summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--.qmake.conf3
-rwxr-xr-xbin/syncqt.pl184
-rw-r--r--config.tests/arch/arch.cpp44
-rw-r--r--config.tests/common/c++11/c++11.cpp10
-rw-r--r--config.tests/common/c++14/c++14.cpp40
-rw-r--r--config.tests/common/c++14/c++14.pro3
-rw-r--r--config.tests/common/c++1z/c++1z.cpp40
-rw-r--r--config.tests/common/c++1z/c++1z.pro3
-rw-r--r--config.tests/common/c++default/c++default.cpp1
-rw-r--r--config.tests/common/c++default/c++default.pro14
-rw-r--r--config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp53
-rw-r--r--config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro12
-rw-r--r--config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp44
-rw-r--r--config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro5
-rw-r--r--config.tests/qpa/gbm/gbm.cpp44
-rw-r--r--config.tests/qpa/gbm/gbm.pro4
-rw-r--r--config.tests/qpa/kms/kms.cpp7
-rw-r--r--config.tests/qpa/kms/kms.pro2
-rw-r--r--config.tests/qpa/mirclient/mirclient.cpp47
-rw-r--r--config.tests/qpa/mirclient/mirclient.pro4
-rw-r--r--config.tests/qpa/wayland-server/wayland-server.pro5
-rw-r--r--config.tests/qpa/wayland-server/wl.cpp40
-rw-r--r--config.tests/unix/cloexec/cloexec.cpp49
-rw-r--r--config.tests/unix/cloexec/cloexec.pro3
-rw-r--r--config.tests/unix/freetype/freetype.pri1
-rw-r--r--config.tests/unix/harfbuzz/harfbuzz.cpp2
-rwxr-xr-xconfig.tests/unix/ptrsize.test32
-rw-r--r--config.tests/unix/ptrsize/ptrsizetest.cpp53
-rw-r--r--config.tests/unix/ptrsize/ptrsizetest.pro3
-rw-r--r--config.tests/unix/syslog/syslog.c42
-rw-r--r--config.tests/unix/syslog/syslog.pro3
-rw-r--r--config.tests/win/directwrite/directwrite.cpp44
-rw-r--r--config.tests/win/directwrite/directwrite.pro4
-rwxr-xr-xconfigure709
-rw-r--r--configure.bat20
-rw-r--r--doc/global/externalsites/external-resources.qdoc2
-rw-r--r--doc/global/externalsites/qt-webpages.qdoc8
-rw-r--r--doc/global/externalsites/qtcreator.qdoc8
-rw-r--r--doc/global/html-header-online.qdocconf3
-rw-r--r--doc/global/manifest-meta.qdocconf8
-rw-r--r--doc/global/qt-cpp-defines.qdocconf7
-rw-r--r--doc/global/qt-html-templates-offline-simple.qdocconf35
-rw-r--r--doc/global/qt-html-templates-offline.qdocconf5
-rw-r--r--doc/global/qt-module-defaults-offline.qdocconf1
-rw-r--r--doc/global/template/scripts/extras.js72
-rw-r--r--doc/global/template/style/list_expand.pngbin0 -> 710 bytes
-rw-r--r--doc/global/template/style/offline-simple.css176
-rw-r--r--doc/global/template/style/offline.css48
-rw-r--r--doc/global/template/style/online.css106
-rw-r--r--doc/src/images/recentfiles-example.pngbin5400 -> 0 bytes
-rw-r--r--examples/dbus/complexpingpong/complexping.cpp14
-rw-r--r--examples/dbus/complexpingpong/complexping.h2
-rw-r--r--examples/dbus/complexpingpong/complexpong.cpp4
-rw-r--r--examples/embedded/digiflip/digiflip.cpp2
-rw-r--r--examples/network/doc/src/fortuneserver.qdoc2
-rw-r--r--examples/network/fortuneclient/client.cpp73
-rw-r--r--examples/network/fortuneclient/client.h7
-rw-r--r--examples/network/fortuneclient/main.cpp1
-rw-r--r--examples/network/fortuneserver/main.cpp1
-rw-r--r--examples/network/fortuneserver/server.cpp43
-rw-r--r--examples/network/fortuneserver/server.h3
-rw-r--r--examples/network/http/authenticationdialog.ui6
-rw-r--r--examples/network/http/httpwindow.cpp274
-rw-r--r--examples/network/http/httpwindow.h31
-rw-r--r--examples/network/http/main.cpp5
-rw-r--r--examples/network/torrent/filemanager.cpp12
-rw-r--r--examples/network/torrent/metainfo.cpp2
-rw-r--r--examples/opengl/2dpainting/window.cpp4
-rw-r--r--examples/opengl/contextinfo/renderwindow.cpp2
-rw-r--r--examples/opengl/contextinfo/widget.cpp2
-rw-r--r--examples/opengl/hellogl2/glwidget.cpp7
-rw-r--r--examples/opengl/hellogl2/main.cpp4
-rw-r--r--examples/opengl/hellogl2/mainwindow.cpp2
-rw-r--r--examples/opengl/hellogl2/window.cpp14
-rw-r--r--examples/opengl/hellogles3/glwindow.cpp281
-rw-r--r--examples/opengl/hellogles3/glwindow.h102
-rw-r--r--examples/opengl/hellogles3/hellogles3.pro11
-rw-r--r--examples/opengl/hellogles3/hellogles3.qrc5
-rw-r--r--examples/opengl/hellogles3/main.cpp78
-rw-r--r--examples/opengl/hellogles3/qtlogo.pngbin0 -> 5402 bytes
-rw-r--r--examples/opengl/hellowindow/hellowindow.cpp4
-rw-r--r--examples/opengl/hellowindow/main.cpp4
-rw-r--r--examples/opengl/opengl.pro3
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.cpp8
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.cpp37
-rw-r--r--examples/opengl/qopenglwindow/main.cpp8
-rw-r--r--examples/opengl/textures/window.cpp6
-rw-r--r--examples/qtconcurrent/map/main.cpp2
-rw-r--r--examples/qtconcurrent/wordcount/main.cpp8
-rw-r--r--examples/sql/books/bookdelegate.cpp2
-rw-r--r--examples/sql/books/books.pro2
-rw-r--r--examples/sql/masterdetail/dialog.cpp2
-rw-r--r--examples/sql/querymodel/customsqlmodel.cpp2
-rw-r--r--examples/webkit/webkit-guide/_copyright.txt40
-rw-r--r--examples/webkit/webkit-guide/_image_assets.htm332
-rw-r--r--examples/webkit/webkit-guide/_index.html320
-rw-r--r--examples/webkit/webkit-guide/anim_accord.htm123
-rw-r--r--examples/webkit/webkit-guide/anim_demo-rotate.htm64
-rw-r--r--examples/webkit/webkit-guide/anim_demo-scale.htm68
-rw-r--r--examples/webkit/webkit-guide/anim_demo-skew.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_gallery.htm115
-rw-r--r--examples/webkit/webkit-guide/anim_panel.htm64
-rw-r--r--examples/webkit/webkit-guide/anim_pulse.htm72
-rw-r--r--examples/webkit/webkit-guide/anim_skew.htm80
-rw-r--r--examples/webkit/webkit-guide/anim_slide1.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_slide2.htm62
-rw-r--r--examples/webkit/webkit-guide/anim_slide3.htm65
-rw-r--r--examples/webkit/webkit-guide/anim_tabbedSkew.htm89
-rw-r--r--examples/webkit/webkit-guide/css/anim_accord.css246
-rw-r--r--examples/webkit/webkit-guide/css/anim_demo-rotate.css95
-rw-r--r--examples/webkit/webkit-guide/css/anim_demo-scale.css112
-rw-r--r--examples/webkit/webkit-guide/css/anim_demo-skew.css98
-rw-r--r--examples/webkit/webkit-guide/css/anim_gallery.css110
-rw-r--r--examples/webkit/webkit-guide/css/anim_panel.css116
-rw-r--r--examples/webkit/webkit-guide/css/anim_pulse.css100
-rw-r--r--examples/webkit/webkit-guide/css/anim_skew.css186
-rw-r--r--examples/webkit/webkit-guide/css/anim_slide.css148
-rw-r--r--examples/webkit/webkit-guide/css/anim_tabbedSkew.css113
-rw-r--r--examples/webkit/webkit-guide/css/css3_backgrounds.css105
-rw-r--r--examples/webkit/webkit-guide/css/css3_border-img.css70
-rw-r--r--examples/webkit/webkit-guide/css/css3_grad-radial.css66
-rw-r--r--examples/webkit/webkit-guide/css/css3_gradientBack.css77
-rw-r--r--examples/webkit/webkit-guide/css/css3_gradientBackStop.css77
-rw-r--r--examples/webkit/webkit-guide/css/css3_gradientButton.css88
-rw-r--r--examples/webkit/webkit-guide/css/css3_mask-grad.css60
-rw-r--r--examples/webkit/webkit-guide/css/css3_mask-img.css58
-rw-r--r--examples/webkit/webkit-guide/css/css3_multicol.css110
-rw-r--r--examples/webkit/webkit-guide/css/css3_reflect.css127
-rw-r--r--examples/webkit/webkit-guide/css/css3_scroll.css93
-rw-r--r--examples/webkit/webkit-guide/css/css3_sel-nth.css63
-rw-r--r--examples/webkit/webkit-guide/css/css3_shadow.css145
-rw-r--r--examples/webkit/webkit-guide/css/css3_shadowBlur.css145
-rw-r--r--examples/webkit/webkit-guide/css/css3_text-overflow.css119
-rw-r--r--examples/webkit/webkit-guide/css/css3_text-shadow.css67
-rw-r--r--examples/webkit/webkit-guide/css/css3_text-stroke.css75
-rw-r--r--examples/webkit/webkit-guide/css/form_tapper.css108
-rw-r--r--examples/webkit/webkit-guide/css/form_toggler.css200
-rw-r--r--examples/webkit/webkit-guide/css/layout_link-fmt.css137
-rw-r--r--examples/webkit/webkit-guide/css/layout_tbl-keyhole.css147
-rw-r--r--examples/webkit/webkit-guide/css/mob_condjs.css55
-rw-r--r--examples/webkit/webkit-guide/css/mob_mediaquery.css49
-rw-r--r--examples/webkit/webkit-guide/css/mobile.css82
-rw-r--r--examples/webkit/webkit-guide/css/mq_desktop.css70
-rw-r--r--examples/webkit/webkit-guide/css/mq_mobile.css69
-rw-r--r--examples/webkit/webkit-guide/css/mq_touch.css69
-rw-r--r--examples/webkit/webkit-guide/css/mqlayout_desktop.css92
-rw-r--r--examples/webkit/webkit-guide/css/mqlayout_mobile.css82
-rw-r--r--examples/webkit/webkit-guide/css/mqlayout_touch.css86
-rw-r--r--examples/webkit/webkit-guide/css/storage.css156
-rw-r--r--examples/webkit/webkit-guide/css3_backgrounds.htm87
-rw-r--r--examples/webkit/webkit-guide/css3_border-img.htm78
-rw-r--r--examples/webkit/webkit-guide/css3_grad-radial.htm62
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBack.htm79
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBackStop.htm93
-rw-r--r--examples/webkit/webkit-guide/css3_gradientButton.htm67
-rw-r--r--examples/webkit/webkit-guide/css3_mask-grad.htm67
-rw-r--r--examples/webkit/webkit-guide/css3_mask-img.htm57
-rw-r--r--examples/webkit/webkit-guide/css3_multicol.htm92
-rw-r--r--examples/webkit/webkit-guide/css3_reflect.htm101
-rw-r--r--examples/webkit/webkit-guide/css3_scroll.htm95
-rw-r--r--examples/webkit/webkit-guide/css3_sel-nth.htm81
-rw-r--r--examples/webkit/webkit-guide/css3_shadow.htm79
-rw-r--r--examples/webkit/webkit-guide/css3_text-overflow.htm118
-rw-r--r--examples/webkit/webkit-guide/css3_text-shadow.htm75
-rw-r--r--examples/webkit/webkit-guide/css3_text-stroke.htm75
-rw-r--r--examples/webkit/webkit-guide/form_tapper.htm75
-rw-r--r--examples/webkit/webkit-guide/form_toggler.htm141
-rw-r--r--examples/webkit/webkit-guide/img/border-frame.pngbin5534 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal1.jpgbin44584 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal2.jpgbin45495 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal3.jpgbin51291 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal4.jpgbin57195 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal5.jpgbin31293 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal6.jpgbin30854 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal7.jpgbin35211 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gal8.jpgbin35269 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gradient.jpgbin710 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/gray_icon_close.pngbin658 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_016.pngbin598 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_032.pngbin1275 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_036.pngbin1803 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ag_048.pngbin1885 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_016.pngbin625 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_032.pngbin1259 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_036.pngbin1755 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_al_048.pngbin1795 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_016.pngbin608 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_032.pngbin1233 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_036.pngbin1777 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ar_048.pngbin1828 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_016.pngbin580 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_032.pngbin1166 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_036.pngbin1668 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_b_048.pngbin1623 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_016.pngbin614 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_032.pngbin1322 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_036.pngbin1811 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_be_048.pngbin1824 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_016.pngbin545 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_032.pngbin1102 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_036.pngbin1595 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_c_048.pngbin1622 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_016.pngbin606 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_032.pngbin1229 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_036.pngbin1771 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ca_048.pngbin1820 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_016.pngbin602 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_032.pngbin1197 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_036.pngbin1731 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cl_048.pngbin1816 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_016.pngbin580 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_032.pngbin1183 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_036.pngbin1742 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_cu_048.pngbin1729 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_016.pngbin539 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_032.pngbin1047 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_036.pngbin1487 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_f_048.pngbin1488 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_016.pngbin591 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_032.pngbin1171 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_036.pngbin1726 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_fe_048.pngbin1745 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_016.pngbin583 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_032.pngbin1135 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_036.pngbin1600 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_h_048.pngbin1644 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_016.pngbin606 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_032.pngbin1179 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_036.pngbin1746 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_he_048.pngbin1675 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_016.pngbin600 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_032.pngbin1189 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_036.pngbin1657 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_k_048.pngbin1706 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_016.pngbin584 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_032.pngbin1125 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_036.pngbin1596 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_li_048.pngbin1691 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_016.pngbin628 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_032.pngbin1286 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_036.pngbin1832 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_mg_048.pngbin1908 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_016.pngbin605 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_032.pngbin1203 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_036.pngbin1728 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_n_048.pngbin1718 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_016.pngbin609 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_032.pngbin1302 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_036.pngbin1811 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_na_048.pngbin1879 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_016.pngbin619 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_032.pngbin1278 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_036.pngbin1798 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ne_048.pngbin1811 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_016.pngbin627 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_032.pngbin1248 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_036.pngbin1805 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_ni_048.pngbin1837 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_016.pngbin580 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_032.pngbin1182 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_036.pngbin1668 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_o_048.pngbin1752 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_016.pngbin600 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_032.pngbin1212 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_036.pngbin1728 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_pt_048.pngbin1675 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_016.pngbin588 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_032.pngbin1198 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_036.pngbin1761 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_si_048.pngbin1820 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_016.pngbin572 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_032.pngbin1164 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_036.pngbin1689 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/ic_zn_048.pngbin1721 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_check.pngbin678 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_check_x24green.pngbin776 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_dismiss.pngbin613 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_dismiss_x22.pngbin539 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-down.pngbin605 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-down_x32.pngbin3593 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-up.pngbin592 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_drill-up_x32.pngbin3685 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_expand-nav.pngbin675 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-collapsed.pngbin285 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-collapsed_x13.pngbin201 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-expanded.pngbin295 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_head-expanded_x13.pngbin3017 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_info.pngbin512 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_info_x24.pngbin652 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-doc.pngbin610 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-email.pngbin542 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-external.pngbin1106 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-pdf.pngbin637 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-ppt.pngbin536 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-rss.pngbin684 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-sms.pngbin1086 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-tel.pngbin1205 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_link-xls.pngbin603 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_list-all.pngbin545 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_list-all_circ.pngbin665 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav-start.pngbin594 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav-top.pngbin634 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav-up.pngbin551 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_nav_end.pngbin643 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_question.pngbin802 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_scroll-left.pngbin660 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_scroll-right.pngbin682 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/icon_trash.pngbin717 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land1.jpgbin40695 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land2.jpgbin38387 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land3.jpgbin27180 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land4.jpgbin45132 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land5.jpgbin85110 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land6.jpgbin38369 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land7.jpgbin38923 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/land8.jpgbin54475 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/mask.pngbin5842 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal1.jpgbin44584 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal2.jpgbin45495 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal3.jpgbin51291 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal4.jpgbin57195 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal5.jpgbin31293 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal6.jpgbin30854 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal7.jpgbin35211 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/gal8.jpgbin35269 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land1.jpgbin40695 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land2.jpgbin38387 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land3.jpgbin27180 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land4.jpgbin45132 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land5.jpgbin85110 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land6.jpgbin38369 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land7.jpgbin38923 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tmp/land8.jpgbin54475 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal1.pngbin16437 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal2.pngbin14736 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal3.pngbin15882 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal4.pngbin18863 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal5.pngbin15854 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal6.pngbin17339 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal7.pngbin17102 -> 0 bytes
-rw-r--r--examples/webkit/webkit-guide/img/tnail_gal8.pngbin17933 -> 0 bytes
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_accord.js78
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_gallery.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_panel.js53
-rwxr-xr-xexamples/webkit/webkit-guide/js/anim_skew.js97
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_backgrounds.js49
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_border-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_grad-radial.js75
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-grad.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_mask-img.js44
-rwxr-xr-xexamples/webkit/webkit-guide/js/css3_text-overflow.js54
-rwxr-xr-xexamples/webkit/webkit-guide/js/form_tapper.js57
-rwxr-xr-xexamples/webkit/webkit-guide/js/mob_condjs.js79
-rwxr-xr-xexamples/webkit/webkit-guide/js/mobile.js50
-rwxr-xr-xexamples/webkit/webkit-guide/js/storage.js94
-rw-r--r--examples/webkit/webkit-guide/layout_link-fmt.htm82
-rw-r--r--examples/webkit/webkit-guide/layout_tbl-keyhole.htm142
-rw-r--r--examples/webkit/webkit-guide/mob_condjs.htm66
-rw-r--r--examples/webkit/webkit-guide/mob_layout.htm60
-rw-r--r--examples/webkit/webkit-guide/mob_mediaquery.htm60
-rw-r--r--examples/webkit/webkit-guide/storage.htm72
-rw-r--r--examples/webkit/webkit-guide/webkit-guide.pro256
-rw-r--r--examples/widgets/desktop/screenshot/main.cpp3
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.cpp139
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.h11
-rw-r--r--examples/widgets/desktop/systray/doc/src/systray.qdoc6
-rw-r--r--examples/widgets/desktop/systray/window.cpp30
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.cpp58
-rw-r--r--examples/widgets/dialogs/configdialog/configdialog.cpp6
-rw-r--r--examples/widgets/dialogs/extension/finddialog.cpp2
-rw-r--r--examples/widgets/dialogs/findfiles/window.cpp19
-rw-r--r--examples/widgets/dialogs/findfiles/window.h1
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.cpp10
-rw-r--r--examples/widgets/dialogs/sipdialog/dialog.cpp7
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.cpp63
-rw-r--r--examples/widgets/dialogs/standarddialogs/main.cpp9
-rw-r--r--examples/widgets/dialogs/tabdialog/tabdialog.cpp4
-rw-r--r--examples/widgets/doc/images/regularexpression-example.pngbin0 -> 78860 bytes
-rw-r--r--examples/widgets/doc/images/systemtray-editor.pngbin0 -> 18147 bytes
-rw-r--r--examples/widgets/doc/images/systemtray-example.pngbin0 -> 47588 bytes
-rw-r--r--examples/widgets/doc/src/application.qdoc75
-rw-r--r--examples/widgets/doc/src/codeeditor.qdoc2
-rw-r--r--examples/widgets/doc/src/findfiles.qdoc7
-rw-r--r--examples/widgets/doc/src/icons.qdoc117
-rw-r--r--examples/widgets/doc/src/imageviewer.qdoc11
-rw-r--r--examples/widgets/doc/src/plugandpaint.qdoc6
-rw-r--r--examples/widgets/doc/src/recentfiles.qdoc37
-rw-r--r--examples/widgets/doc/src/regularexpression.qdoc48
-rw-r--r--examples/widgets/doc/src/screenshot.qdoc90
-rw-r--r--examples/widgets/doc/src/syntaxhighlighter.qdoc2
-rw-r--r--examples/widgets/doc/src/systray.qdoc179
-rw-r--r--examples/widgets/doc/src/tablet.qdoc24
-rw-r--r--examples/widgets/doc/src/tetrix.qdoc2
-rw-r--r--examples/widgets/draganddrop/draggableicons/main.cpp3
-rw-r--r--examples/widgets/draganddrop/draggabletext/draggabletext.pro6
-rw-r--r--examples/widgets/draganddrop/draggabletext/draglabel.cpp49
-rw-r--r--examples/widgets/draganddrop/draggabletext/draglabel.h58
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.cpp45
-rw-r--r--examples/widgets/draganddrop/dropsite/droparea.cpp6
-rw-r--r--examples/widgets/draganddrop/dropsite/dropsitewindow.cpp27
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp19
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/main.cpp2
-rw-r--r--examples/widgets/draganddrop/puzzle/main.cpp2
-rw-r--r--examples/widgets/draganddrop/puzzle/mainwindow.cpp47
-rw-r--r--examples/widgets/draganddrop/puzzle/mainwindow.h3
-rw-r--r--examples/widgets/draganddrop/puzzle/pieceslist.cpp10
-rw-r--r--examples/widgets/draganddrop/puzzle/pieceslist.h2
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzle.pro2
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.cpp26
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.h1
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.cpp11
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.h1
-rw-r--r--examples/widgets/gestures/imagegestures/mainwidget.h2
-rw-r--r--examples/widgets/graphicsview/boxes/scene.cpp4
-rw-r--r--examples/widgets/itemviews/addressbook/adddialog.cpp4
-rw-r--r--examples/widgets/itemviews/addressbook/addresswidget.cpp10
-rw-r--r--examples/widgets/itemviews/addressbook/addresswidget.h2
-rw-r--r--examples/widgets/itemviews/addressbook/mainwindow.cpp16
-rw-r--r--examples/widgets/itemviews/addressbook/newaddresstab.cpp2
-rw-r--r--examples/widgets/itemviews/basicsortfiltermodel/window.cpp22
-rw-r--r--examples/widgets/itemviews/chart/mainwindow.cpp27
-rw-r--r--examples/widgets/itemviews/chart/mainwindow.h3
-rw-r--r--examples/widgets/itemviews/combowidgetmapper/window.cpp12
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp6
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/window.cpp14
-rw-r--r--examples/widgets/itemviews/editabletreemodel/mainwindow.cpp30
-rw-r--r--examples/widgets/itemviews/editabletreemodel/mainwindow.h4
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.cpp2
-rw-r--r--examples/widgets/itemviews/fetchmore/window.cpp12
-rw-r--r--examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp18
-rw-r--r--examples/widgets/itemviews/frozencolumn/main.cpp6
-rw-r--r--examples/widgets/itemviews/interview/model.cpp2
-rw-r--r--examples/widgets/itemviews/pixelator/mainwindow.cpp17
-rw-r--r--examples/widgets/itemviews/puzzle/main.cpp2
-rw-r--r--examples/widgets/itemviews/puzzle/mainwindow.cpp45
-rw-r--r--examples/widgets/itemviews/puzzle/mainwindow.h3
-rw-r--r--examples/widgets/itemviews/simpledommodel/dommodel.cpp2
-rw-r--r--examples/widgets/itemviews/simpledommodel/mainwindow.cpp4
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.cpp2
-rw-r--r--examples/widgets/itemviews/simplewidgetmapper/window.cpp6
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheet.cpp50
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp2
-rw-r--r--examples/widgets/itemviews/stardelegate/stardelegate.cpp4
-rw-r--r--examples/widgets/mainwindows/application/main.cpp16
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.cpp196
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.h21
-rw-r--r--examples/widgets/mainwindows/dockwidgets/mainwindow.cpp95
-rw-r--r--examples/widgets/mainwindows/dockwidgets/mainwindow.h14
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.cpp211
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.h78
-rw-r--r--examples/widgets/mainwindows/mainwindow/main.cpp67
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp215
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.h31
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.cpp88
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.h66
-rw-r--r--examples/widgets/mainwindows/mainwindows.pro1
-rw-r--r--examples/widgets/mainwindows/mdi/main.cpp2
-rw-r--r--examples/widgets/mainwindows/mdi/mainwindow.cpp334
-rw-r--r--examples/widgets/mainwindows/mdi/mainwindow.h31
-rw-r--r--examples/widgets/mainwindows/mdi/mdichild.cpp39
-rw-r--r--examples/widgets/mainwindows/menus/mainwindow.cpp44
-rw-r--r--examples/widgets/mainwindows/recentfiles/main.cpp53
-rw-r--r--examples/widgets/mainwindows/recentfiles/mainwindow.cpp251
-rw-r--r--examples/widgets/mainwindows/recentfiles/mainwindow.h96
-rw-r--r--examples/widgets/mainwindows/recentfiles/recentfiles.pro9
-rw-r--r--examples/widgets/mainwindows/sdi/main.cpp25
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.cpp350
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.h41
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.cpp2
-rw-r--r--examples/widgets/painting/shared/arthurstyle.cpp4
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/widgets/richtext/textedit/main.cpp24
-rw-r--r--examples/widgets/richtext/textedit/textedit.cpp375
-rw-r--r--examples/widgets/richtext/textedit/textedit.h22
-rw-r--r--examples/widgets/tools/regexp/regexpdialog.cpp4
-rw-r--r--examples/widgets/tools/regularexpression/images/copy.pngbin0 -> 1338 bytes
-rw-r--r--examples/widgets/tools/regularexpression/main.cpp51
-rw-r--r--examples/widgets/tools/regularexpression/regularexpression.pro11
-rw-r--r--examples/widgets/tools/regularexpression/regularexpression.qrc5
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.cpp349
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.h100
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.cpp50
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.h2
-rw-r--r--examples/widgets/tools/settingseditor/main.cpp3
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.cpp182
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.h18
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.cpp49
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.h8
-rw-r--r--examples/widgets/tools/settingseditor/variantdelegate.cpp4
-rw-r--r--examples/widgets/tools/tools.pro1
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.cpp17
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/mymodel.cpp2
-rw-r--r--examples/widgets/widgets/calculator/calculator.cpp2
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.cpp134
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.h9
-rw-r--r--examples/widgets/widgets/icons/icons.pro4
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.cpp12
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.h2
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.cpp18
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.h2
-rw-r--r--examples/widgets/widgets/icons/main.cpp26
-rw-r--r--examples/widgets/widgets/icons/mainwindow.cpp475
-rw-r--r--examples/widgets/widgets/icons/mainwindow.h49
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp214
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.h17
-rw-r--r--examples/widgets/widgets/movie/movie.pro2
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.cpp2
-rw-r--r--examples/widgets/widgets/tablet/images.qrc8
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-airbrush.pngbin0 -> 823 bytes
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-eraser.pngbin0 -> 1454 bytes
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-felt-marker.pngbin0 -> 513 bytes
-rw-r--r--examples/widgets/widgets/tablet/images/cursor-pencil.pngbin0 -> 1307 bytes
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.cpp11
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.h1
-rw-r--r--examples/widgets/widgets/tablet/tablet.pro11
-rw-r--r--examples/widgets/widgets/tablet/tabletapplication.cpp3
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.cpp151
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.h15
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro2
-rw-r--r--examples/xml/htmlinfo/main.cpp2
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro2
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.cpp4
-rw-r--r--header.COMM20
-rw-r--r--mkspecs/aix-g++-64/qmake.conf3
-rw-r--r--mkspecs/aix-g++/qmake.conf3
-rw-r--r--mkspecs/aix-xlc-64/qmake.conf3
-rw-r--r--mkspecs/aix-xlc/qmake.conf3
-rw-r--r--mkspecs/common/angle.conf9
-rw-r--r--mkspecs/common/armcc.conf44
-rw-r--r--mkspecs/common/clang-mac.conf4
-rw-r--r--mkspecs/common/clang.conf7
-rw-r--r--mkspecs/common/g++-base.conf7
-rw-r--r--mkspecs/common/gcc-base-mac.conf8
-rw-r--r--mkspecs/common/gcc-base-unix.conf1
-rw-r--r--mkspecs/common/ios/clang.conf2
-rw-r--r--mkspecs/common/linux.conf7
-rw-r--r--mkspecs/common/mac.conf7
-rw-r--r--mkspecs/common/mac/qplatformdefs.h1
-rw-r--r--mkspecs/common/msvc-base.conf56
-rw-r--r--mkspecs/common/msvc-desktop.conf61
-rw-r--r--mkspecs/common/qcc-base-qnx-armle-v7.conf3
-rw-r--r--mkspecs/common/qcc-base-qnx-x86.conf3
-rw-r--r--mkspecs/common/qcc-base-qnx.conf5
-rw-r--r--mkspecs/common/unix.conf1
-rw-r--r--mkspecs/common/wince/qmake.conf11
-rw-r--r--mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in5
-rw-r--r--mkspecs/common/winrt_winphone/manifests/8.1/AppxManifest.xml.in3
-rw-r--r--mkspecs/common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in3
-rw-r--r--mkspecs/common/winrt_winphone/qmake.conf22
-rw-r--r--mkspecs/cygwin-g++/qmake.conf7
-rw-r--r--mkspecs/darwin-g++/qmake.conf3
-rw-r--r--mkspecs/devices/common/linux_device_post.conf4
-rw-r--r--mkspecs/devices/common/linux_device_pre.conf3
-rw-r--r--mkspecs/devices/linux-arm-generic-g++/qmake.conf9
-rw-r--r--mkspecs/devices/linux-arm-generic-g++/qplatformdefs.h34
-rw-r--r--mkspecs/devices/linux-beagleboard-g++/qmake.conf7
-rw-r--r--mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf38
-rw-r--r--mkspecs/devices/linux-jetson-tk1-pro-g++/qplatformdefs.h34
-rw-r--r--mkspecs/devices/linux-nuc-g++/qmake.conf20
-rw-r--r--mkspecs/devices/linux-nuc-g++/qplatformdefs.h34
-rw-r--r--mkspecs/devices/linux-rasp-pi-g++/qmake.conf3
-rw-r--r--mkspecs/devices/linux-rasp-pi2-g++/qmake.conf6
-rw-r--r--mkspecs/features/android/android.prf2
-rw-r--r--mkspecs/features/c++11.prf10
-rw-r--r--mkspecs/features/c++14.prf17
-rw-r--r--mkspecs/features/ctest_testcase_common.prf1
-rw-r--r--mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in4
-rw-r--r--mkspecs/features/data/unix/findclasslist.pl58
-rw-r--r--mkspecs/features/default_post.prf17
-rw-r--r--mkspecs/features/default_pre.prf2
-rw-r--r--mkspecs/features/device_config.prf9
-rw-r--r--mkspecs/features/exclusive_builds.prf3
-rw-r--r--mkspecs/features/gcov.prf1
-rw-r--r--mkspecs/features/lex.prf23
-rw-r--r--mkspecs/features/mac/default_post.prf40
-rw-r--r--mkspecs/features/mac/objective_c.prf27
-rw-r--r--mkspecs/features/mac/sdk.prf5
-rw-r--r--mkspecs/features/plugin_bundle.prf2
-rw-r--r--mkspecs/features/qgltf.prf11
-rw-r--r--mkspecs/features/qml_plugin.prf7
-rw-r--r--mkspecs/features/qt.prf179
-rw-r--r--mkspecs/features/qt_app.prf3
-rw-r--r--mkspecs/features/qt_build_config.prf9
-rw-r--r--mkspecs/features/qt_build_paths.prf11
-rw-r--r--mkspecs/features/qt_clear_installs.prf12
-rw-r--r--mkspecs/features/qt_common.prf16
-rw-r--r--mkspecs/features/qt_docs.prf48
-rw-r--r--mkspecs/features/qt_docs_targets.prf20
-rw-r--r--mkspecs/features/qt_example_installs.prf4
-rw-r--r--mkspecs/features/qt_functions.prf234
-rw-r--r--mkspecs/features/qt_module.prf93
-rw-r--r--mkspecs/features/qt_module_headers.prf76
-rw-r--r--mkspecs/features/qt_module_pris.prf88
-rw-r--r--mkspecs/features/qt_plugin.prf2
-rw-r--r--mkspecs/features/qt_tool.prf3
-rw-r--r--mkspecs/features/resolve_target.prf6
-rw-r--r--mkspecs/features/resources.prf60
-rw-r--r--mkspecs/features/spec_pre.prf2
-rw-r--r--mkspecs/features/testcase.prf27
-rw-r--r--mkspecs/features/unix/hide_symbols.prf1
-rw-r--r--mkspecs/features/warn_off.prf1
-rw-r--r--mkspecs/features/warn_on.prf1
-rw-r--r--mkspecs/features/win32/idcidl.prf2
-rw-r--r--mkspecs/features/win32/windows.prf2
-rw-r--r--mkspecs/features/winrt/font_deployment.prf62
-rw-r--r--mkspecs/features/winrt/package_manifest.prf8
-rw-r--r--mkspecs/features/yacc.prf18
-rw-r--r--mkspecs/freebsd-g++/qmake.conf3
-rw-r--r--mkspecs/freebsd-g++46/qmake.conf3
-rw-r--r--mkspecs/freebsd-icc/qmake.conf3
-rw-r--r--mkspecs/haiku-g++/qmake.conf4
-rw-r--r--mkspecs/hpux-acc-64/qmake.conf3
-rw-r--r--mkspecs/hpux-acc-o64/qmake.conf3
-rw-r--r--mkspecs/hpux-acc/qmake.conf3
-rw-r--r--mkspecs/hpux-g++-64/qmake.conf3
-rw-r--r--mkspecs/hpux-g++/qmake.conf3
-rw-r--r--mkspecs/hpuxi-acc-32/qmake.conf3
-rw-r--r--mkspecs/hpuxi-acc-64/qmake.conf3
-rw-r--r--mkspecs/hpuxi-g++-64/qmake.conf3
-rw-r--r--mkspecs/hurd-g++/qmake.conf3
-rw-r--r--mkspecs/irix-cc-64/qmake.conf3
-rw-r--r--mkspecs/irix-cc/qmake.conf3
-rw-r--r--mkspecs/irix-g++-64/qmake.conf3
-rw-r--r--mkspecs/irix-g++/qmake.conf3
-rw-r--r--mkspecs/linux-cxx/qmake.conf3
-rw-r--r--mkspecs/linux-g++-32/qmake.conf4
-rw-r--r--mkspecs/linux-g++-64/qmake.conf3
-rw-r--r--mkspecs/linux-g++/qplatformdefs.h6
-rw-r--r--mkspecs/linux-icc/qmake.conf16
-rw-r--r--mkspecs/linux-kcc/qmake.conf3
-rw-r--r--mkspecs/linux-pgcc/qmake.conf3
-rw-r--r--mkspecs/lynxos-g++/qmake.conf3
-rw-r--r--mkspecs/macx-clang-32/qmake.conf1
-rw-r--r--mkspecs/macx-g++-32/qmake.conf1
-rw-r--r--mkspecs/macx-icc/qmake.conf17
-rw-r--r--[-rwxr-xr-x]mkspecs/macx-ios-clang/Info.plist.app0
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf184
-rw-r--r--mkspecs/macx-ios-clang/features/exclusive_builds_post.prf8
-rw-r--r--mkspecs/macx-ios-clang/features/qt.prf34
-rw-r--r--mkspecs/macx-ios-clang/features/resolve_config.prf64
-rw-r--r--mkspecs/macx-ios-clang/features/testcase.prf12
-rw-r--r--mkspecs/macx-ios-clang/features/testcase_targets.prf3
-rw-r--r--mkspecs/macx-ios-clang/features/xcodebuild.prf49
-rwxr-xr-xmkspecs/macx-ios-clang/ios_destinations.sh55
-rw-r--r--mkspecs/macx-ios-clang/qmake.conf2
-rwxr-xr-xmkspecs/macx-ios-clang/rename_main.sh78
-rw-r--r--mkspecs/macx-ios-clang/xcodebuild.mk100
-rw-r--r--mkspecs/macx-xcode/default.xcscheme7
-rw-r--r--mkspecs/netbsd-g++/qmake.conf3
-rw-r--r--mkspecs/openbsd-g++/qmake.conf3
-rw-r--r--mkspecs/sco-g++/qmake.conf3
-rw-r--r--mkspecs/solaris-cc-64/qmake.conf3
-rw-r--r--mkspecs/solaris-cc/qmake.conf3
-rw-r--r--mkspecs/solaris-g++-64/qmake.conf3
-rw-r--r--mkspecs/solaris-g++/qmake.conf3
-rw-r--r--mkspecs/tru64-cxx/qmake.conf3
-rw-r--r--mkspecs/tru64-g++/qmake.conf3
-rw-r--r--mkspecs/unixware-cc/qmake.conf3
-rw-r--r--mkspecs/unixware-g++/qmake.conf3
-rw-r--r--mkspecs/unsupported/freebsd-clang/qmake.conf4
-rw-r--r--mkspecs/unsupported/linux-armcc/qmake.conf29
-rw-r--r--mkspecs/unsupported/linux-armcc/qplatformdefs.h92
-rw-r--r--mkspecs/unsupported/linux-host-g++/qmake.conf4
-rw-r--r--mkspecs/unsupported/qnx-X11-g++/qmake.conf2
-rw-r--r--mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf3
-rw-r--r--mkspecs/unsupported/vxworks-ppc-g++/qmake.conf3
-rw-r--r--mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf3
-rw-r--r--mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf3
-rw-r--r--mkspecs/win32-g++/qmake.conf18
-rw-r--r--mkspecs/win32-g++/qplatformdefs.h1
-rw-r--r--mkspecs/win32-icc/qmake.conf12
-rw-r--r--mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf2
-rw-r--r--mkspecs/wince80colibri-armv7-msvc2012/qmake.conf17
-rw-r--r--mkspecs/winphone-arm-msvc2013/qmake.conf1
-rw-r--r--mkspecs/winphone-x86-msvc2013/qmake.conf1
-rw-r--r--mkspecs/winrt-arm-msvc2013/qmake.conf2
-rw-r--r--mkspecs/winrt-arm-msvc2015/qmake.conf7
-rw-r--r--mkspecs/winrt-x64-msvc2015/qmake.conf7
-rw-r--r--mkspecs/winrt-x86-msvc2013/qmake.conf2
-rw-r--r--mkspecs/winrt-x86-msvc2015/qmake.conf8
-rw-r--r--qmake/Makefile.unix7
-rw-r--r--qmake/Makefile.win324
-rw-r--r--qmake/doc/snippets/code/doc_src_qmake-manual.pro21
-rw-r--r--qmake/doc/src/qmake-manual.qdoc147
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp49
-rw-r--r--qmake/generators/makefile.cpp167
-rw-r--r--qmake/generators/makefile.h9
-rw-r--r--qmake/generators/makefiledeps.cpp564
-rw-r--r--qmake/generators/projectgenerator.cpp2
-rw-r--r--qmake/generators/unix/unixmake.cpp459
-rw-r--r--qmake/generators/unix/unixmake.h3
-rw-r--r--qmake/generators/unix/unixmake2.cpp151
-rw-r--r--qmake/generators/win32/cesdkhandler.cpp22
-rw-r--r--qmake/generators/win32/mingw_make.cpp117
-rw-r--r--qmake/generators/win32/mingw_make.h3
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp2
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp49
-rw-r--r--qmake/generators/win32/msvc_nmake.h1
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp8
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp82
-rw-r--r--qmake/generators/win32/msvc_vcproj.h1
-rw-r--r--qmake/generators/win32/winmakefile.cpp315
-rw-r--r--qmake/generators/win32/winmakefile.h6
-rw-r--r--qmake/library/ioutils.cpp4
-rw-r--r--qmake/library/proitems.cpp4
-rw-r--r--qmake/library/proitems.h1
-rw-r--r--qmake/library/qmakebuiltins.cpp43
-rw-r--r--qmake/library/qmakeevaluator.cpp42
-rw-r--r--qmake/library/qmakeevaluator.h10
-rw-r--r--qmake/library/qmakeglobals.cpp50
-rw-r--r--qmake/library/qmakeparser.cpp25
-rw-r--r--qmake/library/qmakeparser.h5
-rw-r--r--qmake/library/qmakevfs.cpp17
-rw-r--r--qmake/library/qmakevfs.h2
-rw-r--r--qmake/meta.cpp16
-rw-r--r--qmake/meta.h12
-rw-r--r--qmake/option.cpp7
-rw-r--r--qmake/option.h4
-rw-r--r--qtbase.pro5
-rw-r--r--[-rwxr-xr-x]src/3rdparty/angle/include/KHR/khrplatform.h0
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp1
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp46
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h4
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp30
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h7
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp4
-rw-r--r--src/3rdparty/easing/easing.cpp18
-rw-r--r--src/3rdparty/forkfd/forkfd.c135
-rw-r--r--src/3rdparty/freetype/README11
-rw-r--r--src/3rdparty/freetype/builds/unix/ftsystem.c2
-rw-r--r--src/3rdparty/freetype/docs/CHANGES188
-rw-r--r--src/3rdparty/freetype/docs/CUSTOMIZE17
-rw-r--r--src/3rdparty/freetype/docs/DEBUG2
-rw-r--r--src/3rdparty/freetype/docs/TODO2
-rw-r--r--src/3rdparty/freetype/freetype.pro4
-rw-r--r--src/3rdparty/freetype/include/config/ftconfig.h450
-rw-r--r--src/3rdparty/freetype/include/config/ftheader.h832
-rw-r--r--src/3rdparty/freetype/include/config/ftoption.h899
-rw-r--r--src/3rdparty/freetype/include/config/ftstdlib.h174
-rw-r--r--src/3rdparty/freetype/include/freetype.h4048
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftconfig.h467
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftheader.h834
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftmodule.h (renamed from src/3rdparty/freetype/include/config/ftmodule.h)0
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftoption.h886
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftstdlib.h174
-rw-r--r--src/3rdparty/freetype/include/freetype/freetype.h4204
-rw-r--r--src/3rdparty/freetype/include/freetype/ftadvanc.h187
-rw-r--r--src/3rdparty/freetype/include/freetype/ftautoh.h450
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbbox.h101
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbdf.h210
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbitmap.h240
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbzip2.h102
-rw-r--r--src/3rdparty/freetype/include/freetype/ftcache.h1057
-rw-r--r--src/3rdparty/freetype/include/freetype/ftcffdrv.h262
-rw-r--r--src/3rdparty/freetype/include/freetype/ftchapters.h135
-rw-r--r--src/3rdparty/freetype/include/freetype/ftcid.h168
-rw-r--r--src/3rdparty/freetype/include/freetype/fterrdef.h276
-rw-r--r--src/3rdparty/freetype/include/freetype/fterrors.h216
-rw-r--r--src/3rdparty/freetype/include/freetype/ftfntfmt.h92
-rw-r--r--src/3rdparty/freetype/include/freetype/ftgasp.h129
-rw-r--r--src/3rdparty/freetype/include/freetype/ftglyph.h605
-rw-r--r--src/3rdparty/freetype/include/freetype/ftgxval.h357
-rw-r--r--src/3rdparty/freetype/include/freetype/ftgzip.h148
-rw-r--r--src/3rdparty/freetype/include/freetype/ftimage.h1214
-rw-r--r--src/3rdparty/freetype/include/freetype/ftincrem.h354
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlcdfil.h251
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlist.h276
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlzw.h99
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmac.h274
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmm.h379
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmodapi.h669
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmoderr.h194
-rw-r--r--src/3rdparty/freetype/include/freetype/ftotval.h204
-rw-r--r--src/3rdparty/freetype/include/freetype/ftoutln.h574
-rw-r--r--src/3rdparty/freetype/include/freetype/ftpfr.h172
-rw-r--r--src/3rdparty/freetype/include/freetype/ftrender.h232
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsizes.h159
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsnames.h200
-rw-r--r--src/3rdparty/freetype/include/freetype/ftstroke.h785
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsynth.h84
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsystem.h355
-rw-r--r--src/3rdparty/freetype/include/freetype/fttrigon.h350
-rw-r--r--src/3rdparty/freetype/include/freetype/ftttdrv.h310
-rw-r--r--src/3rdparty/freetype/include/freetype/fttypes.h602
-rw-r--r--src/3rdparty/freetype/include/freetype/ftwinfnt.h275
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/autohint.h244
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftcalc.h418
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftdebug.h255
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftdriver.h409
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftgloadr.h172
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftmemory.h386
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftobjs.h1571
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftpic.h71
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftrfork.h266
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftserv.h763
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftstream.h536
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/fttrace.h154
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftvalid.h159
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/internal.h63
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/psaux.h877
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/pshints.h722
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svbdf.h82
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svcid.h90
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h55
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svgldict.h88
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svgxval.h72
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svkern.h51
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svmm.h113
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svotval.h55
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpfr.h66
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h81
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svprop.h81
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h177
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h111
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h103
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h106
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svtteng.h53
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h69
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h50
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/sfnt.h748
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/t1types.h255
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/tttypes.h1526
-rw-r--r--src/3rdparty/freetype/include/freetype/t1tables.h761
-rw-r--r--src/3rdparty/freetype/include/freetype/ttnameid.h1237
-rw-r--r--src/3rdparty/freetype/include/freetype/tttables.h829
-rw-r--r--src/3rdparty/freetype/include/freetype/tttags.h111
-rw-r--r--src/3rdparty/freetype/include/freetype/ttunpat.h60
-rw-r--r--src/3rdparty/freetype/include/ft2build.h4
-rw-r--r--src/3rdparty/freetype/include/ftadvanc.h187
-rw-r--r--src/3rdparty/freetype/include/ftautoh.h402
-rw-r--r--src/3rdparty/freetype/include/ftbbox.h101
-rw-r--r--src/3rdparty/freetype/include/ftbdf.h210
-rw-r--r--src/3rdparty/freetype/include/ftbitmap.h232
-rw-r--r--src/3rdparty/freetype/include/ftbzip2.h102
-rw-r--r--src/3rdparty/freetype/include/ftcache.h1057
-rw-r--r--src/3rdparty/freetype/include/ftcffdrv.h262
-rw-r--r--src/3rdparty/freetype/include/ftchapters.h121
-rw-r--r--src/3rdparty/freetype/include/ftcid.h167
-rw-r--r--src/3rdparty/freetype/include/fterrdef.h249
-rw-r--r--src/3rdparty/freetype/include/fterrors.h198
-rw-r--r--src/3rdparty/freetype/include/ftgasp.h129
-rw-r--r--src/3rdparty/freetype/include/ftglyph.h605
-rw-r--r--src/3rdparty/freetype/include/ftgxval.h357
-rw-r--r--src/3rdparty/freetype/include/ftgzip.h148
-rw-r--r--src/3rdparty/freetype/include/ftimage.h1220
-rw-r--r--src/3rdparty/freetype/include/ftincrem.h354
-rw-r--r--src/3rdparty/freetype/include/ftlcdfil.h251
-rw-r--r--src/3rdparty/freetype/include/ftlist.h276
-rw-r--r--src/3rdparty/freetype/include/ftlzw.h99
-rw-r--r--src/3rdparty/freetype/include/ftmac.h274
-rw-r--r--src/3rdparty/freetype/include/ftmm.h373
-rw-r--r--src/3rdparty/freetype/include/ftmodapi.h667
-rw-r--r--src/3rdparty/freetype/include/ftmoderr.h194
-rw-r--r--src/3rdparty/freetype/include/ftotval.h204
-rw-r--r--src/3rdparty/freetype/include/ftoutln.h574
-rw-r--r--src/3rdparty/freetype/include/ftpfr.h172
-rw-r--r--src/3rdparty/freetype/include/ftrender.h237
-rw-r--r--src/3rdparty/freetype/include/ftsizes.h159
-rw-r--r--src/3rdparty/freetype/include/ftsnames.h200
-rw-r--r--src/3rdparty/freetype/include/ftstroke.h785
-rw-r--r--src/3rdparty/freetype/include/ftsynth.h82
-rw-r--r--src/3rdparty/freetype/include/ftsystem.h355
-rw-r--r--src/3rdparty/freetype/include/fttrigon.h350
-rw-r--r--src/3rdparty/freetype/include/ftttdrv.h170
-rw-r--r--src/3rdparty/freetype/include/fttypes.h602
-rw-r--r--src/3rdparty/freetype/include/ftwinfnt.h275
-rw-r--r--src/3rdparty/freetype/include/ftxf86.h84
-rw-r--r--src/3rdparty/freetype/include/internal/autohint.h244
-rw-r--r--src/3rdparty/freetype/include/internal/ftcalc.h406
-rw-r--r--src/3rdparty/freetype/include/internal/ftdebug.h255
-rw-r--r--src/3rdparty/freetype/include/internal/ftdriver.h409
-rw-r--r--src/3rdparty/freetype/include/internal/ftgloadr.h170
-rw-r--r--src/3rdparty/freetype/include/internal/ftmemory.h378
-rw-r--r--src/3rdparty/freetype/include/internal/ftobjs.h1571
-rw-r--r--src/3rdparty/freetype/include/internal/ftpic.h71
-rw-r--r--src/3rdparty/freetype/include/internal/ftrfork.h266
-rw-r--r--src/3rdparty/freetype/include/internal/ftserv.h763
-rw-r--r--src/3rdparty/freetype/include/internal/ftstream.h536
-rw-r--r--src/3rdparty/freetype/include/internal/fttrace.h154
-rw-r--r--src/3rdparty/freetype/include/internal/ftvalid.h159
-rw-r--r--src/3rdparty/freetype/include/internal/internal.h63
-rw-r--r--src/3rdparty/freetype/include/internal/psaux.h877
-rw-r--r--src/3rdparty/freetype/include/internal/pshints.h722
-rw-r--r--src/3rdparty/freetype/include/internal/services/svbdf.h82
-rw-r--r--src/3rdparty/freetype/include/internal/services/svcid.h89
-rw-r--r--src/3rdparty/freetype/include/internal/services/svgldict.h88
-rw-r--r--src/3rdparty/freetype/include/internal/services/svgxval.h72
-rw-r--r--src/3rdparty/freetype/include/internal/services/svkern.h51
-rw-r--r--src/3rdparty/freetype/include/internal/services/svmm.h113
-rw-r--r--src/3rdparty/freetype/include/internal/services/svotval.h55
-rw-r--r--src/3rdparty/freetype/include/internal/services/svpfr.h66
-rw-r--r--src/3rdparty/freetype/include/internal/services/svpostnm.h81
-rw-r--r--src/3rdparty/freetype/include/internal/services/svprop.h81
-rw-r--r--src/3rdparty/freetype/include/internal/services/svpscmap.h177
-rw-r--r--src/3rdparty/freetype/include/internal/services/svpsinfo.h111
-rw-r--r--src/3rdparty/freetype/include/internal/services/svsfnt.h103
-rw-r--r--src/3rdparty/freetype/include/internal/services/svttcmap.h107
-rw-r--r--src/3rdparty/freetype/include/internal/services/svtteng.h53
-rw-r--r--src/3rdparty/freetype/include/internal/services/svttglyf.h68
-rw-r--r--src/3rdparty/freetype/include/internal/services/svwinfnt.h50
-rw-r--r--src/3rdparty/freetype/include/internal/services/svxf86nm.h55
-rw-r--r--src/3rdparty/freetype/include/internal/sfnt.h711
-rw-r--r--src/3rdparty/freetype/include/internal/t1types.h255
-rw-r--r--src/3rdparty/freetype/include/internal/tttypes.h1516
-rw-r--r--src/3rdparty/freetype/include/t1tables.h760
-rw-r--r--src/3rdparty/freetype/include/ttnameid.h1237
-rw-r--r--src/3rdparty/freetype/include/tttables.h829
-rw-r--r--src/3rdparty/freetype/include/tttags.h111
-rw-r--r--src/3rdparty/freetype/include/ttunpat.h60
-rw-r--r--src/3rdparty/freetype/src/Jamfile8
-rw-r--r--src/3rdparty/freetype/src/autofit/Jamfile20
-rw-r--r--src/3rdparty/freetype/src/autofit/afangles.c4
-rw-r--r--src/3rdparty/freetype/src/autofit/afblue.c88
-rw-r--r--src/3rdparty/freetype/src/autofit/afblue.cin2
-rw-r--r--src/3rdparty/freetype/src/autofit/afblue.dat114
-rw-r--r--src/3rdparty/freetype/src/autofit/afblue.h108
-rw-r--r--src/3rdparty/freetype/src/autofit/afblue.hin14
-rw-r--r--src/3rdparty/freetype/src/autofit/afcjk.c80
-rw-r--r--src/3rdparty/freetype/src/autofit/afcjk.h17
-rw-r--r--src/3rdparty/freetype/src/autofit/afcover.h2
-rw-r--r--src/3rdparty/freetype/src/autofit/afdummy.c7
-rw-r--r--src/3rdparty/freetype/src/autofit/afdummy.h2
-rw-r--r--src/3rdparty/freetype/src/autofit/aferrors.h2
-rw-r--r--src/3rdparty/freetype/src/autofit/afglobal.c69
-rw-r--r--src/3rdparty/freetype/src/autofit/afglobal.h18
-rw-r--r--src/3rdparty/freetype/src/autofit/afhints.c199
-rw-r--r--src/3rdparty/freetype/src/autofit/afhints.h73
-rw-r--r--src/3rdparty/freetype/src/autofit/afindic.c7
-rw-r--r--src/3rdparty/freetype/src/autofit/afindic.h2
-rw-r--r--src/3rdparty/freetype/src/autofit/aflatin.c171
-rw-r--r--src/3rdparty/freetype/src/autofit/aflatin.h30
-rw-r--r--src/3rdparty/freetype/src/autofit/aflatin2.c80
-rw-r--r--src/3rdparty/freetype/src/autofit/aflatin2.h2
-rw-r--r--src/3rdparty/freetype/src/autofit/afloader.c223
-rw-r--r--src/3rdparty/freetype/src/autofit/afloader.h21
-rw-r--r--src/3rdparty/freetype/src/autofit/afmodule.c122
-rw-r--r--src/3rdparty/freetype/src/autofit/afmodule.h19
-rw-r--r--src/3rdparty/freetype/src/autofit/afpic.c2
-rw-r--r--src/3rdparty/freetype/src/autofit/afpic.h10
-rw-r--r--src/3rdparty/freetype/src/autofit/afranges.c405
-rw-r--r--src/3rdparty/freetype/src/autofit/afranges.h8
-rw-r--r--src/3rdparty/freetype/src/autofit/afscript.h36
-rw-r--r--src/3rdparty/freetype/src/autofit/afstyles.h51
-rw-r--r--src/3rdparty/freetype/src/autofit/aftypes.h50
-rw-r--r--src/3rdparty/freetype/src/autofit/afwarp.c8
-rw-r--r--src/3rdparty/freetype/src/autofit/afwarp.h4
-rw-r--r--src/3rdparty/freetype/src/autofit/afwrtsys.h2
-rw-r--r--src/3rdparty/freetype/src/autofit/autofit.c2
-rw-r--r--src/3rdparty/freetype/src/autofit/hbshim.c19
-rw-r--r--src/3rdparty/freetype/src/autofit/hbshim.h4
-rw-r--r--src/3rdparty/freetype/src/autofit/module.mk2
-rw-r--r--src/3rdparty/freetype/src/autofit/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/base/Jamfile47
-rw-r--r--src/3rdparty/freetype/src/base/basepic.c2
-rw-r--r--src/3rdparty/freetype/src/base/basepic.h11
-rw-r--r--src/3rdparty/freetype/src/base/ftadvanc.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftapi.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftbase.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftbase.h7
-rw-r--r--src/3rdparty/freetype/src/base/ftbbox.c9
-rw-r--r--src/3rdparty/freetype/src/base/ftbdf.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftbitmap.c67
-rw-r--r--src/3rdparty/freetype/src/base/ftcalc.c442
-rw-r--r--src/3rdparty/freetype/src/base/ftcid.c3
-rw-r--r--src/3rdparty/freetype/src/base/ftdbgmem.c126
-rw-r--r--src/3rdparty/freetype/src/base/ftdebug.c6
-rw-r--r--src/3rdparty/freetype/src/base/ftfntfmt.c55
-rw-r--r--src/3rdparty/freetype/src/base/ftfstype.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftgasp.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftgloadr.c17
-rw-r--r--src/3rdparty/freetype/src/base/ftglyph.c20
-rw-r--r--src/3rdparty/freetype/src/base/ftgxval.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftinit.c14
-rw-r--r--src/3rdparty/freetype/src/base/ftlcdfil.c14
-rw-r--r--src/3rdparty/freetype/src/base/ftmac.c13
-rw-r--r--src/3rdparty/freetype/src/base/ftmm.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftobjs.c230
-rw-r--r--src/3rdparty/freetype/src/base/ftotval.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftoutln.c156
-rw-r--r--src/3rdparty/freetype/src/base/ftpatent.c3
-rw-r--r--src/3rdparty/freetype/src/base/ftpfr.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftpic.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftrfork.c59
-rw-r--r--src/3rdparty/freetype/src/base/ftsnames.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftstream.c88
-rw-r--r--src/3rdparty/freetype/src/base/ftstroke.c59
-rw-r--r--src/3rdparty/freetype/src/base/ftsynth.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftsystem.c16
-rw-r--r--src/3rdparty/freetype/src/base/fttrigon.c75
-rw-r--r--src/3rdparty/freetype/src/base/fttype1.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftutil.c14
-rw-r--r--src/3rdparty/freetype/src/base/ftwinfnt.c2
-rw-r--r--src/3rdparty/freetype/src/base/ftxf86.c40
-rw-r--r--src/3rdparty/freetype/src/base/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/bdf/Jamfile6
-rw-r--r--src/3rdparty/freetype/src/bdf/bdf.h22
-rw-r--r--src/3rdparty/freetype/src/bdf/bdfdrivr.c41
-rw-r--r--src/3rdparty/freetype/src/bdf/bdfdrivr.h2
-rw-r--r--src/3rdparty/freetype/src/bdf/bdflib.c160
-rw-r--r--src/3rdparty/freetype/src/bdf/rules.mk5
-rw-r--r--src/3rdparty/freetype/src/bzip2/Jamfile5
-rw-r--r--src/3rdparty/freetype/src/bzip2/ftbzip2.c28
-rw-r--r--src/3rdparty/freetype/src/bzip2/rules.mk9
-rw-r--r--src/3rdparty/freetype/src/cache/Jamfile16
-rw-r--r--src/3rdparty/freetype/src/cache/ftcache.c2
-rw-r--r--src/3rdparty/freetype/src/cache/ftcbasic.c28
-rw-r--r--src/3rdparty/freetype/src/cache/ftccache.c18
-rw-r--r--src/3rdparty/freetype/src/cache/ftccache.h18
-rw-r--r--src/3rdparty/freetype/src/cache/ftccback.h2
-rw-r--r--src/3rdparty/freetype/src/cache/ftccmap.c10
-rw-r--r--src/3rdparty/freetype/src/cache/ftcerror.h2
-rw-r--r--src/3rdparty/freetype/src/cache/ftcglyph.c4
-rw-r--r--src/3rdparty/freetype/src/cache/ftcglyph.h4
-rw-r--r--src/3rdparty/freetype/src/cache/ftcimage.c9
-rw-r--r--src/3rdparty/freetype/src/cache/ftcimage.h2
-rw-r--r--src/3rdparty/freetype/src/cache/ftcmanag.c11
-rw-r--r--src/3rdparty/freetype/src/cache/ftcmanag.h2
-rw-r--r--src/3rdparty/freetype/src/cache/ftcmru.c2
-rw-r--r--src/3rdparty/freetype/src/cache/ftcmru.h2
-rw-r--r--src/3rdparty/freetype/src/cache/ftcsbits.c8
-rw-r--r--src/3rdparty/freetype/src/cache/ftcsbits.h2
-rw-r--r--src/3rdparty/freetype/src/cache/rules.mk9
-rw-r--r--src/3rdparty/freetype/src/cff/Jamfile20
-rw-r--r--src/3rdparty/freetype/src/cff/cf2arrst.c4
-rw-r--r--src/3rdparty/freetype/src/cff/cf2fixed.h22
-rw-r--r--src/3rdparty/freetype/src/cff/cf2font.h7
-rw-r--r--src/3rdparty/freetype/src/cff/cf2ft.c23
-rw-r--r--src/3rdparty/freetype/src/cff/cf2ft.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cf2hints.c6
-rw-r--r--src/3rdparty/freetype/src/cff/cf2intrp.c52
-rw-r--r--src/3rdparty/freetype/src/cff/cff.c2
-rw-r--r--src/3rdparty/freetype/src/cff/cffcmap.c2
-rw-r--r--src/3rdparty/freetype/src/cff/cffcmap.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cffdrivr.c100
-rw-r--r--src/3rdparty/freetype/src/cff/cffdrivr.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cfferrs.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cffgload.c129
-rw-r--r--src/3rdparty/freetype/src/cff/cffgload.h9
-rw-r--r--src/3rdparty/freetype/src/cff/cffload.c12
-rw-r--r--src/3rdparty/freetype/src/cff/cffload.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cffobjs.c51
-rw-r--r--src/3rdparty/freetype/src/cff/cffobjs.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cffparse.c32
-rw-r--r--src/3rdparty/freetype/src/cff/cffparse.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cffpic.c2
-rw-r--r--src/3rdparty/freetype/src/cff/cffpic.h10
-rw-r--r--src/3rdparty/freetype/src/cff/cfftoken.h2
-rw-r--r--src/3rdparty/freetype/src/cff/cfftypes.h2
-rw-r--r--src/3rdparty/freetype/src/cff/module.mk2
-rw-r--r--src/3rdparty/freetype/src/cff/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/cid/Jamfile9
-rw-r--r--src/3rdparty/freetype/src/cid/ciderrs.h2
-rw-r--r--src/3rdparty/freetype/src/cid/cidgload.c56
-rw-r--r--src/3rdparty/freetype/src/cid/cidgload.h2
-rw-r--r--src/3rdparty/freetype/src/cid/cidload.c48
-rw-r--r--src/3rdparty/freetype/src/cid/cidload.h4
-rw-r--r--src/3rdparty/freetype/src/cid/cidobjs.c18
-rw-r--r--src/3rdparty/freetype/src/cid/cidobjs.h2
-rw-r--r--src/3rdparty/freetype/src/cid/cidparse.c19
-rw-r--r--src/3rdparty/freetype/src/cid/cidparse.h6
-rw-r--r--src/3rdparty/freetype/src/cid/cidriver.c6
-rw-r--r--src/3rdparty/freetype/src/cid/cidriver.h2
-rw-r--r--src/3rdparty/freetype/src/cid/cidtoken.h2
-rw-r--r--src/3rdparty/freetype/src/cid/module.mk2
-rw-r--r--src/3rdparty/freetype/src/cid/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/cid/type1cid.c2
-rw-r--r--src/3rdparty/freetype/src/gxvalid/Jamfile29
-rw-r--r--src/3rdparty/freetype/src/gxvalid/README2
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvalid.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvalid.h3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvbsln.c5
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvcommn.c39
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvcommn.h6
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxverror.h4
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvfeat.c2
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvfeat.h3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvfgen.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvjust.c38
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvkern.c8
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvlcar.c9
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmod.c4
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmod.h3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort.c7
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort.h3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort0.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort1.c5
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort2.c5
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort4.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmort5.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx.c4
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx.h3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx0.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx1.c7
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx2.c6
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx4.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx5.c3
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvopbd.c5
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvprop.c5
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvtrak.c10
-rw-r--r--src/3rdparty/freetype/src/gxvalid/module.mk6
-rw-r--r--src/3rdparty/freetype/src/gxvalid/rules.mk8
-rw-r--r--src/3rdparty/freetype/src/gzip/Jamfile2
-rw-r--r--src/3rdparty/freetype/src/gzip/ftgzip.c31
-rw-r--r--src/3rdparty/freetype/src/gzip/rules.mk11
-rw-r--r--src/3rdparty/freetype/src/lzw/Jamfile2
-rw-r--r--src/3rdparty/freetype/src/lzw/ftlzw.c17
-rw-r--r--src/3rdparty/freetype/src/lzw/ftzopen.c5
-rw-r--r--src/3rdparty/freetype/src/lzw/ftzopen.h7
-rw-r--r--src/3rdparty/freetype/src/lzw/rules.mk10
-rw-r--r--src/3rdparty/freetype/src/otvalid/Jamfile12
-rw-r--r--src/3rdparty/freetype/src/otvalid/module.mk2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvalid.c2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvalid.h2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvbase.c2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvcommn.c4
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvcommn.h2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otverror.h2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvgdef.c4
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvgpos.c10
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvgpos.h2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvgsub.c10
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvjstf.c2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvmath.c10
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvmod.c2
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvmod.h2
-rw-r--r--src/3rdparty/freetype/src/otvalid/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/pcf/Jamfile7
-rw-r--r--src/3rdparty/freetype/src/pcf/pcf.h4
-rw-r--r--src/3rdparty/freetype/src/pcf/pcfdrivr.c67
-rw-r--r--src/3rdparty/freetype/src/pcf/pcfread.c99
-rw-r--r--src/3rdparty/freetype/src/pcf/rules.mk5
-rw-r--r--src/3rdparty/freetype/src/pfr/Jamfile10
-rw-r--r--src/3rdparty/freetype/src/pfr/module.mk2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfr.c2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrcmap.c2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrcmap.h2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrdrivr.c20
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrdrivr.h2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrerror.h2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrgload.c12
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrgload.h2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrload.c19
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrload.h4
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrobjs.c32
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrobjs.h2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrsbit.c71
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrsbit.h2
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrtypes.h6
-rw-r--r--src/3rdparty/freetype/src/pfr/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/psaux/Jamfile10
-rw-r--r--src/3rdparty/freetype/src/psaux/afmparse.c45
-rw-r--r--src/3rdparty/freetype/src/psaux/afmparse.h5
-rw-r--r--src/3rdparty/freetype/src/psaux/module.mk2
-rw-r--r--src/3rdparty/freetype/src/psaux/psaux.c2
-rw-r--r--src/3rdparty/freetype/src/psaux/psauxerr.h2
-rw-r--r--src/3rdparty/freetype/src/psaux/psauxmod.c2
-rw-r--r--src/3rdparty/freetype/src/psaux/psauxmod.h2
-rw-r--r--src/3rdparty/freetype/src/psaux/psconv.c6
-rw-r--r--src/3rdparty/freetype/src/psaux/psconv.h2
-rw-r--r--src/3rdparty/freetype/src/psaux/psobjs.c45
-rw-r--r--src/3rdparty/freetype/src/psaux/psobjs.h12
-rw-r--r--src/3rdparty/freetype/src/psaux/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/psaux/t1cmap.c10
-rw-r--r--src/3rdparty/freetype/src/psaux/t1cmap.h2
-rw-r--r--src/3rdparty/freetype/src/psaux/t1decode.c32
-rw-r--r--src/3rdparty/freetype/src/psaux/t1decode.h2
-rw-r--r--src/3rdparty/freetype/src/pshinter/Jamfile9
-rw-r--r--src/3rdparty/freetype/src/pshinter/module.mk2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshalgo.c143
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshalgo.h49
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshglob.c12
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshglob.h2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshinter.c2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshmod.c2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshmod.h2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshnterr.h2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshpic.c2
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshpic.h10
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshrec.c190
-rw-r--r--src/3rdparty/freetype/src/pshinter/pshrec.h10
-rw-r--r--src/3rdparty/freetype/src/pshinter/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/psnames/Jamfile6
-rw-r--r--src/3rdparty/freetype/src/psnames/module.mk2
-rw-r--r--src/3rdparty/freetype/src/psnames/psmodule.c4
-rw-r--r--src/3rdparty/freetype/src/psnames/psmodule.h2
-rw-r--r--src/3rdparty/freetype/src/psnames/psnamerr.h2
-rw-r--r--src/3rdparty/freetype/src/psnames/psnames.c2
-rw-r--r--src/3rdparty/freetype/src/psnames/pspic.c2
-rw-r--r--src/3rdparty/freetype/src/psnames/pspic.h12
-rw-r--r--src/3rdparty/freetype/src/psnames/pstables.h2
-rw-r--r--src/3rdparty/freetype/src/psnames/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/raster/Jamfile7
-rw-r--r--src/3rdparty/freetype/src/raster/ftmisc.h6
-rw-r--r--src/3rdparty/freetype/src/raster/ftraster.c737
-rw-r--r--src/3rdparty/freetype/src/raster/ftraster.h2
-rw-r--r--src/3rdparty/freetype/src/raster/ftrend1.c114
-rw-r--r--src/3rdparty/freetype/src/raster/ftrend1.h8
-rw-r--r--src/3rdparty/freetype/src/raster/module.mk2
-rw-r--r--src/3rdparty/freetype/src/raster/raster.c2
-rw-r--r--src/3rdparty/freetype/src/raster/rasterrs.h2
-rw-r--r--src/3rdparty/freetype/src/raster/rastpic.c22
-rw-r--r--src/3rdparty/freetype/src/raster/rastpic.h12
-rw-r--r--src/3rdparty/freetype/src/raster/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/sfnt/Jamfile15
-rw-r--r--src/3rdparty/freetype/src/sfnt/module.mk2
-rw-r--r--src/3rdparty/freetype/src/sfnt/pngshim.c35
-rw-r--r--src/3rdparty/freetype/src/sfnt/pngshim.h3
-rw-r--r--src/3rdparty/freetype/src/sfnt/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfdriver.c12
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfdriver.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/sferrors.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfnt.c2
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfntpic.c2
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfntpic.h14
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfobjs.c125
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfobjs.h11
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttbdf.c2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttbdf.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttcmap.c342
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttcmap.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttcmapc.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttkern.c6
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttkern.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttload.c140
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttload.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttmtx.c2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttmtx.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttpost.c34
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttpost.h2
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttsbit.c68
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttsbit.h2
-rw-r--r--src/3rdparty/freetype/src/smooth/Jamfile7
-rw-r--r--src/3rdparty/freetype/src/smooth/ftgrays.c167
-rw-r--r--src/3rdparty/freetype/src/smooth/ftgrays.h2
-rw-r--r--src/3rdparty/freetype/src/smooth/ftsmerrs.h2
-rw-r--r--src/3rdparty/freetype/src/smooth/ftsmooth.c8
-rw-r--r--src/3rdparty/freetype/src/smooth/ftsmooth.h2
-rw-r--r--src/3rdparty/freetype/src/smooth/ftspic.c2
-rw-r--r--src/3rdparty/freetype/src/smooth/ftspic.h7
-rw-r--r--src/3rdparty/freetype/src/smooth/module.mk2
-rw-r--r--src/3rdparty/freetype/src/smooth/rules.mk8
-rw-r--r--src/3rdparty/freetype/src/smooth/smooth.c2
-rw-r--r--src/3rdparty/freetype/src/tools/afblue.pl2
-rw-r--r--src/3rdparty/freetype/src/tools/apinames.c6
-rw-r--r--src/3rdparty/freetype/src/tools/chktrcmp.py2
-rw-r--r--src/3rdparty/freetype/src/tools/docmaker/content.py9
-rw-r--r--src/3rdparty/freetype/src/tools/docmaker/docmaker.py2
-rw-r--r--src/3rdparty/freetype/src/tools/docmaker/formatter.py2
-rw-r--r--src/3rdparty/freetype/src/tools/docmaker/sources.py9
-rw-r--r--src/3rdparty/freetype/src/tools/docmaker/tohtml.py2
-rw-r--r--src/3rdparty/freetype/src/tools/docmaker/utils.py4
-rw-r--r--src/3rdparty/freetype/src/tools/glnames.py6
-rw-r--r--src/3rdparty/freetype/src/tools/no-copyright61
-rw-r--r--src/3rdparty/freetype/src/tools/test_afm.c2
-rw-r--r--src/3rdparty/freetype/src/tools/update-copyright14
-rw-r--r--src/3rdparty/freetype/src/tools/update-copyright-year135
-rw-r--r--src/3rdparty/freetype/src/truetype/Jamfile12
-rw-r--r--src/3rdparty/freetype/src/truetype/module.mk2
-rw-r--r--src/3rdparty/freetype/src/truetype/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/truetype/truetype.c2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttdriver.c16
-rw-r--r--src/3rdparty/freetype/src/truetype/ttdriver.h2
-rw-r--r--src/3rdparty/freetype/src/truetype/tterrors.h2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttgload.c496
-rw-r--r--src/3rdparty/freetype/src/truetype/ttgload.h2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttgxvar.c948
-rw-r--r--src/3rdparty/freetype/src/truetype/ttgxvar.h10
-rw-r--r--src/3rdparty/freetype/src/truetype/ttinterp.c5994
-rw-r--r--src/3rdparty/freetype/src/truetype/ttinterp.h64
-rw-r--r--src/3rdparty/freetype/src/truetype/ttobjs.c127
-rw-r--r--src/3rdparty/freetype/src/truetype/ttobjs.h23
-rw-r--r--src/3rdparty/freetype/src/truetype/ttpic.c2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttpic.h12
-rw-r--r--src/3rdparty/freetype/src/truetype/ttpload.c24
-rw-r--r--src/3rdparty/freetype/src/truetype/ttpload.h2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttsubpix.c86
-rw-r--r--src/3rdparty/freetype/src/truetype/ttsubpix.h42
-rw-r--r--src/3rdparty/freetype/src/type1/Jamfile10
-rw-r--r--src/3rdparty/freetype/src/type1/module.mk2
-rw-r--r--src/3rdparty/freetype/src/type1/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/type1/t1afm.c8
-rw-r--r--src/3rdparty/freetype/src/type1/t1afm.h2
-rw-r--r--src/3rdparty/freetype/src/type1/t1driver.c36
-rw-r--r--src/3rdparty/freetype/src/type1/t1driver.h2
-rw-r--r--src/3rdparty/freetype/src/type1/t1errors.h2
-rw-r--r--src/3rdparty/freetype/src/type1/t1gload.c34
-rw-r--r--src/3rdparty/freetype/src/type1/t1gload.h2
-rw-r--r--src/3rdparty/freetype/src/type1/t1load.c293
-rw-r--r--src/3rdparty/freetype/src/type1/t1load.h2
-rw-r--r--src/3rdparty/freetype/src/type1/t1objs.c15
-rw-r--r--src/3rdparty/freetype/src/type1/t1objs.h2
-rw-r--r--src/3rdparty/freetype/src/type1/t1parse.c51
-rw-r--r--src/3rdparty/freetype/src/type1/t1parse.h8
-rw-r--r--src/3rdparty/freetype/src/type1/t1tokens.h2
-rw-r--r--src/3rdparty/freetype/src/type1/type1.c2
-rw-r--r--src/3rdparty/freetype/src/type42/Jamfile7
-rw-r--r--src/3rdparty/freetype/src/type42/module.mk2
-rw-r--r--src/3rdparty/freetype/src/type42/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/type42/t42drivr.c6
-rw-r--r--src/3rdparty/freetype/src/type42/t42drivr.h3
-rw-r--r--src/3rdparty/freetype/src/type42/t42error.h2
-rw-r--r--src/3rdparty/freetype/src/type42/t42objs.c27
-rw-r--r--src/3rdparty/freetype/src/type42/t42objs.h4
-rw-r--r--src/3rdparty/freetype/src/type42/t42parse.c127
-rw-r--r--src/3rdparty/freetype/src/type42/t42parse.h7
-rw-r--r--src/3rdparty/freetype/src/type42/t42types.h5
-rw-r--r--src/3rdparty/freetype/src/type42/type42.c2
-rw-r--r--src/3rdparty/freetype/src/winfonts/Jamfile2
-rw-r--r--src/3rdparty/freetype/src/winfonts/fnterrs.h2
-rw-r--r--src/3rdparty/freetype/src/winfonts/module.mk2
-rw-r--r--src/3rdparty/freetype/src/winfonts/rules.mk7
-rw-r--r--src/3rdparty/freetype/src/winfonts/winfnt.c89
-rw-r--r--src/3rdparty/freetype/src/winfonts/winfnt.h2
-rw-r--r--src/3rdparty/harfbuzz-ng/NEWS115
-rw-r--r--src/3rdparty/harfbuzz-ng/README1
-rw-r--r--src/3rdparty/harfbuzz-ng/config.h47
-rw-r--r--src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro11
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh102
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-blob.cc24
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-buffer-deserialize-text.hh4
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-buffer-private.hh14
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc33
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-buffer.cc219
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-buffer.h28
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-common.cc47
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-common.h10
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-coretext.cc55
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-face.cc40
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-font-private.hh2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-font.cc126
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-font.h35
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh10
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-object-private.hh34
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh20
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh116
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh56
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-font.cc108
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-font.h4
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-glyf-table.hh104
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh5
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh110
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh44
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh331
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh311
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh279
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh35
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-private.hh45
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout.cc77
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-map-private.hh7
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-map.cc10
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-maxp-table.hh5
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-name-table.hh14
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh6
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-private.hh50
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-table.hh26
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc39
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc13
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic-private.hh2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc141
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc77
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh145
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea-machine.hh224
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea.cc380
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc4
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-machine.hh548
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-private.hh97
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-table.cc696
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use.cc585
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc9
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape-normalize.cc50
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-shape.cc207
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-tag.cc40
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-private.hh131
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-set-private.hh11
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-set.cc52
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-set.h3
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-shape-plan.cc36
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-shape.cc85
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-shape.h3
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-shaper.cc2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-unicode-private.hh2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-unicode.cc33
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-unicode.h41
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-version.h8
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-warning.cc24
-rw-r--r--src/3rdparty/libpng.pri1
-rw-r--r--src/3rdparty/pcre/pcre.h4
-rw-r--r--src/3rdparty/pcre/pcre_compile.c235
-rw-r--r--src/3rdparty/pcre/pcre_get.c23
-rw-r--r--src/3rdparty/pcre/pcre_internal.h2
-rw-r--r--src/3rdparty/pcre/pcre_jit_compile.c19
-rw-r--r--src/3rdparty/pcre/pcre_study.c2
-rw-r--r--src/3rdparty/pcre/pcre_xclass.c2
-rw-r--r--src/3rdparty/pcre/sljit/sljitLir.h88
-rw-r--r--src/3rdparty/pcre/sljit/sljitNativeX86_common.c66
-rw-r--r--src/3rdparty/pixman/pixman-arm-neon-asm.S4
-rw-r--r--src/3rdparty/png_dependency.pri6
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-32-rvk.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-32.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-64.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-int-set.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-interface.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-opt32-settings.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-opt32.c6
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-opt64-settings.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-unrolling.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakNISTInterface.c0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakNISTInterface.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakSponge.c0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakSponge.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/brg_endian.h0
-rw-r--r--src/3rdparty/sqlite/sqlite3.c2
-rw-r--r--src/3rdparty/xcb/README2
-rw-r--r--src/3rdparty/xcb/include/xcb/xinerama.h808
-rw-r--r--src/3rdparty/xcb/libxcb/xinerama.c655
-rw-r--r--src/3rdparty/zlib/0001-Fix-WEC2013-build-of-zlib.patch26
-rw-r--r--src/3rdparty/zlib/zlib.h9
-rw-r--r--src/3rdparty/zlib/zutil.h2
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java158
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java13
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtLayout.java4
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java160
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java14
-rw-r--r--src/android/templates/AndroidManifest.xml4
-rw-r--r--src/angle/angle.pro3
-rw-r--r--src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch361
-rw-r--r--src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch38
-rw-r--r--src/angle/src/common/common.pri10
-rw-r--r--src/angle/src/config.pri3
-rw-r--r--src/angle/src/libEGL/libEGL.pro9
-rw-r--r--src/angle/src/libGLESv2/libGLESv2.pro6
-rw-r--r--src/concurrent/doc/qtconcurrent.qdocconf2
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.h2
-rw-r--r--src/concurrent/qtconcurrentthreadengine.h2
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in23
-rw-r--r--src/corelib/Qt5CoreMacros.cmake13
-rw-r--r--src/corelib/animation/qabstractanimation.h8
-rw-r--r--src/corelib/animation/qanimationgroup.h2
-rw-r--r--src/corelib/animation/qparallelanimationgroup.h2
-rw-r--r--src/corelib/animation/qpauseanimation.h4
-rw-r--r--src/corelib/animation/qpropertyanimation.h4
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.h2
-rw-r--r--src/corelib/animation/qsequentialanimationgroup_p.h2
-rw-r--r--src/corelib/animation/qvariantanimation.h4
-rw-r--r--src/corelib/codecs/qbig5codec.cpp4
-rw-r--r--src/corelib/codecs/qeucjpcodec.cpp4
-rw-r--r--src/corelib/codecs/qeuckrcodec.cpp4
-rw-r--r--src/corelib/codecs/qgb18030codec.cpp6
-rw-r--r--src/corelib/codecs/qjiscodec.cpp2
-rw-r--r--src/corelib/codecs/qsjiscodec.cpp2
-rw-r--r--src/corelib/codecs/qtextcodec.cpp3
-rw-r--r--src/corelib/codecs/qtextcodec.h6
-rw-r--r--src/corelib/codecs/qutfcodec.cpp3
-rw-r--r--src/corelib/codecs/qutfcodec_p.h2
-rw-r--r--src/corelib/corelib.pro6
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/corelib/doc/snippets/code/doc_src_containers.cpp6
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp10
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp33
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp25
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp6
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp25
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp17
-rw-r--r--src/corelib/doc/snippets/qstring/main.cpp12
-rw-r--r--src/corelib/doc/snippets/qstringlist/main.cpp2
-rw-r--r--src/corelib/doc/src/containers.qdoc18
-rw-r--r--src/corelib/doc/src/eventsandfilters.qdoc2
-rw-r--r--src/corelib/doc/src/external-resources.qdoc9
-rw-r--r--src/corelib/doc/src/implicit-sharing.qdoc6
-rw-r--r--src/corelib/doc/src/objectmodel/metaobjects.qdoc2
-rw-r--r--src/corelib/doc/src/objectmodel/properties.qdoc11
-rw-r--r--src/corelib/global/global.pri10
-rw-r--r--src/corelib/global/qcompilerdetection.h25
-rw-r--r--src/corelib/global/qflags.h2
-rw-r--r--src/corelib/global/qglobal.cpp259
-rw-r--r--src/corelib/global/qglobal.h94
-rw-r--r--src/corelib/global/qhooks_p.h11
-rw-r--r--src/corelib/global/qlogging.cpp32
-rw-r--r--src/corelib/global/qlogging.h3
-rw-r--r--src/corelib/global/qnamespace.h30
-rw-r--r--src/corelib/global/qnamespace.qdoc103
-rw-r--r--src/corelib/global/qnumeric_p.h117
-rw-r--r--src/corelib/global/qprocessordetection.h82
-rw-r--r--src/corelib/global/qsysinfo.h28
-rw-r--r--src/corelib/global/qsystemdetection.h4
-rw-r--r--src/corelib/global/qtypeinfo.h72
-rw-r--r--src/corelib/global/qversiontagging.cpp86
-rw-r--r--src/corelib/global/qversiontagging.h86
-rw-r--r--src/corelib/io/forkfd_qt.cpp16
-rw-r--r--src/corelib/io/io.pri1
-rw-r--r--src/corelib/io/qabstractfileengine.cpp1
-rw-r--r--src/corelib/io/qbuffer.h4
-rw-r--r--src/corelib/io/qdatastream.cpp1
-rw-r--r--src/corelib/io/qdatastream.h5
-rw-r--r--src/corelib/io/qdebug.cpp29
-rw-r--r--src/corelib/io/qdebug.h25
-rw-r--r--src/corelib/io/qdir.cpp14
-rw-r--r--src/corelib/io/qdir.h16
-rw-r--r--src/corelib/io/qfile.h2
-rw-r--r--src/corelib/io/qfiledevice.cpp2
-rw-r--r--src/corelib/io/qfiledevice.h2
-rw-r--r--src/corelib/io/qfileinfo.h5
-rw-r--r--src/corelib/io/qfileselector.cpp4
-rw-r--r--src/corelib/io/qfileselector.h2
-rw-r--r--src/corelib/io/qfilesystemengine.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_p.h2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp161
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp5
-rw-r--r--src/corelib/io/qfilesystementry.cpp3
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp10
-rw-r--r--src/corelib/io/qfilesystemwatcher.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.mm31
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_p.h1
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp4
-rw-r--r--src/corelib/io/qiodevice.cpp73
-rw-r--r--src/corelib/io/qiodevice.h2
-rw-r--r--src/corelib/io/qiodevice_p.h1
-rw-r--r--src/corelib/io/qlockfile_unix.cpp8
-rw-r--r--src/corelib/io/qloggingcategory.cpp9
-rw-r--r--src/corelib/io/qloggingregistry.cpp68
-rw-r--r--src/corelib/io/qloggingregistry_p.h1
-rw-r--r--src/corelib/io/qprocess.cpp165
-rw-r--r--src/corelib/io/qprocess.h27
-rw-r--r--src/corelib/io/qprocess_p.h4
-rw-r--r--src/corelib/io/qprocess_unix.cpp65
-rw-r--r--src/corelib/io/qprocess_win.cpp46
-rw-r--r--src/corelib/io/qprocess_wince.cpp29
-rw-r--r--src/corelib/io/qresource.cpp8
-rw-r--r--src/corelib/io/qsavefile.h2
-rw-r--r--src/corelib/io/qsettings.cpp64
-rw-r--r--src/corelib/io/qsettings.h10
-rw-r--r--src/corelib/io/qsettings_mac.cpp15
-rw-r--r--src/corelib/io/qsettings_p.h3
-rw-r--r--src/corelib/io/qsettings_win.cpp8
-rw-r--r--src/corelib/io/qstandardpaths.cpp10
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp30
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp6
-rw-r--r--src/corelib/io/qstandardpaths_winrt.cpp3
-rw-r--r--src/corelib/io/qstorageinfo.cpp12
-rw-r--r--src/corelib/io/qstorageinfo.h6
-rw-r--r--src/corelib/io/qstorageinfo_mac.cpp41
-rw-r--r--src/corelib/io/qstorageinfo_p.h3
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp12
-rw-r--r--src/corelib/io/qtemporarydir.cpp51
-rw-r--r--src/corelib/io/qtemporarydir.h1
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/io/qtemporaryfile_p.h2
-rw-r--r--src/corelib/io/qtextstream.cpp155
-rw-r--r--src/corelib/io/qtextstream.h5
-rw-r--r--src/corelib/io/qtextstream_p.h10
-rw-r--r--src/corelib/io/qtldurl.cpp16
-rw-r--r--src/corelib/io/qurl.cpp8
-rw-r--r--src/corelib/io/qurlidna.cpp2
-rw-r--r--src/corelib/io/qurlquery.cpp22
-rw-r--r--src/corelib/io/qurlquery.h12
-rw-r--r--src/corelib/io/qwindowspipereader.cpp6
-rw-r--r--src/corelib/io/qwindowspipereader_p.h2
-rw-r--r--src/corelib/io/qwinoverlappedionotifier.cpp27
-rw-r--r--src/corelib/io/qwinoverlappedionotifier_p.h2
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp6
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h16
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel_p.h3
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp1
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.cpp3
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp18
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h36
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp33
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp4
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.h4
-rw-r--r--src/corelib/json/qjson_p.h4
-rw-r--r--src/corelib/json/qjsonarray.cpp13
-rw-r--r--src/corelib/json/qjsonarray.h8
-rw-r--r--src/corelib/json/qjsondocument.cpp2
-rw-r--r--src/corelib/json/qjsondocument.h2
-rw-r--r--src/corelib/json/qjsonobject.cpp12
-rw-r--r--src/corelib/json/qjsonobject.h6
-rw-r--r--src/corelib/json/qjsonvalue.cpp26
-rw-r--r--src/corelib/json/qjsonwriter.cpp4
-rw-r--r--src/corelib/kernel/kernel.pri18
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.h4
-rw-r--r--src/corelib/kernel/qcfsocketnotifier.cpp307
-rw-r--r--src/corelib/kernel/qcfsocketnotifier_p.h105
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm17
-rw-r--r--src/corelib/kernel/qcore_mac_p.h4
-rw-r--r--src/corelib/kernel/qcore_unix_p.h78
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp306
-rw-r--r--src/corelib/kernel/qcoreapplication.h17
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h8
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp7
-rw-r--r--src/corelib/kernel/qcoreevent.cpp4
-rw-r--r--src/corelib/kernel/qcoreevent.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp6
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm633
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf_p.h280
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp1
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib_p.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp8
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp132
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt_p.h4
-rw-r--r--src/corelib/kernel/qeventloop.cpp2
-rw-r--r--src/corelib/kernel/qeventloop.h2
-rw-r--r--src/corelib/kernel/qfunctions_fake_env_p.h122
-rw-r--r--src/corelib/kernel/qfunctions_wince.cpp58
-rw-r--r--src/corelib/kernel/qfunctions_wince.h49
-rw-r--r--src/corelib/kernel/qfunctions_winrt.cpp51
-rw-r--r--src/corelib/kernel/qfunctions_winrt.h55
-rw-r--r--src/corelib/kernel/qjni.cpp10
-rw-r--r--src/corelib/kernel/qjni_p.h8
-rw-r--r--src/corelib/kernel/qjnihelpers.cpp102
-rw-r--r--src/corelib/kernel/qjnihelpers_p.h33
-rw-r--r--src/corelib/kernel/qmath.h10
-rw-r--r--src/corelib/kernel/qmetaobject.cpp19
-rw-r--r--src/corelib/kernel/qmetaobject.h36
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp20
-rw-r--r--src/corelib/kernel/qmetatype.cpp30
-rw-r--r--src/corelib/kernel/qmetatype.h115
-rw-r--r--src/corelib/kernel/qmimedata.cpp6
-rw-r--r--src/corelib/kernel/qobject.cpp27
-rw-r--r--src/corelib/kernel/qobject.h46
-rw-r--r--src/corelib/kernel/qobject_impl.h10
-rw-r--r--src/corelib/kernel/qobject_p.h6
-rw-r--r--src/corelib/kernel/qobjectdefs.h24
-rw-r--r--src/corelib/kernel/qpointer.cpp8
-rw-r--r--src/corelib/kernel/qpointer.h12
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp4
-rw-r--r--src/corelib/kernel/qsharedmemory.h4
-rw-r--r--src/corelib/kernel/qsharedmemory_android.cpp14
-rw-r--r--src/corelib/kernel/qsharedmemory_systemv.cpp2
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp6
-rw-r--r--src/corelib/kernel/qsignalmapper.h2
-rw-r--r--src/corelib/kernel/qsocketnotifier.h2
-rw-r--r--src/corelib/kernel/qsystemerror.cpp2
-rw-r--r--src/corelib/kernel/qsystemerror_p.h10
-rw-r--r--src/corelib/kernel/qsystemsemaphore_android.cpp8
-rw-r--r--src/corelib/kernel/qsystemsemaphore_systemv.cpp2
-rw-r--r--src/corelib/kernel/qsystemsemaphore_win.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp9
-rw-r--r--src/corelib/kernel/qtimer.h10
-rw-r--r--src/corelib/kernel/qtranslator.cpp1
-rw-r--r--src/corelib/kernel/qtranslator.h4
-rw-r--r--src/corelib/kernel/qvariant.cpp12
-rw-r--r--src/corelib/kernel/qvariant.h34
-rw-r--r--src/corelib/kernel/qvariant_p.h88
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp4
-rw-r--r--src/corelib/mimetypes/qmimedatabase_p.h1
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp18
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp13
-rw-r--r--src/corelib/mimetypes/qmimetype.h13
-rw-r--r--src/corelib/plugin/plugin.pri1
-rw-r--r--src/corelib/plugin/qfactoryinterface.cpp43
-rw-r--r--src/corelib/plugin/qfactoryinterface.h2
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp8
-rw-r--r--src/corelib/plugin/qlibrary.cpp6
-rw-r--r--src/corelib/plugin/qlibrary.h8
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp9
-rw-r--r--src/corelib/plugin/qplugin.qdoc8
-rw-r--r--src/corelib/plugin/qpluginloader.cpp34
-rw-r--r--src/corelib/plugin/qpluginloader.h4
-rw-r--r--src/corelib/plugin/quuid.cpp14
-rw-r--r--src/corelib/qtzlib.pro7
-rw-r--r--src/corelib/statemachine/qabstractstate.cpp12
-rw-r--r--src/corelib/statemachine/qabstractstate.h2
-rw-r--r--src/corelib/statemachine/qabstractstate_p.h9
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp67
-rw-r--r--src/corelib/statemachine/qabstracttransition.h2
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h6
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp3
-rw-r--r--src/corelib/statemachine/qeventtransition.h4
-rw-r--r--src/corelib/statemachine/qeventtransition_p.h4
-rw-r--r--src/corelib/statemachine/qfinalstate.h2
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp77
-rw-r--r--src/corelib/statemachine/qhistorystate.h10
-rw-r--r--src/corelib/statemachine/qhistorystate_p.h25
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp5
-rw-r--r--src/corelib/statemachine/qsignaltransition.h4
-rw-r--r--src/corelib/statemachine/qsignaltransition_p.h3
-rw-r--r--src/corelib/statemachine/qstate.cpp10
-rw-r--r--src/corelib/statemachine/qstate.h4
-rw-r--r--src/corelib/statemachine/qstate_p.h3
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp209
-rw-r--r--src/corelib/statemachine/qstatemachine.h4
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h27
-rw-r--r--src/corelib/thread/qbasicatomic.h12
-rw-r--r--src/corelib/thread/qexception.cpp24
-rw-r--r--src/corelib/thread/qexception.h18
-rw-r--r--src/corelib/thread/qfuture.qdoc1
-rw-r--r--src/corelib/thread/qfutureinterface.h2
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp24
-rw-r--r--src/corelib/thread/qfuturewatcher.h4
-rw-r--r--src/corelib/thread/qgenericatomic.h81
-rw-r--r--src/corelib/thread/qmutex.cpp7
-rw-r--r--src/corelib/thread/qmutex.h8
-rw-r--r--src/corelib/thread/qmutex_win.cpp6
-rw-r--r--src/corelib/thread/qorderedmutexlocker_p.h6
-rw-r--r--src/corelib/thread/qresultstore.h4
-rw-r--r--src/corelib/thread/qrunnable.cpp11
-rw-r--r--src/corelib/thread/qrunnable.h9
-rw-r--r--src/corelib/thread/qthread.cpp28
-rw-r--r--src/corelib/thread/qthread.h4
-rw-r--r--src/corelib/thread/qthread_p.h10
-rw-r--r--src/corelib/thread/qthread_unix.cpp35
-rw-r--r--src/corelib/thread/qthread_win.cpp32
-rw-r--r--src/corelib/thread/qthreadpool.cpp10
-rw-r--r--src/corelib/thread/qthreadpool.h2
-rw-r--r--src/corelib/thread/qthreadpool_p.h2
-rw-r--r--src/corelib/thread/qwaitcondition_unix.cpp2
-rw-r--r--src/corelib/thread/qwaitcondition_win.cpp6
-rw-r--r--src/corelib/tools/qalgorithms.h125
-rw-r--r--src/corelib/tools/qalgorithms.qdoc70
-rw-r--r--src/corelib/tools/qarraydata.cpp4
-rw-r--r--src/corelib/tools/qarraydata.h6
-rw-r--r--src/corelib/tools/qarraydatapointer.h11
-rw-r--r--src/corelib/tools/qbitarray.cpp4
-rw-r--r--src/corelib/tools/qbitarray.h2
-rw-r--r--src/corelib/tools/qbytearray.cpp98
-rw-r--r--src/corelib/tools/qbytearray.h48
-rw-r--r--src/corelib/tools/qbytearray_p.h61
-rw-r--r--src/corelib/tools/qbytearraylist.h2
-rw-r--r--src/corelib/tools/qchar.cpp134
-rw-r--r--src/corelib/tools/qchar.h280
-rw-r--r--src/corelib/tools/qcollator.cpp2
-rw-r--r--src/corelib/tools/qcollator.h2
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp114
-rw-r--r--src/corelib/tools/qcommandlineoption.h8
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp60
-rw-r--r--src/corelib/tools/qcommandlineparser.h6
-rw-r--r--src/corelib/tools/qcryptographichash.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp189
-rw-r--r--src/corelib/tools/qdatetime.h7
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h1
-rw-r--r--src/corelib/tools/qeasingcurve.cpp10
-rw-r--r--src/corelib/tools/qeasingcurve.h2
-rw-r--r--src/corelib/tools/qelapsedtimer.cpp2
-rw-r--r--src/corelib/tools/qharfbuzz.cpp3
-rw-r--r--src/corelib/tools/qhash.cpp198
-rw-r--r--src/corelib/tools/qhash.h174
-rw-r--r--src/corelib/tools/qhashfunctions.h156
-rw-r--r--src/corelib/tools/qlinkedlist.cpp78
-rw-r--r--src/corelib/tools/qlinkedlist.h34
-rw-r--r--src/corelib/tools/qlist.cpp307
-rw-r--r--src/corelib/tools/qlist.h148
-rw-r--r--src/corelib/tools/qlocale.cpp46
-rw-r--r--src/corelib/tools/qlocale.h40
-rw-r--r--src/corelib/tools/qlocale_mac.mm14
-rw-r--r--src/corelib/tools/qlocale_p.h3
-rw-r--r--src/corelib/tools/qlocale_win.cpp59
-rw-r--r--src/corelib/tools/qmap.cpp160
-rw-r--r--src/corelib/tools/qmap.h155
-rw-r--r--src/corelib/tools/qqueue.cpp13
-rw-r--r--src/corelib/tools/qqueue.h5
-rw-r--r--src/corelib/tools/qrect.cpp4
-rw-r--r--src/corelib/tools/qregexp.cpp46
-rw-r--r--src/corelib/tools/qregexp.h5
-rw-r--r--src/corelib/tools/qregularexpression.cpp29
-rw-r--r--src/corelib/tools/qregularexpression.h4
-rw-r--r--src/corelib/tools/qringbuffer.cpp314
-rw-r--r--src/corelib/tools/qringbuffer_p.h246
-rw-r--r--src/corelib/tools/qscopedpointer.h14
-rw-r--r--src/corelib/tools/qset.h71
-rw-r--r--src/corelib/tools/qset.qdoc124
-rw-r--r--src/corelib/tools/qshareddata.h11
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h83
-rw-r--r--src/corelib/tools/qsimd.cpp298
-rw-r--r--src/corelib/tools/qsimd_p.h181
-rw-r--r--src/corelib/tools/qstack.cpp13
-rw-r--r--src/corelib/tools/qstack.h5
-rw-r--r--src/corelib/tools/qstring.cpp515
-rw-r--r--src/corelib/tools/qstring.h187
-rw-r--r--src/corelib/tools/qstringbuilder.h2
-rw-r--r--src/corelib/tools/qstringiterator_p.h7
-rw-r--r--src/corelib/tools/qtextboundaryfinder.h2
-rw-r--r--src/corelib/tools/qtimeline.h2
-rw-r--r--src/corelib/tools/qtimezone.cpp82
-rw-r--r--src/corelib/tools/qtimezoneprivate.cpp11
-rw-r--r--src/corelib/tools/qtimezoneprivate_android.cpp22
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h1
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp8
-rw-r--r--src/corelib/tools/qunicodetables.cpp11034
-rw-r--r--src/corelib/tools/qunicodetables_p.h36
-rw-r--r--src/corelib/tools/qunicodetools.cpp61
-rw-r--r--src/corelib/tools/qvarlengtharray.h39
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc108
-rw-r--r--src/corelib/tools/qvector.cpp272
-rw-r--r--src/corelib/tools/qvector.h125
-rw-r--r--src/corelib/tools/qversionnumber.cpp138
-rw-r--r--src/corelib/tools/qversionnumber.h313
-rw-r--r--src/corelib/tools/qversionnumber_p.h193
-rw-r--r--src/corelib/tools/tools.pri9
-rw-r--r--src/corelib/xml/qxmlstream.cpp10
-rw-r--r--src/corelib/xml/qxmlstream.h48
-rw-r--r--src/dbus/dbus_minimal_p.h11
-rw-r--r--src/dbus/doc/qtdbus.qdocconf2
-rw-r--r--src/dbus/doc/src/qtdbus-module.qdoc2
-rw-r--r--src/dbus/qdbus_symbols.cpp12
-rw-r--r--src/dbus/qdbus_symbols_p.h6
-rw-r--r--src/dbus/qdbusabstractadaptor.cpp4
-rw-r--r--src/dbus/qdbusabstractadaptor_p.h2
-rw-r--r--src/dbus/qdbusabstractinterface.cpp107
-rw-r--r--src/dbus/qdbusabstractinterface_p.h4
-rw-r--r--src/dbus/qdbusargument.h11
-rw-r--r--src/dbus/qdbusconnection.cpp349
-rw-r--r--src/dbus/qdbusconnection.h12
-rw-r--r--src/dbus/qdbusconnection_p.h59
-rw-r--r--src/dbus/qdbusconnectionmanager_p.h26
-rw-r--r--src/dbus/qdbuserror.cpp6
-rw-r--r--src/dbus/qdbuserror.h15
-rw-r--r--src/dbus/qdbusextratypes.h38
-rw-r--r--src/dbus/qdbusintegrator.cpp672
-rw-r--r--src/dbus/qdbusintegrator_p.h35
-rw-r--r--src/dbus/qdbusinterface.cpp1
-rw-r--r--src/dbus/qdbusinterface.h2
-rw-r--r--src/dbus/qdbusinternalfilters.cpp3
-rw-r--r--src/dbus/qdbusintrospection_p.h4
-rw-r--r--src/dbus/qdbusmacros.h2
-rw-r--r--src/dbus/qdbusmessage.cpp30
-rw-r--r--src/dbus/qdbusmessage.h8
-rw-r--r--src/dbus/qdbuspendingcall.cpp4
-rw-r--r--src/dbus/qdbuspendingcall.h9
-rw-r--r--src/dbus/qdbuspendingcall_p.h5
-rw-r--r--src/dbus/qdbusreply.h2
-rw-r--r--src/dbus/qdbusserver.cpp31
-rw-r--r--src/dbus/qdbusserver.h7
-rw-r--r--src/dbus/qdbusservicewatcher.cpp36
-rw-r--r--src/dbus/qdbusservicewatcher.h8
-rw-r--r--src/dbus/qdbusthreaddebug_p.h6
-rw-r--r--src/dbus/qdbusunixfiledescriptor.h10
-rw-r--r--src/dbus/qdbusvirtualobject.h2
-rw-r--r--src/gui/accessible/qaccessible.cpp151
-rw-r--r--src/gui/accessible/qaccessible.h42
-rw-r--r--src/gui/accessible/qaccessiblebridge.h2
-rw-r--r--src/gui/accessible/qaccessibleplugin.h2
-rw-r--r--src/gui/doc/qtgui.qdocconf2
-rw-r--r--src/gui/doc/snippets/qfileopenevent/Info.plist59
-rw-r--r--src/gui/doc/snippets/qfileopenevent/main.cpp73
-rw-r--r--src/gui/doc/snippets/qfontdatabase/main.cpp2
-rw-r--r--src/gui/image/qbitmap.h2
-rw-r--r--src/gui/image/qicon.cpp108
-rw-r--r--src/gui/image/qicon.h12
-rw-r--r--src/gui/image/qicon_p.h1
-rw-r--r--src/gui/image/qiconengine.cpp7
-rw-r--r--src/gui/image/qiconengine.h1
-rw-r--r--src/gui/image/qiconengineplugin.h2
-rw-r--r--src/gui/image/qiconloader.cpp11
-rw-r--r--src/gui/image/qiconloader_p.h2
-rw-r--r--src/gui/image/qimage.cpp166
-rw-r--r--src/gui/image/qimage.h37
-rw-r--r--src/gui/image/qimage_conversions.cpp38
-rw-r--r--src/gui/image/qimage_neon.cpp30
-rw-r--r--src/gui/image/qimage_p.h37
-rw-r--r--src/gui/image/qimageiohandler.h2
-rw-r--r--src/gui/image/qimagereader.cpp42
-rw-r--r--src/gui/image/qimagereader.h3
-rw-r--r--src/gui/image/qimagewriter.cpp4
-rw-r--r--src/gui/image/qjpeghandler.cpp4
-rw-r--r--src/gui/image/qmovie.h6
-rw-r--r--src/gui/image/qpaintengine_pic.cpp1
-rw-r--r--src/gui/image/qpicture.cpp7
-rw-r--r--src/gui/image/qpicture.h8
-rw-r--r--src/gui/image/qpicture_p.h5
-rw-r--r--src/gui/image/qpictureformatplugin.h2
-rw-r--r--src/gui/image/qpixmap.cpp6
-rw-r--r--src/gui/image/qpixmap.h16
-rw-r--r--src/gui/image/qpixmap_blitter.cpp2
-rw-r--r--src/gui/image/qpixmap_raster.cpp30
-rw-r--r--src/gui/image/qpixmap_win.cpp28
-rw-r--r--src/gui/image/qpixmapcache.cpp43
-rw-r--r--src/gui/image/qpixmapcache.h12
-rw-r--r--src/gui/image/qpnghandler.cpp27
-rw-r--r--src/gui/image/qpnghandler.pri7
-rw-r--r--src/gui/image/qppmhandler.cpp16
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp83
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.h22
-rw-r--r--src/gui/itemmodels/qstandarditemmodel_p.h2
-rw-r--r--src/gui/kernel/kernel.pri8
-rw-r--r--src/gui/kernel/qcursor.cpp18
-rw-r--r--src/gui/kernel/qdnd.cpp8
-rw-r--r--src/gui/kernel/qevent.cpp62
-rw-r--r--src/gui/kernel/qevent.h13
-rw-r--r--src/gui/kernel/qgenericplugin.h2
-rw-r--r--src/gui/kernel/qguiapplication.cpp196
-rw-r--r--src/gui/kernel/qguiapplication.h2
-rw-r--r--src/gui/kernel/qguiapplication_p.h2
-rw-r--r--src/gui/kernel/qguivariant.cpp9
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp423
-rw-r--r--src/gui/kernel/qhighdpiscaling_p.h514
-rw-r--r--src/gui/kernel/qinputmethod.cpp3
-rw-r--r--src/gui/kernel/qinputmethod.h2
-rw-r--r--src/gui/kernel/qkeymapper_p.h1
-rw-r--r--src/gui/kernel/qkeysequence.cpp82
-rw-r--r--src/gui/kernel/qkeysequence.h15
-rw-r--r--src/gui/kernel/qkeysequence_p.h13
-rw-r--r--src/gui/kernel/qoffscreensurface.h2
-rw-r--r--src/gui/kernel/qopenglcontext.cpp54
-rw-r--r--src/gui/kernel/qopenglcontext.h9
-rw-r--r--src/gui/kernel/qopenglcontext_p.h2
-rw-r--r--src/gui/kernel/qopenglwindow.cpp5
-rw-r--r--src/gui/kernel/qopenglwindow.h4
-rw-r--r--src/gui/kernel/qpaintdevicewindow.cpp6
-rw-r--r--src/gui/kernel/qpaintdevicewindow_p.h11
-rw-r--r--src/gui/kernel/qplatformcursor.cpp2
-rw-r--r--src/gui/kernel/qplatformcursor.h2
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp19
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h25
-rw-r--r--src/gui/kernel/qplatformgraphicsbufferhelper.cpp92
-rw-r--r--src/gui/kernel/qplatformgraphicsbufferhelper.h4
-rw-r--r--src/gui/kernel/qplatforminputcontextfactory.cpp46
-rw-r--r--src/gui/kernel/qplatforminputcontextfactory_p.h1
-rw-r--r--src/gui/kernel/qplatformintegration.cpp48
-rw-r--r--src/gui/kernel/qplatformintegration.h7
-rw-r--r--src/gui/kernel/qplatformintegrationfactory.cpp7
-rw-r--r--src/gui/kernel/qplatformmenu.h2
-rw-r--r--src/gui/kernel/qplatformscreen.cpp85
-rw-r--r--src/gui/kernel/qplatformscreen.h17
-rw-r--r--src/gui/kernel/qplatformsystemtrayicon.h2
-rw-r--r--src/gui/kernel/qplatformtheme.cpp4
-rw-r--r--src/gui/kernel/qplatformtheme.h2
-rw-r--r--src/gui/kernel/qplatformthemefactory.cpp4
-rw-r--r--src/gui/kernel/qplatformwindow.cpp131
-rw-r--r--src/gui/kernel/qplatformwindow.h15
-rw-r--r--src/gui/kernel/qrasterwindow.cpp2
-rw-r--r--src/gui/kernel/qrasterwindow.h2
-rw-r--r--src/gui/kernel/qscreen.cpp85
-rw-r--r--src/gui/kernel/qscreen.h8
-rw-r--r--src/gui/kernel/qscreen_p.h25
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow.cpp17
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow_p.h4
-rw-r--r--src/gui/kernel/qshortcutmap.cpp69
-rw-r--r--src/gui/kernel/qshortcutmap_p.h5
-rw-r--r--src/gui/kernel/qsimpledrag.cpp85
-rw-r--r--src/gui/kernel/qsimpledrag_p.h16
-rw-r--r--src/gui/kernel/qstylehints.cpp18
-rw-r--r--src/gui/kernel/qstylehints.h2
-rw-r--r--src/gui/kernel/qtouchdevice.cpp25
-rw-r--r--src/gui/kernel/qtouchdevice_p.h6
-rw-r--r--src/gui/kernel/qwindow.cpp164
-rw-r--r--src/gui/kernel/qwindow.h13
-rw-r--r--src/gui/kernel/qwindow_p.h3
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp422
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h35
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h30
-rw-r--r--src/gui/math3d/qmatrix4x4.h2
-rw-r--r--src/gui/math3d/qquaternion.h28
-rw-r--r--src/gui/math3d/qvector2d.h2
-rw-r--r--src/gui/math3d/qvector3d.h2
-rw-r--r--src/gui/math3d/qvector4d.h2
-rw-r--r--src/gui/opengl/opengl.pri3
-rw-r--r--src/gui/opengl/qopengl.cpp124
-rw-r--r--src/gui/opengl/qopengl.h12
-rw-r--r--src/gui/opengl/qopengl_p.h12
-rw-r--r--src/gui/opengl/qopenglbuffer.h2
-rw-r--r--src/gui/opengl/qopengldebug.h10
-rw-r--r--src/gui/opengl/qopenglengineshadermanager.cpp3
-rw-r--r--src/gui/opengl/qopenglextensions_p.h259
-rw-r--r--src/gui/opengl/qopenglextrafunctions.h1990
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp491
-rw-r--r--src/gui/opengl/qopenglframebufferobject.h22
-rw-r--r--src/gui/opengl/qopenglframebufferobject_p.h27
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp4285
-rw-r--r--src/gui/opengl/qopenglfunctions.h5
-rw-r--r--src/gui/opengl/qopenglgradientcache.cpp78
-rw-r--r--src/gui/opengl/qopenglgradientcache_p.h6
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp7
-rw-r--r--src/gui/opengl/qopenglpaintdevice_p.h2
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp2
-rw-r--r--src/gui/opengl/qopenglpixeltransferoptions.h9
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp2
-rw-r--r--src/gui/opengl/qopenglshaderprogram.h8
-rw-r--r--src/gui/opengl/qopengltexture.cpp293
-rw-r--r--src/gui/opengl/qopengltexture.h33
-rw-r--r--src/gui/opengl/qopengltexture_p.h3
-rw-r--r--src/gui/opengl/qopengltextureblitter.cpp257
-rw-r--r--src/gui/opengl/qopengltextureblitter_p.h4
-rw-r--r--src/gui/opengl/qopengltexturehelper.cpp208
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h37
-rw-r--r--src/gui/opengl/qopengltimerquery.h4
-rw-r--r--src/gui/opengl/qopenglversionfunctions.h5
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.h2
-rw-r--r--src/gui/opengl/qtriangulatingstroker.cpp4
-rw-r--r--src/gui/painting/painting.pri14
-rw-r--r--src/gui/painting/qbackingstore.cpp49
-rw-r--r--src/gui/painting/qbackingstore.h2
-rw-r--r--src/gui/painting/qblendfunctions.cpp187
-rw-r--r--src/gui/painting/qbrush.cpp1
-rw-r--r--src/gui/painting/qcolor.cpp96
-rw-r--r--src/gui/painting/qcolor.h42
-rw-r--r--src/gui/painting/qcompositionfunctions.cpp2197
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp3
-rw-r--r--src/gui/painting/qdatabuffer_p.h1
-rw-r--r--src/gui/painting/qdrawhelper.cpp3634
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp101
-rw-r--r--src/gui/painting/qdrawhelper_neon_asm.S4
-rw-r--r--src/gui/painting/qdrawhelper_neon_p.h2
-rw-r--r--src/gui/painting/qdrawhelper_p.h249
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp103
-rw-r--r--src/gui/painting/qdrawhelper_x86_p.h6
-rw-r--r--src/gui/painting/qimagescale.cpp152
-rw-r--r--src/gui/painting/qimagescale_sse4.cpp42
-rw-r--r--src/gui/painting/qmatrix.cpp24
-rw-r--r--src/gui/painting/qmatrix.h4
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp4
-rw-r--r--src/gui/painting/qpagedpaintdevice_p.h4
-rw-r--r--src/gui/painting/qpagelayout.h11
-rw-r--r--src/gui/painting/qpagesize.h10
-rw-r--r--src/gui/painting/qpaintdevice.cpp6
-rw-r--r--src/gui/painting/qpaintdevice.h6
-rw-r--r--src/gui/painting/qpaintdevice.qdoc29
-rw-r--r--src/gui/painting/qpaintengine.cpp4
-rw-r--r--src/gui/painting/qpaintengine.h4
-rw-r--r--src/gui/painting/qpaintengine_p.h3
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp113
-rw-r--r--src/gui/painting/qpainter.cpp17
-rw-r--r--src/gui/painting/qpainter.h10
-rw-r--r--src/gui/painting/qpainter_p.h3
-rw-r--r--src/gui/painting/qpathclipper.cpp10
-rw-r--r--src/gui/painting/qpathclipper_p.h3
-rw-r--r--src/gui/painting/qpdf.cpp49
-rw-r--r--src/gui/painting/qpdf_p.h4
-rw-r--r--src/gui/painting/qpen.cpp1
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp156
-rw-r--r--src/gui/painting/qplatformbackingstore.h3
-rw-r--r--src/gui/painting/qpolygon.h22
-rw-r--r--src/gui/painting/qregion.cpp33
-rw-r--r--src/gui/painting/qrgb.h4
-rw-r--r--src/gui/painting/qrgba64.h228
-rw-r--r--src/gui/painting/qrgba64.qdoc303
-rw-r--r--src/gui/painting/qrgba64_p.h131
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp33
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h4
-rw-r--r--src/gui/painting/qtransform.cpp28
-rw-r--r--src/gui/painting/qtransform.h4
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.cpp9
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h4
-rw-r--r--src/gui/text/qabstracttextdocumentlayout_p.h3
-rw-r--r--src/gui/text/qcssparser.cpp1
-rw-r--r--src/gui/text/qfont.cpp21
-rw-r--r--src/gui/text/qfontdatabase.cpp97
-rw-r--r--src/gui/text/qfontengine.cpp112
-rw-r--r--src/gui/text/qfontengine_ft.cpp182
-rw-r--r--src/gui/text/qfontengine_ft_p.h7
-rw-r--r--src/gui/text/qfontengine_p.h21
-rw-r--r--src/gui/text/qfontengineglyphcache.cpp43
-rw-r--r--src/gui/text/qfontengineglyphcache_p.h4
-rw-r--r--src/gui/text/qfontmetrics.h10
-rw-r--r--src/gui/text/qfontsubset.cpp41
-rw-r--r--src/gui/text/qfontsubset_p.h2
-rw-r--r--src/gui/text/qglyphrun.cpp1
-rw-r--r--src/gui/text/qglyphrun.h8
-rw-r--r--src/gui/text/qharfbuzzng.cpp10
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp15
-rw-r--r--src/gui/text/qplatformfontdatabase.h2
-rw-r--r--src/gui/text/qrawfont.cpp1
-rw-r--r--src/gui/text/qrawfont.h10
-rw-r--r--src/gui/text/qstatictext.cpp8
-rw-r--r--src/gui/text/qstatictext.h7
-rw-r--r--src/gui/text/qstatictext_p.h5
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp8
-rw-r--r--src/gui/text/qtextcursor.h5
-rw-r--r--src/gui/text/qtextdocument.cpp22
-rw-r--r--src/gui/text/qtextdocument.h18
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp18
-rw-r--r--src/gui/text/qtextengine.cpp63
-rw-r--r--src/gui/text/qtextengine_p.h33
-rw-r--r--src/gui/text/qtextformat.cpp8
-rw-r--r--src/gui/text/qtextformat_p.h1
-rw-r--r--src/gui/text/qtextimagehandler.cpp36
-rw-r--r--src/gui/text/qtextlayout.cpp124
-rw-r--r--src/gui/text/qtextlayout.h24
-rw-r--r--src/gui/text/qtextobject.h6
-rw-r--r--src/gui/text/qtextodfwriter.cpp11
-rw-r--r--src/gui/text/qtextodfwriter_p.h2
-rw-r--r--src/gui/text/qtextoption.cpp6
-rw-r--r--src/gui/text/qtexttable.cpp4
-rw-r--r--src/gui/text/qtexttable.h4
-rw-r--r--src/gui/text/qzip.cpp83
-rw-r--r--src/gui/text/qzipreader_p.h18
-rw-r--r--src/gui/text/text.pri2
-rw-r--r--src/gui/util/qdesktopservices.cpp6
-rw-r--r--src/gui/util/qvalidator.h18
-rw-r--r--src/network/access/qabstractnetworkcache.h7
-rw-r--r--src/network/access/qftp.cpp1
-rw-r--r--src/network/access/qhttpmultipart.h9
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp57
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h1
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp18
-rw-r--r--src/network/access/qhttpnetworkheader.cpp12
-rw-r--r--src/network/access/qhttpnetworkreply.cpp30
-rw-r--r--src/network/access/qhttpnetworkreply_p.h10
-rw-r--r--src/network/access/qhttpnetworkrequest.cpp24
-rw-r--r--src/network/access/qhttpnetworkrequest_p.h8
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp7
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h2
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager_p.h2
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp1
-rw-r--r--src/network/access/qnetworkaccesscache.cpp6
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp7
-rw-r--r--src/network/access/qnetworkaccessmanager.h6
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h2
-rw-r--r--src/network/access/qnetworkcookie.cpp2
-rw-r--r--src/network/access/qnetworkcookie.h5
-rw-r--r--src/network/access/qnetworkcookiejar.cpp4
-rw-r--r--src/network/access/qnetworkcookiejar.h2
-rw-r--r--src/network/access/qnetworkdiskcache.h2
-rw-r--r--src/network/access/qnetworkreply.cpp32
-rw-r--r--src/network/access/qnetworkreply.h5
-rw-r--r--src/network/access/qnetworkreply_p.h1
-rw-r--r--src/network/access/qnetworkreplyfileimpl.cpp7
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp201
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h13
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp21
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h3
-rw-r--r--src/network/access/qnetworkrequest.cpp45
-rw-r--r--src/network/access/qnetworkrequest.h10
-rw-r--r--src/network/access/qspdyprotocolhandler.cpp41
-rw-r--r--src/network/bearer/qnetworkconfigmanager.h4
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp15
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp14
-rw-r--r--src/network/bearer/qnetworkconfiguration.h5
-rw-r--r--src/network/bearer/qnetworksession.h2
-rw-r--r--src/network/doc/qtnetwork.qdocconf2
-rw-r--r--src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp6
-rw-r--r--src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp3
-rw-r--r--src/network/kernel/kernel.pri9
-rw-r--r--src/network/kernel/qauthenticator.cpp4
-rw-r--r--src/network/kernel/qdnslookup.cpp3
-rw-r--r--src/network/kernel/qdnslookup.h46
-rw-r--r--src/network/kernel/qdnslookup_android.cpp2
-rw-r--r--src/network/kernel/qdnslookup_p.h2
-rw-r--r--src/network/kernel/qdnslookup_unix.cpp4
-rw-r--r--src/network/kernel/qdnslookup_win.cpp4
-rw-r--r--src/network/kernel/qdnslookup_winrt.cpp45
-rw-r--r--src/network/kernel/qhostaddress.cpp138
-rw-r--r--src/network/kernel/qhostaddress.h9
-rw-r--r--src/network/kernel/qhostinfo.cpp16
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp9
-rw-r--r--src/network/kernel/qhostinfo_win.cpp34
-rw-r--r--src/network/kernel/qhostinfo_winrt.cpp174
-rw-r--r--src/network/kernel/qnetworkinterface.cpp16
-rw-r--r--src/network/kernel/qnetworkinterface.h13
-rw-r--r--src/network/kernel/qnetworkinterface_unix.cpp90
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp140
-rw-r--r--src/network/kernel/qnetworkinterface_win_p.h262
-rw-r--r--src/network/kernel/qnetworkinterface_winrt.cpp149
-rw-r--r--src/network/kernel/qnetworkproxy.cpp5
-rw-r--r--src/network/kernel/qnetworkproxy.h14
-rw-r--r--src/network/kernel/qnetworkproxy_generic.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy_mac.cpp1
-rw-r--r--src/network/socket/qabstractsocket.cpp137
-rw-r--r--src/network/socket/qabstractsocket.h4
-rw-r--r--src/network/socket/qabstractsocket_p.h5
-rw-r--r--src/network/socket/qabstractsocketengine_p.h48
-rw-r--r--src/network/socket/qhttpsocketengine.cpp13
-rw-r--r--src/network/socket/qhttpsocketengine_p.h7
-rw-r--r--src/network/socket/qlocalserver.h4
-rw-r--r--src/network/socket/qlocalserver_unix.cpp2
-rw-r--r--src/network/socket/qlocalsocket.h2
-rw-r--r--src/network/socket/qnativesocketengine.cpp76
-rw-r--r--src/network/socket/qnativesocketengine_p.h126
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp334
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp333
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp321
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h9
-rw-r--r--src/network/socket/qnet_unix_p.h35
-rw-r--r--src/network/socket/qsocks5socketengine.cpp32
-rw-r--r--src/network/socket/qsocks5socketengine_p.h7
-rw-r--r--src/network/socket/qtcpserver.cpp42
-rw-r--r--src/network/socket/qtcpserver.h6
-rw-r--r--src/network/socket/qtcpserver_p.h2
-rw-r--r--src/network/socket/qtcpsocket.cpp9
-rw-r--r--src/network/socket/qtcpsocket.h6
-rw-r--r--src/network/socket/qudpsocket.cpp28
-rw-r--r--src/network/socket/qudpsocket.h4
-rw-r--r--src/network/ssl/qssl.cpp4
-rw-r--r--src/network/ssl/qssl.h3
-rw-r--r--src/network/ssl/qsslcertificate.h9
-rw-r--r--src/network/ssl/qsslcertificate_openssl.cpp3
-rw-r--r--src/network/ssl/qsslcertificateextension.h8
-rw-r--r--src/network/ssl/qsslcipher.h7
-rw-r--r--src/network/ssl/qsslconfiguration.h5
-rw-r--r--src/network/ssl/qsslcontext_openssl.cpp4
-rw-r--r--src/network/ssl/qsslellipticcurve.cpp2
-rw-r--r--src/network/ssl/qsslellipticcurve.h3
-rw-r--r--src/network/ssl/qsslerror.h5
-rw-r--r--src/network/ssl/qsslkey.h7
-rw-r--r--src/network/ssl/qsslkey_openssl.cpp49
-rw-r--r--src/network/ssl/qsslkey_p.h19
-rw-r--r--src/network/ssl/qsslpresharedkeyauthenticator.h8
-rw-r--r--src/network/ssl/qsslpresharedkeyauthenticator_p.h11
-rw-r--r--src/network/ssl/qsslsocket.cpp42
-rw-r--r--src/network/ssl/qsslsocket.h2
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp70
-rw-r--r--src/network/ssl/qsslsocket_mac_p.h7
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp120
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp105
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h25
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp30
-rw-r--r--src/opengl/doc/qtopengl.qdocconf2
-rw-r--r--src/opengl/doc/src/qtopengl-index.qdoc2
-rw-r--r--src/opengl/doc/src/qtopengl-module.qdoc2
-rw-r--r--src/opengl/gl2paintengineex/qglcustomshaderstage.cpp1
-rw-r--r--src/opengl/qgl.cpp7
-rw-r--r--src/opengl/qgl.h24
-rw-r--r--src/opengl/qgl_p.h2
-rw-r--r--src/opengl/qglbuffer.h2
-rw-r--r--src/opengl/qglcolormap.h2
-rw-r--r--src/opengl/qglframebufferobject.cpp3
-rw-r--r--src/opengl/qglfunctions.h6
-rw-r--r--src/opengl/qglpaintdevice.cpp2
-rw-r--r--src/opengl/qglpixelbuffer.cpp3
-rw-r--r--src/opengl/qglpixelbuffer.h4
-rw-r--r--src/opengl/qglshaderprogram.cpp5
-rw-r--r--src/opengl/qglshaderprogram.h12
-rw-r--r--src/platformheaders/cocoafunctions/cocoafunctions.pri1
-rw-r--r--src/platformheaders/cocoafunctions/qcocoawindowfunctions.h57
-rw-r--r--src/platformheaders/cocoafunctions/qcocoawindowfunctions.qdoc58
-rw-r--r--src/platformheaders/doc/qtplatformheaders.qdocconf2
-rw-r--r--src/platformheaders/helper/helper.pri2
-rw-r--r--src/platformheaders/helper/qplatformheaderhelper.h87
-rw-r--r--src/platformheaders/platformheaders.pro2
-rw-r--r--src/platformheaders/windowsfunctions/qwindowswindowfunctions.h9
-rw-r--r--src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc26
-rw-r--r--src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h54
-rw-r--r--src/platformheaders/xcbfunctions/qxcbwindowfunctions.h36
-rw-r--r--src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc133
-rw-r--r--src/platformheaders/xcbfunctions/xcbfunctions.pri4
-rw-r--r--src/platformsupport/accessibility/qaccessiblebridgeutils_p.h11
-rw-r--r--src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri4
-rw-r--r--src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp307
-rw-r--r--src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h105
-rw-r--r--src/platformsupport/clipboard/clipboard.pri2
-rw-r--r--src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h11
-rw-r--r--src/platformsupport/dbusmenu/qdbusmenutypes.cpp3
-rw-r--r--src/platformsupport/dbusmenu/qdbusmenutypes_p.h26
-rw-r--r--src/platformsupport/dbusmenu/qdbusplatformmenu_p.h11
-rw-r--r--src/platformsupport/dbustray/qdbustraytypes.cpp2
-rw-r--r--src/platformsupport/dbustray/qdbustraytypes_p.h13
-rw-r--r--src/platformsupport/dbustray/qstatusnotifieritemadaptor_p.h11
-rw-r--r--src/platformsupport/dbustray/qxdgnotificationproxy_p.h11
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_static.cpp4
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp2
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri24
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience_p.h1
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer.cpp6
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h4
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp22
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h12
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor.cpp410
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor_p.h142
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration.cpp366
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration_p.h122
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformscreen.cpp146
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformscreen_p.h79
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow.cpp138
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow_p.h85
-rw-r--r--src/platformsupport/eglconvenience/qeglstreamconvenience.cpp112
-rw-r--r--src/platformsupport/eglconvenience/qeglstreamconvenience_p.h184
-rw-r--r--src/platformsupport/eventdispatchers/eventdispatchers.pri10
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm628
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h278
-rw-r--r--src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp197
-rw-r--r--src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h69
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen.cpp5
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp117
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler_p.h9
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp24
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp23
-rw-r--r--src/platformsupport/fontdatabases/mac/coretext.pri7
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm174
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h7
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm10
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h2
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp6
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp4
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablet.cpp2
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablet_p.h3
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp99
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h23
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp26
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h2
-rw-r--r--src/platformsupport/input/libinput/qlibinputhandler.cpp6
-rw-r--r--src/platformsupport/input/libinput/qlibinputkeyboard.cpp17
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer.cpp8
-rw-r--r--src/platformsupport/input/tslib/qtslib_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp14
-rw-r--r--src/platformsupport/linuxaccessibility/bridge.cpp2
-rw-r--r--src/platformsupport/linuxaccessibility/cache.cpp3
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection.cpp35
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection_p.h1
-rw-r--r--src/platformsupport/linuxaccessibility/struct_marshallers_p.h32
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp61
-rw-r--r--src/platformsupport/platformsupport.pro1
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp4
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp74
-rw-r--r--src/plugins/bearer/bearer.pro2
-rw-r--r--src/plugins/bearer/blackberry/qbbengine.cpp22
-rw-r--r--src/plugins/bearer/connman/main.cpp2
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp6
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.h2
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp12
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux_p.h2
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm30
-rw-r--r--src/plugins/bearer/generic/main.cpp4
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp121
-rw-r--r--src/plugins/bearer/generic/qgenericengine.h4
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux.cpp6
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux_p.h2
-rw-r--r--src/plugins/bearer/networkmanager/main.cpp2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp6
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.h2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp6
-rw-r--r--src/plugins/bearer/nla/qnlaengine.cpp42
-rw-r--r--src/plugins/bearer/qbearerengine_impl.h4
-rw-r--r--src/plugins/bearer/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/bearer/qnetworksession_impl.h4
-rw-r--r--src/plugins/generic/tuiotouch/qtuiohandler.cpp3
-rw-r--r--src/plugins/imageformats/gif/main.cpp4
-rw-r--r--src/plugins/imageformats/gif/main.h4
-rw-r--r--src/plugins/imageformats/ico/main.cpp4
-rw-r--r--src/plugins/imageformats/ico/main.h4
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp67
-rw-r--r--src/plugins/imageformats/jpeg/main.cpp4
-rw-r--r--src/plugins/imageformats/jpeg/main.h4
-rw-r--r--src/plugins/platforminputcontexts/compose/compose.json2
-rw-r--r--src/plugins/platforminputcontexts/compose/compose.pro2
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp237
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h4
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp3
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp259
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h46
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxy.cpp29
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxy.h23
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibustypes.cpp116
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibustypes.h33
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp91
-rw-r--r--src/plugins/platforms/android/androidjniinput.h4
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp47
-rw-r--r--src/plugins/platforms/android/androidjnimain.h1
-rw-r--r--src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp8
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp12
-rw-r--r--src/plugins/platforms/android/qandroidplatformfontdatabase.cpp8
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.cpp13
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.h1
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.cpp5
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro2
-rw-r--r--src/plugins/platforms/cocoa/main.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.h14
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm28
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm13
-rw-r--r--src/plugins/platforms/cocoa/qcocoaautoreleasepool.h53
-rw-r--r--src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm48
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h12
-rw-r--r--src/plugins/platforms/cocoa/qcocoaclipboard.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.h12
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.mm15
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm12
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm10
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.h14
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm21
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm30
-rw-r--r--src/plugins/platforms/cocoa/qcocoainputcontext.h9
-rw-r--r--src/plugins/platforms/cocoa/qcocoainputcontext.mm22
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h53
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm56
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h42
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm31
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.h12
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm33
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.h34
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm15
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm13
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaservices.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm3
-rw-r--r--[-rwxr-xr-x]src/plugins/platforms/cocoa/qcocoasystemtrayicon.h20
-rw-r--r--[-rwxr-xr-x]src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h9
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm120
-rw-r--r--src/plugins/platforms/cocoa/qmacclipboard.mm3
-rw-r--r--src/plugins/platforms/cocoa/qmultitouch_mac.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h6
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm129
-rw-r--r--src/plugins/platforms/cocoa/qnsviewaccessibility.mm4
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm6
-rw-r--r--src/plugins/platforms/cocoa/qt_mac_p.h11
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h4
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp13
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h4
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp3
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h3
-rw-r--r--src/plugins/platforms/directfb/qdirectfbblitter.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbconvenience.cpp2
-rw-r--r--[-rwxr-xr-x]src/plugins/platforms/eglfs/cursor-atlas.pngbin2236 -> 2236 bytes
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp31
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp60
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h9
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.json3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro23
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp421
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h97
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicemain.cpp49
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.json3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro23
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.cpp93
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.h60
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlmain.cpp50
-rw-r--r--src/plugins/platforms/eglfs/eglfs_device_lib.pro9
-rw-r--r--src/plugins/platforms/eglfs/qeglfscontext.cpp11
-rw-r--r--src/plugins/platforms/eglfs/qeglfscursor.cpp502
-rw-r--r--src/plugins/platforms/eglfs/qeglfscursor.h141
-rw-r--r--src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp50
-rw-r--r--src/plugins/platforms/eglfs/qeglfsdeviceintegration.h8
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp352
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.h65
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.cpp98
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.h18
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp111
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.h31
-rw-r--r--src/plugins/platforms/haiku/qhaikuclipboard.cpp45
-rw-r--r--src/plugins/platforms/haiku/qhaikuclipboard.h4
-rw-r--r--src/plugins/platforms/haiku/qhaikuwindow.cpp17
-rw-r--r--src/plugins/platforms/ios/qiosapplicationstate.mm12
-rw-r--r--src/plugins/platforms/ios/qiosclipboard.mm4
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm9
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.h3
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.mm44
-rw-r--r--src/plugins/platforms/ios/qiosfileengineassetslibrary.mm40
-rw-r--r--src/plugins/platforms/ios/qiosglobal.h2
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm4
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm2
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm16
-rw-r--r--src/plugins/platforms/ios/qiosmenu.mm21
-rw-r--r--src/plugins/platforms/ios/qiosplatformaccessibility.mm2
-rw-r--r--src/plugins/platforms/ios/qiosscreen.h2
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm33
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm110
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm8
-rw-r--r--src/plugins/platforms/ios/quiaccessibilityelement.h4
-rw-r--r--src/plugins/platforms/ios/quiaccessibilityelement.mm26
-rw-r--r--src/plugins/platforms/ios/quiview.mm37
-rw-r--r--src/plugins/platforms/kms/kms.json3
-rw-r--r--src/plugins/platforms/kms/kms.pro37
-rw-r--r--src/plugins/platforms/kms/main.cpp58
-rw-r--r--src/plugins/platforms/kms/qkmsbackingstore.cpp217
-rw-r--r--src/plugins/platforms/kms/qkmsbackingstore.h72
-rw-r--r--src/plugins/platforms/kms/qkmscontext.cpp136
-rw-r--r--src/plugins/platforms/kms/qkmscontext.h71
-rw-r--r--src/plugins/platforms/kms/qkmscursor.cpp116
-rw-r--r--src/plugins/platforms/kms/qkmscursor.h66
-rw-r--r--src/plugins/platforms/kms/qkmsdevice.cpp118
-rw-r--r--src/plugins/platforms/kms/qkmsdevice.h81
-rw-r--r--src/plugins/platforms/kms/qkmsintegration.cpp204
-rw-r--r--src/plugins/platforms/kms/qkmsintegration.h108
-rw-r--r--src/plugins/platforms/kms/qkmsnativeinterface.cpp135
-rw-r--r--src/plugins/platforms/kms/qkmsnativeinterface.h64
-rw-r--r--src/plugins/platforms/kms/qkmsscreen.cpp275
-rw-r--r--src/plugins/platforms/kms/qkmsscreen.h122
-rw-r--r--src/plugins/platforms/kms/qkmswindow.cpp66
-rw-r--r--src/plugins/platforms/kms/qkmswindow.h57
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp11
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp41
-rw-r--r--src/plugins/platforms/mirclient/mirclient.json3
-rw-r--r--src/plugins/platforms/mirclient/mirclient.pro49
-rw-r--r--src/plugins/platforms/mirclient/qmirclientbackingstore.cpp146
-rw-r--r--src/plugins/platforms/mirclient/qmirclientbackingstore.h70
-rw-r--r--src/plugins/platforms/mirclient/qmirclientclipboard.cpp314
-rw-r--r--src/plugins/platforms/mirclient/qmirclientclipboard.h88
-rw-r--r--src/plugins/platforms/mirclient/qmirclientcursor.cpp201
-rw-r--r--src/plugins/platforms/mirclient/qmirclientcursor.h61
-rw-r--r--src/plugins/platforms/mirclient/qmirclientglcontext.cpp144
-rw-r--r--src/plugins/platforms/mirclient/qmirclientglcontext.h66
-rw-r--r--src/plugins/platforms/mirclient/qmirclientinput.cpp579
-rw-r--r--src/plugins/platforms/mirclient/qmirclientinput.h83
-rw-r--r--src/plugins/platforms/mirclient/qmirclientintegration.cpp278
-rw-r--r--src/plugins/platforms/mirclient/qmirclientintegration.h100
-rw-r--r--src/plugins/platforms/mirclient/qmirclientlogging.h60
-rw-r--r--src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp153
-rw-r--r--src/plugins/platforms/mirclient/qmirclientnativeinterface.h69
-rw-r--r--src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h58
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplatformservices.cpp72
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplatformservices.h54
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplugin.cpp56
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplugin.h53
-rw-r--r--src/plugins/platforms/mirclient/qmirclientscreen.cpp303
-rw-r--r--src/plugins/platforms/mirclient/qmirclientscreen.h92
-rw-r--r--src/plugins/platforms/mirclient/qmirclienttheme.cpp64
-rw-r--r--src/plugins/platforms/mirclient/qmirclienttheme.h54
-rw-r--r--src/plugins/platforms/mirclient/qmirclientwindow.cpp662
-rw-r--r--src/plugins/platforms/mirclient/qmirclientwindow.h85
-rw-r--r--src/plugins/platforms/platforms.pro2
-rw-r--r--src/plugins/platforms/qnx/qqnxabstractnavigator.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.cpp21
-rw-r--r--src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxbpseventfilter.cpp22
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.cpp10
-rw-r--r--src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp8
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.cpp14
-rw-r--r--src/plugins/platforms/qnx/qqnxeglwindow.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp22
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.cpp18
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp114
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp20
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp41
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorbps.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp14
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp20
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorpps.cpp14
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp14
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterwindow.cpp8
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp32
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp22
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventthread.cpp10
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp18
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp16
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp40
-rw-r--r--src/plugins/platforms/windows/accessible/accessible.pri17
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp36
-rw-r--r--src/plugins/platforms/windows/openglblacklists/default.json65
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp66
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.h9
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp70
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h9
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp330
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h77
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp54
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp163
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.h10
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.cpp62
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp69
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp77
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.h11
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp15
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp44
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h41
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp69
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.h6
-rw-r--r--src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp201
-rw-r--r--src/plugins/platforms/windows/qwindowsguieventdispatcher.h60
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp80
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.h11
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp73
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h12
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp159
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.h8
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp43
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeimage.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsole.cpp17
-rw-r--r--src/plugins/platforms/windows/qwindowsopengltester.cpp17
-rw-r--r--src/plugins/platforms/windows/qwindowsopengltester.h8
-rw-r--r--src/plugins/platforms/windows/qwindowsscaling.cpp71
-rw-r--r--src/plugins/platforms/windows/qwindowsscaling.h106
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp132
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.h23
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp30
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.h2
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp13
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.h4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp239
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h67
-rw-r--r--src/plugins/platforms/windows/windows.pri8
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.cpp14
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.cpp33
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp162
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h22
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp305
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.h12
-rw-r--r--src/plugins/platforms/winrt/qwinrtfontdatabase.cpp30
-rw-r--r--src/plugins/platforms/winrt/qwinrtfontdatabase.h8
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp194
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h31
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp280
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.h73
-rw-r--r--src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp105
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp597
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h54
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.cpp189
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp245
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.h13
-rw-r--r--src/plugins/platforms/winrt/winrt.pro22
-rw-r--r--src/plugins/platforms/xcb/README6
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp4
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp16
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro2
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp74
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.cpp24
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp645
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h29
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp173
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp58
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp122
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h20
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp119
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h7
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp275
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h56
-rw-r--r--src/plugins/platforms/xcb/qxcbsessionmanager.cpp1
-rw-r--r--src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp45
-rw-r--r--src/plugins/platforms/xcb/qxcbsystemtraytracker.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp424
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h28
-rw-r--r--src/plugins/platforms/xcb/qxcbwmsupport.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxlibconvenience.cpp63
-rw-r--r--src/plugins/platforms/xcb/qxlibconvenience.h49
-rw-r--r--src/plugins/platforms/xcb/xcb-static/xcb-static.pro6
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro11
-rw-r--r--src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp11
-rw-r--r--src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h5
-rw-r--r--src/plugins/plugins.pro13
-rw-r--r--src/plugins/printsupport/cocoa/main.cpp4
-rw-r--r--src/plugins/printsupport/cups/main.cpp4
-rw-r--r--src/plugins/printsupport/cups/qcupsprintengine.cpp8
-rw-r--r--src/plugins/printsupport/cups/qcupsprintengine_p.h4
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport.cpp5
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport_p.h3
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.cpp7
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.h5
-rw-r--r--src/plugins/printsupport/printsupport.pro5
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.cpp4
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.h3
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/button/core_button_inactive.pngbin2428 -> 2428 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/button/core_button_pressed.pngbin3221 -> 3221 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.pngbin2776 -> 2776 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.pngbin1315 -> 1315 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.pngbin394 -> 394 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/listitem/core_listitem_active.pngbin164 -> 164 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.pngbin135 -> 135 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.pngbin1802 -> 1802 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.pngbin4245 -> 4245 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.pngbin5460 -> 5460 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.pngbin1242 -> 1242 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.pngbin6577 -> 6577 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/button/core_button_inactive.pngbin2262 -> 2262 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/button/core_button_pressed.pngbin2853 -> 2853 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.pngbin2478 -> 2478 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.pngbin1315 -> 1315 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.pngbin394 -> 394 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/listitem/core_listitem_active.pngbin164 -> 164 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.pngbin136 -> 136 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.pngbin1724 -> 1724 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.pngbin3968 -> 3968 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.pngbin4777 -> 4777 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.pngbin1245 -> 1245 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.pngbin6593 -> 6593 bytes
-rw-r--r--src/plugins/styles/bb10style/qpixmapstyle.cpp27
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h4
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.h4
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_mac.mm3
-rw-r--r--src/printsupport/dialogs/qprintdialog.h4
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm4
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp9
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.h5
-rw-r--r--src/printsupport/doc/qtprintsupport.qdocconf4
-rw-r--r--src/printsupport/kernel/qcups.cpp16
-rw-r--r--src/printsupport/kernel/qcups_p.h6
-rw-r--r--src/printsupport/kernel/qpaintengine_alpha.cpp13
-rw-r--r--src/printsupport/kernel/qpaintengine_alpha_p.h6
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.cpp4
-rw-r--r--src/printsupport/kernel/qprint_p.h4
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp20
-rw-r--r--src/printsupport/kernel/qprinter.cpp6
-rw-r--r--src/printsupport/kernel/qprinterinfo.cpp16
-rw-r--r--src/printsupport/widgets/qcupsjobwidget.cpp4
-rw-r--r--src/printsupport/widgets/qcupsjobwidget_p.h4
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.h5
-rw-r--r--src/sql/doc/qtsql.qdocconf2
-rw-r--r--src/sql/doc/snippets/code/src_sql_kernel_qsqldatabase.cpp2
-rw-r--r--src/sql/doc/snippets/sqldatabase/sqldatabase.cpp5
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp143
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp2
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp2
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp2
-rw-r--r--src/sql/kernel/qsqldatabase.cpp6
-rw-r--r--src/sql/kernel/qsqldriver.h4
-rw-r--r--src/sql/kernel/qsqldriverplugin.h2
-rw-r--r--src/sql/kernel/qsqlindex.cpp3
-rw-r--r--src/sql/kernel/qsqlindex.h5
-rw-r--r--src/sql/models/qsqlquerymodel.cpp2
-rw-r--r--src/sql/models/qsqlquerymodel.h4
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp2
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.h2
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
-rw-r--r--src/sql/models/qsqltablemodel.h4
-rw-r--r--src/src.pro18
-rw-r--r--src/testlib/doc/qttestlib.qdocconf2
-rw-r--r--src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp2
-rw-r--r--src/testlib/qbenchmark_p.h2
-rw-r--r--src/testlib/qbenchmarkmetric.cpp2
-rw-r--r--src/testlib/qsignalspy.h9
-rw-r--r--src/testlib/qtest.h22
-rw-r--r--src/testlib/qtest_gui.h14
-rw-r--r--src/testlib/qtestaccessible.h17
-rw-r--r--src/testlib/qtestblacklist.cpp98
-rw-r--r--src/testlib/qtestblacklist_p.h7
-rw-r--r--src/testlib/qtestcase.cpp340
-rw-r--r--src/testlib/qtestcase.h52
-rw-r--r--src/testlib/qtestevent.h10
-rw-r--r--src/testlib/qtesteventloop.h6
-rw-r--r--src/testlib/qtestkeyboard.h16
-rw-r--r--src/testlib/qtestlog.cpp17
-rw-r--r--src/testlib/qtestlog_p.h5
-rw-r--r--src/testlib/qtestmouse.cpp47
-rw-r--r--src/testlib/qtestmouse.h110
-rw-r--r--src/testlib/qtestresult.cpp20
-rw-r--r--src/testlib/qtestsystem.h6
-rw-r--r--src/testlib/qtesttable.cpp164
-rw-r--r--src/testlib/qtesttouch.h16
-rw-r--r--src/testlib/qxmltestlogger.cpp9
-rw-r--r--src/testlib/qxmltestlogger_p.h3
-rw-r--r--src/testlib/testlib.pro3
-rw-r--r--src/tools/bootstrap-dbus/bootstrap-dbus.pro8
-rw-r--r--src/tools/bootstrap/bootstrap.pro29
-rw-r--r--src/tools/moc/moc.cpp1
-rw-r--r--src/tools/moc/preprocessor.cpp30
-rw-r--r--src/tools/moc/preprocessor.h2
-rw-r--r--src/tools/moc/symbols.h6
-rw-r--r--src/tools/qdoc/TODO.txt87
-rw-r--r--src/tools/qdoc/atom.cpp464
-rw-r--r--src/tools/qdoc/atom.h259
-rw-r--r--src/tools/qdoc/codechunk.cpp142
-rw-r--r--src/tools/qdoc/codechunk.h116
-rw-r--r--src/tools/qdoc/codemarker.cpp648
-rw-r--r--src/tools/qdoc/codemarker.h186
-rw-r--r--src/tools/qdoc/codeparser.cpp459
-rw-r--r--src/tools/qdoc/codeparser.h98
-rw-r--r--src/tools/qdoc/config.cpp1215
-rw-r--r--src/tools/qdoc/config.h313
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp1326
-rw-r--r--src/tools/qdoc/cppcodemarker.h85
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp2487
-rw-r--r--src/tools/qdoc/cppcodeparser.h250
-rw-r--r--src/tools/qdoc/doc.cpp3403
-rw-r--r--src/tools/qdoc/doc.h195
-rw-r--r--src/tools/qdoc/doc/config/qdoc.qdocconf72
-rw-r--r--src/tools/qdoc/doc/corefeatures.qdoc35
-rw-r--r--src/tools/qdoc/doc/examples/componentset/ProgressBar.qml135
-rw-r--r--src/tools/qdoc/doc/examples/componentset/Switch.qml142
-rw-r--r--src/tools/qdoc/doc/examples/componentset/TabWidget.qml183
-rw-r--r--src/tools/qdoc/doc/examples/componentset/componentset.pro5
-rw-r--r--src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample38
-rw-r--r--src/tools/qdoc/doc/examples/cpp.qdoc.sample126
-rw-r--r--src/tools/qdoc/doc/examples/examples.qdoc97
-rw-r--r--src/tools/qdoc/doc/examples/layoutmanagement.qdocinc13
-rw-r--r--src/tools/qdoc/doc/examples/main.cpp46
-rw-r--r--src/tools/qdoc/doc/examples/mainwindow.cpp243
-rw-r--r--src/tools/qdoc/doc/examples/minimum.qdocconf38
-rw-r--r--src/tools/qdoc/doc/examples/objectmodel.qdocinc11
-rw-r--r--src/tools/qdoc/doc/examples/qml.qdoc.sample116
-rw-r--r--src/tools/qdoc/doc/examples/samples.qdocinc109
-rw-r--r--src/tools/qdoc/doc/examples/signalandslots.qdocinc9
-rw-r--r--src/tools/qdoc/doc/files/basicqt.qdoc.sample67
-rw-r--r--src/tools/qdoc/doc/files/compat.qdocconf12
-rw-r--r--src/tools/qdoc/doc/files/qtgui.qdocconf49
-rw-r--r--src/tools/qdoc/doc/images/happy.gifbin11526 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/happyguy.jpgbin53442 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/link-to-qquickitem.pngbin46571 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/links-to-broken-links.pngbin16569 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/links-to-links.pngbin10042 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/qa-table.pngbin7057 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/qt-logo.pngbin1495 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/images/training.jpgbin8368 -> 0 bytes
-rw-r--r--src/tools/qdoc/doc/qa-pages.qdoc109
-rw-r--r--src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc633
-rw-r--r--src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc187
-rw-r--r--src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc164
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-DITA.qdoc164
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc154
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc1041
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-intro.qdoc325
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc4050
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc1609
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc1588
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc78
-rw-r--r--src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc92
-rw-r--r--src/tools/qdoc/doc/qtgui-qdocconf.qdoc310
-rw-r--r--src/tools/qdoc/editdistance.cpp106
-rw-r--r--src/tools/qdoc/editdistance.h51
-rw-r--r--src/tools/qdoc/generator.cpp2072
-rw-r--r--src/tools/qdoc/generator.h255
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp853
-rw-r--r--src/tools/qdoc/helpprojectwriter.h117
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp4894
-rw-r--r--src/tools/qdoc/htmlgenerator.h288
-rw-r--r--src/tools/qdoc/jscodemarker.cpp141
-rw-r--r--src/tools/qdoc/jscodemarker.h69
-rw-r--r--src/tools/qdoc/location.cpp439
-rw-r--r--src/tools/qdoc/location.h129
-rw-r--r--src/tools/qdoc/main.cpp789
-rw-r--r--src/tools/qdoc/node.cpp2874
-rw-r--r--src/tools/qdoc/node.h1149
-rw-r--r--src/tools/qdoc/openedlist.cpp220
-rw-r--r--src/tools/qdoc/openedlist.h85
-rw-r--r--src/tools/qdoc/plaincodemarker.cpp119
-rw-r--r--src/tools/qdoc/plaincodemarker.h69
-rw-r--r--src/tools/qdoc/puredocparser.cpp231
-rw-r--r--src/tools/qdoc/puredocparser.h69
-rw-r--r--src/tools/qdoc/qdoc.pro100
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp1688
-rw-r--r--src/tools/qdoc/qdocdatabase.h457
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp1561
-rw-r--r--src/tools/qdoc/qdocindexfiles.h83
-rw-r--r--src/tools/qdoc/qdoctagfiles.cpp386
-rw-r--r--src/tools/qdoc/qdoctagfiles.h68
-rw-r--r--src/tools/qdoc/qmlcodemarker.cpp273
-rw-r--r--src/tools/qdoc/qmlcodemarker.h78
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp327
-rw-r--r--src/tools/qdoc/qmlcodeparser.h84
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.cpp843
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.h170
-rw-r--r--src/tools/qdoc/qmlparser/parser.pri22
-rw-r--r--src/tools/qdoc/qmlparser/qqmljs.g3142
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast.cpp968
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast_p.h2781
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastfwd_p.h183
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp50
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h333
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.cpp159
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.h124
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsglobal_p.h63
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar.cpp1078
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar_p.h207
-rw-r--r--src/tools/qdoc/qmlparser/qqmljskeywords_p.h887
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer.cpp1438
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer_p.h250
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h191
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser.cpp1916
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser_p.h251
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp830
-rw-r--r--src/tools/qdoc/qmlvisitor.h119
-rw-r--r--src/tools/qdoc/quoter.cpp370
-rw-r--r--src/tools/qdoc/quoter.h86
-rw-r--r--src/tools/qdoc/separator.cpp69
-rw-r--r--src/tools/qdoc/separator.h50
-rw-r--r--src/tools/qdoc/text.cpp300
-rw-r--r--src/tools/qdoc/text.h99
-rw-r--r--src/tools/qdoc/tokenizer.cpp798
-rw-r--r--src/tools/qdoc/tokenizer.h176
-rw-r--r--src/tools/qdoc/tree.cpp1524
-rw-r--r--src/tools/qdoc/tree.h246
-rw-r--r--src/tools/qdoc/yyindent.cpp1182
-rw-r--r--src/tools/qlalr/compress.cpp2
-rw-r--r--src/tools/qlalr/cppgenerator.cpp4
-rw-r--r--src/tools/qlalr/lalr.cpp8
-rw-r--r--src/tools/qlalr/lalr.h6
-rw-r--r--src/tools/qlalr/parsetable.cpp2
-rw-r--r--src/tools/rcc/rcc.cpp15
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h1
-rw-r--r--src/tools/uic/qclass_lib_map.h8
-rw-r--r--src/tools/uic/ui4.cpp334
-rw-r--r--src/tools/uic/ui4.h40
-rw-r--r--src/tools/uic/uic.h1
-rw-r--r--src/widgets/accessible/complexwidgets.cpp2
-rw-r--r--src/widgets/accessible/itemviews.cpp23
-rw-r--r--src/widgets/accessible/itemviews_p.h14
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory_p.h4
-rw-r--r--src/widgets/accessible/qaccessiblewidgets.cpp3
-rw-r--r--src/widgets/dialogs/dialogs.pri1
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp157
-rw-r--r--src/widgets/dialogs/qcolordialog.h11
-rw-r--r--src/widgets/dialogs/qcolordialog_p.h179
-rw-r--r--src/widgets/dialogs/qdialog.cpp11
-rw-r--r--src/widgets/dialogs/qdialog.h4
-rw-r--r--src/widgets/dialogs/qerrormessage.cpp81
-rw-r--r--src/widgets/dialogs/qerrormessage.h2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp122
-rw-r--r--src/widgets/dialogs/qfiledialog.h46
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp6
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h4
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp224
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.h10
-rw-r--r--src/widgets/dialogs/qfilesystemmodel_p.h10
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp11
-rw-r--r--src/widgets/dialogs/qfontdialog.h10
-rw-r--r--src/widgets/dialogs/qfontdialog_p.h7
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp1
-rw-r--r--src/widgets/dialogs/qinputdialog.h18
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp7
-rw-r--r--src/widgets/dialogs/qmessagebox.h6
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp6
-rw-r--r--src/widgets/dialogs/qprogressdialog.h5
-rw-r--r--src/widgets/dialogs/qsidebar.cpp18
-rw-r--r--src/widgets/dialogs/qwizard.cpp6
-rw-r--r--src/widgets/dialogs/qwizard.h8
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/images/listview.pngbin9695 -> 9695 bytes
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/images/modelview-combobox.pngbin5022 -> 5022 bytes
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/images/tableview.pngbin10102 -> 10102 bytes
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf2
-rw-r--r--src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp10
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp2
-rw-r--r--src/widgets/doc/snippets/javastyle.cpp25
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/snippets/macmainwindow.mm0
-rw-r--r--src/widgets/doc/snippets/qstyleoption/main.cpp33
-rw-r--r--src/widgets/doc/src/guibooks.qdoc2
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc2
-rw-r--r--src/widgets/doc/src/qtwidgets-examples.qdoc2
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/layout.qdoc4
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc10
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc52
-rw-r--r--src/widgets/doc/src/windows-and-dialogs/mainwindow.qdoc8
-rw-r--r--src/widgets/effects/qgraphicseffect.cpp4
-rw-r--r--src/widgets/effects/qgraphicseffect.h14
-rw-r--r--src/widgets/effects/qgraphicseffect_p.h1
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.h1
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayout.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.h64
-rw-r--r--src/widgets/graphicsview/qgraphicsitem_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.cpp62
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.h2
-rw-r--r--src/widgets/graphicsview/qgraphicslayout.h2
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutitem.h2
-rw-r--r--src/widgets/graphicsview/qgraphicslinearlayout.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicslinearlayout.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp36
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.h10
-rw-r--r--src/widgets/graphicsview/qgraphicssceneevent.h2
-rw-r--r--src/widgets/graphicsview/qgraphicssceneindex.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicstransform.cpp5
-rw-r--r--src/widgets/graphicsview/qgraphicstransform.h6
-rw-r--r--src/widgets/graphicsview/qgraphicstransform_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp10
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsview_p.h1
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp3
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.h8
-rw-r--r--src/widgets/graphicsview/qsimplex_p.cpp8
-rw-r--r--src/widgets/itemviews/itemviews.pri1
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp12
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.h4
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp26
-rw-r--r--src/widgets/itemviews/qabstractitemview.h6
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h2
-rw-r--r--src/widgets/itemviews/qcolumnview.cpp12
-rw-r--r--src/widgets/itemviews/qcolumnview.h4
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.cpp2
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.h2
-rw-r--r--src/widgets/itemviews/qdirmodel.cpp1
-rw-r--r--src/widgets/itemviews/qdirmodel.h6
-rw-r--r--src/widgets/itemviews/qfileiconprovider.cpp1
-rw-r--r--src/widgets/itemviews/qheaderview.cpp8
-rw-r--r--src/widgets/itemviews/qheaderview.h4
-rw-r--r--src/widgets/itemviews/qheaderview_p.h1
-rw-r--r--src/widgets/itemviews/qitemdelegate.h2
-rw-r--r--src/widgets/itemviews/qlistview.cpp31
-rw-r--r--src/widgets/itemviews/qlistview.h7
-rw-r--r--src/widgets/itemviews/qlistview_p.h4
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp24
-rw-r--r--src/widgets/itemviews/qlistwidget.h10
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.h2
-rw-r--r--src/widgets/itemviews/qtableview.cpp31
-rw-r--r--src/widgets/itemviews/qtableview.h2
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp39
-rw-r--r--src/widgets/itemviews/qtablewidget.h6
-rw-r--r--src/widgets/itemviews/qtreeview.h4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp20
-rw-r--r--src/widgets/itemviews/qtreewidget.h6
-rw-r--r--src/widgets/itemviews/qwidgetitemdata_p.h1
-rw-r--r--src/widgets/kernel/qaction.cpp11
-rw-r--r--src/widgets/kernel/qaction.h2
-rw-r--r--src/widgets/kernel/qapplication.cpp50
-rw-r--r--src/widgets/kernel/qapplication.h4
-rw-r--r--src/widgets/kernel/qapplication_p.h2
-rw-r--r--src/widgets/kernel/qboxlayout.h6
-rw-r--r--src/widgets/kernel/qdesktopwidget.cpp81
-rw-r--r--src/widgets/kernel/qdesktopwidget.h5
-rw-r--r--src/widgets/kernel/qdesktopwidget.qdoc14
-rw-r--r--src/widgets/kernel/qformlayout.h2
-rw-r--r--src/widgets/kernel/qgesture.h12
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp15
-rw-r--r--src/widgets/kernel/qgridlayout.h10
-rw-r--r--src/widgets/kernel/qlayout.cpp3
-rw-r--r--src/widgets/kernel/qlayoutitem.h2
-rw-r--r--src/widgets/kernel/qmacgesturerecognizer.cpp1
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp95
-rw-r--r--src/widgets/kernel/qopenglwidget.h2
-rw-r--r--src/widgets/kernel/qshortcut.h2
-rw-r--r--src/widgets/kernel/qsizepolicy.cpp9
-rw-r--r--src/widgets/kernel/qsizepolicy.h6
-rw-r--r--src/widgets/kernel/qtooltip.cpp1
-rw-r--r--src/widgets/kernel/qtooltip.h2
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp3
-rw-r--r--src/widgets/kernel/qwhatsthis.h4
-rw-r--r--src/widgets/kernel/qwidget.cpp192
-rw-r--r--src/widgets/kernel/qwidget.h17
-rw-r--r--src/widgets/kernel/qwidget_p.h12
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp283
-rw-r--r--src/widgets/kernel/qwidgetbackingstore_p.h7
-rw-r--r--src/widgets/kernel/qwidgetsvariant.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp24
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp9
-rw-r--r--src/widgets/statemachine/qkeyeventtransition.cpp2
-rw-r--r--src/widgets/statemachine/qkeyeventtransition.h4
-rw-r--r--src/widgets/statemachine/qmouseeventtransition.h4
-rw-r--r--src/widgets/styles/qandroidstyle.cpp19
-rw-r--r--src/widgets/styles/qcommonstyle.cpp141
-rw-r--r--src/widgets/styles/qcommonstyle.h32
-rw-r--r--src/widgets/styles/qcommonstyle_p.h2
-rw-r--r--src/widgets/styles/qdrawutil.h22
-rw-r--r--src/widgets/styles/qfusionstyle.cpp9
-rw-r--r--src/widgets/styles/qgtk2painter.cpp2
-rw-r--r--src/widgets/styles/qgtkstyle.cpp2
-rw-r--r--src/widgets/styles/qgtkstyle_p.cpp4
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm159
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h4
-rw-r--r--src/widgets/styles/qproxystyle.h20
-rw-r--r--src/widgets/styles/qstyle.h34
-rw-r--r--src/widgets/styles/qstylepainter.h2
-rw-r--r--src/widgets/styles/qstyleplugin.h2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp82
-rw-r--r--src/widgets/styles/qwindowscestyle.cpp6
-rw-r--r--src/widgets/styles/qwindowsmobilestyle.cpp18
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp30
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h3
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp22
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp30
-rw-r--r--src/widgets/util/qcompleter.cpp31
-rw-r--r--src/widgets/util/qcompleter.h6
-rw-r--r--src/widgets/util/qflickgesture.cpp22
-rw-r--r--src/widgets/util/qscroller.cpp12
-rw-r--r--src/widgets/util/qscroller_mac.mm3
-rw-r--r--src/widgets/util/qscroller_p.h3
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp8
-rw-r--r--src/widgets/util/qsystemtrayicon.h4
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp2
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp35
-rw-r--r--src/widgets/util/qundogroup.h2
-rw-r--r--src/widgets/util/qundostack.h6
-rw-r--r--src/widgets/util/qundoview.h6
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp21
-rw-r--r--src/widgets/widgets/qabstractbutton.h4
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp6
-rw-r--r--src/widgets/widgets/qabstractscrollarea.h4
-rw-r--r--src/widgets/widgets/qabstractscrollarea_p.h3
-rw-r--r--src/widgets/widgets/qabstractslider.h4
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp11
-rw-r--r--src/widgets/widgets/qabstractspinbox.h4
-rw-r--r--src/widgets/widgets/qbuttongroup.h2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp5
-rw-r--r--src/widgets/widgets/qcalendarwidget.h2
-rw-r--r--src/widgets/widgets/qcheckbox.h4
-rw-r--r--src/widgets/widgets/qcombobox.cpp22
-rw-r--r--src/widgets/widgets/qcombobox.h2
-rw-r--r--src/widgets/widgets/qcombobox_p.h1
-rw-r--r--src/widgets/widgets/qcommandlinkbutton.h6
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp6
-rw-r--r--src/widgets/widgets/qdatetimeedit.h18
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h3
-rw-r--r--src/widgets/widgets/qdial.h2
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp2
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.h8
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp161
-rw-r--r--src/widgets/widgets/qdockarealayout_p.h8
-rw-r--r--src/widgets/widgets/qdockwidget.cpp179
-rw-r--r--src/widgets/widgets/qdockwidget.h5
-rw-r--r--src/widgets/widgets/qdockwidget_p.h3
-rw-r--r--src/widgets/widgets/qeffects.cpp2
-rw-r--r--src/widgets/widgets/qfocusframe.cpp4
-rw-r--r--src/widgets/widgets/qfocusframe.h2
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp8
-rw-r--r--src/widgets/widgets/qfontcombobox.h2
-rw-r--r--src/widgets/widgets/qframe.cpp6
-rw-r--r--src/widgets/widgets/qframe.h4
-rw-r--r--src/widgets/widgets/qframe_p.h4
-rw-r--r--src/widgets/widgets/qgroupbox.h4
-rw-r--r--src/widgets/widgets/qkeysequenceedit.h4
-rw-r--r--src/widgets/widgets/qlabel.cpp83
-rw-r--r--src/widgets/widgets/qlabel.h4
-rw-r--r--src/widgets/widgets/qlabel_p.h74
-rw-r--r--src/widgets/widgets/qlcdnumber.h4
-rw-r--r--src/widgets/widgets/qlineedit.cpp20
-rw-r--r--src/widgets/widgets/qlineedit.h4
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp8
-rw-r--r--src/widgets/widgets/qlineedit_p.h4
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.h2
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.h2
-rw-r--r--src/widgets/widgets/qmainwindow.cpp54
-rw-r--r--src/widgets/widgets/qmainwindow.h8
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp675
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h46
-rw-r--r--src/widgets/widgets/qmdiarea.h4
-rw-r--r--src/widgets/widgets/qmdiarea_p.h4
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp9
-rw-r--r--src/widgets/widgets/qmdisubwindow.h2
-rw-r--r--src/widgets/widgets/qmenu.cpp177
-rw-r--r--src/widgets/widgets/qmenu.h80
-rw-r--r--src/widgets/widgets/qmenu_mac.mm1
-rw-r--r--src/widgets/widgets/qmenu_p.h14
-rw-r--r--src/widgets/widgets/qmenubar.cpp18
-rw-r--r--src/widgets/widgets/qmenubar.h2
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp2
-rw-r--r--src/widgets/widgets/qplaintextedit.h8
-rw-r--r--src/widgets/widgets/qprogressbar.cpp22
-rw-r--r--src/widgets/widgets/qprogressbar.h2
-rw-r--r--src/widgets/widgets/qpushbutton.h8
-rw-r--r--src/widgets/widgets/qradiobutton.h4
-rw-r--r--src/widgets/widgets/qrubberband.h2
-rw-r--r--src/widgets/widgets/qscrollarea.h4
-rw-r--r--src/widgets/widgets/qscrollbar.h4
-rw-r--r--src/widgets/widgets/qslider.h4
-rw-r--r--src/widgets/widgets/qspinbox.h4
-rw-r--r--src/widgets/widgets/qsplashscreen.h4
-rw-r--r--src/widgets/widgets/qsplitter.cpp13
-rw-r--r--src/widgets/widgets/qsplitter.h4
-rw-r--r--src/widgets/widgets/qsplitter_p.h1
-rw-r--r--src/widgets/widgets/qstackedwidget.h2
-rw-r--r--src/widgets/widgets/qstatusbar.h2
-rw-r--r--src/widgets/widgets/qtabbar.cpp39
-rw-r--r--src/widgets/widgets/qtabbar.h2
-rw-r--r--src/widgets/widgets/qtabbar_p.h2
-rw-r--r--src/widgets/widgets/qtabwidget.cpp26
-rw-r--r--src/widgets/widgets/qtabwidget.h2
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp1
-rw-r--r--src/widgets/widgets/qtextbrowser.h2
-rw-r--r--src/widgets/widgets/qtextedit.h8
-rw-r--r--src/widgets/widgets/qtoolbar.cpp76
-rw-r--r--src/widgets/widgets/qtoolbar.h50
-rw-r--r--src/widgets/widgets/qtoolbararealayout.cpp2
-rw-r--r--src/widgets/widgets/qtoolbarlayout.cpp2
-rw-r--r--src/widgets/widgets/qtoolbox.cpp40
-rw-r--r--src/widgets/widgets/qtoolbox.h2
-rw-r--r--src/widgets/widgets/qtoolbutton.h2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp7
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp21
-rw-r--r--src/winmain/qtmain_winrt.cpp315
-rw-r--r--src/xml/doc/qtxml.qdocconf2
-rw-r--r--src/xml/doc/snippets/rsslisting/handler.cpp2
-rw-r--r--src/xml/doc/snippets/simpleparse/main.cpp2
-rw-r--r--src/xml/dom/qdom.cpp2
-rw-r--r--src/xml/dom/qdom.h16
-rw-r--r--src/xml/sax/qxml.cpp2
-rw-r--r--src/xml/sax/qxml.h8
-rw-r--r--src/xml/sax/qxml_p.h4
-rw-r--r--sync.profile4
-rw-r--r--tests/auto/auto.pro7
-rw-r--r--tests/auto/cmake/CMakeLists.txt6
-rw-r--r--tests/auto/cmake/test_interface/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/test_multiple_find_package/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/test_platform_defs_include/CMakeLists.txt1
-rw-r--r--tests/auto/cmake/test_use_modules_function/CMakeLists.txt2
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp28
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp24
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/BLACKLIST4
-rw-r--r--tests/auto/corelib/animation/qpropertyanimation/BLACKLIST4
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST4
-rw-r--r--tests/auto/corelib/global/qflags/qflags.pro3
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp2
-rw-r--r--tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp21
-rw-r--r--tests/auto/corelib/global/qlogging/qlogging.pro6
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro5
-rw-r--r--tests/auto/corelib/global/qnumeric/qnumeric.pro2
-rw-r--r--tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp160
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp4
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp34
-rw-r--r--tests/auto/corelib/io/qdir/qdir.pro2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp69
-rw-r--r--tests/auto/corelib/io/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/corelib/io/qfile/BLACKLIST9
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp286
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp101
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+haiku/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+haiku/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/qfileselector.qrc3
-rw-r--r--tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp2
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST5
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp15
-rw-r--r--tests/auto/corelib/io/qiodevice/BLACKLIST2
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp41
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp1
-rw-r--r--tests/auto/corelib/io/qprocess/BLACKLIST5
-rw-r--r--tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp14
-rw-r--r--tests/auto/corelib/io/qprocess/testDetached/main.cpp3
-rw-r--r--tests/auto/corelib/io/qprocess/testExitCodes/main.cpp4
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp645
-rw-r--r--tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp19
-rw-r--r--tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp22
-rw-r--r--tests/auto/corelib/io/qsettings/BLACKLIST3
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp99
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp32
-rw-r--r--tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp27
-rw-r--r--tests/auto/corelib/io/qtextstream/BLACKLIST2
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp20
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp54
-rw-r--r--tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp3
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp43
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp8
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp96
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp27
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp6
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro1
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp77
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h3
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST4
-rw-r--r--tests/auto/corelib/kernel/qeventloop/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp15
-rw-r--r--tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp69
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp6
-rw-r--r--tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp40
-rw-r--r--tests/auto/corelib/kernel/qobject/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qobject/qobject.pro6
-rw-r--r--tests/auto/corelib/kernel/qobject/test/test.pro2
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp4
-rw-r--r--tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp17
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST3
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp27
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp51
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp40
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h1
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp9
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp19
-rw-r--r--tests/auto/corelib/statemachine/qstate/tst_qstate.cpp31
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp127
-rw-r--r--tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp58
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri6
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro32
-rw-r--r--tests/auto/corelib/thread/qfuture/tst_qfuture.cpp34
-rw-r--r--tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp62
-rw-r--r--tests/auto/corelib/thread/qsemaphore/BLACKLIST3
-rw-r--r--tests/auto/corelib/thread/qthread/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro4
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/test/test.pro2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp2
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp152
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp4
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp107
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp15
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm12
-rw-r--r--tests/auto/corelib/tools/qchar/data/NormalizationTest.txt18
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp4
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp6
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp39
-rw-r--r--tests/auto/corelib/tools/qdate/tst_qdate.cpp41
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp92
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm6
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp29
-rw-r--r--tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp18
-rw-r--r--tests/auto/corelib/tools/qlatin1string/.gitignore1
-rw-r--r--tests/auto/corelib/tools/qlatin1string/qlatin1string.pro9
-rw-r--r--tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp126
-rw-r--r--tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp20
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp228
-rw-r--r--tests/auto/corelib/tools/qlocale/qlocale.pro4
-rw-r--r--tests/auto/corelib/tools/qlocale/test/test.pro2
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp26
-rw-r--r--tests/auto/corelib/tools/qmap/tst_qmap.cpp63
-rw-r--r--tests/auto/corelib/tools/qregexp/tst_qregexp.cpp3
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp5
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp129
-rw-r--r--tests/auto/corelib/tools/qset/tst_qset.cpp65
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.cpp1
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.pri1
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp50
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp592
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring_mac.mm8
-rw-r--r--tests/auto/corelib/tools/qstringref/tst_qstringref.cpp25
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt6
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt647
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt16
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt125
-rw-r--r--tests/auto/corelib/tools/qtimeline/BLACKLIST4
-rw-r--r--tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp119
-rw-r--r--tests/auto/corelib/tools/qtimezone/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp60
-rw-r--r--tests/auto/corelib/tools/qvector/qvector.pro1
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp261
-rw-r--r--tests/auto/corelib/tools/qversionnumber/qversionnumber.pro4
-rw-r--r--tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp2
-rw-r--r--tests/auto/corelib/tools/tools.pro1
-rw-r--r--tests/auto/dbus/dbus.pro9
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/BLACKLIST2
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp10
-rw-r--r--tests/auto/dbus/qdbusconnection/qdbusconnection.pro1
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp348
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h287
-rw-r--r--tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro5
-rw-r--r--tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp113
-rw-r--r--tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro6
-rw-r--r--tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp37
-rw-r--r--tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro2
-rw-r--r--tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp4
-rw-r--r--tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro5
-rw-r--r--tests/auto/dbus/qdbusmarshall/BLACKLIST3
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp16
-rw-r--r--tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro2
-rw-r--r--tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro2
-rw-r--r--tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp33
-rw-r--r--tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp104
-rw-r--r--tests/auto/dbus/qdbustype/qdbustype.pro2
-rw-r--r--tests/auto/dbus/qdbustype/tst_qdbustype.cpp4
-rw-r--r--tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro2
-rw-r--r--tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp7
-rw-r--r--tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp5
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp31
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp28
-rw-r--r--tests/auto/gui/image/qimagereader/images/longcomment.pgm12
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp42
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp18
-rw-r--r--tests/auto/gui/image/qmovie/tst_qmovie.cpp6
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp24
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp10
-rw-r--r--tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp26
-rw-r--r--tests/auto/gui/kernel/qclipboard/qclipboard.pro2
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/test.pro4
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp12
-rw-r--r--tests/auto/gui/kernel/qguivariant/no_application/main.cpp2
-rw-r--r--tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp22
-rw-r--r--tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp7
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp4
-rw-r--r--tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp2
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp136
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp194
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp48
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp20
-rw-r--r--tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp74
-rw-r--r--tests/auto/gui/painting/qbrush/tst_qbrush.cpp4
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp114
-rw-r--r--tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp2
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro2
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp278
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp34
-rw-r--r--tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp6
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp2
-rw-r--r--tests/auto/gui/painting/qtransform/tst_qtransform.cpp37
-rw-r--r--tests/auto/gui/qopengl/BLACKLIST8
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp201
-rw-r--r--tests/auto/gui/qopenglconfig/buglist.json22
-rw-r--r--tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp42
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp38
-rw-r--r--tests/auto/gui/text/qfont/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp77
-rw-r--r--tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp12
-rw-r--r--tests/auto/gui/text/qrawfont/BLACKLIST4
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp31
-rw-r--r--tests/auto/gui/text/qtextblock/tst_qtextblock.cpp4
-rw-r--r--tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp186
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp37
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp224
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qtextformat/tst_qtextformat.cpp4
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp36
-rw-r--r--tests/auto/gui/text/qtextlist/tst_qtextlist.cpp46
-rw-r--r--tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp336
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp188
-rw-r--r--tests/auto/gui/text/qzip/tst_qzip.cpp19
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp5
-rw-r--r--tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp32
-rw-r--r--tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp16
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/BLACKLIST9
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp3
-rw-r--r--tests/auto/network/access/qftp/BLACKLIST14
-rw-r--r--tests/auto/network/access/qftp/qftp.pro1
-rw-r--r--tests/auto/network/access/qftp/tst_qftp.cpp3
-rw-r--r--tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp4
-rw-r--r--tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/element.xml1
-rw-r--r--tests/auto/network/access/qnetworkreply/qnetworkreply.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp272
-rw-r--r--tests/auto/network/access/spdy/BLACKLIST4
-rw-r--r--tests/auto/network/access/spdy/spdy.pro2
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp38
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp4
-rw-r--r--tests/auto/network/bearer/qnetworksession/qnetworksession.pro2
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/test.pro2
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp99
-rw-r--r--tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp6
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp74
-rw-r--r--tests/auto/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp6
-rw-r--r--tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp2
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/BLACKLIST2
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp67
-rw-r--r--tests/auto/network/socket/platformsocketengine/BLACKLIST1
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp138
-rw-r--r--tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp53
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/BLACKLIST1
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp109
-rw-r--r--tests/auto/network/socket/qlocalsocket/BLACKLIST2
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp30
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/BLACKLIST2
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp116
-rw-r--r--tests/auto/network/socket/qtcpserver/BLACKLIST13
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp10
-rw-r--r--tests/auto/network/socket/qtcpsocket/test/test.pro2
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp112
-rw-r--r--tests/auto/network/socket/qudpsocket/BLACKLIST8
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp5
-rw-r--r--tests/auto/network/ssl/qsslcertificate/BLACKLIST3
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp81
-rw-r--r--tests/auto/network/ssl/qsslkey/BLACKLIST1
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket/BLACKLIST1
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp128
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST2
-rw-r--r--tests/auto/opengl/qgl/BLACKLIST16
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp128
-rw-r--r--tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp10
-rw-r--r--tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp4
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp1
-rw-r--r--tests/auto/other/compiler/compiler.pro3
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp204
-rw-r--r--tests/auto/other/gestures/BLACKLIST2
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp58
-rw-r--r--tests/auto/other/lancelot/tst_lancelot.cpp6
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp2
-rw-r--r--tests/auto/other/macgui/guitest.cpp4
-rw-r--r--tests/auto/other/macgui/macgui.pro2
-rw-r--r--tests/auto/other/macgui/tst_macgui.cpp4
-rw-r--r--tests/auto/other/macnativeevents/BLACKLIST13
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents_mac.cpp29
-rw-r--r--tests/auto/other/macnativeevents/tst_macnativeevents.cpp8
-rw-r--r--tests/auto/other/modeltest/modeltest.cpp2
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp56
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp57
-rw-r--r--tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro3
-rw-r--r--tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp34
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm12
-rw-r--r--tests/auto/other/qcomplextext/tst_qcomplextext.cpp2
-rw-r--r--tests/auto/other/toolsupport/tst_toolsupport.cpp4
-rw-r--r--tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp2
-rw-r--r--tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp5
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp14
-rw-r--r--[-rwxr-xr-x]tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdbbin65536 -> 65536 bytes
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_databases.h4
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp30
-rw-r--r--tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp64
-rw-r--r--tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp13
-rw-r--r--tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp30
-rw-r--r--tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp18
-rw-r--r--tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp51
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml98
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt58
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml98
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml22
-rw-r--r--tests/auto/testlib/selftests/expected_crashes_3.txt1
-rw-r--r--tests/auto/testlib/selftests/selftests.pro2
-rw-r--r--tests/auto/testlib/selftests/test/test.pro2
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp31
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp88
-rw-r--r--tests/auto/tools/qmake/qmake.pro6
-rw-r--r--tests/auto/tools/qmake/testdata/.gitignore5
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/findDeps.pro7
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/main.cpp57
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/needed.cpp1
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/objecta.h41
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/objectf.h41
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/findMocs.pro3
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/main.cpp5
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object1.h4
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object2.h4
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object3.h4
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object4.h3
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object7.h1
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object8.h50
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object9.h41
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/main.cpp38
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/object1.h40
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/rawString.pro4
-rw-r--r--tests/auto/tools/qmake/testdata/resources/main.cpp42
-rw-r--r--tests/auto/tools/qmake/testdata/resources/resources.pro10
-rw-r--r--tests/auto/tools/qmake/testdata/resources/subdir/file.txt0
-rw-r--r--tests/auto/tools/qmake/testdata/resources/test.qrc5
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp61
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp11
-rw-r--r--tests/auto/tools/qmakelib/tst_qmakelib.h4
-rw-r--r--tests/auto/tools/uic/tst_uic.cpp1
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro3
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp35
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp16
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp81
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp196
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/BLACKLIST5
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp274
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp96
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp4
-rw-r--r--tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp8
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp32
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp38
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp113
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp47
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST18
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp13
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp18
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp42
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp4
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp52
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp16
-rw-r--r--tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp17
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro1
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp54
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp10
-rw-r--r--tests/auto/widgets/itemviews/qtableview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp12
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp25
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/qtreeview.pro2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp53
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp53
-rw-r--r--tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp4
-rw-r--r--tests/auto/widgets/kernel/qaction/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp3
-rw-r--r--tests/auto/widgets/kernel/qapplication/BLACKLIST4
-rw-r--r--tests/auto/widgets/kernel/qapplication/qapplication.pro3
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/test.pro9
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp159
-rw-r--r--tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp46
-rw-r--r--tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro5
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp103
-rw-r--r--tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp1
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp429
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp160
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp7
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp24
-rw-r--r--tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp21
-rw-r--r--tests/auto/widgets/kernel/qtooltip/BLACKLIST4
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST78
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp135
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp91
-rw-r--r--tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp33
-rw-r--r--tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp6
-rw-r--r--tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp4
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp10
-rw-r--r--tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp16
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp192
-rw-r--r--tests/auto/widgets/util/qcompleter/BLACKLIST2
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp22
-rw-r--r--tests/auto/widgets/util/qscroller/tst_qscroller.cpp2
-rw-r--r--tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp2
-rw-r--r--tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp34
-rw-r--r--tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp6
-rw-r--r--tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp36
-rw-r--r--tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp44
-rw-r--r--tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp8
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp14
-rw-r--r--tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp6
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp88
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp33
-rw-r--r--tests/auto/widgets/widgets/qlineedit/qlineedit.pro1
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp86
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp159
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp30
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp20
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp93
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST1
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp150
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp78
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro1
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp30
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp4
-rw-r--r--tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qspinbox/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabbar/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp42
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp60
-rw-r--r--tests/auto/widgets/widgets/qtextedit/qtextedit.pro2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp48
-rw-r--r--tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp32
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp4
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp19
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp2
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.entbin4 -> 4 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.entbin54 -> 54 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.entbin12 -> 12 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent0
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp4
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp4
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h3
-rw-r--r--tests/benchmarks/corelib/tools/qringbuffer/main.cpp4
-rw-r--r--tests/benchmarks/gui/text/qtext/main.cpp14
-rw-r--r--tests/benchmarks/sql/kernel/qsqlquery/main.cpp40
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/main.mm168
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro10
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/rasterwindow.cpp188
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/rasterwindow.h65
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/window.cpp195
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/window.h66
-rw-r--r--tests/manual/diaglib/eventfilter.cpp9
-rw-r--r--tests/manual/diaglib/nativewindowdump_win.cpp48
-rw-r--r--tests/manual/diaglib/qwindowdump.cpp13
-rw-r--r--tests/manual/diaglib/textdump.cpp12
-rw-r--r--tests/manual/dialogs/dialogs.pro17
-rw-r--r--tests/manual/highdpi/dragwidget.cpp223
-rw-r--r--tests/manual/highdpi/dragwidget.h68
-rw-r--r--tests/manual/highdpi/highdpi.pro13
-rw-r--r--tests/manual/highdpi/highdpi.qrc1
-rw-r--r--tests/manual/highdpi/main.cpp725
-rw-r--r--tests/manual/highdpi/qticon16@3x.pngbin0 -> 5307 bytes
-rw-r--r--tests/manual/qcursor/qcursor.pro2
-rw-r--r--tests/manual/qcursor/qcursorhighdpi/main.cpp321
-rw-r--r--tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro6
-rw-r--r--tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp7
-rw-r--r--tests/manual/qopenglwidget/openglwidget/main.cpp175
-rw-r--r--tests/manual/qopenglwidget/openglwidget/openglwidget.cpp23
-rw-r--r--tests/manual/qopenglwidget/openglwidget/openglwidget.h5
-rw-r--r--tests/manual/qscreen/main.cpp148
-rw-r--r--tests/manual/qscreen/propertywatcher.cpp81
-rw-r--r--tests/manual/qscreen/propertywatcher.h14
-rw-r--r--tests/manual/qscreen/qscreen.pro1
-rw-r--r--tests/manual/qsysinfo/main.cpp1
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.cpp3
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.h1
-rw-r--r--tests/manual/qtabletevent/regular_widgets/main.cpp34
-rw-r--r--tests/manual/touch/main.cpp433
-rw-r--r--tools/configure/Makefile.mingw5
-rw-r--r--tools/configure/Makefile.win326
-rw-r--r--tools/configure/configure.pro2
-rw-r--r--tools/configure/configureapp.cpp235
-rw-r--r--tools/configure/configureapp.h5
-rw-r--r--tools/configure/environment.cpp9
-rw-r--r--tools/shared/windows/registry.cpp6
-rw-r--r--tools/shared/windows/registry_p.h8
-rw-r--r--util/unicode/data/ArabicShaping.txt38
-rw-r--r--util/unicode/data/BidiMirroring.txt10
-rw-r--r--util/unicode/data/Blocks.txt25
-rw-r--r--util/unicode/data/CaseFolding.txt147
-rw-r--r--util/unicode/data/DerivedAge.txt74
-rw-r--r--util/unicode/data/DerivedNormalizationProps.txt157
-rw-r--r--util/unicode/data/GraphemeBreakProperty.txt33
-rw-r--r--util/unicode/data/LineBreak.txt132
-rw-r--r--util/unicode/data/NormalizationCorrections.txt6
-rw-r--r--util/unicode/data/Scripts.txt180
-rw-r--r--util/unicode/data/SentenceBreakProperty.txt90
-rw-r--r--util/unicode/data/SpecialCasing.txt4
-rw-r--r--util/unicode/data/UnicodeData.txt2161
-rw-r--r--util/unicode/data/WordBreakProperty.txt69
-rw-r--r--util/unicode/main.cpp154
-rwxr-xr-xutil/unicode/writingSystems.sh2
3768 files changed, 130780 insertions, 158561 deletions
diff --git a/.gitignore b/.gitignore
index 5a23b64d69..1ecd8c1009 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,10 @@ pcviewer.cfg
*_resource.rc
.#*
*.*#
+*_wrapper.sh
+*_wrapper.bat
+wrapper.sh
+wrapper.bat
core
.qmake.cache
.qmake.vars
diff --git a/.qmake.conf b/.qmake.conf
index 481544b253..732b5da262 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -5,5 +5,4 @@ CONFIG += warning_clean
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
-# In qtbase, all modules follow qglobal.h
-MODULE_VERSION = $$QT_VERSION
+MODULE_VERSION = 5.6.0
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 3b3e127e86..cca654e3b4 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -81,6 +81,8 @@ our @qpa_headers = ();
# will be derived from sync.profile
our %reverse_classnames = ();
+my %ignore_for_include_check = ();
+my %ignore_for_qt_begin_namespace_check = ();
# global variables (modified by options)
my $isunix = 0;
@@ -319,6 +321,75 @@ sub classNames {
return @ret;
}
+sub check_header {
+ my ($lib, $header, $iheader, $public_header, $private_header) = @_;
+ my $header_skip_qt_begin_namespace_test = 0;
+
+ if ($public_header) {
+ return if ($ignore_for_include_check{$header});
+ $header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header});
+ }
+
+ open(F, "<$iheader") or return;
+ my $qt_begin_namespace_found = 0;
+ my $qt_end_namespace_found = 0;
+ my $qt_namespace_suffix = "";
+ my $line;
+ my $stop_processing = 0;
+ my $we_mean_it = 0;
+ while ($line = <F>) {
+ chomp $line;
+ my $output_line = 1;
+ if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
+ $stop_processing = 1;
+ last;
+ }
+ if ($line =~ /^ *\# *include/) {
+ my $include = $line;
+ if ($line =~ /<.*>/) {
+ $include =~ s,.*<(.*)>.*,$1,;
+ } elsif ($line =~ /".*"/) {
+ $include =~ s,.*"(.*)".*,$1,;
+ } else {
+ $include = 0;
+ }
+ if ($include && $public_header) {
+ print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p.h$/);
+ for my $trylib (keys(%modules)) {
+ if (-e "$out_basedir/include/$trylib/$include") {
+ print STDERR "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
+ }
+ }
+ }
+ } elsif (!$private_header) {
+ if ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
+ $qt_namespace_suffix = defined($1) ? $1 : "";
+ $qt_begin_namespace_found = 1;
+ } elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
+ $qt_end_namespace_found = 1;
+ }
+ } elsif ($line =~ "^// We mean it.") {
+ ++$we_mean_it;
+ }
+ }
+
+ if ($public_header) {
+ if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) {
+ if ($qt_begin_namespace_found == 0) {
+ print STDERR "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
+ }
+
+ if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) {
+ print STDERR "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n";
+ }
+ }
+ } elsif ($private_header) {
+ print STDERR "$lib: WARNING: $iheader does not have the \"We mean it.\" warning\n" if (!$we_mean_it);
+ }
+
+ close(F);
+}
+
sub make_path {
my ($dir, $lib, $be_verbose) = @_;
unless(-e $dir) {
@@ -693,7 +764,7 @@ while ( @ARGV ) {
$var = "version";
$val = shift @ARGV;
} elsif($arg =~/^-/) {
- print "Unknown option: $arg\n\n" if(!$var);
+ print STDERR "ERROR: Unknown option: $arg\n\n" if (!$var);
showUsage();
} else {
$basedir = locateSyncProfile($arg);
@@ -706,7 +777,7 @@ while ( @ARGV ) {
#do something
if(!$var || $var eq "show_help") {
- print "Unknown option: $arg\n\n" if(!$var);
+ print STDERR "ERROR: Unknown option: $arg\n\n" if (!$var);
showUsage();
} elsif ($var eq "copy") {
if($val eq "yes") {
@@ -786,6 +857,7 @@ while ( @ARGV ) {
# if we have no $basedir we cannot be sure which sources you want, so die
die "Could not find any sync.profile for your module!\nPass <module directory> to syncqt to sync your header files.\nsyncqt failed" if (!$basedir);
+die "The -version argument is mandatory" if (!$module_version);
our @ignore_headers = ();
our @ignore_for_master_contents = ();
@@ -800,16 +872,11 @@ loadSyncProfile(\$basedir, \$out_basedir);
@modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate;
+%ignore_for_include_check = map { $_ => 1 } @ignore_for_include_check;
+%ignore_for_qt_begin_namespace_check = map { $_ => 1 } @ignore_for_qt_begin_namespace_check;
$isunix = checkUnix; #cache checkUnix
-if (!$module_version) {
- my $filco = fileContents($basedir."/src/corelib/global/qglobal.h");
- if ($filco !~ m,.*^#[ \t]*define[ \t]+QT_VERSION_STR[ \t]+"([^"]+)".*,sm) {
- die "Cannot determine Qt/Module version. Use -version.\n";
- }
- $module_version = $1;
-}
foreach my $lib (@modules_to_sync) {
die "No such module: $lib" unless(defined $modules{$lib});
@@ -818,6 +885,7 @@ foreach my $lib (@modules_to_sync) {
my $is_qt = !($module =~ s/^!//);
my @dirs = split(/;/, $module);
my $dir = $dirs[0];
+ shift @dirs if ($dir =~ s/^>//);
my $pathtoheaders = "";
$pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib});
@@ -936,6 +1004,12 @@ foreach my $lib (@modules_to_sync) {
my $clean_header;
my $iheader = $subdir . "/" . $header;
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
+ if ($check_includes) {
+ # We need both $public_header and $private_header because QPA headers count as neither
+ my $private_header = !$public_header && !$qpa_header
+ && $header =~ /_p\.h$/ && $subdir !~ /3rdparty/;
+ check_header($lib, $header, $iheader, $public_header, $private_header);
+ }
my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : ();
if($showonly) {
print "$header [$lib]\n";
@@ -1133,96 +1207,4 @@ foreach my $lib (@modules_to_sync) {
}
}
-if($check_includes) {
- foreach my $lib (@modules_to_sync) {
- next if ($modules{$lib} =~ /^!/);
- #calc subdirs
- my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib}));
-
- foreach my $subdir (@subdirs) {
- my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
- foreach my $header (@headers) {
- my $header_skip_qt_begin_namespace_test = 0;
- $header = 0 if($header =~ /^ui_.*.h/);
- $header = 0 if ($header eq lc($lib)."version.h");
- foreach (@ignore_headers) {
- $header = 0 if($header eq $_);
- }
- if($header) {
- my $public_header = $header;
- if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
- $public_header = 0;
- } elsif (isQpaHeader($public_header)) {
- $public_header = 0;
- } else {
- foreach (@ignore_for_master_contents) {
- $public_header = 0 if($header eq $_);
- }
- if($public_header) {
- foreach (@ignore_for_include_check) {
- $public_header = 0 if($header eq $_);
- }
- foreach(@ignore_for_qt_begin_namespace_check) {
- $header_skip_qt_begin_namespace_test = 1 if ($header eq $_);
- }
- }
- }
-
- my $iheader = $subdir . "/" . $header;
- if($public_header) {
- if(open(F, "<$iheader")) {
- my $qt_begin_namespace_found = 0;
- my $qt_end_namespace_found = 0;
- my $qt_namespace_suffix = "";
- my $line;
- my $stop_processing = 0;
- while($line = <F>) {
- chomp $line;
- my $output_line = 1;
- if($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
- $stop_processing = 1;
- last;
- } elsif($line =~ /^ *\# *include/) {
- my $include = $line;
- if($line =~ /<.*>/) {
- $include =~ s,.*<(.*)>.*,$1,;
- } elsif($line =~ /".*"/) {
- $include =~ s,.*"(.*)".*,$1,;
- } else {
- $include = 0;
- }
- if($include) {
- for my $trylib (keys(%modules)) {
- if(-e "$out_basedir/include/$trylib/$include") {
- print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
- }
- }
- }
- } elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
- $qt_namespace_suffix = defined($1) ? $1 : "";
- $qt_begin_namespace_found = 1;
- } elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
- $qt_end_namespace_found = 1;
- }
- }
-
- if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) {
- if ($qt_begin_namespace_found == 0) {
- print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
- }
-
- if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) {
- print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n";
- }
- }
-
- close(F);
- }
- }
- }
- }
- }
- }
-}
-
exit 0;
diff --git a/config.tests/arch/arch.cpp b/config.tests/arch/arch.cpp
index 854228cc9c..c4f23f7bcd 100644
--- a/config.tests/arch/arch.cpp
+++ b/config.tests/arch/arch.cpp
@@ -57,6 +57,10 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
// Advanced Bit Manipulation, AMD Barcelona (family 10h)
" abm"
#endif
+#ifdef __ADX__
+// Multi-Precision Add-Carry Instruction Extensions, Intel Core 5th generation ("Broadwell")
+" adx"
+#endif
#ifdef __AES__
// AES New Instructions, Intel Core-i7 second generation ("Sandy Bridge")
" aes"
@@ -70,19 +74,19 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
" avx2"
#endif
#ifdef __AVX512F__
-// AVX512 Foundation, Intel Xeon Phi codename "Knights Landing"
+// AVX512 Foundation, Intel Xeon Phi codename "Knights Landing" and Intel Xeon codename "Skylake"
" avx512f"
#endif
#ifdef __AVX512CD__
-// AVX512 Conflict Detection, Intel Xeon Phi codename "Knights Landing"
+// AVX512 Conflict Detection, Intel Xeon Phi codename "Knights Landing" and Intel Xeon codename "Skylake"
" avx512cd"
#endif
#ifdef __AVX512DQ__
-// AVX512 Double & Quadword, future Intel Xeon processor
+// AVX512 Double & Quadword, Intel Xeon processor codename "Skylake"
" avx512dq"
#endif
#ifdef __AVX512BW__
-// AVX512 Byte & Word, future Intel Xeon processor
+// AVX512 Byte & Word, Intel Xeon processor codename "Skylake"
" avx512bw"
#endif
#ifdef __AVX512ER__
@@ -94,9 +98,17 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
" avx512pf"
#endif
#ifdef __AVX512VL__
-// AVX512 Vector Length, future Intel Xeon processor
+// AVX512 Vector Length, Intel Xeon processor codename "Skylake"
" avx512vl"
#endif
+#ifdef __AVX512IFMA__
+// AVX512 Integer Fused Multiply-Add, Intel processor codename "Cannonlake"
+" avx512ifma"
+#endif
+#ifdef __AVX512VBMI__
+// AVX512 Vector Byte Manipulation Instructions, Intel processor codename "Cannonlake"
+" avx512vbmi"
+#endif
#ifdef __BMI__
// Bit Manipulation Instructions 1, Intel Core 4th Generation ("Haswell"), AMD "Bulldozer 2"
" bmi"
@@ -143,6 +155,10 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
// Move Big Endian, Intel Atom & "Haswell"
" movbe"
#endif
+#ifdef __MPX__
+// Memory Protection Extensions, Intel Core processor codename "Skylake"
+" mpx"
+#endif
#ifdef __NO_SAHF__
// missing SAHF instruction in 64-bit, up to Intel Pentium 4 64-bit ("Nocona"), AMD Athlon FX
// Note: the macro is not defined, so this will never show up
@@ -156,10 +172,26 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
// Population Count (count of set bits), Intel Core-i7 second generation ("Sandy Bridge")
" popcnt"
#endif
+#ifdef __PREFETCHWT1__
+// Prefetch data for writing with T1 hint, Intel processor TBA
+" prefetchwt1"
+#endif
+#ifdef __PRFCHW__
+// Prefetch data for writing, Intel Core 5th Generation ("Broadwell")
+" prfchw"
+#endif
#ifdef __RDRND__
// Random number generator, Intel Core 3rd Generation ("Ivy Bridge")
" rdrnd"
#endif
+#ifdef __RDSEED__
+// Random number generator, Intel Core 5th Generation ("Broadwell")
+" rdseed"
+#endif
+#ifdef __RTM__
+// Restricted Transactional Memory, Intel Core 4th Generation ("Haswell")
+" rtm"
+#endif
#ifdef __SHA__
// SHA-1 and SHA-256 instructions, Intel processor TBA
" sha"
@@ -205,7 +237,7 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
#endif
// -- ARM --
-#ifdef __ARM_NEON__
+#if defined(__ARM_NEON) || defined(__ARM_NEON__)
" neon"
#endif
#ifdef __IWMMXT__
diff --git a/config.tests/common/c++11/c++11.cpp b/config.tests/common/c++11/c++11.cpp
index 2560113c3f..dddb22a9e2 100644
--- a/config.tests/common/c++11/c++11.cpp
+++ b/config.tests/common/c++11/c++11.cpp
@@ -38,12 +38,6 @@
#endif
#include <utility>
-#if defined(__clang__)
-# if __has_feature(cxx_generalized_initializers)
-// On OS X, the libstdc++ headers don't include <initializer_list>
-// This #include here forces a failure unless we're using libc++
-# include <initializer_list>
-# endif
-#endif
+#include <initializer_list>
-int main(int, char **) { return 0; }
+int main(int, char **) { return std::move(0); }
diff --git a/config.tests/common/c++14/c++14.cpp b/config.tests/common/c++14/c++14.cpp
new file mode 100644
index 0000000000..e17e51831d
--- /dev/null
+++ b/config.tests/common/c++14/c++14.cpp
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the configuration module 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$
+**
+****************************************************************************/
+
+#if __cplusplus > 201103L
+// Compiler claims to support C++14, trust it
+#else
+# error "__cplusplus must be > 201103L (the value of C++11)"
+#endif
+
+int main(int, char **) { return 0; }
diff --git a/config.tests/common/c++14/c++14.pro b/config.tests/common/c++14/c++14.pro
new file mode 100644
index 0000000000..cbd78ba6fe
--- /dev/null
+++ b/config.tests/common/c++14/c++14.pro
@@ -0,0 +1,3 @@
+SOURCES = c++14.cpp
+CONFIG += c++11 c++14 console
+CONFIG -= qt
diff --git a/config.tests/common/c++1z/c++1z.cpp b/config.tests/common/c++1z/c++1z.cpp
new file mode 100644
index 0000000000..2b61cfec49
--- /dev/null
+++ b/config.tests/common/c++1z/c++1z.cpp
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the configuration module 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$
+**
+****************************************************************************/
+
+#if __cplusplus > 201402L
+// Compiler claims to support experimental C++1z, trust it
+#else
+# error "__cplusplus must be > 201402L (the value for C++14)"
+#endif
+
+int main(int, char **) { return 0; }
diff --git a/config.tests/common/c++1z/c++1z.pro b/config.tests/common/c++1z/c++1z.pro
new file mode 100644
index 0000000000..3a24946276
--- /dev/null
+++ b/config.tests/common/c++1z/c++1z.pro
@@ -0,0 +1,3 @@
+SOURCES = c++1z.cpp
+CONFIG += c++11 c++14 c++1z console
+CONFIG -= qt
diff --git a/config.tests/common/c++default/c++default.cpp b/config.tests/common/c++default/c++default.cpp
new file mode 100644
index 0000000000..018963beb3
--- /dev/null
+++ b/config.tests/common/c++default/c++default.cpp
@@ -0,0 +1 @@
+__cplusplus
diff --git a/config.tests/common/c++default/c++default.pro b/config.tests/common/c++default/c++default.pro
new file mode 100644
index 0000000000..7e6bcefe69
--- /dev/null
+++ b/config.tests/common/c++default/c++default.pro
@@ -0,0 +1,14 @@
+TEMPLATE = aux
+CONFIG -= qt c++11
+PREPROCESSOR_SOURCES += c++default.cpp
+
+preprocessor.commands = $(CXX) $(CXXFLAGS) $(INCPATH) -o $@ -E $<
+msvc:preprocessor.commands = $(CXX) $(CXXFLAGS) $(INCPATH) -E ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
+preprocessor.output = ${QMAKE_FILE_BASE}.ii
+preprocessor.input = PREPROCESSOR_SOURCES
+preprocessor.variable_out = GENERATED_FILES
+QMAKE_EXTRA_COMPILERS += preprocessor
+
+all.target = all
+all.depends += c++default.ii
+QMAKE_EXTRA_TARGETS += all
diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp
new file mode 100644
index 0000000000..06809b2624
--- /dev/null
+++ b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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$
+**
+****************************************************************************/
+
+// Test both EGLDevice/Output/Stream and DRM as we only use them in combination.
+//
+// Other KMS/DRM tests relying on pkgconfig for libdrm are not suitable since
+// some systems do not use pkgconfig for the graphics stuff.
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+int main(int, char **)
+{
+ EGLDeviceEXT device = 0;
+ EGLStreamKHR stream = 0;
+ EGLOutputLayerEXT layer = 0;
+ drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0);
+ return EGL_DRM_CRTC_EXT;
+}
diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro
new file mode 100644
index 0000000000..87214abc7a
--- /dev/null
+++ b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro
@@ -0,0 +1,12 @@
+SOURCES = eglfs-egldevice.cpp
+
+for(p, QMAKE_LIBDIR_EGL) {
+ exists($$p):LIBS += -L$$p
+}
+
+INCLUDEPATH += $$QMAKE_INCDIR_EGL
+LIBS += $$QMAKE_LIBS_EGL
+
+LIBS += -ldrm
+
+CONFIG -= qt
diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp
new file mode 100644
index 0000000000..1914d6452b
--- /dev/null
+++ b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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 <EGL/egl.h>
+#include <GLES2/gl2.h>
+
+int main(int, char **)
+{
+ EGLDisplay dpy = 0;
+ EGLContext ctx = 0;
+ mali_native_window *w = 0;
+ eglDestroyContext(dpy, ctx);
+ return 0;
+}
diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro
new file mode 100644
index 0000000000..85bcf6484a
--- /dev/null
+++ b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro
@@ -0,0 +1,5 @@
+SOURCES = eglfs-mali-2.cpp
+
+CONFIG -= qt
+
+LIBS += -lEGL -lGLESv2
diff --git a/config.tests/qpa/gbm/gbm.cpp b/config.tests/qpa/gbm/gbm.cpp
new file mode 100644
index 0000000000..d4f211163d
--- /dev/null
+++ b/config.tests/qpa/gbm/gbm.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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 <stdlib.h>
+#include <stdint.h>
+extern "C" {
+#include <gbm.h>
+}
+
+int main(int, char **)
+{
+ gbm_surface *surface = 0;
+ return 0;
+}
diff --git a/config.tests/qpa/gbm/gbm.pro b/config.tests/qpa/gbm/gbm.pro
new file mode 100644
index 0000000000..19177062a8
--- /dev/null
+++ b/config.tests/qpa/gbm/gbm.pro
@@ -0,0 +1,4 @@
+SOURCES = gbm.cpp
+CONFIG += link_pkgconfig
+PKGCONFIG += gbm
+CONFIG -= qt
diff --git a/config.tests/qpa/kms/kms.cpp b/config.tests/qpa/kms/kms.cpp
index 64c11158c5..ac0c281386 100644
--- a/config.tests/qpa/kms/kms.cpp
+++ b/config.tests/qpa/kms/kms.cpp
@@ -32,17 +32,14 @@
****************************************************************************/
#include <stdlib.h>
+#include <stdint.h>
extern "C" {
-#include <gbm.h>
#include <xf86drmMode.h>
#include <xf86drm.h>
}
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
int main(int, char **)
{
- // Check for gbm_surface which is quite a recent addition.
- gbm_surface *surface = 0;
+ drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0);
return 0;
}
diff --git a/config.tests/qpa/kms/kms.pro b/config.tests/qpa/kms/kms.pro
index 618063dbb9..1fb73677e7 100644
--- a/config.tests/qpa/kms/kms.pro
+++ b/config.tests/qpa/kms/kms.pro
@@ -1,4 +1,4 @@
SOURCES = kms.cpp
CONFIG += link_pkgconfig
-PKGCONFIG += libdrm libudev egl gbm glesv2
+PKGCONFIG += libdrm libudev
CONFIG -= qt
diff --git a/config.tests/qpa/mirclient/mirclient.cpp b/config.tests/qpa/mirclient/mirclient.cpp
new file mode 100644
index 0000000000..c7148e82f9
--- /dev/null
+++ b/config.tests/qpa/mirclient/mirclient.cpp
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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 <mir_toolkit/mir_client_library.h>
+#include <ubuntu/application/lifecycle_delegate.h>
+#include <EGL/egl.h>
+
+static void surfaceCreateCallback(MirSurface*, void*)
+{
+}
+
+
+int main(int, char **)
+{
+ u_application_lifecycle_delegate_new();
+ mir_surface_create(0, surfaceCreateCallback, 0);
+}
diff --git a/config.tests/qpa/mirclient/mirclient.pro b/config.tests/qpa/mirclient/mirclient.pro
new file mode 100644
index 0000000000..b397c2d08a
--- /dev/null
+++ b/config.tests/qpa/mirclient/mirclient.pro
@@ -0,0 +1,4 @@
+SOURCES = mirclient.cpp
+CONFIG += link_pkgconfig
+PKGCONFIG += egl mirclient ubuntu-platform-api
+CONFIG -= qt
diff --git a/config.tests/qpa/wayland-server/wayland-server.pro b/config.tests/qpa/wayland-server/wayland-server.pro
new file mode 100644
index 0000000000..c07740d20f
--- /dev/null
+++ b/config.tests/qpa/wayland-server/wayland-server.pro
@@ -0,0 +1,5 @@
+SOURCES = wl.cpp
+
+CONFIG -= qt
+CONFIG += link_pkgconfig
+PKGCONFIG += wayland-server
diff --git a/config.tests/qpa/wayland-server/wl.cpp b/config.tests/qpa/wayland-server/wl.cpp
new file mode 100644
index 0000000000..ba1756af57
--- /dev/null
+++ b/config.tests/qpa/wayland-server/wl.cpp
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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 <wayland-server.h>
+
+int main(int, char **)
+{
+ wl_display_create();
+ return 0;
+}
diff --git a/config.tests/unix/cloexec/cloexec.cpp b/config.tests/unix/cloexec/cloexec.cpp
new file mode 100644
index 0000000000..3f127d8d3f
--- /dev/null
+++ b/config.tests/unix/cloexec/cloexec.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the configuration module 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$
+**
+****************************************************************************/
+
+#define _GNU_SOURCE 1
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int main()
+{
+ int pipes[2];
+ (void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);
+ (void) fcntl(0, F_DUPFD_CLOEXEC, 0);
+ (void) dup3(0, 3, O_CLOEXEC);
+ (void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK);
+ return 0;
+}
diff --git a/config.tests/unix/cloexec/cloexec.pro b/config.tests/unix/cloexec/cloexec.pro
new file mode 100644
index 0000000000..bc735f9b1f
--- /dev/null
+++ b/config.tests/unix/cloexec/cloexec.pro
@@ -0,0 +1,3 @@
+SOURCES = cloexec.cpp
+CONFIG -= qt
+QT =
diff --git a/config.tests/unix/freetype/freetype.pri b/config.tests/unix/freetype/freetype.pri
index be2fc33265..05299ed2fd 100644
--- a/config.tests/unix/freetype/freetype.pri
+++ b/config.tests/unix/freetype/freetype.pri
@@ -2,6 +2,7 @@
TRY_INCLUDEPATHS = /include /usr/include $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
# LSB doesn't allow using headers from /include or /usr/include
linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
+ haiku:TRY_INCLUDEPATHS += /system/develop/headers
for(p, TRY_INCLUDEPATHS) {
p = $$join(p, "", "", "/freetype2")
exists($$p):INCLUDEPATH *= $$p
diff --git a/config.tests/unix/harfbuzz/harfbuzz.cpp b/config.tests/unix/harfbuzz/harfbuzz.cpp
index bbaa9fc14d..1e6f7e70d6 100644
--- a/config.tests/unix/harfbuzz/harfbuzz.cpp
+++ b/config.tests/unix/harfbuzz/harfbuzz.cpp
@@ -33,7 +33,7 @@
#include <harfbuzz/hb.h>
-#if !HB_VERSION_ATLEAST(0, 9, 31)
+#if !HB_VERSION_ATLEAST(0, 9, 42)
# error "This version of harfbuzz is too old."
#endif
diff --git a/config.tests/unix/ptrsize.test b/config.tests/unix/ptrsize.test
deleted file mode 100755
index 4f42c6d11d..0000000000
--- a/config.tests/unix/ptrsize.test
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-QMKSPEC=$1
-VERBOSE=$2
-SRCDIR=$3
-OUTDIR=$4
-
-# debuggery
-[ "$VERBOSE" = "yes" ] && echo "Testing size of pointers ... ($*)"
-
-# build and run a test program
-test -d "$OUTDIR/config.tests/unix/ptrsize" || mkdir -p "$OUTDIR/config.tests/unix/ptrsize"
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG-=app_bundle" "$SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro" -o "$OUTDIR/config.tests/unix/ptrsize/Makefile" >/dev/null 2>&1
-cd "$OUTDIR/config.tests/unix/ptrsize"
-
-if [ "$VERBOSE" = "yes" ]; then
- ($MAKE clean && $MAKE)
-else
- ($MAKE clean && $MAKE) >/dev/null 2>&1
-fi
-RETVAL=$?
-
-if [ "$RETVAL" -ne 0 ]; then
- PTRSIZE=4
-else
- PTRSIZE=8
-fi
-
-
-# done
-[ "$VERBOSE" = "yes" ] && echo "Pointer size: $PTRSIZE"
-exit $PTRSIZE
diff --git a/config.tests/unix/ptrsize/ptrsizetest.cpp b/config.tests/unix/ptrsize/ptrsizetest.cpp
deleted file mode 100644
index 826095d0e9..0000000000
--- a/config.tests/unix/ptrsize/ptrsizetest.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the config.tests 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$
-**
-****************************************************************************/
-
-/* Sample program for configure to test pointer size on target
-platforms.
-*/
-
-template<int>
-struct QPointerSizeTest
-{
-};
-
-template<>
-struct QPointerSizeTest<8>
-{
- enum { PointerSize = 8 };
-};
-
-int main( int, char ** )
-{
- return QPointerSizeTest<sizeof(void*)>::PointerSize;
-}
-
diff --git a/config.tests/unix/ptrsize/ptrsizetest.pro b/config.tests/unix/ptrsize/ptrsizetest.pro
deleted file mode 100644
index a7ae38a5d9..0000000000
--- a/config.tests/unix/ptrsize/ptrsizetest.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES = ptrsizetest.cpp
-CONFIG -= qt dylib
-CONFIG += debug console
diff --git a/config.tests/unix/syslog/syslog.c b/config.tests/unix/syslog/syslog.c
new file mode 100644
index 0000000000..01e4bbaf8c
--- /dev/null
+++ b/config.tests/unix/syslog/syslog.c
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Tasuku Suzuki <stasuku@gmail.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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 <syslog.h>
+
+int main(int argc, char **argv)
+{
+ openlog("qt", 0, LOG_USER);
+ syslog(LOG_INFO, "configure");
+ closelog();
+ return 0;
+}
diff --git a/config.tests/unix/syslog/syslog.pro b/config.tests/unix/syslog/syslog.pro
new file mode 100644
index 0000000000..abe8cc9cd7
--- /dev/null
+++ b/config.tests/unix/syslog/syslog.pro
@@ -0,0 +1,3 @@
+SOURCES = syslog.c
+
+CONFIG -= qt
diff --git a/config.tests/win/directwrite/directwrite.cpp b/config.tests/win/directwrite/directwrite.cpp
new file mode 100644
index 0000000000..01bea19faf
--- /dev/null
+++ b/config.tests/win/directwrite/directwrite.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests 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 <dwrite.h>
+#include <d2d1.h>
+
+int main(int, char**)
+{
+ IDWriteFactory *factory = 0;
+ DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory),
+ reinterpret_cast<IUnknown **>(&factory));
+ return 0;
+}
diff --git a/config.tests/win/directwrite/directwrite.pro b/config.tests/win/directwrite/directwrite.pro
new file mode 100644
index 0000000000..9a4612ca11
--- /dev/null
+++ b/config.tests/win/directwrite/directwrite.pro
@@ -0,0 +1,4 @@
+SOURCES = directwrite.cpp
+LIBS += -ldwrite
+CONFIG -= qt
+CONFIG += console
diff --git a/configure b/configure
index 254542fc6c..0c579b3e74 100755
--- a/configure
+++ b/configure
@@ -318,7 +318,7 @@ macSDKify()
val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-))
echo "$var=$val"
;;
- QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*|QMAKE_OBJECTIVE_CFLAGS=*)
+ QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*)
echo "$line -isysroot $sysroot $version_min_flag"
;;
QMAKE_LFLAGS=*)
@@ -453,7 +453,7 @@ DeviceVar()
eq="="
;;
*)
- echo >&2 "BUG: wrong command to QMakeVar: $1"
+ echo >&2 "BUG: wrong command to DeviceVar: $1"
;;
esac
@@ -539,23 +539,16 @@ fi
#-----------------------------------------------------------------------------
# Qt version detection
#-----------------------------------------------------------------------------
-QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
+QT_VERSION=
QT_MAJOR_VERSION=
QT_MINOR_VERSION=0
QT_PATCH_VERSION=0
-if [ -n "$QT_VERSION" ]; then
- QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
- MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
- if [ -n "$MAJOR" ]; then
- MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
- PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
- QT_MAJOR_VERSION="$MAJOR"
- [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
- [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
- fi
-fi
+eval `sed -n -e 's/^MODULE_VERSION = \(\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*\)$/QT_VERSION=\1\
+ QT_MAJOR_VERSION=\2\
+ QT_MINOR_VERSION=\3\
+ QT_PATCH_VERSION=\4/p' < "$relpath"/.qmake.conf`
if [ -z "$QT_MAJOR_VERSION" ]; then
- echo "Cannot process version from qglobal.h: $QT_VERSION"
+ echo "Cannot process version from .qmake.conf"
echo "Cannot proceed."
exit 1
fi
@@ -611,6 +604,7 @@ CFG_MYSQL_CONFIG=
CFG_PSQL_CONFIG=
CFG_DEBUG_RELEASE=no
CFG_FORCEDEBUGINFO=no
+CFG_RELEASE_TOOLS=no
CFG_SHARED=yes
CFG_SM=auto
CFG_XSHAPE=auto
@@ -621,6 +615,7 @@ CFG_XFIXES=runtime
CFG_ZLIB=auto
CFG_MTDEV=auto
CFG_JOURNALD=no
+CFG_SYSLOG=no
CFG_SQLITE=qt
CFG_GIF=auto
CFG_PNG=yes
@@ -648,7 +643,6 @@ CFG_BUILD_PARTS=""
CFG_NOBUILD_PARTS=""
CFG_SKIP_MODULES=""
CFG_COMPILE_EXAMPLES=yes
-CFG_RELEASE_QMAKE=no
CFG_AUDIO_BACKEND=auto
CFG_QML_DEBUG=yes
CFG_PKGCONFIG=auto
@@ -684,11 +678,15 @@ CFG_XCB_XLIB=auto
CFG_XCB_GLX=no
CFG_EGLFS=auto
CFG_EGLFS_BRCM=no
+CFG_EGLFS_EGLDEVICE=no
CFG_EGLFS_MALI=no
CFG_EGLFS_VIV=no
+CFG_EGLFS_VIV_WL=no
CFG_DIRECTFB=auto
+CFG_GBM=auto
CFG_LINUXFB=auto
CFG_KMS=auto
+CFG_MIRCLIENT=auto
CFG_LIBUDEV=auto
CFG_LIBINPUT=auto
CFG_OBSOLETE_WAYLAND=no
@@ -705,6 +703,7 @@ CFG_OPENSSL=auto
CFG_LIBPROXY=auto
CFG_SECURETRANSPORT=auto
CFG_PRECOMPILE=auto
+CFG_LTCG=no
CFG_SEPARATE_DEBUG_INFO=no
CFG_REDUCE_EXPORTS=auto
CFG_SSE2=auto
@@ -729,6 +728,7 @@ CFG_IPV6IFNAME=auto
CFG_GETIFADDRS=auto
CFG_INOTIFY=auto
CFG_EVENTFD=auto
+CFG_CLOEXEC=no
CFG_RPATH=yes
CFG_FRAMEWORK=auto
CFG_USE_GOLD_LINKER=auto
@@ -767,7 +767,7 @@ CFG_SANITIZE_MEMORY=no
CFG_SANITIZE_UNDEFINED=no
CFG_PCRE=auto
QPA_PLATFORM_GUARD=yes
-CFG_CXX11=auto
+CFG_STDCXX=auto
CFG_DIRECTWRITE=no
CFG_WERROR=auto
CFG_HEADERSCLEAN=auto
@@ -933,6 +933,7 @@ while [ "$#" -gt 0 ]; do
-sdk| \
-arch| \
-host-arch| \
+ -c++std | \
-mysql_config| \
-psql_config| \
-qpa| \
@@ -1156,7 +1157,7 @@ while [ "$#" -gt 0 ]; do
fi
;;
force-pkg-config)
- CFG_PKGCONFIG="force"
+ CFG_PKGCONFIG="yes"
;;
docdir)
QT_INSTALL_DOCS="$VAL"
@@ -1401,18 +1402,6 @@ while [ "$#" -gt 0 ]; do
unixware7-g++)
PLATFORM=unixware-g++
;;
- macx-g++-64)
- PLATFORM=macx-g++
- NATIVE_64_ARCH=
- case `uname -p` in
- i386) NATIVE_64_ARCH="x86_64" ;;
- powerpc) NATIVE_64_ARCH="ppc64" ;;
- *) echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
- esac
- if [ ! -z "$NATIVE_64_ARCH" ]; then
- QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
- fi
- ;;
esac
;;
xplatform)
@@ -1444,13 +1433,6 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
- optimized-qmake)
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- CFG_RELEASE_QMAKE="$VAL"
- else
- UNKNOWN_OPT=yes
- fi
- ;;
release)
if [ "$VAL" = "yes" ]; then
CFG_DEBUG=no
@@ -1466,6 +1448,13 @@ while [ "$#" -gt 0 ]; do
force-debug-info)
CFG_FORCEDEBUGINFO="$VAL"
;;
+ optimized-qmake|optimized-tools)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_RELEASE_TOOLS="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
developer-build)
CFG_DEV="yes"
;;
@@ -1585,6 +1574,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ ltcg)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_LTCG="$VAL"
+ else
+ UNKNOWN_OPT=no
+ fi
+ ;;
separate-debug-info)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_SEPARATE_DEBUG_INFO="$VAL"
@@ -1700,6 +1696,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ syslog)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_SYSLOG="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
sqlite)
if [ "$VAL" = "system" ]; then
CFG_SQLITE=system
@@ -1828,6 +1831,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ gbm)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_GBM="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
linuxfb)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_LINUXFB="$VAL"
@@ -1842,6 +1852,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ mirclient)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_MIRCLIENT="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
libudev)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_LIBUDEV="$VAL"
@@ -1980,7 +1997,8 @@ while [ "$#" -gt 0 ]; do
if [ "$VAL" = "no" ] || [ "$VAL" = "linked" ] || [ "$VAL" = "runtime" ]; then
CFG_DBUS="$VAL"
elif [ "$VAL" = "yes" ]; then
- CFG_DBUS="runtime"
+ # keep as auto, we'll auto-detect whether to go linked or runtime later
+ CFG_DBUS=auto
else
UNKNOWN_OPT=yes
fi
@@ -1992,6 +2010,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ dbus-runtime)
+ if [ "$VAL" = "yes" ]; then
+ CFG_DBUS="runtime"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
nis)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_NIS="$VAL"
@@ -2218,12 +2243,31 @@ while [ "$#" -gt 0 ]; do
fi
;;
c++11)
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- CFG_CXX11="$VAL"
+ if [ "$VAL" = "yes" ]; then
+ CFG_STDCXX="c++11"
+ elif [ "$VAL" = "no" ]; then
+ CFG_STDCXX="c++98"
else
UNKNOWN_OPT=yes
fi
;;
+ c++std)
+ case "$VAL" in
+ c++98|c++11|c++14|c++1z|auto)
+ CFG_STDCXX="$VAL"
+ ;;
+ 98|11|14|1z)
+ CFG_STDCXX="c++$VAL"
+ ;;
+ 1y|c++1y)
+ CFG_STDCXX="c++14"
+ ;;
+ *)
+ echo >&2 "Invalid C++ edition: $VAL; valid options are: c++98 c++11 c++14 c++1z auto"
+ ERROR=yes
+ ;;
+ esac
+ ;;
system-proxies)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_SYSTEM_PROXIES="$VAL"
@@ -2389,14 +2433,17 @@ Configure options:
-developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
+ * -no-optimized-tools ... Do not build optimized host tools even in debug build.
+ -optimized-tools ...... Build optimized host tools even in debug build.
+
-opensource ........ Compile and link the Open-Source Edition of Qt.
-commercial ........ Compile and link the Commercial Edition of Qt.
-confirm-license ... Automatically acknowledge the license (use with
either -opensource or -commercial)
- -no-c++11 .......... Do not compile Qt with C++11 support enabled.
- + -c++11 ............. Compile Qt with C++11 support enabled.
+ -c++std <edition> .. Compile Qt with C++ standard edition (c++98, c++11, c++14, c++1z)
+ Default: highest supported
* -shared ............ Create and use shared Qt libraries.
-static ............ Create and use static Qt libraries.
@@ -2472,6 +2519,9 @@ Third Party Libraries:
+ -no-journald ........ Do not send logging output to journald.
-journald ........... Send logging output to journald.
+ + -no-syslog .......... Do not send logging output to syslog.
+ -syslog ............. Send logging output to syslog.
+
-no-gif ............. Do not compile GIF reading support.
-no-libpng .......... Do not compile PNG support.
@@ -2573,9 +2623,6 @@ Additional options:
-silent ............ Reduce the build output so that warnings and errors
can be seen more easily.
- * -no-optimized-qmake ... Do not build qmake optimized.
- -optimized-qmake ...... Build qmake optimized.
-
-no-nis ............ Do not compile NIS support.
* -nis ............... Compile NIS support.
@@ -2604,9 +2651,12 @@ Additional options:
* -no-pch ............ Do not use precompiled header support.
-pch ............... Use precompiled header support.
+ * -no-ltcg Do not use Link Time Code Generation
+ -ltcg Use Link Time Code Generation.
+
-no-dbus ........... Do not compile the Qt D-Bus module.
- + -dbus .............. Compile the Qt D-Bus module and dynamically load libdbus-1.
- -dbus-linked ....... Compile the Qt D-Bus module and link to libdbus-1.
+ + -dbus-linked ....... Compile the Qt D-Bus module and link to libdbus-1.
+ -dbus-runtime ...... Compile the Qt D-Bus module and dynamically load libdbus-1.
-reduce-relocations ..... Reduce relocations in the libraries through extra
linker optimizations (Qt/X11 and Qt for Embedded Linux only;
@@ -2632,14 +2682,20 @@ Additional options:
-no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support.
* -eglfs ............. Compile EGLFS support.
+ -no-kms ............ Do not compile backends for KMS.
+ * -kms ............... Compile backends for KMS.
+
+ -no-gbm ............ Do not compile backends for GBM.
+ * -gbm ............... Compile backends for GBM.
+
-no-directfb ....... Do not compile DirectFB support.
* -directfb .......... Compile DirectFB support.
-no-linuxfb ........ Do not compile Linux Framebuffer support.
* -linuxfb ........... Compile Linux Framebuffer support.
- -no-kms ............ Do not compile KMS support.
- * -kms ............... Compile KMS support (Requires EGL).
+ * -no-mirclient....... Do not compile Mir client support.
+ -mirclient.......... Compile Mir client support.
-qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows).
@@ -2670,7 +2726,7 @@ Additional options:
-no-gstreamer ....... Do not support GStreamer.
+ -gstreamer <version> Enable GStreamer support
With no parameter, this will attempt to auto-detect GStreamer 0.10 and
- 1.0. GStreamer 0.10 is used by default when available.
+ 1.0. GStreamer 1.0 is used by default when available.
Use 0.10 or 1.0 for <version> to override auto-detection.
* -no-system-proxies .. Do not use system network proxies by default.
@@ -2703,7 +2759,10 @@ MacOS/iOS options:
link tools against those frameworks.
-no-framework ...... Do not build Qt as a series of frameworks.
- -securetransport ... Use SecureTransport instead of OpenSSL (requires -no-openssl)
+ * -securetransport ... Use SecureTransport instead of OpenSSL
+
+ -no-securetransport Do not use SecureTransport, either use OpenSSL or do not use any SSL backend
+ at all (if combined with -no-openssl).
-sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. The argument should be
one of the available SDKs as listed by 'xcodebuild -showsdks'.
@@ -3156,13 +3215,13 @@ if [ "$XPLATFORM_ANDROID" = "yes" ]; then
;;
macx-*)
CFG_DEFAULT_ANDROID_NDK_HOST=darwin-x86
- if [ ! -z "$NATIVE_64_ARCH" ] && [ -d "$CFG_DEFAULT_ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-$CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION/prebuilt/darwin-x86_64" ]; then
+ if [ -d "$CFG_DEFAULT_ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-$CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION/prebuilt/darwin-x86_64" ]; then
CFG_DEFAULT_ANDROID_NDK_HOST=darwin-x86_64
fi
;;
win32-*)
CFG_DEFAULT_ANDROID_NDK_HOST=windows
- if [ ! -z "$NATIVE_64_ARCH" ] && [ -d "$CFG_DEFAULT_ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-$CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION/prebuilt/windows-x86_64" ]; then
+ if [ -d "$CFG_DEFAULT_ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-$CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION/prebuilt/windows-x86_64" ]; then
CFG_DEFAULT_ANDROID_NDK_HOST=windows-x86_64
fi
;;
@@ -3307,6 +3366,8 @@ fi
# tests that don't need qmake (must be run before displaying help)
#-------------------------------------------------------------------------------
+echo "Running configuration tests (phase 1)..."
+
# detect build style
if [ "$CFG_DEBUG" = "auto" ]; then
if [ "$XPLATFORM_MAC" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
@@ -3328,6 +3389,10 @@ if [ "$CFG_FORCEDEBUGINFO" = "yes" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG force_debug_info"
fi
+if [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG release_tools"
+fi
+
if [ "$XPLATFORM_MAC" = "yes" ]; then
[ "$CFG_PKGCONFIG" = "auto" ] && CFG_PKGCONFIG="no"
fi
@@ -3579,6 +3644,8 @@ unset tty
eval "`LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK "$awkprog" | tee $tty`"
unset tty
+echo "Done running configuration tests."
+
#setup the build parts
if [ -z "$CFG_BUILD_PARTS" ]; then
CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
@@ -3613,9 +3680,6 @@ if [ -z "$QT_INSTALL_PREFIX" ]; then
else
QT_INSTALL_PREFIX="/usr/local/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Qt-$QT_VERSION
fi
- HAVE_INSTALL_PATH=false
-else
- HAVE_INSTALL_PATH=true
fi
QT_INSTALL_PREFIX=`makeabs "$QT_INSTALL_PREFIX"`
@@ -3899,7 +3963,7 @@ if [ -e "$relpath/.git" ]; then
exit 1
fi
- "$relpath/bin/syncqt.pl" -minimal -module QtCore "$relpath" || exit 1
+ "$relpath/bin/syncqt.pl" -version $QT_VERSION -minimal -module QtCore "$relpath" || exit 1
fi
# $1: input variable name (awk regexp)
@@ -3959,7 +4023,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
setBootstrapVariable QMAKE_LFLAGS
setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS
- if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
+ if [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
setBootstrapVariable QMAKE_CFLAGS_RELEASE
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
@@ -4041,6 +4105,9 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
echo "QMAKESPEC = $adjqmakespec" >> "$mkfile"
echo "QT_VERSION = $QT_VERSION" >> "$mkfile"
+ echo "QT_MAJOR_VERSION = $QT_MAJOR_VERSION" >> "$mkfile"
+ echo "QT_MINOR_VERSION = $QT_MINOR_VERSION" >> "$mkfile"
+ echo "QT_PATCH_VERSION = $QT_PATCH_VERSION" >> "$mkfile"
echo "EXTRA_CFLAGS = $EXTRA_CFLAGS" >> "$mkfile"
echo "EXTRA_CXXFLAGS = $EXTRA_CXXFLAGS" >> "$mkfile"
echo "QTOBJS =" $EXTRA_OBJS >> "$mkfile"
@@ -4083,7 +4150,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
fi # Build qmake
-echo "Running configuration tests..."
+echo "Running configuration tests (phase 2)..."
#-------------------------------------------------------------------------------
# create a qt.conf for the Qt build tree itself
@@ -4142,11 +4209,6 @@ fi
if [ "$CFG_PKGCONFIG" = "no" ]; then
PKG_CONFIG=
[ "$OPT_VERBOSE" = "yes" ] && echo "pkg-config support disabled."
-elif [ "$CFG_PKGCONFIG" = "force" ]; then
- echo >&2 ""
- echo >&2 "You have asked to use pkg-config. Please make sure you have"
- echo >&2 "a correctly setup pkg-config environment!"
- echo >&2 ""
elif [ -n "$PKG_CONFIG" ]; then
# found a pkg-config
if [ "$QT_CROSS_COMPILE" = "yes" ]; then
@@ -4159,16 +4221,13 @@ elif [ -n "$PKG_CONFIG" ]; then
fi
export PKG_CONFIG_LIBDIR
echo >&2 "Note: PKG_CONFIG_LIBDIR automatically set to $PKG_CONFIG_LIBDIR"
- elif [ "$CFG_PKGCONFIG" = "yes" ]; then
- echo >&2 "Error: PKG_CONFIG_LIBDIR has not been set. This could mean"
- echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)."
+ elif [ "$CFG_PKGCONFIG" = "auto" ]; then
+ PKG_CONFIG=
+ echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and"
+ echo >&2 "the host's .pc files would be used (even if you set PKG_CONFIG_PATH)."
echo >&2 "Set this variable to the directory that contains target .pc files"
echo >&2 "for pkg-config to function correctly when cross-compiling or"
- echo >&2 "use -force-pkg-config to override this test."
- exit 101
- else
- PKG_CONFIG=
- echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set."
+ echo >&2 "use -pkg-config to override this test."
fi
fi
if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
@@ -4176,17 +4235,19 @@ elif [ -n "$PKG_CONFIG" ]; then
PKG_CONFIG_SYSROOT_DIR=$CFG_SYSROOT
export PKG_CONFIG_SYSROOT_DIR
echo >&2 "Note: PKG_CONFIG_SYSROOT_DIR automatically set to $PKG_CONFIG_SYSROOT_DIR"
- elif [ "$CFG_PKGCONFIG" = "yes" ]; then
- echo >&2 "Error: PKG_CONFIG_SYSROOT_DIR has not been set. Set this variable"
- echo >&2 "to your sysroot for pkg-config to function correctly when cross-compiling"
- echo >&2 "or use -force-pkg-config to override this test."
- exit 101
- else
+ elif [ "$CFG_PKGCONFIG" = "auto" ]; then
PKG_CONFIG=
echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set."
+ echo >&2 "Set this variable to your sysroot for pkg-config to function correctly when"
+ echo >&2 "cross-compiling or use -pkg-config to override this test."
fi
fi
fi
+ if [ -n "$PKG_CONFIG" ]; then
+ CFG_PKGCONFIG=yes
+ else
+ CFG_PKGCONFIG=no
+ fi
elif [ "$CFG_PKGCONFIG" = "yes" ]; then
echo >&2 "Could not detect pkg-config from mkspec or PATH."
exit 101
@@ -4309,23 +4370,61 @@ if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
fi
fi
-# Detect C++11 support
-if [ "$CFG_CXX11" != "no" ]; then
- # Configure detects compiler features based on cross compiler, so we need
- # to explicitly disable C++11 on Mac to avoid breaking builds where the
- # host compiler does not support it.
- if [ "$BUILD_ON_MAC" = "yes" ] && [ "$XPLATFORM_ANDROID" = "yes" ]; then
- CFG_CXX11="no"
- elif compileTest common/c++11 "C++11"; then
- CFG_CXX11="yes"
- elif [ "$CFG_CXX11" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
- echo "C++11 support cannot be enabled due to functionality tests!"
- echo " Turn on verbose messaging (-v) to $0 to see the final report."
- echo " If you believe this message is in error you may use the continue"
- echo " switch (-continue) to $0 to continue."
- exit 101
+# Detect C++11 & up support
+# Configure detects compiler features based on cross compiler, so we need
+# to explicitly disable C++11 on Mac to avoid breaking builds where the
+# host compiler does not support it.
+stdcxx_error=false
+if [ "$BUILD_ON_MAC" = "yes" ] && [ "$XPLATFORM_ANDROID" = "yes" ]; then
+ CFG_STDCXX="c++98"
+elif [ "$CFG_STDCXX" = "c++98" ]; then
+ : # CFG_STDCXX is correct
+elif ! compileTest common/c++11 "C++11"; then
+ if [ "$CFG_STDCXX" != "auto" ]; then
+ stdcxx_error=true
+ else
+ CFG_STDCXX="c++98"
+ fi
+elif [ "$CFG_STDCXX" = "c++11" ]; then
+ : # CFG_STDCXX is correct
+elif ! compileTest common/c++14 "C++14"; then
+ if [ "$CFG_STDCXX" != "auto" ]; then
+ stdcxx_error=true
+ else
+ CFG_STDCXX="c++11"
+ fi
+elif [ "$CFG_STDCXX" = "c++14" ]; then
+ : # CFG_STDCXX is correct
+elif ! compileTest common/c++1z "C++1z"; then
+ if [ "$CFG_STDCXX" != "auto" ]; then
+ stdcxx_error=true
else
- CFG_CXX11="no"
+ CFG_STDCXX="c++14"
+ fi
+else
+ CFG_STDCXX="c++1z"
+fi
+
+if $stdcxx_error && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ echo "$CFG_STDCXX support cannot be enabled due to functionality tests!"
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+fi
+
+# Detect which edition of the C++ standard the compiler defaults to
+CFG_STDCXX_DEFAULT=199711
+if compileTest common/c++default "default C++ standard edition"; then
+ if [ -e "$outpath/config.tests/common/c++default/c++default.ii" ]; then
+ CFG_STDCXX_DEFAULT=`sed -n '/^[0-9]/s/L//p' "$outpath/config.tests/common/c++default/c++default.ii"`
+ else
+ if [ "$OPT_VERBOSE" = "yes" ]; then
+ echo "Failed to run the preprocessor, something is wrong with your compiler"
+ fi
+ if [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ exit 101
+ fi
fi
fi
@@ -4574,6 +4673,23 @@ if [ "$CFG_JOURNALD" != "no" ]; then
fi
fi
+if [ "$CFG_SYSLOG" != "no" ]; then
+ if compileTest unix/syslog "syslog"; then
+ CFG_SYSLOG=yes
+ QMAKE_CONFIG="$QMAKE_CONFIG syslog"
+ else
+ if [ "$CFG_SYSLOG" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ echo "syslog support cannot be enabled due to functionality tests!"
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+ else
+ CFG_SYSLOG=no
+ fi
+ fi
+fi
+
if [ "$CFG_LARGEFILE" = "auto" ]; then
#Large files should be enabled for all Linux systems
CFG_LARGEFILE=yes
@@ -4626,13 +4742,6 @@ if [ "$CFG_EGLFS" = "yes" ]; then
CFG_EGL=yes
fi
-if [ "$CFG_KMS" = "yes" ]; then
- if [ "$CFG_EGL" = "no" ]; then
- echo "The KMS plugin requires EGL support and cannot be built"
- exit 101
- fi
-fi
-
# auto-detect SQL-modules support
for _SQLDR in $CFG_SQL_AVAILABLE; do
case $_SQLDR in
@@ -4945,10 +5054,10 @@ if [ "$CFG_ICONV" != "no" ]; then
fi
# auto-detect libdbus-1 support
-if [ "$CFG_DBUS" = "auto" ]; then
- CFG_DBUS="runtime"
-fi
-if [ "$CFG_DBUS" = "linked" ]; then
+# auto: detect if libdbus-1 is present; if so, link to it
+# linked: fail if libdbus-1 is not present; otherwise link to it
+# runtime: no detection (cannot fail), load libdbus-1 at runtime
+if [ "$CFG_DBUS" = "auto" ] || [ "$CFG_DBUS" = "linked" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
@@ -4964,14 +5073,19 @@ if [ "$CFG_DBUS" = "linked" ]; then
QT_CFLAGS_DBUS=`env -i PATH="$PATH" pkg-config --cflags dbus-1 2>/dev/null`
fi
QMakeVar set QT_HOST_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
+ CFG_DBUS=linked
else
- if [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ # Failed to compile the test, so it's an error if CFG_DBUS is "linked"
+ if [ "$CFG_DBUS" = "linked" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "The Qt D-Bus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
exit 101
+ else
+ # CFG_DBUS is "auto" here
+ CFG_DBUS=runtime
fi
fi
fi
@@ -5007,7 +5121,7 @@ if [ "$CFG_GLIB" != "no" ]; then
else
if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "Glib support cannot be enabled due to functionality tests!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
@@ -5035,7 +5149,7 @@ if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
else
if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "GTK theme support cannot be enabled due to functionality tests!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the fin al report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
@@ -5080,7 +5194,7 @@ if [ "$CFG_PULSEAUDIO" != "no" ]; then
else
if [ "$CFG_PULSEAUDIO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "PulseAudio support cannot be enabled due to functionality tests!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
@@ -5198,7 +5312,7 @@ elif [ "$CFG_OPENGL" = "es2" ]; then
compileTestWithPkgConfig glesv2 unix/opengles2 "OpenGL ES 2.0" OPENGL_ES2
if [ $? != "0" ]; then
echo "The OpenGL ES 2.0 functionality test failed!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in"
echo " ${XQMAKESPEC}."
@@ -5257,7 +5371,7 @@ ORIG_CFG_XCB="$CFG_XCB"
ORIG_CFG_EGLFS="$CFG_EGLFS"
ORIG_CFG_DIRECTFB="$CFG_DIRECTFB"
ORIG_CFG_LINUXFB="$CFG_LINUXFB"
-ORIG_CFG_KMS="$CFG_KMS"
+ORIG_CFG_MIRCLIENT="$CFG_MIRCLIENT"
if [ "$CFG_LIBUDEV" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
@@ -5272,7 +5386,7 @@ if [ "$CFG_LIBUDEV" != "no" ]; then
QT_CONFIG="$QT_CONFIG libudev"
elif [ "$CFG_LIBUDEV" = "yes" ]; then
echo "The libudev functionality test failed!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
exit 1
else
CFG_LIBUDEV=no
@@ -5482,7 +5596,7 @@ if [ "$CFG_XCB" != "no" ]; then
else
if [ "$CFG_XCB" != "auto" ]; then
echo "The test for linking against libxcb failed!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " You might need to install dependency packages for libxcb."
echo " See src/plugins/platforms/xcb/README."
exit 1
@@ -5499,7 +5613,7 @@ if [ "$CFG_DIRECTFB" != "no" ]; then
CFG_DIRECTFB=yes
elif [ "$CFG_DIRECTFB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo " DirectFB support cannot be enabled due to functionality tests!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
@@ -5512,6 +5626,20 @@ if [ "$CFG_DIRECTFB" != "no" ]; then
fi
fi
+if [ "$CFG_GBM" != "no" ]; then
+ if compileTest qpa/gbm "GBM"; then
+ CFG_GBM=yes
+ elif [ "$CFG_GBM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ echo " GBM support cannot be enabled due to functionality tests!"
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+ else
+ CFG_GBM=no
+ fi
+fi
+
if [ "$CFG_LINUXFB" != "no" ]; then
if compileTest qpa/linuxfb "LinuxFB"; then
CFG_LINUXFB=yes
@@ -5540,6 +5668,20 @@ if [ "$CFG_KMS" != "no" ]; then
fi
fi
+if [ "$CFG_MIRCLIENT" != "no" ]; then
+ if compileTest qpa/mirclient "Mir client"; then
+ CFG_MIRCLIENT=yes
+ elif [ "$CFG_MIRCLIENT" = "yes" ]; then
+ echo " Mir client support cannot be enabled due to functionality tests!"
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+ else
+ CFG_MIRCLIENT=no
+ fi
+fi
+
# Detect libxkbcommon
MIN_REQ_XKBCOMMON="0.4.1"
# currently only xcb platform plugin supports building xkbcommon
@@ -5556,7 +5698,7 @@ if [ "$CFG_XCB" != "no" ]; then
elif [ "$CFG_XKBCOMMON" = "system" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo " xkbcommon support cannot be enabled because either xkbcommon or "
echo " xkbcommon-x11 >= $MIN_REQ_XKBCOMMON was not found via pkg-config!"
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
@@ -5617,7 +5759,7 @@ if [ "$CFG_EGL" != "no" ]; then
fi
elif [ "$CFG_EGL" = "yes" ]; then
echo " The EGL functionality test failed; EGL is required by some QPA plugins to manage contexts & surfaces."
- [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?"
+ [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR_EGL, QMAKE_LIBDIR_EGL and QMAKE_LIBS_EGL in ${XQMAKESPEC}."
exit 1
@@ -5636,7 +5778,13 @@ if [ "$CFG_EGLFS" != "no" ]; then
else
CFG_EGLFS_BRCM=no
fi
- if compileTest qpa/eglfs-mali "eglfs-mali"; then
+ if compileTest qpa/eglfs-egldevice "eglfs-egldevice"; then
+ CFG_EGLFS_EGLDEVICE=yes
+ else
+ CFG_EGLFS_EGLDEVICE=no
+ fi
+ if compileTest qpa/eglfs-mali "eglfs-mali" \
+ || compileTest qpa/eglfs-mali-2 "eglfs-mali-2"; then
CFG_EGLFS_MALI=yes
else
CFG_EGLFS_MALI=no
@@ -5646,19 +5794,16 @@ if [ "$CFG_EGLFS" != "no" ]; then
else
CFG_EGLFS_VIV=no
fi
+ if [ "$CFG_EGLFS_VIV" = "yes" ] && compileTest qpa/wayland-server "wayland-server"; then
+ CFG_EGLFS_VIV_WL=yes
+ else
+ CFG_EGLFS_VIV_WL=no
+ fi
else
CFG_EGLFS="no"
fi
fi
-if [ "$CFG_KMS" = "yes" ]; then
- if [ "$CFG_EGL" = "yes" ]; then
- CFG_KMS="yes"
- else
- CFG_KMS="no"
- fi
-fi
-
# Detect accessibility support
if [ "$CFG_ACCESSIBILITY" = "no" ]; then
echo >&2 "Warning: Disabling Accessibility. This version of Qt is unsupported."
@@ -5704,17 +5849,23 @@ if [ "$CFG_DIRECTFB" = "yes" ]; then
QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB"
QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB"
fi
+if [ "$CFG_GBM" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG gbm"
+fi
if [ "$CFG_LINUXFB" = "yes" ]; then
QT_CONFIG="$QT_CONFIG linuxfb"
fi
if [ "$CFG_KMS" = "yes" ]; then
QT_CONFIG="$QT_CONFIG kms"
fi
+if [ "$CFG_MIRCLIENT" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG mirclient"
+fi
if [ "$XPLATFORM_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ] && [ "$XPLATFORM_ANDROID" = "no" ] && [ "$XPLATFORM_HAIKU" = "no" ]; then
- if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_KMS" = "no" ]; then
+ if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_MIRCLIENT" = "no" ]; then
if [ "$QPA_PLATFORM_GUARD" = "yes" ] &&
- ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_KMS" = "auto" ] ); then
+ ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_MIRCLIENT" = "auto" ] ); then
echo "No QPA platform plugin enabled!"
echo " If you really want to build without a QPA platform plugin you must pass"
echo " -no-qpa-platform-guard to configure. Doing this will"
@@ -5887,6 +6038,18 @@ if [ "$CFG_GETIFADDRS" != "no" ]; then
fi
fi
+# find if the platform provides thread-safe CLOEXEC support
+if compileTest unix/cloexec "cloexec"; then
+ CFG_CLOEXEC=yes
+fi
+
+if [ "$XPLATFORM_MAC" = "yes" ] && [ "$CFG_SECURETRANSPORT" != "no" ] && ([ "$CFG_OPENSSL" = "no" ] || [ "$CFG_OPENSSL" = "auto" ]); then
+ CFG_SECURETRANSPORT=yes
+ CFG_OPENSSL=no
+else
+ CFG_SECURETRANSPORT=no
+fi
+
# detect OpenSSL
if [ "$CFG_OPENSSL" != "no" ]; then
if compileTest unix/openssl "OpenSSL"; then
@@ -5906,11 +6069,6 @@ if [ "$CFG_OPENSSL" != "no" ]; then
fi
fi
-if [ "$CFG_SECURETRANSPORT" != "no" ] && [ "$CFG_OPENSSL" = "no" ] && [ "$XPLATFORM_MAC" = "yes" ]; then
- CFG_SECURETRANSPORT=yes
-else
- CFG_SECURETRANSPORT=no
-fi
# detect PCRE
if [ "$CFG_PCRE" != "qt" ]; then
@@ -5981,12 +6139,12 @@ fi
# detect GStreamer support
if [ "$CFG_GSTREAMER" = "auto" ] || [ "$CFG_GSTREAMER" = "yes" ]; then
- if compileTest unix/gstreamer "GStreamer 0.10" -config gst-0.10; then
- CFG_GSTREAMER=yes
- CFG_GSTREAMER_VERSION=0.10
- elif compileTest unix/gstreamer "GStreamer 1.0" -config gst-1.0; then
+ if compileTest unix/gstreamer "GStreamer 1.0" -config gst-1.0; then
CFG_GSTREAMER=yes
CFG_GSTREAMER_VERSION=1.0
+ elif compileTest unix/gstreamer "GStreamer 0.10" -config gst-0.10; then
+ CFG_GSTREAMER=yes
+ CFG_GSTREAMER_VERSION=0.10
else
if [ "$CFG_GSTREAMER" = "yes" ]; then
echo "GStreamer support cannot be enabled due to functionality tests!"
@@ -6024,7 +6182,15 @@ fi
# ask for all that hasn't been auto-detected or specified in the arguments
#-------------------------------------------------------------------------------
-[ "$CFG_CXX11" = "yes" ] && QT_CONFIG="$QT_CONFIG c++11"
+if [ "$CFG_STDCXX" != "c++98" ]; then
+ QT_CONFIG="$QT_CONFIG c++11"
+ if [ "$CFG_STDCXX" != "c++11" ]; then
+ QT_CONFIG="$QT_CONFIG c++14"
+ if [ "$CFG_STDCXX" != "c++14" ]; then
+ QT_CONFIG="$QT_CONFIG c++1z"
+ fi
+ fi
+fi
if [ "$CFG_ATOMIC64" = "libatomic" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG atomic64-libatomic"
@@ -6065,11 +6231,23 @@ fi
if [ "$CFG_EGLFS_BRCM" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_brcm"
fi
+if [ "$CFG_EGLFS_EGLDEVICE" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG eglfs_egldevice"
+fi
+if [ "$CFG_EGLFS" = "yes" ] && [ "$CFG_KMS" = "yes" ] && [ "$CFG_GBM" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG eglfs_gbm"
+ CFG_EGLFS_GBM="yes"
+else
+ CFG_EGLFS_GBM="no"
+fi
if [ "$CFG_EGLFS_MALI" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_mali"
fi
if [ "$CFG_EGLFS_VIV" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_viv"
+ if [ "$CFG_EGLFS_VIV_WL" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG eglfs_viv_wl"
+ fi
fi
# enable openvg
@@ -6169,6 +6347,9 @@ fi
if [ "$CFG_EVENTFD" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eventfd"
fi
+if [ "$CFG_CLOEXEC" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG threadsafe-cloexec"
+fi
if [ "$CFG_LIBJPEG" = "no" ]; then
CFG_JPEG="no"
elif [ "$CFG_LIBJPEG" = "system" ]; then
@@ -6281,7 +6462,6 @@ if [ '!' -z "$W_FLAGS" ]; then
# add the user defined warning flags
QMakeVar add QMAKE_CFLAGS_WARN_ON "$W_FLAGS"
QMakeVar add QMAKE_CXXFLAGS_WARN_ON "$W_FLAGS"
- QMakeVar add QMAKE_OBJECTIVE_CFLAGS_WARN_ON "$W_FLAGS"
fi
if [ "$XPLATFORM_MINGW" = "yes" ]; then
@@ -6313,6 +6493,10 @@ if [ "$CFG_FORCE_ASSERTS" = "yes" ]; then
QT_CONFIG="$QT_CONFIG force_asserts"
fi
+if [ "$CFG_LTCG" = "yes" ]; then
+ QMAKE_CONFIG="$QMAKE_CONFIG ltcg"
+fi
+
if [ "$CFG_SANITIZERS" != "none" ]; then
QTCONFIG_CONFIG="$QTCONFIG_CONFIG sanitizer"
@@ -6482,7 +6666,7 @@ fi
# ### Vestige
if [ "$CFG_QML_DEBUG" = "no" ]; then
- QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QML_DEBUGGER"
+ QT_CONFIG="$QT_CONFIG no-qml-debug"
fi
case "$QMAKE_CONF_COMPILER" in
@@ -6526,27 +6710,43 @@ s/icpc version \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\) .*$/QT_ICC_MAJOR_VERSION=\1; Q
;;
esac
+echo "Done running configuration tests."
+
+# Save stdout in fd 3
+exec 3>&1
+
#-------------------------------------------------------------------------------
# part of configuration information goes into qconfig.h
#-------------------------------------------------------------------------------
+# Open qconfig.h.new
+exec > "$outpath/src/corelib/global/qconfig.h.new"
+
+# start with Qt's version number
+cat <<EOF
+#define QT_VERSION_MAJOR $QT_MAJOR_VERSION
+#define QT_VERSION_MINOR $QT_MINOR_VERSION
+#define QT_VERSION_PATCH $QT_PATCH_VERSION
+#define QT_VERSION_STR "$QT_VERSION"
+
+EOF
+
case "$CFG_QCONFIG" in
full)
- echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
+ echo "/* Everything */"
;;
*)
- tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
- echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
- cat "$CFG_QCONFIG_PATH" >>"$tmpconfig"
- echo "#endif" >>"$tmpconfig"
+ echo "#ifndef QT_BOOTSTRAPPED"
+ cat "$CFG_QCONFIG_PATH"
+ echo "#endif"
;;
esac
-echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
-[ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
+echo '/* Compile time features */'
+[ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\""
if [ "$CFG_SHARED" = "no" ]; then
- cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
+ cat <<EOF
/* Qt was configured for a static build */
#if !defined(QT_SHARED) && !defined(QT_STATIC)
# define QT_STATIC
@@ -6556,58 +6756,45 @@ EOF
fi
if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
- echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
+ echo "#define QT_LARGEFILE_SUPPORT 64"
fi
if [ "$CFG_QREAL" != double ]; then
- echo "#define QT_COORD_TYPE $CFG_QREAL" >>"$outpath/src/corelib/global/qconfig.h.new"
- echo "#define QT_COORD_TYPE_STRING $CFG_QREAL_STRING" >>"$outpath/src/corelib/global/qconfig.h.new"
+ echo "#define QT_COORD_TYPE $CFG_QREAL"
+ echo "#define QT_COORD_TYPE_STRING $CFG_QREAL_STRING"
fi
if [ "$CFG_FRAMEWORK" = "yes" ]; then
- echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
-fi
-
-if [ "$XPLATFORM_MAC" = "yes" ]; then
- cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
-#if defined(__LP64__)
-# define QT_POINTER_SIZE 8
-#else
-# define QT_POINTER_SIZE 4
-#endif
-EOF
-else
- "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
- echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
+ echo "#define QT_MAC_FRAMEWORK_BUILD"
fi
if [ "$CFG_ATOMIC64" = "no" ]; then
- echo "#define QT_NO_STD_ATOMIC64" >> "$outpath/src/corelib/global/qconfig.h.new"
+ echo "#define QT_NO_STD_ATOMIC64"
fi
#REDUCE_RELOCATIONS is a elf/unix only thing, so not in windows configure.exe
if [ "$CFG_REDUCE_RELOCATIONS" = "yes" ]; then
- echo "#define QT_REDUCE_RELOCATIONS" >>"$outpath/src/corelib/global/qconfig.h.new"
+ echo "#define QT_REDUCE_RELOCATIONS"
fi
# Add compiler sub-architecture support
-echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
-echo "// Compiler sub-arch support" >>"$outpath/src/corelib/global/qconfig.h.new"
+echo ""
+echo "// Compiler sub-arch support"
for SUBARCH in SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 AVX AVX2 \
MIPS_DSP MIPS_DSPR2; do
eval "VAL=\$CFG_$SUBARCH"
case "$VAL" in
yes)
echo "#define QT_COMPILER_SUPPORTS_$SUBARCH 1" \
- >>"$outpath/src/corelib/global/qconfig.h.new"
+
;;
esac
done
-echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
+echo ""
if [ "$CFG_DEV" = "yes" ]; then
- echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
+ echo "#define QT_BUILD_INTERNAL"
fi
# Add QPA to config.h
@@ -6653,6 +6840,7 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
[ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
[ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
[ "$CFG_EVENTFD" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EVENTFD"
+[ "$CFG_CLOEXEC" = "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_THREADSAFE_CLOEXEC=1"
[ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
[ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL"
[ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
@@ -6688,7 +6876,7 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
if [ -n "$QCONFIG_FLAGS" ]; then
-cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
+cat << EOF
#ifndef QT_BOOTSTRAPPED
EOF
@@ -6707,14 +6895,14 @@ EOF
fi
if [ -z $cfgdNeg ]; then
-cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
+cat << EOF
#ifndef $cfgd
# define $cfg
#endif
EOF
else
-cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
+cat << EOF
#if defined($cfgd) && defined($cfgdNeg)
# undef $cfgd
#elif !defined($cfgd) && !defined($cfgdNeg)
@@ -6724,27 +6912,30 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
EOF
fi
done
-cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
+cat << EOF
#endif // QT_BOOTSTRAPPED
EOF
fi
if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
-cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
+cat << EOF
#define QT_VISIBILITY_AVAILABLE
EOF
fi
if [ -n "$QT_LIBINFIX" ]; then
-cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
+cat << EOF
#define QT_LIBINFIX "$QT_LIBINFIX"
EOF
fi
-echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new"
+echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\""
+
+# Close qconfig.h.new (by restoring the original stdout)
+exec >&3
# avoid unecessary rebuilds by copying only if qconfig.h has changed
if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
@@ -6756,9 +6947,12 @@ fi
#-------------------------------------------------------------------------------
# save configuration into qconfig.pri
#-------------------------------------------------------------------------------
+
+# open qconfig.pri
QTCONFIG="$outpath/mkspecs/qconfig.pri"
+exec > "$QTCONFIG.tmp"
+
QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
-[ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
if [ "$CFG_DEBUG" = "yes" ]; then
QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
@@ -6795,7 +6989,7 @@ else
fi
fi
-cat >>"$QTCONFIG.tmp" <<EOF
+cat <<EOF
#configuration
CONFIG += $QTCONFIG_CONFIG
host_build {
@@ -6822,59 +7016,63 @@ QT_EDITION = $Edition
EOF
if [ "$Edition" != "OpenSource" ] && [ "$Edition" != "Preview" ]; then
- echo "QT_LICHECK = $Licheck" >> "$QTCONFIG.tmp"
- echo "QT_RELEASE_DATE = $ReleaseDate" >> "$QTCONFIG.tmp"
+ echo "QT_LICHECK = $Licheck"
+ echo "QT_RELEASE_DATE = $ReleaseDate"
fi
-echo >> "$QTCONFIG.tmp"
+echo
if [ "$CFG_SHARED" = "no" ]; then
- echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM" >> "$QTCONFIG.tmp"
- echo >> "$QTCONFIG.tmp"
+ echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM"
+ echo
fi
if [ -n "$PKG_CONFIG_SYSROOT_DIR" ] || [ -n "$PKG_CONFIG_LIBDIR" ]; then
- echo "# pkgconfig" >> "$QTCONFIG.tmp"
- echo "PKG_CONFIG_SYSROOT_DIR = $PKG_CONFIG_SYSROOT_DIR" >> "$QTCONFIG.tmp"
- echo "PKG_CONFIG_LIBDIR = $PKG_CONFIG_LIBDIR" >> "$QTCONFIG.tmp"
- echo >> "$QTCONFIG.tmp"
+ echo "# pkgconfig"
+ echo "PKG_CONFIG_SYSROOT_DIR = $PKG_CONFIG_SYSROOT_DIR"
+ echo "PKG_CONFIG_LIBDIR = $PKG_CONFIG_LIBDIR"
+ echo
fi
if [ -n "$CFG_SYSROOT" ] && [ "$CFG_GCC_SYSROOT" = "yes" ]; then
- echo "# sysroot" >>"$QTCONFIG.tmp"
- echo "!host_build {" >>"$QTCONFIG.tmp"
- echo " QMAKE_CFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp"
- echo " QMAKE_CXXFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp"
- echo " QMAKE_LFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp"
- echo "}" >> "$QTCONFIG.tmp"
- echo >> "$QTCONFIG.tmp"
+ echo "# sysroot"
+ echo "!host_build {"
+ echo " QMAKE_CFLAGS += --sysroot=\$\$[QT_SYSROOT]"
+ echo " QMAKE_CXXFLAGS += --sysroot=\$\$[QT_SYSROOT]"
+ echo " QMAKE_LFLAGS += --sysroot=\$\$[QT_SYSROOT]"
+ echo "}"
+ echo
fi
if [ -n "$RPATH_FLAGS" ]; then
- echo "QMAKE_RPATHDIR += $RPATH_FLAGS" >> "$QTCONFIG.tmp"
+ echo "QMAKE_RPATHDIR += $RPATH_FLAGS"
fi
+echo "QT_COMPILER_STDCXX = $CFG_STDCXX_DEFAULT"
if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
- echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
- echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
- echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
+ echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION"
+ echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION"
+ echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION"
fi
if [ -n "$QT_ICC_MAJOR_VERSION" ]; then
- echo "QT_ICC_MAJOR_VERSION = $QT_ICC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
- echo "QT_ICC_MINOR_VERSION = $QT_ICC_MINOR_VERSION" >> "$QTCONFIG.tmp"
- echo "QT_ICC_PATCH_VERSION = $QT_ICC_PATCH_VERSION" >> "$QTCONFIG.tmp"
+ echo "QT_ICC_MAJOR_VERSION = $QT_ICC_MAJOR_VERSION"
+ echo "QT_ICC_MINOR_VERSION = $QT_ICC_MINOR_VERSION"
+ echo "QT_ICC_PATCH_VERSION = $QT_ICC_PATCH_VERSION"
fi
if [ -n "$QT_CLANG_MAJOR_VERSION" ]; then
- echo "QT_CLANG_MAJOR_VERSION = $QT_CLANG_MAJOR_VERSION" >> "$QTCONFIG.tmp"
- echo "QT_CLANG_MINOR_VERSION = $QT_CLANG_MINOR_VERSION" >> "$QTCONFIG.tmp"
+ echo "QT_CLANG_MAJOR_VERSION = $QT_CLANG_MAJOR_VERSION"
+ echo "QT_CLANG_MINOR_VERSION = $QT_CLANG_MINOR_VERSION"
fi
if [ -n "$QT_APPLE_CLANG_MAJOR_VERSION" ]; then
- echo "QT_APPLE_CLANG_MAJOR_VERSION = $QT_APPLE_CLANG_MAJOR_VERSION" >> "$QTCONFIG.tmp"
- echo "QT_APPLE_CLANG_MINOR_VERSION = $QT_APPLE_CLANG_MINOR_VERSION" >> "$QTCONFIG.tmp"
+ echo "QT_APPLE_CLANG_MAJOR_VERSION = $QT_APPLE_CLANG_MAJOR_VERSION"
+ echo "QT_APPLE_CLANG_MINOR_VERSION = $QT_APPLE_CLANG_MINOR_VERSION"
fi
if [ -n "$QMAKE_INCDIR_OPENGL_ES2" ]; then
- echo "#Qt opengl include path" >> "$QTCONFIG.tmp"
- echo "QMAKE_INCDIR_OPENGL_ES2 = `shellArgumentListToQMakeList "$QMAKE_INCDIR_OPENGL_ES2"`" >> "$QTCONFIG.tmp"
+ echo "#Qt opengl include path"
+ echo "QMAKE_INCDIR_OPENGL_ES2 = `shellArgumentListToQMakeList "$QMAKE_INCDIR_OPENGL_ES2"`"
fi
+# Close qconfig.pri.tmp (by restoring the original stdout)
+exec >&3
+
# replace qconfig.pri if it differs from the newly created temp file
if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
rm -f "$QTCONFIG.tmp"
@@ -6885,12 +7083,15 @@ fi
#-------------------------------------------------------------------------------
# save configuration into qmodule.pri
#-------------------------------------------------------------------------------
+
+# open qmodule.pri
QTMODULE="$outpath/mkspecs/qmodule.pri"
+exec > "$QTMODULE.tmp"
-echo "CONFIG += $QMAKE_CONFIG" >> "$QTMODULE.tmp"
-echo "QT_BUILD_PARTS += $CFG_BUILD_PARTS" >> "$QTMODULE.tmp"
+echo "CONFIG += $QMAKE_CONFIG"
+echo "QT_BUILD_PARTS += $CFG_BUILD_PARTS"
if [ -n "$CFG_SKIP_MODULES" ]; then
- echo "QT_SKIP_MODULES += $CFG_SKIP_MODULES" >> "$QTMODULE.tmp"
+ echo "QT_SKIP_MODULES += $CFG_SKIP_MODULES"
fi
DISABLED_FEATURES=
for cfg in $QCONFIG_FLAGS; do
@@ -6900,55 +7101,58 @@ for cfg in $QCONFIG_FLAGS; do
fi
done
if [ -n "$DISABLED_FEATURES" ]; then
- echo "QT_NO_DEFINES = $DISABLED_FEATURES" >> "$QTMODULE.tmp"
+ echo "QT_NO_DEFINES = $DISABLED_FEATURES"
fi
-echo "QT_QCONFIG_PATH = ${CFG_QCONFIG_PATH#$relpath/src/corelib/global/}" >> "$QTMODULE.tmp"
+echo "QT_QCONFIG_PATH = ${CFG_QCONFIG_PATH#$relpath/src/corelib/global/}"
-cat >>"$QTMODULE.tmp" <<EOF
+cat <<EOF
host_build {
QT_CPU_FEATURES.$CFG_HOST_ARCH = $CFG_HOST_CPUFEATURES
} else {
QT_CPU_FEATURES.$CFG_ARCH = $CFG_CPUFEATURES
}
EOF
-echo "QT_COORD_TYPE = $CFG_QREAL" >> "$QTMODULE.tmp"
+echo "QT_COORD_TYPE = $CFG_QREAL"
if [ -n "$QT_CFLAGS_PSQL" ]; then
- echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$QTMODULE.tmp"
+ echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL"
fi
if [ -n "$QT_LFLAGS_PSQL" ]; then
- echo "QT_LFLAGS_PSQL = $QT_LFLAGS_PSQL" >> "$QTMODULE.tmp"
+ echo "QT_LFLAGS_PSQL = $QT_LFLAGS_PSQL"
fi
if [ -n "$QT_CFLAGS_MYSQL" ]; then
- echo "QT_CFLAGS_MYSQL = $QT_CFLAGS_MYSQL" >> "$QTMODULE.tmp"
+ echo "QT_CFLAGS_MYSQL = $QT_CFLAGS_MYSQL"
fi
if [ -n "$QT_LFLAGS_MYSQL" ]; then
- echo "QT_LFLAGS_MYSQL = $QT_LFLAGS_MYSQL" >> "$QTMODULE.tmp"
+ echo "QT_LFLAGS_MYSQL = $QT_LFLAGS_MYSQL"
fi
if [ -n "$QT_CFLAGS_SQLITE" ]; then
- echo "QT_CFLAGS_SQLITE = $QT_CFLAGS_SQLITE" >> "$QTMODULE.tmp"
+ echo "QT_CFLAGS_SQLITE = $QT_CFLAGS_SQLITE"
fi
if [ -n "$QT_LFLAGS_SQLITE" ]; then
- echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$QTMODULE.tmp"
+ echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE"
fi
if [ -n "$QT_LFLAGS_ODBC" ]; then
- echo "QT_LFLAGS_ODBC = $QT_LFLAGS_ODBC" >> "$QTMODULE.tmp"
+ echo "QT_LFLAGS_ODBC = $QT_LFLAGS_ODBC"
fi
if [ -n "$QT_LFLAGS_TDS" ]; then
- echo "QT_LFLAGS_TDS = $QT_LFLAGS_TDS" >> "$QTMODULE.tmp"
+ echo "QT_LFLAGS_TDS = $QT_LFLAGS_TDS"
fi
#dump in the OPENSSL_LIBS info
if [ '!' -z "$OPENSSL_LIBS" ]; then
- echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$QTMODULE.tmp"
+ echo "OPENSSL_LIBS = $OPENSSL_LIBS"
elif [ "$CFG_OPENSSL" = "linked" ]; then
- echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$QTMODULE.tmp"
+ echo "OPENSSL_LIBS = -lssl -lcrypto"
fi
# cmdline args
-cat "$QMAKE_VARS_FILE" >> "$QTMODULE.tmp"
+cat "$QMAKE_VARS_FILE"
# QMAKE_VARS_FILE will be still needed for a status message.
+# Close qmodule.pri.tmp (by restoring the original stdout)
+exec >&3
+
# replace qmodule.pri if it differs from the newly created temp file
if cmp -s "$QTMODULE.tmp" "$QTMODULE"; then
rm -f "$QTMODULE.tmp"
@@ -6959,7 +7163,7 @@ fi
#-------------------------------------------------------------------------------
# give feedback on configuration
#-------------------------------------------------------------------------------
-exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
+exec 1>$outpath/config.summary # redirect output temporarily to config.summary
report_support()
{
@@ -7039,16 +7243,19 @@ release="release"
[ "$CFG_FORCEDEBUGINFO" = "yes" ] && release="release (with debug info)"
[ "$CFG_DEBUG" = "yes" ] && build_mode="debug" || build_mode=$release
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
- echo " Mode ................... debug and $release; default link: $build_mode"
-else
- echo " Mode ................... $build_mode"
+ build_mode="debug and $release; default link: $build_mode"
fi
+if [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
+ build_mode="$build_mode; optimized tools"
+fi
+echo " Mode ................... $build_mode"
unset build_mode release
echo " Using sanitizer(s)...... $CFG_SANITIZERS"
-echo " Using C++11 ............ $CFG_CXX11"
+echo " Using C++ standard ..... $CFG_STDCXX"
echo " Using gold linker....... $CFG_USE_GOLD_LINKER"
echo " Using new DTAGS ........ $CFG_ENABLE_NEW_DTAGS"
echo " Using PCH .............. $CFG_PRECOMPILE"
+echo " Using LTCG ............. $CFG_LTCG"
echo " Target compiler supports:"
if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then
echo " SSE2/SSE3/SSSE3 ...... ${CFG_SSE2}/${CFG_SSE3}/${CFG_SSSE3}"
@@ -7094,8 +7301,10 @@ report_support " Image formats:"
report_support_plugin " GIF .................." "$CFG_GIF" qt QtGui
report_support_plugin " JPEG ................." "$CFG_JPEG" "$CFG_LIBJPEG" QtGui
report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGui
-report_support " journald ..............." "$CFG_JOURNALD"
report_support " libinput................" "$CFG_LIBINPUT"
+report_support " Logging backends:"
+report_support " journald ..............." "$CFG_JOURNALD"
+report_support " syslog ..............." "$CFG_SYSLOG"
report_support " mtdev .................." "$CFG_MTDEV" yes "system library"
report_support " Networking:"
[ "$XPLATFORM_MAC" = "yes" ] && \
@@ -7122,12 +7331,15 @@ report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
report_support " QPA backends:"
report_support " DirectFB ............." "$CFG_DIRECTFB"
report_support " EGLFS ................" "$CFG_EGLFS"
-report_support " EGLFS i.MX6....... ." "$CFG_EGLFS_VIV"
-report_support " EGLFS KMS .........." "$CFG_KMS"
+report_support " EGLFS i.MX6 ........" "$CFG_EGLFS_VIV"
+report_support " EGLFS i.MX6 Wayland." "$CFG_EGLFS_VIV_WL"
+report_support " EGLFS EGLDevice ...." "$CFG_EGLFS_EGLDEVICE"
+report_support " EGLFS GBM .........." "$CFG_EGLFS_GBM"
report_support " EGLFS Mali ........." "$CFG_EGLFS_MALI"
report_support " EGLFS Raspberry Pi ." "$CFG_EGLFS_BRCM"
report_support " EGLFS X11 .........." "$CFG_EGL_X"
report_support " LinuxFB .............." "$CFG_LINUXFB"
+report_support " Mir client............" "$CFG_MIRCLIENT"
report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy"
if [ "$CFG_XCB" != "no" ]; then
report_support " EGL on X ..........." "$CFG_EGL_X"
@@ -7185,12 +7397,12 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
echo "For example:"
echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
fi
-if [ "$CFG_JOURNALD" = "yes" ] || [ "$CFG_SLOG2" = "yes" ]; then
+if [ "$CFG_JOURNALD" = "yes" ] || [ "$CFG_SYSLOG" = "yes" ] || [ "$CFG_SLOG2" = "yes" ]; then
echo
- echo "NOTE: journald or slog2 integration is enabled."
+ echo "NOTE: journald, syslog or slog2 integration is enabled."
echo "If your users intend on developing applications against this build,"
echo "ensure that the IDEs they use either set QT_LOGGING_TO_CONSOLE to 1"
- echo "or the IDE is able to read the logged output from journald or slog2."
+ echo "or the IDE is able to read the logged output from journald, syslog or slog2."
fi
if [ "$CFG_XKBCOMMON" = "qt" ] && [ "$CFG_XKB_CONFIG_ROOT" = "not found" ]; then
echo
@@ -7202,6 +7414,11 @@ if [ "$CFG_QREAL" = double ] && [ "$CFG_ARCH" = arm ]; then
echo "NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1."
echo "Configure with '-qreal float' to create a build that is binary compatible with 5.1."
fi
+if [ "$CFG_RELEASE_TOOLS" = "yes" -a \( "$CFG_DEBUG" = "no" -o "$CFG_DEBUG_RELEASE" = "yes" \) ]; then
+ echo
+ echo "NOTE: -optimized-tools is not useful in -release mode."
+ echo
+fi
exec 1>&3 3>&- # restore stdout
cat $outpath/config.summary # display config feedback to user
@@ -7307,6 +7524,20 @@ EOF
fi
#-------------------------------------------------------------------------------
+# check if the user passed the deprecated -no-c++11 / --c++-level=c++98 option
+#-------------------------------------------------------------------------------
+if [ "$CFG_STDCXX" = "c++98" ]; then
+cat <<EOF
+
+ NOTICE: The -no-c++11 / --c++-level=c++98 option is deprecated.
+
+ Qt 5.7 will require C++11 support. The options are in effect for this
+ Qt 5.6 build, but you should update your build scripts to remove the
+ option and, if necessary, upgrade your compiler.
+EOF
+fi
+
+#-------------------------------------------------------------------------------
# finally save the executed command to another script
#-------------------------------------------------------------------------------
if [ `basename $0` != "config.status" ]; then
diff --git a/configure.bat b/configure.bat
index 1220bfedc2..47acf26d62 100644
--- a/configure.bat
+++ b/configure.bat
@@ -34,6 +34,7 @@
@echo off
set QTSRC=%~dp0
set QTDIR=%CD%
+
if not exist %QTSRC%.gitignore goto sconf
echo Please wait while bootstrapping configure ...
@@ -47,7 +48,18 @@ if not exist mkspecs (
md mkspecs
if errorlevel 1 goto exit
)
-perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir "%QTDIR%" %QTSRC%
+
+rem Extract Qt's version from .qmake.conf
+for /f "eol=# tokens=1,2,3,4 delims=.= " %%i in (%QTSRC%.qmake.conf) do (
+ if %%i == MODULE_VERSION (
+ set QTVERMAJ=%%j
+ set QTVERMIN=%%k
+ set QTVERPAT=%%l
+ )
+)
+set QTVERSION=%QTVERMAJ%.%QTVERMIN%.%QTVERPAT%
+
+perl %QTSRC%bin\syncqt.pl -minimal -version %QTVERSION% -module QtCore -outdir "%QTDIR%" %QTSRC%
if errorlevel 1 goto exit
if not exist tools\configure (
@@ -62,7 +74,11 @@ if not "%jom.exe%" == "" set make=jom
echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile
echo/>> Makefile
-for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile
+echo QTVERSION = %QTVERSION%>> Makefile
+rem These must have trailing spaces to avoid misinterpretation as 5>>, etc.
+echo QT_VERSION_MAJOR = %QTVERMAJ% >> Makefile
+echo QT_VERSION_MINOR = %QTVERMIN% >> Makefile
+echo QT_VERSION_PATCH = %QTVERPAT% >> Makefile
if not "%icl.exe%" == "" (
echo CXX = icl>>Makefile
echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile
diff --git a/doc/global/externalsites/external-resources.qdoc b/doc/global/externalsites/external-resources.qdoc
index d2cf88c174..3e82dfe814 100644
--- a/doc/global/externalsites/external-resources.qdoc
+++ b/doc/global/externalsites/external-resources.qdoc
@@ -489,6 +489,6 @@
*/
/*!
- \externalpage http://qt.digia.com/Try-Buy/Qt-Account-Sign-up/
+ \externalpage https://login.qt.io/
\title Qt Account Sign-up
*/
diff --git a/doc/global/externalsites/qt-webpages.qdoc b/doc/global/externalsites/qt-webpages.qdoc
index 386573e526..e70a441495 100644
--- a/doc/global/externalsites/qt-webpages.qdoc
+++ b/doc/global/externalsites/qt-webpages.qdoc
@@ -41,11 +41,11 @@
\title Qt Licensing Overview
*/
/*!
- \externalpage http://doc.qt.digia.com/qq/
+ \externalpage http://doc.qt.io/archives/qq/
\title Qt Quarterly
*/
/*!
- \externalpage http://doc.qt.digia.com/qq/qq19-plurals.html
+ \externalpage http://doc.qt.io/archives/qq/qq19-plurals.html
\title Qt Quarterly: Plural Form in Translation
*/
/*!
@@ -62,11 +62,11 @@
\title Qt Coding Style
*/
/*!
- \externalpage http://doc.qt.digia.com/qt-eclipse-1.6/index.html
+ \externalpage http://doc.qt.io/archives/qt-eclipse-1.6/index.html
\title Eclipse Plugin
*/
/*!
- \externalpage http://doc.qt.digia.com/qq/qq11-events.html
+ \externalpage http://doc.qt.io/archives/qq/qq11-events.html
\title Qt Quarterly: Another Look at Events
*/
/*!
diff --git a/doc/global/externalsites/qtcreator.qdoc b/doc/global/externalsites/qtcreator.qdoc
index 95200622f3..b8cd9dec00 100644
--- a/doc/global/externalsites/qtcreator.qdoc
+++ b/doc/global/externalsites/qtcreator.qdoc
@@ -106,6 +106,10 @@
\title Qt Creator: Creating a Qt Quick Application
*/
/*!
+ \externalpage http://doc.qt.io/qtcreator/qtquick-iso-icon-browser.html
+ \title Qt Creator: Browsing ISO 7000 Icons
+*/
+/*!
\externalpage http://doc.qt.io/qtcreator/quick-export-to-qml.html
\title Qt Creator: Exporting Designs from Graphics Software
*/
@@ -210,6 +214,10 @@
\title Qt Creator: Editing MIME Types
*/
/*!
+ \externalpage http://doc.qt.io/qtcreator/creator-modeling.html
+ \title Qt Creator: Modeling
+*/
+/*!
\externalpage http://doc.qt.io/qtcreator/creator-qml-debugging-example.html
\title Qt Creator: Debugging a Qt Quick Example Application
*/
diff --git a/doc/global/html-header-online.qdocconf b/doc/global/html-header-online.qdocconf
index aa67c43947..02b7375d32 100644
--- a/doc/global/html-header-online.qdocconf
+++ b/doc/global/html-header-online.qdocconf
@@ -3,6 +3,7 @@
HTML.stylesheets = template/style/online.css \
template/style/gsc.css \
template/style/list_arrow.png \
+ template/style/list_expand.png \
template/style/icomoon.eot \
template/style/icomoon.svg \
template/style/icomoon.ttf \
@@ -15,6 +16,7 @@ HTML.stylesheets = template/style/online.css \
qhp.extraFiles += style/online.css \
style/gsc.css \
style/list_arrow.png \
+ style/list_expand.png \
style/icomoon.eot \
style/icomoon.svg \
style/icomoon.ttf \
@@ -34,6 +36,7 @@ HTML.headerscripts = \
" <script type=\"text/javascript\" src=\"scripts/extras.js\"></script>\n" \
" <script type=\"text/javascript\">\n" \
" \$(function(){\n" \
+ " \$(\"#footer\").load(\"/style/qt-footer.html\");\n" \
" \$(\"#sidebar-content\").load(\"style/qt5-sidebar.html\");\n" \
" });\n" \
" </script>\n" \
diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf
index e7f0464efd..c45470838a 100644
--- a/doc/global/manifest-meta.qdocconf
+++ b/doc/global/manifest-meta.qdocconf
@@ -43,15 +43,21 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtQuick/Qt Quick Demo - Clocks" \
"QtQuick/Qt Quick Examples - Shader Effects" \
"QtQuickExtras/Qt Quick Extras - Dashboard" \
+ "QtQuickExtras/Qt Quick Extras - Flat" \
"QtQuickExtras/Qt Quick Extras - Gallery" \
"QtQuickControls/Qt Quick Controls - Gallery" \
"QtQuickControls/Qt Quick Controls - Text Editor Example" \
"QtQuickControls/Qt Quick Controls - Table View Example" \
"QtQuickControls/Qt Quick Controls - Calendar Example" \
+ "QtQuickControls/Qt Quick Controls - File System Browser Example" \
"QtQuickDialogs/Qt Quick System Dialog Examples" \
"QtWinExtras/Quick Player" \
"QtMultimedia/QML Video Shader Effects Example" \
- "QtCanvas3D/Planets Example"
+ "QtCanvas3D/Planets Example" \
+ "QtCanvas3D/Interactive Mobile Phone Example" \
+ "QtLocation/Map Viewer (QML)" \
+ "QtWebEngine/WebEngine Quick Nano Browser" \
+ "QtWebEngine/Markdown Editor Example"
manifestmeta.highlighted.attributes = isHighlighted:true
diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf
index 7cc9e0f317..967bbb8ede 100644
--- a/doc/global/qt-cpp-defines.qdocconf
+++ b/doc/global/qt-cpp-defines.qdocconf
@@ -37,6 +37,9 @@ Cpp.ignoretokens += \
Q_DECL_NOTHROW \
Q_DECL_PURE_FUNCTION \
Q_DECL_UNUSED \
+ Q_DECL_CF_RETURNS_RETAINED \
+ Q_DECL_NS_RETURNS_AUTORELEASED \
+ Q_DECL_EQ_DEFAULT \
Q_DECLARATIVE_EXPORT \
Q_EXPLICIT \
Q_EXPORT \
@@ -66,6 +69,7 @@ Cpp.ignoretokens += \
Q_POSITIONING_EXPORT \
Q_MULTIMEDIA_EXPORT \
Q_NETWORK_EXPORT \
+ Q_NEVER_INLINE \
Q_NORETURN \
Q_OPENGL_EXPORT \
Q_OPENVG_EXPORT \
@@ -75,6 +79,7 @@ Cpp.ignoretokens += \
Q_REQUIRED_RESULT \
Q_SCRIPT_EXPORT \
Q_SCRIPTTOOLS_EXPORT \
+ Q_SERIALBUS_EXPORT \
Q_SQL_EXPORT \
Q_SVG_EXPORT \
Q_TESTLIB_EXPORT \
@@ -134,6 +139,7 @@ Cpp.ignoredirectives += \
Q_DECLARE_PRIVATE_D \
Q_DECLARE_PUBLIC \
Q_DECLARE_SHARED \
+ Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6 \
Q_DECLARE_TR_FUNCTIONS \
Q_DECLARE_TYPEINFO \
Q_DECL_NOEXCEPT_EXPR \
@@ -153,4 +159,5 @@ Cpp.ignoredirectives += \
QT_WARNING_DISABLE_GCC \
QT_WARNING_DISABLE_INTEL \
QT_WARNING_DISABLE_MSVC \
+ Q_ATTRIBUTE_FORMAT_PRINTF \
Q_MV_IOS
diff --git a/doc/global/qt-html-templates-offline-simple.qdocconf b/doc/global/qt-html-templates-offline-simple.qdocconf
new file mode 100644
index 0000000000..4a65cc3c57
--- /dev/null
+++ b/doc/global/qt-html-templates-offline-simple.qdocconf
@@ -0,0 +1,35 @@
+# Specify a custom CSS file used by this template
+HTML.stylesheets += template/style/offline-simple.css
+qhp.extraFiles += style/offline-simple.css
+
+# Override the header styles
+HTML.headerstyles = \
+ " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline-simple.css\" />\n" \
+ " <script type=\"text/javascript\">\n" \
+ " window.onload = function(){document.getElementsByTagName(\"link\").item(0).setAttribute(\"href\", \"style/offline.css\");};\n" \
+ " </script>\n"
+
+HTML.postheader = \
+ "<body>\n" \
+ "<div class=\"header\" id=\"qtdocheader\">\n"\
+ " <div class=\"main\">\n" \
+ " <div class=\"main-rounded\">\n" \
+ " <div class=\"navigationbar\">\n" \
+ " <table><tr>\n"
+
+HTML.postpostheader = \
+ " </tr></table>\n"\
+ " </div>\n" \
+ " </div>\n" \
+ "<div class=\"content\">\n" \
+ "<div class=\"line\">\n" \
+ "<div class=\"content mainContent\">\n"
+
+HTML.navigationseparator = \
+ "<span class=\"naviSeparator\"> &#9702; </span>\n"
+
+# Add some padding around code snippets, as we cannot
+# currectly style them for QTextBrowser using only CSS.
+codeindent = 2
+codeprefix = "\n\n"
+codesuffix = "\n\n"
diff --git a/doc/global/qt-html-templates-offline.qdocconf b/doc/global/qt-html-templates-offline.qdocconf
index cd8315aa9a..d5780a35da 100644
--- a/doc/global/qt-html-templates-offline.qdocconf
+++ b/doc/global/qt-html-templates-offline.qdocconf
@@ -26,3 +26,8 @@ qhp.extraFiles += style/offline.css \
images/bullet_dn.png \
images/bullet_sq.png \
images/bgrContent.png
+
+# By default, include override definitions for a simplified template/CSS,
+# suited for rendering HTML with QTextBrowser. Comment out this line to
+# select the standard CSS.
+include(qt-html-templates-offline-simple.qdocconf)
diff --git a/doc/global/qt-module-defaults-offline.qdocconf b/doc/global/qt-module-defaults-offline.qdocconf
index af7afdd96f..ee9557fe5c 100644
--- a/doc/global/qt-module-defaults-offline.qdocconf
+++ b/doc/global/qt-module-defaults-offline.qdocconf
@@ -7,6 +7,7 @@ include(qt-cpp-defines.qdocconf)
include(compat.qdocconf)
include(manifest-meta.qdocconf)
include(fileextensions.qdocconf)
+
include(qt-html-templates-offline.qdocconf)
#extra configuration data such as file extensions
diff --git a/doc/global/template/scripts/extras.js b/doc/global/template/scripts/extras.js
index 8a623a037e..ba7a4a50fb 100644
--- a/doc/global/template/scripts/extras.js
+++ b/doc/global/template/scripts/extras.js
@@ -1,8 +1,25 @@
-var vOffset = 65;
+var vOffset_init = 65;
+var vOffset = vOffset_init;
+var c = 'collapsed';
+
+function toggleList(toggle, content, maxItems) {
+ if (toggle.css('display') == 'none') {
+ vOffset = vOffset_init;
+ toggle.removeClass(c);
+ content.show();
+ return;
+ } else
+ vOffset = 8;
+
+ if (maxItems > content.children().length)
+ return;
+ content.hide();
+ toggle.addClass(c);
+}
$(function () {
$('a[href*=#]:not([href=#])').on('click', function (e) {
- if (e.which == 2)
+ if (e.which == 2 || e.metaKey || e.ctrlKey || e.shiftKey)
return true;
var target = $(this.hash.replace(/(\.)/g, "\\$1"));
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
@@ -14,11 +31,50 @@ $(function () {
});
$(window).load(function () {
- var h = window.location.hash;
- var re = /[^a-z0-9_\.\#\-]/i
- if (h.length > 1 && !re.test(h)) {
- setTimeout(function () {
- $(window).scrollTop($(h.replace(/(\.)/g, "\\$1")).offset().top - vOffset);
- }, 0);
+ var hashChanged = function() {
+ var h = window.location.hash;
+ var re = /[^a-z0-9_\.\#\-]/i
+ if (h.length > 1 && !re.test(h)) {
+ setTimeout(function () {
+ var tgt = $(h.replace(/(\.)/g, "\\$1"));
+ tgt = tgt.length ? tgt : $('[name=' + h.slice(1) + ']');
+ $(window).scrollTop(tgt.offset().top - vOffset);
+ }, 0);
+ }
+ }
+ $(window).bind('hashchange', hashChanged);
+ hashChanged.call();
+
+ if (!$('.sidebar toc').is(':empty')) {
+ $('<div id="toc-toggle"></div>').prependTo('.sidebar .toc');
+ var toc = $('.sidebar .toc ul');
+ var tocToggle = $('#toc-toggle');
+ var tocCallback = function() { toggleList(tocToggle, toc, 4); };
+
+ $('#toc-toggle').on('click', function(e) {
+ e.stopPropagation();
+ toc.toggle();
+ tocToggle.toggleClass(c);
+ });
+
+ tocCallback.call();
+ $(window).resize(tocCallback);
+ }
+
+ if (!$('#sidebar-content').is(':empty')) {
+ $('#sidebar-content h2').first().clone().prependTo('#sidebar-content');
+ $('<div id="sidebar-toggle"></div>').prependTo('#sidebar-content');
+ var sb = $('#sidebar-content .sectionlist');
+ var sbToggle = $('#sidebar-toggle');
+ var sbCallback = function() { toggleList(sbToggle, sb, 0); };
+
+ $('#sidebar-toggle').on('click', function(e) {
+ e.stopPropagation();
+ sb.toggle();
+ sbToggle.toggleClass(c);
+ });
+
+ sbCallback.call();
+ $(window).resize(sbCallback);
}
});
diff --git a/doc/global/template/style/list_expand.png b/doc/global/template/style/list_expand.png
new file mode 100644
index 0000000000..d2145145fd
--- /dev/null
+++ b/doc/global/template/style/list_expand.png
Binary files differ
diff --git a/doc/global/template/style/offline-simple.css b/doc/global/template/style/offline-simple.css
new file mode 100644
index 0000000000..b11cb6a137
--- /dev/null
+++ b/doc/global/template/style/offline-simple.css
@@ -0,0 +1,176 @@
+body {
+ font-size: 14px;
+}
+
+pre {
+ background-color: #f0f0f0;
+ font-family: Courier, monospace;
+ font-size: 15px;
+ font-weight: 600;
+ vertical-align: top;
+ margin: 15px 85px 15px 35px;
+ padding: 25px;
+ width: 90%;
+ overflow-x:auto;
+}
+
+pre a[href] {
+ color: #5caa15;
+}
+
+p {
+ width: 70%;
+ margin: 15px 0px 10px 15px;
+}
+
+table p {
+ margin: 0px;
+ padding: 0px;
+}
+
+a[href] {
+ color: #007330;
+ text-decoration: none;
+}
+
+/* Different color for ext. links */
+a[href|="http://"], a[href|="https://"] {
+ color: #6bb8db;
+}
+
+h1.title {
+ margin-top: 30px;
+ margin-left: 6px;
+ font-size: 32px;
+ padding: 6px;
+}
+
+h2, p.h2 {
+ background-color: #F2F3F4;
+ padding: 4px;
+ margin: 30px 0px 20px 10px;
+}
+
+h3 {
+ font-size: 16px;
+ margin: 30px 0px 30px 6px;
+}
+
+ul, ol {
+ margin-top: 4px;
+ margin-bottom: 0px;
+}
+
+ul li, ol li {
+ margin-bottom: 8px;
+}
+
+.mainContent li.level2 {
+ margin-left: 16px;
+}
+
+.rightAlign {
+ text-align: right;
+}
+
+h3.fn, span.fn {
+ border-width: 3px;
+ border-style: solid;
+ border-color: #aaaaaa;
+ background-color: #eeeeee;
+ word-spacing: 3px;
+ padding: 5px;
+ text-decoration: none;
+ font-weight: 400;
+ font-size: 16px;
+ margin: 45px 0px 0px 6px;
+}
+
+table {
+ max-width: 80%;
+ padding: 15px 45px 15px 15px;
+}
+
+table th {
+ text-align: left;
+ padding: 8px;
+}
+
+table td {
+ padding: 6px 10px 6px 10px;
+}
+
+table tr.odd {
+ background-color: #eeeeee;
+}
+
+table.qmlname td {
+ padding: 0px;
+ margin-left: 6px;
+ font-size: 16px;
+}
+
+table.qmlname p .name,
+h3.fn .name, h3.fn .type {
+ font-weight: bold;
+}
+
+.context h3.fn {
+ font-weight: 400;
+}
+
+.qmlreadonly, .qmldefault {
+ font-family: Courier, monospace;
+ margin-right: 6px;
+}
+
+tr > td > pre {
+ font-size: 14px;
+}
+
+code {
+ font-family: Courier, monospace;
+ font-size: 16px;
+ font-weight: 400;
+}
+
+p.naviNextPrevious {
+ text-align: right;
+ margin-right: 20px;
+}
+
+span.naviSeparator {
+ white-space: pre;
+}
+
+.toc h3 {
+ margin: 0px 0px 10px 6px;
+}
+
+.toc ul {
+ list-style-type: none;
+}
+
+.navigationbar table {
+ padding: 0;
+ margin: 0;
+}
+
+.navigationbar table tr {
+ background-color: #eeeeee;
+}
+
+td#buildversion {
+ background-color: #ffffff;
+}
+
+.footer, .footer p {
+ padding: 5px 0px 5px 0px;
+ margin: 45px 15px 5px 15px;
+ font-size: 10px;
+ background-color: #cccccc;
+}
+
+.footer p {
+ margin: 0px;
+}
diff --git a/doc/global/template/style/offline.css b/doc/global/template/style/offline.css
index 16f26f43bb..1f76efbd38 100644
--- a/doc/global/template/style/offline.css
+++ b/doc/global/template/style/offline.css
@@ -192,6 +192,7 @@ Top navigation
margin-left: 30px;
}
+.naviSeparator { display: none }
/*
-----------
footer and license
@@ -266,7 +267,7 @@ footer and license
float: left
}
- .navigationbar li a {
+ .navigationbar li a, .navigationbar td a {
display: block;
text-decoration: none;
background: url(../images/arrow_bc.png);
@@ -275,6 +276,23 @@ footer and license
padding-right: 17px;
}
+table.buildversion {
+ float: right;
+ margin-top: -18px !important;
+}
+
+.navigationbar table {
+ border-radius: 0;
+ border: 0 none;
+ background-color: #F2F2F2;
+ margin: 0;
+}
+
+.navigationbar table td {
+ padding: 0;
+ border: 0 none;
+}
+
#buildversion {
font-style: italic;
font-size: small;
@@ -497,15 +515,26 @@ li {
margin-bottom: 10px;
padding-left: 8px;
list-style: outside;
- list-style-type: square;
text-align: left;
}
+ ul > li {
+ list-style-type: square;
+ }
+
ol {
margin: 10px;
padding: 0;
}
+ol.A > li {
+ list-style-type: upper-alpha;
+}
+
+ol.a > li{
+ list-style-type: lower-alpha;
+}
+
ol > li {
margin-left: 30px;
padding-left: 8px;
@@ -566,6 +595,21 @@ ol {
margin-left: 15px
}
+.flowList {
+ padding: 25px
+}
+.flowList dd {
+ display: inline-block;
+ margin-left: 10px;
+ width: 255px;
+ line-height: 1.15em;
+ overflow-x: hidden;
+ text-overflow: ellipsis
+}
+.alphaChar {
+ font-size: 2em;
+ position: relative
+}
/*
-----------
Content table
diff --git a/doc/global/template/style/online.css b/doc/global/template/style/online.css
index 8775719be6..be278a27da 100644
--- a/doc/global/template/style/online.css
+++ b/doc/global/template/style/online.css
@@ -254,6 +254,13 @@
line-height:1.4;
font-size:0.875em
}
+@media (min-width: 1320px) {
+ .context .flowListDiv dl.flowList {
+ -webkit-column-count:3;
+ -moz-column-count:3;
+ column-count:3
+ }
+}
@media (min-width: 1120px) {
#navbar.fixed,#navbar.shadow_bottom {
-moz-box-shadow:0px 0px 8px rgba(0,0,0,0.2);
@@ -293,6 +300,11 @@
#navbar.fixed #mainmenu li.current-menu-item a {
border-bottom:4px solid #80C342
}
+ .flowListDiv dl.flowList {
+ -webkit-column-count:2;
+ -moz-column-count:2;
+ column-count:2
+ }
}
@media (max-width: 1120px) {
#navbar {
@@ -525,6 +537,21 @@ body.qt-account #navbar .navbar-oneQt h2 {
position:absolute;
transition:none;
}
+#sidebar-toggle,#toc-toggle {
+ width:24px;
+ height:14px;
+ background-size:24px 28px;
+ cursor:pointer;
+ background-image:url("list_expand.png");
+ float:right
+}
+#sidebar-toggle.collapsed,
+#toc-toggle.collapsed {
+ background-position:bottom left
+}
+#sidebar-content > h2 {
+ display:none
+}
.cookies_yum .close:hover {
background-position:bottom left
}
@@ -960,9 +987,23 @@ ol,ul {
margin-top:0.75em;
margin-left:20px
}
+
+.context ol > li {
+ margin-left: 20px
+}
+
.mainContent ol>li {
- list-style-type:decimal
+ list-style-type: decimal;
+}
+
+.mainContent ol.a >li {
+ list-style-type: lower-alpha;
+}
+
+.mainContent ol.A >li {
+ list-style-type: upper-alpha;
}
+
blockquote,q {
quotes:none
}
@@ -1128,7 +1169,7 @@ dd {
.mainContent b {
font-weight:600
}
-.context ul {
+.context ul,.context ol {
margin-bottom:1.5em
}
.mainContent ul ul {
@@ -1191,6 +1232,19 @@ li a.active {
.flowList {
padding:25px
}
+.flowListDiv dl {
+ -webkit-column-count:1;
+ -moz-column-count:1;
+ column-count:1
+}
+.flowList dd {
+ display:inline-block;
+ margin-left:10px;
+ width:90%;
+ line-height:1.15em;
+ overflow-x:hidden;
+ text-overflow:ellipsis
+}
.alphaChar {
font-size:2em;
position:absolute
@@ -1206,13 +1260,13 @@ li a.active {
}
.mainContent table p {
margin:0px;
- padding:0px
-}
-.mainContent table p {
- margin:0px;
padding:0px;
+ max-width:initial;
min-height:2em
}
+.mainContent table p.centerAlign {
+ text-align:center
+}
.context h2 {
font-size:2.1875em
}
@@ -1246,6 +1300,9 @@ table td,table th {
table.alignedsummary,table.propsummary {
width:initial
}
+table.valuelist td.tblval {
+ font-size:0.75em
+}
div.main_index .row {
border-bottom:1px solid #eee
}
@@ -1282,6 +1339,9 @@ div.main_index .row:after {
div.table {
overflow-x:auto
}
+.context tr > td > pre {
+ font-size:0.85em
+}
p.qt_commercial {
border:3px solid #5caa15;
margin:0 auto;
@@ -1312,7 +1372,6 @@ pre {
line-height:1.5;
overflow-x:auto;
margin-bottom:25px;
- overflow-x:auto;
padding:25px;
margin-top:0.75em
}
@@ -1376,6 +1435,9 @@ pre:hover>.copy_text {
margin:0;
border:none
}
+#sidebar-toggle,#toc-toggle {
+ display:none
+}
@media (max-width: 980px) {
body {
font-size:calc-em(14px)
@@ -1413,7 +1475,8 @@ pre:hover>.copy_text {
visibility:hidden
}
.col-2 h2,.toc h3,.sidebar-content h2,.sidebar-content h3,.sectionlist h2 {
- text-align:center
+ text-align:center;
+ margin-bottom:0
}
div.main_index .row:after {
content:none
@@ -1438,6 +1501,12 @@ pre:hover>.copy_text {
margin-bottom:1em;
padding:20px
}
+ #sidebar-toggle,#toc-toggle {
+ display:block
+ }
+ #sidebar-toggle.collapsed + h2 {
+ display:block
+ }
.mainContent p {
line-height:1.56em;
margin-bottom:1em;
@@ -1446,6 +1515,9 @@ pre:hover>.copy_text {
table td,table th {
padding:5px 5px
}
+ .sectionlist {
+ padding:0
+ }
}
[id]:target,[name]:target,[name]:target+* {
-webkit-animation:highlighter 3s;
@@ -1453,22 +1525,22 @@ pre:hover>.copy_text {
}
@-webkit-keyframes highlighter {
25% {
- background-color:#46a2da;
- color:#fff
+ background-color:#d1e8f6;
+ color:#444
}
75% {
- background-color:#46a2da;
- color:#fff
+ background-color:#d1e8f6;
+ color:#444
}
}
@keyframes highlighter {
25% {
- background-color:#46a2da;
- color:#fff
+ background-color:#d1e8f6;
+ color:#444
}
75% {
- background-color:#46a2da;
- color:#fff
+ background-color:#d1e8f6;
+ color:#444
}
}
@-webkit-keyframes copypaste {
@@ -1580,7 +1652,7 @@ img.gsc-branding-img {
input.gsc-search-button {
background-color: white !important;
height: 35px !important;
- width: 35px !important;
+ width: 25px !important;
color: transparent !important;
background-image: url("doc_search.png") !important;
background-size: 25px auto;
diff --git a/doc/src/images/recentfiles-example.png b/doc/src/images/recentfiles-example.png
deleted file mode 100644
index 8a1f2e5509..0000000000
--- a/doc/src/images/recentfiles-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/dbus/complexpingpong/complexping.cpp b/examples/dbus/complexpingpong/complexping.cpp
index 10318fb0ed..855ef5d394 100644
--- a/examples/dbus/complexpingpong/complexping.cpp
+++ b/examples/dbus/complexpingpong/complexping.cpp
@@ -49,11 +49,9 @@
#include "ping-common.h"
#include "complexping.h"
-void Ping::start(const QString &name, const QString &oldValue, const QString &newValue)
+void Ping::start(const QString &name)
{
- Q_UNUSED(oldValue);
-
- if (name != SERVICE_NAME || newValue.isEmpty())
+ if (name != SERVICE_NAME)
return;
// open stdin for reading
@@ -105,10 +103,12 @@ int main(int argc, char **argv)
return 1;
}
+ QDBusServiceWatcher serviceWatcher(SERVICE_NAME, QDBusConnection::sessionBus(),
+ QDBusServiceWatcher::WatchForRegistration);
+
Ping ping;
- ping.connect(QDBusConnection::sessionBus().interface(),
- SIGNAL(serviceOwnerChanged(QString,QString,QString)),
- SLOT(start(QString,QString,QString)));
+ QObject::connect(&serviceWatcher, &QDBusServiceWatcher::serviceRegistered,
+ &ping, &Ping::start);
QProcess pong;
pong.start("./complexpong");
diff --git a/examples/dbus/complexpingpong/complexping.h b/examples/dbus/complexpingpong/complexping.h
index 4eb571dd2f..f6f1505507 100644
--- a/examples/dbus/complexpingpong/complexping.h
+++ b/examples/dbus/complexpingpong/complexping.h
@@ -49,7 +49,7 @@ class Ping: public QObject
{
Q_OBJECT
public slots:
- void start(const QString &, const QString &, const QString &);
+ void start(const QString &);
public:
QFile qstdin;
QDBusInterface *iface;
diff --git a/examples/dbus/complexpingpong/complexpong.cpp b/examples/dbus/complexpingpong/complexpong.cpp
index 0e0d5fed76..682e301f12 100644
--- a/examples/dbus/complexpingpong/complexpong.cpp
+++ b/examples/dbus/complexpingpong/complexpong.cpp
@@ -61,7 +61,7 @@ void Pong::setValue(const QString &newValue)
void Pong::quit()
{
- QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
+ QTimer::singleShot(0, QCoreApplication::instance(), &QCoreApplication::quit);
}
QDBusVariant Pong::query(const QString &query)
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
QObject obj;
Pong *pong = new Pong(&obj);
- pong->connect(&app, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit()));
+ QObject::connect(&app, &QCoreApplication::aboutToQuit, pong, &Pong::aboutToQuit);
pong->setProperty("value", "initial value");
QDBusConnection::sessionBus().registerObject("/", &obj);
diff --git a/examples/embedded/digiflip/digiflip.cpp b/examples/embedded/digiflip/digiflip.cpp
index 3bb3023caf..af4289efb3 100644
--- a/examples/embedded/digiflip/digiflip.cpp
+++ b/examples/embedded/digiflip/digiflip.cpp
@@ -112,7 +112,7 @@ protected:
QString str = QString::number(n);
if (str.length() == 1)
- str.prepend("0");
+ str.prepend('0');
QFont font;
font.setFamily("Helvetica");
diff --git a/examples/network/doc/src/fortuneserver.qdoc b/examples/network/doc/src/fortuneserver.qdoc
index c55a1634e4..0b110783aa 100644
--- a/examples/network/doc/src/fortuneserver.qdoc
+++ b/examples/network/doc/src/fortuneserver.qdoc
@@ -87,7 +87,7 @@
\snippet fortuneserver/server.cpp 7
- We then call QTcpServer::newPendingConnection(), which returns the
+ We then call QTcpServer::nextPendingConnection(), which returns the
QTcpSocket representing the server side of the connection. By connecting
QTcpSocket::disconnected() to QObject::deleteLater(), we ensure that the
socket will be deleted after disconnecting.
diff --git a/examples/network/fortuneclient/client.cpp b/examples/network/fortuneclient/client.cpp
index fc03a3c596..42fed30445 100644
--- a/examples/network/fortuneclient/client.cpp
+++ b/examples/network/fortuneclient/client.cpp
@@ -45,13 +45,18 @@
//! [0]
Client::Client(QWidget *parent)
-: QDialog(parent), networkSession(0)
+ : QDialog(parent)
+ , hostCombo(new QComboBox)
+ , portLineEdit(new QLineEdit)
+ , getFortuneButton(new QPushButton(tr("Get Fortune")))
+//! [1]
+ , tcpSocket(new QTcpSocket(this))
+//! [1]
+ , blockSize(0)
+ , networkSession(Q_NULLPTR)
{
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
//! [0]
- hostLabel = new QLabel(tr("&Server name:"));
- portLabel = new QLabel(tr("S&erver port:"));
-
- hostCombo = new QComboBox;
hostCombo->setEditable(true);
// find out name of this machine
QString name = QHostInfo::localHostName();
@@ -61,7 +66,7 @@ Client::Client(QWidget *parent)
if (!domain.isEmpty())
hostCombo->addItem(name + QChar('.') + domain);
}
- if (name != QString("localhost"))
+ if (name != QLatin1String("localhost"))
hostCombo->addItem(QString("localhost"));
// find out IP addresses of this machine
QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
@@ -76,54 +81,64 @@ Client::Client(QWidget *parent)
hostCombo->addItem(ipAddressesList.at(i).toString());
}
- portLineEdit = new QLineEdit;
portLineEdit->setValidator(new QIntValidator(1, 65535, this));
+ QLabel *hostLabel = new QLabel(tr("&Server name:"));
hostLabel->setBuddy(hostCombo);
+ QLabel *portLabel = new QLabel(tr("S&erver port:"));
portLabel->setBuddy(portLineEdit);
statusLabel = new QLabel(tr("This examples requires that you run the "
"Fortune Server example as well."));
- getFortuneButton = new QPushButton(tr("Get Fortune"));
getFortuneButton->setDefault(true);
getFortuneButton->setEnabled(false);
- quitButton = new QPushButton(tr("Quit"));
+ QPushButton *quitButton = new QPushButton(tr("Quit"));
- buttonBox = new QDialogButtonBox;
+ QDialogButtonBox *buttonBox = new QDialogButtonBox;
buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
-//! [1]
- tcpSocket = new QTcpSocket(this);
-//! [1]
-
- connect(hostCombo, SIGNAL(editTextChanged(QString)),
- this, SLOT(enableGetFortuneButton()));
- connect(portLineEdit, SIGNAL(textChanged(QString)),
- this, SLOT(enableGetFortuneButton()));
- connect(getFortuneButton, SIGNAL(clicked()),
- this, SLOT(requestNewFortune()));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(hostCombo, &QComboBox::editTextChanged,
+ this, &Client::enableGetFortuneButton);
+ connect(portLineEdit, &QLineEdit::textChanged,
+ this, &Client::enableGetFortuneButton);
+ connect(getFortuneButton, &QAbstractButton::clicked,
+ this, &Client::requestNewFortune);
+ connect(quitButton, &QAbstractButton::clicked, this, &QWidget::close);
//! [2] //! [3]
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(readFortune()));
+ connect(tcpSocket, &QIODevice::readyRead, this, &Client::readFortune);
//! [2] //! [4]
- connect(tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
+ typedef void (QAbstractSocket::*QAbstractSocketErrorSignal)(QAbstractSocket::SocketError);
+ connect(tcpSocket, static_cast<QAbstractSocketErrorSignal>(&QAbstractSocket::error),
//! [3]
- this, SLOT(displayError(QAbstractSocket::SocketError)));
+ this, &Client::displayError);
//! [4]
- QGridLayout *mainLayout = new QGridLayout;
+ QGridLayout *mainLayout = Q_NULLPTR;
+ if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
+ QVBoxLayout *outerVerticalLayout = new QVBoxLayout(this);
+ outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
+ QHBoxLayout *outerHorizontalLayout = new QHBoxLayout;
+ outerHorizontalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored));
+ QGroupBox *groupBox = new QGroupBox(QGuiApplication::applicationDisplayName());
+ mainLayout = new QGridLayout(groupBox);
+ outerHorizontalLayout->addWidget(groupBox);
+ outerHorizontalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored));
+ outerVerticalLayout->addLayout(outerHorizontalLayout);
+ outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
+ } else {
+ mainLayout = new QGridLayout(this);
+ }
mainLayout->addWidget(hostLabel, 0, 0);
mainLayout->addWidget(hostCombo, 0, 1);
mainLayout->addWidget(portLabel, 1, 0);
mainLayout->addWidget(portLineEdit, 1, 1);
mainLayout->addWidget(statusLabel, 2, 0, 1, 2);
mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
- setLayout(mainLayout);
- setWindowTitle(tr("Fortune Client"));
+ setWindowTitle(QGuiApplication::applicationDisplayName());
portLineEdit->setFocus();
QNetworkConfigurationManager manager;
@@ -142,7 +157,7 @@ Client::Client(QWidget *parent)
}
networkSession = new QNetworkSession(config, this);
- connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
+ connect(networkSession, &QNetworkSession::opened, this, &Client::sessionOpened);
getFortuneButton->setEnabled(false);
statusLabel->setText(tr("Opening network session."));
@@ -189,7 +204,7 @@ void Client::readFortune()
in >> nextFortune;
if (nextFortune == currentFortune) {
- QTimer::singleShot(0, this, SLOT(requestNewFortune()));
+ QTimer::singleShot(0, this, &Client::requestNewFortune);
return;
}
//! [11]
diff --git a/examples/network/fortuneclient/client.h b/examples/network/fortuneclient/client.h
index a93d35e4ed..9b7d6f4dbf 100644
--- a/examples/network/fortuneclient/client.h
+++ b/examples/network/fortuneclient/client.h
@@ -46,7 +46,6 @@
QT_BEGIN_NAMESPACE
class QComboBox;
-class QDialogButtonBox;
class QLabel;
class QLineEdit;
class QPushButton;
@@ -60,7 +59,7 @@ class Client : public QDialog
Q_OBJECT
public:
- Client(QWidget *parent = 0);
+ explicit Client(QWidget *parent = Q_NULLPTR);
private slots:
void requestNewFortune();
@@ -70,14 +69,10 @@ private slots:
void sessionOpened();
private:
- QLabel *hostLabel;
- QLabel *portLabel;
QComboBox *hostCombo;
QLineEdit *portLineEdit;
QLabel *statusLabel;
QPushButton *getFortuneButton;
- QPushButton *quitButton;
- QDialogButtonBox *buttonBox;
QTcpSocket *tcpSocket;
QString currentFortune;
diff --git a/examples/network/fortuneclient/main.cpp b/examples/network/fortuneclient/main.cpp
index 2c02dcbaa6..66fff7a374 100644
--- a/examples/network/fortuneclient/main.cpp
+++ b/examples/network/fortuneclient/main.cpp
@@ -44,6 +44,7 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QGuiApplication::setApplicationDisplayName(Client::tr("Fortune Client"));
Client client;
client.show();
return app.exec();
diff --git a/examples/network/fortuneserver/main.cpp b/examples/network/fortuneserver/main.cpp
index 589bb5e339..3b8eef40ba 100644
--- a/examples/network/fortuneserver/main.cpp
+++ b/examples/network/fortuneserver/main.cpp
@@ -48,6 +48,7 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QGuiApplication::setApplicationDisplayName(Server::tr("Fortune Server"));
Server server;
server.show();
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index 64a7814a20..089f594cab 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -46,11 +46,13 @@
#include "server.h"
Server::Server(QWidget *parent)
-: QDialog(parent), tcpServer(0), networkSession(0)
+ : QDialog(parent)
+ , statusLabel(new QLabel)
+ , tcpServer(Q_NULLPTR)
+ , networkSession(0)
{
- statusLabel = new QLabel;
- quitButton = new QPushButton(tr("Quit"));
- quitButton->setAutoDefault(false);
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ statusLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
QNetworkConfigurationManager manager;
if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
@@ -68,7 +70,7 @@ Server::Server(QWidget *parent)
}
networkSession = new QNetworkSession(config, this);
- connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
+ connect(networkSession, &QNetworkSession::opened, this, &Server::sessionOpened);
statusLabel->setText(tr("Opening network session."));
networkSession->open();
@@ -85,10 +87,11 @@ Server::Server(QWidget *parent)
<< tr("You cannot kill time without injuring eternity.")
<< tr("Computers are not intelligent. They only think they are.");
//! [2]
-
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+ QPushButton *quitButton = new QPushButton(tr("Quit"));
+ quitButton->setAutoDefault(false);
+ connect(quitButton, &QAbstractButton::clicked, this, &QWidget::close);
//! [3]
- connect(tcpServer, SIGNAL(newConnection()), this, SLOT(sendFortune()));
+ connect(tcpServer, &QTcpServer::newConnection, this, &Server::sendFortune);
//! [3]
QHBoxLayout *buttonLayout = new QHBoxLayout;
@@ -96,12 +99,26 @@ Server::Server(QWidget *parent)
buttonLayout->addWidget(quitButton);
buttonLayout->addStretch(1);
- QVBoxLayout *mainLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = Q_NULLPTR;
+ if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
+ QVBoxLayout *outerVerticalLayout = new QVBoxLayout(this);
+ outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
+ QHBoxLayout *outerHorizontalLayout = new QHBoxLayout;
+ outerHorizontalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored));
+ QGroupBox *groupBox = new QGroupBox(QGuiApplication::applicationDisplayName());
+ mainLayout = new QVBoxLayout(groupBox);
+ outerHorizontalLayout->addWidget(groupBox);
+ outerHorizontalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored));
+ outerVerticalLayout->addLayout(outerHorizontalLayout);
+ outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
+ } else {
+ mainLayout = new QVBoxLayout(this);
+ }
+
mainLayout->addWidget(statusLabel);
mainLayout->addLayout(buttonLayout);
- setLayout(mainLayout);
- setWindowTitle(tr("Fortune Server"));
+ setWindowTitle(QGuiApplication::applicationDisplayName());
}
void Server::sessionOpened()
@@ -165,8 +182,8 @@ void Server::sendFortune()
//! [6] //! [7]
QTcpSocket *clientConnection = tcpServer->nextPendingConnection();
- connect(clientConnection, SIGNAL(disconnected()),
- clientConnection, SLOT(deleteLater()));
+ connect(clientConnection, &QAbstractSocket::disconnected,
+ clientConnection, &QObject::deleteLater);
//! [7] //! [8]
clientConnection->write(block);
diff --git a/examples/network/fortuneserver/server.h b/examples/network/fortuneserver/server.h
index d21aa107cf..5b3413295a 100644
--- a/examples/network/fortuneserver/server.h
+++ b/examples/network/fortuneserver/server.h
@@ -56,7 +56,7 @@ class Server : public QDialog
Q_OBJECT
public:
- Server(QWidget *parent = 0);
+ explicit Server(QWidget *parent = Q_NULLPTR);
private slots:
void sessionOpened();
@@ -64,7 +64,6 @@ private slots:
private:
QLabel *statusLabel;
- QPushButton *quitButton;
QTcpServer *tcpServer;
QStringList fortunes;
QNetworkSession *networkSession;
diff --git a/examples/network/http/authenticationdialog.ui b/examples/network/http/authenticationdialog.ui
index 82d908cffb..5baf1bd97e 100644
--- a/examples/network/http/authenticationdialog.ui
+++ b/examples/network/http/authenticationdialog.ui
@@ -41,7 +41,11 @@
</widget>
</item>
<item row="3" column="1" >
- <widget class="QLineEdit" name="passwordEdit" />
+ <widget class="QLineEdit" name="passwordEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
</item>
<item row="5" column="0" colspan="2" >
<widget class="QDialogButtonBox" name="buttonBox" >
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index 39623fd6dd..301431fd5e 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -40,85 +40,134 @@
#include <QtWidgets>
#include <QtNetwork>
+#include <QUrl>
#include "httpwindow.h"
#include "ui_authenticationdialog.h"
-HttpWindow::HttpWindow(QWidget *parent)
- : QDialog(parent)
-{
#ifndef QT_NO_SSL
- urlLineEdit = new QLineEdit("https://qt-project.org/");
+static const char defaultUrl[] = "https://qt-project.org/";
#else
- urlLineEdit = new QLineEdit("http://qt-project.org/");
+static const char defaultUrl[] = "http://qt-project.org/";
#endif
+static const char defaultFileName[] = "index.html";
- urlLabel = new QLabel(tr("&URL:"));
- urlLabel->setBuddy(urlLineEdit);
- statusLabel = new QLabel(tr("Please enter the URL of a file you want to "
- "download."));
- statusLabel->setWordWrap(true);
-
- downloadButton = new QPushButton(tr("Download"));
- downloadButton->setDefault(true);
- quitButton = new QPushButton(tr("Quit"));
- quitButton->setAutoDefault(false);
-
- buttonBox = new QDialogButtonBox;
- buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
- buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
+ProgressDialog::ProgressDialog(const QUrl &url, QWidget *parent)
+ : QProgressDialog(parent)
+{
+ setWindowTitle(tr("Download Progress"));
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ setLabelText(tr("Downloading %1.").arg(url.toDisplayString()));
+ setMinimum(0);
+ setValue(0);
+ setMinimumDuration(0);
+}
- progressDialog = new QProgressDialog(this);
+void ProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
+{
+ setMaximum(totalBytes);
+ setValue(bytesRead);
+}
- connect(urlLineEdit, SIGNAL(textChanged(QString)),
- this, SLOT(enableDownloadButton()));
+HttpWindow::HttpWindow(QWidget *parent)
+ : QDialog(parent)
+ , statusLabel(new QLabel(tr("Please enter the URL of a file you want to download.\n\n"), this))
+ , urlLineEdit(new QLineEdit(defaultUrl))
+ , downloadButton(new QPushButton(tr("Download")))
+ , launchCheckBox(new QCheckBox("Launch file"))
+ , defaultFileLineEdit(new QLineEdit(defaultFileName))
+ , downloadDirectoryLineEdit(new QLineEdit)
+ , reply(Q_NULLPTR)
+ , file(Q_NULLPTR)
+ , httpRequestAborted(false)
+{
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ setWindowTitle(tr("HTTP"));
- connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
- this, SLOT(slotAuthenticationRequired(QNetworkReply*,QAuthenticator*)));
+ connect(&qnam, &QNetworkAccessManager::authenticationRequired,
+ this, &HttpWindow::slotAuthenticationRequired);
#ifndef QT_NO_SSL
- connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
- this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
+ connect(&qnam, &QNetworkAccessManager::sslErrors,
+ this, &HttpWindow::sslErrors);
#endif
- connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
- connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
- QHBoxLayout *topLayout = new QHBoxLayout;
- topLayout->addWidget(urlLabel);
- topLayout->addWidget(urlLineEdit);
+ QFormLayout *formLayout = new QFormLayout;
+ urlLineEdit->setClearButtonEnabled(true);
+ connect(urlLineEdit, &QLineEdit::textChanged,
+ this, &HttpWindow::enableDownloadButton);
+ formLayout->addRow(tr("&URL:"), urlLineEdit);
+ QString downloadDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+ if (downloadDirectory.isEmpty() || !QFileInfo(downloadDirectory).isDir())
+ downloadDirectory = QDir::currentPath();
+ downloadDirectoryLineEdit->setText(QDir::toNativeSeparators(downloadDirectory));
+ formLayout->addRow(tr("&Download directory:"), downloadDirectoryLineEdit);
+ formLayout->addRow(tr("Default &file:"), defaultFileLineEdit);
+ launchCheckBox->setChecked(true);
+ formLayout->addRow(launchCheckBox);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ mainLayout->addLayout(formLayout);
+
+ mainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
- QVBoxLayout *mainLayout = new QVBoxLayout;
- mainLayout->addLayout(topLayout);
+ statusLabel->setWordWrap(true);
mainLayout->addWidget(statusLabel);
+
+ downloadButton->setDefault(true);
+ connect(downloadButton, &QAbstractButton::clicked, this, &HttpWindow::downloadFile);
+ QPushButton *quitButton = new QPushButton(tr("Quit"));
+ quitButton->setAutoDefault(false);
+ connect(quitButton, &QAbstractButton::clicked, this, &QWidget::close);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox;
+ buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
+ buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
mainLayout->addWidget(buttonBox);
- setLayout(mainLayout);
- setWindowTitle(tr("HTTP"));
urlLineEdit->setFocus();
}
-void HttpWindow::startRequest(QUrl url)
+void HttpWindow::startRequest(const QUrl &requestedUrl)
{
+ url = requestedUrl;
+ httpRequestAborted = false;
+
reply = qnam.get(QNetworkRequest(url));
- connect(reply, SIGNAL(finished()),
- this, SLOT(httpFinished()));
- connect(reply, SIGNAL(readyRead()),
- this, SLOT(httpReadyRead()));
- connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
- this, SLOT(updateDataReadProgress(qint64,qint64)));
+ connect(reply, &QNetworkReply::finished, this, &HttpWindow::httpFinished);
+ connect(reply, &QIODevice::readyRead, this, &HttpWindow::httpReadyRead);
+
+ ProgressDialog *progressDialog = new ProgressDialog(url, this);
+ progressDialog->setAttribute(Qt::WA_DeleteOnClose);
+ connect(progressDialog, &QProgressDialog::canceled, this, &HttpWindow::cancelDownload);
+ connect(reply, &QNetworkReply::downloadProgress, progressDialog, &ProgressDialog::networkReplyProgress);
+ connect(reply, &QNetworkReply::finished, progressDialog, &ProgressDialog::hide);
+ progressDialog->show();
+
+ statusLabel->setText(tr("Downloading %1...").arg(url.toString()));
}
void HttpWindow::downloadFile()
{
- url = urlLineEdit->text();
+ const QString urlSpec = urlLineEdit->text().trimmed();
+ if (urlSpec.isEmpty())
+ return;
- QFileInfo fileInfo(url.path());
- QString fileName = fileInfo.fileName();
- if (fileName.isEmpty())
- fileName = "index.html";
+ const QUrl newUrl = QUrl::fromUserInput(urlSpec);
+ if (!newUrl.isValid()) {
+ QMessageBox::information(this, tr("Error"),
+ tr("Invalid URL: %1: %2").arg(urlSpec, newUrl.errorString()));
+ return;
+ }
+ QString fileName = newUrl.fileName();
+ if (fileName.isEmpty())
+ fileName = defaultFileLineEdit->text().trimmed();
+ if (fileName.isEmpty())
+ fileName = defaultFileName;
+ QString downloadDirectory = QDir::cleanPath(downloadDirectoryLineEdit->text().trimmed());
+ if (!downloadDirectory.isEmpty() && QFileInfo(downloadDirectory).isDir())
+ fileName.prepend(downloadDirectory + '/');
if (QFile::exists(fileName)) {
- if (QMessageBox::question(this, tr("HTTP"),
+ if (QMessageBox::question(this, tr("Overwrite Existing File"),
tr("There already exists a file called %1 in "
"the current directory. Overwrite?").arg(fileName),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No)
@@ -127,23 +176,27 @@ void HttpWindow::downloadFile()
QFile::remove(fileName);
}
- file = new QFile(fileName);
- if (!file->open(QIODevice::WriteOnly)) {
- QMessageBox::information(this, tr("HTTP"),
- tr("Unable to save the file %1: %2.")
- .arg(fileName).arg(file->errorString()));
- delete file;
- file = 0;
+ file = openFileForWrite(fileName);
+ if (!file)
return;
- }
- progressDialog->setWindowTitle(tr("HTTP"));
- progressDialog->setLabelText(tr("Downloading %1.").arg(fileName));
downloadButton->setEnabled(false);
// schedule the request
- httpRequestAborted = false;
- startRequest(url);
+ startRequest(newUrl);
+}
+
+QFile *HttpWindow::openFileForWrite(const QString &fileName)
+{
+ QScopedPointer<QFile> file(new QFile(fileName));
+ if (!file->open(QIODevice::WriteOnly)) {
+ QMessageBox::information(this, tr("Error"),
+ tr("Unable to save the file %1: %2.")
+ .arg(QDir::toNativeSeparators(fileName),
+ file->errorString()));
+ return Q_NULLPTR;
+ }
+ return file.take();
}
void HttpWindow::cancelDownload()
@@ -156,52 +209,56 @@ void HttpWindow::cancelDownload()
void HttpWindow::httpFinished()
{
+ QFileInfo fi;
+ if (file) {
+ fi.setFile(file->fileName());
+ file->close();
+ delete file;
+ file = Q_NULLPTR;
+ }
+
if (httpRequestAborted) {
- if (file) {
- file->close();
- file->remove();
- delete file;
- file = 0;
- }
reply->deleteLater();
- progressDialog->hide();
+ reply = Q_NULLPTR;
return;
}
- progressDialog->hide();
- file->flush();
- file->close();
-
-
- QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (reply->error()) {
- file->remove();
- QMessageBox::information(this, tr("HTTP"),
- tr("Download failed: %1.")
- .arg(reply->errorString()));
+ QFile::remove(fi.absoluteFilePath());
+ statusLabel->setText(tr("Download failed:\n%1.").arg(reply->errorString()));
downloadButton->setEnabled(true);
- } else if (!redirectionTarget.isNull()) {
- QUrl newUrl = url.resolved(redirectionTarget.toUrl());
- if (QMessageBox::question(this, tr("HTTP"),
- tr("Redirect to %1 ?").arg(newUrl.toString()),
- QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
- url = newUrl;
- reply->deleteLater();
- file->open(QIODevice::WriteOnly);
- file->resize(0);
- startRequest(url);
+ reply->deleteLater();
+ reply = Q_NULLPTR;
+ return;
+ }
+
+ const QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+
+ reply->deleteLater();
+ reply = Q_NULLPTR;
+
+ if (!redirectionTarget.isNull()) {
+ const QUrl redirectedUrl = url.resolved(redirectionTarget.toUrl());
+ if (QMessageBox::question(this, tr("Redirect"),
+ tr("Redirect to %1 ?").arg(redirectedUrl.toString()),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
+ downloadButton->setEnabled(true);
return;
}
- } else {
- QString fileName = QFileInfo(QUrl(urlLineEdit->text()).path()).fileName();
- statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath()));
- downloadButton->setEnabled(true);
+ file = openFileForWrite(fi.absoluteFilePath());
+ if (!file) {
+ downloadButton->setEnabled(true);
+ return;
+ }
+ startRequest(redirectedUrl);
+ return;
}
- reply->deleteLater();
- reply = 0;
- delete file;
- file = 0;
+ statusLabel->setText(tr("Downloaded %1 bytes to %2\nin\n%3")
+ .arg(fi.size()).arg(fi.fileName(), QDir::toNativeSeparators(fi.absolutePath())));
+ if (launchCheckBox->isChecked())
+ QDesktopServices::openUrl(QUrl::fromLocalFile(fi.absoluteFilePath()));
+ downloadButton->setEnabled(true);
}
void HttpWindow::httpReadyRead()
@@ -214,15 +271,6 @@ void HttpWindow::httpReadyRead()
file->write(reply->readAll());
}
-void HttpWindow::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
-{
- if (httpRequestAborted)
- return;
-
- progressDialog->setMaximum(totalBytes);
- progressDialog->setValue(bytesRead);
-}
-
void HttpWindow::enableDownloadButton()
{
downloadButton->setEnabled(!urlLineEdit->text().isEmpty());
@@ -230,18 +278,18 @@ void HttpWindow::enableDownloadButton()
void HttpWindow::slotAuthenticationRequired(QNetworkReply*,QAuthenticator *authenticator)
{
- QDialog dlg;
+ QDialog authenticationDialog;
Ui::Dialog ui;
- ui.setupUi(&dlg);
- dlg.adjustSize();
- ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm()).arg(url.host()));
+ ui.setupUi(&authenticationDialog);
+ authenticationDialog.adjustSize();
+ ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm(), url.host()));
// Did the URL have information? Fill the UI
// This is only relevant if the URL-supplied credentials were wrong
ui.userEdit->setText(url.userName());
ui.passwordEdit->setText(url.password());
- if (dlg.exec() == QDialog::Accepted) {
+ if (authenticationDialog.exec() == QDialog::Accepted) {
authenticator->setUser(ui.userEdit->text());
authenticator->setPassword(ui.passwordEdit->text());
}
@@ -253,12 +301,12 @@ void HttpWindow::sslErrors(QNetworkReply*,const QList<QSslError> &errors)
QString errorString;
foreach (const QSslError &error, errors) {
if (!errorString.isEmpty())
- errorString += ", ";
+ errorString += '\n';
errorString += error.errorString();
}
- if (QMessageBox::warning(this, tr("HTTP"),
- tr("One or more SSL errors has occurred: %1").arg(errorString),
+ if (QMessageBox::warning(this, tr("SSL Errors"),
+ tr("One or more SSL errors has occurred:\n%1").arg(errorString),
QMessageBox::Ignore | QMessageBox::Abort) == QMessageBox::Ignore) {
reply->ignoreSslErrors();
}
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index f1dc2e1f80..cc632e5bab 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -41,39 +41,46 @@
#ifndef HTTPWINDOW_H
#define HTTPWINDOW_H
-#include <QDialog>
+#include <QProgressDialog>
#include <QNetworkAccessManager>
#include <QUrl>
QT_BEGIN_NAMESPACE
-class QDialogButtonBox;
class QFile;
class QLabel;
class QLineEdit;
-class QProgressDialog;
class QPushButton;
class QSslError;
class QAuthenticator;
class QNetworkReply;
-
+class QCheckBox;
QT_END_NAMESPACE
+class ProgressDialog : public QProgressDialog {
+ Q_OBJECT
+
+public:
+ explicit ProgressDialog(const QUrl &url, QWidget *parent = Q_NULLPTR);
+
+public slots:
+ void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
+};
+
class HttpWindow : public QDialog
{
Q_OBJECT
public:
- HttpWindow(QWidget *parent = 0);
+ explicit HttpWindow(QWidget *parent = Q_NULLPTR);
- void startRequest(QUrl url);
+ void startRequest(const QUrl &requestedUrl);
private slots:
void downloadFile();
void cancelDownload();
void httpFinished();
void httpReadyRead();
- void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
void enableDownloadButton();
void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
#ifndef QT_NO_SSL
@@ -81,19 +88,19 @@ private slots:
#endif
private:
+ QFile *openFileForWrite(const QString &fileName);
+
QLabel *statusLabel;
- QLabel *urlLabel;
QLineEdit *urlLineEdit;
- QProgressDialog *progressDialog;
QPushButton *downloadButton;
- QPushButton *quitButton;
- QDialogButtonBox *buttonBox;
+ QCheckBox *launchCheckBox;
+ QLineEdit *defaultFileLineEdit;
+ QLineEdit *downloadDirectoryLineEdit;
QUrl url;
QNetworkAccessManager qnam;
QNetworkReply *reply;
QFile *file;
- int httpGetId;
bool httpRequestAborted;
};
diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp
index 5857af265c..b4960008ec 100644
--- a/examples/network/http/main.cpp
+++ b/examples/network/http/main.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QApplication>
+#include <QDesktopWidget>
#include <QDir>
#include "httpwindow.h"
@@ -47,8 +48,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
-
HttpWindow httpWin;
+ const QRect availableSize = QApplication::desktop()->availableGeometry(&httpWin);
+ httpWin.resize(availableSize.width() / 5, availableSize.height() / 5);
+ httpWin.move((availableSize.width() - httpWin.width()) / 2, (availableSize.height() - httpWin.height()) / 2);
httpWin.show();
return app.exec();
diff --git a/examples/network/torrent/filemanager.cpp b/examples/network/torrent/filemanager.cpp
index b4e921b0a5..58330014cf 100644
--- a/examples/network/torrent/filemanager.cpp
+++ b/examples/network/torrent/filemanager.cpp
@@ -219,8 +219,8 @@ bool FileManager::generateFiles()
QString prefix;
if (!destinationPath.isEmpty()) {
prefix = destinationPath;
- if (!prefix.endsWith("/"))
- prefix += "/";
+ if (!prefix.endsWith('/'))
+ prefix += '/';
QDir dir;
if (!dir.mkpath(prefix)) {
errString = tr("Failed to create directory %1").arg(prefix);
@@ -261,13 +261,13 @@ bool FileManager::generateFiles()
if (!destinationPath.isEmpty()) {
prefix = destinationPath;
- if (!prefix.endsWith("/"))
- prefix += "/";
+ if (!prefix.endsWith('/'))
+ prefix += '/';
}
if (!metaInfo.name().isEmpty()) {
prefix += metaInfo.name();
- if (!prefix.endsWith("/"))
- prefix += "/";
+ if (!prefix.endsWith('/'))
+ prefix += '/';
}
if (!dir.mkpath(prefix)) {
errString = tr("Failed to create directory %1").arg(prefix);
diff --git a/examples/network/torrent/metainfo.cpp b/examples/network/torrent/metainfo.cpp
index cca52c7e7e..52e7afe43a 100644
--- a/examples/network/torrent/metainfo.cpp
+++ b/examples/network/torrent/metainfo.cpp
@@ -96,7 +96,7 @@ bool MetaInfo::parse(const QByteArray &data)
QByteArray path;
foreach (QVariant p, pathElements) {
if (!path.isEmpty())
- path += "/";
+ path += '/';
path += p.toByteArray();
}
diff --git a/examples/opengl/2dpainting/window.cpp b/examples/opengl/2dpainting/window.cpp
index e10d862607..4734026dfb 100644
--- a/examples/opengl/2dpainting/window.cpp
+++ b/examples/opengl/2dpainting/window.cpp
@@ -66,8 +66,8 @@ Window::Window()
setLayout(layout);
QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), native, SLOT(animate()));
- connect(timer, SIGNAL(timeout()), openGL, SLOT(animate()));
+ connect(timer, &QTimer::timeout, native, &Widget::animate);
+ connect(timer, &QTimer::timeout, openGL, &GLWidget::animate);
timer->start(50);
}
//! [0]
diff --git a/examples/opengl/contextinfo/renderwindow.cpp b/examples/opengl/contextinfo/renderwindow.cpp
index 9d7e2c450e..fefcf0e56d 100644
--- a/examples/opengl/contextinfo/renderwindow.cpp
+++ b/examples/opengl/contextinfo/renderwindow.cpp
@@ -221,5 +221,5 @@ void RenderWindow::render()
// only here to make the UI widgets more responsive on slower machines. We
// can afford it since our rendering is so lightweight.
const int interval = 5;
- QTimer::singleShot(interval, this, SLOT(render()));
+ QTimer::singleShot(interval, this, &RenderWindow::render);
}
diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp
index c318accf87..2d36fe4265 100644
--- a/examples/opengl/contextinfo/widget.cpp
+++ b/examples/opengl/contextinfo/widget.cpp
@@ -299,7 +299,7 @@ void Widget::printFormat(const QSurfaceFormat &format)
QString opts;
for (size_t i = 0; i < sizeof(options) / sizeof(Option); ++i)
if (format.testOption(options[i].option))
- opts += QString::fromLatin1(options[i].str) + QStringLiteral(" ");
+ opts += QString::fromLatin1(options[i].str) + QLatin1Char(' ');
m_output->append(tr("Options: %1").arg(opts));
for (size_t i = 0; i < sizeof(renderables) / sizeof(Renderable); ++i)
diff --git a/examples/opengl/hellogl2/glwidget.cpp b/examples/opengl/hellogl2/glwidget.cpp
index 9738dcda20..6505ad3141 100644
--- a/examples/opengl/hellogl2/glwidget.cpp
+++ b/examples/opengl/hellogl2/glwidget.cpp
@@ -55,8 +55,11 @@ GLWidget::GLWidget(QWidget *parent)
// --transparent causes the clear color to be transparent. Therefore, on systems that
// support it, the widget will become transparent apart from the logo.
m_transparent = QCoreApplication::arguments().contains(QStringLiteral("--transparent"));
- if (m_transparent)
- setAttribute(Qt::WA_TranslucentBackground);
+ if (m_transparent) {
+ QSurfaceFormat fmt = format();
+ fmt.setAlphaBufferSize(8);
+ setFormat(fmt);
+ }
}
GLWidget::~GLWidget()
diff --git a/examples/opengl/hellogl2/main.cpp b/examples/opengl/hellogl2/main.cpp
index 4dc67f6e15..554e37e19b 100644
--- a/examples/opengl/hellogl2/main.cpp
+++ b/examples/opengl/hellogl2/main.cpp
@@ -59,6 +59,10 @@ int main(int argc, char *argv[])
QSurfaceFormat::setDefaultFormat(fmt);
MainWindow mainWindow;
+ if (QCoreApplication::arguments().contains(QStringLiteral("--transparent"))) {
+ mainWindow.setAttribute(Qt::WA_TranslucentBackground);
+ mainWindow.setAttribute(Qt::WA_NoSystemBackground, false);
+ }
mainWindow.resize(mainWindow.sizeHint());
int desktopArea = QApplication::desktop()->width() *
QApplication::desktop()->height();
diff --git a/examples/opengl/hellogl2/mainwindow.cpp b/examples/opengl/hellogl2/mainwindow.cpp
index 104cf24b37..b938300349 100644
--- a/examples/opengl/hellogl2/mainwindow.cpp
+++ b/examples/opengl/hellogl2/mainwindow.cpp
@@ -51,7 +51,7 @@ MainWindow::MainWindow()
QAction *addNew = new QAction(menuWindow);
addNew->setText(tr("Add new"));
menuWindow->addAction(addNew);
- connect(addNew, SIGNAL(triggered()), this, SLOT(onAddNew()));
+ connect(addNew, &QAction::triggered, this, &MainWindow::onAddNew);
setMenuBar(menuBar);
onAddNew();
diff --git a/examples/opengl/hellogl2/window.cpp b/examples/opengl/hellogl2/window.cpp
index e60de3b05b..11a5ae68a9 100644
--- a/examples/opengl/hellogl2/window.cpp
+++ b/examples/opengl/hellogl2/window.cpp
@@ -59,12 +59,12 @@ Window::Window(MainWindow *mw)
ySlider = createSlider();
zSlider = createSlider();
- connect(xSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setXRotation(int)));
- connect(glWidget, SIGNAL(xRotationChanged(int)), xSlider, SLOT(setValue(int)));
- connect(ySlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setYRotation(int)));
- connect(glWidget, SIGNAL(yRotationChanged(int)), ySlider, SLOT(setValue(int)));
- connect(zSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setZRotation(int)));
- connect(glWidget, SIGNAL(zRotationChanged(int)), zSlider, SLOT(setValue(int)));
+ connect(xSlider, &QSlider::valueChanged, glWidget, &GLWidget::setXRotation);
+ connect(glWidget, &GLWidget::xRotationChanged, xSlider, &QSlider::setValue);
+ connect(ySlider, &QSlider::valueChanged, glWidget, &GLWidget::setYRotation);
+ connect(glWidget, &GLWidget::yRotationChanged, ySlider, &QSlider::setValue);
+ connect(zSlider, &QSlider::valueChanged, glWidget, &GLWidget::setZRotation);
+ connect(glWidget, &GLWidget::zRotationChanged, zSlider, &QSlider::setValue);
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *container = new QHBoxLayout;
@@ -77,7 +77,7 @@ Window::Window(MainWindow *mw)
w->setLayout(container);
mainLayout->addWidget(w);
dockBtn = new QPushButton(tr("Undock"), this);
- connect(dockBtn, SIGNAL(clicked()), this, SLOT(dockUndock()));
+ connect(dockBtn, &QPushButton::clicked, this, &Window::dockUndock);
mainLayout->addWidget(dockBtn);
setLayout(mainLayout);
diff --git a/examples/opengl/hellogles3/glwindow.cpp b/examples/opengl/hellogles3/glwindow.cpp
new file mode 100644
index 0000000000..a0deb8ecfb
--- /dev/null
+++ b/examples/opengl/hellogles3/glwindow.cpp
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of 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 "glwindow.h"
+#include <QImage>
+#include <QOpenGLTexture>
+#include <QOpenGLShaderProgram>
+#include <QOpenGLBuffer>
+#include <QOpenGLContext>
+#include <QOpenGLVertexArrayObject>
+#include <QOpenGLExtraFunctions>
+#include <QPropertyAnimation>
+#include <QPauseAnimation>
+#include <QSequentialAnimationGroup>
+#include <QTimer>
+
+GLWindow::GLWindow()
+ : m_texture(0),
+ m_program(0),
+ m_vbo(0),
+ m_vao(0),
+ m_target(0, 0, -1),
+ m_uniformsDirty(true),
+ m_r(0),
+ m_r2(0)
+{
+ m_world.setToIdentity();
+ m_world.translate(0, 0, -1);
+ m_world.rotate(180, 1, 0, 0);
+
+ QSequentialAnimationGroup *animGroup = new QSequentialAnimationGroup(this);
+ animGroup->setLoopCount(-1);
+ QPropertyAnimation *zAnim0 = new QPropertyAnimation(this, QByteArrayLiteral("z"));
+ zAnim0->setStartValue(1.5f);
+ zAnim0->setEndValue(10.0f);
+ zAnim0->setDuration(2000);
+ animGroup->addAnimation(zAnim0);
+ QPropertyAnimation *zAnim1 = new QPropertyAnimation(this, QByteArrayLiteral("z"));
+ zAnim1->setStartValue(10.0f);
+ zAnim1->setEndValue(50.0f);
+ zAnim1->setDuration(4000);
+ zAnim1->setEasingCurve(QEasingCurve::OutElastic);
+ animGroup->addAnimation(zAnim1);
+ QPropertyAnimation *zAnim2 = new QPropertyAnimation(this, QByteArrayLiteral("z"));
+ zAnim2->setStartValue(50.0f);
+ zAnim2->setEndValue(1.5f);
+ zAnim2->setDuration(2000);
+ animGroup->addAnimation(zAnim2);
+ animGroup->start();
+
+ QPropertyAnimation* rAnim = new QPropertyAnimation(this, QByteArrayLiteral("r"));
+ rAnim->setStartValue(0.0f);
+ rAnim->setEndValue(360.0f);
+ rAnim->setDuration(2000);
+ rAnim->setLoopCount(-1);
+ rAnim->start();
+
+ QTimer::singleShot(4000, this, &GLWindow::startSecondStage);
+}
+
+GLWindow::~GLWindow()
+{
+ makeCurrent();
+ delete m_texture;
+ delete m_program;
+ delete m_vbo;
+ delete m_vao;
+}
+
+void GLWindow::startSecondStage()
+{
+ QPropertyAnimation* r2Anim = new QPropertyAnimation(this, QByteArrayLiteral("r2"));
+ r2Anim->setStartValue(0.0f);
+ r2Anim->setEndValue(360.0f);
+ r2Anim->setDuration(20000);
+ r2Anim->setLoopCount(-1);
+ r2Anim->start();
+}
+
+void GLWindow::setZ(float v)
+{
+ m_eye.setZ(v);
+ m_uniformsDirty = true;
+ update();
+}
+
+void GLWindow::setR(float v)
+{
+ m_r = v;
+ m_uniformsDirty = true;
+ update();
+}
+
+void GLWindow::setR2(float v)
+{
+ m_r2 = v;
+ m_uniformsDirty = true;
+ update();
+}
+
+static const char *vertexShaderSource =
+ "layout(location = 0) in vec4 vertex;\n"
+ "layout(location = 1) in vec3 normal;\n"
+ "out vec3 vert;\n"
+ "out vec3 vertNormal;\n"
+ "out vec3 color;\n"
+ "uniform mat4 projMatrix;\n"
+ "uniform mat4 camMatrix;\n"
+ "uniform mat4 worldMatrix;\n"
+ "uniform mat4 myMatrix;\n"
+ "uniform sampler2D sampler;\n"
+ "void main() {\n"
+ " ivec2 pos = ivec2(gl_InstanceID % 32, gl_InstanceID / 32);\n"
+ " vec2 t = vec2(float(-16 + pos.x) * 0.8, float(-18 + pos.y) * 0.6);\n"
+ " float val = 2.0 * length(texelFetch(sampler, pos, 0).rgb);\n"
+ " mat4 wm = myMatrix * mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t.x, t.y, val, 1) * worldMatrix;\n"
+ " color = texelFetch(sampler, pos, 0).rgb * vec3(0.4, 1.0, 0.0);\n"
+ " vert = vec3(wm * vertex);\n"
+ " vertNormal = mat3(transpose(inverse(wm))) * normal;\n"
+ " gl_Position = projMatrix * camMatrix * wm * vertex;\n"
+ "}\n";
+
+static const char *fragmentShaderSource =
+ "in highp vec3 vert;\n"
+ "in highp vec3 vertNormal;\n"
+ "in highp vec3 color;\n"
+ "out highp vec4 fragColor;\n"
+ "uniform highp vec3 lightPos;\n"
+ "void main() {\n"
+ " highp vec3 L = normalize(lightPos - vert);\n"
+ " highp float NL = max(dot(normalize(vertNormal), L), 0.0);\n"
+ " highp vec3 col = clamp(color * 0.2 + color * 0.8 * NL, 0.0, 1.0);\n"
+ " fragColor = vec4(col, 1.0);\n"
+ "}\n";
+
+QByteArray versionedShaderCode(const char *src)
+{
+ QByteArray versionedSrc;
+
+ if (QOpenGLContext::currentContext()->isOpenGLES())
+ versionedSrc.append(QByteArrayLiteral("#version 300 es\n"));
+ else
+ versionedSrc.append(QByteArrayLiteral("#version 330\n"));
+
+ versionedSrc.append(src);
+ return versionedSrc;
+}
+
+void GLWindow::initializeGL()
+{
+ QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
+
+ if (m_texture) {
+ delete m_texture;
+ m_texture = 0;
+ }
+ QImage img(":/qtlogo.png");
+ Q_ASSERT(!img.isNull());
+ m_texture = new QOpenGLTexture(img.scaled(32, 36).mirrored());
+
+ if (m_program) {
+ delete m_program;
+ m_program = 0;
+ }
+ m_program = new QOpenGLShaderProgram;
+ // Prepend the correct version directive to the sources. The rest is the
+ // same, thanks to the common GLSL syntax.
+ m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, versionedShaderCode(vertexShaderSource));
+ m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, versionedShaderCode(fragmentShaderSource));
+ m_program->link();
+
+ m_projMatrixLoc = m_program->uniformLocation("projMatrix");
+ m_camMatrixLoc = m_program->uniformLocation("camMatrix");
+ m_worldMatrixLoc = m_program->uniformLocation("worldMatrix");
+ m_myMatrixLoc = m_program->uniformLocation("myMatrix");
+ m_lightPosLoc = m_program->uniformLocation("lightPos");
+
+ // Create a VAO. Not strictly required for ES 3, but it is for plain OpenGL.
+ if (m_vao) {
+ delete m_vao;
+ m_vao = 0;
+ }
+ m_vao = new QOpenGLVertexArrayObject;
+ if (m_vao->create())
+ m_vao->bind();
+
+ if (m_vbo) {
+ delete m_vbo;
+ m_vbo = 0;
+ }
+ m_program->bind();
+ m_vbo = new QOpenGLBuffer;
+ m_vbo->create();
+ m_vbo->bind();
+ m_vbo->allocate(m_logo.constData(), m_logo.count() * sizeof(GLfloat));
+ f->glEnableVertexAttribArray(0);
+ f->glEnableVertexAttribArray(1);
+ f->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), 0);
+ f->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), reinterpret_cast<void *>(3 * sizeof(GLfloat)));
+ m_vbo->release();
+
+ f->glEnable(GL_DEPTH_TEST);
+ f->glEnable(GL_CULL_FACE);
+}
+
+void GLWindow::resizeGL(int w, int h)
+{
+ m_proj.setToIdentity();
+ m_proj.perspective(45.0f, GLfloat(w) / h, 0.01f, 100.0f);
+ m_uniformsDirty = true;
+}
+
+void GLWindow::paintGL()
+{
+ // Now use QOpenGLExtraFunctions instead of QOpenGLFunctions as we want to
+ // do more than what GL(ES) 2.0 offers.
+ QOpenGLExtraFunctions *f = QOpenGLContext::currentContext()->extraFunctions();
+
+ f->glClearColor(0, 0, 0, 1);
+ f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ m_program->bind();
+ m_texture->bind();
+
+ if (m_uniformsDirty) {
+ m_uniformsDirty = false;
+ QMatrix4x4 camera;
+ camera.lookAt(m_eye, m_eye + m_target, QVector3D(0, 1, 0));
+ m_program->setUniformValue(m_projMatrixLoc, m_proj);
+ m_program->setUniformValue(m_camMatrixLoc, camera);
+ QMatrix4x4 wm = m_world;
+ wm.rotate(m_r, 1, 1, 0);
+ m_program->setUniformValue(m_worldMatrixLoc, wm);
+ QMatrix4x4 mm;
+ mm.setToIdentity();
+ mm.rotate(-m_r2, 1, 0, 0);
+ m_program->setUniformValue(m_myMatrixLoc, mm);
+ m_program->setUniformValue(m_lightPosLoc, QVector3D(0, 0, 70));
+ }
+
+ // Now call a function introduced in OpenGL 3.1 / OpenGL ES 3.0. We
+ // requested a 3.3 or ES 3.0 context, so we know this will work.
+ f->glDrawArraysInstanced(GL_TRIANGLES, 0, m_logo.vertexCount(), 32 * 36);
+}
diff --git a/examples/opengl/hellogles3/glwindow.h b/examples/opengl/hellogles3/glwindow.h
new file mode 100644
index 0000000000..8b7758d1b0
--- /dev/null
+++ b/examples/opengl/hellogles3/glwindow.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GLWIDGET_H
+#define GLWIDGET_H
+
+#include <QOpenGLWindow>
+#include <QMatrix4x4>
+#include <QVector3D>
+#include "../hellogl2/logo.h"
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLTexture;
+class QOpenGLShaderProgram;
+class QOpenGLBuffer;
+class QOpenGLVertexArrayObject;
+
+QT_END_NAMESPACE
+
+class GLWindow : public QOpenGLWindow
+{
+ Q_OBJECT
+ Q_PROPERTY(float z READ z WRITE setZ)
+ Q_PROPERTY(float r READ r WRITE setR)
+ Q_PROPERTY(float r2 READ r2 WRITE setR2)
+
+public:
+ GLWindow();
+ ~GLWindow();
+
+ void initializeGL();
+ void resizeGL(int w, int h);
+ void paintGL();
+
+ float z() const { return m_eye.z(); }
+ void setZ(float v);
+
+ float r() const { return m_r; }
+ void setR(float v);
+ float r2() const { return m_r2; }
+ void setR2(float v);
+private slots:
+ void startSecondStage();
+private:
+ QOpenGLTexture *m_texture;
+ QOpenGLShaderProgram *m_program;
+ QOpenGLBuffer *m_vbo;
+ QOpenGLVertexArrayObject *m_vao;
+ Logo m_logo;
+ int m_projMatrixLoc;
+ int m_camMatrixLoc;
+ int m_worldMatrixLoc;
+ int m_myMatrixLoc;
+ int m_lightPosLoc;
+ QMatrix4x4 m_proj;
+ QMatrix4x4 m_world;
+ QVector3D m_eye;
+ QVector3D m_target;
+ bool m_uniformsDirty;
+ float m_r;
+ float m_r2;
+};
+
+#endif
diff --git a/examples/opengl/hellogles3/hellogles3.pro b/examples/opengl/hellogles3/hellogles3.pro
new file mode 100644
index 0000000000..e0d4c25ca6
--- /dev/null
+++ b/examples/opengl/hellogles3/hellogles3.pro
@@ -0,0 +1,11 @@
+HEADERS = $$PWD/glwindow.h \
+ $$PWD/../hellogl2/logo.h
+
+SOURCES = $$PWD/glwindow.cpp \
+ $$PWD/main.cpp \
+ $$PWD/../hellogl2/logo.cpp
+
+RESOURCES += hellogles3.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogles3
+INSTALLS += target
diff --git a/examples/opengl/hellogles3/hellogles3.qrc b/examples/opengl/hellogles3/hellogles3.qrc
new file mode 100644
index 0000000000..f3a0978084
--- /dev/null
+++ b/examples/opengl/hellogles3/hellogles3.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource>
+ <file>qtlogo.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/opengl/hellogles3/main.cpp b/examples/opengl/hellogles3/main.cpp
new file mode 100644
index 0000000000..f0de28bdc4
--- /dev/null
+++ b/examples/opengl/hellogles3/main.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QSurfaceFormat>
+#include <QOpenGLContext>
+
+#include "glwindow.h"
+
+// This example demonstrates easy, cross-platform usage of OpenGL ES 3.0 functions via
+// QOpenGLExtraFunctions in an application that works identically on desktop platforms
+// with OpenGL 3.3 and mobile/embedded devices with OpenGL ES 3.0.
+
+// The code is always the same, with the exception of two places: (1) the OpenGL context
+// creation has to have a sufficiently high version number for the features that are in
+// use, and (2) the shader code's version directive is different.
+
+int main(int argc, char *argv[])
+{
+ QSurfaceFormat fmt;
+ fmt.setDepthBufferSize(24);
+
+ // Request OpenGL 3.3 compatibility or OpenGL ES 3.0.
+ if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
+ qDebug("Requesting 3.3 compatibility context");
+ fmt.setVersion(3, 3);
+ fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
+ } else {
+ qDebug("Requesting 3.0 context");
+ fmt.setVersion(3, 0);
+ }
+
+ QSurfaceFormat::setDefaultFormat(fmt);
+
+ QGuiApplication app(argc, argv);
+
+ GLWindow glWindow;
+ glWindow.showMaximized();
+
+ return app.exec();
+}
diff --git a/examples/opengl/hellogles3/qtlogo.png b/examples/opengl/hellogles3/qtlogo.png
new file mode 100644
index 0000000000..868fcea860
--- /dev/null
+++ b/examples/opengl/hellogles3/qtlogo.png
Binary files differ
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp
index 7674ffaed8..bc58e1a0e4 100644
--- a/examples/opengl/hellowindow/hellowindow.cpp
+++ b/examples/opengl/hellowindow/hellowindow.cpp
@@ -119,7 +119,7 @@ void Renderer::setAnimating(HelloWindow *window, bool animating)
if (animating) {
m_windows << window;
if (m_windows.size() == 1)
- QTimer::singleShot(0, this, SLOT(render()));
+ QTimer::singleShot(0, this, &Renderer::render);
} else {
m_currentWindow = 0;
m_windows.removeOne(window);
@@ -184,7 +184,7 @@ void Renderer::render()
m_fAngle += 1.0f;
- QTimer::singleShot(0, this, SLOT(render()));
+ QTimer::singleShot(0, this, &Renderer::render);
}
Q_GLOBAL_STATIC(QMutex, initMutex)
diff --git a/examples/opengl/hellowindow/main.cpp b/examples/opengl/hellowindow/main.cpp
index 716280aa5f..f665ee6fa8 100644
--- a/examples/opengl/hellowindow/main.cpp
+++ b/examples/opengl/hellowindow/main.cpp
@@ -121,13 +121,13 @@ int main(int argc, char *argv[])
}
for (int i = 0; i < renderThreads.size(); ++i) {
- QObject::connect(qGuiApp, SIGNAL(lastWindowClosed()), renderThreads.at(i), SLOT(quit()));
+ QObject::connect(qGuiApp, &QGuiApplication::lastWindowClosed, renderThreads.at(i), &QThread::quit);
renderThreads.at(i)->start();
}
// Quit after 10 seconds. For platforms that do not have windows that are closeable.
if (QCoreApplication::arguments().contains(QStringLiteral("--timeout")))
- QTimer::singleShot(10000, qGuiApp, SLOT(quit()));
+ QTimer::singleShot(10000, qGuiApp, &QCoreApplication::quit);
const int exitValue = app.exec();
diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro
index cf5329c55d..ed8134743b 100644
--- a/examples/opengl/opengl.pro
+++ b/examples/opengl/opengl.pro
@@ -13,5 +13,6 @@ qtHaveModule(widgets) {
!wince: SUBDIRS += \
qopenglwidget \
cube \
- textures
+ textures \
+ hellogles3
}
diff --git a/examples/opengl/paintedwindow/paintedwindow.cpp b/examples/opengl/paintedwindow/paintedwindow.cpp
index c67edb6f65..6b015bd2c3 100644
--- a/examples/opengl/paintedwindow/paintedwindow.cpp
+++ b/examples/opengl/paintedwindow/paintedwindow.cpp
@@ -83,9 +83,11 @@ PaintedWindow::PaintedWindow()
m_targetOrientation = contentOrientation();
m_nextTargetOrientation = Qt::PrimaryOrientation;
- connect(screen(), SIGNAL(orientationChanged(Qt::ScreenOrientation)), this, SLOT(orientationChanged(Qt::ScreenOrientation)));
- connect(m_animation, SIGNAL(finished()), this, SLOT(rotationDone()));
- connect(this, SIGNAL(rotationChanged(qreal)), this, SLOT(paint()));
+ connect(screen(), &QScreen::orientationChanged, this, &PaintedWindow::orientationChanged);
+ connect(m_animation, &QAbstractAnimation::finished, this, &PaintedWindow::rotationDone);
+ typedef void (PaintedWindow::*PaintedWindowVoidSlot)();
+ connect(this, &PaintedWindow::rotationChanged,
+ this, static_cast<PaintedWindowVoidSlot>(&PaintedWindow::paint));
}
void PaintedWindow::exposeEvent(QExposeEvent *)
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp
index 22111afdcb..06f35db97a 100644
--- a/examples/opengl/qopenglwidget/mainwindow.cpp
+++ b/examples/opengl/qopenglwidget/mainwindow.cpp
@@ -51,6 +51,8 @@
#include "glwidget.h"
+typedef void (QWidget::*QWidgetVoidSlot)();
+
MainWindow::MainWindow()
: m_nextX(1), m_nextY(1)
{
@@ -107,34 +109,27 @@ MainWindow::MainWindow()
groupBox->setLayout(m_layout);
+
QMenu *fileMenu = menuBar()->addMenu("&File");
+ fileMenu->addAction("E&xit", this, &QWidget::close);
QMenu *showMenu = menuBar()->addMenu("&Show");
- QMenu *helpMenu = menuBar()->addMenu("&Help");
- QAction *exit = new QAction("E&xit", fileMenu);
- QAction *aboutQt = new QAction("About Qt", helpMenu);
- QAction *showLogo = new QAction("Show 3D Logo", showMenu);
- QAction *showTexture = new QAction("Show 2D Texture", showMenu);
- QAction *showBubbles = new QAction("Show bubbles", showMenu);
+ showMenu->addAction("Show 3D Logo", glwidget, &GLWidget::setLogo);
+ showMenu->addAction("Show 2D Texture", glwidget, &GLWidget::setTexture);
+ QAction *showBubbles = showMenu->addAction("Show bubbles", glwidget, &GLWidget::setShowBubbles);
showBubbles->setCheckable(true);
showBubbles->setChecked(true);
- fileMenu->addAction(exit);
- helpMenu->addAction(aboutQt);
- showMenu->addAction(showLogo);
- showMenu->addAction(showTexture);
- showMenu->addAction(showBubbles);
-
- connect(exit, SIGNAL(triggered(bool)), this, SLOT(close()));
- connect(aboutQt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt()));
+ QMenu *helpMenu = menuBar()->addMenu("&Help");
+ helpMenu->addAction("About Qt", qApp, &QApplication::aboutQt);
- connect(m_timer, SIGNAL(timeout()), glwidget, SLOT(update()));
+ connect(m_timer, &QTimer::timeout,
+ glwidget, static_cast<QWidgetVoidSlot>(&QWidget::update));
- connect(showLogo, SIGNAL(triggered(bool)), glwidget, SLOT(setLogo()));
- connect(showTexture, SIGNAL(triggered(bool)), glwidget, SLOT(setTexture()));
- connect(showBubbles, SIGNAL(triggered(bool)), glwidget, SLOT(setShowBubbles(bool)));
- connect(slider, SIGNAL(valueChanged(int)), glwidget, SLOT(setScaling(int)));
+ connect(slider, &QAbstractSlider::valueChanged, glwidget, &GLWidget::setScaling);
connect(transparent, &QCheckBox::toggled, glwidget, &GLWidget::setTransparent);
- connect(updateInterval, SIGNAL(valueChanged(int)), this, SLOT(updateIntervalChanged(int)));
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(updateInterval, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &MainWindow::updateIntervalChanged);
connect(timerBased, &QCheckBox::toggled, this, &MainWindow::timerUsageChanged);
connect(timerBased, &QCheckBox::toggled, updateInterval, &QWidget::setEnabled);
@@ -157,7 +152,7 @@ void MainWindow::addNew()
return;
GLWidget *w = new GLWidget(this, false, qRgb(qrand() % 256, qrand() % 256, qrand() % 256));
m_glWidgets << w;
- connect(m_timer, SIGNAL(timeout()), w, SLOT(update()));
+ connect(m_timer, &QTimer::timeout, w, static_cast<QWidgetVoidSlot>(&QWidget::update));
m_layout->addWidget(w, m_nextY, m_nextX, 1, 1);
if (m_nextX == 3) {
m_nextX = 1;
diff --git a/examples/opengl/qopenglwindow/main.cpp b/examples/opengl/qopenglwindow/main.cpp
index 123bebbe2a..f444b5d7c7 100644
--- a/examples/opengl/qopenglwindow/main.cpp
+++ b/examples/opengl/qopenglwindow/main.cpp
@@ -163,16 +163,20 @@ void OpenGLWindow::keyPressEvent(QKeyEvent *e)
void OpenGLWindow::setAnimating(bool enabled)
{
+ typedef void (QPaintDeviceWindow::*QPaintDeviceWindowVoidSlot)();
+
if (enabled) {
// Animate continuously, throttled by the blocking swapBuffers() call the
// QOpenGLWindow internally executes after each paint. Once that is done
// (frameSwapped signal is emitted), we schedule a new update. This
// obviously assumes that the swap interval (see
// QSurfaceFormat::setSwapInterval()) is non-zero.
- connect(this, SIGNAL(frameSwapped()), this, SLOT(update()));
+ connect(this, &QOpenGLWindow::frameSwapped,
+ this, static_cast<QPaintDeviceWindowVoidSlot>(&QPaintDeviceWindow::update));
update();
} else {
- disconnect(this, SIGNAL(frameSwapped()), this, SLOT(update()));
+ disconnect(this, &QOpenGLWindow::frameSwapped,
+ this, static_cast<QPaintDeviceWindowVoidSlot>(&QPaintDeviceWindow::update));
}
}
diff --git a/examples/opengl/textures/window.cpp b/examples/opengl/textures/window.cpp
index e9ad8e2cc6..fddb9f9945 100644
--- a/examples/opengl/textures/window.cpp
+++ b/examples/opengl/textures/window.cpp
@@ -59,8 +59,8 @@ Window::Window()
glWidgets[i][j]->rotateBy(+42 * 16, +42 * 16, -21 * 16);
mainLayout->addWidget(glWidgets[i][j], i, j);
- connect(glWidgets[i][j], SIGNAL(clicked()),
- this, SLOT(setCurrentGlWidget()));
+ connect(glWidgets[i][j], &GLWidget::clicked,
+ this, &Window::setCurrentGlWidget);
}
}
setLayout(mainLayout);
@@ -68,7 +68,7 @@ Window::Window()
currentGlWidget = glWidgets[0][0];
QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(rotateOneStep()));
+ connect(timer, &QTimer::timeout, this, &Window::rotateOneStep);
timer->start(20);
setWindowTitle(tr("Textures"));
diff --git a/examples/qtconcurrent/map/main.cpp b/examples/qtconcurrent/map/main.cpp
index 75b1da4e6f..eaa7c911cb 100644
--- a/examples/qtconcurrent/map/main.cpp
+++ b/examples/qtconcurrent/map/main.cpp
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
// Use QtConcurrentBlocking::mapped to apply the scale function to all the
// images in the list.
- QList<QImage> thumbnails = QtConcurrent::blockingMapped<QList<QImage> >(images, scale);
+ QList<QImage> thumbnails = QtConcurrent::blockingMapped(images, scale);
return 0;
}
diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp
index f45f2820c7..7f6d0f43ba 100644
--- a/examples/qtconcurrent/wordcount/main.cpp
+++ b/examples/qtconcurrent/wordcount/main.cpp
@@ -61,10 +61,10 @@ QStringList findFiles(const QString &startDir, QStringList filters)
QDir dir(startDir);
foreach (QString file, dir.entryList(filters, QDir::Files))
- names += startDir + "/" + file;
+ names += startDir + '/' + file;
foreach (QString subdir, dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot))
- names += findFiles(startDir + "/" + subdir, filters);
+ names += findFiles(startDir + '/' + subdir, filters);
return names;
}
@@ -81,7 +81,7 @@ WordCount singleThreadedWordCount(QStringList files)
f.open(QIODevice::ReadOnly);
QTextStream textStream(&f);
while (textStream.atEnd() == false)
- foreach(QString word, textStream.readLine().split(" "))
+ foreach (const QString &word, textStream.readLine().split(' '))
wordCount[word] += 1;
}
@@ -100,7 +100,7 @@ WordCount countWords(const QString &file)
WordCount wordCount;
while (textStream.atEnd() == false)
- foreach (QString word, textStream.readLine().split(" "))
+ foreach (const QString &word, textStream.readLine().split(' '))
wordCount[word] += 1;
return wordCount;
diff --git a/examples/sql/books/bookdelegate.cpp b/examples/sql/books/bookdelegate.cpp
index ff965eda44..afc4edf434 100644
--- a/examples/sql/books/bookdelegate.cpp
+++ b/examples/sql/books/bookdelegate.cpp
@@ -44,7 +44,7 @@ void BookDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
if (index.column() != 5) {
- QStyleOptionViewItemV3 opt = option;
+ QStyleOptionViewItem opt = option;
opt.rect.adjust(0, 0, -1, -1); // since we draw the grid ourselves
QSqlRelationalDelegate::paint(painter, opt, index);
} else {
diff --git a/examples/sql/books/books.pro b/examples/sql/books/books.pro
index 94f8104414..c64766c29f 100644
--- a/examples/sql/books/books.pro
+++ b/examples/sql/books/books.pro
@@ -16,5 +16,5 @@ wince {
CONFIG(debug, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll
CONFIG(release, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll
sqlPlugins.path = sqldrivers
- DEPLOYMENT += sqlPlugins
+ INSTALLS += sqlPlugins
}
diff --git a/examples/sql/masterdetail/dialog.cpp b/examples/sql/masterdetail/dialog.cpp
index 5518707f58..3171acc448 100644
--- a/examples/sql/masterdetail/dialog.cpp
+++ b/examples/sql/masterdetail/dialog.cpp
@@ -153,7 +153,7 @@ void Dialog::addTracks(int albumId, QStringList tracks)
for (int i = 0; i < tracks.count(); i++) {
QString trackNumber = QString::number(i);
if (i < 10)
- trackNumber.prepend("0");
+ trackNumber.prepend('0');
QDomText textNode = albumDetails.createTextNode(tracks.at(i));
diff --git a/examples/sql/querymodel/customsqlmodel.cpp b/examples/sql/querymodel/customsqlmodel.cpp
index 5966802abe..4cdfdd6ae3 100644
--- a/examples/sql/querymodel/customsqlmodel.cpp
+++ b/examples/sql/querymodel/customsqlmodel.cpp
@@ -53,7 +53,7 @@ QVariant CustomSqlModel::data(const QModelIndex &index, int role) const
QVariant value = QSqlQueryModel::data(index, role);
if (value.isValid() && role == Qt::DisplayRole) {
if (index.column() == 0)
- return value.toString().prepend("#");
+ return value.toString().prepend('#');
else if (index.column() == 2)
return value.toString().toUpper();
}
diff --git a/examples/webkit/webkit-guide/_copyright.txt b/examples/webkit/webkit-guide/_copyright.txt
deleted file mode 100644
index 32e0d2f918..0000000000
--- a/examples/webkit/webkit-guide/_copyright.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
-
-This file is part of QtWebKit
-
-Copyright (c) 2015 The Qt Company Ltd.
-Contact: http://www.qt.io/licensing/
-
-
-You may use this file under the terms of the BSD license as follows:
-
-"Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-o Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-o Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-o Neither the name of 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."
-
--->
-
-\1
diff --git a/examples/webkit/webkit-guide/_image_assets.htm b/examples/webkit/webkit-guide/_image_assets.htm
deleted file mode 100644
index e3699f22bb..0000000000
--- a/examples/webkit/webkit-guide/_image_assets.htm
+++ /dev/null
@@ -1,332 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<title>image assets</title>
-
-<style>
-img { max-height: 72px; }
-</style>
-
-</head>
-<body>
-<h1>image assets</h1>
-
-Notes:
-
-<ul>
-
-<li>Some of these may be redundant; feel free to merge
-
-<li>Feel free to rename files, but give me before & after list of filenames so I can reflect the change
-
-<li>use neutral grayscale if possible
-
-<li>use PNG file format if possible
-
-<li>I plan to cut new set of generic icons
-(e.g., <a href="anim_skew.htm">HERE</a> to be white text on darkish
-gray, probably #777777)
-
-<li>No more need for online/offline indicators (red/green circles) for
-this draft.
-
-</ul>
-
-<table border="1" width="100%">
-
-<tr>
-<th>FILENAME</th>
-<th>IMAGE (thumbnail & link)</th>
-<th>USED ON PAGE</th>
-<th>DESCRIPTION</th>
-</tr>
-
-<tr>
-<td>icon_dismiss.png,<br/>icon_dismiss_x22.png</td>
-<td>
-<a target="elsewhere" href="img/icon_dismiss.png"><img src="img/icon_dismiss.png"/></a>
-<a target="elsewhere" href="img/icon_dismiss_x22.png"><img src="img/icon_dismiss_x22.png"/></a>
-</td>
-<td>
-<a target="elsewhere" href="anim_skew.htm">HERE</a>
-<a target="elsewhere" href="storage.htm">HERE</a>
-<a target="elsewhere" href="css3_text-overflow.htm">HERE</a>
-<a target="elsewhere" href="layout_tbl-keyhole.htm">HERE</a>
-</td>
-<td>Dismiss panel or listed item</td>
-</tr>
-
-<tr>
-<td>icon_expand-nav.png</td>
-<td><a target="elsewhere" href="img/icon_expand-nav.png"><img src="img/icon_expand-nav.png"/></a></td>
-<td><a target="elsewhere" href="anim_accord.htm">HERE</a></td>
-<td>expand complex set of navigation options</td>
-</tr>
-
-<tr>
-<td>icon_nav-up.png</td>
-<td><a target="elsewhere" href="img/icon_nav-up.png"><img src="img/icon_nav-up.png"/></a></td>
-<td><a target="elsewhere" href="layout_tbl-keyhole.htm">HERE</a></td>
-<td>navigate within listings (up arrow also serves as down arrow using rotate transform)</td>
-</tr>
-
-<tr>
-<td>icon_drill-up.png,<br/>icon_drill-up_x32.png</td>
-<td>
-<a target="elsewhere" href="img/icon_drill-up.png"><img src="img/icon_drill-up.png"/></a>
-<a target="elsewhere" href="img/icon_drill-up_x32.png"><img src="img/icon_drill-up_x32.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_slide1.htm">HERE</a></td>
-<td>navigate up one level within sliding drilldown UI</td>
-</tr>
-
-<tr>
-<td>icon_drill-down.png,<br/>icon_drill-down_x32.png</td>
-<td>
-<a target="elsewhere" href="img/icon_drill-down.png"><img src="img/icon_drill-down.png"/></a>
-<a target="elsewhere" href="img/icon_drill-down_x32.png"><img src="img/icon_drill-down_x32.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_slide1.htm">HERE</a></td>
-<td>navigate down one level within sliding drilldown UI</td>
-</tr>
-
-<tr>
-<td>icon_scroll-left.png</td>
-<td><a target="elsewhere" href="img/icon_scroll-left.png"><img src="img/icon_scroll-left.png"/></a></td>
-<td><a target="elsewhere" href="css3_scroll.htm">HERE</a></td>
-<td>custom horizontal scroll button</td>
-</tr>
-
-<tr>
-<td>icon_scroll-right.png</td>
-<td><a target="elsewhere" href="img/icon_scroll-right.png"><img src="img/icon_scroll-right.png"/></a></td>
-<td><a target="elsewhere" href="css3_scroll.htm">HERE</a></td>
-<td>custom horizontal scroll button</td>
-</tr>
-
-<tr>
-<td>icon_head-expanded.png,<br/>icon_head-expanded_x13.png</td>
-<td>
-<a target="elsewhere" href="img/icon_head-expanded.png"><img src="img/icon_head-expanded.png"/></a>
-<a target="elsewhere" href="img/icon_head-expanded_x13.png"><img src="img/icon_head-expanded_x13.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_accord.htm">HERE</a>
-<a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
-<td>marks accordion heading expanded state</td>
-</tr>
-
-<tr>
-<td>icon_head-collapsed.png,<br/>icon_head-collapsed_x13.png</td>
-<td>
-<a target="elsewhere" href="img/icon_head-collapsed.png"><img src="img/icon_head-collapsed.png"/></a>
-<a target="elsewhere" href="img/icon_head-collapsed_x13.png"><img src="img/icon_head-collapsed_x13.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_accord.htm">HERE</a>
-<a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
-<td>marks accordion heading collapsed state</td>
-</tr>
-
-<tr>
-<td>icon_info.png,<br/>icon_info_x24.png</td>
-<td>
-<a target="elsewhere" href="img/icon_info.png"><img src="img/icon_info.png"/></a>
-<a target="elsewhere" href="img/icon_info_x24.png"><img src="img/icon_info_x24.png"/></a>
-</td>
-<td><a target="elsewhere" href="storage.htm">HERE</a></td>
-<td>link to panel specifying user preferences</td>
-</tr>
-
-<tr>
-<td>icon_list-all.png,<br/>icon_list-all_circ.png</td>
-<td>
-<a target="elsewhere" href="img/icon_list-all.png"><img src="img/icon_list-all.png"/></a>
-<a target="elsewhere" href="img/icon_list-all_circ.png"><img src="img/icon_list-all_circ.png"/></a>
-</td>
-<td><a target="elsewhere" href="anim_skew.htm">HERE</a></td>
-<td>within UI listing items users can filter by category, this indicates LIST ALL ITEMS</td>
-</tr>
-
-<tr>
-<td>gradient.jpg</td>
-<td><a target="elsewhere" href="img/gradient.jpg"><img src="img/gradient.jpg"/></a></td>
-<td><a target="elsewhere" href="css3_backgrounds.htm">HERE</a></td>
-<td>serves as background for expanded accordion heads (demonstrates CSS's >1 background image feature)</td>
-</tr>
-
-<tr>
-<td>border-frame.png</td>
-<td><a target="elsewhere" href="img/border-frame.png"><img src="img/border-frame.png"/></a></td>
-<td><a target="elsewhere" href="css3_border-img.htm">HERE</a></td>
-<td>border around chunk of text (got this from Wei Lu's sample; simply demo's this feature)</td>
-</tr>
-
-<tr>
-<td>mask.png</td>
-<td><a target="elsewhere" href="img/mask.png"><img src="img/mask.png"/></a></td>
-<td><a target="elsewhere" href="css3_mask-img.htm">HERE</a></td>
-<td>Used as a gradient to mask an image; think I got this one from <a href="http://webkit.org/blog/181/css-masks/">webkit.org</a></td>
-</tr>
-
-<tr>
-<td>icon_check.png,<br/>icon_check_x24green.png</td>
-<td>
-<a target="elsewhere" href="img/icon_check.png"><img src="img/icon_check.png"/></a>
-<a target="elsewhere" href="img/icon_check_x24green.png"><img src="img/icon_check_x24green.png"/></a>
-</td>
-<td><a target="elsewhere" href="form_tapper.htm">HERE</a></td>
-<td>This is not available as a separate file; it's specified within
-CSS using the "data:" URL scheme. It indicates radio/checkbox
-selection state within tappable UI; keep green if possible to match
-border</td>
-</tr>
-
-<tr>
-<th colspan="4">FILE FORMATS</th>
-<tr>
-
-<tr>
-<td>icon_link-sms.png</td>
-<td><a target="elsewhere" href="img/icon_link-sms.png"><img src="img/icon_link-sms.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>provides visual hint marking context of hyperlink, in this case a link to initiate an instant message</td>
-</tr>
-
-<tr>
-<td>icon_link-tel.png</td>
-<td><a target="elsewhere" href="img/icon_link-tel.png"><img src="img/icon_link-tel.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to make phone call</td>
-</tr>
-
-<tr>
-<td>icon_link-xls.png</td>
-<td><a target="elsewhere" href="img/icon_link-xls.png"><img src="img/icon_link-xls.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to excel file</td>
-</tr>
-
-<tr>
-<td>icon_link-doc.png</td>
-<td><a target="elsewhere" href="img/icon_link-doc.png"><img src="img/icon_link-doc.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to MS Word file</td>
-</tr>
-
-<tr>
-<td>icon_link-email.png</td>
-<td><a target="elsewhere" href="img/icon_link-email.png"><img src="img/icon_link-email.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...email link</td>
-</tr>
-
-<tr>
-<td>icon_link-external.png</td>
-<td><a target="elsewhere" href="img/icon_link-external.png"><img src="img/icon_link-external.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to web page external to current site</td>
-</tr>
-
-<tr>
-<td>icon_link-pdf.png</td>
-<td><a target="elsewhere" href="img/icon_link-pdf.png"><img src="img/icon_link-pdf.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...loink to PDF file</td>
-</tr>
-
-<tr>
-<td>icon_link-ppt.png</td>
-<td><a target="elsewhere" href="img/icon_link-ppt.png"><img src="img/icon_link-ppt.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to PowerPoint file</td>
-</tr>
-
-<tr>
-<td>icon_link-rss.png</td>
-<td><a target="elsewhere" href="img/icon_link-rss.png"><img src="img/icon_link-rss.png"/></a></td>
-<td><a target="elsewhere" href="layout_link-fmt.htm">HERE</a></td>
-<td>...link to RSS feed</td>
-</tr>
-
-<tr>
-<th colspan="4">UNUSED</th>
-<tr>
-
-<tr>
-<td>icon_nav-top.png</td>
-<td><a target="elsewhere" href="img/icon_nav-top.png"><img src="img/icon_nav-top.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_nav-start.png</td>
-<td><a target="elsewhere" href="img/icon_nav-start.png"><img src="img/icon_nav-start.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_nav_end.png</td>
-<td><a target="elsewhere" href="img/icon_nav_end.png"><img src="img/icon_nav_end.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_question.png</td>
-<td><a target="elsewhere" href="img/icon_question.png"><img src="img/icon_question.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>icon_trash.png</td>
-<td><a target="elsewhere" href="img/icon_trash.png"><img src="img/icon_trash.png"/></a></td>
-<td></td>
-<td></td>
-</tr>
-
-</table>
-
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/_index.html b/examples/webkit/webkit-guide/_index.html
deleted file mode 100644
index d683c0508e..0000000000
--- a/examples/webkit/webkit-guide/_index.html
+++ /dev/null
@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<!-- examples.qdoc -->
- <title>CSS: SAMPLE PAGES</title>
- <link rel="stylesheet" type="text/css" href="style/style.css" />
- <script src="scripts/jquery.js" type="text/javascript"></script>
- <script src="scripts/functions.js" type="text/javascript"></script>
- <script src="./scripts/superfish.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <script src="./scripts/narrow.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="style/narrow.css" />
-</head>
-<body class="" onload="CheckEmptyAndLoadList();">
-
- <style>
-div.header, div.toolbar, div.feedback, div#feedbackBox, div.footer, div.sidebar { display: none; background: pink }
-div.toc {
- background: #dddddd;
- border: thin solid #777777;
- padding: 1em;
- border-radius: 1em;
- margin: 1em
-}
-div.toc li:before { color: lightcoral; text-transform: uppercase; }
-h3 { border-top: thick pink solid }
-h4 { border-top: medium gold solid }
-h5 { border-top: medium lightgreen solid }
-h3,h4,h5 { padding-top: 1em }
-li.level1 { margin-left: 0 }
-li.level2 { margin-left: 2em }
-li.level3 { margin-left: 4em }
-li.level4 { margin-left: 6em }
-li.level5 { margin-left: 8em }
-table { border: solid #777777 thin }
-tr:nth-of-type(even) { background: beige }
-tr:nth-of-type(odd) { background: lightblue }
-th {
- background: #777777;
- color: #ffffff;
-}
-
-img[src^='images/cnd_'] { float: right; margin: 1em ; padding: 1em; border-radius: 1em; border: thin #777777 solid; }
-tt, pre { background: #dddddd; border: thin #dddddd solid; }
-a[href^='http://waplabdc.nokia-boston.com'] { color: black; }
-a[href^='http://waplabdc.nokia-boston.com']:before { content: url(http://waplabdc.nokia-boston.com/browser/users/sierra/x/img/html.jpg); }
- </style>
- <div class="header" id="qtdocheader">
- <div class="content">
- <div id="nav-logo">
- <a href="index.html">Home</a></div>
- <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
- <div id="narrowsearch"></div>
- <div id="nav-topright">
- <ul>
- <li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
- <li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
- <li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
- <li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
- DOC</a></li>
- <li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
- </ul>
- </div>
- <div id="shortCut">
- <ul>
- <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li>
- <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS </a></li>
- </ul>
- </div>
- <ul class="sf-menu" id="narrowmenu">
- <li><a href="#">API Lookup</a>
- <ul>
- <li><a href="classes.html">Class index</a></li>
- <li><a href="functions.html">Function index</a></li>
- <li><a href="modules.html">Modules</a></li>
- <li><a href="namespaces.html">Namespaces</a></li>
- <li><a href="qtglobal.html">Global Declarations</a></li>
- <li><a href="qdeclarativeelements.html">QML elements</a></li>
- </ul>
- </li>
- <li><a href="#">Qt Topics</a>
- <ul>
- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
- <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
- <li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
- <li><a href="platform-specific.html">Platform-specific info</a></li>
- <li><a href="technology-apis.html">Qt and Key Technologies</a></li>
- <li><a href="best-practices.html">How-To's and Best Practices</a></li>
- </ul>
- </li>
- <li><a href="#">Examples</a>
- <ul>
- <li><a href="all-examples.html">Examples</a></li>
- <li><a href="tutorials.html">Tutorials</a></li>
- <li><a href="qdeclarativeexamples.html">QML Examples</a></li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- <div class="wrapper">
- <div class="hd">
- <span></span>
- </div>
- <div class="bd group">
- <div class="sidebar">
- <div class="searchlabel">
- Search index:</div>
- <div class="search" id="sidebarsearch">
- <form id="qtdocsearch" action="" onsubmit="return false;">
- <fieldset>
- <input type="text" name="searchstring" id="pageType" value="" />
- <div id="resultdialog">
- <a href="#" id="resultclose">Close</a>
- <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
- <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p>
- <ul id="resultlist" class="all">
- </ul>
- </div>
- </fieldset>
- </form>
- </div>
- <div class="box first bottombar" id="lookup">
- <h2 title="API Lookup"><span></span>
- API Lookup</h2>
- <div id="list001" class="list">
- <ul id="ul001" >
- <li class="defaultLink"><a href="classes.html">Class index</a></li>
- <li class="defaultLink"><a href="functions.html">Function index</a></li>
- <li class="defaultLink"><a href="modules.html">Modules</a></li>
- <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
- <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
- <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
- </ul>
- </div>
- </div>
- <div class="box bottombar" id="topics">
- <h2 title="Qt Topics"><span></span>
- Qt Topics</h2>
- <div id="list002" class="list">
- <ul id="ul002" >
- <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>
- <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
- <li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
- <li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li>
- <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
- <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
- </ul>
- </div>
- </div>
- <div class="box" id="examples">
- <h2 title="Examples"><span></span>
- Examples</h2>
- <div id="list003" class="list">
- <ul id="ul003">
- <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
- <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
- <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="wrap">
- <div class="toolbar">
- <div class="breadcrumb toolblock">
- <ul>
- <li class="first"><a href="index.html">Home</a></li>
- <!-- Bread crumbs goes here -->
- <li>CSS: SAMPLE PAGES</li> </ul>
- </div>
- <div class="toolbuttons toolblock">
- <ul>
- <li id="smallA" class="t_button">A</li>
- <li id="medA" class="t_button active">A</li>
- <li id="bigA" class="t_button">A</li>
- <li id="print" class="t_button"><a href="javascript:this.print();">
- <span>Print</span></a></li>
- </ul>
- </div>
- </div>
- <div class="content mainContent">
-<div class="toc">
-<h3><a name="toc">Contents</a></h3>
-<ul>
-<li class="level1"><a href="#css-sample-pages">CSS: SAMPLE PAGES</a></li>
-<li class="level2"><a href="#media-queries">Media Queries</a></li>
-<li class="level2"><a href="#selectors">Selectors</a></li>
-<li class="level2"><a href="#visual-effects">Visual Effects</a></li>
-<li class="level2"><a href="#dynamic-css">Dynamic CSS</a></li>
-<li class="level1"><a href="#storage">Storage</a></li>
-</ul>
-</div>
-<h1 class="title">CSS: SAMPLE PAGES</h1>
-<span class="subtitle"></span>
-<!-- $$$examples-description -->
-<div class="descr"> <a name="details"></a>
-<a name="css-sample-pages"></a>
-<h2>CSS: SAMPLE PAGES</h2>
-<a name="media-queries"></a>
-<h3>1. Media Queries</h3>
-<ol type="1">
-<li><a target="test" href="mob_mediaquery.htm">MEDIA-QUERY, BASIC</a>: produces message indicating browser class (desktop/touch/low-end mobile)</li>
-<li><a target="test" href="mob_layout.htm">MEDIA-QUERY, LAYOUT</a>: same, but produces various skeletal layouts using media query criteria; large 3-column layout must appear only on desktop browser</li>
-<li><a target="test" href="mob_condjs.htm">MEDIA-QUERY, STYLEMEDIA</a>: Same as #1, but JS produces corresponding message via StyleMedia API</li>
-</ol>
-<a name="selectors"></a>
-<h3>2. Selectors</h3>
-<ol type="1">
-<li><a target="test" href="layout_link-fmt.htm">SELECTOR, ATTRIBUTE PREFIX/SUFFIX</a>: links appear w/different icons based on URL prefix/suffix; linebreaks should not appear within inline links</li>
-<li><a target="test" href="form_tapper.htm">SELECTOR, FORMS, TAP</a>: radio/checkbox inputs can be tapped (only 1 at a time within 'radio' set; any number within 'checkbox' set)</li>
-<li><a target="test" href="form_toggler.htm">SELECTOR, FORMS, TOGGLE</a>: radio/checkbox inputs can be toggled (only 1 at a time within 'radio' inputs; any number within 'checkbox' inputs); 2 "binary" examples at bottom use custom text</li>
-<li><a target="test" href="layout_tbl-keyhole.htm">SELECTOR, NAVIGATIONAL, TABLE</a>: pressing &quot;view listings&quot; displays stacked table rows, one at a time</li>
-<li><a target="test" href="css3_sel-nth.htm">SELECTOR, POSITIONAL</a>: displays 4x6 icon grid, implemted via nth-of-type()</li>
-</ol>
-<a name="visual-effects"></a>
-<h3>3. Visual Effects</h3>
-<ol type="1">
-<li><a target="test" href="css3_backgrounds.htm">CSS, BACKGROUNDS</a>: selected accordion tabs display both gradient background and icon; unselected only displays icon; uses scaleY transition</li>
-<li><a target="test" href="css3_border-img.htm">CSS, BORDER IMAGE</a>: border image surrounds box</li>
-<li><a target="test" href="css3_shadow.htm">CSS, BOX-SHADOW, PLAIN</a>: nav element has shadow; icons appear smaller while pressed</li>
-<li><a target="test" href="css3_gradientBack.htm">CSS, GRADIENT, BACKGROUND</a>: background fades vertically from light to dark</li>
-<li><a target="test" href="css3_gradientBackStop.htm">CSS, GRADIENT, BACKGROUND, COLOR-STOP</a>: as you scroll down page, background fades vertically from dark to light and back to dark again</li>
-<li><a target="test" href="css3_gradientButton.htm">CSS, GRADIENT, BUTTON</a>: buttons appear with vertical shading, appearing w/inverted gradient when pressed</li>
-<li><a target="test" href="css3_grad-radial.htm">CSS, GRADIENT, RADIAL</a>: touching within box produces colorful *splat* effect for duration of touch</li>
-<li><a target="test" href="css3_mask-grad.htm">CSS, MASK, GRADIENT</a>: images appear w/gradient; touching them removes gradient</li>
-<li><a target="test" href="css3_mask-img.htm">CSS, MASK, IMAGE</a>: image fills screen but fades to black around the edges</li>
-<li><a target="test" href="css3_reflect.htm">CSS, REFLECTION</a>: heading and image both appear w/mirror reflections along bottom</li>
-<li><a target="test" href="css3_scroll.htm">CSS, SCROLLBARS</a>: code block scrollable via big buttons</li>
-<li><a target="test" href="css3_text-overflow.htm">CSS, TEXT-OVERFLOW</a>: items appear w/ellipses; touching them expands them; pressing (X) collapses them</li>
-<li><a target="test" href="css3_text-shadow.htm">CSS, TEXT-SHADOW</a>: heading text appears with shadow</li>
-<li><a target="test" href="css3_text-stroke.htm">CSS, TEXT-STROKE</a>: first heading appears w/black outline</li>
-</ol>
-<a name="dynamic-css"></a>
-<h3>4. Dynamic CSS</h3>
-<ol type="1">
-<li><a target="test" href="anim_demo-rotate.htm">ANIMATION, DEMO, ROTATE</a>: animated demo of rotating boxes</li>
-<li><a target="test" href="anim_demo-scale.htm">ANIMATION, DEMO, SCALE</a>: animated demo of shrinking/expanding box</li>
-<li><a target="test" href="anim_demo-skew.htm">ANIMATION, DEMO, SKEW</a>: animated demo of box being pushed and piulled around</li>
-<li><a target="test" href="anim_pulse.htm">ANIMATION, KEYFRAME, PULSE</a>: pressing icons causes them to pulse indefinitely</li>
-<li><a target="test" href="anim_slide1.htm">ANIMATION, KEYFRAME, SLIDING</a>: drill-down menus</li>
-<li><a target="test" href="css3_multicol.htm">ANIMATION, KEYFRAME, BANNER</a>: banner scrolls through 5 colorful items</li>
-<li><a target="test" href="anim_tabbedSkew.htm">ANIMATION, TRANSFORM, SKEWED TABS</a>: touching parts of cube displays different tabbed text</li>
-<li><a target="test" href="anim_accord.htm">ANIMATION, TRANSITION, CHAINED, ACCORDION</a>: tapping icon animates in collapsed accordions; tapping them animates in display of subheads; tapping anywhere else reverses animation sequence, collapsing back to initial icon</li>
-<li><a target="test" href="anim_panel.htm">ANIMATION, TRANSITION, MAX-WIDTH, PANEL</a>: pressing icon animates to expand panel of choices; pressing anywhere collapses panel back down to initial icon</li>
-<li><a target="test" href="anim_skew.htm">ANIMATION, TRANSITION, SKEW</a>: tapping items causes them to wipe off right edge w/skew effect; remainder re-pack vertically; touching each category icon removes non-matching items and drops down matching ones</li>
-<li><a target="test" href="anim_gallery.htm">ANIMATION, TRANSITION, TRANSLATE, GALLERY</a>: tapping images adjacent to main image animates them in; tapping current image flips to display text; w/text displaying, tapping adjacent image animates both effects @ same time</li>
-</ol>
-
-<a name="storage"></a>
-<h2>5. Storage</h2>
-
-<ol type="1">
-<li><a target="test" href="storage.htm">LOCAL/SESSION STORAGE</a>:
-When opened for first time, form opens featuring
-login/password/credit-card fields. Fill them out. Each input's
-background will go pink if input is invalid. Login & password
-validate simply as "required" so any string will do. Credit card
-validates as 16-digit numeral. After filling out, press dismiss box.
-Then quit & reopen browser, go back to page, and press (i) info icon
-to get back into form. login/password should be same as initially
-entered (localStorage), but credit-card data s/b absent
-(sessionStorage).
-
-</li>
-</ol>
-
-</div>
-<!-- @@@examples -->
- <div class="feedback t_button">
- [+] Documentation Feedback</div>
- </div>
- </div>
- </div>
- <div class="ft">
- <span></span>
- </div>
- </div>
- <div class="footer">
- <p>
- <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
- The Qt Company, Qt and their respective logos are trademarks of The Qt
- Company Ltd in Finland and/or other countries worldwide.</p>
- <p>
- All other trademarks are property of their respective owners. <a title="Privacy Policy"
- href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
- <br />
- <p>
- Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.</p>
- <p>
- Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
- Free Documentation License version 1.3</a>
- as published by the Free Software Foundation.</p>
- </div>
- <div id="feedbackBox">
- <div id="feedcloseX" class="feedclose t_button">X</div>
- <form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
- <p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and
- requests, please use the <a href="http://bugreports.qt.io/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
- <p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
- <p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p>
- </form>
- </div>
- <div id="blurpage">
- </div>
- <script src="scripts/functions.js" type="text/javascript"></script>
- <!-- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-4457116-5']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script> -->
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_accord.htm b/examples/webkit/webkit-guide/anim_accord.htm
deleted file mode 100644
index 237457ce73..0000000000
--- a/examples/webkit/webkit-guide/anim_accord.htm
+++ /dev/null
@@ -1,123 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Nested Accordion</title>
-<link href='css/anim_accord.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="main">
-<article>
-
-<dl id="accordion" class="collapsed">
-
-<dt><a href="#">Event Info</a></dt>
-<dd>
-<ul>
-<li><a href="#">Travel</a></li>
-<li><a href="#">Area Info</a></li>
-<li><a href="#">Hospitality</a></li>
-<li><a href="#">Schedule of Events</a></li>
-<li><a href="#">Spectator Guide</a></li>
-<li><a href="#">Contact Us</a></li>
-</ul>
-</dd>
-<dt><a href="#">Team Info</a></dt>
-<dd>
-<ul>
-<li><a href="#">Team Captain</a></li>
-<li><a href="#">Team Members</a></li>
-<li><a href="#">Team Standings</a></li>
-</ul>
-</dd>
-<dt><a href="#">Course</a></dt>
-<dd>
-<ul>
-<li><a href="#">Overview</a></li>
-<li><a href="#">Tour</a></li>
-<li><a href="#">History</a></li>
-</ul>
-</dd>
-<dt><a href="#">History</a></dt>
-<dd>
-<ul>
-<li><a href="#">Past Results</a></li>
-<li><a href="#">U.S. Player Records</a></li>
-<li><a href="#">European Player Records</a></li>
-<li><a href="#">All-Time Records</a></li>
-<li><a href="#">The Trophy</a></li>
-</ul>
-</dd>
-<dt><a href="#">News</a></dt>
-<dd>
-<ul>
-<li><a href="#">News Stotries</a></li>
-<li><a href="#">Interviews</a></li>
-<li><a href="#">Photo Gallery</a></li>
-<li><a href="#">Videos</a></li>
-</ul>
-</dd>
-</dl>
-
-<h4>Nested Accordion</h4>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-
-</article>
-</section>
-<script src="js/anim_accord.js"></script>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-rotate.htm b/examples/webkit/webkit-guide/anim_demo-rotate.htm
deleted file mode 100644
index 48df70b6aa..0000000000
--- a/examples/webkit/webkit-guide/anim_demo-rotate.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>transforms: rotate</title>
-
-<link href='css/anim_demo-rotate.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="rotate">
-Rotate: from 0 to 180&deg;, then to 360&deg;<br/>(Origin: center)
-</section>
-
-<section class="rotateOrigin">
-Rotate: from 0 to -180&deg;, then to -360&deg;<br/>(Origin: top left)
-</section>
-
-<section class="end">
-(The End)
-</section>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-scale.htm b/examples/webkit/webkit-guide/anim_demo-scale.htm
deleted file mode 100644
index 8d5320a471..0000000000
--- a/examples/webkit/webkit-guide/anim_demo-scale.htm
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>transforms: scale</title>
-
-<link href='css/anim_demo-scale.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="scale">
-Scale: from 0 to 0.5, to 1.5 and back.<br/>(Origin: bottom)
-</section>
-
-<section class="scaleX">
-ScaleX: from 0 to 0.5, to 1.5 and back.<br/>(Origin: left)
-</section>
-
-<section class="scaleY">
-ScaleY: from 0 to 0.5, to 1.5 and back.<br/>(Origin: center)
-</section>
-
-<section class="end">
-(The End)
-</section>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_demo-skew.htm b/examples/webkit/webkit-guide/anim_demo-skew.htm
deleted file mode 100644
index b167600f09..0000000000
--- a/examples/webkit/webkit-guide/anim_demo-skew.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>transforms: skew</title>
-<link href='css/anim_demo-skew.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="skew">
-Skew: from 30&deg; to -30&deg; and back.<br/>(Origin: bottom)
-</section>
-
-<section class="skewY">
-SkewY: from 30&deg; to -30&deg; and back.<br/>(Origin: left)
-</section>
-
-<section class="end">
-(The End)
-</section>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_gallery.htm b/examples/webkit/webkit-guide/anim_gallery.htm
deleted file mode 100644
index 4320d6dd16..0000000000
--- a/examples/webkit/webkit-guide/anim_gallery.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Image Gallery</title>
-<link href='css/anim_gallery.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="gallery"><div>
-<img src="img/gal1.jpg"/>
-<div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</div>
-</div><div>
-<img src="img/gal2.jpg"/>
-<div>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aenean elementum arcu sed nibh faucibus pellentesque.
-Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Donec a massa felis, a congue purus. Nullam et turpis diam.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div><div>
-<img src="img/gal3.jpg"/>
-<div>
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-Donec a massa felis, a congue purus. Nullam et turpis diam.
-Donec feugiat gravida viverra.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div><div>
-<img src="img/gal4.jpg"/>
-<div>
-Donec feugiat gravida viverra.
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-</div>
-</div><div>
-<img src="img/gal5.jpg"/>
-<div>
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-</div>
-</div><div>
-<img src="img/gal6.jpg"/>
-<div>
-Donec feugiat gravida viverra.
-Aenean elementum arcu sed nibh faucibus pellentesque.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div><div>
-<img src="img/gal7.jpg"/>
-<div>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-</div>
-</div><div>
-<img src="img/gal8.jpg"/>
-<div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-Aliquam erat volutpat. Mauris tempor, urna at dignissim pellentesque, velit lacus dictum sem, non porttitor felis nulla nec risus.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</div>
-</div></section>
-<script src="js/anim_gallery.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_panel.htm b/examples/webkit/webkit-guide/anim_panel.htm
deleted file mode 100644
index fe2c7e29be..0000000000
--- a/examples/webkit/webkit-guide/anim_panel.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Slide-out Panel</title>
-<link href='css/anim_panel.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section onclick="javascript:void(0)">
-<nav id="panel" class="collapsed">
-<img class="button" src="img/ic_c_032.png" onclick="share()"/>
-<img class="option" src="img/ic_ni_032.png" onclick="debug('Ni')"/>
-<img class="option" src="img/ic_fe_032.png" onclick="debug('Fe')"/>
-<img class="option" src="img/ic_he_032.png" onclick="debug('He')"/>
-<img class="option" src="img/ic_o_032.png" onclick="debug('O')"/>
-<img class="option" src="img/ic_na_032.png" onclick="debug('Na')"/>
-<img class="option" src="img/ic_zn_032.png" onclick="debug('Zn')"/>
-<span class="force">&nbsp;</span>
-</nav>
-<div id="dbg">Press the icon, then choose an option if you wish.</div>
-</section>
-<script src="js/anim_panel.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_pulse.htm b/examples/webkit/webkit-guide/anim_pulse.htm
deleted file mode 100644
index 6e354cf229..0000000000
--- a/examples/webkit/webkit-guide/anim_pulse.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Pulse</title>
-<link href='css/anim_pulse.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<nav>
-<a href="#a" id="a"></a>
-<a href="#b" id="b"></a>
-<a href="#c" id="c"></a>
-<a href="#d" id="d"></a>
-<a href="#e" id="e"></a>
-<a href="#f" id="f"></a>
-<span class="force">&nbsp;</span>
-</nav>
-<h3>Animated Pulse</h3>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_skew.htm b/examples/webkit/webkit-guide/anim_skew.htm
deleted file mode 100644
index 99a9a9cc65..0000000000
--- a/examples/webkit/webkit-guide/anim_skew.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Transitions with Skew Transforms</title>
-<link href="css/anim_skew.css" rel="stylesheet" type="text/css" />
-<style id="custom"></style>
-</head>
-<body>
-<section class="items">
-<div title="cat1">Item #1</div>
-<div title="cat2">Item #2</div>
-<div title="cat1">Item #3</div>
-<div title="cat3">Item #4</div>
-<div title="cat4">Item #5</div>
-<div title="cat1">Item #6</div>
-<div title="cat3">Item #7</div>
-<div title="cat2">Item #8</div>
-<div title="cat4">Item #9</div>
-<div title="cat1">Item #10</div>
-<div title="cat2">Item #11</div>
-<div title="cat3">Item #12</div>
-<div title="cat4">Item #13</div>
-<div title="cat1">Item #14</div>
-<div title="cat2">Item #15</div>
-</section>
-
-<nav>
-<div>&nbsp;</div>
-<div class="cat1">&nbsp;</div>
-<div class="cat2">&nbsp;</div>
-<div class="cat4">&nbsp;</div>
-<div class="cat3">&nbsp;</div>
-</nav>
-
-<script src="js/anim_skew.js"></script>
-<!--
-<script src="js/mobile.js"></script>
--->
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_slide1.htm b/examples/webkit/webkit-guide/anim_slide1.htm
deleted file mode 100644
index e017037b72..0000000000
--- a/examples/webkit/webkit-guide/anim_slide1.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Drilldown Sliders</title>
-<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<a id='out'></a>
-<div id='in' class='panel'>
-<h1>Level 1</h1>
-<ul>
-<li><a href='anim_slide2.htm#in'>Level 2, Option A</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option B</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option C</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option D</a></li>
-<li><a href='anim_slide2.htm#in'>Level 2, Option E</a></li>
-</ul>
-</div>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_slide2.htm b/examples/webkit/webkit-guide/anim_slide2.htm
deleted file mode 100644
index b5275287ca..0000000000
--- a/examples/webkit/webkit-guide/anim_slide2.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Drilldown Sliders</title>
-<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<a id='out'></a>
-<div id='in' class='panel'>
-<h1>Level 2</h1>
-<a class='go_out' href='anim_slide1.htm#out'></a>
-<ul>
-<li><a href='anim_slide3.htm#in'>Level 3, Option A</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option B</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option C</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option D</a></li>
-<li><a href='anim_slide3.htm#in'>Level 3, Option E</a></li>
-</ul>
-</div>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_slide3.htm b/examples/webkit/webkit-guide/anim_slide3.htm
deleted file mode 100644
index 70693dc25e..0000000000
--- a/examples/webkit/webkit-guide/anim_slide3.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Drilldown Sliders</title>
-<link href="css/anim_slide.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<a id='out'></a>
-<div id='in' class='panel'>
-<h1>Level 3</h1>
-
-<a class='go_out' href='anim_slide2.htm#out'></a>
-
-<article>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque.
-</article>
-
-</div>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/anim_tabbedSkew.htm b/examples/webkit/webkit-guide/anim_tabbedSkew.htm
deleted file mode 100644
index 0bf2eb6a4e..0000000000
--- a/examples/webkit/webkit-guide/anim_tabbedSkew.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Transformed Tabs</title>
-<link href='css/anim_tabbedSkew.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<nav>
-<a id="l1" href="#a1">&nbsp;</a>
-<a id="l2" href="#a2">&nbsp;</a>
-<a id="l3" href="#a3">&nbsp;</a>
-</nav>
-<article id="a1">
-<h3>Tab #1</h3>
-<div>&nbsp;</div>
-<p>Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis
-ante, id mollis risus lectus ornare nisl. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
-ipsum felis, cursus sed venenatis nec, tempus ac tellus. Aenean
-elementum arcu sed nibh faucibus pellentesque. </p>
-</article>
-<article id="a2">
-<h3>Tab #2</h3>
-<div>&nbsp;</div>
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl.
-
-</article>
-<article id="a3">
-<h3>Tab #3</h3>
-<div>&nbsp;</div>
-
-Donec feugiat gravida viverra. Vivamus ipsum felis, cursus sed
-venenatis nec, tempus ac tellus. Praesent luctus, risus eu vestibulum
-mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Nullam et turpis diam. Aenean vestibulum egestas metus, eu sodales
-dolor venenatis quis. Aenean augue orci, facilisis et convallis ut,
-egestas at neque.
-
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css/anim_accord.css b/examples/webkit/webkit-guide/css/anim_accord.css
deleted file mode 100644
index f65d05d783..0000000000
--- a/examples/webkit/webkit-guide/css/anim_accord.css
+++ /dev/null
@@ -1,246 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- width : 100;
-}
-
-body > section {
- border-radius : 1em;
- background : #ffffff;
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-h1, h2, h3, h4 {
- margin-top : 0.0em;
- font-size : smaller;
- padding-top : 1em;
-}
-
-body > section.main {
- position : absolute;
- left : 1em;
- right : 1em;
- top : 1em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin-bottom : 10em;
- border-radius : 0.5em;
-}
-
-#accordion,
-#accordion > dt,
-#accordion > dd,
-{
- display : block;
-}
-
-#accordion > dt {
- border-top : thin solid #777777;
-}
-
-#accordion > dd {
- border-bottom : thin solid #777777;
-}
-
-#accordion > dd {
- background-image : -webkit-gradient(linear,center top,center bottom,from(#aaaaaa),to(#ffffff));
-}
-
-#accordion.collapsed {
- background-size : auto;
- background-image : url(../img/icon_expand-nav.png);
- background-repeat : no-repeat;
- background-position : 0.25em 0.25em;
-}
-
-#accordion {
- position : absolute;;
- right : 2em;
- top : 0em;
- overflow : hidden;
- background : #ffffff;
- cursor : pointer;
- z-index : 100;
- font-weight : bold;
-}
-
-#accordion.expanded {
- border : thin solid #206ead;
- width : 80%;
- height : 90%;
- -webkit-transition:
- width 0.5s ease-in-out 0.0s,
- height 0.5s ease-in-out 0.5s
- ;
-}
-
-#accordion.collapsed {
- width : 15%;
- height : 9%;
- -webkit-transition:
- height 0.5s ease-in-out 0.0s,
- width 0.5s ease-in-out 0.5s
- ;
-}
-
-#accordion.collapsed > dt,
-#accordion.collapsed > dd {
- -webkit-transform : translate(100%);
- -webkit-transition : -webkit-transform 0.5s ease-in-out 0.5s;
-}
-
-#accordion.expanded > dt,
-#accordion.expanded > dd {
- -webkit-transform : translate(0%);
- -webkit-transition : -webkit-transform 0.5s ease-in-out 0.0s;
-}
-
-#accordion > dt > a {
- margin-left : 0.5em;
-}
-
-#accordion > dt ,
-#accordion > dd {
- padding : 0.5em;
-}
-
-#accordion > dt ~ dd {
- margin : 0;
-}
-
-#accordion > dd > ul,
-#accordion > dd > ul > li
-{
- padding : 0;
- margin : 0;
-}
-
-#accordion a,
-#accordion a:active,
-#accordion a:hover,
-#accordion a:visited
-{
- text-decoration : none;
- color : #000000;
-}
-
-#accordion > dt.expanded:before {
- content : url(../img/icon_head-expanded_x13.png);
-}
-
-#accordion > dt.collapsed:before {
- content : url(../img/icon_head-collapsed_x13.png);
-}
-
-#accordion > dt.expanded {
- background-image : -webkit-gradient(linear, center top, center bottom, from(#aaaaaa), to(#ffffff));
-}
-
-#accordion > dt.collapsed {
- background-image : -webkit-gradient(linear, center top, center bottom, from(#aaaaaa), to(#ffffff));
-}
-
-#accordion > dt + dd {
- background : #ffffff;
- display : block;
-}
-
-#accordion dd {
- overflow : none;
-}
-
-#accordion > dt.collapsed + dd {
- max-height : 0%;
- opacity : 0;
- -webkit-transform : scaleY(0);
- -webkit-transition : all 0.5s ease-in-out;
-}
-
-#accordion > dt.expanded + dd {
- max-height : 50%;
- opacity : 1;
- -webkit-transform : scaleY(1);
- -webkit-transition : all 0.5s ease-in-out;
-}
-
-#accordion > dd {
- margin : 0;
- padding : 0;
-}
-
-#accordion > dd > ul > li {
- padding-top : 0.25em;
- padding-bottom : 0.5em;
- padding-left : 1.0em;
- padding-right : 1.0em;
-}
-
-#accordion> dt.collapsed:last-of-type {
- border-bottom : thin solid #aaaaaa;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_demo-rotate.css b/examples/webkit/webkit-guide/css/anim_demo-rotate.css
deleted file mode 100644
index e03c9a86ce..0000000000
--- a/examples/webkit/webkit-guide/css/anim_demo-rotate.css
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-body {
- background : #aaaaaa;
- font-weight : bold;
-}
-
-section {
- color : #ffffff;
- background : #777777;
- font-size : x-large;
- -webkit-transform : translate(-150%) scale(1);
- position : absolute;
- text-align : center;
- padding : 1em;
- top : 3em;
- left : 3em;
- bottom : 3em;
- right : 3em;
-}
-
-@-webkit-keyframes demoRotate {
- 0% { -webkit-transform : translate(-150%); }
- 10% { -webkit-transform : rotate(0deg) translate(0); }
- 50% { -webkit-transform : rotate(180deg) translate(0); }
- 90% { -webkit-transform : rotate(360deg) translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-@-webkit-keyframes demoRotateOrigin {
- 0% { -webkit-transform : rotate(0deg) translate(-150%); }
- 10% { -webkit-transform : rotate(0deg) translate(0); }
- 50% { -webkit-transform : rotate(-180deg) translate(0); }
- 90% { -webkit-transform : rotate(-360deg) translate(0); }
- 100% { -webkit-transform : rotate(-360deg) translate(150%) }
-}
-
-@-webkit-keyframes end {
- 0% { -webkit-transform : translate(150%); }
- 30% { -webkit-transform : translate(0); }
- 70% { -webkit-transform : translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-.rotate {
- -webkit-animation : demoRotate 9s 2s;
- -webkit-transform-origin : center;
- -webkit-animation-timing-function : linear;
-}
-.rotateOrigin {
- -webkit-animation : demoRotateOrigin 9s 12s;
- -webkit-transform-origin : top left;
- -webkit-animation-timing-function : linear;
-}
-.end {
- -webkit-animation : end 3s 22s;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_demo-scale.css b/examples/webkit/webkit-guide/css/anim_demo-scale.css
deleted file mode 100644
index c9b69c4a9c..0000000000
--- a/examples/webkit/webkit-guide/css/anim_demo-scale.css
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-weight : bold;
-}
-
-section {
- color : #ffffff;
- background : #777777;
- font-size : x-large;
- -webkit-transform : translate(-150%) scale(1);
- position : absolute;
- text-align : center;
- padding : 1em;
- top : 3em;
- left : 3em;
- bottom : 3em;
- right : 3em;
-}
-
-@-webkit-keyframes demoScale {
- 0% { -webkit-transform : translate(-150%) scale(1); }
- 10% { -webkit-transform : scale(1.0) translate(0); }
- 30% { -webkit-transform : scale(0.5) translate(0); }
- 50% { -webkit-transform : scale(1.0) translate(0); }
- 70% { -webkit-transform : scale(1.5) translate(0); }
- 90% { -webkit-transform : scale(1.0) translate(0); }
- 100% { -webkit-transform : translate(150%) scale(1); }
-}
-
-@-webkit-keyframes demoScaleX {
- 0% { -webkit-transform : translate(-150%) scale(1); }
- 10% { -webkit-transform : scaleX(1.0) translate(0); }
- 30% { -webkit-transform : scaleX(0.5) translate(0); }
- 50% { -webkit-transform : scaleX(1.0) translate(0); }
- 70% { -webkit-transform : scaleX(1.5) translate(0); }
- 90% { -webkit-transform : scaleX(1.0) translate(0); }
- 100% { -webkit-transform : translate(150%) scale(1); }
-}
-
-@-webkit-keyframes demoScaleY {
- 0% { -webkit-transform : translate(-150%) scale(1); }
- 10% { -webkit-transform : scaleY(1.0) translate(0); }
- 30% { -webkit-transform : scaleY(0.5) translate(0); }
- 50% { -webkit-transform : scaleY(1.0) translate(0); }
- 70% { -webkit-transform : scaleY(1.5) translate(0); }
- 90% { -webkit-transform : scaleY(1.0) translate(0); }
- 100% { -webkit-transform : translate(150%) scale(1); }
-}
-
-@-webkit-keyframes end {
- 0% { -webkit-transform : translate(150%); }
- 30% { -webkit-transform : translate(0); }
- 70% { -webkit-transform : translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-.scale {
- -webkit-animation : demoScale 9s 2s;
- -webkit-transform-origin : bottom;
-}
-.scaleX {
- -webkit-animation : demoScaleX 9s 12s;
- -webkit-transform-origin : left;
-}
-.scaleY {
- -webkit-animation : demoScaleY 9s 22s;
- -webkit-transform-origin : center;
-}
-.end {
- -webkit-animation : end 3s 32s;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_demo-skew.css b/examples/webkit/webkit-guide/css/anim_demo-skew.css
deleted file mode 100644
index abb1eaecfb..0000000000
--- a/examples/webkit/webkit-guide/css/anim_demo-skew.css
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-weight : bold;
-}
-
-section {
- color : #ffffff;
- background : #777777;
- font-size : x-large;
- -webkit-transform : translate(-150%) scale(1);
- position : absolute;
- text-align : center;
- padding : 1em;
- top : 3em;
- left : 3em;
- bottom : 3em;
- right : 3em;
-}
-
-@-webkit-keyframes demoSkew {
- 0% { -webkit-transform : translate(-150%); }
- 10% { -webkit-transform : skew(0deg) translate(0); }
- 30% { -webkit-transform : skew(30deg) translate(0); }
- 50% { -webkit-transform : skew(0deg) translate(0); }
- 70% { -webkit-transform : skew(-30deg) translate(0); }
- 90% { -webkit-transform : skew(0deg) translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-@-webkit-keyframes demoSkewY {
- 0% { -webkit-transform : translate(-150%); }
- 10% { -webkit-transform : skewY(0deg) translate(0); }
- 30% { -webkit-transform : skewY(30deg) translate(0); }
- 50% { -webkit-transform : skewY(0deg) translate(0); }
- 70% { -webkit-transform : skewY(-30deg) translate(0); }
- 90% { -webkit-transform : skewY(0deg) translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-@-webkit-keyframes end {
- 0% { -webkit-transform : translate(150%); }
- 30% { -webkit-transform : translate(0); }
- 70% { -webkit-transform : translate(0); }
- 100% { -webkit-transform : translate(150%); }
-}
-
-.skew {
- -webkit-animation : demoSkew 9s 2s;
- -webkit-transform-origin : bottom;
-}
-.skewY {
- -webkit-animation : demoSkewY 9s 12s;
- -webkit-transform-origin : left;
-}
-.end {
- -webkit-animation : end 3s 22s;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_gallery.css b/examples/webkit/webkit-guide/css/anim_gallery.css
deleted file mode 100644
index 2e87de2b3c..0000000000
--- a/examples/webkit/webkit-guide/css/anim_gallery.css
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #444444;
-}
-.gallery > div > div {
- border-radius : 1.0em;
- padding : 1em;
- background : #dddddd;
- min-height : 75%;
-}
-.gallery > div {
- -webkit-transition : all 0.5s ease-in-out;
- z-index : 0;
- position : absolute;
- top : 2.0em;
- bottom : 2.0em;
- left : 2.0em;
- right : 2.0em;
-}
-.gallery > div.selected {
- -webkit-transform : translate(0) scale(1);
- opacity : 1.0;
- z-index : 1;
-}
-.gallery > div.queueR {
- -webkit-transform : translate(70%) scale(0.5);
- opacity : 0.75;
-}
-.gallery > div.queueL {
- -webkit-transform : translate(-70%) scale(0.5);
- opacity : 0.75;
-}
-.gallery > div.hideR {
- -webkit-transform : translate(200%) scale(0.5);
- opacity : 0.0;
-}
-.gallery > div.hideL {
- -webkit-transform : translate(-200%) scale(0.5);
- opacity : 0.0;
-}
-.gallery img {
- max-width : 100%;
- max-height : 100%;
- border-radius : 1.0em;
-}
-
-.gallery > #reveal > div, .gallery > div > img {
- -webkit-transform : scaleX(1) scaleY(1);
- -webkit-transition : -webkit-transform 0.25s ease-out 0.25s;
-}
-.gallery > div > div, .gallery > #reveal > img {
- -webkit-transform : scaleX(0) scaleY(1);
- -webkit-transition : -webkit-transform 0.25s ease-out;
-}
-
-section > div {
- text-align : center;
-}
-
-section > div > img {
- display : inline-block;
-}
-
-section > div > div {
- position : absolute;
- top : 0;
- left : 1.5em;
- right : 1.5em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_panel.css b/examples/webkit/webkit-guide/css/anim_panel.css
deleted file mode 100644
index 4c4282ba54..0000000000
--- a/examples/webkit/webkit-guide/css/anim_panel.css
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-section {
- background : #aaaaaa;
- position : absolute;
- left : 1em;
- right : 1em;
- top : 1em;
- bottom : 1em;
-}
-
-.force {
- padding-right : 5in;
-}
-
-#panel {
- text-align : justify;
- padding : 0.5em;
- border-radius : 0.5em;
- background : #ffffff;
- max-height : 2.0em;
- float : right;
- overflow : hidden;
-}
-
-nav.expanded {
- max-width : 95%;
- -webkit-transition : max-width 0.5s ease-in-out;
-}
-
-nav.collapsed {
- max-width : 12%;
- -webkit-transition : max-width 0.5s ease-in-out;
-
-}
-
-nav.expanded > .button {
- display : none;
-}
-
-nav.collapsed > .button {
- display : inline-block;
-}
-
-nav.expanded > .option {
- opacity : 1;
- -webkit-transform : scale(1);
- -webkit-transition : all 0.5s linear;
-}
-nav.collapsed > .option {
- opacity : 0;
- -webkit-transform : scale(0);
- -webkit-transition : all 0.5s linear;
-}
-
-#dbg {
- padding : 1em;
- border-radius : 1em;
- position : absolute;
- top : 75%;
- bottom : 1em;
- left : 1em;
- right : 1em;
- background : #ffffff;
-}
-
-.measure {
- position : absolute;
- top : 0;
- left : 0;
- width : 320px;
- background : green;
-}
diff --git a/examples/webkit/webkit-guide/css/anim_pulse.css b/examples/webkit/webkit-guide/css/anim_pulse.css
deleted file mode 100644
index 0cd2eae5b9..0000000000
--- a/examples/webkit/webkit-guide/css/anim_pulse.css
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-.force {
- padding-left : 100%
-}
-
-nav {
- text-align : justify;
-}
-
-nav > a {
- background-size : contain;
- background-repeat : no-repeat;
-}
-
-nav > a {
- display : inline-block;
- width : 2em;
- height : 2em;
-}
-
-nav > a:nth-of-type(1) { background-image : url(../img/ic_fe_032.png); }
-nav > a:nth-of-type(2) { background-image : url(../img/ic_ni_032.png); }
-nav > a:nth-of-type(3) { background-image : url(../img/ic_he_032.png); }
-nav > a:nth-of-type(4) { background-image : url(../img/ic_na_032.png); }
-nav > a:nth-of-type(5) { background-image : url(../img/ic_zn_032.png); }
-nav > a:nth-of-type(6) { background-image : url(../img/ic_o_032.png); }
-
-h1,h2,h3 { margin-top : 0; }
-
-nav > a:target { -webkit-animation : pulse 1s infinite; }
-
-@-webkit-keyframes pulse {
- 0% { opacity : 1.0 }
- 50% { opacity : 0.7 }
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_skew.css b/examples/webkit/webkit-guide/css/anim_skew.css
deleted file mode 100644
index 99d48a2a89..0000000000
--- a/examples/webkit/webkit-guide/css/anim_skew.css
+++ /dev/null
@@ -1,186 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- padding : 1em;
- font-family : "Helvetica";
- font-weight : bold;
-}
-
-span {
- background : #ffffff;
- font-weight : bold;
- cursor : pointer;
-}
-
-.items > div {
- cursor : pointer;
- background : #ffffff;
- height : 2em;
- padding : 0.5em 0.5em 0.0em 0.5em;
- border-radius : 0.25em;
- position : absolute;
- left : 1em;
- right : 1em;
- -webkit-transition-property : -webkit-transform, top;
- -webkit-transition-duration : 0.5s, 0.5s;
- -webkit-transition-delay : 0s, 0.5s;
- -webkit-transition-timing-function : ease-in-out;
-}
-
-.hide {
- -webkit-transform-origin : bottom left;
- -webkit-transform : skew(40deg) translate(140%,0em);
-}
-
-.items > div:after {
- content : url(../img/icon_dismiss_x22.png);
- float : right;
-}
-
-.row1 {
- top : 3.5em;
-}
-.row2 {
- top : 6.5em;
-}
-.row3 {
- top : 9.5em;
-}
-.row4 {
- top : 12.5em;
-}
-.row5 {
- top : 15.5em;
-}
-.row6 {
- top : 18.5em;
-}
-.row7 {
- top : 21.5em;
-}
-.row8 {
- top : 24.5em;
-}
-.row9 {
- top : 27.5em;
-}
-.row10 {
- top : 30.5em;
-}
-.row11 {
- top : 33.5em;
-}
-.row12 {
- top : 36.5em;
-}
-.row13 {
- top : 39.5em;
-}
-.row14 {
- top : 42.5em;
-}
-.row15 {
- top : 45.5em;
-}
-
-.items > div {
- padding-left : 3.0em;
- color : #444444;
- background-size : contain;
- background-repeat : no-repeat;
-}
-
-.items > div[title='cat1'] {
- background-image : url(../img/ic_fe_036.png);
-}
-
-.items > div[title='cat2'] {
- background-image : url(../img/ic_na_036.png);
-}
-
-.items > div[title='cat3'] {
- background-image : url(../img/ic_ni_036.png);
-}
-
-.items > div[title='cat4'] {
- background-image : url(../img/ic_mg_036.png);
-}
-
-nav {
- position : absolute;
- background : #aaaaaa;
- top : 0;
- left : 0;
- right : 0;
- z-index : 10;
- height : 2em;
- text-align : center;
- padding : 0.5em;
-}
-
-nav > div {
- background-size : contain;
- background-repeat : no-repeat;
- display : inline-block;
- width : 36px;
- height : 36px;
- margin-left : 0.25em;
- margin-right : 0.25em;
- background-image : -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#eeeeee));
-}
-
-nav > div {
- background-image : url(../img/icon_list-all.png);
-}
-nav > .cat1 {
- background-image : url(../img/ic_fe_036.png);
-}
-nav > .cat2 {
- background-image : url(../img/ic_na_036.png);
-}
-nav > .cat3 {
- background-image : url(../img/ic_ni_036.png);
-}
-nav > .cat4 {
- background-image : url(../img/ic_mg_036.png);
-}
-
diff --git a/examples/webkit/webkit-guide/css/anim_slide.css b/examples/webkit/webkit-guide/css/anim_slide.css
deleted file mode 100644
index cd715efaf3..0000000000
--- a/examples/webkit/webkit-guide/css/anim_slide.css
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-/* main layout */
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1 {
- min-height : 1.5em;
- background : #ffffff;
- margin-left : 1em;
- margin-right : 1em;
- text-align : center;
- font-size : 18px;
- padding-top : 0.25em;
- padding-bottom : 0.25em;
- border-radius : 0.5em;
-}
-
-.panel {
- position : absolute;
- top : 0em;
- bottom : 0em;
- left : 0em;
- right : 0em;
-}
-
-article {
- background : #ffffff;
- padding : 1em;
- border-radius : 1em;
- margin : 1em;
-}
-
-.panel > ul {
- padding : 0em;
- list-style-type : none;
-}
-.panel > ul > li {
- background : #fff;
- margin : 0.5em 1.0em 0.5em 1.0em;
- padding : 0.5em;
- display : block;
- border-radius : 0.5em;
-}
-.panel > ul > li > a {
- width : 100%;
- display : block;
- text-decoration : none;
- text-align : justify;
- color : #000000;
-}
-.panel > a {
- background : #fff;
- margin : 0 1.0em 1.0em 0em;
- padding : 0.5em;
-}
-/* navigational hints */
-
-a.go_out {
- background : transparent;
- position : absolute;
- top : 0.5em;
- left : 1.2em;
- content : url(../img/icon_drill-up_x32.png);
- padding : 0.25em;
- border-radius : 1em;
- display : block;
-}
-
-.panel > ul > li > a:after {
- text-align : right;
- float : right;
- font-size : 1em;
- font-weight : bold;
-}
-.panel > ul > li > a:after {
- -webkit-transform : translate(0, -0.5em);
- content : url(../img/icon_drill-down_x32.png);
-}
-
-/* animations */
-#in:target {
- -webkit-animation : slide_in 0.25s;
-}
-#out:target + .panel {
- -webkit-animation : slide_out 0.25s;
-}
-@-webkit-keyframes slide_in {
- from {
- left : 80%;
- right : -80%;
- }
- to {
- left : 0em;
- right : 0em;
- }
-}
-@-webkit-keyframes slide_out {
- from {
- left : -80%;
- right : 80%;
- }
- to {
- left : 0em;
- right : 0em;
- }
-}
diff --git a/examples/webkit/webkit-guide/css/anim_tabbedSkew.css b/examples/webkit/webkit-guide/css/anim_tabbedSkew.css
deleted file mode 100644
index 16bbd7983e..0000000000
--- a/examples/webkit/webkit-guide/css/anim_tabbedSkew.css
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-section {
- background : #ffffff;
- position : absolute;
- left : 1em;
- right : 1em;
- top : 1em;
- min-height : 60%;
- padding : 1.0em;
- border-radius : 0.5em;
-}
-
-nav {
- text-align : right;
- width : 3.5em;
- height : 4em;
- float : right;
-}
-
-nav > a {
- border-radius : 0.25em;
- width : 1em;
- height : 1em;
- text-align : center;
- font-weight : bold;
- font-size : 2em;
- text-decoration : none;
- color : black;
- position : relative;
- background-size : contain;
- display : block;
-}
-
-nav > a:nth-of-type(1) {
- margin-bottom : 0.1em;
- background-image : url(../img/ic_he_032.png);
- -webkit-transform : skew(-30deg);
-}
-
-nav > a:nth-of-type(2) {
- background-image : url(../img/ic_o_032.png);
- -webkit-transform : skew(30deg);
-}
-
-nav > a:nth-of-type(3) {
- background-image : url(../img/ic_na_032.png);
- -webkit-transform : rotate(-60deg) skew(-30deg) translate(1.7em, -1px);
-}
-
-article {
- display : none;
- margin-bottom : 4em;
-}
-
-article:target {
- display : block;
-}
-
-h3 + div {
- display : inline-block;
- float : right;
- width : 12px;
- height : 3em;
-}
-
-h1,h2,h3,h4 {
- margin-top : 0.5em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_backgrounds.css b/examples/webkit/webkit-guide/css/css3_backgrounds.css
deleted file mode 100644
index a466603046..0000000000
--- a/examples/webkit/webkit-guide/css/css3_backgrounds.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #aaaaaa;
-}
-
-h1,h2,h3,h4 {
- background : #ffffff;
- text-align : center;
- margin : 0.5em;
- padding : 0.5em;
- border-radius : 0.5em;
-}
-
-.accordion {
- margin : 0.5em 0.5em 6em 0.5em;
- border-radius : 0.5em;
- border : thin solid #aaa;
- background : #ffffff;
- overflow : hidden;
- padding : 1.0em 0.5em 1.0em 0.5em;
-
-}
-
-.accordion > dt {
- cursor : pointer;
- border-top : thin solid #aaa;
- border-radius : 0.5em;
- padding : 0.5em 0.5em 0.5em 2.5em;
- font-weight : bold;
- background-size : auto;
- background-image : url(../img/icon_head-collapsed_x13.png);
- background-repeat : no-repeat;
- background-position : 12px 12px;
-}
-
-.accordion > dt:first-of-type {
- border-top : none;
-}
-
-.accordion > dt.selected {
- background-image : url(../img/icon_head-expanded_x13.png) , url(../img/gradient.jpg);
- background-repeat : no-repeat , repeat-x;
- background-position : 12px 12px , 0 0;
- margin-bottom : 0em;
-}
-
-dt + dd {
- max-height : 0%;
- margin : 0;
- opacity : 0;
- padding : 0.5em;
- overflow-y : hidden;
- max-height : 0;
- -webkit-transform : scaleY(0);
- -webkit-transition : all 0.5s linear;
-}
-
-dt.selected + dd {
- -webkit-transform : scaleY(1);
- -webkit-transform-origin : center;
- max-height : 1000px;
- -webkit-transition : all 0.5s linear;
- opacity : 1;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_border-img.css b/examples/webkit/webkit-guide/css/css3_border-img.css
deleted file mode 100644
index 878741f255..0000000000
--- a/examples/webkit/webkit-guide/css/css3_border-img.css
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-.fruit {
- padding : 2.5em;
- -webkit-border-image : url(../img/border-frame.png) 2 stretch stretch;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_grad-radial.css b/examples/webkit/webkit-guide/css/css3_grad-radial.css
deleted file mode 100644
index 1b2ecaf1d9..0000000000
--- a/examples/webkit/webkit-guide/css/css3_grad-radial.css
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 70%;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_gradientBack.css b/examples/webkit/webkit-guide/css/css3_gradientBack.css
deleted file mode 100644
index 63c7843926..0000000000
--- a/examples/webkit/webkit-guide/css/css3_gradientBack.css
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
-}
-
-section {
- position : absolute;
- top : 0.0em;
- left : 0.0em;
- right : 0.0em;
- background : #aaaaaa;
- background : -webkit-gradient(linear, center top, center bottom, from(#dddddd), to(#777777) );
- padding : 1em;
-}
-
-article {
- background : #ffffff;
- padding : 1em;
- border-radius : 0.5em;
- border : thin #aaaaaa solid;
- margin-bottom : 12em;
-}
-
-h1, h2, h3, h4 {
- text-align : center;
- margin-top : 0.5em;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_gradientBackStop.css b/examples/webkit/webkit-guide/css/css3_gradientBackStop.css
deleted file mode 100644
index c3c89af542..0000000000
--- a/examples/webkit/webkit-guide/css/css3_gradientBackStop.css
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
-}
-
-section {
- position : absolute;
- top : 0.0em;
- left : 0.0em;
- right : 0.0em;
- background : #aaaaaa;
- background : -webkit-gradient(linear, center top, center bottom, from(#777777), color-stop(50%,#dddddd), to(#777777) );
- padding : 1em;
-}
-
-article {
- background : #ffffff;
- padding : 1em;
- border-radius : 0.5em;
- border : thin #aaaaaa solid;
- margin-bottom : 12em;
-}
-
-h1, h2, h3, h4 {
- text-align : center;
- margin-top : 0.5em;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_gradientButton.css b/examples/webkit/webkit-guide/css/css3_gradientButton.css
deleted file mode 100644
index 05f3395114..0000000000
--- a/examples/webkit/webkit-guide/css/css3_gradientButton.css
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #ffffff;
-}
-
-article {
- background : #ffffff;
- position : absolute;
- margin : 0;
- left : 0;
- right : 0;
- top : 0;
- bottom : 0;
-}
-
-ul {
- font-weight : bold;
- padding : 0;
- list-style : none;
- margin : 0.5em 0.5em 6em 0.5em;
-}
-
-ul > li {
- margin-bottom : 0.5em;
-}
-
-ul > li > a {
- padding : 0.5em;
- display : block;
- text-decoration : none;
- color : #000000;
- border : thin #aaaaaa solid;
- border-radius : 0.5em;
- background : #dddddd;
- background : -webkit-gradient(linear, center top, center bottom,
- from(#cccccc), to(#ffffff) );
-}
-
-ul > li > a:active {
- color : #ffffff;
- background : #ffffff;
- background : -webkit-gradient(linear, center top, center bottom,
- from(#dddddd), to(#444444) );
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_mask-grad.css b/examples/webkit/webkit-guide/css/css3_mask-grad.css
deleted file mode 100644
index f77d7f1164..0000000000
--- a/examples/webkit/webkit-guide/css/css3_mask-grad.css
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #ffffff;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-img {
- -webkit-mask-box-image : -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
- border-radius : 0.25em;
- margin : 0.1em;
-}
-
-img.select {
- -webkit-mask-box-image : none;
- -webkit-box-shadow : 0.2em 0.2em 0.4em #aaaaaa;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_mask-img.css b/examples/webkit/webkit-guide/css/css3_mask-img.css
deleted file mode 100644
index 58e97fa4ef..0000000000
--- a/examples/webkit/webkit-guide/css/css3_mask-img.css
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #333333;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-img {
- position : absolute;
- left : 5%;
- top : 5%;
- height : 90%;
- width : 90%;
- -webkit-mask-box-image : url(../img/mask.png) 5% stretch;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_multicol.css b/examples/webkit/webkit-guide/css/css3_multicol.css
deleted file mode 100644
index 75cfc8d639..0000000000
--- a/examples/webkit/webkit-guide/css/css3_multicol.css
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- font-family : sans-serif;
- background : #aaaaaa;
-}
-
-section {
- bottom : 0;
- left : 0;
- top : 12%;
- right : 0;
- position : absolute;
- padding-bottom : 6em;
-}
-
-article {
- border-radius : 1em;
- margin : 1em;
- padding : 1em;
- background : #ffffff;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
- margin-top : 0.0em;
-}
-
-nav.ad {
- width : 500%;
- border : thin #aaaaaa solid;
- background : #dddddd;
- position : absolute;
- top : 0%;
- height : 10%;
- column-count : 5;
- column-width : 100%;
- -webkit-animation : banner_scroll 30s infinite;
-}
-
-nav.ad > a {
- width : 20%;
- height : 100%;
- display : inline-block;
- text-align : center;
- padding-top : 0.5em;
- text-decoration : none;
- font-weight : bold;
- color : #000000;
- font-size : larger;
-}
-
-nav.ad > a:nth-of-type(5n-0) { background : lightgreen; }
-nav.ad > a:nth-of-type(5n-1) { background : pink; }
-nav.ad > a:nth-of-type(5n-2) { background : plum; }
-nav.ad > a:nth-of-type(5n-3) { background : lightblue; }
-nav.ad > a:nth-of-type(5n-4) { background : lightcoral; }
-
-@-webkit-keyframes banner_scroll {
- 0% { left : 0%; }
- 18% { left : 0%; }
- 20% { left : -100%; }
- 38% { left : -100%; }
- 40% { left : -200%; }
- 58% { left : -200%; }
- 60% { left : -300%; }
- 78% { left : -300%; }
- 80% { left : -400%; }
- 95% { left : -400%; }
- 100% { left : 0%; }
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_reflect.css b/examples/webkit/webkit-guide/css/css3_reflect.css
deleted file mode 100644
index 2847c0712b..0000000000
--- a/examples/webkit/webkit-guide/css/css3_reflect.css
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin-bottom : 10em;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-body > section.main {
- position : absolute;
- left : 0em;
- right : 0em;
- top : 0em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin : 1em 1em 10em 1em;
- border-radius : 0.5em;
-}
-
-h1, h2, h3 {
- color : #206ead;
- margin-top : 0em;
- text-align : center;
- margin-bottom : 1em;
- -webkit-box-reflect : below -0.25em -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(0.25, transparent), to(black));
-}
-
-.nav1 { background-image : url(../img/ic_he_032.png) }
-.nav2 { background-image : url(../img/ic_o_032.png) }
-.nav3 { background-image : url(../img/ic_ni_032.png) }
-.nav4 { background-image : url(../img/ic_fe_032.png) }
-.nav5 { background-image : url(../img/ic_na_032.png) }
-.nav6 { background-image : url(../img/ic_zn_032.png) }
-
-h1 { font-size : 1.5em; }
-h2 { font-size : 1.2em; }
-h3 { font-size : 1.0em; }
-
-figure {
- display : block;
- text-align : center;
-}
-
-figure > img {
- width : 70%;
- margin-bottom : 3em;
- -webkit-box-reflect : below 0.25em -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(0.50, transparent), to(black));
-}
-
-p:first-line {
- font-weight : bold;
-}
-
-p:first-letter {
- font-size : 200%;
- float : left;
- padding-right : 0.1em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_scroll.css b/examples/webkit/webkit-guide/css/css3_scroll.css
deleted file mode 100644
index af4b177d89..0000000000
--- a/examples/webkit/webkit-guide/css/css3_scroll.css
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background-color : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- margin-top : 0.5em;
- font-size : 18px;
- text-align : center;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1.0em 0.5em 6.0em 0.5em;
- min-height : 50%;
-}
-
-pre {
- font-weight : bold;
- font-family : monospace;
- padding : 1.0em 3em 1.0em 1.0em;
- border : thin solid #aaaaaa;
- border-radius : 1.5em;
- overflow-x : auto;
- background-image : -webkit-gradient(linear,left center,right center,from(#ffffff),to(#777777));
-}
-
-pre::-webkit-scrollbar {
- height : 3em;
-}
-
-pre::-webkit-scrollbar-button:increment {
- background-image : url(../img/icon_scroll-right.png);
-x background-size : contain;
- background-repeat : no-repeat;
- width : 3em;
- height : 3em;
-}
-
-pre::-webkit-scrollbar-button:decrement {
- background-image : url(../img/icon_scroll-left.png);
- background-size : contain;
- background-repeat : no-repeat;
- width : 3em;
- height : 3em;
-}
-
-pre::-webkit-scrollbar-track {
- display : none;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_sel-nth.css b/examples/webkit/webkit-guide/css/css3_sel-nth.css
deleted file mode 100644
index dd4ff26901..0000000000
--- a/examples/webkit/webkit-guide/css/css3_sel-nth.css
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-img {
- position : absolute;
- width : 48px;
- height : 48px;
- padding : 0.25em;
- border : #ffffff medium solid;
- border-radius : 0.5em;
-}
-
-/* columns */
-img:nth-of-type(4n-3) { left : 2% }
-img:nth-of-type(4n-2) { left : 27% }
-img:nth-of-type(4n-1) { left : 52% }
-img:nth-of-type(4n-0) { left : 77% }
-
-/* rows */
-img:nth-of-type(n) { top : 5% }
-img:nth-of-type(n+5) { top : 20% }
-img:nth-of-type(n+9) { top : 35% }
-img:nth-of-type(n+13) { top : 50% }
-img:nth-of-type(n+17) { top : 65% }
-img:nth-of-type(n+21) { top : 80% }
-
diff --git a/examples/webkit/webkit-guide/css/css3_shadow.css b/examples/webkit/webkit-guide/css/css3_shadow.css
deleted file mode 100644
index 3086ace680..0000000000
--- a/examples/webkit/webkit-guide/css/css3_shadow.css
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin-bottom : 10em;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-nav > a:active {
- -webkit-transform : scale(0.8);
-}
-
-h1, h2 {
- margin-top : 0em;
- font-size : 18px;
- text-align : center;
-}
-
-h2 {
- border-top : solid thin #aaaaaa;
-}
-
-body > section.main {
- position : absolute;
- left : 0em;
- right : 0em;
- top : 5em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin : 1em 1em 10em 1em;
- border-radius : 0.5em;
-}
-
-section.nav {
- z-index : 10;
- border-radius : 0;
- background : #aaaaaa;
- background : transparent;
- position : absolute;;
- padding : 1em;
- top : 0;
- right : 0.0em;
- left : 0.0em;
-}
-
-nav {
- padding : 0.5em;
- border-radius : 0.5em;
- background : #ffffff;
- top : 10px;
- text-align : justify;
- height : 36px;
- overflow : hidden;
-}
-
-nav > a {
- display : inline-block;
- background-repeat : no-repeat;
- height : 36px;
- width : 36px;
-}
-
-#force_justify {
- padding-left : 100%;
-}
-
-.nav1 { background-image : url(../img/ic_he_032.png) }
-.nav2 { background-image : url(../img/ic_o_032.png) }
-.nav3 { background-image : url(../img/ic_ni_032.png) }
-.nav4 { background-image : url(../img/ic_fe_032.png) }
-.nav5 { background-image : url(../img/ic_na_032.png) }
-.nav6 { background-image : url(../img/ic_zn_032.png) }
-
-nav {
- -webkit-box-shadow : 0.5em 0.5em #777777;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_shadowBlur.css b/examples/webkit/webkit-guide/css/css3_shadowBlur.css
deleted file mode 100644
index e65fcd5692..0000000000
--- a/examples/webkit/webkit-guide/css/css3_shadowBlur.css
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin-bottom : 10em;
- min-height : 70%;
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-h1, h2 {
- margin-top : 0em;
- font-size : 18px;
- text-align : center;
-}
-
-h2 {
- border-top : solid thin #aaaaaa;
-}
-
-body > section.main {
- position : absolute;
- left : 0em;
- right : 0em;
- top : 5em;
- min-height : 50%;
- border-radius : 0.5em;
- background : #aaaaaa;
- padding : 0;
-}
-
-section.main > article {
- background : #ffffff;
- padding : 1em;
- margin : 1em 1em 10em 1em;
- border-radius : 0.5em;
-}
-
-section.nav {
- z-index : 10;
- border-radius : 0;
- background : #aaaaaa;
- background : transparent;
- position : absolute;;
- padding : 1em;
- top : 0;
- right : 0.0em;
- left : 0.0em;
-}
-
-nav {
- padding : 0.5em;
- border-radius : 0.5em;
- background : #ffffff;
- top : 10px;
- text-align : justify;
- height : 36px;
- overflow : hidden;
-}
-
-nav > a {
- display : inline-block;
- background-repeat : no-repeat;
- height : 36px;
- width : 36px;
-}
-
-nav > a:active {
- -webkit-transform : scale(0.8);
-}
-
-#force_justify {
- padding-left : 100%;
-}
-
-.nav1 { background-image : url(../img/ic_he_032.png) }
-.nav2 { background-image : url(../img/ic_o_032.png) }
-.nav3 { background-image : url(../img/ic_ni_032.png) }
-.nav4 { background-image : url(../img/ic_fe_032.png) }
-.nav5 { background-image : url(../img/ic_na_032.png) }
-.nav6 { background-image : url(../img/ic_zn_032.png) }
-
-nav {
- -webkit-box-shadow : 0.5em 0.5em 0.5em #444444;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_text-overflow.css b/examples/webkit/webkit-guide/css/css3_text-overflow.css
deleted file mode 100644
index 3330a78d20..0000000000
--- a/examples/webkit/webkit-guide/css/css3_text-overflow.css
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-.accordion {
- border : #777777 solid thin;
- padding : 0.0em;
- border-radius : 0.5em;
- list-style : none;
-}
-
-.accordion > li {
- padding : 0.5em;
- border-bottom : #777777 solid thin;
- white-space : nowrap;
- max-height : 1.5em;
- overflow : hidden;
- text-overflow : clip;
- text-overflow : ellipsis;
- text-overflow : ellipsis-word;
- -webkit-transition : max-height 1s ease-in-out;
-}
-
-.accordion > li:last-of-type {
- border-bottom : none;
-}
-
-.accordion > li.selected {
- -webkit-transition : max-height 1s ease-in-out;
- max-height : 100em;
- white-space : normal;
- font-weight : normal;
-}
-
-.accordion > li.selected:first-line {
- font-weight : bold;
-}
-
-.accordion > li.selected:first-letter {
- font-size : 200%;
- float : left;
- padding-right : 0.1em;
-}
-
-.dismiss {
- content : url(../img/icon_dismiss.png);
-}
-
-.accordion > li > .dismiss {
- display : none;
-}
-
-.accordion > li.selected > .dismiss {
- display : block;
- float : right;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_text-shadow.css b/examples/webkit/webkit-guide/css/css3_text-shadow.css
deleted file mode 100644
index 31e58e8587..0000000000
--- a/examples/webkit/webkit-guide/css/css3_text-shadow.css
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
- text-shadow : 0.20em 0.20em 0.20em #999;
- color : #206ead;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
diff --git a/examples/webkit/webkit-guide/css/css3_text-stroke.css b/examples/webkit/webkit-guide/css/css3_text-stroke.css
deleted file mode 100644
index 996ce09db1..0000000000
--- a/examples/webkit/webkit-guide/css/css3_text-stroke.css
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-h1,h2,h3,h4 {
- margin-top : 0.5em;
- text-align : center;
-}
-
-h1 {
- -webkit-text-stroke : 2px #000000;
- font-size : 40px;
-}
-
-h1, h2, h3 {
- color : #206ead;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
diff --git a/examples/webkit/webkit-guide/css/form_tapper.css b/examples/webkit/webkit-guide/css/form_tapper.css
deleted file mode 100644
index 7b86ec443d..0000000000
--- a/examples/webkit/webkit-guide/css/form_tapper.css
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-/* MOBILE UI */
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin : 1em 1em 10em 1em;
- min-height : 70%
-}
-
-h1, h2 {
- margin-top : 1em;
- font-size : smaller;
- text-align : center;
- padding-top : 1em;
-}
-
-h2 {
- border-top : solid thin #dddddd;
-}
-
-/* FORM */
-
-form {
- font-weight : bold;
- font-size : small;
-}
-
-input[type=radio],
-input[type=checkbox] {
- -webkit-appearance : button;
- float : right;
- margin-bottom : -2em;
- opacity : 0;
-}
-
-label,
-input[type=radio],
-input[type=checkbox] {
- width : 90%;
- display : block;
- padding : 0.5em;
- height : 2em;
-}
-
-label {
- padding-top : 0.5em;
- border : medium solid #aaaaaa;
- border-radius : 1.0em;
-}
-
-input[type=radio]:checked + label,
-input[type=checkbox]:checked + label {
- border : medium solid green;
-}
-
-input[type=radio]:checked + label:after,
-input[type=checkbox]:checked + label:after {
- float : right;
- padding-right : 0.5em;
- content : url(../img/icon_check_x24green.png);
-}
-
diff --git a/examples/webkit/webkit-guide/css/form_toggler.css b/examples/webkit/webkit-guide/css/form_toggler.css
deleted file mode 100644
index fc5d888a4d..0000000000
--- a/examples/webkit/webkit-guide/css/form_toggler.css
+++ /dev/null
@@ -1,200 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-/* MOBILE UI */
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-body > section {
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- margin : 1em 1em 10em 1em;
- min-height : 70%
-}
-
-h1, h2 {
- margin-top : 1em;
- font-size : smaller;
- text-align : center;
- padding-top : 1em;
-}
-
-h2 {
- border-top : solid thin #dddddd;
-}
-
- /* FORM */
-
-form
-{
- line-height : 250%;
- font-weight : bold;
- font-size : small;
-}
-
- /* DEFAULT INPUT */
-
-input[type=radio],
-input[type=checkbox]
-{
- text-align : right;
- padding-top : 0.1em;
- text-transform : uppercase;
- float : right;
- -webkit-appearance : button;
- border : 0.25em #aaaaaa solid;
- background : #aaaaaa;
- background : -webkit-gradient(linear,center top,center bottom,from(#999999),to(#ffffff));
- border-radius : 0.5em;
- min-width : 6em;
- height : 2em;
- display : inline-block;
-}
-
- /* CHECKED INPUT */
-
-input[type=radio]:checked,
-input[type=checkbox]:checked
-{
- text-align : left;
-}
-
- /* FLIPPED INPUT */
-
-input.invert
-{
- text-align : left;
-}
-
-input.invert:checked
-{
- text-align : right;
-}
-
- /* DEFAULT TEXT */
-
-input[type=radio]:before,
-input[type=checkbox]:before
-{
- color : #888888;
- height : 1.4em;
- display : inline-block;
- background : pink;
- background : -webkit-gradient(linear,center top,center bottom,from(pink),to(#ffffff));
- min-width : 50%;
- content : "off";
- text-align : center;
- font-weight : bold;
- padding-left : 0.5em;
- padding-right : 0.5em;
- border-radius : 0.25em;
-}
-
- /* CHECKED TEXT */
-
-input[type=radio]:checked:before,
-input[type=checkbox]:checked:before
-{
- color : #ffffff;
- content : "on";
- background : #00aa00;
- background : -webkit-gradient(linear,center top,center bottom,from(green),to(cyan));
-}
-
- /* ALTERNATE DISPLAY */
-
-input.yn:before
-{
- content : "no";
-}
-
-input.yn:checked:before
-{
- content : "yes";
-}
-
-input.tf:before
-{
- content : "false";
-}
-
-input.tf:checked:before
-{
- content : "true";
-}
-
- /* BINARY */
-
-input.binary {
- display : inline-block;
-}
-
-input.binary:checked {
- display : none;
-}
-
-input.binary:before {
- background : #00aa00;
- background : -webkit-gradient(linear,center top,center bottom,from(green),to(cyan));
- color : #ffffff;
-}
-
-input.binary:nth-of-type(odd) {
- text-align : left;
-}
-
-input.binary:nth-of-type(even) {
- text-align : right;
-}
-
- /* CUSTOM */
-
-input.ampm:nth-of-type(odd):before { content : "am"; }
-input.ampm:nth-of-type(even):before { content : "pm"; }
-
-input.sex:nth-of-type(odd):before { content : "male"; }
-input.sex:nth-of-type(even):before { content : "female"; }
-
-input.sex { width : 8em }
-
diff --git a/examples/webkit/webkit-guide/css/layout_link-fmt.css b/examples/webkit/webkit-guide/css/layout_link-fmt.css
deleted file mode 100644
index 918b694dca..0000000000
--- a/examples/webkit/webkit-guide/css/layout_link-fmt.css
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-p {
- font-weight : normal;
-}
-
-a {
- text-wrap : suppress;
- -webkit-text-wrap : suppress;
-}
-
-article {
- background : #ffffff;
- position : absolute;
- top : 1em;
- left : 1em;
- right : 1em;
- padding : 1em;
- border-radius : 1em;
- margin-bottom : 2em;
-}
-
-ol {
- padding-left : 1em;
-}
-
-ol.links {
- margin-bottom : 1em;
- border : #aaaaaa thin solid;
- list-style : none;
- padding-top : 0.5em;
- padding-bottom : 0.5em;
- padding-left : 0em;
- border-radius : 1.0em;
-}
-
-ol.links > li {
- min-height : 2em;
- border-bottom : #aaaaaa thin solid;
- padding-left : 0.5em;
- padding-right : 0.5em;
- padding-top : 0.5em;
-}
-
-ol.links > li:last-of-type {
- border : none;
-}
-
-p a[href]:after {
- -webkit-transform : scale(0.6);
- -webkit-transform-origin : bottom;
- padding-left : 0.25em;
- padding-right : 0.0em;
- display : inline-block;
-}
-
-a[href] {
- text-decoration : none;
-}
-
-ol.links > li > a {
- display : block;
-}
-
-ol.links a:after {
- -webkit-transform : scale(0.8);
- -webkit-transform-origin : top;
-}
-
-a[href^="http://"]:after, a[href^="https://"]:after {
- content : url(../img/icon_link-external.png);
-}
-
-a[href^="mailto:"]:after { content : url(../img/icon_link-email.png); }
-
-a[href^="sms:"]:after { content : url(../img/icon_link-sms.png); }
-
-a[href^="tel:"]:after { content : url(../img/icon_link-tel.png); }
-
-a[href$=".doc"]:after { content : url(../img/icon_link-doc.png); }
-
-a[href$=".ppt"]:after { content : url(../img/icon_link-ppt.png); }
-
-a[href$=".rss"]:after,
-a[href$=".xml"]:after { content : url(../img/icon_link-rss.png); }
-
-a[href$=".pdf"]:after { content : url(../img/icon_link-pdf.png); }
-
-a[href$=".xls"]:after { content : url(../img/icon_link-xls.png); }
-
-ol.links a:after {
- float : right;
-}
diff --git a/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css b/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css
deleted file mode 100644
index 66b9f03a49..0000000000
--- a/examples/webkit/webkit-guide/css/layout_tbl-keyhole.css
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
-}
-
-.mobile {
- display : block;
-}
-
-.mobile > thead > th,
-.mobile > thead > tr {
- display : none;
-}
-
-.mobile > tbody > tr {
- display : none;
- background : #ffffff;
- padding : 0.5em;
- padding-top : 0.5em;
- border-radius : 0.25em;
-}
-
-.mobile > tbody > tr:target {
- display : block;
- border : medium solid #aaaaaa;
-}
-
-.mobile > tbody > tr:nth-of-type(1) {
- padding-top : 0.5em;
-}
-
-.mobile td {
- display : block;
-}
-
-.mobile td:before {
- font-style : italic;
- font-weight : bold;
-}
-
-.mobile td:nth-of-type(5n+1) {
- font-weight : bold;
- color : #206ead;
-}
-
-.mobile td:nth-of-type(5n+2):before {
- content : 'Price: ';
-}
-.mobile td:nth-of-type(5n+3):before {
- content : 'Location: ';
-}
-.mobile td:nth-of-type(5n+4):before {
- content : 'Posted: ';
-}
-
-table th.nav {
- display : none;
-}
-
-.mobile tbody th.nav {
- display : block;
- width : 36px;
- float : right;
-}
-
-th.nav a {
- display : inline-block;
- width : 36px;
- height : 36px;
- background : #ffffff;
- content : url(../img/icon_nav-up.png);
- margin-bottom : 0.5em;
-}
-
-th.nav a:nth-of-type(even) {
- -webkit-transform : rotate(180deg);
-}
-
-tr:first-of-type th.nav a:nth-of-type(odd),
-tr:last-of-type th.nav a:nth-of-type(even)
-{
- content : url(../img/icon_dismiss.png);
-}
-
-tr th.nav a {
- display : none;
-}
-
-tr:first-of-type th.nav a,
-tr:last-of-type th.nav a,
-tr:target th.nav a {
- display : block;
-}
-
-article {
- background : #ffffff;
- border-radius : 0.5em;
- margin : 0.5em;
- padding : 0.5em;
-}
-
-h1 {
- margin-top : 0.5em;
- text-align : center;
- font-size : 18px;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mob_condjs.css b/examples/webkit/webkit-guide/css/mob_condjs.css
deleted file mode 100644
index 401daa90bb..0000000000
--- a/examples/webkit/webkit-guide/css/mob_condjs.css
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-#js {
- background : pink;
- padding : 0.5em;
- border-radius : 0.5em;
-}
-#js, #design {
- padding : 0.5em;
- border-radius : 0.5em;
-}
-#js {
- background : pink;
-}
-#design {
- background : lightgreen;
-}
diff --git a/examples/webkit/webkit-guide/css/mob_mediaquery.css b/examples/webkit/webkit-guide/css/mob_mediaquery.css
deleted file mode 100644
index 7979f30578..0000000000
--- a/examples/webkit/webkit-guide/css/mob_mediaquery.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-#design {
- padding : 0.5em;
- border-radius : 0.5em;
- background : lightgreen;
-}
-
-#design {
- background : lightgreen;
-}
diff --git a/examples/webkit/webkit-guide/css/mobile.css b/examples/webkit/webkit-guide/css/mobile.css
deleted file mode 100644
index dd162f9633..0000000000
--- a/examples/webkit/webkit-guide/css/mobile.css
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- width : 100;
-}
-
-body > section {
- border-radius : 1em;
- background : #ffffff;
- border-radius : 1em;
- padding : 1em;
- background : #ffffff;
- min-height : 70%
-}
-
-.hidden {
- display : none;
-}
-
-.active {
- color : blue;
- cursor : pointer;
- text-decoration : none;
-}
-
-.nav > a {
- display : inline-block;
- width : 48px;
- height : 48px;
-}
-
-h1, h2 {
- margin-top : 1em;
- font-size : smaller;
- text-align : center;
- padding-top : 1em;
-}
-
-h2 {
- border-top : solid thin #dddddd;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mq_desktop.css b/examples/webkit/webkit-guide/css/mq_desktop.css
deleted file mode 100644
index 4438d74ccb..0000000000
--- a/examples/webkit/webkit-guide/css/mq_desktop.css
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-#design:before {
- content : "CSS thinks you are viewing this page with a full desktop browser."
-}
-
diff --git a/examples/webkit/webkit-guide/css/mq_mobile.css b/examples/webkit/webkit-guide/css/mq_mobile.css
deleted file mode 100644
index 91a6872b43..0000000000
--- a/examples/webkit/webkit-guide/css/mq_mobile.css
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-#design:before {
- content : "CSS thinks you are viewing this page with a non-touch mobile browser."
-}
diff --git a/examples/webkit/webkit-guide/css/mq_touch.css b/examples/webkit/webkit-guide/css/mq_touch.css
deleted file mode 100644
index 3dec1f67b6..0000000000
--- a/examples/webkit/webkit-guide/css/mq_touch.css
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background : #aaaaaa;
- font-family : sans-serif;
- font-weight : bold;
-}
-
-h1,h2,h3,h4 {
- text-align : center;
-}
-
-section {
- position : absolute;
- top : 0;
- left : 0;
- right : 0;
- bottom : 0;
-}
-
-article {
- background : #ffffff;
- border-radius : 1.0em;
- padding : 1.0em;
- margin : 1em;
- min-height : 50%;
-}
-
-#design:before {
- content : "CSS thinks you are viewing this page with a touch-based mobile browser."
-}
diff --git a/examples/webkit/webkit-guide/css/mqlayout_desktop.css b/examples/webkit/webkit-guide/css/mqlayout_desktop.css
deleted file mode 100644
index aff0d7f350..0000000000
--- a/examples/webkit/webkit-guide/css/mqlayout_desktop.css
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-/* Desktop UI */
-
-body {
- font-family : sans-serif;
- font-weight : bold;
- min-width : 60em;
-}
-
-nav, body > section, header, footer {
- border-radius : 0.5em;
- padding : 0.5em;
-}
-
-nav, section {
- min-height : 30em;
-}
-
-header {
- background-color : pink;
- height : 3em;
- margin-bottom : 1em;
-}
-
-section#main {
- background-color : lightgreen;
- float : left;
- margin-bottom : 1em;
- margin-left : 2%;
- min-width : 60%;
-}
-
-nav {
- background-color : lightblue;
- float : left;
- margin-bottom : 1em;
- width : 15%;
-}
-
-section#sidebar {
- background-color : plum;
- float : left;
- margin-bottom : 1em;
- margin-left : 2%;
- width : 15%;
-}
-
-footer {
- background-color : gold;
- clear : both;
- height : 3em;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mqlayout_mobile.css b/examples/webkit/webkit-guide/css/mqlayout_mobile.css
deleted file mode 100644
index db49f8050d..0000000000
--- a/examples/webkit/webkit-guide/css/mqlayout_mobile.css
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-/* Mobile UI */
-
-body {
- font-family : sans-serif;
- font-weight : bold;
-}
-
-nav, body > section, header, footer {
- padding : 0.5em;
-}
-
-header {
- display : none;
-}
-
-section#main {
- background-color : lightgreen;
- margin-bottom : 1em;
-}
-
-nav:after {
- float : right;
- content : '[ICON]';
-}
-
-nav:before {
- content : 'SIMPLE ';
-}
-
-nav {
- background-color : lightblue;
- margin-bottom : 1em;
-}
-
-section#sidebar {
- display : none;
-}
-
-footer {
- background-color : gold;
-}
-
diff --git a/examples/webkit/webkit-guide/css/mqlayout_touch.css b/examples/webkit/webkit-guide/css/mqlayout_touch.css
deleted file mode 100644
index c98e40c1ad..0000000000
--- a/examples/webkit/webkit-guide/css/mqlayout_touch.css
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-/* Touch UI */
-
-body {
- font-family : sans-serif;
- font-weight : bold;
-}
-
-nav, body > section, header, footer {
- border-radius : 0.5em;
- padding : 0.5em;
-}
-
-header {
- background-color : pink;
- margin-bottom : 1em;
- float : left;
- width : 30%;
- height : 3em;
-}
-
-section#main {
- background-color : lightgreen;
- margin-bottom : 1em;
- min-height : 20em;
-}
-
-nav:before {
- content : 'TOUCH ';
-}
-
-nav {
- background-color : lightblue;
- margin-bottom : 1em;
- margin-left : 40%;
- max-width : 60%;
- height : 3em;
-}
-
-section#sidebar {
- display : none;
-}
-
-footer {
- background-color : gold;
-}
-
diff --git a/examples/webkit/webkit-guide/css/storage.css b/examples/webkit/webkit-guide/css/storage.css
deleted file mode 100644
index 5984512043..0000000000
--- a/examples/webkit/webkit-guide/css/storage.css
+++ /dev/null
@@ -1,156 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-body {
- background-color : #aaaaaa;
- font-family : sans-serif;
- padding: 1em;
-}
-
-body.off > h1 {
- background-color : pink;
- background-image : url(../img/offline.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff))
-;
-}
-
-body.on > h1 {
- background-color : lightgreen;
- background-image : url(../img/online.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff))
-;
-}
-
-body.unknown > h1 {
- background-image : url(../img/offline_idle.png), -webkit-gradient(linear,center top,center bottom,from(#ffffff),to(#ffffff));
-}
-
-
-h1 {
- background-color : #ffffff;
- background-repeat : no-repeat;
- background-position : 0.5em center, 0 0;
- height : 1.25em;
- border-radius : 0.5em;
- margin : 0.0em;
- padding : 0.5em;
- text-align : center;
- font-size : 18px;
-}
-
-form.show {
- display : block;
- z-index : 99;
-}
-
-form.hide {
- display : none;
-}
-
-#cred {
- background : #ffffff;
- padding : 1em;
- border-radius : 1.0em;
- position : absolute;
- left : 1.0em;;
- right : 1.0em;;
- top : 1.0em;;
- bottom : 1.0em;;
-}
-
-#cred > input, #email > input {
- height : 2.0em;
- width : 95%;
- border-radius : 0.5em;
- padding-left : 0.5em;
-}
-
-#cred > img {
- float : right;
-}
-
-#cred > div:first-of-type {
- margin-top : 2em;
-}
-
-#cred > div, #email > div {
- font-weight : bold;
- margin : 0.5em;
-}
-
-#cred > input[type='submit'] {
- background : lightgreen;
- font-weight : bold;
-}
-
-#cred > input[type='submit']:active {
- background : #777777;
- color : #ffffff;
-}
-
-#cred > input.validate:invalid {
- background : pink;
-}
-
-#cred > input.validate:invalid:after {
- content : "need!";
-}
-
-#cred > input {
- background : #ffffff;
- -webkit-transition : all 1s linear;
-}
-
-#openform {
- float : right;
-}
-
-#email {
- background : #ffffff;
- min-height : 6em;
- margin-top : 1em;
- border-radius : 0.5em;
- padding : 0.5em;
-}
-
-textarea {
- min-height : 10em;
- width : 95%;
- border-radius : 0.5em;
-}
-
diff --git a/examples/webkit/webkit-guide/css3_backgrounds.htm b/examples/webkit/webkit-guide/css3_backgrounds.htm
deleted file mode 100644
index 3d85c68af8..0000000000
--- a/examples/webkit/webkit-guide/css3_backgrounds.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Accordion Tabs</title>
-<link href='css/css3_backgrounds.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<h3>Accordion Tabs</h3>
-<dl class="accordion">
-<dt>Option 1</dt>
-<dd>
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
-minim veniam, quis nostrud exercitation ullamco laboris nisi ut
-aliquip ex ea commodo consequat.
-</dd>
-<dt>Option 2</dt>
-<dd>
-Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
-nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,
-consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
-labore et dolore magna aliqua.
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
-minim veniam, quis nostrud exercitation ullamco laboris nisi ut
-aliquip ex ea commodo consequat.
-</dd>
-<dt>Option 3</dt>
-<dd>
-Lorem ipsum dolor sit amet, quis nostrud exercitation ullamco laboris
-nisi ut aliquip ex ea commodo consequat.
-</dd>
-<dt>Option 4</dt>
-<dd>
-Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore
-et dolore magna aliqua. Ut enim ad minim veniam, consectetur
-adipisicing elit, quis nostrud exercitation ullamco laboris nisi ut
-aliquip ex ea commodo consequat. Consectetur adipisicing elit, ut
-enim ad minim veniam, sed do eiusmod tempor incididunt ut labore et
-dolore magna aliqua.
-</dd>
-</dl>
-<script src="js/css3_backgrounds.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
-
diff --git a/examples/webkit/webkit-guide/css3_border-img.htm b/examples/webkit/webkit-guide/css3_border-img.htm
deleted file mode 100644
index 64ab267790..0000000000
--- a/examples/webkit/webkit-guide/css3_border-img.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>border-image</title>
-<link href='css/css3_border-img.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>border-image</h3>
-
-<p>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante.
-</p>
-
-<div class="fruit">
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.
-
-</div>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque.
-</p>
-
-</article>
-</section>
-<script src="js/css3_border-img.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_grad-radial.htm b/examples/webkit/webkit-guide/css3_grad-radial.htm
deleted file mode 100644
index ff6fdfefb7..0000000000
--- a/examples/webkit/webkit-guide/css3_grad-radial.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Radial Gradient</title>
-<link href='css/css3_grad-radial.css' type='text/css' rel='stylesheet'/>
-<style id="localStyles"></style>
-</head>
-<body>
-<section>
-<article id="main">
-<h3>Radial Gradient</h3>
-
-Touch within the main content area.
-
-</article>
-</section>
-<script src="js/css3_grad-radial.js">
-</script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientBack.htm b/examples/webkit/webkit-guide/css3_gradientBack.htm
deleted file mode 100644
index c7166ec780..0000000000
--- a/examples/webkit/webkit-guide/css3_gradientBack.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Background Gradient</title>
-<link href='css/css3_gradientBack.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h4>Background Gradient</h4>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientBackStop.htm b/examples/webkit/webkit-guide/css3_gradientBackStop.htm
deleted file mode 100644
index ece3cdf757..0000000000
--- a/examples/webkit/webkit-guide/css3_gradientBackStop.htm
+++ /dev/null
@@ -1,93 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Background Gradient + stop-color</title>
-<link href='css/css3_gradientBackStop.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h4>Background Gradient<br/>with stop-color</h4>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p><p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_gradientButton.htm b/examples/webkit/webkit-guide/css3_gradientButton.htm
deleted file mode 100644
index 39e5ff907c..0000000000
--- a/examples/webkit/webkit-guide/css3_gradientButton.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Beveled Buttons</title>
-<link href='css/css3_gradientButton.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<article>
-<h3>Beveled Buttons</h3>
-<ul>
-<li><a href="#">Option 1</a></li>
-<li><a href="#">Option 2</a></li>
-<li><a href="#">Option 3</a></li>
-<li><a href="#">Option 4</a></li>
-<li><a href="#">Option 5</a></li>
-<li><a href="#">Option 6</a></li>
-<li><a href="#">Option 7</a></li>
-<li><a href="#">Option 8</a></li>
-<li><a href="#">Option 9</a></li>
-</ul>
-<p>&nbsp;</p>
-
-</article>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_mask-grad.htm b/examples/webkit/webkit-guide/css3_mask-grad.htm
deleted file mode 100644
index 4a5b7779b1..0000000000
--- a/examples/webkit/webkit-guide/css3_mask-grad.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Webkit Masks</title>
-<link href='css/css3_mask-grad.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Webkit Masks</h3>
-
-<img src="img/tnail_gal1.png"/>
-<img src="img/tnail_gal2.png"/>
-<img src="img/tnail_gal3.png"/>
-<img src="img/tnail_gal4.png"/>
-<img src="img/tnail_gal5.png"/>
-<img src="img/tnail_gal6.png"/>
-<img src="img/tnail_gal7.png"/>
-<img src="img/tnail_gal8.png"/>
-
-</article>
-</section>
-<script src="js/css3_mask-grad.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_mask-img.htm b/examples/webkit/webkit-guide/css3_mask-img.htm
deleted file mode 100644
index dd48b7b1fe..0000000000
--- a/examples/webkit/webkit-guide/css3_mask-img.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Webkit Masks</title>
-<link href='css/css3_mask-img.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<img src="img/gal3.jpg" width="240" height="360"/>
-</article>
-</section>
-<script src="js/css3_mask-img.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_multicol.htm b/examples/webkit/webkit-guide/css3_multicol.htm
deleted file mode 100644
index 56bf22d3d1..0000000000
--- a/examples/webkit/webkit-guide/css3_multicol.htm
+++ /dev/null
@@ -1,92 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Animated Banners</title>
-<link href='css/css3_multicol.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Animated Banners</h3>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-
-</article>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-<br/>
-</section>
-
-<nav class="ad">
-<a href="#">Item #1</a><a href="#">Item #2</a><a href="#">Item #3</a><a href="#">Item #4</a><a href="#">Item #5</a>
-</nav>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_reflect.htm b/examples/webkit/webkit-guide/css3_reflect.htm
deleted file mode 100644
index 39b5f77d32..0000000000
--- a/examples/webkit/webkit-guide/css3_reflect.htm
+++ /dev/null
@@ -1,101 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Webkit Reflections</title>
-<link href='css/css3_reflect.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="main">
-<article>
-<h1>Webkit Reflections</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque.
-</p>
-
-<figure>
-<img src="img/land5.jpg">
-</figure>
-
-<p>Aliquam erat volutpat. Mauris tempor, urna at dignissim
-pellentesque, velit lacus dictum sem, non porttitor felis nulla nec
-risus. Donec a massa felis, a congue purus. Nullam et turpis
-diam. Aenean vestibulum egestas metus, eu sodales dolor venenatis
-quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</p>
-
-<h2>Webkit Reflections</h2>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-<h3>Webkit Reflections</h3>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_scroll.htm b/examples/webkit/webkit-guide/css3_scroll.htm
deleted file mode 100644
index c56707e853..0000000000
--- a/examples/webkit/webkit-guide/css3_scroll.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Custom Scrollbars</title>
-<link href='css/css3_scroll.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Custom Scrollbars</h3>
-
-<p>
-Unlike standard text, linebreaks cannot appear arbitrarily within
-blocks of code. Wide lines may be difficult to read within a
-narrow-screen mobile interface:
-</p>
-
-<pre>
-window.onload = function() {
- var aside = document.querySelector('#related');
- document.querySelector('#main').addEventListener('mouseup', function(event){
- var thresholdDec = 0.5;
- var totalHeight = event.currentTarget.scrollHeight;
- var tapHeight = event.layerY;
- var tapHeightDec = tapHeight / totalHeight;
- var minHeight = 360;
- if ( tapHeight < minHeight ) aside.className = '';
- if (tapHeightDec > thresholdDec ) {
- aside.className = 'visible';
- }
- else {
- aside.className = '';
- }
- });
-};
-</pre>
-
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-
-</article>
-</section>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_sel-nth.htm b/examples/webkit/webkit-guide/css3_sel-nth.htm
deleted file mode 100644
index 05e6bba340..0000000000
--- a/examples/webkit/webkit-guide/css3_sel-nth.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>CSS-only Grid Layout</title>
-<link href='css/css3_sel-nth.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-
-<img src="img/ic_ag_048.png"/>
-<img src="img/ic_al_048.png"/>
-<img src="img/ic_ar_048.png"/>
-<img src="img/ic_be_048.png"/>
-<img src="img/ic_b_048.png"/>
-<img src="img/ic_ca_048.png"/>
-<img src="img/ic_cl_048.png"/>
-<img src="img/ic_cu_048.png"/>
-<img src="img/ic_c_048.png"/>
-<img src="img/ic_fe_048.png"/>
-<img src="img/ic_f_048.png"/>
-<img src="img/ic_he_048.png"/>
-<img src="img/ic_h_048.png"/>
-<img src="img/ic_k_048.png"/>
-<img src="img/ic_li_048.png"/>
-<img src="img/ic_mg_048.png"/>
-<img src="img/ic_na_048.png"/>
-<img src="img/ic_ne_048.png"/>
-<img src="img/ic_ni_048.png"/>
-<img src="img/ic_n_048.png"/>
-<img src="img/ic_o_048.png"/>
-<img src="img/ic_pt_048.png"/>
-<img src="img/ic_si_048.png"/>
-<img src="img/ic_zn_048.png"/>
-
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_shadow.htm b/examples/webkit/webkit-guide/css3_shadow.htm
deleted file mode 100644
index 85547e38b1..0000000000
--- a/examples/webkit/webkit-guide/css3_shadow.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Navigation Icon Feedback</title>
-<link href='css/css3_shadow.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section class="nav">
-<nav>
-<a class="nav1" href="#"></a>
-<a class="nav2" href="#"></a>
-<a class="nav3" href="#"></a>
-<a class="nav4" href="#"></a>
-<a class="nav5" href="#"></a>
-<a class="nav6" href="#"></a>
-<span id="force_justify">&nbsp;</span>
-</nav>
-</section>
-<section class="main">
-<article>
-<h1>Navigation Icon Feedback</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl. Aenean elementum arcu
-sed nibh faucibus pellentesque. Aliquam erat volutpat. Mauris tempor,
-urna at dignissim pellentesque, velit lacus dictum sem, non porttitor
-felis nulla nec risus. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_text-overflow.htm b/examples/webkit/webkit-guide/css3_text-overflow.htm
deleted file mode 100644
index 7307b6536d..0000000000
--- a/examples/webkit/webkit-guide/css3_text-overflow.htm
+++ /dev/null
@@ -1,118 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>text-overflow</title>
-<link href='css/css3_text-overflow.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>text-overflow</h3>
-
-<ul class="accordion">
-<li id="l1">
-<div class="dismiss"></div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus. Mauris tempor, urna at dignissim pellentesque, velit lacus
-dictum sem, non porttitor felis nulla nec risus.
-</li>
-<li id="l2">
-<div class="dismiss"></div>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
-id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
-faucibus pellentesque. Aliquam erat volutpat. Donec a massa felis, a
-congue purus. Nullam et turpis diam. Aenean vestibulum egestas metus,
-eu sodales dolor venenatis quis. Aenean augue orci, facilisis et
-convallis ut, egestas at neque.
-</li>
-<li id="l3">
-<div class="dismiss"></div>
-Donec a massa felis, a congue purus. Nullam et turpis diam. Aenean
-vestibulum egestas metus, eu sodales dolor venenatis quis. Aenean
-augue orci, facilisis et convallis ut, egestas at neque. Lorem ipsum
-dolor sit amet, consectetur adipiscing elit. Donec feugiat gravida
-viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus ac
-tellus.
-</li>
-<li id="l4">
-<div class="dismiss"></div>
-Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
-Aenean augue orci, facilisis et convallis ut, egestas at neque.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Donec a massa felis, a congue purus.
-</li>
-<li id="l5">
-<div class="dismiss"></div>
-Nullam et turpis diam. Vivamus ipsum felis, cursus sed venenatis nec,
-tempus ac tellus. Lorem ipsum dolor sit amet, consectetur adipiscing
-elit. Donec a massa felis, a congue purus. Aenean vestibulum egestas
-metus, eu sodales dolor venenatis quis. Donec feugiat gravida
-viverra. Praesent luctus, risus eu vestibulum mollis, arcu mauris
-mollis ante, id mollis risus lectus ornare nisl.
-</li>
-<li id="l6">
-<div class="dismiss"></div>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.
-Aenean elementum arcu sed nibh faucibus pellentesque. Aliquam erat
-volutpat.
-Donec a massa felis, a congue purus.
-Aenean vestibulum egestas metus, eu sodales dolor venenatis quis.
-</li>
-<li id="l7">
-<div class="dismiss"></div>
-Donec feugiat gravida viverra. Praesent luctus, risus eu vestibulum
-mollis, arcu mauris mollis ante, id mollis risus lectus ornare nisl.
-Aliquam erat volutpat. Nullam et turpis diam. Aenean augue orci,
-facilisis et convallis ut, egestas at neque.
-</li>
-</ul>
-
-</article>
-</section>
-<script src="js/css3_text-overflow.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_text-shadow.htm b/examples/webkit/webkit-guide/css3_text-shadow.htm
deleted file mode 100644
index 2fa10d2e32..0000000000
--- a/examples/webkit/webkit-guide/css3_text-shadow.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Text Shadow</title>
-<link href='css/css3_text-shadow.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h1>Text Shadow</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.
-</p>
-<h2>Subhead</h2>
-<p>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
-id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
-faucibus pellentesque. Aliquam erat volutpat. Mauris tempor, urna at
-dignissim pellentesque, velit lacus dictum sem, non porttitor felis
-nulla nec risus. Donec a massa felis, a congue purus. Nullam et turpis
-diam.
-</p>
-<h3>Subhead</h3>
-<p>
-Aenean vestibulum egestas metus, eu sodales dolor venenatis
-quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/css3_text-stroke.htm b/examples/webkit/webkit-guide/css3_text-stroke.htm
deleted file mode 100644
index 9f8af0e055..0000000000
--- a/examples/webkit/webkit-guide/css3_text-stroke.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Text Stroke</title>
-<link href='css/css3_text-stroke.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h1>Text Stroke</h1>
-<p>
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.
-</p>
-<h2>Subhead</h2>
-<p>
-Praesent luctus, risus eu vestibulum mollis, arcu mauris mollis ante,
-id mollis risus lectus ornare nisl. Aenean elementum arcu sed nibh
-faucibus pellentesque. Aliquam erat volutpat. Mauris tempor, urna at
-dignissim pellentesque, velit lacus dictum sem, non porttitor felis
-nulla nec risus. Donec a massa felis, a congue purus. Nullam et turpis
-diam.
-</p>
-<h3>Subhead</h3>
-<p>
-Aenean vestibulum egestas metus, eu sodales dolor venenatis
-quis. Aenean augue orci, facilisis et convallis ut, egestas at neque.
-</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/form_tapper.htm b/examples/webkit/webkit-guide/form_tapper.htm
deleted file mode 100644
index cf755a59f6..0000000000
--- a/examples/webkit/webkit-guide/form_tapper.htm
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>CSS-only Tap Button Inputs</title>
-<link href='css/form_tapper.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<h1>CSS-only Tap Button Inputs</h1>
-<form>
-<h2>radio</h2>
-<input type="radio" name="radio_basic" value="one"/>
-<label>Option One</label>
-<br/>
-<input type="radio" name="radio_basic" value="two"/>
-<label>Option Two</label>
-<br/>
-<input type="radio" name="radio_basic" value="three"/>
-<label>Option Three</label>
-<h2>checkbox</h2>
-<input type="checkbox" name="checkbox_basic" value="one"/>
-<label>Option One</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="two"/>
-<label>Option Two</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="three"/>
-<label>Option Three</label>
-</form>
-</section>
-<script src="js/form_tapper.js"></script>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/form_toggler.htm b/examples/webkit/webkit-guide/form_toggler.htm
deleted file mode 100644
index 113f450425..0000000000
--- a/examples/webkit/webkit-guide/form_toggler.htm
+++ /dev/null
@@ -1,141 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>CSS-only Toggle Button Inputs</title>
-<link href='css/form_toggler.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<h1>CSS-only Toggle Button Inputs</h1>
-<form>
-<h2>radio (default)</h2>
-<label>Option One</label>
-<input type="radio" name="radio_basic" value="one"/>
-<br/>
-<label>Option Two</label>
-<input type="radio" name="radio_basic" value="two"/>
-<br/>
-<label>Option Three</label>
-<input type="radio" name="radio_basic" value="three"/>
-<h2>checkbox (default)</h2>
-<input type="checkbox" name="checkbox_basic" value="one"/>
-<label>Option One</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="two"/>
-<label>Option Two</label>
-<br/>
-<input type="checkbox" name="checkbox_basic" value="three"/>
-<label>Option Three</label>
-<h2>radio class="invert"</h2>
-<label>Option One</label>
-<input class="invert" type="radio" name="radio_invert" value="one"/>
-<br/>
-<label>Option Two</label>
-<input class="invert" type="radio" name="radio_invert" value="two"/>
-<br/>
-<label>Option Three</label>
-<input class="invert" type="radio" name="radio_invert" value="three"/>
-<h2>checkbox class="invert"</h2>
-<input class="invert" type="checkbox" name="checkbox_invert" value="one"/>
-<label>Option One</label>
-<br/>
-<input class="invert" type="checkbox" name="checkbox_invert" value="two"/>
-<label>Option Two</label>
-<br/>
-<input class="invert" type="checkbox" name="checkbox_invert" value="three"/>
-<label>Option Three</label>
-<h2>radio class="yn"</h2>
-<label>Option One</label>
-<input class="yn" type="radio" name="radio_yn" value="one"/>
-<br/>
-<label>Option Two</label>
-<input class="yn" type="radio" name="radio_yn" value="two"/>
-<br/>
-<label>Option Three</label>
-<input class="yn" type="radio" name="radio_yn" value="three"/>
-<h2>checkbox class="yn"</h2>
-<input class="yn" type="checkbox" name="checkbox_yn" value="one"/>
-<label>Option One</label>
-<br/>
-<input class="yn" type="checkbox" name="checkbox_yn" value="two"/>
-<label>Option Two</label>
-<br/>
-<input class="yn" type="checkbox" name="checkbox_yn" value="three"/>
-<label>Option Three</label>
-<h2>radio class="tf"</h2>
-<label>Option One</label>
-<input class="tf" type="radio" name="radio_tf" value="one"/>
-<br/>
-<label>Option Two</label>
-<input class="tf" type="radio" name="radio_tf" value="two"/>
-<br/>
-<label>Option Three</label>
-<input class="tf" type="radio" name="radio_tf" value="three"/>
-<h2>checkbox class="tf"</h2>
-<input class="tf" type="checkbox" name="checkbox_tf" value="one"/>
-<label>Option One</label>
-<br/>
-<input class="tf" type="checkbox" name="checkbox_tf" value="two"/>
-<label>Option Two</label>
-<br/>
-<input class="tf" type="checkbox" name="checkbox_tf" value="three"/>
-<label>Option Three</label>
-<h2>radio class="binary"</h2>
-<label>Time of Day</label>
-<input class="binary ampm" type="radio" name="radio_binary" value="am"/>
-<input class="binary ampm" type="radio" name="radio_binary" value="pm" checked/>
-<br/>
-<label>Sex</label>
-<input class="binary sex" type="radio" name="radio_sex" value="male" checked/>
-<input class="binary sex" type="radio" name="radio_sex" value="female"/>
-<br/>
-<br/>
-<p>(These use custom button values)</p>
-<br/>
-<br/>
-</form>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/img/border-frame.png b/examples/webkit/webkit-guide/img/border-frame.png
deleted file mode 100644
index 7a0894cabc..0000000000
--- a/examples/webkit/webkit-guide/img/border-frame.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal1.jpg b/examples/webkit/webkit-guide/img/gal1.jpg
deleted file mode 100644
index 8f9edcb2ca..0000000000
--- a/examples/webkit/webkit-guide/img/gal1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal2.jpg b/examples/webkit/webkit-guide/img/gal2.jpg
deleted file mode 100644
index a2301ef22f..0000000000
--- a/examples/webkit/webkit-guide/img/gal2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal3.jpg b/examples/webkit/webkit-guide/img/gal3.jpg
deleted file mode 100644
index a768530a8c..0000000000
--- a/examples/webkit/webkit-guide/img/gal3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal4.jpg b/examples/webkit/webkit-guide/img/gal4.jpg
deleted file mode 100644
index 96c00015c0..0000000000
--- a/examples/webkit/webkit-guide/img/gal4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal5.jpg b/examples/webkit/webkit-guide/img/gal5.jpg
deleted file mode 100644
index 6ec78fc43a..0000000000
--- a/examples/webkit/webkit-guide/img/gal5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal6.jpg b/examples/webkit/webkit-guide/img/gal6.jpg
deleted file mode 100644
index 25eb95cb22..0000000000
--- a/examples/webkit/webkit-guide/img/gal6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal7.jpg b/examples/webkit/webkit-guide/img/gal7.jpg
deleted file mode 100644
index b9fda2fb9d..0000000000
--- a/examples/webkit/webkit-guide/img/gal7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gal8.jpg b/examples/webkit/webkit-guide/img/gal8.jpg
deleted file mode 100644
index c23e2260c3..0000000000
--- a/examples/webkit/webkit-guide/img/gal8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gradient.jpg b/examples/webkit/webkit-guide/img/gradient.jpg
deleted file mode 100644
index 014386e275..0000000000
--- a/examples/webkit/webkit-guide/img/gradient.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/gray_icon_close.png b/examples/webkit/webkit-guide/img/gray_icon_close.png
deleted file mode 100644
index 8e7450153e..0000000000
--- a/examples/webkit/webkit-guide/img/gray_icon_close.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_016.png b/examples/webkit/webkit-guide/img/ic_ag_016.png
deleted file mode 100644
index bb961cb393..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_032.png b/examples/webkit/webkit-guide/img/ic_ag_032.png
deleted file mode 100644
index edb051f50e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_036.png b/examples/webkit/webkit-guide/img/ic_ag_036.png
deleted file mode 100644
index e555e92071..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ag_048.png b/examples/webkit/webkit-guide/img/ic_ag_048.png
deleted file mode 100644
index d2d417da2e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ag_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_016.png b/examples/webkit/webkit-guide/img/ic_al_016.png
deleted file mode 100644
index 0f1c0240fb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_032.png b/examples/webkit/webkit-guide/img/ic_al_032.png
deleted file mode 100644
index 5727a5104e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_036.png b/examples/webkit/webkit-guide/img/ic_al_036.png
deleted file mode 100644
index 76382779b8..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_al_048.png b/examples/webkit/webkit-guide/img/ic_al_048.png
deleted file mode 100644
index 9671d86944..0000000000
--- a/examples/webkit/webkit-guide/img/ic_al_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_016.png b/examples/webkit/webkit-guide/img/ic_ar_016.png
deleted file mode 100644
index fa91e96dca..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_032.png b/examples/webkit/webkit-guide/img/ic_ar_032.png
deleted file mode 100644
index d899c41fdb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_036.png b/examples/webkit/webkit-guide/img/ic_ar_036.png
deleted file mode 100644
index 836593f4bc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ar_048.png b/examples/webkit/webkit-guide/img/ic_ar_048.png
deleted file mode 100644
index e1c77aca74..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ar_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_016.png b/examples/webkit/webkit-guide/img/ic_b_016.png
deleted file mode 100644
index a0ebdf7964..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_032.png b/examples/webkit/webkit-guide/img/ic_b_032.png
deleted file mode 100644
index f5571f2bb9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_036.png b/examples/webkit/webkit-guide/img/ic_b_036.png
deleted file mode 100644
index 4aff7eb601..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_b_048.png b/examples/webkit/webkit-guide/img/ic_b_048.png
deleted file mode 100644
index b84434cec4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_b_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_016.png b/examples/webkit/webkit-guide/img/ic_be_016.png
deleted file mode 100644
index 0297cd827d..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_032.png b/examples/webkit/webkit-guide/img/ic_be_032.png
deleted file mode 100644
index 5c5b9cd9e1..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_036.png b/examples/webkit/webkit-guide/img/ic_be_036.png
deleted file mode 100644
index 96ec4bb4ca..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_be_048.png b/examples/webkit/webkit-guide/img/ic_be_048.png
deleted file mode 100644
index afcdf183dd..0000000000
--- a/examples/webkit/webkit-guide/img/ic_be_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_016.png b/examples/webkit/webkit-guide/img/ic_c_016.png
deleted file mode 100644
index a3cc4cfadf..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_032.png b/examples/webkit/webkit-guide/img/ic_c_032.png
deleted file mode 100644
index 404babecf1..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_036.png b/examples/webkit/webkit-guide/img/ic_c_036.png
deleted file mode 100644
index 78d71500d9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_c_048.png b/examples/webkit/webkit-guide/img/ic_c_048.png
deleted file mode 100644
index 73462ad394..0000000000
--- a/examples/webkit/webkit-guide/img/ic_c_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_016.png b/examples/webkit/webkit-guide/img/ic_ca_016.png
deleted file mode 100644
index af4c37b0e5..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_032.png b/examples/webkit/webkit-guide/img/ic_ca_032.png
deleted file mode 100644
index 6ac8db4ce6..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_036.png b/examples/webkit/webkit-guide/img/ic_ca_036.png
deleted file mode 100644
index 19988c165d..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ca_048.png b/examples/webkit/webkit-guide/img/ic_ca_048.png
deleted file mode 100644
index 0349061038..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ca_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_016.png b/examples/webkit/webkit-guide/img/ic_cl_016.png
deleted file mode 100644
index e9b421e70c..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_032.png b/examples/webkit/webkit-guide/img/ic_cl_032.png
deleted file mode 100644
index f5968d5dfe..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_036.png b/examples/webkit/webkit-guide/img/ic_cl_036.png
deleted file mode 100644
index 2a6721d780..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cl_048.png b/examples/webkit/webkit-guide/img/ic_cl_048.png
deleted file mode 100644
index f32981fe81..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cl_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_016.png b/examples/webkit/webkit-guide/img/ic_cu_016.png
deleted file mode 100644
index 129f99ffd1..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_032.png b/examples/webkit/webkit-guide/img/ic_cu_032.png
deleted file mode 100644
index a07933ea68..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_036.png b/examples/webkit/webkit-guide/img/ic_cu_036.png
deleted file mode 100644
index 5eb6ed6363..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_cu_048.png b/examples/webkit/webkit-guide/img/ic_cu_048.png
deleted file mode 100644
index f21593cf78..0000000000
--- a/examples/webkit/webkit-guide/img/ic_cu_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_016.png b/examples/webkit/webkit-guide/img/ic_f_016.png
deleted file mode 100644
index ff2e3fb5f4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_032.png b/examples/webkit/webkit-guide/img/ic_f_032.png
deleted file mode 100644
index 3424799317..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_036.png b/examples/webkit/webkit-guide/img/ic_f_036.png
deleted file mode 100644
index 019b7032a6..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_f_048.png b/examples/webkit/webkit-guide/img/ic_f_048.png
deleted file mode 100644
index 567d30310a..0000000000
--- a/examples/webkit/webkit-guide/img/ic_f_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_016.png b/examples/webkit/webkit-guide/img/ic_fe_016.png
deleted file mode 100644
index e6d9b829b9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_032.png b/examples/webkit/webkit-guide/img/ic_fe_032.png
deleted file mode 100644
index f2b4e4b417..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_036.png b/examples/webkit/webkit-guide/img/ic_fe_036.png
deleted file mode 100644
index 2aa81b5fec..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_fe_048.png b/examples/webkit/webkit-guide/img/ic_fe_048.png
deleted file mode 100644
index b6914735d9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_fe_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_016.png b/examples/webkit/webkit-guide/img/ic_h_016.png
deleted file mode 100644
index 957a1ffabe..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_032.png b/examples/webkit/webkit-guide/img/ic_h_032.png
deleted file mode 100644
index 824620d4a2..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_036.png b/examples/webkit/webkit-guide/img/ic_h_036.png
deleted file mode 100644
index fba59a5d27..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_h_048.png b/examples/webkit/webkit-guide/img/ic_h_048.png
deleted file mode 100644
index f75822c3aa..0000000000
--- a/examples/webkit/webkit-guide/img/ic_h_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_016.png b/examples/webkit/webkit-guide/img/ic_he_016.png
deleted file mode 100644
index 33fe83677f..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_032.png b/examples/webkit/webkit-guide/img/ic_he_032.png
deleted file mode 100644
index 425c525b69..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_036.png b/examples/webkit/webkit-guide/img/ic_he_036.png
deleted file mode 100644
index a976aece8b..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_he_048.png b/examples/webkit/webkit-guide/img/ic_he_048.png
deleted file mode 100644
index f8f9d4d853..0000000000
--- a/examples/webkit/webkit-guide/img/ic_he_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_016.png b/examples/webkit/webkit-guide/img/ic_k_016.png
deleted file mode 100644
index 860bd62f96..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_032.png b/examples/webkit/webkit-guide/img/ic_k_032.png
deleted file mode 100644
index a14f2c65e9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_036.png b/examples/webkit/webkit-guide/img/ic_k_036.png
deleted file mode 100644
index 49f19e6df0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_k_048.png b/examples/webkit/webkit-guide/img/ic_k_048.png
deleted file mode 100644
index a7515cd782..0000000000
--- a/examples/webkit/webkit-guide/img/ic_k_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_016.png b/examples/webkit/webkit-guide/img/ic_li_016.png
deleted file mode 100644
index c16d81a4bc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_032.png b/examples/webkit/webkit-guide/img/ic_li_032.png
deleted file mode 100644
index 3a34f37066..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_036.png b/examples/webkit/webkit-guide/img/ic_li_036.png
deleted file mode 100644
index e5b97a7a2e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_li_048.png b/examples/webkit/webkit-guide/img/ic_li_048.png
deleted file mode 100644
index 7b030e4cd7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_li_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_016.png b/examples/webkit/webkit-guide/img/ic_mg_016.png
deleted file mode 100644
index 2606336415..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_032.png b/examples/webkit/webkit-guide/img/ic_mg_032.png
deleted file mode 100644
index 2f9d03e6b0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_036.png b/examples/webkit/webkit-guide/img/ic_mg_036.png
deleted file mode 100644
index 584078db84..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_mg_048.png b/examples/webkit/webkit-guide/img/ic_mg_048.png
deleted file mode 100644
index 8cd2f3acc7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_mg_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_016.png b/examples/webkit/webkit-guide/img/ic_n_016.png
deleted file mode 100644
index 90e8f9fec9..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_032.png b/examples/webkit/webkit-guide/img/ic_n_032.png
deleted file mode 100644
index afeb47a105..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_036.png b/examples/webkit/webkit-guide/img/ic_n_036.png
deleted file mode 100644
index 0b7a11deed..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_n_048.png b/examples/webkit/webkit-guide/img/ic_n_048.png
deleted file mode 100644
index c0d7c0699e..0000000000
--- a/examples/webkit/webkit-guide/img/ic_n_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_016.png b/examples/webkit/webkit-guide/img/ic_na_016.png
deleted file mode 100644
index 7888d0f9c0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_032.png b/examples/webkit/webkit-guide/img/ic_na_032.png
deleted file mode 100644
index 801ddca50b..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_036.png b/examples/webkit/webkit-guide/img/ic_na_036.png
deleted file mode 100644
index a6878d45d7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_na_048.png b/examples/webkit/webkit-guide/img/ic_na_048.png
deleted file mode 100644
index 76adaf479c..0000000000
--- a/examples/webkit/webkit-guide/img/ic_na_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_016.png b/examples/webkit/webkit-guide/img/ic_ne_016.png
deleted file mode 100644
index 64562fc2d5..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_032.png b/examples/webkit/webkit-guide/img/ic_ne_032.png
deleted file mode 100644
index fab5cd8fcb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_036.png b/examples/webkit/webkit-guide/img/ic_ne_036.png
deleted file mode 100644
index 41092bf3e7..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ne_048.png b/examples/webkit/webkit-guide/img/ic_ne_048.png
deleted file mode 100644
index 4ec0db0806..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ne_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_016.png b/examples/webkit/webkit-guide/img/ic_ni_016.png
deleted file mode 100644
index 9b88e368a2..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_032.png b/examples/webkit/webkit-guide/img/ic_ni_032.png
deleted file mode 100644
index fc4fcf3ebc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_036.png b/examples/webkit/webkit-guide/img/ic_ni_036.png
deleted file mode 100644
index 9d527470bb..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_ni_048.png b/examples/webkit/webkit-guide/img/ic_ni_048.png
deleted file mode 100644
index b563c50361..0000000000
--- a/examples/webkit/webkit-guide/img/ic_ni_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_016.png b/examples/webkit/webkit-guide/img/ic_o_016.png
deleted file mode 100644
index a95460d457..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_032.png b/examples/webkit/webkit-guide/img/ic_o_032.png
deleted file mode 100644
index 1d4864dded..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_036.png b/examples/webkit/webkit-guide/img/ic_o_036.png
deleted file mode 100644
index 7f5dd02ed2..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_o_048.png b/examples/webkit/webkit-guide/img/ic_o_048.png
deleted file mode 100644
index 7461a8e9e4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_o_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_016.png b/examples/webkit/webkit-guide/img/ic_pt_016.png
deleted file mode 100644
index 513eb97a30..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_032.png b/examples/webkit/webkit-guide/img/ic_pt_032.png
deleted file mode 100644
index 1550c399c8..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_036.png b/examples/webkit/webkit-guide/img/ic_pt_036.png
deleted file mode 100644
index 7eec4d0ce4..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_pt_048.png b/examples/webkit/webkit-guide/img/ic_pt_048.png
deleted file mode 100644
index 50dece6610..0000000000
--- a/examples/webkit/webkit-guide/img/ic_pt_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_016.png b/examples/webkit/webkit-guide/img/ic_si_016.png
deleted file mode 100644
index e639b683ae..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_032.png b/examples/webkit/webkit-guide/img/ic_si_032.png
deleted file mode 100644
index 8657e6276f..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_036.png b/examples/webkit/webkit-guide/img/ic_si_036.png
deleted file mode 100644
index ffe0ee27fc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_si_048.png b/examples/webkit/webkit-guide/img/ic_si_048.png
deleted file mode 100644
index 5b9400dbdc..0000000000
--- a/examples/webkit/webkit-guide/img/ic_si_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_016.png b/examples/webkit/webkit-guide/img/ic_zn_016.png
deleted file mode 100644
index 11e5705130..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_016.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_032.png b/examples/webkit/webkit-guide/img/ic_zn_032.png
deleted file mode 100644
index cb78a5c139..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_032.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_036.png b/examples/webkit/webkit-guide/img/ic_zn_036.png
deleted file mode 100644
index 66abffd40d..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_036.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/ic_zn_048.png b/examples/webkit/webkit-guide/img/ic_zn_048.png
deleted file mode 100644
index d8361ad6c0..0000000000
--- a/examples/webkit/webkit-guide/img/ic_zn_048.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_check.png b/examples/webkit/webkit-guide/img/icon_check.png
deleted file mode 100644
index 294b62d24d..0000000000
--- a/examples/webkit/webkit-guide/img/icon_check.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_check_x24green.png b/examples/webkit/webkit-guide/img/icon_check_x24green.png
deleted file mode 100644
index 803928c231..0000000000
--- a/examples/webkit/webkit-guide/img/icon_check_x24green.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_dismiss.png b/examples/webkit/webkit-guide/img/icon_dismiss.png
deleted file mode 100644
index e7a842640a..0000000000
--- a/examples/webkit/webkit-guide/img/icon_dismiss.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_dismiss_x22.png b/examples/webkit/webkit-guide/img/icon_dismiss_x22.png
deleted file mode 100644
index e52a62a598..0000000000
--- a/examples/webkit/webkit-guide/img/icon_dismiss_x22.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-down.png b/examples/webkit/webkit-guide/img/icon_drill-down.png
deleted file mode 100644
index 7928c6e59e..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-down.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-down_x32.png b/examples/webkit/webkit-guide/img/icon_drill-down_x32.png
deleted file mode 100644
index 477d7cda0d..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-down_x32.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-up.png b/examples/webkit/webkit-guide/img/icon_drill-up.png
deleted file mode 100644
index ff7594054d..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-up.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_drill-up_x32.png b/examples/webkit/webkit-guide/img/icon_drill-up_x32.png
deleted file mode 100644
index d63fe083a1..0000000000
--- a/examples/webkit/webkit-guide/img/icon_drill-up_x32.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_expand-nav.png b/examples/webkit/webkit-guide/img/icon_expand-nav.png
deleted file mode 100644
index 7ec5aa68d1..0000000000
--- a/examples/webkit/webkit-guide/img/icon_expand-nav.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-collapsed.png b/examples/webkit/webkit-guide/img/icon_head-collapsed.png
deleted file mode 100644
index ed47838b5b..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-collapsed.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png b/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png
deleted file mode 100644
index 6892dc08a6..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-collapsed_x13.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-expanded.png b/examples/webkit/webkit-guide/img/icon_head-expanded.png
deleted file mode 100644
index ee7e0a767a..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-expanded.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png b/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png
deleted file mode 100644
index 40e8eeb4c1..0000000000
--- a/examples/webkit/webkit-guide/img/icon_head-expanded_x13.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_info.png b/examples/webkit/webkit-guide/img/icon_info.png
deleted file mode 100644
index b70c760621..0000000000
--- a/examples/webkit/webkit-guide/img/icon_info.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_info_x24.png b/examples/webkit/webkit-guide/img/icon_info_x24.png
deleted file mode 100644
index 9f4f352c84..0000000000
--- a/examples/webkit/webkit-guide/img/icon_info_x24.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-doc.png b/examples/webkit/webkit-guide/img/icon_link-doc.png
deleted file mode 100644
index fc9bd54e06..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-doc.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-email.png b/examples/webkit/webkit-guide/img/icon_link-email.png
deleted file mode 100644
index ef5f95d318..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-email.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-external.png b/examples/webkit/webkit-guide/img/icon_link-external.png
deleted file mode 100644
index 47ddd807e4..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-external.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-pdf.png b/examples/webkit/webkit-guide/img/icon_link-pdf.png
deleted file mode 100644
index fb90a6a2b9..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-pdf.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-ppt.png b/examples/webkit/webkit-guide/img/icon_link-ppt.png
deleted file mode 100644
index c6a532878c..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-ppt.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-rss.png b/examples/webkit/webkit-guide/img/icon_link-rss.png
deleted file mode 100644
index d3cf2c4916..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-rss.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-sms.png b/examples/webkit/webkit-guide/img/icon_link-sms.png
deleted file mode 100644
index f36de100f8..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-sms.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-tel.png b/examples/webkit/webkit-guide/img/icon_link-tel.png
deleted file mode 100644
index 7b665ee5de..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-tel.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_link-xls.png b/examples/webkit/webkit-guide/img/icon_link-xls.png
deleted file mode 100644
index 977c868eae..0000000000
--- a/examples/webkit/webkit-guide/img/icon_link-xls.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_list-all.png b/examples/webkit/webkit-guide/img/icon_list-all.png
deleted file mode 100644
index 97ce879fb8..0000000000
--- a/examples/webkit/webkit-guide/img/icon_list-all.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_list-all_circ.png b/examples/webkit/webkit-guide/img/icon_list-all_circ.png
deleted file mode 100644
index 6c5828e835..0000000000
--- a/examples/webkit/webkit-guide/img/icon_list-all_circ.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-start.png b/examples/webkit/webkit-guide/img/icon_nav-start.png
deleted file mode 100644
index cbe127fdc9..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav-start.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-top.png b/examples/webkit/webkit-guide/img/icon_nav-top.png
deleted file mode 100644
index d57d3efa11..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav-top.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav-up.png b/examples/webkit/webkit-guide/img/icon_nav-up.png
deleted file mode 100644
index bab32593e3..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav-up.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_nav_end.png b/examples/webkit/webkit-guide/img/icon_nav_end.png
deleted file mode 100644
index 6d7dd319b4..0000000000
--- a/examples/webkit/webkit-guide/img/icon_nav_end.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_question.png b/examples/webkit/webkit-guide/img/icon_question.png
deleted file mode 100644
index 28c2ae1f12..0000000000
--- a/examples/webkit/webkit-guide/img/icon_question.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_scroll-left.png b/examples/webkit/webkit-guide/img/icon_scroll-left.png
deleted file mode 100644
index 38b3c3fa0e..0000000000
--- a/examples/webkit/webkit-guide/img/icon_scroll-left.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_scroll-right.png b/examples/webkit/webkit-guide/img/icon_scroll-right.png
deleted file mode 100644
index 4d6191942b..0000000000
--- a/examples/webkit/webkit-guide/img/icon_scroll-right.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/icon_trash.png b/examples/webkit/webkit-guide/img/icon_trash.png
deleted file mode 100644
index b5f6eaae73..0000000000
--- a/examples/webkit/webkit-guide/img/icon_trash.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land1.jpg b/examples/webkit/webkit-guide/img/land1.jpg
deleted file mode 100644
index 05b11d5393..0000000000
--- a/examples/webkit/webkit-guide/img/land1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land2.jpg b/examples/webkit/webkit-guide/img/land2.jpg
deleted file mode 100644
index 0f504b4106..0000000000
--- a/examples/webkit/webkit-guide/img/land2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land3.jpg b/examples/webkit/webkit-guide/img/land3.jpg
deleted file mode 100644
index fd86c950e8..0000000000
--- a/examples/webkit/webkit-guide/img/land3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land4.jpg b/examples/webkit/webkit-guide/img/land4.jpg
deleted file mode 100644
index bcf33daf7f..0000000000
--- a/examples/webkit/webkit-guide/img/land4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land5.jpg b/examples/webkit/webkit-guide/img/land5.jpg
deleted file mode 100644
index c8d550923d..0000000000
--- a/examples/webkit/webkit-guide/img/land5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land6.jpg b/examples/webkit/webkit-guide/img/land6.jpg
deleted file mode 100644
index 2762864634..0000000000
--- a/examples/webkit/webkit-guide/img/land6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land7.jpg b/examples/webkit/webkit-guide/img/land7.jpg
deleted file mode 100644
index 6ac6d88966..0000000000
--- a/examples/webkit/webkit-guide/img/land7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/land8.jpg b/examples/webkit/webkit-guide/img/land8.jpg
deleted file mode 100644
index 37c51df15e..0000000000
--- a/examples/webkit/webkit-guide/img/land8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/mask.png b/examples/webkit/webkit-guide/img/mask.png
deleted file mode 100644
index f9764b54aa..0000000000
--- a/examples/webkit/webkit-guide/img/mask.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal1.jpg b/examples/webkit/webkit-guide/img/tmp/gal1.jpg
deleted file mode 100644
index 8f9edcb2ca..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal2.jpg b/examples/webkit/webkit-guide/img/tmp/gal2.jpg
deleted file mode 100644
index a2301ef22f..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal3.jpg b/examples/webkit/webkit-guide/img/tmp/gal3.jpg
deleted file mode 100644
index a768530a8c..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal4.jpg b/examples/webkit/webkit-guide/img/tmp/gal4.jpg
deleted file mode 100644
index 96c00015c0..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal5.jpg b/examples/webkit/webkit-guide/img/tmp/gal5.jpg
deleted file mode 100644
index 6ec78fc43a..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal6.jpg b/examples/webkit/webkit-guide/img/tmp/gal6.jpg
deleted file mode 100644
index 25eb95cb22..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal7.jpg b/examples/webkit/webkit-guide/img/tmp/gal7.jpg
deleted file mode 100644
index b9fda2fb9d..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/gal8.jpg b/examples/webkit/webkit-guide/img/tmp/gal8.jpg
deleted file mode 100644
index c23e2260c3..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/gal8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land1.jpg b/examples/webkit/webkit-guide/img/tmp/land1.jpg
deleted file mode 100644
index 05b11d5393..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land2.jpg b/examples/webkit/webkit-guide/img/tmp/land2.jpg
deleted file mode 100644
index 0f504b4106..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land3.jpg b/examples/webkit/webkit-guide/img/tmp/land3.jpg
deleted file mode 100644
index fd86c950e8..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land4.jpg b/examples/webkit/webkit-guide/img/tmp/land4.jpg
deleted file mode 100644
index bcf33daf7f..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land5.jpg b/examples/webkit/webkit-guide/img/tmp/land5.jpg
deleted file mode 100644
index c8d550923d..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land6.jpg b/examples/webkit/webkit-guide/img/tmp/land6.jpg
deleted file mode 100644
index 2762864634..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land7.jpg b/examples/webkit/webkit-guide/img/tmp/land7.jpg
deleted file mode 100644
index 6ac6d88966..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land7.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tmp/land8.jpg b/examples/webkit/webkit-guide/img/tmp/land8.jpg
deleted file mode 100644
index 37c51df15e..0000000000
--- a/examples/webkit/webkit-guide/img/tmp/land8.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal1.png b/examples/webkit/webkit-guide/img/tnail_gal1.png
deleted file mode 100644
index 6c83482e25..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal1.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal2.png b/examples/webkit/webkit-guide/img/tnail_gal2.png
deleted file mode 100644
index f090b68959..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal2.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal3.png b/examples/webkit/webkit-guide/img/tnail_gal3.png
deleted file mode 100644
index 6cc257b490..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal3.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal4.png b/examples/webkit/webkit-guide/img/tnail_gal4.png
deleted file mode 100644
index ae9983ccbc..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal4.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal5.png b/examples/webkit/webkit-guide/img/tnail_gal5.png
deleted file mode 100644
index 58d764c9a9..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal5.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal6.png b/examples/webkit/webkit-guide/img/tnail_gal6.png
deleted file mode 100644
index f5d0b8b657..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal6.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal7.png b/examples/webkit/webkit-guide/img/tnail_gal7.png
deleted file mode 100644
index 8d33ea69f6..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal7.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/img/tnail_gal8.png b/examples/webkit/webkit-guide/img/tnail_gal8.png
deleted file mode 100644
index 61e1431ab5..0000000000
--- a/examples/webkit/webkit-guide/img/tnail_gal8.png
+++ /dev/null
Binary files differ
diff --git a/examples/webkit/webkit-guide/js/anim_accord.js b/examples/webkit/webkit-guide/js/anim_accord.js
deleted file mode 100755
index cc95b7f7c9..0000000000
--- a/examples/webkit/webkit-guide/js/anim_accord.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
-
- initDT();
- document.querySelector('body').addEventListener('click', function(event){
- var dl = document.querySelector('#accordion');
- var ct = event.currentTarget;
- var t = event.target;
- var dt;
- if (t.id == 'accordion' && t.className == 'collapsed') {
- dl.className = 'expanded';
- }
- else if (t.tagName == 'DT' && t.parentNode.id == 'accordion') {
- if ( t.className == 'collapsed' ) {
- t.className = 'expanded';
- }
- else {
- t.className = 'collapsed';
- }
- }
- else {
- dl.className = 'collapsed';
- initDT();
- }
- });
-};
-
-function initDT() {
- var el = nlToAr(document.querySelectorAll('#accordion > dt'));
- el.forEach( function(l){ l.className = 'collapsed'; });
-}
-
-function nlToAr(nl) {
- var a = new Array();
- var l = nl.length;
- var i = l - 1;
- a[i] = true;
- for ( i = 0; i < l ; i++ ) { a[i] = nl[i]; }
- return(a);
-}
diff --git a/examples/webkit/webkit-guide/js/anim_gallery.js b/examples/webkit/webkit-guide/js/anim_gallery.js
deleted file mode 100755
index 050f113bb4..0000000000
--- a/examples/webkit/webkit-guide/js/anim_gallery.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.init = function() {
- var divs = document.querySelectorAll('section > div');
- if ( divs.length < 2 ) return false;
- for (var i = 0, l = divs.length ; i < l ; i++ ) {
- if (i > 1) divs[i].className = 'hideR';
- divs[i].addEventListener('click', app.navigate );
- }
- divs[0].className = 'selected';
- divs[1].className = 'queueR';
-};
-
-app.navigate = function(event) {
- var el, n1, n2, p1, p2;
- el = event.currentTarget;
- n1 = el.nextSibling;
- if (n1) n2 = el.nextSibling.nextSibling;
- p1 = el.previousSibling;
- if (p1) p2 = el.previousSibling.previousSibling;
- if ( el.className == 'selected' ) {
- if ( el.id == 'reveal') {
- el.id = '';
- }
- else {
- el.id = 'reveal';
- }
- return false;
- }
- if (n1) { n1.className = 'queueR'; n1.id = ''}
- if (n2) { n2.className = 'hideR'; n2.id = '' }
- if (p1) { p1.className = 'queueL'; p1.id = '' }
- if (p2) { p2.className = 'hideL'; p2.id = '' }
- el.className = 'selected';
-};
-
-window.onload = function() {
- // alert(app.init);
- app.init();
-};
diff --git a/examples/webkit/webkit-guide/js/anim_panel.js b/examples/webkit/webkit-guide/js/anim_panel.js
deleted file mode 100755
index e6cc5e6d8f..0000000000
--- a/examples/webkit/webkit-guide/js/anim_panel.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- document.querySelector('body').addEventListener('click', function(event){
- document.querySelector('#panel').className = 'collapsed';
- });
-}
-
-function share() {
- document.querySelector('#panel').className = 'expanded';
- event.stopPropagation();
-}
-
-function debug(str) {
- document.querySelector('#dbg').innerHTML = 'You chose the <b>' + str.toUpperCase() + '</b> option.';
-}
diff --git a/examples/webkit/webkit-guide/js/anim_skew.js b/examples/webkit/webkit-guide/js/anim_skew.js
deleted file mode 100755
index 8b1300fd1f..0000000000
--- a/examples/webkit/webkit-guide/js/anim_skew.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.init = function() {
- app.elements = document.querySelectorAll('.items > div');
- app.navs = document.querySelectorAll('nav > div');
-
- // elements
- for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
- app.elements[i].className = 'row' + (i + 1);
- app.elements[i].addEventListener('click', app.remove);
- }
-
- // navigation
- for ( var i = 0, ln = app.navs.length ; i < ln ; i++ ) {
- app.navs[i].addEventListener('click', app.filter );
- }
-};
-
-app.filter = function(event) {
- var type = event.target.className;
-
- var hiddenCount = 0;
-
- if (! type ) {
- app.init();
- return false;
- }
-
- for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
- if ( app.elements[i].title == type ) {
- app.elements[i].className = 'row' + ((i + 1) - hiddenCount);
- }
- else {
- app.elements[i].className = 'hide';
- hiddenCount++;
- }
- }
-};
-
-app.remove = function() {
- event.currentTarget.className = 'hide';
- app.rearrange();
-};
-
-app.rearrange = function() {
- var hiddenCount = 0;
- for ( var i = 0, ln = app.elements.length ; i < ln ; i++ ) {
- if ( app.elements[i].className.match(/hide/) ) {
- hiddenCount++;
- }
- else {
- app.elements[i].className = 'row' + ((i + 1) - hiddenCount);
- }
- }
-};
-
-window.onload = function() { app.init() };
-
diff --git a/examples/webkit/webkit-guide/js/css3_backgrounds.js b/examples/webkit/webkit-guide/js/css3_backgrounds.js
deleted file mode 100755
index 29004c7b53..0000000000
--- a/examples/webkit/webkit-guide/js/css3_backgrounds.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-document.querySelector('body').addEventListener('click', function(event) {
- var l = event.target;
- if (l.tagName != 'DT') return false ;
- if ( l.className ) {
- l.className = '';
- }
- else {
- l.className = 'selected';
- }
-});
diff --git a/examples/webkit/webkit-guide/js/css3_border-img.js b/examples/webkit/webkit-guide/js/css3_border-img.js
deleted file mode 100755
index a8bfd9132d..0000000000
--- a/examples/webkit/webkit-guide/js/css3_border-img.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelectorAll('input');
- for (var i = 0, l = el.length ; i < l ; i++ ) {
- }
-}
diff --git a/examples/webkit/webkit-guide/js/css3_grad-radial.js b/examples/webkit/webkit-guide/js/css3_grad-radial.js
deleted file mode 100755
index f194ddaa6c..0000000000
--- a/examples/webkit/webkit-guide/js/css3_grad-radial.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelector('#main');
- el.addEventListener('mousedown', function(event){
-
- var colors = [ 'beige', 'crimson', 'darkcyan', 'turquoise',
- 'darkgoldenrod', 'darkorange', 'fuchsia',
- 'greenyellow', 'lightblue', 'lightcoral',
- 'lightgreen', 'mediumorchid', 'pink', 'plum',
- 'skyblue', 'springgreen', 'tan', 'tomato',
- 'violet', 'yellow', 'teal'];
-
- var x = event.offsetX;
- var y = event.offsetY;
-
- var loc = document.querySelector('#localStyles');
- var style = '#main:active {' + 'background: -webkit-gradient(radial, ';
- style += (x + ' ');
- style += (y + ' ');
- style += ',5,';
- style += ((x + 10) + ' ');
- style += ((y + 10) + ' ');
- style += ', 48, ';
- style += 'from(' + colors[r(5)] + '),';
- style += 'color-stop(20%, ' + colors[r(5)] + '),';
- style += 'color-stop(40%, ' + colors[r(5)] + '),';
- style += 'color-stop(60%, ' + colors[r(5)] + '),';
- style += 'color-stop(80%, ' + colors[r(5)] + '),';
- style += 'to(#ffffff) );'
- style += '}'
- loc.innerHTML = style;
- });
-}
-
-function r(i) {
- return Math.floor( (Math.random() * i ) );
-}
diff --git a/examples/webkit/webkit-guide/js/css3_mask-grad.js b/examples/webkit/webkit-guide/js/css3_mask-grad.js
deleted file mode 100755
index 911212dcf4..0000000000
--- a/examples/webkit/webkit-guide/js/css3_mask-grad.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-document.querySelector('body').addEventListener('click', function(event) {
- var l = event.target;
- if (l.tagName != 'IMG') return false ;
- event.target.className = 'select';
-});
diff --git a/examples/webkit/webkit-guide/js/css3_mask-img.js b/examples/webkit/webkit-guide/js/css3_mask-img.js
deleted file mode 100755
index a8bfd9132d..0000000000
--- a/examples/webkit/webkit-guide/js/css3_mask-img.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelectorAll('input');
- for (var i = 0, l = el.length ; i < l ; i++ ) {
- }
-}
diff --git a/examples/webkit/webkit-guide/js/css3_text-overflow.js b/examples/webkit/webkit-guide/js/css3_text-overflow.js
deleted file mode 100755
index 58af80d6d1..0000000000
--- a/examples/webkit/webkit-guide/js/css3_text-overflow.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- var el = document.querySelectorAll('.accordion > li');
- for (var i = 0, l = el.length ; i < l ; i++ ) {
- el[i].addEventListener('click', function(event){
- var tgt = event.target;
- if ( tgt.tagName == 'LI' && ( ! tgt.className ) ) {
- tgt.className = 'selected';
- }
- if ( tgt.tagName == 'DIV' && ( tgt.className == 'dismiss') ) {
- tgt.parentNode.className = '';
- }
-
- });
- }
-}
diff --git a/examples/webkit/webkit-guide/js/form_tapper.js b/examples/webkit/webkit-guide/js/form_tapper.js
deleted file mode 100755
index d4d87a2c1a..0000000000
--- a/examples/webkit/webkit-guide/js/form_tapper.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- return false;
- var el = document.querySelectorAll('input[type=radio]');
- for ( var i = 0, l = el.length ; i < l ; i++ ) {
- el[i].addEventListener('click', resetRadio);
- }
-}
-
-function resetRadio(event) {
- if (event.target._checked == true) {
- event.target._checked = false;
- event.target.checked = false;
- event.target.indeterminate = true;
- }
- else {
- event.target._checked = true;
- }
-}
diff --git a/examples/webkit/webkit-guide/js/mob_condjs.js b/examples/webkit/webkit-guide/js/mob_condjs.js
deleted file mode 100755
index 32bf550d20..0000000000
--- a/examples/webkit/webkit-guide/js/mob_condjs.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-window.onload = function() {
- var msg = 'JavaScript thinks you are viewing this page with a ';
- if ( isDesign('desktop') ) {
- msg += 'full desktop browser';
- }
- else if ( isDesign('touch') ) {
- msg += 'touch-based mobile browser';
- }
- else if ( isDesign('mobile') ) {
- msg += 'non-touch mobile browser';
- }
- else {
- msg = window.styleMedia.matchMedium;
- }
- document.getElementById('js').innerHTML = msg;
-};
-
-function isDesign(str) {
- var design;
- if (matchesMedia('only screen and (min-device-width: 481px)')) {
- design = 'desktop';
- }
- else if (matchesMedia('only screen and (max-device-width: 480px)')) {
- design = 'touch';
- }
- else if (matchesMedia('handheld')) {
- design = 'mobile';
- }
- return str == design;
-}
-
-function matchesMedia(query) {
- if (!!window.matchMedia)
- return window.matchMedia(query).matches;
- if (!!window.styleMedia && !!window.styleMedia.matchMedium)
- return window.styleMedia.matchMedium(query);
- if (!!window.media && window.media.matchMedium)
- return window.media.matchMedium(query);
- return false;
-}
diff --git a/examples/webkit/webkit-guide/js/mobile.js b/examples/webkit/webkit-guide/js/mobile.js
deleted file mode 100755
index 51c94d4080..0000000000
--- a/examples/webkit/webkit-guide/js/mobile.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.toggleDisplay = function(id) {
- var el = document.getElementById(id);
- if (el.className.match(/hidden/)) {
- el.className = '';
- }
- else {
- el.className = 'hidden';
- }
-}
diff --git a/examples/webkit/webkit-guide/js/storage.js b/examples/webkit/webkit-guide/js/storage.js
deleted file mode 100755
index b5a374f39d..0000000000
--- a/examples/webkit/webkit-guide/js/storage.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt WebKit module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-var app = new Function();
-
-app.dbg = false;
-
-window.onload = function() {
-
- app.cred = document.querySelector('#cred');
-
- // open form:
- document.querySelector('#openform').addEventListener('mousedown', app.getInfo);
- // dismiss form:
- document.querySelector('#dismiss').addEventListener('mousedown', app.dismiss);
-
- // form validation:
- app.inputs = document.querySelectorAll('input:not([type="submit"])');
- for (var i = 0, l = app.inputs.length ; i < l ; i++ ) {
- app.inputs[i].addEventListener('blur', app.checkEdit);
- }
-
- // storage
- app.db_loc = window.localStorage;
- app.db_ses = window.sessionStorage;
-
- if (!!app.db_loc) {
- // no login info yet...
- if ( !app.db_loc.getItem('login') || !app.db_loc.getItem('password') ) app.getInfo();
- }
- else {
- alert("This application needs to run on a recent WebKit-based browser.");
- }
-
-};
-
-app.hint = function(str) {
- document.querySelector('body').className = str;
-};
-
-app.checkEdit = function(ev) {
- ev.currentTarget.className = 'validate';
-}
-
-app.getInfo = function(ev) {
- app.cred.className = 'show';
- app.inputs[0].value = app.db_loc.getItem('login');
- app.inputs[1].value = app.db_loc.getItem('password');
- app.inputs[2].value = app.db_ses.getItem('credit');
-}
-
-app.dismiss = function(ev) {
- app.db_loc.setItem('login', app.inputs[0].value);
- app.db_loc.setItem('password', app.inputs[1].value);
- app.db_ses.setItem('credit', app.inputs[2].value);
- ev.currentTarget.parentNode.className = 'hide';
-}
-
diff --git a/examples/webkit/webkit-guide/layout_link-fmt.htm b/examples/webkit/webkit-guide/layout_link-fmt.htm
deleted file mode 100644
index bcb6228a32..0000000000
--- a/examples/webkit/webkit-guide/layout_link-fmt.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Link Context Hints</title>
-<link href='css/layout_link-fmt.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<article>
-<h3>Link Context Hints</h3>
-<ol class="links">
-<li> <a href="#">Link to internal page</a></li>
-<li> <a href="http://www.google.com" target="new">Link to external page</a></li>
-<li> <a href="mailto:who@where.com">Email Link</a></li>
-<li> <a href="tel:+2125551212">Phone: 212.555.1212</a></li>
-<li> <a href="sms:+2125551212%3Fbody=hello world">SMS Link</a></li>
-<li> <a href="http://whmp.com/pages/podcast/122411.rss">Link to RSS feed</a></li>
-<li> <a href="http://www.ous.edu/about/polipro/files/Budget%20Outline.doc">Link to Word file</a></li>
-<li> <a href="http://www.greenfield-nh.gov/Public_Documents/GreenfieldNH_Admin/BudgetReport2006.pdf">List to PDF file</a></li>
-<li> <a href="http://www.agmconnect.org/cpf/CPF_Budget_Template.xls">Link to Excel file</a></li>
-<li> <a href="http://www.unh.edu/hr/banner/position-budget-training.ppt">Link to Powerpoint file</a></li>
-</ol>
-<h3>Inline Links</h3>
-<p>
-Links to an
-<a href="item2.htm">internal page</a>, an
-<a href="http://example.com/item1.htm" target="new">external page</a>,
-<a href="mailto:who@where.com">email link</a>,
-phone link
-<a href="tel:+2125551212">212.555.1212</a>,
-<a href="sms:+2125551212%3Fbody=hello world">SMS Link</a>,
-<a href="http://whmp.com/pages/podcast/122411.rss">RSS feed</a>,
-<a href="http://www.ous.edu/about/polipro/files/Budget%20Outline.doc">Word file</a>,
-<a href="http://www.greenfield-nh.gov/Public_Documents/GreenfieldNH_Admin/BudgetReport2006.pdf">PDF</a>,
-<a href="http://www.agmconnect.org/cpf/CPF_Budget_Template.xls">Excel</a>,
-<a href="http://www.unh.edu/hr/banner/position-budget-training.ppt">Powerpoint</a>.
-</p>
-</article>
-<p>&nbsp</p>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
deleted file mode 100644
index 58d1ebd6d4..0000000000
--- a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
+++ /dev/null
@@ -1,142 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Mobilized Tables</title>
-<link href='css/layout_tbl-keyhole.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-
-<article id="r0">
-
-<h1>Mobilized Tables</h1>
-
-<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
-feugiat gravida viverra. Vivamus ipsum felis, cursus sed venenatis
-nec, tempus ac tellus.</p>
-
-<p><a href="#r1">View Listings</a></p>
-
-<table class="mobile">
-
-<thead>
-<tr>
-<th class="nav"></th>
-<th>Item</th>
-<th>Price</th>
-<th>Location</th>
-<th>Posted</th>
-<th>Description</th>
-</tr>
-</thead>
-
-<tbody>
-
-<tr id="r1">
-<th class="nav"><a href="#"></a><a href="#r2"></a></th>
-<td>Keiser Indoor Cycling Bike / Platform</td>
-<td>$250</td>
-<td>Santa Monica, CA</td>
-<td>4 days ago</td>
-<td>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
-officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
-amet, consectetur adipiscing elit. Donec feugiat gravida viverra.
-Vivamus ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
-</tr>
-
-<tr id="r2">
-<th class="nav"><a href="#r1"></a><a href="#r3"></a></th>
-<td>Ladies Diamondback Mountain Bike</td>
-<td>$300</td>
-<td>North Hollywood, CA</td>
-<td>3 hours ago</td>
-<td>Duis aute irure dolor in reprehenderit in voluptate velit esse
-cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
-ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
-</tr>
-
-<tr id="r3">
-<th class="nav"><a href="#r2"></a><a href="#r4"></a></th>
-<td>AA Cycle 10 Speed Road Bike</td>
-<td>$150</td>
-<td>Burbank, CA</td>
-<td>2 days ago</td>
-<td>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
-nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Donec feugiat gravida viverra. Vivamus
-ipsum felis, cursus sed venenatis nec, tempus ac tellus.</td>
-</tr>
-
-<tr id="r4">
-<th class="nav"><a href="#r3"></a><a href="#"></a></th>
-<td>Magna Dual Suspection Mountain Bike 24</td>
-<td>$60</td>
-<td>El Segundo, CA</td>
-<td>2 weeks ago</td>
-<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem
-ipsum dolor sit amet, consectetur adipiscing elit. Donec feugiat
-gravida viverra. Vivamus ipsum felis, cursus sed venenatis nec, tempus
-ac tellus.</td>
-</tr>
-
-</tbody>
-
-</table>
-
-<p>
-Text continues here. Donec a massa felis, a congue purus. Nullam et
-turpis diam. Aenean vestibulum egestas metus, eu sodales dolor
-venenatis quis. Aenean augue orci, facilisis et convallis ut, egestas
-at neque.
-</p>
-</article>
-
-<script src="js/mobile.js"></script>
-
-</section>
-
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/mob_condjs.htm b/examples/webkit/webkit-guide/mob_condjs.htm
deleted file mode 100644
index 1cc4a9da00..0000000000
--- a/examples/webkit/webkit-guide/mob_condjs.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Media Queries + JavaScript</title>
-<link media='only screen and (min-device-width: 481px)' href='css/mq_desktop.css' type='text/css' rel='stylesheet'/>
-<link media='only screen and (max-device-width: 480px)' href='css/mq_touch.css' type='text/css' rel='stylesheet'/>
-<link media='handheld' href='css/mqmobile.css' type='text/css' rel='stylesheet'/>
-<link href='css/mob_condjs.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Media Queries + JavaScript</h3>
-<p id="design">...</p>
-
-<p id="js">...</p>
-
-</article>
-</section>
-
-<script src="js/mob_condjs.js"></script>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/mob_layout.htm b/examples/webkit/webkit-guide/mob_layout.htm
deleted file mode 100644
index 1bd74800a2..0000000000
--- a/examples/webkit/webkit-guide/mob_layout.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<title>Media Query-Driven Layout</title>
-<meta name='viewport' content='width=device-width' />
-<title>media-driven layout</title>
-<link media='only screen and (min-device-width: 480px)' href='css/mqlayout_desktop.css' type='text/css' rel='stylesheet'/>
-<link media='only screen and (max-device-width: 480px)' href='css/mqlayout_touch.css' type='text/css' rel='stylesheet'/>
-<link media='handheld' href='css/mqlayout_mobile.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<header>HEADER</header>
-<nav>NAVIGATION</nav>
-<section id="main">MAIN CONTENT</section>
-<section id="sidebar">SIDEBAR</section>
-<footer>FOOTER</footer>
-
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/mob_mediaquery.htm b/examples/webkit/webkit-guide/mob_mediaquery.htm
deleted file mode 100644
index 222884f874..0000000000
--- a/examples/webkit/webkit-guide/mob_mediaquery.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Media Queries</title>
-<link media='only screen and (min-device-width: 481px)' href='css/mq_desktop.css' type='text/css' rel='stylesheet'/>
-<link media='only screen and (max-device-width: 480px)' href='css/mq_touch.css' type='text/css' rel='stylesheet'/>
-<link media='handheld' href='css/mq_mobile.css' type='text/css' rel='stylesheet'/>
-<link href='css/mob_mediaquery.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<section>
-<article>
-<h3>Media Queries</h3>
-<p id="design">...</p>
-</article>
-</section>
-<script src="js/mobile.js"></script>
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/storage.htm b/examples/webkit/webkit-guide/storage.htm
deleted file mode 100644
index 5982a621fe..0000000000
--- a/examples/webkit/webkit-guide/storage.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!--
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta name='viewport' content='width=device-width' />
-<title>Local/Session Storage</title>
-<link href='css/storage.css' type='text/css' rel='stylesheet'/>
-</head>
-<body>
-<h1>
-<img id="openform" src="img/icon_info_x24.png"/>
-Local/Session Storage</h1>
-
-<form id="cred" class="hide">
-
-<img id="dismiss" src="img/icon_dismiss.png"/>
-
-<div>login</div>
-<input id="login" required type="text"/>
-<br/>
-
-<div>password</div>
-<input id="password" required type="password"/>
-
-<div>credit card</div>
-<input id="credit" required type="number" min="999999999999999" max="9999999999999999"/>
-
-</form>
-
-<script src="js/storage.js"></script>
-
-</body>
-</html>
diff --git a/examples/webkit/webkit-guide/webkit-guide.pro b/examples/webkit/webkit-guide/webkit-guide.pro
deleted file mode 100644
index a2c2dd4a20..0000000000
--- a/examples/webkit/webkit-guide/webkit-guide.pro
+++ /dev/null
@@ -1,256 +0,0 @@
-#A simple .pro file to make Qt aware of the webkit-guide files.
-#For documentation generation
-#TEMPLATE += subdirs
-
-SOURCES = anim_accord.htm \
-anim_demo-rotate.htm \
-anim_demo-scale.htm \
-anim_demo-skew.htm \
-anim_gallery.htm \
-anim_panel.htm \
-anim_pulse.htm \
-anim_skew.htm \
-anim_slide1.htm \
-anim_slide2.htm \
-anim_slide3.htm \
-anim_tabbedSkew.htm \
-_copyright.txt \
-css3_backgrounds.htm \
-css3_border-img.htm \
-css3_gradientBack.htm \
-css3_gradientBackStop.htm \
-css3_gradientButton.htm \
-css3_grad-radial.htm \
-css3_mask-grad.htm \
-css3_mask-img.htm \
-css3_multicol.htm \
-css3_reflect.htm \
-css3_scroll.htm \
-css3_sel-nth.htm \
-css3_shadow.htm \
-css3_text-overflow.htm \
-css3_text-shadow.htm \
-css3_text-stroke.htm \
-form_tapper.htm \
-form_toggler.htm \
-_image_assets.htm \
-_index.html \
-layout_link-fmt.htm \
-layout_tbl-keyhole.htm \
-mob_condjs.htm \
-mob_layout.htm \
-mob_mediaquery.htm \
-storage.htm \
-css/anim_accord.css \
-css/anim_demo-rotate.css \
-css/anim_demo-scale.css \
-css/anim_demo-skew.css \
-css/anim_gallery.css \
-css/anim_panel.css \
-css/anim_pulse.css \
-css/anim_skew.css \
-css/anim_slide.css \
-css/anim_tabbedSkew.css \
-css/css3_backgrounds.css \
-css/css3_border-img.css \
-css/css3_gradientBack.css \
-css/css3_gradientBackStop.css \
-css/css3_gradientButton.css \
-css/css3_grad-radial.css \
-css/css3_mask-grad.css \
-css/css3_mask-img.css \
-css/css3_multicol.css \
-css/css3_reflect.css \
-css/css3_scroll.css \
-css/css3_sel-nth.css \
-css/css3_shadowBlur.css \
-css/css3_shadow.css \
-css/css3_text-overflow.css \
-css/css3_text-shadow.css \
-css/css3_text-stroke.css \
-css/form_tapper.css \
-css/form_toggler.css \
-css/layout_link-fmt.css \
-css/layout_tbl-keyhole.css \
-css/mob_condjs.css \
-css/mobile.css \
-css/mob_mediaquery.css \
-css/mq_desktop.css \
-css/mqlayout_desktop.css \
-css/mqlayout_mobile.css \
-css/mqlayout_touch.css \
-css/mq_mobile.css \
-css/mq_touch.css \
-css/storage.css \
-img/border-frame.png \
-img/gal1.jpg \
-img/gal2.jpg \
-img/gal3.jpg \
-img/gal4.jpg \
-img/gal5.jpg \
-img/gal6.jpg \
-img/gal7.jpg \
-img/gal8.jpg \
-img/gradient.jpg \
-img/gray_icon_close.png \
-img/ic_ag_016.png \
-img/ic_ag_032.png \
-img/ic_ag_036.png \
-img/ic_ag_048.png \
-img/ic_al_016.png \
-img/ic_al_032.png \
-img/ic_al_036.png \
-img/ic_al_048.png \
-img/ic_ar_016.png \
-img/ic_ar_032.png \
-img/ic_ar_036.png \
-img/ic_ar_048.png \
-img/ic_b_016.png \
-img/ic_b_032.png \
-img/ic_b_036.png \
-img/ic_b_048.png \
-img/ic_be_016.png \
-img/ic_be_032.png \
-img/ic_be_036.png \
-img/ic_be_048.png \
-img/ic_c_016.png \
-img/ic_c_032.png \
-img/ic_c_036.png \
-img/ic_c_048.png \
-img/ic_ca_016.png \
-img/ic_ca_032.png \
-img/ic_ca_036.png \
-img/ic_ca_048.png \
-img/ic_cl_016.png \
-img/ic_cl_032.png \
-img/ic_cl_036.png \
-img/ic_cl_048.png \
-img/ic_cu_016.png \
-img/ic_cu_032.png \
-img/ic_cu_036.png \
-img/ic_cu_048.png \
-img/ic_f_016.png \
-img/ic_f_032.png \
-img/ic_f_036.png \
-img/ic_f_048.png \
-img/ic_fe_016.png \
-img/ic_fe_032.png \
-img/ic_fe_036.png \
-img/ic_fe_048.png \
-img/ic_h_016.png \
-img/ic_h_032.png \
-img/ic_h_036.png \
-img/ic_h_048.png \
-img/ic_he_016.png \
-img/ic_he_032.png \
-img/ic_he_036.png \
-img/ic_he_048.png \
-img/ic_k_016.png \
-img/ic_k_032.png \
-img/ic_k_036.png \
-img/ic_k_048.png \
-img/ic_li_016.png \
-img/ic_li_032.png \
-img/ic_li_036.png \
-img/ic_li_048.png \
-img/ic_mg_016.png \
-img/ic_mg_032.png \
-img/ic_mg_036.png \
-img/ic_mg_048.png \
-img/ic_n_016.png \
-img/ic_n_032.png \
-img/ic_n_036.png \
-img/ic_n_048.png \
-img/ic_na_016.png \
-img/ic_na_032.png \
-img/ic_na_036.png \
-img/ic_na_048.png \
-img/ic_ne_016.png \
-img/ic_ne_032.png \
-img/ic_ne_036.png \
-img/ic_ne_048.png \
-img/ic_ni_016.png \
-img/ic_ni_032.png \
-img/ic_ni_036.png \
-img/ic_ni_048.png \
-img/ic_o_016.png \
-img/ic_o_032.png \
-img/ic_o_036.png \
-img/ic_o_048.png \
-img/icon_check.png \
-img/icon_check_x24green.png \
-img/icon_dismiss.png \
-img/icon_dismiss_x22.png \
-img/icon_drill-down.png \
-img/icon_drill-down_x32.png \
-img/icon_drill-up.png \
-img/icon_drill-up_x32.png \
-img/icon_expand-nav.png \
-img/icon_head-collapsed.png \
-img/icon_head-collapsed_x13.png \
-img/icon_head-expanded.png \
-img/icon_head-expanded_x13.png \
-img/icon_info.png \
-img/icon_info_x24.png \
-img/icon_link-doc.png \
-img/icon_link-email.png \
-img/icon_link-external.png \
-img/icon_link-pdf.png \
-img/icon_link-ppt.png \
-img/icon_link-rss.png \
-img/icon_link-sms.png \
-img/icon_link-tel.png \
-img/icon_link-xls.png \
-img/icon_list-all_circ.png \
-img/icon_list-all.png \
-img/icon_nav_end.png \
-img/icon_nav-start.png \
-img/icon_nav-top.png \
-img/icon_nav-up.png \
-img/icon_question.png \
-img/icon_scroll-left.png \
-img/icon_scroll-right.png \
-img/icon_trash.png \
-img/ic_pt_016.png \
-img/ic_pt_032.png \
-img/ic_pt_036.png \
-img/ic_pt_048.png \
-img/ic_si_016.png \
-img/ic_si_032.png \
-img/ic_si_036.png \
-img/ic_si_048.png \
-img/ic_zn_016.png \
-img/ic_zn_032.png \
-img/ic_zn_036.png \
-img/ic_zn_048.png \
-img/land1.jpg \
-img/land2.jpg \
-img/land3.jpg \
-img/land4.jpg \
-img/land5.jpg \
-img/land6.jpg \
-img/land7.jpg \
-img/land8.jpg \
-img/mask.png \
-img/tnail_gal1.png \
-img/tnail_gal2.png \
-img/tnail_gal3.png \
-img/tnail_gal4.png \
-img/tnail_gal5.png \
-img/tnail_gal6.png \
-img/tnail_gal7.png \
-img/tnail_gal8.png \
-js/anim_accord.js \
-js/anim_gallery.js \
-js/anim_panel.js \
-js/anim_skew.js \
-js/css3_backgrounds.js \
-js/css3_border-img.js \
-js/css3_grad-radial.js \
-js/css3_mask-grad.js \
-js/css3_mask-img.js \
-js/css3_text-overflow.js \
-js/form_tapper.js \
-js/mob_condjs.js \
-js/mobile.js \
-js/storage.js \
diff --git a/examples/widgets/desktop/screenshot/main.cpp b/examples/widgets/desktop/screenshot/main.cpp
index 788ebb3532..811562858a 100644
--- a/examples/widgets/desktop/screenshot/main.cpp
+++ b/examples/widgets/desktop/screenshot/main.cpp
@@ -39,13 +39,16 @@
****************************************************************************/
#include <QApplication>
+#include <QDesktopWidget>
#include "screenshot.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+
Screenshot screenshot;
+ screenshot.move(QApplication::desktop()->availableGeometry(&screenshot).topLeft() + QPoint(20, 20));
screenshot.show();
return app.exec();
}
diff --git a/examples/widgets/desktop/screenshot/screenshot.cpp b/examples/widgets/desktop/screenshot/screenshot.cpp
index bfca5a45ae..354fe36369 100644
--- a/examples/widgets/desktop/screenshot/screenshot.cpp
+++ b/examples/widgets/desktop/screenshot/screenshot.cpp
@@ -44,20 +44,48 @@
//! [0]
Screenshot::Screenshot()
+ : screenshotLabel(new QLabel(this))
{
- screenshotLabel = new QLabel;
screenshotLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
screenshotLabel->setAlignment(Qt::AlignCenter);
- screenshotLabel->setMinimumSize(240, 160);
- createOptionsGroupBox();
- createButtonsLayout();
+ const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ screenshotLabel->setMinimumSize(screenGeometry.width() / 8, screenGeometry.height() / 8);
- mainLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(screenshotLabel);
+
+ QGroupBox *optionsGroupBox = new QGroupBox(tr("Options"), this);
+ delaySpinBox = new QSpinBox(optionsGroupBox);
+ delaySpinBox->setSuffix(tr(" s"));
+ delaySpinBox->setMaximum(60);
+
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(delaySpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &Screenshot::updateCheckBox);
+
+ hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"), optionsGroupBox);
+
+ QGridLayout *optionsGroupBoxLayout = new QGridLayout(optionsGroupBox);
+ optionsGroupBoxLayout->addWidget(new QLabel(tr("Screenshot Delay:"), this), 0, 0);
+ optionsGroupBoxLayout->addWidget(delaySpinBox, 0, 1);
+ optionsGroupBoxLayout->addWidget(hideThisWindowCheckBox, 1, 0, 1, 2);
+
mainLayout->addWidget(optionsGroupBox);
+
+ QHBoxLayout *buttonsLayout = new QHBoxLayout;
+ newScreenshotButton = new QPushButton(tr("New Screenshot"), this);
+ connect(newScreenshotButton, &QPushButton::clicked, this, &Screenshot::newScreenshot);
+ buttonsLayout->addWidget(newScreenshotButton);
+ QPushButton *saveScreenshotButton = new QPushButton(tr("Save Screenshot"), this);
+ connect(saveScreenshotButton, &QPushButton::clicked, this, &Screenshot::saveScreenshot);
+ buttonsLayout->addWidget(saveScreenshotButton);
+ QPushButton *quitScreenshotButton = new QPushButton(tr("Quit"), this);
+ quitScreenshotButton->setShortcut(Qt::CTRL + Qt::Key_Q);
+ connect(quitScreenshotButton, &QPushButton::clicked, this, &QWidget::close);
+ buttonsLayout->addWidget(quitScreenshotButton);
+ buttonsLayout->addStretch();
mainLayout->addLayout(buttonsLayout);
- setLayout(mainLayout);
shootScreen();
delaySpinBox->setValue(5);
@@ -84,44 +112,59 @@ void Screenshot::newScreenshot()
hide();
newScreenshotButton->setDisabled(true);
- QTimer::singleShot(delaySpinBox->value() * 1000, this, SLOT(shootScreen()));
+ QTimer::singleShot(delaySpinBox->value() * 1000, this, &Screenshot::shootScreen);
}
//! [2]
//! [3]
void Screenshot::saveScreenshot()
{
- QString format = "png";
- QString initialPath = QDir::currentPath() + tr("/untitled.") + format;
-
- QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), initialPath,
- tr("%1 Files (*.%2);;All Files (*)")
- .arg(format.toUpper())
- .arg(format));
- if (!fileName.isEmpty())
- originalPixmap.save(fileName, format.toLatin1().constData());
+ const QString format = "png";
+ QString initialPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
+ if (initialPath.isEmpty())
+ initialPath = QDir::currentPath();
+ initialPath += tr("/untitled.") + format;
+
+ QFileDialog fileDialog(this, tr("Save As"), initialPath);
+ fileDialog.setAcceptMode(QFileDialog::AcceptSave);
+ fileDialog.setFileMode(QFileDialog::AnyFile);
+ fileDialog.setDirectory(initialPath);
+ QStringList mimeTypes;
+ foreach (const QByteArray &bf, QImageWriter::supportedMimeTypes())
+ mimeTypes.append(QLatin1String(bf));
+ fileDialog.setMimeTypeFilters(mimeTypes);
+ fileDialog.selectMimeTypeFilter("image/" + format);
+ fileDialog.setDefaultSuffix(format);
+ if (fileDialog.exec() != QDialog::Accepted)
+ return;
+ const QString fileName = fileDialog.selectedFiles().first();
+ if (!originalPixmap.save(fileName)) {
+ QMessageBox::warning(this, tr("Save Error"), tr("The image could not be saved to \"%1\".")
+ .arg(QDir::toNativeSeparators(fileName)));
+ }
}
//! [3]
//! [4]
void Screenshot::shootScreen()
{
- if (delaySpinBox->value() != 0)
- qApp->beep();
-//! [4]
- originalPixmap = QPixmap(); // clear image for low memory situations
- // on embedded devices.
-//! [5]
QScreen *screen = QGuiApplication::primaryScreen();
- if (screen)
- originalPixmap = screen->grabWindow(0);
+ if (const QWindow *window = windowHandle())
+ screen = window->screen();
+ if (!screen)
+ return;
+
+ if (delaySpinBox->value() != 0)
+ QApplication::beep();
+
+ originalPixmap = screen->grabWindow(0);
updateScreenshotLabel();
newScreenshotButton->setDisabled(false);
if (hideThisWindowCheckBox->isChecked())
show();
}
-//! [5]
+//! [4]
//! [6]
void Screenshot::updateCheckBox()
@@ -135,52 +178,6 @@ void Screenshot::updateCheckBox()
}
//! [6]
-//! [7]
-void Screenshot::createOptionsGroupBox()
-{
- optionsGroupBox = new QGroupBox(tr("Options"));
-
- delaySpinBox = new QSpinBox;
- delaySpinBox->setSuffix(tr(" s"));
- delaySpinBox->setMaximum(60);
- connect(delaySpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateCheckBox()));
-
- delaySpinBoxLabel = new QLabel(tr("Screenshot Delay:"));
-
- hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"));
-
- optionsGroupBoxLayout = new QGridLayout;
- optionsGroupBoxLayout->addWidget(delaySpinBoxLabel, 0, 0);
- optionsGroupBoxLayout->addWidget(delaySpinBox, 0, 1);
- optionsGroupBoxLayout->addWidget(hideThisWindowCheckBox, 1, 0, 1, 2);
- optionsGroupBox->setLayout(optionsGroupBoxLayout);
-}
-//! [7]
-
-//! [8]
-void Screenshot::createButtonsLayout()
-{
- newScreenshotButton = createButton(tr("New Screenshot"), this, SLOT(newScreenshot()));
- saveScreenshotButton = createButton(tr("Save Screenshot"), this, SLOT(saveScreenshot()));
- quitScreenshotButton = createButton(tr("Quit"), this, SLOT(close()));
-
- buttonsLayout = new QHBoxLayout;
- buttonsLayout->addStretch();
- buttonsLayout->addWidget(newScreenshotButton);
- buttonsLayout->addWidget(saveScreenshotButton);
- buttonsLayout->addWidget(quitScreenshotButton);
-}
-//! [8]
-
-//! [9]
-QPushButton *Screenshot::createButton(const QString &text, QWidget *receiver,
- const char *member)
-{
- QPushButton *button = new QPushButton(text);
- button->connect(button, SIGNAL(clicked()), receiver, member);
- return button;
-}
-//! [9]
//! [10]
void Screenshot::updateScreenshotLabel()
diff --git a/examples/widgets/desktop/screenshot/screenshot.h b/examples/widgets/desktop/screenshot/screenshot.h
index 352806cdba..f0e737e4c7 100644
--- a/examples/widgets/desktop/screenshot/screenshot.h
+++ b/examples/widgets/desktop/screenshot/screenshot.h
@@ -73,25 +73,14 @@ private slots:
void updateCheckBox();
private:
- void createOptionsGroupBox();
- void createButtonsLayout();
- QPushButton *createButton(const QString &text, QWidget *receiver, const char *member);
void updateScreenshotLabel();
QPixmap originalPixmap;
QLabel *screenshotLabel;
- QGroupBox *optionsGroupBox;
QSpinBox *delaySpinBox;
- QLabel *delaySpinBoxLabel;
QCheckBox *hideThisWindowCheckBox;
QPushButton *newScreenshotButton;
- QPushButton *saveScreenshotButton;
- QPushButton *quitScreenshotButton;
-
- QVBoxLayout *mainLayout;
- QGridLayout *optionsGroupBoxLayout;
- QHBoxLayout *buttonsLayout;
};
//! [0]
diff --git a/examples/widgets/desktop/systray/doc/src/systray.qdoc b/examples/widgets/desktop/systray/doc/src/systray.qdoc
index 074012b6a7..fa2dbb2721 100644
--- a/examples/widgets/desktop/systray/doc/src/systray.qdoc
+++ b/examples/widgets/desktop/systray/doc/src/systray.qdoc
@@ -173,7 +173,11 @@
We have reimplemented the QWidget::closeEvent() event handler to
receive widget close events, showing the above message to the
- users when they are closing the editor window.
+ users when they are closing the editor window. On OS X we need to
+ avoid showing the message and accepting the close event when the
+ user really intends to quit the application, that is, when the
+ user has triggered "Quit" in the menu bar or pressed the Command+Q
+ shortcut.
In addition to the functions and slots discussed above, we have
also implemented several convenience functions to simplify the
diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp
index b212dc440d..d499f498af 100644
--- a/examples/widgets/desktop/systray/window.cpp
+++ b/examples/widgets/desktop/systray/window.cpp
@@ -42,11 +42,11 @@
#ifndef QT_NO_SYSTEMTRAYICON
-#include <QtGui>
-
#include <QAction>
#include <QCheckBox>
#include <QComboBox>
+#include <QCoreApplication>
+#include <QCloseEvent>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
@@ -68,12 +68,13 @@ Window::Window()
createActions();
createTrayIcon();
- connect(showMessageButton, SIGNAL(clicked()), this, SLOT(showMessage()));
- connect(showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
- connect(iconComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setIcon(int)));
- connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
- connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
- this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
+ connect(showMessageButton, &QAbstractButton::clicked, this, &Window::showMessage);
+ connect(showIconCheckBox, &QAbstractButton::toggled, trayIcon, &QSystemTrayIcon::setVisible);
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(iconComboBox, static_cast<QComboIntSignal>(&QComboBox::currentIndexChanged),
+ this, &Window::setIcon);
+ connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Window::messageClicked);
+ connect(trayIcon, &QSystemTrayIcon::activated, this, &Window::iconActivated);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(iconGroupBox);
@@ -101,6 +102,11 @@ void Window::setVisible(bool visible)
//! [2]
void Window::closeEvent(QCloseEvent *event)
{
+#ifdef Q_OS_OSX
+ if (!event->spontaneous() || !isVisible()) {
+ return;
+ }
+#endif
if (trayIcon->isVisible()) {
QMessageBox::information(this, tr("Systray"),
tr("The program will keep running in the "
@@ -245,16 +251,16 @@ void Window::createMessageGroupBox()
void Window::createActions()
{
minimizeAction = new QAction(tr("Mi&nimize"), this);
- connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
+ connect(minimizeAction, &QAction::triggered, this, &QWidget::hide);
maximizeAction = new QAction(tr("Ma&ximize"), this);
- connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
+ connect(maximizeAction, &QAction::triggered, this, &QWidget::showMaximized);
restoreAction = new QAction(tr("&Restore"), this);
- connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
+ connect(restoreAction, &QAction::triggered, this, &QWidget::showNormal);
quitAction = new QAction(tr("&Quit"), this);
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
}
void Window::createTrayIcon()
diff --git a/examples/widgets/dialogs/classwizard/classwizard.cpp b/examples/widgets/dialogs/classwizard/classwizard.cpp
index 0f1a2a0869..d3e366efe6 100644
--- a/examples/widgets/dialogs/classwizard/classwizard.cpp
+++ b/examples/widgets/dialogs/classwizard/classwizard.cpp
@@ -79,31 +79,31 @@ void ClassWizard::accept()
if (field("comment").toBool()) {
block += "/*\n";
- block += " " + header.toLatin1() + "\n";
+ block += " " + header.toLatin1() + '\n';
block += "*/\n";
- block += "\n";
+ block += '\n';
}
if (field("protect").toBool()) {
- block += "#ifndef " + macroName + "\n";
- block += "#define " + macroName + "\n";
- block += "\n";
+ block += "#ifndef " + macroName + '\n';
+ block += "#define " + macroName + '\n';
+ block += '\n';
}
if (field("includeBase").toBool()) {
- block += "#include " + baseInclude + "\n";
- block += "\n";
+ block += "#include " + baseInclude + '\n';
+ block += '\n';
}
block += "class " + className;
if (!baseClass.isEmpty())
block += " : public " + baseClass;
- block += "\n";
+ block += '\n';
block += "{\n";
/* qmake ignore Q_OBJECT */
if (field("qobjectMacro").toBool()) {
block += " Q_OBJECT\n";
- block += "\n";
+ block += '\n';
}
block += "public:\n";
@@ -115,7 +115,7 @@ void ClassWizard::accept()
block += " " + className + "();\n";
if (field("copyCtor").toBool()) {
block += " " + className + "(const " + className + " &other);\n";
- block += "\n";
+ block += '\n';
block += " " + className + " &operator=" + "(const " + className
+ " &other);\n";
}
@@ -123,11 +123,11 @@ void ClassWizard::accept()
block += "};\n";
if (field("protect").toBool()) {
- block += "\n";
+ block += '\n';
block += "#endif\n";
}
- QFile headerFile(outputDir + "/" + header);
+ QFile headerFile(outputDir + '/' + header);
if (!headerFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(0, QObject::tr("Simple Wizard"),
QObject::tr("Cannot write file %1:\n%2")
@@ -141,12 +141,12 @@ void ClassWizard::accept()
if (field("comment").toBool()) {
block += "/*\n";
- block += " " + implementation.toLatin1() + "\n";
+ block += " " + implementation.toLatin1() + '\n';
block += "*/\n";
- block += "\n";
+ block += '\n';
}
block += "#include \"" + header.toLatin1() + "\"\n";
- block += "\n";
+ block += '\n';
if (field("qobjectCtor").toBool()) {
block += className + "::" + className + "(QObject *parent)\n";
@@ -171,7 +171,7 @@ void ClassWizard::accept()
block += "{\n";
block += " *this = other;\n";
block += "}\n";
- block += "\n";
+ block += '\n';
block += className + " &" + className + "::operator=(const "
+ className + " &other)\n";
block += "{\n";
@@ -183,7 +183,7 @@ void ClassWizard::accept()
}
}
- QFile implementationFile(outputDir + "/" + implementation);
+ QFile implementationFile(outputDir + '/' + implementation);
if (!implementationFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(0, QObject::tr("Simple Wizard"),
QObject::tr("Cannot write file %1:\n%2")
@@ -252,8 +252,8 @@ ClassInfoPage::ClassInfoPage(QWidget *parent)
defaultCtorRadioButton->setChecked(true);
- connect(defaultCtorRadioButton, SIGNAL(toggled(bool)),
- copyCtorCheckBox, SLOT(setEnabled(bool)));
+ connect(defaultCtorRadioButton, &QAbstractButton::toggled,
+ copyCtorCheckBox, &QWidget::setEnabled);
//! [11] //! [12]
registerField("className*", classNameLineEdit);
@@ -311,14 +311,14 @@ CodeStylePage::CodeStylePage(QWidget *parent)
baseIncludeLineEdit = new QLineEdit;
baseIncludeLabel->setBuddy(baseIncludeLineEdit);
- connect(protectCheckBox, SIGNAL(toggled(bool)),
- macroNameLabel, SLOT(setEnabled(bool)));
- connect(protectCheckBox, SIGNAL(toggled(bool)),
- macroNameLineEdit, SLOT(setEnabled(bool)));
- connect(includeBaseCheckBox, SIGNAL(toggled(bool)),
- baseIncludeLabel, SLOT(setEnabled(bool)));
- connect(includeBaseCheckBox, SIGNAL(toggled(bool)),
- baseIncludeLineEdit, SLOT(setEnabled(bool)));
+ connect(protectCheckBox, &QAbstractButton::toggled,
+ macroNameLabel, &QWidget::setEnabled);
+ connect(protectCheckBox, &QAbstractButton::toggled,
+ macroNameLineEdit, &QWidget::setEnabled);
+ connect(includeBaseCheckBox, &QAbstractButton::toggled,
+ baseIncludeLabel, &QWidget::setEnabled);
+ connect(includeBaseCheckBox, &QAbstractButton::toggled,
+ baseIncludeLineEdit, &QWidget::setEnabled);
registerField("comment", commentCheckBox);
registerField("protect", protectCheckBox);
@@ -356,9 +356,9 @@ void CodeStylePage::initializePage()
if (baseClass.isEmpty()) {
baseIncludeLineEdit->clear();
} else if (QRegExp("Q[A-Z].*").exactMatch(baseClass)) {
- baseIncludeLineEdit->setText("<" + baseClass + ">");
+ baseIncludeLineEdit->setText('<' + baseClass + '>');
} else {
- baseIncludeLineEdit->setText("\"" + baseClass.toLower() + ".h\"");
+ baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\"");
}
}
//! [16]
diff --git a/examples/widgets/dialogs/configdialog/configdialog.cpp b/examples/widgets/dialogs/configdialog/configdialog.cpp
index 8e68940227..c4565a6407 100644
--- a/examples/widgets/dialogs/configdialog/configdialog.cpp
+++ b/examples/widgets/dialogs/configdialog/configdialog.cpp
@@ -62,7 +62,7 @@ ConfigDialog::ConfigDialog()
createIcons();
contentsWidget->setCurrentRow(0);
- connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(closeButton, &QAbstractButton::clicked, this, &QWidget::close);
QHBoxLayout *horizontalLayout = new QHBoxLayout;
horizontalLayout->addWidget(contentsWidget);
@@ -102,9 +102,7 @@ void ConfigDialog::createIcons()
queryButton->setTextAlignment(Qt::AlignHCenter);
queryButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- connect(contentsWidget,
- SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
- this, SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
+ connect(contentsWidget, &QListWidget::currentItemChanged, this, &ConfigDialog::changePage);
}
void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
diff --git a/examples/widgets/dialogs/extension/finddialog.cpp b/examples/widgets/dialogs/extension/finddialog.cpp
index 19eab195cb..895b0cf2ce 100644
--- a/examples/widgets/dialogs/extension/finddialog.cpp
+++ b/examples/widgets/dialogs/extension/finddialog.cpp
@@ -78,7 +78,7 @@ FindDialog::FindDialog(QWidget *parent)
buttonBox->addButton(findButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole);
- connect(moreButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool)));
+ connect(moreButton, &QAbstractButton::toggled, extension, &QWidget::setVisible);
QVBoxLayout *extensionLayout = new QVBoxLayout;
extensionLayout->setMargin(0);
diff --git a/examples/widgets/dialogs/findfiles/window.cpp b/examples/widgets/dialogs/findfiles/window.cpp
index 86c34a6352..780c398ad5 100644
--- a/examples/widgets/dialogs/findfiles/window.cpp
+++ b/examples/widgets/dialogs/findfiles/window.cpp
@@ -46,8 +46,10 @@
Window::Window(QWidget *parent)
: QWidget(parent)
{
- browseButton = createButton(tr("&Browse..."), SLOT(browse()));
- findButton = createButton(tr("&Find"), SLOT(find()));
+ browseButton = new QPushButton(tr("&Browse..."), this);
+ connect(browseButton, &QAbstractButton::clicked, this, &Window::browse);
+ findButton = new QPushButton(tr("&Find"), this);
+ connect(findButton, &QAbstractButton::clicked, this, &Window::find);
fileComboBox = createComboBox(tr("*"));
textComboBox = createComboBox();
@@ -195,15 +197,6 @@ void Window::showFiles(const QStringList &files)
}
//! [8]
-//! [9]
-QPushButton *Window::createButton(const QString &text, const char *member)
-{
- QPushButton *button = new QPushButton(text);
- connect(button, SIGNAL(clicked()), this, member);
- return button;
-}
-//! [9]
-
//! [10]
QComboBox *Window::createComboBox(const QString &text)
{
@@ -228,8 +221,8 @@ void Window::createFilesTable()
filesTable->verticalHeader()->hide();
filesTable->setShowGrid(false);
- connect(filesTable, SIGNAL(cellActivated(int,int)),
- this, SLOT(openFileOfItem(int,int)));
+ connect(filesTable, &QTableWidget::cellActivated,
+ this, &Window::openFileOfItem);
}
//! [11]
diff --git a/examples/widgets/dialogs/findfiles/window.h b/examples/widgets/dialogs/findfiles/window.h
index 281c932e2f..89dd87b83b 100644
--- a/examples/widgets/dialogs/findfiles/window.h
+++ b/examples/widgets/dialogs/findfiles/window.h
@@ -68,7 +68,6 @@ private slots:
private:
QStringList findFiles(const QStringList &files, const QString &text);
void showFiles(const QStringList &files);
- QPushButton *createButton(const QString &text, const char *member);
QComboBox *createComboBox(const QString &text = QString());
void createFilesTable();
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
index ace2e1229a..0f11f3ab7b 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
@@ -70,7 +70,7 @@ LicenseWizard::LicenseWizard(QWidget *parent)
setPixmap(QWizard::LogoPixmap, QPixmap(":/images/logo.png"));
//! [7]
- connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
+ connect(this, &QWizard::helpRequested, this, &LicenseWizard::showHelp);
//! [7]
setWindowTitle(tr("License Wizard"));
@@ -339,13 +339,13 @@ void ConclusionPage::setVisible(bool visible)
//! [29]
wizard()->setButtonText(QWizard::CustomButton1, tr("&Print"));
wizard()->setOption(QWizard::HaveCustomButton1, true);
- connect(wizard(), SIGNAL(customButtonClicked(int)),
- this, SLOT(printButtonClicked()));
+ connect(wizard(), &QWizard::customButtonClicked,
+ this, &ConclusionPage::printButtonClicked);
//! [29]
} else {
wizard()->setOption(QWizard::HaveCustomButton1, false);
- disconnect(wizard(), SIGNAL(customButtonClicked(int)),
- this, SLOT(printButtonClicked()));
+ disconnect(wizard(), &QWizard::customButtonClicked,
+ this, &ConclusionPage::printButtonClicked);
}
}
//! [28]
diff --git a/examples/widgets/dialogs/sipdialog/dialog.cpp b/examples/widgets/dialogs/sipdialog/dialog.cpp
index f57cd094ae..48859ec5ff 100644
--- a/examples/widgets/dialogs/sipdialog/dialog.cpp
+++ b/examples/widgets/dialogs/sipdialog/dialog.cpp
@@ -89,10 +89,9 @@ Dialog::Dialog()
//! [Dialog constructor part4]
//! [Dialog constructor part5]
- connect(button, SIGNAL(clicked()),
- qApp, SLOT(closeAllWindows()));
- connect(QApplication::desktop(), SIGNAL(workAreaResized(int)),
- this, SLOT(desktopResized(int)));
+ connect(button, &QAbstractButton::clicked, qApp, &QApplication::closeAllWindows);
+ connect(QApplication::desktop(), &QDesktopWidget::workAreaResized,
+ this, &Dialog::desktopResized);
}
//! [Dialog constructor part5]
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.cpp b/examples/widgets/dialogs/standarddialogs/dialog.cpp
index 0a1532616c..b28cf0f934 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.cpp
+++ b/examples/widgets/dialogs/standarddialogs/dialog.cpp
@@ -98,9 +98,19 @@ int DialogOptionsWidget::value() const
Dialog::Dialog(QWidget *parent)
: QWidget(parent)
{
- QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QVBoxLayout *verticalLayout;
+ if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
+ QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
+ QGroupBox *groupBox = new QGroupBox(QGuiApplication::applicationDisplayName(), this);
+ horizontalLayout->addWidget(groupBox);
+ horizontalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored));
+ verticalLayout = new QVBoxLayout(groupBox);
+ } else {
+ verticalLayout = new QVBoxLayout(this);
+ }
+
QToolBox *toolbox = new QToolBox;
- mainLayout->addWidget(toolbox);
+ verticalLayout->addWidget(toolbox);
errorMessageDialog = new QErrorMessage(this);
@@ -180,27 +190,27 @@ Dialog::Dialog(QWidget *parent)
QPushButton *errorButton =
new QPushButton(tr("QErrorMessage::showM&essage()"));
- connect(integerButton, SIGNAL(clicked()), this, SLOT(setInteger()));
- connect(doubleButton, SIGNAL(clicked()), this, SLOT(setDouble()));
- connect(itemButton, SIGNAL(clicked()), this, SLOT(setItem()));
- connect(textButton, SIGNAL(clicked()), this, SLOT(setText()));
- connect(multiLineTextButton, SIGNAL(clicked()), this, SLOT(setMultiLineText()));
- connect(colorButton, SIGNAL(clicked()), this, SLOT(setColor()));
- connect(fontButton, SIGNAL(clicked()), this, SLOT(setFont()));
- connect(directoryButton, SIGNAL(clicked()),
- this, SLOT(setExistingDirectory()));
- connect(openFileNameButton, SIGNAL(clicked()),
- this, SLOT(setOpenFileName()));
- connect(openFileNamesButton, SIGNAL(clicked()),
- this, SLOT(setOpenFileNames()));
- connect(saveFileNameButton, SIGNAL(clicked()),
- this, SLOT(setSaveFileName()));
- connect(criticalButton, SIGNAL(clicked()), this, SLOT(criticalMessage()));
- connect(informationButton, SIGNAL(clicked()),
- this, SLOT(informationMessage()));
- connect(questionButton, SIGNAL(clicked()), this, SLOT(questionMessage()));
- connect(warningButton, SIGNAL(clicked()), this, SLOT(warningMessage()));
- connect(errorButton, SIGNAL(clicked()), this, SLOT(errorMessage()));
+ connect(integerButton, &QAbstractButton::clicked, this, &Dialog::setInteger);
+ connect(doubleButton, &QAbstractButton::clicked, this, &Dialog::setDouble);
+ connect(itemButton, &QAbstractButton::clicked, this, &Dialog::setItem);
+ connect(textButton, &QAbstractButton::clicked, this, &Dialog::setText);
+ connect(multiLineTextButton, &QAbstractButton::clicked, this, &Dialog::setMultiLineText);
+ connect(colorButton, &QAbstractButton::clicked, this, &Dialog::setColor);
+ connect(fontButton, &QAbstractButton::clicked, this, &Dialog::setFont);
+ connect(directoryButton, &QAbstractButton::clicked,
+ this, &Dialog::setExistingDirectory);
+ connect(openFileNameButton, &QAbstractButton::clicked,
+ this, &Dialog::setOpenFileName);
+ connect(openFileNamesButton, &QAbstractButton::clicked,
+ this, &Dialog::setOpenFileNames);
+ connect(saveFileNameButton, &QAbstractButton::clicked,
+ this, &Dialog::setSaveFileName);
+ connect(criticalButton, &QAbstractButton::clicked, this, &Dialog::criticalMessage);
+ connect(informationButton, &QAbstractButton::clicked,
+ this, &Dialog::informationMessage);
+ connect(questionButton, &QAbstractButton::clicked, this, &Dialog::questionMessage);
+ connect(warningButton, &QAbstractButton::clicked, this, &Dialog::warningMessage);
+ connect(errorButton, &QAbstractButton::clicked, this, &Dialog::errorMessage);
QWidget *page = new QWidget;
QGridLayout *layout = new QGridLayout(page);
@@ -242,6 +252,10 @@ Dialog::Dialog(QWidget *parent)
layout->addWidget(fontLabel, 0, 1);
fontDialogOptionsWidget = new DialogOptionsWidget;
fontDialogOptionsWidget->addCheckBox(doNotUseNativeDialog, QFontDialog::DontUseNativeDialog);
+ fontDialogOptionsWidget->addCheckBox(tr("Show scalable fonts"), QFontDialog::ScalableFonts);
+ fontDialogOptionsWidget->addCheckBox(tr("Show non scalable fonts"), QFontDialog::NonScalableFonts);
+ fontDialogOptionsWidget->addCheckBox(tr("Show monospaced fonts"), QFontDialog::MonospacedFonts);
+ fontDialogOptionsWidget->addCheckBox(tr("Show proportional fonts"), QFontDialog::ProportionalFonts);
fontDialogOptionsWidget->addCheckBox(tr("No buttons") , QFontDialog::NoButtons);
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding), 1, 0);
layout->addWidget(fontDialogOptionsWidget, 2, 0, 1 ,2);
@@ -266,6 +280,7 @@ Dialog::Dialog(QWidget *parent)
fileDialogOptionsWidget->addCheckBox(tr("Do not use sheet"), QFileDialog::DontUseSheet);
fileDialogOptionsWidget->addCheckBox(tr("Readonly"), QFileDialog::ReadOnly);
fileDialogOptionsWidget->addCheckBox(tr("Hide name filter details"), QFileDialog::HideNameFilterDetails);
+ fileDialogOptionsWidget->addCheckBox(tr("Do not use custom directory icons (Windows)"), QFileDialog::DontUseCustomDirectoryIcons);
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding), 4, 0);
layout->addWidget(fileDialogOptionsWidget, 5, 0, 1 ,2);
toolbox->addItem(page, tr("File Dialogs"));
@@ -286,7 +301,7 @@ Dialog::Dialog(QWidget *parent)
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding), 5, 0);
toolbox->addItem(page, tr("Message Boxes"));
- setWindowTitle(tr("Standard Dialogs"));
+ setWindowTitle(QGuiApplication::applicationDisplayName());
}
void Dialog::setInteger()
diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp
index eafd2271df..8a8ee2ac0b 100644
--- a/examples/widgets/dialogs/standarddialogs/main.cpp
+++ b/examples/widgets/dialogs/standarddialogs/main.cpp
@@ -39,6 +39,8 @@
****************************************************************************/
#include <QApplication>
+#include <QStyleHints>
+#include <QDesktopWidget>
#include <QTranslator>
#include <QLocale>
#include <QLibraryInfo>
@@ -48,6 +50,7 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QGuiApplication::setApplicationDisplayName(Dialog::tr("Standard Dialogs"));
#ifndef QT_NO_TRANSLATION
QString translatorFileName = QLatin1String("qt_");
@@ -58,6 +61,12 @@ int main(int argc, char *argv[])
#endif
Dialog dialog;
+ if (!QGuiApplication::styleHints()->showIsFullScreen() && !QGuiApplication::styleHints()->showIsMaximized()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&dialog);
+ dialog.resize(availableGeometry.width() / 3, availableGeometry.height() * 2 / 3);
+ dialog.move((availableGeometry.width() - dialog.width()) / 2,
+ (availableGeometry.height() - dialog.height()) / 2);
+ }
dialog.show();
return app.exec();
diff --git a/examples/widgets/dialogs/tabdialog/tabdialog.cpp b/examples/widgets/dialogs/tabdialog/tabdialog.cpp
index ec1a6efbc8..75a7b85e3b 100644
--- a/examples/widgets/dialogs/tabdialog/tabdialog.cpp
+++ b/examples/widgets/dialogs/tabdialog/tabdialog.cpp
@@ -59,8 +59,8 @@ TabDialog::TabDialog(const QString &fileName, QWidget *parent)
//! [1] //! [3]
| QDialogButtonBox::Cancel);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
//! [2] //! [3]
//! [4]
diff --git a/examples/widgets/doc/images/regularexpression-example.png b/examples/widgets/doc/images/regularexpression-example.png
new file mode 100644
index 0000000000..d426d8514a
--- /dev/null
+++ b/examples/widgets/doc/images/regularexpression-example.png
Binary files differ
diff --git a/examples/widgets/doc/images/systemtray-editor.png b/examples/widgets/doc/images/systemtray-editor.png
new file mode 100644
index 0000000000..fb15dea8cb
--- /dev/null
+++ b/examples/widgets/doc/images/systemtray-editor.png
Binary files differ
diff --git a/examples/widgets/doc/images/systemtray-example.png b/examples/widgets/doc/images/systemtray-example.png
new file mode 100644
index 0000000000..98b5c8133e
--- /dev/null
+++ b/examples/widgets/doc/images/systemtray-example.png
Binary files differ
diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc
index ac32c592fc..cd284ecba0 100644
--- a/examples/widgets/doc/src/application.qdoc
+++ b/examples/widgets/doc/src/application.qdoc
@@ -50,11 +50,10 @@
To keep the example simple, recently opened files aren't shown in
the \uicontrol{File} menu, even though this feature is desired in 90%
- of applications. The \l{mainwindows/recentfiles}{Recent Files}
- example shows how to implement this. Furthermore, this example
- can only load one file at a time. The \l{mainwindows/sdi}{SDI}
- and \l{mainwindows/mdi}{MDI} examples shows how to lift these
- restrictions.
+ of applications. Furthermore, this example can only load one file at a
+ time. The \l{mainwindows/sdi}{SDI} and \l{mainwindows/mdi}{MDI} examples
+ show how to lift these restrictions and how to implement recently opened files
+ handling.
\section1 MainWindow Class Definition
@@ -96,8 +95,7 @@
the widget that occupies the central area of the main window,
between the toolbars and the status bar.
- Then we call \c createActions(), \c createMenus(), \c
- createToolBars(), and \c createStatusBar(), four private
+ Then we call \c createActions() and \c createStatusBar(), two private
functions that set up the user interface. After that, we call \c
readSettings() to restore the user's preferences.
@@ -184,7 +182,8 @@
\snippet mainwindows/application/mainwindow.cpp 22
The \c createActions() private function, which is called from the
- \c MainWindow constructor, creates \l{QAction}s. The code is very
+ \c MainWindow constructor, creates \l{QAction}s and populates
+ the menus and two toolbars. The code is very
repetitive, so we show only the actions corresponding to
\uicontrol{File|New}, \uicontrol{File|Open}, and \uicontrol{Help|About Qt}.
@@ -198,13 +197,27 @@
a "What's This?" text, and more. It emits a
\l{QAction::triggered()}{triggered()} signal whenever the user
invokes the action (e.g., by clicking the associated menu item or
- toolbar button). We connect this signal to a slot that performs
- the actual action.
+ toolbar button).
+
+ Instances of QAction can be created by passing a parent QObject or
+ by using one of the convenience functions of QMenu, QMenuBar or QToolBar.
+ We create the actions that are in a menu as well as in a toolbar
+ parented on the window to prevent ownership issues. For actions
+ that are only in the menu, we use the convenience function
+ QMenu::addAction(), which allows us to pass text, icon and the
+ target object and its slot member function.
+
+ Creating toolbars is very similar to creating menus. The same
+ actions that we put in the menus can be reused in the toolbars.
+ After creating the action, we add it to the toolbar using
+ QToolBar::addAction().
The code above contains one more idiom that must be explained.
For some of the actions, we specify an icon as a QIcon to the
- QAction constructor. The QIcon constructor takes the file name
- of an image that it tries to load. Here, the file name starts
+ QAction constructor. We use QIcon::fromTheme() to obtain
+ the correct standard icon from the underlying window system.
+ If that fails due to the platform not supporting it, we
+ pass a file name as fallback. Here, the file name starts
with \c{:}. Such file names aren't ordinary file names, but
rather path in the executable's stored resources. We'll come back
to this when we review the \c application.qrc file that's part of
@@ -219,30 +232,12 @@
the QAction::setEnabled() slot, ensuring that the actions are
disabled when the text editor has no selection.
- \snippet mainwindows/application/mainwindow.cpp 25
- \snippet mainwindows/application/mainwindow.cpp 27
-
- Creating actions isn't sufficient to make them available to the
- user; we must also add them to the menu system. This is what \c
- createMenus() does. We create a \uicontrol{File}, an \uicontrol{Edit}, and
- a \uicontrol{Help} menu. QMainWindow::menuBar() lets us access the
- window's menu bar widget. We don't have to worry about creating
- the menu bar ourselves; the first time we call this function, the
- QMenuBar is created.
-
Just before we create the \uicontrol{Help} menu, we call
QMenuBar::addSeparator(). This has no effect for most widget
styles (e.g., Windows and OS X styles), but for some
styles this makes sure that \uicontrol{Help} is pushed to the right
side of the menu bar.
- Let's now review the toolbars:
-
- \snippet mainwindows/application/mainwindow.cpp 30
-
- Creating toolbars is very similar to creating menus. The same
- actions that we put in the menus can be reused in the toolbars.
-
\snippet mainwindows/application/mainwindow.cpp 32
\snippet mainwindows/application/mainwindow.cpp 33
@@ -265,15 +260,15 @@
company and the name of the product. This ensures that the
settings for different applications are kept separately.
- We use QSettings::value() to extract the value of the "pos" and
- "size" settings. The second argument to QSettings::value() is
+ We use QSettings::value() to extract the value of the geometry setting.
+ The second argument to QSettings::value() is
optional and specifies a default value for the setting if there
exists none. This value is used the first time the application is
run.
- When restoring the position and size of a window, it's important
- to call QWidget::resize() before QWidget::move(). The reason why
- is given in the \l{Window Geometry} overview.
+ We use QWidget::saveGeometry() and Widget::restoreGeometry() to
+ save the position. They use an opaque QByteArray to store
+ screen number, geometry and window state.
\snippet mainwindows/application/mainwindow.cpp 37
\snippet mainwindows/application/mainwindow.cpp 39
@@ -297,9 +292,9 @@
QMessageBox::Escape flag.
The \c maybeSave() function returns \c true in all cases, except
- when the user clicks \uicontrol{Cancel}. The caller must check the
- return value and stop whatever it was doing if the return value
- is \c false.
+ when the user clicks \uicontrol{Cancel} or saving the file fails.
+ The caller must check the return value and stop whatever it was
+ doing if the return value is \c false.
\snippet mainwindows/application/mainwindow.cpp 42
\snippet mainwindows/application/mainwindow.cpp 43
@@ -361,6 +356,10 @@
\snippet mainwindows/application/main.cpp 0
+ The main function uses QCommandLineParser to check whether some file
+ argument was passed to the application and loads it via
+ MainWindow::loadFile().
+
\section1 The Resource File
As you will probably recall, for some of the actions, we
diff --git a/examples/widgets/doc/src/codeeditor.qdoc b/examples/widgets/doc/src/codeeditor.qdoc
index 645854a58c..6c9e5921b8 100644
--- a/examples/widgets/doc/src/codeeditor.qdoc
+++ b/examples/widgets/doc/src/codeeditor.qdoc
@@ -192,6 +192,6 @@
fetched with QTextBlock::userData(). Matching parentheses can be
highlighted with an extra selection. The "Matching Parentheses
with QSyntaxHighlighter" article in Qt Quarterly 31 implements
- this. You find it here: \l{http://doc.qt.digia.com/qq/}.
+ this. You find it here: \l{http://doc.qt.io/archives/qq/}.
*/
diff --git a/examples/widgets/doc/src/findfiles.qdoc b/examples/widgets/doc/src/findfiles.qdoc
index 0a4fb8268d..dd06ed8bb4 100644
--- a/examples/widgets/doc/src/findfiles.qdoc
+++ b/examples/widgets/doc/src/findfiles.qdoc
@@ -200,13 +200,6 @@
We also update the total number of files found.
- \snippet dialogs/findfiles/window.cpp 9
-
- The private \c createButton() function is called from the
- constructor. We create a QPushButton with the provided text,
- connect it to the provided slot, and return a pointer to the
- button.
-
\snippet dialogs/findfiles/window.cpp 10
The private \c createComboBox() function is also called from the
diff --git a/examples/widgets/doc/src/icons.qdoc b/examples/widgets/doc/src/icons.qdoc
index 5a902e1d98..16cdb5abd0 100644
--- a/examples/widgets/doc/src/icons.qdoc
+++ b/examples/widgets/doc/src/icons.qdoc
@@ -254,6 +254,21 @@
generated pixmaps corresponding to an icon's possible states and
modes at a given size.
+ \snippet widgets/icons/iconpreviewarea.cpp 42
+
+ We would like the table columns to be in the order QIcon::Normal,
+ QIcon::Active, QIcon::Disabled, QIcon::Selected and the rows in the order
+ QIcon::Off, QIcon::On, which does not match the enumeration. The above code
+ provides arrays allowing to map from enumeration value to row/column
+ (by using QVector::indexOf()) and back by using the array index and lists
+ of the matching strings. Qt's containers can be easily populated by
+ using C++ 11 initializer lists. If the compiler does not provide that feature,
+ a pattern like
+
+ \snippet widgets/icons/iconpreviewarea.cpp 43
+
+ can be used.
+
We need two public functions to set the current icon and the
icon's size. In addition the class has three private functions: We
use the \c createHeaderLabel() and \c createPixmapLabel()
@@ -326,7 +341,12 @@
For each mode, and for each state, we retrieve a pixmap using the
QIcon::pixmap() function, which generates a pixmap corresponding
- to the given state, mode and size.
+ to the given state, mode and size. We pass the QWindows instance
+ obtained by calling QWidget::windowHandle() on the top level
+ widget (QWidget::nativeParentWidget()) in order to retrieve
+ the pixmap that matches best.
+ We format a tooltip displaying size, actual size and device pixel
+ ratio.
\section2 MainWindow Class Definition
@@ -347,8 +367,14 @@
\li The \c changeSize() slot changes the size of the preview area's icon.
\li The \c changeIcon() slot updates the set of pixmaps available to the
icon displayed in the preview area.
- \li The \c addImage() slot allows the user to load a new image into the
- application.
+ \li The \c addSampleImages() slot allows the user to load a new image
+ from the samples provided into the application.
+ \li The \c addOtherImages() slot allows the user to load a new image from
+ the directory obtained by calling
+ QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).
+ \li The \c screenChanged() updates the display in the \uicontrol{High DPI}
+ group box to correctly display the parameters of the current screen
+ the window is located on.
\endlist
In addition we declare several private functions to simplify the
@@ -362,8 +388,7 @@
widget and its child widgets, and put them in a grid layout. Then
we create the menus with their associated entries and actions.
- Before we resize the application window to a suitable size, we set
- the window title and determine the current style for the
+ We set the window title and determine the current style for the
application. We also enable the icon size spin box by clicking the
associated radio button, making the current value of the spin box
the icon's initial size.
@@ -421,21 +446,27 @@
The \c changeSize() slot sets the size for the preview area's
icon.
- To determine the new size we first check if the spin box is
+ It is invoked by the QButtonGroup whose members are radio buttons for
+ controlling the icon size. In \c createIconSizeGroupBox(), each button is
+ assigned a QStyle::PixelMetric value as an id, which is passed as a
+ parameter to the slot.
+
+ The special value \c OtherSize indicates that the spin box is
enabled. If it is, we extract the extent of the new size from the
- box. If it's not, we search through the predefined size options,
- extract the QStyle::PixelMetric and use the QStyle::pixelMetric()
- function to determine the extent. Then we create a QSize object
- based on the extent, and use that object to set the size of the
- preview area's icon.
+ box. If it's not, we query the style for the metric. Then we create
+ a QSize object based on the extent, and use that object to set the
+ size of the preview area's icon.
\snippet widgets/icons/mainwindow.cpp 12
- The first thing we do when the \c addImage() slot is called, is to
- show a file dialog to the user. The easiest way to create a file
- dialog is to use QFileDialog's static functions. Here we use the
- \l {QFileDialog::getOpenFileNames()}{getOpenFileNames()} function
- that will return one or more existing files selected by the user.
+ The function \c addImages() is called by the slot addSampleImages()
+ passing the samples directory, or by the slot addOtherImages()
+ passing the directory obtained by querying
+ QStandardPaths::standardLocations().
+
+ The first thing we do is to show a file dialog to the user.
+ We initialize it to show the filters returned by
+ QImageReader::supportedMimeTypes().
For each of the files the file dialog returns, we add a row to the
table widget. The table widget is listing the images the user has
@@ -446,9 +477,13 @@
We retrieve the image name using the QFileInfo::baseName()
function that returns the base name of the file without the path,
- and create the first table widget item in the row. Then we add the
- file's complete name to the item's data. Since an item can hold
- several information pieces, we need to assign the file name a role
+ and create the first table widget item in the row.
+ We check if a high resolution version of the image exists (identified by
+ the suffix \c @2x on the base name) and display that along with the size
+ in the tooltip.
+
+ We add the file's complete name to the item's data. Since an item can
+ hold several information pieces, we need to assign the file name a role
that will distinguish it from other data. This role can be Qt::UserRole
or any value above it.
@@ -465,7 +500,7 @@
contains "_act", "_dis", or "_sel", the modes are changed to
Active, Disabled, or Selected. And if the file name contains
"_on", the state is changed to On. The sample files in the
- example's \c images subdirectory respect this naming convension.
+ example's \c images subdirectory respect this naming convention.
\snippet widgets/icons/mainwindow.cpp 18
\snippet widgets/icons/mainwindow.cpp 19
@@ -482,7 +517,6 @@
make sure that the new image's check box is enabled.
\snippet widgets/icons/mainwindow.cpp 6
- \snippet widgets/icons/mainwindow.cpp 7
The \c changeIcon() slot is called when the user alters the set
of images listed in the QTableWidget, to update the QIcon object
@@ -562,7 +596,7 @@
\snippet widgets/icons/mainwindow.cpp 25
At the end, we connect the QTableWidget::itemChanged() signal to
- the \c changeIcon() slot to ensuret that the preview area is in
+ the \c changeIcon() slot to ensure that the preview area is in
sync with the image table.
\image icons_size_groupbox.png Screenshot of the icon size group box
@@ -574,7 +608,14 @@
\snippet widgets/icons/mainwindow.cpp 26
First we create a group box that will contain all the widgets;
- then we create the radio buttons and the spin box.
+ then we create the radio buttons and the spin box. We add the
+ radio buttons to an instance of QButtonGroup, using the value
+ of the QStyle::PixelMetric they represent as an integer id.
+
+ \snippet widgets/icons/mainwindow.cpp 40
+
+ We introduce an enumeration constant \c OtherSize to represent
+ a custom size.
The spin box is not a regular QSpinBox but an \c IconSizeSpinBox.
The \c IconSizeSpinBox class inherits QSpinBox and reimplements
@@ -602,19 +643,16 @@
In particular we create the \c styleActionGroup based on the
currently available GUI styles using
QStyleFactory. QStyleFactory::keys() returns a list of valid keys,
- typically including "windows", "cleanlooks" and
- "plastique". Depending on the platform, "windowsxp", "windowsvista", "gtk" and
- "macintosh" may be available.
+ typically including "windows" and "fusion". Depending on the platform,
+ "windowsvista" and "macintosh" may be available.
We create one action for each key, and adds the action to the
action group. Also, for each action, we call QAction::setData()
with the style name. We will retrieve it later using
QAction::data().
- \snippet widgets/icons/mainwindow.cpp 29
-
- In the \c createMenu() function, we add the previously created
- actions to the \uicontrol File, \uicontrol View and \uicontrol Help menus.
+ As we go along, we create the \uicontrol File, \uicontrol View and
+ \uicontrol Help menus and add the actions to them.
The QMenu class provides a menu widget for use in menu bars,
context menus, and other popup menus. We put each menu in the
@@ -656,6 +694,13 @@
Q_ASSERT() macro to make sure that QStyleFactory::create()
returned a valid pointer.
+ \snippet widgets/icons/mainwindow.cpp 44
+
+ We overload the show() function to set up the updating of the
+ current screen in \c screenChanged(). After calling QWidget::show(),
+ the QWindow associated with the QWidget is created and we can
+ connect to its QWindow::screenChanged() signal.
+
\section2 IconSizeSpinBox Class Definition
\snippet widgets/icons/iconsizespinbox.h 0
@@ -690,7 +735,7 @@
reimplement the \c valueFromText() function to interpret the
parameter text and return the associated int value.
- We parse the text using a regular expression (a QRegExp). We
+ We parse the text using a regular expression (a QRegularExpression). We
define an expression that matches one or several digits,
optionally followed by whitespace, an "x" or the times symbol,
whitespace and one or several digits again.
@@ -748,7 +793,7 @@
index for editing. The parent widget and style option are used to
control the appearance of the editor widget.
- Our reimplementation create and populate a combobox instead of
+ Our reimplementation creates and populates a combobox instead of
the default line edit. The contents of the combobox depends on
the column in the table for which the editor is requested. Column
1 contains the QIcon modes, whereas column 2 contains the QIcon
@@ -786,4 +831,12 @@
triggered the slot. This signal must be emitted when the editor
widget has completed editing the data, and wants to write it back
into the model.
+
+ \section2 The Implementation of the Function main()
+
+ \snippet widgets/icons/main.cpp 45
+
+ We use QCommandLineParser to handle any command line options or parameters
+ passed to the application. Then, we resize the main window according
+ to the available screen geometry and show it.
*/
diff --git a/examples/widgets/doc/src/imageviewer.qdoc b/examples/widgets/doc/src/imageviewer.qdoc
index 91ae56b5d7..4457da9d6f 100644
--- a/examples/widgets/doc/src/imageviewer.qdoc
+++ b/examples/widgets/doc/src/imageviewer.qdoc
@@ -287,7 +287,8 @@
\snippet widgets/imageviewer/imageviewer.cpp 18
In the private \c createAction() function, we create the
- actions providing the application features.
+ actions providing the application features and populate
+ a menu with them.
We assign a short-cut key to each action and connect them to the
appropriate slots. We only enable the \c openAct and \c exitAct at
@@ -295,16 +296,10 @@
been loaded into the application. In addition we make the \c
fitToWindowAct \l {QAction::checkable}{checkable}.
- \snippet widgets/imageviewer/imageviewer.cpp 19
- \snippet widgets/imageviewer/imageviewer.cpp 20
-
- In the private \c createMenu() function, we add the previously
- created actions to the \uicontrol File, \uicontrol View and \uicontrol Help menus.
-
The QMenu class provides a menu widget for use in menu bars,
context menus, and other popup menus. The QMenuBar class provides
a horizontal menu bar that consists of a list of pull-down menu
- items. So at the end we put the menus in the \c {ImageViewer}'s
+ items. So we put the menus in the \c {ImageViewer}'s
menu bar which we retrieve with the QMainWindow::menuBar()
function.
diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc
index cf83ea3507..b139de9fa1 100644
--- a/examples/widgets/doc/src/plugandpaint.qdoc
+++ b/examples/widgets/doc/src/plugandpaint.qdoc
@@ -285,9 +285,9 @@
\snippet tools/plugandpaint/main.cpp 0
- The argument to Q_IMPORT_PLUGIN() is the plugin's name, as
- specified with Q_PLUGIN_METADATA() in the \l{Exporting the
- Plugin}{plugin}.
+ The argument to Q_IMPORT_PLUGIN() is the plugin name, which corresponds
+ with the name of the class that declares metadata for the plugin with
+ Q_PLUGIN_METADATA().
In the \c .pro file, we need to specify the static library.
Here's the project file for building Plug & Paint:
diff --git a/examples/widgets/doc/src/recentfiles.qdoc b/examples/widgets/doc/src/recentfiles.qdoc
deleted file mode 100644
index b58c9a1f76..0000000000
--- a/examples/widgets/doc/src/recentfiles.qdoc
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example mainwindows/recentfiles
- \title Recent Files Example
- \ingroup examples-mainwindow
-
- \brief The Recent Files example shows how a standard File menu can be extended to show
- the most recent files loaded by a main window application.
-
- \image recentfiles-example.png
-*/
diff --git a/examples/widgets/doc/src/regularexpression.qdoc b/examples/widgets/doc/src/regularexpression.qdoc
new file mode 100644
index 0000000000..804867fb58
--- /dev/null
+++ b/examples/widgets/doc/src/regularexpression.qdoc
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example tools/regularexpression
+ \title QRegularExpression Example
+ \ingroup examples-widgets-tools
+
+ \brief The QRegularExpression example shows how regular expressions in Qt are
+ applied to text by providing an environment in which new regular expressions can be
+ created and tested on custom text strings.
+
+ The example makes usage of the QRegularExpression class, which has been
+ introduced in Qt 5.0. QRegularExpression implements Perl-compatible regular
+ expressions, supporting a number of advanced matching features, such as
+ case insensitive matching, multiline matching, Unicode properties selectors
+ and partial/incremental matching.
+
+ QRegularExpression is a big improvement over QRegExp in terms of features
+ and performance and should be used in all new code.
+
+ \image regularexpression-example.png
+*/
+
diff --git a/examples/widgets/doc/src/screenshot.qdoc b/examples/widgets/doc/src/screenshot.qdoc
index 32c4df9ec2..b376b6ce0e 100644
--- a/examples/widgets/doc/src/screenshot.qdoc
+++ b/examples/widgets/doc/src/screenshot.qdoc
@@ -33,7 +33,7 @@
desktop.
\brief The Screenshot example shows how to take a screenshot of the
- desktop using QApplication and QDesktopWidget. It also shows how
+ desktop using QScreen. It also shows how
to use QTimer to provide a single-shot timer, and how to
reimplement the QWidget::resizeEvent() event handler to make sure
that an application resizes smoothly and without data loss.
@@ -73,12 +73,9 @@
\uicontrol {Hide This Window} option.
\endlist
- We also declare some private functions: We use the \c
- createOptionsGroupBox(), \c createButtonsLayout() and \c
- createButton() functions when we construct the widget. And we call
- the private \c updateScreenshotLabel() function whenever a new
- screenshot is taken or when a resize event changes the size of the
- screenshot preview label.
+ We also declare the private function \c updateScreenshotLabel() which
+ is called whenever a new screenshot is taken or when a resize event
+ changes the size of the screenshot preview label.
In addition we need to store the screenshot's original pixmap. The
reason is that when we display the preview of the screenshot, we
@@ -100,11 +97,18 @@
aligned in the center of the \c Screenshot widget, and set its
minimum size.
+ Next, we create a group box that will contain all of the options'
+ widgets. Then we create a QSpinBox and a QLabel for the \uicontrol
+ {Screenshot Delay} option, and connect the spinbox to the \c
+ updateCheckBox() slot. Finally, we create a QCheckBox for the \uicontrol
+ {Hide This Window} option, add all the options' widgets to a
+ QGridLayout installed on the group box.
+
We create the applications's buttons and the group box containing
the application's options, and put it all into a main
layout. Finally we take the initial screenshot, and set the initial
delay and the window title, before we resize the widget to a
- suitable size.
+ suitable size depending on the screen geometry.
\snippet desktop/screenshot/screenshot.cpp 1
@@ -151,34 +155,37 @@
QFileDialog enables a user to traverse the file system in order to
select one or many files or a directory. The easiest way to create
a QFileDialog is to use the convenience static
- functions.
+ functions. Here, we instantiate the dialog on the stack in order
+ to be able to set up the supported mime types of QImageWriter,
+ allowing the user to save in a variety of formats.
We define the default file format to be png, and we make the file
- dialog's initial path the path the application is run from. We
- create the file dialog using the static
- QFileDialog::getSaveFileName() function which returns a file name
- selected by the user. The file does not have to exist. If the file
+ dialog's initial path the location of pictures as obtained from
+ QStandardPaths, defaulting to the path the application is run from.
+
+ We run the dialog by invoking QDialog::exec() and return if the
+ user canceled the dialog. If the dialog has been accepted, we
+ obtain a file name by calling QFileDialog::selectedFiles().
+ The file does not have to exist. If the file
name is valid, we use the QPixmap::save() function to save the
screenshot's original pixmap in that file.
\snippet desktop/screenshot/screenshot.cpp 4
- The \c shootScreen() slot is called to take the screenshot. If the
- user has chosen to delay the screenshot, we make the application
- beep when the screenshot is taken using the static
- QApplication::beep() function.
-
- The QApplication class manages the GUI application's control flow
- and main settings. It contains the main event loop, where all
- events from the window system and other sources are processed and
- dispatched.
+ The \c shootScreen() slot is called to take the screenshot.
- \snippet desktop/screenshot/screenshot.cpp 5
+ First, we find the instance of QScreen the window is located
+ by retrieving the QWindow and its QScreen, defaulting
+ to the primary screen. If no screen can be found, we return.
+ Although this is unlikely to happen, applications should check
+ for null pointers since there might be situations in which no
+ screen is connected.
- Using the static function QApplication::primaryScreen(), we
- obtain the QScreen object for the application's main screen.
+ If the user has chosen to delay the screenshot, we make the application
+ beep when the screenshot is taken using the static
+ QApplication::beep() function.
- We take the screenshot using the QScreen::grabWindow()
+ We then take the screenshot using the QScreen::grabWindow()
function. The function grabs the contents of the window passed as
an argument, makes a pixmap out of it and returns that pixmap.
The window id can be obtained with QWidget::winId() or QWindow::winId().
@@ -200,37 +207,6 @@
The \c updateCheckBox() slot is called whenever the user changes
the delay using the \uicontrol {Screenshot Delay} option.
- \snippet desktop/screenshot/screenshot.cpp 7
-
- The private \c createOptionsGroupBox() function is called from the
- constructor.
-
- First we create a group box that will contain all of the options'
- widgets. Then we create a QSpinBox and a QLabel for the \uicontrol
- {Screenshot Delay} option, and connect the spinbox to the \c
- updateCheckBox() slot. Finally, we create a QCheckBox for the \uicontrol
- {Hide This Window} option, add all the options' widgets to a
- QGridLayout and install the layout on the group box.
-
- Note that we don't have to specify any parents for the widgets
- when we create them. The reason is that when we add a widget to a
- layout and install the layout on another widget, the layout's
- widgets are automatically reparented to the widget the layout is
- installed on.
-
- \snippet desktop/screenshot/screenshot.cpp 8
-
- The private \c createButtonsLayout() function is called from the
- constructor. We create the application's buttons using the private
- \c createButton() function, and add them to a QHBoxLayout.
-
- \snippet desktop/screenshot/screenshot.cpp 9
-
- The private \c createButton() function is called from the \c
- createButtonsLayout() function. It simply creates a QPushButton
- with the provided text, connects it to the provided receiver and
- slot, and returns a pointer to the button.
-
\snippet desktop/screenshot/screenshot.cpp 10
The private \c updateScreenshotLabel() function is called whenever
diff --git a/examples/widgets/doc/src/syntaxhighlighter.qdoc b/examples/widgets/doc/src/syntaxhighlighter.qdoc
index 2b283afe5e..7d33299c81 100644
--- a/examples/widgets/doc/src/syntaxhighlighter.qdoc
+++ b/examples/widgets/doc/src/syntaxhighlighter.qdoc
@@ -248,7 +248,7 @@
It is possible to implement parenthesis matching with
QSyntaxHighlighter. The "Matching Parentheses with
QSyntaxHighlighter" article in Qt Quarterly 31
- (\l{http://doc.qt.digia.com/qq/}) implements this. We also have
+ (\l{http://doc.qt.io/archives/qq/}) implements this. We also have
the \l{Code Editor Example}, which shows how to implement line
numbers and how to highlight the current line.
diff --git a/examples/widgets/doc/src/systray.qdoc b/examples/widgets/doc/src/systray.qdoc
new file mode 100644
index 0000000000..b05f999dfa
--- /dev/null
+++ b/examples/widgets/doc/src/systray.qdoc
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example desktop/systray
+ \title System Tray Icon Example
+ \ingroup examples-widgets
+ \brief The System Tray Icon example shows how to add an icon with a menu
+ and popup messages to a desktop environment's system tray.
+
+ \image systemtray-example.png Screenshot of the System Tray Icon.
+
+ Modern operating systems usually provide a special area on the
+ desktop, called the system tray or notification area, where
+ long-running applications can display icons and short messages.
+
+ This example consists of one single class, \c Window, providing
+ the main application window (i.e., an editor for the system tray
+ icon) and the associated icon.
+
+ \image systemtray-editor.png
+
+ The editor allows the user to choose the preferred icon as well as
+ set the balloon message's type and duration. The user can also
+ edit the message's title and body. Finally, the editor provides a
+ checkbox controlling whether the icon is actually shown in the
+ system tray, or not.
+
+ \section1 Window Class Definition
+
+ The \c Window class inherits QWidget:
+
+ \snippet desktop/systray/window.h 0
+
+ We implement several private slots to respond to user
+ interaction. The other private functions are only convenience
+ functions provided to simplify the constructor.
+
+ The tray icon is an instance of the QSystemTrayIcon class. To
+ check whether a system tray is present on the user's desktop, call
+ the static QSystemTrayIcon::isSystemTrayAvailable()
+ function. Associated with the icon, we provide a menu containing
+ the typical \uicontrol minimize, \uicontrol maximize, \uicontrol restore and
+ \uicontrol quit actions. We reimplement the QWidget::setVisible() function
+ to update the tray icon's menu whenever the editor's appearance
+ changes, e.g., when maximizing or minimizing the main application
+ window.
+
+ Finally, we reimplement QWidget's \l {QWidget::}{closeEvent()}
+ function to be able to inform the user (when closing the editor
+ window) that the program will keep running in the system tray
+ until the user chooses the \uicontrol Quit entry in the icon's context
+ menu.
+
+ \section1 Window Class Implementation
+
+ When constructing the editor widget, we first create the various
+ editor elements before we create the actual system tray icon:
+
+ \snippet desktop/systray/window.cpp 0
+
+ We ensure that the application responds to user input by
+ connecting most of the editor's input widgets (including the
+ system tray icon) to the application's private slots. But note the
+ visibility checkbox; its \l {QCheckBox::}{toggled()} signal is
+ connected to the \e {icon}'s \l {QSystemTrayIcon::}{setVisible()}
+ function instead.
+
+ \snippet desktop/systray/window.cpp 3
+
+ The \c setIcon() slot is triggered whenever the current index in
+ the icon combobox changes, i.e., whenever the user chooses another
+ icon in the editor. Note that it is also called when the user
+ activates the tray icon with the left mouse button, triggering the
+ icon's \l {QSystemTrayIcon::}{activated()} signal. We will come
+ back to this signal shortly.
+
+ The QSystemTrayIcon::setIcon() function sets the \l
+ {QSystemTrayIcon::}{icon} property that holds the actual system
+ tray icon. On Windows, the system tray icon size is 16x16; on X11,
+ the preferred size is 22x22. The icon will be scaled to the
+ appropriate size as necessary.
+
+ Note that on X11, due to a limitation in the system tray
+ specification, mouse clicks on transparent areas in the icon are
+ propagated to the system tray. If this behavior is unacceptable,
+ we suggest using an icon with no transparency.
+
+ \snippet desktop/systray/window.cpp 4
+
+ Whenever the user activates the system tray icon, it emits its \l
+ {QSystemTrayIcon::}{activated()} signal passing the triggering
+ reason as parameter. QSystemTrayIcon provides the \l
+ {QSystemTrayIcon::}{ActivationReason} enum to describe how the
+ icon was activated.
+
+ In the constructor, we connected our icon's \l
+ {QSystemTrayIcon::}{activated()} signal to our custom \c
+ iconActivated() slot: If the user has clicked the icon using the
+ left mouse button, this function changes the icon image by
+ incrementing the icon combobox's current index, triggering the \c
+ setIcon() slot as mentioned above. If the user activates the icon
+ using the middle mouse button, it calls the custom \c
+ showMessage() slot:
+
+ \snippet desktop/systray/window.cpp 5
+
+ When the \e showMessage() slot is triggered, we first retrieve the
+ message icon depending on the currently chosen message type. The
+ QSystemTrayIcon::MessageIcon enum describes the icon that is shown
+ when a balloon message is displayed. Then we call
+ QSystemTrayIcon's \l {QSystemTrayIcon::}{showMessage()} function
+ to show the message with the title, body, and icon for the time
+ specified in milliseconds.
+
+ QSystemTrayIcon also has the corresponding, \l {QSystemTrayIcon::}
+ {messageClicked()} signal, which is emitted when the user clicks a
+ message displayed by \l {QSystemTrayIcon::}{showMessage()}.
+
+ \snippet desktop/systray/window.cpp 6
+
+ In the constructor, we connected the \l
+ {QSystemTrayIcon::}{messageClicked()} signal to our custom \c
+ messageClicked() slot that simply displays a message using the
+ QMessageBox class.
+
+ QMessageBox provides a modal dialog with a short message, an icon,
+ and buttons laid out depending on the current style. It supports
+ four severity levels: "Question", "Information", "Warning" and
+ "Critical". The easiest way to pop up a message box in Qt is to
+ call one of the associated static functions, e.g.,
+ QMessageBox::information().
+
+ As we mentioned earlier, we reimplement a couple of QWidget's
+ virtual functions:
+
+ \snippet desktop/systray/window.cpp 1
+
+ Our reimplementation of the QWidget::setVisible() function updates
+ the tray icon's menu whenever the editor's appearance changes,
+ e.g., when maximizing or minimizing the main application window,
+ before calling the base class implementation.
+
+ \snippet desktop/systray/window.cpp 2
+
+ We have reimplemented the QWidget::closeEvent() event handler to
+ receive widget close events, showing the above message to the
+ users when they are closing the editor window.
+
+ In addition to the functions and slots discussed above, we have
+ also implemented several convenience functions to simplify the
+ constructor: \c createIconGroupBox(), \c createMessageGroupBox(),
+ \c createActions() and \c createTrayIcon(). See the \l
+ {desktop/systray/window.cpp}{window.cpp} file for details.
+*/
diff --git a/examples/widgets/doc/src/tablet.qdoc b/examples/widgets/doc/src/tablet.qdoc
index 1ab2917b7e..bc03d46332 100644
--- a/examples/widgets/doc/src/tablet.qdoc
+++ b/examples/widgets/doc/src/tablet.qdoc
@@ -259,24 +259,18 @@
\snippet widgets/tablet/tabletcanvas.cpp 5
- In this function we draw on the pixmap based on the movement of the
- device. If the device used on the tablet is a stylus we want to draw a
- line between the positions of the stylus recorded in \c polyLine. We
- also assume that this is a reasonable handling of any unknown device,
- but update the statusbar with a warning so that the user can see that
- for his tablet he might have to implement special handling.
- If it is an airbrush we want to draw a circle of points with a
- point density based on the tangential pressure, which is the position
- of the finger wheel on the airbrush. We use the Qt::BrushStyle to
- draw the points as it has styles that draw points with different
- density; we select the style based on the tangential pressure in
- \c brushPattern().
+ In this function we draw on the pixmap based on the movement of the device.
+ If the device used on the tablet is a stylus, we want to draw a line from
+ the last-known position to the current position. We also assume that this
+ is a reasonable handling of any unknown device, but update the status bar
+ with a warning. If it is an airbrush, we want to draw a circle filled with
+ a soft gradient, whose density can depend on various event parameters.
+ By default it depends on the tangential pressure, which is the position of
+ the finger wheel on the airbrush. If it is a rotation stylus, we simulate
+ a felt marker by drawing trapezoidal strokes.
\snippet widgets/tablet/tabletcanvas.cpp 6
- We return a brush style with a point density that increases with
- the tangential pressure.
-
In \c updateBrush() we set the pen and brush used for drawing
to match \c alphaChannelType, \c lineWidthType, \c
colorSaturationType, and \c myColor. We will examine the code to
diff --git a/examples/widgets/doc/src/tetrix.qdoc b/examples/widgets/doc/src/tetrix.qdoc
index f74d3c14d5..6050fe2356 100644
--- a/examples/widgets/doc/src/tetrix.qdoc
+++ b/examples/widgets/doc/src/tetrix.qdoc
@@ -108,7 +108,7 @@
We connect \l{QAbstractButton::}{clicked()} signals from the \uicontrol{Start}
and \uicontrol{Pause} buttons to the board, and from the \uicontrol{Quit} button to the
- application's \l{QApplication::}{quit()} slot.
+ application's \l{QCoreApplication::quit()} slot.
\snippet widgets/tetrix/tetrixwindow.cpp 4
\snippet widgets/tetrix/tetrixwindow.cpp 5
diff --git a/examples/widgets/draganddrop/draggableicons/main.cpp b/examples/widgets/draganddrop/draggableicons/main.cpp
index 165f71dbf7..44b4f848bf 100644
--- a/examples/widgets/draganddrop/draggableicons/main.cpp
+++ b/examples/widgets/draganddrop/draggableicons/main.cpp
@@ -50,11 +50,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QWidget mainWidget;
- QHBoxLayout *horizontalLayout = new QHBoxLayout;
+ QHBoxLayout *horizontalLayout = new QHBoxLayout(&mainWidget);
horizontalLayout->addWidget(new DragWidget);
horizontalLayout->addWidget(new DragWidget);
- mainWidget.setLayout(horizontalLayout);
mainWidget.setWindowTitle(QObject::tr("Draggable Icons"));
mainWidget.show();
diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.pro b/examples/widgets/draganddrop/draggabletext/draggabletext.pro
index 2815be1613..1add2a270e 100644
--- a/examples/widgets/draganddrop/draggabletext/draggabletext.pro
+++ b/examples/widgets/draganddrop/draggabletext/draggabletext.pro
@@ -1,10 +1,8 @@
QT += widgets
-HEADERS = draglabel.h \
- dragwidget.h
+HEADERS = dragwidget.h
RESOURCES = draggabletext.qrc
-SOURCES = draglabel.cpp \
- dragwidget.cpp \
+SOURCES = dragwidget.cpp \
main.cpp
# install
diff --git a/examples/widgets/draganddrop/draggabletext/draglabel.cpp b/examples/widgets/draganddrop/draggabletext/draglabel.cpp
deleted file mode 100644
index 4e741fb6c8..0000000000
--- a/examples/widgets/draganddrop/draggabletext/draglabel.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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 "draglabel.h"
-
-DragLabel::DragLabel(const QString &text, QWidget *parent)
- : QLabel(text, parent)
-{
- setAutoFillBackground(true);
- setFrameShape(QFrame::Panel);
- setFrameShadow(QFrame::Raised);
-}
diff --git a/examples/widgets/draganddrop/draggabletext/draglabel.h b/examples/widgets/draganddrop/draggabletext/draglabel.h
deleted file mode 100644
index 8d2c31aa1d..0000000000
--- a/examples/widgets/draganddrop/draggabletext/draglabel.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef DRAGLABEL_H
-#define DRAGLABEL_H
-
-#include <QLabel>
-
-QT_BEGIN_NAMESPACE
-class QDragEnterEvent;
-class QDragMoveEvent;
-class QFrame;
-QT_END_NAMESPACE
-
-class DragLabel : public QLabel
-{
-public:
- DragLabel(const QString &text, QWidget *parent);
-};
-
-#endif // DRAGLABEL_H
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
index 3b8bca3277..36c4df2e43 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
@@ -40,13 +40,23 @@
#include <QtWidgets>
-#include "draglabel.h"
#include "dragwidget.h"
+static QLabel *createDragLabel(const QString &text, QWidget *parent)
+{
+ QLabel *label = new QLabel(text, parent);
+ label->setAutoFillBackground(true);
+ label->setFrameShape(QFrame::Panel);
+ label->setFrameShadow(QFrame::Raised);
+ return label;
+}
+
+static QString hotSpotMimeDataKey() { return QStringLiteral("application/x-hotspot"); }
+
DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
- QFile dictionaryFile(":/dictionary/words.txt");
+ QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
dictionaryFile.open(QIODevice::ReadOnly);
QTextStream inputStream(&dictionaryFile);
@@ -57,7 +67,7 @@ DragWidget::DragWidget(QWidget *parent)
QString word;
inputStream >> word;
if (!word.isEmpty()) {
- DragLabel *wordLabel = new DragLabel(word, this);
+ QLabel *wordLabel = createDragLabel(word, this);
wordLabel->move(x, y);
wordLabel->show();
wordLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -69,12 +79,6 @@ DragWidget::DragWidget(QWidget *parent)
}
}
- /*
- QPalette newPalette = palette();
- newPalette.setColor(QPalette::Window, Qt::white);
- setPalette(newPalette);
- */
-
setAcceptDrops(true);
setMinimumSize(400, qMax(200, y));
setWindowTitle(tr("Draggable Text"));
@@ -98,19 +102,19 @@ void DragWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasText()) {
const QMimeData *mime = event->mimeData();
- QStringList pieces = mime->text().split(QRegExp("\\s+"),
+ QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")),
QString::SkipEmptyParts);
QPoint position = event->pos();
QPoint hotSpot;
- QList<QByteArray> hotSpotPos = mime->data("application/x-hotspot").split(' ');
+ QByteArrayList hotSpotPos = mime->data(hotSpotMimeDataKey()).split(' ');
if (hotSpotPos.size() == 2) {
hotSpot.setX(hotSpotPos.first().toInt());
hotSpot.setY(hotSpotPos.last().toInt());
}
- foreach (QString piece, pieces) {
- DragLabel *newLabel = new DragLabel(piece, this);
+ foreach (const QString &piece, pieces) {
+ QLabel *newLabel = createDragLabel(piece, this);
newLabel->move(position - hotSpot);
newLabel->show();
newLabel->setAttribute(Qt::WA_DeleteOnClose);
@@ -127,18 +131,15 @@ void DragWidget::dropEvent(QDropEvent *event)
} else {
event->ignore();
}
- foreach (QObject *child, children()) {
- if (child->inherits("QWidget")) {
- QWidget *widget = static_cast<QWidget *>(child);
- if (!widget->isVisible())
- widget->deleteLater();
- }
+ foreach (QWidget *widget, findChildren<QWidget *>()) {
+ if (!widget->isVisible())
+ widget->deleteLater();
}
}
void DragWidget::mousePressEvent(QMouseEvent *event)
{
- QLabel *child = static_cast<QLabel*>(childAt(event->pos()));
+ QLabel *child = qobject_cast<QLabel*>(childAt(event->pos()));
if (!child)
return;
@@ -146,8 +147,8 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
QMimeData *mimeData = new QMimeData;
mimeData->setText(child->text());
- mimeData->setData("application/x-hotspot",
- QByteArray::number(hotSpot.x()) + " " + QByteArray::number(hotSpot.y()));
+ mimeData->setData(hotSpotMimeDataKey(),
+ QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
QPixmap pixmap(child->size());
child->render(&pixmap);
diff --git a/examples/widgets/draganddrop/dropsite/droparea.cpp b/examples/widgets/draganddrop/dropsite/droparea.cpp
index d3d2bb10ca..0016434cc3 100644
--- a/examples/widgets/draganddrop/dropsite/droparea.cpp
+++ b/examples/widgets/draganddrop/dropsite/droparea.cpp
@@ -92,10 +92,8 @@ void DropArea::dropEvent(QDropEvent *event)
} else if (mimeData->hasUrls()) {
QList<QUrl> urlList = mimeData->urls();
QString text;
- for (int i = 0; i < urlList.size() && i < 32; ++i) {
- QString url = urlList.at(i).path();
- text += url + QString("\n");
- }
+ for (int i = 0; i < urlList.size() && i < 32; ++i)
+ text += urlList.at(i).path() + QLatin1Char('\n');
setText(text);
} else {
setText(tr("Cannot display data"));
diff --git a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
index 5f0e689fc9..5d48be1c34 100644
--- a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
+++ b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
@@ -55,8 +55,8 @@ DropSiteWindow::DropSiteWindow()
//! [constructor part2]
dropArea = new DropArea;
- connect(dropArea, SIGNAL(changed(const QMimeData*)),
- this, SLOT(updateFormatsTable(const QMimeData*)));
+ connect(dropArea, &DropArea::changed,
+ this, &DropSiteWindow::updateFormatsTable);
//! [constructor part2]
//! [constructor part3]
@@ -78,17 +78,16 @@ DropSiteWindow::DropSiteWindow()
buttonBox->addButton(clearButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
- connect(quitButton, SIGNAL(pressed()), this, SLOT(close()));
- connect(clearButton, SIGNAL(pressed()), dropArea, SLOT(clear()));
+ connect(quitButton, &QAbstractButton::pressed, this, &QWidget::close);
+ connect(clearButton, &QAbstractButton::pressed, dropArea, &DropArea::clear);
//! [constructor part4]
//! [constructor part5]
- QVBoxLayout *mainLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(abstractLabel);
mainLayout->addWidget(dropArea);
mainLayout->addWidget(formatsTable);
mainLayout->addWidget(buttonBox);
- setLayout(mainLayout);
setWindowTitle(tr("Drop Site"));
setMinimumSize(350, 500);
@@ -112,22 +111,18 @@ void DropSiteWindow::updateFormatsTable(const QMimeData *mimeData)
//! [updateFormatsTable() part3]
QString text;
- if (format == "text/plain") {
+ if (format == QLatin1String("text/plain")) {
text = mimeData->text().simplified();
- } else if (format == "text/html") {
+ } else if (format == QLatin1String("text/html")) {
text = mimeData->html().simplified();
- } else if (format == "text/uri-list") {
+ } else if (format == QLatin1String("text/uri-list")) {
QList<QUrl> urlList = mimeData->urls();
for (int i = 0; i < urlList.size() && i < 32; ++i)
- text.append(urlList[i].toString() + " ");
+ text.append(urlList.at(i).toString() + QLatin1Char(' '));
} else {
QByteArray data = mimeData->data(format);
- for (int i = 0; i < data.size() && i < 32; ++i) {
- QString hex = QString("%1").arg(uchar(data[i]), 2, 16,
- QChar('0'))
- .toUpper();
- text.append(hex + " ");
- }
+ for (int i = 0; i < data.size() && i < 32; ++i)
+ text.append(QStringLiteral("%1 ").arg(uchar(data[i]), 2, 16, QLatin1Char('0')).toUpper());
}
//! [updateFormatsTable() part3]
diff --git a/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp b/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
index a591a29994..3a9ab5fa76 100644
--- a/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
+++ b/examples/widgets/draganddrop/fridgemagnets/dragwidget.cpp
@@ -43,11 +43,13 @@
#include <QtWidgets>
+static inline QString fridgetMagnetsMimeType() { return QStringLiteral("application/x-fridgemagnet"); }
+
//! [0]
DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
- QFile dictionaryFile(":/dictionary/words.txt");
+ QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
dictionaryFile.open(QFile::ReadOnly);
QTextStream inputStream(&dictionaryFile);
//! [0]
@@ -74,7 +76,6 @@ DragWidget::DragWidget(QWidget *parent)
//! [1]
//! [2]
- //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
@@ -90,7 +91,7 @@ DragWidget::DragWidget(QWidget *parent)
void DragWidget::dragEnterEvent(QDragEnterEvent *event)
{
//! [4] //! [5]
- if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
+ if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
if (children().contains(event->source())) {
event->setDropAction(Qt::MoveAction);
event->accept();
@@ -110,7 +111,7 @@ void DragWidget::dragEnterEvent(QDragEnterEvent *event)
//! [8]
void DragWidget::dragMoveEvent(QDragMoveEvent *event)
{
- if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
+ if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
if (children().contains(event->source())) {
event->setDropAction(Qt::MoveAction);
event->accept();
@@ -128,10 +129,10 @@ void DragWidget::dragMoveEvent(QDragMoveEvent *event)
//! [9]
void DragWidget::dropEvent(QDropEvent *event)
{
- if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
+ if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
const QMimeData *mime = event->mimeData();
//! [9] //! [10]
- QByteArray itemData = mime->data("application/x-fridgemagnet");
+ QByteArray itemData = mime->data(fridgetMagnetsMimeType());
QDataStream dataStream(&itemData, QIODevice::ReadOnly);
QString text;
@@ -152,11 +153,11 @@ void DragWidget::dropEvent(QDropEvent *event)
}
//! [11] //! [12]
} else if (event->mimeData()->hasText()) {
- QStringList pieces = event->mimeData()->text().split(QRegExp("\\s+"),
+ QStringList pieces = event->mimeData()->text().split(QRegularExpression(QStringLiteral("\\s+")),
QString::SkipEmptyParts);
QPoint position = event->pos();
- foreach (QString piece, pieces) {
+ foreach (const QString &piece, pieces) {
DragLabel *newLabel = new DragLabel(piece, this);
newLabel->move(position);
newLabel->show();
@@ -190,7 +191,7 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
//! [15]
QMimeData *mimeData = new QMimeData;
- mimeData->setData("application/x-fridgemagnet", itemData);
+ mimeData->setData(fridgetMagnetsMimeType(), itemData);
mimeData->setText(child->labelText());
//! [15]
diff --git a/examples/widgets/draganddrop/fridgemagnets/main.cpp b/examples/widgets/draganddrop/fridgemagnets/main.cpp
index edff4486d6..a52ff8cabd 100644
--- a/examples/widgets/draganddrop/fridgemagnets/main.cpp
+++ b/examples/widgets/draganddrop/fridgemagnets/main.cpp
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
#endif
DragWidget window;
- bool smallScreen = QApplication::arguments().contains("-small-screen");
+ bool smallScreen = QApplication::arguments().contains(QStringLiteral("-small-screen"));
if (smallScreen)
window.showFullScreen();
else
diff --git a/examples/widgets/draganddrop/puzzle/main.cpp b/examples/widgets/draganddrop/puzzle/main.cpp
index 706ebe4d70..e8ecbe37db 100644
--- a/examples/widgets/draganddrop/puzzle/main.cpp
+++ b/examples/widgets/draganddrop/puzzle/main.cpp
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
- window.openImage(":/images/example.jpg");
+ window.loadImage(QStringLiteral(":/images/example.jpg"));
window.show();
return app.exec();
}
diff --git a/examples/widgets/draganddrop/puzzle/mainwindow.cpp b/examples/widgets/draganddrop/puzzle/mainwindow.cpp
index 0fbdfc3f8d..48e79946e7 100644
--- a/examples/widgets/draganddrop/puzzle/mainwindow.cpp
+++ b/examples/widgets/draganddrop/puzzle/mainwindow.cpp
@@ -55,26 +55,27 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle(tr("Puzzle"));
}
-void MainWindow::openImage(const QString &path)
+void MainWindow::openImage()
{
- QString fileName = path;
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Image"), QString(),
+ tr("Image Files (*.png *.jpg *.bmp)"));
- if (fileName.isNull()) {
- fileName = QFileDialog::getOpenFileName(this,
- tr("Open Image"), "", "Image Files (*.png *.jpg *.bmp)");
- }
+ if (!fileName.isEmpty())
+ loadImage(fileName);
+}
- if (!fileName.isEmpty()) {
- QPixmap newImage;
- if (!newImage.load(fileName)) {
- QMessageBox::warning(this, tr("Open Image"),
- tr("The image file could not be loaded."),
- QMessageBox::Cancel);
- return;
- }
- puzzleImage = newImage;
- setupPuzzle();
+void MainWindow::loadImage(const QString &fileName)
+{
+ QPixmap newImage;
+ if (!newImage.load(fileName)) {
+ QMessageBox::warning(this, tr("Open Image"),
+ tr("The image file could not be loaded."),
+ QMessageBox::Close);
+ return;
}
+ puzzleImage = newImage;
+ setupPuzzle();
}
void MainWindow::setCompleted()
@@ -120,19 +121,15 @@ void MainWindow::setupMenus()
{
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
- QAction *openAction = fileMenu->addAction(tr("&Open..."));
+ QAction *openAction = fileMenu->addAction(tr("&Open..."), this, &MainWindow::openImage);
openAction->setShortcuts(QKeySequence::Open);
- QAction *exitAction = fileMenu->addAction(tr("E&xit"));
+ QAction *exitAction = fileMenu->addAction(tr("E&xit"), qApp, &QCoreApplication::quit);
exitAction->setShortcuts(QKeySequence::Quit);
QMenu *gameMenu = menuBar()->addMenu(tr("&Game"));
- QAction *restartAction = gameMenu->addAction(tr("&Restart"));
-
- connect(openAction, SIGNAL(triggered()), this, SLOT(openImage()));
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(restartAction, SIGNAL(triggered()), this, SLOT(setupPuzzle()));
+ gameMenu->addAction(tr("&Restart"), this, &MainWindow::setupPuzzle);
}
void MainWindow::setupWidgets()
@@ -144,8 +141,8 @@ void MainWindow::setupWidgets()
piecesList = new PiecesList(puzzleWidget->pieceSize(), this);
- connect(puzzleWidget, SIGNAL(puzzleCompleted()),
- this, SLOT(setCompleted()), Qt::QueuedConnection);
+ connect(puzzleWidget, &PuzzleWidget::puzzleCompleted,
+ this, &MainWindow::setCompleted, Qt::QueuedConnection);
frameLayout->addWidget(piecesList);
frameLayout->addWidget(puzzleWidget);
diff --git a/examples/widgets/draganddrop/puzzle/mainwindow.h b/examples/widgets/draganddrop/puzzle/mainwindow.h
index 093a14472e..b5b7d0d903 100644
--- a/examples/widgets/draganddrop/puzzle/mainwindow.h
+++ b/examples/widgets/draganddrop/puzzle/mainwindow.h
@@ -56,9 +56,10 @@ class MainWindow : public QMainWindow
public:
MainWindow(QWidget *parent = 0);
+ void loadImage(const QString &path);
public slots:
- void openImage(const QString &path = QString());
+ void openImage();
void setupPuzzle();
private slots:
diff --git a/examples/widgets/draganddrop/puzzle/pieceslist.cpp b/examples/widgets/draganddrop/puzzle/pieceslist.cpp
index e60fd0a9ff..fb27aa2304 100644
--- a/examples/widgets/draganddrop/puzzle/pieceslist.cpp
+++ b/examples/widgets/draganddrop/puzzle/pieceslist.cpp
@@ -57,7 +57,7 @@ PiecesList::PiecesList(int pieceSize, QWidget *parent)
void PiecesList::dragEnterEvent(QDragEnterEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece"))
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType()))
event->accept();
else
event->ignore();
@@ -65,7 +65,7 @@ void PiecesList::dragEnterEvent(QDragEnterEvent *event)
void PiecesList::dragMoveEvent(QDragMoveEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")) {
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())) {
event->setDropAction(Qt::MoveAction);
event->accept();
} else {
@@ -75,8 +75,8 @@ void PiecesList::dragMoveEvent(QDragMoveEvent *event)
void PiecesList::dropEvent(QDropEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")) {
- QByteArray pieceData = event->mimeData()->data("image/x-puzzle-piece");
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())) {
+ QByteArray pieceData = event->mimeData()->data(PiecesList::puzzleMimeType());
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QPixmap pixmap;
QPoint location;
@@ -112,7 +112,7 @@ void PiecesList::startDrag(Qt::DropActions /*supportedActions*/)
dataStream << pixmap << location;
QMimeData *mimeData = new QMimeData;
- mimeData->setData("image/x-puzzle-piece", itemData);
+ mimeData->setData(PiecesList::puzzleMimeType(), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
diff --git a/examples/widgets/draganddrop/puzzle/pieceslist.h b/examples/widgets/draganddrop/puzzle/pieceslist.h
index 83c1ad8285..07fa504f41 100644
--- a/examples/widgets/draganddrop/puzzle/pieceslist.h
+++ b/examples/widgets/draganddrop/puzzle/pieceslist.h
@@ -51,6 +51,8 @@ public:
explicit PiecesList(int pieceSize, QWidget *parent = 0);
void addPiece(QPixmap pixmap, QPoint location);
+ static QString puzzleMimeType() { return QStringLiteral("image/x-puzzle-piece"); }
+
protected:
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
diff --git a/examples/widgets/draganddrop/puzzle/puzzle.pro b/examples/widgets/draganddrop/puzzle/puzzle.pro
index 67fff21a26..404b75187d 100644
--- a/examples/widgets/draganddrop/puzzle/puzzle.pro
+++ b/examples/widgets/draganddrop/puzzle/puzzle.pro
@@ -18,5 +18,5 @@ INSTALLS += target
wince {
addFile.files = example.jpg
addFile.path = .
- DEPLOYMENT += addFile
+ INSTALLS += addFile
}
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp b/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
index 69c0cbf0cc..29052da4fb 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include "puzzlewidget.h"
+#include "pieceslist.h"
#include <QDrag>
#include <QDragEnterEvent>
@@ -65,7 +66,7 @@ void PuzzleWidget::clear()
void PuzzleWidget::dragEnterEvent(QDragEnterEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece"))
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType()))
event->accept();
else
event->ignore();
@@ -83,8 +84,8 @@ void PuzzleWidget::dragMoveEvent(QDragMoveEvent *event)
{
QRect updateRect = highlightedRect.united(targetSquare(event->pos()));
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")
- && findPiece(targetSquare(event->pos())) == -1) {
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())
+ && pieceRects.indexOf(targetSquare(event->pos())) == -1) {
highlightedRect = targetSquare(event->pos());
event->setDropAction(Qt::MoveAction);
@@ -99,10 +100,10 @@ void PuzzleWidget::dragMoveEvent(QDragMoveEvent *event)
void PuzzleWidget::dropEvent(QDropEvent *event)
{
- if (event->mimeData()->hasFormat("image/x-puzzle-piece")
- && findPiece(targetSquare(event->pos())) == -1) {
+ if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())
+ && pieceRects.indexOf(targetSquare(event->pos())) == -1) {
- QByteArray pieceData = event->mimeData()->data("image/x-puzzle-piece");
+ QByteArray pieceData = event->mimeData()->data(PiecesList::puzzleMimeType());
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QRect square = targetSquare(event->pos());
QPixmap pixmap;
@@ -130,19 +131,10 @@ void PuzzleWidget::dropEvent(QDropEvent *event)
}
}
-int PuzzleWidget::findPiece(const QRect &pieceRect) const
-{
- for (int i = 0; i < pieceRects.size(); ++i) {
- if (pieceRect == pieceRects[i])
- return i;
- }
- return -1;
-}
-
void PuzzleWidget::mousePressEvent(QMouseEvent *event)
{
QRect square = targetSquare(event->pos());
- int found = findPiece(square);
+ int found = pieceRects.indexOf(square);
if (found == -1)
return;
@@ -164,7 +156,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
dataStream << pixmap << location;
QMimeData *mimeData = new QMimeData;
- mimeData->setData("image/x-puzzle-piece", itemData);
+ mimeData->setData(PiecesList::puzzleMimeType(), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.h b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
index 6bf264b5e0..eb8a3a29f9 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.h
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
@@ -75,7 +75,6 @@ protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
- int findPiece(const QRect &pieceRect) const;
const QRect targetSquare(const QPoint &position) const;
QList<QPixmap> piecePixmaps;
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.cpp b/examples/widgets/gestures/imagegestures/imagewidget.cpp
index 440eb783c1..28c715c688 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.cpp
+++ b/examples/widgets/gestures/imagegestures/imagewidget.cpp
@@ -200,7 +200,6 @@ void ImageWidget::openDirectory(const QString &path)
QImage ImageWidget::loadImage(const QString &fileName)
{
- qDebug() << position << files << fileName;
QImageReader reader(fileName);
reader.setAutoTransform(true);
qCDebug(lcExample) << "loading" << QDir::toNativeSeparators(fileName) << position << '/' << files.size();
@@ -230,7 +229,7 @@ void ImageWidget::goNextImage()
prevImage = currentImage;
currentImage = nextImage;
if (position+1 < files.size())
- nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
+ nextImage = loadImage(path + QLatin1Char('/') + files.at(position+1));
else
nextImage = QImage();
}
@@ -247,7 +246,7 @@ void ImageWidget::goPrevImage()
nextImage = currentImage;
currentImage = prevImage;
if (position > 0)
- prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
+ prevImage = loadImage(path + QLatin1Char('/') + files.at(position-1));
else
prevImage = QImage();
}
@@ -277,12 +276,12 @@ void ImageWidget::goToImage(int index)
position = index;
if (index > 0)
- prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
+ prevImage = loadImage(path + QLatin1Char('/') + files.at(position-1));
else
prevImage = QImage();
- currentImage = loadImage(path+QLatin1String("/")+files.at(position));
+ currentImage = loadImage(path + QLatin1Char('/') + files.at(position));
if (position+1 < files.size())
- nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
+ nextImage = loadImage(path + QLatin1Char('/') + files.at(position+1));
else
nextImage = QImage();
update();
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h
index 1629516c0a..71ad2792d0 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.h
+++ b/examples/widgets/gestures/imagegestures/imagewidget.h
@@ -77,7 +77,6 @@ private:
void swipeTriggered(QSwipeGesture*);
//! [class definition begin]
- void updateImage();
QImage loadImage(const QString &fileName);
void loadImage();
void goNextImage();
diff --git a/examples/widgets/gestures/imagegestures/mainwidget.h b/examples/widgets/gestures/imagegestures/mainwidget.h
index 20e32d1afb..e37baa398c 100644
--- a/examples/widgets/gestures/imagegestures/mainwidget.h
+++ b/examples/widgets/gestures/imagegestures/mainwidget.h
@@ -57,8 +57,6 @@ public slots:
void openDirectory(const QString &path);
private:
- bool loadImage(const QString &fileName);
-
ImageWidget *imageWidget;
};
diff --git a/examples/widgets/graphicsview/boxes/scene.cpp b/examples/widgets/graphicsview/boxes/scene.cpp
index 48bdcb9d93..c9691704cb 100644
--- a/examples/widgets/graphicsview/boxes/scene.cpp
+++ b/examples/widgets/graphicsview/boxes/scene.cpp
@@ -319,9 +319,9 @@ RenderOptionsDialog::RenderOptionsDialog()
while (++it != tokens.end()) {
m_parameterNames << name;
if (!singleElement) {
- m_parameterNames.back() += "[";
+ m_parameterNames.back() += '[';
m_parameterNames.back() += counter + counterPos;
- m_parameterNames.back() += "]";
+ m_parameterNames.back() += ']';
int j = 8; // position of last digit
++counter[j];
while (j > 0 && counter[j] > '9') {
diff --git a/examples/widgets/itemviews/addressbook/adddialog.cpp b/examples/widgets/itemviews/addressbook/adddialog.cpp
index de5c7eaf87..d153381b56 100644
--- a/examples/widgets/itemviews/addressbook/adddialog.cpp
+++ b/examples/widgets/itemviews/addressbook/adddialog.cpp
@@ -72,8 +72,8 @@ AddDialog::AddDialog(QWidget *parent)
mainLayout->addLayout(gLayout);
setLayout(mainLayout);
- connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
- connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept);
+ connect(cancelButton, &QAbstractButton::clicked, this, &QDialog::reject);
setWindowTitle(tr("Add a Contact"));
}
diff --git a/examples/widgets/itemviews/addressbook/addresswidget.cpp b/examples/widgets/itemviews/addressbook/addresswidget.cpp
index 20589a9417..792d626a4e 100644
--- a/examples/widgets/itemviews/addressbook/addresswidget.cpp
+++ b/examples/widgets/itemviews/addressbook/addresswidget.cpp
@@ -49,8 +49,8 @@ AddressWidget::AddressWidget(QWidget *parent)
{
table = new TableModel(this);
newAddressTab = new NewAddressTab(this);
- connect(newAddressTab, SIGNAL(sendDetails(QString, QString)),
- this, SLOT(addEntry(QString, QString)));
+ connect(newAddressTab, &NewAddressTab::sendDetails,
+ this, &AddressWidget::addEntry);
addTab(newAddressTab, "Address Book");
@@ -59,7 +59,7 @@ AddressWidget::AddressWidget(QWidget *parent)
//! [0]
//! [2]
-void AddressWidget::addEntry()
+void AddressWidget::showAddEntryDialog()
{
AddDialog aDialog;
@@ -182,8 +182,8 @@ void AddressWidget::setupTabs()
tableView->setSortingEnabled(true);
connect(tableView->selectionModel(),
- SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
- this, SIGNAL(selectionChanged(QItemSelection)));
+ &QItemSelectionModel::selectionChanged,
+ this, &AddressWidget::selectionChanged);
addTab(tableView, str);
}
diff --git a/examples/widgets/itemviews/addressbook/addresswidget.h b/examples/widgets/itemviews/addressbook/addresswidget.h
index b990c47911..a2fc4bc03b 100644
--- a/examples/widgets/itemviews/addressbook/addresswidget.h
+++ b/examples/widgets/itemviews/addressbook/addresswidget.h
@@ -63,7 +63,7 @@ public:
void writeToFile(const QString &fileName);
public slots:
- void addEntry();
+ void showAddEntryDialog();
void addEntry(QString name, QString address);
void editEntry();
void removeEntry();
diff --git a/examples/widgets/itemviews/addressbook/mainwindow.cpp b/examples/widgets/itemviews/addressbook/mainwindow.cpp
index f729f43604..94b38ea2f6 100644
--- a/examples/widgets/itemviews/addressbook/mainwindow.cpp
+++ b/examples/widgets/itemviews/addressbook/mainwindow.cpp
@@ -61,40 +61,40 @@ void MainWindow::createMenus()
openAct = new QAction(tr("&Open..."), this);
fileMenu->addAction(openAct);
- connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::openFile);
//! [1a]
saveAct = new QAction(tr("&Save As..."), this);
fileMenu->addAction(saveAct);
- connect(saveAct, SIGNAL(triggered()), this, SLOT(saveFile()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::saveFile);
fileMenu->addSeparator();
exitAct = new QAction(tr("E&xit"), this);
fileMenu->addAction(exitAct);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+ connect(exitAct, &QAction::triggered, this, &QWidget::close);
toolMenu = menuBar()->addMenu(tr("&Tools"));
addAct = new QAction(tr("&Add Entry..."), this);
toolMenu->addAction(addAct);
- connect(addAct, SIGNAL(triggered()), addressWidget, SLOT(addEntry()));
+ connect(addAct, &QAction::triggered, addressWidget, &AddressWidget::showAddEntryDialog);
//! [1b]
editAct = new QAction(tr("&Edit Entry..."), this);
editAct->setEnabled(false);
toolMenu->addAction(editAct);
- connect(editAct, SIGNAL(triggered()), addressWidget, SLOT(editEntry()));
+ connect(editAct, &QAction::triggered, addressWidget, &AddressWidget::editEntry);
toolMenu->addSeparator();
removeAct = new QAction(tr("&Remove Entry"), this);
removeAct->setEnabled(false);
toolMenu->addAction(removeAct);
- connect(removeAct, SIGNAL(triggered()), addressWidget, SLOT(removeEntry()));
+ connect(removeAct, &QAction::triggered, addressWidget, &AddressWidget::removeEntry);
- connect(addressWidget, SIGNAL(selectionChanged(QItemSelection)),
- this, SLOT(updateActions(QItemSelection)));
+ connect(addressWidget, &AddressWidget::selectionChanged,
+ this, &MainWindow::updateActions);
}
//! [1b]
diff --git a/examples/widgets/itemviews/addressbook/newaddresstab.cpp b/examples/widgets/itemviews/addressbook/newaddresstab.cpp
index 012a19991c..af66636995 100644
--- a/examples/widgets/itemviews/addressbook/newaddresstab.cpp
+++ b/examples/widgets/itemviews/addressbook/newaddresstab.cpp
@@ -53,7 +53,7 @@ NewAddressTab::NewAddressTab(QWidget *parent)
addButton = new QPushButton(tr("Add"));
- connect(addButton, SIGNAL(clicked()), this, SLOT(addEntry()));
+ connect(addButton, &QAbstractButton::clicked, this, &NewAddressTab::addEntry);
mainLayout = new QVBoxLayout;
mainLayout->addWidget(descriptionLabel);
diff --git a/examples/widgets/itemviews/basicsortfiltermodel/window.cpp b/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
index b518460230..0f5a434bcc 100644
--- a/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
+++ b/examples/widgets/itemviews/basicsortfiltermodel/window.cpp
@@ -77,16 +77,18 @@ Window::Window()
filterColumnLabel = new QLabel(tr("Filter &column:"));
filterColumnLabel->setBuddy(filterColumnComboBox);
- connect(filterPatternLineEdit, SIGNAL(textChanged(QString)),
- this, SLOT(filterRegExpChanged()));
- connect(filterSyntaxComboBox, SIGNAL(currentIndexChanged(int)),
- this, SLOT(filterRegExpChanged()));
- connect(filterColumnComboBox, SIGNAL(currentIndexChanged(int)),
- this, SLOT(filterColumnChanged()));
- connect(filterCaseSensitivityCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(filterRegExpChanged()));
- connect(sortCaseSensitivityCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(sortChanged()));
+ connect(filterPatternLineEdit, &QLineEdit::textChanged,
+ this, &Window::filterRegExpChanged);
+
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(filterSyntaxComboBox, static_cast<QComboIntSignal>(&QComboBox::currentIndexChanged),
+ this, &Window::filterRegExpChanged);
+ connect(filterColumnComboBox, static_cast<QComboIntSignal>(&QComboBox::currentIndexChanged),
+ this, &Window::filterColumnChanged);
+ connect(filterCaseSensitivityCheckBox, &QAbstractButton::toggled,
+ this, &Window::filterRegExpChanged);
+ connect(sortCaseSensitivityCheckBox, &QAbstractButton::toggled,
+ this, &Window::sortChanged);
sourceGroupBox = new QGroupBox(tr("Original Model"));
proxyGroupBox = new QGroupBox(tr("Sorted/Filtered Model"));
diff --git a/examples/widgets/itemviews/chart/mainwindow.cpp b/examples/widgets/itemviews/chart/mainwindow.cpp
index 646b8a293a..a148c3036d 100644
--- a/examples/widgets/itemviews/chart/mainwindow.cpp
+++ b/examples/widgets/itemviews/chart/mainwindow.cpp
@@ -56,14 +56,14 @@ MainWindow::MainWindow()
setupModel();
setupViews();
- connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
- connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(openAction, &QAction::triggered, this, &MainWindow::openFile);
+ connect(saveAction, &QAction::triggered, this, &MainWindow::saveFile);
+ connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
menuBar()->addMenu(fileMenu);
statusBar();
- openFile(":/Charts/qtdata.cht");
+ loadFile(":/Charts/qtdata.cht");
setWindowTitle(tr("Chart"));
resize(870, 550);
@@ -99,17 +99,16 @@ void MainWindow::setupViews()
setCentralWidget(splitter);
}
-void MainWindow::openFile(const QString &path)
+void MainWindow::openFile()
{
- QString fileName;
- if (path.isNull())
- fileName = QFileDialog::getOpenFileName(this, tr("Choose a data file"), "", "*.cht");
- else
- fileName = path;
-
- if (fileName.isEmpty())
- return;
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Choose a data file"), "", "*.cht");
+ if (!fileName.isEmpty())
+ loadFile(fileName);
+}
+void MainWindow::loadFile(const QString &fileName)
+{
QFile file(fileName);
if (!file.open(QFile::ReadOnly | QFile::Text))
return;
@@ -125,7 +124,7 @@ void MainWindow::openFile(const QString &path)
if (!line.isEmpty()) {
model->insertRows(row, 1, QModelIndex());
- QStringList pieces = line.split(",", QString::SkipEmptyParts);
+ QStringList pieces = line.split(',', QString::SkipEmptyParts);
model->setData(model->index(row, 0, QModelIndex()),
pieces.value(0));
model->setData(model->index(row, 1, QModelIndex()),
diff --git a/examples/widgets/itemviews/chart/mainwindow.h b/examples/widgets/itemviews/chart/mainwindow.h
index 2fc47bb75b..523ad70441 100644
--- a/examples/widgets/itemviews/chart/mainwindow.h
+++ b/examples/widgets/itemviews/chart/mainwindow.h
@@ -57,12 +57,13 @@ public:
MainWindow();
private slots:
- void openFile(const QString &path = QString());
+ void openFile();
void saveFile();
private:
void setupModel();
void setupViews();
+ void loadFile(const QString &path);
QAbstractItemModel *model;
QAbstractItemView *pieChart;
diff --git a/examples/widgets/itemviews/combowidgetmapper/window.cpp b/examples/widgets/itemviews/combowidgetmapper/window.cpp
index d135ffb33f..3a6f649856 100644
--- a/examples/widgets/itemviews/combowidgetmapper/window.cpp
+++ b/examples/widgets/itemviews/combowidgetmapper/window.cpp
@@ -72,12 +72,12 @@ Window::Window(QWidget *parent)
//! [Set up the mapper]
//! [Set up connections and layouts]
- connect(previousButton, SIGNAL(clicked()),
- mapper, SLOT(toPrevious()));
- connect(nextButton, SIGNAL(clicked()),
- mapper, SLOT(toNext()));
- connect(mapper, SIGNAL(currentIndexChanged(int)),
- this, SLOT(updateButtons(int)));
+ connect(previousButton, &QAbstractButton::clicked,
+ mapper, &QDataWidgetMapper::toPrevious);
+ connect(nextButton, &QAbstractButton::clicked,
+ mapper, &QDataWidgetMapper::toNext);
+ connect(mapper, &QDataWidgetMapper::currentIndexChanged,
+ this, &Window::updateButtons);
QGridLayout *layout = new QGridLayout();
layout->addWidget(nameLabel, 0, 0, 1, 1);
diff --git a/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp b/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp
index 6b5896f3c1..12019e606a 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp
+++ b/examples/widgets/itemviews/customsortfiltermodel/filterwidget.cpp
@@ -55,12 +55,12 @@ FilterWidget::FilterWidget(QWidget *parent)
, m_patternGroup(new QActionGroup(this))
{
setClearButtonEnabled(true);
- connect(this, SIGNAL(textChanged(QString)), this, SIGNAL(filterChanged()));
+ connect(this, &QLineEdit::textChanged, this, &FilterWidget::filterChanged);
QMenu *menu = new QMenu(this);
m_caseSensitivityAction = menu->addAction(tr("Case Sensitive"));
m_caseSensitivityAction->setCheckable(true);
- connect(m_caseSensitivityAction, SIGNAL(toggled(bool)), this, SIGNAL(filterChanged()));
+ connect(m_caseSensitivityAction, &QAction::toggled, this, &FilterWidget::filterChanged);
menu->addSeparator();
m_patternGroup->setExclusive(true);
@@ -77,7 +77,7 @@ FilterWidget::FilterWidget(QWidget *parent)
patternAction->setCheckable(true);
patternAction->setData(QVariant(int(QRegExp::Wildcard)));
m_patternGroup->addAction(patternAction);
- connect(m_patternGroup, SIGNAL(triggered(QAction*)), this, SIGNAL(filterChanged()));
+ connect(m_patternGroup, &QActionGroup::triggered, this, &FilterWidget::filterChanged);
const QIcon icon = QIcon(QPixmap(":/images/find.png"));
QToolButton *optionsButton = new QToolButton;
diff --git a/examples/widgets/itemviews/customsortfiltermodel/window.cpp b/examples/widgets/itemviews/customsortfiltermodel/window.cpp
index 8653df2a61..ff07dfe79c 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/window.cpp
+++ b/examples/widgets/itemviews/customsortfiltermodel/window.cpp
@@ -66,7 +66,7 @@ Window::Window()
//! [3]
filterWidget = new FilterWidget;
filterWidget->setText("Grace|Sports");
- connect(filterWidget, SIGNAL(filterChanged()), this, SLOT(textFilterChanged()));
+ connect(filterWidget, &FilterWidget::filterChanged, this, &Window::textFilterChanged);
filterPatternLabel = new QLabel(tr("&Filter pattern:"));
filterPatternLabel->setBuddy(filterWidget);
@@ -81,13 +81,13 @@ Window::Window()
toLabel = new QLabel(tr("&To:"));
toLabel->setBuddy(toDateEdit);
- connect(filterWidget, SIGNAL(textChanged(QString)),
- this, SLOT(textFilterChanged()));
- connect(fromDateEdit, SIGNAL(dateChanged(QDate)),
- this, SLOT(dateFilterChanged()));
- connect(toDateEdit, SIGNAL(dateChanged(QDate)),
+ connect(filterWidget, &QLineEdit::textChanged,
+ this, &Window::textFilterChanged);
+ connect(fromDateEdit, &QDateTimeEdit::dateChanged,
+ this, &Window::dateFilterChanged);
+ connect(toDateEdit, &QDateTimeEdit::dateChanged,
//! [3] //! [4]
- this, SLOT(dateFilterChanged()));
+ this, &Window::dateFilterChanged);
//! [4]
//! [5]
diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp
index c7abe59c77..f138e27095 100644
--- a/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.cpp
@@ -60,19 +60,17 @@ MainWindow::MainWindow(QWidget *parent)
for (int column = 0; column < model->columnCount(); ++column)
view->resizeColumnToContents(column);
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(exitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
- connect(view->selectionModel(),
- SIGNAL(selectionChanged(const QItemSelection &,
- const QItemSelection &)),
- this, SLOT(updateActions()));
+ connect(view->selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &MainWindow::updateActions);
- connect(actionsMenu, SIGNAL(aboutToShow()), this, SLOT(updateActions()));
- connect(insertRowAction, SIGNAL(triggered()), this, SLOT(insertRow()));
- connect(insertColumnAction, SIGNAL(triggered()), this, SLOT(insertColumn()));
- connect(removeRowAction, SIGNAL(triggered()), this, SLOT(removeRow()));
- connect(removeColumnAction, SIGNAL(triggered()), this, SLOT(removeColumn()));
- connect(insertChildAction, SIGNAL(triggered()), this, SLOT(insertChild()));
+ connect(actionsMenu, &QMenu::aboutToShow, this, &MainWindow::updateActions);
+ connect(insertRowAction, &QAction::triggered, this, &MainWindow::insertRow);
+ connect(insertColumnAction, &QAction::triggered, this, &MainWindow::insertColumn);
+ connect(removeRowAction, &QAction::triggered, this, &MainWindow::removeRow);
+ connect(removeColumnAction, &QAction::triggered, this, &MainWindow::removeColumn);
+ connect(insertChildAction, &QAction::triggered, this, &MainWindow::insertChild);
updateActions();
}
@@ -102,13 +100,13 @@ void MainWindow::insertChild()
updateActions();
}
-bool MainWindow::insertColumn(const QModelIndex &parent)
+bool MainWindow::insertColumn()
{
QAbstractItemModel *model = view->model();
int column = view->selectionModel()->currentIndex().column();
// Insert a column in the parent item.
- bool changed = model->insertColumn(column + 1, parent);
+ bool changed = model->insertColumn(column + 1);
if (changed)
model->setHeaderData(column + 1, Qt::Horizontal, QVariant("[No header]"), Qt::EditRole);
@@ -133,15 +131,15 @@ void MainWindow::insertRow()
}
}
-bool MainWindow::removeColumn(const QModelIndex &parent)
+bool MainWindow::removeColumn()
{
QAbstractItemModel *model = view->model();
int column = view->selectionModel()->currentIndex().column();
// Insert columns in each child of the parent item.
- bool changed = model->removeColumn(column, parent);
+ bool changed = model->removeColumn(column);
- if (!parent.isValid() && changed)
+ if (changed)
updateActions();
return changed;
diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.h b/examples/widgets/itemviews/editabletreemodel/mainwindow.h
index 4626ecbc2a..4c164f88c1 100644
--- a/examples/widgets/itemviews/editabletreemodel/mainwindow.h
+++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.h
@@ -58,9 +58,9 @@ public slots:
private slots:
void insertChild();
- bool insertColumn(const QModelIndex &parent = QModelIndex());
+ bool insertColumn();
void insertRow();
- bool removeColumn(const QModelIndex &parent = QModelIndex());
+ bool removeColumn();
void removeRow();
};
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
index 2903dd7d38..2b12c142cd 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
@@ -246,7 +246,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
while (number < lines.count()) {
int position = 0;
while (position < lines[number].length()) {
- if (lines[number].mid(position, 1) != " ")
+ if (lines[number].at(position) != ' ')
break;
++position;
}
diff --git a/examples/widgets/itemviews/fetchmore/window.cpp b/examples/widgets/itemviews/fetchmore/window.cpp
index eefa09622d..aa4e0adc90 100644
--- a/examples/widgets/itemviews/fetchmore/window.cpp
+++ b/examples/widgets/itemviews/fetchmore/window.cpp
@@ -59,12 +59,12 @@ Window::Window(QWidget *parent)
logViewer = new QTextBrowser;
logViewer->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
- connect(lineEdit, SIGNAL(textChanged(QString)),
- model, SLOT(setDirPath(QString)));
- connect(lineEdit, SIGNAL(textChanged(QString)),
- logViewer, SLOT(clear()));
- connect(model, SIGNAL(numberPopulated(int)),
- this, SLOT(updateLog(int)));
+ connect(lineEdit, &QLineEdit::textChanged,
+ model, &FileListModel::setDirPath);
+ connect(lineEdit, &QLineEdit::textChanged,
+ logViewer, &QTextEdit::clear);
+ connect(model, &FileListModel::numberPopulated,
+ this, &Window::updateLog);
QGridLayout *layout = new QGridLayout;
layout->addWidget(label, 0, 0);
diff --git a/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp b/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp
index 254786b16e..c2233abcc2 100644
--- a/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp
+++ b/examples/widgets/itemviews/frozencolumn/freezetablewidget.cpp
@@ -52,15 +52,15 @@ FreezeTableWidget::FreezeTableWidget(QAbstractItemModel * model)
init();
//connect the headers and scrollbars of both tableviews together
- connect(horizontalHeader(),SIGNAL(sectionResized(int,int,int)), this,
- SLOT(updateSectionWidth(int,int,int)));
- connect(verticalHeader(),SIGNAL(sectionResized(int,int,int)), this,
- SLOT(updateSectionHeight(int,int,int)));
-
- connect(frozenTableView->verticalScrollBar(), SIGNAL(valueChanged(int)),
- verticalScrollBar(), SLOT(setValue(int)));
- connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
- frozenTableView->verticalScrollBar(), SLOT(setValue(int)));
+ connect(horizontalHeader(),&QHeaderView::sectionResized, this,
+ &FreezeTableWidget::updateSectionWidth);
+ connect(verticalHeader(),&QHeaderView::sectionResized, this,
+ &FreezeTableWidget::updateSectionHeight);
+
+ connect(frozenTableView->verticalScrollBar(), &QAbstractSlider::valueChanged,
+ verticalScrollBar(), &QAbstractSlider::setValue);
+ connect(verticalScrollBar(), &QAbstractSlider::valueChanged,
+ frozenTableView->verticalScrollBar(), &QAbstractSlider::setValue);
}
diff --git a/examples/widgets/itemviews/frozencolumn/main.cpp b/examples/widgets/itemviews/frozencolumn/main.cpp
index cfdf57135c..1292a7f403 100644
--- a/examples/widgets/itemviews/frozencolumn/main.cpp
+++ b/examples/widgets/itemviews/frozencolumn/main.cpp
@@ -54,15 +54,15 @@ int main(int argc, char* argv[])
QFile file(":/grades.txt");
if (file.open(QFile::ReadOnly)) {
QString line = file.readLine(200);
- QStringList list = line.simplified().split(",");
+ QStringList list = line.simplified().split(',');
model->setHorizontalHeaderLabels(list);
int row = 0;
QStandardItem *newItem = 0;
while (file.canReadLine()) {
line = file.readLine(200);
- if (!line.startsWith("#") && line.contains(",")) {
- list= line.simplified().split(",");
+ if (!line.startsWith('#') && line.contains(',')) {
+ list = line.simplified().split(',');
for (int col = 0; col < list.length(); ++col){
newItem = new QStandardItem(list.at(col));
model->setItem(row, col, newItem);
diff --git a/examples/widgets/itemviews/interview/model.cpp b/examples/widgets/itemviews/interview/model.cpp
index ba65144cfa..efbb67486b 100644
--- a/examples/widgets/itemviews/interview/model.cpp
+++ b/examples/widgets/itemviews/interview/model.cpp
@@ -88,7 +88,7 @@ QVariant Model::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if (role == Qt::DisplayRole)
- return QVariant("Item " + QString::number(index.row()) + ":" + QString::number(index.column()));
+ return QVariant("Item " + QString::number(index.row()) + ':' + QString::number(index.column()));
if (role == Qt::DecorationRole) {
if (index.column() == 0)
return iconProvider.icon(QFileIconProvider::Folder);
diff --git a/examples/widgets/itemviews/pixelator/mainwindow.cpp b/examples/widgets/itemviews/pixelator/mainwindow.cpp
index a05880225b..bab130a2b2 100644
--- a/examples/widgets/itemviews/pixelator/mainwindow.cpp
+++ b/examples/widgets/itemviews/pixelator/mainwindow.cpp
@@ -98,15 +98,16 @@ MainWindow::MainWindow()
menuBar()->addSeparator();
menuBar()->addMenu(helpMenu);
- connect(openAction, SIGNAL(triggered()), this, SLOT(chooseImage()));
- connect(printAction, SIGNAL(triggered()), this, SLOT(printImage()));
- connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(aboutAction, SIGNAL(triggered()), this, SLOT(showAboutBox()));
+ connect(openAction, &QAction::triggered, this, &MainWindow::chooseImage);
+ connect(printAction, &QAction::triggered, this, &MainWindow::printImage);
+ connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
+ connect(aboutAction, &QAction::triggered, this, &MainWindow::showAboutBox);
//! [4]
- connect(pixelSizeSpinBox, SIGNAL(valueChanged(int)),
- delegate, SLOT(setPixelSize(int)));
- connect(pixelSizeSpinBox, SIGNAL(valueChanged(int)),
- this, SLOT(updateView()));
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(pixelSizeSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ delegate, &PixelDelegate::setPixelSize);
+ connect(pixelSizeSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &MainWindow::updateView);
//! [4]
QHBoxLayout *controlsLayout = new QHBoxLayout;
diff --git a/examples/widgets/itemviews/puzzle/main.cpp b/examples/widgets/itemviews/puzzle/main.cpp
index 866c6f0d8b..a7980489a8 100644
--- a/examples/widgets/itemviews/puzzle/main.cpp
+++ b/examples/widgets/itemviews/puzzle/main.cpp
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
- window.openImage(":/images/example.jpg");
+ window.loadImage(":/images/example.jpg");
window.show();
return app.exec();
}
diff --git a/examples/widgets/itemviews/puzzle/mainwindow.cpp b/examples/widgets/itemviews/puzzle/mainwindow.cpp
index 2e2a1d0ab5..5cd9a7f0df 100644
--- a/examples/widgets/itemviews/puzzle/mainwindow.cpp
+++ b/examples/widgets/itemviews/puzzle/mainwindow.cpp
@@ -57,26 +57,27 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle(tr("Puzzle"));
}
-void MainWindow::openImage(const QString &path)
+void MainWindow::openImage()
{
- QString fileName = path;
-
- if (fileName.isNull()) {
- fileName = QFileDialog::getOpenFileName(this,
- tr("Open Image"), "", tr("Image Files (*.png *.jpg *.bmp)"));
- }
+ const QString fileName =
+ QFileDialog::getOpenFileName(this,
+ tr("Open Image"), QString(),
+ tr("Image Files (*.png *.jpg *.bmp)"));
+ if (!fileName.isEmpty())
+ loadImage(fileName);
+}
- if (!fileName.isEmpty()) {
- QPixmap newImage;
- if (!newImage.load(fileName)) {
- QMessageBox::warning(this, tr("Open Image"),
- tr("The image file could not be loaded."),
- QMessageBox::Cancel);
- return;
- }
- puzzleImage = newImage;
- setupPuzzle();
+void MainWindow::loadImage(const QString &fileName)
+{
+ QPixmap newImage;
+ if (!newImage.load(fileName)) {
+ QMessageBox::warning(this, tr("Open Image"),
+ tr("The image file could not be loaded."),
+ QMessageBox::Cancel);
+ return;
}
+ puzzleImage = newImage;
+ setupPuzzle();
}
void MainWindow::setCompleted()
@@ -116,9 +117,9 @@ void MainWindow::setupMenus()
QAction *restartAction = gameMenu->addAction(tr("&Restart"));
- connect(openAction, SIGNAL(triggered()), this, SLOT(openImage()));
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(restartAction, SIGNAL(triggered()), this, SLOT(setupPuzzle()));
+ connect(openAction, &QAction::triggered, this, &MainWindow::openImage);
+ connect(exitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
+ connect(restartAction, &QAction::triggered, this, &MainWindow::setupPuzzle);
}
void MainWindow::setupWidgets()
@@ -141,8 +142,8 @@ void MainWindow::setupWidgets()
PiecesModel *model = new PiecesModel(puzzleWidget->pieceSize(), this);
piecesList->setModel(model);
- connect(puzzleWidget, SIGNAL(puzzleCompleted()),
- this, SLOT(setCompleted()), Qt::QueuedConnection);
+ connect(puzzleWidget, &PuzzleWidget::puzzleCompleted,
+ this, &MainWindow::setCompleted, Qt::QueuedConnection);
frameLayout->addWidget(piecesList);
frameLayout->addWidget(puzzleWidget);
diff --git a/examples/widgets/itemviews/puzzle/mainwindow.h b/examples/widgets/itemviews/puzzle/mainwindow.h
index 86daf0af2d..440dd46377 100644
--- a/examples/widgets/itemviews/puzzle/mainwindow.h
+++ b/examples/widgets/itemviews/puzzle/mainwindow.h
@@ -58,7 +58,8 @@ public:
MainWindow(QWidget *parent = 0);
public slots:
- void openImage(const QString &path = QString());
+ void openImage();
+ void loadImage(const QString &path);
void setupPuzzle();
private slots:
diff --git a/examples/widgets/itemviews/simpledommodel/dommodel.cpp b/examples/widgets/itemviews/simpledommodel/dommodel.cpp
index f6450abc8b..531957f60b 100644
--- a/examples/widgets/itemviews/simpledommodel/dommodel.cpp
+++ b/examples/widgets/itemviews/simpledommodel/dommodel.cpp
@@ -88,7 +88,7 @@ QVariant DomModel::data(const QModelIndex &index, int role) const
for (int i = 0; i < attributeMap.count(); ++i) {
QDomNode attribute = attributeMap.item(i);
attributes << attribute.nodeName() + "=\""
- +attribute.nodeValue() + "\"";
+ +attribute.nodeValue() + '"';
}
return attributes.join(' ');
case 2:
diff --git a/examples/widgets/itemviews/simpledommodel/mainwindow.cpp b/examples/widgets/itemviews/simpledommodel/mainwindow.cpp
index 4dc87dac1a..c11fb40a0e 100644
--- a/examples/widgets/itemviews/simpledommodel/mainwindow.cpp
+++ b/examples/widgets/itemviews/simpledommodel/mainwindow.cpp
@@ -49,8 +49,8 @@
MainWindow::MainWindow() : QMainWindow(), model(0)
{
fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(tr("&Open..."), this, SLOT(openFile()), QKeySequence::Open);
- fileMenu->addAction(tr("E&xit"), this, SLOT(close()), QKeySequence::Quit);
+ fileMenu->addAction(tr("&Open..."), this, &MainWindow::openFile, QKeySequence::Open);
+ fileMenu->addAction(tr("E&xit"), this, &QWidget::close, QKeySequence::Quit);
model = new DomModel(QDomDocument(), this);
view = new QTreeView(this);
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
index aaa4685b27..f5cd1a160e 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
@@ -180,7 +180,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
while (number < lines.count()) {
int position = 0;
while (position < lines[number].length()) {
- if (lines[number].mid(position, 1) != " ")
+ if (lines[number].at(position) != ' ')
break;
position++;
}
diff --git a/examples/widgets/itemviews/simplewidgetmapper/window.cpp b/examples/widgets/itemviews/simplewidgetmapper/window.cpp
index 9df004430b..0d99acc603 100644
--- a/examples/widgets/itemviews/simplewidgetmapper/window.cpp
+++ b/examples/widgets/itemviews/simplewidgetmapper/window.cpp
@@ -69,9 +69,9 @@ Window::Window(QWidget *parent)
mapper->addMapping(addressEdit, 1);
mapper->addMapping(ageSpinBox, 2);
- connect(previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious()));
- connect(nextButton, SIGNAL(clicked()), mapper, SLOT(toNext()));
- connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons(int)));
+ connect(previousButton, &QAbstractButton::clicked, mapper, &QDataWidgetMapper::toPrevious);
+ connect(nextButton, &QAbstractButton::clicked, mapper, &QDataWidgetMapper::toNext);
+ connect(mapper, &QDataWidgetMapper::currentIndexChanged, this, &Window::updateButtons);
//! [Set up the mapper]
//! [Set up the layout]
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
index 02e635b87a..41b51c1071 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
@@ -73,17 +73,17 @@ SpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent)
setCentralWidget(table);
statusBar();
- connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
- this, SLOT(updateStatus(QTableWidgetItem*)));
- connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
- this, SLOT(updateColor(QTableWidgetItem*)));
- connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
- this, SLOT(updateLineEdit(QTableWidgetItem*)));
- connect(table, SIGNAL(itemChanged(QTableWidgetItem*)),
- this, SLOT(updateStatus(QTableWidgetItem*)));
- connect(formulaInput, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
- connect(table, SIGNAL(itemChanged(QTableWidgetItem*)),
- this, SLOT(updateLineEdit(QTableWidgetItem*)));
+ connect(table, &QTableWidget::currentItemChanged,
+ this, &SpreadSheet::updateStatus);
+ connect(table, &QTableWidget::currentItemChanged,
+ this, &SpreadSheet::updateColor);
+ connect(table, &QTableWidget::currentItemChanged,
+ this, &SpreadSheet::updateLineEdit);
+ connect(table, &QTableWidget::itemChanged,
+ this, &SpreadSheet::updateStatus);
+ connect(formulaInput, &QLineEdit::returnPressed, this, &SpreadSheet::returnPressed);
+ connect(table, &QTableWidget::itemChanged,
+ this, &SpreadSheet::updateLineEdit);
setWindowTitle(tr("Spreadsheet"));
}
@@ -91,43 +91,43 @@ SpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent)
void SpreadSheet::createActions()
{
cell_sumAction = new QAction(tr("Sum"), this);
- connect(cell_sumAction, SIGNAL(triggered()), this, SLOT(actionSum()));
+ connect(cell_sumAction, &QAction::triggered, this, &SpreadSheet::actionSum);
cell_addAction = new QAction(tr("&Add"), this);
cell_addAction->setShortcut(Qt::CTRL | Qt::Key_Plus);
- connect(cell_addAction, SIGNAL(triggered()), this, SLOT(actionAdd()));
+ connect(cell_addAction, &QAction::triggered, this, &SpreadSheet::actionAdd);
cell_subAction = new QAction(tr("&Subtract"), this);
cell_subAction->setShortcut(Qt::CTRL | Qt::Key_Minus);
- connect(cell_subAction, SIGNAL(triggered()), this, SLOT(actionSubtract()));
+ connect(cell_subAction, &QAction::triggered, this, &SpreadSheet::actionSubtract);
cell_mulAction = new QAction(tr("&Multiply"), this);
cell_mulAction->setShortcut(Qt::CTRL | Qt::Key_multiply);
- connect(cell_mulAction, SIGNAL(triggered()), this, SLOT(actionMultiply()));
+ connect(cell_mulAction, &QAction::triggered, this, &SpreadSheet::actionMultiply);
cell_divAction = new QAction(tr("&Divide"), this);
cell_divAction->setShortcut(Qt::CTRL | Qt::Key_division);
- connect(cell_divAction, SIGNAL(triggered()), this, SLOT(actionDivide()));
+ connect(cell_divAction, &QAction::triggered, this, &SpreadSheet::actionDivide);
fontAction = new QAction(tr("Font..."), this);
fontAction->setShortcut(Qt::CTRL | Qt::Key_F);
- connect(fontAction, SIGNAL(triggered()), this, SLOT(selectFont()));
+ connect(fontAction, &QAction::triggered, this, &SpreadSheet::selectFont);
colorAction = new QAction(QPixmap(16, 16), tr("Background &Color..."), this);
- connect(colorAction, SIGNAL(triggered()), this, SLOT(selectColor()));
+ connect(colorAction, &QAction::triggered, this, &SpreadSheet::selectColor);
clearAction = new QAction(tr("Clear"), this);
clearAction->setShortcut(Qt::Key_Delete);
- connect(clearAction, SIGNAL(triggered()), this, SLOT(clear()));
+ connect(clearAction, &QAction::triggered, this, &SpreadSheet::clear);
aboutSpreadSheet = new QAction(tr("About Spreadsheet"), this);
- connect(aboutSpreadSheet, SIGNAL(triggered()), this, SLOT(showAbout()));
+ connect(aboutSpreadSheet, &QAction::triggered, this, &SpreadSheet::showAbout);
exitAction = new QAction(tr("E&xit"), this);
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(exitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
printAction = new QAction(tr("&Print"), this);
- connect(printAction, SIGNAL(triggered()), this, SLOT(print()));
+ connect(printAction, &QAction::triggered, this, &SpreadSheet::print);
firstSeparator = new QAction(this);
firstSeparator->setSeparator(true);
@@ -309,11 +309,11 @@ bool SpreadSheet::runInputDialog(const QString &title,
outColInput.setCurrentIndex(outCol);
QPushButton cancelButton(tr("Cancel"), &addDialog);
- connect(&cancelButton, SIGNAL(clicked()), &addDialog, SLOT(reject()));
+ connect(&cancelButton, &QAbstractButton::clicked, &addDialog, &QDialog::reject);
QPushButton okButton(tr("OK"), &addDialog);
okButton.setDefault(true);
- connect(&okButton, SIGNAL(clicked()), &addDialog, SLOT(accept()));
+ connect(&okButton, &QAbstractButton::clicked, &addDialog, &QDialog::accept);
QHBoxLayout *buttonsLayout = new QHBoxLayout;
buttonsLayout->addStretch(1);
@@ -625,7 +625,7 @@ void SpreadSheet::print()
QPrintPreviewDialog dlg(&printer);
PrintView view;
view.setModel(table->model());
- connect(&dlg, SIGNAL(paintRequested(QPrinter*)), &view, SLOT(print(QPrinter*)));
+ connect(&dlg, &QPrintPreviewDialog::paintRequested, &view, &PrintView::print);
dlg.exec();
#endif
}
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp
index d056e3f8e4..a7404fe159 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.cpp
@@ -63,7 +63,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent,
QCompleter *autoComplete = new QCompleter(allStrings);
editor->setCompleter(autoComplete);
- connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
+ connect(editor, &QLineEdit::editingFinished, this, &SpreadSheetDelegate::commitAndCloseEditor);
return editor;
}
diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.cpp b/examples/widgets/itemviews/stardelegate/stardelegate.cpp
index 48f6eb543b..a9e8f71699 100644
--- a/examples/widgets/itemviews/stardelegate/stardelegate.cpp
+++ b/examples/widgets/itemviews/stardelegate/stardelegate.cpp
@@ -83,8 +83,8 @@ QWidget *StarDelegate::createEditor(QWidget *parent,
{
if (index.data().canConvert<StarRating>()) {
StarEditor *editor = new StarEditor(parent);
- connect(editor, SIGNAL(editingFinished()),
- this, SLOT(commitAndCloseEditor()));
+ connect(editor, &StarEditor::editingFinished,
+ this, &StarDelegate::commitAndCloseEditor);
return editor;
} else {
return QStyledItemDelegate::createEditor(parent, option, index);
diff --git a/examples/widgets/mainwindows/application/main.cpp b/examples/widgets/mainwindows/application/main.cpp
index 41913db07e..73c1cf57d3 100644
--- a/examples/widgets/mainwindows/application/main.cpp
+++ b/examples/widgets/mainwindows/application/main.cpp
@@ -40,6 +40,8 @@
//! [0]
#include <QApplication>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
#include "mainwindow.h"
@@ -48,9 +50,19 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(application);
QApplication app(argc, argv);
- app.setOrganizationName("QtProject");
- app.setApplicationName("Application Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationName("Application Example");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file to open.");
+ parser.process(app);
+
MainWindow mainWin;
+ if (!parser.positionalArguments().isEmpty())
+ mainWin.loadFile(parser.positionalArguments().first());
mainWin.show();
return app.exec();
}
diff --git a/examples/widgets/mainwindows/application/mainwindow.cpp b/examples/widgets/mainwindows/application/mainwindow.cpp
index d3f9c7645e..86dfae166f 100644
--- a/examples/widgets/mainwindows/application/mainwindow.cpp
+++ b/examples/widgets/mainwindows/application/mainwindow.cpp
@@ -46,22 +46,20 @@
//! [1]
MainWindow::MainWindow()
+ : textEdit(new QPlainTextEdit)
//! [1] //! [2]
{
- textEdit = new QPlainTextEdit;
setCentralWidget(textEdit);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
readSettings();
- connect(textEdit->document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(textEdit->document(), &QTextDocument::contentsChanged,
+ this, &MainWindow::documentWasModified);
- setCurrentFile("");
+ setCurrentFile(QString());
setUnifiedTitleAndToolBarOnMac(true);
}
//! [2]
@@ -85,7 +83,7 @@ void MainWindow::newFile()
{
if (maybeSave()) {
textEdit->clear();
- setCurrentFile("");
+ setCurrentFile(QString());
}
}
//! [6]
@@ -121,13 +119,9 @@ bool MainWindow::saveAs()
QFileDialog dialog(this);
dialog.setWindowModality(Qt::WindowModal);
dialog.setAcceptMode(QFileDialog::AcceptSave);
- QStringList files;
- if (dialog.exec())
- files = dialog.selectedFiles();
- else
+ if (dialog.exec() != QDialog::Accepted)
return false;
-
- return saveFile(files.at(0));
+ return saveFile(dialog.selectedFiles().first());
}
//! [12]
@@ -154,121 +148,108 @@ void MainWindow::documentWasModified()
void MainWindow::createActions()
//! [17] //! [18]
{
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
+
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ QAction *newAct = new QAction(newIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
+ fileMenu->addAction(newAct);
+ fileToolBar->addAction(newAct);
//! [19]
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
+ QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
+ fileMenu->addAction(openAct);
+ fileToolBar->addAction(openAct);
//! [18] //! [19]
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ QAction *saveAct = new QAction(saveIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileMenu->addAction(saveAct);
+ fileToolBar->addAction(saveAct);
- saveAsAct = new QAction(tr("Save &As..."), this);
+ const QIcon saveAsIcon = QIcon::fromTheme("document-save-as");
+ QAction *saveAsAct = fileMenu->addAction(saveAsIcon, tr("Save &As..."), this, &MainWindow::saveAs);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
//! [20]
- exitAct = new QAction(tr("E&xit"), this);
+
+ fileMenu->addSeparator();
+
+ const QIcon exitIcon = QIcon::fromTheme("application-exit");
+ QAction *exitAct = fileMenu->addAction(exitIcon, tr("E&xit"), this, &QWidget::close);
exitAct->setShortcuts(QKeySequence::Quit);
//! [20]
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
//! [21]
- cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+//!
+#ifndef QT_NO_CLIPBOARD
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(":/images/cut.png"));
+ QAction *cutAct = new QAction(cutIcon, tr("Cu&t"), this);
//! [21]
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, textEdit, &QPlainTextEdit::cut);
+ editMenu->addAction(cutAct);
+ editToolBar->addAction(cutAct);
- copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this);
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(":/images/copy.png"));
+ QAction *copyAct = new QAction(copyIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, textEdit, &QPlainTextEdit::copy);
+ editMenu->addAction(copyAct);
+ editToolBar->addAction(copyAct);
- pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this);
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(":/images/paste.png"));
+ QAction *pasteAct = new QAction(pasteIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, textEdit, &QPlainTextEdit::paste);
+ editMenu->addAction(pasteAct);
+ editToolBar->addAction(pasteAct);
+
+ menuBar()->addSeparator();
+
+#endif // !QT_NO_CLIPBOARD
- aboutAct = new QAction(tr("&About"), this);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
//! [22]
- aboutQtAct = new QAction(tr("About &Qt"), this);
+
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
//! [22]
//! [23]
+#ifndef QT_NO_CLIPBOARD
cutAct->setEnabled(false);
//! [23] //! [24]
copyAct->setEnabled(false);
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- cutAct, SLOT(setEnabled(bool)));
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- copyAct, SLOT(setEnabled(bool)));
+ connect(textEdit, &QPlainTextEdit::copyAvailable, cutAct, &QAction::setEnabled);
+ connect(textEdit, &QPlainTextEdit::copyAvailable, copyAct, &QAction::setEnabled);
+#endif // !QT_NO_CLIPBOARD
}
//! [24]
-//! [25] //! [26]
-void MainWindow::createMenus()
-//! [25] //! [27]
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
-//! [28]
- fileMenu->addAction(openAct);
-//! [28]
- fileMenu->addAction(saveAct);
-//! [26]
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- editMenu = menuBar()->addMenu(tr("&Edit"));
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-//! [27]
-
-//! [29] //! [30]
-void MainWindow::createToolBars()
-{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
-//! [29] //! [31]
- fileToolBar->addAction(openAct);
-//! [31]
- fileToolBar->addAction(saveAct);
-
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(cutAct);
- editToolBar->addAction(copyAct);
- editToolBar->addAction(pasteAct);
-}
-//! [30]
-
//! [32]
void MainWindow::createStatusBar()
//! [32] //! [33]
@@ -281,11 +262,16 @@ void MainWindow::createStatusBar()
void MainWindow::readSettings()
//! [34] //! [36]
{
- QSettings settings("QtProject", "Application Example");
- QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
- QSize size = settings.value("size", QSize(400, 400)).toSize();
- resize(size);
- move(pos);
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
+ move((availableGeometry.width() - width()) / 2,
+ (availableGeometry.height() - height()) / 2);
+ } else {
+ restoreGeometry(geometry);
+ }
}
//! [35] //! [36]
@@ -293,9 +279,8 @@ void MainWindow::readSettings()
void MainWindow::writeSettings()
//! [37] //! [39]
{
- QSettings settings("QtProject", "Application Example");
- settings.setValue("pos", pos());
- settings.setValue("size", size());
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ settings.setValue("geometry", saveGeometry());
}
//! [38] //! [39]
@@ -303,16 +288,20 @@ void MainWindow::writeSettings()
bool MainWindow::maybeSave()
//! [40] //! [41]
{
- if (textEdit->document()->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Application"),
- tr("The document has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
- if (ret == QMessageBox::Save)
- return save();
- else if (ret == QMessageBox::Cancel)
- return false;
+ if (!textEdit->document()->isModified())
+ return true;
+ const QMessageBox::StandardButton ret
+ = QMessageBox::warning(this, tr("Application"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+ switch (ret) {
+ case QMessageBox::Save:
+ return save();
+ case QMessageBox::Cancel:
+ return false;
+ default:
+ break;
}
return true;
}
@@ -326,8 +315,7 @@ void MainWindow::loadFile(const QString &fileName)
if (!file.open(QFile::ReadOnly | QFile::Text)) {
QMessageBox::warning(this, tr("Application"),
tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return;
}
@@ -353,8 +341,8 @@ bool MainWindow::saveFile(const QString &fileName)
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("Application"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName),
+ file.errorString()));
return false;
}
diff --git a/examples/widgets/mainwindows/application/mainwindow.h b/examples/widgets/mainwindows/application/mainwindow.h
index cb791abf00..08b4aa17f5 100644
--- a/examples/widgets/mainwindows/application/mainwindow.h
+++ b/examples/widgets/mainwindows/application/mainwindow.h
@@ -57,6 +57,8 @@ class MainWindow : public QMainWindow
public:
MainWindow();
+ void loadFile(const QString &fileName);
+
protected:
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
@@ -70,35 +72,16 @@ private slots:
private:
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void readSettings();
void writeSettings();
bool maybeSave();
- void loadFile(const QString &fileName);
bool saveFile(const QString &fileName);
void setCurrentFile(const QString &fileName);
QString strippedName(const QString &fullFileName);
QPlainTextEdit *textEdit;
QString curFile;
-
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *exitAct;
- QAction *cutAct;
- QAction *copyAct;
- QAction *pasteAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
//! [0]
diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
index 20c2bd1c70..c0472b537c 100644
--- a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
+++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
@@ -49,13 +49,11 @@
//! [1]
MainWindow::MainWindow()
+ : textEdit(new QTextEdit)
{
- textEdit = new QTextEdit;
setCentralWidget(textEdit);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
createDockWindows();
@@ -135,17 +133,17 @@ void MainWindow::print()
//! [4]
void MainWindow::save()
{
+ QMimeDatabase mimeDatabase;
QString fileName = QFileDialog::getSaveFileName(this,
tr("Choose a file name"), ".",
- tr("HTML (*.html *.htm)"));
+ mimeDatabase.mimeTypeForName("text/html").filterString());
if (fileName.isEmpty())
return;
QFile file(fileName);
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("Dock Widgets"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return;
}
@@ -222,71 +220,60 @@ void MainWindow::about()
void MainWindow::createActions()
{
- newLetterAct = new QAction(QIcon(":/images/new.png"), tr("&New Letter"),
- this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ QAction *newLetterAct = new QAction(newIcon, tr("&New Letter"), this);
newLetterAct->setShortcuts(QKeySequence::New);
newLetterAct->setStatusTip(tr("Create a new form letter"));
- connect(newLetterAct, SIGNAL(triggered()), this, SLOT(newLetter()));
+ connect(newLetterAct, &QAction::triggered, this, &MainWindow::newLetter);
+ fileMenu->addAction(newLetterAct);
+ fileToolBar->addAction(newLetterAct);
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save..."), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ QAction *saveAct = new QAction(saveIcon, tr("&Save..."), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the current form letter"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileMenu->addAction(saveAct);
+ fileToolBar->addAction(saveAct);
- printAct = new QAction(QIcon(":/images/print.png"), tr("&Print..."), this);
+ const QIcon printIcon = QIcon::fromTheme("document-print", QIcon(":/images/print.png"));
+ QAction *printAct = new QAction(printIcon, tr("&Print..."), this);
printAct->setShortcuts(QKeySequence::Print);
printAct->setStatusTip(tr("Print the current form letter"));
- connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
+ connect(printAct, &QAction::triggered, this, &MainWindow::print);
+ fileMenu->addAction(printAct);
+ fileToolBar->addAction(printAct);
- undoAct = new QAction(QIcon(":/images/undo.png"), tr("&Undo"), this);
- undoAct->setShortcuts(QKeySequence::Undo);
- undoAct->setStatusTip(tr("Undo the last editing action"));
- connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));
+ fileMenu->addSeparator();
- quitAct = new QAction(tr("&Quit"), this);
+ QAction *quitAct = fileMenu->addAction(tr("&Quit"), this, &QWidget::close);
quitAct->setShortcuts(QKeySequence::Quit);
quitAct->setStatusTip(tr("Quit the application"));
- connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));
-
- aboutAct = new QAction(tr("&About"), this);
- aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newLetterAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(printAct);
- fileMenu->addSeparator();
- fileMenu->addAction(quitAct);
- editMenu = menuBar()->addMenu(tr("&Edit"));
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+ const QIcon undoIcon = QIcon::fromTheme("edit-undo", QIcon(":/images/undo.png"));
+ QAction *undoAct = new QAction(undoIcon, tr("&Undo"), this);
+ undoAct->setShortcuts(QKeySequence::Undo);
+ undoAct->setStatusTip(tr("Undo the last editing action"));
+ connect(undoAct, &QAction::triggered, this, &MainWindow::undo);
editMenu->addAction(undoAct);
+ editToolBar->addAction(undoAct);
viewMenu = menuBar()->addMenu(tr("&View"));
menuBar()->addSeparator();
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
-void MainWindow::createToolBars()
-{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newLetterAct);
- fileToolBar->addAction(saveAct);
- fileToolBar->addAction(printAct);
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ aboutAct->setStatusTip(tr("Show the application's About box"));
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(undoAct);
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
+ aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
}
//! [8]
@@ -337,9 +324,9 @@ void MainWindow::createDockWindows()
addDockWidget(Qt::RightDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
- connect(customerList, SIGNAL(currentTextChanged(QString)),
- this, SLOT(insertCustomer(QString)));
- connect(paragraphsList, SIGNAL(currentTextChanged(QString)),
- this, SLOT(addParagraph(QString)));
+ connect(customerList, &QListWidget::currentTextChanged,
+ this, &MainWindow::insertCustomer);
+ connect(paragraphsList, &QListWidget::currentTextChanged,
+ this, &MainWindow::addParagraph);
}
//! [9]
diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.h b/examples/widgets/mainwindows/dockwidgets/mainwindow.h
index 2fb161a20b..c244febf9a 100644
--- a/examples/widgets/mainwindows/dockwidgets/mainwindow.h
+++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.h
@@ -69,8 +69,6 @@ private slots:
private:
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void createDockWindows();
@@ -78,19 +76,7 @@ private:
QListWidget *customerList;
QListWidget *paragraphsList;
- QMenu *fileMenu;
- QMenu *editMenu;
QMenu *viewMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newLetterAct;
- QAction *saveAct;
- QAction *printAct;
- QAction *undoAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
- QAction *quitAct;
};
//! [0]
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index 408f6c4b0f..d746bbe8d3 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -42,6 +42,7 @@
#include <QImage>
#include <QColor>
#include <QDialog>
+#include <QDialogButtonBox>
#include <QGridLayout>
#include <QSpinBox>
#include <QLabel>
@@ -57,15 +58,15 @@ QColor bgColorForName(const QString &name)
{
if (name == "Black")
return QColor("#D8D8D8");
- else if (name == "White")
+ if (name == "White")
return QColor("#F1F1F1");
- else if (name == "Red")
+ if (name == "Red")
return QColor("#F1D8D8");
- else if (name == "Green")
+ if (name == "Green")
return QColor("#D8E4D8");
- else if (name == "Blue")
+ if (name == "Blue")
return QColor("#D8D8F1");
- else if (name == "Yellow")
+ if (name == "Yellow")
return QColor("#F1F0D8");
return QColor(name).light(110);
}
@@ -74,15 +75,15 @@ QColor fgColorForName(const QString &name)
{
if (name == "Black")
return QColor("#6C6C6C");
- else if (name == "White")
+ if (name == "White")
return QColor("#F8F8F8");
- else if (name == "Red")
+ if (name == "Red")
return QColor("#F86C6C");
- else if (name == "Green")
+ if (name == "Green")
return QColor("#6CB26C");
- else if (name == "Blue")
+ if (name == "Blue")
return QColor("#6C6CF8");
- else if (name == "Yellow")
+ if (name == "Yellow")
return QColor("#F8F76C");
return QColor(name);
}
@@ -91,10 +92,10 @@ class ColorDock : public QFrame
{
Q_OBJECT
public:
- ColorDock(const QString &c, QWidget *parent);
+ explicit ColorDock(const QString &c, QWidget *parent);
- virtual QSize sizeHint() const Q_DECL_OVERRIDE;
- virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE { return szHint; }
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE { return minSzHint; }
void setCustomSizeHint(const QSize &size);
@@ -103,28 +104,22 @@ public slots:
protected:
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- QString color;
- QSize szHint, minSzHint;
+
+private:
+ const QString color;
+ QSize szHint;
+ QSize minSzHint;
};
ColorDock::ColorDock(const QString &c, QWidget *parent)
- : QFrame(parent) , color(c)
+ : QFrame(parent)
+ , color(c)
+ , szHint(-1, -1)
+ , minSzHint(125, 75)
{
QFont font = this->font();
font.setPointSize(8);
setFont(font);
- szHint = QSize(-1, -1);
- minSzHint = QSize(125, 75);
-}
-
-QSize ColorDock::sizeHint() const
-{
- return szHint;
-}
-
-QSize ColorDock::minimumSizeHint() const
-{
- return minSzHint;
}
void ColorDock::paintEvent(QPaintEvent *)
@@ -178,6 +173,7 @@ static QSpinBox *createSpinBox(int value, QWidget *parent, int max = 1000)
void ColorDock::changeSizeHints()
{
QDialog dialog(this);
+ dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog.setWindowTitle(color);
QVBoxLayout *topLayout = new QVBoxLayout(&dialog);
@@ -188,7 +184,7 @@ void ColorDock::changeSizeHints()
inputLayout->addWidget(new QLabel(tr("Size Hint:"), &dialog), 0, 0);
inputLayout->addWidget(new QLabel(tr("Min Size Hint:"), &dialog), 1, 0);
inputLayout->addWidget(new QLabel(tr("Max Size:"), &dialog), 2, 0);
- inputLayout->addWidget(new QLabel(tr("Dockwgt Max Size:"), &dialog), 3, 0);
+ inputLayout->addWidget(new QLabel(tr("Dock Widget Max Size:"), &dialog), 3, 0);
QSpinBox *szHintW = createSpinBox(szHint.width(), &dialog);
inputLayout->addWidget(szHintW, 0, 1);
@@ -217,19 +213,13 @@ void ColorDock::changeSizeHints()
topLayout->addStretch();
- QHBoxLayout *buttonBox = new QHBoxLayout();
- topLayout->addLayout(buttonBox);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
+ connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::reject);
- QPushButton *okButton = new QPushButton(tr("Ok"), &dialog);
- QPushButton *cancelButton = new QPushButton(tr("Cancel"), &dialog);
- connect(okButton, SIGNAL(clicked()), &dialog, SLOT(accept()));
- connect(cancelButton, SIGNAL(clicked()), &dialog, SLOT(reject()));
- buttonBox->addStretch();
- buttonBox->addWidget(cancelButton);
- buttonBox->addWidget(okButton);
+ topLayout->addWidget(buttonBox);
-
- if (!dialog.exec())
+ if (dialog.exec() != QDialog::Accepted)
return;
szHint = QSize(szHintW->value(), szHintH->value());
@@ -244,63 +234,62 @@ void ColorDock::changeSizeHints()
void ColorDock::setCustomSizeHint(const QSize &size)
{
- szHint = size;
- updateGeometry();
+ if (szHint != size) {
+ szHint = size;
+ updateGeometry();
+ }
}
-ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFlags flags)
- : QDockWidget(parent, flags)
+ColorSwatch::ColorSwatch(const QString &colorName, QMainWindow *parent, Qt::WindowFlags flags)
+ : QDockWidget(parent, flags), mainWindow(parent)
{
setObjectName(colorName + QLatin1String(" Dock Widget"));
setWindowTitle(objectName() + QLatin1String(" [*]"));
- QFrame *swatch = new ColorDock(colorName, this);
+ ColorDock *swatch = new ColorDock(colorName, this);
swatch->setFrameStyle(QFrame::Box | QFrame::Sunken);
setWidget(swatch);
- changeSizeHintsAction = new QAction(tr("Change Size Hints"), this);
- connect(changeSizeHintsAction, SIGNAL(triggered()), swatch, SLOT(changeSizeHints()));
-
closableAction = new QAction(tr("Closable"), this);
closableAction->setCheckable(true);
- connect(closableAction, SIGNAL(triggered(bool)), SLOT(changeClosable(bool)));
+ connect(closableAction, &QAction::triggered, this, &ColorSwatch::changeClosable);
movableAction = new QAction(tr("Movable"), this);
movableAction->setCheckable(true);
- connect(movableAction, SIGNAL(triggered(bool)), SLOT(changeMovable(bool)));
+ connect(movableAction, &QAction::triggered, this, &ColorSwatch::changeMovable);
floatableAction = new QAction(tr("Floatable"), this);
floatableAction->setCheckable(true);
- connect(floatableAction, SIGNAL(triggered(bool)), SLOT(changeFloatable(bool)));
+ connect(floatableAction, &QAction::triggered, this, &ColorSwatch::changeFloatable);
verticalTitleBarAction = new QAction(tr("Vertical title bar"), this);
verticalTitleBarAction->setCheckable(true);
- connect(verticalTitleBarAction, SIGNAL(triggered(bool)),
- SLOT(changeVerticalTitleBar(bool)));
+ connect(verticalTitleBarAction, &QAction::triggered,
+ this, &ColorSwatch::changeVerticalTitleBar);
floatingAction = new QAction(tr("Floating"), this);
floatingAction->setCheckable(true);
- connect(floatingAction, SIGNAL(triggered(bool)), SLOT(changeFloating(bool)));
+ connect(floatingAction, &QAction::triggered, this, &ColorSwatch::changeFloating);
allowedAreasActions = new QActionGroup(this);
allowedAreasActions->setExclusive(false);
allowLeftAction = new QAction(tr("Allow on Left"), this);
allowLeftAction->setCheckable(true);
- connect(allowLeftAction, SIGNAL(triggered(bool)), SLOT(allowLeft(bool)));
+ connect(allowLeftAction, &QAction::triggered, this, &ColorSwatch::allowLeft);
allowRightAction = new QAction(tr("Allow on Right"), this);
allowRightAction->setCheckable(true);
- connect(allowRightAction, SIGNAL(triggered(bool)), SLOT(allowRight(bool)));
+ connect(allowRightAction, &QAction::triggered, this, &ColorSwatch::allowRight);
allowTopAction = new QAction(tr("Allow on Top"), this);
allowTopAction->setCheckable(true);
- connect(allowTopAction, SIGNAL(triggered(bool)), SLOT(allowTop(bool)));
+ connect(allowTopAction, &QAction::triggered, this, &ColorSwatch::allowTop);
allowBottomAction = new QAction(tr("Allow on Bottom"), this);
allowBottomAction->setCheckable(true);
- connect(allowBottomAction, SIGNAL(triggered(bool)), SLOT(allowBottom(bool)));
+ connect(allowBottomAction, &QAction::triggered, this, &ColorSwatch::allowBottom);
allowedAreasActions->addAction(allowLeftAction);
allowedAreasActions->addAction(allowRightAction);
@@ -312,56 +301,56 @@ ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFl
leftAction = new QAction(tr("Place on Left") , this);
leftAction->setCheckable(true);
- connect(leftAction, SIGNAL(triggered(bool)), SLOT(placeLeft(bool)));
+ connect(leftAction, &QAction::triggered, this, &ColorSwatch::placeLeft);
rightAction = new QAction(tr("Place on Right") , this);
rightAction->setCheckable(true);
- connect(rightAction, SIGNAL(triggered(bool)), SLOT(placeRight(bool)));
+ connect(rightAction, &QAction::triggered, this, &ColorSwatch::placeRight);
topAction = new QAction(tr("Place on Top") , this);
topAction->setCheckable(true);
- connect(topAction, SIGNAL(triggered(bool)), SLOT(placeTop(bool)));
+ connect(topAction, &QAction::triggered, this, &ColorSwatch::placeTop);
bottomAction = new QAction(tr("Place on Bottom") , this);
bottomAction->setCheckable(true);
- connect(bottomAction, SIGNAL(triggered(bool)), SLOT(placeBottom(bool)));
+ connect(bottomAction, &QAction::triggered, this, &ColorSwatch::placeBottom);
areaActions->addAction(leftAction);
areaActions->addAction(rightAction);
areaActions->addAction(topAction);
areaActions->addAction(bottomAction);
- connect(movableAction, SIGNAL(triggered(bool)), areaActions, SLOT(setEnabled(bool)));
+ connect(movableAction, &QAction::triggered, areaActions, &QActionGroup::setEnabled);
- connect(movableAction, SIGNAL(triggered(bool)), allowedAreasActions, SLOT(setEnabled(bool)));
+ connect(movableAction, &QAction::triggered, allowedAreasActions, &QActionGroup::setEnabled);
- connect(floatableAction, SIGNAL(triggered(bool)), floatingAction, SLOT(setEnabled(bool)));
+ connect(floatableAction, &QAction::triggered, floatingAction, &QAction::setEnabled);
- connect(floatingAction, SIGNAL(triggered(bool)), floatableAction, SLOT(setDisabled(bool)));
- connect(movableAction, SIGNAL(triggered(bool)), floatableAction, SLOT(setEnabled(bool)));
+ connect(floatingAction, &QAction::triggered, floatableAction, &QAction::setDisabled);
+ connect(movableAction, &QAction::triggered, floatableAction, &QAction::setEnabled);
tabMenu = new QMenu(this);
tabMenu->setTitle(tr("Tab into"));
- connect(tabMenu, SIGNAL(triggered(QAction*)), this, SLOT(tabInto(QAction*)));
+ connect(tabMenu, &QMenu::triggered, this, &ColorSwatch::tabInto);
splitHMenu = new QMenu(this);
splitHMenu->setTitle(tr("Split horizontally into"));
- connect(splitHMenu, SIGNAL(triggered(QAction*)), this, SLOT(splitInto(QAction*)));
+ connect(splitHMenu, &QMenu::triggered, this, &ColorSwatch::splitInto);
splitVMenu = new QMenu(this);
splitVMenu->setTitle(tr("Split vertically into"));
- connect(splitVMenu, SIGNAL(triggered(QAction*)), this, SLOT(splitInto(QAction*)));
+ connect(splitVMenu, &QMenu::triggered, this, &ColorSwatch::splitInto);
- windowModifiedAction = new QAction(tr("Modified"), this);
+ QAction *windowModifiedAction = new QAction(tr("Modified"), this);
windowModifiedAction->setCheckable(true);
windowModifiedAction->setChecked(false);
- connect(windowModifiedAction, SIGNAL(toggled(bool)), this, SLOT(setWindowModified(bool)));
+ connect(windowModifiedAction, &QAction::toggled, this, &QWidget::setWindowModified);
menu = new QMenu(colorName, this);
menu->addAction(toggleViewAction());
- QAction *action = menu->addAction(tr("Raise"));
- connect(action, SIGNAL(triggered()), this, SLOT(raise()));
- menu->addAction(changeSizeHintsAction);
+ menu->addAction(tr("Raise"), this, &QWidget::raise);
+ menu->addAction(tr("Change Size Hints..."), swatch, &ColorDock::changeSizeHints);
+
menu->addSeparator();
menu->addAction(closableAction);
menu->addAction(movableAction);
@@ -379,18 +368,17 @@ ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFl
menu->addSeparator();
menu->addAction(windowModifiedAction);
- connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateContextMenu()));
+ connect(menu, &QMenu::aboutToShow, this, &ColorSwatch::updateContextMenu);
- if(colorName == "Black") {
- leftAction->setShortcut(Qt::CTRL|Qt::Key_W);
- rightAction->setShortcut(Qt::CTRL|Qt::Key_E);
- toggleViewAction()->setShortcut(Qt::CTRL|Qt::Key_R);
+ if (colorName == QLatin1String("Black")) {
+ leftAction->setShortcut(Qt::CTRL | Qt::Key_W);
+ rightAction->setShortcut(Qt::CTRL | Qt::Key_E);
+ toggleViewAction()->setShortcut(Qt::CTRL | Qt::Key_R);
}
}
void ColorSwatch::updateContextMenu()
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
const Qt::DockWidgetArea area = mainWindow->dockWidgetArea(this);
const Qt::DockWidgetAreas areas = allowedAreas();
@@ -448,48 +436,36 @@ void ColorSwatch::updateContextMenu()
splitVMenu->clear();
QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
foreach (ColorSwatch *dock, dock_list) {
-// if (!dock->isVisible() || dock->isFloating())
-// continue;
tabMenu->addAction(dock->objectName());
splitHMenu->addAction(dock->objectName());
splitVMenu->addAction(dock->objectName());
}
}
-void ColorSwatch::splitInto(QAction *action)
+static ColorSwatch *findByName(const QMainWindow *mainWindow, const QString &name)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
- QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
- ColorSwatch *target = 0;
- foreach (ColorSwatch *dock, dock_list) {
- if (action->text() == dock->objectName()) {
- target = dock;
- break;
- }
+ foreach (ColorSwatch *dock, mainWindow->findChildren<ColorSwatch*>()) {
+ if (name == dock->objectName())
+ return dock;
}
- if (target == 0)
+ return Q_NULLPTR;
+}
+
+void ColorSwatch::splitInto(QAction *action)
+{
+ ColorSwatch *target = findByName(mainWindow, action->text());
+ if (!target)
return;
- Qt::Orientation o = action->parent() == splitHMenu
- ? Qt::Horizontal : Qt::Vertical;
+ const Qt::Orientation o = action->parent() == splitHMenu
+ ? Qt::Horizontal : Qt::Vertical;
mainWindow->splitDockWidget(target, this, o);
}
void ColorSwatch::tabInto(QAction *action)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
- QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
- ColorSwatch *target = 0;
- foreach (ColorSwatch *dock, dock_list) {
- if (action->text() == dock->objectName()) {
- target = dock;
- break;
- }
- }
- if (target == 0)
- return;
-
- mainWindow->tabifyDockWidget(target, this);
+ if (ColorSwatch *target = findByName(mainWindow, action->text()))
+ mainWindow->tabifyDockWidget(target, this);
}
void ColorSwatch::contextMenuEvent(QContextMenuEvent *event)
@@ -506,7 +482,6 @@ void ColorSwatch::resizeEvent(QResizeEvent *e)
QDockWidget::resizeEvent(e);
}
-
void ColorSwatch::allow(Qt::DockWidgetArea area, bool a)
{
Qt::DockWidgetAreas areas = allowedAreas();
@@ -523,9 +498,9 @@ void ColorSwatch::allow(Qt::DockWidgetArea area, bool a)
void ColorSwatch::place(Qt::DockWidgetArea area, bool p)
{
- if (!p) return;
+ if (!p)
+ return;
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
mainWindow->addDockWidget(area, this);
if (allowedAreasActions->isEnabled()) {
@@ -596,10 +571,10 @@ QSize BlueTitleBar::minimumSizeHint() const
BlueTitleBar::BlueTitleBar(QWidget *parent)
: QWidget(parent)
+ , leftPm(QPixmap(":/res/titlebarLeft.png"))
+ , centerPm(QPixmap(":/res/titlebarCenter.png"))
+ , rightPm(QPixmap(":/res/titlebarRight.png"))
{
- leftPm = QPixmap(":/res/titlebarLeft.png");
- centerPm = QPixmap(":/res/titlebarCenter.png");
- rightPm = QPixmap(":/res/titlebarRight.png");
}
void BlueTitleBar::paintEvent(QPaintEvent*)
@@ -687,7 +662,7 @@ void BlueTitleBar::updateMask()
{
QPainter painter(&bitmap);
- ///initialize to transparent
+ // initialize to transparent
painter.fillRect(rect, Qt::color0);
QRect contents = rect;
@@ -696,10 +671,7 @@ void BlueTitleBar::updateMask()
contents.setBottom(contents.bottom()-y());
painter.fillRect(contents, Qt::color1);
-
-
- //let's pait the titlebar
-
+ // let's paint the titlebar
QRect titleRect = this->geometry();
if (dw->features() & QDockWidget::DockWidgetVerticalTitleBar) {
@@ -722,7 +694,6 @@ void BlueTitleBar::updateMask()
QRect rect = titleRect;
-
painter.drawPixmap(rect.topLeft(), leftPm.mask());
painter.fillRect(rect.left() + leftPm.width(), rect.top(),
rect.width() - leftPm.width() - rightPm.width(),
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h
index 6d02592b22..8827a7dca7 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.h
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h
@@ -44,45 +44,15 @@ class ColorSwatch : public QDockWidget
{
Q_OBJECT
- QAction *closableAction;
- QAction *movableAction;
- QAction *floatableAction;
- QAction *floatingAction;
- QAction *verticalTitleBarAction;
-
- QActionGroup *allowedAreasActions;
- QAction *allowLeftAction;
- QAction *allowRightAction;
- QAction *allowTopAction;
- QAction *allowBottomAction;
-
- QActionGroup *areaActions;
- QAction *leftAction;
- QAction *rightAction;
- QAction *topAction;
- QAction *bottomAction;
-
- QAction *changeSizeHintsAction;
-
- QMenu *tabMenu;
- QMenu *splitHMenu;
- QMenu *splitVMenu;
-
- QAction *windowModifiedAction;
-
public:
- explicit ColorSwatch(const QString &colorName, QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit ColorSwatch(const QString &colorName, QMainWindow *parent = Q_NULLPTR, Qt::WindowFlags flags = 0);
- QMenu *menu;
void setCustomSizeHint(const QSize &size);
+ QMenu *colorSwatchMenu() const { return menu; }
protected:
- virtual void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
-
-private:
- void allow(Qt::DockWidgetArea area, bool allow);
- void place(Qt::DockWidgetArea area, bool place);
+ void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
private slots:
void changeClosable(bool on);
@@ -104,25 +74,57 @@ private slots:
void splitInto(QAction *action);
void tabInto(QAction *action);
+
+private:
+ void allow(Qt::DockWidgetArea area, bool allow);
+ void place(Qt::DockWidgetArea area, bool place);
+
+ QAction *closableAction;
+ QAction *movableAction;
+ QAction *floatableAction;
+ QAction *floatingAction;
+ QAction *verticalTitleBarAction;
+
+ QActionGroup *allowedAreasActions;
+ QAction *allowLeftAction;
+ QAction *allowRightAction;
+ QAction *allowTopAction;
+ QAction *allowBottomAction;
+
+ QActionGroup *areaActions;
+ QAction *leftAction;
+ QAction *rightAction;
+ QAction *topAction;
+ QAction *bottomAction;
+
+ QMenu *tabMenu;
+ QMenu *splitHMenu;
+ QMenu *splitVMenu;
+ QMenu *menu;
+
+ QMainWindow *mainWindow;
};
class BlueTitleBar : public QWidget
{
Q_OBJECT
public:
- BlueTitleBar(QWidget *parent = 0);
+ explicit BlueTitleBar(QWidget *parent = Q_NULLPTR);
QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSizeHint(); }
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+
public slots:
void updateMask();
private:
- QPixmap leftPm, centerPm, rightPm;
+ const QPixmap leftPm;
+ const QPixmap centerPm;
+ const QPixmap rightPm;
};
-
-#endif
+#endif // COLORSWATCH_H
diff --git a/examples/widgets/mainwindows/mainwindow/main.cpp b/examples/widgets/mainwindows/mainwindow/main.cpp
index 2192074791..b32b595a2d 100644
--- a/examples/widgets/mainwindows/mainwindow/main.cpp
+++ b/examples/widgets/mainwindows/mainwindow/main.cpp
@@ -37,9 +37,10 @@
#include <QPainterPath>
#include <QPainter>
#include <QMap>
-#include <qdebug.h>
+#include <QDebug>
-void render_qt_text(QPainter *painter, int w, int h, const QColor &color) {
+void render_qt_text(QPainter *painter, int w, int h, const QColor &color)
+{
QPainterPath path;
path.moveTo(-0.083695, 0.283849);
path.cubicTo(-0.049581, 0.349613, -0.012720, 0.397969, 0.026886, 0.428917);
@@ -108,47 +109,67 @@ void render_qt_text(QPainter *painter, int w, int h, const QColor &color) {
painter->drawPath(path);
}
-void usage()
+static void usage()
{
qWarning() << "Usage: mainwindow [-SizeHint<color> <width>x<height>] ...";
exit(1);
}
-QMap<QString, QSize> parseCustomSizeHints(int argc, char **argv)
-{
- QMap<QString, QSize> result;
-
- for (int i = 1; i < argc; ++i) {
- QString arg = QString::fromLocal8Bit(argv[i]);
+enum ParseCommandLineArgumentsResult {
+ CommandLineArgumentsOk,
+ CommandLineArgumentsError,
+ HelpRequested
+};
+static ParseCommandLineArgumentsResult
+ parseCustomSizeHints(const QStringList &arguments, MainWindow::CustomSizeHintMap *result)
+{
+ result->clear();
+ const int argumentCount = arguments.size();
+ for (int i = 1; i < argumentCount; ++i) {
+ const QString &arg = arguments.at(i);
if (arg.startsWith(QLatin1String("-SizeHint"))) {
- QString name = arg.mid(9);
+ const QString name = arg.mid(9);
if (name.isEmpty())
- usage();
- if (++i == argc)
- usage();
- QString sizeStr = QString::fromLocal8Bit(argv[i]);
- int idx = sizeStr.indexOf(QLatin1Char('x'));
+ return CommandLineArgumentsError;
+ if (++i == argumentCount)
+ return CommandLineArgumentsError;
+ const QString sizeStr = arguments.at(i);
+ const int idx = sizeStr.indexOf(QLatin1Char('x'));
if (idx == -1)
- usage();
+ return CommandLineArgumentsError;
bool ok;
- int w = sizeStr.left(idx).toInt(&ok);
+ const int w = sizeStr.leftRef(idx).toInt(&ok);
if (!ok)
- usage();
- int h = sizeStr.mid(idx + 1).toInt(&ok);
+ return CommandLineArgumentsError;
+ const int h = sizeStr.midRef(idx + 1).toInt(&ok);
if (!ok)
- usage();
- result[name] = QSize(w, h);
+ return CommandLineArgumentsError;
+ result->insert(name, QSize(w, h));
+ } else if (arg == QLatin1String("-h") || arg == QLatin1String("--help")) {
+ return HelpRequested;
+ } else {
+ return CommandLineArgumentsError;
}
}
- return result;
+ return CommandLineArgumentsOk;
}
int main(int argc, char **argv)
{
QApplication app(argc, argv);
- QMap<QString, QSize> customSizeHints = parseCustomSizeHints(argc, argv);
+ MainWindow::CustomSizeHintMap customSizeHints;
+ switch (parseCustomSizeHints(QCoreApplication::arguments(), &customSizeHints)) {
+ case CommandLineArgumentsOk:
+ break;
+ case CommandLineArgumentsError:
+ usage();
+ return -1;
+ case HelpRequested:
+ usage();
+ return 0;
+ }
MainWindow mainWin(customSizeHints);
mainWin.resize(800, 600);
mainWin.show();
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index 6349f7aa2e..91579ae611 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -44,6 +44,7 @@
#include <QFile>
#include <QDataStream>
#include <QFileDialog>
+#include <QDialogButtonBox>
#include <QMessageBox>
#include <QSignalMapper>
#include <QApplication>
@@ -53,9 +54,10 @@
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
-#include <qdebug.h>
+#include <QTextEdit>
+#include <QDebug>
-static const char * const message =
+static const char message[] =
"<p><b>Qt Main Window Example</b></p>"
"<p>This is a demonstration of the QMainWindow, QToolBar and "
@@ -75,14 +77,14 @@ static const char * const message =
Q_DECLARE_METATYPE(QDockWidget::DockWidgetFeatures)
-MainWindow::MainWindow(const QMap<QString, QSize> &customSizeHints,
- QWidget *parent, Qt::WindowFlags flags)
+MainWindow::MainWindow(const CustomSizeHintMap &customSizeHints,
+ QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
{
setObjectName("MainWindow");
setWindowTitle("Qt Main Window Example");
- center = new QTextEdit(this);
+ QTextEdit *center = new QTextEdit(this);
center->setReadOnly(true);
center->setMinimumSize(400, 205);
setCentralWidget(center);
@@ -116,49 +118,48 @@ void MainWindow::setupMenuBar()
{
QMenu *menu = menuBar()->addMenu(tr("&File"));
- QAction *action = menu->addAction(tr("Save layout..."));
- connect(action, SIGNAL(triggered()), this, SLOT(saveLayout()));
-
- action = menu->addAction(tr("Load layout..."));
- connect(action, SIGNAL(triggered()), this, SLOT(loadLayout()));
-
- action = menu->addAction(tr("Switch layout direction"));
- connect(action, SIGNAL(triggered()), this, SLOT(switchLayoutDirection()));
+ menu->addAction(tr("Save layout..."), this, &MainWindow::saveLayout);
+ menu->addAction(tr("Load layout..."), this, &MainWindow::loadLayout);
+ menu->addAction(tr("Switch layout direction"),this, &MainWindow::switchLayoutDirection);
menu->addSeparator();
-
- menu->addAction(tr("&Quit"), this, SLOT(close()));
+ menu->addAction(tr("&Quit"), this, &QWidget::close);
mainWindowMenu = menuBar()->addMenu(tr("Main window"));
- action = mainWindowMenu->addAction(tr("Animated docks"));
+ QAction *action = mainWindowMenu->addAction(tr("Animated docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & AnimatedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Allow nested docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & AllowNestedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Allow tabbed docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & AllowTabbedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Force tabbed docks"));
action->setCheckable(true);
action->setChecked(dockOptions() & ForceTabbedDocks);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
action = mainWindowMenu->addAction(tr("Vertical tabs"));
action->setCheckable(true);
action->setChecked(dockOptions() & VerticalTabs);
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
+
+ action = mainWindowMenu->addAction(tr("Grouped dragging"));
+ action->setCheckable(true);
+ action->setChecked(dockOptions() & GroupedDragging);
+ connect(action, &QAction::toggled, this, &MainWindow::setDockOptions);
QMenu *toolBarMenu = menuBar()->addMenu(tr("Tool bars"));
for (int i = 0; i < toolBars.count(); ++i)
- toolBarMenu->addMenu(toolBars.at(i)->menu);
+ toolBarMenu->addMenu(toolBars.at(i)->toolbarMenu());
#ifdef Q_OS_OSX
toolBarMenu->addSeparator();
@@ -166,7 +167,7 @@ void MainWindow::setupMenuBar()
action = toolBarMenu->addAction(tr("Unified"));
action->setCheckable(true);
action->setChecked(unifiedTitleAndToolBarOnMac());
- connect(action, SIGNAL(toggled(bool)), this, SLOT(setUnifiedTitleAndToolBarOnMac(bool)));
+ connect(action, &QAction::toggled, this, &QMainWindow::setUnifiedTitleAndToolBarOnMac);
#endif
dockWidgetMenu = menuBar()->addMenu(tr("&Dock Widgets"));
@@ -187,6 +188,8 @@ void MainWindow::setDockOptions()
opts |= ForceTabbedDocks;
if (actions.at(4)->isChecked())
opts |= VerticalTabs;
+ if (actions.at(5)->isChecked())
+ opts |= GroupedDragging;
QMainWindow::setDockOptions(opts);
}
@@ -200,8 +203,7 @@ void MainWindow::saveLayout()
QFile file(fileName);
if (!file.open(QFile::WriteOnly)) {
QString msg = tr("Failed to open %1\n%2")
- .arg(fileName)
- .arg(file.errorString());
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
QMessageBox::warning(this, tr("Error"), msg);
return;
}
@@ -217,8 +219,7 @@ void MainWindow::saveLayout()
if (!ok) {
QString msg = tr("Error writing to %1\n%2")
- .arg(fileName)
- .arg(file.errorString());
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
QMessageBox::warning(this, tr("Error"), msg);
return;
}
@@ -233,8 +234,7 @@ void MainWindow::loadLayout()
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
QString msg = tr("Failed to open %1\n%2")
- .arg(fileName)
- .arg(file.errorString());
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
QMessageBox::warning(this, tr("Error"), msg);
return;
}
@@ -259,56 +259,65 @@ void MainWindow::loadLayout()
ok = restoreState(layout_data);
if (!ok) {
- QString msg = tr("Error reading %1")
- .arg(fileName);
+ QString msg = tr("Error reading %1").arg(QDir::toNativeSeparators(fileName));
QMessageBox::warning(this, tr("Error"), msg);
return;
}
}
-QAction *addAction(QMenu *menu, const QString &text, QActionGroup *group, QSignalMapper *mapper,
- int id)
+class DockWidgetAreaCornerFunctor {
+public:
+ explicit DockWidgetAreaCornerFunctor(QMainWindow *mw, Qt::Corner c, Qt::DockWidgetArea a)
+ : m_mainWindow(mw), m_area(a), m_corner(c) {}
+
+ void operator()() const { m_mainWindow->setCorner(m_corner, m_area); }
+
+private:
+ QMainWindow *m_mainWindow;
+ Qt::DockWidgetArea m_area;
+ Qt::Corner m_corner;
+};
+
+static QAction *addCornerAction(const QString &text, QMainWindow *mw, QMenu *menu, QActionGroup *group,
+ Qt::Corner c, Qt::DockWidgetArea a)
{
- bool first = group->actions().isEmpty();
- QAction *result = menu->addAction(text);
+ QAction *result = menu->addAction(text, mw, DockWidgetAreaCornerFunctor(mw, c, a));
result->setCheckable(true);
- result->setChecked(first);
group->addAction(result);
- QObject::connect(result, SIGNAL(triggered()), mapper, SLOT(map()));
- mapper->setMapping(result, id);
return result;
}
-void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints)
+void MainWindow::setupDockWidgets(const CustomSizeHintMap &customSizeHints)
{
qRegisterMetaType<QDockWidget::DockWidgetFeatures>();
- mapper = new QSignalMapper(this);
- connect(mapper, SIGNAL(mapped(int)), this, SLOT(setCorner(int)));
-
- QMenu *corner_menu = dockWidgetMenu->addMenu(tr("Top left corner"));
+ QMenu *cornerMenu = dockWidgetMenu->addMenu(tr("Top left corner"));
QActionGroup *group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Top dock area"), group, mapper, 0);
- ::addAction(corner_menu, tr("Left dock area"), group, mapper, 1);
+ QAction *cornerAction = addCornerAction(tr("Top dock area"), this, cornerMenu, group, Qt::TopLeftCorner, Qt::TopDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Left dock area"), this, cornerMenu, group, Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
- corner_menu = dockWidgetMenu->addMenu(tr("Top right corner"));
+ cornerMenu = dockWidgetMenu->addMenu(tr("Top right corner"));
group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Top dock area"), group, mapper, 2);
- ::addAction(corner_menu, tr("Right dock area"), group, mapper, 3);
+ cornerAction = addCornerAction(tr("Top dock area"), this, cornerMenu, group, Qt::TopRightCorner, Qt::TopDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Right dock area"), this, cornerMenu, group, Qt::TopRightCorner, Qt::RightDockWidgetArea);
- corner_menu = dockWidgetMenu->addMenu(tr("Bottom left corner"));
+ cornerMenu = dockWidgetMenu->addMenu(tr("Bottom left corner"));
group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Bottom dock area"), group, mapper, 4);
- ::addAction(corner_menu, tr("Left dock area"), group, mapper, 5);
+ cornerAction = addCornerAction(tr("Bottom dock area"), this, cornerMenu, group, Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Left dock area"), this, cornerMenu, group, Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
- corner_menu = dockWidgetMenu->addMenu(tr("Bottom right corner"));
+ cornerMenu = dockWidgetMenu->addMenu(tr("Bottom right corner"));
group = new QActionGroup(this);
group->setExclusive(true);
- ::addAction(corner_menu, tr("Bottom dock area"), group, mapper, 6);
- ::addAction(corner_menu, tr("Right dock area"), group, mapper, 7);
+ cornerAction = addCornerAction(tr("Bottom dock area"), this, cornerMenu, group, Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
+ cornerAction->setChecked(true);
+ addCornerAction(tr("Right dock area"), this, cornerMenu, group, Qt::BottomRightCorner, Qt::RightDockWidgetArea);
dockWidgetMenu->addSeparator();
@@ -330,16 +339,16 @@ void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints)
};
const int setCount = sizeof(sets) / sizeof(Set);
+ const QIcon qtIcon(QPixmap(":/res/qt.png"));
for (int i = 0; i < setCount; ++i) {
ColorSwatch *swatch = new ColorSwatch(tr(sets[i].name), this, Qt::WindowFlags(sets[i].flags));
- if (i%2)
- swatch->setWindowIcon(QIcon(QPixmap(":/res/qt.png")));
+ if (i % 2)
+ swatch->setWindowIcon(qtIcon);
if (qstrcmp(sets[i].name, "Blue") == 0) {
BlueTitleBar *titlebar = new BlueTitleBar(swatch);
swatch->setTitleBarWidget(titlebar);
- connect(swatch, SIGNAL(topLevelChanged(bool)), titlebar, SLOT(updateMask()));
- connect(swatch, SIGNAL(featuresChanged(QDockWidget::DockWidgetFeatures)), titlebar, SLOT(updateMask()), Qt::QueuedConnection);
-
+ connect(swatch, &QDockWidget::topLevelChanged, titlebar, &BlueTitleBar::updateMask);
+ connect(swatch, &QDockWidget::featuresChanged, titlebar, &BlueTitleBar::updateMask, Qt::QueuedConnection);
}
QString name = QString::fromLatin1(sets[i].name);
@@ -347,69 +356,32 @@ void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints)
swatch->setCustomSizeHint(customSizeHints.value(name));
addDockWidget(sets[i].area, swatch);
- dockWidgetMenu->addMenu(swatch->menu);
+ dockWidgetMenu->addMenu(swatch->colorSwatchMenu());
}
- createDockWidgetAction = new QAction(tr("Add dock widget..."), this);
- connect(createDockWidgetAction, SIGNAL(triggered()), this, SLOT(createDockWidget()));
destroyDockWidgetMenu = new QMenu(tr("Destroy dock widget"), this);
destroyDockWidgetMenu->setEnabled(false);
- connect(destroyDockWidgetMenu, SIGNAL(triggered(QAction*)), this, SLOT(destroyDockWidget(QAction*)));
+ connect(destroyDockWidgetMenu, &QMenu::triggered, this, &MainWindow::destroyDockWidget);
dockWidgetMenu->addSeparator();
- dockWidgetMenu->addAction(createDockWidgetAction);
+ dockWidgetMenu->addAction(tr("Add dock widget..."), this, &MainWindow::createDockWidget);
dockWidgetMenu->addMenu(destroyDockWidgetMenu);
}
-void MainWindow::setCorner(int id)
-{
- switch (id) {
- case 0:
- QMainWindow::setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
- break;
- case 1:
- QMainWindow::setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
- break;
- case 2:
- QMainWindow::setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
- break;
- case 3:
- QMainWindow::setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
- break;
- case 4:
- QMainWindow::setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
- break;
- case 5:
- QMainWindow::setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
- break;
- case 6:
- QMainWindow::setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
- break;
- case 7:
- QMainWindow::setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
- break;
- }
-}
-
-void MainWindow::showEvent(QShowEvent *event)
-{
- QMainWindow::showEvent(event);
-}
-
void MainWindow::switchLayoutDirection()
{
if (layoutDirection() == Qt::LeftToRight)
- qApp->setLayoutDirection(Qt::RightToLeft);
+ QApplication::setLayoutDirection(Qt::RightToLeft);
else
- qApp->setLayoutDirection(Qt::LeftToRight);
+ QApplication::setLayoutDirection(Qt::LeftToRight);
}
class CreateDockWidgetDialog : public QDialog
{
public:
- CreateDockWidgetDialog(QWidget *parent = 0);
+ explicit CreateDockWidgetDialog(QWidget *parent = Q_NULLPTR);
- QString objectName() const;
+ QString enteredObjectName() const { return m_objectName->text(); }
Qt::DockWidgetArea location() const;
private:
@@ -419,15 +391,17 @@ private:
CreateDockWidgetDialog::CreateDockWidgetDialog(QWidget *parent)
: QDialog(parent)
+ , m_objectName(new QLineEdit(this))
+ , m_location(new QComboBox(this))
{
+ setWindowTitle(tr("Add Dock Widget"));
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QGridLayout *layout = new QGridLayout(this);
layout->addWidget(new QLabel(tr("Object name:")), 0, 0);
- m_objectName = new QLineEdit;
layout->addWidget(m_objectName, 0, 1);
layout->addWidget(new QLabel(tr("Location:")), 1, 0);
- m_location = new QComboBox;
m_location->setEditable(false);
m_location->addItem(tr("Top"));
m_location->addItem(tr("Left"));
@@ -436,23 +410,10 @@ CreateDockWidgetDialog::CreateDockWidgetDialog(QWidget *parent)
m_location->addItem(tr("Restore"));
layout->addWidget(m_location, 1, 1);
- QHBoxLayout *buttonLayout = new QHBoxLayout;
- layout->addLayout(buttonLayout, 2, 0, 1, 2);
- buttonLayout->addStretch();
-
- QPushButton *cancelButton = new QPushButton(tr("Cancel"));
- connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
- buttonLayout->addWidget(cancelButton);
- QPushButton *okButton = new QPushButton(tr("Ok"));
- connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
- buttonLayout->addWidget(okButton);
-
- okButton->setDefault(true);
-}
-
-QString CreateDockWidgetDialog::objectName() const
-{
- return m_objectName->text();
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::reject);
+ layout->addWidget(buttonBox, 2, 0, 1, 2);
}
Qt::DockWidgetArea CreateDockWidgetDialog::location() const
@@ -471,13 +432,13 @@ Qt::DockWidgetArea CreateDockWidgetDialog::location() const
void MainWindow::createDockWidget()
{
CreateDockWidgetDialog dialog(this);
- int ret = dialog.exec();
- if (ret == QDialog::Rejected)
+ if (dialog.exec() == QDialog::Rejected)
return;
QDockWidget *dw = new QDockWidget;
- dw->setObjectName(dialog.objectName());
- dw->setWindowTitle(dialog.objectName());
+ const QString name = dialog.enteredObjectName();
+ dw->setObjectName(name);
+ dw->setWindowTitle(name);
dw->setWidget(new QTextEdit);
Qt::DockWidgetArea area = dialog.location();
@@ -499,7 +460,7 @@ void MainWindow::createDockWidget()
extraDockWidgets.append(dw);
destroyDockWidgetMenu->setEnabled(true);
- destroyDockWidgetMenu->addAction(new QAction(dialog.objectName(), this));
+ destroyDockWidgetMenu->addAction(new QAction(name, this));
}
void MainWindow::destroyDockWidget(QAction *action)
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.h b/examples/widgets/mainwindows/mainwindow/mainwindow.h
index f9a6176b2d..162e977520 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.h
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.h
@@ -35,37 +35,25 @@
#define MAINWINDOW_H
#include <QMainWindow>
-#include <QTextEdit>
class ToolBar;
QT_FORWARD_DECLARE_CLASS(QMenu)
-QT_FORWARD_DECLARE_CLASS(QSignalMapper)
class MainWindow : public QMainWindow
{
Q_OBJECT
- QTextEdit *center;
- QList<ToolBar*> toolBars;
- QMenu *dockWidgetMenu;
- QMenu *mainWindowMenu;
- QSignalMapper *mapper;
- QList<QDockWidget*> extraDockWidgets;
- QAction *createDockWidgetAction;
- QMenu *destroyDockWidgetMenu;
-
public:
- MainWindow(const QMap<QString, QSize> &customSizeHints,
- QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ typedef QMap<QString, QSize> CustomSizeHintMap;
-protected:
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
+ explicit MainWindow(const CustomSizeHintMap &customSizeHints,
+ QWidget *parent = Q_NULLPTR,
+ Qt::WindowFlags flags = 0);
public slots:
void actionTriggered(QAction *action);
void saveLayout();
void loadLayout();
- void setCorner(int id);
void switchLayoutDirection();
void setDockOptions();
@@ -75,8 +63,13 @@ public slots:
private:
void setupToolBar();
void setupMenuBar();
- void setupDockWidgets(const QMap<QString, QSize> &customSizeHints);
-};
+ void setupDockWidgets(const CustomSizeHintMap &customSizeHints);
+ QList<ToolBar*> toolBars;
+ QMenu *dockWidgetMenu;
+ QMenu *mainWindowMenu;
+ QList<QDockWidget *> extraDockWidgets;
+ QMenu *destroyDockWidgetMenu;
+};
-#endif
+#endif // MAINWINDOW_H
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.cpp b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
index 280ba965d6..a9b308370a 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.cpp
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
@@ -63,15 +63,15 @@ static QPixmap genIcon(const QSize &iconSize, int number, const QColor &color)
{ return genIcon(iconSize, QString::number(number), color); }
ToolBar::ToolBar(const QString &title, QWidget *parent)
- : QToolBar(parent), spinbox(0), spinboxAction(0)
+ : QToolBar(parent)
+ , spinbox(Q_NULLPTR)
+ , spinboxAction(Q_NULLPTR)
{
- tip = 0;
setWindowTitle(title);
setObjectName(title);
setIconSize(QSize(32, 32));
- QColor bg(palette().background().color());
menu = new QMenu("One", this);
menu->setIcon(genIcon(iconSize(), 1, Qt::black));
menu->addAction(genIcon(iconSize(), "A", Qt::blue), "A");
@@ -90,43 +90,43 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
addAction(genIcon(iconSize(), 6, Qt::yellow), "Six");
orderAction = new QAction(this);
orderAction->setText(tr("Order Items in Tool Bar"));
- connect(orderAction, SIGNAL(triggered()), SLOT(order()));
+ connect(orderAction, &QAction::triggered, this, &ToolBar::order);
randomizeAction = new QAction(this);
randomizeAction->setText(tr("Randomize Items in Tool Bar"));
- connect(randomizeAction, SIGNAL(triggered()), SLOT(randomize()));
+ connect(randomizeAction, &QAction::triggered, this, &ToolBar::randomize);
addSpinBoxAction = new QAction(this);
addSpinBoxAction->setText(tr("Add Spin Box"));
- connect(addSpinBoxAction, SIGNAL(triggered()), SLOT(addSpinBox()));
+ connect(addSpinBoxAction, &QAction::triggered, this, &ToolBar::addSpinBox);
removeSpinBoxAction = new QAction(this);
removeSpinBoxAction->setText(tr("Remove Spin Box"));
removeSpinBoxAction->setEnabled(false);
- connect(removeSpinBoxAction, SIGNAL(triggered()), SLOT(removeSpinBox()));
+ connect(removeSpinBoxAction, &QAction::triggered, this, &ToolBar::removeSpinBox);
movableAction = new QAction(tr("Movable"), this);
movableAction->setCheckable(true);
- connect(movableAction, SIGNAL(triggered(bool)), SLOT(changeMovable(bool)));
+ connect(movableAction, &QAction::triggered, this, &ToolBar::changeMovable);
allowedAreasActions = new QActionGroup(this);
allowedAreasActions->setExclusive(false);
allowLeftAction = new QAction(tr("Allow on Left"), this);
allowLeftAction->setCheckable(true);
- connect(allowLeftAction, SIGNAL(triggered(bool)), SLOT(allowLeft(bool)));
+ connect(allowLeftAction, &QAction::triggered, this, &ToolBar::allowLeft);
allowRightAction = new QAction(tr("Allow on Right"), this);
allowRightAction->setCheckable(true);
- connect(allowRightAction, SIGNAL(triggered(bool)), SLOT(allowRight(bool)));
+ connect(allowRightAction, &QAction::triggered, this, &ToolBar::allowRight);
allowTopAction = new QAction(tr("Allow on Top"), this);
allowTopAction->setCheckable(true);
- connect(allowTopAction, SIGNAL(triggered(bool)), SLOT(allowTop(bool)));
+ connect(allowTopAction, &QAction::triggered, this, &ToolBar::allowTop);
allowBottomAction = new QAction(tr("Allow on Bottom"), this);
allowBottomAction->setCheckable(true);
- connect(allowBottomAction, SIGNAL(triggered(bool)), SLOT(allowBottom(bool)));
+ connect(allowBottomAction, &QAction::triggered, this, &ToolBar::allowBottom);
allowedAreasActions->addAction(allowLeftAction);
allowedAreasActions->addAction(allowRightAction);
@@ -138,31 +138,28 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
leftAction = new QAction(tr("Place on Left") , this);
leftAction->setCheckable(true);
- connect(leftAction, SIGNAL(triggered(bool)), SLOT(placeLeft(bool)));
+ connect(leftAction, &QAction::triggered, this, &ToolBar::placeLeft);
rightAction = new QAction(tr("Place on Right") , this);
rightAction->setCheckable(true);
- connect(rightAction, SIGNAL(triggered(bool)), SLOT(placeRight(bool)));
+ connect(rightAction, &QAction::triggered, this, &ToolBar::placeRight);
topAction = new QAction(tr("Place on Top") , this);
topAction->setCheckable(true);
- connect(topAction, SIGNAL(triggered(bool)), SLOT(placeTop(bool)));
+ connect(topAction, &QAction::triggered, this, &ToolBar::placeTop);
bottomAction = new QAction(tr("Place on Bottom") , this);
bottomAction->setCheckable(true);
- connect(bottomAction, SIGNAL(triggered(bool)), SLOT(placeBottom(bool)));
+ connect(bottomAction, &QAction::triggered, this, &ToolBar::placeBottom);
areaActions->addAction(leftAction);
areaActions->addAction(rightAction);
areaActions->addAction(topAction);
areaActions->addAction(bottomAction);
- toolBarBreakAction = new QAction(tr("Insert break"), this);
- connect(toolBarBreakAction, SIGNAL(triggered(bool)), this, SLOT(insertToolBarBreak()));
+ connect(movableAction, &QAction::triggered, areaActions, &QActionGroup::setEnabled);
- connect(movableAction, SIGNAL(triggered(bool)), areaActions, SLOT(setEnabled(bool)));
-
- connect(movableAction, SIGNAL(triggered(bool)), allowedAreasActions, SLOT(setEnabled(bool)));
+ connect(movableAction, &QAction::triggered, allowedAreasActions, &QActionGroup::setEnabled);
menu = new QMenu(title, this);
menu->addAction(toggleViewAction());
@@ -179,9 +176,9 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
menu->addSeparator();
menu->addActions(areaActions->actions());
menu->addSeparator();
- menu->addAction(toolBarBreakAction);
+ menu->addAction(tr("Insert break"), this, &ToolBar::insertToolBarBreak);
- connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
+ connect(menu, &QMenu::aboutToShow, this, &ToolBar::updateMenu);
randomize();
}
@@ -223,10 +220,9 @@ void ToolBar::updateMenu()
void ToolBar::order()
{
- QList<QAction *> ordered, actions1 = actions(),
- actions2 = findChildren<QAction *>();
- while (!actions2.isEmpty()) {
- QAction *action = actions2.takeFirst();
+ QList<QAction *> ordered;
+ QList<QAction *> actions1 = actions();
+ foreach (QAction *action, findChildren<QAction *>()) {
if (!actions1.contains(action))
continue;
actions1.removeAll(action);
@@ -241,7 +237,8 @@ void ToolBar::order()
void ToolBar::randomize()
{
- QList<QAction *> randomized, actions = this->actions();
+ QList<QAction *> randomized;
+ QList<QAction *> actions = this->actions();
while (!actions.isEmpty()) {
QAction *action = actions.takeAt(rand() % actions.size());
randomized.append(action);
@@ -254,9 +251,8 @@ void ToolBar::randomize()
void ToolBar::addSpinBox()
{
- if (!spinbox) {
+ if (!spinbox)
spinbox = new QSpinBox(this);
- }
if (!spinboxAction)
spinboxAction = addWidget(spinbox);
else
@@ -341,35 +337,3 @@ void ToolBar::insertToolBarBreak()
mainWindow->insertToolBarBreak(this);
}
-
-void ToolBar::enterEvent(QEvent*)
-{
-/*
- These labels on top of toolbars look darn ugly
-
- if (tip == 0) {
- tip = new QLabel(windowTitle(), this);
- QPalette pal = tip->palette();
- QColor c = Qt::black;
- c.setAlpha(100);
- pal.setColor(QPalette::Window, c);
- pal.setColor(QPalette::Foreground, Qt::white);
- tip->setPalette(pal);
- tip->setAutoFillBackground(true);
- tip->setMargin(3);
- tip->setText(windowTitle());
- }
- QPoint c = rect().center();
- QSize hint = tip->sizeHint();
- tip->setGeometry(c.x() - hint.width()/2, c.y() - hint.height()/2,
- hint.width(), hint.height());
-
- tip->show();
-*/
-}
-
-void ToolBar::leaveEvent(QEvent*)
-{
- if (tip != 0)
- tip->hide();
-}
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.h b/examples/widgets/mainwindows/mainwindow/toolbar.h
index b1674a2034..2629d9d7a7 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.h
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.h
@@ -40,49 +40,15 @@ QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QActionGroup)
QT_FORWARD_DECLARE_CLASS(QMenu)
QT_FORWARD_DECLARE_CLASS(QSpinBox)
-QT_FORWARD_DECLARE_CLASS(QLabel)
class ToolBar : public QToolBar
{
Q_OBJECT
- QSpinBox *spinbox;
- QAction *spinboxAction;
-
- QAction *orderAction;
- QAction *randomizeAction;
- QAction *addSpinBoxAction;
- QAction *removeSpinBoxAction;
-
- QAction *movableAction;
-
- QActionGroup *allowedAreasActions;
- QAction *allowLeftAction;
- QAction *allowRightAction;
- QAction *allowTopAction;
- QAction *allowBottomAction;
-
- QActionGroup *areaActions;
- QAction *leftAction;
- QAction *rightAction;
- QAction *topAction;
- QAction *bottomAction;
-
- QAction *toolBarBreakAction;
-
public:
- ToolBar(const QString &title, QWidget *parent);
-
- QMenu *menu;
+ explicit ToolBar(const QString &title, QWidget *parent);
-protected:
- void enterEvent(QEvent*) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent*) Q_DECL_OVERRIDE;
-
-private:
- void allow(Qt::ToolBarArea area, bool allow);
- void place(Qt::ToolBarArea area, bool place);
- QLabel *tip;
+ QMenu *toolbarMenu() const { return menu; }
private slots:
void order();
@@ -105,6 +71,32 @@ private slots:
void updateMenu();
void insertToolBarBreak();
+private:
+ void allow(Qt::ToolBarArea area, bool allow);
+ void place(Qt::ToolBarArea area, bool place);
+
+ QSpinBox *spinbox;
+ QAction *spinboxAction;
+
+ QMenu *menu;
+ QAction *orderAction;
+ QAction *randomizeAction;
+ QAction *addSpinBoxAction;
+ QAction *removeSpinBoxAction;
+
+ QAction *movableAction;
+
+ QActionGroup *allowedAreasActions;
+ QAction *allowLeftAction;
+ QAction *allowRightAction;
+ QAction *allowTopAction;
+ QAction *allowBottomAction;
+
+ QActionGroup *areaActions;
+ QAction *leftAction;
+ QAction *rightAction;
+ QAction *topAction;
+ QAction *bottomAction;
};
-#endif
+#endif // TOOLBAR_H
diff --git a/examples/widgets/mainwindows/mainwindows.pro b/examples/widgets/mainwindows/mainwindows.pro
index 52179ec9bd..dcda89abaf 100644
--- a/examples/widgets/mainwindows/mainwindows.pro
+++ b/examples/widgets/mainwindows/mainwindows.pro
@@ -4,5 +4,4 @@ SUBDIRS = application \
mainwindow \
mdi \
menus \
- recentfiles \
sdi
diff --git a/examples/widgets/mainwindows/mdi/main.cpp b/examples/widgets/mainwindows/mdi/main.cpp
index 5976c85c1c..f02285d1cf 100644
--- a/examples/widgets/mainwindows/mdi/main.cpp
+++ b/examples/widgets/mainwindows/mdi/main.cpp
@@ -49,6 +49,8 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(mdi);
QApplication app(argc, argv);
+ QCoreApplication::setApplicationName("MDI Example");
+ QCoreApplication::setOrganizationName("QtProject");
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
QCommandLineParser parser;
parser.setApplicationDescription("Qt MDI Example");
diff --git a/examples/widgets/mainwindows/mdi/mainwindow.cpp b/examples/widgets/mainwindows/mdi/mainwindow.cpp
index 83ffbf6557..35136c81c4 100644
--- a/examples/widgets/mainwindows/mdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mdi/mainwindow.cpp
@@ -44,20 +44,15 @@
#include "mdichild.h"
MainWindow::MainWindow()
+ : mdiArea(new QMdiArea)
{
- mdiArea = new QMdiArea;
mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setCentralWidget(mdiArea);
- connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)),
- this, SLOT(updateMenus()));
- windowMapper = new QSignalMapper(this);
- connect(windowMapper, SIGNAL(mapped(QWidget*)),
- this, SLOT(setActiveSubWindow(QWidget*)));
+ connect(mdiArea, &QMdiArea::subWindowActivated,
+ this, &MainWindow::updateMenus);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
updateMenus();
@@ -87,20 +82,24 @@ void MainWindow::newFile()
void MainWindow::open()
{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty()) {
- QMdiSubWindow *existing = findMdiChild(fileName);
- if (existing) {
- mdiArea->setActiveSubWindow(existing);
- return;
- }
+ const QString fileName = QFileDialog::getOpenFileName(this);
+ if (!fileName.isEmpty())
+ openFile(fileName);
+}
- if (openFile(fileName))
- statusBar()->showMessage(tr("File loaded"), 2000);
+bool MainWindow::openFile(const QString &fileName)
+{
+ if (QMdiSubWindow *existing = findMdiChild(fileName)) {
+ mdiArea->setActiveSubWindow(existing);
+ return true;
}
+ const bool succeeded = loadFile(fileName);
+ if (succeeded)
+ statusBar()->showMessage(tr("File loaded"), 2000);
+ return succeeded;
}
-bool MainWindow::openFile(const QString &fileName)
+bool MainWindow::loadFile(const QString &fileName)
{
MdiChild *child = createMdiChild();
const bool succeeded = child->loadFile(fileName);
@@ -108,9 +107,87 @@ bool MainWindow::openFile(const QString &fileName)
child->show();
else
child->close();
+ MainWindow::prependToRecentFiles(fileName);
return succeeded;
}
+static inline QString recentFilesKey() { return QStringLiteral("recentFileList"); }
+static inline QString fileKey() { return QStringLiteral("file"); }
+
+static QStringList readRecentFiles(QSettings &settings)
+{
+ QStringList result;
+ const int count = settings.beginReadArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ result.append(settings.value(fileKey()).toString());
+ }
+ settings.endArray();
+ return result;
+}
+
+static void writeRecentFiles(const QStringList &files, QSettings &settings)
+{
+ const int count = files.size();
+ settings.beginWriteArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ settings.setValue(fileKey(), files.at(i));
+ }
+ settings.endArray();
+}
+
+bool MainWindow::hasRecentFiles()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const int count = settings.beginReadArray(recentFilesKey());
+ settings.endArray();
+ return count > 0;
+}
+
+void MainWindow::prependToRecentFiles(const QString &fileName)
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList oldRecentFiles = readRecentFiles(settings);
+ QStringList recentFiles = oldRecentFiles;
+ recentFiles.removeAll(fileName);
+ recentFiles.prepend(fileName);
+ if (oldRecentFiles != recentFiles)
+ writeRecentFiles(recentFiles, settings);
+
+ setRecentFilesVisible(!recentFiles.isEmpty());
+}
+
+void MainWindow::setRecentFilesVisible(bool visible)
+{
+ recentFileSubMenuAct->setVisible(visible);
+ recentFileSeparator->setVisible(visible);
+}
+
+void MainWindow::updateRecentFileActions()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList recentFiles = readRecentFiles(settings);
+ const int count = qMin(int(MaxRecentFiles), recentFiles.size());
+ int i = 0;
+ for ( ; i < count; ++i) {
+ const QString fileName = QFileInfo(recentFiles.at(i)).fileName();
+ recentFileActs[i]->setText(tr("&%1 %2").arg(i + 1).arg(fileName));
+ recentFileActs[i]->setData(recentFiles.at(i));
+ recentFileActs[i]->setVisible(true);
+ }
+ for ( ; i < MaxRecentFiles; ++i)
+ recentFileActs[i]->setVisible(false);
+}
+
+void MainWindow::openRecentFile()
+{
+ if (const QAction *action = qobject_cast<const QAction *>(sender()))
+ openFile(action->data().toString());
+}
+
void MainWindow::save()
{
if (activeMdiChild() && activeMdiChild()->save())
@@ -119,8 +196,11 @@ void MainWindow::save()
void MainWindow::saveAs()
{
- if (activeMdiChild() && activeMdiChild()->saveAs())
+ MdiChild *child = activeMdiChild();
+ if (child && child->saveAs()) {
statusBar()->showMessage(tr("File saved"), 2000);
+ MainWindow::prependToRecentFiles(child->currentFile());
+ }
}
#ifndef QT_NO_CLIPBOARD
@@ -164,7 +244,7 @@ void MainWindow::updateMenus()
cascadeAct->setEnabled(hasMdiChild);
nextAct->setEnabled(hasMdiChild);
previousAct->setEnabled(hasMdiChild);
- separatorAct->setVisible(hasMdiChild);
+ windowMenuSeparatorAct->setVisible(hasMdiChild);
#ifndef QT_NO_CLIPBOARD
bool hasSelection = (activeMdiChild() &&
@@ -174,6 +254,16 @@ void MainWindow::updateMenus()
#endif
}
+class ActiveMdiSubWindowFunctor {
+public:
+ explicit ActiveMdiSubWindowFunctor(QMdiArea *mdiArea, QMdiSubWindow *activeWindow) : m_mdiArea(mdiArea), m_activeWindow(activeWindow) {}
+ void operator()() const { m_mdiArea->setActiveSubWindow(m_activeWindow); }
+
+private:
+ QMdiArea *m_mdiArea;
+ QMdiSubWindow *m_activeWindow;
+};
+
void MainWindow::updateWindowMenu()
{
windowMenu->clear();
@@ -185,13 +275,14 @@ void MainWindow::updateWindowMenu()
windowMenu->addSeparator();
windowMenu->addAction(nextAct);
windowMenu->addAction(previousAct);
- windowMenu->addAction(separatorAct);
+ windowMenu->addAction(windowMenuSeparatorAct);
QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
- separatorAct->setVisible(!windows.isEmpty());
+ windowMenuSeparatorAct->setVisible(!windows.isEmpty());
for (int i = 0; i < windows.size(); ++i) {
- MdiChild *child = qobject_cast<MdiChild *>(windows.at(i)->widget());
+ QMdiSubWindow *mdiSubWindow = windows.at(i);
+ MdiChild *child = qobject_cast<MdiChild *>(mdiSubWindow->widget());
QString text;
if (i < 9) {
@@ -201,11 +292,9 @@ void MainWindow::updateWindowMenu()
text = tr("%1 %2").arg(i + 1)
.arg(child->userFriendlyCurrentFile());
}
- QAction *action = windowMenu->addAction(text);
+ QAction *action = windowMenu->addAction(text, mdiSubWindow, ActiveMdiSubWindowFunctor(mdiArea, mdiSubWindow));
action->setCheckable(true);
action ->setChecked(child == activeMdiChild());
- connect(action, SIGNAL(triggered()), windowMapper, SLOT(map()));
- windowMapper->setMapping(action, windows.at(i));
}
}
@@ -215,10 +304,8 @@ MdiChild *MainWindow::createMdiChild()
mdiArea->addSubWindow(child);
#ifndef QT_NO_CLIPBOARD
- connect(child, SIGNAL(copyAvailable(bool)),
- cutAct, SLOT(setEnabled(bool)));
- connect(child, SIGNAL(copyAvailable(bool)),
- copyAct, SLOT(setEnabled(bool)));
+ connect(child, &QTextEdit::copyAvailable, cutAct, &QAction::setEnabled);
+ connect(child, &QTextEdit::copyAvailable, copyAct, &QAction::setEnabled);
#endif
return child;
@@ -226,139 +313,143 @@ MdiChild *MainWindow::createMdiChild()
void MainWindow::createActions()
{
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ newAct = new QAction(newIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
+ fileMenu->addAction(newAct);
+ fileToolBar->addAction(newAct);
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
+ QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
+ fileMenu->addAction(openAct);
+ fileToolBar->addAction(openAct);
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ saveAct = new QAction(saveIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileToolBar->addAction(saveAct);
- saveAsAct = new QAction(tr("Save &As..."), this);
+ const QIcon saveAsIcon = QIcon::fromTheme("document-save-as");
+ saveAsAct = new QAction(saveAsIcon, tr("Save &As..."), this);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
+ connect(saveAsAct, &QAction::triggered, this, &MainWindow::saveAs);
+ fileMenu->addAction(saveAsAct);
+
+ fileMenu->addSeparator();
+
+ QMenu *recentMenu = fileMenu->addMenu(tr("Recent..."));
+ connect(recentMenu, &QMenu::aboutToShow, this, &MainWindow::updateRecentFileActions);
+ recentFileSubMenuAct = recentMenu->menuAction();
+
+ for (int i = 0; i < MaxRecentFiles; ++i) {
+ recentFileActs[i] = recentMenu->addAction(QString(), this, &MainWindow::openRecentFile);
+ recentFileActs[i]->setVisible(false);
+ }
+
+ recentFileSeparator = fileMenu->addSeparator();
+
+ setRecentFilesVisible(MainWindow::hasRecentFiles());
+
+ fileMenu->addAction(tr("Switch layout direction"), this, &MainWindow::switchLayoutDirection);
+
+ fileMenu->addSeparator();
//! [0]
- exitAct = new QAction(tr("E&xit"), this);
+ const QIcon exitIcon = QIcon::fromTheme("application-exit");
+ QAction *exitAct = fileMenu->addAction(exitIcon, tr("E&xit"), qApp, &QApplication::closeAllWindows);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
+ fileMenu->addAction(exitAct);
//! [0]
#ifndef QT_NO_CLIPBOARD
- cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(":/images/cut.png"));
+ cutAct = new QAction(cutIcon, tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, this, &MainWindow::cut);
+ editMenu->addAction(cutAct);
+ editToolBar->addAction(cutAct);
- copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this);
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(":/images/copy.png"));
+ copyAct = new QAction(copyIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, this, &MainWindow::copy);
+ editMenu->addAction(copyAct);
+ editToolBar->addAction(copyAct);
- pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this);
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(":/images/paste.png"));
+ pasteAct = new QAction(pasteIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, this, &MainWindow::paste);
+ editMenu->addAction(pasteAct);
+ editToolBar->addAction(pasteAct);
#endif
+ windowMenu = menuBar()->addMenu(tr("&Window"));
+ connect(windowMenu, &QMenu::aboutToShow, this, &MainWindow::updateWindowMenu);
+
closeAct = new QAction(tr("Cl&ose"), this);
closeAct->setStatusTip(tr("Close the active window"));
- connect(closeAct, SIGNAL(triggered()),
- mdiArea, SLOT(closeActiveSubWindow()));
+ connect(closeAct, &QAction::triggered,
+ mdiArea, &QMdiArea::closeActiveSubWindow);
closeAllAct = new QAction(tr("Close &All"), this);
closeAllAct->setStatusTip(tr("Close all the windows"));
- connect(closeAllAct, SIGNAL(triggered()),
- mdiArea, SLOT(closeAllSubWindows()));
+ connect(closeAllAct, &QAction::triggered, mdiArea, &QMdiArea::closeAllSubWindows);
tileAct = new QAction(tr("&Tile"), this);
tileAct->setStatusTip(tr("Tile the windows"));
- connect(tileAct, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows()));
+ connect(tileAct, &QAction::triggered, mdiArea, &QMdiArea::tileSubWindows);
cascadeAct = new QAction(tr("&Cascade"), this);
cascadeAct->setStatusTip(tr("Cascade the windows"));
- connect(cascadeAct, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows()));
+ connect(cascadeAct, &QAction::triggered, mdiArea, &QMdiArea::cascadeSubWindows);
nextAct = new QAction(tr("Ne&xt"), this);
nextAct->setShortcuts(QKeySequence::NextChild);
nextAct->setStatusTip(tr("Move the focus to the next window"));
- connect(nextAct, SIGNAL(triggered()),
- mdiArea, SLOT(activateNextSubWindow()));
+ connect(nextAct, &QAction::triggered, mdiArea, &QMdiArea::activateNextSubWindow);
previousAct = new QAction(tr("Pre&vious"), this);
previousAct->setShortcuts(QKeySequence::PreviousChild);
previousAct->setStatusTip(tr("Move the focus to the previous "
"window"));
- connect(previousAct, SIGNAL(triggered()),
- mdiArea, SLOT(activatePreviousSubWindow()));
-
- separatorAct = new QAction(this);
- separatorAct->setSeparator(true);
-
- aboutAct = new QAction(tr("&About"), this);
- aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- QAction *action = fileMenu->addAction(tr("Switch layout direction"));
- connect(action, SIGNAL(triggered()), this, SLOT(switchLayoutDirection()));
- fileMenu->addAction(exitAct);
+ connect(previousAct, &QAction::triggered, mdiArea, &QMdiArea::activatePreviousSubWindow);
- editMenu = menuBar()->addMenu(tr("&Edit"));
-#ifndef QT_NO_CLIPBOARD
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-#endif
+ windowMenuSeparatorAct = new QAction(this);
+ windowMenuSeparatorAct->setSeparator(true);
- windowMenu = menuBar()->addMenu(tr("&Window"));
updateWindowMenu();
- connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu()));
menuBar()->addSeparator();
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
-void MainWindow::createToolBars()
-{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
- fileToolBar->addAction(openAct);
- fileToolBar->addAction(saveAct);
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ aboutAct->setStatusTip(tr("Show the application's About box"));
-#ifndef QT_NO_CLIPBOARD
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(cutAct);
- editToolBar->addAction(copyAct);
- editToolBar->addAction(pasteAct);
-#endif
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
+ aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
}
void MainWindow::createStatusBar()
@@ -368,28 +459,32 @@ void MainWindow::createStatusBar()
void MainWindow::readSettings()
{
- QSettings settings("QtProject", "MDI Example");
- QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
- QSize size = settings.value("size", QSize(400, 400)).toSize();
- move(pos);
- resize(size);
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
+ move((availableGeometry.width() - width()) / 2,
+ (availableGeometry.height() - height()) / 2);
+ } else {
+ restoreGeometry(geometry);
+ }
}
void MainWindow::writeSettings()
{
- QSettings settings("QtProject", "MDI Example");
- settings.setValue("pos", pos());
- settings.setValue("size", size());
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ settings.setValue("geometry", saveGeometry());
}
-MdiChild *MainWindow::activeMdiChild()
+MdiChild *MainWindow::activeMdiChild() const
{
if (QMdiSubWindow *activeSubWindow = mdiArea->activeSubWindow())
return qobject_cast<MdiChild *>(activeSubWindow->widget());
return 0;
}
-QMdiSubWindow *MainWindow::findMdiChild(const QString &fileName)
+QMdiSubWindow *MainWindow::findMdiChild(const QString &fileName) const
{
QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath();
@@ -404,14 +499,7 @@ QMdiSubWindow *MainWindow::findMdiChild(const QString &fileName)
void MainWindow::switchLayoutDirection()
{
if (layoutDirection() == Qt::LeftToRight)
- qApp->setLayoutDirection(Qt::RightToLeft);
+ QGuiApplication::setLayoutDirection(Qt::RightToLeft);
else
- qApp->setLayoutDirection(Qt::LeftToRight);
-}
-
-void MainWindow::setActiveSubWindow(QWidget *window)
-{
- if (!window)
- return;
- mdiArea->setActiveSubWindow(qobject_cast<QMdiSubWindow *>(window));
+ QGuiApplication::setLayoutDirection(Qt::LeftToRight);
}
diff --git a/examples/widgets/mainwindows/mdi/mainwindow.h b/examples/widgets/mainwindows/mdi/mainwindow.h
index fa8e0131e9..3ac60282fd 100644
--- a/examples/widgets/mainwindows/mdi/mainwindow.h
+++ b/examples/widgets/mainwindows/mdi/mainwindow.h
@@ -49,7 +49,6 @@ class QAction;
class QMenu;
class QMdiArea;
class QMdiSubWindow;
-class QSignalMapper;
QT_END_NAMESPACE
class MainWindow : public QMainWindow
@@ -69,6 +68,8 @@ private slots:
void open();
void save();
void saveAs();
+ void updateRecentFileActions();
+ void openRecentFile();
#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
@@ -79,32 +80,30 @@ private slots:
void updateWindowMenu();
MdiChild *createMdiChild();
void switchLayoutDirection();
- void setActiveSubWindow(QWidget *window);
private:
+ enum { MaxRecentFiles = 5 };
+
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void readSettings();
void writeSettings();
- MdiChild *activeMdiChild();
- QMdiSubWindow *findMdiChild(const QString &fileName);
+ bool loadFile(const QString &fileName);
+ static bool hasRecentFiles();
+ void prependToRecentFiles(const QString &fileName);
+ void setRecentFilesVisible(bool visible);
+ MdiChild *activeMdiChild() const;
+ QMdiSubWindow *findMdiChild(const QString &fileName) const;
QMdiArea *mdiArea;
- QSignalMapper *windowMapper;
- QMenu *fileMenu;
- QMenu *editMenu;
QMenu *windowMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
QAction *newAct;
- QAction *openAct;
QAction *saveAct;
QAction *saveAsAct;
- QAction *exitAct;
+ QAction *recentFileActs[MaxRecentFiles];
+ QAction *recentFileSeparator;
+ QAction *recentFileSubMenuAct;
#ifndef QT_NO_CLIPBOARD
QAction *cutAct;
QAction *copyAct;
@@ -116,9 +115,7 @@ private:
QAction *cascadeAct;
QAction *nextAct;
QAction *previousAct;
- QAction *separatorAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
+ QAction *windowMenuSeparatorAct;
};
#endif
diff --git a/examples/widgets/mainwindows/mdi/mdichild.cpp b/examples/widgets/mainwindows/mdi/mdichild.cpp
index 242e8248a2..73364eb3ee 100644
--- a/examples/widgets/mainwindows/mdi/mdichild.cpp
+++ b/examples/widgets/mainwindows/mdi/mdichild.cpp
@@ -56,8 +56,8 @@ void MdiChild::newFile()
curFile = tr("document%1.txt").arg(sequenceNumber++);
setWindowTitle(curFile + "[*]");
- connect(document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(document(), &QTextDocument::contentsChanged,
+ this, &MdiChild::documentWasModified);
}
bool MdiChild::loadFile(const QString &fileName)
@@ -78,8 +78,8 @@ bool MdiChild::loadFile(const QString &fileName)
setCurrentFile(fileName);
- connect(document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(document(), &QTextDocument::contentsChanged,
+ this, &MdiChild::documentWasModified);
return true;
}
@@ -109,8 +109,7 @@ bool MdiChild::saveFile(const QString &fileName)
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("MDI"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return false;
}
@@ -144,18 +143,22 @@ void MdiChild::documentWasModified()
bool MdiChild::maybeSave()
{
- if (document()->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("MDI"),
- tr("'%1' has been modified.\n"
- "Do you want to save your changes?")
- .arg(userFriendlyCurrentFile()),
- QMessageBox::Save | QMessageBox::Discard
- | QMessageBox::Cancel);
- if (ret == QMessageBox::Save)
- return save();
- else if (ret == QMessageBox::Cancel)
- return false;
+ if (!document()->isModified())
+ return true;
+ const QMessageBox::StandardButton ret
+ = QMessageBox::warning(this, tr("MDI"),
+ tr("'%1' has been modified.\n"
+ "Do you want to save your changes?")
+ .arg(userFriendlyCurrentFile()),
+ QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel);
+ switch (ret) {
+ case QMessageBox::Save:
+ return save();
+ case QMessageBox::Cancel:
+ return false;
+ default:
+ break;
}
return true;
}
diff --git a/examples/widgets/mainwindows/menus/mainwindow.cpp b/examples/widgets/mainwindows/menus/mainwindow.cpp
index 31515394bd..d487e3a277 100644
--- a/examples/widgets/mainwindows/menus/mainwindow.cpp
+++ b/examples/widgets/mainwindows/menus/mainwindow.cpp
@@ -198,63 +198,63 @@ void MainWindow::createActions()
newAct = new QAction(tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
//! [4]
openAct = new QAction(tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
//! [5]
saveAct = new QAction(tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
printAct = new QAction(tr("&Print..."), this);
printAct->setShortcuts(QKeySequence::Print);
printAct->setStatusTip(tr("Print the document"));
- connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
+ connect(printAct, &QAction::triggered, this, &MainWindow::print);
exitAct = new QAction(tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+ connect(exitAct, &QAction::triggered, this, &QWidget::close);
undoAct = new QAction(tr("&Undo"), this);
undoAct->setShortcuts(QKeySequence::Undo);
undoAct->setStatusTip(tr("Undo the last operation"));
- connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));
+ connect(undoAct, &QAction::triggered, this, &MainWindow::undo);
redoAct = new QAction(tr("&Redo"), this);
redoAct->setShortcuts(QKeySequence::Redo);
redoAct->setStatusTip(tr("Redo the last operation"));
- connect(redoAct, SIGNAL(triggered()), this, SLOT(redo()));
+ connect(redoAct, &QAction::triggered, this, &MainWindow::redo);
cutAct = new QAction(tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, this, &MainWindow::cut);
copyAct = new QAction(tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), this, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, this, &MainWindow::copy);
pasteAct = new QAction(tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, this, &MainWindow::paste);
boldAct = new QAction(tr("&Bold"), this);
boldAct->setCheckable(true);
boldAct->setShortcut(QKeySequence::Bold);
boldAct->setStatusTip(tr("Make the text bold"));
- connect(boldAct, SIGNAL(triggered()), this, SLOT(bold()));
+ connect(boldAct, &QAction::triggered, this, &MainWindow::bold);
QFont boldFont = boldAct->font();
boldFont.setBold(true);
@@ -264,7 +264,7 @@ void MainWindow::createActions()
italicAct->setCheckable(true);
italicAct->setShortcut(QKeySequence::Italic);
italicAct->setStatusTip(tr("Make the text italic"));
- connect(italicAct, SIGNAL(triggered()), this, SLOT(italic()));
+ connect(italicAct, &QAction::triggered, this, &MainWindow::italic);
QFont italicFont = italicAct->font();
italicFont.setItalic(true);
@@ -273,45 +273,45 @@ void MainWindow::createActions()
setLineSpacingAct = new QAction(tr("Set &Line Spacing..."), this);
setLineSpacingAct->setStatusTip(tr("Change the gap between the lines of a "
"paragraph"));
- connect(setLineSpacingAct, SIGNAL(triggered()), this, SLOT(setLineSpacing()));
+ connect(setLineSpacingAct, &QAction::triggered, this, &MainWindow::setLineSpacing);
setParagraphSpacingAct = new QAction(tr("Set &Paragraph Spacing..."), this);
setParagraphSpacingAct->setStatusTip(tr("Change the gap between paragraphs"));
- connect(setParagraphSpacingAct, SIGNAL(triggered()),
- this, SLOT(setParagraphSpacing()));
+ connect(setParagraphSpacingAct, &QAction::triggered,
+ this, &MainWindow::setParagraphSpacing);
aboutAct = new QAction(tr("&About"), this);
aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ connect(aboutAct, &QAction::triggered, this, &MainWindow::about);
aboutQtAct = new QAction(tr("About &Qt"), this);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
- connect(aboutQtAct, SIGNAL(triggered()), this, SLOT(aboutQt()));
+ connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
+ connect(aboutQtAct, &QAction::triggered, this, &MainWindow::aboutQt);
leftAlignAct = new QAction(tr("&Left Align"), this);
leftAlignAct->setCheckable(true);
leftAlignAct->setShortcut(tr("Ctrl+L"));
leftAlignAct->setStatusTip(tr("Left align the selected text"));
- connect(leftAlignAct, SIGNAL(triggered()), this, SLOT(leftAlign()));
+ connect(leftAlignAct, &QAction::triggered, this, &MainWindow::leftAlign);
rightAlignAct = new QAction(tr("&Right Align"), this);
rightAlignAct->setCheckable(true);
rightAlignAct->setShortcut(tr("Ctrl+R"));
rightAlignAct->setStatusTip(tr("Right align the selected text"));
- connect(rightAlignAct, SIGNAL(triggered()), this, SLOT(rightAlign()));
+ connect(rightAlignAct, &QAction::triggered, this, &MainWindow::rightAlign);
justifyAct = new QAction(tr("&Justify"), this);
justifyAct->setCheckable(true);
justifyAct->setShortcut(tr("Ctrl+J"));
justifyAct->setStatusTip(tr("Justify the selected text"));
- connect(justifyAct, SIGNAL(triggered()), this, SLOT(justify()));
+ connect(justifyAct, &QAction::triggered, this, &MainWindow::justify);
centerAct = new QAction(tr("&Center"), this);
centerAct->setCheckable(true);
centerAct->setShortcut(tr("Ctrl+E"));
centerAct->setStatusTip(tr("Center the selected text"));
- connect(centerAct, SIGNAL(triggered()), this, SLOT(center()));
+ connect(centerAct, &QAction::triggered, this, &MainWindow::center);
//! [6] //! [7]
alignmentGroup = new QActionGroup(this);
diff --git a/examples/widgets/mainwindows/recentfiles/main.cpp b/examples/widgets/mainwindows/recentfiles/main.cpp
deleted file mode 100644
index 23ff3eda16..0000000000
--- a/examples/widgets/mainwindows/recentfiles/main.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "mainwindow.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- app.setOrganizationName("QtProject");
- app.setApplicationName("Recent Files Example");
- MainWindow *mainWin = new MainWindow;
- mainWin->show();
- return app.exec();
-}
diff --git a/examples/widgets/mainwindows/recentfiles/mainwindow.cpp b/examples/widgets/mainwindows/recentfiles/mainwindow.cpp
deleted file mode 100644
index b89797092a..0000000000
--- a/examples/widgets/mainwindows/recentfiles/mainwindow.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtWidgets>
-
-#include "mainwindow.h"
-
-MainWindow::MainWindow()
-{
- setAttribute(Qt::WA_DeleteOnClose);
-
- textEdit = new QTextEdit;
- setCentralWidget(textEdit);
-
- createActions();
- createMenus();
- (void)statusBar();
-
- setWindowFilePath(QString());
- resize(400, 300);
-}
-
-void MainWindow::newFile()
-{
- MainWindow *other = new MainWindow;
- other->show();
-}
-
-void MainWindow::open()
-{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty())
- loadFile(fileName);
-}
-
-void MainWindow::save()
-{
- if (curFile.isEmpty())
- saveAs();
- else
- saveFile(curFile);
-}
-
-void MainWindow::saveAs()
-{
- QString fileName = QFileDialog::getSaveFileName(this);
- if (fileName.isEmpty())
- return;
-
- saveFile(fileName);
-}
-
-void MainWindow::openRecentFile()
-{
- QAction *action = qobject_cast<QAction *>(sender());
- if (action)
- loadFile(action->data().toString());
-}
-
-void MainWindow::about()
-{
- QMessageBox::about(this, tr("About Recent Files"),
- tr("The <b>Recent Files</b> example demonstrates how to provide a "
- "recently used file menu in a Qt application."));
-}
-
-void MainWindow::createActions()
-{
- newAct = new QAction(tr("&New"), this);
- newAct->setShortcuts(QKeySequence::New);
- newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
-
- openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcuts(QKeySequence::Open);
- openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
- saveAct = new QAction(tr("&Save"), this);
- saveAct->setShortcuts(QKeySequence::Save);
- saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
-
- saveAsAct = new QAction(tr("Save &As..."), this);
- saveAsAct->setShortcuts(QKeySequence::SaveAs);
- saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
-
- for (int i = 0; i < MaxRecentFiles; ++i) {
- recentFileActs[i] = new QAction(this);
- recentFileActs[i]->setVisible(false);
- connect(recentFileActs[i], SIGNAL(triggered()),
- this, SLOT(openRecentFile()));
- }
-
- exitAct = new QAction(tr("E&xit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
-
- aboutAct = new QAction(tr("&About"), this);
- aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- separatorAct = fileMenu->addSeparator();
- for (int i = 0; i < MaxRecentFiles; ++i)
- fileMenu->addAction(recentFileActs[i]);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
- updateRecentFileActions();
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-
-void MainWindow::loadFile(const QString &fileName)
-{
- QFile file(fileName);
- if (!file.open(QFile::ReadOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("Recent Files"),
- tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
- return;
- }
-
- QTextStream in(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
- textEdit->setPlainText(in.readAll());
- QApplication::restoreOverrideCursor();
-
- setCurrentFile(fileName);
- statusBar()->showMessage(tr("File loaded"), 2000);
-}
-
-void MainWindow::saveFile(const QString &fileName)
-{
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("Recent Files"),
- tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
- return;
- }
-
- QTextStream out(&file);
- QApplication::setOverrideCursor(Qt::WaitCursor);
- out << textEdit->toPlainText();
- QApplication::restoreOverrideCursor();
-
- setCurrentFile(fileName);
- statusBar()->showMessage(tr("File saved"), 2000);
-}
-
-void MainWindow::setCurrentFile(const QString &fileName)
-{
- curFile = fileName;
- setWindowFilePath(curFile);
-
- QSettings settings;
- QStringList files = settings.value("recentFileList").toStringList();
- files.removeAll(fileName);
- files.prepend(fileName);
- while (files.size() > MaxRecentFiles)
- files.removeLast();
-
- settings.setValue("recentFileList", files);
-
- foreach (QWidget *widget, QApplication::topLevelWidgets()) {
- MainWindow *mainWin = qobject_cast<MainWindow *>(widget);
- if (mainWin)
- mainWin->updateRecentFileActions();
- }
-}
-
-void MainWindow::updateRecentFileActions()
-{
- QSettings settings;
- QStringList files = settings.value("recentFileList").toStringList();
-
- int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
-
- for (int i = 0; i < numRecentFiles; ++i) {
- QString text = tr("&%1 %2").arg(i + 1).arg(strippedName(files[i]));
- recentFileActs[i]->setText(text);
- recentFileActs[i]->setData(files[i]);
- recentFileActs[i]->setVisible(true);
- }
- for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
- recentFileActs[j]->setVisible(false);
-
- separatorAct->setVisible(numRecentFiles > 0);
-}
-
-QString MainWindow::strippedName(const QString &fullFileName)
-{
- return QFileInfo(fullFileName).fileName();
-}
diff --git a/examples/widgets/mainwindows/recentfiles/mainwindow.h b/examples/widgets/mainwindows/recentfiles/mainwindow.h
deleted file mode 100644
index 95252ca525..0000000000
--- a/examples/widgets/mainwindows/recentfiles/mainwindow.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QList>
-#include <QMainWindow>
-
-QT_BEGIN_NAMESPACE
-class QAction;
-class QMenu;
-class QTextEdit;
-QT_END_NAMESPACE
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainWindow();
-
-private slots:
- void newFile();
- void open();
- void save();
- void saveAs();
- void openRecentFile();
- void about();
-
-private:
- void createActions();
- void createMenus();
- void loadFile(const QString &fileName);
- void saveFile(const QString &fileName);
- void setCurrentFile(const QString &fileName);
- void updateRecentFileActions();
- QString strippedName(const QString &fullFileName);
-
- QString curFile;
-
- QTextEdit *textEdit;
- QMenu *fileMenu;
- QMenu *recentFilesMenu;
- QMenu *helpMenu;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *exitAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
- QAction *separatorAct;
-
- enum { MaxRecentFiles = 5 };
- QAction *recentFileActs[MaxRecentFiles];
-};
-
-#endif
diff --git a/examples/widgets/mainwindows/recentfiles/recentfiles.pro b/examples/widgets/mainwindows/recentfiles/recentfiles.pro
deleted file mode 100644
index ccf948f560..0000000000
--- a/examples/widgets/mainwindows/recentfiles/recentfiles.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-QT += widgets
-
-HEADERS = mainwindow.h
-SOURCES = main.cpp \
- mainwindow.cpp
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/recentfiles
-INSTALLS += target
diff --git a/examples/widgets/mainwindows/sdi/main.cpp b/examples/widgets/mainwindows/sdi/main.cpp
index d3350da946..4b125722d8 100644
--- a/examples/widgets/mainwindows/sdi/main.cpp
+++ b/examples/widgets/mainwindows/sdi/main.cpp
@@ -39,6 +39,7 @@
****************************************************************************/
#include <QApplication>
+#include <QCommandLineParser>
#include "mainwindow.h"
@@ -46,9 +47,27 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(sdi);
QApplication app(argc, argv);
- app.setApplicationName("SDI Example");
- app.setOrganizationName("QtProject");
- MainWindow *mainWin = new MainWindow;
+ QCoreApplication::setApplicationName("SDI Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file(s) to open.");
+ parser.process(app);
+
+ MainWindow *mainWin = Q_NULLPTR;
+ foreach (const QString &file, parser.positionalArguments()) {
+ MainWindow *newWin = new MainWindow(file);
+ newWin->tile(mainWin);
+ newWin->show();
+ mainWin = newWin;
+ }
+
+ if (!mainWin)
+ mainWin = new MainWindow;
mainWin->show();
+
return app.exec();
}
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.cpp b/examples/widgets/mainwindows/sdi/mainwindow.cpp
index 1d6226e45c..f59172f172 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/sdi/mainwindow.cpp
@@ -45,7 +45,7 @@
MainWindow::MainWindow()
{
init();
- setCurrentFile("");
+ setCurrentFile(QString());
}
MainWindow::MainWindow(const QString &fileName)
@@ -67,44 +67,44 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::newFile()
{
MainWindow *other = new MainWindow;
- other->move(x() + 40, y() + 40);
+ other->tile(this);
other->show();
}
void MainWindow::open()
{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty()) {
- MainWindow *existing = findMainWindow(fileName);
- if (existing) {
- existing->show();
- existing->raise();
- existing->activateWindow();
- return;
- }
-
- if (isUntitled && textEdit->document()->isEmpty()
- && !isWindowModified()) {
- loadFile(fileName);
- } else {
- MainWindow *other = new MainWindow(fileName);
- if (other->isUntitled) {
- delete other;
- return;
- }
- other->move(x() + 40, y() + 40);
- other->show();
- }
+ const QString fileName = QFileDialog::getOpenFileName(this);
+ if (!fileName.isEmpty())
+ openFile(fileName);
+}
+
+void MainWindow::openFile(const QString &fileName)
+{
+ MainWindow *existing = findMainWindow(fileName);
+ if (existing) {
+ existing->show();
+ existing->raise();
+ existing->activateWindow();
+ return;
+ }
+
+ if (isUntitled && textEdit->document()->isEmpty() && !isWindowModified()) {
+ loadFile(fileName);
+ return;
}
+
+ MainWindow *other = new MainWindow(fileName);
+ if (other->isUntitled) {
+ delete other;
+ return;
+ }
+ other->tile(this);
+ other->show();
}
bool MainWindow::save()
{
- if (isUntitled) {
- return saveAs();
- } else {
- return saveFile(curFile);
- }
+ return isUntitled ? saveAs() : saveFile(curFile);
}
bool MainWindow::saveAs()
@@ -139,123 +139,135 @@ void MainWindow::init()
setCentralWidget(textEdit);
createActions();
- createMenus();
- createToolBars();
createStatusBar();
readSettings();
- connect(textEdit->document(), SIGNAL(contentsChanged()),
- this, SLOT(documentWasModified()));
+ connect(textEdit->document(), &QTextDocument::contentsChanged,
+ this, &MainWindow::documentWasModified);
setUnifiedTitleAndToolBarOnMac(true);
}
+void MainWindow::tile(const QMainWindow *previous)
+{
+ if (!previous)
+ return;
+ int topFrameWidth = previous->geometry().top() - previous->pos().y();
+ if (!topFrameWidth)
+ topFrameWidth = 40;
+ const QPoint pos = previous->pos() + 2 * QPoint(topFrameWidth, topFrameWidth);
+ if (QApplication::desktop()->availableGeometry(this).contains(rect().bottomRight() + pos))
+ move(pos);
+}
+
+//! [implicit tr context]
void MainWindow::createActions()
{
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+//! [implicit tr context]
+ QToolBar *fileToolBar = addToolBar(tr("File"));
+
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(":/images/new.png"));
+ QAction *newAct = new QAction(newIcon, tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+ connect(newAct, &QAction::triggered, this, &MainWindow::newFile);
+ fileMenu->addAction(newAct);
+ fileToolBar->addAction(newAct);
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
+ QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(openAct, &QAction::triggered, this, &MainWindow::open);
+ fileMenu->addAction(openAct);
+ fileToolBar->addAction(openAct);
- saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
+ QAction *saveAct = new QAction(saveIcon, tr("&Save"), this);
saveAct->setShortcuts(QKeySequence::Save);
saveAct->setStatusTip(tr("Save the document to disk"));
- connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+ connect(saveAct, &QAction::triggered, this, &MainWindow::save);
+ fileMenu->addAction(saveAct);
+ fileToolBar->addAction(saveAct);
- saveAsAct = new QAction(tr("Save &As..."), this);
+ const QIcon saveAsIcon = QIcon::fromTheme("document-save-as");
+ QAction *saveAsAct = fileMenu->addAction(saveAsIcon, tr("Save &As..."), this, &MainWindow::saveAs);
saveAsAct->setShortcuts(QKeySequence::SaveAs);
saveAsAct->setStatusTip(tr("Save the document under a new name"));
- connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
- closeAct = new QAction(tr("&Close"), this);
+ fileMenu->addSeparator();
+
+ QMenu *recentMenu = fileMenu->addMenu(tr("Recent..."));
+ connect(recentMenu, &QMenu::aboutToShow, this, &MainWindow::updateRecentFileActions);
+ recentFileSubMenuAct = recentMenu->menuAction();
+
+ for (int i = 0; i < MaxRecentFiles; ++i) {
+ recentFileActs[i] = recentMenu->addAction(QString(), this, &MainWindow::openRecentFile);
+ recentFileActs[i]->setVisible(false);
+ }
+
+ recentFileSeparator = fileMenu->addSeparator();
+
+ setRecentFilesVisible(MainWindow::hasRecentFiles());
+
+ QAction *closeAct = fileMenu->addAction(tr("&Close"), this, &QWidget::close);
closeAct->setShortcut(tr("Ctrl+W"));
closeAct->setStatusTip(tr("Close this window"));
- connect(closeAct, SIGNAL(triggered()), this, SLOT(close()));
- exitAct = new QAction(tr("E&xit"), this);
+ const QIcon exitIcon = QIcon::fromTheme("application-exit");
+ QAction *exitAct = fileMenu->addAction(exitIcon, tr("E&xit"), qApp, &QApplication::closeAllWindows);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
- connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
- cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+ QToolBar *editToolBar = addToolBar(tr("Edit"));
+
+#ifndef QT_NO_CLIPBOARD
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(":/images/cut.png"));
+ QAction *cutAct = new QAction(cutIcon, tr("Cu&t"), this);
cutAct->setShortcuts(QKeySequence::Cut);
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
- connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut()));
+ connect(cutAct, &QAction::triggered, textEdit, &QTextEdit::cut);
+ editMenu->addAction(cutAct);
+ editToolBar->addAction(cutAct);
- copyAct = new QAction(QIcon(":/images/copy.png"), tr("&Copy"), this);
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(":/images/copy.png"));
+ QAction *copyAct = new QAction(copyIcon, tr("&Copy"), this);
copyAct->setShortcuts(QKeySequence::Copy);
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
- connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy()));
+ connect(copyAct, &QAction::triggered, textEdit, &QTextEdit::copy);
+ editMenu->addAction(copyAct);
+ editToolBar->addAction(copyAct);
- pasteAct = new QAction(QIcon(":/images/paste.png"), tr("&Paste"), this);
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(":/images/paste.png"));
+ QAction *pasteAct = new QAction(pasteIcon, tr("&Paste"), this);
pasteAct->setShortcuts(QKeySequence::Paste);
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
- connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste()));
+ connect(pasteAct, &QAction::triggered, textEdit, &QTextEdit::paste);
+ editMenu->addAction(pasteAct);
+ editToolBar->addAction(pasteAct);
+
+ menuBar()->addSeparator();
+#endif // !QT_NO_CLIPBOARD
- aboutAct = new QAction(tr("&About"), this);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ QAction *aboutAct = helpMenu->addAction(tr("&About"), this, &MainWindow::about);
aboutAct->setStatusTip(tr("Show the application's About box"));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
- aboutQtAct = new QAction(tr("About &Qt"), this);
+ QAction *aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
+#ifndef QT_NO_CLIPBOARD
cutAct->setEnabled(false);
copyAct->setEnabled(false);
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- cutAct, SLOT(setEnabled(bool)));
- connect(textEdit, SIGNAL(copyAvailable(bool)),
- copyAct, SLOT(setEnabled(bool)));
-}
-
-//! [implicit tr context]
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
-//! [implicit tr context]
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- fileMenu->addAction(closeAct);
- fileMenu->addAction(exitAct);
-
- editMenu = menuBar()->addMenu(tr("&Edit"));
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-
-void MainWindow::createToolBars()
-{
-//! [0]
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
- fileToolBar->addAction(openAct);
-//! [0]
- fileToolBar->addAction(saveAct);
-
- editToolBar = addToolBar(tr("Edit"));
- editToolBar->addAction(cutAct);
- editToolBar->addAction(copyAct);
- editToolBar->addAction(pasteAct);
+ connect(textEdit, &QTextEdit::copyAvailable, cutAct, &QAction::setEnabled);
+ connect(textEdit, &QTextEdit::copyAvailable, copyAct, &QAction::setEnabled);
+#endif // !QT_NO_CLIPBOARD
}
void MainWindow::createStatusBar()
@@ -265,33 +277,41 @@ void MainWindow::createStatusBar()
void MainWindow::readSettings()
{
- QSettings settings;
- QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
- QSize size = settings.value("size", QSize(400, 400)).toSize();
- move(pos);
- resize(size);
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
+ if (geometry.isEmpty()) {
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
+ move((availableGeometry.width() - width()) / 2,
+ (availableGeometry.height() - height()) / 2);
+ } else {
+ restoreGeometry(geometry);
+ }
}
void MainWindow::writeSettings()
{
- QSettings settings;
- settings.setValue("pos", pos());
- settings.setValue("size", size());
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ settings.setValue("geometry", saveGeometry());
}
bool MainWindow::maybeSave()
{
- if (textEdit->document()->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("SDI"),
- tr("The document has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard
- | QMessageBox::Cancel);
- if (ret == QMessageBox::Save)
- return save();
- else if (ret == QMessageBox::Cancel)
- return false;
+ if (!textEdit->document()->isModified())
+ return true;
+ const QMessageBox::StandardButton ret
+ = QMessageBox::warning(this, tr("SDI"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel);
+ switch (ret) {
+ case QMessageBox::Save:
+ return save();
+ case QMessageBox::Cancel:
+ return false;
+ default:
+ break;
}
return true;
}
@@ -303,8 +323,7 @@ void MainWindow::loadFile(const QString &fileName)
if (!file.open(QFile::ReadOnly | QFile::Text)) {
QMessageBox::warning(this, tr("SDI"),
tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return;
}
@@ -317,14 +336,90 @@ void MainWindow::loadFile(const QString &fileName)
statusBar()->showMessage(tr("File loaded"), 2000);
}
+void MainWindow::setRecentFilesVisible(bool visible)
+{
+ recentFileSubMenuAct->setVisible(visible);
+ recentFileSeparator->setVisible(visible);
+}
+
+static inline QString recentFilesKey() { return QStringLiteral("recentFileList"); }
+static inline QString fileKey() { return QStringLiteral("file"); }
+
+static QStringList readRecentFiles(QSettings &settings)
+{
+ QStringList result;
+ const int count = settings.beginReadArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ result.append(settings.value(fileKey()).toString());
+ }
+ settings.endArray();
+ return result;
+}
+
+static void writeRecentFiles(const QStringList &files, QSettings &settings)
+{
+ const int count = files.size();
+ settings.beginWriteArray(recentFilesKey());
+ for (int i = 0; i < count; ++i) {
+ settings.setArrayIndex(i);
+ settings.setValue(fileKey(), files.at(i));
+ }
+ settings.endArray();
+}
+
+bool MainWindow::hasRecentFiles()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+ const int count = settings.beginReadArray(recentFilesKey());
+ settings.endArray();
+ return count > 0;
+}
+
+void MainWindow::prependToRecentFiles(const QString &fileName)
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList oldRecentFiles = readRecentFiles(settings);
+ QStringList recentFiles = oldRecentFiles;
+ recentFiles.removeAll(fileName);
+ recentFiles.prepend(fileName);
+ if (oldRecentFiles != recentFiles)
+ writeRecentFiles(recentFiles, settings);
+
+ setRecentFilesVisible(!recentFiles.isEmpty());
+}
+
+void MainWindow::updateRecentFileActions()
+{
+ QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
+
+ const QStringList recentFiles = readRecentFiles(settings);
+ const int count = qMin(int(MaxRecentFiles), recentFiles.size());
+ int i = 0;
+ for ( ; i < count; ++i) {
+ const QString fileName = MainWindow::strippedName(recentFiles.at(i));
+ recentFileActs[i]->setText(tr("&%1 %2").arg(i + 1).arg(fileName));
+ recentFileActs[i]->setData(recentFiles.at(i));
+ recentFileActs[i]->setVisible(true);
+ }
+ for ( ; i < MaxRecentFiles; ++i)
+ recentFileActs[i]->setVisible(false);
+}
+
+void MainWindow::openRecentFile()
+{
+ if (const QAction *action = qobject_cast<const QAction *>(sender()))
+ openFile(action->data().toString());
+}
+
bool MainWindow::saveFile(const QString &fileName)
{
QFile file(fileName);
if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("SDI"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .arg(QDir::toNativeSeparators(fileName), file.errorString()));
return false;
}
@@ -351,6 +446,10 @@ void MainWindow::setCurrentFile(const QString &fileName)
textEdit->document()->setModified(false);
setWindowModified(false);
+
+ if (!isUntitled && windowFilePath() != curFile)
+ MainWindow::prependToRecentFiles(curFile);
+
setWindowFilePath(curFile);
}
@@ -359,14 +458,15 @@ QString MainWindow::strippedName(const QString &fullFileName)
return QFileInfo(fullFileName).fileName();
}
-MainWindow *MainWindow::findMainWindow(const QString &fileName)
+MainWindow *MainWindow::findMainWindow(const QString &fileName) const
{
QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath();
- foreach (QWidget *widget, qApp->topLevelWidgets()) {
+ foreach (QWidget *widget, QApplication::topLevelWidgets()) {
MainWindow *mainWin = qobject_cast<MainWindow *>(widget);
if (mainWin && mainWin->curFile == canonicalFilePath)
return mainWin;
}
+
return 0;
}
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.h b/examples/widgets/mainwindows/sdi/mainwindow.h
index f1860a8511..66ac618c72 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.h
+++ b/examples/widgets/mainwindows/sdi/mainwindow.h
@@ -42,6 +42,7 @@
#define MAINWINDOW_H
#include <QMainWindow>
+#include <QList>
QT_BEGIN_NAMESPACE
class QAction;
@@ -57,7 +58,9 @@ class MainWindow : public QMainWindow
public:
MainWindow();
//! [class definition with macro]
- MainWindow(const QString &fileName);
+ explicit MainWindow(const QString &fileName);
+
+ void tile(const QMainWindow *previous);
protected:
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
@@ -67,44 +70,38 @@ private slots:
void open();
bool save();
bool saveAs();
+ void updateRecentFileActions();
+ void openRecentFile();
void about();
void documentWasModified();
private:
+ enum { MaxRecentFiles = 5 };
+
void init();
void createActions();
- void createMenus();
- void createToolBars();
void createStatusBar();
void readSettings();
void writeSettings();
bool maybeSave();
+ void openFile(const QString &fileName);
void loadFile(const QString &fileName);
+ static bool hasRecentFiles();
+ void prependToRecentFiles(const QString &fileName);
+ void setRecentFilesVisible(bool visible);
bool saveFile(const QString &fileName);
void setCurrentFile(const QString &fileName);
- QString strippedName(const QString &fullFileName);
- MainWindow *findMainWindow(const QString &fileName);
+ static QString strippedName(const QString &fullFileName);
+ MainWindow *findMainWindow(const QString &fileName) const;
QTextEdit *textEdit;
+
+ QAction *recentFileActs[MaxRecentFiles];
+ QAction *recentFileSeparator;
+ QAction *recentFileSubMenuAct;
+
QString curFile;
bool isUntitled;
-
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *closeAct;
- QAction *exitAct;
- QAction *cutAct;
- QAction *copyAct;
- QAction *pasteAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
#endif
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp
index bff8ae9c22..53a2aac82e 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.cpp
+++ b/examples/widgets/painting/fontsampler/mainwindow.cpp
@@ -80,7 +80,7 @@ void MainWindow::setupFontTree()
QTreeWidgetItem *familyItem = new QTreeWidgetItem(fontTree);
familyItem->setText(0, family);
familyItem->setCheckState(0, Qt::Unchecked);
- familyItem->setFlags(familyItem->flags() | Qt::ItemIsTristate);
+ familyItem->setFlags(familyItem->flags() | Qt::ItemIsAutoTristate);
foreach (QString style, styles) {
QTreeWidgetItem *styleItem = new QTreeWidgetItem(familyItem);
diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp
index d246336c5d..f03c05881d 100644
--- a/examples/widgets/painting/shared/arthurstyle.cpp
+++ b/examples/widgets/painting/shared/arthurstyle.cpp
@@ -156,8 +156,8 @@ void ArthurStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op
break;
case PE_FrameGroupBox:
- if (const QStyleOptionFrameV2 *group
- = qstyleoption_cast<const QStyleOptionFrameV2 *>(option)) {
+ if (const QStyleOptionFrame *group
+ = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
const QRect &r = group->rect;
painter->save();
diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 19f471b5cf..93cd950b0b 100644
--- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince {
addFiles.files = main.cpp mainwindow.cpp
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/richtext/textedit/main.cpp b/examples/widgets/richtext/textedit/main.cpp
index 4dda7e6c75..1de6d994e6 100644
--- a/examples/widgets/richtext/textedit/main.cpp
+++ b/examples/widgets/richtext/textedit/main.cpp
@@ -32,15 +32,37 @@
****************************************************************************/
#include "textedit.h"
+
#include <QApplication>
+#include <QDesktopWidget>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(textedit);
QApplication a(argc, argv);
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationName("Rich Text");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument("file", "The file to open.");
+ parser.process(a);
+
TextEdit mw;
- mw.resize(700, 800);
+
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mw);
+ mw.resize(availableGeometry.width() / 2, (availableGeometry.height() * 2) / 3);
+ mw.move((availableGeometry.width() - mw.width()) / 2,
+ (availableGeometry.height() - mw.height()) / 2);
+
+ if (!mw.load(parser.positionalArguments().value(0, QLatin1String(":/example.html"))))
+ mw.fileNew();
+
mw.show();
return a.exec();
}
diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp
index 6af436ba46..be46c4d008 100644
--- a/examples/widgets/richtext/textedit/textedit.cpp
+++ b/examples/widgets/richtext/textedit/textedit.cpp
@@ -45,6 +45,7 @@
#include <QMenuBar>
#include <QTextCodec>
#include <QTextEdit>
+#include <QStatusBar>
#include <QToolBar>
#include <QTextCursor>
#include <QTextDocumentWriter>
@@ -73,6 +74,14 @@ TextEdit::TextEdit(QWidget *parent)
#ifdef Q_OS_OSX
setUnifiedTitleAndToolBarOnMac(true);
#endif
+ setWindowTitle(QCoreApplication::applicationName());
+
+ textEdit = new QTextEdit(this);
+ connect(textEdit, &QTextEdit::currentCharFormatChanged,
+ this, &TextEdit::currentCharFormatChanged);
+ connect(textEdit, &QTextEdit::cursorPositionChanged,
+ this, &TextEdit::cursorPositionChanged);
+ setCentralWidget(textEdit);
setToolButtonStyle(Qt::ToolButtonFollowStyle);
setupFileActions();
@@ -80,22 +89,11 @@ TextEdit::TextEdit(QWidget *parent)
setupTextActions();
{
- QMenu *helpMenu = new QMenu(tr("Help"), this);
- menuBar()->addMenu(helpMenu);
- helpMenu->addAction(tr("About"), this, SLOT(about()));
- helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
+ QMenu *helpMenu = menuBar()->addMenu(tr("Help"));
+ helpMenu->addAction(tr("About"), this, &TextEdit::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
- textEdit = new QTextEdit(this);
- connect(textEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)),
- this, SLOT(currentCharFormatChanged(QTextCharFormat)));
- connect(textEdit, SIGNAL(cursorPositionChanged()),
- this, SLOT(cursorPositionChanged()));
-
- setCentralWidget(textEdit);
- textEdit->setFocus();
- setCurrentFileName(QString());
-
QFont textFont("Helvetica");
textFont.setStyleHint(QFont::SansSerif);
textEdit->setFont(textFont);
@@ -103,44 +101,29 @@ TextEdit::TextEdit(QWidget *parent)
colorChanged(textEdit->textColor());
alignmentChanged(textEdit->alignment());
- connect(textEdit->document(), SIGNAL(modificationChanged(bool)),
- actionSave, SLOT(setEnabled(bool)));
- connect(textEdit->document(), SIGNAL(modificationChanged(bool)),
- this, SLOT(setWindowModified(bool)));
- connect(textEdit->document(), SIGNAL(undoAvailable(bool)),
- actionUndo, SLOT(setEnabled(bool)));
- connect(textEdit->document(), SIGNAL(redoAvailable(bool)),
- actionRedo, SLOT(setEnabled(bool)));
+ connect(textEdit->document(), &QTextDocument::modificationChanged,
+ actionSave, &QAction::setEnabled);
+ connect(textEdit->document(), &QTextDocument::modificationChanged,
+ this, &QWidget::setWindowModified);
+ connect(textEdit->document(), &QTextDocument::undoAvailable,
+ actionUndo, &QAction::setEnabled);
+ connect(textEdit->document(), &QTextDocument::redoAvailable,
+ actionRedo, &QAction::setEnabled);
setWindowModified(textEdit->document()->isModified());
actionSave->setEnabled(textEdit->document()->isModified());
actionUndo->setEnabled(textEdit->document()->isUndoAvailable());
actionRedo->setEnabled(textEdit->document()->isRedoAvailable());
- connect(actionUndo, SIGNAL(triggered()), textEdit, SLOT(undo()));
- connect(actionRedo, SIGNAL(triggered()), textEdit, SLOT(redo()));
-
+#ifndef QT_NO_CLIPBOARD
actionCut->setEnabled(false);
actionCopy->setEnabled(false);
- connect(actionCut, SIGNAL(triggered()), textEdit, SLOT(cut()));
- connect(actionCopy, SIGNAL(triggered()), textEdit, SLOT(copy()));
- connect(actionPaste, SIGNAL(triggered()), textEdit, SLOT(paste()));
-
- connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
- connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
-
-#ifndef QT_NO_CLIPBOARD
- connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
+ connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &TextEdit::clipboardDataChanged);
#endif
- QString initialFile = ":/example.html";
- const QStringList args = QCoreApplication::arguments();
- if (args.count() == 2)
- initialFile = args.at(1);
-
- if (!load(initialFile))
- fileNew();
+ textEdit->setFocus();
+ setCurrentFileName(QString());
}
void TextEdit::closeEvent(QCloseEvent *e)
@@ -153,117 +136,90 @@ void TextEdit::closeEvent(QCloseEvent *e)
void TextEdit::setupFileActions()
{
- QToolBar *tb = new QToolBar(this);
- tb->setWindowTitle(tr("File Actions"));
- addToolBar(tb);
-
- QMenu *menu = new QMenu(tr("&File"), this);
- menuBar()->addMenu(menu);
+ QToolBar *tb = addToolBar(tr("File Actions"));
+ QMenu *menu = menuBar()->addMenu(tr("&File"));
- QAction *a;
-
- QIcon newIcon = QIcon::fromTheme("document-new", QIcon(rsrcPath + "/filenew.png"));
- a = new QAction( newIcon, tr("&New"), this);
+ const QIcon newIcon = QIcon::fromTheme("document-new", QIcon(rsrcPath + "/filenew.png"));
+ QAction *a = menu->addAction(newIcon, tr("&New"), this, &TextEdit::fileNew);
+ tb->addAction(a);
a->setPriority(QAction::LowPriority);
a->setShortcut(QKeySequence::New);
- connect(a, SIGNAL(triggered()), this, SLOT(fileNew()));
- tb->addAction(a);
- menu->addAction(a);
- a = new QAction(QIcon::fromTheme("document-open", QIcon(rsrcPath + "/fileopen.png")),
- tr("&Open..."), this);
+ const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(rsrcPath + "/fileopen.png"));
+ a = menu->addAction(openIcon, tr("&Open..."), this, &TextEdit::fileOpen);
a->setShortcut(QKeySequence::Open);
- connect(a, SIGNAL(triggered()), this, SLOT(fileOpen()));
tb->addAction(a);
- menu->addAction(a);
menu->addSeparator();
- actionSave = a = new QAction(QIcon::fromTheme("document-save", QIcon(rsrcPath + "/filesave.png")),
- tr("&Save"), this);
- a->setShortcut(QKeySequence::Save);
- connect(a, SIGNAL(triggered()), this, SLOT(fileSave()));
- a->setEnabled(false);
- tb->addAction(a);
- menu->addAction(a);
+ const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(rsrcPath + "/filesave.png"));
+ actionSave = menu->addAction(saveIcon, tr("&Save"), this, &TextEdit::fileSave);
+ actionSave->setShortcut(QKeySequence::Save);
+ actionSave->setEnabled(false);
+ tb->addAction(actionSave);
- a = new QAction(tr("Save &As..."), this);
+ a = menu->addAction(tr("Save &As..."), this, &TextEdit::fileSaveAs);
a->setPriority(QAction::LowPriority);
- connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
- menu->addAction(a);
menu->addSeparator();
#ifndef QT_NO_PRINTER
- a = new QAction(QIcon::fromTheme("document-print", QIcon(rsrcPath + "/fileprint.png")),
- tr("&Print..."), this);
+ const QIcon printIcon = QIcon::fromTheme("document-print", QIcon(rsrcPath + "/fileprint.png"));
+ a = menu->addAction(printIcon, tr("&Print..."), this, &TextEdit::filePrint);
a->setPriority(QAction::LowPriority);
a->setShortcut(QKeySequence::Print);
- connect(a, SIGNAL(triggered()), this, SLOT(filePrint()));
tb->addAction(a);
- menu->addAction(a);
- a = new QAction(QIcon::fromTheme("fileprint", QIcon(rsrcPath + "/fileprint.png")),
- tr("Print Preview..."), this);
- connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview()));
- menu->addAction(a);
+ const QIcon filePrintIcon = QIcon::fromTheme("fileprint", QIcon(rsrcPath + "/fileprint.png"));
+ menu->addAction(filePrintIcon, tr("Print Preview..."), this, &TextEdit::filePrintPreview);
- a = new QAction(QIcon::fromTheme("exportpdf", QIcon(rsrcPath + "/exportpdf.png")),
- tr("&Export PDF..."), this);
+ const QIcon exportPdfIcon = QIcon::fromTheme("exportpdf", QIcon(rsrcPath + "/exportpdf.png"));
+ a = menu->addAction(exportPdfIcon, tr("&Export PDF..."), this, &TextEdit::filePrintPdf);
a->setPriority(QAction::LowPriority);
a->setShortcut(Qt::CTRL + Qt::Key_D);
- connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf()));
tb->addAction(a);
- menu->addAction(a);
menu->addSeparator();
#endif
- a = new QAction(tr("&Quit"), this);
+ a = menu->addAction(tr("&Quit"), this, &QWidget::close);
a->setShortcut(Qt::CTRL + Qt::Key_Q);
- connect(a, SIGNAL(triggered()), this, SLOT(close()));
- menu->addAction(a);
}
void TextEdit::setupEditActions()
{
- QToolBar *tb = new QToolBar(this);
- tb->setWindowTitle(tr("Edit Actions"));
- addToolBar(tb);
- QMenu *menu = new QMenu(tr("&Edit"), this);
- menuBar()->addMenu(menu);
+ QToolBar *tb = addToolBar(tr("Edit Actions"));
+ QMenu *menu = menuBar()->addMenu(tr("&Edit"));
- QAction *a;
- a = actionUndo = new QAction(QIcon::fromTheme("edit-undo", QIcon(rsrcPath + "/editundo.png")),
- tr("&Undo"), this);
- a->setShortcut(QKeySequence::Undo);
- tb->addAction(a);
- menu->addAction(a);
- a = actionRedo = new QAction(QIcon::fromTheme("edit-redo", QIcon(rsrcPath + "/editredo.png")),
- tr("&Redo"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Redo);
- tb->addAction(a);
- menu->addAction(a);
+ const QIcon undoIcon = QIcon::fromTheme("edit-undo", QIcon(rsrcPath + "/editundo.png"));
+ actionUndo = menu->addAction(undoIcon, tr("&Undo"), textEdit, &QTextEdit::undo);
+ actionUndo->setShortcut(QKeySequence::Undo);
+ tb->addAction(actionUndo);
+
+ const QIcon redoIcon = QIcon::fromTheme("edit-redo", QIcon(rsrcPath + "/editredo.png"));
+ actionRedo = menu->addAction(redoIcon, tr("&Redo"), textEdit, &QTextEdit::redo);
+ actionRedo->setPriority(QAction::LowPriority);
+ actionRedo->setShortcut(QKeySequence::Redo);
+ tb->addAction(actionRedo);
menu->addSeparator();
- a = actionCut = new QAction(QIcon::fromTheme("edit-cut", QIcon(rsrcPath + "/editcut.png")),
- tr("Cu&t"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Cut);
- tb->addAction(a);
- menu->addAction(a);
- a = actionCopy = new QAction(QIcon::fromTheme("edit-copy", QIcon(rsrcPath + "/editcopy.png")),
- tr("&Copy"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Copy);
- tb->addAction(a);
- menu->addAction(a);
- a = actionPaste = new QAction(QIcon::fromTheme("edit-paste", QIcon(rsrcPath + "/editpaste.png")),
- tr("&Paste"), this);
- a->setPriority(QAction::LowPriority);
- a->setShortcut(QKeySequence::Paste);
- tb->addAction(a);
- menu->addAction(a);
+
#ifndef QT_NO_CLIPBOARD
+ const QIcon cutIcon = QIcon::fromTheme("edit-cut", QIcon(rsrcPath + "/editcut.png"));
+ actionCut = menu->addAction(cutIcon, tr("Cu&t"), textEdit, &QTextEdit::cut);
+ actionCut->setPriority(QAction::LowPriority);
+ actionCut->setShortcut(QKeySequence::Cut);
+ tb->addAction(actionCut);
+
+ const QIcon copyIcon = QIcon::fromTheme("edit-copy", QIcon(rsrcPath + "/editcopy.png"));
+ actionCopy = menu->addAction(copyIcon, tr("&Copy"), textEdit, &QTextEdit::copy);
+ actionCopy->setPriority(QAction::LowPriority);
+ actionCopy->setShortcut(QKeySequence::Copy);
+ tb->addAction(actionCopy);
+
+ const QIcon pasteIcon = QIcon::fromTheme("edit-paste", QIcon(rsrcPath + "/editpaste.png"));
+ actionPaste = menu->addAction(pasteIcon, tr("&Paste"), textEdit, &QTextEdit::paste);
+ actionPaste->setPriority(QAction::LowPriority);
+ actionPaste->setShortcut(QKeySequence::Paste);
+ tb->addAction(actionPaste);
if (const QMimeData *md = QApplication::clipboard()->mimeData())
actionPaste->setEnabled(md->hasText());
#endif
@@ -271,110 +227,89 @@ void TextEdit::setupEditActions()
void TextEdit::setupTextActions()
{
- QToolBar *tb = new QToolBar(this);
- tb->setWindowTitle(tr("Format Actions"));
- addToolBar(tb);
-
- QMenu *menu = new QMenu(tr("F&ormat"), this);
- menuBar()->addMenu(menu);
+ QToolBar *tb = addToolBar(tr("Format Actions"));
+ QMenu *menu = menuBar()->addMenu(tr("F&ormat"));
- actionTextBold = new QAction(QIcon::fromTheme("format-text-bold", QIcon(rsrcPath + "/textbold.png")),
- tr("&Bold"), this);
+ const QIcon boldIcon = QIcon::fromTheme("format-text-bold", QIcon(rsrcPath + "/textbold.png"));
+ actionTextBold = menu->addAction(boldIcon, tr("&Bold"), this, &TextEdit::textBold);
actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B);
actionTextBold->setPriority(QAction::LowPriority);
QFont bold;
bold.setBold(true);
actionTextBold->setFont(bold);
- connect(actionTextBold, SIGNAL(triggered()), this, SLOT(textBold()));
tb->addAction(actionTextBold);
- menu->addAction(actionTextBold);
actionTextBold->setCheckable(true);
- actionTextItalic = new QAction(QIcon::fromTheme("format-text-italic",
- QIcon(rsrcPath + "/textitalic.png")),
- tr("&Italic"), this);
+ const QIcon italicIcon = QIcon::fromTheme("format-text-italic", QIcon(rsrcPath + "/textitalic.png"));
+ actionTextItalic = menu->addAction(italicIcon, tr("&Italic"), this, &TextEdit::textItalic);
actionTextItalic->setPriority(QAction::LowPriority);
actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I);
QFont italic;
italic.setItalic(true);
actionTextItalic->setFont(italic);
- connect(actionTextItalic, SIGNAL(triggered()), this, SLOT(textItalic()));
tb->addAction(actionTextItalic);
- menu->addAction(actionTextItalic);
actionTextItalic->setCheckable(true);
- actionTextUnderline = new QAction(QIcon::fromTheme("format-text-underline",
- QIcon(rsrcPath + "/textunder.png")),
- tr("&Underline"), this);
+ const QIcon underlineIcon = QIcon::fromTheme("format-text-underline", QIcon(rsrcPath + "/textunder.png"));
+ actionTextUnderline = menu->addAction(underlineIcon, tr("&Underline"), this, &TextEdit::textUnderline);
actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U);
actionTextUnderline->setPriority(QAction::LowPriority);
QFont underline;
underline.setUnderline(true);
actionTextUnderline->setFont(underline);
- connect(actionTextUnderline, SIGNAL(triggered()), this, SLOT(textUnderline()));
tb->addAction(actionTextUnderline);
- menu->addAction(actionTextUnderline);
actionTextUnderline->setCheckable(true);
menu->addSeparator();
- QActionGroup *grp = new QActionGroup(this);
- connect(grp, SIGNAL(triggered(QAction*)), this, SLOT(textAlign(QAction*)));
-
- // Make sure the alignLeft is always left of the alignRight
- if (QApplication::isLeftToRight()) {
- actionAlignLeft = new QAction(QIcon::fromTheme("format-justify-left",
- QIcon(rsrcPath + "/textleft.png")),
- tr("&Left"), grp);
- actionAlignCenter = new QAction(QIcon::fromTheme("format-justify-center",
- QIcon(rsrcPath + "/textcenter.png")),
- tr("C&enter"), grp);
- actionAlignRight = new QAction(QIcon::fromTheme("format-justify-right",
- QIcon(rsrcPath + "/textright.png")),
- tr("&Right"), grp);
- } else {
- actionAlignRight = new QAction(QIcon::fromTheme("format-justify-right",
- QIcon(rsrcPath + "/textright.png")),
- tr("&Right"), grp);
- actionAlignCenter = new QAction(QIcon::fromTheme("format-justify-center",
- QIcon(rsrcPath + "/textcenter.png")),
- tr("C&enter"), grp);
- actionAlignLeft = new QAction(QIcon::fromTheme("format-justify-left",
- QIcon(rsrcPath + "/textleft.png")),
- tr("&Left"), grp);
- }
- actionAlignJustify = new QAction(QIcon::fromTheme("format-justify-fill",
- QIcon(rsrcPath + "/textjustify.png")),
- tr("&Justify"), grp);
-
+ const QIcon leftIcon = QIcon::fromTheme("format-justify-left", QIcon(rsrcPath + "/textleft.png"));
+ actionAlignLeft = new QAction(leftIcon, tr("&Left"), this);
actionAlignLeft->setShortcut(Qt::CTRL + Qt::Key_L);
actionAlignLeft->setCheckable(true);
actionAlignLeft->setPriority(QAction::LowPriority);
+ const QIcon centerIcon = QIcon::fromTheme("format-justify-center", QIcon(rsrcPath + "/textcenter.png"));
+ actionAlignCenter = new QAction(centerIcon, tr("C&enter"), this);
actionAlignCenter->setShortcut(Qt::CTRL + Qt::Key_E);
actionAlignCenter->setCheckable(true);
actionAlignCenter->setPriority(QAction::LowPriority);
+ const QIcon rightIcon = QIcon::fromTheme("format-justify-right", QIcon(rsrcPath + "/textright.png"));
+ actionAlignRight = new QAction(rightIcon, tr("&Right"), this);
actionAlignRight->setShortcut(Qt::CTRL + Qt::Key_R);
actionAlignRight->setCheckable(true);
actionAlignRight->setPriority(QAction::LowPriority);
+ const QIcon fillIcon = QIcon::fromTheme("format-justify-fill", QIcon(rsrcPath + "/textjustify.png"));
+ actionAlignJustify = new QAction(fillIcon, tr("&Justify"), this);
actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J);
actionAlignJustify->setCheckable(true);
actionAlignJustify->setPriority(QAction::LowPriority);
- tb->addActions(grp->actions());
- menu->addActions(grp->actions());
+ // Make sure the alignLeft is always left of the alignRight
+ QActionGroup *alignGroup = new QActionGroup(this);
+ connect(alignGroup, &QActionGroup::triggered, this, &TextEdit::textAlign);
+
+ if (QApplication::isLeftToRight()) {
+ alignGroup->addAction(actionAlignLeft);
+ alignGroup->addAction(actionAlignCenter);
+ alignGroup->addAction(actionAlignRight);
+ } else {
+ alignGroup->addAction(actionAlignRight);
+ alignGroup->addAction(actionAlignCenter);
+ alignGroup->addAction(actionAlignLeft);
+ }
+ alignGroup->addAction(actionAlignJustify);
+
+ tb->addActions(alignGroup->actions());
+ menu->addActions(alignGroup->actions());
menu->addSeparator();
QPixmap pix(16, 16);
pix.fill(Qt::black);
- actionTextColor = new QAction(pix, tr("&Color..."), this);
- connect(actionTextColor, SIGNAL(triggered()), this, SLOT(textColor()));
+ actionTextColor = menu->addAction(pix, tr("&Color..."), this, &TextEdit::textColor);
tb->addAction(actionTextColor);
- menu->addAction(actionTextColor);
- tb = new QToolBar(this);
+ tb = addToolBar(tr("Format Actions"));
tb->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
- tb->setWindowTitle(tr("Format Actions"));
addToolBarBreak(Qt::TopToolBarArea);
addToolBar(tb);
@@ -389,24 +324,26 @@ void TextEdit::setupTextActions()
comboStyle->addItem("Ordered List (Alpha upper)");
comboStyle->addItem("Ordered List (Roman lower)");
comboStyle->addItem("Ordered List (Roman upper)");
- connect(comboStyle, SIGNAL(activated(int)), this, SLOT(textStyle(int)));
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(comboStyle, static_cast<QComboIntSignal>(&QComboBox::activated), this, &TextEdit::textStyle);
+
+ typedef void (QComboBox::*QComboStringSignal)(const QString &);
comboFont = new QFontComboBox(tb);
tb->addWidget(comboFont);
- connect(comboFont, SIGNAL(activated(QString)), this, SLOT(textFamily(QString)));
+ connect(comboFont, static_cast<QComboStringSignal>(&QComboBox::activated), this, &TextEdit::textFamily);
comboSize = new QComboBox(tb);
comboSize->setObjectName("comboSize");
tb->addWidget(comboSize);
comboSize->setEditable(true);
- QFontDatabase db;
- foreach(int size, db.standardSizes())
+ const QList<int> standardSizes = QFontDatabase::standardSizes();
+ foreach (int size, standardSizes)
comboSize->addItem(QString::number(size));
+ comboSize->setCurrentIndex(standardSizes.indexOf(QApplication::font().pointSize()));
- connect(comboSize, SIGNAL(activated(QString)), this, SLOT(textSize(QString)));
- comboSize->setCurrentIndex(comboSize->findText(QString::number(QApplication::font()
- .pointSize())));
+ connect(comboSize, static_cast<QComboStringSignal>(&QComboBox::activated), this, &TextEdit::textSize);
}
bool TextEdit::load(const QString &f)
@@ -436,11 +373,11 @@ bool TextEdit::maybeSave()
if (!textEdit->document()->isModified())
return true;
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Application"),
- tr("The document has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+ const QMessageBox::StandardButton ret =
+ QMessageBox::warning(this, QCoreApplication::applicationName(),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
if (ret == QMessageBox::Save)
return fileSave();
else if (ret == QMessageBox::Cancel)
@@ -459,7 +396,7 @@ void TextEdit::setCurrentFileName(const QString &fileName)
else
shownName = QFileInfo(fileName).fileName();
- setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Rich Text")));
+ setWindowTitle(tr("%1[*] - %2").arg(shownName, QCoreApplication::applicationName()));
setWindowModified(false);
}
@@ -473,10 +410,17 @@ void TextEdit::fileNew()
void TextEdit::fileOpen()
{
- QString fn = QFileDialog::getOpenFileName(this, tr("Open File..."),
- QString(), tr("HTML-Files (*.htm *.html);;All Files (*)"));
- if (!fn.isEmpty())
- load(fn);
+ QFileDialog fileDialog(this, tr("Open File..."));
+ fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
+ fileDialog.setFileMode(QFileDialog::ExistingFile);
+ fileDialog.setMimeTypeFilters(QStringList() << "text/html" << "text/plain");
+ if (fileDialog.exec() != QDialog::Accepted)
+ return;
+ const QString fn = fileDialog.selectedFiles().first();
+ if (load(fn))
+ statusBar()->showMessage(tr("Opened \"%1\"").arg(QDir::toNativeSeparators(fn)));
+ else
+ statusBar()->showMessage(tr("Could not open \"%1\"").arg(QDir::toNativeSeparators(fn)));
}
bool TextEdit::fileSave()
@@ -488,23 +432,27 @@ bool TextEdit::fileSave()
QTextDocumentWriter writer(fileName);
bool success = writer.write(textEdit->document());
- if (success)
+ if (success) {
textEdit->document()->setModified(false);
+ statusBar()->showMessage(tr("Wrote \"%1\"").arg(QDir::toNativeSeparators(fileName)));
+ } else {
+ statusBar()->showMessage(tr("Could not write to file \"%1\"")
+ .arg(QDir::toNativeSeparators(fileName)));
+ }
return success;
}
bool TextEdit::fileSaveAs()
{
- QString fn = QFileDialog::getSaveFileName(this, tr("Save as..."), QString(),
- tr("ODF files (*.odt);;HTML-Files "
- "(*.htm *.html);;All Files (*)"));
- if (fn.isEmpty())
+ QFileDialog fileDialog(this, tr("Save as..."));
+ fileDialog.setAcceptMode(QFileDialog::AcceptSave);
+ QStringList mimeTypes;
+ mimeTypes << "application/vnd.oasis.opendocument.text" << "text/html" << "text/plain";
+ fileDialog.setMimeTypeFilters(mimeTypes);
+ fileDialog.setDefaultSuffix("odt");
+ if (fileDialog.exec() != QDialog::Accepted)
return false;
- if (!(fn.endsWith(".odt", Qt::CaseInsensitive)
- || fn.endsWith(".htm", Qt::CaseInsensitive)
- || fn.endsWith(".html", Qt::CaseInsensitive))) {
- fn += ".odt"; // default
- }
+ const QString fn = fileDialog.selectedFiles().first();
setCurrentFileName(fn);
return fileSave();
}
@@ -528,7 +476,7 @@ void TextEdit::filePrintPreview()
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::HighResolution);
QPrintPreviewDialog preview(&printer, this);
- connect(&preview, SIGNAL(paintRequested(QPrinter*)), SLOT(printPreview(QPrinter*)));
+ connect(&preview, &QPrintPreviewDialog::paintRequested, this, &TextEdit::printPreview);
preview.exec();
#endif
}
@@ -547,16 +495,19 @@ void TextEdit::filePrintPdf()
{
#ifndef QT_NO_PRINTER
//! [0]
- QString fileName = QFileDialog::getSaveFileName(this, "Export PDF",
- QString(), "*.pdf");
- if (!fileName.isEmpty()) {
- if (QFileInfo(fileName).suffix().isEmpty())
- fileName.append(".pdf");
- QPrinter printer(QPrinter::HighResolution);
- printer.setOutputFormat(QPrinter::PdfFormat);
- printer.setOutputFileName(fileName);
- textEdit->document()->print(&printer);
- }
+ QFileDialog fileDialog(this, tr("Export PDF"));
+ fileDialog.setAcceptMode(QFileDialog::AcceptSave);
+ fileDialog.setMimeTypeFilters(QStringList("application/pdf"));
+ fileDialog.setDefaultSuffix("pdf");
+ if (fileDialog.exec() != QDialog::Accepted)
+ return;
+ QString fileName = fileDialog.selectedFiles().first();
+ QPrinter printer(QPrinter::HighResolution);
+ printer.setOutputFormat(QPrinter::PdfFormat);
+ printer.setOutputFileName(fileName);
+ textEdit->document()->print(&printer);
+ statusBar()->showMessage(tr("Exported \"%1\"")
+ .arg(QDir::toNativeSeparators(fileName)));
//! [0]
#endif
}
diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h
index dade2b9edf..ca2fb86b29 100644
--- a/examples/widgets/richtext/textedit/textedit.h
+++ b/examples/widgets/richtext/textedit/textedit.h
@@ -55,19 +55,15 @@ class TextEdit : public QMainWindow
public:
TextEdit(QWidget *parent = 0);
+ bool load(const QString &f);
+
+public slots:
+ void fileNew();
+
protected:
virtual void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE;
-private:
- void setupFileActions();
- void setupEditActions();
- void setupTextActions();
- bool load(const QString &f);
- bool maybeSave();
- void setCurrentFileName(const QString &fileName);
-
private slots:
- void fileNew();
void fileOpen();
bool fileSave();
bool fileSaveAs();
@@ -92,6 +88,12 @@ private slots:
void printPreview(QPrinter *);
private:
+ void setupFileActions();
+ void setupEditActions();
+ void setupTextActions();
+ bool maybeSave();
+ void setCurrentFileName(const QString &fileName);
+
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
void fontChanged(const QFont &f);
void colorChanged(const QColor &c);
@@ -108,9 +110,11 @@ private:
QAction *actionAlignJustify;
QAction *actionUndo;
QAction *actionRedo;
+#ifndef QT_NO_CLIPBOARD
QAction *actionCut;
QAction *actionCopy;
QAction *actionPaste;
+#endif
QComboBox *comboStyle;
QFontComboBox *comboFont;
diff --git a/examples/widgets/tools/regexp/regexpdialog.cpp b/examples/widgets/tools/regexp/regexpdialog.cpp
index 32df8a4b91..8ed1e790fb 100644
--- a/examples/widgets/tools/regexp/regexpdialog.cpp
+++ b/examples/widgets/tools/regexp/regexpdialog.cpp
@@ -153,8 +153,8 @@ void RegExpDialog::refresh()
QString escaped = pattern;
escaped.replace("\\", "\\\\");
escaped.replace("\"", "\\\"");
- escaped.prepend("\"");
- escaped.append("\"");
+ escaped.prepend('"');
+ escaped.append('"');
escapedPatternLineEdit->setText(escaped);
QRegExp rx(pattern);
diff --git a/examples/widgets/tools/regularexpression/images/copy.png b/examples/widgets/tools/regularexpression/images/copy.png
new file mode 100644
index 0000000000..2aeb28288f
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/images/copy.png
Binary files differ
diff --git a/examples/widgets/tools/regularexpression/main.cpp b/examples/widgets/tools/regularexpression/main.cpp
new file mode 100644
index 0000000000..a5ef410688
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of 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 "regularexpressiondialog.h"
+
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ RegularExpressionDialog dialog;
+ dialog.show();
+ return app.exec();
+}
diff --git a/examples/widgets/tools/regularexpression/regularexpression.pro b/examples/widgets/tools/regularexpression/regularexpression.pro
new file mode 100644
index 0000000000..8e72e171b8
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpression.pro
@@ -0,0 +1,11 @@
+QT += widgets
+
+HEADERS = regularexpressiondialog.h
+SOURCES = regularexpressiondialog.cpp \
+ main.cpp
+
+RESOURCES += regularexpression.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/regularexpression
+INSTALLS += target
diff --git a/examples/widgets/tools/regularexpression/regularexpression.qrc b/examples/widgets/tools/regularexpression/regularexpression.qrc
new file mode 100644
index 0000000000..ce7e104af3
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpression.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/copy.png</file>
+</qresource>
+</RCC>
diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
new file mode 100644
index 0000000000..6cddc1f6c1
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp
@@ -0,0 +1,349 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+** Copyright (C) 2015 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of 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 "regularexpressiondialog.h"
+
+#include <QApplication>
+
+#include <QCheckBox>
+#include <QComboBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QPlainTextEdit>
+#include <QTreeWidget>
+
+#include <QAction>
+#include <QClipboard>
+
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QFormLayout>
+
+#include <QRegularExpression>
+#include <QRegularExpressionMatch>
+#include <QRegularExpressionMatchIterator>
+
+Q_DECLARE_METATYPE(QRegularExpression::MatchType)
+
+RegularExpressionDialog::RegularExpressionDialog(QWidget *parent)
+ : QDialog(parent)
+{
+ setupUi();
+ setWindowTitle(tr("QRegularExpression Example"));
+
+ connect(patternLineEdit, &QLineEdit::textChanged, this, &RegularExpressionDialog::refresh);
+ connect(subjectTextEdit, &QPlainTextEdit::textChanged, this, &RegularExpressionDialog::refresh);
+
+ connect(caseInsensitiveOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dotMatchesEverythingOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(multilineOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(extendedPatternSyntaxOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(invertedGreedinessOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dontCaptureOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(useUnicodePropertiesOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(optimizeOnFirstUsageOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dontAutomaticallyOptimizeOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+
+ connect(offsetSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
+ this, &RegularExpressionDialog::refresh);
+
+ connect(matchTypeComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &RegularExpressionDialog::refresh);
+
+ connect(anchoredMatchOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+ connect(dontCheckSubjectStringMatchOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh);
+
+ patternLineEdit->setText(tr("(\\+?\\d+)-(?<prefix>\\d+)-(?<number>\\w+)"));
+ subjectTextEdit->setPlainText(tr("My office number is +43-152-0123456, my mobile is 001-41-255512 instead."));
+
+ refresh();
+}
+
+void RegularExpressionDialog::refresh()
+{
+ setUpdatesEnabled(false);
+
+ const QString pattern = patternLineEdit->text();
+ const QString text = subjectTextEdit->toPlainText();
+
+ offsetSpinBox->setMaximum(qMax(0, text.length() - 1));
+
+ QString escaped = pattern;
+ escaped.replace(QLatin1String("\\"), QLatin1String("\\\\"));
+ escaped.replace(QLatin1String("\""), QLatin1String("\\\""));
+ escaped.prepend(QLatin1Char('"'));
+ escaped.append(QLatin1Char('"'));
+ escapedPatternLineEdit->setText(escaped);
+
+ QRegularExpression rx(pattern);
+ QRegularExpression::MatchType matchType = matchTypeComboBox->currentData().value<QRegularExpression::MatchType>();
+ QRegularExpression::PatternOptions patternOptions = QRegularExpression::NoPatternOption;
+ QRegularExpression::MatchOptions matchOptions = QRegularExpression::NoMatchOption;
+
+ if (anchoredMatchOptionCheckBox->isChecked())
+ matchOptions |= QRegularExpression::AnchoredMatchOption;
+ if (dontCheckSubjectStringMatchOptionCheckBox->isChecked())
+ matchOptions |= QRegularExpression::DontCheckSubjectStringMatchOption;
+
+ if (caseInsensitiveOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::CaseInsensitiveOption;
+ if (dotMatchesEverythingOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::DotMatchesEverythingOption;
+ if (multilineOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::MultilineOption;
+ if (extendedPatternSyntaxOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::ExtendedPatternSyntaxOption;
+ if (invertedGreedinessOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::InvertedGreedinessOption;
+ if (dontCaptureOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::DontCaptureOption;
+ if (useUnicodePropertiesOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::UseUnicodePropertiesOption;
+ if (optimizeOnFirstUsageOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::OptimizeOnFirstUsageOption;
+ if (dontAutomaticallyOptimizeOptionCheckBox->isChecked())
+ patternOptions |= QRegularExpression::DontAutomaticallyOptimizeOption;
+
+ rx.setPatternOptions(patternOptions);
+
+ QPalette palette = patternLineEdit->palette();
+ if (rx.isValid())
+ palette.setColor(QPalette::Text, subjectTextEdit->palette().color(QPalette::Text));
+ else
+ palette.setColor(QPalette::Text, Qt::red);
+ patternLineEdit->setPalette(palette);
+
+ matchDetailsTreeWidget->clear();
+ matchDetailsTreeWidget->setEnabled(rx.isValid());
+
+ if (rx.isValid()) {
+ const int capturingGroupsCount = rx.captureCount() + 1;
+
+ QRegularExpressionMatchIterator iterator = rx.globalMatch(text, offsetSpinBox->value(), matchType, matchOptions);
+ int i = 0;
+
+ while (iterator.hasNext()) {
+ QRegularExpressionMatch match = iterator.next();
+
+ QTreeWidgetItem *matchDetailTopItem = new QTreeWidgetItem(matchDetailsTreeWidget);
+ matchDetailTopItem->setText(0, QString::number(i));
+
+ for (int captureGroupIndex = 0; captureGroupIndex < capturingGroupsCount; ++captureGroupIndex) {
+ QTreeWidgetItem *matchDetailItem = new QTreeWidgetItem(matchDetailTopItem);
+ matchDetailItem->setText(1, QString::number(captureGroupIndex));
+ matchDetailItem->setText(2, match.captured(captureGroupIndex));
+ }
+
+ ++i;
+ }
+ }
+
+ matchDetailsTreeWidget->expandAll();
+
+ namedGroupsTreeWidget->clear();
+ namedGroupsTreeWidget->setEnabled(rx.isValid());
+
+ if (rx.isValid()) {
+ regexpStatusLabel->setText(tr("Valid"));
+
+ const QStringList namedCaptureGroups = rx.namedCaptureGroups();
+ for (int i = 0; i < namedCaptureGroups.size(); ++i) {
+ const QString currentNamedCaptureGroup = namedCaptureGroups.at(i);
+
+ QTreeWidgetItem *namedGroupItem = new QTreeWidgetItem(namedGroupsTreeWidget);
+ namedGroupItem->setText(0, QString::number(i));
+ namedGroupItem->setText(1, currentNamedCaptureGroup.isNull() ? tr("<no name>") : currentNamedCaptureGroup);
+ }
+ } else {
+ regexpStatusLabel->setText(tr("Invalid: syntax error at position %1 (%2)")
+ .arg(rx.patternErrorOffset())
+ .arg(rx.errorString()));
+ }
+
+ setUpdatesEnabled(true);
+}
+
+void RegularExpressionDialog::copyEscapedPatternToClipboard()
+{
+#ifndef QT_NO_CLIPBOARD
+ QClipboard *clipboard = QGuiApplication::clipboard();
+ if (clipboard)
+ clipboard->setText(escapedPatternLineEdit->text());
+#endif
+}
+
+void RegularExpressionDialog::setupUi()
+{
+ QWidget *leftHalfContainer = setupLeftUi();
+
+ QFrame *verticalSeparator = new QFrame;
+ verticalSeparator->setFrameStyle(QFrame::VLine | QFrame::Sunken);
+
+ QWidget *rightHalfContainer = setupRightUi();
+
+ QHBoxLayout *mainLayout = new QHBoxLayout;
+ mainLayout->addWidget(leftHalfContainer);
+ mainLayout->addWidget(verticalSeparator);
+ mainLayout->addWidget(rightHalfContainer);
+
+ setLayout(mainLayout);
+}
+
+QWidget *RegularExpressionDialog::setupLeftUi()
+{
+ QWidget *container = new QWidget;
+
+ QFormLayout *layout = new QFormLayout(container);
+ layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
+ layout->setMargin(0);
+
+ QLabel *regexpAndSubjectLabel = new QLabel(tr("<h3>Regular expression and text input</h3>"));
+ layout->addRow(regexpAndSubjectLabel);
+
+ patternLineEdit = new QLineEdit;
+ patternLineEdit->setClearButtonEnabled(true);
+ layout->addRow(tr("&Pattern:"), patternLineEdit);
+
+ escapedPatternLineEdit = new QLineEdit;
+ escapedPatternLineEdit->setReadOnly(true);
+ QPalette palette = escapedPatternLineEdit->palette();
+ palette.setBrush(QPalette::Base, palette.brush(QPalette::Disabled, QPalette::Base));
+ escapedPatternLineEdit->setPalette(palette);
+
+#ifndef QT_NO_CLIPBOARD
+ QAction *copyEscapedPatternAction = new QAction(this);
+ copyEscapedPatternAction->setText(tr("Copy to clipboard"));
+ copyEscapedPatternAction->setIcon(QIcon(QStringLiteral(":/images/copy.png")));
+ connect(copyEscapedPatternAction, &QAction::triggered, this, &RegularExpressionDialog::copyEscapedPatternToClipboard);
+ escapedPatternLineEdit->addAction(copyEscapedPatternAction, QLineEdit::TrailingPosition);
+#endif
+
+ layout->addRow(tr("&Escaped pattern:"), escapedPatternLineEdit);
+
+ subjectTextEdit = new QPlainTextEdit;
+ layout->addRow(tr("&Subject text:"), subjectTextEdit);
+
+ caseInsensitiveOptionCheckBox = new QCheckBox(tr("Case insensitive (/i)"));
+ dotMatchesEverythingOptionCheckBox = new QCheckBox(tr("Dot matches everything (/s)"));
+ multilineOptionCheckBox = new QCheckBox(tr("Multiline (/m)"));
+ extendedPatternSyntaxOptionCheckBox = new QCheckBox(tr("Extended pattern (/x)"));
+ invertedGreedinessOptionCheckBox = new QCheckBox(tr("Inverted greediness"));
+ dontCaptureOptionCheckBox = new QCheckBox(tr("Don't capture"));
+ useUnicodePropertiesOptionCheckBox = new QCheckBox(tr("Use unicode properties (/u)"));
+ optimizeOnFirstUsageOptionCheckBox = new QCheckBox(tr("Optimize on first usage"));
+ dontAutomaticallyOptimizeOptionCheckBox = new QCheckBox(tr("Don't automatically optimize"));
+
+ QGridLayout *patternOptionsCheckBoxLayout = new QGridLayout;
+ int gridRow = 0;
+ patternOptionsCheckBoxLayout->addWidget(caseInsensitiveOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(dotMatchesEverythingOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(multilineOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(extendedPatternSyntaxOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(invertedGreedinessOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(dontCaptureOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(useUnicodePropertiesOptionCheckBox, gridRow, 1);
+ patternOptionsCheckBoxLayout->addWidget(optimizeOnFirstUsageOptionCheckBox, gridRow, 2);
+ ++gridRow;
+ patternOptionsCheckBoxLayout->addWidget(dontAutomaticallyOptimizeOptionCheckBox, gridRow, 1);
+
+ layout->addRow(tr("Pattern options:"), patternOptionsCheckBoxLayout);
+
+ offsetSpinBox = new QSpinBox;
+ layout->addRow(tr("Match &offset:"), offsetSpinBox);
+
+ matchTypeComboBox = new QComboBox;
+ matchTypeComboBox->addItem(tr("Normal"), QVariant::fromValue(QRegularExpression::NormalMatch));
+ matchTypeComboBox->addItem(tr("Partial prefer complete"), QVariant::fromValue(QRegularExpression::PartialPreferCompleteMatch));
+ matchTypeComboBox->addItem(tr("Partial prefer first"), QVariant::fromValue(QRegularExpression::PartialPreferFirstMatch));
+ matchTypeComboBox->addItem(tr("No match"), QVariant::fromValue(QRegularExpression::NoMatch));
+ layout->addRow(tr("Match &type:"), matchTypeComboBox);
+
+ dontCheckSubjectStringMatchOptionCheckBox = new QCheckBox(tr("Don't check subject string"));
+ anchoredMatchOptionCheckBox = new QCheckBox(tr("Anchored match"));
+
+ QGridLayout *matchOptionsCheckBoxLayout = new QGridLayout;
+ matchOptionsCheckBoxLayout->addWidget(dontCheckSubjectStringMatchOptionCheckBox, 0, 0);
+ matchOptionsCheckBoxLayout->addWidget(anchoredMatchOptionCheckBox, 0, 1);
+ layout->addRow(tr("Match options:"), matchOptionsCheckBoxLayout);
+
+ return container;
+}
+
+QWidget *RegularExpressionDialog::setupRightUi()
+{
+ QWidget *container = new QWidget;
+
+ QFormLayout *layout = new QFormLayout(container);
+ layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
+ layout->setMargin(0);
+
+ QLabel *matchInfoLabel = new QLabel(tr("<h3>Match information</h3>"));
+ layout->addRow(matchInfoLabel);
+
+ matchDetailsTreeWidget = new QTreeWidget;
+ matchDetailsTreeWidget->setHeaderLabels(QStringList() << tr("Match index") << tr("Group index") << tr("Captured string"));
+ matchDetailsTreeWidget->setSizeAdjustPolicy(QTreeWidget::AdjustToContents);
+ layout->addRow(tr("Match details:"), matchDetailsTreeWidget);
+
+ QFrame *horizontalSeparator = new QFrame;
+ horizontalSeparator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ layout->addRow(horizontalSeparator);
+
+ QLabel *regexpInfoLabel = new QLabel(tr("<h3>Regular expression information</h3>"));
+ layout->addRow(regexpInfoLabel);
+
+ regexpStatusLabel = new QLabel(tr("Valid"));
+ regexpStatusLabel->setWordWrap(true);
+ layout->addRow(tr("Pattern status:"), regexpStatusLabel);
+
+ namedGroupsTreeWidget = new QTreeWidget;
+ namedGroupsTreeWidget->setHeaderLabels(QStringList() << tr("Index") << tr("Named group"));
+ namedGroupsTreeWidget->setSizeAdjustPolicy(QTreeWidget::AdjustToContents);
+ namedGroupsTreeWidget->setRootIsDecorated(false);
+ layout->addRow(tr("Named groups:"), namedGroupsTreeWidget);
+
+ return container;
+}
diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.h b/examples/widgets/tools/regularexpression/regularexpressiondialog.h
new file mode 100644
index 0000000000..1b3b147c14
--- /dev/null
+++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+** Copyright (C) 2015 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef REGULAREXPRESSIONDIALOG_H
+#define REGULAREXPRESSIONDIALOG_H
+
+#include <QDialog>
+
+QT_BEGIN_NAMESPACE
+class QCheckBox;
+class QComboBox;
+class QLabel;
+class QLineEdit;
+class QSpinBox;
+class QPlainTextEdit;
+class QTreeWidget;
+QT_END_NAMESPACE
+
+class RegularExpressionDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ RegularExpressionDialog(QWidget *parent = 0);
+
+private:
+ void refresh();
+ void copyEscapedPatternToClipboard();
+ void setupUi();
+ QWidget *setupLeftUi();
+ QWidget *setupRightUi();
+
+ QLineEdit *patternLineEdit;
+ QLineEdit *escapedPatternLineEdit;
+
+ QPlainTextEdit *subjectTextEdit;
+
+ QCheckBox *caseInsensitiveOptionCheckBox;
+ QCheckBox *dotMatchesEverythingOptionCheckBox;
+ QCheckBox *multilineOptionCheckBox;
+ QCheckBox *extendedPatternSyntaxOptionCheckBox;
+ QCheckBox *invertedGreedinessOptionCheckBox;
+ QCheckBox *dontCaptureOptionCheckBox;
+ QCheckBox *useUnicodePropertiesOptionCheckBox;
+ QCheckBox *optimizeOnFirstUsageOptionCheckBox;
+ QCheckBox *dontAutomaticallyOptimizeOptionCheckBox;
+
+ QSpinBox *offsetSpinBox;
+
+ QComboBox *matchTypeComboBox;
+
+ QCheckBox *anchoredMatchOptionCheckBox;
+ QCheckBox *dontCheckSubjectStringMatchOptionCheckBox;
+
+ QTreeWidget *matchDetailsTreeWidget;
+
+ QLabel *regexpStatusLabel;
+ QTreeWidget *namedGroupsTreeWidget;
+};
+
+#endif
diff --git a/examples/widgets/tools/settingseditor/locationdialog.cpp b/examples/widgets/tools/settingseditor/locationdialog.cpp
index 31c221f5d9..ad7f7e2ce5 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.cpp
+++ b/examples/widgets/tools/settingseditor/locationdialog.cpp
@@ -54,17 +54,18 @@ LocationDialog::LocationDialog(QWidget *parent)
scopeComboBox->addItem(tr("System"));
organizationComboBox = new QComboBox;
- organizationComboBox->addItem(tr("Qt"));
+ organizationComboBox->addItem(tr("QtProject"));
organizationComboBox->setEditable(true);
applicationComboBox = new QComboBox;
applicationComboBox->addItem(tr("Any"));
+ applicationComboBox->addItem(tr("Qt Creator"));
applicationComboBox->addItem(tr("Application Example"));
applicationComboBox->addItem(tr("Assistant"));
applicationComboBox->addItem(tr("Designer"));
applicationComboBox->addItem(tr("Linguist"));
applicationComboBox->setEditable(true);
- applicationComboBox->setCurrentIndex(3);
+ applicationComboBox->setCurrentIndex(1);
formatLabel = new QLabel(tr("&Format:"));
formatLabel->setBuddy(formatComboBox);
@@ -91,28 +92,30 @@ LocationDialog::LocationDialog(QWidget *parent)
locationsTable->setHorizontalHeaderLabels(labels);
locationsTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
locationsTable->horizontalHeader()->resizeSection(1, 180);
+ connect(locationsTable, &QTableWidget::itemActivated, this, &LocationDialog::itemActivated);
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
- | QDialogButtonBox::Cancel);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- connect(formatComboBox, SIGNAL(activated(int)),
- this, SLOT(updateLocationsTable()));
- connect(scopeComboBox, SIGNAL(activated(int)),
- this, SLOT(updateLocationsTable()));
+ typedef void (QComboBox::*QComboIntSignal)(int);
+ connect(formatComboBox, static_cast<QComboIntSignal>(&QComboBox::activated),
+ this, &LocationDialog::updateLocationsTable);
+ connect(scopeComboBox, static_cast<QComboIntSignal>(&QComboBox::activated),
+ this, &LocationDialog::updateLocationsTable);
connect(organizationComboBox->lineEdit(),
- SIGNAL(editingFinished()),
- this, SLOT(updateLocationsTable()));
+ &QLineEdit::editingFinished,
+ this, &LocationDialog::updateLocationsTable);
connect(applicationComboBox->lineEdit(),
- SIGNAL(editingFinished()),
- this, SLOT(updateLocationsTable()));
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
-
- QVBoxLayout *locationsLayout = new QVBoxLayout;
+ &QLineEdit::editingFinished,
+ this, &LocationDialog::updateLocationsTable);
+ connect(applicationComboBox, static_cast<QComboIntSignal>(&QComboBox::activated),
+ this, &LocationDialog::updateLocationsTable);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+
+ QVBoxLayout *locationsLayout = new QVBoxLayout(locationsGroupBox);
locationsLayout->addWidget(locationsTable);
- locationsGroupBox->setLayout(locationsLayout);
- QGridLayout *mainLayout = new QGridLayout;
+ QGridLayout *mainLayout = new QGridLayout(this);
mainLayout->addWidget(formatLabel, 0, 0);
mainLayout->addWidget(formatComboBox, 0, 1);
mainLayout->addWidget(scopeLabel, 1, 0);
@@ -123,7 +126,6 @@ LocationDialog::LocationDialog(QWidget *parent)
mainLayout->addWidget(applicationComboBox, 3, 1);
mainLayout->addWidget(locationsGroupBox, 4, 0, 1, 2);
mainLayout->addWidget(buttonBox, 5, 0, 1, 2);
- setLayout(mainLayout);
updateLocationsTable();
@@ -155,11 +157,16 @@ QString LocationDialog::organization() const
QString LocationDialog::application() const
{
if (applicationComboBox->currentText() == tr("Any"))
- return "";
+ return QString();
else
return applicationComboBox->currentText();
}
+void LocationDialog::itemActivated(QTableWidgetItem *)
+{
+ buttonBox->button(QDialogButtonBox::Ok)->animateClick();
+}
+
void LocationDialog::updateLocationsTable()
{
locationsTable->setUpdatesEnabled(false);
@@ -184,8 +191,7 @@ void LocationDialog::updateLocationsTable()
int row = locationsTable->rowCount();
locationsTable->setRowCount(row + 1);
- QTableWidgetItem *item0 = new QTableWidgetItem;
- item0->setText(settings.fileName());
+ QTableWidgetItem *item0 = new QTableWidgetItem(QDir::toNativeSeparators(settings.fileName()));
QTableWidgetItem *item1 = new QTableWidgetItem;
bool disable = (settings.childKeys().isEmpty()
diff --git a/examples/widgets/tools/settingseditor/locationdialog.h b/examples/widgets/tools/settingseditor/locationdialog.h
index 5bb68d54df..d6f0225a31 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.h
+++ b/examples/widgets/tools/settingseditor/locationdialog.h
@@ -50,6 +50,7 @@ class QDialogButtonBox;
class QGroupBox;
class QLabel;
class QTableWidget;
+class QTableWidgetItem;
QT_END_NAMESPACE
class LocationDialog : public QDialog
@@ -66,6 +67,7 @@ public:
private slots:
void updateLocationsTable();
+ void itemActivated(QTableWidgetItem *);
private:
QLabel *formatLabel;
diff --git a/examples/widgets/tools/settingseditor/main.cpp b/examples/widgets/tools/settingseditor/main.cpp
index 842a474405..0947efd817 100644
--- a/examples/widgets/tools/settingseditor/main.cpp
+++ b/examples/widgets/tools/settingseditor/main.cpp
@@ -45,6 +45,9 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QCoreApplication::setApplicationName("Settings Editor");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+
MainWindow mainWin;
mainWin.show();
return app.exec();
diff --git a/examples/widgets/tools/settingseditor/mainwindow.cpp b/examples/widgets/tools/settingseditor/mainwindow.cpp
index 078a84576d..dbc8309eef 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.cpp
+++ b/examples/widgets/tools/settingseditor/mainwindow.cpp
@@ -45,20 +45,20 @@
#include "settingstree.h"
MainWindow::MainWindow()
+ : settingsTree(new SettingsTree)
+ , locationDialog(Q_NULLPTR)
{
- settingsTree = new SettingsTree;
setCentralWidget(settingsTree);
- locationDialog = 0;
-
createActions();
- createMenus();
autoRefreshAct->setChecked(true);
fallbacksAct->setChecked(true);
- setWindowTitle(tr("Settings Editor"));
- resize(500, 600);
+ setWindowTitle(QCoreApplication::applicationName());
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ adjustSize();
+ move((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2);
}
void MainWindow::openSettings()
@@ -66,49 +66,60 @@ void MainWindow::openSettings()
if (!locationDialog)
locationDialog = new LocationDialog(this);
- if (locationDialog->exec()) {
- QSettings *settings = new QSettings(locationDialog->format(),
- locationDialog->scope(),
- locationDialog->organization(),
- locationDialog->application());
- setSettingsObject(settings);
- fallbacksAct->setEnabled(true);
- }
+ if (locationDialog->exec() != QDialog::Accepted)
+ return;
+
+ SettingsPtr settings(new QSettings(locationDialog->format(),
+ locationDialog->scope(),
+ locationDialog->organization(),
+ locationDialog->application()));
+
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(true);
}
void MainWindow::openIniFile()
{
- QString fileName = QFileDialog::getOpenFileName(this, tr("Open INI File"),
- "", tr("INI Files (*.ini *.conf)"));
- if (!fileName.isEmpty()) {
- QSettings *settings = new QSettings(fileName, QSettings::IniFormat);
- setSettingsObject(settings);
- fallbacksAct->setEnabled(false);
- }
+ const QString directory = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open INI File"),
+ directory, tr("INI Files (*.ini *.conf)"));
+ if (fileName.isEmpty())
+ return;
+
+ SettingsPtr settings(new QSettings(fileName, QSettings::IniFormat));
+
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(false);
}
void MainWindow::openPropertyList()
{
- QString fileName = QFileDialog::getOpenFileName(this,
- tr("Open Property List"),
- "", tr("Property List Files (*.plist)"));
- if (!fileName.isEmpty()) {
- QSettings *settings = new QSettings(fileName, QSettings::NativeFormat);
- setSettingsObject(settings);
- fallbacksAct->setEnabled(false);
- }
+ const QString directory = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
+ const QString fileName =
+ QFileDialog::getOpenFileName(this, tr("Open Property List"),
+ directory, tr("Property List Files (*.plist)"));
+ if (fileName.isEmpty())
+ return;
+
+ SettingsPtr settings(new QSettings(fileName, QSettings::NativeFormat));
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(false);
}
void MainWindow::openRegistryPath()
{
- QString path = QInputDialog::getText(this, tr("Open Registry Path"),
- tr("Enter the path in the Windows registry:"),
- QLineEdit::Normal, "HKEY_CURRENT_USER\\");
- if (!path.isEmpty()) {
- QSettings *settings = new QSettings(path, QSettings::NativeFormat);
- setSettingsObject(settings);
- fallbacksAct->setEnabled(false);
- }
+ const QString path =
+ QInputDialog::getText(this, tr("Open Registry Path"),
+ tr("Enter the path in the Windows registry:"),
+ QLineEdit::Normal, "HKEY_CURRENT_USER\\");
+ if (path.isEmpty())
+ return;
+
+ SettingsPtr settings(new QSettings(path, QSettings::NativeFormat));
+
+ setSettingsObject(settings);
+ fallbacksAct->setEnabled(false);
}
void MainWindow::about()
@@ -120,88 +131,59 @@ void MainWindow::about()
void MainWindow::createActions()
{
- openSettingsAct = new QAction(tr("&Open Application Settings..."), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+
+ QAction *openSettingsAct = fileMenu->addAction(tr("&Open Application Settings..."), this, &MainWindow::openSettings);
openSettingsAct->setShortcuts(QKeySequence::Open);
- connect(openSettingsAct, SIGNAL(triggered()), this, SLOT(openSettings()));
- openIniFileAct = new QAction(tr("Open I&NI File..."), this);
+ QAction *openIniFileAct = fileMenu->addAction(tr("Open I&NI File..."), this, &MainWindow::openIniFile);
openIniFileAct->setShortcut(tr("Ctrl+N"));
- connect(openIniFileAct, SIGNAL(triggered()), this, SLOT(openIniFile()));
- openPropertyListAct = new QAction(tr("Open Mac &Property List..."), this);
+#ifdef Q_OS_OSX
+ QAction *openPropertyListAct = fileMenu->addAction(tr("Open Apple &Property List..."), this, &MainWindow::openPropertyList);
openPropertyListAct->setShortcut(tr("Ctrl+P"));
- connect(openPropertyListAct, SIGNAL(triggered()),
- this, SLOT(openPropertyList()));
+#endif // Q_OS_OSX
- openRegistryPathAct = new QAction(tr("Open Windows &Registry Path..."),
- this);
+#ifdef Q_OS_WIN
+ QAction *openRegistryPathAct = fileMenu->addAction(tr("Open Windows &Registry Path..."), this, &MainWindow::openRegistryPath);
openRegistryPathAct->setShortcut(tr("Ctrl+G"));
- connect(openRegistryPathAct, SIGNAL(triggered()),
- this, SLOT(openRegistryPath()));
+#endif // Q_OS_WIN
+
+ fileMenu->addSeparator();
- refreshAct = new QAction(tr("&Refresh"), this);
+ refreshAct = fileMenu->addAction(tr("&Refresh"), settingsTree, &SettingsTree::refresh);
refreshAct->setShortcut(tr("Ctrl+R"));
refreshAct->setEnabled(false);
- connect(refreshAct, SIGNAL(triggered()), settingsTree, SLOT(refresh()));
- exitAct = new QAction(tr("E&xit"), this);
+ fileMenu->addSeparator();
+
+ QAction *exitAct = fileMenu->addAction(tr("E&xit"), this, &QWidget::close);
exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
- autoRefreshAct = new QAction(tr("&Auto-Refresh"), this);
+ QMenu *optionsMenu = menuBar()->addMenu(tr("&Options"));
+
+ autoRefreshAct = optionsMenu->addAction(tr("&Auto-Refresh"));
autoRefreshAct->setShortcut(tr("Ctrl+A"));
autoRefreshAct->setCheckable(true);
autoRefreshAct->setEnabled(false);
- connect(autoRefreshAct, SIGNAL(triggered(bool)),
- settingsTree, SLOT(setAutoRefresh(bool)));
- connect(autoRefreshAct, SIGNAL(triggered(bool)),
- refreshAct, SLOT(setDisabled(bool)));
+ connect(autoRefreshAct, &QAction::triggered,
+ settingsTree, &SettingsTree::setAutoRefresh);
+ connect(autoRefreshAct, &QAction::triggered,
+ refreshAct, &QAction::setDisabled);
- fallbacksAct = new QAction(tr("&Fallbacks"), this);
+ fallbacksAct = optionsMenu->addAction(tr("&Fallbacks"));
fallbacksAct->setShortcut(tr("Ctrl+F"));
fallbacksAct->setCheckable(true);
fallbacksAct->setEnabled(false);
- connect(fallbacksAct, SIGNAL(triggered(bool)),
- settingsTree, SLOT(setFallbacksEnabled(bool)));
-
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
-#ifndef Q_OS_MAC
- openPropertyListAct->setEnabled(false);
-#endif
-#ifndef Q_OS_WIN
- openRegistryPathAct->setEnabled(false);
-#endif
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(openSettingsAct);
- fileMenu->addAction(openIniFileAct);
- fileMenu->addAction(openPropertyListAct);
- fileMenu->addAction(openRegistryPathAct);
- fileMenu->addSeparator();
- fileMenu->addAction(refreshAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- optionsMenu = menuBar()->addMenu(tr("&Options"));
- optionsMenu->addAction(autoRefreshAct);
- optionsMenu->addAction(fallbacksAct);
-
- menuBar()->addSeparator();
+ connect(fallbacksAct, &QAction::triggered,
+ settingsTree, &SettingsTree::setFallbacksEnabled);
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QCoreApplication::quit);
}
-void MainWindow::setSettingsObject(QSettings *settings)
+void MainWindow::setSettingsObject(const SettingsPtr &settings)
{
settings->setFallbacksEnabled(fallbacksAct->isChecked());
settingsTree->setSettingsObject(settings);
@@ -209,14 +191,14 @@ void MainWindow::setSettingsObject(QSettings *settings)
refreshAct->setEnabled(true);
autoRefreshAct->setEnabled(true);
- QString niceName = settings->fileName();
- niceName.replace("\\", "/");
- int pos = niceName.lastIndexOf("/");
+ QString niceName = QDir::cleanPath(settings->fileName());
+ int pos = niceName.lastIndexOf(QLatin1Char('/'));
if (pos != -1)
niceName.remove(0, pos + 1);
if (!settings->isWritable())
niceName = tr("%1 (read only)").arg(niceName);
- setWindowTitle(tr("%1 - %2").arg(niceName).arg(tr("Settings Editor")));
+ setWindowTitle(tr("%1 - %2").arg(niceName, QCoreApplication::applicationName()));
+ statusBar()->showMessage(tr("Opened \"%1\"").arg(QDir::toNativeSeparators(settings->fileName())));
}
diff --git a/examples/widgets/tools/settingseditor/mainwindow.h b/examples/widgets/tools/settingseditor/mainwindow.h
index 55180c3771..4b1a28dfba 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.h
+++ b/examples/widgets/tools/settingseditor/mainwindow.h
@@ -42,10 +42,10 @@
#define MAINWINDOW_H
#include <QMainWindow>
+#include <QSharedPointer>
QT_BEGIN_NAMESPACE
class QAction;
-class QMenu;
class QSettings;
QT_END_NAMESPACE
class LocationDialog;
@@ -56,6 +56,8 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
+ typedef QSharedPointer<QSettings> SettingsPtr;
+
MainWindow();
private slots:
@@ -67,25 +69,13 @@ private slots:
private:
void createActions();
- void createMenus();
- void setSettingsObject(QSettings *settings);
+ void setSettingsObject(const SettingsPtr &settings);
SettingsTree *settingsTree;
LocationDialog *locationDialog;
-
- QMenu *fileMenu;
- QMenu *optionsMenu;
- QMenu *helpMenu;
- QAction *openSettingsAct;
- QAction *openIniFileAct;
- QAction *openPropertyListAct;
- QAction *openRegistryPathAct;
QAction *refreshAct;
- QAction *exitAct;
QAction *autoRefreshAct;
QAction *fallbacksAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
#endif
diff --git a/examples/widgets/tools/settingseditor/settingstree.cpp b/examples/widgets/tools/settingseditor/settingstree.cpp
index d9d53968ef..b75e3bdc54 100644
--- a/examples/widgets/tools/settingseditor/settingstree.cpp
+++ b/examples/widgets/tools/settingseditor/settingstree.cpp
@@ -45,18 +45,18 @@
SettingsTree::SettingsTree(QWidget *parent)
: QTreeWidget(parent)
+ , autoRefresh(false)
{
setItemDelegate(new VariantDelegate(this));
QStringList labels;
labels << tr("Setting") << tr("Type") << tr("Value");
setHeaderLabels(labels);
- header()->setSectionResizeMode(0, QHeaderView::Stretch);
+ header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(2, QHeaderView::Stretch);
- settings = 0;
refreshTimer.setInterval(2000);
- autoRefresh = false;
groupIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),
QIcon::Normal, QIcon::Off);
@@ -64,34 +64,37 @@ SettingsTree::SettingsTree(QWidget *parent)
QIcon::Normal, QIcon::On);
keyIcon.addPixmap(style()->standardPixmap(QStyle::SP_FileIcon));
- connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(maybeRefresh()));
+ connect(&refreshTimer, &QTimer::timeout, this, &SettingsTree::maybeRefresh);
}
-void SettingsTree::setSettingsObject(QSettings *settings)
+SettingsTree::~SettingsTree()
{
- delete this->settings;
- this->settings = settings;
+}
+
+void SettingsTree::setSettingsObject(const SettingsPtr &newSettings)
+{
+ settings = newSettings;
clear();
- if (settings) {
- settings->setParent(this);
+ if (settings.isNull()) {
+ refreshTimer.stop();
+ } else {
refresh();
if (autoRefresh)
refreshTimer.start();
- } else {
- refreshTimer.stop();
}
}
QSize SettingsTree::sizeHint() const
{
- return QSize(800, 600);
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ return QSize(availableGeometry.width() * 2 / 3, availableGeometry.height() * 2 / 3);
}
void SettingsTree::setAutoRefresh(bool autoRefresh)
{
this->autoRefresh = autoRefresh;
- if (settings) {
+ if (!settings.isNull()) {
if (autoRefresh) {
maybeRefresh();
refreshTimer.start();
@@ -103,7 +106,7 @@ void SettingsTree::setAutoRefresh(bool autoRefresh)
void SettingsTree::setFallbacksEnabled(bool enabled)
{
- if (settings) {
+ if (!settings.isNull()) {
settings->setFallbacksEnabled(enabled);
refresh();
}
@@ -117,17 +120,17 @@ void SettingsTree::maybeRefresh()
void SettingsTree::refresh()
{
- if (!settings)
+ if (settings.isNull())
return;
- disconnect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
- this, SLOT(updateSetting(QTreeWidgetItem*)));
+ disconnect(this, &QTreeWidget::itemChanged,
+ this, &SettingsTree::updateSetting);
settings->sync();
updateChildItems(0);
- connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
- this, SLOT(updateSetting(QTreeWidgetItem*)));
+ connect(this, &QTreeWidget::itemChanged,
+ this, &SettingsTree::updateSetting);
}
bool SettingsTree::event(QEvent *event)
@@ -144,7 +147,7 @@ void SettingsTree::updateSetting(QTreeWidgetItem *item)
QString key = item->text(0);
QTreeWidgetItem *ancestor = item->parent();
while (ancestor) {
- key.prepend(ancestor->text(0) + "/");
+ key.prepend(ancestor->text(0) + QLatin1Char('/'));
ancestor = ancestor->parent();
}
@@ -162,8 +165,8 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
int childIndex = findChild(parent, group, dividerIndex);
if (childIndex != -1) {
child = childAt(parent, childIndex);
- child->setText(1, "");
- child->setText(2, "");
+ child->setText(1, QString());
+ child->setText(2, QString());
child->setData(2, Qt::UserRole, QVariant());
moveItemForward(parent, childIndex, dividerIndex);
} else {
@@ -177,7 +180,7 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
settings->endGroup();
}
- foreach (QString key, settings->childKeys()) {
+ foreach (const QString &key, settings->childKeys()) {
QTreeWidgetItem *child;
int childIndex = findChild(parent, key, 0);
diff --git a/examples/widgets/tools/settingseditor/settingstree.h b/examples/widgets/tools/settingseditor/settingstree.h
index 2a64a5a496..4f542d2543 100644
--- a/examples/widgets/tools/settingseditor/settingstree.h
+++ b/examples/widgets/tools/settingseditor/settingstree.h
@@ -44,6 +44,7 @@
#include <QIcon>
#include <QTimer>
#include <QTreeWidget>
+#include <QSharedPointer>
QT_BEGIN_NAMESPACE
class QSettings;
@@ -54,9 +55,12 @@ class SettingsTree : public QTreeWidget
Q_OBJECT
public:
+ typedef QSharedPointer<QSettings> SettingsPtr;
+
SettingsTree(QWidget *parent = 0);
+ ~SettingsTree();
- void setSettingsObject(QSettings *settings);
+ void setSettingsObject(const SettingsPtr &settings);
QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
@@ -80,7 +84,7 @@ private:
int findChild(QTreeWidgetItem *parent, const QString &text, int startIndex);
void moveItemForward(QTreeWidgetItem *parent, int oldIndex, int newIndex);
- QSettings *settings;
+ SettingsPtr settings;
QTimer refreshTimer;
bool autoRefresh;
QIcon groupIcon;
diff --git a/examples/widgets/tools/settingseditor/variantdelegate.cpp b/examples/widgets/tools/settingseditor/variantdelegate.cpp
index f68082c660..fe2391762b 100644
--- a/examples/widgets/tools/settingseditor/variantdelegate.cpp
+++ b/examples/widgets/tools/settingseditor/variantdelegate.cpp
@@ -60,7 +60,7 @@ VariantDelegate::VariantDelegate(QObject *parent)
dateExp.setPattern("([0-9]{,4})-([0-9]{,2})-([0-9]{,2})");
timeExp.setPattern("([0-9]{,2}):([0-9]{,2}):([0-9]{,2})");
- dateTimeExp.setPattern(dateExp.pattern() + "T" + timeExp.pattern());
+ dateTimeExp.setPattern(dateExp.pattern() + 'T' + timeExp.pattern());
}
void VariantDelegate::paint(QPainter *painter,
@@ -217,7 +217,7 @@ void VariantDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
value = QSize(sizeExp.cap(1).toInt(), sizeExp.cap(2).toInt());
break;
case QVariant::StringList:
- value = text.split(",");
+ value = text.split(',');
break;
case QVariant::Time:
{
diff --git a/examples/widgets/tools/tools.pro b/examples/widgets/tools/tools.pro
index 7178411110..282f8dedea 100644
--- a/examples/widgets/tools/tools.pro
+++ b/examples/widgets/tools/tools.pro
@@ -8,6 +8,7 @@ SUBDIRS = \
plugandpaintplugins \
plugandpaint \
regexp \
+ regularexpression \
settingseditor \
styleplugin \
treemodelcompleter \
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
index 45ded876a7..2953ecd7de 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
@@ -370,7 +370,6 @@ void AddressBook::loadFromFile()
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_3);
- contacts.empty(); // empty existing contacts
in >> contacts;
QMap<QString, QString>::iterator i = contacts.begin();
@@ -422,23 +421,23 @@ void AddressBook::exportAsVCard()
//! [export function part2]
//! [export function part3]
- out << "BEGIN:VCARD" << "\n";
- out << "VERSION:2.1" << "\n";
- out << "N:" << lastName << ";" << firstName << "\n";
+ out << "BEGIN:VCARD" << '\n';
+ out << "VERSION:2.1" << '\n';
+ out << "N:" << lastName << ';' << firstName << '\n';
if (!nameList.isEmpty())
- out << "FN:" << nameList.join(' ') << "\n";
+ out << "FN:" << nameList.join(' ') << '\n';
else
- out << "FN:" << firstName << "\n";
+ out << "FN:" << firstName << '\n';
//! [export function part3]
//! [export function part4]
address.replace(";", "\\;", Qt::CaseInsensitive);
- address.replace("\n", ";", Qt::CaseInsensitive);
+ address.replace('\n', ";", Qt::CaseInsensitive);
address.replace(",", " ", Qt::CaseInsensitive);
- out << "ADR;HOME:;" << address << "\n";
- out << "END:VCARD" << "\n";
+ out << "ADR;HOME:;" << address << '\n';
+ out << "END:VCARD" << '\n';
QMessageBox::information(this, tr("Export Successful"),
tr("\"%1\" has been exported as a vCard.").arg(name));
diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
index 5eb677bb9d..c04c77772f 100644
--- a/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
+++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.cpp
@@ -83,7 +83,7 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
{
for(int col= 0; col < COLS; col++)
{
- result += m_gridData[row][col] + " ";
+ result += m_gridData[row][col] + ' ';
}
}
emit editCompleted( result );
diff --git a/examples/widgets/widgets/calculator/calculator.cpp b/examples/widgets/widgets/calculator/calculator.cpp
index e76011ee0d..87061a9868 100644
--- a/examples/widgets/widgets/calculator/calculator.cpp
+++ b/examples/widgets/widgets/calculator/calculator.cpp
@@ -276,7 +276,7 @@ void Calculator::pointClicked()
{
if (waitingForOperand)
display->setText("0");
- if (!display->text().contains("."))
+ if (!display->text().contains('.'))
display->setText(display->text() + tr("."));
waitingForOperand = false;
}
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.cpp b/examples/widgets/widgets/icons/iconpreviewarea.cpp
index 0736261a02..090615e64d 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.cpp
+++ b/examples/widgets/widgets/icons/iconpreviewarea.cpp
@@ -46,33 +46,95 @@
IconPreviewArea::IconPreviewArea(QWidget *parent)
: QWidget(parent)
{
- QGridLayout *mainLayout = new QGridLayout;
- setLayout(mainLayout);
+ QGridLayout *mainLayout = new QGridLayout(this);
- stateLabels[0] = createHeaderLabel(tr("Off"));
- stateLabels[1] = createHeaderLabel(tr("On"));
+ for (int row = 0; row < NumStates; ++row) {
+ stateLabels[row] = createHeaderLabel(IconPreviewArea::iconStateNames().at(row));
+ mainLayout->addWidget(stateLabels[row], row + 1, 0);
+ }
Q_ASSERT(NumStates == 2);
- modeLabels[0] = createHeaderLabel(tr("Normal"));
- modeLabels[1] = createHeaderLabel(tr("Active"));
- modeLabels[2] = createHeaderLabel(tr("Disabled"));
- modeLabels[3] = createHeaderLabel(tr("Selected"));
+ for (int column = 0; column < NumModes; ++column) {
+ modeLabels[column] = createHeaderLabel(IconPreviewArea::iconModeNames().at(column));
+ mainLayout->addWidget(modeLabels[column], 0, column + 1);
+ }
Q_ASSERT(NumModes == 4);
- for (int j = 0; j < NumStates; ++j)
- mainLayout->addWidget(stateLabels[j], j + 1, 0);
-
- for (int i = 0; i < NumModes; ++i) {
- mainLayout->addWidget(modeLabels[i], 0, i + 1);
-
- for (int j = 0; j < NumStates; ++j) {
- pixmapLabels[i][j] = createPixmapLabel();
- mainLayout->addWidget(pixmapLabels[i][j], j + 1, i + 1);
+ for (int column = 0; column < NumModes; ++column) {
+ for (int row = 0; row < NumStates; ++row) {
+ pixmapLabels[column][row] = createPixmapLabel();
+ mainLayout->addWidget(pixmapLabels[column][row], row + 1, column + 1);
}
}
}
//! [0]
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+
+//! [42]
+QVector<QIcon::Mode> IconPreviewArea::iconModes()
+{
+ static const QVector<QIcon::Mode> result = {QIcon::Normal, QIcon::Active, QIcon::Disabled, QIcon::Selected};
+ return result;
+}
+
+QVector<QIcon::State> IconPreviewArea::iconStates()
+{
+ static const QVector<QIcon::State> result = {QIcon::Off, QIcon::On};
+ return result;
+}
+
+QStringList IconPreviewArea::iconModeNames()
+{
+ static const QStringList result = {tr("Normal"), tr("Active"), tr("Disabled"), tr("Selected")};
+ return result;
+}
+
+QStringList IconPreviewArea::iconStateNames()
+{
+ static const QStringList result = {tr("Off"), tr("On")};
+ return result;
+}
+//! [42]
+
+#else // Q_COMPILER_INITIALIZER_LISTS
+
+//! [43]
+QVector<QIcon::Mode> IconPreviewArea::iconModes()
+{
+ static QVector<QIcon::Mode> result;
+ if (result.isEmpty())
+ result << QIcon::Normal << QIcon::Active << QIcon::Disabled << QIcon::Selected;
+ return result;
+}
+//! [43]
+
+QVector<QIcon::State> IconPreviewArea::iconStates()
+{
+ static QVector<QIcon::State> result;
+ if (result.isEmpty())
+ result << QIcon::Off << QIcon::On;
+ return result;
+}
+
+QStringList IconPreviewArea::iconModeNames()
+{
+ static QStringList result;
+ if (result.isEmpty())
+ result << tr("Normal") << tr("Active") << tr("Disabled") << tr("Selected");
+ return result;
+}
+
+QStringList IconPreviewArea::iconStateNames()
+{
+ static QStringList result;
+ if (result.isEmpty())
+ result << tr("Off") << tr("On");
+ return result;
+}
+
+#endif // !Q_COMPILER_INITIALIZER_LISTS
+
//! [1]
void IconPreviewArea::setIcon(const QIcon &icon)
{
@@ -118,23 +180,27 @@ QLabel *IconPreviewArea::createPixmapLabel()
//! [5]
void IconPreviewArea::updatePixmapLabels()
{
- for (int i = 0; i < NumModes; ++i) {
- QIcon::Mode mode;
- if (i == 0) {
- mode = QIcon::Normal;
- } else if (i == 1) {
- mode = QIcon::Active;
- } else if (i == 2) {
- mode = QIcon::Disabled;
- } else {
- mode = QIcon::Selected;
- }
-
- for (int j = 0; j < NumStates; ++j) {
- QIcon::State state = (j == 0) ? QIcon::Off : QIcon::On;
- QPixmap pixmap = icon.pixmap(size, mode, state);
- pixmapLabels[i][j]->setPixmap(pixmap);
- pixmapLabels[i][j]->setEnabled(!pixmap.isNull());
+ QWindow *window = Q_NULLPTR;
+ if (const QWidget *nativeParent = nativeParentWidget())
+ window = nativeParent->windowHandle();
+ for (int column = 0; column < NumModes; ++column) {
+ for (int row = 0; row < NumStates; ++row) {
+ const QPixmap pixmap =
+ icon.pixmap(window, size, IconPreviewArea::iconModes().at(column),
+ IconPreviewArea::iconStates().at(row));
+ QLabel *pixmapLabel = pixmapLabels[column][row];
+ pixmapLabel->setPixmap(pixmap);
+ pixmapLabel->setEnabled(!pixmap.isNull());
+ QString toolTip;
+ if (!pixmap.isNull()) {
+ const QSize actualSize = icon.actualSize(size);
+ toolTip =
+ tr("Size: %1x%2\nActual size: %3x%4\nDevice pixel ratio: %5")
+ .arg(size.width()).arg(size.height())
+ .arg(actualSize.width()).arg(actualSize.height())
+ .arg(pixmap.devicePixelRatioF());
+ }
+ pixmapLabel->setToolTip(toolTip);
}
}
}
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.h b/examples/widgets/widgets/icons/iconpreviewarea.h
index c2e0a7b79d..693f8811d8 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.h
+++ b/examples/widgets/widgets/icons/iconpreviewarea.h
@@ -43,6 +43,8 @@
#include <QIcon>
#include <QWidget>
+#include <QStringList>
+#include <QVector>
QT_BEGIN_NAMESPACE
class QLabel;
@@ -54,11 +56,16 @@ class IconPreviewArea : public QWidget
Q_OBJECT
public:
- IconPreviewArea(QWidget *parent = 0);
+ explicit IconPreviewArea(QWidget *parent = Q_NULLPTR);
void setIcon(const QIcon &icon);
void setSize(const QSize &size);
+ static QVector<QIcon::Mode> iconModes();
+ static QVector<QIcon::State> iconStates();
+ static QStringList iconModeNames();
+ static QStringList iconStateNames();
+
private:
QLabel *createHeaderLabel(const QString &text);
QLabel *createPixmapLabel();
diff --git a/examples/widgets/widgets/icons/icons.pro b/examples/widgets/widgets/icons/icons.pro
index 21165163aa..4ee95592c8 100644
--- a/examples/widgets/widgets/icons/icons.pro
+++ b/examples/widgets/widgets/icons/icons.pro
@@ -10,6 +10,8 @@ SOURCES = iconpreviewarea.cpp \
main.cpp \
mainwindow.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
EXAMPLE_FILES = images/*
# install
@@ -24,5 +26,5 @@ wince {
} else {
imageFiles.path = images
}
- DEPLOYMENT += imageFiles
+ INSTALLS += imageFiles
}
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.cpp b/examples/widgets/widgets/icons/iconsizespinbox.cpp
index f3796040b3..1916803eea 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.cpp
+++ b/examples/widgets/widgets/icons/iconsizespinbox.cpp
@@ -52,13 +52,13 @@ IconSizeSpinBox::IconSizeSpinBox(QWidget *parent)
//! [1]
int IconSizeSpinBox::valueFromText(const QString &text) const
{
- QRegExp regExp(tr("(\\d+)(\\s*[xx]\\s*\\d+)?"));
+ static const QRegularExpression regExp(tr("(\\d+)(\\s*[xx]\\s*\\d+)?"));
+ Q_ASSERT(regExp.isValid());
- if (regExp.exactMatch(text)) {
- return regExp.cap(1).toInt();
- } else {
- return 0;
- }
+ const QRegularExpressionMatch match = regExp.match(text);
+ if (match.isValid())
+ return match.captured(1).toInt();
+ return 0;
}
//! [1]
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.h b/examples/widgets/widgets/icons/iconsizespinbox.h
index 08105c771c..96b277de39 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.h
+++ b/examples/widgets/widgets/icons/iconsizespinbox.h
@@ -49,7 +49,7 @@ class IconSizeSpinBox : public QSpinBox
Q_OBJECT
public:
- IconSizeSpinBox(QWidget *parent = 0);
+ explicit IconSizeSpinBox(QWidget *parent = Q_NULLPTR);
int valueFromText(const QString &text) const Q_DECL_OVERRIDE;
QString textFromValue(int value) const Q_DECL_OVERRIDE;
diff --git a/examples/widgets/widgets/icons/imagedelegate.cpp b/examples/widgets/widgets/icons/imagedelegate.cpp
index a6df8f3b04..7c393594ca 100644
--- a/examples/widgets/widgets/icons/imagedelegate.cpp
+++ b/examples/widgets/widgets/icons/imagedelegate.cpp
@@ -41,6 +41,7 @@
#include <QtWidgets>
#include "imagedelegate.h"
+#include "iconpreviewarea.h"
//! [0]
ImageDelegate::ImageDelegate(QObject *parent)
@@ -55,17 +56,14 @@ QWidget *ImageDelegate::createEditor(QWidget *parent,
const QModelIndex &index) const
{
QComboBox *comboBox = new QComboBox(parent);
- if (index.column() == 1) {
- comboBox->addItem(tr("Normal"));
- comboBox->addItem(tr("Active"));
- comboBox->addItem(tr("Disabled"));
- comboBox->addItem(tr("Selected"));
- } else if (index.column() == 2) {
- comboBox->addItem(tr("Off"));
- comboBox->addItem(tr("On"));
- }
+ if (index.column() == 1)
+ comboBox->addItems(IconPreviewArea::iconModeNames());
+ else if (index.column() == 2)
+ comboBox->addItems(IconPreviewArea::iconStateNames());
- connect(comboBox, SIGNAL(activated(int)), this, SLOT(emitCommitData()));
+ typedef void (QComboBox::*QComboBoxIntSignal)(int);
+ connect(comboBox, static_cast<QComboBoxIntSignal>(&QComboBox::activated),
+ this, &ImageDelegate::emitCommitData);
return comboBox;
}
diff --git a/examples/widgets/widgets/icons/imagedelegate.h b/examples/widgets/widgets/icons/imagedelegate.h
index a828251013..ed1d8210d5 100644
--- a/examples/widgets/widgets/icons/imagedelegate.h
+++ b/examples/widgets/widgets/icons/imagedelegate.h
@@ -49,7 +49,7 @@ class ImageDelegate : public QItemDelegate
Q_OBJECT
public:
- ImageDelegate(QObject *parent = 0);
+ explicit ImageDelegate(QObject *parent = Q_NULLPTR);
//! [0]
//! [1]
diff --git a/examples/widgets/widgets/icons/main.cpp b/examples/widgets/widgets/icons/main.cpp
index 842a474405..d6a823f1c7 100644
--- a/examples/widgets/widgets/icons/main.cpp
+++ b/examples/widgets/widgets/icons/main.cpp
@@ -39,13 +39,39 @@
****************************************************************************/
#include <QApplication>
+#include <QCommandLineParser>
+#include <QDesktopWidget>
#include "mainwindow.h"
+//! [45]
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QCoreApplication::setApplicationName(MainWindow::tr("Icons"));
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser commandLineParser;
+ commandLineParser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
+ commandLineParser.addHelpOption();
+ commandLineParser.addVersionOption();
+ QCommandLineOption noHighDpiPixmapOption("no-highdpi-pixmaps",
+ "Disable High DPI image loading (Qt::AA_UseHighDpiPixmaps)");
+ commandLineParser.addOption(noHighDpiPixmapOption);
+ commandLineParser.addPositionalArgument(MainWindow::tr("[file]"), MainWindow::tr("Icon file(s) to open."));
+ commandLineParser.process(QCoreApplication::arguments());
+
+ if (!commandLineParser.isSet(noHighDpiPixmapOption))
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
MainWindow mainWin;
+ if (!commandLineParser.positionalArguments().isEmpty())
+ mainWin.loadImages(commandLineParser.positionalArguments());
+
+ const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mainWin);
+ mainWin.resize(availableGeometry.width() / 2, availableGeometry.height() * 2 / 3);
+ mainWin.move((availableGeometry.width() - mainWin.width()) / 2, (availableGeometry.height() - mainWin.height()) / 2);
+
mainWin.show();
return app.exec();
}
+//! [45]
diff --git a/examples/widgets/widgets/icons/mainwindow.cpp b/examples/widgets/widgets/icons/mainwindow.cpp
index 86d18cd62a..4c76b0ee16 100644
--- a/examples/widgets/widgets/icons/mainwindow.cpp
+++ b/examples/widgets/widgets/icons/mainwindow.cpp
@@ -45,34 +45,49 @@
#include "imagedelegate.h"
#include "mainwindow.h"
+//! [40]
+enum { OtherSize = QStyle::PM_CustomBase };
+//! [40]
+
//! [0]
MainWindow::MainWindow()
{
- centralWidget = new QWidget;
+ QWidget *centralWidget = new QWidget(this);
setCentralWidget(centralWidget);
- createPreviewGroupBox();
- createImagesGroupBox();
- createIconSizeGroupBox();
-
createActions();
- createMenus();
- createContextMenu();
- QGridLayout *mainLayout = new QGridLayout;
+ QGridLayout *mainLayout = new QGridLayout(centralWidget);
+
+ QGroupBox *previewGroupBox = new QGroupBox(tr("Preview"));
+ previewArea = new IconPreviewArea(previewGroupBox);
+ QVBoxLayout *previewLayout = new QVBoxLayout(previewGroupBox);
+ previewLayout->addWidget(previewArea);
+
mainLayout->addWidget(previewGroupBox, 0, 0, 1, 2);
- mainLayout->addWidget(imagesGroupBox, 1, 0);
- mainLayout->addWidget(iconSizeGroupBox, 1, 1);
- centralWidget->setLayout(mainLayout);
+ mainLayout->addWidget(createImagesGroupBox(), 1, 0);
+ QVBoxLayout *vBox = new QVBoxLayout;
+ vBox->addWidget(createIconSizeGroupBox());
+ vBox->addWidget(createHighDpiIconSizeGroupBox());
+ vBox->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
+ mainLayout->addLayout(vBox, 1, 1);
+ createContextMenu();
setWindowTitle(tr("Icons"));
checkCurrentStyle();
- otherRadioButton->click();
-
- resize(minimumSizeHint());
+ sizeButtonGroup->button(OtherSize)->click();
}
//! [0]
+//! [44]
+void MainWindow::show()
+{
+ QMainWindow::show();
+ connect(windowHandle(), &QWindow::screenChanged, this, &MainWindow::screenChanged);
+ screenChanged();
+}
+//! [44]
+
//! [1]
void MainWindow::about()
{
@@ -89,60 +104,62 @@ void MainWindow::changeStyle(bool checked)
if (!checked)
return;
- QAction *action = qobject_cast<QAction *>(sender());
+ const QAction *action = qobject_cast<QAction *>(sender());
//! [2] //! [3]
QStyle *style = QStyleFactory::create(action->data().toString());
//! [3] //! [4]
Q_ASSERT(style);
QApplication::setStyle(style);
- smallRadioButton->setText(tr("Small (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_SmallIconSize)));
- largeRadioButton->setText(tr("Large (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_LargeIconSize)));
- toolBarRadioButton->setText(tr("Toolbars (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_ToolBarIconSize)));
- listViewRadioButton->setText(tr("List views (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_ListViewIconSize)));
- iconViewRadioButton->setText(tr("Icon views (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_IconViewIconSize)));
- tabBarRadioButton->setText(tr("Tab bars (%1 x %1)")
- .arg(style->pixelMetric(QStyle::PM_TabBarIconSize)));
-
- changeSize();
+ foreach (QAbstractButton *button, sizeButtonGroup->buttons()) {
+ const QStyle::PixelMetric metric = static_cast<QStyle::PixelMetric>(sizeButtonGroup->id(button));
+ const int value = style->pixelMetric(metric);
+ switch (metric) {
+ case QStyle::PM_SmallIconSize:
+ button->setText(tr("Small (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_LargeIconSize:
+ button->setText(tr("Large (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_ToolBarIconSize:
+ button->setText(tr("Toolbars (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_ListViewIconSize:
+ button->setText(tr("List views (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_IconViewIconSize:
+ button->setText(tr("Icon views (%1 x %1)").arg(value));
+ break;
+ case QStyle::PM_TabBarIconSize:
+ button->setText(tr("Tab bars (%1 x %1)").arg(value));
+ break;
+ default:
+ break;
+ }
+ }
+
+ triggerChangeSize();
}
//! [4]
//! [5]
-void MainWindow::changeSize(bool checked)
+void MainWindow::changeSize(int id, bool checked)
{
if (!checked)
return;
- int extent;
-
- if (otherRadioButton->isChecked()) {
- extent = otherSpinBox->value();
- } else {
- QStyle::PixelMetric metric;
-
- if (smallRadioButton->isChecked()) {
- metric = QStyle::PM_SmallIconSize;
- } else if (largeRadioButton->isChecked()) {
- metric = QStyle::PM_LargeIconSize;
- } else if (toolBarRadioButton->isChecked()) {
- metric = QStyle::PM_ToolBarIconSize;
- } else if (listViewRadioButton->isChecked()) {
- metric = QStyle::PM_ListViewIconSize;
- } else if (iconViewRadioButton->isChecked()) {
- metric = QStyle::PM_IconViewIconSize;
- } else {
- metric = QStyle::PM_TabBarIconSize;
- }
- extent = QApplication::style()->pixelMetric(metric);
- }
+ const bool other = id == int(OtherSize);
+ const int extent = other
+ ? otherSpinBox->value()
+ : QApplication::style()->pixelMetric(static_cast<QStyle::PixelMetric>(id));
+
previewArea->setSize(QSize(extent, extent));
- otherSpinBox->setEnabled(otherRadioButton->isChecked());
+ otherSpinBox->setEnabled(other);
+}
+
+void MainWindow::triggerChangeSize()
+{
+ changeSize(sizeButtonGroup->checkedId(), true);
}
//! [5]
@@ -152,33 +169,21 @@ void MainWindow::changeIcon()
QIcon icon;
for (int row = 0; row < imagesTable->rowCount(); ++row) {
- QTableWidgetItem *item0 = imagesTable->item(row, 0);
- QTableWidgetItem *item1 = imagesTable->item(row, 1);
- QTableWidgetItem *item2 = imagesTable->item(row, 2);
-
- if (item0->checkState() == Qt::Checked) {
- QIcon::Mode mode;
- if (item1->text() == tr("Normal")) {
- mode = QIcon::Normal;
- } else if (item1->text() == tr("Active")) {
- mode = QIcon::Active;
- } else if (item1->text() == tr("Disabled")) {
- mode = QIcon::Disabled;
- } else {
- mode = QIcon::Selected;
- }
-
- QIcon::State state;
- if (item2->text() == tr("On")) {
- state = QIcon::On;
- } else {
- state = QIcon::Off;
-//! [6] //! [7]
- }
-//! [7]
+ const QTableWidgetItem *fileItem = imagesTable->item(row, 0);
+ const QTableWidgetItem *modeItem = imagesTable->item(row, 1);
+ const QTableWidgetItem *stateItem = imagesTable->item(row, 2);
+
+ if (fileItem->checkState() == Qt::Checked) {
+ const int modeIndex = IconPreviewArea::iconModeNames().indexOf(modeItem->text());
+ Q_ASSERT(modeIndex >= 0);
+ const int stateIndex = IconPreviewArea::iconStateNames().indexOf(stateItem->text());
+ Q_ASSERT(stateIndex >= 0);
+ const QIcon::Mode mode = IconPreviewArea::iconModes().at(modeIndex);
+ const QIcon::State state = IconPreviewArea::iconStates().at(stateIndex);
+//! [6]
//! [8]
- QString fileName = item0->data(Qt::UserRole).toString();
+ const QString fileName = fileItem->data(Qt::UserRole).toString();
QImage image(fileName);
if (!image.isNull())
icon.addPixmap(QPixmap::fromImage(image), mode, state);
@@ -193,61 +198,109 @@ void MainWindow::changeIcon()
}
//! [11]
+void MainWindow::addSampleImages()
+{
+ addImages(QLatin1String(SRCDIR) + QLatin1String("/images"));
+}
+
+void MainWindow::addOtherImages()
+{
+ static bool firstInvocation = true;
+ QString directory;
+ if (firstInvocation) {
+ firstInvocation = false;
+ directory = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).value(0, QString());
+ }
+ addImages(directory);
+}
+
//! [12]
-void MainWindow::addImages()
+void MainWindow::addImages(const QString &directory)
{
- QStringList fileNames = QFileDialog::getOpenFileNames(this,
- tr("Open Images"), "",
- tr("Images (*.png *.xpm *.jpg);;"
- "All Files (*)"));
- if (!fileNames.isEmpty()) {
- foreach (QString fileName, fileNames) {
- int row = imagesTable->rowCount();
- imagesTable->setRowCount(row + 1);
+ QFileDialog fileDialog(this, tr("Open Images"), directory);
+ QStringList mimeTypeFilters;
+ foreach (const QByteArray &mimeTypeName, QImageReader::supportedMimeTypes())
+ mimeTypeFilters.append(mimeTypeName);
+ mimeTypeFilters.sort();
+ fileDialog.setMimeTypeFilters(mimeTypeFilters);
+ fileDialog.selectMimeTypeFilter(QLatin1String("image/png"));
+ fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
+ fileDialog.setFileMode(QFileDialog::ExistingFiles);
+ if (!nativeFileDialogAct->isChecked())
+ fileDialog.setOption(QFileDialog::DontUseNativeDialog);
+ if (fileDialog.exec() == QDialog::Accepted)
+ loadImages(fileDialog.selectedFiles());
//! [12]
+}
+void MainWindow::loadImages(const QStringList &fileNames)
+{
+ foreach (const QString &fileName, fileNames) {
+ const int row = imagesTable->rowCount();
+ imagesTable->setRowCount(row + 1);
//! [13]
- QString imageName = QFileInfo(fileName).baseName();
+ const QFileInfo fileInfo(fileName);
+ const QString imageName = fileInfo.baseName();
+ const QString fileName2x = fileInfo.absolutePath()
+ + QLatin1Char('/') + imageName + QLatin1String("@2x.") + fileInfo.suffix();
+ const QFileInfo fileInfo2x(fileName2x);
+ const QImage image(fileName);
+ const QString toolTip =
+ tr("Directory: %1\nFile: %2\nFile@2x: %3\nSize: %4x%5")
+ .arg(QDir::toNativeSeparators(fileInfo.absolutePath()), fileInfo.fileName())
+ .arg(fileInfo2x.exists() ? fileInfo2x.fileName() : tr("<None>"))
+ .arg(image.width()).arg(image.height());
//! [13] //! [14]
- QTableWidgetItem *item0 = new QTableWidgetItem(imageName);
- item0->setData(Qt::UserRole, fileName);
- item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);
+ QTableWidgetItem *fileItem = new QTableWidgetItem(imageName);
+ fileItem->setData(Qt::UserRole, fileName);
+ fileItem->setIcon(QPixmap::fromImage(image));
+ fileItem->setFlags((fileItem->flags() | Qt::ItemIsUserCheckable) & ~Qt::ItemIsEditable);
+ fileItem->setToolTip(toolTip);
//! [14]
//! [15]
- QTableWidgetItem *item1 = new QTableWidgetItem(tr("Normal"));
+ QIcon::Mode mode = QIcon::Normal;
//! [15] //! [16]
- QTableWidgetItem *item2 = new QTableWidgetItem(tr("Off"));
-
- if (guessModeStateAct->isChecked()) {
- if (fileName.contains("_act")) {
- item1->setText(tr("Active"));
- } else if (fileName.contains("_dis")) {
- item1->setText(tr("Disabled"));
- } else if (fileName.contains("_sel")) {
- item1->setText(tr("Selected"));
- }
-
- if (fileName.contains("_on"))
- item2->setText(tr("On"));
+ QIcon::State state = QIcon::Off;
+ if (guessModeStateAct->isChecked()) {
+ if (imageName.contains(QLatin1String("_act"), Qt::CaseInsensitive))
+ mode = QIcon::Active;
+ else if (imageName.contains(QLatin1String("_dis"), Qt::CaseInsensitive))
+ mode = QIcon::Disabled;
+ else if (imageName.contains(QLatin1String("_sel"), Qt::CaseInsensitive))
+ mode = QIcon::Selected;
+
+ if (imageName.contains(QLatin1String("_on"), Qt::CaseInsensitive))
+ state = QIcon::On;
//! [16] //! [17]
- }
+ }
//! [17]
//! [18]
- imagesTable->setItem(row, 0, item0);
+ imagesTable->setItem(row, 0, fileItem);
//! [18] //! [19]
- imagesTable->setItem(row, 1, item1);
- imagesTable->setItem(row, 2, item2);
- imagesTable->openPersistentEditor(item1);
- imagesTable->openPersistentEditor(item2);
-
- item0->setCheckState(Qt::Checked);
- }
+ QTableWidgetItem *modeItem =
+ new QTableWidgetItem(IconPreviewArea::iconModeNames().at(IconPreviewArea::iconModes().indexOf(mode)));
+ modeItem->setToolTip(toolTip);
+ imagesTable->setItem(row, 1, modeItem);
+ QTableWidgetItem *stateItem =
+ new QTableWidgetItem(IconPreviewArea::iconStateNames().at(IconPreviewArea::iconStates().indexOf(state)));
+ stateItem->setToolTip(toolTip);
+ imagesTable->setItem(row, 2, stateItem);
+ imagesTable->openPersistentEditor(modeItem);
+ imagesTable->openPersistentEditor(stateItem);
+
+ fileItem->setCheckState(Qt::Checked);
}
}
//! [19]
+void MainWindow::useHighDpiPixmapsChanged(int checkState)
+{
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, checkState == Qt::Checked);
+ changeIcon();
+}
+
//! [20]
void MainWindow::removeAllImages()
{
@@ -256,21 +309,10 @@ void MainWindow::removeAllImages()
}
//! [20]
-void MainWindow::createPreviewGroupBox()
-{
- previewGroupBox = new QGroupBox(tr("Preview"));
-
- previewArea = new IconPreviewArea;
-
- QVBoxLayout *layout = new QVBoxLayout;
- layout->addWidget(previewArea);
- previewGroupBox->setLayout(layout);
-}
-
//! [21]
-void MainWindow::createImagesGroupBox()
+QWidget *MainWindow::createImagesGroupBox()
{
- imagesGroupBox = new QGroupBox(tr("Images"));
+ QGroupBox *imagesGroupBox = new QGroupBox(tr("Images"));
imagesTable = new QTableWidget;
imagesTable->setSelectionMode(QAbstractItemView::NoSelection);
@@ -292,57 +334,63 @@ void MainWindow::createImagesGroupBox()
//! [23]
//! [24]
- connect(imagesTable, SIGNAL(itemChanged(QTableWidgetItem*)),
+ connect(imagesTable, &QTableWidget::itemChanged,
//! [24] //! [25]
- this, SLOT(changeIcon()));
+ this, &MainWindow::changeIcon);
- QVBoxLayout *layout = new QVBoxLayout;
+ QVBoxLayout *layout = new QVBoxLayout(imagesGroupBox);
layout->addWidget(imagesTable);
- imagesGroupBox->setLayout(layout);
+ return imagesGroupBox;
}
//! [25]
//! [26]
-void MainWindow::createIconSizeGroupBox()
+QWidget *MainWindow::createIconSizeGroupBox()
{
- iconSizeGroupBox = new QGroupBox(tr("Icon Size"));
-
- smallRadioButton = new QRadioButton;
- largeRadioButton = new QRadioButton;
- toolBarRadioButton = new QRadioButton;
- listViewRadioButton = new QRadioButton;
- iconViewRadioButton = new QRadioButton;
- tabBarRadioButton = new QRadioButton;
- otherRadioButton = new QRadioButton(tr("Other:"));
-
+ QGroupBox *iconSizeGroupBox = new QGroupBox(tr("Icon Size"));
+
+ sizeButtonGroup = new QButtonGroup(this);
+ sizeButtonGroup->setExclusive(true);
+
+ typedef void (QButtonGroup::*QButtonGroupIntBoolSignal)(int, bool);
+ connect(sizeButtonGroup, static_cast<QButtonGroupIntBoolSignal>(&QButtonGroup::buttonToggled),
+ this, &MainWindow::changeSize);
+
+ QRadioButton *smallRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(smallRadioButton, QStyle::PM_SmallIconSize);
+ QRadioButton *largeRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(largeRadioButton, QStyle::PM_LargeIconSize);
+ QRadioButton *toolBarRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(toolBarRadioButton, QStyle::PM_ToolBarIconSize);
+ QRadioButton *listViewRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(listViewRadioButton, QStyle::PM_ListViewIconSize);
+ QRadioButton *iconViewRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(iconViewRadioButton, QStyle::PM_IconViewIconSize);
+ QRadioButton *tabBarRadioButton = new QRadioButton;
+ sizeButtonGroup->addButton(tabBarRadioButton, QStyle::PM_TabBarIconSize);
+ QRadioButton *otherRadioButton = new QRadioButton(tr("Other:"));
+ sizeButtonGroup->addButton(otherRadioButton, OtherSize);
otherSpinBox = new IconSizeSpinBox;
- otherSpinBox->setRange(8, 128);
+ otherSpinBox->setRange(8, 256);
+ const QString spinBoxToolTip =
+ tr("Enter a custom size within %1..%2")
+ .arg(otherSpinBox->minimum()).arg(otherSpinBox->maximum());
otherSpinBox->setValue(64);
+ otherSpinBox->setToolTip(spinBoxToolTip);
+ otherRadioButton->setToolTip(spinBoxToolTip);
//! [26]
//! [27]
- connect(smallRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(largeRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(toolBarRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(listViewRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(iconViewRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(tabBarRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(otherRadioButton, SIGNAL(toggled(bool)),
- this, SLOT(changeSize(bool)));
- connect(otherSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeSize()));
+ typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
+ connect(otherSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
+ this, &MainWindow::triggerChangeSize);
QHBoxLayout *otherSizeLayout = new QHBoxLayout;
otherSizeLayout->addWidget(otherRadioButton);
otherSizeLayout->addWidget(otherSpinBox);
otherSizeLayout->addStretch();
- QGridLayout *layout = new QGridLayout;
+ QGridLayout *layout = new QGridLayout(iconSizeGroupBox);
layout->addWidget(smallRadioButton, 0, 0);
layout->addWidget(largeRadioButton, 1, 0);
layout->addWidget(toolBarRadioButton, 2, 0);
@@ -351,75 +399,99 @@ void MainWindow::createIconSizeGroupBox()
layout->addWidget(tabBarRadioButton, 2, 1);
layout->addLayout(otherSizeLayout, 3, 0, 1, 2);
layout->setRowStretch(4, 1);
- iconSizeGroupBox->setLayout(layout);
+ return iconSizeGroupBox;
}
//! [27]
+void MainWindow::screenChanged()
+{
+ devicePixelRatioLabel->setText(QString::number(devicePixelRatioF()));
+ if (const QWindow *window = windowHandle()) {
+ const QScreen *screen = window->screen();
+ const QString screenDescription =
+ tr("\"%1\" (%2x%3)").arg(screen->name())
+ .arg(screen->geometry().width()).arg(screen->geometry().height());
+ screenNameLabel->setText(screenDescription);
+ }
+ changeIcon();
+}
+
+QWidget *MainWindow::createHighDpiIconSizeGroupBox()
+{
+ QGroupBox *highDpiGroupBox = new QGroupBox(tr("High DPI Scaling"));
+ QFormLayout *layout = new QFormLayout(highDpiGroupBox);
+ devicePixelRatioLabel = new QLabel(highDpiGroupBox);
+ screenNameLabel = new QLabel(highDpiGroupBox);
+ layout->addRow(tr("Screen:"), screenNameLabel);
+ layout->addRow(tr("Device pixel ratio:"), devicePixelRatioLabel);
+ QCheckBox *highDpiPixmapsCheckBox = new QCheckBox(QLatin1String("Qt::AA_UseHighDpiPixmaps"));
+ highDpiPixmapsCheckBox->setChecked(QCoreApplication::testAttribute(Qt::AA_UseHighDpiPixmaps));
+ connect(highDpiPixmapsCheckBox, &QCheckBox::stateChanged, this, &MainWindow::useHighDpiPixmapsChanged);
+ layout->addRow(highDpiPixmapsCheckBox);
+ return highDpiGroupBox;
+}
+
//! [28]
void MainWindow::createActions()
{
- addImagesAct = new QAction(tr("&Add Images..."), this);
- addImagesAct->setShortcut(tr("Ctrl+A"));
- connect(addImagesAct, SIGNAL(triggered()), this, SLOT(addImages()));
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+
+ addSampleImagesAct = new QAction(tr("Add &Sample Images..."), this);
+ addSampleImagesAct->setShortcut(tr("Ctrl+A"));
+ connect(addSampleImagesAct, &QAction::triggered, this, &MainWindow::addSampleImages);
+ fileMenu->addAction(addSampleImagesAct);
+
+ addOtherImagesAct = new QAction(tr("&Add Images..."), this);
+ addOtherImagesAct->setShortcut(QKeySequence::Open);
+ connect(addOtherImagesAct, &QAction::triggered, this, &MainWindow::addOtherImages);
+ fileMenu->addAction(addOtherImagesAct);
removeAllImagesAct = new QAction(tr("&Remove All Images"), this);
removeAllImagesAct->setShortcut(tr("Ctrl+R"));
- connect(removeAllImagesAct, SIGNAL(triggered()),
- this, SLOT(removeAllImages()));
+ connect(removeAllImagesAct, &QAction::triggered,
+ this, &MainWindow::removeAllImages);
+ fileMenu->addAction(removeAllImagesAct);
- exitAct = new QAction(tr("&Quit"), this);
+ fileMenu->addSeparator();
+
+ QAction *exitAct = fileMenu->addAction(tr("&Quit"), this, &QWidget::close);
exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ QMenu *viewMenu = menuBar()->addMenu(tr("&View"));
styleActionGroup = new QActionGroup(this);
- foreach (QString styleName, QStyleFactory::keys()) {
- QAction *action = new QAction(styleActionGroup);
- action->setText(tr("%1 Style").arg(styleName));
+ foreach (const QString &styleName, QStyleFactory::keys()) {
+ QAction *action = new QAction(tr("%1 Style").arg(styleName), styleActionGroup);
action->setData(styleName);
action->setCheckable(true);
- connect(action, SIGNAL(triggered(bool)), this, SLOT(changeStyle(bool)));
+ connect(action, &QAction::triggered, this, &MainWindow::changeStyle);
+ viewMenu->addAction(action);
}
+ QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings"));
+
guessModeStateAct = new QAction(tr("&Guess Image Mode/State"), this);
guessModeStateAct->setCheckable(true);
guessModeStateAct->setChecked(true);
+ settingsMenu->addAction(guessModeStateAct);
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ nativeFileDialogAct = new QAction(tr("&Use Native File Dialog"), this);
+ nativeFileDialogAct->setCheckable(true);
+ nativeFileDialogAct->setChecked(true);
+ settingsMenu->addAction(nativeFileDialogAct);
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
//! [28]
-//! [29]
-void MainWindow::createMenus()
-{
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(addImagesAct);
- fileMenu->addAction(removeAllImagesAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- viewMenu = menuBar()->addMenu(tr("&View"));
- foreach (QAction *action, styleActionGroup->actions())
- viewMenu->addAction(action);
- viewMenu->addSeparator();
- viewMenu->addAction(guessModeStateAct);
-
- menuBar()->addSeparator();
-
- helpMenu = menuBar()->addMenu(tr("&Help"));
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-}
-//! [29]
-
//! [30]
void MainWindow::createContextMenu()
{
imagesTable->setContextMenuPolicy(Qt::ActionsContextMenu);
- imagesTable->addAction(addImagesAct);
+ imagesTable->addAction(addSampleImagesAct);
+ imagesTable->addAction(addOtherImagesAct);
imagesTable->addAction(removeAllImagesAct);
}
//! [30]
@@ -429,14 +501,13 @@ void MainWindow::checkCurrentStyle()
{
foreach (QAction *action, styleActionGroup->actions()) {
QString styleName = action->data().toString();
- QStyle *candidate = QStyleFactory::create(styleName);
- Q_ASSERT(candidate);
+ QScopedPointer<QStyle> candidate(QStyleFactory::create(styleName));
+ Q_ASSERT(!candidate.isNull());
if (candidate->metaObject()->className()
== QApplication::style()->metaObject()->className()) {
action->trigger();
return;
}
- delete candidate;
}
}
//! [31]
diff --git a/examples/widgets/widgets/icons/mainwindow.h b/examples/widgets/widgets/icons/mainwindow.h
index 3628038878..207986f741 100644
--- a/examples/widgets/widgets/icons/mainwindow.h
+++ b/examples/widgets/widgets/icons/mainwindow.h
@@ -49,9 +49,10 @@
QT_BEGIN_NAMESPACE
class QAction;
class QActionGroup;
-class QGroupBox;
+class QLabel;
class QMenu;
class QRadioButton;
+class QButtonGroup;
class QTableWidget;
QT_END_NAMESPACE
class IconPreviewArea;
@@ -65,51 +66,47 @@ class MainWindow : public QMainWindow
public:
MainWindow();
+ void loadImages(const QStringList &fileNames);
+
+ void show();
+
private slots:
void about();
void changeStyle(bool checked);
- void changeSize(bool checked = true);
+ void changeSize(int, bool);
+ void triggerChangeSize();
void changeIcon();
- void addImages();
+ void addSampleImages();
+ void addOtherImages();
void removeAllImages();
+ void useHighDpiPixmapsChanged(int checkState);
+ void screenChanged();
private:
- void createPreviewGroupBox();
- void createImagesGroupBox();
- void createIconSizeGroupBox();
+ QWidget *createImagesGroupBox();
+ QWidget *createIconSizeGroupBox();
+ QWidget *createHighDpiIconSizeGroupBox();
void createActions();
- void createMenus();
void createContextMenu();
void checkCurrentStyle();
+ void addImages(const QString &directory);
- QWidget *centralWidget;
-
- QGroupBox *previewGroupBox;
IconPreviewArea *previewArea;
- QGroupBox *imagesGroupBox;
QTableWidget *imagesTable;
- QGroupBox *iconSizeGroupBox;
- QRadioButton *smallRadioButton;
- QRadioButton *largeRadioButton;
- QRadioButton *toolBarRadioButton;
- QRadioButton *listViewRadioButton;
- QRadioButton *iconViewRadioButton;
- QRadioButton *tabBarRadioButton;
- QRadioButton *otherRadioButton;
+ QButtonGroup *sizeButtonGroup;
IconSizeSpinBox *otherSpinBox;
- QMenu *fileMenu;
- QMenu *viewMenu;
- QMenu *helpMenu;
- QAction *addImagesAct;
+ QLabel *devicePixelRatioLabel;
+ QLabel *screenNameLabel;
+
+ QAction *addOtherImagesAct;
+ QAction *addSampleImagesAct;
QAction *removeAllImagesAct;
- QAction *exitAct;
QAction *guessModeStateAct;
+ QAction *nativeFileDialogAct;
QActionGroup *styleActionGroup;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
//! [0]
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp
index 93b88e9c18..844acbd62f 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.cpp
+++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp
@@ -47,19 +47,20 @@
//! [0]
ImageViewer::ImageViewer()
+ : imageLabel(new QLabel)
+ , scrollArea(new QScrollArea)
+ , scaleFactor(1)
{
- imageLabel = new QLabel;
imageLabel->setBackgroundRole(QPalette::Base);
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
imageLabel->setScaledContents(true);
- scrollArea = new QScrollArea;
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(imageLabel);
+ scrollArea->setVisible(false);
setCentralWidget(scrollArea);
createActions();
- createMenus();
resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 5);
}
@@ -71,53 +72,99 @@ bool ImageViewer::loadFile(const QString &fileName)
{
QImageReader reader(fileName);
reader.setAutoTransform(true);
- const QImage image = reader.read();
- if (image.isNull()) {
+ const QImage newImage = reader.read();
+ if (newImage.isNull()) {
QMessageBox::information(this, QGuiApplication::applicationDisplayName(),
- tr("Cannot load %1.").arg(QDir::toNativeSeparators(fileName)));
- setWindowFilePath(QString());
- imageLabel->setPixmap(QPixmap());
- imageLabel->adjustSize();
+ tr("Cannot load %1: %2")
+ .arg(QDir::toNativeSeparators(fileName), reader.errorString()));
return false;
}
-//! [2] //! [3]
+//! [2]
+
+ setImage(newImage);
+
+ setWindowFilePath(fileName);
+
+ const QString message = tr("Opened \"%1\", %2x%3, Depth: %4")
+ .arg(QDir::toNativeSeparators(fileName)).arg(image.width()).arg(image.height()).arg(image.depth());
+ statusBar()->showMessage(message);
+ return true;
+}
+
+void ImageViewer::setImage(const QImage &newImage)
+{
+ image = newImage;
imageLabel->setPixmap(QPixmap::fromImage(image));
-//! [3] //! [4]
+//! [4]
scaleFactor = 1.0;
+ scrollArea->setVisible(true);
printAct->setEnabled(true);
fitToWindowAct->setEnabled(true);
updateActions();
if (!fitToWindowAct->isChecked())
imageLabel->adjustSize();
-
- setWindowFilePath(fileName);
- return true;
}
//! [4]
-//! [2]
+bool ImageViewer::saveFile(const QString &fileName)
+{
+ QImageWriter writer(fileName);
+
+ if (!writer.write(image)) {
+ QMessageBox::information(this, QGuiApplication::applicationDisplayName(),
+ tr("Cannot write %1: %2")
+ .arg(QDir::toNativeSeparators(fileName)), writer.errorString());
+ return false;
+ }
+ const QString message = tr("Wrote \"%1\"").arg(QDir::toNativeSeparators(fileName));
+ statusBar()->showMessage(message);
+ return true;
+}
//! [1]
-void ImageViewer::open()
+
+static void initializeImageFileDialog(QFileDialog &dialog, QFileDialog::AcceptMode acceptMode)
{
+ static bool firstDialog = true;
+
+ if (firstDialog) {
+ firstDialog = false;
+ const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
+ dialog.setDirectory(picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
+ }
+
QStringList mimeTypeFilters;
- foreach (const QByteArray &mimeTypeName, QImageReader::supportedMimeTypes())
+ const QByteArrayList supportedMimeTypes = acceptMode == QFileDialog::AcceptOpen
+ ? QImageReader::supportedMimeTypes() : QImageWriter::supportedMimeTypes();
+ foreach (const QByteArray &mimeTypeName, supportedMimeTypes)
mimeTypeFilters.append(mimeTypeName);
mimeTypeFilters.sort();
- const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
- QFileDialog dialog(this, tr("Open File"),
- picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
- dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setMimeTypeFilters(mimeTypeFilters);
dialog.selectMimeTypeFilter("image/jpeg");
+ if (acceptMode == QFileDialog::AcceptSave)
+ dialog.setDefaultSuffix("jpg");
+}
+
+void ImageViewer::open()
+{
+ QFileDialog dialog(this, tr("Open File"));
+ initializeImageFileDialog(dialog, QFileDialog::AcceptOpen);
while (dialog.exec() == QDialog::Accepted && !loadFile(dialog.selectedFiles().first())) {}
}
//! [1]
+void ImageViewer::saveAs()
+{
+ QFileDialog dialog(this, tr("Save File As"));
+ initializeImageFileDialog(dialog, QFileDialog::AcceptSave);
+
+ while (dialog.exec() == QDialog::Accepted && !saveFile(dialog.selectedFiles().first())) {}
+}
+
//! [5]
void ImageViewer::print()
//! [5] //! [6]
@@ -140,6 +187,43 @@ void ImageViewer::print()
}
//! [8]
+void ImageViewer::copy()
+{
+#ifndef QT_NO_CLIPBOARD
+ QGuiApplication::clipboard()->setImage(image);
+#endif // !QT_NO_CLIPBOARD
+}
+
+#ifndef QT_NO_CLIPBOARD
+static QImage clipboardImage()
+{
+ if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData()) {
+ if (mimeData->hasImage()) {
+ const QImage image = qvariant_cast<QImage>(mimeData->imageData());
+ if (!image.isNull())
+ return image;
+ }
+ }
+ return QImage();
+}
+#endif // !QT_NO_CLIPBOARD
+
+void ImageViewer::paste()
+{
+#ifndef QT_NO_CLIPBOARD
+ const QImage newImage = clipboardImage();
+ if (newImage.isNull()) {
+ statusBar()->showMessage(tr("No image in clipboard"));
+ } else {
+ setImage(newImage);
+ setWindowFilePath(QString());
+ const QString message = tr("Obtained image from clipboard, %1x%2, Depth: %3")
+ .arg(newImage.width()).arg(newImage.height()).arg(newImage.depth());
+ statusBar()->showMessage(message);
+ }
+#endif // !QT_NO_CLIPBOARD
+}
+
//! [9]
void ImageViewer::zoomIn()
//! [9] //! [10]
@@ -167,9 +251,8 @@ void ImageViewer::fitToWindow()
{
bool fitToWindow = fitToWindowAct->isChecked();
scrollArea->setWidgetResizable(fitToWindow);
- if (!fitToWindow) {
+ if (!fitToWindow)
normalSize();
- }
updateActions();
}
//! [14]
@@ -199,79 +282,66 @@ void ImageViewer::about()
void ImageViewer::createActions()
//! [17] //! [18]
{
- openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcut(tr("Ctrl+O"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+
+ QAction *openAct = fileMenu->addAction(tr("&Open..."), this, &ImageViewer::open);
+ openAct->setShortcut(QKeySequence::Open);
+
+ saveAsAct = fileMenu->addAction(tr("&Save As..."), this, &ImageViewer::saveAs);
+ saveAsAct->setEnabled(false);
- printAct = new QAction(tr("&Print..."), this);
- printAct->setShortcut(tr("Ctrl+P"));
+ printAct = fileMenu->addAction(tr("&Print..."), this, &ImageViewer::print);
+ printAct->setShortcut(QKeySequence::Print);
printAct->setEnabled(false);
- connect(printAct, SIGNAL(triggered()), this, SLOT(print()));
- exitAct = new QAction(tr("E&xit"), this);
+ fileMenu->addSeparator();
+
+ QAction *exitAct = fileMenu->addAction(tr("E&xit"), this, &QWidget::close);
exitAct->setShortcut(tr("Ctrl+Q"));
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
- zoomInAct = new QAction(tr("Zoom &In (25%)"), this);
- zoomInAct->setShortcut(tr("Ctrl++"));
+ QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
+
+ copyAct = editMenu->addAction(tr("&Copy"), this, &ImageViewer::copy);
+ copyAct->setShortcut(QKeySequence::Copy);
+ copyAct->setEnabled(false);
+
+ QAction *pasteAct = editMenu->addAction(tr("&Paste"), this, &ImageViewer::paste);
+ pasteAct->setShortcut(QKeySequence::Paste);
+
+ QMenu *viewMenu = menuBar()->addMenu(tr("&View"));
+
+ zoomInAct = viewMenu->addAction(tr("Zoom &In (25%)"), this, &ImageViewer::zoomIn);
+ zoomInAct->setShortcut(QKeySequence::ZoomIn);
zoomInAct->setEnabled(false);
- connect(zoomInAct, SIGNAL(triggered()), this, SLOT(zoomIn()));
- zoomOutAct = new QAction(tr("Zoom &Out (25%)"), this);
- zoomOutAct->setShortcut(tr("Ctrl+-"));
+ zoomOutAct = viewMenu->addAction(tr("Zoom &Out (25%)"), this, &ImageViewer::zoomOut);
+ zoomOutAct->setShortcut(QKeySequence::ZoomOut);
zoomOutAct->setEnabled(false);
- connect(zoomOutAct, SIGNAL(triggered()), this, SLOT(zoomOut()));
- normalSizeAct = new QAction(tr("&Normal Size"), this);
+ normalSizeAct = viewMenu->addAction(tr("&Normal Size"), this, &ImageViewer::normalSize);
normalSizeAct->setShortcut(tr("Ctrl+S"));
normalSizeAct->setEnabled(false);
- connect(normalSizeAct, SIGNAL(triggered()), this, SLOT(normalSize()));
- fitToWindowAct = new QAction(tr("&Fit to Window"), this);
+ viewMenu->addSeparator();
+
+ fitToWindowAct = viewMenu->addAction(tr("&Fit to Window"), this, &ImageViewer::fitToWindow);
fitToWindowAct->setEnabled(false);
fitToWindowAct->setCheckable(true);
fitToWindowAct->setShortcut(tr("Ctrl+F"));
- connect(fitToWindowAct, SIGNAL(triggered()), this, SLOT(fitToWindow()));
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+ helpMenu->addAction(tr("&About"), this, &ImageViewer::about);
+ helpMenu->addAction(tr("About &Qt"), &QApplication::aboutQt);
}
//! [18]
-//! [19]
-void ImageViewer::createMenus()
-//! [19] //! [20]
-{
- fileMenu = new QMenu(tr("&File"), this);
- fileMenu->addAction(openAct);
- fileMenu->addAction(printAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- viewMenu = new QMenu(tr("&View"), this);
- viewMenu->addAction(zoomInAct);
- viewMenu->addAction(zoomOutAct);
- viewMenu->addAction(normalSizeAct);
- viewMenu->addSeparator();
- viewMenu->addAction(fitToWindowAct);
-
- helpMenu = new QMenu(tr("&Help"), this);
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-
- menuBar()->addMenu(fileMenu);
- menuBar()->addMenu(viewMenu);
- menuBar()->addMenu(helpMenu);
-}
-//! [20]
-
//! [21]
void ImageViewer::updateActions()
//! [21] //! [22]
{
+ saveAsAct->setEnabled(!image.isNull());
+ copyAct->setEnabled(!image.isNull());
zoomInAct->setEnabled(!fitToWindowAct->isChecked());
zoomOutAct->setEnabled(!fitToWindowAct->isChecked());
normalSizeAct->setEnabled(!fitToWindowAct->isChecked());
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.h b/examples/widgets/widgets/imageviewer/imageviewer.h
index 7b35e3ee9e..7084bf98d1 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.h
+++ b/examples/widgets/widgets/imageviewer/imageviewer.h
@@ -42,6 +42,7 @@
#define IMAGEVIEWER_H
#include <QMainWindow>
+#include <QImage>
#ifndef QT_NO_PRINTER
#include <QPrinter>
#endif
@@ -65,7 +66,10 @@ public:
private slots:
void open();
+ void saveAs();
void print();
+ void copy();
+ void paste();
void zoomIn();
void zoomOut();
void normalSize();
@@ -76,9 +80,12 @@ private:
void createActions();
void createMenus();
void updateActions();
+ bool saveFile(const QString &fileName);
+ void setImage(const QImage &newImage);
void scaleImage(double factor);
void adjustScrollBar(QScrollBar *scrollBar, double factor);
+ QImage image;
QLabel *imageLabel;
QScrollArea *scrollArea;
double scaleFactor;
@@ -87,19 +94,13 @@ private:
QPrinter printer;
#endif
- QAction *openAct;
+ QAction *saveAsAct;
QAction *printAct;
- QAction *exitAct;
+ QAction *copyAct;
QAction *zoomInAct;
QAction *zoomOutAct;
QAction *normalSizeAct;
QAction *fitToWindowAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
-
- QMenu *fileMenu;
- QMenu *viewMenu;
- QMenu *helpMenu;
};
//! [0]
diff --git a/examples/widgets/widgets/movie/movie.pro b/examples/widgets/widgets/movie/movie.pro
index 86d85552c2..94d86454d8 100644
--- a/examples/widgets/widgets/movie/movie.pro
+++ b/examples/widgets/widgets/movie/movie.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince {
addFiles.files += *.gif
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.cpp b/examples/widgets/widgets/stylesheet/mainwindow.cpp
index a49c06dfd2..6d84897c77 100644
--- a/examples/widgets/widgets/stylesheet/mainwindow.cpp
+++ b/examples/widgets/widgets/stylesheet/mainwindow.cpp
@@ -67,7 +67,7 @@ void MainWindow::on_aboutAction_triggered()
{
QMessageBox::about(this, tr("About Style sheet"),
tr("The <b>Style Sheet</b> example shows how widgets can be styled "
- "using <a href=\"http://doc.qt.digia.com/4.5/stylesheet.html\">Qt "
+ "using <a href=\"http://doc.qt.io/qt-5/stylesheet.html\">Qt "
"Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop up the "
"style editor, and either choose an existing style sheet or design "
"your own."));
diff --git a/examples/widgets/widgets/tablet/images.qrc b/examples/widgets/widgets/tablet/images.qrc
new file mode 100644
index 0000000000..eb3eabbace
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images.qrc
@@ -0,0 +1,8 @@
+<RCC>
+ <qresource>
+ <file>images/cursor-airbrush.png</file>
+ <file>images/cursor-eraser.png</file>
+ <file>images/cursor-felt-marker.png</file>
+ <file>images/cursor-pencil.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/widgets/widgets/tablet/images/cursor-airbrush.png b/examples/widgets/widgets/tablet/images/cursor-airbrush.png
new file mode 100644
index 0000000000..bea756ed6f
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-airbrush.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/images/cursor-eraser.png b/examples/widgets/widgets/tablet/images/cursor-eraser.png
new file mode 100644
index 0000000000..e5488a89f2
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-eraser.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/images/cursor-felt-marker.png b/examples/widgets/widgets/tablet/images/cursor-felt-marker.png
new file mode 100644
index 0000000000..132f09aa39
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-felt-marker.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/images/cursor-pencil.png b/examples/widgets/widgets/tablet/images/cursor-pencil.png
new file mode 100644
index 0000000000..cc2f447d02
--- /dev/null
+++ b/examples/widgets/widgets/tablet/images/cursor-pencil.png
Binary files differ
diff --git a/examples/widgets/widgets/tablet/mainwindow.cpp b/examples/widgets/widgets/tablet/mainwindow.cpp
index aed84c50df..5e84f5b6a2 100644
--- a/examples/widgets/widgets/tablet/mainwindow.cpp
+++ b/examples/widgets/widgets/tablet/mainwindow.cpp
@@ -52,7 +52,7 @@ MainWindow::MainWindow(TabletCanvas *canvas)
myCanvas->setColor(Qt::red);
myCanvas->setLineWidthType(TabletCanvas::LineWidthPressure);
- myCanvas->setAlphaChannelType(TabletCanvas::NoAlpha);
+ myCanvas->setAlphaChannelType(TabletCanvas::AlphaTangentialPressure);
myCanvas->setColorSaturationType(TabletCanvas::NoSaturation);
setWindowTitle(tr("Tablet Example"));
@@ -75,6 +75,8 @@ void MainWindow::alphaActionTriggered(QAction *action)
{
if (action == alphaChannelPressureAction) {
myCanvas->setAlphaChannelType(TabletCanvas::AlphaPressure);
+ } else if (action == alphaChannelTangentialPressureAction) {
+ myCanvas->setAlphaChannelType(TabletCanvas::AlphaTangentialPressure);
} else if (action == alphaChannelTiltAction) {
myCanvas->setAlphaChannelType(TabletCanvas::AlphaTilt);
} else {
@@ -157,15 +159,19 @@ void MainWindow::createActions()
alphaChannelPressureAction = new QAction(tr("&Pressure"), this);
alphaChannelPressureAction->setCheckable(true);
+ alphaChannelTangentialPressureAction = new QAction(tr("T&angential Pressure"), this);
+ alphaChannelTangentialPressureAction->setCheckable(true);
+ alphaChannelTangentialPressureAction->setChecked(true);
+
alphaChannelTiltAction = new QAction(tr("&Tilt"), this);
alphaChannelTiltAction->setCheckable(true);
noAlphaChannelAction = new QAction(tr("No Alpha Channel"), this);
noAlphaChannelAction->setCheckable(true);
- noAlphaChannelAction->setChecked(true);
alphaChannelGroup = new QActionGroup(this);
alphaChannelGroup->addAction(alphaChannelPressureAction);
+ alphaChannelGroup->addAction(alphaChannelTangentialPressureAction);
alphaChannelGroup->addAction(alphaChannelTiltAction);
alphaChannelGroup->addAction(noAlphaChannelAction);
connect(alphaChannelGroup, SIGNAL(triggered(QAction*)),
@@ -259,6 +265,7 @@ void MainWindow::createMenus()
alphaChannelMenu = tabletMenu->addMenu(tr("&Alpha Channel"));
alphaChannelMenu->addAction(alphaChannelPressureAction);
+ alphaChannelMenu->addAction(alphaChannelTangentialPressureAction);
alphaChannelMenu->addAction(alphaChannelTiltAction);
alphaChannelMenu->addAction(noAlphaChannelAction);
diff --git a/examples/widgets/widgets/tablet/mainwindow.h b/examples/widgets/widgets/tablet/mainwindow.h
index 5e77ea1acf..c6ac2e6026 100644
--- a/examples/widgets/widgets/tablet/mainwindow.h
+++ b/examples/widgets/widgets/tablet/mainwindow.h
@@ -79,6 +79,7 @@ private:
QActionGroup *alphaChannelGroup;
QAction *alphaChannelPressureAction;
+ QAction *alphaChannelTangentialPressureAction;
QAction *alphaChannelTiltAction;
QAction *noAlphaChannelAction;
diff --git a/examples/widgets/widgets/tablet/tablet.pro b/examples/widgets/widgets/tablet/tablet.pro
index de81e7b198..9b8927f483 100644
--- a/examples/widgets/widgets/tablet/tablet.pro
+++ b/examples/widgets/widgets/tablet/tablet.pro
@@ -1,12 +1,13 @@
QT += widgets
HEADERS = mainwindow.h \
- tabletcanvas.h \
- tabletapplication.h
+ tabletcanvas.h \
+ tabletapplication.h
SOURCES = mainwindow.cpp \
- main.cpp \
- tabletcanvas.cpp \
- tabletapplication.cpp
+ main.cpp \
+ tabletcanvas.cpp \
+ tabletapplication.cpp
+RESOURCES += images.qrc
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/tablet
diff --git a/examples/widgets/widgets/tablet/tabletapplication.cpp b/examples/widgets/widgets/tablet/tabletapplication.cpp
index c3210f822c..3e1356ee9c 100644
--- a/examples/widgets/widgets/tablet/tabletapplication.cpp
+++ b/examples/widgets/widgets/tablet/tabletapplication.cpp
@@ -47,8 +47,7 @@ bool TabletApplication::event(QEvent *event)
{
if (event->type() == QEvent::TabletEnterProximity ||
event->type() == QEvent::TabletLeaveProximity) {
- myCanvas->setTabletDevice(
- static_cast<QTabletEvent *>(event)->device());
+ myCanvas->setTabletDevice(static_cast<QTabletEvent *>(event));
return true;
}
return QApplication::event(event);
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.cpp b/examples/widgets/widgets/tablet/tabletcanvas.cpp
index 20d6291292..8ff3d41e0e 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.cpp
+++ b/examples/widgets/widgets/tablet/tabletcanvas.cpp
@@ -47,14 +47,13 @@
TabletCanvas::TabletCanvas()
{
resize(500, 500);
- myBrush = QBrush();
- myPen = QPen();
+ myColor = Qt::red;
+ myBrush = QBrush(myColor);
+ myPen = QPen(myBrush, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
initPixmap();
setAutoFillBackground(true);
deviceDown = false;
- myColor = Qt::red;
- myTabletDevice = QTabletEvent::Stylus;
- alphaChannelType = NoAlpha;
+ alphaChannelType = AlphaTangentialPressure;
colorSaturationType = NoSaturation;
lineWidthType = LineWidthPressure;
}
@@ -99,24 +98,25 @@ void TabletCanvas::tabletEvent(QTabletEvent *event)
case QEvent::TabletPress:
if (!deviceDown) {
deviceDown = true;
- polyLine[0] = polyLine[1] = polyLine[2] = event->pos();
+ lastPoint.pos = event->posF();
+ lastPoint.rotation = event->rotation();
}
break;
- case QEvent::TabletRelease:
- if (deviceDown)
- deviceDown = false;
- break;
case QEvent::TabletMove:
- polyLine[2] = polyLine[1];
- polyLine[1] = polyLine[0];
- polyLine[0] = event->pos();
-
+ if (event->device() == QTabletEvent::RotationStylus)
+ updateCursor(event);
if (deviceDown) {
updateBrush(event);
QPainter painter(&pixmap);
paintPixmap(painter, event);
+ lastPoint.pos = event->posF();
+ lastPoint.rotation = event->rotation();
}
break;
+ case QEvent::TabletRelease:
+ if (deviceDown && event->buttons() == Qt::NoButton)
+ deviceDown = false;
+ break;
default:
break;
}
@@ -135,23 +135,44 @@ void TabletCanvas::paintEvent(QPaintEvent *)
//! [5]
void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
{
- QPoint brushAdjust(10, 10);
+ painter.setRenderHint(QPainter::Antialiasing);
- switch (myTabletDevice) {
+ switch (event->device()) {
+//! [6]
case QTabletEvent::Airbrush:
- myBrush.setColor(myColor);
- myBrush.setStyle(brushPattern(event->pressure()));
- painter.setPen(Qt::NoPen);
- painter.setBrush(myBrush);
-
- for (int i = 0; i < 3; ++i) {
- painter.drawEllipse(QRect(polyLine[i] - brushAdjust,
- polyLine[i] + brushAdjust));
+ {
+ painter.setPen(Qt::NoPen);
+ QRadialGradient grad(lastPoint.pos, myPen.widthF() * 10.0);
+ QColor color = myBrush.color();
+ color.setAlphaF(color.alphaF() * 0.25);
+ grad.setColorAt(0, myBrush.color());
+ grad.setColorAt(0.5, Qt::transparent);
+ painter.setBrush(grad);
+ qreal radius = grad.radius();
+ painter.drawEllipse(event->posF(), radius, radius);
+ }
+ break;
+ case QTabletEvent::RotationStylus:
+ {
+ myBrush.setStyle(Qt::SolidPattern);
+ painter.setPen(Qt::NoPen);
+ painter.setBrush(myBrush);
+ QPolygonF poly;
+ qreal halfWidth = myPen.widthF();
+ QPointF brushAdjust(qSin(qDegreesToRadians(lastPoint.rotation)) * halfWidth,
+ qCos(qDegreesToRadians(lastPoint.rotation)) * halfWidth);
+ poly << lastPoint.pos + brushAdjust;
+ poly << lastPoint.pos - brushAdjust;
+ brushAdjust = QPointF(qSin(qDegreesToRadians(event->rotation())) * halfWidth,
+ qCos(qDegreesToRadians(event->rotation())) * halfWidth);
+ poly << event->posF() - brushAdjust;
+ poly << event->posF() + brushAdjust;
+ painter.drawConvexPolygon(poly);
}
break;
+//! [6]
case QTabletEvent::Puck:
case QTabletEvent::FourDMouse:
- case QTabletEvent::RotationStylus:
{
const QString error(tr("This input device is not supported by the example."));
#ifndef QT_NO_STATUSTIP
@@ -174,42 +195,15 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
}
// FALL-THROUGH
case QTabletEvent::Stylus:
- painter.setBrush(myBrush);
painter.setPen(myPen);
- painter.drawLine(polyLine[1], event->pos());
+ painter.drawLine(lastPoint.pos, event->posF());
break;
}
}
//! [5]
-//! [6]
-Qt::BrushStyle TabletCanvas::brushPattern(qreal value)
-{
- int pattern = int((value) * 100.0) % 7;
-
- switch (pattern) {
- case 0:
- return Qt::SolidPattern;
- case 1:
- return Qt::Dense1Pattern;
- case 2:
- return Qt::Dense2Pattern;
- case 3:
- return Qt::Dense3Pattern;
- case 4:
- return Qt::Dense4Pattern;
- case 5:
- return Qt::Dense5Pattern;
- case 6:
- return Qt::Dense6Pattern;
- default:
- return Qt::Dense7Pattern;
- }
-}
-//! [6]
-
//! [7]
-void TabletCanvas::updateBrush(QTabletEvent *event)
+void TabletCanvas::updateBrush(const QTabletEvent *event)
{
int hue, saturation, value, alpha;
myColor.getHsv(&hue, &saturation, &value, &alpha);
@@ -220,7 +214,13 @@ void TabletCanvas::updateBrush(QTabletEvent *event)
switch (alphaChannelType) {
case AlphaPressure:
- myColor.setAlpha(int(event->pressure() * 255.0));
+ myColor.setAlphaF(event->pressure());
+ break;
+ case AlphaTangentialPressure:
+ if (event->device() == QTabletEvent::Airbrush)
+ myColor.setAlphaF(qMax(0.01, (event->tangentialPressure() + 1.0) / 2.0));
+ else
+ myColor.setAlpha(255);
break;
case AlphaTilt:
myColor.setAlpha(maximum(abs(vValue - 127), abs(hValue - 127)));
@@ -268,8 +268,47 @@ void TabletCanvas::updateBrush(QTabletEvent *event)
}
//! [11]
+void TabletCanvas::updateCursor(const QTabletEvent *event)
+{
+ QCursor cursor;
+ if (event->type() != QEvent::TabletLeaveProximity) {
+ if (event->pointerType() == QTabletEvent::Eraser) {
+ cursor = QCursor(QPixmap(":/images/cursor-eraser.png"), 3, 28);
+ } else {
+ switch (event->device()) {
+ case QTabletEvent::Stylus:
+ cursor = QCursor(QPixmap(":/images/cursor-pencil.png"), 0, 0);
+ break;
+ case QTabletEvent::Airbrush:
+ cursor = QCursor(QPixmap(":/images/cursor-airbrush.png"), 3, 4);
+ break;
+ case QTabletEvent::RotationStylus: {
+ QImage origImg(QLatin1String(":/images/cursor-felt-marker.png"));
+ QImage img(32, 32, QImage::Format_ARGB32);
+ QColor solid = myColor;
+ solid.setAlpha(255);
+ img.fill(solid);
+ QPainter painter(&img);
+ QTransform transform = painter.transform();
+ transform.translate(16, 16);
+ transform.rotate(-event->rotation());
+ painter.setTransform(transform);
+ painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ painter.drawImage(-24, -24, origImg);
+ painter.setCompositionMode(QPainter::CompositionMode_HardLight);
+ painter.drawImage(-24, -24, origImg);
+ painter.end();
+ cursor = QCursor(QPixmap::fromImage(img), 16, 16);
+ } break;
+ default:
+ break;
+ }
+ }
+ }
+ setCursor(cursor);
+}
+
void TabletCanvas::resizeEvent(QResizeEvent *)
{
initPixmap();
- polyLine[0] = polyLine[1] = polyLine[2] = QPoint();
}
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h
index 873f3a7ab0..a7335dbaf0 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.h
+++ b/examples/widgets/widgets/tablet/tabletcanvas.h
@@ -61,7 +61,7 @@ class TabletCanvas : public QWidget
Q_OBJECT
public:
- enum AlphaChannelType { AlphaPressure, AlphaTilt, NoAlpha };
+ enum AlphaChannelType { AlphaPressure, AlphaTangentialPressure, AlphaTilt, NoAlpha };
enum ColorSaturationType { SaturationVTilt, SaturationHTilt,
SaturationPressure, NoSaturation };
enum LineWidthType { LineWidthPressure, LineWidthTilt, NoLineWidth };
@@ -80,8 +80,8 @@ public:
{ myColor = color; }
QColor color() const
{ return myColor; }
- void setTabletDevice(QTabletEvent::TabletDevice device)
- { myTabletDevice = device; }
+ void setTabletDevice(QTabletEvent *event)
+ { myTabletDevice = event->device(); updateCursor(event); }
int maximum(int a, int b)
{ return a > b ? a : b; }
@@ -94,7 +94,8 @@ private:
void initPixmap();
void paintPixmap(QPainter &painter, QTabletEvent *event);
Qt::BrushStyle brushPattern(qreal value);
- void updateBrush(QTabletEvent *event);
+ void updateBrush(const QTabletEvent *event);
+ void updateCursor(const QTabletEvent *event);
AlphaChannelType alphaChannelType;
ColorSaturationType colorSaturationType;
@@ -107,7 +108,11 @@ private:
QBrush myBrush;
QPen myPen;
bool deviceDown;
- QPoint polyLine[3];
+
+ struct Point {
+ QPointF pos;
+ qreal rotation;
+ } lastPoint;
};
//! [0]
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index baf63fa191..0ab4f0266d 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -14,6 +14,6 @@ INSTALLS += target
wince {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
index c0b82965ee..8adaa780b8 100644
--- a/examples/xml/htmlinfo/htmlinfo.pro
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -9,7 +9,7 @@ win32: CONFIG += console
wince {
htmlfiles.files = *.html
htmlfiles.path = .
- DEPLOYMENT += htmlfiles
+ INSTALLS += htmlfiles
}
# install
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
index 3869ca5472..1424cfca67 100644
--- a/examples/xml/htmlinfo/main.cpp
+++ b/examples/xml/htmlinfo/main.cpp
@@ -79,7 +79,7 @@ void parseHtmlFile(QTextStream &out, const QString &fileName) {
}
//! [2]
- out << " Title: \"" << title << "\"" << endl
+ out << " Title: \"" << title << '"' << endl
<< " Number of paragraphs: " << paragraphCount << endl
<< " Number of links: " << links.size() << endl
<< " Showing first few links:" << endl;
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index 353e1559cc..96a48ef5d4 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -16,5 +16,5 @@ INSTALLS += target
wince {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/xml/saxbookmarks/xbelgenerator.cpp b/examples/xml/saxbookmarks/xbelgenerator.cpp
index 24612c132c..5f1ec62e7e 100644
--- a/examples/xml/saxbookmarks/xbelgenerator.cpp
+++ b/examples/xml/saxbookmarks/xbelgenerator.cpp
@@ -81,8 +81,8 @@ QString XbelGenerator::escapedAttribute(const QString &str)
{
QString result = escapedText(str);
result.replace("\"", "&quot;");
- result.prepend("\"");
- result.append("\"");
+ result.prepend(QLatin1Char('"'));
+ result.append(QLatin1Char('"'));
return result;
}
diff --git a/header.COMM b/header.COMM
new file mode 100644
index 0000000000..1c8cb00e73
--- /dev/null
+++ b/header.COMM
@@ -0,0 +1,20 @@
+/******************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the <Fill> module.
+**
+** $QT_BEGIN_LICENSE:COMM$
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software 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.
+**
+** $QT_END_LICENSE$
+**
+******************************************************************************/
diff --git a/mkspecs/aix-g++-64/qmake.conf b/mkspecs/aix-g++-64/qmake.conf
index 176c437c45..7f620a9577 100644
--- a/mkspecs/aix-g++-64/qmake.conf
+++ b/mkspecs/aix-g++-64/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -67,5 +69,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib -X64
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/aix-g++/qmake.conf b/mkspecs/aix-g++/qmake.conf
index 553d9af544..d2f26a1b41 100644
--- a/mkspecs/aix-g++/qmake.conf
+++ b/mkspecs/aix-g++/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -67,5 +69,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/aix-xlc-64/qmake.conf b/mkspecs/aix-xlc-64/qmake.conf
index 42dbd18b4a..1aea8d81c5 100644
--- a/mkspecs/aix-xlc-64/qmake.conf
+++ b/mkspecs/aix-xlc-64/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
+include(../common/unix.conf)
+
QMAKE_COMPILER = ibm_xlc
QMAKE_CC = xlc
@@ -66,5 +68,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib -X64
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/aix-xlc/qmake.conf b/mkspecs/aix-xlc/qmake.conf
index d2de649355..c765d4ff6b 100644
--- a/mkspecs/aix-xlc/qmake.conf
+++ b/mkspecs/aix-xlc/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
+include(../common/unix.conf)
+
QMAKE_COMPILER = ibm_xlc
QMAKE_CC = xlc
@@ -69,5 +71,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/common/angle.conf b/mkspecs/common/angle.conf
new file mode 100644
index 0000000000..fffdb581c5
--- /dev/null
+++ b/mkspecs/common/angle.conf
@@ -0,0 +1,9 @@
+# Renaming these files requires that the LIBRARY entry of their corresponding
+# def files are also updated to reflect the name.
+# The .def files are found in the angle directories:
+#
+# qtbase\src\3rdparty\angle\src\libEGL\libEGL[d?].def
+# qtbase\src\3rdparty\angle\src\libEGL\libGLESv2[d?].def
+
+LIBEGL_NAME="libEGL"
+LIBGLESV2_NAME="libGLESv2"
diff --git a/mkspecs/common/armcc.conf b/mkspecs/common/armcc.conf
deleted file mode 100644
index a52fefc106..0000000000
--- a/mkspecs/common/armcc.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# qmake configuration for armcc
-#
-
-QMAKE_COMPILER = armcc
-
-CONFIG += rvct_linker
-QMAKE_CC = armcc
-QMAKE_CFLAGS +=
-QMAKE_CFLAGS_DEPS += -M
-QMAKE_CFLAGS_WARN_ON +=
-QMAKE_CFLAGS_WARN_OFF += -W
-QMAKE_CFLAGS_RELEASE += -O2
-QMAKE_CFLAGS_DEBUG += -g -O0
-QMAKE_CFLAGS_HIDESYMS += --visibility_inlines_hidden
-
-QMAKE_CXX = armcc
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --exceptions --exceptions_unwind
-QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS
-QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
-QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
-QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
-QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
-QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
-QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
-QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
-QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS
-
-QMAKE_LINK = armlink
-QMAKE_LINK_SHLIB = armlink
-QMAKE_LINK_C = armlink
-QMAKE_LINK_C_SHLIB = armlink
-QMAKE_LFLAGS +=
-QMAKE_LFLAGS_RELEASE +=
-QMAKE_LFLAGS_DEBUG +=
-QMAKE_LFLAGS_APP +=
-QMAKE_LFLAGS_SHLIB +=
-QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
-QMAKE_LFLAGS_THREAD +=
-
-QMAKE_AR = armar --create
-QMAKE_LIB = armar --create
-QMAKE_RANLIB =
-
diff --git a/mkspecs/common/clang-mac.conf b/mkspecs/common/clang-mac.conf
index 3280274f36..c616e20b6e 100644
--- a/mkspecs/common/clang-mac.conf
+++ b/mkspecs/common/clang-mac.conf
@@ -6,5 +6,5 @@ QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
-QMAKE_CXXFLAGS_CXX11 += -stdlib=libc++
-QMAKE_LFLAGS_CXX11 += -stdlib=libc++
+QMAKE_CXXFLAGS += -stdlib=libc++
+QMAKE_LFLAGS += -stdlib=libc++
diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf
index a0a2b3f3d1..ee9c1b8371 100644
--- a/mkspecs/common/clang.conf
+++ b/mkspecs/common/clang.conf
@@ -27,8 +27,15 @@ QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
QMAKE_CXXFLAGS_CXX11 = -std=c++11
+QMAKE_CXXFLAGS_CXX14 = -std=c++1y
+QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
+QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
+QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
+QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
QMAKE_LFLAGS_CXX11 =
+QMAKE_LFLAGS_CXX14 =
+QMAKE_LFLAGS_CXX1Z =
QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
# Wrapper tools that understand .o/.a files with LLVM bytecode instead of machine code
diff --git a/mkspecs/common/g++-base.conf b/mkspecs/common/g++-base.conf
index d687dbc3f3..4254551994 100644
--- a/mkspecs/common/g++-base.conf
+++ b/mkspecs/common/g++-base.conf
@@ -28,4 +28,11 @@ QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_P
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_CXXFLAGS_CXX11 = -std=c++0x
+QMAKE_CXXFLAGS_CXX14 = -std=c++1y
+QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
+QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++0x
+QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
+QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
QMAKE_LFLAGS_CXX11 =
+QMAKE_LFLAGS_CXX14 =
+QMAKE_LFLAGS_CXX1Z =
diff --git a/mkspecs/common/gcc-base-mac.conf b/mkspecs/common/gcc-base-mac.conf
index 747f09ae81..e9bf780ec1 100644
--- a/mkspecs/common/gcc-base-mac.conf
+++ b/mkspecs/common/gcc-base-mac.conf
@@ -12,14 +12,6 @@ include(gcc-base.conf)
QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__=4 __APPLE_CC__
-QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS
-QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
-QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
-QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
-QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
-QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
-QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS
-
QMAKE_LFLAGS += -headerpad_max_install_names
QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib
diff --git a/mkspecs/common/gcc-base-unix.conf b/mkspecs/common/gcc-base-unix.conf
index f82c8a8430..0178bda75a 100644
--- a/mkspecs/common/gcc-base-unix.conf
+++ b/mkspecs/common/gcc-base-unix.conf
@@ -22,3 +22,4 @@ QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold
# -Bsymbolic-functions (ld) support
QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
+QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script,
diff --git a/mkspecs/common/ios/clang.conf b/mkspecs/common/ios/clang.conf
index 36cb655229..f45b89665f 100644
--- a/mkspecs/common/ios/clang.conf
+++ b/mkspecs/common/ios/clang.conf
@@ -22,7 +22,7 @@ QMAKE_IOS_OBJ_CFLAGS += -Wno-deprecated-implementations -Wprotocol -Wno-select
# Set build flags
QMAKE_CFLAGS += $$QMAKE_IOS_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_IOS_CFLAGS $$QMAKE_IOS_CXXFLAGS
-QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_CFLAGS $$QMAKE_IOS_CXXFLAGS $$QMAKE_IOS_OBJ_CFLAGS
+QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_OBJ_CFLAGS
QMAKE_IOS_CFLAGS =
QMAKE_IOS_CXXFLAGS =
diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf
index 8d6fb6fe17..143df704b1 100644
--- a/mkspecs/common/linux.conf
+++ b/mkspecs/common/linux.conf
@@ -4,10 +4,15 @@
QMAKE_PLATFORM += linux
+include(unix.conf)
+
QMAKE_CFLAGS_THREAD += -D_REENTRANT
QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
+QMAKE_LFLAGS_REL_RPATH = -Wl,-z,origin
+QMAKE_REL_RPATH_BASE = $ORIGIN
+
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 =
@@ -51,5 +56,3 @@ QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
-
-include(unix.conf)
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index 91639ddb50..ad3c638a6f 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -6,6 +6,8 @@
QMAKE_PLATFORM += mac darwin
+include(unix.conf)
+
QMAKE_RESOURCE = /Developer/Tools/Rez
QMAKE_EXTENSION_SHLIB = dylib
QMAKE_LIBDIR =
@@ -20,6 +22,9 @@ QMAKE_FIX_RPATH = install_name_tool -id
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
QMAKE_LFLAGS_GCSECTIONS = -Wl,-dead_strip
+QMAKE_LFLAGS_REL_RPATH =
+QMAKE_REL_RPATH_BASE = @loader_path
+
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL
QMAKE_LIBS_THREAD =
@@ -27,5 +32,3 @@ QMAKE_LIBS_THREAD =
QMAKE_AR = ar cq
QMAKE_RANLIB = ranlib -s
QMAKE_NM = nm -P
-
-include(unix.conf)
diff --git a/mkspecs/common/mac/qplatformdefs.h b/mkspecs/common/mac/qplatformdefs.h
index 44664933df..18f62e23f8 100644
--- a/mkspecs/common/mac/qplatformdefs.h
+++ b/mkspecs/common/mac/qplatformdefs.h
@@ -62,6 +62,7 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
+#define __APPLE_USE_RFC_3542
#include <netinet/in.h>
#ifndef QT_NO_IPV6IFNAME
#include <net/if.h>
diff --git a/mkspecs/common/msvc-base.conf b/mkspecs/common/msvc-base.conf
new file mode 100644
index 0000000000..5bd144faa0
--- /dev/null
+++ b/mkspecs/common/msvc-base.conf
@@ -0,0 +1,56 @@
+#
+# qmake configuration for Microsoft Visual Studio C/C++ Compiler
+# This mkspec is used for all win32-msvcXXXX, winrt-XXX-msvcXXX
+# and winphone-XXX-msvcXXX specs
+#
+
+#
+# Version-specific changes
+#
+
+greaterThan(MSC_VER, 1499) {
+ # Visual Studio 2008 (9.0) / Visual C++ 15.0 and up
+ QMAKE_CFLAGS_MP = -MP
+ QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
+}
+
+greaterThan(MSC_VER, 1599) {
+ # Visual Studio 2010 (10.0) / Visual C++ 16.0 and up
+ MAKEFILE_GENERATOR = MSBUILD
+
+ QMAKE_CFLAGS_AVX = -arch:AVX
+ QMAKE_CFLAGS_AVX2 = -arch:AVX
+
+ VCPROJ_EXTENSION = .vcxproj
+}
+
+greaterThan(MSC_VER, 1699) {
+ # Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
+ QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
+ QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@
+ QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@
+ QT_CONFIG += c++11
+ CONFIG += c++11
+}
+
+greaterThan(MSC_VER, 1799) {
+ # Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
+ QMAKE_CFLAGS += -FS
+ QMAKE_CXXFLAGS += -FS
+
+ equals(MSC_VER, 1800) {
+ QMAKE_CFLAGS_RELEASE += -Zc:strictStrings
+ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
+ QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings
+ QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
+ }
+}
+
+greaterThan(MSC_VER, 1899) {
+ # Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
+ QMAKE_CFLAGS += -Zc:strictStrings
+ QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
+ QMAKE_CFLAGS_AVX2 = -arch:AVX2
+ QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
+ QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577
+}
diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf
index 369f95bae9..eec9e1f688 100644
--- a/mkspecs/common/msvc-desktop.conf
+++ b/mkspecs/common/msvc-desktop.conf
@@ -9,6 +9,8 @@ isEmpty(MSC_VER)|isEmpty(MSVC_VER): error("Source mkspec must set both MSC_VER a
# Baseline: Visual Studio 2005 (8.0), VC++ 14.0
#
+include(angle.conf)
+
MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM = win32
QMAKE_COMPILER = msvc
@@ -23,7 +25,7 @@ contains(QMAKE_TARGET.arch, x86_64) {
QMAKE_CC = cl
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
-QMAKE_YACC = byacc
+QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -nologo -Zc:wchar_t
QMAKE_CFLAGS_WARN_ON = -W3
@@ -74,14 +76,17 @@ QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
QMAKE_LFLAGS_DLL = /DLL
QMAKE_LFLAGS_LTCG = /LTCG
+QMAKE_PREFIX_SHLIB =
+QMAKE_EXTENSION_SHLIB = dll
+QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
QMAKE_LIBS_NETWORK = ws2_32.lib
QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib
-QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib gdi32.lib user32.lib
-QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib gdi32.lib user32.lib
+QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib gdi32.lib user32.lib
+QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib gdi32.lib user32.lib
QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
@@ -94,54 +99,6 @@ VCPROJ_EXTENSION = .vcproj
VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0
-#
-# Version-specific changes
-#
-greaterThan(MSC_VER, 1499) {
- # Visual Studio 2008 (9.0) / Visual C++ 15.0 and up
- QMAKE_CFLAGS_MP = -MP
- QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
-}
-
-greaterThan(MSC_VER, 1599) {
- # Visual Studio 2010 (10.0) / Visual C++ 16.0 and up
- MAKEFILE_GENERATOR = MSBUILD
-
- QMAKE_CFLAGS_AVX = -arch:AVX
- QMAKE_CFLAGS_AVX2 = -arch:AVX
-
- VCPROJ_EXTENSION = .vcxproj
-}
-
-greaterThan(MSC_VER, 1699) {
- # Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
- QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
- QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@
- QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@
- QT_CONFIG += c++11
- CONFIG += c++11
-}
-
-greaterThan(MSC_VER, 1799) {
- # Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
- QMAKE_CFLAGS += -FS
- QMAKE_CXXFLAGS += -FS
-
- equals(MSC_VER, 1800) {
- QMAKE_CFLAGS_RELEASE += -Zc:strictStrings
- QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
- QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings
- QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
- }
-}
-
-greaterThan(MSC_VER, 1899) {
- # Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
- QMAKE_CFLAGS += -Zc:strictStrings
- QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
- QMAKE_CFLAGS_AVX2 = -arch:AVX2
- QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
- QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577
-}
+include(msvc-base.conf)
unset(MSC_VER)
diff --git a/mkspecs/common/qcc-base-qnx-armle-v7.conf b/mkspecs/common/qcc-base-qnx-armle-v7.conf
index 12d393f070..ad3bb33da4 100644
--- a/mkspecs/common/qcc-base-qnx-armle-v7.conf
+++ b/mkspecs/common/qcc-base-qnx-armle-v7.conf
@@ -4,9 +4,10 @@
MAKEFILE_GENERATOR = UNIX
-include(g++-unix.conf)
include(unix.conf)
+include(g++-unix.conf)
+
QMAKE_CC = qcc -Vgcc_ntoarmv7le
QMAKE_CXX = qcc -Vgcc_ntoarmv7le
QNX_CPUDIR = armle-v7
diff --git a/mkspecs/common/qcc-base-qnx-x86.conf b/mkspecs/common/qcc-base-qnx-x86.conf
index b49075086d..37a5d9ce70 100644
--- a/mkspecs/common/qcc-base-qnx-x86.conf
+++ b/mkspecs/common/qcc-base-qnx-x86.conf
@@ -4,9 +4,10 @@
MAKEFILE_GENERATOR = UNIX
-include(g++-unix.conf)
include(unix.conf)
+include(g++-unix.conf)
+
QMAKE_CC = qcc -Vgcc_ntox86
QMAKE_CXX = qcc -Vgcc_ntox86
QNX_CPUDIR = x86
diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf
index a0a88b9605..156ba0ddd8 100644
--- a/mkspecs/common/qcc-base-qnx.conf
+++ b/mkspecs/common/qcc-base-qnx.conf
@@ -4,7 +4,7 @@
include(qcc-base.conf)
-QMAKE_PLATFORM += qnx
+QMAKE_PLATFORM = qnx $$QMAKE_PLATFORM
#Choose qnx QPA Plugin as default
QT_QPA_DEFAULT_PLATFORM = qnx
@@ -19,6 +19,7 @@ QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link,
# -Bsymbolic-functions (ld) support
QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
+QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script,
# Generic options for all BlackBerry/QNX qcc mkspecs
QMAKE_CFLAGS_THREAD = -D_REENTRANT
@@ -45,6 +46,8 @@ QMAKE_LIBDIR = $${QNX_DIR}/$${QNX_CPUDIR}/lib $${QNX_DIR}/$${QNX_CPUD
QMAKE_LFLAGS += -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/lib -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/usr/lib
QMAKE_CXXFLAGS_CXX11 = -Wc,-std=gnu++0x
+QMAKE_CXXFLAGS_CXX14 = -Wc,-std=gnu++1y
+QMAKE_CXXFLAGS_CXX1Z = -Wc,-std=gnu++1z
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
diff --git a/mkspecs/common/unix.conf b/mkspecs/common/unix.conf
index 2146b62f17..8521c85b99 100644
--- a/mkspecs/common/unix.conf
+++ b/mkspecs/common/unix.conf
@@ -12,5 +12,6 @@ QMAKE_YACCFLAGS_MANGLE += -p $base -b $base
QMAKE_YACC_HEADER = $base.tab.h
QMAKE_YACC_SOURCE = $base.tab.c
QMAKE_PREFIX_SHLIB = lib
+QMAKE_EXTENSION_SHLIB = so
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf
index 434e063de8..fa1a72a1b9 100644
--- a/mkspecs/common/wince/qmake.conf
+++ b/mkspecs/common/wince/qmake.conf
@@ -2,6 +2,8 @@
# qmake configuration for common Windows CE
#
+include(../angle.conf)
+
MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM += wince win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target
@@ -15,7 +17,7 @@ QMAKE_COMPILER = msvc
QMAKE_CC = cl
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
-QMAKE_YACC = byacc
+QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
QMAKE_CFLAGS_WARN_ON = -W3
@@ -62,10 +64,13 @@ QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_LIBS_NETWORK = ws2.lib
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT =
+QMAKE_PREFIX_SHLIB =
+QMAKE_EXTENSION_SHLIB = dll
+QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
-QMAKE_LIBS_EGL = libEGL.lib
-QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib
+QMAKE_LIBS_EGL = $${LIBEGL_NAME}.lib
+QMAKE_LIBS_OPENGL_ES2 = $${LIBGLESV2_NAME}.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
diff --git a/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in b/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
index 9e188084ad..d091ea3b82 100644
--- a/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
+++ b/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
@@ -43,8 +43,5 @@
</uap:VisualElements>
</Application>
</Applications>
-
- <Capabilities>
- <Capability Name=\"internetClient\" />
- </Capabilities>
+ $${WINRT_MANIFEST.capabilities}
</Package>
diff --git a/mkspecs/common/winrt_winphone/manifests/8.1/AppxManifest.xml.in b/mkspecs/common/winrt_winphone/manifests/8.1/AppxManifest.xml.in
index 91353c608b..b02b691f48 100644
--- a/mkspecs/common/winrt_winphone/manifests/8.1/AppxManifest.xml.in
+++ b/mkspecs/common/winrt_winphone/manifests/8.1/AppxManifest.xml.in
@@ -42,7 +42,6 @@
</m2:VisualElements>
</Application>
</Applications>$${WINRT_MANIFEST.capabilities}
- <Dependencies>$${WINRT_MANIFEST.dependencies}
- </Dependencies>
+ $${WINRT_MANIFEST.dependencies}
</Package>
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. -->
diff --git a/mkspecs/common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in b/mkspecs/common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
index 19deb94675..235fe96794 100644
--- a/mkspecs/common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
+++ b/mkspecs/common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
@@ -43,7 +43,6 @@
</m3:VisualElements>
</Application>
</Applications>$${WINRT_MANIFEST.capabilities}
- <Dependencies>$${WINRT_MANIFEST.dependencies}
- </Dependencies>
+ $${WINRT_MANIFEST.dependencies}
</Package>
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. -->
diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf
index 97ef661230..a9450b0c32 100644
--- a/mkspecs/common/winrt_winphone/qmake.conf
+++ b/mkspecs/common/winrt_winphone/qmake.conf
@@ -4,10 +4,12 @@
# Written for Microsoft Visual C++
#
+include(../angle.conf)
+
MAKEFILE_GENERATOR = MSBUILD
QMAKE_COMPILER = msvc
QMAKE_PLATFORM = winrt win32
-CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target no_generated_target_info package_manifest rtti
+CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target package_manifest rtti
DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN \
QT_NO_PRINTER QT_NO_PRINTDIALOG # TODO: Remove when printing is re-enabled
@@ -16,7 +18,7 @@ DEPLOYMENT_PLUGIN += qwinrt
QMAKE_CC = cl
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
-QMAKE_YACC = byacc
+QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -nologo
QMAKE_CFLAGS_WARN_ON = -W3
@@ -70,14 +72,17 @@ QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = /MANIFEST:NO
QMAKE_LFLAGS_DLL = /MANIFEST:NO /DLL
QMAKE_LFLAGS_LTCG = /LTCG
+QMAKE_PREFIX_SHLIB =
+QMAKE_EXTENSION_SHLIB = dll
+QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS += runtimeobject.lib
-QMAKE_LIBS_CORE =
+QMAKE_LIBS_CORE += ws2_32.lib
QMAKE_LIBS_GUI =
-QMAKE_LIBS_NETWORK =
-QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib
-QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib
+QMAKE_LIBS_NETWORK += ws2_32.lib
+QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
+QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
@@ -89,4 +94,9 @@ VCPROJ_EXTENSION = .vcxproj
VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0
WINRT_ASSETS_PATH = $$PWD/assets
+
+include(../msvc-base.conf)
+
+unset(MSC_VER)
+
load(qt_config)
diff --git a/mkspecs/cygwin-g++/qmake.conf b/mkspecs/cygwin-g++/qmake.conf
index caed4133b1..a4f64d9c66 100644
--- a/mkspecs/cygwin-g++/qmake.conf
+++ b/mkspecs/cygwin-g++/qmake.conf
@@ -6,7 +6,7 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = cygwin unix posix
-CONFIG += incremental
+CONFIG += incremental unversioned_libname
QMAKE_INCREMENTAL_STYLE = sublib
QMAKE_COMPILER = gcc
@@ -14,7 +14,7 @@ QMAKE_COMPILER = gcc
QMAKE_CC = gcc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
-QMAKE_YACC = byacc
+QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -pipe
QMAKE_CFLAGS_DEPS = -M
@@ -56,8 +56,6 @@ QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,-soname,
QMAKE_LFLAGS_THREAD =
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
-QMAKE_CYGWIN_SHLIB = 1
-QMAKE_CYGWIN_EXE = 1
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
@@ -65,6 +63,7 @@ QMAKE_LIBS_X11 = -lXext -lX11
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread
QMAKE_PREFIX_SHLIB = lib
+QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
diff --git a/mkspecs/darwin-g++/qmake.conf b/mkspecs/darwin-g++/qmake.conf
index ab333b1684..79f81a990f 100644
--- a/mkspecs/darwin-g++/qmake.conf
+++ b/mkspecs/darwin-g++/qmake.conf
@@ -9,6 +9,8 @@ QMAKE_PLATFORM = osx macx mac darwin
CONFIG += native_precompiled_headers
DEFINES += __USE_WS_X11__
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = cc
@@ -84,5 +86,4 @@ QMAKE_PCH_OUTPUT_EXT = .gch
QMAKE_CXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/devices/common/linux_device_post.conf b/mkspecs/devices/common/linux_device_post.conf
index d90d25191f..88fa31d805 100644
--- a/mkspecs/devices/common/linux_device_post.conf
+++ b/mkspecs/devices/common/linux_device_post.conf
@@ -3,6 +3,10 @@ contains(DISTRO_OPTS, deb-multi-arch) {
-Wl,-rpath-link,$$[QT_SYSROOT]/lib/$${GCC_MACHINE_DUMP}
}
+contains(DISTRO_OPTS, boot2qt) {
+ QMAKE_PLATFORM += boot2qt
+}
+
QMAKE_CFLAGS += $$COMPILER_FLAGS
QMAKE_CXXFLAGS += $$COMPILER_FLAGS
QMAKE_LFLAGS += $$LINKER_FLAGS
diff --git a/mkspecs/devices/common/linux_device_pre.conf b/mkspecs/devices/common/linux_device_pre.conf
index 16becbdd52..cfbdc23d63 100644
--- a/mkspecs/devices/common/linux_device_pre.conf
+++ b/mkspecs/devices/common/linux_device_pre.conf
@@ -23,3 +23,6 @@ QMAKE_AR = $${CROSS_COMPILE}ar cqs
QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
QMAKE_NM = $${CROSS_COMPILE}nm -P
QMAKE_STRIP = $${CROSS_COMPILE}strip
+
+contains(DISTRO_OPTS, deb-multi-arch): \
+ PKG_CONFIG = $${CROSS_COMPILE}pkg-config
diff --git a/mkspecs/devices/linux-arm-generic-g++/qmake.conf b/mkspecs/devices/linux-arm-generic-g++/qmake.conf
new file mode 100644
index 0000000000..3dbd297b94
--- /dev/null
+++ b/mkspecs/devices/linux-arm-generic-g++/qmake.conf
@@ -0,0 +1,9 @@
+#
+# Generic qmake configuration for building with g++ on arm devices.
+#
+# A minimal configure line could look something like this:
+# ./configure -device arm-generic-g++ -device-option CROSS_COMPILE=arm-linux-gnueabi-
+
+include(../common/linux_device_pre.conf)
+include(../common/linux_arm_device_post.conf)
+load(qt_config)
diff --git a/mkspecs/devices/linux-arm-generic-g++/qplatformdefs.h b/mkspecs/devices/linux-arm-generic-g++/qplatformdefs.h
new file mode 100644
index 0000000000..5ae49b35dd
--- /dev/null
+++ b/mkspecs/devices/linux-arm-generic-g++/qplatformdefs.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the qmake spec 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 "../../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/devices/linux-beagleboard-g++/qmake.conf b/mkspecs/devices/linux-beagleboard-g++/qmake.conf
index 1d32d374c6..604da50f63 100644
--- a/mkspecs/devices/linux-beagleboard-g++/qmake.conf
+++ b/mkspecs/devices/linux-beagleboard-g++/qmake.conf
@@ -26,7 +26,7 @@ QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
QMAKE_NM = $${CROSS_COMPILE}nm -P
QMAKE_STRIP = $${CROSS_COMPILE}strip
-COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
+COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mthumb
#modifications to gcc-base.conf
QMAKE_CFLAGS += $${COMPILER_FLAGS}
@@ -47,11 +47,12 @@ QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $${QMAKE_LIBS_EGL}
QMAKE_LIBS_OPENVG = -lOpenVG $${QMAKE_LIBS_EGL}
+DISTRO_OPTS += hard-float
+
# No need for any special EGL device integration.
# Prioritize the default, compiled-in integration over any plugins.
EGLFS_DEVICE_INTEGRATION = none
-# Sanity check
-deviceSanityCheckCompiler()
+include(../common/linux_arm_device_post.conf)
load(qt_config)
diff --git a/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf b/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf
new file mode 100644
index 0000000000..ca9ebda087
--- /dev/null
+++ b/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf
@@ -0,0 +1,38 @@
+#
+# qmake configuration for the Jetson TK1 Pro boards
+#
+# A typical configure line might look like:
+# configure \
+# -device jetson-tk1-pro \
+# -device-option VIBRANTE_SDK_TOPDIR=/opt/nvidia/vibrante-vcm30t124-linux
+# -device-option CROSS_COMPILE=/opt/nvidia/toolchains/tegra-4.8.1-nv/usr/bin/arm-cortex_a15-linux-gnueabi/arm-cortex_a15-linux-gnueabi- \
+# -sysroot /opt/nvidia/vibrante-vcm30t124-linux/targetfs \
+# -no-gcc-sysroot
+
+include(../common/linux_device_pre.conf)
+
+isEmpty(VIBRANTE_SDK_TOPDIR):error("You must pass -device-option VIBRANTE_SDK_TOPDIR=/path/to/sdk")
+
+QMAKE_INCDIR += \
+ $${VIBRANTE_SDK_TOPDIR}/include \
+ $$[QT_SYSROOT]/usr/include
+
+QMAKE_LIBDIR += \
+ $${VIBRANTE_SDK_TOPDIR}/lib-target \
+ $$[QT_SYSROOT]/usr/lib \
+ $$[QT_SYSROOT]/lib/arm-linux-gnueabihf \
+ $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf
+
+QMAKE_LFLAGS += \
+ -Wl,-rpath-link,$${VIBRANTE_SDK_TOPDIR}/lib-target \
+ -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
+ -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
+ -Wl,-rpath-link,$$[QT_SYSROOT]/lib/arm-linux-gnueabihf
+
+DISTRO_OPTS += hard-float
+COMPILER_FLAGS += -mtune=cortex-a15 -march=armv7-a -mfpu=neon-vfpv4 -DWIN_INTERFACE_CUSTOM
+
+EGLFS_DEVICE_INTEGRATION = eglfs_kms_egldevice
+
+include(../common/linux_arm_device_post.conf)
+load(qt_config)
diff --git a/mkspecs/devices/linux-jetson-tk1-pro-g++/qplatformdefs.h b/mkspecs/devices/linux-jetson-tk1-pro-g++/qplatformdefs.h
new file mode 100644
index 0000000000..beacd150b8
--- /dev/null
+++ b/mkspecs/devices/linux-jetson-tk1-pro-g++/qplatformdefs.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "../../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/devices/linux-nuc-g++/qmake.conf b/mkspecs/devices/linux-nuc-g++/qmake.conf
new file mode 100644
index 0000000000..fef5991341
--- /dev/null
+++ b/mkspecs/devices/linux-nuc-g++/qmake.conf
@@ -0,0 +1,20 @@
+#
+# qmake configuration for the Intel NUC DE3815TYKE targeting EGL/GLES either via KMS (eglfs) or Wayland
+#
+# Verified with a core-image-weston image produced by Yocto.
+
+include(../common/linux_device_pre.conf)
+
+QMAKE_LIBS_EGL += -lEGL
+QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
+
+NUC_CFLAGS = -m64
+QMAKE_CFLAGS += $$NUC_CFLAGS
+QMAKE_CXXFLAGS += $$NUC_CFLAGS
+
+# Preferred eglfs backend
+EGLFS_DEVICE_INTEGRATION = eglfs_kms
+
+include(../common/linux_device_post.conf)
+
+load(qt_config)
diff --git a/mkspecs/devices/linux-nuc-g++/qplatformdefs.h b/mkspecs/devices/linux-nuc-g++/qplatformdefs.h
new file mode 100644
index 0000000000..5ae49b35dd
--- /dev/null
+++ b/mkspecs/devices/linux-nuc-g++/qplatformdefs.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the qmake spec 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 "../../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
index bccb87e869..89177b7fa2 100644
--- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
+++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
@@ -8,13 +8,16 @@ QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
+QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/opt/vc/include \
$$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \
$$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
+QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
QMAKE_LIBS_EGL = -lEGL -lGLESv2
+QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2
contains(DISTRO, squeeze) {
#Debian Squeeze: Legacy everything
diff --git a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
index 9be3f401ce..2911f08873 100644
--- a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
+++ b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
@@ -6,17 +6,21 @@ QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
+QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/opt/vc/include \
$$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \
$$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
+QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
QMAKE_LIBS_EGL = -lEGL -lGLESv2
-QMAKE_CFLAGS += -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux
+QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2
+QMAKE_CFLAGS += -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
DISTRO_OPTS += hard-float
+DISTRO_OPTS += deb-multi-arch
# Preferred eglfs backend
EGLFS_DEVICE_INTEGRATION = eglfs_brcm
diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf
index f428f7db87..7d77598e76 100644
--- a/mkspecs/features/android/android.prf
+++ b/mkspecs/features/android/android.prf
@@ -3,7 +3,7 @@ contains(TEMPLATE, ".*app") {
!contains(TARGET, ".so"): TARGET = lib$${TARGET}.so
QMAKE_LFLAGS += -Wl,-soname,$$shell_quote($$TARGET)
- android_install: {
+ android_install {
target.path=/libs/$$ANDROID_TARGET_ARCH/
INSTALLS *= target
}
diff --git a/mkspecs/features/c++11.prf b/mkspecs/features/c++11.prf
deleted file mode 100644
index 32eaca4a9b..0000000000
--- a/mkspecs/features/c++11.prf
+++ /dev/null
@@ -1,10 +0,0 @@
-QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_CXX11
-QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CXXFLAGS_CXX11
-QMAKE_LFLAGS += $$QMAKE_LFLAGS_CXX11
-
-contains(QMAKE_LFLAGS, -stdlib=libc++) {
- equals(QMAKE_MACOSX_DEPLOYMENT_TARGET, 10.6): \
- QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
- contains(QMAKE_IOS_DEPLOYMENT_TARGET, ^4.*): \
- QMAKE_IOS_DEPLOYMENT_TARGET = 5.0
-}
diff --git a/mkspecs/features/c++14.prf b/mkspecs/features/c++14.prf
deleted file mode 100644
index a54d11840d..0000000000
--- a/mkspecs/features/c++14.prf
+++ /dev/null
@@ -1,17 +0,0 @@
-intel_icc {
- # ICC does not support C++14 yet
-} else: clang {
- # Clang has supported -std=c++1y since version 3.2
- greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 1): \
- QMAKE_CXXFLAGS_CXX11 = -std=c++1y
- # Unknown how long Apple Clang has supported -std=c++1y, but at least since XCode 5.0
- greaterThan(QT_APPLE_CLANG_MAJOR_VERSION, 4): \
- QMAKE_CXXFLAGS_CXX11 = -std=c++1y
-} else: gcc {
- # GCC has supported -std=c++1y since 4.8
- greaterThan(QT_GCC_MAJOR_VERSION, 4)|greaterThan(QT_GCC_MINOR_VERSION, 7): \
- QMAKE_CXXFLAGS_CXX11 = -std=c++1y
-}
-
-# Delegate to c++11.prf
-include(c++11.prf)
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index bdf40541ec..7183ade4df 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -56,6 +56,7 @@ mingw:isEmpty(CROSS_COMPILE):CMAKE_GENERATOR = -G \"MinGW Makefiles\"
BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP)
+!qtHaveModule(gui): CMAKE_MODULE_DEFINES += -DNO_GUI=True
!qtHaveModule(widgets): CMAKE_MODULE_DEFINES += -DNO_WIDGETS=True
!qtHaveModule(dbus): CMAKE_MODULE_DEFINES += -DNO_DBUS=True
diff --git a/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in b/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
index e804754912..7c42430e97 100644
--- a/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
@@ -1,11 +1,11 @@
set(PACKAGE_VERSION $$CMAKE_PACKAGE_VERSION)
-if(\"\${PACKAGE_VERSION}\" VERSION_LESS \"\${PACKAGE_FIND_VERSION}\")
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
- if(\"\${PACKAGE_FIND_VERSION}\" STREQUAL \"\${PACKAGE_VERSION}\")
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
diff --git a/mkspecs/features/data/unix/findclasslist.pl b/mkspecs/features/data/unix/findclasslist.pl
new file mode 100644
index 0000000000..adec22d58d
--- /dev/null
+++ b/mkspecs/features/data/unix/findclasslist.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/env perl
+#############################################################################
+##
+## Copyright (C) 2016 Intel Corporation
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the build configuration tools 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$
+##
+#############################################################################
+
+use strict;
+my $syntax = "findclasslist.pl\n" .
+ "Replaces each \@FILE:filename\@ in stdin with the classes found in that file\n";
+
+$\ = $/;
+while (<STDIN>) {
+ chomp;
+ unless (/\@FILE:(.*)\@/) {
+ print;
+ next;
+ }
+
+ # Replace this line with the class list
+ open HDR, "<$1" or die("Could not open header $1: $!");
+ my $comment = " /* $1 */";
+ while (my $line = <HDR>) {
+ # Match a struct or class declaration, but not a forward declaration
+ $line =~ /^(?:struct|class) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next;
+ print $comment if $comment;
+ printf " *%d%s*;\n", length $1, $1;
+ $comment = 0;
+ }
+ close HDR;
+}
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index bcaddc8363..cd8d8859aa 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -35,7 +35,6 @@ force_debug_info|debug: \
force_debug_info {
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
- QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
}
@@ -51,13 +50,11 @@ optimize_full {
debug {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG
- QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_DEBUG
QMAKE_LFLAGS += $$QMAKE_LFLAGS_DEBUG
QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_DEBUG
} else {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE
- QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_RELEASE
QMAKE_LFLAGS += $$QMAKE_LFLAGS_RELEASE
QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE
}
@@ -98,6 +95,20 @@ breakpad {
!isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME)
}
+c++11|c++14|c++1z {
+ c++1z: cxxstd = CXX1Z
+ else: c++14: cxxstd = CXX14
+ else: cxxstd = CXX11
+
+ # Check if we should disable the GNU extensions or not
+ !strict_c++:!isEmpty(QMAKE_CXXFLAGS_GNU$$cxxstd): cxxstd = GNU$$cxxstd
+
+ QMAKE_CXXFLAGS += $$eval(QMAKE_CXXFLAGS_$$cxxstd)
+ QMAKE_LFLAGS += $$eval(QMAKE_LFLAGS_$$cxxstd)
+
+ unset(cxxstd)
+}
+
!precompile_header: SOURCES += $$NO_PCH_SOURCES
QMAKE_INCDIR += $$QMAKE_INCDIR_POST
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
index eb3281ea1d..a247b46a72 100644
--- a/mkspecs/features/default_pre.prf
+++ b/mkspecs/features/default_pre.prf
@@ -8,6 +8,8 @@ CONFIG = \
testcase_targets import_plugins import_qpa_plugin \
$$CONFIG
+contains(QT_CONFIG, c++11):lessThan(QT_COMPILER_STDCXX, 201103): CONFIG += c++11
+
!build_pass:defined(QT_EDITION, var):!equals(QT_EDITION, "OpenSource"):!equals(QT_EDITION, "Preview") {
#
# call license checker (but cache result for one day)
diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
index cd3a0cf8cd..e0383ef530 100644
--- a/mkspecs/features/device_config.prf
+++ b/mkspecs/features/device_config.prf
@@ -19,10 +19,15 @@ defineTest(deviceSanityCheckCompiler) {
else: \
sfx =
+ # Build the compiler filename using the first value in QMAKE_CXX in order to
+ # support tools like ccache, which give QMAKE_CXX values of the form:
+ # ccache <path_to_compiler>
+ compiler = $$first(QMAKE_CXX)$$sfx
+
# Check if the binary exists with an absolute path. Do this check
# before the CROSS_COMPILE empty check below to allow the mkspec
# to derive the compiler path from other device options.
- exists($$QMAKE_CXX$$sfx):return()
+ exists($$compiler):return()
# Check for possible reasons of failure
# check if CROSS_COMPILE device-option is set
@@ -31,7 +36,7 @@ defineTest(deviceSanityCheckCompiler) {
# Check if QMAKE_CXX points to an executable.
ensurePathEnv()
for (dir, QMAKE_PATH_ENV) {
- exists($$dir/$${QMAKE_CXX}$$sfx): \
+ exists($$dir/$${compiler}): \
return()
}
diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf
index 4d88dcd15e..5d06198ae4 100644
--- a/mkspecs/features/exclusive_builds.prf
+++ b/mkspecs/features/exclusive_builds.prf
@@ -34,4 +34,5 @@ defineTest(addExclusiveBuilds) {
}
# Default directories to process
-QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR
+QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR QGLTF_DIR DESTDIR
+QMAKE_DIR_REPLACE_SANE += QGLTF_DIR
diff --git a/mkspecs/features/gcov.prf b/mkspecs/features/gcov.prf
index 330831fc0e..f45ba4c520 100644
--- a/mkspecs/features/gcov.prf
+++ b/mkspecs/features/gcov.prf
@@ -25,7 +25,6 @@
QMAKE_CFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
-QMAKE_OBJECTIVE_CFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CLEAN += $(OBJECTS_DIR)*.gcno and $(OBJECTS_DIR)*.gcda
diff --git a/mkspecs/features/lex.prf b/mkspecs/features/lex.prf
index 43d8fbd038..1ca9ae8afa 100644
--- a/mkspecs/features/lex.prf
+++ b/mkspecs/features/lex.prf
@@ -10,14 +10,23 @@
} else {
lex.variable_out = GENERATED_SOURCES
}
- isEmpty(QMAKE_LEXFLAGS_MANGLE):QMAKE_LEXFLAGS_MANGLE = -P${QMAKE_FILE_BASE}
- QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS
- !yacc_no_name_mangle:QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE
- lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \
- $$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \
- $$QMAKE_MOVE lex.${QMAKE_FILE_BASE}.c $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t)
- lex.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_lex$${first(QMAKE_EXT_CPP)}
+ contains(QMAKE_LEX, .*flex) {
+ # GNU flex, we can use -o outfile
+ lex.commands = $$QMAKE_LEX $$QMAKE_LEXFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ } else {
+ # stupid POSIX lex, it only generates a file called lex.yy.c
+ # or lex.prefix.c if the -P<prefix> option is active
+ intermediate_file = lex.yy.c
+ QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS $$QMAKE_LEXFLAGS_MANGLE
+
+ lex.commands = \
+ -$(DEL_FILE) ${QMAKE_FILE_OUT}$$escape_expand(\\n\\t) \
+ $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \
+ $(MOVE) $$intermediate_file ${QMAKE_FILE_OUT} $$escape_expand(\\n\\t)
+ unset(intermediate_file)
+ }
+ lex.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_LEX}$${first(QMAKE_EXT_CPP)}
silent:lex.commands = @echo Lex ${QMAKE_FILE_IN} && $$lex.commands
QMAKE_EXTRA_COMPILERS += lex
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index b459389c72..30960e66dd 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,20 +1,7 @@
load(default_post)
!no_objective_c:CONFIG += objective_c
-qt:!isEmpty(QT_CONFIG) {
- # Pick a suitable default architecture for qmake-based applications.
- # If the Qt package contains one of x86 and x86_64, pick that one. If it
- # contains both then use the compiler default. Make a similar decision for
- # PowerPC-based systems. Note that this logic assumes that Qt has been
- # configured with an architecture that is usable on the system.
- contains(QMAKE_HOST.arch, ppc)|contains(QMAKE_HOST.arch, "Power Macintosh") {
- !contains(QT_CONFIG, ppc64):contains(QT_CONFIG, ppc):CONFIG += ppc
- contains(QT_CONFIG, ppc64):!contains(QT_CONFIG, ppc):CONFIG += ppc64
- } else {
- !contains(QT_CONFIG, x86_64):contains(QT_CONFIG, x86):CONFIG += x86
- contains(QT_CONFIG, x86_64):!contains(QT_CONFIG, x86):CONFIG += x86_64
- }
-
+qt {
contains(QT_CONFIG, static) {
# C++11 support means using libc++ instead of libstd++. As the
# two libraries are incompatible we need to ensure the end user
@@ -35,31 +22,6 @@ qt:!isEmpty(QT_CONFIG) {
QMAKE_LFLAGS += -stdlib=libstdc++
}
}
- # If Qt was built with shared libraries with rpath support and project does
- # not specify own rpaths (including empty list) add one pointing to Qt
- # libraries. This applies only to apps, since all loaded libraries inherit
- # rpaths from current process executable.
- else:!if(host_build:force_bootstrap):equals(TEMPLATE, app):!defined(QMAKE_RPATHDIR, var):contains(QT_CONFIG, rpath) {
- # If app is expected to be installed into the Qt prefix build, use
- # relative path, so all SDK tools and examples work when relocated.
- prefix_build:defined(target.path, var):\
- contains(target.path, "$$re_escape($$[QT_INSTALL_PREFIX])/.*"):\
- # Tests are an exception, since they are launched in their build not
- # install location by CI, so we cannot use relative rpaths there.
- !contains(target.path, "$$re_escape($$[QT_INSTALL_TESTS])/.*") {
- app_bundle {
- ios: binpath = $$target.path/$${TARGET}.app
- else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS
- } else {
- binpath = $$target.path
- }
- QMAKE_RPATHDIR = @loader_path/$$relative_path($$[QT_INSTALL_LIBS], $$binpath)
- unset(binpath)
- } else {
- # Otherwise, use absolute path to Qt libraries
- QMAKE_RPATHDIR = $$[QT_INSTALL_LIBS]
- }
- }
}
macx-xcode:!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
diff --git a/mkspecs/features/mac/objective_c.prf b/mkspecs/features/mac/objective_c.prf
index 0f25f41eec..b3b1d4be99 100644
--- a/mkspecs/features/mac/objective_c.prf
+++ b/mkspecs/features/mac/objective_c.prf
@@ -1,23 +1,10 @@
-for(source, SOURCES) {
- contains(source,.*\\.mm?$) {
- warning(Objective-C source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES)
- SOURCES -= $$source
- OBJECTIVE_SOURCES += $$source
- }
-}
+# Objective-C/C++ sources go in SOURCES, like all other sources
+SOURCES += $$OBJECTIVE_SOURCES
-isEmpty(QMAKE_OBJECTIVE_CC):QMAKE_OBJECTIVE_CC = $$QMAKE_CC
+# Strip C/C++ flags from QMAKE_OBJECTIVE_CFLAGS just in case
+QMAKE_OBJECTIVE_CFLAGS -= $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS
-OBJECTIVE_C_OBJECTS_DIR = $$OBJECTS_DIR
-isEmpty(OBJECTIVE_C_OBJECTS_DIR):OBJECTIVE_C_OBJECTS_DIR = .
-isEmpty(QMAKE_EXT_OBJECTIVE_C):QMAKE_EXT_OBJECTIVE_C = .mm .m
-
-objective_c.dependency_type = TYPE_C
-objective_c.variables = QMAKE_OBJECTIVE_CFLAGS
-objective_c.commands = $$QMAKE_OBJECTIVE_CC -c $(QMAKE_COMP_QMAKE_OBJECTIVE_CFLAGS) $(DEFINES) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
-objective_c.output = $$OBJECTIVE_C_OBJECTS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
-objective_c.input = OBJECTIVE_SOURCES
-objective_c.name = Compile ${QMAKE_FILE_IN}
-silent:objective_c.commands = @echo objective-c ${QMAKE_FILE_IN} && $$objective_c.commands
-QMAKE_EXTRA_COMPILERS += objective_c
+# Add Objective-C/C++ flags to C/C++ flags, the compiler can handle it
+QMAKE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS
+QMAKE_CXXFLAGS += $$QMAKE_OBJECTIVE_CFLAGS
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index e238f8e005..210843bd94 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -32,7 +32,6 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version) {
!equals(MAKEFILE_GENERATOR, XCODE) {
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
- QMAKE_OBJECTIVE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH
}
@@ -72,9 +71,6 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
# FIXME: Get the version_min_flag out of the platform's 'Native Build System.xcspec'
version_identifier = $$replace(QMAKE_MAC_PLATFORM_NAME, iphonesimulator, ios-simulator)
- # C++11 support may affect the deployment target
- c++11: load(c++11)
-
ios:!host_build: \
deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
else: \
@@ -83,6 +79,5 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
QMAKE_CFLAGS += $$version_min_flag
QMAKE_CXXFLAGS += $$version_min_flag
- QMAKE_OBJECTIVE_CFLAGS += $$version_min_flag
QMAKE_LFLAGS += $$version_min_flag
}
diff --git a/mkspecs/features/plugin_bundle.prf b/mkspecs/features/plugin_bundle.prf
new file mode 100644
index 0000000000..f3e7294c90
--- /dev/null
+++ b/mkspecs/features/plugin_bundle.prf
@@ -0,0 +1,2 @@
+# Override mkspec default which creates a shared library
+mac: QMAKE_LFLAGS_PLUGIN = -bundle
diff --git a/mkspecs/features/qgltf.prf b/mkspecs/features/qgltf.prf
new file mode 100644
index 0000000000..c62e8c2ee8
--- /dev/null
+++ b/mkspecs/features/qgltf.prf
@@ -0,0 +1,11 @@
+qtPrepareTool(QMAKE_QGLTF, qgltf)
+
+isEmpty(QGLTF_DIR): QGLTF_DIR = .
+
+qgltf.input = QT3D_MODELS
+qgltf.output = $$QGLTF_DIR/${QMAKE_FILE_BASE}.qrc
+qgltf.variable_out += RESOURCES
+qgltf.commands = $$QMAKE_QGLTF -d $$QGLTF_DIR $$QGLTF_PARAMS ${QMAKE_FILE_NAME}
+silent: qgltf.commands = @echo qgltf ${QMAKE_FILE_IN} && $$qgltf.commands -s
+qgltf.CONFIG += no_link
+QMAKE_EXTRA_COMPILERS += qgltf
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index a639ac2969..daedeca3a0 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -19,6 +19,8 @@ if(win32|mac):!macx-xcode {
contains(QT_CONFIG, build_all):CONFIG += build_all
}
+CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable
+
!no_cxx_module:isEmpty(CXX_MODULE) {
CXX_MODULE = $$TARGET
TARGET = declarative_$${TARGET}
@@ -88,7 +90,6 @@ load(qt_common)
qmlplugindump = qmlplugindump
importpath.name = QML2_IMPORT_PATH
}
- qtPrepareTool(QMLPLUGINDUMP, $$qmlplugindump)
importpath.value =
for(qmod, QTREPOS) {
qml1_target: \
@@ -98,7 +99,9 @@ load(qt_common)
exists($$qmod): importpath.value += $$shell_path($$qmod)
}
importpath.value = $$unique(importpath.value)
- qtAddToolEnv(QMLPLUGINDUMP, importpath)
+ QT_TOOL_ENV = importpath
+ qtPrepareTool(QMLPLUGINDUMP, $$qmlplugindump)
+ QT_TOOL_ENV =
TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )
qmltypes.target = qmltypes
qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index be54d030e7..f62b6bb139 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -14,18 +14,6 @@ no_keywords:DEFINES += QT_NO_KEYWORDS
plugin { #Qt plugins
static:DEFINES += QT_STATICPLUGIN
DEFINES += QT_PLUGIN
-
- # Triggers both on Qt being configured with -arch boundschecker,
- # and if you qmake CONFIG+=boundchecker on your plugin project
- boundschecker|contains(QT_CONFIG,boundschecker) {
- # This option is added for plugins when Qt is configured for Boundschecker,
- # since we want Boundschecker to not instrument the qt_plugin_query_verification_data
- # function, as we call that function without the plugin's dependent DLLs, thus
- # Boundscheckers instrumentation will fail. The function only returns a const char *,
- # so no instrumentation is really needed on that function anyways.
- QMAKE_CFLAGS += /nmignore:*:qt_plugin_query_verification_data
- QMAKE_CXXFLAGS += /nmignore:*:qt_plugin_query_verification_data
- }
}
qtestlib {
@@ -57,23 +45,153 @@ qaxserver {
QT += axserver
}
+# target variable, flag source variable
+defineTest(qtProcessModuleFlags) {
+ for(flag, $$2) {
+ contains(flag, ^-.*): \
+ $$1 -= $$replace(flag, ^-, )
+ else: \
+ $$1 += $$flag
+ }
+ export($$1)
+}
+
unset(using_privates)
-qtAddModules(QT, LIBS)
-qtAddModules(QT_PRIVATE, LIBS_PRIVATE)
+var_sfx =
+for(ever) {
+ # qmake variables cannot contain dashes, so normalize the names first
+ CLEAN_QT$$var_sfx = $$replace(QT$$var_sfx, -private$, _private)
+ # Topological resolution of modules based on their QT.<module>.depends variable
+ FULL_QT$$var_sfx = $$resolve_depends(CLEAN_QT$$var_sfx, "QT.")
+ # Finally actually add the modules
+ unset(BAD_QT)
+ for(QTLIB, FULL_QT$$var_sfx) {
+ MODULE_NAME = $$eval(QT.$${QTLIB}.name)
+ MODULE_MODULE = $$eval(QT.$${QTLIB}.module)
+ MODULE_INCLUDES = $$eval(QT.$${QTLIB}.includes)
+ MODULE_LIBS = $$eval(QT.$${QTLIB}.libs)
+ MODULE_FRAMEWORKS = $$eval(QT.$${QTLIB}.frameworks)
+ MODULE_CONFIG = $$eval(QT.$${QTLIB}.module_config)
+
+ isEmpty(MODULE_NAME) {
+ BAD_QT += $$QTLIB
+ next()
+ }
+
+ contains(MODULE_CONFIG, internal_module): \
+ using_privates = true
+ contains(MODULE_CONFIG, ltcg): \
+ CONFIG += link_ltcg
+
+ qtProcessModuleFlags(CONFIG, QT.$${QTLIB}.CONFIG)
+ qtProcessModuleFlags(DEFINES, QT.$${QTLIB}.DEFINES)
+
+ MODULE_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
+ MODULE_LIBS_ADD = $$MODULE_LIBS
+ MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
+
+ !contains(MODULE_CONFIG, v2) {
+ # Backwards compatibility with pre-5.6 module .pri files
+
+ contains(MODULE_CONFIG, lib_bundle) {
+ MODULE_FRAMEWORKS = $$MODULE_LIBS
+ inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers
+ MODULE_INCLUDES = $$inc
+ contains(MODULE_CONFIG, internal_module): \
+ MODULE_INCLUDES += \
+ $$inc/$$eval(QT.$${QTLIB}.VERSION) \
+ $$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME
+ } else {
+ # Re-insert the major version in the library name (cf qt5LibraryTarget above)
+ MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
+ }
+
+ # Only link to this module if a libs directory is set, else this is just a module
+ # to give access to sources or include files, and not for linking.
+ !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \
+ MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX}
+ }
+
+ # Frameworks shouldn't need include paths, but much code does not use
+ # module-qualified #includes, so by default we add paths which point
+ # directly into the frameworks. Private modules have somewhat convoluted
+ # header paths, so adding them is necessary in every case.
+ !if(contains(MODULE_CONFIG, lib_bundle):qt_no_framework_direct_includes) \
+ |contains(MODULE_CONFIG, internal_module): \
+ INCLUDEPATH *= $$MODULE_INCLUDES
+ QMAKE_FRAMEWORKPATH *= $$MODULE_FRAMEWORKS
+ !isEmpty(MODULE_MODULE) {
+ contains(MODULE_CONFIG, lib_bundle) {
+ LIBS$$var_sfx += -framework $$MODULE_MODULE
+ } else {
+ !isEmpty(MODULE_LIBS_ADD): \
+ LIBS$$var_sfx += -L$$MODULE_LIBS_ADD
+
+ lib = $$MODULE_MODULE$$qtPlatformTargetSuffix()
+ LIBS$$var_sfx += -l$$lib
+
+ contains(MODULE_CONFIG, staticlib): \
+ PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
+
+ !isEmpty(QMAKE_LSB) {
+ !isEmpty(MODULE_LIBS_ADD): \
+ QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
+ QMAKE_LFLAGS *= --lsb-shared-libs=$$lib
+ QMAKE_LIBDIR *= /opt/lsb/lib
+ }
+ }
+ }
+ }
+ !isEmpty(BAD_QT):error("Unknown module(s) in QT$$var_sfx: $$replace(BAD_QT, _private$, -private)")
+
+ !isEmpty(var_sfx): break()
+ var_sfx = _PRIVATE
+}
!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
message("This project is using private headers and will therefore be tied to this specific Qt module build version.")
message("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
message("This is not a bug, but a result of using Qt internals. You have been warned!")
}
-qtAddRpathLink($$QT $$QT_PRIVATE)
-wince:static:gui {
- QTLIB += qmenu_wce.res
+qt_module_deps = $$CLEAN_QT $$CLEAN_QT_PRIVATE
+qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
+
+!no_qt_rpath:!static:contains(QT_CONFIG, rpath):!contains(QT_CONFIG, static):\
+ contains(qt_module_deps, core) {
+ relative_qt_rpath:!isEmpty(QMAKE_REL_RPATH_BASE):contains(INSTALLS, target):\
+ isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
+ mac {
+ if(equals(TEMPLATE, app):app_bundle)|\
+ if(equals(TEMPLATE, lib):plugin:plugin_bundle) {
+ ios: binpath = $$target.path/$${TARGET}.app
+ else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS
+ } else: equals(TEMPLATE, lib):!plugin:lib_bundle {
+ binpath = $$target.path/$${TARGET}.framework/Versions/Current
+ } else {
+ binpath = $$target.path
+ }
+ } else {
+ binpath = $$target.path
+ }
+ # NOT the /dev property, as INSTALLS use host paths
+ QMAKE_RPATHDIR += $$relative_path($$[QT_INSTALL_LIBS], $$binpath)
+ } else {
+ QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS/dev]
+ }
}
-qt_module_deps = $$QT $$QT_PRIVATE
-qt_module_deps = $$replace(qt_module_deps, -private$, _private)
-qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
+!isEmpty(QMAKE_LFLAGS_RPATHLINK):!contains(QT_CONFIG, static) {
+ # -rpath-link is used by the linker to find dependencies of dynamic
+ # libraries which were NOT specified on the command line.
+ # This means that paths of direct dependencies (QT & QT_PRIVATE)
+ # don't need to be listed, unlike their private dependencies' paths.
+ privdep = $$resolve_depends(qt_module_deps, "QT.", ".depends" ".run_depends")
+ privdep -= $$qt_module_deps
+ rpaths =
+ for(dep, privdep): \
+ rpaths += $$eval(QT.$${dep}.libs)
+ QMAKE_RPATHLINKDIR *= $$unique(rpaths)
+}
# static builds: link qml import plugins into the app.
contains(qt_module_deps, qml): \
@@ -98,7 +216,7 @@ contains(qt_module_deps, qml): \
!isEmpty(IMPORTS._KEYS_) {
# add import plugins to LIBS line
- for (key, IMPORTS._KEYS_): {
+ for (key, IMPORTS._KEYS_) {
PATH = $$eval(IMPORTS.$${key}.path)
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
!isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
@@ -234,14 +352,10 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
QT_PLUGINPATH = $$eval(QT_PLUGIN.$${QTPLUG}.TYPE)
# Generate the plugin linker line
- target_qt:isEqual(TARGET, QTPLUG) {
- warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
- } else {
- QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
- }
+ QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
# Only link against plugin in static builds
- isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
+ isEqual(QT_CURRENT_VERIFY, QTPLUGIN) {
!isEmpty(QT_PLUGINPATH) {
plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH)
isEmpty(plugpath): \
@@ -252,15 +366,18 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
# if the plugin is linked statically there is no need to deploy it
DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
}
- isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:if(wince*|winrt): {
+
+ # The following block is currently broken, because qt_plugin_XXX.prf files
+ # are not generated for dynamic builds.
+ false:isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:if(wince*|winrt) {
QT_ITEM =
debug: QT_ITEM = $${QTPLUG}d4.dll
else: QT_ITEM = $${QTPLUG}4.dll
- eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM})
- eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
+ qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM}
+ qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}
- DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
+ INSTALLS *= qt_additional_plugin_$${QTPLUG}
}
}
}
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
index 0f83fd7270..823a4c9490 100644
--- a/mkspecs/features/qt_app.prf
+++ b/mkspecs/features/qt_app.prf
@@ -21,7 +21,7 @@ QMAKE_LFLAGS += $$QMAKE_LFLAGS_GCSECTIONS
host_build: QT -= gui # no host tool will ever use gui
host_build:force_bootstrap {
- !build_pass: CONFIG += release
+ !build_pass:contains(QT_CONFIG, release_tools): CONFIG += release
contains(QT, core(-private)?|xml) {
QT -= core core-private xml
QT += bootstrap-private
@@ -30,6 +30,7 @@ host_build:force_bootstrap {
} else {
!build_pass:contains(QT_CONFIG, debug_and_release):contains(QT_CONFIG, build_all): CONFIG += release
target.path = $$[QT_INSTALL_BINS]
+ CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
}
INSTALLS += target
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 7197f84c9a..518fd93f04 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -52,9 +52,18 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
unset(modpath)
}
+# Don't actually try to install anything in non-prefix builds.
+# This is much easier and safer than making every single INSTALLS
+# assignment conditional.
+!prefix_build: \
+ CONFIG += qt_clear_installs
+
cross_compile: \
CONFIG += force_bootstrap
+android|ios|winrt: \
+ CONFIG += builtin_testdata
+
CONFIG += \
create_prl link_prl \
prepare_docs qt_docs_targets \
diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf
index 9163ac30b2..1848f00e90 100644
--- a/mkspecs/features/qt_build_paths.prf
+++ b/mkspecs/features/qt_build_paths.prf
@@ -20,10 +20,9 @@ isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
exists($$MODULE_BASE_INDIR/.git): \
CONFIG += git_build
-!prefix_build {
- QTDIR = $$[QT_HOST_PREFIX]
- # Permit modules to enforce being built outside QTDIR ...
- !force_independent: MODULE_BASE_OUTDIR = $$QTDIR
- # ... though this sort of breaks the idea.
- MODULE_QMAKE_OUTDIR = $$QTDIR
+!force_independent {
+ # If the module is not built independently, everything ends up in qtbase.
+ # This is the case in non-prefix builds, except for selected modules.
+ MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX]
+ MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX]
}
diff --git a/mkspecs/features/qt_clear_installs.prf b/mkspecs/features/qt_clear_installs.prf
new file mode 100644
index 0000000000..66d12f9d6d
--- /dev/null
+++ b/mkspecs/features/qt_clear_installs.prf
@@ -0,0 +1,12 @@
+#
+# W A R N I N G
+# -------------
+#
+# This file is not part of the Qt API. It exists purely as an
+# implementation detail. It may change from version to version
+# without notice, or even be removed.
+#
+# We mean it.
+#
+
+INSTALLS =
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 55f65b5526..38602f642d 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -12,7 +12,9 @@
QMAKE_DIR_REPLACE_SANE += DESTDIR
CONFIG -= debug_and_release_target
-contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++11): CONFIG += c++11 strict_c++
+contains(QT_CONFIG, c++14): CONFIG += c++14
+contains(QT_CONFIG, c++1z): CONFIG += c++1z
contains(TEMPLATE, .*lib) {
# module and plugins
!host_build:contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
@@ -46,18 +48,18 @@ warnings_are_errors:warning_clean {
# If the module declares that it has does its clean-up of warnings, enable -Werror.
# This setting is compiler-dependent anyway because it depends on the version of the
# compiler.
- clang {
- # Apple clang 4.0-4.2,5.0-5.1
- # Regular clang 3.3-3.6
+ clang:!ios {
+ # Apple clang 4.0-4.2,5.0-5.1,6.0-6.4
+ # Regular clang 3.3-3.7
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
- contains(apple_ver, "4\\.[012]|5\\.[01]")|contains(reg_ver, "3\\.[3-6]") {
+ contains(apple_ver, "4\\.[012]|5\\.[01]|6\\.[01234]")|contains(reg_ver, "3\\.[3-7]") {
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
}
} else:intel_icc:linux {
- # Intel CC 13.0 - 15.0, on Linux only
+ # Intel CC 13.0 - 16.0, on Linux only
ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION}
- linux:contains(ver, "(1[34]\\.|15\\.0)") {
+ linux:contains(ver, "(1[345]\\.|16\\.0)") {
# 177: function "entity" was declared but never referenced
# (too aggressive; ICC reports even for functions created due to template instantiation)
# 1224: #warning directive
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index bcc16ada78..183d0c9502 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -11,6 +11,27 @@
!exists($$QMAKE_DOCS): error("Cannot find documentation specification file $$QMAKE_DOCS")
+qtver.name = QT_VERSION
+qtver.value = $$VERSION
+isEmpty(qtver.value): qtver.value = $$MODULE_VERSION
+isEmpty(qtver.value): error("No version for documentation specified.")
+qtmver.name = QT_VER
+qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
+qtvertag.name = QT_VERSION_TAG
+qtvertag.value = $$replace(qtver.value, \.,)
+qtdocs.name = QT_INSTALL_DOCS
+qtdocs.value = $$[QT_INSTALL_DOCS/src]
+QT_TOOL_ENV = qtver qtmver qtvertag qtdocs
+qtPrepareTool(QDOC, qdoc)
+QT_TOOL_ENV =
+
+!build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
+
+# qtPrepareTool() must be called outside a build pass, as it protects
+# against concurrent wrapper creation by omitting it during build passes.
+# However, creating the actual targets is reserved to the build passes.
+debug_and_release:!build_pass: return()
+
load(qt_build_paths)
QMAKE_DOCS_BASE_OUTDIR = $$MODULE_BASE_OUTDIR/doc
@@ -18,10 +39,9 @@ QMAKE_DOCS_TARGET = $$replace(QMAKE_DOCS, ^(.*/)?(.*)\\.qdocconf$, \\2)
isEmpty(QMAKE_DOCS_TARGETDIR): QMAKE_DOCS_TARGETDIR = $$QMAKE_DOCS_TARGET
QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
-qtPrepareTool(QDOC, qdoc)
-QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR
+QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
!build_online_docs: \
- QDOC += -installdir $$[QT_INSTALL_DOCS]
+ QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
PREP_DOC_INDEXES =
DOC_INDEXES =
!isEmpty(QTREPOS) {
@@ -34,26 +54,15 @@ DOC_INDEXES =
mps += $$dirname(QT.$${d}.libs)
mps = $$unique(mps)
for (mp, mps): \
- PREP_DOC_INDEXES += -indexdir $$mp/doc
+ PREP_DOC_INDEXES += -indexdir $$shell_quote($$mp/doc)
}
for(qrep, QTREPOS): \
- DOC_INDEXES += -indexdir $$qrep/doc
+ DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
} else {
prepare_docs: \
- PREP_DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get]
- DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get]
+ PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
+ DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
}
-qtver.name = QT_VERSION
-qtver.value = $$VERSION
-isEmpty(qtver.value): qtver.value = $$MODULE_VERSION
-isEmpty(qtver.value): error("No version for documentation specified.")
-qtmver.name = QT_VER
-qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
-qtvertag.name = QT_VERSION_TAG
-qtvertag.value = $$replace(qtver.value, \.,)
-qtdocs.name = QT_INSTALL_DOCS
-qtdocs.value = $$[QT_INSTALL_DOCS/src]
-qtAddToolEnv(QDOC, qtver qtmver qtvertag qtdocs)
doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs {
prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors
@@ -63,8 +72,7 @@ prepare_docs {
}
!build_online_docs {
- qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
- qch_docs.commands = $$QHELPGENERATOR $$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp -o $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
+ qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
inst_html_docs.path = $$[QT_INSTALL_DOCS]
diff --git a/mkspecs/features/qt_docs_targets.prf b/mkspecs/features/qt_docs_targets.prf
index 89f080cc5e..1f9e2b0b47 100644
--- a/mkspecs/features/qt_docs_targets.prf
+++ b/mkspecs/features/qt_docs_targets.prf
@@ -29,17 +29,17 @@ QMAKE_EXTRA_TARGETS += docs
contains(TEMPLATE, subdirs) {
for(inst, DOC_TARGETS): \
prepareRecursiveTarget($$inst)
-} else:debug_and_release:!build_pass {
- sub = $$first(BUILDS)
- for(inst, DOC_TARGETS) {
- $${inst}.CONFIG = recursive
- $${inst}.recurse = $$sub
- }
} else {
- # apps and libs only generate docs if QMAKE_DOCS is set
- !isEmpty(QMAKE_DOCS) {
- # backwards compat hack
- load(qt_docs)
+ debug_and_release:!build_pass {
+ sub = $$first(BUILDS)
+ for(inst, DOC_TARGETS) {
+ $${inst}.CONFIG = recursive
+ $${inst}.recurse = $$sub
+ }
}
+ # Apps and libs request docs creation by setting QMAKE_DOCS.
+ # This is a backwards compat hack - technically, the modules which need it
+ # are supposed to load(qt_docs) themselves.
+ !isEmpty(QMAKE_DOCS): load(qt_docs)
}
QMAKE_EXTRA_TARGETS += $$DOC_TARGETS
diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
index ff842ca754..a644904981 100644
--- a/mkspecs/features/qt_example_installs.prf
+++ b/mkspecs/features/qt_example_installs.prf
@@ -9,6 +9,8 @@
# We mean it.
#
+contains(TEMPLATE, "vc.*"): return()
+
defineTest(addInstallFiles) {
for(sf, 2) {
sf = $$relative_path($$sf, $$_PRO_FILE_PWD_)
@@ -99,5 +101,7 @@ probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
SOURCES =
OBJECTIVE_SOURCES =
INSTALLS -= target
+ } else {
+ CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
}
}
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 0468c51f81..f1982d6e4e 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -15,7 +15,7 @@ defineReplace(qtPlatformTargetSuffix) {
defineReplace(qtLibraryTarget) {
LIBRARY_NAME = $$1
- mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
+ CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
}
@@ -38,24 +38,14 @@ defineTest(qtAddLibrary) {
# Reverse-engineer the module name from the library name.
for(var, QT_MODULES) {
isEqual(QT.$${var}.name, $$1) {
- qtAddModule($$var, LIBS)
+ QT += $$var
+ export(QT)
return(true)
}
}
error("No module matching library '$$1' found.")
}
-# target variable, flag source variable
-defineTest(qtProcessModuleFlags) {
- for(flag, $$2) {
- contains(flag, ^-.*): \
- $$1 -= $$replace(flag, ^-, )
- else: \
- $$1 += $$flag
- }
- export($$1)
-}
-
# qt module
defineTest(qtHaveModule) {
!isEmpty(QT.$$replace(1, -, _).name): \
@@ -63,137 +53,6 @@ defineTest(qtHaveModule) {
return(false)
}
-# qt module, libs variable
-defineTest(qtAddModule) {
- MODULE_NAME = $$eval(QT.$${1}.name)
- MODULE_INCLUDES = $$eval(QT.$${1}.includes)
- MODULE_LIBS = $$eval(QT.$${1}.libs)
- MODULE_CONFIG = $$eval(QT.$${1}.module_config)
-
- contains(MODULE_CONFIG, internal_module) {
- using_privates = true
- export(using_privates)
- }
- contains(MODULE_CONFIG, ltcg): CONFIG += link_ltcg
-
- qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG)
- qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES)
-
- MODULE_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
- MODULE_LIBS_ADD = $$MODULE_LIBS
- MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
-
- unset(LINKAGE)
- mac:contains(MODULE_CONFIG, lib_bundle) {
- FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers
- !qt_no_framework_direct_includes {
- INCLUDEPATH *= $$FRAMEWORK_INCLUDE
- }
- contains(MODULE_CONFIG, internal_module): \
- INCLUDEPATH += \
- $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \
- $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME
- QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
- export(QMAKE_FRAMEWORKPATH)
- !contains(MODULE_CONFIG, no_link): \
- LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX}
- } else {
- INCLUDEPATH *= $$MODULE_INCLUDES
- }
- export(INCLUDEPATH)
-
- # Only link to this module if a libs directory is set, else this is just a module
- # to give access to sources or include files, and not for linking.
- !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link) {
-
- # Re-insert the major version in the library name (cf qt5LibraryTarget above)
- # unless it's a framework build
- !mac|!contains(MODULE_CONFIG, lib_bundle): \
- MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
-
- win32 {
- # Make sure the version number isn't appended again to the lib name
- ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE
- dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE
- $$ver_var = 0
- $$dver_var = 0
- export($$ver_var)
- export($$dver_var)
- }
-
- isEmpty(LINKAGE) {
- !isEmpty(MODULE_LIBS_ADD): \
- LINKAGE = -L$$MODULE_LIBS_ADD
- lib = $${MODULE_NAME}$${QT_LIBINFIX}$$qtPlatformTargetSuffix()
- LINKAGE += -l$$lib
-
- contains(QT_CONFIG, rpath) {
- QMAKE_RPATHDIR *= $$eval(QT.$${1}.rpath)
- export(QMAKE_RPATHDIR)
- }
-
- contains(MODULE_CONFIG, staticlib) {
- PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
- export(PRE_TARGETDEPS)
- }
- }
-
- $$2 += $$LINKAGE
- export($$2)
-
- !isEmpty(QMAKE_LSB) {
- !isEmpty(MODULE_LIBS_ADD): \
- QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
- QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX}
- QMAKE_LIBDIR *= /opt/lsb/lib
- export(QMAKE_LFLAGS)
- export(QMAKE_LIBDIR)
- }
- }
-}
-
-# qt variable, libs variable
-defineTest(qtAddModules) {
- # qmake variables cannot contain dashes, so normalize the names first
- $$1 = $$replace($$1, -private$, _private)
- # Topological resolution of modules based on their QT.<module>.depends variable
- $$1 = $$resolve_depends($$1, "QT.")
- # Finally actually add the modules
- unset(BAD_QT)
- for(QTLIB, $$1) {
- QTLIBNAME = $$eval(QT.$${QTLIB}.name)
- isEmpty(QTLIBNAME) {
- BAD_QT += $$QTLIB
- next()
- }
-
- target_qt:isEqual(TARGET, $$QTLIBNAME) {
- warning("$$TARGET cannot have a $$1 of $$QTLIB")
- next()
- }
-
- qtAddModule($$QTLIB, $$2)
- }
- !isEmpty(BAD_QT):error("Unknown module(s) in $$1: $$replace(BAD_QT, _private$, -private)")
-}
-
-defineTest(qtAddRpathLink) {
- # -rpath-link is used by the linker to find dependencies of dynamic
- # libraries which were NOT specified on the command line.
- # This means that paths of direct dependencies (QT & QT_PRIVATE)
- # don't need to appear here. However, their private dependencies'
- # paths OTOH need to be put there.
- pubqt = $$replace(1, -private$, _private)
- pubdep = $$resolve_depends(pubqt, "QT.")
- privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".run_depends")
- privdep -= $$pubdep
- rpaths =
- for(dep, privdep): \
- rpaths += $$eval(QT.$${dep}.libs)
- QMAKE_RPATHLINKDIR *= $$unique(rpaths)
- export(QMAKE_RPATHLINKDIR)
-}
-
# variable, default, [suffix for variable for system() use], [prepare primary variable for system() use]
defineTest(qtPrepareTool) {
cmd = $$eval(QT_TOOL.$${2}.binary)
@@ -211,6 +70,7 @@ defineTest(qtPrepareTool) {
}
}
QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars)
+ QT_TOOL_NAME = $$2
!isEmpty(3)|!isEmpty(4) {
$$1$$3 =
for (arg, cmd): \
@@ -231,29 +91,73 @@ defineTest(qtAddToolEnv) {
ds = $$QMAKE_DIR_SEP
else: \
ds = $$DIR_SEPARATOR
+ batch_sets =
for(env, 2) {
value = $$eval($${env}.value)
!isEmpty(value) {
name = $$eval($${env}.name)
+ config = $$eval($${env}.CONFIG)
equals(ds, /) {
- contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
+ contains(config, prepend): infix = \${$$name:+:\$$$name}
+ else: contains(config, always_prepend): infix = :\$$$name
else: infix =
- val = "$$name=$$shell_quote($$join(value, :))$$infix"
+ # Under msys, this path is taken only in the non-system()
+ # case, so using shell_quote() always works.
+ batch_sets += \
+ "$$name=$$shell_quote($$join(value, :))$$infix" \
+ "export $$name"
} else {
- # Escape closing parens when expanding the variable, otherwise cmd confuses itself.
- contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
- else: infix =
+ value ~= s,\\^,^^^^,g
+ value ~= s,!,^^!,g
value ~= s,\\),^),g
- val = "(set $$name=$$join(value, ;)$$infix) &"
- }
- isEmpty(3): !contains(TEMPLATE, vc.*) {
- contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
- val ~= s,\\\$,\$\$,g
+ contains(config, prepend) {
+ batch_sets += \
+ "if defined $$name (" \
+ " set $$name=$$join(value, ;);!$$name!" \
+ ") else (" \
+ " set $$name=$$join(value, ;)" \
+ ")"
+ } else: contains(config, always_prepend) {
+ batch_sets += "(set $$name=$$join(value, ;);!$$name!)"
+ } else {
+ batch_sets += "(set $$name=$$join(value, ;))"
+ }
}
- $$1 = "$$val $$eval($$1)"
}
}
+ !isEmpty(batch_sets) {
+ batch_name = wrapper
+ !isEmpty(QT_TOOL_NAME): batch_name = $${QT_TOOL_NAME}_wrapper
+ cmd = $$eval($$1)
+ !isEmpty(cmd): cmd = "$$cmd "
+ equals(ds, /) {
+ batch_name = $${batch_name}.sh
+ batch_cont = \
+ "$$LITERAL_HASH!/bin/sh" \
+ $$batch_sets \
+ "exec $$cmd\"$@\""
+ # It would be nicer to use the '.' command (without 'exec' above),
+ # but that doesn't set the positional arguments under (d)ash.
+ $$1 =
+ } else {
+ batch_name = $${batch_name}.bat
+ batch_cont = \
+ "@echo off" \
+ "SetLocal EnableDelayedExpansion" \
+ $$batch_sets \
+ "$$cmd%*" \
+ "EndLocal"
+ $$1 = call
+ }
+ !build_pass:!write_file($$OUT_PWD/$$batch_name, batch_cont, exe): error("Aborting.")
+ isEmpty(3): \
+ $$1 += $$shell_quote($$shell_path($$OUT_PWD/$$batch_name))
+ else: \
+ $$1 += $$system_quote($$system_path($$OUT_PWD/$$batch_name))
+ QMAKE_DISTCLEAN += $$OUT_PWD/$$batch_name
+ }
export($$1)
+ export(QMAKE_DISTCLEAN)
}
# target variable, dependency var name, [non-empty: prepare for system(), not make]
@@ -261,15 +165,9 @@ defineTest(qtAddTargetEnv) {
deps = $$replace($$2, -private$, _private)
deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends")
!isEmpty(deps) {
- ptypes =
- for(dep, deps) {
- isEmpty(3): \
- deppath += $$shell_path($$eval(QT.$${dep}.libs))
- else: \
- deppath += $$system_path($$eval(QT.$${dep}.libs))
- ptypes += $$eval(QT.$${dep}.plugin_types)
- }
+ deppath.CONFIG = prepend
equals(QMAKE_HOST.os, Windows) {
+ deppath.CONFIG = always_prepend
deppath.name = PATH
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
deppath.name = LD_LIBRARY_PATH
@@ -285,8 +183,15 @@ defineTest(qtAddTargetEnv) {
} else {
error("Operating system not supported.")
}
+ ptypes =
+ for(dep, deps) {
+ isEmpty(3): \
+ deppath += $$shell_path($$eval(QT.$${dep}.libs))
+ else: \
+ deppath += $$system_path($$eval(QT.$${dep}.libs))
+ ptypes += $$eval(QT.$${dep}.plugin_types)
+ }
deppath.value = $$unique(deppath)
- deppath.CONFIG = prepend
pluginpath.value =
ppaths = $$[QT_INSTALL_PLUGINS/get]
@@ -301,6 +206,7 @@ defineTest(qtAddTargetEnv) {
pluginpath.value += $$system_path($$qplug)
}
pluginpath.name = QT_PLUGIN_PATH
+ pluginpath.CONFIG = prepend
QT_TOOL_ENV += deppath pluginpath
}
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index f187b85b6d..e543ea65e6 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -32,7 +32,7 @@ host_build {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_SPLIT_SECTIONS
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SPLIT_SECTIONS
force_bootstrap {
- !build_pass: CONFIG += release
+ !build_pass:contains(QT_CONFIG, release_tools): CONFIG += release
contains(QT, core(-private)?|xml) {
QT -= core core-private xml
QT += bootstrap-private
@@ -42,6 +42,11 @@ host_build {
}
}
+CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework): \
+ CONFIG += lib_bundle
+
+CONFIG += relative_qt_rpath # Qt libraries should be relocatable
+
ucmodule = $$upper($$MODULE)
isEmpty(MODULE_INCNAME): MODULE_INCNAME = $$TARGET
@@ -51,6 +56,8 @@ internal_module: \
else: \
MODULE_DEPENDS = $$replace(QT, -private$, )
MODULE_DEPENDS = $$unique(MODULE_DEPENDS)
+contains(MODULE_DEPENDS, $$MODULE): \
+ error("$$TARGET depends on itself.")
contains(TARGET, QtAddOn.*): \
MODULE_DEFINE = QT_ADDON_$${ucmodule}_LIB
@@ -73,10 +80,10 @@ CONFIG += qmake_cache target_qt
QMAKE_DOCS_TARGETDIR = qt$${MODULE}
-load(qt_module_pris)
load(qt_common)
-
!no_module_headers: load(qt_module_headers)
+load(qt_module_pris)
+
INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes)
# If Qt was configured with -debug-and-release then build the module the same way
@@ -86,7 +93,7 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu
contains(QT_CONFIG, build_all):CONFIG += build_all
}
-linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
QT += $$QT_FOR_PRIVATE
unset(QT_FOR_PRIVATE)
@@ -99,17 +106,15 @@ else: \
DEFINES += QT_BUILD_$${ucmodule}_LIB
# OS X and iOS frameworks
-mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
+lib_bundle {
# Set the CFBundleIdentifier prefix for Qt frameworks
QMAKE_TARGET_BUNDLE_PREFIX = org.qt-project
#QMAKE_FRAMEWORK_VERSION = 4.0
- CONFIG += sliced_bundle qt_framework
+ CONFIG += sliced_bundle
header_module {
CONFIG += bundle
QMAKE_BUNDLE_EXTENSION = .framework
QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.lib
- } else {
- CONFIG += lib_bundle
}
CONFIG -= qt_install_headers #no need to install these as well
!debug_and_release|!build_all|CONFIG(release, debug|release) {
@@ -127,7 +132,6 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
}
mac {
- CONFIG += explicitlib
macx-g++ {
QMAKE_CFLAGS += -fconstant-cfstrings
QMAKE_CXXFLAGS += -fconstant-cfstrings
@@ -187,7 +191,49 @@ equals(QT_ARCH, i386):contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):compiler_support
QMAKE_CXXFLAGS += -mfpmath=sse
}
-android: CONFIG += qt_android_deps
+android: CONFIG += qt_android_deps no_linker_version_script
+
+!header_module:unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!no_linker_version_script:!static {
+ verscript = $$OUT_PWD/$${TARGET}.version
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_VERSION_SCRIPT}$$verscript
+
+ internal_module {
+ verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API { *; };"
+ } else {
+ verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API {" \
+ " qt_private_api_tag*;"
+ for(header, SYNCQT.PRIVATE_HEADER_FILES): \
+ verscript_content += " @FILE:$${_PRO_FILE_PWD_}/$$header@"
+ verscript_content += "};"
+
+ current = Qt_$$QT_MAJOR_VERSION
+ verscript_content += "$$current { *; };"
+ isEmpty(QT_NAMESPACE): tag_symbol = qt_version_tag
+ else: tag_symbol = qt_version_tag_$$QT_NAMESPACE
+
+ for(i, 0..$$QT_MINOR_VERSION) {
+ previous = $$current
+ current = Qt_$${QT_MAJOR_VERSION}.$$i
+ equals(i, $$QT_MINOR_VERSION): verscript_content += "$$current { $$tag_symbol; } $$previous;"
+ else: verscript_content += "$$current {} $$previous;"
+ }
+
+ # Add a post-processing step to replace the @FILE:filename@
+ verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $${verscript}.in > $@
+ verscriptprocess.target = $$verscript
+ for(header, SYNCQT.PRIVATE_HEADER_FILES): \
+ verscriptprocess.depends += $${_PRO_FILE_PWD_}/$$header
+ verscriptprocess.depends += $${verscript}.in
+ QMAKE_EXTRA_TARGETS += verscriptprocess
+ PRE_TARGETDEPS += $$verscript
+ verscript = $${verscript}.in
+ }
+ write_file($$verscript, verscript_content)|error("Aborting.")
+ unset(current)
+ unset(previous)
+ unset(verscript)
+ unset(verscript_content)
+}
#install directives
load(qt_installs)
@@ -195,7 +241,7 @@ load(qt_installs)
load(qt_targets)
# this builds on top of qt_common
-unix|mingw {
+!internal_module:!lib_bundle:if(unix|mingw) {
CONFIG += create_pc
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
host_build: \
@@ -215,19 +261,18 @@ unix|mingw {
pclib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR
pclib_replace.CONFIG = path
QMAKE_PKGCONFIG_INSTALL_REPLACE += pclib_replace
-
- unix {
- CONFIG += create_libtool explicitlib
- host_build: \
- QMAKE_LIBTOOL_LIBDIR = $$[QT_HOST_LIBS]
- else: \
- QMAKE_LIBTOOL_LIBDIR = "=$$[QT_INSTALL_LIBS/raw]"
- ltlib_replace.match = $$lib_replace.match
- !isEmpty(lib_replace.replace): \
- ltlib_replace.replace = $$QMAKE_LIBTOOL_LIBDIR
- ltlib_replace.CONFIG = path
- QMAKE_LIBTOOL_INSTALL_REPLACE += ltlib_replace
- }
+}
+!lib_bundle:unix {
+ CONFIG += create_libtool
+ host_build: \
+ QMAKE_LIBTOOL_LIBDIR = $$[QT_HOST_LIBS]
+ else: \
+ QMAKE_LIBTOOL_LIBDIR = "=$$[QT_INSTALL_LIBS/raw]"
+ ltlib_replace.match = $$lib_replace.match
+ !isEmpty(lib_replace.replace): \
+ ltlib_replace.replace = $$QMAKE_LIBTOOL_LIBDIR
+ ltlib_replace.CONFIG = path
+ QMAKE_LIBTOOL_INSTALL_REPLACE += ltlib_replace
}
contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE
diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf
index 3f2383c120..eb1db08405 100644
--- a/mkspecs/features/qt_module_headers.prf
+++ b/mkspecs/features/qt_module_headers.prf
@@ -18,17 +18,78 @@ load(qt_build_paths)
} else {
contains(QT_CONFIG, private_tests): \ # -developer-build
QMAKE_SYNCQT += -check-includes
- QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION
}
+ for(mod, MODULE_INCNAME): \
+ QMAKE_SYNCQT += -module $$mod
QMAKE_SYNCQT += \
- -outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
+ -version $$VERSION -outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
!silent: message($$QMAKE_SYNCQT)
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
- include-distclean.commands = $$QMAKE_DEL_TREE $$shell_quote($$shell_path($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME))
- QMAKE_EXTRA_TARGETS += include-distclean
- DISTCLEAN_DEPS += include-distclean
+ !minimal_syncqt {
+ include-distclean.commands = \
+ $$QMAKE_DEL_TREE $$shell_quote($$shell_path($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME))
+ QMAKE_EXTRA_TARGETS += include-distclean
+ DISTCLEAN_DEPS += include-distclean
+ }
+}
+
+# Pre-generated headers in the source tree (tar-ball) and
+# - shadow build or
+# - non-shadow non-prefix build of a module which is not qtbase
+# (because the build-time generated headers all end up in qtbase).
+!git_build: \
+ if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \
+ |if(!prefix_build:!equals(MODULE_BASE_INDIR, $$[QT_HOST_PREFIX]))): \
+ CONFIG += split_incpath
+
+# To avoid stuffing the code with repetetive conditionals,
+# we parametrize the names of the variables we assign to.
+
+# Internal modules have no private part - they *are* private.
+!internal_module: \
+ prv = _PRIVATE
+
+# When doing a framework build with a prefix, the module needs to point
+# into the frameworks' Headers dirs directly, as no shared include/ dir
+# is installed.
+# However, during the build, it needs to point into the shared include/
+# dir, as the framework doesn't even exist yet. For bootstrapped modules
+# which borrow headers from "proper" modules, this situation persists
+# even beyond the module's own build. The implication of this is that
+# qmake might never use a framework's headers in a non-prefix build,
+# as there is no separate set of .pri files for users outside Qt.
+prefix_build:lib_bundle: \
+ fwd = _FWD
+# When using a split include path during the build, the installed module's
+# include path is also structurally different from that in the build dir.
+prefix_build:split_incpath: \
+ sfwd = _FWD
+
+ibase = \$\$QT_MODULE_INCLUDE_BASE
+MODULE$${fwd}_INCLUDES = $$ibase
+split_incpath {
+ bibase = $$val_escape(MODULE_BASE_OUTDIR)/include
+ MODULE$${sfwd}_INCLUDES += $$bibase
+}
+for(mod, MODULE_INCNAME) {
+ mibase = $$ibase/$$mod
+ MODULE$${fwd}_INCLUDES += $$mibase
+ MODULE$${fwd}$${prv}_INCLUDES += $$mibase/$$VERSION $$mibase/$$VERSION/$$mod
+ split_incpath {
+ mbibase = $$bibase/$$mod
+ MODULE$${sfwd}_INCLUDES += $$mbibase
+ generated_privates: \
+ MODULE$${sfwd}$${prv}_INCLUDES += $$mbibase/$$VERSION $$mbibase/$$VERSION/$$mod
+ }
+ prefix_build:lib_bundle {
+ mfbase = \$\$QT_MODULE_LIB_BASE/$${mod}.framework/Headers
+ MODULE_INCLUDES += $$mfbase
+ MODULE$${prv}_INCLUDES += $$mfbase/$$VERSION $$mfbase/$$VERSION/$$mod
+ }
}
+MODULE_INCLUDES += $$MODULE_AUX_INCLUDES
+MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES
minimal_syncqt: return()
@@ -38,6 +99,9 @@ git_build: \
else: \
INC_PATH = $$MODULE_BASE_INDIR
include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true)
+CONFIG += qt_install_headers
+
+alien_syncqt: return()
for (injection, SYNCQT.INJECTIONS) {
injects = $$split(injection, :)
@@ -82,8 +146,6 @@ SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER
isEmpty(PRECOMPILED_HEADER): PRECOMPILED_HEADER = $$MODULE_MASTER_DEPS_HEADER
}
-CONFIG += qt_install_headers
-
headersclean:!internal_module {
# Make sure that the header compiles with our strict options
hcleanDEFS = -DQT_NO_CAST_TO_ASCII=1 \
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index 1d727847e2..5f5639a1cf 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -10,14 +10,7 @@
#
load(qt_build_paths)
-# Pre-generated headers in the source tree and
-# - shadow build or
-# - non-shadow non-prefix build of a module which is not qtbase (because the build-time
-# generated headers all end up in qtbase).
-!git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \
- |if(!prefix_build:!equals(MODULE_BASE_INDIR, $$[QT_HOST_PREFIX]))): \
- CONFIG += split_incpath
-force_independent|split_incpath: \
+force_independent|!isEmpty(MODULE_FWD_INCLUDES): \
CONFIG += need_fwd_pri
mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
need_fwd_pri: \
@@ -49,31 +42,26 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
module_libs = "\$\$QT_MODULE_HOST_LIB_BASE"
else: \
module_libs = "\$\$QT_MODULE_LIB_BASE"
- unix:!static {
- host_build: \
- module_rpath = $$[QT_HOST_LIBS]
- else: \
- module_rpath = $$[QT_INSTALL_LIBS/dev]
- module_rpath = "QT.$${MODULE_ID}.rpath = $$val_escape(module_rpath)"
- } else {
- module_rpath =
- }
!isEmpty(QT_PRIVATE): \
module_rundep = "QT.$${MODULE_ID}.run_depends = $$replace(QT_PRIVATE, -private$, _private)"
else: \
module_rundep =
+ module_build_type = v2
static: \
- module_build_type = staticlib
- else:mac:contains(QT_CONFIG, qt_framework): \
- module_build_type = lib_bundle
- else: \
- module_build_type =
- equals(TEMPLATE, aux): \
- module_build_type += no_link
+ module_build_type += staticlib
+ lib_bundle {
+ module_build_type += lib_bundle
+ MODULE_FRAMEWORKS = " \$\$QT_MODULE_LIB_BASE"
+ }
internal_module: \
module_build_type += internal_module
ltcg: \
module_build_type += ltcg
+ module_module =
+ !equals(TEMPLATE, aux) {
+ module_module = $$TARGET$$QT_LIBINFIX
+ !lib_bundle: module_module ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
+ }
!isEmpty(MODULE_CONFIG): \
module_config = "QT.$${MODULE_ID}.CONFIG = $$MODULE_CONFIG"
else: \
@@ -86,27 +74,6 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
module_master = "QT.$${MODULE_ID}.master_header = $$MODULE_MASTER_HEADER"
else: \
module_master =
- !no_module_headers:!minimal_syncqt {
- MODULE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME
- MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \
- \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME
- }
- split_incpath {
- MODULE_SHADOW_INCLUDES = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \
- $$MODULE_BASE_OUTDIR/include)
- generated_privates: \
- MODULE_SHADOW_PRIVATE_INCLUDES = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \
- $$MODULE_BASE_OUTDIR/include)
- }
- MODULE_INCLUDES += $$MODULE_AUX_INCLUDES
- MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES
- internal_module: \
- MODULE_INCLUDES += $$MODULE_PRIVATE_INCLUDES
- split_incpath {
- MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$val_escape(MODULE_SHADOW_INCLUDES)"
- generated_privates: \
- MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}_private.includes += $$val_escape(MODULE_SHADOW_PRIVATE_INCLUDES)"
- }
MODULE_PRI_CONT = \
"QT.$${MODULE_ID}.VERSION = $${VERSION}" \
"QT.$${MODULE_ID}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
@@ -114,10 +81,11 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
"QT.$${MODULE_ID}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
"" \
"QT.$${MODULE_ID}.name = $$TARGET" \
+ "QT.$${MODULE_ID}.module = $$module_module" \
"QT.$${MODULE_ID}.libs = $$module_libs" \
- $$module_rpath \
$$module_master \
- "QT.$${MODULE_ID}.includes = $$MODULE_INCLUDES"
+ "QT.$${MODULE_ID}.includes = $$MODULE_INCLUDES" \
+ "QT.$${MODULE_ID}.frameworks =$$MODULE_FRAMEWORKS"
!host_build: MODULE_PRI_CONT += \
"QT.$${MODULE_ID}.bins = \$\$QT_MODULE_BIN_BASE" \
"QT.$${MODULE_ID}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \
@@ -135,7 +103,11 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
"QT_MODULES += $$MODULE"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
!internal_module:!no_private_module {
- module_build_type += internal_module no_link
+ module_build_type += internal_module
+ private_deps = $$QT
+ private_deps -= $$MODULE_DEPENDS
+ private_deps += $$MODULE $$QT_FOR_PRIVATE
+ private_deps ~= s,-private$,_private,g
MODULE_PRIVATE_PRI_CONT = \
"QT.$${MODULE}_private.VERSION = $${VERSION}" \
"QT.$${MODULE}_private.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
@@ -143,9 +115,11 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
"QT.$${MODULE}_private.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
"" \
"QT.$${MODULE}_private.name = $${TARGET}" \ # Same name as base module
+ "QT.$${MODULE}_private.module =" \
"QT.$${MODULE}_private.libs = $$module_libs" \
"QT.$${MODULE}_private.includes = $$MODULE_PRIVATE_INCLUDES" \
- "QT.$${MODULE}_private.depends = $$replace($$list($$MODULE $$QT_FOR_PRIVATE), -private$, _private)" \
+ "QT.$${MODULE}_private.frameworks =" \
+ "QT.$${MODULE}_private.depends = $$private_deps" \
"QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")"
write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error("Aborting.")
}
@@ -153,7 +127,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
need_fwd_pri {
- split_incpath: \
+ !git_build: \
MODULE_BASE_INCDIR = $$MODULE_BASE_INDIR
else: \
MODULE_BASE_INCDIR = $$MODULE_BASE_OUTDIR
@@ -173,7 +147,15 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
!internal_module:!no_private_module: MODULE_FWD_PRI_CONT += \
"include($$val_escape(MODULE_PRIVATE_PRI))" \
"QT.$${MODULE}_private.priority = 1"
- MODULE_FWD_PRI_CONT += $$MODULE_FWD_PRI_CONT_SUFFIX
+ !isEmpty(MODULE_FWD_INCLUDES) {
+ !lib_bundle: \
+ pls = +
+ MODULE_FWD_PRI_CONT += \
+ "QT.$${MODULE_ID}.includes $$pls= $$MODULE_FWD_INCLUDES"
+ !internal_module: \
+ MODULE_FWD_PRI_CONT += \
+ "QT.$${MODULE}_private.includes $$pls= $$MODULE_FWD_PRIVATE_INCLUDES"
+ }
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
MODULE_PRI_FILES += $$MODULE_FWD_PRI
@@ -199,8 +181,8 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
include($$mod_work_pfx/qt_lib_$${pri}.pri)
for(mod, mods_to_load) {
for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
- name depends run_depends plugin_types module_config CONFIG DEFINES \
- priority includes bins libs libexecs plugins imports qml \
+ name module depends run_depends plugin_types module_config CONFIG DEFINES \
+ priority includes bins libs frameworks libexecs plugins imports qml \
)):defined(QT.$${mod}.$$var, var):cache(QT.$${mod}.$$var, transient)
}
cache(QT_MODULES, transient)
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 17748e518a..220f11bd75 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -30,6 +30,8 @@ tool_plugin {
contains(QT_CONFIG, build_all):CONFIG += build_all
}
+CONFIG += relative_qt_rpath # Qt's plugins should be relocatable
+
CONFIG(static, static|shared)|prefix_build {
isEmpty(MODULE): MODULE = $$basename(TARGET)
diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf
index 1d3e88cbe9..839c3d6b88 100644
--- a/mkspecs/features/qt_tool.prf
+++ b/mkspecs/features/qt_tool.prf
@@ -12,6 +12,7 @@
load(qt_app)
CONFIG += console
+DEFINES *= QT_USE_QSTRINGBUILDER
# If we are doing a prefix build, create a "module" pri which enables
# qtPrepareTool() to work with the non-installed build.
@@ -63,3 +64,5 @@ CONFIG += console
cache(QT_TOOL.$${MODULE}.$$var, transient)
}
+# The variable is re-used by qtPrepareTool(), and we really don't want that.
+unset(QT_TOOL_ENV)
diff --git a/mkspecs/features/resolve_target.prf b/mkspecs/features/resolve_target.prf
index aa52e9d67e..d6460c1d9d 100644
--- a/mkspecs/features/resolve_target.prf
+++ b/mkspecs/features/resolve_target.prf
@@ -54,13 +54,13 @@ win32 {
} else {
equals(TEMPLATE, lib) {
static {
- QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.a
+ QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_STATICLIB}
} else: plugin|unversioned_libname {
- QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.so
+ QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_SHLIB}
} else {
TEMP_VERSION = $$VERSION
isEmpty(TEMP_VERSION):TEMP_VERSION = 1.0.0
- QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.so.$${TEMP_VERSION}
+ QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_SHLIB}.$${TEMP_VERSION}
}
} else {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index 8564731a22..7a38ff8f38 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -6,6 +6,66 @@ isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
!contains(QMAKE_RESOURCE_FLAGS, -root):!isEmpty(QMAKE_RESOURCE_ROOT):QMAKE_RESOURCE_FLAGS += -root $$QMAKE_RESOURCE_ROOT
!contains(QMAKE_RESOURCE_FLAGS, -name): QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE}
+# http://www.w3.org/TR/xml/#syntax
+defineReplace(xml_escape) {
+ 1 ~= s,&,&amp;,
+ 1 ~= s,\',&apos;,
+ 1 ~= s,\",&quot;,
+ 1 ~= s,<,&lt;,
+ 1 ~= s,>,&gt;,
+ return($$1)
+}
+
+RESOURCES += qmake_immediate
+for(resource, RESOURCES) {
+ # Regular case of user qrc file
+ contains(resource, ".*\.qrc$"): \
+ next()
+
+ # Fallback for stand-alone files/directories
+ !defined($${resource}.files, var) {
+ !equals(resource, qmake_immediate) {
+ !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
+ warning("Failure to find: $$resource")
+ qmake_immediate.files += $$resource
+ }
+ RESOURCES -= $$resource
+ next()
+ }
+
+ resource_file = $$RCC_DIR/qmake_$${resource}.qrc
+
+ !debug_and_release|build_pass {
+ # Collection of files, generate qrc file
+ prefix = $$eval($${resource}.prefix)
+ isEmpty(prefix): \
+ prefix = "/"
+
+ resource_file_content = \
+ "<!DOCTYPE RCC><RCC version=\"1.0\">" \
+ "<qresource prefix=\"$$xml_escape($$prefix)\">"
+
+ abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_)
+
+ for(file, $${resource}.files) {
+ abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_)
+ alias = $$relative_path($$abs_path, $$abs_base)
+ resource_file_content += \
+ "<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$abs_path)</file>"
+ }
+
+ resource_file_content += \
+ "</qresource>" \
+ "</RCC>"
+
+ !write_file($$OUT_PWD/$$resource_file, resource_file_content): \
+ error("Aborting.")
+ }
+
+ RESOURCES -= $$resource
+ RESOURCES += $$resource_file
+}
+
rcc.input = RESOURCES
rcc.name = RCC ${QMAKE_FILE_IN}
rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
diff --git a/mkspecs/features/spec_pre.prf b/mkspecs/features/spec_pre.prf
index cdc1d7ee1e..ff310d9793 100644
--- a/mkspecs/features/spec_pre.prf
+++ b/mkspecs/features/spec_pre.prf
@@ -7,6 +7,8 @@ QMAKE_DIRLIST_SEP = $$DIRLIST_SEPARATOR
QMAKE_EXT_C = .c
QMAKE_EXT_CPP = .cpp .cc .cxx
+QMAKE_EXT_OBJC = .m
+QMAKE_EXT_OBJCXX = .mm
QMAKE_EXT_CPP_MOC = .moc
QMAKE_EXT_H = .h .hpp .hh .hxx
QMAKE_EXT_H_MOC = .cpp
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index a6ef930128..5ad372f976 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -9,6 +9,11 @@ testcase_exceptions: CONFIG += exceptions
check.files =
check.path = .
+# Add environment for non-installed builds. Do this first, so the
+# 'make' variable expansions don't end up in a batch file/script.
+QT_TOOL_NAME = target
+qtAddTargetEnv(check.commands, QT)
+
# If the test ends up in a different directory, we should cd to that directory.
TESTRUN_CWD = $$DESTDIR
@@ -27,7 +32,7 @@ check.commands += $(TESTRUNNER)
unix {
isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = .
- mac:app_bundle: \
+ app_bundle: \
check.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
else: \
check.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET)
@@ -40,10 +45,6 @@ unix {
# Allow for custom arguments to tests
check.commands += $(TESTARGS)
-# Add environment for non-installed builds
-qtAddTargetEnv(check.commands, QT)
-
-# This must happen after adding the environment.
!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \
check.commands = cd $$shell_path($$TESTRUN_CWD) && $$check.commands
@@ -79,7 +80,7 @@ isEmpty(BUILDS)|build_pass {
INSTALLS += target
}
-contains(INSTALLS, target) {
+!builtin_testdata:contains(INSTALLS, target) {
# Install testdata and helpers as well, but only if we're actually installing the test.
#
# Testdata is installed relative to the directory containing the testcase
@@ -180,6 +181,20 @@ contains(INSTALLS, target) {
}
}
+builtin_testdata {
+ ALL_TESTDATA = $$TESTDATA $$GENERATED_TESTDATA
+ # RESOURCES does not support wildcards (for good reasons)
+ for(td, ALL_TESTDATA): \
+ testdata.files += $$files($$absolute_path($$td, $$_PRO_FILE_PWD_))
+ !isEmpty(testdata.files) {
+ testdata.base = $$_PRO_FILE_PWD_
+ RESOURCES += testdata
+ }
+
+ !isEmpty(TEST_HELPER_INSTALLS): \
+ error("This platform does not support tests which require helpers.")
+}
+
macx-xcode:bundle:isEmpty(QMAKE_BUNDLE_EXTENSION) {
QMAKE_PBX_PRODUCT_TYPE = com.apple.product-type.bundle.unit-test
QMAKE_PBX_BUNDLE_TYPE = wrapper.cfbundle
diff --git a/mkspecs/features/unix/hide_symbols.prf b/mkspecs/features/unix/hide_symbols.prf
index 4af99c2eac..f4d3921cb1 100644
--- a/mkspecs/features/unix/hide_symbols.prf
+++ b/mkspecs/features/unix/hide_symbols.prf
@@ -1,4 +1,3 @@
QMAKE_CFLAGS += $$QMAKE_CFLAGS_HIDESYMS
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_HIDESYMS
-QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_HIDESYMS
QMAKE_LFLAGS += $$QMAKE_LFLAGS_HIDESYMS
diff --git a/mkspecs/features/warn_off.prf b/mkspecs/features/warn_off.prf
index e37979c035..072a7aca15 100644
--- a/mkspecs/features/warn_off.prf
+++ b/mkspecs/features/warn_off.prf
@@ -1,4 +1,3 @@
CONFIG -= warn_on
QMAKE_CFLAGS += $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_WARN_OFF
-QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_OFF \ No newline at end of file
diff --git a/mkspecs/features/warn_on.prf b/mkspecs/features/warn_on.prf
index 7e78a8e0d3..03a4a24a61 100644
--- a/mkspecs/features/warn_on.prf
+++ b/mkspecs/features/warn_on.prf
@@ -1,5 +1,4 @@
CONFIG -= warn_off
QMAKE_CFLAGS += $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_WARN_ON
-QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_ON
diff --git a/mkspecs/features/win32/idcidl.prf b/mkspecs/features/win32/idcidl.prf
index a688b3ff41..fba7173e79 100644
--- a/mkspecs/features/win32/idcidl.prf
+++ b/mkspecs/features/win32/idcidl.prf
@@ -1,4 +1,4 @@
-build_pass:console: {
+build_pass:console {
warning("QAxServer applications cannot be console applications.")
warning("Remove 'console' from your CONFIG.")
}
diff --git a/mkspecs/features/win32/windows.prf b/mkspecs/features/win32/windows.prf
index 6ea9756f9a..986067fc8c 100644
--- a/mkspecs/features/win32/windows.prf
+++ b/mkspecs/features/win32/windows.prf
@@ -5,7 +5,7 @@ contains(TEMPLATE, ".*app") {
mingw:DEFINES += QT_NEEDS_QMAIN
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
- isEqual(entryLib, -lqtmain): {
+ isEqual(entryLib, -lqtmain) {
!contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \
QMAKE_LIBS += -L$$QT.core.libs
CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d
diff --git a/mkspecs/features/winrt/font_deployment.prf b/mkspecs/features/winrt/font_deployment.prf
deleted file mode 100644
index c767d5bc1a..0000000000
--- a/mkspecs/features/winrt/font_deployment.prf
+++ /dev/null
@@ -1,62 +0,0 @@
-# Provide default fonts for windows phone
-# The DEFAULTFONTS variable indicates, whether the default set of fonts is
-# used for deployment. The check below won't work after the fonts are added
-# so this helper variable is added and used for the user warning check later.
-!defined(FONTS, var):winphone {
- FONTS = \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Bold.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-BoldOblique.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Bold.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-BoldOblique.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Oblique.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Oblique.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Bold.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-BoldOblique.ttf \
- $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Oblique.ttf
- DEFAULTFONTS =
-}
-
-if(build_pass:equals(TEMPLATE, "app"))| \
-if(!build_pass:equals(TEMPLATE, "vcapp")) {
- defined(DEFAULTFONTS, var) {
- message(Default fonts will automatically be deployed with your application. \
- To avoid automatic deployment unset the \"FONTS\" variable (\"FONTS =\") in your .pro file. \
- You can also customize which fonts are deployed by setting the \"FONTS\" variable.)
- }
-
- contains(TEMPLATE, "vc.*") {
- BUILD_DIR = $$OUT_PWD
- } else {
- load(resolve_target)
- BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET)
- }
-
- for (FONT, FONTS) {
- font_$${FONT}.input = $$FONT
- font_$${FONT}.output = $$BUILD_DIR/fonts/$$basename(FONT)
- font_$${FONT}.CONFIG = verbatim
- QMAKE_SUBSTITUTES += font_$${FONT}
- }
-
- !isEmpty(FONTS):equals(TEMPLATE, "app") {
- fonts.files = $$BUILD_DIR/fonts/*
- isEmpty(target.path) {
- fonts.path = $$OUT_PWD/fonts
- } else {
- fonts.path = $$target.path/fonts
- }
-
- INSTALLS += fonts
- }
-}
-
-!isEmpty(FONTS):winphone:equals(TEMPLATE, "vcapp"):build_pass {
- for (FONT, FONTS) {
- fonts.files += $$OUT_PWD/fonts/$$basename(FONT)
- }
- fonts.path = fonts
- DEPLOYMENT += fonts
-}
diff --git a/mkspecs/features/winrt/package_manifest.prf b/mkspecs/features/winrt/package_manifest.prf
index 0f6f185170..3520fcdf93 100644
--- a/mkspecs/features/winrt/package_manifest.prf
+++ b/mkspecs/features/winrt/package_manifest.prf
@@ -108,6 +108,10 @@
INDENT = "$$escape_expand(\\r\\n) "
+ # All Windows 10 applications need to have internetClient. It is also not marked as additional
+ # capability anymore and is assumed to be standard.
+ *-msvc2015: WINRT_MANIFEST.capabilities += internetClient
+
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device)
@@ -125,10 +129,14 @@
# Dependencies are given as a string list. The CRT dependency is added automatically above.
# For MSVC2015 the dependencies are added in conjunction with TargetDeviceFamily
+ # Due to the hard coded dependency on "Windows.Universal" the <Dependencies> tag
+ # is already inside the MSVC2015 manifest.
WINRT_MANIFEST.dependencies = $$unique(WINRT_MANIFEST.dependencies)
!isEmpty(WINRT_MANIFEST.dependencies) {
+ *-msvc2013: MANIFEST_DEPENDENCIES += "<Dependencies>"
for(DEPENDENCY, WINRT_MANIFEST.dependencies): \
MANIFEST_DEPENDENCIES += " <PackageDependency Name=\"$$DEPENDENCY\" />"
+ *-msvc2013: MANIFEST_DEPENDENCIES += "</Dependencies>"
WINRT_MANIFEST.dependencies = $$join(MANIFEST_DEPENDENCIES, $$INDENT, $$INDENT)
}
diff --git a/mkspecs/features/yacc.prf b/mkspecs/features/yacc.prf
index 4d7e0a381b..e78dd8cbb3 100644
--- a/mkspecs/features/yacc.prf
+++ b/mkspecs/features/yacc.prf
@@ -9,9 +9,9 @@
isEmpty(QMAKE_YACCFLAGS_MANGLE) {
- QMAKE_YACCFLAGS_MANGLE = -p ${QMAKE_FILE_BASE}
- QMAKE_YACC_HEADER = y.tab.h
- QMAKE_YACC_SOURCE = y.tab.c
+ QMAKE_YACCFLAGS_MANGLE = -p ${QMAKE_FILE_BASE} -b ${QMAKE_FILE_BASE}
+ QMAKE_YACC_HEADER = ${QMAKE_FILE_BASE}.tab.h
+ QMAKE_YACC_SOURCE = ${QMAKE_FILE_BASE}.tab.c
} else {
QMAKE_YACCFLAGS_MANGLE ~= s/\\$base/${QMAKE_FILE_BASE}/g #backwards compat
QMAKE_YACC_HEADER ~= s/\\$base/${QMAKE_FILE_BASE}/g
@@ -21,11 +21,11 @@
!yacc_no_name_mangle:QMAKE_YACCDECLFLAGS += $$QMAKE_YACCFLAGS_MANGLE
yacc_decl.commands = \
+ -$(DEL_FILE) $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \
$$QMAKE_YACC $$QMAKE_YACCDECLFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \
- $$QMAKE_DEL_FILE $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \
- $$QMAKE_MOVE $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)}$$escape_expand(\\n\\t) \
- $$QMAKE_MOVE $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t)
- yacc_decl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)}
+ $(MOVE) $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)}$$escape_expand(\\n\\t) \
+ $(MOVE) $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t)
+ yacc_decl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)}
silent:yacc_decl.commands = @echo Yacc ${QMAKE_FILE_IN} && $$yacc_decl.commands
QMAKE_EXTRA_COMPILERS += yacc_decl
@@ -36,7 +36,7 @@
yacc_impl.input = YACCSOURCES
yacc_impl.variable_out = GENERATED_SOURCES
yacc_impl.commands = $$escape_expand(\\n) # We don't want any commands where, but if command is empty no rules are created
- yacc_impl.depends = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_H)} # Make sure we depend on the step above
- yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}_yacc$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above
+ yacc_impl.depends = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} # Make sure we depend on the step above
+ yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above
QMAKE_EXTRA_COMPILERS += yacc_impl
}
diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf
index 47505fc06a..282b6bdfa7 100644
--- a/mkspecs/freebsd-g++/qmake.conf
+++ b/mkspecs/freebsd-g++/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
+include(../common/unix.conf)
+
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
@@ -27,7 +29,6 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
load(qt_config)
diff --git a/mkspecs/freebsd-g++46/qmake.conf b/mkspecs/freebsd-g++46/qmake.conf
index 277997ab28..b930fca78b 100644
--- a/mkspecs/freebsd-g++46/qmake.conf
+++ b/mkspecs/freebsd-g++46/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
+include(../common/unix.conf)
+
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
@@ -27,7 +29,6 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
diff --git a/mkspecs/freebsd-icc/qmake.conf b/mkspecs/freebsd-icc/qmake.conf
index fb419f7e5b..d72ea73278 100644
--- a/mkspecs/freebsd-icc/qmake.conf
+++ b/mkspecs/freebsd-icc/qmake.conf
@@ -30,6 +30,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc intel_icc # icc pretends to be gcc
QMAKE_CC = icc
@@ -90,5 +92,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/haiku-g++/qmake.conf b/mkspecs/haiku-g++/qmake.conf
index 6144392385..ac28069864 100644
--- a/mkspecs/haiku-g++/qmake.conf
+++ b/mkspecs/haiku-g++/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = haiku
+include(../common/unix.conf)
+
# Choose haiku QPA Plugin as default
QT_QPA_DEFAULT_PLATFORM = haiku
@@ -23,5 +25,5 @@ QMAKE_RANLIB =
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
-include(../common/unix.conf)
+
load(qt_config)
diff --git a/mkspecs/hpux-acc-64/qmake.conf b/mkspecs/hpux-acc-64/qmake.conf
index 2156b448fe..f0b879de83 100644
--- a/mkspecs/hpux-acc-64/qmake.conf
+++ b/mkspecs/hpux-acc-64/qmake.conf
@@ -49,6 +49,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
QMAKE_COMPILER_DEFINES += __hpux __HP_aCC
+include(../common/unix.conf)
+
QMAKE_COMPILER = hp_acc
QMAKE_CC = cc
@@ -111,5 +113,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpux-acc-o64/qmake.conf b/mkspecs/hpux-acc-o64/qmake.conf
index 69c3df1375..750bb99155 100644
--- a/mkspecs/hpux-acc-o64/qmake.conf
+++ b/mkspecs/hpux-acc-o64/qmake.conf
@@ -48,6 +48,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
+include(../common/unix.conf)
+
QMAKE_COMPILER = hp_acc
QMAKE_CC = cc
@@ -109,5 +111,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpux-acc/qmake.conf b/mkspecs/hpux-acc/qmake.conf
index eaa8888fbe..2f1ce1054c 100644
--- a/mkspecs/hpux-acc/qmake.conf
+++ b/mkspecs/hpux-acc/qmake.conf
@@ -28,6 +28,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
QMAKE_COMPILER_DEFINES += __hpux __HP_aCC
+include(../common/unix.conf)
+
QMAKE_COMPILER = hp_acc
QMAKE_CC = cc
@@ -90,5 +92,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpux-g++-64/qmake.conf b/mkspecs/hpux-g++-64/qmake.conf
index 3e822edbfb..a27333fa18 100644
--- a/mkspecs/hpux-g++-64/qmake.conf
+++ b/mkspecs/hpux-g++-64/qmake.conf
@@ -8,6 +8,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -73,5 +75,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpux-g++/qmake.conf b/mkspecs/hpux-g++/qmake.conf
index 866a3416bc..b488da7178 100644
--- a/mkspecs/hpux-g++/qmake.conf
+++ b/mkspecs/hpux-g++/qmake.conf
@@ -9,6 +9,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
CONFIG += plugin_no_soname
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -74,5 +76,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpuxi-acc-32/qmake.conf b/mkspecs/hpuxi-acc-32/qmake.conf
index 79bf20fbb2..e80a7973fe 100644
--- a/mkspecs/hpuxi-acc-32/qmake.conf
+++ b/mkspecs/hpuxi-acc-32/qmake.conf
@@ -6,6 +6,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
CONFIG += plugin_no_soname
+include(../common/unix.conf)
+
QMAKE_COMPILER = hp_acc
QMAKE_CC = cc
@@ -66,5 +68,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpuxi-acc-64/qmake.conf b/mkspecs/hpuxi-acc-64/qmake.conf
index aaec3eab14..360e35c5d6 100644
--- a/mkspecs/hpuxi-acc-64/qmake.conf
+++ b/mkspecs/hpuxi-acc-64/qmake.conf
@@ -49,6 +49,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
CONFIG += plugin_no_soname
+include(../common/unix.conf)
+
QMAKE_COMPILER = hp_acc
QMAKE_CC = cc
@@ -109,5 +111,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hpuxi-g++-64/qmake.conf b/mkspecs/hpuxi-g++-64/qmake.conf
index 8a05a5f611..4c376de719 100644
--- a/mkspecs/hpuxi-g++-64/qmake.conf
+++ b/mkspecs/hpuxi-g++-64/qmake.conf
@@ -13,6 +13,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = hpux
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -76,5 +78,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf
index e7e4e3a82d..f2e3242627 100644
--- a/mkspecs/hurd-g++/qmake.conf
+++ b/mkspecs/hurd-g++/qmake.conf
@@ -7,6 +7,8 @@ QMAKE_PLATFORM += hurd
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/unix.conf)
+
QMAKE_CFLAGS_THREAD += -D_REENTRANT
QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
@@ -46,7 +48,6 @@ QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
-include(../common/unix.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
load(qt_config)
diff --git a/mkspecs/irix-cc-64/qmake.conf b/mkspecs/irix-cc-64/qmake.conf
index 05c8b6fc84..ad5c6a3ee1 100644
--- a/mkspecs/irix-cc-64/qmake.conf
+++ b/mkspecs/irix-cc-64/qmake.conf
@@ -38,6 +38,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = irix
QMAKE_COMPILER_DEFINES += __sgi __EDG
+include(../common/unix.conf)
+
QMAKE_COMPILER = sgi_cc
QMAKE_CC = cc
@@ -103,5 +105,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = -r $(OBJECTS_DIR)so_locations $(OBJECTS_DIR)ii_files
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/irix-cc/qmake.conf b/mkspecs/irix-cc/qmake.conf
index 72d4e65474..52abdf8578 100644
--- a/mkspecs/irix-cc/qmake.conf
+++ b/mkspecs/irix-cc/qmake.conf
@@ -38,6 +38,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = irix
QMAKE_COMPILER_DEFINES += __sgi __EDG
+include(../common/unix.conf)
+
QMAKE_COMPILER = sgi_cc
QMAKE_CC = cc
@@ -103,5 +105,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = -r $(OBJECTS_DIR)so_locations $(OBJECTS_DIR)ii_files
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/irix-g++-64/qmake.conf b/mkspecs/irix-g++-64/qmake.conf
index 12c224b5c0..bd258df5e8 100644
--- a/mkspecs/irix-g++-64/qmake.conf
+++ b/mkspecs/irix-g++-64/qmake.conf
@@ -6,6 +6,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = irix
QMAKE_COMPILER_DEFINES += __sgi __GNUC__
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -73,5 +75,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = so_locations
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/irix-g++/qmake.conf b/mkspecs/irix-g++/qmake.conf
index 2c02165e0d..57a27b6a1b 100644
--- a/mkspecs/irix-g++/qmake.conf
+++ b/mkspecs/irix-g++/qmake.conf
@@ -6,6 +6,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = irix
QMAKE_COMPILER_DEFINES += __sgi __GNUC__
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -73,5 +75,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = so_locations
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/linux-cxx/qmake.conf b/mkspecs/linux-cxx/qmake.conf
index 1c7cafc6f2..b156bea084 100644
--- a/mkspecs/linux-cxx/qmake.conf
+++ b/mkspecs/linux-cxx/qmake.conf
@@ -7,6 +7,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = linux
+include(../common/unix.conf)
+
QMAKE_COMPILER = compaq_cc
QMAKE_CC = ccc
@@ -61,5 +63,4 @@ QMAKE_LIBS_OPENGL = -lGL
QMAKE_AR = ar cqs
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/linux-g++-32/qmake.conf b/mkspecs/linux-g++-32/qmake.conf
index 340aa85e7c..f09abeeec0 100644
--- a/mkspecs/linux-g++-32/qmake.conf
+++ b/mkspecs/linux-g++-32/qmake.conf
@@ -6,10 +6,12 @@ MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/linux.conf)
+
QMAKE_CFLAGS = -m32
QMAKE_LFLAGS = -m32
-include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
+
load(qt_config)
diff --git a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf
index 36fb6a83eb..a79b69ff31 100644
--- a/mkspecs/linux-g++-64/qmake.conf
+++ b/mkspecs/linux-g++-64/qmake.conf
@@ -9,10 +9,11 @@ MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/linux.conf)
+
QMAKE_CFLAGS = -m64
QMAKE_LFLAGS = -m64
-include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h
index 5c18632e5d..95a57585d9 100644
--- a/mkspecs/linux-g++/qplatformdefs.h
+++ b/mkspecs/linux-g++/qplatformdefs.h
@@ -78,10 +78,10 @@
#undef QT_SOCKLEN_T
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
-#define QT_SOCKLEN_T socklen_t
-#else
+#if defined(__GLIBC__) && (__GLIBC__ < 2)
#define QT_SOCKLEN_T int
+#else
+#define QT_SOCKLEN_T socklen_t
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index 9190aa9f28..57f6c45ac1 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -18,13 +18,15 @@ QMAKE_CFLAGS_WARN_ON = -w1 -Wall -Wcheck -wd1572,873,2259,2261
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing
QMAKE_CFLAGS_DEBUG = -O0 -g
-QMAKE_CFLAGS_SHLIB = -fPIC -fno-jump-tables
+QMAKE_CFLAGS_SHLIB = -fPIC
QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_THREAD = -D_REENTRANT
QMAKE_CFLAGS_SPLIT_SECTIONS = -ffunction-sections
-QMAKE_CFLAGS_LTCG = -ipo
+QMAKE_CFLAGS_LTCG = -ipo -fno-fat-lto-objects
+QMAKE_CFLAGS_LTCG_FATOBJECTS = -ffat-lto-objects
+QMAKE_CFLAGS_DISABLE_LTCG = -no-ipo
QMAKE_CFLAGS_SSE2 += -xSSE2
QMAKE_CFLAGS_SSE3 += -xSSE3
@@ -50,7 +52,14 @@ QMAKE_CXXFLAGS_SPLIT_SECTIONS = $$QMAKE_CFLAGS_SPLIT_SECTIONS
# Disabling exceptions disabled - workaround for QTBUG-36577
#QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
QMAKE_CXXFLAGS_CXX11 = -std=c++0x
+QMAKE_CXXFLAGS_CXX14 = -std=c++1y
+QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
+QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++0x
+QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
+QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS
+QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
QMAKE_INCDIR =
QMAKE_LIBDIR =
@@ -72,6 +81,8 @@ QMAKE_LFLAGS_NOUNDEF = -Wl,-z,defs
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link,
QMAKE_LFLAGS_CXX11 =
+QMAKE_LFLAGS_CXX14 =
+QMAKE_LFLAGS_CXX1Z =
QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_LIBS =
@@ -97,6 +108,7 @@ QMAKE_CXXFLAGS_PRECOMPILE = -c -pch-create ${QMAKE_PCH_OUTPUT} -include ${QMAKE_
# -Bsymbolic-functions (ld) support
QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
+QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script,
# Symbol visibility control
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
diff --git a/mkspecs/linux-kcc/qmake.conf b/mkspecs/linux-kcc/qmake.conf
index 06efc8c12c..591a59537f 100644
--- a/mkspecs/linux-kcc/qmake.conf
+++ b/mkspecs/linux-kcc/qmake.conf
@@ -16,6 +16,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = linux
+include(../common/unix.conf)
+
QMAKE_COMPILER = kai_cc
QMAKE_CC = KCC
@@ -78,5 +80,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = -r $(OBJECTS_DIR)ti_files
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/linux-pgcc/qmake.conf b/mkspecs/linux-pgcc/qmake.conf
index 286f937b0e..c41823ba94 100644
--- a/mkspecs/linux-pgcc/qmake.conf
+++ b/mkspecs/linux-pgcc/qmake.conf
@@ -7,6 +7,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = linux
+include(../common/unix.conf)
+
QMAKE_COMPILER = portland_cc
QMAKE_CC = pgcc
@@ -67,5 +69,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/lynxos-g++/qmake.conf b/mkspecs/lynxos-g++/qmake.conf
index a53d6a8ec7..91bcc6b85d 100644
--- a/mkspecs/lynxos-g++/qmake.conf
+++ b/mkspecs/lynxos-g++/qmake.conf
@@ -9,6 +9,8 @@ QMAKE_PLATFORM = lynxos
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -74,5 +76,4 @@ QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/macx-clang-32/qmake.conf b/mkspecs/macx-clang-32/qmake.conf
index 87c601ee74..ec33c02e93 100644
--- a/mkspecs/macx-clang-32/qmake.conf
+++ b/mkspecs/macx-clang-32/qmake.conf
@@ -14,7 +14,6 @@ include(../common/clang-mac.conf)
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
QMAKE_CFLAGS += -arch i386
-QMAKE_OBJECTIVE_CFLAGS += -arch i386
QMAKE_CXXFLAGS += -arch i386
QMAKE_LFLAGS += -arch i386
diff --git a/mkspecs/macx-g++-32/qmake.conf b/mkspecs/macx-g++-32/qmake.conf
index 2a8197ebbd..af6fe5689e 100644
--- a/mkspecs/macx-g++-32/qmake.conf
+++ b/mkspecs/macx-g++-32/qmake.conf
@@ -17,7 +17,6 @@ include(../common/g++-macx.conf)
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
QMAKE_CFLAGS += -arch i386
-QMAKE_OBJECTIVE_CFLAGS += -arch i386
QMAKE_CXXFLAGS += -arch i386
QMAKE_LFLAGS += -arch i386
diff --git a/mkspecs/macx-icc/qmake.conf b/mkspecs/macx-icc/qmake.conf
index 5e45e67d0c..70ea5ee80f 100644
--- a/mkspecs/macx-icc/qmake.conf
+++ b/mkspecs/macx-icc/qmake.conf
@@ -18,12 +18,13 @@ QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125,2259,2261,3280
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE =
QMAKE_CFLAGS_DEBUG = -g
-QMAKE_CFLAGS_SHLIB = -fPIC -fno-jump-tables
+QMAKE_CFLAGS_SHLIB = -fPIC
QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_THREAD =
QMAKE_CFLAGS_SPLIT_SECTIONS = -ffunction-sections
QMAKE_CFLAGS_LTCG = -ipo
+QMAKE_CFLAGS_DISABLE_LTCG = -no-ipo
QMAKE_CFLAGS_SSE2 += -msse2
QMAKE_CFLAGS_SSE3 += -msse3
@@ -33,14 +34,6 @@ QMAKE_CFLAGS_SSE4_2 += -msse4.2
QMAKE_CFLAGS_AVX += -mavx
QMAKE_CFLAGS_AVX2 += -march=core-avx2
-QMAKE_OBJECTIVE_CC = clang
-QMAKE_OBJECTIVE_CFLAGS = -pipe
-QMAKE_OBJECTIVE_CFLAGS_WARN_ON = -Wall -W
-QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = -w
-QMAKE_OBJECTIVE_CFLAGS_RELEASE = -Os
-QMAKE_OBJECTIVE_CFLAGS_DEBUG = -g
-QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = -fvisibility=hidden
-
QMAKE_CXX = icpc
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
@@ -53,8 +46,14 @@ QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_CXXFLAGS_CXX11 = -std=c++11
+QMAKE_CXXFLAGS_CXX14 = -std=c++1y
+QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
+QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
+QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
+QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
QMAKE_CXXFLAGS_SPLIT_SECTIONS = $$QMAKE_CFLAGS_SPLIT_SECTIONS
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
QMAKE_LINK = icpc
QMAKE_LINK_SHLIB = icpc
diff --git a/mkspecs/macx-ios-clang/Info.plist.app b/mkspecs/macx-ios-clang/Info.plist.app
index 623ed496c5..623ed496c5 100755..100644
--- a/mkspecs/macx-ios-clang/Info.plist.app
+++ b/mkspecs/macx-ios-clang/Info.plist.app
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index 172e34bac5..40e7a893de 100644
--- a/mkspecs/macx-ios-clang/features/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -1,179 +1,24 @@
-load(sdk)
-
-# Resolve config so we don't need to use CONFIG() later on
-CONFIG(iphonesimulator, iphonesimulator|iphoneos) {
- CONFIG -= iphoneos
-} else {
- CONFIG -= iphonesimulator
- CONFIG += iphoneos
-}
-
-equals(TEMPLATE, app) {
+equals(TEMPLATE, app):contains(CONFIG, qt) {
# If the application uses Qt, it needs to be an application bundle
# to be able to deploy and run on iOS. The only exception to this
# is if you're working with a jailbroken device and can run the
# resulting binary from the console/over SSH, but that's not a
# use-case we care about, so no need to complicate the logic.
- qt: CONFIG *= app_bundle
-
- app_bundle {
- macx-xcode {
- # There is no way to genereate Xcode projects that are limited to either
- # simulator or device builds, so iphonesimulator_and_iphoneos is always
- # effectivly active, even if the user disabled it explicitly.
- # The Xcode generator doesn't support multiple BUILDS though (exclusive
- # builds), so we have to manually set up the simulator suffix.
- library_suffix_iphonesimulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=iphonesimulator*]"
- library_suffix_iphonesimulator.value = "_iphonesimulator$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})"
- QMAKE_MAC_XCODE_SETTINGS += library_suffix_iphonesimulator
- CONFIG *= xcode_dynamic_library_suffix
- } else {
- # For Qt applications we want Xcode project files as the generated output,
- # but since qmake doesn't handle the transition between makefiles and Xcode
- # project files (which happens when using subdirs), we create a wrapper
- # makefile that takes care of generating the Xcode project, and allows
- # building by calling out to xcodebuild.
- TEMPLATE = aux
-
- SOURCES =
- OBJECTIVE_SOURCES =
- RESOURCES =
- INSTALLS =
- QMAKE_EXTRA_COMPILERS =
-
- !build_pass {
- CONFIG += debug_and_release
- load(resolve_config)
-
- CONFIG += iphonesimulator_and_iphoneos
- iphonesimulator.name = Simulator
- iphoneos.name = Device
- addExclusiveBuilds(iphonesimulator, iphoneos)
-
- load(exclusive_builds_post)
-
- xcode_distclean.commands = "$(DEL_FILE) -R $${TARGET}.xcodeproj"
- xcode_distclean.depends = \
- debug-iphonesimulator-distclean debug-iphoneos-distclean \
- release-iphonesimulator-distclean release-iphoneos-distclean
- QMAKE_EXTRA_TARGETS += xcode_distclean
- DISTCLEAN_DEPS += xcode_distclean
-
- mkpath($$OUT_PWD)|error("Aborting.")
- args =
- for(arg, QMAKE_ARGS): \
- args += $$system_quote($$arg)
- system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode")
-
- # We have a target, even though our template is aux
- CONFIG += have_target
-
- } else {
- load(resolve_config)
-
- iphonesimulator: \
- sdk = iphonesimulator
- else: \
- sdk = iphoneos
-
- debug: \
- cfg = debug
- else: \
- cfg = release
-
- for(action, $$list(build install clean test)) {
- equals(action, build) {
- action_target_suffix =
- action_target = all
- } else: equals(action, test) {
- action_target_suffix = -check
- action_target = check
- } else {
- action_target_suffix = -$$action
- action_target = $$action
- }
-
- target = $${sdk}-$${cfg}$${action_target_suffix}
-
- xcodebuild = "xcodebuild $$action -scheme $(TARGET) -sdk $$sdk -configuration $$title($$cfg)"
-
- equals(action, test):equals(sdk, iphoneos) {
- AVAILABLE_DEVICE_IDS = "$(shell system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad|iPod)/,/Serial/s/ *Serial Number: *(.+)/\1/p')"
- CUSTOM_DEVICE_IDS = "$(filter $(EXPORT_AVAILABLE_DEVICE_IDS), $(IOS_TEST_DEVICE_IDS))"
- TEST_DEVICE_IDS = "$(strip $(if $(EXPORT_CUSTOM_DEVICE_IDS), $(EXPORT_CUSTOM_DEVICE_IDS), $(EXPORT_AVAILABLE_DEVICE_IDS)))"
-
- QMAKE_EXTRA_VARIABLES += AVAILABLE_DEVICE_IDS CUSTOM_DEVICE_IDS TEST_DEVICE_IDS
-
- xcodebuild = "@$(if $(EXPORT_TEST_DEVICE_IDS),"\
- "echo Running tests on $(words $(EXPORT_TEST_DEVICE_IDS)) device\\(s\\): && ("\
- "$(foreach deviceid, $(EXPORT_TEST_DEVICE_IDS),"\
- "(echo Testing on device ID '$(deviceid)' ... && $${xcodebuild} -destination 'platform=iOS,id=$(deviceid)' && echo) &&"\
- ") echo Tests completed successfully on all devices"\
- "), $(error No iOS devices connected, please connect at least one device that can be used for testing.))"
- }
-
- $${target}.commands = $$xcodebuild
- QMAKE_EXTRA_TARGETS += $$target
-
- $${action_target}.depends += $$target
- QMAKE_EXTRA_TARGETS *= $${action_target}
- }
-
- xcode_build_dir_distclean.commands = "$(DEL_FILE) -R $$title($$cfg)-$${sdk}"
- xcode_build_dir_distclean.depends = clean
- QMAKE_EXTRA_TARGETS += xcode_build_dir_distclean
- distclean.depends = xcode_build_dir_distclean
- QMAKE_EXTRA_TARGETS += distclean
- }
- }
- }
-} else: equals(TEMPLATE, lib) {
- iphonesimulator.name = Simulator
- iphoneos.name = Device
- addExclusiveBuilds(iphonesimulator, iphoneos)
-} else: equals(TEMPLATE, subdirs) {
- # Prevent recursion into host_builds
- for(subdir, SUBDIRS) {
- contains($${subdir}.CONFIG, host_build) {
- $${subdir}.CONFIG += no_iphoneos_target no_iphonesimulator_target
-
- # Other targets which we do want to recurse into may depend on this target,
- # for example corelib depends on moc, rcc, bootstrap, etc, and other libs
- # may depend on host-tools that are needed to build the lib, so we resolve
- # the final target name and redirect it to the base target, so that the
- # dependency chain is not broken for the other targets.
-
- !isEmpty($${subdir}.target) {
- target = $$eval($${subdir}.target)
- } else {
- !isEmpty($${subdir}.file): \
- file = $$eval($${subdir}.file)
- else: !isEmpty($${subdir}.subdir): \
- file = $$eval($${subdir}.subdir)
- else: \
- file = $$subdir
-
- target = sub-$$file
- }
-
- target ~= s,[^a-zA-Z0-9_],-,
-
- $${target}-iphonesimulator.depends = $$target
- $${target}-iphoneos.depends = $$target
- QMAKE_EXTRA_TARGETS += $${target}-iphonesimulator $${target}-iphoneos
- }
- }
-
- prepareRecursiveTarget(iphonesimulator)
- prepareRecursiveTarget(iphoneos)
- QMAKE_EXTRA_TARGETS += iphonesimulator iphoneos
-
-} else: equals(TEMPLATE, aux) {
- # Dummy targets for the 'aux' TEMPLATE, so we can always recurse
- QMAKE_EXTRA_TARGETS *= iphonesimulator iphoneos
+ CONFIG *= app_bundle
+
+ # For Qt applications we want Xcode project files as the generated output,
+ # but since qmake doesn't handle the transition between makefiles and Xcode
+ # project files (which happens when using subdirs), we can't just override
+ # MAKEFILE_GENERATOR. Instead, we generate the Xcode project by spawning a
+ # child qmake process with -spec macx-xcode and let the top level qmake
+ # process generate a wrapper makefile that forwards everything to xcodebuild.
+ equals(MAKEFILE_GENERATOR, UNIX): \
+ CONFIG = xcodebuild $$CONFIG
}
+load(default_post)
+
macx-xcode {
ios_device_family.name = TARGETED_DEVICE_FAMILY
ios_device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
@@ -248,8 +93,5 @@ macx-xcode {
QMAKE_CFLAGS += $$arch_flags
QMAKE_CXXFLAGS += $$arch_flags
- QMAKE_OBJECTIVE_CFLAGS += $$arch_flags
QMAKE_LFLAGS += $$arch_flags
}
-
-load(default_post)
diff --git a/mkspecs/macx-ios-clang/features/exclusive_builds_post.prf b/mkspecs/macx-ios-clang/features/exclusive_builds_post.prf
new file mode 100644
index 0000000000..1fb0a55846
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/exclusive_builds_post.prf
@@ -0,0 +1,8 @@
+
+xcodebuild {
+ # Prevent qmake from generating empty output dirs for each exclusive build,
+ # as Xcode will do this by itself, and with a different name.
+ QMAKE_DIR_REPLACE =
+}
+
+load(exclusive_builds_post)
diff --git a/mkspecs/macx-ios-clang/features/qt.prf b/mkspecs/macx-ios-clang/features/qt.prf
index 9e6b486c6e..474a195e4b 100644
--- a/mkspecs/macx-ios-clang/features/qt.prf
+++ b/mkspecs/macx-ios-clang/features/qt.prf
@@ -19,34 +19,12 @@ equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
QTPLUGIN.platforms = -
!no_main_wrapper {
- # We use ld to rename the _main symbol to _qt_main, so that we don't get a symbol clash
- # with the _main we provide that calls UIApplicationMain. We need to make a copy of the
- # original object file, as ld will not copy over DWARF debug information to the output
- # file. Instead, it will inject a reference back to the original object file, so when
- # Xcode runs dsymutil to make the final dSYM file it will still find the debug info
- # for the object file that provided the original _main. This back-reference has the
- # interesting side-effect of the debug information still referring to the original
- # symbol name, so stack-traces will show both our wrapper main and the original
- # user main as 'main', and adding a symbolic breakpoint for 'main' will break on
- # both functions. Although a bit weird, it's a good thing, as the user will still be
- # able to add symbolic breakpoints for 'main', not caring that the symbol is actually
- # called 'qt_main' now.
-
- macx-xcode {
- objects_dir = "\"${OBJECT_FILE_DIR}-${CURRENT_VARIANT}\""
- archs = "\"${ARCHS}\""
- } else {
- isEmpty(OBJECTS_DIR): \
- objects_dir = .
- else: \
- objects_dir = $$shell_quote($$OBJECTS_DIR)
- archs = $$shell_quote($$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS)
- }
-
- !isEmpty(QMAKE_PRE_LINK): \
- QMAKE_PRE_LINK += ";"
-
- QMAKE_PRE_LINK += $$shell_quote($$QMAKESPEC/rename_main.sh) $$objects_dir $$archs
+ # The LC_MAIN load command available in iOS 6.0 and above allows dyld to
+ # directly call the entrypoint instead of going through _start in crt.o.
+ # Passing -e to the linker changes the entrypoint from _main to our custom
+ # wrapper that calls UIApplicationMain and dispatches back to main() once
+ # the application has started up and is ready to initialize QApplication.
+ QMAKE_LFLAGS += -Wl,-e,_qt_main_wrapper
}
}
diff --git a/mkspecs/macx-ios-clang/features/resolve_config.prf b/mkspecs/macx-ios-clang/features/resolve_config.prf
new file mode 100644
index 0000000000..d1d3e8ca39
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/resolve_config.prf
@@ -0,0 +1,64 @@
+
+xcodebuild {
+ # Xcode project files always support both Debug and Release configurations
+ # and iOS device and simulator targets, so we make sure the wrapper-makefile
+ # also does.
+ CONFIG += debug_and_release iphonesimulator_and_iphoneos
+}
+
+load(resolve_config)
+
+CONFIG(iphonesimulator, iphonesimulator|iphoneos): \
+ CONFIG -= iphoneos
+else: \
+ CONFIG -= iphonesimulator
+
+macx-xcode {
+ # There is no way to genereate Xcode projects that are limited to either
+ # simulator or device builds, so iphonesimulator_and_iphoneos is always
+ # effectivly active, even if the user disabled it explicitly.
+ # The Xcode generator doesn't support multiple BUILDS though (exclusive
+ # builds), so we have to manually set up the simulator suffix.
+ library_suffix_iphonesimulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=iphonesimulator*]"
+ library_suffix_iphonesimulator.value = "_iphonesimulator$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})"
+ QMAKE_MAC_XCODE_SETTINGS += library_suffix_iphonesimulator
+ CONFIG *= xcode_dynamic_library_suffix
+} else {
+ iphonesimulator.name = Simulator
+ iphoneos.name = Device
+ addExclusiveBuilds(iphonesimulator, iphoneos)
+}
+
+equals(TEMPLATE, subdirs) {
+ # Prevent recursion into host_builds
+ for(subdir, SUBDIRS) {
+ contains($${subdir}.CONFIG, host_build) {
+ $${subdir}.CONFIG += no_iphoneos_target no_iphonesimulator_target
+
+ # Other targets which we do want to recurse into may depend on this target,
+ # for example corelib depends on moc, rcc, bootstrap, etc, and other libs
+ # may depend on host-tools that are needed to build the lib, so we resolve
+ # the final target name and redirect it to the base target, so that the
+ # dependency chain is not broken for the other targets.
+
+ !isEmpty($${subdir}.target) {
+ target = $$eval($${subdir}.target)
+ } else {
+ !isEmpty($${subdir}.file): \
+ file = $$eval($${subdir}.file)
+ else: !isEmpty($${subdir}.subdir): \
+ file = $$eval($${subdir}.subdir)
+ else: \
+ file = $$subdir
+
+ target = sub-$$file
+ }
+
+ target ~= s,[^a-zA-Z0-9_],-,
+
+ $${target}-iphonesimulator.depends = $$target
+ $${target}-iphoneos.depends = $$target
+ QMAKE_EXTRA_TARGETS += $${target}-iphonesimulator $${target}-iphoneos
+ }
+ }
+}
diff --git a/mkspecs/macx-ios-clang/features/testcase.prf b/mkspecs/macx-ios-clang/features/testcase.prf
new file mode 100644
index 0000000000..e16c163ffa
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/testcase.prf
@@ -0,0 +1,12 @@
+# Pretend we have a target, even though our template is aux
+xcodebuild: \
+ CONFIG += have_target
+
+load(testcase)
+
+# We provide our own check logic
+xcodebuild {
+ check.depends =
+ check.commands =
+ QMAKE_EXTRA_TARGETS *= check
+}
diff --git a/mkspecs/macx-ios-clang/features/testcase_targets.prf b/mkspecs/macx-ios-clang/features/testcase_targets.prf
new file mode 100644
index 0000000000..e0a2922c3f
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/testcase_targets.prf
@@ -0,0 +1,3 @@
+# For the xcodebuild wrapper makefile we deal with test targets manually
+!xcodebuild: \
+ load(testcase_targets)
diff --git a/mkspecs/macx-ios-clang/features/xcodebuild.prf b/mkspecs/macx-ios-clang/features/xcodebuild.prf
new file mode 100644
index 0000000000..b897432a43
--- /dev/null
+++ b/mkspecs/macx-ios-clang/features/xcodebuild.prf
@@ -0,0 +1,49 @@
+
+# For Qt applications we want Xcode project files as the generated output,
+# but since qmake doesn't handle the transition between makefiles and Xcode
+# project files (which happens when using subdirs), we can't just override
+# MAKEFILE_GENERATOR. Instead, we generate the Xcode project by spawing a
+# child qmake process with -spec macx-xcode and let the top level qmake
+# process generate a wrapper makefile that forwards everything to xcodebuild.
+
+TEMPLATE = aux
+
+SOURCES =
+OBJECTIVE_SOURCES =
+RESOURCES =
+INSTALLS =
+QMAKE_EXTRA_COMPILERS =
+
+!mkpath($$OUT_PWD): \
+ error("Failed to create $$OUT_PWD")
+
+args =
+for(arg, QMAKE_ARGS): \
+ args += $$system_quote($$arg)
+
+cmd = "$$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode"
+debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'")
+system("cd $$system_quote($$OUT_PWD) && $$cmd")
+
+# Subtargets
+
+for(build, BUILDS): \
+ SUBTARGETS += $$eval($${build}.target)
+QMAKE_EXTRA_VARIABLES += SUBTARGETS
+
+CONFIG += no_default_goal_deps
+
+QMAKE_EXTRA_INCLUDES += $$shell_quote($$QMAKESPEC/xcodebuild.mk)
+
+# Distclean
+
+distfiles = $${TARGET}.xcodeproj
+for(build, BUILDS): \
+ distfiles += $$title($$eval($${build}.target))
+distclean_xcodebuild.commands = -$(DEL_FILE) -R $$distfiles
+
+distclean.depends += clean_all distclean_xcodebuild
+QMAKE_EXTRA_TARGETS += distclean distclean_xcodebuild
+
+# Empty exclusive builds, we've set them up manually
+BUILDS =
diff --git a/mkspecs/macx-ios-clang/ios_destinations.sh b/mkspecs/macx-ios-clang/ios_destinations.sh
new file mode 100755
index 0000000000..e7b13c212c
--- /dev/null
+++ b/mkspecs/macx-ios-clang/ios_destinations.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#############################################################################
+##
+## Copyright (C) 2015 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is the build configuration utility 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$
+##
+#############################################################################
+
+booted_simulator=$(xcrun simctl list devices | grep -E "iPhone|iPad" | grep -v unavailable | grep Booted | perl -lne 'print $1 if /\((.*?)\)/')
+echo "IPHONESIMULATOR_DEVICES = $booted_simulator"
+
+xcodebuild test -scheme $1 -destination 'id=0' -destination-timeout 1 2>&1| sed -n 's/{ \(platform:.*\) }/\1/p' | while read destination; do
+ id=$(echo $destination | sed -n -E 's/.*id:([^ ,]+).*/\1/p')
+ echo $destination | tr ',' '\n' | while read keyval; do
+ key=$(echo $keyval | cut -d ':' -f 1 | tr '[:lower:]' '[:upper:]')
+ val=$(echo $keyval | cut -d ':' -f 2)
+ echo "%_$id: DESTINATION_${key} = $val"
+
+ if [ $key = 'PLATFORM' ]; then
+ if [ "$val" = "iOS" ]; then
+ echo "IPHONEOS_DEVICES += $id"
+ elif [ "$val" = "iOS Simulator" -a "$id" != "$booted_simulator" ]; then
+ echo "IPHONESIMULATOR_DEVICES += $id"
+ fi
+ fi
+ done
+ echo
+done
diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf
index 0dd761760c..d5e5840902 100644
--- a/mkspecs/macx-ios-clang/qmake.conf
+++ b/mkspecs/macx-ios-clang/qmake.conf
@@ -7,7 +7,7 @@ CONFIG += app_bundle reduce_exports incremental global_init_link
QMAKE_INCREMENTAL_STYLE = sublib
QMAKE_MACOSX_DEPLOYMENT_TARGET =
-QMAKE_IOS_DEPLOYMENT_TARGET = 5.1.1
+QMAKE_IOS_DEPLOYMENT_TARGET = 6.0
INCLUDEPATH += $$PWD/ios
DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
diff --git a/mkspecs/macx-ios-clang/rename_main.sh b/mkspecs/macx-ios-clang/rename_main.sh
deleted file mode 100755
index 1547f5f75c..0000000000
--- a/mkspecs/macx-ios-clang/rename_main.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-
-#############################################################################
-##
-## Copyright (C) 2015 The Qt Company Ltd.
-## Contact: http://www.qt.io/licensing/
-##
-## This file is the build configuration utility 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$
-##
-#############################################################################
-
-if [ $# -ne 2 ]; then
- echo "$0: wrong number of arguments for internal tool used by iOS mkspec"
-else
- arch_paths=""
- for a in $2; do
- arch_paths="$arch_paths
-$1/$a"
- done
- for f in $(IFS="
-"; find $arch_paths -name '*.o'); do
- # Skip object files without the _main symbol
- nm $f 2>/dev/null | grep -q 'T _main$' || continue
-
- fname=${f#$1/}
-
- file -b $f | grep -qi 'llvm bit-code' && \
- (cat \
-<<EOF >&2
-$f:: error: The file '$fname' contains LLVM bitcode, not object code. Automatic main() redirection could not be applied.
-note: This is most likely due to the use of link-time optimization (-flto). Please disable LTO, or work around the \
-issue by manually renaming your main() function to qtmn():
-
-#ifdef Q_OS_IOS
-extern "C" int qtmn(int argc, char *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
-EOF
- ) && exit 1
-
- echo "Found main() in $fname"
-
- strings -t d - $f | grep '_main\(\.eh\)\?$' | while read match; do
- offset=$(echo $match | cut -d ' ' -f 1)
- symbol=$(echo $match | cut -d ' ' -f 2)
-
- echo " Renaming '$symbol' at offset $offset to '${symbol/main/qtmn}'"
-
- # In-place rename the string (keeping the same length)
- printf '_qtmn' | dd of=$f bs=1 seek=$offset conv=notrunc >/dev/null 2>&1
- done
- done
-fi \ No newline at end of file
diff --git a/mkspecs/macx-ios-clang/xcodebuild.mk b/mkspecs/macx-ios-clang/xcodebuild.mk
new file mode 100644
index 0000000000..1bd18430df
--- /dev/null
+++ b/mkspecs/macx-ios-clang/xcodebuild.mk
@@ -0,0 +1,100 @@
+
+# We don't want xcodebuild to run in parallel
+.NOTPARALLEL:
+
+# Functions
+targets = $(foreach target, $(EXPORT_SUBTARGETS), $(target)-$(strip $(1)))
+toupper = $(shell echo $1 | tr '[:lower:]' '[:upper:]')
+tolower = $(shell echo $1 | tr '[:upper:]' '[:lower:]')
+basesdk = $(shell echo $1 | sed 's/[0-9.]*$$//')
+
+# Explicit comma variable
+, := ,
+
+# Default targets
+first: build
+all: build_all
+
+.DEFAULT_GOAL = first
+
+# Top level targets
+build: build_first
+clean: clean_first
+install: install_first
+check: check_first
+distclean: clean_all
+
+$(EXPORT_SUBTARGETS): % : %-build
+
+# Generic targets
+%_first: $(firstword $(call targets, %)) ;
+%_all: $(call targets, %) ;
+
+# Actions
+%-build: ACTION = build
+%-build: xcodebuild-% ;
+
+%-clean: ACTION = clean
+%-clean: xcodebuild-% ;
+
+%-install: ACTION = install
+%-install: xcodebuild-% ;
+
+# iOS Simulator doesn't support archiving
+%-iphonesimulator-install: ACTION = build
+iphonesimulator-install: ACTION = build
+
+# Limit check to a single configuration
+%-iphoneos-check: check-iphoneos ;
+%-iphonesimulator-check: check-iphonesimulator ;
+
+# SDK
+%-iphoneos: SDK = iphoneos
+%-iphonesimulator: SDK = iphonesimulator
+
+# Configuration
+release-%: CONFIGURATION = Release
+debug-%: CONFIGURATION = Debug
+
+# Test and build (device) destinations
+ifneq ($(filter check%,$(MAKECMDGOALS)),)
+ ifeq ($(DEVICES),)
+ $(info Enumerating test destinations (you may override this by setting DEVICES explicitly), please wait...)
+ SPECDIR := $(dir $(lastword $(MAKEFILE_LIST)))
+ DESTINATIONS_INCLUDE = /tmp/ios_destinations.mk
+ $(shell $(SPECDIR)/ios_destinations.sh $(TARGET) > $(DESTINATIONS_INCLUDE))
+ include $(DESTINATIONS_INCLUDE)
+ endif
+endif
+
+%-iphonesimulator: DEVICES = $(firstword $(IPHONESIMULATOR_DEVICES))
+%-iphoneos: DEVICES = $(IPHONEOS_DEVICES)
+
+IPHONEOS_GENERIC_DESTINATION := "generic/platform=iOS"
+IPHONESIMULATOR_GENERIC_DESTINATION := "id=$(shell xcrun simctl list devices | grep -E 'iPhone|iPad' | grep -v unavailable | perl -lne 'print $$1 if /\((.*?)\)/' | tail -n 1)"
+
+DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(value $(call toupper,$(call basesdk,$(SDK)))_GENERIC_DESTINATION))
+
+# Xcodebuild
+
+DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
+ on '$(DESTINATION_NAME)' ($(DESTINATION_ID))$(if $(DESTINATION_OS),$(,) $(DESTINATION_PLATFORM) $(DESTINATION_OS),)"
+
+xcodebuild-%:
+ @$(if $(DESTINATION_NAME), echo $(DESTINATION_MESSAGE),)
+ xcodebuild $(ACTION) -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,)
+
+xcodebuild-check-device_%: DESTINATION_ID=$(lastword $(subst _, ,$@))
+
+# Special check target (requires SECONDEXPANSION due to devices)
+.SECONDEXPANSION:
+check-%: ACTION = test
+check-%: $$(foreach device, $$(DEVICES), xcodebuild-check-device_$$(device)) ;
+ @echo $(if $^, Ran $(call tolower,$(CONFIGURATION)) tests on $(words $^) $(SDK) destination\(s\): $(DEVICES), No compatible test devices found for \'$(SDK)\' SDK && false)
+
+# Determined by device
+check-%: SDK =
+
+# Default to debug for testing
+check-%: CONFIGURATION = Debug
+
diff --git a/mkspecs/macx-xcode/default.xcscheme b/mkspecs/macx-xcode/default.xcscheme
index 4a16fefca0..ab2f6a8ab7 100644
--- a/mkspecs/macx-xcode/default.xcscheme
+++ b/mkspecs/macx-xcode/default.xcscheme
@@ -73,6 +73,13 @@
ReferencedContainer = "container:@QMAKE_ORIG_TARGET@.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
+ <EnvironmentVariables>
+ <EnvironmentVariable
+ key = "DYLD_IMAGE_SUFFIX"
+ value = "$(QT_LIBRARY_SUFFIX)"
+ isEnabled = "YES">
+ </EnvironmentVariable>
+ </EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf
index 6cb24d9bf9..04c675da24 100644
--- a/mkspecs/netbsd-g++/qmake.conf
+++ b/mkspecs/netbsd-g++/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = netbsd bsd
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -68,5 +70,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf
index 2fdbd2c469..10330bc081 100644
--- a/mkspecs/openbsd-g++/qmake.conf
+++ b/mkspecs/openbsd-g++/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = openbsd bsd
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -69,5 +71,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/sco-g++/qmake.conf b/mkspecs/sco-g++/qmake.conf
index ebf60a3954..27fc1cffe3 100644
--- a/mkspecs/sco-g++/qmake.conf
+++ b/mkspecs/sco-g++/qmake.conf
@@ -7,6 +7,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = sco
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -65,5 +67,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf
index 6e1d35ef43..1c7b43c29c 100644
--- a/mkspecs/solaris-cc-64/qmake.conf
+++ b/mkspecs/solaris-cc-64/qmake.conf
@@ -24,6 +24,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = solaris
+include(../common/unix.conf)
+
QMAKE_COMPILER = sun_cc
QMAKE_CC = cc
@@ -90,5 +92,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = -r $(OBJECTS_DIR)Templates.DB $(OBJECTS_DIR)SunWS_cache
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf
index 23814135b6..045ab033dd 100644
--- a/mkspecs/solaris-cc/qmake.conf
+++ b/mkspecs/solaris-cc/qmake.conf
@@ -7,6 +7,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = solaris
+include(../common/unix.conf)
+
QMAKE_COMPILER = sun_cc
QMAKE_CC = cc
@@ -73,5 +75,4 @@ QMAKE_RANLIB =
QMAKE_CLEAN = -r $(OBJECTS_DIR)Templates.DB $(OBJECTS_DIR)SunWS_cache
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf
index 34fd044f3e..91ffb9193e 100644
--- a/mkspecs/solaris-g++-64/qmake.conf
+++ b/mkspecs/solaris-g++-64/qmake.conf
@@ -28,6 +28,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = solaris
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -92,5 +94,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf
index ccc178395b..594646353d 100644
--- a/mkspecs/solaris-g++/qmake.conf
+++ b/mkspecs/solaris-g++/qmake.conf
@@ -11,6 +11,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = solaris
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -75,5 +77,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/tru64-cxx/qmake.conf b/mkspecs/tru64-cxx/qmake.conf
index a2e0112623..024590bf91 100644
--- a/mkspecs/tru64-cxx/qmake.conf
+++ b/mkspecs/tru64-cxx/qmake.conf
@@ -6,6 +6,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = tru64
CONFIG += plugin_no_soname
+include(../common/unix.conf)
+
QMAKE_COMPILER = dec_cc
QMAKE_CC = cc
@@ -65,5 +67,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/tru64-g++/qmake.conf b/mkspecs/tru64-g++/qmake.conf
index dd7eb6c9c3..193e2694ea 100644
--- a/mkspecs/tru64-g++/qmake.conf
+++ b/mkspecs/tru64-g++/qmake.conf
@@ -6,6 +6,8 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = tru64
CONFIG += plugin_no_soname
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -67,5 +69,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/unixware-cc/qmake.conf b/mkspecs/unixware-cc/qmake.conf
index 483b8c0bb3..1a36a3e76b 100644
--- a/mkspecs/unixware-cc/qmake.conf
+++ b/mkspecs/unixware-cc/qmake.conf
@@ -10,6 +10,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = unixware
+include(../common/unix.conf)
+
QMAKE_COMPILER = sco_cc
QMAKE_CC = cc
@@ -69,5 +71,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/unixware-g++/qmake.conf b/mkspecs/unixware-g++/qmake.conf
index feca5a4c9e..abe2773deb 100644
--- a/mkspecs/unixware-g++/qmake.conf
+++ b/mkspecs/unixware-g++/qmake.conf
@@ -7,6 +7,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = unixware
+include(../common/unix.conf)
+
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@@ -68,5 +70,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/unsupported/freebsd-clang/qmake.conf b/mkspecs/unsupported/freebsd-clang/qmake.conf
index 92b7c47590..9d9815a7b3 100644
--- a/mkspecs/unsupported/freebsd-clang/qmake.conf
+++ b/mkspecs/unsupported/freebsd-clang/qmake.conf
@@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
+include(../common/unix.conf)
+
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
@@ -28,7 +30,7 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
-include(../../common/unix.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/clang.conf)
+
load(qt_config)
diff --git a/mkspecs/unsupported/linux-armcc/qmake.conf b/mkspecs/unsupported/linux-armcc/qmake.conf
deleted file mode 100644
index 2c7eb7c2d8..0000000000
--- a/mkspecs/unsupported/linux-armcc/qmake.conf
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# qmake configuration for linux-armcc
-#
-
-MAKEFILE_GENERATOR = UNIX
-CONFIG += incremental armcc_linker
-QMAKE_INCREMENTAL_STYLE = sublib
-
-include(../../common/linux.conf)
-include(../../common/armcc.conf)
-load(qt_config)
-
-# use armcc for linking since armlink doesn't understand the arm_linux_config_file option
-QMAKE_LINK = armcc
-QMAKE_LINK_SHLIB = armcc
-QMAKE_LINK_C = armcc
-QMAKE_LINK_C_SHLIB = armcc
-
-QMAKE_LFLAGS_SHLIB += --apcs=/fpic --shared
-QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
-
-QMAKE_LIBS += libstdc++.so librt.so
-
-CONFIG -= rvct_linker
-
-QMAKE_CFLAGS += --gnu --arm_linux --dllimport_runtime --thumb --cpu Cortex-A9 --arm_linux_config_file="$(HOME)/qt_rvct_config" --arm-linux-paths --apcs=/interwork --visibility_inlines_hidden --diag_suppress 1300,2523
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --cpp
-
-QMAKE_LFLAGS += --diag_suppress 6331,6780,6439 --arm_linux_config_file="$(HOME)/qt_rvct_config" --arm-linux-paths
diff --git a/mkspecs/unsupported/linux-armcc/qplatformdefs.h b/mkspecs/unsupported/linux-armcc/qplatformdefs.h
deleted file mode 100644
index 946b4d2b90..0000000000
--- a/mkspecs/unsupported/linux-armcc/qplatformdefs.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the qmake spec 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 QPLATFORMDEFS_H
-#define QPLATFORMDEFS_H
-
-// Get Qt defines/settings
-
-#include "qglobal.h"
-
-// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
-
-// 1) need to reset default environment if _BSD_SOURCE is defined
-// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
-// 3) it seems older glibc need this to include the X/Open stuff
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#include <unistd.h>
-
-
-// We are hot - unistd.h should have turned on the specific APIs we requested
-
-#include <features.h>
-#include <pthread.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <grp.h>
-#include <pwd.h>
-#include <signal.h>
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/ipc.h>
-#include <sys/time.h>
-#include <sys/shm.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
-
-#define QT_USE_XOPEN_LFS_EXTENSIONS
-#include "../../common/posix/qplatformdefs.h"
-
-#undef QT_SOCKLEN_T
-
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
-#define QT_SOCKLEN_T socklen_t
-#else
-#define QT_SOCKLEN_T int
-#endif
-
-#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
-#define QT_SNPRINTF ::snprintf
-#define QT_VSNPRINTF ::vsnprintf
-#endif
-
-#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf
index 1523126eaa..3aa7520776 100644
--- a/mkspecs/unsupported/linux-host-g++/qmake.conf
+++ b/mkspecs/unsupported/linux-host-g++/qmake.conf
@@ -17,6 +17,8 @@ QMAKE_PLATFORM = linux
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/unix.conf)
+
#
# qmake configuration for common gcc
#
@@ -71,6 +73,7 @@ QMAKE_PCH_OUTPUT_EXT = .gch
# -Bsymbolic-functions (ld) support
QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
+QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script,
#
# qmake configuration for common linux
@@ -110,5 +113,4 @@ QMAKE_RANLIB =
QMAKE_STRIP = host-strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
-include(../../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/unsupported/qnx-X11-g++/qmake.conf b/mkspecs/unsupported/qnx-X11-g++/qmake.conf
index 8d2c63f330..79a5609dbf 100644
--- a/mkspecs/unsupported/qnx-X11-g++/qmake.conf
+++ b/mkspecs/unsupported/qnx-X11-g++/qmake.conf
@@ -7,9 +7,9 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = qnx
+include(../common/unix.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
-include(../common/unix.conf)
QMAKE_CFLAGS_THREAD = -D_REENTRANT
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CLFAGS_THREAD
diff --git a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf
index a4cf23df9c..16e3127803 100644
--- a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf
+++ b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf
@@ -7,6 +7,8 @@ QMAKE_PLATFORM = vxworks
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/unix.conf)
+
VXWORKS_ARCH = ppc
VXWORKS_CPU = PPC32
VXWORKS_DIAB_SPEC = -tPPC7400FV:vxworks66
@@ -88,6 +90,5 @@ QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
-include(../../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf b/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf
index 1d3e9f4eb4..49cacdba43 100644
--- a/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf
+++ b/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf
@@ -8,13 +8,14 @@ CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
DEFINES += VXWORKS
+include(../../common/linux.conf)
+
VXWORKS_ARCH = ppc
VXWORKS_CPU = PPC32
VXWORKS_ARCH_MUNCH = ppc
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
-include(../../common/linux.conf)
QMAKE_CC = cc$$VXWORKS_ARCH_MUNCH
QMAKE_CFLAGS = -fno-builtin -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip -DCPU=$$upper($$VXWORKS_ARCH) -DVX_CPU_FAMILY=$$VXWORKS_ARCH -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -D_VSB_CONFIG_FILE=\'<../lib/h/config/vsbConfig.h>\'
diff --git a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf
index 49f0c21d4a..44e39a8a8c 100644
--- a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf
+++ b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf
@@ -7,6 +7,8 @@ QMAKE_PLATFORM = vxworks
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
+include(../common/unix.conf)
+
VXWORKS_ARCH = simlinux
VXWORKS_CPU = SIMLINUX
VXWORKS_DIAB_SPEC = -tX86LH:vxworks66
@@ -87,6 +89,5 @@ QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
-include(../../common/unix.conf)
load(qt_config)
diff --git a/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf
index 3c8fd12d4a..4d5cc97fad 100644
--- a/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf
+++ b/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf
@@ -8,13 +8,14 @@ CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
DEFINES += VXWORKS
+include(../../common/linux.conf)
+
VXWORKS_ARCH = simlinux
VXWORKS_CPU = SIMLINUX
VXWORKS_ARCH_MUNCH = pentium
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
-include(../../common/linux.conf)
QMAKE_CC = cc$$VXWORKS_ARCH_MUNCH
QMAKE_CFLAGS = -fno-builtin -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip -DCPU=$$upper($$VXWORKS_ARCH) -DVX_CPU_FAMILY=$$VXWORKS_ARCH -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -D_VSB_CONFIG_FILE=\'<../lib/h/config/vsbConfig.h>\'
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index c6ff808a99..61963c7b0d 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -8,6 +8,7 @@
#
load(device_config)
+include(../common/angle.conf)
MAKEFILE_GENERATOR = MINGW
QMAKE_PLATFORM = win32 mingw
@@ -23,7 +24,7 @@ QMAKE_COMPILER = gcc
QMAKE_CC = $${CROSS_COMPILE}gcc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
-QMAKE_YACC = byacc
+QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport
QMAKE_CFLAGS_DEPS = -M
@@ -56,6 +57,11 @@ QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
QMAKE_CXXFLAGS_CXX11 = -std=c++0x
+QMAKE_CXXFLAGS_CXX14 = -std=c++1y
+QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
+QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++0x
+QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
+QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
QMAKE_CXXFLAGS_SPLIT_SECTIONS = $$QMAKE_CFLAGS_SPLIT_SECTIONS
QMAKE_INCDIR =
@@ -76,20 +82,24 @@ QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LFLAGS_CXX11 =
+QMAKE_LFLAGS_CXX14 =
+QMAKE_LFLAGS_CXX1Z =
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
-QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
+QMAKE_PREFIX_SHLIB =
+QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
+QMAKE_LIB_EXTENSIONS = a dll.a
QMAKE_LIBS =
QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
QMAKE_LIBS_NETWORK = -lws2_32
QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
-QMAKE_LIBS_OPENGL_ES2 = -llibEGL -llibGLESv2 -lgdi32 -luser32
-QMAKE_LIBS_OPENGL_ES2_DEBUG = -llibEGLd -llibGLESv2d -lgdi32 -luser32
+QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32
+QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d -lgdi32 -luser32
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
diff --git a/mkspecs/win32-g++/qplatformdefs.h b/mkspecs/win32-g++/qplatformdefs.h
index b4ba092d3b..ef3c518262 100644
--- a/mkspecs/win32-g++/qplatformdefs.h
+++ b/mkspecs/win32-g++/qplatformdefs.h
@@ -52,7 +52,6 @@
#include <errno.h>
#include <sys/stat.h>
#include <stdlib.h>
-#include <qt_windows.h>
#include <limits.h>
#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)
diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf
index 2ec0d84918..3b440d143f 100644
--- a/mkspecs/win32-icc/qmake.conf
+++ b/mkspecs/win32-icc/qmake.conf
@@ -15,15 +15,16 @@ QMAKE_COMPILER = msvc intel_icl # icl pretends to be msvc
QMAKE_CC = icl
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
-QMAKE_YACC = byacc
+QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
-QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738
+QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738,809
QMAKE_CFLAGS_WARN_ON = -W3 /Qwd673
QMAKE_CFLAGS_WARN_OFF = -W0 /Qwd673
QMAKE_CFLAGS_RELEASE = -O2 -MD
QMAKE_CFLAGS_DEBUG = -Zi -MDd -Od
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_LTCG = -Qipo
+QMAKE_CFLAGS_DISABLE_LTCG = -Qno-ipo
QMAKE_CFLAGS_SSE2 = -QxSSE2
QMAKE_CFLAGS_SSE3 = -QxSSE3
QMAKE_CFLAGS_SSSE3 = -QxSSSE3
@@ -46,7 +47,11 @@ QMAKE_CXXFLAGS_RTTI_OFF =
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc
QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
QMAKE_CXXFLAGS_CXX11 = -Qstd=c++11
+# ICC supports the following but Qt won't compile
+#QMAKE_CXXFLAGS_CXX14 = -Qstd=c++14
+#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++1z
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
QMAKE_INCDIR =
@@ -65,6 +70,9 @@ QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:console
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:windows
QMAKE_LFLAGS_DLL = /DLL
QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_PREFIX_SHLIB =
+QMAKE_EXTENSION_SHLIB = dll
+QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS =
diff --git a/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf b/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf
index 772a514b89..860fbc0e6a 100644
--- a/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf
+++ b/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf
@@ -21,7 +21,7 @@ QMAKE_LIBS_NETWORK = ws2.lib $$QMAKE_LIBS_GUI
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT =
QMAKE_LIBS_OPENVG = libopenvg.lib
-QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib
+QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
QMAKE_RC = rc
diff --git a/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf b/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf
index 47c512bbda..3712c94778 100644
--- a/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf
+++ b/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf
@@ -5,11 +5,11 @@
include(../common/wince/qmake.conf)
-CE_SDK = Toradex_CE8_SDK # replace with actual SDK name
+CE_SDK = Toradex_CE800 # replace with actual SDK name
CE_ARCH = ARMV7
QT_CONFIG -= accessibility
-DEFINES += QT_NO_CLIPBOARD QT_NO_ACCESSIBILITY QT_NO_NATIVE_GESTURES QT_NOSTANDARDSHELL_UI_MODEL _CRT_SECURE_NO_DEPRECATE _WIN32_WCE=0x800 $$CE_ARCH _AMRV7_ armv7 _ARM_ UNDER_CE WINCE ARM
+DEFINES += QT_NO_CLIPBOARD QT_NO_ACCESSIBILITY QT_NO_NATIVE_GESTURES QT_NOSTANDARDSHELL_UI_MODEL _CRT_SECURE_NO_DEPRECATE _WIN32_WCE=0x800 $$CE_ARCH _AMRV7_ armv7 _ARM_ UNDER_CE WINCE ARM QT_NO_WINCE_SHELLSDK QT_NO_WINCE_NUIOUSER
#QMAKE_CXXFLAGS += /P
QMAKE_CFLAGS_RELEASE += -O2 -MT
@@ -25,7 +25,7 @@ QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -MD
QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS_DEBUG += -MTd
QMAKE_INCDIR_OPENGL_ES2 += $$(NV_WINCE_T2_PLAT)/include
-QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWSCE,8.00 /MACHINE:ARM /ENTRY:mainCRTStartup
+QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWSCE,8.00 /MACHINE:ARM
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWSCE,8.00 /MACHINE:ARM
QMAKE_LFLAGS_DLL = /SUBSYSTEM:WINDOWSCE,8.00 /MACHINE:ARM /DLL /SAFESEH:NO
QMAKE_LIBFLAGS_RELEASE = /LTCG
@@ -33,13 +33,10 @@ QMAKE_LIBS = coredll.lib
QMAKE_LIBS_CORE = ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib
QMAKE_LIBS_GUI = ole32.lib $$QMAKE_LIBS_CORE
QMAKE_LIBS_NETWORK = ws2.lib $$QMAKE_LIBS_GUI
-QMAKE_LIBS_OPENGL =
-QMAKE_LIBS_COMPAT =
-QMAKE_LIBS_OPENVG =
-QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib
-QMAKE_LIBDIR_OPENGL_ES2 = $$(NV_WINCE_T2_PLAT)/lib/Test
-QMAKE_INCDIR_EGL = $$(NV_WINCE_T2_PLAT)/include
-QMAKE_LIBDIR_EGL = $$(NV_WINCE_T2_PLAT)/lib/Test
+QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
+
+MAKEFILE_GENERATOR = MSBUILD
+VCPROJ_EXTENSION = .vcxproj
QMAKE_RC = rc
diff --git a/mkspecs/winphone-arm-msvc2013/qmake.conf b/mkspecs/winphone-arm-msvc2013/qmake.conf
index e848d254d4..ca2cc50e84 100644
--- a/mkspecs/winphone-arm-msvc2013/qmake.conf
+++ b/mkspecs/winphone-arm-msvc2013/qmake.conf
@@ -8,6 +8,7 @@ include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1800
QMAKE_PLATFORM = winphone $$QMAKE_PLATFORM
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP ARM __ARM__ __ARM__
+CONFIG += no_generated_target_info
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
diff --git a/mkspecs/winphone-x86-msvc2013/qmake.conf b/mkspecs/winphone-x86-msvc2013/qmake.conf
index 18d8402822..ad8dbe1fee 100644
--- a/mkspecs/winphone-x86-msvc2013/qmake.conf
+++ b/mkspecs/winphone-x86-msvc2013/qmake.conf
@@ -8,6 +8,7 @@ include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1800
QMAKE_PLATFORM = winphone $$QMAKE_PLATFORM
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP X86 __X86__ __x86__
+CONFIG += no_generated_target_info
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
diff --git a/mkspecs/winrt-arm-msvc2013/qmake.conf b/mkspecs/winrt-arm-msvc2013/qmake.conf
index d1ab60723d..f8b48b0829 100644
--- a/mkspecs/winrt-arm-msvc2013/qmake.conf
+++ b/mkspecs/winrt-arm-msvc2013/qmake.conf
@@ -6,7 +6,7 @@
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1800
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP ARM __ARM__ __arm__
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP ARM __ARM__ __arm__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf
index 44c91a5e80..7a9375246d 100644
--- a/mkspecs/winrt-arm-msvc2015/qmake.conf
+++ b/mkspecs/winrt-arm-msvc2015/qmake.conf
@@ -4,15 +4,16 @@
# Written for Microsoft Visual C++ 2015
#
+MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1900
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP ARM __ARM__ __arm__
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:ARM
+QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib kernel32.lib
+QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
VCPROJ_ARCH = ARM
MSVC_VER = 14.0
diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf
index a6c5db6f0f..ca2dc88bf0 100644
--- a/mkspecs/winrt-x64-msvc2015/qmake.conf
+++ b/mkspecs/winrt-x64-msvc2015/qmake.conf
@@ -4,15 +4,16 @@
# Written for Microsoft Visual C++ 2015
#
+MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP X64 __X64__ __x64__
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /MACHINE:X64
+QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib kernel32.lib
+QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
VCPROJ_ARCH = x64
MSVC_VER = 14.0
diff --git a/mkspecs/winrt-x86-msvc2013/qmake.conf b/mkspecs/winrt-x86-msvc2013/qmake.conf
index 77b906c7d3..3359102e7e 100644
--- a/mkspecs/winrt-x86-msvc2013/qmake.conf
+++ b/mkspecs/winrt-x86-msvc2013/qmake.conf
@@ -6,7 +6,7 @@
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1800 _WIN32
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP X86 __X86__ __x86__
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP X86 __X86__ __x86__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf
index dfeaf63e2c..3b2681e93d 100644
--- a/mkspecs/winrt-x86-msvc2015/qmake.conf
+++ b/mkspecs/winrt-x86-msvc2015/qmake.conf
@@ -4,16 +4,16 @@
# Written for Microsoft Visual C++ 2015
#
+MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32
-DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP X86 __X86__ __x86__
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
-QMAKE_LFLAGS += /SAFESEH /MACHINE:X86
-
-QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib kernel32.lib
+QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
+QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
VCPROJ_ARCH = Win32
MSVC_VER = 14.0
WINSDK_VER = 10.0
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 86f884fe20..405bbf9212 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -13,7 +13,7 @@ OBJS=project.o option.o property.o main.o ioutils.o proitems.o \
#qt code
QOBJS=qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtextstream.o qiodevice.o \
- qdebug.o qmalloc.o qglobal.o \
+ qringbuffer.o qdebug.o qmalloc.o qglobal.o \
qarraydata.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfiledevice.o qfile.o \
qfilesystementry.o qfilesystemengine.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o \
qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o \
@@ -44,6 +44,7 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/tools/qstring_compat.cpp \
$(SOURCE_PATH)/src/corelib/io/qfiledevice.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp \
$(SOURCE_PATH)/src/corelib/io/qdebug.cpp \
$(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \
$(SOURCE_PATH)/src/corelib/global/qglobal.cpp $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp \
@@ -101,6 +102,7 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \
-I$(QMAKESPEC) \
-I$(SOURCE_PATH)/tools/shared \
+ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
@@ -242,6 +244,9 @@ qsettings_win.o: $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
qiodevice.o: $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
+qringbuffer.o: $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp
+
qdebug.o: $(SOURCE_PATH)/src/corelib/io/qdebug.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdebug.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 9dda6ca1e7..e61e9503f3 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -22,7 +22,7 @@ CFLAGS_EXTRA = /Zc:wchar_t-
! elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS $(CFLAGS_CRT)
! elseif "$(QMAKESPEC)" == "win32-msvc2015"
-CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 $(CFLAGS_CRT)
+CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 /wd4577 $(CFLAGS_CRT)
! else
! error Unsupported compiler for this Makefile
! endif
@@ -36,6 +36,7 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
-I$(SOURCE_PATH)\tools\shared \
+ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
@@ -88,6 +89,7 @@ QTOBJS= \
qglobal.obj \
qhash.obj \
qiodevice.obj \
+ qringbuffer.obj \
qdebug.obj \
qlist.obj \
qlinkedlist.obj \
diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
index 43de125446..6fa3ca085d 100644
--- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro
+++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
@@ -186,21 +186,6 @@ DEFINES += USE_MY_STUFF
#! [27]
-#! [28]
-myFiles.files = path\*.png
-DEPLOYMENT += myFiles
-#! [28]
-
-
-#! [29]
-myFiles.files = path\file1.ext1 path2\file2.ext1 path3\*
-myFiles.path = \some\path\on\device
-someother.files = C:\additional\files\*
-someother.path = \myFiles\path2
-DEPLOYMENT += myFiles someother
-#! [29]
-
-
#! [30]
DESTDIR = ../../lib
#! [30]
@@ -989,8 +974,12 @@ VERSION_PE_HEADER = 1.2
#! [185]
#! [186]
+RC_DEFINES += USE_MY_STUFF
+#! [186]
+
+#! [187]
win32-g++:contains(QMAKE_HOST.arch, x86_64):{
message("Host is 64bit")
...
}
-#! [186]
+#! [187]
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index ccb8d95973..e59b0ddcbe 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -728,7 +728,7 @@
\section2 Creating and Moving Xcode Projects
Developers on OS X can take advantage of the qmake support for Xcode
- project files, as described in \l{Additional Command-Line Options},
+ project files, as described in \l{Qt for OS X#Additional Command-Line Options}{Qt for OS X} documentation.
by running qmake to generate an Xcode project from an existing qmake project
file. For example:
@@ -1119,38 +1119,6 @@
Specifies a list of all directories to look in to resolve dependencies. This
variable is used when crawling through \c included files.
- \target DEPLOYMENT
- \section1 DEPLOYMENT
-
- \note This variable is used only on the Windows CE platform.
-
- Specifies which additional files will be deployed. Deployment means the
- transfer of files from the development system to the target device or
- emulator.
-
- Files can be deployed by either creating a Visual Studio project or using
- the \l {Using Qt Test remotely on Windows CE}{cetest} executable.
-
- For example, the following definition uploads all PNG images in \c path to
- the directory where the build target is deployed:
-
- \snippet code/doc_src_qmake-manual.pro 28
-
- The default deployment target path for Windows CE is
- \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
- \c{\Program Files\target}.
-
- It is also possible to specify multiple \c sources to be deployed on
- target \c paths. In addition, different variables can be used for
- deployment to different directories.
-
- For example:
-
- \snippet code/doc_src_qmake-manual.pro 29
-
- \note In Windows CE all linked Qt libraries will be deployed to the path
- specified by \c{myFiles.path}.
-
\target DEPLOYMENT_PLUGIN
\section1 DEPLOYMENT_PLUGIN
@@ -1275,6 +1243,13 @@
For more information, see \l{Installing Files}.
+ This variable is also used to specify which additional files will be
+ deployed to embedded devices.
+
+ For Windows CE, the default deployment target path is
+ \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
+ \c{\Program Files\target}.
+
\target LEXIMPLS
\section1 LEXIMPLS
@@ -1755,7 +1730,7 @@
\row \li .version_string \li Host OS version string
\endtable
- \snippet code/doc_src_qmake-manual.pro 186
+ \snippet code/doc_src_qmake-manual.pro 187
\target QMAKE_INCDIR
\section1 QMAKE_INCDIR
@@ -1870,6 +1845,22 @@
The value of this variable is typically handled by
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ \section1 QMAKE_LFLAGS_REL_RPATH
+
+ Specifies the linker flags needed to enable relative paths in
+ \l{QMAKE_RPATHDIR}.
+
+ The value of this variable is typically handled by
+ qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
+ \section1 QMAKE_REL_RPATH_BASE
+
+ Specifies the string the dynamic linker understands to be the
+ location of the referring executable or library.
+
+ The value of this variable is typically handled by
+ qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
\section1 QMAKE_LFLAGS_RPATHLINK
Specifies the linker flags needed to use the values from
@@ -2120,6 +2111,13 @@
executable at link time so that the paths will be preferentially
searched at runtime.
+ When relative paths are specified, qmake will mangle them into a form
+ understood by the dynamic linker to be relative to the location of
+ the referring executable or library.
+ This is supported only by some platforms (currently Linux and
+ Darwin-based ones) and is detectable by checking whether
+ \l{QMAKE_REL_RPATH_BASE} is set.
+
\section1 QMAKE_RPATHLINKDIR
Specifies a list of library paths for the static linker to search for implicit
@@ -2228,52 +2226,10 @@
\section1 QT
- Specifies the Qt modules that are used by your project.
-
- The table below shows the options that can be used with the \c QT variable
- and the Qt modules that are associated with each of them:
-
- \table
- \header \li Option \li Module Enabled
- \row \li axcontainer \li \l{Using ActiveX controls and COM in Qt}
- {QAxContainer}, which is
- part of the \l{Active Qt} framework
- \row \li axserver \li \l{Building ActiveX servers in Qt}
- {QAxServer}, which is
- part of the \l{Active Qt} framework
- \row \li concurrent \li \l{Qt Concurrent}
- \row \li core (included by default) \li \l{Qt Core}
- \row \li dbus \li \l{Qt D-Bus}
- \row \li declarative \li \l{Qt Quick 1} (deprecated)
- \row \li designer \li \l{Qt Designer}
- \row \li gui (included by default) \li \l{Qt GUI}
- \row \li help \li \l{Qt Help}
- \row \li multimedia \li \l{Qt Multimedia}
- \row \li multimediawidgets \li \l{Qt Multimedia Widgets}
- \row \li network \li \l{Qt Network}
- \row \li opengl \li \l{Qt OpenGL} (deprecated)
- \row \li printsupport \li \l{Qt Print Support}
- \row \li qml \li \l{Qt QML}
- \row \li qmltest \li \l{Qt QML Test}
- \row \li x11extras \li \l{Qt X11 Extras}
- \row \li quick \li \l{Qt Quick}
- \row \li script \li \l{Qt Script} (deprecated)
- \row \li scripttools \li \l{Qt Script Tools} (deprecated)
- \row \li sensors \li \l{Qt Sensors}
- \row \li serialport \li \l{Qt Serial Port}
- \row \li sql \li \l{Qt SQL}
- \row \li svg \li \l{Qt SVG}
- \row \li testlib \li \l{Qt Test}
- \row \li uitools \li \l{Qt UI Tools}
- \row \li webkit \li \l{Qt WebKit}
- \row \li webkitwidgets \li \l{Qt WebKit Widgets}
- \row \li widgets \li \l{Qt Widgets}
- \row \li winextras \li \l{Qt Windows Extras}
- \row \li xml \li \l{Qt XML} (deprecated)
- \row \li xmlpatterns \li \l{Qt XML Patterns}
- \endtable
+ Specifies the \l{All Modules}{Qt modules} that are used by your project. For
+ the value to add for each module, see the module documentation.
- By default, \c QT contains both \c core and \c gui, ensuring that standard
+ By default, \c QT contains \c core and \c gui, ensuring that standard
GUI applications can be built without further configuration.
If you want to build a project \e without the \l{Qt GUI} module, you need to
@@ -2336,6 +2292,14 @@
.rc file. This is only utilized if the \l{VERSION} or \l{RC_ICONS} variable
is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
+ \target RC_DEFINES
+ \section1 RC_DEFINES
+
+ Windows only. qmake adds the values of this variable as RC preprocessor macros
+ (/d option). If this variable is not set, the \l{DEFINES} variable is used instead.
+
+ \snippet code/doc_src_qmake-manual.pro 186
+
\target RC_ICONS
\section1 RC_ICONS
@@ -2444,7 +2408,6 @@
\row \li .file \li Specify the subproject \c pro file explicitly. Cannot be
used in conjunction with \c .subdir modifier.
\row \li .depends \li This subproject depends on specified subproject.
- Available only on platforms that use makefiles.
\row \li .makefile \li The makefile of subproject.
Available only on platforms that use makefiles.
\row \li .target \li Base string used for makefile targets related to this
@@ -4001,25 +3964,27 @@
\list 1
\li In a directory listed in the \c QMAKEFEATURES environment variable that
- contains a colon-separated list of directories.
+ contains a list of directories delimited by the platform's path list separator
+ (colon for Unix, semicolon for Windows).
\li In a directory listed in the \c QMAKEFEATURES property variable that
- contains a colon-spearated list of directories.
+ contains a list of directories delimited by the platform's path list separator.
\omit
\li In a features directory beneath the project's root directory (where
- the \c{.qmake.cache} file is generated).
+ the \c{.qmake.cache} file is generated).
\endomit
\li In a features directory residing within a \c mkspecs directory.
- \c mkspecs directories can be located beneath any of the directories
- listed in the \c QMAKEPATH environment variable that contains a
- colon-separated list of directories. For example:
+ \c mkspecs directories can be located beneath any of the directories
+ listed in the \c QMAKEPATH environment variable that contains a
+ list of directories delimited by the platform's path list separator.
+ For example:
\c{$QMAKEPATH/mkspecs/<features>}.
\li In a features directory residing beneath the directory provided by the
- \l{QMAKESPEC} environment variable. For example: \c{$QMAKESPEC/<features>}.
+ \l{QMAKESPEC} environment variable. For example: \c{$QMAKESPEC/<features>}.
\li In a features directory residing in the \c data_install/mkspecs directory.
- For example: \c{data_install/mkspecs/<features>}.
+ For example: \c{data_install/mkspecs/<features>}.
\li In a features directory that exists as a sibling of the directory
- specified by the \c QMAKESPEC environment variable.
- For example: \c{$QMAKESPEC/../<features>}.
+ specified by the \c QMAKESPEC environment variable.
+ For example: \c{$QMAKESPEC/../<features>}.
\endlist
The following features directories are searched for features files:
@@ -4525,7 +4490,7 @@
*/
/*!
- \target qmake-getting-started
+ \keyword qmake-getting-started
\page qmake-tutorial.html
\title Getting Started
\contentspage {qmake Manual}{Contents}
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 7ff1d97b16..42dd6c8aeb 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -417,20 +417,24 @@ public:
inline QString groupName() const { return group; }
inline QString compilerName() const { return compiler; }
inline bool isObjectOutput(const QString &file) const {
- bool ret = object_output;
- for(int i = 0; !ret && i < Option::c_ext.size(); ++i) {
- if(file.endsWith(Option::c_ext.at(i))) {
- ret = true;
- break;
- }
+ if (object_output)
+ return true;
+
+ if (file.endsWith(Option::objc_ext))
+ return true;
+ if (file.endsWith(Option::objcpp_ext))
+ return true;
+
+ for (int i = 0; i < Option::c_ext.size(); ++i) {
+ if (file.endsWith(Option::c_ext.at(i)))
+ return true;
}
- for(int i = 0; !ret && i < Option::cpp_ext.size(); ++i) {
- if(file.endsWith(Option::cpp_ext.at(i))) {
- ret = true;
- break;
- }
+ for (int i = 0; i < Option::cpp_ext.size(); ++i) {
+ if (file.endsWith(Option::cpp_ext.at(i)))
+ return true;
}
- return ret;
+
+ return false;
}
};
@@ -490,9 +494,9 @@ static QString xcodeFiletypeForFilename(const QString &filename)
return "sourcecode.c.h";
}
- if (filename.endsWith(QStringLiteral(".mm")))
+ if (filename.endsWith(Option::objcpp_ext))
return QStringLiteral("sourcecode.cpp.objcpp");
- if (filename.endsWith(QStringLiteral(".m")))
+ if (filename.endsWith(Option::objc_ext))
return QStringLiteral("sourcecode.c.objc");
if (filename.endsWith(QStringLiteral(".framework")))
return QStringLiteral("wrapper.framework");
@@ -816,7 +820,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
for(int x = 0; x < tmp.count();) {
bool remove = false;
QString library, name;
- ProString opt = tmp[x].trimmed();
+ ProString opt = tmp[x];
if(opt.startsWith("-L")) {
QString r = opt.mid(2).toQString();
fixForOutput(r);
@@ -833,8 +837,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
encode the version number in the Project file which might be a bad
things in days to come? --Sam
*/
- QString lib_file = (*lit) + Option::dir_sep + lib;
- if(QMakeMetaInfo::libExists(lib_file)) {
+ QString lib_file = QMakeMetaInfo::findLib(Option::normalizePath((*lit) + Option::dir_sep + lib));
+ if (!lib_file.isEmpty()) {
QMakeMetaInfo libinfo(project);
if(libinfo.readLib(lib_file)) {
if(!libinfo.isEmpty("QMAKE_PRL_TARGET")) {
@@ -849,8 +853,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QString librarySuffix = project->first("QMAKE_XCODE_LIBRARY_SUFFIX").toQString();
suffixSetting = "$(" + suffixSetting + ")";
if (!librarySuffix.isEmpty()) {
- library.replace(librarySuffix, suffixSetting);
- name.remove(librarySuffix);
+ int pos = library.lastIndexOf(librarySuffix + '.');
+ if (pos == -1) {
+ warn_msg(WarnLogic, "Failed to find expected suffix '%s' for library '%s'.",
+ qPrintable(librarySuffix), qPrintable(library));
+ } else {
+ library.replace(pos, librarySuffix.length(), suffixSetting);
+ if (name.endsWith(librarySuffix))
+ name.chop(librarySuffix.length());
+ }
} else {
library.replace(name, name + suffixSetting);
}
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7d4026c292..a54083c04d 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -252,10 +252,11 @@ MakefileGenerator::setProjectFile(QMakeProject *p)
else
target_mode = TARG_UNIX_MODE;
init();
- findLibraries();
- if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE &&
- project->isActiveConfig("link_prl")) //load up prl's'
- processPrlFiles();
+ bool linkPrl = (Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE)
+ && project->isActiveConfig("link_prl");
+ bool mergeLflags = !project->isActiveConfig("no_smart_library_merge")
+ && !project->isActiveConfig("no_lflags_merge");
+ findLibraries(linkPrl, mergeLflags);
}
ProStringList
@@ -377,6 +378,13 @@ MakefileGenerator::init()
ProValueMap &v = project->variables();
+ v["QMAKE_BUILTIN_COMPILERS"] = ProStringList() << "C" << "CXX";
+
+ v["QMAKE_LANGUAGE_C"] = ProString("c");
+ v["QMAKE_LANGUAGE_CXX"] = ProString("c++");
+ v["QMAKE_LANGUAGE_OBJC"] = ProString("objective-c");
+ v["QMAKE_LANGUAGE_OBJCXX"] = ProString("objective-c++");
+
if (v["TARGET"].isEmpty())
warn_msg(WarnLogic, "TARGET is empty");
@@ -871,65 +879,60 @@ MakefileGenerator::init()
bool
MakefileGenerator::processPrlFile(QString &file)
{
- bool ret = false, try_replace_file=false;
- QString meta_file, orig_file = file;
- if(QMakeMetaInfo::libExists(file)) {
+ bool try_replace_file = false;
+ QString f = fileFixify(file, FileFixifyBackwards);
+ QString meta_file = QMakeMetaInfo::findLib(f);
+ if (!meta_file.isEmpty()) {
try_replace_file = true;
- meta_file = file;
- file = "";
} else {
- QString tmp = file;
+ QString tmp = f;
int ext = tmp.lastIndexOf('.');
if(ext != -1)
tmp = tmp.left(ext);
- meta_file = tmp;
- }
-// meta_file = fileFixify(meta_file);
- QString real_meta_file = Option::normalizePath(meta_file);
- if(!meta_file.isEmpty()) {
- QString f = fileFixify(real_meta_file, FileFixifyBackwards);
- if(QMakeMetaInfo::libExists(f)) {
- QMakeMetaInfo libinfo(project);
- debug_msg(1, "Processing PRL file: %s", real_meta_file.toLatin1().constData());
- if(!libinfo.readLib(f)) {
- fprintf(stderr, "Error processing meta file: %s\n", real_meta_file.toLatin1().constData());
- } else if(project->isActiveConfig("no_read_prl_" + libinfo.type().toLower())) {
- debug_msg(2, "Ignored meta file %s [%s]", real_meta_file.toLatin1().constData(), libinfo.type().toLatin1().constData());
- } else {
- ret = true;
- project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS");
- ProStringList &defs = project->values("DEFINES");
- const ProStringList &prl_defs = project->values("PRL_EXPORT_DEFINES");
- foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES"))
- if (!defs.contains(def) && prl_defs.contains(def))
- defs.append(def);
- if(try_replace_file && !libinfo.isEmpty("QMAKE_PRL_TARGET")) {
- QString dir;
- int slsh = real_meta_file.lastIndexOf('/');
- if(slsh != -1)
- dir = real_meta_file.left(slsh+1);
- file = libinfo.first("QMAKE_PRL_TARGET").toQString();
- if(QDir::isRelativePath(file))
- file.prepend(dir);
- }
- }
- }
- if(ret) {
- QString mf = QMakeMetaInfo::findLib(meta_file);
- if(project->values("QMAKE_PRL_INTERNAL_FILES").indexOf(mf) == -1)
- project->values("QMAKE_PRL_INTERNAL_FILES").append(mf);
- if(project->values("QMAKE_INTERNAL_INCLUDED_FILES").indexOf(mf) == -1)
- project->values("QMAKE_INTERNAL_INCLUDED_FILES").append(mf);
- }
+ meta_file = QMakeMetaInfo::findLib(tmp);
}
- if(try_replace_file && file.isEmpty()) {
-#if 0
- warn_msg(WarnLogic, "Found prl [%s] file with no target [%s]!", meta_file.toLatin1().constData(),
- orig_file.toLatin1().constData());
-#endif
- file = orig_file;
+ if (meta_file.isEmpty())
+ return false;
+ QMakeMetaInfo libinfo(project);
+ debug_msg(1, "Processing PRL file: %s", meta_file.toLatin1().constData());
+ if (!libinfo.readLib(meta_file)) {
+ fprintf(stderr, "Error processing meta file %s\n", meta_file.toLatin1().constData());
+ return false;
}
- return ret;
+ if (project->isActiveConfig("no_read_prl_" + libinfo.type().toLower())) {
+ debug_msg(2, "Ignored meta file %s [%s]",
+ meta_file.toLatin1().constData(), libinfo.type().toLatin1().constData());
+ return false;
+ }
+ project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS");
+ ProStringList &defs = project->values("DEFINES");
+ const ProStringList &prl_defs = project->values("PRL_EXPORT_DEFINES");
+ foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES"))
+ if (!defs.contains(def) && prl_defs.contains(def))
+ defs.append(def);
+ if (try_replace_file) {
+ ProString tgt = libinfo.first("QMAKE_PRL_TARGET");
+ if (tgt.isEmpty()) {
+ fprintf(stderr, "Error: %s does not define QMAKE_PRL_TARGET\n",
+ meta_file.toLatin1().constData());
+ } else if (!tgt.contains('.')
+ && !libinfo.values("QMAKE_PRL_CONFIG").contains("lib_bundle")) {
+ fprintf(stderr, "Error: %s defines QMAKE_PRL_TARGET without extension\n",
+ meta_file.toLatin1().constData());
+ } else {
+ int off = qMax(file.lastIndexOf('/'), file.lastIndexOf('\\')) + 1;
+ debug_msg(1, " Replacing library reference %s with %s",
+ file.mid(off).toLatin1().constData(),
+ tgt.toQString().toLatin1().constData());
+ file.replace(off, 1000, tgt.toQString());
+ }
+ }
+ QString mf = fileFixify(meta_file);
+ if (!project->values("QMAKE_PRL_INTERNAL_FILES").contains(mf))
+ project->values("QMAKE_PRL_INTERNAL_FILES").append(mf);
+ if (!project->values("QMAKE_INTERNAL_INCLUDED_FILES").contains(mf))
+ project->values("QMAKE_INTERNAL_INCLUDED_FILES").append(mf);
+ return true;
}
void
@@ -944,12 +947,6 @@ MakefileGenerator::filterIncludedFiles(const char *var)
}
}
-void
-MakefileGenerator::processPrlFiles()
-{
- qFatal("MakefileGenerator::processPrlFiles() called!");
-}
-
static QString
qv(const ProString &val)
{
@@ -968,10 +965,6 @@ qv(const ProStringList &val)
void
MakefileGenerator::writePrlFile(QTextStream &t)
{
- ProString target = project->first("TARGET");
- int slsh = target.lastIndexOf(Option::dir_sep);
- if(slsh != -1)
- target.chopFront(slsh + 1);
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
@@ -981,7 +974,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl;
- t << "QMAKE_PRL_TARGET =" << qv(target) << endl;
+ t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << endl;
if(!project->isEmpty("PRL_EXPORT_DEFINES"))
t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << endl;
if(!project->isEmpty("PRL_EXPORT_CFLAGS"))
@@ -1151,12 +1144,28 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
<< " " << escapeDependencyPaths(findDependencies(srcf)).join(" \\\n\t\t");
ProKey comp;
- for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) {
- if((*sit).endsWith((*cppit))) {
- comp = "QMAKE_RUN_CXX";
- break;
+ foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) {
+ // Unfortunately we were not consistent about the C++ naming
+ ProString extensionSuffix = compiler;
+ if (extensionSuffix == "CXX")
+ extensionSuffix = ProString("CPP");
+
+ // Nor the C naming
+ ProString compilerSuffix = compiler;
+ if (compilerSuffix == "C")
+ compilerSuffix = ProString("CC");
+
+ foreach (const ProString &extension, project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) {
+ if ((*sit).endsWith(extension)) {
+ comp = ProKey("QMAKE_RUN_" + compilerSuffix);
+ break;
+ }
}
+
+ if (!comp.isNull())
+ break;
}
+
if (comp.isEmpty())
comp = "QMAKE_RUN_CC";
if (!project->isEmpty(comp)) {
@@ -2744,6 +2753,22 @@ MakefileGenerator::fileInfo(QString file) const
return fi;
}
+MakefileGenerator::LibFlagType
+MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
+{
+ if (flag.startsWith("-L")) {
+ *arg = flag.mid(2);
+ return LibFlagPath;
+ }
+ if (flag.startsWith("-l")) {
+ *arg = flag.mid(2);
+ return LibFlagLib;
+ }
+ if (flag.startsWith('-'))
+ return LibFlagOther;
+ return LibFlagFile;
+}
+
ProStringList
MakefileGenerator::fixLibFlags(const ProKey &var)
{
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 07483dbcb0..97159eaef4 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -185,7 +185,7 @@ protected:
virtual bool doDepends() const { return Option::mkfile::do_deps; }
void filterIncludedFiles(const char *);
- virtual void processSources() {
+ void processSources() {
filterIncludedFiles("SOURCES");
filterIncludedFiles("GENERATED_SOURCES");
}
@@ -197,11 +197,10 @@ protected:
QString prlFileName(bool fixify=true);
void writePrlFile();
bool processPrlFile(QString &);
- virtual void processPrlFiles();
virtual void writePrlFile(QTextStream &);
//make sure libraries are found
- virtual bool findLibraries();
+ virtual bool findLibraries(bool linkPrl, bool mergeLflags);
//for retrieving values and lists of values
virtual QString var(const ProKey &var) const;
@@ -221,6 +220,8 @@ protected:
QString filePrefixRoot(const QString &, const QString &);
+ enum LibFlagType { LibFlagLib, LibFlagPath, LibFlagFile, LibFlagOther };
+ virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg);
ProStringList fixLibFlags(const ProKey &var);
virtual ProString fixLibFlag(const ProString &lib);
@@ -276,7 +277,7 @@ inline bool MakefileGenerator::noIO() const
inline QString MakefileGenerator::defaultInstall(const QString &)
{ return QString(""); }
-inline bool MakefileGenerator::findLibraries()
+inline bool MakefileGenerator::findLibraries(bool, bool)
{ return true; }
inline MakefileGenerator::~MakefileGenerator()
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 79e017a560..047d17f18a 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -56,6 +56,7 @@
QT_BEGIN_NAMESPACE
+// FIXME: a line ending in CRLF gets counted as two lines.
#if 1
#define qmake_endOfLine(c) (c == '\r' || c == '\n')
#else
@@ -387,6 +388,121 @@ QFileInfo QMakeSourceFileInfo::findFileInfo(const QMakeLocalFileName &dep)
return QFileInfo(dep.real());
}
+static int skipEscapedLineEnds(const char *buffer, int buffer_len, int offset, int *lines)
+{
+ // Join physical lines to make logical lines, as in the C preprocessor
+ while (offset + 1 < buffer_len
+ && buffer[offset] == '\\'
+ && qmake_endOfLine(buffer[offset + 1])) {
+ offset += 2;
+ ++*lines;
+ if (offset < buffer_len
+ && buffer[offset - 1] == '\r'
+ && buffer[offset] == '\n') // CRLF
+ offset++;
+ }
+ return offset;
+}
+
+static bool matchWhileUnsplitting(const char *buffer, int buffer_len, int start,
+ const char *needle, int needle_len,
+ int *matchlen, int *lines)
+{
+ int x = start;
+ for (int n = 0; n < needle_len && x < buffer_len;
+ n++, x = skipEscapedLineEnds(buffer, buffer_len, x + 1, lines)) {
+ if (buffer[x] != needle[n])
+ return false;
+ }
+ // That also skipped any remaining BSNLs immediately after the match.
+
+ // Tell caller how long the match was:
+ *matchlen = x - start;
+
+ return true;
+}
+
+/* Advance from an opening quote at buffer[offset] to the matching close quote. */
+static int scanPastString(char *buffer, int buffer_len, int offset, int *lines)
+{
+ // It might be a C++11 raw string.
+ bool israw = false;
+ if (buffer[offset] == '"' && offset > 0) {
+ int explore = offset - 1;
+ while (explore > 0 && buffer[explore] != 'R') {
+ if (buffer[explore] == '8' || buffer[explore] == 'u' || buffer[explore] == 'U') {
+ explore--;
+ } else if (explore > 1 && qmake_endOfLine(buffer[explore])
+ && buffer[explore - 1] == '\\') {
+ explore -= 2;
+ } else if (explore > 2 && buffer[explore] == '\n'
+ && buffer[explore - 1] == '\r'
+ && buffer[explore - 2] == '\\') {
+ explore -= 3;
+ } else {
+ break;
+ }
+ }
+ israw = (buffer[explore] == 'R');
+ }
+
+ if (israw) {
+#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), lines)
+
+ offset = SKIP_BSNL(offset + 1);
+ const char *const delim = buffer + offset;
+ int clean = offset;
+ while (offset < buffer_len && buffer[offset] != '(') {
+ if (clean < offset)
+ buffer[clean++] = buffer[offset];
+ else
+ clean++;
+
+ offset = SKIP_BSNL(offset + 1);
+ }
+ /*
+ Not checking correctness (trust real compiler to do that):
+ - no controls, spaces, '(', ')', '\\' or (presumably) '"' in delim;
+ - at most 16 bytes in delim
+
+ Raw strings are surely defined after phase 2, when BSNLs are resolved;
+ so the delimiter's exclusion of '\\' and space (including newlines)
+ applies too late to save us the need to cope with BSNLs in it.
+ */
+
+ const int delimlen = buffer + clean - delim;
+ int matchlen = delimlen, extralines = 0;
+ while ((offset = SKIP_BSNL(offset + 1)) < buffer_len
+ && (buffer[offset] != ')'
+ || (delimlen > 0 &&
+ !matchWhileUnsplitting(buffer, buffer_len,
+ offset + 1, delim, delimlen,
+ &matchlen, &extralines))
+ || buffer[offset + 1 + matchlen] != '"')) {
+ // skip, but keep track of lines
+ if (qmake_endOfLine(buffer[offset]))
+ ++*lines;
+ extralines = 0;
+ }
+ *lines += extralines; // from the match
+ // buffer[offset] is ')'
+ offset += 1 + matchlen; // 1 for ')', then delim
+ // buffer[offset] is '"'
+
+#undef SKIP_BSNL
+ } else { // Traditional string or char literal:
+ const char term = buffer[offset];
+ while (++offset < buffer_len && buffer[offset] != term) {
+ if (buffer[offset] == '\\')
+ ++offset;
+ else if (qmake_endOfLine(buffer[offset]))
+ ++*lines;
+ }
+ }
+
+ return offset;
+}
+
bool QMakeSourceFileInfo::findDeps(SourceFile *file)
{
if(file->dep_checked || file->type == TYPE_UNKNOWN)
@@ -425,215 +541,255 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
file->deps = new SourceDependChildren;
int line_count = 1;
+ enum {
+ /*
+ States of C preprocessing (for TYPE_C only), after backslash-newline
+ elimination and skipping comments and spaces (i.e. in ANSI X3.159-1989
+ section 2.1.1.2's phase 4). We're about to study buffer[x] to decide
+ on which transition to do.
+ */
+ AtStart, // start of logical line; a # may start a preprocessor directive
+ HadHash, // saw a # at start, looking for preprocessor keyword
+ WantName, // saw #include or #import, waiting for name
+ InCode // after directive, parsing non-#include directive or in actual code
+ } cpp_state = AtStart;
for(int x = 0; x < buffer_len; ++x) {
bool try_local = true;
char *inc = 0;
if(file->type == QMakeSourceFileInfo::TYPE_UI) {
// skip whitespaces
- while(x < buffer_len && (*(buffer+x) == ' ' || *(buffer+x) == '\t'))
+ while (x < buffer_len && (buffer[x] == ' ' || buffer[x] == '\t'))
++x;
- if(*(buffer + x) == '<') {
+ if (buffer[x] == '<') {
++x;
- if(buffer_len >= x + 12 && !strncmp(buffer + x, "includehint", 11) &&
- (*(buffer + x + 11) == ' ' || *(buffer + x + 11) == '>')) {
- for(x += 11; *(buffer + x) != '>'; ++x) ;
+ if (buffer_len >= x + 12 && !strncmp(buffer + x, "includehint", 11) &&
+ (buffer[x + 11] == ' ' || buffer[x + 11] == '>')) {
+ for (x += 11; buffer[x] != '>'; ++x) {} // skip
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
- *(buffer + x + inc_len) = '\0';
+ for (x += 1 ; buffer[x + inc_len] != '<'; ++inc_len) {} // skip
+ buffer[x + inc_len] = '\0';
inc = buffer + x;
- } else if(buffer_len >= x + 13 && !strncmp(buffer + x, "customwidget", 12) &&
- (*(buffer + x + 12) == ' ' || *(buffer + x + 12) == '>')) {
- for(x += 13; *(buffer + x) != '>'; ++x) ; //skip up to >
+ } else if (buffer_len >= x + 13 && !strncmp(buffer + x, "customwidget", 12) &&
+ (buffer[x + 12] == ' ' || buffer[x + 12] == '>')) {
+ for (x += 13; buffer[x] != '>'; ++x) {} // skip up to >
while(x < buffer_len) {
- for(x++; *(buffer + x) != '<'; ++x) ; //skip up to <
+ for (x++; buffer[x] != '<'; ++x) {} // skip up to <
x++;
if(buffer_len >= x + 7 && !strncmp(buffer+x, "header", 6) &&
- (*(buffer + x + 6) == ' ' || *(buffer + x + 6) == '>')) {
- for(x += 7; *(buffer + x) != '>'; ++x) ; //skip up to >
+ (buffer[x + 6] == ' ' || buffer[x + 6] == '>')) {
+ for (x += 7; buffer[x] != '>'; ++x) {} // skip up to >
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
- *(buffer + x + inc_len) = '\0';
+ for (x += 1 ; buffer[x + inc_len] != '<'; ++inc_len) {} // skip
+ buffer[x + inc_len] = '\0';
inc = buffer + x;
break;
} else if(buffer_len >= x + 14 && !strncmp(buffer+x, "/customwidget", 13) &&
- (*(buffer + x + 13) == ' ' || *(buffer + x + 13) == '>')) {
+ (buffer[x + 13] == ' ' || buffer[x + 13] == '>')) {
x += 14;
break;
}
}
} else if(buffer_len >= x + 8 && !strncmp(buffer + x, "include", 7) &&
- (*(buffer + x + 7) == ' ' || *(buffer + x + 7) == '>')) {
- for(x += 8; *(buffer + x) != '>'; ++x) {
- if(buffer_len >= x + 9 && *(buffer + x) == 'i' &&
- !strncmp(buffer + x, "impldecl", 8)) {
- for(x += 8; *(buffer + x) != '='; ++x) ;
- if(*(buffer + x) != '=')
+ (buffer[x + 7] == ' ' || buffer[x + 7] == '>')) {
+ for (x += 8; buffer[x] != '>'; ++x) {
+ if (buffer_len >= x + 9 && buffer[x] == 'i' &&
+ !strncmp(buffer + x, "impldecl", 8)) {
+ for (x += 8; buffer[x] != '='; ++x) {} // skip
+ if (buffer[x] != '=')
continue;
- for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x) ;
+ for (++x; buffer[x] == '\t' || buffer[x] == ' '; ++x) {} // skip
char quote = 0;
- if(*(buffer+x) == '\'' || *(buffer+x) == '"') {
- quote = *(buffer + x);
+ if (buffer[x] == '\'' || buffer[x] == '"') {
+ quote = buffer[x];
++x;
}
int val_len;
for(val_len = 0; true; ++val_len) {
if(quote) {
- if(*(buffer+x+val_len) == quote)
+ if (buffer[x + val_len] == quote)
break;
- } else if(*(buffer + x + val_len) == '>' ||
- *(buffer + x + val_len) == ' ') {
+ } else if (buffer[x + val_len] == '>' ||
+ buffer[x + val_len] == ' ') {
break;
}
}
-//? char saved = *(buffer + x + val_len);
- *(buffer + x + val_len) = '\0';
+//? char saved = buffer[x + val_len];
+ buffer[x + val_len] = '\0';
if(!strcmp(buffer+x, "in implementation")) {
//### do this
}
}
}
int inc_len = 0;
- for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ;
- *(buffer + x + inc_len) = '\0';
+ for (x += 1 ; buffer[x + inc_len] != '<'; ++inc_len) {} // skip
+ buffer[x + inc_len] = '\0';
inc = buffer + x;
}
}
//read past new line now..
- for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
+ for (; x < buffer_len && !qmake_endOfLine(buffer[x]); ++x) {} // skip
++line_count;
} else if(file->type == QMakeSourceFileInfo::TYPE_QRC) {
} else if(file->type == QMakeSourceFileInfo::TYPE_C) {
- for(int beginning=1; x < buffer_len; ++x) {
- // whitespace comments and line-endings
+ // We've studied all buffer[i] for i < x
+ for (; x < buffer_len; ++x) {
+ // How to handle backslash-newline (BSNL) pairs:
+#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count)
+
+ // Seek code or directive, skipping comments and space:
for(; x < buffer_len; ++x) {
- if(*(buffer+x) == ' ' || *(buffer+x) == '\t') {
+ x = SKIP_BSNL(x);
+ if (buffer[x] == ' ' || buffer[x] == '\t') {
// keep going
- } else if(*(buffer+x) == '/') {
- ++x;
- if(buffer_len >= x) {
- if(*(buffer+x) == '/') { //c++ style comment
- for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
- beginning = 1;
- } else if(*(buffer+x) == '*') { //c style comment
- for(++x; x < buffer_len; ++x) {
- if(*(buffer+x) == '*') {
- if(x+1 < buffer_len && *(buffer + (x+1)) == '/') {
- ++x;
- break;
- }
- } else if(qmake_endOfLine(*(buffer+x))) {
- ++line_count;
+ } else if (buffer[x] == '/') {
+ int extralines = 0;
+ int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines);
+ if (buffer[y] == '/') { // C++-style comment
+ line_count += extralines;
+ x = SKIP_BSNL(y + 1);
+ while (x < buffer_len && !qmake_endOfLine(buffer[x]))
+ x = SKIP_BSNL(x + 1); // skip
+
+ cpp_state = AtStart;
+ ++line_count;
+ } else if (buffer[y] == '*') { // C-style comment
+ line_count += extralines;
+ x = y;
+ while (++x < buffer_len) {
+ x = SKIP_BSNL(x);
+ if (buffer[x] == '*') {
+ extralines = 0;
+ y = skipEscapedLineEnds(buffer, buffer_len,
+ x + 1, &extralines);
+ if (y < buffer_len && buffer[y] == '/') {
+ line_count += extralines;
+ x = y; // for loop shall step past this
+ break;
}
+ } else if (qmake_endOfLine(buffer[x])) {
+ ++line_count;
}
}
+ } else {
+ // buffer[x] is the division operator
+ break;
}
- } else if(qmake_endOfLine(*(buffer+x))) {
+ } else if (qmake_endOfLine(buffer[x])) {
++line_count;
- beginning = 1;
+ cpp_state = AtStart;
} else {
+ /* Drop out of phases 1, 2, 3, into phase 4 */
break;
}
}
+ // Phase 4 study of buffer[x]:
if(x >= buffer_len)
break;
- // preprocessor directive
- if(beginning && *(buffer+x) == '#')
+ switch (cpp_state) {
+ case HadHash:
+ {
+ // Read keyword; buffer[x] starts first preprocessing token after #
+ const char *const keyword = buffer + x;
+ int clean = x;
+ while (x < buffer_len && buffer[x] >= 'a' && buffer[x] <= 'z') {
+ // skip over keyword, consolidating it if it contains BSNLs
+ // (see WantName's similar code consolidating inc, below)
+ if (clean < x)
+ buffer[clean++] = buffer[x];
+ else
+ clean++;
+
+ x = SKIP_BSNL(x + 1);
+ }
+ const int keyword_len = buffer + clean - keyword;
+ x--; // Still need to study buffer[x] next time round for loop.
+
+ cpp_state =
+ ((keyword_len == 7 && !strncmp(keyword, "include", 7)) // C & Obj-C
+ || (keyword_len == 6 && !strncmp(keyword, "import", 6))) // Obj-C
+ ? WantName : InCode;
break;
+ }
- // quoted strings
- if(*(buffer+x) == '\'' || *(buffer+x) == '"') {
- const char term = *(buffer+(x++));
- for(; x < buffer_len; ++x) {
- if(*(buffer+x) == term) {
- ++x;
- break;
- } else if(*(buffer+x) == '\\') {
- ++x;
- } else if(qmake_endOfLine(*(buffer+x))) {
+ case WantName:
+ {
+ char term = buffer[x];
+ if (term == '<') {
+ try_local = false;
+ term = '>';
+ } else if (term != '"') {
+ /*
+ Possibly malformed, but this may be something like:
+ #include IDENTIFIER
+ which does work, if #define IDENTIFIER "filename" is
+ in effect. This is beyond this noddy preprocessor's
+ powers of tracking. So give up and resume searching
+ for a directive. We haven't made sense of buffer[x],
+ so back up to ensure we do study it (now as code) next
+ time round the loop.
+ */
+ x--;
+ cpp_state = InCode;
+ continue;
+ }
+
+ x = SKIP_BSNL(x + 1);
+ inc = buffer + x;
+ int clean = x; // offset if we need to clear \-newlines
+ for (; x < buffer_len && buffer[x] != term; x = SKIP_BSNL(x + 1)) {
+ if (qmake_endOfLine(buffer[x])) { // malformed
+ cpp_state = AtStart;
++line_count;
+ break;
}
- }
- }
- beginning = 0;
- }
- if(x >= buffer_len)
- break;
- //got a preprocessor symbol
- ++x;
- while(x < buffer_len) {
- if(*(buffer+x) != ' ' && *(buffer+x) != '\t')
- break;
- ++x;
- }
+ /*
+ If we do skip any BSNLs, we need to consolidate the
+ surviving text by copying to lower indices. For that
+ to be possible, we also have to keep 'clean' advanced
+ in step with x even when we've yet to see any BSNLs.
+ */
+ if (clean < x)
+ buffer[clean++] = buffer[x];
+ else
+ clean++;
+ }
+ if (cpp_state == WantName)
+ buffer[clean] = '\0';
+ else // i.e. malformed
+ inc = 0;
- int keyword_len = 0;
- const char *keyword = buffer+x;
- while(x+keyword_len < buffer_len) {
- if(((*(buffer+x+keyword_len) < 'a' || *(buffer+x+keyword_len) > 'z')) &&
- *(buffer+x+keyword_len) != '_') {
- for(x+=keyword_len; //skip spaces after keyword
- x < buffer_len && (*(buffer+x) == ' ' || *(buffer+x) == '\t');
- x++) ;
- break;
- } else if(qmake_endOfLine(*(buffer+x+keyword_len))) {
- x += keyword_len-1;
- keyword_len = 0;
+ cpp_state = InCode; // hereafter
break;
}
- keyword_len++;
- }
- if((keyword_len == 7 && !strncmp(keyword, "include", 7)) // C & Obj-C
- || (keyword_len == 6 && !strncmp(keyword, "import", 6))) { // Obj-C
- char term = *(buffer + x);
- if(term == '<') {
- try_local = false;
- term = '>';
- } else if(term != '"') { //wtf?
- continue;
- }
- x++;
-
- int inc_len;
- for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len) ;
- *(buffer + x + inc_len) = '\0';
- inc = buffer + x;
- x += inc_len;
- } else if(keyword_len == 13 && !strncmp(keyword, "qmake_warning", keyword_len)) {
- char term = 0;
- if(*(buffer + x) == '"')
- term = '"';
- if(*(buffer + x) == '\'')
- term = '\'';
- if(term)
- x++;
-
- int msg_len;
- for(msg_len = 0; (term && *(buffer + x + msg_len) != term) &&
- !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len) ;
- *(buffer + x + msg_len) = '\0';
- debug_msg(0, "%s:%d %s -- %s", file->file.local().toLatin1().constData(), line_count, keyword, buffer+x);
- x += msg_len;
- } else if(*(buffer+x) == '\'' || *(buffer+x) == '"') {
- const char term = *(buffer+(x++));
- while(x < buffer_len) {
- if(*(buffer+x) == term)
+ case AtStart:
+ // Preprocessor directive?
+ if (buffer[x] == '#') {
+ cpp_state = HadHash;
break;
- if(*(buffer+x) == '\\') {
- x+=2;
- } else {
- if(qmake_endOfLine(*(buffer+x)))
- ++line_count;
- ++x;
}
+ cpp_state = InCode;
+ // ... and fall through to handle buffer[x] as such.
+ case InCode:
+ // matching quotes (string literals and character literals)
+ if (buffer[x] == '\'' || buffer[x] == '"') {
+ x = scanPastString(buffer, buffer_len, x, &line_count);
+ // for loop's ++x shall step over the closing quote.
+ }
+ // else: buffer[x] is just some code; move on.
+ break;
}
- } else {
- --x;
+
+ if (inc) // We were in WantName and found a name.
+ break;
+#undef SKIP_BSNL
}
+ if(x >= buffer_len)
+ break;
}
if(inc) {
@@ -702,6 +858,13 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
return true;
}
+static bool isCWordChar(char c) {
+ return c == '_'
+ || (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || (c >= '0' && c <= '9');
+}
+
bool QMakeSourceFileInfo::findMocs(SourceFile *file)
{
if(file->moc_checked)
@@ -709,7 +872,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
files_changed = true;
file->moc_checked = true;
- int buffer_len;
+ int buffer_len = 0;
char *buffer = 0;
{
struct stat fst;
@@ -727,104 +890,101 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
return false; //shouldn't happen
}
buffer = getBuffer(fst.st_size);
- for(int have_read = buffer_len = 0;
- (have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len));
- buffer_len += have_read) ;
+ while (int have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len))
+ buffer_len += have_read;
+
QT_CLOSE(fd);
}
debug_msg(2, "findMocs: %s", file->file.local().toLatin1().constData());
int line_count = 1;
- bool ignore_qobject = false, ignore_qgadget = false;
+ bool ignore[2] = { false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET
/* qmake ignore Q_GADGET */
/* qmake ignore Q_OBJECT */
for(int x = 0; x < buffer_len; x++) {
- if(*(buffer + x) == '/') {
- ++x;
- if(buffer_len >= x) {
- if(*(buffer + x) == '/') { //c++ style comment
- for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ;
- } else if(*(buffer + x) == '*') { //c style comment
- for(++x; x < buffer_len; ++x) {
- if(*(buffer + x) == 't' || *(buffer + x) == 'q') { //ignore
+#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count)
+ x = SKIP_BSNL(x);
+ if (buffer[x] == '/') {
+ int extralines = 0;
+ int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines);
+ if (buffer_len > y) {
+ // If comment, advance to the character that ends it:
+ if (buffer[y] == '/') { // C++-style comment
+ line_count += extralines;
+ x = y;
+ do {
+ x = SKIP_BSNL(x + 1);
+ } while (x < buffer_len && !qmake_endOfLine(buffer[x]));
+
+ } else if (buffer[y] == '*') { // C-style comment
+ line_count += extralines;
+ x = SKIP_BSNL(y + 1);
+ for (; x < buffer_len; x = SKIP_BSNL(x + 1)) {
+ if (buffer[x] == 't' || buffer[x] == 'q') { // ignore
if(buffer_len >= (x + 20) &&
!strncmp(buffer + x + 1, "make ignore Q_OBJECT", 20)) {
debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_OBJECT\"",
file->file.real().toLatin1().constData(), line_count);
x += 20;
- ignore_qobject = true;
+ ignore[0] = true;
} else if(buffer_len >= (x + 20) &&
!strncmp(buffer + x + 1, "make ignore Q_GADGET", 20)) {
debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_GADGET\"",
file->file.real().toLatin1().constData(), line_count);
x += 20;
- ignore_qgadget = true;
+ ignore[1] = true;
}
- } else if(*(buffer + x) == '*') {
- if(buffer_len >= (x+1) && *(buffer + (x+1)) == '/') {
- ++x;
+ } else if (buffer[x] == '*') {
+ extralines = 0;
+ y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines);
+ if (buffer_len > y && buffer[y] == '/') {
+ line_count += extralines;
+ x = y;
break;
}
- } else if(Option::debug_level && qmake_endOfLine(*(buffer + x))) {
+ } else if (Option::debug_level && qmake_endOfLine(buffer[x])) {
++line_count;
}
}
}
+ // else: don't update x, buffer[x] is just the division operator.
}
- } else if(*(buffer+x) == '\'' || *(buffer+x) == '"') {
- const char term = *(buffer+(x++));
- while(x < buffer_len) {
- if(*(buffer+x) == term)
- break;
- if(*(buffer+x) == '\\') {
- x+=2;
- } else {
- if(qmake_endOfLine(*(buffer+x)))
- ++line_count;
- ++x;
- }
- }
+ } else if (buffer[x] == '\'' || buffer[x] == '"') {
+ x = scanPastString(buffer, buffer_len, x, &line_count);
+ // Leaves us on closing quote; for loop's x++ steps us past it.
}
- if(Option::debug_level && qmake_endOfLine(*(buffer+x)))
+
+ if (x < buffer_len && Option::debug_level && qmake_endOfLine(buffer[x]))
++line_count;
- if (buffer_len > x + 2 && buffer[x + 1] == 'Q' && buffer[x + 2] == '_' &&
- *(buffer + x) != '_' &&
- (*(buffer + x) < 'a' || *(buffer + x) > 'z') &&
- (*(buffer + x) < 'A' || *(buffer + x) > 'Z') &&
- (*(buffer + x) < '0' || *(buffer + x) > '9')) {
- ++x;
- int match = 0;
- static const char *interesting[] = { "OBJECT", "GADGET" };
- for (int interest = 0, m1, m2; interest < 2; ++interest) {
- if(interest == 0 && ignore_qobject)
- continue;
- else if(interest == 1 && ignore_qgadget)
- continue;
- for(m1 = 0, m2 = 0; *(interesting[interest]+m1); ++m1) {
- if(*(interesting[interest]+m1) != *(buffer+x+2+m1)) {
- m2 = -1;
- break;
+ if (buffer_len > x + 8 && !isCWordChar(buffer[x])) {
+ int morelines = 0;
+ int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &morelines);
+ if (buffer[y] == 'Q') {
+ static const char interesting[][9] = { "Q_OBJECT", "Q_GADGET" };
+ for (int interest = 0; interest < 2; ++interest) {
+ if (ignore[interest])
+ continue;
+
+ int matchlen = 0, extralines = 0;
+ if (matchWhileUnsplitting(buffer, buffer_len, y,
+ interesting[interest],
+ strlen(interesting[interest]),
+ &matchlen, &extralines)
+ && y + matchlen < buffer_len
+ && !isCWordChar(buffer[y + matchlen])) {
+ if (Option::debug_level) {
+ buffer[y + matchlen] = '\0';
+ debug_msg(2, "Mocgen: %s:%d Found MOC symbol %s",
+ file->file.real().toLatin1().constData(),
+ line_count + morelines, buffer + y);
+ }
+ file->mocable = true;
+ return true;
}
- ++m2;
- }
- if(m1 == m2) {
- match = m2 + 2;
- break;
- }
- }
- if(match && *(buffer+x+match) != '_' &&
- (*(buffer+x+match) < 'a' || *(buffer+x+match) > 'z') &&
- (*(buffer+x+match) < 'A' || *(buffer+x+match) > 'Z') &&
- (*(buffer+x+match) < '0' || *(buffer+x+match) > '9')) {
- if(Option::debug_level) {
- *(buffer+x+match) = '\0';
- debug_msg(2, "Mocgen: %s:%d Found MOC symbol %s", file->file.real().toLatin1().constData(),
- line_count, buffer+x);
}
- file->mocable = true;
- return true;
}
}
+#undef SKIP_BSNL
}
return true;
}
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index 9b1796c45d..7d042ce66c 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -166,7 +166,7 @@ ProjectGenerator::init()
QString nd = newdir;
if(nd == ".")
nd = "";
- else if(!nd.isEmpty() && !nd.endsWith(QString(QChar(QDir::separator()))))
+ else if (!nd.isEmpty() && !nd.endsWith(QDir::separator()))
nd += QDir::separator();
nd += profiles[i];
fileFixify(nd);
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index c4750cb8a4..57c0a97228 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -45,21 +45,11 @@ QT_BEGIN_NAMESPACE
void
UnixMakefileGenerator::init()
{
- if(project->isEmpty("QMAKE_EXTENSION_SHLIB")) {
- if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) {
- project->values("QMAKE_EXTENSION_SHLIB").append("so");
- } else {
- project->values("QMAKE_EXTENSION_SHLIB").append("dll");
- }
- }
-
ProStringList &configs = project->values("CONFIG");
if(project->isEmpty("ICON") && !project->isEmpty("RC_FILE"))
project->values("ICON") = project->values("RC_FILE");
if(project->isEmpty("QMAKE_EXTENSION_PLUGIN"))
project->values("QMAKE_EXTENSION_PLUGIN").append(project->first("QMAKE_EXTENSION_SHLIB"));
- if(project->isEmpty("QMAKE_LIBTOOL"))
- project->values("QMAKE_LIBTOOL").append("libtool --silent");
project->values("QMAKE_ORIG_TARGET") = project->values("TARGET");
@@ -111,11 +101,6 @@ UnixMakefileGenerator::init()
project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_PREBIND");
if(!project->isEmpty("QMAKE_INCDIR"))
project->values("INCLUDEPATH") += project->values("QMAKE_INCDIR");
- project->values("QMAKE_L_FLAG")
- << (project->isActiveConfig("rvct_linker") ? "--userlibpath "
- : project->isActiveConfig("armcc_linker") ? "-L--userlibpath="
- : project->isActiveConfig("ti_linker") ? "--search_path="
- : "-L");
ProStringList ldadd;
if(!project->isEmpty("QMAKE_LIBDIR")) {
const ProStringList &libdirs = project->values("QMAKE_LIBDIR");
@@ -140,8 +125,23 @@ UnixMakefileGenerator::init()
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
for (int i = 0; i < rpathdirs.size(); ++i) {
QString rpathdir = rpathdirs[i].toQString();
- if (!rpathdir.startsWith('@') && !rpathdir.startsWith('$'))
- rpathdir = QFileInfo(rpathdir).absoluteFilePath();
+ if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(') {
+ rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell
+ } else if (!rpathdir.startsWith('@') && fileInfo(rpathdir).isRelative()) {
+ QString rpathbase = project->first("QMAKE_REL_RPATH_BASE").toQString();
+ if (rpathbase.isEmpty()) {
+ fprintf(stderr, "Error: This platform does not support relative paths in QMAKE_RPATHDIR (%s)\n",
+ rpathdir.toLatin1().constData());
+ continue;
+ }
+ if (rpathbase.startsWith('$'))
+ rpathbase.replace(0, 1, "\\$$"); // Escape from make and the shell
+ if (rpathdir == ".")
+ rpathdir = rpathbase;
+ else
+ rpathdir.prepend(rpathbase + '/');
+ project->values("QMAKE_LFLAGS").insertUnique(project->values("QMAKE_LFLAGS_REL_RPATH"));
+ }
project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(rpathdir);
}
}
@@ -155,19 +155,19 @@ UnixMakefileGenerator::init()
if(project->isActiveConfig("GNUmake") && !project->isEmpty("QMAKE_CFLAGS_DEPS"))
include_deps = true; //do not generate deps
- if(project->isActiveConfig("compile_libtool"))
- Option::obj_ext = ".lo"; //override the .o
MakefileGenerator::init();
- QString comps[] = { "C", "CXX", "OBJC", "OBJCXX", QString() };
- for(int i = 0; !comps[i].isNull(); i++) {
+ if (project->isActiveConfig("objective_c"))
+ project->values("QMAKE_BUILTIN_COMPILERS") << "OBJC" << "OBJCXX";
+
+ foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) {
QString compile_flag = var("QMAKE_COMPILE_FLAG");
if(compile_flag.isEmpty())
compile_flag = "-c";
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
- QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_USE_PRECOMPILE"));
+ QString pchFlags = var(ProKey("QMAKE_" + compiler + "FLAGS_USE_PRECOMPILE"));
QString pchBaseName;
if(!project->isEmpty("PRECOMPILED_DIR")) {
@@ -194,22 +194,11 @@ UnixMakefileGenerator::init()
pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
pchBaseName += Option::dir_sep;
- QString pchOutputFile;
-
- if(comps[i] == "C") {
- pchOutputFile = "c";
- } else if(comps[i] == "CXX") {
- pchOutputFile = "c++";
- } else if(project->isActiveConfig("objective_c")) {
- if(comps[i] == "OBJC")
- pchOutputFile = "objective-c";
- else if(comps[i] == "OBJCXX")
- pchOutputFile = "objective-c++";
- }
- if(!pchOutputFile.isEmpty()) {
+ ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler));
+ if (!language.isEmpty()) {
pchFlags.replace("${QMAKE_PCH_OUTPUT}",
- escapeFilePath(pchBaseName + pchOutputFile + headerSuffix));
+ escapeFilePath(pchBaseName + language + headerSuffix));
}
}
@@ -217,26 +206,30 @@ UnixMakefileGenerator::init()
compile_flag += " " + pchFlags;
}
- QString cflags;
- if(comps[i] == "OBJC" || comps[i] == "OBJCXX")
- cflags += " $(CFLAGS)";
- else
- cflags += " $(" + comps[i] + "FLAGS)";
- compile_flag += cflags + " $(INCPATH)";
+ QString compilerExecutable;
+ if (compiler == "C" || compiler == "OBJC") {
+ compilerExecutable = "$(CC)";
+ compile_flag += " $(CFLAGS)";
+ } else {
+ compilerExecutable = "$(CXX)";
+ compile_flag += " $(CXXFLAGS)";
+ }
+
+ compile_flag += " $(INCPATH)";
- QString compiler = comps[i];
- if (compiler == "C")
- compiler = "CC";
+ ProString compilerVariable = compiler;
+ if (compilerVariable == "C")
+ compilerVariable = ProString("CC");
- const ProKey runComp("QMAKE_RUN_" + compiler);
+ const ProKey runComp("QMAKE_RUN_" + compilerVariable);
if(project->isEmpty(runComp))
- project->values(runComp).append("$(" + compiler + ") " + compile_flag + " " + var("QMAKE_CC_O_FLAG") + "$obj $src");
- const ProKey runCompImp("QMAKE_RUN_" + compiler + "_IMP");
+ project->values(runComp).append(compilerExecutable + " " + compile_flag + " " + var("QMAKE_CC_O_FLAG") + "$obj $src");
+ const ProKey runCompImp("QMAKE_RUN_" + compilerVariable + "_IMP");
if(project->isEmpty(runCompImp))
- project->values(runCompImp).append("$(" + compiler + ") " + compile_flag + " " + var("QMAKE_CC_O_FLAG") + "\"$@\" \"$<\"");
+ project->values(runCompImp).append(compilerExecutable + " " + compile_flag + " " + var("QMAKE_CC_O_FLAG") + "\"$@\" \"$<\"");
}
- if (project->isActiveConfig("mac") && !project->isEmpty("TARGET") && !project->isActiveConfig("compile_libtool") &&
+ if (project->isActiveConfig("mac") && !project->isEmpty("TARGET") &&
((project->isActiveConfig("build_pass") || project->isEmpty("BUILDS")))) {
ProString bundle;
if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) {
@@ -290,6 +283,11 @@ UnixMakefileGenerator::init()
init2();
project->values("QMAKE_INTERNAL_PRL_LIBS") << "QMAKE_LIBS";
+ ProString target = project->first("TARGET");
+ int slsh = target.lastIndexOf(Option::dir_sep);
+ if (slsh != -1)
+ target.chopFront(slsh + 1);
+ project->values("LIB_TARGET").prepend(target);
if(!project->isEmpty("QMAKE_MAX_FILES_PER_AR")) {
bool ok;
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt(&ok);
@@ -313,56 +311,14 @@ UnixMakefileGenerator::init()
project->values("QMAKE_INTERNAL_PRL_LIBS") << "QMAKE_AR_SUBLIBS";
}
}
-
- if(project->isActiveConfig("compile_libtool")) {
- static const char * const libtoolify[] = {
- "QMAKE_RUN_CC", "QMAKE_RUN_CC_IMP", "QMAKE_RUN_CXX", "QMAKE_RUN_CXX_IMP",
- "QMAKE_LINK_THREAD", "QMAKE_LINK", "QMAKE_AR_CMD", "QMAKE_LINK_SHLIB_CMD", 0
- };
- for (int i = 0; libtoolify[i]; i++) {
- ProStringList &l = project->values(libtoolify[i]);
- if(!l.isEmpty()) {
- QString libtool_flags, comp_flags;
- if (!strncmp(libtoolify[i], "QMAKE_LINK", 10) || !strcmp(libtoolify[i], "QMAKE_AR_CMD")) {
- libtool_flags += " --mode=link";
- if(project->isActiveConfig("staticlib")) {
- libtool_flags += " -static";
- } else {
- if(!project->isEmpty("QMAKE_LIB_FLAG")) {
- int maj = project->first("VER_MAJ").toInt();
- int min = project->first("VER_MIN").toInt();
- int pat = project->first("VER_PAT").toInt();
- comp_flags += " -version-info " + QString::number(10*maj + min) +
- ":" + QString::number(pat) + ":0";
- if (strcmp(libtoolify[i], "QMAKE_AR_CMD")) {
- QString rpath = Option::output_dir;
- if(!project->isEmpty("DESTDIR")) {
- rpath = project->first("DESTDIR").toQString();
- if(QDir::isRelativePath(rpath))
- rpath.prepend(Option::output_dir + Option::dir_sep);
- }
- comp_flags += " -rpath " + escapeFilePath(Option::fixPathToTargetOS(rpath, false));
- }
- }
- }
- if(project->isActiveConfig("plugin"))
- libtool_flags += " -module";
- } else {
- libtool_flags += " --mode=compile";
- }
- l.first().prepend("$(LIBTOOL)" + libtool_flags + " ");
- if(!comp_flags.isEmpty())
- l.first() += comp_flags;
- }
- }
- }
}
QStringList
-&UnixMakefileGenerator::findDependencies(const QString &file)
+&UnixMakefileGenerator::findDependencies(const QString &f)
{
- QStringList &ret = MakefileGenerator::findDependencies(file);
+ QStringList &ret = MakefileGenerator::findDependencies(f);
if (doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
+ ProString file = f;
QString header_prefix;
if(!project->isEmpty("PRECOMPILED_DIR"))
header_prefix = project->first("PRECOMPILED_DIR").toQString();
@@ -382,45 +338,33 @@ QStringList
QString header_suffix = project->isActiveConfig("clang_pch_style")
? project->first("QMAKE_PCH_OUTPUT_EXT").toQString() : "";
header_prefix += Option::dir_sep + project->first("QMAKE_PRECOMP_PREFIX");
- for(QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) {
- if(file.endsWith(*it)) {
- if(!project->isEmpty("QMAKE_CFLAGS_PRECOMPILE")) {
- QString precomp_c_h = header_prefix + "c" + header_suffix;
- if(!ret.contains(precomp_c_h))
- ret += precomp_c_h;
- }
- if(project->isActiveConfig("objective_c")) {
- if(!project->isEmpty("QMAKE_OBJCFLAGS_PRECOMPILE")) {
- QString precomp_objc_h = header_prefix + "objective-c" + header_suffix;
- if(!ret.contains(precomp_objc_h))
- ret += precomp_objc_h;
- }
- if(!project->isEmpty("QMAKE_OBJCXXFLAGS_PRECOMPILE")) {
- QString precomp_objcpp_h = header_prefix + "objective-c++" + header_suffix;
- if(!ret.contains(precomp_objcpp_h))
- ret += precomp_objcpp_h;
- }
- }
- break;
- }
- }
- for(QStringList::Iterator it = Option::cpp_ext.begin(); it != Option::cpp_ext.end(); ++it) {
- if(file.endsWith(*it)) {
- if(!project->isEmpty("QMAKE_CXXFLAGS_PRECOMPILE")) {
- QString precomp_cpp_h = header_prefix + "c++" + header_suffix;
- if(!ret.contains(precomp_cpp_h))
- ret += precomp_cpp_h;
- }
- if(project->isActiveConfig("objective_c")) {
- if(!project->isEmpty("QMAKE_OBJCXXFLAGS_PRECOMPILE")) {
- QString precomp_objcpp_h = header_prefix + "objective-c++" + header_suffix;
- if(!ret.contains(precomp_objcpp_h))
- ret += precomp_objcpp_h;
- }
- }
- break;
+
+ foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) {
+ if (project->isEmpty(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE")))
+ continue;
+
+ ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler));
+ if (language.isEmpty())
+ continue;
+
+ // Unfortunately we were not consistent about the C++ naming
+ ProString extensionSuffix = compiler;
+ if (extensionSuffix == "CXX")
+ extensionSuffix = ProString("CPP");
+
+ foreach (const ProString &extension, project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) {
+ if (!file.endsWith(extension.toQString()))
+ continue;
+
+ QString precompiledHeader = header_prefix + language + header_suffix;
+ if (!ret.contains(precompiledHeader))
+ ret += precompiledHeader;
+
+ goto foundPrecompiledDependency;
}
}
+ foundPrecompiledDependency:
+ ; // Hurray!!
}
}
return ret;
@@ -433,20 +377,19 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
}
bool
-UnixMakefileGenerator::findLibraries()
+UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
- ProString libArg = project->first("QMAKE_L_FLAG");
- if (libArg == "-L")
- libArg.clear();
- QList<QMakeLocalFileName> libdirs;
- int libidx = 0;
+ QList<QMakeLocalFileName> libdirs, frameworkdirs;
+ int libidx = 0, fwidx = 0;
foreach (const ProString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
libdirs.append(QMakeLocalFileName(dlib.toQString()));
+ frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks"));
+ frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
ProStringList &l = project->values(lflags[i]);
for (ProStringList::Iterator it = l.begin(); it != l.end(); ) {
- QString stub, dir, extn, opt = (*it).trimmed().toQString();
+ QString opt = (*it).toQString();
if(opt.startsWith("-")) {
if(opt.startsWith("-L")) {
QString lib = opt.mid(2);
@@ -457,173 +400,60 @@ UnixMakefileGenerator::findLibraries()
continue;
}
libdirs.insert(libidx++, f);
- if (!libArg.isEmpty())
- *it = libArg + f.real();
} else if(opt.startsWith("-l")) {
- if (project->isActiveConfig("rvct_linker") || project->isActiveConfig("armcc_linker")) {
- (*it) = "lib" + opt.mid(2) + ".so";
- } else if (project->isActiveConfig("ti_linker")) {
- (*it) = opt.mid(2);
- } else {
- stub = opt.mid(2);
- }
- } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
- if (opt.length() == 10)
- ++it;
- // Skip
- }
- } else {
- extn = dir = "";
- stub = opt;
- int slsh = opt.lastIndexOf(Option::dir_sep);
- if(slsh != -1) {
- dir = opt.left(slsh);
- stub = opt.mid(slsh+1);
- }
- QRegExp stub_reg("^.*lib(" + stub + "[^./=]*)\\.(.*)$");
- if(stub_reg.exactMatch(stub)) {
- stub = stub_reg.cap(1);
- extn = stub_reg.cap(2);
- }
- }
- if(!stub.isEmpty()) {
- stub += project->first(ProKey("QMAKE_" + stub.toUpper() + "_SUFFIX")).toQString();
- bool found = false;
- ProStringList extens;
- if(!extn.isNull())
- extens << extn;
- else
+ QString lib = opt.mid(2);
+ ProStringList extens;
extens << project->first("QMAKE_EXTENSION_SHLIB") << "a";
- for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
- if(dir.isNull()) {
- for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) {
- QString pathToLib = ((*dep_it).local() + '/'
- + project->first("QMAKE_PREFIX_SHLIB")
- + stub + "." + (*extit));
- if(exists(pathToLib)) {
- (*it) = "-l" + stub;
- found = true;
- break;
- }
- }
- } else {
- QString lib = dir + project->first("QMAKE_PREFIX_SHLIB") + stub + "." + (*extit);
- if (exists(lib)) {
- (*it) = lib;
- found = true;
- break;
- }
- }
- }
- if(!found && project->isActiveConfig("compile_libtool")) {
- for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
- if (exists(libdirs[dep_i].local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext)) {
- (*it) = libdirs[dep_i].real() + Option::dir_sep + project->first("QMAKE_PREFIX_SHLIB") + stub + Option::libtool_ext;
- found = true;
- break;
- }
- }
- }
- }
- ++it;
- }
- }
- return false;
-}
-
-QString linkLib(const QString &file, const QString &libName) {
- QString ret;
- QRegExp reg("^.*lib(" + QRegExp::escape(libName) + "[^./=]*).*$");
- if(reg.exactMatch(file))
- ret = "-l" + reg.cap(1);
- return ret;
-}
-
-void
-UnixMakefileGenerator::processPrlFiles()
-{
- const QString libArg = project->first("QMAKE_L_FLAG").toQString();
- QList<QMakeLocalFileName> libdirs, frameworkdirs;
- int libidx = 0, fwidx = 0;
- foreach (const ProString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
- libdirs.append(QMakeLocalFileName(dlib.toQString()));
- frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks"));
- frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));
- static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
- for (int i = 0; lflags[i]; i++) {
- ProStringList &l = project->values(lflags[i]);
- for(int lit = 0; lit < l.size(); ++lit) {
- QString opt = l.at(lit).trimmed().toQString();
- if(opt.startsWith("-")) {
- if (opt.startsWith(libArg)) {
- QMakeLocalFileName l(opt.mid(libArg.length()));
- if(!libdirs.contains(l))
- libdirs.insert(libidx++, l);
- } else if(opt.startsWith("-l")) {
- QString lib = opt.right(opt.length() - 2);
- QString prl_ext = project->first(ProKey("QMAKE_" + lib.toUpper() + "_SUFFIX")).toQString();
- for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
- const QMakeLocalFileName &lfn = libdirs[dep_i];
- if(!project->isActiveConfig("compile_libtool")) { //give them the .libs..
- QString la = lfn.local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + lib + Option::libtool_ext;
- if (exists(la) && QFile::exists(lfn.local() + "/.libs")) {
- QString dot_libs = lfn.real() + Option::dir_sep + ".libs";
- l.append("-L" + dot_libs);
- libdirs.insert(libidx++, QMakeLocalFileName(dot_libs));
- }
- }
-
- QString prl = lfn.local() + '/' + project->first("QMAKE_PREFIX_SHLIB") + lib + prl_ext;
- if(processPrlFile(prl)) {
- if(prl.startsWith(lfn.local()))
- prl.replace(0, lfn.local().length(), lfn.real());
- opt = linkLib(prl, lib);
- break;
+ for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin();
+ dep_it != libdirs.end(); ++dep_it) {
+ QString libBase = (*dep_it).local() + '/'
+ + project->first("QMAKE_PREFIX_SHLIB") + lib;
+ if (linkPrl && processPrlFile(libBase))
+ goto found;
+ for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
+ if (exists(libBase + '.' + (*extit)))
+ goto found;
}
}
+ found: ;
} else if (target_mode == TARG_MAC_MODE && opt.startsWith("-F")) {
- QMakeLocalFileName f(opt.right(opt.length()-2));
- if(!frameworkdirs.contains(f))
+ QMakeLocalFileName f(opt.mid(2));
+ if (!frameworkdirs.contains(f))
frameworkdirs.insert(fwidx++, f);
} else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
- if(opt.length() > 11)
- opt = opt.mid(11);
- else
- opt = l.at(++lit).toQString();
- opt = opt.trimmed();
- foreach (const QMakeLocalFileName &dir, frameworkdirs) {
- QString prl = dir.local() + "/" + opt + ".framework/" + opt + Option::prl_ext;
- if(processPrlFile(prl))
- break;
+ if (linkPrl) {
+ if (opt.length() == 10)
+ opt = (*++it).toQString();
+ else
+ opt = opt.mid(10).trimmed();
+ foreach (const QMakeLocalFileName &dir, frameworkdirs) {
+ QString prl = dir.local() + "/" + opt + ".framework/" + opt + Option::prl_ext;
+ if (processPrlFile(prl))
+ break;
+ }
+ } else {
+ if (opt.length() == 10)
+ ++it;
+ // Skip
}
}
- } else if(!opt.isNull()) {
- QString lib = opt;
- processPrlFile(lib);
-#if 0
- if(ret)
- opt = linkLib(lib, "");
-#endif
- if(!opt.isEmpty())
- for (int k = 0; k < l.size(); ++k)
- l[k] = l.at(k).toQString().replace(lib, opt);
+ } else if (linkPrl) {
+ processPrlFile(opt);
}
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
- if(!prl_libs.isEmpty()) {
- for(int prl = 0; prl < prl_libs.size(); ++prl)
- l.insert(++lit, prl_libs.at(prl));
- prl_libs.clear();
- }
+ for (int prl = 0; prl < prl_libs.size(); ++prl)
+ it = l.insert(++it, prl_libs.at(prl));
+ prl_libs.clear();
+ ++it;
}
- //merge them into a logical order
- if(!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) {
+ if (mergeLflags) {
QHash<ProKey, ProStringList> lflags;
for(int lit = 0; lit < l.size(); ++lit) {
ProKey arch("default");
- ProString opt = l.at(lit).trimmed();
- if(opt.startsWith("-")) {
+ ProString opt = l.at(lit);
+ if (opt.startsWith('-')) {
if (target_mode == TARG_MAC_MODE && opt.startsWith("-Xarch")) {
if (opt.length() > 7) {
arch = opt.mid(7).toKey();
@@ -631,36 +461,27 @@ UnixMakefileGenerator::processPrlFiles()
}
}
- if (opt.startsWith(libArg) ||
- (target_mode == TARG_MAC_MODE && opt.startsWith("-F"))) {
- if(!lflags[arch].contains(opt))
+ if (opt.startsWith("-L")
+ || (target_mode == TARG_MAC_MODE && opt.startsWith("-F"))) {
+ if (!lflags[arch].contains(opt))
lflags[arch].append(opt);
- } else if(opt.startsWith("-l") || opt == "-pthread") {
- // Make sure we keep the dependency-order of libraries
- if (lflags[arch].contains(opt))
- lflags[arch].removeAll(opt);
+ } else if (opt.startsWith("-l") || opt == "-pthread") {
+ // Make sure we keep the dependency order of libraries
+ lflags[arch].removeAll(opt);
lflags[arch].append(opt);
} else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
- if(opt.length() > 11)
- opt = opt.mid(11);
- else {
+ if (opt.length() > 10) {
+ opt = opt.mid(10).trimmed();
+ } else {
opt = l.at(++lit);
- if (target_mode == TARG_MAC_MODE && opt.startsWith("-Xarch"))
+ if (opt.startsWith("-Xarch"))
opt = l.at(++lit); // The user has done the right thing and prefixed each part
}
bool found = false;
for(int x = 0; x < lflags[arch].size(); ++x) {
- ProString xf = lflags[arch].at(x);
- if(xf.startsWith("-framework")) {
- ProString framework;
- if(xf.length() > 11)
- framework = xf.mid(11);
- else
- framework = lflags[arch].at(++x);
- if(framework == opt) {
- found = true;
- break;
- }
+ if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) {
+ found = true;
+ break;
}
}
if(!found) {
@@ -690,6 +511,7 @@ UnixMakefileGenerator::processPrlFiles()
}
}
}
+ return false;
}
QString
@@ -718,7 +540,6 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
} else if(project->first("TEMPLATE") == "app") {
target = "$(QMAKE_TARGET)";
} else if(project->first("TEMPLATE") == "lib") {
- if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) {
if (!project->isActiveConfig("staticlib")
&& !project->isActiveConfig("plugin")
&& !project->isActiveConfig("unversioned_libname")) {
@@ -728,7 +549,6 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
links << "$(TARGET0)";
}
}
- }
}
for(int i = 0; i < targets.size(); ++i) {
QString src = targets.at(i).toQString(),
@@ -741,16 +561,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
uninst.append("-$(DEL_FILE) " + dst);
}
- if (bundle == NoBundle && project->isActiveConfig("compile_libtool")) {
- QString src_targ = escapeFilePath(target);
- if(src_targ == "$(TARGET)")
- src_targ = "$(TARGETL)";
- QString dst_dir = fileFixify(targetdir, FileFixifyAbsolute);
- if(QDir::isRelativePath(dst_dir))
- dst_dir = Option::fixPathToTargetOS(Option::output_dir + Option::dir_sep + dst_dir);
- ret = "-$(LIBTOOL) --mode=install cp " + src_targ + ' ' + escapeFilePath(filePrefixRoot(root, dst_dir));
- uninst.append("-$(LIBTOOL) --mode=uninstall " + src_targ);
- } else {
+ {
QString src_targ = target;
if(!destdir.isEmpty())
src_targ = Option::fixPathToTargetOS(destdir + target, false);
@@ -868,7 +679,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
if(type == "prl" && project->isActiveConfig("create_prl") && !project->isActiveConfig("no_install_prl") &&
!project->isEmpty("QMAKE_INTERNAL_PRL_FILE"))
meta = prlFileName(false);
- if(type == "libtool" && project->isActiveConfig("create_libtool") && !project->isActiveConfig("compile_libtool"))
+ if (type == "libtool" && project->isActiveConfig("create_libtool"))
meta = libtoolFileName(false);
if(type == "pkgconfig" && project->isActiveConfig("create_pc"))
meta = pkgConfigFileName(false);
diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h
index b136ea04d0..db3f59f517 100644
--- a/qmake/generators/unix/unixmake.h
+++ b/qmake/generators/unix/unixmake.h
@@ -54,9 +54,8 @@ protected:
virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
virtual QString defaultInstall(const QString &);
virtual ProString fixLibFlag(const ProString &lib);
- virtual void processPrlFiles();
- virtual bool findLibraries();
+ virtual bool findLibraries(bool linkPrl, bool mergeLflags);
virtual QString escapeFilePath(const QString &path) const;
ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); }
virtual QStringList &findDependencies(const QString &);
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index e4973157cd..9db64bebee 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -53,13 +53,8 @@ UnixMakefileGenerator::writePrlFile(QTextStream &t)
{
MakefileGenerator::writePrlFile(t);
// libtool support
-
if(project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib") { //write .la
- if(project->isActiveConfig("compile_libtool"))
- warn_msg(WarnLogic, "create_libtool specified with compile_libtool can lead to conflicting .la\n"
- "formats, create_libtool has been disabled\n");
- else
- writeLibtoolFile();
+ writeLibtoolFile();
}
// pkg-config support
if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib")
@@ -214,8 +209,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "AR = " << var("QMAKE_AR") << endl;
t << "RANLIB = " << var("QMAKE_RANLIB") << endl;
- if(project->isActiveConfig("compile_libtool"))
- t << "LIBTOOL = " << var("QMAKE_LIBTOOL") << endl;
t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
t << "STRIP = " << var("QMAKE_STRIP") << endl;
@@ -269,13 +262,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
- // The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes
- // would be interpreted as line continuation. The lack of spacing between the value and the
- // comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
- // spacing.
- t << "DESTDIR = " << fileVar("DESTDIR") << "#avoid trailing-slash linebreak\n";
- if(project->isActiveConfig("compile_libtool"))
- t << "TARGETL = " << fileVar("TARGET_la") << endl;
+ QString destd = fileVar("DESTDIR");
+ // When building on non-MSys MinGW, the path ends with a backslash, which
+ // GNU make will interpret that as a line continuation. Doubling the backslash
+ // avoids the problem, at the cost of the variable containing *both* backslashes.
+ if (destd.endsWith('\\'))
+ destd += '\\';
+ t << "DESTDIR = " << destd << endl;
t << "TARGET = " << fileVar("TARGET") << endl; // ### mixed use!
if(project->isActiveConfig("plugin")) {
t << "TARGETD = " << fileVar("TARGET") << endl;
@@ -306,18 +299,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "include " << escapeDependencyPath(*it) << endl;
/* rules */
- t << "first: all\n";
- t << "####### Implicit rules\n\n";
- t << ".SUFFIXES: " << Option::obj_ext;
- for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
- t << " " << (*cit);
- for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
- t << " " << (*cppit);
- t << endl << endl;
- for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
- t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl;
- for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
- t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl;
+ t << "first:" << (!project->isActiveConfig("no_default_goal_deps") ? " all" : "") << "\n";
if(include_deps) {
if (project->isActiveConfig("gcc_MD_depends")) {
@@ -600,10 +582,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" << var("QMAKE_PRE_LINK");
- if(project->isActiveConfig("compile_libtool")) {
- t << "\n\t"
- << var("QMAKE_LINK_SHLIB_CMD");
- } else if(project->isActiveConfig("plugin")) {
+ if (project->isActiveConfig("plugin")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD");
@@ -703,15 +682,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< " $(OBJECTS) $(OBJCOMP) " << depVar("POST_TARGETDEPS") << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir, false) << "\n\t";
- t << "-$(DEL_FILE) $(TARGET)\n\t"
+ t << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t"
<< var("QMAKE_AR_CMD") << "\n";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
- t << "\t$(RANLIB) $(TARGET)\n";
- if(!destdir.isEmpty())
- t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)\n"
- << "\t-$(MOVE) $(TARGET) " << destdir << " \n";
+ t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
} else {
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt();
ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"),
@@ -723,14 +699,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++)
build << (*objit);
QString ar;
- ProString lib = escapeFilePath(*libit);
+ ProString lib = destdir + escapeFilePath(*libit);
if((*libit) == "$(TARGET)") {
t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS")
<< ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t";
ar = project->first("QMAKE_AR_CMD").toQString();
ar.replace("$(OBJECTS)", escapeFilePaths(build).join(' '));
} else {
- t << escapeDependencyPath(*libit) << ": " << valList(escapeDependencyPaths(build)) << "\n\t";
+ t << destdir_d << escapeDependencyPath(*libit) << ": "
+ << valList(escapeDependencyPaths(build)) << "\n\t";
ar = "$(AR) " + lib + ' ' + escapeFilePaths(build).join(' ');
}
if(!destdir.isEmpty())
@@ -741,9 +718,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << lib << "\n";
- if(!destdir.isEmpty())
- t << "\t-$(DEL_FILE) " << destdir << lib << "\n"
- << "\t-$(MOVE) " << lib << ' ' << destdir << " \n";
}
}
t << endl << endl;
@@ -752,8 +726,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
writeMakeQmake(t);
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isActiveConfig("no_autoqmake")) {
QStringList meta_files;
- if(project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib" &&
- !project->isActiveConfig("compile_libtool")) { //libtool
+ if (project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib") { //libtool
meta_files += libtoolFileName();
}
if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") { //pkg-config
@@ -807,11 +780,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} else {
info_plist = escapeFilePath(fileFixify(info_plist));
}
- bool isApp = (project->first("TEMPLATE") == "app");
- QString info_plist_out =
- bundle_dir + (isApp ? "Contents/Info.plist"
- : "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION")
- + "/Resources/Info.plist");
+ bool isFramework = project->first("TEMPLATE") == "lib" && project->isActiveConfig("lib_bundle");
+ QString info_plist_out = bundle_dir +
+ (isFramework ? ("Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/Resources/Info.plist")
+ : "Contents/Info.plist");
bundledFiles << info_plist_out;
alldeps << info_plist_out;
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
@@ -844,7 +816,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
bundleIdentifier.replace('_', '-');
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
- if (isApp) {
+ if (!isFramework) {
QString icon = fileFixify(var("ICON"));
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
@@ -852,6 +824,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
+ << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl;
@@ -988,10 +961,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "clean:" << clean_targets << "\n\t";
if(!project->isEmpty("OBJECTS")) {
- if(project->isActiveConfig("compile_libtool"))
- t << "-$(LIBTOOL) --mode=clean $(DEL_FILE) $(OBJECTS)\n\t";
- else
- t << "-$(DEL_FILE) $(OBJECTS)\n\t";
+ t << "-$(DEL_FILE) $(OBJECTS)\n\t";
}
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
ProStringList precomp_files;
@@ -1022,15 +992,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProString header_suffix = project->isActiveConfig("clang_pch_style")
? project->first("QMAKE_PCH_OUTPUT_EXT") : "";
- if(!project->isEmpty("QMAKE_CFLAGS_PRECOMPILE"))
- precomp_files += precomph_out_dir + header_prefix + "c" + header_suffix;
- if(!project->isEmpty("QMAKE_CXXFLAGS_PRECOMPILE"))
- precomp_files += precomph_out_dir + header_prefix + "c++" + header_suffix;
- if(project->isActiveConfig("objective_c")) {
- if(!project->isEmpty("QMAKE_OBJCFLAGS_PRECOMPILE"))
- precomp_files += precomph_out_dir + header_prefix + "objective-c" + header_suffix;
- if(!project->isEmpty("QMAKE_OBJCXXFLAGS_PRECOMPILE"))
- precomp_files += precomph_out_dir + header_prefix + "objective-c++" + header_suffix;
+ foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) {
+ if (project->isEmpty(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE")))
+ continue;
+ ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler));
+ if (language.isEmpty())
+ continue;
+
+ precomp_files += precomph_out_dir + header_prefix + language + header_suffix;
}
}
t << "-$(DEL_FILE) " << escapeFilePaths(precomp_files).join(' ') << "\n\t";
@@ -1048,8 +1017,6 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_BUNDLE")) {
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
- } else if(project->isActiveConfig("compile_libtool")) {
- t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) $(TARGET)\n";
} else if (project->isActiveConfig("staticlib") || project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n";
} else if (project->values("QMAKE_APP_FLAG").isEmpty()) {
@@ -1087,17 +1054,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
QString pchInput = project->first("PRECOMPILED_HEADER").toQString();
t << "###### Precompiled headers\n";
- QString comps[] = { "C", "CXX", "OBJC", "OBJCXX", QString() };
- for(int i = 0; !comps[i].isNull(); i++) {
- QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_PRECOMPILE"));
+ foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) {
+ QString pchFlags = var(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE"));
if(pchFlags.isEmpty())
continue;
QString cflags;
- if(comps[i] == "OBJC" || comps[i] == "OBJCXX")
+ if (compiler == "C" || compiler == "OBJC")
cflags += " $(CFLAGS)";
else
- cflags += " $(" + comps[i] + "FLAGS)";
+ cflags += " $(CXXFLAGS)";
ProString pchBaseName = project->first("QMAKE_ORIG_TARGET");
ProString pchOutput;
@@ -1125,21 +1091,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProString header_suffix = project->isActiveConfig("clang_pch_style")
? project->first("QMAKE_PCH_OUTPUT_EXT") : "";
pchOutput += Option::dir_sep;
- QString pchOutputDir = pchOutput.toQString(), pchOutputFile;
-
- if(comps[i] == "C") {
- pchOutputFile = "c";
- } else if(comps[i] == "CXX") {
- pchOutputFile = "c++";
- } else if(project->isActiveConfig("objective_c")) {
- if(comps[i] == "OBJC")
- pchOutputFile = "objective-c";
- else if(comps[i] == "OBJCXX")
- pchOutputFile = "objective-c++";
- }
- if(pchOutputFile.isEmpty())
+ QString pchOutputDir = pchOutput.toQString();
+
+ QString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler)).toQString();
+ if (language.isEmpty())
continue;
- pchOutput += header_prefix + pchOutputFile + header_suffix;
+
+ pchOutput += header_prefix + language + header_suffix;
t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' '
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
@@ -1149,14 +1107,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
.replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName.toQString()))
.replace("${QMAKE_PCH_OUTPUT}", escapeFilePath(pchOutput.toQString()));
- QString compiler;
- if(comps[i] == "C" || comps[i] == "OBJC" || comps[i] == "OBJCXX")
- compiler = "$(CC)";
+ QString compilerExecutable;
+ if (compiler == "C" || compiler == "OBJC")
+ compilerExecutable = "$(CC)";
else
- compiler = "$(CXX)";
+ compilerExecutable = "$(CXX)";
// compile command
- t << "\n\t" << compiler << cflags << " $(INCPATH) " << pchFlags << endl << endl;
+ t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchFlags << endl << endl;
}
}
@@ -1182,27 +1140,21 @@ void UnixMakefileGenerator::init2()
}
if(!project->isEmpty("TARGET"))
project->values("TARGET").first().prepend(project->first("DESTDIR"));
- if (!project->values("QMAKE_CYGWIN_EXE").isEmpty())
- project->values("TARGET_EXT").append(".exe");
} else if (project->isActiveConfig("staticlib")) {
project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB"));
project->values("TARGET").first() += "." + project->first("QMAKE_EXTENSION_STATICLIB");
if(project->values("QMAKE_AR_CMD").isEmpty())
- project->values("QMAKE_AR_CMD").append("$(AR) $(TARGET) $(OBJECTS)");
+ project->values("QMAKE_AR_CMD").append("$(AR) $(DESTDIR)$(TARGET) $(OBJECTS)");
} else {
project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB")
+ project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB"));
- if(project->isActiveConfig("compile_libtool"))
- project->values("TARGET_la") = ProStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext);
ProStringList &ar_cmd = project->values("QMAKE_AR_CMD");
if (!ar_cmd.isEmpty())
ar_cmd[0] = ar_cmd.at(0).toQString().replace("(TARGET)","(TARGETA)");
else
ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)");
- if(project->isActiveConfig("compile_libtool")) {
- project->values("TARGET") = project->values("TARGET_la");
- } else if(!project->isEmpty("QMAKE_BUNDLE")) {
+ if (!project->isEmpty("QMAKE_BUNDLE")) {
ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
@@ -1330,7 +1282,7 @@ void UnixMakefileGenerator::init2()
soname.prepend(instpath);
} else if (!project->isEmpty("QMAKE_SONAME_PREFIX")) {
QString sonameprefix = project->first("QMAKE_SONAME_PREFIX").toQString();
- if (!sonameprefix.startsWith('@') && !sonameprefix.startsWith('$'))
+ if (!sonameprefix.startsWith('@'))
sonameprefix = Option::fixPathToTargetOS(sonameprefix, false);
if (!sonameprefix.endsWith(Option::dir_sep))
sonameprefix += Option::dir_sep;
@@ -1356,7 +1308,7 @@ void UnixMakefileGenerator::init2()
project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_PLUGIN");
project->values("QMAKE_CXXFLAGS") += project->values("QMAKE_CXXFLAGS_PLUGIN");
project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_PLUGIN");
- if(project->isActiveConfig("plugin_with_soname") && !project->isActiveConfig("compile_libtool"))
+ if (project->isActiveConfig("plugin_with_soname"))
project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_SONAME");
} else {
project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_SHLIB");
@@ -1375,8 +1327,7 @@ void UnixMakefileGenerator::init2()
project->first("VER_MIN") + "." +
project->first("VER_PAT"));
}
- if(!project->isActiveConfig("compile_libtool"))
- project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_SONAME");
+ project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_SONAME");
}
}
diff --git a/qmake/generators/win32/cesdkhandler.cpp b/qmake/generators/win32/cesdkhandler.cpp
index cbee1d0dbd..f8235bae27 100644
--- a/qmake/generators/win32/cesdkhandler.cpp
+++ b/qmake/generators/win32/cesdkhandler.cpp
@@ -49,6 +49,7 @@ struct PropertyContainer
QString value;
QMap<QString, PropertyContainer> properties;
};
+Q_DECLARE_TYPEINFO(PropertyContainer, Q_MOVABLE_TYPE);
CeSdkInfo::CeSdkInfo() : m_major(0) , m_minor(0)
{
@@ -60,7 +61,7 @@ CeSdkHandler::CeSdkHandler()
struct ContainsPathKey
{
- bool operator()(const QString &val)
+ bool operator()(const QString &val) const
{
return !(val.endsWith(QStringLiteral("MSBuildToolsPath"))
|| val.endsWith(QStringLiteral("MSBuildToolsRoot")));
@@ -69,8 +70,8 @@ struct ContainsPathKey
struct ValueFromKey
{
- ValueFromKey(const QSettings *settings) : settings(settings){}
- QString operator()(const QString &key)
+ explicit ValueFromKey(const QSettings *settings) : settings(settings) {}
+ QString operator()(const QString &key) const
{
return settings->value(key).toString();
}
@@ -178,13 +179,14 @@ QStringList CeSdkHandler::filterMsBuildToolPaths(const QStringList &paths) const
{
QStringList result;
foreach (const QString &path, paths) {
- QDir dir(path);
+ QDir dirVC110(path);
if (path.endsWith(QStringLiteral("bin")))
- dir.cdUp();
- if (dir.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V110\\Platforms"))
- || dir.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V120\\Platforms"))) {
- result << dir.absolutePath();
- }
+ dirVC110.cdUp();
+ QDir dirVC120 = dirVC110;
+ if (dirVC110.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V110\\Platforms")))
+ result << dirVC110.absolutePath();
+ if (dirVC120.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V120\\Platforms")))
+ result << dirVC120.absolutePath();
}
return result;
}
@@ -286,6 +288,8 @@ void CeSdkHandler::retrieveWEC2013SDKs()
currentSdk.m_minor = currentProperty.properties.value(QLatin1String("OSMinor")).value.toInt();
retrieveEnvironment(currentProperty.properties.value(QLatin1String("MSBuild Files110")).value.split(';'),
filteredToolPaths, &currentSdk);
+ retrieveEnvironment(currentProperty.properties.value(QLatin1String("MSBuild Files120")).value.split(';'),
+ filteredToolPaths, &currentSdk);
if (!currentSdk.m_include.isEmpty())
m_list.append(currentSdk);
}
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index c19e17bc0e..97bfef88a4 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -33,7 +33,6 @@
#include "mingw_make.h"
#include "option.h"
-#include "meta.h"
#include <proitems.h>
@@ -56,11 +55,6 @@ QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const
return ret;
}
-QString MingwMakefileGenerator::getLibTarget()
-{
- return QString("lib" + project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".a");
-}
-
QString MingwMakefileGenerator::getManifestFileForRcFile() const
{
return project->first("QMAKE_MANIFEST").toQString();
@@ -68,48 +62,21 @@ QString MingwMakefileGenerator::getManifestFileForRcFile() const
ProString MingwMakefileGenerator::fixLibFlag(const ProString &lib)
{
- if (lib.startsWith("lib"))
- return QStringLiteral("-l") + escapeFilePath(lib.mid(3));
- return escapeFilePath(lib);
+ if (lib.startsWith("-l")) // Fallback for unresolved -l libs.
+ return QLatin1String("-l") + escapeFilePath(lib.mid(2));
+ if (lib.startsWith("-L")) // Lib search path. Needed only by -l above.
+ return QLatin1String("-L")
+ + escapeFilePath(Option::fixPathToTargetOS(lib.mid(2).toQString(), false));
+ if (lib.startsWith("lib")) // Fallback for unresolved MSVC-style libs.
+ return QLatin1String("-l") + escapeFilePath(lib.mid(3).toQString());
+ return escapeFilePath(Option::fixPathToTargetOS(lib.toQString(), false));
}
-bool MingwMakefileGenerator::findLibraries()
+MakefileGenerator::LibFlagType
+MingwMakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
{
- QList<QMakeLocalFileName> dirs;
- static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
- for (int i = 0; lflags[i]; i++) {
- ProStringList &l = project->values(lflags[i]);
- ProStringList::Iterator it = l.begin();
- while (it != l.end()) {
- if ((*it).startsWith("-l")) {
- QString steam = (*it).mid(2).toQString();
- ProString out;
- QString suffix = project->first(ProKey("QMAKE_" + steam.toUpper() + "_SUFFIX")).toQString();
- for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
- QString extension;
- int ver = findHighestVersion((*dir_it).local(), steam, "dll.a|a");
- if (ver > 0)
- extension += QString::number(ver);
- extension += suffix;
- if (QMakeMetaInfo::libExists((*dir_it).local() + '/' + steam)
- || exists((*dir_it).local() + '/' + steam + extension + ".a")
- || exists((*dir_it).local() + '/' + steam + extension + ".dll.a")) {
- out = *it + extension;
- break;
- }
- }
- if (!out.isEmpty()) // We assume if it never finds it that its correct
- (*it) = out;
- } else if ((*it).startsWith("-L")) {
- QMakeLocalFileName f((*it).mid(2).toQString());
- dirs.append(f);
- *it = "-L" + f.real();
- }
-
- ++it;
- }
- }
- return true;
+ // Skip MSVC handling from Win32MakefileGenerator
+ return MakefileGenerator::parseLibFlag(flag, arg);
}
bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
@@ -183,25 +150,6 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
}
}
-void createRvctObjectScriptFile(const QString &fileName, const ProStringList &objList)
-{
- QString filePath = Option::output_dir + QDir::separator() + fileName;
- QFile file(filePath);
- if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QTextStream t(&file);
- for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
- QString path = (*it).toQString();
- // ### quoting?
- if (QDir::isRelativePath(path))
- t << "./" << path << endl;
- else
- t << path << endl;
- }
- t.flush();
- file.close();
- }
-}
-
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);
@@ -239,8 +187,6 @@ void MingwMakefileGenerator::init()
project->values("TARGET_PRL").append(project->first("TARGET"));
- project->values("QMAKE_L_FLAG") << "-L";
-
processVars();
project->values("QMAKE_LIBS") += project->values("RES_FILE");
@@ -249,8 +195,7 @@ void MingwMakefileGenerator::init()
QString destDir = "";
if(!project->first("DESTDIR").isEmpty())
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
- project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET")
- + project->first("TARGET_VERSION_EXT") + ".a");
+ project->values("MINGW_IMPORT_LIB").prepend(destDir + project->first("LIB_TARGET"));
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + fileVar("MINGW_IMPORT_LIB"));
}
@@ -335,32 +280,19 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
ar_script_file += "." + var("BUILD_NAME");
}
// QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
- if (project->isActiveConfig("rvct_linker")) {
- createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS"));
- QString ar_cmd = project->values("QMAKE_LIB").join(' ');
- if (ar_cmd.isEmpty())
- ar_cmd = "armar --create";
- objectsLinkLine = ar_cmd + ' ' + fileVar("DEST_TARGET") + " --via " + escapeFilePath(ar_script_file);
- } else {
- // Strip off any options since the ar commands will be read from file.
- QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
- if (ar_cmd.isEmpty())
- ar_cmd = "ar";
- createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
- objectsLinkLine = ar_cmd + " -M < " + escapeFilePath(ar_script_file);
- }
+ // Strip off any options since the ar commands will be read from file.
+ QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);
+ if (ar_cmd.isEmpty())
+ ar_cmd = "ar";
+ createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
+ objectsLinkLine = ar_cmd + " -M < " + escapeFilePath(ar_script_file);
} else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
- if (project->isActiveConfig("rvct_linker")) {
- createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = QString::fromLatin1("--via ") + escapeFilePath(ld_script_file);
- } else {
- createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = escapeFilePath(ld_script_file);
- }
+ createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = escapeFilePath(ld_script_file);
}
Win32MakefileGenerator::writeObjectsPart(t);
}
@@ -405,9 +337,14 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
}
if (!rc_file.isEmpty()) {
+
+ ProString defines = varGlue("RC_DEFINES", " -D", " -D", "");
+ if (defines.isEmpty())
+ defines = ProString(" $(DEFINES)");
+
t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t"
<< var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE")
- << incPathStr << " $(DEFINES)\n\n";
+ << incPathStr << defines << "\n\n";
}
}
diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h
index e76391080c..4e94a23ae2 100644
--- a/qmake/generators/win32/mingw_make.h
+++ b/qmake/generators/win32/mingw_make.h
@@ -47,7 +47,6 @@ protected:
QString escapeDependencyPath(const QString &path) const;
ProString escapeDependencyPath(const ProString &path) const { return MakefileGenerator::escapeDependencyPath(path); }
virtual ProString fixLibFlag(const ProString &lib);
- QString getLibTarget();
virtual QString getManifestFileForRcFile() const;
bool writeMakefile(QTextStream &);
void init();
@@ -63,7 +62,7 @@ private:
QString preCompHeaderOut;
- virtual bool findLibraries();
+ virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg);
QString objectsLinkLine;
};
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index aad6e6e878..8e2be589cd 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -628,7 +628,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("Platform", tool.SingleProjects.at(i).PlatformName)
<< closetag();
isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT;
- isWinPhone = isWinPhone = tool.SingleProjects.at(i).Configuration.WinPhone;
+ isWinPhone = isWinPhone || tool.SingleProjects.at(i).Configuration.WinPhone;
}
xml << closetag()
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 7646198da1..d6753b4ed6 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -142,18 +142,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
const bool isPhone = project->isActiveConfig(QStringLiteral("winphone"));
#ifdef Q_OS_WIN
- QString regKeyPrefix;
-#if !defined(Q_OS_WIN64) && _WIN32_WINNT >= 0x0501
- BOOL isWow64;
- IsWow64Process(GetCurrentProcess(), &isWow64);
- if (!isWow64)
- regKeyPrefix = QStringLiteral("Software\\");
- else
-#endif
- regKeyPrefix = QStringLiteral("Software\\Wow6432Node\\");
-
- QString regKey = regKeyPrefix + QStringLiteral("Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir");
- const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey);
+ QString regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir");
+ const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY);
if (vcInstallDir.isEmpty()) {
fprintf(stderr, "Failed to find the Visual Studio installation directory.\n");
return false;
@@ -161,13 +151,13 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
QString windowsPath;
if (isPhone) {
- windowsPath = "Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v";
+ windowsPath = "Software\\Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v";
} else {
- windowsPath = "Microsoft\\Microsoft SDKs\\Windows\\v";
+ windowsPath = "Software\\Microsoft\\Microsoft SDKs\\Windows\\v";
}
- regKey = regKeyPrefix + windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder");
- const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey);
+ regKey = windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder");
+ const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY);
if (kitDir.isEmpty()) {
fprintf(stderr, "Failed to find the Windows Kit installation directory.\n");
return false;
@@ -203,6 +193,9 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
incDirs << crtInclude + QStringLiteral("/shared");
incDirs << crtInclude + QStringLiteral("/winrt");
+ incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/")
+ + crtVersion + QStringLiteral("/Include/WinRT");
+
libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch;
libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch;
@@ -266,11 +259,6 @@ void NmakeMakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &cal
Win32MakefileGenerator::writeSubMakeCall(t, callPrefix, makeArguments);
}
-QString NmakeMakefileGenerator::getPdbTarget()
-{
- return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb");
-}
-
QString NmakeMakefileGenerator::defaultInstall(const QString &t)
{
if((t != "target" && t != "dlltarget") ||
@@ -288,7 +276,7 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
if (project->isActiveConfig("debug_info")) {
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
- QString pdb_target = getPdbTarget();
+ QString pdb_target = project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb";
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
if(!ret.isEmpty())
@@ -373,8 +361,6 @@ void NmakeMakefileGenerator::init()
return;
}
- project->values("QMAKE_L_FLAG") << "/LIBPATH:";
-
processVars();
project->values("QMAKE_LIBS") += project->values("RES_FILE");
@@ -419,21 +405,22 @@ void NmakeMakefileGenerator::init()
project->values("PRECOMPILED_PCH") = ProStringList(precompPch);
}
- ProString version = project->first("TARGET_VERSION_EXT");
+ ProString tgt = project->first("DESTDIR")
+ + project->first("TARGET") + project->first("TARGET_VERSION_EXT");
if(project->isActiveConfig("shared")) {
- project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".exp");
- project->values("QMAKE_DISTCLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".lib");
+ project->values("QMAKE_CLEAN").append(tgt + ".exp");
+ project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
}
if (project->isActiveConfig("debug_info")) {
- QString pdbfile = project->first("DESTDIR") + project->first("TARGET") + version + ".pdb";
+ QString pdbfile = tgt + ".pdb";
QString escapedPdbFile = escapeFilePath(pdbfile);
project->values("QMAKE_CFLAGS").append("/Fd" + escapedPdbFile);
project->values("QMAKE_CXXFLAGS").append("/Fd" + escapedPdbFile);
project->values("QMAKE_DISTCLEAN").append(pdbfile);
}
if (project->isActiveConfig("debug")) {
- project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".ilk");
- project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".idb");
+ project->values("QMAKE_CLEAN").append(tgt + ".ilk");
+ project->values("QMAKE_CLEAN").append(tgt + ".idb");
} else {
ProStringList &defines = project->values("DEFINES");
if (!defines.contains("NDEBUG"))
@@ -454,6 +441,8 @@ QStringList NmakeMakefileGenerator::sourceFilesForImplicitRulesFilter()
void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
{
+ t << "####### Implicit rules\n\n";
+
t << ".SUFFIXES:";
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
t << " " << (*cit);
diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h
index 83ce96c8b7..df72ef394c 100644
--- a/qmake/generators/win32/msvc_nmake.h
+++ b/qmake/generators/win32/msvc_nmake.h
@@ -52,7 +52,6 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator
protected:
virtual void writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments);
- virtual QString getPdbTarget();
virtual QString defaultInstall(const QString &t);
virtual QStringList &findDependencies(const QString &file);
QString var(const ProKey &value) const;
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 1e522cc8ee..f26dbbc40b 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2196,7 +2196,7 @@ void VCFilter::modifyPCHstage(QString str)
break;
}
}
- bool isHFile = Option::hasFileExtension(str, Option::h_ext) && (str == Project->precompH);
+ const bool isHFile = (str == Project->precompH);
bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP);
if(!isCFile && !isHFile && !isCPPFile)
@@ -2399,11 +2399,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
if (!CustomBuildTool.Description.isEmpty())
CustomBuildTool.Description += ", ";
CustomBuildTool.Description += cmd_name;
- // Execute custom build steps in an environment variable scope to prevent unwanted
- // side effects for downstream build steps
- CustomBuildTool.CommandLine += QLatin1String("setlocal");
CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed());
- CustomBuildTool.CommandLine += QLatin1String("endlocal");
int space = cmd.indexOf(' ');
QFileInfo finf(cmd.left(space));
if (CustomBuildTool.ToolPath.isEmpty())
@@ -2414,7 +2410,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
// Make sure that all deps are only once
QStringList uniqDeps;
for (int c = 0; c < deps.count(); ++c) {
- QString aDep = deps.at(c).trimmed();
+ QString aDep = deps.at(c);
if (!aDep.isEmpty())
uniqDeps << aDep;
}
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 895bfbaf0d..465c8fc312 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -70,21 +70,6 @@ struct DotNetCombo {
const char *versionStr;
const char *regKey;
} dotNetCombo[] = {
-#ifdef Q_OS_WIN64
- {NET2015, "MSVC.NET 2015 (14.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir"},
- {NET2013, "MSVC.NET 2013 (12.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
- {NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
- {NET2012, "MSVC.NET 2012 (11.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"},
- {NET2012, "MSVC.NET 2012 Express Edition (11.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir"},
- {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"},
- {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"},
- {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"},
- {NET2008, "MSVC.NET 2008 Express Edition (9.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir"},
- {NET2005, "MSVC.NET 2005 (8.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"},
- {NET2005, "MSVC.NET 2005 Express Edition (8.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir"},
- {NET2003, "MSVC.NET 2003 (7.1)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir"},
- {NET2002, "MSVC.NET 2002 (7.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"},
-#else
{NET2015, "MSVC.NET 2015 (14.0)", "Software\\Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
@@ -98,7 +83,6 @@ struct DotNetCombo {
{NET2005, "MSVC.NET 2005 Express Edition (8.0)", "Software\\Microsoft\\VCExpress\\8.0\\Setup\\VC\\ProductDir"},
{NET2003, "MSVC.NET 2003 (7.1)", "Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir"},
{NET2002, "MSVC.NET 2002 (7.0)", "Software\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"},
-#endif
{NETUnknown, "", ""},
};
@@ -125,7 +109,8 @@ DotNET which_dotnet_version(const QByteArray &preferredVersion = QByteArray())
int installed = 0;
int i = 0;
for(; dotNetCombo[i].version; ++i) {
- QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey);
+ QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey,
+ KEY_WOW64_32KEY);
if (!path.isEmpty() && installPaths.value(dotNetCombo[i].version) != path) {
lowestInstalledVersion = &dotNetCombo[i];
installPaths.insert(lowestInstalledVersion->version, path);
@@ -520,7 +505,6 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
ProStringList tmpList;
tmpList += subdir.second;
tmpList += allDependencies;
- QPair<QString, ProStringList> val = qMakePair(fi.absoluteFilePath(), tmpList);
// Initialize a 'fake' project to get the correct variables
// and to be able to extract all the dependencies
Option::QMAKE_MODE old_mode = Option::qmake_mode;
@@ -532,31 +516,13 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION");
- QString vcprojDir = qmake_getpwd();
+ QString vcprojDir = Option::output_dir;
// If file doesn't exsist, then maybe the users configuration
// doesn't allow it to be created. Skip to next...
if (!exists(vcprojDir + Option::dir_sep + vcproj)) {
- // Try to find the directory which fits relative
- // to the output path, which represents the shadow
- // path in case we are shadow building
- QStringList list = fi.path().split(QLatin1Char('/'));
- QString tmpDir = QFileInfo(Option::output).path() + Option::dir_sep;
- bool found = false;
- for (int i = list.size() - 1; i >= 0; --i) {
- QString curr;
- for (int j = i; j < list.size(); ++j)
- curr += list.at(j) + Option::dir_sep;
- if (exists(tmpDir + curr + vcproj)) {
- vcprojDir = QDir::cleanPath(tmpDir + curr);
- found = true;
- break;
- }
- }
- if (!found) {
- warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData());
- goto nextfile; // # Dirty!
- }
+ warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData());
+ goto nextfile; // # Dirty!
}
VcsolutionDepend *newDep = new VcsolutionDepend;
@@ -570,8 +536,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
projGuids.insert(newDep->orig_target, newDep->target);
- if (val.second.size()) {
- const ProStringList depends = val.second;
+ if (tmpList.size()) {
+ const ProStringList depends = tmpList;
foreach (const ProString &dep, depends) {
QString depend = dep.toQString();
if (!projGuids[depend].isEmpty()) {
@@ -583,8 +549,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
newDep->dependencies << projGuids[projLookup[tmpDep]];
}
} else {
- QStringList dependencies = val.second.toQStringList();
- extraSubdirs.insert(newDep, dependencies);
+ extraSubdirs.insert(newDep, tmpList.toQStringList());
newDep->dependencies.clear();
break;
}
@@ -603,7 +568,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
wit != where.end(); ++wit) {
const ProStringList &l = tmp_proj.values(ProKey(*wit));
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- QString opt = (*it).toQString();
+ const QString opt = fixLibFlag(*it).toQString();
if (!opt.startsWith("/") && // Not a switch
opt != newDep->target && // Not self
opt != "opengl32.lib" && // We don't care about these libs
@@ -810,8 +775,6 @@ void VcprojGenerator::init()
else if (project->first("TEMPLATE") == "vclib")
project->values("QMAKE_LIB_FLAG").append("1");
- project->values("QMAKE_L_FLAG") << "/LIBPATH:";
-
processVars();
// set /VERSION for EXE/DLL header
@@ -1209,12 +1172,13 @@ void VcprojGenerator::initLinkerTool()
if (!project->values("DEF_FILE").isEmpty())
conf.linker.ModuleDefinitionFile = project->first("DEF_FILE").toQString();
- foreach (const ProString &libs, project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE")) {
- if (libs.left(9).toQString().toUpper() == "/LIBPATH:") {
- ProStringList l = ProStringList(libs);
- conf.linker.parseOptions(l);
- } else {
- conf.linker.AdditionalDependencies << escapeFilePath(libs.toQString());
+ static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
+ for (int i = 0; lflags[i]; i++) {
+ foreach (const ProString &lib, fixLibFlags(lflags[i])) {
+ if (lib.startsWith("/LIBPATH:"))
+ conf.linker.AdditionalLibraryDirectories << lib.mid(9).toQString();
+ else
+ conf.linker.AdditionalDependencies << lib.toQString();
}
}
@@ -1225,7 +1189,12 @@ void VcprojGenerator::initLinkerTool()
void VcprojGenerator::initResourceTool()
{
VCConfiguration &conf = vcProject.Configuration;
- conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions;
+
+ ProStringList rcDefines = project->values("RC_DEFINES");
+ if (rcDefines.size() > 0)
+ conf.resource.PreprocessorDefinitions = rcDefines.toQStringList();
+ else
+ conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions;
foreach (const ProString &path, project->values("RC_INCLUDEPATH")) {
QString fixedPath = fileFixify(path.toQString());
@@ -1382,8 +1351,7 @@ void VcprojGenerator::initDeploymentTool()
}
}
- // foreach item in DEPLOYMENT
- foreach (const ProString &item, project->values("DEPLOYMENT")) {
+ foreach (const ProString &item, project->values("INSTALLS")) {
// get item.path
QString devicePath = project->first(ProKey(item + ".path")).toQString();
if (!conf.WinRT) {
@@ -1460,11 +1428,11 @@ void VcprojGenerator::initWinDeployQtTool()
// itself contains the original subdirectories as parameters and hence the
// call fails.
// Neither there is a way to disable this behavior for Windows Phone, nor
- // to influence the parameters. Hence the only way to get a release build
+ // to influence the parameters. Hence the only way to get a build
// done is to recreate the directory structure manually by invoking
// windeployqt a second time, so that the MDILXapCompile call succeeds and
// deployment continues.
- if (conf.WinPhone && conf.Name == QStringLiteral("Release|ARM")) {
+ if (conf.WinPhone) {
conf.windeployqt.CommandLine = commandLine
+ QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\\")
+ var("OBJECTS_DIR")
diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h
index 35dc1e8937..50125a30a6 100644
--- a/qmake/generators/win32/msvc_vcproj.h
+++ b/qmake/generators/win32/msvc_vcproj.h
@@ -75,7 +75,6 @@ public:
protected:
virtual VCProjectWriter *createProjectWriter();
virtual bool doDepends() const { return false; } //never necesary
- virtual void processSources() { filterIncludedFiles("SOURCES"); filterIncludedFiles("GENERATED_SOURCES"); }
using Win32MakefileGenerator::replaceExtraCompilerVariables;
virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor);
virtual bool supportsMetaBuild() { return true; }
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 386e2865fa..1fba7057ab 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -49,215 +49,125 @@ Win32MakefileGenerator::Win32MakefileGenerator() : MakefileGenerator()
{
}
-int
-Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem, const QString &ext)
+ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
{
- QString bd = Option::normalizePath(d);
- if(!exists(bd))
- return -1;
-
- QMakeMetaInfo libinfo(project);
- bool libInfoRead = libinfo.readLib(bd + '/' + stem);
-
- // If the library, for which we're trying to find the highest version
- // number, is a static library
- if (libInfoRead && libinfo.values("QMAKE_PRL_CONFIG").contains("staticlib"))
- return -1;
-
- const ProStringList &vover = project->values(ProKey("QMAKE_" + stem.toUpper() + "_VERSION_OVERRIDE"));
- if (!vover.isEmpty())
- return vover.first().toInt();
-
- int biggest=-1;
- if (project->isActiveConfig("link_highest_lib_version")) {
- static QHash<QString, QStringList> dirEntryListCache;
- QStringList entries = dirEntryListCache.value(bd);
- if (entries.isEmpty()) {
- QDir dir(bd);
- entries = dir.entryList();
- dirEntryListCache.insert(bd, entries);
- }
-
- QRegExp regx(QString("((lib)?%1([0-9]*)).(%2|prl)$").arg(stem).arg(ext), Qt::CaseInsensitive);
- for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
- if(regx.exactMatch((*it))) {
- if (!regx.cap(3).isEmpty()) {
- bool ok = true;
- int num = regx.cap(3).toInt(&ok);
- biggest = qMax(biggest, (!ok ? -1 : num));
- }
- }
- }
- }
- if(libInfoRead
- && !libinfo.values("QMAKE_PRL_CONFIG").contains("staticlib")
- && !libinfo.isEmpty("QMAKE_PRL_VERSION"))
- biggest = qMax(biggest, libinfo.first("QMAKE_PRL_VERSION").toQString().replace(".", "").toInt());
- return biggest;
+ if (lib.startsWith("-l")) // Fallback for unresolved -l libs.
+ return escapeFilePath(lib.mid(2) + QLatin1String(".lib"));
+ if (lib.startsWith("-L")) // Lib search path. Needed only by -l above.
+ return QLatin1String("/LIBPATH:")
+ + escapeFilePath(Option::fixPathToTargetOS(lib.mid(2).toQString(), false));
+ return escapeFilePath(Option::fixPathToTargetOS(lib.toQString(), false));
}
-ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
+MakefileGenerator::LibFlagType
+Win32MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
{
- if (lib.startsWith('/')) {
- if (lib.startsWith("/LIBPATH:"))
- return QLatin1String("/LIBPATH:")
- + escapeFilePath(Option::fixPathToTargetOS(lib.mid(9).toQString(), false));
- // This appears to be a user-supplied flag. Assume sufficient quoting.
- return lib;
+ LibFlagType ret = MakefileGenerator::parseLibFlag(flag, arg);
+ if (ret != LibFlagFile)
+ return ret;
+ // MSVC compatibility. This should be deprecated.
+ if (flag.startsWith("/LIBPATH:")) {
+ *arg = flag.mid(9);
+ return LibFlagPath;
}
- // This must be a fully resolved library path.
- return escapeFilePath(Option::fixPathToTargetOS(lib.toQString(), false));
+ // These are pure qmake inventions. They *really* should be deprecated.
+ if (flag.startsWith("/L")) {
+ *arg = flag.mid(2);
+ return LibFlagPath;
+ }
+ if (flag.startsWith("/l")) {
+ *arg = flag.mid(2);
+ return LibFlagLib;
+ }
+ return LibFlagFile;
}
bool
-Win32MakefileGenerator::findLibraries()
+Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
+ ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
+ if (impexts.isEmpty())
+ impexts = project->values("QMAKE_EXTENSION_STATICLIB");
QList<QMakeLocalFileName> dirs;
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
ProStringList &l = project->values(lflags[i]);
for (ProStringList::Iterator it = l.begin(); it != l.end();) {
- bool remove = false;
- QString opt = (*it).trimmed().toQString();
- if(opt.startsWith("/LIBPATH:")) {
- QString libpath = opt.mid(9);
- QMakeLocalFileName l(libpath);
- if (!dirs.contains(l)) {
- dirs.append(l);
- (*it) = "/LIBPATH:" + l.real();
- } else {
- remove = true;
- }
- } else if(opt.startsWith("-L") || opt.startsWith("/L")) {
- QString libpath = Option::fixPathToTargetOS(opt.mid(2), false, false);
- QMakeLocalFileName l(libpath);
- if(!dirs.contains(l)) {
- dirs.append(l);
- (*it) = "/LIBPATH:" + l.real();
- } else {
- remove = true;
+ const ProString &opt = *it;
+ ProString arg;
+ LibFlagType type = parseLibFlag(opt, &arg);
+ if (type == LibFlagPath) {
+ QMakeLocalFileName lp(arg.toQString());
+ if (dirs.contains(lp)) {
+ it = l.erase(it);
+ continue;
}
- } else if(opt.startsWith("-l") || opt.startsWith("/l")) {
- QString lib = opt.right(opt.length() - 2), out;
- if(!lib.isEmpty()) {
- ProString suffix = project->first(ProKey("QMAKE_" + lib.toUpper() + "_SUFFIX"));
- for(QList<QMakeLocalFileName>::Iterator it = dirs.begin();
- it != dirs.end(); ++it) {
- QString extension;
- int ver = findHighestVersion((*it).local(), lib);
- if(ver > 0)
- extension += QString::number(ver);
- extension += suffix;
- extension += ".lib";
- if (QMakeMetaInfo::libExists((*it).local() + '/' + lib)
- || exists((*it).local() + '/' + lib + extension)) {
- out = (*it).real() + Option::dir_sep + lib + extension;
- break;
+ dirs.append(lp);
+ (*it) = "-L" + lp.real();
+ } else if (type == LibFlagLib) {
+ QString lib = arg.toQString();
+ ProString verovr =
+ project->first(ProKey("QMAKE_" + lib.toUpper() + "_VERSION_OVERRIDE"));
+ for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
+ dir_it != dirs.end(); ++dir_it) {
+ QString cand = (*dir_it).real() + Option::dir_sep + lib;
+ if (linkPrl && processPrlFile(cand)) {
+ (*it) = cand;
+ goto found;
+ }
+ QString libBase = (*dir_it).local() + '/' + lib + verovr;
+ for (ProStringList::ConstIterator extit = impexts.begin();
+ extit != impexts.end(); ++extit) {
+ if (exists(libBase + '.' + *extit)) {
+ (*it) = cand + verovr + '.' + *extit;
+ goto found;
}
}
}
- if(out.isEmpty())
- out = lib + ".lib";
- (*it) = out;
- } else if (!exists(Option::normalizePath(opt))) {
- QList<QMakeLocalFileName> lib_dirs;
- QString file = Option::fixPathToTargetOS(opt);
- int slsh = file.lastIndexOf(Option::dir_sep);
- if(slsh != -1) {
- lib_dirs.append(QMakeLocalFileName(file.left(slsh+1)));
- file = file.right(file.length() - slsh - 1);
+ // We assume if it never finds it that it's correct
+ found: ;
+ } else if (linkPrl && type == LibFlagFile) {
+ QString lib = opt.toQString();
+ if (fileInfo(lib).isAbsolute()) {
+ if (processPrlFile(lib))
+ (*it) = lib;
} else {
- lib_dirs = dirs;
- }
- if(file.endsWith(".lib")) {
- file = file.left(file.length() - 4);
- if(!file.at(file.length()-1).isNumber()) {
- ProString suffix = project->first(ProKey("QMAKE_" + file.toUpper() + "_SUFFIX"));
- for(QList<QMakeLocalFileName>::Iterator dep_it = lib_dirs.begin(); dep_it != lib_dirs.end(); ++dep_it) {
- QString lib_tmpl(file + "%1" + suffix + ".lib");
- int ver = findHighestVersion((*dep_it).local(), file);
- if(ver != -1) {
- if(ver)
- lib_tmpl = lib_tmpl.arg(ver);
- else
- lib_tmpl = lib_tmpl.arg("");
- if(slsh != -1) {
- QString dir = (*dep_it).real();
- if(!dir.endsWith(Option::dir_sep))
- dir += Option::dir_sep;
- lib_tmpl.prepend(dir);
- }
- (*it) = lib_tmpl;
- break;
- }
+ for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
+ dir_it != dirs.end(); ++dir_it) {
+ QString cand = (*dir_it).real() + Option::dir_sep + lib;
+ if (processPrlFile(cand)) {
+ (*it) = cand;
+ break;
}
}
}
}
- if(remove) {
- it = l.erase(it);
- } else {
- ++it;
- }
- }
- }
- return true;
-}
-void
-Win32MakefileGenerator::processPrlFiles()
-{
- const QString libArg = project->first("QMAKE_L_FLAG").toQString();
- QList<QMakeLocalFileName> libdirs;
- static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
- for (int i = 0; lflags[i]; i++) {
- ProStringList &l = project->values(lflags[i]);
+ ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
+ for (int prl = 0; prl < prl_libs.size(); ++prl)
+ it = l.insert(++it, prl_libs.at(prl));
+ prl_libs.clear();
+ ++it;
+ }
+ if (mergeLflags) {
+ ProStringList lopts;
for (int lit = 0; lit < l.size(); ++lit) {
- QString opt = l.at(lit).trimmed().toQString();
- if (opt.startsWith(libArg)) {
- QMakeLocalFileName l(opt.mid(libArg.length()));
- if (!libdirs.contains(l))
- libdirs.append(l);
- } else if (!opt.startsWith("/")) {
- if (!processPrlFile(opt) && (QDir::isRelativePath(opt) || opt.startsWith("-l"))) {
- QString tmp;
- if (opt.startsWith("-l"))
- tmp = opt.mid(2);
- else
- tmp = opt;
- for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
- QString prl = (*it).local() + '/' + tmp;
- if (processPrlFile(prl))
- break;
- }
- }
- }
- ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
- for (int prl = 0; prl < prl_libs.size(); ++prl)
- l.insert(++lit, prl_libs.at(prl));
- prl_libs.clear();
- }
-
- // Merge them into a logical order
- if (!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) {
- ProStringList lflags;
- for (int lit = 0; lit < l.size(); ++lit) {
- ProString opt = l.at(lit).trimmed();
- if (opt.startsWith(libArg)) {
- if (!lflags.contains(opt))
- lflags.append(opt);
- } else {
- // Make sure we keep the dependency-order of libraries
- lflags.removeAll(opt);
- lflags.append(opt);
- }
+ ProString opt = l.at(lit);
+ if (opt.startsWith(QLatin1String("-L"))) {
+ if (!lopts.contains(opt))
+ lopts.append(opt);
+ } else {
+ // Make sure we keep the dependency order of libraries
+ lopts.removeAll(opt);
+ lopts.append(opt);
}
- l = lflags;
}
+ l = lopts;
}
+ }
+ return true;
}
-
void Win32MakefileGenerator::processVars()
{
project->values("QMAKE_ORIG_TARGET") = project->values("TARGET");
@@ -286,7 +196,6 @@ void Win32MakefileGenerator::processVars()
fixTargetExt();
processRcFileVar();
- ProString libArg = project->first("QMAKE_L_FLAG");
ProStringList libs;
ProStringList &libDir = project->values("QMAKE_LIBDIR");
for (ProStringList::Iterator libDir_it = libDir.begin(); libDir_it != libDir.end(); ++libDir_it) {
@@ -294,7 +203,7 @@ void Win32MakefileGenerator::processVars()
if (!lib.isEmpty()) {
if (lib.endsWith('\\'))
lib.chop(1);
- libs << libArg + Option::fixPathToTargetOS(lib, false, false);
+ libs << QLatin1String("-L") + lib;
}
}
project->values("QMAKE_LIBS") += libs + project->values("LIBS");
@@ -321,20 +230,19 @@ void Win32MakefileGenerator::processVars()
void Win32MakefileGenerator::fixTargetExt()
{
- if (project->isEmpty("QMAKE_EXTENSION_STATICLIB"))
- project->values("QMAKE_EXTENSION_STATICLIB").append("lib");
- if (project->isEmpty("QMAKE_EXTENSION_SHLIB"))
- project->values("QMAKE_EXTENSION_SHLIB").append("dll");
-
if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
project->values("TARGET_EXT").append(".exe");
} else if (project->isActiveConfig("shared")) {
+ project->values("LIB_TARGET").prepend(project->first("QMAKE_PREFIX_STATICLIB")
+ + project->first("TARGET") + project->first("TARGET_VERSION_EXT")
+ + '.' + project->first("QMAKE_EXTENSION_STATICLIB"));
project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + "."
+ project->first("QMAKE_EXTENSION_SHLIB"));
project->values("TARGET").first() = project->first("QMAKE_PREFIX_SHLIB") + project->first("TARGET");
} else {
project->values("TARGET_EXT").append("." + project->first("QMAKE_EXTENSION_STATICLIB"));
project->values("TARGET").first() = project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET");
+ project->values("LIB_TARGET").prepend(project->first("TARGET") + project->first("TARGET_EXT")); // for the .prl only
}
}
@@ -662,7 +570,6 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << endl;
t << endl;
- t << "####### Implicit rules\n\n";
writeImplicitRulesPart(t);
t << "####### Build rules\n\n";
@@ -734,16 +641,6 @@ void Win32MakefileGenerator::writeObjectsPart(QTextStream &t)
void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &t)
{
- t << ".SUFFIXES:";
- for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
- t << " " << (*cppit);
- for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
- t << " " << (*cit);
- t << endl << endl;
- for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
- t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl;
- for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
- t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl;
}
void Win32MakefileGenerator::writeBuildRulesPart(QTextStream &)
@@ -755,10 +652,6 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
if(!project->values("RC_FILE").isEmpty()) {
const ProString res_file = project->first("RES_FILE");
const QString rc_file = fileFixify(project->first("RC_FILE").toQString());
- // The resource tool needs to have the same defines passed in as the compiler, since you may
- // use these defines in the .rc file itself. Also, we need to add the _DEBUG define manually
- // since the compiler defines this symbol by itself, and we use it in the automatically
- // created rc file when VERSION is define the .pro file.
const ProStringList rcIncPaths = project->values("RC_INCLUDEPATH");
QString incPathStr;
@@ -770,19 +663,25 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
incPathStr += escapeFilePath(path);
}
+ // The resource tool may use defines. This might be the same defines passed in as the
+ // compiler, since you may use these defines in the .rc file itself.
+ // As the escape syntax for the command line defines for RC is different from that for CL,
+ // we might have to set specific defines for RC.
+ ProString defines = varGlue("RC_DEFINES", " -D", " -D", "");
+ if (defines.isEmpty())
+ defines = ProString(" $(DEFINES)");
+
+ // Also, we need to add the _DEBUG define manually since the compiler defines this symbol
+ // by itself, and we use it in the automatically created rc file when VERSION is defined
+ // in the .pro file.
t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t"
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
- << " $(DEFINES)" << incPathStr << " -fo " << escapeFilePath(res_file)
+ << defines << incPathStr << " -fo " << escapeFilePath(res_file)
<< ' ' << escapeFilePath(rc_file);
t << endl << endl;
}
}
-QString Win32MakefileGenerator::getLibTarget()
-{
- return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".lib");
-}
-
QString Win32MakefileGenerator::defaultInstall(const QString &t)
{
if((t != "target" && t != "dlltarget") ||
@@ -829,7 +728,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
}
if(project->isActiveConfig("shared") && !project->isActiveConfig("plugin")) {
- QString lib_target = getLibTarget();
+ ProString lib_target = project->first("LIB_TARGET");
QString src_targ = escapeFilePath(
(project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR"))
+ lib_target);
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index ea763c3175..54c4d3be53 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -57,16 +57,14 @@ protected:
virtual void writeRcFilePart(QTextStream &t);
- int findHighestVersion(const QString &dir, const QString &stem, const QString &ext = QLatin1String("lib"));
- virtual bool findLibraries();
+ virtual bool findLibraries(bool linkPrl, bool mergeLflags);
+ virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg);
virtual ProString fixLibFlag(const ProString &lib);
- virtual void processPrlFiles();
void processVars();
void fixTargetExt();
void processRcFileVar();
- virtual QString getLibTarget();
static QString cQuoted(const QString &str);
virtual QString getManifestFileForRcFile() const;
};
diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp
index 04be215246..a2f3e8ec3d 100644
--- a/qmake/library/ioutils.cpp
+++ b/qmake/library/ioutils.cpp
@@ -68,6 +68,10 @@ bool IoUtils::isRelativePath(const QString &path)
{
if (path.startsWith(QLatin1Char('/')))
return false;
+#ifdef QMAKE_BUILTIN_PRFS
+ if (path.startsWith(QLatin1String(":/")))
+ return false;
+#endif
#ifdef Q_OS_WIN
if (path.startsWith(QLatin1Char('\\')))
return false;
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index a610da6b69..5fb70df3b1 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -212,11 +212,7 @@ ProString &ProString::prepend(const ProString &other)
ProString &ProString::append(const QLatin1String other)
{
const char *latin1 = other.latin1();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
int size = other.size();
-#else
- int size = strlen(latin1);
-#endif
if (size) {
QChar *ptr = prepareExtend(size, 0, m_length);
for (int i = 0; i < size; i++)
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index 9430d28521..e4ef1d1586 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -342,6 +342,7 @@ public:
const QString &items() const { return m_proitems; }
QString *itemsRef() { return &m_proitems; }
const ushort *tokPtr() const { return (const ushort *)m_proitems.constData(); }
+ const ushort *tokPtrEnd() const { return (const ushort *)m_proitems.constData() + m_proitems.size(); }
void ref() { m_refCount.ref(); }
void deref() { if (!m_refCount.deref()) delete this; }
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 02d5d5dd31..02cd8a2760 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -358,10 +358,10 @@ static QMakeEvaluator::VisitReturn parseJsonInto(const QByteArray &json, const Q
QMakeEvaluator::VisitReturn
QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
- const QString &contents)
+ bool exe, const QString &contents)
{
QString errStr;
- if (!m_vfs->writeFile(fn, mode, contents, &errStr)) {
+ if (!m_vfs->writeFile(fn, mode, exe, contents, &errStr)) {
evalError(fL1S("Cannot write %1file %2: %3")
.arg(ctx, QDir::toNativeSeparators(fn), errStr));
return ReturnFalse;
@@ -514,7 +514,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
QString tmp = args.at(0).toQString(m_tmp1);
for (int i = 1; i < args.count(); ++i)
tmp = tmp.arg(args.at(i).toQString(m_tmp2));
- ret << ProString(tmp);
+ ret << (tmp.isSharedWith(m_tmp1) ? args.at(0) : ProString(tmp).setSource(args.at(0)));
}
break;
case E_FORMAT_NUMBER:
@@ -1387,6 +1387,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
QString parseInto;
LoadFlags flags = 0;
+ if (m_cumulative)
+ flags = LoadSilent;
if (args.count() >= 2) {
parseInto = args.at(1).toQString(m_tmp2);
if (args.count() >= 3 && isTrue(args.at(2), m_tmp3))
@@ -1468,8 +1470,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
fputs(msg.toLatin1().constData(), stderr);
#endif
} else {
- m_handler->fileMessage(fL1S("Project %1: %2")
- .arg(function.toQString(m_tmp1).toUpper(), msg));
+ m_handler->fileMessage(
+ (func_t == T_ERROR ? QMakeHandler::ErrorMessage :
+ func_t == T_WARNING ? QMakeHandler::WarningMessage :
+ QMakeHandler::InfoMessage)
+ | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0),
+ fL1S("Project %1: %2").arg(function.toQString(m_tmp1).toUpper(), msg));
}
}
return (func_t == T_ERROR && !m_cumulative) ? ReturnError : ReturnTrue;
@@ -1541,20 +1547,33 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
case T_WRITE_FILE: {
if (args.count() > 3) {
- evalError(fL1S("write_file(name, [content var, [append]]) requires one to three arguments."));
+ evalError(fL1S("write_file(name, [content var, [append] [exe]]) requires one to three arguments."));
return ReturnFalse;
}
QIODevice::OpenMode mode = QIODevice::Truncate;
+ bool exe = false;
QString contents;
if (args.count() >= 2) {
const ProStringList &vals = values(args.at(1).toKey());
if (!vals.isEmpty())
- contents = vals.join(fL1S("\n")) + QLatin1Char('\n');
- if (args.count() >= 3)
- if (!args.at(2).toQString(m_tmp1).compare(fL1S("append"), Qt::CaseInsensitive))
- mode = QIODevice::Append;
+ contents = vals.join(QLatin1Char('\n')) + QLatin1Char('\n');
+ if (args.count() >= 3) {
+ foreach (const ProString &opt, split_value_list(args.at(2).toQString(m_tmp2))) {
+ opt.toQString(m_tmp3);
+ if (m_tmp3 == QLatin1String("append")) {
+ mode = QIODevice::Append;
+ } else if (m_tmp3 == QLatin1String("exe")) {
+ exe = true;
+ } else {
+ evalError(fL1S("write_file(): invalid flag %1.").arg(m_tmp3));
+ return ReturnFalse;
+ }
+ }
+ }
}
- return writeFile(QString(), resolvePath(args.at(0).toQString(m_tmp1)), mode, contents);
+ QString path = resolvePath(args.at(0).toQString(m_tmp1));
+ path.detach(); // make sure to not leak m_tmp1 into the map of written files.
+ return writeFile(QString(), path, mode, exe, contents);
}
case T_TOUCH: {
if (args.count() != 2) {
@@ -1765,7 +1784,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
valuesRef(ProKey("_QMAKE_STASH_")) << ProString(fn);
}
}
- return writeFile(fL1S("cache "), fn, QIODevice::Append, varstr);
+ return writeFile(fL1S("cache "), fn, QIODevice::Append, false, varstr);
}
default:
evalError(fL1S("Function '%1' is not implemented.").arg(function.toQString(m_tmp1)));
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index 4cfd265591..4c5ce2e097 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -188,7 +188,8 @@ void QMakeEvaluator::initStatics()
{ "QMAKE_RPATH", "QMAKE_LFLAGS_RPATH" },
{ "QMAKE_FRAMEWORKDIR", "QMAKE_FRAMEWORKPATH" },
{ "QMAKE_FRAMEWORKDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS" },
- { "IN_PWD", "PWD" }
+ { "IN_PWD", "PWD" },
+ { "DEPLOYMENT", "INSTALLS" }
};
for (unsigned i = 0; i < sizeof(mapInits)/sizeof(mapInits[0]); ++i)
statics.varMap.insert(ProKey(mapInits[i].oldname), ProKey(mapInits[i].newname));
@@ -451,7 +452,7 @@ void QMakeEvaluator::evaluateExpression(
break; }
case TokEnvVar: {
const ProString &var = pro->getStr(tokPtr);
- const ProString &val = ProString(m_option->getEnv(var.toQString(m_tmp1)));
+ const ProString &val = ProString(m_option->getEnv(var.toQString()));
debugMsg(2, "env var %s => %s", dbgStr(var), dbgStr(val));
addStr(val, ret, pending, joined);
break; }
@@ -574,13 +575,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
okey = true, or_op = false; // force next evaluation
break;
case TokForLoop:
- if (m_cumulative) { // This is a no-win situation, so just pretend it's no loop
- skipHashStr(tokPtr);
- uint exprLen = getBlockLen(tokPtr);
- tokPtr += exprLen;
- blockLen = getBlockLen(tokPtr);
- ret = visitProBlock(tokPtr);
- } else if (okey != or_op) {
+ if (m_cumulative || okey != or_op) {
const ProKey &variable = pro->getHashStr(tokPtr);
uint exprLen = getBlockLen(tokPtr);
const ushort *exprPtr = tokPtr;
@@ -750,6 +745,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop(
ProStringList list = values(it_list.toKey());
if (list.isEmpty()) {
if (it_list == statics.strforever) {
+ if (m_cumulative) {
+ // The termination conditions wouldn't be evaluated, so we must skip it.
+ traceMsg("skipping forever loop in cumulative mode");
+ return ReturnFalse;
+ }
infinite = true;
} else {
const QString &itl = it_list.toQString(m_tmp1);
@@ -760,6 +760,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop(
if (ok) {
int end = itl.mid(dotdot+2).toInt(&ok);
if (ok) {
+ if (m_cumulative && qAbs(end - start) > 100) {
+ // Such a loop is unlikely to contribute something useful to the
+ // file collection, and may cause considerable delay.
+ traceMsg("skipping excessive loop in cumulative mode");
+ return ReturnFalse;
+ }
if (start < end) {
for (int i = start; i <= end; i++)
list << ProString(QString::number(i));
@@ -906,8 +912,11 @@ void QMakeEvaluator::visitProVariable(
m_featureRoots = 0;
else if (varName == statics.strQMAKESPEC) {
if (!values(varName).isEmpty()) {
- m_qmakespec = values(varName).first().toQString();
- m_featureRoots = 0;
+ QString spec = values(varName).first().toQString();
+ if (IoUtils::isAbsolutePath(spec)) {
+ m_qmakespec = spec;
+ m_featureRoots = 0;
+ }
}
}
#ifdef PROEVALUATOR_FULL
@@ -1153,8 +1162,11 @@ bool QMakeEvaluator::loadSpecInternal()
// the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORIGINAL variable.
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
- if (!orig_spec.isEmpty())
- m_qmakespec = orig_spec.toQString();
+ if (!orig_spec.isEmpty()) {
+ QString spec = orig_spec.toQString();
+ if (IoUtils::isAbsolutePath(spec))
+ m_qmakespec = spec;
+ }
# endif
#endif
valuesRef(ProKey("QMAKESPEC")) = ProString(m_qmakespec);
@@ -1294,7 +1306,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConfigFeatures()
config.detach();
processed.insert(config);
VisitReturn vr = evaluateFeatureFile(config, true);
- if (vr == ReturnError)
+ if (vr == ReturnError && !m_cumulative)
return vr;
if (vr == ReturnTrue) {
finished = false;
@@ -1909,7 +1921,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile(
}
#ifdef QMAKE_BUILTIN_PRFS
fn.prepend(QLatin1String(":/qmake/features/"));
- if (QFileInfo(fn).exists())
+ if (QFileInfo::exists(fn))
goto cool;
#endif
fn = QLatin1String(""); // Indicate failed lookup. See comment above.
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index a60adde84e..9560f71587 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -41,7 +41,6 @@
#include "qmakeparser.h"
#include "ioutils.h"
-#include <qiodevice.h>
#include <qlist.h>
#include <qlinkedlist.h>
#include <qmap.h>
@@ -52,6 +51,8 @@
#include <qshareddata.h>
#ifndef QT_BOOTSTRAPPED
# include <qprocess.h>
+#else
+# include <qiodevice.h>
#endif
#ifdef PROEVALUATOR_THREAD_SAFE
# include <qmutex.h>
@@ -67,6 +68,8 @@ public:
enum {
SourceEvaluator = 0x10,
+ CumulativeEvalMessage = 0x1000,
+
EvalWarnLanguage = SourceEvaluator | WarningMessage | WarnLanguage,
EvalWarnDeprecated = SourceEvaluator | WarningMessage | WarnDeprecated,
@@ -74,7 +77,7 @@ public:
};
// error(), warning() and message() from .pro file
- virtual void fileMessage(const QString &msg) = 0;
+ virtual void fileMessage(int type, const QString &msg) = 0;
enum EvalFileType { EvalProjectFile, EvalIncludeFile, EvalConfigFile, EvalFeatureFile, EvalAuxFile };
virtual void aboutToEval(ProFile *parent, ProFile *proFile, EvalFileType type) = 0;
@@ -235,7 +238,7 @@ public:
QMultiMap<int, ProString> &rootSet) const;
VisitReturn writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
- const QString &contents);
+ bool exe, const QString &contents);
#ifndef QT_BOOTSTRAPPED
void runProcess(QProcess *proc, const QString &command) const;
#endif
@@ -310,6 +313,7 @@ public:
QMakeHandler *m_handler;
QMakeVfs *m_vfs;
};
+Q_DECLARE_TYPEINFO(QMakeEvaluator::Location, Q_PRIMITIVE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(QMakeEvaluator::LoadFlags)
diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp
index 55ce404410..8bb5199519 100644
--- a/qmake/library/qmakeglobals.cpp
+++ b/qmake/library/qmakeglobals.cpp
@@ -74,27 +74,8 @@ QT_BEGIN_NAMESPACE
#define fL1S(s) QString::fromLatin1(s)
-namespace { // MSVC doesn't seem to know the semantics of "static" ...
-
-static struct {
- QRegExp reg_variableName;
-} statics;
-
-}
-
-static void initStatics()
-{
- if (!statics.reg_variableName.isEmpty())
- return;
-
- statics.reg_variableName.setPattern(QLatin1String("\\$\\(.*\\)"));
- statics.reg_variableName.setMinimal(true);
-}
-
QMakeGlobals::QMakeGlobals()
{
- initStatics();
-
do_cache = true;
#ifdef PROEVALUATOR_DEBUG
@@ -197,11 +178,11 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
void QMakeGlobals::commitCommandLineArguments(QMakeCmdLineParserState &state)
{
if (!state.preconfigs.isEmpty())
- state.precmds << (fL1S("CONFIG += ") + state.preconfigs.join(fL1S(" ")));
- precmds = state.precmds.join(fL1S("\n"));
+ state.precmds << (fL1S("CONFIG += ") + state.preconfigs.join(QLatin1Char(' ')));
+ precmds = state.precmds.join(QLatin1Char('\n'));
if (!state.postconfigs.isEmpty())
- state.postcmds << (fL1S("CONFIG += ") + state.postconfigs.join(fL1S(" ")));
- postcmds = state.postcmds.join(fL1S("\n"));
+ state.postcmds << (fL1S("CONFIG += ") + state.postconfigs.join(QLatin1Char(' ')));
+ postcmds = state.postcmds.join(QLatin1Char('\n'));
if (xqmakespec.isEmpty())
xqmakespec = qmakespec;
@@ -292,11 +273,24 @@ QStringList QMakeGlobals::getPathListEnv(const QString &var) const
QString QMakeGlobals::expandEnvVars(const QString &str) const
{
QString string = str;
- int rep;
- QRegExp reg_variableName = statics.reg_variableName; // Copy for thread safety
- while ((rep = reg_variableName.indexIn(string)) != -1)
- string.replace(rep, reg_variableName.matchedLength(),
- getEnv(string.mid(rep + 2, reg_variableName.matchedLength() - 3)));
+ int startIndex = 0;
+ forever {
+ startIndex = string.indexOf(QLatin1Char('$'), startIndex);
+ if (startIndex < 0)
+ break;
+ if (string.length() < startIndex + 3)
+ break;
+ if (string.at(startIndex + 1) != QLatin1Char('(')) {
+ startIndex++;
+ continue;
+ }
+ int endIndex = string.indexOf(QLatin1Char(')'), startIndex + 2);
+ if (endIndex < 0)
+ break;
+ QString value = getEnv(string.mid(startIndex + 2, endIndex - startIndex - 2));
+ string.replace(startIndex, endIndex - startIndex + 1, value);
+ startIndex += value.length();
+ }
return string;
}
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 3fd7957bc0..95a072392e 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -64,6 +64,18 @@ void ProFileCache::discardFile(const QString &fileName)
#endif
QHash<QString, Entry>::Iterator it = parsed_files.find(fileName);
if (it != parsed_files.end()) {
+#ifdef PROPARSER_THREAD_SAFE
+ if (it->locker) {
+ if (!it->locker->done) {
+ ++it->locker->waiters;
+ it->locker->cond.wait(&mutex);
+ if (!--it->locker->waiters) {
+ delete it->locker;
+ it->locker = 0;
+ }
+ }
+ }
+#endif
if (it->pro)
it->pro->deref();
parsed_files.erase(it);
@@ -80,6 +92,18 @@ void ProFileCache::discardFiles(const QString &prefix)
end = parsed_files.end();
while (it != end)
if (it.key().startsWith(prefix)) {
+#ifdef PROPARSER_THREAD_SAFE
+ if (it->locker) {
+ if (!it->locker->done) {
+ ++it->locker->waiters;
+ it->locker->cond.wait(&mutex);
+ if (!--it->locker->waiters) {
+ delete it->locker;
+ it->locker = 0;
+ }
+ }
+ }
+#endif
if (it->pro)
it->pro->deref();
it = parsed_files.erase(it);
@@ -88,7 +112,6 @@ void ProFileCache::discardFiles(const QString &prefix)
}
}
-
////////// Parser ///////////
#define fL1S(s) QString::fromLatin1(s)
diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h
index dfea1ddfdf..7fa4f62a96 100644
--- a/qmake/library/qmakeparser.h
+++ b/qmake/library/qmakeparser.h
@@ -50,8 +50,9 @@ class QMAKE_EXPORT QMakeParserHandler
public:
enum {
CategoryMask = 0xf00,
- WarningMessage = 0x000,
- ErrorMessage = 0x100,
+ InfoMessage = 0x100,
+ WarningMessage = 0x200,
+ ErrorMessage = 0x300,
SourceMask = 0xf0,
SourceParser = 0,
diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp
index 613e4e90d7..d23d1f06ff 100644
--- a/qmake/library/qmakevfs.cpp
+++ b/qmake/library/qmakevfs.cpp
@@ -52,8 +52,8 @@ QMakeVfs::QMakeVfs()
{
}
-bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QString &contents,
- QString *errStr)
+bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe,
+ const QString &contents, QString *errStr)
{
#ifndef PROEVALUATOR_FULL
# ifdef PROEVALUATOR_THREAD_SAFE
@@ -75,8 +75,16 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QStr
QByteArray bytes = contents.toLocal8Bit();
QFile cfile(fn);
if (!(mode & QIODevice::Append) && cfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- if (cfile.readAll() == bytes)
+ if (cfile.readAll() == bytes) {
+ if (exe) {
+ cfile.setPermissions(cfile.permissions()
+ | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
+ } else {
+ cfile.setPermissions(cfile.permissions()
+ & ~(QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther));
+ }
return true;
+ }
cfile.close();
}
if (!cfile.open(mode | QIODevice::WriteOnly | QIODevice::Text)) {
@@ -89,6 +97,9 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QStr
*errStr = cfile.errorString();
return false;
}
+ if (exe)
+ cfile.setPermissions(cfile.permissions()
+ | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
return true;
#endif
}
diff --git a/qmake/library/qmakevfs.h b/qmake/library/qmakevfs.h
index 8eeae15dcc..1bc11d3593 100644
--- a/qmake/library/qmakevfs.h
+++ b/qmake/library/qmakevfs.h
@@ -52,7 +52,7 @@ class QMAKE_EXPORT QMakeVfs
public:
QMakeVfs();
- bool writeFile(const QString &fn, QIODevice::OpenMode mode, const QString &contents, QString *errStr);
+ bool writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe, const QString &contents, QString *errStr);
bool readFile(const QString &fn, QString *contents, QString *errStr);
bool exists(const QString &fn);
diff --git a/qmake/meta.cpp b/qmake/meta.cpp
index d7aa885541..719b2c060f 100644
--- a/qmake/meta.cpp
+++ b/qmake/meta.cpp
@@ -48,11 +48,8 @@ QMakeMetaInfo::QMakeMetaInfo(QMakeProject *_conf)
bool
-QMakeMetaInfo::readLib(QString lib)
+QMakeMetaInfo::readLib(const QString &meta_file)
{
- clear();
- QString meta_file = findLib(lib);
-
if(cache_vars.contains(meta_file)) {
vars = cache_vars[meta_file];
return true;
@@ -84,18 +81,9 @@ QMakeMetaInfo::readLib(QString lib)
}
-void
-QMakeMetaInfo::clear()
-{
- vars.clear();
-}
-
-
QString
-QMakeMetaInfo::findLib(QString lib)
+QMakeMetaInfo::findLib(const QString &lib)
{
- lib = Option::normalizePath(lib);
-
QString ret;
QString extns[] = { Option::prl_ext, /*Option::pkgcfg_ext, Option::libtool_ext,*/ QString() };
for(int extn = 0; !extns[extn].isNull(); extn++) {
diff --git a/qmake/meta.h b/qmake/meta.h
index a08b946916..7c91ffda44 100644
--- a/qmake/meta.h
+++ b/qmake/meta.h
@@ -52,15 +52,14 @@ class QMakeMetaInfo
ProValueMap vars;
QString meta_type;
static QHash<QString, ProValueMap> cache_vars;
- void clear();
public:
QMakeMetaInfo(QMakeProject *_conf);
- bool readLib(QString lib);
- static QString findLib(QString lib);
- static bool libExists(QString lib);
- QString type() const;
+ // These functions expect the path to be normalized
+ static QString findLib(const QString &lib);
+ bool readLib(const QString &meta_file);
+ QString type() const;
bool isEmpty(const ProKey &v);
ProStringList &values(const ProKey &v);
ProString first(const ProKey &v);
@@ -92,9 +91,6 @@ inline ProString QMakeMetaInfo::first(const ProKey &v)
inline ProValueMap &QMakeMetaInfo::variables()
{ return vars; }
-inline bool QMakeMetaInfo::libExists(QString lib)
-{ return !findLib(lib).isNull(); }
-
QT_END_NAMESPACE
#endif // META_H
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 4d20f64d58..46bfa33dd3 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -59,6 +59,8 @@ QStringList Option::h_ext;
QString Option::cpp_moc_ext;
QStringList Option::cpp_ext;
QStringList Option::c_ext;
+QString Option::objc_ext;
+QString Option::objcpp_ext;
QString Option::obj_ext;
QString Option::lex_ext;
QString Option::yacc_ext;
@@ -465,6 +467,8 @@ bool Option::postProcessProject(QMakeProject *project)
Option::cpp_ext = project->values("QMAKE_EXT_CPP").toQStringList();
Option::h_ext = project->values("QMAKE_EXT_H").toQStringList();
Option::c_ext = project->values("QMAKE_EXT_C").toQStringList();
+ Option::objc_ext = project->first("QMAKE_EXT_OBJC").toQString();
+ Option::objcpp_ext = project->first("QMAKE_EXT_OBJCXX").toQString();
Option::res_ext = project->first("QMAKE_EXT_RES").toQString();
Option::pkgcfg_ext = project->first("QMAKE_EXT_PKGCONFIG").toQString();
Option::libtool_ext = project->first("QMAKE_EXT_LIBTOOL").toQString();
@@ -597,8 +601,9 @@ void EvalHandler::message(int type, const QString &msg, const QString &fileName,
fprintf(stderr, "%s%s\n", qPrintable(pfx), qPrintable(msg));
}
-void EvalHandler::fileMessage(const QString &msg)
+void EvalHandler::fileMessage(int type, const QString &msg)
{
+ Q_UNUSED(type)
fprintf(stderr, "%s\n", qPrintable(msg));
}
diff --git a/qmake/option.h b/qmake/option.h
index 0ab0365bb3..cb3eb1341a 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -67,7 +67,7 @@ class EvalHandler : public QMakeHandler {
public:
void message(int type, const QString &msg, const QString &fileName, int lineNo);
- void fileMessage(const QString &msg);
+ void fileMessage(int type, const QString &msg);
void aboutToEval(ProFile *, ProFile *, EvalFileType);
void doneWithEval(ProFile *);
@@ -91,6 +91,8 @@ struct Option
static QStringList h_ext;
static QStringList cpp_ext;
static QStringList c_ext;
+ static QString objc_ext;
+ static QString objcpp_ext;
static QString cpp_moc_ext;
static QString obj_ext;
static QString lex_ext;
diff --git a/qtbase.pro b/qtbase.pro
index 24d0f5287b..98ca86ad58 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -51,6 +51,11 @@ licheck.path = $$[QT_HOST_BINS]
licheck.files = $$PWD/bin/$$QT_LICHECK
!isEmpty(QT_LICHECK): INSTALLS += licheck
+#fixqt4headers.pl
+fixqt4headers.path = $$[QT_HOST_BINS]
+fixqt4headers.files = $$PWD/bin/fixqt4headers.pl
+INSTALLS += fixqt4headers
+
#syncqt
syncqt.path = $$[QT_HOST_BINS]
syncqt.files = $$PWD/bin/syncqt.pl
diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h
index c9e6f17d34..c9e6f17d34 100755..100644
--- a/src/3rdparty/angle/include/KHR/khrplatform.h
+++ b/src/3rdparty/angle/include/KHR/khrplatform.h
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
index 4a87488014..84515f4c6c 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
@@ -203,6 +203,7 @@ egl::Error SurfaceD3D::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
if (width == 0 || height == 0)
{
+ checkForOutOfDateSwapChain();
return egl::Error(EGL_SUCCESS);
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
index dc539cf66e..0af2cf12c6 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
@@ -154,14 +154,8 @@ EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHei
const bool useSharedResource = !mNativeWindow.getNativeWindow() && mRenderer->getShareHandleSupport();
D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0};
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
- const int textureLength = std::max(backbufferWidth, backbufferHeight);
- offscreenTextureDesc.Width = textureLength;
- offscreenTextureDesc.Height = textureLength;
-#else
offscreenTextureDesc.Width = backbufferWidth;
offscreenTextureDesc.Height = backbufferHeight;
-#endif
offscreenTextureDesc.Format = backbufferFormatInfo.texFormat;
offscreenTextureDesc.MipLevels = 1;
offscreenTextureDesc.ArraySize = 1;
@@ -241,14 +235,8 @@ EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHei
if (mDepthBufferFormat != GL_NONE)
{
D3D11_TEXTURE2D_DESC depthStencilTextureDesc;
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
- const int textureLength = std::max(backbufferWidth, backbufferHeight);
- depthStencilTextureDesc.Width = textureLength;
- depthStencilTextureDesc.Height = textureLength;
-#else
depthStencilTextureDesc.Width = backbufferWidth;
depthStencilTextureDesc.Height = backbufferHeight;
-#endif
depthStencilTextureDesc.Format = depthBufferFormatInfo.texFormat;
depthStencilTextureDesc.MipLevels = 1;
depthStencilTextureDesc.ArraySize = 1;
@@ -349,7 +337,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
return EGL_SUCCESS;
}
-#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
// Can only call resize if we have already created our swap buffer and resources
ASSERT(mSwapChain && mBackBufferTexture && mBackBufferRTView);
@@ -392,12 +379,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
}
return resetOffscreenTexture(backbufferWidth, backbufferHeight);
-#else
- // Do nothing on Windows Phone apart from updating the internal buffer/width height
- mWidth = backbufferWidth;
- mHeight = backbufferHeight;
- return EGL_SUCCESS;
-#endif
}
EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swapInterval)
@@ -552,27 +533,6 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
d3d11::PositionTexCoordVertex *vertices = static_cast<d3d11::PositionTexCoordVertex*>(mappedResource.pData);
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
- // Create a quad in homogeneous coordinates
- float x1 = -1.0f;
- float y1 = -1.0f;
- float x2 = 1.0f;
- float y2 = 1.0f;
-
- const float dim = std::max(mWidth, mHeight);
- float u1 = 0;
- float v1 = 0;
- float u2 = float(width) / dim;
- float v2 = float(height) / dim;
-
- const NativeWindow::RotationFlags flags = mNativeWindow.rotationFlags();
- const bool rotateL = flags == NativeWindow::RotateLeft;
- const bool rotateR = flags == NativeWindow::RotateRight;
- d3d11::SetPositionTexCoordVertex(&vertices[0], x1, y1, rotateL ? u2 : u1, rotateR ? v2 : v1);
- d3d11::SetPositionTexCoordVertex(&vertices[1], x1, y2, rotateR ? u2 : u1, rotateL ? v1 : v2);
- d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, rotateR ? u1 : u2, rotateL ? v2 : v1);
- d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, rotateL ? u1 : u2, rotateR ? v1 : v2);
-#else
// Create a quad in homogeneous coordinates
float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
@@ -588,7 +548,6 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
d3d11::SetPositionTexCoordVertex(&vertices[1], x1, y2, u1, v2);
d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, u2, v1);
d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, u2, v2);
-#endif
deviceContext->Unmap(mQuadVB, 0);
@@ -618,13 +577,8 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
D3D11_VIEWPORT viewport;
viewport.TopLeftX = 0;
viewport.TopLeftY = 0;
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
- viewport.Width = (rotateL || rotateR) ? height : width;
- viewport.Height = (rotateL || rotateR) ? width : height;
-#else
viewport.Width = mWidth;
viewport.Height = mHeight;
-#endif
viewport.MinDepth = 0.0f;
viewport.MaxDepth = 1.0f;
deviceContext->RSSetViewports(1, &viewport);
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
index fa9a69c5a1..f45a077d97 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
@@ -191,25 +191,4 @@ HRESULT GetCoreWindowSizeInPixels(const ComPtr<ABI::Windows::UI::Core::ICoreWind
return result;
}
-
-static float GetLogicalDpi()
-{
- ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
- float dpi = 96.0f;
-
- if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf())))
- {
- if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi)))
- {
- return dpi;
- }
- }
- return dpi;
-}
-
-long ConvertDipsToPixels(float dips)
-{
- static const float dipsPerInch = 96.0f;
- return lround((dips * GetLogicalDpi() / dipsPerInch));
-}
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
index 59df9d5a6c..87cdfe6f22 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
@@ -19,7 +19,6 @@ typedef ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CGraphics__CD
namespace rx
{
-long ConvertDipsToPixels(float dips);
class CoreWindowNativeWindow : public InspectableNativeWindow, public std::enable_shared_from_this<CoreWindowNativeWindow>
{
@@ -64,8 +63,7 @@ class CoreWindowSizeChangedHandler :
ABI::Windows::Foundation::Size windowSize;
if (SUCCEEDED(sizeChangedEventArgs->get_Size(&windowSize)))
{
- SIZE windowSizeInPixels = { ConvertDipsToPixels(windowSize.Width), ConvertDipsToPixels(windowSize.Height) };
- host->setNewClientSize(windowSizeInPixels);
+ host->setNewClientSize(windowSize);
}
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
index 2bf48c5d94..e83f47929f 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
@@ -288,4 +288,25 @@ HRESULT GetOptionalSizePropertyValue(const ComPtr<ABI::Windows::Foundation::Coll
return result;
}
+
+static float GetLogicalDpi()
+{
+ ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
+ float dpi = 96.0f;
+
+ if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf())))
+ {
+ if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi)))
+ {
+ return dpi;
+ }
+ }
+ return dpi;
+}
+
+long ConvertDipsToPixels(float dips)
+{
+ static const float dipsPerInch = 96.0f;
+ return lround((dips * GetLogicalDpi() / dipsPerInch));
+}
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
index 575bdf8a58..f0534077ae 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
@@ -26,6 +26,8 @@ using namespace ABI::Windows::Foundation::Collections;
namespace rx
{
+long ConvertDipsToPixels(float dips);
+
class InspectableNativeWindow
{
public:
@@ -45,7 +47,7 @@ class InspectableNativeWindow
virtual HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain) = 0;
virtual bool registerForSizeChangeEvents() = 0;
virtual void unregisterForSizeChangeEvents() = 0;
- virtual HRESULT scaleSwapChain(const SIZE& newSize) { return S_OK; }
+ virtual HRESULT scaleSwapChain(const Size& newSize) { return S_OK; }
bool getClientRect(RECT *rect)
{
@@ -59,11 +61,11 @@ class InspectableNativeWindow
return true;
}
- void setNewClientSize(const SIZE &newSize)
+ void setNewClientSize(const Size &newSize)
{
- if (mSupportsSwapChainResize && !mRequiresSwapChainScaling)
+ if (mSupportsSwapChainResize)
{
- mNewClientRect = { 0, 0, newSize.cx, newSize.cy };
+ mNewClientRect = { 0, 0, ConvertDipsToPixels(newSize.Width), ConvertDipsToPixels(newSize.Height) };
mClientRectChanged = true;
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
index 53899dbb30..0b48b54334 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
@@ -66,7 +66,7 @@ bool SwapChainPanelNativeWindow::initialize(EGLNativeWindowType window, IPropert
}
else
{
- result = GetSwapChainPanelSize(mSwapChainPanel, &mClientRect);
+ result = GetSwapChainPanelSize(mSwapChainPanel, &mClientRect, &mRequiresSwapChainScaling);
}
}
@@ -139,7 +139,6 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
ComPtr<IDXGISwapChain1> newSwapChain;
ComPtr<ISwapChainPanelNative> swapChainPanelNative;
- RECT currentPanelSize = {};
HRESULT result = factory->CreateSwapChainForComposition(device, &swapChainDesc, nullptr, newSwapChain.ReleaseAndGetAddressOf());
@@ -167,13 +166,13 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
// first reading the current size of the swapchain panel, then scaling
if (SUCCEEDED(result) && mRequiresSwapChainScaling)
{
- result = GetSwapChainPanelSize(mSwapChainPanel, &currentPanelSize);
- }
+ ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
+ result = mSwapChainPanel.As(&uiElement);
+ ASSERT(SUCCEEDED(result));
- // Scale the swapchain to fit inside the contents of the panel.
- if (SUCCEEDED(result) && mRequiresSwapChainScaling)
- {
- SIZE currentSize = { currentPanelSize.right, currentPanelSize.bottom };
+ Size currentSize;
+ result = uiElement->get_RenderSize(&currentSize);
+ ASSERT(SUCCEEDED(result));
result = scaleSwapChain(currentSize);
}
@@ -190,9 +189,9 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
return result;
}
-HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &newSize)
+HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const Size &newSize)
{
- ABI::Windows::Foundation::Size renderScale = { (float)newSize.cx/(float)mClientRect.right, (float)newSize.cy/(float)mClientRect.bottom };
+ ABI::Windows::Foundation::Size renderScale = { newSize.Width / mNewClientRect.right, newSize.Height / mNewClientRect.bottom };
// Setup a scale matrix for the swap chain
DXGI_MATRIX_3X2_F scaleMatrix = {};
scaleMatrix._11 = renderScale.Width;
@@ -208,7 +207,7 @@ HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &newSize)
return result;
}
-HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize)
+HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize, bool *scalingActive)
{
ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
ABI::Windows::Foundation::Size renderSize = { 0, 0 };
@@ -220,7 +219,14 @@ HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISw
if (SUCCEEDED(result))
{
- *windowSize = { 0, 0, lround(renderSize.Width), lround(renderSize.Height) };
+ long width = ConvertDipsToPixels(renderSize.Width);
+ long height = ConvertDipsToPixels(renderSize.Height);
+ *windowSize = { 0, 0, width, height };
+
+ if (scalingActive)
+ {
+ *scalingActive = width != renderSize.Width || height != renderSize.Height;
+ }
}
return result;
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
index caf327d913..5debd2fd0b 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
@@ -22,7 +22,7 @@ class SwapChainPanelNativeWindow : public InspectableNativeWindow, public std::e
bool registerForSizeChangeEvents();
void unregisterForSizeChangeEvents();
HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain);
- HRESULT scaleSwapChain(const SIZE &newSize);
+ HRESULT scaleSwapChain(const Size &newSize) override;
private:
ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> mSwapChainPanel;
@@ -62,8 +62,7 @@ class SwapChainPanelSizeChangedHandler :
HRESULT result = sizeChangedEventArgs->get_NewSize(&newSize);
if (SUCCEEDED(result))
{
- SIZE windowSize = { lround(newSize.Width), lround(newSize.Height) };
- host->setNewClientSize(windowSize);
+ host->setNewClientSize(newSize);
}
}
@@ -74,6 +73,6 @@ class SwapChainPanelSizeChangedHandler :
std::weak_ptr<InspectableNativeWindow> mHost;
};
-HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize);
+HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize, bool *scalingActive = nullptr);
}
#endif // LIBANGLE_RENDERER_D3D_D3D11_WINRT_SWAPCHAINPANELNATIVEWINDOW_H_
diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
index 8be6ae7d2f..d41c5a4da5 100644
--- a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
@@ -659,7 +659,11 @@ void GL_APIENTRY BlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi
{
if (!ValidateBlitFramebufferParameters(context, srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1, mask, filter,
+#ifndef ANGLE_ENABLE_WINDOWS_STORE
true))
+#else
+ false))
+#endif
{
return;
}
diff --git a/src/3rdparty/easing/easing.cpp b/src/3rdparty/easing/easing.cpp
index 7d70a4d24b..04a59445e5 100644
--- a/src/3rdparty/easing/easing.cpp
+++ b/src/3rdparty/easing/easing.cpp
@@ -102,7 +102,7 @@ static qreal easeInCubic(qreal t)
}
/**
- * Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity.
+ * Easing equation function for a cubic (t^3) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @return The correct value.
@@ -154,7 +154,7 @@ static qreal easeInQuart(qreal t)
}
/**
- * Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity.
+ * Easing equation function for a quartic (t^4) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @return The correct value.
@@ -205,7 +205,7 @@ static qreal easeInQuint(qreal t)
}
/**
- * Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity.
+ * Easing equation function for a quintic (t^5) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @return The correct value.
@@ -256,7 +256,7 @@ static qreal easeInSine(qreal t)
}
/**
- * Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.
+ * Easing equation function for a sinusoidal (sin(t)) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @return The correct value.
@@ -301,7 +301,7 @@ static qreal easeInExpo(qreal t)
}
/**
- * Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity.
+ * Easing equation function for an exponential (2^t) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @return The correct value.
@@ -350,7 +350,7 @@ static qreal easeInCirc(qreal t)
}
/**
- * Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity.
+ * Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @return The correct value.
@@ -438,7 +438,7 @@ static qreal easeOutElastic_helper(qreal t, qreal /*b*/, qreal c, qreal /*d*/, q
}
/**
- * Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity.
+ * Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @param a Amplitude.
@@ -503,7 +503,7 @@ static qreal easeInBack(qreal t, qreal s)
}
/**
- * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating from zero velocity.
+ * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
@@ -566,7 +566,7 @@ static qreal easeOutBounce_helper(qreal t, qreal c, qreal a)
}
/**
- * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.
+ * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating to zero velocity.
*
* @param t Current time (in frames or seconds).
* @param a Amplitude.
diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c
index cff717fe0c..fef710a79e 100644
--- a/src/3rdparty/forkfd/forkfd.c
+++ b/src/3rdparty/forkfd/forkfd.c
@@ -25,11 +25,8 @@
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
-# define _NETBSD_SOURCE 1
-# define _POSIX_C_SOURCE 200809L
-# define _XOPEN_SOURCE 700
-# define __BSD_VISIBLE 1
#endif
+
#include "forkfd.h"
#include <sys/types.h>
@@ -46,6 +43,7 @@
#include <unistd.h>
#ifdef __linux__
+# define HAVE_WAIT4 1
# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x207 && \
(!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x90201)))
# include <sys/eventfd.h>
@@ -56,6 +54,9 @@
# define HAVE_PIPE2 1
# endif
#endif
+#if defined(__FreeBSD__) && __FreeBSD__ >= 9
+# include <sys/procdesc.h>
+#endif
#if _POSIX_VERSION-0 >= 200809L || _XOPEN_VERSION-0 >= 500
# define HAVE_WAITID 1
@@ -67,6 +68,10 @@
#if defined(__FreeBSD__) && defined(__FreeBSD_version) && __FreeBSD_version >= 1000032
# define HAVE_PIPE2 1
#endif
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) || \
+ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+# define HAVE_WAIT4 1
+#endif
#if defined(__APPLE__)
/* Up until OS X 10.7, waitid(P_ALL, ...) will return success, but will not
@@ -199,12 +204,33 @@ static int isChildReady(pid_t pid, siginfo_t *info)
}
#endif
+static void convertStatusToForkfdInfo(int status, struct forkfd_info *info)
+{
+ if (WIFEXITED(status)) {
+ info->code = CLD_EXITED;
+ info->status = WEXITSTATUS(status);
+ } else if (WIFSIGNALED(status)) {
+ info->code = CLD_KILLED;
+# ifdef WCOREDUMP
+ if (WCOREDUMP(status))
+ info->code = CLD_DUMPED;
+# endif
+ info->status = WTERMSIG(status);
+ }
+}
+
static int tryReaping(pid_t pid, struct pipe_payload *payload)
{
/* reap the child */
-#ifdef HAVE_WAITID
+#if defined(HAVE_WAIT4)
+ int status;
+ if (wait4(pid, &status, WNOHANG, &payload->rusage) <= 0)
+ return 0;
+ convertStatusToForkfdInfo(status, &payload->info);
+#else
+# if defined(HAVE_WAITID)
if (waitid_works) {
- // we have waitid(2), which fills in siginfo_t for us
+ /* we have waitid(2), which gets us some payload values on some systems */
siginfo_t info;
info.si_pid = 0;
int ret = waitid(P_PID, pid, &info, WEXITED | WNOHANG) == 0 && info.si_pid == pid;
@@ -213,30 +239,20 @@ static int tryReaping(pid_t pid, struct pipe_payload *payload)
payload->info.code = info.si_code;
payload->info.status = info.si_status;
-# ifdef __linux__
+# ifdef __linux__
payload->rusage.ru_utime.tv_sec = info.si_utime / CLOCKS_PER_SEC;
payload->rusage.ru_utime.tv_usec = info.si_utime % CLOCKS_PER_SEC;
payload->rusage.ru_stime.tv_sec = info.si_stime / CLOCKS_PER_SEC;
payload->rusage.ru_stime.tv_usec = info.si_stime % CLOCKS_PER_SEC;
-# endif
+# endif
return 1;
}
-#endif
+# endif // HAVE_WAITID
int status;
if (waitpid(pid, &status, WNOHANG) <= 0)
return 0; // child did not change state
-
- if (WIFEXITED(status)) {
- payload->info.code = CLD_EXITED;
- payload->info.status = WEXITSTATUS(status);
- } else if (WIFSIGNALED(status)) {
- payload->info.code = CLD_KILLED;
-# ifdef WCOREDUMP
- if (WCOREDUMP(status))
- payload->info.code = CLD_DUMPED;
-# endif
- payload->info.status = WTERMSIG(status);
- }
+ convertStatusToForkfdInfo(status, &payload->info);
+#endif // !HAVE_WAIT4
return 1;
}
@@ -496,6 +512,55 @@ static int create_pipe(int filedes[], int flags)
return ret;
}
+#if defined(FORKFD_NO_SPAWNFD) && defined(__FreeBSD__) && __FreeBSD__ >= 9
+# if __FreeBSD__ == 9
+/* PROCDESC is an optional feature in the kernel and wasn't enabled
+ * by default on FreeBSD 9. So we need to check for it at runtime. */
+static ffd_atomic_int system_has_forkfd = FFD_ATOMIC_INIT(1);
+# else
+/* On FreeBSD 10, PROCDESC was enabled by default. On v11, it's not an option
+ * anymore and can't be disabled. */
+static const int system_has_forkfd = 1;
+# endif
+
+static int system_forkfd(int flags, pid_t *ppid)
+{
+ int ret;
+ pid_t pid;
+ pid = pdfork(&ret, PD_DAEMON);
+ if (__builtin_expect(pid == -1, 0)) {
+# if __FreeBSD__ == 9
+ if (errno == ENOSYS) {
+ /* PROCDESC wasn't compiled into the kernel: don't try it again. */
+ ffd_atomic_store(&system_has_forkfd, 0, FFD_ATOMIC_RELAXED);
+ }
+# endif
+ return -1;
+ }
+ if (pid == 0) {
+ /* child process */
+ return FFD_CHILD_PROCESS;
+ }
+
+ /* parent process */
+ if (flags & FFD_CLOEXEC)
+ fcntl(ret, F_SETFD, FD_CLOEXEC);
+ if (flags & FFD_NONBLOCK)
+ fcntl(ret, F_SETFL, fcntl(ret, F_GETFL) | O_NONBLOCK);
+ if (ppid)
+ *ppid = pid;
+ return ret;
+}
+#else
+static const int system_has_forkfd = 0;
+static int system_forkfd(int flags, pid_t *ppid)
+{
+ (void)flags;
+ (void)ppid;
+ return -1;
+}
+#endif
+
#ifndef FORKFD_NO_FORKFD
/**
* @brief forkfd returns a file descriptor representing a child process
@@ -543,6 +608,12 @@ int forkfd(int flags, pid_t *ppid)
int efd;
#endif
+ if (system_has_forkfd) {
+ ret = system_forkfd(flags, ppid);
+ if (system_has_forkfd)
+ return ret;
+ }
+
(void) pthread_once(&forkfd_initialization, forkfd_initialize);
info = allocateInfo(&header);
@@ -666,6 +737,8 @@ int spawnfd(int flags, pid_t *ppid, const char *path, const posix_spawn_file_act
/* we can only do work if we have a way to start the child in stopped mode;
* otherwise, we have a major race condition. */
+ assert(!system_has_forkfd);
+
(void) pthread_once(&forkfd_initialization, forkfd_initialize);
info = allocateInfo(&header);
@@ -722,6 +795,26 @@ int forkfd_wait(int ffd, forkfd_info *info, struct rusage *rusage)
struct pipe_payload payload;
int ret;
+ if (system_has_forkfd) {
+#if defined(__FreeBSD__) && __FreeBSD__ >= 9
+ pid_t pid;
+ int status;
+ int options = WEXITED;
+
+ ret = pdgetpid(ffd, &pid);
+ if (ret == -1)
+ return ret;
+ ret = fcntl(ffd, F_GETFL);
+ if (ret == -1)
+ return ret;
+ options |= (ret & O_NONBLOCK) ? WNOHANG : 0;
+ ret = wait4(pid, &status, options, rusage);
+ if (ret != -1 && info)
+ convertStatusToForkfdInfo(status, info);
+ return ret == -1 ? -1 : 0;
+#endif
+ }
+
ret = read(ffd, &payload, sizeof(payload));
if (ret == -1)
return ret; /* pass errno, probably EINTR, EBADF or EWOULDBLOCK */
diff --git a/src/3rdparty/freetype/README b/src/3rdparty/freetype/README
index f00a1ab79b..ed62e1dee7 100644
--- a/src/3rdparty/freetype/README
+++ b/src/3rdparty/freetype/README
@@ -1,4 +1,4 @@
- FreeType 2.5.5
+ FreeType 2.6.1
==============
Homepage: http://www.freetype.org
@@ -24,9 +24,9 @@
and download one of the following files.
- freetype-doc-2.5.5.tar.bz2
- freetype-doc-2.5.5.tar.gz
- ftdoc255.zip
+ freetype-doc-2.6.1.tar.bz2
+ freetype-doc-2.6.1.tar.gz
+ ftdoc261.zip
To view the documentation online, go to
@@ -42,6 +42,7 @@
general use and discussion: freetype@nongnu.org
engine internals, porting, etc.: freetype-devel@nongnu.org
announcements: freetype-announce@nongnu.org
+ git repository tracker: freetype-commit@nongnu.org
The lists are moderated; see
@@ -70,7 +71,7 @@
----------------------------------------------------------------------
-Copyright 2006-2014 by
+Copyright 2006-2015 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/builds/unix/ftsystem.c b/src/3rdparty/freetype/builds/unix/ftsystem.c
index 7f7b3acb30..d7513d9e96 100644
--- a/src/3rdparty/freetype/builds/unix/ftsystem.c
+++ b/src/3rdparty/freetype/builds/unix/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
-/* Copyright 1996-2002, 2004-2008, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/docs/CHANGES b/src/3rdparty/freetype/docs/CHANGES
index bbc31104af..ffc686b466 100644
--- a/src/3rdparty/freetype/docs/CHANGES
+++ b/src/3rdparty/freetype/docs/CHANGES
@@ -1,3 +1,189 @@
+CHANGES BETWEEN 2.6 and 2.6.1
+
+ I. IMPORTANT BUG FIXES
+
+ - It turned out that for CFFs only the advance widths should be
+ taken from the `htmx' table, not the side bearings. This bug,
+ introduced in version 2.6.0, makes it necessary to upgrade if
+ you are using CFFs; otherwise, you get cropped glyphs with GUI
+ interfaces like GTK or Qt.
+
+ - Accessing Type 42 fonts returned incorrect results if the glyph
+ order of the embedded TrueType font differs from the glyph order
+ of the Type 42 charstrings table.
+
+
+ II. IMPORTANT CHANGES
+
+ - The header file layout has been changed (again), moving all
+ header files except `ft2build.h' into a subdirectory tree.
+
+ Doing so reduces the possibility of header file name clashes
+ (e.g., FTGL's `FTGlyph.h' with FreeType's `ftglyph.h') on case
+ insensitive file systems like Mac OS X or Windows.
+
+ Applications that use (a) the `freetype-config' script or
+ FreeType's `freetype2.pc' file for pkg-config to get the include
+ directory for the compiler, and (b) the documented way for
+ header inclusion like
+
+ #include <ft2build.h>
+ #include FT_FREETYPE_H
+ ...
+
+ don't need any change to the source code.
+
+ - Simple access to named instances in GX variation fonts is now
+ available (in addition to the previous method via FreeType's MM
+ interface). In the `FT_Face' structure, bits 16-30 of the
+ `face_index' field hold the current named instance index for the
+ given face index, and bits 16-30 of `style_flags' contain the
+ number of instances for the given face index. `FT_Open_Face'
+ and friends also understand the extended bits of the face index
+ parameter.
+
+ You need to enable TT_CONFIG_OPTION_GX_VAR_SUPPORT for this new
+ feature. Otherwise, bits 16-30 of the two fields are zero (or
+ are ignored).
+
+ - Lao script support has been added to the auto-hinter.
+
+
+ III. MISCELLANEOUS
+
+ - The auto-hinter's Arabic script support has been enhanced.
+
+ - Superscript-like and subscript-like glyphs as used by various
+ phonetic alphabets like the IPA are now better supported by the
+ auto-hinter.
+
+ - The TrueType bytecode interpreter now runs slightly faster.
+
+ - Improved support for builds with cmake.
+
+ - The function `FT_CeilFix' now always rounds towards plus
+ infinity.
+
+ - The function `FT_FloorFix' now always rounds towards minus
+ infinity.
+
+ - A new load flag `FT_LOAD_COMPUTE_METRICS' has been added; it
+ makes FreeType ignore pre-computed metrics, as needed by font
+ validating or font editing programs. Right now, only the
+ TrueType module supports it to ignore data from the `hdmx'
+ table.
+
+ - Another round of bug fixes to better handle broken fonts, found
+ by Kostya Serebryany <kcc@google.com>.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.5.5 and 2.6
+
+ I. IMPORTANT CHANGES
+
+ - Behdad Esfahbod contributed code for improved thread-safety,
+ which results in the following model.
+
+ * An `FT_Face' object can only be safely used from one thread at
+ a time.
+
+ * An `FT_Library' object can now be used without modification
+ from multiple threads at the same time.
+
+ * `FT_Face' creation and destruction with the same `FT_Library'
+ object can only be done from one thread at a time.
+
+ One can use a single `FT_Library' object across threads as long
+ as a mutex lock is used around `FT_New_Face' and `FT_Done_Face'.
+ Any calls to `FT_Load_Glyph' and similar API are safe and do not
+ need the lock to be held as long as the same `FT_Face' is not
+ used from multiple threads at the same time.
+
+ - Thai script support has been added to the auto-hinter.
+
+ - Arabic script support has been added to the auto-hinter.
+
+ - Following OpenType version 1.7, advance widths and side bearing
+ values in CFFs (wrapped in an SFNT structure) are now always
+ taken from the `hmtx' table.
+
+ - Following OpenType version 1.7, the PostScript font name of a
+ CFF font (wrapped in an SFNT structure) is now always taken from
+ the `name' table. This is also true for OpenType Collections
+ (i.e., TTCs using CFFs subfonts instead of TTFs), where it may
+ have a significant difference.
+
+ - Fonts natively hinted for ClearType are now supported, properly
+ handling selector index 3 of the INSTCTRL bytecode instruction.
+
+ - Major improvements to the GX TrueType variation font handling.
+
+
+ II. MISCELLANEOUS
+
+ - A new auto-hinter property `warping' can switch on and off the
+ warping code if this experimental feature is compiled in (by
+ defining the AF_CONFIG_OPTION_USE_WARPER configuration option;
+ by default this option is now enabled but warping is switched
+ off).
+
+ The AF_CONFIG_OPTION_USE_WARPER option itself is an old feature,
+ available since 2006. Warping only works in `light'
+ auto-hinting mode. The idea of the code is to slightly scale
+ and shift a glyph along the non-hinted dimension (which is
+ usually the horizontal axis) so that as much of its segments are
+ aligned (more or less) to the grid. To find out a glyph's
+ optimal scaling and shifting value, various parameter
+ combinations are tried and scored.
+
+ See file `ftautoh.h' for more; the demo programs `ftdiff',
+ `ftview', and `ftgrid' can toggle warping with key `w'.
+
+ - Some fields in the `FTC_ImageTypeRec' structure have been
+ changed from signed to unsigned type, which better reflects the
+ actual usage. It is also an additional means to protect against
+ malformed input.
+
+ This change doesn't break the ABI; however, it might cause
+ compiler warnings.
+
+ - Function `FT_Bitmap_New' has been renamed to `FT_Bitmap_Init',
+ since this name better reflects its function. For backwards
+ compatibility, the old function name is still available.
+
+ - Function `FT_Get_X11_Font_Format' has been renamed to
+ `FT_Get_Font_Format', since this name better reflects its
+ function. For backwards compatibility, the old function name is
+ still available.
+
+ Additionally, the header file macro for this function has been
+ renamed to `FT_FONT_FORMATS_H' (the old name `FT_XFREE86_H' is
+ retained for backwards compatibility).
+
+ - Various improvements to the `ftgrid' demo program.
+
+ . It can now display GX and MM fonts while interactively
+ manipulating the axes (with keys F2, F3, and F4).
+
+ . Anti-aliasing rendering modes can now be selected (with keys
+ F5 and F6).
+
+ . The display of point numbers can be toggled with key `D'.
+
+ - Various improvements to the `ftdump' demo program.
+
+ . It now displays information on MM and GX variation axes.
+
+ . New command line option `-u' makes it output data in utf-8
+ encoding.
+
+ - The `ftmulti' demo program can now handle up to six MM or GX
+ axes.
+
+
+======================================================================
CHANGES BETWEEN 2.5.4 and 2.5.5
@@ -4159,7 +4345,7 @@ Extensions support:
------------------------------------------------------------------------
-Copyright 2000-2013 by
+Copyright 2000-2015 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/docs/CUSTOMIZE b/src/3rdparty/freetype/docs/CUSTOMIZE
index dfadb4658d..42fc313811 100644
--- a/src/3rdparty/freetype/docs/CUSTOMIZE
+++ b/src/3rdparty/freetype/docs/CUSTOMIZE
@@ -8,7 +8,7 @@ How to customize the compilation of the library
I. Configuration macros
- The file found in `include/config/ftoption.h' contains a list of
+ The file `include/freetype/config/ftoption.h' contains a list of
commented configuration macros that can be toggled by developers to
indicate which features should be active while building the library.
@@ -35,9 +35,9 @@ II. Modules list
can keep the source files `clean'.
If you don't use GNU make you have to manually edit the file
- `include/config/ftmodule.h' (which is *not* used with if compiled
- with GNU make) to add or remove the drivers and components you want
- to compile into the library. See `INSTALL.ANY' for more
+ `include/freetype/config/ftmodule.h' (which is *not* used with if
+ compiled with GNU make) to add or remove the drivers and components
+ you want to compile into the library. See `INSTALL.ANY' for more
information.
@@ -95,8 +95,9 @@ IV. Overriding default configuration and module headers
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_MODULES_H
- are compiled. Their default values being <config/ftoption.h> and
- <config/ftmodule.h>, you can do something like:
+ are compiled. Their default values being
+ <freetype/config/ftoption.h> and <freetype/config/ftmodule.h>, you
+ can do something like:
custom/
config/
@@ -122,7 +123,7 @@ IV. Overriding default configuration and module headers
#define FT_CONFIG_OPTIONS_H <custom/my-ftoption.h>
#define FT_CONFIG_MODULES_H <custom/my-ftmodule.h>
- #include <config/ftheader.h>
+ #include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_MY_PLATFORM_H__ */
@@ -138,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
-Copyright 2003, 2005, 2006, 2012, 2013 by
+Copyright 2003-2015 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/docs/DEBUG b/src/3rdparty/freetype/docs/DEBUG
index d8c79d187a..ab2c769ac5 100644
--- a/src/3rdparty/freetype/docs/DEBUG
+++ b/src/3rdparty/freetype/docs/DEBUG
@@ -191,7 +191,7 @@ behaviour of FreeType at runtime.
------------------------------------------------------------------------
-Copyright 2002-2005, 2009, 2013 by
+Copyright 2002-2015 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/docs/TODO b/src/3rdparty/freetype/docs/TODO
index be60d6f040..43eeae349e 100644
--- a/src/3rdparty/freetype/docs/TODO
+++ b/src/3rdparty/freetype/docs/TODO
@@ -27,7 +27,7 @@ Other bugs have been registered at the savannah bugzilla of FreeType.
------------------------------------------------------------------------
-Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
+Copyright 2001-2015 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/freetype.pro b/src/3rdparty/freetype/freetype.pro
index a32579e0f9..e9436febc6 100644
--- a/src/3rdparty/freetype/freetype.pro
+++ b/src/3rdparty/freetype/freetype.pro
@@ -67,5 +67,9 @@ contains(QT_CONFIG, system-zlib) {
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include($$PWD/../zlib_dependency.pri)
}
+contains(QT_CONFIG, system-png) {
+ DEFINES += FT_CONFIG_OPTION_USE_PNG
+ include($$PWD/../png_dependency.pri)
+}
DEFINES += TT_CONFIG_OPTION_SUBPIXEL_HINTING
diff --git a/src/3rdparty/freetype/include/config/ftconfig.h b/src/3rdparty/freetype/include/config/ftconfig.h
deleted file mode 100644
index 22d70fd35b..0000000000
--- a/src/3rdparty/freetype/include/config/ftconfig.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftconfig.h */
-/* */
-/* ANSI-specific configuration file (specification only). */
-/* */
-/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This header file contains a number of macro definitions that are used */
- /* by the rest of the engine. Most of the macros here are automatically */
- /* determined at compile time, and you should not need to change it to */
- /* port FreeType, except to compile the library with a non-ANSI */
- /* compiler. */
- /* */
- /* Note however that if some specific modifications are needed, we */
- /* advise you to place a modified copy in your build directory. */
- /* */
- /* The build directory is usually `builds/<system>', and contains */
- /* system-specific files that are always included first when building */
- /* the library. */
- /* */
- /* This ANSI version should stay in `include/config/'. */
- /* */
- /*************************************************************************/
-
-#ifndef __FTCONFIG_H__
-#define __FTCONFIG_H__
-
-#include <ft2build.h>
-#include FT_CONFIG_OPTIONS_H
-#include FT_CONFIG_STANDARD_LIBRARY_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
- /* */
- /* These macros can be toggled to suit a specific system. The current */
- /* ones are defaults used to compile FreeType in an ANSI C environment */
- /* (16bit compilers are also supported). Copy this file to your own */
- /* `builds/<system>' directory, and edit it to port the engine. */
- /* */
- /*************************************************************************/
-
-
- /* There are systems (like the Texas Instruments 'C54x) where a `char' */
- /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
- /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
- /* is probably unexpected. */
- /* */
- /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
- /* `char' type. */
-
-#ifndef FT_CHAR_BIT
-#define FT_CHAR_BIT CHAR_BIT
-#endif
-
-
- /* The size of an `int' type. */
-#if FT_UINT_MAX == 0xFFFFUL
-#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
-#elif FT_UINT_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
-#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
-#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
-#else
-#error "Unsupported size of `int' type!"
-#endif
-
- /* The size of a `long' type. A five-byte `long' (as used e.g. on the */
- /* DM642) is recognized but avoided. */
-#if FT_ULONG_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
-#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
-#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
-#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
-#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
-#else
-#error "Unsupported size of `long' type!"
-#endif
-
-
- /* FT_UNUSED is a macro used to indicate that a given parameter is not */
- /* used -- this is only used to get rid of unpleasant compiler warnings */
-#ifndef FT_UNUSED
-#define FT_UNUSED( arg ) ( (arg) = (arg) )
-#endif
-
-
- /*************************************************************************/
- /* */
- /* AUTOMATIC CONFIGURATION MACROS */
- /* */
- /* These macros are computed from the ones defined above. Don't touch */
- /* their definition, unless you know precisely what you are doing. No */
- /* porter should need to mess with them. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Mac support */
- /* */
- /* This is the only necessary change, so it is defined here instead */
- /* providing a new configuration file. */
- /* */
-#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
- /* no Carbon frameworks for 64bit 10.4.x */
- /* AvailabilityMacros.h is available since Mac OS X 10.2, */
- /* so guess the system version by maximum errno before inclusion */
-#include <errno.h>
-#ifdef ECANCELED /* defined since 10.2 */
-#include "AvailabilityMacros.h"
-#endif
-#if defined( __LP64__ ) && \
- ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#undef FT_MACINTOSH
-#endif
-
-#elif defined( __SC__ ) || defined( __MRC__ )
- /* Classic MacOS compilers */
-#include "ConditionalMacros.h"
-#if TARGET_OS_MAC
-#define FT_MACINTOSH 1
-#endif
-
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int16 */
- /* */
- /* <Description> */
- /* A typedef for a 16bit signed integer type. */
- /* */
- typedef signed short FT_Int16;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt16 */
- /* */
- /* <Description> */
- /* A typedef for a 16bit unsigned integer type. */
- /* */
- typedef unsigned short FT_UInt16;
-
- /* */
-
-
- /* this #if 0 ... #endif clause is for documentation purposes */
-#if 0
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int32 */
- /* */
- /* <Description> */
- /* A typedef for a 32bit signed integer type. The size depends on */
- /* the configuration. */
- /* */
- typedef signed XXX FT_Int32;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt32 */
- /* */
- /* A typedef for a 32bit unsigned integer type. The size depends on */
- /* the configuration. */
- /* */
- typedef unsigned XXX FT_UInt32;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int64 */
- /* */
- /* A typedef for a 64bit signed integer type. The size depends on */
- /* the configuration. Only defined if there is real 64bit support; */
- /* otherwise, it gets emulated with a structure (if necessary). */
- /* */
- typedef signed XXX FT_Int64;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt64 */
- /* */
- /* A typedef for a 64bit unsigned integer type. The size depends on */
- /* the configuration. Only defined if there is real 64bit support; */
- /* otherwise, it gets emulated with a structure (if necessary). */
- /* */
- typedef unsigned XXX FT_UInt64;
-
- /* */
-
-#endif
-
-#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
-
- typedef signed int FT_Int32;
- typedef unsigned int FT_UInt32;
-
-#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
-
- typedef signed long FT_Int32;
- typedef unsigned long FT_UInt32;
-
-#else
-#error "no 32bit type found -- please check your configuration files"
-#endif
-
-
- /* look up an integer type that is at least 32 bits */
-#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
-
- typedef int FT_Fast;
- typedef unsigned int FT_UFast;
-
-#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
-
- typedef long FT_Fast;
- typedef unsigned long FT_UFast;
-
-#endif
-
-
- /* determine whether we have a 64-bit int type for platforms without */
- /* Autoconf */
-#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
-
- /* FT_LONG64 must be defined if a 64-bit type is available */
-#define FT_LONG64
-#define FT_INT64 long
-#define FT_UINT64 unsigned long
-
- /*************************************************************************/
- /* */
- /* A 64-bit data type may create compilation problems if you compile */
- /* in strict ANSI mode. To avoid them, we disable other 64-bit data */
- /* types if __STDC__ is defined. You can however ignore this rule */
- /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
- /* */
-#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
-
-#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
-
- /* this compiler provides the __int64 type */
-#define FT_LONG64
-#define FT_INT64 __int64
-#define FT_UINT64 unsigned __int64
-
-#elif defined( __BORLANDC__ ) /* Borland C++ */
-
- /* XXXX: We should probably check the value of __BORLANDC__ in order */
- /* to test the compiler version. */
-
- /* this compiler provides the __int64 type */
-#define FT_LONG64
-#define FT_INT64 __int64
-#define FT_UINT64 unsigned __int64
-
-#elif defined( __WATCOMC__ ) /* Watcom C++ */
-
- /* Watcom doesn't provide 64-bit data types */
-
-#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
-
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#elif defined( __GNUC__ )
-
- /* GCC provides the `long long' type */
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#endif /* _MSC_VER */
-
-#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
-
-#ifdef FT_LONG64
- typedef FT_INT64 FT_Int64;
- typedef FT_UINT64 FT_UInt64;
-#endif
-
-
-#define FT_BEGIN_STMNT do {
-#define FT_END_STMNT } while ( 0 )
-#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
-
-
-#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
-
-#define FT_LOCAL( x ) static x
-#define FT_LOCAL_DEF( x ) static x
-
-#else
-
-#ifdef __cplusplus
-#define FT_LOCAL( x ) extern "C" x
-#define FT_LOCAL_DEF( x ) extern "C" x
-#else
-#define FT_LOCAL( x ) extern x
-#define FT_LOCAL_DEF( x ) x
-#endif
-
-#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
-
-#define FT_LOCAL_ARRAY( x ) extern const x
-#define FT_LOCAL_ARRAY_DEF( x ) const x
-
-
-#ifndef FT_BASE
-
-#ifdef __cplusplus
-#define FT_BASE( x ) extern "C" x
-#else
-#define FT_BASE( x ) extern x
-#endif
-
-#endif /* !FT_BASE */
-
-
-#ifndef FT_BASE_DEF
-
-#ifdef __cplusplus
-#define FT_BASE_DEF( x ) x
-#else
-#define FT_BASE_DEF( x ) x
-#endif
-
-#endif /* !FT_BASE_DEF */
-
-
-#ifndef FT_EXPORT
-
-#ifdef __cplusplus
-#define FT_EXPORT( x ) extern "C" x
-#else
-#define FT_EXPORT( x ) extern x
-#endif
-
-#endif /* !FT_EXPORT */
-
-
-#ifndef FT_EXPORT_DEF
-
-#ifdef __cplusplus
-#define FT_EXPORT_DEF( x ) extern "C" x
-#else
-#define FT_EXPORT_DEF( x ) extern x
-#endif
-
-#endif /* !FT_EXPORT_DEF */
-
-
-#ifndef FT_EXPORT_VAR
-
-#ifdef __cplusplus
-#define FT_EXPORT_VAR( x ) extern "C" x
-#else
-#define FT_EXPORT_VAR( x ) extern x
-#endif
-
-#endif /* !FT_EXPORT_VAR */
-
- /* The following macros are needed to compile the library with a */
- /* C++ compiler and with 16bit compilers. */
- /* */
-
- /* This is special. Within C++, you must specify `extern "C"' for */
- /* functions which are used via function pointers, and you also */
- /* must do that for structures which contain function pointers to */
- /* assure C linkage -- it's not possible to have (local) anonymous */
- /* functions which are accessed by (global) function pointers. */
- /* */
- /* */
- /* FT_CALLBACK_DEF is used to _define_ a callback function. */
- /* */
- /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
- /* contains pointers to callback functions. */
- /* */
- /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
- /* that contains pointers to callback functions. */
- /* */
- /* */
- /* Some 16bit compilers have to redefine these macros to insert */
- /* the infamous `_cdecl' or `__fastcall' declarations. */
- /* */
-#ifndef FT_CALLBACK_DEF
-#ifdef __cplusplus
-#define FT_CALLBACK_DEF( x ) extern "C" x
-#else
-#define FT_CALLBACK_DEF( x ) static x
-#endif
-#endif /* FT_CALLBACK_DEF */
-
-#ifndef FT_CALLBACK_TABLE
-#ifdef __cplusplus
-#define FT_CALLBACK_TABLE extern "C"
-#define FT_CALLBACK_TABLE_DEF extern "C"
-#else
-#define FT_CALLBACK_TABLE extern
-#define FT_CALLBACK_TABLE_DEF /* nothing */
-#endif
-#endif /* FT_CALLBACK_TABLE */
-
-
-FT_END_HEADER
-
-
-#endif /* __FTCONFIG_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/config/ftheader.h b/src/3rdparty/freetype/include/config/ftheader.h
deleted file mode 100644
index b623629921..0000000000
--- a/src/3rdparty/freetype/include/config/ftheader.h
+++ /dev/null
@@ -1,832 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftheader.h */
-/* */
-/* Build macros of the FreeType 2 library. */
-/* */
-/* Copyright 1996-2008, 2010, 2012, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-#ifndef __FT_HEADER_H__
-#define __FT_HEADER_H__
-
-
- /*@***********************************************************************/
- /* */
- /* <Macro> */
- /* FT_BEGIN_HEADER */
- /* */
- /* <Description> */
- /* This macro is used in association with @FT_END_HEADER in header */
- /* files to ensure that the declarations within are properly */
- /* encapsulated in an `extern "C" { .. }' block when included from a */
- /* C++ compiler. */
- /* */
-#ifdef __cplusplus
-#define FT_BEGIN_HEADER extern "C" {
-#else
-#define FT_BEGIN_HEADER /* nothing */
-#endif
-
-
- /*@***********************************************************************/
- /* */
- /* <Macro> */
- /* FT_END_HEADER */
- /* */
- /* <Description> */
- /* This macro is used in association with @FT_BEGIN_HEADER in header */
- /* files to ensure that the declarations within are properly */
- /* encapsulated in an `extern "C" { .. }' block when included from a */
- /* C++ compiler. */
- /* */
-#ifdef __cplusplus
-#define FT_END_HEADER }
-#else
-#define FT_END_HEADER /* nothing */
-#endif
-
-
- /*************************************************************************/
- /* */
- /* Aliases for the FreeType 2 public and configuration files. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* header_file_macros */
- /* */
- /* <Title> */
- /* Header File Macros */
- /* */
- /* <Abstract> */
- /* Macro definitions used to #include specific header files. */
- /* */
- /* <Description> */
- /* The following macros are defined to the name of specific */
- /* FreeType~2 header files. They can be used directly in #include */
- /* statements as in: */
- /* */
- /* { */
- /* #include FT_FREETYPE_H */
- /* #include FT_MULTIPLE_MASTERS_H */
- /* #include FT_GLYPH_H */
- /* } */
- /* */
- /* There are several reasons why we are now using macros to name */
- /* public header files. The first one is that such macros are not */
- /* limited to the infamous 8.3~naming rule required by DOS (and */
- /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
- /* */
- /* The second reason is that it allows for more flexibility in the */
- /* way FreeType~2 is installed on a given system. */
- /* */
- /*************************************************************************/
-
-
- /* configuration files */
-
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_CONFIG_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * FreeType~2 configuration data.
- *
- */
-#ifndef FT_CONFIG_CONFIG_H
-#define FT_CONFIG_CONFIG_H <config/ftconfig.h>
-#endif
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_STANDARD_LIBRARY_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * FreeType~2 interface to the standard C library functions.
- *
- */
-#ifndef FT_CONFIG_STANDARD_LIBRARY_H
-#define FT_CONFIG_STANDARD_LIBRARY_H <config/ftstdlib.h>
-#endif
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_OPTIONS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * FreeType~2 project-specific configuration options.
- *
- */
-#ifndef FT_CONFIG_OPTIONS_H
-#define FT_CONFIG_OPTIONS_H <config/ftoption.h>
-#endif
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CONFIG_MODULES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list of FreeType~2 modules that are statically linked to new library
- * instances in @FT_Init_FreeType.
- *
- */
-#ifndef FT_CONFIG_MODULES_H
-#define FT_CONFIG_MODULES_H <config/ftmodule.h>
-#endif
-
- /* */
-
- /* public headers */
-
- /*************************************************************************
- *
- * @macro:
- * FT_FREETYPE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * base FreeType~2 API.
- *
- */
-#define FT_FREETYPE_H <freetype.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ERRORS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list of FreeType~2 error codes (and messages).
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
-#define FT_ERRORS_H <fterrors.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_MODULE_ERRORS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list of FreeType~2 module error offsets (and messages).
- *
- */
-#define FT_MODULE_ERRORS_H <ftmoderr.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SYSTEM_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 interface to low-level operations (i.e., memory management
- * and stream i/o).
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
-#define FT_SYSTEM_H <ftsystem.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IMAGE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing type
- * definitions related to glyph images (i.e., bitmaps, outlines,
- * scan-converter parameters).
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
-#define FT_IMAGE_H <ftimage.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TYPES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * basic data types defined by FreeType~2.
- *
- * It is included by @FT_FREETYPE_H.
- *
- */
-#define FT_TYPES_H <fttypes.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_LIST_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * list management API of FreeType~2.
- *
- * (Most applications will never need to include this file.)
- *
- */
-#define FT_LIST_H <ftlist.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_OUTLINE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * scalable outline management API of FreeType~2.
- *
- */
-#define FT_OUTLINE_H <ftoutln.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SIZES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API which manages multiple @FT_Size objects per face.
- *
- */
-#define FT_SIZES_H <ftsizes.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_MODULE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * module management API of FreeType~2.
- *
- */
-#define FT_MODULE_H <ftmodapi.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_RENDER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * renderer module management API of FreeType~2.
- *
- */
-#define FT_RENDER_H <ftrender.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_AUTOHINTER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * structures and macros related to the auto-hinting module.
- *
- */
-#define FT_AUTOHINTER_H <ftautoh.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CFF_DRIVER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * structures and macros related to the CFF driver module.
- *
- */
-#define FT_CFF_DRIVER_H <ftcffdrv.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_DRIVER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing
- * structures and macros related to the TrueType driver module.
- *
- */
-#define FT_TRUETYPE_DRIVER_H <ftttdrv.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TYPE1_TABLES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * types and API specific to the Type~1 format.
- *
- */
-#define FT_TYPE1_TABLES_H <t1tables.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_IDS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * enumeration values which identify name strings, languages, encodings,
- * etc. This file really contains a _large_ set of constant macro
- * definitions, taken from the TrueType and OpenType specifications.
- *
- */
-#define FT_TRUETYPE_IDS_H <ttnameid.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_TABLES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * types and API specific to the TrueType (as well as OpenType) format.
- *
- */
-#define FT_TRUETYPE_TABLES_H <tttables.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TRUETYPE_TAGS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of TrueType four-byte `tags' which identify blocks in
- * SFNT-based font formats (i.e., TrueType and OpenType).
- *
- */
-#define FT_TRUETYPE_TAGS_H <tttags.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_BDF_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which accesses BDF-specific strings from a
- * face.
- *
- */
-#define FT_BDF_H <ftbdf.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CID_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which access CID font information from a
- * face.
- *
- */
-#define FT_CID_H <ftcid.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_GZIP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports gzip-compressed files.
- *
- */
-#define FT_GZIP_H <ftgzip.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_LZW_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports LZW-compressed files.
- *
- */
-#define FT_LZW_H <ftlzw.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_BZIP2_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports bzip2-compressed files.
- *
- */
-#define FT_BZIP2_H <ftbzip2.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_WINFONTS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * definitions of an API which supports Windows FNT files.
- *
- */
-#define FT_WINFONTS_H <ftwinfnt.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_GLYPH_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional glyph management component.
- *
- */
-#define FT_GLYPH_H <ftglyph.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_BITMAP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional bitmap conversion component.
- *
- */
-#define FT_BITMAP_H <ftbitmap.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_BBOX_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional exact bounding box computation routines.
- *
- */
-#define FT_BBOX_H <ftbbox.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * API of the optional FreeType~2 cache sub-system.
- *
- */
-#define FT_CACHE_H <ftcache.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_IMAGE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `glyph image' API of the FreeType~2 cache sub-system.
- *
- * It is used to define a cache for @FT_Glyph elements. You can also
- * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
- * store small glyph bitmaps, as it will use less memory.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * glyph image-related cache declarations.
- *
- */
-#define FT_CACHE_IMAGE_H FT_CACHE_H
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_SMALL_BITMAPS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `small bitmaps' API of the FreeType~2 cache sub-system.
- *
- * It is used to define a cache for small glyph bitmaps in a relatively
- * memory-efficient way. You can also use the API defined in
- * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
- * including scalable outlines.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * small bitmaps-related cache declarations.
- *
- */
-#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_CHARMAP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `charmap' API of the FreeType~2 cache sub-system.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * charmap-based cache declarations.
- *
- */
-#define FT_CACHE_CHARMAP_H FT_CACHE_H
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_MAC_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * Macintosh-specific FreeType~2 API. The latter is used to access
- * fonts embedded in resource forks.
- *
- * This header file must be explicitly included by client applications
- * compiled on the Mac (note that the base API still works though).
- *
- */
-#define FT_MAC_H <ftmac.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_MULTIPLE_MASTERS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional multiple-masters management API of FreeType~2.
- *
- */
-#define FT_MULTIPLE_MASTERS_H <ftmm.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SFNT_NAMES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional FreeType~2 API which accesses embedded `name' strings in
- * SFNT-based font formats (i.e., TrueType and OpenType).
- *
- */
-#define FT_SFNT_NAMES_H <ftsnames.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_OPENTYPE_VALIDATE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
- * GPOS, GSUB, JSTF).
- *
- */
-#define FT_OPENTYPE_VALIDATE_H <ftotval.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_GX_VALIDATE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
- * mort, morx, bsln, just, kern, opbd, trak, prop).
- *
- */
-#define FT_GX_VALIDATE_H <ftgxval.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_PFR_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which accesses PFR-specific data.
- *
- */
-#define FT_PFR_H <ftpfr.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_STROKER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which provides functions to stroke outline paths.
- */
-#define FT_STROKER_H <ftstroke.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SYNTHESIS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs artificial obliquing and emboldening.
- */
-#define FT_SYNTHESIS_H <ftsynth.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_XFREE86_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which provides functions specific to the XFree86 and
- * X.Org X11 servers.
- */
-#define FT_XFREE86_H <ftxf86.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_TRIGONOMETRY_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs trigonometric computations (e.g.,
- * cosines and arc tangents).
- */
-#define FT_TRIGONOMETRY_H <fttrigon.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_LCD_FILTER_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs color filtering for subpixel rendering.
- */
-#define FT_LCD_FILTER_H <ftlcdfil.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_UNPATENTED_HINTING_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs color filtering for subpixel rendering.
- */
-#define FT_UNPATENTED_HINTING_H <ttunpat.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_INCREMENTAL_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which performs color filtering for subpixel rendering.
- */
-#define FT_INCREMENTAL_H <ftincrem.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_GASP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which returns entries from the TrueType GASP table.
- */
-#define FT_GASP_H <ftgasp.h>
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ADVANCES_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * FreeType~2 API which returns individual and ranged glyph advances.
- */
-#define FT_ADVANCES_H <ftadvanc.h>
-
-
- /* */
-
-#define FT_ERROR_DEFINITIONS_H <fterrdef.h>
-
-
- /* The internals of the cache sub-system are no longer exposed. We */
- /* default to FT_CACHE_H at the moment just in case, but we know of */
- /* no rogue client that uses them. */
- /* */
-#define FT_CACHE_MANAGER_H <ftcache.h>
-#define FT_CACHE_INTERNAL_MRU_H <ftcache.h>
-#define FT_CACHE_INTERNAL_MANAGER_H <ftcache.h>
-#define FT_CACHE_INTERNAL_CACHE_H <ftcache.h>
-#define FT_CACHE_INTERNAL_GLYPH_H <ftcache.h>
-#define FT_CACHE_INTERNAL_IMAGE_H <ftcache.h>
-#define FT_CACHE_INTERNAL_SBITS_H <ftcache.h>
-
-
-#define FT_INCREMENTAL_H <ftincrem.h>
-
-#define FT_TRUETYPE_UNPATENTED_H <ttunpat.h>
-
-
- /*
- * Include internal headers definitions from <internal/...>
- * only when building the library.
- */
-#ifdef FT2_BUILD_LIBRARY
-#define FT_INTERNAL_INTERNAL_H <internal/internal.h>
-#include FT_INTERNAL_INTERNAL_H
-#endif /* FT2_BUILD_LIBRARY */
-
-
-#endif /* __FT2_BUILD_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/config/ftoption.h b/src/3rdparty/freetype/include/config/ftoption.h
deleted file mode 100644
index 2b0b67e7af..0000000000
--- a/src/3rdparty/freetype/include/config/ftoption.h
+++ /dev/null
@@ -1,899 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftoption.h */
-/* */
-/* User-selectable configuration macros (specification only). */
-/* */
-/* Copyright 1996-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTOPTION_H__
-#define __FTOPTION_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
- /*************************************************************************/
- /* */
- /* USER-SELECTABLE CONFIGURATION MACROS */
- /* */
- /* This file contains the default configuration macro definitions for */
- /* a standard build of the FreeType library. There are three ways to */
- /* use this file to build project-specific versions of the library: */
- /* */
- /* - You can modify this file by hand, but this is not recommended in */
- /* cases where you would like to build several versions of the */
- /* library from a single source directory. */
- /* */
- /* - You can put a copy of this file in your build directory, more */
- /* precisely in `$BUILD/config/ftoption.h', where `$BUILD' is the */
- /* name of a directory that is included _before_ the FreeType include */
- /* path during compilation. */
- /* */
- /* The default FreeType Makefiles and Jamfiles use the build */
- /* directory `builds/<system>' by default, but you can easily change */
- /* that for your own projects. */
- /* */
- /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
- /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
- /* locate this file during the build. For example, */
- /* */
- /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
- /* #include <config/ftheader.h> */
- /* */
- /* will use `$BUILD/myftoptions.h' instead of this file for macro */
- /* definitions. */
- /* */
- /* Note also that you can similarly pre-define the macro */
- /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
- /* that are statically linked to the library at compile time. By */
- /* default, this file is <config/ftmodule.h>. */
- /* */
- /* We highly recommend using the third method whenever possible. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Uncomment the line below if you want to activate sub-pixel rendering */
- /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
- /* */
- /* Note that this feature is covered by several Microsoft patents */
- /* and should not be activated in any default build of the library. */
- /* */
- /* This macro has no impact on the FreeType API, only on its */
- /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
- /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
- /* the original size in case this macro isn't defined; however, each */
- /* triplet of subpixels has R=G=B. */
- /* */
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-
-
- /*************************************************************************/
- /* */
- /* Many compilers provide a non-ANSI 64-bit data type that can be used */
- /* by FreeType to speed up some computations. However, this will create */
- /* some problems when compiling the library in strict ANSI mode. */
- /* */
- /* For this reason, the use of 64-bit integers is normally disabled when */
- /* the __STDC__ macro is defined. You can however disable this by */
- /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
- /* */
- /* For most compilers, this will only create compilation warnings when */
- /* building the library. */
- /* */
- /* ObNote: The compiler-specific 64-bit integers are detected in the */
- /* file `ftconfig.h' either statically or through the */
- /* `configure' script on supported platforms. */
- /* */
-#undef FT_CONFIG_OPTION_FORCE_INT64
-
-
- /*************************************************************************/
- /* */
- /* If this macro is defined, do not try to use an assembler version of */
- /* performance-critical functions (e.g. FT_MulFix). You should only do */
- /* that to verify that the assembler function works properly, or to */
- /* execute benchmark tests of the various implementations. */
-/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
-
-
- /*************************************************************************/
- /* */
- /* If this macro is defined, try to use an inlined assembler version of */
- /* the `FT_MulFix' function, which is a `hotspot' when loading and */
- /* hinting glyphs, and which should be executed as fast as possible. */
- /* */
- /* Note that if your compiler or CPU is not supported, this will default */
- /* to the standard and portable implementation found in `ftcalc.c'. */
- /* */
-#define FT_CONFIG_OPTION_INLINE_MULFIX
-
-
- /*************************************************************************/
- /* */
- /* LZW-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `compress' program. This is mostly used to parse many of the PCF */
- /* files that come with various X11 distributions. The implementation */
- /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
- /* (see src/lzw/ftgzip.c). */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
-#define FT_CONFIG_OPTION_USE_LZW
-
-
- /*************************************************************************/
- /* */
- /* Gzip-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `gzip' program. This is mostly used to parse many of the PCF files */
- /* that come with XFree86. The implementation uses `zlib' to */
- /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
- /* */
- /* Define this macro if you want to enable this `feature'. See also */
- /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
- /* */
-#define FT_CONFIG_OPTION_USE_ZLIB
-
-
- /*************************************************************************/
- /* */
- /* ZLib library selection */
- /* */
- /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
- /* It allows FreeType's `ftgzip' component to link to the system's */
- /* installation of the ZLib library. This is useful on systems like */
- /* Unix or VMS where it generally is already available. */
- /* */
- /* If you let it undefined, the component will use its own copy */
- /* of the zlib sources instead. These have been modified to be */
- /* included directly within the component and *not* export external */
- /* function names. This allows you to link any program with FreeType */
- /* _and_ ZLib without linking conflicts. */
- /* */
- /* Do not #undef this macro here since the build system might define */
- /* it for certain configurations only. */
- /* */
-/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
-
-
- /*************************************************************************/
- /* */
- /* Bzip2-compressed file support. */
- /* */
- /* FreeType now handles font files that have been compressed with the */
- /* `bzip2' program. This is mostly used to parse many of the PCF */
- /* files that come with XFree86. The implementation uses `libbz2' to */
- /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
- /* Contrary to gzip, bzip2 currently is not included and need to use */
- /* the system available bzip2 implementation. */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
-/* #define FT_CONFIG_OPTION_USE_BZIP2 */
-
-
- /*************************************************************************/
- /* */
- /* Define to disable the use of file stream functions and types, FILE, */
- /* fopen() etc. Enables the use of smaller system libraries on embedded */
- /* systems that have multiple system libraries, some with or without */
- /* file stream support, in the cases where file stream support is not */
- /* necessary such as memory loading of font files. */
- /* */
-/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
-
-
- /*************************************************************************/
- /* */
- /* PNG bitmap support. */
- /* */
- /* FreeType now handles loading color bitmap glyphs in the PNG format. */
- /* This requires help from the external libpng library. Uncompressed */
- /* color bitmaps do not need any external libraries and will be */
- /* supported regardless of this configuration. */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
-/* #define FT_CONFIG_OPTION_USE_PNG */
-
-
- /*************************************************************************/
- /* */
- /* HarfBuzz support. */
- /* */
- /* FreeType uses the HarfBuzz library to improve auto-hinting of */
- /* OpenType fonts. If available, many glyphs not directly addressable */
- /* by a font's character map will be hinted also. */
- /* */
- /* Define this macro if you want to enable this `feature'. */
- /* */
-/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
-
-
- /*************************************************************************/
- /* */
- /* DLL export compilation */
- /* */
- /* When compiling FreeType as a DLL, some systems/compilers need a */
- /* special keyword in front OR after the return type of function */
- /* declarations. */
- /* */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
- /* */
- /* FT_EXPORT( return_type ) */
- /* */
- /* is used in a function declaration, as in */
- /* */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* */
- /* */
- /* FT_EXPORT_DEF( return_type ) */
- /* */
- /* is used in a function definition, as in */
- /* */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* */
- /* You can provide your own implementation of FT_EXPORT and */
- /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
- /* will be later automatically defined as `extern return_type' to */
- /* allow normal compilation. */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
-/* #define FT_EXPORT(x) extern x */
-/* #define FT_EXPORT_DEF(x) x */
-
-
- /*************************************************************************/
- /* */
- /* Glyph Postscript Names handling */
- /* */
- /* By default, FreeType 2 is compiled with the `psnames' module. This */
- /* module is in charge of converting a glyph name string into a */
- /* Unicode value, or return a Macintosh standard glyph name for the */
- /* use with the TrueType `post' table. */
- /* */
- /* Undefine this macro if you do not want `psnames' compiled in your */
- /* build of FreeType. This has the following effects: */
- /* */
- /* - The TrueType driver will provide its own set of glyph names, */
- /* if you build it to support postscript names in the TrueType */
- /* `post' table. */
- /* */
- /* - The Type 1 driver will not be able to synthesize a Unicode */
- /* charmap out of the glyphs found in the fonts. */
- /* */
- /* You would normally undefine this configuration macro when building */
- /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
- /* */
-#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* Postscript Names to Unicode Values support */
- /* */
- /* By default, FreeType 2 is built with the `PSNames' module compiled */
- /* in. Among other things, the module is used to convert a glyph name */
- /* into a Unicode value. This is especially useful in order to */
- /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
- /* through a big table named the `Adobe Glyph List' (AGL). */
- /* */
- /* Undefine this macro if you do not want the Adobe Glyph List */
- /* compiled in your `PSNames' module. The Type 1 driver will not be */
- /* able to synthesize a Unicode charmap out of the glyphs found in the */
- /* fonts. */
- /* */
-#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-
-
- /*************************************************************************/
- /* */
- /* Support for Mac fonts */
- /* */
- /* Define this macro if you want support for outline fonts in Mac */
- /* format (mac dfont, mac resource, macbinary containing a mac */
- /* resource) on non-Mac platforms. */
- /* */
- /* Note that the `FOND' resource isn't checked. */
- /* */
-#define FT_CONFIG_OPTION_MAC_FONTS
-
-
- /*************************************************************************/
- /* */
- /* Guessing methods to access embedded resource forks */
- /* */
- /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
- /* GNU/Linux). */
- /* */
- /* Resource forks which include fonts data are stored sometimes in */
- /* locations which users or developers don't expected. In some cases, */
- /* resource forks start with some offset from the head of a file. In */
- /* other cases, the actual resource fork is stored in file different */
- /* from what the user specifies. If this option is activated, */
- /* FreeType tries to guess whether such offsets or different file */
- /* names must be used. */
- /* */
- /* Note that normal, direct access of resource forks is controlled via */
- /* the FT_CONFIG_OPTION_MAC_FONTS option. */
- /* */
-#ifdef FT_CONFIG_OPTION_MAC_FONTS
-#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
-#endif
-
-
- /*************************************************************************/
- /* */
- /* Allow the use of FT_Incremental_Interface to load typefaces that */
- /* contain no glyph data, but supply it via a callback function. */
- /* This is required by clients supporting document formats which */
- /* supply font data incrementally as the document is parsed, such */
- /* as the Ghostscript interpreter for the PostScript language. */
- /* */
-#define FT_CONFIG_OPTION_INCREMENTAL
-
-
- /*************************************************************************/
- /* */
- /* The size in bytes of the render pool used by the scan-line converter */
- /* to do all of its work. */
- /* */
- /* This must be greater than 4KByte if you use FreeType to rasterize */
- /* glyphs; otherwise, you may set it to zero to avoid unnecessary */
- /* allocation of the render pool. */
- /* */
-#define FT_RENDER_POOL_SIZE 16384L
-
-
- /*************************************************************************/
- /* */
- /* FT_MAX_MODULES */
- /* */
- /* The maximum number of modules that can be registered in a single */
- /* FreeType library object. 32 is the default. */
- /* */
-#define FT_MAX_MODULES 32
-
-
- /*************************************************************************/
- /* */
- /* Debug level */
- /* */
- /* FreeType can be compiled in debug or trace mode. In debug mode, */
- /* errors are reported through the `ftdebug' component. In trace */
- /* mode, additional messages are sent to the standard output during */
- /* execution. */
- /* */
- /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
- /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
- /* */
- /* Don't define any of these macros to compile in `release' mode! */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
-/* #define FT_DEBUG_LEVEL_ERROR */
-/* #define FT_DEBUG_LEVEL_TRACE */
-
-
- /*************************************************************************/
- /* */
- /* Autofitter debugging */
- /* */
- /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
- /* control the autofitter behaviour for debugging purposes with global */
- /* boolean variables (consequently, you should *never* enable this */
- /* while compiling in `release' mode): */
- /* */
- /* _af_debug_disable_horz_hints */
- /* _af_debug_disable_vert_hints */
- /* _af_debug_disable_blue_hints */
- /* */
- /* Additionally, the following functions provide dumps of various */
- /* internal autofit structures to stdout (using `printf'): */
- /* */
- /* af_glyph_hints_dump_points */
- /* af_glyph_hints_dump_segments */
- /* af_glyph_hints_dump_edges */
- /* */
- /* As an argument, they use another global variable: */
- /* */
- /* _af_debug_hints */
- /* */
- /* Please have a look at the `ftgrid' demo program to see how those */
- /* variables and macros should be used. */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
-/* #define FT_DEBUG_AUTOFIT */
-
-
- /*************************************************************************/
- /* */
- /* Memory Debugging */
- /* */
- /* FreeType now comes with an integrated memory debugger that is */
- /* capable of detecting simple errors like memory leaks or double */
- /* deletes. To compile it within your build of the library, you */
- /* should define FT_DEBUG_MEMORY here. */
- /* */
- /* Note that the memory debugger is only activated at runtime when */
- /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
- /* */
- /* Do not #undef this macro here since the build system might define */
- /* it for certain configurations only. */
- /* */
-/* #define FT_DEBUG_MEMORY */
-
-
- /*************************************************************************/
- /* */
- /* Module errors */
- /* */
- /* If this macro is set (which is _not_ the default), the higher byte */
- /* of an error code gives the module in which the error has occurred, */
- /* while the lower byte is the real error code. */
- /* */
- /* Setting this macro makes sense for debugging purposes only, since */
- /* it would break source compatibility of certain programs that use */
- /* FreeType 2. */
- /* */
- /* More details can be found in the files ftmoderr.h and fterrors.h. */
- /* */
-#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
-
-
- /*************************************************************************/
- /* */
- /* Position Independent Code */
- /* */
- /* If this macro is set (which is _not_ the default), FreeType2 will */
- /* avoid creating constants that require address fixups. Instead the */
- /* constants will be moved into a struct and additional intialization */
- /* code will be used. */
- /* */
- /* Setting this macro is needed for systems that prohibit address */
- /* fixups, such as BREW. */
- /* */
-/* #define FT_CONFIG_OPTION_PIC */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
- /* embedded bitmaps in all formats using the SFNT module (namely */
- /* TrueType & OpenType). */
- /* */
-#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
- /* load and enumerate the glyph Postscript names in a TrueType or */
- /* OpenType file. */
- /* */
- /* Note that when you do not compile the `PSNames' module by undefining */
- /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
- /* contain additional code used to read the PS Names table from a font. */
- /* */
- /* (By default, the module uses `PSNames' to extract glyph names.) */
- /* */
-#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
- /* access the internal name table in a SFNT-based format like TrueType */
- /* or OpenType. The name table contains various strings used to */
- /* describe the font, like family name, copyright, version, etc. It */
- /* does not contain any glyph name though. */
- /* */
- /* Accessing SFNT names is done through the functions declared in */
- /* `ftsnames.h'. */
- /* */
-#define TT_CONFIG_OPTION_SFNT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* TrueType CMap support */
- /* */
- /* Here you can fine-tune which TrueType CMap table format shall be */
- /* supported. */
-#define TT_CONFIG_CMAP_FORMAT_0
-#define TT_CONFIG_CMAP_FORMAT_2
-#define TT_CONFIG_CMAP_FORMAT_4
-#define TT_CONFIG_CMAP_FORMAT_6
-#define TT_CONFIG_CMAP_FORMAT_8
-#define TT_CONFIG_CMAP_FORMAT_10
-#define TT_CONFIG_CMAP_FORMAT_12
-#define TT_CONFIG_CMAP_FORMAT_13
-#define TT_CONFIG_CMAP_FORMAT_14
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
- /* a bytecode interpreter in the TrueType driver. */
- /* */
- /* By undefining this, you will only compile the code necessary to load */
- /* TrueType glyphs without hinting. */
- /* */
- /* Do not #undef this macro here, since the build system might */
- /* define it for certain configurations only. */
- /* */
-#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
- /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
- /* replaces the native TrueType hinting mechanism when anything but */
- /* FT_RENDER_MODE_MONO is requested. */
- /* */
- /* Enabling this causes the TrueType driver to ignore instructions under */
- /* certain conditions. This is done in accordance with the guide here, */
- /* with some minor differences: */
- /* */
- /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
- /* */
- /* By undefining this, you only compile the code necessary to hint */
- /* TrueType glyphs with native TT hinting. */
- /* */
- /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
- /* defined. */
- /* */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-
-
- /*************************************************************************/
- /* */
- /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
- /* of the TrueType bytecode interpreter is used that doesn't implement */
- /* any of the patented opcodes and algorithms. The patents related to */
- /* TrueType hinting have expired worldwide since May 2010; this option */
- /* is now deprecated. */
- /* */
- /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
- /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
- /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
- /* */
- /* This macro is only useful for a small number of font files (mostly */
- /* for Asian scripts) that require bytecode interpretation to properly */
- /* load glyphs. For all other fonts, this produces unpleasant results, */
- /* thus the unpatented interpreter is never used to load glyphs from */
- /* TrueType fonts unless one of the following two options is used. */
- /* */
- /* - The unpatented interpreter is explicitly activated by the user */
- /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
- /* when opening the FT_Face. */
- /* */
- /* - FreeType detects that the FT_Face corresponds to one of the */
- /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
- /* contains a hard-coded list of font names and other matching */
- /* parameters (see function `tt_face_init' in file */
- /* `src/truetype/ttobjs.c'). */
- /* */
- /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
- /* */
- /* { */
- /* FT_Parameter parameter; */
- /* FT_Open_Args open_args; */
- /* */
- /* */
- /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
- /* */
- /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
- /* open_args.pathname = my_font_pathname; */
- /* open_args.num_params = 1; */
- /* open_args.params = &parameter; */
- /* */
- /* error = FT_Open_Face( library, &open_args, index, &face ); */
- /* ... */
- /* } */
- /* */
-/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
- /* bytecode interpreter with a huge switch statement, rather than a call */
- /* table. This results in smaller and faster code for a number of */
- /* architectures. */
- /* */
- /* Note however that on some compiler/processor combinations, undefining */
- /* this macro will generate faster, though larger, code. */
- /* */
-#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
- /* TrueType glyph loader to use Apple's definition of how to handle */
- /* component offsets in composite glyphs. */
- /* */
- /* Apple and MS disagree on the default behavior of component offsets */
- /* in composites. Apple says that they should be scaled by the scaling */
- /* factors in the transformation matrix (roughly, it's more complex) */
- /* while MS says they should not. OpenType defines two bits in the */
- /* composite flags array which can be used to disambiguate, but old */
- /* fonts will not have them. */
- /* */
- /* http://www.microsoft.com/typography/otspec/glyf.htm */
- /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
- /* */
-#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
- /* support for Apple's distortable font technology (fvar, gvar, cvar, */
- /* and avar tables). This has many similarities to Type 1 Multiple */
- /* Masters support. */
- /* */
-#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
- /* an embedded `BDF ' table within SFNT-based bitmap formats. */
- /* */
-#define TT_CONFIG_OPTION_BDF
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
- /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
- /* required. */
- /* */
-#define T1_MAX_DICT_DEPTH 5
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
- /* calls during glyph loading. */
- /* */
-#define T1_MAX_SUBRS_CALLS 16
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
- /* minimum of 16 is required. */
- /* */
- /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
- /* */
-#define T1_MAX_CHARSTRINGS_OPERANDS 256
-
-
- /*************************************************************************/
- /* */
- /* Define this configuration macro if you want to prevent the */
- /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
- /* files into an existing face. Note that if set, the T1 driver will be */
- /* unable to produce kerning distances. */
- /* */
-#undef T1_CONFIG_OPTION_NO_AFM
-
-
- /*************************************************************************/
- /* */
- /* Define this configuration macro if you want to prevent the */
- /* compilation of the Multiple Masters font support in the Type 1 */
- /* driver. */
- /* */
-#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** C F F D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */
- /* possible to set up the default values of the four control points that */
- /* define the stem darkening behaviour of the (new) CFF engine. For */
- /* more details please read the documentation of the */
- /* `darkening-parameters' property of the cff driver module (file */
- /* `ftcffdrv.h'), which allows the control at run-time. */
- /* */
- /* Do *not* undefine these macros! */
- /* */
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
-
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
-
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
-
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
-#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
-
-
- /*************************************************************************/
- /* */
- /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
- /* engine gets compiled into FreeType. If defined, it is possible to */
- /* switch between the two engines using the `hinting-engine' property of */
- /* the cff driver module. */
- /* */
-/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
- /* support. */
- /* */
-#define AF_CONFIG_OPTION_CJK
-
- /*************************************************************************/
- /* */
- /* Compile autofit module with Indic script support. */
- /* */
-#define AF_CONFIG_OPTION_INDIC
-
- /*************************************************************************/
- /* */
- /* Compile autofit module with warp hinting. The idea of the warping */
- /* code is to slightly scale and shift a glyph within a single dimension */
- /* so that as much of its segments are aligned (more or less) on the */
- /* grid. To find out the optimal scaling and shifting value, various */
- /* parameter combinations are tried and scored. */
- /* */
- /* This experimental option is only active if the render mode is */
- /* FT_RENDER_MODE_LIGHT. */
- /* */
-/* #define AF_CONFIG_OPTION_USE_WARPER */
-
- /* */
-
-
- /*
- * This macro is obsolete. Support has been removed in FreeType
- * version 2.5.
- */
-/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
- /*
- * This macro is defined if either unpatented or native TrueType
- * hinting is requested by the definitions above.
- */
-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-#define TT_USE_BYTECODE_INTERPRETER
-#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
-#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
-#define TT_USE_BYTECODE_INTERPRETER
-#endif
-
-
- /*
- * Check CFF darkening parameters. The checks are the same as in function
- * `cff_property_set' in file `cffdrivr.c'.
- */
-#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \
- \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \
- \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \
- \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
- CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
-#error "Invalid CFF darkening parameters!"
-#endif
-
-FT_END_HEADER
-
-
-#endif /* __FTOPTION_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/config/ftstdlib.h b/src/3rdparty/freetype/include/config/ftstdlib.h
deleted file mode 100644
index b940efc427..0000000000
--- a/src/3rdparty/freetype/include/config/ftstdlib.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftstdlib.h */
-/* */
-/* ANSI-specific library and header configuration file (specification */
-/* only). */
-/* */
-/* Copyright 2002-2007, 2009, 2011-2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to group all #includes to the ANSI C library that */
- /* FreeType normally requires. It also defines macros to rename the */
- /* standard functions within the FreeType source code. */
- /* */
- /* Load a file which defines __FTSTDLIB_H__ before this one to override */
- /* it. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTSTDLIB_H__
-#define __FTSTDLIB_H__
-
-
-#include <stddef.h>
-
-#define ft_ptrdiff_t ptrdiff_t
-
-
- /**********************************************************************/
- /* */
- /* integer limits */
- /* */
- /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
- /* of `int' and `long' in bytes at compile-time. So far, this works */
- /* for all platforms the library has been tested on. */
- /* */
- /* Note that on the extremely rare platforms that do not provide */
- /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
- /* old Crays where `int' is 36 bits), we do not make any guarantee */
- /* about the correct behaviour of FT2 with all fonts. */
- /* */
- /* In these case, `ftconfig.h' will refuse to compile anyway with a */
- /* message like `couldn't find 32-bit type' or something similar. */
- /* */
- /**********************************************************************/
-
-
-#include <limits.h>
-
-#define FT_CHAR_BIT CHAR_BIT
-#define FT_USHORT_MAX USHRT_MAX
-#define FT_INT_MAX INT_MAX
-#define FT_INT_MIN INT_MIN
-#define FT_UINT_MAX UINT_MAX
-#define FT_ULONG_MAX ULONG_MAX
-
-
- /**********************************************************************/
- /* */
- /* character and string processing */
- /* */
- /**********************************************************************/
-
-
-#include <string.h>
-
-#define ft_memchr memchr
-#define ft_memcmp memcmp
-#define ft_memcpy memcpy
-#define ft_memmove memmove
-#define ft_memset memset
-#define ft_strcat strcat
-#define ft_strcmp strcmp
-#define ft_strcpy strcpy
-#define ft_strlen strlen
-#define ft_strncmp strncmp
-#define ft_strncpy strncpy
-#define ft_strrchr strrchr
-#define ft_strstr strstr
-
-
- /**********************************************************************/
- /* */
- /* file handling */
- /* */
- /**********************************************************************/
-
-
-#include <stdio.h>
-
-#define FT_FILE FILE
-#define ft_fclose fclose
-#define ft_fopen fopen
-#define ft_fread fread
-#define ft_fseek fseek
-#define ft_ftell ftell
-#define ft_sprintf sprintf
-
-
- /**********************************************************************/
- /* */
- /* sorting */
- /* */
- /**********************************************************************/
-
-
-#include <stdlib.h>
-
-#define ft_qsort qsort
-
-
- /**********************************************************************/
- /* */
- /* memory allocation */
- /* */
- /**********************************************************************/
-
-
-#define ft_scalloc calloc
-#define ft_sfree free
-#define ft_smalloc malloc
-#define ft_srealloc realloc
-
-
- /**********************************************************************/
- /* */
- /* miscellaneous */
- /* */
- /**********************************************************************/
-
-
-#define ft_atol atol
-#define ft_labs labs
-
-
- /**********************************************************************/
- /* */
- /* execution control */
- /* */
- /**********************************************************************/
-
-
-#include <setjmp.h>
-
-#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
- /* jmp_buf is defined as a macro */
- /* on certain platforms */
-
-#define ft_longjmp longjmp
-#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
-
-
- /* the following is only used for debugging purposes, i.e., if */
- /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
-
-#include <stdarg.h>
-
-
-#endif /* __FTSTDLIB_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/freetype.h b/src/3rdparty/freetype/include/freetype.h
deleted file mode 100644
index 27fd44bfc2..0000000000
--- a/src/3rdparty/freetype/include/freetype.h
+++ /dev/null
@@ -1,4048 +0,0 @@
-/***************************************************************************/
-/* */
-/* freetype.h */
-/* */
-/* FreeType high-level API and common types (specification only). */
-/* */
-/* Copyright 1996-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FREETYPE_H__
-#define __FREETYPE_H__
-
-
-#ifndef FT_FREETYPE_H
-#error "`ft2build.h' hasn't been included yet!"
-#error "Please always use macros to include FreeType header files."
-#error "Example:"
-#error " #include <ft2build.h>"
-#error " #include FT_FREETYPE_H"
-#endif
-
-
-#include <ft2build.h>
-#include FT_CONFIG_CONFIG_H
-#include FT_TYPES_H
-#include FT_ERRORS_H
-
-
-FT_BEGIN_HEADER
-
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* header_inclusion */
- /* */
- /* <Title> */
- /* FreeType's header inclusion scheme */
- /* */
- /* <Abstract> */
- /* How client applications should include FreeType header files. */
- /* */
- /* <Description> */
- /* To be as flexible as possible (and for historical reasons), */
- /* FreeType uses a very special inclusion scheme to load header */
- /* files, for example */
- /* */
- /* { */
- /* #include <ft2build.h> */
- /* */
- /* #include FT_FREETYPE_H */
- /* #include FT_OUTLINE_H */
- /* } */
- /* */
- /* A compiler and its preprocessor only needs an include path to find */
- /* the file `ft2build.h'; the exact locations and names of the other */
- /* FreeType header files are hidden by preprocessor macro names, */
- /* loaded by `ft2build.h'. The API documentation always gives the */
- /* header macro name needed for a particular function. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* user_allocation */
- /* */
- /* <Title> */
- /* User allocation */
- /* */
- /* <Abstract> */
- /* How client applications should allocate FreeType data structures. */
- /* */
- /* <Description> */
- /* FreeType assumes that structures allocated by the user and passed */
- /* as arguments are zeroed out except for the actual data. In other */
- /* words, it is recommended to use `calloc' (or variants of it) */
- /* instead of `malloc' for allocation. */
- /* */
- /*************************************************************************/
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S I C T Y P E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* base_interface */
- /* */
- /* <Title> */
- /* Base Interface */
- /* */
- /* <Abstract> */
- /* The FreeType~2 base font interface. */
- /* */
- /* <Description> */
- /* This section describes the most important public high-level API */
- /* functions of FreeType~2. */
- /* */
- /* <Order> */
- /* FT_Library */
- /* FT_Face */
- /* FT_Size */
- /* FT_GlyphSlot */
- /* FT_CharMap */
- /* FT_Encoding */
- /* FT_ENC_TAG */
- /* */
- /* FT_FaceRec */
- /* */
- /* FT_FACE_FLAG_SCALABLE */
- /* FT_FACE_FLAG_FIXED_SIZES */
- /* FT_FACE_FLAG_FIXED_WIDTH */
- /* FT_FACE_FLAG_HORIZONTAL */
- /* FT_FACE_FLAG_VERTICAL */
- /* FT_FACE_FLAG_COLOR */
- /* FT_FACE_FLAG_SFNT */
- /* FT_FACE_FLAG_CID_KEYED */
- /* FT_FACE_FLAG_TRICKY */
- /* FT_FACE_FLAG_KERNING */
- /* FT_FACE_FLAG_MULTIPLE_MASTERS */
- /* FT_FACE_FLAG_GLYPH_NAMES */
- /* FT_FACE_FLAG_EXTERNAL_STREAM */
- /* FT_FACE_FLAG_HINTER */
- /* FT_FACE_FLAG_TRICKY */
- /* */
- /* FT_HAS_HORIZONTAL */
- /* FT_HAS_VERTICAL */
- /* FT_HAS_KERNING */
- /* FT_HAS_FIXED_SIZES */
- /* FT_HAS_GLYPH_NAMES */
- /* FT_HAS_MULTIPLE_MASTERS */
- /* FT_HAS_COLOR */
- /* */
- /* FT_IS_SFNT */
- /* FT_IS_SCALABLE */
- /* FT_IS_FIXED_WIDTH */
- /* FT_IS_CID_KEYED */
- /* FT_IS_TRICKY */
- /* */
- /* FT_STYLE_FLAG_BOLD */
- /* FT_STYLE_FLAG_ITALIC */
- /* */
- /* FT_SizeRec */
- /* FT_Size_Metrics */
- /* */
- /* FT_GlyphSlotRec */
- /* FT_Glyph_Metrics */
- /* FT_SubGlyph */
- /* */
- /* FT_Bitmap_Size */
- /* */
- /* FT_Init_FreeType */
- /* FT_Done_FreeType */
- /* */
- /* FT_New_Face */
- /* FT_Done_Face */
- /* FT_Reference_Face */
- /* FT_New_Memory_Face */
- /* FT_Open_Face */
- /* FT_Open_Args */
- /* FT_Parameter */
- /* FT_Attach_File */
- /* FT_Attach_Stream */
- /* */
- /* FT_Set_Char_Size */
- /* FT_Set_Pixel_Sizes */
- /* FT_Request_Size */
- /* FT_Select_Size */
- /* FT_Size_Request_Type */
- /* FT_Size_RequestRec */
- /* FT_Size_Request */
- /* FT_Set_Transform */
- /* FT_Load_Glyph */
- /* FT_Get_Char_Index */
- /* FT_Get_First_Char */
- /* FT_Get_Next_Char */
- /* FT_Get_Name_Index */
- /* FT_Load_Char */
- /* */
- /* FT_OPEN_MEMORY */
- /* FT_OPEN_STREAM */
- /* FT_OPEN_PATHNAME */
- /* FT_OPEN_DRIVER */
- /* FT_OPEN_PARAMS */
- /* */
- /* FT_LOAD_DEFAULT */
- /* FT_LOAD_RENDER */
- /* FT_LOAD_MONOCHROME */
- /* FT_LOAD_LINEAR_DESIGN */
- /* FT_LOAD_NO_SCALE */
- /* FT_LOAD_NO_HINTING */
- /* FT_LOAD_NO_BITMAP */
- /* FT_LOAD_NO_AUTOHINT */
- /* FT_LOAD_COLOR */
- /* */
- /* FT_LOAD_VERTICAL_LAYOUT */
- /* FT_LOAD_IGNORE_TRANSFORM */
- /* FT_LOAD_FORCE_AUTOHINT */
- /* FT_LOAD_NO_RECURSE */
- /* FT_LOAD_PEDANTIC */
- /* */
- /* FT_LOAD_TARGET_NORMAL */
- /* FT_LOAD_TARGET_LIGHT */
- /* FT_LOAD_TARGET_MONO */
- /* FT_LOAD_TARGET_LCD */
- /* FT_LOAD_TARGET_LCD_V */
- /* */
- /* FT_LOAD_TARGET_MODE */
- /* */
- /* FT_Render_Glyph */
- /* FT_Render_Mode */
- /* FT_Get_Kerning */
- /* FT_Kerning_Mode */
- /* FT_Get_Track_Kerning */
- /* FT_Get_Glyph_Name */
- /* FT_Get_Postscript_Name */
- /* */
- /* FT_CharMapRec */
- /* FT_Select_Charmap */
- /* FT_Set_Charmap */
- /* FT_Get_Charmap_Index */
- /* */
- /* FT_Get_FSType_Flags */
- /* FT_Get_SubGlyph_Info */
- /* */
- /* FT_Face_Internal */
- /* FT_Size_Internal */
- /* FT_Slot_Internal */
- /* */
- /* FT_FACE_FLAG_XXX */
- /* FT_STYLE_FLAG_XXX */
- /* FT_OPEN_XXX */
- /* FT_LOAD_XXX */
- /* FT_LOAD_TARGET_XXX */
- /* FT_SUBGLYPH_FLAG_XXX */
- /* FT_FSTYPE_XXX */
- /* */
- /* FT_HAS_FAST_GLYPHS */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Glyph_Metrics */
- /* */
- /* <Description> */
- /* A structure used to model the metrics of a single glyph. The */
- /* values are expressed in 26.6 fractional pixel format; if the flag */
- /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
- /* are expressed in font units instead. */
- /* */
- /* <Fields> */
- /* width :: */
- /* The glyph's width. */
- /* */
- /* height :: */
- /* The glyph's height. */
- /* */
- /* horiBearingX :: */
- /* Left side bearing for horizontal layout. */
- /* */
- /* horiBearingY :: */
- /* Top side bearing for horizontal layout. */
- /* */
- /* horiAdvance :: */
- /* Advance width for horizontal layout. */
- /* */
- /* vertBearingX :: */
- /* Left side bearing for vertical layout. */
- /* */
- /* vertBearingY :: */
- /* Top side bearing for vertical layout. Larger positive values */
- /* mean further below the vertical glyph origin. */
- /* */
- /* vertAdvance :: */
- /* Advance height for vertical layout. Positive values mean the */
- /* glyph has a positive advance downward. */
- /* */
- /* <Note> */
- /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
- /* dimensions of the hinted glyph (in case hinting is applicable). */
- /* */
- /* Stroking a glyph with an outside border does not increase */
- /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
- /* values to account for the added width and height. */
- /* */
- typedef struct FT_Glyph_Metrics_
- {
- FT_Pos width;
- FT_Pos height;
-
- FT_Pos horiBearingX;
- FT_Pos horiBearingY;
- FT_Pos horiAdvance;
-
- FT_Pos vertBearingX;
- FT_Pos vertBearingY;
- FT_Pos vertAdvance;
-
- } FT_Glyph_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Bitmap_Size */
- /* */
- /* <Description> */
- /* This structure models the metrics of a bitmap strike (i.e., a set */
- /* of glyphs for a given point size and resolution) in a bitmap font. */
- /* It is used for the `available_sizes' field of @FT_Face. */
- /* */
- /* <Fields> */
- /* height :: The vertical distance, in pixels, between two */
- /* consecutive baselines. It is always positive. */
- /* */
- /* width :: The average width, in pixels, of all glyphs in the */
- /* strike. */
- /* */
- /* size :: The nominal size of the strike in 26.6 fractional */
- /* points. This field is not very useful. */
- /* */
- /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
- /* pixels. */
- /* */
- /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
- /* pixels. */
- /* */
- /* <Note> */
- /* Windows FNT: */
- /* The nominal size given in a FNT font is not reliable. Thus when */
- /* the driver finds it incorrect, it sets `size' to some calculated */
- /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
- /* height given in the font, respectively. */
- /* */
- /* TrueType embedded bitmaps: */
- /* `size', `width', and `height' values are not contained in the */
- /* bitmap strike itself. They are computed from the global font */
- /* parameters. */
- /* */
- typedef struct FT_Bitmap_Size_
- {
- FT_Short height;
- FT_Short width;
-
- FT_Pos size;
-
- FT_Pos x_ppem;
- FT_Pos y_ppem;
-
- } FT_Bitmap_Size;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Library */
- /* */
- /* <Description> */
- /* A handle to a FreeType library instance. Each `library' is */
- /* completely independent from the others; it is the `root' of a set */
- /* of objects like fonts, faces, sizes, etc. */
- /* */
- /* It also embeds a memory manager (see @FT_Memory), as well as a */
- /* scan-line converter object (see @FT_Raster). */
- /* */
- /* In multi-threaded applications, make sure that the same FT_Library */
- /* object or any of its children doesn't get accessed in parallel. */
- /* */
- /* <Note> */
- /* Library objects are normally created by @FT_Init_FreeType, and */
- /* destroyed with @FT_Done_FreeType. If you need reference-counting */
- /* (cf. @FT_Reference_Library), use @FT_New_Library and */
- /* @FT_Done_Library. */
- /* */
- typedef struct FT_LibraryRec_ *FT_Library;
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* module_management */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Module */
- /* */
- /* <Description> */
- /* A handle to a given FreeType module object. Each module can be a */
- /* font driver, a renderer, or anything else that provides services */
- /* to the formers. */
- /* */
- typedef struct FT_ModuleRec_* FT_Module;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Driver */
- /* */
- /* <Description> */
- /* A handle to a given FreeType font driver object. Each font driver */
- /* is a special module capable of creating faces from font files. */
- /* */
- typedef struct FT_DriverRec_* FT_Driver;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Renderer */
- /* */
- /* <Description> */
- /* A handle to a given FreeType renderer. A renderer is a special */
- /* module in charge of converting a glyph image to a bitmap, when */
- /* necessary. Each renderer supports a given glyph image format, and */
- /* one or more target surface depths. */
- /* */
- typedef struct FT_RendererRec_* FT_Renderer;
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* base_interface */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face */
- /* */
- /* <Description> */
- /* A handle to a given typographic face object. A face object models */
- /* a given typeface, in a given style. */
- /* */
- /* <Note> */
- /* Each face object also owns a single @FT_GlyphSlot object, as well */
- /* as one or more @FT_Size objects. */
- /* */
- /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
- /* a given filepathname or a custom input stream. */
- /* */
- /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
- /* */
- /* <Also> */
- /* See @FT_FaceRec for the publicly accessible fields of a given face */
- /* object. */
- /* */
- typedef struct FT_FaceRec_* FT_Face;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size */
- /* */
- /* <Description> */
- /* A handle to an object used to model a face scaled to a given */
- /* character size. */
- /* */
- /* <Note> */
- /* Each @FT_Face has an _active_ @FT_Size object that is used by */
- /* functions like @FT_Load_Glyph to determine the scaling */
- /* transformation that in turn is used to load and hint glyphs and */
- /* metrics. */
- /* */
- /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
- /* @FT_Request_Size or even @FT_Select_Size to change the content */
- /* (i.e., the scaling values) of the active @FT_Size. */
- /* */
- /* You can use @FT_New_Size to create additional size objects for a */
- /* given @FT_Face, but they won't be used by other functions until */
- /* you activate it through @FT_Activate_Size. Only one size can be */
- /* activated at any given time per face. */
- /* */
- /* <Also> */
- /* See @FT_SizeRec for the publicly accessible fields of a given size */
- /* object. */
- /* */
- typedef struct FT_SizeRec_* FT_Size;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a given `glyph slot'. A slot is a container where it */
- /* is possible to load any of the glyphs contained in its parent */
- /* face. */
- /* */
- /* In other words, each time you call @FT_Load_Glyph or */
- /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
- /* i.e., the glyph's metrics, its image (bitmap or outline), and */
- /* other control information. */
- /* */
- /* <Also> */
- /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
- /* */
- typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_CharMap */
- /* */
- /* <Description> */
- /* A handle to a given character map. A charmap is used to translate */
- /* character codes in a given encoding into glyph indexes for its */
- /* parent's face. Some font formats may provide several charmaps per */
- /* font. */
- /* */
- /* Each face object owns zero or more charmaps, but only one of them */
- /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
- /* */
- /* The list of available charmaps in a face is available through the */
- /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
- /* */
- /* The currently active charmap is available as `face->charmap'. */
- /* You should call @FT_Set_Charmap to change it. */
- /* */
- /* <Note> */
- /* When a new face is created (either through @FT_New_Face or */
- /* @FT_Open_Face), the library looks for a Unicode charmap within */
- /* the list and automatically activates it. */
- /* */
- /* <Also> */
- /* See @FT_CharMapRec for the publicly accessible fields of a given */
- /* character map. */
- /* */
- typedef struct FT_CharMapRec_* FT_CharMap;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_ENC_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags into an unsigned long. It is */
- /* used to define `encoding' identifiers (see @FT_Encoding). */
- /* */
- /* <Note> */
- /* Since many 16-bit compilers don't like 32-bit enumerations, you */
- /* should redefine this macro in case of problems to something like */
- /* this: */
- /* */
- /* { */
- /* #define FT_ENC_TAG( value, a, b, c, d ) value */
- /* } */
- /* */
- /* to get a simple enumeration without assigning special numbers. */
- /* */
-
-#ifndef FT_ENC_TAG
-#define FT_ENC_TAG( value, a, b, c, d ) \
- value = ( ( (FT_UInt32)(a) << 24 ) | \
- ( (FT_UInt32)(b) << 16 ) | \
- ( (FT_UInt32)(c) << 8 ) | \
- (FT_UInt32)(d) )
-
-#endif /* FT_ENC_TAG */
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Encoding */
- /* */
- /* <Description> */
- /* An enumeration used to specify character sets supported by */
- /* charmaps. Used in the @FT_Select_Charmap API function. */
- /* */
- /* <Note> */
- /* Despite the name, this enumeration lists specific character */
- /* repertories (i.e., charsets), and not text encoding methods (e.g., */
- /* UTF-8, UTF-16, etc.). */
- /* */
- /* Other encodings might be defined in the future. */
- /* */
- /* <Values> */
- /* FT_ENCODING_NONE :: */
- /* The encoding value~0 is reserved. */
- /* */
- /* FT_ENCODING_UNICODE :: */
- /* Corresponds to the Unicode character set. This value covers */
- /* all versions of the Unicode repertoire, including ASCII and */
- /* Latin-1. Most fonts include a Unicode charmap, but not all */
- /* of them. */
- /* */
- /* For example, if you want to access Unicode value U+1F028 (and */
- /* the font contains it), use value 0x1F028 as the input value for */
- /* @FT_Get_Char_Index. */
- /* */
- /* FT_ENCODING_MS_SYMBOL :: */
- /* Corresponds to the Microsoft Symbol encoding, used to encode */
- /* mathematical symbols in the 32..255 character code range. For */
- /* more information, see */
- /* `http://www.kostis.net/charsets/symbol.htm'. */
- /* */
- /* FT_ENCODING_SJIS :: */
- /* Corresponds to Japanese SJIS encoding. More info at */
- /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */
- /* See note on multi-byte encodings below. */
- /* */
- /* FT_ENCODING_GB2312 :: */
- /* Corresponds to an encoding system for Simplified Chinese as used */
- /* used in mainland China. */
- /* */
- /* FT_ENCODING_BIG5 :: */
- /* Corresponds to an encoding system for Traditional Chinese as */
- /* used in Taiwan and Hong Kong. */
- /* */
- /* FT_ENCODING_WANSUNG :: */
- /* Corresponds to the Korean encoding system known as Wansung. */
- /* For more information see */
- /* `http://msdn.microsoft.com/en-US/goglobal/cc305154'. */
- /* */
- /* FT_ENCODING_JOHAB :: */
- /* The Korean standard character set (KS~C 5601-1992), which */
- /* corresponds to MS Windows code page 1361. This character set */
- /* includes all possible Hangeul character combinations. */
- /* */
- /* FT_ENCODING_ADOBE_LATIN_1 :: */
- /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
- /* PostScript font. It is limited to 256 character codes. */
- /* */
- /* FT_ENCODING_ADOBE_STANDARD :: */
- /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
- /* */
- /* FT_ENCODING_ADOBE_EXPERT :: */
- /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
- /* */
- /* FT_ENCODING_ADOBE_CUSTOM :: */
- /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
- /* OpenType/CFF fonts. It is limited to 256 character codes. */
- /* */
- /* FT_ENCODING_APPLE_ROMAN :: */
- /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
- /* and OpenType fonts contain a charmap for this encoding, since */
- /* older versions of Mac OS are able to use it. */
- /* */
- /* FT_ENCODING_OLD_LATIN_2 :: */
- /* This value is deprecated and was never used nor reported by */
- /* FreeType. Don't use or test for it. */
- /* */
- /* FT_ENCODING_MS_SJIS :: */
- /* Same as FT_ENCODING_SJIS. Deprecated. */
- /* */
- /* FT_ENCODING_MS_GB2312 :: */
- /* Same as FT_ENCODING_GB2312. Deprecated. */
- /* */
- /* FT_ENCODING_MS_BIG5 :: */
- /* Same as FT_ENCODING_BIG5. Deprecated. */
- /* */
- /* FT_ENCODING_MS_WANSUNG :: */
- /* Same as FT_ENCODING_WANSUNG. Deprecated. */
- /* */
- /* FT_ENCODING_MS_JOHAB :: */
- /* Same as FT_ENCODING_JOHAB. Deprecated. */
- /* */
- /* <Note> */
- /* By default, FreeType automatically synthesizes a Unicode charmap */
- /* for PostScript fonts, using their glyph names dictionaries. */
- /* However, it also reports the encodings defined explicitly in the */
- /* font file, for the cases when they are needed, with the Adobe */
- /* values as well. */
- /* */
- /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
- /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
- /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
- /* which encoding is really present. If, for example, the */
- /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
- /* the font is encoded in KOI8-R. */
- /* */
- /* FT_ENCODING_NONE is always set (with a single exception) by the */
- /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
- /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
- /* which encoding is really present. For example, */
- /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
- /* Russian). */
- /* */
- /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
- /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
- /* FT_ENCODING_APPLE_ROMAN). */
- /* */
- /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
- /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */
- /* be needed to be able to distinguish Apple encoding variants. See */
- /* */
- /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */
- /* */
- /* to get an idea how to do that. Basically, if the language ID */
- /* is~0, don't use it, otherwise subtract 1 from the language ID. */
- /* Then examine `encoding_id'. If, for example, `encoding_id' is */
- /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
- /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
- /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
- /* variant the Arabic encoding. */
- /* */
- typedef enum FT_Encoding_
- {
- FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
-
- FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
- FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
-
- FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
- FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
- FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
- FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
- FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
-
- /* for backwards compatibility */
- FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
- FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
- FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
- FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
- FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
-
- FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
- FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
- FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
- FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
-
- FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
-
- FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
-
- } FT_Encoding;
-
-
- /* these constants are deprecated; use the corresponding `FT_Encoding' */
- /* values instead */
-#define ft_encoding_none FT_ENCODING_NONE
-#define ft_encoding_unicode FT_ENCODING_UNICODE
-#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
-#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
-#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
-#define ft_encoding_sjis FT_ENCODING_SJIS
-#define ft_encoding_gb2312 FT_ENCODING_GB2312
-#define ft_encoding_big5 FT_ENCODING_BIG5
-#define ft_encoding_wansung FT_ENCODING_WANSUNG
-#define ft_encoding_johab FT_ENCODING_JOHAB
-
-#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
-#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
-#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
-#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_CharMapRec */
- /* */
- /* <Description> */
- /* The base charmap structure. */
- /* */
- /* <Fields> */
- /* face :: A handle to the parent face object. */
- /* */
- /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
- /* this with @FT_Select_Charmap. */
- /* */
- /* platform_id :: An ID number describing the platform for the */
- /* following encoding ID. This comes directly from */
- /* the TrueType specification and should be emulated */
- /* for other formats. */
- /* */
- /* encoding_id :: A platform specific encoding number. This also */
- /* comes from the TrueType specification and should be */
- /* emulated similarly. */
- /* */
- typedef struct FT_CharMapRec_
- {
- FT_Face face;
- FT_Encoding encoding;
- FT_UShort platform_id;
- FT_UShort encoding_id;
-
- } FT_CharMapRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S E O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
- /* model private data of a given @FT_Face object. */
- /* */
- /* This structure might change between releases of FreeType~2 and is */
- /* not generally available to client applications. */
- /* */
- typedef struct FT_Face_InternalRec_* FT_Face_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_FaceRec */
- /* */
- /* <Description> */
- /* FreeType root face class structure. A face object models a */
- /* typeface in a font file. */
- /* */
- /* <Fields> */
- /* num_faces :: The number of faces in the font file. Some */
- /* font formats can have multiple faces in */
- /* a font file. */
- /* */
- /* face_index :: The index of the face in the font file. It */
- /* is set to~0 if there is only one face in */
- /* the font file. */
- /* */
- /* face_flags :: A set of bit flags that give important */
- /* information about the face; see */
- /* @FT_FACE_FLAG_XXX for the details. */
- /* */
- /* style_flags :: A set of bit flags indicating the style of */
- /* the face; see @FT_STYLE_FLAG_XXX for the */
- /* details. */
- /* */
- /* num_glyphs :: The number of glyphs in the face. If the */
- /* face is scalable and has sbits (see */
- /* `num_fixed_sizes'), it is set to the number */
- /* of outline glyphs. */
- /* */
- /* For CID-keyed fonts, this value gives the */
- /* highest CID used in the font. */
- /* */
- /* family_name :: The face's family name. This is an ASCII */
- /* string, usually in English, that describes */
- /* the typeface's family (like `Times New */
- /* Roman', `Bodoni', `Garamond', etc). This */
- /* is a least common denominator used to list */
- /* fonts. Some formats (TrueType & OpenType) */
- /* provide localized and Unicode versions of */
- /* this string. Applications should use the */
- /* format specific interface to access them. */
- /* Can be NULL (e.g., in fonts embedded in a */
- /* PDF file). */
- /* */
- /* style_name :: The face's style name. This is an ASCII */
- /* string, usually in English, that describes */
- /* the typeface's style (like `Italic', */
- /* `Bold', `Condensed', etc). Not all font */
- /* formats provide a style name, so this field */
- /* is optional, and can be set to NULL. As */
- /* for `family_name', some formats provide */
- /* localized and Unicode versions of this */
- /* string. Applications should use the format */
- /* specific interface to access them. */
- /* */
- /* num_fixed_sizes :: The number of bitmap strikes in the face. */
- /* Even if the face is scalable, there might */
- /* still be bitmap strikes, which are called */
- /* `sbits' in that case. */
- /* */
- /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
- /* strikes in the face. It is set to NULL if */
- /* there is no bitmap strike. */
- /* */
- /* num_charmaps :: The number of charmaps in the face. */
- /* */
- /* charmaps :: An array of the charmaps of the face. */
- /* */
- /* generic :: A field reserved for client uses. See the */
- /* @FT_Generic type description. */
- /* */
- /* bbox :: The font bounding box. Coordinates are */
- /* expressed in font units (see */
- /* `units_per_EM'). The box is large enough */
- /* to contain any glyph from the font. Thus, */
- /* `bbox.yMax' can be seen as the `maximum */
- /* ascender', and `bbox.yMin' as the `minimum */
- /* descender'. Only relevant for scalable */
- /* formats. */
- /* */
- /* Note that the bounding box might be off by */
- /* (at least) one pixel for hinted fonts. See */
- /* @FT_Size_Metrics for further discussion. */
- /* */
- /* units_per_EM :: The number of font units per EM square for */
- /* this face. This is typically 2048 for */
- /* TrueType fonts, and 1000 for Type~1 fonts. */
- /* Only relevant for scalable formats. */
- /* */
- /* ascender :: The typographic ascender of the face, */
- /* expressed in font units. For font formats */
- /* not having this information, it is set to */
- /* `bbox.yMax'. Only relevant for scalable */
- /* formats. */
- /* */
- /* descender :: The typographic descender of the face, */
- /* expressed in font units. For font formats */
- /* not having this information, it is set to */
- /* `bbox.yMin'. Note that this field is */
- /* usually negative. Only relevant for */
- /* scalable formats. */
- /* */
- /* height :: This value is the vertical distance */
- /* between two consecutive baselines, */
- /* expressed in font units. It is always */
- /* positive. Only relevant for scalable */
- /* formats. */
- /* */
- /* If you want the global glyph height, use */
- /* `ascender - descender'. */
- /* */
- /* max_advance_width :: The maximum advance width, in font units, */
- /* for all glyphs in this face. This can be */
- /* used to make word wrapping computations */
- /* faster. Only relevant for scalable */
- /* formats. */
- /* */
- /* max_advance_height :: The maximum advance height, in font units, */
- /* for all glyphs in this face. This is only */
- /* relevant for vertical layouts, and is set */
- /* to `height' for fonts that do not provide */
- /* vertical metrics. Only relevant for */
- /* scalable formats. */
- /* */
- /* underline_position :: The position, in font units, of the */
- /* underline line for this face. It is the */
- /* center of the underlining stem. Only */
- /* relevant for scalable formats. */
- /* */
- /* underline_thickness :: The thickness, in font units, of the */
- /* underline for this face. Only relevant for */
- /* scalable formats. */
- /* */
- /* glyph :: The face's associated glyph slot(s). */
- /* */
- /* size :: The current active size for this face. */
- /* */
- /* charmap :: The current active charmap for this face. */
- /* */
- /* <Note> */
- /* Fields may be changed after a call to @FT_Attach_File or */
- /* @FT_Attach_Stream. */
- /* */
- typedef struct FT_FaceRec_
- {
- FT_Long num_faces;
- FT_Long face_index;
-
- FT_Long face_flags;
- FT_Long style_flags;
-
- FT_Long num_glyphs;
-
- FT_String* family_name;
- FT_String* style_name;
-
- FT_Int num_fixed_sizes;
- FT_Bitmap_Size* available_sizes;
-
- FT_Int num_charmaps;
- FT_CharMap* charmaps;
-
- FT_Generic generic;
-
- /*# The following member variables (down to `underline_thickness') */
- /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
- /*# for bitmap fonts. */
- FT_BBox bbox;
-
- FT_UShort units_per_EM;
- FT_Short ascender;
- FT_Short descender;
- FT_Short height;
-
- FT_Short max_advance_width;
- FT_Short max_advance_height;
-
- FT_Short underline_position;
- FT_Short underline_thickness;
-
- FT_GlyphSlot glyph;
- FT_Size size;
- FT_CharMap charmap;
-
- /*@private begin */
-
- FT_Driver driver;
- FT_Memory memory;
- FT_Stream stream;
-
- FT_ListRec sizes_list;
-
- FT_Generic autohint; /* face-specific auto-hinter data */
- void* extensions; /* unused */
-
- FT_Face_Internal internal;
-
- /*@private end */
-
- } FT_FaceRec;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_FACE_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit flags used in the `face_flags' field of the */
- /* @FT_FaceRec structure. They inform client applications of */
- /* properties of the corresponding face. */
- /* */
- /* <Values> */
- /* FT_FACE_FLAG_SCALABLE :: */
- /* Indicates that the face contains outline glyphs. This doesn't */
- /* prevent bitmap strikes, i.e., a face can have both this and */
- /* and @FT_FACE_FLAG_FIXED_SIZES set. */
- /* */
- /* FT_FACE_FLAG_FIXED_SIZES :: */
- /* Indicates that the face contains bitmap strikes. See also the */
- /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
- /* */
- /* FT_FACE_FLAG_FIXED_WIDTH :: */
- /* Indicates that the face contains fixed-width characters (like */
- /* Courier, Lucido, MonoType, etc.). */
- /* */
- /* FT_FACE_FLAG_SFNT :: */
- /* Indicates that the face uses the `sfnt' storage scheme. For */
- /* now, this means TrueType and OpenType. */
- /* */
- /* FT_FACE_FLAG_HORIZONTAL :: */
- /* Indicates that the face contains horizontal glyph metrics. This */
- /* should be set for all common formats. */
- /* */
- /* FT_FACE_FLAG_VERTICAL :: */
- /* Indicates that the face contains vertical glyph metrics. This */
- /* is only available in some formats, not all of them. */
- /* */
- /* FT_FACE_FLAG_KERNING :: */
- /* Indicates that the face contains kerning information. If set, */
- /* the kerning distance can be retrieved through the function */
- /* @FT_Get_Kerning. Otherwise the function always return the */
- /* vector (0,0). Note that FreeType doesn't handle kerning data */
- /* from the `GPOS' table (as present in some OpenType fonts). */
- /* */
- /* FT_FACE_FLAG_FAST_GLYPHS :: */
- /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
- /* */
- /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
- /* Indicates that the font contains multiple masters and is capable */
- /* of interpolating between them. See the multiple-masters */
- /* specific API for details. */
- /* */
- /* FT_FACE_FLAG_GLYPH_NAMES :: */
- /* Indicates that the font contains glyph names that can be */
- /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
- /* fonts contain broken glyph name tables. Use the function */
- /* @FT_Has_PS_Glyph_Names when needed. */
- /* */
- /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
- /* Used internally by FreeType to indicate that a face's stream was */
- /* provided by the client application and should not be destroyed */
- /* when @FT_Done_Face is called. Don't read or test this flag. */
- /* */
- /* FT_FACE_FLAG_HINTER :: */
- /* Set if the font driver has a hinting machine of its own. For */
- /* example, with TrueType fonts, it makes sense to use data from */
- /* the SFNT `gasp' table only if the native TrueType hinting engine */
- /* (with the bytecode interpreter) is available and active. */
- /* */
- /* FT_FACE_FLAG_CID_KEYED :: */
- /* Set if the font is CID-keyed. In that case, the font is not */
- /* accessed by glyph indices but by CID values. For subsetted */
- /* CID-keyed fonts this has the consequence that not all index */
- /* values are a valid argument to FT_Load_Glyph. Only the CID */
- /* values for which corresponding glyphs in the subsetted font */
- /* exist make FT_Load_Glyph return successfully; in all other cases */
- /* you get an `FT_Err_Invalid_Argument' error. */
- /* */
- /* Note that CID-keyed fonts that are in an SFNT wrapper don't */
- /* have this flag set since the glyphs are accessed in the normal */
- /* way (using contiguous indices); the `CID-ness' isn't visible to */
- /* the application. */
- /* */
- /* FT_FACE_FLAG_TRICKY :: */
- /* Set if the font is `tricky', this is, it always needs the */
- /* font format's native hinting engine to get a reasonable result. */
- /* A typical example is the Chinese font `mingli.ttf' that uses */
- /* TrueType bytecode instructions to move and scale all of its */
- /* subglyphs. */
- /* */
- /* It is not possible to autohint such fonts using */
- /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
- /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
- /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
- /* probably never want this except for demonstration purposes. */
- /* */
- /* Currently, there are about a dozen TrueType fonts in the list of */
- /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
- /* */
- /* FT_FACE_FLAG_COLOR :: */
- /* Set if the font has color glyph tables. To access color glyphs */
- /* use @FT_LOAD_COLOR. */
- /* */
-#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
-#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
-#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
-#define FT_FACE_FLAG_SFNT ( 1L << 3 )
-#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
-#define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
-#define FT_FACE_FLAG_KERNING ( 1L << 6 )
-#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
-#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
-#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
-#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
-#define FT_FACE_FLAG_HINTER ( 1L << 11 )
-#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
-#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
-#define FT_FACE_FLAG_COLOR ( 1L << 14 )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_HORIZONTAL( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains
- * horizontal metrics (this is true for all font formats though).
- *
- * @also:
- * @FT_HAS_VERTICAL can be used to check for vertical metrics.
- *
- */
-#define FT_HAS_HORIZONTAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_VERTICAL( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains real
- * vertical metrics (and not only synthesized ones).
- *
- */
-#define FT_HAS_VERTICAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_VERTICAL )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_KERNING( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains kerning
- * data that can be accessed with @FT_Get_Kerning.
- *
- */
-#define FT_HAS_KERNING( face ) \
- ( face->face_flags & FT_FACE_FLAG_KERNING )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_SCALABLE( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a scalable
- * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
- * and PFR font formats.
- *
- */
-#define FT_IS_SCALABLE( face ) \
- ( face->face_flags & FT_FACE_FLAG_SCALABLE )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_SFNT( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a font
- * whose format is based on the SFNT storage scheme. This usually
- * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
- * bitmap fonts.
- *
- * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
- * @FT_TRUETYPE_TABLES_H are available.
- *
- */
-#define FT_IS_SFNT( face ) \
- ( face->face_flags & FT_FACE_FLAG_SFNT )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_FIXED_WIDTH( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a font face
- * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
- * glyphs.
- *
- */
-#define FT_IS_FIXED_WIDTH( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_FIXED_SIZES( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some
- * embedded bitmaps. See the `available_sizes' field of the
- * @FT_FaceRec structure.
- *
- */
-#define FT_HAS_FIXED_SIZES( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_FAST_GLYPHS( face )
- *
- * @description:
- * Deprecated.
- *
- */
-#define FT_HAS_FAST_GLYPHS( face ) 0
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_GLYPH_NAMES( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some glyph
- * names that can be accessed through @FT_Get_Glyph_Name.
- *
- */
-#define FT_HAS_GLYPH_NAMES( face ) \
- ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_MULTIPLE_MASTERS( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some
- * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
- * are then available to choose the exact design you want.
- *
- */
-#define FT_HAS_MULTIPLE_MASTERS( face ) \
- ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_CID_KEYED( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a CID-keyed
- * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
- * details.
- *
- * If this macro is true, all functions defined in @FT_CID_H are
- * available.
- *
- */
-#define FT_IS_CID_KEYED( face ) \
- ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_TRICKY( face )
- *
- * @description:
- * A macro that returns true whenever a face represents a `tricky' font.
- * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
- *
- */
-#define FT_IS_TRICKY( face ) \
- ( face->face_flags & FT_FACE_FLAG_TRICKY )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_COLOR( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains
- * tables for color glyphs.
- *
- */
-#define FT_HAS_COLOR( face ) \
- ( face->face_flags & FT_FACE_FLAG_COLOR )
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* FT_STYLE_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit-flags used to indicate the style of a given face. */
- /* These are used in the `style_flags' field of @FT_FaceRec. */
- /* */
- /* <Values> */
- /* FT_STYLE_FLAG_ITALIC :: */
- /* Indicates that a given face style is italic or oblique. */
- /* */
- /* FT_STYLE_FLAG_BOLD :: */
- /* Indicates that a given face is bold. */
- /* */
- /* <Note> */
- /* The style information as provided by FreeType is very basic. More */
- /* details are beyond the scope and should be done on a higher level */
- /* (for example, by analyzing various fields of the `OS/2' table in */
- /* SFNT based fonts). */
- /* */
-#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
-#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
- /* model private data of a given @FT_Size object. */
- /* */
- typedef struct FT_Size_InternalRec_* FT_Size_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_Metrics */
- /* */
- /* <Description> */
- /* The size metrics structure gives the metrics of a size object. */
- /* */
- /* <Fields> */
- /* x_ppem :: The width of the scaled EM square in pixels, hence */
- /* the term `ppem' (pixels per EM). It is also */
- /* referred to as `nominal width'. */
- /* */
- /* y_ppem :: The height of the scaled EM square in pixels, */
- /* hence the term `ppem' (pixels per EM). It is also */
- /* referred to as `nominal height'. */
- /* */
- /* x_scale :: A 16.16 fractional scaling value used to convert */
- /* horizontal metrics from font units to 26.6 */
- /* fractional pixels. Only relevant for scalable */
- /* font formats. */
- /* */
- /* y_scale :: A 16.16 fractional scaling value used to convert */
- /* vertical metrics from font units to 26.6 */
- /* fractional pixels. Only relevant for scalable */
- /* font formats. */
- /* */
- /* ascender :: The ascender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* descender :: The descender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* height :: The height in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* max_advance :: The maximum advance width in 26.6 fractional */
- /* pixels. See @FT_FaceRec for the details. */
- /* */
- /* <Note> */
- /* The scaling values, if relevant, are determined first during a */
- /* size changing operation. The remaining fields are then set by the */
- /* driver. For scalable formats, they are usually set to scaled */
- /* values of the corresponding fields in @FT_FaceRec. */
- /* */
- /* Note that due to glyph hinting, these values might not be exact */
- /* for certain fonts. Thus they must be treated as unreliable */
- /* with an error margin of at least one pixel! */
- /* */
- /* Indeed, the only way to get the exact metrics is to render _all_ */
- /* glyphs. As this would be a definite performance hit, it is up to */
- /* client applications to perform such computations. */
- /* */
- /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
- /* */
- typedef struct FT_Size_Metrics_
- {
- FT_UShort x_ppem; /* horizontal pixels per EM */
- FT_UShort y_ppem; /* vertical pixels per EM */
-
- FT_Fixed x_scale; /* scaling values used to convert font */
- FT_Fixed y_scale; /* units to 26.6 fractional pixels */
-
- FT_Pos ascender; /* ascender in 26.6 frac. pixels */
- FT_Pos descender; /* descender in 26.6 frac. pixels */
- FT_Pos height; /* text height in 26.6 frac. pixels */
- FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
-
- } FT_Size_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SizeRec */
- /* */
- /* <Description> */
- /* FreeType root size class structure. A size object models a face */
- /* object at a given size. */
- /* */
- /* <Fields> */
- /* face :: Handle to the parent face object. */
- /* */
- /* generic :: A typeless pointer, unused by the FreeType library or */
- /* any of its drivers. It can be used by client */
- /* applications to link their own data to each size */
- /* object. */
- /* */
- /* metrics :: Metrics for this size object. This field is read-only. */
- /* */
- typedef struct FT_SizeRec_
- {
- FT_Face face; /* parent face object */
- FT_Generic generic; /* generic pointer for client uses */
- FT_Size_Metrics metrics; /* size metrics */
- FT_Size_Internal internal;
-
- } FT_SizeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SubGlyph */
- /* */
- /* <Description> */
- /* The subglyph structure is an internal object used to describe */
- /* subglyphs (for example, in the case of composites). */
- /* */
- /* <Note> */
- /* The subglyph implementation is not part of the high-level API, */
- /* hence the forward structure declaration. */
- /* */
- /* You can however retrieve subglyph information with */
- /* @FT_Get_SubGlyph_Info. */
- /* */
- typedef struct FT_SubGlyphRec_* FT_SubGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Slot_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
- /* model private data of a given @FT_GlyphSlot object. */
- /* */
- typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphSlotRec */
- /* */
- /* <Description> */
- /* FreeType root glyph slot class structure. A glyph slot is a */
- /* container where individual glyphs can be loaded, be they in */
- /* outline or bitmap format. */
- /* */
- /* <Fields> */
- /* library :: A handle to the FreeType library instance */
- /* this slot belongs to. */
- /* */
- /* face :: A handle to the parent face object. */
- /* */
- /* next :: In some cases (like some font tools), several */
- /* glyph slots per face object can be a good */
- /* thing. As this is rare, the glyph slots are */
- /* listed through a direct, single-linked list */
- /* using its `next' field. */
- /* */
- /* generic :: A typeless pointer unused by the FreeType */
- /* library or any of its drivers. It can be */
- /* used by client applications to link their own */
- /* data to each glyph slot object. */
- /* */
- /* metrics :: The metrics of the last loaded glyph in the */
- /* slot. The returned values depend on the last */
- /* load flags (see the @FT_Load_Glyph API */
- /* function) and can be expressed either in 26.6 */
- /* fractional pixels or font units. */
- /* */
- /* Note that even when the glyph image is */
- /* transformed, the metrics are not. */
- /* */
- /* linearHoriAdvance :: The advance width of the unhinted glyph. */
- /* Its value is expressed in 16.16 fractional */
- /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
- /* when loading the glyph. This field can be */
- /* important to perform correct WYSIWYG layout. */
- /* Only relevant for outline glyphs. */
- /* */
- /* linearVertAdvance :: The advance height of the unhinted glyph. */
- /* Its value is expressed in 16.16 fractional */
- /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
- /* when loading the glyph. This field can be */
- /* important to perform correct WYSIWYG layout. */
- /* Only relevant for outline glyphs. */
- /* */
- /* advance :: This shorthand is, depending on */
- /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
- /* (hinted) advance width for the glyph, in 26.6 */
- /* fractional pixel format. As specified with */
- /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
- /* `horiAdvance' or the `vertAdvance' value of */
- /* `metrics' field. */
- /* */
- /* format :: This field indicates the format of the image */
- /* contained in the glyph slot. Typically */
- /* @FT_GLYPH_FORMAT_BITMAP, */
- /* @FT_GLYPH_FORMAT_OUTLINE, or */
- /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
- /* possible. */
- /* */
- /* bitmap :: This field is used as a bitmap descriptor */
- /* when the slot format is */
- /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
- /* address and content of the bitmap buffer can */
- /* change between calls of @FT_Load_Glyph and a */
- /* few other functions. */
- /* */
- /* bitmap_left :: The bitmap's left bearing expressed in */
- /* integer pixels. Only valid if the format is */
- /* @FT_GLYPH_FORMAT_BITMAP, this is, if the */
- /* glyph slot contains a bitmap. */
- /* */
- /* bitmap_top :: The bitmap's top bearing expressed in integer */
- /* pixels. Remember that this is the distance */
- /* from the baseline to the top-most glyph */
- /* scanline, upwards y~coordinates being */
- /* *positive*. */
- /* */
- /* outline :: The outline descriptor for the current glyph */
- /* image if its format is */
- /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
- /* loaded, `outline' can be transformed, */
- /* distorted, embolded, etc. However, it must */
- /* not be freed. */
- /* */
- /* num_subglyphs :: The number of subglyphs in a composite glyph. */
- /* This field is only valid for the composite */
- /* glyph format that should normally only be */
- /* loaded with the @FT_LOAD_NO_RECURSE flag. */
- /* */
- /* subglyphs :: An array of subglyph descriptors for */
- /* composite glyphs. There are `num_subglyphs' */
- /* elements in there. Currently internal to */
- /* FreeType. */
- /* */
- /* control_data :: Certain font drivers can also return the */
- /* control data for a given glyph image (e.g. */
- /* TrueType bytecode, Type~1 charstrings, etc.). */
- /* This field is a pointer to such data. */
- /* */
- /* control_len :: This is the length in bytes of the control */
- /* data. */
- /* */
- /* other :: Really wicked formats can use this pointer to */
- /* present their own glyph image to client */
- /* applications. Note that the application */
- /* needs to know about the image format. */
- /* */
- /* lsb_delta :: The difference between hinted and unhinted */
- /* left side bearing while autohinting is */
- /* active. Zero otherwise. */
- /* */
- /* rsb_delta :: The difference between hinted and unhinted */
- /* right side bearing while autohinting is */
- /* active. Zero otherwise. */
- /* */
- /* <Note> */
- /* If @FT_Load_Glyph is called with default flags (see */
- /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
- /* its native format (e.g., an outline glyph for TrueType and Type~1 */
- /* formats). */
- /* */
- /* This image can later be converted into a bitmap by calling */
- /* @FT_Render_Glyph. This function finds the current renderer for */
- /* the native image's format, then invokes it. */
- /* */
- /* The renderer is in charge of transforming the native image through */
- /* the slot's face transformation fields, then converting it into a */
- /* bitmap that is returned in `slot->bitmap'. */
- /* */
- /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
- /* to specify the position of the bitmap relative to the current pen */
- /* position (e.g., coordinates (0,0) on the baseline). Of course, */
- /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
- /* */
- /* <Note> */
- /* Here a small pseudo code fragment that shows how to use */
- /* `lsb_delta' and `rsb_delta': */
- /* */
- /* { */
- /* FT_Pos origin_x = 0; */
- /* FT_Pos prev_rsb_delta = 0; */
- /* */
- /* */
- /* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
- /* */
- /* <load glyph with `FT_Load_Glyph'> */
- /* */
- /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
- /* origin_x -= 64; */
- /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
- /* origin_x += 64; */
- /* */
- /* prev_rsb_delta = face->glyph->rsb_delta; */
- /* */
- /* <save glyph image, or render glyph, or ...> */
- /* */
- /* origin_x += face->glyph->advance.x; */
- /* endfor */
- /* } */
- /* */
- typedef struct FT_GlyphSlotRec_
- {
- FT_Library library;
- FT_Face face;
- FT_GlyphSlot next;
- FT_UInt reserved; /* retained for binary compatibility */
- FT_Generic generic;
-
- FT_Glyph_Metrics metrics;
- FT_Fixed linearHoriAdvance;
- FT_Fixed linearVertAdvance;
- FT_Vector advance;
-
- FT_Glyph_Format format;
-
- FT_Bitmap bitmap;
- FT_Int bitmap_left;
- FT_Int bitmap_top;
-
- FT_Outline outline;
-
- FT_UInt num_subglyphs;
- FT_SubGlyph subglyphs;
-
- void* control_data;
- long control_len;
-
- FT_Pos lsb_delta;
- FT_Pos rsb_delta;
-
- void* other;
-
- FT_Slot_Internal internal;
-
- } FT_GlyphSlotRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* F U N C T I O N S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Init_FreeType */
- /* */
- /* <Description> */
- /* Initialize a new FreeType library object. The set of modules */
- /* that are registered by this function is determined at build time. */
- /* */
- /* <Output> */
- /* alibrary :: A handle to a new library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* In case you want to provide your own memory allocating routines, */
- /* use @FT_New_Library instead, followed by a call to */
- /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
- /* */
- /* For multi-threading applications each thread should have its own */
- /* FT_Library object. */
- /* */
- /* If you need reference-counting (cf. @FT_Reference_Library), use */
- /* @FT_New_Library and @FT_Done_Library. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Init_FreeType( FT_Library *alibrary );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_FreeType */
- /* */
- /* <Description> */
- /* Destroy a given FreeType library object and all of its children, */
- /* including resources, drivers, faces, sizes, etc. */
- /* */
- /* <Input> */
- /* library :: A handle to the target library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_FreeType( FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_OPEN_XXX */
- /* */
- /* <Description> */
- /* A list of bit-field constants used within the `flags' field of the */
- /* @FT_Open_Args structure. */
- /* */
- /* <Values> */
- /* FT_OPEN_MEMORY :: This is a memory-based stream. */
- /* */
- /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
- /* */
- /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
- /* name. */
- /* */
- /* FT_OPEN_DRIVER :: Use the `driver' field. */
- /* */
- /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
- /* */
- /* <Note> */
- /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
- /* flags are mutually exclusive. */
- /* */
-#define FT_OPEN_MEMORY 0x1
-#define FT_OPEN_STREAM 0x2
-#define FT_OPEN_PATHNAME 0x4
-#define FT_OPEN_DRIVER 0x8
-#define FT_OPEN_PARAMS 0x10
-
-
- /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */
- /* values instead */
-#define ft_open_memory FT_OPEN_MEMORY
-#define ft_open_stream FT_OPEN_STREAM
-#define ft_open_pathname FT_OPEN_PATHNAME
-#define ft_open_driver FT_OPEN_DRIVER
-#define ft_open_params FT_OPEN_PARAMS
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Parameter */
- /* */
- /* <Description> */
- /* A simple structure used to pass more or less generic parameters to */
- /* @FT_Open_Face. */
- /* */
- /* <Fields> */
- /* tag :: A four-byte identification tag. */
- /* */
- /* data :: A pointer to the parameter data. */
- /* */
- /* <Note> */
- /* The ID and function of parameters are driver-specific. See the */
- /* various FT_PARAM_TAG_XXX flags for more information. */
- /* */
- typedef struct FT_Parameter_
- {
- FT_ULong tag;
- FT_Pointer data;
-
- } FT_Parameter;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Open_Args */
- /* */
- /* <Description> */
- /* A structure used to indicate how to open a new font file or */
- /* stream. A pointer to such a structure can be used as a parameter */
- /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
- /* */
- /* <Fields> */
- /* flags :: A set of bit flags indicating how to use the */
- /* structure. */
- /* */
- /* memory_base :: The first byte of the file in memory. */
- /* */
- /* memory_size :: The size in bytes of the file in memory. */
- /* */
- /* pathname :: A pointer to an 8-bit file pathname. */
- /* */
- /* stream :: A handle to a source stream object. */
- /* */
- /* driver :: This field is exclusively used by @FT_Open_Face; */
- /* it simply specifies the font driver to use to open */
- /* the face. If set to~0, FreeType tries to load the */
- /* face with each one of the drivers in its list. */
- /* */
- /* num_params :: The number of extra parameters. */
- /* */
- /* params :: Extra parameters passed to the font driver when */
- /* opening a new face. */
- /* */
- /* <Note> */
- /* The stream type is determined by the contents of `flags' that */
- /* are tested in the following order by @FT_Open_Face: */
- /* */
- /* If the @FT_OPEN_MEMORY bit is set, assume that this is a */
- /* memory file of `memory_size' bytes, located at `memory_address'. */
- /* The data are are not copied, and the client is responsible for */
- /* releasing and destroying them _after_ the corresponding call to */
- /* @FT_Done_Face. */
- /* */
- /* Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a */
- /* custom input stream `stream' is used. */
- /* */
- /* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this */
- /* is a normal file and use `pathname' to open it. */
- /* */
- /* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to */
- /* open the file with the driver whose handler is in `driver'. */
- /* */
- /* If the @FT_OPEN_PARAMS bit is set, the parameters given by */
- /* `num_params' and `params' is used. They are ignored otherwise. */
- /* */
- /* Ideally, both the `pathname' and `params' fields should be tagged */
- /* as `const'; this is missing for API backwards compatibility. In */
- /* other words, applications should treat them as read-only. */
- /* */
- typedef struct FT_Open_Args_
- {
- FT_UInt flags;
- const FT_Byte* memory_base;
- FT_Long memory_size;
- FT_String* pathname;
- FT_Stream stream;
- FT_Module driver;
- FT_Int num_params;
- FT_Parameter* params;
-
- } FT_Open_Args;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face */
- /* */
- /* <Description> */
- /* This function calls @FT_Open_Face to open a font by its pathname. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* pathname :: A path to the font file. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See @FT_Open_Face for more details. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Use @FT_Done_Face to destroy the created @FT_Face object (along */
- /* with its slot and sizes). */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face( FT_Library library,
- const char* filepathname,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Memory_Face */
- /* */
- /* <Description> */
- /* This function calls @FT_Open_Face to open a font that has been */
- /* loaded into memory. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* file_base :: A pointer to the beginning of the font data. */
- /* */
- /* file_size :: The size of the memory chunk used by the font data. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See @FT_Open_Face for more details. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You must not deallocate the memory before calling @FT_Done_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Memory_Face( FT_Library library,
- const FT_Byte* file_base,
- FT_Long file_size,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Open_Face */
- /* */
- /* <Description> */
- /* Create a face object from a given resource described by */
- /* @FT_Open_Args. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* args :: A pointer to an `FT_Open_Args' structure that must */
- /* be filled by the caller. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See note below. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Unlike FreeType 1.x, this function automatically creates a glyph */
- /* slot for the face object that can be accessed directly through */
- /* `face->glyph'. */
- /* */
- /* FT_Open_Face can be used to quickly check whether the font */
- /* format of a given font resource is supported by FreeType. If the */
- /* `face_index' field is negative, the function's return value is~0 */
- /* if the font format is recognized, or non-zero otherwise; */
- /* the function returns a more or less empty face handle in `*aface' */
- /* (if `aface' isn't NULL). The only useful field in this special */
- /* case is `face->num_faces' that gives the number of faces within */
- /* the font file. After examination, the returned @FT_Face structure */
- /* should be deallocated with a call to @FT_Done_Face. */
- /* */
- /* Each new face object created with this function also owns a */
- /* default @FT_Size object, accessible as `face->size'. */
- /* */
- /* One @FT_Library instance can have multiple face objects, this is, */
- /* @FT_Open_Face and its siblings can be called multiple times using */
- /* the same `library' argument. */
- /* */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Open_Face( FT_Library library,
- const FT_Open_Args* args,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_File */
- /* */
- /* <Description> */
- /* This function calls @FT_Attach_Stream to attach a file. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* filepathname :: The pathname. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Attach_File( FT_Face face,
- const char* filepathname );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_Stream */
- /* */
- /* <Description> */
- /* `Attach' data to a face object. Normally, this is used to read */
- /* additional information for the face object. For example, you can */
- /* attach an AFM file that comes with a Type~1 font to get the */
- /* kerning values and other metrics. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* parameters :: A pointer to @FT_Open_Args that must be filled by */
- /* the caller. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The meaning of the `attach' (i.e., what really happens when the */
- /* new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they are doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Attach_Stream( FT_Face face,
- FT_Open_Args* parameters );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Reference_Face */
- /* */
- /* <Description> */
- /* A counter gets initialized to~1 at the time an @FT_Face structure */
- /* is created. This function increments the counter. @FT_Done_Face */
- /* then only destroys a face if the counter is~1, otherwise it simply */
- /* decrements the counter. */
- /* */
- /* This function helps in managing life-cycles of structures that */
- /* reference @FT_Face objects. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Since> */
- /* 2.4.2 */
- /* */
- FT_EXPORT( FT_Error )
- FT_Reference_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Face */
- /* */
- /* <Description> */
- /* Discard a given face object, as well as all of its child slots and */
- /* sizes. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Size */
- /* */
- /* <Description> */
- /* Select a bitmap strike. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* strike_index :: The index of the bitmap strike in the */
- /* `available_sizes' field of @FT_FaceRec structure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Select_Size( FT_Face face,
- FT_Int strike_index );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Size_Request_Type */
- /* */
- /* <Description> */
- /* An enumeration type that lists the supported size request types. */
- /* */
- /* <Values> */
- /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
- /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
- /* used to determine both scaling values. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
- /* The real dimension. The sum of the the `ascender' and (minus */
- /* of) the `descender' fields of @FT_FaceRec are used to determine */
- /* both scaling values. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_BBOX :: */
- /* The font bounding box. The width and height of the `bbox' field */
- /* of @FT_FaceRec are used to determine the horizontal and vertical */
- /* scaling value, respectively. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_CELL :: */
- /* The `max_advance_width' field of @FT_FaceRec is used to */
- /* determine the horizontal scaling value; the vertical scaling */
- /* value is determined the same way as */
- /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
- /* values are set to the smaller one. This type is useful if you */
- /* want to specify the font size for, say, a window of a given */
- /* dimension and 80x24 cells. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_SCALES :: */
- /* Specify the scaling values directly. */
- /* */
- /* <Note> */
- /* The above descriptions only apply to scalable formats. For bitmap */
- /* formats, the behaviour is up to the driver. */
- /* */
- /* See the note section of @FT_Size_Metrics if you wonder how size */
- /* requesting relates to scaling values. */
- /* */
- typedef enum FT_Size_Request_Type_
- {
- FT_SIZE_REQUEST_TYPE_NOMINAL,
- FT_SIZE_REQUEST_TYPE_REAL_DIM,
- FT_SIZE_REQUEST_TYPE_BBOX,
- FT_SIZE_REQUEST_TYPE_CELL,
- FT_SIZE_REQUEST_TYPE_SCALES,
-
- FT_SIZE_REQUEST_TYPE_MAX
-
- } FT_Size_Request_Type;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_RequestRec */
- /* */
- /* <Description> */
- /* A structure used to model a size request. */
- /* */
- /* <Fields> */
- /* type :: See @FT_Size_Request_Type. */
- /* */
- /* width :: The desired width. */
- /* */
- /* height :: The desired height. */
- /* */
- /* horiResolution :: The horizontal resolution. If set to zero, */
- /* `width' is treated as a 26.6 fractional pixel */
- /* value. */
- /* */
- /* vertResolution :: The vertical resolution. If set to zero, */
- /* `height' is treated as a 26.6 fractional pixel */
- /* value. */
- /* */
- /* <Note> */
- /* If `width' is zero, then the horizontal scaling value is set equal */
- /* to the vertical scaling value, and vice versa. */
- /* */
- typedef struct FT_Size_RequestRec_
- {
- FT_Size_Request_Type type;
- FT_Long width;
- FT_Long height;
- FT_UInt horiResolution;
- FT_UInt vertResolution;
-
- } FT_Size_RequestRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_Request */
- /* */
- /* <Description> */
- /* A handle to a size request structure. */
- /* */
- typedef struct FT_Size_RequestRec_ *FT_Size_Request;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Request_Size */
- /* */
- /* <Description> */
- /* Resize the scale of the active @FT_Size object in a face. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* req :: A pointer to a @FT_Size_RequestRec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Although drivers may select the bitmap strike matching the */
- /* request, you should not rely on this if you intend to select a */
- /* particular bitmap strike. Use @FT_Select_Size instead in that */
- /* case. */
- /* */
- /* The relation between the requested size and the resulting glyph */
- /* size is dependent entirely on how the size is defined in the */
- /* source face. The font designer chooses the final size of each */
- /* glyph relative to this size. For more information refer to */
- /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
- /* */
- /* Don't use this function if you are using the FreeType cache API. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Request_Size( FT_Face face,
- FT_Size_Request req );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Char_Size */
- /* */
- /* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in points). */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* char_width :: The nominal width, in 26.6 fractional points. */
- /* */
- /* char_height :: The nominal height, in 26.6 fractional points. */
- /* */
- /* horz_resolution :: The horizontal resolution in dpi. */
- /* */
- /* vert_resolution :: The vertical resolution in dpi. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If either the character width or height is zero, it is set equal */
- /* to the other value. */
- /* */
- /* If either the horizontal or vertical resolution is zero, it is set */
- /* equal to the other value. */
- /* */
- /* A character width or height smaller than 1pt is set to 1pt; if */
- /* both resolution values are zero, they are set to 72dpi. */
- /* */
- /* Don't use this function if you are using the FreeType cache API. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Char_Size( FT_Face face,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Pixel_Sizes */
- /* */
- /* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in pixels). */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* pixel_width :: The nominal width, in pixels. */
- /* */
- /* pixel_height :: The nominal height, in pixels. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You should not rely on the resulting glyphs matching, or being */
- /* constrained, to this pixel size. Refer to @FT_Request_Size to */
- /* understand how requested sizes relate to actual sizes. */
- /* */
- /* Don't use this function if you are using the FreeType cache API. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Pixel_Sizes( FT_Face face,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Glyph */
- /* */
- /* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object where the glyph */
- /* is loaded. */
- /* */
- /* <Input> */
- /* glyph_index :: The index of the glyph in the font file. For */
- /* CID-keyed fonts (either in PS or in CFF format) */
- /* this argument specifies the CID value. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* @FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The loaded glyph may be transformed. See @FT_Set_Transform for */
- /* the details. */
- /* */
- /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
- /* returned for invalid CID values (this is, for CID values that */
- /* don't have a corresponding glyph in the font). See the discussion */
- /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Load_Glyph( FT_Face face,
- FT_UInt glyph_index,
- FT_Int32 load_flags );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Char */
- /* */
- /* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object, according to its character code. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object where the glyph */
- /* is loaded. */
- /* */
- /* <Input> */
- /* char_code :: The glyph's character code, according to the */
- /* current charmap used in the face. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* @FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Load_Char( FT_Face face,
- FT_ULong char_code,
- FT_Int32 load_flags );
-
-
- /*************************************************************************
- *
- * @enum:
- * FT_LOAD_XXX
- *
- * @description:
- * A list of bit-field constants used with @FT_Load_Glyph to indicate
- * what kind of operations to perform during glyph loading.
- *
- * @values:
- * FT_LOAD_DEFAULT ::
- * Corresponding to~0, this value is used as the default glyph load
- * operation. In this case, the following happens:
- *
- * 1. FreeType looks for a bitmap for the glyph corresponding to the
- * face's current size. If one is found, the function returns.
- * The bitmap data can be accessed from the glyph slot (see note
- * below).
- *
- * 2. If no embedded bitmap is searched or found, FreeType looks for a
- * scalable outline. If one is found, it is loaded from the font
- * file, scaled to device pixels, then `hinted' to the pixel grid
- * in order to optimize it. The outline data can be accessed from
- * the glyph slot (see note below).
- *
- * Note that by default, the glyph loader doesn't render outlines into
- * bitmaps. The following flags are used to modify this default
- * behaviour to more specific and useful cases.
- *
- * FT_LOAD_NO_SCALE ::
- * Don't scale the loaded outline glyph but keep it in font units.
- *
- * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
- * unsets @FT_LOAD_RENDER.
- *
- * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
- * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
- * subglyphs must be scaled and positioned with hinting instructions.
- * This can be solved by loading the font without FT_LOAD_NO_SCALE and
- * setting the character size to `font->units_per_EM'.
- *
- * FT_LOAD_NO_HINTING ::
- * Disable hinting. This generally generates `blurrier' bitmap glyphs
- * when the glyph are rendered in any of the anti-aliased modes. See
- * also the note below.
- *
- * This flag is implied by @FT_LOAD_NO_SCALE.
- *
- * FT_LOAD_RENDER ::
- * Call @FT_Render_Glyph after the glyph is loaded. By default, the
- * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
- * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
- *
- * This flag is unset by @FT_LOAD_NO_SCALE.
- *
- * FT_LOAD_NO_BITMAP ::
- * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
- * flag.
- *
- * @FT_LOAD_NO_SCALE always sets this flag.
- *
- * FT_LOAD_VERTICAL_LAYOUT ::
- * Load the glyph for vertical text layout. In particular, the
- * `advance' value in the @FT_GlyphSlotRec structure is set to the
- * `vertAdvance' value of the `metrics' field.
- *
- * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
- * this flag currently. Reason is that in this case vertical metrics
- * get synthesized, and those values are not always consistent across
- * various font formats.
- *
- * FT_LOAD_FORCE_AUTOHINT ::
- * Indicates that the auto-hinter is preferred over the font's native
- * hinter. See also the note below.
- *
- * FT_LOAD_PEDANTIC ::
- * Indicates that the font driver should perform pedantic verifications
- * during glyph loading. This is mostly used to detect broken glyphs
- * in fonts. By default, FreeType tries to handle broken fonts also.
- *
- * In particular, errors from the TrueType bytecode engine are not
- * passed to the application if this flag is not set; this might
- * result in partially hinted or distorted glyphs in case a glyph's
- * bytecode is buggy.
- *
- * FT_LOAD_NO_RECURSE ::
- * Indicate that the font driver should not load composite glyphs
- * recursively. Instead, it should set the `num_subglyph' and
- * `subglyphs' values of the glyph slot accordingly, and set
- * `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE. The description of
- * subglyphs can then be accessed with @FT_Get_SubGlyph_Info.
- *
- * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
- *
- * FT_LOAD_IGNORE_TRANSFORM ::
- * Indicates that the transform matrix set by @FT_Set_Transform should
- * be ignored.
- *
- * FT_LOAD_MONOCHROME ::
- * This flag is used with @FT_LOAD_RENDER to indicate that you want to
- * render an outline glyph to a 1-bit monochrome bitmap glyph, with
- * 8~pixels packed into each byte of the bitmap data.
- *
- * Note that this has no effect on the hinting algorithm used. You
- * should rather use @FT_LOAD_TARGET_MONO so that the
- * monochrome-optimized hinting algorithm is used.
- *
- * FT_LOAD_LINEAR_DESIGN ::
- * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
- * fields of @FT_GlyphSlotRec should be kept in font units. See
- * @FT_GlyphSlotRec for details.
- *
- * FT_LOAD_NO_AUTOHINT ::
- * Disable auto-hinter. See also the note below.
- *
- * FT_LOAD_COLOR ::
- * This flag is used to request loading of color embedded-bitmap
- * images. The resulting color bitmaps, if available, will have the
- * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
- * bitmaps are found, they will be converted to 256-level gray
- * bitmaps transparently. Those bitmaps will be in the
- * @FT_PIXEL_MODE_GRAY format.
- *
- * FT_LOAD_CROP_BITMAP ::
- * Ignored. Deprecated.
- *
- * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
- * Ignored. Deprecated.
- *
- * @note:
- * By default, hinting is enabled and the font's native hinter (see
- * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
- * disable hinting by setting @FT_LOAD_NO_HINTING or change the
- * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
- * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
- * used at all.
- *
- * See the description of @FT_FACE_FLAG_TRICKY for a special exception
- * (affecting only a handful of Asian fonts).
- *
- * Besides deciding which hinter to use, you can also decide which
- * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
- *
- * Note that the auto-hinter needs a valid Unicode cmap (either a native
- * one or synthesized by FreeType) for producing correct results. If a
- * font provides an incorrect mapping (for example, assigning the
- * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
- * mathematical integral sign), the auto-hinter might produce useless
- * results.
- *
- */
-#define FT_LOAD_DEFAULT 0x0
-#define FT_LOAD_NO_SCALE ( 1L << 0 )
-#define FT_LOAD_NO_HINTING ( 1L << 1 )
-#define FT_LOAD_RENDER ( 1L << 2 )
-#define FT_LOAD_NO_BITMAP ( 1L << 3 )
-#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
-#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
-#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
-#define FT_LOAD_PEDANTIC ( 1L << 7 )
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
-#define FT_LOAD_NO_RECURSE ( 1L << 10 )
-#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
-#define FT_LOAD_MONOCHROME ( 1L << 12 )
-#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
-#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
- /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
-#define FT_LOAD_COLOR ( 1L << 20 )
-
- /* */
-
- /* used internally only by certain font drivers! */
-#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
-#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_LOAD_TARGET_XXX
- *
- * @description:
- * A list of values that are used to select a specific hinting algorithm
- * to use by the hinter. You should OR one of these values to your
- * `load_flags' when calling @FT_Load_Glyph.
- *
- * Note that font's native hinters may ignore the hinting algorithm you
- * have specified (e.g., the TrueType bytecode interpreter). You can set
- * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
- *
- * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
- * always implies @FT_LOAD_FORCE_AUTOHINT.
- *
- * @values:
- * FT_LOAD_TARGET_NORMAL ::
- * This corresponds to the default hinting algorithm, optimized for
- * standard gray-level rendering. For monochrome output, use
- * @FT_LOAD_TARGET_MONO instead.
- *
- * FT_LOAD_TARGET_LIGHT ::
- * A lighter hinting algorithm for non-monochrome modes. Many
- * generated glyphs are more fuzzy but better resemble its original
- * shape. A bit like rendering on Mac OS~X.
- *
- * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
- *
- * FT_LOAD_TARGET_MONO ::
- * Strong hinting algorithm that should only be used for monochrome
- * output. The result is probably unpleasant if the glyph is rendered
- * in non-monochrome modes.
- *
- * FT_LOAD_TARGET_LCD ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
- * decimated LCD displays.
- *
- * FT_LOAD_TARGET_LCD_V ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
- * decimated LCD displays.
- *
- * @note:
- * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
- * `load_flags'. They can't be ORed.
- *
- * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
- * corresponding mode (i.e., the mode that matches the used algorithm
- * best). An exeption is FT_LOAD_TARGET_MONO since it implies
- * @FT_LOAD_MONOCHROME.
- *
- * You can use a hinting algorithm that doesn't correspond to the same
- * rendering mode. As an example, it is possible to use the `light'
- * hinting algorithm and have the results rendered in horizontal LCD
- * pixel mode, with code like
- *
- * {
- * FT_Load_Glyph( face, glyph_index,
- * load_flags | FT_LOAD_TARGET_LIGHT );
- *
- * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
- * }
- *
- */
-#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
-
-#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
-#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
-#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
-#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
-#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
-
-
- /**************************************************************************
- *
- * @macro:
- * FT_LOAD_TARGET_MODE
- *
- * @description:
- * Return the @FT_Render_Mode corresponding to a given
- * @FT_LOAD_TARGET_XXX value.
- *
- */
-#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Transform */
- /* */
- /* <Description> */
- /* A function used to set the transformation that is applied to glyph */
- /* images when they are loaded into a glyph slot through */
- /* @FT_Load_Glyph. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
- /* the identity matrix. */
- /* delta :: A pointer to the translation vector. Use~0 for the null */
- /* vector. */
- /* */
- /* <Note> */
- /* The transformation is only applied to scalable image formats after */
- /* the glyph has been loaded. It means that hinting is unaltered by */
- /* the transformation and is performed on the character size given in */
- /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
- /* */
- /* Note that this also transforms the `face.glyph.advance' field, but */
- /* *not* the values in `face.glyph.metrics'. */
- /* */
- FT_EXPORT( void )
- FT_Set_Transform( FT_Face face,
- FT_Matrix* matrix,
- FT_Vector* delta );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Render_Mode */
- /* */
- /* <Description> */
- /* An enumeration type that lists the render modes supported by */
- /* FreeType~2. Each mode corresponds to a specific type of scanline */
- /* conversion performed on the outline. */
- /* */
- /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
- /* field in the @FT_GlyphSlotRec structure gives the format of the */
- /* returned bitmap. */
- /* */
- /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
- /* */
- /* <Values> */
- /* FT_RENDER_MODE_NORMAL :: */
- /* This is the default render mode; it corresponds to 8-bit */
- /* anti-aliased bitmaps. */
- /* */
- /* FT_RENDER_MODE_LIGHT :: */
- /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
- /* defined as a separate value because render modes are also used */
- /* indirectly to define hinting algorithm selectors. See */
- /* @FT_LOAD_TARGET_XXX for details. */
- /* */
- /* FT_RENDER_MODE_MONO :: */
- /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
- /* opacity). */
- /* */
- /* FT_RENDER_MODE_LCD :: */
- /* This mode corresponds to horizontal RGB and BGR sub-pixel */
- /* displays like LCD screens. It produces 8-bit bitmaps that are */
- /* 3~times the width of the original glyph outline in pixels, and */
- /* which use the @FT_PIXEL_MODE_LCD mode. */
- /* */
- /* FT_RENDER_MODE_LCD_V :: */
- /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
- /* (like PDA screens, rotated LCD displays, etc.). It produces */
- /* 8-bit bitmaps that are 3~times the height of the original */
- /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
- /* */
- /* <Note> */
- /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
- /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
- /* (not active in the default builds). It is up to the caller to */
- /* either call @FT_Library_SetLcdFilter (if available) or do the */
- /* filtering itself. */
- /* */
- /* The selected render mode only affects vector glyphs of a font. */
- /* Embedded bitmaps often have a different pixel mode like */
- /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
- /* them into 8-bit pixmaps. */
- /* */
- typedef enum FT_Render_Mode_
- {
- FT_RENDER_MODE_NORMAL = 0,
- FT_RENDER_MODE_LIGHT,
- FT_RENDER_MODE_MONO,
- FT_RENDER_MODE_LCD,
- FT_RENDER_MODE_LCD_V,
-
- FT_RENDER_MODE_MAX
-
- } FT_Render_Mode;
-
-
- /* these constants are deprecated; use the corresponding */
- /* `FT_Render_Mode' values instead */
-#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
-#define ft_render_mode_mono FT_RENDER_MODE_MONO
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Render_Glyph */
- /* */
- /* <Description> */
- /* Convert a given glyph image to a bitmap. It does so by inspecting */
- /* the glyph image format, finding the relevant renderer, and */
- /* invoking it. */
- /* */
- /* <InOut> */
- /* slot :: A handle to the glyph slot containing the image to */
- /* convert. */
- /* */
- /* <Input> */
- /* render_mode :: This is the render mode used to render the glyph */
- /* image into a bitmap. See @FT_Render_Mode for a */
- /* list of possible values. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* To get meaningful results, font scaling values must be set with */
- /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Render_Glyph( FT_GlyphSlot slot,
- FT_Render_Mode render_mode );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Kerning_Mode */
- /* */
- /* <Description> */
- /* An enumeration used to specify which kerning values to return in */
- /* @FT_Get_Kerning. */
- /* */
- /* <Values> */
- /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
- /* distances (value is~0). */
- /* */
- /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
- /* distances. */
- /* */
- /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
- /* units. */
- /* */
- typedef enum FT_Kerning_Mode_
- {
- FT_KERNING_DEFAULT = 0,
- FT_KERNING_UNFITTED,
- FT_KERNING_UNSCALED
-
- } FT_Kerning_Mode;
-
-
- /* these constants are deprecated; use the corresponding */
- /* `FT_Kerning_Mode' values instead */
-#define ft_kerning_default FT_KERNING_DEFAULT
-#define ft_kerning_unfitted FT_KERNING_UNFITTED
-#define ft_kerning_unscaled FT_KERNING_UNSCALED
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Kerning */
- /* */
- /* <Description> */
- /* Return the kerning vector between two glyphs of a same face. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* left_glyph :: The index of the left glyph in the kern pair. */
- /* */
- /* right_glyph :: The index of the right glyph in the kern pair. */
- /* */
- /* kern_mode :: See @FT_Kerning_Mode for more information. */
- /* Determines the scale and dimension of the returned */
- /* kerning vector. */
- /* */
- /* <Output> */
- /* akerning :: The kerning vector. This is either in font units */
- /* or in pixels (26.6 format) for scalable formats, */
- /* and in pixels for fixed-sizes formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this method. Other layouts, or more sophisticated */
- /* kernings, are out of the scope of this API function -- they can be */
- /* implemented through format-specific interfaces. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Kerning( FT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph,
- FT_UInt kern_mode,
- FT_Vector *akerning );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Track_Kerning */
- /* */
- /* <Description> */
- /* Return the track kerning for a given face object at a given size. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* point_size :: The point size in 16.16 fractional points. */
- /* */
- /* degree :: The degree of tightness. Increasingly negative */
- /* values represent tighter track kerning, while */
- /* increasingly positive values represent looser track */
- /* kerning. Value zero means no track kerning. */
- /* */
- /* <Output> */
- /* akerning :: The kerning in 16.16 fractional points, to be */
- /* uniformly applied between all glyphs. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Currently, only the Type~1 font driver supports track kerning, */
- /* using data from AFM files (if attached with @FT_Attach_File or */
- /* @FT_Attach_Stream). */
- /* */
- /* Only very few AFM files come with track kerning data; please refer */
- /* to the Adobe's AFM specification for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Track_Kerning( FT_Face face,
- FT_Fixed point_size,
- FT_Int degree,
- FT_Fixed* akerning );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph_Name */
- /* */
- /* <Description> */
- /* Retrieve the ASCII name of a given glyph in a face. This only */
- /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* glyph_index :: The glyph index. */
- /* */
- /* buffer_max :: The maximum number of bytes available in the */
- /* buffer. */
- /* */
- /* <Output> */
- /* buffer :: A pointer to a target buffer where the name is */
- /* copied to. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* An error is returned if the face doesn't provide glyph names or if */
- /* the glyph index is invalid. In all cases of failure, the first */
- /* byte of `buffer' is set to~0 to indicate an empty name. */
- /* */
- /* The glyph name is truncated to fit within the buffer if it is too */
- /* long. The returned string is always zero-terminated. */
- /* */
- /* Be aware that FreeType reorders glyph indices internally so that */
- /* glyph index~0 always corresponds to the `missing glyph' (called */
- /* `.notdef'). */
- /* */
- /* This function always returns an error if the config macro */
- /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Glyph_Name( FT_Face face,
- FT_UInt glyph_index,
- FT_Pointer buffer,
- FT_UInt buffer_max );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Postscript_Name */
- /* */
- /* <Description> */
- /* Retrieve the ASCII PostScript name of a given face, if available. */
- /* This only works with PostScript and TrueType fonts. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* A pointer to the face's PostScript name. NULL if unavailable. */
- /* */
- /* <Note> */
- /* The returned pointer is owned by the face and is destroyed with */
- /* it. */
- /* */
- FT_EXPORT( const char* )
- FT_Get_Postscript_Name( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Charmap */
- /* */
- /* <Description> */
- /* Select a given charmap by its encoding tag (as listed in */
- /* `freetype.h'). */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* encoding :: A handle to the selected encoding. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function returns an error if no charmap in the face */
- /* corresponds to the encoding queried here. */
- /* */
- /* Because many fonts contain more than a single cmap for Unicode */
- /* encoding, this function has some special code to select the one */
- /* that covers Unicode best (`best' in the sense that a UCS-4 cmap is */
- /* preferred to a UCS-2 cmap). It is thus preferable to */
- /* @FT_Set_Charmap in this case. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Select_Charmap( FT_Face face,
- FT_Encoding encoding );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Charmap */
- /* */
- /* <Description> */
- /* Select a given charmap for character code to glyph index mapping. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* charmap :: A handle to the selected charmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function returns an error if the charmap is not part of */
- /* the face (i.e., if it is not listed in the `face->charmaps' */
- /* table). */
- /* */
- /* It also fails if a type~14 charmap is selected. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Charmap( FT_Face face,
- FT_CharMap charmap );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Get_Charmap_Index
- *
- * @description:
- * Retrieve index of a given charmap.
- *
- * @input:
- * charmap ::
- * A handle to a charmap.
- *
- * @return:
- * The index into the array of character maps within the face to which
- * `charmap' belongs. If an error occurs, -1 is returned.
- *
- */
- FT_EXPORT( FT_Int )
- FT_Get_Charmap_Index( FT_CharMap charmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Char_Index */
- /* */
- /* <Description> */
- /* Return the glyph index of a given character code. This function */
- /* uses a charmap object to do the mapping. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* charcode :: The character code. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means `undefined character code'. */
- /* */
- /* <Note> */
- /* If you use FreeType to manipulate the contents of font files */
- /* directly, be aware that the glyph index returned by this function */
- /* doesn't always correspond to the internal indices used within the */
- /* file. This is done to ensure that value~0 always corresponds to */
- /* the `missing glyph'. If the first glyph is not named `.notdef', */
- /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
- /* the glyph ID~0 position, and whatever was there will be moved to */
- /* the position `.notdef' had. For Type~1 fonts, if there is no */
- /* `.notdef' glyph at all, then one will be created at index~0 and */
- /* whatever was there will be moved to the last index -- Type~42 */
- /* fonts are considered invalid under this condition. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Char_Index( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_First_Char */
- /* */
- /* <Description> */
- /* This function is used to return the first character code in the */
- /* current charmap of a given face. It also returns the */
- /* corresponding glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Output> */
- /* agindex :: Glyph index of first character code. 0~if charmap is */
- /* empty. */
- /* */
- /* <Return> */
- /* The charmap's first character code. */
- /* */
- /* <Note> */
- /* You should use this function with @FT_Get_Next_Char to be able to */
- /* parse all character codes available in a given charmap. The code */
- /* should look like this: */
- /* */
- /* { */
- /* FT_ULong charcode; */
- /* FT_UInt gindex; */
- /* */
- /* */
- /* charcode = FT_Get_First_Char( face, &gindex ); */
- /* while ( gindex != 0 ) */
- /* { */
- /* ... do something with (charcode,gindex) pair ... */
- /* */
- /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
- /* } */
- /* } */
- /* */
- /* Note that `*agindex' is set to~0 if the charmap is empty. The */
- /* result itself can be~0 in two cases: if the charmap is empty or */
- /* if the value~0 is the first valid character code. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_First_Char( FT_Face face,
- FT_UInt *agindex );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Next_Char */
- /* */
- /* <Description> */
- /* This function is used to return the next character code in the */
- /* current charmap of a given face following the value `char_code', */
- /* as well as the corresponding glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* char_code :: The starting character code. */
- /* */
- /* <Output> */
- /* agindex :: Glyph index of next character code. 0~if charmap */
- /* is empty. */
- /* */
- /* <Return> */
- /* The charmap's next character code. */
- /* */
- /* <Note> */
- /* You should use this function with @FT_Get_First_Char to walk */
- /* over all character codes available in a given charmap. See the */
- /* note for this function for a simple code example. */
- /* */
- /* Note that `*agindex' is set to~0 when there are no more codes in */
- /* the charmap. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_Next_Char( FT_Face face,
- FT_ULong char_code,
- FT_UInt *agindex );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Name_Index */
- /* */
- /* <Description> */
- /* Return the glyph index of a given glyph name. This function uses */
- /* driver specific objects to do the translation. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* glyph_name :: The glyph name. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means `undefined character code'. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Name_Index( FT_Face face,
- FT_String* glyph_name );
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SUBGLYPH_FLAG_XXX
- *
- * @description:
- * A list of constants used to describe subglyphs. Please refer to the
- * TrueType specification for the meaning of the various flags.
- *
- * @values:
- * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
- * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
- * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
- * FT_SUBGLYPH_FLAG_SCALE ::
- * FT_SUBGLYPH_FLAG_XY_SCALE ::
- * FT_SUBGLYPH_FLAG_2X2 ::
- * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
- *
- */
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
-#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
-#define FT_SUBGLYPH_FLAG_SCALE 8
-#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
-#define FT_SUBGLYPH_FLAG_2X2 0x80
-#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
-
-
- /*************************************************************************
- *
- * @func:
- * FT_Get_SubGlyph_Info
- *
- * @description:
- * Retrieve a description of a given subglyph. Only use it if
- * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
- * returned otherwise.
- *
- * @input:
- * glyph ::
- * The source glyph slot.
- *
- * sub_index ::
- * The index of the subglyph. Must be less than
- * `glyph->num_subglyphs'.
- *
- * @output:
- * p_index ::
- * The glyph index of the subglyph.
- *
- * p_flags ::
- * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
- *
- * p_arg1 ::
- * The subglyph's first argument (if any).
- *
- * p_arg2 ::
- * The subglyph's second argument (if any).
- *
- * p_transform ::
- * The subglyph transformation (if any).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
- * interpreted depending on the flags returned in `*p_flags'. See the
- * TrueType specification for details.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
- FT_UInt sub_index,
- FT_Int *p_index,
- FT_UInt *p_flags,
- FT_Int *p_arg1,
- FT_Int *p_arg2,
- FT_Matrix *p_transform );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_FSTYPE_XXX */
- /* */
- /* <Description> */
- /* A list of bit flags used in the `fsType' field of the OS/2 table */
- /* in a TrueType or OpenType font and the `FSType' entry in a */
- /* PostScript font. These bit flags are returned by */
- /* @FT_Get_FSType_Flags; they inform client applications of embedding */
- /* and subsetting restrictions associated with a font. */
- /* */
- /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
- /* more details. */
- /* */
- /* <Values> */
- /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
- /* Fonts with no fsType bit set may be embedded and permanently */
- /* installed on the remote system by an application. */
- /* */
- /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
- /* Fonts that have only this bit set must not be modified, embedded */
- /* or exchanged in any manner without first obtaining permission of */
- /* the font software copyright owner. */
- /* */
- /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
- /* If this bit is set, the font may be embedded and temporarily */
- /* loaded on the remote system. Documents containing Preview & */
- /* Print fonts must be opened `read-only'; no edits can be applied */
- /* to the document. */
- /* */
- /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
- /* If this bit is set, the font may be embedded but must only be */
- /* installed temporarily on other systems. In contrast to Preview */
- /* & Print fonts, documents containing editable fonts may be opened */
- /* for reading, editing is permitted, and changes may be saved. */
- /* */
- /* FT_FSTYPE_NO_SUBSETTING :: */
- /* If this bit is set, the font may not be subsetted prior to */
- /* embedding. */
- /* */
- /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
- /* If this bit is set, only bitmaps contained in the font may be */
- /* embedded; no outline data may be embedded. If there are no */
- /* bitmaps available in the font, then the font is unembeddable. */
- /* */
- /* <Note> */
- /* While the fsType flags can indicate that a font may be embedded, a */
- /* license with the font vendor may be separately required to use the */
- /* font in this way. */
- /* */
-#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
-#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
-#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
-#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
-#define FT_FSTYPE_NO_SUBSETTING 0x0100
-#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_FSType_Flags */
- /* */
- /* <Description> */
- /* Return the fsType flags for a font. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* The fsType flags, @FT_FSTYPE_XXX. */
- /* */
- /* <Note> */
- /* Use this function rather than directly reading the `fs_type' field */
- /* in the @PS_FontInfoRec structure, which is only guaranteed to */
- /* return the correct results for Type~1 fonts. */
- /* */
- /* <Since> */
- /* 2.3.8 */
- /* */
- FT_EXPORT( FT_UShort )
- FT_Get_FSType_Flags( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* glyph_variants */
- /* */
- /* <Title> */
- /* Glyph Variants */
- /* */
- /* <Abstract> */
- /* The FreeType~2 interface to Unicode Ideographic Variation */
- /* Sequences (IVS), using the SFNT cmap format~14. */
- /* */
- /* <Description> */
- /* Many CJK characters have variant forms. They are a sort of grey */
- /* area somewhere between being totally irrelevant and semantically */
- /* distinct; for this reason, the Unicode consortium decided to */
- /* introduce Ideographic Variation Sequences (IVS), consisting of a */
- /* Unicode base character and one of 240 variant selectors */
- /* (U+E0100-U+E01EF), instead of further extending the already huge */
- /* code range for CJK characters. */
- /* */
- /* An IVS is registered and unique; for further details please refer */
- /* to Unicode Technical Standard #37, the Ideographic Variation */
- /* Database: */
- /* */
- /* http://www.unicode.org/reports/tr37/ */
- /* */
- /* To date (November 2014), the character with the most variants is */
- /* U+9089, having 32 such IVS. */
- /* */
- /* Adobe and MS decided to support IVS with a new cmap subtable */
- /* (format~14). It is an odd subtable because it is not a mapping of */
- /* input code points to glyphs, but contains lists of all variants */
- /* supported by the font. */
- /* */
- /* A variant may be either `default' or `non-default'. A default */
- /* variant is the one you will get for that code point if you look it */
- /* up in the standard Unicode cmap. A non-default variant is a */
- /* different glyph. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharVariantIndex */
- /* */
- /* <Description> */
- /* Return the glyph index of a given character code as modified by */
- /* the variation selector. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character code point in Unicode. */
- /* */
- /* variantSelector :: */
- /* The Unicode code point of the variation selector. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means either `undefined character code', or */
- /* `undefined selector code', or `no variation selector cmap */
- /* subtable', or `current CharMap is not Unicode'. */
- /* */
- /* <Note> */
- /* If you use FreeType to manipulate the contents of font files */
- /* directly, be aware that the glyph index returned by this function */
- /* doesn't always correspond to the internal indices used within */
- /* the file. This is done to ensure that value~0 always corresponds */
- /* to the `missing glyph'. */
- /* */
- /* This function is only meaningful if */
- /* a) the font has a variation selector cmap sub table, */
- /* and */
- /* b) the current charmap has a Unicode encoding. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Face_GetCharVariantIndex( FT_Face face,
- FT_ULong charcode,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharVariantIsDefault */
- /* */
- /* <Description> */
- /* Check whether this variant of this Unicode character is the one to */
- /* be found in the `cmap'. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character codepoint in Unicode. */
- /* */
- /* variantSelector :: */
- /* The Unicode codepoint of the variation selector. */
- /* */
- /* <Return> */
- /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
- /* variation selector cmap, or -1 if it is not a variant. */
- /* */
- /* <Note> */
- /* This function is only meaningful if the font has a variation */
- /* selector cmap subtable. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_Int )
- FT_Face_GetCharVariantIsDefault( FT_Face face,
- FT_ULong charcode,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetVariantSelectors */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
- /* in the font. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* <Return> */
- /* A pointer to an array of selector code points, or NULL if there is */
- /* no valid variant selector cmap subtable. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetVariantSelectors( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetVariantsOfChar */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
- /* for the specified character code. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character codepoint in Unicode. */
- /* */
- /* <Return> */
- /* A pointer to an array of variant selector code points that are */
- /* active for the given character, or NULL if the corresponding list */
- /* is empty. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetVariantsOfChar( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharsOfVariant */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode character codes found for */
- /* the specified variant selector. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* variantSelector :: */
- /* The variant selector code point in Unicode. */
- /* */
- /* <Return> */
- /* A list of all the code points that are specified by this selector */
- /* (both default and non-default codes are returned) or NULL if there */
- /* is no valid cmap or the variant selector is invalid. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetCharsOfVariant( FT_Face face,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /* <Title> */
- /* Computations */
- /* */
- /* <Abstract> */
- /* Crunching fixed numbers and vectors. */
- /* */
- /* <Description> */
- /* This section contains various functions used to perform */
- /* computations on 16.16 fixed-float numbers or 2d vectors. */
- /* */
- /* <Order> */
- /* FT_MulDiv */
- /* FT_MulFix */
- /* FT_DivFix */
- /* FT_RoundFix */
- /* FT_CeilFix */
- /* FT_FloorFix */
- /* FT_Vector_Transform */
- /* FT_Matrix_Multiply */
- /* FT_Matrix_Invert */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximum accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
- FT_EXPORT( FT_Long )
- FT_MulDiv( FT_Long a,
- FT_Long b,
- FT_Long c );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
- /* used to multiply a given value by a 16.16 fixed-point factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*b)/0x10000'. */
- /* */
- /* <Note> */
- /* This function has been optimized for the case where the absolute */
- /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
- /* As this happens mainly when scaling from notional units to */
- /* fractional pixels in FreeType, it resulted in noticeable speed */
- /* improvements between versions 2.x and 1.x. */
- /* */
- /* As a conclusion, always try to place a 16.16 factor as the */
- /* _second_ argument of this function; this can make a great */
- /* difference. */
- /* */
- FT_EXPORT( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_DivFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed-point factor. */
- /* */
- /* <Input> */
- /* a :: The numerator. */
- /* b :: The denominator. Use a 16.16 factor here. */
- /* */
- /* <Return> */
- /* The result of `(a*0x10000)/b'. */
- /* */
- FT_EXPORT( FT_Long )
- FT_DivFix( FT_Long a,
- FT_Long b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_RoundFix */
- /* */
- /* <Description> */
- /* A very simple function used to round a 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number to be rounded. */
- /* */
- /* <Return> */
- /* The result of `(a + 0x8000) & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_RoundFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_CeilFix */
- /* */
- /* <Description> */
- /* A very simple function used to compute the ceiling function of a */
- /* 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number for which the ceiling function is to be computed. */
- /* */
- /* <Return> */
- /* The result of `(a + 0x10000 - 1) & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_CeilFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_FloorFix */
- /* */
- /* <Description> */
- /* A very simple function used to compute the floor function of a */
- /* 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number for which the floor function is to be computed. */
- /* */
- /* <Return> */
- /* The result of `a & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_FloorFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Vector_Transform */
- /* */
- /* <Description> */
- /* Transform a single vector through a 2x2 matrix. */
- /* */
- /* <InOut> */
- /* vector :: The target vector to transform. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the source 2x2 matrix. */
- /* */
- /* <Note> */
- /* The result is undefined if either `vector' or `matrix' is invalid. */
- /* */
- FT_EXPORT( void )
- FT_Vector_Transform( FT_Vector* vec,
- const FT_Matrix* matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* version */
- /* */
- /* <Title> */
- /* FreeType Version */
- /* */
- /* <Abstract> */
- /* Functions and macros related to FreeType versions. */
- /* */
- /* <Description> */
- /* Note that those functions and macros are of limited use because */
- /* even a new release of FreeType with only documentation changes */
- /* increases the version number. */
- /* */
- /* <Order> */
- /* FT_Library_Version */
- /* */
- /* FREETYPE_MAJOR */
- /* FREETYPE_MINOR */
- /* FREETYPE_PATCH */
- /* */
- /* FT_Face_CheckTrueTypePatents */
- /* FT_Face_SetUnpatentedHinting */
- /* */
- /* FREETYPE_XXX */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @enum:
- * FREETYPE_XXX
- *
- * @description:
- * These three macros identify the FreeType source code version.
- * Use @FT_Library_Version to access them at runtime.
- *
- * @values:
- * FREETYPE_MAJOR :: The major version number.
- * FREETYPE_MINOR :: The minor version number.
- * FREETYPE_PATCH :: The patch level.
- *
- * @note:
- * The version number of FreeType if built as a dynamic link library
- * with the `libtool' package is _not_ controlled by these three
- * macros.
- *
- */
-#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 5
-#define FREETYPE_PATCH 5
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Library_Version */
- /* */
- /* <Description> */
- /* Return the version of the FreeType library being used. This is */
- /* useful when dynamically linking to the library, since one cannot */
- /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
- /* @FREETYPE_PATCH. */
- /* */
- /* <Input> */
- /* library :: A source library handle. */
- /* */
- /* <Output> */
- /* amajor :: The major version number. */
- /* */
- /* aminor :: The minor version number. */
- /* */
- /* apatch :: The patch version number. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' argument is because */
- /* certain programs implement library initialization in a custom way */
- /* that doesn't use @FT_Init_FreeType. */
- /* */
- /* In such cases, the library version might not be available before */
- /* the library object has been created. */
- /* */
- FT_EXPORT( void )
- FT_Library_Version( FT_Library library,
- FT_Int *amajor,
- FT_Int *aminor,
- FT_Int *apatch );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_CheckTrueTypePatents */
- /* */
- /* <Description> */
- /* Parse all bytecode instructions of a TrueType font file to check */
- /* whether any of the patented opcodes are used. This is only useful */
- /* if you want to be able to use the unpatented hinter with */
- /* fonts that do *not* use these opcodes. */
- /* */
- /* Note that this function parses *all* glyph instructions in the */
- /* font file, which may be slow. */
- /* */
- /* <Input> */
- /* face :: A face handle. */
- /* */
- /* <Return> */
- /* 1~if this is a TrueType font that uses one of the patented */
- /* opcodes, 0~otherwise. */
- /* */
- /* <Note> */
- /* Since May 2010, TrueType hinting is no longer patented. */
- /* */
- /* <Since> */
- /* 2.3.5 */
- /* */
- FT_EXPORT( FT_Bool )
- FT_Face_CheckTrueTypePatents( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_SetUnpatentedHinting */
- /* */
- /* <Description> */
- /* Enable or disable the unpatented hinter for a given face. */
- /* Only enable it if you have determined that the face doesn't */
- /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
- /* */
- /* <Input> */
- /* face :: A face handle. */
- /* */
- /* value :: New boolean setting. */
- /* */
- /* <Return> */
- /* The old setting value. This will always be false if this is not */
- /* an SFNT font, or if the unpatented hinter is not compiled in this */
- /* instance of the library. */
- /* */
- /* <Note> */
- /* Since May 2010, TrueType hinting is no longer patented. */
- /* */
- /* <Since> */
- /* 2.3.5 */
- /* */
- FT_EXPORT( FT_Bool )
- FT_Face_SetUnpatentedHinting( FT_Face face,
- FT_Bool value );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FREETYPE_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/freetype/config/ftconfig.h b/src/3rdparty/freetype/include/freetype/config/ftconfig.h
new file mode 100644
index 0000000000..d4d79936df
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/config/ftconfig.h
@@ -0,0 +1,467 @@
+/***************************************************************************/
+/* */
+/* ftconfig.h */
+/* */
+/* ANSI-specific configuration file (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This header file contains a number of macro definitions that are used */
+ /* by the rest of the engine. Most of the macros here are automatically */
+ /* determined at compile time, and you should not need to change it to */
+ /* port FreeType, except to compile the library with a non-ANSI */
+ /* compiler. */
+ /* */
+ /* Note however that if some specific modifications are needed, we */
+ /* advise you to place a modified copy in your build directory. */
+ /* */
+ /* The build directory is usually `builds/<system>', and contains */
+ /* system-specific files that are always included first when building */
+ /* the library. */
+ /* */
+ /* This ANSI version should stay in `include/config/'. */
+ /* */
+ /*************************************************************************/
+
+#ifndef __FTCONFIG_H__
+#define __FTCONFIG_H__
+
+#include <ft2build.h>
+#include FT_CONFIG_OPTIONS_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
+ /* */
+ /* These macros can be toggled to suit a specific system. The current */
+ /* ones are defaults used to compile FreeType in an ANSI C environment */
+ /* (16bit compilers are also supported). Copy this file to your own */
+ /* `builds/<system>' directory, and edit it to port the engine. */
+ /* */
+ /*************************************************************************/
+
+
+ /* There are systems (like the Texas Instruments 'C54x) where a `char' */
+ /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
+ /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
+ /* is probably unexpected. */
+ /* */
+ /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
+ /* `char' type. */
+
+#ifndef FT_CHAR_BIT
+#define FT_CHAR_BIT CHAR_BIT
+#endif
+
+
+ /* The size of an `int' type. */
+#if FT_UINT_MAX == 0xFFFFUL
+#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
+#elif FT_UINT_MAX == 0xFFFFFFFFUL
+#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
+#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
+#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
+#else
+#error "Unsupported size of `int' type!"
+#endif
+
+ /* The size of a `long' type. A five-byte `long' (as used e.g. on the */
+ /* DM642) is recognized but avoided. */
+#if FT_ULONG_MAX == 0xFFFFFFFFUL
+#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
+#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
+#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
+#else
+#error "Unsupported size of `long' type!"
+#endif
+
+
+ /* FT_UNUSED is a macro used to indicate that a given parameter is not */
+ /* used -- this is only used to get rid of unpleasant compiler warnings */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* AUTOMATIC CONFIGURATION MACROS */
+ /* */
+ /* These macros are computed from the ones defined above. Don't touch */
+ /* their definition, unless you know precisely what you are doing. No */
+ /* porter should need to mess with them. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Mac support */
+ /* */
+ /* This is the only necessary change, so it is defined here instead */
+ /* providing a new configuration file. */
+ /* */
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+ /* no Carbon frameworks for 64bit 10.4.x */
+ /* AvailabilityMacros.h is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
+#include "AvailabilityMacros.h"
+#endif
+#if defined( __LP64__ ) && \
+ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
+#undef FT_MACINTOSH
+#endif
+
+#elif defined( __SC__ ) || defined( __MRC__ )
+ /* Classic MacOS compilers */
+#include "ConditionalMacros.h"
+#if TARGET_OS_MAC
+#define FT_MACINTOSH 1
+#endif
+
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int16 */
+ /* */
+ /* <Description> */
+ /* A typedef for a 16bit signed integer type. */
+ /* */
+ typedef signed short FT_Int16;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt16 */
+ /* */
+ /* <Description> */
+ /* A typedef for a 16bit unsigned integer type. */
+ /* */
+ typedef unsigned short FT_UInt16;
+
+ /* */
+
+
+ /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int32 */
+ /* */
+ /* <Description> */
+ /* A typedef for a 32bit signed integer type. The size depends on */
+ /* the configuration. */
+ /* */
+ typedef signed XXX FT_Int32;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt32 */
+ /* */
+ /* A typedef for a 32bit unsigned integer type. The size depends on */
+ /* the configuration. */
+ /* */
+ typedef unsigned XXX FT_UInt32;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int64 */
+ /* */
+ /* A typedef for a 64bit signed integer type. The size depends on */
+ /* the configuration. Only defined if there is real 64bit support; */
+ /* otherwise, it gets emulated with a structure (if necessary). */
+ /* */
+ typedef signed XXX FT_Int64;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt64 */
+ /* */
+ /* A typedef for a 64bit unsigned integer type. The size depends on */
+ /* the configuration. Only defined if there is real 64bit support; */
+ /* otherwise, it gets emulated with a structure (if necessary). */
+ /* */
+ typedef unsigned XXX FT_UInt64;
+
+ /* */
+
+#endif
+
+#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_UInt32;
+
+#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#error "no 32bit type found -- please check your configuration files"
+#endif
+
+
+ /* look up an integer type that is at least 32 bits */
+#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
+
+ typedef int FT_Fast;
+ typedef unsigned int FT_UFast;
+
+#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
+
+ typedef long FT_Fast;
+ typedef unsigned long FT_UFast;
+
+#endif
+
+
+ /* determine whether we have a 64-bit int type for platforms without */
+ /* Autoconf */
+#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
+
+ /* FT_LONG64 must be defined if a 64-bit type is available */
+#define FT_LONG64
+#define FT_INT64 long
+#define FT_UINT64 unsigned long
+
+ /*************************************************************************/
+ /* */
+ /* A 64-bit data type may create compilation problems if you compile */
+ /* in strict ANSI mode. To avoid them, we disable other 64-bit data */
+ /* types if __STDC__ is defined. You can however ignore this rule */
+ /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
+ /* */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
+
+ /* this compiler provides the __int64 type */
+#define FT_LONG64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __BORLANDC__ ) /* Borland C++ */
+
+ /* XXXX: We should probably check the value of __BORLANDC__ in order */
+ /* to test the compiler version. */
+
+ /* this compiler provides the __int64 type */
+#define FT_LONG64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __WATCOMC__ ) /* Watcom C++ */
+
+ /* Watcom doesn't provide 64-bit data types */
+
+#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
+
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the `long long' type */
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#endif /* _MSC_VER */
+
+#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
+
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+ typedef FT_UINT64 FT_UInt64;
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* miscellaneous */
+ /* */
+ /*************************************************************************/
+
+
+#define FT_BEGIN_STMNT do {
+#define FT_END_STMNT } while ( 0 )
+#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
+
+
+ /* typeof condition taken from gnulib's `intprops.h' header file */
+#if ( __GNUC__ >= 2 || \
+ defined( __IBM__TYPEOF__ ) || \
+ ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
+#define FT_TYPEOF( type ) (__typeof__ (type))
+#else
+#define FT_TYPEOF( type ) /* empty */
+#endif
+
+
+#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
+
+#define FT_LOCAL( x ) static x
+#define FT_LOCAL_DEF( x ) static x
+
+#else
+
+#ifdef __cplusplus
+#define FT_LOCAL( x ) extern "C" x
+#define FT_LOCAL_DEF( x ) extern "C" x
+#else
+#define FT_LOCAL( x ) extern x
+#define FT_LOCAL_DEF( x ) x
+#endif
+
+#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
+
+#define FT_LOCAL_ARRAY( x ) extern const x
+#define FT_LOCAL_ARRAY_DEF( x ) const x
+
+
+#ifndef FT_BASE
+
+#ifdef __cplusplus
+#define FT_BASE( x ) extern "C" x
+#else
+#define FT_BASE( x ) extern x
+#endif
+
+#endif /* !FT_BASE */
+
+
+#ifndef FT_BASE_DEF
+
+#ifdef __cplusplus
+#define FT_BASE_DEF( x ) x
+#else
+#define FT_BASE_DEF( x ) x
+#endif
+
+#endif /* !FT_BASE_DEF */
+
+
+#ifndef FT_EXPORT
+
+#ifdef __cplusplus
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT */
+
+
+#ifndef FT_EXPORT_DEF
+
+#ifdef __cplusplus
+#define FT_EXPORT_DEF( x ) extern "C" x
+#else
+#define FT_EXPORT_DEF( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_DEF */
+
+
+#ifndef FT_EXPORT_VAR
+
+#ifdef __cplusplus
+#define FT_EXPORT_VAR( x ) extern "C" x
+#else
+#define FT_EXPORT_VAR( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_VAR */
+
+ /* The following macros are needed to compile the library with a */
+ /* C++ compiler and with 16bit compilers. */
+ /* */
+
+ /* This is special. Within C++, you must specify `extern "C"' for */
+ /* functions which are used via function pointers, and you also */
+ /* must do that for structures which contain function pointers to */
+ /* assure C linkage -- it's not possible to have (local) anonymous */
+ /* functions which are accessed by (global) function pointers. */
+ /* */
+ /* */
+ /* FT_CALLBACK_DEF is used to _define_ a callback function. */
+ /* */
+ /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
+ /* contains pointers to callback functions. */
+ /* */
+ /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
+ /* that contains pointers to callback functions. */
+ /* */
+ /* */
+ /* Some 16bit compilers have to redefine these macros to insert */
+ /* the infamous `_cdecl' or `__fastcall' declarations. */
+ /* */
+#ifndef FT_CALLBACK_DEF
+#ifdef __cplusplus
+#define FT_CALLBACK_DEF( x ) extern "C" x
+#else
+#define FT_CALLBACK_DEF( x ) static x
+#endif
+#endif /* FT_CALLBACK_DEF */
+
+#ifndef FT_CALLBACK_TABLE
+#ifdef __cplusplus
+#define FT_CALLBACK_TABLE extern "C"
+#define FT_CALLBACK_TABLE_DEF extern "C"
+#else
+#define FT_CALLBACK_TABLE extern
+#define FT_CALLBACK_TABLE_DEF /* nothing */
+#endif
+#endif /* FT_CALLBACK_TABLE */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTCONFIG_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/config/ftheader.h b/src/3rdparty/freetype/include/freetype/config/ftheader.h
new file mode 100644
index 0000000000..55f833db0f
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/config/ftheader.h
@@ -0,0 +1,834 @@
+/***************************************************************************/
+/* */
+/* ftheader.h */
+/* */
+/* Build macros of the FreeType 2 library. */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef __FT_HEADER_H__
+#define __FT_HEADER_H__
+
+
+ /*@***********************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_BEGIN_HEADER */
+ /* */
+ /* <Description> */
+ /* This macro is used in association with @FT_END_HEADER in header */
+ /* files to ensure that the declarations within are properly */
+ /* encapsulated in an `extern "C" { .. }' block when included from a */
+ /* C++ compiler. */
+ /* */
+#ifdef __cplusplus
+#define FT_BEGIN_HEADER extern "C" {
+#else
+#define FT_BEGIN_HEADER /* nothing */
+#endif
+
+
+ /*@***********************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_END_HEADER */
+ /* */
+ /* <Description> */
+ /* This macro is used in association with @FT_BEGIN_HEADER in header */
+ /* files to ensure that the declarations within are properly */
+ /* encapsulated in an `extern "C" { .. }' block when included from a */
+ /* C++ compiler. */
+ /* */
+#ifdef __cplusplus
+#define FT_END_HEADER }
+#else
+#define FT_END_HEADER /* nothing */
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* Aliases for the FreeType 2 public and configuration files. */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* header_file_macros */
+ /* */
+ /* <Title> */
+ /* Header File Macros */
+ /* */
+ /* <Abstract> */
+ /* Macro definitions used to #include specific header files. */
+ /* */
+ /* <Description> */
+ /* The following macros are defined to the name of specific */
+ /* FreeType~2 header files. They can be used directly in #include */
+ /* statements as in: */
+ /* */
+ /* { */
+ /* #include FT_FREETYPE_H */
+ /* #include FT_MULTIPLE_MASTERS_H */
+ /* #include FT_GLYPH_H */
+ /* } */
+ /* */
+ /* There are several reasons why we are now using macros to name */
+ /* public header files. The first one is that such macros are not */
+ /* limited to the infamous 8.3~naming rule required by DOS (and */
+ /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
+ /* */
+ /* The second reason is that it allows for more flexibility in the */
+ /* way FreeType~2 is installed on a given system. */
+ /* */
+ /*************************************************************************/
+
+
+ /* configuration files */
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_CONFIG_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * FreeType~2 configuration data.
+ *
+ */
+#ifndef FT_CONFIG_CONFIG_H
+#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
+#endif
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_STANDARD_LIBRARY_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * FreeType~2 interface to the standard C library functions.
+ *
+ */
+#ifndef FT_CONFIG_STANDARD_LIBRARY_H
+#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
+#endif
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_OPTIONS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * FreeType~2 project-specific configuration options.
+ *
+ */
+#ifndef FT_CONFIG_OPTIONS_H
+#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
+#endif
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CONFIG_MODULES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list of FreeType~2 modules that are statically linked to new library
+ * instances in @FT_Init_FreeType.
+ *
+ */
+#ifndef FT_CONFIG_MODULES_H
+#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
+#endif
+
+ /* */
+
+ /* public headers */
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_FREETYPE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * base FreeType~2 API.
+ *
+ */
+#define FT_FREETYPE_H <freetype/freetype.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_ERRORS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list of FreeType~2 error codes (and messages).
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
+#define FT_ERRORS_H <freetype/fterrors.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_MODULE_ERRORS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list of FreeType~2 module error offsets (and messages).
+ *
+ */
+#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_SYSTEM_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 interface to low-level operations (i.e., memory management
+ * and stream i/o).
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
+#define FT_SYSTEM_H <freetype/ftsystem.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IMAGE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing type
+ * definitions related to glyph images (i.e., bitmaps, outlines,
+ * scan-converter parameters).
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
+#define FT_IMAGE_H <freetype/ftimage.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TYPES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * basic data types defined by FreeType~2.
+ *
+ * It is included by @FT_FREETYPE_H.
+ *
+ */
+#define FT_TYPES_H <freetype/fttypes.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_LIST_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * list management API of FreeType~2.
+ *
+ * (Most applications will never need to include this file.)
+ *
+ */
+#define FT_LIST_H <freetype/ftlist.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_OUTLINE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * scalable outline management API of FreeType~2.
+ *
+ */
+#define FT_OUTLINE_H <freetype/ftoutln.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_SIZES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API which manages multiple @FT_Size objects per face.
+ *
+ */
+#define FT_SIZES_H <freetype/ftsizes.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_MODULE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * module management API of FreeType~2.
+ *
+ */
+#define FT_MODULE_H <freetype/ftmodapi.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_RENDER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * renderer module management API of FreeType~2.
+ *
+ */
+#define FT_RENDER_H <freetype/ftrender.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_AUTOHINTER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the auto-hinting module.
+ *
+ */
+#define FT_AUTOHINTER_H <freetype/ftautoh.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CFF_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the CFF driver module.
+ *
+ */
+#define FT_CFF_DRIVER_H <freetype/ftcffdrv.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the TrueType driver module.
+ *
+ */
+#define FT_TRUETYPE_DRIVER_H <freetype/ftttdrv.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TYPE1_TABLES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * types and API specific to the Type~1 format.
+ *
+ */
+#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_IDS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * enumeration values which identify name strings, languages, encodings,
+ * etc. This file really contains a _large_ set of constant macro
+ * definitions, taken from the TrueType and OpenType specifications.
+ *
+ */
+#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_TABLES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * types and API specific to the TrueType (as well as OpenType) format.
+ *
+ */
+#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_TAGS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of TrueType four-byte `tags' which identify blocks in
+ * SFNT-based font formats (i.e., TrueType and OpenType).
+ *
+ */
+#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_BDF_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which accesses BDF-specific strings from a
+ * face.
+ *
+ */
+#define FT_BDF_H <freetype/ftbdf.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CID_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which access CID font information from a
+ * face.
+ *
+ */
+#define FT_CID_H <freetype/ftcid.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_GZIP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports gzip-compressed files.
+ *
+ */
+#define FT_GZIP_H <freetype/ftgzip.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_LZW_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports LZW-compressed files.
+ *
+ */
+#define FT_LZW_H <freetype/ftlzw.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_BZIP2_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports bzip2-compressed files.
+ *
+ */
+#define FT_BZIP2_H <freetype/ftbzip2.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_WINFONTS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports Windows FNT files.
+ *
+ */
+#define FT_WINFONTS_H <freetype/ftwinfnt.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_GLYPH_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional glyph management component.
+ *
+ */
+#define FT_GLYPH_H <freetype/ftglyph.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_BITMAP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional bitmap conversion component.
+ *
+ */
+#define FT_BITMAP_H <freetype/ftbitmap.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_BBOX_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional exact bounding box computation routines.
+ *
+ */
+#define FT_BBOX_H <freetype/ftbbox.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * API of the optional FreeType~2 cache sub-system.
+ *
+ */
+#define FT_CACHE_H <freetype/ftcache.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_IMAGE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * `glyph image' API of the FreeType~2 cache sub-system.
+ *
+ * It is used to define a cache for @FT_Glyph elements. You can also
+ * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
+ * store small glyph bitmaps, as it will use less memory.
+ *
+ * This macro is deprecated. Simply include @FT_CACHE_H to have all
+ * glyph image-related cache declarations.
+ *
+ */
+#define FT_CACHE_IMAGE_H FT_CACHE_H
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_SMALL_BITMAPS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * `small bitmaps' API of the FreeType~2 cache sub-system.
+ *
+ * It is used to define a cache for small glyph bitmaps in a relatively
+ * memory-efficient way. You can also use the API defined in
+ * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
+ * including scalable outlines.
+ *
+ * This macro is deprecated. Simply include @FT_CACHE_H to have all
+ * small bitmaps-related cache declarations.
+ *
+ */
+#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_CACHE_CHARMAP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * `charmap' API of the FreeType~2 cache sub-system.
+ *
+ * This macro is deprecated. Simply include @FT_CACHE_H to have all
+ * charmap-based cache declarations.
+ *
+ */
+#define FT_CACHE_CHARMAP_H FT_CACHE_H
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_MAC_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * Macintosh-specific FreeType~2 API. The latter is used to access
+ * fonts embedded in resource forks.
+ *
+ * This header file must be explicitly included by client applications
+ * compiled on the Mac (note that the base API still works though).
+ *
+ */
+#define FT_MAC_H <freetype/ftmac.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_MULTIPLE_MASTERS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional multiple-masters management API of FreeType~2.
+ *
+ */
+#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_SFNT_NAMES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional FreeType~2 API which accesses embedded `name' strings in
+ * SFNT-based font formats (i.e., TrueType and OpenType).
+ *
+ */
+#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_OPENTYPE_VALIDATE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
+ * GPOS, GSUB, JSTF).
+ *
+ */
+#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_GX_VALIDATE_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
+ * mort, morx, bsln, just, kern, opbd, trak, prop).
+ *
+ */
+#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_PFR_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which accesses PFR-specific data.
+ *
+ */
+#define FT_PFR_H <freetype/ftpfr.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_STROKER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which provides functions to stroke outline paths.
+ */
+#define FT_STROKER_H <freetype/ftstroke.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_SYNTHESIS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs artificial obliquing and emboldening.
+ */
+#define FT_SYNTHESIS_H <freetype/ftsynth.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_FONT_FORMATS_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which provides functions specific to font formats.
+ */
+#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
+
+ /* deprecated */
+#define FT_XFREE86_H FT_FONT_FORMATS_H
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TRIGONOMETRY_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs trigonometric computations (e.g.,
+ * cosines and arc tangents).
+ */
+#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_LCD_FILTER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs color filtering for subpixel rendering.
+ */
+#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_UNPATENTED_HINTING_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs color filtering for subpixel rendering.
+ */
+#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_INCREMENTAL_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which performs color filtering for subpixel rendering.
+ */
+#define FT_INCREMENTAL_H <freetype/ftincrem.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_GASP_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which returns entries from the TrueType GASP table.
+ */
+#define FT_GASP_H <freetype/ftgasp.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_ADVANCES_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * FreeType~2 API which returns individual and ranged glyph advances.
+ */
+#define FT_ADVANCES_H <freetype/ftadvanc.h>
+
+
+ /* */
+
+#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
+
+
+ /* The internals of the cache sub-system are no longer exposed. We */
+ /* default to FT_CACHE_H at the moment just in case, but we know of */
+ /* no rogue client that uses them. */
+ /* */
+#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
+
+
+#define FT_INCREMENTAL_H <freetype/ftincrem.h>
+
+#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
+
+
+ /*
+ * Include internal headers definitions from <internal/...>
+ * only when building the library.
+ */
+#ifdef FT2_BUILD_LIBRARY
+#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
+#include FT_INTERNAL_INTERNAL_H
+#endif /* FT2_BUILD_LIBRARY */
+
+
+#endif /* __FT2_BUILD_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/config/ftmodule.h b/src/3rdparty/freetype/include/freetype/config/ftmodule.h
index 76d271a74b..76d271a74b 100644
--- a/src/3rdparty/freetype/include/config/ftmodule.h
+++ b/src/3rdparty/freetype/include/freetype/config/ftmodule.h
diff --git a/src/3rdparty/freetype/include/freetype/config/ftoption.h b/src/3rdparty/freetype/include/freetype/config/ftoption.h
new file mode 100644
index 0000000000..4970945d15
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/config/ftoption.h
@@ -0,0 +1,886 @@
+/***************************************************************************/
+/* */
+/* ftoption.h */
+/* */
+/* User-selectable configuration macros (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTOPTION_H__
+#define __FTOPTION_H__
+
+
+#include <ft2build.h>
+
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* USER-SELECTABLE CONFIGURATION MACROS */
+ /* */
+ /* This file contains the default configuration macro definitions for */
+ /* a standard build of the FreeType library. There are three ways to */
+ /* use this file to build project-specific versions of the library: */
+ /* */
+ /* - You can modify this file by hand, but this is not recommended in */
+ /* cases where you would like to build several versions of the */
+ /* library from a single source directory. */
+ /* */
+ /* - You can put a copy of this file in your build directory, more */
+ /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
+ /* is the name of a directory that is included _before_ the FreeType */
+ /* include path during compilation. */
+ /* */
+ /* The default FreeType Makefiles and Jamfiles use the build */
+ /* directory `builds/<system>' by default, but you can easily change */
+ /* that for your own projects. */
+ /* */
+ /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
+ /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
+ /* locate this file during the build. For example, */
+ /* */
+ /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
+ /* #include <freetype/config/ftheader.h> */
+ /* */
+ /* will use `$BUILD/myftoptions.h' instead of this file for macro */
+ /* definitions. */
+ /* */
+ /* Note also that you can similarly pre-define the macro */
+ /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
+ /* that are statically linked to the library at compile time. By */
+ /* default, this file is <freetype/config/ftmodule.h>. */
+ /* */
+ /* We highly recommend using the third method whenever possible. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Uncomment the line below if you want to activate sub-pixel rendering */
+ /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
+ /* */
+ /* Note that this feature is covered by several Microsoft patents */
+ /* and should not be activated in any default build of the library. */
+ /* */
+ /* This macro has no impact on the FreeType API, only on its */
+ /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
+ /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
+ /* the original size in case this macro isn't defined; however, each */
+ /* triplet of subpixels has R=G=B. */
+ /* */
+ /* This is done to allow FreeType clients to run unmodified, forcing */
+ /* them to display normal gray-level anti-aliased glyphs. */
+ /* */
+/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+
+
+ /*************************************************************************/
+ /* */
+ /* Many compilers provide a non-ANSI 64-bit data type that can be used */
+ /* by FreeType to speed up some computations. However, this will create */
+ /* some problems when compiling the library in strict ANSI mode. */
+ /* */
+ /* For this reason, the use of 64-bit integers is normally disabled when */
+ /* the __STDC__ macro is defined. You can however disable this by */
+ /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
+ /* */
+ /* For most compilers, this will only create compilation warnings when */
+ /* building the library. */
+ /* */
+ /* ObNote: The compiler-specific 64-bit integers are detected in the */
+ /* file `ftconfig.h' either statically or through the */
+ /* `configure' script on supported platforms. */
+ /* */
+#undef FT_CONFIG_OPTION_FORCE_INT64
+
+
+ /*************************************************************************/
+ /* */
+ /* If this macro is defined, do not try to use an assembler version of */
+ /* performance-critical functions (e.g. FT_MulFix). You should only do */
+ /* that to verify that the assembler function works properly, or to */
+ /* execute benchmark tests of the various implementations. */
+/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+ /*************************************************************************/
+ /* */
+ /* If this macro is defined, try to use an inlined assembler version of */
+ /* the `FT_MulFix' function, which is a `hotspot' when loading and */
+ /* hinting glyphs, and which should be executed as fast as possible. */
+ /* */
+ /* Note that if your compiler or CPU is not supported, this will default */
+ /* to the standard and portable implementation found in `ftcalc.c'. */
+ /* */
+#define FT_CONFIG_OPTION_INLINE_MULFIX
+
+
+ /*************************************************************************/
+ /* */
+ /* LZW-compressed file support. */
+ /* */
+ /* FreeType now handles font files that have been compressed with the */
+ /* `compress' program. This is mostly used to parse many of the PCF */
+ /* files that come with various X11 distributions. The implementation */
+ /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
+ /* (see src/lzw/ftgzip.c). */
+ /* */
+ /* Define this macro if you want to enable this `feature'. */
+ /* */
+#define FT_CONFIG_OPTION_USE_LZW
+
+
+ /*************************************************************************/
+ /* */
+ /* Gzip-compressed file support. */
+ /* */
+ /* FreeType now handles font files that have been compressed with the */
+ /* `gzip' program. This is mostly used to parse many of the PCF files */
+ /* that come with XFree86. The implementation uses `zlib' to */
+ /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
+ /* */
+ /* Define this macro if you want to enable this `feature'. See also */
+ /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
+ /* */
+#define FT_CONFIG_OPTION_USE_ZLIB
+
+
+ /*************************************************************************/
+ /* */
+ /* ZLib library selection */
+ /* */
+ /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
+ /* It allows FreeType's `ftgzip' component to link to the system's */
+ /* installation of the ZLib library. This is useful on systems like */
+ /* Unix or VMS where it generally is already available. */
+ /* */
+ /* If you let it undefined, the component will use its own copy */
+ /* of the zlib sources instead. These have been modified to be */
+ /* included directly within the component and *not* export external */
+ /* function names. This allows you to link any program with FreeType */
+ /* _and_ ZLib without linking conflicts. */
+ /* */
+ /* Do not #undef this macro here since the build system might define */
+ /* it for certain configurations only. */
+ /* */
+/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
+
+
+ /*************************************************************************/
+ /* */
+ /* Bzip2-compressed file support. */
+ /* */
+ /* FreeType now handles font files that have been compressed with the */
+ /* `bzip2' program. This is mostly used to parse many of the PCF */
+ /* files that come with XFree86. The implementation uses `libbz2' to */
+ /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
+ /* Contrary to gzip, bzip2 currently is not included and need to use */
+ /* the system available bzip2 implementation. */
+ /* */
+ /* Define this macro if you want to enable this `feature'. */
+ /* */
+/* #define FT_CONFIG_OPTION_USE_BZIP2 */
+
+
+ /*************************************************************************/
+ /* */
+ /* Define to disable the use of file stream functions and types, FILE, */
+ /* fopen() etc. Enables the use of smaller system libraries on embedded */
+ /* systems that have multiple system libraries, some with or without */
+ /* file stream support, in the cases where file stream support is not */
+ /* necessary such as memory loading of font files. */
+ /* */
+/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
+
+
+ /*************************************************************************/
+ /* */
+ /* PNG bitmap support. */
+ /* */
+ /* FreeType now handles loading color bitmap glyphs in the PNG format. */
+ /* This requires help from the external libpng library. Uncompressed */
+ /* color bitmaps do not need any external libraries and will be */
+ /* supported regardless of this configuration. */
+ /* */
+ /* Define this macro if you want to enable this `feature'. */
+ /* */
+/* #define FT_CONFIG_OPTION_USE_PNG */
+
+
+ /*************************************************************************/
+ /* */
+ /* HarfBuzz support. */
+ /* */
+ /* FreeType uses the HarfBuzz library to improve auto-hinting of */
+ /* OpenType fonts. If available, many glyphs not directly addressable */
+ /* by a font's character map will be hinted also. */
+ /* */
+ /* Define this macro if you want to enable this `feature'. */
+ /* */
+/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
+
+
+ /*************************************************************************/
+ /* */
+ /* DLL export compilation */
+ /* */
+ /* When compiling FreeType as a DLL, some systems/compilers need a */
+ /* special keyword in front OR after the return type of function */
+ /* declarations. */
+ /* */
+ /* Two macros are used within the FreeType source code to define */
+ /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
+ /* */
+ /* FT_EXPORT( return_type ) */
+ /* */
+ /* is used in a function declaration, as in */
+ /* */
+ /* FT_EXPORT( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ); */
+ /* */
+ /* */
+ /* FT_EXPORT_DEF( return_type ) */
+ /* */
+ /* is used in a function definition, as in */
+ /* */
+ /* FT_EXPORT_DEF( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ) */
+ /* { */
+ /* ... some code ... */
+ /* return FT_Err_Ok; */
+ /* } */
+ /* */
+ /* You can provide your own implementation of FT_EXPORT and */
+ /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
+ /* will be later automatically defined as `extern return_type' to */
+ /* allow normal compilation. */
+ /* */
+ /* Do not #undef these macros here since the build system might define */
+ /* them for certain configurations only. */
+ /* */
+/* #define FT_EXPORT(x) extern x */
+/* #define FT_EXPORT_DEF(x) x */
+
+
+ /*************************************************************************/
+ /* */
+ /* Glyph Postscript Names handling */
+ /* */
+ /* By default, FreeType 2 is compiled with the `psnames' module. This */
+ /* module is in charge of converting a glyph name string into a */
+ /* Unicode value, or return a Macintosh standard glyph name for the */
+ /* use with the TrueType `post' table. */
+ /* */
+ /* Undefine this macro if you do not want `psnames' compiled in your */
+ /* build of FreeType. This has the following effects: */
+ /* */
+ /* - The TrueType driver will provide its own set of glyph names, */
+ /* if you build it to support postscript names in the TrueType */
+ /* `post' table. */
+ /* */
+ /* - The Type 1 driver will not be able to synthesize a Unicode */
+ /* charmap out of the glyphs found in the fonts. */
+ /* */
+ /* You would normally undefine this configuration macro when building */
+ /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
+ /* */
+#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* Postscript Names to Unicode Values support */
+ /* */
+ /* By default, FreeType 2 is built with the `PSNames' module compiled */
+ /* in. Among other things, the module is used to convert a glyph name */
+ /* into a Unicode value. This is especially useful in order to */
+ /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
+ /* through a big table named the `Adobe Glyph List' (AGL). */
+ /* */
+ /* Undefine this macro if you do not want the Adobe Glyph List */
+ /* compiled in your `PSNames' module. The Type 1 driver will not be */
+ /* able to synthesize a Unicode charmap out of the glyphs found in the */
+ /* fonts. */
+ /* */
+#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
+
+
+ /*************************************************************************/
+ /* */
+ /* Support for Mac fonts */
+ /* */
+ /* Define this macro if you want support for outline fonts in Mac */
+ /* format (mac dfont, mac resource, macbinary containing a mac */
+ /* resource) on non-Mac platforms. */
+ /* */
+ /* Note that the `FOND' resource isn't checked. */
+ /* */
+#define FT_CONFIG_OPTION_MAC_FONTS
+
+
+ /*************************************************************************/
+ /* */
+ /* Guessing methods to access embedded resource forks */
+ /* */
+ /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
+ /* GNU/Linux). */
+ /* */
+ /* Resource forks which include fonts data are stored sometimes in */
+ /* locations which users or developers don't expected. In some cases, */
+ /* resource forks start with some offset from the head of a file. In */
+ /* other cases, the actual resource fork is stored in file different */
+ /* from what the user specifies. If this option is activated, */
+ /* FreeType tries to guess whether such offsets or different file */
+ /* names must be used. */
+ /* */
+ /* Note that normal, direct access of resource forks is controlled via */
+ /* the FT_CONFIG_OPTION_MAC_FONTS option. */
+ /* */
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* Allow the use of FT_Incremental_Interface to load typefaces that */
+ /* contain no glyph data, but supply it via a callback function. */
+ /* This is required by clients supporting document formats which */
+ /* supply font data incrementally as the document is parsed, such */
+ /* as the Ghostscript interpreter for the PostScript language. */
+ /* */
+#define FT_CONFIG_OPTION_INCREMENTAL
+
+
+ /*************************************************************************/
+ /* */
+ /* The size in bytes of the render pool used by the scan-line converter */
+ /* to do all of its work. */
+ /* */
+#define FT_RENDER_POOL_SIZE 16384L
+
+
+ /*************************************************************************/
+ /* */
+ /* FT_MAX_MODULES */
+ /* */
+ /* The maximum number of modules that can be registered in a single */
+ /* FreeType library object. 32 is the default. */
+ /* */
+#define FT_MAX_MODULES 32
+
+
+ /*************************************************************************/
+ /* */
+ /* Debug level */
+ /* */
+ /* FreeType can be compiled in debug or trace mode. In debug mode, */
+ /* errors are reported through the `ftdebug' component. In trace */
+ /* mode, additional messages are sent to the standard output during */
+ /* execution. */
+ /* */
+ /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
+ /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
+ /* */
+ /* Don't define any of these macros to compile in `release' mode! */
+ /* */
+ /* Do not #undef these macros here since the build system might define */
+ /* them for certain configurations only. */
+ /* */
+/* #define FT_DEBUG_LEVEL_ERROR */
+/* #define FT_DEBUG_LEVEL_TRACE */
+
+
+ /*************************************************************************/
+ /* */
+ /* Autofitter debugging */
+ /* */
+ /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
+ /* control the autofitter behaviour for debugging purposes with global */
+ /* boolean variables (consequently, you should *never* enable this */
+ /* while compiling in `release' mode): */
+ /* */
+ /* _af_debug_disable_horz_hints */
+ /* _af_debug_disable_vert_hints */
+ /* _af_debug_disable_blue_hints */
+ /* */
+ /* Additionally, the following functions provide dumps of various */
+ /* internal autofit structures to stdout (using `printf'): */
+ /* */
+ /* af_glyph_hints_dump_points */
+ /* af_glyph_hints_dump_segments */
+ /* af_glyph_hints_dump_edges */
+ /* af_glyph_hints_get_num_segments */
+ /* af_glyph_hints_get_segment_offset */
+ /* */
+ /* As an argument, they use another global variable: */
+ /* */
+ /* _af_debug_hints */
+ /* */
+ /* Please have a look at the `ftgrid' demo program to see how those */
+ /* variables and macros should be used. */
+ /* */
+ /* Do not #undef these macros here since the build system might define */
+ /* them for certain configurations only. */
+ /* */
+/* #define FT_DEBUG_AUTOFIT */
+
+
+ /*************************************************************************/
+ /* */
+ /* Memory Debugging */
+ /* */
+ /* FreeType now comes with an integrated memory debugger that is */
+ /* capable of detecting simple errors like memory leaks or double */
+ /* deletes. To compile it within your build of the library, you */
+ /* should define FT_DEBUG_MEMORY here. */
+ /* */
+ /* Note that the memory debugger is only activated at runtime when */
+ /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
+ /* */
+ /* Do not #undef this macro here since the build system might define */
+ /* it for certain configurations only. */
+ /* */
+/* #define FT_DEBUG_MEMORY */
+
+
+ /*************************************************************************/
+ /* */
+ /* Module errors */
+ /* */
+ /* If this macro is set (which is _not_ the default), the higher byte */
+ /* of an error code gives the module in which the error has occurred, */
+ /* while the lower byte is the real error code. */
+ /* */
+ /* Setting this macro makes sense for debugging purposes only, since */
+ /* it would break source compatibility of certain programs that use */
+ /* FreeType 2. */
+ /* */
+ /* More details can be found in the files ftmoderr.h and fterrors.h. */
+ /* */
+#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+
+
+ /*************************************************************************/
+ /* */
+ /* Position Independent Code */
+ /* */
+ /* If this macro is set (which is _not_ the default), FreeType2 will */
+ /* avoid creating constants that require address fixups. Instead the */
+ /* constants will be moved into a struct and additional intialization */
+ /* code will be used. */
+ /* */
+ /* Setting this macro is needed for systems that prohibit address */
+ /* fixups, such as BREW. */
+ /* */
+/* #define FT_CONFIG_OPTION_PIC */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
+ /* embedded bitmaps in all formats using the SFNT module (namely */
+ /* TrueType & OpenType). */
+ /* */
+#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
+ /* load and enumerate the glyph Postscript names in a TrueType or */
+ /* OpenType file. */
+ /* */
+ /* Note that when you do not compile the `PSNames' module by undefining */
+ /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
+ /* contain additional code used to read the PS Names table from a font. */
+ /* */
+ /* (By default, the module uses `PSNames' to extract glyph names.) */
+ /* */
+#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
+ /* access the internal name table in a SFNT-based format like TrueType */
+ /* or OpenType. The name table contains various strings used to */
+ /* describe the font, like family name, copyright, version, etc. It */
+ /* does not contain any glyph name though. */
+ /* */
+ /* Accessing SFNT names is done through the functions declared in */
+ /* `ftsnames.h'. */
+ /* */
+#define TT_CONFIG_OPTION_SFNT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* TrueType CMap support */
+ /* */
+ /* Here you can fine-tune which TrueType CMap table format shall be */
+ /* supported. */
+#define TT_CONFIG_CMAP_FORMAT_0
+#define TT_CONFIG_CMAP_FORMAT_2
+#define TT_CONFIG_CMAP_FORMAT_4
+#define TT_CONFIG_CMAP_FORMAT_6
+#define TT_CONFIG_CMAP_FORMAT_8
+#define TT_CONFIG_CMAP_FORMAT_10
+#define TT_CONFIG_CMAP_FORMAT_12
+#define TT_CONFIG_CMAP_FORMAT_13
+#define TT_CONFIG_CMAP_FORMAT_14
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
+ /* a bytecode interpreter in the TrueType driver. */
+ /* */
+ /* By undefining this, you will only compile the code necessary to load */
+ /* TrueType glyphs without hinting. */
+ /* */
+ /* Do not #undef this macro here, since the build system might */
+ /* define it for certain configurations only. */
+ /* */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
+ /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
+ /* replaces the native TrueType hinting mechanism when anything but */
+ /* FT_RENDER_MODE_MONO is requested. */
+ /* */
+ /* Enabling this causes the TrueType driver to ignore instructions under */
+ /* certain conditions. This is done in accordance with the guide here, */
+ /* with some minor differences: */
+ /* */
+ /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
+ /* */
+ /* By undefining this, you only compile the code necessary to hint */
+ /* TrueType glyphs with native TT hinting. */
+ /* */
+ /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
+ /* defined. */
+ /* */
+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+
+ /*************************************************************************/
+ /* */
+ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
+ /* of the TrueType bytecode interpreter is used that doesn't implement */
+ /* any of the patented opcodes and algorithms. The patents related to */
+ /* TrueType hinting have expired worldwide since May 2010; this option */
+ /* is now deprecated. */
+ /* */
+ /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
+ /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
+ /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
+ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
+ /* */
+ /* This macro is only useful for a small number of font files (mostly */
+ /* for Asian scripts) that require bytecode interpretation to properly */
+ /* load glyphs. For all other fonts, this produces unpleasant results, */
+ /* thus the unpatented interpreter is never used to load glyphs from */
+ /* TrueType fonts unless one of the following two options is used. */
+ /* */
+ /* - The unpatented interpreter is explicitly activated by the user */
+ /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
+ /* when opening the FT_Face. */
+ /* */
+ /* - FreeType detects that the FT_Face corresponds to one of the */
+ /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
+ /* contains a hard-coded list of font names and other matching */
+ /* parameters (see function `tt_face_init' in file */
+ /* `src/truetype/ttobjs.c'). */
+ /* */
+ /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
+ /* */
+ /* { */
+ /* FT_Parameter parameter; */
+ /* FT_Open_Args open_args; */
+ /* */
+ /* */
+ /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
+ /* */
+ /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
+ /* open_args.pathname = my_font_pathname; */
+ /* open_args.num_params = 1; */
+ /* open_args.params = &parameter; */
+ /* */
+ /* error = FT_Open_Face( library, &open_args, index, &face ); */
+ /* ... */
+ /* } */
+ /* */
+/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
+ /* TrueType glyph loader to use Apple's definition of how to handle */
+ /* component offsets in composite glyphs. */
+ /* */
+ /* Apple and MS disagree on the default behavior of component offsets */
+ /* in composites. Apple says that they should be scaled by the scaling */
+ /* factors in the transformation matrix (roughly, it's more complex) */
+ /* while MS says they should not. OpenType defines two bits in the */
+ /* composite flags array which can be used to disambiguate, but old */
+ /* fonts will not have them. */
+ /* */
+ /* http://www.microsoft.com/typography/otspec/glyf.htm */
+ /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */
+ /* */
+#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
+ /* support for Apple's distortable font technology (fvar, gvar, cvar, */
+ /* and avar tables). This has many similarities to Type 1 Multiple */
+ /* Masters support. */
+ /* */
+#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
+ /* an embedded `BDF ' table within SFNT-based bitmap formats. */
+ /* */
+#define TT_CONFIG_OPTION_BDF
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
+ /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
+ /* required. */
+ /* */
+#define T1_MAX_DICT_DEPTH 5
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
+ /* calls during glyph loading. */
+ /* */
+#define T1_MAX_SUBRS_CALLS 16
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
+ /* minimum of 16 is required. */
+ /* */
+ /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
+ /* */
+#define T1_MAX_CHARSTRINGS_OPERANDS 256
+
+
+ /*************************************************************************/
+ /* */
+ /* Define this configuration macro if you want to prevent the */
+ /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
+ /* files into an existing face. Note that if set, the T1 driver will be */
+ /* unable to produce kerning distances. */
+ /* */
+#undef T1_CONFIG_OPTION_NO_AFM
+
+
+ /*************************************************************************/
+ /* */
+ /* Define this configuration macro if you want to prevent the */
+ /* compilation of the Multiple Masters font support in the Type 1 */
+ /* driver. */
+ /* */
+#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** C F F D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */
+ /* possible to set up the default values of the four control points that */
+ /* define the stem darkening behaviour of the (new) CFF engine. For */
+ /* more details please read the documentation of the */
+ /* `darkening-parameters' property of the cff driver module (file */
+ /* `ftcffdrv.h'), which allows the control at run-time. */
+ /* */
+ /* Do *not* undefine these macros! */
+ /* */
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
+
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
+#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
+
+
+ /*************************************************************************/
+ /* */
+ /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
+ /* engine gets compiled into FreeType. If defined, it is possible to */
+ /* switch between the two engines using the `hinting-engine' property of */
+ /* the cff driver module. */
+ /* */
+/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
+ /* support. */
+ /* */
+#define AF_CONFIG_OPTION_CJK
+
+ /*************************************************************************/
+ /* */
+ /* Compile autofit module with Indic script support. */
+ /* */
+#define AF_CONFIG_OPTION_INDIC
+
+ /*************************************************************************/
+ /* */
+ /* Compile autofit module with warp hinting. The idea of the warping */
+ /* code is to slightly scale and shift a glyph within a single dimension */
+ /* so that as much of its segments are aligned (more or less) on the */
+ /* grid. To find out the optimal scaling and shifting value, various */
+ /* parameter combinations are tried and scored. */
+ /* */
+ /* This experimental option is active only if the rendering mode is */
+ /* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
+ /* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
+ /* information; by default it is switched off). */
+ /* */
+#define AF_CONFIG_OPTION_USE_WARPER
+
+ /* */
+
+
+ /*
+ * This macro is obsolete. Support has been removed in FreeType
+ * version 2.5.
+ */
+/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
+
+
+ /*
+ * This macro is defined if either unpatented or native TrueType
+ * hinting is requested by the definitions above.
+ */
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+#define TT_USE_BYTECODE_INTERPRETER
+#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
+#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
+#define TT_USE_BYTECODE_INTERPRETER
+#endif
+
+
+ /*
+ * Check CFF darkening parameters. The checks are the same as in function
+ * `cff_property_set' in file `cffdrivr.c'.
+ */
+#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \
+ \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \
+ \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \
+ \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
+ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
+#error "Invalid CFF darkening parameters!"
+#endif
+
+FT_END_HEADER
+
+
+#endif /* __FTOPTION_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/config/ftstdlib.h b/src/3rdparty/freetype/include/freetype/config/ftstdlib.h
new file mode 100644
index 0000000000..4b471d4d15
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/config/ftstdlib.h
@@ -0,0 +1,174 @@
+/***************************************************************************/
+/* */
+/* ftstdlib.h */
+/* */
+/* ANSI-specific library and header configuration file (specification */
+/* only). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file is used to group all #includes to the ANSI C library that */
+ /* FreeType normally requires. It also defines macros to rename the */
+ /* standard functions within the FreeType source code. */
+ /* */
+ /* Load a file which defines __FTSTDLIB_H__ before this one to override */
+ /* it. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTSTDLIB_H__
+#define __FTSTDLIB_H__
+
+
+#include <stddef.h>
+
+#define ft_ptrdiff_t ptrdiff_t
+
+
+ /**********************************************************************/
+ /* */
+ /* integer limits */
+ /* */
+ /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
+ /* of `int' and `long' in bytes at compile-time. So far, this works */
+ /* for all platforms the library has been tested on. */
+ /* */
+ /* Note that on the extremely rare platforms that do not provide */
+ /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
+ /* old Crays where `int' is 36 bits), we do not make any guarantee */
+ /* about the correct behaviour of FT2 with all fonts. */
+ /* */
+ /* In these case, `ftconfig.h' will refuse to compile anyway with a */
+ /* message like `couldn't find 32-bit type' or something similar. */
+ /* */
+ /**********************************************************************/
+
+
+#include <limits.h>
+
+#define FT_CHAR_BIT CHAR_BIT
+#define FT_USHORT_MAX USHRT_MAX
+#define FT_INT_MAX INT_MAX
+#define FT_INT_MIN INT_MIN
+#define FT_UINT_MAX UINT_MAX
+#define FT_LONG_MAX LONG_MAX
+#define FT_ULONG_MAX ULONG_MAX
+
+
+ /**********************************************************************/
+ /* */
+ /* character and string processing */
+ /* */
+ /**********************************************************************/
+
+
+#include <string.h>
+
+#define ft_memchr memchr
+#define ft_memcmp memcmp
+#define ft_memcpy memcpy
+#define ft_memmove memmove
+#define ft_memset memset
+#define ft_strcat strcat
+#define ft_strcmp strcmp
+#define ft_strcpy strcpy
+#define ft_strlen strlen
+#define ft_strncmp strncmp
+#define ft_strncpy strncpy
+#define ft_strrchr strrchr
+#define ft_strstr strstr
+
+
+ /**********************************************************************/
+ /* */
+ /* file handling */
+ /* */
+ /**********************************************************************/
+
+
+#include <stdio.h>
+
+#define FT_FILE FILE
+#define ft_fclose fclose
+#define ft_fopen fopen
+#define ft_fread fread
+#define ft_fseek fseek
+#define ft_ftell ftell
+#define ft_sprintf sprintf
+
+
+ /**********************************************************************/
+ /* */
+ /* sorting */
+ /* */
+ /**********************************************************************/
+
+
+#include <stdlib.h>
+
+#define ft_qsort qsort
+
+
+ /**********************************************************************/
+ /* */
+ /* memory allocation */
+ /* */
+ /**********************************************************************/
+
+
+#define ft_scalloc calloc
+#define ft_sfree free
+#define ft_smalloc malloc
+#define ft_srealloc realloc
+
+
+ /**********************************************************************/
+ /* */
+ /* miscellaneous */
+ /* */
+ /**********************************************************************/
+
+
+#define ft_atol atol
+
+
+ /**********************************************************************/
+ /* */
+ /* execution control */
+ /* */
+ /**********************************************************************/
+
+
+#include <setjmp.h>
+
+#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
+ /* jmp_buf is defined as a macro */
+ /* on certain platforms */
+
+#define ft_longjmp longjmp
+#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
+
+
+ /* the following is only used for debugging purposes, i.e., if */
+ /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
+
+#include <stdarg.h>
+
+
+#endif /* __FTSTDLIB_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/freetype.h b/src/3rdparty/freetype/include/freetype/freetype.h
new file mode 100644
index 0000000000..b6247f510f
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/freetype.h
@@ -0,0 +1,4204 @@
+/***************************************************************************/
+/* */
+/* freetype.h */
+/* */
+/* FreeType high-level API and common types (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FREETYPE_H__
+#define __FREETYPE_H__
+
+
+#ifndef FT_FREETYPE_H
+#error "`ft2build.h' hasn't been included yet!"
+#error "Please always use macros to include FreeType header files."
+#error "Example:"
+#error " #include <ft2build.h>"
+#error " #include FT_FREETYPE_H"
+#endif
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_TYPES_H
+#include FT_ERRORS_H
+
+
+FT_BEGIN_HEADER
+
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* header_inclusion */
+ /* */
+ /* <Title> */
+ /* FreeType's header inclusion scheme */
+ /* */
+ /* <Abstract> */
+ /* How client applications should include FreeType header files. */
+ /* */
+ /* <Description> */
+ /* To be as flexible as possible (and for historical reasons), */
+ /* FreeType uses a very special inclusion scheme to load header */
+ /* files, for example */
+ /* */
+ /* { */
+ /* #include <ft2build.h> */
+ /* */
+ /* #include FT_FREETYPE_H */
+ /* #include FT_OUTLINE_H */
+ /* } */
+ /* */
+ /* A compiler and its preprocessor only needs an include path to find */
+ /* the file `ft2build.h'; the exact locations and names of the other */
+ /* FreeType header files are hidden by preprocessor macro names, */
+ /* loaded by `ft2build.h'. The API documentation always gives the */
+ /* header macro name needed for a particular function. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* user_allocation */
+ /* */
+ /* <Title> */
+ /* User allocation */
+ /* */
+ /* <Abstract> */
+ /* How client applications should allocate FreeType data structures. */
+ /* */
+ /* <Description> */
+ /* FreeType assumes that structures allocated by the user and passed */
+ /* as arguments are zeroed out except for the actual data. In other */
+ /* words, it is recommended to use `calloc' (or variants of it) */
+ /* instead of `malloc' for allocation. */
+ /* */
+ /*************************************************************************/
+
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S I C T Y P E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* base_interface */
+ /* */
+ /* <Title> */
+ /* Base Interface */
+ /* */
+ /* <Abstract> */
+ /* The FreeType~2 base font interface. */
+ /* */
+ /* <Description> */
+ /* This section describes the most important public high-level API */
+ /* functions of FreeType~2. */
+ /* */
+ /* <Order> */
+ /* FT_Library */
+ /* FT_Face */
+ /* FT_Size */
+ /* FT_GlyphSlot */
+ /* FT_CharMap */
+ /* FT_Encoding */
+ /* FT_ENC_TAG */
+ /* */
+ /* FT_FaceRec */
+ /* */
+ /* FT_FACE_FLAG_SCALABLE */
+ /* FT_FACE_FLAG_FIXED_SIZES */
+ /* FT_FACE_FLAG_FIXED_WIDTH */
+ /* FT_FACE_FLAG_HORIZONTAL */
+ /* FT_FACE_FLAG_VERTICAL */
+ /* FT_FACE_FLAG_COLOR */
+ /* FT_FACE_FLAG_SFNT */
+ /* FT_FACE_FLAG_CID_KEYED */
+ /* FT_FACE_FLAG_TRICKY */
+ /* FT_FACE_FLAG_KERNING */
+ /* FT_FACE_FLAG_MULTIPLE_MASTERS */
+ /* FT_FACE_FLAG_GLYPH_NAMES */
+ /* FT_FACE_FLAG_EXTERNAL_STREAM */
+ /* FT_FACE_FLAG_HINTER */
+ /* FT_FACE_FLAG_TRICKY */
+ /* */
+ /* FT_HAS_HORIZONTAL */
+ /* FT_HAS_VERTICAL */
+ /* FT_HAS_KERNING */
+ /* FT_HAS_FIXED_SIZES */
+ /* FT_HAS_GLYPH_NAMES */
+ /* FT_HAS_MULTIPLE_MASTERS */
+ /* FT_HAS_COLOR */
+ /* */
+ /* FT_IS_SFNT */
+ /* FT_IS_SCALABLE */
+ /* FT_IS_FIXED_WIDTH */
+ /* FT_IS_CID_KEYED */
+ /* FT_IS_TRICKY */
+ /* */
+ /* FT_STYLE_FLAG_BOLD */
+ /* FT_STYLE_FLAG_ITALIC */
+ /* */
+ /* FT_SizeRec */
+ /* FT_Size_Metrics */
+ /* */
+ /* FT_GlyphSlotRec */
+ /* FT_Glyph_Metrics */
+ /* FT_SubGlyph */
+ /* */
+ /* FT_Bitmap_Size */
+ /* */
+ /* FT_Init_FreeType */
+ /* FT_Done_FreeType */
+ /* */
+ /* FT_New_Face */
+ /* FT_Done_Face */
+ /* FT_Reference_Face */
+ /* FT_New_Memory_Face */
+ /* FT_Open_Face */
+ /* FT_Open_Args */
+ /* FT_Parameter */
+ /* FT_Attach_File */
+ /* FT_Attach_Stream */
+ /* */
+ /* FT_Set_Char_Size */
+ /* FT_Set_Pixel_Sizes */
+ /* FT_Request_Size */
+ /* FT_Select_Size */
+ /* FT_Size_Request_Type */
+ /* FT_Size_RequestRec */
+ /* FT_Size_Request */
+ /* FT_Set_Transform */
+ /* FT_Load_Glyph */
+ /* FT_Get_Char_Index */
+ /* FT_Get_First_Char */
+ /* FT_Get_Next_Char */
+ /* FT_Get_Name_Index */
+ /* FT_Load_Char */
+ /* */
+ /* FT_OPEN_MEMORY */
+ /* FT_OPEN_STREAM */
+ /* FT_OPEN_PATHNAME */
+ /* FT_OPEN_DRIVER */
+ /* FT_OPEN_PARAMS */
+ /* */
+ /* FT_LOAD_DEFAULT */
+ /* FT_LOAD_RENDER */
+ /* FT_LOAD_MONOCHROME */
+ /* FT_LOAD_LINEAR_DESIGN */
+ /* FT_LOAD_NO_SCALE */
+ /* FT_LOAD_NO_HINTING */
+ /* FT_LOAD_NO_BITMAP */
+ /* FT_LOAD_NO_AUTOHINT */
+ /* FT_LOAD_COLOR */
+ /* */
+ /* FT_LOAD_VERTICAL_LAYOUT */
+ /* FT_LOAD_IGNORE_TRANSFORM */
+ /* FT_LOAD_FORCE_AUTOHINT */
+ /* FT_LOAD_NO_RECURSE */
+ /* FT_LOAD_PEDANTIC */
+ /* */
+ /* FT_LOAD_TARGET_NORMAL */
+ /* FT_LOAD_TARGET_LIGHT */
+ /* FT_LOAD_TARGET_MONO */
+ /* FT_LOAD_TARGET_LCD */
+ /* FT_LOAD_TARGET_LCD_V */
+ /* */
+ /* FT_LOAD_TARGET_MODE */
+ /* */
+ /* FT_Render_Glyph */
+ /* FT_Render_Mode */
+ /* FT_Get_Kerning */
+ /* FT_Kerning_Mode */
+ /* FT_Get_Track_Kerning */
+ /* FT_Get_Glyph_Name */
+ /* FT_Get_Postscript_Name */
+ /* */
+ /* FT_CharMapRec */
+ /* FT_Select_Charmap */
+ /* FT_Set_Charmap */
+ /* FT_Get_Charmap_Index */
+ /* */
+ /* FT_Get_FSType_Flags */
+ /* FT_Get_SubGlyph_Info */
+ /* */
+ /* FT_Face_Internal */
+ /* FT_Size_Internal */
+ /* FT_Slot_Internal */
+ /* */
+ /* FT_FACE_FLAG_XXX */
+ /* FT_STYLE_FLAG_XXX */
+ /* FT_OPEN_XXX */
+ /* FT_LOAD_XXX */
+ /* FT_LOAD_TARGET_XXX */
+ /* FT_SUBGLYPH_FLAG_XXX */
+ /* FT_FSTYPE_XXX */
+ /* */
+ /* FT_HAS_FAST_GLYPHS */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Glyph_Metrics */
+ /* */
+ /* <Description> */
+ /* A structure used to model the metrics of a single glyph. The */
+ /* values are expressed in 26.6 fractional pixel format; if the flag */
+ /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
+ /* are expressed in font units instead. */
+ /* */
+ /* <Fields> */
+ /* width :: */
+ /* The glyph's width. */
+ /* */
+ /* height :: */
+ /* The glyph's height. */
+ /* */
+ /* horiBearingX :: */
+ /* Left side bearing for horizontal layout. */
+ /* */
+ /* horiBearingY :: */
+ /* Top side bearing for horizontal layout. */
+ /* */
+ /* horiAdvance :: */
+ /* Advance width for horizontal layout. */
+ /* */
+ /* vertBearingX :: */
+ /* Left side bearing for vertical layout. */
+ /* */
+ /* vertBearingY :: */
+ /* Top side bearing for vertical layout. Larger positive values */
+ /* mean further below the vertical glyph origin. */
+ /* */
+ /* vertAdvance :: */
+ /* Advance height for vertical layout. Positive values mean the */
+ /* glyph has a positive advance downward. */
+ /* */
+ /* <Note> */
+ /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
+ /* dimensions of the hinted glyph (in case hinting is applicable). */
+ /* */
+ /* Stroking a glyph with an outside border does not increase */
+ /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
+ /* values to account for the added width and height. */
+ /* */
+ typedef struct FT_Glyph_Metrics_
+ {
+ FT_Pos width;
+ FT_Pos height;
+
+ FT_Pos horiBearingX;
+ FT_Pos horiBearingY;
+ FT_Pos horiAdvance;
+
+ FT_Pos vertBearingX;
+ FT_Pos vertBearingY;
+ FT_Pos vertAdvance;
+
+ } FT_Glyph_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Bitmap_Size */
+ /* */
+ /* <Description> */
+ /* This structure models the metrics of a bitmap strike (i.e., a set */
+ /* of glyphs for a given point size and resolution) in a bitmap font. */
+ /* It is used for the `available_sizes' field of @FT_Face. */
+ /* */
+ /* <Fields> */
+ /* height :: The vertical distance, in pixels, between two */
+ /* consecutive baselines. It is always positive. */
+ /* */
+ /* width :: The average width, in pixels, of all glyphs in the */
+ /* strike. */
+ /* */
+ /* size :: The nominal size of the strike in 26.6 fractional */
+ /* points. This field is not very useful. */
+ /* */
+ /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
+ /* pixels. */
+ /* */
+ /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
+ /* pixels. */
+ /* */
+ /* <Note> */
+ /* Windows FNT: */
+ /* The nominal size given in a FNT font is not reliable. Thus when */
+ /* the driver finds it incorrect, it sets `size' to some calculated */
+ /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
+ /* height given in the font, respectively. */
+ /* */
+ /* TrueType embedded bitmaps: */
+ /* `size', `width', and `height' values are not contained in the */
+ /* bitmap strike itself. They are computed from the global font */
+ /* parameters. */
+ /* */
+ typedef struct FT_Bitmap_Size_
+ {
+ FT_Short height;
+ FT_Short width;
+
+ FT_Pos size;
+
+ FT_Pos x_ppem;
+ FT_Pos y_ppem;
+
+ } FT_Bitmap_Size;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Library */
+ /* */
+ /* <Description> */
+ /* A handle to a FreeType library instance. Each `library' is */
+ /* completely independent from the others; it is the `root' of a set */
+ /* of objects like fonts, faces, sizes, etc. */
+ /* */
+ /* It also embeds a memory manager (see @FT_Memory), as well as a */
+ /* scan-line converter object (see @FT_Raster). */
+ /* */
+ /* In multi-threaded applications it is easiest to use one */
+ /* `FT_Library' object per thread. In case this is too cumbersome, */
+ /* a single `FT_Library' object across threads is possible also */
+ /* (since FreeType version 2.5.6), as long as a mutex lock is used */
+ /* around @FT_New_Face and @FT_Done_Face. */
+ /* */
+ /* <Note> */
+ /* Library objects are normally created by @FT_Init_FreeType, and */
+ /* destroyed with @FT_Done_FreeType. If you need reference-counting */
+ /* (cf. @FT_Reference_Library), use @FT_New_Library and */
+ /* @FT_Done_Library. */
+ /* */
+ typedef struct FT_LibraryRec_ *FT_Library;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* module_management */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Module */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType module object. Each module can be a */
+ /* font driver, a renderer, or anything else that provides services */
+ /* to the formers. */
+ /* */
+ typedef struct FT_ModuleRec_* FT_Module;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Driver */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType font driver object. Each font driver */
+ /* is a special module capable of creating faces from font files. */
+ /* */
+ typedef struct FT_DriverRec_* FT_Driver;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Renderer */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType renderer. A renderer is a special */
+ /* module in charge of converting a glyph image to a bitmap, when */
+ /* necessary. Each renderer supports a given glyph image format, and */
+ /* one or more target surface depths. */
+ /* */
+ typedef struct FT_RendererRec_* FT_Renderer;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* base_interface */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face */
+ /* */
+ /* <Description> */
+ /* A handle to a given typographic face object. A face object models */
+ /* a given typeface, in a given style. */
+ /* */
+ /* <Note> */
+ /* Each face object also owns a single @FT_GlyphSlot object, as well */
+ /* as one or more @FT_Size objects. */
+ /* */
+ /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
+ /* a given filepathname or a custom input stream. */
+ /* */
+ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
+ /* */
+ /* An `FT_Face' object can only be safely used from one thread at a */
+ /* time. Similarly, creation and destruction of `FT_Face' with the */
+ /* same @FT_Library object can only be done from one thread at a */
+ /* time. On the other hand, functions like @FT_Load_Glyph and its */
+ /* siblings are thread-safe and do not need the lock to be held as */
+ /* long as the same `FT_Face' object is not used from multiple */
+ /* threads at the same time. */
+ /* */
+ /* <Also> */
+ /* See @FT_FaceRec for the publicly accessible fields of a given face */
+ /* object. */
+ /* */
+ typedef struct FT_FaceRec_* FT_Face;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size */
+ /* */
+ /* <Description> */
+ /* A handle to an object used to model a face scaled to a given */
+ /* character size. */
+ /* */
+ /* <Note> */
+ /* Each @FT_Face has an _active_ @FT_Size object that is used by */
+ /* functions like @FT_Load_Glyph to determine the scaling */
+ /* transformation that in turn is used to load and hint glyphs and */
+ /* metrics. */
+ /* */
+ /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
+ /* @FT_Request_Size or even @FT_Select_Size to change the content */
+ /* (i.e., the scaling values) of the active @FT_Size. */
+ /* */
+ /* You can use @FT_New_Size to create additional size objects for a */
+ /* given @FT_Face, but they won't be used by other functions until */
+ /* you activate it through @FT_Activate_Size. Only one size can be */
+ /* activated at any given time per face. */
+ /* */
+ /* <Also> */
+ /* See @FT_SizeRec for the publicly accessible fields of a given size */
+ /* object. */
+ /* */
+ typedef struct FT_SizeRec_* FT_Size;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* A handle to a given `glyph slot'. A slot is a container where it */
+ /* is possible to load any of the glyphs contained in its parent */
+ /* face. */
+ /* */
+ /* In other words, each time you call @FT_Load_Glyph or */
+ /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
+ /* i.e., the glyph's metrics, its image (bitmap or outline), and */
+ /* other control information. */
+ /* */
+ /* <Also> */
+ /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
+ /* */
+ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_CharMap */
+ /* */
+ /* <Description> */
+ /* A handle to a given character map. A charmap is used to translate */
+ /* character codes in a given encoding into glyph indexes for its */
+ /* parent's face. Some font formats may provide several charmaps per */
+ /* font. */
+ /* */
+ /* Each face object owns zero or more charmaps, but only one of them */
+ /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
+ /* */
+ /* The list of available charmaps in a face is available through the */
+ /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
+ /* */
+ /* The currently active charmap is available as `face->charmap'. */
+ /* You should call @FT_Set_Charmap to change it. */
+ /* */
+ /* <Note> */
+ /* When a new face is created (either through @FT_New_Face or */
+ /* @FT_Open_Face), the library looks for a Unicode charmap within */
+ /* the list and automatically activates it. */
+ /* */
+ /* <Also> */
+ /* See @FT_CharMapRec for the publicly accessible fields of a given */
+ /* character map. */
+ /* */
+ typedef struct FT_CharMapRec_* FT_CharMap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_ENC_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four-letter tags into an unsigned long. It is */
+ /* used to define `encoding' identifiers (see @FT_Encoding). */
+ /* */
+ /* <Note> */
+ /* Since many 16-bit compilers don't like 32-bit enumerations, you */
+ /* should redefine this macro in case of problems to something like */
+ /* this: */
+ /* */
+ /* { */
+ /* #define FT_ENC_TAG( value, a, b, c, d ) value */
+ /* } */
+ /* */
+ /* to get a simple enumeration without assigning special numbers. */
+ /* */
+
+#ifndef FT_ENC_TAG
+#define FT_ENC_TAG( value, a, b, c, d ) \
+ value = ( ( (FT_UInt32)(a) << 24 ) | \
+ ( (FT_UInt32)(b) << 16 ) | \
+ ( (FT_UInt32)(c) << 8 ) | \
+ (FT_UInt32)(d) )
+
+#endif /* FT_ENC_TAG */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Encoding */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify character sets supported by */
+ /* charmaps. Used in the @FT_Select_Charmap API function. */
+ /* */
+ /* <Note> */
+ /* Despite the name, this enumeration lists specific character */
+ /* repertories (i.e., charsets), and not text encoding methods (e.g., */
+ /* UTF-8, UTF-16, etc.). */
+ /* */
+ /* Other encodings might be defined in the future. */
+ /* */
+ /* <Values> */
+ /* FT_ENCODING_NONE :: */
+ /* The encoding value~0 is reserved. */
+ /* */
+ /* FT_ENCODING_UNICODE :: */
+ /* Corresponds to the Unicode character set. This value covers */
+ /* all versions of the Unicode repertoire, including ASCII and */
+ /* Latin-1. Most fonts include a Unicode charmap, but not all */
+ /* of them. */
+ /* */
+ /* For example, if you want to access Unicode value U+1F028 (and */
+ /* the font contains it), use value 0x1F028 as the input value for */
+ /* @FT_Get_Char_Index. */
+ /* */
+ /* FT_ENCODING_MS_SYMBOL :: */
+ /* Corresponds to the Microsoft Symbol encoding, used to encode */
+ /* mathematical symbols and wingdings. For more information, see */
+ /* `http://www.microsoft.com/typography/otspec/recom.htm', */
+ /* `http://www.kostis.net/charsets/symbol.htm', and */
+ /* `http://www.kostis.net/charsets/wingding.htm'. */
+ /* */
+ /* This encoding uses character codes from the PUA (Private Unicode */
+ /* Area) in the range U+F020-U+F0FF. */
+ /* */
+ /* FT_ENCODING_SJIS :: */
+ /* Corresponds to Japanese SJIS encoding. More info at */
+ /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */
+ /* See note on multi-byte encodings below. */
+ /* */
+ /* FT_ENCODING_GB2312 :: */
+ /* Corresponds to an encoding system for Simplified Chinese as used */
+ /* used in mainland China. */
+ /* */
+ /* FT_ENCODING_BIG5 :: */
+ /* Corresponds to an encoding system for Traditional Chinese as */
+ /* used in Taiwan and Hong Kong. */
+ /* */
+ /* FT_ENCODING_WANSUNG :: */
+ /* Corresponds to the Korean encoding system known as Wansung. */
+ /* For more information see */
+ /* `https://msdn.microsoft.com/en-US/goglobal/cc305154'. */
+ /* */
+ /* FT_ENCODING_JOHAB :: */
+ /* The Korean standard character set (KS~C 5601-1992), which */
+ /* corresponds to MS Windows code page 1361. This character set */
+ /* includes all possible Hangeul character combinations. */
+ /* */
+ /* FT_ENCODING_ADOBE_LATIN_1 :: */
+ /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
+ /* PostScript font. It is limited to 256 character codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_STANDARD :: */
+ /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
+ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+ /* codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_EXPERT :: */
+ /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
+ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+ /* codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_CUSTOM :: */
+ /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
+ /* OpenType/CFF fonts. It is limited to 256 character codes. */
+ /* */
+ /* FT_ENCODING_APPLE_ROMAN :: */
+ /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
+ /* and OpenType fonts contain a charmap for this encoding, since */
+ /* older versions of Mac OS are able to use it. */
+ /* */
+ /* FT_ENCODING_OLD_LATIN_2 :: */
+ /* This value is deprecated and was never used nor reported by */
+ /* FreeType. Don't use or test for it. */
+ /* */
+ /* FT_ENCODING_MS_SJIS :: */
+ /* Same as FT_ENCODING_SJIS. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_GB2312 :: */
+ /* Same as FT_ENCODING_GB2312. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_BIG5 :: */
+ /* Same as FT_ENCODING_BIG5. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_WANSUNG :: */
+ /* Same as FT_ENCODING_WANSUNG. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_JOHAB :: */
+ /* Same as FT_ENCODING_JOHAB. Deprecated. */
+ /* */
+ /* <Note> */
+ /* By default, FreeType automatically synthesizes a Unicode charmap */
+ /* for PostScript fonts, using their glyph names dictionaries. */
+ /* However, it also reports the encodings defined explicitly in the */
+ /* font file, for the cases when they are needed, with the Adobe */
+ /* values as well. */
+ /* */
+ /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
+ /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
+ /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
+ /* which encoding is really present. If, for example, the */
+ /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
+ /* the font is encoded in KOI8-R. */
+ /* */
+ /* FT_ENCODING_NONE is always set (with a single exception) by the */
+ /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
+ /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
+ /* which encoding is really present. For example, */
+ /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
+ /* Russian). */
+ /* */
+ /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
+ /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
+ /* FT_ENCODING_APPLE_ROMAN). */
+ /* */
+ /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
+ /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */
+ /* be needed to be able to distinguish Apple encoding variants. See */
+ /* */
+ /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */
+ /* */
+ /* to get an idea how to do that. Basically, if the language ID */
+ /* is~0, don't use it, otherwise subtract 1 from the language ID. */
+ /* Then examine `encoding_id'. If, for example, `encoding_id' is */
+ /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
+ /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
+ /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
+ /* variant the Arabic encoding. */
+ /* */
+ typedef enum FT_Encoding_
+ {
+ FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
+
+ FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
+ FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
+
+ FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
+ FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
+ FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
+ FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
+ FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
+
+ /* for backwards compatibility */
+ FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
+ FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
+ FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
+ FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
+ FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
+
+ FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
+
+ FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
+
+ FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
+
+ } FT_Encoding;
+
+
+ /* these constants are deprecated; use the corresponding `FT_Encoding' */
+ /* values instead */
+#define ft_encoding_none FT_ENCODING_NONE
+#define ft_encoding_unicode FT_ENCODING_UNICODE
+#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
+#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
+#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
+#define ft_encoding_sjis FT_ENCODING_SJIS
+#define ft_encoding_gb2312 FT_ENCODING_GB2312
+#define ft_encoding_big5 FT_ENCODING_BIG5
+#define ft_encoding_wansung FT_ENCODING_WANSUNG
+#define ft_encoding_johab FT_ENCODING_JOHAB
+
+#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
+#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
+#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
+#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_CharMapRec */
+ /* */
+ /* <Description> */
+ /* The base charmap structure. */
+ /* */
+ /* <Fields> */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
+ /* this with @FT_Select_Charmap. */
+ /* */
+ /* platform_id :: An ID number describing the platform for the */
+ /* following encoding ID. This comes directly from */
+ /* the TrueType specification and should be emulated */
+ /* for other formats. */
+ /* */
+ /* encoding_id :: A platform specific encoding number. This also */
+ /* comes from the TrueType specification and should be */
+ /* emulated similarly. */
+ /* */
+ typedef struct FT_CharMapRec_
+ {
+ FT_Face face;
+ FT_Encoding encoding;
+ FT_UShort platform_id;
+ FT_UShort encoding_id;
+
+ } FT_CharMapRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S E O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
+ /* model private data of a given @FT_Face object. */
+ /* */
+ /* This structure might change between releases of FreeType~2 and is */
+ /* not generally available to client applications. */
+ /* */
+ typedef struct FT_Face_InternalRec_* FT_Face_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_FaceRec */
+ /* */
+ /* <Description> */
+ /* FreeType root face class structure. A face object models a */
+ /* typeface in a font file. */
+ /* */
+ /* <Fields> */
+ /* num_faces :: The number of faces in the font file. Some */
+ /* font formats can have multiple faces in */
+ /* a font file. */
+ /* */
+ /* face_index :: This field holds two different values. */
+ /* Bits 0-15 are the index of the face in the */
+ /* font file (starting with value~0). They */
+ /* are set to~0 if there is only one face in */
+ /* the font file. */
+ /* */
+ /* Bits 16-30 are relevant to GX variation */
+ /* fonts only, holding the named instance */
+ /* index for the current face index (starting */
+ /* with value~1; value~0 indicates font access */
+ /* without GX variation data). For non-GX */
+ /* fonts, bits 16-30 are ignored. If we have */
+ /* the third named instance of face~4, say, */
+ /* `face_index' is set to 0x00030004. */
+ /* */
+ /* Bit 31 is always zero (this is, */
+ /* `face_index' is always a positive value). */
+ /* */
+ /* face_flags :: A set of bit flags that give important */
+ /* information about the face; see */
+ /* @FT_FACE_FLAG_XXX for the details. */
+ /* */
+ /* style_flags :: The lower 16~bits contain a set of bit */
+ /* flags indicating the style of the face; see */
+ /* @FT_STYLE_FLAG_XXX for the details. Bits */
+ /* 16-30 hold the number of named instances */
+ /* available for the current face if we have a */
+ /* GX variation (sub)font. Bit 31 is always */
+ /* zero (this is, `style_flags' is always a */
+ /* positive value). */
+ /* */
+ /* num_glyphs :: The number of glyphs in the face. If the */
+ /* face is scalable and has sbits (see */
+ /* `num_fixed_sizes'), it is set to the number */
+ /* of outline glyphs. */
+ /* */
+ /* For CID-keyed fonts, this value gives the */
+ /* highest CID used in the font. */
+ /* */
+ /* family_name :: The face's family name. This is an ASCII */
+ /* string, usually in English, that describes */
+ /* the typeface's family (like `Times New */
+ /* Roman', `Bodoni', `Garamond', etc). This */
+ /* is a least common denominator used to list */
+ /* fonts. Some formats (TrueType & OpenType) */
+ /* provide localized and Unicode versions of */
+ /* this string. Applications should use the */
+ /* format specific interface to access them. */
+ /* Can be NULL (e.g., in fonts embedded in a */
+ /* PDF file). */
+ /* */
+ /* In case the font doesn't provide a specific */
+ /* family name entry, FreeType tries to */
+ /* synthesize one, deriving it from other name */
+ /* entries. */
+ /* */
+ /* style_name :: The face's style name. This is an ASCII */
+ /* string, usually in English, that describes */
+ /* the typeface's style (like `Italic', */
+ /* `Bold', `Condensed', etc). Not all font */
+ /* formats provide a style name, so this field */
+ /* is optional, and can be set to NULL. As */
+ /* for `family_name', some formats provide */
+ /* localized and Unicode versions of this */
+ /* string. Applications should use the format */
+ /* specific interface to access them. */
+ /* */
+ /* num_fixed_sizes :: The number of bitmap strikes in the face. */
+ /* Even if the face is scalable, there might */
+ /* still be bitmap strikes, which are called */
+ /* `sbits' in that case. */
+ /* */
+ /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
+ /* strikes in the face. It is set to NULL if */
+ /* there is no bitmap strike. */
+ /* */
+ /* num_charmaps :: The number of charmaps in the face. */
+ /* */
+ /* charmaps :: An array of the charmaps of the face. */
+ /* */
+ /* generic :: A field reserved for client uses. See the */
+ /* @FT_Generic type description. */
+ /* */
+ /* bbox :: The font bounding box. Coordinates are */
+ /* expressed in font units (see */
+ /* `units_per_EM'). The box is large enough */
+ /* to contain any glyph from the font. Thus, */
+ /* `bbox.yMax' can be seen as the `maximum */
+ /* ascender', and `bbox.yMin' as the `minimum */
+ /* descender'. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* Note that the bounding box might be off by */
+ /* (at least) one pixel for hinted fonts. See */
+ /* @FT_Size_Metrics for further discussion. */
+ /* */
+ /* units_per_EM :: The number of font units per EM square for */
+ /* this face. This is typically 2048 for */
+ /* TrueType fonts, and 1000 for Type~1 fonts. */
+ /* Only relevant for scalable formats. */
+ /* */
+ /* ascender :: The typographic ascender of the face, */
+ /* expressed in font units. For font formats */
+ /* not having this information, it is set to */
+ /* `bbox.yMax'. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* descender :: The typographic descender of the face, */
+ /* expressed in font units. For font formats */
+ /* not having this information, it is set to */
+ /* `bbox.yMin'. Note that this field is */
+ /* usually negative. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* height :: This value is the vertical distance */
+ /* between two consecutive baselines, */
+ /* expressed in font units. It is always */
+ /* positive. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* If you want the global glyph height, use */
+ /* `ascender - descender'. */
+ /* */
+ /* max_advance_width :: The maximum advance width, in font units, */
+ /* for all glyphs in this face. This can be */
+ /* used to make word wrapping computations */
+ /* faster. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* max_advance_height :: The maximum advance height, in font units, */
+ /* for all glyphs in this face. This is only */
+ /* relevant for vertical layouts, and is set */
+ /* to `height' for fonts that do not provide */
+ /* vertical metrics. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* underline_position :: The position, in font units, of the */
+ /* underline line for this face. It is the */
+ /* center of the underlining stem. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* underline_thickness :: The thickness, in font units, of the */
+ /* underline for this face. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* glyph :: The face's associated glyph slot(s). */
+ /* */
+ /* size :: The current active size for this face. */
+ /* */
+ /* charmap :: The current active charmap for this face. */
+ /* */
+ /* <Note> */
+ /* Fields may be changed after a call to @FT_Attach_File or */
+ /* @FT_Attach_Stream. */
+ /* */
+ typedef struct FT_FaceRec_
+ {
+ FT_Long num_faces;
+ FT_Long face_index;
+
+ FT_Long face_flags;
+ FT_Long style_flags;
+
+ FT_Long num_glyphs;
+
+ FT_String* family_name;
+ FT_String* style_name;
+
+ FT_Int num_fixed_sizes;
+ FT_Bitmap_Size* available_sizes;
+
+ FT_Int num_charmaps;
+ FT_CharMap* charmaps;
+
+ FT_Generic generic;
+
+ /*# The following member variables (down to `underline_thickness') */
+ /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
+ /*# for bitmap fonts. */
+ FT_BBox bbox;
+
+ FT_UShort units_per_EM;
+ FT_Short ascender;
+ FT_Short descender;
+ FT_Short height;
+
+ FT_Short max_advance_width;
+ FT_Short max_advance_height;
+
+ FT_Short underline_position;
+ FT_Short underline_thickness;
+
+ FT_GlyphSlot glyph;
+ FT_Size size;
+ FT_CharMap charmap;
+
+ /*@private begin */
+
+ FT_Driver driver;
+ FT_Memory memory;
+ FT_Stream stream;
+
+ FT_ListRec sizes_list;
+
+ FT_Generic autohint; /* face-specific auto-hinter data */
+ void* extensions; /* unused */
+
+ FT_Face_Internal internal;
+
+ /*@private end */
+
+ } FT_FaceRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_FACE_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit flags used in the `face_flags' field of the */
+ /* @FT_FaceRec structure. They inform client applications of */
+ /* properties of the corresponding face. */
+ /* */
+ /* <Values> */
+ /* FT_FACE_FLAG_SCALABLE :: */
+ /* Indicates that the face contains outline glyphs. This doesn't */
+ /* prevent bitmap strikes, i.e., a face can have both this and */
+ /* and @FT_FACE_FLAG_FIXED_SIZES set. */
+ /* */
+ /* FT_FACE_FLAG_FIXED_SIZES :: */
+ /* Indicates that the face contains bitmap strikes. See also the */
+ /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
+ /* */
+ /* FT_FACE_FLAG_FIXED_WIDTH :: */
+ /* Indicates that the face contains fixed-width characters (like */
+ /* Courier, Lucido, MonoType, etc.). */
+ /* */
+ /* FT_FACE_FLAG_SFNT :: */
+ /* Indicates that the face uses the `sfnt' storage scheme. For */
+ /* now, this means TrueType and OpenType. */
+ /* */
+ /* FT_FACE_FLAG_HORIZONTAL :: */
+ /* Indicates that the face contains horizontal glyph metrics. This */
+ /* should be set for all common formats. */
+ /* */
+ /* FT_FACE_FLAG_VERTICAL :: */
+ /* Indicates that the face contains vertical glyph metrics. This */
+ /* is only available in some formats, not all of them. */
+ /* */
+ /* FT_FACE_FLAG_KERNING :: */
+ /* Indicates that the face contains kerning information. If set, */
+ /* the kerning distance can be retrieved through the function */
+ /* @FT_Get_Kerning. Otherwise the function always return the */
+ /* vector (0,0). Note that FreeType doesn't handle kerning data */
+ /* from the `GPOS' table (as present in some OpenType fonts). */
+ /* */
+ /* FT_FACE_FLAG_FAST_GLYPHS :: */
+ /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
+ /* */
+ /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
+ /* Indicates that the font contains multiple masters and is capable */
+ /* of interpolating between them. See the multiple-masters */
+ /* specific API for details. */
+ /* */
+ /* FT_FACE_FLAG_GLYPH_NAMES :: */
+ /* Indicates that the font contains glyph names that can be */
+ /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
+ /* fonts contain broken glyph name tables. Use the function */
+ /* @FT_Has_PS_Glyph_Names when needed. */
+ /* */
+ /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
+ /* Used internally by FreeType to indicate that a face's stream was */
+ /* provided by the client application and should not be destroyed */
+ /* when @FT_Done_Face is called. Don't read or test this flag. */
+ /* */
+ /* FT_FACE_FLAG_HINTER :: */
+ /* Set if the font driver has a hinting machine of its own. For */
+ /* example, with TrueType fonts, it makes sense to use data from */
+ /* the SFNT `gasp' table only if the native TrueType hinting engine */
+ /* (with the bytecode interpreter) is available and active. */
+ /* */
+ /* FT_FACE_FLAG_CID_KEYED :: */
+ /* Set if the font is CID-keyed. In that case, the font is not */
+ /* accessed by glyph indices but by CID values. For subsetted */
+ /* CID-keyed fonts this has the consequence that not all index */
+ /* values are a valid argument to FT_Load_Glyph. Only the CID */
+ /* values for which corresponding glyphs in the subsetted font */
+ /* exist make FT_Load_Glyph return successfully; in all other cases */
+ /* you get an `FT_Err_Invalid_Argument' error. */
+ /* */
+ /* Note that CID-keyed fonts that are in an SFNT wrapper don't */
+ /* have this flag set since the glyphs are accessed in the normal */
+ /* way (using contiguous indices); the `CID-ness' isn't visible to */
+ /* the application. */
+ /* */
+ /* FT_FACE_FLAG_TRICKY :: */
+ /* Set if the font is `tricky', this is, it always needs the */
+ /* font format's native hinting engine to get a reasonable result. */
+ /* A typical example is the Chinese font `mingli.ttf' that uses */
+ /* TrueType bytecode instructions to move and scale all of its */
+ /* subglyphs. */
+ /* */
+ /* It is not possible to auto-hint such fonts using */
+ /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
+ /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
+ /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
+ /* probably never want this except for demonstration purposes. */
+ /* */
+ /* Currently, there are about a dozen TrueType fonts in the list of */
+ /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
+ /* */
+ /* FT_FACE_FLAG_COLOR :: */
+ /* Set if the font has color glyph tables. To access color glyphs */
+ /* use @FT_LOAD_COLOR. */
+ /* */
+#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
+#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
+#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
+#define FT_FACE_FLAG_SFNT ( 1L << 3 )
+#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
+#define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
+#define FT_FACE_FLAG_KERNING ( 1L << 6 )
+#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
+#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
+#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
+#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
+#define FT_FACE_FLAG_HINTER ( 1L << 11 )
+#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
+#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
+#define FT_FACE_FLAG_COLOR ( 1L << 14 )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_HORIZONTAL( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains
+ * horizontal metrics (this is true for all font formats though).
+ *
+ * @also:
+ * @FT_HAS_VERTICAL can be used to check for vertical metrics.
+ *
+ */
+#define FT_HAS_HORIZONTAL( face ) \
+ ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_VERTICAL( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains real
+ * vertical metrics (and not only synthesized ones).
+ *
+ */
+#define FT_HAS_VERTICAL( face ) \
+ ( face->face_flags & FT_FACE_FLAG_VERTICAL )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_KERNING( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains kerning
+ * data that can be accessed with @FT_Get_Kerning.
+ *
+ */
+#define FT_HAS_KERNING( face ) \
+ ( face->face_flags & FT_FACE_FLAG_KERNING )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_SCALABLE( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a scalable
+ * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
+ * and PFR font formats.
+ *
+ */
+#define FT_IS_SCALABLE( face ) \
+ ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_SFNT( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a font
+ * whose format is based on the SFNT storage scheme. This usually
+ * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
+ * bitmap fonts.
+ *
+ * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
+ * @FT_TRUETYPE_TABLES_H are available.
+ *
+ */
+#define FT_IS_SFNT( face ) \
+ ( face->face_flags & FT_FACE_FLAG_SFNT )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_FIXED_WIDTH( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a font face
+ * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
+ * glyphs.
+ *
+ */
+#define FT_IS_FIXED_WIDTH( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_FIXED_SIZES( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some
+ * embedded bitmaps. See the `available_sizes' field of the
+ * @FT_FaceRec structure.
+ *
+ */
+#define FT_HAS_FIXED_SIZES( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_FAST_GLYPHS( face )
+ *
+ * @description:
+ * Deprecated.
+ *
+ */
+#define FT_HAS_FAST_GLYPHS( face ) 0
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_GLYPH_NAMES( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some glyph
+ * names that can be accessed through @FT_Get_Glyph_Name.
+ *
+ */
+#define FT_HAS_GLYPH_NAMES( face ) \
+ ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_MULTIPLE_MASTERS( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some
+ * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
+ * are then available to choose the exact design you want.
+ *
+ */
+#define FT_HAS_MULTIPLE_MASTERS( face ) \
+ ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_CID_KEYED( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a CID-keyed
+ * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
+ * details.
+ *
+ * If this macro is true, all functions defined in @FT_CID_H are
+ * available.
+ *
+ */
+#define FT_IS_CID_KEYED( face ) \
+ ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_TRICKY( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face represents a `tricky' font.
+ * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
+ *
+ */
+#define FT_IS_TRICKY( face ) \
+ ( face->face_flags & FT_FACE_FLAG_TRICKY )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_COLOR( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains
+ * tables for color glyphs.
+ *
+ */
+#define FT_HAS_COLOR( face ) \
+ ( face->face_flags & FT_FACE_FLAG_COLOR )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* FT_STYLE_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit flags used to indicate the style of a given face. */
+ /* These are used in the `style_flags' field of @FT_FaceRec. */
+ /* */
+ /* <Values> */
+ /* FT_STYLE_FLAG_ITALIC :: */
+ /* Indicates that a given face style is italic or oblique. */
+ /* */
+ /* FT_STYLE_FLAG_BOLD :: */
+ /* Indicates that a given face is bold. */
+ /* */
+ /* <Note> */
+ /* The style information as provided by FreeType is very basic. More */
+ /* details are beyond the scope and should be done on a higher level */
+ /* (for example, by analyzing various fields of the `OS/2' table in */
+ /* SFNT based fonts). */
+ /* */
+#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
+#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
+ /* model private data of a given @FT_Size object. */
+ /* */
+ typedef struct FT_Size_InternalRec_* FT_Size_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_Metrics */
+ /* */
+ /* <Description> */
+ /* The size metrics structure gives the metrics of a size object. */
+ /* */
+ /* <Fields> */
+ /* x_ppem :: The width of the scaled EM square in pixels, hence */
+ /* the term `ppem' (pixels per EM). It is also */
+ /* referred to as `nominal width'. */
+ /* */
+ /* y_ppem :: The height of the scaled EM square in pixels, */
+ /* hence the term `ppem' (pixels per EM). It is also */
+ /* referred to as `nominal height'. */
+ /* */
+ /* x_scale :: A 16.16 fractional scaling value used to convert */
+ /* horizontal metrics from font units to 26.6 */
+ /* fractional pixels. Only relevant for scalable */
+ /* font formats. */
+ /* */
+ /* y_scale :: A 16.16 fractional scaling value used to convert */
+ /* vertical metrics from font units to 26.6 */
+ /* fractional pixels. Only relevant for scalable */
+ /* font formats. */
+ /* */
+ /* ascender :: The ascender in 26.6 fractional pixels. See */
+ /* @FT_FaceRec for the details. */
+ /* */
+ /* descender :: The descender in 26.6 fractional pixels. See */
+ /* @FT_FaceRec for the details. */
+ /* */
+ /* height :: The height in 26.6 fractional pixels. See */
+ /* @FT_FaceRec for the details. */
+ /* */
+ /* max_advance :: The maximum advance width in 26.6 fractional */
+ /* pixels. See @FT_FaceRec for the details. */
+ /* */
+ /* <Note> */
+ /* The scaling values, if relevant, are determined first during a */
+ /* size changing operation. The remaining fields are then set by the */
+ /* driver. For scalable formats, they are usually set to scaled */
+ /* values of the corresponding fields in @FT_FaceRec. */
+ /* */
+ /* Note that due to glyph hinting, these values might not be exact */
+ /* for certain fonts. Thus they must be treated as unreliable */
+ /* with an error margin of at least one pixel! */
+ /* */
+ /* Indeed, the only way to get the exact metrics is to render _all_ */
+ /* glyphs. As this would be a definite performance hit, it is up to */
+ /* client applications to perform such computations. */
+ /* */
+ /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
+ /* */
+ typedef struct FT_Size_Metrics_
+ {
+ FT_UShort x_ppem; /* horizontal pixels per EM */
+ FT_UShort y_ppem; /* vertical pixels per EM */
+
+ FT_Fixed x_scale; /* scaling values used to convert font */
+ FT_Fixed y_scale; /* units to 26.6 fractional pixels */
+
+ FT_Pos ascender; /* ascender in 26.6 frac. pixels */
+ FT_Pos descender; /* descender in 26.6 frac. pixels */
+ FT_Pos height; /* text height in 26.6 frac. pixels */
+ FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
+
+ } FT_Size_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SizeRec */
+ /* */
+ /* <Description> */
+ /* FreeType root size class structure. A size object models a face */
+ /* object at a given size. */
+ /* */
+ /* <Fields> */
+ /* face :: Handle to the parent face object. */
+ /* */
+ /* generic :: A typeless pointer, unused by the FreeType library or */
+ /* any of its drivers. It can be used by client */
+ /* applications to link their own data to each size */
+ /* object. */
+ /* */
+ /* metrics :: Metrics for this size object. This field is read-only. */
+ /* */
+ typedef struct FT_SizeRec_
+ {
+ FT_Face face; /* parent face object */
+ FT_Generic generic; /* generic pointer for client uses */
+ FT_Size_Metrics metrics; /* size metrics */
+ FT_Size_Internal internal;
+
+ } FT_SizeRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SubGlyph */
+ /* */
+ /* <Description> */
+ /* The subglyph structure is an internal object used to describe */
+ /* subglyphs (for example, in the case of composites). */
+ /* */
+ /* <Note> */
+ /* The subglyph implementation is not part of the high-level API, */
+ /* hence the forward structure declaration. */
+ /* */
+ /* You can however retrieve subglyph information with */
+ /* @FT_Get_SubGlyph_Info. */
+ /* */
+ typedef struct FT_SubGlyphRec_* FT_SubGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Slot_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
+ /* model private data of a given @FT_GlyphSlot object. */
+ /* */
+ typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_GlyphSlotRec */
+ /* */
+ /* <Description> */
+ /* FreeType root glyph slot class structure. A glyph slot is a */
+ /* container where individual glyphs can be loaded, be they in */
+ /* outline or bitmap format. */
+ /* */
+ /* <Fields> */
+ /* library :: A handle to the FreeType library instance */
+ /* this slot belongs to. */
+ /* */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* next :: In some cases (like some font tools), several */
+ /* glyph slots per face object can be a good */
+ /* thing. As this is rare, the glyph slots are */
+ /* listed through a direct, single-linked list */
+ /* using its `next' field. */
+ /* */
+ /* generic :: A typeless pointer unused by the FreeType */
+ /* library or any of its drivers. It can be */
+ /* used by client applications to link their own */
+ /* data to each glyph slot object. */
+ /* */
+ /* metrics :: The metrics of the last loaded glyph in the */
+ /* slot. The returned values depend on the last */
+ /* load flags (see the @FT_Load_Glyph API */
+ /* function) and can be expressed either in 26.6 */
+ /* fractional pixels or font units. */
+ /* */
+ /* Note that even when the glyph image is */
+ /* transformed, the metrics are not. */
+ /* */
+ /* linearHoriAdvance :: The advance width of the unhinted glyph. */
+ /* Its value is expressed in 16.16 fractional */
+ /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
+ /* when loading the glyph. This field can be */
+ /* important to perform correct WYSIWYG layout. */
+ /* Only relevant for outline glyphs. */
+ /* */
+ /* linearVertAdvance :: The advance height of the unhinted glyph. */
+ /* Its value is expressed in 16.16 fractional */
+ /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
+ /* when loading the glyph. This field can be */
+ /* important to perform correct WYSIWYG layout. */
+ /* Only relevant for outline glyphs. */
+ /* */
+ /* advance :: This shorthand is, depending on */
+ /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
+ /* (hinted) advance width for the glyph, in 26.6 */
+ /* fractional pixel format. As specified with */
+ /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
+ /* `horiAdvance' or the `vertAdvance' value of */
+ /* `metrics' field. */
+ /* */
+ /* format :: This field indicates the format of the image */
+ /* contained in the glyph slot. Typically */
+ /* @FT_GLYPH_FORMAT_BITMAP, */
+ /* @FT_GLYPH_FORMAT_OUTLINE, or */
+ /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
+ /* possible. */
+ /* */
+ /* bitmap :: This field is used as a bitmap descriptor */
+ /* when the slot format is */
+ /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
+ /* address and content of the bitmap buffer can */
+ /* change between calls of @FT_Load_Glyph and a */
+ /* few other functions. */
+ /* */
+ /* bitmap_left :: The bitmap's left bearing expressed in */
+ /* integer pixels. Only valid if the format is */
+ /* @FT_GLYPH_FORMAT_BITMAP, this is, if the */
+ /* glyph slot contains a bitmap. */
+ /* */
+ /* bitmap_top :: The bitmap's top bearing expressed in integer */
+ /* pixels. Remember that this is the distance */
+ /* from the baseline to the top-most glyph */
+ /* scanline, upwards y~coordinates being */
+ /* *positive*. */
+ /* */
+ /* outline :: The outline descriptor for the current glyph */
+ /* image if its format is */
+ /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
+ /* loaded, `outline' can be transformed, */
+ /* distorted, embolded, etc. However, it must */
+ /* not be freed. */
+ /* */
+ /* num_subglyphs :: The number of subglyphs in a composite glyph. */
+ /* This field is only valid for the composite */
+ /* glyph format that should normally only be */
+ /* loaded with the @FT_LOAD_NO_RECURSE flag. */
+ /* */
+ /* subglyphs :: An array of subglyph descriptors for */
+ /* composite glyphs. There are `num_subglyphs' */
+ /* elements in there. Currently internal to */
+ /* FreeType. */
+ /* */
+ /* control_data :: Certain font drivers can also return the */
+ /* control data for a given glyph image (e.g. */
+ /* TrueType bytecode, Type~1 charstrings, etc.). */
+ /* This field is a pointer to such data. */
+ /* */
+ /* control_len :: This is the length in bytes of the control */
+ /* data. */
+ /* */
+ /* other :: Really wicked formats can use this pointer to */
+ /* present their own glyph image to client */
+ /* applications. Note that the application */
+ /* needs to know about the image format. */
+ /* */
+ /* lsb_delta :: The difference between hinted and unhinted */
+ /* left side bearing while auto-hinting is */
+ /* active. Zero otherwise. */
+ /* */
+ /* rsb_delta :: The difference between hinted and unhinted */
+ /* right side bearing while auto-hinting is */
+ /* active. Zero otherwise. */
+ /* */
+ /* <Note> */
+ /* If @FT_Load_Glyph is called with default flags (see */
+ /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
+ /* its native format (e.g., an outline glyph for TrueType and Type~1 */
+ /* formats). */
+ /* */
+ /* This image can later be converted into a bitmap by calling */
+ /* @FT_Render_Glyph. This function finds the current renderer for */
+ /* the native image's format, then invokes it. */
+ /* */
+ /* The renderer is in charge of transforming the native image through */
+ /* the slot's face transformation fields, then converting it into a */
+ /* bitmap that is returned in `slot->bitmap'. */
+ /* */
+ /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
+ /* to specify the position of the bitmap relative to the current pen */
+ /* position (e.g., coordinates (0,0) on the baseline). Of course, */
+ /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
+ /* */
+ /* <Note> */
+ /* Here is a small pseudo code fragment that shows how to use */
+ /* `lsb_delta' and `rsb_delta': */
+ /* */
+ /* { */
+ /* FT_Pos origin_x = 0; */
+ /* FT_Pos prev_rsb_delta = 0; */
+ /* */
+ /* */
+ /* for all glyphs do */
+ /* <compute kern between current and previous glyph and add it to */
+ /* `origin_x'> */
+ /* */
+ /* <load glyph with `FT_Load_Glyph'> */
+ /* */
+ /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
+ /* origin_x -= 64; */
+ /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
+ /* origin_x += 64; */
+ /* */
+ /* prev_rsb_delta = face->glyph->rsb_delta; */
+ /* */
+ /* <save glyph image, or render glyph, or ...> */
+ /* */
+ /* origin_x += face->glyph->advance.x; */
+ /* endfor */
+ /* } */
+ /* */
+ typedef struct FT_GlyphSlotRec_
+ {
+ FT_Library library;
+ FT_Face face;
+ FT_GlyphSlot next;
+ FT_UInt reserved; /* retained for binary compatibility */
+ FT_Generic generic;
+
+ FT_Glyph_Metrics metrics;
+ FT_Fixed linearHoriAdvance;
+ FT_Fixed linearVertAdvance;
+ FT_Vector advance;
+
+ FT_Glyph_Format format;
+
+ FT_Bitmap bitmap;
+ FT_Int bitmap_left;
+ FT_Int bitmap_top;
+
+ FT_Outline outline;
+
+ FT_UInt num_subglyphs;
+ FT_SubGlyph subglyphs;
+
+ void* control_data;
+ long control_len;
+
+ FT_Pos lsb_delta;
+ FT_Pos rsb_delta;
+
+ void* other;
+
+ FT_Slot_Internal internal;
+
+ } FT_GlyphSlotRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* F U N C T I O N S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Init_FreeType */
+ /* */
+ /* <Description> */
+ /* Initialize a new FreeType library object. The set of modules */
+ /* that are registered by this function is determined at build time. */
+ /* */
+ /* <Output> */
+ /* alibrary :: A handle to a new library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* In case you want to provide your own memory allocating routines, */
+ /* use @FT_New_Library instead, followed by a call to */
+ /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
+ /* */
+ /* See the documentation of @FT_Library and @FT_Face for */
+ /* multi-threading issues. */
+ /* */
+ /* If you need reference-counting (cf. @FT_Reference_Library), use */
+ /* @FT_New_Library and @FT_Done_Library. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Init_FreeType( FT_Library *alibrary );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_FreeType */
+ /* */
+ /* <Description> */
+ /* Destroy a given FreeType library object and all of its children, */
+ /* including resources, drivers, faces, sizes, etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the target library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_FreeType( FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_OPEN_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit field constants used within the `flags' field of the */
+ /* @FT_Open_Args structure. */
+ /* */
+ /* <Values> */
+ /* FT_OPEN_MEMORY :: This is a memory-based stream. */
+ /* */
+ /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
+ /* */
+ /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
+ /* name. */
+ /* */
+ /* FT_OPEN_DRIVER :: Use the `driver' field. */
+ /* */
+ /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
+ /* */
+ /* <Note> */
+ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
+ /* flags are mutually exclusive. */
+ /* */
+#define FT_OPEN_MEMORY 0x1
+#define FT_OPEN_STREAM 0x2
+#define FT_OPEN_PATHNAME 0x4
+#define FT_OPEN_DRIVER 0x8
+#define FT_OPEN_PARAMS 0x10
+
+
+ /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */
+ /* values instead */
+#define ft_open_memory FT_OPEN_MEMORY
+#define ft_open_stream FT_OPEN_STREAM
+#define ft_open_pathname FT_OPEN_PATHNAME
+#define ft_open_driver FT_OPEN_DRIVER
+#define ft_open_params FT_OPEN_PARAMS
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Parameter */
+ /* */
+ /* <Description> */
+ /* A simple structure used to pass more or less generic parameters to */
+ /* @FT_Open_Face. */
+ /* */
+ /* <Fields> */
+ /* tag :: A four-byte identification tag. */
+ /* */
+ /* data :: A pointer to the parameter data. */
+ /* */
+ /* <Note> */
+ /* The ID and function of parameters are driver-specific. See the */
+ /* various FT_PARAM_TAG_XXX flags for more information. */
+ /* */
+ typedef struct FT_Parameter_
+ {
+ FT_ULong tag;
+ FT_Pointer data;
+
+ } FT_Parameter;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Open_Args */
+ /* */
+ /* <Description> */
+ /* A structure used to indicate how to open a new font file or */
+ /* stream. A pointer to such a structure can be used as a parameter */
+ /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
+ /* */
+ /* <Fields> */
+ /* flags :: A set of bit flags indicating how to use the */
+ /* structure. */
+ /* */
+ /* memory_base :: The first byte of the file in memory. */
+ /* */
+ /* memory_size :: The size in bytes of the file in memory. */
+ /* */
+ /* pathname :: A pointer to an 8-bit file pathname. */
+ /* */
+ /* stream :: A handle to a source stream object. */
+ /* */
+ /* driver :: This field is exclusively used by @FT_Open_Face; */
+ /* it simply specifies the font driver to use to open */
+ /* the face. If set to~0, FreeType tries to load the */
+ /* face with each one of the drivers in its list. */
+ /* */
+ /* num_params :: The number of extra parameters. */
+ /* */
+ /* params :: Extra parameters passed to the font driver when */
+ /* opening a new face. */
+ /* */
+ /* <Note> */
+ /* The stream type is determined by the contents of `flags' that */
+ /* are tested in the following order by @FT_Open_Face: */
+ /* */
+ /* If the @FT_OPEN_MEMORY bit is set, assume that this is a */
+ /* memory file of `memory_size' bytes, located at `memory_address'. */
+ /* The data are are not copied, and the client is responsible for */
+ /* releasing and destroying them _after_ the corresponding call to */
+ /* @FT_Done_Face. */
+ /* */
+ /* Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a */
+ /* custom input stream `stream' is used. */
+ /* */
+ /* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this */
+ /* is a normal file and use `pathname' to open it. */
+ /* */
+ /* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to */
+ /* open the file with the driver whose handler is in `driver'. */
+ /* */
+ /* If the @FT_OPEN_PARAMS bit is set, the parameters given by */
+ /* `num_params' and `params' is used. They are ignored otherwise. */
+ /* */
+ /* Ideally, both the `pathname' and `params' fields should be tagged */
+ /* as `const'; this is missing for API backwards compatibility. In */
+ /* other words, applications should treat them as read-only. */
+ /* */
+ typedef struct FT_Open_Args_
+ {
+ FT_UInt flags;
+ const FT_Byte* memory_base;
+ FT_Long memory_size;
+ FT_String* pathname;
+ FT_Stream stream;
+ FT_Module driver;
+ FT_Int num_params;
+ FT_Parameter* params;
+
+ } FT_Open_Args;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Open_Face to open a font by its pathname. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* pathname :: A path to the font file. */
+ /* */
+ /* face_index :: See @FT_Open_Face for a detailed description of this */
+ /* parameter. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. If `face_index' is */
+ /* greater than or equal to zero, it must be non-NULL. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Use @FT_Done_Face to destroy the created @FT_Face object (along */
+ /* with its slot and sizes). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face( FT_Library library,
+ const char* filepathname,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Memory_Face */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Open_Face to open a font that has been */
+ /* loaded into memory. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* file_base :: A pointer to the beginning of the font data. */
+ /* */
+ /* file_size :: The size of the memory chunk used by the font data. */
+ /* */
+ /* face_index :: See @FT_Open_Face for a detailed description of this */
+ /* parameter. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. If `face_index' is */
+ /* greater than or equal to zero, it must be non-NULL. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* You must not deallocate the memory before calling @FT_Done_Face. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Memory_Face( FT_Library library,
+ const FT_Byte* file_base,
+ FT_Long file_size,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Open_Face */
+ /* */
+ /* <Description> */
+ /* Create a face object from a given resource described by */
+ /* @FT_Open_Args. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* args :: A pointer to an `FT_Open_Args' structure that must */
+ /* be filled by the caller. */
+ /* */
+ /* face_index :: This field holds two different values. Bits 0-15 */
+ /* are the index of the face in the font file (starting */
+ /* with value~0). Set it to~0 if there is only one */
+ /* face in the font file. */
+ /* */
+ /* Bits 16-30 are relevant to GX variation fonts only, */
+ /* specifying the named instance index for the current */
+ /* face index (starting with value~1; value~0 makes */
+ /* FreeType ignore named instances). For non-GX fonts, */
+ /* bits 16-30 are ignored. Assuming that you want to */
+ /* access the third named instance in face~4, */
+ /* `face_index' should be set to 0x00030004. If you */
+ /* want to access face~4 without GX variation handling, */
+ /* simply set `face_index' to value~4. */
+ /* */
+ /* FT_Open_Face and its siblings can be used to quickly */
+ /* check whether the font format of a given font */
+ /* resource is supported by FreeType. In general, if */
+ /* the `face_index' argument is negative, the */
+ /* function's return value is~0 if the font format is */
+ /* recognized, or non-zero otherwise. The function */
+ /* allocates a more or less empty face handle in */
+ /* `*aface' (if `aface' isn't NULL); the only two */
+ /* useful fields in this special case are */
+ /* `face->num_faces' and `face->style_flags'. For any */
+ /* negative value of `face_index', `face->num_faces' */
+ /* gives the number of faces within the font file. For */
+ /* the negative value `-(N+1)' (with `N' a 16-bit */
+ /* value), bits 16-30 in `face->style_flags' give the */
+ /* number of named instances in face `N' if we have a */
+ /* GX variation font (or zero otherwise). After */
+ /* examination, the returned @FT_Face structure should */
+ /* be deallocated with a call to @FT_Done_Face. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. If `face_index' is */
+ /* greater than or equal to zero, it must be non-NULL. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Unlike FreeType 1.x, this function automatically creates a glyph */
+ /* slot for the face object that can be accessed directly through */
+ /* `face->glyph'. */
+ /* */
+ /* Each new face object created with this function also owns a */
+ /* default @FT_Size object, accessible as `face->size'. */
+ /* */
+ /* One @FT_Library instance can have multiple face objects, this is, */
+ /* @FT_Open_Face and its siblings can be called multiple times using */
+ /* the same `library' argument. */
+ /* */
+ /* See the discussion of reference counters in the description of */
+ /* @FT_Reference_Face. */
+ /* */
+ /* To loop over all faces, use code similar to the following snippet */
+ /* (omitting the error handling). */
+ /* */
+ /* { */
+ /* ... */
+ /* FT_Face face; */
+ /* FT_Long i, num_faces; */
+ /* */
+ /* */
+ /* error = FT_Open_Face( library, args, -1, &face ); */
+ /* if ( error ) { ... } */
+ /* */
+ /* num_faces = face->num_faces; */
+ /* FT_Done_Face( face ); */
+ /* */
+ /* for ( i = 0; i < num_faces; i++ ) */
+ /* { */
+ /* ... */
+ /* error = FT_Open_Face( library, args, i, &face ); */
+ /* ... */
+ /* FT_Done_Face( face ); */
+ /* ... */
+ /* } */
+ /* } */
+ /* */
+ /* To loop over all valid values for `face_index', use something */
+ /* similar to the following snippet, again without error handling. */
+ /* The code accesses all faces immediately (thus only a single call */
+ /* of `FT_Open_Face' within the do-loop), with and without named */
+ /* instances. */
+ /* */
+ /* { */
+ /* ... */
+ /* FT_Face face; */
+ /* */
+ /* FT_Long num_faces = 0; */
+ /* FT_Long num_instances = 0; */
+ /* */
+ /* FT_Long face_idx = 0; */
+ /* FT_Long instance_idx = 0; */
+ /* */
+ /* */
+ /* do */
+ /* { */
+ /* FT_Long id = ( instance_idx << 16 ) + face_idx; */
+ /* */
+ /* */
+ /* error = FT_Open_Face( library, args, id, &face ); */
+ /* if ( error ) { ... } */
+ /* */
+ /* num_faces = face->num_faces; */
+ /* num_instances = face->style_flags >> 16; */
+ /* */
+ /* ... */
+ /* */
+ /* FT_Done_Face( face ); */
+ /* */
+ /* if ( instance_idx < num_instances ) */
+ /* instance_idx++; */
+ /* else */
+ /* { */
+ /* face_idx++; */
+ /* instance_idx = 0; */
+ /* } */
+ /* */
+ /* } while ( face_idx < num_faces ) */
+ /* } */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Open_Face( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_File */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Attach_Stream to attach a file. */
+ /* */
+ /* <InOut> */
+ /* face :: The target face object. */
+ /* */
+ /* <Input> */
+ /* filepathname :: The pathname. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Attach_File( FT_Face face,
+ const char* filepathname );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_Stream */
+ /* */
+ /* <Description> */
+ /* `Attach' data to a face object. Normally, this is used to read */
+ /* additional information for the face object. For example, you can */
+ /* attach an AFM file that comes with a Type~1 font to get the */
+ /* kerning values and other metrics. */
+ /* */
+ /* <InOut> */
+ /* face :: The target face object. */
+ /* */
+ /* <Input> */
+ /* parameters :: A pointer to @FT_Open_Args that must be filled by */
+ /* the caller. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The meaning of the `attach' (i.e., what really happens when the */
+ /* new file is read) is not fixed by FreeType itself. It really */
+ /* depends on the font format (and thus the font driver). */
+ /* */
+ /* Client applications are expected to know what they are doing */
+ /* when invoking this function. Most drivers simply do not implement */
+ /* file attachments. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Attach_Stream( FT_Face face,
+ FT_Open_Args* parameters );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Reference_Face */
+ /* */
+ /* <Description> */
+ /* A counter gets initialized to~1 at the time an @FT_Face structure */
+ /* is created. This function increments the counter. @FT_Done_Face */
+ /* then only destroys a face if the counter is~1, otherwise it simply */
+ /* decrements the counter. */
+ /* */
+ /* This function helps in managing life-cycles of structures that */
+ /* reference @FT_Face objects. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Since> */
+ /* 2.4.2 */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Reference_Face( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Face */
+ /* */
+ /* <Description> */
+ /* Discard a given face object, as well as all of its child slots and */
+ /* sizes. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* See the discussion of reference counters in the description of */
+ /* @FT_Reference_Face. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_Face( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Select_Size */
+ /* */
+ /* <Description> */
+ /* Select a bitmap strike. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* strike_index :: The index of the bitmap strike in the */
+ /* `available_sizes' field of @FT_FaceRec structure. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Select_Size( FT_Face face,
+ FT_Int strike_index );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Size_Request_Type */
+ /* */
+ /* <Description> */
+ /* An enumeration type that lists the supported size request types. */
+ /* */
+ /* <Values> */
+ /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
+ /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
+ /* used to determine both scaling values. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
+ /* The real dimension. The sum of the the `ascender' and (minus */
+ /* of) the `descender' fields of @FT_FaceRec are used to determine */
+ /* both scaling values. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_BBOX :: */
+ /* The font bounding box. The width and height of the `bbox' field */
+ /* of @FT_FaceRec are used to determine the horizontal and vertical */
+ /* scaling value, respectively. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_CELL :: */
+ /* The `max_advance_width' field of @FT_FaceRec is used to */
+ /* determine the horizontal scaling value; the vertical scaling */
+ /* value is determined the same way as */
+ /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
+ /* values are set to the smaller one. This type is useful if you */
+ /* want to specify the font size for, say, a window of a given */
+ /* dimension and 80x24 cells. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_SCALES :: */
+ /* Specify the scaling values directly. */
+ /* */
+ /* <Note> */
+ /* The above descriptions only apply to scalable formats. For bitmap */
+ /* formats, the behaviour is up to the driver. */
+ /* */
+ /* See the note section of @FT_Size_Metrics if you wonder how size */
+ /* requesting relates to scaling values. */
+ /* */
+ typedef enum FT_Size_Request_Type_
+ {
+ FT_SIZE_REQUEST_TYPE_NOMINAL,
+ FT_SIZE_REQUEST_TYPE_REAL_DIM,
+ FT_SIZE_REQUEST_TYPE_BBOX,
+ FT_SIZE_REQUEST_TYPE_CELL,
+ FT_SIZE_REQUEST_TYPE_SCALES,
+
+ FT_SIZE_REQUEST_TYPE_MAX
+
+ } FT_Size_Request_Type;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_RequestRec */
+ /* */
+ /* <Description> */
+ /* A structure used to model a size request. */
+ /* */
+ /* <Fields> */
+ /* type :: See @FT_Size_Request_Type. */
+ /* */
+ /* width :: The desired width. */
+ /* */
+ /* height :: The desired height. */
+ /* */
+ /* horiResolution :: The horizontal resolution. If set to zero, */
+ /* `width' is treated as a 26.6 fractional pixel */
+ /* value. */
+ /* */
+ /* vertResolution :: The vertical resolution. If set to zero, */
+ /* `height' is treated as a 26.6 fractional pixel */
+ /* value. */
+ /* */
+ /* <Note> */
+ /* If `width' is zero, then the horizontal scaling value is set equal */
+ /* to the vertical scaling value, and vice versa. */
+ /* */
+ typedef struct FT_Size_RequestRec_
+ {
+ FT_Size_Request_Type type;
+ FT_Long width;
+ FT_Long height;
+ FT_UInt horiResolution;
+ FT_UInt vertResolution;
+
+ } FT_Size_RequestRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_Request */
+ /* */
+ /* <Description> */
+ /* A handle to a size request structure. */
+ /* */
+ typedef struct FT_Size_RequestRec_ *FT_Size_Request;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Request_Size */
+ /* */
+ /* <Description> */
+ /* Resize the scale of the active @FT_Size object in a face. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* req :: A pointer to a @FT_Size_RequestRec. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Although drivers may select the bitmap strike matching the */
+ /* request, you should not rely on this if you intend to select a */
+ /* particular bitmap strike. Use @FT_Select_Size instead in that */
+ /* case. */
+ /* */
+ /* The relation between the requested size and the resulting glyph */
+ /* size is dependent entirely on how the size is defined in the */
+ /* source face. The font designer chooses the final size of each */
+ /* glyph relative to this size. For more information refer to */
+ /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
+ /* */
+ /* Don't use this function if you are using the FreeType cache API. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Request_Size( FT_Face face,
+ FT_Size_Request req );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Char_Size */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Request_Size to request the nominal size */
+ /* (in points). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* char_width :: The nominal width, in 26.6 fractional points. */
+ /* */
+ /* char_height :: The nominal height, in 26.6 fractional points. */
+ /* */
+ /* horz_resolution :: The horizontal resolution in dpi. */
+ /* */
+ /* vert_resolution :: The vertical resolution in dpi. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* If either the character width or height is zero, it is set equal */
+ /* to the other value. */
+ /* */
+ /* If either the horizontal or vertical resolution is zero, it is set */
+ /* equal to the other value. */
+ /* */
+ /* A character width or height smaller than 1pt is set to 1pt; if */
+ /* both resolution values are zero, they are set to 72dpi. */
+ /* */
+ /* Don't use this function if you are using the FreeType cache API. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Char_Size( FT_Face face,
+ FT_F26Dot6 char_width,
+ FT_F26Dot6 char_height,
+ FT_UInt horz_resolution,
+ FT_UInt vert_resolution );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Pixel_Sizes */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Request_Size to request the nominal size */
+ /* (in pixels). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* <Input> */
+ /* pixel_width :: The nominal width, in pixels. */
+ /* */
+ /* pixel_height :: The nominal height, in pixels. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* You should not rely on the resulting glyphs matching, or being */
+ /* constrained, to this pixel size. Refer to @FT_Request_Size to */
+ /* understand how requested sizes relate to actual sizes. */
+ /* */
+ /* Don't use this function if you are using the FreeType cache API. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Pixel_Sizes( FT_Face face,
+ FT_UInt pixel_width,
+ FT_UInt pixel_height );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Glyph */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph into the glyph slot of a */
+ /* face object. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the target face object where the glyph */
+ /* is loaded. */
+ /* */
+ /* <Input> */
+ /* glyph_index :: The index of the glyph in the font file. For */
+ /* CID-keyed fonts (either in PS or in CFF format) */
+ /* this argument specifies the CID value. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* @FT_LOAD_XXX constants can be used to control the */
+ /* glyph loading process (e.g., whether the outline */
+ /* should be scaled, whether to load bitmaps or not, */
+ /* whether to hint the outline, etc). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The loaded glyph may be transformed. See @FT_Set_Transform for */
+ /* the details. */
+ /* */
+ /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
+ /* returned for invalid CID values (this is, for CID values that */
+ /* don't have a corresponding glyph in the font). See the discussion */
+ /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Load_Glyph( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Char */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph into the glyph slot of a */
+ /* face object, according to its character code. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object where the glyph */
+ /* is loaded. */
+ /* */
+ /* <Input> */
+ /* char_code :: The glyph's character code, according to the */
+ /* current charmap used in the face. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* @FT_LOAD_XXX constants can be used to control the */
+ /* glyph loading process (e.g., whether the outline */
+ /* should be scaled, whether to load bitmaps or not, */
+ /* whether to hint the outline, etc). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Load_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_Int32 load_flags );
+
+
+ /*************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_XXX
+ *
+ * @description:
+ * A list of bit field constants used with @FT_Load_Glyph to indicate
+ * what kind of operations to perform during glyph loading.
+ *
+ * @values:
+ * FT_LOAD_DEFAULT ::
+ * Corresponding to~0, this value is used as the default glyph load
+ * operation. In this case, the following happens:
+ *
+ * 1. FreeType looks for a bitmap for the glyph corresponding to the
+ * face's current size. If one is found, the function returns.
+ * The bitmap data can be accessed from the glyph slot (see note
+ * below).
+ *
+ * 2. If no embedded bitmap is searched or found, FreeType looks for a
+ * scalable outline. If one is found, it is loaded from the font
+ * file, scaled to device pixels, then `hinted' to the pixel grid
+ * in order to optimize it. The outline data can be accessed from
+ * the glyph slot (see note below).
+ *
+ * Note that by default, the glyph loader doesn't render outlines into
+ * bitmaps. The following flags are used to modify this default
+ * behaviour to more specific and useful cases.
+ *
+ * FT_LOAD_NO_SCALE ::
+ * Don't scale the loaded outline glyph but keep it in font units.
+ *
+ * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
+ * unsets @FT_LOAD_RENDER.
+ *
+ * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
+ * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
+ * subglyphs must be scaled and positioned with hinting instructions.
+ * This can be solved by loading the font without FT_LOAD_NO_SCALE and
+ * setting the character size to `font->units_per_EM'.
+ *
+ * FT_LOAD_NO_HINTING ::
+ * Disable hinting. This generally generates `blurrier' bitmap glyphs
+ * when the glyph are rendered in any of the anti-aliased modes. See
+ * also the note below.
+ *
+ * This flag is implied by @FT_LOAD_NO_SCALE.
+ *
+ * FT_LOAD_RENDER ::
+ * Call @FT_Render_Glyph after the glyph is loaded. By default, the
+ * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
+ * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
+ *
+ * This flag is unset by @FT_LOAD_NO_SCALE.
+ *
+ * FT_LOAD_NO_BITMAP ::
+ * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
+ * flag.
+ *
+ * @FT_LOAD_NO_SCALE always sets this flag.
+ *
+ * FT_LOAD_VERTICAL_LAYOUT ::
+ * Load the glyph for vertical text layout. In particular, the
+ * `advance' value in the @FT_GlyphSlotRec structure is set to the
+ * `vertAdvance' value of the `metrics' field.
+ *
+ * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
+ * this flag currently. Reason is that in this case vertical metrics
+ * get synthesized, and those values are not always consistent across
+ * various font formats.
+ *
+ * FT_LOAD_FORCE_AUTOHINT ::
+ * Indicates that the auto-hinter is preferred over the font's native
+ * hinter. See also the note below.
+ *
+ * FT_LOAD_PEDANTIC ::
+ * Indicates that the font driver should perform pedantic verifications
+ * during glyph loading. This is mostly used to detect broken glyphs
+ * in fonts. By default, FreeType tries to handle broken fonts also.
+ *
+ * In particular, errors from the TrueType bytecode engine are not
+ * passed to the application if this flag is not set; this might
+ * result in partially hinted or distorted glyphs in case a glyph's
+ * bytecode is buggy.
+ *
+ * FT_LOAD_NO_RECURSE ::
+ * Indicate that the font driver should not load composite glyphs
+ * recursively. Instead, it should set the `num_subglyph' and
+ * `subglyphs' values of the glyph slot accordingly, and set
+ * `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE. The description of
+ * subglyphs can then be accessed with @FT_Get_SubGlyph_Info.
+ *
+ * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
+ *
+ * FT_LOAD_IGNORE_TRANSFORM ::
+ * Indicates that the transform matrix set by @FT_Set_Transform should
+ * be ignored.
+ *
+ * FT_LOAD_MONOCHROME ::
+ * This flag is used with @FT_LOAD_RENDER to indicate that you want to
+ * render an outline glyph to a 1-bit monochrome bitmap glyph, with
+ * 8~pixels packed into each byte of the bitmap data.
+ *
+ * Note that this has no effect on the hinting algorithm used. You
+ * should rather use @FT_LOAD_TARGET_MONO so that the
+ * monochrome-optimized hinting algorithm is used.
+ *
+ * FT_LOAD_LINEAR_DESIGN ::
+ * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
+ * fields of @FT_GlyphSlotRec should be kept in font units. See
+ * @FT_GlyphSlotRec for details.
+ *
+ * FT_LOAD_NO_AUTOHINT ::
+ * Disable auto-hinter. See also the note below.
+ *
+ * FT_LOAD_COLOR ::
+ * This flag is used to request loading of color embedded-bitmap
+ * images. The resulting color bitmaps, if available, will have the
+ * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
+ * bitmaps are found, they will be converted to 256-level gray
+ * bitmaps transparently. Those bitmaps will be in the
+ * @FT_PIXEL_MODE_GRAY format.
+ *
+ * FT_LOAD_COMPUTE_METRICS ::
+ * This flag sets computing glyph metrics without the use of bundled
+ * metrics tables (for example, the `hdmx' table in TrueType fonts).
+ * Well-behaving fonts have optimized bundled metrics and these should
+ * be used. This flag is mainly used by font validating or font
+ * editing applications, which need to ignore, verify, or edit those
+ * tables.
+ *
+ * Currently, this flag is only implemented for TrueType fonts.
+ *
+ * FT_LOAD_CROP_BITMAP ::
+ * Ignored. Deprecated.
+ *
+ * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
+ * Ignored. Deprecated.
+ *
+ * @note:
+ * By default, hinting is enabled and the font's native hinter (see
+ * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
+ * disable hinting by setting @FT_LOAD_NO_HINTING or change the
+ * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
+ * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
+ * used at all.
+ *
+ * See the description of @FT_FACE_FLAG_TRICKY for a special exception
+ * (affecting only a handful of Asian fonts).
+ *
+ * Besides deciding which hinter to use, you can also decide which
+ * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
+ *
+ * Note that the auto-hinter needs a valid Unicode cmap (either a native
+ * one or synthesized by FreeType) for producing correct results. If a
+ * font provides an incorrect mapping (for example, assigning the
+ * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
+ * mathematical integral sign), the auto-hinter might produce useless
+ * results.
+ *
+ */
+#define FT_LOAD_DEFAULT 0x0
+#define FT_LOAD_NO_SCALE ( 1L << 0 )
+#define FT_LOAD_NO_HINTING ( 1L << 1 )
+#define FT_LOAD_RENDER ( 1L << 2 )
+#define FT_LOAD_NO_BITMAP ( 1L << 3 )
+#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
+#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
+#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
+#define FT_LOAD_PEDANTIC ( 1L << 7 )
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
+#define FT_LOAD_NO_RECURSE ( 1L << 10 )
+#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
+#define FT_LOAD_MONOCHROME ( 1L << 12 )
+#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
+#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
+ /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
+#define FT_LOAD_COLOR ( 1L << 20 )
+#define FT_LOAD_COMPUTE_METRICS ( 1L << 21 )
+
+ /* */
+
+ /* used internally only by certain font drivers! */
+#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
+#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_TARGET_XXX
+ *
+ * @description:
+ * A list of values that are used to select a specific hinting algorithm
+ * to use by the hinter. You should OR one of these values to your
+ * `load_flags' when calling @FT_Load_Glyph.
+ *
+ * Note that font's native hinters may ignore the hinting algorithm you
+ * have specified (e.g., the TrueType bytecode interpreter). You can set
+ * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
+ *
+ * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
+ * always implies @FT_LOAD_FORCE_AUTOHINT.
+ *
+ * @values:
+ * FT_LOAD_TARGET_NORMAL ::
+ * This corresponds to the default hinting algorithm, optimized for
+ * standard gray-level rendering. For monochrome output, use
+ * @FT_LOAD_TARGET_MONO instead.
+ *
+ * FT_LOAD_TARGET_LIGHT ::
+ * A lighter hinting algorithm for non-monochrome modes. Many
+ * generated glyphs are more fuzzy but better resemble its original
+ * shape. A bit like rendering on Mac OS~X.
+ *
+ * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
+ *
+ * FT_LOAD_TARGET_MONO ::
+ * Strong hinting algorithm that should only be used for monochrome
+ * output. The result is probably unpleasant if the glyph is rendered
+ * in non-monochrome modes.
+ *
+ * FT_LOAD_TARGET_LCD ::
+ * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
+ * decimated LCD displays.
+ *
+ * FT_LOAD_TARGET_LCD_V ::
+ * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
+ * decimated LCD displays.
+ *
+ * @note:
+ * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
+ * `load_flags'. They can't be ORed.
+ *
+ * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
+ * corresponding mode (i.e., the mode that matches the used algorithm
+ * best). An exeption is FT_LOAD_TARGET_MONO since it implies
+ * @FT_LOAD_MONOCHROME.
+ *
+ * You can use a hinting algorithm that doesn't correspond to the same
+ * rendering mode. As an example, it is possible to use the `light'
+ * hinting algorithm and have the results rendered in horizontal LCD
+ * pixel mode, with code like
+ *
+ * {
+ * FT_Load_Glyph( face, glyph_index,
+ * load_flags | FT_LOAD_TARGET_LIGHT );
+ *
+ * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
+ * }
+ *
+ */
+#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
+
+#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
+#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
+#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
+#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
+#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_LOAD_TARGET_MODE
+ *
+ * @description:
+ * Return the @FT_Render_Mode corresponding to a given
+ * @FT_LOAD_TARGET_XXX value.
+ *
+ */
+#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Transform */
+ /* */
+ /* <Description> */
+ /* A function used to set the transformation that is applied to glyph */
+ /* images when they are loaded into a glyph slot through */
+ /* @FT_Load_Glyph. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
+ /* the identity matrix. */
+ /* delta :: A pointer to the translation vector. Use~0 for the null */
+ /* vector. */
+ /* */
+ /* <Note> */
+ /* The transformation is only applied to scalable image formats after */
+ /* the glyph has been loaded. It means that hinting is unaltered by */
+ /* the transformation and is performed on the character size given in */
+ /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
+ /* */
+ /* Note that this also transforms the `face.glyph.advance' field, but */
+ /* *not* the values in `face.glyph.metrics'. */
+ /* */
+ FT_EXPORT( void )
+ FT_Set_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Render_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration type that lists the render modes supported by */
+ /* FreeType~2. Each mode corresponds to a specific type of scanline */
+ /* conversion performed on the outline. */
+ /* */
+ /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
+ /* field in the @FT_GlyphSlotRec structure gives the format of the */
+ /* returned bitmap. */
+ /* */
+ /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
+ /* */
+ /* <Values> */
+ /* FT_RENDER_MODE_NORMAL :: */
+ /* This is the default render mode; it corresponds to 8-bit */
+ /* anti-aliased bitmaps. */
+ /* */
+ /* FT_RENDER_MODE_LIGHT :: */
+ /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
+ /* defined as a separate value because render modes are also used */
+ /* indirectly to define hinting algorithm selectors. See */
+ /* @FT_LOAD_TARGET_XXX for details. */
+ /* */
+ /* FT_RENDER_MODE_MONO :: */
+ /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
+ /* opacity). */
+ /* */
+ /* FT_RENDER_MODE_LCD :: */
+ /* This mode corresponds to horizontal RGB and BGR sub-pixel */
+ /* displays like LCD screens. It produces 8-bit bitmaps that are */
+ /* 3~times the width of the original glyph outline in pixels, and */
+ /* which use the @FT_PIXEL_MODE_LCD mode. */
+ /* */
+ /* FT_RENDER_MODE_LCD_V :: */
+ /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
+ /* (like PDA screens, rotated LCD displays, etc.). It produces */
+ /* 8-bit bitmaps that are 3~times the height of the original */
+ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
+ /* */
+ /* <Note> */
+ /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
+ /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
+ /* (not active in the default builds). It is up to the caller to */
+ /* either call @FT_Library_SetLcdFilter (if available) or do the */
+ /* filtering itself. */
+ /* */
+ /* The selected render mode only affects vector glyphs of a font. */
+ /* Embedded bitmaps often have a different pixel mode like */
+ /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
+ /* them into 8-bit pixmaps. */
+ /* */
+ typedef enum FT_Render_Mode_
+ {
+ FT_RENDER_MODE_NORMAL = 0,
+ FT_RENDER_MODE_LIGHT,
+ FT_RENDER_MODE_MONO,
+ FT_RENDER_MODE_LCD,
+ FT_RENDER_MODE_LCD_V,
+
+ FT_RENDER_MODE_MAX
+
+ } FT_Render_Mode;
+
+
+ /* these constants are deprecated; use the corresponding */
+ /* `FT_Render_Mode' values instead */
+#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
+#define ft_render_mode_mono FT_RENDER_MODE_MONO
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Render_Glyph */
+ /* */
+ /* <Description> */
+ /* Convert a given glyph image to a bitmap. It does so by inspecting */
+ /* the glyph image format, finding the relevant renderer, and */
+ /* invoking it. */
+ /* */
+ /* <InOut> */
+ /* slot :: A handle to the glyph slot containing the image to */
+ /* convert. */
+ /* */
+ /* <Input> */
+ /* render_mode :: This is the render mode used to render the glyph */
+ /* image into a bitmap. See @FT_Render_Mode for a */
+ /* list of possible values. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* To get meaningful results, font scaling values must be set with */
+ /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Render_Glyph( FT_GlyphSlot slot,
+ FT_Render_Mode render_mode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Kerning_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify which kerning values to return in */
+ /* @FT_Get_Kerning. */
+ /* */
+ /* <Values> */
+ /* FT_KERNING_DEFAULT :: Return grid-fitted kerning distances in */
+ /* pixels (value is~0). Whether they are */
+ /* scaled depends on @FT_LOAD_NO_SCALE. */
+ /* */
+ /* FT_KERNING_UNFITTED :: Return un-grid-fitted kerning distances in */
+ /* 26.6 fractional pixels. Whether they are */
+ /* scaled depends on @FT_LOAD_NO_SCALE. */
+ /* */
+ /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
+ /* units. */
+ /* */
+ /* <Note> */
+ /* FT_KERNING_DEFAULT returns full pixel values; it also makes */
+ /* FreeType heuristically scale down kerning distances at small ppem */
+ /* values so that they don't become too big. */
+ /* */
+ typedef enum FT_Kerning_Mode_
+ {
+ FT_KERNING_DEFAULT = 0,
+ FT_KERNING_UNFITTED,
+ FT_KERNING_UNSCALED
+
+ } FT_Kerning_Mode;
+
+
+ /* these constants are deprecated; use the corresponding */
+ /* `FT_Kerning_Mode' values instead */
+#define ft_kerning_default FT_KERNING_DEFAULT
+#define ft_kerning_unfitted FT_KERNING_UNFITTED
+#define ft_kerning_unscaled FT_KERNING_UNSCALED
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Kerning */
+ /* */
+ /* <Description> */
+ /* Return the kerning vector between two glyphs of a same face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* left_glyph :: The index of the left glyph in the kern pair. */
+ /* */
+ /* right_glyph :: The index of the right glyph in the kern pair. */
+ /* */
+ /* kern_mode :: See @FT_Kerning_Mode for more information. */
+ /* Determines the scale and dimension of the returned */
+ /* kerning vector. */
+ /* */
+ /* <Output> */
+ /* akerning :: The kerning vector. This is either in font units, */
+ /* fractional pixels (26.6 format), or pixels for */
+ /* scalable formats, and in pixels for fixed-sizes */
+ /* formats. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Only horizontal layouts (left-to-right & right-to-left) are */
+ /* supported by this method. Other layouts, or more sophisticated */
+ /* kernings, are out of the scope of this API function -- they can be */
+ /* implemented through format-specific interfaces. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Kerning( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_UInt kern_mode,
+ FT_Vector *akerning );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Track_Kerning */
+ /* */
+ /* <Description> */
+ /* Return the track kerning for a given face object at a given size. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* point_size :: The point size in 16.16 fractional points. */
+ /* */
+ /* degree :: The degree of tightness. Increasingly negative */
+ /* values represent tighter track kerning, while */
+ /* increasingly positive values represent looser track */
+ /* kerning. Value zero means no track kerning. */
+ /* */
+ /* <Output> */
+ /* akerning :: The kerning in 16.16 fractional points, to be */
+ /* uniformly applied between all glyphs. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Currently, only the Type~1 font driver supports track kerning, */
+ /* using data from AFM files (if attached with @FT_Attach_File or */
+ /* @FT_Attach_Stream). */
+ /* */
+ /* Only very few AFM files come with track kerning data; please refer */
+ /* to the Adobe's AFM specification for more details. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Track_Kerning( FT_Face face,
+ FT_Fixed point_size,
+ FT_Int degree,
+ FT_Fixed* akerning );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph_Name */
+ /* */
+ /* <Description> */
+ /* Retrieve the ASCII name of a given glyph in a face. This only */
+ /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* glyph_index :: The glyph index. */
+ /* */
+ /* buffer_max :: The maximum number of bytes available in the */
+ /* buffer. */
+ /* */
+ /* <Output> */
+ /* buffer :: A pointer to a target buffer where the name is */
+ /* copied to. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* An error is returned if the face doesn't provide glyph names or if */
+ /* the glyph index is invalid. In all cases of failure, the first */
+ /* byte of `buffer' is set to~0 to indicate an empty name. */
+ /* */
+ /* The glyph name is truncated to fit within the buffer if it is too */
+ /* long. The returned string is always zero-terminated. */
+ /* */
+ /* Be aware that FreeType reorders glyph indices internally so that */
+ /* glyph index~0 always corresponds to the `missing glyph' (called */
+ /* `.notdef'). */
+ /* */
+ /* This function always returns an error if the config macro */
+ /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Glyph_Name( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Postscript_Name */
+ /* */
+ /* <Description> */
+ /* Retrieve the ASCII PostScript name of a given face, if available. */
+ /* This only works with PostScript and TrueType fonts. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* A pointer to the face's PostScript name. NULL if unavailable. */
+ /* */
+ /* <Note> */
+ /* The returned pointer is owned by the face and is destroyed with */
+ /* it. */
+ /* */
+ FT_EXPORT( const char* )
+ FT_Get_Postscript_Name( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Select_Charmap */
+ /* */
+ /* <Description> */
+ /* Select a given charmap by its encoding tag (as listed in */
+ /* `freetype.h'). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* encoding :: A handle to the selected encoding. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function returns an error if no charmap in the face */
+ /* corresponds to the encoding queried here. */
+ /* */
+ /* Because many fonts contain more than a single cmap for Unicode */
+ /* encoding, this function has some special code to select the one */
+ /* that covers Unicode best (`best' in the sense that a UCS-4 cmap is */
+ /* preferred to a UCS-2 cmap). It is thus preferable to */
+ /* @FT_Set_Charmap in this case. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Select_Charmap( FT_Face face,
+ FT_Encoding encoding );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Charmap */
+ /* */
+ /* <Description> */
+ /* Select a given charmap for character code to glyph index mapping. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* charmap :: A handle to the selected charmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function returns an error if the charmap is not part of */
+ /* the face (i.e., if it is not listed in the `face->charmaps' */
+ /* table). */
+ /* */
+ /* It also fails if a type~14 charmap is selected. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Charmap( FT_Face face,
+ FT_CharMap charmap );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Get_Charmap_Index
+ *
+ * @description:
+ * Retrieve index of a given charmap.
+ *
+ * @input:
+ * charmap ::
+ * A handle to a charmap.
+ *
+ * @return:
+ * The index into the array of character maps within the face to which
+ * `charmap' belongs. If an error occurs, -1 is returned.
+ *
+ */
+ FT_EXPORT( FT_Int )
+ FT_Get_Charmap_Index( FT_CharMap charmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Char_Index */
+ /* */
+ /* <Description> */
+ /* Return the glyph index of a given character code. This function */
+ /* uses a charmap object to do the mapping. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* charcode :: The character code. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0~means `undefined character code'. */
+ /* */
+ /* <Note> */
+ /* If you use FreeType to manipulate the contents of font files */
+ /* directly, be aware that the glyph index returned by this function */
+ /* doesn't always correspond to the internal indices used within the */
+ /* file. This is done to ensure that value~0 always corresponds to */
+ /* the `missing glyph'. If the first glyph is not named `.notdef', */
+ /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
+ /* the glyph ID~0 position, and whatever was there will be moved to */
+ /* the position `.notdef' had. For Type~1 fonts, if there is no */
+ /* `.notdef' glyph at all, then one will be created at index~0 and */
+ /* whatever was there will be moved to the last index -- Type~42 */
+ /* fonts are considered invalid under this condition. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Char_Index( FT_Face face,
+ FT_ULong charcode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_First_Char */
+ /* */
+ /* <Description> */
+ /* This function is used to return the first character code in the */
+ /* current charmap of a given face. It also returns the */
+ /* corresponding glyph index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Output> */
+ /* agindex :: Glyph index of first character code. 0~if charmap is */
+ /* empty. */
+ /* */
+ /* <Return> */
+ /* The charmap's first character code. */
+ /* */
+ /* <Note> */
+ /* You should use this function with @FT_Get_Next_Char to be able to */
+ /* parse all character codes available in a given charmap. The code */
+ /* should look like this: */
+ /* */
+ /* { */
+ /* FT_ULong charcode; */
+ /* FT_UInt gindex; */
+ /* */
+ /* */
+ /* charcode = FT_Get_First_Char( face, &gindex ); */
+ /* while ( gindex != 0 ) */
+ /* { */
+ /* ... do something with (charcode,gindex) pair ... */
+ /* */
+ /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
+ /* } */
+ /* } */
+ /* */
+ /* Be aware that character codes can have values up to 0xFFFFFFFF; */
+ /* this might happen for non-Unicode or malformed cmaps. However, */
+ /* even with regular Unicode encoding, so-called `last resort fonts' */
+ /* (using SFNT cmap format 13, see function @FT_Get_CMap_Format) */
+ /* normally have entries for all Unicode characters up to 0x1FFFFF, */
+ /* which can cause *a lot* of iterations. */
+ /* */
+ /* Note that `*agindex' is set to~0 if the charmap is empty. The */
+ /* result itself can be~0 in two cases: if the charmap is empty or */
+ /* if the value~0 is the first valid character code. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_First_Char( FT_Face face,
+ FT_UInt *agindex );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Next_Char */
+ /* */
+ /* <Description> */
+ /* This function is used to return the next character code in the */
+ /* current charmap of a given face following the value `char_code', */
+ /* as well as the corresponding glyph index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* char_code :: The starting character code. */
+ /* */
+ /* <Output> */
+ /* agindex :: Glyph index of next character code. 0~if charmap */
+ /* is empty. */
+ /* */
+ /* <Return> */
+ /* The charmap's next character code. */
+ /* */
+ /* <Note> */
+ /* You should use this function with @FT_Get_First_Char to walk */
+ /* over all character codes available in a given charmap. See the */
+ /* note for this function for a simple code example. */
+ /* */
+ /* Note that `*agindex' is set to~0 when there are no more codes in */
+ /* the charmap. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_Next_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_UInt *agindex );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Name_Index */
+ /* */
+ /* <Description> */
+ /* Return the glyph index of a given glyph name. This function uses */
+ /* driver specific objects to do the translation. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* glyph_name :: The glyph name. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0~means `undefined character code'. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Name_Index( FT_Face face,
+ FT_String* glyph_name );
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_SUBGLYPH_FLAG_XXX
+ *
+ * @description:
+ * A list of constants used to describe subglyphs. Please refer to the
+ * TrueType specification for the meaning of the various flags.
+ *
+ * @values:
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
+ * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
+ * FT_SUBGLYPH_FLAG_SCALE ::
+ * FT_SUBGLYPH_FLAG_XY_SCALE ::
+ * FT_SUBGLYPH_FLAG_2X2 ::
+ * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
+ *
+ */
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
+#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
+#define FT_SUBGLYPH_FLAG_SCALE 8
+#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
+#define FT_SUBGLYPH_FLAG_2X2 0x80
+#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
+
+
+ /*************************************************************************
+ *
+ * @func:
+ * FT_Get_SubGlyph_Info
+ *
+ * @description:
+ * Retrieve a description of a given subglyph. Only use it if
+ * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
+ * returned otherwise.
+ *
+ * @input:
+ * glyph ::
+ * The source glyph slot.
+ *
+ * sub_index ::
+ * The index of the subglyph. Must be less than
+ * `glyph->num_subglyphs'.
+ *
+ * @output:
+ * p_index ::
+ * The glyph index of the subglyph.
+ *
+ * p_flags ::
+ * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
+ *
+ * p_arg1 ::
+ * The subglyph's first argument (if any).
+ *
+ * p_arg2 ::
+ * The subglyph's second argument (if any).
+ *
+ * p_transform ::
+ * The subglyph transformation (if any).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
+ * interpreted depending on the flags returned in `*p_flags'. See the
+ * TrueType specification for details.
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
+ FT_UInt sub_index,
+ FT_Int *p_index,
+ FT_UInt *p_flags,
+ FT_Int *p_arg1,
+ FT_Int *p_arg2,
+ FT_Matrix *p_transform );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_FSTYPE_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit flags used in the `fsType' field of the OS/2 table */
+ /* in a TrueType or OpenType font and the `FSType' entry in a */
+ /* PostScript font. These bit flags are returned by */
+ /* @FT_Get_FSType_Flags; they inform client applications of embedding */
+ /* and subsetting restrictions associated with a font. */
+ /* */
+ /* See */
+ /* http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf */
+ /* for more details. */
+ /* */
+ /* <Values> */
+ /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
+ /* Fonts with no fsType bit set may be embedded and permanently */
+ /* installed on the remote system by an application. */
+ /* */
+ /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
+ /* Fonts that have only this bit set must not be modified, embedded */
+ /* or exchanged in any manner without first obtaining permission of */
+ /* the font software copyright owner. */
+ /* */
+ /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
+ /* If this bit is set, the font may be embedded and temporarily */
+ /* loaded on the remote system. Documents containing Preview & */
+ /* Print fonts must be opened `read-only'; no edits can be applied */
+ /* to the document. */
+ /* */
+ /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
+ /* If this bit is set, the font may be embedded but must only be */
+ /* installed temporarily on other systems. In contrast to Preview */
+ /* & Print fonts, documents containing editable fonts may be opened */
+ /* for reading, editing is permitted, and changes may be saved. */
+ /* */
+ /* FT_FSTYPE_NO_SUBSETTING :: */
+ /* If this bit is set, the font may not be subsetted prior to */
+ /* embedding. */
+ /* */
+ /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
+ /* If this bit is set, only bitmaps contained in the font may be */
+ /* embedded; no outline data may be embedded. If there are no */
+ /* bitmaps available in the font, then the font is unembeddable. */
+ /* */
+ /* <Note> */
+ /* The flags are ORed together, thus more than a single value can be */
+ /* returned. */
+ /* */
+ /* While the fsType flags can indicate that a font may be embedded, a */
+ /* license with the font vendor may be separately required to use the */
+ /* font in this way. */
+ /* */
+#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
+#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
+#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
+#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
+#define FT_FSTYPE_NO_SUBSETTING 0x0100
+#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_FSType_Flags */
+ /* */
+ /* <Description> */
+ /* Return the fsType flags for a font. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* The fsType flags, @FT_FSTYPE_XXX. */
+ /* */
+ /* <Note> */
+ /* Use this function rather than directly reading the `fs_type' field */
+ /* in the @PS_FontInfoRec structure, which is only guaranteed to */
+ /* return the correct results for Type~1 fonts. */
+ /* */
+ /* <Since> */
+ /* 2.3.8 */
+ /* */
+ FT_EXPORT( FT_UShort )
+ FT_Get_FSType_Flags( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* glyph_variants */
+ /* */
+ /* <Title> */
+ /* Glyph Variants */
+ /* */
+ /* <Abstract> */
+ /* The FreeType~2 interface to Unicode Ideographic Variation */
+ /* Sequences (IVS), using the SFNT cmap format~14. */
+ /* */
+ /* <Description> */
+ /* Many CJK characters have variant forms. They are a sort of grey */
+ /* area somewhere between being totally irrelevant and semantically */
+ /* distinct; for this reason, the Unicode consortium decided to */
+ /* introduce Ideographic Variation Sequences (IVS), consisting of a */
+ /* Unicode base character and one of 240 variant selectors */
+ /* (U+E0100-U+E01EF), instead of further extending the already huge */
+ /* code range for CJK characters. */
+ /* */
+ /* An IVS is registered and unique; for further details please refer */
+ /* to Unicode Technical Standard #37, the Ideographic Variation */
+ /* Database: */
+ /* */
+ /* http://www.unicode.org/reports/tr37/ */
+ /* */
+ /* To date (November 2014), the character with the most variants is */
+ /* U+9089, having 32 such IVS. */
+ /* */
+ /* Adobe and MS decided to support IVS with a new cmap subtable */
+ /* (format~14). It is an odd subtable because it is not a mapping of */
+ /* input code points to glyphs, but contains lists of all variants */
+ /* supported by the font. */
+ /* */
+ /* A variant may be either `default' or `non-default'. A default */
+ /* variant is the one you will get for that code point if you look it */
+ /* up in the standard Unicode cmap. A non-default variant is a */
+ /* different glyph. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetCharVariantIndex */
+ /* */
+ /* <Description> */
+ /* Return the glyph index of a given character code as modified by */
+ /* the variation selector. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* charcode :: */
+ /* The character code point in Unicode. */
+ /* */
+ /* variantSelector :: */
+ /* The Unicode code point of the variation selector. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0~means either `undefined character code', or */
+ /* `undefined selector code', or `no variation selector cmap */
+ /* subtable', or `current CharMap is not Unicode'. */
+ /* */
+ /* <Note> */
+ /* If you use FreeType to manipulate the contents of font files */
+ /* directly, be aware that the glyph index returned by this function */
+ /* doesn't always correspond to the internal indices used within */
+ /* the file. This is done to ensure that value~0 always corresponds */
+ /* to the `missing glyph'. */
+ /* */
+ /* This function is only meaningful if */
+ /* a) the font has a variation selector cmap sub table, */
+ /* and */
+ /* b) the current charmap has a Unicode encoding. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Face_GetCharVariantIndex( FT_Face face,
+ FT_ULong charcode,
+ FT_ULong variantSelector );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetCharVariantIsDefault */
+ /* */
+ /* <Description> */
+ /* Check whether this variant of this Unicode character is the one to */
+ /* be found in the `cmap'. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* charcode :: */
+ /* The character codepoint in Unicode. */
+ /* */
+ /* variantSelector :: */
+ /* The Unicode codepoint of the variation selector. */
+ /* */
+ /* <Return> */
+ /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
+ /* variation selector cmap, or -1 if it is not a variant. */
+ /* */
+ /* <Note> */
+ /* This function is only meaningful if the font has a variation */
+ /* selector cmap subtable. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_Int )
+ FT_Face_GetCharVariantIsDefault( FT_Face face,
+ FT_ULong charcode,
+ FT_ULong variantSelector );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetVariantSelectors */
+ /* */
+ /* <Description> */
+ /* Return a zero-terminated list of Unicode variant selectors found */
+ /* in the font. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* A pointer to an array of selector code points, or NULL if there is */
+ /* no valid variant selector cmap subtable. */
+ /* */
+ /* <Note> */
+ /* The last item in the array is~0; the array is owned by the */
+ /* @FT_Face object but can be overwritten or released on the next */
+ /* call to a FreeType function. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt32* )
+ FT_Face_GetVariantSelectors( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetVariantsOfChar */
+ /* */
+ /* <Description> */
+ /* Return a zero-terminated list of Unicode variant selectors found */
+ /* for the specified character code. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* charcode :: */
+ /* The character codepoint in Unicode. */
+ /* */
+ /* <Return> */
+ /* A pointer to an array of variant selector code points that are */
+ /* active for the given character, or NULL if the corresponding list */
+ /* is empty. */
+ /* */
+ /* <Note> */
+ /* The last item in the array is~0; the array is owned by the */
+ /* @FT_Face object but can be overwritten or released on the next */
+ /* call to a FreeType function. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt32* )
+ FT_Face_GetVariantsOfChar( FT_Face face,
+ FT_ULong charcode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetCharsOfVariant */
+ /* */
+ /* <Description> */
+ /* Return a zero-terminated list of Unicode character codes found for */
+ /* the specified variant selector. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* variantSelector :: */
+ /* The variant selector code point in Unicode. */
+ /* */
+ /* <Return> */
+ /* A list of all the code points that are specified by this selector */
+ /* (both default and non-default codes are returned) or NULL if there */
+ /* is no valid cmap or the variant selector is invalid. */
+ /* */
+ /* <Note> */
+ /* The last item in the array is~0; the array is owned by the */
+ /* @FT_Face object but can be overwritten or released on the next */
+ /* call to a FreeType function. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt32* )
+ FT_Face_GetCharsOfVariant( FT_Face face,
+ FT_ULong variantSelector );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* computations */
+ /* */
+ /* <Title> */
+ /* Computations */
+ /* */
+ /* <Abstract> */
+ /* Crunching fixed numbers and vectors. */
+ /* */
+ /* <Description> */
+ /* This section contains various functions used to perform */
+ /* computations on 16.16 fixed-float numbers or 2d vectors. */
+ /* */
+ /* <Order> */
+ /* FT_MulDiv */
+ /* FT_MulFix */
+ /* FT_DivFix */
+ /* FT_RoundFix */
+ /* FT_CeilFix */
+ /* FT_FloorFix */
+ /* FT_Vector_Transform */
+ /* FT_Matrix_Multiply */
+ /* FT_Matrix_Invert */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulDiv */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation `(a*b)/c' */
+ /* with maximum accuracy (it uses a 64-bit intermediate integer */
+ /* whenever necessary). */
+ /* */
+ /* This function isn't necessarily as fast as some processor specific */
+ /* operations, but is at least completely portable. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. */
+ /* c :: The divisor. */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/c'. This function never traps when trying to */
+ /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
+ /* on the signs of `a' and `b'. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_MulDiv( FT_Long a,
+ FT_Long b,
+ FT_Long c );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
+ /* used to multiply a given value by a 16.16 fixed-point factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/0x10000'. */
+ /* */
+ /* <Note> */
+ /* This function has been optimized for the case where the absolute */
+ /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
+ /* As this happens mainly when scaling from notional units to */
+ /* fractional pixels in FreeType, it resulted in noticeable speed */
+ /* improvements between versions 2.x and 1.x. */
+ /* */
+ /* As a conclusion, always try to place a 16.16 factor as the */
+ /* _second_ argument of this function; this can make a great */
+ /* difference. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_MulFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_DivFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
+ /* used to divide a given value by a 16.16 fixed-point factor. */
+ /* */
+ /* <Input> */
+ /* a :: The numerator. */
+ /* b :: The denominator. Use a 16.16 factor here. */
+ /* */
+ /* <Return> */
+ /* The result of `(a*0x10000)/b'. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_DivFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_RoundFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to round a 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number to be rounded. */
+ /* */
+ /* <Return> */
+ /* `a' rounded to nearest 16.16 fixed integer, halfway cases away */
+ /* from zero. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_RoundFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_CeilFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to compute the ceiling function of a */
+ /* 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number for which the ceiling function is to be computed. */
+ /* */
+ /* <Return> */
+ /* `a' rounded towards plus infinity. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_CeilFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_FloorFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to compute the floor function of a */
+ /* 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number for which the floor function is to be computed. */
+ /* */
+ /* <Return> */
+ /* `a' rounded towards minus infinity. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_FloorFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Vector_Transform */
+ /* */
+ /* <Description> */
+ /* Transform a single vector through a 2x2 matrix. */
+ /* */
+ /* <InOut> */
+ /* vector :: The target vector to transform. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the source 2x2 matrix. */
+ /* */
+ /* <Note> */
+ /* The result is undefined if either `vector' or `matrix' is invalid. */
+ /* */
+ FT_EXPORT( void )
+ FT_Vector_Transform( FT_Vector* vec,
+ const FT_Matrix* matrix );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* version */
+ /* */
+ /* <Title> */
+ /* FreeType Version */
+ /* */
+ /* <Abstract> */
+ /* Functions and macros related to FreeType versions. */
+ /* */
+ /* <Description> */
+ /* Note that those functions and macros are of limited use because */
+ /* even a new release of FreeType with only documentation changes */
+ /* increases the version number. */
+ /* */
+ /* <Order> */
+ /* FT_Library_Version */
+ /* */
+ /* FREETYPE_MAJOR */
+ /* FREETYPE_MINOR */
+ /* FREETYPE_PATCH */
+ /* */
+ /* FT_Face_CheckTrueTypePatents */
+ /* FT_Face_SetUnpatentedHinting */
+ /* */
+ /* FREETYPE_XXX */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @enum:
+ * FREETYPE_XXX
+ *
+ * @description:
+ * These three macros identify the FreeType source code version.
+ * Use @FT_Library_Version to access them at runtime.
+ *
+ * @values:
+ * FREETYPE_MAJOR :: The major version number.
+ * FREETYPE_MINOR :: The minor version number.
+ * FREETYPE_PATCH :: The patch level.
+ *
+ * @note:
+ * The version number of FreeType if built as a dynamic link library
+ * with the `libtool' package is _not_ controlled by these three
+ * macros.
+ *
+ */
+#define FREETYPE_MAJOR 2
+#define FREETYPE_MINOR 6
+#define FREETYPE_PATCH 1
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Library_Version */
+ /* */
+ /* <Description> */
+ /* Return the version of the FreeType library being used. This is */
+ /* useful when dynamically linking to the library, since one cannot */
+ /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
+ /* @FREETYPE_PATCH. */
+ /* */
+ /* <Input> */
+ /* library :: A source library handle. */
+ /* */
+ /* <Output> */
+ /* amajor :: The major version number. */
+ /* */
+ /* aminor :: The minor version number. */
+ /* */
+ /* apatch :: The patch version number. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a `library' argument is because */
+ /* certain programs implement library initialization in a custom way */
+ /* that doesn't use @FT_Init_FreeType. */
+ /* */
+ /* In such cases, the library version might not be available before */
+ /* the library object has been created. */
+ /* */
+ FT_EXPORT( void )
+ FT_Library_Version( FT_Library library,
+ FT_Int *amajor,
+ FT_Int *aminor,
+ FT_Int *apatch );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_CheckTrueTypePatents */
+ /* */
+ /* <Description> */
+ /* Parse all bytecode instructions of a TrueType font file to check */
+ /* whether any of the patented opcodes are used. This is only useful */
+ /* if you want to be able to use the unpatented hinter with */
+ /* fonts that do *not* use these opcodes. */
+ /* */
+ /* Note that this function parses *all* glyph instructions in the */
+ /* font file, which may be slow. */
+ /* */
+ /* <Input> */
+ /* face :: A face handle. */
+ /* */
+ /* <Return> */
+ /* 1~if this is a TrueType font that uses one of the patented */
+ /* opcodes, 0~otherwise. */
+ /* */
+ /* <Note> */
+ /* Since May 2010, TrueType hinting is no longer patented. */
+ /* */
+ /* <Since> */
+ /* 2.3.5 */
+ /* */
+ FT_EXPORT( FT_Bool )
+ FT_Face_CheckTrueTypePatents( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_SetUnpatentedHinting */
+ /* */
+ /* <Description> */
+ /* Enable or disable the unpatented hinter for a given face. */
+ /* Only enable it if you have determined that the face doesn't */
+ /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
+ /* */
+ /* <Input> */
+ /* face :: A face handle. */
+ /* */
+ /* value :: New boolean setting. */
+ /* */
+ /* <Return> */
+ /* The old setting value. This will always be false if this is not */
+ /* an SFNT font, or if the unpatented hinter is not compiled in this */
+ /* instance of the library. */
+ /* */
+ /* <Note> */
+ /* Since May 2010, TrueType hinting is no longer patented. */
+ /* */
+ /* <Since> */
+ /* 2.3.5 */
+ /* */
+ FT_EXPORT( FT_Bool )
+ FT_Face_SetUnpatentedHinting( FT_Face face,
+ FT_Bool value );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FREETYPE_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftadvanc.h b/src/3rdparty/freetype/include/freetype/ftadvanc.h
new file mode 100644
index 0000000000..b4d2aed567
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftadvanc.h
@@ -0,0 +1,187 @@
+/***************************************************************************/
+/* */
+/* ftadvanc.h */
+/* */
+/* Quick computation of advance widths (specification only). */
+/* */
+/* Copyright 2008-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTADVANC_H__
+#define __FTADVANC_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * quick_advance
+ *
+ * @title:
+ * Quick retrieval of advance values
+ *
+ * @abstract:
+ * Retrieve horizontal and vertical advance values without processing
+ * glyph outlines, if possible.
+ *
+ * @description:
+ * This section contains functions to quickly extract advance values
+ * without handling glyph outlines, if possible.
+ *
+ * @order:
+ * FT_Get_Advance
+ * FT_Get_Advances
+ *
+ */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* FT_ADVANCE_FLAG_FAST_ONLY */
+ /* */
+ /* <Description> */
+ /* A bit-flag to be OR-ed with the `flags' parameter of the */
+ /* @FT_Get_Advance and @FT_Get_Advances functions. */
+ /* */
+ /* If set, it indicates that you want these functions to fail if the */
+ /* corresponding hinting mode or font driver doesn't allow for very */
+ /* quick advance computation. */
+ /* */
+ /* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
+ /* or light-hinted can have their advance width computed very */
+ /* quickly. */
+ /* */
+ /* Normal and bytecode hinted modes that require loading, scaling, */
+ /* and hinting of the glyph outline, are extremely slow by */
+ /* comparison. */
+ /* */
+#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Advance */
+ /* */
+ /* <Description> */
+ /* Retrieve the advance value of a given glyph outline in an */
+ /* @FT_Face. */
+ /* */
+ /* <Input> */
+ /* face :: The source @FT_Face handle. */
+ /* */
+ /* gindex :: The glyph index. */
+ /* */
+ /* load_flags :: A set of bit flags similar to those used when */
+ /* calling @FT_Load_Glyph, used to determine what kind */
+ /* of advances you need. */
+ /* <Output> */
+ /* padvance :: The advance value. If scaling is performed (based on */
+ /* the value of `load_flags'), the advance value is in */
+ /* 16.16 format. Otherwise, it is in font units. */
+ /* */
+ /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
+ /* vertical advance corresponding to a vertical layout. */
+ /* Otherwise, it is the horizontal advance in a */
+ /* horizontal layout. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
+ /* if the corresponding font backend doesn't have a quick way to */
+ /* retrieve the advances. */
+ /* */
+ /* A scaled advance is returned in 16.16 format but isn't transformed */
+ /* by the affine transformation specified by @FT_Set_Transform. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Advance( FT_Face face,
+ FT_UInt gindex,
+ FT_Int32 load_flags,
+ FT_Fixed *padvance );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Advances */
+ /* */
+ /* <Description> */
+ /* Retrieve the advance values of several glyph outlines in an */
+ /* @FT_Face. */
+ /* */
+ /* <Input> */
+ /* face :: The source @FT_Face handle. */
+ /* */
+ /* start :: The first glyph index. */
+ /* */
+ /* count :: The number of advance values you want to retrieve. */
+ /* */
+ /* load_flags :: A set of bit flags similar to those used when */
+ /* calling @FT_Load_Glyph. */
+ /* */
+ /* <Output> */
+ /* padvance :: The advance values. This array, to be provided by the */
+ /* caller, must contain at least `count' elements. */
+ /* */
+ /* If scaling is performed (based on the value of */
+ /* `load_flags'), the advance values are in 16.16 format. */
+ /* Otherwise, they are in font units. */
+ /* */
+ /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
+ /* vertical advances corresponding to a vertical layout. */
+ /* Otherwise, they are the horizontal advances in a */
+ /* horizontal layout. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
+ /* if the corresponding font backend doesn't have a quick way to */
+ /* retrieve the advances. */
+ /* */
+ /* Scaled advances are returned in 16.16 format but aren't */
+ /* transformed by the affine transformation specified by */
+ /* @FT_Set_Transform. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Advances( FT_Face face,
+ FT_UInt start,
+ FT_UInt count,
+ FT_Int32 load_flags,
+ FT_Fixed *padvances );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTADVANC_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftautoh.h b/src/3rdparty/freetype/include/freetype/ftautoh.h
new file mode 100644
index 0000000000..ab39c21995
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftautoh.h
@@ -0,0 +1,450 @@
+/***************************************************************************/
+/* */
+/* ftautoh.h */
+/* */
+/* FreeType API for controlling the auto-hinter (specification only). */
+/* */
+/* Copyright 2012-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTAUTOH_H__
+#define __FTAUTOH_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * auto_hinter
+ *
+ * @title:
+ * The auto-hinter
+ *
+ * @abstract:
+ * Controlling the auto-hinting module.
+ *
+ * @description:
+ * While FreeType's auto-hinter doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * Note that the auto-hinter's module name is `autofitter' for
+ * historical reasons.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * glyph-to-script-map
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * The auto-hinter provides various script modules to hint glyphs.
+ * Examples of supported scripts are Latin or CJK. Before a glyph is
+ * auto-hinted, the Unicode character map of the font gets examined, and
+ * the script is then determined based on Unicode character ranges, see
+ * below.
+ *
+ * OpenType fonts, however, often provide much more glyphs than
+ * character codes (small caps, superscripts, ligatures, swashes, etc.),
+ * to be controlled by so-called `features'. Handling OpenType features
+ * can be quite complicated and thus needs a separate library on top of
+ * FreeType.
+ *
+ * The mapping between glyph indices and scripts (in the auto-hinter
+ * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
+ * array with `num_glyphs' elements, as found in the font's @FT_Face
+ * structure. The `glyph-to-script-map' property returns a pointer to
+ * this array, which can be modified as needed. Note that the
+ * modification should happen before the first glyph gets processed by
+ * the auto-hinter so that the global analysis of the font shapes
+ * actually uses the modified mapping.
+ *
+ * The following example code demonstrates how to access it (omitting
+ * the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Prop_GlyphToScriptMap prop;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ * FT_New_Face( library, "foo.ttf", 0, &face );
+ *
+ * prop.face = face;
+ *
+ * FT_Property_Get( library, "autofitter",
+ * "glyph-to-script-map", &prop );
+ *
+ * // adjust `prop.map' as needed right here
+ *
+ * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
+ * }
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_AUTOHINTER_SCRIPT_XXX
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * A list of constants used for the @glyph-to-script-map property to
+ * specify the script submodule the auto-hinter should use for hinting a
+ * particular glyph.
+ *
+ * @values:
+ * FT_AUTOHINTER_SCRIPT_NONE ::
+ * Don't auto-hint this glyph.
+ *
+ * FT_AUTOHINTER_SCRIPT_LATIN ::
+ * Apply the latin auto-hinter. For the auto-hinter, `latin' is a
+ * very broad term, including Cyrillic and Greek also since characters
+ * from those scripts share the same design constraints.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+0020 - U+007F // Basic Latin (no control characters)
+ * U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
+ * U+0100 - U+017F // Latin Extended-A
+ * U+0180 - U+024F // Latin Extended-B
+ * U+0250 - U+02AF // IPA Extensions
+ * U+02B0 - U+02FF // Spacing Modifier Letters
+ * U+0300 - U+036F // Combining Diacritical Marks
+ * U+0370 - U+03FF // Greek and Coptic
+ * U+0400 - U+04FF // Cyrillic
+ * U+0500 - U+052F // Cyrillic Supplement
+ * U+1D00 - U+1D7F // Phonetic Extensions
+ * U+1D80 - U+1DBF // Phonetic Extensions Supplement
+ * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
+ * U+1E00 - U+1EFF // Latin Extended Additional
+ * U+1F00 - U+1FFF // Greek Extended
+ * U+2000 - U+206F // General Punctuation
+ * U+2070 - U+209F // Superscripts and Subscripts
+ * U+20A0 - U+20CF // Currency Symbols
+ * U+2150 - U+218F // Number Forms
+ * U+2460 - U+24FF // Enclosed Alphanumerics
+ * U+2C60 - U+2C7F // Latin Extended-C
+ * U+2DE0 - U+2DFF // Cyrillic Extended-A
+ * U+2E00 - U+2E7F // Supplemental Punctuation
+ * U+A640 - U+A69F // Cyrillic Extended-B
+ * U+A720 - U+A7FF // Latin Extended-D
+ * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
+ * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
+ * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
+ * }
+ *
+ * FT_AUTOHINTER_SCRIPT_CJK ::
+ * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
+ * Vietnamese, and some other scripts.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+1100 - U+11FF // Hangul Jamo
+ * U+2E80 - U+2EFF // CJK Radicals Supplement
+ * U+2F00 - U+2FDF // Kangxi Radicals
+ * U+2FF0 - U+2FFF // Ideographic Description Characters
+ * U+3000 - U+303F // CJK Symbols and Punctuation
+ * U+3040 - U+309F // Hiragana
+ * U+30A0 - U+30FF // Katakana
+ * U+3100 - U+312F // Bopomofo
+ * U+3130 - U+318F // Hangul Compatibility Jamo
+ * U+3190 - U+319F // Kanbun
+ * U+31A0 - U+31BF // Bopomofo Extended
+ * U+31C0 - U+31EF // CJK Strokes
+ * U+31F0 - U+31FF // Katakana Phonetic Extensions
+ * U+3200 - U+32FF // Enclosed CJK Letters and Months
+ * U+3300 - U+33FF // CJK Compatibility
+ * U+3400 - U+4DBF // CJK Unified Ideographs Extension A
+ * U+4DC0 - U+4DFF // Yijing Hexagram Symbols
+ * U+4E00 - U+9FFF // CJK Unified Ideographs
+ * U+A960 - U+A97F // Hangul Jamo Extended-A
+ * U+AC00 - U+D7AF // Hangul Syllables
+ * U+D7B0 - U+D7FF // Hangul Jamo Extended-B
+ * U+F900 - U+FAFF // CJK Compatibility Ideographs
+ * U+FE10 - U+FE1F // Vertical forms
+ * U+FE30 - U+FE4F // CJK Compatibility Forms
+ * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
+ * U+1B000 - U+1B0FF // Kana Supplement
+ * U+1D300 - U+1D35F // Tai Xuan Hing Symbols
+ * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
+ * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
+ * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
+ * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
+ * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
+ * }
+ *
+ * FT_AUTOHINTER_SCRIPT_INDIC ::
+ * Apply the indic auto-hinter, covering all major scripts from the
+ * Indian sub-continent and some other related scripts like Thai, Lao,
+ * or Tibetan.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+0900 - U+0DFF // Indic Range
+ * U+0F00 - U+0FFF // Tibetan
+ * U+1900 - U+194F // Limbu
+ * U+1B80 - U+1BBF // Sundanese
+ * U+1C80 - U+1CDF // Meetei Mayak
+ * U+A800 - U+A82F // Syloti Nagri
+ * U+11800 - U+118DF // Sharada
+ * }
+ *
+ * Note that currently Indic support is rudimentary only, missing blue
+ * zone support.
+ *
+ */
+#define FT_AUTOHINTER_SCRIPT_NONE 0
+#define FT_AUTOHINTER_SCRIPT_LATIN 1
+#define FT_AUTOHINTER_SCRIPT_CJK 2
+#define FT_AUTOHINTER_SCRIPT_INDIC 3
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Prop_GlyphToScriptMap
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * The data exchange structure for the @glyph-to-script-map property.
+ *
+ */
+ typedef struct FT_Prop_GlyphToScriptMap_
+ {
+ FT_Face face;
+ FT_UShort* map;
+
+ } FT_Prop_GlyphToScriptMap;
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * fallback-script
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * If no auto-hinter script module can be assigned to a glyph, a
+ * fallback script gets assigned to it (see also the
+ * @glyph-to-script-map property). By default, this is
+ * @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
+ * this fallback value can be changed.
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "fallback-script", &fallback_script );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * It's important to use the right timing for changing this value: The
+ * creation of the glyph-to-script map that eventually uses the
+ * fallback script value gets triggered either by setting or reading a
+ * face-specific property like @glyph-to-script-map, or by auto-hinting
+ * any glyph from that face. In particular, if you have already created
+ * an @FT_Face structure but not loaded any glyph (using the
+ * auto-hinter), a change of the fallback script will affect this face.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * default-script
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
+ * the HarfBuzz library access OpenType features for getting better
+ * glyph coverages, this property sets the (auto-fitter) script to be
+ * used for the default (OpenType) script data of a font's GSUB table.
+ * Features for the default script are intended for all scripts not
+ * explicitly handled in GSUB; an example is a `dlig' feature,
+ * containing the combination of the characters `T', `E', and `L' to
+ * form a `TEL' ligature.
+ *
+ * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
+ * `default-script' property, this default value can be changed.
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "default-script", &default_script );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * It's important to use the right timing for changing this value: The
+ * creation of the glyph-to-script map that eventually uses the
+ * default script value gets triggered either by setting or reading a
+ * face-specific property like @glyph-to-script-map, or by auto-hinting
+ * any glyph from that face. In particular, if you have already created
+ * an @FT_Face structure but not loaded any glyph (using the
+ * auto-hinter), a change of the default script will affect this face.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * increase-x-height
+ *
+ * @description:
+ * For ppem values in the range 6~<= ppem <= `increase-x-height', round
+ * up the font's x~height much more often than normally. If the value
+ * is set to~0, which is the default, this feature is switched off. Use
+ * this property to improve the legibility of small font sizes if
+ * necessary.
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Prop_IncreaseXHeight prop;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ * FT_New_Face( library, "foo.ttf", 0, &face );
+ * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
+ *
+ * prop.face = face;
+ * prop.limit = 14;
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "increase-x-height", &prop );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * Set this value right after calling @FT_Set_Char_Size, but before
+ * loading any glyph (using the auto-hinter).
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Prop_IncreaseXHeight
+ *
+ * @description:
+ * The data exchange structure for the @increase-x-height property.
+ *
+ */
+ typedef struct FT_Prop_IncreaseXHeight_
+ {
+ FT_Face face;
+ FT_UInt limit;
+
+ } FT_Prop_IncreaseXHeight;
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * warping
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * If FreeType gets compiled with option AF_CONFIG_OPTION_USE_WARPER to
+ * activate the warp hinting code in the auto-hinter, this property
+ * switches warping on and off.
+ *
+ * Warping only works in `light' auto-hinting mode. The idea of the
+ * code is to slightly scale and shift a glyph along the non-hinted
+ * dimension (which is usually the horizontal axis) so that as much of
+ * its segments are aligned (more or less) to the grid. To find out a
+ * glyph's optimal scaling and shifting value, various parameter
+ * combinations are tried and scored.
+ *
+ * By default, warping is off. The example below shows how to switch on
+ * warping (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Bool warping = 1;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "warping", &warping );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * The warping code can also change advance widths. Have a look at the
+ * `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure
+ * for details on improving inter-glyph distances while rendering.
+ *
+ * Since warping is a global property of the auto-hinter it is best to
+ * change its value before rendering any face. Otherwise, you should
+ * reload all faces that get auto-hinted in `light' hinting mode.
+ *
+ */
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTAUTOH_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftbbox.h b/src/3rdparty/freetype/include/freetype/ftbbox.h
new file mode 100644
index 0000000000..9d9d040767
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftbbox.h
@@ -0,0 +1,101 @@
+/***************************************************************************/
+/* */
+/* ftbbox.h */
+/* */
+/* FreeType exact bbox computation (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This component has a _single_ role: to compute exact outline bounding */
+ /* boxes. */
+ /* */
+ /* It is separated from the rest of the engine for various technical */
+ /* reasons. It may well be integrated in `ftoutln' later. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTBBOX_H__
+#define __FTBBOX_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_BBox */
+ /* */
+ /* <Description> */
+ /* Compute the exact bounding box of an outline. This is slower */
+ /* than computing the control box. However, it uses an advanced */
+ /* algorithm that returns _very_ quickly when the two boxes */
+ /* coincide. Otherwise, the outline Bézier arcs are traversed to */
+ /* extract their extrema. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline. */
+ /* */
+ /* <Output> */
+ /* abbox :: The outline's exact bounding box. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* If the font is tricky and the glyph has been loaded with */
+ /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
+ /* reasonable values for the BBox it is necessary to load the glyph */
+ /* at a large ppem value (so that the hinting instructions can */
+ /* properly shift and scale the subglyphs), then extracting the BBox, */
+ /* which can be eventually converted back to font units. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Get_BBox( FT_Outline* outline,
+ FT_BBox *abbox );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTBBOX_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
diff --git a/src/3rdparty/freetype/include/freetype/ftbdf.h b/src/3rdparty/freetype/include/freetype/ftbdf.h
new file mode 100644
index 0000000000..0bdabf481c
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftbdf.h
@@ -0,0 +1,210 @@
+/***************************************************************************/
+/* */
+/* ftbdf.h */
+/* */
+/* FreeType API for accessing BDF-specific strings (specification). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTBDF_H__
+#define __FTBDF_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* bdf_fonts */
+ /* */
+ /* <Title> */
+ /* BDF and PCF Files */
+ /* */
+ /* <Abstract> */
+ /* BDF and PCF specific API. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of functions specific to BDF */
+ /* and PCF fonts. */
+ /* */
+ /*************************************************************************/
+
+
+ /**********************************************************************
+ *
+ * @enum:
+ * BDF_PropertyType
+ *
+ * @description:
+ * A list of BDF property types.
+ *
+ * @values:
+ * BDF_PROPERTY_TYPE_NONE ::
+ * Value~0 is used to indicate a missing property.
+ *
+ * BDF_PROPERTY_TYPE_ATOM ::
+ * Property is a string atom.
+ *
+ * BDF_PROPERTY_TYPE_INTEGER ::
+ * Property is a 32-bit signed integer.
+ *
+ * BDF_PROPERTY_TYPE_CARDINAL ::
+ * Property is a 32-bit unsigned integer.
+ */
+ typedef enum BDF_PropertyType_
+ {
+ BDF_PROPERTY_TYPE_NONE = 0,
+ BDF_PROPERTY_TYPE_ATOM = 1,
+ BDF_PROPERTY_TYPE_INTEGER = 2,
+ BDF_PROPERTY_TYPE_CARDINAL = 3
+
+ } BDF_PropertyType;
+
+
+ /**********************************************************************
+ *
+ * @type:
+ * BDF_Property
+ *
+ * @description:
+ * A handle to a @BDF_PropertyRec structure to model a given
+ * BDF/PCF property.
+ */
+ typedef struct BDF_PropertyRec_* BDF_Property;
+
+
+ /**********************************************************************
+ *
+ * @struct:
+ * BDF_PropertyRec
+ *
+ * @description:
+ * This structure models a given BDF/PCF property.
+ *
+ * @fields:
+ * type ::
+ * The property type.
+ *
+ * u.atom ::
+ * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
+ * NULL, indicating an empty string.
+ *
+ * u.integer ::
+ * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
+ *
+ * u.cardinal ::
+ * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
+ */
+ typedef struct BDF_PropertyRec_
+ {
+ BDF_PropertyType type;
+ union {
+ const char* atom;
+ FT_Int32 integer;
+ FT_UInt32 cardinal;
+
+ } u;
+
+ } BDF_PropertyRec;
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_BDF_Charset_ID
+ *
+ * @description:
+ * Retrieve a BDF font character set identity, according to
+ * the BDF specification.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * @output:
+ * acharset_encoding ::
+ * Charset encoding, as a C~string, owned by the face.
+ *
+ * acharset_registry ::
+ * Charset registry, as a C~string, owned by the face.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with BDF faces, returning an error otherwise.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_BDF_Charset_ID( FT_Face face,
+ const char* *acharset_encoding,
+ const char* *acharset_registry );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_BDF_Property
+ *
+ * @description:
+ * Retrieve a BDF property from a BDF or PCF font file.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * name :: The property name.
+ *
+ * @output:
+ * aproperty :: The property.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function works with BDF _and_ PCF fonts. It returns an error
+ * otherwise. It also returns an error if the property is not in the
+ * font.
+ *
+ * A `property' is a either key-value pair within the STARTPROPERTIES
+ * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
+ * `info->props' array within a `FontRec' structure of a PCF font.
+ *
+ * Integer properties are always stored as `signed' within PCF fonts;
+ * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
+ * for BDF fonts only.
+ *
+ * In case of error, `aproperty->type' is always set to
+ * @BDF_PROPERTY_TYPE_NONE.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_BDF_Property( FT_Face face,
+ const char* prop_name,
+ BDF_PropertyRec *aproperty );
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTBDF_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftbitmap.h b/src/3rdparty/freetype/include/freetype/ftbitmap.h
new file mode 100644
index 0000000000..46cc47b7d1
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftbitmap.h
@@ -0,0 +1,240 @@
+/***************************************************************************/
+/* */
+/* ftbitmap.h */
+/* */
+/* FreeType utility functions for bitmaps (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTBITMAP_H__
+#define __FTBITMAP_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* bitmap_handling */
+ /* */
+ /* <Title> */
+ /* Bitmap Handling */
+ /* */
+ /* <Abstract> */
+ /* Handling FT_Bitmap objects. */
+ /* */
+ /* <Description> */
+ /* This section contains functions for handling @FT_Bitmap objects. */
+ /* Note that none of the functions changes the bitmap's `flow' (as */
+ /* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Bitmap_Init */
+ /* */
+ /* <Description> */
+ /* Initialize a pointer to an @FT_Bitmap structure. */
+ /* */
+ /* <InOut> */
+ /* abitmap :: A pointer to the bitmap structure. */
+ /* */
+ /* <Note> */
+ /* A deprecated name for the same function is `FT_Bitmap_New'. */
+ /* */
+ FT_EXPORT( void )
+ FT_Bitmap_Init( FT_Bitmap *abitmap );
+
+
+ /* deprecated */
+ FT_EXPORT( void )
+ FT_Bitmap_New( FT_Bitmap *abitmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Bitmap_Copy */
+ /* */
+ /* <Description> */
+ /* Copy a bitmap into another one. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a library object. */
+ /* */
+ /* source :: A handle to the source bitmap. */
+ /* */
+ /* <Output> */
+ /* target :: A handle to the target bitmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Bitmap_Copy( FT_Library library,
+ const FT_Bitmap *source,
+ FT_Bitmap *target);
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Bitmap_Embolden */
+ /* */
+ /* <Description> */
+ /* Embolden a bitmap. The new bitmap will be about `xStrength' */
+ /* pixels wider and `yStrength' pixels higher. The left and bottom */
+ /* borders are kept unchanged. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a library object. */
+ /* */
+ /* xStrength :: How strong the glyph is emboldened horizontally. */
+ /* Expressed in 26.6 pixel format. */
+ /* */
+ /* yStrength :: How strong the glyph is emboldened vertically. */
+ /* Expressed in 26.6 pixel format. */
+ /* */
+ /* <InOut> */
+ /* bitmap :: A handle to the target bitmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The current implementation restricts `xStrength' to be less than */
+ /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
+ /* */
+ /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
+ /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
+ /* */
+ /* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
+ /* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Bitmap_Embolden( FT_Library library,
+ FT_Bitmap* bitmap,
+ FT_Pos xStrength,
+ FT_Pos yStrength );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Bitmap_Convert */
+ /* */
+ /* <Description> */
+ /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
+ /* to a bitmap object with depth 8bpp, making the number of used */
+ /* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a library object. */
+ /* */
+ /* source :: The source bitmap. */
+ /* */
+ /* alignment :: The pitch of the bitmap is a multiple of this */
+ /* parameter. Common values are 1, 2, or 4. */
+ /* */
+ /* <Output> */
+ /* target :: The target bitmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* It is possible to call @FT_Bitmap_Convert multiple times without */
+ /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
+ /* */
+ /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
+ /* */
+ /* The `library' argument is taken to have access to FreeType's */
+ /* memory handling functions. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Bitmap_Convert( FT_Library library,
+ const FT_Bitmap *source,
+ FT_Bitmap *target,
+ FT_Int alignment );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_GlyphSlot_Own_Bitmap */
+ /* */
+ /* <Description> */
+ /* Make sure that a glyph slot owns `slot->bitmap'. */
+ /* */
+ /* <Input> */
+ /* slot :: The glyph slot. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function is to be used in combination with */
+ /* @FT_Bitmap_Embolden. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Bitmap_Done */
+ /* */
+ /* <Description> */
+ /* Destroy a bitmap object initialized with @FT_Bitmap_Init. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a library object. */
+ /* */
+ /* bitmap :: The bitmap object to be freed. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The `library' argument is taken to have access to FreeType's */
+ /* memory handling functions. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Bitmap_Done( FT_Library library,
+ FT_Bitmap *bitmap );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTBITMAP_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftbzip2.h b/src/3rdparty/freetype/include/freetype/ftbzip2.h
new file mode 100644
index 0000000000..c25f9469df
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftbzip2.h
@@ -0,0 +1,102 @@
+/***************************************************************************/
+/* */
+/* ftbzip2.h */
+/* */
+/* Bzip2-compressed stream support. */
+/* */
+/* Copyright 2010-2015 by */
+/* Joel Klinghed. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTBZIP2_H__
+#define __FTBZIP2_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* bzip2 */
+ /* */
+ /* <Title> */
+ /* BZIP2 Streams */
+ /* */
+ /* <Abstract> */
+ /* Using bzip2-compressed font files. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of Bzip2-specific functions. */
+ /* */
+ /*************************************************************************/
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Stream_OpenBzip2
+ *
+ * @description:
+ * Open a new stream to parse bzip2-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.bz2' fonts that come
+ * with XFree86.
+ *
+ * @input:
+ * stream ::
+ * The target embedding stream.
+ *
+ * source ::
+ * The source stream.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source stream must be opened _before_ calling this function.
+ *
+ * Calling the internal function `FT_Stream_Close' on the new stream will
+ * *not* call `FT_Stream_Close' on the source stream. None of the stream
+ * objects will be released to the heap.
+ *
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream.
+ *
+ * In certain builds of the library, bzip2 compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a bzip2 compressed stream
+ * from it and re-open the face with it.
+ *
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with bzip2 support.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stream_OpenBzip2( FT_Stream stream,
+ FT_Stream source );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTBZIP2_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftcache.h b/src/3rdparty/freetype/include/freetype/ftcache.h
new file mode 100644
index 0000000000..68525bb829
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftcache.h
@@ -0,0 +1,1057 @@
+/***************************************************************************/
+/* */
+/* ftcache.h */
+/* */
+/* FreeType Cache subsystem (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCACHE_H__
+#define __FTCACHE_H__
+
+
+#include <ft2build.h>
+#include FT_GLYPH_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************
+ *
+ * <Section>
+ * cache_subsystem
+ *
+ * <Title>
+ * Cache Sub-System
+ *
+ * <Abstract>
+ * How to cache face, size, and glyph data with FreeType~2.
+ *
+ * <Description>
+ * This section describes the FreeType~2 cache sub-system, which is used
+ * to limit the number of concurrently opened @FT_Face and @FT_Size
+ * objects, as well as caching information like character maps and glyph
+ * images while limiting their maximum memory usage.
+ *
+ * Note that all types and functions begin with the `FTC_' prefix.
+ *
+ * The cache is highly portable and thus doesn't know anything about the
+ * fonts installed on your system, or how to access them. This implies
+ * the following scheme:
+ *
+ * First, available or installed font faces are uniquely identified by
+ * @FTC_FaceID values, provided to the cache by the client. Note that
+ * the cache only stores and compares these values, and doesn't try to
+ * interpret them in any way.
+ *
+ * Second, the cache calls, only when needed, a client-provided function
+ * to convert an @FTC_FaceID into a new @FT_Face object. The latter is
+ * then completely managed by the cache, including its termination
+ * through @FT_Done_Face. To monitor termination of face objects, the
+ * finalizer callback in the `generic' field of the @FT_Face object can
+ * be used, which might also be used to store the @FTC_FaceID of the
+ * face.
+ *
+ * Clients are free to map face IDs to anything else. The most simple
+ * usage is to associate them to a (pathname,face_index) pair that is
+ * used to call @FT_New_Face. However, more complex schemes are also
+ * possible.
+ *
+ * Note that for the cache to work correctly, the face ID values must be
+ * *persistent*, which means that the contents they point to should not
+ * change at runtime, or that their value should not become invalid.
+ *
+ * If this is unavoidable (e.g., when a font is uninstalled at runtime),
+ * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
+ * the cache get rid of any references to the old @FTC_FaceID it may
+ * keep internally. Failure to do so will lead to incorrect behaviour
+ * or even crashes.
+ *
+ * To use the cache, start with calling @FTC_Manager_New to create a new
+ * @FTC_Manager object, which models a single cache instance. You can
+ * then look up @FT_Face and @FT_Size objects with
+ * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
+ *
+ * If you want to use the charmap caching, call @FTC_CMapCache_New, then
+ * later use @FTC_CMapCache_Lookup to perform the equivalent of
+ * @FT_Get_Char_Index, only much faster.
+ *
+ * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
+ * later use @FTC_ImageCache_Lookup to retrieve the corresponding
+ * @FT_Glyph objects from the cache.
+ *
+ * If you need lots of small bitmaps, it is much more memory efficient
+ * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
+ * returns @FTC_SBitRec structures, which are used to store small
+ * bitmaps directly. (A small bitmap is one whose metrics and
+ * dimensions all fit into 8-bit integers).
+ *
+ * We hope to also provide a kerning cache in the near future.
+ *
+ *
+ * <Order>
+ * FTC_Manager
+ * FTC_FaceID
+ * FTC_Face_Requester
+ *
+ * FTC_Manager_New
+ * FTC_Manager_Reset
+ * FTC_Manager_Done
+ * FTC_Manager_LookupFace
+ * FTC_Manager_LookupSize
+ * FTC_Manager_RemoveFaceID
+ *
+ * FTC_Node
+ * FTC_Node_Unref
+ *
+ * FTC_ImageCache
+ * FTC_ImageCache_New
+ * FTC_ImageCache_Lookup
+ *
+ * FTC_SBit
+ * FTC_SBitCache
+ * FTC_SBitCache_New
+ * FTC_SBitCache_Lookup
+ *
+ * FTC_CMapCache
+ * FTC_CMapCache_New
+ * FTC_CMapCache_Lookup
+ *
+ *************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** BASIC TYPE DEFINITIONS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @type: FTC_FaceID
+ *
+ * @description:
+ * An opaque pointer type that is used to identity face objects. The
+ * contents of such objects is application-dependent.
+ *
+ * These pointers are typically used to point to a user-defined
+ * structure containing a font file path, and face index.
+ *
+ * @note:
+ * Never use NULL as a valid @FTC_FaceID.
+ *
+ * Face IDs are passed by the client to the cache manager that calls,
+ * when needed, the @FTC_Face_Requester to translate them into new
+ * @FT_Face objects.
+ *
+ * If the content of a given face ID changes at runtime, or if the value
+ * becomes invalid (e.g., when uninstalling a font), you should
+ * immediately call @FTC_Manager_RemoveFaceID before any other cache
+ * function.
+ *
+ * Failure to do so will result in incorrect behaviour or even
+ * memory leaks and crashes.
+ */
+ typedef FT_Pointer FTC_FaceID;
+
+
+ /************************************************************************
+ *
+ * @functype:
+ * FTC_Face_Requester
+ *
+ * @description:
+ * A callback function provided by client applications. It is used by
+ * the cache manager to translate a given @FTC_FaceID into a new valid
+ * @FT_Face object, on demand.
+ *
+ * <Input>
+ * face_id ::
+ * The face ID to resolve.
+ *
+ * library ::
+ * A handle to a FreeType library object.
+ *
+ * req_data ::
+ * Application-provided request data (see note below).
+ *
+ * <Output>
+ * aface ::
+ * A new @FT_Face handle.
+ *
+ * <Return>
+ * FreeType error code. 0~means success.
+ *
+ * <Note>
+ * The third parameter `req_data' is the same as the one passed by the
+ * client when @FTC_Manager_New is called.
+ *
+ * The face requester should not perform funny things on the returned
+ * face object, like creating a new @FT_Size for it, or setting a
+ * transformation through @FT_Set_Transform!
+ */
+ typedef FT_Error
+ (*FTC_Face_Requester)( FTC_FaceID face_id,
+ FT_Library library,
+ FT_Pointer req_data,
+ FT_Face* aface );
+
+ /* */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** CACHE MANAGER OBJECT *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_Manager */
+ /* */
+ /* <Description> */
+ /* This object corresponds to one instance of the cache-subsystem. */
+ /* It is used to cache one or more @FT_Face objects, along with */
+ /* corresponding @FT_Size objects. */
+ /* */
+ /* The manager intentionally limits the total number of opened */
+ /* @FT_Face and @FT_Size objects to control memory usage. See the */
+ /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
+ /* */
+ /* The manager is also used to cache `nodes' of various types while */
+ /* limiting their total memory usage. */
+ /* */
+ /* All limitations are enforced by keeping lists of managed objects */
+ /* in most-recently-used order, and flushing old nodes to make room */
+ /* for new ones. */
+ /* */
+ typedef struct FTC_ManagerRec_* FTC_Manager;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_Node */
+ /* */
+ /* <Description> */
+ /* An opaque handle to a cache node object. Each cache node is */
+ /* reference-counted. A node with a count of~0 might be flushed */
+ /* out of a full cache whenever a lookup request is performed. */
+ /* */
+ /* If you look up nodes, you have the ability to `acquire' them, */
+ /* i.e., to increment their reference count. This will prevent the */
+ /* node from being flushed out of the cache until you explicitly */
+ /* `release' it (see @FTC_Node_Unref). */
+ /* */
+ /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
+ /* */
+ typedef struct FTC_NodeRec_* FTC_Node;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_New */
+ /* */
+ /* <Description> */
+ /* Create a new cache manager. */
+ /* */
+ /* <Input> */
+ /* library :: The parent FreeType library handle to use. */
+ /* */
+ /* max_faces :: Maximum number of opened @FT_Face objects managed by */
+ /* this cache instance. Use~0 for defaults. */
+ /* */
+ /* max_sizes :: Maximum number of opened @FT_Size objects managed by */
+ /* this cache instance. Use~0 for defaults. */
+ /* */
+ /* max_bytes :: Maximum number of bytes to use for cached data nodes. */
+ /* Use~0 for defaults. Note that this value does not */
+ /* account for managed @FT_Face and @FT_Size objects. */
+ /* */
+ /* requester :: An application-provided callback used to translate */
+ /* face IDs into real @FT_Face objects. */
+ /* */
+ /* req_data :: A generic pointer that is passed to the requester */
+ /* each time it is called (see @FTC_Face_Requester). */
+ /* */
+ /* <Output> */
+ /* amanager :: A handle to a new manager object. 0~in case of */
+ /* failure. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_Manager_New( FT_Library library,
+ FT_UInt max_faces,
+ FT_UInt max_sizes,
+ FT_ULong max_bytes,
+ FTC_Face_Requester requester,
+ FT_Pointer req_data,
+ FTC_Manager *amanager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Reset */
+ /* */
+ /* <Description> */
+ /* Empty a given cache manager. This simply gets rid of all the */
+ /* currently cached @FT_Face and @FT_Size objects within the manager. */
+ /* */
+ /* <InOut> */
+ /* manager :: A handle to the manager. */
+ /* */
+ FT_EXPORT( void )
+ FTC_Manager_Reset( FTC_Manager manager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Done */
+ /* */
+ /* <Description> */
+ /* Destroy a given manager after emptying it. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the target cache manager object. */
+ /* */
+ FT_EXPORT( void )
+ FTC_Manager_Done( FTC_Manager manager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_LookupFace */
+ /* */
+ /* <Description> */
+ /* Retrieve the @FT_Face object that corresponds to a given face ID */
+ /* through a cache manager. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the cache manager. */
+ /* */
+ /* face_id :: The ID of the face object. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to the face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The returned @FT_Face object is always owned by the manager. You */
+ /* should never try to discard it yourself. */
+ /* */
+ /* The @FT_Face object doesn't necessarily have a current size object */
+ /* (i.e., face->size can be~0). If you need a specific `font size', */
+ /* use @FTC_Manager_LookupSize instead. */
+ /* */
+ /* Never change the face's transformation matrix (i.e., never call */
+ /* the @FT_Set_Transform function) on a returned face! If you need */
+ /* to transform glyphs, do it yourself after glyph loading. */
+ /* */
+ /* When you perform a lookup, out-of-memory errors are detected */
+ /* _within_ the lookup and force incremental flushes of the cache */
+ /* until enough memory is released for the lookup to succeed. */
+ /* */
+ /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
+ /* already been completely flushed, and still no memory was available */
+ /* for the operation. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_Manager_LookupFace( FTC_Manager manager,
+ FTC_FaceID face_id,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FTC_ScalerRec */
+ /* */
+ /* <Description> */
+ /* A structure used to describe a given character size in either */
+ /* pixels or points to the cache manager. See */
+ /* @FTC_Manager_LookupSize. */
+ /* */
+ /* <Fields> */
+ /* face_id :: The source face ID. */
+ /* */
+ /* width :: The character width. */
+ /* */
+ /* height :: The character height. */
+ /* */
+ /* pixel :: A Boolean. If 1, the `width' and `height' fields are */
+ /* interpreted as integer pixel character sizes. */
+ /* Otherwise, they are expressed as 1/64th of points. */
+ /* */
+ /* x_res :: Only used when `pixel' is value~0 to indicate the */
+ /* horizontal resolution in dpi. */
+ /* */
+ /* y_res :: Only used when `pixel' is value~0 to indicate the */
+ /* vertical resolution in dpi. */
+ /* */
+ /* <Note> */
+ /* This type is mainly used to retrieve @FT_Size objects through the */
+ /* cache manager. */
+ /* */
+ typedef struct FTC_ScalerRec_
+ {
+ FTC_FaceID face_id;
+ FT_UInt width;
+ FT_UInt height;
+ FT_Int pixel;
+ FT_UInt x_res;
+ FT_UInt y_res;
+
+ } FTC_ScalerRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FTC_Scaler */
+ /* */
+ /* <Description> */
+ /* A handle to an @FTC_ScalerRec structure. */
+ /* */
+ typedef struct FTC_ScalerRec_* FTC_Scaler;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_LookupSize */
+ /* */
+ /* <Description> */
+ /* Retrieve the @FT_Size object that corresponds to a given */
+ /* @FTC_ScalerRec pointer through a cache manager. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the cache manager. */
+ /* */
+ /* scaler :: A scaler handle. */
+ /* */
+ /* <Output> */
+ /* asize :: A handle to the size object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The returned @FT_Size object is always owned by the manager. You */
+ /* should never try to discard it by yourself. */
+ /* */
+ /* You can access the parent @FT_Face object simply as `size->face' */
+ /* if you need it. Note that this object is also owned by the */
+ /* manager. */
+ /* */
+ /* <Note> */
+ /* When you perform a lookup, out-of-memory errors are detected */
+ /* _within_ the lookup and force incremental flushes of the cache */
+ /* until enough memory is released for the lookup to succeed. */
+ /* */
+ /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
+ /* already been completely flushed, and still no memory is available */
+ /* for the operation. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_Manager_LookupSize( FTC_Manager manager,
+ FTC_Scaler scaler,
+ FT_Size *asize );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Node_Unref */
+ /* */
+ /* <Description> */
+ /* Decrement a cache node's internal reference count. When the count */
+ /* reaches 0, it is not destroyed but becomes eligible for subsequent */
+ /* cache flushes. */
+ /* */
+ /* <Input> */
+ /* node :: The cache node handle. */
+ /* */
+ /* manager :: The cache manager handle. */
+ /* */
+ FT_EXPORT( void )
+ FTC_Node_Unref( FTC_Node node,
+ FTC_Manager manager );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FTC_Manager_RemoveFaceID
+ *
+ * @description:
+ * A special function used to indicate to the cache manager that
+ * a given @FTC_FaceID is no longer valid, either because its
+ * content changed, or because it was deallocated or uninstalled.
+ *
+ * @input:
+ * manager ::
+ * The cache manager handle.
+ *
+ * face_id ::
+ * The @FTC_FaceID to be removed.
+ *
+ * @note:
+ * This function flushes all nodes from the cache corresponding to this
+ * `face_id', with the exception of nodes with a non-null reference
+ * count.
+ *
+ * Such nodes are however modified internally so as to never appear
+ * in later lookups with the same `face_id' value, and to be immediately
+ * destroyed when released by all their users.
+ *
+ */
+ FT_EXPORT( void )
+ FTC_Manager_RemoveFaceID( FTC_Manager manager,
+ FTC_FaceID face_id );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* cache_subsystem */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************
+ *
+ * @type:
+ * FTC_CMapCache
+ *
+ * @description:
+ * An opaque handle used to model a charmap cache. This cache is to
+ * hold character codes -> glyph indices mappings.
+ *
+ */
+ typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FTC_CMapCache_New
+ *
+ * @description:
+ * Create a new charmap cache.
+ *
+ * @input:
+ * manager ::
+ * A handle to the cache manager.
+ *
+ * @output:
+ * acache ::
+ * A new cache handle. NULL in case of error.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * Like all other caches, this one will be destroyed with the cache
+ * manager.
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FTC_CMapCache_New( FTC_Manager manager,
+ FTC_CMapCache *acache );
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FTC_CMapCache_Lookup
+ *
+ * @description:
+ * Translate a character code into a glyph index, using the charmap
+ * cache.
+ *
+ * @input:
+ * cache ::
+ * A charmap cache handle.
+ *
+ * face_id ::
+ * The source face ID.
+ *
+ * cmap_index ::
+ * The index of the charmap in the source face. Any negative value
+ * means to use the cache @FT_Face's default charmap.
+ *
+ * char_code ::
+ * The character code (in the corresponding charmap).
+ *
+ * @return:
+ * Glyph index. 0~means `no glyph'.
+ *
+ */
+ FT_EXPORT( FT_UInt )
+ FTC_CMapCache_Lookup( FTC_CMapCache cache,
+ FTC_FaceID face_id,
+ FT_Int cmap_index,
+ FT_UInt32 char_code );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* cache_subsystem */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** IMAGE CACHE OBJECT *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @struct:
+ * FTC_ImageTypeRec
+ *
+ * @description:
+ * A structure used to model the type of images in a glyph cache.
+ *
+ * @fields:
+ * face_id ::
+ * The face ID.
+ *
+ * width ::
+ * The width in pixels.
+ *
+ * height ::
+ * The height in pixels.
+ *
+ * flags ::
+ * The load flags, as in @FT_Load_Glyph.
+ *
+ */
+ typedef struct FTC_ImageTypeRec_
+ {
+ FTC_FaceID face_id;
+ FT_UInt width;
+ FT_UInt height;
+ FT_Int32 flags;
+
+ } FTC_ImageTypeRec;
+
+
+ /*************************************************************************
+ *
+ * @type:
+ * FTC_ImageType
+ *
+ * @description:
+ * A handle to an @FTC_ImageTypeRec structure.
+ *
+ */
+ typedef struct FTC_ImageTypeRec_* FTC_ImageType;
+
+
+ /* */
+
+
+#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
+ ( (d1)->face_id == (d2)->face_id && \
+ (d1)->width == (d2)->width && \
+ (d1)->flags == (d2)->flags )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_ImageCache */
+ /* */
+ /* <Description> */
+ /* A handle to a glyph image cache object. They are designed to */
+ /* hold many distinct glyph images while not exceeding a certain */
+ /* memory threshold. */
+ /* */
+ typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_ImageCache_New */
+ /* */
+ /* <Description> */
+ /* Create a new glyph image cache. */
+ /* */
+ /* <Input> */
+ /* manager :: The parent manager for the image cache. */
+ /* */
+ /* <Output> */
+ /* acache :: A handle to the new glyph image cache object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_ImageCache_New( FTC_Manager manager,
+ FTC_ImageCache *acache );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_ImageCache_Lookup */
+ /* */
+ /* <Description> */
+ /* Retrieve a given glyph image from a glyph image cache. */
+ /* */
+ /* <Input> */
+ /* cache :: A handle to the source glyph image cache. */
+ /* */
+ /* type :: A pointer to a glyph image type descriptor. */
+ /* */
+ /* gindex :: The glyph index to retrieve. */
+ /* */
+ /* <Output> */
+ /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
+ /* failure. */
+ /* */
+ /* anode :: Used to return the address of of the corresponding cache */
+ /* node after incrementing its reference count (see note */
+ /* below). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The returned glyph is owned and managed by the glyph image cache. */
+ /* Never try to transform or discard it manually! You can however */
+ /* create a copy with @FT_Glyph_Copy and modify the new one. */
+ /* */
+ /* If `anode' is _not_ NULL, it receives the address of the cache */
+ /* node containing the glyph image, after increasing its reference */
+ /* count. This ensures that the node (as well as the @FT_Glyph) will */
+ /* always be kept in the cache until you call @FTC_Node_Unref to */
+ /* `release' it. */
+ /* */
+ /* If `anode' is NULL, the cache node is left unchanged, which means */
+ /* that the @FT_Glyph could be flushed out of the cache on the next */
+ /* call to one of the caching sub-system APIs. Don't assume that it */
+ /* is persistent! */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_ImageCache_Lookup( FTC_ImageCache cache,
+ FTC_ImageType type,
+ FT_UInt gindex,
+ FT_Glyph *aglyph,
+ FTC_Node *anode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_ImageCache_LookupScaler */
+ /* */
+ /* <Description> */
+ /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
+ /* to specify the face ID and its size. */
+ /* */
+ /* <Input> */
+ /* cache :: A handle to the source glyph image cache. */
+ /* */
+ /* scaler :: A pointer to a scaler descriptor. */
+ /* */
+ /* load_flags :: The corresponding load flags. */
+ /* */
+ /* gindex :: The glyph index to retrieve. */
+ /* */
+ /* <Output> */
+ /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
+ /* failure. */
+ /* */
+ /* anode :: Used to return the address of of the corresponding */
+ /* cache node after incrementing its reference count */
+ /* (see note below). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The returned glyph is owned and managed by the glyph image cache. */
+ /* Never try to transform or discard it manually! You can however */
+ /* create a copy with @FT_Glyph_Copy and modify the new one. */
+ /* */
+ /* If `anode' is _not_ NULL, it receives the address of the cache */
+ /* node containing the glyph image, after increasing its reference */
+ /* count. This ensures that the node (as well as the @FT_Glyph) will */
+ /* always be kept in the cache until you call @FTC_Node_Unref to */
+ /* `release' it. */
+ /* */
+ /* If `anode' is NULL, the cache node is left unchanged, which means */
+ /* that the @FT_Glyph could be flushed out of the cache on the next */
+ /* call to one of the caching sub-system APIs. Don't assume that it */
+ /* is persistent! */
+ /* */
+ /* Calls to @FT_Set_Char_Size and friends have no effect on cached */
+ /* glyphs; you should always use the FreeType cache API instead. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
+ FTC_Scaler scaler,
+ FT_ULong load_flags,
+ FT_UInt gindex,
+ FT_Glyph *aglyph,
+ FTC_Node *anode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_SBit */
+ /* */
+ /* <Description> */
+ /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
+ /* structure for details. */
+ /* */
+ typedef struct FTC_SBitRec_* FTC_SBit;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FTC_SBitRec */
+ /* */
+ /* <Description> */
+ /* A very compact structure used to describe a small glyph bitmap. */
+ /* */
+ /* <Fields> */
+ /* width :: The bitmap width in pixels. */
+ /* */
+ /* height :: The bitmap height in pixels. */
+ /* */
+ /* left :: The horizontal distance from the pen position to the */
+ /* left bitmap border (a.k.a. `left side bearing', or */
+ /* `lsb'). */
+ /* */
+ /* top :: The vertical distance from the pen position (on the */
+ /* baseline) to the upper bitmap border (a.k.a. `top */
+ /* side bearing'). The distance is positive for upwards */
+ /* y~coordinates. */
+ /* */
+ /* format :: The format of the glyph bitmap (monochrome or gray). */
+ /* */
+ /* max_grays :: Maximum gray level value (in the range 1 to~255). */
+ /* */
+ /* pitch :: The number of bytes per bitmap line. May be positive */
+ /* or negative. */
+ /* */
+ /* xadvance :: The horizontal advance width in pixels. */
+ /* */
+ /* yadvance :: The vertical advance height in pixels. */
+ /* */
+ /* buffer :: A pointer to the bitmap pixels. */
+ /* */
+ typedef struct FTC_SBitRec_
+ {
+ FT_Byte width;
+ FT_Byte height;
+ FT_Char left;
+ FT_Char top;
+
+ FT_Byte format;
+ FT_Byte max_grays;
+ FT_Short pitch;
+ FT_Char xadvance;
+ FT_Char yadvance;
+
+ FT_Byte* buffer;
+
+ } FTC_SBitRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_SBitCache */
+ /* */
+ /* <Description> */
+ /* A handle to a small bitmap cache. These are special cache objects */
+ /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
+ /* much more efficient way than the traditional glyph image cache */
+ /* implemented by @FTC_ImageCache. */
+ /* */
+ typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_SBitCache_New */
+ /* */
+ /* <Description> */
+ /* Create a new cache to store small glyph bitmaps. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the source cache manager. */
+ /* */
+ /* <Output> */
+ /* acache :: A handle to the new sbit cache. NULL in case of error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_SBitCache_New( FTC_Manager manager,
+ FTC_SBitCache *acache );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_SBitCache_Lookup */
+ /* */
+ /* <Description> */
+ /* Look up a given small glyph bitmap in a given sbit cache and */
+ /* `lock' it to prevent its flushing from the cache until needed. */
+ /* */
+ /* <Input> */
+ /* cache :: A handle to the source sbit cache. */
+ /* */
+ /* type :: A pointer to the glyph image type descriptor. */
+ /* */
+ /* gindex :: The glyph index. */
+ /* */
+ /* <Output> */
+ /* sbit :: A handle to a small bitmap descriptor. */
+ /* */
+ /* anode :: Used to return the address of of the corresponding cache */
+ /* node after incrementing its reference count (see note */
+ /* below). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The small bitmap descriptor and its bit buffer are owned by the */
+ /* cache and should never be freed by the application. They might */
+ /* as well disappear from memory on the next cache lookup, so don't */
+ /* treat them as persistent data. */
+ /* */
+ /* The descriptor's `buffer' field is set to~0 to indicate a missing */
+ /* glyph bitmap. */
+ /* */
+ /* If `anode' is _not_ NULL, it receives the address of the cache */
+ /* node containing the bitmap, after increasing its reference count. */
+ /* This ensures that the node (as well as the image) will always be */
+ /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
+ /* */
+ /* If `anode' is NULL, the cache node is left unchanged, which means */
+ /* that the bitmap could be flushed out of the cache on the next */
+ /* call to one of the caching sub-system APIs. Don't assume that it */
+ /* is persistent! */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_SBitCache_Lookup( FTC_SBitCache cache,
+ FTC_ImageType type,
+ FT_UInt gindex,
+ FTC_SBit *sbit,
+ FTC_Node *anode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_SBitCache_LookupScaler */
+ /* */
+ /* <Description> */
+ /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
+ /* to specify the face ID and its size. */
+ /* */
+ /* <Input> */
+ /* cache :: A handle to the source sbit cache. */
+ /* */
+ /* scaler :: A pointer to the scaler descriptor. */
+ /* */
+ /* load_flags :: The corresponding load flags. */
+ /* */
+ /* gindex :: The glyph index. */
+ /* */
+ /* <Output> */
+ /* sbit :: A handle to a small bitmap descriptor. */
+ /* */
+ /* anode :: Used to return the address of of the corresponding */
+ /* cache node after incrementing its reference count */
+ /* (see note below). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The small bitmap descriptor and its bit buffer are owned by the */
+ /* cache and should never be freed by the application. They might */
+ /* as well disappear from memory on the next cache lookup, so don't */
+ /* treat them as persistent data. */
+ /* */
+ /* The descriptor's `buffer' field is set to~0 to indicate a missing */
+ /* glyph bitmap. */
+ /* */
+ /* If `anode' is _not_ NULL, it receives the address of the cache */
+ /* node containing the bitmap, after increasing its reference count. */
+ /* This ensures that the node (as well as the image) will always be */
+ /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
+ /* */
+ /* If `anode' is NULL, the cache node is left unchanged, which means */
+ /* that the bitmap could be flushed out of the cache on the next */
+ /* call to one of the caching sub-system APIs. Don't assume that it */
+ /* is persistent! */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_SBitCache_LookupScaler( FTC_SBitCache cache,
+ FTC_Scaler scaler,
+ FT_ULong load_flags,
+ FT_UInt gindex,
+ FTC_SBit *sbit,
+ FTC_Node *anode );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTCACHE_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftcffdrv.h b/src/3rdparty/freetype/include/freetype/ftcffdrv.h
new file mode 100644
index 0000000000..6c8e416cee
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftcffdrv.h
@@ -0,0 +1,262 @@
+/***************************************************************************/
+/* */
+/* ftcffdrv.h */
+/* */
+/* FreeType API for controlling the CFF driver (specification only). */
+/* */
+/* Copyright 2013-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCFFDRV_H__
+#define __FTCFFDRV_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * cff_driver
+ *
+ * @title:
+ * The CFF driver
+ *
+ * @abstract:
+ * Controlling the CFF driver module.
+ *
+ * @description:
+ * While FreeType's CFF driver doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. The list below gives the available properties
+ * together with the necessary macros and structures.
+ *
+ * The CFF driver's module name is `cff'.
+ *
+ * *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
+ *
+ * The rasterizer is positioning horizontal features (e.g., ascender
+ * height & x-height, or crossbars) on the pixel grid and minimizing the
+ * amount of antialiasing applied to them, while placing vertical
+ * features (vertical stems) on the pixel grid without hinting, thus
+ * representing the stem position and weight accurately. Sometimes the
+ * vertical stems may be only partially black. In this context,
+ * `antialiasing' means that stems are not positioned exactly on pixel
+ * borders, causing a fuzzy appearance.
+ *
+ * There are two principles behind this approach.
+ *
+ * 1) No hinting in the horizontal direction: Unlike `superhinted'
+ * TrueType, which changes glyph widths to accommodate regular
+ * inter-glyph spacing, Adobe's approach is `faithful to the design' in
+ * representing both the glyph width and the inter-glyph spacing
+ * designed for the font. This makes the screen display as close as it
+ * can be to the result one would get with infinite resolution, while
+ * preserving what is considered the key characteristics of each glyph.
+ * Note that the distances between unhinted and grid-fitted positions at
+ * small sizes are comparable to kerning values and thus would be
+ * noticeable (and distracting) while reading if hinting were applied.
+ *
+ * One of the reasons to not hint horizontally is antialiasing for LCD
+ * screens: The pixel geometry of modern displays supplies three
+ * vertical sub-pixels as the eye moves horizontally across each visible
+ * pixel. On devices where we can be certain this characteristic is
+ * present a rasterizer can take advantage of the sub-pixels to add
+ * increments of weight. In Western writing systems this turns out to
+ * be the more critical direction anyway; the weights and spacing of
+ * vertical stems (see above) are central to Armenian, Cyrillic, Greek,
+ * and Latin type designs. Even when the rasterizer uses greyscale
+ * antialiasing instead of color (a necessary compromise when one
+ * doesn't know the screen characteristics), the unhinted vertical
+ * features preserve the design's weight and spacing much better than
+ * aliased type would.
+ *
+ * 2) Aligment in the vertical direction: Weights and spacing along the
+ * y~axis are less critical; what is much more important is the visual
+ * alignment of related features (like cap-height and x-height). The
+ * sense of alignment for these is enhanced by the sharpness of grid-fit
+ * edges, while the cruder vertical resolution (full pixels instead of
+ * 1/3 pixels) is less of a problem.
+ *
+ * On the technical side, horizontal alignment zones for ascender,
+ * x-height, and other important height values (traditionally called
+ * `blue zones') as defined in the font are positioned independently,
+ * each being rounded to the nearest pixel edge, taking care of
+ * overshoot suppression at small sizes, stem darkening, and scaling.
+ *
+ * Hstems (this is, hint values defined in the font to help align
+ * horizontal features) that fall within a blue zone are said to be
+ * `captured' and are aligned to that zone. Uncaptured stems are moved
+ * in one of four ways, top edge up or down, bottom edge up or down.
+ * Unless there are conflicting hstems, the smallest movement is taken
+ * to minimize distortion.
+ *
+ * @order:
+ * hinting-engine
+ * no-stem-darkening
+ * darkening-parameters
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * hinting-engine
+ *
+ * @description:
+ * Thanks to Adobe, which contributed a new hinting (and parsing)
+ * engine, an application can select between `freetype' and `adobe' if
+ * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
+ * macro isn't defined, `hinting-engine' does nothing.
+ *
+ * The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
+ * defined, and `adobe' otherwise.
+ *
+ * The following example code demonstrates how to select Adobe's hinting
+ * engine (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "hinting-engine", &hinting_engine );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_CFF_HINTING_XXX
+ *
+ * @description:
+ * A list of constants used for the @hinting-engine property to select
+ * the hinting engine for CFF fonts.
+ *
+ * @values:
+ * FT_CFF_HINTING_FREETYPE ::
+ * Use the old FreeType hinting engine.
+ *
+ * FT_CFF_HINTING_ADOBE ::
+ * Use the hinting engine contributed by Adobe.
+ *
+ */
+#define FT_CFF_HINTING_FREETYPE 0
+#define FT_CFF_HINTING_ADOBE 1
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * no-stem-darkening
+ *
+ * @description:
+ * By default, the Adobe CFF engine darkens stems at smaller sizes,
+ * regardless of hinting, to enhance contrast. This feature requires
+ * a rendering system with proper gamma correction. Setting this
+ * property, stem darkening gets switched off.
+ *
+ * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
+ *
+ * {
+ * FT_Library library;
+ * FT_Bool no_stem_darkening = TRUE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "no-stem-darkening", &no_stem_darkening );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * darkening-parameters
+ *
+ * @description:
+ * By default, the Adobe CFF engine darkens stems as follows (if the
+ * `no-stem-darkening' property isn't set):
+ *
+ * {
+ * stem width <= 0.5px: darkening amount = 0.4px
+ * stem width = 1px: darkening amount = 0.275px
+ * stem width = 1.667px: darkening amount = 0.275px
+ * stem width >= 2.333px: darkening amount = 0px
+ * }
+ *
+ * and piecewise linear in-between. At configuration time, these four
+ * control points can be set with the macro
+ * `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'. At runtime, the control
+ * points can be changed using the `darkening-parameters' property, as
+ * the following example demonstrates.
+ *
+ * {
+ * FT_Library library;
+ * FT_Int darken_params[8] = { 500, 300, // x1, y1
+ * 1000, 200, // x2, y2
+ * 1500, 100, // x3, y3
+ * 2000, 0 }; // x4, y4
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "darkening-parameters", darken_params );
+ * }
+ *
+ * The x~values give the stem width, and the y~values the darkening
+ * amount. The unit is 1000th of pixels. All coordinate values must be
+ * positive; the x~values must be monotonically increasing; the
+ * y~values must be monotonically decreasing and smaller than or
+ * equal to 500 (corresponding to half a pixel); the slope of each
+ * linear piece must be shallower than -1 (e.g., -.4).
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTCFFDRV_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftchapters.h b/src/3rdparty/freetype/include/freetype/ftchapters.h
new file mode 100644
index 0000000000..ab4389530e
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftchapters.h
@@ -0,0 +1,135 @@
+/***************************************************************************/
+/* */
+/* This file defines the structure of the FreeType reference. */
+/* It is used by the python script that generates the HTML files. */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* general_remarks */
+/* */
+/* <Title> */
+/* General Remarks */
+/* */
+/* <Sections> */
+/* header_inclusion */
+/* user_allocation */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* core_api */
+/* */
+/* <Title> */
+/* Core API */
+/* */
+/* <Sections> */
+/* version */
+/* basic_types */
+/* base_interface */
+/* glyph_variants */
+/* glyph_management */
+/* mac_specific */
+/* sizes_management */
+/* header_file_macros */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* format_specific */
+/* */
+/* <Title> */
+/* Format-Specific API */
+/* */
+/* <Sections> */
+/* multiple_masters */
+/* truetype_tables */
+/* type1_tables */
+/* sfnt_names */
+/* bdf_fonts */
+/* cid_fonts */
+/* pfr_fonts */
+/* winfnt_fonts */
+/* font_formats */
+/* gasp_table */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* module_specific */
+/* */
+/* <Title> */
+/* Controlling FreeType Modules */
+/* */
+/* <Sections> */
+/* auto_hinter */
+/* cff_driver */
+/* tt_driver */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* cache_subsystem */
+/* */
+/* <Title> */
+/* Cache Sub-System */
+/* */
+/* <Sections> */
+/* cache_subsystem */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* support_api */
+/* */
+/* <Title> */
+/* Support API */
+/* */
+/* <Sections> */
+/* computations */
+/* list_processing */
+/* outline_processing */
+/* quick_advance */
+/* bitmap_handling */
+/* raster */
+/* glyph_stroker */
+/* system_interface */
+/* module_management */
+/* gzip */
+/* lzw */
+/* bzip2 */
+/* lcd_filtering */
+/* */
+/***************************************************************************/
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* error_codes */
+/* */
+/* <Title> */
+/* Error Codes */
+/* */
+/* <Sections> */
+/* error_enumerations */
+/* error_code_values */
+/* */
+/***************************************************************************/
diff --git a/src/3rdparty/freetype/include/freetype/ftcid.h b/src/3rdparty/freetype/include/freetype/ftcid.h
new file mode 100644
index 0000000000..05741c85b7
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftcid.h
@@ -0,0 +1,168 @@
+/***************************************************************************/
+/* */
+/* ftcid.h */
+/* */
+/* FreeType API for accessing CID font information (specification). */
+/* */
+/* Copyright 2007-2015 by */
+/* Dereg Clegg and Michael Toftdal. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCID_H__
+#define __FTCID_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* cid_fonts */
+ /* */
+ /* <Title> */
+ /* CID Fonts */
+ /* */
+ /* <Abstract> */
+ /* CID-keyed font specific API. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of CID-keyed font specific */
+ /* functions. */
+ /* */
+ /*************************************************************************/
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_CID_Registry_Ordering_Supplement
+ *
+ * @description:
+ * Retrieve the Registry/Ordering/Supplement triple (also known as the
+ * "R/O/S") from a CID-keyed font.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * @output:
+ * registry ::
+ * The registry, as a C~string, owned by the face.
+ *
+ * ordering ::
+ * The ordering, as a C~string, owned by the face.
+ *
+ * supplement ::
+ * The supplement.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with CID faces, returning an error
+ * otherwise.
+ *
+ * @since:
+ * 2.3.6
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
+ const char* *registry,
+ const char* *ordering,
+ FT_Int *supplement);
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_CID_Is_Internally_CID_Keyed
+ *
+ * @description:
+ * Retrieve the type of the input face, CID keyed or not. In
+ * constrast to the @FT_IS_CID_KEYED macro this function returns
+ * successfully also for CID-keyed fonts in an SNFT wrapper.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * @output:
+ * is_cid ::
+ * The type of the face as an @FT_Bool.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with CID faces and OpenType fonts,
+ * returning an error otherwise.
+ *
+ * @since:
+ * 2.3.9
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
+ FT_Bool *is_cid );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_CID_From_Glyph_Index
+ *
+ * @description:
+ * Retrieve the CID of the input glyph index.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * glyph_index ::
+ * The input glyph index.
+ *
+ * @output:
+ * cid ::
+ * The CID as an @FT_UInt.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with CID faces and OpenType fonts,
+ * returning an error otherwise.
+ *
+ * @since:
+ * 2.3.9
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_CID_From_Glyph_Index( FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt *cid );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTCID_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/fterrdef.h b/src/3rdparty/freetype/include/freetype/fterrdef.h
new file mode 100644
index 0000000000..d865da7127
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/fterrdef.h
@@ -0,0 +1,276 @@
+/***************************************************************************/
+/* */
+/* fterrdef.h */
+/* */
+/* FreeType error codes (specification). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* error_code_values */
+ /* */
+ /* <Title> */
+ /* Error Code Values */
+ /* */
+ /* <Abstract> */
+ /* All possible error codes returned by FreeType functions. */
+ /* */
+ /* <Description> */
+ /* The list below is taken verbatim from the file `fterrdef.h' */
+ /* (loaded automatically by including `FT_FREETYPE_H'). The first */
+ /* argument of the `FT_ERROR_DEF_' macro is the error label; by */
+ /* default, the prefix `FT_Err_' gets added so that you get error */
+ /* names like `FT_Err_Cannot_Open_Resource'. The second argument is */
+ /* the error code, and the last argument an error string, which is not */
+ /* used by FreeType. */
+ /* */
+ /* Within your application you should *only* use error names and */
+ /* *never* its numeric values! The latter might (and actually do) */
+ /* change in forthcoming FreeType versions. */
+ /* */
+ /* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */
+ /* See the `Error Enumerations' subsection how to automatically */
+ /* generate a list of error strings. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Err_XXX */
+ /* */
+ /*************************************************************************/
+
+ /* generic errors */
+
+ FT_NOERRORDEF_( Ok, 0x00,
+ "no error" )
+
+ FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
+ "cannot open resource" )
+ FT_ERRORDEF_( Unknown_File_Format, 0x02,
+ "unknown file format" )
+ FT_ERRORDEF_( Invalid_File_Format, 0x03,
+ "broken file" )
+ FT_ERRORDEF_( Invalid_Version, 0x04,
+ "invalid FreeType version" )
+ FT_ERRORDEF_( Lower_Module_Version, 0x05,
+ "module version is too low" )
+ FT_ERRORDEF_( Invalid_Argument, 0x06,
+ "invalid argument" )
+ FT_ERRORDEF_( Unimplemented_Feature, 0x07,
+ "unimplemented feature" )
+ FT_ERRORDEF_( Invalid_Table, 0x08,
+ "broken table" )
+ FT_ERRORDEF_( Invalid_Offset, 0x09,
+ "broken offset within table" )
+ FT_ERRORDEF_( Array_Too_Large, 0x0A,
+ "array allocation size too large" )
+ FT_ERRORDEF_( Missing_Module, 0x0B,
+ "missing module" )
+ FT_ERRORDEF_( Missing_Property, 0x0C,
+ "missing property" )
+
+ /* glyph/character errors */
+
+ FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
+ "invalid glyph index" )
+ FT_ERRORDEF_( Invalid_Character_Code, 0x11,
+ "invalid character code" )
+ FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
+ "unsupported glyph image format" )
+ FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
+ "cannot render this glyph format" )
+ FT_ERRORDEF_( Invalid_Outline, 0x14,
+ "invalid outline" )
+ FT_ERRORDEF_( Invalid_Composite, 0x15,
+ "invalid composite glyph" )
+ FT_ERRORDEF_( Too_Many_Hints, 0x16,
+ "too many hints" )
+ FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
+ "invalid pixel size" )
+
+ /* handle errors */
+
+ FT_ERRORDEF_( Invalid_Handle, 0x20,
+ "invalid object handle" )
+ FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
+ "invalid library handle" )
+ FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
+ "invalid module handle" )
+ FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
+ "invalid face handle" )
+ FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
+ "invalid size handle" )
+ FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
+ "invalid glyph slot handle" )
+ FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
+ "invalid charmap handle" )
+ FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
+ "invalid cache manager handle" )
+ FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
+ "invalid stream handle" )
+
+ /* driver errors */
+
+ FT_ERRORDEF_( Too_Many_Drivers, 0x30,
+ "too many modules" )
+ FT_ERRORDEF_( Too_Many_Extensions, 0x31,
+ "too many extensions" )
+
+ /* memory errors */
+
+ FT_ERRORDEF_( Out_Of_Memory, 0x40,
+ "out of memory" )
+ FT_ERRORDEF_( Unlisted_Object, 0x41,
+ "unlisted object" )
+
+ /* stream errors */
+
+ FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
+ "cannot open stream" )
+ FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
+ "invalid stream seek" )
+ FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
+ "invalid stream skip" )
+ FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
+ "invalid stream read" )
+ FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
+ "invalid stream operation" )
+ FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
+ "invalid frame operation" )
+ FT_ERRORDEF_( Nested_Frame_Access, 0x57,
+ "nested frame access" )
+ FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
+ "invalid frame read" )
+
+ /* raster errors */
+
+ FT_ERRORDEF_( Raster_Uninitialized, 0x60,
+ "raster uninitialized" )
+ FT_ERRORDEF_( Raster_Corrupted, 0x61,
+ "raster corrupted" )
+ FT_ERRORDEF_( Raster_Overflow, 0x62,
+ "raster overflow" )
+ FT_ERRORDEF_( Raster_Negative_Height, 0x63,
+ "negative height while rastering" )
+
+ /* cache errors */
+
+ FT_ERRORDEF_( Too_Many_Caches, 0x70,
+ "too many registered caches" )
+
+ /* TrueType and SFNT errors */
+
+ FT_ERRORDEF_( Invalid_Opcode, 0x80,
+ "invalid opcode" )
+ FT_ERRORDEF_( Too_Few_Arguments, 0x81,
+ "too few arguments" )
+ FT_ERRORDEF_( Stack_Overflow, 0x82,
+ "stack overflow" )
+ FT_ERRORDEF_( Code_Overflow, 0x83,
+ "code overflow" )
+ FT_ERRORDEF_( Bad_Argument, 0x84,
+ "bad argument" )
+ FT_ERRORDEF_( Divide_By_Zero, 0x85,
+ "division by zero" )
+ FT_ERRORDEF_( Invalid_Reference, 0x86,
+ "invalid reference" )
+ FT_ERRORDEF_( Debug_OpCode, 0x87,
+ "found debug opcode" )
+ FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
+ "found ENDF opcode in execution stream" )
+ FT_ERRORDEF_( Nested_DEFS, 0x89,
+ "nested DEFS" )
+ FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
+ "invalid code range" )
+ FT_ERRORDEF_( Execution_Too_Long, 0x8B,
+ "execution context too long" )
+ FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
+ "too many function definitions" )
+ FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
+ "too many instruction definitions" )
+ FT_ERRORDEF_( Table_Missing, 0x8E,
+ "SFNT font table missing" )
+ FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
+ "horizontal header (hhea) table missing" )
+ FT_ERRORDEF_( Locations_Missing, 0x90,
+ "locations (loca) table missing" )
+ FT_ERRORDEF_( Name_Table_Missing, 0x91,
+ "name table missing" )
+ FT_ERRORDEF_( CMap_Table_Missing, 0x92,
+ "character map (cmap) table missing" )
+ FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
+ "horizontal metrics (hmtx) table missing" )
+ FT_ERRORDEF_( Post_Table_Missing, 0x94,
+ "PostScript (post) table missing" )
+ FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
+ "invalid horizontal metrics" )
+ FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
+ "invalid character map (cmap) format" )
+ FT_ERRORDEF_( Invalid_PPem, 0x97,
+ "invalid ppem value" )
+ FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
+ "invalid vertical metrics" )
+ FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
+ "could not find context" )
+ FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
+ "invalid PostScript (post) table format" )
+ FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
+ "invalid PostScript (post) table" )
+
+ /* CFF, CID, and Type 1 errors */
+
+ FT_ERRORDEF_( Syntax_Error, 0xA0,
+ "opcode syntax error" )
+ FT_ERRORDEF_( Stack_Underflow, 0xA1,
+ "argument stack underflow" )
+ FT_ERRORDEF_( Ignore, 0xA2,
+ "ignore" )
+ FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
+ "no Unicode glyph name found" )
+ FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
+ "glyph to big for hinting" )
+
+ /* BDF errors */
+
+ FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
+ "`STARTFONT' field missing" )
+ FT_ERRORDEF_( Missing_Font_Field, 0xB1,
+ "`FONT' field missing" )
+ FT_ERRORDEF_( Missing_Size_Field, 0xB2,
+ "`SIZE' field missing" )
+ FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
+ "`FONTBOUNDINGBOX' field missing" )
+ FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
+ "`CHARS' field missing" )
+ FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
+ "`STARTCHAR' field missing" )
+ FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
+ "`ENCODING' field missing" )
+ FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
+ "`BBX' field missing" )
+ FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
+ "`BBX' too big" )
+ FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
+ "Font header corrupted or missing fields" )
+ FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
+ "Font glyphs corrupted or missing fields" )
+
+ /* */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/fterrors.h b/src/3rdparty/freetype/include/freetype/fterrors.h
new file mode 100644
index 0000000000..0507b9ad7d
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/fterrors.h
@@ -0,0 +1,216 @@
+/***************************************************************************/
+/* */
+/* fterrors.h */
+/* */
+/* FreeType error code handling (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* error_enumerations */
+ /* */
+ /* <Title> */
+ /* Error Enumerations */
+ /* */
+ /* <Abstract> */
+ /* How to handle errors and error strings. */
+ /* */
+ /* <Description> */
+ /* The header file `fterrors.h' (which is automatically included by */
+ /* `freetype.h' defines the handling of FreeType's enumeration */
+ /* constants. It can also be used to generate error message strings */
+ /* with a small macro trick explained below. */
+ /* */
+ /* *Error* *Formats* */
+ /* */
+ /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
+ /* defined in `ftoption.h' in order to make the higher byte indicate */
+ /* the module where the error has happened (this is not compatible */
+ /* with standard builds of FreeType&nbsp;2, however). See the file */
+ /* `ftmoderr.h' for more details. */
+ /* */
+ /* *Error* *Message* *Strings* */
+ /* */
+ /* Error definitions are set up with special macros that allow client */
+ /* applications to build a table of error message strings. The */
+ /* strings are not included in a normal build of FreeType&nbsp;2 to */
+ /* save space (most client applications do not use them). */
+ /* */
+ /* To do so, you have to define the following macros before including */
+ /* this file. */
+ /* */
+ /* { */
+ /* FT_ERROR_START_LIST */
+ /* } */
+ /* */
+ /* This macro is called before anything else to define the start of */
+ /* the error list. It is followed by several FT_ERROR_DEF calls. */
+ /* */
+ /* { */
+ /* FT_ERROR_DEF( e, v, s ) */
+ /* } */
+ /* */
+ /* This macro is called to define one single error. `e' is the error */
+ /* code identifier (e.g., `Invalid_Argument'), `v' is the error's */
+ /* numerical value, and `s' is the corresponding error string. */
+ /* */
+ /* { */
+ /* FT_ERROR_END_LIST */
+ /* } */
+ /* */
+ /* This macro ends the list. */
+ /* */
+ /* Additionally, you have to undefine `__FTERRORS_H__' before */
+ /* #including this file. */
+ /* */
+ /* Here is a simple example. */
+ /* */
+ /* { */
+ /* #undef __FTERRORS_H__ */
+ /* #define FT_ERRORDEF( e, v, s ) { e, s }, */
+ /* #define FT_ERROR_START_LIST { */
+ /* #define FT_ERROR_END_LIST { 0, NULL } }; */
+ /* */
+ /* const struct */
+ /* { */
+ /* int err_code; */
+ /* const char* err_msg; */
+ /* } ft_errors[] = */
+ /* */
+ /* #include FT_ERRORS_H */
+ /* } */
+ /* */
+ /* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */
+ /* `FT_NOERRORDEF'; it is always zero. */
+ /* */
+ /*************************************************************************/
+
+ /* */
+
+#ifndef __FTERRORS_H__
+#define __FTERRORS_H__
+
+
+ /* include module base error codes */
+#include FT_MODULE_ERRORS_H
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** SETUP MACROS *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#undef FT_NEED_EXTERN_C
+
+
+ /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
+ /* By default, we use `FT_Err_'. */
+ /* */
+#ifndef FT_ERR_PREFIX
+#define FT_ERR_PREFIX FT_Err_
+#endif
+
+
+ /* FT_ERR_BASE is used as the base for module-specific errors. */
+ /* */
+#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+
+#ifndef FT_ERR_BASE
+#define FT_ERR_BASE FT_Mod_Err_Base
+#endif
+
+#else
+
+#undef FT_ERR_BASE
+#define FT_ERR_BASE 0
+
+#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
+
+
+ /* If FT_ERRORDEF is not defined, we need to define a simple */
+ /* enumeration type. */
+ /* */
+#ifndef FT_ERRORDEF
+
+#define FT_ERRORDEF( e, v, s ) e = v,
+#define FT_ERROR_START_LIST enum {
+#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
+
+#ifdef __cplusplus
+#define FT_NEED_EXTERN_C
+ extern "C" {
+#endif
+
+#endif /* !FT_ERRORDEF */
+
+
+ /* this macro is used to define an error */
+#define FT_ERRORDEF_( e, v, s ) \
+ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
+
+ /* this is only used for <module>_Err_Ok, which must be 0! */
+#define FT_NOERRORDEF_( e, v, s ) \
+ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
+
+
+#ifdef FT_ERROR_START_LIST
+ FT_ERROR_START_LIST
+#endif
+
+
+ /* now include the error codes */
+#include FT_ERROR_DEFINITIONS_H
+
+
+#ifdef FT_ERROR_END_LIST
+ FT_ERROR_END_LIST
+#endif
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** SIMPLE CLEANUP *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+#ifdef FT_NEED_EXTERN_C
+ }
+#endif
+
+#undef FT_ERROR_START_LIST
+#undef FT_ERROR_END_LIST
+
+#undef FT_ERRORDEF
+#undef FT_ERRORDEF_
+#undef FT_NOERRORDEF_
+
+#undef FT_NEED_EXTERN_C
+#undef FT_ERR_BASE
+
+ /* FT_ERR_PREFIX is needed internally */
+#ifndef FT2_BUILD_LIBRARY
+#undef FT_ERR_PREFIX
+#endif
+
+#endif /* __FTERRORS_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftfntfmt.h b/src/3rdparty/freetype/include/freetype/ftfntfmt.h
new file mode 100644
index 0000000000..1f8ff28f10
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftfntfmt.h
@@ -0,0 +1,92 @@
+/***************************************************************************/
+/* */
+/* ftfntfmt.h */
+/* */
+/* Support functions for font formats. */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTFNTFMT_H__
+#define __FTFNTFMT_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* font_formats */
+ /* */
+ /* <Title> */
+ /* Font Formats */
+ /* */
+ /* <Abstract> */
+ /* Getting the font format. */
+ /* */
+ /* <Description> */
+ /* The single function in this section can be used to get the font */
+ /* format. Note that this information is not needed normally; */
+ /* however, there are special cases (like in PDF devices) where it is */
+ /* important to differentiate, in spite of FreeType's uniform API. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Font_Format */
+ /* */
+ /* <Description> */
+ /* Return a string describing the format of a given face. Possible */
+ /* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */
+ /* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */
+ /* */
+ /* The return value is suitable to be used as an X11 FONT_PROPERTY. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* Input face handle. */
+ /* */
+ /* <Return> */
+ /* Font format string. NULL in case of error. */
+ /* */
+ /* <Note> */
+ /* A deprecated name for the same function is */
+ /* `FT_Get_X11_Font_Format'. */
+ /* */
+ FT_EXPORT( const char* )
+ FT_Get_Font_Format( FT_Face face );
+
+
+ /* deprecated */
+ FT_EXPORT( const char* )
+ FT_Get_X11_Font_Format( FT_Face face );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTFNTFMT_H__ */
diff --git a/src/3rdparty/freetype/include/freetype/ftgasp.h b/src/3rdparty/freetype/include/freetype/ftgasp.h
new file mode 100644
index 0000000000..9a9b6321b3
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftgasp.h
@@ -0,0 +1,129 @@
+/***************************************************************************/
+/* */
+/* ftgasp.h */
+/* */
+/* Access of TrueType's `gasp' table (specification). */
+/* */
+/* Copyright 2007-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef _FT_GASP_H_
+#define _FT_GASP_H_
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+ /***************************************************************************
+ *
+ * @section:
+ * gasp_table
+ *
+ * @title:
+ * Gasp Table
+ *
+ * @abstract:
+ * Retrieving TrueType `gasp' table entries.
+ *
+ * @description:
+ * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
+ * font for specific entries in its `gasp' table, if any. This is
+ * mainly useful when implementing native TrueType hinting with the
+ * bytecode interpreter to duplicate the Windows text rendering results.
+ */
+
+ /*************************************************************************
+ *
+ * @enum:
+ * FT_GASP_XXX
+ *
+ * @description:
+ * A list of values and/or bit-flags returned by the @FT_Get_Gasp
+ * function.
+ *
+ * @values:
+ * FT_GASP_NO_TABLE ::
+ * This special value means that there is no GASP table in this face.
+ * It is up to the client to decide what to do.
+ *
+ * FT_GASP_DO_GRIDFIT ::
+ * Grid-fitting and hinting should be performed at the specified ppem.
+ * This *really* means TrueType bytecode interpretation. If this bit
+ * is not set, no hinting gets applied.
+ *
+ * FT_GASP_DO_GRAY ::
+ * Anti-aliased rendering should be performed at the specified ppem.
+ * If not set, do monochrome rendering.
+ *
+ * FT_GASP_SYMMETRIC_SMOOTHING ::
+ * If set, smoothing along multiple axes must be used with ClearType.
+ *
+ * FT_GASP_SYMMETRIC_GRIDFIT ::
+ * Grid-fitting must be used with ClearType's symmetric smoothing.
+ *
+ * @note:
+ * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
+ * used for standard font rasterization only. Independently of that,
+ * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
+ * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
+ * `FT_GASP_DO_GRAY' are consequently ignored).
+ *
+ * `ClearType' is Microsoft's implementation of LCD rendering, partly
+ * protected by patents.
+ *
+ * @since:
+ * 2.3.0
+ */
+#define FT_GASP_NO_TABLE -1
+#define FT_GASP_DO_GRIDFIT 0x01
+#define FT_GASP_DO_GRAY 0x02
+#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
+#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
+
+
+ /*************************************************************************
+ *
+ * @func:
+ * FT_Get_Gasp
+ *
+ * @description:
+ * Read the `gasp' table from a TrueType or OpenType font file and
+ * return the entry corresponding to a given character pixel size.
+ *
+ * @input:
+ * face :: The source face handle.
+ * ppem :: The vertical character pixel size.
+ *
+ * @return:
+ * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
+ * `gasp' table in the face.
+ *
+ * @since:
+ * 2.3.0
+ */
+ FT_EXPORT( FT_Int )
+ FT_Get_Gasp( FT_Face face,
+ FT_UInt ppem );
+
+ /* */
+
+
+#endif /* _FT_GASP_H_ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftglyph.h b/src/3rdparty/freetype/include/freetype/ftglyph.h
new file mode 100644
index 0000000000..803ad39621
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftglyph.h
@@ -0,0 +1,605 @@
+/***************************************************************************/
+/* */
+/* ftglyph.h */
+/* */
+/* FreeType convenience functions to handle glyphs (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file contains the definition of several convenience functions */
+ /* that can be used by client applications to easily retrieve glyph */
+ /* bitmaps and outlines from a given face. */
+ /* */
+ /* These functions should be optional if you are writing a font server */
+ /* or text layout engine on top of FreeType. However, they are pretty */
+ /* handy for many other simple uses of the library. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTGLYPH_H__
+#define __FTGLYPH_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* glyph_management */
+ /* */
+ /* <Title> */
+ /* Glyph Management */
+ /* */
+ /* <Abstract> */
+ /* Generic interface to manage individual glyph data. */
+ /* */
+ /* <Description> */
+ /* This section contains definitions used to manage glyph data */
+ /* through generic FT_Glyph objects. Each of them can contain a */
+ /* bitmap, a vector outline, or even images in other formats. */
+ /* */
+ /*************************************************************************/
+
+
+ /* forward declaration to a private type */
+ typedef struct FT_Glyph_Class_ FT_Glyph_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Glyph */
+ /* */
+ /* <Description> */
+ /* Handle to an object used to model generic glyph images. It is a */
+ /* pointer to the @FT_GlyphRec structure and can contain a glyph */
+ /* bitmap or pointer. */
+ /* */
+ /* <Note> */
+ /* Glyph objects are not owned by the library. You must thus release */
+ /* them manually (through @FT_Done_Glyph) _before_ calling */
+ /* @FT_Done_FreeType. */
+ /* */
+ typedef struct FT_GlyphRec_* FT_Glyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_GlyphRec */
+ /* */
+ /* <Description> */
+ /* The root glyph structure contains a given glyph image plus its */
+ /* advance width in 16.16 fixed-point format. */
+ /* */
+ /* <Fields> */
+ /* library :: A handle to the FreeType library object. */
+ /* */
+ /* clazz :: A pointer to the glyph's class. Private. */
+ /* */
+ /* format :: The format of the glyph's image. */
+ /* */
+ /* advance :: A 16.16 vector that gives the glyph's advance width. */
+ /* */
+ typedef struct FT_GlyphRec_
+ {
+ FT_Library library;
+ const FT_Glyph_Class* clazz;
+ FT_Glyph_Format format;
+ FT_Vector advance;
+
+ } FT_GlyphRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_BitmapGlyph */
+ /* */
+ /* <Description> */
+ /* A handle to an object used to model a bitmap glyph image. This is */
+ /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
+ /* */
+ typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_BitmapGlyphRec */
+ /* */
+ /* <Description> */
+ /* A structure used for bitmap glyph images. This really is a */
+ /* `sub-class' of @FT_GlyphRec. */
+ /* */
+ /* <Fields> */
+ /* root :: The root @FT_Glyph fields. */
+ /* */
+ /* left :: The left-side bearing, i.e., the horizontal distance */
+ /* from the current pen position to the left border of the */
+ /* glyph bitmap. */
+ /* */
+ /* top :: The top-side bearing, i.e., the vertical distance from */
+ /* the current pen position to the top border of the glyph */
+ /* bitmap. This distance is positive for upwards~y! */
+ /* */
+ /* bitmap :: A descriptor for the bitmap. */
+ /* */
+ /* <Note> */
+ /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
+ /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
+ /* the bitmap's contents easily. */
+ /* */
+ /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
+ /* and is thus created and destroyed with it. */
+ /* */
+ typedef struct FT_BitmapGlyphRec_
+ {
+ FT_GlyphRec root;
+ FT_Int left;
+ FT_Int top;
+ FT_Bitmap bitmap;
+
+ } FT_BitmapGlyphRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_OutlineGlyph */
+ /* */
+ /* <Description> */
+ /* A handle to an object used to model an outline glyph image. This */
+ /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
+ /* */
+ typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_OutlineGlyphRec */
+ /* */
+ /* <Description> */
+ /* A structure used for outline (vectorial) glyph images. This */
+ /* really is a `sub-class' of @FT_GlyphRec. */
+ /* */
+ /* <Fields> */
+ /* root :: The root @FT_Glyph fields. */
+ /* */
+ /* outline :: A descriptor for the outline. */
+ /* */
+ /* <Note> */
+ /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
+ /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
+ /* the outline's content easily. */
+ /* */
+ /* As the outline is extracted from a glyph slot, its coordinates are */
+ /* expressed normally in 26.6 pixels, unless the flag */
+ /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
+ /* */
+ /* The outline's tables are always owned by the object and are */
+ /* destroyed with it. */
+ /* */
+ typedef struct FT_OutlineGlyphRec_
+ {
+ FT_GlyphRec root;
+ FT_Outline outline;
+
+ } FT_OutlineGlyphRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph */
+ /* */
+ /* <Description> */
+ /* A function used to extract a glyph image from a slot. Note that */
+ /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */
+ /* */
+ /* <Input> */
+ /* slot :: A handle to the source glyph slot. */
+ /* */
+ /* <Output> */
+ /* aglyph :: A handle to the glyph object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Glyph( FT_GlyphSlot slot,
+ FT_Glyph *aglyph );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Copy */
+ /* */
+ /* <Description> */
+ /* A function used to copy a glyph image. Note that the created */
+ /* @FT_Glyph object must be released with @FT_Done_Glyph. */
+ /* */
+ /* <Input> */
+ /* source :: A handle to the source glyph object. */
+ /* */
+ /* <Output> */
+ /* target :: A handle to the target glyph object. 0~in case of */
+ /* error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_Copy( FT_Glyph source,
+ FT_Glyph *target );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Transform */
+ /* */
+ /* <Description> */
+ /* Transform a glyph image if its format is scalable. */
+ /* */
+ /* <InOut> */
+ /* glyph :: A handle to the target glyph object. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to a 2x2 matrix to apply. */
+ /* */
+ /* delta :: A pointer to a 2d vector to apply. Coordinates are */
+ /* expressed in 1/64th of a pixel. */
+ /* */
+ /* <Return> */
+ /* FreeType error code (if not 0, the glyph format is not scalable). */
+ /* */
+ /* <Note> */
+ /* The 2x2 transformation matrix is also applied to the glyph's */
+ /* advance vector. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_Transform( FT_Glyph glyph,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Glyph_BBox_Mode */
+ /* */
+ /* <Description> */
+ /* The mode how the values of @FT_Glyph_Get_CBox are returned. */
+ /* */
+ /* <Values> */
+ /* FT_GLYPH_BBOX_UNSCALED :: */
+ /* Return unscaled font units. */
+ /* */
+ /* FT_GLYPH_BBOX_SUBPIXELS :: */
+ /* Return unfitted 26.6 coordinates. */
+ /* */
+ /* FT_GLYPH_BBOX_GRIDFIT :: */
+ /* Return grid-fitted 26.6 coordinates. */
+ /* */
+ /* FT_GLYPH_BBOX_TRUNCATE :: */
+ /* Return coordinates in integer pixels. */
+ /* */
+ /* FT_GLYPH_BBOX_PIXELS :: */
+ /* Return grid-fitted pixel coordinates. */
+ /* */
+ typedef enum FT_Glyph_BBox_Mode_
+ {
+ FT_GLYPH_BBOX_UNSCALED = 0,
+ FT_GLYPH_BBOX_SUBPIXELS = 0,
+ FT_GLYPH_BBOX_GRIDFIT = 1,
+ FT_GLYPH_BBOX_TRUNCATE = 2,
+ FT_GLYPH_BBOX_PIXELS = 3
+
+ } FT_Glyph_BBox_Mode;
+
+
+ /* these constants are deprecated; use the corresponding */
+ /* `FT_Glyph_BBox_Mode' values instead */
+#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
+#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
+#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
+#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
+#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Get_CBox */
+ /* */
+ /* <Description> */
+ /* Return a glyph's `control box'. The control box encloses all the */
+ /* outline's points, including Bézier control points. Though it */
+ /* coincides with the exact bounding box for most glyphs, it can be */
+ /* slightly larger in some situations (like when rotating an outline */
+ /* that contains Bézier outside arcs). */
+ /* */
+ /* Computing the control box is very fast, while getting the bounding */
+ /* box can take much more time as it needs to walk over all segments */
+ /* and arcs in the outline. To get the latter, you can use the */
+ /* `ftbbox' component, which is dedicated to this single task. */
+ /* */
+ /* <Input> */
+ /* glyph :: A handle to the source glyph object. */
+ /* */
+ /* mode :: The mode that indicates how to interpret the returned */
+ /* bounding box values. */
+ /* */
+ /* <Output> */
+ /* acbox :: The glyph coordinate bounding box. Coordinates are */
+ /* expressed in 1/64th of pixels if it is grid-fitted. */
+ /* */
+ /* <Note> */
+ /* Coordinates are relative to the glyph origin, using the y~upwards */
+ /* convention. */
+ /* */
+ /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
+ /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
+ /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
+ /* is another name for this constant. */
+ /* */
+ /* If the font is tricky and the glyph has been loaded with */
+ /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */
+ /* reasonable values for the CBox it is necessary to load the glyph */
+ /* at a large ppem value (so that the hinting instructions can */
+ /* properly shift and scale the subglyphs), then extracting the CBox, */
+ /* which can be eventually converted back to font units. */
+ /* */
+ /* Note that the maximum coordinates are exclusive, which means that */
+ /* one can compute the width and height of the glyph image (be it in */
+ /* integer or 26.6 pixels) as: */
+ /* */
+ /* { */
+ /* width = bbox.xMax - bbox.xMin; */
+ /* height = bbox.yMax - bbox.yMin; */
+ /* } */
+ /* */
+ /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
+ /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
+ /* which corresponds to: */
+ /* */
+ /* { */
+ /* bbox.xMin = FLOOR(bbox.xMin); */
+ /* bbox.yMin = FLOOR(bbox.yMin); */
+ /* bbox.xMax = CEILING(bbox.xMax); */
+ /* bbox.yMax = CEILING(bbox.yMax); */
+ /* } */
+ /* */
+ /* To get the bbox in pixel coordinates, set `bbox_mode' to */
+ /* @FT_GLYPH_BBOX_TRUNCATE. */
+ /* */
+ /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
+ /* to @FT_GLYPH_BBOX_PIXELS. */
+ /* */
+ FT_EXPORT( void )
+ FT_Glyph_Get_CBox( FT_Glyph glyph,
+ FT_UInt bbox_mode,
+ FT_BBox *acbox );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_To_Bitmap */
+ /* */
+ /* <Description> */
+ /* Convert a given glyph object to a bitmap glyph object. */
+ /* */
+ /* <InOut> */
+ /* the_glyph :: A pointer to a handle to the target glyph. */
+ /* */
+ /* <Input> */
+ /* render_mode :: An enumeration that describes how the data is */
+ /* rendered. */
+ /* */
+ /* origin :: A pointer to a vector used to translate the glyph */
+ /* image before rendering. Can be~0 (if no */
+ /* translation). The origin is expressed in */
+ /* 26.6 pixels. */
+ /* */
+ /* destroy :: A boolean that indicates that the original glyph */
+ /* image should be destroyed by this function. It is */
+ /* never destroyed in case of error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function does nothing if the glyph format isn't scalable. */
+ /* */
+ /* The glyph image is translated with the `origin' vector before */
+ /* rendering. */
+ /* */
+ /* The first parameter is a pointer to an @FT_Glyph handle, that will */
+ /* be _replaced_ by this function (with newly allocated data). */
+ /* Typically, you would use (omitting error handling): */
+ /* */
+ /* */
+ /* { */
+ /* FT_Glyph glyph; */
+ /* FT_BitmapGlyph glyph_bitmap; */
+ /* */
+ /* */
+ /* // load glyph */
+ /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
+ /* */
+ /* // extract glyph image */
+ /* error = FT_Get_Glyph( face->glyph, &glyph ); */
+ /* */
+ /* // convert to a bitmap (default render mode + destroying old) */
+ /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
+ /* { */
+ /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
+ /* 0, 1 ); */
+ /* if ( error ) // `glyph' unchanged */
+ /* ... */
+ /* } */
+ /* */
+ /* // access bitmap content by typecasting */
+ /* glyph_bitmap = (FT_BitmapGlyph)glyph; */
+ /* */
+ /* // do funny stuff with it, like blitting/drawing */
+ /* ... */
+ /* */
+ /* // discard glyph image (bitmap or not) */
+ /* FT_Done_Glyph( glyph ); */
+ /* } */
+ /* */
+ /* */
+ /* Here another example, again without error handling: */
+ /* */
+ /* */
+ /* { */
+ /* FT_Glyph glyphs[MAX_GLYPHS] */
+ /* */
+ /* */
+ /* ... */
+ /* */
+ /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
+ /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */
+ /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */
+ /* */
+ /* ... */
+ /* */
+ /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
+ /* { */
+ /* FT_Glyph bitmap = glyphs[idx]; */
+ /* */
+ /* */
+ /* ... */
+ /* */
+ /* // after this call, `bitmap' no longer points into */
+ /* // the `glyphs' array (and the old value isn't destroyed) */
+ /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */
+ /* */
+ /* ... */
+ /* */
+ /* FT_Done_Glyph( bitmap ); */
+ /* } */
+ /* */
+ /* ... */
+ /* */
+ /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
+ /* FT_Done_Glyph( glyphs[idx] ); */
+ /* } */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
+ FT_Render_Mode render_mode,
+ FT_Vector* origin,
+ FT_Bool destroy );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Glyph */
+ /* */
+ /* <Description> */
+ /* Destroy a given glyph. */
+ /* */
+ /* <Input> */
+ /* glyph :: A handle to the target glyph object. */
+ /* */
+ FT_EXPORT( void )
+ FT_Done_Glyph( FT_Glyph glyph );
+
+ /* */
+
+
+ /* other helpful functions */
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* computations */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Matrix_Multiply */
+ /* */
+ /* <Description> */
+ /* Perform the matrix operation `b = a*b'. */
+ /* */
+ /* <Input> */
+ /* a :: A pointer to matrix `a'. */
+ /* */
+ /* <InOut> */
+ /* b :: A pointer to matrix `b'. */
+ /* */
+ /* <Note> */
+ /* The result is undefined if either `a' or `b' is zero. */
+ /* */
+ FT_EXPORT( void )
+ FT_Matrix_Multiply( const FT_Matrix* a,
+ FT_Matrix* b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Matrix_Invert */
+ /* */
+ /* <Description> */
+ /* Invert a 2x2 matrix. Return an error if it can't be inverted. */
+ /* */
+ /* <InOut> */
+ /* matrix :: A pointer to the target matrix. Remains untouched in */
+ /* case of error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Matrix_Invert( FT_Matrix* matrix );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTGLYPH_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
diff --git a/src/3rdparty/freetype/include/freetype/ftgxval.h b/src/3rdparty/freetype/include/freetype/ftgxval.h
new file mode 100644
index 0000000000..0e9ac1dad3
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftgxval.h
@@ -0,0 +1,357 @@
+/***************************************************************************/
+/* */
+/* ftgxval.h */
+/* */
+/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* Masatake YAMATO, Redhat K.K, */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+/***************************************************************************/
+/* */
+/* gxvalid is derived from both gxlayout module and otvalid module. */
+/* Development of gxlayout is supported by the Information-technology */
+/* Promotion Agency(IPA), Japan. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTGXVAL_H__
+#define __FTGXVAL_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* gx_validation */
+ /* */
+ /* <Title> */
+ /* TrueTypeGX/AAT Validation */
+ /* */
+ /* <Abstract> */
+ /* An API to validate TrueTypeGX/AAT tables. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of functions to validate */
+ /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
+ /* trak, prop, lcar). */
+ /* */
+ /* <Order> */
+ /* FT_TrueTypeGX_Validate */
+ /* FT_TrueTypeGX_Free */
+ /* */
+ /* FT_ClassicKern_Validate */
+ /* FT_ClassicKern_Free */
+ /* */
+ /* FT_VALIDATE_GX_LENGTH */
+ /* FT_VALIDATE_GXXXX */
+ /* FT_VALIDATE_CKERNXXX */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* */
+ /* Warning: Use FT_VALIDATE_XXX to validate a table. */
+ /* Following definitions are for gxvalid developers. */
+ /* */
+ /* */
+ /*************************************************************************/
+
+#define FT_VALIDATE_feat_INDEX 0
+#define FT_VALIDATE_mort_INDEX 1
+#define FT_VALIDATE_morx_INDEX 2
+#define FT_VALIDATE_bsln_INDEX 3
+#define FT_VALIDATE_just_INDEX 4
+#define FT_VALIDATE_kern_INDEX 5
+#define FT_VALIDATE_opbd_INDEX 6
+#define FT_VALIDATE_trak_INDEX 7
+#define FT_VALIDATE_prop_INDEX 8
+#define FT_VALIDATE_lcar_INDEX 9
+#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_VALIDATE_GX_LENGTH
+ *
+ * @description:
+ * The number of tables checked in this module. Use it as a parameter
+ * for the `table-length' argument of function @FT_TrueTypeGX_Validate.
+ */
+#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
+
+ /* */
+
+ /* Up to 0x1000 is used by otvalid.
+ Ox2xxx is reserved for feature OT extension. */
+#define FT_VALIDATE_GX_START 0x4000
+#define FT_VALIDATE_GX_BITFIELD( tag ) \
+ ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
+
+
+ /**********************************************************************
+ *
+ * @enum:
+ * FT_VALIDATE_GXXXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
+ * indicate which TrueTypeGX/AAT Type tables should be validated.
+ *
+ * @values:
+ * FT_VALIDATE_feat ::
+ * Validate `feat' table.
+ *
+ * FT_VALIDATE_mort ::
+ * Validate `mort' table.
+ *
+ * FT_VALIDATE_morx ::
+ * Validate `morx' table.
+ *
+ * FT_VALIDATE_bsln ::
+ * Validate `bsln' table.
+ *
+ * FT_VALIDATE_just ::
+ * Validate `just' table.
+ *
+ * FT_VALIDATE_kern ::
+ * Validate `kern' table.
+ *
+ * FT_VALIDATE_opbd ::
+ * Validate `opbd' table.
+ *
+ * FT_VALIDATE_trak ::
+ * Validate `trak' table.
+ *
+ * FT_VALIDATE_prop ::
+ * Validate `prop' table.
+ *
+ * FT_VALIDATE_lcar ::
+ * Validate `lcar' table.
+ *
+ * FT_VALIDATE_GX ::
+ * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
+ * opbd, trak, prop and lcar).
+ *
+ */
+
+#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
+#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
+#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
+#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
+#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
+#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
+#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
+#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
+#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
+#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
+
+#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
+ FT_VALIDATE_mort | \
+ FT_VALIDATE_morx | \
+ FT_VALIDATE_bsln | \
+ FT_VALIDATE_just | \
+ FT_VALIDATE_kern | \
+ FT_VALIDATE_opbd | \
+ FT_VALIDATE_trak | \
+ FT_VALIDATE_prop | \
+ FT_VALIDATE_lcar )
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_TrueTypeGX_Validate
+ *
+ * @description:
+ * Validate various TrueTypeGX tables to assure that all offsets and
+ * indices are valid. The idea is that a higher-level library that
+ * actually does the text layout can access those tables without
+ * error checking (which can be quite time consuming).
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * validation_flags ::
+ * A bit field that specifies the tables to be validated. See
+ * @FT_VALIDATE_GXXXX for possible values.
+ *
+ * table_length ::
+ * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
+ * should be passed.
+ *
+ * @output:
+ * tables ::
+ * The array where all validated sfnt tables are stored.
+ * The array itself must be allocated by a client.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with TrueTypeGX fonts, returning an error
+ * otherwise.
+ *
+ * After use, the application should deallocate the buffers pointed to by
+ * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
+ * indicates that the table either doesn't exist in the font, the
+ * application hasn't asked for validation, or the validator doesn't have
+ * the ability to validate the sfnt table.
+ */
+ FT_EXPORT( FT_Error )
+ FT_TrueTypeGX_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
+ FT_UInt table_length );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_TrueTypeGX_Free
+ *
+ * @description:
+ * Free the buffer allocated by TrueTypeGX validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer allocated by
+ * @FT_TrueTypeGX_Validate.
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * @FT_TrueTypeGX_Validate only.
+ */
+ FT_EXPORT( void )
+ FT_TrueTypeGX_Free( FT_Face face,
+ FT_Bytes table );
+
+
+ /**********************************************************************
+ *
+ * @enum:
+ * FT_VALIDATE_CKERNXXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_ClassicKern_Validate
+ * to indicate the classic kern dialect or dialects. If the selected
+ * type doesn't fit, @FT_ClassicKern_Validate regards the table as
+ * invalid.
+ *
+ * @values:
+ * FT_VALIDATE_MS ::
+ * Handle the `kern' table as a classic Microsoft kern table.
+ *
+ * FT_VALIDATE_APPLE ::
+ * Handle the `kern' table as a classic Apple kern table.
+ *
+ * FT_VALIDATE_CKERN ::
+ * Handle the `kern' as either classic Apple or Microsoft kern table.
+ */
+#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
+#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
+
+#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_ClassicKern_Validate
+ *
+ * @description:
+ * Validate classic (16-bit format) kern table to assure that the offsets
+ * and indices are valid. The idea is that a higher-level library that
+ * actually does the text layout can access those tables without error
+ * checking (which can be quite time consuming).
+ *
+ * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
+ * the new 32-bit format and the classic 16-bit format, while
+ * FT_ClassicKern_Validate only supports the classic 16-bit format.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * validation_flags ::
+ * A bit field that specifies the dialect to be validated. See
+ * @FT_VALIDATE_CKERNXXX for possible values.
+ *
+ * @output:
+ * ckern_table ::
+ * A pointer to the kern table.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * After use, the application should deallocate the buffers pointed to by
+ * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
+ * indicates that the table doesn't exist in the font.
+ */
+ FT_EXPORT( FT_Error )
+ FT_ClassicKern_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes *ckern_table );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_ClassicKern_Free
+ *
+ * @description:
+ * Free the buffer allocated by classic Kern validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer that is allocated by
+ * @FT_ClassicKern_Validate.
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * @FT_ClassicKern_Validate only.
+ */
+ FT_EXPORT( void )
+ FT_ClassicKern_Free( FT_Face face,
+ FT_Bytes table );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTGXVAL_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftgzip.h b/src/3rdparty/freetype/include/freetype/ftgzip.h
new file mode 100644
index 0000000000..b3a532d5e1
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftgzip.h
@@ -0,0 +1,148 @@
+/***************************************************************************/
+/* */
+/* ftgzip.h */
+/* */
+/* Gzip-compressed stream support. */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTGZIP_H__
+#define __FTGZIP_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* gzip */
+ /* */
+ /* <Title> */
+ /* GZIP Streams */
+ /* */
+ /* <Abstract> */
+ /* Using gzip-compressed font files. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of Gzip-specific functions. */
+ /* */
+ /*************************************************************************/
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Stream_OpenGzip
+ *
+ * @description:
+ * Open a new stream to parse gzip-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.gz' fonts that come
+ * with XFree86.
+ *
+ * @input:
+ * stream ::
+ * The target embedding stream.
+ *
+ * source ::
+ * The source stream.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source stream must be opened _before_ calling this function.
+ *
+ * Calling the internal function `FT_Stream_Close' on the new stream will
+ * *not* call `FT_Stream_Close' on the source stream. None of the stream
+ * objects will be released to the heap.
+ *
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream.
+ *
+ * In certain builds of the library, gzip compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a gzipped stream from
+ * it and re-open the face with it.
+ *
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with zlib support.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stream_OpenGzip( FT_Stream stream,
+ FT_Stream source );
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Gzip_Uncompress
+ *
+ * @description:
+ * Decompress a zipped input buffer into an output buffer. This function
+ * is modeled after zlib's `uncompress' function.
+ *
+ * @input:
+ * memory ::
+ * A FreeType memory handle.
+ *
+ * input ::
+ * The input buffer.
+ *
+ * input_len ::
+ * The length of the input buffer.
+ *
+ * @output:
+ * output::
+ * The output buffer.
+ *
+ * @inout:
+ * output_len ::
+ * Before calling the function, this is the the total size of the
+ * output buffer, which must be large enough to hold the entire
+ * uncompressed data (so the size of the uncompressed data must be
+ * known in advance). After calling the function, `output_len' is the
+ * size of the used data in `output'.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with zlib support.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Gzip_Uncompress( FT_Memory memory,
+ FT_Byte* output,
+ FT_ULong* output_len,
+ const FT_Byte* input,
+ FT_ULong input_len );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTGZIP_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftimage.h b/src/3rdparty/freetype/include/freetype/ftimage.h
new file mode 100644
index 0000000000..82f284c4f9
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftimage.h
@@ -0,0 +1,1214 @@
+/***************************************************************************/
+/* */
+/* ftimage.h */
+/* */
+/* FreeType glyph image formats and default raster interface */
+/* (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Note: A `raster' is simply a scan-line converter, used to render */
+ /* FT_Outlines into FT_Bitmaps. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTIMAGE_H__
+#define __FTIMAGE_H__
+
+
+ /* _STANDALONE_ is from ftgrays.c */
+#ifndef _STANDALONE_
+#include <ft2build.h>
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Pos */
+ /* */
+ /* <Description> */
+ /* The type FT_Pos is used to store vectorial coordinates. Depending */
+ /* on the context, these can represent distances in integer font */
+ /* units, or 16.16, or 26.6 fixed-point pixel coordinates. */
+ /* */
+ typedef signed long FT_Pos;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Vector */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2D vector; coordinates are of */
+ /* the FT_Pos type. */
+ /* */
+ /* <Fields> */
+ /* x :: The horizontal coordinate. */
+ /* y :: The vertical coordinate. */
+ /* */
+ typedef struct FT_Vector_
+ {
+ FT_Pos x;
+ FT_Pos y;
+
+ } FT_Vector;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_BBox */
+ /* */
+ /* <Description> */
+ /* A structure used to hold an outline's bounding box, i.e., the */
+ /* coordinates of its extrema in the horizontal and vertical */
+ /* directions. */
+ /* */
+ /* <Fields> */
+ /* xMin :: The horizontal minimum (left-most). */
+ /* */
+ /* yMin :: The vertical minimum (bottom-most). */
+ /* */
+ /* xMax :: The horizontal maximum (right-most). */
+ /* */
+ /* yMax :: The vertical maximum (top-most). */
+ /* */
+ /* <Note> */
+ /* The bounding box is specified with the coordinates of the lower */
+ /* left and the upper right corner. In PostScript, those values are */
+ /* often called (llx,lly) and (urx,ury), respectively. */
+ /* */
+ /* If `yMin' is negative, this value gives the glyph's descender. */
+ /* Otherwise, the glyph doesn't descend below the baseline. */
+ /* Similarly, if `ymax' is positive, this value gives the glyph's */
+ /* ascender. */
+ /* */
+ /* `xMin' gives the horizontal distance from the glyph's origin to */
+ /* the left edge of the glyph's bounding box. If `xMin' is negative, */
+ /* the glyph extends to the left of the origin. */
+ /* */
+ typedef struct FT_BBox_
+ {
+ FT_Pos xMin, yMin;
+ FT_Pos xMax, yMax;
+
+ } FT_BBox;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Pixel_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration type used to describe the format of pixels in a */
+ /* given bitmap. Note that additional formats may be added in the */
+ /* future. */
+ /* */
+ /* <Values> */
+ /* FT_PIXEL_MODE_NONE :: */
+ /* Value~0 is reserved. */
+ /* */
+ /* FT_PIXEL_MODE_MONO :: */
+ /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */
+ /* are stored in most-significant order (MSB), which means that */
+ /* the left-most pixel in a byte has value 128. */
+ /* */
+ /* FT_PIXEL_MODE_GRAY :: */
+ /* An 8-bit bitmap, generally used to represent anti-aliased glyph */
+ /* images. Each pixel is stored in one byte. Note that the number */
+ /* of `gray' levels is stored in the `num_grays' field of the */
+ /* @FT_Bitmap structure (it generally is 256). */
+ /* */
+ /* FT_PIXEL_MODE_GRAY2 :: */
+ /* A 2-bit per pixel bitmap, used to represent embedded */
+ /* anti-aliased bitmaps in font files according to the OpenType */
+ /* specification. We haven't found a single font using this */
+ /* format, however. */
+ /* */
+ /* FT_PIXEL_MODE_GRAY4 :: */
+ /* A 4-bit per pixel bitmap, representing embedded anti-aliased */
+ /* bitmaps in font files according to the OpenType specification. */
+ /* We haven't found a single font using this format, however. */
+ /* */
+ /* FT_PIXEL_MODE_LCD :: */
+ /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
+ /* used for display on LCD displays; the bitmap is three times */
+ /* wider than the original glyph image. See also */
+ /* @FT_RENDER_MODE_LCD. */
+ /* */
+ /* FT_PIXEL_MODE_LCD_V :: */
+ /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
+ /* used for display on rotated LCD displays; the bitmap is three */
+ /* times taller than the original glyph image. See also */
+ /* @FT_RENDER_MODE_LCD_V. */
+ /* */
+ /* FT_PIXEL_MODE_BGRA :: */
+ /* An image with four 8-bit channels per pixel, representing a */
+ /* color image (such as emoticons) with alpha channel. For each */
+ /* pixel, the format is BGRA, which means, the blue channel comes */
+ /* first in memory. The color channels are pre-multiplied and in */
+ /* the sRGB colorspace. For example, full red at half-translucent */
+ /* opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */
+ /* See also @FT_LOAD_COLOR. */
+ /* */
+ typedef enum FT_Pixel_Mode_
+ {
+ FT_PIXEL_MODE_NONE = 0,
+ FT_PIXEL_MODE_MONO,
+ FT_PIXEL_MODE_GRAY,
+ FT_PIXEL_MODE_GRAY2,
+ FT_PIXEL_MODE_GRAY4,
+ FT_PIXEL_MODE_LCD,
+ FT_PIXEL_MODE_LCD_V,
+ FT_PIXEL_MODE_BGRA,
+
+ FT_PIXEL_MODE_MAX /* do not remove */
+
+ } FT_Pixel_Mode;
+
+
+ /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */
+ /* values instead. */
+#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
+#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
+#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
+#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
+#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Bitmap */
+ /* */
+ /* <Description> */
+ /* A structure used to describe a bitmap or pixmap to the raster. */
+ /* Note that we now manage pixmaps of various depths through the */
+ /* `pixel_mode' field. */
+ /* */
+ /* <Fields> */
+ /* rows :: The number of bitmap rows. */
+ /* */
+ /* width :: The number of pixels in bitmap row. */
+ /* */
+ /* pitch :: The pitch's absolute value is the number of bytes */
+ /* taken by one bitmap row, including padding. */
+ /* However, the pitch is positive when the bitmap has */
+ /* a `down' flow, and negative when it has an `up' */
+ /* flow. In all cases, the pitch is an offset to add */
+ /* to a bitmap pointer in order to go down one row. */
+ /* */
+ /* Note that `padding' means the alignment of a */
+ /* bitmap to a byte border, and FreeType functions */
+ /* normally align to the smallest possible integer */
+ /* value. */
+ /* */
+ /* For the B/W rasterizer, `pitch' is always an even */
+ /* number. */
+ /* */
+ /* To change the pitch of a bitmap (say, to make it a */
+ /* multiple of 4), use @FT_Bitmap_Convert. */
+ /* Alternatively, you might use callback functions to */
+ /* directly render to the application's surface; see */
+ /* the file `example2.cpp' in the tutorial for a */
+ /* demonstration. */
+ /* */
+ /* buffer :: A typeless pointer to the bitmap buffer. This */
+ /* value should be aligned on 32-bit boundaries in */
+ /* most cases. */
+ /* */
+ /* num_grays :: This field is only used with */
+ /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
+ /* levels used in the bitmap. */
+ /* */
+ /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
+ /* See @FT_Pixel_Mode for possible values. */
+ /* */
+ /* palette_mode :: This field is intended for paletted pixel modes; */
+ /* it indicates how the palette is stored. Not */
+ /* used currently. */
+ /* */
+ /* palette :: A typeless pointer to the bitmap palette; this */
+ /* field is intended for paletted pixel modes. Not */
+ /* used currently. */
+ /* */
+ typedef struct FT_Bitmap_
+ {
+ unsigned int rows;
+ unsigned int width;
+ int pitch;
+ unsigned char* buffer;
+ unsigned short num_grays;
+ unsigned char pixel_mode;
+ unsigned char palette_mode;
+ void* palette;
+
+ } FT_Bitmap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Outline */
+ /* */
+ /* <Description> */
+ /* This structure is used to describe an outline to the scan-line */
+ /* converter. */
+ /* */
+ /* <Fields> */
+ /* n_contours :: The number of contours in the outline. */
+ /* */
+ /* n_points :: The number of points in the outline. */
+ /* */
+ /* points :: A pointer to an array of `n_points' @FT_Vector */
+ /* elements, giving the outline's point coordinates. */
+ /* */
+ /* tags :: A pointer to an array of `n_points' chars, giving */
+ /* each outline point's type. */
+ /* */
+ /* If bit~0 is unset, the point is `off' the curve, */
+ /* i.e., a Bézier control point, while it is `on' if */
+ /* set. */
+ /* */
+ /* Bit~1 is meaningful for `off' points only. If set, */
+ /* it indicates a third-order Bézier arc control point; */
+ /* and a second-order control point if unset. */
+ /* */
+ /* If bit~2 is set, bits 5-7 contain the drop-out mode */
+ /* (as defined in the OpenType specification; the value */
+ /* is the same as the argument to the SCANMODE */
+ /* instruction). */
+ /* */
+ /* Bits 3 and~4 are reserved for internal purposes. */
+ /* */
+ /* contours :: An array of `n_contours' shorts, giving the end */
+ /* point of each contour within the outline. For */
+ /* example, the first contour is defined by the points */
+ /* `0' to `contours[0]', the second one is defined by */
+ /* the points `contours[0]+1' to `contours[1]', etc. */
+ /* */
+ /* flags :: A set of bit flags used to characterize the outline */
+ /* and give hints to the scan-converter and hinter on */
+ /* how to convert/grid-fit it. See @FT_OUTLINE_XXX. */
+ /* */
+ /* <Note> */
+ /* The B/W rasterizer only checks bit~2 in the `tags' array for the */
+ /* first point of each contour. The drop-out mode as given with */
+ /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */
+ /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */
+ /* */
+ typedef struct FT_Outline_
+ {
+ short n_contours; /* number of contours in glyph */
+ short n_points; /* number of points in the glyph */
+
+ FT_Vector* points; /* the outline's points */
+ char* tags; /* the points flags */
+ short* contours; /* the contour end points */
+
+ int flags; /* outline masks */
+
+ } FT_Outline;
+
+ /* */
+
+ /* Following limits must be consistent with */
+ /* FT_Outline.{n_contours,n_points} */
+#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
+#define FT_OUTLINE_POINTS_MAX SHRT_MAX
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_OUTLINE_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit-field constants use for the flags in an outline's */
+ /* `flags' field. */
+ /* */
+ /* <Values> */
+ /* FT_OUTLINE_NONE :: */
+ /* Value~0 is reserved. */
+ /* */
+ /* FT_OUTLINE_OWNER :: */
+ /* If set, this flag indicates that the outline's field arrays */
+ /* (i.e., `points', `flags', and `contours') are `owned' by the */
+ /* outline object, and should thus be freed when it is destroyed. */
+ /* */
+ /* FT_OUTLINE_EVEN_ODD_FILL :: */
+ /* By default, outlines are filled using the non-zero winding rule. */
+ /* If set to 1, the outline will be filled using the even-odd fill */
+ /* rule (only works with the smooth rasterizer). */
+ /* */
+ /* FT_OUTLINE_REVERSE_FILL :: */
+ /* By default, outside contours of an outline are oriented in */
+ /* clock-wise direction, as defined in the TrueType specification. */
+ /* This flag is set if the outline uses the opposite direction */
+ /* (typically for Type~1 fonts). This flag is ignored by the scan */
+ /* converter. */
+ /* */
+ /* FT_OUTLINE_IGNORE_DROPOUTS :: */
+ /* By default, the scan converter will try to detect drop-outs in */
+ /* an outline and correct the glyph bitmap to ensure consistent */
+ /* shape continuity. If set, this flag hints the scan-line */
+ /* converter to ignore such cases. See below for more information. */
+ /* */
+ /* FT_OUTLINE_SMART_DROPOUTS :: */
+ /* Select smart dropout control. If unset, use simple dropout */
+ /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */
+ /* below for more information. */
+ /* */
+ /* FT_OUTLINE_INCLUDE_STUBS :: */
+ /* If set, turn pixels on for `stubs', otherwise exclude them. */
+ /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */
+ /* more information. */
+ /* */
+ /* FT_OUTLINE_HIGH_PRECISION :: */
+ /* This flag indicates that the scan-line converter should try to */
+ /* convert this outline to bitmaps with the highest possible */
+ /* quality. It is typically set for small character sizes. Note */
+ /* that this is only a hint that might be completely ignored by a */
+ /* given scan-converter. */
+ /* */
+ /* FT_OUTLINE_SINGLE_PASS :: */
+ /* This flag is set to force a given scan-converter to only use a */
+ /* single pass over the outline to render a bitmap glyph image. */
+ /* Normally, it is set for very large character sizes. It is only */
+ /* a hint that might be completely ignored by a given */
+ /* scan-converter. */
+ /* */
+ /* <Note> */
+ /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */
+ /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */
+ /* rasterizer. */
+ /* */
+ /* There exists a second mechanism to pass the drop-out mode to the */
+ /* B/W rasterizer; see the `tags' field in @FT_Outline. */
+ /* */
+ /* Please refer to the description of the `SCANTYPE' instruction in */
+ /* the OpenType specification (in file `ttinst1.doc') how simple */
+ /* drop-outs, smart drop-outs, and stubs are defined. */
+ /* */
+#define FT_OUTLINE_NONE 0x0
+#define FT_OUTLINE_OWNER 0x1
+#define FT_OUTLINE_EVEN_ODD_FILL 0x2
+#define FT_OUTLINE_REVERSE_FILL 0x4
+#define FT_OUTLINE_IGNORE_DROPOUTS 0x8
+#define FT_OUTLINE_SMART_DROPOUTS 0x10
+#define FT_OUTLINE_INCLUDE_STUBS 0x20
+
+#define FT_OUTLINE_HIGH_PRECISION 0x100
+#define FT_OUTLINE_SINGLE_PASS 0x200
+
+
+ /* these constants are deprecated; use the corresponding */
+ /* `FT_OUTLINE_XXX' values instead */
+#define ft_outline_none FT_OUTLINE_NONE
+#define ft_outline_owner FT_OUTLINE_OWNER
+#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
+#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
+#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
+#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
+#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
+
+ /* */
+
+#define FT_CURVE_TAG( flag ) ( flag & 3 )
+
+#define FT_CURVE_TAG_ON 1
+#define FT_CURVE_TAG_CONIC 0
+#define FT_CURVE_TAG_CUBIC 2
+
+#define FT_CURVE_TAG_HAS_SCANMODE 4
+
+#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */
+#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
+
+#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
+ FT_CURVE_TAG_TOUCH_Y )
+
+#define FT_Curve_Tag_On FT_CURVE_TAG_ON
+#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
+#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
+#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
+#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_MoveToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `move */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `move to' is emitted to start a new contour in an outline. */
+ /* */
+ /* <Input> */
+ /* to :: A pointer to the target point of the `move to'. */
+ /* */
+ /* user :: A typeless pointer, which is passed from the caller of the */
+ /* decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0~means success. */
+ /* */
+ typedef int
+ (*FT_Outline_MoveToFunc)( const FT_Vector* to,
+ void* user );
+
+#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_LineToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `line */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `line to' is emitted to indicate a segment in the outline. */
+ /* */
+ /* <Input> */
+ /* to :: A pointer to the target point of the `line to'. */
+ /* */
+ /* user :: A typeless pointer, which is passed from the caller of the */
+ /* decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0~means success. */
+ /* */
+ typedef int
+ (*FT_Outline_LineToFunc)( const FT_Vector* to,
+ void* user );
+
+#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_ConicToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `conic */
+ /* to' function during outline walking or decomposition. */
+ /* */
+ /* A `conic to' is emitted to indicate a second-order Bézier arc in */
+ /* the outline. */
+ /* */
+ /* <Input> */
+ /* control :: An intermediate control point between the last position */
+ /* and the new target in `to'. */
+ /* */
+ /* to :: A pointer to the target end point of the conic arc. */
+ /* */
+ /* user :: A typeless pointer, which is passed from the caller of */
+ /* the decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0~means success. */
+ /* */
+ typedef int
+ (*FT_Outline_ConicToFunc)( const FT_Vector* control,
+ const FT_Vector* to,
+ void* user );
+
+#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_CubicToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `cubic */
+ /* to' function during outline walking or decomposition. */
+ /* */
+ /* A `cubic to' is emitted to indicate a third-order Bézier arc. */
+ /* */
+ /* <Input> */
+ /* control1 :: A pointer to the first Bézier control point. */
+ /* */
+ /* control2 :: A pointer to the second Bézier control point. */
+ /* */
+ /* to :: A pointer to the target end point. */
+ /* */
+ /* user :: A typeless pointer, which is passed from the caller of */
+ /* the decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0~means success. */
+ /* */
+ typedef int
+ (*FT_Outline_CubicToFunc)( const FT_Vector* control1,
+ const FT_Vector* control2,
+ const FT_Vector* to,
+ void* user );
+
+#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Outline_Funcs */
+ /* */
+ /* <Description> */
+ /* A structure to hold various function pointers used during outline */
+ /* decomposition in order to emit segments, conic, and cubic Béziers. */
+ /* */
+ /* <Fields> */
+ /* move_to :: The `move to' emitter. */
+ /* */
+ /* line_to :: The segment emitter. */
+ /* */
+ /* conic_to :: The second-order Bézier arc emitter. */
+ /* */
+ /* cubic_to :: The third-order Bézier arc emitter. */
+ /* */
+ /* shift :: The shift that is applied to coordinates before they */
+ /* are sent to the emitter. */
+ /* */
+ /* delta :: The delta that is applied to coordinates before they */
+ /* are sent to the emitter, but after the shift. */
+ /* */
+ /* <Note> */
+ /* The point coordinates sent to the emitters are the transformed */
+ /* version of the original coordinates (this is important for high */
+ /* accuracy during scan-conversion). The transformation is simple: */
+ /* */
+ /* { */
+ /* x' = (x << shift) - delta */
+ /* y' = (x << shift) - delta */
+ /* } */
+ /* */
+ /* Set the values of `shift' and `delta' to~0 to get the original */
+ /* point coordinates. */
+ /* */
+ typedef struct FT_Outline_Funcs_
+ {
+ FT_Outline_MoveToFunc move_to;
+ FT_Outline_LineToFunc line_to;
+ FT_Outline_ConicToFunc conic_to;
+ FT_Outline_CubicToFunc cubic_to;
+
+ int shift;
+ FT_Pos delta;
+
+ } FT_Outline_Funcs;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_IMAGE_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four-letter tags to an unsigned long type. */
+ /* */
+ /* <Note> */
+ /* Since many 16-bit compilers don't like 32-bit enumerations, you */
+ /* should redefine this macro in case of problems to something like */
+ /* this: */
+ /* */
+ /* { */
+ /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
+ /* } */
+ /* */
+ /* to get a simple enumeration without assigning special numbers. */
+ /* */
+#ifndef FT_IMAGE_TAG
+#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
+ value = ( ( (unsigned long)_x1 << 24 ) | \
+ ( (unsigned long)_x2 << 16 ) | \
+ ( (unsigned long)_x3 << 8 ) | \
+ (unsigned long)_x4 )
+#endif /* FT_IMAGE_TAG */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Glyph_Format */
+ /* */
+ /* <Description> */
+ /* An enumeration type used to describe the format of a given glyph */
+ /* image. Note that this version of FreeType only supports two image */
+ /* formats, even though future font drivers will be able to register */
+ /* their own format. */
+ /* */
+ /* <Values> */
+ /* FT_GLYPH_FORMAT_NONE :: */
+ /* The value~0 is reserved. */
+ /* */
+ /* FT_GLYPH_FORMAT_COMPOSITE :: */
+ /* The glyph image is a composite of several other images. This */
+ /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */
+ /* report compound glyphs (like accented characters). */
+ /* */
+ /* FT_GLYPH_FORMAT_BITMAP :: */
+ /* The glyph image is a bitmap, and can be described as an */
+ /* @FT_Bitmap. You generally need to access the `bitmap' field of */
+ /* the @FT_GlyphSlotRec structure to read it. */
+ /* */
+ /* FT_GLYPH_FORMAT_OUTLINE :: */
+ /* The glyph image is a vectorial outline made of line segments */
+ /* and Bézier arcs; it can be described as an @FT_Outline; you */
+ /* generally want to access the `outline' field of the */
+ /* @FT_GlyphSlotRec structure to read it. */
+ /* */
+ /* FT_GLYPH_FORMAT_PLOTTER :: */
+ /* The glyph image is a vectorial path with no inside and outside */
+ /* contours. Some Type~1 fonts, like those in the Hershey family, */
+ /* contain glyphs in this format. These are described as */
+ /* @FT_Outline, but FreeType isn't currently capable of rendering */
+ /* them correctly. */
+ /* */
+ typedef enum FT_Glyph_Format_
+ {
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
+
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
+
+ } FT_Glyph_Format;
+
+
+ /* these constants are deprecated; use the corresponding */
+ /* `FT_Glyph_Format' values instead. */
+#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
+#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
+#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
+#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
+#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** R A S T E R D E F I N I T I O N S *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* A raster is a scan converter, in charge of rendering an outline into */
+ /* a a bitmap. This section contains the public API for rasters. */
+ /* */
+ /* Note that in FreeType 2, all rasters are now encapsulated within */
+ /* specific modules called `renderers'. See `ftrender.h' for more */
+ /* details on renderers. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* raster */
+ /* */
+ /* <Title> */
+ /* Scanline Converter */
+ /* */
+ /* <Abstract> */
+ /* How vectorial outlines are converted into bitmaps and pixmaps. */
+ /* */
+ /* <Description> */
+ /* This section contains technical definitions. */
+ /* */
+ /* <Order> */
+ /* FT_Raster */
+ /* FT_Span */
+ /* FT_SpanFunc */
+ /* */
+ /* FT_Raster_Params */
+ /* FT_RASTER_FLAG_XXX */
+ /* */
+ /* FT_Raster_NewFunc */
+ /* FT_Raster_DoneFunc */
+ /* FT_Raster_ResetFunc */
+ /* FT_Raster_SetModeFunc */
+ /* FT_Raster_RenderFunc */
+ /* FT_Raster_Funcs */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Raster */
+ /* */
+ /* <Description> */
+ /* An opaque handle (pointer) to a raster object. Each object can be */
+ /* used independently to convert an outline into a bitmap or pixmap. */
+ /* */
+ typedef struct FT_RasterRec_* FT_Raster;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Span */
+ /* */
+ /* <Description> */
+ /* A structure used to model a single span of gray pixels when */
+ /* rendering an anti-aliased bitmap. */
+ /* */
+ /* <Fields> */
+ /* x :: The span's horizontal start position. */
+ /* */
+ /* len :: The span's length in pixels. */
+ /* */
+ /* coverage :: The span color/coverage, ranging from 0 (background) */
+ /* to 255 (foreground). */
+ /* */
+ /* <Note> */
+ /* This structure is used by the span drawing callback type named */
+ /* @FT_SpanFunc that takes the y~coordinate of the span as a */
+ /* parameter. */
+ /* */
+ /* The coverage value is always between 0 and 255. If you want less */
+ /* gray values, the callback function has to reduce them. */
+ /* */
+ typedef struct FT_Span_
+ {
+ short x;
+ unsigned short len;
+ unsigned char coverage;
+
+ } FT_Span;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_SpanFunc */
+ /* */
+ /* <Description> */
+ /* A function used as a call-back by the anti-aliased renderer in */
+ /* order to let client applications draw themselves the gray pixel */
+ /* spans on each scan line. */
+ /* */
+ /* <Input> */
+ /* y :: The scanline's y~coordinate. */
+ /* */
+ /* count :: The number of spans to draw on this scanline. */
+ /* */
+ /* spans :: A table of `count' spans to draw on the scanline. */
+ /* */
+ /* user :: User-supplied data that is passed to the callback. */
+ /* */
+ /* <Note> */
+ /* This callback allows client applications to directly render the */
+ /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
+ /* */
+ /* This can be used to write anti-aliased outlines directly to a */
+ /* given background bitmap, and even perform translucency. */
+ /* */
+ /* Note that the `count' field cannot be greater than a fixed value */
+ /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
+ /* `ftoption.h'. By default, this value is set to~32, which means */
+ /* that if there are more than 32~spans on a given scanline, the */
+ /* callback is called several times with the same `y' parameter in */
+ /* order to draw all callbacks. */
+ /* */
+ /* Otherwise, the callback is only called once per scan-line, and */
+ /* only for those scanlines that do have `gray' pixels on them. */
+ /* */
+ typedef void
+ (*FT_SpanFunc)( int y,
+ int count,
+ const FT_Span* spans,
+ void* user );
+
+#define FT_Raster_Span_Func FT_SpanFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_BitTest_Func */
+ /* */
+ /* <Description> */
+ /* Deprecated, unimplemented. */
+ /* */
+ typedef int
+ (*FT_Raster_BitTest_Func)( int y,
+ int x,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_BitSet_Func */
+ /* */
+ /* <Description> */
+ /* Deprecated, unimplemented. */
+ /* */
+ typedef void
+ (*FT_Raster_BitSet_Func)( int y,
+ int x,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_RASTER_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit flag constants as used in the `flags' field of a */
+ /* @FT_Raster_Params structure. */
+ /* */
+ /* <Values> */
+ /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
+ /* */
+ /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
+ /* anti-aliased glyph image should be */
+ /* generated. Otherwise, it will be */
+ /* monochrome (1-bit). */
+ /* */
+ /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
+ /* rendering. In this mode, client */
+ /* applications must provide their own span */
+ /* callback. This lets them directly */
+ /* draw or compose over an existing bitmap. */
+ /* If this bit is not set, the target */
+ /* pixmap's buffer _must_ be zeroed before */
+ /* rendering. */
+ /* */
+ /* Direct rendering is only possible with */
+ /* anti-aliased glyphs. */
+ /* */
+ /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
+ /* rendering mode. If set, the output will */
+ /* be clipped to a box specified in the */
+ /* `clip_box' field of the */
+ /* @FT_Raster_Params structure. */
+ /* */
+ /* Note that by default, the glyph bitmap */
+ /* is clipped to the target pixmap, except */
+ /* in direct rendering mode where all spans */
+ /* are generated if no clipping box is set. */
+ /* */
+#define FT_RASTER_FLAG_DEFAULT 0x0
+#define FT_RASTER_FLAG_AA 0x1
+#define FT_RASTER_FLAG_DIRECT 0x2
+#define FT_RASTER_FLAG_CLIP 0x4
+
+ /* these constants are deprecated; use the corresponding */
+ /* `FT_RASTER_FLAG_XXX' values instead */
+#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
+#define ft_raster_flag_aa FT_RASTER_FLAG_AA
+#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
+#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Raster_Params */
+ /* */
+ /* <Description> */
+ /* A structure to hold the arguments used by a raster's render */
+ /* function. */
+ /* */
+ /* <Fields> */
+ /* target :: The target bitmap. */
+ /* */
+ /* source :: A pointer to the source glyph image (e.g., an */
+ /* @FT_Outline). */
+ /* */
+ /* flags :: The rendering flags. */
+ /* */
+ /* gray_spans :: The gray span drawing callback. */
+ /* */
+ /* black_spans :: Unused. */
+ /* */
+ /* bit_test :: Unused. */
+ /* */
+ /* bit_set :: Unused. */
+ /* */
+ /* user :: User-supplied data that is passed to each drawing */
+ /* callback. */
+ /* */
+ /* clip_box :: An optional clipping box. It is only used in */
+ /* direct rendering mode. Note that coordinates here */
+ /* should be expressed in _integer_ pixels (and not in */
+ /* 26.6 fixed-point units). */
+ /* */
+ /* <Note> */
+ /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
+ /* bit flag is set in the `flags' field, otherwise a monochrome */
+ /* bitmap is generated. */
+ /* */
+ /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
+ /* raster will call the `gray_spans' callback to draw gray pixel */
+ /* spans. This allows direct composition over a pre-existing bitmap */
+ /* through user-provided callbacks to perform the span drawing and */
+ /* composition. Not supported by the monochrome rasterizer. */
+ /* */
+ typedef struct FT_Raster_Params_
+ {
+ const FT_Bitmap* target;
+ const void* source;
+ int flags;
+ FT_SpanFunc gray_spans;
+ FT_SpanFunc black_spans; /* unused */
+ FT_Raster_BitTest_Func bit_test; /* unused */
+ FT_Raster_BitSet_Func bit_set; /* unused */
+ void* user;
+ FT_BBox clip_box;
+
+ } FT_Raster_Params;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_NewFunc */
+ /* */
+ /* <Description> */
+ /* A function used to create a new raster object. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the memory allocator. */
+ /* */
+ /* <Output> */
+ /* raster :: A handle to the new raster object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The `memory' parameter is a typeless pointer in order to avoid */
+ /* un-wanted dependencies on the rest of the FreeType code. In */
+ /* practice, it is an @FT_Memory object, i.e., a handle to the */
+ /* standard FreeType memory allocator. However, this field can be */
+ /* completely ignored by a given raster implementation. */
+ /* */
+ typedef int
+ (*FT_Raster_NewFunc)( void* memory,
+ FT_Raster* raster );
+
+#define FT_Raster_New_Func FT_Raster_NewFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_DoneFunc */
+ /* */
+ /* <Description> */
+ /* A function used to destroy a given raster object. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the raster object. */
+ /* */
+ typedef void
+ (*FT_Raster_DoneFunc)( FT_Raster raster );
+
+#define FT_Raster_Done_Func FT_Raster_DoneFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_ResetFunc */
+ /* */
+ /* <Description> */
+ /* FreeType used to provide an area of memory called the `render */
+ /* pool' available to all registered rasters. This was not thread */
+ /* safe however and now FreeType never allocates this pool. NULL */
+ /* is always passed in as pool_base. */
+ /* */
+ /* This function is called each time the render pool changes, or just */
+ /* after a new raster object is created. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the new raster object. */
+ /* */
+ /* pool_base :: The address in memory of the render pool. */
+ /* */
+ /* pool_size :: The size in bytes of the render pool. */
+ /* */
+ /* <Note> */
+ /* Rasters should ignore the render pool and rely on dynamic or stack */
+ /* allocation if they want to (a handle to the memory allocator is */
+ /* passed to the raster constructor). */
+ /* */
+ typedef void
+ (*FT_Raster_ResetFunc)( FT_Raster raster,
+ unsigned char* pool_base,
+ unsigned long pool_size );
+
+#define FT_Raster_Reset_Func FT_Raster_ResetFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_SetModeFunc */
+ /* */
+ /* <Description> */
+ /* This function is a generic facility to change modes or attributes */
+ /* in a given raster. This can be used for debugging purposes, or */
+ /* simply to allow implementation-specific `features' in a given */
+ /* raster module. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the new raster object. */
+ /* */
+ /* mode :: A 4-byte tag used to name the mode or property. */
+ /* */
+ /* args :: A pointer to the new mode/property to use. */
+ /* */
+ typedef int
+ (*FT_Raster_SetModeFunc)( FT_Raster raster,
+ unsigned long mode,
+ void* args );
+
+#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_RenderFunc */
+ /* */
+ /* <Description> */
+ /* Invoke a given raster to scan-convert a given glyph image into a */
+ /* target bitmap. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the raster object. */
+ /* */
+ /* params :: A pointer to an @FT_Raster_Params structure used to */
+ /* store the rendering parameters. */
+ /* */
+ /* <Return> */
+ /* Error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The exact format of the source image depends on the raster's glyph */
+ /* format defined in its @FT_Raster_Funcs structure. It can be an */
+ /* @FT_Outline or anything else in order to support a large array of */
+ /* glyph formats. */
+ /* */
+ /* Note also that the render function can fail and return a */
+ /* `FT_Err_Unimplemented_Feature' error code if the raster used does */
+ /* not support direct composition. */
+ /* */
+ /* XXX: For now, the standard raster doesn't support direct */
+ /* composition but this should change for the final release (see */
+ /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
+ /* for examples of distinct implementations that support direct */
+ /* composition). */
+ /* */
+ typedef int
+ (*FT_Raster_RenderFunc)( FT_Raster raster,
+ const FT_Raster_Params* params );
+
+#define FT_Raster_Render_Func FT_Raster_RenderFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Raster_Funcs */
+ /* */
+ /* <Description> */
+ /* A structure used to describe a given raster class to the library. */
+ /* */
+ /* <Fields> */
+ /* glyph_format :: The supported glyph format for this raster. */
+ /* */
+ /* raster_new :: The raster constructor. */
+ /* */
+ /* raster_reset :: Used to reset the render pool within the raster. */
+ /* */
+ /* raster_render :: A function to render a glyph into a given bitmap. */
+ /* */
+ /* raster_done :: The raster destructor. */
+ /* */
+ typedef struct FT_Raster_Funcs_
+ {
+ FT_Glyph_Format glyph_format;
+ FT_Raster_NewFunc raster_new;
+ FT_Raster_ResetFunc raster_reset;
+ FT_Raster_SetModeFunc raster_set_mode;
+ FT_Raster_RenderFunc raster_render;
+ FT_Raster_DoneFunc raster_done;
+
+ } FT_Raster_Funcs;
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTIMAGE_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
diff --git a/src/3rdparty/freetype/include/freetype/ftincrem.h b/src/3rdparty/freetype/include/freetype/ftincrem.h
new file mode 100644
index 0000000000..840af25b05
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftincrem.h
@@ -0,0 +1,354 @@
+/***************************************************************************/
+/* */
+/* ftincrem.h */
+/* */
+/* FreeType incremental loading (specification). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTINCREM_H__
+#define __FTINCREM_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /***************************************************************************
+ *
+ * @section:
+ * incremental
+ *
+ * @title:
+ * Incremental Loading
+ *
+ * @abstract:
+ * Custom Glyph Loading.
+ *
+ * @description:
+ * This section contains various functions used to perform so-called
+ * `incremental' glyph loading. This is a mode where all glyphs loaded
+ * from a given @FT_Face are provided by the client application.
+ *
+ * Apart from that, all other tables are loaded normally from the font
+ * file. This mode is useful when FreeType is used within another
+ * engine, e.g., a PostScript Imaging Processor.
+ *
+ * To enable this mode, you must use @FT_Open_Face, passing an
+ * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
+ * @FT_Incremental_Interface value. See the comments for
+ * @FT_Incremental_InterfaceRec for an example.
+ *
+ */
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental
+ *
+ * @description:
+ * An opaque type describing a user-provided object used to implement
+ * `incremental' glyph loading within FreeType. This is used to support
+ * embedded fonts in certain environments (e.g., PostScript interpreters),
+ * where the glyph data isn't in the font file, or must be overridden by
+ * different values.
+ *
+ * @note:
+ * It is up to client applications to create and implement @FT_Incremental
+ * objects, as long as they provide implementations for the methods
+ * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
+ * and @FT_Incremental_GetGlyphMetricsFunc.
+ *
+ * See the description of @FT_Incremental_InterfaceRec to understand how
+ * to use incremental objects with FreeType.
+ *
+ */
+ typedef struct FT_IncrementalRec_* FT_Incremental;
+
+
+ /***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_MetricsRec
+ *
+ * @description:
+ * A small structure used to contain the basic glyph metrics returned
+ * by the @FT_Incremental_GetGlyphMetricsFunc method.
+ *
+ * @fields:
+ * bearing_x ::
+ * Left bearing, in font units.
+ *
+ * bearing_y ::
+ * Top bearing, in font units.
+ *
+ * advance ::
+ * Horizontal component of glyph advance, in font units.
+ *
+ * advance_v ::
+ * Vertical component of glyph advance, in font units.
+ *
+ * @note:
+ * These correspond to horizontal or vertical metrics depending on the
+ * value of the `vertical' argument to the function
+ * @FT_Incremental_GetGlyphMetricsFunc.
+ *
+ */
+ typedef struct FT_Incremental_MetricsRec_
+ {
+ FT_Long bearing_x;
+ FT_Long bearing_y;
+ FT_Long advance;
+ FT_Long advance_v; /* since 2.3.12 */
+
+ } FT_Incremental_MetricsRec;
+
+
+ /***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_Metrics
+ *
+ * @description:
+ * A handle to an @FT_Incremental_MetricsRec structure.
+ *
+ */
+ typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_GetGlyphDataFunc
+ *
+ * @description:
+ * A function called by FreeType to access a given glyph's data bytes
+ * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
+ * enabled.
+ *
+ * Note that the format of the glyph's data bytes depends on the font
+ * file format. For TrueType, it must correspond to the raw bytes within
+ * the `glyf' table. For PostScript formats, it must correspond to the
+ * *unencrypted* charstring bytes, without any `lenIV' header. It is
+ * undefined for any other format.
+ *
+ * @input:
+ * incremental ::
+ * Handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * glyph_index ::
+ * Index of relevant glyph.
+ *
+ * @output:
+ * adata ::
+ * A structure describing the returned glyph data bytes (which will be
+ * accessed as a read-only byte block).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If this function returns successfully the method
+ * @FT_Incremental_FreeGlyphDataFunc will be called later to release
+ * the data bytes.
+ *
+ * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
+ * compound glyphs.
+ *
+ */
+ typedef FT_Error
+ (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
+ FT_UInt glyph_index,
+ FT_Data* adata );
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_FreeGlyphDataFunc
+ *
+ * @description:
+ * A function used to release the glyph data bytes returned by a
+ * successful call to @FT_Incremental_GetGlyphDataFunc.
+ *
+ * @input:
+ * incremental ::
+ * A handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * data ::
+ * A structure describing the glyph data bytes (which will be accessed
+ * as a read-only byte block).
+ *
+ */
+ typedef void
+ (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
+ FT_Data* data );
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_GetGlyphMetricsFunc
+ *
+ * @description:
+ * A function used to retrieve the basic metrics of a given glyph index
+ * before accessing its data. This is necessary because, in certain
+ * formats like TrueType, the metrics are stored in a different place from
+ * the glyph images proper.
+ *
+ * @input:
+ * incremental ::
+ * A handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * glyph_index ::
+ * Index of relevant glyph.
+ *
+ * vertical ::
+ * If true, return vertical metrics.
+ *
+ * ametrics ::
+ * This parameter is used for both input and output.
+ * The original glyph metrics, if any, in font units. If metrics are
+ * not available all the values must be set to zero.
+ *
+ * @output:
+ * ametrics ::
+ * The replacement glyph metrics in font units.
+ *
+ */
+ typedef FT_Error
+ (*FT_Incremental_GetGlyphMetricsFunc)
+ ( FT_Incremental incremental,
+ FT_UInt glyph_index,
+ FT_Bool vertical,
+ FT_Incremental_MetricsRec *ametrics );
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_FuncsRec
+ *
+ * @description:
+ * A table of functions for accessing fonts that load data
+ * incrementally. Used in @FT_Incremental_InterfaceRec.
+ *
+ * @fields:
+ * get_glyph_data ::
+ * The function to get glyph data. Must not be null.
+ *
+ * free_glyph_data ::
+ * The function to release glyph data. Must not be null.
+ *
+ * get_glyph_metrics ::
+ * The function to get glyph metrics. May be null if the font does
+ * not provide overriding glyph metrics.
+ *
+ */
+ typedef struct FT_Incremental_FuncsRec_
+ {
+ FT_Incremental_GetGlyphDataFunc get_glyph_data;
+ FT_Incremental_FreeGlyphDataFunc free_glyph_data;
+ FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
+
+ } FT_Incremental_FuncsRec;
+
+
+ /***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_InterfaceRec
+ *
+ * @description:
+ * A structure to be used with @FT_Open_Face to indicate that the user
+ * wants to support incremental glyph loading. You should use it with
+ * @FT_PARAM_TAG_INCREMENTAL as in the following example:
+ *
+ * {
+ * FT_Incremental_InterfaceRec inc_int;
+ * FT_Parameter parameter;
+ * FT_Open_Args open_args;
+ *
+ *
+ * // set up incremental descriptor
+ * inc_int.funcs = my_funcs;
+ * inc_int.object = my_object;
+ *
+ * // set up optional parameter
+ * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
+ * parameter.data = &inc_int;
+ *
+ * // set up FT_Open_Args structure
+ * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
+ * open_args.pathname = my_font_pathname;
+ * open_args.num_params = 1;
+ * open_args.params = &parameter; // we use one optional argument
+ *
+ * // open the font
+ * error = FT_Open_Face( library, &open_args, index, &face );
+ * ...
+ * }
+ *
+ */
+ typedef struct FT_Incremental_InterfaceRec_
+ {
+ const FT_Incremental_FuncsRec* funcs;
+ FT_Incremental object;
+
+ } FT_Incremental_InterfaceRec;
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_Interface
+ *
+ * @description:
+ * A pointer to an @FT_Incremental_InterfaceRec structure.
+ *
+ */
+ typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_INCREMENTAL
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to indicate
+ * an incremental loading object to be used by FreeType.
+ *
+ */
+#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTINCREM_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftlcdfil.h b/src/3rdparty/freetype/include/freetype/ftlcdfil.h
new file mode 100644
index 0000000000..4cd999a4b3
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftlcdfil.h
@@ -0,0 +1,251 @@
+/***************************************************************************/
+/* */
+/* ftlcdfil.h */
+/* */
+/* FreeType API for color filtering of subpixel bitmap glyphs */
+/* (specification). */
+/* */
+/* Copyright 2006-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FT_LCD_FILTER_H__
+#define __FT_LCD_FILTER_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /***************************************************************************
+ *
+ * @section:
+ * lcd_filtering
+ *
+ * @title:
+ * LCD Filtering
+ *
+ * @abstract:
+ * Reduce color fringes of LCD-optimized bitmaps.
+ *
+ * @description:
+ * The @FT_Library_SetLcdFilter API can be used to specify a low-pass
+ * filter, which is then applied to LCD-optimized bitmaps generated
+ * through @FT_Render_Glyph. This is useful to reduce color fringes
+ * that would occur with unfiltered rendering.
+ *
+ * Note that no filter is active by default, and that this function is
+ * *not* implemented in default builds of the library. You need to
+ * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
+ * in order to activate it.
+ *
+ * FreeType generates alpha coverage maps, which are linear by nature.
+ * For instance, the value 0x80 in bitmap representation means that
+ * (within numerical precision) 0x80/0xFF fraction of that pixel is
+ * covered by the glyph's outline. The blending function for placing
+ * text over a background is
+ *
+ * {
+ * dst = alpha * src + (1 - alpha) * dst ,
+ * }
+ *
+ * which is known as OVER. However, when calculating the output of the
+ * OVER operator, the source colors should first be transformed to a
+ * linear color space, then alpha blended in that space, and transformed
+ * back to the output color space.
+ *
+ * When linear light blending is used, the default FIR5 filtering
+ * weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
+ * they have been designed for black on white rendering while lacking
+ * gamma correction. To preserve color neutrality, weights for a FIR5
+ * filter should be chosen according to two free parameters `a' and `c',
+ * and the FIR weights should be
+ *
+ * {
+ * [a - c, a + c, 2 * a, a + c, a - c] .
+ * }
+ *
+ * This formula generates equal weights for all the color primaries
+ * across the filter kernel, which makes it colorless. One suggested
+ * set of weights is
+ *
+ * {
+ * [0x10, 0x50, 0x60, 0x50, 0x10] ,
+ * }
+ *
+ * where `a' has value 0x30 and `b' value 0x20. The weights in filter
+ * may have a sum larger than 0x100, which increases coloration slightly
+ * but also improves contrast.
+ */
+
+
+ /****************************************************************************
+ *
+ * @enum:
+ * FT_LcdFilter
+ *
+ * @description:
+ * A list of values to identify various types of LCD filters.
+ *
+ * @values:
+ * FT_LCD_FILTER_NONE ::
+ * Do not perform filtering. When used with subpixel rendering, this
+ * results in sometimes severe color fringes.
+ *
+ * FT_LCD_FILTER_DEFAULT ::
+ * The default filter reduces color fringes considerably, at the cost
+ * of a slight blurriness in the output.
+ *
+ * FT_LCD_FILTER_LIGHT ::
+ * The light filter is a variant that produces less blurriness at the
+ * cost of slightly more color fringes than the default one. It might
+ * be better, depending on taste, your monitor, or your personal vision.
+ *
+ * FT_LCD_FILTER_LEGACY ::
+ * This filter corresponds to the original libXft color filter. It
+ * provides high contrast output but can exhibit really bad color
+ * fringes if glyphs are not extremely well hinted to the pixel grid.
+ * In other words, it only works well if the TrueType bytecode
+ * interpreter is enabled *and* high-quality hinted fonts are used.
+ *
+ * This filter is only provided for comparison purposes, and might be
+ * disabled or stay unsupported in the future.
+ *
+ * @since:
+ * 2.3.0
+ */
+ typedef enum FT_LcdFilter_
+ {
+ FT_LCD_FILTER_NONE = 0,
+ FT_LCD_FILTER_DEFAULT = 1,
+ FT_LCD_FILTER_LIGHT = 2,
+ FT_LCD_FILTER_LEGACY = 16,
+
+ FT_LCD_FILTER_MAX /* do not remove */
+
+ } FT_LcdFilter;
+
+
+ /**************************************************************************
+ *
+ * @func:
+ * FT_Library_SetLcdFilter
+ *
+ * @description:
+ * This function is used to apply color filtering to LCD decimated
+ * bitmaps, like the ones used when calling @FT_Render_Glyph with
+ * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
+ *
+ * @input:
+ * library ::
+ * A handle to the target library instance.
+ *
+ * filter ::
+ * The filter type.
+ *
+ * You can use @FT_LCD_FILTER_NONE here to disable this feature, or
+ * @FT_LCD_FILTER_DEFAULT to use a default filter that should work
+ * well on most LCD screens.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This feature is always disabled by default. Clients must make an
+ * explicit call to this function with a `filter' value other than
+ * @FT_LCD_FILTER_NONE in order to enable it.
+ *
+ * Due to *PATENTS* covering subpixel rendering, this function doesn't
+ * do anything except returning `FT_Err_Unimplemented_Feature' if the
+ * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
+ * defined in your build of the library, which should correspond to all
+ * default builds of FreeType.
+ *
+ * The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
+ * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
+ *
+ * It does _not_ affect the output of @FT_Outline_Render and
+ * @FT_Outline_Get_Bitmap.
+ *
+ * If this feature is activated, the dimensions of LCD glyph bitmaps are
+ * either larger or taller than the dimensions of the corresponding
+ * outline with regards to the pixel grid. For example, for
+ * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
+ * up to 3~pixels to the right.
+ *
+ * The bitmap offset values are adjusted correctly, so clients shouldn't
+ * need to modify their layout and glyph positioning code when enabling
+ * the filter.
+ *
+ * @since:
+ * 2.3.0
+ */
+ FT_EXPORT( FT_Error )
+ FT_Library_SetLcdFilter( FT_Library library,
+ FT_LcdFilter filter );
+
+
+ /**************************************************************************
+ *
+ * @func:
+ * FT_Library_SetLcdFilterWeights
+ *
+ * @description:
+ * Use this function to override the filter weights selected by
+ * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
+ * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
+ * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
+ * FT_LCD_FILTER_LEGACY.
+ *
+ * @input:
+ * library ::
+ * A handle to the target library instance.
+ *
+ * weights ::
+ * A pointer to an array; the function copies the first five bytes and
+ * uses them to specify the filter weights.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * Due to *PATENTS* covering subpixel rendering, this function doesn't
+ * do anything except returning `FT_Err_Unimplemented_Feature' if the
+ * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
+ * defined in your build of the library, which should correspond to all
+ * default builds of FreeType.
+ *
+ * This function must be called after @FT_Library_SetLcdFilter to have
+ * any effect.
+ *
+ * @since:
+ * 2.4.0
+ */
+ FT_EXPORT( FT_Error )
+ FT_Library_SetLcdFilterWeights( FT_Library library,
+ unsigned char *weights );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FT_LCD_FILTER_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftlist.h b/src/3rdparty/freetype/include/freetype/ftlist.h
new file mode 100644
index 0000000000..12b48c78f7
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftlist.h
@@ -0,0 +1,276 @@
+/***************************************************************************/
+/* */
+/* ftlist.h */
+/* */
+/* Generic list support for FreeType (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file implements functions relative to list processing. Its */
+ /* data structures are defined in `freetype.h'. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTLIST_H__
+#define __FTLIST_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* list_processing */
+ /* */
+ /* <Title> */
+ /* List Processing */
+ /* */
+ /* <Abstract> */
+ /* Simple management of lists. */
+ /* */
+ /* <Description> */
+ /* This section contains various definitions related to list */
+ /* processing using doubly-linked nodes. */
+ /* */
+ /* <Order> */
+ /* FT_List */
+ /* FT_ListNode */
+ /* FT_ListRec */
+ /* FT_ListNodeRec */
+ /* */
+ /* FT_List_Add */
+ /* FT_List_Insert */
+ /* FT_List_Find */
+ /* FT_List_Remove */
+ /* FT_List_Up */
+ /* FT_List_Iterate */
+ /* FT_List_Iterator */
+ /* FT_List_Finalize */
+ /* FT_List_Destructor */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Find */
+ /* */
+ /* <Description> */
+ /* Find the list node for a given listed object. */
+ /* */
+ /* <Input> */
+ /* list :: A pointer to the parent list. */
+ /* data :: The address of the listed object. */
+ /* */
+ /* <Return> */
+ /* List node. NULL if it wasn't found. */
+ /* */
+ FT_EXPORT( FT_ListNode )
+ FT_List_Find( FT_List list,
+ void* data );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Add */
+ /* */
+ /* <Description> */
+ /* Append an element to the end of a list. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to the parent list. */
+ /* node :: The node to append. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Add( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Insert */
+ /* */
+ /* <Description> */
+ /* Insert an element at the head of a list. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to parent list. */
+ /* node :: The node to insert. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Insert( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Remove */
+ /* */
+ /* <Description> */
+ /* Remove a node from a list. This function doesn't check whether */
+ /* the node is in the list! */
+ /* */
+ /* <Input> */
+ /* node :: The node to remove. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to the parent list. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Remove( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Up */
+ /* */
+ /* <Description> */
+ /* Move a node to the head/top of a list. Used to maintain LRU */
+ /* lists. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to the parent list. */
+ /* node :: The node to move. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Up( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_List_Iterator */
+ /* */
+ /* <Description> */
+ /* An FT_List iterator function that is called during a list parse */
+ /* by @FT_List_Iterate. */
+ /* */
+ /* <Input> */
+ /* node :: The current iteration list node. */
+ /* */
+ /* user :: A typeless pointer passed to @FT_List_Iterate. */
+ /* Can be used to point to the iteration's state. */
+ /* */
+ typedef FT_Error
+ (*FT_List_Iterator)( FT_ListNode node,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Iterate */
+ /* */
+ /* <Description> */
+ /* Parse a list and calls a given iterator function on each element. */
+ /* Note that parsing is stopped as soon as one of the iterator calls */
+ /* returns a non-zero value. */
+ /* */
+ /* <Input> */
+ /* list :: A handle to the list. */
+ /* iterator :: An iterator function, called on each node of the list. */
+ /* user :: A user-supplied field that is passed as the second */
+ /* argument to the iterator. */
+ /* */
+ /* <Return> */
+ /* The result (a FreeType error code) of the last iterator call. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_List_Iterate( FT_List list,
+ FT_List_Iterator iterator,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_List_Destructor */
+ /* */
+ /* <Description> */
+ /* An @FT_List iterator function that is called during a list */
+ /* finalization by @FT_List_Finalize to destroy all elements in a */
+ /* given list. */
+ /* */
+ /* <Input> */
+ /* system :: The current system object. */
+ /* */
+ /* data :: The current object to destroy. */
+ /* */
+ /* user :: A typeless pointer passed to @FT_List_Iterate. It can */
+ /* be used to point to the iteration's state. */
+ /* */
+ typedef void
+ (*FT_List_Destructor)( FT_Memory memory,
+ void* data,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Finalize */
+ /* */
+ /* <Description> */
+ /* Destroy all elements in the list as well as the list itself. */
+ /* */
+ /* <Input> */
+ /* list :: A handle to the list. */
+ /* */
+ /* destroy :: A list destructor that will be applied to each element */
+ /* of the list. Set this to NULL if not needed. */
+ /* */
+ /* memory :: The current memory object that handles deallocation. */
+ /* */
+ /* user :: A user-supplied field that is passed as the last */
+ /* argument to the destructor. */
+ /* */
+ /* <Note> */
+ /* This function expects that all nodes added by @FT_List_Add or */
+ /* @FT_List_Insert have been dynamically allocated. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Finalize( FT_List list,
+ FT_List_Destructor destroy,
+ FT_Memory memory,
+ void* user );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTLIST_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftlzw.h b/src/3rdparty/freetype/include/freetype/ftlzw.h
new file mode 100644
index 0000000000..d3ec28e554
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftlzw.h
@@ -0,0 +1,99 @@
+/***************************************************************************/
+/* */
+/* ftlzw.h */
+/* */
+/* LZW-compressed stream support. */
+/* */
+/* Copyright 2004-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTLZW_H__
+#define __FTLZW_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* lzw */
+ /* */
+ /* <Title> */
+ /* LZW Streams */
+ /* */
+ /* <Abstract> */
+ /* Using LZW-compressed font files. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of LZW-specific functions. */
+ /* */
+ /*************************************************************************/
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Stream_OpenLZW
+ *
+ * @description:
+ * Open a new stream to parse LZW-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.Z' fonts that come
+ * with XFree86.
+ *
+ * @input:
+ * stream :: The target embedding stream.
+ *
+ * source :: The source stream.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source stream must be opened _before_ calling this function.
+ *
+ * Calling the internal function `FT_Stream_Close' on the new stream will
+ * *not* call `FT_Stream_Close' on the source stream. None of the stream
+ * objects will be released to the heap.
+ *
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream
+ *
+ * In certain builds of the library, LZW compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a LZW stream from it
+ * and re-open the face with it.
+ *
+ * This function may return `FT_Err_Unimplemented_Feature' if your build
+ * of FreeType was not compiled with LZW support.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stream_OpenLZW( FT_Stream stream,
+ FT_Stream source );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTLZW_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftmac.h b/src/3rdparty/freetype/include/freetype/ftmac.h
new file mode 100644
index 0000000000..14c55cfe2b
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftmac.h
@@ -0,0 +1,274 @@
+/***************************************************************************/
+/* */
+/* ftmac.h */
+/* */
+/* Additional Mac-specific API. */
+/* */
+/* Copyright 1996-2015 by */
+/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* NOTE: Include this file after FT_FREETYPE_H and after any */
+/* Mac-specific headers (because this header uses Mac types such as */
+/* Handle, FSSpec, FSRef, etc.) */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMAC_H__
+#define __FTMAC_H__
+
+
+#include <ft2build.h>
+
+
+FT_BEGIN_HEADER
+
+
+/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
+#ifndef FT_DEPRECATED_ATTRIBUTE
+#if defined(__GNUC__) && \
+ ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
+#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
+#else
+#define FT_DEPRECATED_ATTRIBUTE
+#endif
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* mac_specific */
+ /* */
+ /* <Title> */
+ /* Mac Specific Interface */
+ /* */
+ /* <Abstract> */
+ /* Only available on the Macintosh. */
+ /* */
+ /* <Description> */
+ /* The following definitions are only available if FreeType is */
+ /* compiled on a Macintosh. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face_From_FOND */
+ /* */
+ /* <Description> */
+ /* Create a new face object from a FOND resource. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* fond :: A FOND resource. */
+ /* */
+ /* face_index :: Only supported for the -1 `sanity check' special */
+ /* case. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Notes> */
+ /* This function can be used to create @FT_Face objects from fonts */
+ /* that are installed in the system as follows. */
+ /* */
+ /* { */
+ /* fond = GetResource( 'FOND', fontName ); */
+ /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
+ /* } */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face_From_FOND( FT_Library library,
+ Handle fond,
+ FT_Long face_index,
+ FT_Face *aface )
+ FT_DEPRECATED_ATTRIBUTE;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_GetFile_From_Mac_Name */
+ /* */
+ /* <Description> */
+ /* Return an FSSpec for the disk file containing the named font. */
+ /* */
+ /* <Input> */
+ /* fontName :: Mac OS name of the font (e.g., Times New Roman */
+ /* Bold). */
+ /* */
+ /* <Output> */
+ /* pathSpec :: FSSpec to the file. For passing to */
+ /* @FT_New_Face_From_FSSpec. */
+ /* */
+ /* face_index :: Index of the face. For passing to */
+ /* @FT_New_Face_From_FSSpec. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_GetFile_From_Mac_Name( const char* fontName,
+ FSSpec* pathSpec,
+ FT_Long* face_index )
+ FT_DEPRECATED_ATTRIBUTE;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_GetFile_From_Mac_ATS_Name */
+ /* */
+ /* <Description> */
+ /* Return an FSSpec for the disk file containing the named font. */
+ /* */
+ /* <Input> */
+ /* fontName :: Mac OS name of the font in ATS framework. */
+ /* */
+ /* <Output> */
+ /* pathSpec :: FSSpec to the file. For passing to */
+ /* @FT_New_Face_From_FSSpec. */
+ /* */
+ /* face_index :: Index of the face. For passing to */
+ /* @FT_New_Face_From_FSSpec. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_GetFile_From_Mac_ATS_Name( const char* fontName,
+ FSSpec* pathSpec,
+ FT_Long* face_index )
+ FT_DEPRECATED_ATTRIBUTE;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_GetFilePath_From_Mac_ATS_Name */
+ /* */
+ /* <Description> */
+ /* Return a pathname of the disk file and face index for given font */
+ /* name that is handled by ATS framework. */
+ /* */
+ /* <Input> */
+ /* fontName :: Mac OS name of the font in ATS framework. */
+ /* */
+ /* <Output> */
+ /* path :: Buffer to store pathname of the file. For passing */
+ /* to @FT_New_Face. The client must allocate this */
+ /* buffer before calling this function. */
+ /* */
+ /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
+ /* */
+ /* face_index :: Index of the face. For passing to @FT_New_Face. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
+ UInt8* path,
+ UInt32 maxPathSize,
+ FT_Long* face_index )
+ FT_DEPRECATED_ATTRIBUTE;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face_From_FSSpec */
+ /* */
+ /* <Description> */
+ /* Create a new face object from a given resource and typeface index */
+ /* using an FSSpec to the font file. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* spec :: FSSpec to the font file. */
+ /* */
+ /* face_index :: The index of the face within the resource. The */
+ /* first face has index~0. */
+ /* <Output> */
+ /* aface :: A handle to a new face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
+ /* it accepts an FSSpec instead of a path. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face_From_FSSpec( FT_Library library,
+ const FSSpec *spec,
+ FT_Long face_index,
+ FT_Face *aface )
+ FT_DEPRECATED_ATTRIBUTE;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face_From_FSRef */
+ /* */
+ /* <Description> */
+ /* Create a new face object from a given resource and typeface index */
+ /* using an FSRef to the font file. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* spec :: FSRef to the font file. */
+ /* */
+ /* face_index :: The index of the face within the resource. The */
+ /* first face has index~0. */
+ /* <Output> */
+ /* aface :: A handle to a new face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
+ /* it accepts an FSRef instead of a path. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face_From_FSRef( FT_Library library,
+ const FSRef *ref,
+ FT_Long face_index,
+ FT_Face *aface )
+ FT_DEPRECATED_ATTRIBUTE;
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTMAC_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftmm.h b/src/3rdparty/freetype/include/freetype/ftmm.h
new file mode 100644
index 0000000000..6ef47987e6
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftmm.h
@@ -0,0 +1,379 @@
+/***************************************************************************/
+/* */
+/* ftmm.h */
+/* */
+/* FreeType Multiple Master font interface (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMM_H__
+#define __FTMM_H__
+
+
+#include <ft2build.h>
+#include FT_TYPE1_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* multiple_masters */
+ /* */
+ /* <Title> */
+ /* Multiple Masters */
+ /* */
+ /* <Abstract> */
+ /* How to manage Multiple Masters fonts. */
+ /* */
+ /* <Description> */
+ /* The following types and functions are used to manage Multiple */
+ /* Master fonts, i.e., the selection of specific design instances by */
+ /* setting design axis coordinates. */
+ /* */
+ /* George Williams has extended this interface to make it work with */
+ /* both Type~1 Multiple Masters fonts and GX distortable (var) */
+ /* fonts. Some of these routines only work with MM fonts, others */
+ /* will work with both types. They are similar enough that a */
+ /* consistent interface makes sense. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_MM_Axis */
+ /* */
+ /* <Description> */
+ /* A simple structure used to model a given axis in design space for */
+ /* Multiple Masters fonts. */
+ /* */
+ /* This structure can't be used for GX var fonts. */
+ /* */
+ /* <Fields> */
+ /* name :: The axis's name. */
+ /* */
+ /* minimum :: The axis's minimum design coordinate. */
+ /* */
+ /* maximum :: The axis's maximum design coordinate. */
+ /* */
+ typedef struct FT_MM_Axis_
+ {
+ FT_String* name;
+ FT_Long minimum;
+ FT_Long maximum;
+
+ } FT_MM_Axis;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Multi_Master */
+ /* */
+ /* <Description> */
+ /* A structure used to model the axes and space of a Multiple Masters */
+ /* font. */
+ /* */
+ /* This structure can't be used for GX var fonts. */
+ /* */
+ /* <Fields> */
+ /* num_axis :: Number of axes. Cannot exceed~4. */
+ /* */
+ /* num_designs :: Number of designs; should be normally 2^num_axis */
+ /* even though the Type~1 specification strangely */
+ /* allows for intermediate designs to be present. */
+ /* This number cannot exceed~16. */
+ /* */
+ /* axis :: A table of axis descriptors. */
+ /* */
+ typedef struct FT_Multi_Master_
+ {
+ FT_UInt num_axis;
+ FT_UInt num_designs;
+ FT_MM_Axis axis[T1_MAX_MM_AXIS];
+
+ } FT_Multi_Master;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Var_Axis */
+ /* */
+ /* <Description> */
+ /* A simple structure used to model a given axis in design space for */
+ /* Multiple Masters and GX var fonts. */
+ /* */
+ /* <Fields> */
+ /* name :: The axis's name. */
+ /* Not always meaningful for GX. */
+ /* */
+ /* minimum :: The axis's minimum design coordinate. */
+ /* */
+ /* def :: The axis's default design coordinate. */
+ /* FreeType computes meaningful default values for MM; it */
+ /* is then an integer value, not in 16.16 format. */
+ /* */
+ /* maximum :: The axis's maximum design coordinate. */
+ /* */
+ /* tag :: The axis's tag (the GX equivalent to `name'). */
+ /* FreeType provides default values for MM if possible. */
+ /* */
+ /* strid :: The entry in `name' table (another GX version of */
+ /* `name'). */
+ /* Not meaningful for MM. */
+ /* */
+ typedef struct FT_Var_Axis_
+ {
+ FT_String* name;
+
+ FT_Fixed minimum;
+ FT_Fixed def;
+ FT_Fixed maximum;
+
+ FT_ULong tag;
+ FT_UInt strid;
+
+ } FT_Var_Axis;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Var_Named_Style */
+ /* */
+ /* <Description> */
+ /* A simple structure used to model a named style in a GX var font. */
+ /* */
+ /* This structure can't be used for MM fonts. */
+ /* */
+ /* <Fields> */
+ /* coords :: The design coordinates for this style. */
+ /* This is an array with one entry for each axis. */
+ /* */
+ /* strid :: The entry in `name' table identifying this style. */
+ /* */
+ typedef struct FT_Var_Named_Style_
+ {
+ FT_Fixed* coords;
+ FT_UInt strid;
+
+ } FT_Var_Named_Style;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_MM_Var */
+ /* */
+ /* <Description> */
+ /* A structure used to model the axes and space of a Multiple Masters */
+ /* or GX var distortable font. */
+ /* */
+ /* Some fields are specific to one format and not to the other. */
+ /* */
+ /* <Fields> */
+ /* num_axis :: The number of axes. The maximum value is~4 for */
+ /* MM; no limit in GX. */
+ /* */
+ /* num_designs :: The number of designs; should be normally */
+ /* 2^num_axis for MM fonts. Not meaningful for GX */
+ /* (where every glyph could have a different */
+ /* number of designs). */
+ /* */
+ /* num_namedstyles :: The number of named styles; only meaningful for */
+ /* GX that allows certain design coordinates to */
+ /* have a string ID (in the `name' table) */
+ /* associated with them. The font can tell the */
+ /* user that, for example, Weight=1.5 is `Bold'. */
+ /* */
+ /* axis :: An axis descriptor table. */
+ /* GX fonts contain slightly more data than MM. */
+ /* */
+ /* namedstyle :: A named style table. */
+ /* Only meaningful with GX. */
+ /* */
+ typedef struct FT_MM_Var_
+ {
+ FT_UInt num_axis;
+ FT_UInt num_designs;
+ FT_UInt num_namedstyles;
+ FT_Var_Axis* axis;
+ FT_Var_Named_Style* namedstyle;
+
+ } FT_MM_Var;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Multi_Master */
+ /* */
+ /* <Description> */
+ /* Retrieve the Multiple Master descriptor of a given font. */
+ /* */
+ /* This function can't be used with GX fonts. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Output> */
+ /* amaster :: The Multiple Masters descriptor. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Multi_Master( FT_Face face,
+ FT_Multi_Master *amaster );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_MM_Var */
+ /* */
+ /* <Description> */
+ /* Retrieve the Multiple Master/GX var descriptor of a given font. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Output> */
+ /* amaster :: The Multiple Masters/GX var descriptor. */
+ /* Allocates a data structure, which the user must free. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_MM_Var( FT_Face face,
+ FT_MM_Var* *amaster );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_MM_Design_Coordinates */
+ /* */
+ /* <Description> */
+ /* For Multiple Masters fonts, choose an interpolated font design */
+ /* through design coordinates. */
+ /* */
+ /* This function can't be used with GX fonts. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of available design coordinates. If it */
+ /* is larger than the number of axes, ignore the excess */
+ /* values. If it is smaller than the number of axes, */
+ /* use default values for the remaining axes. */
+ /* */
+ /* coords :: An array of design coordinates. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_MM_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Var_Design_Coordinates */
+ /* */
+ /* <Description> */
+ /* For Multiple Master or GX Var fonts, choose an interpolated font */
+ /* design through design coordinates. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of available design coordinates. If it */
+ /* is larger than the number of axes, ignore the excess */
+ /* values. If it is smaller than the number of axes, */
+ /* use default values for the remaining axes. */
+ /* */
+ /* coords :: An array of design coordinates. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Var_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_MM_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* For Multiple Masters and GX var fonts, choose an interpolated font */
+ /* design through normalized blend coordinates. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of available design coordinates. If it */
+ /* is larger than the number of axes, ignore the excess */
+ /* values. If it is smaller than the number of axes, */
+ /* use default values for the remaining axes. */
+ /* */
+ /* coords :: The design coordinates array (each element must be */
+ /* between 0 and 1.0). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_MM_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Var_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* This is another name of @FT_Set_MM_Blend_Coordinates. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Var_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTMM_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftmodapi.h b/src/3rdparty/freetype/include/freetype/ftmodapi.h
new file mode 100644
index 0000000000..544279a68a
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftmodapi.h
@@ -0,0 +1,669 @@
+/***************************************************************************/
+/* */
+/* ftmodapi.h */
+/* */
+/* FreeType modules public interface (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMODAPI_H__
+#define __FTMODAPI_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* module_management */
+ /* */
+ /* <Title> */
+ /* Module Management */
+ /* */
+ /* <Abstract> */
+ /* How to add, upgrade, remove, and control modules from FreeType. */
+ /* */
+ /* <Description> */
+ /* The definitions below are used to manage modules within FreeType. */
+ /* Modules can be added, upgraded, and removed at runtime. */
+ /* Additionally, some module properties can be controlled also. */
+ /* */
+ /* Here is a list of possible values of the `module_name' field in */
+ /* the @FT_Module_Class structure. */
+ /* */
+ /* { */
+ /* autofitter */
+ /* bdf */
+ /* cff */
+ /* gxvalid */
+ /* otvalid */
+ /* pcf */
+ /* pfr */
+ /* psaux */
+ /* pshinter */
+ /* psnames */
+ /* raster1 */
+ /* sfnt */
+ /* smooth, smooth-lcd, smooth-lcdv */
+ /* truetype */
+ /* type1 */
+ /* type42 */
+ /* t1cid */
+ /* winfonts */
+ /* } */
+ /* */
+ /* Note that the FreeType Cache sub-system is not a FreeType module. */
+ /* */
+ /* <Order> */
+ /* FT_Module */
+ /* FT_Module_Constructor */
+ /* FT_Module_Destructor */
+ /* FT_Module_Requester */
+ /* FT_Module_Class */
+ /* */
+ /* FT_Add_Module */
+ /* FT_Get_Module */
+ /* FT_Remove_Module */
+ /* FT_Add_Default_Modules */
+ /* */
+ /* FT_Property_Set */
+ /* FT_Property_Get */
+ /* */
+ /* FT_New_Library */
+ /* FT_Done_Library */
+ /* FT_Reference_Library */
+ /* */
+ /* FT_Renderer */
+ /* FT_Renderer_Class */
+ /* */
+ /* FT_Get_Renderer */
+ /* FT_Set_Renderer */
+ /* */
+ /* FT_Set_Debug_Hook */
+ /* */
+ /*************************************************************************/
+
+
+ /* module bit flags */
+#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
+#define FT_MODULE_RENDERER 2 /* this module is a renderer */
+#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
+#define FT_MODULE_STYLER 8 /* this module is a styler */
+
+#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
+ /* scalable fonts */
+#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
+ /* support vector outlines */
+#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
+ /* own hinter */
+
+
+ /* deprecated values */
+#define ft_module_font_driver FT_MODULE_FONT_DRIVER
+#define ft_module_renderer FT_MODULE_RENDERER
+#define ft_module_hinter FT_MODULE_HINTER
+#define ft_module_styler FT_MODULE_STYLER
+
+#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
+#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
+#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
+
+
+ typedef FT_Pointer FT_Module_Interface;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Module_Constructor */
+ /* */
+ /* <Description> */
+ /* A function used to initialize (not create) a new module object. */
+ /* */
+ /* <Input> */
+ /* module :: The module to initialize. */
+ /* */
+ typedef FT_Error
+ (*FT_Module_Constructor)( FT_Module module );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Module_Destructor */
+ /* */
+ /* <Description> */
+ /* A function used to finalize (not destroy) a given module object. */
+ /* */
+ /* <Input> */
+ /* module :: The module to finalize. */
+ /* */
+ typedef void
+ (*FT_Module_Destructor)( FT_Module module );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Module_Requester */
+ /* */
+ /* <Description> */
+ /* A function used to query a given module for a specific interface. */
+ /* */
+ /* <Input> */
+ /* module :: The module to be searched. */
+ /* */
+ /* name :: The name of the interface in the module. */
+ /* */
+ typedef FT_Module_Interface
+ (*FT_Module_Requester)( FT_Module module,
+ const char* name );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Module_Class */
+ /* */
+ /* <Description> */
+ /* The module class descriptor. */
+ /* */
+ /* <Fields> */
+ /* module_flags :: Bit flags describing the module. */
+ /* */
+ /* module_size :: The size of one module object/instance in */
+ /* bytes. */
+ /* */
+ /* module_name :: The name of the module. */
+ /* */
+ /* module_version :: The version, as a 16.16 fixed number */
+ /* (major.minor). */
+ /* */
+ /* module_requires :: The version of FreeType this module requires, */
+ /* as a 16.16 fixed number (major.minor). Starts */
+ /* at version 2.0, i.e., 0x20000. */
+ /* */
+ /* module_init :: The initializing function. */
+ /* */
+ /* module_done :: The finalizing function. */
+ /* */
+ /* get_interface :: The interface requesting function. */
+ /* */
+ typedef struct FT_Module_Class_
+ {
+ FT_ULong module_flags;
+ FT_Long module_size;
+ const FT_String* module_name;
+ FT_Fixed module_version;
+ FT_Fixed module_requires;
+
+ const void* module_interface;
+
+ FT_Module_Constructor module_init;
+ FT_Module_Destructor module_done;
+ FT_Module_Requester get_interface;
+
+ } FT_Module_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Add_Module */
+ /* */
+ /* <Description> */
+ /* Add a new module to a given library instance. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* <Input> */
+ /* clazz :: A pointer to class descriptor for the module. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* An error will be returned if a module already exists by that name, */
+ /* or if the module requires a version of FreeType that is too great. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Add_Module( FT_Library library,
+ const FT_Module_Class* clazz );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Module */
+ /* */
+ /* <Description> */
+ /* Find a module by its name. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* module_name :: The module's name (as an ASCII string). */
+ /* */
+ /* <Return> */
+ /* A module handle. 0~if none was found. */
+ /* */
+ /* <Note> */
+ /* FreeType's internal modules aren't documented very well, and you */
+ /* should look up the source code for details. */
+ /* */
+ FT_EXPORT( FT_Module )
+ FT_Get_Module( FT_Library library,
+ const char* module_name );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Remove_Module */
+ /* */
+ /* <Description> */
+ /* Remove a given module from a library instance. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to a library object. */
+ /* */
+ /* <Input> */
+ /* module :: A handle to a module object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The module object is destroyed by the function in case of success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Remove_Module( FT_Library library,
+ FT_Module module );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Property_Set
+ *
+ * @description:
+ * Set a property for a given module.
+ *
+ * @input:
+ * library ::
+ * A handle to the library the module is part of.
+ *
+ * module_name ::
+ * The module name.
+ *
+ * property_name ::
+ * The property name. Properties are described in the `Synopsis'
+ * subsection of the module's documentation.
+ *
+ * Note that only a few modules have properties.
+ *
+ * value ::
+ * A generic pointer to a variable or structure that gives the new
+ * value of the property. The exact definition of `value' is
+ * dependent on the property; see the `Synopsis' subsection of the
+ * module's documentation.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If `module_name' isn't a valid module name, or `property_name'
+ * doesn't specify a valid property, or if `value' doesn't represent a
+ * valid value for the given property, an error is returned.
+ *
+ * The following example sets property `bar' (a simple integer) in
+ * module `foo' to value~1.
+ *
+ * {
+ * FT_UInt bar;
+ *
+ *
+ * bar = 1;
+ * FT_Property_Set( library, "foo", "bar", &bar );
+ * }
+ *
+ * Note that the FreeType Cache sub-system doesn't recognize module
+ * property changes. To avoid glyph lookup confusion within the cache
+ * you should call @FTC_Manager_Reset to completely flush the cache if
+ * a module property gets changed after @FTC_Manager_New has been
+ * called.
+ *
+ * It is not possible to set properties of the FreeType Cache
+ * sub-system itself with FT_Property_Set; use @FTC_Property_Set
+ * instead.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Property_Set( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ const void* value );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Property_Get
+ *
+ * @description:
+ * Get a module's property value.
+ *
+ * @input:
+ * library ::
+ * A handle to the library the module is part of.
+ *
+ * module_name ::
+ * The module name.
+ *
+ * property_name ::
+ * The property name. Properties are described in the `Synopsis'
+ * subsection of the module's documentation.
+ *
+ * @inout:
+ * value ::
+ * A generic pointer to a variable or structure that gives the
+ * value of the property. The exact definition of `value' is
+ * dependent on the property; see the `Synopsis' subsection of the
+ * module's documentation.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If `module_name' isn't a valid module name, or `property_name'
+ * doesn't specify a valid property, or if `value' doesn't represent a
+ * valid value for the given property, an error is returned.
+ *
+ * The following example gets property `baz' (a range) in module `foo'.
+ *
+ * {
+ * typedef range_
+ * {
+ * FT_Int32 min;
+ * FT_Int32 max;
+ *
+ * } range;
+ *
+ * range baz;
+ *
+ *
+ * FT_Property_Get( library, "foo", "baz", &baz );
+ * }
+ *
+ * It is not possible to retrieve properties of the FreeType Cache
+ * sub-system with FT_Property_Get; use @FTC_Property_Get instead.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Property_Get( FT_Library library,
+ const FT_String* module_name,
+ const FT_String* property_name,
+ void* value );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Reference_Library */
+ /* */
+ /* <Description> */
+ /* A counter gets initialized to~1 at the time an @FT_Library */
+ /* structure is created. This function increments the counter. */
+ /* @FT_Done_Library then only destroys a library if the counter is~1, */
+ /* otherwise it simply decrements the counter. */
+ /* */
+ /* This function helps in managing life-cycles of structures that */
+ /* reference @FT_Library objects. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a target library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Since> */
+ /* 2.4.2 */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Reference_Library( FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Library */
+ /* */
+ /* <Description> */
+ /* This function is used to create a new FreeType library instance */
+ /* from a given memory object. It is thus possible to use libraries */
+ /* with distinct memory allocators within the same program. Note, */
+ /* however, that the used @FT_Memory structure is expected to remain */
+ /* valid for the life of the @FT_Library object. */
+ /* */
+ /* Normally, you would call this function (followed by a call to */
+ /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
+ /* instead of @FT_Init_FreeType to initialize the FreeType library. */
+ /* */
+ /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
+ /* library instance. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the original memory object. */
+ /* */
+ /* <Output> */
+ /* alibrary :: A pointer to handle of a new library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* See the discussion of reference counters in the description of */
+ /* @FT_Reference_Library. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Library( FT_Memory memory,
+ FT_Library *alibrary );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Library */
+ /* */
+ /* <Description> */
+ /* Discard a given library object. This closes all drivers and */
+ /* discards all resource objects. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the target library. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* See the discussion of reference counters in the description of */
+ /* @FT_Reference_Library. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_Library( FT_Library library );
+
+ /* */
+
+ typedef void
+ (*FT_DebugHook_Func)( void* arg );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Debug_Hook */
+ /* */
+ /* <Description> */
+ /* Set a debug hook function for debugging the interpreter of a font */
+ /* format. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* <Input> */
+ /* hook_index :: The index of the debug hook. You should use the */
+ /* values defined in `ftobjs.h', e.g., */
+ /* `FT_DEBUG_HOOK_TRUETYPE'. */
+ /* */
+ /* debug_hook :: The function used to debug the interpreter. */
+ /* */
+ /* <Note> */
+ /* Currently, four debug hook slots are available, but only two (for */
+ /* the TrueType and the Type~1 interpreter) are defined. */
+ /* */
+ /* Since the internal headers of FreeType are no longer installed, */
+ /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
+ /* This is a bug and will be fixed in a forthcoming release. */
+ /* */
+ FT_EXPORT( void )
+ FT_Set_Debug_Hook( FT_Library library,
+ FT_UInt hook_index,
+ FT_DebugHook_Func debug_hook );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Add_Default_Modules */
+ /* */
+ /* <Description> */
+ /* Add the set of default drivers to a given library object. */
+ /* This is only useful when you create a library object with */
+ /* @FT_New_Library (usually to plug a custom memory manager). */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to a new library object. */
+ /* */
+ FT_EXPORT( void )
+ FT_Add_Default_Modules( FT_Library library );
+
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * truetype_engine
+ *
+ * @title:
+ * The TrueType Engine
+ *
+ * @abstract:
+ * TrueType bytecode support.
+ *
+ * @description:
+ * This section contains a function used to query the level of TrueType
+ * bytecode support compiled in this version of the library.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_TrueTypeEngineType
+ *
+ * @description:
+ * A list of values describing which kind of TrueType bytecode
+ * engine is implemented in a given FT_Library instance. It is used
+ * by the @FT_Get_TrueType_Engine_Type function.
+ *
+ * @values:
+ * FT_TRUETYPE_ENGINE_TYPE_NONE ::
+ * The library doesn't implement any kind of bytecode interpreter.
+ *
+ * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
+ * The library implements a bytecode interpreter that doesn't
+ * support the patented operations of the TrueType virtual machine.
+ *
+ * Its main use is to load certain Asian fonts that position and
+ * scale glyph components with bytecode instructions. It produces
+ * bad output for most other fonts.
+ *
+ * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
+ * The library implements a bytecode interpreter that covers
+ * the full instruction set of the TrueType virtual machine (this
+ * was governed by patents until May 2010, hence the name).
+ *
+ * @since:
+ * 2.2
+ *
+ */
+ typedef enum FT_TrueTypeEngineType_
+ {
+ FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
+ FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
+ FT_TRUETYPE_ENGINE_TYPE_PATENTED
+
+ } FT_TrueTypeEngineType;
+
+
+ /**************************************************************************
+ *
+ * @func:
+ * FT_Get_TrueType_Engine_Type
+ *
+ * @description:
+ * Return an @FT_TrueTypeEngineType value to indicate which level of
+ * the TrueType virtual machine a given library instance supports.
+ *
+ * @input:
+ * library ::
+ * A library instance.
+ *
+ * @return:
+ * A value indicating which level is supported.
+ *
+ * @since:
+ * 2.2
+ *
+ */
+ FT_EXPORT( FT_TrueTypeEngineType )
+ FT_Get_TrueType_Engine_Type( FT_Library library );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTMODAPI_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftmoderr.h b/src/3rdparty/freetype/include/freetype/ftmoderr.h
new file mode 100644
index 0000000000..9d7f981409
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftmoderr.h
@@ -0,0 +1,194 @@
+/***************************************************************************/
+/* */
+/* ftmoderr.h */
+/* */
+/* FreeType module error offsets (specification). */
+/* */
+/* Copyright 2001-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file is used to define the FreeType module error codes. */
+ /* */
+ /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
+ /* set, the lower byte of an error value identifies the error code as */
+ /* usual. In addition, the higher byte identifies the module. For */
+ /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
+ /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
+ /* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
+ /* */
+ /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
+ /* including the high byte. */
+ /* */
+ /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
+ /* an error value is set to zero. */
+ /* */
+ /* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
+ /* provides some macros in `fttypes.h'. */
+ /* */
+ /* FT_ERR( err ) */
+ /* Add current error module prefix (as defined with the */
+ /* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
+ /* the line */
+ /* */
+ /* error = FT_ERR( Invalid_Outline ); */
+ /* */
+ /* expands to */
+ /* */
+ /* error = BDF_Err_Invalid_Outline; */
+ /* */
+ /* For simplicity, you can always use `FT_Err_Ok' directly instead */
+ /* of `FT_ERR( Ok )'. */
+ /* */
+ /* FT_ERR_EQ( errcode, err ) */
+ /* FT_ERR_NEQ( errcode, err ) */
+ /* Compare error code `errcode' with the error `err' for equality */
+ /* and inequality, respectively. Example: */
+ /* */
+ /* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
+ /* ... */
+ /* */
+ /* Using this macro you don't have to think about error prefixes. */
+ /* Of course, if module errors are not active, the above example is */
+ /* the same as */
+ /* */
+ /* if ( error == FT_Err_Invalid_Outline ) */
+ /* ... */
+ /* */
+ /* FT_ERROR_BASE( errcode ) */
+ /* FT_ERROR_MODULE( errcode ) */
+ /* Get base error and module error code, respectively. */
+ /* */
+ /* */
+ /* It can also be used to create a module error message table easily */
+ /* with something like */
+ /* */
+ /* { */
+ /* #undef __FTMODERR_H__ */
+ /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
+ /* #define FT_MODERR_START_LIST { */
+ /* #define FT_MODERR_END_LIST { 0, 0 } }; */
+ /* */
+ /* const struct */
+ /* { */
+ /* int mod_err_offset; */
+ /* const char* mod_err_msg */
+ /* } ft_mod_errors[] = */
+ /* */
+ /* #include FT_MODULE_ERRORS_H */
+ /* } */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTMODERR_H__
+#define __FTMODERR_H__
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** SETUP MACROS *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#undef FT_NEED_EXTERN_C
+
+#ifndef FT_MODERRDEF
+
+#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
+#else
+#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
+#endif
+
+#define FT_MODERR_START_LIST enum {
+#define FT_MODERR_END_LIST FT_Mod_Err_Max };
+
+#ifdef __cplusplus
+#define FT_NEED_EXTERN_C
+ extern "C" {
+#endif
+
+#endif /* !FT_MODERRDEF */
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** LIST MODULE ERROR BASES *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#ifdef FT_MODERR_START_LIST
+ FT_MODERR_START_LIST
+#endif
+
+
+ FT_MODERRDEF( Base, 0x000, "base module" )
+ FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
+ FT_MODERRDEF( BDF, 0x200, "BDF module" )
+ FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
+ FT_MODERRDEF( Cache, 0x400, "cache module" )
+ FT_MODERRDEF( CFF, 0x500, "CFF module" )
+ FT_MODERRDEF( CID, 0x600, "CID module" )
+ FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
+ FT_MODERRDEF( LZW, 0x800, "LZW module" )
+ FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
+ FT_MODERRDEF( PCF, 0xA00, "PCF module" )
+ FT_MODERRDEF( PFR, 0xB00, "PFR module" )
+ FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
+ FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
+ FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
+ FT_MODERRDEF( Raster, 0xF00, "raster module" )
+ FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
+ FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
+ FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
+ FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
+ FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
+ FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
+ FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
+
+
+#ifdef FT_MODERR_END_LIST
+ FT_MODERR_END_LIST
+#endif
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** CLEANUP *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#ifdef FT_NEED_EXTERN_C
+ }
+#endif
+
+#undef FT_MODERR_START_LIST
+#undef FT_MODERR_END_LIST
+#undef FT_MODERRDEF
+#undef FT_NEED_EXTERN_C
+
+
+#endif /* __FTMODERR_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftotval.h b/src/3rdparty/freetype/include/freetype/ftotval.h
new file mode 100644
index 0000000000..e744b713fb
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftotval.h
@@ -0,0 +1,204 @@
+/***************************************************************************/
+/* */
+/* ftotval.h */
+/* */
+/* FreeType API for validating OpenType tables (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* */
+/* Warning: This module might be moved to a different library in the */
+/* future to avoid a tight dependency between FreeType and the */
+/* OpenType specification. */
+/* */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTOTVAL_H__
+#define __FTOTVAL_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* ot_validation */
+ /* */
+ /* <Title> */
+ /* OpenType Validation */
+ /* */
+ /* <Abstract> */
+ /* An API to validate OpenType tables. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of functions to validate */
+ /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
+ /* */
+ /* <Order> */
+ /* FT_OpenType_Validate */
+ /* FT_OpenType_Free */
+ /* */
+ /* FT_VALIDATE_OTXXX */
+ /* */
+ /*************************************************************************/
+
+
+ /**********************************************************************
+ *
+ * @enum:
+ * FT_VALIDATE_OTXXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_OpenType_Validate to
+ * indicate which OpenType tables should be validated.
+ *
+ * @values:
+ * FT_VALIDATE_BASE ::
+ * Validate BASE table.
+ *
+ * FT_VALIDATE_GDEF ::
+ * Validate GDEF table.
+ *
+ * FT_VALIDATE_GPOS ::
+ * Validate GPOS table.
+ *
+ * FT_VALIDATE_GSUB ::
+ * Validate GSUB table.
+ *
+ * FT_VALIDATE_JSTF ::
+ * Validate JSTF table.
+ *
+ * FT_VALIDATE_MATH ::
+ * Validate MATH table.
+ *
+ * FT_VALIDATE_OT ::
+ * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
+ *
+ */
+#define FT_VALIDATE_BASE 0x0100
+#define FT_VALIDATE_GDEF 0x0200
+#define FT_VALIDATE_GPOS 0x0400
+#define FT_VALIDATE_GSUB 0x0800
+#define FT_VALIDATE_JSTF 0x1000
+#define FT_VALIDATE_MATH 0x2000
+
+#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
+ FT_VALIDATE_GDEF | \
+ FT_VALIDATE_GPOS | \
+ FT_VALIDATE_GSUB | \
+ FT_VALIDATE_JSTF | \
+ FT_VALIDATE_MATH
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_OpenType_Validate
+ *
+ * @description:
+ * Validate various OpenType tables to assure that all offsets and
+ * indices are valid. The idea is that a higher-level library that
+ * actually does the text layout can access those tables without
+ * error checking (which can be quite time consuming).
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * validation_flags ::
+ * A bit field that specifies the tables to be validated. See
+ * @FT_VALIDATE_OTXXX for possible values.
+ *
+ * @output:
+ * BASE_table ::
+ * A pointer to the BASE table.
+ *
+ * GDEF_table ::
+ * A pointer to the GDEF table.
+ *
+ * GPOS_table ::
+ * A pointer to the GPOS table.
+ *
+ * GSUB_table ::
+ * A pointer to the GSUB table.
+ *
+ * JSTF_table ::
+ * A pointer to the JSTF table.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with OpenType fonts, returning an error
+ * otherwise.
+ *
+ * After use, the application should deallocate the five tables with
+ * @FT_OpenType_Free. A NULL value indicates that the table either
+ * doesn't exist in the font, or the application hasn't asked for
+ * validation.
+ */
+ FT_EXPORT( FT_Error )
+ FT_OpenType_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes *BASE_table,
+ FT_Bytes *GDEF_table,
+ FT_Bytes *GPOS_table,
+ FT_Bytes *GSUB_table,
+ FT_Bytes *JSTF_table );
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_OpenType_Free
+ *
+ * @description:
+ * Free the buffer allocated by OpenType validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer that is allocated by
+ * @FT_OpenType_Validate.
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * @FT_OpenType_Validate only.
+ */
+ FT_EXPORT( void )
+ FT_OpenType_Free( FT_Face face,
+ FT_Bytes table );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTOTVAL_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftoutln.h b/src/3rdparty/freetype/include/freetype/ftoutln.h
new file mode 100644
index 0000000000..b6ec70de8c
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftoutln.h
@@ -0,0 +1,574 @@
+/***************************************************************************/
+/* */
+/* ftoutln.h */
+/* */
+/* Support for the FT_Outline type used to store glyph shapes of */
+/* most scalable font formats (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTOUTLN_H__
+#define __FTOUTLN_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /* <Title> */
+ /* Outline Processing */
+ /* */
+ /* <Abstract> */
+ /* Functions to create, transform, and render vectorial glyph images. */
+ /* */
+ /* <Description> */
+ /* This section contains routines used to create and destroy scalable */
+ /* glyph images known as `outlines'. These can also be measured, */
+ /* transformed, and converted into bitmaps and pixmaps. */
+ /* */
+ /* <Order> */
+ /* FT_Outline */
+ /* FT_Outline_New */
+ /* FT_Outline_Done */
+ /* FT_Outline_Copy */
+ /* FT_Outline_Translate */
+ /* FT_Outline_Transform */
+ /* FT_Outline_Embolden */
+ /* FT_Outline_EmboldenXY */
+ /* FT_Outline_Reverse */
+ /* FT_Outline_Check */
+ /* */
+ /* FT_Outline_Get_CBox */
+ /* FT_Outline_Get_BBox */
+ /* */
+ /* FT_Outline_Get_Bitmap */
+ /* FT_Outline_Render */
+ /* FT_Outline_Decompose */
+ /* FT_Outline_Funcs */
+ /* FT_Outline_MoveToFunc */
+ /* FT_Outline_LineToFunc */
+ /* FT_Outline_ConicToFunc */
+ /* FT_Outline_CubicToFunc */
+ /* */
+ /* FT_Orientation */
+ /* FT_Outline_Get_Orientation */
+ /* */
+ /* FT_OUTLINE_XXX */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Decompose */
+ /* */
+ /* <Description> */
+ /* Walk over an outline's structure to decompose it into individual */
+ /* segments and Bézier arcs. This function also emits `move to' */
+ /* operations to indicate the start of new contours in the outline. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source target. */
+ /* */
+ /* func_interface :: A table of `emitters', i.e., function pointers */
+ /* called during decomposition to indicate path */
+ /* operations. */
+ /* */
+ /* <InOut> */
+ /* user :: A typeless pointer that is passed to each */
+ /* emitter during the decomposition. It can be */
+ /* used to store the state during the */
+ /* decomposition. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* A contour that contains a single point only is represented by a */
+ /* `move to' operation followed by `line to' to the same point. In */
+ /* most cases, it is best to filter this out before using the */
+ /* outline for stroking purposes (otherwise it would result in a */
+ /* visible dot when round caps are used). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Decompose( FT_Outline* outline,
+ const FT_Outline_Funcs* func_interface,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_New */
+ /* */
+ /* <Description> */
+ /* Create a new outline of a given size. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object from where the */
+ /* outline is allocated. Note however that the new */
+ /* outline will *not* necessarily be *freed*, when */
+ /* destroying the library, by @FT_Done_FreeType. */
+ /* */
+ /* numPoints :: The maximum number of points within the outline. */
+ /* Must be smaller than or equal to 0xFFFF (65535). */
+ /* */
+ /* numContours :: The maximum number of contours within the outline. */
+ /* This value must be in the range 0 to `numPoints'. */
+ /* */
+ /* <Output> */
+ /* anoutline :: A handle to the new outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a `library' parameter is simply */
+ /* to use the library's memory allocator. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_New( FT_Library library,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+ FT_EXPORT( FT_Error )
+ FT_Outline_New_Internal( FT_Memory memory,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Done */
+ /* */
+ /* <Description> */
+ /* Destroy an outline created with @FT_Outline_New. */
+ /* */
+ /* <Input> */
+ /* library :: A handle of the library object used to allocate the */
+ /* outline. */
+ /* */
+ /* outline :: A pointer to the outline object to be discarded. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* If the outline's `owner' field is not set, only the outline */
+ /* descriptor will be released. */
+ /* */
+ /* The reason why this function takes an `library' parameter is */
+ /* simply to use ft_mem_free(). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Done( FT_Library library,
+ FT_Outline* outline );
+
+
+ FT_EXPORT( FT_Error )
+ FT_Outline_Done_Internal( FT_Memory memory,
+ FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Check */
+ /* */
+ /* <Description> */
+ /* Check the contents of an outline descriptor. */
+ /* */
+ /* <Input> */
+ /* outline :: A handle to a source outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Check( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_CBox */
+ /* */
+ /* <Description> */
+ /* Return an outline's `control box'. The control box encloses all */
+ /* the outline's points, including Bézier control points. Though it */
+ /* coincides with the exact bounding box for most glyphs, it can be */
+ /* slightly larger in some situations (like when rotating an outline */
+ /* that contains Bézier outside arcs). */
+ /* */
+ /* Computing the control box is very fast, while getting the bounding */
+ /* box can take much more time as it needs to walk over all segments */
+ /* and arcs in the outline. To get the latter, you can use the */
+ /* `ftbbox' component, which is dedicated to this single task. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <Output> */
+ /* acbox :: The outline's control box. */
+ /* */
+ /* <Note> */
+ /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Get_CBox( const FT_Outline* outline,
+ FT_BBox *acbox );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Translate */
+ /* */
+ /* <Description> */
+ /* Apply a simple translation to the points of an outline. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Input> */
+ /* xOffset :: The horizontal offset. */
+ /* */
+ /* yOffset :: The vertical offset. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Translate( const FT_Outline* outline,
+ FT_Pos xOffset,
+ FT_Pos yOffset );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Copy */
+ /* */
+ /* <Description> */
+ /* Copy an outline into another one. Both objects must have the */
+ /* same sizes (number of points & number of contours) when this */
+ /* function is called. */
+ /* */
+ /* <Input> */
+ /* source :: A handle to the source outline. */
+ /* */
+ /* <Output> */
+ /* target :: A handle to the target outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Copy( const FT_Outline* source,
+ FT_Outline *target );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Transform */
+ /* */
+ /* <Description> */
+ /* Apply a simple 2x2 matrix to all of an outline's points. Useful */
+ /* for applying rotations, slanting, flipping, etc. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation matrix. */
+ /* */
+ /* <Note> */
+ /* You can use @FT_Outline_Translate if you need to translate the */
+ /* outline's points. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Transform( const FT_Outline* outline,
+ const FT_Matrix* matrix );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Embolden */
+ /* */
+ /* <Description> */
+ /* Embolden an outline. The new outline will be at most 4~times */
+ /* `strength' pixels wider and higher. You may think of the left and */
+ /* bottom borders as unchanged. */
+ /* */
+ /* Negative `strength' values to reduce the outline thickness are */
+ /* possible also. */
+ /* */
+ /* <InOut> */
+ /* outline :: A handle to the target outline. */
+ /* */
+ /* <Input> */
+ /* strength :: How strong the glyph is emboldened. Expressed in */
+ /* 26.6 pixel format. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The used algorithm to increase or decrease the thickness of the */
+ /* glyph doesn't change the number of points; this means that certain */
+ /* situations like acute angles or intersections are sometimes */
+ /* handled incorrectly. */
+ /* */
+ /* If you need `better' metrics values you should call */
+ /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */
+ /* */
+ /* Example call: */
+ /* */
+ /* { */
+ /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
+ /* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) */
+ /* FT_Outline_Embolden( &face->glyph->outline, strength ); */
+ /* } */
+ /* */
+ /* To get meaningful results, font scaling values must be set with */
+ /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Embolden( FT_Outline* outline,
+ FT_Pos strength );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_EmboldenXY */
+ /* */
+ /* <Description> */
+ /* Embolden an outline. The new outline will be `xstrength' pixels */
+ /* wider and `ystrength' pixels higher. Otherwise, it is similar to */
+ /* @FT_Outline_Embolden, which uses the same strength in both */
+ /* directions. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_EmboldenXY( FT_Outline* outline,
+ FT_Pos xstrength,
+ FT_Pos ystrength );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Reverse */
+ /* */
+ /* <Description> */
+ /* Reverse the drawing direction of an outline. This is used to */
+ /* ensure consistent fill conventions for mirrored glyphs. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Note> */
+ /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
+ /* the outline's `flags' field. */
+ /* */
+ /* It shouldn't be used by a normal client application, unless it */
+ /* knows what it is doing. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Reverse( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_Bitmap */
+ /* */
+ /* <Description> */
+ /* Render an outline within a bitmap. The outline's image is simply */
+ /* OR-ed to the target bitmap. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <InOut> */
+ /* abitmap :: A pointer to the target bitmap descriptor. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function does NOT CREATE the bitmap, it only renders an */
+ /* outline image within the one you pass to it! Consequently, the */
+ /* various fields in `abitmap' should be set accordingly. */
+ /* */
+ /* It will use the raster corresponding to the default glyph format. */
+ /* */
+ /* The value of the `num_grays' field in `abitmap' is ignored. If */
+ /* you select the gray-level rasterizer, and you want less than 256 */
+ /* gray levels, you have to use @FT_Outline_Render directly. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Get_Bitmap( FT_Library library,
+ FT_Outline* outline,
+ const FT_Bitmap *abitmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Render */
+ /* */
+ /* <Description> */
+ /* Render an outline within a bitmap using the current scan-convert. */
+ /* This function uses an @FT_Raster_Params structure as an argument, */
+ /* allowing advanced features like direct composition, translucency, */
+ /* etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <InOut> */
+ /* params :: A pointer to an @FT_Raster_Params structure used to */
+ /* describe the rendering operation. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* You should know what you are doing and how @FT_Raster_Params works */
+ /* to use this function. */
+ /* */
+ /* The field `params.source' will be set to `outline' before the scan */
+ /* converter is called, which means that the value you give to it is */
+ /* actually ignored. */
+ /* */
+ /* The gray-level rasterizer always uses 256 gray levels. If you */
+ /* want less gray levels, you have to provide your own span callback. */
+ /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */
+ /* @FT_Raster_Params structure for more details. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Render( FT_Library library,
+ FT_Outline* outline,
+ FT_Raster_Params* params );
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_Orientation
+ *
+ * @description:
+ * A list of values used to describe an outline's contour orientation.
+ *
+ * The TrueType and PostScript specifications use different conventions
+ * to determine whether outline contours should be filled or unfilled.
+ *
+ * @values:
+ * FT_ORIENTATION_TRUETYPE ::
+ * According to the TrueType specification, clockwise contours must
+ * be filled, and counter-clockwise ones must be unfilled.
+ *
+ * FT_ORIENTATION_POSTSCRIPT ::
+ * According to the PostScript specification, counter-clockwise contours
+ * must be filled, and clockwise ones must be unfilled.
+ *
+ * FT_ORIENTATION_FILL_RIGHT ::
+ * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
+ * remember that in TrueType, everything that is to the right of
+ * the drawing direction of a contour must be filled.
+ *
+ * FT_ORIENTATION_FILL_LEFT ::
+ * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
+ * remember that in PostScript, everything that is to the left of
+ * the drawing direction of a contour must be filled.
+ *
+ * FT_ORIENTATION_NONE ::
+ * The orientation cannot be determined. That is, different parts of
+ * the glyph have different orientation.
+ *
+ */
+ typedef enum FT_Orientation_
+ {
+ FT_ORIENTATION_TRUETYPE = 0,
+ FT_ORIENTATION_POSTSCRIPT = 1,
+ FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
+ FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
+ FT_ORIENTATION_NONE
+
+ } FT_Orientation;
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Outline_Get_Orientation
+ *
+ * @description:
+ * This function analyzes a glyph outline and tries to compute its
+ * fill orientation (see @FT_Orientation). This is done by integrating
+ * the total area covered by the outline. The positive integral
+ * corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT
+ * is returned. The negative integral corresponds to the counter-clockwise
+ * orientation and @FT_ORIENTATION_TRUETYPE is returned.
+ *
+ * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
+ * outlines.
+ *
+ * @input:
+ * outline ::
+ * A handle to the source outline.
+ *
+ * @return:
+ * The orientation.
+ *
+ */
+ FT_EXPORT( FT_Orientation )
+ FT_Outline_Get_Orientation( FT_Outline* outline );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTOUTLN_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
diff --git a/src/3rdparty/freetype/include/freetype/ftpfr.h b/src/3rdparty/freetype/include/freetype/ftpfr.h
new file mode 100644
index 0000000000..a1c02a2f5e
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftpfr.h
@@ -0,0 +1,172 @@
+/***************************************************************************/
+/* */
+/* ftpfr.h */
+/* */
+/* FreeType API for accessing PFR-specific data (specification only). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTPFR_H__
+#define __FTPFR_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* pfr_fonts */
+ /* */
+ /* <Title> */
+ /* PFR Fonts */
+ /* */
+ /* <Abstract> */
+ /* PFR/TrueDoc specific API. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of PFR-specific functions. */
+ /* */
+ /*************************************************************************/
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_PFR_Metrics
+ *
+ * @description:
+ * Return the outline and metrics resolutions of a given PFR face.
+ *
+ * @input:
+ * face :: Handle to the input face. It can be a non-PFR face.
+ *
+ * @output:
+ * aoutline_resolution ::
+ * Outline resolution. This is equivalent to `face->units_per_EM'
+ * for non-PFR fonts. Optional (parameter can be NULL).
+ *
+ * ametrics_resolution ::
+ * Metrics resolution. This is equivalent to `outline_resolution'
+ * for non-PFR fonts. Optional (parameter can be NULL).
+ *
+ * ametrics_x_scale ::
+ * A 16.16 fixed-point number used to scale distance expressed
+ * in metrics units to device sub-pixels. This is equivalent to
+ * `face->size->x_scale', but for metrics only. Optional (parameter
+ * can be NULL).
+ *
+ * ametrics_y_scale ::
+ * Same as `ametrics_x_scale' but for the vertical direction.
+ * optional (parameter can be NULL).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If the input face is not a PFR, this function will return an error.
+ * However, in all cases, it will return valid values.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_PFR_Metrics( FT_Face face,
+ FT_UInt *aoutline_resolution,
+ FT_UInt *ametrics_resolution,
+ FT_Fixed *ametrics_x_scale,
+ FT_Fixed *ametrics_y_scale );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_PFR_Kerning
+ *
+ * @description:
+ * Return the kerning pair corresponding to two glyphs in a PFR face.
+ * The distance is expressed in metrics units, unlike the result of
+ * @FT_Get_Kerning.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * left :: Index of the left glyph.
+ *
+ * right :: Index of the right glyph.
+ *
+ * @output:
+ * avector :: A kerning vector.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function always return distances in original PFR metrics
+ * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
+ * mode, which always returns distances converted to outline units.
+ *
+ * You can use the value of the `x_scale' and `y_scale' parameters
+ * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_PFR_Kerning( FT_Face face,
+ FT_UInt left,
+ FT_UInt right,
+ FT_Vector *avector );
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_PFR_Advance
+ *
+ * @description:
+ * Return a given glyph advance, expressed in original metrics units,
+ * from a PFR font.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * gindex :: The glyph index.
+ *
+ * @output:
+ * aadvance :: The glyph advance in metrics units.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
+ * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_PFR_Advance( FT_Face face,
+ FT_UInt gindex,
+ FT_Pos *aadvance );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTPFR_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftrender.h b/src/3rdparty/freetype/include/freetype/ftrender.h
new file mode 100644
index 0000000000..ec8da700b1
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftrender.h
@@ -0,0 +1,232 @@
+/***************************************************************************/
+/* */
+/* ftrender.h */
+/* */
+/* FreeType renderer modules public interface (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTRENDER_H__
+#define __FTRENDER_H__
+
+
+#include <ft2build.h>
+#include FT_MODULE_H
+#include FT_GLYPH_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* module_management */
+ /* */
+ /*************************************************************************/
+
+
+ /* create a new glyph object */
+ typedef FT_Error
+ (*FT_Glyph_InitFunc)( FT_Glyph glyph,
+ FT_GlyphSlot slot );
+
+ /* destroys a given glyph object */
+ typedef void
+ (*FT_Glyph_DoneFunc)( FT_Glyph glyph );
+
+ typedef void
+ (*FT_Glyph_TransformFunc)( FT_Glyph glyph,
+ const FT_Matrix* matrix,
+ const FT_Vector* delta );
+
+ typedef void
+ (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
+ FT_BBox* abbox );
+
+ typedef FT_Error
+ (*FT_Glyph_CopyFunc)( FT_Glyph source,
+ FT_Glyph target );
+
+ typedef FT_Error
+ (*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
+ FT_GlyphSlot slot );
+
+/* deprecated */
+#define FT_Glyph_Init_Func FT_Glyph_InitFunc
+#define FT_Glyph_Done_Func FT_Glyph_DoneFunc
+#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
+#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
+#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
+#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
+
+
+ struct FT_Glyph_Class_
+ {
+ FT_Long glyph_size;
+ FT_Glyph_Format glyph_format;
+ FT_Glyph_InitFunc glyph_init;
+ FT_Glyph_DoneFunc glyph_done;
+ FT_Glyph_CopyFunc glyph_copy;
+ FT_Glyph_TransformFunc glyph_transform;
+ FT_Glyph_GetBBoxFunc glyph_bbox;
+ FT_Glyph_PrepareFunc glyph_prepare;
+ };
+
+
+ typedef FT_Error
+ (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ FT_UInt mode,
+ const FT_Vector* origin );
+
+ typedef FT_Error
+ (*FT_Renderer_TransformFunc)( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ const FT_Matrix* matrix,
+ const FT_Vector* delta );
+
+
+ typedef void
+ (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ FT_BBox* cbox );
+
+
+ typedef FT_Error
+ (*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
+ FT_ULong mode_tag,
+ FT_Pointer mode_ptr );
+
+/* deprecated identifiers */
+#define FTRenderer_render FT_Renderer_RenderFunc
+#define FTRenderer_transform FT_Renderer_TransformFunc
+#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
+#define FTRenderer_setMode FT_Renderer_SetModeFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Renderer_Class */
+ /* */
+ /* <Description> */
+ /* The renderer module class descriptor. */
+ /* */
+ /* <Fields> */
+ /* root :: The root @FT_Module_Class fields. */
+ /* */
+ /* glyph_format :: The glyph image format this renderer handles. */
+ /* */
+ /* render_glyph :: A method used to render the image that is in a */
+ /* given glyph slot into a bitmap. */
+ /* */
+ /* transform_glyph :: A method used to transform the image that is in */
+ /* a given glyph slot. */
+ /* */
+ /* get_glyph_cbox :: A method used to access the glyph's cbox. */
+ /* */
+ /* set_mode :: A method used to pass additional parameters. */
+ /* */
+ /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
+ /* This is a pointer to its raster's class. */
+ /* */
+ typedef struct FT_Renderer_Class_
+ {
+ FT_Module_Class root;
+
+ FT_Glyph_Format glyph_format;
+
+ FT_Renderer_RenderFunc render_glyph;
+ FT_Renderer_TransformFunc transform_glyph;
+ FT_Renderer_GetCBoxFunc get_glyph_cbox;
+ FT_Renderer_SetModeFunc set_mode;
+
+ FT_Raster_Funcs* raster_class;
+
+ } FT_Renderer_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Renderer */
+ /* */
+ /* <Description> */
+ /* Retrieve the current renderer for a given glyph format. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* format :: The glyph format. */
+ /* */
+ /* <Return> */
+ /* A renderer handle. 0~if none found. */
+ /* */
+ /* <Note> */
+ /* An error will be returned if a module already exists by that name, */
+ /* or if the module requires a version of FreeType that is too great. */
+ /* */
+ /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
+ /* renderer by its name, use @FT_Get_Module. */
+ /* */
+ FT_EXPORT( FT_Renderer )
+ FT_Get_Renderer( FT_Library library,
+ FT_Glyph_Format format );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Renderer */
+ /* */
+ /* <Description> */
+ /* Set the current renderer to use, and set additional mode. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* <Input> */
+ /* renderer :: A handle to the renderer object. */
+ /* */
+ /* num_params :: The number of additional parameters. */
+ /* */
+ /* parameters :: Additional parameters. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* In case of success, the renderer will be used to convert glyph */
+ /* images in the renderer's known format into bitmaps. */
+ /* */
+ /* This doesn't change the current renderer for other formats. */
+ /* */
+ /* Currently, no FreeType renderer module uses `parameters'; you */
+ /* should thus always pass NULL as the value. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Renderer( FT_Library library,
+ FT_Renderer renderer,
+ FT_UInt num_params,
+ FT_Parameter* parameters );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTRENDER_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftsizes.h b/src/3rdparty/freetype/include/freetype/ftsizes.h
new file mode 100644
index 0000000000..bef8424715
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftsizes.h
@@ -0,0 +1,159 @@
+/***************************************************************************/
+/* */
+/* ftsizes.h */
+/* */
+/* FreeType size objects management (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Typical application would normally not need to use these functions. */
+ /* However, they have been placed in a public API for the rare cases */
+ /* where they are needed. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTSIZES_H__
+#define __FTSIZES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* sizes_management */
+ /* */
+ /* <Title> */
+ /* Size Management */
+ /* */
+ /* <Abstract> */
+ /* Managing multiple sizes per face. */
+ /* */
+ /* <Description> */
+ /* When creating a new face object (e.g., with @FT_New_Face), an */
+ /* @FT_Size object is automatically created and used to store all */
+ /* pixel-size dependent information, available in the `face->size' */
+ /* field. */
+ /* */
+ /* It is however possible to create more sizes for a given face, */
+ /* mostly in order to manage several character pixel sizes of the */
+ /* same font family and style. See @FT_New_Size and @FT_Done_Size. */
+ /* */
+ /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
+ /* modify the contents of the current `active' size; you thus need */
+ /* to use @FT_Activate_Size to change it. */
+ /* */
+ /* 99% of applications won't need the functions provided here, */
+ /* especially if they use the caching sub-system, so be cautious */
+ /* when using these. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Size */
+ /* */
+ /* <Description> */
+ /* Create a new size object from a given face object. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a parent face object. */
+ /* */
+ /* <Output> */
+ /* asize :: A handle to a new size object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* You need to call @FT_Activate_Size in order to select the new size */
+ /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
+ /* @FT_Load_Glyph, @FT_Load_Char, etc. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Size( FT_Face face,
+ FT_Size* size );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Size */
+ /* */
+ /* <Description> */
+ /* Discard a given size object. Note that @FT_Done_Face */
+ /* automatically discards all size objects allocated with */
+ /* @FT_New_Size. */
+ /* */
+ /* <Input> */
+ /* size :: A handle to a target size object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_Size( FT_Size size );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Activate_Size */
+ /* */
+ /* <Description> */
+ /* Even though it is possible to create several size objects for a */
+ /* given face (see @FT_New_Size for details), functions like */
+ /* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */
+ /* activated last to determine the `current character pixel size'. */
+ /* */
+ /* This function can be used to `activate' a previously created size */
+ /* object. */
+ /* */
+ /* <Input> */
+ /* size :: A handle to a target size object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* If `face' is the size's parent face object, this function changes */
+ /* the value of `face->size' to the input size handle. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Activate_Size( FT_Size size );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTSIZES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftsnames.h b/src/3rdparty/freetype/include/freetype/ftsnames.h
new file mode 100644
index 0000000000..0f7fbe1744
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftsnames.h
@@ -0,0 +1,200 @@
+/***************************************************************************/
+/* */
+/* ftsnames.h */
+/* */
+/* Simple interface to access SFNT name tables (which are used */
+/* to hold font names, copyright info, notices, etc.) (specification). */
+/* */
+/* This is _not_ used to retrieve glyph names! */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FT_SFNT_NAMES_H__
+#define __FT_SFNT_NAMES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* sfnt_names */
+ /* */
+ /* <Title> */
+ /* SFNT Names */
+ /* */
+ /* <Abstract> */
+ /* Access the names embedded in TrueType and OpenType files. */
+ /* */
+ /* <Description> */
+ /* The TrueType and OpenType specifications allow the inclusion of */
+ /* a special `names table' in font files. This table contains */
+ /* textual (and internationalized) information regarding the font, */
+ /* like family name, copyright, version, etc. */
+ /* */
+ /* The definitions below are used to access them if available. */
+ /* */
+ /* Note that this has nothing to do with glyph names! */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SfntName */
+ /* */
+ /* <Description> */
+ /* A structure used to model an SFNT `name' table entry. */
+ /* */
+ /* <Fields> */
+ /* platform_id :: The platform ID for `string'. */
+ /* */
+ /* encoding_id :: The encoding ID for `string'. */
+ /* */
+ /* language_id :: The language ID for `string'. */
+ /* */
+ /* name_id :: An identifier for `string'. */
+ /* */
+ /* string :: The `name' string. Note that its format differs */
+ /* depending on the (platform,encoding) pair. It can */
+ /* be a Pascal String, a UTF-16 one, etc. */
+ /* */
+ /* Generally speaking, the string is not */
+ /* zero-terminated. Please refer to the TrueType */
+ /* specification for details. */
+ /* */
+ /* string_len :: The length of `string' in bytes. */
+ /* */
+ /* <Note> */
+ /* Possible values for `platform_id', `encoding_id', `language_id', */
+ /* and `name_id' are given in the file `ttnameid.h'. For details */
+ /* please refer to the TrueType or OpenType specification. */
+ /* */
+ /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
+ /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
+ /* */
+ typedef struct FT_SfntName_
+ {
+ FT_UShort platform_id;
+ FT_UShort encoding_id;
+ FT_UShort language_id;
+ FT_UShort name_id;
+
+ FT_Byte* string; /* this string is *not* null-terminated! */
+ FT_UInt string_len; /* in bytes */
+
+ } FT_SfntName;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Sfnt_Name_Count */
+ /* */
+ /* <Description> */
+ /* Retrieve the number of name strings in the SFNT `name' table. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Return> */
+ /* The number of strings in the `name' table. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Sfnt_Name_Count( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Sfnt_Name */
+ /* */
+ /* <Description> */
+ /* Retrieve a string of the SFNT `name' table for a given index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* idx :: The index of the `name' string. */
+ /* */
+ /* <Output> */
+ /* aname :: The indexed @FT_SfntName structure. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The `string' array returned in the `aname' structure is not */
+ /* null-terminated. The application should deallocate it if it is no */
+ /* longer in use. */
+ /* */
+ /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
+ /* `name' table entries, then do a loop until you get the right */
+ /* platform, encoding, and name ID. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Sfnt_Name( FT_Face face,
+ FT_UInt idx,
+ FT_SfntName *aname );
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to make
+ * FT_Open_Face() ignore preferred family subfamily names in `name'
+ * table since OpenType version 1.4. For backwards compatibility with
+ * legacy systems that have a 4-face-per-family restriction.
+ *
+ */
+#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to make
+ * FT_Open_Face() ignore preferred subfamily names in `name' table since
+ * OpenType version 1.4. For backwards compatibility with legacy
+ * systems that have a 4-face-per-family restriction.
+ *
+ */
+#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FT_SFNT_NAMES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftstroke.h b/src/3rdparty/freetype/include/freetype/ftstroke.h
new file mode 100644
index 0000000000..7ebb1e7404
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftstroke.h
@@ -0,0 +1,785 @@
+/***************************************************************************/
+/* */
+/* ftstroke.h */
+/* */
+/* FreeType path stroker (specification). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FT_STROKE_H__
+#define __FT_STROKE_H__
+
+#include <ft2build.h>
+#include FT_OUTLINE_H
+#include FT_GLYPH_H
+
+
+FT_BEGIN_HEADER
+
+
+ /************************************************************************
+ *
+ * @section:
+ * glyph_stroker
+ *
+ * @title:
+ * Glyph Stroker
+ *
+ * @abstract:
+ * Generating bordered and stroked glyphs.
+ *
+ * @description:
+ * This component generates stroked outlines of a given vectorial
+ * glyph. It also allows you to retrieve the `outside' and/or the
+ * `inside' borders of the stroke.
+ *
+ * This can be useful to generate `bordered' glyph, i.e., glyphs
+ * displayed with a coloured (and anti-aliased) border around their
+ * shape.
+ *
+ * @order:
+ * FT_Stroker
+ *
+ * FT_Stroker_LineJoin
+ * FT_Stroker_LineCap
+ * FT_StrokerBorder
+ *
+ * FT_Outline_GetInsideBorder
+ * FT_Outline_GetOutsideBorder
+ *
+ * FT_Glyph_Stroke
+ * FT_Glyph_StrokeBorder
+ *
+ * FT_Stroker_New
+ * FT_Stroker_Set
+ * FT_Stroker_Rewind
+ * FT_Stroker_ParseOutline
+ * FT_Stroker_Done
+ *
+ * FT_Stroker_BeginSubPath
+ * FT_Stroker_EndSubPath
+ *
+ * FT_Stroker_LineTo
+ * FT_Stroker_ConicTo
+ * FT_Stroker_CubicTo
+ *
+ * FT_Stroker_GetBorderCounts
+ * FT_Stroker_ExportBorder
+ * FT_Stroker_GetCounts
+ * FT_Stroker_Export
+ *
+ */
+
+
+ /**************************************************************
+ *
+ * @type:
+ * FT_Stroker
+ *
+ * @description:
+ * Opaque handle to a path stroker object.
+ */
+ typedef struct FT_StrokerRec_* FT_Stroker;
+
+
+ /**************************************************************
+ *
+ * @enum:
+ * FT_Stroker_LineJoin
+ *
+ * @description:
+ * These values determine how two joining lines are rendered
+ * in a stroker.
+ *
+ * @values:
+ * FT_STROKER_LINEJOIN_ROUND ::
+ * Used to render rounded line joins. Circular arcs are used
+ * to join two lines smoothly.
+ *
+ * FT_STROKER_LINEJOIN_BEVEL ::
+ * Used to render beveled line joins. The outer corner of
+ * the joined lines is filled by enclosing the triangular
+ * region of the corner with a straight line between the
+ * outer corners of each stroke.
+ *
+ * FT_STROKER_LINEJOIN_MITER_FIXED ::
+ * Used to render mitered line joins, with fixed bevels if the
+ * miter limit is exceeded. The outer edges of the strokes
+ * for the two segments are extended until they meet at an
+ * angle. If the segments meet at too sharp an angle (such
+ * that the miter would extend from the intersection of the
+ * segments a distance greater than the product of the miter
+ * limit value and the border radius), then a bevel join (see
+ * above) is used instead. This prevents long spikes being
+ * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
+ * line join as used in PostScript and PDF.
+ *
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE ::
+ * FT_STROKER_LINEJOIN_MITER ::
+ * Used to render mitered line joins, with variable bevels if
+ * the miter limit is exceeded. The intersection of the
+ * strokes is clipped at a line perpendicular to the bisector
+ * of the angle between the strokes, at the distance from the
+ * intersection of the segments equal to the product of the
+ * miter limit value and the border radius. This prevents
+ * long spikes being created.
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
+ * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
+ * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
+ * backwards compatibility.
+ */
+ typedef enum FT_Stroker_LineJoin_
+ {
+ FT_STROKER_LINEJOIN_ROUND = 0,
+ FT_STROKER_LINEJOIN_BEVEL = 1,
+ FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
+ FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE,
+ FT_STROKER_LINEJOIN_MITER_FIXED = 3
+
+ } FT_Stroker_LineJoin;
+
+
+ /**************************************************************
+ *
+ * @enum:
+ * FT_Stroker_LineCap
+ *
+ * @description:
+ * These values determine how the end of opened sub-paths are
+ * rendered in a stroke.
+ *
+ * @values:
+ * FT_STROKER_LINECAP_BUTT ::
+ * The end of lines is rendered as a full stop on the last
+ * point itself.
+ *
+ * FT_STROKER_LINECAP_ROUND ::
+ * The end of lines is rendered as a half-circle around the
+ * last point.
+ *
+ * FT_STROKER_LINECAP_SQUARE ::
+ * The end of lines is rendered as a square around the
+ * last point.
+ */
+ typedef enum FT_Stroker_LineCap_
+ {
+ FT_STROKER_LINECAP_BUTT = 0,
+ FT_STROKER_LINECAP_ROUND,
+ FT_STROKER_LINECAP_SQUARE
+
+ } FT_Stroker_LineCap;
+
+
+ /**************************************************************
+ *
+ * @enum:
+ * FT_StrokerBorder
+ *
+ * @description:
+ * These values are used to select a given stroke border
+ * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
+ *
+ * @values:
+ * FT_STROKER_BORDER_LEFT ::
+ * Select the left border, relative to the drawing direction.
+ *
+ * FT_STROKER_BORDER_RIGHT ::
+ * Select the right border, relative to the drawing direction.
+ *
+ * @note:
+ * Applications are generally interested in the `inside' and `outside'
+ * borders. However, there is no direct mapping between these and the
+ * `left' and `right' ones, since this really depends on the glyph's
+ * drawing orientation, which varies between font formats.
+ *
+ * You can however use @FT_Outline_GetInsideBorder and
+ * @FT_Outline_GetOutsideBorder to get these.
+ */
+ typedef enum FT_StrokerBorder_
+ {
+ FT_STROKER_BORDER_LEFT = 0,
+ FT_STROKER_BORDER_RIGHT
+
+ } FT_StrokerBorder;
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Outline_GetInsideBorder
+ *
+ * @description:
+ * Retrieve the @FT_StrokerBorder value corresponding to the
+ * `inside' borders of a given outline.
+ *
+ * @input:
+ * outline ::
+ * The source outline handle.
+ *
+ * @return:
+ * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
+ * outlines.
+ */
+ FT_EXPORT( FT_StrokerBorder )
+ FT_Outline_GetInsideBorder( FT_Outline* outline );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Outline_GetOutsideBorder
+ *
+ * @description:
+ * Retrieve the @FT_StrokerBorder value corresponding to the
+ * `outside' borders of a given outline.
+ *
+ * @input:
+ * outline ::
+ * The source outline handle.
+ *
+ * @return:
+ * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
+ * outlines.
+ */
+ FT_EXPORT( FT_StrokerBorder )
+ FT_Outline_GetOutsideBorder( FT_Outline* outline );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_New
+ *
+ * @description:
+ * Create a new stroker object.
+ *
+ * @input:
+ * library ::
+ * FreeType library handle.
+ *
+ * @output:
+ * astroker ::
+ * A new stroker object handle. NULL in case of error.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_New( FT_Library library,
+ FT_Stroker *astroker );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Set
+ *
+ * @description:
+ * Reset a stroker object's attributes.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * radius ::
+ * The border radius.
+ *
+ * line_cap ::
+ * The line cap style.
+ *
+ * line_join ::
+ * The line join style.
+ *
+ * miter_limit ::
+ * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
+ * expressed as 16.16 fixed-point value.
+ *
+ * @note:
+ * The radius is expressed in the same units as the outline
+ * coordinates.
+ *
+ * This function calls @FT_Stroker_Rewind automatically.
+ */
+ FT_EXPORT( void )
+ FT_Stroker_Set( FT_Stroker stroker,
+ FT_Fixed radius,
+ FT_Stroker_LineCap line_cap,
+ FT_Stroker_LineJoin line_join,
+ FT_Fixed miter_limit );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Rewind
+ *
+ * @description:
+ * Reset a stroker object without changing its attributes.
+ * You should call this function before beginning a new
+ * series of calls to @FT_Stroker_BeginSubPath or
+ * @FT_Stroker_EndSubPath.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ */
+ FT_EXPORT( void )
+ FT_Stroker_Rewind( FT_Stroker stroker );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_ParseOutline
+ *
+ * @description:
+ * A convenience function used to parse a whole outline with
+ * the stroker. The resulting outline(s) can be retrieved
+ * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * outline ::
+ * The source outline.
+ *
+ * opened ::
+ * A boolean. If~1, the outline is treated as an open path instead
+ * of a closed one.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If `opened' is~0 (the default), the outline is treated as a closed
+ * path, and the stroker generates two distinct `border' outlines.
+ *
+ * If `opened' is~1, the outline is processed as an open path, and the
+ * stroker generates a single `stroke' outline.
+ *
+ * This function calls @FT_Stroker_Rewind automatically.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_ParseOutline( FT_Stroker stroker,
+ FT_Outline* outline,
+ FT_Bool opened );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_BeginSubPath
+ *
+ * @description:
+ * Start a new sub-path in the stroker.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * to ::
+ * A pointer to the start vector.
+ *
+ * open ::
+ * A boolean. If~1, the sub-path is treated as an open one.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function is useful when you need to stroke a path that is
+ * not stored as an @FT_Outline object.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_BeginSubPath( FT_Stroker stroker,
+ FT_Vector* to,
+ FT_Bool open );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_EndSubPath
+ *
+ * @description:
+ * Close the current sub-path in the stroker.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function after @FT_Stroker_BeginSubPath.
+ * If the subpath was not `opened', this function `draws' a
+ * single line segment to the start position when needed.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_EndSubPath( FT_Stroker stroker );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_LineTo
+ *
+ * @description:
+ * `Draw' a single line segment in the stroker's current sub-path,
+ * from the last position.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * to ::
+ * A pointer to the destination point.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function between @FT_Stroker_BeginSubPath and
+ * @FT_Stroker_EndSubPath.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_LineTo( FT_Stroker stroker,
+ FT_Vector* to );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_ConicTo
+ *
+ * @description:
+ * `Draw' a single quadratic Bézier in the stroker's current sub-path,
+ * from the last position.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * control ::
+ * A pointer to a Bézier control point.
+ *
+ * to ::
+ * A pointer to the destination point.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function between @FT_Stroker_BeginSubPath and
+ * @FT_Stroker_EndSubPath.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_ConicTo( FT_Stroker stroker,
+ FT_Vector* control,
+ FT_Vector* to );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_CubicTo
+ *
+ * @description:
+ * `Draw' a single cubic Bézier in the stroker's current sub-path,
+ * from the last position.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * control1 ::
+ * A pointer to the first Bézier control point.
+ *
+ * control2 ::
+ * A pointer to second Bézier control point.
+ *
+ * to ::
+ * A pointer to the destination point.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * You should call this function between @FT_Stroker_BeginSubPath and
+ * @FT_Stroker_EndSubPath.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_CubicTo( FT_Stroker stroker,
+ FT_Vector* control1,
+ FT_Vector* control2,
+ FT_Vector* to );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_GetBorderCounts
+ *
+ * @description:
+ * Call this function once you have finished parsing your paths
+ * with the stroker. It returns the number of points and
+ * contours necessary to export one of the `border' or `stroke'
+ * outlines generated by the stroker.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * border ::
+ * The border index.
+ *
+ * @output:
+ * anum_points ::
+ * The number of points.
+ *
+ * anum_contours ::
+ * The number of contours.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * When an outline, or a sub-path, is `closed', the stroker generates
+ * two independent `border' outlines, named `left' and `right'.
+ *
+ * When the outline, or a sub-path, is `opened', the stroker merges
+ * the `border' outlines with caps. The `left' border receives all
+ * points, while the `right' border becomes empty.
+ *
+ * Use the function @FT_Stroker_GetCounts instead if you want to
+ * retrieve the counts associated to both borders.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_GetBorderCounts( FT_Stroker stroker,
+ FT_StrokerBorder border,
+ FT_UInt *anum_points,
+ FT_UInt *anum_contours );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_ExportBorder
+ *
+ * @description:
+ * Call this function after @FT_Stroker_GetBorderCounts to
+ * export the corresponding border to your own @FT_Outline
+ * structure.
+ *
+ * Note that this function appends the border points and
+ * contours to your outline, but does not try to resize its
+ * arrays.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * border ::
+ * The border index.
+ *
+ * outline ::
+ * The target outline handle.
+ *
+ * @note:
+ * Always call this function after @FT_Stroker_GetBorderCounts to
+ * get sure that there is enough room in your @FT_Outline object to
+ * receive all new data.
+ *
+ * When an outline, or a sub-path, is `closed', the stroker generates
+ * two independent `border' outlines, named `left' and `right'.
+ *
+ * When the outline, or a sub-path, is `opened', the stroker merges
+ * the `border' outlines with caps. The `left' border receives all
+ * points, while the `right' border becomes empty.
+ *
+ * Use the function @FT_Stroker_Export instead if you want to
+ * retrieve all borders at once.
+ */
+ FT_EXPORT( void )
+ FT_Stroker_ExportBorder( FT_Stroker stroker,
+ FT_StrokerBorder border,
+ FT_Outline* outline );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_GetCounts
+ *
+ * @description:
+ * Call this function once you have finished parsing your paths
+ * with the stroker. It returns the number of points and
+ * contours necessary to export all points/borders from the stroked
+ * outline/path.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * @output:
+ * anum_points ::
+ * The number of points.
+ *
+ * anum_contours ::
+ * The number of contours.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stroker_GetCounts( FT_Stroker stroker,
+ FT_UInt *anum_points,
+ FT_UInt *anum_contours );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Export
+ *
+ * @description:
+ * Call this function after @FT_Stroker_GetBorderCounts to
+ * export all borders to your own @FT_Outline structure.
+ *
+ * Note that this function appends the border points and
+ * contours to your outline, but does not try to resize its
+ * arrays.
+ *
+ * @input:
+ * stroker ::
+ * The target stroker handle.
+ *
+ * outline ::
+ * The target outline handle.
+ */
+ FT_EXPORT( void )
+ FT_Stroker_Export( FT_Stroker stroker,
+ FT_Outline* outline );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Stroker_Done
+ *
+ * @description:
+ * Destroy a stroker object.
+ *
+ * @input:
+ * stroker ::
+ * A stroker handle. Can be NULL.
+ */
+ FT_EXPORT( void )
+ FT_Stroker_Done( FT_Stroker stroker );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Glyph_Stroke
+ *
+ * @description:
+ * Stroke a given outline glyph object with a given stroker.
+ *
+ * @inout:
+ * pglyph ::
+ * Source glyph handle on input, new glyph handle on output.
+ *
+ * @input:
+ * stroker ::
+ * A stroker handle.
+ *
+ * destroy ::
+ * A Boolean. If~1, the source glyph object is destroyed
+ * on success.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source glyph is untouched in case of error.
+ *
+ * Adding stroke may yield a significantly wider and taller glyph
+ * depending on how large of a radius was used to stroke the glyph. You
+ * may need to manually adjust horizontal and vertical advance amounts
+ * to account for this added size.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_Stroke( FT_Glyph *pglyph,
+ FT_Stroker stroker,
+ FT_Bool destroy );
+
+
+ /**************************************************************
+ *
+ * @function:
+ * FT_Glyph_StrokeBorder
+ *
+ * @description:
+ * Stroke a given outline glyph object with a given stroker, but
+ * only return either its inside or outside border.
+ *
+ * @inout:
+ * pglyph ::
+ * Source glyph handle on input, new glyph handle on output.
+ *
+ * @input:
+ * stroker ::
+ * A stroker handle.
+ *
+ * inside ::
+ * A Boolean. If~1, return the inside border, otherwise
+ * the outside border.
+ *
+ * destroy ::
+ * A Boolean. If~1, the source glyph object is destroyed
+ * on success.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The source glyph is untouched in case of error.
+ *
+ * Adding stroke may yield a significantly wider and taller glyph
+ * depending on how large of a radius was used to stroke the glyph. You
+ * may need to manually adjust horizontal and vertical advance amounts
+ * to account for this added size.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
+ FT_Stroker stroker,
+ FT_Bool inside,
+ FT_Bool destroy );
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FT_STROKE_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
diff --git a/src/3rdparty/freetype/include/freetype/ftsynth.h b/src/3rdparty/freetype/include/freetype/ftsynth.h
new file mode 100644
index 0000000000..fbcbad871a
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftsynth.h
@@ -0,0 +1,84 @@
+/***************************************************************************/
+/* */
+/* ftsynth.h */
+/* */
+/* FreeType synthesizing code for emboldening and slanting */
+/* (specification). */
+/* */
+/* Copyright 2000-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /********* *********/
+ /********* WARNING, THIS IS ALPHA CODE! THIS API *********/
+ /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
+ /********* FREETYPE DEVELOPMENT TEAM *********/
+ /********* *********/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /* Main reason for not lifting the functions in this module to a */
+ /* `standard' API is that the used parameters for emboldening and */
+ /* slanting are not configurable. Consider the functions as a */
+ /* code resource that should be copied into the application and */
+ /* adapted to the particular needs. */
+
+
+#ifndef __FTSYNTH_H__
+#define __FTSYNTH_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /* Embolden a glyph by a `reasonable' value (which is highly a matter of */
+ /* taste). This function is actually a convenience function, providing */
+ /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
+ /* */
+ /* For emboldened outlines the height, width, and advance metrics are */
+ /* increased by the strength of the emboldening -- this even affects */
+ /* mono-width fonts! */
+ /* */
+ /* You can also call @FT_Outline_Get_CBox to get precise values. */
+ FT_EXPORT( void )
+ FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
+
+ /* Slant an outline glyph to the right by about 12 degrees. */
+ FT_EXPORT( void )
+ FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTSYNTH_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftsystem.h b/src/3rdparty/freetype/include/freetype/ftsystem.h
new file mode 100644
index 0000000000..2bc999910b
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftsystem.h
@@ -0,0 +1,355 @@
+/***************************************************************************/
+/* */
+/* ftsystem.h */
+/* */
+/* FreeType low-level system interface definition (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTSYSTEM_H__
+#define __FTSYSTEM_H__
+
+
+#include <ft2build.h>
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* system_interface */
+ /* */
+ /* <Title> */
+ /* System Interface */
+ /* */
+ /* <Abstract> */
+ /* How FreeType manages memory and i/o. */
+ /* */
+ /* <Description> */
+ /* This section contains various definitions related to memory */
+ /* management and i/o access. You need to understand this */
+ /* information if you want to use a custom memory manager or you own */
+ /* i/o streams. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* M E M O R Y M A N A G E M E N T */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @type:
+ * FT_Memory
+ *
+ * @description:
+ * A handle to a given memory manager object, defined with an
+ * @FT_MemoryRec structure.
+ *
+ */
+ typedef struct FT_MemoryRec_* FT_Memory;
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * FT_Alloc_Func
+ *
+ * @description:
+ * A function used to allocate `size' bytes from `memory'.
+ *
+ * @input:
+ * memory ::
+ * A handle to the source memory manager.
+ *
+ * size ::
+ * The size in bytes to allocate.
+ *
+ * @return:
+ * Address of new memory block. 0~in case of failure.
+ *
+ */
+ typedef void*
+ (*FT_Alloc_Func)( FT_Memory memory,
+ long size );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * FT_Free_Func
+ *
+ * @description:
+ * A function used to release a given block of memory.
+ *
+ * @input:
+ * memory ::
+ * A handle to the source memory manager.
+ *
+ * block ::
+ * The address of the target memory block.
+ *
+ */
+ typedef void
+ (*FT_Free_Func)( FT_Memory memory,
+ void* block );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * FT_Realloc_Func
+ *
+ * @description:
+ * A function used to re-allocate a given block of memory.
+ *
+ * @input:
+ * memory ::
+ * A handle to the source memory manager.
+ *
+ * cur_size ::
+ * The block's current size in bytes.
+ *
+ * new_size ::
+ * The block's requested new size.
+ *
+ * block ::
+ * The block's current address.
+ *
+ * @return:
+ * New block address. 0~in case of memory shortage.
+ *
+ * @note:
+ * In case of error, the old block must still be available.
+ *
+ */
+ typedef void*
+ (*FT_Realloc_Func)( FT_Memory memory,
+ long cur_size,
+ long new_size,
+ void* block );
+
+
+ /*************************************************************************
+ *
+ * @struct:
+ * FT_MemoryRec
+ *
+ * @description:
+ * A structure used to describe a given memory manager to FreeType~2.
+ *
+ * @fields:
+ * user ::
+ * A generic typeless pointer for user data.
+ *
+ * alloc ::
+ * A pointer type to an allocation function.
+ *
+ * free ::
+ * A pointer type to an memory freeing function.
+ *
+ * realloc ::
+ * A pointer type to a reallocation function.
+ *
+ */
+ struct FT_MemoryRec_
+ {
+ void* user;
+ FT_Alloc_Func alloc;
+ FT_Free_Func free;
+ FT_Realloc_Func realloc;
+ };
+
+
+ /*************************************************************************/
+ /* */
+ /* I / O M A N A G E M E N T */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @type:
+ * FT_Stream
+ *
+ * @description:
+ * A handle to an input stream.
+ *
+ * @also:
+ * See @FT_StreamRec for the publicly accessible fields of a given
+ * stream object.
+ *
+ */
+ typedef struct FT_StreamRec_* FT_Stream;
+
+
+ /*************************************************************************
+ *
+ * @struct:
+ * FT_StreamDesc
+ *
+ * @description:
+ * A union type used to store either a long or a pointer. This is used
+ * to store a file descriptor or a `FILE*' in an input stream.
+ *
+ */
+ typedef union FT_StreamDesc_
+ {
+ long value;
+ void* pointer;
+
+ } FT_StreamDesc;
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * FT_Stream_IoFunc
+ *
+ * @description:
+ * A function used to seek and read data from a given input stream.
+ *
+ * @input:
+ * stream ::
+ * A handle to the source stream.
+ *
+ * offset ::
+ * The offset of read in stream (always from start).
+ *
+ * buffer ::
+ * The address of the read buffer.
+ *
+ * count ::
+ * The number of bytes to read from the stream.
+ *
+ * @return:
+ * The number of bytes effectively read by the stream.
+ *
+ * @note:
+ * This function might be called to perform a seek or skip operation
+ * with a `count' of~0. A non-zero return value then indicates an
+ * error.
+ *
+ */
+ typedef unsigned long
+ (*FT_Stream_IoFunc)( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * FT_Stream_CloseFunc
+ *
+ * @description:
+ * A function used to close a given input stream.
+ *
+ * @input:
+ * stream ::
+ * A handle to the target stream.
+ *
+ */
+ typedef void
+ (*FT_Stream_CloseFunc)( FT_Stream stream );
+
+
+ /*************************************************************************
+ *
+ * @struct:
+ * FT_StreamRec
+ *
+ * @description:
+ * A structure used to describe an input stream.
+ *
+ * @input:
+ * base ::
+ * For memory-based streams, this is the address of the first stream
+ * byte in memory. This field should always be set to NULL for
+ * disk-based streams.
+ *
+ * size ::
+ * The stream size in bytes.
+ *
+ * In case of compressed streams where the size is unknown before
+ * actually doing the decompression, the value is set to 0x7FFFFFFF.
+ * (Note that this size value can occur for normal streams also; it is
+ * thus just a hint.)
+ *
+ * pos ::
+ * The current position within the stream.
+ *
+ * descriptor ::
+ * This field is a union that can hold an integer or a pointer. It is
+ * used by stream implementations to store file descriptors or `FILE*'
+ * pointers.
+ *
+ * pathname ::
+ * This field is completely ignored by FreeType. However, it is often
+ * useful during debugging to use it to store the stream's filename
+ * (where available).
+ *
+ * read ::
+ * The stream's input function.
+ *
+ * close ::
+ * The stream's close function.
+ *
+ * memory ::
+ * The memory manager to use to preload frames. This is set
+ * internally by FreeType and shouldn't be touched by stream
+ * implementations.
+ *
+ * cursor ::
+ * This field is set and used internally by FreeType when parsing
+ * frames.
+ *
+ * limit ::
+ * This field is set and used internally by FreeType when parsing
+ * frames.
+ *
+ */
+ typedef struct FT_StreamRec_
+ {
+ unsigned char* base;
+ unsigned long size;
+ unsigned long pos;
+
+ FT_StreamDesc descriptor;
+ FT_StreamDesc pathname;
+ FT_Stream_IoFunc read;
+ FT_Stream_CloseFunc close;
+
+ FT_Memory memory;
+ unsigned char* cursor;
+ unsigned char* limit;
+
+ } FT_StreamRec;
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTSYSTEM_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/fttrigon.h b/src/3rdparty/freetype/include/freetype/fttrigon.h
new file mode 100644
index 0000000000..485ec51587
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/fttrigon.h
@@ -0,0 +1,350 @@
+/***************************************************************************/
+/* */
+/* fttrigon.h */
+/* */
+/* FreeType trigonometric functions (specification). */
+/* */
+/* Copyright 2001-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTTRIGON_H__
+#define __FTTRIGON_H__
+
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* computations */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @type:
+ * FT_Angle
+ *
+ * @description:
+ * This type is used to model angle values in FreeType. Note that the
+ * angle is a 16.16 fixed-point value expressed in degrees.
+ *
+ */
+ typedef FT_Fixed FT_Angle;
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_PI
+ *
+ * @description:
+ * The angle pi expressed in @FT_Angle units.
+ *
+ */
+#define FT_ANGLE_PI ( 180L << 16 )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_2PI
+ *
+ * @description:
+ * The angle 2*pi expressed in @FT_Angle units.
+ *
+ */
+#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_PI2
+ *
+ * @description:
+ * The angle pi/2 expressed in @FT_Angle units.
+ *
+ */
+#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_ANGLE_PI4
+ *
+ * @description:
+ * The angle pi/4 expressed in @FT_Angle units.
+ *
+ */
+#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Sin
+ *
+ * @description:
+ * Return the sinus of a given angle in fixed-point format.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ * @return:
+ * The sinus value.
+ *
+ * @note:
+ * If you need both the sinus and cosinus for a given angle, use the
+ * function @FT_Vector_Unit.
+ *
+ */
+ FT_EXPORT( FT_Fixed )
+ FT_Sin( FT_Angle angle );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Cos
+ *
+ * @description:
+ * Return the cosinus of a given angle in fixed-point format.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ * @return:
+ * The cosinus value.
+ *
+ * @note:
+ * If you need both the sinus and cosinus for a given angle, use the
+ * function @FT_Vector_Unit.
+ *
+ */
+ FT_EXPORT( FT_Fixed )
+ FT_Cos( FT_Angle angle );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Tan
+ *
+ * @description:
+ * Return the tangent of a given angle in fixed-point format.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ * @return:
+ * The tangent value.
+ *
+ */
+ FT_EXPORT( FT_Fixed )
+ FT_Tan( FT_Angle angle );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Atan2
+ *
+ * @description:
+ * Return the arc-tangent corresponding to a given vector (x,y) in
+ * the 2d plane.
+ *
+ * @input:
+ * x ::
+ * The horizontal vector coordinate.
+ *
+ * y ::
+ * The vertical vector coordinate.
+ *
+ * @return:
+ * The arc-tangent value (i.e. angle).
+ *
+ */
+ FT_EXPORT( FT_Angle )
+ FT_Atan2( FT_Fixed x,
+ FT_Fixed y );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Angle_Diff
+ *
+ * @description:
+ * Return the difference between two angles. The result is always
+ * constrained to the ]-PI..PI] interval.
+ *
+ * @input:
+ * angle1 ::
+ * First angle.
+ *
+ * angle2 ::
+ * Second angle.
+ *
+ * @return:
+ * Constrained value of `value2-value1'.
+ *
+ */
+ FT_EXPORT( FT_Angle )
+ FT_Angle_Diff( FT_Angle angle1,
+ FT_Angle angle2 );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Unit
+ *
+ * @description:
+ * Return the unit vector corresponding to a given angle. After the
+ * call, the value of `vec.x' will be `cos(angle)', and the value of
+ * `vec.y' will be `sin(angle)'.
+ *
+ * This function is useful to retrieve both the sinus and cosinus of a
+ * given angle quickly.
+ *
+ * @output:
+ * vec ::
+ * The address of target vector.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ */
+ FT_EXPORT( void )
+ FT_Vector_Unit( FT_Vector* vec,
+ FT_Angle angle );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Rotate
+ *
+ * @description:
+ * Rotate a vector by a given angle.
+ *
+ * @inout:
+ * vec ::
+ * The address of target vector.
+ *
+ * @input:
+ * angle ::
+ * The input angle.
+ *
+ */
+ FT_EXPORT( void )
+ FT_Vector_Rotate( FT_Vector* vec,
+ FT_Angle angle );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Length
+ *
+ * @description:
+ * Return the length of a given vector.
+ *
+ * @input:
+ * vec ::
+ * The address of target vector.
+ *
+ * @return:
+ * The vector length, expressed in the same units that the original
+ * vector coordinates.
+ *
+ */
+ FT_EXPORT( FT_Fixed )
+ FT_Vector_Length( FT_Vector* vec );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Vector_Polarize
+ *
+ * @description:
+ * Compute both the length and angle of a given vector.
+ *
+ * @input:
+ * vec ::
+ * The address of source vector.
+ *
+ * @output:
+ * length ::
+ * The vector length.
+ *
+ * angle ::
+ * The vector angle.
+ *
+ */
+ FT_EXPORT( void )
+ FT_Vector_Polarize( FT_Vector* vec,
+ FT_Fixed *length,
+ FT_Angle *angle );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Vector_From_Polar
+ *
+ * @description:
+ * Compute vector coordinates from a length and angle.
+ *
+ * @output:
+ * vec ::
+ * The address of source vector.
+ *
+ * @input:
+ * length ::
+ * The vector length.
+ *
+ * angle ::
+ * The vector angle.
+ *
+ */
+ FT_EXPORT( void )
+ FT_Vector_From_Polar( FT_Vector* vec,
+ FT_Fixed length,
+ FT_Angle angle );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTTRIGON_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftttdrv.h b/src/3rdparty/freetype/include/freetype/ftttdrv.h
new file mode 100644
index 0000000000..dc0081a0b9
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftttdrv.h
@@ -0,0 +1,310 @@
+/***************************************************************************/
+/* */
+/* ftttdrv.h */
+/* */
+/* FreeType API for controlling the TrueType driver */
+/* (specification only). */
+/* */
+/* Copyright 2013-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTTTDRV_H__
+#define __FTTTDRV_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * tt_driver
+ *
+ * @title:
+ * The TrueType driver
+ *
+ * @abstract:
+ * Controlling the TrueType driver module.
+ *
+ * @description:
+ * While FreeType's TrueType driver doesn't expose API functions by
+ * itself, it is possible to control its behaviour with @FT_Property_Set
+ * and @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * The TrueType driver's module name is `truetype'.
+ *
+ * We start with a list of definitions, kindly provided by Greg
+ * Hitchcock.
+ *
+ * _Bi-Level_ _Rendering_
+ *
+ * Monochromatic rendering, exclusively used in the early days of
+ * TrueType by both Apple and Microsoft. Microsoft's GDI interface
+ * supported hinting of the right-side bearing point, such that the
+ * advance width could be non-linear. Most often this was done to
+ * achieve some level of glyph symmetry. To enable reasonable
+ * performance (e.g., not having to run hinting on all glyphs just to
+ * get the widths) there was a bit in the head table indicating if the
+ * side bearing was hinted, and additional tables, `hdmx' and `LTSH', to
+ * cache hinting widths across multiple sizes and device aspect ratios.
+ *
+ * _Font_ _Smoothing_
+ *
+ * Microsoft's GDI implementation of anti-aliasing. Not traditional
+ * anti-aliasing as the outlines were hinted before the sampling. The
+ * widths matched the bi-level rendering.
+ *
+ * _ClearType_ _Rendering_
+ *
+ * Technique that uses physical subpixels to improve rendering on LCD
+ * (and other) displays. Because of the higher resolution, many methods
+ * of improving symmetry in glyphs through hinting the right-side
+ * bearing were no longer necessary. This lead to what GDI calls
+ * `natural widths' ClearType, see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec21. Since hinting
+ * has extra resolution, most non-linearity went away, but it is still
+ * possible for hints to change the advance widths in this mode.
+ *
+ * _ClearType_ _Compatible_ _Widths_
+ *
+ * One of the earliest challenges with ClearType was allowing the
+ * implementation in GDI to be selected without requiring all UI and
+ * documents to reflow. To address this, a compatible method of
+ * rendering ClearType was added where the font hints are executed once
+ * to determine the width in bi-level rendering, and then re-run in
+ * ClearType, with the difference in widths being absorbed in the font
+ * hints for ClearType (mostly in the white space of hints); see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec20. Somewhat by
+ * definition, compatible width ClearType allows for non-linear widths,
+ * but only when the bi-level version has non-linear widths.
+ *
+ * _ClearType_ _Subpixel_ _Positioning_
+ *
+ * One of the nice benefits of ClearType is the ability to more crisply
+ * display fractional widths; unfortunately, the GDI model of integer
+ * bitmaps did not support this. However, the WPF and Direct Write
+ * frameworks do support fractional widths. DWrite calls this `natural
+ * mode', not to be confused with GDI's `natural widths'. Subpixel
+ * positioning, in the current implementation of Direct Write,
+ * unfortunately does not support hinted advance widths, see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec22. Note that the
+ * TrueType interpreter fully allows the advance width to be adjusted in
+ * this mode, just the DWrite client will ignore those changes.
+ *
+ * _ClearType_ _Backwards_ _Compatibility_
+ *
+ * This is a set of exceptions made in the TrueType interpreter to
+ * minimize hinting techniques that were problematic with the extra
+ * resolution of ClearType; see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and
+ * http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
+ * This technique is not to be confused with ClearType compatible
+ * widths. ClearType backwards compatibility has no direct impact on
+ * changing advance widths, but there might be an indirect impact on
+ * disabling some deltas. This could be worked around in backwards
+ * compatibility mode.
+ *
+ * _Native_ _ClearType_ _Mode_
+ *
+ * (Not to be confused with `natural widths'.) This mode removes all
+ * the exceptions in the TrueType interpreter when running with
+ * ClearType. Any issues on widths would still apply, though.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * interpreter-version
+ *
+ * @description:
+ * Currently, two versions are available, representing the bytecode
+ * interpreter with and without subpixel hinting support,
+ * respectively. The default is subpixel support if
+ * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
+ * support otherwise (since it isn't available then).
+ *
+ * If subpixel hinting is on, many TrueType bytecode instructions behave
+ * differently compared to B/W or grayscale rendering (except if `native
+ * ClearType' is selected by the font). The main idea is to render at a
+ * much increased horizontal resolution, then sampling down the created
+ * output to subpixel precision. However, many older fonts are not
+ * suited to this and must be specially taken care of by applying
+ * (hardcoded) font-specific tweaks.
+ *
+ * Details on subpixel hinting and some of the necessary tweaks can be
+ * found in Greg Hitchcock's whitepaper at
+ * `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
+ *
+ * The following example code demonstrates how to activate subpixel
+ * hinting (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "truetype",
+ * "interpreter-version",
+ * &interpreter_version );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * TT_INTERPRETER_VERSION_XXX
+ *
+ * @description:
+ * A list of constants used for the @interpreter-version property to
+ * select the hinting engine for Truetype fonts.
+ *
+ * The numeric value in the constant names represents the version
+ * number as returned by the `GETINFO' bytecode instruction.
+ *
+ * @values:
+ * TT_INTERPRETER_VERSION_35 ::
+ * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
+ * Windows~98; only grayscale and B/W rasterizing is supported.
+ *
+ * TT_INTERPRETER_VERSION_38 ::
+ * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
+ * equivalent to the hinting provided by DirectWrite ClearType (as
+ * can be found, for example, in the Internet Explorer~9 running on
+ * Windows~7).
+ *
+ * @note:
+ * This property controls the behaviour of the bytecode interpreter
+ * and thus how outlines get hinted. It does *not* control how glyph
+ * get rasterized! In particular, it does not control subpixel color
+ * filtering.
+ *
+ * If FreeType has not been compiled with configuration option
+ * FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
+ * `FT_Err_Unimplemented_Feature' error.
+ *
+ * Depending on the graphics framework, Microsoft uses different
+ * bytecode and rendering engines. As a consequence, the version
+ * numbers returned by a call to the `GETINFO' bytecode instruction are
+ * more convoluted than desired.
+ *
+ * Here are two tables that try to shed some light on the possible
+ * values for the MS rasterizer engine, together with the additional
+ * features introduced by it.
+ *
+ * {
+ * GETINFO framework version feature
+ * -------------------------------------------------------------------
+ * 3 GDI (Win 3.1), v1.0 16-bit, first version
+ * TrueImage
+ * 33 GDI (Win NT 3.1), v1.5 32-bit
+ * HP Laserjet
+ * 34 GDI (Win 95) v1.6 font smoothing,
+ * new SCANTYPE opcode
+ * 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET
+ * bits in composite glyphs
+ * 36 MGDI (Win CE 2) v1.6+ classic ClearType
+ * 37 GDI (XP and later), v1.8 ClearType
+ * GDI+ old (before Vista)
+ * 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType,
+ * WPF Y-direction ClearType,
+ * additional error checking
+ * 39 DWrite (before Win 8) v2.0 subpixel ClearType flags
+ * in GETINFO opcode,
+ * bug fixes
+ * 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag
+ * DWrite (Win 8) in GETINFO opcode,
+ * Gray ClearType
+ * }
+ *
+ * The `version' field gives a rough orientation only, since some
+ * applications provided certain features much earlier (as an example,
+ * Microsoft Reader used subpixel and Y-direction ClearType already in
+ * Windows 2000). Similarly, updates to a given framework might include
+ * improved hinting support.
+ *
+ * {
+ * version sampling rendering comment
+ * x y x y
+ * --------------------------------------------------------------
+ * v1.0 normal normal B/W B/W bi-level
+ * v1.6 high high gray gray grayscale
+ * v1.8 high normal color-filter B/W (GDI) ClearType
+ * v1.9 high high color-filter gray Color ClearType
+ * v2.1 high normal gray B/W Gray ClearType
+ * v2.1 high high gray gray Gray ClearType
+ * }
+ *
+ * Color and Gray ClearType are the two available variants of
+ * `Y-direction ClearType', meaning grayscale rasterization along the
+ * Y-direction; the name used in the TrueType specification for this
+ * feature is `symmetric smoothing'. `Classic ClearType' is the
+ * original algorithm used before introducing a modified version in
+ * Win~XP. Another name for v1.6's grayscale rendering is `font
+ * smoothing', and `Color ClearType' is sometimes also called `DWrite
+ * ClearType'. To differentiate between today's Color ClearType and the
+ * earlier ClearType variant with B/W rendering along the vertical axis,
+ * the latter is sometimes called `GDI ClearType'.
+ *
+ * `Normal' and `high' sampling describe the (virtual) resolution to
+ * access the rasterized outline after the hinting process. `Normal'
+ * means 1 sample per grid line (i.e., B/W). In the current Microsoft
+ * implementation, `high' means an extra virtual resolution of 16x16 (or
+ * 16x1) grid lines per pixel for bytecode instructions like `MIRP'.
+ * After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
+ * lines for color filtering if Color ClearType is activated.
+ *
+ * Note that `Gray ClearType' is essentially the same as v1.6's
+ * grayscale rendering. However, the GETINFO instruction handles it
+ * differently: v1.6 returns bit~12 (hinting for grayscale), while v2.1
+ * returns bits~13 (hinting for ClearType), 18 (symmetrical smoothing),
+ * and~19 (Gray ClearType). Also, this mode respects bits 2 and~3 for
+ * the version~1 gasp table exclusively (like Color ClearType), while
+ * v1.6 only respects the values of version~0 (bits 0 and~1).
+ *
+ * FreeType doesn't provide all capabilities of the most recent
+ * ClearType incarnation, thus we identify our subpixel support as
+ * version~38.
+ *
+ */
+#define TT_INTERPRETER_VERSION_35 35
+#define TT_INTERPRETER_VERSION_38 38
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTTTDRV_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/fttypes.h b/src/3rdparty/freetype/include/freetype/fttypes.h
new file mode 100644
index 0000000000..706a1be4ef
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/fttypes.h
@@ -0,0 +1,602 @@
+/***************************************************************************/
+/* */
+/* fttypes.h */
+/* */
+/* FreeType simple types definitions (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTTYPES_H__
+#define __FTTYPES_H__
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_SYSTEM_H
+#include FT_IMAGE_H
+
+#include <stddef.h>
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /* <Title> */
+ /* Basic Data Types */
+ /* */
+ /* <Abstract> */
+ /* The basic data types defined by the library. */
+ /* */
+ /* <Description> */
+ /* This section contains the basic data types defined by FreeType~2, */
+ /* ranging from simple scalar types to bitmap descriptors. More */
+ /* font-specific structures are defined in a different section. */
+ /* */
+ /* <Order> */
+ /* FT_Byte */
+ /* FT_Bytes */
+ /* FT_Char */
+ /* FT_Int */
+ /* FT_UInt */
+ /* FT_Int16 */
+ /* FT_UInt16 */
+ /* FT_Int32 */
+ /* FT_UInt32 */
+ /* FT_Int64 */
+ /* FT_UInt64 */
+ /* FT_Short */
+ /* FT_UShort */
+ /* FT_Long */
+ /* FT_ULong */
+ /* FT_Bool */
+ /* FT_Offset */
+ /* FT_PtrDist */
+ /* FT_String */
+ /* FT_Tag */
+ /* FT_Error */
+ /* FT_Fixed */
+ /* FT_Pointer */
+ /* FT_Pos */
+ /* FT_Vector */
+ /* FT_BBox */
+ /* FT_Matrix */
+ /* FT_FWord */
+ /* FT_UFWord */
+ /* FT_F2Dot14 */
+ /* FT_UnitVector */
+ /* FT_F26Dot6 */
+ /* FT_Data */
+ /* */
+ /* FT_MAKE_TAG */
+ /* */
+ /* FT_Generic */
+ /* FT_Generic_Finalizer */
+ /* */
+ /* FT_Bitmap */
+ /* FT_Pixel_Mode */
+ /* FT_Palette_Mode */
+ /* FT_Glyph_Format */
+ /* FT_IMAGE_TAG */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Bool */
+ /* */
+ /* <Description> */
+ /* A typedef of unsigned char, used for simple booleans. As usual, */
+ /* values 1 and~0 represent true and false, respectively. */
+ /* */
+ typedef unsigned char FT_Bool;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_FWord */
+ /* */
+ /* <Description> */
+ /* A signed 16-bit integer used to store a distance in original font */
+ /* units. */
+ /* */
+ typedef signed short FT_FWord; /* distance in FUnits */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UFWord */
+ /* */
+ /* <Description> */
+ /* An unsigned 16-bit integer used to store a distance in original */
+ /* font units. */
+ /* */
+ typedef unsigned short FT_UFWord; /* unsigned distance */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Char */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the _signed_ char type. */
+ /* */
+ typedef signed char FT_Char;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Byte */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the _unsigned_ char type. */
+ /* */
+ typedef unsigned char FT_Byte;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Bytes */
+ /* */
+ /* <Description> */
+ /* A typedef for constant memory areas. */
+ /* */
+ typedef const FT_Byte* FT_Bytes;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Tag */
+ /* */
+ /* <Description> */
+ /* A typedef for 32-bit tags (as used in the SFNT format). */
+ /* */
+ typedef FT_UInt32 FT_Tag;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_String */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the char type, usually used for strings. */
+ /* */
+ typedef char FT_String;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Short */
+ /* */
+ /* <Description> */
+ /* A typedef for signed short. */
+ /* */
+ typedef signed short FT_Short;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UShort */
+ /* */
+ /* <Description> */
+ /* A typedef for unsigned short. */
+ /* */
+ typedef unsigned short FT_UShort;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int */
+ /* */
+ /* <Description> */
+ /* A typedef for the int type. */
+ /* */
+ typedef signed int FT_Int;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt */
+ /* */
+ /* <Description> */
+ /* A typedef for the unsigned int type. */
+ /* */
+ typedef unsigned int FT_UInt;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Long */
+ /* */
+ /* <Description> */
+ /* A typedef for signed long. */
+ /* */
+ typedef signed long FT_Long;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_ULong */
+ /* */
+ /* <Description> */
+ /* A typedef for unsigned long. */
+ /* */
+ typedef unsigned long FT_ULong;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_F2Dot14 */
+ /* */
+ /* <Description> */
+ /* A signed 2.14 fixed-point type used for unit vectors. */
+ /* */
+ typedef signed short FT_F2Dot14;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_F26Dot6 */
+ /* */
+ /* <Description> */
+ /* A signed 26.6 fixed-point type used for vectorial pixel */
+ /* coordinates. */
+ /* */
+ typedef signed long FT_F26Dot6;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Fixed */
+ /* */
+ /* <Description> */
+ /* This type is used to store 16.16 fixed-point values, like scaling */
+ /* values or matrix coefficients. */
+ /* */
+ typedef signed long FT_Fixed;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Error */
+ /* */
+ /* <Description> */
+ /* The FreeType error code type. A value of~0 is always interpreted */
+ /* as a successful operation. */
+ /* */
+ typedef int FT_Error;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Pointer */
+ /* */
+ /* <Description> */
+ /* A simple typedef for a typeless pointer. */
+ /* */
+ typedef void* FT_Pointer;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Offset */
+ /* */
+ /* <Description> */
+ /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
+ /* _unsigned_ integer type used to express a file size or position, */
+ /* or a memory block size. */
+ /* */
+ typedef size_t FT_Offset;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_PtrDist */
+ /* */
+ /* <Description> */
+ /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
+ /* largest _signed_ integer type used to express the distance */
+ /* between two pointers. */
+ /* */
+ typedef ft_ptrdiff_t FT_PtrDist;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_UnitVector */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2D vector unit vector. Uses */
+ /* FT_F2Dot14 types. */
+ /* */
+ /* <Fields> */
+ /* x :: Horizontal coordinate. */
+ /* */
+ /* y :: Vertical coordinate. */
+ /* */
+ typedef struct FT_UnitVector_
+ {
+ FT_F2Dot14 x;
+ FT_F2Dot14 y;
+
+ } FT_UnitVector;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Matrix */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2x2 matrix. Coefficients are */
+ /* in 16.16 fixed-point format. The computation performed is: */
+ /* */
+ /* { */
+ /* x' = x*xx + y*xy */
+ /* y' = x*yx + y*yy */
+ /* } */
+ /* */
+ /* <Fields> */
+ /* xx :: Matrix coefficient. */
+ /* */
+ /* xy :: Matrix coefficient. */
+ /* */
+ /* yx :: Matrix coefficient. */
+ /* */
+ /* yy :: Matrix coefficient. */
+ /* */
+ typedef struct FT_Matrix_
+ {
+ FT_Fixed xx, xy;
+ FT_Fixed yx, yy;
+
+ } FT_Matrix;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Data */
+ /* */
+ /* <Description> */
+ /* Read-only binary data represented as a pointer and a length. */
+ /* */
+ /* <Fields> */
+ /* pointer :: The data. */
+ /* */
+ /* length :: The length of the data in bytes. */
+ /* */
+ typedef struct FT_Data_
+ {
+ const FT_Byte* pointer;
+ FT_Int length;
+
+ } FT_Data;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Generic_Finalizer */
+ /* */
+ /* <Description> */
+ /* Describe a function used to destroy the `client' data of any */
+ /* FreeType object. See the description of the @FT_Generic type for */
+ /* details of usage. */
+ /* */
+ /* <Input> */
+ /* The address of the FreeType object that is under finalization. */
+ /* Its client data is accessed through its `generic' field. */
+ /* */
+ typedef void (*FT_Generic_Finalizer)(void* object);
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Generic */
+ /* */
+ /* <Description> */
+ /* Client applications often need to associate their own data to a */
+ /* variety of FreeType core objects. For example, a text layout API */
+ /* might want to associate a glyph cache to a given size object. */
+ /* */
+ /* Some FreeType object contains a `generic' field, of type */
+ /* FT_Generic, which usage is left to client applications and font */
+ /* servers. */
+ /* */
+ /* It can be used to store a pointer to client-specific data, as well */
+ /* as the address of a `finalizer' function, which will be called by */
+ /* FreeType when the object is destroyed (for example, the previous */
+ /* client example would put the address of the glyph cache destructor */
+ /* in the `finalizer' field). */
+ /* */
+ /* <Fields> */
+ /* data :: A typeless pointer to any client-specified data. This */
+ /* field is completely ignored by the FreeType library. */
+ /* */
+ /* finalizer :: A pointer to a `generic finalizer' function, which */
+ /* will be called when the object is destroyed. If this */
+ /* field is set to NULL, no code will be called. */
+ /* */
+ typedef struct FT_Generic_
+ {
+ void* data;
+ FT_Generic_Finalizer finalizer;
+
+ } FT_Generic;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_MAKE_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four-letter tags that are used to label */
+ /* TrueType tables into an unsigned long, to be used within FreeType. */
+ /* */
+ /* <Note> */
+ /* The produced values *must* be 32-bit integers. Don't redefine */
+ /* this macro. */
+ /* */
+#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
+ (FT_Tag) \
+ ( ( (FT_ULong)_x1 << 24 ) | \
+ ( (FT_ULong)_x2 << 16 ) | \
+ ( (FT_ULong)_x3 << 8 ) | \
+ (FT_ULong)_x4 )
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* L I S T M A N A G E M E N T */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* list_processing */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_ListNode */
+ /* */
+ /* <Description> */
+ /* Many elements and objects in FreeType are listed through an */
+ /* @FT_List record (see @FT_ListRec). As its name suggests, an */
+ /* FT_ListNode is a handle to a single list element. */
+ /* */
+ typedef struct FT_ListNodeRec_* FT_ListNode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_List */
+ /* */
+ /* <Description> */
+ /* A handle to a list record (see @FT_ListRec). */
+ /* */
+ typedef struct FT_ListRec_* FT_List;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ListNodeRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold a single list element. */
+ /* */
+ /* <Fields> */
+ /* prev :: The previous element in the list. NULL if first. */
+ /* */
+ /* next :: The next element in the list. NULL if last. */
+ /* */
+ /* data :: A typeless pointer to the listed object. */
+ /* */
+ typedef struct FT_ListNodeRec_
+ {
+ FT_ListNode prev;
+ FT_ListNode next;
+ void* data;
+
+ } FT_ListNodeRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ListRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold a simple doubly-linked list. These are */
+ /* used in many parts of FreeType. */
+ /* */
+ /* <Fields> */
+ /* head :: The head (first element) of doubly-linked list. */
+ /* */
+ /* tail :: The tail (last element) of doubly-linked list. */
+ /* */
+ typedef struct FT_ListRec_
+ {
+ FT_ListNode head;
+ FT_ListNode tail;
+
+ } FT_ListRec;
+
+ /* */
+
+
+#define FT_IS_EMPTY( list ) ( (list).head == 0 )
+#define FT_BOOL( x ) ( (FT_Bool)( x ) )
+
+ /* concatenate C tokens */
+#define FT_ERR_XCAT( x, y ) x ## y
+#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
+
+ /* see `ftmoderr.h' for descriptions of the following macros */
+
+#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
+
+#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
+#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
+
+#define FT_ERR_EQ( x, e ) \
+ ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )
+#define FT_ERR_NEQ( x, e ) \
+ ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )
+
+
+FT_END_HEADER
+
+#endif /* __FTTYPES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftwinfnt.h b/src/3rdparty/freetype/include/freetype/ftwinfnt.h
new file mode 100644
index 0000000000..caedaa1cc7
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftwinfnt.h
@@ -0,0 +1,275 @@
+/***************************************************************************/
+/* */
+/* ftwinfnt.h */
+/* */
+/* FreeType API for accessing Windows fnt-specific data. */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTWINFNT_H__
+#define __FTWINFNT_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* winfnt_fonts */
+ /* */
+ /* <Title> */
+ /* Window FNT Files */
+ /* */
+ /* <Abstract> */
+ /* Windows FNT specific API. */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of Windows FNT specific */
+ /* functions. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @enum:
+ * FT_WinFNT_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `charset' byte in
+ * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
+ * encodings (except for cp1361) can be found at
+ * ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
+ * subdirectory. cp1361 is roughly a superset of
+ * MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
+ *
+ * @values:
+ * FT_WinFNT_ID_DEFAULT ::
+ * This is used for font enumeration and font creation as a
+ * `don't care' value. Valid font files don't contain this value.
+ * When querying for information about the character set of the font
+ * that is currently selected into a specified device context, this
+ * return value (of the related Windows API) simply denotes failure.
+ *
+ * FT_WinFNT_ID_SYMBOL ::
+ * There is no known mapping table available.
+ *
+ * FT_WinFNT_ID_MAC ::
+ * Mac Roman encoding.
+ *
+ * FT_WinFNT_ID_OEM ::
+ * From Michael Pöttgen <michael@poettgen.de>:
+ *
+ * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
+ * is used for the charset of vector fonts, like `modern.fon',
+ * `roman.fon', and `script.fon' on Windows.
+ *
+ * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
+ * specifies a character set that is operating-system dependent.
+ *
+ * The `IFIMETRICS' documentation from the `Windows Driver
+ * Development Kit' says: This font supports an OEM-specific
+ * character set. The OEM character set is system dependent.
+ *
+ * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
+ * second default codepage that most international versions of
+ * Windows have. It is one of the OEM codepages from
+ *
+ * https://msdn.microsoft.com/en-us/goglobal/bb964655,
+ *
+ * and is used for the `DOS boxes', to support legacy applications.
+ * A German Windows version for example usually uses ANSI codepage
+ * 1252 and OEM codepage 850.
+ *
+ * FT_WinFNT_ID_CP874 ::
+ * A superset of Thai TIS 620 and ISO 8859-11.
+ *
+ * FT_WinFNT_ID_CP932 ::
+ * A superset of Japanese Shift-JIS (with minor deviations).
+ *
+ * FT_WinFNT_ID_CP936 ::
+ * A superset of simplified Chinese GB 2312-1980 (with different
+ * ordering and minor deviations).
+ *
+ * FT_WinFNT_ID_CP949 ::
+ * A superset of Korean Hangul KS~C 5601-1987 (with different
+ * ordering and minor deviations).
+ *
+ * FT_WinFNT_ID_CP950 ::
+ * A superset of traditional Chinese Big~5 ETen (with different
+ * ordering and minor deviations).
+ *
+ * FT_WinFNT_ID_CP1250 ::
+ * A superset of East European ISO 8859-2 (with slightly different
+ * ordering).
+ *
+ * FT_WinFNT_ID_CP1251 ::
+ * A superset of Russian ISO 8859-5 (with different ordering).
+ *
+ * FT_WinFNT_ID_CP1252 ::
+ * ANSI encoding. A superset of ISO 8859-1.
+ *
+ * FT_WinFNT_ID_CP1253 ::
+ * A superset of Greek ISO 8859-7 (with minor modifications).
+ *
+ * FT_WinFNT_ID_CP1254 ::
+ * A superset of Turkish ISO 8859-9.
+ *
+ * FT_WinFNT_ID_CP1255 ::
+ * A superset of Hebrew ISO 8859-8 (with some modifications).
+ *
+ * FT_WinFNT_ID_CP1256 ::
+ * A superset of Arabic ISO 8859-6 (with different ordering).
+ *
+ * FT_WinFNT_ID_CP1257 ::
+ * A superset of Baltic ISO 8859-13 (with some deviations).
+ *
+ * FT_WinFNT_ID_CP1258 ::
+ * For Vietnamese. This encoding doesn't cover all necessary
+ * characters.
+ *
+ * FT_WinFNT_ID_CP1361 ::
+ * Korean (Johab).
+ */
+
+#define FT_WinFNT_ID_CP1252 0
+#define FT_WinFNT_ID_DEFAULT 1
+#define FT_WinFNT_ID_SYMBOL 2
+#define FT_WinFNT_ID_MAC 77
+#define FT_WinFNT_ID_CP932 128
+#define FT_WinFNT_ID_CP949 129
+#define FT_WinFNT_ID_CP1361 130
+#define FT_WinFNT_ID_CP936 134
+#define FT_WinFNT_ID_CP950 136
+#define FT_WinFNT_ID_CP1253 161
+#define FT_WinFNT_ID_CP1254 162
+#define FT_WinFNT_ID_CP1258 163
+#define FT_WinFNT_ID_CP1255 177
+#define FT_WinFNT_ID_CP1256 178
+#define FT_WinFNT_ID_CP1257 186
+#define FT_WinFNT_ID_CP1251 204
+#define FT_WinFNT_ID_CP874 222
+#define FT_WinFNT_ID_CP1250 238
+#define FT_WinFNT_ID_OEM 255
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_WinFNT_HeaderRec */
+ /* */
+ /* <Description> */
+ /* Windows FNT Header info. */
+ /* */
+ typedef struct FT_WinFNT_HeaderRec_
+ {
+ FT_UShort version;
+ FT_ULong file_size;
+ FT_Byte copyright[60];
+ FT_UShort file_type;
+ FT_UShort nominal_point_size;
+ FT_UShort vertical_resolution;
+ FT_UShort horizontal_resolution;
+ FT_UShort ascent;
+ FT_UShort internal_leading;
+ FT_UShort external_leading;
+ FT_Byte italic;
+ FT_Byte underline;
+ FT_Byte strike_out;
+ FT_UShort weight;
+ FT_Byte charset;
+ FT_UShort pixel_width;
+ FT_UShort pixel_height;
+ FT_Byte pitch_and_family;
+ FT_UShort avg_width;
+ FT_UShort max_width;
+ FT_Byte first_char;
+ FT_Byte last_char;
+ FT_Byte default_char;
+ FT_Byte break_char;
+ FT_UShort bytes_per_row;
+ FT_ULong device_offset;
+ FT_ULong face_name_offset;
+ FT_ULong bits_pointer;
+ FT_ULong bits_offset;
+ FT_Byte reserved;
+ FT_ULong flags;
+ FT_UShort A_space;
+ FT_UShort B_space;
+ FT_UShort C_space;
+ FT_UShort color_table_offset;
+ FT_ULong reserved1[4];
+
+ } FT_WinFNT_HeaderRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_WinFNT_Header */
+ /* */
+ /* <Description> */
+ /* A handle to an @FT_WinFNT_HeaderRec structure. */
+ /* */
+ typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_WinFNT_Header
+ *
+ * @description:
+ * Retrieve a Windows FNT font info header.
+ *
+ * @input:
+ * face :: A handle to the input face.
+ *
+ * @output:
+ * aheader :: The WinFNT header.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * This function only works with Windows FNT faces, returning an error
+ * otherwise.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_WinFNT_Header( FT_Face face,
+ FT_WinFNT_HeaderRec *aheader );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTWINFNT_H__ */
+
+
+/* END */
+
+
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
diff --git a/src/3rdparty/freetype/include/freetype/internal/autohint.h b/src/3rdparty/freetype/include/freetype/internal/autohint.h
new file mode 100644
index 0000000000..8d5a9773cb
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/autohint.h
@@ -0,0 +1,244 @@
+/***************************************************************************/
+/* */
+/* autohint.h */
+/* */
+/* High-level `autohint' module-specific interface (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* The auto-hinter is used to load and automatically hint glyphs if a */
+ /* format-specific hinter isn't available. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __AUTOHINT_H__
+#define __AUTOHINT_H__
+
+
+ /*************************************************************************/
+ /* */
+ /* A small technical note regarding automatic hinting in order to */
+ /* clarify this module interface. */
+ /* */
+ /* An automatic hinter might compute two kinds of data for a given face: */
+ /* */
+ /* - global hints: Usually some metrics that describe global properties */
+ /* of the face. It is computed by scanning more or less */
+ /* aggressively the glyphs in the face, and thus can be */
+ /* very slow to compute (even if the size of global */
+ /* hints is really small). */
+ /* */
+ /* - glyph hints: These describe some important features of the glyph */
+ /* outline, as well as how to align them. They are */
+ /* generally much faster to compute than global hints. */
+ /* */
+ /* The current FreeType auto-hinter does a pretty good job while */
+ /* performing fast computations for both global and glyph hints. */
+ /* However, we might be interested in introducing more complex and */
+ /* powerful algorithms in the future, like the one described in the John */
+ /* D. Hobby paper, which unfortunately requires a lot more horsepower. */
+ /* */
+ /* Because a sufficiently sophisticated font management system would */
+ /* typically implement an LRU cache of opened face objects to reduce */
+ /* memory usage, it is a good idea to be able to avoid recomputing */
+ /* global hints every time the same face is re-opened. */
+ /* */
+ /* We thus provide the ability to cache global hints outside of the face */
+ /* object, in order to speed up font re-opening time. Of course, this */
+ /* feature is purely optional, so most client programs won't even notice */
+ /* it. */
+ /* */
+ /* I initially thought that it would be a good idea to cache the glyph */
+ /* hints too. However, my general idea now is that if you really need */
+ /* to cache these too, you are simply in need of a new font format, */
+ /* where all this information could be stored within the font file and */
+ /* decoded on the fly. */
+ /* */
+ /*************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_AutoHinter_GlobalGetFunc */
+ /* */
+ /* <Description> */
+ /* Retrieve the global hints computed for a given face object. The */
+ /* resulting data is dissociated from the face and will survive a */
+ /* call to FT_Done_Face(). It must be discarded through the API */
+ /* FT_AutoHinter_GlobalDoneFunc(). */
+ /* */
+ /* <Input> */
+ /* hinter :: A handle to the source auto-hinter. */
+ /* */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Output> */
+ /* global_hints :: A typeless pointer to the global hints. */
+ /* */
+ /* global_len :: The size in bytes of the global hints. */
+ /* */
+ typedef void
+ (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
+ FT_Face face,
+ void** global_hints,
+ long* global_len );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_AutoHinter_GlobalDoneFunc */
+ /* */
+ /* <Description> */
+ /* Discard the global hints retrieved through */
+ /* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */
+ /* are freed from memory. */
+ /* */
+ /* <Input> */
+ /* hinter :: A handle to the auto-hinter module. */
+ /* */
+ /* global :: A pointer to retrieved global hints to discard. */
+ /* */
+ typedef void
+ (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
+ void* global );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_AutoHinter_GlobalResetFunc */
+ /* */
+ /* <Description> */
+ /* This function is used to recompute the global metrics in a given */
+ /* font. This is useful when global font data changes (e.g. Multiple */
+ /* Masters fonts where blend coordinates change). */
+ /* */
+ /* <Input> */
+ /* hinter :: A handle to the source auto-hinter. */
+ /* */
+ /* face :: A handle to the face. */
+ /* */
+ typedef void
+ (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
+ FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_AutoHinter_GlyphLoadFunc */
+ /* */
+ /* <Description> */
+ /* This function is used to load, scale, and automatically hint a */
+ /* glyph from a given face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the face. */
+ /* */
+ /* glyph_index :: The glyph index. */
+ /* */
+ /* load_flags :: The load flags. */
+ /* */
+ /* <Note> */
+ /* This function is capable of loading composite glyphs by hinting */
+ /* each sub-glyph independently (which improves quality). */
+ /* */
+ /* It will call the font driver with @FT_Load_Glyph, with */
+ /* @FT_LOAD_NO_SCALE set. */
+ /* */
+ typedef FT_Error
+ (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
+ FT_GlyphSlot slot,
+ FT_Size size,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_AutoHinter_InterfaceRec */
+ /* */
+ /* <Description> */
+ /* The auto-hinter module's interface. */
+ /* */
+ typedef struct FT_AutoHinter_InterfaceRec_
+ {
+ FT_AutoHinter_GlobalResetFunc reset_face;
+ FT_AutoHinter_GlobalGetFunc get_global_hints;
+ FT_AutoHinter_GlobalDoneFunc done_global_hints;
+ FT_AutoHinter_GlyphLoadFunc load_glyph;
+
+ } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_AUTOHINTER_INTERFACE( \
+ class_, \
+ reset_face_, \
+ get_global_hints_, \
+ done_global_hints_, \
+ load_glyph_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_AutoHinter_InterfaceRec class_ = \
+ { \
+ reset_face_, \
+ get_global_hints_, \
+ done_global_hints_, \
+ load_glyph_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_AUTOHINTER_INTERFACE( \
+ class_, \
+ reset_face_, \
+ get_global_hints_, \
+ done_global_hints_, \
+ load_glyph_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_AutoHinter_InterfaceRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->reset_face = reset_face_; \
+ clazz->get_global_hints = get_global_hints_; \
+ clazz->done_global_hints = done_global_hints_; \
+ clazz->load_glyph = load_glyph_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+FT_END_HEADER
+
+#endif /* __AUTOHINT_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftcalc.h b/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
new file mode 100644
index 0000000000..67ade7e5f9
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
@@ -0,0 +1,418 @@
+/***************************************************************************/
+/* */
+/* ftcalc.h */
+/* */
+/* Arithmetic computations (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCALC_H__
+#define __FTCALC_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
+ /* */
+ /*************************************************************************/
+
+#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
+ /* Provide assembler fragments for performance-critical functions. */
+ /* These must be defined `static __inline__' with GCC. */
+
+#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
+
+ /* documentation is in freetype.h */
+
+ static __inline FT_Int32
+ FT_MulFix_arm( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 t, t2;
+
+
+ __asm
+ {
+ smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
+ mov a, t, asr #31 /* a = (hi >> 31) */
+ add a, a, #0x8000 /* a += 0x8000 */
+ adds t2, t2, a /* t2 += a */
+ adc t, t, #0 /* t += carry */
+ mov a, t2, lsr #16 /* a = t2 >> 16 */
+ orr a, a, t, lsl #16 /* a |= t << 16 */
+ }
+ return a;
+ }
+
+#endif /* __CC_ARM || __ARMCC__ */
+
+
+#ifdef __GNUC__
+
+#if defined( __arm__ ) && \
+ ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
+ !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
+
+ /* documentation is in freetype.h */
+
+ static __inline__ FT_Int32
+ FT_MulFix_arm( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 t, t2;
+
+
+ __asm__ __volatile__ (
+ "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
+ "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
+#if defined( __clang__ ) && defined( __thumb2__ )
+ "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
+#else
+ "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
+#endif
+ "adds %1, %1, %0\n\t" /* %1 += %0 */
+ "adc %2, %2, #0\n\t" /* %2 += carry */
+ "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
+ "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
+ : "=r"(a), "=&r"(t2), "=&r"(t)
+ : "r"(a), "r"(b)
+ : "cc" );
+ return a;
+ }
+
+#endif /* __arm__ && */
+ /* ( __thumb2__ || !__thumb__ ) && */
+ /* !( __CC_ARM || __ARMCC__ ) */
+
+
+#if defined( __i386__ )
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
+
+ /* documentation is in freetype.h */
+
+ static __inline__ FT_Int32
+ FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 result;
+
+
+ __asm__ __volatile__ (
+ "imul %%edx\n"
+ "movl %%edx, %%ecx\n"
+ "sarl $31, %%ecx\n"
+ "addl $0x8000, %%ecx\n"
+ "addl %%ecx, %%eax\n"
+ "adcl $0, %%edx\n"
+ "shrl $16, %%eax\n"
+ "shll $16, %%edx\n"
+ "addl %%edx, %%eax\n"
+ : "=a"(result), "=d"(b)
+ : "a"(a), "d"(b)
+ : "%ecx", "cc" );
+ return result;
+ }
+
+#endif /* i386 */
+
+#endif /* __GNUC__ */
+
+
+#ifdef _MSC_VER /* Visual C++ */
+
+#ifdef _M_IX86
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
+
+ /* documentation is in freetype.h */
+
+ static __inline FT_Int32
+ FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 result;
+
+ __asm
+ {
+ mov eax, a
+ mov edx, b
+ imul edx
+ mov ecx, edx
+ sar ecx, 31
+ add ecx, 8000h
+ add eax, ecx
+ adc edx, 0
+ shr eax, 16
+ shl edx, 16
+ add eax, edx
+ mov result, eax
+ }
+ return result;
+ }
+
+#endif /* _M_IX86 */
+
+#endif /* _MSC_VER */
+
+
+#if defined( __GNUC__ ) && defined( __x86_64__ )
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64
+
+ static __inline__ FT_Int32
+ FT_MulFix_x86_64( FT_Int32 a,
+ FT_Int32 b )
+ {
+ /* Temporarily disable the warning that C90 doesn't support */
+ /* `long long'. */
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
+#endif
+
+#if 1
+ /* Technically not an assembly fragment, but GCC does a really good */
+ /* job at inlining it and generating good machine code for it. */
+ long long ret, tmp;
+
+
+ ret = (long long)a * b;
+ tmp = ret >> 63;
+ ret += 0x8000 + tmp;
+
+ return (FT_Int32)( ret >> 16 );
+#else
+
+ /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */
+ /* code from the lines below. The main issue is that `wide_a' is not */
+ /* properly initialized by sign-extending `a'. Instead, the generated */
+ /* machine code assumes that the register that contains `a' on input */
+ /* can be used directly as a 64-bit value, which is wrong most of the */
+ /* time. */
+ long long wide_a = (long long)a;
+ long long wide_b = (long long)b;
+ long long result;
+
+
+ __asm__ __volatile__ (
+ "imul %2, %1\n"
+ "mov %1, %0\n"
+ "sar $63, %0\n"
+ "lea 0x8000(%1, %0), %0\n"
+ "sar $16, %0\n"
+ : "=&r"(result), "=&r"(wide_a)
+ : "r"(wide_b)
+ : "cc" );
+
+ return (FT_Int32)result;
+#endif
+
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
+#pragma GCC diagnostic pop
+#endif
+ }
+
+#endif /* __GNUC__ && __x86_64__ */
+
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
+#ifdef FT_MULFIX_ASSEMBLER
+#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
+#endif
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulDiv_No_Round */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation `(a*b)/c' */
+ /* (without rounding) with maximum accuracy (it uses a 64-bit */
+ /* intermediate integer whenever necessary). */
+ /* */
+ /* This function isn't necessarily as fast as some processor specific */
+ /* operations, but is at least completely portable. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. */
+ /* c :: The divisor. */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/c'. This function never traps when trying to */
+ /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
+ /* on the signs of `a' and `b'. */
+ /* */
+ FT_BASE( FT_Long )
+ FT_MulDiv_No_Round( FT_Long a,
+ FT_Long b,
+ FT_Long c );
+
+
+ /*
+ * A variant of FT_Matrix_Multiply which scales its result afterwards.
+ * The idea is that both `a' and `b' are scaled by factors of 10 so that
+ * the values are as precise as possible to get a correct result during
+ * the 64bit multiplication. Let `sa' and `sb' be the scaling factors of
+ * `a' and `b', respectively, then the scaling factor of the result is
+ * `sa*sb'.
+ */
+ FT_BASE( void )
+ FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
+ FT_Matrix *b,
+ FT_Long scaling );
+
+
+ /*
+ * A variant of FT_Vector_Transform. See comments for
+ * FT_Matrix_Multiply_Scaled.
+ */
+ FT_BASE( void )
+ FT_Vector_Transform_Scaled( FT_Vector* vector,
+ const FT_Matrix* matrix,
+ FT_Long scaling );
+
+
+ /*
+ * This function normalizes a vector and returns its original length.
+ * The normalized vector is a 16.16 fixed-point unit vector with length
+ * close to 0x10000. The accuracy of the returned length is limited to
+ * 16 bits also. The function utilizes quick inverse square root
+ * approximation without divisions and square roots relying on Newton's
+ * iterations instead.
+ */
+ FT_BASE( FT_UInt32 )
+ FT_Vector_NormLen( FT_Vector* vector );
+
+
+ /*
+ * Return -1, 0, or +1, depending on the orientation of a given corner.
+ * We use the Cartesian coordinate system, with positive vertical values
+ * going upwards. The function returns +1 if the corner turns to the
+ * left, -1 to the right, and 0 for undecidable cases.
+ */
+ FT_BASE( FT_Int )
+ ft_corner_orientation( FT_Pos in_x,
+ FT_Pos in_y,
+ FT_Pos out_x,
+ FT_Pos out_y );
+
+
+ /*
+ * Return TRUE if a corner is flat or nearly flat. This is equivalent to
+ * saying that the corner point is close to its neighbors, or inside an
+ * ellipse defined by the neighbor focal points to be more precise.
+ */
+ FT_BASE( FT_Int )
+ ft_corner_is_flat( FT_Pos in_x,
+ FT_Pos in_y,
+ FT_Pos out_x,
+ FT_Pos out_y );
+
+
+ /*
+ * Return the most significant bit index.
+ */
+
+#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
+#if defined( __GNUC__ ) && \
+ ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
+
+#if FT_SIZEOF_INT == 4
+
+#define FT_MSB( x ) ( 31 - __builtin_clz( x ) )
+
+#elif FT_SIZEOF_LONG == 4
+
+#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
+
+#endif
+
+#endif /* __GNUC__ */
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+#ifndef FT_MSB
+
+ FT_BASE( FT_Int )
+ FT_MSB( FT_UInt32 z );
+
+#endif
+
+
+ /*
+ * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
+ * two fixed-point arguments instead.
+ */
+ FT_BASE( FT_Fixed )
+ FT_Hypot( FT_Fixed x,
+ FT_Fixed y );
+
+
+#if 0
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_SqrtFixed */
+ /* */
+ /* <Description> */
+ /* Computes the square root of a 16.16 fixed-point value. */
+ /* */
+ /* <Input> */
+ /* x :: The value to compute the root for. */
+ /* */
+ /* <Return> */
+ /* The result of `sqrt(x)'. */
+ /* */
+ /* <Note> */
+ /* This function is not very fast. */
+ /* */
+ FT_BASE( FT_Int32 )
+ FT_SqrtFixed( FT_Int32 x );
+
+#endif /* 0 */
+
+
+#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
+#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
+#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
+#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
+#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
+#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
+
+#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
+ : ( -( ( 32 - (x) ) & -64 ) ) )
+
+
+FT_END_HEADER
+
+#endif /* __FTCALC_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftdebug.h b/src/3rdparty/freetype/include/freetype/internal/ftdebug.h
new file mode 100644
index 0000000000..216c73031e
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftdebug.h
@@ -0,0 +1,255 @@
+/***************************************************************************/
+/* */
+/* ftdebug.h */
+/* */
+/* Debugging and logging component (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/* */
+/* IMPORTANT: A description of FreeType's debugging support can be */
+/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
+/* understand this code. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTDEBUG_H__
+#define __FTDEBUG_H__
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
+ /* is already defined; this simplifies the following #ifdefs */
+ /* */
+#ifdef FT_DEBUG_LEVEL_TRACE
+#undef FT_DEBUG_LEVEL_ERROR
+#define FT_DEBUG_LEVEL_ERROR
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* Define the trace enums as well as the trace levels array when they */
+ /* are needed. */
+ /* */
+ /*************************************************************************/
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#define FT_TRACE_DEF( x ) trace_ ## x ,
+
+ /* defining the enumeration */
+ typedef enum FT_Trace_
+ {
+#include FT_INTERNAL_TRACE_H
+ trace_count
+
+ } FT_Trace;
+
+
+ /* defining the array of trace levels, provided by `src/base/ftdebug.c' */
+ extern int ft_trace_levels[trace_count];
+
+#undef FT_TRACE_DEF
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+
+ /*************************************************************************/
+ /* */
+ /* Define the FT_TRACE macro */
+ /* */
+ /* IMPORTANT! */
+ /* */
+ /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
+ /* value before using any TRACE macro. */
+ /* */
+ /*************************************************************************/
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#define FT_TRACE( level, varformat ) \
+ do \
+ { \
+ if ( ft_trace_levels[FT_COMPONENT] >= level ) \
+ FT_Message varformat; \
+ } while ( 0 )
+
+#else /* !FT_DEBUG_LEVEL_TRACE */
+
+#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
+
+#endif /* !FT_DEBUG_LEVEL_TRACE */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Trace_Get_Count */
+ /* */
+ /* <Description> */
+ /* Return the number of available trace components. */
+ /* */
+ /* <Return> */
+ /* The number of trace components. 0 if FreeType 2 is not built with */
+ /* FT_DEBUG_LEVEL_TRACE definition. */
+ /* */
+ /* <Note> */
+ /* This function may be useful if you want to access elements of */
+ /* the internal `ft_trace_levels' array by an index. */
+ /* */
+ FT_BASE( FT_Int )
+ FT_Trace_Get_Count( void );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Trace_Get_Name */
+ /* */
+ /* <Description> */
+ /* Return the name of a trace component. */
+ /* */
+ /* <Input> */
+ /* The index of the trace component. */
+ /* */
+ /* <Return> */
+ /* The name of the trace component. This is a statically allocated */
+ /* C string, so do not free it after use. NULL if FreeType 2 is not */
+ /* built with FT_DEBUG_LEVEL_TRACE definition. */
+ /* */
+ /* <Note> */
+ /* Use @FT_Trace_Get_Count to get the number of available trace */
+ /* components. */
+ /* */
+ /* This function may be useful if you want to control FreeType 2's */
+ /* debug level in your application. */
+ /* */
+ FT_BASE( const char* )
+ FT_Trace_Get_Name( FT_Int idx );
+
+
+ /*************************************************************************/
+ /* */
+ /* You need two opening and closing parentheses! */
+ /* */
+ /* Example: FT_TRACE0(( "Value is %i", foo )) */
+ /* */
+ /* Output of the FT_TRACEX macros is sent to stderr. */
+ /* */
+ /*************************************************************************/
+
+#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
+#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
+#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
+#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
+#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
+#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
+#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
+#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
+
+
+ /*************************************************************************/
+ /* */
+ /* Define the FT_ERROR macro. */
+ /* */
+ /* Output of this macro is sent to stderr. */
+ /* */
+ /*************************************************************************/
+
+#ifdef FT_DEBUG_LEVEL_ERROR
+
+#define FT_ERROR( varformat ) FT_Message varformat
+
+#else /* !FT_DEBUG_LEVEL_ERROR */
+
+#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
+
+#endif /* !FT_DEBUG_LEVEL_ERROR */
+
+
+ /*************************************************************************/
+ /* */
+ /* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw' */
+ /* makes it possible to easily set a breakpoint at this function. */
+ /* */
+ /*************************************************************************/
+
+#ifdef FT_DEBUG_LEVEL_ERROR
+
+#define FT_ASSERT( condition ) \
+ do \
+ { \
+ if ( !( condition ) ) \
+ FT_Panic( "assertion failed on line %d of file %s\n", \
+ __LINE__, __FILE__ ); \
+ } while ( 0 )
+
+#define FT_THROW( e ) \
+ ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ), \
+ __LINE__, \
+ __FILE__ ) | \
+ FT_ERR_CAT( FT_ERR_PREFIX, e ) )
+
+#else /* !FT_DEBUG_LEVEL_ERROR */
+
+#define FT_ASSERT( condition ) do { } while ( 0 )
+
+#define FT_THROW( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
+
+#endif /* !FT_DEBUG_LEVEL_ERROR */
+
+
+ /*************************************************************************/
+ /* */
+ /* Define `FT_Message' and `FT_Panic' when needed. */
+ /* */
+ /*************************************************************************/
+
+#ifdef FT_DEBUG_LEVEL_ERROR
+
+#include "stdio.h" /* for vfprintf() */
+
+ /* print a message */
+ FT_BASE( void )
+ FT_Message( const char* fmt,
+ ... );
+
+ /* print a message and exit */
+ FT_BASE( void )
+ FT_Panic( const char* fmt,
+ ... );
+
+ /* report file name and line number of an error */
+ FT_BASE( int )
+ FT_Throw( FT_Error error,
+ int line,
+ const char* file );
+
+#endif /* FT_DEBUG_LEVEL_ERROR */
+
+
+ FT_BASE( void )
+ ft_debug_init( void );
+
+FT_END_HEADER
+
+#endif /* __FTDEBUG_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftdriver.h b/src/3rdparty/freetype/include/freetype/internal/ftdriver.h
new file mode 100644
index 0000000000..16856d3df8
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftdriver.h
@@ -0,0 +1,409 @@
+/***************************************************************************/
+/* */
+/* ftdriver.h */
+/* */
+/* FreeType font driver interface (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTDRIVER_H__
+#define __FTDRIVER_H__
+
+
+#include <ft2build.h>
+#include FT_MODULE_H
+
+
+FT_BEGIN_HEADER
+
+
+ typedef FT_Error
+ (*FT_Face_InitFunc)( FT_Stream stream,
+ FT_Face face,
+ FT_Int typeface_index,
+ FT_Int num_params,
+ FT_Parameter* parameters );
+
+ typedef void
+ (*FT_Face_DoneFunc)( FT_Face face );
+
+
+ typedef FT_Error
+ (*FT_Size_InitFunc)( FT_Size size );
+
+ typedef void
+ (*FT_Size_DoneFunc)( FT_Size size );
+
+
+ typedef FT_Error
+ (*FT_Slot_InitFunc)( FT_GlyphSlot slot );
+
+ typedef void
+ (*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
+
+
+ typedef FT_Error
+ (*FT_Size_RequestFunc)( FT_Size size,
+ FT_Size_Request req );
+
+ typedef FT_Error
+ (*FT_Size_SelectFunc)( FT_Size size,
+ FT_ULong size_index );
+
+ typedef FT_Error
+ (*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
+ FT_Size size,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+ typedef FT_UInt
+ (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
+ FT_Long charcode );
+
+ typedef FT_Long
+ (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
+ FT_Long charcode );
+
+
+ typedef FT_Error
+ (*FT_Face_GetKerningFunc)( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_Vector* kerning );
+
+
+ typedef FT_Error
+ (*FT_Face_AttachFunc)( FT_Face face,
+ FT_Stream stream );
+
+
+ typedef FT_Error
+ (*FT_Face_GetAdvancesFunc)( FT_Face face,
+ FT_UInt first,
+ FT_UInt count,
+ FT_Int32 flags,
+ FT_Fixed* advances );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Driver_ClassRec */
+ /* */
+ /* <Description> */
+ /* The font driver class. This structure mostly contains pointers to */
+ /* driver methods. */
+ /* */
+ /* <Fields> */
+ /* root :: The parent module. */
+ /* */
+ /* face_object_size :: The size of a face object in bytes. */
+ /* */
+ /* size_object_size :: The size of a size object in bytes. */
+ /* */
+ /* slot_object_size :: The size of a glyph object in bytes. */
+ /* */
+ /* init_face :: The format-specific face constructor. */
+ /* */
+ /* done_face :: The format-specific face destructor. */
+ /* */
+ /* init_size :: The format-specific size constructor. */
+ /* */
+ /* done_size :: The format-specific size destructor. */
+ /* */
+ /* init_slot :: The format-specific slot constructor. */
+ /* */
+ /* done_slot :: The format-specific slot destructor. */
+ /* */
+ /* */
+ /* load_glyph :: A function handle to load a glyph to a slot. */
+ /* This field is mandatory! */
+ /* */
+ /* get_kerning :: A function handle to return the unscaled */
+ /* kerning for a given pair of glyphs. Can be */
+ /* set to 0 if the format doesn't support */
+ /* kerning. */
+ /* */
+ /* attach_file :: This function handle is used to read */
+ /* additional data for a face from another */
+ /* file/stream. For example, this can be used to */
+ /* add data from AFM or PFM files on a Type 1 */
+ /* face, or a CIDMap on a CID-keyed face. */
+ /* */
+ /* get_advances :: A function handle used to return advance */
+ /* widths of `count' glyphs (in font units), */
+ /* starting at `first'. The `vertical' flag must */
+ /* be set to get vertical advance heights. The */
+ /* `advances' buffer is caller-allocated. */
+ /* The idea of this function is to be able to */
+ /* perform device-independent text layout without */
+ /* loading a single glyph image. */
+ /* */
+ /* request_size :: A handle to a function used to request the new */
+ /* character size. Can be set to 0 if the */
+ /* scaling done in the base layer suffices. */
+ /* */
+ /* select_size :: A handle to a function used to select a new */
+ /* fixed size. It is used only if */
+ /* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
+ /* to 0 if the scaling done in the base layer */
+ /* suffices. */
+ /* <Note> */
+ /* Most function pointers, with the exception of `load_glyph', can be */
+ /* set to 0 to indicate a default behaviour. */
+ /* */
+ typedef struct FT_Driver_ClassRec_
+ {
+ FT_Module_Class root;
+
+ FT_Long face_object_size;
+ FT_Long size_object_size;
+ FT_Long slot_object_size;
+
+ FT_Face_InitFunc init_face;
+ FT_Face_DoneFunc done_face;
+
+ FT_Size_InitFunc init_size;
+ FT_Size_DoneFunc done_size;
+
+ FT_Slot_InitFunc init_slot;
+ FT_Slot_DoneFunc done_slot;
+
+ FT_Slot_LoadFunc load_glyph;
+
+ FT_Face_GetKerningFunc get_kerning;
+ FT_Face_AttachFunc attach_file;
+ FT_Face_GetAdvancesFunc get_advances;
+
+ /* since version 2.2 */
+ FT_Size_RequestFunc request_size;
+ FT_Size_SelectFunc select_size;
+
+ } FT_Driver_ClassRec, *FT_Driver_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DECLARE_DRIVER */
+ /* */
+ /* <Description> */
+ /* Used to create a forward declaration of an FT_Driver_ClassRec */
+ /* struct instance. */
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_DRIVER */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of FT_Driver_ClassRec struct. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
+ /* called with a pointer where the allocated structure is returned. */
+ /* And when it is no longer needed a `destroy' function needs to be */
+ /* called to release that allocation. */
+ /* */
+ /* `fcinit.c' (ft_create_default_module_classes) already contains a */
+ /* mechanism to call these functions for the default modules */
+ /* described in `ftmodule.h'. */
+ /* */
+ /* Notice that the created `create' and `destroy' functions call */
+ /* `pic_init' and `pic_free' to allow you to manually allocate and */
+ /* initialize any additional global data, like a module specific */
+ /* interface, and put them in the global pic container defined in */
+ /* `ftpic.h'. If you don't need them just implement the functions as */
+ /* empty to resolve the link error. Also the `pic_init' and */
+ /* `pic_free' functions should be declared in `pic.h', to be referred */
+ /* by driver definition calling `FT_DEFINE_DRIVER' in following. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro is */
+ /* used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DECLARE_DRIVER( class_ ) \
+ FT_CALLBACK_TABLE \
+ const FT_Driver_ClassRec class_;
+
+#define FT_DEFINE_DRIVER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ init_face_, \
+ done_face_, \
+ init_size_, \
+ done_size_, \
+ init_slot_, \
+ done_slot_, \
+ load_glyph_, \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ request_size_, \
+ select_size_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_Driver_ClassRec class_ = \
+ { \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ \
+ init_face_, \
+ done_face_, \
+ \
+ init_size_, \
+ done_size_, \
+ \
+ init_slot_, \
+ done_slot_, \
+ \
+ load_glyph_, \
+ \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ \
+ request_size_, \
+ select_size_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
+
+#define FT_DEFINE_DRIVER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ init_face_, \
+ done_face_, \
+ init_size_, \
+ done_size_, \
+ init_slot_, \
+ done_slot_, \
+ load_glyph_, \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ request_size_, \
+ select_size_ ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_Module_Class* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
+ \
+ \
+ class_ ## _pic_free( library ); \
+ if ( dclazz ) \
+ FT_FREE( dclazz ); \
+ } \
+ \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_Module_Class** output_class ) \
+ { \
+ FT_Driver_Class clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
+ return error; \
+ \
+ error = class_ ## _pic_init( library ); \
+ if ( error ) \
+ { \
+ FT_FREE( clazz ); \
+ return error; \
+ } \
+ \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ \
+ clazz->face_object_size = face_object_size_; \
+ clazz->size_object_size = size_object_size_; \
+ clazz->slot_object_size = slot_object_size_; \
+ \
+ clazz->init_face = init_face_; \
+ clazz->done_face = done_face_; \
+ \
+ clazz->init_size = init_size_; \
+ clazz->done_size = done_size_; \
+ \
+ clazz->init_slot = init_slot_; \
+ clazz->done_slot = done_slot_; \
+ \
+ clazz->load_glyph = load_glyph_; \
+ \
+ clazz->get_kerning = get_kerning_; \
+ clazz->attach_file = attach_file_; \
+ clazz->get_advances = get_advances_; \
+ \
+ clazz->request_size = request_size_; \
+ clazz->select_size = select_size_; \
+ \
+ *output_class = (FT_Module_Class*)clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+FT_END_HEADER
+
+#endif /* __FTDRIVER_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h b/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h
new file mode 100644
index 0000000000..970dd70cc3
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h
@@ -0,0 +1,172 @@
+/***************************************************************************/
+/* */
+/* ftgloadr.h */
+/* */
+/* The FreeType glyph loader (specification). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTGLOADR_H__
+#define __FTGLOADR_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_GlyphLoader */
+ /* */
+ /* <Description> */
+ /* The glyph loader is an internal object used to load several glyphs */
+ /* together (for example, in the case of composites). */
+ /* */
+ /* <Note> */
+ /* The glyph loader implementation is not part of the high-level API, */
+ /* hence the forward structure declaration. */
+ /* */
+ typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
+
+
+#if 0 /* moved to freetype.h in version 2.2 */
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
+#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
+#define FT_SUBGLYPH_FLAG_SCALE 8
+#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
+#define FT_SUBGLYPH_FLAG_2X2 0x80
+#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
+#endif
+
+
+ typedef struct FT_SubGlyphRec_
+ {
+ FT_Int index;
+ FT_UShort flags;
+ FT_Int arg1;
+ FT_Int arg2;
+ FT_Matrix transform;
+
+ } FT_SubGlyphRec;
+
+
+ typedef struct FT_GlyphLoadRec_
+ {
+ FT_Outline outline; /* outline */
+ FT_Vector* extra_points; /* extra points table */
+ FT_Vector* extra_points2; /* second extra points table */
+ FT_UInt num_subglyphs; /* number of subglyphs */
+ FT_SubGlyph subglyphs; /* subglyphs */
+
+ } FT_GlyphLoadRec, *FT_GlyphLoad;
+
+
+ typedef struct FT_GlyphLoaderRec_
+ {
+ FT_Memory memory;
+ FT_UInt max_points;
+ FT_UInt max_contours;
+ FT_UInt max_subglyphs;
+ FT_Bool use_extra;
+
+ FT_GlyphLoadRec base;
+ FT_GlyphLoadRec current;
+
+ void* other; /* for possible future extension? */
+
+ } FT_GlyphLoaderRec;
+
+
+ /* create new empty glyph loader */
+ FT_BASE( FT_Error )
+ FT_GlyphLoader_New( FT_Memory memory,
+ FT_GlyphLoader *aloader );
+
+ /* add an extra points table to a glyph loader */
+ FT_BASE( FT_Error )
+ FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader );
+
+ /* destroy a glyph loader */
+ FT_BASE( void )
+ FT_GlyphLoader_Done( FT_GlyphLoader loader );
+
+ /* reset a glyph loader (frees everything int it) */
+ FT_BASE( void )
+ FT_GlyphLoader_Reset( FT_GlyphLoader loader );
+
+ /* rewind a glyph loader */
+ FT_BASE( void )
+ FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
+
+ /* check that there is enough space to add `n_points' and `n_contours' */
+ /* to the glyph loader */
+ FT_BASE( FT_Error )
+ FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
+ FT_UInt n_points,
+ FT_UInt n_contours );
+
+
+#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
+ ( (_count) == 0 || \
+ ( (FT_UInt)(_loader)->base.outline.n_points + \
+ (FT_UInt)(_loader)->current.outline.n_points + \
+ (FT_UInt)(_count) ) <= (_loader)->max_points )
+
+#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
+ ( (_count) == 0 || \
+ ( (FT_UInt)(_loader)->base.outline.n_contours + \
+ (FT_UInt)(_loader)->current.outline.n_contours + \
+ (FT_UInt)(_count) ) <= (_loader)->max_contours )
+
+#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \
+ ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
+ FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
+ ? 0 \
+ : FT_GlyphLoader_CheckPoints( (_loader), \
+ (FT_UInt)(_points), \
+ (FT_UInt)(_contours) ) )
+
+
+ /* check that there is enough space to add `n_subs' sub-glyphs to */
+ /* a glyph loader */
+ FT_BASE( FT_Error )
+ FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
+ FT_UInt n_subs );
+
+ /* prepare a glyph loader, i.e. empty the current glyph */
+ FT_BASE( void )
+ FT_GlyphLoader_Prepare( FT_GlyphLoader loader );
+
+ /* add the current glyph to the base glyph */
+ FT_BASE( void )
+ FT_GlyphLoader_Add( FT_GlyphLoader loader );
+
+ /* copy points from one glyph loader to another */
+ FT_BASE( FT_Error )
+ FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
+ FT_GlyphLoader source );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTGLOADR_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftmemory.h b/src/3rdparty/freetype/include/freetype/internal/ftmemory.h
new file mode 100644
index 0000000000..c0c553b4fc
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftmemory.h
@@ -0,0 +1,386 @@
+/***************************************************************************/
+/* */
+/* ftmemory.h */
+/* */
+/* The FreeType memory management macros (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMEMORY_H__
+#define __FTMEMORY_H__
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_SET_ERROR */
+ /* */
+ /* <Description> */
+ /* This macro is used to set an implicit `error' variable to a given */
+ /* expression's value (usually a function call), and convert it to a */
+ /* boolean which is set whenever the value is != 0. */
+ /* */
+#undef FT_SET_ERROR
+#define FT_SET_ERROR( expression ) \
+ ( ( error = (expression) ) != 0 )
+
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** M E M O R Y ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*
+ * C++ refuses to handle statements like p = (void*)anything, with `p' a
+ * typed pointer. Since we don't have a `typeof' operator in standard
+ * C++, we have to use a template to emulate it.
+ */
+
+#ifdef __cplusplus
+
+ extern "C++"
+ template <typename T> inline T*
+ cplusplus_typeof( T*,
+ void *v )
+ {
+ return static_cast <T*> ( v );
+ }
+
+#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
+
+#else
+
+#define FT_ASSIGNP( p, val ) (p) = (val)
+
+#endif
+
+
+
+#ifdef FT_DEBUG_MEMORY
+
+ FT_BASE( const char* ) _ft_debug_file;
+ FT_BASE( long ) _ft_debug_lineno;
+
+#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
+ _ft_debug_lineno = __LINE__, \
+ (exp) )
+
+#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
+ _ft_debug_lineno = __LINE__, \
+ FT_ASSIGNP( p, exp ) )
+
+#else /* !FT_DEBUG_MEMORY */
+
+#define FT_DEBUG_INNER( exp ) (exp)
+#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
+
+#endif /* !FT_DEBUG_MEMORY */
+
+
+ /*
+ * The allocation functions return a pointer, and the error code
+ * is written to through the `p_error' parameter. See below for
+ * for documentation.
+ */
+
+ FT_BASE( FT_Pointer )
+ ft_mem_alloc( FT_Memory memory,
+ FT_Long size,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_qalloc( FT_Memory memory,
+ FT_Long size,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_realloc( FT_Memory memory,
+ FT_Long item_size,
+ FT_Long cur_count,
+ FT_Long new_count,
+ void* block,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_qrealloc( FT_Memory memory,
+ FT_Long item_size,
+ FT_Long cur_count,
+ FT_Long new_count,
+ void* block,
+ FT_Error *p_error );
+
+ FT_BASE( void )
+ ft_mem_free( FT_Memory memory,
+ const void* P );
+
+
+#define FT_MEM_ALLOC( ptr, size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
+ (FT_Long)(size), \
+ &error ) )
+
+#define FT_MEM_FREE( ptr ) \
+ FT_BEGIN_STMNT \
+ ft_mem_free( memory, (ptr) ); \
+ (ptr) = NULL; \
+ FT_END_STMNT
+
+#define FT_MEM_NEW( ptr ) \
+ FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
+
+#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ 1, \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_QALLOC( ptr, size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, \
+ (FT_Long)(size), \
+ &error ) )
+
+#define FT_MEM_QNEW( ptr ) \
+ FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
+
+#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ 1, \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ (FT_Long)(item_size), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ (FT_Long)(itmsz), \
+ (FT_Long)(oldcnt), \
+ (FT_Long)(newcnt), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ (FT_Long)(item_size), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ (FT_Long)(itmsz), \
+ (FT_Long)(oldcnt), \
+ (FT_Long)(newcnt), \
+ (ptr), \
+ &error ) )
+
+
+#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
+
+
+#define FT_MEM_SET( dest, byte, count ) \
+ ft_memset( dest, byte, (FT_Offset)(count) )
+
+#define FT_MEM_COPY( dest, source, count ) \
+ ft_memcpy( dest, source, (FT_Offset)(count) )
+
+#define FT_MEM_MOVE( dest, source, count ) \
+ ft_memmove( dest, source, (FT_Offset)(count) )
+
+
+#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
+
+#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
+
+
+#define FT_ARRAY_ZERO( dest, count ) \
+ FT_MEM_ZERO( dest, \
+ (FT_Offset)(count) * sizeof ( *(dest) ) )
+
+#define FT_ARRAY_COPY( dest, source, count ) \
+ FT_MEM_COPY( dest, \
+ source, \
+ (FT_Offset)(count) * sizeof ( *(dest) ) )
+
+#define FT_ARRAY_MOVE( dest, source, count ) \
+ FT_MEM_MOVE( dest, \
+ source, \
+ (FT_Offset)(count) * sizeof ( *(dest) ) )
+
+
+ /*
+ * Return the maximum number of addressable elements in an array.
+ * We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
+ * any problems.
+ */
+#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
+
+#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
+
+
+ /*************************************************************************/
+ /* */
+ /* The following functions macros expect that their pointer argument is */
+ /* _typed_ in order to automatically compute array element sizes. */
+ /* */
+
+#define FT_MEM_NEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ sizeof ( *(ptr) ), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ sizeof ( *(ptr) ), \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_QNEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ sizeof ( *(ptr) ), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ sizeof ( *(ptr) ), \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_ALLOC( ptr, size ) \
+ FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
+
+#define FT_REALLOC( ptr, cursz, newsz ) \
+ FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
+
+#define FT_ALLOC_MULT( ptr, count, item_size ) \
+ FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
+
+#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
+ FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
+ newcnt, itmsz ) )
+
+#define FT_QALLOC( ptr, size ) \
+ FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
+
+#define FT_QREALLOC( ptr, cursz, newsz ) \
+ FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
+
+#define FT_QALLOC_MULT( ptr, count, item_size ) \
+ FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
+
+#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
+ FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
+ newcnt, itmsz ) )
+
+#define FT_FREE( ptr ) FT_MEM_FREE( ptr )
+
+#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
+
+#define FT_NEW_ARRAY( ptr, count ) \
+ FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
+
+#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
+ FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
+
+#define FT_QNEW( ptr ) \
+ FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
+
+#define FT_QNEW_ARRAY( ptr, count ) \
+ FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
+
+#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
+ FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
+
+
+ FT_BASE( FT_Pointer )
+ ft_mem_strdup( FT_Memory memory,
+ const char* str,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_dup( FT_Memory memory,
+ const void* address,
+ FT_ULong size,
+ FT_Error *p_error );
+
+
+#define FT_MEM_STRDUP( dst, str ) \
+ (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
+
+#define FT_STRDUP( dst, str ) \
+ FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
+
+#define FT_MEM_DUP( dst, address, size ) \
+ (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
+
+#define FT_DUP( dst, address, size ) \
+ FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
+
+
+ /* Return >= 1 if a truncation occurs. */
+ /* Return 0 if the source string fits the buffer. */
+ /* This is *not* the same as strlcpy(). */
+ FT_BASE( FT_Int )
+ ft_mem_strcpyn( char* dst,
+ const char* src,
+ FT_ULong size );
+
+#define FT_STRCPYN( dst, src, size ) \
+ ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTMEMORY_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftobjs.h b/src/3rdparty/freetype/include/freetype/internal/ftobjs.h
new file mode 100644
index 0000000000..da5582dc3f
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftobjs.h
@@ -0,0 +1,1571 @@
+/***************************************************************************/
+/* */
+/* ftobjs.h */
+/* */
+/* The FreeType private base classes (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file contains the definition of all internal FreeType classes. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTOBJS_H__
+#define __FTOBJS_H__
+
+#include <ft2build.h>
+#include FT_RENDER_H
+#include FT_SIZES_H
+#include FT_LCD_FILTER_H
+#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_GLYPH_LOADER_H
+#include FT_INTERNAL_DRIVER_H
+#include FT_INTERNAL_AUTOHINT_H
+#include FT_INTERNAL_SERVICE_H
+#include FT_INTERNAL_PIC_H
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+#include FT_INCREMENTAL_H
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* Some generic definitions. */
+ /* */
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* The min and max functions missing in C. As usual, be careful not to */
+ /* write things like FT_MIN( a++, b++ ) to avoid side effects. */
+ /* */
+#define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
+#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
+
+#define 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 FT_HYPOT( x, y ) \
+ ( x = FT_ABS( x ), \
+ y = FT_ABS( y ), \
+ x > y ? x + ( 3 * y >> 3 ) \
+ : y + ( 3 * x >> 3 ) )
+
+ /* we use FT_TYPEOF to suppress signedness compilation warnings */
+#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n)-1 ) )
+#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
+#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
+
+#define FT_PIX_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
+#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
+#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
+
+
+ /*
+ * character classification functions -- since these are used to parse
+ * font files, we must not use those in <ctypes.h> which are
+ * locale-dependent
+ */
+#define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
+
+#define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
+ ( (unsigned)(x) - 'a' ) < 6U || \
+ ( (unsigned)(x) - 'A' ) < 6U )
+
+ /* the next two macros assume ASCII representation */
+#define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
+#define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
+
+#define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
+#define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** C H A R M A P S ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /* handle to internal charmap object */
+ typedef struct FT_CMapRec_* FT_CMap;
+
+ /* handle to charmap class structure */
+ typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
+
+ /* internal charmap object structure */
+ typedef struct FT_CMapRec_
+ {
+ FT_CharMapRec charmap;
+ FT_CMap_Class clazz;
+
+ } FT_CMapRec;
+
+ /* typecase any pointer to a charmap handle */
+#define FT_CMAP( x ) ((FT_CMap)( x ))
+
+ /* obvious macros */
+#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
+#define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
+#define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
+#define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
+
+
+ /* class method definitions */
+ typedef FT_Error
+ (*FT_CMap_InitFunc)( FT_CMap cmap,
+ FT_Pointer init_data );
+
+ typedef void
+ (*FT_CMap_DoneFunc)( FT_CMap cmap );
+
+ typedef FT_UInt
+ (*FT_CMap_CharIndexFunc)( FT_CMap cmap,
+ FT_UInt32 char_code );
+
+ typedef FT_UInt
+ (*FT_CMap_CharNextFunc)( FT_CMap cmap,
+ FT_UInt32 *achar_code );
+
+ typedef FT_UInt
+ (*FT_CMap_CharVarIndexFunc)( FT_CMap cmap,
+ FT_CMap unicode_cmap,
+ FT_UInt32 char_code,
+ FT_UInt32 variant_selector );
+
+ typedef FT_Bool
+ (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap cmap,
+ FT_UInt32 char_code,
+ FT_UInt32 variant_selector );
+
+ typedef FT_UInt32 *
+ (*FT_CMap_VariantListFunc)( FT_CMap cmap,
+ FT_Memory mem );
+
+ typedef FT_UInt32 *
+ (*FT_CMap_CharVariantListFunc)( FT_CMap cmap,
+ FT_Memory mem,
+ FT_UInt32 char_code );
+
+ typedef FT_UInt32 *
+ (*FT_CMap_VariantCharListFunc)( FT_CMap cmap,
+ FT_Memory mem,
+ FT_UInt32 variant_selector );
+
+
+ typedef struct FT_CMap_ClassRec_
+ {
+ FT_ULong size;
+ FT_CMap_InitFunc init;
+ FT_CMap_DoneFunc done;
+ FT_CMap_CharIndexFunc char_index;
+ FT_CMap_CharNextFunc char_next;
+
+ /* Subsequent entries are special ones for format 14 -- the variant */
+ /* selector subtable which behaves like no other */
+
+ FT_CMap_CharVarIndexFunc char_var_index;
+ FT_CMap_CharVarIsDefaultFunc char_var_default;
+ FT_CMap_VariantListFunc variant_list;
+ FT_CMap_CharVariantListFunc charvariant_list;
+ FT_CMap_VariantCharListFunc variantchar_list;
+
+ } FT_CMap_ClassRec;
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DECLARE_CMAP_CLASS( class_ ) \
+ FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
+
+#define FT_DEFINE_CMAP_CLASS( \
+ class_, \
+ size_, \
+ init_, \
+ done_, \
+ char_index_, \
+ char_next_, \
+ char_var_index_, \
+ char_var_default_, \
+ variant_list_, \
+ charvariant_list_, \
+ variantchar_list_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_CMap_ClassRec class_ = \
+ { \
+ size_, \
+ init_, \
+ done_, \
+ char_index_, \
+ char_next_, \
+ char_var_index_, \
+ char_var_default_, \
+ variant_list_, \
+ charvariant_list_, \
+ variantchar_list_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DECLARE_CMAP_CLASS( class_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_CMap_ClassRec* clazz );
+
+#define FT_DEFINE_CMAP_CLASS( \
+ class_, \
+ size_, \
+ init_, \
+ done_, \
+ char_index_, \
+ char_next_, \
+ char_var_index_, \
+ char_var_default_, \
+ variant_list_, \
+ charvariant_list_, \
+ variantchar_list_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_CMap_ClassRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->size = size_; \
+ clazz->init = init_; \
+ clazz->done = done_; \
+ clazz->char_index = char_index_; \
+ clazz->char_next = char_next_; \
+ clazz->char_var_index = char_var_index_; \
+ clazz->char_var_default = char_var_default_; \
+ clazz->variant_list = variant_list_; \
+ clazz->charvariant_list = charvariant_list_; \
+ clazz->variantchar_list = variantchar_list_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+ /* create a new charmap and add it to charmap->face */
+ FT_BASE( FT_Error )
+ FT_CMap_New( FT_CMap_Class clazz,
+ FT_Pointer init_data,
+ FT_CharMap charmap,
+ FT_CMap *acmap );
+
+ /* destroy a charmap and remove it from face's list */
+ FT_BASE( void )
+ FT_CMap_Done( FT_CMap cmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Face_InternalRec */
+ /* */
+ /* <Description> */
+ /* This structure contains the internal fields of each FT_Face */
+ /* object. These fields may change between different releases of */
+ /* FreeType. */
+ /* */
+ /* <Fields> */
+ /* max_points :: */
+ /* The maximum number of points used to store the vectorial outline */
+ /* of any glyph in this face. If this value cannot be known in */
+ /* advance, or if the face isn't scalable, this should be set to 0. */
+ /* Only relevant for scalable formats. */
+ /* */
+ /* max_contours :: */
+ /* The maximum number of contours used to store the vectorial */
+ /* outline of any glyph in this face. If this value cannot be */
+ /* known in advance, or if the face isn't scalable, this should be */
+ /* set to 0. Only relevant for scalable formats. */
+ /* */
+ /* transform_matrix :: */
+ /* A 2x2 matrix of 16.16 coefficients used to transform glyph */
+ /* outlines after they are loaded from the font. Only used by the */
+ /* convenience functions. */
+ /* */
+ /* transform_delta :: */
+ /* A translation vector used to transform glyph outlines after they */
+ /* are loaded from the font. Only used by the convenience */
+ /* functions. */
+ /* */
+ /* transform_flags :: */
+ /* Some flags used to classify the transform. Only used by the */
+ /* convenience functions. */
+ /* */
+ /* services :: */
+ /* A cache for frequently used services. It should be only */
+ /* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */
+ /* */
+ /* incremental_interface :: */
+ /* If non-null, the interface through which glyph data and metrics */
+ /* are loaded incrementally for faces that do not provide all of */
+ /* this data when first opened. This field exists only if */
+ /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
+ /* */
+ /* ignore_unpatented_hinter :: */
+ /* This boolean flag instructs the glyph loader to ignore the */
+ /* native font hinter, if one is found. This is exclusively used */
+ /* in the case when the unpatented hinter is compiled within the */
+ /* library. */
+ /* */
+ /* refcount :: */
+ /* A counter initialized to~1 at the time an @FT_Face structure is */
+ /* created. @FT_Reference_Face increments this counter, and */
+ /* @FT_Done_Face only destroys a face if the counter is~1, */
+ /* otherwise it simply decrements it. */
+ /* */
+ typedef struct FT_Face_InternalRec_
+ {
+ FT_Matrix transform_matrix;
+ FT_Vector transform_delta;
+ FT_Int transform_flags;
+
+ FT_ServiceCacheRec services;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ FT_Incremental_InterfaceRec* incremental_interface;
+#endif
+
+ FT_Bool ignore_unpatented_hinter;
+ FT_Int refcount;
+
+ } FT_Face_InternalRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Slot_InternalRec */
+ /* */
+ /* <Description> */
+ /* This structure contains the internal fields of each FT_GlyphSlot */
+ /* object. These fields may change between different releases of */
+ /* FreeType. */
+ /* */
+ /* <Fields> */
+ /* loader :: The glyph loader object used to load outlines */
+ /* into the glyph slot. */
+ /* */
+ /* flags :: Possible values are zero or */
+ /* FT_GLYPH_OWN_BITMAP. The latter indicates */
+ /* that the FT_GlyphSlot structure owns the */
+ /* bitmap buffer. */
+ /* */
+ /* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
+ /* must be transformed through a specific */
+ /* font transformation. This is _not_ the same */
+ /* as the face transform set through */
+ /* FT_Set_Transform(). */
+ /* */
+ /* glyph_matrix :: The 2x2 matrix corresponding to the glyph */
+ /* transformation, if necessary. */
+ /* */
+ /* glyph_delta :: The 2d translation vector corresponding to */
+ /* the glyph transformation, if necessary. */
+ /* */
+ /* glyph_hints :: Format-specific glyph hints management. */
+ /* */
+
+#define FT_GLYPH_OWN_BITMAP 0x1U
+
+ typedef struct FT_Slot_InternalRec_
+ {
+ FT_GlyphLoader loader;
+ FT_UInt flags;
+ FT_Bool glyph_transformed;
+ FT_Matrix glyph_matrix;
+ FT_Vector glyph_delta;
+ void* glyph_hints;
+
+ } FT_GlyphSlot_InternalRec;
+
+
+#if 0
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_InternalRec */
+ /* */
+ /* <Description> */
+ /* This structure contains the internal fields of each FT_Size */
+ /* object. Currently, it's empty. */
+ /* */
+ /*************************************************************************/
+
+ typedef struct FT_Size_InternalRec_
+ {
+ /* empty */
+
+ } FT_Size_InternalRec;
+
+#endif
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** M O D U L E S ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ModuleRec */
+ /* */
+ /* <Description> */
+ /* A module object instance. */
+ /* */
+ /* <Fields> */
+ /* clazz :: A pointer to the module's class. */
+ /* */
+ /* library :: A handle to the parent library object. */
+ /* */
+ /* memory :: A handle to the memory manager. */
+ /* */
+ typedef struct FT_ModuleRec_
+ {
+ FT_Module_Class* clazz;
+ FT_Library library;
+ FT_Memory memory;
+
+ } FT_ModuleRec;
+
+
+ /* typecast an object to an FT_Module */
+#define FT_MODULE( x ) ((FT_Module)( x ))
+#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
+#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
+#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
+
+
+#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_FONT_DRIVER )
+
+#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_RENDERER )
+
+#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_HINTER )
+
+#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_STYLER )
+
+#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_DRIVER_SCALABLE )
+
+#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_DRIVER_NO_OUTLINES )
+
+#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
+ FT_MODULE_DRIVER_HAS_HINTER )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Module_Interface */
+ /* */
+ /* <Description> */
+ /* Finds a module and returns its specific interface as a typeless */
+ /* pointer. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* module_name :: The module's name (as an ASCII string). */
+ /* */
+ /* <Return> */
+ /* A module-specific interface if available, 0 otherwise. */
+ /* */
+ /* <Note> */
+ /* You should better be familiar with FreeType internals to know */
+ /* which module to look for, and what its interface is :-) */
+ /* */
+ FT_BASE( const void* )
+ FT_Get_Module_Interface( FT_Library library,
+ const char* mod_name );
+
+ FT_BASE( FT_Pointer )
+ ft_module_get_service( FT_Module module,
+ const char* service_id );
+
+ /* */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** F A C E, S I Z E & G L Y P H S L O T O B J E C T S ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /* a few macros used to perform easy typecasts with minimal brain damage */
+
+#define FT_FACE( x ) ((FT_Face)(x))
+#define FT_SIZE( x ) ((FT_Size)(x))
+#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
+
+#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
+#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
+#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
+#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
+
+#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
+#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
+
+#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
+#define FT_FACE_SIZE( x ) FT_FACE( x )->size
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* It is sometimes useful to have more than one glyph slot for a */
+ /* given face object. This function is used to create additional */
+ /* slots. All of them are automatically discarded when the face is */
+ /* destroyed. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a parent face object. */
+ /* */
+ /* <Output> */
+ /* aslot :: A handle to a new glyph slot object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_BASE( FT_Error )
+ FT_New_GlyphSlot( FT_Face face,
+ FT_GlyphSlot *aslot );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* Destroys a given glyph slot. Remember however that all slots are */
+ /* automatically destroyed with its parent. Using this function is */
+ /* not always mandatory. */
+ /* */
+ /* <Input> */
+ /* slot :: A handle to a target glyph slot. */
+ /* */
+ FT_BASE( void )
+ FT_Done_GlyphSlot( FT_GlyphSlot slot );
+
+ /* */
+
+#define FT_REQUEST_WIDTH( req ) \
+ ( (req)->horiResolution \
+ ? ( (req)->width * (FT_Pos)(req)->horiResolution + 36 ) / 72 \
+ : (req)->width )
+
+#define FT_REQUEST_HEIGHT( req ) \
+ ( (req)->vertResolution \
+ ? ( (req)->height * (FT_Pos)(req)->vertResolution + 36 ) / 72 \
+ : (req)->height )
+
+
+ /* Set the metrics according to a bitmap strike. */
+ FT_BASE( void )
+ FT_Select_Metrics( FT_Face face,
+ FT_ULong strike_index );
+
+
+ /* Set the metrics according to a size request. */
+ FT_BASE( void )
+ FT_Request_Metrics( FT_Face face,
+ FT_Size_Request req );
+
+
+ /* Match a size request against `available_sizes'. */
+ FT_BASE( FT_Error )
+ FT_Match_Size( FT_Face face,
+ FT_Size_Request req,
+ FT_Bool ignore_width,
+ FT_ULong* size_index );
+
+
+ /* Use the horizontal metrics to synthesize the vertical metrics. */
+ /* If `advance' is zero, it is also synthesized. */
+ FT_BASE( void )
+ ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
+ FT_Pos advance );
+
+
+ /* Free the bitmap of a given glyphslot when needed (i.e., only when it */
+ /* was allocated with ft_glyphslot_alloc_bitmap). */
+ FT_BASE( void )
+ ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
+
+
+ /* Allocate a new bitmap buffer in a glyph slot. */
+ FT_BASE( FT_Error )
+ ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
+ FT_ULong size );
+
+
+ /* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
+ /* will not be freed by a later call to ft_glyphslot_free_bitmap. */
+ FT_BASE( void )
+ ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
+ FT_Byte* buffer );
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** R E N D E R E R S ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+#define FT_RENDERER( x ) ((FT_Renderer)( x ))
+#define FT_GLYPH( x ) ((FT_Glyph)( x ))
+#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
+#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
+
+
+ typedef struct FT_RendererRec_
+ {
+ FT_ModuleRec root;
+ FT_Renderer_Class* clazz;
+ FT_Glyph_Format glyph_format;
+ FT_Glyph_Class glyph_class;
+
+ FT_Raster raster;
+ FT_Raster_Render_Func raster_render;
+ FT_Renderer_RenderFunc render;
+
+ } FT_RendererRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** F O N T D R I V E R S ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /* typecast a module into a driver easily */
+#define FT_DRIVER( x ) ((FT_Driver)(x))
+
+ /* typecast a module as a driver, and get its driver class */
+#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_DriverRec */
+ /* */
+ /* <Description> */
+ /* The root font driver class. A font driver is responsible for */
+ /* managing and loading font files of a given format. */
+ /* */
+ /* <Fields> */
+ /* root :: Contains the fields of the root module class. */
+ /* */
+ /* clazz :: A pointer to the font driver's class. Note that */
+ /* this is NOT root.clazz. `class' wasn't used */
+ /* as it is a reserved word in C++. */
+ /* */
+ /* faces_list :: The list of faces currently opened by this */
+ /* driver. */
+ /* */
+ /* glyph_loader :: Unused. Used to be glyph loader for all faces */
+ /* managed by this driver. */
+ /* */
+ typedef struct FT_DriverRec_
+ {
+ FT_ModuleRec root;
+ FT_Driver_Class clazz;
+ FT_ListRec faces_list;
+ FT_GlyphLoader glyph_loader;
+
+ } FT_DriverRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** L I B R A R I E S ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /* This hook is used by the TrueType debugger. It must be set to an */
+ /* alternate truetype bytecode interpreter function. */
+#define FT_DEBUG_HOOK_TRUETYPE 0
+
+
+ /* Set this debug hook to a non-null pointer to force unpatented hinting */
+ /* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
+ /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
+ /* during debugging. */
+#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
+
+
+ typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
+ FT_Render_Mode render_mode,
+ FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_LibraryRec */
+ /* */
+ /* <Description> */
+ /* The FreeType library class. This is the root of all FreeType */
+ /* data. Use FT_New_Library() to create a library object, and */
+ /* FT_Done_Library() to discard it and all child objects. */
+ /* */
+ /* <Fields> */
+ /* memory :: The library's memory object. Manages memory */
+ /* allocation. */
+ /* */
+ /* version_major :: The major version number of the library. */
+ /* */
+ /* version_minor :: The minor version number of the library. */
+ /* */
+ /* version_patch :: The current patch level of the library. */
+ /* */
+ /* num_modules :: The number of modules currently registered */
+ /* within this library. This is set to 0 for new */
+ /* libraries. New modules are added through the */
+ /* FT_Add_Module() API function. */
+ /* */
+ /* modules :: A table used to store handles to the currently */
+ /* registered modules. Note that each font driver */
+ /* contains a list of its opened faces. */
+ /* */
+ /* renderers :: The list of renderers currently registered */
+ /* within the library. */
+ /* */
+ /* cur_renderer :: The current outline renderer. This is a */
+ /* shortcut used to avoid parsing the list on */
+ /* each call to FT_Outline_Render(). It is a */
+ /* handle to the current renderer for the */
+ /* FT_GLYPH_FORMAT_OUTLINE format. */
+ /* */
+ /* auto_hinter :: XXX */
+ /* */
+ /* raster_pool :: The raster object's render pool. This can */
+ /* ideally be changed dynamically at run-time. */
+ /* */
+ /* raster_pool_size :: The size of the render pool in bytes. */
+ /* */
+ /* debug_hooks :: XXX */
+ /* */
+ /* lcd_filter :: If subpixel rendering is activated, the */
+ /* selected LCD filter mode. */
+ /* */
+ /* lcd_extra :: If subpixel rendering is activated, the number */
+ /* of extra pixels needed for the LCD filter. */
+ /* */
+ /* lcd_weights :: If subpixel rendering is activated, the LCD */
+ /* filter weights, if any. */
+ /* */
+ /* lcd_filter_func :: If subpixel rendering is activated, the LCD */
+ /* filtering callback function. */
+ /* */
+ /* pic_container :: Contains global structs and tables, instead */
+ /* of defining them globallly. */
+ /* */
+ /* refcount :: A counter initialized to~1 at the time an */
+ /* @FT_Library structure is created. */
+ /* @FT_Reference_Library increments this counter, */
+ /* and @FT_Done_Library only destroys a library */
+ /* if the counter is~1, otherwise it simply */
+ /* decrements it. */
+ /* */
+ typedef struct FT_LibraryRec_
+ {
+ FT_Memory memory; /* library's memory manager */
+
+ FT_Int version_major;
+ FT_Int version_minor;
+ FT_Int version_patch;
+
+ FT_UInt num_modules;
+ FT_Module modules[FT_MAX_MODULES]; /* module objects */
+
+ FT_ListRec renderers; /* list of renderers */
+ FT_Renderer cur_renderer; /* current outline renderer */
+ FT_Module auto_hinter;
+
+ FT_Byte* raster_pool; /* scan-line conversion */
+ /* render pool */
+ FT_ULong raster_pool_size; /* size of render pool in bytes */
+
+ FT_DebugHook_Func debug_hooks[4];
+
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ FT_LcdFilter lcd_filter;
+ FT_Int lcd_extra; /* number of extra pixels */
+ FT_Byte lcd_weights[7]; /* filter weights, if any */
+ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
+#endif
+
+#ifdef FT_CONFIG_OPTION_PIC
+ FT_PIC_Container pic_container;
+#endif
+
+ FT_Int refcount;
+
+ } FT_LibraryRec;
+
+
+ FT_BASE( FT_Renderer )
+ FT_Lookup_Renderer( FT_Library library,
+ FT_Glyph_Format format,
+ FT_ListNode* node );
+
+ FT_BASE( FT_Error )
+ FT_Render_Glyph_Internal( FT_Library library,
+ FT_GlyphSlot slot,
+ FT_Render_Mode render_mode );
+
+ typedef const char*
+ (*FT_Face_GetPostscriptNameFunc)( FT_Face face );
+
+ typedef FT_Error
+ (*FT_Face_GetGlyphNameFunc)( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+ typedef FT_UInt
+ (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
+ FT_String* glyph_name );
+
+
+#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Memory */
+ /* */
+ /* <Description> */
+ /* Creates a new memory object. */
+ /* */
+ /* <Return> */
+ /* A pointer to the new memory object. 0 in case of error. */
+ /* */
+ FT_BASE( FT_Memory )
+ FT_New_Memory( void );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Memory */
+ /* */
+ /* <Description> */
+ /* Discards memory manager. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the memory manager. */
+ /* */
+ FT_BASE( void )
+ FT_Done_Memory( FT_Memory memory );
+
+#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
+
+
+ /* Define default raster's interface. The default raster is located in */
+ /* `src/base/ftraster.c'. */
+ /* */
+ /* Client applications can register new rasters through the */
+ /* FT_Set_Raster() API. */
+
+#ifndef FT_NO_DEFAULT_RASTER
+ FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
+#endif
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** P I C S U P P O R T ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /* PIC support macros for ftimage.h */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_OUTLINE_FUNCS */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of FT_Outline_Funcs struct. */
+ /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
+ /* be called with a pre-allocated structure to be filled. */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro */
+ /* is used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_OUTLINE_FUNCS( \
+ class_, \
+ move_to_, \
+ line_to_, \
+ conic_to_, \
+ cubic_to_, \
+ shift_, \
+ delta_ ) \
+ static const FT_Outline_Funcs class_ = \
+ { \
+ move_to_, \
+ line_to_, \
+ conic_to_, \
+ cubic_to_, \
+ shift_, \
+ delta_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_OUTLINE_FUNCS( \
+ class_, \
+ move_to_, \
+ line_to_, \
+ conic_to_, \
+ cubic_to_, \
+ shift_, \
+ delta_ ) \
+ static FT_Error \
+ Init_Class_ ## class_( FT_Outline_Funcs* clazz ) \
+ { \
+ clazz->move_to = move_to_; \
+ clazz->line_to = line_to_; \
+ clazz->conic_to = conic_to_; \
+ clazz->cubic_to = cubic_to_; \
+ clazz->shift = shift_; \
+ clazz->delta = delta_; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_RASTER_FUNCS */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of FT_Raster_Funcs struct. */
+ /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
+ /* be called with a pre-allocated structure to be filled. */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro */
+ /* is used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_RASTER_FUNCS( \
+ class_, \
+ glyph_format_, \
+ raster_new_, \
+ raster_reset_, \
+ raster_set_mode_, \
+ raster_render_, \
+ raster_done_ ) \
+ const FT_Raster_Funcs class_ = \
+ { \
+ glyph_format_, \
+ raster_new_, \
+ raster_reset_, \
+ raster_set_mode_, \
+ raster_render_, \
+ raster_done_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_RASTER_FUNCS( \
+ class_, \
+ glyph_format_, \
+ raster_new_, \
+ raster_reset_, \
+ raster_set_mode_, \
+ raster_render_, \
+ raster_done_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Raster_Funcs* clazz ) \
+ { \
+ clazz->glyph_format = glyph_format_; \
+ clazz->raster_new = raster_new_; \
+ clazz->raster_reset = raster_reset_; \
+ clazz->raster_set_mode = raster_set_mode_; \
+ clazz->raster_render = raster_render_; \
+ clazz->raster_done = raster_done_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+ /* PIC support macros for ftrender.h */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_GLYPH */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of FT_Glyph_Class struct. */
+ /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
+ /* be called with a pre-allocated stcture to be filled. */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro */
+ /* is used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_GLYPH( \
+ class_, \
+ size_, \
+ format_, \
+ init_, \
+ done_, \
+ copy_, \
+ transform_, \
+ bbox_, \
+ prepare_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_Glyph_Class class_ = \
+ { \
+ size_, \
+ format_, \
+ init_, \
+ done_, \
+ copy_, \
+ transform_, \
+ bbox_, \
+ prepare_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_GLYPH( \
+ class_, \
+ size_, \
+ format_, \
+ init_, \
+ done_, \
+ copy_, \
+ transform_, \
+ bbox_, \
+ prepare_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Glyph_Class* clazz ) \
+ { \
+ clazz->glyph_size = size_; \
+ clazz->glyph_format = format_; \
+ clazz->glyph_init = init_; \
+ clazz->glyph_done = done_; \
+ clazz->glyph_copy = copy_; \
+ clazz->glyph_transform = transform_; \
+ clazz->glyph_bbox = bbox_; \
+ clazz->glyph_prepare = prepare_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DECLARE_RENDERER */
+ /* */
+ /* <Description> */
+ /* Used to create a forward declaration of a */
+ /* FT_Renderer_Class struct instance. */
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_RENDERER */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of FT_Renderer_Class struct. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
+ /* to be called with a pointer where the allocated structure is */
+ /* returned. And when it is no longer needed a `destroy' function */
+ /* needs to be called to release that allocation. */
+ /* `fcinit.c' (ft_create_default_module_classes) already contains */
+ /* a mechanism to call these functions for the default modules */
+ /* described in `ftmodule.h'. */
+ /* */
+ /* Notice that the created `create' and `destroy' functions call */
+ /* `pic_init' and `pic_free' to allow you to manually allocate and */
+ /* initialize any additional global data, like a module specific */
+ /* interface, and put them in the global pic container defined in */
+ /* `ftpic.h'. If you don't need them just implement the functions as */
+ /* empty to resolve the link error. Also the `pic_init' and */
+ /* `pic_free' functions should be declared in `pic.h', to be referred */
+ /* by the renderer definition calling `FT_DEFINE_RENDERER' in the */
+ /* following. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro */
+ /* is used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DECLARE_RENDERER( class_ ) \
+ FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
+
+#define FT_DEFINE_RENDERER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ glyph_format_, \
+ render_glyph_, \
+ transform_glyph_, \
+ get_glyph_cbox_, \
+ set_mode_, \
+ raster_class_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_Renderer_Class class_ = \
+ { \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ glyph_format_, \
+ \
+ render_glyph_, \
+ transform_glyph_, \
+ get_glyph_cbox_, \
+ set_mode_, \
+ \
+ raster_class_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DECLARE_RENDERER( class_ ) FT_DECLARE_MODULE( class_ )
+
+#define FT_DEFINE_RENDERER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ glyph_format_, \
+ render_glyph_, \
+ transform_glyph_, \
+ get_glyph_cbox_, \
+ set_mode_, \
+ raster_class_ ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_Module_Class* clazz ) \
+ { \
+ FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ class_ ## _pic_free( library ); \
+ if ( rclazz ) \
+ FT_FREE( rclazz ); \
+ } \
+ \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_Module_Class** output_class ) \
+ { \
+ FT_Renderer_Class* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
+ return error; \
+ \
+ error = class_ ## _pic_init( library ); \
+ if ( error ) \
+ { \
+ FT_FREE( clazz ); \
+ return error; \
+ } \
+ \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ \
+ clazz->glyph_format = glyph_format_; \
+ \
+ clazz->render_glyph = render_glyph_; \
+ clazz->transform_glyph = transform_glyph_; \
+ clazz->get_glyph_cbox = get_glyph_cbox_; \
+ clazz->set_mode = set_mode_; \
+ \
+ clazz->raster_class = raster_class_; \
+ \
+ *output_class = (FT_Module_Class*)clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+ /* PIC support macros for ftmodapi.h **/
+
+
+#ifdef FT_CONFIG_OPTION_PIC
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Module_Creator */
+ /* */
+ /* <Description> */
+ /* A function used to create (allocate) a new module class object. */
+ /* The object's members are initialized, but the module itself is */
+ /* not. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the memory manager. */
+ /* output_class :: Initialized with the newly allocated class. */
+ /* */
+ typedef FT_Error
+ (*FT_Module_Creator)( FT_Memory memory,
+ FT_Module_Class** output_class );
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Module_Destroyer */
+ /* */
+ /* <Description> */
+ /* A function used to destroy (deallocate) a module class object. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the memory manager. */
+ /* clazz :: Module class to destroy. */
+ /* */
+ typedef void
+ (*FT_Module_Destroyer)( FT_Memory memory,
+ FT_Module_Class* clazz );
+
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DECLARE_MODULE */
+ /* */
+ /* <Description> */
+ /* Used to create a forward declaration of a */
+ /* FT_Module_Class struct instance. */
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_MODULE */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of an FT_Module_Class struct. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
+ /* be called with a pointer where the allocated structure is */
+ /* returned. And when it is no longer needed a `destroy' function */
+ /* needs to be called to release that allocation. */
+ /* `fcinit.c' (ft_create_default_module_classes) already contains */
+ /* a mechanism to call these functions for the default modules */
+ /* described in `ftmodule.h'. */
+ /* */
+ /* Notice that the created `create' and `destroy' functions call */
+ /* `pic_init' and `pic_free' to allow you to manually allocate and */
+ /* initialize any additional global data, like a module specific */
+ /* interface, and put them in the global pic container defined in */
+ /* `ftpic.h'. If you don't need them just implement the functions as */
+ /* empty to resolve the link error. Also the `pic_init' and */
+ /* `pic_free' functions should be declared in `pic.h', to be referred */
+ /* by the module definition calling `FT_DEFINE_MODULE' in the */
+ /* following. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro */
+ /* is used). */
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_ROOT_MODULE */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of an FT_Module_Class struct inside */
+ /* another struct that contains it or in a function that initializes */
+ /* that containing struct. */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DECLARE_MODULE( class_ ) \
+ FT_CALLBACK_TABLE \
+ const FT_Module_Class class_;
+
+#define FT_DEFINE_ROOT_MODULE( \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ { \
+ flags_, \
+ size_, \
+ \
+ name_, \
+ version_, \
+ requires_, \
+ \
+ interface_, \
+ \
+ init_, \
+ done_, \
+ get_interface_, \
+ },
+
+#define FT_DEFINE_MODULE( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_Module_Class class_ = \
+ { \
+ flags_, \
+ size_, \
+ \
+ name_, \
+ version_, \
+ requires_, \
+ \
+ interface_, \
+ \
+ init_, \
+ done_, \
+ get_interface_, \
+ };
+
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DECLARE_MODULE( class_ ) \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_Module_Class** output_class ); \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_Module_Class* clazz );
+
+#define FT_DEFINE_ROOT_MODULE( \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ clazz->root.module_flags = flags_; \
+ clazz->root.module_size = size_; \
+ clazz->root.module_name = name_; \
+ clazz->root.module_version = version_; \
+ clazz->root.module_requires = requires_; \
+ \
+ clazz->root.module_interface = interface_; \
+ \
+ clazz->root.module_init = init_; \
+ clazz->root.module_done = done_; \
+ clazz->root.get_interface = get_interface_;
+
+#define FT_DEFINE_MODULE( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_Module_Class* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ class_ ## _pic_free( library ); \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_Module_Class** output_class ) \
+ { \
+ FT_Memory memory = library->memory; \
+ FT_Module_Class* clazz = NULL; \
+ FT_Error error; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
+ return error; \
+ error = class_ ## _pic_init( library ); \
+ if ( error ) \
+ { \
+ FT_FREE( clazz ); \
+ return error; \
+ } \
+ \
+ clazz->module_flags = flags_; \
+ clazz->module_size = size_; \
+ clazz->module_name = name_; \
+ clazz->module_version = version_; \
+ clazz->module_requires = requires_; \
+ \
+ clazz->module_interface = interface_; \
+ \
+ clazz->module_init = init_; \
+ clazz->module_done = done_; \
+ clazz->get_interface = get_interface_; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+FT_END_HEADER
+
+#endif /* __FTOBJS_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftpic.h b/src/3rdparty/freetype/include/freetype/internal/ftpic.h
new file mode 100644
index 0000000000..7f9154f419
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftpic.h
@@ -0,0 +1,71 @@
+/***************************************************************************/
+/* */
+/* ftpic.h */
+/* */
+/* The FreeType position independent code services (declaration). */
+/* */
+/* Copyright 2009-2015 by */
+/* Oran Agra and Mickey Gabel. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Modules that ordinarily have const global data that need address */
+ /* can instead define pointers here. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTPIC_H__
+#define __FTPIC_H__
+
+
+FT_BEGIN_HEADER
+
+#ifdef FT_CONFIG_OPTION_PIC
+
+ typedef struct FT_PIC_Container_
+ {
+ /* pic containers for base */
+ void* base;
+
+ /* pic containers for modules */
+ void* autofit;
+ void* cff;
+ void* pshinter;
+ void* psnames;
+ void* raster;
+ void* sfnt;
+ void* smooth;
+ void* truetype;
+
+ } FT_PIC_Container;
+
+
+ /* Initialize the various function tables, structs, etc. */
+ /* stored in the container. */
+ FT_BASE( FT_Error )
+ ft_pic_container_init( FT_Library library );
+
+
+ /* Destroy the contents of the container. */
+ FT_BASE( void )
+ ft_pic_container_destroy( FT_Library library );
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTPIC_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftrfork.h b/src/3rdparty/freetype/include/freetype/internal/ftrfork.h
new file mode 100644
index 0000000000..da61ca75b5
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftrfork.h
@@ -0,0 +1,266 @@
+/***************************************************************************/
+/* */
+/* ftrfork.h */
+/* */
+/* Embedded resource forks accessor (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* Masatake YAMATO and Redhat K.K. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+/***************************************************************************/
+/* Development of the code in this file is support of */
+/* Information-technology Promotion Agency, Japan. */
+/***************************************************************************/
+
+
+#ifndef __FTRFORK_H__
+#define __FTRFORK_H__
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
+
+
+FT_BEGIN_HEADER
+
+
+ /* Number of guessing rules supported in `FT_Raccess_Guess'. */
+ /* Don't forget to increment the number if you add a new guessing rule. */
+#define FT_RACCESS_N_RULES 9
+
+
+ /* A structure to describe a reference in a resource by its resource ID */
+ /* and internal offset. The `POST' resource expects to be concatenated */
+ /* by the order of resource IDs instead of its appearance in the file. */
+
+ typedef struct FT_RFork_Ref_
+ {
+ FT_UShort res_id;
+ FT_Long offset;
+
+ } FT_RFork_Ref;
+
+#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
+ typedef FT_Error
+ (*ft_raccess_guess_func)( FT_Library library,
+ FT_Stream stream,
+ char *base_file_name,
+ char **result_file_name,
+ FT_Long *result_offset );
+
+ typedef enum FT_RFork_Rule_ {
+ FT_RFork_Rule_invalid = -2,
+ FT_RFork_Rule_uknown, /* -1 */
+ FT_RFork_Rule_apple_double,
+ FT_RFork_Rule_apple_single,
+ FT_RFork_Rule_darwin_ufs_export,
+ FT_RFork_Rule_darwin_newvfs,
+ FT_RFork_Rule_darwin_hfsplus,
+ FT_RFork_Rule_vfat,
+ FT_RFork_Rule_linux_cap,
+ FT_RFork_Rule_linux_double,
+ FT_RFork_Rule_linux_netatalk
+ } FT_RFork_Rule;
+
+ /* For fast translation between rule index and rule type,
+ * the macros FT_RFORK_xxx should be kept consistent with
+ * the raccess_guess_funcs table
+ */
+ typedef struct ft_raccess_guess_rec_ {
+ ft_raccess_guess_func func;
+ FT_RFork_Rule type;
+ } ft_raccess_guess_rec;
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+ /* this array is a storage in non-PIC mode, so ; is needed in END */
+#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
+ static const type name[] = {
+#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
+ { raccess_guess_ ## func_suffix, \
+ FT_RFork_Rule_ ## type_suffix },
+#define CONST_FT_RFORK_RULE_ARRAY_END };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+ /* this array is a function in PIC mode, so no ; is needed in END */
+#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
+ void \
+ FT_Init_Table_ ## name( type* storage ) \
+ { \
+ type* local = storage; \
+ \
+ \
+ int i = 0;
+#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
+ local[i].func = raccess_guess_ ## func_suffix; \
+ local[i].type = FT_RFork_Rule_ ## type_suffix; \
+ i++;
+#define CONST_FT_RFORK_RULE_ARRAY_END }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Raccess_Guess */
+ /* */
+ /* <Description> */
+ /* Guess a file name and offset where the actual resource fork is */
+ /* stored. The macro FT_RACCESS_N_RULES holds the number of */
+ /* guessing rules; the guessed result for the Nth rule is */
+ /* represented as a triplet: a new file name (new_names[N]), a file */
+ /* offset (offsets[N]), and an error code (errors[N]). */
+ /* */
+ /* <Input> */
+ /* library :: */
+ /* A FreeType library instance. */
+ /* */
+ /* stream :: */
+ /* A file stream containing the resource fork. */
+ /* */
+ /* base_name :: */
+ /* The (base) file name of the resource fork used for some */
+ /* guessing rules. */
+ /* */
+ /* <Output> */
+ /* new_names :: */
+ /* An array of guessed file names in which the resource forks may */
+ /* exist. If `new_names[N]' is NULL, the guessed file name is */
+ /* equal to `base_name'. */
+ /* */
+ /* offsets :: */
+ /* An array of guessed file offsets. `offsets[N]' holds the file */
+ /* offset of the possible start of the resource fork in file */
+ /* `new_names[N]'. */
+ /* */
+ /* errors :: */
+ /* An array of FreeType error codes. `errors[N]' is the error */
+ /* code of Nth guessing rule function. If `errors[N]' is not */
+ /* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
+ /* */
+ FT_BASE( void )
+ FT_Raccess_Guess( FT_Library library,
+ FT_Stream stream,
+ char* base_name,
+ char** new_names,
+ FT_Long* offsets,
+ FT_Error* errors );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Raccess_Get_HeaderInfo */
+ /* */
+ /* <Description> */
+ /* Get the information from the header of resource fork. The */
+ /* information includes the file offset where the resource map */
+ /* starts, and the file offset where the resource data starts. */
+ /* `FT_Raccess_Get_DataOffsets' requires these two data. */
+ /* */
+ /* <Input> */
+ /* library :: */
+ /* A FreeType library instance. */
+ /* */
+ /* stream :: */
+ /* A file stream containing the resource fork. */
+ /* */
+ /* rfork_offset :: */
+ /* The file offset where the resource fork starts. */
+ /* */
+ /* <Output> */
+ /* map_offset :: */
+ /* The file offset where the resource map starts. */
+ /* */
+ /* rdata_pos :: */
+ /* The file offset where the resource data starts. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. FT_Err_Ok means success. */
+ /* */
+ FT_BASE( FT_Error )
+ FT_Raccess_Get_HeaderInfo( FT_Library library,
+ FT_Stream stream,
+ FT_Long rfork_offset,
+ FT_Long *map_offset,
+ FT_Long *rdata_pos );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Raccess_Get_DataOffsets */
+ /* */
+ /* <Description> */
+ /* Get the data offsets for a tag in a resource fork. Offsets are */
+ /* stored in an array because, in some cases, resources in a resource */
+ /* fork have the same tag. */
+ /* */
+ /* <Input> */
+ /* library :: */
+ /* A FreeType library instance. */
+ /* */
+ /* stream :: */
+ /* A file stream containing the resource fork. */
+ /* */
+ /* map_offset :: */
+ /* The file offset where the resource map starts. */
+ /* */
+ /* rdata_pos :: */
+ /* The file offset where the resource data starts. */
+ /* */
+ /* tag :: */
+ /* The resource tag. */
+ /* */
+ /* sort_by_res_id :: */
+ /* A Boolean to sort the fragmented resource by their ids. */
+ /* The fragmented resources for `POST' resource should be sorted */
+ /* to restore Type1 font properly. For `snft' resources, sorting */
+ /* may induce a different order of the faces in comparison to that */
+ /* by QuickDraw API. */
+ /* */
+ /* <Output> */
+ /* offsets :: */
+ /* The stream offsets for the resource data specified by `tag'. */
+ /* This array is allocated by the function, so you have to call */
+ /* @ft_mem_free after use. */
+ /* */
+ /* count :: */
+ /* The length of offsets array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. FT_Err_Ok means success. */
+ /* */
+ /* <Note> */
+ /* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
+ /* value for `map_offset' and `rdata_pos'. */
+ /* */
+ FT_BASE( FT_Error )
+ FT_Raccess_Get_DataOffsets( FT_Library library,
+ FT_Stream stream,
+ FT_Long map_offset,
+ FT_Long rdata_pos,
+ FT_Long tag,
+ FT_Bool sort_by_res_id,
+ FT_Long **offsets,
+ FT_Long *count );
+
+
+FT_END_HEADER
+
+#endif /* __FTRFORK_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftserv.h b/src/3rdparty/freetype/include/freetype/internal/ftserv.h
new file mode 100644
index 0000000000..11a0c7f3de
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftserv.h
@@ -0,0 +1,763 @@
+/***************************************************************************/
+/* */
+/* ftserv.h */
+/* */
+/* The FreeType services (specification only). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Each module can export one or more `services'. Each service is */
+ /* identified by a constant string and modeled by a pointer; the latter */
+ /* generally corresponds to a structure containing function pointers. */
+ /* */
+ /* Note that a service's data cannot be a mere function pointer because */
+ /* in C it is possible that function pointers might be implemented */
+ /* differently than data pointers (e.g. 48 bits instead of 32). */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTSERV_H__
+#define __FTSERV_H__
+
+
+FT_BEGIN_HEADER
+
+ /*
+ * @macro:
+ * FT_FACE_FIND_SERVICE
+ *
+ * @description:
+ * This macro is used to look up a service from a face's driver module.
+ *
+ * @input:
+ * face ::
+ * The source face handle.
+ *
+ * id ::
+ * A string describing the service as defined in the service's
+ * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
+ * `multi-masters'). It is automatically prefixed with
+ * `FT_SERVICE_ID_'.
+ *
+ * @output:
+ * ptr ::
+ * A variable that receives the service pointer. Will be NULL
+ * if not found.
+ */
+#ifdef __cplusplus
+
+#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_ = NULL; \
+ FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
+ \
+ \
+ if ( module->clazz->get_interface ) \
+ _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
+ *_pptr_ = _tmp_; \
+ FT_END_STMNT
+
+#else /* !C++ */
+
+#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_ = NULL; \
+ \
+ if ( module->clazz->get_interface ) \
+ _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
+ ptr = _tmp_; \
+ FT_END_STMNT
+
+#endif /* !C++ */
+
+
+ /*
+ * @macro:
+ * FT_FACE_FIND_GLOBAL_SERVICE
+ *
+ * @description:
+ * This macro is used to look up a service from all modules.
+ *
+ * @input:
+ * face ::
+ * The source face handle.
+ *
+ * id ::
+ * A string describing the service as defined in the service's
+ * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
+ * `multi-masters'). It is automatically prefixed with
+ * `FT_SERVICE_ID_'.
+ *
+ * @output:
+ * ptr ::
+ * A variable that receives the service pointer. Will be NULL
+ * if not found.
+ */
+#ifdef __cplusplus
+
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_; \
+ FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
+ \
+ \
+ _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
+ *_pptr_ = _tmp_; \
+ FT_END_STMNT
+
+#else /* !C++ */
+
+#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
+ FT_Pointer _tmp_; \
+ \
+ \
+ _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
+ ptr = _tmp_; \
+ FT_END_STMNT
+
+#endif /* !C++ */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** S E R V I C E D E S C R I P T O R S *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*
+ * The following structure is used to _describe_ a given service
+ * to the library. This is useful to build simple static service lists.
+ */
+ typedef struct FT_ServiceDescRec_
+ {
+ const char* serv_id; /* service name */
+ const void* serv_data; /* service pointer/data */
+
+ } FT_ServiceDescRec;
+
+ typedef const FT_ServiceDescRec* FT_ServiceDesc;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_SERVICEDESCREC1 */
+ /* FT_DEFINE_SERVICEDESCREC2 */
+ /* FT_DEFINE_SERVICEDESCREC3 */
+ /* FT_DEFINE_SERVICEDESCREC4 */
+ /* FT_DEFINE_SERVICEDESCREC5 */
+ /* FT_DEFINE_SERVICEDESCREC6 */
+ /* FT_DEFINE_SERVICEDESCREC7 */
+ /* */
+ /* <Description> */
+ /* Used to initialize an array of FT_ServiceDescRec structures. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */
+ /* be called with a pointer to return an allocated array. As soon as */
+ /* it is no longer needed, a `destroy' function needs to be called to */
+ /* release that allocation. */
+ /* */
+ /* These functions should be manually called from the `pic_init' and */
+ /* `pic_free' functions of your module (see FT_DEFINE_MODULE). */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is not defined the array will be */
+ /* allocated in the global scope (or the scope where the macro is */
+ /* used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICEDESCREC1( class_, \
+ serv_id_1, serv_data_1 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC2( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC3( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC4( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC5( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC6( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { NULL, NULL } \
+ };
+
+#define FT_DEFINE_SERVICEDESCREC7( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { serv_id_7, serv_data_7 }, \
+ { NULL, NULL } \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICEDESCREC1( class_, \
+ serv_id_1, serv_data_1 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class ) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = NULL; \
+ clazz[1].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC2( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class ) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = NULL; \
+ clazz[2].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC3( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class ) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = NULL; \
+ clazz[3].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC4( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class ) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = NULL; \
+ clazz[4].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC5( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class ) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = NULL; \
+ clazz[5].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC6( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = serv_id_6; \
+ clazz[5].serv_data = serv_data_6; \
+ clazz[6].serv_id = NULL; \
+ clazz[6].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#define FT_DEFINE_SERVICEDESCREC7( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = serv_id_6; \
+ clazz[5].serv_data = serv_data_6; \
+ clazz[6].serv_id = serv_id_7; \
+ clazz[6].serv_data = serv_data_7; \
+ clazz[7].serv_id = NULL; \
+ clazz[7].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+ /*
+ * Parse a list of FT_ServiceDescRec descriptors and look for
+ * a specific service by ID. Note that the last element in the
+ * array must be { NULL, NULL }, and that the function should
+ * return NULL if the service isn't available.
+ *
+ * This function can be used by modules to implement their
+ * `get_service' method.
+ */
+ FT_BASE( FT_Pointer )
+ ft_service_list_lookup( FT_ServiceDesc service_descriptors,
+ const char* service_id );
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** S E R V I C E S C A C H E *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*
+ * This structure is used to store a cache for several frequently used
+ * services. It is the type of `face->internal->services'. You
+ * should only use FT_FACE_LOOKUP_SERVICE to access it.
+ *
+ * All fields should have the type FT_Pointer to relax compilation
+ * dependencies. We assume the developer isn't completely stupid.
+ *
+ * Each field must be named `service_XXXX' where `XXX' corresponds to
+ * the correct FT_SERVICE_ID_XXXX macro. See the definition of
+ * FT_FACE_LOOKUP_SERVICE below how this is implemented.
+ *
+ */
+ typedef struct FT_ServiceCacheRec_
+ {
+ FT_Pointer service_POSTSCRIPT_FONT_NAME;
+ FT_Pointer service_MULTI_MASTERS;
+ FT_Pointer service_GLYPH_DICT;
+ FT_Pointer service_PFR_METRICS;
+ FT_Pointer service_WINFNT;
+
+ } FT_ServiceCacheRec, *FT_ServiceCache;
+
+
+ /*
+ * A magic number used within the services cache.
+ */
+
+ /* ensure that value `1' has the same width as a pointer */
+#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
+
+
+ /*
+ * @macro:
+ * FT_FACE_LOOKUP_SERVICE
+ *
+ * @description:
+ * This macro is used to lookup a service from a face's driver module
+ * using its cache.
+ *
+ * @input:
+ * face::
+ * The source face handle containing the cache.
+ *
+ * field ::
+ * The field name in the cache.
+ *
+ * id ::
+ * The service ID.
+ *
+ * @output:
+ * ptr ::
+ * A variable receiving the service data. NULL if not available.
+ */
+#ifdef __cplusplus
+
+#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Pointer svc; \
+ FT_Pointer* Pptr = (FT_Pointer*)&(ptr); \
+ \
+ \
+ svc = FT_FACE( face )->internal->services. service_ ## id; \
+ if ( svc == FT_SERVICE_UNAVAILABLE ) \
+ svc = NULL; \
+ else if ( svc == NULL ) \
+ { \
+ FT_FACE_FIND_SERVICE( face, svc, id ); \
+ \
+ FT_FACE( face )->internal->services. service_ ## id = \
+ (FT_Pointer)( svc != NULL ? svc \
+ : FT_SERVICE_UNAVAILABLE ); \
+ } \
+ *Pptr = svc; \
+ FT_END_STMNT
+
+#else /* !C++ */
+
+#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
+ FT_BEGIN_STMNT \
+ FT_Pointer svc; \
+ \
+ \
+ svc = FT_FACE( face )->internal->services. service_ ## id; \
+ if ( svc == FT_SERVICE_UNAVAILABLE ) \
+ svc = NULL; \
+ else if ( svc == NULL ) \
+ { \
+ FT_FACE_FIND_SERVICE( face, svc, id ); \
+ \
+ FT_FACE( face )->internal->services. service_ ## id = \
+ (FT_Pointer)( svc != NULL ? svc \
+ : FT_SERVICE_UNAVAILABLE ); \
+ } \
+ ptr = svc; \
+ FT_END_STMNT
+
+#endif /* !C++ */
+
+ /*
+ * A macro used to define new service structure types.
+ */
+
+#define FT_DEFINE_SERVICE( name ) \
+ typedef struct FT_Service_ ## name ## Rec_ \
+ FT_Service_ ## name ## Rec ; \
+ typedef struct FT_Service_ ## name ## Rec_ \
+ const * FT_Service_ ## name ; \
+ struct FT_Service_ ## name ## Rec_
+
+ /* */
+
+ /*
+ * The header files containing the services.
+ */
+
+#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
+#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
+#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
+#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
+#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
+#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
+#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
+#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
+#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h>
+#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
+#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
+#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h>
+#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
+#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
+#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
+#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
+#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
+#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTSERV_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftstream.h b/src/3rdparty/freetype/include/freetype/internal/ftstream.h
new file mode 100644
index 0000000000..384e5df305
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftstream.h
@@ -0,0 +1,536 @@
+/***************************************************************************/
+/* */
+/* ftstream.h */
+/* */
+/* Stream handling (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTSTREAM_H__
+#define __FTSTREAM_H__
+
+
+#include <ft2build.h>
+#include FT_SYSTEM_H
+#include FT_INTERNAL_OBJECTS_H
+
+
+FT_BEGIN_HEADER
+
+
+ /* format of an 8-bit frame_op value: */
+ /* */
+ /* bit 76543210 */
+ /* xxxxxxes */
+ /* */
+ /* s is set to 1 if the value is signed. */
+ /* e is set to 1 if the value is little-endian. */
+ /* xxx is a command. */
+
+#define FT_FRAME_OP_SHIFT 2
+#define FT_FRAME_OP_SIGNED 1
+#define FT_FRAME_OP_LITTLE 2
+#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
+
+#define FT_MAKE_FRAME_OP( command, little, sign ) \
+ ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
+
+#define FT_FRAME_OP_END 0
+#define FT_FRAME_OP_START 1 /* start a new frame */
+#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
+#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
+#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
+#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
+#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
+
+
+ typedef enum FT_Frame_Op_
+ {
+ ft_frame_end = 0,
+ ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
+
+ ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
+ ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
+
+ ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
+ ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
+ ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
+ ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
+
+ ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
+ ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
+ ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
+ ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
+
+ ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
+ ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
+ ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
+ ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
+
+ ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
+ ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
+
+ } FT_Frame_Op;
+
+
+ typedef struct FT_Frame_Field_
+ {
+ FT_Byte value;
+ FT_Byte size;
+ FT_UShort offset;
+
+ } FT_Frame_Field;
+
+
+ /* Construct an FT_Frame_Field out of a structure type and a field name. */
+ /* The structure type must be set in the FT_STRUCTURE macro before */
+ /* calling the FT_FRAME_START() macro. */
+ /* */
+#define FT_FIELD_SIZE( f ) \
+ (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
+
+#define FT_FIELD_SIZE_DELTA( f ) \
+ (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
+
+#define FT_FIELD_OFFSET( f ) \
+ (FT_UShort)( offsetof( FT_STRUCTURE, f ) )
+
+#define FT_FRAME_FIELD( frame_op, field ) \
+ { \
+ frame_op, \
+ FT_FIELD_SIZE( field ), \
+ FT_FIELD_OFFSET( field ) \
+ }
+
+#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
+
+#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
+#define FT_FRAME_END { ft_frame_end, 0, 0 }
+
+#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
+#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
+#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
+#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
+#define FT_FRAME_OFF3( f ) FT_FRAME_FIELD( ft_frame_off3_be, f )
+#define FT_FRAME_UOFF3( f ) FT_FRAME_FIELD( ft_frame_uoff3_be, f )
+#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
+#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
+
+#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
+#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
+#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
+#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
+#define FT_FRAME_OFF3_LE( f ) FT_FRAME_FIELD( ft_frame_off3_le, f )
+#define FT_FRAME_UOFF3_LE( f ) FT_FRAME_FIELD( ft_frame_uoff3_le, f )
+
+#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
+#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
+#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
+
+#define FT_FRAME_BYTES( field, count ) \
+ { \
+ ft_frame_bytes, \
+ count, \
+ FT_FIELD_OFFSET( field ) \
+ }
+
+#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
+
+
+ /*************************************************************************/
+ /* */
+ /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
+ /* type `char*' or equivalent (1-byte elements). */
+ /* */
+
+#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
+
+#define FT_INT16( x ) ( (FT_Int16)(x) )
+#define FT_UINT16( x ) ( (FT_UInt16)(x) )
+#define FT_INT32( x ) ( (FT_Int32)(x) )
+#define FT_UINT32( x ) ( (FT_UInt32)(x) )
+
+
+#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
+#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
+
+
+#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
+ FT_BYTE_U16( p, 1, 0) )
+
+#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
+ FT_BYTE_U16( p, 1, 0 ) )
+
+#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
+ FT_BYTE_U32( p, 1, 16 ) | \
+ FT_BYTE_U32( p, 2, 8 ) | \
+ FT_BYTE_U32( p, 3, 0 ) )
+
+#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
+ FT_BYTE_U32( p, 1, 16 ) | \
+ FT_BYTE_U32( p, 2, 8 ) | \
+ FT_BYTE_U32( p, 3, 0 ) )
+
+#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 2, 0 ) )
+
+#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 2, 0 ) )
+
+#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
+ FT_BYTE_U16( p, 0, 0 ) )
+
+#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
+ FT_BYTE_U16( p, 0, 0 ) )
+
+#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
+ FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
+
+#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
+ FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
+
+#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
+
+#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
+
+
+#define FT_NEXT_CHAR( buffer ) \
+ ( (signed char)*buffer++ )
+
+#define FT_NEXT_BYTE( buffer ) \
+ ( (unsigned char)*buffer++ )
+
+#define FT_NEXT_SHORT( buffer ) \
+ ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
+
+#define FT_NEXT_USHORT( buffer ) \
+ ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
+
+#define FT_NEXT_OFF3( buffer ) \
+ ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
+
+#define FT_NEXT_UOFF3( buffer ) \
+ ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
+
+#define FT_NEXT_LONG( buffer ) \
+ ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
+
+#define FT_NEXT_ULONG( buffer ) \
+ ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
+
+
+#define FT_NEXT_SHORT_LE( buffer ) \
+ ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
+
+#define FT_NEXT_USHORT_LE( buffer ) \
+ ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
+
+#define FT_NEXT_OFF3_LE( buffer ) \
+ ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
+
+#define FT_NEXT_UOFF3_LE( buffer ) \
+ ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
+
+#define FT_NEXT_LONG_LE( buffer ) \
+ ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
+
+#define FT_NEXT_ULONG_LE( buffer ) \
+ ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
+
+
+ /*************************************************************************/
+ /* */
+ /* Each GET_xxxx() macro uses an implicit `stream' variable. */
+ /* */
+#if 0
+#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
+
+#define FT_GET_CHAR() FT_GET_MACRO( CHAR )
+#define FT_GET_BYTE() FT_GET_MACRO( BYTE )
+#define FT_GET_SHORT() FT_GET_MACRO( SHORT )
+#define FT_GET_USHORT() FT_GET_MACRO( USHORT )
+#define FT_GET_OFF3() FT_GET_MACRO( OFF3 )
+#define FT_GET_UOFF3() FT_GET_MACRO( UOFF3 )
+#define FT_GET_LONG() FT_GET_MACRO( LONG )
+#define FT_GET_ULONG() FT_GET_MACRO( ULONG )
+#define FT_GET_TAG4() FT_GET_MACRO( ULONG )
+
+#define FT_GET_SHORT_LE() FT_GET_MACRO( SHORT_LE )
+#define FT_GET_USHORT_LE() FT_GET_MACRO( USHORT_LE )
+#define FT_GET_LONG_LE() FT_GET_MACRO( LONG_LE )
+#define FT_GET_ULONG_LE() FT_GET_MACRO( ULONG_LE )
+
+#else
+#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
+
+#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
+#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
+#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
+#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
+#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
+#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
+#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
+#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
+#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
+
+#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
+#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
+#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
+#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
+#endif
+
+#define FT_READ_MACRO( func, type, var ) \
+ ( var = (type)func( stream, &error ), \
+ error != FT_Err_Ok )
+
+#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
+#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
+#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
+#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
+#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
+#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
+#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
+#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
+
+#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
+#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
+#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
+#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
+
+
+#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
+
+ /* initialize a stream for reading a regular system stream */
+ FT_BASE( FT_Error )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname );
+
+#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
+
+
+ /* create a new (input) stream from an FT_Open_Args structure */
+ FT_BASE( FT_Error )
+ FT_Stream_New( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Stream *astream );
+
+ /* free a stream */
+ FT_BASE( void )
+ FT_Stream_Free( FT_Stream stream,
+ FT_Int external );
+
+ /* initialize a stream for reading in-memory data */
+ FT_BASE( void )
+ FT_Stream_OpenMemory( FT_Stream stream,
+ const FT_Byte* base,
+ FT_ULong size );
+
+ /* close a stream (does not destroy the stream structure) */
+ FT_BASE( void )
+ FT_Stream_Close( FT_Stream stream );
+
+
+ /* seek within a stream. position is relative to start of stream */
+ FT_BASE( FT_Error )
+ FT_Stream_Seek( FT_Stream stream,
+ FT_ULong pos );
+
+ /* skip bytes in a stream */
+ FT_BASE( FT_Error )
+ FT_Stream_Skip( FT_Stream stream,
+ FT_Long distance );
+
+ /* return current stream position */
+ FT_BASE( FT_ULong )
+ FT_Stream_Pos( FT_Stream stream );
+
+ /* read bytes from a stream into a user-allocated buffer, returns an */
+ /* error if not all bytes could be read. */
+ FT_BASE( FT_Error )
+ FT_Stream_Read( FT_Stream stream,
+ FT_Byte* buffer,
+ FT_ULong count );
+
+ /* read bytes from a stream at a given position */
+ FT_BASE( FT_Error )
+ FT_Stream_ReadAt( FT_Stream stream,
+ FT_ULong pos,
+ FT_Byte* buffer,
+ FT_ULong count );
+
+ /* try to read bytes at the end of a stream; return number of bytes */
+ /* really available */
+ FT_BASE( FT_ULong )
+ FT_Stream_TryRead( FT_Stream stream,
+ FT_Byte* buffer,
+ FT_ULong count );
+
+ /* Enter a frame of `count' consecutive bytes in a stream. Returns an */
+ /* error if the frame could not be read/accessed. The caller can use */
+ /* the FT_Stream_Get_XXX functions to retrieve frame data without */
+ /* error checks. */
+ /* */
+ /* You must _always_ call FT_Stream_ExitFrame() once you have entered */
+ /* a stream frame! */
+ /* */
+ FT_BASE( FT_Error )
+ FT_Stream_EnterFrame( FT_Stream stream,
+ FT_ULong count );
+
+ /* exit a stream frame */
+ FT_BASE( void )
+ FT_Stream_ExitFrame( FT_Stream stream );
+
+ /* Extract a stream frame. If the stream is disk-based, a heap block */
+ /* is allocated and the frame bytes are read into it. If the stream */
+ /* is memory-based, this function simply set a pointer to the data. */
+ /* */
+ /* Useful to optimize access to memory-based streams transparently. */
+ /* */
+ /* All extracted frames must be `freed' with a call to the function */
+ /* FT_Stream_ReleaseFrame(). */
+ /* */
+ FT_BASE( FT_Error )
+ FT_Stream_ExtractFrame( FT_Stream stream,
+ FT_ULong count,
+ FT_Byte** pbytes );
+
+ /* release an extract frame (see FT_Stream_ExtractFrame) */
+ FT_BASE( void )
+ FT_Stream_ReleaseFrame( FT_Stream stream,
+ FT_Byte** pbytes );
+
+ /* read a byte from an entered frame */
+ FT_BASE( FT_Char )
+ FT_Stream_GetChar( FT_Stream stream );
+
+ /* read a 16-bit big-endian unsigned integer from an entered frame */
+ FT_BASE( FT_UShort )
+ FT_Stream_GetUShort( FT_Stream stream );
+
+ /* read a 24-bit big-endian unsigned integer from an entered frame */
+ FT_BASE( FT_ULong )
+ FT_Stream_GetUOffset( FT_Stream stream );
+
+ /* read a 32-bit big-endian unsigned integer from an entered frame */
+ FT_BASE( FT_ULong )
+ FT_Stream_GetULong( FT_Stream stream );
+
+ /* read a 16-bit little-endian unsigned integer from an entered frame */
+ FT_BASE( FT_UShort )
+ FT_Stream_GetUShortLE( FT_Stream stream );
+
+ /* read a 32-bit little-endian unsigned integer from an entered frame */
+ FT_BASE( FT_ULong )
+ FT_Stream_GetULongLE( FT_Stream stream );
+
+
+ /* read a byte from a stream */
+ FT_BASE( FT_Char )
+ FT_Stream_ReadChar( FT_Stream stream,
+ FT_Error* error );
+
+ /* read a 16-bit big-endian unsigned integer from a stream */
+ FT_BASE( FT_UShort )
+ FT_Stream_ReadUShort( FT_Stream stream,
+ FT_Error* error );
+
+ /* read a 24-bit big-endian unsigned integer from a stream */
+ FT_BASE( FT_ULong )
+ FT_Stream_ReadUOffset( FT_Stream stream,
+ FT_Error* error );
+
+ /* read a 32-bit big-endian integer from a stream */
+ FT_BASE( FT_ULong )
+ FT_Stream_ReadULong( FT_Stream stream,
+ FT_Error* error );
+
+ /* read a 16-bit little-endian unsigned integer from a stream */
+ FT_BASE( FT_UShort )
+ FT_Stream_ReadUShortLE( FT_Stream stream,
+ FT_Error* error );
+
+ /* read a 32-bit little-endian unsigned integer from a stream */
+ FT_BASE( FT_ULong )
+ FT_Stream_ReadULongLE( FT_Stream stream,
+ FT_Error* error );
+
+ /* Read a structure from a stream. The structure must be described */
+ /* by an array of FT_Frame_Field records. */
+ FT_BASE( FT_Error )
+ FT_Stream_ReadFields( FT_Stream stream,
+ const FT_Frame_Field* fields,
+ void* structure );
+
+
+#define FT_STREAM_POS() \
+ FT_Stream_Pos( stream )
+
+#define FT_STREAM_SEEK( position ) \
+ FT_SET_ERROR( FT_Stream_Seek( stream, \
+ (FT_ULong)(position) ) )
+
+#define FT_STREAM_SKIP( distance ) \
+ FT_SET_ERROR( FT_Stream_Skip( stream, \
+ (FT_Long)(distance) ) )
+
+#define FT_STREAM_READ( buffer, count ) \
+ FT_SET_ERROR( FT_Stream_Read( stream, \
+ (FT_Byte*)(buffer), \
+ (FT_ULong)(count) ) )
+
+#define FT_STREAM_READ_AT( position, buffer, count ) \
+ FT_SET_ERROR( FT_Stream_ReadAt( stream, \
+ (FT_ULong)(position), \
+ (FT_Byte*)buffer, \
+ (FT_ULong)(count) ) )
+
+#define FT_STREAM_READ_FIELDS( fields, object ) \
+ FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
+
+
+#define FT_FRAME_ENTER( size ) \
+ FT_SET_ERROR( \
+ FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
+ (FT_ULong)(size) ) ) )
+
+#define FT_FRAME_EXIT() \
+ FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
+
+#define FT_FRAME_EXTRACT( size, bytes ) \
+ FT_SET_ERROR( \
+ FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
+ (FT_ULong)(size), \
+ (FT_Byte**)&(bytes) ) ) )
+
+#define FT_FRAME_RELEASE( bytes ) \
+ FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
+ (FT_Byte**)&(bytes) ) )
+
+
+FT_END_HEADER
+
+#endif /* __FTSTREAM_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/fttrace.h b/src/3rdparty/freetype/include/freetype/internal/fttrace.h
new file mode 100644
index 0000000000..9d28d214d6
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/fttrace.h
@@ -0,0 +1,154 @@
+/***************************************************************************/
+/* */
+/* fttrace.h */
+/* */
+/* Tracing handling (specification only). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /* definitions of trace levels for FreeType 2 */
+
+ /* the first level must always be `trace_any' */
+FT_TRACE_DEF( any )
+
+ /* base components */
+FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
+FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
+FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
+FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
+FT_TRACE_DEF( list ) /* list management (ftlist.c) */
+FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
+FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
+FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
+FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
+FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
+
+FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
+FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
+FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
+FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
+FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
+FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
+
+ /* Cache sub-system */
+FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
+
+ /* SFNT driver components */
+FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
+FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
+FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
+FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
+FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
+FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
+FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
+FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
+FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
+
+ /* TrueType driver components */
+FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
+FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
+FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
+FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
+FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
+FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
+
+ /* Type 1 driver components */
+FT_TRACE_DEF( t1afm )
+FT_TRACE_DEF( t1driver )
+FT_TRACE_DEF( t1gload )
+FT_TRACE_DEF( t1hint )
+FT_TRACE_DEF( t1load )
+FT_TRACE_DEF( t1objs )
+FT_TRACE_DEF( t1parse )
+
+ /* PostScript helper module `psaux' */
+FT_TRACE_DEF( t1decode )
+FT_TRACE_DEF( psobjs )
+FT_TRACE_DEF( psconv )
+
+ /* PostScript hinting module `pshinter' */
+FT_TRACE_DEF( pshrec )
+FT_TRACE_DEF( pshalgo1 )
+FT_TRACE_DEF( pshalgo2 )
+
+ /* Type 2 driver components */
+FT_TRACE_DEF( cffdriver )
+FT_TRACE_DEF( cffgload )
+FT_TRACE_DEF( cffload )
+FT_TRACE_DEF( cffobjs )
+FT_TRACE_DEF( cffparse )
+
+FT_TRACE_DEF( cf2blues )
+FT_TRACE_DEF( cf2hints )
+FT_TRACE_DEF( cf2interp )
+
+ /* Type 42 driver component */
+FT_TRACE_DEF( t42 )
+
+ /* CID driver components */
+FT_TRACE_DEF( cidafm )
+FT_TRACE_DEF( ciddriver )
+FT_TRACE_DEF( cidgload )
+FT_TRACE_DEF( cidload )
+FT_TRACE_DEF( cidobjs )
+FT_TRACE_DEF( cidparse )
+
+ /* Windows font component */
+FT_TRACE_DEF( winfnt )
+
+ /* PCF font components */
+FT_TRACE_DEF( pcfdriver )
+FT_TRACE_DEF( pcfread )
+
+ /* BDF font components */
+FT_TRACE_DEF( bdfdriver )
+FT_TRACE_DEF( bdflib )
+
+ /* PFR font component */
+FT_TRACE_DEF( pfr )
+
+ /* OpenType validation components */
+FT_TRACE_DEF( otvmodule )
+FT_TRACE_DEF( otvcommon )
+FT_TRACE_DEF( otvbase )
+FT_TRACE_DEF( otvgdef )
+FT_TRACE_DEF( otvgpos )
+FT_TRACE_DEF( otvgsub )
+FT_TRACE_DEF( otvjstf )
+FT_TRACE_DEF( otvmath )
+
+ /* TrueTypeGX/AAT validation components */
+FT_TRACE_DEF( gxvmodule )
+FT_TRACE_DEF( gxvcommon )
+FT_TRACE_DEF( gxvfeat )
+FT_TRACE_DEF( gxvmort )
+FT_TRACE_DEF( gxvmorx )
+FT_TRACE_DEF( gxvbsln )
+FT_TRACE_DEF( gxvjust )
+FT_TRACE_DEF( gxvkern )
+FT_TRACE_DEF( gxvopbd )
+FT_TRACE_DEF( gxvtrak )
+FT_TRACE_DEF( gxvprop )
+FT_TRACE_DEF( gxvlcar )
+
+ /* autofit components */
+FT_TRACE_DEF( afmodule )
+FT_TRACE_DEF( afhints )
+FT_TRACE_DEF( afcjk )
+FT_TRACE_DEF( aflatin )
+FT_TRACE_DEF( aflatin2 )
+FT_TRACE_DEF( afwarp )
+FT_TRACE_DEF( afharfbuzz )
+FT_TRACE_DEF( afglobal )
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftvalid.h b/src/3rdparty/freetype/include/freetype/internal/ftvalid.h
new file mode 100644
index 0000000000..9cda6eef5f
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftvalid.h
@@ -0,0 +1,159 @@
+/***************************************************************************/
+/* */
+/* ftvalid.h */
+/* */
+/* FreeType validation support (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTVALID_H__
+#define __FTVALID_H__
+
+#include <ft2build.h>
+#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** ****/
+ /**** V A L I D A T I O N ****/
+ /**** ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /* handle to a validation object */
+ typedef struct FT_ValidatorRec_ volatile* FT_Validator;
+
+
+ /*************************************************************************/
+ /* */
+ /* There are three distinct validation levels defined here: */
+ /* */
+ /* FT_VALIDATE_DEFAULT :: */
+ /* A table that passes this validation level can be used reliably by */
+ /* FreeType. It generally means that all offsets have been checked to */
+ /* prevent out-of-bound reads, that array counts are correct, etc. */
+ /* */
+ /* FT_VALIDATE_TIGHT :: */
+ /* A table that passes this validation level can be used reliably and */
+ /* doesn't contain invalid data. For example, a charmap table that */
+ /* returns invalid glyph indices will not pass, even though it can */
+ /* be used with FreeType in default mode (the library will simply */
+ /* return an error later when trying to load the glyph). */
+ /* */
+ /* It also checks that fields which must be a multiple of 2, 4, or 8, */
+ /* don't have incorrect values, etc. */
+ /* */
+ /* FT_VALIDATE_PARANOID :: */
+ /* Only for font debugging. Checks that a table follows the */
+ /* specification by 100%. Very few fonts will be able to pass this */
+ /* level anyway but it can be useful for certain tools like font */
+ /* editors/converters. */
+ /* */
+ typedef enum FT_ValidationLevel_
+ {
+ FT_VALIDATE_DEFAULT = 0,
+ FT_VALIDATE_TIGHT,
+ FT_VALIDATE_PARANOID
+
+ } FT_ValidationLevel;
+
+
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `structure was padded due to */
+ /* __declspec(align())' in order to compile cleanly with */
+ /* the maximum level of warnings. */
+#pragma warning( push )
+#pragma warning( disable : 4324 )
+#endif /* _MSC_VER */
+
+ /* validator structure */
+ typedef struct FT_ValidatorRec_
+ {
+ ft_jmp_buf jump_buffer; /* used for exception handling */
+
+ const FT_Byte* base; /* address of table in memory */
+ const FT_Byte* limit; /* `base' + sizeof(table) in memory */
+ FT_ValidationLevel level; /* validation level */
+ FT_Error error; /* error returned. 0 means success */
+
+ } FT_ValidatorRec;
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
+
+#define FT_VALIDATOR( x ) ( (FT_Validator)( x ) )
+
+
+ FT_BASE( void )
+ ft_validator_init( FT_Validator valid,
+ const FT_Byte* base,
+ const FT_Byte* limit,
+ FT_ValidationLevel level );
+
+ /* Do not use this. It's broken and will cause your validator to crash */
+ /* if you run it on an invalid font. */
+ FT_BASE( FT_Int )
+ ft_validator_run( FT_Validator valid );
+
+ /* Sets the error field in a validator, then calls `longjmp' to return */
+ /* to high-level caller. Using `setjmp/longjmp' avoids many stupid */
+ /* error checks within the validation routines. */
+ /* */
+ FT_BASE( void )
+ ft_validator_error( FT_Validator valid,
+ FT_Error error );
+
+
+ /* Calls ft_validate_error. Assumes that the `valid' local variable */
+ /* holds a pointer to the current validator object. */
+ /* */
+#define FT_INVALID( _error ) FT_INVALID_( _error )
+#define FT_INVALID_( _error ) \
+ ft_validator_error( valid, FT_THROW( _error ) )
+
+ /* called when a broken table is detected */
+#define FT_INVALID_TOO_SHORT \
+ FT_INVALID( Invalid_Table )
+
+ /* called when an invalid offset is detected */
+#define FT_INVALID_OFFSET \
+ FT_INVALID( Invalid_Offset )
+
+ /* called when an invalid format/value is detected */
+#define FT_INVALID_FORMAT \
+ FT_INVALID( Invalid_Table )
+
+ /* called when an invalid glyph index is detected */
+#define FT_INVALID_GLYPH_ID \
+ FT_INVALID( Invalid_Glyph_Index )
+
+ /* called when an invalid field value is detected */
+#define FT_INVALID_DATA \
+ FT_INVALID( Invalid_Table )
+
+
+FT_END_HEADER
+
+#endif /* __FTVALID_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/internal.h b/src/3rdparty/freetype/include/freetype/internal/internal.h
new file mode 100644
index 0000000000..809ce59c92
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/internal.h
@@ -0,0 +1,63 @@
+/***************************************************************************/
+/* */
+/* internal.h */
+/* */
+/* Internal header files (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file is automatically included by `ft2build.h'. */
+ /* Do not include it manually! */
+ /* */
+ /*************************************************************************/
+
+
+#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
+#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
+#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
+#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
+#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
+#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
+#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
+#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
+#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
+#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
+#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h>
+#define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h>
+#define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h>
+
+#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
+#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
+
+#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
+#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
+#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
+
+#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
+
+
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+
+ /* We disable the warning `conditional expression is constant' here */
+ /* in order to compile cleanly with the maximum level of warnings. */
+ /* In particular, the warning complains about stuff like `while(0)' */
+ /* which is very useful in macro definitions. There is no benefit */
+ /* in having it enabled. */
+#pragma warning( disable : 4127 )
+
+#endif /* _MSC_VER */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/psaux.h b/src/3rdparty/freetype/include/freetype/internal/psaux.h
new file mode 100644
index 0000000000..1c5f784f52
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/psaux.h
@@ -0,0 +1,877 @@
+/***************************************************************************/
+/* */
+/* psaux.h */
+/* */
+/* Auxiliary functions and data structures related to PostScript fonts */
+/* (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __PSAUX_H__
+#define __PSAUX_H__
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** T1_TABLE *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ typedef struct PS_TableRec_* PS_Table;
+ typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_Table_FuncsRec */
+ /* */
+ /* <Description> */
+ /* A set of function pointers to manage PS_Table objects. */
+ /* */
+ /* <Fields> */
+ /* table_init :: Used to initialize a table. */
+ /* */
+ /* table_done :: Finalizes resp. destroy a given table. */
+ /* */
+ /* table_add :: Adds a new object to a table. */
+ /* */
+ /* table_release :: Releases table data, then finalizes it. */
+ /* */
+ typedef struct PS_Table_FuncsRec_
+ {
+ FT_Error
+ (*init)( PS_Table table,
+ FT_Int count,
+ FT_Memory memory );
+
+ void
+ (*done)( PS_Table table );
+
+ FT_Error
+ (*add)( PS_Table table,
+ FT_Int idx,
+ void* object,
+ FT_UInt length );
+
+ void
+ (*release)( PS_Table table );
+
+ } PS_Table_FuncsRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_TableRec */
+ /* */
+ /* <Description> */
+ /* A PS_Table is a simple object used to store an array of objects in */
+ /* a single memory block. */
+ /* */
+ /* <Fields> */
+ /* block :: The address in memory of the growheap's block. This */
+ /* can change between two object adds, due to */
+ /* reallocation. */
+ /* */
+ /* cursor :: The current top of the grow heap within its block. */
+ /* */
+ /* capacity :: The current size of the heap block. Increments by */
+ /* 1kByte chunks. */
+ /* */
+ /* init :: Set to 0xDEADBEEF if `elements' and `lengths' have */
+ /* been allocated. */
+ /* */
+ /* max_elems :: The maximum number of elements in table. */
+ /* */
+ /* num_elems :: The current number of elements in table. */
+ /* */
+ /* elements :: A table of element addresses within the block. */
+ /* */
+ /* lengths :: A table of element sizes within the block. */
+ /* */
+ /* memory :: The object used for memory operations */
+ /* (alloc/realloc). */
+ /* */
+ /* funcs :: A table of method pointers for this object. */
+ /* */
+ typedef struct PS_TableRec_
+ {
+ FT_Byte* block; /* current memory block */
+ FT_Offset cursor; /* current cursor in memory block */
+ FT_Offset capacity; /* current size of memory block */
+ FT_ULong init;
+
+ FT_Int max_elems;
+ FT_Int num_elems;
+ FT_Byte** elements; /* addresses of table elements */
+ FT_UInt* lengths; /* lengths of table elements */
+
+ FT_Memory memory;
+ PS_Table_FuncsRec funcs;
+
+ } PS_TableRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** T1 FIELDS & TOKENS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef struct PS_ParserRec_* PS_Parser;
+
+ typedef struct T1_TokenRec_* T1_Token;
+
+ typedef struct T1_FieldRec_* T1_Field;
+
+
+ /* simple enumeration type used to identify token types */
+ typedef enum T1_TokenType_
+ {
+ T1_TOKEN_TYPE_NONE = 0,
+ T1_TOKEN_TYPE_ANY,
+ T1_TOKEN_TYPE_STRING,
+ T1_TOKEN_TYPE_ARRAY,
+ T1_TOKEN_TYPE_KEY, /* aka `name' */
+
+ /* do not remove */
+ T1_TOKEN_TYPE_MAX
+
+ } T1_TokenType;
+
+
+ /* a simple structure used to identify tokens */
+ typedef struct T1_TokenRec_
+ {
+ FT_Byte* start; /* first character of token in input stream */
+ FT_Byte* limit; /* first character after the token */
+ T1_TokenType type; /* type of token */
+
+ } T1_TokenRec;
+
+
+ /* enumeration type used to identify object fields */
+ typedef enum T1_FieldType_
+ {
+ T1_FIELD_TYPE_NONE = 0,
+ T1_FIELD_TYPE_BOOL,
+ T1_FIELD_TYPE_INTEGER,
+ T1_FIELD_TYPE_FIXED,
+ T1_FIELD_TYPE_FIXED_1000,
+ T1_FIELD_TYPE_STRING,
+ T1_FIELD_TYPE_KEY,
+ T1_FIELD_TYPE_BBOX,
+ T1_FIELD_TYPE_MM_BBOX,
+ T1_FIELD_TYPE_INTEGER_ARRAY,
+ T1_FIELD_TYPE_FIXED_ARRAY,
+ T1_FIELD_TYPE_CALLBACK,
+
+ /* do not remove */
+ T1_FIELD_TYPE_MAX
+
+ } T1_FieldType;
+
+
+ typedef enum T1_FieldLocation_
+ {
+ T1_FIELD_LOCATION_CID_INFO,
+ T1_FIELD_LOCATION_FONT_DICT,
+ T1_FIELD_LOCATION_FONT_EXTRA,
+ T1_FIELD_LOCATION_FONT_INFO,
+ T1_FIELD_LOCATION_PRIVATE,
+ T1_FIELD_LOCATION_BBOX,
+ T1_FIELD_LOCATION_LOADER,
+ T1_FIELD_LOCATION_FACE,
+ T1_FIELD_LOCATION_BLEND,
+
+ /* do not remove */
+ T1_FIELD_LOCATION_MAX
+
+ } T1_FieldLocation;
+
+
+ typedef void
+ (*T1_Field_ParseFunc)( FT_Face face,
+ FT_Pointer parser );
+
+
+ /* structure type used to model object fields */
+ typedef struct T1_FieldRec_
+ {
+ const char* ident; /* field identifier */
+ T1_FieldLocation location;
+ T1_FieldType type; /* type of field */
+ T1_Field_ParseFunc reader;
+ FT_UInt offset; /* offset of field in object */
+ FT_Byte size; /* size of field in bytes */
+ FT_UInt array_max; /* maximum number of elements for */
+ /* array */
+ FT_UInt count_offset; /* offset of element count for */
+ /* arrays; must not be zero if in */
+ /* use -- in other words, a */
+ /* `num_FOO' element must not */
+ /* start the used structure if we */
+ /* parse a `FOO' array */
+ FT_UInt dict; /* where we expect it */
+ } T1_FieldRec;
+
+#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */
+#define T1_FIELD_DICT_PRIVATE ( 1 << 1 )
+
+
+
+#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
+ { \
+ _ident, T1CODE, _type, \
+ 0, \
+ FT_FIELD_OFFSET( _fname ), \
+ FT_FIELD_SIZE( _fname ), \
+ 0, 0, \
+ _dict \
+ },
+
+#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
+ { \
+ _ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
+ (T1_Field_ParseFunc)_reader, \
+ 0, 0, \
+ 0, 0, \
+ _dict \
+ },
+
+#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
+ { \
+ _ident, T1CODE, _type, \
+ 0, \
+ FT_FIELD_OFFSET( _fname ), \
+ FT_FIELD_SIZE_DELTA( _fname ), \
+ _max, \
+ FT_FIELD_OFFSET( num_ ## _fname ), \
+ _dict \
+ },
+
+#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
+ { \
+ _ident, T1CODE, _type, \
+ 0, \
+ FT_FIELD_OFFSET( _fname ), \
+ FT_FIELD_SIZE_DELTA( _fname ), \
+ _max, 0, \
+ _dict \
+ },
+
+
+#define T1_FIELD_BOOL( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )
+
+#define T1_FIELD_NUM( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )
+
+#define T1_FIELD_FIXED( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )
+
+#define T1_FIELD_FIXED_1000( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \
+ _dict )
+
+#define T1_FIELD_STRING( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )
+
+#define T1_FIELD_KEY( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )
+
+#define T1_FIELD_BBOX( _ident, _fname, _dict ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )
+
+
+#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict ) \
+ T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
+ _fname, _fmax, _dict )
+
+#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict ) \
+ T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
+ _fname, _fmax, _dict )
+
+#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict ) \
+ T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
+ _fname, _fmax, _dict )
+
+#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict ) \
+ T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
+ _fname, _fmax, _dict )
+
+#define T1_FIELD_CALLBACK( _ident, _name, _dict ) \
+ T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** T1 PARSER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef const struct PS_Parser_FuncsRec_* PS_Parser_Funcs;
+
+ typedef struct PS_Parser_FuncsRec_
+ {
+ void
+ (*init)( PS_Parser parser,
+ FT_Byte* base,
+ FT_Byte* limit,
+ FT_Memory memory );
+
+ void
+ (*done)( PS_Parser parser );
+
+ void
+ (*skip_spaces)( PS_Parser parser );
+ void
+ (*skip_PS_token)( PS_Parser parser );
+
+ FT_Long
+ (*to_int)( PS_Parser parser );
+ FT_Fixed
+ (*to_fixed)( PS_Parser parser,
+ FT_Int power_ten );
+
+ FT_Error
+ (*to_bytes)( PS_Parser parser,
+ FT_Byte* bytes,
+ FT_Offset max_bytes,
+ FT_ULong* pnum_bytes,
+ FT_Bool delimiters );
+
+ FT_Int
+ (*to_coord_array)( PS_Parser parser,
+ FT_Int max_coords,
+ FT_Short* coords );
+ FT_Int
+ (*to_fixed_array)( PS_Parser parser,
+ FT_Int max_values,
+ FT_Fixed* values,
+ FT_Int power_ten );
+
+ void
+ (*to_token)( PS_Parser parser,
+ T1_Token token );
+ void
+ (*to_token_array)( PS_Parser parser,
+ T1_Token tokens,
+ FT_UInt max_tokens,
+ FT_Int* pnum_tokens );
+
+ FT_Error
+ (*load_field)( PS_Parser parser,
+ const T1_Field field,
+ void** objects,
+ FT_UInt max_objects,
+ FT_ULong* pflags );
+
+ FT_Error
+ (*load_field_table)( PS_Parser parser,
+ const T1_Field field,
+ void** objects,
+ FT_UInt max_objects,
+ FT_ULong* pflags );
+
+ } PS_Parser_FuncsRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_ParserRec */
+ /* */
+ /* <Description> */
+ /* A PS_Parser is an object used to parse a Type 1 font very quickly. */
+ /* */
+ /* <Fields> */
+ /* cursor :: The current position in the text. */
+ /* */
+ /* base :: Start of the processed text. */
+ /* */
+ /* limit :: End of the processed text. */
+ /* */
+ /* error :: The last error returned. */
+ /* */
+ /* memory :: The object used for memory operations (alloc/realloc). */
+ /* */
+ /* funcs :: A table of functions for the parser. */
+ /* */
+ typedef struct PS_ParserRec_
+ {
+ FT_Byte* cursor;
+ FT_Byte* base;
+ FT_Byte* limit;
+ FT_Error error;
+ FT_Memory memory;
+
+ PS_Parser_FuncsRec funcs;
+
+ } PS_ParserRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** T1 BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ typedef struct T1_BuilderRec_* T1_Builder;
+
+
+ typedef FT_Error
+ (*T1_Builder_Check_Points_Func)( T1_Builder builder,
+ FT_Int count );
+
+ typedef void
+ (*T1_Builder_Add_Point_Func)( T1_Builder builder,
+ FT_Pos x,
+ FT_Pos y,
+ FT_Byte flag );
+
+ typedef FT_Error
+ (*T1_Builder_Add_Point1_Func)( T1_Builder builder,
+ FT_Pos x,
+ FT_Pos y );
+
+ typedef FT_Error
+ (*T1_Builder_Add_Contour_Func)( T1_Builder builder );
+
+ typedef FT_Error
+ (*T1_Builder_Start_Point_Func)( T1_Builder builder,
+ FT_Pos x,
+ FT_Pos y );
+
+ typedef void
+ (*T1_Builder_Close_Contour_Func)( T1_Builder builder );
+
+
+ typedef const struct T1_Builder_FuncsRec_* T1_Builder_Funcs;
+
+ typedef struct T1_Builder_FuncsRec_
+ {
+ void
+ (*init)( T1_Builder builder,
+ FT_Face face,
+ FT_Size size,
+ FT_GlyphSlot slot,
+ FT_Bool hinting );
+
+ void
+ (*done)( T1_Builder builder );
+
+ T1_Builder_Check_Points_Func check_points;
+ T1_Builder_Add_Point_Func add_point;
+ T1_Builder_Add_Point1_Func add_point1;
+ T1_Builder_Add_Contour_Func add_contour;
+ T1_Builder_Start_Point_Func start_point;
+ T1_Builder_Close_Contour_Func close_contour;
+
+ } T1_Builder_FuncsRec;
+
+
+ /* an enumeration type to handle charstring parsing states */
+ typedef enum T1_ParseState_
+ {
+ T1_Parse_Start,
+ T1_Parse_Have_Width,
+ T1_Parse_Have_Moveto,
+ T1_Parse_Have_Path
+
+ } T1_ParseState;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Structure> */
+ /* T1_BuilderRec */
+ /* */
+ /* <Description> */
+ /* A structure used during glyph loading to store its outline. */
+ /* */
+ /* <Fields> */
+ /* memory :: The current memory object. */
+ /* */
+ /* face :: The current face object. */
+ /* */
+ /* glyph :: The current glyph slot. */
+ /* */
+ /* loader :: XXX */
+ /* */
+ /* base :: The base glyph outline. */
+ /* */
+ /* current :: The current glyph outline. */
+ /* */
+ /* max_points :: maximum points in builder outline */
+ /* */
+ /* max_contours :: Maximum number of contours in builder outline. */
+ /* */
+ /* pos_x :: The horizontal translation (if composite glyph). */
+ /* */
+ /* pos_y :: The vertical translation (if composite glyph). */
+ /* */
+ /* left_bearing :: The left side bearing point. */
+ /* */
+ /* advance :: The horizontal advance vector. */
+ /* */
+ /* bbox :: Unused. */
+ /* */
+ /* parse_state :: An enumeration which controls the charstring */
+ /* parsing state. */
+ /* */
+ /* load_points :: If this flag is not set, no points are loaded. */
+ /* */
+ /* no_recurse :: Set but not used. */
+ /* */
+ /* metrics_only :: A boolean indicating that we only want to compute */
+ /* the metrics of a given glyph, not load all of its */
+ /* points. */
+ /* */
+ /* funcs :: An array of function pointers for the builder. */
+ /* */
+ typedef struct T1_BuilderRec_
+ {
+ FT_Memory memory;
+ FT_Face face;
+ FT_GlyphSlot glyph;
+ FT_GlyphLoader loader;
+ FT_Outline* base;
+ FT_Outline* current;
+
+ FT_Pos pos_x;
+ FT_Pos pos_y;
+
+ FT_Vector left_bearing;
+ FT_Vector advance;
+
+ FT_BBox bbox; /* bounding box */
+ T1_ParseState parse_state;
+ FT_Bool load_points;
+ FT_Bool no_recurse;
+
+ FT_Bool metrics_only;
+
+ void* hints_funcs; /* hinter-specific */
+ void* hints_globals; /* hinter-specific */
+
+ T1_Builder_FuncsRec funcs;
+
+ } T1_BuilderRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** T1 DECODER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+#if 0
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
+ /* calls during glyph loading. */
+ /* */
+#define T1_MAX_SUBRS_CALLS 8
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
+ /* minimum of 16 is required. */
+ /* */
+#define T1_MAX_CHARSTRINGS_OPERANDS 32
+
+#endif /* 0 */
+
+
+ typedef struct T1_Decoder_ZoneRec_
+ {
+ FT_Byte* cursor;
+ FT_Byte* base;
+ FT_Byte* limit;
+
+ } T1_Decoder_ZoneRec, *T1_Decoder_Zone;
+
+
+ typedef struct T1_DecoderRec_* T1_Decoder;
+ typedef const struct T1_Decoder_FuncsRec_* T1_Decoder_Funcs;
+
+
+ typedef FT_Error
+ (*T1_Decoder_Callback)( T1_Decoder decoder,
+ FT_UInt glyph_index );
+
+
+ typedef struct T1_Decoder_FuncsRec_
+ {
+ FT_Error
+ (*init)( T1_Decoder decoder,
+ FT_Face face,
+ FT_Size size,
+ FT_GlyphSlot slot,
+ FT_Byte** glyph_names,
+ PS_Blend blend,
+ FT_Bool hinting,
+ FT_Render_Mode hint_mode,
+ T1_Decoder_Callback callback );
+
+ void
+ (*done)( T1_Decoder decoder );
+
+ FT_Error
+ (*parse_charstrings)( T1_Decoder decoder,
+ FT_Byte* base,
+ FT_UInt len );
+
+ } T1_Decoder_FuncsRec;
+
+
+ typedef struct T1_DecoderRec_
+ {
+ T1_BuilderRec builder;
+
+ FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
+ FT_Long* top;
+
+ T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1];
+ T1_Decoder_Zone zone;
+
+ FT_Service_PsCMaps psnames; /* for seac */
+ FT_UInt num_glyphs;
+ FT_Byte** glyph_names;
+
+ FT_Int lenIV; /* internal for sub routine calls */
+ FT_Int num_subrs;
+ FT_Byte** subrs;
+ FT_UInt* subrs_len; /* array of subrs length (optional) */
+
+ FT_Matrix font_matrix;
+ FT_Vector font_offset;
+
+ FT_Int flex_state;
+ FT_Int num_flex_vectors;
+ FT_Vector flex_vectors[7];
+
+ PS_Blend blend; /* for multiple master support */
+
+ FT_Render_Mode hint_mode;
+
+ T1_Decoder_Callback parse_callback;
+ T1_Decoder_FuncsRec funcs;
+
+ FT_Long* buildchar;
+ FT_UInt len_buildchar;
+
+ FT_Bool seac;
+
+ } T1_DecoderRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** AFM PARSER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef struct AFM_ParserRec_* AFM_Parser;
+
+ typedef struct AFM_Parser_FuncsRec_
+ {
+ FT_Error
+ (*init)( AFM_Parser parser,
+ FT_Memory memory,
+ FT_Byte* base,
+ FT_Byte* limit );
+
+ void
+ (*done)( AFM_Parser parser );
+
+ FT_Error
+ (*parse)( AFM_Parser parser );
+
+ } AFM_Parser_FuncsRec;
+
+
+ typedef struct AFM_StreamRec_* AFM_Stream;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* AFM_ParserRec */
+ /* */
+ /* <Description> */
+ /* An AFM_Parser is a parser for the AFM files. */
+ /* */
+ /* <Fields> */
+ /* memory :: The object used for memory operations (alloc and */
+ /* realloc). */
+ /* */
+ /* stream :: This is an opaque object. */
+ /* */
+ /* FontInfo :: The result will be stored here. */
+ /* */
+ /* get_index :: A user provided function to get a glyph index by its */
+ /* name. */
+ /* */
+ typedef struct AFM_ParserRec_
+ {
+ FT_Memory memory;
+ AFM_Stream stream;
+
+ AFM_FontInfo FontInfo;
+
+ FT_Int
+ (*get_index)( const char* name,
+ FT_Offset len,
+ void* user_data );
+
+ void* user_data;
+
+ } AFM_ParserRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** TYPE1 CHARMAPS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef const struct T1_CMap_ClassesRec_* T1_CMap_Classes;
+
+ typedef struct T1_CMap_ClassesRec_
+ {
+ FT_CMap_Class standard;
+ FT_CMap_Class expert;
+ FT_CMap_Class custom;
+ FT_CMap_Class unicode;
+
+ } T1_CMap_ClassesRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** PSAux Module Interface *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef struct PSAux_ServiceRec_
+ {
+ /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */
+ const PS_Table_FuncsRec* ps_table_funcs;
+ const PS_Parser_FuncsRec* ps_parser_funcs;
+ const T1_Builder_FuncsRec* t1_builder_funcs;
+ const T1_Decoder_FuncsRec* t1_decoder_funcs;
+
+ void
+ (*t1_decrypt)( FT_Byte* buffer,
+ FT_Offset length,
+ FT_UShort seed );
+
+ T1_CMap_Classes t1_cmap_classes;
+
+ /* fields after this comment line were added after version 2.1.10 */
+ const AFM_Parser_FuncsRec* afm_parser_funcs;
+
+ } PSAux_ServiceRec, *PSAux_Service;
+
+ /* backwards-compatible type definition */
+ typedef PSAux_ServiceRec PSAux_Interface;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** Some convenience functions *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+#define IS_PS_NEWLINE( ch ) \
+ ( (ch) == '\r' || \
+ (ch) == '\n' )
+
+#define IS_PS_SPACE( ch ) \
+ ( (ch) == ' ' || \
+ IS_PS_NEWLINE( ch ) || \
+ (ch) == '\t' || \
+ (ch) == '\f' || \
+ (ch) == '\0' )
+
+#define IS_PS_SPECIAL( ch ) \
+ ( (ch) == '/' || \
+ (ch) == '(' || (ch) == ')' || \
+ (ch) == '<' || (ch) == '>' || \
+ (ch) == '[' || (ch) == ']' || \
+ (ch) == '{' || (ch) == '}' || \
+ (ch) == '%' )
+
+#define IS_PS_DELIM( ch ) \
+ ( IS_PS_SPACE( ch ) || \
+ IS_PS_SPECIAL( ch ) )
+
+#define IS_PS_DIGIT( ch ) \
+ ( (ch) >= '0' && (ch) <= '9' )
+
+#define IS_PS_XDIGIT( ch ) \
+ ( IS_PS_DIGIT( ch ) || \
+ ( (ch) >= 'A' && (ch) <= 'F' ) || \
+ ( (ch) >= 'a' && (ch) <= 'f' ) )
+
+#define IS_PS_BASE85( ch ) \
+ ( (ch) >= '!' && (ch) <= 'u' )
+
+#define IS_PS_TOKEN( cur, limit, token ) \
+ ( (char)(cur)[0] == (token)[0] && \
+ ( (cur) + sizeof ( (token) ) == (limit) || \
+ ( (cur) + sizeof( (token) ) < (limit) && \
+ IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) ) && \
+ ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )
+
+
+FT_END_HEADER
+
+#endif /* __PSAUX_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/pshints.h b/src/3rdparty/freetype/include/freetype/internal/pshints.h
new file mode 100644
index 0000000000..12aaabacd4
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/pshints.h
@@ -0,0 +1,722 @@
+/***************************************************************************/
+/* */
+/* pshints.h */
+/* */
+/* Interface to Postscript-specific (Type 1 and Type 2) hints */
+/* recorders (specification only). These are used to support native */
+/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
+/* */
+/* Copyright 2001-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __PSHINTS_H__
+#define __PSHINTS_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_TYPE1_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** INTERNAL REPRESENTATION OF GLOBALS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef struct PSH_GlobalsRec_* PSH_Globals;
+
+ typedef FT_Error
+ (*PSH_Globals_NewFunc)( FT_Memory memory,
+ T1_Private* private_dict,
+ PSH_Globals* aglobals );
+
+ typedef void
+ (*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
+ FT_Fixed x_scale,
+ FT_Fixed y_scale,
+ FT_Fixed x_delta,
+ FT_Fixed y_delta );
+
+ typedef void
+ (*PSH_Globals_DestroyFunc)( PSH_Globals globals );
+
+
+ typedef struct PSH_Globals_FuncsRec_
+ {
+ PSH_Globals_NewFunc create;
+ PSH_Globals_SetScaleFunc set_scale;
+ PSH_Globals_DestroyFunc destroy;
+
+ } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** PUBLIC TYPE 1 HINTS RECORDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************
+ *
+ * @type:
+ * T1_Hints
+ *
+ * @description:
+ * This is a handle to an opaque structure used to record glyph hints
+ * from a Type 1 character glyph character string.
+ *
+ * The methods used to operate on this object are defined by the
+ * @T1_Hints_FuncsRec structure. Recording glyph hints is normally
+ * achieved through the following scheme:
+ *
+ * - Open a new hint recording session by calling the `open' method.
+ * This rewinds the recorder and prepare it for new input.
+ *
+ * - For each hint found in the glyph charstring, call the corresponding
+ * method (`stem', `stem3', or `reset'). Note that these functions do
+ * not return an error code.
+ *
+ * - Close the recording session by calling the `close' method. It
+ * returns an error code if the hints were invalid or something
+ * strange happened (e.g., memory shortage).
+ *
+ * The hints accumulated in the object can later be used by the
+ * PostScript hinter.
+ *
+ */
+ typedef struct T1_HintsRec_* T1_Hints;
+
+
+ /*************************************************************************
+ *
+ * @type:
+ * T1_Hints_Funcs
+ *
+ * @description:
+ * A pointer to the @T1_Hints_FuncsRec structure that defines the API of
+ * a given @T1_Hints object.
+ *
+ */
+ typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T1_Hints_OpenFunc
+ *
+ * @description:
+ * A method of the @T1_Hints class used to prepare it for a new Type 1
+ * hints recording session.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 1 hints recorder.
+ *
+ * @note:
+ * You should always call the @T1_Hints_CloseFunc method in order to
+ * close an opened recording session.
+ *
+ */
+ typedef void
+ (*T1_Hints_OpenFunc)( T1_Hints hints );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T1_Hints_SetStemFunc
+ *
+ * @description:
+ * A method of the @T1_Hints class used to record a new horizontal or
+ * vertical stem. This corresponds to the Type 1 `hstem' and `vstem'
+ * operators.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 1 hints recorder.
+ *
+ * dimension ::
+ * 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
+ *
+ * coords ::
+ * Array of 2 coordinates in 16.16 format, used as (position,length)
+ * stem descriptor.
+ *
+ * @note:
+ * Use vertical coordinates (y) for horizontal stems (dim=0). Use
+ * horizontal coordinates (x) for vertical stems (dim=1).
+ *
+ * `coords[0]' is the absolute stem position (lowest coordinate);
+ * `coords[1]' is the length.
+ *
+ * The length can be negative, in which case it must be either -20 or
+ * -21. It is interpreted as a `ghost' stem, according to the Type 1
+ * specification.
+ *
+ * If the length is -21 (corresponding to a bottom ghost stem), then
+ * the real stem position is `coords[0]+coords[1]'.
+ *
+ */
+ typedef void
+ (*T1_Hints_SetStemFunc)( T1_Hints hints,
+ FT_UInt dimension,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T1_Hints_SetStem3Func
+ *
+ * @description:
+ * A method of the @T1_Hints class used to record three
+ * counter-controlled horizontal or vertical stems at once.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 1 hints recorder.
+ *
+ * dimension ::
+ * 0 for horizontal stems, 1 for vertical ones.
+ *
+ * coords ::
+ * An array of 6 values in 16.16 format, holding 3 (position,length)
+ * pairs for the counter-controlled stems.
+ *
+ * @note:
+ * Use vertical coordinates (y) for horizontal stems (dim=0). Use
+ * horizontal coordinates (x) for vertical stems (dim=1).
+ *
+ * The lengths cannot be negative (ghost stems are never
+ * counter-controlled).
+ *
+ */
+ typedef void
+ (*T1_Hints_SetStem3Func)( T1_Hints hints,
+ FT_UInt dimension,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T1_Hints_ResetFunc
+ *
+ * @description:
+ * A method of the @T1_Hints class used to reset the stems hints in a
+ * recording session.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 1 hints recorder.
+ *
+ * end_point ::
+ * The index of the last point in the input glyph in which the
+ * previously defined hints apply.
+ *
+ */
+ typedef void
+ (*T1_Hints_ResetFunc)( T1_Hints hints,
+ FT_UInt end_point );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T1_Hints_CloseFunc
+ *
+ * @description:
+ * A method of the @T1_Hints class used to close a hint recording
+ * session.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 1 hints recorder.
+ *
+ * end_point ::
+ * The index of the last point in the input glyph.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @note:
+ * The error code is set to indicate that an error occurred during the
+ * recording session.
+ *
+ */
+ typedef FT_Error
+ (*T1_Hints_CloseFunc)( T1_Hints hints,
+ FT_UInt end_point );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T1_Hints_ApplyFunc
+ *
+ * @description:
+ * A method of the @T1_Hints class used to apply hints to the
+ * corresponding glyph outline. Must be called once all hints have been
+ * recorded.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 1 hints recorder.
+ *
+ * outline ::
+ * A pointer to the target outline descriptor.
+ *
+ * globals ::
+ * The hinter globals for this font.
+ *
+ * hint_mode ::
+ * Hinting information.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @note:
+ * On input, all points within the outline are in font coordinates. On
+ * output, they are in 1/64th of pixels.
+ *
+ * The scaling transformation is taken from the `globals' object which
+ * must correspond to the same font as the glyph.
+ *
+ */
+ typedef FT_Error
+ (*T1_Hints_ApplyFunc)( T1_Hints hints,
+ FT_Outline* outline,
+ PSH_Globals globals,
+ FT_Render_Mode hint_mode );
+
+
+ /*************************************************************************
+ *
+ * @struct:
+ * T1_Hints_FuncsRec
+ *
+ * @description:
+ * The structure used to provide the API to @T1_Hints objects.
+ *
+ * @fields:
+ * hints ::
+ * A handle to the T1 Hints recorder.
+ *
+ * open ::
+ * The function to open a recording session.
+ *
+ * close ::
+ * The function to close a recording session.
+ *
+ * stem ::
+ * The function to set a simple stem.
+ *
+ * stem3 ::
+ * The function to set counter-controlled stems.
+ *
+ * reset ::
+ * The function to reset stem hints.
+ *
+ * apply ::
+ * The function to apply the hints to the corresponding glyph outline.
+ *
+ */
+ typedef struct T1_Hints_FuncsRec_
+ {
+ T1_Hints hints;
+ T1_Hints_OpenFunc open;
+ T1_Hints_CloseFunc close;
+ T1_Hints_SetStemFunc stem;
+ T1_Hints_SetStem3Func stem3;
+ T1_Hints_ResetFunc reset;
+ T1_Hints_ApplyFunc apply;
+
+ } T1_Hints_FuncsRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** PUBLIC TYPE 2 HINTS RECORDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************
+ *
+ * @type:
+ * T2_Hints
+ *
+ * @description:
+ * This is a handle to an opaque structure used to record glyph hints
+ * from a Type 2 character glyph character string.
+ *
+ * The methods used to operate on this object are defined by the
+ * @T2_Hints_FuncsRec structure. Recording glyph hints is normally
+ * achieved through the following scheme:
+ *
+ * - Open a new hint recording session by calling the `open' method.
+ * This rewinds the recorder and prepare it for new input.
+ *
+ * - For each hint found in the glyph charstring, call the corresponding
+ * method (`stems', `hintmask', `counters'). Note that these
+ * functions do not return an error code.
+ *
+ * - Close the recording session by calling the `close' method. It
+ * returns an error code if the hints were invalid or something
+ * strange happened (e.g., memory shortage).
+ *
+ * The hints accumulated in the object can later be used by the
+ * Postscript hinter.
+ *
+ */
+ typedef struct T2_HintsRec_* T2_Hints;
+
+
+ /*************************************************************************
+ *
+ * @type:
+ * T2_Hints_Funcs
+ *
+ * @description:
+ * A pointer to the @T2_Hints_FuncsRec structure that defines the API of
+ * a given @T2_Hints object.
+ *
+ */
+ typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T2_Hints_OpenFunc
+ *
+ * @description:
+ * A method of the @T2_Hints class used to prepare it for a new Type 2
+ * hints recording session.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 2 hints recorder.
+ *
+ * @note:
+ * You should always call the @T2_Hints_CloseFunc method in order to
+ * close an opened recording session.
+ *
+ */
+ typedef void
+ (*T2_Hints_OpenFunc)( T2_Hints hints );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T2_Hints_StemsFunc
+ *
+ * @description:
+ * A method of the @T2_Hints class used to set the table of stems in
+ * either the vertical or horizontal dimension. Equivalent to the
+ * `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 2 hints recorder.
+ *
+ * dimension ::
+ * 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
+ *
+ * count ::
+ * The number of stems.
+ *
+ * coords ::
+ * An array of `count' (position,length) pairs in 16.16 format.
+ *
+ * @note:
+ * Use vertical coordinates (y) for horizontal stems (dim=0). Use
+ * horizontal coordinates (x) for vertical stems (dim=1).
+ *
+ * There are `2*count' elements in the `coords' array. Each even
+ * element is an absolute position in font units, each odd element is a
+ * length in font units.
+ *
+ * A length can be negative, in which case it must be either -20 or
+ * -21. It is interpreted as a `ghost' stem, according to the Type 1
+ * specification.
+ *
+ */
+ typedef void
+ (*T2_Hints_StemsFunc)( T2_Hints hints,
+ FT_UInt dimension,
+ FT_Int count,
+ FT_Fixed* coordinates );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T2_Hints_MaskFunc
+ *
+ * @description:
+ * A method of the @T2_Hints class used to set a given hintmask (this
+ * corresponds to the `hintmask' Type 2 operator).
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 2 hints recorder.
+ *
+ * end_point ::
+ * The glyph index of the last point to which the previously defined
+ * or activated hints apply.
+ *
+ * bit_count ::
+ * The number of bits in the hint mask.
+ *
+ * bytes ::
+ * An array of bytes modelling the hint mask.
+ *
+ * @note:
+ * If the hintmask starts the charstring (before any glyph point
+ * definition), the value of `end_point' should be 0.
+ *
+ * `bit_count' is the number of meaningful bits in the `bytes' array; it
+ * must be equal to the total number of hints defined so far (i.e.,
+ * horizontal+verticals).
+ *
+ * The `bytes' array can come directly from the Type 2 charstring and
+ * respects the same format.
+ *
+ */
+ typedef void
+ (*T2_Hints_MaskFunc)( T2_Hints hints,
+ FT_UInt end_point,
+ FT_UInt bit_count,
+ const FT_Byte* bytes );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T2_Hints_CounterFunc
+ *
+ * @description:
+ * A method of the @T2_Hints class used to set a given counter mask
+ * (this corresponds to the `hintmask' Type 2 operator).
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 2 hints recorder.
+ *
+ * end_point ::
+ * A glyph index of the last point to which the previously defined or
+ * active hints apply.
+ *
+ * bit_count ::
+ * The number of bits in the hint mask.
+ *
+ * bytes ::
+ * An array of bytes modelling the hint mask.
+ *
+ * @note:
+ * If the hintmask starts the charstring (before any glyph point
+ * definition), the value of `end_point' should be 0.
+ *
+ * `bit_count' is the number of meaningful bits in the `bytes' array; it
+ * must be equal to the total number of hints defined so far (i.e.,
+ * horizontal+verticals).
+ *
+ * The `bytes' array can come directly from the Type 2 charstring and
+ * respects the same format.
+ *
+ */
+ typedef void
+ (*T2_Hints_CounterFunc)( T2_Hints hints,
+ FT_UInt bit_count,
+ const FT_Byte* bytes );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T2_Hints_CloseFunc
+ *
+ * @description:
+ * A method of the @T2_Hints class used to close a hint recording
+ * session.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 2 hints recorder.
+ *
+ * end_point ::
+ * The index of the last point in the input glyph.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @note:
+ * The error code is set to indicate that an error occurred during the
+ * recording session.
+ *
+ */
+ typedef FT_Error
+ (*T2_Hints_CloseFunc)( T2_Hints hints,
+ FT_UInt end_point );
+
+
+ /*************************************************************************
+ *
+ * @functype:
+ * T2_Hints_ApplyFunc
+ *
+ * @description:
+ * A method of the @T2_Hints class used to apply hints to the
+ * corresponding glyph outline. Must be called after the `close'
+ * method.
+ *
+ * @input:
+ * hints ::
+ * A handle to the Type 2 hints recorder.
+ *
+ * outline ::
+ * A pointer to the target outline descriptor.
+ *
+ * globals ::
+ * The hinter globals for this font.
+ *
+ * hint_mode ::
+ * Hinting information.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @note:
+ * On input, all points within the outline are in font coordinates. On
+ * output, they are in 1/64th of pixels.
+ *
+ * The scaling transformation is taken from the `globals' object which
+ * must correspond to the same font than the glyph.
+ *
+ */
+ typedef FT_Error
+ (*T2_Hints_ApplyFunc)( T2_Hints hints,
+ FT_Outline* outline,
+ PSH_Globals globals,
+ FT_Render_Mode hint_mode );
+
+
+ /*************************************************************************
+ *
+ * @struct:
+ * T2_Hints_FuncsRec
+ *
+ * @description:
+ * The structure used to provide the API to @T2_Hints objects.
+ *
+ * @fields:
+ * hints ::
+ * A handle to the T2 hints recorder object.
+ *
+ * open ::
+ * The function to open a recording session.
+ *
+ * close ::
+ * The function to close a recording session.
+ *
+ * stems ::
+ * The function to set the dimension's stems table.
+ *
+ * hintmask ::
+ * The function to set hint masks.
+ *
+ * counter ::
+ * The function to set counter masks.
+ *
+ * apply ::
+ * The function to apply the hints on the corresponding glyph outline.
+ *
+ */
+ typedef struct T2_Hints_FuncsRec_
+ {
+ T2_Hints hints;
+ T2_Hints_OpenFunc open;
+ T2_Hints_CloseFunc close;
+ T2_Hints_StemsFunc stems;
+ T2_Hints_MaskFunc hintmask;
+ T2_Hints_CounterFunc counter;
+ T2_Hints_ApplyFunc apply;
+
+ } T2_Hints_FuncsRec;
+
+
+ /* */
+
+
+ typedef struct PSHinter_Interface_
+ {
+ PSH_Globals_Funcs (*get_globals_funcs)( FT_Module module );
+ T1_Hints_Funcs (*get_t1_funcs) ( FT_Module module );
+ T2_Hints_Funcs (*get_t2_funcs) ( FT_Module module );
+
+ } PSHinter_Interface;
+
+ typedef PSHinter_Interface* PSHinter_Service;
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_PSHINTER_INTERFACE( \
+ class_, \
+ get_globals_funcs_, \
+ get_t1_funcs_, \
+ get_t2_funcs_ ) \
+ static const PSHinter_Interface class_ = \
+ { \
+ get_globals_funcs_, \
+ get_t1_funcs_, \
+ get_t2_funcs_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_PSHINTER_INTERFACE( \
+ class_, \
+ get_globals_funcs_, \
+ get_t1_funcs_, \
+ get_t2_funcs_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ PSHinter_Interface* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->get_globals_funcs = get_globals_funcs_; \
+ clazz->get_t1_funcs = get_t1_funcs_; \
+ clazz->get_t2_funcs = get_t2_funcs_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+FT_END_HEADER
+
+#endif /* __PSHINTS_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h b/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h
new file mode 100644
index 0000000000..865b53687d
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h
@@ -0,0 +1,82 @@
+/***************************************************************************/
+/* */
+/* svbdf.h */
+/* */
+/* The FreeType BDF services (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVBDF_H__
+#define __SVBDF_H__
+
+#include FT_BDF_H
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_BDF "bdf"
+
+ typedef FT_Error
+ (*FT_BDF_GetCharsetIdFunc)( FT_Face face,
+ const char* *acharset_encoding,
+ const char* *acharset_registry );
+
+ typedef FT_Error
+ (*FT_BDF_GetPropertyFunc)( FT_Face face,
+ const char* prop_name,
+ BDF_PropertyRec *aproperty );
+
+
+ FT_DEFINE_SERVICE( BDF )
+ {
+ FT_BDF_GetCharsetIdFunc get_charset_id;
+ FT_BDF_GetPropertyFunc get_property;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_BDFRec( class_, \
+ get_charset_id_, \
+ get_property_ ) \
+ static const FT_Service_BDFRec class_ = \
+ { \
+ get_charset_id_, get_property_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_BDFRec( class_, \
+ get_charset_id_, \
+ get_property_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \
+ { \
+ clazz->get_charset_id = get_charset_id_; \
+ clazz->get_property = get_property_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVBDF_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svcid.h b/src/3rdparty/freetype/include/freetype/internal/services/svcid.h
new file mode 100644
index 0000000000..4a535a6f42
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svcid.h
@@ -0,0 +1,90 @@
+/***************************************************************************/
+/* */
+/* svcid.h */
+/* */
+/* The FreeType CID font services (specification). */
+/* */
+/* Copyright 2007-2015 by */
+/* Derek Clegg and Michael Toftdal. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVCID_H__
+#define __SVCID_H__
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_CID "CID"
+
+ typedef FT_Error
+ (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face,
+ const char* *registry,
+ const char* *ordering,
+ FT_Int *supplement );
+ typedef FT_Error
+ (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
+ FT_Bool *is_cid );
+ typedef FT_Error
+ (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt *cid );
+
+ FT_DEFINE_SERVICE( CID )
+ {
+ FT_CID_GetRegistryOrderingSupplementFunc get_ros;
+ FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
+ FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_CIDREC( class_, \
+ get_ros_, \
+ get_is_cid_, \
+ get_cid_from_glyph_index_ ) \
+ static const FT_Service_CIDRec class_ = \
+ { \
+ get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_CIDREC( class_, \
+ get_ros_, \
+ get_is_cid_, \
+ get_cid_from_glyph_index_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_Service_CIDRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->get_ros = get_ros_; \
+ clazz->get_is_cid = get_is_cid_; \
+ clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVCID_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h b/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h
new file mode 100644
index 0000000000..f8b3617364
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h
@@ -0,0 +1,55 @@
+/***************************************************************************/
+/* */
+/* svfntfmt.h */
+/* */
+/* The FreeType font format service (specification only). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVFNTFMT_H__
+#define __SVFNTFMT_H__
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * A trivial service used to return the name of a face's font driver,
+ * according to the XFree86 nomenclature. Note that the service data
+ * is a simple constant string pointer.
+ */
+
+#define FT_SERVICE_ID_FONT_FORMAT "font-format"
+
+#define FT_FONT_FORMAT_TRUETYPE "TrueType"
+#define FT_FONT_FORMAT_TYPE_1 "Type 1"
+#define FT_FONT_FORMAT_BDF "BDF"
+#define FT_FONT_FORMAT_PCF "PCF"
+#define FT_FONT_FORMAT_TYPE_42 "Type 42"
+#define FT_FONT_FORMAT_CID "CID Type 1"
+#define FT_FONT_FORMAT_CFF "CFF"
+#define FT_FONT_FORMAT_PFR "PFR"
+#define FT_FONT_FORMAT_WINFNT "Windows FNT"
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVFNTFMT_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h b/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h
new file mode 100644
index 0000000000..f78bca5d77
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h
@@ -0,0 +1,88 @@
+/***************************************************************************/
+/* */
+/* svgldict.h */
+/* */
+/* The FreeType glyph dictionary services (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVGLDICT_H__
+#define __SVGLDICT_H__
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * A service used to retrieve glyph names, as well as to find the
+ * index of a given glyph name in a font.
+ *
+ */
+
+#define FT_SERVICE_ID_GLYPH_DICT "glyph-dict"
+
+
+ typedef FT_Error
+ (*FT_GlyphDict_GetNameFunc)( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+ typedef FT_UInt
+ (*FT_GlyphDict_NameIndexFunc)( FT_Face face,
+ FT_String* glyph_name );
+
+
+ FT_DEFINE_SERVICE( GlyphDict )
+ {
+ FT_GlyphDict_GetNameFunc get_name;
+ FT_GlyphDict_NameIndexFunc name_index; /* optional */
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
+ get_name_, \
+ name_index_) \
+ static const FT_Service_GlyphDictRec class_ = \
+ { \
+ get_name_, name_index_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
+ get_name_, \
+ name_index_) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_Service_GlyphDictRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->get_name = get_name_; \
+ clazz->name_index = name_index_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVGLDICT_H__ */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h b/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h
new file mode 100644
index 0000000000..59cc3b7048
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h
@@ -0,0 +1,72 @@
+/***************************************************************************/
+/* */
+/* svgxval.h */
+/* */
+/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* Masatake YAMATO, Red Hat K.K., */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+/***************************************************************************/
+/* */
+/* gxvalid is derived from both gxlayout module and otvalid module. */
+/* Development of gxlayout is supported by the Information-technology */
+/* Promotion Agency(IPA), Japan. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVGXVAL_H__
+#define __SVGXVAL_H__
+
+#include FT_GX_VALIDATE_H
+#include FT_INTERNAL_VALIDATE_H
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
+#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
+
+ typedef FT_Error
+ (*gxv_validate_func)( FT_Face face,
+ FT_UInt gx_flags,
+ FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
+ FT_UInt table_length );
+
+
+ typedef FT_Error
+ (*ckern_validate_func)( FT_Face face,
+ FT_UInt ckern_flags,
+ FT_Bytes *ckern_table );
+
+
+ FT_DEFINE_SERVICE( GXvalidate )
+ {
+ gxv_validate_func validate;
+ };
+
+ FT_DEFINE_SERVICE( CKERNvalidate )
+ {
+ ckern_validate_func validate;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVGXVAL_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svkern.h b/src/3rdparty/freetype/include/freetype/internal/services/svkern.h
new file mode 100644
index 0000000000..bc26f15941
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svkern.h
@@ -0,0 +1,51 @@
+/***************************************************************************/
+/* */
+/* svkern.h */
+/* */
+/* The FreeType Kerning service (specification). */
+/* */
+/* Copyright 2006-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVKERN_H__
+#define __SVKERN_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_TRUETYPE_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+#define FT_SERVICE_ID_KERNING "kerning"
+
+
+ typedef FT_Error
+ (*FT_Kerning_TrackGetFunc)( FT_Face face,
+ FT_Fixed point_size,
+ FT_Int degree,
+ FT_Fixed* akerning );
+
+ FT_DEFINE_SERVICE( Kerning )
+ {
+ FT_Kerning_TrackGetFunc get_track;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVKERN_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svmm.h b/src/3rdparty/freetype/include/freetype/internal/services/svmm.h
new file mode 100644
index 0000000000..f2cecfbb3b
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svmm.h
@@ -0,0 +1,113 @@
+/***************************************************************************/
+/* */
+/* svmm.h */
+/* */
+/* The FreeType Multiple Masters and GX var services (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVMM_H__
+#define __SVMM_H__
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * A service used to manage multiple-masters data in a given face.
+ *
+ * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
+ *
+ */
+
+#define FT_SERVICE_ID_MULTI_MASTERS "multi-masters"
+
+
+ typedef FT_Error
+ (*FT_Get_MM_Func)( FT_Face face,
+ FT_Multi_Master* master );
+
+ typedef FT_Error
+ (*FT_Get_MM_Var_Func)( FT_Face face,
+ FT_MM_Var* *master );
+
+ typedef FT_Error
+ (*FT_Set_MM_Design_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+ typedef FT_Error
+ (*FT_Set_Var_Design_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ typedef FT_Error
+ (*FT_Set_MM_Blend_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+
+ FT_DEFINE_SERVICE( MultiMasters )
+ {
+ FT_Get_MM_Func get_mm;
+ FT_Set_MM_Design_Func set_mm_design;
+ FT_Set_MM_Blend_Func set_mm_blend;
+ FT_Get_MM_Var_Func get_mm_var;
+ FT_Set_Var_Design_Func set_var_design;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_ ) \
+ static const FT_Service_MultiMastersRec class_ = \
+ { \
+ get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
+ { \
+ clazz->get_mm = get_mm_; \
+ clazz->set_mm_design = set_mm_design_; \
+ clazz->set_mm_blend = set_mm_blend_; \
+ clazz->get_mm_var = get_mm_var_; \
+ clazz->set_var_design = set_var_design_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __SVMM_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svotval.h b/src/3rdparty/freetype/include/freetype/internal/services/svotval.h
new file mode 100644
index 0000000000..a82a6420fd
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svotval.h
@@ -0,0 +1,55 @@
+/***************************************************************************/
+/* */
+/* svotval.h */
+/* */
+/* The FreeType OpenType validation service (specification). */
+/* */
+/* Copyright 2004-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVOTVAL_H__
+#define __SVOTVAL_H__
+
+#include FT_OPENTYPE_VALIDATE_H
+#include FT_INTERNAL_VALIDATE_H
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate"
+
+
+ typedef FT_Error
+ (*otv_validate_func)( FT_Face volatile face,
+ FT_UInt ot_flags,
+ FT_Bytes *base,
+ FT_Bytes *gdef,
+ FT_Bytes *gpos,
+ FT_Bytes *gsub,
+ FT_Bytes *jstf );
+
+
+ FT_DEFINE_SERVICE( OTvalidate )
+ {
+ otv_validate_func validate;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVOTVAL_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h b/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h
new file mode 100644
index 0000000000..d4eb1693d0
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h
@@ -0,0 +1,66 @@
+/***************************************************************************/
+/* */
+/* svpfr.h */
+/* */
+/* Internal PFR service functions (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVPFR_H__
+#define __SVPFR_H__
+
+#include FT_PFR_H
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_PFR_METRICS "pfr-metrics"
+
+
+ typedef FT_Error
+ (*FT_PFR_GetMetricsFunc)( FT_Face face,
+ FT_UInt *aoutline,
+ FT_UInt *ametrics,
+ FT_Fixed *ax_scale,
+ FT_Fixed *ay_scale );
+
+ typedef FT_Error
+ (*FT_PFR_GetKerningFunc)( FT_Face face,
+ FT_UInt left,
+ FT_UInt right,
+ FT_Vector *avector );
+
+ typedef FT_Error
+ (*FT_PFR_GetAdvanceFunc)( FT_Face face,
+ FT_UInt gindex,
+ FT_Pos *aadvance );
+
+
+ FT_DEFINE_SERVICE( PfrMetrics )
+ {
+ FT_PFR_GetMetricsFunc get_metrics;
+ FT_PFR_GetKerningFunc get_kerning;
+ FT_PFR_GetAdvanceFunc get_advance;
+
+ };
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __SVPFR_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h b/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h
new file mode 100644
index 0000000000..a89f79e479
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h
@@ -0,0 +1,81 @@
+/***************************************************************************/
+/* */
+/* svpostnm.h */
+/* */
+/* The FreeType PostScript name services (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVPOSTNM_H__
+#define __SVPOSTNM_H__
+
+#include FT_INTERNAL_SERVICE_H
+
+
+FT_BEGIN_HEADER
+
+ /*
+ * A trivial service used to retrieve the PostScript name of a given
+ * font when available. The `get_name' field should never be NULL.
+ *
+ * The corresponding function can return NULL to indicate that the
+ * PostScript name is not available.
+ *
+ * The name is owned by the face and will be destroyed with it.
+ */
+
+#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
+
+
+ typedef const char*
+ (*FT_PsName_GetFunc)( FT_Face face );
+
+
+ FT_DEFINE_SERVICE( PsFontName )
+ {
+ FT_PsName_GetFunc get_ps_font_name;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
+ static const FT_Service_PsFontNameRec class_ = \
+ { \
+ get_ps_font_name_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_Service_PsFontNameRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->get_ps_font_name = get_ps_font_name_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPOSTNM_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svprop.h b/src/3rdparty/freetype/include/freetype/internal/services/svprop.h
new file mode 100644
index 0000000000..c9f07ce33a
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svprop.h
@@ -0,0 +1,81 @@
+/***************************************************************************/
+/* */
+/* svprop.h */
+/* */
+/* The FreeType property service (specification). */
+/* */
+/* Copyright 2012-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVPROP_H__
+#define __SVPROP_H__
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_PROPERTIES "properties"
+
+
+ typedef FT_Error
+ (*FT_Properties_SetFunc)( FT_Module module,
+ const char* property_name,
+ const void* value );
+
+ typedef FT_Error
+ (*FT_Properties_GetFunc)( FT_Module module,
+ const char* property_name,
+ void* value );
+
+
+ FT_DEFINE_SERVICE( Properties )
+ {
+ FT_Properties_SetFunc set_property;
+ FT_Properties_GetFunc get_property;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
+ set_property_, \
+ get_property_ ) \
+ static const FT_Service_PropertiesRec class_ = \
+ { \
+ set_property_, \
+ get_property_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
+ set_property_, \
+ get_property_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \
+ { \
+ clazz->set_property = set_property_; \
+ clazz->get_property = get_property_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPROP_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h b/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h
new file mode 100644
index 0000000000..66da6e1043
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h
@@ -0,0 +1,177 @@
+/***************************************************************************/
+/* */
+/* svpscmap.h */
+/* */
+/* The FreeType PostScript charmap service (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVPSCMAP_H__
+#define __SVPSCMAP_H__
+
+#include FT_INTERNAL_OBJECTS_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
+
+
+ /*
+ * Adobe glyph name to unicode value.
+ */
+ typedef FT_UInt32
+ (*PS_Unicode_ValueFunc)( const char* glyph_name );
+
+ /*
+ * Macintosh name id to glyph name. NULL if invalid index.
+ */
+ typedef const char*
+ (*PS_Macintosh_NameFunc)( FT_UInt name_index );
+
+ /*
+ * Adobe standard string ID to glyph name. NULL if invalid index.
+ */
+ typedef const char*
+ (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
+
+
+ /*
+ * Simple unicode -> glyph index charmap built from font glyph names
+ * table.
+ */
+ typedef struct PS_UniMap_
+ {
+ FT_UInt32 unicode; /* bit 31 set: is glyph variant */
+ FT_UInt glyph_index;
+
+ } PS_UniMap;
+
+
+ typedef struct PS_UnicodesRec_* PS_Unicodes;
+
+ typedef struct PS_UnicodesRec_
+ {
+ FT_CMapRec cmap;
+ FT_UInt num_maps;
+ PS_UniMap* maps;
+
+ } PS_UnicodesRec;
+
+
+ /*
+ * A function which returns a glyph name for a given index. Returns
+ * NULL if invalid index.
+ */
+ typedef const char*
+ (*PS_GetGlyphNameFunc)( FT_Pointer data,
+ FT_UInt string_index );
+
+ /*
+ * A function used to release the glyph name returned by
+ * PS_GetGlyphNameFunc, when needed
+ */
+ typedef void
+ (*PS_FreeGlyphNameFunc)( FT_Pointer data,
+ const char* name );
+
+ typedef FT_Error
+ (*PS_Unicodes_InitFunc)( FT_Memory memory,
+ PS_Unicodes unicodes,
+ FT_UInt num_glyphs,
+ PS_GetGlyphNameFunc get_glyph_name,
+ PS_FreeGlyphNameFunc free_glyph_name,
+ FT_Pointer glyph_data );
+
+ typedef FT_UInt
+ (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
+ FT_UInt32 unicode );
+
+ typedef FT_UInt32
+ (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
+ FT_UInt32 *unicode );
+
+
+ FT_DEFINE_SERVICE( PsCMaps )
+ {
+ PS_Unicode_ValueFunc unicode_value;
+
+ PS_Unicodes_InitFunc unicodes_init;
+ PS_Unicodes_CharIndexFunc unicodes_char_index;
+ PS_Unicodes_CharNextFunc unicodes_char_next;
+
+ PS_Macintosh_NameFunc macintosh_name;
+ PS_Adobe_Std_StringsFunc adobe_std_strings;
+ const unsigned short* adobe_std_encoding;
+ const unsigned short* adobe_expert_encoding;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
+ unicode_value_, \
+ unicodes_init_, \
+ unicodes_char_index_, \
+ unicodes_char_next_, \
+ macintosh_name_, \
+ adobe_std_strings_, \
+ adobe_std_encoding_, \
+ adobe_expert_encoding_ ) \
+ static const FT_Service_PsCMapsRec class_ = \
+ { \
+ unicode_value_, unicodes_init_, \
+ unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
+ adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
+ unicode_value_, \
+ unicodes_init_, \
+ unicodes_char_index_, \
+ unicodes_char_next_, \
+ macintosh_name_, \
+ adobe_std_strings_, \
+ adobe_std_encoding_, \
+ adobe_expert_encoding_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_Service_PsCMapsRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->unicode_value = unicode_value_; \
+ clazz->unicodes_init = unicodes_init_; \
+ clazz->unicodes_char_index = unicodes_char_index_; \
+ clazz->unicodes_char_next = unicodes_char_next_; \
+ clazz->macintosh_name = macintosh_name_; \
+ clazz->adobe_std_strings = adobe_std_strings_; \
+ clazz->adobe_std_encoding = adobe_std_encoding_; \
+ clazz->adobe_expert_encoding = adobe_expert_encoding_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPSCMAP_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h b/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h
new file mode 100644
index 0000000000..752a266025
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h
@@ -0,0 +1,111 @@
+/***************************************************************************/
+/* */
+/* svpsinfo.h */
+/* */
+/* The FreeType PostScript info service (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVPSINFO_H__
+#define __SVPSINFO_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info"
+
+
+ typedef FT_Error
+ (*PS_GetFontInfoFunc)( FT_Face face,
+ PS_FontInfoRec* afont_info );
+
+ typedef FT_Error
+ (*PS_GetFontExtraFunc)( FT_Face face,
+ PS_FontExtraRec* afont_extra );
+
+ typedef FT_Int
+ (*PS_HasGlyphNamesFunc)( FT_Face face );
+
+ typedef FT_Error
+ (*PS_GetFontPrivateFunc)( FT_Face face,
+ PS_PrivateRec* afont_private );
+
+ typedef FT_Long
+ (*PS_GetFontValueFunc)( FT_Face face,
+ PS_Dict_Keys key,
+ FT_UInt idx,
+ void *value,
+ FT_Long value_len );
+
+
+ FT_DEFINE_SERVICE( PsInfo )
+ {
+ PS_GetFontInfoFunc ps_get_font_info;
+ PS_GetFontExtraFunc ps_get_font_extra;
+ PS_HasGlyphNamesFunc ps_has_glyph_names;
+ PS_GetFontPrivateFunc ps_get_font_private;
+ PS_GetFontValueFunc ps_get_font_value;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
+ get_font_info_, \
+ ps_get_font_extra_, \
+ has_glyph_names_, \
+ get_font_private_, \
+ get_font_value_ ) \
+ static const FT_Service_PsInfoRec class_ = \
+ { \
+ get_font_info_, ps_get_font_extra_, has_glyph_names_, \
+ get_font_private_, get_font_value_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
+ get_font_info_, \
+ ps_get_font_extra_, \
+ has_glyph_names_, \
+ get_font_private_, \
+ get_font_value_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_Service_PsInfoRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->ps_get_font_info = get_font_info_; \
+ clazz->ps_get_font_extra = ps_get_font_extra_; \
+ clazz->ps_has_glyph_names = has_glyph_names_; \
+ clazz->ps_get_font_private = get_font_private_; \
+ clazz->ps_get_font_value = get_font_value_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPSINFO_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h b/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h
new file mode 100644
index 0000000000..252ae1cf5e
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h
@@ -0,0 +1,103 @@
+/***************************************************************************/
+/* */
+/* svsfnt.h */
+/* */
+/* The FreeType SFNT table loading service (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVSFNT_H__
+#define __SVSFNT_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_TRUETYPE_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * SFNT table loading service.
+ */
+
+#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table"
+
+
+ /*
+ * Used to implement FT_Load_Sfnt_Table().
+ */
+ typedef FT_Error
+ (*FT_SFNT_TableLoadFunc)( FT_Face face,
+ FT_ULong tag,
+ FT_Long offset,
+ FT_Byte* buffer,
+ FT_ULong* length );
+
+ /*
+ * Used to implement FT_Get_Sfnt_Table().
+ */
+ typedef void*
+ (*FT_SFNT_TableGetFunc)( FT_Face face,
+ FT_Sfnt_Tag tag );
+
+
+ /*
+ * Used to implement FT_Sfnt_Table_Info().
+ */
+ typedef FT_Error
+ (*FT_SFNT_TableInfoFunc)( FT_Face face,
+ FT_UInt idx,
+ FT_ULong *tag,
+ FT_ULong *offset,
+ FT_ULong *length );
+
+
+ FT_DEFINE_SERVICE( SFNT_Table )
+ {
+ FT_SFNT_TableLoadFunc load_table;
+ FT_SFNT_TableGetFunc get_table;
+ FT_SFNT_TableInfoFunc table_info;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
+ static const FT_Service_SFNT_TableRec class_ = \
+ { \
+ load_, get_, info_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec* clazz ) \
+ { \
+ clazz->load_table = load_; \
+ clazz->get_table = get_; \
+ clazz->table_info = info_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVSFNT_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h b/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h
new file mode 100644
index 0000000000..cd95b9ab81
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h
@@ -0,0 +1,106 @@
+/***************************************************************************/
+/* */
+/* svttcmap.h */
+/* */
+/* The FreeType TrueType/sfnt cmap extra information service. */
+/* */
+/* Copyright 2003-2015 by */
+/* Masatake YAMATO, Redhat K.K., */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+/* Development of this service is support of
+ Information-technology Promotion Agency, Japan. */
+
+#ifndef __SVTTCMAP_H__
+#define __SVTTCMAP_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_TRUETYPE_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_CMapInfo */
+ /* */
+ /* <Description> */
+ /* A structure used to store TrueType/sfnt specific cmap information */
+ /* which is not covered by the generic @FT_CharMap structure. This */
+ /* structure can be accessed with the @FT_Get_TT_CMap_Info function. */
+ /* */
+ /* <Fields> */
+ /* language :: */
+ /* The language ID used in Mac fonts. Definitions of values are in */
+ /* `ttnameid.h'. */
+ /* */
+ /* format :: */
+ /* The cmap format. OpenType 1.6 defines the formats 0 (byte */
+ /* encoding table), 2~(high-byte mapping through table), 4~(segment */
+ /* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
+ /* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
+ /* coverage), 13~(last resort font), and 14 (Unicode Variation */
+ /* Sequences). */
+ /* */
+ typedef struct TT_CMapInfo_
+ {
+ FT_ULong language;
+ FT_Long format;
+
+ } TT_CMapInfo;
+
+
+ typedef FT_Error
+ (*TT_CMap_Info_GetFunc)( FT_CharMap charmap,
+ TT_CMapInfo *cmap_info );
+
+
+ FT_DEFINE_SERVICE( TTCMaps )
+ {
+ TT_CMap_Info_GetFunc get_cmap_info;
+ };
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
+ static const FT_Service_TTCMapsRec class_ = \
+ { \
+ get_cmap_info_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ FT_Service_TTCMapsRec* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->get_cmap_info = get_cmap_info_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __SVTTCMAP_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h b/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h
new file mode 100644
index 0000000000..272ee8c055
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h
@@ -0,0 +1,53 @@
+/***************************************************************************/
+/* */
+/* svtteng.h */
+/* */
+/* The FreeType TrueType engine query service (specification). */
+/* */
+/* Copyright 2006-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVTTENG_H__
+#define __SVTTENG_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_MODULE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * SFNT table loading service.
+ */
+
+#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
+
+ /*
+ * Used to implement FT_Get_TrueType_Engine_Type
+ */
+
+ FT_DEFINE_SERVICE( TrueTypeEngine )
+ {
+ FT_TrueTypeEngineType engine_type;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVTTENG_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h b/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h
new file mode 100644
index 0000000000..f5cb76a9f8
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h
@@ -0,0 +1,69 @@
+/***************************************************************************/
+/* */
+/* svttglyf.h */
+/* */
+/* The FreeType TrueType glyph service. */
+/* */
+/* Copyright 2007-2015 by */
+/* David Turner. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef __SVTTGLYF_H__
+#define __SVTTGLYF_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_TRUETYPE_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_TT_GLYF "tt-glyf"
+
+
+ typedef FT_ULong
+ (*TT_Glyf_GetLocationFunc)( FT_Face face,
+ FT_UInt gindex,
+ FT_ULong *psize );
+
+ FT_DEFINE_SERVICE( TTGlyf )
+ {
+ TT_Glyf_GetLocationFunc get_location;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
+ static const FT_Service_TTGlyfRec class_ = \
+ { \
+ get_location_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_TTGlyfRec* clazz ) \
+ { \
+ clazz->get_location = get_location_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __SVTTGLYF_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h b/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h
new file mode 100644
index 0000000000..0036929b2f
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h
@@ -0,0 +1,50 @@
+/***************************************************************************/
+/* */
+/* svwinfnt.h */
+/* */
+/* The FreeType Windows FNT/FONT service (specification). */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVWINFNT_H__
+#define __SVWINFNT_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_WINFONTS_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_WINFNT "winfonts"
+
+ typedef FT_Error
+ (*FT_WinFnt_GetHeaderFunc)( FT_Face face,
+ FT_WinFNT_HeaderRec *aheader );
+
+
+ FT_DEFINE_SERVICE( WinFnt )
+ {
+ FT_WinFnt_GetHeaderFunc get_header;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVWINFNT_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/sfnt.h b/src/3rdparty/freetype/include/freetype/internal/sfnt.h
new file mode 100644
index 0000000000..30f53bf09c
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/sfnt.h
@@ -0,0 +1,748 @@
+/***************************************************************************/
+/* */
+/* sfnt.h */
+/* */
+/* High-level `sfnt' driver interface (specification). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SFNT_H__
+#define __SFNT_H__
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DRIVER_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Init_Face_Func */
+ /* */
+ /* <Description> */
+ /* First part of the SFNT face object initialization. This finds */
+ /* the face in a SFNT file or collection, and load its format tag in */
+ /* face->format_tag. */
+ /* */
+ /* <Input> */
+ /* stream :: The input stream. */
+ /* */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* face_index :: The index of the TrueType font, if we are opening a */
+ /* collection, in bits 0-15. The numbered instance */
+ /* index~+~1 of a GX (sub)font, if applicable, in bits */
+ /* 16-30. */
+ /* */
+ /* num_params :: The number of additional parameters. */
+ /* */
+ /* params :: Optional additional parameters. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The stream cursor must be at the font file's origin. */
+ /* */
+ /* This function recognizes fonts embedded in a `TrueType */
+ /* collection'. */
+ /* */
+ /* Once the format tag has been validated by the font driver, it */
+ /* should then call the TT_Load_Face_Func() callback to read the rest */
+ /* of the SFNT tables in the object. */
+ /* */
+ typedef FT_Error
+ (*TT_Init_Face_Func)( FT_Stream stream,
+ TT_Face face,
+ FT_Int face_index,
+ FT_Int num_params,
+ FT_Parameter* params );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_Face_Func */
+ /* */
+ /* <Description> */
+ /* Second part of the SFNT face object initialization. This loads */
+ /* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */
+ /* face object. */
+ /* */
+ /* <Input> */
+ /* stream :: The input stream. */
+ /* */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* face_index :: The index of the TrueType font, if we are opening a */
+ /* collection, in bits 0-15. The numbered instance */
+ /* index~+~1 of a GX (sub)font, if applicable, in bits */
+ /* 16-30. */
+ /* */
+ /* num_params :: The number of additional parameters. */
+ /* */
+ /* params :: Optional additional parameters. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function must be called after TT_Init_Face_Func(). */
+ /* */
+ typedef FT_Error
+ (*TT_Load_Face_Func)( FT_Stream stream,
+ TT_Face face,
+ FT_Int face_index,
+ FT_Int num_params,
+ FT_Parameter* params );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Done_Face_Func */
+ /* */
+ /* <Description> */
+ /* A callback used to delete the common SFNT data from a face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* <Note> */
+ /* This function does NOT destroy the face object. */
+ /* */
+ typedef void
+ (*TT_Done_Face_Func)( TT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_Any_Func */
+ /* */
+ /* <Description> */
+ /* Load any font table into client memory. */
+ /* */
+ /* <Input> */
+ /* face :: The face object to look for. */
+ /* */
+ /* tag :: The tag of table to load. Use the value 0 if you want */
+ /* to access the whole font file, else set this parameter */
+ /* to a valid TrueType table tag that you can forge with */
+ /* the MAKE_TT_TAG macro. */
+ /* */
+ /* offset :: The starting offset in the table (or the file if */
+ /* tag == 0). */
+ /* */
+ /* length :: The address of the decision variable: */
+ /* */
+ /* If length == NULL: */
+ /* Loads the whole table. Returns an error if */
+ /* `offset' == 0! */
+ /* */
+ /* If *length == 0: */
+ /* Exits immediately; returning the length of the given */
+ /* table or of the font file, depending on the value of */
+ /* `tag'. */
+ /* */
+ /* If *length != 0: */
+ /* Loads the next `length' bytes of table or font, */
+ /* starting at offset `offset' (in table or font too). */
+ /* */
+ /* <Output> */
+ /* buffer :: The address of target buffer. */
+ /* */
+ /* <Return> */
+ /* TrueType error code. 0 means success. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_Any_Func)( TT_Face face,
+ FT_ULong tag,
+ FT_Long offset,
+ FT_Byte *buffer,
+ FT_ULong* length );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Find_SBit_Image_Func */
+ /* */
+ /* <Description> */
+ /* Check whether an embedded bitmap (an `sbit') exists for a given */
+ /* glyph, at a given strike. */
+ /* */
+ /* <Input> */
+ /* face :: The target face object. */
+ /* */
+ /* glyph_index :: The glyph index. */
+ /* */
+ /* strike_index :: The current strike index. */
+ /* */
+ /* <Output> */
+ /* arange :: The SBit range containing the glyph index. */
+ /* */
+ /* astrike :: The SBit strike containing the glyph index. */
+ /* */
+ /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. Returns */
+ /* SFNT_Err_Invalid_Argument if no sbit exists for the requested */
+ /* glyph. */
+ /* */
+ typedef FT_Error
+ (*TT_Find_SBit_Image_Func)( TT_Face face,
+ FT_UInt glyph_index,
+ FT_ULong strike_index,
+ TT_SBit_Range *arange,
+ TT_SBit_Strike *astrike,
+ FT_ULong *aglyph_offset );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_SBit_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* Get the big metrics for a given embedded bitmap. */
+ /* */
+ /* <Input> */
+ /* stream :: The input stream. */
+ /* */
+ /* range :: The SBit range containing the glyph. */
+ /* */
+ /* <Output> */
+ /* big_metrics :: A big SBit metrics structure for the glyph. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The stream cursor must be positioned at the glyph's offset within */
+ /* the `EBDT' table before the call. */
+ /* */
+ /* If the image format uses variable metrics, the stream cursor is */
+ /* positioned just after the metrics header in the `EBDT' table on */
+ /* function exit. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_SBit_Metrics_Func)( FT_Stream stream,
+ TT_SBit_Range range,
+ TT_SBit_Metrics metrics );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_SBit_Image_Func */
+ /* */
+ /* <Description> */
+ /* Load a given glyph sbit image from the font resource. This also */
+ /* returns its metrics. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* The target face object. */
+ /* */
+ /* strike_index :: */
+ /* The strike index. */
+ /* */
+ /* glyph_index :: */
+ /* The current glyph index. */
+ /* */
+ /* load_flags :: */
+ /* The current load flags. */
+ /* */
+ /* stream :: */
+ /* The input stream. */
+ /* */
+ /* <Output> */
+ /* amap :: */
+ /* The target pixmap. */
+ /* */
+ /* ametrics :: */
+ /* A big sbit metrics structure for the glyph image. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. Returns an error if no */
+ /* glyph sbit exists for the index. */
+ /* */
+ /* <Note> */
+ /* The `map.buffer' field is always freed before the glyph is loaded. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_SBit_Image_Func)( TT_Face face,
+ FT_ULong strike_index,
+ FT_UInt glyph_index,
+ FT_UInt load_flags,
+ FT_Stream stream,
+ FT_Bitmap *amap,
+ TT_SBit_MetricsRec *ametrics );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Set_SBit_Strike_Func */
+ /* */
+ /* <Description> */
+ /* Select an sbit strike for a given size request. */
+ /* */
+ /* <Input> */
+ /* face :: The target face object. */
+ /* */
+ /* req :: The size request. */
+ /* */
+ /* <Output> */
+ /* astrike_index :: The index of the sbit strike. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. Returns an error if no */
+ /* sbit strike exists for the selected ppem values. */
+ /* */
+ typedef FT_Error
+ (*TT_Set_SBit_Strike_Func)( TT_Face face,
+ FT_Size_Request req,
+ FT_ULong* astrike_index );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_Strike_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* Load the metrics of a given strike. */
+ /* */
+ /* <Input> */
+ /* face :: The target face object. */
+ /* */
+ /* strike_index :: The strike index. */
+ /* */
+ /* <Output> */
+ /* metrics :: the metrics of the strike. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. Returns an error if no */
+ /* such sbit strike exists. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_Strike_Metrics_Func)( TT_Face face,
+ FT_ULong strike_index,
+ FT_Size_Metrics* metrics );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Get_PS_Name_Func */
+ /* */
+ /* <Description> */
+ /* Get the PostScript glyph name of a glyph. */
+ /* */
+ /* <Input> */
+ /* idx :: The glyph index. */
+ /* */
+ /* PSname :: The address of a string pointer. Will be NULL in case */
+ /* of error, otherwise it is a pointer to the glyph name. */
+ /* */
+ /* You must not modify the returned string! */
+ /* */
+ /* <Output> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ typedef FT_Error
+ (*TT_Get_PS_Name_Func)( TT_Face face,
+ FT_UInt idx,
+ FT_String** PSname );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* Load a metrics table, which is a table with a horizontal and a */
+ /* vertical version. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* stream :: The input stream. */
+ /* */
+ /* vertical :: A boolean flag. If set, load the vertical one. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_Metrics_Func)( TT_Face face,
+ FT_Stream stream,
+ FT_Bool vertical );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Get_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* Load the horizontal or vertical header in a face object. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* vertical :: A boolean flag. If set, load vertical metrics. */
+ /* */
+ /* gindex :: The glyph index. */
+ /* */
+ /* <Output> */
+ /* abearing :: The horizontal (or vertical) bearing. Set to zero in */
+ /* case of error. */
+ /* */
+ /* aadvance :: The horizontal (or vertical) advance. Set to zero in */
+ /* case of error. */
+ /* */
+ typedef void
+ (*TT_Get_Metrics_Func)( TT_Face face,
+ FT_Bool vertical,
+ FT_UInt gindex,
+ FT_Short* abearing,
+ FT_UShort* aadvance );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Get_Name_Func */
+ /* */
+ /* <Description> */
+ /* From the `name' table, return a given ENGLISH name record in */
+ /* ASCII. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* nameid :: The name id of the name record to return. */
+ /* */
+ /* <InOut> */
+ /* name :: The address of an allocated string pointer. NULL if */
+ /* no name is present. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ typedef FT_Error
+ (*TT_Get_Name_Func)( TT_Face face,
+ FT_UShort nameid,
+ FT_String** name );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_Table_Func */
+ /* */
+ /* <Description> */
+ /* Load a given TrueType table. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* stream :: The input stream. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The function uses `face->goto_table' to seek the stream to the */
+ /* start of the table, except while loading the font directory. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_Table_Func)( TT_Face face,
+ FT_Stream stream );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Free_Table_Func */
+ /* */
+ /* <Description> */
+ /* Free a given TrueType table. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object. */
+ /* */
+ typedef void
+ (*TT_Free_Table_Func)( TT_Face face );
+
+
+ /*
+ * @functype:
+ * TT_Face_GetKerningFunc
+ *
+ * @description:
+ * Return the horizontal kerning value between two glyphs.
+ *
+ * @input:
+ * face :: A handle to the source face object.
+ * left_glyph :: The left glyph index.
+ * right_glyph :: The right glyph index.
+ *
+ * @return:
+ * The kerning value in font units.
+ */
+ typedef FT_Int
+ (*TT_Face_GetKerningFunc)( TT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* SFNT_Interface */
+ /* */
+ /* <Description> */
+ /* This structure holds pointers to the functions used to load and */
+ /* free the basic tables that are required in a `sfnt' font file. */
+ /* */
+ /* <Fields> */
+ /* Check the various xxx_Func() descriptions for details. */
+ /* */
+ typedef struct SFNT_Interface_
+ {
+ TT_Loader_GotoTableFunc goto_table;
+
+ TT_Init_Face_Func init_face;
+ TT_Load_Face_Func load_face;
+ TT_Done_Face_Func done_face;
+ FT_Module_Requester get_interface;
+
+ TT_Load_Any_Func load_any;
+
+ /* these functions are called by `load_face' but they can also */
+ /* be called from external modules, if there is a need to do so */
+ TT_Load_Table_Func load_head;
+ TT_Load_Metrics_Func load_hhea;
+ TT_Load_Table_Func load_cmap;
+ TT_Load_Table_Func load_maxp;
+ TT_Load_Table_Func load_os2;
+ TT_Load_Table_Func load_post;
+
+ TT_Load_Table_Func load_name;
+ TT_Free_Table_Func free_name;
+
+ /* this field was called `load_kerning' up to version 2.1.10 */
+ TT_Load_Table_Func load_kern;
+
+ TT_Load_Table_Func load_gasp;
+ TT_Load_Table_Func load_pclt;
+
+ /* see `ttload.h'; this field was called `load_bitmap_header' up to */
+ /* version 2.1.10 */
+ TT_Load_Table_Func load_bhed;
+
+ TT_Load_SBit_Image_Func load_sbit_image;
+
+ /* see `ttpost.h' */
+ TT_Get_PS_Name_Func get_psname;
+ TT_Free_Table_Func free_psnames;
+
+ /* starting here, the structure differs from version 2.1.7 */
+
+ /* this field was introduced in version 2.1.8, named `get_psname' */
+ TT_Face_GetKerningFunc get_kerning;
+
+ /* new elements introduced after version 2.1.10 */
+
+ /* load the font directory, i.e., the offset table and */
+ /* the table directory */
+ TT_Load_Table_Func load_font_dir;
+ TT_Load_Metrics_Func load_hmtx;
+
+ TT_Load_Table_Func load_eblc;
+ TT_Free_Table_Func free_eblc;
+
+ TT_Set_SBit_Strike_Func set_sbit_strike;
+ TT_Load_Strike_Metrics_Func load_strike_metrics;
+
+ TT_Get_Metrics_Func get_metrics;
+
+ TT_Get_Name_Func get_name;
+
+ } SFNT_Interface;
+
+
+ /* transitional */
+ typedef SFNT_Interface* SFNT_Service;
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SFNT_INTERFACE( \
+ class_, \
+ goto_table_, \
+ init_face_, \
+ load_face_, \
+ done_face_, \
+ get_interface_, \
+ load_any_, \
+ load_head_, \
+ load_hhea_, \
+ load_cmap_, \
+ load_maxp_, \
+ load_os2_, \
+ load_post_, \
+ load_name_, \
+ free_name_, \
+ load_kern_, \
+ load_gasp_, \
+ load_pclt_, \
+ load_bhed_, \
+ load_sbit_image_, \
+ get_psname_, \
+ free_psnames_, \
+ get_kerning_, \
+ load_font_dir_, \
+ load_hmtx_, \
+ load_eblc_, \
+ free_eblc_, \
+ set_sbit_strike_, \
+ load_strike_metrics_, \
+ get_metrics_, \
+ get_name_ ) \
+ static const SFNT_Interface class_ = \
+ { \
+ goto_table_, \
+ init_face_, \
+ load_face_, \
+ done_face_, \
+ get_interface_, \
+ load_any_, \
+ load_head_, \
+ load_hhea_, \
+ load_cmap_, \
+ load_maxp_, \
+ load_os2_, \
+ load_post_, \
+ load_name_, \
+ free_name_, \
+ load_kern_, \
+ load_gasp_, \
+ load_pclt_, \
+ load_bhed_, \
+ load_sbit_image_, \
+ get_psname_, \
+ free_psnames_, \
+ get_kerning_, \
+ load_font_dir_, \
+ load_hmtx_, \
+ load_eblc_, \
+ free_eblc_, \
+ set_sbit_strike_, \
+ load_strike_metrics_, \
+ get_metrics_, \
+ get_name_, \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_INTERNAL( a, a_ ) \
+ clazz->a = a_;
+
+#define FT_DEFINE_SFNT_INTERFACE( \
+ class_, \
+ goto_table_, \
+ init_face_, \
+ load_face_, \
+ done_face_, \
+ get_interface_, \
+ load_any_, \
+ load_head_, \
+ load_hhea_, \
+ load_cmap_, \
+ load_maxp_, \
+ load_os2_, \
+ load_post_, \
+ load_name_, \
+ free_name_, \
+ load_kern_, \
+ load_gasp_, \
+ load_pclt_, \
+ load_bhed_, \
+ load_sbit_image_, \
+ get_psname_, \
+ free_psnames_, \
+ get_kerning_, \
+ load_font_dir_, \
+ load_hmtx_, \
+ load_eblc_, \
+ free_eblc_, \
+ set_sbit_strike_, \
+ load_strike_metrics_, \
+ get_metrics_, \
+ get_name_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ SFNT_Interface* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->goto_table = goto_table_; \
+ clazz->init_face = init_face_; \
+ clazz->load_face = load_face_; \
+ clazz->done_face = done_face_; \
+ clazz->get_interface = get_interface_; \
+ clazz->load_any = load_any_; \
+ clazz->load_head = load_head_; \
+ clazz->load_hhea = load_hhea_; \
+ clazz->load_cmap = load_cmap_; \
+ clazz->load_maxp = load_maxp_; \
+ clazz->load_os2 = load_os2_; \
+ clazz->load_post = load_post_; \
+ clazz->load_name = load_name_; \
+ clazz->free_name = free_name_; \
+ clazz->load_kern = load_kern_; \
+ clazz->load_gasp = load_gasp_; \
+ clazz->load_pclt = load_pclt_; \
+ clazz->load_bhed = load_bhed_; \
+ clazz->load_sbit_image = load_sbit_image_; \
+ clazz->get_psname = get_psname_; \
+ clazz->free_psnames = free_psnames_; \
+ clazz->get_kerning = get_kerning_; \
+ clazz->load_font_dir = load_font_dir_; \
+ clazz->load_hmtx = load_hmtx_; \
+ clazz->load_eblc = load_eblc_; \
+ clazz->free_eblc = free_eblc_; \
+ clazz->set_sbit_strike = set_sbit_strike_; \
+ clazz->load_strike_metrics = load_strike_metrics_; \
+ clazz->get_metrics = get_metrics_; \
+ clazz->get_name = get_name_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+FT_END_HEADER
+
+#endif /* __SFNT_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/t1types.h b/src/3rdparty/freetype/include/freetype/internal/t1types.h
new file mode 100644
index 0000000000..029acc4009
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/t1types.h
@@ -0,0 +1,255 @@
+/***************************************************************************/
+/* */
+/* t1types.h */
+/* */
+/* Basic Type1/Type2 type definitions and interface (specification */
+/* only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __T1TYPES_H__
+#define __T1TYPES_H__
+
+
+#include <ft2build.h>
+#include FT_TYPE1_TABLES_H
+#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+#include FT_INTERNAL_SERVICE_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_EncodingRec */
+ /* */
+ /* <Description> */
+ /* A structure modeling a custom encoding. */
+ /* */
+ /* <Fields> */
+ /* num_chars :: The number of character codes in the encoding. */
+ /* Usually 256. */
+ /* */
+ /* code_first :: The lowest valid character code in the encoding. */
+ /* */
+ /* code_last :: The highest valid character code in the encoding */
+ /* + 1. When equal to code_first there are no valid */
+ /* character codes. */
+ /* */
+ /* char_index :: An array of corresponding glyph indices. */
+ /* */
+ /* char_name :: An array of corresponding glyph names. */
+ /* */
+ typedef struct T1_EncodingRecRec_
+ {
+ FT_Int num_chars;
+ FT_Int code_first;
+ FT_Int code_last;
+
+ FT_UShort* char_index;
+ FT_String** char_name;
+
+ } T1_EncodingRec, *T1_Encoding;
+
+
+ /* used to hold extra data of PS_FontInfoRec that
+ * cannot be stored in the publicly defined structure.
+ *
+ * Note these can't be blended with multiple-masters.
+ */
+ typedef struct PS_FontExtraRec_
+ {
+ FT_UShort fs_type;
+
+ } PS_FontExtraRec;
+
+
+ typedef struct T1_FontRec_
+ {
+ PS_FontInfoRec font_info; /* font info dictionary */
+ PS_FontExtraRec font_extra; /* font info extra fields */
+ PS_PrivateRec private_dict; /* private dictionary */
+ FT_String* font_name; /* top-level dictionary */
+
+ T1_EncodingType encoding_type;
+ T1_EncodingRec encoding;
+
+ FT_Byte* subrs_block;
+ FT_Byte* charstrings_block;
+ FT_Byte* glyph_names_block;
+
+ FT_Int num_subrs;
+ FT_Byte** subrs;
+ FT_UInt* subrs_len;
+
+ FT_Int num_glyphs;
+ FT_String** glyph_names; /* array of glyph names */
+ FT_Byte** charstrings; /* array of glyph charstrings */
+ FT_UInt* charstrings_len;
+
+ FT_Byte paint_type;
+ FT_Byte font_type;
+ FT_Matrix font_matrix;
+ FT_Vector font_offset;
+ FT_BBox font_bbox;
+ FT_Long font_id;
+
+ FT_Fixed stroke_width;
+
+ } T1_FontRec, *T1_Font;
+
+
+ typedef struct CID_SubrsRec_
+ {
+ FT_Int num_subrs;
+ FT_Byte** code;
+
+ } CID_SubrsRec, *CID_Subrs;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** AFM FONT INFORMATION STRUCTURES ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ typedef struct AFM_TrackKernRec_
+ {
+ FT_Int degree;
+ FT_Fixed min_ptsize;
+ FT_Fixed min_kern;
+ FT_Fixed max_ptsize;
+ FT_Fixed max_kern;
+
+ } AFM_TrackKernRec, *AFM_TrackKern;
+
+ typedef struct AFM_KernPairRec_
+ {
+ FT_UInt index1;
+ FT_UInt index2;
+ FT_Int x;
+ FT_Int y;
+
+ } AFM_KernPairRec, *AFM_KernPair;
+
+ typedef struct AFM_FontInfoRec_
+ {
+ FT_Bool IsCIDFont;
+ FT_BBox FontBBox;
+ FT_Fixed Ascender;
+ FT_Fixed Descender;
+ AFM_TrackKern TrackKerns; /* free if non-NULL */
+ FT_UInt NumTrackKern;
+ AFM_KernPair KernPairs; /* free if non-NULL */
+ FT_UInt NumKernPair;
+
+ } AFM_FontInfoRec, *AFM_FontInfo;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** ORIGINAL T1_FACE CLASS DEFINITION ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ typedef struct T1_FaceRec_* T1_Face;
+ typedef struct CID_FaceRec_* CID_Face;
+
+
+ typedef struct T1_FaceRec_
+ {
+ FT_FaceRec root;
+ T1_FontRec type1;
+ const void* psnames;
+ const void* psaux;
+ const void* afm_data;
+ FT_CharMapRec charmaprecs[2];
+ FT_CharMap charmaps[2];
+
+ /* support for Multiple Masters fonts */
+ PS_Blend blend;
+
+ /* undocumented, optional: indices of subroutines that express */
+ /* the NormalizeDesignVector and the ConvertDesignVector procedure, */
+ /* respectively, as Type 2 charstrings; -1 if keywords not present */
+ FT_Int ndv_idx;
+ FT_Int cdv_idx;
+
+ /* undocumented, optional: has the same meaning as len_buildchar */
+ /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
+ FT_UInt len_buildchar;
+ FT_Long* buildchar;
+
+ /* since version 2.1 - interface to PostScript hinter */
+ const void* pshinter;
+
+ } T1_FaceRec;
+
+
+ typedef struct CID_FaceRec_
+ {
+ FT_FaceRec root;
+ void* psnames;
+ void* psaux;
+ CID_FaceInfoRec cid;
+ PS_FontExtraRec font_extra;
+#if 0
+ void* afm_data;
+#endif
+ CID_Subrs subrs;
+
+ /* since version 2.1 - interface to PostScript hinter */
+ void* pshinter;
+
+ /* since version 2.1.8, but was originally positioned after `afm_data' */
+ FT_Byte* binary_data; /* used if hex data has been converted */
+ FT_Stream cid_stream;
+
+ } CID_FaceRec;
+
+
+FT_END_HEADER
+
+#endif /* __T1TYPES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/tttypes.h b/src/3rdparty/freetype/include/freetype/internal/tttypes.h
new file mode 100644
index 0000000000..1507a7c57a
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/tttypes.h
@@ -0,0 +1,1526 @@
+/***************************************************************************/
+/* */
+/* tttypes.h */
+/* */
+/* Basic SFNT/TrueType type definitions and interface (specification */
+/* only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __TTTYPES_H__
+#define __TTTYPES_H__
+
+
+#include <ft2build.h>
+#include FT_TRUETYPE_TABLES_H
+#include FT_INTERNAL_OBJECTS_H
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TTC_HeaderRec */
+ /* */
+ /* <Description> */
+ /* TrueType collection header. This table contains the offsets of */
+ /* the font headers of each distinct TrueType face in the file. */
+ /* */
+ /* <Fields> */
+ /* tag :: Must be `ttc ' to indicate a TrueType collection. */
+ /* */
+ /* version :: The version number. */
+ /* */
+ /* count :: The number of faces in the collection. The */
+ /* specification says this should be an unsigned long, but */
+ /* we use a signed long since we need the value -1 for */
+ /* specific purposes. */
+ /* */
+ /* offsets :: The offsets of the font headers, one per face. */
+ /* */
+ typedef struct TTC_HeaderRec_
+ {
+ FT_ULong tag;
+ FT_Fixed version;
+ FT_Long count;
+ FT_ULong* offsets;
+
+ } TTC_HeaderRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* SFNT_HeaderRec */
+ /* */
+ /* <Description> */
+ /* SFNT file format header. */
+ /* */
+ /* <Fields> */
+ /* format_tag :: The font format tag. */
+ /* */
+ /* num_tables :: The number of tables in file. */
+ /* */
+ /* search_range :: Must be `16 * (max power of 2 <= num_tables)'. */
+ /* */
+ /* entry_selector :: Must be log2 of `search_range / 16'. */
+ /* */
+ /* range_shift :: Must be `num_tables * 16 - search_range'. */
+ /* */
+ typedef struct SFNT_HeaderRec_
+ {
+ FT_ULong format_tag;
+ FT_UShort num_tables;
+ FT_UShort search_range;
+ FT_UShort entry_selector;
+ FT_UShort range_shift;
+
+ FT_ULong offset; /* not in file */
+
+ } SFNT_HeaderRec, *SFNT_Header;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_TableRec */
+ /* */
+ /* <Description> */
+ /* This structure describes a given table of a TrueType font. */
+ /* */
+ /* <Fields> */
+ /* Tag :: A four-bytes tag describing the table. */
+ /* */
+ /* CheckSum :: The table checksum. This value can be ignored. */
+ /* */
+ /* Offset :: The offset of the table from the start of the TrueType */
+ /* font in its resource. */
+ /* */
+ /* Length :: The table length (in bytes). */
+ /* */
+ typedef struct TT_TableRec_
+ {
+ FT_ULong Tag; /* table type */
+ FT_ULong CheckSum; /* table checksum */
+ FT_ULong Offset; /* table file offset */
+ FT_ULong Length; /* table length */
+
+ } TT_TableRec, *TT_Table;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* WOFF_HeaderRec */
+ /* */
+ /* <Description> */
+ /* WOFF file format header. */
+ /* */
+ /* <Fields> */
+ /* See */
+ /* */
+ /* http://www.w3.org/TR/WOFF/#WOFFHeader */
+ /* */
+ typedef struct WOFF_HeaderRec_
+ {
+ FT_ULong signature;
+ FT_ULong flavor;
+ FT_ULong length;
+ FT_UShort num_tables;
+ FT_UShort reserved;
+ FT_ULong totalSfntSize;
+ FT_UShort majorVersion;
+ FT_UShort minorVersion;
+ FT_ULong metaOffset;
+ FT_ULong metaLength;
+ FT_ULong metaOrigLength;
+ FT_ULong privOffset;
+ FT_ULong privLength;
+
+ } WOFF_HeaderRec, *WOFF_Header;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* WOFF_TableRec */
+ /* */
+ /* <Description> */
+ /* This structure describes a given table of a WOFF font. */
+ /* */
+ /* <Fields> */
+ /* Tag :: A four-bytes tag describing the table. */
+ /* */
+ /* Offset :: The offset of the table from the start of the WOFF */
+ /* font in its resource. */
+ /* */
+ /* CompLength :: Compressed table length (in bytes). */
+ /* */
+ /* OrigLength :: Unompressed table length (in bytes). */
+ /* */
+ /* CheckSum :: The table checksum. This value can be ignored. */
+ /* */
+ /* OrigOffset :: The uncompressed table file offset. This value gets */
+ /* computed while constructing the (uncompressed) SFNT */
+ /* header. It is not contained in the WOFF file. */
+ /* */
+ typedef struct WOFF_TableRec_
+ {
+ FT_ULong Tag; /* table ID */
+ FT_ULong Offset; /* table file offset */
+ FT_ULong CompLength; /* compressed table length */
+ FT_ULong OrigLength; /* uncompressed table length */
+ FT_ULong CheckSum; /* uncompressed checksum */
+
+ FT_ULong OrigOffset; /* uncompressed table file offset */
+ /* (not in the WOFF file) */
+ } WOFF_TableRec, *WOFF_Table;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_LongMetricsRec */
+ /* */
+ /* <Description> */
+ /* A structure modeling the long metrics of the `hmtx' and `vmtx' */
+ /* TrueType tables. The values are expressed in font units. */
+ /* */
+ /* <Fields> */
+ /* advance :: The advance width or height for the glyph. */
+ /* */
+ /* bearing :: The left-side or top-side bearing for the glyph. */
+ /* */
+ typedef struct TT_LongMetricsRec_
+ {
+ FT_UShort advance;
+ FT_Short bearing;
+
+ } TT_LongMetricsRec, *TT_LongMetrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* TT_ShortMetrics */
+ /* */
+ /* <Description> */
+ /* A simple type to model the short metrics of the `hmtx' and `vmtx' */
+ /* tables. */
+ /* */
+ typedef FT_Short TT_ShortMetrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_NameEntryRec */
+ /* */
+ /* <Description> */
+ /* A structure modeling TrueType name records. Name records are used */
+ /* to store important strings like family name, style name, */
+ /* copyright, etc. in _localized_ versions (i.e., language, encoding, */
+ /* etc). */
+ /* */
+ /* <Fields> */
+ /* platformID :: The ID of the name's encoding platform. */
+ /* */
+ /* encodingID :: The platform-specific ID for the name's encoding. */
+ /* */
+ /* languageID :: The platform-specific ID for the name's language. */
+ /* */
+ /* nameID :: The ID specifying what kind of name this is. */
+ /* */
+ /* stringLength :: The length of the string in bytes. */
+ /* */
+ /* stringOffset :: The offset to the string in the `name' table. */
+ /* */
+ /* string :: A pointer to the string's bytes. Note that these */
+ /* are usually UTF-16 encoded characters. */
+ /* */
+ typedef struct TT_NameEntryRec_
+ {
+ FT_UShort platformID;
+ FT_UShort encodingID;
+ FT_UShort languageID;
+ FT_UShort nameID;
+ FT_UShort stringLength;
+ FT_ULong stringOffset;
+
+ /* this last field is not defined in the spec */
+ /* but used by the FreeType engine */
+
+ FT_Byte* string;
+
+ } TT_NameEntryRec, *TT_NameEntry;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_NameTableRec */
+ /* */
+ /* <Description> */
+ /* A structure modeling the TrueType name table. */
+ /* */
+ /* <Fields> */
+ /* format :: The format of the name table. */
+ /* */
+ /* numNameRecords :: The number of names in table. */
+ /* */
+ /* storageOffset :: The offset of the name table in the `name' */
+ /* TrueType table. */
+ /* */
+ /* names :: An array of name records. */
+ /* */
+ /* stream :: the file's input stream. */
+ /* */
+ typedef struct TT_NameTableRec_
+ {
+ FT_UShort format;
+ FT_UInt numNameRecords;
+ FT_UInt storageOffset;
+ TT_NameEntryRec* names;
+ FT_Stream stream;
+
+ } TT_NameTableRec, *TT_NameTable;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_GaspRangeRec */
+ /* */
+ /* <Description> */
+ /* A tiny structure used to model a gasp range according to the */
+ /* TrueType specification. */
+ /* */
+ /* <Fields> */
+ /* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */
+ /* */
+ /* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */
+ /* modes to be used. */
+ /* */
+ typedef struct TT_GaspRangeRec_
+ {
+ FT_UShort maxPPEM;
+ FT_UShort gaspFlag;
+
+ } TT_GaspRangeRec, *TT_GaspRange;
+
+
+#define TT_GASP_GRIDFIT 0x01
+#define TT_GASP_DOGRAY 0x02
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_GaspRec */
+ /* */
+ /* <Description> */
+ /* A structure modeling the TrueType `gasp' table used to specify */
+ /* grid-fitting and anti-aliasing behaviour. */
+ /* */
+ /* <Fields> */
+ /* version :: The version number. */
+ /* */
+ /* numRanges :: The number of gasp ranges in table. */
+ /* */
+ /* gaspRanges :: An array of gasp ranges. */
+ /* */
+ typedef struct TT_Gasp_
+ {
+ FT_UShort version;
+ FT_UShort numRanges;
+ TT_GaspRange gaspRanges;
+
+ } TT_GaspRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** EMBEDDED BITMAPS SUPPORT ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_MetricsRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold the big metrics of a given glyph bitmap */
+ /* in a TrueType or OpenType font. These are usually found in the */
+ /* `EBDT' (Microsoft) or `bloc' (Apple) table. */
+ /* */
+ /* <Fields> */
+ /* height :: The glyph height in pixels. */
+ /* */
+ /* width :: The glyph width in pixels. */
+ /* */
+ /* horiBearingX :: The horizontal left bearing. */
+ /* */
+ /* horiBearingY :: The horizontal top bearing. */
+ /* */
+ /* horiAdvance :: The horizontal advance. */
+ /* */
+ /* vertBearingX :: The vertical left bearing. */
+ /* */
+ /* vertBearingY :: The vertical top bearing. */
+ /* */
+ /* vertAdvance :: The vertical advance. */
+ /* */
+ typedef struct TT_SBit_MetricsRec_
+ {
+ FT_UShort height;
+ FT_UShort width;
+
+ FT_Short horiBearingX;
+ FT_Short horiBearingY;
+ FT_UShort horiAdvance;
+
+ FT_Short vertBearingX;
+ FT_Short vertBearingY;
+ FT_UShort vertAdvance;
+
+ } TT_SBit_MetricsRec, *TT_SBit_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_SmallMetricsRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold the small metrics of a given glyph bitmap */
+ /* in a TrueType or OpenType font. These are usually found in the */
+ /* `EBDT' (Microsoft) or the `bdat' (Apple) table. */
+ /* */
+ /* <Fields> */
+ /* height :: The glyph height in pixels. */
+ /* */
+ /* width :: The glyph width in pixels. */
+ /* */
+ /* bearingX :: The left-side bearing. */
+ /* */
+ /* bearingY :: The top-side bearing. */
+ /* */
+ /* advance :: The advance width or height. */
+ /* */
+ typedef struct TT_SBit_Small_Metrics_
+ {
+ FT_Byte height;
+ FT_Byte width;
+
+ FT_Char bearingX;
+ FT_Char bearingY;
+ FT_Byte advance;
+
+ } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_LineMetricsRec */
+ /* */
+ /* <Description> */
+ /* A structure used to describe the text line metrics of a given */
+ /* bitmap strike, for either a horizontal or vertical layout. */
+ /* */
+ /* <Fields> */
+ /* ascender :: The ascender in pixels. */
+ /* */
+ /* descender :: The descender in pixels. */
+ /* */
+ /* max_width :: The maximum glyph width in pixels. */
+ /* */
+ /* caret_slope_enumerator :: Rise of the caret slope, typically set */
+ /* to 1 for non-italic fonts. */
+ /* */
+ /* caret_slope_denominator :: Rise of the caret slope, typically set */
+ /* to 0 for non-italic fonts. */
+ /* */
+ /* caret_offset :: Offset in pixels to move the caret for */
+ /* proper positioning. */
+ /* */
+ /* min_origin_SB :: Minimum of horiBearingX (resp. */
+ /* vertBearingY). */
+ /* min_advance_SB :: Minimum of */
+ /* */
+ /* horizontal advance - */
+ /* ( horiBearingX + width ) */
+ /* */
+ /* resp. */
+ /* */
+ /* vertical advance - */
+ /* ( vertBearingY + height ) */
+ /* */
+ /* max_before_BL :: Maximum of horiBearingY (resp. */
+ /* vertBearingY). */
+ /* */
+ /* min_after_BL :: Minimum of */
+ /* */
+ /* horiBearingY - height */
+ /* */
+ /* resp. */
+ /* */
+ /* vertBearingX - width */
+ /* */
+ /* pads :: Unused (to make the size of the record */
+ /* a multiple of 32 bits. */
+ /* */
+ typedef struct TT_SBit_LineMetricsRec_
+ {
+ FT_Char ascender;
+ FT_Char descender;
+ FT_Byte max_width;
+ FT_Char caret_slope_numerator;
+ FT_Char caret_slope_denominator;
+ FT_Char caret_offset;
+ FT_Char min_origin_SB;
+ FT_Char min_advance_SB;
+ FT_Char max_before_BL;
+ FT_Char min_after_BL;
+ FT_Char pads[2];
+
+ } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_RangeRec */
+ /* */
+ /* <Description> */
+ /* A TrueType/OpenType subIndexTable as defined in the `EBLC' */
+ /* (Microsoft) or `bloc' (Apple) tables. */
+ /* */
+ /* <Fields> */
+ /* first_glyph :: The first glyph index in the range. */
+ /* */
+ /* last_glyph :: The last glyph index in the range. */
+ /* */
+ /* index_format :: The format of index table. Valid values are 1 */
+ /* to 5. */
+ /* */
+ /* image_format :: The format of `EBDT' image data. */
+ /* */
+ /* image_offset :: The offset to image data in `EBDT'. */
+ /* */
+ /* image_size :: For index formats 2 and 5. This is the size in */
+ /* bytes of each glyph bitmap. */
+ /* */
+ /* big_metrics :: For index formats 2 and 5. This is the big */
+ /* metrics for each glyph bitmap. */
+ /* */
+ /* num_glyphs :: For index formats 4 and 5. This is the number of */
+ /* glyphs in the code array. */
+ /* */
+ /* glyph_offsets :: For index formats 1 and 3. */
+ /* */
+ /* glyph_codes :: For index formats 4 and 5. */
+ /* */
+ /* table_offset :: The offset of the index table in the `EBLC' */
+ /* table. Only used during strike loading. */
+ /* */
+ typedef struct TT_SBit_RangeRec_
+ {
+ FT_UShort first_glyph;
+ FT_UShort last_glyph;
+
+ FT_UShort index_format;
+ FT_UShort image_format;
+ FT_ULong image_offset;
+
+ FT_ULong image_size;
+ TT_SBit_MetricsRec metrics;
+ FT_ULong num_glyphs;
+
+ FT_ULong* glyph_offsets;
+ FT_UShort* glyph_codes;
+
+ FT_ULong table_offset;
+
+ } TT_SBit_RangeRec, *TT_SBit_Range;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_StrikeRec */
+ /* */
+ /* <Description> */
+ /* A structure used describe a given bitmap strike in the `EBLC' */
+ /* (Microsoft) or `bloc' (Apple) tables. */
+ /* */
+ /* <Fields> */
+ /* num_index_ranges :: The number of index ranges. */
+ /* */
+ /* index_ranges :: An array of glyph index ranges. */
+ /* */
+ /* color_ref :: Unused. `color_ref' is put in for future */
+ /* enhancements, but these fields are already */
+ /* in use by other platforms (e.g. Newton). */
+ /* For details, please see */
+ /* */
+ /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html */
+ /* */
+ /* hori :: The line metrics for horizontal layouts. */
+ /* */
+ /* vert :: The line metrics for vertical layouts. */
+ /* */
+ /* start_glyph :: The lowest glyph index for this strike. */
+ /* */
+ /* end_glyph :: The highest glyph index for this strike. */
+ /* */
+ /* x_ppem :: The number of horizontal pixels per EM. */
+ /* */
+ /* y_ppem :: The number of vertical pixels per EM. */
+ /* */
+ /* bit_depth :: The bit depth. Valid values are 1, 2, 4, */
+ /* and 8. */
+ /* */
+ /* flags :: Is this a vertical or horizontal strike? For */
+ /* details, please see */
+ /* */
+ /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html */
+ /* */
+ typedef struct TT_SBit_StrikeRec_
+ {
+ FT_Int num_ranges;
+ TT_SBit_Range sbit_ranges;
+ FT_ULong ranges_offset;
+
+ FT_ULong color_ref;
+
+ TT_SBit_LineMetricsRec hori;
+ TT_SBit_LineMetricsRec vert;
+
+ FT_UShort start_glyph;
+ FT_UShort end_glyph;
+
+ FT_Byte x_ppem;
+ FT_Byte y_ppem;
+
+ FT_Byte bit_depth;
+ FT_Char flags;
+
+ } TT_SBit_StrikeRec, *TT_SBit_Strike;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_ComponentRec */
+ /* */
+ /* <Description> */
+ /* A simple structure to describe a compound sbit element. */
+ /* */
+ /* <Fields> */
+ /* glyph_code :: The element's glyph index. */
+ /* */
+ /* x_offset :: The element's left bearing. */
+ /* */
+ /* y_offset :: The element's top bearing. */
+ /* */
+ typedef struct TT_SBit_ComponentRec_
+ {
+ FT_UShort glyph_code;
+ FT_Char x_offset;
+ FT_Char y_offset;
+
+ } TT_SBit_ComponentRec, *TT_SBit_Component;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_SBit_ScaleRec */
+ /* */
+ /* <Description> */
+ /* A structure used describe a given bitmap scaling table, as defined */
+ /* in the `EBSC' table. */
+ /* */
+ /* <Fields> */
+ /* hori :: The horizontal line metrics. */
+ /* */
+ /* vert :: The vertical line metrics. */
+ /* */
+ /* x_ppem :: The number of horizontal pixels per EM. */
+ /* */
+ /* y_ppem :: The number of vertical pixels per EM. */
+ /* */
+ /* x_ppem_substitute :: Substitution x_ppem value. */
+ /* */
+ /* y_ppem_substitute :: Substitution y_ppem value. */
+ /* */
+ typedef struct TT_SBit_ScaleRec_
+ {
+ TT_SBit_LineMetricsRec hori;
+ TT_SBit_LineMetricsRec vert;
+
+ FT_Byte x_ppem;
+ FT_Byte y_ppem;
+
+ FT_Byte x_ppem_substitute;
+ FT_Byte y_ppem_substitute;
+
+ } TT_SBit_ScaleRec, *TT_SBit_Scale;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Post_20Rec */
+ /* */
+ /* <Description> */
+ /* Postscript names sub-table, format 2.0. Stores the PS name of */
+ /* each glyph in the font face. */
+ /* */
+ /* <Fields> */
+ /* num_glyphs :: The number of named glyphs in the table. */
+ /* */
+ /* num_names :: The number of PS names stored in the table. */
+ /* */
+ /* glyph_indices :: The indices of the glyphs in the names arrays. */
+ /* */
+ /* glyph_names :: The PS names not in Mac Encoding. */
+ /* */
+ typedef struct TT_Post_20Rec_
+ {
+ FT_UShort num_glyphs;
+ FT_UShort num_names;
+ FT_UShort* glyph_indices;
+ FT_Char** glyph_names;
+
+ } TT_Post_20Rec, *TT_Post_20;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Post_25Rec */
+ /* */
+ /* <Description> */
+ /* Postscript names sub-table, format 2.5. Stores the PS name of */
+ /* each glyph in the font face. */
+ /* */
+ /* <Fields> */
+ /* num_glyphs :: The number of glyphs in the table. */
+ /* */
+ /* offsets :: An array of signed offsets in a normal Mac */
+ /* Postscript name encoding. */
+ /* */
+ typedef struct TT_Post_25_
+ {
+ FT_UShort num_glyphs;
+ FT_Char* offsets;
+
+ } TT_Post_25Rec, *TT_Post_25;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Post_NamesRec */
+ /* */
+ /* <Description> */
+ /* Postscript names table, either format 2.0 or 2.5. */
+ /* */
+ /* <Fields> */
+ /* loaded :: A flag to indicate whether the PS names are loaded. */
+ /* */
+ /* format_20 :: The sub-table used for format 2.0. */
+ /* */
+ /* format_25 :: The sub-table used for format 2.5. */
+ /* */
+ typedef struct TT_Post_NamesRec_
+ {
+ FT_Bool loaded;
+
+ union
+ {
+ TT_Post_20Rec format_20;
+ TT_Post_25Rec format_25;
+
+ } names;
+
+ } TT_Post_NamesRec, *TT_Post_Names;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** GX VARIATION TABLE SUPPORT ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ typedef struct GX_BlendRec_ *GX_Blend;
+#endif
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*
+ * These types are used to support a `BDF ' table that isn't part of the
+ * official TrueType specification. It is mainly used in SFNT-based
+ * bitmap fonts that were generated from a set of BDF fonts.
+ *
+ * The format of the table is as follows.
+ *
+ * USHORT version `BDF ' table version number, should be 0x0001.
+ * USHORT strikeCount Number of strikes (bitmap sizes) in this table.
+ * ULONG stringTable Offset (from start of BDF table) to string
+ * table.
+ *
+ * This is followed by an array of `strikeCount' descriptors, having the
+ * following format.
+ *
+ * USHORT ppem Vertical pixels per EM for this strike.
+ * USHORT numItems Number of items for this strike (properties and
+ * atoms). Maximum is 255.
+ *
+ * This array in turn is followed by `strikeCount' value sets. Each
+ * `value set' is an array of `numItems' items with the following format.
+ *
+ * ULONG item_name Offset in string table to item name.
+ * USHORT item_type The item type. Possible values are
+ * 0 => string (e.g., COMMENT)
+ * 1 => atom (e.g., FONT or even SIZE)
+ * 2 => int32
+ * 3 => uint32
+ * 0x10 => A flag to indicate a properties. This
+ * is ORed with the above values.
+ * ULONG item_value For strings => Offset into string table without
+ * the corresponding double quotes.
+ * For atoms => Offset into string table.
+ * For integers => Direct value.
+ *
+ * All strings in the string table consist of bytes and are
+ * zero-terminated.
+ *
+ */
+
+#ifdef TT_CONFIG_OPTION_BDF
+
+ typedef struct TT_BDFRec_
+ {
+ FT_Byte* table;
+ FT_Byte* table_end;
+ FT_Byte* strings;
+ FT_ULong strings_size;
+ FT_UInt num_strikes;
+ FT_Bool loaded;
+
+ } TT_BDFRec, *TT_BDF;
+
+#endif /* TT_CONFIG_OPTION_BDF */
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*** ***/
+ /*** ***/
+ /*** ORIGINAL TT_FACE CLASS DEFINITION ***/
+ /*** ***/
+ /*** ***/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This structure/class is defined here because it is common to the */
+ /* following formats: TTF, OpenType-TT, and OpenType-CFF. */
+ /* */
+ /* Note, however, that the classes TT_Size and TT_GlyphSlot are not */
+ /* shared between font drivers, and are thus defined in `ttobjs.h'. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* TT_Face */
+ /* */
+ /* <Description> */
+ /* A handle to a TrueType face/font object. A TT_Face encapsulates */
+ /* the resolution and scaling independent parts of a TrueType font */
+ /* resource. */
+ /* */
+ /* <Note> */
+ /* The TT_Face structure is also used as a `parent class' for the */
+ /* OpenType-CFF class (T2_Face). */
+ /* */
+ typedef struct TT_FaceRec_* TT_Face;
+
+
+ /* a function type used for the truetype bytecode interpreter hooks */
+ typedef FT_Error
+ (*TT_Interpreter)( void* exec_context );
+
+ /* forward declaration */
+ typedef struct TT_LoaderRec_* TT_Loader;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Loader_GotoTableFunc */
+ /* */
+ /* <Description> */
+ /* Seeks a stream to the start of a given TrueType table. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* tag :: A 4-byte tag used to name the table. */
+ /* */
+ /* stream :: The input stream. */
+ /* */
+ /* <Output> */
+ /* length :: The length of the table in bytes. Set to 0 if not */
+ /* needed. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The stream cursor must be at the font file's origin. */
+ /* */
+ typedef FT_Error
+ (*TT_Loader_GotoTableFunc)( TT_Face face,
+ FT_ULong tag,
+ FT_Stream stream,
+ FT_ULong* length );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Loader_StartGlyphFunc */
+ /* */
+ /* <Description> */
+ /* Seeks a stream to the start of a given glyph element, and opens a */
+ /* frame for it. */
+ /* */
+ /* <Input> */
+ /* loader :: The current TrueType glyph loader object. */
+ /* */
+ /* glyph index :: The index of the glyph to access. */
+ /* */
+ /* offset :: The offset of the glyph according to the */
+ /* `locations' table. */
+ /* */
+ /* byte_count :: The size of the frame in bytes. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function is normally equivalent to FT_STREAM_SEEK(offset) */
+ /* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, */
+ /* but alternative formats (e.g. compressed ones) might use something */
+ /* different. */
+ /* */
+ typedef FT_Error
+ (*TT_Loader_StartGlyphFunc)( TT_Loader loader,
+ FT_UInt glyph_index,
+ FT_ULong offset,
+ FT_UInt byte_count );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Loader_ReadGlyphFunc */
+ /* */
+ /* <Description> */
+ /* Reads one glyph element (its header, a simple glyph, or a */
+ /* composite) from the loader's current stream frame. */
+ /* */
+ /* <Input> */
+ /* loader :: The current TrueType glyph loader object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ typedef FT_Error
+ (*TT_Loader_ReadGlyphFunc)( TT_Loader loader );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Loader_EndGlyphFunc */
+ /* */
+ /* <Description> */
+ /* Closes the current loader stream frame for the glyph. */
+ /* */
+ /* <Input> */
+ /* loader :: The current TrueType glyph loader object. */
+ /* */
+ typedef void
+ (*TT_Loader_EndGlyphFunc)( TT_Loader loader );
+
+
+ typedef enum TT_SbitTableType_
+ {
+ TT_SBIT_TABLE_TYPE_NONE = 0,
+ TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */
+ /* `bloc' (Apple) */
+ TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google) */
+ TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple) */
+
+ /* do not remove */
+ TT_SBIT_TABLE_TYPE_MAX
+
+ } TT_SbitTableType;
+
+
+ /*************************************************************************/
+ /* */
+ /* TrueType Face Type */
+ /* */
+ /* <Struct> */
+ /* TT_Face */
+ /* */
+ /* <Description> */
+ /* The TrueType face class. These objects model the resolution and */
+ /* point-size independent data found in a TrueType font file. */
+ /* */
+ /* <Fields> */
+ /* root :: The base FT_Face structure, managed by the */
+ /* base layer. */
+ /* */
+ /* ttc_header :: The TrueType collection header, used when */
+ /* the file is a `ttc' rather than a `ttf'. */
+ /* For ordinary font files, the field */
+ /* `ttc_header.count' is set to 0. */
+ /* */
+ /* format_tag :: The font format tag. */
+ /* */
+ /* num_tables :: The number of TrueType tables in this font */
+ /* file. */
+ /* */
+ /* dir_tables :: The directory of TrueType tables for this */
+ /* font file. */
+ /* */
+ /* header :: The font's font header (`head' table). */
+ /* Read on font opening. */
+ /* */
+ /* horizontal :: The font's horizontal header (`hhea' */
+ /* table). This field also contains the */
+ /* associated horizontal metrics table */
+ /* (`hmtx'). */
+ /* */
+ /* max_profile :: The font's maximum profile table. Read on */
+ /* font opening. Note that some maximum */
+ /* values cannot be taken directly from this */
+ /* table. We thus define additional fields */
+ /* below to hold the computed maxima. */
+ /* */
+ /* vertical_info :: A boolean which is set when the font file */
+ /* contains vertical metrics. If not, the */
+ /* value of the `vertical' field is */
+ /* undefined. */
+ /* */
+ /* vertical :: The font's vertical header (`vhea' table). */
+ /* This field also contains the associated */
+ /* vertical metrics table (`vmtx'), if found. */
+ /* IMPORTANT: The contents of this field is */
+ /* undefined if the `vertical_info' field is */
+ /* unset. */
+ /* */
+ /* num_names :: The number of name records within this */
+ /* TrueType font. */
+ /* */
+ /* name_table :: The table of name records (`name'). */
+ /* */
+ /* os2 :: The font's OS/2 table (`OS/2'). */
+ /* */
+ /* postscript :: The font's PostScript table (`post' */
+ /* table). The PostScript glyph names are */
+ /* not loaded by the driver on face opening. */
+ /* See the `ttpost' module for more details. */
+ /* */
+ /* cmap_table :: Address of the face's `cmap' SFNT table */
+ /* in memory (it's an extracted frame). */
+ /* */
+ /* cmap_size :: The size in bytes of the `cmap_table' */
+ /* described above. */
+ /* */
+ /* goto_table :: A function called by each TrueType table */
+ /* loader to position a stream's cursor to */
+ /* the start of a given table according to */
+ /* its tag. It defaults to TT_Goto_Face but */
+ /* can be different for strange formats (e.g. */
+ /* Type 42). */
+ /* */
+ /* access_glyph_frame :: A function used to access the frame of a */
+ /* given glyph within the face's font file. */
+ /* */
+ /* forget_glyph_frame :: A function used to forget the frame of a */
+ /* given glyph when all data has been loaded. */
+ /* */
+ /* read_glyph_header :: A function used to read a glyph header. */
+ /* It must be called between an `access' and */
+ /* `forget'. */
+ /* */
+ /* read_simple_glyph :: A function used to read a simple glyph. */
+ /* It must be called after the header was */
+ /* read, and before the `forget'. */
+ /* */
+ /* read_composite_glyph :: A function used to read a composite glyph. */
+ /* It must be called after the header was */
+ /* read, and before the `forget'. */
+ /* */
+ /* sfnt :: A pointer to the SFNT service. */
+ /* */
+ /* psnames :: A pointer to the PostScript names service. */
+ /* */
+ /* hdmx :: The face's horizontal device metrics */
+ /* (`hdmx' table). This table is optional in */
+ /* TrueType/OpenType fonts. */
+ /* */
+ /* gasp :: The grid-fitting and scaling properties */
+ /* table (`gasp'). This table is optional in */
+ /* TrueType/OpenType fonts. */
+ /* */
+ /* pclt :: The `pclt' SFNT table. */
+ /* */
+ /* num_sbit_scales :: The number of sbit scales for this font. */
+ /* */
+ /* sbit_scales :: Array of sbit scales embedded in this */
+ /* font. This table is optional in a */
+ /* TrueType/OpenType font. */
+ /* */
+ /* postscript_names :: A table used to store the Postscript names */
+ /* of the glyphs for this font. See the */
+ /* file `ttconfig.h' for comments on the */
+ /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
+ /* */
+ /* num_locations :: The number of glyph locations in this */
+ /* TrueType file. This should be */
+ /* identical to the number of glyphs. */
+ /* Ignored for Type 2 fonts. */
+ /* */
+ /* glyph_locations :: An array of longs. These are offsets to */
+ /* glyph data within the `glyf' table. */
+ /* Ignored for Type 2 font faces. */
+ /* */
+ /* glyf_len :: The length of the `glyf' table. Needed */
+ /* for malformed `loca' tables. */
+ /* */
+ /* font_program_size :: Size in bytecodes of the face's font */
+ /* program. 0 if none defined. Ignored for */
+ /* Type 2 fonts. */
+ /* */
+ /* font_program :: The face's font program (bytecode stream) */
+ /* executed at load time, also used during */
+ /* glyph rendering. Comes from the `fpgm' */
+ /* table. Ignored for Type 2 font fonts. */
+ /* */
+ /* cvt_program_size :: The size in bytecodes of the face's cvt */
+ /* program. Ignored for Type 2 fonts. */
+ /* */
+ /* cvt_program :: The face's cvt program (bytecode stream) */
+ /* executed each time an instance/size is */
+ /* changed/reset. Comes from the `prep' */
+ /* table. Ignored for Type 2 fonts. */
+ /* */
+ /* cvt_size :: Size of the control value table (in */
+ /* entries). Ignored for Type 2 fonts. */
+ /* */
+ /* cvt :: The face's original control value table. */
+ /* Coordinates are expressed in unscaled font */
+ /* units. Comes from the `cvt ' table. */
+ /* Ignored for Type 2 fonts. */
+ /* */
+ /* num_kern_pairs :: The number of kerning pairs present in the */
+ /* font file. The engine only loads the */
+ /* first horizontal format 0 kern table it */
+ /* finds in the font file. Ignored for */
+ /* Type 2 fonts. */
+ /* */
+ /* kern_table_index :: The index of the kerning table in the font */
+ /* kerning directory. Ignored for Type 2 */
+ /* fonts. */
+ /* */
+ /* interpreter :: A pointer to the TrueType bytecode */
+ /* interpreters field is also used to hook */
+ /* the debugger in `ttdebug'. */
+ /* */
+ /* unpatented_hinting :: If true, use only unpatented methods in */
+ /* the bytecode interpreter. */
+ /* */
+ /* doblend :: A boolean which is set if the font should */
+ /* be blended (this is for GX var). */
+ /* */
+ /* blend :: Contains the data needed to control GX */
+ /* variation tables (rather like Multiple */
+ /* Master data). */
+ /* */
+ /* extra :: Reserved for third-party font drivers. */
+ /* */
+ /* postscript_name :: The PS name of the font. Used by the */
+ /* postscript name service. */
+ /* */
+ typedef struct TT_FaceRec_
+ {
+ FT_FaceRec root;
+
+ TTC_HeaderRec ttc_header;
+
+ FT_ULong format_tag;
+ FT_UShort num_tables;
+ TT_Table dir_tables;
+
+ TT_Header header; /* TrueType header table */
+ TT_HoriHeader horizontal; /* TrueType horizontal header */
+
+ TT_MaxProfile max_profile;
+
+ FT_Bool vertical_info;
+ TT_VertHeader vertical; /* TT Vertical header, if present */
+
+ FT_UShort num_names; /* number of name records */
+ TT_NameTableRec name_table; /* name table */
+
+ TT_OS2 os2; /* TrueType OS/2 table */
+ TT_Postscript postscript; /* TrueType Postscript table */
+
+ FT_Byte* cmap_table; /* extracted `cmap' table */
+ FT_ULong cmap_size;
+
+ TT_Loader_GotoTableFunc goto_table;
+
+ TT_Loader_StartGlyphFunc access_glyph_frame;
+ TT_Loader_EndGlyphFunc forget_glyph_frame;
+ TT_Loader_ReadGlyphFunc read_glyph_header;
+ TT_Loader_ReadGlyphFunc read_simple_glyph;
+ TT_Loader_ReadGlyphFunc read_composite_glyph;
+
+ /* a typeless pointer to the SFNT_Interface table used to load */
+ /* the basic TrueType tables in the face object */
+ void* sfnt;
+
+ /* a typeless pointer to the FT_Service_PsCMapsRec table used to */
+ /* handle glyph names <-> unicode & Mac values */
+ void* psnames;
+
+
+ /***********************************************************************/
+ /* */
+ /* Optional TrueType/OpenType tables */
+ /* */
+ /***********************************************************************/
+
+ /* grid-fitting and scaling table */
+ TT_GaspRec gasp; /* the `gasp' table */
+
+ /* PCL 5 table */
+ TT_PCLT pclt;
+
+ /* embedded bitmaps support */
+ FT_ULong num_sbit_scales;
+ TT_SBit_Scale sbit_scales;
+
+ /* postscript names table */
+ TT_Post_NamesRec postscript_names;
+
+
+ /***********************************************************************/
+ /* */
+ /* TrueType-specific fields (ignored by the OTF-Type2 driver) */
+ /* */
+ /***********************************************************************/
+
+ /* the font program, if any */
+ FT_ULong font_program_size;
+ FT_Byte* font_program;
+
+ /* the cvt program, if any */
+ FT_ULong cvt_program_size;
+ FT_Byte* cvt_program;
+
+ /* the original, unscaled, control value table */
+ FT_ULong cvt_size;
+ FT_Short* cvt;
+
+ /* A pointer to the bytecode interpreter to use. This is also */
+ /* used to hook the debugger for the `ttdebug' utility. */
+ TT_Interpreter interpreter;
+
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
+ /* Use unpatented hinting only. */
+ FT_Bool unpatented_hinting;
+#endif
+
+ /***********************************************************************/
+ /* */
+ /* Other tables or fields. This is used by derivative formats like */
+ /* OpenType. */
+ /* */
+ /***********************************************************************/
+
+ FT_Generic extra;
+
+ const char* postscript_name;
+
+ FT_ULong glyf_len;
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_Bool doblend;
+ GX_Blend blend;
+#endif
+
+ /* since version 2.2 */
+
+ FT_Byte* horz_metrics;
+ FT_ULong horz_metrics_size;
+
+ FT_Byte* vert_metrics;
+ FT_ULong vert_metrics_size;
+
+ FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
+ FT_Byte* glyph_locations;
+
+ FT_Byte* hdmx_table;
+ FT_ULong hdmx_table_size;
+ FT_UInt hdmx_record_count;
+ FT_ULong hdmx_record_size;
+ FT_Byte* hdmx_record_sizes;
+
+ FT_Byte* sbit_table;
+ FT_ULong sbit_table_size;
+ TT_SbitTableType sbit_table_type;
+ FT_UInt sbit_num_strikes;
+
+ FT_Byte* kern_table;
+ FT_ULong kern_table_size;
+ FT_UInt num_kern_tables;
+ FT_UInt32 kern_avail_bits;
+ FT_UInt32 kern_order_bits;
+
+#ifdef TT_CONFIG_OPTION_BDF
+ TT_BDFRec bdf;
+#endif /* TT_CONFIG_OPTION_BDF */
+
+ /* since 2.3.0 */
+ FT_ULong horz_metrics_offset;
+ FT_ULong vert_metrics_offset;
+
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+ /* since 2.4.12 */
+ FT_ULong sph_found_func_flags; /* special functions found */
+ /* for this face */
+ FT_Bool sph_compatibility_mode;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+ } TT_FaceRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_GlyphZoneRec */
+ /* */
+ /* <Description> */
+ /* A glyph zone is used to load, scale and hint glyph outline */
+ /* coordinates. */
+ /* */
+ /* <Fields> */
+ /* memory :: A handle to the memory manager. */
+ /* */
+ /* max_points :: The maximum size in points of the zone. */
+ /* */
+ /* max_contours :: Max size in links contours of the zone. */
+ /* */
+ /* n_points :: The current number of points in the zone. */
+ /* */
+ /* n_contours :: The current number of contours in the zone. */
+ /* */
+ /* org :: The original glyph coordinates (font */
+ /* units/scaled). */
+ /* */
+ /* cur :: The current glyph coordinates (scaled/hinted). */
+ /* */
+ /* tags :: The point control tags. */
+ /* */
+ /* contours :: The contours end points. */
+ /* */
+ /* first_point :: Offset of the current subglyph's first point. */
+ /* */
+ typedef struct TT_GlyphZoneRec_
+ {
+ FT_Memory memory;
+ FT_UShort max_points;
+ FT_Short max_contours;
+ FT_UShort n_points; /* number of points in zone */
+ FT_Short n_contours; /* number of contours */
+
+ FT_Vector* org; /* original point coordinates */
+ FT_Vector* cur; /* current point coordinates */
+ FT_Vector* orus; /* original (unscaled) point coordinates */
+
+ FT_Byte* tags; /* current touch flags */
+ FT_UShort* contours; /* contour end points */
+
+ FT_UShort first_point; /* offset of first (#0) point */
+
+ } TT_GlyphZoneRec, *TT_GlyphZone;
+
+
+ /* handle to execution context */
+ typedef struct TT_ExecContextRec_* TT_ExecContext;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* TT_Size */
+ /* */
+ /* <Description> */
+ /* A handle to a TrueType size object. */
+ /* */
+ typedef struct TT_SizeRec_* TT_Size;
+
+
+ /* glyph loader structure */
+ typedef struct TT_LoaderRec_
+ {
+ TT_Face face;
+ TT_Size size;
+ FT_GlyphSlot glyph;
+ FT_GlyphLoader gloader;
+
+ FT_ULong load_flags;
+ FT_UInt glyph_index;
+
+ FT_Stream stream;
+ FT_Int byte_len;
+
+ FT_Short n_contours;
+ FT_BBox bbox;
+ FT_Int left_bearing;
+ FT_Int advance;
+ FT_Int linear;
+ FT_Bool linear_def;
+ FT_Vector pp1;
+ FT_Vector pp2;
+
+ FT_ULong glyf_offset;
+
+ /* the zone where we load our glyphs */
+ TT_GlyphZoneRec base;
+ TT_GlyphZoneRec zone;
+
+ TT_ExecContext exec;
+ FT_Byte* instructions;
+ FT_ULong ins_pos;
+
+ /* for possible extensibility in other formats */
+ void* other;
+
+ /* since version 2.1.8 */
+ FT_Int top_bearing;
+ FT_Int vadvance;
+ FT_Vector pp3;
+ FT_Vector pp4;
+
+ /* since version 2.2.1 */
+ FT_Byte* cursor;
+ FT_Byte* limit;
+
+ } TT_LoaderRec;
+
+
+FT_END_HEADER
+
+#endif /* __TTTYPES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/t1tables.h b/src/3rdparty/freetype/include/freetype/t1tables.h
new file mode 100644
index 0000000000..a6ea415af5
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/t1tables.h
@@ -0,0 +1,761 @@
+/***************************************************************************/
+/* */
+/* t1tables.h */
+/* */
+/* Basic Type 1/Type 2 tables definitions and interface (specification */
+/* only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __T1TABLES_H__
+#define __T1TABLES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* type1_tables */
+ /* */
+ /* <Title> */
+ /* Type 1 Tables */
+ /* */
+ /* <Abstract> */
+ /* Type~1 (PostScript) specific font tables. */
+ /* */
+ /* <Description> */
+ /* This section contains the definition of Type 1-specific tables, */
+ /* including structures related to other PostScript font formats. */
+ /* */
+ /* <Order> */
+ /* PS_FontInfoRec */
+ /* PS_FontInfo */
+ /* PS_PrivateRec */
+ /* PS_Private */
+ /* */
+ /* CID_FaceDictRec */
+ /* CID_FaceDict */
+ /* CID_FaceInfoRec */
+ /* CID_FaceInfo */
+ /* */
+ /* FT_Has_PS_Glyph_Names */
+ /* FT_Get_PS_Font_Info */
+ /* FT_Get_PS_Font_Private */
+ /* FT_Get_PS_Font_Value */
+ /* */
+ /* T1_Blend_Flags */
+ /* T1_EncodingType */
+ /* PS_Dict_Keys */
+ /* */
+ /*************************************************************************/
+
+
+ /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
+ /* structures in order to support Multiple Master fonts. */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_FontInfoRec */
+ /* */
+ /* <Description> */
+ /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
+ /* Note that for Multiple Master fonts, each instance has its own */
+ /* FontInfo dictionary. */
+ /* */
+ typedef struct PS_FontInfoRec_
+ {
+ FT_String* version;
+ FT_String* notice;
+ FT_String* full_name;
+ FT_String* family_name;
+ FT_String* weight;
+ FT_Long italic_angle;
+ FT_Bool is_fixed_pitch;
+ FT_Short underline_position;
+ FT_UShort underline_thickness;
+
+ } PS_FontInfoRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_FontInfo */
+ /* */
+ /* <Description> */
+ /* A handle to a @PS_FontInfoRec structure. */
+ /* */
+ typedef struct PS_FontInfoRec_* PS_FontInfo;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_FontInfo */
+ /* */
+ /* <Description> */
+ /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
+ /* kept to maintain source compatibility between various versions of */
+ /* FreeType. */
+ /* */
+ typedef PS_FontInfoRec T1_FontInfo;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_PrivateRec */
+ /* */
+ /* <Description> */
+ /* A structure used to model a Type~1 or Type~2 private dictionary. */
+ /* Note that for Multiple Master fonts, each instance has its own */
+ /* Private dictionary. */
+ /* */
+ typedef struct PS_PrivateRec_
+ {
+ FT_Int unique_id;
+ FT_Int lenIV;
+
+ FT_Byte num_blue_values;
+ FT_Byte num_other_blues;
+ FT_Byte num_family_blues;
+ FT_Byte num_family_other_blues;
+
+ FT_Short blue_values[14];
+ FT_Short other_blues[10];
+
+ FT_Short family_blues [14];
+ FT_Short family_other_blues[10];
+
+ FT_Fixed blue_scale;
+ FT_Int blue_shift;
+ FT_Int blue_fuzz;
+
+ FT_UShort standard_width[1];
+ FT_UShort standard_height[1];
+
+ FT_Byte num_snap_widths;
+ FT_Byte num_snap_heights;
+ FT_Bool force_bold;
+ FT_Bool round_stem_up;
+
+ FT_Short snap_widths [13]; /* including std width */
+ FT_Short snap_heights[13]; /* including std height */
+
+ FT_Fixed expansion_factor;
+
+ FT_Long language_group;
+ FT_Long password;
+
+ FT_Short min_feature[2];
+
+ } PS_PrivateRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* PS_Private */
+ /* */
+ /* <Description> */
+ /* A handle to a @PS_PrivateRec structure. */
+ /* */
+ typedef struct PS_PrivateRec_* PS_Private;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* T1_Private */
+ /* */
+ /* <Description> */
+ /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
+ /* kept to maintain source compatibility between various versions of */
+ /* FreeType. */
+ /* */
+ typedef PS_PrivateRec T1_Private;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* T1_Blend_Flags */
+ /* */
+ /* <Description> */
+ /* A set of flags used to indicate which fields are present in a */
+ /* given blend dictionary (font info or private). Used to support */
+ /* Multiple Masters fonts. */
+ /* */
+ /* <Values> */
+ /* T1_BLEND_UNDERLINE_POSITION :: */
+ /* T1_BLEND_UNDERLINE_THICKNESS :: */
+ /* T1_BLEND_ITALIC_ANGLE :: */
+ /* T1_BLEND_BLUE_VALUES :: */
+ /* T1_BLEND_OTHER_BLUES :: */
+ /* T1_BLEND_STANDARD_WIDTH :: */
+ /* T1_BLEND_STANDARD_HEIGHT :: */
+ /* T1_BLEND_STEM_SNAP_WIDTHS :: */
+ /* T1_BLEND_STEM_SNAP_HEIGHTS :: */
+ /* T1_BLEND_BLUE_SCALE :: */
+ /* T1_BLEND_BLUE_SHIFT :: */
+ /* T1_BLEND_FAMILY_BLUES :: */
+ /* T1_BLEND_FAMILY_OTHER_BLUES :: */
+ /* T1_BLEND_FORCE_BOLD :: */
+ /* */
+ typedef enum T1_Blend_Flags_
+ {
+ /* required fields in a FontInfo blend dictionary */
+ T1_BLEND_UNDERLINE_POSITION = 0,
+ T1_BLEND_UNDERLINE_THICKNESS,
+ T1_BLEND_ITALIC_ANGLE,
+
+ /* required fields in a Private blend dictionary */
+ T1_BLEND_BLUE_VALUES,
+ T1_BLEND_OTHER_BLUES,
+ T1_BLEND_STANDARD_WIDTH,
+ T1_BLEND_STANDARD_HEIGHT,
+ T1_BLEND_STEM_SNAP_WIDTHS,
+ T1_BLEND_STEM_SNAP_HEIGHTS,
+ T1_BLEND_BLUE_SCALE,
+ T1_BLEND_BLUE_SHIFT,
+ T1_BLEND_FAMILY_BLUES,
+ T1_BLEND_FAMILY_OTHER_BLUES,
+ T1_BLEND_FORCE_BOLD,
+
+ T1_BLEND_MAX /* do not remove */
+
+ } T1_Blend_Flags;
+
+
+ /* these constants are deprecated; use the corresponding */
+ /* `T1_Blend_Flags' values instead */
+#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
+#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
+#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
+#define t1_blend_blue_values T1_BLEND_BLUE_VALUES
+#define t1_blend_other_blues T1_BLEND_OTHER_BLUES
+#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
+#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
+#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
+#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
+#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
+#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
+#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
+#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
+#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
+#define t1_blend_max T1_BLEND_MAX
+
+ /* */
+
+
+ /* maximum number of Multiple Masters designs, as defined in the spec */
+#define T1_MAX_MM_DESIGNS 16
+
+ /* maximum number of Multiple Masters axes, as defined in the spec */
+#define T1_MAX_MM_AXIS 4
+
+ /* maximum number of elements in a design map */
+#define T1_MAX_MM_MAP_POINTS 20
+
+
+ /* this structure is used to store the BlendDesignMap entry for an axis */
+ typedef struct PS_DesignMap_
+ {
+ FT_Byte num_points;
+ FT_Long* design_points;
+ FT_Fixed* blend_points;
+
+ } PS_DesignMapRec, *PS_DesignMap;
+
+ /* backwards-compatible definition */
+ typedef PS_DesignMapRec T1_DesignMap;
+
+
+ typedef struct PS_BlendRec_
+ {
+ FT_UInt num_designs;
+ FT_UInt num_axis;
+
+ FT_String* axis_names[T1_MAX_MM_AXIS];
+ FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
+ PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
+
+ FT_Fixed* weight_vector;
+ FT_Fixed* default_weight_vector;
+
+ PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
+ PS_Private privates [T1_MAX_MM_DESIGNS + 1];
+
+ FT_ULong blend_bitflags;
+
+ FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
+
+ /* since 2.3.0 */
+
+ /* undocumented, optional: the default design instance; */
+ /* corresponds to default_weight_vector -- */
+ /* num_default_design_vector == 0 means it is not present */
+ /* in the font and associated metrics files */
+ FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
+ FT_UInt num_default_design_vector;
+
+ } PS_BlendRec, *PS_Blend;
+
+
+ /* backwards-compatible definition */
+ typedef PS_BlendRec T1_Blend;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CID_FaceDictRec */
+ /* */
+ /* <Description> */
+ /* A structure used to represent data in a CID top-level dictionary. */
+ /* */
+ typedef struct CID_FaceDictRec_
+ {
+ PS_PrivateRec private_dict;
+
+ FT_UInt len_buildchar;
+ FT_Fixed forcebold_threshold;
+ FT_Pos stroke_width;
+ FT_Fixed expansion_factor;
+
+ FT_Byte paint_type;
+ FT_Byte font_type;
+ FT_Matrix font_matrix;
+ FT_Vector font_offset;
+
+ FT_UInt num_subrs;
+ FT_ULong subrmap_offset;
+ FT_Int sd_bytes;
+
+ } CID_FaceDictRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CID_FaceDict */
+ /* */
+ /* <Description> */
+ /* A handle to a @CID_FaceDictRec structure. */
+ /* */
+ typedef struct CID_FaceDictRec_* CID_FaceDict;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CID_FontDict */
+ /* */
+ /* <Description> */
+ /* This type is equivalent to @CID_FaceDictRec. It is deprecated but */
+ /* kept to maintain source compatibility between various versions of */
+ /* FreeType. */
+ /* */
+ typedef CID_FaceDictRec CID_FontDict;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CID_FaceInfoRec */
+ /* */
+ /* <Description> */
+ /* A structure used to represent CID Face information. */
+ /* */
+ typedef struct CID_FaceInfoRec_
+ {
+ FT_String* cid_font_name;
+ FT_Fixed cid_version;
+ FT_Int cid_font_type;
+
+ FT_String* registry;
+ FT_String* ordering;
+ FT_Int supplement;
+
+ PS_FontInfoRec font_info;
+ FT_BBox font_bbox;
+ FT_ULong uid_base;
+
+ FT_Int num_xuid;
+ FT_ULong xuid[16];
+
+ FT_ULong cidmap_offset;
+ FT_Int fd_bytes;
+ FT_Int gd_bytes;
+ FT_ULong cid_count;
+
+ FT_Int num_dicts;
+ CID_FaceDict font_dicts;
+
+ FT_ULong data_offset;
+
+ } CID_FaceInfoRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CID_FaceInfo */
+ /* */
+ /* <Description> */
+ /* A handle to a @CID_FaceInfoRec structure. */
+ /* */
+ typedef struct CID_FaceInfoRec_* CID_FaceInfo;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CID_Info */
+ /* */
+ /* <Description> */
+ /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
+ /* kept to maintain source compatibility between various versions of */
+ /* FreeType. */
+ /* */
+ typedef CID_FaceInfoRec CID_Info;
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Has_PS_Glyph_Names
+ *
+ * @description:
+ * Return true if a given face provides reliable PostScript glyph
+ * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
+ * except that certain fonts (mostly TrueType) contain incorrect
+ * glyph name tables.
+ *
+ * When this function returns true, the caller is sure that the glyph
+ * names returned by @FT_Get_Glyph_Name are reliable.
+ *
+ * @input:
+ * face ::
+ * face handle
+ *
+ * @return:
+ * Boolean. True if glyph names are reliable.
+ *
+ */
+ FT_EXPORT( FT_Int )
+ FT_Has_PS_Glyph_Names( FT_Face face );
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Get_PS_Font_Info
+ *
+ * @description:
+ * Retrieve the @PS_FontInfoRec structure corresponding to a given
+ * PostScript font.
+ *
+ * @input:
+ * face ::
+ * PostScript face handle.
+ *
+ * @output:
+ * afont_info ::
+ * Output font info structure pointer.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * String pointers within the @PS_FontInfoRec structure are owned by
+ * the face and don't need to be freed by the caller. Missing entries
+ * in the font's FontInfo dictionary are represented by NULL pointers.
+ *
+ * If the font's format is not PostScript-based, this function will
+ * return the `FT_Err_Invalid_Argument' error code.
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_PS_Font_Info( FT_Face face,
+ PS_FontInfo afont_info );
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Get_PS_Font_Private
+ *
+ * @description:
+ * Retrieve the @PS_PrivateRec structure corresponding to a given
+ * PostScript font.
+ *
+ * @input:
+ * face ::
+ * PostScript face handle.
+ *
+ * @output:
+ * afont_private ::
+ * Output private dictionary structure pointer.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The string pointers within the @PS_PrivateRec structure are owned by
+ * the face and don't need to be freed by the caller.
+ *
+ * If the font's format is not PostScript-based, this function returns
+ * the `FT_Err_Invalid_Argument' error code.
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_PS_Font_Private( FT_Face face,
+ PS_Private afont_private );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* T1_EncodingType */
+ /* */
+ /* <Description> */
+ /* An enumeration describing the `Encoding' entry in a Type 1 */
+ /* dictionary. */
+ /* */
+ /* <Values> */
+ /* T1_ENCODING_TYPE_NONE :: */
+ /* T1_ENCODING_TYPE_ARRAY :: */
+ /* T1_ENCODING_TYPE_STANDARD :: */
+ /* T1_ENCODING_TYPE_ISOLATIN1 :: */
+ /* T1_ENCODING_TYPE_EXPERT :: */
+ /* */
+ typedef enum T1_EncodingType_
+ {
+ T1_ENCODING_TYPE_NONE = 0,
+ T1_ENCODING_TYPE_ARRAY,
+ T1_ENCODING_TYPE_STANDARD,
+ T1_ENCODING_TYPE_ISOLATIN1,
+ T1_ENCODING_TYPE_EXPERT
+
+ } T1_EncodingType;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* PS_Dict_Keys */
+ /* */
+ /* <Description> */
+ /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
+ /* the Type~1 dictionary entry to retrieve. */
+ /* */
+ /* <Values> */
+ /* PS_DICT_FONT_TYPE :: */
+ /* PS_DICT_FONT_MATRIX :: */
+ /* PS_DICT_FONT_BBOX :: */
+ /* PS_DICT_PAINT_TYPE :: */
+ /* PS_DICT_FONT_NAME :: */
+ /* PS_DICT_UNIQUE_ID :: */
+ /* PS_DICT_NUM_CHAR_STRINGS :: */
+ /* PS_DICT_CHAR_STRING_KEY :: */
+ /* PS_DICT_CHAR_STRING :: */
+ /* PS_DICT_ENCODING_TYPE :: */
+ /* PS_DICT_ENCODING_ENTRY :: */
+ /* PS_DICT_NUM_SUBRS :: */
+ /* PS_DICT_SUBR :: */
+ /* PS_DICT_STD_HW :: */
+ /* PS_DICT_STD_VW :: */
+ /* PS_DICT_NUM_BLUE_VALUES :: */
+ /* PS_DICT_BLUE_VALUE :: */
+ /* PS_DICT_BLUE_FUZZ :: */
+ /* PS_DICT_NUM_OTHER_BLUES :: */
+ /* PS_DICT_OTHER_BLUE :: */
+ /* PS_DICT_NUM_FAMILY_BLUES :: */
+ /* PS_DICT_FAMILY_BLUE :: */
+ /* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */
+ /* PS_DICT_FAMILY_OTHER_BLUE :: */
+ /* PS_DICT_BLUE_SCALE :: */
+ /* PS_DICT_BLUE_SHIFT :: */
+ /* PS_DICT_NUM_STEM_SNAP_H :: */
+ /* PS_DICT_STEM_SNAP_H :: */
+ /* PS_DICT_NUM_STEM_SNAP_V :: */
+ /* PS_DICT_STEM_SNAP_V :: */
+ /* PS_DICT_FORCE_BOLD :: */
+ /* PS_DICT_RND_STEM_UP :: */
+ /* PS_DICT_MIN_FEATURE :: */
+ /* PS_DICT_LEN_IV :: */
+ /* PS_DICT_PASSWORD :: */
+ /* PS_DICT_LANGUAGE_GROUP :: */
+ /* PS_DICT_VERSION :: */
+ /* PS_DICT_NOTICE :: */
+ /* PS_DICT_FULL_NAME :: */
+ /* PS_DICT_FAMILY_NAME :: */
+ /* PS_DICT_WEIGHT :: */
+ /* PS_DICT_IS_FIXED_PITCH :: */
+ /* PS_DICT_UNDERLINE_POSITION :: */
+ /* PS_DICT_UNDERLINE_THICKNESS :: */
+ /* PS_DICT_FS_TYPE :: */
+ /* PS_DICT_ITALIC_ANGLE :: */
+ /* */
+ typedef enum PS_Dict_Keys_
+ {
+ /* conventionally in the font dictionary */
+ PS_DICT_FONT_TYPE, /* FT_Byte */
+ PS_DICT_FONT_MATRIX, /* FT_Fixed */
+ PS_DICT_FONT_BBOX, /* FT_Fixed */
+ PS_DICT_PAINT_TYPE, /* FT_Byte */
+ PS_DICT_FONT_NAME, /* FT_String* */
+ PS_DICT_UNIQUE_ID, /* FT_Int */
+ PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */
+ PS_DICT_CHAR_STRING_KEY, /* FT_String* */
+ PS_DICT_CHAR_STRING, /* FT_String* */
+ PS_DICT_ENCODING_TYPE, /* T1_EncodingType */
+ PS_DICT_ENCODING_ENTRY, /* FT_String* */
+
+ /* conventionally in the font Private dictionary */
+ PS_DICT_NUM_SUBRS, /* FT_Int */
+ PS_DICT_SUBR, /* FT_String* */
+ PS_DICT_STD_HW, /* FT_UShort */
+ PS_DICT_STD_VW, /* FT_UShort */
+ PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */
+ PS_DICT_BLUE_VALUE, /* FT_Short */
+ PS_DICT_BLUE_FUZZ, /* FT_Int */
+ PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */
+ PS_DICT_OTHER_BLUE, /* FT_Short */
+ PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */
+ PS_DICT_FAMILY_BLUE, /* FT_Short */
+ PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */
+ PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */
+ PS_DICT_BLUE_SCALE, /* FT_Fixed */
+ PS_DICT_BLUE_SHIFT, /* FT_Int */
+ PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */
+ PS_DICT_STEM_SNAP_H, /* FT_Short */
+ PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */
+ PS_DICT_STEM_SNAP_V, /* FT_Short */
+ PS_DICT_FORCE_BOLD, /* FT_Bool */
+ PS_DICT_RND_STEM_UP, /* FT_Bool */
+ PS_DICT_MIN_FEATURE, /* FT_Short */
+ PS_DICT_LEN_IV, /* FT_Int */
+ PS_DICT_PASSWORD, /* FT_Long */
+ PS_DICT_LANGUAGE_GROUP, /* FT_Long */
+
+ /* conventionally in the font FontInfo dictionary */
+ PS_DICT_VERSION, /* FT_String* */
+ PS_DICT_NOTICE, /* FT_String* */
+ PS_DICT_FULL_NAME, /* FT_String* */
+ PS_DICT_FAMILY_NAME, /* FT_String* */
+ PS_DICT_WEIGHT, /* FT_String* */
+ PS_DICT_IS_FIXED_PITCH, /* FT_Bool */
+ PS_DICT_UNDERLINE_POSITION, /* FT_Short */
+ PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
+ PS_DICT_FS_TYPE, /* FT_UShort */
+ PS_DICT_ITALIC_ANGLE, /* FT_Long */
+
+ PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
+
+ } PS_Dict_Keys;
+
+
+ /************************************************************************
+ *
+ * @function:
+ * FT_Get_PS_Font_Value
+ *
+ * @description:
+ * Retrieve the value for the supplied key from a PostScript font.
+ *
+ * @input:
+ * face ::
+ * PostScript face handle.
+ *
+ * key ::
+ * An enumeration value representing the dictionary key to retrieve.
+ *
+ * idx ::
+ * For array values, this specifies the index to be returned.
+ *
+ * value ::
+ * A pointer to memory into which to write the value.
+ *
+ * valen_len ::
+ * The size, in bytes, of the memory supplied for the value.
+ *
+ * @output:
+ * value ::
+ * The value matching the above key, if it exists.
+ *
+ * @return:
+ * The amount of memory (in bytes) required to hold the requested
+ * value (if it exists, -1 otherwise).
+ *
+ * @note:
+ * The values returned are not pointers into the internal structures of
+ * the face, but are `fresh' copies, so that the memory containing them
+ * belongs to the calling application. This also enforces the
+ * `read-only' nature of these values, i.e., this function cannot be
+ * used to manipulate the face.
+ *
+ * `value' is a void pointer because the values returned can be of
+ * various types.
+ *
+ * If either `value' is NULL or `value_len' is too small, just the
+ * required memory size for the requested entry is returned.
+ *
+ * The `idx' parameter is used, not only to retrieve elements of, for
+ * example, the FontMatrix or FontBBox, but also to retrieve name keys
+ * from the CharStrings dictionary, and the charstrings themselves. It
+ * is ignored for atomic values.
+ *
+ * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
+ * get the value as in the font stream, you need to divide by
+ * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
+ *
+ * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
+ * be retrieved. So, for example, PostScript procedures such as NP,
+ * ND, and RD are not available. Arbitrary keys are, obviously, not be
+ * available either.
+ *
+ * If the font's format is not PostScript-based, this function returns
+ * the `FT_Err_Invalid_Argument' error code.
+ *
+ */
+ FT_EXPORT( FT_Long )
+ FT_Get_PS_Font_Value( FT_Face face,
+ PS_Dict_Keys key,
+ FT_UInt idx,
+ void *value,
+ FT_Long value_len );
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __T1TABLES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ttnameid.h b/src/3rdparty/freetype/include/freetype/ttnameid.h
new file mode 100644
index 0000000000..c9585f2413
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ttnameid.h
@@ -0,0 +1,1237 @@
+/***************************************************************************/
+/* */
+/* ttnameid.h */
+/* */
+/* TrueType name ID definitions (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __TTNAMEID_H__
+#define __TTNAMEID_H__
+
+
+#include <ft2build.h>
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* truetype_tables */
+ /* */
+
+
+ /*************************************************************************/
+ /* */
+ /* Possible values for the `platform' identifier code in the name */
+ /* records of the TTF `name' table. */
+ /* */
+ /*************************************************************************/
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_PLATFORM_XXX
+ *
+ * @description:
+ * A list of valid values for the `platform_id' identifier code in
+ * @FT_CharMapRec and @FT_SfntName structures.
+ *
+ * @values:
+ * TT_PLATFORM_APPLE_UNICODE ::
+ * Used by Apple to indicate a Unicode character map and/or name entry.
+ * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note
+ * that name entries in this format are coded as big-endian UCS-2
+ * character codes _only_.
+ *
+ * TT_PLATFORM_MACINTOSH ::
+ * Used by Apple to indicate a MacOS-specific charmap and/or name entry.
+ * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that
+ * most TrueType fonts contain an Apple roman charmap to be usable on
+ * MacOS systems (even if they contain a Microsoft charmap as well).
+ *
+ * TT_PLATFORM_ISO ::
+ * This value was used to specify ISO/IEC 10646 charmaps. It is however
+ * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
+ * `encoding_id' values.
+ *
+ * TT_PLATFORM_MICROSOFT ::
+ * Used by Microsoft to indicate Windows-specific charmaps. See
+ * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
+ * Note that most fonts contain a Unicode charmap using
+ * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
+ *
+ * TT_PLATFORM_CUSTOM ::
+ * Used to indicate application-specific charmaps.
+ *
+ * TT_PLATFORM_ADOBE ::
+ * This value isn't part of any font format specification, but is used
+ * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec
+ * structure. See @TT_ADOBE_ID_XXX.
+ */
+
+#define TT_PLATFORM_APPLE_UNICODE 0
+#define TT_PLATFORM_MACINTOSH 1
+#define TT_PLATFORM_ISO 2 /* deprecated */
+#define TT_PLATFORM_MICROSOFT 3
+#define TT_PLATFORM_CUSTOM 4
+#define TT_PLATFORM_ADOBE 7 /* artificial */
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_APPLE_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
+ *
+ * @values:
+ * TT_APPLE_ID_DEFAULT ::
+ * Unicode version 1.0.
+ *
+ * TT_APPLE_ID_UNICODE_1_1 ::
+ * Unicode 1.1; specifies Hangul characters starting at U+34xx.
+ *
+ * TT_APPLE_ID_ISO_10646 ::
+ * Deprecated (identical to preceding).
+ *
+ * TT_APPLE_ID_UNICODE_2_0 ::
+ * Unicode 2.0 and beyond (UTF-16 BMP only).
+ *
+ * TT_APPLE_ID_UNICODE_32 ::
+ * Unicode 3.1 and beyond, using UTF-32.
+ *
+ * TT_APPLE_ID_VARIANT_SELECTOR ::
+ * From Adobe, not Apple. Not a normal cmap. Specifies variations
+ * on a real cmap.
+ */
+
+#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
+#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
+#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
+#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
+#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */
+#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_MAC_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_MACINTOSH charmaps and name entries.
+ *
+ * @values:
+ * TT_MAC_ID_ROMAN ::
+ * TT_MAC_ID_JAPANESE ::
+ * TT_MAC_ID_TRADITIONAL_CHINESE ::
+ * TT_MAC_ID_KOREAN ::
+ * TT_MAC_ID_ARABIC ::
+ * TT_MAC_ID_HEBREW ::
+ * TT_MAC_ID_GREEK ::
+ * TT_MAC_ID_RUSSIAN ::
+ * TT_MAC_ID_RSYMBOL ::
+ * TT_MAC_ID_DEVANAGARI ::
+ * TT_MAC_ID_GURMUKHI ::
+ * TT_MAC_ID_GUJARATI ::
+ * TT_MAC_ID_ORIYA ::
+ * TT_MAC_ID_BENGALI ::
+ * TT_MAC_ID_TAMIL ::
+ * TT_MAC_ID_TELUGU ::
+ * TT_MAC_ID_KANNADA ::
+ * TT_MAC_ID_MALAYALAM ::
+ * TT_MAC_ID_SINHALESE ::
+ * TT_MAC_ID_BURMESE ::
+ * TT_MAC_ID_KHMER ::
+ * TT_MAC_ID_THAI ::
+ * TT_MAC_ID_LAOTIAN ::
+ * TT_MAC_ID_GEORGIAN ::
+ * TT_MAC_ID_ARMENIAN ::
+ * TT_MAC_ID_MALDIVIAN ::
+ * TT_MAC_ID_SIMPLIFIED_CHINESE ::
+ * TT_MAC_ID_TIBETAN ::
+ * TT_MAC_ID_MONGOLIAN ::
+ * TT_MAC_ID_GEEZ ::
+ * TT_MAC_ID_SLAVIC ::
+ * TT_MAC_ID_VIETNAMESE ::
+ * TT_MAC_ID_SINDHI ::
+ * TT_MAC_ID_UNINTERP ::
+ */
+
+#define TT_MAC_ID_ROMAN 0
+#define TT_MAC_ID_JAPANESE 1
+#define TT_MAC_ID_TRADITIONAL_CHINESE 2
+#define TT_MAC_ID_KOREAN 3
+#define TT_MAC_ID_ARABIC 4
+#define TT_MAC_ID_HEBREW 5
+#define TT_MAC_ID_GREEK 6
+#define TT_MAC_ID_RUSSIAN 7
+#define TT_MAC_ID_RSYMBOL 8
+#define TT_MAC_ID_DEVANAGARI 9
+#define TT_MAC_ID_GURMUKHI 10
+#define TT_MAC_ID_GUJARATI 11
+#define TT_MAC_ID_ORIYA 12
+#define TT_MAC_ID_BENGALI 13
+#define TT_MAC_ID_TAMIL 14
+#define TT_MAC_ID_TELUGU 15
+#define TT_MAC_ID_KANNADA 16
+#define TT_MAC_ID_MALAYALAM 17
+#define TT_MAC_ID_SINHALESE 18
+#define TT_MAC_ID_BURMESE 19
+#define TT_MAC_ID_KHMER 20
+#define TT_MAC_ID_THAI 21
+#define TT_MAC_ID_LAOTIAN 22
+#define TT_MAC_ID_GEORGIAN 23
+#define TT_MAC_ID_ARMENIAN 24
+#define TT_MAC_ID_MALDIVIAN 25
+#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
+#define TT_MAC_ID_TIBETAN 26
+#define TT_MAC_ID_MONGOLIAN 27
+#define TT_MAC_ID_GEEZ 28
+#define TT_MAC_ID_SLAVIC 29
+#define TT_MAC_ID_VIETNAMESE 30
+#define TT_MAC_ID_SINDHI 31
+#define TT_MAC_ID_UNINTERP 32
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_ISO_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_ISO charmaps and name entries.
+ *
+ * Their use is now deprecated.
+ *
+ * @values:
+ * TT_ISO_ID_7BIT_ASCII ::
+ * ASCII.
+ * TT_ISO_ID_10646 ::
+ * ISO/10646.
+ * TT_ISO_ID_8859_1 ::
+ * Also known as Latin-1.
+ */
+
+#define TT_ISO_ID_7BIT_ASCII 0
+#define TT_ISO_ID_10646 1
+#define TT_ISO_ID_8859_1 2
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_MS_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_MICROSOFT charmaps and name entries.
+ *
+ * @values:
+ * TT_MS_ID_SYMBOL_CS ::
+ * Corresponds to Microsoft symbol encoding. See
+ * @FT_ENCODING_MS_SYMBOL.
+ *
+ * TT_MS_ID_UNICODE_CS ::
+ * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See
+ * @FT_ENCODING_UNICODE.
+ *
+ * TT_MS_ID_SJIS ::
+ * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS.
+ *
+ * TT_MS_ID_GB2312 ::
+ * Corresponds to Simplified Chinese as used in Mainland China. See
+ * @FT_ENCODING_GB2312.
+ *
+ * TT_MS_ID_BIG_5 ::
+ * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
+ * See @FT_ENCODING_BIG5.
+ *
+ * TT_MS_ID_WANSUNG ::
+ * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG.
+ *
+ * TT_MS_ID_JOHAB ::
+ * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB.
+ *
+ * TT_MS_ID_UCS_4 ::
+ * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to
+ * the OpenType specification version 1.4 (mid-2001.)
+ */
+
+#define TT_MS_ID_SYMBOL_CS 0
+#define TT_MS_ID_UNICODE_CS 1
+#define TT_MS_ID_SJIS 2
+#define TT_MS_ID_GB2312 3
+#define TT_MS_ID_BIG_5 4
+#define TT_MS_ID_WANSUNG 5
+#define TT_MS_ID_JOHAB 6
+#define TT_MS_ID_UCS_4 10
+
+
+ /***********************************************************************
+ *
+ * @enum:
+ * TT_ADOBE_ID_XXX
+ *
+ * @description:
+ * A list of valid values for the `encoding_id' for
+ * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!
+ *
+ * @values:
+ * TT_ADOBE_ID_STANDARD ::
+ * Adobe standard encoding.
+ * TT_ADOBE_ID_EXPERT ::
+ * Adobe expert encoding.
+ * TT_ADOBE_ID_CUSTOM ::
+ * Adobe custom encoding.
+ * TT_ADOBE_ID_LATIN_1 ::
+ * Adobe Latin~1 encoding.
+ */
+
+#define TT_ADOBE_ID_STANDARD 0
+#define TT_ADOBE_ID_EXPERT 1
+#define TT_ADOBE_ID_CUSTOM 2
+#define TT_ADOBE_ID_LATIN_1 3
+
+
+ /*************************************************************************/
+ /* */
+ /* Possible values of the language identifier field in the name records */
+ /* of the TTF `name' table if the `platform' identifier code is */
+ /* TT_PLATFORM_MACINTOSH. These values are also used as return values */
+ /* for function @FT_Get_CMap_Language_ID. */
+ /* */
+ /* The canonical source for the Apple assigned Language ID's is at */
+ /* */
+ /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html */
+ /* */
+#define TT_MAC_LANGID_ENGLISH 0
+#define TT_MAC_LANGID_FRENCH 1
+#define TT_MAC_LANGID_GERMAN 2
+#define TT_MAC_LANGID_ITALIAN 3
+#define TT_MAC_LANGID_DUTCH 4
+#define TT_MAC_LANGID_SWEDISH 5
+#define TT_MAC_LANGID_SPANISH 6
+#define TT_MAC_LANGID_DANISH 7
+#define TT_MAC_LANGID_PORTUGUESE 8
+#define TT_MAC_LANGID_NORWEGIAN 9
+#define TT_MAC_LANGID_HEBREW 10
+#define TT_MAC_LANGID_JAPANESE 11
+#define TT_MAC_LANGID_ARABIC 12
+#define TT_MAC_LANGID_FINNISH 13
+#define TT_MAC_LANGID_GREEK 14
+#define TT_MAC_LANGID_ICELANDIC 15
+#define TT_MAC_LANGID_MALTESE 16
+#define TT_MAC_LANGID_TURKISH 17
+#define TT_MAC_LANGID_CROATIAN 18
+#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
+#define TT_MAC_LANGID_URDU 20
+#define TT_MAC_LANGID_HINDI 21
+#define TT_MAC_LANGID_THAI 22
+#define TT_MAC_LANGID_KOREAN 23
+#define TT_MAC_LANGID_LITHUANIAN 24
+#define TT_MAC_LANGID_POLISH 25
+#define TT_MAC_LANGID_HUNGARIAN 26
+#define TT_MAC_LANGID_ESTONIAN 27
+#define TT_MAC_LANGID_LETTISH 28
+#define TT_MAC_LANGID_SAAMISK 29
+#define TT_MAC_LANGID_FAEROESE 30
+#define TT_MAC_LANGID_FARSI 31
+#define TT_MAC_LANGID_RUSSIAN 32
+#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
+#define TT_MAC_LANGID_FLEMISH 34
+#define TT_MAC_LANGID_IRISH 35
+#define TT_MAC_LANGID_ALBANIAN 36
+#define TT_MAC_LANGID_ROMANIAN 37
+#define TT_MAC_LANGID_CZECH 38
+#define TT_MAC_LANGID_SLOVAK 39
+#define TT_MAC_LANGID_SLOVENIAN 40
+#define TT_MAC_LANGID_YIDDISH 41
+#define TT_MAC_LANGID_SERBIAN 42
+#define TT_MAC_LANGID_MACEDONIAN 43
+#define TT_MAC_LANGID_BULGARIAN 44
+#define TT_MAC_LANGID_UKRAINIAN 45
+#define TT_MAC_LANGID_BYELORUSSIAN 46
+#define TT_MAC_LANGID_UZBEK 47
+#define TT_MAC_LANGID_KAZAKH 48
+#define TT_MAC_LANGID_AZERBAIJANI 49
+#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49
+#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
+#define TT_MAC_LANGID_ARMENIAN 51
+#define TT_MAC_LANGID_GEORGIAN 52
+#define TT_MAC_LANGID_MOLDAVIAN 53
+#define TT_MAC_LANGID_KIRGHIZ 54
+#define TT_MAC_LANGID_TAJIKI 55
+#define TT_MAC_LANGID_TURKMEN 56
+#define TT_MAC_LANGID_MONGOLIAN 57
+#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57
+#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
+#define TT_MAC_LANGID_PASHTO 59
+#define TT_MAC_LANGID_KURDISH 60
+#define TT_MAC_LANGID_KASHMIRI 61
+#define TT_MAC_LANGID_SINDHI 62
+#define TT_MAC_LANGID_TIBETAN 63
+#define TT_MAC_LANGID_NEPALI 64
+#define TT_MAC_LANGID_SANSKRIT 65
+#define TT_MAC_LANGID_MARATHI 66
+#define TT_MAC_LANGID_BENGALI 67
+#define TT_MAC_LANGID_ASSAMESE 68
+#define TT_MAC_LANGID_GUJARATI 69
+#define TT_MAC_LANGID_PUNJABI 70
+#define TT_MAC_LANGID_ORIYA 71
+#define TT_MAC_LANGID_MALAYALAM 72
+#define TT_MAC_LANGID_KANNADA 73
+#define TT_MAC_LANGID_TAMIL 74
+#define TT_MAC_LANGID_TELUGU 75
+#define TT_MAC_LANGID_SINHALESE 76
+#define TT_MAC_LANGID_BURMESE 77
+#define TT_MAC_LANGID_KHMER 78
+#define TT_MAC_LANGID_LAO 79
+#define TT_MAC_LANGID_VIETNAMESE 80
+#define TT_MAC_LANGID_INDONESIAN 81
+#define TT_MAC_LANGID_TAGALOG 82
+#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
+#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
+#define TT_MAC_LANGID_AMHARIC 85
+#define TT_MAC_LANGID_TIGRINYA 86
+#define TT_MAC_LANGID_GALLA 87
+#define TT_MAC_LANGID_SOMALI 88
+#define TT_MAC_LANGID_SWAHILI 89
+#define TT_MAC_LANGID_RUANDA 90
+#define TT_MAC_LANGID_RUNDI 91
+#define TT_MAC_LANGID_CHEWA 92
+#define TT_MAC_LANGID_MALAGASY 93
+#define TT_MAC_LANGID_ESPERANTO 94
+#define TT_MAC_LANGID_WELSH 128
+#define TT_MAC_LANGID_BASQUE 129
+#define TT_MAC_LANGID_CATALAN 130
+#define TT_MAC_LANGID_LATIN 131
+#define TT_MAC_LANGID_QUECHUA 132
+#define TT_MAC_LANGID_GUARANI 133
+#define TT_MAC_LANGID_AYMARA 134
+#define TT_MAC_LANGID_TATAR 135
+#define TT_MAC_LANGID_UIGHUR 136
+#define TT_MAC_LANGID_DZONGKHA 137
+#define TT_MAC_LANGID_JAVANESE 138
+#define TT_MAC_LANGID_SUNDANESE 139
+
+
+#if 0 /* these seem to be errors that have been dropped */
+
+#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
+#define TT_MAC_LANGID_IRISH_GAELIC 141
+
+#endif
+
+
+ /* The following codes are new as of 2000-03-10 */
+#define TT_MAC_LANGID_GALICIAN 140
+#define TT_MAC_LANGID_AFRIKAANS 141
+#define TT_MAC_LANGID_BRETON 142
+#define TT_MAC_LANGID_INUKTITUT 143
+#define TT_MAC_LANGID_SCOTTISH_GAELIC 144
+#define TT_MAC_LANGID_MANX_GAELIC 145
+#define TT_MAC_LANGID_IRISH_GAELIC 146
+#define TT_MAC_LANGID_TONGAN 147
+#define TT_MAC_LANGID_GREEK_POLYTONIC 148
+#define TT_MAC_LANGID_GREELANDIC 149
+#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
+
+
+ /*************************************************************************/
+ /* */
+ /* Possible values of the language identifier field in the name records */
+ /* of the TTF `name' table if the `platform' identifier code is */
+ /* TT_PLATFORM_MICROSOFT. */
+ /* */
+ /* The canonical source for the MS assigned LCIDs is */
+ /* */
+ /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */
+ /* */
+
+#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
+#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
+#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
+#define TT_MS_LANGID_ARABIC_EGYPT 0x0C01
+#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
+#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
+#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
+#define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01
+#define TT_MS_LANGID_ARABIC_OMAN 0x2001
+#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
+#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
+#define TT_MS_LANGID_ARABIC_JORDAN 0x2C01
+#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
+#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
+#define TT_MS_LANGID_ARABIC_UAE 0x3801
+#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01
+#define TT_MS_LANGID_ARABIC_QATAR 0x4001
+#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
+#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
+#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
+#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
+#define TT_MS_LANGID_CHINESE_PRC 0x0804
+#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04
+#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
+
+#if 1 /* this looks like the correct value */
+#define TT_MS_LANGID_CHINESE_MACAU 0x1404
+#else /* but beware, Microsoft may change its mind...
+ the most recent Word reference has the following: */
+#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
+#endif
+
+#if 0 /* used only with .NET `cultures'; commented out */
+#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
+#endif
+
+#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
+#define TT_MS_LANGID_DANISH_DENMARK 0x0406
+#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
+#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
+#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07
+#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
+#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
+#define TT_MS_LANGID_GREEK_GREECE 0x0408
+
+ /* don't ask what this one means... It is commented out currently. */
+#if 0
+#define TT_MS_LANGID_GREEK_GREECE2 0x2008
+#endif
+
+#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
+#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
+#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
+#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09
+#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
+#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
+#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
+#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09
+#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
+#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
+#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
+#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09
+#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
+#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
+#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
+#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09
+#define TT_MS_LANGID_ENGLISH_INDIA 0x4009
+#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409
+#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809
+#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A
+#define TT_MS_LANGID_SPANISH_MEXICO 0x080A
+#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0C0A
+#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A
+#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A
+#define TT_MS_LANGID_SPANISH_PANAMA 0x180A
+#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A
+#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A
+#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A
+#define TT_MS_LANGID_SPANISH_PERU 0x280A
+#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A
+#define TT_MS_LANGID_SPANISH_ECUADOR 0x300A
+#define TT_MS_LANGID_SPANISH_CHILE 0x340A
+#define TT_MS_LANGID_SPANISH_URUGUAY 0x380A
+#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A
+#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A
+#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A
+#define TT_MS_LANGID_SPANISH_HONDURAS 0x480A
+#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A
+#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A
+#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A
+ /* The following ID blatantly violate MS specs by using a */
+ /* sublanguage > 0x1F. */
+#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU
+#define TT_MS_LANGID_FINNISH_FINLAND 0x040B
+#define TT_MS_LANGID_FRENCH_FRANCE 0x040C
+#define TT_MS_LANGID_FRENCH_BELGIUM 0x080C
+#define TT_MS_LANGID_FRENCH_CANADA 0x0C0C
+#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C
+#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C
+#define TT_MS_LANGID_FRENCH_MONACO 0x180C
+#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C
+#define TT_MS_LANGID_FRENCH_REUNION 0x200C
+#define TT_MS_LANGID_FRENCH_CONGO 0x240C
+ /* which was formerly: */
+#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
+#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C
+#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C
+#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C
+#define TT_MS_LANGID_FRENCH_MALI 0x340C
+#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C
+#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C
+ /* and another violation of the spec (see 0xE40AU) */
+#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU
+#define TT_MS_LANGID_HEBREW_ISRAEL 0x040D
+#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E
+#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F
+#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
+#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
+#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
+#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
+#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
+#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
+#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
+#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
+#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
+#define TT_MS_LANGID_POLISH_POLAND 0x0415
+#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
+#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
+#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
+#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
+#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
+#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
+#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
+#define TT_MS_LANGID_CROATIAN_CROATIA 0x041A
+#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A
+#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A
+
+#if 0 /* this used to be this value, but it looks like we were wrong */
+#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101A
+#else /* current sources say */
+#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A
+#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A
+ /* and XPsp2 Platform SDK added (2004-07-26) */
+ /* Names are shortened to be significant within 40 chars. */
+#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A
+#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181A
+#endif
+
+#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B
+#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C
+#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D
+#define TT_MS_LANGID_SWEDISH_FINLAND 0x081D
+#define TT_MS_LANGID_THAI_THAILAND 0x041E
+#define TT_MS_LANGID_TURKISH_TURKEY 0x041F
+#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
+#define TT_MS_LANGID_URDU_INDIA 0x0820
+#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
+#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
+#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
+#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
+#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
+#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
+#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
+#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
+#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428
+#define TT_MS_LANGID_FARSI_IRAN 0x0429
+#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A
+#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B
+#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C
+#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C
+#define TT_MS_LANGID_BASQUE_SPAIN 0x042D
+#define TT_MS_LANGID_SORBIAN_GERMANY 0x042E
+#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F
+#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
+#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
+#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
+#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
+#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
+#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
+#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
+#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
+#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
+#define TT_MS_LANGID_HINDI_INDIA 0x0439
+#define TT_MS_LANGID_MALTESE_MALTA 0x043A
+ /* Added by XPsp2 Platform SDK (2004-07-26) */
+#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B
+#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B
+#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B
+#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B
+#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B
+#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B
+#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B
+#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B
+#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B
+ /* ... and we also keep our old identifier... */
+#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B
+
+#if 0 /* this seems to be a previous inversion */
+#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
+#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
+#else
+#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
+#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
+#endif
+
+#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D
+#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
+#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
+#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043F
+#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
+ /* alias declared in Windows 2000 */
+#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
+ TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
+
+#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
+#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
+#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
+#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
+#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
+#define TT_MS_LANGID_BENGALI_INDIA 0x0445
+#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845
+#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
+#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
+#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
+#define TT_MS_LANGID_ORIYA_INDIA 0x0448
+#define TT_MS_LANGID_TAMIL_INDIA 0x0449
+#define TT_MS_LANGID_TELUGU_INDIA 0x044A
+#define TT_MS_LANGID_KANNADA_INDIA 0x044B
+#define TT_MS_LANGID_MALAYALAM_INDIA 0x044C
+#define TT_MS_LANGID_ASSAMESE_INDIA 0x044D
+#define TT_MS_LANGID_MARATHI_INDIA 0x044E
+#define TT_MS_LANGID_SANSKRIT_INDIA 0x044F
+#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
+#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850
+#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
+ /* Don't use the next constant! It has */
+ /* (1) the wrong spelling (Dzonghka) */
+ /* (2) Microsoft doesn't officially define it -- */
+ /* at least it is not in the List of Local */
+ /* ID Values. */
+ /* (3) Dzongkha is not the same language as */
+ /* Tibetan, so merging it is wrong anyway. */
+ /* */
+ /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
+#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
+
+#if 0
+ /* the following used to be defined */
+#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
+ /* ... but it was changed; */
+#else
+ /* So we will continue to #define it, but with the correct value */
+#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN
+#endif
+
+#define TT_MS_LANGID_WELSH_WALES 0x0452
+#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453
+#define TT_MS_LANGID_LAO_LAOS 0x0454
+#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455
+#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456
+#define TT_MS_LANGID_KONKANI_INDIA 0x0457
+#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
+#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
+#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
+ /* Missing a LCID for Sindhi in Devanagari script */
+#define TT_MS_LANGID_SYRIAC_SYRIA 0x045A
+#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045B
+#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C
+#define TT_MS_LANGID_INUKTITUT_CANADA 0x045D
+#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E
+#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F
+#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085F
+ /* Missing a LCID for Tifinagh script */
+#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
+ /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
+ /* script is yet unclear... might be Arabic, Nagari or Sharada */
+#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
+ /* ... and aliased (by MS) for compatibility reasons. */
+#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA
+#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
+#define TT_MS_LANGID_NEPALI_INDIA 0x0861
+#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462
+#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463
+#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
+#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
+ /* alias declared in Windows 2000 */
+#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
+#define TT_MS_LANGID_EDO_NIGERIA 0x0466
+#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
+#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
+#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
+#define TT_MS_LANGID_YORUBA_NIGERIA 0x046A
+#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B
+#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B
+#define TT_MS_LANGID_QUECHUA_PERU 0x0C6B
+#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046C
+ /* Also spelled by XPsp2 Platform SDK (2004-07-26) */
+#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
+ TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
+ /* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */
+#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
+#define TT_MS_LANGID_KANURI_NIGERIA 0x0471
+#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
+#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
+#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
+ /* also spelled in the `Passport SDK' list as: */
+#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
+#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474
+#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
+#define TT_MS_LANGID_LATIN 0x0476
+#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
+ /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
+ /* not written (but OTOH the peculiar writing system is worth */
+ /* studying). */
+#define TT_MS_LANGID_YI_CHINA 0x0478
+#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
+ /* language codes from 0x047A to 0x047F are (still) unknown. */
+#define TT_MS_LANGID_UIGHUR_CHINA 0x0480
+#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
+
+#if 0 /* not deemed useful for fonts */
+#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04FF
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* Possible values of the `name' identifier field in the name records of */
+ /* the TTF `name' table. These values are platform independent. */
+ /* */
+#define TT_NAME_ID_COPYRIGHT 0
+#define TT_NAME_ID_FONT_FAMILY 1
+#define TT_NAME_ID_FONT_SUBFAMILY 2
+#define TT_NAME_ID_UNIQUE_ID 3
+#define TT_NAME_ID_FULL_NAME 4
+#define TT_NAME_ID_VERSION_STRING 5
+#define TT_NAME_ID_PS_NAME 6
+#define TT_NAME_ID_TRADEMARK 7
+
+ /* the following values are from the OpenType spec */
+#define TT_NAME_ID_MANUFACTURER 8
+#define TT_NAME_ID_DESIGNER 9
+#define TT_NAME_ID_DESCRIPTION 10
+#define TT_NAME_ID_VENDOR_URL 11
+#define TT_NAME_ID_DESIGNER_URL 12
+#define TT_NAME_ID_LICENSE 13
+#define TT_NAME_ID_LICENSE_URL 14
+ /* number 15 is reserved */
+#define TT_NAME_ID_PREFERRED_FAMILY 16
+#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
+#define TT_NAME_ID_MAC_FULL_NAME 18
+
+ /* The following code is new as of 2000-01-21 */
+#define TT_NAME_ID_SAMPLE_TEXT 19
+
+ /* This is new in OpenType 1.3 */
+#define TT_NAME_ID_CID_FINDFONT_NAME 20
+
+ /* This is new in OpenType 1.5 */
+#define TT_NAME_ID_WWS_FAMILY 21
+#define TT_NAME_ID_WWS_SUBFAMILY 22
+
+
+ /*************************************************************************/
+ /* */
+ /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
+ /* */
+ /* Updated 08-Nov-2008. */
+ /* */
+
+ /* Bit 0 Basic Latin */
+#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
+ /* Bit 1 C1 Controls and Latin-1 Supplement */
+#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
+ /* Bit 2 Latin Extended-A */
+#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
+ /* Bit 3 Latin Extended-B */
+#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
+ /* Bit 4 IPA Extensions */
+ /* Phonetic Extensions */
+ /* Phonetic Extensions Supplement */
+#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
+ /* U+1D00-U+1D7F */
+ /* U+1D80-U+1DBF */
+ /* Bit 5 Spacing Modifier Letters */
+ /* Modifier Tone Letters */
+#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
+ /* U+A700-U+A71F */
+ /* Bit 6 Combining Diacritical Marks */
+ /* Combining Diacritical Marks Supplement */
+#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
+ /* U+1DC0-U+1DFF */
+ /* Bit 7 Greek and Coptic */
+#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
+ /* Bit 8 Coptic */
+#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
+ /* Bit 9 Cyrillic */
+ /* Cyrillic Supplement */
+ /* Cyrillic Extended-A */
+ /* Cyrillic Extended-B */
+#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
+ /* U+0500-U+052F */
+ /* U+2DE0-U+2DFF */
+ /* U+A640-U+A69F */
+ /* Bit 10 Armenian */
+#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
+ /* Bit 11 Hebrew */
+#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
+ /* Bit 12 Vai */
+#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
+ /* Bit 13 Arabic */
+ /* Arabic Supplement */
+#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
+ /* U+0750-U+077F */
+ /* Bit 14 NKo */
+#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
+ /* Bit 15 Devanagari */
+#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
+ /* Bit 16 Bengali */
+#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
+ /* Bit 17 Gurmukhi */
+#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
+ /* Bit 18 Gujarati */
+#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
+ /* Bit 19 Oriya */
+#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
+ /* Bit 20 Tamil */
+#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
+ /* Bit 21 Telugu */
+#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
+ /* Bit 22 Kannada */
+#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
+ /* Bit 23 Malayalam */
+#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
+ /* Bit 24 Thai */
+#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
+ /* Bit 25 Lao */
+#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
+ /* Bit 26 Georgian */
+ /* Georgian Supplement */
+#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
+ /* U+2D00-U+2D2F */
+ /* Bit 27 Balinese */
+#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
+ /* Bit 28 Hangul Jamo */
+#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
+ /* Bit 29 Latin Extended Additional */
+ /* Latin Extended-C */
+ /* Latin Extended-D */
+#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
+ /* U+2C60-U+2C7F */
+ /* U+A720-U+A7FF */
+ /* Bit 30 Greek Extended */
+#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
+ /* Bit 31 General Punctuation */
+ /* Supplemental Punctuation */
+#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
+ /* U+2E00-U+2E7F */
+ /* Bit 32 Superscripts And Subscripts */
+#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
+ /* Bit 33 Currency Symbols */
+#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
+ /* Bit 34 Combining Diacritical Marks For Symbols */
+#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
+ /* Bit 35 Letterlike Symbols */
+#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
+ /* Bit 36 Number Forms */
+#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
+ /* Bit 37 Arrows */
+ /* Supplemental Arrows-A */
+ /* Supplemental Arrows-B */
+ /* Miscellaneous Symbols and Arrows */
+#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
+ /* U+27F0-U+27FF */
+ /* U+2900-U+297F */
+ /* U+2B00-U+2BFF */
+ /* Bit 38 Mathematical Operators */
+ /* Supplemental Mathematical Operators */
+ /* Miscellaneous Mathematical Symbols-A */
+ /* Miscellaneous Mathematical Symbols-B */
+#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
+ /* U+2A00-U+2AFF */
+ /* U+27C0-U+27EF */
+ /* U+2980-U+29FF */
+ /* Bit 39 Miscellaneous Technical */
+#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
+ /* Bit 40 Control Pictures */
+#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
+ /* Bit 41 Optical Character Recognition */
+#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
+ /* Bit 42 Enclosed Alphanumerics */
+#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
+ /* Bit 43 Box Drawing */
+#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
+ /* Bit 44 Block Elements */
+#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
+ /* Bit 45 Geometric Shapes */
+#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
+ /* Bit 46 Miscellaneous Symbols */
+#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
+ /* Bit 47 Dingbats */
+#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
+ /* Bit 48 CJK Symbols and Punctuation */
+#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
+ /* Bit 49 Hiragana */
+#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
+ /* Bit 50 Katakana */
+ /* Katakana Phonetic Extensions */
+#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
+ /* U+31F0-U+31FF */
+ /* Bit 51 Bopomofo */
+ /* Bopomofo Extended */
+#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
+ /* U+31A0-U+31BF */
+ /* Bit 52 Hangul Compatibility Jamo */
+#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
+ /* Bit 53 Phags-Pa */
+#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
+#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
+#define TT_UCR_PHAGSPA
+ /* Bit 54 Enclosed CJK Letters and Months */
+#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
+ /* Bit 55 CJK Compatibility */
+#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
+ /* Bit 56 Hangul Syllables */
+#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
+ /* Bit 57 High Surrogates */
+ /* High Private Use Surrogates */
+ /* Low Surrogates */
+ /* */
+ /* According to OpenType specs v.1.3+, */
+ /* setting bit 57 implies that there is */
+ /* at least one codepoint beyond the */
+ /* Basic Multilingual Plane that is */
+ /* supported by this font. So it really */
+ /* means >= U+10000 */
+#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
+ /* U+DB80-U+DBFF */
+ /* U+DC00-U+DFFF */
+#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
+ /* Bit 58 Phoenician */
+#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
+ /* Bit 59 CJK Unified Ideographs */
+ /* CJK Radicals Supplement */
+ /* Kangxi Radicals */
+ /* Ideographic Description Characters */
+ /* CJK Unified Ideographs Extension A */
+ /* CJK Unified Ideographs Extension B */
+ /* Kanbun */
+#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
+ /* U+2E80-U+2EFF */
+ /* U+2F00-U+2FDF */
+ /* U+2FF0-U+2FFF */
+ /* U+3400-U+4DB5 */
+ /*U+20000-U+2A6DF*/
+ /* U+3190-U+319F */
+ /* Bit 60 Private Use */
+#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
+ /* Bit 61 CJK Strokes */
+ /* CJK Compatibility Ideographs */
+ /* CJK Compatibility Ideographs Supplement */
+#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
+ /* U+F900-U+FAFF */
+ /*U+2F800-U+2FA1F*/
+ /* Bit 62 Alphabetic Presentation Forms */
+#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
+ /* Bit 63 Arabic Presentation Forms-A */
+#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
+ /* Bit 64 Combining Half Marks */
+#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
+ /* Bit 65 Vertical forms */
+ /* CJK Compatibility Forms */
+#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
+ /* U+FE30-U+FE4F */
+ /* Bit 66 Small Form Variants */
+#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
+ /* Bit 67 Arabic Presentation Forms-B */
+#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */
+ /* Bit 68 Halfwidth and Fullwidth Forms */
+#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
+ /* Bit 69 Specials */
+#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
+ /* Bit 70 Tibetan */
+#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */
+ /* Bit 71 Syriac */
+#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
+ /* Bit 72 Thaana */
+#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
+ /* Bit 73 Sinhala */
+#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
+ /* Bit 74 Myanmar */
+#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
+ /* Bit 75 Ethiopic */
+ /* Ethiopic Supplement */
+ /* Ethiopic Extended */
+#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
+ /* U+1380-U+139F */
+ /* U+2D80-U+2DDF */
+ /* Bit 76 Cherokee */
+#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
+ /* Bit 77 Unified Canadian Aboriginal Syllabics */
+#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */
+ /* Bit 78 Ogham */
+#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
+ /* Bit 79 Runic */
+#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
+ /* Bit 80 Khmer */
+ /* Khmer Symbols */
+#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
+ /* U+19E0-U+19FF */
+ /* Bit 81 Mongolian */
+#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
+ /* Bit 82 Braille Patterns */
+#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
+ /* Bit 83 Yi Syllables */
+ /* Yi Radicals */
+#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
+ /* U+A490-U+A4CF */
+ /* Bit 84 Tagalog */
+ /* Hanunoo */
+ /* Buhid */
+ /* Tagbanwa */
+#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
+ /* U+1720-U+173F */
+ /* U+1740-U+175F */
+ /* U+1760-U+177F */
+ /* Bit 85 Old Italic */
+#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/
+ /* Bit 86 Gothic */
+#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
+ /* Bit 87 Deseret */
+#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
+ /* Bit 88 Byzantine Musical Symbols */
+ /* Musical Symbols */
+ /* Ancient Greek Musical Notation */
+#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
+ /*U+1D100-U+1D1FF*/
+ /*U+1D200-U+1D24F*/
+ /* Bit 89 Mathematical Alphanumeric Symbols */
+#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
+ /* Bit 90 Private Use (plane 15) */
+ /* Private Use (plane 16) */
+#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
+ /*U+100000-U+10FFFD*/
+ /* Bit 91 Variation Selectors */
+ /* Variation Selectors Supplement */
+#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
+ /*U+E0100-U+E01EF*/
+ /* Bit 92 Tags */
+#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
+ /* Bit 93 Limbu */
+#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
+ /* Bit 94 Tai Le */
+#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
+ /* Bit 95 New Tai Lue */
+#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
+ /* Bit 96 Buginese */
+#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
+ /* Bit 97 Glagolitic */
+#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
+ /* Bit 98 Tifinagh */
+#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
+ /* Bit 99 Yijing Hexagram Symbols */
+#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
+ /* Bit 100 Syloti Nagri */
+#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
+ /* Bit 101 Linear B Syllabary */
+ /* Linear B Ideograms */
+ /* Aegean Numbers */
+#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
+ /*U+10080-U+100FF*/
+ /*U+10100-U+1013F*/
+ /* Bit 102 Ancient Greek Numbers */
+#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
+ /* Bit 103 Ugaritic */
+#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
+ /* Bit 104 Old Persian */
+#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
+ /* Bit 105 Shavian */
+#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
+ /* Bit 106 Osmanya */
+#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
+ /* Bit 107 Cypriot Syllabary */
+#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
+ /* Bit 108 Kharoshthi */
+#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
+ /* Bit 109 Tai Xuan Jing Symbols */
+#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
+ /* Bit 110 Cuneiform */
+ /* Cuneiform Numbers and Punctuation */
+#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
+ /*U+12400-U+1247F*/
+ /* Bit 111 Counting Rod Numerals */
+#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
+ /* Bit 112 Sundanese */
+#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
+ /* Bit 113 Lepcha */
+#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
+ /* Bit 114 Ol Chiki */
+#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
+ /* Bit 115 Saurashtra */
+#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
+ /* Bit 116 Kayah Li */
+#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
+ /* Bit 117 Rejang */
+#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
+ /* Bit 118 Cham */
+#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
+ /* Bit 119 Ancient Symbols */
+#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
+ /* Bit 120 Phaistos Disc */
+#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
+ /* Bit 121 Carian */
+ /* Lycian */
+ /* Lydian */
+#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
+ /*U+10280-U+1029F*/
+ /*U+10920-U+1093F*/
+ /* Bit 122 Domino Tiles */
+ /* Mahjong Tiles */
+#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
+ /*U+1F000-U+1F02F*/
+ /* Bit 123-127 Reserved for process-internal usage */
+
+
+ /*************************************************************************/
+ /* */
+ /* Some compilers have a very limited length of identifiers. */
+ /* */
+#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
+#define HAVE_LIMIT_ON_IDENTS
+#endif
+
+
+#ifndef HAVE_LIMIT_ON_IDENTS
+
+
+ /*************************************************************************/
+ /* */
+ /* Here some alias #defines in order to be clearer. */
+ /* */
+ /* These are not always #defined to stay within the 31~character limit, */
+ /* which some compilers have. */
+ /* */
+ /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
+ /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
+ /* If you get a warning with such a compiler, use the -i40 switch. */
+ /* */
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
+ TT_UCR_ARABIC_PRESENTATIONS_A
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
+ TT_UCR_ARABIC_PRESENTATIONS_B
+
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
+ TT_UCR_COMBINING_DIACRITICS
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
+ TT_UCR_COMBINING_DIACRITICS_SYMB
+
+
+#endif /* !HAVE_LIMIT_ON_IDENTS */
+
+
+FT_END_HEADER
+
+#endif /* __TTNAMEID_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/tttables.h b/src/3rdparty/freetype/include/freetype/tttables.h
new file mode 100644
index 0000000000..1568f40364
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/tttables.h
@@ -0,0 +1,829 @@
+/***************************************************************************/
+/* */
+/* tttables.h */
+/* */
+/* Basic SFNT/TrueType tables definitions and interface */
+/* (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __TTTABLES_H__
+#define __TTTABLES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* truetype_tables */
+ /* */
+ /* <Title> */
+ /* TrueType Tables */
+ /* */
+ /* <Abstract> */
+ /* TrueType specific table types and functions. */
+ /* */
+ /* <Description> */
+ /* This section contains the definition of TrueType-specific tables */
+ /* as well as some routines used to access and process them. */
+ /* */
+ /* <Order> */
+ /* TT_Header */
+ /* TT_HoriHeader */
+ /* TT_VertHeader */
+ /* TT_OS2 */
+ /* TT_Postscript */
+ /* TT_PCLT */
+ /* TT_MaxProfile */
+ /* */
+ /* FT_Sfnt_Tag */
+ /* FT_Get_Sfnt_Table */
+ /* FT_Load_Sfnt_Table */
+ /* FT_Sfnt_Table_Info */
+ /* */
+ /* FT_Get_CMap_Language_ID */
+ /* FT_Get_CMap_Format */
+ /* */
+ /* FT_PARAM_TAG_UNPATENTED_HINTING */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Header */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType font header table. All */
+ /* fields follow the TrueType specification. */
+ /* */
+ typedef struct TT_Header_
+ {
+ FT_Fixed Table_Version;
+ FT_Fixed Font_Revision;
+
+ FT_Long CheckSum_Adjust;
+ FT_Long Magic_Number;
+
+ FT_UShort Flags;
+ FT_UShort Units_Per_EM;
+
+ FT_Long Created [2];
+ FT_Long Modified[2];
+
+ FT_Short xMin;
+ FT_Short yMin;
+ FT_Short xMax;
+ FT_Short yMax;
+
+ FT_UShort Mac_Style;
+ FT_UShort Lowest_Rec_PPEM;
+
+ FT_Short Font_Direction;
+ FT_Short Index_To_Loc_Format;
+ FT_Short Glyph_Data_Format;
+
+ } TT_Header;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_HoriHeader */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType horizontal header, the `hhea' */
+ /* table, as well as the corresponding horizontal metrics table, */
+ /* i.e., the `hmtx' table. */
+ /* */
+ /* <Fields> */
+ /* Version :: The table version. */
+ /* */
+ /* Ascender :: The font's ascender, i.e., the distance */
+ /* from the baseline to the top-most of all */
+ /* glyph points found in the font. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of the */
+ /* glyphs found in the font (maybe ASCII). */
+ /* */
+ /* You should use the `sTypoAscender' field */
+ /* of the OS/2 table instead if you want */
+ /* the correct one. */
+ /* */
+ /* Descender :: The font's descender, i.e., the distance */
+ /* from the baseline to the bottom-most of */
+ /* all glyph points found in the font. It */
+ /* is negative. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of the */
+ /* glyphs found in the font (maybe ASCII). */
+ /* */
+ /* You should use the `sTypoDescender' */
+ /* field of the OS/2 table instead if you */
+ /* want the correct one. */
+ /* */
+ /* Line_Gap :: The font's line gap, i.e., the distance */
+ /* to add to the ascender and descender to */
+ /* get the BTB, i.e., the */
+ /* baseline-to-baseline distance for the */
+ /* font. */
+ /* */
+ /* advance_Width_Max :: This field is the maximum of all advance */
+ /* widths found in the font. It can be */
+ /* used to compute the maximum width of an */
+ /* arbitrary string of text. */
+ /* */
+ /* min_Left_Side_Bearing :: The minimum left side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* min_Right_Side_Bearing :: The minimum right side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* xMax_Extent :: The maximum horizontal extent (i.e., the */
+ /* `width' of a glyph's bounding box) for */
+ /* all glyphs in the font. */
+ /* */
+ /* caret_Slope_Rise :: The rise coefficient of the cursor's */
+ /* slope of the cursor (slope=rise/run). */
+ /* */
+ /* caret_Slope_Run :: The run coefficient of the cursor's */
+ /* slope. */
+ /* */
+ /* Reserved :: 8~reserved bytes. */
+ /* */
+ /* metric_Data_Format :: Always~0. */
+ /* */
+ /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
+ /* table -- this value can be smaller than */
+ /* the total number of glyphs in the font. */
+ /* */
+ /* long_metrics :: A pointer into the `hmtx' table. */
+ /* */
+ /* short_metrics :: A pointer into the `hmtx' table. */
+ /* */
+ /* <Note> */
+ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+ /* be identical except for the names of their fields, */
+ /* which are different. */
+ /* */
+ /* This ensures that a single function in the `ttload' */
+ /* module is able to read both the horizontal and vertical */
+ /* headers. */
+ /* */
+ typedef struct TT_HoriHeader_
+ {
+ FT_Fixed Version;
+ FT_Short Ascender;
+ FT_Short Descender;
+ FT_Short Line_Gap;
+
+ FT_UShort advance_Width_Max; /* advance width maximum */
+
+ FT_Short min_Left_Side_Bearing; /* minimum left-sb */
+ FT_Short min_Right_Side_Bearing; /* minimum right-sb */
+ FT_Short xMax_Extent; /* xmax extents */
+ FT_Short caret_Slope_Rise;
+ FT_Short caret_Slope_Run;
+ FT_Short caret_Offset;
+
+ FT_Short Reserved[4];
+
+ FT_Short metric_Data_Format;
+ FT_UShort number_Of_HMetrics;
+
+ /* The following fields are not defined by the TrueType specification */
+ /* but they are used to connect the metrics header to the relevant */
+ /* `HMTX' table. */
+
+ void* long_metrics;
+ void* short_metrics;
+
+ } TT_HoriHeader;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_VertHeader */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType vertical header, the `vhea' */
+ /* table, as well as the corresponding vertical metrics table, i.e., */
+ /* the `vmtx' table. */
+ /* */
+ /* <Fields> */
+ /* Version :: The table version. */
+ /* */
+ /* Ascender :: The font's ascender, i.e., the distance */
+ /* from the baseline to the top-most of */
+ /* all glyph points found in the font. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of */
+ /* the glyphs found in the font (maybe */
+ /* ASCII). */
+ /* */
+ /* You should use the `sTypoAscender' */
+ /* field of the OS/2 table instead if you */
+ /* want the correct one. */
+ /* */
+ /* Descender :: The font's descender, i.e., the */
+ /* distance from the baseline to the */
+ /* bottom-most of all glyph points found */
+ /* in the font. It is negative. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of */
+ /* the glyphs found in the font (maybe */
+ /* ASCII). */
+ /* */
+ /* You should use the `sTypoDescender' */
+ /* field of the OS/2 table instead if you */
+ /* want the correct one. */
+ /* */
+ /* Line_Gap :: The font's line gap, i.e., the distance */
+ /* to add to the ascender and descender to */
+ /* get the BTB, i.e., the */
+ /* baseline-to-baseline distance for the */
+ /* font. */
+ /* */
+ /* advance_Height_Max :: This field is the maximum of all */
+ /* advance heights found in the font. It */
+ /* can be used to compute the maximum */
+ /* height of an arbitrary string of text. */
+ /* */
+ /* min_Top_Side_Bearing :: The minimum top side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* yMax_Extent :: The maximum vertical extent (i.e., the */
+ /* `height' of a glyph's bounding box) for */
+ /* all glyphs in the font. */
+ /* */
+ /* caret_Slope_Rise :: The rise coefficient of the cursor's */
+ /* slope of the cursor (slope=rise/run). */
+ /* */
+ /* caret_Slope_Run :: The run coefficient of the cursor's */
+ /* slope. */
+ /* */
+ /* caret_Offset :: The cursor's offset for slanted fonts. */
+ /* This value is `reserved' in vmtx */
+ /* version 1.0. */
+ /* */
+ /* Reserved :: 8~reserved bytes. */
+ /* */
+ /* metric_Data_Format :: Always~0. */
+ /* */
+ /* number_Of_HMetrics :: Number of VMetrics entries in the */
+ /* `vmtx' table -- this value can be */
+ /* smaller than the total number of glyphs */
+ /* in the font. */
+ /* */
+ /* long_metrics :: A pointer into the `vmtx' table. */
+ /* */
+ /* short_metrics :: A pointer into the `vmtx' table. */
+ /* */
+ /* <Note> */
+ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+ /* be identical except for the names of their fields, */
+ /* which are different. */
+ /* */
+ /* This ensures that a single function in the `ttload' */
+ /* module is able to read both the horizontal and vertical */
+ /* headers. */
+ /* */
+ typedef struct TT_VertHeader_
+ {
+ FT_Fixed Version;
+ FT_Short Ascender;
+ FT_Short Descender;
+ FT_Short Line_Gap;
+
+ FT_UShort advance_Height_Max; /* advance height maximum */
+
+ FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
+ FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
+ FT_Short yMax_Extent; /* xmax or ymax extents */
+ FT_Short caret_Slope_Rise;
+ FT_Short caret_Slope_Run;
+ FT_Short caret_Offset;
+
+ FT_Short Reserved[4];
+
+ FT_Short metric_Data_Format;
+ FT_UShort number_Of_VMetrics;
+
+ /* The following fields are not defined by the TrueType specification */
+ /* but they're used to connect the metrics header to the relevant */
+ /* `HMTX' or `VMTX' table. */
+
+ void* long_metrics;
+ void* short_metrics;
+
+ } TT_VertHeader;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_OS2 */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType OS/2 table. All fields */
+ /* comply to the OpenType specification. */
+ /* */
+ /* Note that we now support old Mac fonts that do not include an OS/2 */
+ /* table. In this case, the `version' field is always set to 0xFFFF. */
+ /* */
+ typedef struct TT_OS2_
+ {
+ FT_UShort version; /* 0x0001 - more or 0xFFFF */
+ FT_Short xAvgCharWidth;
+ FT_UShort usWeightClass;
+ FT_UShort usWidthClass;
+ FT_UShort fsType;
+ FT_Short ySubscriptXSize;
+ FT_Short ySubscriptYSize;
+ FT_Short ySubscriptXOffset;
+ FT_Short ySubscriptYOffset;
+ FT_Short ySuperscriptXSize;
+ FT_Short ySuperscriptYSize;
+ FT_Short ySuperscriptXOffset;
+ FT_Short ySuperscriptYOffset;
+ FT_Short yStrikeoutSize;
+ FT_Short yStrikeoutPosition;
+ FT_Short sFamilyClass;
+
+ FT_Byte panose[10];
+
+ FT_ULong ulUnicodeRange1; /* Bits 0-31 */
+ FT_ULong ulUnicodeRange2; /* Bits 32-63 */
+ FT_ULong ulUnicodeRange3; /* Bits 64-95 */
+ FT_ULong ulUnicodeRange4; /* Bits 96-127 */
+
+ FT_Char achVendID[4];
+
+ FT_UShort fsSelection;
+ FT_UShort usFirstCharIndex;
+ FT_UShort usLastCharIndex;
+ FT_Short sTypoAscender;
+ FT_Short sTypoDescender;
+ FT_Short sTypoLineGap;
+ FT_UShort usWinAscent;
+ FT_UShort usWinDescent;
+
+ /* only version 1 and higher: */
+
+ FT_ULong ulCodePageRange1; /* Bits 0-31 */
+ FT_ULong ulCodePageRange2; /* Bits 32-63 */
+
+ /* only version 2 and higher: */
+
+ FT_Short sxHeight;
+ FT_Short sCapHeight;
+ FT_UShort usDefaultChar;
+ FT_UShort usBreakChar;
+ FT_UShort usMaxContext;
+
+ /* only version 5 and higher: */
+
+ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
+ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
+
+ } TT_OS2;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Postscript */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType PostScript table. All fields */
+ /* comply to the TrueType specification. This structure does not */
+ /* reference the PostScript glyph names, which can be nevertheless */
+ /* accessed with the `ttpost' module. */
+ /* */
+ typedef struct TT_Postscript_
+ {
+ FT_Fixed FormatType;
+ FT_Fixed italicAngle;
+ FT_Short underlinePosition;
+ FT_Short underlineThickness;
+ FT_ULong isFixedPitch;
+ FT_ULong minMemType42;
+ FT_ULong maxMemType42;
+ FT_ULong minMemType1;
+ FT_ULong maxMemType1;
+
+ /* Glyph names follow in the file, but we don't */
+ /* load them by default. See the ttpost.c file. */
+
+ } TT_Postscript;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_PCLT */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType PCLT table. All fields */
+ /* comply to the TrueType specification. */
+ /* */
+ typedef struct TT_PCLT_
+ {
+ FT_Fixed Version;
+ FT_ULong FontNumber;
+ FT_UShort Pitch;
+ FT_UShort xHeight;
+ FT_UShort Style;
+ FT_UShort TypeFamily;
+ FT_UShort CapHeight;
+ FT_UShort SymbolSet;
+ FT_Char TypeFace[16];
+ FT_Char CharacterComplement[8];
+ FT_Char FileName[6];
+ FT_Char StrokeWeight;
+ FT_Char WidthType;
+ FT_Byte SerifStyle;
+ FT_Byte Reserved;
+
+ } TT_PCLT;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_MaxProfile */
+ /* */
+ /* <Description> */
+ /* The maximum profile is a table containing many max values, which */
+ /* can be used to pre-allocate arrays. This ensures that no memory */
+ /* allocation occurs during a glyph load. */
+ /* */
+ /* <Fields> */
+ /* version :: The version number. */
+ /* */
+ /* numGlyphs :: The number of glyphs in this TrueType */
+ /* font. */
+ /* */
+ /* maxPoints :: The maximum number of points in a */
+ /* non-composite TrueType glyph. See also */
+ /* the structure element */
+ /* `maxCompositePoints'. */
+ /* */
+ /* maxContours :: The maximum number of contours in a */
+ /* non-composite TrueType glyph. See also */
+ /* the structure element */
+ /* `maxCompositeContours'. */
+ /* */
+ /* maxCompositePoints :: The maximum number of points in a */
+ /* composite TrueType glyph. See also the */
+ /* structure element `maxPoints'. */
+ /* */
+ /* maxCompositeContours :: The maximum number of contours in a */
+ /* composite TrueType glyph. See also the */
+ /* structure element `maxContours'. */
+ /* */
+ /* maxZones :: The maximum number of zones used for */
+ /* glyph hinting. */
+ /* */
+ /* maxTwilightPoints :: The maximum number of points in the */
+ /* twilight zone used for glyph hinting. */
+ /* */
+ /* maxStorage :: The maximum number of elements in the */
+ /* storage area used for glyph hinting. */
+ /* */
+ /* maxFunctionDefs :: The maximum number of function */
+ /* definitions in the TrueType bytecode for */
+ /* this font. */
+ /* */
+ /* maxInstructionDefs :: The maximum number of instruction */
+ /* definitions in the TrueType bytecode for */
+ /* this font. */
+ /* */
+ /* maxStackElements :: The maximum number of stack elements used */
+ /* during bytecode interpretation. */
+ /* */
+ /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
+ /* used for glyph hinting. */
+ /* */
+ /* maxComponentElements :: The maximum number of simple (i.e., non- */
+ /* composite) glyphs in a composite glyph. */
+ /* */
+ /* maxComponentDepth :: The maximum nesting depth of composite */
+ /* glyphs. */
+ /* */
+ /* <Note> */
+ /* This structure is only used during font loading. */
+ /* */
+ typedef struct TT_MaxProfile_
+ {
+ FT_Fixed version;
+ FT_UShort numGlyphs;
+ FT_UShort maxPoints;
+ FT_UShort maxContours;
+ FT_UShort maxCompositePoints;
+ FT_UShort maxCompositeContours;
+ FT_UShort maxZones;
+ FT_UShort maxTwilightPoints;
+ FT_UShort maxStorage;
+ FT_UShort maxFunctionDefs;
+ FT_UShort maxInstructionDefs;
+ FT_UShort maxStackElements;
+ FT_UShort maxSizeOfInstructions;
+ FT_UShort maxComponentElements;
+ FT_UShort maxComponentDepth;
+
+ } TT_MaxProfile;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Sfnt_Tag */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify the index of an SFNT table. */
+ /* Used in the @FT_Get_Sfnt_Table API function. */
+ /* */
+ /* <Values> */
+ /* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */
+ /* */
+ /* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */
+ /* */
+ /* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */
+ /* */
+ /* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
+ /* */
+ /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture. */
+ /* */
+ /* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
+ /* */
+ /* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */
+ /* */
+ typedef enum FT_Sfnt_Tag_
+ {
+ FT_SFNT_HEAD,
+ FT_SFNT_MAXP,
+ FT_SFNT_OS2,
+ FT_SFNT_HHEA,
+ FT_SFNT_VHEA,
+ FT_SFNT_POST,
+ FT_SFNT_PCLT,
+
+ FT_SFNT_MAX
+
+ } FT_Sfnt_Tag;
+
+ /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
+ /* values instead */
+#define ft_sfnt_head FT_SFNT_HEAD
+#define ft_sfnt_maxp FT_SFNT_MAXP
+#define ft_sfnt_os2 FT_SFNT_OS2
+#define ft_sfnt_hhea FT_SFNT_HHEA
+#define ft_sfnt_vhea FT_SFNT_VHEA
+#define ft_sfnt_post FT_SFNT_POST
+#define ft_sfnt_pclt FT_SFNT_PCLT
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Sfnt_Table */
+ /* */
+ /* <Description> */
+ /* Return a pointer to a given SFNT table within a face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source. */
+ /* */
+ /* tag :: The index of the SFNT table. */
+ /* */
+ /* <Return> */
+ /* A type-less pointer to the table. This will be~0 in case of */
+ /* error, or if the corresponding table was not found *OR* loaded */
+ /* from the file. */
+ /* */
+ /* Use a typecast according to `tag' to access the structure */
+ /* elements. */
+ /* */
+ /* <Note> */
+ /* The table is owned by the face object and disappears with it. */
+ /* */
+ /* This function is only useful to access SFNT tables that are loaded */
+ /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
+ /* a list. */
+ /* */
+ /* Here an example how to access the `vhea' table: */
+ /* */
+ /* { */
+ /* TT_VertHeader* vert_header; */
+ /* */
+ /* */
+ /* vert_header = */
+ /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */
+ /* } */
+ /* */
+ FT_EXPORT( void* )
+ FT_Get_Sfnt_Table( FT_Face face,
+ FT_Sfnt_Tag tag );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Load_Sfnt_Table
+ *
+ * @description:
+ * Load any font table into client memory.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * tag ::
+ * The four-byte tag of the table to load. Use the value~0 if you want
+ * to access the whole font file. Otherwise, you can use one of the
+ * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
+ * one with @FT_MAKE_TAG.
+ *
+ * offset ::
+ * The starting offset in the table (or file if tag == 0).
+ *
+ * @output:
+ * buffer ::
+ * The target buffer address. The client must ensure that the memory
+ * array is big enough to hold the data.
+ *
+ * @inout:
+ * length ::
+ * If the `length' parameter is NULL, then try to load the whole table.
+ * Return an error code if it fails.
+ *
+ * Else, if `*length' is~0, exit immediately while returning the
+ * table's (or file) full size in it.
+ *
+ * Else the number of bytes to read from the table or file, from the
+ * starting offset.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * If you need to determine the table's length you should first call this
+ * function with `*length' set to~0, as in the following example:
+ *
+ * {
+ * FT_ULong length = 0;
+ *
+ *
+ * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
+ * if ( error ) { ... table does not exist ... }
+ *
+ * buffer = malloc( length );
+ * if ( buffer == NULL ) { ... not enough memory ... }
+ *
+ * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
+ * if ( error ) { ... could not load table ... }
+ * }
+ *
+ * Note that structures like @TT_Header or @TT_OS2 can't be used with
+ * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
+ * those structures depend on the processor architecture, with varying
+ * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Load_Sfnt_Table( FT_Face face,
+ FT_ULong tag,
+ FT_Long offset,
+ FT_Byte* buffer,
+ FT_ULong* length );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Sfnt_Table_Info
+ *
+ * @description:
+ * Return information on an SFNT table.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * table_index ::
+ * The index of an SFNT table. The function returns
+ * FT_Err_Table_Missing for an invalid value.
+ *
+ * @inout:
+ * tag ::
+ * The name tag of the SFNT table. If the value is NULL, `table_index'
+ * is ignored, and `length' returns the number of SFNT tables in the
+ * font.
+ *
+ * @output:
+ * length ::
+ * The length of the SFNT table (or the number of SFNT tables, depending
+ * on `tag').
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * While parsing fonts, FreeType handles SFNT tables with length zero as
+ * missing.
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Sfnt_Table_Info( FT_Face face,
+ FT_UInt table_index,
+ FT_ULong *tag,
+ FT_ULong *length );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_CMap_Language_ID */
+ /* */
+ /* <Description> */
+ /* Return TrueType/sfnt specific cmap language ID. Definitions of */
+ /* language ID values are in `ttnameid.h'. */
+ /* */
+ /* <Input> */
+ /* charmap :: */
+ /* The target charmap. */
+ /* */
+ /* <Return> */
+ /* The language ID of `charmap'. If `charmap' doesn't belong to a */
+ /* TrueType/sfnt face, just return~0 as the default value. */
+ /* */
+ /* For a format~14 cmap (to access Unicode IVS), the return value is */
+ /* 0xFFFFFFFF. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_CMap_Language_ID( FT_CharMap charmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_CMap_Format */
+ /* */
+ /* <Description> */
+ /* Return TrueType/sfnt specific cmap format. */
+ /* */
+ /* <Input> */
+ /* charmap :: */
+ /* The target charmap. */
+ /* */
+ /* <Return> */
+ /* The format of `charmap'. If `charmap' doesn't belong to a */
+ /* TrueType/sfnt face, return -1. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_Get_CMap_Format( FT_CharMap charmap );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __TTTABLES_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/tttags.h b/src/3rdparty/freetype/include/freetype/tttags.h
new file mode 100644
index 0000000000..3836c7bbfd
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/tttags.h
@@ -0,0 +1,111 @@
+/***************************************************************************/
+/* */
+/* tttags.h */
+/* */
+/* Tags for TrueType and OpenType tables (specification only). */
+/* */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __TTAGS_H__
+#define __TTAGS_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
+#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
+#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
+#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
+#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
+#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
+#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
+#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
+#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
+#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
+#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
+#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
+#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
+#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
+#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
+#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
+#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
+#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
+#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
+#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
+#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
+#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
+#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
+#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
+#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
+#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
+#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
+#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
+#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
+#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
+#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
+#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
+#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
+#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
+#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
+#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
+#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
+#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
+#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
+#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
+#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
+#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
+#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
+#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
+#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
+#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
+#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
+#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
+#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
+#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
+#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
+#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
+#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
+#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
+#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
+#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
+#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
+#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
+#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
+#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
+#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
+#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
+#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
+#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
+#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
+#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
+#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
+#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
+
+
+FT_END_HEADER
+
+#endif /* __TTAGS_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ttunpat.h b/src/3rdparty/freetype/include/freetype/ttunpat.h
new file mode 100644
index 0000000000..8ea556895c
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ttunpat.h
@@ -0,0 +1,60 @@
+/***************************************************************************/
+/* */
+/* ttunpat.h */
+/* */
+/* Definitions for the unpatented TrueType hinting system */
+/* */
+/* Copyright 2003-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* Written by Graham Asher <graham.asher@btinternet.com> */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __TTUNPAT_H__
+#define __TTUNPAT_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_UNPATENTED_HINTING
+ *
+ * @description:
+ * A constant used as the tag of an @FT_Parameter structure to indicate
+ * that unpatented methods only should be used by the TrueType bytecode
+ * interpreter for a typeface opened by @FT_Open_Face.
+ *
+ */
+#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __TTUNPAT_H__ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/ft2build.h b/src/3rdparty/freetype/include/ft2build.h
index 6f8eb7f373..419b80ae44 100644
--- a/src/3rdparty/freetype/include/ft2build.h
+++ b/src/3rdparty/freetype/include/ft2build.h
@@ -4,7 +4,7 @@
/* */
/* FreeType 2 build and setup macros. */
/* */
-/* Copyright 1996-2001, 2006, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -34,7 +34,7 @@
#ifndef __FT2BUILD_H__
#define __FT2BUILD_H__
-#include <config/ftheader.h>
+#include <freetype/config/ftheader.h>
#endif /* __FT2BUILD_H__ */
diff --git a/src/3rdparty/freetype/include/ftadvanc.h b/src/3rdparty/freetype/include/ftadvanc.h
deleted file mode 100644
index 955f93fa16..0000000000
--- a/src/3rdparty/freetype/include/ftadvanc.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftadvanc.h */
-/* */
-/* Quick computation of advance widths (specification only). */
-/* */
-/* Copyright 2008, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTADVANC_H__
-#define __FTADVANC_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /**************************************************************************
- *
- * @section:
- * quick_advance
- *
- * @title:
- * Quick retrieval of advance values
- *
- * @abstract:
- * Retrieve horizontal and vertical advance values without processing
- * glyph outlines, if possible.
- *
- * @description:
- * This section contains functions to quickly extract advance values
- * without handling glyph outlines, if possible.
- *
- * @order:
- * FT_Get_Advance
- * FT_Get_Advances
- *
- */
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* FT_ADVANCE_FLAG_FAST_ONLY */
- /* */
- /* <Description> */
- /* A bit-flag to be OR-ed with the `flags' parameter of the */
- /* @FT_Get_Advance and @FT_Get_Advances functions. */
- /* */
- /* If set, it indicates that you want these functions to fail if the */
- /* corresponding hinting mode or font driver doesn't allow for very */
- /* quick advance computation. */
- /* */
- /* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
- /* or light-hinted can have their advance width computed very */
- /* quickly. */
- /* */
- /* Normal and bytecode hinted modes that require loading, scaling, */
- /* and hinting of the glyph outline, are extremely slow by */
- /* comparison. */
- /* */
-#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Advance */
- /* */
- /* <Description> */
- /* Retrieve the advance value of a given glyph outline in an */
- /* @FT_Face. */
- /* */
- /* <Input> */
- /* face :: The source @FT_Face handle. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* load_flags :: A set of bit flags similar to those used when */
- /* calling @FT_Load_Glyph, used to determine what kind */
- /* of advances you need. */
- /* <Output> */
- /* padvance :: The advance value. If scaling is performed (based on */
- /* the value of `load_flags'), the advance value is in */
- /* 16.16 format. Otherwise, it is in font units. */
- /* */
- /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
- /* vertical advance corresponding to a vertical layout. */
- /* Otherwise, it is the horizontal advance in a */
- /* horizontal layout. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
- /* if the corresponding font backend doesn't have a quick way to */
- /* retrieve the advances. */
- /* */
- /* A scaled advance is returned in 16.16 format but isn't transformed */
- /* by the affine transformation specified by @FT_Set_Transform. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Advance( FT_Face face,
- FT_UInt gindex,
- FT_Int32 load_flags,
- FT_Fixed *padvance );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Advances */
- /* */
- /* <Description> */
- /* Retrieve the advance values of several glyph outlines in an */
- /* @FT_Face. */
- /* */
- /* <Input> */
- /* face :: The source @FT_Face handle. */
- /* */
- /* start :: The first glyph index. */
- /* */
- /* count :: The number of advance values you want to retrieve. */
- /* */
- /* load_flags :: A set of bit flags similar to those used when */
- /* calling @FT_Load_Glyph. */
- /* */
- /* <Output> */
- /* padvance :: The advance values. This array, to be provided by the */
- /* caller, must contain at least `count' elements. */
- /* */
- /* If scaling is performed (based on the value of */
- /* `load_flags'), the advance values are in 16.16 format. */
- /* Otherwise, they are in font units. */
- /* */
- /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
- /* vertical advances corresponding to a vertical layout. */
- /* Otherwise, they are the horizontal advances in a */
- /* horizontal layout. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
- /* if the corresponding font backend doesn't have a quick way to */
- /* retrieve the advances. */
- /* */
- /* Scaled advances are returned in 16.16 format but aren't */
- /* transformed by the affine transformation specified by */
- /* @FT_Set_Transform. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Advances( FT_Face face,
- FT_UInt start,
- FT_UInt count,
- FT_Int32 load_flags,
- FT_Fixed *padvances );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTADVANC_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftautoh.h b/src/3rdparty/freetype/include/ftautoh.h
deleted file mode 100644
index 59191abbfe..0000000000
--- a/src/3rdparty/freetype/include/ftautoh.h
+++ /dev/null
@@ -1,402 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftautoh.h */
-/* */
-/* FreeType API for controlling the auto-hinter (specification only). */
-/* */
-/* Copyright 2012, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTAUTOH_H__
-#define __FTAUTOH_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /**************************************************************************
- *
- * @section:
- * auto_hinter
- *
- * @title:
- * The auto-hinter
- *
- * @abstract:
- * Controlling the auto-hinting module.
- *
- * @description:
- * While FreeType's auto-hinter doesn't expose API functions by itself,
- * it is possible to control its behaviour with @FT_Property_Set and
- * @FT_Property_Get. The following lists the available properties
- * together with the necessary macros and structures.
- *
- * Note that the auto-hinter's module name is `autofitter' for
- * historical reasons.
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * glyph-to-script-map
- *
- * @description:
- * *Experimental* *only*
- *
- * The auto-hinter provides various script modules to hint glyphs.
- * Examples of supported scripts are Latin or CJK. Before a glyph is
- * auto-hinted, the Unicode character map of the font gets examined, and
- * the script is then determined based on Unicode character ranges, see
- * below.
- *
- * OpenType fonts, however, often provide much more glyphs than
- * character codes (small caps, superscripts, ligatures, swashes, etc.),
- * to be controlled by so-called `features'. Handling OpenType features
- * can be quite complicated and thus needs a separate library on top of
- * FreeType.
- *
- * The mapping between glyph indices and scripts (in the auto-hinter
- * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
- * array with `num_glyphs' elements, as found in the font's @FT_Face
- * structure. The `glyph-to-script-map' property returns a pointer to
- * this array, which can be modified as needed. Note that the
- * modification should happen before the first glyph gets processed by
- * the auto-hinter so that the global analysis of the font shapes
- * actually uses the modified mapping.
- *
- * The following example code demonstrates how to access it (omitting
- * the error handling).
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_Prop_GlyphToScriptMap prop;
- *
- *
- * FT_Init_FreeType( &library );
- * FT_New_Face( library, "foo.ttf", 0, &face );
- *
- * prop.face = face;
- *
- * FT_Property_Get( library, "autofitter",
- * "glyph-to-script-map", &prop );
- *
- * // adjust `prop.map' as needed right here
- *
- * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
- * }
- *
- */
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_AUTOHINTER_SCRIPT_XXX
- *
- * @description:
- * *Experimental* *only*
- *
- * A list of constants used for the @glyph-to-script-map property to
- * specify the script submodule the auto-hinter should use for hinting a
- * particular glyph.
- *
- * @values:
- * FT_AUTOHINTER_SCRIPT_NONE ::
- * Don't auto-hint this glyph.
- *
- * FT_AUTOHINTER_SCRIPT_LATIN ::
- * Apply the latin auto-hinter. For the auto-hinter, `latin' is a
- * very broad term, including Cyrillic and Greek also since characters
- * from those scripts share the same design constraints.
- *
- * By default, characters from the following Unicode ranges are
- * assigned to this submodule.
- *
- * {
- * U+0020 - U+007F // Basic Latin (no control characters)
- * U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
- * U+0100 - U+017F // Latin Extended-A
- * U+0180 - U+024F // Latin Extended-B
- * U+0250 - U+02AF // IPA Extensions
- * U+02B0 - U+02FF // Spacing Modifier Letters
- * U+0300 - U+036F // Combining Diacritical Marks
- * U+0370 - U+03FF // Greek and Coptic
- * U+0400 - U+04FF // Cyrillic
- * U+0500 - U+052F // Cyrillic Supplement
- * U+1D00 - U+1D7F // Phonetic Extensions
- * U+1D80 - U+1DBF // Phonetic Extensions Supplement
- * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
- * U+1E00 - U+1EFF // Latin Extended Additional
- * U+1F00 - U+1FFF // Greek Extended
- * U+2000 - U+206F // General Punctuation
- * U+2070 - U+209F // Superscripts and Subscripts
- * U+20A0 - U+20CF // Currency Symbols
- * U+2150 - U+218F // Number Forms
- * U+2460 - U+24FF // Enclosed Alphanumerics
- * U+2C60 - U+2C7F // Latin Extended-C
- * U+2DE0 - U+2DFF // Cyrillic Extended-A
- * U+2E00 - U+2E7F // Supplemental Punctuation
- * U+A640 - U+A69F // Cyrillic Extended-B
- * U+A720 - U+A7FF // Latin Extended-D
- * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
- * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
- * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
- * }
- *
- * FT_AUTOHINTER_SCRIPT_CJK ::
- * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
- * Vietnamese, and some other scripts.
- *
- * By default, characters from the following Unicode ranges are
- * assigned to this submodule.
- *
- * {
- * U+1100 - U+11FF // Hangul Jamo
- * U+2E80 - U+2EFF // CJK Radicals Supplement
- * U+2F00 - U+2FDF // Kangxi Radicals
- * U+2FF0 - U+2FFF // Ideographic Description Characters
- * U+3000 - U+303F // CJK Symbols and Punctuation
- * U+3040 - U+309F // Hiragana
- * U+30A0 - U+30FF // Katakana
- * U+3100 - U+312F // Bopomofo
- * U+3130 - U+318F // Hangul Compatibility Jamo
- * U+3190 - U+319F // Kanbun
- * U+31A0 - U+31BF // Bopomofo Extended
- * U+31C0 - U+31EF // CJK Strokes
- * U+31F0 - U+31FF // Katakana Phonetic Extensions
- * U+3200 - U+32FF // Enclosed CJK Letters and Months
- * U+3300 - U+33FF // CJK Compatibility
- * U+3400 - U+4DBF // CJK Unified Ideographs Extension A
- * U+4DC0 - U+4DFF // Yijing Hexagram Symbols
- * U+4E00 - U+9FFF // CJK Unified Ideographs
- * U+A960 - U+A97F // Hangul Jamo Extended-A
- * U+AC00 - U+D7AF // Hangul Syllables
- * U+D7B0 - U+D7FF // Hangul Jamo Extended-B
- * U+F900 - U+FAFF // CJK Compatibility Ideographs
- * U+FE10 - U+FE1F // Vertical forms
- * U+FE30 - U+FE4F // CJK Compatibility Forms
- * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
- * U+1B000 - U+1B0FF // Kana Supplement
- * U+1D300 - U+1D35F // Tai Xuan Hing Symbols
- * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
- * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
- * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
- * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
- * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
- * }
- *
- * FT_AUTOHINTER_SCRIPT_INDIC ::
- * Apply the indic auto-hinter, covering all major scripts from the
- * Indian sub-continent and some other related scripts like Thai, Lao,
- * or Tibetan.
- *
- * By default, characters from the following Unicode ranges are
- * assigned to this submodule.
- *
- * {
- * U+0900 - U+0DFF // Indic Range
- * U+0F00 - U+0FFF // Tibetan
- * U+1900 - U+194F // Limbu
- * U+1B80 - U+1BBF // Sundanese
- * U+1C80 - U+1CDF // Meetei Mayak
- * U+A800 - U+A82F // Syloti Nagri
- * U+11800 - U+118DF // Sharada
- * }
- *
- * Note that currently Indic support is rudimentary only, missing blue
- * zone support.
- *
- */
-#define FT_AUTOHINTER_SCRIPT_NONE 0
-#define FT_AUTOHINTER_SCRIPT_LATIN 1
-#define FT_AUTOHINTER_SCRIPT_CJK 2
-#define FT_AUTOHINTER_SCRIPT_INDIC 3
-
-
- /**************************************************************************
- *
- * @struct:
- * FT_Prop_GlyphToScriptMap
- *
- * @description:
- * *Experimental* *only*
- *
- * The data exchange structure for the @glyph-to-script-map property.
- *
- */
- typedef struct FT_Prop_GlyphToScriptMap_
- {
- FT_Face face;
- FT_Byte* map;
-
- } FT_Prop_GlyphToScriptMap;
-
-
- /**************************************************************************
- *
- * @property:
- * fallback-script
- *
- * @description:
- * *Experimental* *only*
- *
- * If no auto-hinter script module can be assigned to a glyph, a
- * fallback script gets assigned to it (see also the
- * @glyph-to-script-map property). By default, this is
- * @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
- * this fallback value can be changed.
- *
- * {
- * FT_Library library;
- * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "autofitter",
- * "fallback-script", &fallback_script );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- * It's important to use the right timing for changing this value: The
- * creation of the glyph-to-script map that eventually uses the
- * fallback script value gets triggered either by setting or reading a
- * face-specific property like @glyph-to-script-map, or by auto-hinting
- * any glyph from that face. In particular, if you have already created
- * an @FT_Face structure but not loaded any glyph (using the
- * auto-hinter), a change of the fallback script will affect this face.
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * default-script
- *
- * @description:
- * *Experimental* *only*
- *
- * If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
- * the HarfBuzz library access OpenType features for getting better
- * glyph coverages, this property sets the (auto-fitter) script to be
- * used for the default (OpenType) script data of a font's GSUB table.
- * Features for the default script are intended for all scripts not
- * explicitly handled in GSUB; an example is a `dlig' feature,
- * containing the combination of the characters `T', `E', and `L' to
- * form a `TEL' ligature.
- *
- * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
- * `default-script' property, this default value can be changed.
- *
- * {
- * FT_Library library;
- * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "autofitter",
- * "default-script", &default_script );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- * It's important to use the right timing for changing this value: The
- * creation of the glyph-to-script map that eventually uses the
- * default script value gets triggered either by setting or reading a
- * face-specific property like @glyph-to-script-map, or by auto-hinting
- * any glyph from that face. In particular, if you have already created
- * an @FT_Face structure but not loaded any glyph (using the
- * auto-hinter), a change of the default script will affect this face.
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * increase-x-height
- *
- * @description:
- * For ppem values in the range 6~<= ppem <= `increase-x-height', round
- * up the font's x~height much more often than normally. If the value
- * is set to~0, which is the default, this feature is switched off. Use
- * this property to improve the legibility of small font sizes if
- * necessary.
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_Prop_IncreaseXHeight prop;
- *
- *
- * FT_Init_FreeType( &library );
- * FT_New_Face( library, "foo.ttf", 0, &face );
- * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
- *
- * prop.face = face;
- * prop.limit = 14;
- *
- * FT_Property_Set( library, "autofitter",
- * "increase-x-height", &prop );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- * Set this value right after calling @FT_Set_Char_Size, but before
- * loading any glyph (using the auto-hinter).
- *
- */
-
-
- /**************************************************************************
- *
- * @struct:
- * FT_Prop_IncreaseXHeight
- *
- * @description:
- * The data exchange structure for the @increase-x-height property.
- *
- */
- typedef struct FT_Prop_IncreaseXHeight_
- {
- FT_Face face;
- FT_UInt limit;
-
- } FT_Prop_IncreaseXHeight;
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTAUTOH_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftbbox.h b/src/3rdparty/freetype/include/ftbbox.h
deleted file mode 100644
index d6800e240f..0000000000
--- a/src/3rdparty/freetype/include/ftbbox.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftbbox.h */
-/* */
-/* FreeType exact bbox computation (specification). */
-/* */
-/* Copyright 1996-2001, 2003, 2007, 2011, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This component has a _single_ role: to compute exact outline bounding */
- /* boxes. */
- /* */
- /* It is separated from the rest of the engine for various technical */
- /* reasons. It may well be integrated in `ftoutln' later. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTBBOX_H__
-#define __FTBBOX_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* outline_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_BBox */
- /* */
- /* <Description> */
- /* Compute the exact bounding box of an outline. This is slower */
- /* than computing the control box. However, it uses an advanced */
- /* algorithm that returns _very_ quickly when the two boxes */
- /* coincide. Otherwise, the outline Bézier arcs are traversed to */
- /* extract their extrema. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline. */
- /* */
- /* <Output> */
- /* abbox :: The outline's exact bounding box. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If the font is tricky and the glyph has been loaded with */
- /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
- /* reasonable values for the BBox it is necessary to load the glyph */
- /* at a large ppem value (so that the hinting instructions can */
- /* properly shift and scale the subglyphs), then extracting the BBox, */
- /* which can be eventually converted back to font units. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Get_BBox( FT_Outline* outline,
- FT_BBox *abbox );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTBBOX_H__ */
-
-
-/* END */
-
-
-/* Local Variables: */
-/* coding: utf-8 */
-/* End: */
diff --git a/src/3rdparty/freetype/include/ftbdf.h b/src/3rdparty/freetype/include/ftbdf.h
deleted file mode 100644
index 6d262e4141..0000000000
--- a/src/3rdparty/freetype/include/ftbdf.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftbdf.h */
-/* */
-/* FreeType API for accessing BDF-specific strings (specification). */
-/* */
-/* Copyright 2002-2004, 2006, 2009, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTBDF_H__
-#define __FTBDF_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* bdf_fonts */
- /* */
- /* <Title> */
- /* BDF and PCF Files */
- /* */
- /* <Abstract> */
- /* BDF and PCF specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of functions specific to BDF */
- /* and PCF fonts. */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @enum:
- * BDF_PropertyType
- *
- * @description:
- * A list of BDF property types.
- *
- * @values:
- * BDF_PROPERTY_TYPE_NONE ::
- * Value~0 is used to indicate a missing property.
- *
- * BDF_PROPERTY_TYPE_ATOM ::
- * Property is a string atom.
- *
- * BDF_PROPERTY_TYPE_INTEGER ::
- * Property is a 32-bit signed integer.
- *
- * BDF_PROPERTY_TYPE_CARDINAL ::
- * Property is a 32-bit unsigned integer.
- */
- typedef enum BDF_PropertyType_
- {
- BDF_PROPERTY_TYPE_NONE = 0,
- BDF_PROPERTY_TYPE_ATOM = 1,
- BDF_PROPERTY_TYPE_INTEGER = 2,
- BDF_PROPERTY_TYPE_CARDINAL = 3
-
- } BDF_PropertyType;
-
-
- /**********************************************************************
- *
- * @type:
- * BDF_Property
- *
- * @description:
- * A handle to a @BDF_PropertyRec structure to model a given
- * BDF/PCF property.
- */
- typedef struct BDF_PropertyRec_* BDF_Property;
-
-
- /**********************************************************************
- *
- * @struct:
- * BDF_PropertyRec
- *
- * @description:
- * This structure models a given BDF/PCF property.
- *
- * @fields:
- * type ::
- * The property type.
- *
- * u.atom ::
- * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
- * NULL, indicating an empty string.
- *
- * u.integer ::
- * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
- *
- * u.cardinal ::
- * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
- */
- typedef struct BDF_PropertyRec_
- {
- BDF_PropertyType type;
- union {
- const char* atom;
- FT_Int32 integer;
- FT_UInt32 cardinal;
-
- } u;
-
- } BDF_PropertyRec;
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_BDF_Charset_ID
- *
- * @description:
- * Retrieve a BDF font character set identity, according to
- * the BDF specification.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * @output:
- * acharset_encoding ::
- * Charset encoding, as a C~string, owned by the face.
- *
- * acharset_registry ::
- * Charset registry, as a C~string, owned by the face.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with BDF faces, returning an error otherwise.
- */
- FT_EXPORT( FT_Error )
- FT_Get_BDF_Charset_ID( FT_Face face,
- const char* *acharset_encoding,
- const char* *acharset_registry );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_BDF_Property
- *
- * @description:
- * Retrieve a BDF property from a BDF or PCF font file.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * name :: The property name.
- *
- * @output:
- * aproperty :: The property.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function works with BDF _and_ PCF fonts. It returns an error
- * otherwise. It also returns an error if the property is not in the
- * font.
- *
- * A `property' is a either key-value pair within the STARTPROPERTIES
- * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
- * `info->props' array within a `FontRec' structure of a PCF font.
- *
- * Integer properties are always stored as `signed' within PCF fonts;
- * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
- * for BDF fonts only.
- *
- * In case of error, `aproperty->type' is always set to
- * @BDF_PROPERTY_TYPE_NONE.
- */
- FT_EXPORT( FT_Error )
- FT_Get_BDF_Property( FT_Face face,
- const char* prop_name,
- BDF_PropertyRec *aproperty );
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FTBDF_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftbitmap.h b/src/3rdparty/freetype/include/ftbitmap.h
deleted file mode 100644
index eae716904b..0000000000
--- a/src/3rdparty/freetype/include/ftbitmap.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftbitmap.h */
-/* */
-/* FreeType utility functions for bitmaps (specification). */
-/* */
-/* Copyright 2004-2006, 2008, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTBITMAP_H__
-#define __FTBITMAP_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* bitmap_handling */
- /* */
- /* <Title> */
- /* Bitmap Handling */
- /* */
- /* <Abstract> */
- /* Handling FT_Bitmap objects. */
- /* */
- /* <Description> */
- /* This section contains functions for handling @FT_Bitmap objects. */
- /* Note that none of the functions changes the bitmap's `flow' (as */
- /* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_New */
- /* */
- /* <Description> */
- /* Initialize a pointer to an @FT_Bitmap structure. */
- /* */
- /* <InOut> */
- /* abitmap :: A pointer to the bitmap structure. */
- /* */
- FT_EXPORT( void )
- FT_Bitmap_New( FT_Bitmap *abitmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Copy */
- /* */
- /* <Description> */
- /* Copy a bitmap into another one. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* source :: A handle to the source bitmap. */
- /* */
- /* <Output> */
- /* target :: A handle to the target bitmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Copy( FT_Library library,
- const FT_Bitmap *source,
- FT_Bitmap *target);
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Embolden */
- /* */
- /* <Description> */
- /* Embolden a bitmap. The new bitmap will be about `xStrength' */
- /* pixels wider and `yStrength' pixels higher. The left and bottom */
- /* borders are kept unchanged. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* xStrength :: How strong the glyph is emboldened horizontally. */
- /* Expressed in 26.6 pixel format. */
- /* */
- /* yStrength :: How strong the glyph is emboldened vertically. */
- /* Expressed in 26.6 pixel format. */
- /* */
- /* <InOut> */
- /* bitmap :: A handle to the target bitmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The current implementation restricts `xStrength' to be less than */
- /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
- /* */
- /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
- /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
- /* */
- /* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
- /* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Embolden( FT_Library library,
- FT_Bitmap* bitmap,
- FT_Pos xStrength,
- FT_Pos yStrength );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Convert */
- /* */
- /* <Description> */
- /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
- /* to a bitmap object with depth 8bpp, making the number of used */
- /* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* source :: The source bitmap. */
- /* */
- /* alignment :: The pitch of the bitmap is a multiple of this */
- /* parameter. Common values are 1, 2, or 4. */
- /* */
- /* <Output> */
- /* target :: The target bitmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* It is possible to call @FT_Bitmap_Convert multiple times without */
- /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
- /* */
- /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
- /* */
- /* The `library' argument is taken to have access to FreeType's */
- /* memory handling functions. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Convert( FT_Library library,
- const FT_Bitmap *source,
- FT_Bitmap *target,
- FT_Int alignment );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GlyphSlot_Own_Bitmap */
- /* */
- /* <Description> */
- /* Make sure that a glyph slot owns `slot->bitmap'. */
- /* */
- /* <Input> */
- /* slot :: The glyph slot. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function is to be used in combination with */
- /* @FT_Bitmap_Embolden. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Bitmap_Done */
- /* */
- /* <Description> */
- /* Destroy a bitmap object created with @FT_Bitmap_New. */
- /* */
- /* <Input> */
- /* library :: A handle to a library object. */
- /* */
- /* bitmap :: The bitmap object to be freed. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The `library' argument is taken to have access to FreeType's */
- /* memory handling functions. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Bitmap_Done( FT_Library library,
- FT_Bitmap *bitmap );
-
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTBITMAP_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftbzip2.h b/src/3rdparty/freetype/include/ftbzip2.h
deleted file mode 100644
index 4dce161fd6..0000000000
--- a/src/3rdparty/freetype/include/ftbzip2.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftbzip2.h */
-/* */
-/* Bzip2-compressed stream support. */
-/* */
-/* Copyright 2010 by */
-/* Joel Klinghed. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTBZIP2_H__
-#define __FTBZIP2_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* bzip2 */
- /* */
- /* <Title> */
- /* BZIP2 Streams */
- /* */
- /* <Abstract> */
- /* Using bzip2-compressed font files. */
- /* */
- /* <Description> */
- /* This section contains the declaration of Bzip2-specific functions. */
- /* */
- /*************************************************************************/
-
-
- /************************************************************************
- *
- * @function:
- * FT_Stream_OpenBzip2
- *
- * @description:
- * Open a new stream to parse bzip2-compressed font files. This is
- * mainly used to support the compressed `*.pcf.bz2' fonts that come
- * with XFree86.
- *
- * @input:
- * stream ::
- * The target embedding stream.
- *
- * source ::
- * The source stream.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source stream must be opened _before_ calling this function.
- *
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- *
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream.
- *
- * In certain builds of the library, bzip2 compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a bzip2 compressed stream
- * from it and re-open the face with it.
- *
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with bzip2 support.
- */
- FT_EXPORT( FT_Error )
- FT_Stream_OpenBzip2( FT_Stream stream,
- FT_Stream source );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTBZIP2_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftcache.h b/src/3rdparty/freetype/include/ftcache.h
deleted file mode 100644
index a30e925cc5..0000000000
--- a/src/3rdparty/freetype/include/ftcache.h
+++ /dev/null
@@ -1,1057 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftcache.h */
-/* */
-/* FreeType Cache subsystem (specification). */
-/* */
-/* Copyright 1996-2008, 2010, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTCACHE_H__
-#define __FTCACHE_H__
-
-
-#include <ft2build.h>
-#include FT_GLYPH_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************
- *
- * <Section>
- * cache_subsystem
- *
- * <Title>
- * Cache Sub-System
- *
- * <Abstract>
- * How to cache face, size, and glyph data with FreeType~2.
- *
- * <Description>
- * This section describes the FreeType~2 cache sub-system, which is used
- * to limit the number of concurrently opened @FT_Face and @FT_Size
- * objects, as well as caching information like character maps and glyph
- * images while limiting their maximum memory usage.
- *
- * Note that all types and functions begin with the `FTC_' prefix.
- *
- * The cache is highly portable and thus doesn't know anything about the
- * fonts installed on your system, or how to access them. This implies
- * the following scheme:
- *
- * First, available or installed font faces are uniquely identified by
- * @FTC_FaceID values, provided to the cache by the client. Note that
- * the cache only stores and compares these values, and doesn't try to
- * interpret them in any way.
- *
- * Second, the cache calls, only when needed, a client-provided function
- * to convert an @FTC_FaceID into a new @FT_Face object. The latter is
- * then completely managed by the cache, including its termination
- * through @FT_Done_Face. To monitor termination of face objects, the
- * finalizer callback in the `generic' field of the @FT_Face object can
- * be used, which might also be used to store the @FTC_FaceID of the
- * face.
- *
- * Clients are free to map face IDs to anything else. The most simple
- * usage is to associate them to a (pathname,face_index) pair that is
- * used to call @FT_New_Face. However, more complex schemes are also
- * possible.
- *
- * Note that for the cache to work correctly, the face ID values must be
- * *persistent*, which means that the contents they point to should not
- * change at runtime, or that their value should not become invalid.
- *
- * If this is unavoidable (e.g., when a font is uninstalled at runtime),
- * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
- * the cache get rid of any references to the old @FTC_FaceID it may
- * keep internally. Failure to do so will lead to incorrect behaviour
- * or even crashes.
- *
- * To use the cache, start with calling @FTC_Manager_New to create a new
- * @FTC_Manager object, which models a single cache instance. You can
- * then look up @FT_Face and @FT_Size objects with
- * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
- *
- * If you want to use the charmap caching, call @FTC_CMapCache_New, then
- * later use @FTC_CMapCache_Lookup to perform the equivalent of
- * @FT_Get_Char_Index, only much faster.
- *
- * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
- * later use @FTC_ImageCache_Lookup to retrieve the corresponding
- * @FT_Glyph objects from the cache.
- *
- * If you need lots of small bitmaps, it is much more memory efficient
- * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
- * returns @FTC_SBitRec structures, which are used to store small
- * bitmaps directly. (A small bitmap is one whose metrics and
- * dimensions all fit into 8-bit integers).
- *
- * We hope to also provide a kerning cache in the near future.
- *
- *
- * <Order>
- * FTC_Manager
- * FTC_FaceID
- * FTC_Face_Requester
- *
- * FTC_Manager_New
- * FTC_Manager_Reset
- * FTC_Manager_Done
- * FTC_Manager_LookupFace
- * FTC_Manager_LookupSize
- * FTC_Manager_RemoveFaceID
- *
- * FTC_Node
- * FTC_Node_Unref
- *
- * FTC_ImageCache
- * FTC_ImageCache_New
- * FTC_ImageCache_Lookup
- *
- * FTC_SBit
- * FTC_SBitCache
- * FTC_SBitCache_New
- * FTC_SBitCache_Lookup
- *
- * FTC_CMapCache
- * FTC_CMapCache_New
- * FTC_CMapCache_Lookup
- *
- *************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** BASIC TYPE DEFINITIONS *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type: FTC_FaceID
- *
- * @description:
- * An opaque pointer type that is used to identity face objects. The
- * contents of such objects is application-dependent.
- *
- * These pointers are typically used to point to a user-defined
- * structure containing a font file path, and face index.
- *
- * @note:
- * Never use NULL as a valid @FTC_FaceID.
- *
- * Face IDs are passed by the client to the cache manager that calls,
- * when needed, the @FTC_Face_Requester to translate them into new
- * @FT_Face objects.
- *
- * If the content of a given face ID changes at runtime, or if the value
- * becomes invalid (e.g., when uninstalling a font), you should
- * immediately call @FTC_Manager_RemoveFaceID before any other cache
- * function.
- *
- * Failure to do so will result in incorrect behaviour or even
- * memory leaks and crashes.
- */
- typedef FT_Pointer FTC_FaceID;
-
-
- /************************************************************************
- *
- * @functype:
- * FTC_Face_Requester
- *
- * @description:
- * A callback function provided by client applications. It is used by
- * the cache manager to translate a given @FTC_FaceID into a new valid
- * @FT_Face object, on demand.
- *
- * <Input>
- * face_id ::
- * The face ID to resolve.
- *
- * library ::
- * A handle to a FreeType library object.
- *
- * req_data ::
- * Application-provided request data (see note below).
- *
- * <Output>
- * aface ::
- * A new @FT_Face handle.
- *
- * <Return>
- * FreeType error code. 0~means success.
- *
- * <Note>
- * The third parameter `req_data' is the same as the one passed by the
- * client when @FTC_Manager_New is called.
- *
- * The face requester should not perform funny things on the returned
- * face object, like creating a new @FT_Size for it, or setting a
- * transformation through @FT_Set_Transform!
- */
- typedef FT_Error
- (*FTC_Face_Requester)( FTC_FaceID face_id,
- FT_Library library,
- FT_Pointer req_data,
- FT_Face* aface );
-
- /* */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** CACHE MANAGER OBJECT *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_Manager */
- /* */
- /* <Description> */
- /* This object corresponds to one instance of the cache-subsystem. */
- /* It is used to cache one or more @FT_Face objects, along with */
- /* corresponding @FT_Size objects. */
- /* */
- /* The manager intentionally limits the total number of opened */
- /* @FT_Face and @FT_Size objects to control memory usage. See the */
- /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
- /* */
- /* The manager is also used to cache `nodes' of various types while */
- /* limiting their total memory usage. */
- /* */
- /* All limitations are enforced by keeping lists of managed objects */
- /* in most-recently-used order, and flushing old nodes to make room */
- /* for new ones. */
- /* */
- typedef struct FTC_ManagerRec_* FTC_Manager;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_Node */
- /* */
- /* <Description> */
- /* An opaque handle to a cache node object. Each cache node is */
- /* reference-counted. A node with a count of~0 might be flushed */
- /* out of a full cache whenever a lookup request is performed. */
- /* */
- /* If you look up nodes, you have the ability to `acquire' them, */
- /* i.e., to increment their reference count. This will prevent the */
- /* node from being flushed out of the cache until you explicitly */
- /* `release' it (see @FTC_Node_Unref). */
- /* */
- /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
- /* */
- typedef struct FTC_NodeRec_* FTC_Node;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_New */
- /* */
- /* <Description> */
- /* Create a new cache manager. */
- /* */
- /* <Input> */
- /* library :: The parent FreeType library handle to use. */
- /* */
- /* max_faces :: Maximum number of opened @FT_Face objects managed by */
- /* this cache instance. Use~0 for defaults. */
- /* */
- /* max_sizes :: Maximum number of opened @FT_Size objects managed by */
- /* this cache instance. Use~0 for defaults. */
- /* */
- /* max_bytes :: Maximum number of bytes to use for cached data nodes. */
- /* Use~0 for defaults. Note that this value does not */
- /* account for managed @FT_Face and @FT_Size objects. */
- /* */
- /* requester :: An application-provided callback used to translate */
- /* face IDs into real @FT_Face objects. */
- /* */
- /* req_data :: A generic pointer that is passed to the requester */
- /* each time it is called (see @FTC_Face_Requester). */
- /* */
- /* <Output> */
- /* amanager :: A handle to a new manager object. 0~in case of */
- /* failure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_Manager_New( FT_Library library,
- FT_UInt max_faces,
- FT_UInt max_sizes,
- FT_ULong max_bytes,
- FTC_Face_Requester requester,
- FT_Pointer req_data,
- FTC_Manager *amanager );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_Reset */
- /* */
- /* <Description> */
- /* Empty a given cache manager. This simply gets rid of all the */
- /* currently cached @FT_Face and @FT_Size objects within the manager. */
- /* */
- /* <InOut> */
- /* manager :: A handle to the manager. */
- /* */
- FT_EXPORT( void )
- FTC_Manager_Reset( FTC_Manager manager );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_Done */
- /* */
- /* <Description> */
- /* Destroy a given manager after emptying it. */
- /* */
- /* <Input> */
- /* manager :: A handle to the target cache manager object. */
- /* */
- FT_EXPORT( void )
- FTC_Manager_Done( FTC_Manager manager );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_LookupFace */
- /* */
- /* <Description> */
- /* Retrieve the @FT_Face object that corresponds to a given face ID */
- /* through a cache manager. */
- /* */
- /* <Input> */
- /* manager :: A handle to the cache manager. */
- /* */
- /* face_id :: The ID of the face object. */
- /* */
- /* <Output> */
- /* aface :: A handle to the face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned @FT_Face object is always owned by the manager. You */
- /* should never try to discard it yourself. */
- /* */
- /* The @FT_Face object doesn't necessarily have a current size object */
- /* (i.e., face->size can be~0). If you need a specific `font size', */
- /* use @FTC_Manager_LookupSize instead. */
- /* */
- /* Never change the face's transformation matrix (i.e., never call */
- /* the @FT_Set_Transform function) on a returned face! If you need */
- /* to transform glyphs, do it yourself after glyph loading. */
- /* */
- /* When you perform a lookup, out-of-memory errors are detected */
- /* _within_ the lookup and force incremental flushes of the cache */
- /* until enough memory is released for the lookup to succeed. */
- /* */
- /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
- /* already been completely flushed, and still no memory was available */
- /* for the operation. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_Manager_LookupFace( FTC_Manager manager,
- FTC_FaceID face_id,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FTC_ScalerRec */
- /* */
- /* <Description> */
- /* A structure used to describe a given character size in either */
- /* pixels or points to the cache manager. See */
- /* @FTC_Manager_LookupSize. */
- /* */
- /* <Fields> */
- /* face_id :: The source face ID. */
- /* */
- /* width :: The character width. */
- /* */
- /* height :: The character height. */
- /* */
- /* pixel :: A Boolean. If 1, the `width' and `height' fields are */
- /* interpreted as integer pixel character sizes. */
- /* Otherwise, they are expressed as 1/64th of points. */
- /* */
- /* x_res :: Only used when `pixel' is value~0 to indicate the */
- /* horizontal resolution in dpi. */
- /* */
- /* y_res :: Only used when `pixel' is value~0 to indicate the */
- /* vertical resolution in dpi. */
- /* */
- /* <Note> */
- /* This type is mainly used to retrieve @FT_Size objects through the */
- /* cache manager. */
- /* */
- typedef struct FTC_ScalerRec_
- {
- FTC_FaceID face_id;
- FT_UInt width;
- FT_UInt height;
- FT_Int pixel;
- FT_UInt x_res;
- FT_UInt y_res;
-
- } FTC_ScalerRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FTC_Scaler */
- /* */
- /* <Description> */
- /* A handle to an @FTC_ScalerRec structure. */
- /* */
- typedef struct FTC_ScalerRec_* FTC_Scaler;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Manager_LookupSize */
- /* */
- /* <Description> */
- /* Retrieve the @FT_Size object that corresponds to a given */
- /* @FTC_ScalerRec pointer through a cache manager. */
- /* */
- /* <Input> */
- /* manager :: A handle to the cache manager. */
- /* */
- /* scaler :: A scaler handle. */
- /* */
- /* <Output> */
- /* asize :: A handle to the size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned @FT_Size object is always owned by the manager. You */
- /* should never try to discard it by yourself. */
- /* */
- /* You can access the parent @FT_Face object simply as `size->face' */
- /* if you need it. Note that this object is also owned by the */
- /* manager. */
- /* */
- /* <Note> */
- /* When you perform a lookup, out-of-memory errors are detected */
- /* _within_ the lookup and force incremental flushes of the cache */
- /* until enough memory is released for the lookup to succeed. */
- /* */
- /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
- /* already been completely flushed, and still no memory is available */
- /* for the operation. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_Manager_LookupSize( FTC_Manager manager,
- FTC_Scaler scaler,
- FT_Size *asize );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_Node_Unref */
- /* */
- /* <Description> */
- /* Decrement a cache node's internal reference count. When the count */
- /* reaches 0, it is not destroyed but becomes eligible for subsequent */
- /* cache flushes. */
- /* */
- /* <Input> */
- /* node :: The cache node handle. */
- /* */
- /* manager :: The cache manager handle. */
- /* */
- FT_EXPORT( void )
- FTC_Node_Unref( FTC_Node node,
- FTC_Manager manager );
-
-
- /*************************************************************************
- *
- * @function:
- * FTC_Manager_RemoveFaceID
- *
- * @description:
- * A special function used to indicate to the cache manager that
- * a given @FTC_FaceID is no longer valid, either because its
- * content changed, or because it was deallocated or uninstalled.
- *
- * @input:
- * manager ::
- * The cache manager handle.
- *
- * face_id ::
- * The @FTC_FaceID to be removed.
- *
- * @note:
- * This function flushes all nodes from the cache corresponding to this
- * `face_id', with the exception of nodes with a non-null reference
- * count.
- *
- * Such nodes are however modified internally so as to never appear
- * in later lookups with the same `face_id' value, and to be immediately
- * destroyed when released by all their users.
- *
- */
- FT_EXPORT( void )
- FTC_Manager_RemoveFaceID( FTC_Manager manager,
- FTC_FaceID face_id );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
-
- /*************************************************************************
- *
- * @type:
- * FTC_CMapCache
- *
- * @description:
- * An opaque handle used to model a charmap cache. This cache is to
- * hold character codes -> glyph indices mappings.
- *
- */
- typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
-
-
- /*************************************************************************
- *
- * @function:
- * FTC_CMapCache_New
- *
- * @description:
- * Create a new charmap cache.
- *
- * @input:
- * manager ::
- * A handle to the cache manager.
- *
- * @output:
- * acache ::
- * A new cache handle. NULL in case of error.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * Like all other caches, this one will be destroyed with the cache
- * manager.
- *
- */
- FT_EXPORT( FT_Error )
- FTC_CMapCache_New( FTC_Manager manager,
- FTC_CMapCache *acache );
-
-
- /************************************************************************
- *
- * @function:
- * FTC_CMapCache_Lookup
- *
- * @description:
- * Translate a character code into a glyph index, using the charmap
- * cache.
- *
- * @input:
- * cache ::
- * A charmap cache handle.
- *
- * face_id ::
- * The source face ID.
- *
- * cmap_index ::
- * The index of the charmap in the source face. Any negative value
- * means to use the cache @FT_Face's default charmap.
- *
- * char_code ::
- * The character code (in the corresponding charmap).
- *
- * @return:
- * Glyph index. 0~means `no glyph'.
- *
- */
- FT_EXPORT( FT_UInt )
- FTC_CMapCache_Lookup( FTC_CMapCache cache,
- FTC_FaceID face_id,
- FT_Int cmap_index,
- FT_UInt32 char_code );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** IMAGE CACHE OBJECT *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @struct:
- * FTC_ImageTypeRec
- *
- * @description:
- * A structure used to model the type of images in a glyph cache.
- *
- * @fields:
- * face_id ::
- * The face ID.
- *
- * width ::
- * The width in pixels.
- *
- * height ::
- * The height in pixels.
- *
- * flags ::
- * The load flags, as in @FT_Load_Glyph.
- *
- */
- typedef struct FTC_ImageTypeRec_
- {
- FTC_FaceID face_id;
- FT_Int width;
- FT_Int height;
- FT_Int32 flags;
-
- } FTC_ImageTypeRec;
-
-
- /*************************************************************************
- *
- * @type:
- * FTC_ImageType
- *
- * @description:
- * A handle to an @FTC_ImageTypeRec structure.
- *
- */
- typedef struct FTC_ImageTypeRec_* FTC_ImageType;
-
-
- /* */
-
-
-#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
- ( (d1)->face_id == (d2)->face_id && \
- (d1)->width == (d2)->width && \
- (d1)->flags == (d2)->flags )
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_ImageCache */
- /* */
- /* <Description> */
- /* A handle to a glyph image cache object. They are designed to */
- /* hold many distinct glyph images while not exceeding a certain */
- /* memory threshold. */
- /* */
- typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_ImageCache_New */
- /* */
- /* <Description> */
- /* Create a new glyph image cache. */
- /* */
- /* <Input> */
- /* manager :: The parent manager for the image cache. */
- /* */
- /* <Output> */
- /* acache :: A handle to the new glyph image cache object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_ImageCache_New( FTC_Manager manager,
- FTC_ImageCache *acache );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_ImageCache_Lookup */
- /* */
- /* <Description> */
- /* Retrieve a given glyph image from a glyph image cache. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source glyph image cache. */
- /* */
- /* type :: A pointer to a glyph image type descriptor. */
- /* */
- /* gindex :: The glyph index to retrieve. */
- /* */
- /* <Output> */
- /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
- /* failure. */
- /* */
- /* anode :: Used to return the address of of the corresponding cache */
- /* node after incrementing its reference count (see note */
- /* below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned glyph is owned and managed by the glyph image cache. */
- /* Never try to transform or discard it manually! You can however */
- /* create a copy with @FT_Glyph_Copy and modify the new one. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the glyph image, after increasing its reference */
- /* count. This ensures that the node (as well as the @FT_Glyph) will */
- /* always be kept in the cache until you call @FTC_Node_Unref to */
- /* `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the @FT_Glyph could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- FT_EXPORT( FT_Error )
- FTC_ImageCache_Lookup( FTC_ImageCache cache,
- FTC_ImageType type,
- FT_UInt gindex,
- FT_Glyph *aglyph,
- FTC_Node *anode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_ImageCache_LookupScaler */
- /* */
- /* <Description> */
- /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
- /* to specify the face ID and its size. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source glyph image cache. */
- /* */
- /* scaler :: A pointer to a scaler descriptor. */
- /* */
- /* load_flags :: The corresponding load flags. */
- /* */
- /* gindex :: The glyph index to retrieve. */
- /* */
- /* <Output> */
- /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
- /* failure. */
- /* */
- /* anode :: Used to return the address of of the corresponding */
- /* cache node after incrementing its reference count */
- /* (see note below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The returned glyph is owned and managed by the glyph image cache. */
- /* Never try to transform or discard it manually! You can however */
- /* create a copy with @FT_Glyph_Copy and modify the new one. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the glyph image, after increasing its reference */
- /* count. This ensures that the node (as well as the @FT_Glyph) will */
- /* always be kept in the cache until you call @FTC_Node_Unref to */
- /* `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the @FT_Glyph could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- /* Calls to @FT_Set_Char_Size and friends have no effect on cached */
- /* glyphs; you should always use the FreeType cache API instead. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
- FTC_Scaler scaler,
- FT_ULong load_flags,
- FT_UInt gindex,
- FT_Glyph *aglyph,
- FTC_Node *anode );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_SBit */
- /* */
- /* <Description> */
- /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
- /* structure for details. */
- /* */
- typedef struct FTC_SBitRec_* FTC_SBit;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FTC_SBitRec */
- /* */
- /* <Description> */
- /* A very compact structure used to describe a small glyph bitmap. */
- /* */
- /* <Fields> */
- /* width :: The bitmap width in pixels. */
- /* */
- /* height :: The bitmap height in pixels. */
- /* */
- /* left :: The horizontal distance from the pen position to the */
- /* left bitmap border (a.k.a. `left side bearing', or */
- /* `lsb'). */
- /* */
- /* top :: The vertical distance from the pen position (on the */
- /* baseline) to the upper bitmap border (a.k.a. `top */
- /* side bearing'). The distance is positive for upwards */
- /* y~coordinates. */
- /* */
- /* format :: The format of the glyph bitmap (monochrome or gray). */
- /* */
- /* max_grays :: Maximum gray level value (in the range 1 to~255). */
- /* */
- /* pitch :: The number of bytes per bitmap line. May be positive */
- /* or negative. */
- /* */
- /* xadvance :: The horizontal advance width in pixels. */
- /* */
- /* yadvance :: The vertical advance height in pixels. */
- /* */
- /* buffer :: A pointer to the bitmap pixels. */
- /* */
- typedef struct FTC_SBitRec_
- {
- FT_Byte width;
- FT_Byte height;
- FT_Char left;
- FT_Char top;
-
- FT_Byte format;
- FT_Byte max_grays;
- FT_Short pitch;
- FT_Char xadvance;
- FT_Char yadvance;
-
- FT_Byte* buffer;
-
- } FTC_SBitRec;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FTC_SBitCache */
- /* */
- /* <Description> */
- /* A handle to a small bitmap cache. These are special cache objects */
- /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
- /* much more efficient way than the traditional glyph image cache */
- /* implemented by @FTC_ImageCache. */
- /* */
- typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_SBitCache_New */
- /* */
- /* <Description> */
- /* Create a new cache to store small glyph bitmaps. */
- /* */
- /* <Input> */
- /* manager :: A handle to the source cache manager. */
- /* */
- /* <Output> */
- /* acache :: A handle to the new sbit cache. NULL in case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FTC_SBitCache_New( FTC_Manager manager,
- FTC_SBitCache *acache );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_SBitCache_Lookup */
- /* */
- /* <Description> */
- /* Look up a given small glyph bitmap in a given sbit cache and */
- /* `lock' it to prevent its flushing from the cache until needed. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source sbit cache. */
- /* */
- /* type :: A pointer to the glyph image type descriptor. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* <Output> */
- /* sbit :: A handle to a small bitmap descriptor. */
- /* */
- /* anode :: Used to return the address of of the corresponding cache */
- /* node after incrementing its reference count (see note */
- /* below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The small bitmap descriptor and its bit buffer are owned by the */
- /* cache and should never be freed by the application. They might */
- /* as well disappear from memory on the next cache lookup, so don't */
- /* treat them as persistent data. */
- /* */
- /* The descriptor's `buffer' field is set to~0 to indicate a missing */
- /* glyph bitmap. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the bitmap, after increasing its reference count. */
- /* This ensures that the node (as well as the image) will always be */
- /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the bitmap could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- FT_EXPORT( FT_Error )
- FTC_SBitCache_Lookup( FTC_SBitCache cache,
- FTC_ImageType type,
- FT_UInt gindex,
- FTC_SBit *sbit,
- FTC_Node *anode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FTC_SBitCache_LookupScaler */
- /* */
- /* <Description> */
- /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
- /* to specify the face ID and its size. */
- /* */
- /* <Input> */
- /* cache :: A handle to the source sbit cache. */
- /* */
- /* scaler :: A pointer to the scaler descriptor. */
- /* */
- /* load_flags :: The corresponding load flags. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* <Output> */
- /* sbit :: A handle to a small bitmap descriptor. */
- /* */
- /* anode :: Used to return the address of of the corresponding */
- /* cache node after incrementing its reference count */
- /* (see note below). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The small bitmap descriptor and its bit buffer are owned by the */
- /* cache and should never be freed by the application. They might */
- /* as well disappear from memory on the next cache lookup, so don't */
- /* treat them as persistent data. */
- /* */
- /* The descriptor's `buffer' field is set to~0 to indicate a missing */
- /* glyph bitmap. */
- /* */
- /* If `anode' is _not_ NULL, it receives the address of the cache */
- /* node containing the bitmap, after increasing its reference count. */
- /* This ensures that the node (as well as the image) will always be */
- /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
- /* */
- /* If `anode' is NULL, the cache node is left unchanged, which means */
- /* that the bitmap could be flushed out of the cache on the next */
- /* call to one of the caching sub-system APIs. Don't assume that it */
- /* is persistent! */
- /* */
- FT_EXPORT( FT_Error )
- FTC_SBitCache_LookupScaler( FTC_SBitCache cache,
- FTC_Scaler scaler,
- FT_ULong load_flags,
- FT_UInt gindex,
- FTC_SBit *sbit,
- FTC_Node *anode );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTCACHE_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftcffdrv.h b/src/3rdparty/freetype/include/ftcffdrv.h
deleted file mode 100644
index f7031bc883..0000000000
--- a/src/3rdparty/freetype/include/ftcffdrv.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftcffdrv.h */
-/* */
-/* FreeType API for controlling the CFF driver (specification only). */
-/* */
-/* Copyright 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTCFFDRV_H__
-#define __FTCFFDRV_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /**************************************************************************
- *
- * @section:
- * cff_driver
- *
- * @title:
- * The CFF driver
- *
- * @abstract:
- * Controlling the CFF driver module.
- *
- * @description:
- * While FreeType's CFF driver doesn't expose API functions by itself,
- * it is possible to control its behaviour with @FT_Property_Set and
- * @FT_Property_Get. The list below gives the available properties
- * together with the necessary macros and structures.
- *
- * The CFF driver's module name is `cff'.
- *
- * *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
- *
- * The rasterizer is positioning horizontal features (e.g., ascender
- * height & x-height, or crossbars) on the pixel grid and minimizing the
- * amount of antialiasing applied to them, while placing vertical
- * features (vertical stems) on the pixel grid without hinting, thus
- * representing the stem position and weight accurately. Sometimes the
- * vertical stems may be only partially black. In this context,
- * `antialiasing' means that stems are not positioned exactly on pixel
- * borders, causing a fuzzy appearance.
- *
- * There are two principles behind this approach.
- *
- * 1) No hinting in the horizontal direction: Unlike `superhinted'
- * TrueType, which changes glyph widths to accommodate regular
- * inter-glyph spacing, Adobe's approach is `faithful to the design' in
- * representing both the glyph width and the inter-glyph spacing
- * designed for the font. This makes the screen display as close as it
- * can be to the result one would get with infinite resolution, while
- * preserving what is considered the key characteristics of each glyph.
- * Note that the distances between unhinted and grid-fitted positions at
- * small sizes are comparable to kerning values and thus would be
- * noticeable (and distracting) while reading if hinting were applied.
- *
- * One of the reasons to not hint horizontally is antialiasing for LCD
- * screens: The pixel geometry of modern displays supplies three
- * vertical sub-pixels as the eye moves horizontally across each visible
- * pixel. On devices where we can be certain this characteristic is
- * present a rasterizer can take advantage of the sub-pixels to add
- * increments of weight. In Western writing systems this turns out to
- * be the more critical direction anyway; the weights and spacing of
- * vertical stems (see above) are central to Armenian, Cyrillic, Greek,
- * and Latin type designs. Even when the rasterizer uses greyscale
- * antialiasing instead of color (a necessary compromise when one
- * doesn't know the screen characteristics), the unhinted vertical
- * features preserve the design's weight and spacing much better than
- * aliased type would.
- *
- * 2) Aligment in the vertical direction: Weights and spacing along the
- * y~axis are less critical; what is much more important is the visual
- * alignment of related features (like cap-height and x-height). The
- * sense of alignment for these is enhanced by the sharpness of grid-fit
- * edges, while the cruder vertical resolution (full pixels instead of
- * 1/3 pixels) is less of a problem.
- *
- * On the technical side, horizontal alignment zones for ascender,
- * x-height, and other important height values (traditionally called
- * `blue zones') as defined in the font are positioned independently,
- * each being rounded to the nearest pixel edge, taking care of
- * overshoot suppression at small sizes, stem darkening, and scaling.
- *
- * Hstems (this is, hint values defined in the font to help align
- * horizontal features) that fall within a blue zone are said to be
- * `captured' and are aligned to that zone. Uncaptured stems are moved
- * in one of four ways, top edge up or down, bottom edge up or down.
- * Unless there are conflicting hstems, the smallest movement is taken
- * to minimize distortion.
- *
- * @order:
- * hinting-engine
- * no-stem-darkening
- * darkening-parameters
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * hinting-engine
- *
- * @description:
- * Thanks to Adobe, which contributed a new hinting (and parsing)
- * engine, an application can select between `freetype' and `adobe' if
- * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
- * macro isn't defined, `hinting-engine' does nothing.
- *
- * The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
- * defined, and `adobe' otherwise.
- *
- * The following example code demonstrates how to select Adobe's hinting
- * engine (omitting the error handling).
- *
- * {
- * FT_Library library;
- * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "cff",
- * "hinting-engine", &hinting_engine );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- */
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_CFF_HINTING_XXX
- *
- * @description:
- * A list of constants used for the @hinting-engine property to select
- * the hinting engine for CFF fonts.
- *
- * @values:
- * FT_CFF_HINTING_FREETYPE ::
- * Use the old FreeType hinting engine.
- *
- * FT_CFF_HINTING_ADOBE ::
- * Use the hinting engine contributed by Adobe.
- *
- */
-#define FT_CFF_HINTING_FREETYPE 0
-#define FT_CFF_HINTING_ADOBE 1
-
-
- /**************************************************************************
- *
- * @property:
- * no-stem-darkening
- *
- * @description:
- * By default, the Adobe CFF engine darkens stems at smaller sizes,
- * regardless of hinting, to enhance contrast. This feature requires
- * a rendering system with proper gamma correction. Setting this
- * property, stem darkening gets switched off.
- *
- * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
- *
- * {
- * FT_Library library;
- * FT_Bool no_stem_darkening = TRUE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "cff",
- * "no-stem-darkening", &no_stem_darkening );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * darkening-parameters
- *
- * @description:
- * By default, the Adobe CFF engine darkens stems as follows (if the
- * `no-stem-darkening' property isn't set):
- *
- * {
- * stem width <= 0.5px: darkening amount = 0.4px
- * stem width = 1px: darkening amount = 0.275px
- * stem width = 1.667px: darkening amount = 0.275px
- * stem width >= 2.333px: darkening amount = 0px
- * }
- *
- * and piecewise linear in-between. At configuration time, these four
- * control points can be set with the macro
- * `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'. At runtime, the control
- * points can be changed using the `darkening-parameters' property, as
- * the following example demonstrates.
- *
- * {
- * FT_Library library;
- * FT_Int darken_params[8] = { 500, 300, // x1, y1
- * 1000, 200, // x2, y2
- * 1500, 100, // x3, y3
- * 2000, 0 }; // x4, y4
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "cff",
- * "darkening-parameters", darken_params );
- * }
- *
- * The x~values give the stem width, and the y~values the darkening
- * amount. The unit is 1000th of pixels. All coordinate values must be
- * positive; the x~values must be monotonically increasing; the
- * y~values must be monotonically decreasing and smaller than or
- * equal to 500 (corresponding to half a pixel); the slope of each
- * linear piece must be shallower than -1 (e.g., -.4).
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __FTCFFDRV_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftchapters.h b/src/3rdparty/freetype/include/ftchapters.h
deleted file mode 100644
index d333761c81..0000000000
--- a/src/3rdparty/freetype/include/ftchapters.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/***************************************************************************/
-/* */
-/* This file defines the structure of the FreeType reference. */
-/* It is used by the python script that generates the HTML files. */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* <Chapter> */
-/* general_remarks */
-/* */
-/* <Title> */
-/* General Remarks */
-/* */
-/* <Sections> */
-/* header_inclusion */
-/* user_allocation */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* <Chapter> */
-/* core_api */
-/* */
-/* <Title> */
-/* Core API */
-/* */
-/* <Sections> */
-/* version */
-/* basic_types */
-/* base_interface */
-/* glyph_variants */
-/* glyph_management */
-/* mac_specific */
-/* sizes_management */
-/* header_file_macros */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* <Chapter> */
-/* format_specific */
-/* */
-/* <Title> */
-/* Format-Specific API */
-/* */
-/* <Sections> */
-/* multiple_masters */
-/* truetype_tables */
-/* type1_tables */
-/* sfnt_names */
-/* bdf_fonts */
-/* cid_fonts */
-/* pfr_fonts */
-/* winfnt_fonts */
-/* font_formats */
-/* gasp_table */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* <Chapter> */
-/* module_specific */
-/* */
-/* <Title> */
-/* Controlling FreeType Modules */
-/* */
-/* <Sections> */
-/* auto_hinter */
-/* cff_driver */
-/* tt_driver */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* <Chapter> */
-/* cache_subsystem */
-/* */
-/* <Title> */
-/* Cache Sub-System */
-/* */
-/* <Sections> */
-/* cache_subsystem */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* <Chapter> */
-/* support_api */
-/* */
-/* <Title> */
-/* Support API */
-/* */
-/* <Sections> */
-/* computations */
-/* list_processing */
-/* outline_processing */
-/* quick_advance */
-/* bitmap_handling */
-/* raster */
-/* glyph_stroker */
-/* system_interface */
-/* module_management */
-/* gzip */
-/* lzw */
-/* bzip2 */
-/* lcd_filtering */
-/* */
-/***************************************************************************/
diff --git a/src/3rdparty/freetype/include/ftcid.h b/src/3rdparty/freetype/include/ftcid.h
deleted file mode 100644
index 17550d87b5..0000000000
--- a/src/3rdparty/freetype/include/ftcid.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftcid.h */
-/* */
-/* FreeType API for accessing CID font information (specification). */
-/* */
-/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTCID_H__
-#define __FTCID_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cid_fonts */
- /* */
- /* <Title> */
- /* CID Fonts */
- /* */
- /* <Abstract> */
- /* CID-keyed font specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of CID-keyed font specific */
- /* functions. */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_CID_Registry_Ordering_Supplement
- *
- * @description:
- * Retrieve the Registry/Ordering/Supplement triple (also known as the
- * "R/O/S") from a CID-keyed font.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * @output:
- * registry ::
- * The registry, as a C~string, owned by the face.
- *
- * ordering ::
- * The ordering, as a C~string, owned by the face.
- *
- * supplement ::
- * The supplement.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with CID faces, returning an error
- * otherwise.
- *
- * @since:
- * 2.3.6
- */
- FT_EXPORT( FT_Error )
- FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
- const char* *registry,
- const char* *ordering,
- FT_Int *supplement);
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_CID_Is_Internally_CID_Keyed
- *
- * @description:
- * Retrieve the type of the input face, CID keyed or not. In
- * constrast to the @FT_IS_CID_KEYED macro this function returns
- * successfully also for CID-keyed fonts in an SNFT wrapper.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * @output:
- * is_cid ::
- * The type of the face as an @FT_Bool.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with CID faces and OpenType fonts,
- * returning an error otherwise.
- *
- * @since:
- * 2.3.9
- */
- FT_EXPORT( FT_Error )
- FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
- FT_Bool *is_cid );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_CID_From_Glyph_Index
- *
- * @description:
- * Retrieve the CID of the input glyph index.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * glyph_index ::
- * The input glyph index.
- *
- * @output:
- * cid ::
- * The CID as an @FT_UInt.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with CID faces and OpenType fonts,
- * returning an error otherwise.
- *
- * @since:
- * 2.3.9
- */
- FT_EXPORT( FT_Error )
- FT_Get_CID_From_Glyph_Index( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt *cid );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTCID_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/fterrdef.h b/src/3rdparty/freetype/include/fterrdef.h
deleted file mode 100644
index 99b2fadec6..0000000000
--- a/src/3rdparty/freetype/include/fterrdef.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/***************************************************************************/
-/* */
-/* fterrdef.h */
-/* */
-/* FreeType error codes (specification). */
-/* */
-/* Copyright 2002, 2004, 2006, 2007, 2010-2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** LIST OF ERROR CODES/MESSAGES *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-
- /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
- /* including this file. */
-
-
- /* generic errors */
-
- FT_NOERRORDEF_( Ok, 0x00,
- "no error" )
-
- FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
- "cannot open resource" )
- FT_ERRORDEF_( Unknown_File_Format, 0x02,
- "unknown file format" )
- FT_ERRORDEF_( Invalid_File_Format, 0x03,
- "broken file" )
- FT_ERRORDEF_( Invalid_Version, 0x04,
- "invalid FreeType version" )
- FT_ERRORDEF_( Lower_Module_Version, 0x05,
- "module version is too low" )
- FT_ERRORDEF_( Invalid_Argument, 0x06,
- "invalid argument" )
- FT_ERRORDEF_( Unimplemented_Feature, 0x07,
- "unimplemented feature" )
- FT_ERRORDEF_( Invalid_Table, 0x08,
- "broken table" )
- FT_ERRORDEF_( Invalid_Offset, 0x09,
- "broken offset within table" )
- FT_ERRORDEF_( Array_Too_Large, 0x0A,
- "array allocation size too large" )
- FT_ERRORDEF_( Missing_Module, 0x0B,
- "missing module" )
- FT_ERRORDEF_( Missing_Property, 0x0C,
- "missing property" )
-
- /* glyph/character errors */
-
- FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
- "invalid glyph index" )
- FT_ERRORDEF_( Invalid_Character_Code, 0x11,
- "invalid character code" )
- FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
- "unsupported glyph image format" )
- FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
- "cannot render this glyph format" )
- FT_ERRORDEF_( Invalid_Outline, 0x14,
- "invalid outline" )
- FT_ERRORDEF_( Invalid_Composite, 0x15,
- "invalid composite glyph" )
- FT_ERRORDEF_( Too_Many_Hints, 0x16,
- "too many hints" )
- FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
- "invalid pixel size" )
-
- /* handle errors */
-
- FT_ERRORDEF_( Invalid_Handle, 0x20,
- "invalid object handle" )
- FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
- "invalid library handle" )
- FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
- "invalid module handle" )
- FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
- "invalid face handle" )
- FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
- "invalid size handle" )
- FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
- "invalid glyph slot handle" )
- FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
- "invalid charmap handle" )
- FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
- "invalid cache manager handle" )
- FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
- "invalid stream handle" )
-
- /* driver errors */
-
- FT_ERRORDEF_( Too_Many_Drivers, 0x30,
- "too many modules" )
- FT_ERRORDEF_( Too_Many_Extensions, 0x31,
- "too many extensions" )
-
- /* memory errors */
-
- FT_ERRORDEF_( Out_Of_Memory, 0x40,
- "out of memory" )
- FT_ERRORDEF_( Unlisted_Object, 0x41,
- "unlisted object" )
-
- /* stream errors */
-
- FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
- "cannot open stream" )
- FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
- "invalid stream seek" )
- FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
- "invalid stream skip" )
- FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
- "invalid stream read" )
- FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
- "invalid stream operation" )
- FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
- "invalid frame operation" )
- FT_ERRORDEF_( Nested_Frame_Access, 0x57,
- "nested frame access" )
- FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
- "invalid frame read" )
-
- /* raster errors */
-
- FT_ERRORDEF_( Raster_Uninitialized, 0x60,
- "raster uninitialized" )
- FT_ERRORDEF_( Raster_Corrupted, 0x61,
- "raster corrupted" )
- FT_ERRORDEF_( Raster_Overflow, 0x62,
- "raster overflow" )
- FT_ERRORDEF_( Raster_Negative_Height, 0x63,
- "negative height while rastering" )
-
- /* cache errors */
-
- FT_ERRORDEF_( Too_Many_Caches, 0x70,
- "too many registered caches" )
-
- /* TrueType and SFNT errors */
-
- FT_ERRORDEF_( Invalid_Opcode, 0x80,
- "invalid opcode" )
- FT_ERRORDEF_( Too_Few_Arguments, 0x81,
- "too few arguments" )
- FT_ERRORDEF_( Stack_Overflow, 0x82,
- "stack overflow" )
- FT_ERRORDEF_( Code_Overflow, 0x83,
- "code overflow" )
- FT_ERRORDEF_( Bad_Argument, 0x84,
- "bad argument" )
- FT_ERRORDEF_( Divide_By_Zero, 0x85,
- "division by zero" )
- FT_ERRORDEF_( Invalid_Reference, 0x86,
- "invalid reference" )
- FT_ERRORDEF_( Debug_OpCode, 0x87,
- "found debug opcode" )
- FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
- "found ENDF opcode in execution stream" )
- FT_ERRORDEF_( Nested_DEFS, 0x89,
- "nested DEFS" )
- FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
- "invalid code range" )
- FT_ERRORDEF_( Execution_Too_Long, 0x8B,
- "execution context too long" )
- FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
- "too many function definitions" )
- FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
- "too many instruction definitions" )
- FT_ERRORDEF_( Table_Missing, 0x8E,
- "SFNT font table missing" )
- FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
- "horizontal header (hhea) table missing" )
- FT_ERRORDEF_( Locations_Missing, 0x90,
- "locations (loca) table missing" )
- FT_ERRORDEF_( Name_Table_Missing, 0x91,
- "name table missing" )
- FT_ERRORDEF_( CMap_Table_Missing, 0x92,
- "character map (cmap) table missing" )
- FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
- "horizontal metrics (hmtx) table missing" )
- FT_ERRORDEF_( Post_Table_Missing, 0x94,
- "PostScript (post) table missing" )
- FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
- "invalid horizontal metrics" )
- FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
- "invalid character map (cmap) format" )
- FT_ERRORDEF_( Invalid_PPem, 0x97,
- "invalid ppem value" )
- FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
- "invalid vertical metrics" )
- FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
- "could not find context" )
- FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
- "invalid PostScript (post) table format" )
- FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
- "invalid PostScript (post) table" )
-
- /* CFF, CID, and Type 1 errors */
-
- FT_ERRORDEF_( Syntax_Error, 0xA0,
- "opcode syntax error" )
- FT_ERRORDEF_( Stack_Underflow, 0xA1,
- "argument stack underflow" )
- FT_ERRORDEF_( Ignore, 0xA2,
- "ignore" )
- FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
- "no Unicode glyph name found" )
- FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
- "glyph to big for hinting" )
-
- /* BDF errors */
-
- FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
- "`STARTFONT' field missing" )
- FT_ERRORDEF_( Missing_Font_Field, 0xB1,
- "`FONT' field missing" )
- FT_ERRORDEF_( Missing_Size_Field, 0xB2,
- "`SIZE' field missing" )
- FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
- "`FONTBOUNDINGBOX' field missing" )
- FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
- "`CHARS' field missing" )
- FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
- "`STARTCHAR' field missing" )
- FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
- "`ENCODING' field missing" )
- FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
- "`BBX' field missing" )
- FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
- "`BBX' too big" )
- FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
- "Font header corrupted or missing fields" )
- FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
- "Font glyphs corrupted or missing fields" )
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/fterrors.h b/src/3rdparty/freetype/include/fterrors.h
deleted file mode 100644
index 0fa3e4dce1..0000000000
--- a/src/3rdparty/freetype/include/fterrors.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/***************************************************************************/
-/* */
-/* fterrors.h */
-/* */
-/* FreeType error code handling (specification). */
-/* */
-/* Copyright 1996-2002, 2004, 2007, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This special header file is used to define the handling of FT2 */
- /* enumeration constants. It can also be used to generate error message */
- /* strings with a small macro trick explained below. */
- /* */
- /* I - Error Formats */
- /* ----------------- */
- /* */
- /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
- /* defined in ftoption.h in order to make the higher byte indicate */
- /* the module where the error has happened (this is not compatible */
- /* with standard builds of FreeType 2). See the file `ftmoderr.h' for */
- /* more details. */
- /* */
- /* */
- /* II - Error Message strings */
- /* -------------------------- */
- /* */
- /* The error definitions below are made through special macros that */
- /* allow client applications to build a table of error message strings */
- /* if they need it. The strings are not included in a normal build of */
- /* FreeType 2 to save space (most client applications do not use */
- /* them). */
- /* */
- /* To do so, you have to define the following macros before including */
- /* this file: */
- /* */
- /* FT_ERROR_START_LIST :: */
- /* This macro is called before anything else to define the start of */
- /* the error list. It is followed by several FT_ERROR_DEF calls */
- /* (see below). */
- /* */
- /* FT_ERROR_DEF( e, v, s ) :: */
- /* This macro is called to define one single error. */
- /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
- /* `v' is the error numerical value. */
- /* `s' is the corresponding error string. */
- /* */
- /* FT_ERROR_END_LIST :: */
- /* This macro ends the list. */
- /* */
- /* Additionally, you have to undefine __FTERRORS_H__ before #including */
- /* this file. */
- /* */
- /* Here is a simple example: */
- /* */
- /* { */
- /* #undef __FTERRORS_H__ */
- /* #define FT_ERRORDEF( e, v, s ) { e, s }, */
- /* #define FT_ERROR_START_LIST { */
- /* #define FT_ERROR_END_LIST { 0, 0 } }; */
- /* */
- /* const struct */
- /* { */
- /* int err_code; */
- /* const char* err_msg; */
- /* } ft_errors[] = */
- /* */
- /* #include FT_ERRORS_H */
- /* } */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTERRORS_H__
-#define __FTERRORS_H__
-
-
- /* include module base error codes */
-#include FT_MODULE_ERRORS_H
-
-
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** SETUP MACROS *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-
-#undef FT_NEED_EXTERN_C
-
-
- /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
- /* By default, we use `FT_Err_'. */
- /* */
-#ifndef FT_ERR_PREFIX
-#define FT_ERR_PREFIX FT_Err_
-#endif
-
-
- /* FT_ERR_BASE is used as the base for module-specific errors. */
- /* */
-#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
-
-#ifndef FT_ERR_BASE
-#define FT_ERR_BASE FT_Mod_Err_Base
-#endif
-
-#else
-
-#undef FT_ERR_BASE
-#define FT_ERR_BASE 0
-
-#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
-
-
- /* If FT_ERRORDEF is not defined, we need to define a simple */
- /* enumeration type. */
- /* */
-#ifndef FT_ERRORDEF
-
-#define FT_ERRORDEF( e, v, s ) e = v,
-#define FT_ERROR_START_LIST enum {
-#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
-
-#ifdef __cplusplus
-#define FT_NEED_EXTERN_C
- extern "C" {
-#endif
-
-#endif /* !FT_ERRORDEF */
-
-
- /* this macro is used to define an error */
-#define FT_ERRORDEF_( e, v, s ) \
- FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
-
- /* this is only used for <module>_Err_Ok, which must be 0! */
-#define FT_NOERRORDEF_( e, v, s ) \
- FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
-
-
-#ifdef FT_ERROR_START_LIST
- FT_ERROR_START_LIST
-#endif
-
-
- /* now include the error codes */
-#include FT_ERROR_DEFINITIONS_H
-
-
-#ifdef FT_ERROR_END_LIST
- FT_ERROR_END_LIST
-#endif
-
-
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** SIMPLE CLEANUP *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-#ifdef FT_NEED_EXTERN_C
- }
-#endif
-
-#undef FT_ERROR_START_LIST
-#undef FT_ERROR_END_LIST
-
-#undef FT_ERRORDEF
-#undef FT_ERRORDEF_
-#undef FT_NOERRORDEF_
-
-#undef FT_NEED_EXTERN_C
-#undef FT_ERR_BASE
-
- /* FT_ERR_PREFIX is needed internally */
-#ifndef FT2_BUILD_LIBRARY
-#undef FT_ERR_PREFIX
-#endif
-
-#endif /* __FTERRORS_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftgasp.h b/src/3rdparty/freetype/include/ftgasp.h
deleted file mode 100644
index 3f3d765467..0000000000
--- a/src/3rdparty/freetype/include/ftgasp.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftgasp.h */
-/* */
-/* Access of TrueType's `gasp' table (specification). */
-/* */
-/* Copyright 2007, 2008, 2011 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef _FT_GASP_H_
-#define _FT_GASP_H_
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
- /***************************************************************************
- *
- * @section:
- * gasp_table
- *
- * @title:
- * Gasp Table
- *
- * @abstract:
- * Retrieving TrueType `gasp' table entries.
- *
- * @description:
- * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
- * font for specific entries in its `gasp' table, if any. This is
- * mainly useful when implementing native TrueType hinting with the
- * bytecode interpreter to duplicate the Windows text rendering results.
- */
-
- /*************************************************************************
- *
- * @enum:
- * FT_GASP_XXX
- *
- * @description:
- * A list of values and/or bit-flags returned by the @FT_Get_Gasp
- * function.
- *
- * @values:
- * FT_GASP_NO_TABLE ::
- * This special value means that there is no GASP table in this face.
- * It is up to the client to decide what to do.
- *
- * FT_GASP_DO_GRIDFIT ::
- * Grid-fitting and hinting should be performed at the specified ppem.
- * This *really* means TrueType bytecode interpretation. If this bit
- * is not set, no hinting gets applied.
- *
- * FT_GASP_DO_GRAY ::
- * Anti-aliased rendering should be performed at the specified ppem.
- * If not set, do monochrome rendering.
- *
- * FT_GASP_SYMMETRIC_SMOOTHING ::
- * If set, smoothing along multiple axes must be used with ClearType.
- *
- * FT_GASP_SYMMETRIC_GRIDFIT ::
- * Grid-fitting must be used with ClearType's symmetric smoothing.
- *
- * @note:
- * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
- * used for standard font rasterization only. Independently of that,
- * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
- * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
- * `FT_GASP_DO_GRAY' are consequently ignored).
- *
- * `ClearType' is Microsoft's implementation of LCD rendering, partly
- * protected by patents.
- *
- * @since:
- * 2.3.0
- */
-#define FT_GASP_NO_TABLE -1
-#define FT_GASP_DO_GRIDFIT 0x01
-#define FT_GASP_DO_GRAY 0x02
-#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
-#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
-
-
- /*************************************************************************
- *
- * @func:
- * FT_Get_Gasp
- *
- * @description:
- * Read the `gasp' table from a TrueType or OpenType font file and
- * return the entry corresponding to a given character pixel size.
- *
- * @input:
- * face :: The source face handle.
- * ppem :: The vertical character pixel size.
- *
- * @return:
- * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
- * `gasp' table in the face.
- *
- * @since:
- * 2.3.0
- */
- FT_EXPORT( FT_Int )
- FT_Get_Gasp( FT_Face face,
- FT_UInt ppem );
-
- /* */
-
-
-#endif /* _FT_GASP_H_ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftglyph.h b/src/3rdparty/freetype/include/ftglyph.h
deleted file mode 100644
index 15fa6a9950..0000000000
--- a/src/3rdparty/freetype/include/ftglyph.h
+++ /dev/null
@@ -1,605 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftglyph.h */
-/* */
-/* FreeType convenience functions to handle glyphs (specification). */
-/* */
-/* Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file contains the definition of several convenience functions */
- /* that can be used by client applications to easily retrieve glyph */
- /* bitmaps and outlines from a given face. */
- /* */
- /* These functions should be optional if you are writing a font server */
- /* or text layout engine on top of FreeType. However, they are pretty */
- /* handy for many other simple uses of the library. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTGLYPH_H__
-#define __FTGLYPH_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* glyph_management */
- /* */
- /* <Title> */
- /* Glyph Management */
- /* */
- /* <Abstract> */
- /* Generic interface to manage individual glyph data. */
- /* */
- /* <Description> */
- /* This section contains definitions used to manage glyph data */
- /* through generic FT_Glyph objects. Each of them can contain a */
- /* bitmap, a vector outline, or even images in other formats. */
- /* */
- /*************************************************************************/
-
-
- /* forward declaration to a private type */
- typedef struct FT_Glyph_Class_ FT_Glyph_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Glyph */
- /* */
- /* <Description> */
- /* Handle to an object used to model generic glyph images. It is a */
- /* pointer to the @FT_GlyphRec structure and can contain a glyph */
- /* bitmap or pointer. */
- /* */
- /* <Note> */
- /* Glyph objects are not owned by the library. You must thus release */
- /* them manually (through @FT_Done_Glyph) _before_ calling */
- /* @FT_Done_FreeType. */
- /* */
- typedef struct FT_GlyphRec_* FT_Glyph;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphRec */
- /* */
- /* <Description> */
- /* The root glyph structure contains a given glyph image plus its */
- /* advance width in 16.16 fixed-point format. */
- /* */
- /* <Fields> */
- /* library :: A handle to the FreeType library object. */
- /* */
- /* clazz :: A pointer to the glyph's class. Private. */
- /* */
- /* format :: The format of the glyph's image. */
- /* */
- /* advance :: A 16.16 vector that gives the glyph's advance width. */
- /* */
- typedef struct FT_GlyphRec_
- {
- FT_Library library;
- const FT_Glyph_Class* clazz;
- FT_Glyph_Format format;
- FT_Vector advance;
-
- } FT_GlyphRec;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_BitmapGlyph */
- /* */
- /* <Description> */
- /* A handle to an object used to model a bitmap glyph image. This is */
- /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
- /* */
- typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_BitmapGlyphRec */
- /* */
- /* <Description> */
- /* A structure used for bitmap glyph images. This really is a */
- /* `sub-class' of @FT_GlyphRec. */
- /* */
- /* <Fields> */
- /* root :: The root @FT_Glyph fields. */
- /* */
- /* left :: The left-side bearing, i.e., the horizontal distance */
- /* from the current pen position to the left border of the */
- /* glyph bitmap. */
- /* */
- /* top :: The top-side bearing, i.e., the vertical distance from */
- /* the current pen position to the top border of the glyph */
- /* bitmap. This distance is positive for upwards~y! */
- /* */
- /* bitmap :: A descriptor for the bitmap. */
- /* */
- /* <Note> */
- /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
- /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
- /* the bitmap's contents easily. */
- /* */
- /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
- /* and is thus created and destroyed with it. */
- /* */
- typedef struct FT_BitmapGlyphRec_
- {
- FT_GlyphRec root;
- FT_Int left;
- FT_Int top;
- FT_Bitmap bitmap;
-
- } FT_BitmapGlyphRec;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_OutlineGlyph */
- /* */
- /* <Description> */
- /* A handle to an object used to model an outline glyph image. This */
- /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
- /* */
- typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_OutlineGlyphRec */
- /* */
- /* <Description> */
- /* A structure used for outline (vectorial) glyph images. This */
- /* really is a `sub-class' of @FT_GlyphRec. */
- /* */
- /* <Fields> */
- /* root :: The root @FT_Glyph fields. */
- /* */
- /* outline :: A descriptor for the outline. */
- /* */
- /* <Note> */
- /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
- /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
- /* the outline's content easily. */
- /* */
- /* As the outline is extracted from a glyph slot, its coordinates are */
- /* expressed normally in 26.6 pixels, unless the flag */
- /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
- /* */
- /* The outline's tables are always owned by the object and are */
- /* destroyed with it. */
- /* */
- typedef struct FT_OutlineGlyphRec_
- {
- FT_GlyphRec root;
- FT_Outline outline;
-
- } FT_OutlineGlyphRec;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph */
- /* */
- /* <Description> */
- /* A function used to extract a glyph image from a slot. Note that */
- /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */
- /* */
- /* <Input> */
- /* slot :: A handle to the source glyph slot. */
- /* */
- /* <Output> */
- /* aglyph :: A handle to the glyph object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Glyph( FT_GlyphSlot slot,
- FT_Glyph *aglyph );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Copy */
- /* */
- /* <Description> */
- /* A function used to copy a glyph image. Note that the created */
- /* @FT_Glyph object must be released with @FT_Done_Glyph. */
- /* */
- /* <Input> */
- /* source :: A handle to the source glyph object. */
- /* */
- /* <Output> */
- /* target :: A handle to the target glyph object. 0~in case of */
- /* error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Glyph_Copy( FT_Glyph source,
- FT_Glyph *target );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Transform */
- /* */
- /* <Description> */
- /* Transform a glyph image if its format is scalable. */
- /* */
- /* <InOut> */
- /* glyph :: A handle to the target glyph object. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to a 2x2 matrix to apply. */
- /* */
- /* delta :: A pointer to a 2d vector to apply. Coordinates are */
- /* expressed in 1/64th of a pixel. */
- /* */
- /* <Return> */
- /* FreeType error code (if not 0, the glyph format is not scalable). */
- /* */
- /* <Note> */
- /* The 2x2 transformation matrix is also applied to the glyph's */
- /* advance vector. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Glyph_Transform( FT_Glyph glyph,
- FT_Matrix* matrix,
- FT_Vector* delta );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Glyph_BBox_Mode */
- /* */
- /* <Description> */
- /* The mode how the values of @FT_Glyph_Get_CBox are returned. */
- /* */
- /* <Values> */
- /* FT_GLYPH_BBOX_UNSCALED :: */
- /* Return unscaled font units. */
- /* */
- /* FT_GLYPH_BBOX_SUBPIXELS :: */
- /* Return unfitted 26.6 coordinates. */
- /* */
- /* FT_GLYPH_BBOX_GRIDFIT :: */
- /* Return grid-fitted 26.6 coordinates. */
- /* */
- /* FT_GLYPH_BBOX_TRUNCATE :: */
- /* Return coordinates in integer pixels. */
- /* */
- /* FT_GLYPH_BBOX_PIXELS :: */
- /* Return grid-fitted pixel coordinates. */
- /* */
- typedef enum FT_Glyph_BBox_Mode_
- {
- FT_GLYPH_BBOX_UNSCALED = 0,
- FT_GLYPH_BBOX_SUBPIXELS = 0,
- FT_GLYPH_BBOX_GRIDFIT = 1,
- FT_GLYPH_BBOX_TRUNCATE = 2,
- FT_GLYPH_BBOX_PIXELS = 3
-
- } FT_Glyph_BBox_Mode;
-
-
- /* these constants are deprecated; use the corresponding */
- /* `FT_Glyph_BBox_Mode' values instead */
-#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
-#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
-#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
-#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
-#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Get_CBox */
- /* */
- /* <Description> */
- /* Return a glyph's `control box'. The control box encloses all the */
- /* outline's points, including Bézier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* that contains Bézier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component, which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the source glyph object. */
- /* */
- /* mode :: The mode that indicates how to interpret the returned */
- /* bounding box values. */
- /* */
- /* <Output> */
- /* acbox :: The glyph coordinate bounding box. Coordinates are */
- /* expressed in 1/64th of pixels if it is grid-fitted. */
- /* */
- /* <Note> */
- /* Coordinates are relative to the glyph origin, using the y~upwards */
- /* convention. */
- /* */
- /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
- /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
- /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
- /* is another name for this constant. */
- /* */
- /* If the font is tricky and the glyph has been loaded with */
- /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */
- /* reasonable values for the CBox it is necessary to load the glyph */
- /* at a large ppem value (so that the hinting instructions can */
- /* properly shift and scale the subglyphs), then extracting the CBox, */
- /* which can be eventually converted back to font units. */
- /* */
- /* Note that the maximum coordinates are exclusive, which means that */
- /* one can compute the width and height of the glyph image (be it in */
- /* integer or 26.6 pixels) as: */
- /* */
- /* { */
- /* width = bbox.xMax - bbox.xMin; */
- /* height = bbox.yMax - bbox.yMin; */
- /* } */
- /* */
- /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
- /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
- /* which corresponds to: */
- /* */
- /* { */
- /* bbox.xMin = FLOOR(bbox.xMin); */
- /* bbox.yMin = FLOOR(bbox.yMin); */
- /* bbox.xMax = CEILING(bbox.xMax); */
- /* bbox.yMax = CEILING(bbox.yMax); */
- /* } */
- /* */
- /* To get the bbox in pixel coordinates, set `bbox_mode' to */
- /* @FT_GLYPH_BBOX_TRUNCATE. */
- /* */
- /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
- /* to @FT_GLYPH_BBOX_PIXELS. */
- /* */
- FT_EXPORT( void )
- FT_Glyph_Get_CBox( FT_Glyph glyph,
- FT_UInt bbox_mode,
- FT_BBox *acbox );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_To_Bitmap */
- /* */
- /* <Description> */
- /* Convert a given glyph object to a bitmap glyph object. */
- /* */
- /* <InOut> */
- /* the_glyph :: A pointer to a handle to the target glyph. */
- /* */
- /* <Input> */
- /* render_mode :: An enumeration that describes how the data is */
- /* rendered. */
- /* */
- /* origin :: A pointer to a vector used to translate the glyph */
- /* image before rendering. Can be~0 (if no */
- /* translation). The origin is expressed in */
- /* 26.6 pixels. */
- /* */
- /* destroy :: A boolean that indicates that the original glyph */
- /* image should be destroyed by this function. It is */
- /* never destroyed in case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function does nothing if the glyph format isn't scalable. */
- /* */
- /* The glyph image is translated with the `origin' vector before */
- /* rendering. */
- /* */
- /* The first parameter is a pointer to an @FT_Glyph handle, that will */
- /* be _replaced_ by this function (with newly allocated data). */
- /* Typically, you would use (omitting error handling): */
- /* */
- /* */
- /* { */
- /* FT_Glyph glyph; */
- /* FT_BitmapGlyph glyph_bitmap; */
- /* */
- /* */
- /* // load glyph */
- /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
- /* */
- /* // extract glyph image */
- /* error = FT_Get_Glyph( face->glyph, &glyph ); */
- /* */
- /* // convert to a bitmap (default render mode + destroying old) */
- /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
- /* { */
- /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
- /* 0, 1 ); */
- /* if ( error ) // `glyph' unchanged */
- /* ... */
- /* } */
- /* */
- /* // access bitmap content by typecasting */
- /* glyph_bitmap = (FT_BitmapGlyph)glyph; */
- /* */
- /* // do funny stuff with it, like blitting/drawing */
- /* ... */
- /* */
- /* // discard glyph image (bitmap or not) */
- /* FT_Done_Glyph( glyph ); */
- /* } */
- /* */
- /* */
- /* Here another example, again without error handling: */
- /* */
- /* */
- /* { */
- /* FT_Glyph glyphs[MAX_GLYPHS] */
- /* */
- /* */
- /* ... */
- /* */
- /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
- /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */
- /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */
- /* */
- /* ... */
- /* */
- /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
- /* { */
- /* FT_Glyph bitmap = glyphs[idx]; */
- /* */
- /* */
- /* ... */
- /* */
- /* // after this call, `bitmap' no longer points into */
- /* // the `glyphs' array (and the old value isn't destroyed) */
- /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */
- /* */
- /* ... */
- /* */
- /* FT_Done_Glyph( bitmap ); */
- /* } */
- /* */
- /* ... */
- /* */
- /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
- /* FT_Done_Glyph( glyphs[idx] ); */
- /* } */
- /* */
- FT_EXPORT( FT_Error )
- FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
- FT_Render_Mode render_mode,
- FT_Vector* origin,
- FT_Bool destroy );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Glyph */
- /* */
- /* <Description> */
- /* Destroy a given glyph. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the target glyph object. */
- /* */
- FT_EXPORT( void )
- FT_Done_Glyph( FT_Glyph glyph );
-
- /* */
-
-
- /* other helpful functions */
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Multiply */
- /* */
- /* <Description> */
- /* Perform the matrix operation `b = a*b'. */
- /* */
- /* <Input> */
- /* a :: A pointer to matrix `a'. */
- /* */
- /* <InOut> */
- /* b :: A pointer to matrix `b'. */
- /* */
- /* <Note> */
- /* The result is undefined if either `a' or `b' is zero. */
- /* */
- FT_EXPORT( void )
- FT_Matrix_Multiply( const FT_Matrix* a,
- FT_Matrix* b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Invert */
- /* */
- /* <Description> */
- /* Invert a 2x2 matrix. Return an error if it can't be inverted. */
- /* */
- /* <InOut> */
- /* matrix :: A pointer to the target matrix. Remains untouched in */
- /* case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Matrix_Invert( FT_Matrix* matrix );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTGLYPH_H__ */
-
-
-/* END */
-
-
-/* Local Variables: */
-/* coding: utf-8 */
-/* End: */
diff --git a/src/3rdparty/freetype/include/ftgxval.h b/src/3rdparty/freetype/include/ftgxval.h
deleted file mode 100644
index 88c3d93750..0000000000
--- a/src/3rdparty/freetype/include/ftgxval.h
+++ /dev/null
@@ -1,357 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftgxval.h */
-/* */
-/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
-/* */
-/* Copyright 2004-2006, 2013 by */
-/* Masatake YAMATO, Redhat K.K, */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTGXVAL_H__
-#define __FTGXVAL_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* gx_validation */
- /* */
- /* <Title> */
- /* TrueTypeGX/AAT Validation */
- /* */
- /* <Abstract> */
- /* An API to validate TrueTypeGX/AAT tables. */
- /* */
- /* <Description> */
- /* This section contains the declaration of functions to validate */
- /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
- /* trak, prop, lcar). */
- /* */
- /* <Order> */
- /* FT_TrueTypeGX_Validate */
- /* FT_TrueTypeGX_Free */
- /* */
- /* FT_ClassicKern_Validate */
- /* FT_ClassicKern_Free */
- /* */
- /* FT_VALIDATE_GX_LENGTH */
- /* FT_VALIDATE_GXXXX */
- /* FT_VALIDATE_CKERNXXX */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* */
- /* Warning: Use FT_VALIDATE_XXX to validate a table. */
- /* Following definitions are for gxvalid developers. */
- /* */
- /* */
- /*************************************************************************/
-
-#define FT_VALIDATE_feat_INDEX 0
-#define FT_VALIDATE_mort_INDEX 1
-#define FT_VALIDATE_morx_INDEX 2
-#define FT_VALIDATE_bsln_INDEX 3
-#define FT_VALIDATE_just_INDEX 4
-#define FT_VALIDATE_kern_INDEX 5
-#define FT_VALIDATE_opbd_INDEX 6
-#define FT_VALIDATE_trak_INDEX 7
-#define FT_VALIDATE_prop_INDEX 8
-#define FT_VALIDATE_lcar_INDEX 9
-#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_VALIDATE_GX_LENGTH
- *
- * @description:
- * The number of tables checked in this module. Use it as a parameter
- * for the `table-length' argument of function @FT_TrueTypeGX_Validate.
- */
-#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
-
- /* */
-
- /* Up to 0x1000 is used by otvalid.
- Ox2xxx is reserved for feature OT extension. */
-#define FT_VALIDATE_GX_START 0x4000
-#define FT_VALIDATE_GX_BITFIELD( tag ) \
- ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
-
-
- /**********************************************************************
- *
- * @enum:
- * FT_VALIDATE_GXXXX
- *
- * @description:
- * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
- * indicate which TrueTypeGX/AAT Type tables should be validated.
- *
- * @values:
- * FT_VALIDATE_feat ::
- * Validate `feat' table.
- *
- * FT_VALIDATE_mort ::
- * Validate `mort' table.
- *
- * FT_VALIDATE_morx ::
- * Validate `morx' table.
- *
- * FT_VALIDATE_bsln ::
- * Validate `bsln' table.
- *
- * FT_VALIDATE_just ::
- * Validate `just' table.
- *
- * FT_VALIDATE_kern ::
- * Validate `kern' table.
- *
- * FT_VALIDATE_opbd ::
- * Validate `opbd' table.
- *
- * FT_VALIDATE_trak ::
- * Validate `trak' table.
- *
- * FT_VALIDATE_prop ::
- * Validate `prop' table.
- *
- * FT_VALIDATE_lcar ::
- * Validate `lcar' table.
- *
- * FT_VALIDATE_GX ::
- * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
- * opbd, trak, prop and lcar).
- *
- */
-
-#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
-#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
-#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
-#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
-#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
-#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
-#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
-#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
-#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
-#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
-
-#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
- FT_VALIDATE_mort | \
- FT_VALIDATE_morx | \
- FT_VALIDATE_bsln | \
- FT_VALIDATE_just | \
- FT_VALIDATE_kern | \
- FT_VALIDATE_opbd | \
- FT_VALIDATE_trak | \
- FT_VALIDATE_prop | \
- FT_VALIDATE_lcar )
-
-
- /**********************************************************************
- *
- * @function:
- * FT_TrueTypeGX_Validate
- *
- * @description:
- * Validate various TrueTypeGX tables to assure that all offsets and
- * indices are valid. The idea is that a higher-level library that
- * actually does the text layout can access those tables without
- * error checking (which can be quite time consuming).
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * validation_flags ::
- * A bit field that specifies the tables to be validated. See
- * @FT_VALIDATE_GXXXX for possible values.
- *
- * table_length ::
- * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
- * should be passed.
- *
- * @output:
- * tables ::
- * The array where all validated sfnt tables are stored.
- * The array itself must be allocated by a client.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with TrueTypeGX fonts, returning an error
- * otherwise.
- *
- * After use, the application should deallocate the buffers pointed to by
- * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
- * indicates that the table either doesn't exist in the font, the
- * application hasn't asked for validation, or the validator doesn't have
- * the ability to validate the sfnt table.
- */
- FT_EXPORT( FT_Error )
- FT_TrueTypeGX_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
- FT_UInt table_length );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_TrueTypeGX_Free
- *
- * @description:
- * Free the buffer allocated by TrueTypeGX validator.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * table ::
- * The pointer to the buffer allocated by
- * @FT_TrueTypeGX_Validate.
- *
- * @note:
- * This function must be used to free the buffer allocated by
- * @FT_TrueTypeGX_Validate only.
- */
- FT_EXPORT( void )
- FT_TrueTypeGX_Free( FT_Face face,
- FT_Bytes table );
-
-
- /**********************************************************************
- *
- * @enum:
- * FT_VALIDATE_CKERNXXX
- *
- * @description:
- * A list of bit-field constants used with @FT_ClassicKern_Validate
- * to indicate the classic kern dialect or dialects. If the selected
- * type doesn't fit, @FT_ClassicKern_Validate regards the table as
- * invalid.
- *
- * @values:
- * FT_VALIDATE_MS ::
- * Handle the `kern' table as a classic Microsoft kern table.
- *
- * FT_VALIDATE_APPLE ::
- * Handle the `kern' table as a classic Apple kern table.
- *
- * FT_VALIDATE_CKERN ::
- * Handle the `kern' as either classic Apple or Microsoft kern table.
- */
-#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
-#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
-
-#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
-
-
- /**********************************************************************
- *
- * @function:
- * FT_ClassicKern_Validate
- *
- * @description:
- * Validate classic (16-bit format) kern table to assure that the offsets
- * and indices are valid. The idea is that a higher-level library that
- * actually does the text layout can access those tables without error
- * checking (which can be quite time consuming).
- *
- * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
- * the new 32-bit format and the classic 16-bit format, while
- * FT_ClassicKern_Validate only supports the classic 16-bit format.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * validation_flags ::
- * A bit field that specifies the dialect to be validated. See
- * @FT_VALIDATE_CKERNXXX for possible values.
- *
- * @output:
- * ckern_table ::
- * A pointer to the kern table.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * After use, the application should deallocate the buffers pointed to by
- * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
- * indicates that the table doesn't exist in the font.
- */
- FT_EXPORT( FT_Error )
- FT_ClassicKern_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes *ckern_table );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_ClassicKern_Free
- *
- * @description:
- * Free the buffer allocated by classic Kern validator.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * table ::
- * The pointer to the buffer that is allocated by
- * @FT_ClassicKern_Validate.
- *
- * @note:
- * This function must be used to free the buffer allocated by
- * @FT_ClassicKern_Validate only.
- */
- FT_EXPORT( void )
- FT_ClassicKern_Free( FT_Face face,
- FT_Bytes table );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTGXVAL_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftgzip.h b/src/3rdparty/freetype/include/ftgzip.h
deleted file mode 100644
index eb346c6dc7..0000000000
--- a/src/3rdparty/freetype/include/ftgzip.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftgzip.h */
-/* */
-/* Gzip-compressed stream support. */
-/* */
-/* Copyright 2002-2004, 2006, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTGZIP_H__
-#define __FTGZIP_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* gzip */
- /* */
- /* <Title> */
- /* GZIP Streams */
- /* */
- /* <Abstract> */
- /* Using gzip-compressed font files. */
- /* */
- /* <Description> */
- /* This section contains the declaration of Gzip-specific functions. */
- /* */
- /*************************************************************************/
-
-
- /************************************************************************
- *
- * @function:
- * FT_Stream_OpenGzip
- *
- * @description:
- * Open a new stream to parse gzip-compressed font files. This is
- * mainly used to support the compressed `*.pcf.gz' fonts that come
- * with XFree86.
- *
- * @input:
- * stream ::
- * The target embedding stream.
- *
- * source ::
- * The source stream.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source stream must be opened _before_ calling this function.
- *
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- *
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream.
- *
- * In certain builds of the library, gzip compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a gzipped stream from
- * it and re-open the face with it.
- *
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with zlib support.
- */
- FT_EXPORT( FT_Error )
- FT_Stream_OpenGzip( FT_Stream stream,
- FT_Stream source );
-
-
- /************************************************************************
- *
- * @function:
- * FT_Gzip_Uncompress
- *
- * @description:
- * Decompress a zipped input buffer into an output buffer. This function
- * is modeled after zlib's `uncompress' function.
- *
- * @input:
- * memory ::
- * A FreeType memory handle.
- *
- * input ::
- * The input buffer.
- *
- * input_len ::
- * The length of the input buffer.
- *
- * @output:
- * output::
- * The output buffer.
- *
- * @inout:
- * output_len ::
- * Before calling the function, this is the the total size of the
- * output buffer, which must be large enough to hold the entire
- * uncompressed data (so the size of the uncompressed data must be
- * known in advance). After calling the function, `output_len' is the
- * size of the used data in `output'.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with zlib support.
- */
- FT_EXPORT( FT_Error )
- FT_Gzip_Uncompress( FT_Memory memory,
- FT_Byte* output,
- FT_ULong* output_len,
- const FT_Byte* input,
- FT_ULong input_len );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTGZIP_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftimage.h b/src/3rdparty/freetype/include/ftimage.h
deleted file mode 100644
index 2f7ca2aaf5..0000000000
--- a/src/3rdparty/freetype/include/ftimage.h
+++ /dev/null
@@ -1,1220 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftimage.h */
-/* */
-/* FreeType glyph image formats and default raster interface */
-/* (specification). */
-/* */
-/* Copyright 1996-2010, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Note: A `raster' is simply a scan-line converter, used to render */
- /* FT_Outlines into FT_Bitmaps. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTIMAGE_H__
-#define __FTIMAGE_H__
-
-
- /* _STANDALONE_ is from ftgrays.c */
-#ifndef _STANDALONE_
-#include <ft2build.h>
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Pos */
- /* */
- /* <Description> */
- /* The type FT_Pos is used to store vectorial coordinates. Depending */
- /* on the context, these can represent distances in integer font */
- /* units, or 16.16, or 26.6 fixed-point pixel coordinates. */
- /* */
- typedef signed long FT_Pos;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Vector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2D vector; coordinates are of */
- /* the FT_Pos type. */
- /* */
- /* <Fields> */
- /* x :: The horizontal coordinate. */
- /* y :: The vertical coordinate. */
- /* */
- typedef struct FT_Vector_
- {
- FT_Pos x;
- FT_Pos y;
-
- } FT_Vector;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_BBox */
- /* */
- /* <Description> */
- /* A structure used to hold an outline's bounding box, i.e., the */
- /* coordinates of its extrema in the horizontal and vertical */
- /* directions. */
- /* */
- /* <Fields> */
- /* xMin :: The horizontal minimum (left-most). */
- /* */
- /* yMin :: The vertical minimum (bottom-most). */
- /* */
- /* xMax :: The horizontal maximum (right-most). */
- /* */
- /* yMax :: The vertical maximum (top-most). */
- /* */
- /* <Note> */
- /* The bounding box is specified with the coordinates of the lower */
- /* left and the upper right corner. In PostScript, those values are */
- /* often called (llx,lly) and (urx,ury), respectively. */
- /* */
- /* If `yMin' is negative, this value gives the glyph's descender. */
- /* Otherwise, the glyph doesn't descend below the baseline. */
- /* Similarly, if `ymax' is positive, this value gives the glyph's */
- /* ascender. */
- /* */
- /* `xMin' gives the horizontal distance from the glyph's origin to */
- /* the left edge of the glyph's bounding box. If `xMin' is negative, */
- /* the glyph extends to the left of the origin. */
- /* */
- typedef struct FT_BBox_
- {
- FT_Pos xMin, yMin;
- FT_Pos xMax, yMax;
-
- } FT_BBox;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Pixel_Mode */
- /* */
- /* <Description> */
- /* An enumeration type used to describe the format of pixels in a */
- /* given bitmap. Note that additional formats may be added in the */
- /* future. */
- /* */
- /* <Values> */
- /* FT_PIXEL_MODE_NONE :: */
- /* Value~0 is reserved. */
- /* */
- /* FT_PIXEL_MODE_MONO :: */
- /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */
- /* are stored in most-significant order (MSB), which means that */
- /* the left-most pixel in a byte has value 128. */
- /* */
- /* FT_PIXEL_MODE_GRAY :: */
- /* An 8-bit bitmap, generally used to represent anti-aliased glyph */
- /* images. Each pixel is stored in one byte. Note that the number */
- /* of `gray' levels is stored in the `num_grays' field of the */
- /* @FT_Bitmap structure (it generally is 256). */
- /* */
- /* FT_PIXEL_MODE_GRAY2 :: */
- /* A 2-bit per pixel bitmap, used to represent embedded */
- /* anti-aliased bitmaps in font files according to the OpenType */
- /* specification. We haven't found a single font using this */
- /* format, however. */
- /* */
- /* FT_PIXEL_MODE_GRAY4 :: */
- /* A 4-bit per pixel bitmap, representing embedded anti-aliased */
- /* bitmaps in font files according to the OpenType specification. */
- /* We haven't found a single font using this format, however. */
- /* */
- /* FT_PIXEL_MODE_LCD :: */
- /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
- /* used for display on LCD displays; the bitmap is three times */
- /* wider than the original glyph image. See also */
- /* @FT_RENDER_MODE_LCD. */
- /* */
- /* FT_PIXEL_MODE_LCD_V :: */
- /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
- /* used for display on rotated LCD displays; the bitmap is three */
- /* times taller than the original glyph image. See also */
- /* @FT_RENDER_MODE_LCD_V. */
- /* */
- /* FT_PIXEL_MODE_BGRA :: */
- /* An image with four 8-bit channels per pixel, representing a */
- /* color image (such as emoticons) with alpha channel. For each */
- /* pixel, the format is BGRA, which means, the blue channel comes */
- /* first in memory. The color channels are pre-multiplied and in */
- /* the sRGB colorspace. For example, full red at half-translucent */
- /* opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */
- /* See also @FT_LOAD_COLOR. */
- /* */
- typedef enum FT_Pixel_Mode_
- {
- FT_PIXEL_MODE_NONE = 0,
- FT_PIXEL_MODE_MONO,
- FT_PIXEL_MODE_GRAY,
- FT_PIXEL_MODE_GRAY2,
- FT_PIXEL_MODE_GRAY4,
- FT_PIXEL_MODE_LCD,
- FT_PIXEL_MODE_LCD_V,
- FT_PIXEL_MODE_BGRA,
-
- FT_PIXEL_MODE_MAX /* do not remove */
-
- } FT_Pixel_Mode;
-
-
- /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */
- /* values instead. */
-#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
-#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
-#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
-#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
-#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Bitmap */
- /* */
- /* <Description> */
- /* A structure used to describe a bitmap or pixmap to the raster. */
- /* Note that we now manage pixmaps of various depths through the */
- /* `pixel_mode' field. */
- /* */
- /* <Fields> */
- /* rows :: The number of bitmap rows. */
- /* */
- /* width :: The number of pixels in bitmap row. */
- /* */
- /* pitch :: The pitch's absolute value is the number of bytes */
- /* taken by one bitmap row, including padding. */
- /* However, the pitch is positive when the bitmap has */
- /* a `down' flow, and negative when it has an `up' */
- /* flow. In all cases, the pitch is an offset to add */
- /* to a bitmap pointer in order to go down one row. */
- /* */
- /* Note that `padding' means the alignment of a */
- /* bitmap to a byte border, and FreeType functions */
- /* normally align to the smallest possible integer */
- /* value. */
- /* */
- /* For the B/W rasterizer, `pitch' is always an even */
- /* number. */
- /* */
- /* To change the pitch of a bitmap (say, to make it a */
- /* multiple of 4), use @FT_Bitmap_Convert. */
- /* Alternatively, you might use callback functions to */
- /* directly render to the application's surface; see */
- /* the file `example2.cpp' in the tutorial for a */
- /* demonstration. */
- /* */
- /* buffer :: A typeless pointer to the bitmap buffer. This */
- /* value should be aligned on 32-bit boundaries in */
- /* most cases. */
- /* */
- /* num_grays :: This field is only used with */
- /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
- /* levels used in the bitmap. */
- /* */
- /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
- /* See @FT_Pixel_Mode for possible values. */
- /* */
- /* palette_mode :: This field is intended for paletted pixel modes; */
- /* it indicates how the palette is stored. Not */
- /* used currently. */
- /* */
- /* palette :: A typeless pointer to the bitmap palette; this */
- /* field is intended for paletted pixel modes. Not */
- /* used currently. */
- /* */
- /* <Note> */
- /* For now, the only pixel modes supported by FreeType are mono and */
- /* grays. However, drivers might be added in the future to support */
- /* more `colorful' options. */
- /* */
- typedef struct FT_Bitmap_
- {
- unsigned int rows;
- unsigned int width;
- int pitch;
- unsigned char* buffer;
- unsigned short num_grays;
- unsigned char pixel_mode;
- unsigned char palette_mode;
- void* palette;
-
- } FT_Bitmap;
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* outline_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Outline */
- /* */
- /* <Description> */
- /* This structure is used to describe an outline to the scan-line */
- /* converter. */
- /* */
- /* <Fields> */
- /* n_contours :: The number of contours in the outline. */
- /* */
- /* n_points :: The number of points in the outline. */
- /* */
- /* points :: A pointer to an array of `n_points' @FT_Vector */
- /* elements, giving the outline's point coordinates. */
- /* */
- /* tags :: A pointer to an array of `n_points' chars, giving */
- /* each outline point's type. */
- /* */
- /* If bit~0 is unset, the point is `off' the curve, */
- /* i.e., a Bézier control point, while it is `on' if */
- /* set. */
- /* */
- /* Bit~1 is meaningful for `off' points only. If set, */
- /* it indicates a third-order Bézier arc control point; */
- /* and a second-order control point if unset. */
- /* */
- /* If bit~2 is set, bits 5-7 contain the drop-out mode */
- /* (as defined in the OpenType specification; the value */
- /* is the same as the argument to the SCANMODE */
- /* instruction). */
- /* */
- /* Bits 3 and~4 are reserved for internal purposes. */
- /* */
- /* contours :: An array of `n_contours' shorts, giving the end */
- /* point of each contour within the outline. For */
- /* example, the first contour is defined by the points */
- /* `0' to `contours[0]', the second one is defined by */
- /* the points `contours[0]+1' to `contours[1]', etc. */
- /* */
- /* flags :: A set of bit flags used to characterize the outline */
- /* and give hints to the scan-converter and hinter on */
- /* how to convert/grid-fit it. See @FT_OUTLINE_XXX. */
- /* */
- /* <Note> */
- /* The B/W rasterizer only checks bit~2 in the `tags' array for the */
- /* first point of each contour. The drop-out mode as given with */
- /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */
- /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */
- /* */
- typedef struct FT_Outline_
- {
- short n_contours; /* number of contours in glyph */
- short n_points; /* number of points in the glyph */
-
- FT_Vector* points; /* the outline's points */
- char* tags; /* the points flags */
- short* contours; /* the contour end points */
-
- int flags; /* outline masks */
-
- } FT_Outline;
-
- /* */
-
- /* Following limits must be consistent with */
- /* FT_Outline.{n_contours,n_points} */
-#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
-#define FT_OUTLINE_POINTS_MAX SHRT_MAX
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_OUTLINE_XXX */
- /* */
- /* <Description> */
- /* A list of bit-field constants use for the flags in an outline's */
- /* `flags' field. */
- /* */
- /* <Values> */
- /* FT_OUTLINE_NONE :: */
- /* Value~0 is reserved. */
- /* */
- /* FT_OUTLINE_OWNER :: */
- /* If set, this flag indicates that the outline's field arrays */
- /* (i.e., `points', `flags', and `contours') are `owned' by the */
- /* outline object, and should thus be freed when it is destroyed. */
- /* */
- /* FT_OUTLINE_EVEN_ODD_FILL :: */
- /* By default, outlines are filled using the non-zero winding rule. */
- /* If set to 1, the outline will be filled using the even-odd fill */
- /* rule (only works with the smooth rasterizer). */
- /* */
- /* FT_OUTLINE_REVERSE_FILL :: */
- /* By default, outside contours of an outline are oriented in */
- /* clock-wise direction, as defined in the TrueType specification. */
- /* This flag is set if the outline uses the opposite direction */
- /* (typically for Type~1 fonts). This flag is ignored by the scan */
- /* converter. */
- /* */
- /* FT_OUTLINE_IGNORE_DROPOUTS :: */
- /* By default, the scan converter will try to detect drop-outs in */
- /* an outline and correct the glyph bitmap to ensure consistent */
- /* shape continuity. If set, this flag hints the scan-line */
- /* converter to ignore such cases. See below for more information. */
- /* */
- /* FT_OUTLINE_SMART_DROPOUTS :: */
- /* Select smart dropout control. If unset, use simple dropout */
- /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */
- /* below for more information. */
- /* */
- /* FT_OUTLINE_INCLUDE_STUBS :: */
- /* If set, turn pixels on for `stubs', otherwise exclude them. */
- /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */
- /* more information. */
- /* */
- /* FT_OUTLINE_HIGH_PRECISION :: */
- /* This flag indicates that the scan-line converter should try to */
- /* convert this outline to bitmaps with the highest possible */
- /* quality. It is typically set for small character sizes. Note */
- /* that this is only a hint that might be completely ignored by a */
- /* given scan-converter. */
- /* */
- /* FT_OUTLINE_SINGLE_PASS :: */
- /* This flag is set to force a given scan-converter to only use a */
- /* single pass over the outline to render a bitmap glyph image. */
- /* Normally, it is set for very large character sizes. It is only */
- /* a hint that might be completely ignored by a given */
- /* scan-converter. */
- /* */
- /* <Note> */
- /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */
- /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */
- /* rasterizer. */
- /* */
- /* There exists a second mechanism to pass the drop-out mode to the */
- /* B/W rasterizer; see the `tags' field in @FT_Outline. */
- /* */
- /* Please refer to the description of the `SCANTYPE' instruction in */
- /* the OpenType specification (in file `ttinst1.doc') how simple */
- /* drop-outs, smart drop-outs, and stubs are defined. */
- /* */
-#define FT_OUTLINE_NONE 0x0
-#define FT_OUTLINE_OWNER 0x1
-#define FT_OUTLINE_EVEN_ODD_FILL 0x2
-#define FT_OUTLINE_REVERSE_FILL 0x4
-#define FT_OUTLINE_IGNORE_DROPOUTS 0x8
-#define FT_OUTLINE_SMART_DROPOUTS 0x10
-#define FT_OUTLINE_INCLUDE_STUBS 0x20
-
-#define FT_OUTLINE_HIGH_PRECISION 0x100
-#define FT_OUTLINE_SINGLE_PASS 0x200
-
-
- /* these constants are deprecated; use the corresponding */
- /* `FT_OUTLINE_XXX' values instead */
-#define ft_outline_none FT_OUTLINE_NONE
-#define ft_outline_owner FT_OUTLINE_OWNER
-#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
-#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
-#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
-#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
-#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
-
- /* */
-
-#define FT_CURVE_TAG( flag ) ( flag & 3 )
-
-#define FT_CURVE_TAG_ON 1
-#define FT_CURVE_TAG_CONIC 0
-#define FT_CURVE_TAG_CUBIC 2
-
-#define FT_CURVE_TAG_HAS_SCANMODE 4
-
-#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */
-#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
-
-#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
- FT_CURVE_TAG_TOUCH_Y )
-
-#define FT_Curve_Tag_On FT_CURVE_TAG_ON
-#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
-#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
-#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
-#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_MoveToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `move */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `move to' is emitted to start a new contour in an outline. */
- /* */
- /* <Input> */
- /* to :: A pointer to the target point of the `move to'. */
- /* */
- /* user :: A typeless pointer, which is passed from the caller of the */
- /* decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_MoveToFunc)( const FT_Vector* to,
- void* user );
-
-#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_LineToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `line */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `line to' is emitted to indicate a segment in the outline. */
- /* */
- /* <Input> */
- /* to :: A pointer to the target point of the `line to'. */
- /* */
- /* user :: A typeless pointer, which is passed from the caller of the */
- /* decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_LineToFunc)( const FT_Vector* to,
- void* user );
-
-#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_ConicToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `conic */
- /* to' function during outline walking or decomposition. */
- /* */
- /* A `conic to' is emitted to indicate a second-order Bézier arc in */
- /* the outline. */
- /* */
- /* <Input> */
- /* control :: An intermediate control point between the last position */
- /* and the new target in `to'. */
- /* */
- /* to :: A pointer to the target end point of the conic arc. */
- /* */
- /* user :: A typeless pointer, which is passed from the caller of */
- /* the decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_ConicToFunc)( const FT_Vector* control,
- const FT_Vector* to,
- void* user );
-
-#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_CubicToFunc */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `cubic */
- /* to' function during outline walking or decomposition. */
- /* */
- /* A `cubic to' is emitted to indicate a third-order Bézier arc. */
- /* */
- /* <Input> */
- /* control1 :: A pointer to the first Bézier control point. */
- /* */
- /* control2 :: A pointer to the second Bézier control point. */
- /* */
- /* to :: A pointer to the target end point. */
- /* */
- /* user :: A typeless pointer, which is passed from the caller of */
- /* the decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- typedef int
- (*FT_Outline_CubicToFunc)( const FT_Vector* control1,
- const FT_Vector* control2,
- const FT_Vector* to,
- void* user );
-
-#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Outline_Funcs */
- /* */
- /* <Description> */
- /* A structure to hold various function pointers used during outline */
- /* decomposition in order to emit segments, conic, and cubic Béziers. */
- /* */
- /* <Fields> */
- /* move_to :: The `move to' emitter. */
- /* */
- /* line_to :: The segment emitter. */
- /* */
- /* conic_to :: The second-order Bézier arc emitter. */
- /* */
- /* cubic_to :: The third-order Bézier arc emitter. */
- /* */
- /* shift :: The shift that is applied to coordinates before they */
- /* are sent to the emitter. */
- /* */
- /* delta :: The delta that is applied to coordinates before they */
- /* are sent to the emitter, but after the shift. */
- /* */
- /* <Note> */
- /* The point coordinates sent to the emitters are the transformed */
- /* version of the original coordinates (this is important for high */
- /* accuracy during scan-conversion). The transformation is simple: */
- /* */
- /* { */
- /* x' = (x << shift) - delta */
- /* y' = (x << shift) - delta */
- /* } */
- /* */
- /* Set the values of `shift' and `delta' to~0 to get the original */
- /* point coordinates. */
- /* */
- typedef struct FT_Outline_Funcs_
- {
- FT_Outline_MoveToFunc move_to;
- FT_Outline_LineToFunc line_to;
- FT_Outline_ConicToFunc conic_to;
- FT_Outline_CubicToFunc cubic_to;
-
- int shift;
- FT_Pos delta;
-
- } FT_Outline_Funcs;
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_IMAGE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags to an unsigned long type. */
- /* */
- /* <Note> */
- /* Since many 16-bit compilers don't like 32-bit enumerations, you */
- /* should redefine this macro in case of problems to something like */
- /* this: */
- /* */
- /* { */
- /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
- /* } */
- /* */
- /* to get a simple enumeration without assigning special numbers. */
- /* */
-#ifndef FT_IMAGE_TAG
-#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
- value = ( ( (unsigned long)_x1 << 24 ) | \
- ( (unsigned long)_x2 << 16 ) | \
- ( (unsigned long)_x3 << 8 ) | \
- (unsigned long)_x4 )
-#endif /* FT_IMAGE_TAG */
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Glyph_Format */
- /* */
- /* <Description> */
- /* An enumeration type used to describe the format of a given glyph */
- /* image. Note that this version of FreeType only supports two image */
- /* formats, even though future font drivers will be able to register */
- /* their own format. */
- /* */
- /* <Values> */
- /* FT_GLYPH_FORMAT_NONE :: */
- /* The value~0 is reserved. */
- /* */
- /* FT_GLYPH_FORMAT_COMPOSITE :: */
- /* The glyph image is a composite of several other images. This */
- /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */
- /* report compound glyphs (like accented characters). */
- /* */
- /* FT_GLYPH_FORMAT_BITMAP :: */
- /* The glyph image is a bitmap, and can be described as an */
- /* @FT_Bitmap. You generally need to access the `bitmap' field of */
- /* the @FT_GlyphSlotRec structure to read it. */
- /* */
- /* FT_GLYPH_FORMAT_OUTLINE :: */
- /* The glyph image is a vectorial outline made of line segments */
- /* and Bézier arcs; it can be described as an @FT_Outline; you */
- /* generally want to access the `outline' field of the */
- /* @FT_GlyphSlotRec structure to read it. */
- /* */
- /* FT_GLYPH_FORMAT_PLOTTER :: */
- /* The glyph image is a vectorial path with no inside and outside */
- /* contours. Some Type~1 fonts, like those in the Hershey family, */
- /* contain glyphs in this format. These are described as */
- /* @FT_Outline, but FreeType isn't currently capable of rendering */
- /* them correctly. */
- /* */
- typedef enum FT_Glyph_Format_
- {
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
-
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
-
- } FT_Glyph_Format;
-
-
- /* these constants are deprecated; use the corresponding */
- /* `FT_Glyph_Format' values instead. */
-#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
-#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
-#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
-#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
-#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** R A S T E R D E F I N I T I O N S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* A raster is a scan converter, in charge of rendering an outline into */
- /* a a bitmap. This section contains the public API for rasters. */
- /* */
- /* Note that in FreeType 2, all rasters are now encapsulated within */
- /* specific modules called `renderers'. See `ftrender.h' for more */
- /* details on renderers. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* raster */
- /* */
- /* <Title> */
- /* Scanline Converter */
- /* */
- /* <Abstract> */
- /* How vectorial outlines are converted into bitmaps and pixmaps. */
- /* */
- /* <Description> */
- /* This section contains technical definitions. */
- /* */
- /* <Order> */
- /* FT_Raster */
- /* FT_Span */
- /* FT_SpanFunc */
- /* */
- /* FT_Raster_Params */
- /* FT_RASTER_FLAG_XXX */
- /* */
- /* FT_Raster_NewFunc */
- /* FT_Raster_DoneFunc */
- /* FT_Raster_ResetFunc */
- /* FT_Raster_SetModeFunc */
- /* FT_Raster_RenderFunc */
- /* FT_Raster_Funcs */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Raster */
- /* */
- /* <Description> */
- /* An opaque handle (pointer) to a raster object. Each object can be */
- /* used independently to convert an outline into a bitmap or pixmap. */
- /* */
- typedef struct FT_RasterRec_* FT_Raster;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Span */
- /* */
- /* <Description> */
- /* A structure used to model a single span of gray pixels when */
- /* rendering an anti-aliased bitmap. */
- /* */
- /* <Fields> */
- /* x :: The span's horizontal start position. */
- /* */
- /* len :: The span's length in pixels. */
- /* */
- /* coverage :: The span color/coverage, ranging from 0 (background) */
- /* to 255 (foreground). */
- /* */
- /* <Note> */
- /* This structure is used by the span drawing callback type named */
- /* @FT_SpanFunc that takes the y~coordinate of the span as a */
- /* parameter. */
- /* */
- /* The coverage value is always between 0 and 255. If you want less */
- /* gray values, the callback function has to reduce them. */
- /* */
- typedef struct FT_Span_
- {
- short x;
- unsigned short len;
- unsigned char coverage;
-
- } FT_Span;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_SpanFunc */
- /* */
- /* <Description> */
- /* A function used as a call-back by the anti-aliased renderer in */
- /* order to let client applications draw themselves the gray pixel */
- /* spans on each scan line. */
- /* */
- /* <Input> */
- /* y :: The scanline's y~coordinate. */
- /* */
- /* count :: The number of spans to draw on this scanline. */
- /* */
- /* spans :: A table of `count' spans to draw on the scanline. */
- /* */
- /* user :: User-supplied data that is passed to the callback. */
- /* */
- /* <Note> */
- /* This callback allows client applications to directly render the */
- /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
- /* */
- /* This can be used to write anti-aliased outlines directly to a */
- /* given background bitmap, and even perform translucency. */
- /* */
- /* Note that the `count' field cannot be greater than a fixed value */
- /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
- /* `ftoption.h'. By default, this value is set to~32, which means */
- /* that if there are more than 32~spans on a given scanline, the */
- /* callback is called several times with the same `y' parameter in */
- /* order to draw all callbacks. */
- /* */
- /* Otherwise, the callback is only called once per scan-line, and */
- /* only for those scanlines that do have `gray' pixels on them. */
- /* */
- typedef void
- (*FT_SpanFunc)( int y,
- int count,
- const FT_Span* spans,
- void* user );
-
-#define FT_Raster_Span_Func FT_SpanFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_BitTest_Func */
- /* */
- /* <Description> */
- /* Deprecated, unimplemented. */
- /* */
- typedef int
- (*FT_Raster_BitTest_Func)( int y,
- int x,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_BitSet_Func */
- /* */
- /* <Description> */
- /* Deprecated, unimplemented. */
- /* */
- typedef void
- (*FT_Raster_BitSet_Func)( int y,
- int x,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_RASTER_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit flag constants as used in the `flags' field of a */
- /* @FT_Raster_Params structure. */
- /* */
- /* <Values> */
- /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
- /* */
- /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
- /* anti-aliased glyph image should be */
- /* generated. Otherwise, it will be */
- /* monochrome (1-bit). */
- /* */
- /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
- /* rendering. In this mode, client */
- /* applications must provide their own span */
- /* callback. This lets them directly */
- /* draw or compose over an existing bitmap. */
- /* If this bit is not set, the target */
- /* pixmap's buffer _must_ be zeroed before */
- /* rendering. */
- /* */
- /* Direct rendering is only possible with */
- /* anti-aliased glyphs. */
- /* */
- /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
- /* rendering mode. If set, the output will */
- /* be clipped to a box specified in the */
- /* `clip_box' field of the */
- /* @FT_Raster_Params structure. */
- /* */
- /* Note that by default, the glyph bitmap */
- /* is clipped to the target pixmap, except */
- /* in direct rendering mode where all spans */
- /* are generated if no clipping box is set. */
- /* */
-#define FT_RASTER_FLAG_DEFAULT 0x0
-#define FT_RASTER_FLAG_AA 0x1
-#define FT_RASTER_FLAG_DIRECT 0x2
-#define FT_RASTER_FLAG_CLIP 0x4
-
- /* these constants are deprecated; use the corresponding */
- /* `FT_RASTER_FLAG_XXX' values instead */
-#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
-#define ft_raster_flag_aa FT_RASTER_FLAG_AA
-#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
-#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Raster_Params */
- /* */
- /* <Description> */
- /* A structure to hold the arguments used by a raster's render */
- /* function. */
- /* */
- /* <Fields> */
- /* target :: The target bitmap. */
- /* */
- /* source :: A pointer to the source glyph image (e.g., an */
- /* @FT_Outline). */
- /* */
- /* flags :: The rendering flags. */
- /* */
- /* gray_spans :: The gray span drawing callback. */
- /* */
- /* black_spans :: Unused. */
- /* */
- /* bit_test :: Unused. */
- /* */
- /* bit_set :: Unused. */
- /* */
- /* user :: User-supplied data that is passed to each drawing */
- /* callback. */
- /* */
- /* clip_box :: An optional clipping box. It is only used in */
- /* direct rendering mode. Note that coordinates here */
- /* should be expressed in _integer_ pixels (and not in */
- /* 26.6 fixed-point units). */
- /* */
- /* <Note> */
- /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
- /* bit flag is set in the `flags' field, otherwise a monochrome */
- /* bitmap is generated. */
- /* */
- /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
- /* raster will call the `gray_spans' callback to draw gray pixel */
- /* spans. This allows direct composition over a pre-existing bitmap */
- /* through user-provided callbacks to perform the span drawing and */
- /* composition. Not supported by the monochrome rasterizer. */
- /* */
- typedef struct FT_Raster_Params_
- {
- const FT_Bitmap* target;
- const void* source;
- int flags;
- FT_SpanFunc gray_spans;
- FT_SpanFunc black_spans; /* unused */
- FT_Raster_BitTest_Func bit_test; /* unused */
- FT_Raster_BitSet_Func bit_set; /* unused */
- void* user;
- FT_BBox clip_box;
-
- } FT_Raster_Params;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_NewFunc */
- /* */
- /* <Description> */
- /* A function used to create a new raster object. */
- /* */
- /* <Input> */
- /* memory :: A handle to the memory allocator. */
- /* */
- /* <Output> */
- /* raster :: A handle to the new raster object. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- /* <Note> */
- /* The `memory' parameter is a typeless pointer in order to avoid */
- /* un-wanted dependencies on the rest of the FreeType code. In */
- /* practice, it is an @FT_Memory object, i.e., a handle to the */
- /* standard FreeType memory allocator. However, this field can be */
- /* completely ignored by a given raster implementation. */
- /* */
- typedef int
- (*FT_Raster_NewFunc)( void* memory,
- FT_Raster* raster );
-
-#define FT_Raster_New_Func FT_Raster_NewFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_DoneFunc */
- /* */
- /* <Description> */
- /* A function used to destroy a given raster object. */
- /* */
- /* <Input> */
- /* raster :: A handle to the raster object. */
- /* */
- typedef void
- (*FT_Raster_DoneFunc)( FT_Raster raster );
-
-#define FT_Raster_Done_Func FT_Raster_DoneFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_ResetFunc */
- /* */
- /* <Description> */
- /* FreeType provides an area of memory called the `render pool', */
- /* available to all registered rasters. This pool can be freely used */
- /* during a given scan-conversion but is shared by all rasters. Its */
- /* content is thus transient. */
- /* */
- /* This function is called each time the render pool changes, or just */
- /* after a new raster object is created. */
- /* */
- /* <Input> */
- /* raster :: A handle to the new raster object. */
- /* */
- /* pool_base :: The address in memory of the render pool. */
- /* */
- /* pool_size :: The size in bytes of the render pool. */
- /* */
- /* <Note> */
- /* Rasters can ignore the render pool and rely on dynamic memory */
- /* allocation if they want to (a handle to the memory allocator is */
- /* passed to the raster constructor). However, this is not */
- /* recommended for efficiency purposes. */
- /* */
- typedef void
- (*FT_Raster_ResetFunc)( FT_Raster raster,
- unsigned char* pool_base,
- unsigned long pool_size );
-
-#define FT_Raster_Reset_Func FT_Raster_ResetFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_SetModeFunc */
- /* */
- /* <Description> */
- /* This function is a generic facility to change modes or attributes */
- /* in a given raster. This can be used for debugging purposes, or */
- /* simply to allow implementation-specific `features' in a given */
- /* raster module. */
- /* */
- /* <Input> */
- /* raster :: A handle to the new raster object. */
- /* */
- /* mode :: A 4-byte tag used to name the mode or property. */
- /* */
- /* args :: A pointer to the new mode/property to use. */
- /* */
- typedef int
- (*FT_Raster_SetModeFunc)( FT_Raster raster,
- unsigned long mode,
- void* args );
-
-#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_RenderFunc */
- /* */
- /* <Description> */
- /* Invoke a given raster to scan-convert a given glyph image into a */
- /* target bitmap. */
- /* */
- /* <Input> */
- /* raster :: A handle to the raster object. */
- /* */
- /* params :: A pointer to an @FT_Raster_Params structure used to */
- /* store the rendering parameters. */
- /* */
- /* <Return> */
- /* Error code. 0~means success. */
- /* */
- /* <Note> */
- /* The exact format of the source image depends on the raster's glyph */
- /* format defined in its @FT_Raster_Funcs structure. It can be an */
- /* @FT_Outline or anything else in order to support a large array of */
- /* glyph formats. */
- /* */
- /* Note also that the render function can fail and return a */
- /* `FT_Err_Unimplemented_Feature' error code if the raster used does */
- /* not support direct composition. */
- /* */
- /* XXX: For now, the standard raster doesn't support direct */
- /* composition but this should change for the final release (see */
- /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
- /* for examples of distinct implementations that support direct */
- /* composition). */
- /* */
- typedef int
- (*FT_Raster_RenderFunc)( FT_Raster raster,
- const FT_Raster_Params* params );
-
-#define FT_Raster_Render_Func FT_Raster_RenderFunc
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Raster_Funcs */
- /* */
- /* <Description> */
- /* A structure used to describe a given raster class to the library. */
- /* */
- /* <Fields> */
- /* glyph_format :: The supported glyph format for this raster. */
- /* */
- /* raster_new :: The raster constructor. */
- /* */
- /* raster_reset :: Used to reset the render pool within the raster. */
- /* */
- /* raster_render :: A function to render a glyph into a given bitmap. */
- /* */
- /* raster_done :: The raster destructor. */
- /* */
- typedef struct FT_Raster_Funcs_
- {
- FT_Glyph_Format glyph_format;
- FT_Raster_NewFunc raster_new;
- FT_Raster_ResetFunc raster_reset;
- FT_Raster_SetModeFunc raster_set_mode;
- FT_Raster_RenderFunc raster_render;
- FT_Raster_DoneFunc raster_done;
-
- } FT_Raster_Funcs;
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTIMAGE_H__ */
-
-
-/* END */
-
-
-/* Local Variables: */
-/* coding: utf-8 */
-/* End: */
diff --git a/src/3rdparty/freetype/include/ftincrem.h b/src/3rdparty/freetype/include/ftincrem.h
deleted file mode 100644
index 4c0246c5df..0000000000
--- a/src/3rdparty/freetype/include/ftincrem.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftincrem.h */
-/* */
-/* FreeType incremental loading (specification). */
-/* */
-/* Copyright 2002, 2003, 2006-2008, 2010, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTINCREM_H__
-#define __FTINCREM_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /***************************************************************************
- *
- * @section:
- * incremental
- *
- * @title:
- * Incremental Loading
- *
- * @abstract:
- * Custom Glyph Loading.
- *
- * @description:
- * This section contains various functions used to perform so-called
- * `incremental' glyph loading. This is a mode where all glyphs loaded
- * from a given @FT_Face are provided by the client application.
- *
- * Apart from that, all other tables are loaded normally from the font
- * file. This mode is useful when FreeType is used within another
- * engine, e.g., a PostScript Imaging Processor.
- *
- * To enable this mode, you must use @FT_Open_Face, passing an
- * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
- * @FT_Incremental_Interface value. See the comments for
- * @FT_Incremental_InterfaceRec for an example.
- *
- */
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental
- *
- * @description:
- * An opaque type describing a user-provided object used to implement
- * `incremental' glyph loading within FreeType. This is used to support
- * embedded fonts in certain environments (e.g., PostScript interpreters),
- * where the glyph data isn't in the font file, or must be overridden by
- * different values.
- *
- * @note:
- * It is up to client applications to create and implement @FT_Incremental
- * objects, as long as they provide implementations for the methods
- * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
- * and @FT_Incremental_GetGlyphMetricsFunc.
- *
- * See the description of @FT_Incremental_InterfaceRec to understand how
- * to use incremental objects with FreeType.
- *
- */
- typedef struct FT_IncrementalRec_* FT_Incremental;
-
-
- /***************************************************************************
- *
- * @struct:
- * FT_Incremental_MetricsRec
- *
- * @description:
- * A small structure used to contain the basic glyph metrics returned
- * by the @FT_Incremental_GetGlyphMetricsFunc method.
- *
- * @fields:
- * bearing_x ::
- * Left bearing, in font units.
- *
- * bearing_y ::
- * Top bearing, in font units.
- *
- * advance ::
- * Horizontal component of glyph advance, in font units.
- *
- * advance_v ::
- * Vertical component of glyph advance, in font units.
- *
- * @note:
- * These correspond to horizontal or vertical metrics depending on the
- * value of the `vertical' argument to the function
- * @FT_Incremental_GetGlyphMetricsFunc.
- *
- */
- typedef struct FT_Incremental_MetricsRec_
- {
- FT_Long bearing_x;
- FT_Long bearing_y;
- FT_Long advance;
- FT_Long advance_v; /* since 2.3.12 */
-
- } FT_Incremental_MetricsRec;
-
-
- /***************************************************************************
- *
- * @struct:
- * FT_Incremental_Metrics
- *
- * @description:
- * A handle to an @FT_Incremental_MetricsRec structure.
- *
- */
- typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_GetGlyphDataFunc
- *
- * @description:
- * A function called by FreeType to access a given glyph's data bytes
- * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
- * enabled.
- *
- * Note that the format of the glyph's data bytes depends on the font
- * file format. For TrueType, it must correspond to the raw bytes within
- * the `glyf' table. For PostScript formats, it must correspond to the
- * *unencrypted* charstring bytes, without any `lenIV' header. It is
- * undefined for any other format.
- *
- * @input:
- * incremental ::
- * Handle to an opaque @FT_Incremental handle provided by the client
- * application.
- *
- * glyph_index ::
- * Index of relevant glyph.
- *
- * @output:
- * adata ::
- * A structure describing the returned glyph data bytes (which will be
- * accessed as a read-only byte block).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If this function returns successfully the method
- * @FT_Incremental_FreeGlyphDataFunc will be called later to release
- * the data bytes.
- *
- * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
- * compound glyphs.
- *
- */
- typedef FT_Error
- (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
- FT_UInt glyph_index,
- FT_Data* adata );
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_FreeGlyphDataFunc
- *
- * @description:
- * A function used to release the glyph data bytes returned by a
- * successful call to @FT_Incremental_GetGlyphDataFunc.
- *
- * @input:
- * incremental ::
- * A handle to an opaque @FT_Incremental handle provided by the client
- * application.
- *
- * data ::
- * A structure describing the glyph data bytes (which will be accessed
- * as a read-only byte block).
- *
- */
- typedef void
- (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
- FT_Data* data );
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_GetGlyphMetricsFunc
- *
- * @description:
- * A function used to retrieve the basic metrics of a given glyph index
- * before accessing its data. This is necessary because, in certain
- * formats like TrueType, the metrics are stored in a different place from
- * the glyph images proper.
- *
- * @input:
- * incremental ::
- * A handle to an opaque @FT_Incremental handle provided by the client
- * application.
- *
- * glyph_index ::
- * Index of relevant glyph.
- *
- * vertical ::
- * If true, return vertical metrics.
- *
- * ametrics ::
- * This parameter is used for both input and output.
- * The original glyph metrics, if any, in font units. If metrics are
- * not available all the values must be set to zero.
- *
- * @output:
- * ametrics ::
- * The replacement glyph metrics in font units.
- *
- */
- typedef FT_Error
- (*FT_Incremental_GetGlyphMetricsFunc)
- ( FT_Incremental incremental,
- FT_UInt glyph_index,
- FT_Bool vertical,
- FT_Incremental_MetricsRec *ametrics );
-
-
- /**************************************************************************
- *
- * @struct:
- * FT_Incremental_FuncsRec
- *
- * @description:
- * A table of functions for accessing fonts that load data
- * incrementally. Used in @FT_Incremental_InterfaceRec.
- *
- * @fields:
- * get_glyph_data ::
- * The function to get glyph data. Must not be null.
- *
- * free_glyph_data ::
- * The function to release glyph data. Must not be null.
- *
- * get_glyph_metrics ::
- * The function to get glyph metrics. May be null if the font does
- * not provide overriding glyph metrics.
- *
- */
- typedef struct FT_Incremental_FuncsRec_
- {
- FT_Incremental_GetGlyphDataFunc get_glyph_data;
- FT_Incremental_FreeGlyphDataFunc free_glyph_data;
- FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
-
- } FT_Incremental_FuncsRec;
-
-
- /***************************************************************************
- *
- * @struct:
- * FT_Incremental_InterfaceRec
- *
- * @description:
- * A structure to be used with @FT_Open_Face to indicate that the user
- * wants to support incremental glyph loading. You should use it with
- * @FT_PARAM_TAG_INCREMENTAL as in the following example:
- *
- * {
- * FT_Incremental_InterfaceRec inc_int;
- * FT_Parameter parameter;
- * FT_Open_Args open_args;
- *
- *
- * // set up incremental descriptor
- * inc_int.funcs = my_funcs;
- * inc_int.object = my_object;
- *
- * // set up optional parameter
- * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
- * parameter.data = &inc_int;
- *
- * // set up FT_Open_Args structure
- * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
- * open_args.pathname = my_font_pathname;
- * open_args.num_params = 1;
- * open_args.params = &parameter; // we use one optional argument
- *
- * // open the font
- * error = FT_Open_Face( library, &open_args, index, &face );
- * ...
- * }
- *
- */
- typedef struct FT_Incremental_InterfaceRec_
- {
- const FT_Incremental_FuncsRec* funcs;
- FT_Incremental object;
-
- } FT_Incremental_InterfaceRec;
-
-
- /***************************************************************************
- *
- * @type:
- * FT_Incremental_Interface
- *
- * @description:
- * A pointer to an @FT_Incremental_InterfaceRec structure.
- *
- */
- typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_INCREMENTAL
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to indicate
- * an incremental loading object to be used by FreeType.
- *
- */
-#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTINCREM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftlcdfil.h b/src/3rdparty/freetype/include/ftlcdfil.h
deleted file mode 100644
index e8679c1a3f..0000000000
--- a/src/3rdparty/freetype/include/ftlcdfil.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftlcdfil.h */
-/* */
-/* FreeType API for color filtering of subpixel bitmap glyphs */
-/* (specification). */
-/* */
-/* Copyright 2006-2008, 2010, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FT_LCD_FILTER_H__
-#define __FT_LCD_FILTER_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /***************************************************************************
- *
- * @section:
- * lcd_filtering
- *
- * @title:
- * LCD Filtering
- *
- * @abstract:
- * Reduce color fringes of LCD-optimized bitmaps.
- *
- * @description:
- * The @FT_Library_SetLcdFilter API can be used to specify a low-pass
- * filter, which is then applied to LCD-optimized bitmaps generated
- * through @FT_Render_Glyph. This is useful to reduce color fringes
- * that would occur with unfiltered rendering.
- *
- * Note that no filter is active by default, and that this function is
- * *not* implemented in default builds of the library. You need to
- * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
- * in order to activate it.
- *
- * FreeType generates alpha coverage maps, which are linear by nature.
- * For instance, the value 0x80 in bitmap representation means that
- * (within numerical precision) 0x80/0xFF fraction of that pixel is
- * covered by the glyph's outline. The blending function for placing
- * text over a background is
- *
- * {
- * dst = alpha * src + (1 - alpha) * dst ,
- * }
- *
- * which is known as OVER. However, when calculating the output of the
- * OVER operator, the source colors should first be transformed to a
- * linear color space, then alpha blended in that space, and transformed
- * back to the output color space.
- *
- * When linear light blending is used, the default FIR5 filtering
- * weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
- * they have been designed for black on white rendering while lacking
- * gamma correction. To preserve color neutrality, weights for a FIR5
- * filter should be chosen according to two free parameters `a' and `c',
- * and the FIR weights should be
- *
- * {
- * [a - c, a + c, 2 * a, a + c, a - c] .
- * }
- *
- * This formula generates equal weights for all the color primaries
- * across the filter kernel, which makes it colorless. One suggested
- * set of weights is
- *
- * {
- * [0x10, 0x50, 0x60, 0x50, 0x10] ,
- * }
- *
- * where `a' has value 0x30 and `b' value 0x20. The weights in filter
- * may have a sum larger than 0x100, which increases coloration slightly
- * but also improves contrast.
- */
-
-
- /****************************************************************************
- *
- * @enum:
- * FT_LcdFilter
- *
- * @description:
- * A list of values to identify various types of LCD filters.
- *
- * @values:
- * FT_LCD_FILTER_NONE ::
- * Do not perform filtering. When used with subpixel rendering, this
- * results in sometimes severe color fringes.
- *
- * FT_LCD_FILTER_DEFAULT ::
- * The default filter reduces color fringes considerably, at the cost
- * of a slight blurriness in the output.
- *
- * FT_LCD_FILTER_LIGHT ::
- * The light filter is a variant that produces less blurriness at the
- * cost of slightly more color fringes than the default one. It might
- * be better, depending on taste, your monitor, or your personal vision.
- *
- * FT_LCD_FILTER_LEGACY ::
- * This filter corresponds to the original libXft color filter. It
- * provides high contrast output but can exhibit really bad color
- * fringes if glyphs are not extremely well hinted to the pixel grid.
- * In other words, it only works well if the TrueType bytecode
- * interpreter is enabled *and* high-quality hinted fonts are used.
- *
- * This filter is only provided for comparison purposes, and might be
- * disabled or stay unsupported in the future.
- *
- * @since:
- * 2.3.0
- */
- typedef enum FT_LcdFilter_
- {
- FT_LCD_FILTER_NONE = 0,
- FT_LCD_FILTER_DEFAULT = 1,
- FT_LCD_FILTER_LIGHT = 2,
- FT_LCD_FILTER_LEGACY = 16,
-
- FT_LCD_FILTER_MAX /* do not remove */
-
- } FT_LcdFilter;
-
-
- /**************************************************************************
- *
- * @func:
- * FT_Library_SetLcdFilter
- *
- * @description:
- * This function is used to apply color filtering to LCD decimated
- * bitmaps, like the ones used when calling @FT_Render_Glyph with
- * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
- *
- * @input:
- * library ::
- * A handle to the target library instance.
- *
- * filter ::
- * The filter type.
- *
- * You can use @FT_LCD_FILTER_NONE here to disable this feature, or
- * @FT_LCD_FILTER_DEFAULT to use a default filter that should work
- * well on most LCD screens.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This feature is always disabled by default. Clients must make an
- * explicit call to this function with a `filter' value other than
- * @FT_LCD_FILTER_NONE in order to enable it.
- *
- * Due to *PATENTS* covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature' if the
- * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
- * defined in your build of the library, which should correspond to all
- * default builds of FreeType.
- *
- * The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
- * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
- *
- * It does _not_ affect the output of @FT_Outline_Render and
- * @FT_Outline_Get_Bitmap.
- *
- * If this feature is activated, the dimensions of LCD glyph bitmaps are
- * either larger or taller than the dimensions of the corresponding
- * outline with regards to the pixel grid. For example, for
- * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
- * up to 3~pixels to the right.
- *
- * The bitmap offset values are adjusted correctly, so clients shouldn't
- * need to modify their layout and glyph positioning code when enabling
- * the filter.
- *
- * @since:
- * 2.3.0
- */
- FT_EXPORT( FT_Error )
- FT_Library_SetLcdFilter( FT_Library library,
- FT_LcdFilter filter );
-
-
- /**************************************************************************
- *
- * @func:
- * FT_Library_SetLcdFilterWeights
- *
- * @description:
- * Use this function to override the filter weights selected by
- * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
- * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
- * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
- * FT_LCD_FILTER_LEGACY.
- *
- * @input:
- * library ::
- * A handle to the target library instance.
- *
- * weights ::
- * A pointer to an array; the function copies the first five bytes and
- * uses them to specify the filter weights.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * Due to *PATENTS* covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature' if the
- * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
- * defined in your build of the library, which should correspond to all
- * default builds of FreeType.
- *
- * This function must be called after @FT_Library_SetLcdFilter to have
- * any effect.
- *
- * @since:
- * 2.4.0
- */
- FT_EXPORT( FT_Error )
- FT_Library_SetLcdFilterWeights( FT_Library library,
- unsigned char *weights );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FT_LCD_FILTER_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftlist.h b/src/3rdparty/freetype/include/ftlist.h
deleted file mode 100644
index 9950a27997..0000000000
--- a/src/3rdparty/freetype/include/ftlist.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftlist.h */
-/* */
-/* Generic list support for FreeType (specification). */
-/* */
-/* Copyright 1996-2001, 2003, 2007, 2010, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file implements functions relative to list processing. Its */
- /* data structures are defined in `freetype.h'. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTLIST_H__
-#define __FTLIST_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* list_processing */
- /* */
- /* <Title> */
- /* List Processing */
- /* */
- /* <Abstract> */
- /* Simple management of lists. */
- /* */
- /* <Description> */
- /* This section contains various definitions related to list */
- /* processing using doubly-linked nodes. */
- /* */
- /* <Order> */
- /* FT_List */
- /* FT_ListNode */
- /* FT_ListRec */
- /* FT_ListNodeRec */
- /* */
- /* FT_List_Add */
- /* FT_List_Insert */
- /* FT_List_Find */
- /* FT_List_Remove */
- /* FT_List_Up */
- /* FT_List_Iterate */
- /* FT_List_Iterator */
- /* FT_List_Finalize */
- /* FT_List_Destructor */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Find */
- /* */
- /* <Description> */
- /* Find the list node for a given listed object. */
- /* */
- /* <Input> */
- /* list :: A pointer to the parent list. */
- /* data :: The address of the listed object. */
- /* */
- /* <Return> */
- /* List node. NULL if it wasn't found. */
- /* */
- FT_EXPORT( FT_ListNode )
- FT_List_Find( FT_List list,
- void* data );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Add */
- /* */
- /* <Description> */
- /* Append an element to the end of a list. */
- /* */
- /* <InOut> */
- /* list :: A pointer to the parent list. */
- /* node :: The node to append. */
- /* */
- FT_EXPORT( void )
- FT_List_Add( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Insert */
- /* */
- /* <Description> */
- /* Insert an element at the head of a list. */
- /* */
- /* <InOut> */
- /* list :: A pointer to parent list. */
- /* node :: The node to insert. */
- /* */
- FT_EXPORT( void )
- FT_List_Insert( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Remove */
- /* */
- /* <Description> */
- /* Remove a node from a list. This function doesn't check whether */
- /* the node is in the list! */
- /* */
- /* <Input> */
- /* node :: The node to remove. */
- /* */
- /* <InOut> */
- /* list :: A pointer to the parent list. */
- /* */
- FT_EXPORT( void )
- FT_List_Remove( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Up */
- /* */
- /* <Description> */
- /* Move a node to the head/top of a list. Used to maintain LRU */
- /* lists. */
- /* */
- /* <InOut> */
- /* list :: A pointer to the parent list. */
- /* node :: The node to move. */
- /* */
- FT_EXPORT( void )
- FT_List_Up( FT_List list,
- FT_ListNode node );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_List_Iterator */
- /* */
- /* <Description> */
- /* An FT_List iterator function that is called during a list parse */
- /* by @FT_List_Iterate. */
- /* */
- /* <Input> */
- /* node :: The current iteration list node. */
- /* */
- /* user :: A typeless pointer passed to @FT_List_Iterate. */
- /* Can be used to point to the iteration's state. */
- /* */
- typedef FT_Error
- (*FT_List_Iterator)( FT_ListNode node,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Iterate */
- /* */
- /* <Description> */
- /* Parse a list and calls a given iterator function on each element. */
- /* Note that parsing is stopped as soon as one of the iterator calls */
- /* returns a non-zero value. */
- /* */
- /* <Input> */
- /* list :: A handle to the list. */
- /* iterator :: An iterator function, called on each node of the list. */
- /* user :: A user-supplied field that is passed as the second */
- /* argument to the iterator. */
- /* */
- /* <Return> */
- /* The result (a FreeType error code) of the last iterator call. */
- /* */
- FT_EXPORT( FT_Error )
- FT_List_Iterate( FT_List list,
- FT_List_Iterator iterator,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_List_Destructor */
- /* */
- /* <Description> */
- /* An @FT_List iterator function that is called during a list */
- /* finalization by @FT_List_Finalize to destroy all elements in a */
- /* given list. */
- /* */
- /* <Input> */
- /* system :: The current system object. */
- /* */
- /* data :: The current object to destroy. */
- /* */
- /* user :: A typeless pointer passed to @FT_List_Iterate. It can */
- /* be used to point to the iteration's state. */
- /* */
- typedef void
- (*FT_List_Destructor)( FT_Memory memory,
- void* data,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_List_Finalize */
- /* */
- /* <Description> */
- /* Destroy all elements in the list as well as the list itself. */
- /* */
- /* <Input> */
- /* list :: A handle to the list. */
- /* */
- /* destroy :: A list destructor that will be applied to each element */
- /* of the list. Set this to NULL if not needed. */
- /* */
- /* memory :: The current memory object that handles deallocation. */
- /* */
- /* user :: A user-supplied field that is passed as the last */
- /* argument to the destructor. */
- /* */
- /* <Note> */
- /* This function expects that all nodes added by @FT_List_Add or */
- /* @FT_List_Insert have been dynamically allocated. */
- /* */
- FT_EXPORT( void )
- FT_List_Finalize( FT_List list,
- FT_List_Destructor destroy,
- FT_Memory memory,
- void* user );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTLIST_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftlzw.h b/src/3rdparty/freetype/include/ftlzw.h
deleted file mode 100644
index 857c0c52bb..0000000000
--- a/src/3rdparty/freetype/include/ftlzw.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftlzw.h */
-/* */
-/* LZW-compressed stream support. */
-/* */
-/* Copyright 2004, 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTLZW_H__
-#define __FTLZW_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* lzw */
- /* */
- /* <Title> */
- /* LZW Streams */
- /* */
- /* <Abstract> */
- /* Using LZW-compressed font files. */
- /* */
- /* <Description> */
- /* This section contains the declaration of LZW-specific functions. */
- /* */
- /*************************************************************************/
-
- /************************************************************************
- *
- * @function:
- * FT_Stream_OpenLZW
- *
- * @description:
- * Open a new stream to parse LZW-compressed font files. This is
- * mainly used to support the compressed `*.pcf.Z' fonts that come
- * with XFree86.
- *
- * @input:
- * stream :: The target embedding stream.
- *
- * source :: The source stream.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source stream must be opened _before_ calling this function.
- *
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- *
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream
- *
- * In certain builds of the library, LZW compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a LZW stream from it
- * and re-open the face with it.
- *
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with LZW support.
- */
- FT_EXPORT( FT_Error )
- FT_Stream_OpenLZW( FT_Stream stream,
- FT_Stream source );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTLZW_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftmac.h b/src/3rdparty/freetype/include/ftmac.h
deleted file mode 100644
index 42874fe6fc..0000000000
--- a/src/3rdparty/freetype/include/ftmac.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftmac.h */
-/* */
-/* Additional Mac-specific API. */
-/* */
-/* Copyright 1996-2001, 2004, 2006, 2007, 2013 by */
-/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* NOTE: Include this file after FT_FREETYPE_H and after any */
-/* Mac-specific headers (because this header uses Mac types such as */
-/* Handle, FSSpec, FSRef, etc.) */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTMAC_H__
-#define __FTMAC_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
-
-/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
-#ifndef FT_DEPRECATED_ATTRIBUTE
-#if defined(__GNUC__) && \
- ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
-#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
-#else
-#define FT_DEPRECATED_ATTRIBUTE
-#endif
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* mac_specific */
- /* */
- /* <Title> */
- /* Mac Specific Interface */
- /* */
- /* <Abstract> */
- /* Only available on the Macintosh. */
- /* */
- /* <Description> */
- /* The following definitions are only available if FreeType is */
- /* compiled on a Macintosh. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FOND */
- /* */
- /* <Description> */
- /* Create a new face object from a FOND resource. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* fond :: A FOND resource. */
- /* */
- /* face_index :: Only supported for the -1 `sanity check' special */
- /* case. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Notes> */
- /* This function can be used to create @FT_Face objects from fonts */
- /* that are installed in the system as follows. */
- /* */
- /* { */
- /* fond = GetResource( 'FOND', fontName ); */
- /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
- /* } */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face_From_FOND( FT_Library library,
- Handle fond,
- FT_Long face_index,
- FT_Face *aface )
- FT_DEPRECATED_ATTRIBUTE;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GetFile_From_Mac_Name */
- /* */
- /* <Description> */
- /* Return an FSSpec for the disk file containing the named font. */
- /* */
- /* <Input> */
- /* fontName :: Mac OS name of the font (e.g., Times New Roman */
- /* Bold). */
- /* */
- /* <Output> */
- /* pathSpec :: FSSpec to the file. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* face_index :: Index of the face. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GetFile_From_Mac_Name( const char* fontName,
- FSSpec* pathSpec,
- FT_Long* face_index )
- FT_DEPRECATED_ATTRIBUTE;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GetFile_From_Mac_ATS_Name */
- /* */
- /* <Description> */
- /* Return an FSSpec for the disk file containing the named font. */
- /* */
- /* <Input> */
- /* fontName :: Mac OS name of the font in ATS framework. */
- /* */
- /* <Output> */
- /* pathSpec :: FSSpec to the file. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* face_index :: Index of the face. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GetFile_From_Mac_ATS_Name( const char* fontName,
- FSSpec* pathSpec,
- FT_Long* face_index )
- FT_DEPRECATED_ATTRIBUTE;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_GetFilePath_From_Mac_ATS_Name */
- /* */
- /* <Description> */
- /* Return a pathname of the disk file and face index for given font */
- /* name that is handled by ATS framework. */
- /* */
- /* <Input> */
- /* fontName :: Mac OS name of the font in ATS framework. */
- /* */
- /* <Output> */
- /* path :: Buffer to store pathname of the file. For passing */
- /* to @FT_New_Face. The client must allocate this */
- /* buffer before calling this function. */
- /* */
- /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
- /* */
- /* face_index :: Index of the face. For passing to @FT_New_Face. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
- UInt8* path,
- UInt32 maxPathSize,
- FT_Long* face_index )
- FT_DEPRECATED_ATTRIBUTE;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FSSpec */
- /* */
- /* <Description> */
- /* Create a new face object from a given resource and typeface index */
- /* using an FSSpec to the font file. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* spec :: FSSpec to the font file. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index~0. */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
- /* it accepts an FSSpec instead of a path. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face_From_FSSpec( FT_Library library,
- const FSSpec *spec,
- FT_Long face_index,
- FT_Face *aface )
- FT_DEPRECATED_ATTRIBUTE;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FSRef */
- /* */
- /* <Description> */
- /* Create a new face object from a given resource and typeface index */
- /* using an FSRef to the font file. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* spec :: FSRef to the font file. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index~0. */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
- /* it accepts an FSRef instead of a path. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face_From_FSRef( FT_Library library,
- const FSRef *ref,
- FT_Long face_index,
- FT_Face *aface )
- FT_DEPRECATED_ATTRIBUTE;
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __FTMAC_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftmm.h b/src/3rdparty/freetype/include/ftmm.h
deleted file mode 100644
index 2dcfd678df..0000000000
--- a/src/3rdparty/freetype/include/ftmm.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftmm.h */
-/* */
-/* FreeType Multiple Master font interface (specification). */
-/* */
-/* Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTMM_H__
-#define __FTMM_H__
-
-
-#include <ft2build.h>
-#include FT_TYPE1_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* multiple_masters */
- /* */
- /* <Title> */
- /* Multiple Masters */
- /* */
- /* <Abstract> */
- /* How to manage Multiple Masters fonts. */
- /* */
- /* <Description> */
- /* The following types and functions are used to manage Multiple */
- /* Master fonts, i.e., the selection of specific design instances by */
- /* setting design axis coordinates. */
- /* */
- /* George Williams has extended this interface to make it work with */
- /* both Type~1 Multiple Masters fonts and GX distortable (var) */
- /* fonts. Some of these routines only work with MM fonts, others */
- /* will work with both types. They are similar enough that a */
- /* consistent interface makes sense. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_MM_Axis */
- /* */
- /* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters fonts. */
- /* */
- /* This structure can't be used for GX var fonts. */
- /* */
- /* <Fields> */
- /* name :: The axis's name. */
- /* */
- /* minimum :: The axis's minimum design coordinate. */
- /* */
- /* maximum :: The axis's maximum design coordinate. */
- /* */
- typedef struct FT_MM_Axis_
- {
- FT_String* name;
- FT_Long minimum;
- FT_Long maximum;
-
- } FT_MM_Axis;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Multi_Master */
- /* */
- /* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
- /* font. */
- /* */
- /* This structure can't be used for GX var fonts. */
- /* */
- /* <Fields> */
- /* num_axis :: Number of axes. Cannot exceed~4. */
- /* */
- /* num_designs :: Number of designs; should be normally 2^num_axis */
- /* even though the Type~1 specification strangely */
- /* allows for intermediate designs to be present. This */
- /* number cannot exceed~16. */
- /* */
- /* axis :: A table of axis descriptors. */
- /* */
- typedef struct FT_Multi_Master_
- {
- FT_UInt num_axis;
- FT_UInt num_designs;
- FT_MM_Axis axis[T1_MAX_MM_AXIS];
-
- } FT_Multi_Master;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Var_Axis */
- /* */
- /* <Description> */
- /* A simple structure used to model a given axis in design space for */
- /* Multiple Masters and GX var fonts. */
- /* */
- /* <Fields> */
- /* name :: The axis's name. */
- /* Not always meaningful for GX. */
- /* */
- /* minimum :: The axis's minimum design coordinate. */
- /* */
- /* def :: The axis's default design coordinate. */
- /* FreeType computes meaningful default values for MM; it */
- /* is then an integer value, not in 16.16 format. */
- /* */
- /* maximum :: The axis's maximum design coordinate. */
- /* */
- /* tag :: The axis's tag (the GX equivalent to `name'). */
- /* FreeType provides default values for MM if possible. */
- /* */
- /* strid :: The entry in `name' table (another GX version of */
- /* `name'). */
- /* Not meaningful for MM. */
- /* */
- typedef struct FT_Var_Axis_
- {
- FT_String* name;
-
- FT_Fixed minimum;
- FT_Fixed def;
- FT_Fixed maximum;
-
- FT_ULong tag;
- FT_UInt strid;
-
- } FT_Var_Axis;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Var_Named_Style */
- /* */
- /* <Description> */
- /* A simple structure used to model a named style in a GX var font. */
- /* */
- /* This structure can't be used for MM fonts. */
- /* */
- /* <Fields> */
- /* coords :: The design coordinates for this style. */
- /* This is an array with one entry for each axis. */
- /* */
- /* strid :: The entry in `name' table identifying this style. */
- /* */
- typedef struct FT_Var_Named_Style_
- {
- FT_Fixed* coords;
- FT_UInt strid;
-
- } FT_Var_Named_Style;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_MM_Var */
- /* */
- /* <Description> */
- /* A structure used to model the axes and space of a Multiple Masters */
- /* or GX var distortable font. */
- /* */
- /* Some fields are specific to one format and not to the other. */
- /* */
- /* <Fields> */
- /* num_axis :: The number of axes. The maximum value is~4 for */
- /* MM; no limit in GX. */
- /* */
- /* num_designs :: The number of designs; should be normally */
- /* 2^num_axis for MM fonts. Not meaningful for GX */
- /* (where every glyph could have a different */
- /* number of designs). */
- /* */
- /* num_namedstyles :: The number of named styles; only meaningful for */
- /* GX that allows certain design coordinates to */
- /* have a string ID (in the `name' table) */
- /* associated with them. The font can tell the */
- /* user that, for example, Weight=1.5 is `Bold'. */
- /* */
- /* axis :: A table of axis descriptors. */
- /* GX fonts contain slightly more data than MM. */
- /* */
- /* namedstyles :: A table of named styles. */
- /* Only meaningful with GX. */
- /* */
- typedef struct FT_MM_Var_
- {
- FT_UInt num_axis;
- FT_UInt num_designs;
- FT_UInt num_namedstyles;
- FT_Var_Axis* axis;
- FT_Var_Named_Style* namedstyle;
-
- } FT_MM_Var;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Multi_Master */
- /* */
- /* <Description> */
- /* Retrieve the Multiple Master descriptor of a given font. */
- /* */
- /* This function can't be used with GX fonts. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Output> */
- /* amaster :: The Multiple Masters descriptor. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Multi_Master( FT_Face face,
- FT_Multi_Master *amaster );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_MM_Var */
- /* */
- /* <Description> */
- /* Retrieve the Multiple Master/GX var descriptor of a given font. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Output> */
- /* amaster :: The Multiple Masters/GX var descriptor. */
- /* Allocates a data structure, which the user must free. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_MM_Var( FT_Face face,
- FT_MM_Var* *amaster );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_MM_Design_Coordinates */
- /* */
- /* <Description> */
- /* For Multiple Masters fonts, choose an interpolated font design */
- /* through design coordinates. */
- /* */
- /* This function can't be used with GX fonts. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face. */
- /* */
- /* <Input> */
- /* num_coords :: The number of design coordinates (must be equal to */
- /* the number of axes in the font). */
- /* */
- /* coords :: An array of design coordinates. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_MM_Design_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Long* coords );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Var_Design_Coordinates */
- /* */
- /* <Description> */
- /* For Multiple Master or GX Var fonts, choose an interpolated font */
- /* design through design coordinates. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face. */
- /* */
- /* <Input> */
- /* num_coords :: The number of design coordinates (must be equal to */
- /* the number of axes in the font). */
- /* */
- /* coords :: An array of design coordinates. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Var_Design_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Fixed* coords );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_MM_Blend_Coordinates */
- /* */
- /* <Description> */
- /* For Multiple Masters and GX var fonts, choose an interpolated font */
- /* design through normalized blend coordinates. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face. */
- /* */
- /* <Input> */
- /* num_coords :: The number of design coordinates (must be equal to */
- /* the number of axes in the font). */
- /* */
- /* coords :: The design coordinates array (each element must be */
- /* between 0 and 1.0). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_MM_Blend_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Fixed* coords );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Var_Blend_Coordinates */
- /* */
- /* <Description> */
- /* This is another name of @FT_Set_MM_Blend_Coordinates. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Var_Blend_Coordinates( FT_Face face,
- FT_UInt num_coords,
- FT_Fixed* coords );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTMM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftmodapi.h b/src/3rdparty/freetype/include/ftmodapi.h
deleted file mode 100644
index 980f15d3de..0000000000
--- a/src/3rdparty/freetype/include/ftmodapi.h
+++ /dev/null
@@ -1,667 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftmodapi.h */
-/* */
-/* FreeType modules public interface (specification). */
-/* */
-/* Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTMODAPI_H__
-#define __FTMODAPI_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* module_management */
- /* */
- /* <Title> */
- /* Module Management */
- /* */
- /* <Abstract> */
- /* How to add, upgrade, remove, and control modules from FreeType. */
- /* */
- /* <Description> */
- /* The definitions below are used to manage modules within FreeType. */
- /* Modules can be added, upgraded, and removed at runtime. */
- /* Additionally, some module properties can be controlled also. */
- /* */
- /* Here is a list of possible values of the `module_name' field in */
- /* the @FT_Module_Class structure. */
- /* */
- /* { */
- /* autofitter */
- /* bdf */
- /* cff */
- /* gxvalid */
- /* otvalid */
- /* pcf */
- /* pfr */
- /* psaux */
- /* pshinter */
- /* psnames */
- /* raster1, raster5 */
- /* sfnt */
- /* smooth, smooth-lcd, smooth-lcdv */
- /* truetype */
- /* type1 */
- /* type42 */
- /* t1cid */
- /* winfonts */
- /* } */
- /* */
- /* Note that the FreeType Cache sub-system is not a FreeType module. */
- /* */
- /* <Order> */
- /* FT_Module */
- /* FT_Module_Constructor */
- /* FT_Module_Destructor */
- /* FT_Module_Requester */
- /* FT_Module_Class */
- /* */
- /* FT_Add_Module */
- /* FT_Get_Module */
- /* FT_Remove_Module */
- /* FT_Add_Default_Modules */
- /* */
- /* FT_Property_Set */
- /* FT_Property_Get */
- /* */
- /* FT_New_Library */
- /* FT_Done_Library */
- /* FT_Reference_Library */
- /* */
- /* FT_Renderer */
- /* FT_Renderer_Class */
- /* */
- /* FT_Get_Renderer */
- /* FT_Set_Renderer */
- /* */
- /* FT_Set_Debug_Hook */
- /* */
- /*************************************************************************/
-
-
- /* module bit flags */
-#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
-#define FT_MODULE_RENDERER 2 /* this module is a renderer */
-#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
-#define FT_MODULE_STYLER 8 /* this module is a styler */
-
-#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
- /* scalable fonts */
-#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
- /* support vector outlines */
-#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
- /* own hinter */
-
-
- /* deprecated values */
-#define ft_module_font_driver FT_MODULE_FONT_DRIVER
-#define ft_module_renderer FT_MODULE_RENDERER
-#define ft_module_hinter FT_MODULE_HINTER
-#define ft_module_styler FT_MODULE_STYLER
-
-#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
-#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
-#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
-
-
- typedef FT_Pointer FT_Module_Interface;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Constructor */
- /* */
- /* <Description> */
- /* A function used to initialize (not create) a new module object. */
- /* */
- /* <Input> */
- /* module :: The module to initialize. */
- /* */
- typedef FT_Error
- (*FT_Module_Constructor)( FT_Module module );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Destructor */
- /* */
- /* <Description> */
- /* A function used to finalize (not destroy) a given module object. */
- /* */
- /* <Input> */
- /* module :: The module to finalize. */
- /* */
- typedef void
- (*FT_Module_Destructor)( FT_Module module );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Requester */
- /* */
- /* <Description> */
- /* A function used to query a given module for a specific interface. */
- /* */
- /* <Input> */
- /* module :: The module to be searched. */
- /* */
- /* name :: The name of the interface in the module. */
- /* */
- typedef FT_Module_Interface
- (*FT_Module_Requester)( FT_Module module,
- const char* name );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Module_Class */
- /* */
- /* <Description> */
- /* The module class descriptor. */
- /* */
- /* <Fields> */
- /* module_flags :: Bit flags describing the module. */
- /* */
- /* module_size :: The size of one module object/instance in */
- /* bytes. */
- /* */
- /* module_name :: The name of the module. */
- /* */
- /* module_version :: The version, as a 16.16 fixed number */
- /* (major.minor). */
- /* */
- /* module_requires :: The version of FreeType this module requires, */
- /* as a 16.16 fixed number (major.minor). Starts */
- /* at version 2.0, i.e., 0x20000. */
- /* */
- /* module_init :: The initializing function. */
- /* */
- /* module_done :: The finalizing function. */
- /* */
- /* get_interface :: The interface requesting function. */
- /* */
- typedef struct FT_Module_Class_
- {
- FT_ULong module_flags;
- FT_Long module_size;
- const FT_String* module_name;
- FT_Fixed module_version;
- FT_Fixed module_requires;
-
- const void* module_interface;
-
- FT_Module_Constructor module_init;
- FT_Module_Destructor module_done;
- FT_Module_Requester get_interface;
-
- } FT_Module_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Add_Module */
- /* */
- /* <Description> */
- /* Add a new module to a given library instance. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library object. */
- /* */
- /* <Input> */
- /* clazz :: A pointer to class descriptor for the module. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* An error will be returned if a module already exists by that name, */
- /* or if the module requires a version of FreeType that is too great. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Add_Module( FT_Library library,
- const FT_Module_Class* clazz );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Module */
- /* */
- /* <Description> */
- /* Find a module by its name. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* module_name :: The module's name (as an ASCII string). */
- /* */
- /* <Return> */
- /* A module handle. 0~if none was found. */
- /* */
- /* <Note> */
- /* FreeType's internal modules aren't documented very well, and you */
- /* should look up the source code for details. */
- /* */
- FT_EXPORT( FT_Module )
- FT_Get_Module( FT_Library library,
- const char* module_name );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Remove_Module */
- /* */
- /* <Description> */
- /* Remove a given module from a library instance. */
- /* */
- /* <InOut> */
- /* library :: A handle to a library object. */
- /* */
- /* <Input> */
- /* module :: A handle to a module object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The module object is destroyed by the function in case of success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Remove_Module( FT_Library library,
- FT_Module module );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Property_Set
- *
- * @description:
- * Set a property for a given module.
- *
- * @input:
- * library ::
- * A handle to the library the module is part of.
- *
- * module_name ::
- * The module name.
- *
- * property_name ::
- * The property name. Properties are described in the `Synopsis'
- * subsection of the module's documentation.
- *
- * Note that only a few modules have properties.
- *
- * value ::
- * A generic pointer to a variable or structure that gives the new
- * value of the property. The exact definition of `value' is
- * dependent on the property; see the `Synopsis' subsection of the
- * module's documentation.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If `module_name' isn't a valid module name, or `property_name'
- * doesn't specify a valid property, or if `value' doesn't represent a
- * valid value for the given property, an error is returned.
- *
- * The following example sets property `bar' (a simple integer) in
- * module `foo' to value~1.
- *
- * {
- * FT_UInt bar;
- *
- *
- * bar = 1;
- * FT_Property_Set( library, "foo", "bar", &bar );
- * }
- *
- * Note that the FreeType Cache sub-system doesn't recognize module
- * property changes. To avoid glyph lookup confusion within the cache
- * you should call @FTC_Manager_Reset to completely flush the cache if
- * a module property gets changed after @FTC_Manager_New has been
- * called.
- *
- * It is not possible to set properties of the FreeType Cache
- * sub-system itself with FT_Property_Set; use @FTC_Property_Set
- * instead.
- *
- * @since:
- * 2.4.11
- *
- */
- FT_EXPORT( FT_Error )
- FT_Property_Set( FT_Library library,
- const FT_String* module_name,
- const FT_String* property_name,
- const void* value );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Property_Get
- *
- * @description:
- * Get a module's property value.
- *
- * @input:
- * library ::
- * A handle to the library the module is part of.
- *
- * module_name ::
- * The module name.
- *
- * property_name ::
- * The property name. Properties are described in the `Synopsis'
- * subsection of the module's documentation.
- *
- * @inout:
- * value ::
- * A generic pointer to a variable or structure that gives the
- * value of the property. The exact definition of `value' is
- * dependent on the property; see the `Synopsis' subsection of the
- * module's documentation.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If `module_name' isn't a valid module name, or `property_name'
- * doesn't specify a valid property, or if `value' doesn't represent a
- * valid value for the given property, an error is returned.
- *
- * The following example gets property `baz' (a range) in module `foo'.
- *
- * {
- * typedef range_
- * {
- * FT_Int32 min;
- * FT_Int32 max;
- *
- * } range;
- *
- * range baz;
- *
- *
- * FT_Property_Get( library, "foo", "baz", &baz );
- * }
- *
- * It is not possible to retrieve properties of the FreeType Cache
- * sub-system with FT_Property_Get; use @FTC_Property_Get instead.
- *
- * @since:
- * 2.4.11
- *
- */
- FT_EXPORT( FT_Error )
- FT_Property_Get( FT_Library library,
- const FT_String* module_name,
- const FT_String* property_name,
- void* value );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Reference_Library */
- /* */
- /* <Description> */
- /* A counter gets initialized to~1 at the time an @FT_Library */
- /* structure is created. This function increments the counter. */
- /* @FT_Done_Library then only destroys a library if the counter is~1, */
- /* otherwise it simply decrements the counter. */
- /* */
- /* This function helps in managing life-cycles of structures that */
- /* reference @FT_Library objects. */
- /* */
- /* <Input> */
- /* library :: A handle to a target library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Since> */
- /* 2.4.2 */
- /* */
- FT_EXPORT( FT_Error )
- FT_Reference_Library( FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Library */
- /* */
- /* <Description> */
- /* This function is used to create a new FreeType library instance */
- /* from a given memory object. It is thus possible to use libraries */
- /* with distinct memory allocators within the same program. */
- /* */
- /* Normally, you would call this function (followed by a call to */
- /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
- /* instead of @FT_Init_FreeType to initialize the FreeType library. */
- /* */
- /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
- /* library instance. */
- /* */
- /* <Input> */
- /* memory :: A handle to the original memory object. */
- /* */
- /* <Output> */
- /* alibrary :: A pointer to handle of a new library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Library. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Library( FT_Memory memory,
- FT_Library *alibrary );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Library */
- /* */
- /* <Description> */
- /* Discard a given library object. This closes all drivers and */
- /* discards all resource objects. */
- /* */
- /* <Input> */
- /* library :: A handle to the target library. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Library. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Library( FT_Library library );
-
- /* */
-
- typedef void
- (*FT_DebugHook_Func)( void* arg );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Debug_Hook */
- /* */
- /* <Description> */
- /* Set a debug hook function for debugging the interpreter of a font */
- /* format. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library object. */
- /* */
- /* <Input> */
- /* hook_index :: The index of the debug hook. You should use the */
- /* values defined in `ftobjs.h', e.g., */
- /* `FT_DEBUG_HOOK_TRUETYPE'. */
- /* */
- /* debug_hook :: The function used to debug the interpreter. */
- /* */
- /* <Note> */
- /* Currently, four debug hook slots are available, but only two (for */
- /* the TrueType and the Type~1 interpreter) are defined. */
- /* */
- /* Since the internal headers of FreeType are no longer installed, */
- /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
- /* This is a bug and will be fixed in a forthcoming release. */
- /* */
- FT_EXPORT( void )
- FT_Set_Debug_Hook( FT_Library library,
- FT_UInt hook_index,
- FT_DebugHook_Func debug_hook );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Add_Default_Modules */
- /* */
- /* <Description> */
- /* Add the set of default drivers to a given library object. */
- /* This is only useful when you create a library object with */
- /* @FT_New_Library (usually to plug a custom memory manager). */
- /* */
- /* <InOut> */
- /* library :: A handle to a new library object. */
- /* */
- FT_EXPORT( void )
- FT_Add_Default_Modules( FT_Library library );
-
-
-
- /**************************************************************************
- *
- * @section:
- * truetype_engine
- *
- * @title:
- * The TrueType Engine
- *
- * @abstract:
- * TrueType bytecode support.
- *
- * @description:
- * This section contains a function used to query the level of TrueType
- * bytecode support compiled in this version of the library.
- *
- */
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_TrueTypeEngineType
- *
- * @description:
- * A list of values describing which kind of TrueType bytecode
- * engine is implemented in a given FT_Library instance. It is used
- * by the @FT_Get_TrueType_Engine_Type function.
- *
- * @values:
- * FT_TRUETYPE_ENGINE_TYPE_NONE ::
- * The library doesn't implement any kind of bytecode interpreter.
- *
- * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
- * The library implements a bytecode interpreter that doesn't
- * support the patented operations of the TrueType virtual machine.
- *
- * Its main use is to load certain Asian fonts that position and
- * scale glyph components with bytecode instructions. It produces
- * bad output for most other fonts.
- *
- * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
- * The library implements a bytecode interpreter that covers
- * the full instruction set of the TrueType virtual machine (this
- * was governed by patents until May 2010, hence the name).
- *
- * @since:
- * 2.2
- *
- */
- typedef enum FT_TrueTypeEngineType_
- {
- FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
- FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
- FT_TRUETYPE_ENGINE_TYPE_PATENTED
-
- } FT_TrueTypeEngineType;
-
-
- /**************************************************************************
- *
- * @func:
- * FT_Get_TrueType_Engine_Type
- *
- * @description:
- * Return an @FT_TrueTypeEngineType value to indicate which level of
- * the TrueType virtual machine a given library instance supports.
- *
- * @input:
- * library ::
- * A library instance.
- *
- * @return:
- * A value indicating which level is supported.
- *
- * @since:
- * 2.2
- *
- */
- FT_EXPORT( FT_TrueTypeEngineType )
- FT_Get_TrueType_Engine_Type( FT_Library library );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTMODAPI_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftmoderr.h b/src/3rdparty/freetype/include/ftmoderr.h
deleted file mode 100644
index 5a27db151a..0000000000
--- a/src/3rdparty/freetype/include/ftmoderr.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftmoderr.h */
-/* */
-/* FreeType module error offsets (specification). */
-/* */
-/* Copyright 2001-2005, 2010, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is used to define the FreeType module error codes. */
- /* */
- /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
- /* set, the lower byte of an error value identifies the error code as */
- /* usual. In addition, the higher byte identifies the module. For */
- /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
- /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
- /* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
- /* */
- /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
- /* including the high byte. */
- /* */
- /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
- /* an error value is set to zero. */
- /* */
- /* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
- /* provides some macros in `fttypes.h'. */
- /* */
- /* FT_ERR( err ) */
- /* Add current error module prefix (as defined with the */
- /* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
- /* the line */
- /* */
- /* error = FT_ERR( Invalid_Outline ); */
- /* */
- /* expands to */
- /* */
- /* error = BDF_Err_Invalid_Outline; */
- /* */
- /* For simplicity, you can always use `FT_Err_Ok' directly instead */
- /* of `FT_ERR( Ok )'. */
- /* */
- /* FT_ERR_EQ( errcode, err ) */
- /* FT_ERR_NEQ( errcode, err ) */
- /* Compare error code `errcode' with the error `err' for equality */
- /* and inequality, respectively. Example: */
- /* */
- /* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
- /* ... */
- /* */
- /* Using this macro you don't have to think about error prefixes. */
- /* Of course, if module errors are not active, the above example is */
- /* the same as */
- /* */
- /* if ( error == FT_Err_Invalid_Outline ) */
- /* ... */
- /* */
- /* FT_ERROR_BASE( errcode ) */
- /* FT_ERROR_MODULE( errcode ) */
- /* Get base error and module error code, respectively. */
- /* */
- /* */
- /* It can also be used to create a module error message table easily */
- /* with something like */
- /* */
- /* { */
- /* #undef __FTMODERR_H__ */
- /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
- /* #define FT_MODERR_START_LIST { */
- /* #define FT_MODERR_END_LIST { 0, 0 } }; */
- /* */
- /* const struct */
- /* { */
- /* int mod_err_offset; */
- /* const char* mod_err_msg */
- /* } ft_mod_errors[] = */
- /* */
- /* #include FT_MODULE_ERRORS_H */
- /* } */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTMODERR_H__
-#define __FTMODERR_H__
-
-
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** SETUP MACROS *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-
-#undef FT_NEED_EXTERN_C
-
-#ifndef FT_MODERRDEF
-
-#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
-#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
-#else
-#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
-#endif
-
-#define FT_MODERR_START_LIST enum {
-#define FT_MODERR_END_LIST FT_Mod_Err_Max };
-
-#ifdef __cplusplus
-#define FT_NEED_EXTERN_C
- extern "C" {
-#endif
-
-#endif /* !FT_MODERRDEF */
-
-
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** LIST MODULE ERROR BASES *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-
-#ifdef FT_MODERR_START_LIST
- FT_MODERR_START_LIST
-#endif
-
-
- FT_MODERRDEF( Base, 0x000, "base module" )
- FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
- FT_MODERRDEF( BDF, 0x200, "BDF module" )
- FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
- FT_MODERRDEF( Cache, 0x400, "cache module" )
- FT_MODERRDEF( CFF, 0x500, "CFF module" )
- FT_MODERRDEF( CID, 0x600, "CID module" )
- FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
- FT_MODERRDEF( LZW, 0x800, "LZW module" )
- FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
- FT_MODERRDEF( PCF, 0xA00, "PCF module" )
- FT_MODERRDEF( PFR, 0xB00, "PFR module" )
- FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
- FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
- FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
- FT_MODERRDEF( Raster, 0xF00, "raster module" )
- FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
- FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
- FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
- FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
- FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
- FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
- FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
-
-
-#ifdef FT_MODERR_END_LIST
- FT_MODERR_END_LIST
-#endif
-
-
- /*******************************************************************/
- /*******************************************************************/
- /***** *****/
- /***** CLEANUP *****/
- /***** *****/
- /*******************************************************************/
- /*******************************************************************/
-
-
-#ifdef FT_NEED_EXTERN_C
- }
-#endif
-
-#undef FT_MODERR_START_LIST
-#undef FT_MODERR_END_LIST
-#undef FT_MODERRDEF
-#undef FT_NEED_EXTERN_C
-
-
-#endif /* __FTMODERR_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftotval.h b/src/3rdparty/freetype/include/ftotval.h
deleted file mode 100644
index 75ba03ee8e..0000000000
--- a/src/3rdparty/freetype/include/ftotval.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftotval.h */
-/* */
-/* FreeType API for validating OpenType tables (specification). */
-/* */
-/* Copyright 2004-2007, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-/***************************************************************************/
-/* */
-/* */
-/* Warning: This module might be moved to a different library in the */
-/* future to avoid a tight dependency between FreeType and the */
-/* OpenType specification. */
-/* */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTOTVAL_H__
-#define __FTOTVAL_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* ot_validation */
- /* */
- /* <Title> */
- /* OpenType Validation */
- /* */
- /* <Abstract> */
- /* An API to validate OpenType tables. */
- /* */
- /* <Description> */
- /* This section contains the declaration of functions to validate */
- /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
- /* */
- /* <Order> */
- /* FT_OpenType_Validate */
- /* FT_OpenType_Free */
- /* */
- /* FT_VALIDATE_OTXXX */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @enum:
- * FT_VALIDATE_OTXXX
- *
- * @description:
- * A list of bit-field constants used with @FT_OpenType_Validate to
- * indicate which OpenType tables should be validated.
- *
- * @values:
- * FT_VALIDATE_BASE ::
- * Validate BASE table.
- *
- * FT_VALIDATE_GDEF ::
- * Validate GDEF table.
- *
- * FT_VALIDATE_GPOS ::
- * Validate GPOS table.
- *
- * FT_VALIDATE_GSUB ::
- * Validate GSUB table.
- *
- * FT_VALIDATE_JSTF ::
- * Validate JSTF table.
- *
- * FT_VALIDATE_MATH ::
- * Validate MATH table.
- *
- * FT_VALIDATE_OT ::
- * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
- *
- */
-#define FT_VALIDATE_BASE 0x0100
-#define FT_VALIDATE_GDEF 0x0200
-#define FT_VALIDATE_GPOS 0x0400
-#define FT_VALIDATE_GSUB 0x0800
-#define FT_VALIDATE_JSTF 0x1000
-#define FT_VALIDATE_MATH 0x2000
-
-#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
- FT_VALIDATE_GDEF | \
- FT_VALIDATE_GPOS | \
- FT_VALIDATE_GSUB | \
- FT_VALIDATE_JSTF | \
- FT_VALIDATE_MATH
-
- /**********************************************************************
- *
- * @function:
- * FT_OpenType_Validate
- *
- * @description:
- * Validate various OpenType tables to assure that all offsets and
- * indices are valid. The idea is that a higher-level library that
- * actually does the text layout can access those tables without
- * error checking (which can be quite time consuming).
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * validation_flags ::
- * A bit field that specifies the tables to be validated. See
- * @FT_VALIDATE_OTXXX for possible values.
- *
- * @output:
- * BASE_table ::
- * A pointer to the BASE table.
- *
- * GDEF_table ::
- * A pointer to the GDEF table.
- *
- * GPOS_table ::
- * A pointer to the GPOS table.
- *
- * GSUB_table ::
- * A pointer to the GSUB table.
- *
- * JSTF_table ::
- * A pointer to the JSTF table.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with OpenType fonts, returning an error
- * otherwise.
- *
- * After use, the application should deallocate the five tables with
- * @FT_OpenType_Free. A NULL value indicates that the table either
- * doesn't exist in the font, or the application hasn't asked for
- * validation.
- */
- FT_EXPORT( FT_Error )
- FT_OpenType_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes *BASE_table,
- FT_Bytes *GDEF_table,
- FT_Bytes *GPOS_table,
- FT_Bytes *GSUB_table,
- FT_Bytes *JSTF_table );
-
- /**********************************************************************
- *
- * @function:
- * FT_OpenType_Free
- *
- * @description:
- * Free the buffer allocated by OpenType validator.
- *
- * @input:
- * face ::
- * A handle to the input face.
- *
- * table ::
- * The pointer to the buffer that is allocated by
- * @FT_OpenType_Validate.
- *
- * @note:
- * This function must be used to free the buffer allocated by
- * @FT_OpenType_Validate only.
- */
- FT_EXPORT( void )
- FT_OpenType_Free( FT_Face face,
- FT_Bytes table );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTOTVAL_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftoutln.h b/src/3rdparty/freetype/include/ftoutln.h
deleted file mode 100644
index d3b8fbd265..0000000000
--- a/src/3rdparty/freetype/include/ftoutln.h
+++ /dev/null
@@ -1,574 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftoutln.h */
-/* */
-/* Support for the FT_Outline type used to store glyph shapes of */
-/* most scalable font formats (specification). */
-/* */
-/* Copyright 1996-2003, 2005-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTOUTLN_H__
-#define __FTOUTLN_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* outline_processing */
- /* */
- /* <Title> */
- /* Outline Processing */
- /* */
- /* <Abstract> */
- /* Functions to create, transform, and render vectorial glyph images. */
- /* */
- /* <Description> */
- /* This section contains routines used to create and destroy scalable */
- /* glyph images known as `outlines'. These can also be measured, */
- /* transformed, and converted into bitmaps and pixmaps. */
- /* */
- /* <Order> */
- /* FT_Outline */
- /* FT_Outline_New */
- /* FT_Outline_Done */
- /* FT_Outline_Copy */
- /* FT_Outline_Translate */
- /* FT_Outline_Transform */
- /* FT_Outline_Embolden */
- /* FT_Outline_EmboldenXY */
- /* FT_Outline_Reverse */
- /* FT_Outline_Check */
- /* */
- /* FT_Outline_Get_CBox */
- /* FT_Outline_Get_BBox */
- /* */
- /* FT_Outline_Get_Bitmap */
- /* FT_Outline_Render */
- /* FT_Outline_Decompose */
- /* FT_Outline_Funcs */
- /* FT_Outline_MoveToFunc */
- /* FT_Outline_LineToFunc */
- /* FT_Outline_ConicToFunc */
- /* FT_Outline_CubicToFunc */
- /* */
- /* FT_Orientation */
- /* FT_Outline_Get_Orientation */
- /* */
- /* FT_OUTLINE_XXX */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Decompose */
- /* */
- /* <Description> */
- /* Walk over an outline's structure to decompose it into individual */
- /* segments and Bézier arcs. This function also emits `move to' */
- /* operations to indicate the start of new contours in the outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source target. */
- /* */
- /* func_interface :: A table of `emitters', i.e., function pointers */
- /* called during decomposition to indicate path */
- /* operations. */
- /* */
- /* <InOut> */
- /* user :: A typeless pointer that is passed to each */
- /* emitter during the decomposition. It can be */
- /* used to store the state during the */
- /* decomposition. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* A contour that contains a single point only is represented by a */
- /* `move to' operation followed by `line to' to the same point. In */
- /* most cases, it is best to filter this out before using the */
- /* outline for stroking purposes (otherwise it would result in a */
- /* visible dot when round caps are used). */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Decompose( FT_Outline* outline,
- const FT_Outline_Funcs* func_interface,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_New */
- /* */
- /* <Description> */
- /* Create a new outline of a given size. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object from where the */
- /* outline is allocated. Note however that the new */
- /* outline will *not* necessarily be *freed*, when */
- /* destroying the library, by @FT_Done_FreeType. */
- /* */
- /* numPoints :: The maximum number of points within the outline. */
- /* Must be smaller than or equal to 0xFFFF (65535). */
- /* */
- /* numContours :: The maximum number of contours within the outline. */
- /* This value must be in the range 0 to `numPoints'. */
- /* */
- /* <Output> */
- /* anoutline :: A handle to the new outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' parameter is simply */
- /* to use the library's memory allocator. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_New( FT_Library library,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline );
-
-
- FT_EXPORT( FT_Error )
- FT_Outline_New_Internal( FT_Memory memory,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Done */
- /* */
- /* <Description> */
- /* Destroy an outline created with @FT_Outline_New. */
- /* */
- /* <Input> */
- /* library :: A handle of the library object used to allocate the */
- /* outline. */
- /* */
- /* outline :: A pointer to the outline object to be discarded. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If the outline's `owner' field is not set, only the outline */
- /* descriptor will be released. */
- /* */
- /* The reason why this function takes an `library' parameter is */
- /* simply to use ft_mem_free(). */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Done( FT_Library library,
- FT_Outline* outline );
-
-
- FT_EXPORT( FT_Error )
- FT_Outline_Done_Internal( FT_Memory memory,
- FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Check */
- /* */
- /* <Description> */
- /* Check the contents of an outline descriptor. */
- /* */
- /* <Input> */
- /* outline :: A handle to a source outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Check( FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_CBox */
- /* */
- /* <Description> */
- /* Return an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bézier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* that contains Bézier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component, which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <Output> */
- /* acbox :: The outline's control box. */
- /* */
- /* <Note> */
- /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Get_CBox( const FT_Outline* outline,
- FT_BBox *acbox );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Translate */
- /* */
- /* <Description> */
- /* Apply a simple translation to the points of an outline. */
- /* */
- /* <InOut> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Input> */
- /* xOffset :: The horizontal offset. */
- /* */
- /* yOffset :: The vertical offset. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Translate( const FT_Outline* outline,
- FT_Pos xOffset,
- FT_Pos yOffset );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Copy */
- /* */
- /* <Description> */
- /* Copy an outline into another one. Both objects must have the */
- /* same sizes (number of points & number of contours) when this */
- /* function is called. */
- /* */
- /* <Input> */
- /* source :: A handle to the source outline. */
- /* */
- /* <Output> */
- /* target :: A handle to the target outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Copy( const FT_Outline* source,
- FT_Outline *target );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Transform */
- /* */
- /* <Description> */
- /* Apply a simple 2x2 matrix to all of an outline's points. Useful */
- /* for applying rotations, slanting, flipping, etc. */
- /* */
- /* <InOut> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the transformation matrix. */
- /* */
- /* <Note> */
- /* You can use @FT_Outline_Translate if you need to translate the */
- /* outline's points. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Transform( const FT_Outline* outline,
- const FT_Matrix* matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Embolden */
- /* */
- /* <Description> */
- /* Embolden an outline. The new outline will be at most 4~times */
- /* `strength' pixels wider and higher. You may think of the left and */
- /* bottom borders as unchanged. */
- /* */
- /* Negative `strength' values to reduce the outline thickness are */
- /* possible also. */
- /* */
- /* <InOut> */
- /* outline :: A handle to the target outline. */
- /* */
- /* <Input> */
- /* strength :: How strong the glyph is emboldened. Expressed in */
- /* 26.6 pixel format. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The used algorithm to increase or decrease the thickness of the */
- /* glyph doesn't change the number of points; this means that certain */
- /* situations like acute angles or intersections are sometimes */
- /* handled incorrectly. */
- /* */
- /* If you need `better' metrics values you should call */
- /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */
- /* */
- /* Example call: */
- /* */
- /* { */
- /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
- /* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
- /* FT_Outline_Embolden( &face->slot->outline, strength ); */
- /* } */
- /* */
- /* To get meaningful results, font scaling values must be set with */
- /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Embolden( FT_Outline* outline,
- FT_Pos strength );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_EmboldenXY */
- /* */
- /* <Description> */
- /* Embolden an outline. The new outline will be `xstrength' pixels */
- /* wider and `ystrength' pixels higher. Otherwise, it is similar to */
- /* @FT_Outline_Embolden, which uses the same strength in both */
- /* directions. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_EmboldenXY( FT_Outline* outline,
- FT_Pos xstrength,
- FT_Pos ystrength );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Reverse */
- /* */
- /* <Description> */
- /* Reverse the drawing direction of an outline. This is used to */
- /* ensure consistent fill conventions for mirrored glyphs. */
- /* */
- /* <InOut> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Note> */
- /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
- /* the outline's `flags' field. */
- /* */
- /* It shouldn't be used by a normal client application, unless it */
- /* knows what it is doing. */
- /* */
- FT_EXPORT( void )
- FT_Outline_Reverse( FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_Bitmap */
- /* */
- /* <Description> */
- /* Render an outline within a bitmap. The outline's image is simply */
- /* OR-ed to the target bitmap. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <InOut> */
- /* abitmap :: A pointer to the target bitmap descriptor. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function does NOT CREATE the bitmap, it only renders an */
- /* outline image within the one you pass to it! Consequently, the */
- /* various fields in `abitmap' should be set accordingly. */
- /* */
- /* It will use the raster corresponding to the default glyph format. */
- /* */
- /* The value of the `num_grays' field in `abitmap' is ignored. If */
- /* you select the gray-level rasterizer, and you want less than 256 */
- /* gray levels, you have to use @FT_Outline_Render directly. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Get_Bitmap( FT_Library library,
- FT_Outline* outline,
- const FT_Bitmap *abitmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Render */
- /* */
- /* <Description> */
- /* Render an outline within a bitmap using the current scan-convert. */
- /* This function uses an @FT_Raster_Params structure as an argument, */
- /* allowing advanced features like direct composition, translucency, */
- /* etc. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <InOut> */
- /* params :: A pointer to an @FT_Raster_Params structure used to */
- /* describe the rendering operation. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You should know what you are doing and how @FT_Raster_Params works */
- /* to use this function. */
- /* */
- /* The field `params.source' will be set to `outline' before the scan */
- /* converter is called, which means that the value you give to it is */
- /* actually ignored. */
- /* */
- /* The gray-level rasterizer always uses 256 gray levels. If you */
- /* want less gray levels, you have to provide your own span callback. */
- /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */
- /* @FT_Raster_Params structure for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Outline_Render( FT_Library library,
- FT_Outline* outline,
- FT_Raster_Params* params );
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_Orientation
- *
- * @description:
- * A list of values used to describe an outline's contour orientation.
- *
- * The TrueType and PostScript specifications use different conventions
- * to determine whether outline contours should be filled or unfilled.
- *
- * @values:
- * FT_ORIENTATION_TRUETYPE ::
- * According to the TrueType specification, clockwise contours must
- * be filled, and counter-clockwise ones must be unfilled.
- *
- * FT_ORIENTATION_POSTSCRIPT ::
- * According to the PostScript specification, counter-clockwise contours
- * must be filled, and clockwise ones must be unfilled.
- *
- * FT_ORIENTATION_FILL_RIGHT ::
- * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
- * remember that in TrueType, everything that is to the right of
- * the drawing direction of a contour must be filled.
- *
- * FT_ORIENTATION_FILL_LEFT ::
- * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
- * remember that in PostScript, everything that is to the left of
- * the drawing direction of a contour must be filled.
- *
- * FT_ORIENTATION_NONE ::
- * The orientation cannot be determined. That is, different parts of
- * the glyph have different orientation.
- *
- */
- typedef enum FT_Orientation_
- {
- FT_ORIENTATION_TRUETYPE = 0,
- FT_ORIENTATION_POSTSCRIPT = 1,
- FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
- FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
- FT_ORIENTATION_NONE
-
- } FT_Orientation;
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Outline_Get_Orientation
- *
- * @description:
- * This function analyzes a glyph outline and tries to compute its
- * fill orientation (see @FT_Orientation). This is done by integrating
- * the total area covered by the outline. The positive integral
- * corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT
- * is returned. The negative integral corresponds to the counter-clockwise
- * orientation and @FT_ORIENTATION_TRUETYPE is returned.
- *
- * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
- * outlines.
- *
- * @input:
- * outline ::
- * A handle to the source outline.
- *
- * @return:
- * The orientation.
- *
- */
- FT_EXPORT( FT_Orientation )
- FT_Outline_Get_Orientation( FT_Outline* outline );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTOUTLN_H__ */
-
-
-/* END */
-
-
-/* Local Variables: */
-/* coding: utf-8 */
-/* End: */
diff --git a/src/3rdparty/freetype/include/ftpfr.h b/src/3rdparty/freetype/include/ftpfr.h
deleted file mode 100644
index 7d5035396b..0000000000
--- a/src/3rdparty/freetype/include/ftpfr.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftpfr.h */
-/* */
-/* FreeType API for accessing PFR-specific data (specification only). */
-/* */
-/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTPFR_H__
-#define __FTPFR_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* pfr_fonts */
- /* */
- /* <Title> */
- /* PFR Fonts */
- /* */
- /* <Abstract> */
- /* PFR/TrueDoc specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of PFR-specific functions. */
- /* */
- /*************************************************************************/
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_PFR_Metrics
- *
- * @description:
- * Return the outline and metrics resolutions of a given PFR face.
- *
- * @input:
- * face :: Handle to the input face. It can be a non-PFR face.
- *
- * @output:
- * aoutline_resolution ::
- * Outline resolution. This is equivalent to `face->units_per_EM'
- * for non-PFR fonts. Optional (parameter can be NULL).
- *
- * ametrics_resolution ::
- * Metrics resolution. This is equivalent to `outline_resolution'
- * for non-PFR fonts. Optional (parameter can be NULL).
- *
- * ametrics_x_scale ::
- * A 16.16 fixed-point number used to scale distance expressed
- * in metrics units to device sub-pixels. This is equivalent to
- * `face->size->x_scale', but for metrics only. Optional (parameter
- * can be NULL).
- *
- * ametrics_y_scale ::
- * Same as `ametrics_x_scale' but for the vertical direction.
- * optional (parameter can be NULL).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If the input face is not a PFR, this function will return an error.
- * However, in all cases, it will return valid values.
- */
- FT_EXPORT( FT_Error )
- FT_Get_PFR_Metrics( FT_Face face,
- FT_UInt *aoutline_resolution,
- FT_UInt *ametrics_resolution,
- FT_Fixed *ametrics_x_scale,
- FT_Fixed *ametrics_y_scale );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_PFR_Kerning
- *
- * @description:
- * Return the kerning pair corresponding to two glyphs in a PFR face.
- * The distance is expressed in metrics units, unlike the result of
- * @FT_Get_Kerning.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * left :: Index of the left glyph.
- *
- * right :: Index of the right glyph.
- *
- * @output:
- * avector :: A kerning vector.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function always return distances in original PFR metrics
- * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
- * mode, which always returns distances converted to outline units.
- *
- * You can use the value of the `x_scale' and `y_scale' parameters
- * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
- */
- FT_EXPORT( FT_Error )
- FT_Get_PFR_Kerning( FT_Face face,
- FT_UInt left,
- FT_UInt right,
- FT_Vector *avector );
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_PFR_Advance
- *
- * @description:
- * Return a given glyph advance, expressed in original metrics units,
- * from a PFR font.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * gindex :: The glyph index.
- *
- * @output:
- * aadvance :: The glyph advance in metrics units.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
- * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
- */
- FT_EXPORT( FT_Error )
- FT_Get_PFR_Advance( FT_Face face,
- FT_UInt gindex,
- FT_Pos *aadvance );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTPFR_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftrender.h b/src/3rdparty/freetype/include/ftrender.h
deleted file mode 100644
index e8d36363ca..0000000000
--- a/src/3rdparty/freetype/include/ftrender.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftrender.h */
-/* */
-/* FreeType renderer modules public interface (specification). */
-/* */
-/* Copyright 1996-2001, 2005, 2006, 2010 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTRENDER_H__
-#define __FTRENDER_H__
-
-
-#include <ft2build.h>
-#include FT_MODULE_H
-#include FT_GLYPH_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* module_management */
- /* */
- /*************************************************************************/
-
-
- /* create a new glyph object */
- typedef FT_Error
- (*FT_Glyph_InitFunc)( FT_Glyph glyph,
- FT_GlyphSlot slot );
-
- /* destroys a given glyph object */
- typedef void
- (*FT_Glyph_DoneFunc)( FT_Glyph glyph );
-
- typedef void
- (*FT_Glyph_TransformFunc)( FT_Glyph glyph,
- const FT_Matrix* matrix,
- const FT_Vector* delta );
-
- typedef void
- (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
- FT_BBox* abbox );
-
- typedef FT_Error
- (*FT_Glyph_CopyFunc)( FT_Glyph source,
- FT_Glyph target );
-
- typedef FT_Error
- (*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
- FT_GlyphSlot slot );
-
-/* deprecated */
-#define FT_Glyph_Init_Func FT_Glyph_InitFunc
-#define FT_Glyph_Done_Func FT_Glyph_DoneFunc
-#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
-#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
-#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
-#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
-
-
- struct FT_Glyph_Class_
- {
- FT_Long glyph_size;
- FT_Glyph_Format glyph_format;
- FT_Glyph_InitFunc glyph_init;
- FT_Glyph_DoneFunc glyph_done;
- FT_Glyph_CopyFunc glyph_copy;
- FT_Glyph_TransformFunc glyph_transform;
- FT_Glyph_GetBBoxFunc glyph_bbox;
- FT_Glyph_PrepareFunc glyph_prepare;
- };
-
-
- typedef FT_Error
- (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
- FT_GlyphSlot slot,
- FT_UInt mode,
- const FT_Vector* origin );
-
- typedef FT_Error
- (*FT_Renderer_TransformFunc)( FT_Renderer renderer,
- FT_GlyphSlot slot,
- const FT_Matrix* matrix,
- const FT_Vector* delta );
-
-
- typedef void
- (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
- FT_GlyphSlot slot,
- FT_BBox* cbox );
-
-
- typedef FT_Error
- (*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
- FT_ULong mode_tag,
- FT_Pointer mode_ptr );
-
-/* deprecated identifiers */
-#define FTRenderer_render FT_Renderer_RenderFunc
-#define FTRenderer_transform FT_Renderer_TransformFunc
-#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
-#define FTRenderer_setMode FT_Renderer_SetModeFunc
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Renderer_Class */
- /* */
- /* <Description> */
- /* The renderer module class descriptor. */
- /* */
- /* <Fields> */
- /* root :: The root @FT_Module_Class fields. */
- /* */
- /* glyph_format :: The glyph image format this renderer handles. */
- /* */
- /* render_glyph :: A method used to render the image that is in a */
- /* given glyph slot into a bitmap. */
- /* */
- /* transform_glyph :: A method used to transform the image that is in */
- /* a given glyph slot. */
- /* */
- /* get_glyph_cbox :: A method used to access the glyph's cbox. */
- /* */
- /* set_mode :: A method used to pass additional parameters. */
- /* */
- /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
- /* This is a pointer to its raster's class. */
- /* */
- typedef struct FT_Renderer_Class_
- {
- FT_Module_Class root;
-
- FT_Glyph_Format glyph_format;
-
- FT_Renderer_RenderFunc render_glyph;
- FT_Renderer_TransformFunc transform_glyph;
- FT_Renderer_GetCBoxFunc get_glyph_cbox;
- FT_Renderer_SetModeFunc set_mode;
-
- FT_Raster_Funcs* raster_class;
-
- } FT_Renderer_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Renderer */
- /* */
- /* <Description> */
- /* Retrieve the current renderer for a given glyph format. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* format :: The glyph format. */
- /* */
- /* <Return> */
- /* A renderer handle. 0~if none found. */
- /* */
- /* <Note> */
- /* An error will be returned if a module already exists by that name, */
- /* or if the module requires a version of FreeType that is too great. */
- /* */
- /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
- /* renderer by its name, use @FT_Get_Module. */
- /* */
- FT_EXPORT( FT_Renderer )
- FT_Get_Renderer( FT_Library library,
- FT_Glyph_Format format );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Renderer */
- /* */
- /* <Description> */
- /* Set the current renderer to use, and set additional mode. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library object. */
- /* */
- /* <Input> */
- /* renderer :: A handle to the renderer object. */
- /* */
- /* num_params :: The number of additional parameters. */
- /* */
- /* parameters :: Additional parameters. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* In case of success, the renderer will be used to convert glyph */
- /* images in the renderer's known format into bitmaps. */
- /* */
- /* This doesn't change the current renderer for other formats. */
- /* */
- /* Currently, only the B/W renderer, if compiled with */
- /* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
- /* anti-aliasing mode; this option must be set directly in */
- /* `ftraster.c' and is undefined by default) accepts a single tag */
- /* `pal5' to set its gray palette as a character string with */
- /* 5~elements. Consequently, the third and fourth argument are zero */
- /* normally. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Renderer( FT_Library library,
- FT_Renderer renderer,
- FT_UInt num_params,
- FT_Parameter* parameters );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTRENDER_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftsizes.h b/src/3rdparty/freetype/include/ftsizes.h
deleted file mode 100644
index 4167045701..0000000000
--- a/src/3rdparty/freetype/include/ftsizes.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftsizes.h */
-/* */
-/* FreeType size objects management (specification). */
-/* */
-/* Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* Typical application would normally not need to use these functions. */
- /* However, they have been placed in a public API for the rare cases */
- /* where they are needed. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTSIZES_H__
-#define __FTSIZES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* sizes_management */
- /* */
- /* <Title> */
- /* Size Management */
- /* */
- /* <Abstract> */
- /* Managing multiple sizes per face. */
- /* */
- /* <Description> */
- /* When creating a new face object (e.g., with @FT_New_Face), an */
- /* @FT_Size object is automatically created and used to store all */
- /* pixel-size dependent information, available in the `face->size' */
- /* field. */
- /* */
- /* It is however possible to create more sizes for a given face, */
- /* mostly in order to manage several character pixel sizes of the */
- /* same font family and style. See @FT_New_Size and @FT_Done_Size. */
- /* */
- /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
- /* modify the contents of the current `active' size; you thus need */
- /* to use @FT_Activate_Size to change it. */
- /* */
- /* 99% of applications won't need the functions provided here, */
- /* especially if they use the caching sub-system, so be cautious */
- /* when using these. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Size */
- /* */
- /* <Description> */
- /* Create a new size object from a given face object. */
- /* */
- /* <Input> */
- /* face :: A handle to a parent face object. */
- /* */
- /* <Output> */
- /* asize :: A handle to a new size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You need to call @FT_Activate_Size in order to select the new size */
- /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
- /* @FT_Load_Glyph, @FT_Load_Char, etc. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Size( FT_Face face,
- FT_Size* size );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Size */
- /* */
- /* <Description> */
- /* Discard a given size object. Note that @FT_Done_Face */
- /* automatically discards all size objects allocated with */
- /* @FT_New_Size. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Size( FT_Size size );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Activate_Size */
- /* */
- /* <Description> */
- /* Even though it is possible to create several size objects for a */
- /* given face (see @FT_New_Size for details), functions like */
- /* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */
- /* activated last to determine the `current character pixel size'. */
- /* */
- /* This function can be used to `activate' a previously created size */
- /* object. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If `face' is the size's parent face object, this function changes */
- /* the value of `face->size' to the input size handle. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Activate_Size( FT_Size size );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTSIZES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftsnames.h b/src/3rdparty/freetype/include/ftsnames.h
deleted file mode 100644
index 88af440356..0000000000
--- a/src/3rdparty/freetype/include/ftsnames.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftsnames.h */
-/* */
-/* Simple interface to access SFNT name tables (which are used */
-/* to hold font names, copyright info, notices, etc.) (specification). */
-/* */
-/* This is _not_ used to retrieve glyph names! */
-/* */
-/* Copyright 1996-2003, 2006, 2009, 2010, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FT_SFNT_NAMES_H__
-#define __FT_SFNT_NAMES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* sfnt_names */
- /* */
- /* <Title> */
- /* SFNT Names */
- /* */
- /* <Abstract> */
- /* Access the names embedded in TrueType and OpenType files. */
- /* */
- /* <Description> */
- /* The TrueType and OpenType specifications allow the inclusion of */
- /* a special `names table' in font files. This table contains */
- /* textual (and internationalized) information regarding the font, */
- /* like family name, copyright, version, etc. */
- /* */
- /* The definitions below are used to access them if available. */
- /* */
- /* Note that this has nothing to do with glyph names! */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SfntName */
- /* */
- /* <Description> */
- /* A structure used to model an SFNT `name' table entry. */
- /* */
- /* <Fields> */
- /* platform_id :: The platform ID for `string'. */
- /* */
- /* encoding_id :: The encoding ID for `string'. */
- /* */
- /* language_id :: The language ID for `string'. */
- /* */
- /* name_id :: An identifier for `string'. */
- /* */
- /* string :: The `name' string. Note that its format differs */
- /* depending on the (platform,encoding) pair. It can */
- /* be a Pascal String, a UTF-16 one, etc. */
- /* */
- /* Generally speaking, the string is not */
- /* zero-terminated. Please refer to the TrueType */
- /* specification for details. */
- /* */
- /* string_len :: The length of `string' in bytes. */
- /* */
- /* <Note> */
- /* Possible values for `platform_id', `encoding_id', `language_id', */
- /* and `name_id' are given in the file `ttnameid.h'. For details */
- /* please refer to the TrueType or OpenType specification. */
- /* */
- /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
- /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
- /* */
- typedef struct FT_SfntName_
- {
- FT_UShort platform_id;
- FT_UShort encoding_id;
- FT_UShort language_id;
- FT_UShort name_id;
-
- FT_Byte* string; /* this string is *not* null-terminated! */
- FT_UInt string_len; /* in bytes */
-
- } FT_SfntName;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Name_Count */
- /* */
- /* <Description> */
- /* Retrieve the number of name strings in the SFNT `name' table. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Return> */
- /* The number of strings in the `name' table. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Sfnt_Name_Count( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Name */
- /* */
- /* <Description> */
- /* Retrieve a string of the SFNT `name' table for a given index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* idx :: The index of the `name' string. */
- /* */
- /* <Output> */
- /* aname :: The indexed @FT_SfntName structure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The `string' array returned in the `aname' structure is not */
- /* null-terminated. The application should deallocate it if it is no */
- /* longer in use. */
- /* */
- /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
- /* `name' table entries, then do a loop until you get the right */
- /* platform, encoding, and name ID. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Sfnt_Name( FT_Face face,
- FT_UInt idx,
- FT_SfntName *aname );
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to make
- * FT_Open_Face() ignore preferred family subfamily names in `name'
- * table since OpenType version 1.4. For backwards compatibility with
- * legacy systems that have a 4-face-per-family restriction.
- *
- */
-#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to make
- * FT_Open_Face() ignore preferred subfamily names in `name' table since
- * OpenType version 1.4. For backwards compatibility with legacy
- * systems that have a 4-face-per-family restriction.
- *
- */
-#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FT_SFNT_NAMES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftstroke.h b/src/3rdparty/freetype/include/ftstroke.h
deleted file mode 100644
index bd311709f3..0000000000
--- a/src/3rdparty/freetype/include/ftstroke.h
+++ /dev/null
@@ -1,785 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftstroke.h */
-/* */
-/* FreeType path stroker (specification). */
-/* */
-/* Copyright 2002-2006, 2008, 2009, 2011-2012, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FT_STROKE_H__
-#define __FT_STROKE_H__
-
-#include <ft2build.h>
-#include FT_OUTLINE_H
-#include FT_GLYPH_H
-
-
-FT_BEGIN_HEADER
-
-
- /************************************************************************
- *
- * @section:
- * glyph_stroker
- *
- * @title:
- * Glyph Stroker
- *
- * @abstract:
- * Generating bordered and stroked glyphs.
- *
- * @description:
- * This component generates stroked outlines of a given vectorial
- * glyph. It also allows you to retrieve the `outside' and/or the
- * `inside' borders of the stroke.
- *
- * This can be useful to generate `bordered' glyph, i.e., glyphs
- * displayed with a coloured (and anti-aliased) border around their
- * shape.
- *
- * @order:
- * FT_Stroker
- *
- * FT_Stroker_LineJoin
- * FT_Stroker_LineCap
- * FT_StrokerBorder
- *
- * FT_Outline_GetInsideBorder
- * FT_Outline_GetOutsideBorder
- *
- * FT_Glyph_Stroke
- * FT_Glyph_StrokeBorder
- *
- * FT_Stroker_New
- * FT_Stroker_Set
- * FT_Stroker_Rewind
- * FT_Stroker_ParseOutline
- * FT_Stroker_Done
- *
- * FT_Stroker_BeginSubPath
- * FT_Stroker_EndSubPath
- *
- * FT_Stroker_LineTo
- * FT_Stroker_ConicTo
- * FT_Stroker_CubicTo
- *
- * FT_Stroker_GetBorderCounts
- * FT_Stroker_ExportBorder
- * FT_Stroker_GetCounts
- * FT_Stroker_Export
- *
- */
-
-
- /**************************************************************
- *
- * @type:
- * FT_Stroker
- *
- * @description:
- * Opaque handle to a path stroker object.
- */
- typedef struct FT_StrokerRec_* FT_Stroker;
-
-
- /**************************************************************
- *
- * @enum:
- * FT_Stroker_LineJoin
- *
- * @description:
- * These values determine how two joining lines are rendered
- * in a stroker.
- *
- * @values:
- * FT_STROKER_LINEJOIN_ROUND ::
- * Used to render rounded line joins. Circular arcs are used
- * to join two lines smoothly.
- *
- * FT_STROKER_LINEJOIN_BEVEL ::
- * Used to render beveled line joins. The outer corner of
- * the joined lines is filled by enclosing the triangular
- * region of the corner with a straight line between the
- * outer corners of each stroke.
- *
- * FT_STROKER_LINEJOIN_MITER_FIXED ::
- * Used to render mitered line joins, with fixed bevels if the
- * miter limit is exceeded. The outer edges of the strokes
- * for the two segments are extended until they meet at an
- * angle. If the segments meet at too sharp an angle (such
- * that the miter would extend from the intersection of the
- * segments a distance greater than the product of the miter
- * limit value and the border radius), then a bevel join (see
- * above) is used instead. This prevents long spikes being
- * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
- * line join as used in PostScript and PDF.
- *
- * FT_STROKER_LINEJOIN_MITER_VARIABLE ::
- * FT_STROKER_LINEJOIN_MITER ::
- * Used to render mitered line joins, with variable bevels if
- * the miter limit is exceeded. The intersection of the
- * strokes is clipped at a line perpendicular to the bisector
- * of the angle between the strokes, at the distance from the
- * intersection of the segments equal to the product of the
- * miter limit value and the border radius. This prevents
- * long spikes being created.
- * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
- * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
- * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
- * backwards compatibility.
- */
- typedef enum FT_Stroker_LineJoin_
- {
- FT_STROKER_LINEJOIN_ROUND = 0,
- FT_STROKER_LINEJOIN_BEVEL = 1,
- FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
- FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE,
- FT_STROKER_LINEJOIN_MITER_FIXED = 3
-
- } FT_Stroker_LineJoin;
-
-
- /**************************************************************
- *
- * @enum:
- * FT_Stroker_LineCap
- *
- * @description:
- * These values determine how the end of opened sub-paths are
- * rendered in a stroke.
- *
- * @values:
- * FT_STROKER_LINECAP_BUTT ::
- * The end of lines is rendered as a full stop on the last
- * point itself.
- *
- * FT_STROKER_LINECAP_ROUND ::
- * The end of lines is rendered as a half-circle around the
- * last point.
- *
- * FT_STROKER_LINECAP_SQUARE ::
- * The end of lines is rendered as a square around the
- * last point.
- */
- typedef enum FT_Stroker_LineCap_
- {
- FT_STROKER_LINECAP_BUTT = 0,
- FT_STROKER_LINECAP_ROUND,
- FT_STROKER_LINECAP_SQUARE
-
- } FT_Stroker_LineCap;
-
-
- /**************************************************************
- *
- * @enum:
- * FT_StrokerBorder
- *
- * @description:
- * These values are used to select a given stroke border
- * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
- *
- * @values:
- * FT_STROKER_BORDER_LEFT ::
- * Select the left border, relative to the drawing direction.
- *
- * FT_STROKER_BORDER_RIGHT ::
- * Select the right border, relative to the drawing direction.
- *
- * @note:
- * Applications are generally interested in the `inside' and `outside'
- * borders. However, there is no direct mapping between these and the
- * `left' and `right' ones, since this really depends on the glyph's
- * drawing orientation, which varies between font formats.
- *
- * You can however use @FT_Outline_GetInsideBorder and
- * @FT_Outline_GetOutsideBorder to get these.
- */
- typedef enum FT_StrokerBorder_
- {
- FT_STROKER_BORDER_LEFT = 0,
- FT_STROKER_BORDER_RIGHT
-
- } FT_StrokerBorder;
-
-
- /**************************************************************
- *
- * @function:
- * FT_Outline_GetInsideBorder
- *
- * @description:
- * Retrieve the @FT_StrokerBorder value corresponding to the
- * `inside' borders of a given outline.
- *
- * @input:
- * outline ::
- * The source outline handle.
- *
- * @return:
- * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
- * outlines.
- */
- FT_EXPORT( FT_StrokerBorder )
- FT_Outline_GetInsideBorder( FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Outline_GetOutsideBorder
- *
- * @description:
- * Retrieve the @FT_StrokerBorder value corresponding to the
- * `outside' borders of a given outline.
- *
- * @input:
- * outline ::
- * The source outline handle.
- *
- * @return:
- * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
- * outlines.
- */
- FT_EXPORT( FT_StrokerBorder )
- FT_Outline_GetOutsideBorder( FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_New
- *
- * @description:
- * Create a new stroker object.
- *
- * @input:
- * library ::
- * FreeType library handle.
- *
- * @output:
- * astroker ::
- * A new stroker object handle. NULL in case of error.
- *
- * @return:
- * FreeType error code. 0~means success.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_New( FT_Library library,
- FT_Stroker *astroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Set
- *
- * @description:
- * Reset a stroker object's attributes.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * radius ::
- * The border radius.
- *
- * line_cap ::
- * The line cap style.
- *
- * line_join ::
- * The line join style.
- *
- * miter_limit ::
- * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
- * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
- * expressed as 16.16 fixed-point value.
- *
- * @note:
- * The radius is expressed in the same units as the outline
- * coordinates.
- *
- * This function calls @FT_Stroker_Rewind automatically.
- */
- FT_EXPORT( void )
- FT_Stroker_Set( FT_Stroker stroker,
- FT_Fixed radius,
- FT_Stroker_LineCap line_cap,
- FT_Stroker_LineJoin line_join,
- FT_Fixed miter_limit );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Rewind
- *
- * @description:
- * Reset a stroker object without changing its attributes.
- * You should call this function before beginning a new
- * series of calls to @FT_Stroker_BeginSubPath or
- * @FT_Stroker_EndSubPath.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- */
- FT_EXPORT( void )
- FT_Stroker_Rewind( FT_Stroker stroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_ParseOutline
- *
- * @description:
- * A convenience function used to parse a whole outline with
- * the stroker. The resulting outline(s) can be retrieved
- * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * outline ::
- * The source outline.
- *
- * opened ::
- * A boolean. If~1, the outline is treated as an open path instead
- * of a closed one.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If `opened' is~0 (the default), the outline is treated as a closed
- * path, and the stroker generates two distinct `border' outlines.
- *
- * If `opened' is~1, the outline is processed as an open path, and the
- * stroker generates a single `stroke' outline.
- *
- * This function calls @FT_Stroker_Rewind automatically.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_ParseOutline( FT_Stroker stroker,
- FT_Outline* outline,
- FT_Bool opened );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_BeginSubPath
- *
- * @description:
- * Start a new sub-path in the stroker.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * to ::
- * A pointer to the start vector.
- *
- * open ::
- * A boolean. If~1, the sub-path is treated as an open one.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function is useful when you need to stroke a path that is
- * not stored as an @FT_Outline object.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_BeginSubPath( FT_Stroker stroker,
- FT_Vector* to,
- FT_Bool open );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_EndSubPath
- *
- * @description:
- * Close the current sub-path in the stroker.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function after @FT_Stroker_BeginSubPath.
- * If the subpath was not `opened', this function `draws' a
- * single line segment to the start position when needed.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_EndSubPath( FT_Stroker stroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_LineTo
- *
- * @description:
- * `Draw' a single line segment in the stroker's current sub-path,
- * from the last position.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * to ::
- * A pointer to the destination point.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function between @FT_Stroker_BeginSubPath and
- * @FT_Stroker_EndSubPath.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_LineTo( FT_Stroker stroker,
- FT_Vector* to );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_ConicTo
- *
- * @description:
- * `Draw' a single quadratic Bézier in the stroker's current sub-path,
- * from the last position.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * control ::
- * A pointer to a Bézier control point.
- *
- * to ::
- * A pointer to the destination point.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function between @FT_Stroker_BeginSubPath and
- * @FT_Stroker_EndSubPath.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_ConicTo( FT_Stroker stroker,
- FT_Vector* control,
- FT_Vector* to );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_CubicTo
- *
- * @description:
- * `Draw' a single cubic Bézier in the stroker's current sub-path,
- * from the last position.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * control1 ::
- * A pointer to the first Bézier control point.
- *
- * control2 ::
- * A pointer to second Bézier control point.
- *
- * to ::
- * A pointer to the destination point.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * You should call this function between @FT_Stroker_BeginSubPath and
- * @FT_Stroker_EndSubPath.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_CubicTo( FT_Stroker stroker,
- FT_Vector* control1,
- FT_Vector* control2,
- FT_Vector* to );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_GetBorderCounts
- *
- * @description:
- * Call this function once you have finished parsing your paths
- * with the stroker. It returns the number of points and
- * contours necessary to export one of the `border' or `stroke'
- * outlines generated by the stroker.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * border ::
- * The border index.
- *
- * @output:
- * anum_points ::
- * The number of points.
- *
- * anum_contours ::
- * The number of contours.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * When an outline, or a sub-path, is `closed', the stroker generates
- * two independent `border' outlines, named `left' and `right'.
- *
- * When the outline, or a sub-path, is `opened', the stroker merges
- * the `border' outlines with caps. The `left' border receives all
- * points, while the `right' border becomes empty.
- *
- * Use the function @FT_Stroker_GetCounts instead if you want to
- * retrieve the counts associated to both borders.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_GetBorderCounts( FT_Stroker stroker,
- FT_StrokerBorder border,
- FT_UInt *anum_points,
- FT_UInt *anum_contours );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_ExportBorder
- *
- * @description:
- * Call this function after @FT_Stroker_GetBorderCounts to
- * export the corresponding border to your own @FT_Outline
- * structure.
- *
- * Note that this function appends the border points and
- * contours to your outline, but does not try to resize its
- * arrays.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * border ::
- * The border index.
- *
- * outline ::
- * The target outline handle.
- *
- * @note:
- * Always call this function after @FT_Stroker_GetBorderCounts to
- * get sure that there is enough room in your @FT_Outline object to
- * receive all new data.
- *
- * When an outline, or a sub-path, is `closed', the stroker generates
- * two independent `border' outlines, named `left' and `right'.
- *
- * When the outline, or a sub-path, is `opened', the stroker merges
- * the `border' outlines with caps. The `left' border receives all
- * points, while the `right' border becomes empty.
- *
- * Use the function @FT_Stroker_Export instead if you want to
- * retrieve all borders at once.
- */
- FT_EXPORT( void )
- FT_Stroker_ExportBorder( FT_Stroker stroker,
- FT_StrokerBorder border,
- FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_GetCounts
- *
- * @description:
- * Call this function once you have finished parsing your paths
- * with the stroker. It returns the number of points and
- * contours necessary to export all points/borders from the stroked
- * outline/path.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * @output:
- * anum_points ::
- * The number of points.
- *
- * anum_contours ::
- * The number of contours.
- *
- * @return:
- * FreeType error code. 0~means success.
- */
- FT_EXPORT( FT_Error )
- FT_Stroker_GetCounts( FT_Stroker stroker,
- FT_UInt *anum_points,
- FT_UInt *anum_contours );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Export
- *
- * @description:
- * Call this function after @FT_Stroker_GetBorderCounts to
- * export all borders to your own @FT_Outline structure.
- *
- * Note that this function appends the border points and
- * contours to your outline, but does not try to resize its
- * arrays.
- *
- * @input:
- * stroker ::
- * The target stroker handle.
- *
- * outline ::
- * The target outline handle.
- */
- FT_EXPORT( void )
- FT_Stroker_Export( FT_Stroker stroker,
- FT_Outline* outline );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Stroker_Done
- *
- * @description:
- * Destroy a stroker object.
- *
- * @input:
- * stroker ::
- * A stroker handle. Can be NULL.
- */
- FT_EXPORT( void )
- FT_Stroker_Done( FT_Stroker stroker );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Glyph_Stroke
- *
- * @description:
- * Stroke a given outline glyph object with a given stroker.
- *
- * @inout:
- * pglyph ::
- * Source glyph handle on input, new glyph handle on output.
- *
- * @input:
- * stroker ::
- * A stroker handle.
- *
- * destroy ::
- * A Boolean. If~1, the source glyph object is destroyed
- * on success.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source glyph is untouched in case of error.
- *
- * Adding stroke may yield a significantly wider and taller glyph
- * depending on how large of a radius was used to stroke the glyph. You
- * may need to manually adjust horizontal and vertical advance amounts
- * to account for this added size.
- */
- FT_EXPORT( FT_Error )
- FT_Glyph_Stroke( FT_Glyph *pglyph,
- FT_Stroker stroker,
- FT_Bool destroy );
-
-
- /**************************************************************
- *
- * @function:
- * FT_Glyph_StrokeBorder
- *
- * @description:
- * Stroke a given outline glyph object with a given stroker, but
- * only return either its inside or outside border.
- *
- * @inout:
- * pglyph ::
- * Source glyph handle on input, new glyph handle on output.
- *
- * @input:
- * stroker ::
- * A stroker handle.
- *
- * inside ::
- * A Boolean. If~1, return the inside border, otherwise
- * the outside border.
- *
- * destroy ::
- * A Boolean. If~1, the source glyph object is destroyed
- * on success.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The source glyph is untouched in case of error.
- *
- * Adding stroke may yield a significantly wider and taller glyph
- * depending on how large of a radius was used to stroke the glyph. You
- * may need to manually adjust horizontal and vertical advance amounts
- * to account for this added size.
- */
- FT_EXPORT( FT_Error )
- FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
- FT_Stroker stroker,
- FT_Bool inside,
- FT_Bool destroy );
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FT_STROKE_H__ */
-
-
-/* END */
-
-
-/* Local Variables: */
-/* coding: utf-8 */
-/* End: */
diff --git a/src/3rdparty/freetype/include/ftsynth.h b/src/3rdparty/freetype/include/ftsynth.h
deleted file mode 100644
index d0ea730874..0000000000
--- a/src/3rdparty/freetype/include/ftsynth.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftsynth.h */
-/* */
-/* FreeType synthesizing code for emboldening and slanting */
-/* (specification). */
-/* */
-/* Copyright 2000-2001, 2003, 2006, 2008, 2012, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /********* *********/
- /********* WARNING, THIS IS ALPHA CODE! THIS API *********/
- /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
- /********* FREETYPE DEVELOPMENT TEAM *********/
- /********* *********/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /* Main reason for not lifting the functions in this module to a */
- /* `standard' API is that the used parameters for emboldening and */
- /* slanting are not configurable. Consider the functions as a */
- /* code resource that should be copied into the application and */
- /* adapted to the particular needs. */
-
-
-#ifndef __FTSYNTH_H__
-#define __FTSYNTH_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /* Embolden a glyph by a `reasonable' value (which is highly a matter of */
- /* taste). This function is actually a convenience function, providing */
- /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
- /* */
- /* For emboldened outlines the height, width, and advance metrics are */
- /* increased by the strength of the emboldening. You can also call */
- /* @FT_Outline_Get_CBox to get precise values. */
- FT_EXPORT( void )
- FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
-
- /* Slant an outline glyph to the right by about 12 degrees. */
- FT_EXPORT( void )
- FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTSYNTH_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftsystem.h b/src/3rdparty/freetype/include/ftsystem.h
deleted file mode 100644
index 7436ed2678..0000000000
--- a/src/3rdparty/freetype/include/ftsystem.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftsystem.h */
-/* */
-/* FreeType low-level system interface definition (specification). */
-/* */
-/* Copyright 1996-2001, 2002, 2005, 2010, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTSYSTEM_H__
-#define __FTSYSTEM_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* system_interface */
- /* */
- /* <Title> */
- /* System Interface */
- /* */
- /* <Abstract> */
- /* How FreeType manages memory and i/o. */
- /* */
- /* <Description> */
- /* This section contains various definitions related to memory */
- /* management and i/o access. You need to understand this */
- /* information if you want to use a custom memory manager or you own */
- /* i/o streams. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* M E M O R Y M A N A G E M E N T */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type:
- * FT_Memory
- *
- * @description:
- * A handle to a given memory manager object, defined with an
- * @FT_MemoryRec structure.
- *
- */
- typedef struct FT_MemoryRec_* FT_Memory;
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Alloc_Func
- *
- * @description:
- * A function used to allocate `size' bytes from `memory'.
- *
- * @input:
- * memory ::
- * A handle to the source memory manager.
- *
- * size ::
- * The size in bytes to allocate.
- *
- * @return:
- * Address of new memory block. 0~in case of failure.
- *
- */
- typedef void*
- (*FT_Alloc_Func)( FT_Memory memory,
- long size );
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Free_Func
- *
- * @description:
- * A function used to release a given block of memory.
- *
- * @input:
- * memory ::
- * A handle to the source memory manager.
- *
- * block ::
- * The address of the target memory block.
- *
- */
- typedef void
- (*FT_Free_Func)( FT_Memory memory,
- void* block );
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Realloc_Func
- *
- * @description:
- * A function used to re-allocate a given block of memory.
- *
- * @input:
- * memory ::
- * A handle to the source memory manager.
- *
- * cur_size ::
- * The block's current size in bytes.
- *
- * new_size ::
- * The block's requested new size.
- *
- * block ::
- * The block's current address.
- *
- * @return:
- * New block address. 0~in case of memory shortage.
- *
- * @note:
- * In case of error, the old block must still be available.
- *
- */
- typedef void*
- (*FT_Realloc_Func)( FT_Memory memory,
- long cur_size,
- long new_size,
- void* block );
-
-
- /*************************************************************************
- *
- * @struct:
- * FT_MemoryRec
- *
- * @description:
- * A structure used to describe a given memory manager to FreeType~2.
- *
- * @fields:
- * user ::
- * A generic typeless pointer for user data.
- *
- * alloc ::
- * A pointer type to an allocation function.
- *
- * free ::
- * A pointer type to an memory freeing function.
- *
- * realloc ::
- * A pointer type to a reallocation function.
- *
- */
- struct FT_MemoryRec_
- {
- void* user;
- FT_Alloc_Func alloc;
- FT_Free_Func free;
- FT_Realloc_Func realloc;
- };
-
-
- /*************************************************************************/
- /* */
- /* I / O M A N A G E M E N T */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type:
- * FT_Stream
- *
- * @description:
- * A handle to an input stream.
- *
- * @also:
- * See @FT_StreamRec for the publicly accessible fields of a given
- * stream object.
- *
- */
- typedef struct FT_StreamRec_* FT_Stream;
-
-
- /*************************************************************************
- *
- * @struct:
- * FT_StreamDesc
- *
- * @description:
- * A union type used to store either a long or a pointer. This is used
- * to store a file descriptor or a `FILE*' in an input stream.
- *
- */
- typedef union FT_StreamDesc_
- {
- long value;
- void* pointer;
-
- } FT_StreamDesc;
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Stream_IoFunc
- *
- * @description:
- * A function used to seek and read data from a given input stream.
- *
- * @input:
- * stream ::
- * A handle to the source stream.
- *
- * offset ::
- * The offset of read in stream (always from start).
- *
- * buffer ::
- * The address of the read buffer.
- *
- * count ::
- * The number of bytes to read from the stream.
- *
- * @return:
- * The number of bytes effectively read by the stream.
- *
- * @note:
- * This function might be called to perform a seek or skip operation
- * with a `count' of~0. A non-zero return value then indicates an
- * error.
- *
- */
- typedef unsigned long
- (*FT_Stream_IoFunc)( FT_Stream stream,
- unsigned long offset,
- unsigned char* buffer,
- unsigned long count );
-
-
- /*************************************************************************
- *
- * @functype:
- * FT_Stream_CloseFunc
- *
- * @description:
- * A function used to close a given input stream.
- *
- * @input:
- * stream ::
- * A handle to the target stream.
- *
- */
- typedef void
- (*FT_Stream_CloseFunc)( FT_Stream stream );
-
-
- /*************************************************************************
- *
- * @struct:
- * FT_StreamRec
- *
- * @description:
- * A structure used to describe an input stream.
- *
- * @input:
- * base ::
- * For memory-based streams, this is the address of the first stream
- * byte in memory. This field should always be set to NULL for
- * disk-based streams.
- *
- * size ::
- * The stream size in bytes.
- *
- * In case of compressed streams where the size is unknown before
- * actually doing the decompression, the value is set to 0x7FFFFFFF.
- * (Note that this size value can occur for normal streams also; it is
- * thus just a hint.)
- *
- * pos ::
- * The current position within the stream.
- *
- * descriptor ::
- * This field is a union that can hold an integer or a pointer. It is
- * used by stream implementations to store file descriptors or `FILE*'
- * pointers.
- *
- * pathname ::
- * This field is completely ignored by FreeType. However, it is often
- * useful during debugging to use it to store the stream's filename
- * (where available).
- *
- * read ::
- * The stream's input function.
- *
- * close ::
- * The stream's close function.
- *
- * memory ::
- * The memory manager to use to preload frames. This is set
- * internally by FreeType and shouldn't be touched by stream
- * implementations.
- *
- * cursor ::
- * This field is set and used internally by FreeType when parsing
- * frames.
- *
- * limit ::
- * This field is set and used internally by FreeType when parsing
- * frames.
- *
- */
- typedef struct FT_StreamRec_
- {
- unsigned char* base;
- unsigned long size;
- unsigned long pos;
-
- FT_StreamDesc descriptor;
- FT_StreamDesc pathname;
- FT_Stream_IoFunc read;
- FT_Stream_CloseFunc close;
-
- FT_Memory memory;
- unsigned char* cursor;
- unsigned char* limit;
-
- } FT_StreamRec;
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTSYSTEM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/fttrigon.h b/src/3rdparty/freetype/include/fttrigon.h
deleted file mode 100644
index 9c7b54324e..0000000000
--- a/src/3rdparty/freetype/include/fttrigon.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/***************************************************************************/
-/* */
-/* fttrigon.h */
-/* */
-/* FreeType trigonometric functions (specification). */
-/* */
-/* Copyright 2001, 2003, 2005, 2007, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTTRIGON_H__
-#define __FTTRIGON_H__
-
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @type:
- * FT_Angle
- *
- * @description:
- * This type is used to model angle values in FreeType. Note that the
- * angle is a 16.16 fixed-point value expressed in degrees.
- *
- */
- typedef FT_Fixed FT_Angle;
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_PI
- *
- * @description:
- * The angle pi expressed in @FT_Angle units.
- *
- */
-#define FT_ANGLE_PI ( 180L << 16 )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_2PI
- *
- * @description:
- * The angle 2*pi expressed in @FT_Angle units.
- *
- */
-#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_PI2
- *
- * @description:
- * The angle pi/2 expressed in @FT_Angle units.
- *
- */
-#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_ANGLE_PI4
- *
- * @description:
- * The angle pi/4 expressed in @FT_Angle units.
- *
- */
-#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Sin
- *
- * @description:
- * Return the sinus of a given angle in fixed-point format.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- * @return:
- * The sinus value.
- *
- * @note:
- * If you need both the sinus and cosinus for a given angle, use the
- * function @FT_Vector_Unit.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Sin( FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Cos
- *
- * @description:
- * Return the cosinus of a given angle in fixed-point format.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- * @return:
- * The cosinus value.
- *
- * @note:
- * If you need both the sinus and cosinus for a given angle, use the
- * function @FT_Vector_Unit.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Cos( FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Tan
- *
- * @description:
- * Return the tangent of a given angle in fixed-point format.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- * @return:
- * The tangent value.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Tan( FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Atan2
- *
- * @description:
- * Return the arc-tangent corresponding to a given vector (x,y) in
- * the 2d plane.
- *
- * @input:
- * x ::
- * The horizontal vector coordinate.
- *
- * y ::
- * The vertical vector coordinate.
- *
- * @return:
- * The arc-tangent value (i.e. angle).
- *
- */
- FT_EXPORT( FT_Angle )
- FT_Atan2( FT_Fixed x,
- FT_Fixed y );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Angle_Diff
- *
- * @description:
- * Return the difference between two angles. The result is always
- * constrained to the ]-PI..PI] interval.
- *
- * @input:
- * angle1 ::
- * First angle.
- *
- * angle2 ::
- * Second angle.
- *
- * @return:
- * Constrained value of `value2-value1'.
- *
- */
- FT_EXPORT( FT_Angle )
- FT_Angle_Diff( FT_Angle angle1,
- FT_Angle angle2 );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Unit
- *
- * @description:
- * Return the unit vector corresponding to a given angle. After the
- * call, the value of `vec.x' will be `sin(angle)', and the value of
- * `vec.y' will be `cos(angle)'.
- *
- * This function is useful to retrieve both the sinus and cosinus of a
- * given angle quickly.
- *
- * @output:
- * vec ::
- * The address of target vector.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_Unit( FT_Vector* vec,
- FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Rotate
- *
- * @description:
- * Rotate a vector by a given angle.
- *
- * @inout:
- * vec ::
- * The address of target vector.
- *
- * @input:
- * angle ::
- * The input angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_Rotate( FT_Vector* vec,
- FT_Angle angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Length
- *
- * @description:
- * Return the length of a given vector.
- *
- * @input:
- * vec ::
- * The address of target vector.
- *
- * @return:
- * The vector length, expressed in the same units that the original
- * vector coordinates.
- *
- */
- FT_EXPORT( FT_Fixed )
- FT_Vector_Length( FT_Vector* vec );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_Polarize
- *
- * @description:
- * Compute both the length and angle of a given vector.
- *
- * @input:
- * vec ::
- * The address of source vector.
- *
- * @output:
- * length ::
- * The vector length.
- *
- * angle ::
- * The vector angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_Polarize( FT_Vector* vec,
- FT_Fixed *length,
- FT_Angle *angle );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Vector_From_Polar
- *
- * @description:
- * Compute vector coordinates from a length and angle.
- *
- * @output:
- * vec ::
- * The address of source vector.
- *
- * @input:
- * length ::
- * The vector length.
- *
- * angle ::
- * The vector angle.
- *
- */
- FT_EXPORT( void )
- FT_Vector_From_Polar( FT_Vector* vec,
- FT_Fixed length,
- FT_Angle angle );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTTRIGON_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftttdrv.h b/src/3rdparty/freetype/include/ftttdrv.h
deleted file mode 100644
index 358841397c..0000000000
--- a/src/3rdparty/freetype/include/ftttdrv.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftttdrv.h */
-/* */
-/* FreeType API for controlling the TrueType driver */
-/* (specification only). */
-/* */
-/* Copyright 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTTTDRV_H__
-#define __FTTTDRV_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /**************************************************************************
- *
- * @section:
- * tt_driver
- *
- * @title:
- * The TrueType driver
- *
- * @abstract:
- * Controlling the TrueType driver module.
- *
- * @description:
- * While FreeType's TrueType driver doesn't expose API functions by
- * itself, it is possible to control its behaviour with @FT_Property_Set
- * and @FT_Property_Get. The following lists the available properties
- * together with the necessary macros and structures.
- *
- * The TrueType driver's module name is `truetype'.
- *
- */
-
-
- /**************************************************************************
- *
- * @property:
- * interpreter-version
- *
- * @description:
- * Currently, two versions are available, representing the bytecode
- * interpreter with and without subpixel hinting support,
- * respectively. The default is subpixel support if
- * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
- * support otherwise (since it isn't available then).
- *
- * If subpixel hinting is on, many TrueType bytecode instructions
- * behave differently compared to B/W or grayscale rendering. The
- * main idea is to render at a much increased horizontal resolution,
- * then sampling down the created output to subpixel precision.
- * However, many older fonts are not suited to this and must be
- * specially taken care of by applying (hardcoded) font-specific
- * tweaks.
- *
- * Details on subpixel hinting and some of the necessary tweaks can be
- * found in Greg Hitchcock's whitepaper at
- * `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
- *
- * The following example code demonstrates how to activate subpixel
- * hinting (omitting the error handling).
- *
- * {
- * FT_Library library;
- * FT_Face face;
- * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "truetype",
- * "interpreter-version",
- * &interpreter_version );
- * }
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- */
-
-
- /**************************************************************************
- *
- * @enum:
- * TT_INTERPRETER_VERSION_XXX
- *
- * @description:
- * A list of constants used for the @interpreter-version property to
- * select the hinting engine for Truetype fonts.
- *
- * The numeric value in the constant names represents the version
- * number as returned by the `GETINFO' bytecode instruction.
- *
- * @values:
- * TT_INTERPRETER_VERSION_35 ::
- * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
- * Windows~98; only grayscale and B/W rasterizing is supported.
- *
- * TT_INTERPRETER_VERSION_38 ::
- * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
- * equivalent to the hinting provided by DirectWrite ClearType (as
- * can be found, for example, in the Internet Explorer~9 running on
- * Windows~7).
- *
- * @note:
- * This property controls the behaviour of the bytecode interpreter
- * and thus how outlines get hinted. It does *not* control how glyph
- * get rasterized! In particular, it does not control subpixel color
- * filtering.
- *
- * If FreeType has not been compiled with configuration option
- * FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
- * `FT_Err_Unimplemented_Feature' error.
- *
- * Depending on the graphics framework, Microsoft uses different
- * bytecode engines. As a consequence, the version numbers returned by
- * a call to the `GETINFO[1]' bytecode instruction are more convoluted
- * than desired.
- *
- * {
- * framework Windows version result of GETINFO[1]
- * ----------------------------------------------------
- * GDI before XP 35
- * GDI XP and later 37
- * GDI+ old before Vista 37
- * GDI+ old Vista, 7 38
- * GDI+ after 7 40
- * DWrite before 8 39
- * DWrite 8 and later 40
- * }
- *
- * Since FreeType doesn't provide all capabilities of DWrite ClearType,
- * using version~38 seems justified.
- *
- */
-#define TT_INTERPRETER_VERSION_35 35
-#define TT_INTERPRETER_VERSION_38 38
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __FTTTDRV_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/fttypes.h b/src/3rdparty/freetype/include/fttypes.h
deleted file mode 100644
index 2c01e8737c..0000000000
--- a/src/3rdparty/freetype/include/fttypes.h
+++ /dev/null
@@ -1,602 +0,0 @@
-/***************************************************************************/
-/* */
-/* fttypes.h */
-/* */
-/* FreeType simple types definitions (specification only). */
-/* */
-/* Copyright 1996-2002, 2004, 2006-2009, 2012-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTTYPES_H__
-#define __FTTYPES_H__
-
-
-#include <ft2build.h>
-#include FT_CONFIG_CONFIG_H
-#include FT_SYSTEM_H
-#include FT_IMAGE_H
-
-#include <stddef.h>
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /* <Title> */
- /* Basic Data Types */
- /* */
- /* <Abstract> */
- /* The basic data types defined by the library. */
- /* */
- /* <Description> */
- /* This section contains the basic data types defined by FreeType~2, */
- /* ranging from simple scalar types to bitmap descriptors. More */
- /* font-specific structures are defined in a different section. */
- /* */
- /* <Order> */
- /* FT_Byte */
- /* FT_Bytes */
- /* FT_Char */
- /* FT_Int */
- /* FT_UInt */
- /* FT_Int16 */
- /* FT_UInt16 */
- /* FT_Int32 */
- /* FT_UInt32 */
- /* FT_Int64 */
- /* FT_UInt64 */
- /* FT_Short */
- /* FT_UShort */
- /* FT_Long */
- /* FT_ULong */
- /* FT_Bool */
- /* FT_Offset */
- /* FT_PtrDist */
- /* FT_String */
- /* FT_Tag */
- /* FT_Error */
- /* FT_Fixed */
- /* FT_Pointer */
- /* FT_Pos */
- /* FT_Vector */
- /* FT_BBox */
- /* FT_Matrix */
- /* FT_FWord */
- /* FT_UFWord */
- /* FT_F2Dot14 */
- /* FT_UnitVector */
- /* FT_F26Dot6 */
- /* FT_Data */
- /* */
- /* FT_MAKE_TAG */
- /* */
- /* FT_Generic */
- /* FT_Generic_Finalizer */
- /* */
- /* FT_Bitmap */
- /* FT_Pixel_Mode */
- /* FT_Palette_Mode */
- /* FT_Glyph_Format */
- /* FT_IMAGE_TAG */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Bool */
- /* */
- /* <Description> */
- /* A typedef of unsigned char, used for simple booleans. As usual, */
- /* values 1 and~0 represent true and false, respectively. */
- /* */
- typedef unsigned char FT_Bool;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_FWord */
- /* */
- /* <Description> */
- /* A signed 16-bit integer used to store a distance in original font */
- /* units. */
- /* */
- typedef signed short FT_FWord; /* distance in FUnits */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UFWord */
- /* */
- /* <Description> */
- /* An unsigned 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- typedef unsigned short FT_UFWord; /* unsigned distance */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Char */
- /* */
- /* <Description> */
- /* A simple typedef for the _signed_ char type. */
- /* */
- typedef signed char FT_Char;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Byte */
- /* */
- /* <Description> */
- /* A simple typedef for the _unsigned_ char type. */
- /* */
- typedef unsigned char FT_Byte;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Bytes */
- /* */
- /* <Description> */
- /* A typedef for constant memory areas. */
- /* */
- typedef const FT_Byte* FT_Bytes;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Tag */
- /* */
- /* <Description> */
- /* A typedef for 32-bit tags (as used in the SFNT format). */
- /* */
- typedef FT_UInt32 FT_Tag;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_String */
- /* */
- /* <Description> */
- /* A simple typedef for the char type, usually used for strings. */
- /* */
- typedef char FT_String;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Short */
- /* */
- /* <Description> */
- /* A typedef for signed short. */
- /* */
- typedef signed short FT_Short;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UShort */
- /* */
- /* <Description> */
- /* A typedef for unsigned short. */
- /* */
- typedef unsigned short FT_UShort;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int */
- /* */
- /* <Description> */
- /* A typedef for the int type. */
- /* */
- typedef signed int FT_Int;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt */
- /* */
- /* <Description> */
- /* A typedef for the unsigned int type. */
- /* */
- typedef unsigned int FT_UInt;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Long */
- /* */
- /* <Description> */
- /* A typedef for signed long. */
- /* */
- typedef signed long FT_Long;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ULong */
- /* */
- /* <Description> */
- /* A typedef for unsigned long. */
- /* */
- typedef unsigned long FT_ULong;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F2Dot14 */
- /* */
- /* <Description> */
- /* A signed 2.14 fixed-point type used for unit vectors. */
- /* */
- typedef signed short FT_F2Dot14;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F26Dot6 */
- /* */
- /* <Description> */
- /* A signed 26.6 fixed-point type used for vectorial pixel */
- /* coordinates. */
- /* */
- typedef signed long FT_F26Dot6;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Fixed */
- /* */
- /* <Description> */
- /* This type is used to store 16.16 fixed-point values, like scaling */
- /* values or matrix coefficients. */
- /* */
- typedef signed long FT_Fixed;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Error */
- /* */
- /* <Description> */
- /* The FreeType error code type. A value of~0 is always interpreted */
- /* as a successful operation. */
- /* */
- typedef int FT_Error;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Pointer */
- /* */
- /* <Description> */
- /* A simple typedef for a typeless pointer. */
- /* */
- typedef void* FT_Pointer;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Offset */
- /* */
- /* <Description> */
- /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
- /* _unsigned_ integer type used to express a file size or position, */
- /* or a memory block size. */
- /* */
- typedef size_t FT_Offset;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_PtrDist */
- /* */
- /* <Description> */
- /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
- /* largest _signed_ integer type used to express the distance */
- /* between two pointers. */
- /* */
- typedef ft_ptrdiff_t FT_PtrDist;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_UnitVector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2D vector unit vector. Uses */
- /* FT_F2Dot14 types. */
- /* */
- /* <Fields> */
- /* x :: Horizontal coordinate. */
- /* */
- /* y :: Vertical coordinate. */
- /* */
- typedef struct FT_UnitVector_
- {
- FT_F2Dot14 x;
- FT_F2Dot14 y;
-
- } FT_UnitVector;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Matrix */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2x2 matrix. Coefficients are */
- /* in 16.16 fixed-point format. The computation performed is: */
- /* */
- /* { */
- /* x' = x*xx + y*xy */
- /* y' = x*yx + y*yy */
- /* } */
- /* */
- /* <Fields> */
- /* xx :: Matrix coefficient. */
- /* */
- /* xy :: Matrix coefficient. */
- /* */
- /* yx :: Matrix coefficient. */
- /* */
- /* yy :: Matrix coefficient. */
- /* */
- typedef struct FT_Matrix_
- {
- FT_Fixed xx, xy;
- FT_Fixed yx, yy;
-
- } FT_Matrix;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Data */
- /* */
- /* <Description> */
- /* Read-only binary data represented as a pointer and a length. */
- /* */
- /* <Fields> */
- /* pointer :: The data. */
- /* */
- /* length :: The length of the data in bytes. */
- /* */
- typedef struct FT_Data_
- {
- const FT_Byte* pointer;
- FT_Int length;
-
- } FT_Data;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Generic_Finalizer */
- /* */
- /* <Description> */
- /* Describe a function used to destroy the `client' data of any */
- /* FreeType object. See the description of the @FT_Generic type for */
- /* details of usage. */
- /* */
- /* <Input> */
- /* The address of the FreeType object that is under finalization. */
- /* Its client data is accessed through its `generic' field. */
- /* */
- typedef void (*FT_Generic_Finalizer)(void* object);
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Generic */
- /* */
- /* <Description> */
- /* Client applications often need to associate their own data to a */
- /* variety of FreeType core objects. For example, a text layout API */
- /* might want to associate a glyph cache to a given size object. */
- /* */
- /* Some FreeType object contains a `generic' field, of type */
- /* FT_Generic, which usage is left to client applications and font */
- /* servers. */
- /* */
- /* It can be used to store a pointer to client-specific data, as well */
- /* as the address of a `finalizer' function, which will be called by */
- /* FreeType when the object is destroyed (for example, the previous */
- /* client example would put the address of the glyph cache destructor */
- /* in the `finalizer' field). */
- /* */
- /* <Fields> */
- /* data :: A typeless pointer to any client-specified data. This */
- /* field is completely ignored by the FreeType library. */
- /* */
- /* finalizer :: A pointer to a `generic finalizer' function, which */
- /* will be called when the object is destroyed. If this */
- /* field is set to NULL, no code will be called. */
- /* */
- typedef struct FT_Generic_
- {
- void* data;
- FT_Generic_Finalizer finalizer;
-
- } FT_Generic;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_MAKE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags that are used to label */
- /* TrueType tables into an unsigned long, to be used within FreeType. */
- /* */
- /* <Note> */
- /* The produced values *must* be 32-bit integers. Don't redefine */
- /* this macro. */
- /* */
-#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
- (FT_Tag) \
- ( ( (FT_ULong)_x1 << 24 ) | \
- ( (FT_ULong)_x2 << 16 ) | \
- ( (FT_ULong)_x3 << 8 ) | \
- (FT_ULong)_x4 )
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* L I S T M A N A G E M E N T */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* list_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ListNode */
- /* */
- /* <Description> */
- /* Many elements and objects in FreeType are listed through an */
- /* @FT_List record (see @FT_ListRec). As its name suggests, an */
- /* FT_ListNode is a handle to a single list element. */
- /* */
- typedef struct FT_ListNodeRec_* FT_ListNode;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_List */
- /* */
- /* <Description> */
- /* A handle to a list record (see @FT_ListRec). */
- /* */
- typedef struct FT_ListRec_* FT_List;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListNodeRec */
- /* */
- /* <Description> */
- /* A structure used to hold a single list element. */
- /* */
- /* <Fields> */
- /* prev :: The previous element in the list. NULL if first. */
- /* */
- /* next :: The next element in the list. NULL if last. */
- /* */
- /* data :: A typeless pointer to the listed object. */
- /* */
- typedef struct FT_ListNodeRec_
- {
- FT_ListNode prev;
- FT_ListNode next;
- void* data;
-
- } FT_ListNodeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListRec */
- /* */
- /* <Description> */
- /* A structure used to hold a simple doubly-linked list. These are */
- /* used in many parts of FreeType. */
- /* */
- /* <Fields> */
- /* head :: The head (first element) of doubly-linked list. */
- /* */
- /* tail :: The tail (last element) of doubly-linked list. */
- /* */
- typedef struct FT_ListRec_
- {
- FT_ListNode head;
- FT_ListNode tail;
-
- } FT_ListRec;
-
- /* */
-
-
-#define FT_IS_EMPTY( list ) ( (list).head == 0 )
-#define FT_BOOL( x ) ( (FT_Bool)( x ) )
-
- /* concatenate C tokens */
-#define FT_ERR_XCAT( x, y ) x ## y
-#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
-
- /* see `ftmoderr.h' for descriptions of the following macros */
-
-#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
-
-#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
-#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
-
-#define FT_ERR_EQ( x, e ) \
- ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )
-#define FT_ERR_NEQ( x, e ) \
- ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )
-
-
-FT_END_HEADER
-
-#endif /* __FTTYPES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ftwinfnt.h b/src/3rdparty/freetype/include/ftwinfnt.h
deleted file mode 100644
index 50261581a2..0000000000
--- a/src/3rdparty/freetype/include/ftwinfnt.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftwinfnt.h */
-/* */
-/* FreeType API for accessing Windows fnt-specific data. */
-/* */
-/* Copyright 2003, 2004, 2008 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTWINFNT_H__
-#define __FTWINFNT_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* winfnt_fonts */
- /* */
- /* <Title> */
- /* Window FNT Files */
- /* */
- /* <Abstract> */
- /* Windows FNT specific API. */
- /* */
- /* <Description> */
- /* This section contains the declaration of Windows FNT specific */
- /* functions. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @enum:
- * FT_WinFNT_ID_XXX
- *
- * @description:
- * A list of valid values for the `charset' byte in
- * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
- * encodings (except for cp1361) can be found at
- * ftp://ftp.unicode.org/public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
- * subdirectory. cp1361 is roughly a superset of
- * MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
- *
- * @values:
- * FT_WinFNT_ID_DEFAULT ::
- * This is used for font enumeration and font creation as a
- * `don't care' value. Valid font files don't contain this value.
- * When querying for information about the character set of the font
- * that is currently selected into a specified device context, this
- * return value (of the related Windows API) simply denotes failure.
- *
- * FT_WinFNT_ID_SYMBOL ::
- * There is no known mapping table available.
- *
- * FT_WinFNT_ID_MAC ::
- * Mac Roman encoding.
- *
- * FT_WinFNT_ID_OEM ::
- * From Michael Pöttgen <michael@poettgen.de>:
- *
- * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
- * is used for the charset of vector fonts, like `modern.fon',
- * `roman.fon', and `script.fon' on Windows.
- *
- * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
- * specifies a character set that is operating-system dependent.
- *
- * The `IFIMETRICS' documentation from the `Windows Driver
- * Development Kit' says: This font supports an OEM-specific
- * character set. The OEM character set is system dependent.
- *
- * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
- * second default codepage that most international versions of
- * Windows have. It is one of the OEM codepages from
- *
- * http://www.microsoft.com/globaldev/reference/cphome.mspx,
- *
- * and is used for the `DOS boxes', to support legacy applications.
- * A German Windows version for example usually uses ANSI codepage
- * 1252 and OEM codepage 850.
- *
- * FT_WinFNT_ID_CP874 ::
- * A superset of Thai TIS 620 and ISO 8859-11.
- *
- * FT_WinFNT_ID_CP932 ::
- * A superset of Japanese Shift-JIS (with minor deviations).
- *
- * FT_WinFNT_ID_CP936 ::
- * A superset of simplified Chinese GB 2312-1980 (with different
- * ordering and minor deviations).
- *
- * FT_WinFNT_ID_CP949 ::
- * A superset of Korean Hangul KS~C 5601-1987 (with different
- * ordering and minor deviations).
- *
- * FT_WinFNT_ID_CP950 ::
- * A superset of traditional Chinese Big~5 ETen (with different
- * ordering and minor deviations).
- *
- * FT_WinFNT_ID_CP1250 ::
- * A superset of East European ISO 8859-2 (with slightly different
- * ordering).
- *
- * FT_WinFNT_ID_CP1251 ::
- * A superset of Russian ISO 8859-5 (with different ordering).
- *
- * FT_WinFNT_ID_CP1252 ::
- * ANSI encoding. A superset of ISO 8859-1.
- *
- * FT_WinFNT_ID_CP1253 ::
- * A superset of Greek ISO 8859-7 (with minor modifications).
- *
- * FT_WinFNT_ID_CP1254 ::
- * A superset of Turkish ISO 8859-9.
- *
- * FT_WinFNT_ID_CP1255 ::
- * A superset of Hebrew ISO 8859-8 (with some modifications).
- *
- * FT_WinFNT_ID_CP1256 ::
- * A superset of Arabic ISO 8859-6 (with different ordering).
- *
- * FT_WinFNT_ID_CP1257 ::
- * A superset of Baltic ISO 8859-13 (with some deviations).
- *
- * FT_WinFNT_ID_CP1258 ::
- * For Vietnamese. This encoding doesn't cover all necessary
- * characters.
- *
- * FT_WinFNT_ID_CP1361 ::
- * Korean (Johab).
- */
-
-#define FT_WinFNT_ID_CP1252 0
-#define FT_WinFNT_ID_DEFAULT 1
-#define FT_WinFNT_ID_SYMBOL 2
-#define FT_WinFNT_ID_MAC 77
-#define FT_WinFNT_ID_CP932 128
-#define FT_WinFNT_ID_CP949 129
-#define FT_WinFNT_ID_CP1361 130
-#define FT_WinFNT_ID_CP936 134
-#define FT_WinFNT_ID_CP950 136
-#define FT_WinFNT_ID_CP1253 161
-#define FT_WinFNT_ID_CP1254 162
-#define FT_WinFNT_ID_CP1258 163
-#define FT_WinFNT_ID_CP1255 177
-#define FT_WinFNT_ID_CP1256 178
-#define FT_WinFNT_ID_CP1257 186
-#define FT_WinFNT_ID_CP1251 204
-#define FT_WinFNT_ID_CP874 222
-#define FT_WinFNT_ID_CP1250 238
-#define FT_WinFNT_ID_OEM 255
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_WinFNT_HeaderRec */
- /* */
- /* <Description> */
- /* Windows FNT Header info. */
- /* */
- typedef struct FT_WinFNT_HeaderRec_
- {
- FT_UShort version;
- FT_ULong file_size;
- FT_Byte copyright[60];
- FT_UShort file_type;
- FT_UShort nominal_point_size;
- FT_UShort vertical_resolution;
- FT_UShort horizontal_resolution;
- FT_UShort ascent;
- FT_UShort internal_leading;
- FT_UShort external_leading;
- FT_Byte italic;
- FT_Byte underline;
- FT_Byte strike_out;
- FT_UShort weight;
- FT_Byte charset;
- FT_UShort pixel_width;
- FT_UShort pixel_height;
- FT_Byte pitch_and_family;
- FT_UShort avg_width;
- FT_UShort max_width;
- FT_Byte first_char;
- FT_Byte last_char;
- FT_Byte default_char;
- FT_Byte break_char;
- FT_UShort bytes_per_row;
- FT_ULong device_offset;
- FT_ULong face_name_offset;
- FT_ULong bits_pointer;
- FT_ULong bits_offset;
- FT_Byte reserved;
- FT_ULong flags;
- FT_UShort A_space;
- FT_UShort B_space;
- FT_UShort C_space;
- FT_UShort color_table_offset;
- FT_ULong reserved1[4];
-
- } FT_WinFNT_HeaderRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_WinFNT_Header */
- /* */
- /* <Description> */
- /* A handle to an @FT_WinFNT_HeaderRec structure. */
- /* */
- typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
-
-
- /**********************************************************************
- *
- * @function:
- * FT_Get_WinFNT_Header
- *
- * @description:
- * Retrieve a Windows FNT font info header.
- *
- * @input:
- * face :: A handle to the input face.
- *
- * @output:
- * aheader :: The WinFNT header.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * This function only works with Windows FNT faces, returning an error
- * otherwise.
- */
- FT_EXPORT( FT_Error )
- FT_Get_WinFNT_Header( FT_Face face,
- FT_WinFNT_HeaderRec *aheader );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTWINFNT_H__ */
-
-
-/* END */
-
-
-/* Local Variables: */
-/* coding: utf-8 */
-/* End: */
diff --git a/src/3rdparty/freetype/include/ftxf86.h b/src/3rdparty/freetype/include/ftxf86.h
deleted file mode 100644
index 89d1993e1e..0000000000
--- a/src/3rdparty/freetype/include/ftxf86.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftxf86.h */
-/* */
-/* Support functions for X11. */
-/* */
-/* Copyright 2002-2004, 2006, 2007, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTXF86_H__
-#define __FTXF86_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* font_formats */
- /* */
- /* <Title> */
- /* Font Formats */
- /* */
- /* <Abstract> */
- /* Getting the font format. */
- /* */
- /* <Description> */
- /* The single function in this section can be used to get the font */
- /* format. Note that this information is not needed normally; */
- /* however, there are special cases (like in PDF devices) where it is */
- /* important to differentiate, in spite of FreeType's uniform API. */
- /* */
- /* This function is in the X11/xf86 namespace for historical reasons */
- /* and in no way depends on that windowing system. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_X11_Font_Format */
- /* */
- /* <Description> */
- /* Return a string describing the format of a given face, using values */
- /* that can be used as an X11 FONT_PROPERTY. Possible values are */
- /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
- /* `PFR', and `Windows~FNT'. */
- /* */
- /* <Input> */
- /* face :: */
- /* Input face handle. */
- /* */
- /* <Return> */
- /* Font format string. NULL in case of error. */
- /* */
- FT_EXPORT( const char* )
- FT_Get_X11_Font_Format( FT_Face face );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTXF86_H__ */
diff --git a/src/3rdparty/freetype/include/internal/autohint.h b/src/3rdparty/freetype/include/internal/autohint.h
deleted file mode 100644
index 545de938c2..0000000000
--- a/src/3rdparty/freetype/include/internal/autohint.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/***************************************************************************/
-/* */
-/* autohint.h */
-/* */
-/* High-level `autohint' module-specific interface (specification). */
-/* */
-/* Copyright 1996-2002, 2007, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* The auto-hinter is used to load and automatically hint glyphs if a */
- /* format-specific hinter isn't available. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __AUTOHINT_H__
-#define __AUTOHINT_H__
-
-
- /*************************************************************************/
- /* */
- /* A small technical note regarding automatic hinting in order to */
- /* clarify this module interface. */
- /* */
- /* An automatic hinter might compute two kinds of data for a given face: */
- /* */
- /* - global hints: Usually some metrics that describe global properties */
- /* of the face. It is computed by scanning more or less */
- /* aggressively the glyphs in the face, and thus can be */
- /* very slow to compute (even if the size of global */
- /* hints is really small). */
- /* */
- /* - glyph hints: These describe some important features of the glyph */
- /* outline, as well as how to align them. They are */
- /* generally much faster to compute than global hints. */
- /* */
- /* The current FreeType auto-hinter does a pretty good job while */
- /* performing fast computations for both global and glyph hints. */
- /* However, we might be interested in introducing more complex and */
- /* powerful algorithms in the future, like the one described in the John */
- /* D. Hobby paper, which unfortunately requires a lot more horsepower. */
- /* */
- /* Because a sufficiently sophisticated font management system would */
- /* typically implement an LRU cache of opened face objects to reduce */
- /* memory usage, it is a good idea to be able to avoid recomputing */
- /* global hints every time the same face is re-opened. */
- /* */
- /* We thus provide the ability to cache global hints outside of the face */
- /* object, in order to speed up font re-opening time. Of course, this */
- /* feature is purely optional, so most client programs won't even notice */
- /* it. */
- /* */
- /* I initially thought that it would be a good idea to cache the glyph */
- /* hints too. However, my general idea now is that if you really need */
- /* to cache these too, you are simply in need of a new font format, */
- /* where all this information could be stored within the font file and */
- /* decoded on the fly. */
- /* */
- /*************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
- typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_AutoHinter_GlobalGetFunc */
- /* */
- /* <Description> */
- /* Retrieve the global hints computed for a given face object. The */
- /* resulting data is dissociated from the face and will survive a */
- /* call to FT_Done_Face(). It must be discarded through the API */
- /* FT_AutoHinter_GlobalDoneFunc(). */
- /* */
- /* <Input> */
- /* hinter :: A handle to the source auto-hinter. */
- /* */
- /* face :: A handle to the source face object. */
- /* */
- /* <Output> */
- /* global_hints :: A typeless pointer to the global hints. */
- /* */
- /* global_len :: The size in bytes of the global hints. */
- /* */
- typedef void
- (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
- FT_Face face,
- void** global_hints,
- long* global_len );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_AutoHinter_GlobalDoneFunc */
- /* */
- /* <Description> */
- /* Discard the global hints retrieved through */
- /* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */
- /* are freed from memory. */
- /* */
- /* <Input> */
- /* hinter :: A handle to the auto-hinter module. */
- /* */
- /* global :: A pointer to retrieved global hints to discard. */
- /* */
- typedef void
- (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
- void* global );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_AutoHinter_GlobalResetFunc */
- /* */
- /* <Description> */
- /* This function is used to recompute the global metrics in a given */
- /* font. This is useful when global font data changes (e.g. Multiple */
- /* Masters fonts where blend coordinates change). */
- /* */
- /* <Input> */
- /* hinter :: A handle to the source auto-hinter. */
- /* */
- /* face :: A handle to the face. */
- /* */
- typedef void
- (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
- FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_AutoHinter_GlyphLoadFunc */
- /* */
- /* <Description> */
- /* This function is used to load, scale, and automatically hint a */
- /* glyph from a given face. */
- /* */
- /* <Input> */
- /* face :: A handle to the face. */
- /* */
- /* glyph_index :: The glyph index. */
- /* */
- /* load_flags :: The load flags. */
- /* */
- /* <Note> */
- /* This function is capable of loading composite glyphs by hinting */
- /* each sub-glyph independently (which improves quality). */
- /* */
- /* It will call the font driver with @FT_Load_Glyph, with */
- /* @FT_LOAD_NO_SCALE set. */
- /* */
- typedef FT_Error
- (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
- FT_GlyphSlot slot,
- FT_Size size,
- FT_UInt glyph_index,
- FT_Int32 load_flags );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_AutoHinter_InterfaceRec */
- /* */
- /* <Description> */
- /* The auto-hinter module's interface. */
- /* */
- typedef struct FT_AutoHinter_InterfaceRec_
- {
- FT_AutoHinter_GlobalResetFunc reset_face;
- FT_AutoHinter_GlobalGetFunc get_global_hints;
- FT_AutoHinter_GlobalDoneFunc done_global_hints;
- FT_AutoHinter_GlyphLoadFunc load_glyph;
-
- } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_AUTOHINTER_INTERFACE( \
- class_, \
- reset_face_, \
- get_global_hints_, \
- done_global_hints_, \
- load_glyph_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_AutoHinter_InterfaceRec class_ = \
- { \
- reset_face_, \
- get_global_hints_, \
- done_global_hints_, \
- load_glyph_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_AUTOHINTER_INTERFACE( \
- class_, \
- reset_face_, \
- get_global_hints_, \
- done_global_hints_, \
- load_glyph_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_AutoHinter_InterfaceRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->reset_face = reset_face_; \
- clazz->get_global_hints = get_global_hints_; \
- clazz->done_global_hints = done_global_hints_; \
- clazz->load_glyph = load_glyph_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-FT_END_HEADER
-
-#endif /* __AUTOHINT_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftcalc.h b/src/3rdparty/freetype/include/internal/ftcalc.h
deleted file mode 100644
index 14ec37b9cd..0000000000
--- a/src/3rdparty/freetype/include/internal/ftcalc.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftcalc.h */
-/* */
-/* Arithmetic computations (specification). */
-/* */
-/* Copyright 1996-2006, 2008, 2009, 2012-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTCALC_H__
-#define __FTCALC_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
- /* */
- /*************************************************************************/
-
-#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
- /* Provide assembler fragments for performance-critical functions. */
- /* These must be defined `static __inline__' with GCC. */
-
-#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
-
-#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
-
- /* documentation is in freetype.h */
-
- static __inline FT_Int32
- FT_MulFix_arm( FT_Int32 a,
- FT_Int32 b )
- {
- register FT_Int32 t, t2;
-
-
- __asm
- {
- smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
- mov a, t, asr #31 /* a = (hi >> 31) */
- add a, a, #0x8000 /* a += 0x8000 */
- adds t2, t2, a /* t2 += a */
- adc t, t, #0 /* t += carry */
- mov a, t2, lsr #16 /* a = t2 >> 16 */
- orr a, a, t, lsl #16 /* a |= t << 16 */
- }
- return a;
- }
-
-#endif /* __CC_ARM || __ARMCC__ */
-
-
-#ifdef __GNUC__
-
-#if defined( __arm__ ) && \
- ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
- !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
-
-#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
-
- /* documentation is in freetype.h */
-
- static __inline__ FT_Int32
- FT_MulFix_arm( FT_Int32 a,
- FT_Int32 b )
- {
- register FT_Int32 t, t2;
-
-
- __asm__ __volatile__ (
- "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
- "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
-#if defined( __clang__ ) && defined( __thumb2__ )
- "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
-#else
- "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
-#endif
- "adds %1, %1, %0\n\t" /* %1 += %0 */
- "adc %2, %2, #0\n\t" /* %2 += carry */
- "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
- "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
- : "=r"(a), "=&r"(t2), "=&r"(t)
- : "r"(a), "r"(b)
- : "cc" );
- return a;
- }
-
-#endif /* __arm__ && */
- /* ( __thumb2__ || !__thumb__ ) && */
- /* !( __CC_ARM || __ARMCC__ ) */
-
-
-#if defined( __i386__ )
-
-#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
-
- /* documentation is in freetype.h */
-
- static __inline__ FT_Int32
- FT_MulFix_i386( FT_Int32 a,
- FT_Int32 b )
- {
- register FT_Int32 result;
-
-
- __asm__ __volatile__ (
- "imul %%edx\n"
- "movl %%edx, %%ecx\n"
- "sarl $31, %%ecx\n"
- "addl $0x8000, %%ecx\n"
- "addl %%ecx, %%eax\n"
- "adcl $0, %%edx\n"
- "shrl $16, %%eax\n"
- "shll $16, %%edx\n"
- "addl %%edx, %%eax\n"
- : "=a"(result), "=d"(b)
- : "a"(a), "d"(b)
- : "%ecx", "cc" );
- return result;
- }
-
-#endif /* i386 */
-
-#endif /* __GNUC__ */
-
-
-#ifdef _MSC_VER /* Visual C++ */
-
-#ifdef _M_IX86
-
-#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
-
- /* documentation is in freetype.h */
-
- static __inline FT_Int32
- FT_MulFix_i386( FT_Int32 a,
- FT_Int32 b )
- {
- register FT_Int32 result;
-
- __asm
- {
- mov eax, a
- mov edx, b
- imul edx
- mov ecx, edx
- sar ecx, 31
- add ecx, 8000h
- add eax, ecx
- adc edx, 0
- shr eax, 16
- shl edx, 16
- add eax, edx
- mov result, eax
- }
- return result;
- }
-
-#endif /* _M_IX86 */
-
-#endif /* _MSC_VER */
-
-
-#if defined( __GNUC__ ) && defined( __x86_64__ )
-
-#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64
-
- static __inline__ FT_Int32
- FT_MulFix_x86_64( FT_Int32 a,
- FT_Int32 b )
- {
- /* Temporarily disable the warning that C90 doesn't support */
- /* `long long'. */
-#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wlong-long"
-#endif
-
-#if 1
- /* Technically not an assembly fragment, but GCC does a really good */
- /* job at inlining it and generating good machine code for it. */
- long long ret, tmp;
-
-
- ret = (long long)a * b;
- tmp = ret >> 63;
- ret += 0x8000 + tmp;
-
- return (FT_Int32)( ret >> 16 );
-#else
-
- /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */
- /* code from the lines below. The main issue is that `wide_a' is not */
- /* properly initialized by sign-extending `a'. Instead, the generated */
- /* machine code assumes that the register that contains `a' on input */
- /* can be used directly as a 64-bit value, which is wrong most of the */
- /* time. */
- long long wide_a = (long long)a;
- long long wide_b = (long long)b;
- long long result;
-
-
- __asm__ __volatile__ (
- "imul %2, %1\n"
- "mov %1, %0\n"
- "sar $63, %0\n"
- "lea 0x8000(%1, %0), %0\n"
- "sar $16, %0\n"
- : "=&r"(result), "=&r"(wide_a)
- : "r"(wide_b)
- : "cc" );
-
- return (FT_Int32)result;
-#endif
-
-#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
-#pragma GCC diagnostic pop
-#endif
- }
-
-#endif /* __GNUC__ && __x86_64__ */
-
-#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
-
-
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
-#ifdef FT_MULFIX_ASSEMBLER
-#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
-#endif
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv_No_Round */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* (without rounding) with maximum accuracy (it uses a 64-bit */
- /* intermediate integer whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
- FT_BASE( FT_Long )
- FT_MulDiv_No_Round( FT_Long a,
- FT_Long b,
- FT_Long c );
-
-
- /*
- * A variant of FT_Matrix_Multiply which scales its result afterwards.
- * The idea is that both `a' and `b' are scaled by factors of 10 so that
- * the values are as precise as possible to get a correct result during
- * the 64bit multiplication. Let `sa' and `sb' be the scaling factors of
- * `a' and `b', respectively, then the scaling factor of the result is
- * `sa*sb'.
- */
- FT_BASE( void )
- FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
- FT_Matrix *b,
- FT_Long scaling );
-
-
- /*
- * A variant of FT_Vector_Transform. See comments for
- * FT_Matrix_Multiply_Scaled.
- */
- FT_BASE( void )
- FT_Vector_Transform_Scaled( FT_Vector* vector,
- const FT_Matrix* matrix,
- FT_Long scaling );
-
-
- /*
- * Return -1, 0, or +1, depending on the orientation of a given corner.
- * We use the Cartesian coordinate system, with positive vertical values
- * going upwards. The function returns +1 if the corner turns to the
- * left, -1 to the right, and 0 for undecidable cases.
- */
- FT_BASE( FT_Int )
- ft_corner_orientation( FT_Pos in_x,
- FT_Pos in_y,
- FT_Pos out_x,
- FT_Pos out_y );
-
-
- /*
- * Return TRUE if a corner is flat or nearly flat. This is equivalent to
- * saying that the corner point is close to its neighbors, or inside an
- * ellipse defined by the neighbor focal points to be more precise.
- */
- FT_BASE( FT_Int )
- ft_corner_is_flat( FT_Pos in_x,
- FT_Pos in_y,
- FT_Pos out_x,
- FT_Pos out_y );
-
-
- /*
- * Return the most significant bit index.
- */
-
-#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
-#if defined( __GNUC__ ) && \
- ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
-
-#if FT_SIZEOF_INT == 4
-
-#define FT_MSB( x ) ( 31 - __builtin_clz( x ) )
-
-#elif FT_SIZEOF_LONG == 4
-
-#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
-
-#endif
-
-#endif /* __GNUC__ */
-#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
-
-#ifndef FT_MSB
-
- FT_BASE( FT_Int )
- FT_MSB( FT_UInt32 z );
-
-#endif
-
-
- /*
- * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
- * two fixed-point arguments instead.
- */
- FT_BASE( FT_Fixed )
- FT_Hypot( FT_Fixed x,
- FT_Fixed y );
-
-
-#if 0
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_SqrtFixed */
- /* */
- /* <Description> */
- /* Computes the square root of a 16.16 fixed-point value. */
- /* */
- /* <Input> */
- /* x :: The value to compute the root for. */
- /* */
- /* <Return> */
- /* The result of `sqrt(x)'. */
- /* */
- /* <Note> */
- /* This function is not very fast. */
- /* */
- FT_BASE( FT_Int32 )
- FT_SqrtFixed( FT_Int32 x );
-
-#endif /* 0 */
-
-
-#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
-#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
-#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
-#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
-#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
-#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
-
-#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
- : ( -( ( 32 - (x) ) & -64 ) ) )
-
-
-FT_END_HEADER
-
-#endif /* __FTCALC_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftdebug.h b/src/3rdparty/freetype/include/internal/ftdebug.h
deleted file mode 100644
index 58a3916d7e..0000000000
--- a/src/3rdparty/freetype/include/internal/ftdebug.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftdebug.h */
-/* */
-/* Debugging and logging component (specification). */
-/* */
-/* Copyright 1996-2002, 2004, 2006-2009, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/* */
-/* IMPORTANT: A description of FreeType's debugging support can be */
-/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
-/* understand this code. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTDEBUG_H__
-#define __FTDEBUG_H__
-
-
-#include <ft2build.h>
-#include FT_CONFIG_CONFIG_H
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
- /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
- /* is already defined; this simplifies the following #ifdefs */
- /* */
-#ifdef FT_DEBUG_LEVEL_TRACE
-#undef FT_DEBUG_LEVEL_ERROR
-#define FT_DEBUG_LEVEL_ERROR
-#endif
-
-
- /*************************************************************************/
- /* */
- /* Define the trace enums as well as the trace levels array when they */
- /* are needed. */
- /* */
- /*************************************************************************/
-
-#ifdef FT_DEBUG_LEVEL_TRACE
-
-#define FT_TRACE_DEF( x ) trace_ ## x ,
-
- /* defining the enumeration */
- typedef enum FT_Trace_
- {
-#include FT_INTERNAL_TRACE_H
- trace_count
-
- } FT_Trace;
-
-
- /* defining the array of trace levels, provided by `src/base/ftdebug.c' */
- extern int ft_trace_levels[trace_count];
-
-#undef FT_TRACE_DEF
-
-#endif /* FT_DEBUG_LEVEL_TRACE */
-
-
- /*************************************************************************/
- /* */
- /* Define the FT_TRACE macro */
- /* */
- /* IMPORTANT! */
- /* */
- /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
- /* value before using any TRACE macro. */
- /* */
- /*************************************************************************/
-
-#ifdef FT_DEBUG_LEVEL_TRACE
-
-#define FT_TRACE( level, varformat ) \
- do \
- { \
- if ( ft_trace_levels[FT_COMPONENT] >= level ) \
- FT_Message varformat; \
- } while ( 0 )
-
-#else /* !FT_DEBUG_LEVEL_TRACE */
-
-#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
-
-#endif /* !FT_DEBUG_LEVEL_TRACE */
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Trace_Get_Count */
- /* */
- /* <Description> */
- /* Return the number of available trace components. */
- /* */
- /* <Return> */
- /* The number of trace components. 0 if FreeType 2 is not built with */
- /* FT_DEBUG_LEVEL_TRACE definition. */
- /* */
- /* <Note> */
- /* This function may be useful if you want to access elements of */
- /* the internal `ft_trace_levels' array by an index. */
- /* */
- FT_BASE( FT_Int )
- FT_Trace_Get_Count( void );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Trace_Get_Name */
- /* */
- /* <Description> */
- /* Return the name of a trace component. */
- /* */
- /* <Input> */
- /* The index of the trace component. */
- /* */
- /* <Return> */
- /* The name of the trace component. This is a statically allocated */
- /* C string, so do not free it after use. NULL if FreeType 2 is not */
- /* built with FT_DEBUG_LEVEL_TRACE definition. */
- /* */
- /* <Note> */
- /* Use @FT_Trace_Get_Count to get the number of available trace */
- /* components. */
- /* */
- /* This function may be useful if you want to control FreeType 2's */
- /* debug level in your application. */
- /* */
- FT_BASE( const char * )
- FT_Trace_Get_Name( FT_Int idx );
-
-
- /*************************************************************************/
- /* */
- /* You need two opening and closing parentheses! */
- /* */
- /* Example: FT_TRACE0(( "Value is %i", foo )) */
- /* */
- /* Output of the FT_TRACEX macros is sent to stderr. */
- /* */
- /*************************************************************************/
-
-#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
-#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
-#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
-#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
-#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
-#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
-#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
-#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
-
-
- /*************************************************************************/
- /* */
- /* Define the FT_ERROR macro. */
- /* */
- /* Output of this macro is sent to stderr. */
- /* */
- /*************************************************************************/
-
-#ifdef FT_DEBUG_LEVEL_ERROR
-
-#define FT_ERROR( varformat ) FT_Message varformat
-
-#else /* !FT_DEBUG_LEVEL_ERROR */
-
-#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
-
-#endif /* !FT_DEBUG_LEVEL_ERROR */
-
-
- /*************************************************************************/
- /* */
- /* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw' */
- /* makes it possible to easily set a breakpoint at this function. */
- /* */
- /*************************************************************************/
-
-#ifdef FT_DEBUG_LEVEL_ERROR
-
-#define FT_ASSERT( condition ) \
- do \
- { \
- if ( !( condition ) ) \
- FT_Panic( "assertion failed on line %d of file %s\n", \
- __LINE__, __FILE__ ); \
- } while ( 0 )
-
-#define FT_THROW( e ) \
- ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ), \
- __LINE__, \
- __FILE__ ) | \
- FT_ERR_CAT( FT_ERR_PREFIX, e ) )
-
-#else /* !FT_DEBUG_LEVEL_ERROR */
-
-#define FT_ASSERT( condition ) do { } while ( 0 )
-
-#define FT_THROW( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
-
-#endif /* !FT_DEBUG_LEVEL_ERROR */
-
-
- /*************************************************************************/
- /* */
- /* Define `FT_Message' and `FT_Panic' when needed. */
- /* */
- /*************************************************************************/
-
-#ifdef FT_DEBUG_LEVEL_ERROR
-
-#include "stdio.h" /* for vfprintf() */
-
- /* print a message */
- FT_BASE( void )
- FT_Message( const char* fmt,
- ... );
-
- /* print a message and exit */
- FT_BASE( void )
- FT_Panic( const char* fmt,
- ... );
-
- /* report file name and line number of an error */
- FT_BASE( int )
- FT_Throw( FT_Error error,
- int line,
- const char* file );
-
-#endif /* FT_DEBUG_LEVEL_ERROR */
-
-
- FT_BASE( void )
- ft_debug_init( void );
-
-FT_END_HEADER
-
-#endif /* __FTDEBUG_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftdriver.h b/src/3rdparty/freetype/include/internal/ftdriver.h
deleted file mode 100644
index 940218e62d..0000000000
--- a/src/3rdparty/freetype/include/internal/ftdriver.h
+++ /dev/null
@@ -1,409 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftdriver.h */
-/* */
-/* FreeType font driver interface (specification). */
-/* */
-/* Copyright 1996-2003, 2006, 2008, 2011-2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTDRIVER_H__
-#define __FTDRIVER_H__
-
-
-#include <ft2build.h>
-#include FT_MODULE_H
-
-
-FT_BEGIN_HEADER
-
-
- typedef FT_Error
- (*FT_Face_InitFunc)( FT_Stream stream,
- FT_Face face,
- FT_Int typeface_index,
- FT_Int num_params,
- FT_Parameter* parameters );
-
- typedef void
- (*FT_Face_DoneFunc)( FT_Face face );
-
-
- typedef FT_Error
- (*FT_Size_InitFunc)( FT_Size size );
-
- typedef void
- (*FT_Size_DoneFunc)( FT_Size size );
-
-
- typedef FT_Error
- (*FT_Slot_InitFunc)( FT_GlyphSlot slot );
-
- typedef void
- (*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
-
-
- typedef FT_Error
- (*FT_Size_RequestFunc)( FT_Size size,
- FT_Size_Request req );
-
- typedef FT_Error
- (*FT_Size_SelectFunc)( FT_Size size,
- FT_ULong size_index );
-
- typedef FT_Error
- (*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
- FT_Size size,
- FT_UInt glyph_index,
- FT_Int32 load_flags );
-
-
- typedef FT_UInt
- (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
- FT_Long charcode );
-
- typedef FT_Long
- (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
- FT_Long charcode );
-
-
- typedef FT_Error
- (*FT_Face_GetKerningFunc)( FT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph,
- FT_Vector* kerning );
-
-
- typedef FT_Error
- (*FT_Face_AttachFunc)( FT_Face face,
- FT_Stream stream );
-
-
- typedef FT_Error
- (*FT_Face_GetAdvancesFunc)( FT_Face face,
- FT_UInt first,
- FT_UInt count,
- FT_Int32 flags,
- FT_Fixed* advances );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Driver_ClassRec */
- /* */
- /* <Description> */
- /* The font driver class. This structure mostly contains pointers to */
- /* driver methods. */
- /* */
- /* <Fields> */
- /* root :: The parent module. */
- /* */
- /* face_object_size :: The size of a face object in bytes. */
- /* */
- /* size_object_size :: The size of a size object in bytes. */
- /* */
- /* slot_object_size :: The size of a glyph object in bytes. */
- /* */
- /* init_face :: The format-specific face constructor. */
- /* */
- /* done_face :: The format-specific face destructor. */
- /* */
- /* init_size :: The format-specific size constructor. */
- /* */
- /* done_size :: The format-specific size destructor. */
- /* */
- /* init_slot :: The format-specific slot constructor. */
- /* */
- /* done_slot :: The format-specific slot destructor. */
- /* */
- /* */
- /* load_glyph :: A function handle to load a glyph to a slot. */
- /* This field is mandatory! */
- /* */
- /* get_kerning :: A function handle to return the unscaled */
- /* kerning for a given pair of glyphs. Can be */
- /* set to 0 if the format doesn't support */
- /* kerning. */
- /* */
- /* attach_file :: This function handle is used to read */
- /* additional data for a face from another */
- /* file/stream. For example, this can be used to */
- /* add data from AFM or PFM files on a Type 1 */
- /* face, or a CIDMap on a CID-keyed face. */
- /* */
- /* get_advances :: A function handle used to return advance */
- /* widths of `count' glyphs (in font units), */
- /* starting at `first'. The `vertical' flag must */
- /* be set to get vertical advance heights. The */
- /* `advances' buffer is caller-allocated. */
- /* The idea of this function is to be able to */
- /* perform device-independent text layout without */
- /* loading a single glyph image. */
- /* */
- /* request_size :: A handle to a function used to request the new */
- /* character size. Can be set to 0 if the */
- /* scaling done in the base layer suffices. */
- /* */
- /* select_size :: A handle to a function used to select a new */
- /* fixed size. It is used only if */
- /* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
- /* to 0 if the scaling done in the base layer */
- /* suffices. */
- /* <Note> */
- /* Most function pointers, with the exception of `load_glyph', can be */
- /* set to 0 to indicate a default behaviour. */
- /* */
- typedef struct FT_Driver_ClassRec_
- {
- FT_Module_Class root;
-
- FT_Long face_object_size;
- FT_Long size_object_size;
- FT_Long slot_object_size;
-
- FT_Face_InitFunc init_face;
- FT_Face_DoneFunc done_face;
-
- FT_Size_InitFunc init_size;
- FT_Size_DoneFunc done_size;
-
- FT_Slot_InitFunc init_slot;
- FT_Slot_DoneFunc done_slot;
-
- FT_Slot_LoadFunc load_glyph;
-
- FT_Face_GetKerningFunc get_kerning;
- FT_Face_AttachFunc attach_file;
- FT_Face_GetAdvancesFunc get_advances;
-
- /* since version 2.2 */
- FT_Size_RequestFunc request_size;
- FT_Size_SelectFunc select_size;
-
- } FT_Driver_ClassRec, *FT_Driver_Class;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DECLARE_DRIVER */
- /* */
- /* <Description> */
- /* Used to create a forward declaration of an FT_Driver_ClassRec */
- /* struct instance. */
- /* */
- /* <Macro> */
- /* FT_DEFINE_DRIVER */
- /* */
- /* <Description> */
- /* Used to initialize an instance of FT_Driver_ClassRec struct. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
- /* called with a pointer where the allocated structure is returned. */
- /* And when it is no longer needed a `destroy' function needs to be */
- /* called to release that allocation. */
- /* */
- /* `fcinit.c' (ft_create_default_module_classes) already contains a */
- /* mechanism to call these functions for the default modules */
- /* described in `ftmodule.h'. */
- /* */
- /* Notice that the created `create' and `destroy' functions call */
- /* `pic_init' and `pic_free' to allow you to manually allocate and */
- /* initialize any additional global data, like a module specific */
- /* interface, and put them in the global pic container defined in */
- /* `ftpic.h'. If you don't need them just implement the functions as */
- /* empty to resolve the link error. Also the `pic_init' and */
- /* `pic_free' functions should be declared in `pic.h', to be referred */
- /* by driver definition calling `FT_DEFINE_DRIVER' in following. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro is */
- /* used). */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DECLARE_DRIVER( class_ ) \
- FT_CALLBACK_TABLE \
- const FT_Driver_ClassRec class_;
-
-#define FT_DEFINE_DRIVER( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_, \
- face_object_size_, \
- size_object_size_, \
- slot_object_size_, \
- init_face_, \
- done_face_, \
- init_size_, \
- done_size_, \
- init_slot_, \
- done_slot_, \
- load_glyph_, \
- get_kerning_, \
- attach_file_, \
- get_advances_, \
- request_size_, \
- select_size_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_Driver_ClassRec class_ = \
- { \
- FT_DEFINE_ROOT_MODULE( flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- \
- face_object_size_, \
- size_object_size_, \
- slot_object_size_, \
- \
- init_face_, \
- done_face_, \
- \
- init_size_, \
- done_size_, \
- \
- init_slot_, \
- done_slot_, \
- \
- load_glyph_, \
- \
- get_kerning_, \
- attach_file_, \
- get_advances_, \
- \
- request_size_, \
- select_size_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
-
-#define FT_DEFINE_DRIVER( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_, \
- face_object_size_, \
- size_object_size_, \
- slot_object_size_, \
- init_face_, \
- done_face_, \
- init_size_, \
- done_size_, \
- init_slot_, \
- done_slot_, \
- load_glyph_, \
- get_kerning_, \
- attach_file_, \
- get_advances_, \
- request_size_, \
- select_size_ ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_Module_Class* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
- \
- \
- class_ ## _pic_free( library ); \
- if ( dclazz ) \
- FT_FREE( dclazz ); \
- } \
- \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_Module_Class** output_class ) \
- { \
- FT_Driver_Class clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
- return error; \
- \
- error = class_ ## _pic_init( library ); \
- if ( error ) \
- { \
- FT_FREE( clazz ); \
- return error; \
- } \
- \
- FT_DEFINE_ROOT_MODULE( flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- \
- clazz->face_object_size = face_object_size_; \
- clazz->size_object_size = size_object_size_; \
- clazz->slot_object_size = slot_object_size_; \
- \
- clazz->init_face = init_face_; \
- clazz->done_face = done_face_; \
- \
- clazz->init_size = init_size_; \
- clazz->done_size = done_size_; \
- \
- clazz->init_slot = init_slot_; \
- clazz->done_slot = done_slot_; \
- \
- clazz->load_glyph = load_glyph_; \
- \
- clazz->get_kerning = get_kerning_; \
- clazz->attach_file = attach_file_; \
- clazz->get_advances = get_advances_; \
- \
- clazz->request_size = request_size_; \
- clazz->select_size = select_size_; \
- \
- *output_class = (FT_Module_Class*)clazz; \
- \
- return FT_Err_Ok; \
- }
-
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-FT_END_HEADER
-
-#endif /* __FTDRIVER_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftgloadr.h b/src/3rdparty/freetype/include/internal/ftgloadr.h
deleted file mode 100644
index f70774f74e..0000000000
--- a/src/3rdparty/freetype/include/internal/ftgloadr.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftgloadr.h */
-/* */
-/* The FreeType glyph loader (specification). */
-/* */
-/* Copyright 2002, 2003, 2005, 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTGLOADR_H__
-#define __FTGLOADR_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphLoader */
- /* */
- /* <Description> */
- /* The glyph loader is an internal object used to load several glyphs */
- /* together (for example, in the case of composites). */
- /* */
- /* <Note> */
- /* The glyph loader implementation is not part of the high-level API, */
- /* hence the forward structure declaration. */
- /* */
- typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
-
-
-#if 0 /* moved to freetype.h in version 2.2 */
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
-#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
-#define FT_SUBGLYPH_FLAG_SCALE 8
-#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
-#define FT_SUBGLYPH_FLAG_2X2 0x80
-#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
-#endif
-
-
- typedef struct FT_SubGlyphRec_
- {
- FT_Int index;
- FT_UShort flags;
- FT_Int arg1;
- FT_Int arg2;
- FT_Matrix transform;
-
- } FT_SubGlyphRec;
-
-
- typedef struct FT_GlyphLoadRec_
- {
- FT_Outline outline; /* outline */
- FT_Vector* extra_points; /* extra points table */
- FT_Vector* extra_points2; /* second extra points table */
- FT_UInt num_subglyphs; /* number of subglyphs */
- FT_SubGlyph subglyphs; /* subglyphs */
-
- } FT_GlyphLoadRec, *FT_GlyphLoad;
-
-
- typedef struct FT_GlyphLoaderRec_
- {
- FT_Memory memory;
- FT_UInt max_points;
- FT_UInt max_contours;
- FT_UInt max_subglyphs;
- FT_Bool use_extra;
-
- FT_GlyphLoadRec base;
- FT_GlyphLoadRec current;
-
- void* other; /* for possible future extension? */
-
- } FT_GlyphLoaderRec;
-
-
- /* create new empty glyph loader */
- FT_BASE( FT_Error )
- FT_GlyphLoader_New( FT_Memory memory,
- FT_GlyphLoader *aloader );
-
- /* add an extra points table to a glyph loader */
- FT_BASE( FT_Error )
- FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader );
-
- /* destroy a glyph loader */
- FT_BASE( void )
- FT_GlyphLoader_Done( FT_GlyphLoader loader );
-
- /* reset a glyph loader (frees everything int it) */
- FT_BASE( void )
- FT_GlyphLoader_Reset( FT_GlyphLoader loader );
-
- /* rewind a glyph loader */
- FT_BASE( void )
- FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
-
- /* check that there is enough space to add `n_points' and `n_contours' */
- /* to the glyph loader */
- FT_BASE( FT_Error )
- FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
- FT_UInt n_points,
- FT_UInt n_contours );
-
-
-#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
- ( (_count) == 0 || \
- ( (_loader)->base.outline.n_points + \
- (_loader)->current.outline.n_points + \
- (unsigned long)(_count) ) <= (_loader)->max_points )
-
-#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
- ( (_count) == 0 || \
- ( (_loader)->base.outline.n_contours + \
- (_loader)->current.outline.n_contours + \
- (unsigned long)(_count)) <= (_loader)->max_contours )
-
-#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \
- ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
- FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
- ? 0 \
- : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
-
-
- /* check that there is enough space to add `n_subs' sub-glyphs to */
- /* a glyph loader */
- FT_BASE( FT_Error )
- FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
- FT_UInt n_subs );
-
- /* prepare a glyph loader, i.e. empty the current glyph */
- FT_BASE( void )
- FT_GlyphLoader_Prepare( FT_GlyphLoader loader );
-
- /* add the current glyph to the base glyph */
- FT_BASE( void )
- FT_GlyphLoader_Add( FT_GlyphLoader loader );
-
- /* copy points from one glyph loader to another */
- FT_BASE( FT_Error )
- FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
- FT_GlyphLoader source );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTGLOADR_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftmemory.h b/src/3rdparty/freetype/include/internal/ftmemory.h
deleted file mode 100644
index 3d51aeec69..0000000000
--- a/src/3rdparty/freetype/include/internal/ftmemory.h
+++ /dev/null
@@ -1,378 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftmemory.h */
-/* */
-/* The FreeType memory management macros (specification). */
-/* */
-/* Copyright 1996-2002, 2004-2007, 2010, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTMEMORY_H__
-#define __FTMEMORY_H__
-
-
-#include <ft2build.h>
-#include FT_CONFIG_CONFIG_H
-#include FT_TYPES_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_SET_ERROR */
- /* */
- /* <Description> */
- /* This macro is used to set an implicit `error' variable to a given */
- /* expression's value (usually a function call), and convert it to a */
- /* boolean which is set whenever the value is != 0. */
- /* */
-#undef FT_SET_ERROR
-#define FT_SET_ERROR( expression ) \
- ( ( error = (expression) ) != 0 )
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** M E M O R Y ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*
- * C++ refuses to handle statements like p = (void*)anything, with `p' a
- * typed pointer. Since we don't have a `typeof' operator in standard
- * C++, we have to use a template to emulate it.
- */
-
-#ifdef __cplusplus
-
- extern "C++"
- template <typename T> inline T*
- cplusplus_typeof( T*,
- void *v )
- {
- return static_cast <T*> ( v );
- }
-
-#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
-
-#else
-
-#define FT_ASSIGNP( p, val ) (p) = (val)
-
-#endif
-
-
-
-#ifdef FT_DEBUG_MEMORY
-
- FT_BASE( const char* ) _ft_debug_file;
- FT_BASE( long ) _ft_debug_lineno;
-
-#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
- _ft_debug_lineno = __LINE__, \
- (exp) )
-
-#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
- _ft_debug_lineno = __LINE__, \
- FT_ASSIGNP( p, exp ) )
-
-#else /* !FT_DEBUG_MEMORY */
-
-#define FT_DEBUG_INNER( exp ) (exp)
-#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
-
-#endif /* !FT_DEBUG_MEMORY */
-
-
- /*
- * The allocation functions return a pointer, and the error code
- * is written to through the `p_error' parameter. See below for
- * for documentation.
- */
-
- FT_BASE( FT_Pointer )
- ft_mem_alloc( FT_Memory memory,
- FT_Long size,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_qalloc( FT_Memory memory,
- FT_Long size,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_realloc( FT_Memory memory,
- FT_Long item_size,
- FT_Long cur_count,
- FT_Long new_count,
- void* block,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_qrealloc( FT_Memory memory,
- FT_Long item_size,
- FT_Long cur_count,
- FT_Long new_count,
- void* block,
- FT_Error *p_error );
-
- FT_BASE( void )
- ft_mem_free( FT_Memory memory,
- const void* P );
-
-
-#define FT_MEM_ALLOC( ptr, size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
- (FT_Long)(size), \
- &error ) )
-
-#define FT_MEM_FREE( ptr ) \
- FT_BEGIN_STMNT \
- ft_mem_free( memory, (ptr) ); \
- (ptr) = NULL; \
- FT_END_STMNT
-
-#define FT_MEM_NEW( ptr ) \
- FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
-
-#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
- 1, \
- (FT_Long)(cursz), \
- (FT_Long)(newsz), \
- (ptr), \
- &error ) )
-
-#define FT_MEM_QALLOC( ptr, size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, \
- (FT_Long)(size), \
- &error ) )
-
-#define FT_MEM_QNEW( ptr ) \
- FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
-
-#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
- 1, \
- (FT_Long)(cursz), \
- (FT_Long)(newsz), \
- (ptr), \
- &error ) )
-
-#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
- (FT_Long)(item_size), \
- 0, \
- (FT_Long)(count), \
- NULL, \
- &error ) )
-
-#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
- (FT_Long)(itmsz), \
- (FT_Long)(oldcnt), \
- (FT_Long)(newcnt), \
- (ptr), \
- &error ) )
-
-#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
- (FT_Long)(item_size), \
- 0, \
- (FT_Long)(count), \
- NULL, \
- &error ) )
-
-#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
- (FT_Long)(itmsz), \
- (FT_Long)(oldcnt), \
- (FT_Long)(newcnt), \
- (ptr), \
- &error ) )
-
-
-#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
-
-
-#define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count )
-
-#define FT_MEM_COPY( dest, source, count ) ft_memcpy( dest, source, count )
-
-#define FT_MEM_MOVE( dest, source, count ) ft_memmove( dest, source, count )
-
-
-#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
-
-#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
-
-
-#define FT_ARRAY_ZERO( dest, count ) \
- FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
-
-#define FT_ARRAY_COPY( dest, source, count ) \
- FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )
-
-#define FT_ARRAY_MOVE( dest, source, count ) \
- FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )
-
-
- /*
- * Return the maximum number of addressable elements in an array.
- * We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
- * any problems.
- */
-#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
-
-#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
-
-
- /*************************************************************************/
- /* */
- /* The following functions macros expect that their pointer argument is */
- /* _typed_ in order to automatically compute array element sizes. */
- /* */
-
-#define FT_MEM_NEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
- sizeof ( *(ptr) ), \
- 0, \
- (FT_Long)(count), \
- NULL, \
- &error ) )
-
-#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
- sizeof ( *(ptr) ), \
- (FT_Long)(cursz), \
- (FT_Long)(newsz), \
- (ptr), \
- &error ) )
-
-#define FT_MEM_QNEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
- sizeof ( *(ptr) ), \
- 0, \
- (FT_Long)(count), \
- NULL, \
- &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
- sizeof ( *(ptr) ), \
- (FT_Long)(cursz), \
- (FT_Long)(newsz), \
- (ptr), \
- &error ) )
-
-#define FT_ALLOC( ptr, size ) \
- FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
-
-#define FT_REALLOC( ptr, cursz, newsz ) \
- FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
-
-#define FT_ALLOC_MULT( ptr, count, item_size ) \
- FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
-
-#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
- FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
- newcnt, itmsz ) )
-
-#define FT_QALLOC( ptr, size ) \
- FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
-
-#define FT_QREALLOC( ptr, cursz, newsz ) \
- FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
-
-#define FT_QALLOC_MULT( ptr, count, item_size ) \
- FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
-
-#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
- FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
- newcnt, itmsz ) )
-
-#define FT_FREE( ptr ) FT_MEM_FREE( ptr )
-
-#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
-
-#define FT_NEW_ARRAY( ptr, count ) \
- FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
-
-#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
- FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
-
-#define FT_QNEW( ptr ) \
- FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
-
-#define FT_QNEW_ARRAY( ptr, count ) \
- FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
-
-#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
- FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
-
-
- FT_BASE( FT_Pointer )
- ft_mem_strdup( FT_Memory memory,
- const char* str,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_dup( FT_Memory memory,
- const void* address,
- FT_ULong size,
- FT_Error *p_error );
-
-
-#define FT_MEM_STRDUP( dst, str ) \
- (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
-
-#define FT_STRDUP( dst, str ) \
- FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
-
-#define FT_MEM_DUP( dst, address, size ) \
- (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
-
-#define FT_DUP( dst, address, size ) \
- FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
-
-
- /* Return >= 1 if a truncation occurs. */
- /* Return 0 if the source string fits the buffer. */
- /* This is *not* the same as strlcpy(). */
- FT_BASE( FT_Int )
- ft_mem_strcpyn( char* dst,
- const char* src,
- FT_ULong size );
-
-#define FT_STRCPYN( dst, src, size ) \
- ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTMEMORY_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftobjs.h b/src/3rdparty/freetype/include/internal/ftobjs.h
deleted file mode 100644
index b45a5ed814..0000000000
--- a/src/3rdparty/freetype/include/internal/ftobjs.h
+++ /dev/null
@@ -1,1571 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftobjs.h */
-/* */
-/* The FreeType private base classes (specification). */
-/* */
-/* Copyright 1996-2006, 2008, 2010, 2012-2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file contains the definition of all internal FreeType classes. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTOBJS_H__
-#define __FTOBJS_H__
-
-#include <ft2build.h>
-#include FT_RENDER_H
-#include FT_SIZES_H
-#include FT_LCD_FILTER_H
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_GLYPH_LOADER_H
-#include FT_INTERNAL_DRIVER_H
-#include FT_INTERNAL_AUTOHINT_H
-#include FT_INTERNAL_SERVICE_H
-#include FT_INTERNAL_PIC_H
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-#include FT_INCREMENTAL_H
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* Some generic definitions. */
- /* */
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-
- /*************************************************************************/
- /* */
- /* The min and max functions missing in C. As usual, be careful not to */
- /* write things like FT_MIN( a++, b++ ) to avoid side effects. */
- /* */
-#define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
-#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
-
-#define 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 FT_HYPOT( x, y ) \
- ( x = FT_ABS( x ), \
- y = FT_ABS( y ), \
- x > y ? x + ( 3 * y >> 3 ) \
- : y + ( 3 * x >> 3 ) )
-
-#define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
-#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
-#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
-
-#define FT_PIX_FLOOR( x ) ( (x) & ~63 )
-#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
-#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
-
-
- /*
- * character classification functions -- since these are used to parse
- * font files, we must not use those in <ctypes.h> which are
- * locale-dependent
- */
-#define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
-
-#define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
- ( (unsigned)(x) - 'a' ) < 6U || \
- ( (unsigned)(x) - 'A' ) < 6U )
-
- /* the next two macros assume ASCII representation */
-#define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
-#define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
-
-#define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
-#define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** C H A R M A P S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /* handle to internal charmap object */
- typedef struct FT_CMapRec_* FT_CMap;
-
- /* handle to charmap class structure */
- typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
-
- /* internal charmap object structure */
- typedef struct FT_CMapRec_
- {
- FT_CharMapRec charmap;
- FT_CMap_Class clazz;
-
- } FT_CMapRec;
-
- /* typecase any pointer to a charmap handle */
-#define FT_CMAP( x ) ((FT_CMap)( x ))
-
- /* obvious macros */
-#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
-#define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
-#define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
-#define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
-
-
- /* class method definitions */
- typedef FT_Error
- (*FT_CMap_InitFunc)( FT_CMap cmap,
- FT_Pointer init_data );
-
- typedef void
- (*FT_CMap_DoneFunc)( FT_CMap cmap );
-
- typedef FT_UInt
- (*FT_CMap_CharIndexFunc)( FT_CMap cmap,
- FT_UInt32 char_code );
-
- typedef FT_UInt
- (*FT_CMap_CharNextFunc)( FT_CMap cmap,
- FT_UInt32 *achar_code );
-
- typedef FT_UInt
- (*FT_CMap_CharVarIndexFunc)( FT_CMap cmap,
- FT_CMap unicode_cmap,
- FT_UInt32 char_code,
- FT_UInt32 variant_selector );
-
- typedef FT_Bool
- (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap cmap,
- FT_UInt32 char_code,
- FT_UInt32 variant_selector );
-
- typedef FT_UInt32 *
- (*FT_CMap_VariantListFunc)( FT_CMap cmap,
- FT_Memory mem );
-
- typedef FT_UInt32 *
- (*FT_CMap_CharVariantListFunc)( FT_CMap cmap,
- FT_Memory mem,
- FT_UInt32 char_code );
-
- typedef FT_UInt32 *
- (*FT_CMap_VariantCharListFunc)( FT_CMap cmap,
- FT_Memory mem,
- FT_UInt32 variant_selector );
-
-
- typedef struct FT_CMap_ClassRec_
- {
- FT_ULong size;
- FT_CMap_InitFunc init;
- FT_CMap_DoneFunc done;
- FT_CMap_CharIndexFunc char_index;
- FT_CMap_CharNextFunc char_next;
-
- /* Subsequent entries are special ones for format 14 -- the variant */
- /* selector subtable which behaves like no other */
-
- FT_CMap_CharVarIndexFunc char_var_index;
- FT_CMap_CharVarIsDefaultFunc char_var_default;
- FT_CMap_VariantListFunc variant_list;
- FT_CMap_CharVariantListFunc charvariant_list;
- FT_CMap_VariantCharListFunc variantchar_list;
-
- } FT_CMap_ClassRec;
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DECLARE_CMAP_CLASS( class_ ) \
- FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
-
-#define FT_DEFINE_CMAP_CLASS( \
- class_, \
- size_, \
- init_, \
- done_, \
- char_index_, \
- char_next_, \
- char_var_index_, \
- char_var_default_, \
- variant_list_, \
- charvariant_list_, \
- variantchar_list_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_CMap_ClassRec class_ = \
- { \
- size_, \
- init_, \
- done_, \
- char_index_, \
- char_next_, \
- char_var_index_, \
- char_var_default_, \
- variant_list_, \
- charvariant_list_, \
- variantchar_list_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DECLARE_CMAP_CLASS( class_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_CMap_ClassRec* clazz );
-
-#define FT_DEFINE_CMAP_CLASS( \
- class_, \
- size_, \
- init_, \
- done_, \
- char_index_, \
- char_next_, \
- char_var_index_, \
- char_var_default_, \
- variant_list_, \
- charvariant_list_, \
- variantchar_list_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_CMap_ClassRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->size = size_; \
- clazz->init = init_; \
- clazz->done = done_; \
- clazz->char_index = char_index_; \
- clazz->char_next = char_next_; \
- clazz->char_var_index = char_var_index_; \
- clazz->char_var_default = char_var_default_; \
- clazz->variant_list = variant_list_; \
- clazz->charvariant_list = charvariant_list_; \
- clazz->variantchar_list = variantchar_list_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
- /* create a new charmap and add it to charmap->face */
- FT_BASE( FT_Error )
- FT_CMap_New( FT_CMap_Class clazz,
- FT_Pointer init_data,
- FT_CharMap charmap,
- FT_CMap *acmap );
-
- /* destroy a charmap and remove it from face's list */
- FT_BASE( void )
- FT_CMap_Done( FT_CMap cmap );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Face_InternalRec */
- /* */
- /* <Description> */
- /* This structure contains the internal fields of each FT_Face */
- /* object. These fields may change between different releases of */
- /* FreeType. */
- /* */
- /* <Fields> */
- /* max_points :: */
- /* The maximum number of points used to store the vectorial outline */
- /* of any glyph in this face. If this value cannot be known in */
- /* advance, or if the face isn't scalable, this should be set to 0. */
- /* Only relevant for scalable formats. */
- /* */
- /* max_contours :: */
- /* The maximum number of contours used to store the vectorial */
- /* outline of any glyph in this face. If this value cannot be */
- /* known in advance, or if the face isn't scalable, this should be */
- /* set to 0. Only relevant for scalable formats. */
- /* */
- /* transform_matrix :: */
- /* A 2x2 matrix of 16.16 coefficients used to transform glyph */
- /* outlines after they are loaded from the font. Only used by the */
- /* convenience functions. */
- /* */
- /* transform_delta :: */
- /* A translation vector used to transform glyph outlines after they */
- /* are loaded from the font. Only used by the convenience */
- /* functions. */
- /* */
- /* transform_flags :: */
- /* Some flags used to classify the transform. Only used by the */
- /* convenience functions. */
- /* */
- /* services :: */
- /* A cache for frequently used services. It should be only */
- /* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */
- /* */
- /* incremental_interface :: */
- /* If non-null, the interface through which glyph data and metrics */
- /* are loaded incrementally for faces that do not provide all of */
- /* this data when first opened. This field exists only if */
- /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
- /* */
- /* ignore_unpatented_hinter :: */
- /* This boolean flag instructs the glyph loader to ignore the */
- /* native font hinter, if one is found. This is exclusively used */
- /* in the case when the unpatented hinter is compiled within the */
- /* library. */
- /* */
- /* refcount :: */
- /* A counter initialized to~1 at the time an @FT_Face structure is */
- /* created. @FT_Reference_Face increments this counter, and */
- /* @FT_Done_Face only destroys a face if the counter is~1, */
- /* otherwise it simply decrements it. */
- /* */
- typedef struct FT_Face_InternalRec_
- {
- FT_Matrix transform_matrix;
- FT_Vector transform_delta;
- FT_Int transform_flags;
-
- FT_ServiceCacheRec services;
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
- FT_Incremental_InterfaceRec* incremental_interface;
-#endif
-
- FT_Bool ignore_unpatented_hinter;
- FT_Int refcount;
-
- } FT_Face_InternalRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Slot_InternalRec */
- /* */
- /* <Description> */
- /* This structure contains the internal fields of each FT_GlyphSlot */
- /* object. These fields may change between different releases of */
- /* FreeType. */
- /* */
- /* <Fields> */
- /* loader :: The glyph loader object used to load outlines */
- /* into the glyph slot. */
- /* */
- /* flags :: Possible values are zero or */
- /* FT_GLYPH_OWN_BITMAP. The latter indicates */
- /* that the FT_GlyphSlot structure owns the */
- /* bitmap buffer. */
- /* */
- /* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
- /* must be transformed through a specific */
- /* font transformation. This is _not_ the same */
- /* as the face transform set through */
- /* FT_Set_Transform(). */
- /* */
- /* glyph_matrix :: The 2x2 matrix corresponding to the glyph */
- /* transformation, if necessary. */
- /* */
- /* glyph_delta :: The 2d translation vector corresponding to */
- /* the glyph transformation, if necessary. */
- /* */
- /* glyph_hints :: Format-specific glyph hints management. */
- /* */
-
-#define FT_GLYPH_OWN_BITMAP 0x1
-
- typedef struct FT_Slot_InternalRec_
- {
- FT_GlyphLoader loader;
- FT_UInt flags;
- FT_Bool glyph_transformed;
- FT_Matrix glyph_matrix;
- FT_Vector glyph_delta;
- void* glyph_hints;
-
- } FT_GlyphSlot_InternalRec;
-
-
-#if 0
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_InternalRec */
- /* */
- /* <Description> */
- /* This structure contains the internal fields of each FT_Size */
- /* object. Currently, it's empty. */
- /* */
- /*************************************************************************/
-
- typedef struct FT_Size_InternalRec_
- {
- /* empty */
-
- } FT_Size_InternalRec;
-
-#endif
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** M O D U L E S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ModuleRec */
- /* */
- /* <Description> */
- /* A module object instance. */
- /* */
- /* <Fields> */
- /* clazz :: A pointer to the module's class. */
- /* */
- /* library :: A handle to the parent library object. */
- /* */
- /* memory :: A handle to the memory manager. */
- /* */
- typedef struct FT_ModuleRec_
- {
- FT_Module_Class* clazz;
- FT_Library library;
- FT_Memory memory;
-
- } FT_ModuleRec;
-
-
- /* typecast an object to an FT_Module */
-#define FT_MODULE( x ) ((FT_Module)( x ))
-#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
-#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
-#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
-
-
-#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_FONT_DRIVER )
-
-#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_RENDERER )
-
-#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_HINTER )
-
-#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_STYLER )
-
-#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_DRIVER_SCALABLE )
-
-#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_DRIVER_NO_OUTLINES )
-
-#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
- FT_MODULE_DRIVER_HAS_HINTER )
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Module_Interface */
- /* */
- /* <Description> */
- /* Finds a module and returns its specific interface as a typeless */
- /* pointer. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* module_name :: The module's name (as an ASCII string). */
- /* */
- /* <Return> */
- /* A module-specific interface if available, 0 otherwise. */
- /* */
- /* <Note> */
- /* You should better be familiar with FreeType internals to know */
- /* which module to look for, and what its interface is :-) */
- /* */
- FT_BASE( const void* )
- FT_Get_Module_Interface( FT_Library library,
- const char* mod_name );
-
- FT_BASE( FT_Pointer )
- ft_module_get_service( FT_Module module,
- const char* service_id );
-
- /* */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** F A C E, S I Z E & G L Y P H S L O T O B J E C T S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /* a few macros used to perform easy typecasts with minimal brain damage */
-
-#define FT_FACE( x ) ((FT_Face)(x))
-#define FT_SIZE( x ) ((FT_Size)(x))
-#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
-
-#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
-#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
-#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
-#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
-
-#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
-#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
-
-#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
-#define FT_FACE_SIZE( x ) FT_FACE( x )->size
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_GlyphSlot */
- /* */
- /* <Description> */
- /* It is sometimes useful to have more than one glyph slot for a */
- /* given face object. This function is used to create additional */
- /* slots. All of them are automatically discarded when the face is */
- /* destroyed. */
- /* */
- /* <Input> */
- /* face :: A handle to a parent face object. */
- /* */
- /* <Output> */
- /* aslot :: A handle to a new glyph slot object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- FT_BASE( FT_Error )
- FT_New_GlyphSlot( FT_Face face,
- FT_GlyphSlot *aslot );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_GlyphSlot */
- /* */
- /* <Description> */
- /* Destroys a given glyph slot. Remember however that all slots are */
- /* automatically destroyed with its parent. Using this function is */
- /* not always mandatory. */
- /* */
- /* <Input> */
- /* slot :: A handle to a target glyph slot. */
- /* */
- FT_BASE( void )
- FT_Done_GlyphSlot( FT_GlyphSlot slot );
-
- /* */
-
-#define FT_REQUEST_WIDTH( req ) \
- ( (req)->horiResolution \
- ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
- : (req)->width )
-
-#define FT_REQUEST_HEIGHT( req ) \
- ( (req)->vertResolution \
- ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
- : (req)->height )
-
-
- /* Set the metrics according to a bitmap strike. */
- FT_BASE( void )
- FT_Select_Metrics( FT_Face face,
- FT_ULong strike_index );
-
-
- /* Set the metrics according to a size request. */
- FT_BASE( void )
- FT_Request_Metrics( FT_Face face,
- FT_Size_Request req );
-
-
- /* Match a size request against `available_sizes'. */
- FT_BASE( FT_Error )
- FT_Match_Size( FT_Face face,
- FT_Size_Request req,
- FT_Bool ignore_width,
- FT_ULong* size_index );
-
-
- /* Use the horizontal metrics to synthesize the vertical metrics. */
- /* If `advance' is zero, it is also synthesized. */
- FT_BASE( void )
- ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
- FT_Pos advance );
-
-
- /* Free the bitmap of a given glyphslot when needed (i.e., only when it */
- /* was allocated with ft_glyphslot_alloc_bitmap). */
- FT_BASE( void )
- ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
-
-
- /* Allocate a new bitmap buffer in a glyph slot. */
- FT_BASE( FT_Error )
- ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
- FT_ULong size );
-
-
- /* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
- /* will not be freed by a later call to ft_glyphslot_free_bitmap. */
- FT_BASE( void )
- ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
- FT_Byte* buffer );
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** R E N D E R E R S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
-#define FT_RENDERER( x ) ((FT_Renderer)( x ))
-#define FT_GLYPH( x ) ((FT_Glyph)( x ))
-#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
-#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
-
-
- typedef struct FT_RendererRec_
- {
- FT_ModuleRec root;
- FT_Renderer_Class* clazz;
- FT_Glyph_Format glyph_format;
- FT_Glyph_Class glyph_class;
-
- FT_Raster raster;
- FT_Raster_Render_Func raster_render;
- FT_Renderer_RenderFunc render;
-
- } FT_RendererRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** F O N T D R I V E R S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /* typecast a module into a driver easily */
-#define FT_DRIVER( x ) ((FT_Driver)(x))
-
- /* typecast a module as a driver, and get its driver class */
-#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_DriverRec */
- /* */
- /* <Description> */
- /* The root font driver class. A font driver is responsible for */
- /* managing and loading font files of a given format. */
- /* */
- /* <Fields> */
- /* root :: Contains the fields of the root module class. */
- /* */
- /* clazz :: A pointer to the font driver's class. Note that */
- /* this is NOT root.clazz. `class' wasn't used */
- /* as it is a reserved word in C++. */
- /* */
- /* faces_list :: The list of faces currently opened by this */
- /* driver. */
- /* */
- /* glyph_loader :: The glyph loader for all faces managed by this */
- /* driver. This object isn't defined for unscalable */
- /* formats. */
- /* */
- typedef struct FT_DriverRec_
- {
- FT_ModuleRec root;
- FT_Driver_Class clazz;
- FT_ListRec faces_list;
- FT_GlyphLoader glyph_loader;
-
- } FT_DriverRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** L I B R A R I E S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /* This hook is used by the TrueType debugger. It must be set to an */
- /* alternate truetype bytecode interpreter function. */
-#define FT_DEBUG_HOOK_TRUETYPE 0
-
-
- /* Set this debug hook to a non-null pointer to force unpatented hinting */
- /* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
- /* during debugging. */
-#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
-
-
- typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
- FT_Render_Mode render_mode,
- FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_LibraryRec */
- /* */
- /* <Description> */
- /* The FreeType library class. This is the root of all FreeType */
- /* data. Use FT_New_Library() to create a library object, and */
- /* FT_Done_Library() to discard it and all child objects. */
- /* */
- /* <Fields> */
- /* memory :: The library's memory object. Manages memory */
- /* allocation. */
- /* */
- /* version_major :: The major version number of the library. */
- /* */
- /* version_minor :: The minor version number of the library. */
- /* */
- /* version_patch :: The current patch level of the library. */
- /* */
- /* num_modules :: The number of modules currently registered */
- /* within this library. This is set to 0 for new */
- /* libraries. New modules are added through the */
- /* FT_Add_Module() API function. */
- /* */
- /* modules :: A table used to store handles to the currently */
- /* registered modules. Note that each font driver */
- /* contains a list of its opened faces. */
- /* */
- /* renderers :: The list of renderers currently registered */
- /* within the library. */
- /* */
- /* cur_renderer :: The current outline renderer. This is a */
- /* shortcut used to avoid parsing the list on */
- /* each call to FT_Outline_Render(). It is a */
- /* handle to the current renderer for the */
- /* FT_GLYPH_FORMAT_OUTLINE format. */
- /* */
- /* auto_hinter :: XXX */
- /* */
- /* raster_pool :: The raster object's render pool. This can */
- /* ideally be changed dynamically at run-time. */
- /* */
- /* raster_pool_size :: The size of the render pool in bytes. */
- /* */
- /* debug_hooks :: XXX */
- /* */
- /* lcd_filter :: If subpixel rendering is activated, the */
- /* selected LCD filter mode. */
- /* */
- /* lcd_extra :: If subpixel rendering is activated, the number */
- /* of extra pixels needed for the LCD filter. */
- /* */
- /* lcd_weights :: If subpixel rendering is activated, the LCD */
- /* filter weights, if any. */
- /* */
- /* lcd_filter_func :: If subpixel rendering is activated, the LCD */
- /* filtering callback function. */
- /* */
- /* pic_container :: Contains global structs and tables, instead */
- /* of defining them globallly. */
- /* */
- /* refcount :: A counter initialized to~1 at the time an */
- /* @FT_Library structure is created. */
- /* @FT_Reference_Library increments this counter, */
- /* and @FT_Done_Library only destroys a library */
- /* if the counter is~1, otherwise it simply */
- /* decrements it. */
- /* */
- typedef struct FT_LibraryRec_
- {
- FT_Memory memory; /* library's memory manager */
-
- FT_Int version_major;
- FT_Int version_minor;
- FT_Int version_patch;
-
- FT_UInt num_modules;
- FT_Module modules[FT_MAX_MODULES]; /* module objects */
-
- FT_ListRec renderers; /* list of renderers */
- FT_Renderer cur_renderer; /* current outline renderer */
- FT_Module auto_hinter;
-
- FT_Byte* raster_pool; /* scan-line conversion */
- /* render pool */
- FT_ULong raster_pool_size; /* size of render pool in bytes */
-
- FT_DebugHook_Func debug_hooks[4];
-
-#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- FT_LcdFilter lcd_filter;
- FT_Int lcd_extra; /* number of extra pixels */
- FT_Byte lcd_weights[7]; /* filter weights, if any */
- FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
-#endif
-
-#ifdef FT_CONFIG_OPTION_PIC
- FT_PIC_Container pic_container;
-#endif
-
- FT_Int refcount;
-
- } FT_LibraryRec;
-
-
- FT_BASE( FT_Renderer )
- FT_Lookup_Renderer( FT_Library library,
- FT_Glyph_Format format,
- FT_ListNode* node );
-
- FT_BASE( FT_Error )
- FT_Render_Glyph_Internal( FT_Library library,
- FT_GlyphSlot slot,
- FT_Render_Mode render_mode );
-
- typedef const char*
- (*FT_Face_GetPostscriptNameFunc)( FT_Face face );
-
- typedef FT_Error
- (*FT_Face_GetGlyphNameFunc)( FT_Face face,
- FT_UInt glyph_index,
- FT_Pointer buffer,
- FT_UInt buffer_max );
-
- typedef FT_UInt
- (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
- FT_String* glyph_name );
-
-
-#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Memory */
- /* */
- /* <Description> */
- /* Creates a new memory object. */
- /* */
- /* <Return> */
- /* A pointer to the new memory object. 0 in case of error. */
- /* */
- FT_BASE( FT_Memory )
- FT_New_Memory( void );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Memory */
- /* */
- /* <Description> */
- /* Discards memory manager. */
- /* */
- /* <Input> */
- /* memory :: A handle to the memory manager. */
- /* */
- FT_BASE( void )
- FT_Done_Memory( FT_Memory memory );
-
-#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
-
-
- /* Define default raster's interface. The default raster is located in */
- /* `src/base/ftraster.c'. */
- /* */
- /* Client applications can register new rasters through the */
- /* FT_Set_Raster() API. */
-
-#ifndef FT_NO_DEFAULT_RASTER
- FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
-#endif
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** P I C S U P P O R T ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /* PIC support macros for ftimage.h */
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DEFINE_OUTLINE_FUNCS */
- /* */
- /* <Description> */
- /* Used to initialize an instance of FT_Outline_Funcs struct. */
- /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
- /* be called with a pre-allocated structure to be filled. */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro */
- /* is used). */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_OUTLINE_FUNCS( \
- class_, \
- move_to_, \
- line_to_, \
- conic_to_, \
- cubic_to_, \
- shift_, \
- delta_ ) \
- static const FT_Outline_Funcs class_ = \
- { \
- move_to_, \
- line_to_, \
- conic_to_, \
- cubic_to_, \
- shift_, \
- delta_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_OUTLINE_FUNCS( \
- class_, \
- move_to_, \
- line_to_, \
- conic_to_, \
- cubic_to_, \
- shift_, \
- delta_ ) \
- static FT_Error \
- Init_Class_ ## class_( FT_Outline_Funcs* clazz ) \
- { \
- clazz->move_to = move_to_; \
- clazz->line_to = line_to_; \
- clazz->conic_to = conic_to_; \
- clazz->cubic_to = cubic_to_; \
- clazz->shift = shift_; \
- clazz->delta = delta_; \
- \
- return FT_Err_Ok; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DEFINE_RASTER_FUNCS */
- /* */
- /* <Description> */
- /* Used to initialize an instance of FT_Raster_Funcs struct. */
- /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
- /* be called with a pre-allocated structure to be filled. */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro */
- /* is used). */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_RASTER_FUNCS( \
- class_, \
- glyph_format_, \
- raster_new_, \
- raster_reset_, \
- raster_set_mode_, \
- raster_render_, \
- raster_done_ ) \
- const FT_Raster_Funcs class_ = \
- { \
- glyph_format_, \
- raster_new_, \
- raster_reset_, \
- raster_set_mode_, \
- raster_render_, \
- raster_done_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_RASTER_FUNCS( \
- class_, \
- glyph_format_, \
- raster_new_, \
- raster_reset_, \
- raster_set_mode_, \
- raster_render_, \
- raster_done_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Raster_Funcs* clazz ) \
- { \
- clazz->glyph_format = glyph_format_; \
- clazz->raster_new = raster_new_; \
- clazz->raster_reset = raster_reset_; \
- clazz->raster_set_mode = raster_set_mode_; \
- clazz->raster_render = raster_render_; \
- clazz->raster_done = raster_done_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
- /* PIC support macros for ftrender.h */
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DEFINE_GLYPH */
- /* */
- /* <Description> */
- /* Used to initialize an instance of FT_Glyph_Class struct. */
- /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
- /* be called with a pre-allocated stcture to be filled. */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro */
- /* is used). */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_GLYPH( \
- class_, \
- size_, \
- format_, \
- init_, \
- done_, \
- copy_, \
- transform_, \
- bbox_, \
- prepare_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_Glyph_Class class_ = \
- { \
- size_, \
- format_, \
- init_, \
- done_, \
- copy_, \
- transform_, \
- bbox_, \
- prepare_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_GLYPH( \
- class_, \
- size_, \
- format_, \
- init_, \
- done_, \
- copy_, \
- transform_, \
- bbox_, \
- prepare_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Glyph_Class* clazz ) \
- { \
- clazz->glyph_size = size_; \
- clazz->glyph_format = format_; \
- clazz->glyph_init = init_; \
- clazz->glyph_done = done_; \
- clazz->glyph_copy = copy_; \
- clazz->glyph_transform = transform_; \
- clazz->glyph_bbox = bbox_; \
- clazz->glyph_prepare = prepare_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DECLARE_RENDERER */
- /* */
- /* <Description> */
- /* Used to create a forward declaration of a */
- /* FT_Renderer_Class struct instance. */
- /* */
- /* <Macro> */
- /* FT_DEFINE_RENDERER */
- /* */
- /* <Description> */
- /* Used to initialize an instance of FT_Renderer_Class struct. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
- /* to be called with a pointer where the allocated structure is */
- /* returned. And when it is no longer needed a `destroy' function */
- /* needs to be called to release that allocation. */
- /* `fcinit.c' (ft_create_default_module_classes) already contains */
- /* a mechanism to call these functions for the default modules */
- /* described in `ftmodule.h'. */
- /* */
- /* Notice that the created `create' and `destroy' functions call */
- /* `pic_init' and `pic_free' to allow you to manually allocate and */
- /* initialize any additional global data, like a module specific */
- /* interface, and put them in the global pic container defined in */
- /* `ftpic.h'. If you don't need them just implement the functions as */
- /* empty to resolve the link error. Also the `pic_init' and */
- /* `pic_free' functions should be declared in `pic.h', to be referred */
- /* by the renderer definition calling `FT_DEFINE_RENDERER' in the */
- /* following. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro */
- /* is used). */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DECLARE_RENDERER( class_ ) \
- FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
-
-#define FT_DEFINE_RENDERER( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_, \
- glyph_format_, \
- render_glyph_, \
- transform_glyph_, \
- get_glyph_cbox_, \
- set_mode_, \
- raster_class_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_Renderer_Class class_ = \
- { \
- FT_DEFINE_ROOT_MODULE( flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- glyph_format_, \
- \
- render_glyph_, \
- transform_glyph_, \
- get_glyph_cbox_, \
- set_mode_, \
- \
- raster_class_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DECLARE_RENDERER( class_ ) FT_DECLARE_MODULE( class_ )
-
-#define FT_DEFINE_RENDERER( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_, \
- glyph_format_, \
- render_glyph_, \
- transform_glyph_, \
- get_glyph_cbox_, \
- set_mode_, \
- raster_class_ ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_Module_Class* clazz ) \
- { \
- FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
- FT_Memory memory = library->memory; \
- \
- \
- class_ ## _pic_free( library ); \
- if ( rclazz ) \
- FT_FREE( rclazz ); \
- } \
- \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_Module_Class** output_class ) \
- { \
- FT_Renderer_Class* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
- return error; \
- \
- error = class_ ## _pic_init( library ); \
- if ( error ) \
- { \
- FT_FREE( clazz ); \
- return error; \
- } \
- \
- FT_DEFINE_ROOT_MODULE( flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- \
- clazz->glyph_format = glyph_format_; \
- \
- clazz->render_glyph = render_glyph_; \
- clazz->transform_glyph = transform_glyph_; \
- clazz->get_glyph_cbox = get_glyph_cbox_; \
- clazz->set_mode = set_mode_; \
- \
- clazz->raster_class = raster_class_; \
- \
- *output_class = (FT_Module_Class*)clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
- /* PIC support macros for ftmodapi.h **/
-
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Creator */
- /* */
- /* <Description> */
- /* A function used to create (allocate) a new module class object. */
- /* The object's members are initialized, but the module itself is */
- /* not. */
- /* */
- /* <Input> */
- /* memory :: A handle to the memory manager. */
- /* output_class :: Initialized with the newly allocated class. */
- /* */
- typedef FT_Error
- (*FT_Module_Creator)( FT_Memory memory,
- FT_Module_Class** output_class );
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Module_Destroyer */
- /* */
- /* <Description> */
- /* A function used to destroy (deallocate) a module class object. */
- /* */
- /* <Input> */
- /* memory :: A handle to the memory manager. */
- /* clazz :: Module class to destroy. */
- /* */
- typedef void
- (*FT_Module_Destroyer)( FT_Memory memory,
- FT_Module_Class* clazz );
-
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DECLARE_MODULE */
- /* */
- /* <Description> */
- /* Used to create a forward declaration of a */
- /* FT_Module_Class struct instance. */
- /* */
- /* <Macro> */
- /* FT_DEFINE_MODULE */
- /* */
- /* <Description> */
- /* Used to initialize an instance of an FT_Module_Class struct. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
- /* be called with a pointer where the allocated structure is */
- /* returned. And when it is no longer needed a `destroy' function */
- /* needs to be called to release that allocation. */
- /* `fcinit.c' (ft_create_default_module_classes) already contains */
- /* a mechanism to call these functions for the default modules */
- /* described in `ftmodule.h'. */
- /* */
- /* Notice that the created `create' and `destroy' functions call */
- /* `pic_init' and `pic_free' to allow you to manually allocate and */
- /* initialize any additional global data, like a module specific */
- /* interface, and put them in the global pic container defined in */
- /* `ftpic.h'. If you don't need them just implement the functions as */
- /* empty to resolve the link error. Also the `pic_init' and */
- /* `pic_free' functions should be declared in `pic.h', to be referred */
- /* by the module definition calling `FT_DEFINE_MODULE' in the */
- /* following. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro */
- /* is used). */
- /* */
- /* <Macro> */
- /* FT_DEFINE_ROOT_MODULE */
- /* */
- /* <Description> */
- /* Used to initialize an instance of an FT_Module_Class struct inside */
- /* another struct that contains it or in a function that initializes */
- /* that containing struct. */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DECLARE_MODULE( class_ ) \
- FT_CALLBACK_TABLE \
- const FT_Module_Class class_;
-
-#define FT_DEFINE_ROOT_MODULE( \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- { \
- flags_, \
- size_, \
- \
- name_, \
- version_, \
- requires_, \
- \
- interface_, \
- \
- init_, \
- done_, \
- get_interface_, \
- },
-
-#define FT_DEFINE_MODULE( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_Module_Class class_ = \
- { \
- flags_, \
- size_, \
- \
- name_, \
- version_, \
- requires_, \
- \
- interface_, \
- \
- init_, \
- done_, \
- get_interface_, \
- };
-
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DECLARE_MODULE( class_ ) \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_Module_Class** output_class ); \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_Module_Class* clazz );
-
-#define FT_DEFINE_ROOT_MODULE( \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- clazz->root.module_flags = flags_; \
- clazz->root.module_size = size_; \
- clazz->root.module_name = name_; \
- clazz->root.module_version = version_; \
- clazz->root.module_requires = requires_; \
- \
- clazz->root.module_interface = interface_; \
- \
- clazz->root.module_init = init_; \
- clazz->root.module_done = done_; \
- clazz->root.get_interface = get_interface_;
-
-#define FT_DEFINE_MODULE( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_Module_Class* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- class_ ## _pic_free( library ); \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_Module_Class** output_class ) \
- { \
- FT_Memory memory = library->memory; \
- FT_Module_Class* clazz = NULL; \
- FT_Error error; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
- return error; \
- error = class_ ## _pic_init( library ); \
- if ( error ) \
- { \
- FT_FREE( clazz ); \
- return error; \
- } \
- \
- clazz->module_flags = flags_; \
- clazz->module_size = size_; \
- clazz->module_name = name_; \
- clazz->module_version = version_; \
- clazz->module_requires = requires_; \
- \
- clazz->module_interface = interface_; \
- \
- clazz->module_init = init_; \
- clazz->module_done = done_; \
- clazz->get_interface = get_interface_; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
-FT_END_HEADER
-
-#endif /* __FTOBJS_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftpic.h b/src/3rdparty/freetype/include/internal/ftpic.h
deleted file mode 100644
index 485ce7a24e..0000000000
--- a/src/3rdparty/freetype/include/internal/ftpic.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftpic.h */
-/* */
-/* The FreeType position independent code services (declaration). */
-/* */
-/* Copyright 2009, 2012 by */
-/* Oran Agra and Mickey Gabel. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Modules that ordinarily have const global data that need address */
- /* can instead define pointers here. */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTPIC_H__
-#define __FTPIC_H__
-
-
-FT_BEGIN_HEADER
-
-#ifdef FT_CONFIG_OPTION_PIC
-
- typedef struct FT_PIC_Container_
- {
- /* pic containers for base */
- void* base;
-
- /* pic containers for modules */
- void* autofit;
- void* cff;
- void* pshinter;
- void* psnames;
- void* raster;
- void* sfnt;
- void* smooth;
- void* truetype;
-
- } FT_PIC_Container;
-
-
- /* Initialize the various function tables, structs, etc. */
- /* stored in the container. */
- FT_BASE( FT_Error )
- ft_pic_container_init( FT_Library library );
-
-
- /* Destroy the contents of the container. */
- FT_BASE( void )
- ft_pic_container_destroy( FT_Library library );
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FTPIC_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftrfork.h b/src/3rdparty/freetype/include/internal/ftrfork.h
deleted file mode 100644
index d750cbefd8..0000000000
--- a/src/3rdparty/freetype/include/internal/ftrfork.h
+++ /dev/null
@@ -1,266 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftrfork.h */
-/* */
-/* Embedded resource forks accessor (specification). */
-/* */
-/* Copyright 2004, 2006, 2007, 2012, 2013 by */
-/* Masatake YAMATO and Redhat K.K. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* Development of the code in this file is support of */
-/* Information-technology Promotion Agency, Japan. */
-/***************************************************************************/
-
-
-#ifndef __FTRFORK_H__
-#define __FTRFORK_H__
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_OBJECTS_H
-
-
-FT_BEGIN_HEADER
-
-
- /* Number of guessing rules supported in `FT_Raccess_Guess'. */
- /* Don't forget to increment the number if you add a new guessing rule. */
-#define FT_RACCESS_N_RULES 9
-
-
- /* A structure to describe a reference in a resource by its resource ID */
- /* and internal offset. The `POST' resource expects to be concatenated */
- /* by the order of resource IDs instead of its appearance in the file. */
-
- typedef struct FT_RFork_Ref_
- {
- FT_UShort res_id;
- FT_ULong offset;
-
- } FT_RFork_Ref;
-
-#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
- typedef FT_Error
- (*ft_raccess_guess_func)( FT_Library library,
- FT_Stream stream,
- char *base_file_name,
- char **result_file_name,
- FT_Long *result_offset );
-
- typedef enum FT_RFork_Rule_ {
- FT_RFork_Rule_invalid = -2,
- FT_RFork_Rule_uknown, /* -1 */
- FT_RFork_Rule_apple_double,
- FT_RFork_Rule_apple_single,
- FT_RFork_Rule_darwin_ufs_export,
- FT_RFork_Rule_darwin_newvfs,
- FT_RFork_Rule_darwin_hfsplus,
- FT_RFork_Rule_vfat,
- FT_RFork_Rule_linux_cap,
- FT_RFork_Rule_linux_double,
- FT_RFork_Rule_linux_netatalk
- } FT_RFork_Rule;
-
- /* For fast translation between rule index and rule type,
- * the macros FT_RFORK_xxx should be kept consistent with
- * the raccess_guess_funcs table
- */
- typedef struct ft_raccess_guess_rec_ {
- ft_raccess_guess_func func;
- FT_RFork_Rule type;
- } ft_raccess_guess_rec;
-
-#ifndef FT_CONFIG_OPTION_PIC
-
- /* this array is a storage in non-PIC mode, so ; is needed in END */
-#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
- const type name[] = {
-#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
- { raccess_guess_ ## func_suffix, \
- FT_RFork_Rule_ ## type_suffix },
-#define CONST_FT_RFORK_RULE_ARRAY_END };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
- /* this array is a function in PIC mode, so no ; is needed in END */
-#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
- void \
- FT_Init_Table_ ## name( type* storage ) \
- { \
- type* local = storage; \
- \
- \
- int i = 0;
-#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
- local[i].func = raccess_guess_ ## func_suffix; \
- local[i].type = FT_RFork_Rule_ ## type_suffix; \
- i++;
-#define CONST_FT_RFORK_RULE_ARRAY_END }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Raccess_Guess */
- /* */
- /* <Description> */
- /* Guess a file name and offset where the actual resource fork is */
- /* stored. The macro FT_RACCESS_N_RULES holds the number of */
- /* guessing rules; the guessed result for the Nth rule is */
- /* represented as a triplet: a new file name (new_names[N]), a file */
- /* offset (offsets[N]), and an error code (errors[N]). */
- /* */
- /* <Input> */
- /* library :: */
- /* A FreeType library instance. */
- /* */
- /* stream :: */
- /* A file stream containing the resource fork. */
- /* */
- /* base_name :: */
- /* The (base) file name of the resource fork used for some */
- /* guessing rules. */
- /* */
- /* <Output> */
- /* new_names :: */
- /* An array of guessed file names in which the resource forks may */
- /* exist. If `new_names[N]' is NULL, the guessed file name is */
- /* equal to `base_name'. */
- /* */
- /* offsets :: */
- /* An array of guessed file offsets. `offsets[N]' holds the file */
- /* offset of the possible start of the resource fork in file */
- /* `new_names[N]'. */
- /* */
- /* errors :: */
- /* An array of FreeType error codes. `errors[N]' is the error */
- /* code of Nth guessing rule function. If `errors[N]' is not */
- /* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
- /* */
- FT_BASE( void )
- FT_Raccess_Guess( FT_Library library,
- FT_Stream stream,
- char* base_name,
- char** new_names,
- FT_Long* offsets,
- FT_Error* errors );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Raccess_Get_HeaderInfo */
- /* */
- /* <Description> */
- /* Get the information from the header of resource fork. The */
- /* information includes the file offset where the resource map */
- /* starts, and the file offset where the resource data starts. */
- /* `FT_Raccess_Get_DataOffsets' requires these two data. */
- /* */
- /* <Input> */
- /* library :: */
- /* A FreeType library instance. */
- /* */
- /* stream :: */
- /* A file stream containing the resource fork. */
- /* */
- /* rfork_offset :: */
- /* The file offset where the resource fork starts. */
- /* */
- /* <Output> */
- /* map_offset :: */
- /* The file offset where the resource map starts. */
- /* */
- /* rdata_pos :: */
- /* The file offset where the resource data starts. */
- /* */
- /* <Return> */
- /* FreeType error code. FT_Err_Ok means success. */
- /* */
- FT_BASE( FT_Error )
- FT_Raccess_Get_HeaderInfo( FT_Library library,
- FT_Stream stream,
- FT_Long rfork_offset,
- FT_Long *map_offset,
- FT_Long *rdata_pos );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Raccess_Get_DataOffsets */
- /* */
- /* <Description> */
- /* Get the data offsets for a tag in a resource fork. Offsets are */
- /* stored in an array because, in some cases, resources in a resource */
- /* fork have the same tag. */
- /* */
- /* <Input> */
- /* library :: */
- /* A FreeType library instance. */
- /* */
- /* stream :: */
- /* A file stream containing the resource fork. */
- /* */
- /* map_offset :: */
- /* The file offset where the resource map starts. */
- /* */
- /* rdata_pos :: */
- /* The file offset where the resource data starts. */
- /* */
- /* tag :: */
- /* The resource tag. */
- /* */
- /* sort_by_res_id :: */
- /* A Boolean to sort the fragmented resource by their ids. */
- /* The fragmented resources for `POST' resource should be sorted */
- /* to restore Type1 font properly. For `snft' resources, sorting */
- /* may induce a different order of the faces in comparison to that */
- /* by QuickDraw API. */
- /* */
- /* <Output> */
- /* offsets :: */
- /* The stream offsets for the resource data specified by `tag'. */
- /* This array is allocated by the function, so you have to call */
- /* @ft_mem_free after use. */
- /* */
- /* count :: */
- /* The length of offsets array. */
- /* */
- /* <Return> */
- /* FreeType error code. FT_Err_Ok means success. */
- /* */
- /* <Note> */
- /* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
- /* value for `map_offset' and `rdata_pos'. */
- /* */
- FT_BASE( FT_Error )
- FT_Raccess_Get_DataOffsets( FT_Library library,
- FT_Stream stream,
- FT_Long map_offset,
- FT_Long rdata_pos,
- FT_Long tag,
- FT_Bool sort_by_res_id,
- FT_Long **offsets,
- FT_Long *count );
-
-
-FT_END_HEADER
-
-#endif /* __FTRFORK_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftserv.h b/src/3rdparty/freetype/include/internal/ftserv.h
deleted file mode 100644
index 1203ec8121..0000000000
--- a/src/3rdparty/freetype/include/internal/ftserv.h
+++ /dev/null
@@ -1,763 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftserv.h */
-/* */
-/* The FreeType services (specification only). */
-/* */
-/* Copyright 2003-2007, 2009, 2012, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Each module can export one or more `services'. Each service is */
- /* identified by a constant string and modeled by a pointer; the latter */
- /* generally corresponds to a structure containing function pointers. */
- /* */
- /* Note that a service's data cannot be a mere function pointer because */
- /* in C it is possible that function pointers might be implemented */
- /* differently than data pointers (e.g. 48 bits instead of 32). */
- /* */
- /*************************************************************************/
-
-
-#ifndef __FTSERV_H__
-#define __FTSERV_H__
-
-
-FT_BEGIN_HEADER
-
- /*
- * @macro:
- * FT_FACE_FIND_SERVICE
- *
- * @description:
- * This macro is used to look up a service from a face's driver module.
- *
- * @input:
- * face ::
- * The source face handle.
- *
- * id ::
- * A string describing the service as defined in the service's
- * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
- * `multi-masters'). It is automatically prefixed with
- * `FT_SERVICE_ID_'.
- *
- * @output:
- * ptr ::
- * A variable that receives the service pointer. Will be NULL
- * if not found.
- */
-#ifdef __cplusplus
-
-#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_ = NULL; \
- FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
- \
- \
- if ( module->clazz->get_interface ) \
- _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
- *_pptr_ = _tmp_; \
- FT_END_STMNT
-
-#else /* !C++ */
-
-#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_ = NULL; \
- \
- if ( module->clazz->get_interface ) \
- _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
- ptr = _tmp_; \
- FT_END_STMNT
-
-#endif /* !C++ */
-
-
- /*
- * @macro:
- * FT_FACE_FIND_GLOBAL_SERVICE
- *
- * @description:
- * This macro is used to look up a service from all modules.
- *
- * @input:
- * face ::
- * The source face handle.
- *
- * id ::
- * A string describing the service as defined in the service's
- * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
- * `multi-masters'). It is automatically prefixed with
- * `FT_SERVICE_ID_'.
- *
- * @output:
- * ptr ::
- * A variable that receives the service pointer. Will be NULL
- * if not found.
- */
-#ifdef __cplusplus
-
-#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_; \
- FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
- \
- \
- _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
- *_pptr_ = _tmp_; \
- FT_END_STMNT
-
-#else /* !C++ */
-
-#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
- FT_Pointer _tmp_; \
- \
- \
- _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
- ptr = _tmp_; \
- FT_END_STMNT
-
-#endif /* !C++ */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** S E R V I C E D E S C R I P T O R S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*
- * The following structure is used to _describe_ a given service
- * to the library. This is useful to build simple static service lists.
- */
- typedef struct FT_ServiceDescRec_
- {
- const char* serv_id; /* service name */
- const void* serv_data; /* service pointer/data */
-
- } FT_ServiceDescRec;
-
- typedef const FT_ServiceDescRec* FT_ServiceDesc;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_DEFINE_SERVICEDESCREC1 */
- /* FT_DEFINE_SERVICEDESCREC2 */
- /* FT_DEFINE_SERVICEDESCREC3 */
- /* FT_DEFINE_SERVICEDESCREC4 */
- /* FT_DEFINE_SERVICEDESCREC5 */
- /* FT_DEFINE_SERVICEDESCREC6 */
- /* FT_DEFINE_SERVICEDESCREC7 */
- /* */
- /* <Description> */
- /* Used to initialize an array of FT_ServiceDescRec structures. */
- /* */
- /* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */
- /* be called with a pointer to return an allocated array. As soon as */
- /* it is no longer needed, a `destroy' function needs to be called to */
- /* release that allocation. */
- /* */
- /* These functions should be manually called from the `pic_init' and */
- /* `pic_free' functions of your module (see FT_DEFINE_MODULE). */
- /* */
- /* When FT_CONFIG_OPTION_PIC is not defined the array will be */
- /* allocated in the global scope (or the scope where the macro is */
- /* used). */
- /* */
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICEDESCREC1( class_, \
- serv_id_1, serv_data_1 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { NULL, NULL } \
- };
-
-#define FT_DEFINE_SERVICEDESCREC2( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { serv_id_2, serv_data_2 }, \
- { NULL, NULL } \
- };
-
-#define FT_DEFINE_SERVICEDESCREC3( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { serv_id_2, serv_data_2 }, \
- { serv_id_3, serv_data_3 }, \
- { NULL, NULL } \
- };
-
-#define FT_DEFINE_SERVICEDESCREC4( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { serv_id_2, serv_data_2 }, \
- { serv_id_3, serv_data_3 }, \
- { serv_id_4, serv_data_4 }, \
- { NULL, NULL } \
- };
-
-#define FT_DEFINE_SERVICEDESCREC5( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { serv_id_2, serv_data_2 }, \
- { serv_id_3, serv_data_3 }, \
- { serv_id_4, serv_data_4 }, \
- { serv_id_5, serv_data_5 }, \
- { NULL, NULL } \
- };
-
-#define FT_DEFINE_SERVICEDESCREC6( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5, \
- serv_id_6, serv_data_6 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { serv_id_2, serv_data_2 }, \
- { serv_id_3, serv_data_3 }, \
- { serv_id_4, serv_data_4 }, \
- { serv_id_5, serv_data_5 }, \
- { serv_id_6, serv_data_6 }, \
- { NULL, NULL } \
- };
-
-#define FT_DEFINE_SERVICEDESCREC7( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5, \
- serv_id_6, serv_data_6, \
- serv_id_7, serv_data_7 ) \
- static const FT_ServiceDescRec class_[] = \
- { \
- { serv_id_1, serv_data_1 }, \
- { serv_id_2, serv_data_2 }, \
- { serv_id_3, serv_data_3 }, \
- { serv_id_4, serv_data_4 }, \
- { serv_id_5, serv_data_5 }, \
- { serv_id_6, serv_data_6 }, \
- { serv_id_7, serv_data_7 }, \
- { NULL, NULL } \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICEDESCREC1( class_, \
- serv_id_1, serv_data_1 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class ) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = NULL; \
- clazz[1].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#define FT_DEFINE_SERVICEDESCREC2( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class ) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = NULL; \
- clazz[2].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#define FT_DEFINE_SERVICEDESCREC3( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class ) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = serv_id_3; \
- clazz[2].serv_data = serv_data_3; \
- clazz[3].serv_id = NULL; \
- clazz[3].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#define FT_DEFINE_SERVICEDESCREC4( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class ) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = serv_id_3; \
- clazz[2].serv_data = serv_data_3; \
- clazz[3].serv_id = serv_id_4; \
- clazz[3].serv_data = serv_data_4; \
- clazz[4].serv_id = NULL; \
- clazz[4].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#define FT_DEFINE_SERVICEDESCREC5( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class ) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = serv_id_3; \
- clazz[2].serv_data = serv_data_3; \
- clazz[3].serv_id = serv_id_4; \
- clazz[3].serv_data = serv_data_4; \
- clazz[4].serv_id = serv_id_5; \
- clazz[4].serv_data = serv_data_5; \
- clazz[5].serv_id = NULL; \
- clazz[5].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#define FT_DEFINE_SERVICEDESCREC6( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5, \
- serv_id_6, serv_data_6 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = serv_id_3; \
- clazz[2].serv_data = serv_data_3; \
- clazz[3].serv_id = serv_id_4; \
- clazz[3].serv_data = serv_data_4; \
- clazz[4].serv_id = serv_id_5; \
- clazz[4].serv_data = serv_data_5; \
- clazz[5].serv_id = serv_id_6; \
- clazz[5].serv_data = serv_data_6; \
- clazz[6].serv_id = NULL; \
- clazz[6].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#define FT_DEFINE_SERVICEDESCREC7( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5, \
- serv_id_6, serv_data_6, \
- serv_id_7, serv_data_7 ) \
- void \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec* clazz ) \
- { \
- FT_Memory memory = library->memory; \
- \
- \
- if ( clazz ) \
- FT_FREE( clazz ); \
- } \
- \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class) \
- { \
- FT_ServiceDescRec* clazz = NULL; \
- FT_Error error; \
- FT_Memory memory = library->memory; \
- \
- \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
- return error; \
- \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = serv_id_3; \
- clazz[2].serv_data = serv_data_3; \
- clazz[3].serv_id = serv_id_4; \
- clazz[3].serv_data = serv_data_4; \
- clazz[4].serv_id = serv_id_5; \
- clazz[4].serv_data = serv_data_5; \
- clazz[5].serv_id = serv_id_6; \
- clazz[5].serv_data = serv_data_6; \
- clazz[6].serv_id = serv_id_7; \
- clazz[6].serv_data = serv_data_7; \
- clazz[7].serv_id = NULL; \
- clazz[7].serv_data = NULL; \
- \
- *output_class = clazz; \
- \
- return FT_Err_Ok; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-
- /*
- * Parse a list of FT_ServiceDescRec descriptors and look for
- * a specific service by ID. Note that the last element in the
- * array must be { NULL, NULL }, and that the function should
- * return NULL if the service isn't available.
- *
- * This function can be used by modules to implement their
- * `get_service' method.
- */
- FT_BASE( FT_Pointer )
- ft_service_list_lookup( FT_ServiceDesc service_descriptors,
- const char* service_id );
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** S E R V I C E S C A C H E *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*
- * This structure is used to store a cache for several frequently used
- * services. It is the type of `face->internal->services'. You
- * should only use FT_FACE_LOOKUP_SERVICE to access it.
- *
- * All fields should have the type FT_Pointer to relax compilation
- * dependencies. We assume the developer isn't completely stupid.
- *
- * Each field must be named `service_XXXX' where `XXX' corresponds to
- * the correct FT_SERVICE_ID_XXXX macro. See the definition of
- * FT_FACE_LOOKUP_SERVICE below how this is implemented.
- *
- */
- typedef struct FT_ServiceCacheRec_
- {
- FT_Pointer service_POSTSCRIPT_FONT_NAME;
- FT_Pointer service_MULTI_MASTERS;
- FT_Pointer service_GLYPH_DICT;
- FT_Pointer service_PFR_METRICS;
- FT_Pointer service_WINFNT;
-
- } FT_ServiceCacheRec, *FT_ServiceCache;
-
-
- /*
- * A magic number used within the services cache.
- */
-
- /* ensure that value `1' has the same width as a pointer */
-#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
-
-
- /*
- * @macro:
- * FT_FACE_LOOKUP_SERVICE
- *
- * @description:
- * This macro is used to lookup a service from a face's driver module
- * using its cache.
- *
- * @input:
- * face::
- * The source face handle containing the cache.
- *
- * field ::
- * The field name in the cache.
- *
- * id ::
- * The service ID.
- *
- * @output:
- * ptr ::
- * A variable receiving the service data. NULL if not available.
- */
-#ifdef __cplusplus
-
-#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Pointer svc; \
- FT_Pointer* Pptr = (FT_Pointer*)&(ptr); \
- \
- \
- svc = FT_FACE( face )->internal->services. service_ ## id; \
- if ( svc == FT_SERVICE_UNAVAILABLE ) \
- svc = NULL; \
- else if ( svc == NULL ) \
- { \
- FT_FACE_FIND_SERVICE( face, svc, id ); \
- \
- FT_FACE( face )->internal->services. service_ ## id = \
- (FT_Pointer)( svc != NULL ? svc \
- : FT_SERVICE_UNAVAILABLE ); \
- } \
- *Pptr = svc; \
- FT_END_STMNT
-
-#else /* !C++ */
-
-#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
- FT_BEGIN_STMNT \
- FT_Pointer svc; \
- \
- \
- svc = FT_FACE( face )->internal->services. service_ ## id; \
- if ( svc == FT_SERVICE_UNAVAILABLE ) \
- svc = NULL; \
- else if ( svc == NULL ) \
- { \
- FT_FACE_FIND_SERVICE( face, svc, id ); \
- \
- FT_FACE( face )->internal->services. service_ ## id = \
- (FT_Pointer)( svc != NULL ? svc \
- : FT_SERVICE_UNAVAILABLE ); \
- } \
- ptr = svc; \
- FT_END_STMNT
-
-#endif /* !C++ */
-
- /*
- * A macro used to define new service structure types.
- */
-
-#define FT_DEFINE_SERVICE( name ) \
- typedef struct FT_Service_ ## name ## Rec_ \
- FT_Service_ ## name ## Rec ; \
- typedef struct FT_Service_ ## name ## Rec_ \
- const * FT_Service_ ## name ; \
- struct FT_Service_ ## name ## Rec_
-
- /* */
-
- /*
- * The header files containing the services.
- */
-
-#define FT_SERVICE_BDF_H <internal/services/svbdf.h>
-#define FT_SERVICE_CID_H <internal/services/svcid.h>
-#define FT_SERVICE_GLYPH_DICT_H <internal/services/svgldict.h>
-#define FT_SERVICE_GX_VALIDATE_H <internal/services/svgxval.h>
-#define FT_SERVICE_KERNING_H <internal/services/svkern.h>
-#define FT_SERVICE_MULTIPLE_MASTERS_H <internal/services/svmm.h>
-#define FT_SERVICE_OPENTYPE_VALIDATE_H <internal/services/svotval.h>
-#define FT_SERVICE_PFR_H <internal/services/svpfr.h>
-#define FT_SERVICE_POSTSCRIPT_CMAPS_H <internal/services/svpscmap.h>
-#define FT_SERVICE_POSTSCRIPT_INFO_H <internal/services/svpsinfo.h>
-#define FT_SERVICE_POSTSCRIPT_NAME_H <internal/services/svpostnm.h>
-#define FT_SERVICE_PROPERTIES_H <internal/services/svprop.h>
-#define FT_SERVICE_SFNT_H <internal/services/svsfnt.h>
-#define FT_SERVICE_TRUETYPE_ENGINE_H <internal/services/svtteng.h>
-#define FT_SERVICE_TT_CMAP_H <internal/services/svttcmap.h>
-#define FT_SERVICE_WINFNT_H <internal/services/svwinfnt.h>
-#define FT_SERVICE_XFREE86_NAME_H <internal/services/svxf86nm.h>
-#define FT_SERVICE_TRUETYPE_GLYF_H <internal/services/svttglyf.h>
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FTSERV_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftstream.h b/src/3rdparty/freetype/include/internal/ftstream.h
deleted file mode 100644
index 2661858320..0000000000
--- a/src/3rdparty/freetype/include/internal/ftstream.h
+++ /dev/null
@@ -1,536 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftstream.h */
-/* */
-/* Stream handling (specification). */
-/* */
-/* Copyright 1996-2002, 2004-2006, 2011, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTSTREAM_H__
-#define __FTSTREAM_H__
-
-
-#include <ft2build.h>
-#include FT_SYSTEM_H
-#include FT_INTERNAL_OBJECTS_H
-
-
-FT_BEGIN_HEADER
-
-
- /* format of an 8-bit frame_op value: */
- /* */
- /* bit 76543210 */
- /* xxxxxxes */
- /* */
- /* s is set to 1 if the value is signed. */
- /* e is set to 1 if the value is little-endian. */
- /* xxx is a command. */
-
-#define FT_FRAME_OP_SHIFT 2
-#define FT_FRAME_OP_SIGNED 1
-#define FT_FRAME_OP_LITTLE 2
-#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
-
-#define FT_MAKE_FRAME_OP( command, little, sign ) \
- ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
-
-#define FT_FRAME_OP_END 0
-#define FT_FRAME_OP_START 1 /* start a new frame */
-#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
-#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
-#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
-#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
-#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
-
-
- typedef enum FT_Frame_Op_
- {
- ft_frame_end = 0,
- ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
-
- ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
- ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
-
- ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
- ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
- ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
- ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
-
- ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
- ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
- ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
- ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
-
- ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
- ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
- ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
- ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
-
- ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
- ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
-
- } FT_Frame_Op;
-
-
- typedef struct FT_Frame_Field_
- {
- FT_Byte value;
- FT_Byte size;
- FT_UShort offset;
-
- } FT_Frame_Field;
-
-
- /* Construct an FT_Frame_Field out of a structure type and a field name. */
- /* The structure type must be set in the FT_STRUCTURE macro before */
- /* calling the FT_FRAME_START() macro. */
- /* */
-#define FT_FIELD_SIZE( f ) \
- (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
-
-#define FT_FIELD_SIZE_DELTA( f ) \
- (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
-
-#define FT_FIELD_OFFSET( f ) \
- (FT_UShort)( offsetof( FT_STRUCTURE, f ) )
-
-#define FT_FRAME_FIELD( frame_op, field ) \
- { \
- frame_op, \
- FT_FIELD_SIZE( field ), \
- FT_FIELD_OFFSET( field ) \
- }
-
-#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
-
-#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
-#define FT_FRAME_END { ft_frame_end, 0, 0 }
-
-#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
-#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
-#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
-#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
-#define FT_FRAME_OFF3( f ) FT_FRAME_FIELD( ft_frame_off3_be, f )
-#define FT_FRAME_UOFF3( f ) FT_FRAME_FIELD( ft_frame_uoff3_be, f )
-#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
-#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
-
-#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
-#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
-#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
-#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
-#define FT_FRAME_OFF3_LE( f ) FT_FRAME_FIELD( ft_frame_off3_le, f )
-#define FT_FRAME_UOFF3_LE( f ) FT_FRAME_FIELD( ft_frame_uoff3_le, f )
-
-#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
-#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
-#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
-
-#define FT_FRAME_BYTES( field, count ) \
- { \
- ft_frame_bytes, \
- count, \
- FT_FIELD_OFFSET( field ) \
- }
-
-#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
-
-
- /*************************************************************************/
- /* */
- /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
- /* type `char*' or equivalent (1-byte elements). */
- /* */
-
-#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
-
-#define FT_INT16( x ) ( (FT_Int16)(x) )
-#define FT_UINT16( x ) ( (FT_UInt16)(x) )
-#define FT_INT32( x ) ( (FT_Int32)(x) )
-#define FT_UINT32( x ) ( (FT_UInt32)(x) )
-
-
-#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
-#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
-
-
-#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
- FT_BYTE_U16( p, 1, 0) )
-
-#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
- FT_BYTE_U16( p, 1, 0 ) )
-
-#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
- FT_BYTE_U32( p, 1, 16 ) | \
- FT_BYTE_U32( p, 2, 8 ) | \
- FT_BYTE_U32( p, 3, 0 ) )
-
-#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
- FT_BYTE_U32( p, 1, 16 ) | \
- FT_BYTE_U32( p, 2, 8 ) | \
- FT_BYTE_U32( p, 3, 0 ) )
-
-#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 2, 0 ) )
-
-#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 2, 0 ) )
-
-#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
- FT_BYTE_U16( p, 0, 0 ) )
-
-#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
- FT_BYTE_U16( p, 0, 0 ) )
-
-#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
- FT_BYTE_U32( p, 2, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 0, 0 ) )
-
-#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
- FT_BYTE_U32( p, 2, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 0, 0 ) )
-
-#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 0, 0 ) )
-
-#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 0, 0 ) )
-
-
-#define FT_NEXT_CHAR( buffer ) \
- ( (signed char)*buffer++ )
-
-#define FT_NEXT_BYTE( buffer ) \
- ( (unsigned char)*buffer++ )
-
-#define FT_NEXT_SHORT( buffer ) \
- ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
-
-#define FT_NEXT_USHORT( buffer ) \
- ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
-
-#define FT_NEXT_OFF3( buffer ) \
- ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
-
-#define FT_NEXT_UOFF3( buffer ) \
- ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
-
-#define FT_NEXT_LONG( buffer ) \
- ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
-
-#define FT_NEXT_ULONG( buffer ) \
- ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
-
-
-#define FT_NEXT_SHORT_LE( buffer ) \
- ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
-
-#define FT_NEXT_USHORT_LE( buffer ) \
- ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
-
-#define FT_NEXT_OFF3_LE( buffer ) \
- ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
-
-#define FT_NEXT_UOFF3_LE( buffer ) \
- ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
-
-#define FT_NEXT_LONG_LE( buffer ) \
- ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
-
-#define FT_NEXT_ULONG_LE( buffer ) \
- ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
-
-
- /*************************************************************************/
- /* */
- /* Each GET_xxxx() macro uses an implicit `stream' variable. */
- /* */
-#if 0
-#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
-
-#define FT_GET_CHAR() FT_GET_MACRO( CHAR )
-#define FT_GET_BYTE() FT_GET_MACRO( BYTE )
-#define FT_GET_SHORT() FT_GET_MACRO( SHORT )
-#define FT_GET_USHORT() FT_GET_MACRO( USHORT )
-#define FT_GET_OFF3() FT_GET_MACRO( OFF3 )
-#define FT_GET_UOFF3() FT_GET_MACRO( UOFF3 )
-#define FT_GET_LONG() FT_GET_MACRO( LONG )
-#define FT_GET_ULONG() FT_GET_MACRO( ULONG )
-#define FT_GET_TAG4() FT_GET_MACRO( ULONG )
-
-#define FT_GET_SHORT_LE() FT_GET_MACRO( SHORT_LE )
-#define FT_GET_USHORT_LE() FT_GET_MACRO( USHORT_LE )
-#define FT_GET_LONG_LE() FT_GET_MACRO( LONG_LE )
-#define FT_GET_ULONG_LE() FT_GET_MACRO( ULONG_LE )
-
-#else
-#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
-
-#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
-#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
-#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
-#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
-#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
-#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
-#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
-#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
-#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
-
-#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
-#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
-#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
-#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
-#endif
-
-#define FT_READ_MACRO( func, type, var ) \
- ( var = (type)func( stream, &error ), \
- error != FT_Err_Ok )
-
-#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
-#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
-#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
-#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
-#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
-#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
-#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
-#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
-
-#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
-#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
-#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
-#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
-
-
-#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
-
- /* initialize a stream for reading a regular system stream */
- FT_BASE( FT_Error )
- FT_Stream_Open( FT_Stream stream,
- const char* filepathname );
-
-#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
-
-
- /* create a new (input) stream from an FT_Open_Args structure */
- FT_BASE( FT_Error )
- FT_Stream_New( FT_Library library,
- const FT_Open_Args* args,
- FT_Stream *astream );
-
- /* free a stream */
- FT_BASE( void )
- FT_Stream_Free( FT_Stream stream,
- FT_Int external );
-
- /* initialize a stream for reading in-memory data */
- FT_BASE( void )
- FT_Stream_OpenMemory( FT_Stream stream,
- const FT_Byte* base,
- FT_ULong size );
-
- /* close a stream (does not destroy the stream structure) */
- FT_BASE( void )
- FT_Stream_Close( FT_Stream stream );
-
-
- /* seek within a stream. position is relative to start of stream */
- FT_BASE( FT_Error )
- FT_Stream_Seek( FT_Stream stream,
- FT_ULong pos );
-
- /* skip bytes in a stream */
- FT_BASE( FT_Error )
- FT_Stream_Skip( FT_Stream stream,
- FT_Long distance );
-
- /* return current stream position */
- FT_BASE( FT_Long )
- FT_Stream_Pos( FT_Stream stream );
-
- /* read bytes from a stream into a user-allocated buffer, returns an */
- /* error if not all bytes could be read. */
- FT_BASE( FT_Error )
- FT_Stream_Read( FT_Stream stream,
- FT_Byte* buffer,
- FT_ULong count );
-
- /* read bytes from a stream at a given position */
- FT_BASE( FT_Error )
- FT_Stream_ReadAt( FT_Stream stream,
- FT_ULong pos,
- FT_Byte* buffer,
- FT_ULong count );
-
- /* try to read bytes at the end of a stream; return number of bytes */
- /* really available */
- FT_BASE( FT_ULong )
- FT_Stream_TryRead( FT_Stream stream,
- FT_Byte* buffer,
- FT_ULong count );
-
- /* Enter a frame of `count' consecutive bytes in a stream. Returns an */
- /* error if the frame could not be read/accessed. The caller can use */
- /* the FT_Stream_Get_XXX functions to retrieve frame data without */
- /* error checks. */
- /* */
- /* You must _always_ call FT_Stream_ExitFrame() once you have entered */
- /* a stream frame! */
- /* */
- FT_BASE( FT_Error )
- FT_Stream_EnterFrame( FT_Stream stream,
- FT_ULong count );
-
- /* exit a stream frame */
- FT_BASE( void )
- FT_Stream_ExitFrame( FT_Stream stream );
-
- /* Extract a stream frame. If the stream is disk-based, a heap block */
- /* is allocated and the frame bytes are read into it. If the stream */
- /* is memory-based, this function simply set a pointer to the data. */
- /* */
- /* Useful to optimize access to memory-based streams transparently. */
- /* */
- /* All extracted frames must be `freed' with a call to the function */
- /* FT_Stream_ReleaseFrame(). */
- /* */
- FT_BASE( FT_Error )
- FT_Stream_ExtractFrame( FT_Stream stream,
- FT_ULong count,
- FT_Byte** pbytes );
-
- /* release an extract frame (see FT_Stream_ExtractFrame) */
- FT_BASE( void )
- FT_Stream_ReleaseFrame( FT_Stream stream,
- FT_Byte** pbytes );
-
- /* read a byte from an entered frame */
- FT_BASE( FT_Char )
- FT_Stream_GetChar( FT_Stream stream );
-
- /* read a 16-bit big-endian unsigned integer from an entered frame */
- FT_BASE( FT_UShort )
- FT_Stream_GetUShort( FT_Stream stream );
-
- /* read a 24-bit big-endian unsigned integer from an entered frame */
- FT_BASE( FT_ULong )
- FT_Stream_GetUOffset( FT_Stream stream );
-
- /* read a 32-bit big-endian unsigned integer from an entered frame */
- FT_BASE( FT_ULong )
- FT_Stream_GetULong( FT_Stream stream );
-
- /* read a 16-bit little-endian unsigned integer from an entered frame */
- FT_BASE( FT_UShort )
- FT_Stream_GetUShortLE( FT_Stream stream );
-
- /* read a 32-bit little-endian unsigned integer from an entered frame */
- FT_BASE( FT_ULong )
- FT_Stream_GetULongLE( FT_Stream stream );
-
-
- /* read a byte from a stream */
- FT_BASE( FT_Char )
- FT_Stream_ReadChar( FT_Stream stream,
- FT_Error* error );
-
- /* read a 16-bit big-endian unsigned integer from a stream */
- FT_BASE( FT_UShort )
- FT_Stream_ReadUShort( FT_Stream stream,
- FT_Error* error );
-
- /* read a 24-bit big-endian unsigned integer from a stream */
- FT_BASE( FT_ULong )
- FT_Stream_ReadUOffset( FT_Stream stream,
- FT_Error* error );
-
- /* read a 32-bit big-endian integer from a stream */
- FT_BASE( FT_ULong )
- FT_Stream_ReadULong( FT_Stream stream,
- FT_Error* error );
-
- /* read a 16-bit little-endian unsigned integer from a stream */
- FT_BASE( FT_UShort )
- FT_Stream_ReadUShortLE( FT_Stream stream,
- FT_Error* error );
-
- /* read a 32-bit little-endian unsigned integer from a stream */
- FT_BASE( FT_ULong )
- FT_Stream_ReadULongLE( FT_Stream stream,
- FT_Error* error );
-
- /* Read a structure from a stream. The structure must be described */
- /* by an array of FT_Frame_Field records. */
- FT_BASE( FT_Error )
- FT_Stream_ReadFields( FT_Stream stream,
- const FT_Frame_Field* fields,
- void* structure );
-
-
-#define FT_STREAM_POS() \
- FT_Stream_Pos( stream )
-
-#define FT_STREAM_SEEK( position ) \
- FT_SET_ERROR( FT_Stream_Seek( stream, \
- (FT_ULong)(position) ) )
-
-#define FT_STREAM_SKIP( distance ) \
- FT_SET_ERROR( FT_Stream_Skip( stream, \
- (FT_Long)(distance) ) )
-
-#define FT_STREAM_READ( buffer, count ) \
- FT_SET_ERROR( FT_Stream_Read( stream, \
- (FT_Byte*)(buffer), \
- (FT_ULong)(count) ) )
-
-#define FT_STREAM_READ_AT( position, buffer, count ) \
- FT_SET_ERROR( FT_Stream_ReadAt( stream, \
- (FT_ULong)(position), \
- (FT_Byte*)buffer, \
- (FT_ULong)(count) ) )
-
-#define FT_STREAM_READ_FIELDS( fields, object ) \
- FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
-
-
-#define FT_FRAME_ENTER( size ) \
- FT_SET_ERROR( \
- FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
- (FT_ULong)(size) ) ) )
-
-#define FT_FRAME_EXIT() \
- FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
-
-#define FT_FRAME_EXTRACT( size, bytes ) \
- FT_SET_ERROR( \
- FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
- (FT_ULong)(size), \
- (FT_Byte**)&(bytes) ) ) )
-
-#define FT_FRAME_RELEASE( bytes ) \
- FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
- (FT_Byte**)&(bytes) ) )
-
-
-FT_END_HEADER
-
-#endif /* __FTSTREAM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/fttrace.h b/src/3rdparty/freetype/include/internal/fttrace.h
deleted file mode 100644
index d5253db78a..0000000000
--- a/src/3rdparty/freetype/include/internal/fttrace.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/***************************************************************************/
-/* */
-/* fttrace.h */
-/* */
-/* Tracing handling (specification only). */
-/* */
-/* Copyright 2002, 2004-2007, 2009, 2011-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /* definitions of trace levels for FreeType 2 */
-
- /* the first level must always be `trace_any' */
-FT_TRACE_DEF( any )
-
- /* base components */
-FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
-FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
-FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
-FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
-FT_TRACE_DEF( list ) /* list management (ftlist.c) */
-FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
-FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
-FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
-FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
-FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
-
-FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
-FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
-FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
-FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
-FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
-FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
-
- /* Cache sub-system */
-FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
-
- /* SFNT driver components */
-FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
-FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
-FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
-FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
-FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
-FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
-FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
-FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
-FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
-
- /* TrueType driver components */
-FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
-FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
-FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
-FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
-FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
-FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
-
- /* Type 1 driver components */
-FT_TRACE_DEF( t1afm )
-FT_TRACE_DEF( t1driver )
-FT_TRACE_DEF( t1gload )
-FT_TRACE_DEF( t1hint )
-FT_TRACE_DEF( t1load )
-FT_TRACE_DEF( t1objs )
-FT_TRACE_DEF( t1parse )
-
- /* PostScript helper module `psaux' */
-FT_TRACE_DEF( t1decode )
-FT_TRACE_DEF( psobjs )
-FT_TRACE_DEF( psconv )
-
- /* PostScript hinting module `pshinter' */
-FT_TRACE_DEF( pshrec )
-FT_TRACE_DEF( pshalgo1 )
-FT_TRACE_DEF( pshalgo2 )
-
- /* Type 2 driver components */
-FT_TRACE_DEF( cffdriver )
-FT_TRACE_DEF( cffgload )
-FT_TRACE_DEF( cffload )
-FT_TRACE_DEF( cffobjs )
-FT_TRACE_DEF( cffparse )
-
-FT_TRACE_DEF( cf2blues )
-FT_TRACE_DEF( cf2hints )
-FT_TRACE_DEF( cf2interp )
-
- /* Type 42 driver component */
-FT_TRACE_DEF( t42 )
-
- /* CID driver components */
-FT_TRACE_DEF( cidafm )
-FT_TRACE_DEF( ciddriver )
-FT_TRACE_DEF( cidgload )
-FT_TRACE_DEF( cidload )
-FT_TRACE_DEF( cidobjs )
-FT_TRACE_DEF( cidparse )
-
- /* Windows font component */
-FT_TRACE_DEF( winfnt )
-
- /* PCF font components */
-FT_TRACE_DEF( pcfdriver )
-FT_TRACE_DEF( pcfread )
-
- /* BDF font components */
-FT_TRACE_DEF( bdfdriver )
-FT_TRACE_DEF( bdflib )
-
- /* PFR font component */
-FT_TRACE_DEF( pfr )
-
- /* OpenType validation components */
-FT_TRACE_DEF( otvmodule )
-FT_TRACE_DEF( otvcommon )
-FT_TRACE_DEF( otvbase )
-FT_TRACE_DEF( otvgdef )
-FT_TRACE_DEF( otvgpos )
-FT_TRACE_DEF( otvgsub )
-FT_TRACE_DEF( otvjstf )
-FT_TRACE_DEF( otvmath )
-
- /* TrueTypeGX/AAT validation components */
-FT_TRACE_DEF( gxvmodule )
-FT_TRACE_DEF( gxvcommon )
-FT_TRACE_DEF( gxvfeat )
-FT_TRACE_DEF( gxvmort )
-FT_TRACE_DEF( gxvmorx )
-FT_TRACE_DEF( gxvbsln )
-FT_TRACE_DEF( gxvjust )
-FT_TRACE_DEF( gxvkern )
-FT_TRACE_DEF( gxvopbd )
-FT_TRACE_DEF( gxvtrak )
-FT_TRACE_DEF( gxvprop )
-FT_TRACE_DEF( gxvlcar )
-
- /* autofit components */
-FT_TRACE_DEF( afmodule )
-FT_TRACE_DEF( afhints )
-FT_TRACE_DEF( afcjk )
-FT_TRACE_DEF( aflatin )
-FT_TRACE_DEF( aflatin2 )
-FT_TRACE_DEF( afwarp )
-FT_TRACE_DEF( afharfbuzz )
-FT_TRACE_DEF( afglobal )
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/ftvalid.h b/src/3rdparty/freetype/include/internal/ftvalid.h
deleted file mode 100644
index c281b1424a..0000000000
--- a/src/3rdparty/freetype/include/internal/ftvalid.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftvalid.h */
-/* */
-/* FreeType validation support (specification). */
-/* */
-/* Copyright 2004, 2013, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTVALID_H__
-#define __FTVALID_H__
-
-#include <ft2build.h>
-#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** V A L I D A T I O N ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /* handle to a validation object */
- typedef struct FT_ValidatorRec_ volatile* FT_Validator;
-
-
- /*************************************************************************/
- /* */
- /* There are three distinct validation levels defined here: */
- /* */
- /* FT_VALIDATE_DEFAULT :: */
- /* A table that passes this validation level can be used reliably by */
- /* FreeType. It generally means that all offsets have been checked to */
- /* prevent out-of-bound reads, that array counts are correct, etc. */
- /* */
- /* FT_VALIDATE_TIGHT :: */
- /* A table that passes this validation level can be used reliably and */
- /* doesn't contain invalid data. For example, a charmap table that */
- /* returns invalid glyph indices will not pass, even though it can */
- /* be used with FreeType in default mode (the library will simply */
- /* return an error later when trying to load the glyph). */
- /* */
- /* It also checks that fields which must be a multiple of 2, 4, or 8, */
- /* don't have incorrect values, etc. */
- /* */
- /* FT_VALIDATE_PARANOID :: */
- /* Only for font debugging. Checks that a table follows the */
- /* specification by 100%. Very few fonts will be able to pass this */
- /* level anyway but it can be useful for certain tools like font */
- /* editors/converters. */
- /* */
- typedef enum FT_ValidationLevel_
- {
- FT_VALIDATE_DEFAULT = 0,
- FT_VALIDATE_TIGHT,
- FT_VALIDATE_PARANOID
-
- } FT_ValidationLevel;
-
-
-#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
- /* We disable the warning `structure was padded due to */
- /* __declspec(align())' in order to compile cleanly with */
- /* the maximum level of warnings. */
-#pragma warning( push )
-#pragma warning( disable : 4324 )
-#endif /* _MSC_VER */
-
- /* validator structure */
- typedef struct FT_ValidatorRec_
- {
- ft_jmp_buf jump_buffer; /* used for exception handling */
-
- const FT_Byte* base; /* address of table in memory */
- const FT_Byte* limit; /* `base' + sizeof(table) in memory */
- FT_ValidationLevel level; /* validation level */
- FT_Error error; /* error returned. 0 means success */
-
- } FT_ValidatorRec;
-
-#if defined( _MSC_VER )
-#pragma warning( pop )
-#endif
-
-#define FT_VALIDATOR( x ) ( (FT_Validator)( x ) )
-
-
- FT_BASE( void )
- ft_validator_init( FT_Validator valid,
- const FT_Byte* base,
- const FT_Byte* limit,
- FT_ValidationLevel level );
-
- /* Do not use this. It's broken and will cause your validator to crash */
- /* if you run it on an invalid font. */
- FT_BASE( FT_Int )
- ft_validator_run( FT_Validator valid );
-
- /* Sets the error field in a validator, then calls `longjmp' to return */
- /* to high-level caller. Using `setjmp/longjmp' avoids many stupid */
- /* error checks within the validation routines. */
- /* */
- FT_BASE( void )
- ft_validator_error( FT_Validator valid,
- FT_Error error );
-
-
- /* Calls ft_validate_error. Assumes that the `valid' local variable */
- /* holds a pointer to the current validator object. */
- /* */
-#define FT_INVALID( _error ) FT_INVALID_( _error )
-#define FT_INVALID_( _error ) \
- ft_validator_error( valid, FT_THROW( _error ) )
-
- /* called when a broken table is detected */
-#define FT_INVALID_TOO_SHORT \
- FT_INVALID( Invalid_Table )
-
- /* called when an invalid offset is detected */
-#define FT_INVALID_OFFSET \
- FT_INVALID( Invalid_Offset )
-
- /* called when an invalid format/value is detected */
-#define FT_INVALID_FORMAT \
- FT_INVALID( Invalid_Table )
-
- /* called when an invalid glyph index is detected */
-#define FT_INVALID_GLYPH_ID \
- FT_INVALID( Invalid_Glyph_Index )
-
- /* called when an invalid field value is detected */
-#define FT_INVALID_DATA \
- FT_INVALID( Invalid_Table )
-
-
-FT_END_HEADER
-
-#endif /* __FTVALID_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/internal.h b/src/3rdparty/freetype/include/internal/internal.h
deleted file mode 100644
index e0ddb06b70..0000000000
--- a/src/3rdparty/freetype/include/internal/internal.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************/
-/* */
-/* internal.h */
-/* */
-/* Internal header files (specification only). */
-/* */
-/* Copyright 1996-2004, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This file is automatically included by `ft2build.h'. */
- /* Do not include it manually! */
- /* */
- /*************************************************************************/
-
-
-#define FT_INTERNAL_OBJECTS_H <internal/ftobjs.h>
-#define FT_INTERNAL_PIC_H <internal/ftpic.h>
-#define FT_INTERNAL_STREAM_H <internal/ftstream.h>
-#define FT_INTERNAL_MEMORY_H <internal/ftmemory.h>
-#define FT_INTERNAL_DEBUG_H <internal/ftdebug.h>
-#define FT_INTERNAL_CALC_H <internal/ftcalc.h>
-#define FT_INTERNAL_DRIVER_H <internal/ftdriver.h>
-#define FT_INTERNAL_TRACE_H <internal/fttrace.h>
-#define FT_INTERNAL_GLYPH_LOADER_H <internal/ftgloadr.h>
-#define FT_INTERNAL_SFNT_H <internal/sfnt.h>
-#define FT_INTERNAL_SERVICE_H <internal/ftserv.h>
-#define FT_INTERNAL_RFORK_H <internal/ftrfork.h>
-#define FT_INTERNAL_VALIDATE_H <internal/ftvalid.h>
-
-#define FT_INTERNAL_TRUETYPE_TYPES_H <internal/tttypes.h>
-#define FT_INTERNAL_TYPE1_TYPES_H <internal/t1types.h>
-
-#define FT_INTERNAL_POSTSCRIPT_AUX_H <internal/psaux.h>
-#define FT_INTERNAL_POSTSCRIPT_HINTS_H <internal/pshints.h>
-#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <internal/psglobal.h>
-
-#define FT_INTERNAL_AUTOHINT_H <internal/autohint.h>
-
-
-#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
-
- /* We disable the warning `conditional expression is constant' here */
- /* in order to compile cleanly with the maximum level of warnings. */
- /* In particular, the warning complains about stuff like `while(0)' */
- /* which is very useful in macro definitions. There is no benefit */
- /* in having it enabled. */
-#pragma warning( disable : 4127 )
-
-#endif /* _MSC_VER */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/psaux.h b/src/3rdparty/freetype/include/internal/psaux.h
deleted file mode 100644
index e903114f84..0000000000
--- a/src/3rdparty/freetype/include/internal/psaux.h
+++ /dev/null
@@ -1,877 +0,0 @@
-/***************************************************************************/
-/* */
-/* psaux.h */
-/* */
-/* Auxiliary functions and data structures related to PostScript fonts */
-/* (specification). */
-/* */
-/* Copyright 1996-2004, 2006, 2008, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __PSAUX_H__
-#define __PSAUX_H__
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_OBJECTS_H
-#include FT_INTERNAL_TYPE1_TYPES_H
-#include FT_SERVICE_POSTSCRIPT_CMAPS_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** T1_TABLE *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- typedef struct PS_TableRec_* PS_Table;
- typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_Table_FuncsRec */
- /* */
- /* <Description> */
- /* A set of function pointers to manage PS_Table objects. */
- /* */
- /* <Fields> */
- /* table_init :: Used to initialize a table. */
- /* */
- /* table_done :: Finalizes resp. destroy a given table. */
- /* */
- /* table_add :: Adds a new object to a table. */
- /* */
- /* table_release :: Releases table data, then finalizes it. */
- /* */
- typedef struct PS_Table_FuncsRec_
- {
- FT_Error
- (*init)( PS_Table table,
- FT_Int count,
- FT_Memory memory );
-
- void
- (*done)( PS_Table table );
-
- FT_Error
- (*add)( PS_Table table,
- FT_Int idx,
- void* object,
- FT_PtrDist length );
-
- void
- (*release)( PS_Table table );
-
- } PS_Table_FuncsRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_TableRec */
- /* */
- /* <Description> */
- /* A PS_Table is a simple object used to store an array of objects in */
- /* a single memory block. */
- /* */
- /* <Fields> */
- /* block :: The address in memory of the growheap's block. This */
- /* can change between two object adds, due to */
- /* reallocation. */
- /* */
- /* cursor :: The current top of the grow heap within its block. */
- /* */
- /* capacity :: The current size of the heap block. Increments by */
- /* 1kByte chunks. */
- /* */
- /* init :: Set to 0xDEADBEEF if `elements' and `lengths' have */
- /* been allocated. */
- /* */
- /* max_elems :: The maximum number of elements in table. */
- /* */
- /* num_elems :: The current number of elements in table. */
- /* */
- /* elements :: A table of element addresses within the block. */
- /* */
- /* lengths :: A table of element sizes within the block. */
- /* */
- /* memory :: The object used for memory operations */
- /* (alloc/realloc). */
- /* */
- /* funcs :: A table of method pointers for this object. */
- /* */
- typedef struct PS_TableRec_
- {
- FT_Byte* block; /* current memory block */
- FT_Offset cursor; /* current cursor in memory block */
- FT_Offset capacity; /* current size of memory block */
- FT_Long init;
-
- FT_Int max_elems;
- FT_Int num_elems;
- FT_Byte** elements; /* addresses of table elements */
- FT_PtrDist* lengths; /* lengths of table elements */
-
- FT_Memory memory;
- PS_Table_FuncsRec funcs;
-
- } PS_TableRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** T1 FIELDS & TOKENS *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef struct PS_ParserRec_* PS_Parser;
-
- typedef struct T1_TokenRec_* T1_Token;
-
- typedef struct T1_FieldRec_* T1_Field;
-
-
- /* simple enumeration type used to identify token types */
- typedef enum T1_TokenType_
- {
- T1_TOKEN_TYPE_NONE = 0,
- T1_TOKEN_TYPE_ANY,
- T1_TOKEN_TYPE_STRING,
- T1_TOKEN_TYPE_ARRAY,
- T1_TOKEN_TYPE_KEY, /* aka `name' */
-
- /* do not remove */
- T1_TOKEN_TYPE_MAX
-
- } T1_TokenType;
-
-
- /* a simple structure used to identify tokens */
- typedef struct T1_TokenRec_
- {
- FT_Byte* start; /* first character of token in input stream */
- FT_Byte* limit; /* first character after the token */
- T1_TokenType type; /* type of token */
-
- } T1_TokenRec;
-
-
- /* enumeration type used to identify object fields */
- typedef enum T1_FieldType_
- {
- T1_FIELD_TYPE_NONE = 0,
- T1_FIELD_TYPE_BOOL,
- T1_FIELD_TYPE_INTEGER,
- T1_FIELD_TYPE_FIXED,
- T1_FIELD_TYPE_FIXED_1000,
- T1_FIELD_TYPE_STRING,
- T1_FIELD_TYPE_KEY,
- T1_FIELD_TYPE_BBOX,
- T1_FIELD_TYPE_MM_BBOX,
- T1_FIELD_TYPE_INTEGER_ARRAY,
- T1_FIELD_TYPE_FIXED_ARRAY,
- T1_FIELD_TYPE_CALLBACK,
-
- /* do not remove */
- T1_FIELD_TYPE_MAX
-
- } T1_FieldType;
-
-
- typedef enum T1_FieldLocation_
- {
- T1_FIELD_LOCATION_CID_INFO,
- T1_FIELD_LOCATION_FONT_DICT,
- T1_FIELD_LOCATION_FONT_EXTRA,
- T1_FIELD_LOCATION_FONT_INFO,
- T1_FIELD_LOCATION_PRIVATE,
- T1_FIELD_LOCATION_BBOX,
- T1_FIELD_LOCATION_LOADER,
- T1_FIELD_LOCATION_FACE,
- T1_FIELD_LOCATION_BLEND,
-
- /* do not remove */
- T1_FIELD_LOCATION_MAX
-
- } T1_FieldLocation;
-
-
- typedef void
- (*T1_Field_ParseFunc)( FT_Face face,
- FT_Pointer parser );
-
-
- /* structure type used to model object fields */
- typedef struct T1_FieldRec_
- {
- const char* ident; /* field identifier */
- T1_FieldLocation location;
- T1_FieldType type; /* type of field */
- T1_Field_ParseFunc reader;
- FT_UInt offset; /* offset of field in object */
- FT_Byte size; /* size of field in bytes */
- FT_UInt array_max; /* maximum number of elements for */
- /* array */
- FT_UInt count_offset; /* offset of element count for */
- /* arrays; must not be zero if in */
- /* use -- in other words, a */
- /* `num_FOO' element must not */
- /* start the used structure if we */
- /* parse a `FOO' array */
- FT_UInt dict; /* where we expect it */
- } T1_FieldRec;
-
-#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */
-#define T1_FIELD_DICT_PRIVATE ( 1 << 1 )
-
-
-
-#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
- { \
- _ident, T1CODE, _type, \
- 0, \
- FT_FIELD_OFFSET( _fname ), \
- FT_FIELD_SIZE( _fname ), \
- 0, 0, \
- _dict \
- },
-
-#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
- { \
- _ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
- (T1_Field_ParseFunc)_reader, \
- 0, 0, \
- 0, 0, \
- _dict \
- },
-
-#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
- { \
- _ident, T1CODE, _type, \
- 0, \
- FT_FIELD_OFFSET( _fname ), \
- FT_FIELD_SIZE_DELTA( _fname ), \
- _max, \
- FT_FIELD_OFFSET( num_ ## _fname ), \
- _dict \
- },
-
-#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
- { \
- _ident, T1CODE, _type, \
- 0, \
- FT_FIELD_OFFSET( _fname ), \
- FT_FIELD_SIZE_DELTA( _fname ), \
- _max, 0, \
- _dict \
- },
-
-
-#define T1_FIELD_BOOL( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )
-
-#define T1_FIELD_NUM( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )
-
-#define T1_FIELD_FIXED( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )
-
-#define T1_FIELD_FIXED_1000( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \
- _dict )
-
-#define T1_FIELD_STRING( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )
-
-#define T1_FIELD_KEY( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )
-
-#define T1_FIELD_BBOX( _ident, _fname, _dict ) \
- T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )
-
-
-#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict ) \
- T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
- _fname, _fmax, _dict )
-
-#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict ) \
- T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
- _fname, _fmax, _dict )
-
-#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict ) \
- T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
- _fname, _fmax, _dict )
-
-#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict ) \
- T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
- _fname, _fmax, _dict )
-
-#define T1_FIELD_CALLBACK( _ident, _name, _dict ) \
- T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** T1 PARSER *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef const struct PS_Parser_FuncsRec_* PS_Parser_Funcs;
-
- typedef struct PS_Parser_FuncsRec_
- {
- void
- (*init)( PS_Parser parser,
- FT_Byte* base,
- FT_Byte* limit,
- FT_Memory memory );
-
- void
- (*done)( PS_Parser parser );
-
- void
- (*skip_spaces)( PS_Parser parser );
- void
- (*skip_PS_token)( PS_Parser parser );
-
- FT_Long
- (*to_int)( PS_Parser parser );
- FT_Fixed
- (*to_fixed)( PS_Parser parser,
- FT_Int power_ten );
-
- FT_Error
- (*to_bytes)( PS_Parser parser,
- FT_Byte* bytes,
- FT_Offset max_bytes,
- FT_Long* pnum_bytes,
- FT_Bool delimiters );
-
- FT_Int
- (*to_coord_array)( PS_Parser parser,
- FT_Int max_coords,
- FT_Short* coords );
- FT_Int
- (*to_fixed_array)( PS_Parser parser,
- FT_Int max_values,
- FT_Fixed* values,
- FT_Int power_ten );
-
- void
- (*to_token)( PS_Parser parser,
- T1_Token token );
- void
- (*to_token_array)( PS_Parser parser,
- T1_Token tokens,
- FT_UInt max_tokens,
- FT_Int* pnum_tokens );
-
- FT_Error
- (*load_field)( PS_Parser parser,
- const T1_Field field,
- void** objects,
- FT_UInt max_objects,
- FT_ULong* pflags );
-
- FT_Error
- (*load_field_table)( PS_Parser parser,
- const T1_Field field,
- void** objects,
- FT_UInt max_objects,
- FT_ULong* pflags );
-
- } PS_Parser_FuncsRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_ParserRec */
- /* */
- /* <Description> */
- /* A PS_Parser is an object used to parse a Type 1 font very quickly. */
- /* */
- /* <Fields> */
- /* cursor :: The current position in the text. */
- /* */
- /* base :: Start of the processed text. */
- /* */
- /* limit :: End of the processed text. */
- /* */
- /* error :: The last error returned. */
- /* */
- /* memory :: The object used for memory operations (alloc/realloc). */
- /* */
- /* funcs :: A table of functions for the parser. */
- /* */
- typedef struct PS_ParserRec_
- {
- FT_Byte* cursor;
- FT_Byte* base;
- FT_Byte* limit;
- FT_Error error;
- FT_Memory memory;
-
- PS_Parser_FuncsRec funcs;
-
- } PS_ParserRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** T1 BUILDER *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- typedef struct T1_BuilderRec_* T1_Builder;
-
-
- typedef FT_Error
- (*T1_Builder_Check_Points_Func)( T1_Builder builder,
- FT_Int count );
-
- typedef void
- (*T1_Builder_Add_Point_Func)( T1_Builder builder,
- FT_Pos x,
- FT_Pos y,
- FT_Byte flag );
-
- typedef FT_Error
- (*T1_Builder_Add_Point1_Func)( T1_Builder builder,
- FT_Pos x,
- FT_Pos y );
-
- typedef FT_Error
- (*T1_Builder_Add_Contour_Func)( T1_Builder builder );
-
- typedef FT_Error
- (*T1_Builder_Start_Point_Func)( T1_Builder builder,
- FT_Pos x,
- FT_Pos y );
-
- typedef void
- (*T1_Builder_Close_Contour_Func)( T1_Builder builder );
-
-
- typedef const struct T1_Builder_FuncsRec_* T1_Builder_Funcs;
-
- typedef struct T1_Builder_FuncsRec_
- {
- void
- (*init)( T1_Builder builder,
- FT_Face face,
- FT_Size size,
- FT_GlyphSlot slot,
- FT_Bool hinting );
-
- void
- (*done)( T1_Builder builder );
-
- T1_Builder_Check_Points_Func check_points;
- T1_Builder_Add_Point_Func add_point;
- T1_Builder_Add_Point1_Func add_point1;
- T1_Builder_Add_Contour_Func add_contour;
- T1_Builder_Start_Point_Func start_point;
- T1_Builder_Close_Contour_Func close_contour;
-
- } T1_Builder_FuncsRec;
-
-
- /* an enumeration type to handle charstring parsing states */
- typedef enum T1_ParseState_
- {
- T1_Parse_Start,
- T1_Parse_Have_Width,
- T1_Parse_Have_Moveto,
- T1_Parse_Have_Path
-
- } T1_ParseState;
-
-
- /*************************************************************************/
- /* */
- /* <Structure> */
- /* T1_BuilderRec */
- /* */
- /* <Description> */
- /* A structure used during glyph loading to store its outline. */
- /* */
- /* <Fields> */
- /* memory :: The current memory object. */
- /* */
- /* face :: The current face object. */
- /* */
- /* glyph :: The current glyph slot. */
- /* */
- /* loader :: XXX */
- /* */
- /* base :: The base glyph outline. */
- /* */
- /* current :: The current glyph outline. */
- /* */
- /* max_points :: maximum points in builder outline */
- /* */
- /* max_contours :: Maximum number of contours in builder outline. */
- /* */
- /* pos_x :: The horizontal translation (if composite glyph). */
- /* */
- /* pos_y :: The vertical translation (if composite glyph). */
- /* */
- /* left_bearing :: The left side bearing point. */
- /* */
- /* advance :: The horizontal advance vector. */
- /* */
- /* bbox :: Unused. */
- /* */
- /* parse_state :: An enumeration which controls the charstring */
- /* parsing state. */
- /* */
- /* load_points :: If this flag is not set, no points are loaded. */
- /* */
- /* no_recurse :: Set but not used. */
- /* */
- /* metrics_only :: A boolean indicating that we only want to compute */
- /* the metrics of a given glyph, not load all of its */
- /* points. */
- /* */
- /* funcs :: An array of function pointers for the builder. */
- /* */
- typedef struct T1_BuilderRec_
- {
- FT_Memory memory;
- FT_Face face;
- FT_GlyphSlot glyph;
- FT_GlyphLoader loader;
- FT_Outline* base;
- FT_Outline* current;
-
- FT_Pos pos_x;
- FT_Pos pos_y;
-
- FT_Vector left_bearing;
- FT_Vector advance;
-
- FT_BBox bbox; /* bounding box */
- T1_ParseState parse_state;
- FT_Bool load_points;
- FT_Bool no_recurse;
-
- FT_Bool metrics_only;
-
- void* hints_funcs; /* hinter-specific */
- void* hints_globals; /* hinter-specific */
-
- T1_Builder_FuncsRec funcs;
-
- } T1_BuilderRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** T1 DECODER *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
-#if 0
-
- /*************************************************************************/
- /* */
- /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
- /* calls during glyph loading. */
- /* */
-#define T1_MAX_SUBRS_CALLS 8
-
-
- /*************************************************************************/
- /* */
- /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
- /* minimum of 16 is required. */
- /* */
-#define T1_MAX_CHARSTRINGS_OPERANDS 32
-
-#endif /* 0 */
-
-
- typedef struct T1_Decoder_ZoneRec_
- {
- FT_Byte* cursor;
- FT_Byte* base;
- FT_Byte* limit;
-
- } T1_Decoder_ZoneRec, *T1_Decoder_Zone;
-
-
- typedef struct T1_DecoderRec_* T1_Decoder;
- typedef const struct T1_Decoder_FuncsRec_* T1_Decoder_Funcs;
-
-
- typedef FT_Error
- (*T1_Decoder_Callback)( T1_Decoder decoder,
- FT_UInt glyph_index );
-
-
- typedef struct T1_Decoder_FuncsRec_
- {
- FT_Error
- (*init)( T1_Decoder decoder,
- FT_Face face,
- FT_Size size,
- FT_GlyphSlot slot,
- FT_Byte** glyph_names,
- PS_Blend blend,
- FT_Bool hinting,
- FT_Render_Mode hint_mode,
- T1_Decoder_Callback callback );
-
- void
- (*done)( T1_Decoder decoder );
-
- FT_Error
- (*parse_charstrings)( T1_Decoder decoder,
- FT_Byte* base,
- FT_UInt len );
-
- } T1_Decoder_FuncsRec;
-
-
- typedef struct T1_DecoderRec_
- {
- T1_BuilderRec builder;
-
- FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
- FT_Long* top;
-
- T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1];
- T1_Decoder_Zone zone;
-
- FT_Service_PsCMaps psnames; /* for seac */
- FT_UInt num_glyphs;
- FT_Byte** glyph_names;
-
- FT_Int lenIV; /* internal for sub routine calls */
- FT_UInt num_subrs;
- FT_Byte** subrs;
- FT_PtrDist* subrs_len; /* array of subrs length (optional) */
-
- FT_Matrix font_matrix;
- FT_Vector font_offset;
-
- FT_Int flex_state;
- FT_Int num_flex_vectors;
- FT_Vector flex_vectors[7];
-
- PS_Blend blend; /* for multiple master support */
-
- FT_Render_Mode hint_mode;
-
- T1_Decoder_Callback parse_callback;
- T1_Decoder_FuncsRec funcs;
-
- FT_Long* buildchar;
- FT_UInt len_buildchar;
-
- FT_Bool seac;
-
- } T1_DecoderRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** AFM PARSER *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef struct AFM_ParserRec_* AFM_Parser;
-
- typedef struct AFM_Parser_FuncsRec_
- {
- FT_Error
- (*init)( AFM_Parser parser,
- FT_Memory memory,
- FT_Byte* base,
- FT_Byte* limit );
-
- void
- (*done)( AFM_Parser parser );
-
- FT_Error
- (*parse)( AFM_Parser parser );
-
- } AFM_Parser_FuncsRec;
-
-
- typedef struct AFM_StreamRec_* AFM_Stream;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* AFM_ParserRec */
- /* */
- /* <Description> */
- /* An AFM_Parser is a parser for the AFM files. */
- /* */
- /* <Fields> */
- /* memory :: The object used for memory operations (alloc and */
- /* realloc). */
- /* */
- /* stream :: This is an opaque object. */
- /* */
- /* FontInfo :: The result will be stored here. */
- /* */
- /* get_index :: A user provided function to get a glyph index by its */
- /* name. */
- /* */
- typedef struct AFM_ParserRec_
- {
- FT_Memory memory;
- AFM_Stream stream;
-
- AFM_FontInfo FontInfo;
-
- FT_Int
- (*get_index)( const char* name,
- FT_Offset len,
- void* user_data );
-
- void* user_data;
-
- } AFM_ParserRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** TYPE1 CHARMAPS *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef const struct T1_CMap_ClassesRec_* T1_CMap_Classes;
-
- typedef struct T1_CMap_ClassesRec_
- {
- FT_CMap_Class standard;
- FT_CMap_Class expert;
- FT_CMap_Class custom;
- FT_CMap_Class unicode;
-
- } T1_CMap_ClassesRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** PSAux Module Interface *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef struct PSAux_ServiceRec_
- {
- /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */
- const PS_Table_FuncsRec* ps_table_funcs;
- const PS_Parser_FuncsRec* ps_parser_funcs;
- const T1_Builder_FuncsRec* t1_builder_funcs;
- const T1_Decoder_FuncsRec* t1_decoder_funcs;
-
- void
- (*t1_decrypt)( FT_Byte* buffer,
- FT_Offset length,
- FT_UShort seed );
-
- T1_CMap_Classes t1_cmap_classes;
-
- /* fields after this comment line were added after version 2.1.10 */
- const AFM_Parser_FuncsRec* afm_parser_funcs;
-
- } PSAux_ServiceRec, *PSAux_Service;
-
- /* backwards-compatible type definition */
- typedef PSAux_ServiceRec PSAux_Interface;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** Some convenience functions *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
-#define IS_PS_NEWLINE( ch ) \
- ( (ch) == '\r' || \
- (ch) == '\n' )
-
-#define IS_PS_SPACE( ch ) \
- ( (ch) == ' ' || \
- IS_PS_NEWLINE( ch ) || \
- (ch) == '\t' || \
- (ch) == '\f' || \
- (ch) == '\0' )
-
-#define IS_PS_SPECIAL( ch ) \
- ( (ch) == '/' || \
- (ch) == '(' || (ch) == ')' || \
- (ch) == '<' || (ch) == '>' || \
- (ch) == '[' || (ch) == ']' || \
- (ch) == '{' || (ch) == '}' || \
- (ch) == '%' )
-
-#define IS_PS_DELIM( ch ) \
- ( IS_PS_SPACE( ch ) || \
- IS_PS_SPECIAL( ch ) )
-
-#define IS_PS_DIGIT( ch ) \
- ( (ch) >= '0' && (ch) <= '9' )
-
-#define IS_PS_XDIGIT( ch ) \
- ( IS_PS_DIGIT( ch ) || \
- ( (ch) >= 'A' && (ch) <= 'F' ) || \
- ( (ch) >= 'a' && (ch) <= 'f' ) )
-
-#define IS_PS_BASE85( ch ) \
- ( (ch) >= '!' && (ch) <= 'u' )
-
-#define IS_PS_TOKEN( cur, limit, token ) \
- ( (char)(cur)[0] == (token)[0] && \
- ( (cur) + sizeof ( (token) ) == (limit) || \
- ( (cur) + sizeof( (token) ) < (limit) && \
- IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) ) && \
- ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )
-
-
-FT_END_HEADER
-
-#endif /* __PSAUX_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/pshints.h b/src/3rdparty/freetype/include/internal/pshints.h
deleted file mode 100644
index f05ea6863a..0000000000
--- a/src/3rdparty/freetype/include/internal/pshints.h
+++ /dev/null
@@ -1,722 +0,0 @@
-/***************************************************************************/
-/* */
-/* pshints.h */
-/* */
-/* Interface to Postscript-specific (Type 1 and Type 2) hints */
-/* recorders (specification only). These are used to support native */
-/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
-/* */
-/* Copyright 2001-2003, 2005-2007, 2009, 2012, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __PSHINTS_H__
-#define __PSHINTS_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_TYPE1_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** INTERNAL REPRESENTATION OF GLOBALS *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef struct PSH_GlobalsRec_* PSH_Globals;
-
- typedef FT_Error
- (*PSH_Globals_NewFunc)( FT_Memory memory,
- T1_Private* private_dict,
- PSH_Globals* aglobals );
-
- typedef void
- (*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
- FT_Fixed x_scale,
- FT_Fixed y_scale,
- FT_Fixed x_delta,
- FT_Fixed y_delta );
-
- typedef void
- (*PSH_Globals_DestroyFunc)( PSH_Globals globals );
-
-
- typedef struct PSH_Globals_FuncsRec_
- {
- PSH_Globals_NewFunc create;
- PSH_Globals_SetScaleFunc set_scale;
- PSH_Globals_DestroyFunc destroy;
-
- } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** PUBLIC TYPE 1 HINTS RECORDER *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************
- *
- * @type:
- * T1_Hints
- *
- * @description:
- * This is a handle to an opaque structure used to record glyph hints
- * from a Type 1 character glyph character string.
- *
- * The methods used to operate on this object are defined by the
- * @T1_Hints_FuncsRec structure. Recording glyph hints is normally
- * achieved through the following scheme:
- *
- * - Open a new hint recording session by calling the `open' method.
- * This rewinds the recorder and prepare it for new input.
- *
- * - For each hint found in the glyph charstring, call the corresponding
- * method (`stem', `stem3', or `reset'). Note that these functions do
- * not return an error code.
- *
- * - Close the recording session by calling the `close' method. It
- * returns an error code if the hints were invalid or something
- * strange happened (e.g., memory shortage).
- *
- * The hints accumulated in the object can later be used by the
- * PostScript hinter.
- *
- */
- typedef struct T1_HintsRec_* T1_Hints;
-
-
- /*************************************************************************
- *
- * @type:
- * T1_Hints_Funcs
- *
- * @description:
- * A pointer to the @T1_Hints_FuncsRec structure that defines the API of
- * a given @T1_Hints object.
- *
- */
- typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
-
-
- /*************************************************************************
- *
- * @functype:
- * T1_Hints_OpenFunc
- *
- * @description:
- * A method of the @T1_Hints class used to prepare it for a new Type 1
- * hints recording session.
- *
- * @input:
- * hints ::
- * A handle to the Type 1 hints recorder.
- *
- * @note:
- * You should always call the @T1_Hints_CloseFunc method in order to
- * close an opened recording session.
- *
- */
- typedef void
- (*T1_Hints_OpenFunc)( T1_Hints hints );
-
-
- /*************************************************************************
- *
- * @functype:
- * T1_Hints_SetStemFunc
- *
- * @description:
- * A method of the @T1_Hints class used to record a new horizontal or
- * vertical stem. This corresponds to the Type 1 `hstem' and `vstem'
- * operators.
- *
- * @input:
- * hints ::
- * A handle to the Type 1 hints recorder.
- *
- * dimension ::
- * 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
- *
- * coords ::
- * Array of 2 coordinates in 16.16 format, used as (position,length)
- * stem descriptor.
- *
- * @note:
- * Use vertical coordinates (y) for horizontal stems (dim=0). Use
- * horizontal coordinates (x) for vertical stems (dim=1).
- *
- * `coords[0]' is the absolute stem position (lowest coordinate);
- * `coords[1]' is the length.
- *
- * The length can be negative, in which case it must be either -20 or
- * -21. It is interpreted as a `ghost' stem, according to the Type 1
- * specification.
- *
- * If the length is -21 (corresponding to a bottom ghost stem), then
- * the real stem position is `coords[0]+coords[1]'.
- *
- */
- typedef void
- (*T1_Hints_SetStemFunc)( T1_Hints hints,
- FT_UInt dimension,
- FT_Fixed* coords );
-
-
- /*************************************************************************
- *
- * @functype:
- * T1_Hints_SetStem3Func
- *
- * @description:
- * A method of the @T1_Hints class used to record three
- * counter-controlled horizontal or vertical stems at once.
- *
- * @input:
- * hints ::
- * A handle to the Type 1 hints recorder.
- *
- * dimension ::
- * 0 for horizontal stems, 1 for vertical ones.
- *
- * coords ::
- * An array of 6 values in 16.16 format, holding 3 (position,length)
- * pairs for the counter-controlled stems.
- *
- * @note:
- * Use vertical coordinates (y) for horizontal stems (dim=0). Use
- * horizontal coordinates (x) for vertical stems (dim=1).
- *
- * The lengths cannot be negative (ghost stems are never
- * counter-controlled).
- *
- */
- typedef void
- (*T1_Hints_SetStem3Func)( T1_Hints hints,
- FT_UInt dimension,
- FT_Fixed* coords );
-
-
- /*************************************************************************
- *
- * @functype:
- * T1_Hints_ResetFunc
- *
- * @description:
- * A method of the @T1_Hints class used to reset the stems hints in a
- * recording session.
- *
- * @input:
- * hints ::
- * A handle to the Type 1 hints recorder.
- *
- * end_point ::
- * The index of the last point in the input glyph in which the
- * previously defined hints apply.
- *
- */
- typedef void
- (*T1_Hints_ResetFunc)( T1_Hints hints,
- FT_UInt end_point );
-
-
- /*************************************************************************
- *
- * @functype:
- * T1_Hints_CloseFunc
- *
- * @description:
- * A method of the @T1_Hints class used to close a hint recording
- * session.
- *
- * @input:
- * hints ::
- * A handle to the Type 1 hints recorder.
- *
- * end_point ::
- * The index of the last point in the input glyph.
- *
- * @return:
- * FreeType error code. 0 means success.
- *
- * @note:
- * The error code is set to indicate that an error occurred during the
- * recording session.
- *
- */
- typedef FT_Error
- (*T1_Hints_CloseFunc)( T1_Hints hints,
- FT_UInt end_point );
-
-
- /*************************************************************************
- *
- * @functype:
- * T1_Hints_ApplyFunc
- *
- * @description:
- * A method of the @T1_Hints class used to apply hints to the
- * corresponding glyph outline. Must be called once all hints have been
- * recorded.
- *
- * @input:
- * hints ::
- * A handle to the Type 1 hints recorder.
- *
- * outline ::
- * A pointer to the target outline descriptor.
- *
- * globals ::
- * The hinter globals for this font.
- *
- * hint_mode ::
- * Hinting information.
- *
- * @return:
- * FreeType error code. 0 means success.
- *
- * @note:
- * On input, all points within the outline are in font coordinates. On
- * output, they are in 1/64th of pixels.
- *
- * The scaling transformation is taken from the `globals' object which
- * must correspond to the same font as the glyph.
- *
- */
- typedef FT_Error
- (*T1_Hints_ApplyFunc)( T1_Hints hints,
- FT_Outline* outline,
- PSH_Globals globals,
- FT_Render_Mode hint_mode );
-
-
- /*************************************************************************
- *
- * @struct:
- * T1_Hints_FuncsRec
- *
- * @description:
- * The structure used to provide the API to @T1_Hints objects.
- *
- * @fields:
- * hints ::
- * A handle to the T1 Hints recorder.
- *
- * open ::
- * The function to open a recording session.
- *
- * close ::
- * The function to close a recording session.
- *
- * stem ::
- * The function to set a simple stem.
- *
- * stem3 ::
- * The function to set counter-controlled stems.
- *
- * reset ::
- * The function to reset stem hints.
- *
- * apply ::
- * The function to apply the hints to the corresponding glyph outline.
- *
- */
- typedef struct T1_Hints_FuncsRec_
- {
- T1_Hints hints;
- T1_Hints_OpenFunc open;
- T1_Hints_CloseFunc close;
- T1_Hints_SetStemFunc stem;
- T1_Hints_SetStem3Func stem3;
- T1_Hints_ResetFunc reset;
- T1_Hints_ApplyFunc apply;
-
- } T1_Hints_FuncsRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** PUBLIC TYPE 2 HINTS RECORDER *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************
- *
- * @type:
- * T2_Hints
- *
- * @description:
- * This is a handle to an opaque structure used to record glyph hints
- * from a Type 2 character glyph character string.
- *
- * The methods used to operate on this object are defined by the
- * @T2_Hints_FuncsRec structure. Recording glyph hints is normally
- * achieved through the following scheme:
- *
- * - Open a new hint recording session by calling the `open' method.
- * This rewinds the recorder and prepare it for new input.
- *
- * - For each hint found in the glyph charstring, call the corresponding
- * method (`stems', `hintmask', `counters'). Note that these
- * functions do not return an error code.
- *
- * - Close the recording session by calling the `close' method. It
- * returns an error code if the hints were invalid or something
- * strange happened (e.g., memory shortage).
- *
- * The hints accumulated in the object can later be used by the
- * Postscript hinter.
- *
- */
- typedef struct T2_HintsRec_* T2_Hints;
-
-
- /*************************************************************************
- *
- * @type:
- * T2_Hints_Funcs
- *
- * @description:
- * A pointer to the @T2_Hints_FuncsRec structure that defines the API of
- * a given @T2_Hints object.
- *
- */
- typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
-
-
- /*************************************************************************
- *
- * @functype:
- * T2_Hints_OpenFunc
- *
- * @description:
- * A method of the @T2_Hints class used to prepare it for a new Type 2
- * hints recording session.
- *
- * @input:
- * hints ::
- * A handle to the Type 2 hints recorder.
- *
- * @note:
- * You should always call the @T2_Hints_CloseFunc method in order to
- * close an opened recording session.
- *
- */
- typedef void
- (*T2_Hints_OpenFunc)( T2_Hints hints );
-
-
- /*************************************************************************
- *
- * @functype:
- * T2_Hints_StemsFunc
- *
- * @description:
- * A method of the @T2_Hints class used to set the table of stems in
- * either the vertical or horizontal dimension. Equivalent to the
- * `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
- *
- * @input:
- * hints ::
- * A handle to the Type 2 hints recorder.
- *
- * dimension ::
- * 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
- *
- * count ::
- * The number of stems.
- *
- * coords ::
- * An array of `count' (position,length) pairs in 16.16 format.
- *
- * @note:
- * Use vertical coordinates (y) for horizontal stems (dim=0). Use
- * horizontal coordinates (x) for vertical stems (dim=1).
- *
- * There are `2*count' elements in the `coords' array. Each even
- * element is an absolute position in font units, each odd element is a
- * length in font units.
- *
- * A length can be negative, in which case it must be either -20 or
- * -21. It is interpreted as a `ghost' stem, according to the Type 1
- * specification.
- *
- */
- typedef void
- (*T2_Hints_StemsFunc)( T2_Hints hints,
- FT_UInt dimension,
- FT_UInt count,
- FT_Fixed* coordinates );
-
-
- /*************************************************************************
- *
- * @functype:
- * T2_Hints_MaskFunc
- *
- * @description:
- * A method of the @T2_Hints class used to set a given hintmask (this
- * corresponds to the `hintmask' Type 2 operator).
- *
- * @input:
- * hints ::
- * A handle to the Type 2 hints recorder.
- *
- * end_point ::
- * The glyph index of the last point to which the previously defined
- * or activated hints apply.
- *
- * bit_count ::
- * The number of bits in the hint mask.
- *
- * bytes ::
- * An array of bytes modelling the hint mask.
- *
- * @note:
- * If the hintmask starts the charstring (before any glyph point
- * definition), the value of `end_point' should be 0.
- *
- * `bit_count' is the number of meaningful bits in the `bytes' array; it
- * must be equal to the total number of hints defined so far (i.e.,
- * horizontal+verticals).
- *
- * The `bytes' array can come directly from the Type 2 charstring and
- * respects the same format.
- *
- */
- typedef void
- (*T2_Hints_MaskFunc)( T2_Hints hints,
- FT_UInt end_point,
- FT_UInt bit_count,
- const FT_Byte* bytes );
-
-
- /*************************************************************************
- *
- * @functype:
- * T2_Hints_CounterFunc
- *
- * @description:
- * A method of the @T2_Hints class used to set a given counter mask
- * (this corresponds to the `hintmask' Type 2 operator).
- *
- * @input:
- * hints ::
- * A handle to the Type 2 hints recorder.
- *
- * end_point ::
- * A glyph index of the last point to which the previously defined or
- * active hints apply.
- *
- * bit_count ::
- * The number of bits in the hint mask.
- *
- * bytes ::
- * An array of bytes modelling the hint mask.
- *
- * @note:
- * If the hintmask starts the charstring (before any glyph point
- * definition), the value of `end_point' should be 0.
- *
- * `bit_count' is the number of meaningful bits in the `bytes' array; it
- * must be equal to the total number of hints defined so far (i.e.,
- * horizontal+verticals).
- *
- * The `bytes' array can come directly from the Type 2 charstring and
- * respects the same format.
- *
- */
- typedef void
- (*T2_Hints_CounterFunc)( T2_Hints hints,
- FT_UInt bit_count,
- const FT_Byte* bytes );
-
-
- /*************************************************************************
- *
- * @functype:
- * T2_Hints_CloseFunc
- *
- * @description:
- * A method of the @T2_Hints class used to close a hint recording
- * session.
- *
- * @input:
- * hints ::
- * A handle to the Type 2 hints recorder.
- *
- * end_point ::
- * The index of the last point in the input glyph.
- *
- * @return:
- * FreeType error code. 0 means success.
- *
- * @note:
- * The error code is set to indicate that an error occurred during the
- * recording session.
- *
- */
- typedef FT_Error
- (*T2_Hints_CloseFunc)( T2_Hints hints,
- FT_UInt end_point );
-
-
- /*************************************************************************
- *
- * @functype:
- * T2_Hints_ApplyFunc
- *
- * @description:
- * A method of the @T2_Hints class used to apply hints to the
- * corresponding glyph outline. Must be called after the `close'
- * method.
- *
- * @input:
- * hints ::
- * A handle to the Type 2 hints recorder.
- *
- * outline ::
- * A pointer to the target outline descriptor.
- *
- * globals ::
- * The hinter globals for this font.
- *
- * hint_mode ::
- * Hinting information.
- *
- * @return:
- * FreeType error code. 0 means success.
- *
- * @note:
- * On input, all points within the outline are in font coordinates. On
- * output, they are in 1/64th of pixels.
- *
- * The scaling transformation is taken from the `globals' object which
- * must correspond to the same font than the glyph.
- *
- */
- typedef FT_Error
- (*T2_Hints_ApplyFunc)( T2_Hints hints,
- FT_Outline* outline,
- PSH_Globals globals,
- FT_Render_Mode hint_mode );
-
-
- /*************************************************************************
- *
- * @struct:
- * T2_Hints_FuncsRec
- *
- * @description:
- * The structure used to provide the API to @T2_Hints objects.
- *
- * @fields:
- * hints ::
- * A handle to the T2 hints recorder object.
- *
- * open ::
- * The function to open a recording session.
- *
- * close ::
- * The function to close a recording session.
- *
- * stems ::
- * The function to set the dimension's stems table.
- *
- * hintmask ::
- * The function to set hint masks.
- *
- * counter ::
- * The function to set counter masks.
- *
- * apply ::
- * The function to apply the hints on the corresponding glyph outline.
- *
- */
- typedef struct T2_Hints_FuncsRec_
- {
- T2_Hints hints;
- T2_Hints_OpenFunc open;
- T2_Hints_CloseFunc close;
- T2_Hints_StemsFunc stems;
- T2_Hints_MaskFunc hintmask;
- T2_Hints_CounterFunc counter;
- T2_Hints_ApplyFunc apply;
-
- } T2_Hints_FuncsRec;
-
-
- /* */
-
-
- typedef struct PSHinter_Interface_
- {
- PSH_Globals_Funcs (*get_globals_funcs)( FT_Module module );
- T1_Hints_Funcs (*get_t1_funcs) ( FT_Module module );
- T2_Hints_Funcs (*get_t2_funcs) ( FT_Module module );
-
- } PSHinter_Interface;
-
- typedef PSHinter_Interface* PSHinter_Service;
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_PSHINTER_INTERFACE( \
- class_, \
- get_globals_funcs_, \
- get_t1_funcs_, \
- get_t2_funcs_ ) \
- static const PSHinter_Interface class_ = \
- { \
- get_globals_funcs_, \
- get_t1_funcs_, \
- get_t2_funcs_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_PSHINTER_INTERFACE( \
- class_, \
- get_globals_funcs_, \
- get_t1_funcs_, \
- get_t2_funcs_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- PSHinter_Interface* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->get_globals_funcs = get_globals_funcs_; \
- clazz->get_t1_funcs = get_t1_funcs_; \
- clazz->get_t2_funcs = get_t2_funcs_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-FT_END_HEADER
-
-#endif /* __PSHINTS_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svbdf.h b/src/3rdparty/freetype/include/internal/services/svbdf.h
deleted file mode 100644
index 0974752a79..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svbdf.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************/
-/* */
-/* svbdf.h */
-/* */
-/* The FreeType BDF services (specification). */
-/* */
-/* Copyright 2003, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVBDF_H__
-#define __SVBDF_H__
-
-#include FT_BDF_H
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_BDF "bdf"
-
- typedef FT_Error
- (*FT_BDF_GetCharsetIdFunc)( FT_Face face,
- const char* *acharset_encoding,
- const char* *acharset_registry );
-
- typedef FT_Error
- (*FT_BDF_GetPropertyFunc)( FT_Face face,
- const char* prop_name,
- BDF_PropertyRec *aproperty );
-
-
- FT_DEFINE_SERVICE( BDF )
- {
- FT_BDF_GetCharsetIdFunc get_charset_id;
- FT_BDF_GetPropertyFunc get_property;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_BDFRec( class_, \
- get_charset_id_, \
- get_property_ ) \
- static const FT_Service_BDFRec class_ = \
- { \
- get_charset_id_, get_property_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_BDFRec( class_, \
- get_charset_id_, \
- get_property_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \
- { \
- clazz->get_charset_id = get_charset_id_; \
- clazz->get_property = get_property_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVBDF_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svcid.h b/src/3rdparty/freetype/include/internal/services/svcid.h
deleted file mode 100644
index 6be3f9374d..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svcid.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/***************************************************************************/
-/* */
-/* svcid.h */
-/* */
-/* The FreeType CID font services (specification). */
-/* */
-/* Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVCID_H__
-#define __SVCID_H__
-
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_CID "CID"
-
- typedef FT_Error
- (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face,
- const char* *registry,
- const char* *ordering,
- FT_Int *supplement );
- typedef FT_Error
- (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
- FT_Bool *is_cid );
- typedef FT_Error
- (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt *cid );
-
- FT_DEFINE_SERVICE( CID )
- {
- FT_CID_GetRegistryOrderingSupplementFunc get_ros;
- FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
- FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_CIDREC( class_, \
- get_ros_, \
- get_is_cid_, \
- get_cid_from_glyph_index_ ) \
- static const FT_Service_CIDRec class_ = \
- { \
- get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_CIDREC( class_, \
- get_ros_, \
- get_is_cid_, \
- get_cid_from_glyph_index_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_Service_CIDRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->get_ros = get_ros_; \
- clazz->get_is_cid = get_is_cid_; \
- clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVCID_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svgldict.h b/src/3rdparty/freetype/include/internal/services/svgldict.h
deleted file mode 100644
index 1d12534725..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svgldict.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************/
-/* */
-/* svgldict.h */
-/* */
-/* The FreeType glyph dictionary services (specification). */
-/* */
-/* Copyright 2003, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVGLDICT_H__
-#define __SVGLDICT_H__
-
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*
- * A service used to retrieve glyph names, as well as to find the
- * index of a given glyph name in a font.
- *
- */
-
-#define FT_SERVICE_ID_GLYPH_DICT "glyph-dict"
-
-
- typedef FT_Error
- (*FT_GlyphDict_GetNameFunc)( FT_Face face,
- FT_UInt glyph_index,
- FT_Pointer buffer,
- FT_UInt buffer_max );
-
- typedef FT_UInt
- (*FT_GlyphDict_NameIndexFunc)( FT_Face face,
- FT_String* glyph_name );
-
-
- FT_DEFINE_SERVICE( GlyphDict )
- {
- FT_GlyphDict_GetNameFunc get_name;
- FT_GlyphDict_NameIndexFunc name_index; /* optional */
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
- get_name_, \
- name_index_) \
- static const FT_Service_GlyphDictRec class_ = \
- { \
- get_name_, name_index_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
- get_name_, \
- name_index_) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_Service_GlyphDictRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->get_name = get_name_; \
- clazz->name_index = name_index_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVGLDICT_H__ */
diff --git a/src/3rdparty/freetype/include/internal/services/svgxval.h b/src/3rdparty/freetype/include/internal/services/svgxval.h
deleted file mode 100644
index 2cdab50655..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svgxval.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************/
-/* */
-/* svgxval.h */
-/* */
-/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
-/* */
-/* Copyright 2004, 2005 by */
-/* Masatake YAMATO, Red Hat K.K., */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-/***************************************************************************/
-/* */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVGXVAL_H__
-#define __SVGXVAL_H__
-
-#include FT_GX_VALIDATE_H
-#include FT_INTERNAL_VALIDATE_H
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
-#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
-
- typedef FT_Error
- (*gxv_validate_func)( FT_Face face,
- FT_UInt gx_flags,
- FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
- FT_UInt table_length );
-
-
- typedef FT_Error
- (*ckern_validate_func)( FT_Face face,
- FT_UInt ckern_flags,
- FT_Bytes *ckern_table );
-
-
- FT_DEFINE_SERVICE( GXvalidate )
- {
- gxv_validate_func validate;
- };
-
- FT_DEFINE_SERVICE( CKERNvalidate )
- {
- ckern_validate_func validate;
- };
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVGXVAL_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svkern.h b/src/3rdparty/freetype/include/internal/services/svkern.h
deleted file mode 100644
index 1488adf493..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svkern.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************/
-/* */
-/* svkern.h */
-/* */
-/* The FreeType Kerning service (specification). */
-/* */
-/* Copyright 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVKERN_H__
-#define __SVKERN_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_TRUETYPE_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-#define FT_SERVICE_ID_KERNING "kerning"
-
-
- typedef FT_Error
- (*FT_Kerning_TrackGetFunc)( FT_Face face,
- FT_Fixed point_size,
- FT_Int degree,
- FT_Fixed* akerning );
-
- FT_DEFINE_SERVICE( Kerning )
- {
- FT_Kerning_TrackGetFunc get_track;
- };
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVKERN_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svmm.h b/src/3rdparty/freetype/include/internal/services/svmm.h
deleted file mode 100644
index b08a663d66..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svmm.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/***************************************************************************/
-/* */
-/* svmm.h */
-/* */
-/* The FreeType Multiple Masters and GX var services (specification). */
-/* */
-/* Copyright 2003, 2004, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVMM_H__
-#define __SVMM_H__
-
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*
- * A service used to manage multiple-masters data in a given face.
- *
- * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
- *
- */
-
-#define FT_SERVICE_ID_MULTI_MASTERS "multi-masters"
-
-
- typedef FT_Error
- (*FT_Get_MM_Func)( FT_Face face,
- FT_Multi_Master* master );
-
- typedef FT_Error
- (*FT_Get_MM_Var_Func)( FT_Face face,
- FT_MM_Var* *master );
-
- typedef FT_Error
- (*FT_Set_MM_Design_Func)( FT_Face face,
- FT_UInt num_coords,
- FT_Long* coords );
-
- typedef FT_Error
- (*FT_Set_Var_Design_Func)( FT_Face face,
- FT_UInt num_coords,
- FT_Fixed* coords );
-
- typedef FT_Error
- (*FT_Set_MM_Blend_Func)( FT_Face face,
- FT_UInt num_coords,
- FT_Long* coords );
-
-
- FT_DEFINE_SERVICE( MultiMasters )
- {
- FT_Get_MM_Func get_mm;
- FT_Set_MM_Design_Func set_mm_design;
- FT_Set_MM_Blend_Func set_mm_blend;
- FT_Get_MM_Var_Func get_mm_var;
- FT_Set_Var_Design_Func set_var_design;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_var_, \
- set_var_design_ ) \
- static const FT_Service_MultiMastersRec class_ = \
- { \
- get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_var_, \
- set_var_design_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
- { \
- clazz->get_mm = get_mm_; \
- clazz->set_mm_design = set_mm_design_; \
- clazz->set_mm_blend = set_mm_blend_; \
- clazz->get_mm_var = get_mm_var_; \
- clazz->set_var_design = set_var_design_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __SVMM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svotval.h b/src/3rdparty/freetype/include/internal/services/svotval.h
deleted file mode 100644
index 970bbd5759..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svotval.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************/
-/* */
-/* svotval.h */
-/* */
-/* The FreeType OpenType validation service (specification). */
-/* */
-/* Copyright 2004, 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVOTVAL_H__
-#define __SVOTVAL_H__
-
-#include FT_OPENTYPE_VALIDATE_H
-#include FT_INTERNAL_VALIDATE_H
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate"
-
-
- typedef FT_Error
- (*otv_validate_func)( FT_Face volatile face,
- FT_UInt ot_flags,
- FT_Bytes *base,
- FT_Bytes *gdef,
- FT_Bytes *gpos,
- FT_Bytes *gsub,
- FT_Bytes *jstf );
-
-
- FT_DEFINE_SERVICE( OTvalidate )
- {
- otv_validate_func validate;
- };
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVOTVAL_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svpfr.h b/src/3rdparty/freetype/include/internal/services/svpfr.h
deleted file mode 100644
index 462786f9ce..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svpfr.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************/
-/* */
-/* svpfr.h */
-/* */
-/* Internal PFR service functions (specification). */
-/* */
-/* Copyright 2003, 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVPFR_H__
-#define __SVPFR_H__
-
-#include FT_PFR_H
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_PFR_METRICS "pfr-metrics"
-
-
- typedef FT_Error
- (*FT_PFR_GetMetricsFunc)( FT_Face face,
- FT_UInt *aoutline,
- FT_UInt *ametrics,
- FT_Fixed *ax_scale,
- FT_Fixed *ay_scale );
-
- typedef FT_Error
- (*FT_PFR_GetKerningFunc)( FT_Face face,
- FT_UInt left,
- FT_UInt right,
- FT_Vector *avector );
-
- typedef FT_Error
- (*FT_PFR_GetAdvanceFunc)( FT_Face face,
- FT_UInt gindex,
- FT_Pos *aadvance );
-
-
- FT_DEFINE_SERVICE( PfrMetrics )
- {
- FT_PFR_GetMetricsFunc get_metrics;
- FT_PFR_GetKerningFunc get_kerning;
- FT_PFR_GetAdvanceFunc get_advance;
-
- };
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __SVPFR_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svpostnm.h b/src/3rdparty/freetype/include/internal/services/svpostnm.h
deleted file mode 100644
index a76b4fe057..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svpostnm.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************/
-/* */
-/* svpostnm.h */
-/* */
-/* The FreeType PostScript name services (specification). */
-/* */
-/* Copyright 2003, 2007, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVPOSTNM_H__
-#define __SVPOSTNM_H__
-
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
- /*
- * A trivial service used to retrieve the PostScript name of a given
- * font when available. The `get_name' field should never be NULL.
- *
- * The corresponding function can return NULL to indicate that the
- * PostScript name is not available.
- *
- * The name is owned by the face and will be destroyed with it.
- */
-
-#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
-
-
- typedef const char*
- (*FT_PsName_GetFunc)( FT_Face face );
-
-
- FT_DEFINE_SERVICE( PsFontName )
- {
- FT_PsName_GetFunc get_ps_font_name;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
- static const FT_Service_PsFontNameRec class_ = \
- { \
- get_ps_font_name_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_Service_PsFontNameRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->get_ps_font_name = get_ps_font_name_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVPOSTNM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svprop.h b/src/3rdparty/freetype/include/internal/services/svprop.h
deleted file mode 100644
index 22da0bbc69..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svprop.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************/
-/* */
-/* svprop.h */
-/* */
-/* The FreeType property service (specification). */
-/* */
-/* Copyright 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVPROP_H__
-#define __SVPROP_H__
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_PROPERTIES "properties"
-
-
- typedef FT_Error
- (*FT_Properties_SetFunc)( FT_Module module,
- const char* property_name,
- const void* value );
-
- typedef FT_Error
- (*FT_Properties_GetFunc)( FT_Module module,
- const char* property_name,
- void* value );
-
-
- FT_DEFINE_SERVICE( Properties )
- {
- FT_Properties_SetFunc set_property;
- FT_Properties_GetFunc get_property;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
- set_property_, \
- get_property_ ) \
- static const FT_Service_PropertiesRec class_ = \
- { \
- set_property_, \
- get_property_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
- set_property_, \
- get_property_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \
- { \
- clazz->set_property = set_property_; \
- clazz->get_property = get_property_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVPROP_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svpscmap.h b/src/3rdparty/freetype/include/internal/services/svpscmap.h
deleted file mode 100644
index 030948ea64..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svpscmap.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************/
-/* */
-/* svpscmap.h */
-/* */
-/* The FreeType PostScript charmap service (specification). */
-/* */
-/* Copyright 2003, 2006, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVPSCMAP_H__
-#define __SVPSCMAP_H__
-
-#include FT_INTERNAL_OBJECTS_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
-
-
- /*
- * Adobe glyph name to unicode value.
- */
- typedef FT_UInt32
- (*PS_Unicode_ValueFunc)( const char* glyph_name );
-
- /*
- * Macintosh name id to glyph name. NULL if invalid index.
- */
- typedef const char*
- (*PS_Macintosh_NameFunc)( FT_UInt name_index );
-
- /*
- * Adobe standard string ID to glyph name. NULL if invalid index.
- */
- typedef const char*
- (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
-
-
- /*
- * Simple unicode -> glyph index charmap built from font glyph names
- * table.
- */
- typedef struct PS_UniMap_
- {
- FT_UInt32 unicode; /* bit 31 set: is glyph variant */
- FT_UInt glyph_index;
-
- } PS_UniMap;
-
-
- typedef struct PS_UnicodesRec_* PS_Unicodes;
-
- typedef struct PS_UnicodesRec_
- {
- FT_CMapRec cmap;
- FT_UInt num_maps;
- PS_UniMap* maps;
-
- } PS_UnicodesRec;
-
-
- /*
- * A function which returns a glyph name for a given index. Returns
- * NULL if invalid index.
- */
- typedef const char*
- (*PS_GetGlyphNameFunc)( FT_Pointer data,
- FT_UInt string_index );
-
- /*
- * A function used to release the glyph name returned by
- * PS_GetGlyphNameFunc, when needed
- */
- typedef void
- (*PS_FreeGlyphNameFunc)( FT_Pointer data,
- const char* name );
-
- typedef FT_Error
- (*PS_Unicodes_InitFunc)( FT_Memory memory,
- PS_Unicodes unicodes,
- FT_UInt num_glyphs,
- PS_GetGlyphNameFunc get_glyph_name,
- PS_FreeGlyphNameFunc free_glyph_name,
- FT_Pointer glyph_data );
-
- typedef FT_UInt
- (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
- FT_UInt32 unicode );
-
- typedef FT_UInt32
- (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
- FT_UInt32 *unicode );
-
-
- FT_DEFINE_SERVICE( PsCMaps )
- {
- PS_Unicode_ValueFunc unicode_value;
-
- PS_Unicodes_InitFunc unicodes_init;
- PS_Unicodes_CharIndexFunc unicodes_char_index;
- PS_Unicodes_CharNextFunc unicodes_char_next;
-
- PS_Macintosh_NameFunc macintosh_name;
- PS_Adobe_Std_StringsFunc adobe_std_strings;
- const unsigned short* adobe_std_encoding;
- const unsigned short* adobe_expert_encoding;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
- unicode_value_, \
- unicodes_init_, \
- unicodes_char_index_, \
- unicodes_char_next_, \
- macintosh_name_, \
- adobe_std_strings_, \
- adobe_std_encoding_, \
- adobe_expert_encoding_ ) \
- static const FT_Service_PsCMapsRec class_ = \
- { \
- unicode_value_, unicodes_init_, \
- unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
- adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
- unicode_value_, \
- unicodes_init_, \
- unicodes_char_index_, \
- unicodes_char_next_, \
- macintosh_name_, \
- adobe_std_strings_, \
- adobe_std_encoding_, \
- adobe_expert_encoding_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_Service_PsCMapsRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->unicode_value = unicode_value_; \
- clazz->unicodes_init = unicodes_init_; \
- clazz->unicodes_char_index = unicodes_char_index_; \
- clazz->unicodes_char_next = unicodes_char_next_; \
- clazz->macintosh_name = macintosh_name_; \
- clazz->adobe_std_strings = adobe_std_strings_; \
- clazz->adobe_std_encoding = adobe_std_encoding_; \
- clazz->adobe_expert_encoding = adobe_expert_encoding_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVPSCMAP_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svpsinfo.h b/src/3rdparty/freetype/include/internal/services/svpsinfo.h
deleted file mode 100644
index 4bfb506711..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svpsinfo.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************/
-/* */
-/* svpsinfo.h */
-/* */
-/* The FreeType PostScript info service (specification). */
-/* */
-/* Copyright 2003, 2004, 2009, 2011, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVPSINFO_H__
-#define __SVPSINFO_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_INTERNAL_TYPE1_TYPES_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info"
-
-
- typedef FT_Error
- (*PS_GetFontInfoFunc)( FT_Face face,
- PS_FontInfoRec* afont_info );
-
- typedef FT_Error
- (*PS_GetFontExtraFunc)( FT_Face face,
- PS_FontExtraRec* afont_extra );
-
- typedef FT_Int
- (*PS_HasGlyphNamesFunc)( FT_Face face );
-
- typedef FT_Error
- (*PS_GetFontPrivateFunc)( FT_Face face,
- PS_PrivateRec* afont_private );
-
- typedef FT_Long
- (*PS_GetFontValueFunc)( FT_Face face,
- PS_Dict_Keys key,
- FT_UInt idx,
- void *value,
- FT_Long value_len );
-
-
- FT_DEFINE_SERVICE( PsInfo )
- {
- PS_GetFontInfoFunc ps_get_font_info;
- PS_GetFontExtraFunc ps_get_font_extra;
- PS_HasGlyphNamesFunc ps_has_glyph_names;
- PS_GetFontPrivateFunc ps_get_font_private;
- PS_GetFontValueFunc ps_get_font_value;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
- get_font_info_, \
- ps_get_font_extra_, \
- has_glyph_names_, \
- get_font_private_, \
- get_font_value_ ) \
- static const FT_Service_PsInfoRec class_ = \
- { \
- get_font_info_, ps_get_font_extra_, has_glyph_names_, \
- get_font_private_, get_font_value_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
- get_font_info_, \
- ps_get_font_extra_, \
- has_glyph_names_, \
- get_font_private_, \
- get_font_value_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_Service_PsInfoRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->ps_get_font_info = get_font_info_; \
- clazz->ps_get_font_extra = ps_get_font_extra_; \
- clazz->ps_has_glyph_names = has_glyph_names_; \
- clazz->ps_get_font_private = get_font_private_; \
- clazz->ps_get_font_value = get_font_value_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVPSINFO_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svsfnt.h b/src/3rdparty/freetype/include/internal/services/svsfnt.h
deleted file mode 100644
index d3835aa1c2..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svsfnt.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/***************************************************************************/
-/* */
-/* svsfnt.h */
-/* */
-/* The FreeType SFNT table loading service (specification). */
-/* */
-/* Copyright 2003, 2004, 2009, 2012 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVSFNT_H__
-#define __SVSFNT_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_TRUETYPE_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-
- /*
- * SFNT table loading service.
- */
-
-#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table"
-
-
- /*
- * Used to implement FT_Load_Sfnt_Table().
- */
- typedef FT_Error
- (*FT_SFNT_TableLoadFunc)( FT_Face face,
- FT_ULong tag,
- FT_Long offset,
- FT_Byte* buffer,
- FT_ULong* length );
-
- /*
- * Used to implement FT_Get_Sfnt_Table().
- */
- typedef void*
- (*FT_SFNT_TableGetFunc)( FT_Face face,
- FT_Sfnt_Tag tag );
-
-
- /*
- * Used to implement FT_Sfnt_Table_Info().
- */
- typedef FT_Error
- (*FT_SFNT_TableInfoFunc)( FT_Face face,
- FT_UInt idx,
- FT_ULong *tag,
- FT_ULong *offset,
- FT_ULong *length );
-
-
- FT_DEFINE_SERVICE( SFNT_Table )
- {
- FT_SFNT_TableLoadFunc load_table;
- FT_SFNT_TableGetFunc get_table;
- FT_SFNT_TableInfoFunc table_info;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
- static const FT_Service_SFNT_TableRec class_ = \
- { \
- load_, get_, info_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec* clazz ) \
- { \
- clazz->load_table = load_; \
- clazz->get_table = get_; \
- clazz->table_info = info_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVSFNT_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svttcmap.h b/src/3rdparty/freetype/include/internal/services/svttcmap.h
deleted file mode 100644
index 4370f4c2d8..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svttcmap.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************/
-/* */
-/* svttcmap.h */
-/* */
-/* The FreeType TrueType/sfnt cmap extra information service. */
-/* */
-/* Copyright 2003 by */
-/* Masatake YAMATO, Redhat K.K. */
-/* */
-/* Copyright 2003, 2008, 2009, 2012, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-/* Development of this service is support of
- Information-technology Promotion Agency, Japan. */
-
-#ifndef __SVTTCMAP_H__
-#define __SVTTCMAP_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_TRUETYPE_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_CMapInfo */
- /* */
- /* <Description> */
- /* A structure used to store TrueType/sfnt specific cmap information */
- /* which is not covered by the generic @FT_CharMap structure. This */
- /* structure can be accessed with the @FT_Get_TT_CMap_Info function. */
- /* */
- /* <Fields> */
- /* language :: */
- /* The language ID used in Mac fonts. Definitions of values are in */
- /* `ttnameid.h'. */
- /* */
- /* format :: */
- /* The cmap format. OpenType 1.5 defines the formats 0 (byte */
- /* encoding table), 2~(high-byte mapping through table), 4~(segment */
- /* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
- /* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
- /* coverage), and 14 (Unicode Variation Sequences). */
- /* */
- typedef struct TT_CMapInfo_
- {
- FT_ULong language;
- FT_Long format;
-
- } TT_CMapInfo;
-
-
- typedef FT_Error
- (*TT_CMap_Info_GetFunc)( FT_CharMap charmap,
- TT_CMapInfo *cmap_info );
-
-
- FT_DEFINE_SERVICE( TTCMaps )
- {
- TT_CMap_Info_GetFunc get_cmap_info;
- };
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
- static const FT_Service_TTCMapsRec class_ = \
- { \
- get_cmap_info_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_Service_TTCMapsRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->get_cmap_info = get_cmap_info_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __SVTTCMAP_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svtteng.h b/src/3rdparty/freetype/include/internal/services/svtteng.h
deleted file mode 100644
index 58e02a6f9d..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svtteng.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************/
-/* */
-/* svtteng.h */
-/* */
-/* The FreeType TrueType engine query service (specification). */
-/* */
-/* Copyright 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVTTENG_H__
-#define __SVTTENG_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_MODULE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*
- * SFNT table loading service.
- */
-
-#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
-
- /*
- * Used to implement FT_Get_TrueType_Engine_Type
- */
-
- FT_DEFINE_SERVICE( TrueTypeEngine )
- {
- FT_TrueTypeEngineType engine_type;
- };
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVTTENG_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svttglyf.h b/src/3rdparty/freetype/include/internal/services/svttglyf.h
deleted file mode 100644
index 369eb8421b..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svttglyf.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************/
-/* */
-/* svttglyf.h */
-/* */
-/* The FreeType TrueType glyph service. */
-/* */
-/* Copyright 2007, 2009, 2012 by David Turner. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-#ifndef __SVTTGLYF_H__
-#define __SVTTGLYF_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_TRUETYPE_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_TT_GLYF "tt-glyf"
-
-
- typedef FT_ULong
- (*TT_Glyf_GetLocationFunc)( FT_Face face,
- FT_UInt gindex,
- FT_ULong *psize );
-
- FT_DEFINE_SERVICE( TTGlyf )
- {
- TT_Glyf_GetLocationFunc get_location;
- };
-
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
- static const FT_Service_TTGlyfRec class_ = \
- { \
- get_location_ \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Service_TTGlyfRec* clazz ) \
- { \
- clazz->get_location = get_location_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __SVTTGLYF_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svwinfnt.h b/src/3rdparty/freetype/include/internal/services/svwinfnt.h
deleted file mode 100644
index 57f7765d92..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svwinfnt.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************/
-/* */
-/* svwinfnt.h */
-/* */
-/* The FreeType Windows FNT/FONT service (specification). */
-/* */
-/* Copyright 2003 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVWINFNT_H__
-#define __SVWINFNT_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_WINFONTS_H
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_WINFNT "winfonts"
-
- typedef FT_Error
- (*FT_WinFnt_GetHeaderFunc)( FT_Face face,
- FT_WinFNT_HeaderRec *aheader );
-
-
- FT_DEFINE_SERVICE( WinFnt )
- {
- FT_WinFnt_GetHeaderFunc get_header;
- };
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVWINFNT_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/services/svxf86nm.h b/src/3rdparty/freetype/include/internal/services/svxf86nm.h
deleted file mode 100644
index ca5d884a83..0000000000
--- a/src/3rdparty/freetype/include/internal/services/svxf86nm.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************/
-/* */
-/* svxf86nm.h */
-/* */
-/* The FreeType XFree86 services (specification only). */
-/* */
-/* Copyright 2003 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVXF86NM_H__
-#define __SVXF86NM_H__
-
-#include FT_INTERNAL_SERVICE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*
- * A trivial service used to return the name of a face's font driver,
- * according to the XFree86 nomenclature. Note that the service data
- * is a simple constant string pointer.
- */
-
-#define FT_SERVICE_ID_XF86_NAME "xf86-driver-name"
-
-#define FT_XF86_FORMAT_TRUETYPE "TrueType"
-#define FT_XF86_FORMAT_TYPE_1 "Type 1"
-#define FT_XF86_FORMAT_BDF "BDF"
-#define FT_XF86_FORMAT_PCF "PCF"
-#define FT_XF86_FORMAT_TYPE_42 "Type 42"
-#define FT_XF86_FORMAT_CID "CID Type 1"
-#define FT_XF86_FORMAT_CFF "CFF"
-#define FT_XF86_FORMAT_PFR "PFR"
-#define FT_XF86_FORMAT_WINFNT "Windows FNT"
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVXF86NM_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/sfnt.h b/src/3rdparty/freetype/include/internal/sfnt.h
deleted file mode 100644
index d558e869bd..0000000000
--- a/src/3rdparty/freetype/include/internal/sfnt.h
+++ /dev/null
@@ -1,711 +0,0 @@
-/***************************************************************************/
-/* */
-/* sfnt.h */
-/* */
-/* High-level `sfnt' driver interface (specification). */
-/* */
-/* Copyright 1996-2006, 2009, 2012-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SFNT_H__
-#define __SFNT_H__
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_DRIVER_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Init_Face_Func */
- /* */
- /* <Description> */
- /* First part of the SFNT face object initialization. This finds */
- /* the face in a SFNT file or collection, and load its format tag in */
- /* face->format_tag. */
- /* */
- /* <Input> */
- /* stream :: The input stream. */
- /* */
- /* face :: A handle to the target face object. */
- /* */
- /* face_index :: The index of the TrueType font, if we are opening a */
- /* collection. */
- /* */
- /* num_params :: The number of additional parameters. */
- /* */
- /* params :: Optional additional parameters. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be at the font file's origin. */
- /* */
- /* This function recognizes fonts embedded in a `TrueType */
- /* collection'. */
- /* */
- /* Once the format tag has been validated by the font driver, it */
- /* should then call the TT_Load_Face_Func() callback to read the rest */
- /* of the SFNT tables in the object. */
- /* */
- typedef FT_Error
- (*TT_Init_Face_Func)( FT_Stream stream,
- TT_Face face,
- FT_Int face_index,
- FT_Int num_params,
- FT_Parameter* params );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Face_Func */
- /* */
- /* <Description> */
- /* Second part of the SFNT face object initialization. This loads */
- /* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */
- /* face object. */
- /* */
- /* <Input> */
- /* stream :: The input stream. */
- /* */
- /* face :: A handle to the target face object. */
- /* */
- /* face_index :: The index of the TrueType font, if we are opening a */
- /* collection. */
- /* */
- /* num_params :: The number of additional parameters. */
- /* */
- /* params :: Optional additional parameters. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function must be called after TT_Init_Face_Func(). */
- /* */
- typedef FT_Error
- (*TT_Load_Face_Func)( FT_Stream stream,
- TT_Face face,
- FT_Int face_index,
- FT_Int num_params,
- FT_Parameter* params );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Done_Face_Func */
- /* */
- /* <Description> */
- /* A callback used to delete the common SFNT data from a face. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Note> */
- /* This function does NOT destroy the face object. */
- /* */
- typedef void
- (*TT_Done_Face_Func)( TT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Any_Func */
- /* */
- /* <Description> */
- /* Load any font table into client memory. */
- /* */
- /* <Input> */
- /* face :: The face object to look for. */
- /* */
- /* tag :: The tag of table to load. Use the value 0 if you want */
- /* to access the whole font file, else set this parameter */
- /* to a valid TrueType table tag that you can forge with */
- /* the MAKE_TT_TAG macro. */
- /* */
- /* offset :: The starting offset in the table (or the file if */
- /* tag == 0). */
- /* */
- /* length :: The address of the decision variable: */
- /* */
- /* If length == NULL: */
- /* Loads the whole table. Returns an error if */
- /* `offset' == 0! */
- /* */
- /* If *length == 0: */
- /* Exits immediately; returning the length of the given */
- /* table or of the font file, depending on the value of */
- /* `tag'. */
- /* */
- /* If *length != 0: */
- /* Loads the next `length' bytes of table or font, */
- /* starting at offset `offset' (in table or font too). */
- /* */
- /* <Output> */
- /* buffer :: The address of target buffer. */
- /* */
- /* <Return> */
- /* TrueType error code. 0 means success. */
- /* */
- typedef FT_Error
- (*TT_Load_Any_Func)( TT_Face face,
- FT_ULong tag,
- FT_Long offset,
- FT_Byte *buffer,
- FT_ULong* length );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Find_SBit_Image_Func */
- /* */
- /* <Description> */
- /* Check whether an embedded bitmap (an `sbit') exists for a given */
- /* glyph, at a given strike. */
- /* */
- /* <Input> */
- /* face :: The target face object. */
- /* */
- /* glyph_index :: The glyph index. */
- /* */
- /* strike_index :: The current strike index. */
- /* */
- /* <Output> */
- /* arange :: The SBit range containing the glyph index. */
- /* */
- /* astrike :: The SBit strike containing the glyph index. */
- /* */
- /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. Returns */
- /* SFNT_Err_Invalid_Argument if no sbit exists for the requested */
- /* glyph. */
- /* */
- typedef FT_Error
- (*TT_Find_SBit_Image_Func)( TT_Face face,
- FT_UInt glyph_index,
- FT_ULong strike_index,
- TT_SBit_Range *arange,
- TT_SBit_Strike *astrike,
- FT_ULong *aglyph_offset );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_SBit_Metrics_Func */
- /* */
- /* <Description> */
- /* Get the big metrics for a given embedded bitmap. */
- /* */
- /* <Input> */
- /* stream :: The input stream. */
- /* */
- /* range :: The SBit range containing the glyph. */
- /* */
- /* <Output> */
- /* big_metrics :: A big SBit metrics structure for the glyph. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be positioned at the glyph's offset within */
- /* the `EBDT' table before the call. */
- /* */
- /* If the image format uses variable metrics, the stream cursor is */
- /* positioned just after the metrics header in the `EBDT' table on */
- /* function exit. */
- /* */
- typedef FT_Error
- (*TT_Load_SBit_Metrics_Func)( FT_Stream stream,
- TT_SBit_Range range,
- TT_SBit_Metrics metrics );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_SBit_Image_Func */
- /* */
- /* <Description> */
- /* Load a given glyph sbit image from the font resource. This also */
- /* returns its metrics. */
- /* */
- /* <Input> */
- /* face :: */
- /* The target face object. */
- /* */
- /* strike_index :: */
- /* The strike index. */
- /* */
- /* glyph_index :: */
- /* The current glyph index. */
- /* */
- /* load_flags :: */
- /* The current load flags. */
- /* */
- /* stream :: */
- /* The input stream. */
- /* */
- /* <Output> */
- /* amap :: */
- /* The target pixmap. */
- /* */
- /* ametrics :: */
- /* A big sbit metrics structure for the glyph image. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. Returns an error if no */
- /* glyph sbit exists for the index. */
- /* */
- /* <Note> */
- /* The `map.buffer' field is always freed before the glyph is loaded. */
- /* */
- typedef FT_Error
- (*TT_Load_SBit_Image_Func)( TT_Face face,
- FT_ULong strike_index,
- FT_UInt glyph_index,
- FT_UInt load_flags,
- FT_Stream stream,
- FT_Bitmap *amap,
- TT_SBit_MetricsRec *ametrics );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Set_SBit_Strike_Func */
- /* */
- /* <Description> */
- /* Select an sbit strike for a given size request. */
- /* */
- /* <Input> */
- /* face :: The target face object. */
- /* */
- /* req :: The size request. */
- /* */
- /* <Output> */
- /* astrike_index :: The index of the sbit strike. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. Returns an error if no */
- /* sbit strike exists for the selected ppem values. */
- /* */
- typedef FT_Error
- (*TT_Set_SBit_Strike_Func)( TT_Face face,
- FT_Size_Request req,
- FT_ULong* astrike_index );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Strike_Metrics_Func */
- /* */
- /* <Description> */
- /* Load the metrics of a given strike. */
- /* */
- /* <Input> */
- /* face :: The target face object. */
- /* */
- /* strike_index :: The strike index. */
- /* */
- /* <Output> */
- /* metrics :: the metrics of the strike. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. Returns an error if no */
- /* such sbit strike exists. */
- /* */
- typedef FT_Error
- (*TT_Load_Strike_Metrics_Func)( TT_Face face,
- FT_ULong strike_index,
- FT_Size_Metrics* metrics );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Get_PS_Name_Func */
- /* */
- /* <Description> */
- /* Get the PostScript glyph name of a glyph. */
- /* */
- /* <Input> */
- /* idx :: The glyph index. */
- /* */
- /* PSname :: The address of a string pointer. Will be NULL in case */
- /* of error, otherwise it is a pointer to the glyph name. */
- /* */
- /* You must not modify the returned string! */
- /* */
- /* <Output> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error
- (*TT_Get_PS_Name_Func)( TT_Face face,
- FT_UInt idx,
- FT_String** PSname );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Metrics_Func */
- /* */
- /* <Description> */
- /* Load a metrics table, which is a table with a horizontal and a */
- /* vertical version. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* vertical :: A boolean flag. If set, load the vertical one. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error
- (*TT_Load_Metrics_Func)( TT_Face face,
- FT_Stream stream,
- FT_Bool vertical );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Get_Metrics_Func */
- /* */
- /* <Description> */
- /* Load the horizontal or vertical header in a face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* vertical :: A boolean flag. If set, load vertical metrics. */
- /* */
- /* gindex :: The glyph index. */
- /* */
- /* <Output> */
- /* abearing :: The horizontal (or vertical) bearing. Set to zero in */
- /* case of error. */
- /* */
- /* aadvance :: The horizontal (or vertical) advance. Set to zero in */
- /* case of error. */
- /* */
- typedef void
- (*TT_Get_Metrics_Func)( TT_Face face,
- FT_Bool vertical,
- FT_UInt gindex,
- FT_Short* abearing,
- FT_UShort* aadvance );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Table_Func */
- /* */
- /* <Description> */
- /* Load a given TrueType table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The function uses `face->goto_table' to seek the stream to the */
- /* start of the table, except while loading the font directory. */
- /* */
- typedef FT_Error
- (*TT_Load_Table_Func)( TT_Face face,
- FT_Stream stream );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Free_Table_Func */
- /* */
- /* <Description> */
- /* Free a given TrueType table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- typedef void
- (*TT_Free_Table_Func)( TT_Face face );
-
-
- /*
- * @functype:
- * TT_Face_GetKerningFunc
- *
- * @description:
- * Return the horizontal kerning value between two glyphs.
- *
- * @input:
- * face :: A handle to the source face object.
- * left_glyph :: The left glyph index.
- * right_glyph :: The right glyph index.
- *
- * @return:
- * The kerning value in font units.
- */
- typedef FT_Int
- (*TT_Face_GetKerningFunc)( TT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* SFNT_Interface */
- /* */
- /* <Description> */
- /* This structure holds pointers to the functions used to load and */
- /* free the basic tables that are required in a `sfnt' font file. */
- /* */
- /* <Fields> */
- /* Check the various xxx_Func() descriptions for details. */
- /* */
- typedef struct SFNT_Interface_
- {
- TT_Loader_GotoTableFunc goto_table;
-
- TT_Init_Face_Func init_face;
- TT_Load_Face_Func load_face;
- TT_Done_Face_Func done_face;
- FT_Module_Requester get_interface;
-
- TT_Load_Any_Func load_any;
-
- /* these functions are called by `load_face' but they can also */
- /* be called from external modules, if there is a need to do so */
- TT_Load_Table_Func load_head;
- TT_Load_Metrics_Func load_hhea;
- TT_Load_Table_Func load_cmap;
- TT_Load_Table_Func load_maxp;
- TT_Load_Table_Func load_os2;
- TT_Load_Table_Func load_post;
-
- TT_Load_Table_Func load_name;
- TT_Free_Table_Func free_name;
-
- /* this field was called `load_kerning' up to version 2.1.10 */
- TT_Load_Table_Func load_kern;
-
- TT_Load_Table_Func load_gasp;
- TT_Load_Table_Func load_pclt;
-
- /* see `ttload.h'; this field was called `load_bitmap_header' up to */
- /* version 2.1.10 */
- TT_Load_Table_Func load_bhed;
-
- TT_Load_SBit_Image_Func load_sbit_image;
-
- /* see `ttpost.h' */
- TT_Get_PS_Name_Func get_psname;
- TT_Free_Table_Func free_psnames;
-
- /* starting here, the structure differs from version 2.1.7 */
-
- /* this field was introduced in version 2.1.8, named `get_psname' */
- TT_Face_GetKerningFunc get_kerning;
-
- /* new elements introduced after version 2.1.10 */
-
- /* load the font directory, i.e., the offset table and */
- /* the table directory */
- TT_Load_Table_Func load_font_dir;
- TT_Load_Metrics_Func load_hmtx;
-
- TT_Load_Table_Func load_eblc;
- TT_Free_Table_Func free_eblc;
-
- TT_Set_SBit_Strike_Func set_sbit_strike;
- TT_Load_Strike_Metrics_Func load_strike_metrics;
-
- TT_Get_Metrics_Func get_metrics;
-
- } SFNT_Interface;
-
-
- /* transitional */
- typedef SFNT_Interface* SFNT_Service;
-
-#ifndef FT_CONFIG_OPTION_PIC
-
-#define FT_DEFINE_SFNT_INTERFACE( \
- class_, \
- goto_table_, \
- init_face_, \
- load_face_, \
- done_face_, \
- get_interface_, \
- load_any_, \
- load_head_, \
- load_hhea_, \
- load_cmap_, \
- load_maxp_, \
- load_os2_, \
- load_post_, \
- load_name_, \
- free_name_, \
- load_kern_, \
- load_gasp_, \
- load_pclt_, \
- load_bhed_, \
- load_sbit_image_, \
- get_psname_, \
- free_psnames_, \
- get_kerning_, \
- load_font_dir_, \
- load_hmtx_, \
- load_eblc_, \
- free_eblc_, \
- set_sbit_strike_, \
- load_strike_metrics_, \
- get_metrics_ ) \
- static const SFNT_Interface class_ = \
- { \
- goto_table_, \
- init_face_, \
- load_face_, \
- done_face_, \
- get_interface_, \
- load_any_, \
- load_head_, \
- load_hhea_, \
- load_cmap_, \
- load_maxp_, \
- load_os2_, \
- load_post_, \
- load_name_, \
- free_name_, \
- load_kern_, \
- load_gasp_, \
- load_pclt_, \
- load_bhed_, \
- load_sbit_image_, \
- get_psname_, \
- free_psnames_, \
- get_kerning_, \
- load_font_dir_, \
- load_hmtx_, \
- load_eblc_, \
- free_eblc_, \
- set_sbit_strike_, \
- load_strike_metrics_, \
- get_metrics_, \
- };
-
-#else /* FT_CONFIG_OPTION_PIC */
-
-#define FT_INTERNAL( a, a_ ) \
- clazz->a = a_;
-
-#define FT_DEFINE_SFNT_INTERFACE( \
- class_, \
- goto_table_, \
- init_face_, \
- load_face_, \
- done_face_, \
- get_interface_, \
- load_any_, \
- load_head_, \
- load_hhea_, \
- load_cmap_, \
- load_maxp_, \
- load_os2_, \
- load_post_, \
- load_name_, \
- free_name_, \
- load_kern_, \
- load_gasp_, \
- load_pclt_, \
- load_bhed_, \
- load_sbit_image_, \
- get_psname_, \
- free_psnames_, \
- get_kerning_, \
- load_font_dir_, \
- load_hmtx_, \
- load_eblc_, \
- free_eblc_, \
- set_sbit_strike_, \
- load_strike_metrics_, \
- get_metrics_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- SFNT_Interface* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->goto_table = goto_table_; \
- clazz->init_face = init_face_; \
- clazz->load_face = load_face_; \
- clazz->done_face = done_face_; \
- clazz->get_interface = get_interface_; \
- clazz->load_any = load_any_; \
- clazz->load_head = load_head_; \
- clazz->load_hhea = load_hhea_; \
- clazz->load_cmap = load_cmap_; \
- clazz->load_maxp = load_maxp_; \
- clazz->load_os2 = load_os2_; \
- clazz->load_post = load_post_; \
- clazz->load_name = load_name_; \
- clazz->free_name = free_name_; \
- clazz->load_kern = load_kern_; \
- clazz->load_gasp = load_gasp_; \
- clazz->load_pclt = load_pclt_; \
- clazz->load_bhed = load_bhed_; \
- clazz->load_sbit_image = load_sbit_image_; \
- clazz->get_psname = get_psname_; \
- clazz->free_psnames = free_psnames_; \
- clazz->get_kerning = get_kerning_; \
- clazz->load_font_dir = load_font_dir_; \
- clazz->load_hmtx = load_hmtx_; \
- clazz->load_eblc = load_eblc_; \
- clazz->free_eblc = free_eblc_; \
- clazz->set_sbit_strike = set_sbit_strike_; \
- clazz->load_strike_metrics = load_strike_metrics_; \
- clazz->get_metrics = get_metrics_; \
- }
-
-#endif /* FT_CONFIG_OPTION_PIC */
-
-FT_END_HEADER
-
-#endif /* __SFNT_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/t1types.h b/src/3rdparty/freetype/include/internal/t1types.h
deleted file mode 100644
index e20237c14d..0000000000
--- a/src/3rdparty/freetype/include/internal/t1types.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/***************************************************************************/
-/* */
-/* t1types.h */
-/* */
-/* Basic Type1/Type2 type definitions and interface (specification */
-/* only). */
-/* */
-/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __T1TYPES_H__
-#define __T1TYPES_H__
-
-
-#include <ft2build.h>
-#include FT_TYPE1_TABLES_H
-#include FT_INTERNAL_POSTSCRIPT_HINTS_H
-#include FT_INTERNAL_SERVICE_H
-#include FT_SERVICE_POSTSCRIPT_CMAPS_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* T1_EncodingRec */
- /* */
- /* <Description> */
- /* A structure modeling a custom encoding. */
- /* */
- /* <Fields> */
- /* num_chars :: The number of character codes in the encoding. */
- /* Usually 256. */
- /* */
- /* code_first :: The lowest valid character code in the encoding. */
- /* */
- /* code_last :: The highest valid character code in the encoding */
- /* + 1. When equal to code_first there are no valid */
- /* character codes. */
- /* */
- /* char_index :: An array of corresponding glyph indices. */
- /* */
- /* char_name :: An array of corresponding glyph names. */
- /* */
- typedef struct T1_EncodingRecRec_
- {
- FT_Int num_chars;
- FT_Int code_first;
- FT_Int code_last;
-
- FT_UShort* char_index;
- FT_String** char_name;
-
- } T1_EncodingRec, *T1_Encoding;
-
-
- /* used to hold extra data of PS_FontInfoRec that
- * cannot be stored in the publicly defined structure.
- *
- * Note these can't be blended with multiple-masters.
- */
- typedef struct PS_FontExtraRec_
- {
- FT_UShort fs_type;
-
- } PS_FontExtraRec;
-
-
- typedef struct T1_FontRec_
- {
- PS_FontInfoRec font_info; /* font info dictionary */
- PS_FontExtraRec font_extra; /* font info extra fields */
- PS_PrivateRec private_dict; /* private dictionary */
- FT_String* font_name; /* top-level dictionary */
-
- T1_EncodingType encoding_type;
- T1_EncodingRec encoding;
-
- FT_Byte* subrs_block;
- FT_Byte* charstrings_block;
- FT_Byte* glyph_names_block;
-
- FT_Int num_subrs;
- FT_Byte** subrs;
- FT_PtrDist* subrs_len;
-
- FT_Int num_glyphs;
- FT_String** glyph_names; /* array of glyph names */
- FT_Byte** charstrings; /* array of glyph charstrings */
- FT_PtrDist* charstrings_len;
-
- FT_Byte paint_type;
- FT_Byte font_type;
- FT_Matrix font_matrix;
- FT_Vector font_offset;
- FT_BBox font_bbox;
- FT_Long font_id;
-
- FT_Fixed stroke_width;
-
- } T1_FontRec, *T1_Font;
-
-
- typedef struct CID_SubrsRec_
- {
- FT_UInt num_subrs;
- FT_Byte** code;
-
- } CID_SubrsRec, *CID_Subrs;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** AFM FONT INFORMATION STRUCTURES ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef struct AFM_TrackKernRec_
- {
- FT_Int degree;
- FT_Fixed min_ptsize;
- FT_Fixed min_kern;
- FT_Fixed max_ptsize;
- FT_Fixed max_kern;
-
- } AFM_TrackKernRec, *AFM_TrackKern;
-
- typedef struct AFM_KernPairRec_
- {
- FT_Int index1;
- FT_Int index2;
- FT_Int x;
- FT_Int y;
-
- } AFM_KernPairRec, *AFM_KernPair;
-
- typedef struct AFM_FontInfoRec_
- {
- FT_Bool IsCIDFont;
- FT_BBox FontBBox;
- FT_Fixed Ascender;
- FT_Fixed Descender;
- AFM_TrackKern TrackKerns; /* free if non-NULL */
- FT_Int NumTrackKern;
- AFM_KernPair KernPairs; /* free if non-NULL */
- FT_Int NumKernPair;
-
- } AFM_FontInfoRec, *AFM_FontInfo;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** ORIGINAL T1_FACE CLASS DEFINITION ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- typedef struct T1_FaceRec_* T1_Face;
- typedef struct CID_FaceRec_* CID_Face;
-
-
- typedef struct T1_FaceRec_
- {
- FT_FaceRec root;
- T1_FontRec type1;
- const void* psnames;
- const void* psaux;
- const void* afm_data;
- FT_CharMapRec charmaprecs[2];
- FT_CharMap charmaps[2];
-
- /* support for Multiple Masters fonts */
- PS_Blend blend;
-
- /* undocumented, optional: indices of subroutines that express */
- /* the NormalizeDesignVector and the ConvertDesignVector procedure, */
- /* respectively, as Type 2 charstrings; -1 if keywords not present */
- FT_Int ndv_idx;
- FT_Int cdv_idx;
-
- /* undocumented, optional: has the same meaning as len_buildchar */
- /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
- FT_UInt len_buildchar;
- FT_Long* buildchar;
-
- /* since version 2.1 - interface to PostScript hinter */
- const void* pshinter;
-
- } T1_FaceRec;
-
-
- typedef struct CID_FaceRec_
- {
- FT_FaceRec root;
- void* psnames;
- void* psaux;
- CID_FaceInfoRec cid;
- PS_FontExtraRec font_extra;
-#if 0
- void* afm_data;
-#endif
- CID_Subrs subrs;
-
- /* since version 2.1 - interface to PostScript hinter */
- void* pshinter;
-
- /* since version 2.1.8, but was originally positioned after `afm_data' */
- FT_Byte* binary_data; /* used if hex data has been converted */
- FT_Stream cid_stream;
-
- } CID_FaceRec;
-
-
-FT_END_HEADER
-
-#endif /* __T1TYPES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/internal/tttypes.h b/src/3rdparty/freetype/include/internal/tttypes.h
deleted file mode 100644
index ad302b87c8..0000000000
--- a/src/3rdparty/freetype/include/internal/tttypes.h
+++ /dev/null
@@ -1,1516 +0,0 @@
-/***************************************************************************/
-/* */
-/* tttypes.h */
-/* */
-/* Basic SFNT/TrueType type definitions and interface (specification */
-/* only). */
-/* */
-/* Copyright 1996-2002, 2004-2008, 2012-2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __TTTYPES_H__
-#define __TTTYPES_H__
-
-
-#include <ft2build.h>
-#include FT_TRUETYPE_TABLES_H
-#include FT_INTERNAL_OBJECTS_H
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-#include FT_MULTIPLE_MASTERS_H
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TTC_HeaderRec */
- /* */
- /* <Description> */
- /* TrueType collection header. This table contains the offsets of */
- /* the font headers of each distinct TrueType face in the file. */
- /* */
- /* <Fields> */
- /* tag :: Must be `ttc ' to indicate a TrueType collection. */
- /* */
- /* version :: The version number. */
- /* */
- /* count :: The number of faces in the collection. The */
- /* specification says this should be an unsigned long, but */
- /* we use a signed long since we need the value -1 for */
- /* specific purposes. */
- /* */
- /* offsets :: The offsets of the font headers, one per face. */
- /* */
- typedef struct TTC_HeaderRec_
- {
- FT_ULong tag;
- FT_Fixed version;
- FT_Long count;
- FT_ULong* offsets;
-
- } TTC_HeaderRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* SFNT_HeaderRec */
- /* */
- /* <Description> */
- /* SFNT file format header. */
- /* */
- /* <Fields> */
- /* format_tag :: The font format tag. */
- /* */
- /* num_tables :: The number of tables in file. */
- /* */
- /* search_range :: Must be `16 * (max power of 2 <= num_tables)'. */
- /* */
- /* entry_selector :: Must be log2 of `search_range / 16'. */
- /* */
- /* range_shift :: Must be `num_tables * 16 - search_range'. */
- /* */
- typedef struct SFNT_HeaderRec_
- {
- FT_ULong format_tag;
- FT_UShort num_tables;
- FT_UShort search_range;
- FT_UShort entry_selector;
- FT_UShort range_shift;
-
- FT_ULong offset; /* not in file */
-
- } SFNT_HeaderRec, *SFNT_Header;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_TableRec */
- /* */
- /* <Description> */
- /* This structure describes a given table of a TrueType font. */
- /* */
- /* <Fields> */
- /* Tag :: A four-bytes tag describing the table. */
- /* */
- /* CheckSum :: The table checksum. This value can be ignored. */
- /* */
- /* Offset :: The offset of the table from the start of the TrueType */
- /* font in its resource. */
- /* */
- /* Length :: The table length (in bytes). */
- /* */
- typedef struct TT_TableRec_
- {
- FT_ULong Tag; /* table type */
- FT_ULong CheckSum; /* table checksum */
- FT_ULong Offset; /* table file offset */
- FT_ULong Length; /* table length */
-
- } TT_TableRec, *TT_Table;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* WOFF_HeaderRec */
- /* */
- /* <Description> */
- /* WOFF file format header. */
- /* */
- /* <Fields> */
- /* See */
- /* */
- /* http://www.w3.org/TR/WOFF/#WOFFHeader */
- /* */
- typedef struct WOFF_HeaderRec_
- {
- FT_ULong signature;
- FT_ULong flavor;
- FT_ULong length;
- FT_UShort num_tables;
- FT_UShort reserved;
- FT_ULong totalSfntSize;
- FT_UShort majorVersion;
- FT_UShort minorVersion;
- FT_ULong metaOffset;
- FT_ULong metaLength;
- FT_ULong metaOrigLength;
- FT_ULong privOffset;
- FT_ULong privLength;
-
- } WOFF_HeaderRec, *WOFF_Header;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* WOFF_TableRec */
- /* */
- /* <Description> */
- /* This structure describes a given table of a WOFF font. */
- /* */
- /* <Fields> */
- /* Tag :: A four-bytes tag describing the table. */
- /* */
- /* Offset :: The offset of the table from the start of the WOFF */
- /* font in its resource. */
- /* */
- /* CompLength :: Compressed table length (in bytes). */
- /* */
- /* OrigLength :: Unompressed table length (in bytes). */
- /* */
- /* CheckSum :: The table checksum. This value can be ignored. */
- /* */
- /* OrigOffset :: The uncompressed table file offset. This value gets */
- /* computed while constructing the (uncompressed) SFNT */
- /* header. It is not contained in the WOFF file. */
- /* */
- typedef struct WOFF_TableRec_
- {
- FT_ULong Tag; /* table ID */
- FT_ULong Offset; /* table file offset */
- FT_ULong CompLength; /* compressed table length */
- FT_ULong OrigLength; /* uncompressed table length */
- FT_ULong CheckSum; /* uncompressed checksum */
-
- FT_ULong OrigOffset; /* uncompressed table file offset */
- /* (not in the WOFF file) */
- } WOFF_TableRec, *WOFF_Table;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_LongMetricsRec */
- /* */
- /* <Description> */
- /* A structure modeling the long metrics of the `hmtx' and `vmtx' */
- /* TrueType tables. The values are expressed in font units. */
- /* */
- /* <Fields> */
- /* advance :: The advance width or height for the glyph. */
- /* */
- /* bearing :: The left-side or top-side bearing for the glyph. */
- /* */
- typedef struct TT_LongMetricsRec_
- {
- FT_UShort advance;
- FT_Short bearing;
-
- } TT_LongMetricsRec, *TT_LongMetrics;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_ShortMetrics */
- /* */
- /* <Description> */
- /* A simple type to model the short metrics of the `hmtx' and `vmtx' */
- /* tables. */
- /* */
- typedef FT_Short TT_ShortMetrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_NameEntryRec */
- /* */
- /* <Description> */
- /* A structure modeling TrueType name records. Name records are used */
- /* to store important strings like family name, style name, */
- /* copyright, etc. in _localized_ versions (i.e., language, encoding, */
- /* etc). */
- /* */
- /* <Fields> */
- /* platformID :: The ID of the name's encoding platform. */
- /* */
- /* encodingID :: The platform-specific ID for the name's encoding. */
- /* */
- /* languageID :: The platform-specific ID for the name's language. */
- /* */
- /* nameID :: The ID specifying what kind of name this is. */
- /* */
- /* stringLength :: The length of the string in bytes. */
- /* */
- /* stringOffset :: The offset to the string in the `name' table. */
- /* */
- /* string :: A pointer to the string's bytes. Note that these */
- /* are usually UTF-16 encoded characters. */
- /* */
- typedef struct TT_NameEntryRec_
- {
- FT_UShort platformID;
- FT_UShort encodingID;
- FT_UShort languageID;
- FT_UShort nameID;
- FT_UShort stringLength;
- FT_ULong stringOffset;
-
- /* this last field is not defined in the spec */
- /* but used by the FreeType engine */
-
- FT_Byte* string;
-
- } TT_NameEntryRec, *TT_NameEntry;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_NameTableRec */
- /* */
- /* <Description> */
- /* A structure modeling the TrueType name table. */
- /* */
- /* <Fields> */
- /* format :: The format of the name table. */
- /* */
- /* numNameRecords :: The number of names in table. */
- /* */
- /* storageOffset :: The offset of the name table in the `name' */
- /* TrueType table. */
- /* */
- /* names :: An array of name records. */
- /* */
- /* stream :: the file's input stream. */
- /* */
- typedef struct TT_NameTableRec_
- {
- FT_UShort format;
- FT_UInt numNameRecords;
- FT_UInt storageOffset;
- TT_NameEntryRec* names;
- FT_Stream stream;
-
- } TT_NameTableRec, *TT_NameTable;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_GaspRangeRec */
- /* */
- /* <Description> */
- /* A tiny structure used to model a gasp range according to the */
- /* TrueType specification. */
- /* */
- /* <Fields> */
- /* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */
- /* */
- /* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */
- /* modes to be used. */
- /* */
- typedef struct TT_GaspRangeRec_
- {
- FT_UShort maxPPEM;
- FT_UShort gaspFlag;
-
- } TT_GaspRangeRec, *TT_GaspRange;
-
-
-#define TT_GASP_GRIDFIT 0x01
-#define TT_GASP_DOGRAY 0x02
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_GaspRec */
- /* */
- /* <Description> */
- /* A structure modeling the TrueType `gasp' table used to specify */
- /* grid-fitting and anti-aliasing behaviour. */
- /* */
- /* <Fields> */
- /* version :: The version number. */
- /* */
- /* numRanges :: The number of gasp ranges in table. */
- /* */
- /* gaspRanges :: An array of gasp ranges. */
- /* */
- typedef struct TT_Gasp_
- {
- FT_UShort version;
- FT_UShort numRanges;
- TT_GaspRange gaspRanges;
-
- } TT_GaspRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** EMBEDDED BITMAPS SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_MetricsRec */
- /* */
- /* <Description> */
- /* A structure used to hold the big metrics of a given glyph bitmap */
- /* in a TrueType or OpenType font. These are usually found in the */
- /* `EBDT' (Microsoft) or `bloc' (Apple) table. */
- /* */
- /* <Fields> */
- /* height :: The glyph height in pixels. */
- /* */
- /* width :: The glyph width in pixels. */
- /* */
- /* horiBearingX :: The horizontal left bearing. */
- /* */
- /* horiBearingY :: The horizontal top bearing. */
- /* */
- /* horiAdvance :: The horizontal advance. */
- /* */
- /* vertBearingX :: The vertical left bearing. */
- /* */
- /* vertBearingY :: The vertical top bearing. */
- /* */
- /* vertAdvance :: The vertical advance. */
- /* */
- typedef struct TT_SBit_MetricsRec_
- {
- FT_UShort height;
- FT_UShort width;
-
- FT_Short horiBearingX;
- FT_Short horiBearingY;
- FT_UShort horiAdvance;
-
- FT_Short vertBearingX;
- FT_Short vertBearingY;
- FT_UShort vertAdvance;
-
- } TT_SBit_MetricsRec, *TT_SBit_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_SmallMetricsRec */
- /* */
- /* <Description> */
- /* A structure used to hold the small metrics of a given glyph bitmap */
- /* in a TrueType or OpenType font. These are usually found in the */
- /* `EBDT' (Microsoft) or the `bdat' (Apple) table. */
- /* */
- /* <Fields> */
- /* height :: The glyph height in pixels. */
- /* */
- /* width :: The glyph width in pixels. */
- /* */
- /* bearingX :: The left-side bearing. */
- /* */
- /* bearingY :: The top-side bearing. */
- /* */
- /* advance :: The advance width or height. */
- /* */
- typedef struct TT_SBit_Small_Metrics_
- {
- FT_Byte height;
- FT_Byte width;
-
- FT_Char bearingX;
- FT_Char bearingY;
- FT_Byte advance;
-
- } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_LineMetricsRec */
- /* */
- /* <Description> */
- /* A structure used to describe the text line metrics of a given */
- /* bitmap strike, for either a horizontal or vertical layout. */
- /* */
- /* <Fields> */
- /* ascender :: The ascender in pixels. */
- /* */
- /* descender :: The descender in pixels. */
- /* */
- /* max_width :: The maximum glyph width in pixels. */
- /* */
- /* caret_slope_enumerator :: Rise of the caret slope, typically set */
- /* to 1 for non-italic fonts. */
- /* */
- /* caret_slope_denominator :: Rise of the caret slope, typically set */
- /* to 0 for non-italic fonts. */
- /* */
- /* caret_offset :: Offset in pixels to move the caret for */
- /* proper positioning. */
- /* */
- /* min_origin_SB :: Minimum of horiBearingX (resp. */
- /* vertBearingY). */
- /* min_advance_SB :: Minimum of */
- /* */
- /* horizontal advance - */
- /* ( horiBearingX + width ) */
- /* */
- /* resp. */
- /* */
- /* vertical advance - */
- /* ( vertBearingY + height ) */
- /* */
- /* max_before_BL :: Maximum of horiBearingY (resp. */
- /* vertBearingY). */
- /* */
- /* min_after_BL :: Minimum of */
- /* */
- /* horiBearingY - height */
- /* */
- /* resp. */
- /* */
- /* vertBearingX - width */
- /* */
- /* pads :: Unused (to make the size of the record */
- /* a multiple of 32 bits. */
- /* */
- typedef struct TT_SBit_LineMetricsRec_
- {
- FT_Char ascender;
- FT_Char descender;
- FT_Byte max_width;
- FT_Char caret_slope_numerator;
- FT_Char caret_slope_denominator;
- FT_Char caret_offset;
- FT_Char min_origin_SB;
- FT_Char min_advance_SB;
- FT_Char max_before_BL;
- FT_Char min_after_BL;
- FT_Char pads[2];
-
- } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_RangeRec */
- /* */
- /* <Description> */
- /* A TrueType/OpenType subIndexTable as defined in the `EBLC' */
- /* (Microsoft) or `bloc' (Apple) tables. */
- /* */
- /* <Fields> */
- /* first_glyph :: The first glyph index in the range. */
- /* */
- /* last_glyph :: The last glyph index in the range. */
- /* */
- /* index_format :: The format of index table. Valid values are 1 */
- /* to 5. */
- /* */
- /* image_format :: The format of `EBDT' image data. */
- /* */
- /* image_offset :: The offset to image data in `EBDT'. */
- /* */
- /* image_size :: For index formats 2 and 5. This is the size in */
- /* bytes of each glyph bitmap. */
- /* */
- /* big_metrics :: For index formats 2 and 5. This is the big */
- /* metrics for each glyph bitmap. */
- /* */
- /* num_glyphs :: For index formats 4 and 5. This is the number of */
- /* glyphs in the code array. */
- /* */
- /* glyph_offsets :: For index formats 1 and 3. */
- /* */
- /* glyph_codes :: For index formats 4 and 5. */
- /* */
- /* table_offset :: The offset of the index table in the `EBLC' */
- /* table. Only used during strike loading. */
- /* */
- typedef struct TT_SBit_RangeRec_
- {
- FT_UShort first_glyph;
- FT_UShort last_glyph;
-
- FT_UShort index_format;
- FT_UShort image_format;
- FT_ULong image_offset;
-
- FT_ULong image_size;
- TT_SBit_MetricsRec metrics;
- FT_ULong num_glyphs;
-
- FT_ULong* glyph_offsets;
- FT_UShort* glyph_codes;
-
- FT_ULong table_offset;
-
- } TT_SBit_RangeRec, *TT_SBit_Range;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_StrikeRec */
- /* */
- /* <Description> */
- /* A structure used describe a given bitmap strike in the `EBLC' */
- /* (Microsoft) or `bloc' (Apple) tables. */
- /* */
- /* <Fields> */
- /* num_index_ranges :: The number of index ranges. */
- /* */
- /* index_ranges :: An array of glyph index ranges. */
- /* */
- /* color_ref :: Unused. `color_ref' is put in for future */
- /* enhancements, but these fields are already */
- /* in use by other platforms (e.g. Newton). */
- /* For details, please see */
- /* */
- /* http://fonts.apple.com/ */
- /* TTRefMan/RM06/Chap6bloc.html */
- /* */
- /* hori :: The line metrics for horizontal layouts. */
- /* */
- /* vert :: The line metrics for vertical layouts. */
- /* */
- /* start_glyph :: The lowest glyph index for this strike. */
- /* */
- /* end_glyph :: The highest glyph index for this strike. */
- /* */
- /* x_ppem :: The number of horizontal pixels per EM. */
- /* */
- /* y_ppem :: The number of vertical pixels per EM. */
- /* */
- /* bit_depth :: The bit depth. Valid values are 1, 2, 4, */
- /* and 8. */
- /* */
- /* flags :: Is this a vertical or horizontal strike? For */
- /* details, please see */
- /* */
- /* http://fonts.apple.com/ */
- /* TTRefMan/RM06/Chap6bloc.html */
- /* */
- typedef struct TT_SBit_StrikeRec_
- {
- FT_Int num_ranges;
- TT_SBit_Range sbit_ranges;
- FT_ULong ranges_offset;
-
- FT_ULong color_ref;
-
- TT_SBit_LineMetricsRec hori;
- TT_SBit_LineMetricsRec vert;
-
- FT_UShort start_glyph;
- FT_UShort end_glyph;
-
- FT_Byte x_ppem;
- FT_Byte y_ppem;
-
- FT_Byte bit_depth;
- FT_Char flags;
-
- } TT_SBit_StrikeRec, *TT_SBit_Strike;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_ComponentRec */
- /* */
- /* <Description> */
- /* A simple structure to describe a compound sbit element. */
- /* */
- /* <Fields> */
- /* glyph_code :: The element's glyph index. */
- /* */
- /* x_offset :: The element's left bearing. */
- /* */
- /* y_offset :: The element's top bearing. */
- /* */
- typedef struct TT_SBit_ComponentRec_
- {
- FT_UShort glyph_code;
- FT_Char x_offset;
- FT_Char y_offset;
-
- } TT_SBit_ComponentRec, *TT_SBit_Component;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_ScaleRec */
- /* */
- /* <Description> */
- /* A structure used describe a given bitmap scaling table, as defined */
- /* in the `EBSC' table. */
- /* */
- /* <Fields> */
- /* hori :: The horizontal line metrics. */
- /* */
- /* vert :: The vertical line metrics. */
- /* */
- /* x_ppem :: The number of horizontal pixels per EM. */
- /* */
- /* y_ppem :: The number of vertical pixels per EM. */
- /* */
- /* x_ppem_substitute :: Substitution x_ppem value. */
- /* */
- /* y_ppem_substitute :: Substitution y_ppem value. */
- /* */
- typedef struct TT_SBit_ScaleRec_
- {
- TT_SBit_LineMetricsRec hori;
- TT_SBit_LineMetricsRec vert;
-
- FT_Byte x_ppem;
- FT_Byte y_ppem;
-
- FT_Byte x_ppem_substitute;
- FT_Byte y_ppem_substitute;
-
- } TT_SBit_ScaleRec, *TT_SBit_Scale;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Post_20Rec */
- /* */
- /* <Description> */
- /* Postscript names sub-table, format 2.0. Stores the PS name of */
- /* each glyph in the font face. */
- /* */
- /* <Fields> */
- /* num_glyphs :: The number of named glyphs in the table. */
- /* */
- /* num_names :: The number of PS names stored in the table. */
- /* */
- /* glyph_indices :: The indices of the glyphs in the names arrays. */
- /* */
- /* glyph_names :: The PS names not in Mac Encoding. */
- /* */
- typedef struct TT_Post_20Rec_
- {
- FT_UShort num_glyphs;
- FT_UShort num_names;
- FT_UShort* glyph_indices;
- FT_Char** glyph_names;
-
- } TT_Post_20Rec, *TT_Post_20;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Post_25Rec */
- /* */
- /* <Description> */
- /* Postscript names sub-table, format 2.5. Stores the PS name of */
- /* each glyph in the font face. */
- /* */
- /* <Fields> */
- /* num_glyphs :: The number of glyphs in the table. */
- /* */
- /* offsets :: An array of signed offsets in a normal Mac */
- /* Postscript name encoding. */
- /* */
- typedef struct TT_Post_25_
- {
- FT_UShort num_glyphs;
- FT_Char* offsets;
-
- } TT_Post_25Rec, *TT_Post_25;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Post_NamesRec */
- /* */
- /* <Description> */
- /* Postscript names table, either format 2.0 or 2.5. */
- /* */
- /* <Fields> */
- /* loaded :: A flag to indicate whether the PS names are loaded. */
- /* */
- /* format_20 :: The sub-table used for format 2.0. */
- /* */
- /* format_25 :: The sub-table used for format 2.5. */
- /* */
- typedef struct TT_Post_NamesRec_
- {
- FT_Bool loaded;
-
- union
- {
- TT_Post_20Rec format_20;
- TT_Post_25Rec format_25;
-
- } names;
-
- } TT_Post_NamesRec, *TT_Post_Names;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** GX VARIATION TABLE SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- typedef struct GX_BlendRec_ *GX_Blend;
-#endif
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*
- * These types are used to support a `BDF ' table that isn't part of the
- * official TrueType specification. It is mainly used in SFNT-based
- * bitmap fonts that were generated from a set of BDF fonts.
- *
- * The format of the table is as follows.
- *
- * USHORT version `BDF ' table version number, should be 0x0001.
- * USHORT strikeCount Number of strikes (bitmap sizes) in this table.
- * ULONG stringTable Offset (from start of BDF table) to string
- * table.
- *
- * This is followed by an array of `strikeCount' descriptors, having the
- * following format.
- *
- * USHORT ppem Vertical pixels per EM for this strike.
- * USHORT numItems Number of items for this strike (properties and
- * atoms). Maximum is 255.
- *
- * This array in turn is followed by `strikeCount' value sets. Each
- * `value set' is an array of `numItems' items with the following format.
- *
- * ULONG item_name Offset in string table to item name.
- * USHORT item_type The item type. Possible values are
- * 0 => string (e.g., COMMENT)
- * 1 => atom (e.g., FONT or even SIZE)
- * 2 => int32
- * 3 => uint32
- * 0x10 => A flag to indicate a properties. This
- * is ORed with the above values.
- * ULONG item_value For strings => Offset into string table without
- * the corresponding double quotes.
- * For atoms => Offset into string table.
- * For integers => Direct value.
- *
- * All strings in the string table consist of bytes and are
- * zero-terminated.
- *
- */
-
-#ifdef TT_CONFIG_OPTION_BDF
-
- typedef struct TT_BDFRec_
- {
- FT_Byte* table;
- FT_Byte* table_end;
- FT_Byte* strings;
- FT_ULong strings_size;
- FT_UInt num_strikes;
- FT_Bool loaded;
-
- } TT_BDFRec, *TT_BDF;
-
-#endif /* TT_CONFIG_OPTION_BDF */
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** ORIGINAL TT_FACE CLASS DEFINITION ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This structure/class is defined here because it is common to the */
- /* following formats: TTF, OpenType-TT, and OpenType-CFF. */
- /* */
- /* Note, however, that the classes TT_Size and TT_GlyphSlot are not */
- /* shared between font drivers, and are thus defined in `ttobjs.h'. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Face */
- /* */
- /* <Description> */
- /* A handle to a TrueType face/font object. A TT_Face encapsulates */
- /* the resolution and scaling independent parts of a TrueType font */
- /* resource. */
- /* */
- /* <Note> */
- /* The TT_Face structure is also used as a `parent class' for the */
- /* OpenType-CFF class (T2_Face). */
- /* */
- typedef struct TT_FaceRec_* TT_Face;
-
-
- /* a function type used for the truetype bytecode interpreter hooks */
- typedef FT_Error
- (*TT_Interpreter)( void* exec_context );
-
- /* forward declaration */
- typedef struct TT_LoaderRec_* TT_Loader;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Loader_GotoTableFunc */
- /* */
- /* <Description> */
- /* Seeks a stream to the start of a given TrueType table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* tag :: A 4-byte tag used to name the table. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* <Output> */
- /* length :: The length of the table in bytes. Set to 0 if not */
- /* needed. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be at the font file's origin. */
- /* */
- typedef FT_Error
- (*TT_Loader_GotoTableFunc)( TT_Face face,
- FT_ULong tag,
- FT_Stream stream,
- FT_ULong* length );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Loader_StartGlyphFunc */
- /* */
- /* <Description> */
- /* Seeks a stream to the start of a given glyph element, and opens a */
- /* frame for it. */
- /* */
- /* <Input> */
- /* loader :: The current TrueType glyph loader object. */
- /* */
- /* glyph index :: The index of the glyph to access. */
- /* */
- /* offset :: The offset of the glyph according to the */
- /* `locations' table. */
- /* */
- /* byte_count :: The size of the frame in bytes. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function is normally equivalent to FT_STREAM_SEEK(offset) */
- /* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, */
- /* but alternative formats (e.g. compressed ones) might use something */
- /* different. */
- /* */
- typedef FT_Error
- (*TT_Loader_StartGlyphFunc)( TT_Loader loader,
- FT_UInt glyph_index,
- FT_ULong offset,
- FT_UInt byte_count );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Loader_ReadGlyphFunc */
- /* */
- /* <Description> */
- /* Reads one glyph element (its header, a simple glyph, or a */
- /* composite) from the loader's current stream frame. */
- /* */
- /* <Input> */
- /* loader :: The current TrueType glyph loader object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error
- (*TT_Loader_ReadGlyphFunc)( TT_Loader loader );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Loader_EndGlyphFunc */
- /* */
- /* <Description> */
- /* Closes the current loader stream frame for the glyph. */
- /* */
- /* <Input> */
- /* loader :: The current TrueType glyph loader object. */
- /* */
- typedef void
- (*TT_Loader_EndGlyphFunc)( TT_Loader loader );
-
-
- typedef enum TT_SbitTableType_
- {
- TT_SBIT_TABLE_TYPE_NONE = 0,
- TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */
- /* `bloc' (Apple) */
- TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google) */
- TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple) */
-
- /* do not remove */
- TT_SBIT_TABLE_TYPE_MAX
-
- } TT_SbitTableType;
-
-
- /*************************************************************************/
- /* */
- /* TrueType Face Type */
- /* */
- /* <Struct> */
- /* TT_Face */
- /* */
- /* <Description> */
- /* The TrueType face class. These objects model the resolution and */
- /* point-size independent data found in a TrueType font file. */
- /* */
- /* <Fields> */
- /* root :: The base FT_Face structure, managed by the */
- /* base layer. */
- /* */
- /* ttc_header :: The TrueType collection header, used when */
- /* the file is a `ttc' rather than a `ttf'. */
- /* For ordinary font files, the field */
- /* `ttc_header.count' is set to 0. */
- /* */
- /* format_tag :: The font format tag. */
- /* */
- /* num_tables :: The number of TrueType tables in this font */
- /* file. */
- /* */
- /* dir_tables :: The directory of TrueType tables for this */
- /* font file. */
- /* */
- /* header :: The font's font header (`head' table). */
- /* Read on font opening. */
- /* */
- /* horizontal :: The font's horizontal header (`hhea' */
- /* table). This field also contains the */
- /* associated horizontal metrics table */
- /* (`hmtx'). */
- /* */
- /* max_profile :: The font's maximum profile table. Read on */
- /* font opening. Note that some maximum */
- /* values cannot be taken directly from this */
- /* table. We thus define additional fields */
- /* below to hold the computed maxima. */
- /* */
- /* vertical_info :: A boolean which is set when the font file */
- /* contains vertical metrics. If not, the */
- /* value of the `vertical' field is */
- /* undefined. */
- /* */
- /* vertical :: The font's vertical header (`vhea' table). */
- /* This field also contains the associated */
- /* vertical metrics table (`vmtx'), if found. */
- /* IMPORTANT: The contents of this field is */
- /* undefined if the `verticalInfo' field is */
- /* unset. */
- /* */
- /* num_names :: The number of name records within this */
- /* TrueType font. */
- /* */
- /* name_table :: The table of name records (`name'). */
- /* */
- /* os2 :: The font's OS/2 table (`OS/2'). */
- /* */
- /* postscript :: The font's PostScript table (`post' */
- /* table). The PostScript glyph names are */
- /* not loaded by the driver on face opening. */
- /* See the `ttpost' module for more details. */
- /* */
- /* cmap_table :: Address of the face's `cmap' SFNT table */
- /* in memory (it's an extracted frame). */
- /* */
- /* cmap_size :: The size in bytes of the `cmap_table' */
- /* described above. */
- /* */
- /* goto_table :: A function called by each TrueType table */
- /* loader to position a stream's cursor to */
- /* the start of a given table according to */
- /* its tag. It defaults to TT_Goto_Face but */
- /* can be different for strange formats (e.g. */
- /* Type 42). */
- /* */
- /* access_glyph_frame :: A function used to access the frame of a */
- /* given glyph within the face's font file. */
- /* */
- /* forget_glyph_frame :: A function used to forget the frame of a */
- /* given glyph when all data has been loaded. */
- /* */
- /* read_glyph_header :: A function used to read a glyph header. */
- /* It must be called between an `access' and */
- /* `forget'. */
- /* */
- /* read_simple_glyph :: A function used to read a simple glyph. */
- /* It must be called after the header was */
- /* read, and before the `forget'. */
- /* */
- /* read_composite_glyph :: A function used to read a composite glyph. */
- /* It must be called after the header was */
- /* read, and before the `forget'. */
- /* */
- /* sfnt :: A pointer to the SFNT service. */
- /* */
- /* psnames :: A pointer to the PostScript names service. */
- /* */
- /* hdmx :: The face's horizontal device metrics */
- /* (`hdmx' table). This table is optional in */
- /* TrueType/OpenType fonts. */
- /* */
- /* gasp :: The grid-fitting and scaling properties */
- /* table (`gasp'). This table is optional in */
- /* TrueType/OpenType fonts. */
- /* */
- /* pclt :: The `pclt' SFNT table. */
- /* */
- /* num_sbit_scales :: The number of sbit scales for this font. */
- /* */
- /* sbit_scales :: Array of sbit scales embedded in this */
- /* font. This table is optional in a */
- /* TrueType/OpenType font. */
- /* */
- /* postscript_names :: A table used to store the Postscript names */
- /* of the glyphs for this font. See the */
- /* file `ttconfig.h' for comments on the */
- /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
- /* */
- /* num_locations :: The number of glyph locations in this */
- /* TrueType file. This should be */
- /* identical to the number of glyphs. */
- /* Ignored for Type 2 fonts. */
- /* */
- /* glyph_locations :: An array of longs. These are offsets to */
- /* glyph data within the `glyf' table. */
- /* Ignored for Type 2 font faces. */
- /* */
- /* glyf_len :: The length of the `glyf' table. Needed */
- /* for malformed `loca' tables. */
- /* */
- /* font_program_size :: Size in bytecodes of the face's font */
- /* program. 0 if none defined. Ignored for */
- /* Type 2 fonts. */
- /* */
- /* font_program :: The face's font program (bytecode stream) */
- /* executed at load time, also used during */
- /* glyph rendering. Comes from the `fpgm' */
- /* table. Ignored for Type 2 font fonts. */
- /* */
- /* cvt_program_size :: The size in bytecodes of the face's cvt */
- /* program. Ignored for Type 2 fonts. */
- /* */
- /* cvt_program :: The face's cvt program (bytecode stream) */
- /* executed each time an instance/size is */
- /* changed/reset. Comes from the `prep' */
- /* table. Ignored for Type 2 fonts. */
- /* */
- /* cvt_size :: Size of the control value table (in */
- /* entries). Ignored for Type 2 fonts. */
- /* */
- /* cvt :: The face's original control value table. */
- /* Coordinates are expressed in unscaled font */
- /* units. Comes from the `cvt ' table. */
- /* Ignored for Type 2 fonts. */
- /* */
- /* num_kern_pairs :: The number of kerning pairs present in the */
- /* font file. The engine only loads the */
- /* first horizontal format 0 kern table it */
- /* finds in the font file. Ignored for */
- /* Type 2 fonts. */
- /* */
- /* kern_table_index :: The index of the kerning table in the font */
- /* kerning directory. Ignored for Type 2 */
- /* fonts. */
- /* */
- /* interpreter :: A pointer to the TrueType bytecode */
- /* interpreters field is also used to hook */
- /* the debugger in `ttdebug'. */
- /* */
- /* unpatented_hinting :: If true, use only unpatented methods in */
- /* the bytecode interpreter. */
- /* */
- /* doblend :: A boolean which is set if the font should */
- /* be blended (this is for GX var). */
- /* */
- /* blend :: Contains the data needed to control GX */
- /* variation tables (rather like Multiple */
- /* Master data). */
- /* */
- /* extra :: Reserved for third-party font drivers. */
- /* */
- /* postscript_name :: The PS name of the font. Used by the */
- /* postscript name service. */
- /* */
- typedef struct TT_FaceRec_
- {
- FT_FaceRec root;
-
- TTC_HeaderRec ttc_header;
-
- FT_ULong format_tag;
- FT_UShort num_tables;
- TT_Table dir_tables;
-
- TT_Header header; /* TrueType header table */
- TT_HoriHeader horizontal; /* TrueType horizontal header */
-
- TT_MaxProfile max_profile;
-
- FT_Bool vertical_info;
- TT_VertHeader vertical; /* TT Vertical header, if present */
-
- FT_UShort num_names; /* number of name records */
- TT_NameTableRec name_table; /* name table */
-
- TT_OS2 os2; /* TrueType OS/2 table */
- TT_Postscript postscript; /* TrueType Postscript table */
-
- FT_Byte* cmap_table; /* extracted `cmap' table */
- FT_ULong cmap_size;
-
- TT_Loader_GotoTableFunc goto_table;
-
- TT_Loader_StartGlyphFunc access_glyph_frame;
- TT_Loader_EndGlyphFunc forget_glyph_frame;
- TT_Loader_ReadGlyphFunc read_glyph_header;
- TT_Loader_ReadGlyphFunc read_simple_glyph;
- TT_Loader_ReadGlyphFunc read_composite_glyph;
-
- /* a typeless pointer to the SFNT_Interface table used to load */
- /* the basic TrueType tables in the face object */
- void* sfnt;
-
- /* a typeless pointer to the FT_Service_PsCMapsRec table used to */
- /* handle glyph names <-> unicode & Mac values */
- void* psnames;
-
-
- /***********************************************************************/
- /* */
- /* Optional TrueType/OpenType tables */
- /* */
- /***********************************************************************/
-
- /* grid-fitting and scaling table */
- TT_GaspRec gasp; /* the `gasp' table */
-
- /* PCL 5 table */
- TT_PCLT pclt;
-
- /* embedded bitmaps support */
- FT_ULong num_sbit_scales;
- TT_SBit_Scale sbit_scales;
-
- /* postscript names table */
- TT_Post_NamesRec postscript_names;
-
-
- /***********************************************************************/
- /* */
- /* TrueType-specific fields (ignored by the OTF-Type2 driver) */
- /* */
- /***********************************************************************/
-
- /* the font program, if any */
- FT_ULong font_program_size;
- FT_Byte* font_program;
-
- /* the cvt program, if any */
- FT_ULong cvt_program_size;
- FT_Byte* cvt_program;
-
- /* the original, unscaled, control value table */
- FT_ULong cvt_size;
- FT_Short* cvt;
-
- /* A pointer to the bytecode interpreter to use. This is also */
- /* used to hook the debugger for the `ttdebug' utility. */
- TT_Interpreter interpreter;
-
-#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- /* Use unpatented hinting only. */
- FT_Bool unpatented_hinting;
-#endif
-
- /***********************************************************************/
- /* */
- /* Other tables or fields. This is used by derivative formats like */
- /* OpenType. */
- /* */
- /***********************************************************************/
-
- FT_Generic extra;
-
- const char* postscript_name;
-
- FT_ULong glyf_len;
-
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Bool doblend;
- GX_Blend blend;
-#endif
-
- /* since version 2.2 */
-
- FT_Byte* horz_metrics;
- FT_ULong horz_metrics_size;
-
- FT_Byte* vert_metrics;
- FT_ULong vert_metrics_size;
-
- FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
- FT_Byte* glyph_locations;
-
- FT_Byte* hdmx_table;
- FT_ULong hdmx_table_size;
- FT_UInt hdmx_record_count;
- FT_ULong hdmx_record_size;
- FT_Byte* hdmx_record_sizes;
-
- FT_Byte* sbit_table;
- FT_ULong sbit_table_size;
- TT_SbitTableType sbit_table_type;
- FT_UInt sbit_num_strikes;
-
- FT_Byte* kern_table;
- FT_ULong kern_table_size;
- FT_UInt num_kern_tables;
- FT_UInt32 kern_avail_bits;
- FT_UInt32 kern_order_bits;
-
-#ifdef TT_CONFIG_OPTION_BDF
- TT_BDFRec bdf;
-#endif /* TT_CONFIG_OPTION_BDF */
-
- /* since 2.3.0 */
- FT_ULong horz_metrics_offset;
- FT_ULong vert_metrics_offset;
-
-#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- /* since 2.4.12 */
- FT_ULong sph_found_func_flags; /* special functions found */
- /* for this face */
- FT_Bool sph_compatibility_mode;
-#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-
- } TT_FaceRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_GlyphZoneRec */
- /* */
- /* <Description> */
- /* A glyph zone is used to load, scale and hint glyph outline */
- /* coordinates. */
- /* */
- /* <Fields> */
- /* memory :: A handle to the memory manager. */
- /* */
- /* max_points :: The maximum size in points of the zone. */
- /* */
- /* max_contours :: Max size in links contours of the zone. */
- /* */
- /* n_points :: The current number of points in the zone. */
- /* */
- /* n_contours :: The current number of contours in the zone. */
- /* */
- /* org :: The original glyph coordinates (font */
- /* units/scaled). */
- /* */
- /* cur :: The current glyph coordinates (scaled/hinted). */
- /* */
- /* tags :: The point control tags. */
- /* */
- /* contours :: The contours end points. */
- /* */
- /* first_point :: Offset of the current subglyph's first point. */
- /* */
- typedef struct TT_GlyphZoneRec_
- {
- FT_Memory memory;
- FT_UShort max_points;
- FT_UShort max_contours;
- FT_UShort n_points; /* number of points in zone */
- FT_Short n_contours; /* number of contours */
-
- FT_Vector* org; /* original point coordinates */
- FT_Vector* cur; /* current point coordinates */
- FT_Vector* orus; /* original (unscaled) point coordinates */
-
- FT_Byte* tags; /* current touch flags */
- FT_UShort* contours; /* contour end points */
-
- FT_UShort first_point; /* offset of first (#0) point */
-
- } TT_GlyphZoneRec, *TT_GlyphZone;
-
-
- /* handle to execution context */
- typedef struct TT_ExecContextRec_* TT_ExecContext;
-
- /* glyph loader structure */
- typedef struct TT_LoaderRec_
- {
- FT_Face face;
- FT_Size size;
- FT_GlyphSlot glyph;
- FT_GlyphLoader gloader;
-
- FT_ULong load_flags;
- FT_UInt glyph_index;
-
- FT_Stream stream;
- FT_Int byte_len;
-
- FT_Short n_contours;
- FT_BBox bbox;
- FT_Int left_bearing;
- FT_Int advance;
- FT_Int linear;
- FT_Bool linear_def;
- FT_Vector pp1;
- FT_Vector pp2;
-
- FT_ULong glyf_offset;
-
- /* the zone where we load our glyphs */
- TT_GlyphZoneRec base;
- TT_GlyphZoneRec zone;
-
- TT_ExecContext exec;
- FT_Byte* instructions;
- FT_ULong ins_pos;
-
- /* for possible extensibility in other formats */
- void* other;
-
- /* since version 2.1.8 */
- FT_Int top_bearing;
- FT_Int vadvance;
- FT_Vector pp3;
- FT_Vector pp4;
-
- /* since version 2.2.1 */
- FT_Byte* cursor;
- FT_Byte* limit;
-
- } TT_LoaderRec;
-
-
-FT_END_HEADER
-
-#endif /* __TTTYPES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/t1tables.h b/src/3rdparty/freetype/include/t1tables.h
deleted file mode 100644
index 61aefdd541..0000000000
--- a/src/3rdparty/freetype/include/t1tables.h
+++ /dev/null
@@ -1,760 +0,0 @@
-/***************************************************************************/
-/* */
-/* t1tables.h */
-/* */
-/* Basic Type 1/Type 2 tables definitions and interface (specification */
-/* only). */
-/* */
-/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __T1TABLES_H__
-#define __T1TABLES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* type1_tables */
- /* */
- /* <Title> */
- /* Type 1 Tables */
- /* */
- /* <Abstract> */
- /* Type~1 (PostScript) specific font tables. */
- /* */
- /* <Description> */
- /* This section contains the definition of Type 1-specific tables, */
- /* including structures related to other PostScript font formats. */
- /* */
- /* <Order> */
- /* PS_FontInfoRec */
- /* PS_FontInfo */
- /* PS_PrivateRec */
- /* PS_Private */
- /* */
- /* CID_FaceDictRec */
- /* CID_FaceDict */
- /* CID_FaceInfoRec */
- /* CID_FaceInfo */
- /* */
- /* FT_Has_PS_Glyph_Names */
- /* FT_Get_PS_Font_Info */
- /* FT_Get_PS_Font_Private */
- /* FT_Get_PS_Font_Value */
- /* */
- /* T1_Blend_Flags */
- /* T1_EncodingType */
- /* PS_Dict_Keys */
- /* */
- /*************************************************************************/
-
-
- /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
- /* structures in order to support Multiple Master fonts. */
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_FontInfoRec */
- /* */
- /* <Description> */
- /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
- /* Note that for Multiple Master fonts, each instance has its own */
- /* FontInfo dictionary. */
- /* */
- typedef struct PS_FontInfoRec_
- {
- FT_String* version;
- FT_String* notice;
- FT_String* full_name;
- FT_String* family_name;
- FT_String* weight;
- FT_Long italic_angle;
- FT_Bool is_fixed_pitch;
- FT_Short underline_position;
- FT_UShort underline_thickness;
-
- } PS_FontInfoRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_FontInfo */
- /* */
- /* <Description> */
- /* A handle to a @PS_FontInfoRec structure. */
- /* */
- typedef struct PS_FontInfoRec_* PS_FontInfo;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* T1_FontInfo */
- /* */
- /* <Description> */
- /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef PS_FontInfoRec T1_FontInfo;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_PrivateRec */
- /* */
- /* <Description> */
- /* A structure used to model a Type~1 or Type~2 private dictionary. */
- /* Note that for Multiple Master fonts, each instance has its own */
- /* Private dictionary. */
- /* */
- typedef struct PS_PrivateRec_
- {
- FT_Int unique_id;
- FT_Int lenIV;
-
- FT_Byte num_blue_values;
- FT_Byte num_other_blues;
- FT_Byte num_family_blues;
- FT_Byte num_family_other_blues;
-
- FT_Short blue_values[14];
- FT_Short other_blues[10];
-
- FT_Short family_blues [14];
- FT_Short family_other_blues[10];
-
- FT_Fixed blue_scale;
- FT_Int blue_shift;
- FT_Int blue_fuzz;
-
- FT_UShort standard_width[1];
- FT_UShort standard_height[1];
-
- FT_Byte num_snap_widths;
- FT_Byte num_snap_heights;
- FT_Bool force_bold;
- FT_Bool round_stem_up;
-
- FT_Short snap_widths [13]; /* including std width */
- FT_Short snap_heights[13]; /* including std height */
-
- FT_Fixed expansion_factor;
-
- FT_Long language_group;
- FT_Long password;
-
- FT_Short min_feature[2];
-
- } PS_PrivateRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* PS_Private */
- /* */
- /* <Description> */
- /* A handle to a @PS_PrivateRec structure. */
- /* */
- typedef struct PS_PrivateRec_* PS_Private;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* T1_Private */
- /* */
- /* <Description> */
- /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef PS_PrivateRec T1_Private;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* T1_Blend_Flags */
- /* */
- /* <Description> */
- /* A set of flags used to indicate which fields are present in a */
- /* given blend dictionary (font info or private). Used to support */
- /* Multiple Masters fonts. */
- /* */
- /* <Values> */
- /* T1_BLEND_UNDERLINE_POSITION :: */
- /* T1_BLEND_UNDERLINE_THICKNESS :: */
- /* T1_BLEND_ITALIC_ANGLE :: */
- /* T1_BLEND_BLUE_VALUES :: */
- /* T1_BLEND_OTHER_BLUES :: */
- /* T1_BLEND_STANDARD_WIDTH :: */
- /* T1_BLEND_STANDARD_HEIGHT :: */
- /* T1_BLEND_STEM_SNAP_WIDTHS :: */
- /* T1_BLEND_STEM_SNAP_HEIGHTS :: */
- /* T1_BLEND_BLUE_SCALE :: */
- /* T1_BLEND_BLUE_SHIFT :: */
- /* T1_BLEND_FAMILY_BLUES :: */
- /* T1_BLEND_FAMILY_OTHER_BLUES :: */
- /* T1_BLEND_FORCE_BOLD :: */
- /* */
- typedef enum T1_Blend_Flags_
- {
- /* required fields in a FontInfo blend dictionary */
- T1_BLEND_UNDERLINE_POSITION = 0,
- T1_BLEND_UNDERLINE_THICKNESS,
- T1_BLEND_ITALIC_ANGLE,
-
- /* required fields in a Private blend dictionary */
- T1_BLEND_BLUE_VALUES,
- T1_BLEND_OTHER_BLUES,
- T1_BLEND_STANDARD_WIDTH,
- T1_BLEND_STANDARD_HEIGHT,
- T1_BLEND_STEM_SNAP_WIDTHS,
- T1_BLEND_STEM_SNAP_HEIGHTS,
- T1_BLEND_BLUE_SCALE,
- T1_BLEND_BLUE_SHIFT,
- T1_BLEND_FAMILY_BLUES,
- T1_BLEND_FAMILY_OTHER_BLUES,
- T1_BLEND_FORCE_BOLD,
-
- T1_BLEND_MAX /* do not remove */
-
- } T1_Blend_Flags;
-
-
- /* these constants are deprecated; use the corresponding */
- /* `T1_Blend_Flags' values instead */
-#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
-#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
-#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
-#define t1_blend_blue_values T1_BLEND_BLUE_VALUES
-#define t1_blend_other_blues T1_BLEND_OTHER_BLUES
-#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
-#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
-#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
-#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
-#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
-#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
-#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
-#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
-#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
-#define t1_blend_max T1_BLEND_MAX
-
- /* */
-
-
- /* maximum number of Multiple Masters designs, as defined in the spec */
-#define T1_MAX_MM_DESIGNS 16
-
- /* maximum number of Multiple Masters axes, as defined in the spec */
-#define T1_MAX_MM_AXIS 4
-
- /* maximum number of elements in a design map */
-#define T1_MAX_MM_MAP_POINTS 20
-
-
- /* this structure is used to store the BlendDesignMap entry for an axis */
- typedef struct PS_DesignMap_
- {
- FT_Byte num_points;
- FT_Long* design_points;
- FT_Fixed* blend_points;
-
- } PS_DesignMapRec, *PS_DesignMap;
-
- /* backwards-compatible definition */
- typedef PS_DesignMapRec T1_DesignMap;
-
-
- typedef struct PS_BlendRec_
- {
- FT_UInt num_designs;
- FT_UInt num_axis;
-
- FT_String* axis_names[T1_MAX_MM_AXIS];
- FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
- PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
-
- FT_Fixed* weight_vector;
- FT_Fixed* default_weight_vector;
-
- PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
- PS_Private privates [T1_MAX_MM_DESIGNS + 1];
-
- FT_ULong blend_bitflags;
-
- FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
-
- /* since 2.3.0 */
-
- /* undocumented, optional: the default design instance; */
- /* corresponds to default_weight_vector -- */
- /* num_default_design_vector == 0 means it is not present */
- /* in the font and associated metrics files */
- FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
- FT_UInt num_default_design_vector;
-
- } PS_BlendRec, *PS_Blend;
-
-
- /* backwards-compatible definition */
- typedef PS_BlendRec T1_Blend;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceDictRec */
- /* */
- /* <Description> */
- /* A structure used to represent data in a CID top-level dictionary. */
- /* */
- typedef struct CID_FaceDictRec_
- {
- PS_PrivateRec private_dict;
-
- FT_UInt len_buildchar;
- FT_Fixed forcebold_threshold;
- FT_Pos stroke_width;
- FT_Fixed expansion_factor;
-
- FT_Byte paint_type;
- FT_Byte font_type;
- FT_Matrix font_matrix;
- FT_Vector font_offset;
-
- FT_UInt num_subrs;
- FT_ULong subrmap_offset;
- FT_Int sd_bytes;
-
- } CID_FaceDictRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceDict */
- /* */
- /* <Description> */
- /* A handle to a @CID_FaceDictRec structure. */
- /* */
- typedef struct CID_FaceDictRec_* CID_FaceDict;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FontDict */
- /* */
- /* <Description> */
- /* This type is equivalent to @CID_FaceDictRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef CID_FaceDictRec CID_FontDict;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceInfoRec */
- /* */
- /* <Description> */
- /* A structure used to represent CID Face information. */
- /* */
- typedef struct CID_FaceInfoRec_
- {
- FT_String* cid_font_name;
- FT_Fixed cid_version;
- FT_Int cid_font_type;
-
- FT_String* registry;
- FT_String* ordering;
- FT_Int supplement;
-
- PS_FontInfoRec font_info;
- FT_BBox font_bbox;
- FT_ULong uid_base;
-
- FT_Int num_xuid;
- FT_ULong xuid[16];
-
- FT_ULong cidmap_offset;
- FT_Int fd_bytes;
- FT_Int gd_bytes;
- FT_ULong cid_count;
-
- FT_Int num_dicts;
- CID_FaceDict font_dicts;
-
- FT_ULong data_offset;
-
- } CID_FaceInfoRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_FaceInfo */
- /* */
- /* <Description> */
- /* A handle to a @CID_FaceInfoRec structure. */
- /* */
- typedef struct CID_FaceInfoRec_* CID_FaceInfo;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CID_Info */
- /* */
- /* <Description> */
- /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
- /* */
- typedef CID_FaceInfoRec CID_Info;
-
-
- /************************************************************************
- *
- * @function:
- * FT_Has_PS_Glyph_Names
- *
- * @description:
- * Return true if a given face provides reliable PostScript glyph
- * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
- * except that certain fonts (mostly TrueType) contain incorrect
- * glyph name tables.
- *
- * When this function returns true, the caller is sure that the glyph
- * names returned by @FT_Get_Glyph_Name are reliable.
- *
- * @input:
- * face ::
- * face handle
- *
- * @return:
- * Boolean. True if glyph names are reliable.
- *
- */
- FT_EXPORT( FT_Int )
- FT_Has_PS_Glyph_Names( FT_Face face );
-
-
- /************************************************************************
- *
- * @function:
- * FT_Get_PS_Font_Info
- *
- * @description:
- * Retrieve the @PS_FontInfoRec structure corresponding to a given
- * PostScript font.
- *
- * @input:
- * face ::
- * PostScript face handle.
- *
- * @output:
- * afont_info ::
- * Output font info structure pointer.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The string pointers within the font info structure are owned by
- * the face and don't need to be freed by the caller.
- *
- * If the font's format is not PostScript-based, this function will
- * return the `FT_Err_Invalid_Argument' error code.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_PS_Font_Info( FT_Face face,
- PS_FontInfo afont_info );
-
-
- /************************************************************************
- *
- * @function:
- * FT_Get_PS_Font_Private
- *
- * @description:
- * Retrieve the @PS_PrivateRec structure corresponding to a given
- * PostScript font.
- *
- * @input:
- * face ::
- * PostScript face handle.
- *
- * @output:
- * afont_private ::
- * Output private dictionary structure pointer.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The string pointers within the @PS_PrivateRec structure are owned by
- * the face and don't need to be freed by the caller.
- *
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument' error code.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_PS_Font_Private( FT_Face face,
- PS_Private afont_private );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* T1_EncodingType */
- /* */
- /* <Description> */
- /* An enumeration describing the `Encoding' entry in a Type 1 */
- /* dictionary. */
- /* */
- /* <Values> */
- /* T1_ENCODING_TYPE_NONE :: */
- /* T1_ENCODING_TYPE_ARRAY :: */
- /* T1_ENCODING_TYPE_STANDARD :: */
- /* T1_ENCODING_TYPE_ISOLATIN1 :: */
- /* T1_ENCODING_TYPE_EXPERT :: */
- /* */
- typedef enum T1_EncodingType_
- {
- T1_ENCODING_TYPE_NONE = 0,
- T1_ENCODING_TYPE_ARRAY,
- T1_ENCODING_TYPE_STANDARD,
- T1_ENCODING_TYPE_ISOLATIN1,
- T1_ENCODING_TYPE_EXPERT
-
- } T1_EncodingType;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* PS_Dict_Keys */
- /* */
- /* <Description> */
- /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
- /* the Type~1 dictionary entry to retrieve. */
- /* */
- /* <Values> */
- /* PS_DICT_FONT_TYPE :: */
- /* PS_DICT_FONT_MATRIX :: */
- /* PS_DICT_FONT_BBOX :: */
- /* PS_DICT_PAINT_TYPE :: */
- /* PS_DICT_FONT_NAME :: */
- /* PS_DICT_UNIQUE_ID :: */
- /* PS_DICT_NUM_CHAR_STRINGS :: */
- /* PS_DICT_CHAR_STRING_KEY :: */
- /* PS_DICT_CHAR_STRING :: */
- /* PS_DICT_ENCODING_TYPE :: */
- /* PS_DICT_ENCODING_ENTRY :: */
- /* PS_DICT_NUM_SUBRS :: */
- /* PS_DICT_SUBR :: */
- /* PS_DICT_STD_HW :: */
- /* PS_DICT_STD_VW :: */
- /* PS_DICT_NUM_BLUE_VALUES :: */
- /* PS_DICT_BLUE_VALUE :: */
- /* PS_DICT_BLUE_FUZZ :: */
- /* PS_DICT_NUM_OTHER_BLUES :: */
- /* PS_DICT_OTHER_BLUE :: */
- /* PS_DICT_NUM_FAMILY_BLUES :: */
- /* PS_DICT_FAMILY_BLUE :: */
- /* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */
- /* PS_DICT_FAMILY_OTHER_BLUE :: */
- /* PS_DICT_BLUE_SCALE :: */
- /* PS_DICT_BLUE_SHIFT :: */
- /* PS_DICT_NUM_STEM_SNAP_H :: */
- /* PS_DICT_STEM_SNAP_H :: */
- /* PS_DICT_NUM_STEM_SNAP_V :: */
- /* PS_DICT_STEM_SNAP_V :: */
- /* PS_DICT_FORCE_BOLD :: */
- /* PS_DICT_RND_STEM_UP :: */
- /* PS_DICT_MIN_FEATURE :: */
- /* PS_DICT_LEN_IV :: */
- /* PS_DICT_PASSWORD :: */
- /* PS_DICT_LANGUAGE_GROUP :: */
- /* PS_DICT_VERSION :: */
- /* PS_DICT_NOTICE :: */
- /* PS_DICT_FULL_NAME :: */
- /* PS_DICT_FAMILY_NAME :: */
- /* PS_DICT_WEIGHT :: */
- /* PS_DICT_IS_FIXED_PITCH :: */
- /* PS_DICT_UNDERLINE_POSITION :: */
- /* PS_DICT_UNDERLINE_THICKNESS :: */
- /* PS_DICT_FS_TYPE :: */
- /* PS_DICT_ITALIC_ANGLE :: */
- /* */
- typedef enum PS_Dict_Keys_
- {
- /* conventionally in the font dictionary */
- PS_DICT_FONT_TYPE, /* FT_Byte */
- PS_DICT_FONT_MATRIX, /* FT_Fixed */
- PS_DICT_FONT_BBOX, /* FT_Fixed */
- PS_DICT_PAINT_TYPE, /* FT_Byte */
- PS_DICT_FONT_NAME, /* FT_String* */
- PS_DICT_UNIQUE_ID, /* FT_Int */
- PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */
- PS_DICT_CHAR_STRING_KEY, /* FT_String* */
- PS_DICT_CHAR_STRING, /* FT_String* */
- PS_DICT_ENCODING_TYPE, /* T1_EncodingType */
- PS_DICT_ENCODING_ENTRY, /* FT_String* */
-
- /* conventionally in the font Private dictionary */
- PS_DICT_NUM_SUBRS, /* FT_Int */
- PS_DICT_SUBR, /* FT_String* */
- PS_DICT_STD_HW, /* FT_UShort */
- PS_DICT_STD_VW, /* FT_UShort */
- PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */
- PS_DICT_BLUE_VALUE, /* FT_Short */
- PS_DICT_BLUE_FUZZ, /* FT_Int */
- PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */
- PS_DICT_OTHER_BLUE, /* FT_Short */
- PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */
- PS_DICT_FAMILY_BLUE, /* FT_Short */
- PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */
- PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */
- PS_DICT_BLUE_SCALE, /* FT_Fixed */
- PS_DICT_BLUE_SHIFT, /* FT_Int */
- PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */
- PS_DICT_STEM_SNAP_H, /* FT_Short */
- PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */
- PS_DICT_STEM_SNAP_V, /* FT_Short */
- PS_DICT_FORCE_BOLD, /* FT_Bool */
- PS_DICT_RND_STEM_UP, /* FT_Bool */
- PS_DICT_MIN_FEATURE, /* FT_Short */
- PS_DICT_LEN_IV, /* FT_Int */
- PS_DICT_PASSWORD, /* FT_Long */
- PS_DICT_LANGUAGE_GROUP, /* FT_Long */
-
- /* conventionally in the font FontInfo dictionary */
- PS_DICT_VERSION, /* FT_String* */
- PS_DICT_NOTICE, /* FT_String* */
- PS_DICT_FULL_NAME, /* FT_String* */
- PS_DICT_FAMILY_NAME, /* FT_String* */
- PS_DICT_WEIGHT, /* FT_String* */
- PS_DICT_IS_FIXED_PITCH, /* FT_Bool */
- PS_DICT_UNDERLINE_POSITION, /* FT_Short */
- PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
- PS_DICT_FS_TYPE, /* FT_UShort */
- PS_DICT_ITALIC_ANGLE, /* FT_Long */
-
- PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
-
- } PS_Dict_Keys;
-
-
- /************************************************************************
- *
- * @function:
- * FT_Get_PS_Font_Value
- *
- * @description:
- * Retrieve the value for the supplied key from a PostScript font.
- *
- * @input:
- * face ::
- * PostScript face handle.
- *
- * key ::
- * An enumeration value representing the dictionary key to retrieve.
- *
- * idx ::
- * For array values, this specifies the index to be returned.
- *
- * value ::
- * A pointer to memory into which to write the value.
- *
- * valen_len ::
- * The size, in bytes, of the memory supplied for the value.
- *
- * @output:
- * value ::
- * The value matching the above key, if it exists.
- *
- * @return:
- * The amount of memory (in bytes) required to hold the requested
- * value (if it exists, -1 otherwise).
- *
- * @note:
- * The values returned are not pointers into the internal structures of
- * the face, but are `fresh' copies, so that the memory containing them
- * belongs to the calling application. This also enforces the
- * `read-only' nature of these values, i.e., this function cannot be
- * used to manipulate the face.
- *
- * `value' is a void pointer because the values returned can be of
- * various types.
- *
- * If either `value' is NULL or `value_len' is too small, just the
- * required memory size for the requested entry is returned.
- *
- * The `idx' parameter is used, not only to retrieve elements of, for
- * example, the FontMatrix or FontBBox, but also to retrieve name keys
- * from the CharStrings dictionary, and the charstrings themselves. It
- * is ignored for atomic values.
- *
- * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
- * get the value as in the font stream, you need to divide by
- * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
- *
- * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
- * be retrieved. So, for example, PostScript procedures such as NP,
- * ND, and RD are not available. Arbitrary keys are, obviously, not be
- * available either.
- *
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument' error code.
- *
- */
- FT_EXPORT( FT_Long )
- FT_Get_PS_Font_Value( FT_Face face,
- PS_Dict_Keys key,
- FT_UInt idx,
- void *value,
- FT_Long value_len );
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __T1TABLES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ttnameid.h b/src/3rdparty/freetype/include/ttnameid.h
deleted file mode 100644
index e65b558127..0000000000
--- a/src/3rdparty/freetype/include/ttnameid.h
+++ /dev/null
@@ -1,1237 +0,0 @@
-/***************************************************************************/
-/* */
-/* ttnameid.h */
-/* */
-/* TrueType name ID definitions (specification only). */
-/* */
-/* Copyright 1996-2004, 2006-2008, 2012-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __TTNAMEID_H__
-#define __TTNAMEID_H__
-
-
-#include <ft2build.h>
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* truetype_tables */
- /* */
-
-
- /*************************************************************************/
- /* */
- /* Possible values for the `platform' identifier code in the name */
- /* records of the TTF `name' table. */
- /* */
- /*************************************************************************/
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_PLATFORM_XXX
- *
- * @description:
- * A list of valid values for the `platform_id' identifier code in
- * @FT_CharMapRec and @FT_SfntName structures.
- *
- * @values:
- * TT_PLATFORM_APPLE_UNICODE ::
- * Used by Apple to indicate a Unicode character map and/or name entry.
- * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note
- * that name entries in this format are coded as big-endian UCS-2
- * character codes _only_.
- *
- * TT_PLATFORM_MACINTOSH ::
- * Used by Apple to indicate a MacOS-specific charmap and/or name entry.
- * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that
- * most TrueType fonts contain an Apple roman charmap to be usable on
- * MacOS systems (even if they contain a Microsoft charmap as well).
- *
- * TT_PLATFORM_ISO ::
- * This value was used to specify ISO/IEC 10646 charmaps. It is however
- * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
- * `encoding_id' values.
- *
- * TT_PLATFORM_MICROSOFT ::
- * Used by Microsoft to indicate Windows-specific charmaps. See
- * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
- * Note that most fonts contain a Unicode charmap using
- * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
- *
- * TT_PLATFORM_CUSTOM ::
- * Used to indicate application-specific charmaps.
- *
- * TT_PLATFORM_ADOBE ::
- * This value isn't part of any font format specification, but is used
- * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec
- * structure. See @TT_ADOBE_ID_XXX.
- */
-
-#define TT_PLATFORM_APPLE_UNICODE 0
-#define TT_PLATFORM_MACINTOSH 1
-#define TT_PLATFORM_ISO 2 /* deprecated */
-#define TT_PLATFORM_MICROSOFT 3
-#define TT_PLATFORM_CUSTOM 4
-#define TT_PLATFORM_ADOBE 7 /* artificial */
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_APPLE_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
- *
- * @values:
- * TT_APPLE_ID_DEFAULT ::
- * Unicode version 1.0.
- *
- * TT_APPLE_ID_UNICODE_1_1 ::
- * Unicode 1.1; specifies Hangul characters starting at U+34xx.
- *
- * TT_APPLE_ID_ISO_10646 ::
- * Deprecated (identical to preceding).
- *
- * TT_APPLE_ID_UNICODE_2_0 ::
- * Unicode 2.0 and beyond (UTF-16 BMP only).
- *
- * TT_APPLE_ID_UNICODE_32 ::
- * Unicode 3.1 and beyond, using UTF-32.
- *
- * TT_APPLE_ID_VARIANT_SELECTOR ::
- * From Adobe, not Apple. Not a normal cmap. Specifies variations
- * on a real cmap.
- */
-
-#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
-#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
-#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
-#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
-#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */
-#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_MAC_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_MACINTOSH charmaps and name entries.
- *
- * @values:
- * TT_MAC_ID_ROMAN ::
- * TT_MAC_ID_JAPANESE ::
- * TT_MAC_ID_TRADITIONAL_CHINESE ::
- * TT_MAC_ID_KOREAN ::
- * TT_MAC_ID_ARABIC ::
- * TT_MAC_ID_HEBREW ::
- * TT_MAC_ID_GREEK ::
- * TT_MAC_ID_RUSSIAN ::
- * TT_MAC_ID_RSYMBOL ::
- * TT_MAC_ID_DEVANAGARI ::
- * TT_MAC_ID_GURMUKHI ::
- * TT_MAC_ID_GUJARATI ::
- * TT_MAC_ID_ORIYA ::
- * TT_MAC_ID_BENGALI ::
- * TT_MAC_ID_TAMIL ::
- * TT_MAC_ID_TELUGU ::
- * TT_MAC_ID_KANNADA ::
- * TT_MAC_ID_MALAYALAM ::
- * TT_MAC_ID_SINHALESE ::
- * TT_MAC_ID_BURMESE ::
- * TT_MAC_ID_KHMER ::
- * TT_MAC_ID_THAI ::
- * TT_MAC_ID_LAOTIAN ::
- * TT_MAC_ID_GEORGIAN ::
- * TT_MAC_ID_ARMENIAN ::
- * TT_MAC_ID_MALDIVIAN ::
- * TT_MAC_ID_SIMPLIFIED_CHINESE ::
- * TT_MAC_ID_TIBETAN ::
- * TT_MAC_ID_MONGOLIAN ::
- * TT_MAC_ID_GEEZ ::
- * TT_MAC_ID_SLAVIC ::
- * TT_MAC_ID_VIETNAMESE ::
- * TT_MAC_ID_SINDHI ::
- * TT_MAC_ID_UNINTERP ::
- */
-
-#define TT_MAC_ID_ROMAN 0
-#define TT_MAC_ID_JAPANESE 1
-#define TT_MAC_ID_TRADITIONAL_CHINESE 2
-#define TT_MAC_ID_KOREAN 3
-#define TT_MAC_ID_ARABIC 4
-#define TT_MAC_ID_HEBREW 5
-#define TT_MAC_ID_GREEK 6
-#define TT_MAC_ID_RUSSIAN 7
-#define TT_MAC_ID_RSYMBOL 8
-#define TT_MAC_ID_DEVANAGARI 9
-#define TT_MAC_ID_GURMUKHI 10
-#define TT_MAC_ID_GUJARATI 11
-#define TT_MAC_ID_ORIYA 12
-#define TT_MAC_ID_BENGALI 13
-#define TT_MAC_ID_TAMIL 14
-#define TT_MAC_ID_TELUGU 15
-#define TT_MAC_ID_KANNADA 16
-#define TT_MAC_ID_MALAYALAM 17
-#define TT_MAC_ID_SINHALESE 18
-#define TT_MAC_ID_BURMESE 19
-#define TT_MAC_ID_KHMER 20
-#define TT_MAC_ID_THAI 21
-#define TT_MAC_ID_LAOTIAN 22
-#define TT_MAC_ID_GEORGIAN 23
-#define TT_MAC_ID_ARMENIAN 24
-#define TT_MAC_ID_MALDIVIAN 25
-#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
-#define TT_MAC_ID_TIBETAN 26
-#define TT_MAC_ID_MONGOLIAN 27
-#define TT_MAC_ID_GEEZ 28
-#define TT_MAC_ID_SLAVIC 29
-#define TT_MAC_ID_VIETNAMESE 30
-#define TT_MAC_ID_SINDHI 31
-#define TT_MAC_ID_UNINTERP 32
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_ISO_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_ISO charmaps and name entries.
- *
- * Their use is now deprecated.
- *
- * @values:
- * TT_ISO_ID_7BIT_ASCII ::
- * ASCII.
- * TT_ISO_ID_10646 ::
- * ISO/10646.
- * TT_ISO_ID_8859_1 ::
- * Also known as Latin-1.
- */
-
-#define TT_ISO_ID_7BIT_ASCII 0
-#define TT_ISO_ID_10646 1
-#define TT_ISO_ID_8859_1 2
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_MS_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_MICROSOFT charmaps and name entries.
- *
- * @values:
- * TT_MS_ID_SYMBOL_CS ::
- * Corresponds to Microsoft symbol encoding. See
- * @FT_ENCODING_MS_SYMBOL.
- *
- * TT_MS_ID_UNICODE_CS ::
- * Corresponds to a Microsoft WGL4 charmap, matching Unicode. See
- * @FT_ENCODING_UNICODE.
- *
- * TT_MS_ID_SJIS ::
- * Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS.
- *
- * TT_MS_ID_GB2312 ::
- * Corresponds to Simplified Chinese as used in Mainland China. See
- * @FT_ENCODING_GB2312.
- *
- * TT_MS_ID_BIG_5 ::
- * Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
- * See @FT_ENCODING_BIG5.
- *
- * TT_MS_ID_WANSUNG ::
- * Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG.
- *
- * TT_MS_ID_JOHAB ::
- * Corresponds to Johab encoding. See @FT_ENCODING_JOHAB.
- *
- * TT_MS_ID_UCS_4 ::
- * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to
- * the OpenType specification version 1.4 (mid-2001.)
- */
-
-#define TT_MS_ID_SYMBOL_CS 0
-#define TT_MS_ID_UNICODE_CS 1
-#define TT_MS_ID_SJIS 2
-#define TT_MS_ID_GB2312 3
-#define TT_MS_ID_BIG_5 4
-#define TT_MS_ID_WANSUNG 5
-#define TT_MS_ID_JOHAB 6
-#define TT_MS_ID_UCS_4 10
-
-
- /***********************************************************************
- *
- * @enum:
- * TT_ADOBE_ID_XXX
- *
- * @description:
- * A list of valid values for the `encoding_id' for
- * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!
- *
- * @values:
- * TT_ADOBE_ID_STANDARD ::
- * Adobe standard encoding.
- * TT_ADOBE_ID_EXPERT ::
- * Adobe expert encoding.
- * TT_ADOBE_ID_CUSTOM ::
- * Adobe custom encoding.
- * TT_ADOBE_ID_LATIN_1 ::
- * Adobe Latin~1 encoding.
- */
-
-#define TT_ADOBE_ID_STANDARD 0
-#define TT_ADOBE_ID_EXPERT 1
-#define TT_ADOBE_ID_CUSTOM 2
-#define TT_ADOBE_ID_LATIN_1 3
-
-
- /*************************************************************************/
- /* */
- /* Possible values of the language identifier field in the name records */
- /* of the TTF `name' table if the `platform' identifier code is */
- /* TT_PLATFORM_MACINTOSH. These values are also used as return values */
- /* for function @FT_Get_CMap_Language_ID. */
- /* */
- /* The canonical source for the Apple assigned Language ID's is at */
- /* */
- /* https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html */
- /* */
-#define TT_MAC_LANGID_ENGLISH 0
-#define TT_MAC_LANGID_FRENCH 1
-#define TT_MAC_LANGID_GERMAN 2
-#define TT_MAC_LANGID_ITALIAN 3
-#define TT_MAC_LANGID_DUTCH 4
-#define TT_MAC_LANGID_SWEDISH 5
-#define TT_MAC_LANGID_SPANISH 6
-#define TT_MAC_LANGID_DANISH 7
-#define TT_MAC_LANGID_PORTUGUESE 8
-#define TT_MAC_LANGID_NORWEGIAN 9
-#define TT_MAC_LANGID_HEBREW 10
-#define TT_MAC_LANGID_JAPANESE 11
-#define TT_MAC_LANGID_ARABIC 12
-#define TT_MAC_LANGID_FINNISH 13
-#define TT_MAC_LANGID_GREEK 14
-#define TT_MAC_LANGID_ICELANDIC 15
-#define TT_MAC_LANGID_MALTESE 16
-#define TT_MAC_LANGID_TURKISH 17
-#define TT_MAC_LANGID_CROATIAN 18
-#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
-#define TT_MAC_LANGID_URDU 20
-#define TT_MAC_LANGID_HINDI 21
-#define TT_MAC_LANGID_THAI 22
-#define TT_MAC_LANGID_KOREAN 23
-#define TT_MAC_LANGID_LITHUANIAN 24
-#define TT_MAC_LANGID_POLISH 25
-#define TT_MAC_LANGID_HUNGARIAN 26
-#define TT_MAC_LANGID_ESTONIAN 27
-#define TT_MAC_LANGID_LETTISH 28
-#define TT_MAC_LANGID_SAAMISK 29
-#define TT_MAC_LANGID_FAEROESE 30
-#define TT_MAC_LANGID_FARSI 31
-#define TT_MAC_LANGID_RUSSIAN 32
-#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
-#define TT_MAC_LANGID_FLEMISH 34
-#define TT_MAC_LANGID_IRISH 35
-#define TT_MAC_LANGID_ALBANIAN 36
-#define TT_MAC_LANGID_ROMANIAN 37
-#define TT_MAC_LANGID_CZECH 38
-#define TT_MAC_LANGID_SLOVAK 39
-#define TT_MAC_LANGID_SLOVENIAN 40
-#define TT_MAC_LANGID_YIDDISH 41
-#define TT_MAC_LANGID_SERBIAN 42
-#define TT_MAC_LANGID_MACEDONIAN 43
-#define TT_MAC_LANGID_BULGARIAN 44
-#define TT_MAC_LANGID_UKRAINIAN 45
-#define TT_MAC_LANGID_BYELORUSSIAN 46
-#define TT_MAC_LANGID_UZBEK 47
-#define TT_MAC_LANGID_KAZAKH 48
-#define TT_MAC_LANGID_AZERBAIJANI 49
-#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49
-#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
-#define TT_MAC_LANGID_ARMENIAN 51
-#define TT_MAC_LANGID_GEORGIAN 52
-#define TT_MAC_LANGID_MOLDAVIAN 53
-#define TT_MAC_LANGID_KIRGHIZ 54
-#define TT_MAC_LANGID_TAJIKI 55
-#define TT_MAC_LANGID_TURKMEN 56
-#define TT_MAC_LANGID_MONGOLIAN 57
-#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57
-#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
-#define TT_MAC_LANGID_PASHTO 59
-#define TT_MAC_LANGID_KURDISH 60
-#define TT_MAC_LANGID_KASHMIRI 61
-#define TT_MAC_LANGID_SINDHI 62
-#define TT_MAC_LANGID_TIBETAN 63
-#define TT_MAC_LANGID_NEPALI 64
-#define TT_MAC_LANGID_SANSKRIT 65
-#define TT_MAC_LANGID_MARATHI 66
-#define TT_MAC_LANGID_BENGALI 67
-#define TT_MAC_LANGID_ASSAMESE 68
-#define TT_MAC_LANGID_GUJARATI 69
-#define TT_MAC_LANGID_PUNJABI 70
-#define TT_MAC_LANGID_ORIYA 71
-#define TT_MAC_LANGID_MALAYALAM 72
-#define TT_MAC_LANGID_KANNADA 73
-#define TT_MAC_LANGID_TAMIL 74
-#define TT_MAC_LANGID_TELUGU 75
-#define TT_MAC_LANGID_SINHALESE 76
-#define TT_MAC_LANGID_BURMESE 77
-#define TT_MAC_LANGID_KHMER 78
-#define TT_MAC_LANGID_LAO 79
-#define TT_MAC_LANGID_VIETNAMESE 80
-#define TT_MAC_LANGID_INDONESIAN 81
-#define TT_MAC_LANGID_TAGALOG 82
-#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
-#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
-#define TT_MAC_LANGID_AMHARIC 85
-#define TT_MAC_LANGID_TIGRINYA 86
-#define TT_MAC_LANGID_GALLA 87
-#define TT_MAC_LANGID_SOMALI 88
-#define TT_MAC_LANGID_SWAHILI 89
-#define TT_MAC_LANGID_RUANDA 90
-#define TT_MAC_LANGID_RUNDI 91
-#define TT_MAC_LANGID_CHEWA 92
-#define TT_MAC_LANGID_MALAGASY 93
-#define TT_MAC_LANGID_ESPERANTO 94
-#define TT_MAC_LANGID_WELSH 128
-#define TT_MAC_LANGID_BASQUE 129
-#define TT_MAC_LANGID_CATALAN 130
-#define TT_MAC_LANGID_LATIN 131
-#define TT_MAC_LANGID_QUECHUA 132
-#define TT_MAC_LANGID_GUARANI 133
-#define TT_MAC_LANGID_AYMARA 134
-#define TT_MAC_LANGID_TATAR 135
-#define TT_MAC_LANGID_UIGHUR 136
-#define TT_MAC_LANGID_DZONGKHA 137
-#define TT_MAC_LANGID_JAVANESE 138
-#define TT_MAC_LANGID_SUNDANESE 139
-
-
-#if 0 /* these seem to be errors that have been dropped */
-
-#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
-#define TT_MAC_LANGID_IRISH_GAELIC 141
-
-#endif
-
-
- /* The following codes are new as of 2000-03-10 */
-#define TT_MAC_LANGID_GALICIAN 140
-#define TT_MAC_LANGID_AFRIKAANS 141
-#define TT_MAC_LANGID_BRETON 142
-#define TT_MAC_LANGID_INUKTITUT 143
-#define TT_MAC_LANGID_SCOTTISH_GAELIC 144
-#define TT_MAC_LANGID_MANX_GAELIC 145
-#define TT_MAC_LANGID_IRISH_GAELIC 146
-#define TT_MAC_LANGID_TONGAN 147
-#define TT_MAC_LANGID_GREEK_POLYTONIC 148
-#define TT_MAC_LANGID_GREELANDIC 149
-#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
-
-
- /*************************************************************************/
- /* */
- /* Possible values of the language identifier field in the name records */
- /* of the TTF `name' table if the `platform' identifier code is */
- /* TT_PLATFORM_MICROSOFT. */
- /* */
- /* The canonical source for the MS assigned LCIDs is */
- /* */
- /* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */
- /* */
-
-#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
-#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
-#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
-#define TT_MS_LANGID_ARABIC_EGYPT 0x0C01
-#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
-#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
-#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
-#define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01
-#define TT_MS_LANGID_ARABIC_OMAN 0x2001
-#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
-#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
-#define TT_MS_LANGID_ARABIC_JORDAN 0x2C01
-#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
-#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
-#define TT_MS_LANGID_ARABIC_UAE 0x3801
-#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01
-#define TT_MS_LANGID_ARABIC_QATAR 0x4001
-#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
-#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
-#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
-#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
-#define TT_MS_LANGID_CHINESE_PRC 0x0804
-#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04
-#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
-
-#if 1 /* this looks like the correct value */
-#define TT_MS_LANGID_CHINESE_MACAU 0x1404
-#else /* but beware, Microsoft may change its mind...
- the most recent Word reference has the following: */
-#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
-#endif
-
-#if 0 /* used only with .NET `cultures'; commented out */
-#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
-#endif
-
-#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
-#define TT_MS_LANGID_DANISH_DENMARK 0x0406
-#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
-#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
-#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07
-#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
-#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
-#define TT_MS_LANGID_GREEK_GREECE 0x0408
-
- /* don't ask what this one means... It is commented out currently. */
-#if 0
-#define TT_MS_LANGID_GREEK_GREECE2 0x2008
-#endif
-
-#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
-#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
-#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
-#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09
-#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
-#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
-#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
-#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09
-#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
-#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
-#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
-#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09
-#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
-#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
-#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
-#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09
-#define TT_MS_LANGID_ENGLISH_INDIA 0x4009
-#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409
-#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809
-#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A
-#define TT_MS_LANGID_SPANISH_MEXICO 0x080A
-#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0C0A
-#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A
-#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A
-#define TT_MS_LANGID_SPANISH_PANAMA 0x180A
-#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A
-#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A
-#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A
-#define TT_MS_LANGID_SPANISH_PERU 0x280A
-#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A
-#define TT_MS_LANGID_SPANISH_ECUADOR 0x300A
-#define TT_MS_LANGID_SPANISH_CHILE 0x340A
-#define TT_MS_LANGID_SPANISH_URUGUAY 0x380A
-#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A
-#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A
-#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A
-#define TT_MS_LANGID_SPANISH_HONDURAS 0x480A
-#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A
-#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A
-#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A
- /* The following ID blatantly violate MS specs by using a */
- /* sublanguage > 0x1F. */
-#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU
-#define TT_MS_LANGID_FINNISH_FINLAND 0x040B
-#define TT_MS_LANGID_FRENCH_FRANCE 0x040C
-#define TT_MS_LANGID_FRENCH_BELGIUM 0x080C
-#define TT_MS_LANGID_FRENCH_CANADA 0x0C0C
-#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C
-#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C
-#define TT_MS_LANGID_FRENCH_MONACO 0x180C
-#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C
-#define TT_MS_LANGID_FRENCH_REUNION 0x200C
-#define TT_MS_LANGID_FRENCH_CONGO 0x240C
- /* which was formerly: */
-#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
-#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C
-#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C
-#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C
-#define TT_MS_LANGID_FRENCH_MALI 0x340C
-#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C
-#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C
- /* and another violation of the spec (see 0xE40AU) */
-#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU
-#define TT_MS_LANGID_HEBREW_ISRAEL 0x040D
-#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E
-#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F
-#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
-#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
-#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
-#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
-#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
-#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
-#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
-#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
-#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
-#define TT_MS_LANGID_POLISH_POLAND 0x0415
-#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
-#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
-#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
-#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
-#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
-#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
-#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
-#define TT_MS_LANGID_CROATIAN_CROATIA 0x041A
-#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A
-#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A
-
-#if 0 /* this used to be this value, but it looks like we were wrong */
-#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101A
-#else /* current sources say */
-#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A
-#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A
- /* and XPsp2 Platform SDK added (2004-07-26) */
- /* Names are shortened to be significant within 40 chars. */
-#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A
-#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181A
-#endif
-
-#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B
-#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C
-#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D
-#define TT_MS_LANGID_SWEDISH_FINLAND 0x081D
-#define TT_MS_LANGID_THAI_THAILAND 0x041E
-#define TT_MS_LANGID_TURKISH_TURKEY 0x041F
-#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
-#define TT_MS_LANGID_URDU_INDIA 0x0820
-#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
-#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
-#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
-#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
-#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
-#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
-#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
-#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
-#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428
-#define TT_MS_LANGID_FARSI_IRAN 0x0429
-#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A
-#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B
-#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C
-#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C
-#define TT_MS_LANGID_BASQUE_SPAIN 0x042D
-#define TT_MS_LANGID_SORBIAN_GERMANY 0x042E
-#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F
-#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
-#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
-#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
-#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
-#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
-#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
-#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
-#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
-#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
-#define TT_MS_LANGID_HINDI_INDIA 0x0439
-#define TT_MS_LANGID_MALTESE_MALTA 0x043A
- /* Added by XPsp2 Platform SDK (2004-07-26) */
-#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B
-#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B
-#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B
-#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B
-#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B
-#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B
-#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B
-#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B
-#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B
- /* ... and we also keep our old identifier... */
-#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B
-
-#if 0 /* this seems to be a previous inversion */
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
-#else
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
-#endif
-
-#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D
-#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
-#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
-#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043F
-#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
- /* alias declared in Windows 2000 */
-#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
- TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
-
-#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
-#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
-#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
-#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
-#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
-#define TT_MS_LANGID_BENGALI_INDIA 0x0445
-#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845
-#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
-#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
-#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
-#define TT_MS_LANGID_ORIYA_INDIA 0x0448
-#define TT_MS_LANGID_TAMIL_INDIA 0x0449
-#define TT_MS_LANGID_TELUGU_INDIA 0x044A
-#define TT_MS_LANGID_KANNADA_INDIA 0x044B
-#define TT_MS_LANGID_MALAYALAM_INDIA 0x044C
-#define TT_MS_LANGID_ASSAMESE_INDIA 0x044D
-#define TT_MS_LANGID_MARATHI_INDIA 0x044E
-#define TT_MS_LANGID_SANSKRIT_INDIA 0x044F
-#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
-#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850
-#define TT_MS_LANGID_TIBETAN_CHINA 0x0451
- /* Don't use the next constant! It has */
- /* (1) the wrong spelling (Dzonghka) */
- /* (2) Microsoft doesn't officially define it -- */
- /* at least it is not in the List of Local */
- /* ID Values. */
- /* (3) Dzongkha is not the same language as */
- /* Tibetan, so merging it is wrong anyway. */
- /* */
- /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
-#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
-
-#if 0
- /* the following used to be defined */
-#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
- /* ... but it was changed; */
-#else
- /* So we will continue to #define it, but with the correct value */
-#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN
-#endif
-
-#define TT_MS_LANGID_WELSH_WALES 0x0452
-#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453
-#define TT_MS_LANGID_LAO_LAOS 0x0454
-#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455
-#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456
-#define TT_MS_LANGID_KONKANI_INDIA 0x0457
-#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
-#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
-#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
- /* Missing a LCID for Sindhi in Devanagari script */
-#define TT_MS_LANGID_SYRIAC_SYRIA 0x045A
-#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045B
-#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C
-#define TT_MS_LANGID_INUKTITUT_CANADA 0x045D
-#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E
-#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F
-#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085F
- /* Missing a LCID for Tifinagh script */
-#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
- /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
- /* script is yet unclear... might be Arabic, Nagari or Sharada */
-#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
- /* ... and aliased (by MS) for compatibility reasons. */
-#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA
-#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
-#define TT_MS_LANGID_NEPALI_INDIA 0x0861
-#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462
-#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463
-#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
-#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
- /* alias declared in Windows 2000 */
-#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
-#define TT_MS_LANGID_EDO_NIGERIA 0x0466
-#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
-#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
-#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
-#define TT_MS_LANGID_YORUBA_NIGERIA 0x046A
-#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B
-#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B
-#define TT_MS_LANGID_QUECHUA_PERU 0x0C6B
-#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046C
- /* Also spelled by XPsp2 Platform SDK (2004-07-26) */
-#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
- TT_MS_LANGID_SEPEDI_SOUTH_AFRICA
- /* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */
-#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
-#define TT_MS_LANGID_KANURI_NIGERIA 0x0471
-#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
-#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
-#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
- /* also spelled in the `Passport SDK' list as: */
-#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
-#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474
-#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
-#define TT_MS_LANGID_LATIN 0x0476
-#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
- /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
- /* not written (but OTOH the peculiar writing system is worth */
- /* studying). */
-#define TT_MS_LANGID_YI_CHINA 0x0478
-#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
- /* language codes from 0x047A to 0x047F are (still) unknown. */
-#define TT_MS_LANGID_UIGHUR_CHINA 0x0480
-#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
-
-#if 0 /* not deemed useful for fonts */
-#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04FF
-#endif
-
-
- /*************************************************************************/
- /* */
- /* Possible values of the `name' identifier field in the name records of */
- /* the TTF `name' table. These values are platform independent. */
- /* */
-#define TT_NAME_ID_COPYRIGHT 0
-#define TT_NAME_ID_FONT_FAMILY 1
-#define TT_NAME_ID_FONT_SUBFAMILY 2
-#define TT_NAME_ID_UNIQUE_ID 3
-#define TT_NAME_ID_FULL_NAME 4
-#define TT_NAME_ID_VERSION_STRING 5
-#define TT_NAME_ID_PS_NAME 6
-#define TT_NAME_ID_TRADEMARK 7
-
- /* the following values are from the OpenType spec */
-#define TT_NAME_ID_MANUFACTURER 8
-#define TT_NAME_ID_DESIGNER 9
-#define TT_NAME_ID_DESCRIPTION 10
-#define TT_NAME_ID_VENDOR_URL 11
-#define TT_NAME_ID_DESIGNER_URL 12
-#define TT_NAME_ID_LICENSE 13
-#define TT_NAME_ID_LICENSE_URL 14
- /* number 15 is reserved */
-#define TT_NAME_ID_PREFERRED_FAMILY 16
-#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
-#define TT_NAME_ID_MAC_FULL_NAME 18
-
- /* The following code is new as of 2000-01-21 */
-#define TT_NAME_ID_SAMPLE_TEXT 19
-
- /* This is new in OpenType 1.3 */
-#define TT_NAME_ID_CID_FINDFONT_NAME 20
-
- /* This is new in OpenType 1.5 */
-#define TT_NAME_ID_WWS_FAMILY 21
-#define TT_NAME_ID_WWS_SUBFAMILY 22
-
-
- /*************************************************************************/
- /* */
- /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
- /* */
- /* Updated 08-Nov-2008. */
- /* */
-
- /* Bit 0 Basic Latin */
-#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
- /* Bit 1 C1 Controls and Latin-1 Supplement */
-#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
- /* Bit 2 Latin Extended-A */
-#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
- /* Bit 3 Latin Extended-B */
-#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
- /* Bit 4 IPA Extensions */
- /* Phonetic Extensions */
- /* Phonetic Extensions Supplement */
-#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
- /* U+1D00-U+1D7F */
- /* U+1D80-U+1DBF */
- /* Bit 5 Spacing Modifier Letters */
- /* Modifier Tone Letters */
-#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
- /* U+A700-U+A71F */
- /* Bit 6 Combining Diacritical Marks */
- /* Combining Diacritical Marks Supplement */
-#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
- /* U+1DC0-U+1DFF */
- /* Bit 7 Greek and Coptic */
-#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
- /* Bit 8 Coptic */
-#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
- /* Bit 9 Cyrillic */
- /* Cyrillic Supplement */
- /* Cyrillic Extended-A */
- /* Cyrillic Extended-B */
-#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
- /* U+0500-U+052F */
- /* U+2DE0-U+2DFF */
- /* U+A640-U+A69F */
- /* Bit 10 Armenian */
-#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
- /* Bit 11 Hebrew */
-#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
- /* Bit 12 Vai */
-#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
- /* Bit 13 Arabic */
- /* Arabic Supplement */
-#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
- /* U+0750-U+077F */
- /* Bit 14 NKo */
-#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
- /* Bit 15 Devanagari */
-#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
- /* Bit 16 Bengali */
-#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
- /* Bit 17 Gurmukhi */
-#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
- /* Bit 18 Gujarati */
-#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
- /* Bit 19 Oriya */
-#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
- /* Bit 20 Tamil */
-#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
- /* Bit 21 Telugu */
-#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
- /* Bit 22 Kannada */
-#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
- /* Bit 23 Malayalam */
-#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
- /* Bit 24 Thai */
-#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
- /* Bit 25 Lao */
-#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
- /* Bit 26 Georgian */
- /* Georgian Supplement */
-#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
- /* U+2D00-U+2D2F */
- /* Bit 27 Balinese */
-#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
- /* Bit 28 Hangul Jamo */
-#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
- /* Bit 29 Latin Extended Additional */
- /* Latin Extended-C */
- /* Latin Extended-D */
-#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
- /* U+2C60-U+2C7F */
- /* U+A720-U+A7FF */
- /* Bit 30 Greek Extended */
-#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
- /* Bit 31 General Punctuation */
- /* Supplemental Punctuation */
-#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
- /* U+2E00-U+2E7F */
- /* Bit 32 Superscripts And Subscripts */
-#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
- /* Bit 33 Currency Symbols */
-#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
- /* Bit 34 Combining Diacritical Marks For Symbols */
-#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
- /* Bit 35 Letterlike Symbols */
-#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
- /* Bit 36 Number Forms */
-#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
- /* Bit 37 Arrows */
- /* Supplemental Arrows-A */
- /* Supplemental Arrows-B */
- /* Miscellaneous Symbols and Arrows */
-#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
- /* U+27F0-U+27FF */
- /* U+2900-U+297F */
- /* U+2B00-U+2BFF */
- /* Bit 38 Mathematical Operators */
- /* Supplemental Mathematical Operators */
- /* Miscellaneous Mathematical Symbols-A */
- /* Miscellaneous Mathematical Symbols-B */
-#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
- /* U+2A00-U+2AFF */
- /* U+27C0-U+27EF */
- /* U+2980-U+29FF */
- /* Bit 39 Miscellaneous Technical */
-#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
- /* Bit 40 Control Pictures */
-#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
- /* Bit 41 Optical Character Recognition */
-#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
- /* Bit 42 Enclosed Alphanumerics */
-#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
- /* Bit 43 Box Drawing */
-#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
- /* Bit 44 Block Elements */
-#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
- /* Bit 45 Geometric Shapes */
-#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
- /* Bit 46 Miscellaneous Symbols */
-#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
- /* Bit 47 Dingbats */
-#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
- /* Bit 48 CJK Symbols and Punctuation */
-#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
- /* Bit 49 Hiragana */
-#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
- /* Bit 50 Katakana */
- /* Katakana Phonetic Extensions */
-#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
- /* U+31F0-U+31FF */
- /* Bit 51 Bopomofo */
- /* Bopomofo Extended */
-#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
- /* U+31A0-U+31BF */
- /* Bit 52 Hangul Compatibility Jamo */
-#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
- /* Bit 53 Phags-Pa */
-#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
-#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
-#define TT_UCR_PHAGSPA
- /* Bit 54 Enclosed CJK Letters and Months */
-#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
- /* Bit 55 CJK Compatibility */
-#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
- /* Bit 56 Hangul Syllables */
-#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
- /* Bit 57 High Surrogates */
- /* High Private Use Surrogates */
- /* Low Surrogates */
- /* */
- /* According to OpenType specs v.1.3+, */
- /* setting bit 57 implies that there is */
- /* at least one codepoint beyond the */
- /* Basic Multilingual Plane that is */
- /* supported by this font. So it really */
- /* means >= U+10000 */
-#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
- /* U+DB80-U+DBFF */
- /* U+DC00-U+DFFF */
-#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
- /* Bit 58 Phoenician */
-#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
- /* Bit 59 CJK Unified Ideographs */
- /* CJK Radicals Supplement */
- /* Kangxi Radicals */
- /* Ideographic Description Characters */
- /* CJK Unified Ideographs Extension A */
- /* CJK Unified Ideographs Extension B */
- /* Kanbun */
-#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
- /* U+2E80-U+2EFF */
- /* U+2F00-U+2FDF */
- /* U+2FF0-U+2FFF */
- /* U+3400-U+4DB5 */
- /*U+20000-U+2A6DF*/
- /* U+3190-U+319F */
- /* Bit 60 Private Use */
-#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
- /* Bit 61 CJK Strokes */
- /* CJK Compatibility Ideographs */
- /* CJK Compatibility Ideographs Supplement */
-#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
- /* U+F900-U+FAFF */
- /*U+2F800-U+2FA1F*/
- /* Bit 62 Alphabetic Presentation Forms */
-#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
- /* Bit 63 Arabic Presentation Forms-A */
-#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
- /* Bit 64 Combining Half Marks */
-#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
- /* Bit 65 Vertical forms */
- /* CJK Compatibility Forms */
-#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
- /* U+FE30-U+FE4F */
- /* Bit 66 Small Form Variants */
-#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
- /* Bit 67 Arabic Presentation Forms-B */
-#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */
- /* Bit 68 Halfwidth and Fullwidth Forms */
-#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
- /* Bit 69 Specials */
-#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
- /* Bit 70 Tibetan */
-#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */
- /* Bit 71 Syriac */
-#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
- /* Bit 72 Thaana */
-#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
- /* Bit 73 Sinhala */
-#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
- /* Bit 74 Myanmar */
-#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
- /* Bit 75 Ethiopic */
- /* Ethiopic Supplement */
- /* Ethiopic Extended */
-#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
- /* U+1380-U+139F */
- /* U+2D80-U+2DDF */
- /* Bit 76 Cherokee */
-#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
- /* Bit 77 Unified Canadian Aboriginal Syllabics */
-#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */
- /* Bit 78 Ogham */
-#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
- /* Bit 79 Runic */
-#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
- /* Bit 80 Khmer */
- /* Khmer Symbols */
-#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
- /* U+19E0-U+19FF */
- /* Bit 81 Mongolian */
-#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
- /* Bit 82 Braille Patterns */
-#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
- /* Bit 83 Yi Syllables */
- /* Yi Radicals */
-#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
- /* U+A490-U+A4CF */
- /* Bit 84 Tagalog */
- /* Hanunoo */
- /* Buhid */
- /* Tagbanwa */
-#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
- /* U+1720-U+173F */
- /* U+1740-U+175F */
- /* U+1760-U+177F */
- /* Bit 85 Old Italic */
-#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/
- /* Bit 86 Gothic */
-#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
- /* Bit 87 Deseret */
-#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
- /* Bit 88 Byzantine Musical Symbols */
- /* Musical Symbols */
- /* Ancient Greek Musical Notation */
-#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
- /*U+1D100-U+1D1FF*/
- /*U+1D200-U+1D24F*/
- /* Bit 89 Mathematical Alphanumeric Symbols */
-#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
- /* Bit 90 Private Use (plane 15) */
- /* Private Use (plane 16) */
-#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
- /*U+100000-U+10FFFD*/
- /* Bit 91 Variation Selectors */
- /* Variation Selectors Supplement */
-#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
- /*U+E0100-U+E01EF*/
- /* Bit 92 Tags */
-#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
- /* Bit 93 Limbu */
-#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
- /* Bit 94 Tai Le */
-#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
- /* Bit 95 New Tai Lue */
-#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
- /* Bit 96 Buginese */
-#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
- /* Bit 97 Glagolitic */
-#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
- /* Bit 98 Tifinagh */
-#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
- /* Bit 99 Yijing Hexagram Symbols */
-#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
- /* Bit 100 Syloti Nagri */
-#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
- /* Bit 101 Linear B Syllabary */
- /* Linear B Ideograms */
- /* Aegean Numbers */
-#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
- /*U+10080-U+100FF*/
- /*U+10100-U+1013F*/
- /* Bit 102 Ancient Greek Numbers */
-#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
- /* Bit 103 Ugaritic */
-#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
- /* Bit 104 Old Persian */
-#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
- /* Bit 105 Shavian */
-#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
- /* Bit 106 Osmanya */
-#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
- /* Bit 107 Cypriot Syllabary */
-#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
- /* Bit 108 Kharoshthi */
-#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
- /* Bit 109 Tai Xuan Jing Symbols */
-#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
- /* Bit 110 Cuneiform */
- /* Cuneiform Numbers and Punctuation */
-#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
- /*U+12400-U+1247F*/
- /* Bit 111 Counting Rod Numerals */
-#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
- /* Bit 112 Sundanese */
-#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
- /* Bit 113 Lepcha */
-#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
- /* Bit 114 Ol Chiki */
-#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
- /* Bit 115 Saurashtra */
-#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
- /* Bit 116 Kayah Li */
-#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
- /* Bit 117 Rejang */
-#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
- /* Bit 118 Cham */
-#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
- /* Bit 119 Ancient Symbols */
-#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
- /* Bit 120 Phaistos Disc */
-#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
- /* Bit 121 Carian */
- /* Lycian */
- /* Lydian */
-#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
- /*U+10280-U+1029F*/
- /*U+10920-U+1093F*/
- /* Bit 122 Domino Tiles */
- /* Mahjong Tiles */
-#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
- /*U+1F000-U+1F02F*/
- /* Bit 123-127 Reserved for process-internal usage */
-
-
- /*************************************************************************/
- /* */
- /* Some compilers have a very limited length of identifiers. */
- /* */
-#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
-#define HAVE_LIMIT_ON_IDENTS
-#endif
-
-
-#ifndef HAVE_LIMIT_ON_IDENTS
-
-
- /*************************************************************************/
- /* */
- /* Here some alias #defines in order to be clearer. */
- /* */
- /* These are not always #defined to stay within the 31~character limit, */
- /* which some compilers have. */
- /* */
- /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */
- /* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
- /* If you get a warning with such a compiler, use the -i40 switch. */
- /* */
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
- TT_UCR_ARABIC_PRESENTATIONS_A
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
- TT_UCR_ARABIC_PRESENTATIONS_B
-
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
- TT_UCR_COMBINING_DIACRITICS
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
- TT_UCR_COMBINING_DIACRITICS_SYMB
-
-
-#endif /* !HAVE_LIMIT_ON_IDENTS */
-
-
-FT_END_HEADER
-
-#endif /* __TTNAMEID_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/tttables.h b/src/3rdparty/freetype/include/tttables.h
deleted file mode 100644
index e1d8b05e79..0000000000
--- a/src/3rdparty/freetype/include/tttables.h
+++ /dev/null
@@ -1,829 +0,0 @@
-/***************************************************************************/
-/* */
-/* tttables.h */
-/* */
-/* Basic SFNT/TrueType tables definitions and interface */
-/* (specification only). */
-/* */
-/* Copyright 1996-2005, 2008-2014 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __TTTABLES_H__
-#define __TTTABLES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* truetype_tables */
- /* */
- /* <Title> */
- /* TrueType Tables */
- /* */
- /* <Abstract> */
- /* TrueType specific table types and functions. */
- /* */
- /* <Description> */
- /* This section contains the definition of TrueType-specific tables */
- /* as well as some routines used to access and process them. */
- /* */
- /* <Order> */
- /* TT_Header */
- /* TT_HoriHeader */
- /* TT_VertHeader */
- /* TT_OS2 */
- /* TT_Postscript */
- /* TT_PCLT */
- /* TT_MaxProfile */
- /* */
- /* FT_Sfnt_Tag */
- /* FT_Get_Sfnt_Table */
- /* FT_Load_Sfnt_Table */
- /* FT_Sfnt_Table_Info */
- /* */
- /* FT_Get_CMap_Language_ID */
- /* FT_Get_CMap_Format */
- /* */
- /* FT_PARAM_TAG_UNPATENTED_HINTING */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Header */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType font header table. All */
- /* fields follow the TrueType specification. */
- /* */
- typedef struct TT_Header_
- {
- FT_Fixed Table_Version;
- FT_Fixed Font_Revision;
-
- FT_Long CheckSum_Adjust;
- FT_Long Magic_Number;
-
- FT_UShort Flags;
- FT_UShort Units_Per_EM;
-
- FT_Long Created [2];
- FT_Long Modified[2];
-
- FT_Short xMin;
- FT_Short yMin;
- FT_Short xMax;
- FT_Short yMax;
-
- FT_UShort Mac_Style;
- FT_UShort Lowest_Rec_PPEM;
-
- FT_Short Font_Direction;
- FT_Short Index_To_Loc_Format;
- FT_Short Glyph_Data_Format;
-
- } TT_Header;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_HoriHeader */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType horizontal header, the `hhea' */
- /* table, as well as the corresponding horizontal metrics table, */
- /* i.e., the `hmtx' table. */
- /* */
- /* <Fields> */
- /* Version :: The table version. */
- /* */
- /* Ascender :: The font's ascender, i.e., the distance */
- /* from the baseline to the top-most of all */
- /* glyph points found in the font. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of the */
- /* glyphs found in the font (maybe ASCII). */
- /* */
- /* You should use the `sTypoAscender' field */
- /* of the OS/2 table instead if you want */
- /* the correct one. */
- /* */
- /* Descender :: The font's descender, i.e., the distance */
- /* from the baseline to the bottom-most of */
- /* all glyph points found in the font. It */
- /* is negative. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of the */
- /* glyphs found in the font (maybe ASCII). */
- /* */
- /* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Line_Gap :: The font's line gap, i.e., the distance */
- /* to add to the ascender and descender to */
- /* get the BTB, i.e., the */
- /* baseline-to-baseline distance for the */
- /* font. */
- /* */
- /* advance_Width_Max :: This field is the maximum of all advance */
- /* widths found in the font. It can be */
- /* used to compute the maximum width of an */
- /* arbitrary string of text. */
- /* */
- /* min_Left_Side_Bearing :: The minimum left side bearing of all */
- /* glyphs within the font. */
- /* */
- /* min_Right_Side_Bearing :: The minimum right side bearing of all */
- /* glyphs within the font. */
- /* */
- /* xMax_Extent :: The maximum horizontal extent (i.e., the */
- /* `width' of a glyph's bounding box) for */
- /* all glyphs in the font. */
- /* */
- /* caret_Slope_Rise :: The rise coefficient of the cursor's */
- /* slope of the cursor (slope=rise/run). */
- /* */
- /* caret_Slope_Run :: The run coefficient of the cursor's */
- /* slope. */
- /* */
- /* Reserved :: 8~reserved bytes. */
- /* */
- /* metric_Data_Format :: Always~0. */
- /* */
- /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
- /* table -- this value can be smaller than */
- /* the total number of glyphs in the font. */
- /* */
- /* long_metrics :: A pointer into the `hmtx' table. */
- /* */
- /* short_metrics :: A pointer into the `hmtx' table. */
- /* */
- /* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields, */
- /* which are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
- /* */
- typedef struct TT_HoriHeader_
- {
- FT_Fixed Version;
- FT_Short Ascender;
- FT_Short Descender;
- FT_Short Line_Gap;
-
- FT_UShort advance_Width_Max; /* advance width maximum */
-
- FT_Short min_Left_Side_Bearing; /* minimum left-sb */
- FT_Short min_Right_Side_Bearing; /* minimum right-sb */
- FT_Short xMax_Extent; /* xmax extents */
- FT_Short caret_Slope_Rise;
- FT_Short caret_Slope_Run;
- FT_Short caret_Offset;
-
- FT_Short Reserved[4];
-
- FT_Short metric_Data_Format;
- FT_UShort number_Of_HMetrics;
-
- /* The following fields are not defined by the TrueType specification */
- /* but they are used to connect the metrics header to the relevant */
- /* `HMTX' table. */
-
- void* long_metrics;
- void* short_metrics;
-
- } TT_HoriHeader;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_VertHeader */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType vertical header, the `vhea' */
- /* table, as well as the corresponding vertical metrics table, i.e., */
- /* the `vmtx' table. */
- /* */
- /* <Fields> */
- /* Version :: The table version. */
- /* */
- /* Ascender :: The font's ascender, i.e., the distance */
- /* from the baseline to the top-most of */
- /* all glyph points found in the font. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of */
- /* the glyphs found in the font (maybe */
- /* ASCII). */
- /* */
- /* You should use the `sTypoAscender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Descender :: The font's descender, i.e., the */
- /* distance from the baseline to the */
- /* bottom-most of all glyph points found */
- /* in the font. It is negative. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of */
- /* the glyphs found in the font (maybe */
- /* ASCII). */
- /* */
- /* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Line_Gap :: The font's line gap, i.e., the distance */
- /* to add to the ascender and descender to */
- /* get the BTB, i.e., the */
- /* baseline-to-baseline distance for the */
- /* font. */
- /* */
- /* advance_Height_Max :: This field is the maximum of all */
- /* advance heights found in the font. It */
- /* can be used to compute the maximum */
- /* height of an arbitrary string of text. */
- /* */
- /* min_Top_Side_Bearing :: The minimum top side bearing of all */
- /* glyphs within the font. */
- /* */
- /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
- /* glyphs within the font. */
- /* */
- /* yMax_Extent :: The maximum vertical extent (i.e., the */
- /* `height' of a glyph's bounding box) for */
- /* all glyphs in the font. */
- /* */
- /* caret_Slope_Rise :: The rise coefficient of the cursor's */
- /* slope of the cursor (slope=rise/run). */
- /* */
- /* caret_Slope_Run :: The run coefficient of the cursor's */
- /* slope. */
- /* */
- /* caret_Offset :: The cursor's offset for slanted fonts. */
- /* This value is `reserved' in vmtx */
- /* version 1.0. */
- /* */
- /* Reserved :: 8~reserved bytes. */
- /* */
- /* metric_Data_Format :: Always~0. */
- /* */
- /* number_Of_HMetrics :: Number of VMetrics entries in the */
- /* `vmtx' table -- this value can be */
- /* smaller than the total number of glyphs */
- /* in the font. */
- /* */
- /* long_metrics :: A pointer into the `vmtx' table. */
- /* */
- /* short_metrics :: A pointer into the `vmtx' table. */
- /* */
- /* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields, */
- /* which are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
- /* */
- typedef struct TT_VertHeader_
- {
- FT_Fixed Version;
- FT_Short Ascender;
- FT_Short Descender;
- FT_Short Line_Gap;
-
- FT_UShort advance_Height_Max; /* advance height maximum */
-
- FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
- FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
- FT_Short yMax_Extent; /* xmax or ymax extents */
- FT_Short caret_Slope_Rise;
- FT_Short caret_Slope_Run;
- FT_Short caret_Offset;
-
- FT_Short Reserved[4];
-
- FT_Short metric_Data_Format;
- FT_UShort number_Of_VMetrics;
-
- /* The following fields are not defined by the TrueType specification */
- /* but they're used to connect the metrics header to the relevant */
- /* `HMTX' or `VMTX' table. */
-
- void* long_metrics;
- void* short_metrics;
-
- } TT_VertHeader;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_OS2 */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType OS/2 table. All fields */
- /* comply to the OpenType specification. */
- /* */
- /* Note that we now support old Mac fonts that do not include an OS/2 */
- /* table. In this case, the `version' field is always set to 0xFFFF. */
- /* */
- typedef struct TT_OS2_
- {
- FT_UShort version; /* 0x0001 - more or 0xFFFF */
- FT_Short xAvgCharWidth;
- FT_UShort usWeightClass;
- FT_UShort usWidthClass;
- FT_Short fsType;
- FT_Short ySubscriptXSize;
- FT_Short ySubscriptYSize;
- FT_Short ySubscriptXOffset;
- FT_Short ySubscriptYOffset;
- FT_Short ySuperscriptXSize;
- FT_Short ySuperscriptYSize;
- FT_Short ySuperscriptXOffset;
- FT_Short ySuperscriptYOffset;
- FT_Short yStrikeoutSize;
- FT_Short yStrikeoutPosition;
- FT_Short sFamilyClass;
-
- FT_Byte panose[10];
-
- FT_ULong ulUnicodeRange1; /* Bits 0-31 */
- FT_ULong ulUnicodeRange2; /* Bits 32-63 */
- FT_ULong ulUnicodeRange3; /* Bits 64-95 */
- FT_ULong ulUnicodeRange4; /* Bits 96-127 */
-
- FT_Char achVendID[4];
-
- FT_UShort fsSelection;
- FT_UShort usFirstCharIndex;
- FT_UShort usLastCharIndex;
- FT_Short sTypoAscender;
- FT_Short sTypoDescender;
- FT_Short sTypoLineGap;
- FT_UShort usWinAscent;
- FT_UShort usWinDescent;
-
- /* only version 1 and higher: */
-
- FT_ULong ulCodePageRange1; /* Bits 0-31 */
- FT_ULong ulCodePageRange2; /* Bits 32-63 */
-
- /* only version 2 and higher: */
-
- FT_Short sxHeight;
- FT_Short sCapHeight;
- FT_UShort usDefaultChar;
- FT_UShort usBreakChar;
- FT_UShort usMaxContext;
-
- /* only version 5 and higher: */
-
- FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
- FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
-
- } TT_OS2;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Postscript */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType PostScript table. All fields */
- /* comply to the TrueType specification. This structure does not */
- /* reference the PostScript glyph names, which can be nevertheless */
- /* accessed with the `ttpost' module. */
- /* */
- typedef struct TT_Postscript_
- {
- FT_Fixed FormatType;
- FT_Fixed italicAngle;
- FT_Short underlinePosition;
- FT_Short underlineThickness;
- FT_ULong isFixedPitch;
- FT_ULong minMemType42;
- FT_ULong maxMemType42;
- FT_ULong minMemType1;
- FT_ULong maxMemType1;
-
- /* Glyph names follow in the file, but we don't */
- /* load them by default. See the ttpost.c file. */
-
- } TT_Postscript;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_PCLT */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType PCLT table. All fields */
- /* comply to the TrueType specification. */
- /* */
- typedef struct TT_PCLT_
- {
- FT_Fixed Version;
- FT_ULong FontNumber;
- FT_UShort Pitch;
- FT_UShort xHeight;
- FT_UShort Style;
- FT_UShort TypeFamily;
- FT_UShort CapHeight;
- FT_UShort SymbolSet;
- FT_Char TypeFace[16];
- FT_Char CharacterComplement[8];
- FT_Char FileName[6];
- FT_Char StrokeWeight;
- FT_Char WidthType;
- FT_Byte SerifStyle;
- FT_Byte Reserved;
-
- } TT_PCLT;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_MaxProfile */
- /* */
- /* <Description> */
- /* The maximum profile is a table containing many max values, which */
- /* can be used to pre-allocate arrays. This ensures that no memory */
- /* allocation occurs during a glyph load. */
- /* */
- /* <Fields> */
- /* version :: The version number. */
- /* */
- /* numGlyphs :: The number of glyphs in this TrueType */
- /* font. */
- /* */
- /* maxPoints :: The maximum number of points in a */
- /* non-composite TrueType glyph. See also */
- /* the structure element */
- /* `maxCompositePoints'. */
- /* */
- /* maxContours :: The maximum number of contours in a */
- /* non-composite TrueType glyph. See also */
- /* the structure element */
- /* `maxCompositeContours'. */
- /* */
- /* maxCompositePoints :: The maximum number of points in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxPoints'. */
- /* */
- /* maxCompositeContours :: The maximum number of contours in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxContours'. */
- /* */
- /* maxZones :: The maximum number of zones used for */
- /* glyph hinting. */
- /* */
- /* maxTwilightPoints :: The maximum number of points in the */
- /* twilight zone used for glyph hinting. */
- /* */
- /* maxStorage :: The maximum number of elements in the */
- /* storage area used for glyph hinting. */
- /* */
- /* maxFunctionDefs :: The maximum number of function */
- /* definitions in the TrueType bytecode for */
- /* this font. */
- /* */
- /* maxInstructionDefs :: The maximum number of instruction */
- /* definitions in the TrueType bytecode for */
- /* this font. */
- /* */
- /* maxStackElements :: The maximum number of stack elements used */
- /* during bytecode interpretation. */
- /* */
- /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
- /* used for glyph hinting. */
- /* */
- /* maxComponentElements :: The maximum number of simple (i.e., non- */
- /* composite) glyphs in a composite glyph. */
- /* */
- /* maxComponentDepth :: The maximum nesting depth of composite */
- /* glyphs. */
- /* */
- /* <Note> */
- /* This structure is only used during font loading. */
- /* */
- typedef struct TT_MaxProfile_
- {
- FT_Fixed version;
- FT_UShort numGlyphs;
- FT_UShort maxPoints;
- FT_UShort maxContours;
- FT_UShort maxCompositePoints;
- FT_UShort maxCompositeContours;
- FT_UShort maxZones;
- FT_UShort maxTwilightPoints;
- FT_UShort maxStorage;
- FT_UShort maxFunctionDefs;
- FT_UShort maxInstructionDefs;
- FT_UShort maxStackElements;
- FT_UShort maxSizeOfInstructions;
- FT_UShort maxComponentElements;
- FT_UShort maxComponentDepth;
-
- } TT_MaxProfile;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Sfnt_Tag */
- /* */
- /* <Description> */
- /* An enumeration used to specify the index of an SFNT table. */
- /* Used in the @FT_Get_Sfnt_Table API function. */
- /* */
- /* <Values> */
- /* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */
- /* */
- /* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */
- /* */
- /* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */
- /* */
- /* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
- /* */
- /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture. */
- /* */
- /* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
- /* */
- /* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */
- /* */
- typedef enum FT_Sfnt_Tag_
- {
- FT_SFNT_HEAD,
- FT_SFNT_MAXP,
- FT_SFNT_OS2,
- FT_SFNT_HHEA,
- FT_SFNT_VHEA,
- FT_SFNT_POST,
- FT_SFNT_PCLT,
-
- FT_SFNT_MAX
-
- } FT_Sfnt_Tag;
-
- /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
- /* values instead */
-#define ft_sfnt_head FT_SFNT_HEAD
-#define ft_sfnt_maxp FT_SFNT_MAXP
-#define ft_sfnt_os2 FT_SFNT_OS2
-#define ft_sfnt_hhea FT_SFNT_HHEA
-#define ft_sfnt_vhea FT_SFNT_VHEA
-#define ft_sfnt_post FT_SFNT_POST
-#define ft_sfnt_pclt FT_SFNT_PCLT
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Table */
- /* */
- /* <Description> */
- /* Return a pointer to a given SFNT table within a face. */
- /* */
- /* <Input> */
- /* face :: A handle to the source. */
- /* */
- /* tag :: The index of the SFNT table. */
- /* */
- /* <Return> */
- /* A type-less pointer to the table. This will be~0 in case of */
- /* error, or if the corresponding table was not found *OR* loaded */
- /* from the file. */
- /* */
- /* Use a typecast according to `tag' to access the structure */
- /* elements. */
- /* */
- /* <Note> */
- /* The table is owned by the face object and disappears with it. */
- /* */
- /* This function is only useful to access SFNT tables that are loaded */
- /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
- /* a list. */
- /* */
- /* Here an example how to access the `vhea' table: */
- /* */
- /* { */
- /* TT_VertHeader* vert_header; */
- /* */
- /* */
- /* vert_header = */
- /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */
- /* } */
- /* */
- FT_EXPORT( void* )
- FT_Get_Sfnt_Table( FT_Face face,
- FT_Sfnt_Tag tag );
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Load_Sfnt_Table
- *
- * @description:
- * Load any font table into client memory.
- *
- * @input:
- * face ::
- * A handle to the source face.
- *
- * tag ::
- * The four-byte tag of the table to load. Use the value~0 if you want
- * to access the whole font file. Otherwise, you can use one of the
- * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
- * one with @FT_MAKE_TAG.
- *
- * offset ::
- * The starting offset in the table (or file if tag == 0).
- *
- * @output:
- * buffer ::
- * The target buffer address. The client must ensure that the memory
- * array is big enough to hold the data.
- *
- * @inout:
- * length ::
- * If the `length' parameter is NULL, then try to load the whole table.
- * Return an error code if it fails.
- *
- * Else, if `*length' is~0, exit immediately while returning the
- * table's (or file) full size in it.
- *
- * Else the number of bytes to read from the table or file, from the
- * starting offset.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * If you need to determine the table's length you should first call this
- * function with `*length' set to~0, as in the following example:
- *
- * {
- * FT_ULong length = 0;
- *
- *
- * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
- * if ( error ) { ... table does not exist ... }
- *
- * buffer = malloc( length );
- * if ( buffer == NULL ) { ... not enough memory ... }
- *
- * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
- * if ( error ) { ... could not load table ... }
- * }
- *
- * Note that structures like @TT_Header or @TT_OS2 can't be used with
- * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
- * those structures depend on the processor architecture, with varying
- * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
- *
- */
- FT_EXPORT( FT_Error )
- FT_Load_Sfnt_Table( FT_Face face,
- FT_ULong tag,
- FT_Long offset,
- FT_Byte* buffer,
- FT_ULong* length );
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Sfnt_Table_Info
- *
- * @description:
- * Return information on an SFNT table.
- *
- * @input:
- * face ::
- * A handle to the source face.
- *
- * table_index ::
- * The index of an SFNT table. The function returns
- * FT_Err_Table_Missing for an invalid value.
- *
- * @inout:
- * tag ::
- * The name tag of the SFNT table. If the value is NULL, `table_index'
- * is ignored, and `length' returns the number of SFNT tables in the
- * font.
- *
- * @output:
- * length ::
- * The length of the SFNT table (or the number of SFNT tables, depending
- * on `tag').
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * While parsing fonts, FreeType handles SFNT tables with length zero as
- * missing.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Sfnt_Table_Info( FT_Face face,
- FT_UInt table_index,
- FT_ULong *tag,
- FT_ULong *length );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_CMap_Language_ID */
- /* */
- /* <Description> */
- /* Return TrueType/sfnt specific cmap language ID. Definitions of */
- /* language ID values are in `ttnameid.h'. */
- /* */
- /* <Input> */
- /* charmap :: */
- /* The target charmap. */
- /* */
- /* <Return> */
- /* The language ID of `charmap'. If `charmap' doesn't belong to a */
- /* TrueType/sfnt face, just return~0 as the default value. */
- /* */
- /* For a format~14 cmap (to access Unicode IVS), the return value is */
- /* 0xFFFFFFFF. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_CMap_Language_ID( FT_CharMap charmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_CMap_Format */
- /* */
- /* <Description> */
- /* Return TrueType/sfnt specific cmap format. */
- /* */
- /* <Input> */
- /* charmap :: */
- /* The target charmap. */
- /* */
- /* <Return> */
- /* The format of `charmap'. If `charmap' doesn't belong to a */
- /* TrueType/sfnt face, return -1. */
- /* */
- FT_EXPORT( FT_Long )
- FT_Get_CMap_Format( FT_CharMap charmap );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __TTTABLES_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/tttags.h b/src/3rdparty/freetype/include/tttags.h
deleted file mode 100644
index d59aa19a33..0000000000
--- a/src/3rdparty/freetype/include/tttags.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************/
-/* */
-/* tttags.h */
-/* */
-/* Tags for TrueType and OpenType tables (specification only). */
-/* */
-/* Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __TTAGS_H__
-#define __TTAGS_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
-#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
-#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
-#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
-#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
-#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
-#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
-#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
-#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
-#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
-#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
-#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
-#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
-#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
-#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
-#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
-#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
-#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
-#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
-#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
-#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
-#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
-#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
-#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
-#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
-#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
-#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
-#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
-#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
-#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
-#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
-#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
-#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
-#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
-#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
-#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
-#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
-#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
-#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
-#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
-#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
-#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
-#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
-#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
-#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
-#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
-#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
-#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
-#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
-#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
-#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
-#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
-#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
-#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
-#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
-#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
-#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
-#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
-#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
-#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
-#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
-#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
-#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
-#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
-#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
-#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
-#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
-#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
-#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
-
-
-FT_END_HEADER
-
-#endif /* __TTAGS_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/include/ttunpat.h b/src/3rdparty/freetype/include/ttunpat.h
deleted file mode 100644
index bf53ddd528..0000000000
--- a/src/3rdparty/freetype/include/ttunpat.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************/
-/* */
-/* ttunpat.h */
-/* */
-/* Definitions for the unpatented TrueType hinting system */
-/* */
-/* Copyright 2003, 2006 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* Written by Graham Asher <graham.asher@btinternet.com> */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __TTUNPAT_H__
-#define __TTUNPAT_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_UNPATENTED_HINTING
- *
- * @description:
- * A constant used as the tag of an @FT_Parameter structure to indicate
- * that unpatented methods only should be used by the TrueType bytecode
- * interpreter for a typeface opened by @FT_Open_Face.
- *
- */
-#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __TTUNPAT_H__ */
-
-
-/* END */
diff --git a/src/3rdparty/freetype/src/Jamfile b/src/3rdparty/freetype/src/Jamfile
index 1cc06858c0..65e061910d 100644
--- a/src/3rdparty/freetype/src/Jamfile
+++ b/src/3rdparty/freetype/src/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src Jamfile
#
-# Copyright 2001, 2002, 2013 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -11,12 +11,6 @@
SubDir FT2_TOP $(FT2_SRC_DIR) ;
-# The file <internal/internal.h> is used to define macros that are
-# later used in #include statements. It needs to be parsed in order to
-# record these definitions.
-#
-HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) internal internal.h ] ;
-
for xx in $(FT2_COMPONENTS)
{
SubInclude FT2_TOP $(FT2_SRC_DIR) $(xx) ;
diff --git a/src/3rdparty/freetype/src/autofit/Jamfile b/src/3rdparty/freetype/src/autofit/Jamfile
index 2714765b5b..5cd0b46108 100644
--- a/src/3rdparty/freetype/src/autofit/Jamfile
+++ b/src/3rdparty/freetype/src/autofit/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/autofit Jamfile
#
-# Copyright 2003, 2004, 2005, 2006, 2007, 2009 by
+# Copyright 2003-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -17,11 +17,25 @@ SubDir FT2_TOP src autofit ;
# define FT2_AUTOFIT2 to enable experimental latin hinter replacement
if $(FT2_AUTOFIT2)
{
- DEFINES += FT_OPTION_AUTOFIT2 ;
+ CCFLAGS += FT_OPTION_AUTOFIT2 ;
}
if $(FT2_MULTI)
{
- _sources = afangles afglobal afhints aflatin afcjk afindic afloader afmodule afdummy afwarp afpic ;
+ _sources = afangles
+ afblue
+ afcjk
+ afdummy
+ afglobal
+ afhints
+ afindic
+ aflatin
+ afloader
+ afmodule
+ afpic
+ afranges
+ afwarp
+ hbshim
+ ;
if $(FT2_AUTOFIT2)
{
diff --git a/src/3rdparty/freetype/src/autofit/afangles.c b/src/3rdparty/freetype/src/autofit/afangles.c
index f8b095bef3..1b1eb31fe7 100644
--- a/src/3rdparty/freetype/src/autofit/afangles.c
+++ b/src/3rdparty/freetype/src/autofit/afangles.c
@@ -5,7 +5,7 @@
/* Routines used to compute vector angles with limited accuracy */
/* and very high speed. It also contains sorting routines (body). */
/* */
-/* Copyright 2003-2006, 2011-2012 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -259,7 +259,7 @@
sum += table[j].org;
table[j].org = 0;
}
- table[cur_idx].org = sum / j;
+ table[cur_idx].org = sum / (FT_Pos)j;
if ( i < *count - 1 )
{
diff --git a/src/3rdparty/freetype/src/autofit/afblue.c b/src/3rdparty/freetype/src/autofit/afblue.c
index 811226eac3..b871e0c651 100644
--- a/src/3rdparty/freetype/src/autofit/afblue.c
+++ b/src/3rdparty/freetype/src/autofit/afblue.c
@@ -7,7 +7,7 @@
/* */
/* Auto-fitter data for blue strings (body). */
/* */
-/* Copyright 2013 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,6 +26,12 @@
af_blue_strings[] =
{
/* */
+ '\xD8', '\xA7', '\xD8', '\xA5', '\xD9', '\x84', '\xD9', '\x83', '\xD8', '\xB7', '\xD8', '\xB8', /* ا إ ل ك ط ظ */
+ '\0',
+ '\xD8', '\xAA', '\xD8', '\xAB', '\xD8', '\xB7', '\xD8', '\xB8', '\xD9', '\x83', /* ت ث ط ظ ك */
+ '\0',
+ '\xD9', '\x80', /* ـ */
+ '\0',
'\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */
'\0',
'\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */
@@ -58,6 +64,16 @@
'\0',
'\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5', /* קךןףץ */
'\0',
+ '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\x94', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\xA1', '\xE0', '\xBA', '\xA5', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\x87', /* າ ດ ອ ມ ລ ວ ຣ ງ */
+ '\0',
+ '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\x9A', '\xE0', '\xBA', '\x8D', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\xAE', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA2', /* າ ອ ບ ຍ ຣ ຮ ວ ຢ */
+ '\0',
+ '\xE0', '\xBA', '\x9B', '\xE0', '\xBA', '\xA2', '\xE0', '\xBA', '\x9F', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ ຝ */
+ '\0',
+ '\xE0', '\xBB', '\x82', '\xE0', '\xBB', '\x84', '\xE0', '\xBB', '\x83', /* ໂ ໄ ໃ */
+ '\0',
+ '\xE0', '\xBA', '\x87', '\xE0', '\xBA', '\x8A', '\xE0', '\xBA', '\x96', '\xE0', '\xBA', '\xBD', '\xE0', '\xBB', '\x86', '\xE0', '\xBA', '\xAF', /* ງ ຊ ຖ ຽ ໆ ຯ */
+ '\0',
'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S', /* THEZOCQS */
'\0',
'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S', /* HEZLOCUS */
@@ -68,9 +84,43 @@
'\0',
'p', 'q', 'g', 'j', 'y', /* pqgjy */
'\0',
+ '\xE2', '\x82', '\x80', '\xE2', '\x82', '\x83', '\xE2', '\x82', '\x85', '\xE2', '\x82', '\x87', '\xE2', '\x82', '\x88', /* ₀₃₅₇₈ */
+ '\0',
+ '\xE2', '\x82', '\x80', '\xE2', '\x82', '\x81', '\xE2', '\x82', '\x82', '\xE2', '\x82', '\x83', '\xE2', '\x82', '\x88', /* ₀₁₂₃₈ */
+ '\0',
+ '\xE1', '\xB5', '\xA2', '\xE2', '\xB1', '\xBC', '\xE2', '\x82', '\x95', '\xE2', '\x82', '\x96', '\xE2', '\x82', '\x97', /* ᵢⱼₕₖₗ */
+ '\0',
+ '\xE2', '\x82', '\x90', '\xE2', '\x82', '\x91', '\xE2', '\x82', '\x92', '\xE2', '\x82', '\x93', '\xE2', '\x82', '\x99', '\xE2', '\x82', '\x9B', '\xE1', '\xB5', '\xA5', '\xE1', '\xB5', '\xA4', '\xE1', '\xB5', '\xA3', /* ₐₑₒₓₙₛᵥᵤᵣ */
+ '\0',
+ '\xE1', '\xB5', '\xA6', '\xE1', '\xB5', '\xA7', '\xE1', '\xB5', '\xA8', '\xE1', '\xB5', '\xA9', '\xE2', '\x82', '\x9A', /* ᵦᵧᵨᵩₚ */
+ '\0',
+ '\xE2', '\x81', '\xB0', '\xC2', '\xB3', '\xE2', '\x81', '\xB5', '\xE2', '\x81', '\xB7', '\xE1', '\xB5', '\x80', '\xE1', '\xB4', '\xB4', '\xE1', '\xB4', '\xB1', '\xE1', '\xB4', '\xBC', /* ⁰³⁵⁷ᵀᴴᴱᴼ */
+ '\0',
+ '\xE2', '\x81', '\xB0', '\xC2', '\xB9', '\xC2', '\xB2', '\xC2', '\xB3', '\xE1', '\xB4', '\xB1', '\xE1', '\xB4', '\xB8', '\xE1', '\xB4', '\xBC', '\xE1', '\xB5', '\x81', /* ⁰¹²³ᴱᴸᴼᵁ */
+ '\0',
+ '\xE1', '\xB5', '\x87', '\xE1', '\xB5', '\x88', '\xE1', '\xB5', '\x8F', '\xCA', '\xB0', '\xCA', '\xB2', '\xE1', '\xB6', '\xA0', '\xE2', '\x81', '\xB1', /* ᵇᵈᵏʰʲᶠⁱ */
+ '\0',
+ '\xE1', '\xB5', '\x89', '\xE1', '\xB5', '\x92', '\xCA', '\xB3', '\xCB', '\xA2', '\xCB', '\xA3', '\xE1', '\xB6', '\x9C', '\xE1', '\xB6', '\xBB', /* ᵉᵒʳˢˣᶜᶻ */
+ '\0',
+ '\xE1', '\xB5', '\x96', '\xCA', '\xB8', '\xE1', '\xB5', '\x8D', /* ᵖʸᵍ */
+ '\0',
'\xE0', '\xB0', '\x87', '\xE0', '\xB0', '\x8C', '\xE0', '\xB0', '\x99', '\xE0', '\xB0', '\x9E', '\xE0', '\xB0', '\xA3', '\xE0', '\xB0', '\xB1', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */
'\0',
'\xE0', '\xB0', '\x85', '\xE0', '\xB0', '\x95', '\xE0', '\xB0', '\x9A', '\xE0', '\xB0', '\xB0', '\xE0', '\xB0', '\xBD', '\xE0', '\xB1', '\xA8', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */
+ '\0',
+ '\xE0', '\xB8', '\x9A', '\xE0', '\xB9', '\x80', '\xE0', '\xB9', '\x81', '\xE0', '\xB8', '\xAD', '\xE0', '\xB8', '\x81', '\xE0', '\xB8', '\xB2', /* บ เ แ อ ก า */
+ '\0',
+ '\xE0', '\xB8', '\x9A', '\xE0', '\xB8', '\x9B', '\xE0', '\xB8', '\xA9', '\xE0', '\xB8', '\xAF', '\xE0', '\xB8', '\xAD', '\xE0', '\xB8', '\xA2', '\xE0', '\xB8', '\xAE', /* บ ป ษ ฯ อ ย ฮ */
+ '\0',
+ '\xE0', '\xB8', '\x9B', '\xE0', '\xB8', '\x9D', '\xE0', '\xB8', '\x9F', /* ป ฝ ฟ */
+ '\0',
+ '\xE0', '\xB9', '\x82', '\xE0', '\xB9', '\x83', '\xE0', '\xB9', '\x84', /* โ ใ ไ */
+ '\0',
+ '\xE0', '\xB8', '\x8E', '\xE0', '\xB8', '\x8F', '\xE0', '\xB8', '\xA4', '\xE0', '\xB8', '\xA6', /* ฎ ฏ ฤ ฦ */
+ '\0',
+ '\xE0', '\xB8', '\x8D', '\xE0', '\xB8', '\x90', /* ญ ฐ */
+ '\0',
+ '\xE0', '\xB9', '\x90', '\xE0', '\xB9', '\x91', '\xE0', '\xB9', '\x93', /* ๐ ๑ ๓ */
#ifdef AF_CONFIG_OPTION_CJK
'\0',
'\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 他们你來們到和地 */
@@ -121,6 +171,10 @@
af_blue_stringsets[] =
{
/* */
+ { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_ARABIC_BOTTOM, 0 },
+ { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
@@ -149,6 +203,13 @@
{ AF_BLUE_STRING_HEBREW_BOTTOM, 0 },
{ AF_BLUE_STRING_HEBREW_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_LAO_BOTTOM, 0 },
+ { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LAO_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
@@ -157,9 +218,34 @@
{ AF_BLUE_STRING_LATIN_SMALL, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_TELUGU_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_THAI_BOTTOM, 0 },
+ { AF_BLUE_STRING_THAI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_THAI_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_THAI_DESCENDER, 0 },
+ { AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 },
+ { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
#ifdef AF_CONFIG_OPTION_CJK
{ AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP },
{ AF_BLUE_STRING_CJK_BOTTOM, 0 },
diff --git a/src/3rdparty/freetype/src/autofit/afblue.cin b/src/3rdparty/freetype/src/autofit/afblue.cin
index c6762bec30..b303a4b2b0 100644
--- a/src/3rdparty/freetype/src/autofit/afblue.cin
+++ b/src/3rdparty/freetype/src/autofit/afblue.cin
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter data for blue strings (body). */
/* */
-/* Copyright 2013 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/afblue.dat b/src/3rdparty/freetype/src/autofit/afblue.dat
index 3f98c13b24..1b52378ed3 100644
--- a/src/3rdparty/freetype/src/autofit/afblue.dat
+++ b/src/3rdparty/freetype/src/autofit/afblue.dat
@@ -2,7 +2,7 @@
//
// Auto-fitter data for blue strings.
//
-// Copyright 2013, 2014 by
+// Copyright 2013-2015 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
@@ -67,6 +67,18 @@
AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ AF_BLUE_STRING_ARABIC_TOP
+ "ا إ ل ك ط ظ"
+ AF_BLUE_STRING_ARABIC_BOTTOM
+ "ت ث ط ظ ك"
+ // We don't necessarily have access to medial forms via Unicode in case
+ // Arabic presentational forms are missing. The only character that is
+ // guaranteed to have the same vertical position with joining (this is,
+ // non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both
+ // round and flat curves.
+ AF_BLUE_STRING_ARABIC_JOIN
+ "ـ"
+
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
"БВЕПЗОСЭ"
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
@@ -108,6 +120,17 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_HEBREW_DESCENDER
"קךןףץ"
+ AF_BLUE_STRING_LAO_TOP
+ "າ ດ ອ ມ ລ ວ ຣ ງ"
+ AF_BLUE_STRING_LAO_BOTTOM
+ "າ ອ ບ ຍ ຣ ຮ ວ ຢ"
+ AF_BLUE_STRING_LAO_ASCENDER
+ "ປ ຢ ຟ ຝ"
+ AF_BLUE_STRING_LAO_LARGE_ASCENDER
+ "ໂ ໄ ໃ"
+ AF_BLUE_STRING_LAO_DESCENDER
+ "ງ ຊ ຖ ຽ ໆ ຯ"
+
AF_BLUE_STRING_LATIN_CAPITAL_TOP
"THEZOCQS"
AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
@@ -119,14 +142,54 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_LATIN_SMALL_DESCENDER
"pqgjy"
+ // we assume that both the subscript and superscript ranges
+ // don't contain oldstyle digits (actually, most fonts probably
+ // have digits only in those ranges)
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP
+ "₀₃₅₇₈"
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM
+ "₀₁₂₃₈"
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP
+ "ᵢⱼₕₖₗ"
+ AF_BLUE_STRING_LATIN_SUBS_SMALL
+ "ₐₑₒₓₙₛᵥᵤᵣ"
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER
+ "ᵦᵧᵨᵩₚ"
+
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP
+ "⁰³⁵⁷ᵀᴴᴱᴼ"
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM
+ "⁰¹²³ᴱᴸᴼᵁ"
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP
+ "ᵇᵈᵏʰʲᶠⁱ"
+ AF_BLUE_STRING_LATIN_SUPS_SMALL
+ "ᵉᵒʳˢˣᶜᶻ"
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
+ "ᵖʸᵍ"
+
// we separate the letters with spaces to avoid ligatures;
// this is just for convenience to simplify reading
AF_BLUE_STRING_TELUGU_TOP
"ఇ ఌ ఙ ఞ ణ ఱ ౯"
-
AF_BLUE_STRING_TELUGU_BOTTOM
"అ క చ ర ఽ ౨ ౬"
+ AF_BLUE_STRING_THAI_TOP
+ "บ เ แ อ ก า"
+ AF_BLUE_STRING_THAI_BOTTOM
+ "บ ป ษ ฯ อ ย ฮ"
+ AF_BLUE_STRING_THAI_ASCENDER
+ "ป ฝ ฟ"
+ AF_BLUE_STRING_THAI_LARGE_ASCENDER
+ "โ ใ ไ"
+ AF_BLUE_STRING_THAI_DESCENDER
+ "ฎ ฏ ฤ ฦ"
+ AF_BLUE_STRING_THAI_LARGE_DESCENDER
+ "ญ ฐ"
+ AF_BLUE_STRING_THAI_DIGIT_TOP
+ "๐ ๑ ๓"
+
+
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRING_CJK_TOP
@@ -268,6 +331,12 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
+ AF_BLUE_STRINGSET_ARAB
+ { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_ARABIC_BOTTOM, 0 }
+ { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_CYRL
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }
@@ -304,6 +373,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_HEBREW_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_LAO
+ { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_LAO_BOTTOM, 0 }
+ { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LAO_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_LATN
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }
@@ -314,11 +392,43 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_LATB
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+ AF_BLUE_STRINGSET_LATP
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
AF_BLUE_STRINGSET_TELU
{ AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_TELUGU_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_STRINGSET_THAI
+ { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_THAI_BOTTOM, 0 }
+ { AF_BLUE_STRING_THAI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_THAI_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_THAI_DESCENDER, 0 }
+ { AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 }
+ { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
+
+
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRINGSET_HANI
diff --git a/src/3rdparty/freetype/src/autofit/afblue.h b/src/3rdparty/freetype/src/autofit/afblue.h
index a86184191d..c26a9c792b 100644
--- a/src/3rdparty/freetype/src/autofit/afblue.h
+++ b/src/3rdparty/freetype/src/autofit/afblue.h
@@ -7,7 +7,7 @@
/* */
/* Auto-fitter data for blue strings (specification). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -74,30 +74,55 @@ FT_BEGIN_HEADER
typedef enum AF_Blue_String_
{
- AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 0,
- AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 17,
- AF_BLUE_STRING_CYRILLIC_SMALL = 34,
- AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 51,
- AF_BLUE_STRING_DEVANAGARI_BASE = 58,
- AF_BLUE_STRING_DEVANAGARI_TOP = 83,
- AF_BLUE_STRING_DEVANAGARI_HEAD = 108,
- AF_BLUE_STRING_DEVANAGARI_BOTTOM = 133,
- AF_BLUE_STRING_GREEK_CAPITAL_TOP = 140,
- AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 155,
- AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 168,
- AF_BLUE_STRING_GREEK_SMALL = 181,
- AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 198,
- AF_BLUE_STRING_HEBREW_TOP = 215,
- AF_BLUE_STRING_HEBREW_BOTTOM = 232,
- AF_BLUE_STRING_HEBREW_DESCENDER = 245,
- AF_BLUE_STRING_LATIN_CAPITAL_TOP = 256,
- AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 265,
- AF_BLUE_STRING_LATIN_SMALL_F_TOP = 274,
- AF_BLUE_STRING_LATIN_SMALL = 282,
- AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 290,
- AF_BLUE_STRING_TELUGU_TOP = 296,
- AF_BLUE_STRING_TELUGU_BOTTOM = 318,
- af_blue_1_1 = 339,
+ AF_BLUE_STRING_ARABIC_TOP = 0,
+ AF_BLUE_STRING_ARABIC_BOTTOM = 13,
+ AF_BLUE_STRING_ARABIC_JOIN = 24,
+ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 27,
+ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 44,
+ AF_BLUE_STRING_CYRILLIC_SMALL = 61,
+ AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 78,
+ AF_BLUE_STRING_DEVANAGARI_BASE = 85,
+ AF_BLUE_STRING_DEVANAGARI_TOP = 110,
+ AF_BLUE_STRING_DEVANAGARI_HEAD = 135,
+ AF_BLUE_STRING_DEVANAGARI_BOTTOM = 160,
+ AF_BLUE_STRING_GREEK_CAPITAL_TOP = 167,
+ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 182,
+ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 195,
+ AF_BLUE_STRING_GREEK_SMALL = 208,
+ AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 225,
+ AF_BLUE_STRING_HEBREW_TOP = 242,
+ AF_BLUE_STRING_HEBREW_BOTTOM = 259,
+ AF_BLUE_STRING_HEBREW_DESCENDER = 272,
+ AF_BLUE_STRING_LAO_TOP = 283,
+ AF_BLUE_STRING_LAO_BOTTOM = 308,
+ AF_BLUE_STRING_LAO_ASCENDER = 333,
+ AF_BLUE_STRING_LAO_LARGE_ASCENDER = 346,
+ AF_BLUE_STRING_LAO_DESCENDER = 356,
+ AF_BLUE_STRING_LATIN_CAPITAL_TOP = 375,
+ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 384,
+ AF_BLUE_STRING_LATIN_SMALL_F_TOP = 393,
+ AF_BLUE_STRING_LATIN_SMALL = 401,
+ AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 409,
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 415,
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 431,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 447,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL = 463,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 491,
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 507,
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 531,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 553,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL = 573,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 592,
+ AF_BLUE_STRING_TELUGU_TOP = 601,
+ AF_BLUE_STRING_TELUGU_BOTTOM = 623,
+ AF_BLUE_STRING_THAI_TOP = 645,
+ AF_BLUE_STRING_THAI_BOTTOM = 664,
+ AF_BLUE_STRING_THAI_ASCENDER = 686,
+ AF_BLUE_STRING_THAI_LARGE_ASCENDER = 696,
+ AF_BLUE_STRING_THAI_DESCENDER = 706,
+ AF_BLUE_STRING_THAI_LARGE_DESCENDER = 719,
+ AF_BLUE_STRING_THAI_DIGIT_TOP = 726,
+ af_blue_1_1 = 735,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153,
@@ -138,30 +163,35 @@ FT_BEGIN_HEADER
/* Properties are specific to a writing system. We assume that a given */
/* blue string can't be used in more than a single writing system, which */
/* is a safe bet. */
-#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) /* must have value 1 */
-#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1 << 1 )
-#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 2 )
-#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 3 )
+#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */
+#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 1 )
+#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 2 )
+#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 3 )
-#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 ) /* must have value 1 */
-#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 ) /* must have value 2 */
+#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */
+#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */
#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
-#define AF_BLUE_STRINGSET_MAX_LEN 7
+#define AF_BLUE_STRINGSET_MAX_LEN 8
/* The AF_Blue_Stringset enumeration values are offsets into the */
/* `af_blue_stringsets' array. */
typedef enum AF_Blue_Stringset_
{
- AF_BLUE_STRINGSET_CYRL = 0,
- AF_BLUE_STRINGSET_DEVA = 6,
- AF_BLUE_STRINGSET_GREK = 12,
- AF_BLUE_STRINGSET_HEBR = 19,
- AF_BLUE_STRINGSET_LATN = 23,
- AF_BLUE_STRINGSET_TELU = 30,
- af_blue_2_1 = 33,
+ AF_BLUE_STRINGSET_ARAB = 0,
+ AF_BLUE_STRINGSET_CYRL = 4,
+ AF_BLUE_STRINGSET_DEVA = 10,
+ AF_BLUE_STRINGSET_GREK = 16,
+ AF_BLUE_STRINGSET_HEBR = 23,
+ AF_BLUE_STRINGSET_LAO = 27,
+ AF_BLUE_STRINGSET_LATN = 33,
+ AF_BLUE_STRINGSET_LATB = 40,
+ AF_BLUE_STRINGSET_LATP = 47,
+ AF_BLUE_STRINGSET_TELU = 54,
+ AF_BLUE_STRINGSET_THAI = 57,
+ af_blue_2_1 = 65,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
af_blue_2_1_1 = af_blue_2_1 + 2,
diff --git a/src/3rdparty/freetype/src/autofit/afblue.hin b/src/3rdparty/freetype/src/autofit/afblue.hin
index 0b4b48d7fe..ad43fe6cef 100644
--- a/src/3rdparty/freetype/src/autofit/afblue.hin
+++ b/src/3rdparty/freetype/src/autofit/afblue.hin
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter data for blue strings (specification). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -96,13 +96,13 @@ FT_BEGIN_HEADER
/* Properties are specific to a writing system. We assume that a given */
/* blue string can't be used in more than a single writing system, which */
/* is a safe bet. */
-#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) /* must have value 1 */
-#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1 << 1 )
-#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 2 )
-#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 3 )
+#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */
+#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 1 )
+#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 2 )
+#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 3 )
-#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 ) /* must have value 1 */
-#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 ) /* must have value 2 */
+#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */
+#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */
#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
diff --git a/src/3rdparty/freetype/src/autofit/afcjk.c b/src/3rdparty/freetype/src/autofit/afcjk.c
index 048e0e7d02..0ade4be40b 100644
--- a/src/3rdparty/freetype/src/autofit/afcjk.c
+++ b/src/3rdparty/freetype/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK writing system (body). */
/* */
-/* Copyright 2006-2014 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -260,8 +260,8 @@
FT_Pos fills[AF_BLUE_STRING_MAX_LEN];
FT_Pos flats[AF_BLUE_STRING_MAX_LEN];
- FT_Int num_fills;
- FT_Int num_flats;
+ FT_UInt num_fills;
+ FT_UInt num_flats;
FT_Bool fill;
@@ -720,8 +720,8 @@
{
AF_Point pt = seg->first;
AF_Point last = seg->last;
- AF_Flags f0 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
- AF_Flags f1;
+ FT_UInt f0 = pt->flags & AF_FLAG_CONTROL;
+ FT_UInt f1;
seg->flags &= ~AF_EDGE_ROUND;
@@ -729,7 +729,7 @@
for ( ; pt != last; f0 = f1 )
{
pt = pt->next;
- f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
+ f1 = pt->flags & AF_FLAG_CONTROL;
if ( !f0 && !f1 )
break;
@@ -863,19 +863,19 @@
if ( link == seg2 )
{
- seg->link = 0;
+ seg->link = NULL;
seg->serif = link1;
}
else if ( link == link2 )
{
- seg->link = 0;
+ seg->link = NULL;
seg->serif = seg1;
}
}
}
else
{
- seg1->link = link1->link = 0;
+ seg1->link = link1->link = NULL;
break;
}
@@ -892,7 +892,7 @@
seg2->num_linked++;
if ( seg2->link != seg1 )
{
- seg1->link = 0;
+ seg1->link = NULL;
if ( seg2->score < dist_threshold || seg1->score < seg2->score * 4 )
seg1->serif = seg2->link;
@@ -1159,7 +1159,7 @@
/* Example: the `c' in cour.pfa at size 13 */
if ( edge->serif && edge->link )
- edge->serif = 0;
+ edge->serif = NULL;
}
}
@@ -1190,7 +1190,7 @@
/* Compute all edges which lie within blue zones. */
- FT_LOCAL_DEF( void )
+ static void
af_cjk_hints_compute_blue_edges( AF_GlyphHints hints,
AF_CJKMetrics metrics,
AF_Dimension dim )
@@ -1301,7 +1301,7 @@
/* compute flags depending on render mode, etc. */
mode = metrics->root.scaler.render_mode;
-#ifdef AF_CONFIG_OPTION_USE_WARPER
+#if 0 /* AF_CONFIG_OPTION_USE_WARPER */
if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
#endif
@@ -1334,6 +1334,12 @@
scaler_flags |= AF_SCALER_FLAG_NO_ADVANCE;
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ /* get (global) warper flag */
+ if ( !metrics->root.globals->module->warping )
+ scaler_flags |= AF_SCALER_FLAG_NO_WARPER;
+#endif
+
hints->scaler_flags = scaler_flags;
hints->other_flags = other_flags;
@@ -1354,13 +1360,13 @@
static FT_Pos
af_cjk_snap_width( AF_Width widths,
- FT_Int count,
+ FT_UInt count,
FT_Pos width )
{
- int n;
- FT_Pos best = 64 + 32 + 2;
- FT_Pos reference = width;
- FT_Pos scaled;
+ FT_UInt n;
+ FT_Pos best = 64 + 32 + 2;
+ FT_Pos reference = width;
+ FT_Pos scaled;
for ( n = 0; n < count; n++ )
@@ -1405,8 +1411,8 @@
af_cjk_compute_stem_width( AF_GlyphHints hints,
AF_Dimension dim,
FT_Pos width,
- AF_Edge_Flags base_flags,
- AF_Edge_Flags stem_flags )
+ FT_UInt base_flags,
+ FT_UInt stem_flags )
{
AF_CJKMetrics metrics = (AF_CJKMetrics)hints->metrics;
AF_CJKAxis axis = &metrics->axis[dim];
@@ -1530,10 +1536,9 @@
{
FT_Pos dist = stem_edge->opos - base_edge->opos;
- FT_Pos fitted_width = af_cjk_compute_stem_width(
- hints, dim, dist,
- (AF_Edge_Flags)base_edge->flags,
- (AF_Edge_Flags)stem_edge->flags );
+ FT_Pos fitted_width = af_cjk_compute_stem_width( hints, dim, dist,
+ base_edge->flags,
+ stem_edge->flags );
stem_edge->pos = base_edge->pos + fitted_width;
@@ -1611,8 +1616,8 @@
org_len = edge2->opos - edge->opos;
cur_len = af_cjk_compute_stem_width( hints, dim, org_len,
- (AF_Edge_Flags)edge->flags,
- (AF_Edge_Flags)edge2->flags );
+ edge->flags,
+ edge2->flags );
org_center = ( edge->opos + edge2->opos ) / 2 + anchor;
cur_pos1 = org_center - cur_len / 2;
@@ -1713,7 +1718,7 @@
AF_Edge edge_limit = edges + axis->num_edges;
FT_PtrDist n_edges;
AF_Edge edge;
- AF_Edge anchor = 0;
+ AF_Edge anchor = NULL;
FT_Pos delta = 0;
FT_Int skipped = 0;
FT_Bool has_last_stem = FALSE;
@@ -2176,7 +2181,8 @@
/* Apply the complete hinting algorithm to a CJK glyph. */
FT_LOCAL_DEF( FT_Error )
- af_cjk_hints_apply( AF_GlyphHints hints,
+ af_cjk_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_CJKMetrics metrics )
{
@@ -2184,6 +2190,7 @@
int dim;
FT_UNUSED( metrics );
+ FT_UNUSED( glyph_index );
error = af_glyph_hints_reload( hints, outline );
@@ -2191,7 +2198,13 @@
goto Exit;
/* analyze glyph outline */
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ if ( ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ AF_HINTS_DO_WARP( hints ) ) ||
+ AF_HINTS_DO_HORIZONTAL( hints ) )
+#else
if ( AF_HINTS_DO_HORIZONTAL( hints ) )
+#endif
{
error = af_cjk_hints_detect_features( hints, AF_DIMENSION_HORZ );
if ( error )
@@ -2217,8 +2230,9 @@
{
#ifdef AF_CONFIG_OPTION_USE_WARPER
- if ( dim == AF_DIMENSION_HORZ &&
- metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL )
+ if ( dim == AF_DIMENSION_HORZ &&
+ metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ AF_HINTS_DO_WARP( hints ) )
{
AF_WarperRec warper;
FT_Fixed scale;
@@ -2240,12 +2254,6 @@
}
}
-#if 0
- af_glyph_hints_dump_points( hints );
- af_glyph_hints_dump_segments( hints );
- af_glyph_hints_dump_edges( hints );
-#endif
-
af_glyph_hints_save( hints, outline );
Exit:
diff --git a/src/3rdparty/freetype/src/autofit/afcjk.h b/src/3rdparty/freetype/src/autofit/afcjk.h
index 4dd4f39177..e395e74a01 100644
--- a/src/3rdparty/freetype/src/autofit/afcjk.h
+++ b/src/3rdparty/freetype/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK writing system (specification). */
/* */
-/* Copyright 2006, 2007, 2011-2014 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -55,14 +55,10 @@ FT_BEGIN_HEADER
#define AF_CJK_MAX_WIDTHS 16
- enum
- {
- AF_CJK_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */
- AF_CJK_BLUE_TOP = 1 << 1, /* result of AF_CJK_IS_TOP_BLUE */
- AF_CJK_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
- /* optimization */
- AF_CJK_BLUE_FLAG_MAX
- };
+#define AF_CJK_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
+#define AF_CJK_BLUE_TOP ( 1U << 1 ) /* result of AF_CJK_IS_TOP_BLUE */
+#define AF_CJK_BLUE_ADJUSTMENT ( 1U << 2 ) /* used for scale adjustment */
+ /* optimization */
typedef struct AF_CJKBlueRec_
@@ -119,7 +115,8 @@ FT_BEGIN_HEADER
AF_CJKMetrics metrics );
FT_LOCAL( FT_Error )
- af_cjk_hints_apply( AF_GlyphHints hints,
+ af_cjk_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_CJKMetrics metrics );
diff --git a/src/3rdparty/freetype/src/autofit/afcover.h b/src/3rdparty/freetype/src/autofit/afcover.h
index d5ac96944a..520e8a4ae0 100644
--- a/src/3rdparty/freetype/src/autofit/afcover.h
+++ b/src/3rdparty/freetype/src/autofit/afcover.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter coverages (specification only). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/afdummy.c b/src/3rdparty/freetype/src/autofit/afdummy.c
index f8702a109e..18dd301d10 100644
--- a/src/3rdparty/freetype/src/autofit/afdummy.c
+++ b/src/3rdparty/freetype/src/autofit/afdummy.c
@@ -5,7 +5,7 @@
/* Auto-fitter dummy routines to be used if no hinting should be */
/* performed (body). */
/* */
-/* Copyright 2003-2005, 2011, 2013 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -38,11 +38,14 @@
static FT_Error
- af_dummy_hints_apply( AF_GlyphHints hints,
+ af_dummy_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline )
{
FT_Error error;
+ FT_UNUSED( glyph_index );
+
error = af_glyph_hints_reload( hints, outline );
if ( !error )
diff --git a/src/3rdparty/freetype/src/autofit/afdummy.h b/src/3rdparty/freetype/src/autofit/afdummy.h
index ad1b0d3abb..b4fdc78e39 100644
--- a/src/3rdparty/freetype/src/autofit/afdummy.h
+++ b/src/3rdparty/freetype/src/autofit/afdummy.h
@@ -5,7 +5,7 @@
/* Auto-fitter dummy routines to be used if no hinting should be */
/* performed (specification). */
/* */
-/* Copyright 2003-2005, 2011, 2013 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/aferrors.h b/src/3rdparty/freetype/src/autofit/aferrors.h
index 50e1a22dd5..7b416e470d 100644
--- a/src/3rdparty/freetype/src/autofit/aferrors.h
+++ b/src/3rdparty/freetype/src/autofit/aferrors.h
@@ -4,7 +4,7 @@
/* */
/* Autofitter error codes (specification only). */
/* */
-/* Copyright 2005, 2012 by */
+/* Copyright 2005-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/afglobal.c b/src/3rdparty/freetype/src/autofit/afglobal.c
index a54c20c023..b071cc76fb 100644
--- a/src/3rdparty/freetype/src/autofit/afglobal.c
+++ b/src/3rdparty/freetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter routines to compute global hinting values (body). */
/* */
-/* Copyright 2003-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -47,6 +47,7 @@
af_ ## s ## _script_class, \
AF_SCRIPT_ ## S, \
af_ ## s ## _uniranges, \
+ af_ ## s ## _nonbase_uniranges, \
sc1, sc2, sc3 )
#include "afscript.h"
@@ -135,16 +136,15 @@
FT_Error error;
FT_Face face = globals->face;
FT_CharMap old_charmap = face->charmap;
- FT_Byte* gstyles = globals->glyph_styles;
+ FT_UShort* gstyles = globals->glyph_styles;
FT_UInt ss;
FT_UInt i;
FT_UInt dflt = ~0U; /* a non-valid value */
/* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */
- FT_MEM_SET( globals->glyph_styles,
- AF_STYLE_UNASSIGNED,
- globals->glyph_count );
+ for ( i = 0; i < (FT_UInt)globals->glyph_count; i++ )
+ gstyles[i] = AF_STYLE_UNASSIGNED;
error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
if ( error )
@@ -190,10 +190,10 @@
gindex = FT_Get_Char_Index( face, charcode );
- if ( gindex != 0 &&
- gindex < (FT_ULong)globals->glyph_count &&
- gstyles[gindex] == AF_STYLE_UNASSIGNED )
- gstyles[gindex] = (FT_Byte)ss;
+ if ( gindex != 0 &&
+ gindex < (FT_ULong)globals->glyph_count &&
+ ( gstyles[gindex] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED )
+ gstyles[gindex] = (FT_UShort)ss;
for (;;)
{
@@ -202,9 +202,38 @@
if ( gindex == 0 || charcode > range->last )
break;
- if ( gindex < (FT_ULong)globals->glyph_count &&
- gstyles[gindex] == AF_STYLE_UNASSIGNED )
- gstyles[gindex] = (FT_Byte)ss;
+ if ( gindex < (FT_ULong)globals->glyph_count &&
+ ( gstyles[gindex] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED )
+ gstyles[gindex] = (FT_UShort)ss;
+ }
+ }
+
+ /* do the same for the script's non-base characters */
+ for ( range = script_class->script_uni_nonbase_ranges;
+ range->first != 0;
+ range++ )
+ {
+ FT_ULong charcode = range->first;
+ FT_UInt gindex;
+
+
+ gindex = FT_Get_Char_Index( face, charcode );
+
+ if ( gindex != 0 &&
+ gindex < (FT_ULong)globals->glyph_count &&
+ ( gstyles[gindex] & AF_STYLE_MASK ) == (FT_UShort)ss )
+ gstyles[gindex] |= AF_NONBASE;
+
+ for (;;)
+ {
+ charcode = FT_Get_Next_Char( face, charcode, &gindex );
+
+ if ( gindex == 0 || charcode > range->last )
+ break;
+
+ if ( gindex < (FT_ULong)globals->glyph_count &&
+ ( gstyles[gindex] & AF_STYLE_MASK ) == (FT_UShort)ss )
+ gstyles[gindex] |= AF_NONBASE;
}
}
}
@@ -250,9 +279,9 @@
for ( nn = 0; nn < globals->glyph_count; nn++ )
{
- if ( ( gstyles[nn] & ~AF_DIGIT ) == AF_STYLE_UNASSIGNED )
+ if ( ( gstyles[nn] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED )
{
- gstyles[nn] &= ~AF_STYLE_UNASSIGNED;
+ gstyles[nn] &= ~AF_STYLE_MASK;
gstyles[nn] |= globals->module->fallback_style;
}
}
@@ -276,7 +305,7 @@
for ( idx = 0; idx < globals->glyph_count; idx++ )
{
- if ( ( gstyles[idx] & ~AF_DIGIT ) == style_class->style )
+ if ( ( gstyles[idx] & AF_STYLE_MASK ) == style_class->style )
{
if ( !( count % 10 ) )
FT_TRACE4(( " " ));
@@ -314,13 +343,17 @@
memory = face->memory;
- if ( FT_ALLOC( globals, sizeof ( *globals ) +
- face->num_glyphs * sizeof ( FT_Byte ) ) )
+ /* we allocate an AF_FaceGlobals structure together */
+ /* with the glyph_styles array */
+ if ( FT_ALLOC( globals,
+ sizeof ( *globals ) +
+ (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
globals->face = face;
globals->glyph_count = face->num_glyphs;
- globals->glyph_styles = (FT_Byte*)( globals + 1 );
+ /* right after the globals structure come the glyph styles */
+ globals->glyph_styles = (FT_UShort*)( globals + 1 );
globals->module = module;
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
diff --git a/src/3rdparty/freetype/src/autofit/afglobal.h b/src/3rdparty/freetype/src/autofit/afglobal.h
index 38d8d69528..ffb2f86066 100644
--- a/src/3rdparty/freetype/src/autofit/afglobal.h
+++ b/src/3rdparty/freetype/src/autofit/afglobal.h
@@ -5,7 +5,7 @@
/* Auto-fitter routines to compute global hinting values */
/* (specification). */
/* */
-/* Copyright 2003-2005, 2007, 2009, 2011-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -72,10 +72,16 @@ FT_BEGIN_HEADER
#endif
/* default script for OpenType; ignored if HarfBuzz isn't used */
#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN
- /* a bit mask indicating an uncovered glyph */
-#define AF_STYLE_UNASSIGNED 0x7F
- /* if this flag is set, we have an ASCII digit */
-#define AF_DIGIT 0x80
+
+ /* a bit mask for AF_DIGIT and AF_NONBASE */
+#define AF_STYLE_MASK 0x3FFF
+ /* an uncovered glyph */
+#define AF_STYLE_UNASSIGNED AF_STYLE_MASK
+
+ /* if this flag is set, we have an ASCII digit */
+#define AF_DIGIT 0x8000U
+ /* if this flag is set, we have a non-base character */
+#define AF_NONBASE 0x4000U
/* `increase-x-height' property */
#define AF_PROP_INCREASE_X_HEIGHT_MIN 6
@@ -100,7 +106,7 @@ FT_BEGIN_HEADER
{
FT_Face face;
FT_Long glyph_count; /* same as face->num_glyphs */
- FT_Byte* glyph_styles;
+ FT_UShort* glyph_styles;
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
hb_font_t* hb_font;
diff --git a/src/3rdparty/freetype/src/autofit/afhints.c b/src/3rdparty/freetype/src/autofit/afhints.c
index f3cc50f202..37482ebd1f 100644
--- a/src/3rdparty/freetype/src/autofit/afhints.c
+++ b/src/3rdparty/freetype/src/autofit/afhints.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (body). */
/* */
-/* Copyright 2003-2007, 2009-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -43,7 +43,15 @@
AF_Segment segment = NULL;
- if ( axis->num_segments >= axis->max_segments )
+ if ( axis->num_segments < AF_SEGMENTS_EMBEDDED )
+ {
+ if ( axis->segments == NULL )
+ {
+ axis->segments = axis->embedded.segments;
+ axis->max_segments = AF_SEGMENTS_EMBEDDED;
+ }
+ }
+ else if ( axis->num_segments >= axis->max_segments )
{
FT_Int old_max = axis->max_segments;
FT_Int new_max = old_max;
@@ -60,8 +68,18 @@
if ( new_max < old_max || new_max > big_max )
new_max = big_max;
- if ( FT_RENEW_ARRAY( axis->segments, old_max, new_max ) )
- goto Exit;
+ if ( axis->segments == axis->embedded.segments )
+ {
+ if ( FT_NEW_ARRAY( axis->segments, new_max ) )
+ goto Exit;
+ ft_memcpy( axis->segments, axis->embedded.segments,
+ sizeof ( axis->embedded.segments ) );
+ }
+ else
+ {
+ if ( FT_RENEW_ARRAY( axis->segments, old_max, new_max ) )
+ goto Exit;
+ }
axis->max_segments = new_max;
}
@@ -89,7 +107,15 @@
AF_Edge edges;
- if ( axis->num_edges >= axis->max_edges )
+ if ( axis->num_edges < AF_EDGES_EMBEDDED )
+ {
+ if ( axis->edges == NULL )
+ {
+ axis->edges = axis->embedded.edges;
+ axis->max_edges = AF_EDGES_EMBEDDED;
+ }
+ }
+ else if ( axis->num_edges >= axis->max_edges )
{
FT_Int old_max = axis->max_edges;
FT_Int new_max = old_max;
@@ -106,8 +132,18 @@
if ( new_max < old_max || new_max > big_max )
new_max = big_max;
- if ( FT_RENEW_ARRAY( axis->edges, old_max, new_max ) )
- goto Exit;
+ if ( axis->edges == axis->embedded.edges )
+ {
+ if ( FT_NEW_ARRAY( axis->edges, new_max ) )
+ goto Exit;
+ ft_memcpy( axis->edges, axis->embedded.edges,
+ sizeof ( axis->embedded.edges ) );
+ }
+ else
+ {
+ if ( FT_RENEW_ARRAY( axis->edges, old_max, new_max ) )
+ goto Exit;
+ }
axis->max_edges = new_max;
}
@@ -195,9 +231,13 @@
AF_Point point;
- AF_DUMP(( "Table of points:\n"
- " [ index | xorg | yorg | xscale | yscale"
- " | xfit | yfit | flags ]\n" ));
+ AF_DUMP(( "Table of points:\n" ));
+
+ if ( hints->num_points )
+ AF_DUMP(( " [ index | xorg | yorg | xscale | yscale"
+ " | xfit | yfit | flags ]\n" ));
+ else
+ AF_DUMP(( " (none)\n" ));
for ( point = points; point < limit; point++ )
AF_DUMP(( " [ %5d | %5d | %5d | %6.2f | %6.2f"
@@ -218,7 +258,7 @@
static const char*
- af_edge_flags_to_string( AF_Edge_Flags flags )
+ af_edge_flags_to_string( FT_UInt flags )
{
static char temp[32];
int pos = 0;
@@ -293,7 +333,7 @@
AF_INDEX_NUM( seg->edge, edges ),
seg->height,
seg->height - ( seg->max_coord - seg->min_coord ),
- af_edge_flags_to_string( (AF_Edge_Flags)seg->flags ) ));
+ af_edge_flags_to_string( seg->flags ) ));
AF_DUMP(( "\n" ));
}
}
@@ -420,7 +460,7 @@
edge->blue_edge ? 'y' : 'n',
edge->opos / 64.0,
edge->pos / 64.0,
- af_edge_flags_to_string( (AF_Edge_Flags)edge->flags ) ));
+ af_edge_flags_to_string( edge->flags ) ));
AF_DUMP(( "\n" ));
}
}
@@ -469,15 +509,15 @@
else
{
dir = AF_DIR_DOWN;
- ll = dy;
+ ll = -dy;
ss = dx;
}
}
- /* return no direction if arm lengths differ too much */
+ /* return no direction if arm lengths do not differ enough */
/* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */
- ss *= 14;
- if ( FT_ABS( ll ) <= FT_ABS( ss ) )
+ /* the long arm is never negative */
+ if ( ll <= 14 * FT_ABS( ss ) )
dir = AF_DIR_NONE;
return dir;
@@ -488,7 +528,8 @@
af_glyph_hints_init( AF_GlyphHints hints,
FT_Memory memory )
{
- FT_ZERO( hints );
+ /* no need to initialize the embedded items */
+ FT_MEM_ZERO( hints, sizeof ( *hints ) - sizeof ( hints->embedded ) );
hints->memory = memory;
}
@@ -496,13 +537,15 @@
FT_LOCAL_DEF( void )
af_glyph_hints_done( AF_GlyphHints hints )
{
- FT_Memory memory = hints->memory;
+ FT_Memory memory;
int dim;
if ( !( hints && hints->memory ) )
return;
+ memory = hints->memory;
+
/*
* note that we don't need to free the segment and edge
* buffers since they are really within the hints->points array
@@ -514,20 +557,24 @@
axis->num_segments = 0;
axis->max_segments = 0;
- FT_FREE( axis->segments );
+ if ( axis->segments != axis->embedded.segments )
+ FT_FREE( axis->segments );
axis->num_edges = 0;
axis->max_edges = 0;
- FT_FREE( axis->edges );
+ if ( axis->edges != axis->embedded.edges )
+ FT_FREE( axis->edges );
}
- FT_FREE( hints->contours );
+ if ( hints->contours != hints->embedded.contours )
+ FT_FREE( hints->contours );
hints->max_contours = 0;
hints->num_contours = 0;
- FT_FREE( hints->points );
- hints->num_points = 0;
+ if ( hints->points != hints->embedded.points )
+ FT_FREE( hints->points );
hints->max_points = 0;
+ hints->num_points = 0;
hints->memory = NULL;
}
@@ -571,15 +618,27 @@
/* first of all, reallocate the contours array if necessary */
new_max = (FT_UInt)outline->n_contours;
- old_max = hints->max_contours;
- if ( new_max > old_max )
+ old_max = (FT_UInt)hints->max_contours;
+
+ if ( new_max <= AF_CONTOURS_EMBEDDED )
+ {
+ if ( hints->contours == NULL )
+ {
+ hints->contours = hints->embedded.contours;
+ hints->max_contours = AF_CONTOURS_EMBEDDED;
+ }
+ }
+ else if ( new_max > old_max )
{
- new_max = ( new_max + 3 ) & ~3; /* round up to a multiple of 4 */
+ if ( hints->contours == hints->embedded.contours )
+ hints->contours = NULL;
+
+ new_max = ( new_max + 3 ) & ~3U; /* round up to a multiple of 4 */
if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )
goto Exit;
- hints->max_contours = new_max;
+ hints->max_contours = (FT_Int)new_max;
}
/*
@@ -588,15 +647,27 @@
* hint metrics appropriately
*/
new_max = (FT_UInt)( outline->n_points + 2 );
- old_max = hints->max_points;
- if ( new_max > old_max )
+ old_max = (FT_UInt)hints->max_points;
+
+ if ( new_max <= AF_POINTS_EMBEDDED )
+ {
+ if ( hints->points == NULL )
+ {
+ hints->points = hints->embedded.points;
+ hints->max_points = AF_POINTS_EMBEDDED;
+ }
+ }
+ else if ( new_max > old_max )
{
- new_max = ( new_max + 2 + 7 ) & ~7; /* round up to a multiple of 8 */
+ if ( hints->points == hints->embedded.points )
+ hints->points = NULL;
+
+ new_max = ( new_max + 2 + 7 ) & ~7U; /* round up to a multiple of 8 */
if ( FT_RENEW_ARRAY( hints->points, old_max, new_max ) )
goto Exit;
- hints->max_points = new_max;
+ hints->max_points = (FT_Int)new_max;
}
hints->num_points = outline->n_points;
@@ -721,8 +792,6 @@
FT_Pos out_x, out_y;
- FT_Bool is_first;
-
/* since the first point of a contour could be part of a */
/* series of near points, go backwards to find the first */
@@ -773,17 +842,13 @@
out_x = 0;
out_y = 0;
- is_first = 1;
-
- for ( point = first;
- point != first || is_first;
- point = point->next )
+ next = first;
+ do
{
AF_Direction out_dir;
- is_first = 0;
-
+ point = next;
next = point->next;
out_x += next->fx - point->fx;
@@ -815,7 +880,8 @@
out_x = 0;
out_y = 0;
- }
+
+ } while ( next != first );
}
/*
@@ -1045,7 +1111,7 @@
AF_AxisHints axis = &hints->axis[dim];
AF_Edge edges = axis->edges;
AF_Edge edge_limit = edges + axis->num_edges;
- AF_Flags touch_flag;
+ FT_UInt touch_flag;
if ( dim == AF_DIMENSION_HORZ )
@@ -1226,33 +1292,27 @@
AF_Point ref2 )
{
AF_Point p;
- FT_Pos u;
- FT_Pos v1 = ref1->v;
- FT_Pos v2 = ref2->v;
- FT_Pos d1 = ref1->u - v1;
- FT_Pos d2 = ref2->u - v2;
+ FT_Pos u, v1, v2, u1, u2, d1, d2;
if ( p1 > p2 )
return;
- if ( v1 == v2 )
+ if ( ref1->v > ref2->v )
{
- for ( p = p1; p <= p2; p++ )
- {
- u = p->v;
-
- if ( u <= v1 )
- u += d1;
- else
- u += d2;
-
- p->u = u;
- }
- return;
+ p = ref1;
+ ref1 = ref2;
+ ref2 = p;
}
- if ( v1 < v2 )
+ v1 = ref1->v;
+ v2 = ref2->v;
+ u1 = ref1->u;
+ u2 = ref2->u;
+ d1 = u1 - v1;
+ d2 = u2 - v2;
+
+ if ( u1 == u2 || v1 == v2 )
{
for ( p = p1; p <= p2; p++ )
{
@@ -1263,23 +1323,26 @@
else if ( u >= v2 )
u += d2;
else
- u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 );
+ u = u1;
p->u = u;
}
}
else
{
+ FT_Fixed scale = FT_DivFix( u2 - u1, v2 - v1 );
+
+
for ( p = p1; p <= p2; p++ )
{
u = p->v;
- if ( u <= v2 )
- u += d2;
- else if ( u >= v1 )
+ if ( u <= v1 )
u += d1;
+ else if ( u >= v2 )
+ u += d2;
else
- u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 );
+ u = u1 + FT_MulFix( u - v1, scale );
p->u = u;
}
@@ -1298,7 +1361,7 @@
AF_Point point_limit = points + hints->num_points;
AF_Point* contour = hints->contours;
AF_Point* contour_limit = contour + hints->num_contours;
- AF_Flags touch_flag;
+ FT_UInt touch_flag;
AF_Point point;
AF_Point end_point;
AF_Point first_point;
diff --git a/src/3rdparty/freetype/src/autofit/afhints.h b/src/3rdparty/freetype/src/autofit/afhints.h
index 92101de7ca..a64c7a4b11 100644
--- a/src/3rdparty/freetype/src/autofit/afhints.h
+++ b/src/3rdparty/freetype/src/autofit/afhints.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (specification). */
/* */
-/* Copyright 2003-2008, 2010-2012, 2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -207,35 +207,27 @@ FT_BEGIN_HEADER
/* point hint flags */
- typedef enum AF_Flags_
- {
- AF_FLAG_NONE = 0,
-
- /* point type flags */
- AF_FLAG_CONIC = 1 << 0,
- AF_FLAG_CUBIC = 1 << 1,
- AF_FLAG_CONTROL = AF_FLAG_CONIC | AF_FLAG_CUBIC,
+#define AF_FLAG_NONE 0
- /* point touch flags */
- AF_FLAG_TOUCH_X = 1 << 2,
- AF_FLAG_TOUCH_Y = 1 << 3,
+ /* point type flags */
+#define AF_FLAG_CONIC ( 1U << 0 )
+#define AF_FLAG_CUBIC ( 1U << 1 )
+#define AF_FLAG_CONTROL ( AF_FLAG_CONIC | AF_FLAG_CUBIC )
- /* candidates for weak interpolation have this flag set */
- AF_FLAG_WEAK_INTERPOLATION = 1 << 4
+ /* point touch flags */
+#define AF_FLAG_TOUCH_X ( 1U << 2 )
+#define AF_FLAG_TOUCH_Y ( 1U << 3 )
- } AF_Flags;
+ /* candidates for weak interpolation have this flag set */
+#define AF_FLAG_WEAK_INTERPOLATION ( 1U << 4 )
/* edge hint flags */
- typedef enum AF_Edge_Flags_
- {
- AF_EDGE_NORMAL = 0,
- AF_EDGE_ROUND = 1 << 0,
- AF_EDGE_SERIF = 1 << 1,
- AF_EDGE_DONE = 1 << 2,
- AF_EDGE_NEUTRAL = 1 << 3 /* set if edge aligns to a neutral blue zone */
-
- } AF_Edge_Flags;
+#define AF_EDGE_NORMAL 0
+#define AF_EDGE_ROUND ( 1U << 0 )
+#define AF_EDGE_SERIF ( 1U << 1 )
+#define AF_EDGE_DONE ( 1U << 2 )
+#define AF_EDGE_NEUTRAL ( 1U << 3 ) /* edge aligns to a neutral blue zone */
typedef struct AF_PointRec_* AF_Point;
@@ -305,6 +297,8 @@ FT_BEGIN_HEADER
} AF_EdgeRec;
+#define AF_SEGMENTS_EMBEDDED 18 /* number of embedded segments */
+#define AF_EDGES_EMBEDDED 12 /* number of embedded edges */
typedef struct AF_AxisHintsRec_
{
@@ -321,9 +315,20 @@ FT_BEGIN_HEADER
AF_Direction major_dir; /* either vertical or horizontal */
+ /* two arrays to avoid allocation penalty */
+ struct
+ {
+ AF_SegmentRec segments[AF_SEGMENTS_EMBEDDED];
+ AF_EdgeRec edges[AF_EDGES_EMBEDDED];
+ } embedded;
+
+
} AF_AxisHintsRec, *AF_AxisHints;
+#define AF_POINTS_EMBEDDED 96 /* number of embedded points */
+#define AF_CONTOURS_EMBEDDED 8 /* number of embedded contours */
+
typedef struct AF_GlyphHintsRec_
{
FT_Memory memory;
@@ -352,6 +357,14 @@ FT_BEGIN_HEADER
FT_Pos xmin_delta; /* used for warping */
FT_Pos xmax_delta;
+ /* Two arrays to avoid allocation penalty. */
+ /* The `embedded' structure must be the last element! */
+ struct
+ {
+ AF_Point contours[AF_CONTOURS_EMBEDDED];
+ AF_PointRec points[AF_POINTS_EMBEDDED];
+ } embedded;
+
} AF_GlyphHintsRec;
@@ -369,9 +382,6 @@ FT_BEGIN_HEADER
( !_af_debug_disable_vert_hints && \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) )
-#define AF_HINTS_DO_ADVANCE( h ) \
- !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
-
#define AF_HINTS_DO_BLUES( h ) ( !_af_debug_disable_blue_hints )
#else /* !FT_DEBUG_AUTOFIT */
@@ -382,12 +392,17 @@ FT_BEGIN_HEADER
#define AF_HINTS_DO_VERTICAL( h ) \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL )
+#define AF_HINTS_DO_BLUES( h ) 1
+
+#endif /* !FT_DEBUG_AUTOFIT */
+
+
#define AF_HINTS_DO_ADVANCE( h ) \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
-#define AF_HINTS_DO_BLUES( h ) 1
+#define AF_HINTS_DO_WARP( h ) \
+ !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_WARPER )
-#endif /* !FT_DEBUG_AUTOFIT */
FT_LOCAL( AF_Direction )
diff --git a/src/3rdparty/freetype/src/autofit/afindic.c b/src/3rdparty/freetype/src/autofit/afindic.c
index 197881b614..05b6bdd887 100644
--- a/src/3rdparty/freetype/src/autofit/afindic.c
+++ b/src/3rdparty/freetype/src/autofit/afindic.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for Indic writing system (body). */
/* */
-/* Copyright 2007, 2011-2013 by */
+/* Copyright 2007-2015 by */
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -79,12 +79,13 @@
static FT_Error
- af_indic_hints_apply( AF_GlyphHints hints,
+ af_indic_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_CJKMetrics metrics )
{
/* use CJK routines */
- return af_cjk_hints_apply( hints, outline, metrics );
+ return af_cjk_hints_apply( glyph_index, hints, outline, metrics );
}
diff --git a/src/3rdparty/freetype/src/autofit/afindic.h b/src/3rdparty/freetype/src/autofit/afindic.h
index 9e13cf7e3f..4c36908ada 100644
--- a/src/3rdparty/freetype/src/autofit/afindic.h
+++ b/src/3rdparty/freetype/src/autofit/afindic.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for Indic writing system */
/* (specification). */
/* */
-/* Copyright 2007, 2012, 2013 by */
+/* Copyright 2007-2015 by */
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/aflatin.c b/src/3rdparty/freetype/src/autofit/aflatin.c
index 36a36896fb..363f72114b 100644
--- a/src/3rdparty/freetype/src/autofit/aflatin.c
+++ b/src/3rdparty/freetype/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin writing system (body). */
/* */
-/* Copyright 2003-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,6 +41,10 @@
#define FT_COMPONENT trace_aflatin
+ /* needed for computation of round vs. flat segments */
+#define FLAT_THRESHOLD( x ) ( x / 14 )
+
+
/*************************************************************************/
/*************************************************************************/
/***** *****/
@@ -261,8 +265,8 @@
FT_Pos flats [AF_BLUE_STRING_MAX_LEN];
FT_Pos rounds[AF_BLUE_STRING_MAX_LEN];
- FT_Int num_flats;
- FT_Int num_rounds;
+ FT_UInt num_flats;
+ FT_UInt num_rounds;
AF_LatinBlue blue;
FT_Error error;
@@ -274,6 +278,8 @@
AF_Blue_Stringset bss = sc->blue_stringset;
const AF_Blue_StringRec* bs = &af_blue_stringsets[bss];
+ FT_Pos flat_threshold = FLAT_THRESHOLD( metrics->units_per_em );
+
/* we walk over the blue character strings as specified in the */
/* style's entry in the `af_blue_stringset' array */
@@ -362,9 +368,10 @@
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
outline = face->glyph->outline;
- if ( error || outline.n_points <= 0 )
+ /* reject glyphs that don't produce any rendering */
+ if ( error || outline.n_points <= 2 )
{
- FT_TRACE5(( " U+%04lX contains no outlines\n", ch ));
+ FT_TRACE5(( " U+%04lX contains no (usable) outlines\n", ch ));
continue;
}
@@ -692,16 +699,16 @@
/* now set the `round' flag depending on the segment's kind: */
/* */
/* - if the horizontal distance between the first and last */
- /* `on' point is larger than upem/8 (value 8 is heuristic) */
+ /* `on' point is larger than a heuristic threshold */
/* we have a flat segment */
/* - if either the first or the last point of the segment is */
/* an `off' point, the segment is round, otherwise it is */
/* flat */
if ( best_on_point_first >= 0 &&
best_on_point_last >= 0 &&
- (FT_UInt)( FT_ABS( points[best_on_point_last].x -
- points[best_on_point_first].x ) ) >
- metrics->units_per_em / 8 )
+ ( FT_ABS( points[best_on_point_last].x -
+ points[best_on_point_first].x ) ) >
+ flat_threshold )
round = 0;
else
round = FT_BOOL(
@@ -1031,8 +1038,11 @@
if ( dim == AF_DIMENSION_VERT )
{
- FT_TRACE5(( "blue zones (style `%s')\n",
- af_style_names[metrics->root.style_class->style] ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( axis->blue_count )
+ FT_TRACE5(( "blue zones (style `%s')\n",
+ af_style_names[metrics->root.style_class->style] ));
+#endif
/* scale the blue zones */
for ( nn = 0; nn < axis->blue_count; nn++ )
@@ -1154,14 +1164,17 @@
af_latin_hints_compute_segments( AF_GlyphHints hints,
AF_Dimension dim )
{
- AF_AxisHints axis = &hints->axis[dim];
- FT_Memory memory = hints->memory;
- FT_Error error = FT_Err_Ok;
- AF_Segment segment = NULL;
- AF_SegmentRec seg0;
- AF_Point* contour = hints->contours;
- AF_Point* contour_limit = contour + hints->num_contours;
- AF_Direction major_dir, segment_dir;
+ AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics;
+ AF_AxisHints axis = &hints->axis[dim];
+ FT_Memory memory = hints->memory;
+ FT_Error error = FT_Err_Ok;
+ AF_Segment segment = NULL;
+ AF_SegmentRec seg0;
+ AF_Point* contour = hints->contours;
+ AF_Point* contour_limit = contour + hints->num_contours;
+ AF_Direction major_dir, segment_dir;
+
+ FT_Pos flat_threshold = FLAT_THRESHOLD( metrics->units_per_em );
FT_ZERO( &seg0 );
@@ -1202,11 +1215,13 @@
/* do each contour separately */
for ( ; contour < contour_limit; contour++ )
{
- AF_Point point = contour[0];
- AF_Point last = point->prev;
- int on_edge = 0;
- FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */
- FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */
+ AF_Point point = contour[0];
+ AF_Point last = point->prev;
+ int on_edge = 0;
+ FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */
+ FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */
+ FT_Pos min_on_pos = 32000;
+ FT_Pos max_on_pos = -32000;
FT_Bool passed;
@@ -1248,6 +1263,16 @@
if ( u > max_pos )
max_pos = u;
+ /* get minimum and maximum coordinate of on points */
+ if ( !( point->flags & AF_FLAG_CONTROL ) )
+ {
+ v = point->v;
+ if ( v < min_on_pos )
+ min_on_pos = v;
+ if ( v > max_on_pos )
+ max_on_pos = v;
+ }
+
if ( point->out_dir != segment_dir || point == last )
{
/* we are just leaving an edge; record a new segment! */
@@ -1255,9 +1280,10 @@
segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
/* a segment is round if either its first or last point */
- /* is a control point */
- if ( ( segment->first->flags | point->flags ) &
- AF_FLAG_CONTROL )
+ /* is a control point, and the length of the on points */
+ /* inbetween doesn't exceed a heuristic limit */
+ if ( ( segment->first->flags | point->flags ) & AF_FLAG_CONTROL &&
+ ( max_on_pos - min_on_pos ) < flat_threshold )
segment->flags |= AF_EDGE_ROUND;
/* compute segment size */
@@ -1300,10 +1326,19 @@
/* clear all segment fields */
segment[0] = seg0;
- segment->dir = (FT_Char)segment_dir;
+ segment->dir = (FT_Char)segment_dir;
+ segment->first = point;
+ segment->last = point;
+
min_pos = max_pos = point->u;
- segment->first = point;
- segment->last = point;
+
+ if ( point->flags & AF_FLAG_CONTROL )
+ {
+ min_on_pos = 32000;
+ max_on_pos = -32000;
+ }
+ else
+ min_on_pos = max_on_pos = point->v;
on_edge = 1;
}
@@ -1791,7 +1826,7 @@
/* Example: the `c' in cour.pfa at size 13 */
if ( edge->serif && edge->link )
- edge->serif = 0;
+ edge->serif = NULL;
}
}
@@ -1825,7 +1860,7 @@
/* Compute all edges which lie within blue zones. */
- FT_LOCAL_DEF( void )
+ static void
af_latin_hints_compute_blue_edges( AF_GlyphHints hints,
AF_LatinMetrics metrics )
{
@@ -1995,11 +2030,20 @@
/*
* In `light' hinting mode we disable horizontal hinting completely.
* We also do it if the face is italic.
+ *
+ * However, if warping is enabled (which only works in `light' hinting
+ * mode), advance widths get adjusted, too.
*/
if ( mode == FT_RENDER_MODE_LIGHT ||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ /* get (global) warper flag */
+ if ( !metrics->root.globals->module->warping )
+ scaler_flags |= AF_SCALER_FLAG_NO_WARPER;
+#endif
+
hints->scaler_flags = scaler_flags;
hints->other_flags = other_flags;
@@ -2020,13 +2064,13 @@
static FT_Pos
af_latin_snap_width( AF_Width widths,
- FT_Int count,
+ FT_UInt count,
FT_Pos width )
{
- int n;
- FT_Pos best = 64 + 32 + 2;
- FT_Pos reference = width;
- FT_Pos scaled;
+ FT_UInt n;
+ FT_Pos best = 64 + 32 + 2;
+ FT_Pos reference = width;
+ FT_Pos scaled;
for ( n = 0; n < count; n++ )
@@ -2071,8 +2115,8 @@
af_latin_compute_stem_width( AF_GlyphHints hints,
AF_Dimension dim,
FT_Pos width,
- AF_Edge_Flags base_flags,
- AF_Edge_Flags stem_flags )
+ FT_UInt base_flags,
+ FT_UInt stem_flags )
{
AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics;
AF_LatinAxis axis = &metrics->axis[dim];
@@ -2239,10 +2283,9 @@
{
FT_Pos dist = stem_edge->opos - base_edge->opos;
- FT_Pos fitted_width = af_latin_compute_stem_width(
- hints, dim, dist,
- (AF_Edge_Flags)base_edge->flags,
- (AF_Edge_Flags)stem_edge->flags );
+ FT_Pos fitted_width = af_latin_compute_stem_width( hints, dim, dist,
+ base_edge->flags,
+ stem_edge->flags );
stem_edge->pos = base_edge->pos + fitted_width;
@@ -2281,7 +2324,7 @@
/* The main grid-fitting routine. */
- FT_LOCAL_DEF( void )
+ static void
af_latin_hint_edges( AF_GlyphHints hints,
AF_Dimension dim )
{
@@ -2334,7 +2377,7 @@
FT_Byte neutral2 = edge2->flags & AF_EDGE_NEUTRAL;
- if ( ( neutral && neutral2 ) || neutral2 )
+ if ( neutral2 )
{
edge2->blue_edge = NULL;
edge2->flags &= ~AF_EDGE_NEUTRAL;
@@ -2437,10 +2480,9 @@
org_len = edge2->opos - edge->opos;
- cur_len = af_latin_compute_stem_width(
- hints, dim, org_len,
- (AF_Edge_Flags)edge->flags,
- (AF_Edge_Flags)edge2->flags );
+ cur_len = af_latin_compute_stem_width( hints, dim, org_len,
+ edge->flags,
+ edge2->flags );
/* some voodoo to specially round edges for small stem widths; */
/* the idea is to align the center of a stem, then shifting */
@@ -2507,10 +2549,9 @@
org_len = edge2->opos - edge->opos;
org_center = org_pos + ( org_len >> 1 );
- cur_len = af_latin_compute_stem_width(
- hints, dim, org_len,
- (AF_Edge_Flags)edge->flags,
- (AF_Edge_Flags)edge2->flags );
+ cur_len = af_latin_compute_stem_width( hints, dim, org_len,
+ edge->flags,
+ edge2->flags );
if ( edge2->flags & AF_EDGE_DONE )
{
@@ -2568,10 +2609,9 @@
org_len = edge2->opos - edge->opos;
org_center = org_pos + ( org_len >> 1 );
- cur_len = af_latin_compute_stem_width(
- hints, dim, org_len,
- (AF_Edge_Flags)edge->flags,
- (AF_Edge_Flags)edge2->flags );
+ cur_len = af_latin_compute_stem_width( hints, dim, org_len,
+ edge->flags,
+ edge2->flags );
cur_pos1 = FT_PIX_ROUND( org_pos );
delta1 = cur_pos1 + ( cur_len >> 1 ) - org_center;
@@ -2799,7 +2839,8 @@
/* Apply the complete hinting algorithm to a latin glyph. */
static FT_Error
- af_latin_hints_apply( AF_GlyphHints hints,
+ af_latin_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_LatinMetrics metrics )
{
@@ -2815,8 +2856,9 @@
/* analyze glyph outline */
#ifdef AF_CONFIG_OPTION_USE_WARPER
- if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||
- AF_HINTS_DO_HORIZONTAL( hints ) )
+ if ( ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ AF_HINTS_DO_WARP( hints ) ) ||
+ AF_HINTS_DO_HORIZONTAL( hints ) )
#else
if ( AF_HINTS_DO_HORIZONTAL( hints ) )
#endif
@@ -2840,7 +2882,9 @@
if ( error )
goto Exit;
- af_latin_hints_compute_blue_edges( hints, metrics );
+ /* apply blue zones to base characters only */
+ if ( !( metrics->root.globals->glyph_styles[glyph_index] & AF_NONBASE ) )
+ af_latin_hints_compute_blue_edges( hints, metrics );
}
/* grid-fit the outline */
@@ -2848,7 +2892,8 @@
{
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( dim == AF_DIMENSION_HORZ &&
- metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT )
+ metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ AF_HINTS_DO_WARP( hints ) )
{
AF_WarperRec warper;
FT_Fixed scale;
@@ -2861,7 +2906,7 @@
scale, delta );
continue;
}
-#endif
+#endif /* AF_CONFIG_OPTION_USE_WARPER */
if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||
( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) ) )
diff --git a/src/3rdparty/freetype/src/autofit/aflatin.h b/src/3rdparty/freetype/src/autofit/aflatin.h
index 2c0bfca18b..6855492ca3 100644
--- a/src/3rdparty/freetype/src/autofit/aflatin.h
+++ b/src/3rdparty/freetype/src/autofit/aflatin.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for latin writing system */
/* (specification). */
/* */
-/* Copyright 2003-2007, 2009, 2011-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -63,15 +63,11 @@ FT_BEGIN_HEADER
#define AF_LATIN_MAX_WIDTHS 16
- enum
- {
- AF_LATIN_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */
- AF_LATIN_BLUE_TOP = 1 << 1, /* set if we have a top blue zone */
- AF_LATIN_BLUE_NEUTRAL = 1 << 2, /* set if we have neutral blue zone */
- AF_LATIN_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment */
- /* optimization */
- AF_LATIN_BLUE_FLAG_MAX
- };
+#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
+#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */
+#define AF_LATIN_BLUE_NEUTRAL ( 1U << 2 ) /* we have neutral blue zone */
+#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 3 ) /* used for scale adjustment */
+ /* optimization */
typedef struct AF_LatinBlueRec_
@@ -138,15 +134,11 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
- enum
- {
- AF_LATIN_HINTS_HORZ_SNAP = 1 << 0, /* enable stem width snapping */
- AF_LATIN_HINTS_VERT_SNAP = 1 << 1, /* enable stem height snapping */
- AF_LATIN_HINTS_STEM_ADJUST = 1 << 2, /* enable stem width/height */
- /* adjustment */
- AF_LATIN_HINTS_MONO = 1 << 3 /* indicate monochrome */
- /* rendering */
- };
+#define AF_LATIN_HINTS_HORZ_SNAP ( 1U << 0 ) /* stem width snapping */
+#define AF_LATIN_HINTS_VERT_SNAP ( 1U << 1 ) /* stem height snapping */
+#define AF_LATIN_HINTS_STEM_ADJUST ( 1U << 2 ) /* stem width/height */
+ /* adjustment */
+#define AF_LATIN_HINTS_MONO ( 1U << 3 ) /* monochrome rendering */
#define AF_LATIN_HINTS_DO_HORZ_SNAP( h ) \
diff --git a/src/3rdparty/freetype/src/autofit/aflatin2.c b/src/3rdparty/freetype/src/autofit/aflatin2.c
index 07590b380c..0380ffc04c 100644
--- a/src/3rdparty/freetype/src/autofit/aflatin2.c
+++ b/src/3rdparty/freetype/src/autofit/aflatin2.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin writing system (body). */
/* */
-/* Copyright 2003-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -835,8 +835,8 @@
{
AF_Point pt = first;
AF_Point last = point;
- AF_Flags f0 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
- AF_Flags f1;
+ FT_UInt f0 = pt->flags & AF_FLAG_CONTROL;
+ FT_UInt f1;
segment->flags &= ~AF_EDGE_ROUND;
@@ -844,7 +844,7 @@
for ( ; pt != last; f0 = f1 )
{
pt = pt->next;
- f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
+ f1 = pt->flags & AF_FLAG_CONTROL;
if ( !f0 && !f1 )
break;
@@ -1048,7 +1048,7 @@
{
if ( seg2->link != seg1 )
{
- seg1->link = 0;
+ seg1->link = NULL;
seg1->serif = seg2->link;
}
}
@@ -1128,7 +1128,7 @@
for ( seg = segments; seg < segment_limit; seg++ )
{
- AF_Edge found = 0;
+ AF_Edge found = NULL;
FT_Int ee;
@@ -1355,7 +1355,7 @@
/* Example: the `c' in cour.pfa at size 13 */
if ( edge->serif && edge->link )
- edge->serif = 0;
+ edge->serif = NULL;
}
}
@@ -1382,7 +1382,7 @@
}
- FT_LOCAL_DEF( void )
+ static void
af_latin2_hints_compute_blue_edges( AF_GlyphHints hints,
AF_LatinMetrics metrics )
{
@@ -1513,9 +1513,7 @@
#if 0 /* #ifdef AF_CONFIG_OPTION_USE_WARPER */
if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
- {
metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
- }
#endif
scaler_flags = hints->scaler_flags;
@@ -1552,6 +1550,12 @@
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ /* get (global) warper flag */
+ if ( !metrics->root.globals->module->warping )
+ scaler_flags |= AF_SCALER_FLAG_NO_WARPER;
+#endif
+
hints->scaler_flags = scaler_flags;
hints->other_flags = other_flags;
@@ -1572,13 +1576,13 @@
static FT_Pos
af_latin2_snap_width( AF_Width widths,
- FT_Int count,
+ FT_UInt count,
FT_Pos width )
{
- int n;
- FT_Pos best = 64 + 32 + 2;
- FT_Pos reference = width;
- FT_Pos scaled;
+ FT_UInt n;
+ FT_Pos best = 64 + 32 + 2;
+ FT_Pos reference = width;
+ FT_Pos scaled;
for ( n = 0; n < count; n++ )
@@ -1621,8 +1625,8 @@
af_latin2_compute_stem_width( AF_GlyphHints hints,
AF_Dimension dim,
FT_Pos width,
- AF_Edge_Flags base_flags,
- AF_Edge_Flags stem_flags )
+ FT_UInt base_flags,
+ FT_UInt stem_flags )
{
AF_LatinMetrics metrics = (AF_LatinMetrics) hints->metrics;
AF_LatinAxis axis = & metrics->axis[dim];
@@ -1793,10 +1797,9 @@
{
FT_Pos dist = stem_edge->opos - base_edge->opos;
- FT_Pos fitted_width = af_latin2_compute_stem_width(
- hints, dim, dist,
- (AF_Edge_Flags)base_edge->flags,
- (AF_Edge_Flags)stem_edge->flags );
+ FT_Pos fitted_width = af_latin2_compute_stem_width( hints, dim, dist,
+ base_edge->flags,
+ stem_edge->flags );
stem_edge->pos = base_edge->pos + fitted_width;
@@ -1830,7 +1833,7 @@
/*************************************************************************/
- FT_LOCAL_DEF( void )
+ static void
af_latin2_hint_edges( AF_GlyphHints hints,
AF_Dimension dim )
{
@@ -1838,7 +1841,7 @@
AF_Edge edges = axis->edges;
AF_Edge edge_limit = edges + axis->num_edges;
AF_Edge edge;
- AF_Edge anchor = 0;
+ AF_Edge anchor = NULL;
FT_Int has_serifs = 0;
FT_Pos anchor_drift = 0;
@@ -1942,10 +1945,9 @@
org_len = edge2->opos - edge->opos;
- cur_len = af_latin2_compute_stem_width(
- hints, dim, org_len,
- (AF_Edge_Flags)edge->flags,
- (AF_Edge_Flags)edge2->flags );
+ cur_len = af_latin2_compute_stem_width( hints, dim, org_len,
+ edge->flags,
+ edge2->flags );
if ( cur_len <= 64 )
u_off = d_off = 32;
else
@@ -2007,10 +2009,9 @@
org_len = edge2->opos - edge->opos;
org_center = org_pos + ( org_len >> 1 );
- cur_len = af_latin2_compute_stem_width(
- hints, dim, org_len,
- (AF_Edge_Flags)edge->flags,
- (AF_Edge_Flags)edge2->flags );
+ cur_len = af_latin2_compute_stem_width( hints, dim, org_len,
+ edge->flags,
+ edge2->flags );
org_left = org_pos + ( ( org_len - cur_len ) >> 1 );
org_right = org_pos + ( ( org_len + cur_len ) >> 1 );
@@ -2299,13 +2300,16 @@
static FT_Error
- af_latin2_hints_apply( AF_GlyphHints hints,
+ af_latin2_hints_apply( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_LatinMetrics metrics )
{
FT_Error error;
int dim;
+ FT_UNUSED( glyph_index );
+
error = af_glyph_hints_reload( hints, outline );
if ( error )
@@ -2313,8 +2317,9 @@
/* analyze glyph outline */
#ifdef AF_CONFIG_OPTION_USE_WARPER
- if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||
- AF_HINTS_DO_HORIZONTAL( hints ) )
+ if ( ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ AF_HINTS_DO_WARP( hints ) ) ||
+ AF_HINTS_DO_HORIZONTAL( hints ) )
#else
if ( AF_HINTS_DO_HORIZONTAL( hints ) )
#endif
@@ -2337,8 +2342,9 @@
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
{
#ifdef AF_CONFIG_OPTION_USE_WARPER
- if ( ( dim == AF_DIMENSION_HORZ &&
- metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ) )
+ if ( dim == AF_DIMENSION_HORZ &&
+ metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
+ AF_HINTS_DO_WARP( hints ) )
{
AF_WarperRec warper;
FT_Fixed scale;
@@ -2349,7 +2355,7 @@
af_glyph_hints_scale_dim( hints, dim, scale, delta );
continue;
}
-#endif
+#endif /* AF_CONFIG_OPTION_USE_WARPER */
if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||
( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) ) )
diff --git a/src/3rdparty/freetype/src/autofit/aflatin2.h b/src/3rdparty/freetype/src/autofit/aflatin2.h
index b5d252a91b..9326753130 100644
--- a/src/3rdparty/freetype/src/autofit/aflatin2.h
+++ b/src/3rdparty/freetype/src/autofit/aflatin2.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for latin writing system */
/* (specification). */
/* */
-/* Copyright 2003-2007, 2012, 2013 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/afloader.c b/src/3rdparty/freetype/src/autofit/afloader.c
index fb15c87f0e..722ffd31ec 100644
--- a/src/3rdparty/freetype/src/autofit/afloader.c
+++ b/src/3rdparty/freetype/src/autofit/afloader.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (body). */
/* */
-/* Copyright 2003-2009, 2011-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,38 +26,29 @@
/* Initialize glyph loader. */
- FT_LOCAL_DEF( FT_Error )
- af_loader_init( AF_Module module )
+ FT_LOCAL_DEF( void )
+ af_loader_init( AF_Loader loader,
+ AF_GlyphHints hints )
{
- AF_Loader loader = module->loader;
- FT_Memory memory = module->root.library->memory;
-
-
FT_ZERO( loader );
- af_glyph_hints_init( &loader->hints, memory );
-#ifdef FT_DEBUG_AUTOFIT
- _af_debug_hints = &loader->hints;
-#endif
- return FT_GlyphLoader_New( memory, &loader->gloader );
+ loader->hints = hints;
}
/* Reset glyph loader and compute globals if necessary. */
FT_LOCAL_DEF( FT_Error )
- af_loader_reset( AF_Module module,
+ af_loader_reset( AF_Loader loader,
+ AF_Module module,
FT_Face face )
{
- FT_Error error = FT_Err_Ok;
- AF_Loader loader = module->loader;
+ FT_Error error = FT_Err_Ok;
loader->face = face;
loader->globals = (AF_FaceGlobals)face->autohint.data;
- FT_GlyphLoader_Rewind( loader->gloader );
-
if ( loader->globals == NULL )
{
error = af_face_globals_new( face, &loader->globals, module );
@@ -77,42 +68,33 @@
/* Finalize glyph loader. */
FT_LOCAL_DEF( void )
- af_loader_done( AF_Module module )
+ af_loader_done( AF_Loader loader )
{
- AF_Loader loader = module->loader;
-
-
- af_glyph_hints_done( &loader->hints );
-
loader->face = NULL;
loader->globals = NULL;
-
-#ifdef FT_DEBUG_AUTOFIT
- _af_debug_hints = NULL;
-#endif
- FT_GlyphLoader_Done( loader->gloader );
- loader->gloader = NULL;
+ loader->hints = NULL;
}
- /* Load a single glyph component. This routine calls itself */
- /* recursively, if necessary, and does the main work of */
- /* `af_loader_load_glyph.' */
+ /* Do the main work of `af_loader_load_glyph'. Note that we never */
+ /* have to deal with composite glyphs as those get loaded into */
+ /* FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function. */
+ /* In the rare cases where FT_LOAD_NO_RECURSE is set, it implies */
+ /* FT_LOAD_NO_SCALE and as such the auto-hinter is never called. */
static FT_Error
af_loader_load_g( AF_Loader loader,
AF_Scaler scaler,
FT_UInt glyph_index,
- FT_Int32 load_flags,
- FT_UInt depth )
+ FT_Int32 load_flags )
{
FT_Error error;
FT_Face face = loader->face;
- FT_GlyphLoader gloader = loader->gloader;
AF_StyleMetrics metrics = loader->metrics;
- AF_GlyphHints hints = &loader->hints;
+ AF_GlyphHints hints = loader->hints;
FT_GlyphSlot slot = face->glyph;
FT_Slot_Internal internal = slot->internal;
+ FT_GlyphLoader gloader = internal->loader;
FT_Int32 flags;
@@ -144,29 +126,6 @@
loader->trans_delta.x,
loader->trans_delta.y );
- /* copy the outline points in the loader's current */
- /* extra points which are used to keep original glyph coordinates */
- error = FT_GLYPHLOADER_CHECK_POINTS( gloader,
- slot->outline.n_points + 4,
- slot->outline.n_contours );
- if ( error )
- goto Exit;
-
- FT_ARRAY_COPY( gloader->current.outline.points,
- slot->outline.points,
- slot->outline.n_points );
-
- FT_ARRAY_COPY( gloader->current.outline.contours,
- slot->outline.contours,
- slot->outline.n_contours );
-
- FT_ARRAY_COPY( gloader->current.outline.tags,
- slot->outline.tags,
- slot->outline.n_points );
-
- gloader->current.outline.n_points = slot->outline.n_points;
- gloader->current.outline.n_contours = slot->outline.n_contours;
-
/* compute original horizontal phantom points (and ignore */
/* vertical ones) */
loader->pp1.x = hints->x_delta;
@@ -191,8 +150,9 @@
if ( writing_system_class->style_hints_apply )
- writing_system_class->style_hints_apply( hints,
- &gloader->current.outline,
+ writing_system_class->style_hints_apply( glyph_index,
+ hints,
+ &gloader->base.outline,
metrics );
}
@@ -267,128 +227,6 @@
slot->rsb_delta = loader->pp2.x - pp2x;
}
- /* good, we simply add the glyph to our loader's base */
- FT_GlyphLoader_Add( gloader );
- break;
-
- case FT_GLYPH_FORMAT_COMPOSITE:
- {
- FT_UInt nn, num_subglyphs = slot->num_subglyphs;
- FT_UInt num_base_subgs, start_point;
- FT_SubGlyph subglyph;
-
-
- start_point = gloader->base.outline.n_points;
-
- /* first of all, copy the subglyph descriptors in the glyph loader */
- error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs );
- if ( error )
- goto Exit;
-
- FT_ARRAY_COPY( gloader->current.subglyphs,
- slot->subglyphs,
- num_subglyphs );
-
- gloader->current.num_subglyphs = num_subglyphs;
- num_base_subgs = gloader->base.num_subglyphs;
-
- /* now read each subglyph independently */
- for ( nn = 0; nn < num_subglyphs; nn++ )
- {
- FT_Vector pp1, pp2;
- FT_Pos x, y;
- FT_UInt num_points, num_new_points, num_base_points;
-
-
- /* gloader.current.subglyphs can change during glyph loading due */
- /* to re-allocation -- we must recompute the current subglyph on */
- /* each iteration */
- subglyph = gloader->base.subglyphs + num_base_subgs + nn;
-
- pp1 = loader->pp1;
- pp2 = loader->pp2;
-
- num_base_points = gloader->base.outline.n_points;
-
- error = af_loader_load_g( loader, scaler, subglyph->index,
- load_flags, depth + 1 );
- if ( error )
- goto Exit;
-
- /* recompute subglyph pointer */
- subglyph = gloader->base.subglyphs + num_base_subgs + nn;
-
- if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) )
- {
- loader->pp1 = pp1;
- loader->pp2 = pp2;
- }
-
- num_points = gloader->base.outline.n_points;
- num_new_points = num_points - num_base_points;
-
- /* now perform the transformation required for this subglyph */
-
- if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE |
- FT_SUBGLYPH_FLAG_XY_SCALE |
- FT_SUBGLYPH_FLAG_2X2 ) )
- {
- FT_Vector* cur = gloader->base.outline.points +
- num_base_points;
- FT_Vector* limit = cur + num_new_points;
-
-
- for ( ; cur < limit; cur++ )
- FT_Vector_Transform( cur, &subglyph->transform );
- }
-
- /* apply offset */
-
- if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ) )
- {
- FT_Int k = subglyph->arg1;
- FT_UInt l = subglyph->arg2;
- FT_Vector* p1;
- FT_Vector* p2;
-
-
- if ( start_point + k >= num_base_points ||
- l >= (FT_UInt)num_new_points )
- {
- error = FT_THROW( Invalid_Composite );
- goto Exit;
- }
-
- l += num_base_points;
-
- /* for now, only use the current point coordinates; */
- /* we eventually may consider another approach */
- p1 = gloader->base.outline.points + start_point + k;
- p2 = gloader->base.outline.points + start_point + l;
-
- x = p1->x - p2->x;
- y = p1->y - p2->y;
- }
- else
- {
- x = FT_MulFix( subglyph->arg1, hints->x_scale ) + hints->x_delta;
- y = FT_MulFix( subglyph->arg2, hints->y_scale ) + hints->y_delta;
-
- x = FT_PIX_ROUND( x );
- y = FT_PIX_ROUND( y );
- }
-
- {
- FT_Outline dummy = gloader->base.outline;
-
-
- dummy.points += num_base_points;
- dummy.n_points = (short)num_new_points;
-
- FT_Outline_Translate( &dummy, x, y );
- }
- }
- }
break;
default:
@@ -397,7 +235,6 @@
}
Hint_Metrics:
- if ( depth == 0 )
{
FT_BBox bbox;
FT_Vector vvector;
@@ -472,18 +309,14 @@
slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
- /* now copy outline into glyph slot */
- FT_GlyphLoader_Rewind( internal->loader );
- error = FT_GlyphLoader_CopyPoints( internal->loader, gloader );
- if ( error )
- goto Exit;
-
+#if 0
/* reassign all outline fields except flags to protect them */
slot->outline.n_contours = internal->loader->base.outline.n_contours;
slot->outline.n_points = internal->loader->base.outline.n_points;
slot->outline.points = internal->loader->base.outline.points;
slot->outline.tags = internal->loader->base.outline.tags;
slot->outline.contours = internal->loader->base.outline.contours;
+#endif
slot->format = FT_GLYPH_FORMAT_OUTLINE;
}
@@ -496,14 +329,14 @@
/* Load a glyph. */
FT_LOCAL_DEF( FT_Error )
- af_loader_load_glyph( AF_Module module,
+ af_loader_load_glyph( AF_Loader loader,
+ AF_Module module,
FT_Face face,
FT_UInt gindex,
FT_Int32 load_flags )
{
FT_Error error;
FT_Size size = face->size;
- AF_Loader loader = module->loader;
AF_ScalerRec scaler;
@@ -521,7 +354,7 @@
scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );
scaler.flags = 0; /* XXX: fix this */
- error = af_loader_reset( module, face );
+ error = af_loader_reset( loader, module, face );
if ( !error )
{
AF_StyleMetrics metrics;
@@ -558,13 +391,13 @@
if ( writing_system_class->style_hints_init )
{
- error = writing_system_class->style_hints_init( &loader->hints,
+ error = writing_system_class->style_hints_init( loader->hints,
metrics );
if ( error )
goto Exit;
}
- error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 );
+ error = af_loader_load_g( loader, &scaler, gindex, load_flags );
}
}
Exit:
diff --git a/src/3rdparty/freetype/src/autofit/afloader.h b/src/3rdparty/freetype/src/autofit/afloader.h
index 9601e24fce..37cfd14239 100644
--- a/src/3rdparty/freetype/src/autofit/afloader.h
+++ b/src/3rdparty/freetype/src/autofit/afloader.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (specification). */
/* */
-/* Copyright 2003-2005, 2011-2013 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,13 +20,12 @@
#define __AFLOADER_H__
#include "afhints.h"
+#include "afmodule.h"
#include "afglobal.h"
FT_BEGIN_HEADER
- typedef struct AF_ModuleRec_* AF_Module;
-
/*
* The autofitter module's (global) data structure to communicate with
* actual fonts. If necessary, `local' data like the current face, the
@@ -42,8 +41,7 @@ FT_BEGIN_HEADER
AF_FaceGlobals globals;
/* current glyph data */
- FT_GlyphLoader gloader;
- AF_GlyphHintsRec hints;
+ AF_GlyphHints hints;
AF_StyleMetrics metrics;
FT_Bool transformed;
FT_Matrix trans_matrix;
@@ -55,21 +53,24 @@ FT_BEGIN_HEADER
} AF_LoaderRec, *AF_Loader;
- FT_LOCAL( FT_Error )
- af_loader_init( AF_Module module );
+ FT_LOCAL( void )
+ af_loader_init( AF_Loader loader,
+ AF_GlyphHints hints );
FT_LOCAL( FT_Error )
- af_loader_reset( AF_Module module,
+ af_loader_reset( AF_Loader loader,
+ AF_Module module,
FT_Face face );
FT_LOCAL( void )
- af_loader_done( AF_Module module );
+ af_loader_done( AF_Loader loader );
FT_LOCAL( FT_Error )
- af_loader_load_glyph( AF_Module module,
+ af_loader_load_glyph( AF_Loader loader,
+ AF_Module module,
FT_Face face,
FT_UInt gindex,
FT_Int32 load_flags );
diff --git a/src/3rdparty/freetype/src/autofit/afmodule.c b/src/3rdparty/freetype/src/autofit/afmodule.c
index 641e03ea2b..bbf1372518 100644
--- a/src/3rdparty/freetype/src/autofit/afmodule.c
+++ b/src/3rdparty/freetype/src/autofit/afmodule.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (body). */
/* */
-/* Copyright 2003-2006, 2009, 2011-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,10 +23,35 @@
#include "afpic.h"
#ifdef FT_DEBUG_AUTOFIT
- int _af_debug_disable_horz_hints;
- int _af_debug_disable_vert_hints;
- int _af_debug_disable_blue_hints;
- void* _af_debug_hints;
+
+#ifndef FT_MAKE_OPTION_SINGLE_OBJECT
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+ extern void
+ af_glyph_hints_dump_segments( AF_GlyphHints hints,
+ FT_Bool to_stdout );
+ extern void
+ af_glyph_hints_dump_points( AF_GlyphHints hints,
+ FT_Bool to_stdout );
+ extern void
+ af_glyph_hints_dump_edges( AF_GlyphHints hints,
+ FT_Bool to_stdout );
+#ifdef __cplusplus
+ }
+#endif
+
+#endif
+
+ int _af_debug_disable_horz_hints;
+ int _af_debug_disable_vert_hints;
+ int _af_debug_disable_blue_hints;
+
+ /* we use a global object instead of a local one for debugging */
+ AF_GlyphHintsRec _af_debug_hints_rec[1];
+
+ void* _af_debug_hints = _af_debug_hints_rec;
#endif
#include FT_INTERNAL_OBJECTS_H
@@ -141,6 +166,17 @@
return error;
}
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ else if ( !ft_strcmp( property_name, "warping" ) )
+ {
+ FT_Bool* warping = (FT_Bool*)value;
+
+
+ module->warping = *warping;
+
+ return error;
+ }
+#endif /* AF_CONFIG_OPTION_USE_WARPER */
FT_TRACE0(( "af_property_set: missing property `%s'\n",
property_name ));
@@ -157,6 +193,9 @@
AF_Module module = (AF_Module)ft_module;
FT_UInt fallback_style = module->fallback_style;
FT_UInt default_script = module->default_script;
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ FT_Bool warping = module->warping;
+#endif
if ( !ft_strcmp( property_name, "glyph-to-script-map" ) )
@@ -203,7 +242,17 @@
return error;
}
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ else if ( !ft_strcmp( property_name, "warping" ) )
+ {
+ FT_Bool* val = (FT_Bool*)value;
+
+ *val = warping;
+
+ return error;
+ }
+#endif /* AF_CONFIG_OPTION_USE_WARPER */
FT_TRACE0(( "af_property_get: missing property `%s'\n",
property_name ));
@@ -252,18 +301,23 @@
module->fallback_style = AF_STYLE_FALLBACK;
module->default_script = AF_SCRIPT_DEFAULT;
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ module->warping = 0;
+#endif
- return af_loader_init( module );
+ return FT_Err_Ok;
}
FT_CALLBACK_DEF( void )
af_autofitter_done( FT_Module ft_module ) /* AF_Module */
{
- AF_Module module = (AF_Module)ft_module;
-
+ FT_UNUSED( ft_module );
- af_loader_done( module );
+#ifdef FT_DEBUG_AUTOFIT
+ if ( _af_debug_hints_rec->memory )
+ af_glyph_hints_done( _af_debug_hints_rec );
+#endif
}
@@ -274,10 +328,56 @@
FT_UInt glyph_index,
FT_Int32 load_flags )
{
+ FT_Error error = FT_Err_Ok;
+ FT_Memory memory = module->root.library->memory;
+
+#ifdef FT_DEBUG_AUTOFIT
+
+ /* in debug mode, we use a global object that survives this routine */
+
+ AF_GlyphHints hints = _af_debug_hints_rec;
+ AF_LoaderRec loader[1];
+
FT_UNUSED( size );
- return af_loader_load_glyph( module, slot->face,
- glyph_index, load_flags );
+
+ if ( hints->memory )
+ af_glyph_hints_done( hints );
+
+ af_glyph_hints_init( hints, memory );
+ af_loader_init( loader, hints );
+
+ error = af_loader_load_glyph( loader, module, slot->face,
+ glyph_index, load_flags );
+
+ af_glyph_hints_dump_points( hints, 0 );
+ af_glyph_hints_dump_segments( hints, 0 );
+ af_glyph_hints_dump_edges( hints, 0 );
+
+ af_loader_done( loader );
+
+ return error;
+
+#else /* !FT_DEBUG_AUTOFIT */
+
+ AF_GlyphHintsRec hints[1];
+ AF_LoaderRec loader[1];
+
+ FT_UNUSED( size );
+
+
+ af_glyph_hints_init( hints, memory );
+ af_loader_init( loader, hints );
+
+ error = af_loader_load_glyph( loader, module, slot->face,
+ glyph_index, load_flags );
+
+ af_loader_done( loader );
+ af_glyph_hints_done( hints );
+
+ return error;
+
+#endif /* !FT_DEBUG_AUTOFIT */
}
diff --git a/src/3rdparty/freetype/src/autofit/afmodule.h b/src/3rdparty/freetype/src/autofit/afmodule.h
index 20b7b9f665..b9c2fd8a2d 100644
--- a/src/3rdparty/freetype/src/autofit/afmodule.h
+++ b/src/3rdparty/freetype/src/autofit/afmodule.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (specification). */
/* */
-/* Copyright 2003-2005, 2009, 2012, 2013 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,17 +23,13 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_MODULE_H
-#include "afloader.h"
-
FT_BEGIN_HEADER
/*
- * This is the `extended' FT_Module structure which holds the
- * autofitter's global data. Right before hinting a glyph, the data
- * specific to the glyph's face (blue zones, stem widths, etc.) are
- * loaded into `loader' (see function `af_loader_reset').
+ * This is the `extended' FT_Module structure that holds the
+ * autofitter's global data.
*/
typedef struct AF_ModuleRec_
@@ -42,13 +38,14 @@ FT_BEGIN_HEADER
FT_UInt fallback_style;
FT_UInt default_script;
+#ifdef AF_CONFIG_OPTION_USE_WARPER
+ FT_Bool warping;
+#endif
- AF_LoaderRec loader[1];
-
- } AF_ModuleRec;
+ } AF_ModuleRec, *AF_Module;
-FT_DECLARE_MODULE(autofit_module_class)
+FT_DECLARE_MODULE( autofit_module_class )
FT_END_HEADER
diff --git a/src/3rdparty/freetype/src/autofit/afpic.c b/src/3rdparty/freetype/src/autofit/afpic.c
index cb29fd79fe..5589e612cf 100644
--- a/src/3rdparty/freetype/src/autofit/afpic.c
+++ b/src/3rdparty/freetype/src/autofit/afpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009-2014 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/afpic.h b/src/3rdparty/freetype/src/autofit/afpic.h
index 9a68b4a5a2..9b45069f5d 100644
--- a/src/3rdparty/freetype/src/autofit/afpic.h
+++ b/src/3rdparty/freetype/src/autofit/afpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009, 2011-2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,8 +20,6 @@
#define __AFPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
@@ -43,6 +41,8 @@ FT_BEGIN_HEADER
#include "aftypes.h"
+FT_BEGIN_HEADER
+
typedef struct AFModulePIC_
{
FT_ServiceDescRec* af_services;
@@ -93,12 +93,12 @@ FT_BEGIN_HEADER
FT_Error
autofit_module_class_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __AFPIC_H__ */
diff --git a/src/3rdparty/freetype/src/autofit/afranges.c b/src/3rdparty/freetype/src/autofit/afranges.c
index b2c504d426..13c221364c 100644
--- a/src/3rdparty/freetype/src/autofit/afranges.c
+++ b/src/3rdparty/freetype/src/autofit/afranges.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter Unicode script ranges (body). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,6 +18,78 @@
#include "afranges.h"
+ /*
+ * The algorithm for assigning properties and styles to the `glyph_styles'
+ * array is as follows (cf. the implementation in
+ * `af_face_globals_compute_style_coverage').
+ *
+ * Walk over all scripts (as listed in `afscript.h').
+ *
+ * For a given script, walk over all styles (as listed in `afstyles.h').
+ * The order of styles is important and should be as follows.
+ *
+ * - First come styles based on OpenType features (small caps, for
+ * example). Since features rely on glyph indices, thus completely
+ * bypassing character codes, no properties are assigned.
+ *
+ * - Next comes the default style, using the character ranges as defined
+ * below. This also assigns properties.
+ *
+ * Note that there also exist fallback scripts, mainly covering
+ * superscript and subscript glyphs of a script that are not present as
+ * OpenType features. Fallback scripts are defined below, also
+ * assigning properties; they are applied after the corresponding
+ * script.
+ *
+ */
+
+
+ /* XXX Check base character ranges again: */
+ /* Right now, they are quickly derived by visual inspection. */
+ /* I can imagine that fine-tuning is necessary. */
+
+ /* for the auto-hinter, a `non-base character' is something that should */
+ /* not be affected by blue zones, regardless of whether this is a */
+ /* spacing or no-spacing glyph */
+
+ /* the `ta_xxxx_nonbase_uniranges' ranges must be strict subsets */
+ /* of the corresponding `ta_xxxx_uniranges' ranges */
+
+
+ const AF_Script_UniRangeRec af_arab_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0600UL, 0x06FFUL ), /* Arabic */
+ AF_UNIRANGE_REC( 0x0750UL, 0x07FFUL ), /* Arabic Supplement */
+ AF_UNIRANGE_REC( 0x08A0UL, 0x08FFUL ), /* Arabic Extended-A */
+ AF_UNIRANGE_REC( 0xFB50UL, 0xFDFFUL ), /* Arabic Presentation Forms-A */
+ AF_UNIRANGE_REC( 0xFE70UL, 0xFEFFUL ), /* Arabic Presentation Forms-B */
+ AF_UNIRANGE_REC( 0x1EE00UL, 0x1EEFFUL ), /* Arabic Mathematical Alphabetic Symbols */
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+ const AF_Script_UniRangeRec af_arab_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0600UL, 0x0605UL ),
+ AF_UNIRANGE_REC( 0x0610UL, 0x061AUL ),
+ AF_UNIRANGE_REC( 0x064BUL, 0x065FUL ),
+ AF_UNIRANGE_REC( 0x0670UL, 0x0670UL ),
+ AF_UNIRANGE_REC( 0x06D6UL, 0x06DCUL ),
+ AF_UNIRANGE_REC( 0x06DFUL, 0x06E4UL ),
+ AF_UNIRANGE_REC( 0x06E7UL, 0x06E8UL ),
+ AF_UNIRANGE_REC( 0x06EAUL, 0x06EDUL ),
+ AF_UNIRANGE_REC( 0x08E3UL, 0x08FFUL ),
+ AF_UNIRANGE_REC( 0xFBB2UL, 0xFBC1UL ),
+ AF_UNIRANGE_REC( 0xFE70UL, 0xFE70UL ),
+ AF_UNIRANGE_REC( 0xFE72UL, 0xFE72UL ),
+ AF_UNIRANGE_REC( 0xFE74UL, 0xFE74UL ),
+ AF_UNIRANGE_REC( 0xFE76UL, 0xFE76UL ),
+ AF_UNIRANGE_REC( 0xFE78UL, 0xFE78UL ),
+ AF_UNIRANGE_REC( 0xFE7AUL, 0xFE7AUL ),
+ AF_UNIRANGE_REC( 0xFE7CUL, 0xFE7CUL ),
+ AF_UNIRANGE_REC( 0xFE7EUL, 0xFE7EUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
const AF_Script_UniRangeRec af_cyrl_uniranges[] =
{
@@ -28,23 +100,47 @@
AF_UNIRANGE_REC( 0UL, 0UL )
};
- /* there are some characters in the Devanagari Unicode block that are */
+ const AF_Script_UniRangeRec af_cyrl_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0483UL, 0x0489UL ),
+ AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ),
+ AF_UNIRANGE_REC( 0xA66FUL, 0xA67FUL ),
+ AF_UNIRANGE_REC( 0xA69EUL, 0xA69FUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
+ /* There are some characters in the Devanagari Unicode block that are */
/* generic to Indic scripts; we omit them so that their presence doesn't */
- /* trigger Devanagari */
+ /* trigger Devanagari. */
const AF_Script_UniRangeRec af_deva_uniranges[] =
{
- AF_UNIRANGE_REC( 0x0900UL, 0x093BUL ), /* Devanagari */
+ AF_UNIRANGE_REC( 0x0900UL, 0x093BUL ), /* Devanagari */
/* omitting U+093C nukta */
- AF_UNIRANGE_REC( 0x093DUL, 0x0950UL ),
+ AF_UNIRANGE_REC( 0x093DUL, 0x0950UL ), /* ... continued */
/* omitting U+0951 udatta, U+0952 anudatta */
- AF_UNIRANGE_REC( 0x0953UL, 0x0963UL ),
+ AF_UNIRANGE_REC( 0x0953UL, 0x0963UL ), /* ... continued */
/* omitting U+0964 danda, U+0965 double danda */
- AF_UNIRANGE_REC( 0x0966UL, 0x097FUL ),
- AF_UNIRANGE_REC( 0x20B9UL, 0x20B9UL ), /* (new) Rupee sign */
+ AF_UNIRANGE_REC( 0x0966UL, 0x097FUL ), /* ... continued */
+ AF_UNIRANGE_REC( 0x20B9UL, 0x20B9UL ), /* (new) Rupee sign */
+ AF_UNIRANGE_REC( 0xA8E0UL, 0xA8FFUL ), /* Devanagari Extended */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_deva_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0900UL, 0x0902UL ),
+ AF_UNIRANGE_REC( 0x093AUL, 0x093AUL ),
+ AF_UNIRANGE_REC( 0x0941UL, 0x0948UL ),
+ AF_UNIRANGE_REC( 0x094DUL, 0x094DUL ),
+ AF_UNIRANGE_REC( 0x0953UL, 0x0957UL ),
+ AF_UNIRANGE_REC( 0x0962UL, 0x0963UL ),
+ AF_UNIRANGE_REC( 0xA8E0UL, 0xA8F1UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_grek_uniranges[] =
{
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */
@@ -52,6 +148,19 @@
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_grek_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x037AUL, 0x037AUL ),
+ AF_UNIRANGE_REC( 0x0384UL, 0x0385UL ),
+ AF_UNIRANGE_REC( 0x1FBDUL, 0x1FC1UL ),
+ AF_UNIRANGE_REC( 0x1FCDUL, 0x1FCFUL ),
+ AF_UNIRANGE_REC( 0x1FDDUL, 0x1FDFUL ),
+ AF_UNIRANGE_REC( 0x1FEDUL, 0x1FEFUL ),
+ AF_UNIRANGE_REC( 0x1FFDUL, 0x1FFEUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_hebr_uniranges[] =
{
AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */
@@ -59,45 +168,171 @@
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_hebr_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0591UL, 0x05BFUL ),
+ AF_UNIRANGE_REC( 0x05C1UL, 0x05C2UL ),
+ AF_UNIRANGE_REC( 0x05C4UL, 0x05C5UL ),
+ AF_UNIRANGE_REC( 0x05C7UL, 0x05C7UL ),
+ AF_UNIRANGE_REC( 0xFB1EUL, 0xFB1EUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
+ const AF_Script_UniRangeRec af_lao_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0E80UL, 0x0EFFUL ), /* Lao */
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+ const AF_Script_UniRangeRec af_lao_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0EB1UL, 0x0EB1UL ),
+ AF_UNIRANGE_REC( 0x0EB4UL, 0x0EBCUL ),
+ AF_UNIRANGE_REC( 0x0EC8UL, 0x0ECDUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_latn_uniranges[] =
{
AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */
- AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */
+ AF_UNIRANGE_REC( 0x00A0UL, 0x00A9UL ), /* Latin-1 Supplement (no control chars) */
+ AF_UNIRANGE_REC( 0x00ABUL, 0x00B1UL ), /* ... continued */
+ AF_UNIRANGE_REC( 0x00B4UL, 0x00B8UL ), /* ... continued */
+ AF_UNIRANGE_REC( 0x00BBUL, 0x00FFUL ), /* ... continued */
AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */
AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */
AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */
- AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */
+ AF_UNIRANGE_REC( 0x02B9UL, 0x02DFUL ), /* Spacing Modifier Letters */
+ AF_UNIRANGE_REC( 0x02E5UL, 0x02FFUL ), /* ... continued */
AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */
- AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */
- AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */
+ AF_UNIRANGE_REC( 0x1AB0UL, 0x1ABEUL ), /* Combining Diacritical Marks Extended */
+ AF_UNIRANGE_REC( 0x1D00UL, 0x1D2BUL ), /* Phonetic Extensions */
+ AF_UNIRANGE_REC( 0x1D6BUL, 0x1D77UL ), /* ... continued */
+ AF_UNIRANGE_REC( 0x1D79UL, 0x1D7FUL ), /* ... continued */
+ AF_UNIRANGE_REC( 0x1D80UL, 0x1D9AUL ), /* Phonetic Extensions Supplement */
AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */
AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */
AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */
- AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */
AF_UNIRANGE_REC( 0x20A0UL, 0x20B8UL ), /* Currency Symbols ... */
AF_UNIRANGE_REC( 0x20BAUL, 0x20CFUL ), /* ... except new Rupee sign */
AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */
- AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */
- AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */
+ AF_UNIRANGE_REC( 0x2C60UL, 0x2C7BUL ), /* Latin Extended-C */
+ AF_UNIRANGE_REC( 0x2C7EUL, 0x2C7FUL ), /* ... continued */
AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */
- AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */
+ AF_UNIRANGE_REC( 0xA720UL, 0xA76FUL ), /* Latin Extended-D */
+ AF_UNIRANGE_REC( 0xA771UL, 0xA7F7UL ), /* ... continued */
+ AF_UNIRANGE_REC( 0xA7FAUL, 0xA7FFUL ), /* ... continued */
+ AF_UNIRANGE_REC( 0xAB30UL, 0xAB5BUL ), /* Latin Extended-E */
+ AF_UNIRANGE_REC( 0xAB60UL, 0xAB6FUL ), /* ... continued */
AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */
AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */
- AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_latn_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x005EUL, 0x0060UL ),
+ AF_UNIRANGE_REC( 0x007EUL, 0x007EUL ),
+ AF_UNIRANGE_REC( 0x00A8UL, 0x00A9UL ),
+ AF_UNIRANGE_REC( 0x00AEUL, 0x00B0UL ),
+ AF_UNIRANGE_REC( 0x00B4UL, 0x00B4UL ),
+ AF_UNIRANGE_REC( 0x00B8UL, 0x00B8UL ),
+ AF_UNIRANGE_REC( 0x00BCUL, 0x00BEUL ),
+ AF_UNIRANGE_REC( 0x02B9UL, 0x02DFUL ),
+ AF_UNIRANGE_REC( 0x02E5UL, 0x02FFUL ),
+ AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ),
+ AF_UNIRANGE_REC( 0x1AB0UL, 0x1ABEUL ),
+ AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ),
+ AF_UNIRANGE_REC( 0x2017UL, 0x2017UL ),
+ AF_UNIRANGE_REC( 0x203EUL, 0x203EUL ),
+ AF_UNIRANGE_REC( 0xA788UL, 0xA788UL ),
+ AF_UNIRANGE_REC( 0xA7F8UL, 0xA7FAUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
+ const AF_Script_UniRangeRec af_latb_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1D62UL, 0x1D6AUL ), /* some small subscript letters */
+ AF_UNIRANGE_REC( 0x2080UL, 0x209CUL ), /* subscript digits and letters */
+ AF_UNIRANGE_REC( 0x2C7CUL, 0x2C7CUL ), /* latin subscript small letter j */
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+ const AF_Script_UniRangeRec af_latb_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
+ const AF_Script_UniRangeRec af_latp_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x00AAUL, 0x00AAUL ), /* feminine ordinal indicator */
+ AF_UNIRANGE_REC( 0x00B2UL, 0x00B3UL ), /* superscript two and three */
+ AF_UNIRANGE_REC( 0x00B9UL, 0x00BAUL ), /* superscript one, masc. ord. indic. */
+ AF_UNIRANGE_REC( 0x02B0UL, 0x02B8UL ), /* some latin superscript mod. letters */
+ AF_UNIRANGE_REC( 0x02E0UL, 0x02E4UL ), /* some IPA modifier letters */
+ AF_UNIRANGE_REC( 0x1D2CUL, 0x1D61UL ), /* latin superscript modifier letters */
+ AF_UNIRANGE_REC( 0x1D78UL, 0x1D78UL ), /* modifier letter cyrillic en */
+ AF_UNIRANGE_REC( 0x1D9BUL, 0x1DBFUL ), /* more modifier letters */
+ AF_UNIRANGE_REC( 0x2070UL, 0x207FUL ), /* superscript digits and letters */
+ AF_UNIRANGE_REC( 0x2C7DUL, 0x2C7DUL ), /* modifier letter capital v */
+ AF_UNIRANGE_REC( 0xA770UL, 0xA770UL ), /* modifier letter us */
+ AF_UNIRANGE_REC( 0xA7F8UL, 0xA7F9UL ), /* more modifier letters */
+ AF_UNIRANGE_REC( 0xAB5CUL, 0xAB5FUL ), /* more modifier letters */
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+ const AF_Script_UniRangeRec af_latp_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_none_uniranges[] =
{
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_none_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_telu_uniranges[] =
{
AF_UNIRANGE_REC( 0x0C00UL, 0x0C7FUL ), /* Telugu */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_telu_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0C00UL, 0x0C00UL ),
+ AF_UNIRANGE_REC( 0x0C3EUL, 0x0C40UL ),
+ AF_UNIRANGE_REC( 0x0C46UL, 0x0C56UL ),
+ AF_UNIRANGE_REC( 0x0C62UL, 0x0C63UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
+ const AF_Script_UniRangeRec af_thai_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0E00UL, 0x0E7FUL ), /* Thai */
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+ const AF_Script_UniRangeRec af_thai_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0E31UL, 0x0E31UL ),
+ AF_UNIRANGE_REC( 0x0E34UL, 0x0E3AUL ),
+ AF_UNIRANGE_REC( 0x0E47UL, 0x0E4EUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
#ifdef AF_CONFIG_OPTION_INDIC
const AF_Script_UniRangeRec af_beng_uniranges[] =
@@ -106,72 +341,197 @@
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_beng_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0981UL, 0x0981UL ),
+ AF_UNIRANGE_REC( 0x09BCUL, 0x09BCUL ),
+ AF_UNIRANGE_REC( 0x09C1UL, 0x09C4UL ),
+ AF_UNIRANGE_REC( 0x09CDUL, 0x09CDUL ),
+ AF_UNIRANGE_REC( 0x09E2UL, 0x09E3UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_gujr_uniranges[] =
{
AF_UNIRANGE_REC( 0x0A80UL, 0x0AFFUL ), /* Gujarati */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_gujr_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0A81UL, 0x0A82UL ),
+ AF_UNIRANGE_REC( 0x0ABCUL, 0x0ABCUL ),
+ AF_UNIRANGE_REC( 0x0AC1UL, 0x0AC8UL ),
+ AF_UNIRANGE_REC( 0x0ACDUL, 0x0ACDUL ),
+ AF_UNIRANGE_REC( 0x0AE2UL, 0x0AE3UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_guru_uniranges[] =
{
AF_UNIRANGE_REC( 0x0A00UL, 0x0A7FUL ), /* Gurmukhi */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_guru_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0A01UL, 0x0A02UL ),
+ AF_UNIRANGE_REC( 0x0A3CUL, 0x0A3EUL ),
+ AF_UNIRANGE_REC( 0x0A41UL, 0x0A51UL ),
+ AF_UNIRANGE_REC( 0x0A70UL, 0x0A71UL ),
+ AF_UNIRANGE_REC( 0x0A75UL, 0x0A75UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_knda_uniranges[] =
{
AF_UNIRANGE_REC( 0x0C80UL, 0x0CFFUL ), /* Kannada */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_knda_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0C81UL, 0x0C81UL ),
+ AF_UNIRANGE_REC( 0x0CBCUL, 0x0CBCUL ),
+ AF_UNIRANGE_REC( 0x0CBFUL, 0x0CBFUL ),
+ AF_UNIRANGE_REC( 0x0CC6UL, 0x0CC6UL ),
+ AF_UNIRANGE_REC( 0x0CCCUL, 0x0CCDUL ),
+ AF_UNIRANGE_REC( 0x0CE2UL, 0x0CE3UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_limb_uniranges[] =
{
AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_limb_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1920UL, 0x1922UL ),
+ AF_UNIRANGE_REC( 0x1927UL, 0x1934UL ),
+ AF_UNIRANGE_REC( 0x1937UL, 0x193BUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_mlym_uniranges[] =
{
AF_UNIRANGE_REC( 0x0D00UL, 0x0D7FUL ), /* Malayalam */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_mlym_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0D01UL, 0x0D01UL ),
+ AF_UNIRANGE_REC( 0x0D4DUL, 0x0D4EUL ),
+ AF_UNIRANGE_REC( 0x0D62UL, 0x0D63UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_orya_uniranges[] =
{
AF_UNIRANGE_REC( 0x0B00UL, 0x0B7FUL ), /* Oriya */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_orya_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0B01UL, 0x0B02UL ),
+ AF_UNIRANGE_REC( 0x0B3CUL, 0x0B3CUL ),
+ AF_UNIRANGE_REC( 0x0B3FUL, 0x0B3FUL ),
+ AF_UNIRANGE_REC( 0x0B41UL, 0x0B44UL ),
+ AF_UNIRANGE_REC( 0x0B4DUL, 0x0B56UL ),
+ AF_UNIRANGE_REC( 0x0B62UL, 0x0B63UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_sinh_uniranges[] =
{
AF_UNIRANGE_REC( 0x0D80UL, 0x0DFFUL ), /* Sinhala */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_sinh_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0DCAUL, 0x0DCAUL ),
+ AF_UNIRANGE_REC( 0x0DD2UL, 0x0DD6UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_sund_uniranges[] =
{
- AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */
+ AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */
+ AF_UNIRANGE_REC( 0x1CC0UL, 0x1CCFUL ), /* Sundanese Supplement */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_sund_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x1B80UL, 0x1B82UL ),
+ AF_UNIRANGE_REC( 0x1BA1UL, 0x1BADUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_sylo_uniranges[] =
{
AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_sylo_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0xA802UL, 0xA802UL ),
+ AF_UNIRANGE_REC( 0xA806UL, 0xA806UL ),
+ AF_UNIRANGE_REC( 0xA80BUL, 0xA80BUL ),
+ AF_UNIRANGE_REC( 0xA825UL, 0xA826UL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_taml_uniranges[] =
{
AF_UNIRANGE_REC( 0x0B80UL, 0x0BFFUL ), /* Tamil */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_taml_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0B82UL, 0x0B82UL ),
+ AF_UNIRANGE_REC( 0x0BC0UL, 0x0BC2UL ),
+ AF_UNIRANGE_REC( 0x0BCDUL, 0x0BCDUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
+
const AF_Script_UniRangeRec af_tibt_uniranges[] =
{
AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_tibt_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x0F18UL, 0x0F19UL ),
+ AF_UNIRANGE_REC( 0x0F35UL, 0x0F35UL ),
+ AF_UNIRANGE_REC( 0x0F37UL, 0x0F37UL ),
+ AF_UNIRANGE_REC( 0x0F39UL, 0x0F39UL ),
+ AF_UNIRANGE_REC( 0x0F3EUL, 0x0F3FUL ),
+ AF_UNIRANGE_REC( 0x0F71UL, 0x0F7EUL ),
+ AF_UNIRANGE_REC( 0x0F80UL, 0x0F84UL ),
+ AF_UNIRANGE_REC( 0x0F86UL, 0x0F87UL ),
+ AF_UNIRANGE_REC( 0x0F8DUL, 0x0FBCUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
#endif /* !AF_CONFIG_OPTION_INDIC */
#ifdef AF_CONFIG_OPTION_CJK
@@ -193,7 +553,6 @@
AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */
AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */
AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */
- AF_UNIRANGE_REC( 0x3200UL, 0x32FFUL ), /* Enclosed CJK Letters and Months */
AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */
AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */
AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */
@@ -207,7 +566,6 @@
AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */
AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ), /* Kana Supplement */
AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ), /* Tai Xuan Hing Symbols */
- AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ), /* Enclosed Ideographic Supplement */
AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */
AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ), /* CJK Unified Ideographs Extension C */
AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ), /* CJK Unified Ideographs Extension D */
@@ -215,6 +573,13 @@
AF_UNIRANGE_REC( 0UL, 0UL )
};
+ const AF_Script_UniRangeRec af_hani_nonbase_uniranges[] =
+ {
+ AF_UNIRANGE_REC( 0x302AUL, 0x302FUL ),
+ AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ),
+ AF_UNIRANGE_REC( 0UL, 0UL )
+ };
+
#endif /* !AF_CONFIG_OPTION_CJK */
/* END */
diff --git a/src/3rdparty/freetype/src/autofit/afranges.h b/src/3rdparty/freetype/src/autofit/afranges.h
index fe5b2aa7c1..b080873e77 100644
--- a/src/3rdparty/freetype/src/autofit/afranges.h
+++ b/src/3rdparty/freetype/src/autofit/afranges.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter Unicode script ranges (specification). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,6 +31,12 @@ FT_BEGIN_HEADER
#include "afscript.h"
+#undef SCRIPT
+#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
+ extern const AF_Script_UniRangeRec af_ ## s ## _nonbase_uniranges[];
+
+#include "afscript.h"
+
/* */
FT_END_HEADER
diff --git a/src/3rdparty/freetype/src/autofit/afscript.h b/src/3rdparty/freetype/src/autofit/afscript.h
index efe8754df8..b92e84f5ff 100644
--- a/src/3rdparty/freetype/src/autofit/afscript.h
+++ b/src/3rdparty/freetype/src/autofit/afscript.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter scripts (specification only). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,11 +25,20 @@
/* by a description string. Then comes the corresponding HarfBuzz */
/* script name tag, followed by a string of standard characters (to */
/* derive the standard width and height of stems). */
+ /* */
+ /* Note that fallback scripts only have a default style, thus we */
+ /* use `HB_SCRIPT_INVALID' as the HarfBuzz script name tag for */
+ /* them. */
+
+ SCRIPT( arab, ARAB,
+ "Arabic",
+ HB_SCRIPT_ARABIC,
+ 0x644, 0x62D, 0x640 ) /* ل ح ـ */
SCRIPT( cyrl, CYRL,
"Cyrillic",
HB_SCRIPT_CYRILLIC,
- 0x43E, 0x41E, 0x0 ) /* оО */
+ 0x43E, 0x41E, 0x0 ) /* о О */
SCRIPT( deva, DEVA,
"Devanagari",
@@ -39,18 +48,34 @@
SCRIPT( grek, GREK,
"Greek",
HB_SCRIPT_GREEK,
- 0x3BF, 0x39F, 0x0 ) /* οΟ */
+ 0x3BF, 0x39F, 0x0 ) /* ο Ο */
SCRIPT( hebr, HEBR,
"Hebrew",
HB_SCRIPT_HEBREW,
0x5DD, 0x0, 0x0 ) /* ם */
+ /* only digit zero has a simple shape in the Lao script */
+ SCRIPT( lao, LAO,
+ "Lao",
+ HB_SCRIPT_LAO,
+ 0xED0, 0x0, 0x0 ) /* ໐ */
+
SCRIPT( latn, LATN,
"Latin",
HB_SCRIPT_LATIN,
'o', 'O', '0' )
+ SCRIPT( latb, LATB,
+ "Latin Subscript Fallback",
+ HB_SCRIPT_INVALID,
+ 0x2092, 0x2080, 0x0 ) /* ₒ ₀ */
+
+ SCRIPT( latp, LATP,
+ "Latin Superscript Fallback",
+ HB_SCRIPT_INVALID,
+ 0x1D52, 0x1D3C, 0x2070 ) /* ᵒ ᴼ ⁰ */
+
SCRIPT( none, NONE,
"no script",
HB_SCRIPT_INVALID,
@@ -62,6 +87,11 @@
HB_SCRIPT_TELUGU,
0xC66, 0xC67, 0x0 ) /* ౦ ౧ */
+ SCRIPT( thai, THAI,
+ "Thai",
+ HB_SCRIPT_THAI,
+ 0xE32, 0xE45, 0xE50 ) /* า ๅ ๐ */
+
#ifdef AF_CONFIG_OPTION_INDIC
SCRIPT( beng, BENG,
diff --git a/src/3rdparty/freetype/src/autofit/afstyles.h b/src/3rdparty/freetype/src/autofit/afstyles.h
index f14d354ccb..87663c9ee7 100644
--- a/src/3rdparty/freetype/src/autofit/afstyles.h
+++ b/src/3rdparty/freetype/src/autofit/afstyles.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter styles (specification only). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,7 +27,9 @@
/* coverage. */
/* */
/* Note that styles using `AF_COVERAGE_DEFAULT' should always */
- /* come after styles with other coverages. */
+ /* come after styles with other coverages. Also note that */
+ /* fallback scripts only use `AF_COVERAGE_DEFAULT' for its */
+ /* style. */
/* */
/* Example: */
/* */
@@ -80,8 +82,23 @@
"default", \
DEFAULT )
+
+ STYLE( arab_dflt, ARAB_DFLT,
+ "Arabic default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_ARAB,
+ AF_BLUE_STRINGSET_ARAB,
+ AF_COVERAGE_DEFAULT )
+
META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" )
+ STYLE( deva_dflt, DEVA_DFLT,
+ "Devanagari default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_DEVA,
+ AF_BLUE_STRINGSET_DEVA,
+ AF_COVERAGE_DEFAULT )
+
META_STYLE_LATIN( grek, GREK, "Greek" )
STYLE( hebr_dflt, HEBR_DFLT,
@@ -90,13 +107,28 @@
AF_SCRIPT_HEBR,
AF_BLUE_STRINGSET_HEBR,
AF_COVERAGE_DEFAULT )
+
+ STYLE( lao_dflt, LAO_DFLT,
+ "Lao default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_LAO,
+ AF_BLUE_STRINGSET_LAO,
+ AF_COVERAGE_DEFAULT )
+
META_STYLE_LATIN( latn, LATN, "Latin" )
- STYLE( deva_dflt, DEVA_DFLT,
- "Devanagari default style",
+ STYLE( latb_dflt, LATB_DFLT,
+ "Latin subscript fallback default style",
AF_WRITING_SYSTEM_LATIN,
- AF_SCRIPT_DEVA,
- AF_BLUE_STRINGSET_DEVA,
+ AF_SCRIPT_LATB,
+ AF_BLUE_STRINGSET_LATB,
+ AF_COVERAGE_DEFAULT )
+
+ STYLE( latp_dflt, LATP_DFLT,
+ "Latin superscript fallback default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_LATP,
+ AF_BLUE_STRINGSET_LATP,
AF_COVERAGE_DEFAULT )
#ifdef FT_OPTION_AUTOFIT2
@@ -122,6 +154,13 @@
AF_BLUE_STRINGSET_TELU,
AF_COVERAGE_DEFAULT )
+ STYLE( thai_dflt, THAI_DFLT,
+ "Thai default style",
+ AF_WRITING_SYSTEM_LATIN,
+ AF_SCRIPT_THAI,
+ AF_BLUE_STRINGSET_THAI,
+ AF_COVERAGE_DEFAULT )
+
#ifdef AF_CONFIG_OPTION_INDIC
/* no blue stringset support for the Indic writing system yet */
diff --git a/src/3rdparty/freetype/src/autofit/aftypes.h b/src/3rdparty/freetype/src/autofit/aftypes.h
index 61badd1b8d..43b38006c2 100644
--- a/src/3rdparty/freetype/src/autofit/aftypes.h
+++ b/src/3rdparty/freetype/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter types (specification only). */
/* */
-/* Copyright 2003-2009, 2011-2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,6 +41,10 @@
#include "afblue.h"
+#ifdef FT_DEBUG_AUTOFIT
+#include FT_CONFIG_STANDARD_LIBRARY_H
+#endif
+
FT_BEGIN_HEADER
@@ -54,8 +58,6 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_AUTOFIT
-#include FT_CONFIG_STANDARD_LIBRARY_H
-
extern int _af_debug_disable_horz_hints;
extern int _af_debug_disable_vert_hints;
extern int _af_debug_disable_blue_hints;
@@ -138,11 +140,10 @@ extern void* _af_debug_hints;
AF_Angle _delta = (angle2) - (angle1); \
\
\
- _delta %= AF_ANGLE_2PI; \
- if ( _delta < 0 ) \
+ while ( _delta <= -AF_ANGLE_PI ) \
_delta += AF_ANGLE_2PI; \
\
- if ( _delta > AF_ANGLE_PI ) \
+ while ( _delta > AF_ANGLE_PI ) \
_delta -= AF_ANGLE_2PI; \
\
result = _delta; \
@@ -168,13 +169,10 @@ extern void* _af_debug_hints;
* auto-hinted glyph image.
*/
- typedef enum AF_ScalerFlags_
- {
- AF_SCALER_FLAG_NO_HORIZONTAL = 1, /* disable horizontal hinting */
- AF_SCALER_FLAG_NO_VERTICAL = 2, /* disable vertical hinting */
- AF_SCALER_FLAG_NO_ADVANCE = 4 /* disable advance hinting */
-
- } AF_ScalerFlags;
+#define AF_SCALER_FLAG_NO_HORIZONTAL 1U /* disable horizontal hinting */
+#define AF_SCALER_FLAG_NO_VERTICAL 2U /* disable vertical hinting */
+#define AF_SCALER_FLAG_NO_ADVANCE 4U /* disable advance hinting */
+#define AF_SCALER_FLAG_NO_WARPER 8U /* disable warper */
typedef struct AF_ScalerRec_
@@ -219,7 +217,8 @@ extern void* _af_debug_hints;
AF_StyleMetrics metrics );
typedef void
- (*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints hints,
+ (*AF_WritingSystem_ApplyHintsFunc)( FT_UInt glyph_index,
+ AF_GlyphHints hints,
FT_Outline* outline,
AF_StyleMetrics metrics );
@@ -295,8 +294,9 @@ extern void* _af_debug_hints;
/*************************************************************************/
/*
- * Each script is associated with a set of Unicode ranges that gets used
- * to test whether the font face supports the script.
+ * Each script is associated with two sets of Unicode ranges to test
+ * whether the font face supports the script, and which non-base
+ * characters the script contains.
*
* We use four-letter script tags from the OpenType specification,
* extended by `NONE', which indicates `no script'.
@@ -333,7 +333,9 @@ extern void* _af_debug_hints;
{
AF_Script script;
- AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */
+ /* last element in the ranges must be { 0, 0 } */
+ AF_Script_UniRange script_uni_ranges;
+ AF_Script_UniRange script_uni_nonbase_ranges;
FT_UInt32 standard_char1; /* for default width and height */
FT_UInt32 standard_char2; /* ditto */
@@ -513,6 +515,7 @@ extern void* _af_debug_hints;
script_class, \
script, \
ranges, \
+ nonbase_ranges, \
std_char1, \
std_char2, \
std_char3 ) \
@@ -521,6 +524,7 @@ extern void* _af_debug_hints;
{ \
script, \
ranges, \
+ nonbase_ranges, \
std_char1, \
std_char2, \
std_char3 \
@@ -587,17 +591,19 @@ extern void* _af_debug_hints;
script_class, \
script_, \
ranges, \
+ nonbase_ranges, \
std_char1, \
std_char2, \
std_char3 ) \
FT_LOCAL_DEF( void ) \
FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \
{ \
- ac->script = script_; \
- ac->script_uni_ranges = ranges; \
- ac->standard_char1 = std_char1; \
- ac->standard_char2 = std_char2; \
- ac->standard_char3 = std_char3; \
+ ac->script = script_; \
+ ac->script_uni_ranges = ranges; \
+ ac->script_uni_nonbase_ranges = nonbase_ranges; \
+ ac->standard_char1 = std_char1; \
+ ac->standard_char2 = std_char2; \
+ ac->standard_char3 = std_char3; \
}
diff --git a/src/3rdparty/freetype/src/autofit/afwarp.c b/src/3rdparty/freetype/src/autofit/afwarp.c
index 34a97ffc57..59af4f02bd 100644
--- a/src/3rdparty/freetype/src/autofit/afwarp.c
+++ b/src/3rdparty/freetype/src/autofit/afwarp.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter warping algorithm (body). */
/* */
-/* Copyright 2006, 2007, 2011 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -76,10 +76,10 @@
FT_Pos xx2,
AF_WarpScore base_distort,
AF_Segment segments,
- FT_UInt num_segments )
+ FT_Int num_segments )
{
FT_Int idx_min, idx_max, idx0;
- FT_UInt nn;
+ FT_Int nn;
AF_WarpScore scores[65];
@@ -171,7 +171,7 @@
FT_Fixed org_scale;
FT_Pos org_delta;
- FT_UInt nn, num_points, num_segments;
+ FT_Int nn, num_points, num_segments;
FT_Int X1, X2;
FT_Int w;
diff --git a/src/3rdparty/freetype/src/autofit/afwarp.h b/src/3rdparty/freetype/src/autofit/afwarp.h
index 7343fdd5ef..6069b6b277 100644
--- a/src/3rdparty/freetype/src/autofit/afwarp.h
+++ b/src/3rdparty/freetype/src/autofit/afwarp.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter warping algorithm (specification). */
/* */
-/* Copyright 2006, 2007 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,7 +25,7 @@ FT_BEGIN_HEADER
#define AF_WARPER_SCALE
-#define AF_WARPER_FLOOR( x ) ( (x) & ~63 )
+#define AF_WARPER_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
#define AF_WARPER_CEIL( x ) AF_WARPER_FLOOR( (x) + 63 )
diff --git a/src/3rdparty/freetype/src/autofit/afwrtsys.h b/src/3rdparty/freetype/src/autofit/afwrtsys.h
index 8aa2ed9e6b..4aa89d2356 100644
--- a/src/3rdparty/freetype/src/autofit/afwrtsys.h
+++ b/src/3rdparty/freetype/src/autofit/afwrtsys.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter writing systems (specification only). */
/* */
-/* Copyright 2013 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/autofit.c b/src/3rdparty/freetype/src/autofit/autofit.c
index e2b9934e4b..b6ed4a0ff1 100644
--- a/src/3rdparty/freetype/src/autofit/autofit.c
+++ b/src/3rdparty/freetype/src/autofit/autofit.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module (body). */
/* */
-/* Copyright 2003-2007, 2011, 2013 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/autofit/hbshim.c b/src/3rdparty/freetype/src/autofit/hbshim.c
index a705cef000..7a45059c39 100644
--- a/src/3rdparty/freetype/src/autofit/hbshim.c
+++ b/src/3rdparty/freetype/src/autofit/hbshim.c
@@ -4,7 +4,7 @@
/* */
/* HarfBuzz interface for accessing OpenType features (body). */
/* */
-/* Copyright 2013, 2014 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -98,7 +98,7 @@
FT_Error
af_get_coverage( AF_FaceGlobals globals,
AF_StyleClass style_class,
- FT_Byte* gstyles )
+ FT_UShort* gstyles )
{
hb_face_t* face;
@@ -187,7 +187,7 @@
count = 0;
#endif
- for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE4(( " %d", idx ));
@@ -218,7 +218,7 @@
count = 0;
#endif
- for ( idx = -1; hb_set_next( gpos_lookups, &idx ); )
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gpos_lookups, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE4(( " %d", idx ));
@@ -267,7 +267,8 @@
GET_UTF8_CHAR( ch, p );
- for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups,
+ &idx ); )
{
hb_codepoint_t gidx = FT_Get_Char_Index( globals->face, ch );
@@ -344,7 +345,7 @@
count = 0;
#endif
- for ( idx = -1; hb_set_next( gsub_glyphs, &idx ); )
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_glyphs, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
if ( !( count % 10 ) )
@@ -362,7 +363,7 @@
continue;
if ( gstyles[idx] == AF_STYLE_UNASSIGNED )
- gstyles[idx] = (FT_Byte)style_class->style;
+ gstyles[idx] = (FT_UShort)style_class->style;
#ifdef FT_DEBUG_LEVEL_TRACE
else
FT_TRACE4(( "*" ));
@@ -441,7 +442,7 @@
if ( feature )
{
- FT_UInt upem = metrics->globals->face->units_per_EM;
+ FT_Int upem = (FT_Int)metrics->globals->face->units_per_EM;
hb_font_t* font = metrics->globals->hb_font;
hb_buffer_t* buf = hb_buffer_create();
@@ -508,7 +509,7 @@
FT_Error
af_get_coverage( AF_FaceGlobals globals,
AF_StyleClass style_class,
- FT_Byte* gstyles )
+ FT_UShort* gstyles )
{
FT_UNUSED( globals );
FT_UNUSED( style_class );
diff --git a/src/3rdparty/freetype/src/autofit/hbshim.h b/src/3rdparty/freetype/src/autofit/hbshim.h
index 02f1513f67..3824941ca2 100644
--- a/src/3rdparty/freetype/src/autofit/hbshim.h
+++ b/src/3rdparty/freetype/src/autofit/hbshim.h
@@ -4,7 +4,7 @@
/* */
/* HarfBuzz interface for accessing OpenType features (specification). */
/* */
-/* Copyright 2013 by */
+/* Copyright 2013-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -38,7 +38,7 @@ FT_BEGIN_HEADER
FT_Error
af_get_coverage( AF_FaceGlobals globals,
AF_StyleClass style_class,
- FT_Byte* gstyles );
+ FT_UShort* gstyles );
FT_Error
af_get_char_index( AF_StyleMetrics metrics,
diff --git a/src/3rdparty/freetype/src/autofit/module.mk b/src/3rdparty/freetype/src/autofit/module.mk
index 6ec60912ab..33214387f5 100644
--- a/src/3rdparty/freetype/src/autofit/module.mk
+++ b/src/3rdparty/freetype/src/autofit/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003, 2004, 2005, 2006 by
+# Copyright 2003-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/autofit/rules.mk b/src/3rdparty/freetype/src/autofit/rules.mk
index 658f04ea59..6ef959f1ba 100644
--- a/src/3rdparty/freetype/src/autofit/rules.mk
+++ b/src/3rdparty/freetype/src/autofit/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2007, 2011, 2013 by
+# Copyright 2003-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ AUTOF_DIR := $(SRC_DIR)/autofit
# compilation flags for the driver
#
-AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))
+AUTOF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# AUTOF driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/base/Jamfile b/src/3rdparty/freetype/src/base/Jamfile
index 832e8b8424..e39fb096b2 100644
--- a/src/3rdparty/freetype/src/base/Jamfile
+++ b/src/3rdparty/freetype/src/base/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/base Jamfile
#
-# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -17,10 +17,19 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
if $(FT2_MULTI)
{
- _sources = ftadvanc ftcalc ftdbgmem ftgloadr
- ftobjs ftoutln ftrfork ftsnames
- ftstream fttrigon ftutil
- basepic ftpic
+ _sources = basepic
+ ftadvanc
+ ftcalc
+ ftdbgmem
+ ftgloadr
+ ftobjs
+ ftoutln
+ ftpic
+ ftrfork
+ ftsnames
+ ftstream
+ fttrigon
+ ftutil
;
}
else
@@ -34,13 +43,31 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
# Add the optional/replaceable files.
#
{
- local _sources = bbox bdf bitmap debug gasp
- glyph gxval init lcdfil mm
- otval pfr stroke synth system
- type1 winfnt xf86 patent
+ local _sources = ftapi
+ ftbbox
+ ftbdf
+ ftbitmap
+ ftcid
+ ftdebug
+ ftfntfmt
+ ftfstype
+ ftgasp
+ ftglyph
+ ftgxval
+ ftinit
+ ftlcdfil
+ ftmm
+ ftotval
+ ftpatent
+ ftpfr
+ ftstroke
+ ftsynth
+ ftsystem
+ fttype1
+ ftwinfnt
;
- Library $(FT2_LIB) : ft$(_sources).c ;
+ Library $(FT2_LIB) : $(_sources).c ;
}
# Add Macintosh-specific file to the library when necessary.
diff --git a/src/3rdparty/freetype/src/base/basepic.c b/src/3rdparty/freetype/src/base/basepic.c
index aeb6fd5777..9850ed96a4 100644
--- a/src/3rdparty/freetype/src/base/basepic.c
+++ b/src/3rdparty/freetype/src/base/basepic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for base. */
/* */
-/* Copyright 2009, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/basepic.h b/src/3rdparty/freetype/src/base/basepic.h
index 329d7c8fd6..c5d7cbf5ab 100644
--- a/src/3rdparty/freetype/src/base/basepic.h
+++ b/src/3rdparty/freetype/src/base/basepic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for base. */
/* */
-/* Copyright 2009 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,10 +20,9 @@
#define __BASEPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
+
#ifndef FT_CONFIG_OPTION_PIC
#define FT_OUTLINE_GLYPH_CLASS_GET &ft_outline_glyph_class
@@ -43,6 +42,8 @@ FT_BEGIN_HEADER
#endif
+FT_BEGIN_HEADER
+
typedef struct BasePIC_
{
FT_Module_Class** default_module_classes;
@@ -78,12 +79,12 @@ FT_BEGIN_HEADER
FT_Error
ft_base_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __BASEPIC_H__ */
diff --git a/src/3rdparty/freetype/src/base/ftadvanc.c b/src/3rdparty/freetype/src/base/ftadvanc.c
index 18884efe19..f12908f518 100644
--- a/src/3rdparty/freetype/src/base/ftadvanc.c
+++ b/src/3rdparty/freetype/src/base/ftadvanc.c
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (body). */
/* */
-/* Copyright 2008, 2009, 2011, 2013, 2014 by */
+/* Copyright 2008-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftapi.c b/src/3rdparty/freetype/src/base/ftapi.c
index 8914d1f4e9..f22a181b59 100644
--- a/src/3rdparty/freetype/src/base/ftapi.c
+++ b/src/3rdparty/freetype/src/base/ftapi.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType compatibility functions (body). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftbase.c b/src/3rdparty/freetype/src/base/ftbase.c
index 5e5d70ec4b..253dfb7236 100644
--- a/src/3rdparty/freetype/src/base/ftbase.c
+++ b/src/3rdparty/freetype/src/base/ftbase.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component (body only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftbase.h b/src/3rdparty/freetype/src/base/ftbase.h
index 51a1db18b8..e37fefa411 100644
--- a/src/3rdparty/freetype/src/base/ftbase.h
+++ b/src/3rdparty/freetype/src/base/ftbase.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private functions used in base module (specification). */
/* */
-/* Copyright 2008, 2010 by */
+/* Copyright 2008-2015 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,6 +27,11 @@
FT_BEGIN_HEADER
+ /* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
+ /* see https://support.microsoft.com/en-us/kb/130437 */
+#define FT_MAC_RFORK_MAX_LEN 0x00FFFFFFUL
+
+
/* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */
/* font, and try to load a face specified by the face_index. */
FT_LOCAL( FT_Error )
diff --git a/src/3rdparty/freetype/src/base/ftbbox.c b/src/3rdparty/freetype/src/base/ftbbox.c
index f9a17517ec..10df98de6a 100644
--- a/src/3rdparty/freetype/src/base/ftbbox.c
+++ b/src/3rdparty/freetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
/* */
/* FreeType bbox computation (body). */
/* */
-/* Copyright 1996-2002, 2004, 2006, 2010, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -255,6 +255,7 @@
FT_Pos peak = 0;
FT_Int shift;
+
/* This function finds a peak of a cubic segment if it is above 0 */
/* using iterative bisection of the segment, or returns 0. */
/* The fixed-point arithmetic of bisection is inherently stable */
@@ -264,8 +265,10 @@
/* It is called with either q2 or q3 positive, which is necessary */
/* for the peak to exist and avoids undefined FT_MSB. */
- shift = 27 -
- FT_MSB( FT_ABS( q1 ) | FT_ABS( q2 ) | FT_ABS( q3 ) | FT_ABS( q4 ) );
+ shift = 27 - FT_MSB( (FT_UInt32)( FT_ABS( q1 ) |
+ FT_ABS( q2 ) |
+ FT_ABS( q3 ) |
+ FT_ABS( q4 ) ) );
if ( shift > 0 )
{
diff --git a/src/3rdparty/freetype/src/base/ftbdf.c b/src/3rdparty/freetype/src/base/ftbdf.c
index d9dcbad5ed..aa72ddcdf9 100644
--- a/src/3rdparty/freetype/src/base/ftbdf.c
+++ b/src/3rdparty/freetype/src/base/ftbdf.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (body). */
/* */
-/* Copyright 2002-2004, 2013, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftbitmap.c b/src/3rdparty/freetype/src/base/ftbitmap.c
index 19a1a80795..a54572aaa2 100644
--- a/src/3rdparty/freetype/src/base/ftbitmap.c
+++ b/src/3rdparty/freetype/src/base/ftbitmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (body). */
/* */
-/* Copyright 2004-2009, 2011, 2013, 2014 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,6 +31,16 @@
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( void )
+ FT_Bitmap_Init( FT_Bitmap *abitmap )
+ {
+ if ( abitmap )
+ *abitmap = null_bitmap;
+ }
+
+
+ /* deprecated function name; retained for ABI compatibility */
+
+ FT_EXPORT_DEF( void )
FT_Bitmap_New( FT_Bitmap *abitmap )
{
if ( abitmap )
@@ -117,7 +127,7 @@
FT_Byte* t = target->buffer;
- t += pitch * ( target->rows - 1 );
+ t += (FT_ULong)pitch * ( target->rows - 1 );
for ( i = target->rows; i > 0; i-- )
{
@@ -160,21 +170,21 @@
{
case FT_PIXEL_MODE_MONO:
bpp = 1;
- new_pitch = ( width + xpixels + 7 ) >> 3;
+ new_pitch = (int)( ( width + xpixels + 7 ) >> 3 );
break;
case FT_PIXEL_MODE_GRAY2:
bpp = 2;
- new_pitch = ( width + xpixels + 3 ) >> 2;
+ new_pitch = (int)( ( width + xpixels + 3 ) >> 2 );
break;
case FT_PIXEL_MODE_GRAY4:
bpp = 4;
- new_pitch = ( width + xpixels + 1 ) >> 1;
+ new_pitch = (int)( ( width + xpixels + 1 ) >> 1 );
break;
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
bpp = 8;
- new_pitch = ( width + xpixels );
+ new_pitch = (int)( width + xpixels );
break;
default:
return FT_THROW( Invalid_Glyph_Format );
@@ -184,7 +194,7 @@
if ( ypixels == 0 && new_pitch <= pitch )
{
/* zero the padding */
- FT_UInt bit_width = pitch * 8;
+ FT_UInt bit_width = (FT_UInt)pitch * 8;
FT_UInt bit_last = ( width + xpixels ) * bpp;
@@ -227,8 +237,9 @@
for ( i = 0; i < bitmap->rows; i++ )
- FT_MEM_COPY( buffer + new_pitch * ( ypixels + i ),
- bitmap->buffer + pitch * i, len );
+ FT_MEM_COPY( buffer + (FT_UInt)new_pitch * ( ypixels + i ),
+ bitmap->buffer + (FT_UInt)pitch * i,
+ len );
}
else
{
@@ -236,8 +247,9 @@
for ( i = 0; i < bitmap->rows; i++ )
- FT_MEM_COPY( buffer + new_pitch * i,
- bitmap->buffer + pitch * i, len );
+ FT_MEM_COPY( buffer + (FT_UInt)new_pitch * i,
+ bitmap->buffer + (FT_UInt)pitch * i,
+ len );
}
FT_FREE( bitmap->buffer );
@@ -295,7 +307,7 @@
/* convert to 8bpp */
- FT_Bitmap_New( &tmp );
+ FT_Bitmap_Init( &tmp );
error = FT_Bitmap_Convert( library, bitmap, &tmp, 1 );
if ( error )
return error;
@@ -323,7 +335,8 @@
return FT_Err_Ok;
}
- error = ft_bitmap_assure_buffer( library->memory, bitmap, xstr, ystr );
+ error = ft_bitmap_assure_buffer( library->memory, bitmap,
+ (FT_UInt)xstr, (FT_UInt)ystr );
if ( error )
return error;
@@ -334,7 +347,7 @@
else
{
pitch = -pitch;
- p = bitmap->buffer + pitch * ( bitmap->rows - 1 );
+ p = bitmap->buffer + (FT_UInt)pitch * ( bitmap->rows - 1 );
}
/* for each row */
@@ -407,8 +420,8 @@
p += bitmap->pitch;
}
- bitmap->width += xstr;
- bitmap->rows += ystr;
+ bitmap->width += (FT_UInt)xstr;
+ bitmap->rows += (FT_UInt)ystr;
return FT_Err_Ok;
}
@@ -501,7 +514,7 @@
if ( old_target_pitch < 0 )
old_target_pitch = -old_target_pitch;
- old_size = target->rows * old_target_pitch;
+ old_size = target->rows * (FT_UInt)old_target_pitch;
target->pixel_mode = FT_PIXEL_MODE_GRAY;
target->rows = source->rows;
@@ -510,20 +523,20 @@
pad = 0;
if ( alignment > 0 )
{
- pad = source->width % alignment;
+ pad = (FT_Int)source->width % alignment;
if ( pad != 0 )
pad = alignment - pad;
}
- target_pitch = source->width + pad;
+ target_pitch = (FT_Int)source->width + pad;
- if ( target_pitch > 0 &&
- (FT_ULong)target->rows > FT_ULONG_MAX / target_pitch )
+ if ( target_pitch > 0 &&
+ (FT_ULong)target->rows > FT_ULONG_MAX / (FT_ULong)target_pitch )
return FT_THROW( Invalid_Argument );
- if ( target->rows * target_pitch > old_size &&
+ if ( target->rows * (FT_ULong)target_pitch > old_size &&
FT_QREALLOC( target->buffer,
- old_size, target->rows * target_pitch ) )
+ old_size, target->rows * (FT_UInt)target_pitch ) )
return error;
target->pitch = target->pitch < 0 ? -target_pitch : target_pitch;
@@ -539,9 +552,9 @@
/* take care of bitmap flow */
if ( source->pitch < 0 )
- s -= source->pitch * ( source->rows - 1 );
+ s -= source->pitch * (FT_Int)( source->rows - 1 );
if ( target->pitch < 0 )
- t -= target->pitch * ( target->rows - 1 );
+ t -= target->pitch * (FT_Int)( target->rows - 1 );
switch ( source->pixel_mode )
{
@@ -604,7 +617,7 @@
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
{
- FT_Int width = source->width;
+ FT_UInt width = source->width;
FT_UInt i;
@@ -756,7 +769,7 @@
FT_Error error;
- FT_Bitmap_New( &bitmap );
+ FT_Bitmap_Init( &bitmap );
error = FT_Bitmap_Copy( slot->library, &slot->bitmap, &bitmap );
if ( error )
return error;
diff --git a/src/3rdparty/freetype/src/base/ftcalc.c b/src/3rdparty/freetype/src/base/ftcalc.c
index 57f796803d..619a08b3a0 100644
--- a/src/3rdparty/freetype/src/base/ftcalc.c
+++ b/src/3rdparty/freetype/src/base/ftcalc.c
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (body). */
/* */
-/* Copyright 1996-2006, 2008, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -86,8 +86,7 @@
FT_EXPORT_DEF( FT_Fixed )
FT_RoundFix( FT_Fixed a )
{
- return a >= 0 ? ( a + 0x8000L ) & ~0xFFFFL
- : -((-a + 0x8000L ) & ~0xFFFFL );
+ return ( a + 0x8000L - ( a < 0 ) ) & ~0xFFFFL;
}
@@ -96,8 +95,7 @@
FT_EXPORT_DEF( FT_Fixed )
FT_CeilFix( FT_Fixed a )
{
- return a >= 0 ? ( a + 0xFFFFL ) & ~0xFFFFL
- : -((-a + 0xFFFFL ) & ~0xFFFFL );
+ return ( a + 0xFFFFL ) & ~0xFFFFL;
}
@@ -106,8 +104,7 @@
FT_EXPORT_DEF( FT_Fixed )
FT_FloorFix( FT_Fixed a )
{
- return a >= 0 ? a & ~0xFFFFL
- : -((-a) & ~0xFFFFL );
+ return a & ~0xFFFFL;
}
#ifndef FT_MSB
@@ -173,69 +170,77 @@
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Long )
- FT_MulDiv( FT_Long a,
- FT_Long b,
- FT_Long c )
+ FT_MulDiv( FT_Long a_,
+ FT_Long b_,
+ FT_Long c_ )
{
- FT_Int s = 1;
- FT_Long d;
+ FT_Int s = 1;
+ FT_UInt64 a, b, c, d;
+ FT_Long d_;
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
- FT_MOVE_SIGN( c, s );
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
+ FT_MOVE_SIGN( c_, s );
- d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
- : 0x7FFFFFFFL );
+ a = (FT_UInt64)a_;
+ b = (FT_UInt64)b_;
+ c = (FT_UInt64)c_;
- return s < 0 ? -d : d;
+ d = c > 0 ? ( a * b + ( c >> 1 ) ) / c
+ : 0x7FFFFFFFUL;
+
+ d_ = (FT_Long)d;
+
+ return s < 0 ? -d_ : d_;
}
/* documentation is in ftcalc.h */
FT_BASE_DEF( FT_Long )
- FT_MulDiv_No_Round( FT_Long a,
- FT_Long b,
- FT_Long c )
+ FT_MulDiv_No_Round( FT_Long a_,
+ FT_Long b_,
+ FT_Long c_ )
{
- FT_Int s = 1;
- FT_Long d;
+ FT_Int s = 1;
+ FT_UInt64 a, b, c, d;
+ FT_Long d_;
+
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
+ FT_MOVE_SIGN( c_, s );
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
- FT_MOVE_SIGN( c, s );
+ a = (FT_UInt64)a_;
+ b = (FT_UInt64)b_;
+ c = (FT_UInt64)c_;
- d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
- : 0x7FFFFFFFL );
+ d = c > 0 ? a * b / c
+ : 0x7FFFFFFFUL;
- return s < 0 ? -d : d;
+ d_ = (FT_Long)d;
+
+ return s < 0 ? -d_ : d_;
}
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b )
+ FT_MulFix( FT_Long a_,
+ FT_Long b_ )
{
#ifdef FT_MULFIX_ASSEMBLER
- return FT_MULFIX_ASSEMBLER( a, b );
+ return FT_MULFIX_ASSEMBLER( a_, b_ );
#else
- FT_Int s = 1;
- FT_Long c;
-
-
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
+ FT_Int64 ab = (FT_Int64)a_ * (FT_Int64)b_;
- c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
-
- return s < 0 ? -c : c;
+ /* this requires arithmetic right shift of signed numbers */
+ return (FT_Long)( ( ab + 0x8000L - ( ab < 0 ) ) >> 16 );
#endif /* FT_MULFIX_ASSEMBLER */
}
@@ -244,20 +249,26 @@
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Long )
- FT_DivFix( FT_Long a,
- FT_Long b )
+ FT_DivFix( FT_Long a_,
+ FT_Long b_ )
{
- FT_Int s = 1;
- FT_Long q;
+ FT_Int s = 1;
+ FT_UInt64 a, b, q;
+ FT_Long q_;
+
+
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
+ a = (FT_UInt64)a_;
+ b = (FT_UInt64)b_;
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
+ q = b > 0 ? ( ( a << 16 ) + ( b >> 1 ) ) / b
+ : 0x7FFFFFFFUL;
- q = (FT_Long)( b > 0 ? ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b
- : 0x7FFFFFFFL );
+ q_ = (FT_Long)q;
- return s < 0 ? -q : q;
+ return s < 0 ? -q_ : q_;
}
@@ -401,26 +412,29 @@
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Long )
- FT_MulDiv( FT_Long a,
- FT_Long b,
- FT_Long c )
+ FT_MulDiv( FT_Long a_,
+ FT_Long b_,
+ FT_Long c_ )
{
- FT_Int s = 1;
+ FT_Int s = 1;
+ FT_UInt32 a, b, c;
/* XXX: this function does not allow 64-bit arguments */
- if ( a == 0 || b == c )
- return a;
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
- FT_MOVE_SIGN( c, s );
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
+ FT_MOVE_SIGN( c_, s );
+
+ a = (FT_UInt32)a_;
+ b = (FT_UInt32)b_;
+ c = (FT_UInt32)c_;
if ( c == 0 )
- a = 0x7FFFFFFFL;
+ a = 0x7FFFFFFFUL;
- else if ( (FT_ULong)a + b <= 129894UL - ( c >> 17 ) )
- a = ( (FT_ULong)a * b + ( c >> 1 ) ) / c;
+ else if ( a + b <= 129894UL - ( c >> 17 ) )
+ a = ( a * b + ( c >> 1 ) ) / c;
else
{
@@ -439,30 +453,36 @@
: ft_div64by32( temp.hi, temp.lo, c );
}
- return s < 0 ? -a : a;
+ a_ = (FT_Long)a;
+
+ return s < 0 ? -a_ : a_;
}
FT_BASE_DEF( FT_Long )
- FT_MulDiv_No_Round( FT_Long a,
- FT_Long b,
- FT_Long c )
+ FT_MulDiv_No_Round( FT_Long a_,
+ FT_Long b_,
+ FT_Long c_ )
{
- FT_Int s = 1;
+ FT_Int s = 1;
+ FT_UInt32 a, b, c;
- if ( a == 0 || b == c )
- return a;
+ /* XXX: this function does not allow 64-bit arguments */
+
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
+ FT_MOVE_SIGN( c_, s );
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
- FT_MOVE_SIGN( c, s );
+ a = (FT_UInt32)a_;
+ b = (FT_UInt32)b_;
+ c = (FT_UInt32)c_;
if ( c == 0 )
- a = 0x7FFFFFFFL;
+ a = 0x7FFFFFFFUL;
- else if ( (FT_ULong)a + b <= 131071UL )
- a = (FT_ULong)a * b / c;
+ else if ( a + b <= 131071UL )
+ a = a * b / c;
else
{
@@ -476,19 +496,21 @@
: ft_div64by32( temp.hi, temp.lo, c );
}
- return s < 0 ? -a : a;
+ a_ = (FT_Long)a;
+
+ return s < 0 ? -a_ : a_;
}
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b )
+ FT_MulFix( FT_Long a_,
+ FT_Long b_ )
{
#ifdef FT_MULFIX_ASSEMBLER
- return FT_MULFIX_ASSEMBLER( a, b );
+ return FT_MULFIX_ASSEMBLER( a_, b_ );
#elif 0
@@ -499,13 +521,10 @@
* the leftmost bits by copying the sign bit, it might be faster.
*/
- FT_Long sa, sb;
- FT_ULong ua, ub;
+ FT_Long sa, sb;
+ FT_UInt32 a, b;
- if ( a == 0 || b == 0x10000L )
- return a;
-
/*
* This is a clever way of converting a signed number `a' into its
* absolute value (stored back into `a') and its sign. The sign is
@@ -524,57 +543,58 @@
* with the value 1 rather than -1. After that, everything else goes
* wrong.
*/
- sa = ( a >> ( sizeof ( a ) * 8 - 1 ) );
- a = ( a ^ sa ) - sa;
- sb = ( b >> ( sizeof ( b ) * 8 - 1 ) );
- b = ( b ^ sb ) - sb;
+ sa = ( a_ >> ( sizeof ( a_ ) * 8 - 1 ) );
+ a = ( a_ ^ sa ) - sa;
+ sb = ( b_ >> ( sizeof ( b_ ) * 8 - 1 ) );
+ b = ( b_ ^ sb ) - sb;
- ua = (FT_ULong)a;
- ub = (FT_ULong)b;
+ a = (FT_UInt32)a_;
+ b = (FT_UInt32)b_;
- if ( ua + ( ub >> 8 ) <= 8190UL )
- ua = ( ua * ub + 0x8000U ) >> 16;
+ if ( a + ( b >> 8 ) <= 8190UL )
+ a = ( a * b + 0x8000U ) >> 16;
else
{
- FT_ULong al = ua & 0xFFFFU;
+ FT_UInt32 al = a & 0xFFFFUL;
- ua = ( ua >> 16 ) * ub + al * ( ub >> 16 ) +
- ( ( al * ( ub & 0xFFFFU ) + 0x8000U ) >> 16 );
+ a = ( a >> 16 ) * b + al * ( b >> 16 ) +
+ ( ( al * ( b & 0xFFFFUL ) + 0x8000UL ) >> 16 );
}
- sa ^= sb,
- ua = (FT_ULong)(( ua ^ sa ) - sa);
+ sa ^= sb;
+ a = ( a ^ sa ) - sa;
- return (FT_Long)ua;
+ return (FT_Long)a;
#else /* 0 */
- FT_Int s = 1;
- FT_ULong ua, ub;
+ FT_Int s = 1;
+ FT_UInt32 a, b;
- if ( a == 0 || b == 0x10000L )
- return a;
+ /* XXX: this function does not allow 64-bit arguments */
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
- ua = (FT_ULong)a;
- ub = (FT_ULong)b;
+ a = (FT_UInt32)a_;
+ b = (FT_UInt32)b_;
- if ( ua + ( ub >> 8 ) <= 8190UL )
- ua = ( ua * ub + 0x8000UL ) >> 16;
+ if ( a + ( b >> 8 ) <= 8190UL )
+ a = ( a * b + 0x8000UL ) >> 16;
else
{
- FT_ULong al = ua & 0xFFFFUL;
+ FT_UInt32 al = a & 0xFFFFUL;
- ua = ( ua >> 16 ) * ub + al * ( ub >> 16 ) +
- ( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 );
+ a = ( a >> 16 ) * b + al * ( b >> 16 ) +
+ ( ( al * ( b & 0xFFFFUL ) + 0x8000UL ) >> 16 );
}
- return s < 0 ? -(FT_Long)ua : (FT_Long)ua;
+ a_ = (FT_Long)a;
+
+ return s < 0 ? -a_ : a_;
#endif /* 0 */
@@ -584,27 +604,31 @@
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Long )
- FT_DivFix( FT_Long a,
- FT_Long b )
+ FT_DivFix( FT_Long a_,
+ FT_Long b_ )
{
- FT_Int s = 1;
- FT_Long q;
+ FT_Int s = 1;
+ FT_UInt32 a, b, q;
+ FT_Long q_;
/* XXX: this function does not allow 64-bit arguments */
- FT_MOVE_SIGN( a, s );
- FT_MOVE_SIGN( b, s );
+ FT_MOVE_SIGN( a_, s );
+ FT_MOVE_SIGN( b_, s );
+
+ a = (FT_UInt32)a_;
+ b = (FT_UInt32)b_;
if ( b == 0 )
{
/* check for division by 0 */
- q = 0x7FFFFFFFL;
+ q = 0x7FFFFFFFUL;
}
- else if ( a <= 65535L - ( b >> 17 ) )
+ else if ( a <= 65535UL - ( b >> 17 ) )
{
/* compute result directly */
- q = (FT_Long)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b );
+ q = ( ( a << 16 ) + ( b >> 1 ) ) / b;
}
else
{
@@ -618,14 +642,16 @@
temp2.lo = b >> 1;
FT_Add64( &temp, &temp2, &temp );
- q = (FT_Long)ft_div64by32( temp.hi, temp.lo, b );
+ q = ft_div64by32( temp.hi, temp.lo, b );
}
- return s < 0 ? -q : q;
+ q_ = (FT_Long)q;
+
+ return s < 0 ? -q_ : q_;
}
-#endif /* FT_LONG64 */
+#endif /* !FT_LONG64 */
/* documentation is in ftglyph.h */
@@ -732,6 +758,102 @@
}
+ /* documentation is in ftcalc.h */
+
+ FT_BASE_DEF( FT_UInt32 )
+ FT_Vector_NormLen( FT_Vector* vector )
+ {
+ FT_Int32 x_ = vector->x;
+ FT_Int32 y_ = vector->y;
+ FT_Int32 b, z;
+ FT_UInt32 x, y, u, v, l;
+ FT_Int sx = 1, sy = 1, shift;
+
+
+ FT_MOVE_SIGN( x_, sx );
+ FT_MOVE_SIGN( y_, sy );
+
+ x = (FT_UInt32)x_;
+ y = (FT_UInt32)y_;
+
+ /* trivial cases */
+ if ( x == 0 )
+ {
+ if ( y > 0 )
+ vector->y = sy * 0x10000;
+ return y;
+ }
+ else if ( y == 0 )
+ {
+ if ( x > 0 )
+ vector->x = sx * 0x10000;
+ return x;
+ }
+
+ /* Estimate length and prenormalize by shifting so that */
+ /* the new approximate length is between 2/3 and 4/3. */
+ /* The magic constant 0xAAAAAAAAUL (2/3 of 2^32) helps */
+ /* achieve this in 16.16 fixed-point representation. */
+ l = x > y ? x + ( y >> 1 )
+ : y + ( x >> 1 );
+
+ shift = 31 - FT_MSB( l );
+ shift -= 15 + ( l >= ( 0xAAAAAAAAUL >> shift ) );
+
+ if ( shift > 0 )
+ {
+ x <<= shift;
+ y <<= shift;
+
+ /* re-estimate length for tiny vectors */
+ l = x > y ? x + ( y >> 1 )
+ : y + ( x >> 1 );
+ }
+ else
+ {
+ x >>= -shift;
+ y >>= -shift;
+ l >>= -shift;
+ }
+
+ /* lower linear approximation for reciprocal length minus one */
+ b = 0x10000 - (FT_Int32)l;
+
+ x_ = (FT_Int32)x;
+ y_ = (FT_Int32)y;
+
+ /* Newton's iterations */
+ do
+ {
+ u = (FT_UInt32)( x_ + ( x_ * b >> 16 ) );
+ v = (FT_UInt32)( y_ + ( y_ * b >> 16 ) );
+
+ /* Normalized squared length in the parentheses approaches 2^32. */
+ /* On two's complement systems, converting to signed gives the */
+ /* difference with 2^32 even if the expression wraps around. */
+ z = -(FT_Int32)( u * u + v * v ) / 0x200;
+ z = z * ( ( 0x10000 + b ) >> 8 ) / 0x10000;
+
+ b += z;
+
+ } while ( z > 0 );
+
+ vector->x = sx < 0 ? -(FT_Pos)u : (FT_Pos)u;
+ vector->y = sy < 0 ? -(FT_Pos)v : (FT_Pos)v;
+
+ /* Conversion to signed helps to recover from likely wrap around */
+ /* in calculating the prenormalized length, because it gives the */
+ /* correct difference with 2^32 on two's complement systems. */
+ l = (FT_UInt32)( 0x10000 + (FT_Int32)( u * x + v * y ) / 0x10000 );
+ if ( shift > 0 )
+ l = ( l + ( 1 << ( shift - 1 ) ) ) >> shift;
+ else
+ l <<= -shift;
+
+ return l;
+ }
+
+
#if 0
/* documentation is in ftcalc.h */
@@ -748,7 +870,7 @@
if ( x > 0 )
{
rem_hi = 0;
- rem_lo = x;
+ rem_lo = (FT_UInt32)x;
count = 24;
do
{
@@ -779,58 +901,40 @@
FT_Pos out_x,
FT_Pos out_y )
{
- FT_Long result; /* avoid overflow on 16-bit system */
-
-
- /* deal with the trivial cases quickly */
- if ( in_y == 0 )
- {
- if ( in_x >= 0 )
- result = out_y;
- else
- result = -out_y;
- }
- else if ( in_x == 0 )
- {
- if ( in_y >= 0 )
- result = -out_x;
- else
- result = out_x;
- }
- else if ( out_y == 0 )
- {
- if ( out_x >= 0 )
- result = in_y;
- else
- result = -in_y;
- }
- else if ( out_x == 0 )
- {
- if ( out_y >= 0 )
- result = -in_x;
- else
- result = in_x;
- }
- else /* general case */
- {
#ifdef FT_LONG64
- FT_Int64 delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;
+ FT_Int64 delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;
- if ( delta == 0 )
- result = 0;
- else
- result = 1 - 2 * ( delta < 0 );
+ return ( delta > 0 ) - ( delta < 0 );
#else
+ FT_Int result;
+
+
+ if ( (FT_ULong)FT_ABS( in_x ) + (FT_ULong)FT_ABS( out_y ) <= 131071UL &&
+ (FT_ULong)FT_ABS( in_y ) + (FT_ULong)FT_ABS( out_x ) <= 131071UL )
+ {
+ FT_Long z1 = in_x * out_y;
+ FT_Long z2 = in_y * out_x;
+
+
+ if ( z1 > z2 )
+ result = +1;
+ else if ( z1 < z2 )
+ result = -1;
+ else
+ result = 0;
+ }
+ else /* products might overflow 32 bits */
+ {
FT_Int64 z1, z2;
/* XXX: this function does not allow 64-bit arguments */
- ft_multo64( (FT_Int32)in_x, (FT_Int32)out_y, &z1 );
- ft_multo64( (FT_Int32)in_y, (FT_Int32)out_x, &z2 );
+ ft_multo64( (FT_UInt32)in_x, (FT_UInt32)out_y, &z1 );
+ ft_multo64( (FT_UInt32)in_y, (FT_UInt32)out_x, &z2 );
if ( z1.hi > z2.hi )
result = +1;
@@ -842,12 +946,12 @@
result = -1;
else
result = 0;
-
-#endif
}
/* XXX: only the sign of return value, +1/0/-1 must be used */
- return (FT_Int)result;
+ return result;
+
+#endif
}
diff --git a/src/3rdparty/freetype/src/base/ftcid.c b/src/3rdparty/freetype/src/base/ftcid.c
index 741879d922..0734881b71 100644
--- a/src/3rdparty/freetype/src/base/ftcid.c
+++ b/src/3rdparty/freetype/src/base/ftcid.c
@@ -4,7 +4,8 @@
/* */
/* FreeType API for accessing CID font information. */
/* */
-/* Copyright 2007, 2009, 2013 by Derek Clegg, Michael Toftdal. */
+/* Copyright 2007-2015 by */
+/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
diff --git a/src/3rdparty/freetype/src/base/ftdbgmem.c b/src/3rdparty/freetype/src/base/ftdbgmem.c
index 6fb86fe77d..6f20313b34 100644
--- a/src/3rdparty/freetype/src/base/ftdbgmem.c
+++ b/src/3rdparty/freetype/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
/* */
/* Memory debugger (body). */
/* */
-/* Copyright 2001-2006, 2009, 2013 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -35,7 +35,7 @@
#include FT_CONFIG_STANDARD_LIBRARY_H
- FT_BASE_DEF( const char* ) _ft_debug_file = 0;
+ FT_BASE_DEF( const char* ) _ft_debug_file = NULL;
FT_BASE_DEF( long ) _ft_debug_lineno = 0;
extern void
@@ -47,7 +47,7 @@
typedef struct FT_MemTableRec_* FT_MemTable;
-#define FT_MEM_VAL( addr ) ((FT_PtrDist)(FT_Pointer)( addr ))
+#define FT_MEM_VAL( addr ) ( (FT_PtrDist)(FT_Pointer)( addr ) )
/*
* This structure holds statistics for a single allocation/release
@@ -76,7 +76,7 @@
/*
- * We don't need a resizable array for the memory sources, because
+ * We don't need a resizable array for the memory sources because
* their number is pretty limited within FreeType.
*/
#define FT_MEM_SOURCE_BUCKETS 128
@@ -85,8 +85,8 @@
* This structure holds information related to a single allocated
* memory block. If KEEPALIVE is defined, blocks that are freed by
* FreeType are never released to the system. Instead, their `size'
- * field is set to -size. This is mainly useful to detect double frees,
- * at the price of large memory footprint during execution.
+ * field is set to `-size'. This is mainly useful to detect double
+ * frees, at the price of a large memory footprint during execution.
*/
typedef struct FT_MemNodeRec_
{
@@ -111,20 +111,20 @@
*/
typedef struct FT_MemTableRec_
{
- FT_ULong size;
- FT_ULong nodes;
+ FT_Long size;
+ FT_Long nodes;
FT_MemNode* buckets;
- FT_ULong alloc_total;
- FT_ULong alloc_current;
- FT_ULong alloc_max;
- FT_ULong alloc_count;
+ FT_Long alloc_total;
+ FT_Long alloc_current;
+ FT_Long alloc_max;
+ FT_Long alloc_count;
FT_Bool bound_total;
- FT_ULong alloc_total_max;
+ FT_Long alloc_total_max;
FT_Bool bound_count;
- FT_ULong alloc_count_max;
+ FT_Long alloc_count_max;
FT_MemSource sources[FT_MEM_SOURCE_BUCKETS];
@@ -142,14 +142,14 @@
#define FT_MEM_SIZE_MIN 7
#define FT_MEM_SIZE_MAX 13845163
-#define FT_FILENAME( x ) ((x) ? (x) : "unknown file")
+#define FT_FILENAME( x ) ( (x) ? (x) : "unknown file" )
/*
* Prime numbers are ugly to handle. It would be better to implement
* L-Hashing, which is 10% faster and doesn't require divisions.
*/
- static const FT_UInt ft_mem_primes[] =
+ static const FT_Int ft_mem_primes[] =
{
7,
11,
@@ -189,10 +189,10 @@
};
- static FT_ULong
- ft_mem_closest_prime( FT_ULong num )
+ static FT_Long
+ ft_mem_closest_prime( FT_Long num )
{
- FT_UInt i;
+ size_t i;
for ( i = 0;
@@ -204,7 +204,7 @@
}
- extern void
+ static void
ft_mem_debug_panic( const char* fmt,
... )
{
@@ -254,19 +254,20 @@
static void
ft_mem_table_resize( FT_MemTable table )
{
- FT_ULong new_size;
+ FT_Long new_size;
new_size = ft_mem_closest_prime( table->nodes );
if ( new_size != table->size )
{
FT_MemNode* new_buckets;
- FT_ULong i;
+ FT_Long i;
new_buckets = (FT_MemNode *)
- ft_mem_table_alloc( table,
- new_size * sizeof ( FT_MemNode ) );
+ ft_mem_table_alloc(
+ table,
+ new_size * (FT_Long)sizeof ( FT_MemNode ) );
if ( new_buckets == NULL )
return;
@@ -282,7 +283,7 @@
while ( node )
{
next = node->link;
- hash = FT_MEM_VAL( node->address ) % new_size;
+ hash = FT_MEM_VAL( node->address ) % (FT_PtrDist)new_size;
pnode = new_buckets + hash;
node->link = pnode[0];
@@ -325,8 +326,9 @@
table->free = memory->free;
table->buckets = (FT_MemNode *)
- memory->alloc( memory,
- table->size * sizeof ( FT_MemNode ) );
+ memory->alloc(
+ memory,
+ table->size * (FT_Long)sizeof ( FT_MemNode ) );
if ( table->buckets )
FT_ARRAY_ZERO( table->buckets, table->size );
else
@@ -343,9 +345,9 @@
static void
ft_mem_table_destroy( FT_MemTable table )
{
- FT_ULong i;
- FT_Long leak_count = 0;
- FT_ULong leaks = 0;
+ FT_Long i;
+ FT_Long leak_count = 0;
+ FT_Long leaks = 0;
FT_DumpMemory( table->memory );
@@ -359,7 +361,7 @@
while ( node )
{
next = node->link;
- node->link = 0;
+ node->link = NULL;
if ( node->size > 0 )
{
@@ -381,7 +383,7 @@
ft_mem_table_free( table, node );
node = next;
}
- table->buckets[i] = 0;
+ table->buckets[i] = NULL;
}
ft_mem_table_free( table, table->buckets );
@@ -430,7 +432,7 @@
hash = FT_MEM_VAL( address );
- pnode = table->buckets + ( hash % table->size );
+ pnode = table->buckets + ( hash % (FT_PtrDist)table->size );
for (;;)
{
@@ -466,8 +468,8 @@
if ( node == NULL )
break;
- if ( node->file_name == _ft_debug_file &&
- node->line_no == _ft_debug_lineno )
+ if ( node->file_name == _ft_debug_file &&
+ node->line_no == _ft_debug_lineno )
goto Exit;
pnode = &node->link;
@@ -485,11 +487,11 @@
node->max_blocks = 0;
node->all_blocks = 0;
- node->cur_size = 0;
- node->max_size = 0;
- node->all_size = 0;
+ node->cur_size = 0;
+ node->max_size = 0;
+ node->all_size = 0;
- node->cur_max = 0;
+ node->cur_max = 0;
node->link = NULL;
node->hash = hash;
@@ -503,7 +505,7 @@
static void
ft_mem_table_set( FT_MemTable table,
FT_Byte* address,
- FT_ULong size,
+ FT_Long size,
FT_Long delta )
{
FT_MemNode *pnode, node;
@@ -558,7 +560,7 @@
source->max_blocks = source->cur_blocks;
}
- if ( size > (FT_ULong)source->cur_max )
+ if ( size > source->cur_max )
source->cur_max = size;
if ( delta != 0 )
@@ -671,7 +673,7 @@
}
- extern FT_Pointer
+ static FT_Pointer
ft_mem_debug_alloc( FT_Memory memory,
FT_Long size )
{
@@ -688,14 +690,14 @@
return NULL;
/* return NULL if this allocation would overflow the maximum heap size */
- if ( table->bound_total &&
- table->alloc_total_max - table->alloc_current > (FT_ULong)size )
+ if ( table->bound_total &&
+ table->alloc_total_max - table->alloc_current > size )
return NULL;
block = (FT_Byte *)ft_mem_table_alloc( table, size );
if ( block )
{
- ft_mem_table_set( table, block, (FT_ULong)size, 0 );
+ ft_mem_table_set( table, block, size, 0 );
table->alloc_count++;
}
@@ -707,7 +709,7 @@
}
- extern void
+ static void
ft_mem_debug_free( FT_Memory memory,
FT_Pointer block )
{
@@ -731,7 +733,7 @@
}
- extern FT_Pointer
+ static FT_Pointer
ft_mem_debug_realloc( FT_Memory memory,
FT_Long cur_size,
FT_Long new_size,
@@ -787,21 +789,22 @@
table->alloc_count >= table->alloc_count_max )
return NULL;
- delta = (FT_Long)( new_size - cur_size );
+ delta = new_size - cur_size;
/* return NULL if this allocation would overflow the maximum heap size */
- if ( delta > 0 &&
- table->bound_total &&
- table->alloc_current + (FT_ULong)delta > table->alloc_total_max )
+ if ( delta > 0 &&
+ table->bound_total &&
+ table->alloc_current + delta > table->alloc_total_max )
return NULL;
- new_block = (FT_Byte *)ft_mem_table_alloc( table, new_size );
+ new_block = (FT_Pointer)ft_mem_table_alloc( table, new_size );
if ( new_block == NULL )
return NULL;
ft_mem_table_set( table, (FT_Byte*)new_block, new_size, delta );
- ft_memcpy( new_block, block, cur_size < new_size ? cur_size : new_size );
+ ft_memcpy( new_block, block, cur_size < new_size ? (size_t)cur_size
+ : (size_t)new_size );
ft_mem_table_remove( table, (FT_Byte*)block, delta );
@@ -844,7 +847,7 @@
if ( total_max > 0 )
{
table->bound_total = 1;
- table->alloc_total_max = (FT_ULong)total_max;
+ table->alloc_total_max = total_max;
}
}
@@ -857,7 +860,7 @@
if ( total_count > 0 )
{
table->bound_count = 1;
- table->alloc_count_max = (FT_ULong)total_count;
+ table->alloc_count_max = total_count;
}
}
@@ -896,7 +899,6 @@
}
-
static int
ft_mem_source_compare( const void* p1,
const void* p2 )
@@ -925,7 +927,7 @@
FT_MemSource* bucket = table->sources;
FT_MemSource* limit = bucket + FT_MEM_SOURCE_BUCKETS;
FT_MemSource* sources;
- FT_UInt nn, count;
+ FT_Int nn, count;
const char* fmt;
@@ -939,8 +941,9 @@
count++;
}
- sources = (FT_MemSource*)ft_mem_table_alloc(
- table, sizeof ( *sources ) * count );
+ sources = (FT_MemSource*)
+ ft_mem_table_alloc(
+ table, count * (FT_Long)sizeof ( *sources ) );
count = 0;
for ( bucket = table->sources; bucket < limit; bucket++ )
@@ -952,7 +955,10 @@
sources[count++] = source;
}
- ft_qsort( sources, count, sizeof ( *sources ), ft_mem_source_compare );
+ ft_qsort( sources,
+ (size_t)count,
+ sizeof ( *sources ),
+ ft_mem_source_compare );
printf( "FreeType Memory Dump: "
"current=%ld max=%ld total=%ld count=%ld\n",
diff --git a/src/3rdparty/freetype/src/base/ftdebug.c b/src/3rdparty/freetype/src/base/ftdebug.c
index 39ac6add05..03e18a8699 100644
--- a/src/3rdparty/freetype/src/base/ftdebug.c
+++ b/src/3rdparty/freetype/src/base/ftdebug.c
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (body). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2008, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -152,8 +152,8 @@
/* the memory and stream components which are set to 7 and 5, */
/* respectively. */
/* */
- /* See the file <include/internal/fttrace.h> for details of the */
- /* available toggle names. */
+ /* See the file `include/freetype/internal/fttrace.h' for details of */
+ /* the available toggle names. */
/* */
/* The level must be between 0 and 7; 0 means quiet (except for serious */
/* runtime errors), and 7 means _very_ verbose. */
diff --git a/src/3rdparty/freetype/src/base/ftfntfmt.c b/src/3rdparty/freetype/src/base/ftfntfmt.c
new file mode 100644
index 0000000000..98e7431a2b
--- /dev/null
+++ b/src/3rdparty/freetype/src/base/ftfntfmt.c
@@ -0,0 +1,55 @@
+/***************************************************************************/
+/* */
+/* ftfntfmt.c */
+/* */
+/* FreeType utility file for font formats (body). */
+/* */
+/* Copyright 2002-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_FONT_FORMATS_H
+#include FT_INTERNAL_OBJECTS_H
+#include FT_SERVICE_FONT_FORMAT_H
+
+
+ /* documentation is in ftfntfmt.h */
+
+ FT_EXPORT_DEF( const char* )
+ FT_Get_Font_Format( FT_Face face )
+ {
+ const char* result = NULL;
+
+
+ if ( face )
+ FT_FACE_FIND_SERVICE( face, result, FONT_FORMAT );
+
+ return result;
+ }
+
+
+ /* deprecated function name; retained for ABI compatibility */
+
+ FT_EXPORT_DEF( const char* )
+ FT_Get_X11_Font_Format( FT_Face face )
+ {
+ const char* result = NULL;
+
+
+ if ( face )
+ FT_FACE_FIND_SERVICE( face, result, FONT_FORMAT );
+
+ return result;
+ }
+
+
+/* END */
diff --git a/src/3rdparty/freetype/src/base/ftfstype.c b/src/3rdparty/freetype/src/base/ftfstype.c
index 6b49ef8371..cd3458f73e 100644
--- a/src/3rdparty/freetype/src/base/ftfstype.c
+++ b/src/3rdparty/freetype/src/base/ftfstype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file to access FSType data (body). */
/* */
-/* Copyright 2008, 2009, 2014 by */
+/* Copyright 2008-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftgasp.c b/src/3rdparty/freetype/src/base/ftgasp.c
index 8485d29259..bbd257c479 100644
--- a/src/3rdparty/freetype/src/base/ftgasp.c
+++ b/src/3rdparty/freetype/src/base/ftgasp.c
@@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (body). */
/* */
-/* Copyright 2007 by */
+/* Copyright 2007-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftgloadr.c b/src/3rdparty/freetype/src/base/ftgloadr.c
index 3cc5c7a805..7e28638b27 100644
--- a/src/3rdparty/freetype/src/base/ftgloadr.c
+++ b/src/3rdparty/freetype/src/base/ftgloadr.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (body). */
/* */
-/* Copyright 2002-2006, 2010, 2013 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -212,7 +212,8 @@
/* check points & tags */
- new_max = base->n_points + current->n_points + n_points;
+ new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points +
+ n_points;
old_max = loader->max_points;
if ( new_max > old_max )
@@ -245,7 +246,7 @@
/* check contours */
old_max = loader->max_contours;
- new_max = base->n_contours + current->n_contours +
+ new_max = (FT_UInt)base->n_contours + (FT_UInt)current->n_contours +
n_contours;
if ( new_max > old_max )
{
@@ -329,9 +330,9 @@
FT_GlyphLoad base;
FT_GlyphLoad current;
- FT_UInt n_curr_contours;
- FT_UInt n_base_points;
- FT_UInt n;
+ FT_Int n_curr_contours;
+ FT_Int n_base_points;
+ FT_Int n;
if ( !loader )
@@ -365,8 +366,8 @@
FT_GlyphLoader source )
{
FT_Error error;
- FT_UInt num_points = source->base.outline.n_points;
- FT_UInt num_contours = source->base.outline.n_contours;
+ FT_UInt num_points = (FT_UInt)source->base.outline.n_points;
+ FT_UInt num_contours = (FT_UInt)source->base.outline.n_contours;
error = FT_GlyphLoader_CheckPoints( target, num_points, num_contours );
diff --git a/src/3rdparty/freetype/src/base/ftglyph.c b/src/3rdparty/freetype/src/base/ftglyph.c
index ac178c41be..cb7fc37787 100644
--- a/src/3rdparty/freetype/src/base/ftglyph.c
+++ b/src/3rdparty/freetype/src/base/ftglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (body). */
/* */
-/* Copyright 1996-2005, 2007, 2008, 2010, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -82,7 +82,7 @@
}
else
{
- FT_Bitmap_New( &glyph->bitmap );
+ FT_Bitmap_Init( &glyph->bitmap );
error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
}
@@ -126,9 +126,9 @@
cbox->xMin = glyph->left << 6;
- cbox->xMax = cbox->xMin + ( glyph->bitmap.width << 6 );
+ cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width << 6 );
cbox->yMax = glyph->top << 6;
- cbox->yMin = cbox->yMax - ( glyph->bitmap.rows << 6 );
+ cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows << 6 );
}
@@ -173,7 +173,9 @@
}
/* allocate new outline */
- error = FT_Outline_New( library, source->n_points, source->n_contours,
+ error = FT_Outline_New( library,
+ (FT_UInt)source->n_points,
+ source->n_contours,
&glyph->outline );
if ( error )
goto Exit;
@@ -205,8 +207,10 @@
FT_Library library = FT_GLYPH( source )->library;
- error = FT_Outline_New( library, source->outline.n_points,
- source->outline.n_contours, &target->outline );
+ error = FT_Outline_New( library,
+ (FT_UInt)source->outline.n_points,
+ source->outline.n_contours,
+ &target->outline );
if ( !error )
FT_Outline_Copy( &source->outline, &target->outline );
@@ -287,7 +291,7 @@
FT_Glyph glyph = NULL;
- *aglyph = 0;
+ *aglyph = NULL;
if ( !FT_ALLOC( glyph, clazz->glyph_size ) )
{
diff --git a/src/3rdparty/freetype/src/base/ftgxval.c b/src/3rdparty/freetype/src/base/ftgxval.c
index a65f4c879b..58868f2e86 100644
--- a/src/3rdparty/freetype/src/base/ftgxval.c
+++ b/src/3rdparty/freetype/src/base/ftgxval.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTyepGX/AAT tables (body). */
/* */
-/* Copyright 2004-2006, 2010, 2013, 2014 by */
+/* Copyright 2004-2015 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/src/3rdparty/freetype/src/base/ftinit.c b/src/3rdparty/freetype/src/base/ftinit.c
index c4c88201a1..b65a91d06c 100644
--- a/src/3rdparty/freetype/src/base/ftinit.c
+++ b/src/3rdparty/freetype/src/base/ftinit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType initialization layer (body). */
/* */
-/* Copyright 1996-2002, 2005, 2007, 2009, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,8 +23,8 @@
/* FT_Add_Default_Modules(): */
/* This function is used to add the set of default modules to a */
/* fresh new library object. The set is taken from the header file */
- /* `config/ftmodule.h'. See the document `FreeType 2.0 Build */
- /* System' for more information. */
+ /* `freetype/config/ftmodule.h'. See the document `FreeType 2.0 */
+ /* Build System' for more information. */
/* */
/* FT_Init_FreeType(): */
/* This function creates a system object for the current platform, */
@@ -138,7 +138,7 @@
#include FT_CONFIG_MODULES_H
FT_FREE( classes );
- pic_container->default_module_classes = 0;
+ pic_container->default_module_classes = NULL;
}
@@ -164,7 +164,7 @@
memory = library->memory;
- pic_container->default_module_classes = 0;
+ pic_container->default_module_classes = NULL;
if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) *
( FT_NUM_MODULE_CLASSES + 1 ) ) )
@@ -172,8 +172,8 @@
/* initialize all pointers to 0, especially the last one */
for ( i = 0; i < FT_NUM_MODULE_CLASSES; i++ )
- classes[i] = 0;
- classes[FT_NUM_MODULE_CLASSES] = 0;
+ classes[i] = NULL;
+ classes[FT_NUM_MODULE_CLASSES] = NULL;
i = 0;
diff --git a/src/3rdparty/freetype/src/base/ftlcdfil.c b/src/3rdparty/freetype/src/base/ftlcdfil.c
index d8bcbbf1d2..ff6f7e98ce 100644
--- a/src/3rdparty/freetype/src/base/ftlcdfil.c
+++ b/src/3rdparty/freetype/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
/* */
-/* Copyright 2006, 2008-2010, 2013, 2014 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,7 +48,7 @@
/* take care of bitmap flow */
if ( bitmap->pitch < 0 )
- line -= bitmap->pitch * ( bitmap->rows - 1 );
+ line -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
/* `fir' and `pix' must be at least 32 bit wide, since the sum of */
/* the values in `weights' can exceed 0xFF */
@@ -112,7 +112,7 @@
/* take care of bitmap flow */
if ( bitmap->pitch < 0 )
- column -= bitmap->pitch * ( bitmap->rows - 1 );
+ column -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
for ( ; width > 0; width--, column++ )
{
@@ -182,7 +182,7 @@
FT_UInt height = (FT_UInt)bitmap->rows;
FT_Int pitch = bitmap->pitch;
- static const int filters[3][3] =
+ static const unsigned int filters[3][3] =
{
{ 65538 * 9/13, 65538 * 1/6, 65538 * 1/13 },
{ 65538 * 3/13, 65538 * 4/6, 65538 * 3/13 },
@@ -200,7 +200,7 @@
/* take care of bitmap flow */
if ( bitmap->pitch < 0 )
- line -= bitmap->pitch * ( bitmap->rows - 1 );
+ line -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
for ( ; height > 0; height--, line += pitch )
{
@@ -243,12 +243,12 @@
/* take care of bitmap flow */
if ( bitmap->pitch < 0 )
- column -= bitmap->pitch * ( bitmap->rows - 1 );
+ column -= bitmap->pitch * (FT_Int)( bitmap->rows - 1 );
for ( ; width > 0; width--, column++ )
{
FT_Byte* col = column;
- FT_Byte* col_end = col + height * pitch;
+ FT_Byte* col_end = col + (FT_Int)height * pitch;
for ( ; col < col_end; col += 3 * pitch )
diff --git a/src/3rdparty/freetype/src/base/ftmac.c b/src/3rdparty/freetype/src/base/ftmac.c
index 5301ab44fc..114bbb6391 100644
--- a/src/3rdparty/freetype/src/base/ftmac.c
+++ b/src/3rdparty/freetype/src/base/ftmac.c
@@ -8,7 +8,7 @@
/* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
/* classic platforms built by MPW. */
/* */
-/* Copyright 1996-2009, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -618,11 +618,11 @@
total_size += 6; /* code + 4 bytes chunk length */
}
- total_size += GetHandleSize( post_data ) - 2;
+ total_size += (FT_ULong)GetHandleSize( post_data ) - 2;
last_code = code;
- /* detect integer overflows */
- if ( total_size < old_total_size )
+ /* detect resource fork overflow */
+ if ( FT_MAC_RFORK_MAX_LEN < total_size )
{
error = FT_THROW( Array_Too_Large );
goto Error;
@@ -747,6 +747,11 @@
return FT_THROW( Invalid_Handle );
sfnt_size = (FT_ULong)GetHandleSize( sfnt );
+
+ /* detect resource fork overflow */
+ if ( FT_MAC_RFORK_MAX_LEN < sfnt_size )
+ return FT_THROW( Array_Too_Large );
+
if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
{
ReleaseResource( sfnt );
diff --git a/src/3rdparty/freetype/src/base/ftmm.c b/src/3rdparty/freetype/src/base/ftmm.c
index 056680bd60..7c012aa438 100644
--- a/src/3rdparty/freetype/src/base/ftmm.c
+++ b/src/3rdparty/freetype/src/base/ftmm.c
@@ -4,7 +4,7 @@
/* */
/* Multiple Master font support (body). */
/* */
-/* Copyright 1996-2001, 2003, 2004, 2009, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftobjs.c b/src/3rdparty/freetype/src/base/ftobjs.c
index ee15a016c7..f0c2e77fcc 100644
--- a/src/3rdparty/freetype/src/base/ftobjs.c
+++ b/src/3rdparty/freetype/src/base/ftobjs.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -158,7 +158,7 @@
FT_Stream stream = NULL;
- *astream = 0;
+ *astream = NULL;
if ( !library )
return FT_THROW( Invalid_Library_Handle );
@@ -178,7 +178,7 @@
/* create a memory-based stream */
FT_Stream_OpenMemory( stream,
(const FT_Byte*)args->memory_base,
- args->memory_size );
+ (FT_ULong)args->memory_size );
}
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
@@ -353,10 +353,10 @@
slot->bitmap_left = 0;
slot->bitmap_top = 0;
slot->num_subglyphs = 0;
- slot->subglyphs = 0;
- slot->control_data = 0;
+ slot->subglyphs = NULL;
+ slot->control_data = NULL;
slot->control_len = 0;
- slot->other = 0;
+ slot->other = NULL;
slot->format = FT_GLYPH_FORMAT_NONE;
slot->linearHoriAdvance = 0;
@@ -387,7 +387,7 @@
if ( FT_DRIVER_USES_OUTLINES( driver ) )
{
FT_GlyphLoader_Done( slot->internal->loader );
- slot->internal->loader = 0;
+ slot->internal->loader = NULL;
}
FT_FREE( slot->internal );
@@ -438,7 +438,7 @@
*aslot = slot;
}
else if ( aslot )
- *aslot = 0;
+ *aslot = NULL;
Exit:
@@ -932,7 +932,7 @@
(FT_List_Destructor)destroy_size,
memory,
driver );
- face->size = 0;
+ face->size = NULL;
/* now discard client data */
if ( face->generic.finalizer )
@@ -950,7 +950,7 @@
face->stream,
( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
- face->stream = 0;
+ face->stream = NULL;
/* get rid of it */
if ( face->internal )
@@ -968,10 +968,6 @@
(FT_List_Destructor)destroy_face,
driver->root.memory,
driver );
-
- /* check whether we need to drop the driver's glyph loader */
- if ( FT_DRIVER_USES_OUTLINES( driver ) )
- FT_GlyphLoader_Done( driver->glyph_loader );
}
@@ -1157,7 +1153,7 @@
int i;
- face->internal->incremental_interface = 0;
+ face->internal->incremental_interface = NULL;
for ( i = 0; i < num_params && !face->internal->incremental_interface;
i++ )
if ( params[i].tag == FT_PARAM_TAG_INCREMENTAL )
@@ -1199,7 +1195,7 @@
clazz->done_face( face );
FT_FREE( internal );
FT_FREE( face );
- *aface = 0;
+ *aface = NULL;
}
return error;
@@ -1302,8 +1298,8 @@
FT_FREE( stream->base );
stream->size = 0;
- stream->base = 0;
- stream->close = 0;
+ stream->base = NULL;
+ stream->close = NULL;
}
@@ -1327,7 +1323,7 @@
if ( !base )
return FT_THROW( Invalid_Argument );
- *astream = 0;
+ *astream = NULL;
memory = library->memory;
if ( FT_NEW( stream ) )
goto Exit;
@@ -1379,13 +1375,13 @@
}
#ifdef FT_MACINTOSH
- /* At this point, face_index has served its purpose; */
+ /* At this point, the face index has served its purpose; */
/* whoever calls this function has already used it to */
/* locate the correct font data. We should not propagate */
/* this index to FT_Open_Face() (unless it is negative). */
if ( face_index > 0 )
- face_index = 0;
+ face_index &= 0x7FFF0000L; /* retain GX data */
#endif
error = FT_Open_Face( library, &args, face_index, aface );
@@ -1491,7 +1487,7 @@
FT_Error error;
FT_Memory memory = library->memory;
FT_ULong offset, length;
- FT_Long pos;
+ FT_ULong pos;
FT_Bool is_sfnt_cid;
FT_Byte* sfnt_ps = NULL;
@@ -1499,7 +1495,11 @@
FT_UNUSED( params );
- pos = FT_Stream_Pos( stream );
+ /* ignore GX stuff */
+ if ( face_index > 0 )
+ face_index &= 0xFFFFL;
+
+ pos = FT_STREAM_POS();
error = ft_lookup_PS_in_sfnt_stream( stream,
face_index,
@@ -1516,8 +1516,10 @@
goto Exit;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_ps, length );
- if ( error )
+ if ( error ) {
+ FT_FREE( sfnt_ps );
goto Exit;
+ }
error = open_face_from_buffer( library,
sfnt_ps,
@@ -1577,7 +1579,7 @@
pfb_len = 0;
for ( i = 0; i < resource_cnt; ++i )
{
- error = FT_Stream_Seek( stream, offsets[i] );
+ error = FT_Stream_Seek( stream, (FT_ULong)offsets[i] );
if ( error )
goto Exit;
if ( FT_READ_ULONG( temp ) )
@@ -1586,12 +1588,14 @@
/* FT2 allocator takes signed long buffer length,
* too large value causing overflow should be checked
*/
- FT_TRACE4(( " POST fragment #%d: length=0x%08x\n",
- i, temp));
- if ( 0x7FFFFFFFUL < temp || pfb_len + temp + 6 < pfb_len )
+ FT_TRACE4(( " POST fragment #%d: length=0x%08x"
+ " total pfb_len=0x%08x\n",
+ i, temp, pfb_len + temp + 6));
+ if ( FT_MAC_RFORK_MAX_LEN < temp ||
+ FT_MAC_RFORK_MAX_LEN - temp < pfb_len + 6 )
{
- FT_TRACE2(( " too long fragment length makes"
- " pfb_len confused: temp=0x%08x\n", temp ));
+ FT_TRACE2(( " MacOS resource length cannot exceed"
+ " 0x%08x\n", FT_MAC_RFORK_MAX_LEN ));
error = FT_THROW( Invalid_Offset );
goto Exit;
}
@@ -1624,7 +1628,7 @@
type = 1;
for ( i = 0; i < resource_cnt; ++i )
{
- error = FT_Stream_Seek( stream, offsets[i] );
+ error = FT_Stream_Seek( stream, (FT_ULong)offsets[i] );
if ( error )
goto Exit2;
if ( FT_READ_ULONG( rlen ) )
@@ -1664,7 +1668,7 @@
else
{
FT_TRACE3(( " Write POST fragment #%d header (4-byte) to buffer"
- " 0x%p + 0x%08x\n", i, pfb_data, pfb_lenpos ));
+ " %p + 0x%08x\n", i, pfb_data, pfb_lenpos ));
if ( pfb_lenpos + 3 > pfb_len + 2 )
goto Exit2;
pfb_data[pfb_lenpos ] = (FT_Byte)( len );
@@ -1676,7 +1680,7 @@
break;
FT_TRACE3(( " Write POST fragment #%d header (6-byte) to buffer"
- " 0x%p + 0x%08x\n", i, pfb_data, pfb_pos ));
+ " %p + 0x%08x\n", i, pfb_data, pfb_pos ));
if ( pfb_pos + 6 > pfb_len + 2 )
goto Exit2;
pfb_data[pfb_pos++] = 0x80;
@@ -1696,7 +1700,7 @@
goto Exit2;
FT_TRACE3(( " Load POST fragment #%d (%d byte) to buffer"
- " 0x%p + 0x%08x\n", i, rlen, pfb_data, pfb_pos ));
+ " %p + 0x%08x\n", i, rlen, pfb_data, pfb_pos ));
error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
if ( error )
goto Exit2;
@@ -1741,7 +1745,7 @@
/* The resource header says we've got resource_cnt `sfnt' */
/* (TrueType/OpenType) resources in this file. Look through */
/* them for the one indicated by face_index, load it into mem, */
- /* pass it on the the truetype driver and return it. */
+ /* pass it on to the truetype driver, and return it. */
/* */
static FT_Error
Mac_Read_sfnt_Resource( FT_Library library,
@@ -1754,7 +1758,7 @@
FT_Memory memory = library->memory;
FT_Byte* sfnt_data = NULL;
FT_Error error;
- FT_Long flag_offset;
+ FT_ULong flag_offset;
FT_Long rlen;
int is_cff;
FT_Long face_index_in_resource = 0;
@@ -1765,7 +1769,7 @@
if ( face_index >= resource_cnt )
return FT_THROW( Cannot_Open_Resource );
- flag_offset = offsets[face_index];
+ flag_offset = (FT_ULong)offsets[face_index];
error = FT_Stream_Seek( stream, flag_offset );
if ( error )
goto Exit;
@@ -1774,6 +1778,8 @@
goto Exit;
if ( rlen == -1 )
return FT_THROW( Cannot_Open_Resource );
+ if ( (FT_ULong)rlen > FT_MAC_RFORK_MAX_LEN )
+ return FT_THROW( Invalid_Offset );
error = open_face_PS_from_sfnt_stream( library,
stream,
@@ -1787,16 +1793,18 @@
if ( FT_Stream_Seek( stream, flag_offset + 4 ) )
goto Exit;
- if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) )
+ if ( FT_ALLOC( sfnt_data, rlen ) )
return error;
- error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen );
- if ( error )
+ error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, (FT_ULong)rlen );
+ if ( error ) {
+ FT_FREE( sfnt_data );
goto Exit;
+ }
is_cff = rlen > 4 && !ft_memcmp( sfnt_data, "OTTO", 4 );
error = open_face_from_buffer( library,
sfnt_data,
- rlen,
+ (FT_ULong)rlen,
face_index_in_resource,
is_cff ? "cff" : "truetype",
aface );
@@ -1893,13 +1901,14 @@
if ( error )
goto Exit;
- if ( header[ 0] != 0 ||
- header[74] != 0 ||
- header[82] != 0 ||
- header[ 1] == 0 ||
- header[ 1] > 33 ||
- header[63] != 0 ||
- header[2 + header[1]] != 0 )
+ if ( header[ 0] != 0 ||
+ header[74] != 0 ||
+ header[82] != 0 ||
+ header[ 1] == 0 ||
+ header[ 1] > 33 ||
+ header[63] != 0 ||
+ header[2 + header[1]] != 0 ||
+ header[0x53] > 0x7F )
return FT_THROW( Unknown_File_Format );
dlen = ( header[0x53] << 24 ) |
@@ -1934,7 +1943,7 @@
FT_Memory memory = library->memory;
FT_Error error = FT_ERR( Unknown_File_Format );
- int i;
+ FT_UInt i;
char * file_names[FT_RACCESS_N_RULES];
FT_Long offsets[FT_RACCESS_N_RULES];
@@ -1942,7 +1951,7 @@
FT_Bool is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */
FT_Open_Args args2;
- FT_Stream stream2 = 0;
+ FT_Stream stream2 = NULL;
FT_Raccess_Guess( library, stream,
@@ -2036,7 +2045,11 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_raccess
- FT_TRACE3(( "Try as dfont: %s ...", args->pathname ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE3(( "Try as dfont: " ));
+ if ( !( args->flags & FT_OPEN_MEMORY ) )
+ FT_TRACE3(( "%s ...", args->pathname ));
+#endif
error = IsMacResource( library, stream, 0, face_index, aface );
@@ -2103,7 +2116,7 @@
if ( FT_MODULE_IS_DRIVER( driver ) )
{
FT_Int num_params = 0;
- FT_Parameter* params = 0;
+ FT_Parameter* params = NULL;
if ( args->flags & FT_OPEN_PARAMS )
@@ -2137,7 +2150,7 @@
if ( FT_MODULE_IS_DRIVER( cur[0] ) )
{
FT_Int num_params = 0;
- FT_Parameter* params = 0;
+ FT_Parameter* params = NULL;
driver = FT_DRIVER( cur[0] );
@@ -2448,8 +2461,8 @@
FT_Driver driver;
FT_Driver_Class clazz;
- FT_Size size = 0;
- FT_ListNode node = 0;
+ FT_Size size = NULL;
+ FT_ListNode node = NULL;
if ( !face )
@@ -2461,7 +2474,7 @@
if ( !face->driver )
return FT_THROW( Invalid_Driver_Handle );
- *asize = 0;
+ *asize = NULL;
driver = face->driver;
clazz = driver->clazz;
@@ -2474,7 +2487,7 @@
size->face = face;
/* for now, do not use any internal fields in size objects */
- size->internal = 0;
+ size->internal = NULL;
if ( clazz->init_size )
error = clazz->init_size( size );
@@ -2532,7 +2545,7 @@
if ( face->size == size )
{
- face->size = 0;
+ face->size = NULL;
if ( face->sizes_list.head )
face->size = (FT_Size)(face->sizes_list.head->data);
}
@@ -3018,14 +3031,14 @@
pixel_height = 1;
/* use `>=' to avoid potential compiler warning on 16bit platforms */
- if ( pixel_width >= 0xFFFFU )
- pixel_width = 0xFFFFU;
+ if ( pixel_width >= 0xFFFFU )
+ pixel_width = 0xFFFFU;
if ( pixel_height >= 0xFFFFU )
pixel_height = 0xFFFFU;
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
- req.width = pixel_width << 6;
- req.height = pixel_height << 6;
+ req.width = (FT_Long)( pixel_width << 6 );
+ req.height = (FT_Long)( pixel_height << 6 );
req.horiResolution = 0;
req.vertResolution = 0;
@@ -3072,18 +3085,37 @@
if ( kern_mode != FT_KERNING_UNFITTED )
{
+ FT_Pos orig_x = akerning->x;
+ FT_Pos orig_y = akerning->y;
+
+
/* we scale down kerning values for small ppem values */
/* to avoid that rounding makes them too big. */
/* `25' has been determined heuristically. */
if ( face->size->metrics.x_ppem < 25 )
- akerning->x = FT_MulDiv( akerning->x,
+ akerning->x = FT_MulDiv( orig_x,
face->size->metrics.x_ppem, 25 );
if ( face->size->metrics.y_ppem < 25 )
- akerning->y = FT_MulDiv( akerning->y,
+ akerning->y = FT_MulDiv( orig_y,
face->size->metrics.y_ppem, 25 );
akerning->x = FT_PIX_ROUND( akerning->x );
akerning->y = FT_PIX_ROUND( akerning->y );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_Pos orig_x_rounded = FT_PIX_ROUND( orig_x );
+ FT_Pos orig_y_rounded = FT_PIX_ROUND( orig_y );
+
+
+ if ( akerning->x != orig_x_rounded ||
+ akerning->y != orig_y_rounded )
+ FT_TRACE5(( "FT_Get_Kerning: horizontal kerning"
+ " (%d, %d) scaled down to (%d, %d) pixels\n",
+ orig_x_rounded / 64, orig_y_rounded / 64,
+ akerning->x / 64, akerning->y / 64 ));
+ }
+#endif
}
}
}
@@ -3354,8 +3386,12 @@
FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
+
result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );
+ if ( result >= (FT_UInt)face->num_glyphs )
+ result = 0;
}
+
return result;
}
@@ -3374,7 +3410,7 @@
if ( face && face->charmap && face->num_glyphs )
{
gindex = FT_Get_Char_Index( face, 0 );
- if ( gindex == 0 || gindex >= (FT_UInt)face->num_glyphs )
+ if ( gindex == 0 )
result = FT_Get_Next_Char( face, 0, &gindex );
}
@@ -3852,7 +3888,7 @@
FT_ListNode* node )
{
FT_ListNode cur;
- FT_Renderer result = 0;
+ FT_Renderer result = NULL;
if ( !library )
@@ -3864,7 +3900,7 @@
{
if ( *node )
cur = (*node)->next;
- *node = 0;
+ *node = NULL;
}
while ( cur )
@@ -4084,8 +4120,7 @@
default:
{
- FT_ListNode node = 0;
- FT_Bool update = 0;
+ FT_ListNode node = NULL;
/* small shortcut for the very common case */
@@ -4112,16 +4147,6 @@
/* now, look for another renderer that supports the same */
/* format. */
renderer = FT_Lookup_Renderer( library, slot->format, &node );
- update = 1;
- }
-
- /* if we changed the current renderer for the glyph image format */
- /* we need to select it as the next current one */
- if ( !error && update && renderer )
- {
- error = FT_Set_Renderer( library, renderer, 0, 0 );
- if ( error )
- break;
}
}
}
@@ -4138,7 +4163,7 @@
FT_Error err;
- FT_Bitmap_New( &bitmap );
+ FT_Bitmap_Init( &bitmap );
/* this also converts the bitmap flow to `down' (i.e., pitch > 0) */
err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 );
@@ -4147,15 +4172,17 @@
MD5_CTX ctx;
unsigned char md5[16];
int i;
+ unsigned int rows = bitmap.rows;
+ unsigned int pitch = (unsigned int)bitmap.pitch;
- MD5_Init( &ctx);
- MD5_Update( &ctx, bitmap.buffer, bitmap.rows * bitmap.pitch );
+ MD5_Init( &ctx );
+ MD5_Update( &ctx, bitmap.buffer, rows * pitch );
MD5_Final( md5, &ctx );
FT_TRACE3(( "MD5 checksum for %dx%d bitmap:\n"
" ",
- bitmap.rows, bitmap.pitch ));
+ rows, pitch ));
for ( i = 0; i < 16; i++ )
FT_TRACE3(( "%02X", md5[i] ));
FT_TRACE3(( "\n" ));
@@ -4228,7 +4255,7 @@
if ( library && library->auto_hinter == module )
- library->auto_hinter = 0;
+ library->auto_hinter = NULL;
/* if the module is a renderer */
if ( FT_MODULE_IS_RENDERER( module ) )
@@ -4324,17 +4351,10 @@
/* if the module is a font driver */
if ( FT_MODULE_IS_DRIVER( module ) )
{
- /* allocate glyph loader if needed */
FT_Driver driver = FT_DRIVER( module );
driver->clazz = (FT_Driver_Class)module->clazz;
- if ( FT_DRIVER_USES_OUTLINES( driver ) )
- {
- error = FT_GlyphLoader_New( memory, &driver->glyph_loader );
- if ( error )
- goto Fail;
- }
}
if ( clazz->module_init )
@@ -4351,15 +4371,6 @@
return error;
Fail:
- if ( FT_MODULE_IS_DRIVER( module ) )
- {
- FT_Driver driver = FT_DRIVER( module );
-
-
- if ( FT_DRIVER_USES_OUTLINES( driver ) )
- FT_GlyphLoader_Done( driver->glyph_loader );
- }
-
if ( FT_MODULE_IS_RENDERER( module ) )
{
FT_Renderer renderer = FT_RENDERER( module );
@@ -4494,7 +4505,7 @@
cur[0] = cur[1];
cur++;
}
- limit[0] = 0;
+ limit[0] = NULL;
/* destroy the module */
Destroy_Module( module );
@@ -4677,12 +4688,9 @@
goto Fail;
#endif
- /* allocate the render pool */
- library->raster_pool_size = FT_RENDER_POOL_SIZE;
-#if FT_RENDER_POOL_SIZE > 0
- if ( FT_ALLOC( library->raster_pool, FT_RENDER_POOL_SIZE ) )
- goto Fail;
-#endif
+ /* we don't use raster_pool anymore. */
+ library->raster_pool_size = 0;
+ library->raster_pool = NULL;
library->version_major = FREETYPE_MAJOR;
library->version_minor = FREETYPE_MINOR;
@@ -4695,8 +4703,8 @@
return FT_Err_Ok;
- Fail:
#ifdef FT_CONFIG_OPTION_PIC
+ Fail:
ft_pic_container_destroy( library );
#endif
FT_FREE( library );
@@ -4825,16 +4833,12 @@
if ( module )
{
Destroy_Module( module );
- library->modules[n] = 0;
+ library->modules[n] = NULL;
}
}
}
#endif
- /* Destroy raster objects */
- FT_FREE( library->raster_pool );
- library->raster_pool_size = 0;
-
#ifdef FT_CONFIG_OPTION_PIC
/* Destroy pic container contents */
ft_pic_container_destroy( library );
diff --git a/src/3rdparty/freetype/src/base/ftotval.c b/src/3rdparty/freetype/src/base/ftotval.c
index 5fc73d76ab..786457ba2a 100644
--- a/src/3rdparty/freetype/src/base/ftotval.c
+++ b/src/3rdparty/freetype/src/base/ftotval.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (body). */
/* */
-/* Copyright 2004, 2006, 2008, 2010, 2013 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftoutln.c b/src/3rdparty/freetype/src/base/ftoutln.c
index 8749d64ce7..35cc9f5569 100644
--- a/src/3rdparty/freetype/src/base/ftoutln.c
+++ b/src/3rdparty/freetype/src/base/ftoutln.c
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
-/* Copyright 1996-2008, 2010, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -52,8 +52,9 @@
const FT_Outline_Funcs* func_interface,
void* user )
{
-#undef SCALED
-#define SCALED( x ) ( ( (x) << shift ) - delta )
+#undef SCALED
+#define SCALED( x ) ( ( (x) < 0 ? -( -(x) << shift ) \
+ : ( (x) << shift ) ) - delta )
FT_Vector v_last;
FT_Vector v_control;
@@ -279,7 +280,7 @@
if ( error )
goto Exit;
- first = last + 1;
+ first = (FT_UInt)last + 1;
}
FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
@@ -320,7 +321,7 @@
FT_NEW_ARRAY( anoutline->contours, numContours ) )
goto Fail;
- anoutline->n_points = (FT_UShort)numPoints;
+ anoutline->n_points = (FT_Short)numPoints;
anoutline->n_contours = (FT_Short)numContours;
anoutline->flags |= FT_OUTLINE_OWNER;
@@ -612,7 +613,6 @@
FT_Raster_Params* params )
{
FT_Error error;
- FT_Bool update = FALSE;
FT_Renderer renderer;
FT_ListNode node;
@@ -646,14 +646,8 @@
/* format */
renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE,
&node );
- update = TRUE;
}
- /* if we changed the current renderer for the glyph image format */
- /* we need to select it as the next current one */
- if ( !error && update && renderer )
- error = FT_Set_Renderer( library, renderer, 0, 0 );
-
return error;
}
@@ -914,8 +908,7 @@
FT_Pos ystrength )
{
FT_Vector* points;
- FT_Vector v_prev, v_first, v_next, v_cur;
- FT_Int c, n, first;
+ FT_Int c, first, last;
FT_Int orientation;
@@ -941,87 +934,95 @@
first = 0;
for ( c = 0; c < outline->n_contours; c++ )
{
- FT_Vector in, out, shift;
- FT_Fixed l_in, l_out, l, q, d;
- int last = outline->contours[c];
+ FT_Vector in, out, anchor, shift;
+ FT_Fixed l_in, l_out, l_anchor = 0, l, q, d;
+ FT_Int i, j, k;
- v_first = points[first];
- v_prev = points[last];
- v_cur = v_first;
+ l_in = 0;
+ last = outline->contours[c];
- /* compute incoming normalized vector */
- in.x = v_cur.x - v_prev.x;
- in.y = v_cur.y - v_prev.y;
- l_in = FT_Vector_Length( &in );
- if ( l_in )
+ /* Counter j cycles though the points; counter i advances only */
+ /* when points are moved; anchor k marks the first moved point. */
+ for ( i = last, j = first, k = -1;
+ j != i && i != k;
+ j = j < last ? j + 1 : first )
{
- in.x = FT_DivFix( in.x, l_in );
- in.y = FT_DivFix( in.y, l_in );
- }
+ if ( j != k )
+ {
+ out.x = points[j].x - points[i].x;
+ out.y = points[j].y - points[i].y;
+ l_out = (FT_Fixed)FT_Vector_NormLen( &out );
- for ( n = first; n <= last; n++ )
- {
- if ( n < last )
- v_next = points[n + 1];
+ if ( l_out == 0 )
+ continue;
+ }
else
- v_next = v_first;
-
- /* compute outgoing normalized vector */
- out.x = v_next.x - v_cur.x;
- out.y = v_next.y - v_cur.y;
- l_out = FT_Vector_Length( &out );
- if ( l_out )
{
- out.x = FT_DivFix( out.x, l_out );
- out.y = FT_DivFix( out.y, l_out );
+ out = anchor;
+ l_out = l_anchor;
}
- d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );
-
- /* shift only if turn is less than ~160 degrees */
- if ( d > -0xF000L )
+ if ( l_in != 0 )
{
- d = d + 0x10000L;
+ if ( k < 0 )
+ {
+ k = i;
+ anchor = in;
+ l_anchor = l_in;
+ }
- /* shift components are aligned along lateral bisector */
- /* and directed according to the outline orientation. */
- shift.x = in.y + out.y;
- shift.y = in.x + out.x;
+ d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );
- if ( orientation == FT_ORIENTATION_TRUETYPE )
- shift.x = -shift.x;
- else
- shift.y = -shift.y;
+ /* shift only if turn is less than ~160 degrees */
+ if ( d > -0xF000L )
+ {
+ d = d + 0x10000L;
- /* restrict shift magnitude to better handle collapsing segments */
- q = FT_MulFix( out.x, in.y ) - FT_MulFix( out.y, in.x );
- if ( orientation == FT_ORIENTATION_TRUETYPE )
- q = -q;
+ /* shift components along lateral bisector in proper orientation */
+ shift.x = in.y + out.y;
+ shift.y = in.x + out.x;
- l = FT_MIN( l_in, l_out );
+ if ( orientation == FT_ORIENTATION_TRUETYPE )
+ shift.x = -shift.x;
+ else
+ shift.y = -shift.y;
- /* non-strict inequalities avoid divide-by-zero when q == l == 0 */
- if ( FT_MulFix( xstrength, q ) <= FT_MulFix( d, l ) )
- shift.x = FT_MulDiv( shift.x, xstrength, d );
- else
- shift.x = FT_MulDiv( shift.x, l, q );
+ /* restrict shift magnitude to better handle collapsing segments */
+ q = FT_MulFix( out.x, in.y ) - FT_MulFix( out.y, in.x );
+ if ( orientation == FT_ORIENTATION_TRUETYPE )
+ q = -q;
+
+ l = FT_MIN( l_in, l_out );
+
+ /* non-strict inequalities avoid divide-by-zero when q == l == 0 */
+ if ( FT_MulFix( xstrength, q ) <= FT_MulFix( l, d ) )
+ shift.x = FT_MulDiv( shift.x, xstrength, d );
+ else
+ shift.x = FT_MulDiv( shift.x, l, q );
- if ( FT_MulFix( ystrength, q ) <= FT_MulFix( d, l ) )
- shift.y = FT_MulDiv( shift.y, ystrength, d );
+ if ( FT_MulFix( ystrength, q ) <= FT_MulFix( l, d ) )
+ shift.y = FT_MulDiv( shift.y, ystrength, d );
+ else
+ shift.y = FT_MulDiv( shift.y, l, q );
+ }
else
- shift.y = FT_MulDiv( shift.y, l, q );
+ shift.x = shift.y = 0;
+
+ for ( ;
+ i != j;
+ i = i < last ? i + 1 : first )
+ {
+ points[i].x += xstrength + shift.x;
+ points[i].y += ystrength + shift.y;
+ }
}
else
- shift.x = shift.y = 0;
-
- outline->points[n].x = v_cur.x + xstrength + shift.x;
- outline->points[n].y = v_cur.y + ystrength + shift.y;
+ i = j;
- in = out;
- l_in = l_out;
- v_cur = v_next;
+ in = out;
+ l_in = l_out;
}
first = last + 1;
@@ -1050,7 +1051,7 @@
/* We use the nonzero winding rule to find the orientation. */
/* Since glyph outlines behave much more `regular' than arbitrary */
/* cubic or quadratic curves, this test deals with the polygon */
- /* only which is spanned up by the control points. */
+ /* only that is spanned up by the control points. */
FT_Outline_Get_CBox( outline, &cbox );
@@ -1058,10 +1059,11 @@
if ( cbox.xMin == cbox.xMax || cbox.yMin == cbox.yMax )
return FT_ORIENTATION_NONE;
- xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14;
+ xshift = FT_MSB( (FT_UInt32)( FT_ABS( cbox.xMax ) |
+ FT_ABS( cbox.xMin ) ) ) - 14;
xshift = FT_MAX( xshift, 0 );
- yshift = FT_MSB( cbox.yMax - cbox.yMin ) - 14;
+ yshift = FT_MSB( (FT_UInt32)( cbox.yMax - cbox.yMin ) ) - 14;
yshift = FT_MAX( yshift, 0 );
points = outline->points;
diff --git a/src/3rdparty/freetype/src/base/ftpatent.c b/src/3rdparty/freetype/src/base/ftpatent.c
index 82b42f0343..bf2b0855c9 100644
--- a/src/3rdparty/freetype/src/base/ftpatent.c
+++ b/src/3rdparty/freetype/src/base/ftpatent.c
@@ -5,7 +5,8 @@
/* FreeType API for checking patented TrueType bytecode instructions */
/* (body). */
/* */
-/* Copyright 2007, 2008, 2010 by David Turner. */
+/* Copyright 2007-2015 by */
+/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
diff --git a/src/3rdparty/freetype/src/base/ftpfr.c b/src/3rdparty/freetype/src/base/ftpfr.c
index 7425abe33c..39f089e3e9 100644
--- a/src/3rdparty/freetype/src/base/ftpfr.c
+++ b/src/3rdparty/freetype/src/base/ftpfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (body). */
/* */
-/* Copyright 2002-2004, 2008, 2010, 2013, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftpic.c b/src/3rdparty/freetype/src/base/ftpic.c
index 9bd92f785a..6c4b1cd4e6 100644
--- a/src/3rdparty/freetype/src/base/ftpic.c
+++ b/src/3rdparty/freetype/src/base/ftpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (body). */
/* */
-/* Copyright 2009, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftrfork.c b/src/3rdparty/freetype/src/base/ftrfork.c
index efe24d6eee..c30c76678e 100644
--- a/src/3rdparty/freetype/src/base/ftrfork.c
+++ b/src/3rdparty/freetype/src/base/ftrfork.c
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (body). */
/* */
-/* Copyright 2004-2010, 2013, 2014 by */
+/* Copyright 2004-2015 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@@ -63,7 +63,7 @@
FT_UNUSED( library );
- error = FT_Stream_Seek( stream, rfork_offset );
+ error = FT_Stream_Seek( stream, (FT_ULong)rfork_offset );
if ( error )
return error;
@@ -71,25 +71,36 @@
if ( error )
return error;
- *rdata_pos = rfork_offset + ( ( head[0] << 24 ) |
- ( head[1] << 16 ) |
- ( head[2] << 8 ) |
- head[3] );
- map_pos = rfork_offset + ( ( head[4] << 24 ) |
- ( head[5] << 16 ) |
- ( head[6] << 8 ) |
- head[7] );
- rdata_len = ( head[ 8] << 24 ) |
- ( head[ 9] << 16 ) |
- ( head[10] << 8 ) |
- head[11];
+ /* ensure positive values */
+ if ( head[0] >= 0x80 || head[4] >= 0x80 || head[8] >= 0x80 )
+ return FT_THROW( Unknown_File_Format );
+
+ *rdata_pos = ( head[ 0] << 24 ) |
+ ( head[ 1] << 16 ) |
+ ( head[ 2] << 8 ) |
+ head[ 3];
+ map_pos = ( head[ 4] << 24 ) |
+ ( head[ 5] << 16 ) |
+ ( head[ 6] << 8 ) |
+ head[ 7];
+ rdata_len = ( head[ 8] << 24 ) |
+ ( head[ 9] << 16 ) |
+ ( head[10] << 8 ) |
+ head[11];
/* map_len = head[12] .. head[15] */
- if ( *rdata_pos + rdata_len != map_pos || map_pos == rfork_offset )
+ if ( *rdata_pos != map_pos - rdata_len || map_pos == 0 )
return FT_THROW( Unknown_File_Format );
- error = FT_Stream_Seek( stream, map_pos );
+ if ( FT_LONG_MAX - rfork_offset < *rdata_pos ||
+ FT_LONG_MAX - rfork_offset < map_pos )
+ return FT_THROW( Unknown_File_Format );
+
+ *rdata_pos += rfork_offset;
+ map_pos += rfork_offset;
+
+ error = FT_Stream_Seek( stream, (FT_ULong)map_pos );
if ( error )
return error;
@@ -124,7 +135,7 @@
if ( type_list == -1 )
return FT_THROW( Unknown_File_Format );
- error = FT_Stream_Seek( stream, map_pos + type_list );
+ error = FT_Stream_Seek( stream, (FT_ULong)( map_pos + type_list ) );
if ( error )
return error;
@@ -166,7 +177,7 @@
FT_TRACE3(( "\n" ));
- error = FT_Stream_Seek( stream, map_offset );
+ error = FT_Stream_Seek( stream, (FT_ULong)map_offset );
if ( error )
return error;
@@ -194,7 +205,7 @@
*count = subcnt + 1;
rpos += map_offset;
- error = FT_Stream_Seek( stream, rpos );
+ error = FT_Stream_Seek( stream, (FT_ULong)rpos );
if ( error )
return error;
@@ -220,7 +231,7 @@
if (sort_by_res_id)
{
- ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),
+ ft_qsort( ref, (size_t)*count, sizeof ( FT_RFork_Ref ),
( int(*)(const void*, const void*) )
ft_raccess_sort_ref_by_id );
@@ -713,9 +724,9 @@
FT_UShort n_of_entries;
int i;
- FT_UInt32 entry_id, entry_offset, entry_length = 0;
+ FT_Int32 entry_id, entry_offset, entry_length = 0;
- const FT_UInt32 resource_fork_entry_id = 0x2;
+ const FT_Int32 resource_fork_entry_id = 0x2;
FT_UNUSED( library );
FT_UNUSED( base_file_name );
@@ -813,7 +824,9 @@
tmp = ft_strrchr( original_name, '/' );
if ( tmp )
{
- ft_strncpy( new_name, original_name, tmp - original_name + 1 );
+ ft_strncpy( new_name,
+ original_name,
+ (size_t)( tmp - original_name + 1 ) );
new_name[tmp - original_name + 1] = '\0';
slash = tmp + 1;
}
diff --git a/src/3rdparty/freetype/src/base/ftsnames.c b/src/3rdparty/freetype/src/base/ftsnames.c
index 260e91c148..80304e5c85 100644
--- a/src/3rdparty/freetype/src/base/ftsnames.c
+++ b/src/3rdparty/freetype/src/base/ftsnames.c
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2001, 2002, 2009 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftstream.c b/src/3rdparty/freetype/src/base/ftstream.c
index 759fd8fc07..b68f3f82d2 100644
--- a/src/3rdparty/freetype/src/base/ftstream.c
+++ b/src/3rdparty/freetype/src/base/ftstream.c
@@ -4,7 +4,7 @@
/* */
/* I/O stream support (body). */
/* */
-/* Copyright 2000-2002, 2004-2006, 2008-2011, 2013 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -39,9 +39,9 @@
stream->base = (FT_Byte*) base;
stream->size = size;
stream->pos = 0;
- stream->cursor = 0;
- stream->read = 0;
- stream->close = 0;
+ stream->cursor = NULL;
+ stream->read = NULL;
+ stream->close = NULL;
}
@@ -95,11 +95,11 @@
if ( distance < 0 )
return FT_THROW( Invalid_Stream_Operation );
- return FT_Stream_Seek( stream, (FT_ULong)( stream->pos + distance ) );
+ return FT_Stream_Seek( stream, stream->pos + (FT_ULong)distance );
}
- FT_BASE_DEF( FT_Long )
+ FT_BASE_DEF( FT_ULong )
FT_Stream_Pos( FT_Stream stream )
{
return stream->pos;
@@ -203,8 +203,8 @@
*pbytes = (FT_Byte*)stream->cursor;
/* equivalent to FT_Stream_ExitFrame(), with no memory block release */
- stream->cursor = 0;
- stream->limit = 0;
+ stream->cursor = NULL;
+ stream->limit = NULL;
}
return error;
@@ -226,7 +226,7 @@
FT_FREE( *pbytes );
#endif
}
- *pbytes = 0;
+ *pbytes = NULL;
}
@@ -260,7 +260,9 @@
#ifdef FT_DEBUG_MEMORY
/* assume _ft_debug_file and _ft_debug_lineno are already set */
- stream->base = (unsigned char*)ft_mem_qalloc( memory, count, &error );
+ stream->base = (unsigned char*)ft_mem_qalloc( memory,
+ (FT_Long)count,
+ &error );
if ( error )
goto Exit;
#else
@@ -333,8 +335,8 @@
FT_FREE( stream->base );
#endif
}
- stream->cursor = 0;
- stream->limit = 0;
+ stream->cursor = NULL;
+ stream->limit = NULL;
}
@@ -348,7 +350,7 @@
result = 0;
if ( stream->cursor < stream->limit )
- result = *stream->cursor++;
+ result = (FT_Char)*stream->cursor++;
return result;
}
@@ -357,8 +359,8 @@
FT_BASE_DEF( FT_UShort )
FT_Stream_GetUShort( FT_Stream stream )
{
- FT_Byte* p;
- FT_Short result;
+ FT_Byte* p;
+ FT_UShort result;
FT_ASSERT( stream && stream->cursor );
@@ -376,8 +378,8 @@
FT_BASE_DEF( FT_UShort )
FT_Stream_GetUShortLE( FT_Stream stream )
{
- FT_Byte* p;
- FT_Short result;
+ FT_Byte* p;
+ FT_UShort result;
FT_ASSERT( stream && stream->cursor );
@@ -396,7 +398,7 @@
FT_Stream_GetUOffset( FT_Stream stream )
{
FT_Byte* p;
- FT_Long result;
+ FT_ULong result;
FT_ASSERT( stream && stream->cursor );
@@ -414,7 +416,7 @@
FT_Stream_GetULong( FT_Stream stream )
{
FT_Byte* p;
- FT_Long result;
+ FT_ULong result;
FT_ASSERT( stream && stream->cursor );
@@ -432,7 +434,7 @@
FT_Stream_GetULongLE( FT_Stream stream )
{
FT_Byte* p;
- FT_Long result;
+ FT_ULong result;
FT_ASSERT( stream && stream->cursor );
@@ -471,7 +473,7 @@
}
stream->pos++;
- return result;
+ return (FT_Char)result;
Fail:
*error = FT_THROW( Invalid_Stream_Operation );
@@ -485,11 +487,11 @@
FT_BASE_DEF( FT_UShort )
FT_Stream_ReadUShort( FT_Stream stream,
- FT_Error* error )
+ FT_Error* error )
{
- FT_Byte reads[2];
- FT_Byte* p = 0;
- FT_Short result = 0;
+ FT_Byte reads[2];
+ FT_Byte* p = 0;
+ FT_UShort result = 0;
FT_ASSERT( stream );
@@ -506,9 +508,7 @@
p = reads;
}
else
- {
p = stream->base + stream->pos;
- }
if ( p )
result = FT_NEXT_USHORT( p );
@@ -532,11 +532,11 @@
FT_BASE_DEF( FT_UShort )
FT_Stream_ReadUShortLE( FT_Stream stream,
- FT_Error* error )
+ FT_Error* error )
{
- FT_Byte reads[2];
- FT_Byte* p = 0;
- FT_Short result = 0;
+ FT_Byte reads[2];
+ FT_Byte* p = 0;
+ FT_UShort result = 0;
FT_ASSERT( stream );
@@ -553,9 +553,7 @@
p = reads;
}
else
- {
p = stream->base + stream->pos;
- }
if ( p )
result = FT_NEXT_USHORT_LE( p );
@@ -579,11 +577,11 @@
FT_BASE_DEF( FT_ULong )
FT_Stream_ReadUOffset( FT_Stream stream,
- FT_Error* error )
+ FT_Error* error )
{
FT_Byte reads[3];
- FT_Byte* p = 0;
- FT_Long result = 0;
+ FT_Byte* p = 0;
+ FT_ULong result = 0;
FT_ASSERT( stream );
@@ -600,9 +598,7 @@
p = reads;
}
else
- {
p = stream->base + stream->pos;
- }
if ( p )
result = FT_NEXT_UOFF3( p );
@@ -626,11 +622,11 @@
FT_BASE_DEF( FT_ULong )
FT_Stream_ReadULong( FT_Stream stream,
- FT_Error* error )
+ FT_Error* error )
{
FT_Byte reads[4];
- FT_Byte* p = 0;
- FT_Long result = 0;
+ FT_Byte* p = 0;
+ FT_ULong result = 0;
FT_ASSERT( stream );
@@ -647,9 +643,7 @@
p = reads;
}
else
- {
p = stream->base + stream->pos;
- }
if ( p )
result = FT_NEXT_ULONG( p );
@@ -673,11 +667,11 @@
FT_BASE_DEF( FT_ULong )
FT_Stream_ReadULongLE( FT_Stream stream,
- FT_Error* error )
+ FT_Error* error )
{
FT_Byte reads[4];
- FT_Byte* p = 0;
- FT_Long result = 0;
+ FT_Byte* p = 0;
+ FT_ULong result = 0;
FT_ASSERT( stream );
@@ -694,9 +688,7 @@
p = reads;
}
else
- {
p = stream->base + stream->pos;
- }
if ( p )
result = FT_NEXT_ULONG_LE( p );
diff --git a/src/3rdparty/freetype/src/base/ftstroke.c b/src/3rdparty/freetype/src/base/ftstroke.c
index 5fc41fc8fa..fecb3cc25c 100644
--- a/src/3rdparty/freetype/src/base/ftstroke.c
+++ b/src/3rdparty/freetype/src/base/ftstroke.c
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (body). */
/* */
-/* Copyright 2002-2006, 2008-2011, 2013, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,6 +24,16 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
+#include "basepic.h"
+
+
+ /* declare an extern to access `ft_outline_glyph_class' globally */
+ /* allocated in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */
+ /* macro to access it when FT_CONFIG_OPTION_PIC is defined */
+#ifndef FT_CONFIG_OPTION_PIC
+ FT_CALLBACK_TABLE const FT_Glyph_Class ft_outline_glyph_class;
+#endif
+
/* documentation is in ftstroke.h */
@@ -347,7 +357,7 @@
ft_stroke_border_close( FT_StrokeBorder border,
FT_Bool reverse )
{
- FT_UInt start = border->start;
+ FT_UInt start = (FT_UInt)border->start;
FT_UInt count = border->num_points;
@@ -599,7 +609,7 @@
if ( border->start >= 0 )
ft_stroke_border_close( border, FALSE );
- border->start = border->num_points;
+ border->start = (FT_Int)border->num_points;
border->movable = FALSE;
return ft_stroke_border_lineto( border, to, FALSE );
@@ -742,7 +752,7 @@
}
}
- outline->n_points = (short)( outline->n_points + border->num_points );
+ outline->n_points += (short)border->num_points;
FT_ASSERT( FT_Outline_Check( outline ) == 0 );
}
@@ -999,7 +1009,9 @@
/* Only intersect borders if between two lineto's and both */
/* lines are long enough (line_length is zero for curves). */
- if ( !border->movable || line_length == 0 )
+ /* Also avoid U-turns of nearly 180 degree. */
+ if ( !border->movable || line_length == 0 ||
+ theta > 0x59C000 || theta < -0x59C000 )
intersect = FALSE;
else
{
@@ -1220,11 +1232,8 @@
goto Exit;
/* when we turn to the right, the inside side is 0 */
- inside_side = 0;
-
/* otherwise, the inside side is 1 */
- if ( turn < 0 )
- inside_side = 1;
+ inside_side = ( turn < 0 );
/* process the inside side */
error = ft_stroker_inside( stroker, inside_side, line_length );
@@ -1232,7 +1241,7 @@
goto Exit;
/* process the outside side */
- error = ft_stroker_outside( stroker, 1 - inside_side, line_length );
+ error = ft_stroker_outside( stroker, !inside_side, line_length );
Exit:
return error;
@@ -1822,7 +1831,7 @@
FT_ASSERT( left->start >= 0 );
- new_points = left->num_points - left->start;
+ new_points = (FT_Int)left->num_points - left->start;
if ( new_points > 0 )
{
error = ft_stroke_border_grow( right, (FT_UInt)new_points );
@@ -1862,8 +1871,8 @@
}
}
- left->num_points = left->start;
- right->num_points += new_points;
+ left->num_points = (FT_UInt)left->start;
+ right->num_points += (FT_UInt)new_points;
right->movable = FALSE;
left->movable = FALSE;
@@ -1941,11 +1950,8 @@
if ( turn != 0 )
{
/* when we turn to the right, the inside side is 0 */
- inside_side = 0;
-
/* otherwise, the inside side is 1 */
- if ( turn < 0 )
- inside_side = 1;
+ inside_side = ( turn < 0 );
error = ft_stroker_inside( stroker,
inside_side,
@@ -1955,7 +1961,7 @@
/* process the outside side */
error = ft_stroker_outside( stroker,
- 1 - inside_side,
+ !inside_side,
stroker->subpath_line_length );
if ( error )
goto Exit;
@@ -2118,7 +2124,7 @@
FT_UInt last; /* index of last point in contour */
- last = outline->contours[n];
+ last = (FT_UInt)outline->contours[n];
limit = outline->points + last;
/* skip empty points; we don't stroke these */
@@ -2289,15 +2295,6 @@
}
- /* declare an extern to access `ft_outline_glyph_class' globally */
- /* allocated in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */
- /* macro to access it when FT_CONFIG_OPTION_PIC is defined */
-#ifndef FT_CONFIG_OPTION_PIC
- extern const FT_Glyph_Class ft_outline_glyph_class;
-#endif
-#include "basepic.h"
-
-
/* documentation is in ftstroke.h */
FT_EXPORT_DEF( FT_Error )
@@ -2347,7 +2344,9 @@
FT_Outline_Done( glyph->library, outline );
error = FT_Outline_New( glyph->library,
- num_points, num_contours, outline );
+ num_points,
+ (FT_Int)num_contours,
+ outline );
if ( error )
goto Fail;
@@ -2437,7 +2436,7 @@
error = FT_Outline_New( glyph->library,
num_points,
- num_contours,
+ (FT_Int)num_contours,
outline );
if ( error )
goto Fail;
diff --git a/src/3rdparty/freetype/src/base/ftsynth.c b/src/3rdparty/freetype/src/base/ftsynth.c
index 0567bd537a..cd68533957 100644
--- a/src/3rdparty/freetype/src/base/ftsynth.c
+++ b/src/3rdparty/freetype/src/base/ftsynth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
-/* Copyright 2000-2006, 2010, 2012-2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftsystem.c b/src/3rdparty/freetype/src/base/ftsystem.c
index 2c6ddac10c..1938fd8917 100644
--- a/src/3rdparty/freetype/src/base/ftsystem.c
+++ b/src/3rdparty/freetype/src/base/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific FreeType low-level system interface (body). */
/* */
-/* Copyright 1996-2002, 2006, 2008-2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -71,7 +71,7 @@
{
FT_UNUSED( memory );
- return ft_smalloc( size );
+ return ft_smalloc( (size_t)size );
}
@@ -104,7 +104,7 @@
FT_UNUSED( memory );
FT_UNUSED( cur_size );
- return ft_srealloc( block, new_size );
+ return ft_srealloc( block, (size_t)new_size );
}
@@ -171,7 +171,7 @@
stream->descriptor.pointer = NULL;
stream->size = 0;
- stream->base = 0;
+ stream->base = NULL;
}
@@ -212,7 +212,7 @@
file = STREAM_FILE( stream );
if ( stream->pos != offset )
- ft_fseek( file, offset, SEEK_SET );
+ ft_fseek( file, (long)offset, SEEK_SET );
return (unsigned long)ft_fread( buffer, 1, count, file );
}
@@ -232,7 +232,7 @@
stream->descriptor.pointer = NULL;
stream->pathname.pointer = (char*)filepathname;
- stream->base = 0;
+ stream->base = NULL;
stream->pos = 0;
stream->read = NULL;
stream->close = NULL;
@@ -247,7 +247,7 @@
}
ft_fseek( file, 0, SEEK_END );
- stream->size = ft_ftell( file );
+ stream->size = (unsigned long)ft_ftell( file );
if ( !stream->size )
{
FT_ERROR(( "FT_Stream_Open:" ));
@@ -292,7 +292,7 @@
memory = (FT_Memory)ft_smalloc( sizeof ( *memory ) );
if ( memory )
{
- memory->user = 0;
+ memory->user = NULL;
memory->alloc = ft_alloc;
memory->realloc = ft_realloc;
memory->free = ft_free;
diff --git a/src/3rdparty/freetype/src/base/fttrigon.c b/src/3rdparty/freetype/src/base/fttrigon.c
index 22b7ecf1bf..5b24304c2f 100644
--- a/src/3rdparty/freetype/src/base/fttrigon.c
+++ b/src/3rdparty/freetype/src/base/fttrigon.c
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (body). */
/* */
-/* Copyright 2001-2005, 2012-2014 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -92,8 +92,8 @@
s = -1;
}
- lo1 = val & 0x0000FFFFU;
- hi1 = val >> 16;
+ lo1 = (FT_UInt32)val & 0x0000FFFFU;
+ hi1 = (FT_UInt32)val >> 16;
lo2 = FT_TRIG_SCALE & 0x0000FFFFU;
hi2 = FT_TRIG_SCALE >> 16;
@@ -120,7 +120,7 @@
lo += 0x40000000UL;
hi += ( lo < 0x40000000UL );
- val = (FT_Fixed)hi;
+ val = (FT_Fixed)hi;
return s < 0 ? -val : val;
}
@@ -139,7 +139,7 @@
x = vec->x;
y = vec->y;
- shift = FT_MSB( FT_ABS( x ) | FT_ABS( y ) );
+ shift = FT_MSB( (FT_UInt32)( FT_ABS( x ) | FT_ABS( y ) ) );
if ( shift <= FT_TRIG_SAFE_MSB )
{
@@ -299,11 +299,9 @@
FT_Vector v;
- v.x = FT_TRIG_SCALE >> 8;
- v.y = 0;
- ft_trig_pseudo_rotate( &v, angle );
+ FT_Vector_Unit( &v, angle );
- return ( v.x + 0x80L ) >> 8;
+ return v.x;
}
@@ -312,7 +310,12 @@
FT_EXPORT_DEF( FT_Fixed )
FT_Sin( FT_Angle angle )
{
- return FT_Cos( FT_ANGLE_PI2 - angle );
+ FT_Vector v;
+
+
+ FT_Vector_Unit( &v, angle );
+
+ return v.y;
}
@@ -324,9 +327,7 @@
FT_Vector v;
- v.x = FT_TRIG_SCALE >> 8;
- v.y = 0;
- ft_trig_pseudo_rotate( &v, angle );
+ FT_Vector_Unit( &v, angle );
return FT_DivFix( v.y, v.x );
}
@@ -388,33 +389,32 @@
FT_Vector v;
- if ( !vec )
+ if ( !vec || !angle )
return;
- v.x = vec->x;
- v.y = vec->y;
+ v = *vec;
- if ( angle && ( v.x != 0 || v.y != 0 ) )
- {
- shift = ft_trig_prenorm( &v );
- ft_trig_pseudo_rotate( &v, angle );
- v.x = ft_trig_downscale( v.x );
- v.y = ft_trig_downscale( v.y );
+ if ( v.x == 0 && v.y == 0 )
+ return;
- if ( shift > 0 )
- {
- FT_Int32 half = (FT_Int32)1L << ( shift - 1 );
+ shift = ft_trig_prenorm( &v );
+ ft_trig_pseudo_rotate( &v, angle );
+ v.x = ft_trig_downscale( v.x );
+ v.y = ft_trig_downscale( v.y );
+ if ( shift > 0 )
+ {
+ FT_Int32 half = (FT_Int32)1L << ( shift - 1 );
- vec->x = ( v.x + half + FT_SIGN_LONG( v.x ) ) >> shift;
- vec->y = ( v.y + half + FT_SIGN_LONG( v.y ) ) >> shift;
- }
- else
- {
- shift = -shift;
- vec->x = (FT_Pos)( (FT_ULong)v.x << shift );
- vec->y = (FT_Pos)( (FT_ULong)v.y << shift );
- }
+
+ vec->x = ( v.x + half + FT_SIGN_LONG( v.x ) ) >> shift;
+ vec->y = ( v.y + half + FT_SIGN_LONG( v.y ) ) >> shift;
+ }
+ else
+ {
+ shift = -shift;
+ vec->x = (FT_Pos)( (FT_ULong)v.x << shift );
+ vec->y = (FT_Pos)( (FT_ULong)v.y << shift );
}
}
@@ -450,7 +450,7 @@
v.x = ft_trig_downscale( v.x );
if ( shift > 0 )
- return ( v.x + ( 1 << ( shift - 1 ) ) ) >> shift;
+ return ( v.x + ( 1L << ( shift - 1 ) ) ) >> shift;
return (FT_Fixed)( (FT_UInt32)v.x << -shift );
}
@@ -512,11 +512,10 @@
FT_Angle delta = angle2 - angle1;
- delta %= FT_ANGLE_2PI;
- if ( delta < 0 )
+ while ( delta <= -FT_ANGLE_PI )
delta += FT_ANGLE_2PI;
- if ( delta > FT_ANGLE_PI )
+ while ( delta > FT_ANGLE_PI )
delta -= FT_ANGLE_2PI;
return delta;
diff --git a/src/3rdparty/freetype/src/base/fttype1.c b/src/3rdparty/freetype/src/base/fttype1.c
index 47af19afb0..c549382afd 100644
--- a/src/3rdparty/freetype/src/base/fttype1.c
+++ b/src/3rdparty/freetype/src/base/fttype1.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for PS names support (body). */
/* */
-/* Copyright 2002-2004, 2011, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftutil.c b/src/3rdparty/freetype/src/base/ftutil.c
index 56e2800eb6..f5b72db708 100644
--- a/src/3rdparty/freetype/src/base/ftutil.c
+++ b/src/3rdparty/freetype/src/base/ftutil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for memory and list management (body). */
/* */
-/* Copyright 2002, 2004-2007, 2013 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -180,7 +180,7 @@
FT_Error *p_error )
{
FT_Error error;
- FT_Pointer p = ft_mem_qalloc( memory, size, &error );
+ FT_Pointer p = ft_mem_qalloc( memory, (FT_Long)size, &error );
if ( !error && address )
@@ -275,7 +275,7 @@
before = list->tail;
- node->next = 0;
+ node->next = NULL;
node->prev = before;
if ( before )
@@ -302,7 +302,7 @@
after = list->head;
node->next = after;
- node->prev = 0;
+ node->prev = NULL;
if ( !after )
list->tail = node;
@@ -366,7 +366,7 @@
else
list->tail = before;
- node->prev = 0;
+ node->prev = NULL;
node->next = list->head;
list->head->prev = node;
list->head = node;
@@ -433,8 +433,8 @@
cur = next;
}
- list->head = 0;
- list->tail = 0;
+ list->head = NULL;
+ list->tail = NULL;
}
diff --git a/src/3rdparty/freetype/src/base/ftwinfnt.c b/src/3rdparty/freetype/src/base/ftwinfnt.c
index 8e337fbe53..76a19af983 100644
--- a/src/3rdparty/freetype/src/base/ftwinfnt.c
+++ b/src/3rdparty/freetype/src/base/ftwinfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows FNT specific info (body). */
/* */
-/* Copyright 2003, 2004, 2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/base/ftxf86.c b/src/3rdparty/freetype/src/base/ftxf86.c
deleted file mode 100644
index a4bf767dfa..0000000000
--- a/src/3rdparty/freetype/src/base/ftxf86.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftxf86.c */
-/* */
-/* FreeType utility file for X11 support (body). */
-/* */
-/* Copyright 2002, 2003, 2004 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_XFREE86_H
-#include FT_INTERNAL_OBJECTS_H
-#include FT_SERVICE_XFREE86_NAME_H
-
-
- /* documentation is in ftxf86.h */
-
- FT_EXPORT_DEF( const char* )
- FT_Get_X11_Font_Format( FT_Face face )
- {
- const char* result = NULL;
-
-
- if ( face )
- FT_FACE_FIND_SERVICE( face, result, XF86_NAME );
-
- return result;
- }
-
-
-/* END */
diff --git a/src/3rdparty/freetype/src/base/rules.mk b/src/3rdparty/freetype/src/base/rules.mk
index cbd810732b..1852e08613 100644
--- a/src/3rdparty/freetype/src/base/rules.mk
+++ b/src/3rdparty/freetype/src/base/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2002-2009, 2013 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -23,7 +23,10 @@
# layer proper.
-BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
+BASE_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(BASE_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Base layer sources
diff --git a/src/3rdparty/freetype/src/bdf/Jamfile b/src/3rdparty/freetype/src/bdf/Jamfile
index da23ccd0ad..86b85fa3e4 100644
--- a/src/3rdparty/freetype/src/bdf/Jamfile
+++ b/src/3rdparty/freetype/src/bdf/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/bdf Jamfile
#
-# Copyright 2002 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,9 @@ SubDir FT2_TOP $(FT2_SRC_DIR) bdf ;
if $(FT2_MULTI)
{
- _sources = bdfdrivr bdflib ;
+ _sources = bdfdrivr
+ bdflib
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/bdf/bdf.h b/src/3rdparty/freetype/src/bdf/bdf.h
index d11be6f147..f24d925d8f 100644
--- a/src/3rdparty/freetype/src/bdf/bdf.h
+++ b/src/3rdparty/freetype/src/bdf/bdf.h
@@ -40,12 +40,12 @@ FT_BEGIN_HEADER
/* Imported from bdfP.h */
-#define _bdf_glyph_modified( map, e ) \
- ( (map)[(e) >> 5] & ( 1 << ( (e) & 31 ) ) )
-#define _bdf_set_glyph_modified( map, e ) \
- ( (map)[(e) >> 5] |= ( 1 << ( (e) & 31 ) ) )
-#define _bdf_clear_glyph_modified( map, e ) \
- ( (map)[(e) >> 5] &= ~( 1 << ( (e) & 31 ) ) )
+#define _bdf_glyph_modified( map, e ) \
+ ( (map)[(e) >> 5] & ( 1UL << ( (e) & 31 ) ) )
+#define _bdf_set_glyph_modified( map, e ) \
+ ( (map)[(e) >> 5] |= ( 1UL << ( (e) & 31 ) ) )
+#define _bdf_clear_glyph_modified( map, e ) \
+ ( (map)[(e) >> 5] &= ~( 1UL << ( (e) & 31 ) ) )
/* end of bdfP.h */
@@ -167,10 +167,10 @@ FT_BEGIN_HEADER
typedef struct hashtable_
{
- int limit;
- int size;
- int used;
- hashnode* table;
+ unsigned int limit;
+ unsigned int size;
+ unsigned int used;
+ hashnode* table;
} hashtable;
@@ -194,7 +194,7 @@ FT_BEGIN_HEADER
char* name; /* Name of the font. */
bdf_bbx_t bbx; /* Font bounding box. */
- long point_size; /* Point size of the font. */
+ unsigned long point_size; /* Point size of the font. */
unsigned long resolution_x; /* Font horizontal resolution. */
unsigned long resolution_y; /* Font vertical resolution. */
diff --git a/src/3rdparty/freetype/src/bdf/bdfdrivr.c b/src/3rdparty/freetype/src/bdf/bdfdrivr.c
index 55a428c1b6..404af517e5 100644
--- a/src/3rdparty/freetype/src/bdf/bdfdrivr.c
+++ b/src/3rdparty/freetype/src/bdf/bdfdrivr.c
@@ -33,7 +33,7 @@ THE SOFTWARE.
#include FT_TRUETYPE_IDS_H
#include FT_SERVICE_BDF_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#include "bdf.h"
#include "bdfdrivr.h"
@@ -106,7 +106,7 @@ THE SOFTWARE.
mid = ( min + max ) >> 1;
- code = encodings[mid].enc;
+ code = (FT_ULong)encodings[mid].enc;
if ( charcode == code )
{
@@ -146,7 +146,7 @@ THE SOFTWARE.
mid = ( min + max ) >> 1;
- code = encodings[mid].enc;
+ code = (FT_ULong)encodings[mid].enc;
if ( charcode == code )
{
@@ -165,7 +165,7 @@ THE SOFTWARE.
charcode = 0;
if ( min < cmap->num_encodings )
{
- charcode = encodings[min].enc;
+ charcode = (FT_ULong)encodings[min].enc;
result = encodings[min].glyph + 1;
}
@@ -379,7 +379,8 @@ THE SOFTWARE.
* an invalid argument error when the font could be
* opened by the specified driver.
*/
- if ( face_index > 0 ) {
+ if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
+ {
FT_ERROR(( "BDF_Face_Init: invalid face index\n" ));
BDF_Face_Done( bdfface );
return FT_THROW( Invalid_Argument );
@@ -420,14 +421,14 @@ THE SOFTWARE.
goto Exit;
}
else
- bdfface->family_name = 0;
+ bdfface->family_name = NULL;
if ( ( error = bdf_interpret_style( face ) ) != 0 )
goto Exit;
/* the number of glyphs (with one slot for the undefined glyph */
/* at position 0 and all unencoded glyphs) */
- bdfface->num_glyphs = font->glyphs_size + 1;
+ bdfface->num_glyphs = (FT_Long)( font->glyphs_size + 1 );
bdfface->num_fixed_sizes = 1;
if ( FT_NEW_ARRAY( bdfface->available_sizes, 1 ) )
@@ -494,7 +495,7 @@ THE SOFTWARE.
{
(face->en_table[n]).enc = cur[n].encoding;
FT_TRACE4(( " idx %d, val 0x%lX\n", n, cur[n].encoding ));
- (face->en_table[n]).glyph = (FT_Short)n;
+ (face->en_table[n]).glyph = (FT_UShort)n;
if ( cur[n].encoding == font->default_char )
{
@@ -509,7 +510,7 @@ THE SOFTWARE.
/* charmaps */
{
- bdf_property_t *charset_registry = 0, *charset_encoding = 0;
+ bdf_property_t *charset_registry, *charset_encoding;
FT_Bool unicode_charmap = 0;
@@ -615,9 +616,9 @@ THE SOFTWARE.
FT_Select_Metrics( size->face, strike_index );
- size->metrics.ascender = bdffont->font_ascent << 6;
- size->metrics.descender = -bdffont->font_descent << 6;
- size->metrics.max_advance = bdffont->bbx.width << 6;
+ size->metrics.ascender = bdffont->font_ascent * 64;
+ size->metrics.descender = -bdffont->font_descent * 64;
+ size->metrics.max_advance = bdffont->bbx.width * 64;
return FT_Err_Ok;
}
@@ -734,18 +735,18 @@ THE SOFTWARE.
slot->bitmap_left = glyph.bbx.x_offset;
slot->bitmap_top = glyph.bbx.ascent;
- slot->metrics.horiAdvance = glyph.dwidth << 6;
- slot->metrics.horiBearingX = glyph.bbx.x_offset << 6;
- slot->metrics.horiBearingY = glyph.bbx.ascent << 6;
- slot->metrics.width = bitmap->width << 6;
- slot->metrics.height = bitmap->rows << 6;
+ slot->metrics.horiAdvance = (FT_Pos)( glyph.dwidth * 64 );
+ slot->metrics.horiBearingX = (FT_Pos)( glyph.bbx.x_offset * 64 );
+ slot->metrics.horiBearingY = (FT_Pos)( glyph.bbx.ascent * 64 );
+ slot->metrics.width = (FT_Pos)( bitmap->width * 64 );
+ slot->metrics.height = (FT_Pos)( bitmap->rows * 64 );
/*
* XXX DWIDTH1 and VVECTOR should be parsed and
* used here, provided such fonts do exist.
*/
ft_synthesize_vertical_metrics( &slot->metrics,
- bdf->bdffont->bbx.height << 6 );
+ bdf->bdffont->bbx.height * 64 );
Exit:
return error;
@@ -836,8 +837,8 @@ THE SOFTWARE.
static const FT_ServiceDescRec bdf_services[] =
{
- { FT_SERVICE_ID_BDF, &bdf_service_bdf },
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_BDF },
+ { FT_SERVICE_ID_BDF, &bdf_service_bdf },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_BDF },
{ NULL, NULL }
};
diff --git a/src/3rdparty/freetype/src/bdf/bdfdrivr.h b/src/3rdparty/freetype/src/bdf/bdfdrivr.h
index ca0dae50d2..3c61d644f4 100644
--- a/src/3rdparty/freetype/src/bdf/bdfdrivr.h
+++ b/src/3rdparty/freetype/src/bdf/bdfdrivr.h
@@ -43,7 +43,7 @@ FT_BEGIN_HEADER
typedef struct BDF_encoding_el_
{
- FT_ULong enc;
+ FT_Long enc;
FT_UShort glyph;
} BDF_encoding_el;
diff --git a/src/3rdparty/freetype/src/bdf/bdflib.c b/src/3rdparty/freetype/src/bdf/bdflib.c
index abcfdee7be..414deb58ad 100644
--- a/src/3rdparty/freetype/src/bdf/bdflib.c
+++ b/src/3rdparty/freetype/src/bdf/bdflib.c
@@ -243,7 +243,7 @@
/* Mocklisp hash function. */
while ( *kp )
- res = ( res << 5 ) - res + *kp++;
+ res = ( res << 5 ) - res + (unsigned long)*kp++;
ndp = bp + ( res % ht->size );
while ( *ndp )
@@ -264,9 +264,9 @@
hash_rehash( hashtable* ht,
FT_Memory memory )
{
- hashnode* obp = ht->table, *bp, *nbp;
- int i, sz = ht->size;
- FT_Error error = FT_Err_Ok;
+ hashnode* obp = ht->table, *bp, *nbp;
+ unsigned int i, sz = ht->size;
+ FT_Error error = FT_Err_Ok;
ht->size <<= 1;
@@ -294,8 +294,8 @@
hash_init( hashtable* ht,
FT_Memory memory )
{
- int sz = INITIAL_HT_SIZE;
- FT_Error error = FT_Err_Ok;
+ unsigned int sz = INITIAL_HT_SIZE;
+ FT_Error error = FT_Err_Ok;
ht->size = sz;
@@ -316,8 +316,8 @@
{
if ( ht != 0 )
{
- int i, sz = ht->size;
- hashnode* bp = ht->table;
+ unsigned int i, sz = ht->size;
+ hashnode* bp = ht->table;
for ( i = 0; i < sz; i++, bp++ )
@@ -570,10 +570,11 @@
char* line,
unsigned long linelen )
{
- int mult, final_empty;
- char *sp, *ep, *end;
- char seps[32];
- FT_Error error = FT_Err_Ok;
+ unsigned long final_empty;
+ int mult;
+ char *sp, *ep, *end;
+ char seps[32];
+ FT_Error error = FT_Err_Ok;
/* Initialize the list. */
@@ -682,7 +683,7 @@
unsigned long lineno, buf_size;
int refill, hold, to_skip;
ptrdiff_t bytes, start, end, cursor, avail;
- char* buf = 0;
+ char* buf = NULL;
FT_Memory memory = stream->memory;
FT_Error error = FT_Err_Ok;
@@ -715,7 +716,7 @@
{
bytes = (ptrdiff_t)FT_Stream_TryRead(
stream, (FT_Byte*)buf + cursor,
- (FT_ULong)( buf_size - cursor ) );
+ buf_size - (unsigned long)cursor );
avail = cursor + bytes;
cursor = 0;
refill = 0;
@@ -760,7 +761,7 @@
if ( FT_RENEW_ARRAY( buf, buf_size, new_size ) )
goto Exit;
- cursor = buf_size;
+ cursor = (ptrdiff_t)buf_size;
buf_size = new_size;
}
else
@@ -858,9 +859,9 @@
/* Routine to convert an ASCII string into an unsigned long integer. */
static unsigned long
- _bdf_atoul( char* s,
- char** end,
- int base )
+ _bdf_atoul( char* s,
+ char** end,
+ unsigned int base )
{
unsigned long v;
const unsigned char* dmap;
@@ -903,7 +904,7 @@
}
- /* Routine to convert an ASCII string into an signed long integer. */
+ /* Routine to convert an ASCII string into a signed long integer. */
static long
_bdf_atol( char* s,
char** end,
@@ -958,7 +959,54 @@
}
- /* Routine to convert an ASCII string into an signed short integer. */
+ /* Routine to convert an ASCII string into an unsigned short integer. */
+ static unsigned short
+ _bdf_atous( char* s,
+ char** end,
+ unsigned int base )
+ {
+ unsigned short v;
+ const unsigned char* dmap;
+
+
+ if ( s == 0 || *s == 0 )
+ return 0;
+
+ /* Make sure the radix is something recognizable. Default to 10. */
+ switch ( base )
+ {
+ case 8:
+ dmap = odigits;
+ break;
+ case 16:
+ dmap = hdigits;
+ break;
+ default:
+ base = 10;
+ dmap = ddigits;
+ break;
+ }
+
+ /* Check for the special hex prefix. */
+ if ( *s == '0' &&
+ ( *( s + 1 ) == 'x' || *( s + 1 ) == 'X' ) )
+ {
+ base = 16;
+ dmap = hdigits;
+ s += 2;
+ }
+
+ for ( v = 0; sbitset( dmap, *s ); s++ )
+ v = (unsigned short)( v * base + a2i[(int)*s] );
+
+ if ( end != 0 )
+ *end = s;
+
+ return v;
+ }
+
+
+ /* Routine to convert an ASCII string into a signed short integer. */
static short
_bdf_atos( char* s,
char** end,
@@ -1115,20 +1163,20 @@
/* Parse flags. */
-#define _BDF_START 0x0001
-#define _BDF_FONT_NAME 0x0002
-#define _BDF_SIZE 0x0004
-#define _BDF_FONT_BBX 0x0008
-#define _BDF_PROPS 0x0010
-#define _BDF_GLYPHS 0x0020
-#define _BDF_GLYPH 0x0040
-#define _BDF_ENCODING 0x0080
-#define _BDF_SWIDTH 0x0100
-#define _BDF_DWIDTH 0x0200
-#define _BDF_BBX 0x0400
-#define _BDF_BITMAP 0x0800
-
-#define _BDF_SWIDTH_ADJ 0x1000
+#define _BDF_START 0x0001U
+#define _BDF_FONT_NAME 0x0002U
+#define _BDF_SIZE 0x0004U
+#define _BDF_FONT_BBX 0x0008U
+#define _BDF_PROPS 0x0010U
+#define _BDF_GLYPHS 0x0020U
+#define _BDF_GLYPH 0x0040U
+#define _BDF_ENCODING 0x0080U
+#define _BDF_SWIDTH 0x0100U
+#define _BDF_DWIDTH 0x0200U
+#define _BDF_BBX 0x0400U
+#define _BDF_BITMAP 0x0800U
+
+#define _BDF_SWIDTH_ADJ 0x1000U
#define _BDF_GLYPH_BITS ( _BDF_GLYPH | \
_BDF_ENCODING | \
@@ -1703,7 +1751,7 @@
glyph->encoding = p->glyph_enc;
/* Reset the initial glyph info. */
- p->glyph_name = 0;
+ p->glyph_name = NULL;
}
else
{
@@ -1724,14 +1772,14 @@
glyph = font->unencoded + font->unencoded_used;
glyph->name = p->glyph_name;
- glyph->encoding = font->unencoded_used++;
+ glyph->encoding = (long)font->unencoded_used++;
}
else
/* Free up the glyph name if the unencoded shouldn't be */
/* kept. */
FT_FREE( p->glyph_name );
- p->glyph_name = 0;
+ p->glyph_name = NULL;
}
/* Clear the flags that might be added when width and height are */
@@ -1864,8 +1912,8 @@
if ( error )
goto Exit;
- glyph->bbx.width = _bdf_atos( p->list.field[1], 0, 10 );
- glyph->bbx.height = _bdf_atos( p->list.field[2], 0, 10 );
+ glyph->bbx.width = _bdf_atous( p->list.field[1], 0, 10 );
+ glyph->bbx.height = _bdf_atous( p->list.field[2], 0, 10 );
glyph->bbx.x_offset = _bdf_atos( p->list.field[3], 0, 10 );
glyph->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );
@@ -2225,8 +2273,8 @@
if ( error )
goto Exit;
- p->font->bbx.width = _bdf_atos( p->list.field[1], 0, 10 );
- p->font->bbx.height = _bdf_atos( p->list.field[2], 0, 10 );
+ p->font->bbx.width = _bdf_atous( p->list.field[1], 0, 10 );
+ p->font->bbx.height = _bdf_atous( p->list.field[2], 0, 10 );
p->font->bbx.x_offset = _bdf_atos( p->list.field[3], 0, 10 );
p->font->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );
@@ -2298,29 +2346,23 @@
/* Check for the bits per pixel field. */
if ( p->list.used == 5 )
{
- unsigned short bitcount, i, shift;
+ unsigned short bpp;
- p->font->bpp = (unsigned short)_bdf_atos( p->list.field[4], 0, 10 );
+ bpp = (unsigned short)_bdf_atos( p->list.field[4], 0, 10 );
- /* Only values 1, 2, 4, 8 are allowed. */
- shift = p->font->bpp;
- bitcount = 0;
- for ( i = 0; shift > 0; i++ )
- {
- if ( shift & 1 )
- bitcount = i;
- shift >>= 1;
- }
-
- shift = (short)( ( bitcount > 3 ) ? 8 : ( 1 << bitcount ) );
+ /* Only values 1, 2, 4, 8 are allowed for greymap fonts. */
+ if ( bpp > 4 )
+ p->font->bpp = 8;
+ else if ( bpp > 2 )
+ p->font->bpp = 4;
+ else if ( bpp > 1 )
+ p->font->bpp = 2;
+ else
+ p->font->bpp = 1;
- if ( p->font->bpp > shift || p->font->bpp != shift )
- {
- /* select next higher value */
- p->font->bpp = (unsigned short)( shift << 1 );
+ if ( p->font->bpp != bpp )
FT_TRACE2(( "_bdf_parse_start: " ACMSG11, p->font->bpp ));
- }
}
else
p->font->bpp = 1;
diff --git a/src/3rdparty/freetype/src/bdf/rules.mk b/src/3rdparty/freetype/src/bdf/rules.mk
index 6ff1614dde..d1dd76b1c3 100644
--- a/src/3rdparty/freetype/src/bdf/rules.mk
+++ b/src/3rdparty/freetype/src/bdf/rules.mk
@@ -32,7 +32,10 @@
BDF_DIR := $(SRC_DIR)/bdf
-BDF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(BDF_DIR))
+BDF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(BDF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# bdf driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/bzip2/Jamfile b/src/3rdparty/freetype/src/bzip2/Jamfile
index 3da986dce6..53f850e6f2 100644
--- a/src/3rdparty/freetype/src/bzip2/Jamfile
+++ b/src/3rdparty/freetype/src/bzip2/Jamfile
@@ -1,10 +1,9 @@
# FreeType 2 src/bzip2 Jamfile
#
-# Copyright 2010 by
+# Copyright 2010-2015 by
# Joel Klinghed
#
-# Based on src/lzw/Jamfile, Copyright 2004, 2006 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
+# based on `src/lzw/Jamfile'
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
diff --git a/src/3rdparty/freetype/src/bzip2/ftbzip2.c b/src/3rdparty/freetype/src/bzip2/ftbzip2.c
index 7e406b1612..cf94733762 100644
--- a/src/3rdparty/freetype/src/bzip2/ftbzip2.c
+++ b/src/3rdparty/freetype/src/bzip2/ftbzip2.c
@@ -8,11 +8,10 @@
/* parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2010, 2012-2014 by */
+/* Copyright 2010-2015 by */
/* Joel Klinghed. */
/* */
-/* Based on src/gzip/ftgzip.c, Copyright 2002 - 2010 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* based on `src/gzip/ftgzip.c' */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -71,7 +70,7 @@
int items,
int size )
{
- FT_ULong sz = (FT_ULong)size * items;
+ FT_ULong sz = (FT_ULong)size * (FT_ULong)items;
FT_Error error;
FT_Pointer p = NULL;
@@ -255,7 +254,10 @@
size = stream->read( stream, stream->pos, zip->input,
FT_BZIP2_BUFFER_SIZE );
if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
return FT_THROW( Invalid_Stream_Operation );
+ }
}
else
{
@@ -264,7 +266,10 @@
size = FT_BZIP2_BUFFER_SIZE;
if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
return FT_THROW( Invalid_Stream_Operation );
+ }
FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
}
@@ -311,7 +316,8 @@
}
else if ( err != BZ_OK )
{
- error = FT_THROW( Invalid_Stream_Operation );
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
break;
}
}
@@ -438,16 +444,16 @@
}
- static FT_ULong
- ft_bzip2_stream_io( FT_Stream stream,
- FT_ULong pos,
- FT_Byte* buffer,
- FT_ULong count )
+ static unsigned long
+ ft_bzip2_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
{
FT_BZip2File zip = (FT_BZip2File)stream->descriptor.pointer;
- return ft_bzip2_file_io( zip, pos, buffer, count );
+ return ft_bzip2_file_io( zip, offset, buffer, count );
}
diff --git a/src/3rdparty/freetype/src/bzip2/rules.mk b/src/3rdparty/freetype/src/bzip2/rules.mk
index 0ff2628b4a..7040588c1b 100644
--- a/src/3rdparty/freetype/src/bzip2/rules.mk
+++ b/src/3rdparty/freetype/src/bzip2/rules.mk
@@ -2,11 +2,10 @@
# FreeType 2 BZIP2 support configuration rules
#
-# Copyright 2010 by
+# Copyright 2010-2015 by
# Joel Klinghed.
#
-# Based on src/lzw/rules.mk, Copyright 2004-2006 by
-# Albert Chin-A-Young.
+# based on `src/lzw/rules.mk'
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
@@ -22,7 +21,9 @@ BZIP2_DIR := $(SRC_DIR)/bzip2
# compilation flags for the driver
#
-BZIP2_COMPILE := $(FT_COMPILE)
+BZIP2_COMPILE := $(CC) $(ANSIFLAGS) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# BZIP2 support sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/cache/Jamfile b/src/3rdparty/freetype/src/cache/Jamfile
index 6563991375..1d2bb29392 100644
--- a/src/3rdparty/freetype/src/cache/Jamfile
+++ b/src/3rdparty/freetype/src/cache/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/cache Jamfile
#
-# Copyright 2001, 2003, 2004, 2013 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -11,25 +11,19 @@
SubDir FT2_TOP $(FT2_SRC_DIR) cache ;
-# The file <ftcache.h> contains some macro definitions that are
-# later used in #include statements related to the cache sub-system. It
-# needs to be parsed through a HDRMACRO rule for macro definitions.
-#
-HDRMACRO [ FT2_SubDir include ftcache.h ] ;
-
{
local _sources ;
if $(FT2_MULTI)
{
- _sources = ftcmru
- ftcmanag
+ _sources = ftcbasic
ftccache
ftcglyph
- ftcsbits
ftcimage
- ftcbasic
+ ftcmanag
ftccmap
+ ftcmru
+ ftcsbits
;
}
else
diff --git a/src/3rdparty/freetype/src/cache/ftcache.c b/src/3rdparty/freetype/src/cache/ftcache.c
index d41e91e5ec..8de527acab 100644
--- a/src/3rdparty/freetype/src/cache/ftcache.c
+++ b/src/3rdparty/freetype/src/cache/ftcache.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType Caching sub-system (body only). */
/* */
-/* Copyright 2000-2001, 2003 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftcbasic.c b/src/3rdparty/freetype/src/cache/ftcbasic.c
index 6bad39d912..ac3290cef4 100644
--- a/src/3rdparty/freetype/src/cache/ftcbasic.c
+++ b/src/3rdparty/freetype/src/cache/ftcbasic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType basic cache interface (body). */
/* */
-/* Copyright 2003-2007, 2009-2011, 2013, 2014 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -45,8 +45,8 @@
FT_BOOL( FTC_SCALER_COMPARE( &(a)->scaler, &(b)->scaler ) && \
(a)->load_flags == (b)->load_flags )
-#define FTC_BASIC_ATTR_HASH( a ) \
- ( FTC_SCALER_HASH( &(a)->scaler ) + 31*(a)->load_flags )
+#define FTC_BASIC_ATTR_HASH( a ) \
+ ( FTC_SCALER_HASH( &(a)->scaler ) + 31 * (a)->load_flags )
typedef struct FTC_BasicQueryRec_
@@ -138,8 +138,10 @@
FT_Face face = size->face;
- error = FT_Load_Glyph( face, gindex,
- family->attrs.load_flags | FT_LOAD_RENDER );
+ error = FT_Load_Glyph(
+ face,
+ gindex,
+ (FT_Int)family->attrs.load_flags | FT_LOAD_RENDER );
if ( !error )
*aface = face;
}
@@ -169,7 +171,9 @@
{
face = size->face;
- error = FT_Load_Glyph( face, gindex, family->attrs.load_flags );
+ error = FT_Load_Glyph( face,
+ gindex,
+ (FT_Int)family->attrs.load_flags );
if ( !error )
{
if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP ||
@@ -283,7 +287,7 @@
FTC_BasicQueryRec query;
FTC_Node node = 0; /* make compiler happy */
FT_Error error;
- FT_PtrDist hash;
+ FT_Offset hash;
/* some argument checks are delayed to `FTC_Cache_Lookup' */
@@ -300,7 +304,7 @@
if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )
FT_TRACE1(( "FTC_ImageCache_Lookup:"
" higher bits in load_flags 0x%x are dropped\n",
- type->flags & ~((FT_ULong)FT_UINT_MAX) ));
+ (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) ));
query.attrs.scaler.face_id = type->face_id;
query.attrs.scaler.width = type->width;
@@ -356,7 +360,7 @@
FTC_BasicQueryRec query;
FTC_Node node = 0; /* make compiler happy */
FT_Error error;
- FT_PtrDist hash;
+ FT_Offset hash;
/* some argument checks are delayed to `FTC_Cache_Lookup' */
@@ -466,7 +470,7 @@
FT_Error error;
FTC_BasicQueryRec query;
FTC_Node node = 0; /* make compiler happy */
- FT_PtrDist hash;
+ FT_Offset hash;
if ( anode )
@@ -481,7 +485,7 @@
if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )
FT_TRACE1(( "FTC_ImageCache_Lookup:"
" higher bits in load_flags 0x%x are dropped\n",
- type->flags & ~((FT_ULong)FT_UINT_MAX) ));
+ (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) ));
query.attrs.scaler.face_id = type->face_id;
query.attrs.scaler.width = type->width;
@@ -541,7 +545,7 @@
FT_Error error;
FTC_BasicQueryRec query;
FTC_Node node = 0; /* make compiler happy */
- FT_PtrDist hash;
+ FT_Offset hash;
if ( anode )
diff --git a/src/3rdparty/freetype/src/cache/ftccache.c b/src/3rdparty/freetype/src/cache/ftccache.c
index f20dd4502c..d8c5b99681 100644
--- a/src/3rdparty/freetype/src/cache/ftccache.c
+++ b/src/3rdparty/freetype/src/cache/ftccache.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType internal cache interface (body). */
/* */
-/* Copyright 2000-2007, 2009-2011, 2013 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -88,16 +88,16 @@
* body for FTC_NODE__TOP_FOR_HASH( cache, hash )
*/
FT_LOCAL_DEF( FTC_Node* )
- ftc_get_top_node_for_hash( FTC_Cache cache,
- FT_PtrDist hash )
+ ftc_get_top_node_for_hash( FTC_Cache cache,
+ FT_Offset hash )
{
FTC_Node* pnode;
- FT_UInt idx;
+ FT_Offset idx;
- idx = (FT_UInt)( hash & cache->mask );
+ idx = hash & cache->mask;
if ( idx < cache->p )
- idx = (FT_UInt)( hash & ( 2 * cache->mask + 1 ) );
+ idx = hash & ( 2 * cache->mask + 1 );
pnode = cache->buckets + idx;
return pnode;
}
@@ -414,7 +414,7 @@
static void
ftc_cache_add( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FTC_Node node )
{
node->hash = hash;
@@ -442,7 +442,7 @@
FT_LOCAL_DEF( FT_Error )
FTC_Cache_NewNode( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_Pointer query,
FTC_Node *anode )
{
@@ -481,7 +481,7 @@
FT_LOCAL_DEF( FT_Error )
FTC_Cache_Lookup( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_Pointer query,
FTC_Node *anode )
{
diff --git a/src/3rdparty/freetype/src/cache/ftccache.h b/src/3rdparty/freetype/src/cache/ftccache.h
index 4155f320e0..4e17c7afef 100644
--- a/src/3rdparty/freetype/src/cache/ftccache.h
+++ b/src/3rdparty/freetype/src/cache/ftccache.h
@@ -4,7 +4,7 @@
/* */
/* FreeType internal cache interface (specification). */
/* */
-/* Copyright 2000-2007, 2009-2011, 2013 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,8 +24,8 @@
FT_BEGIN_HEADER
-#define _FTC_FACE_ID_HASH( i ) \
- ((FT_PtrDist)(( (FT_PtrDist)(i) >> 3 ) ^ ( (FT_PtrDist)(i) << 7 )))
+#define _FTC_FACE_ID_HASH( i ) \
+ ( ( (FT_Offset)(i) >> 3 ) ^ ( (FT_Offset)(i) << 7 ) )
/* handle to cache object */
typedef struct FTC_CacheRec_* FTC_Cache;
@@ -59,7 +59,7 @@ FT_BEGIN_HEADER
{
FTC_MruNodeRec mru; /* circular mru list pointer */
FTC_Node link; /* used for hashing */
- FT_PtrDist hash; /* used for hashing too */
+ FT_Offset hash; /* used for hashing too */
FT_UShort cache_index; /* index of cache the node belongs to */
FT_Short ref_count; /* reference count for this node */
@@ -80,8 +80,8 @@ FT_BEGIN_HEADER
: ( ( hash ) & ( cache )->mask ) ) )
#else
FT_LOCAL( FTC_Node* )
- ftc_get_top_node_for_hash( FTC_Cache cache,
- FT_PtrDist hash );
+ ftc_get_top_node_for_hash( FTC_Cache cache,
+ FT_Offset hash );
#define FTC_NODE__TOP_FOR_HASH( cache, hash ) \
ftc_get_top_node_for_hash( ( cache ), ( hash ) )
#endif
@@ -179,14 +179,14 @@ FT_BEGIN_HEADER
#ifndef FTC_INLINE
FT_LOCAL( FT_Error )
FTC_Cache_Lookup( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_Pointer query,
FTC_Node *anode );
#endif
FT_LOCAL( FT_Error )
FTC_Cache_NewNode( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_Pointer query,
FTC_Node *anode );
@@ -211,7 +211,7 @@ FT_BEGIN_HEADER
FT_BEGIN_STMNT \
FTC_Node *_bucket, *_pnode, _node; \
FTC_Cache _cache = FTC_CACHE(cache); \
- FT_PtrDist _hash = (FT_PtrDist)(hash); \
+ FT_Offset _hash = (FT_Offset)(hash); \
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
FT_Bool _list_changed = FALSE; \
\
diff --git a/src/3rdparty/freetype/src/cache/ftccback.h b/src/3rdparty/freetype/src/cache/ftccback.h
index 9528279273..b3237d5a3f 100644
--- a/src/3rdparty/freetype/src/cache/ftccback.h
+++ b/src/3rdparty/freetype/src/cache/ftccback.h
@@ -4,7 +4,7 @@
/* */
/* Callback functions of the caching sub-system (specification only). */
/* */
-/* Copyright 2004-2006, 2011, 2013 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftccmap.c b/src/3rdparty/freetype/src/cache/ftccmap.c
index ab223663bb..b8262220c4 100644
--- a/src/3rdparty/freetype/src/cache/ftccmap.c
+++ b/src/3rdparty/freetype/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType CharMap cache (body) */
/* */
-/* Copyright 2000-2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -63,8 +63,6 @@
} FTC_CMapQueryRec, *FTC_CMapQuery;
#define FTC_CMAP_QUERY( x ) ((FTC_CMapQuery)(x))
-#define FTC_CMAP_QUERY_HASH( x ) \
- FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code )
/* the cmap cache node */
typedef struct FTC_CMapNodeRec_
@@ -78,8 +76,6 @@
} FTC_CMapNodeRec, *FTC_CMapNode;
#define FTC_CMAP_NODE( x ) ( (FTC_CMapNode)( x ) )
-#define FTC_CMAP_NODE_HASH( x ) \
- FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first )
/* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */
/* glyph indices haven't been queried through FT_Get_Glyph_Index() yet */
@@ -242,7 +238,7 @@
FTC_Node node;
FT_Error error;
FT_UInt gindex = 0;
- FT_PtrDist hash;
+ FT_Offset hash;
FT_Int no_cmap_change = 0;
@@ -270,7 +266,7 @@
query.cmap_index = (FT_UInt)cmap_index;
query.char_code = char_code;
- hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );
+ hash = FTC_CMAP_HASH( face_id, (FT_UInt)cmap_index, char_code );
#if 1
FTC_CACHE_LOOKUP_CMP( cache, ftc_cmap_node_compare, hash, &query,
diff --git a/src/3rdparty/freetype/src/cache/ftcerror.h b/src/3rdparty/freetype/src/cache/ftcerror.h
index 0e055709bb..15adec58de 100644
--- a/src/3rdparty/freetype/src/cache/ftcerror.h
+++ b/src/3rdparty/freetype/src/cache/ftcerror.h
@@ -4,7 +4,7 @@
/* */
/* Caching sub-system error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftcglyph.c b/src/3rdparty/freetype/src/cache/ftcglyph.c
index 441e177238..343b8a7793 100644
--- a/src/3rdparty/freetype/src/cache/ftcglyph.c
+++ b/src/3rdparty/freetype/src/cache/ftcglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Glyph Image (FT_Glyph) cache (body). */
/* */
-/* Copyright 2000-2001, 2003, 2004, 2006, 2009, 2011 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -185,7 +185,7 @@
FT_LOCAL_DEF( FT_Error )
FTC_GCache_Lookup( FTC_GCache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_UInt gindex,
FTC_GQuery query,
FTC_Node *anode )
diff --git a/src/3rdparty/freetype/src/cache/ftcglyph.h b/src/3rdparty/freetype/src/cache/ftcglyph.h
index 5fed19cb8f..6cadbe2c10 100644
--- a/src/3rdparty/freetype/src/cache/ftcglyph.h
+++ b/src/3rdparty/freetype/src/cache/ftcglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType abstract glyph cache (specification). */
/* */
-/* Copyright 2000-2001, 2003, 2004, 2006, 2007, 2011 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -260,7 +260,7 @@ FT_BEGIN_HEADER
#ifndef FTC_INLINE
FT_LOCAL( FT_Error )
FTC_GCache_Lookup( FTC_GCache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_UInt gindex,
FTC_GQuery query,
FTC_Node *anode );
diff --git a/src/3rdparty/freetype/src/cache/ftcimage.c b/src/3rdparty/freetype/src/cache/ftcimage.c
index c242ece021..f519a6179c 100644
--- a/src/3rdparty/freetype/src/cache/ftcimage.c
+++ b/src/3rdparty/freetype/src/cache/ftcimage.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (body). */
/* */
-/* Copyright 2000-2001, 2003, 2004, 2006, 2010 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,7 @@
#include FT_CACHE_H
#include "ftcimage.h"
#include FT_INTERNAL_MEMORY_H
+#include FT_INTERNAL_OBJECTS_H
#include "ftccback.h"
#include "ftcerror.h"
@@ -122,7 +123,7 @@
bitg = (FT_BitmapGlyph)glyph;
- size = bitg->bitmap.rows * ft_labs( bitg->bitmap.pitch ) +
+ size = bitg->bitmap.rows * (FT_Offset)FT_ABS( bitg->bitmap.pitch ) +
sizeof ( *bitg );
}
break;
@@ -133,9 +134,9 @@
outg = (FT_OutlineGlyph)glyph;
- size = outg->outline.n_points *
+ size = (FT_Offset)outg->outline.n_points *
( sizeof ( FT_Vector ) + sizeof ( FT_Byte ) ) +
- outg->outline.n_contours * sizeof ( FT_Short ) +
+ (FT_Offset)outg->outline.n_contours * sizeof ( FT_Short ) +
sizeof ( *outg );
}
break;
diff --git a/src/3rdparty/freetype/src/cache/ftcimage.h b/src/3rdparty/freetype/src/cache/ftcimage.h
index 20d5d3e07d..b312eaa3d9 100644
--- a/src/3rdparty/freetype/src/cache/ftcimage.h
+++ b/src/3rdparty/freetype/src/cache/ftcimage.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Generic Image cache (specification) */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2006 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftcmanag.c b/src/3rdparty/freetype/src/cache/ftcmanag.c
index fff7a08827..658614c8db 100644
--- a/src/3rdparty/freetype/src/cache/ftcmanag.c
+++ b/src/3rdparty/freetype/src/cache/ftcmanag.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (body). */
/* */
-/* Copyright 2000-2006, 2008-2010, 2013, 2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -34,8 +34,6 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_cache
-#define FTC_LRU_GET_MANAGER( lru ) ( (FTC_Manager)(lru)->user_data )
-
static FT_Error
ftc_scaler_lookup_size( FTC_Manager manager,
@@ -60,8 +58,11 @@
if ( scaler->pixel )
error = FT_Set_Pixel_Sizes( face, scaler->width, scaler->height );
else
- error = FT_Set_Char_Size( face, scaler->width, scaler->height,
- scaler->x_res, scaler->y_res );
+ error = FT_Set_Char_Size( face,
+ (FT_F26Dot6)scaler->width,
+ (FT_F26Dot6)scaler->height,
+ scaler->x_res,
+ scaler->y_res );
if ( error )
{
FT_Done_Size( size );
diff --git a/src/3rdparty/freetype/src/cache/ftcmanag.h b/src/3rdparty/freetype/src/cache/ftcmanag.h
index 0aec33c584..c6787b72c5 100644
--- a/src/3rdparty/freetype/src/cache/ftcmanag.h
+++ b/src/3rdparty/freetype/src/cache/ftcmanag.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (specification). */
/* */
-/* Copyright 2000-2001, 2003, 2004, 2006, 2010, 2013 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftcmru.c b/src/3rdparty/freetype/src/cache/ftcmru.c
index dc8b4cc397..10ce4f301e 100644
--- a/src/3rdparty/freetype/src/cache/ftcmru.c
+++ b/src/3rdparty/freetype/src/cache/ftcmru.c
@@ -4,7 +4,7 @@
/* */
/* FreeType MRU support (body). */
/* */
-/* Copyright 2003, 2004, 2006, 2009 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftcmru.h b/src/3rdparty/freetype/src/cache/ftcmru.h
index 6fccf11781..c0c35f934b 100644
--- a/src/3rdparty/freetype/src/cache/ftcmru.h
+++ b/src/3rdparty/freetype/src/cache/ftcmru.h
@@ -4,7 +4,7 @@
/* */
/* Simple MRU list-cache (specification). */
/* */
-/* Copyright 2000-2001, 2003-2006, 2010, 2013 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/ftcsbits.c b/src/3rdparty/freetype/src/cache/ftcsbits.c
index 59727d16e2..8141719167 100644
--- a/src/3rdparty/freetype/src/cache/ftcsbits.c
+++ b/src/3rdparty/freetype/src/cache/ftcsbits.c
@@ -4,7 +4,7 @@
/* */
/* FreeType sbits manager (body). */
/* */
-/* Copyright 2000-2006, 2009-2011, 2013, 2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -52,7 +52,7 @@
if ( pitch < 0 )
pitch = -pitch;
- size = (FT_ULong)( pitch * bitmap->rows );
+ size = (FT_ULong)pitch * bitmap->rows;
if ( !FT_ALLOC( sbit->buffer, size ) )
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
@@ -181,7 +181,7 @@
/* now, compute size */
if ( asize )
- *asize = FT_ABS( sbit->pitch ) * sbit->height;
+ *asize = (FT_ULong)FT_ABS( sbit->pitch ) * sbit->height;
} /* glyph loading successful */
@@ -302,7 +302,7 @@
pitch = -pitch;
/* add the size of a given glyph image */
- size += pitch * sbit->height;
+ size += (FT_Offset)pitch * sbit->height;
}
}
diff --git a/src/3rdparty/freetype/src/cache/ftcsbits.h b/src/3rdparty/freetype/src/cache/ftcsbits.h
index df55dca806..5a2fa1ac80 100644
--- a/src/3rdparty/freetype/src/cache/ftcsbits.h
+++ b/src/3rdparty/freetype/src/cache/ftcsbits.h
@@ -4,7 +4,7 @@
/* */
/* A small-bitmap cache (specification). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2006, 2011 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cache/rules.mk b/src/3rdparty/freetype/src/cache/rules.mk
index ed75a6a91f..6d5cf344b3 100644
--- a/src/3rdparty/freetype/src/cache/rules.mk
+++ b/src/3rdparty/freetype/src/cache/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2000, 2001, 2003, 2004, 2006, 2008 by
+# Copyright 2000-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -17,9 +17,13 @@
#
CACHE_DIR := $(SRC_DIR)/cache
+
# compilation flags for the driver
#
-CACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR))
+CACHE_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Cache driver sources (i.e., C files)
@@ -33,6 +37,7 @@ CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \
$(CACHE_DIR)/ftcmru.c \
$(CACHE_DIR)/ftcsbits.c
+
# Cache driver headers
#
CACHE_DRV_H := $(CACHE_DIR)/ftccache.h \
diff --git a/src/3rdparty/freetype/src/cff/Jamfile b/src/3rdparty/freetype/src/cff/Jamfile
index 6705d3cfdb..deec0792ce 100644
--- a/src/3rdparty/freetype/src/cff/Jamfile
+++ b/src/3rdparty/freetype/src/cff/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/cff Jamfile
#
-# Copyright 2001, 2002 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,23 @@ SubDir FT2_TOP $(FT2_SRC_DIR) cff ;
if $(FT2_MULTI)
{
- _sources = cffdrivr cffgload cffload cffobjs cffparse cffcmap cffpic ;
+ _sources = cffcmap
+ cffdrivr
+ cffgload
+ cffload
+ cffobjs
+ cffparse
+ cffpic
+ cf2arrst
+ cf2blues
+ cf2error
+ cf2font
+ cf2ft
+ cf2hints
+ cf2intrp
+ cf2read
+ cf2stack
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/cff/cf2arrst.c b/src/3rdparty/freetype/src/cff/cf2arrst.c
index c8d6f13098..89f3e9f1d7 100644
--- a/src/3rdparty/freetype/src/cff/cf2arrst.c
+++ b/src/3rdparty/freetype/src/cff/cf2arrst.c
@@ -101,10 +101,10 @@
FT_Error error = FT_Err_Ok; /* for FT_REALLOC */
FT_Memory memory = arrstack->memory; /* for FT_REALLOC */
- FT_Long newSize = (FT_Long)( numElements * arrstack->sizeItem );
+ size_t newSize = numElements * arrstack->sizeItem;
- if ( numElements > LONG_MAX / arrstack->sizeItem )
+ if ( numElements > FT_LONG_MAX / arrstack->sizeItem )
goto exit;
diff --git a/src/3rdparty/freetype/src/cff/cf2fixed.h b/src/3rdparty/freetype/src/cff/cf2fixed.h
index ed1452a7da..d6d9faf8e5 100644
--- a/src/3rdparty/freetype/src/cff/cf2fixed.h
+++ b/src/3rdparty/freetype/src/cff/cf2fixed.h
@@ -57,22 +57,22 @@ FT_BEGIN_HEADER
/* in C 89, left and right shift of negative numbers is */
/* implementation specific behaviour in the general case */
-#define cf2_intToFixed( i ) \
+#define cf2_intToFixed( i ) \
( (CF2_Fixed)( (FT_UInt32)(i) << 16 ) )
-#define cf2_fixedToInt( x ) \
+#define cf2_fixedToInt( x ) \
( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
-#define cf2_fixedRound( x ) \
- ( (CF2_Fixed)( ( (x) + 0x8000 ) & 0xFFFF0000L ) )
-#define cf2_floatToFixed( f ) \
+#define cf2_fixedRound( x ) \
+ ( (CF2_Fixed)( ( (FT_UInt32)(x) + 0x8000U ) & 0xFFFF0000UL ) )
+#define cf2_floatToFixed( f ) \
( (CF2_Fixed)( (f) * 65536.0 + 0.5 ) )
-#define cf2_fixedAbs( x ) \
+#define cf2_fixedAbs( x ) \
( (x) < 0 ? -(x) : (x) )
-#define cf2_fixedFloor( x ) \
- ( (CF2_Fixed)( (x) & 0xFFFF0000L ) )
-#define cf2_fixedFraction( x ) \
+#define cf2_fixedFloor( x ) \
+ ( (CF2_Fixed)( (FT_UInt32)(x) & 0xFFFF0000UL ) )
+#define cf2_fixedFraction( x ) \
( (x) - cf2_fixedFloor( x ) )
-#define cf2_fracToFixed( x ) \
- ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 ) \
+#define cf2_fracToFixed( x ) \
+ ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 ) \
: ( ( (x) + 0x2000 ) >> 14 ) )
diff --git a/src/3rdparty/freetype/src/cff/cf2font.h b/src/3rdparty/freetype/src/cff/cf2font.h
index d8860ce8ed..86cf02f49d 100644
--- a/src/3rdparty/freetype/src/cff/cf2font.h
+++ b/src/3rdparty/freetype/src/cff/cf2font.h
@@ -48,7 +48,12 @@ FT_BEGIN_HEADER
#define CF2_OPERAND_STACK_SIZE 48
-#define CF2_MAX_SUBR 10 /* maximum subroutine nesting */
+#define CF2_MAX_SUBR 16 /* maximum subroutine nesting; */
+ /* only 10 are allowed but there exist */
+ /* fonts like `HiraKakuProN-W3.ttf' */
+ /* (Hiragino Kaku Gothic ProN W3; */
+ /* 8.2d6e1; 2014-12-19) that exceed */
+ /* this limit */
/* typedef is in `cf2glue.h' */
diff --git a/src/3rdparty/freetype/src/cff/cf2ft.c b/src/3rdparty/freetype/src/cff/cf2ft.c
index ebba4694ce..d2544a2345 100644
--- a/src/3rdparty/freetype/src/cff/cf2ft.c
+++ b/src/3rdparty/freetype/src/cff/cf2ft.c
@@ -551,7 +551,7 @@
FT_ZERO( buf );
- idx += decoder->globals_bias;
+ idx += (CF2_UInt)decoder->globals_bias;
if ( idx >= decoder->num_globals )
return TRUE; /* error */
@@ -569,7 +569,7 @@
/* used for seac component */
FT_LOCAL_DEF( FT_Error )
cf2_getSeacComponent( CFF_Decoder* decoder,
- CF2_UInt code,
+ CF2_Int code,
CF2_Buffer buf )
{
CF2_Int gid;
@@ -582,12 +582,21 @@
FT_ZERO( buf );
- gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
- if ( gid < 0 )
- return FT_THROW( Invalid_Glyph_Format );
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ /* Incremental fonts don't necessarily have valid charsets. */
+ /* They use the character code, not the glyph index, in this case. */
+ if ( decoder->builder.face->root.internal->incremental_interface )
+ gid = code;
+ else
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ {
+ gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
+ if ( gid < 0 )
+ return FT_THROW( Invalid_Glyph_Format );
+ }
error = cff_get_glyph_data( decoder->builder.face,
- gid,
+ (CF2_UInt)gid,
&charstring,
&len );
/* TODO: for now, just pass the FreeType error through */
@@ -626,7 +635,7 @@
FT_ZERO( buf );
- idx += decoder->locals_bias;
+ idx += (CF2_UInt)decoder->locals_bias;
if ( idx >= decoder->num_locals )
return TRUE; /* error */
diff --git a/src/3rdparty/freetype/src/cff/cf2ft.h b/src/3rdparty/freetype/src/cff/cf2ft.h
index 731da3ca8c..3073df382f 100644
--- a/src/3rdparty/freetype/src/cff/cf2ft.h
+++ b/src/3rdparty/freetype/src/cff/cf2ft.h
@@ -103,7 +103,7 @@ FT_BEGIN_HEADER
CF2_Buffer buf );
FT_LOCAL( FT_Error )
cf2_getSeacComponent( CFF_Decoder* decoder,
- CF2_UInt code,
+ CF2_Int code,
CF2_Buffer buf );
FT_LOCAL( void )
cf2_freeSeacComponent( CFF_Decoder* decoder,
diff --git a/src/3rdparty/freetype/src/cff/cf2hints.c b/src/3rdparty/freetype/src/cff/cf2hints.c
index 040d193f31..0e27000210 100644
--- a/src/3rdparty/freetype/src/cff/cf2hints.c
+++ b/src/3rdparty/freetype/src/cff/cf2hints.c
@@ -697,10 +697,10 @@
/* make room to insert */
{
- CF2_Int iSrc = hintmap->count - 1;
- CF2_Int iDst = isPair ? hintmap->count + 1 : hintmap->count;
+ CF2_UInt iSrc = hintmap->count - 1;
+ CF2_UInt iDst = isPair ? hintmap->count + 1 : hintmap->count;
- CF2_Int count = hintmap->count - indexInsert;
+ CF2_UInt count = hintmap->count - indexInsert;
if ( iDst >= CF2_MAX_HINT_EDGES )
diff --git a/src/3rdparty/freetype/src/cff/cf2intrp.c b/src/3rdparty/freetype/src/cff/cf2intrp.c
index a26960669f..ff3fa9aaaa 100644
--- a/src/3rdparty/freetype/src/cff/cf2intrp.c
+++ b/src/3rdparty/freetype/src/cff/cf2intrp.c
@@ -43,6 +43,7 @@
#include "cf2font.h"
#include "cf2stack.h"
#include "cf2hints.h"
+#include "cf2intrp.h"
#include "cf2error.h"
@@ -760,16 +761,19 @@
/* push our current CFF charstring region on subrStack */
charstring = (CF2_Buffer)
- cf2_arrstack_getPointer( &subrStack,
- charstringIndex + 1 );
+ cf2_arrstack_getPointer(
+ &subrStack,
+ (size_t)charstringIndex + 1 );
/* set up the new CFF region and pointer */
- subrIndex = cf2_stack_popInt( opStack );
+ subrIndex = (CF2_UInt)cf2_stack_popInt( opStack );
switch ( op1 )
{
case cf2_cmdCALLGSUBR:
- FT_TRACE4(( "(%d)\n", subrIndex + decoder->globals_bias ));
+ FT_TRACE4(( " (idx %d, entering level %d)\n",
+ subrIndex + (CF2_UInt)decoder->globals_bias,
+ charstringIndex + 1 ));
if ( cf2_initGlobalRegionBuffer( decoder,
subrIndex,
@@ -782,7 +786,9 @@
default:
/* cf2_cmdCALLSUBR */
- FT_TRACE4(( "(%d)\n", subrIndex + decoder->locals_bias ));
+ FT_TRACE4(( " (idx %d, entering level %d)\n",
+ subrIndex + (CF2_UInt)decoder->locals_bias,
+ charstringIndex + 1 ));
if ( cf2_initLocalRegionBuffer( decoder,
subrIndex,
@@ -798,7 +804,7 @@
continue; /* do not clear the stack */
case cf2_cmdRETURN:
- FT_TRACE4(( " return\n" ));
+ FT_TRACE4(( " return (leaving level %d)\n", charstringIndex ));
if ( charstringIndex < 1 )
{
@@ -809,8 +815,9 @@
/* restore position in previous charstring */
charstring = (CF2_Buffer)
- cf2_arrstack_getPointer( &subrStack,
- --charstringIndex );
+ cf2_arrstack_getPointer(
+ &subrStack,
+ (CF2_UInt)--charstringIndex );
continue; /* do not clear the stack */
case cf2_cmdESC:
@@ -1088,8 +1095,8 @@
/* must be either 4 or 5 -- */
/* this is a (deprecated) implied `seac' operator */
- CF2_UInt achar;
- CF2_UInt bchar;
+ CF2_Int achar;
+ CF2_Int bchar;
CF2_BufferRec component;
CF2_Fixed dummyWidth; /* ignore component width */
FT_Error error2;
@@ -1291,10 +1298,16 @@
case cf2_cmdVVCURVETO:
{
- CF2_UInt count = cf2_stack_count( opStack );
+ CF2_UInt count, count1 = cf2_stack_count( opStack );
CF2_UInt index = 0;
+ /* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
+ /* we enforce it by clearing the second bit */
+ /* (and sorting the stack indexing to suit) */
+ count = count1 & ~2U;
+ index += count1 - count;
+
FT_TRACE4(( " vvcurveto\n" ));
while ( index < count )
@@ -1330,10 +1343,16 @@
case cf2_cmdHHCURVETO:
{
- CF2_UInt count = cf2_stack_count( opStack );
+ CF2_UInt count, count1 = cf2_stack_count( opStack );
CF2_UInt index = 0;
+ /* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
+ /* we enforce it by clearing the second bit */
+ /* (and sorting the stack indexing to suit) */
+ count = count1 & ~2U;
+ index += count1 - count;
+
FT_TRACE4(( " hhcurveto\n" ));
while ( index < count )
@@ -1370,12 +1389,19 @@
case cf2_cmdVHCURVETO:
case cf2_cmdHVCURVETO:
{
- CF2_UInt count = cf2_stack_count( opStack );
+ CF2_UInt count, count1 = cf2_stack_count( opStack );
CF2_UInt index = 0;
FT_Bool alternate = op1 == cf2_cmdHVCURVETO;
+ /* if `cf2_stack_count' isn't of the form 8n, 8n+1, */
+ /* 8n+4, or 8n+5, we enforce it by clearing the */
+ /* second bit */
+ /* (and sorting the stack indexing to suit) */
+ count = count1 & ~2U;
+ index += count1 - count;
+
FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" ));
while ( index < count )
diff --git a/src/3rdparty/freetype/src/cff/cff.c b/src/3rdparty/freetype/src/cff/cff.c
index c3840b5838..bb2cfb5253 100644
--- a/src/3rdparty/freetype/src/cff/cff.c
+++ b/src/3rdparty/freetype/src/cff/cff.c
@@ -4,7 +4,7 @@
/* */
/* FreeType OpenType driver component (body only). */
/* */
-/* Copyright 1996-2001, 2002, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffcmap.c b/src/3rdparty/freetype/src/cff/cffcmap.c
index 52248b2b9a..e7538e9840 100644
--- a/src/3rdparty/freetype/src/cff/cffcmap.c
+++ b/src/3rdparty/freetype/src/cff/cffcmap.c
@@ -4,7 +4,7 @@
/* */
/* CFF character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2007, 2010, 2013 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffcmap.h b/src/3rdparty/freetype/src/cff/cffcmap.h
index 3f7f67bbe0..6eaed636ec 100644
--- a/src/3rdparty/freetype/src/cff/cffcmap.h
+++ b/src/3rdparty/freetype/src/cff/cffcmap.h
@@ -4,7 +4,7 @@
/* */
/* CFF character mapping table (cmap) support (specification). */
/* */
-/* Copyright 2002, 2003, 2006 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffdrivr.c b/src/3rdparty/freetype/src/cff/cffdrivr.c
index 3e8898e343..a718b7a002 100644
--- a/src/3rdparty/freetype/src/cff/cffdrivr.c
+++ b/src/3rdparty/freetype/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -35,7 +35,7 @@
#include "cfferrs.h"
#include "cffpic.h"
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_PROPERTIES_H
#include FT_CFF_DRIVER_H
@@ -64,11 +64,6 @@
/*************************************************************************/
-#undef PAIR_TAG
-#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \
- (FT_ULong)right )
-
-
/*************************************************************************/
/* */
/* <Function> */
@@ -121,9 +116,6 @@
}
-#undef PAIR_TAG
-
-
/*************************************************************************/
/* */
/* <Function> */
@@ -203,6 +195,68 @@
FT_GlyphSlot slot = face->glyph;
+ if ( FT_IS_SFNT( face ) )
+ {
+ /* OpenType 1.7 mandates that the data from `hmtx' table be used; */
+ /* it is no longer necessary that those values are identical to */
+ /* the values in the `CFF' table */
+
+ TT_Face ttface = (TT_Face)face;
+ FT_Short dummy;
+
+
+ if ( flags & FT_LOAD_VERTICAL_LAYOUT )
+ {
+ /* check whether we have data from the `vmtx' table at all; */
+ /* otherwise we extract the info from the CFF glyphstrings */
+ /* (instead of synthesizing a global value using the `OS/2' */
+ /* table) */
+ if ( !ttface->vertical_info )
+ goto Missing_Table;
+
+ for ( nn = 0; nn < count; nn++ )
+ {
+ FT_UShort ah;
+
+
+ ( (SFNT_Service)ttface->sfnt )->get_metrics( ttface,
+ 1,
+ start + nn,
+ &dummy,
+ &ah );
+
+ FT_TRACE5(( " idx %d: advance height %d font units\n",
+ start + nn, ah ));
+ advances[nn] = ah;
+ }
+ }
+ else
+ {
+ /* check whether we have data from the `hmtx' table at all */
+ if ( !ttface->horizontal.number_Of_HMetrics )
+ goto Missing_Table;
+
+ for ( nn = 0; nn < count; nn++ )
+ {
+ FT_UShort aw;
+
+
+ ( (SFNT_Service)ttface->sfnt )->get_metrics( ttface,
+ 0,
+ start + nn,
+ &dummy,
+ &aw );
+
+ FT_TRACE5(( " idx %d: advance width %d font units\n",
+ start + nn, aw ));
+ advances[nn] = aw;
+ }
+ }
+
+ return error;
+ }
+
+ Missing_Table:
flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
for ( nn = 0; nn < count; nn++ )
@@ -352,7 +406,7 @@
font_info->italic_angle = dict->italic_angle;
font_info->is_fixed_pitch = dict->is_fixed_pitch;
font_info->underline_position = (FT_Short)dict->underline_position;
- font_info->underline_thickness = (FT_Short)dict->underline_thickness;
+ font_info->underline_thickness = (FT_UShort)dict->underline_thickness;
cff->font_info = font_info;
}
@@ -383,9 +437,27 @@
static const char*
cff_get_ps_name( CFF_Face face )
{
- CFF_Font cff = (CFF_Font)face->extra.data;
+ CFF_Font cff = (CFF_Font)face->extra.data;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+ /* following the OpenType specification 1.7, we return the name stored */
+ /* in the `name' table for a CFF wrapped into an SFNT container */
+
+ if ( sfnt )
+ {
+ FT_Library library = FT_FACE_LIBRARY( face );
+ FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
+ FT_Service_PsFontName service =
+ (FT_Service_PsFontName)ft_module_get_service(
+ sfnt_module,
+ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME );
+
+
+ if ( service && service->get_ps_font_name )
+ return service->get_ps_font_name( FT_FACE( face ) );
+ }
+
return (const char*)cff->font_name;
}
@@ -723,7 +795,7 @@
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
FT_DEFINE_SERVICEDESCREC7(
cff_services,
- FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF,
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
@@ -734,7 +806,7 @@
#else
FT_DEFINE_SERVICEDESCREC6(
cff_services,
- FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF,
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
FT_SERVICE_ID_POSTSCRIPT_INFO, &CFF_SERVICE_PS_INFO_GET,
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
diff --git a/src/3rdparty/freetype/src/cff/cffdrivr.h b/src/3rdparty/freetype/src/cff/cffdrivr.h
index 50e8138701..9527f5e149 100644
--- a/src/3rdparty/freetype/src/cff/cffdrivr.h
+++ b/src/3rdparty/freetype/src/cff/cffdrivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level OpenType driver interface (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cfferrs.h b/src/3rdparty/freetype/src/cff/cfferrs.h
index 801d73ec6b..543bdb07c2 100644
--- a/src/3rdparty/freetype/src/cff/cfferrs.h
+++ b/src/3rdparty/freetype/src/cff/cfferrs.h
@@ -4,7 +4,7 @@
/* */
/* CFF error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffgload.c b/src/3rdparty/freetype/src/cff/cffgload.c
index 758a3d3bbd..5f57403e22 100644
--- a/src/3rdparty/freetype/src/cff/cffgload.c
+++ b/src/3rdparty/freetype/src/cff/cffgload.c
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -273,8 +273,8 @@
builder->current = &loader->current.outline;
FT_GlyphLoader_Rewind( loader );
- builder->hints_globals = 0;
- builder->hints_funcs = 0;
+ builder->hints_globals = NULL;
+ builder->hints_funcs = NULL;
if ( hinting && size )
{
@@ -646,7 +646,7 @@
for ( n = 0; n < cff->num_glyphs; n++ )
{
if ( cff->charset.sids[n] == glyph_sid )
- return n;
+ return (FT_Int)n;
}
return -1;
@@ -672,7 +672,7 @@
*pointer = (FT_Byte*)data.pointer;
- *length = data.length;
+ *length = (FT_ULong)data.length;
return error;
}
@@ -707,7 +707,7 @@
data.pointer = *pointer;
- data.length = length;
+ data.length = (FT_Int)length;
face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object, &data );
@@ -819,7 +819,7 @@
FT_GlyphLoader_Prepare( builder->loader );
/* First load `bchar' in builder */
- error = cff_get_glyph_data( face, bchar_index,
+ error = cff_get_glyph_data( face, (FT_UInt)bchar_index,
&charstring, &charstring_len );
if ( !error )
{
@@ -849,7 +849,7 @@
builder->pos_y = ady;
/* Now load `achar' on top of the base outline. */
- error = cff_get_glyph_data( face, achar_index,
+ error = cff_get_glyph_data( face, (FT_UInt)achar_index,
&charstring, &charstring_len );
if ( !error )
{
@@ -922,10 +922,10 @@
decoder->read_width = 1;
/* compute random seed from stack address of parameter */
- seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed ^
- (FT_PtrDist)(char*)&decoder ^
- (FT_PtrDist)(char*)&charstring_base ) &
- FT_ULONG_MAX ) ;
+ seed = (FT_Fixed)( ( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&decoder ^
+ (FT_Offset)(char*)&charstring_base ) &
+ FT_ULONG_MAX );
seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
if ( seed == 0 )
seed = 0x7384;
@@ -1373,12 +1373,12 @@
{
if ( op == cff_op_hintmask )
hinter->hintmask( hinter->hints,
- builder->current->n_points,
- decoder->num_hints,
+ (FT_UInt)builder->current->n_points,
+ (FT_UInt)decoder->num_hints,
ip );
else
hinter->counter( hinter->hints,
- decoder->num_hints,
+ (FT_UInt)decoder->num_hints,
ip );
}
@@ -1995,7 +1995,7 @@
if ( hinter )
{
if ( hinter->close( hinter->hints,
- builder->current->n_points ) )
+ (FT_UInt)builder->current->n_points ) )
goto Syntax_Error;
/* apply hints to the loaded glyph outline now */
@@ -2389,7 +2389,9 @@
decoder->locals_bias );
- FT_TRACE4(( " callsubr(%d)\n", idx ));
+ FT_TRACE4(( " callsubr (idx %d, entering level %d)\n",
+ idx,
+ zone - decoder->zones + 1 ));
if ( idx >= decoder->num_locals )
{
@@ -2431,7 +2433,9 @@
decoder->globals_bias );
- FT_TRACE4(( " callgsubr(%d)\n", idx ));
+ FT_TRACE4(( " callgsubr (idx %d, entering level %d)\n",
+ idx,
+ zone - decoder->zones + 1 ));
if ( idx >= decoder->num_globals )
{
@@ -2468,7 +2472,8 @@
break;
case cff_op_return:
- FT_TRACE4(( " return\n" ));
+ FT_TRACE4(( " return (leaving level %d)\n",
+ decoder->zone - decoder->zones ));
if ( decoder->zone <= decoder->zones )
{
@@ -2669,7 +2674,7 @@
error = sfnt->load_sbit_image( face,
size->strike_index,
glyph_index,
- (FT_Int)load_flags,
+ (FT_UInt)load_flags,
stream,
&glyph->root.bitmap,
&metrics );
@@ -2720,7 +2725,7 @@
face->vertical_info &&
face->vertical.number_Of_VMetrics > 0 );
- /* get the vertical metrics from the vtmx table if we have one */
+ /* get the vertical metrics from the vmtx table if we have one */
if ( has_vertical_info )
{
(void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
@@ -2757,16 +2762,16 @@
/* this scaling is only relevant if the PS hinter isn't active */
if ( cff->num_subfonts )
{
- FT_ULong top_upm, sub_upm;
- FT_Byte fd_index = cff_fd_select_get( &cff->fd_select,
- glyph_index );
+ FT_Long top_upm, sub_upm;
+ FT_Byte fd_index = cff_fd_select_get( &cff->fd_select,
+ glyph_index );
if ( fd_index >= cff->num_subfonts )
fd_index = (FT_Byte)( cff->num_subfonts - 1 );
- top_upm = cff->top_font.font_dict.units_per_em;
- sub_upm = cff->subfonts[fd_index]->font_dict.units_per_em;
+ top_upm = (FT_Long)cff->top_font.font_dict.units_per_em;
+ sub_upm = (FT_Long)cff->subfonts[fd_index]->font_dict.units_per_em;
font_matrix = cff->subfonts[fd_index]->font_dict.font_matrix;
@@ -2867,7 +2872,7 @@
/* fonts. */
if ( face->root.internal->incremental_interface )
{
- glyph->root.control_data = 0;
+ glyph->root.control_data = NULL;
glyph->root.control_len = 0;
}
else
@@ -2884,7 +2889,7 @@
{
glyph->root.control_data = csindex->bytes +
csindex->offsets[glyph_index] - 1;
- glyph->root.control_len = charstring_len;
+ glyph->root.control_len = (FT_Long)charstring_len;
}
}
@@ -2944,29 +2949,46 @@
{
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &glyph->root.metrics;
- FT_Vector advance;
FT_Bool has_vertical_info;
- /* copy the _unscaled_ advance width */
- metrics->horiAdvance = decoder.glyph_width;
- glyph->root.linearHoriAdvance = decoder.glyph_width;
+ if ( face->horizontal.number_Of_HMetrics )
+ {
+ FT_Short horiBearingX = 0;
+ FT_UShort horiAdvance = 0;
+
+
+ ( (SFNT_Service)face->sfnt )->get_metrics( face, 0,
+ glyph_index,
+ &horiBearingX,
+ &horiAdvance );
+ metrics->horiAdvance = horiAdvance;
+ metrics->horiBearingX = horiBearingX;
+ glyph->root.linearHoriAdvance = horiAdvance;
+ }
+ else
+ {
+ /* copy the _unscaled_ advance width */
+ metrics->horiAdvance = decoder.glyph_width;
+ glyph->root.linearHoriAdvance = decoder.glyph_width;
+ }
+
glyph->root.internal->glyph_transformed = 0;
has_vertical_info = FT_BOOL( face->vertical_info &&
face->vertical.number_Of_VMetrics > 0 );
- /* get the vertical metrics from the vtmx table if we have one */
+ /* get the vertical metrics from the vmtx table if we have one */
if ( has_vertical_info )
{
FT_Short vertBearingY = 0;
FT_UShort vertAdvance = 0;
- (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
- glyph_index,
- &vertBearingY,
- &vertAdvance );
+ ( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
+ glyph_index,
+ &vertBearingY,
+ &vertAdvance );
metrics->vertBearingY = vertBearingY;
metrics->vertAdvance = vertAdvance;
}
@@ -2991,26 +3013,27 @@
glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL;
- if ( !( font_matrix.xx == 0x10000L &&
- font_matrix.yy == 0x10000L &&
- font_matrix.xy == 0 &&
- font_matrix.yx == 0 ) )
+ /* apply the font matrix, if any */
+ if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
+ font_matrix.xy != 0 || font_matrix.yx != 0 )
+ {
FT_Outline_Transform( &glyph->root.outline, &font_matrix );
- if ( !( font_offset.x == 0 &&
- font_offset.y == 0 ) )
- FT_Outline_Translate( &glyph->root.outline,
- font_offset.x, font_offset.y );
+ metrics->horiAdvance = FT_MulFix( metrics->horiAdvance,
+ font_matrix.xx );
+ metrics->vertAdvance = FT_MulFix( metrics->vertAdvance,
+ font_matrix.yy );
+ }
- advance.x = metrics->horiAdvance;
- advance.y = 0;
- FT_Vector_Transform( &advance, &font_matrix );
- metrics->horiAdvance = advance.x + font_offset.x;
+ if ( font_offset.x || font_offset.y )
+ {
+ FT_Outline_Translate( &glyph->root.outline,
+ font_offset.x,
+ font_offset.y );
- advance.x = 0;
- advance.y = metrics->vertAdvance;
- FT_Vector_Transform( &advance, &font_matrix );
- metrics->vertAdvance = advance.y + font_offset.y;
+ metrics->horiAdvance += font_offset.x;
+ metrics->vertAdvance += font_offset.y;
+ }
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || force_scaling )
{
diff --git a/src/3rdparty/freetype/src/cff/cffgload.h b/src/3rdparty/freetype/src/cff/cffgload.h
index 41df7db692..5f2655f3d9 100644
--- a/src/3rdparty/freetype/src/cff/cffgload.h
+++ b/src/3rdparty/freetype/src/cff/cffgload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2004, 2006-2009, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,7 +29,12 @@ FT_BEGIN_HEADER
#define CFF_MAX_OPERANDS 48
-#define CFF_MAX_SUBRS_CALLS 32
+#define CFF_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
+ /* only 10 are allowed but there exist */
+ /* fonts like `HiraKakuProN-W3.ttf' */
+ /* (Hiragino Kaku Gothic ProN W3; */
+ /* 8.2d6e1; 2014-12-19) that exceed */
+ /* this limit */
#define CFF_MAX_TRANS_ELEMENTS 32
diff --git a/src/3rdparty/freetype/src/cff/cffload.c b/src/3rdparty/freetype/src/cff/cffload.c
index d9bec5966b..c61222d651 100644
--- a/src/3rdparty/freetype/src/cff/cffload.c
+++ b/src/3rdparty/freetype/src/cff/cffload.c
@@ -4,7 +4,7 @@
/* */
/* OpenType and CFF data/program tables loader (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -357,7 +357,7 @@
case 3:
for ( ; p < p_end; p += 3, poff++ )
- poff[0] = FT_PEEK_OFF3( p );
+ poff[0] = FT_PEEK_UOFF3( p );
break;
default:
@@ -809,7 +809,7 @@
/* When multiple GIDs map to the same CID, we choose the lowest */
/* GID. This is not described in any spec, but it matches the */
/* behaviour of recent Acroread versions. */
- for ( j = num_glyphs - 1; j >= 0 ; j-- )
+ for ( j = (FT_Long)num_glyphs - 1; j >= 0 ; j-- )
charset->cids[charset->sids[j]] = (FT_UShort)j;
charset->max_cid = max_cid;
@@ -1447,7 +1447,7 @@
FT_ULong base_offset;
CFF_FontRecDict dict;
CFF_IndexRec string_index;
- FT_Int subfont_index;
+ FT_UInt subfont_index;
FT_ZERO( font );
@@ -1495,9 +1495,9 @@
if ( pure_cff )
{
/* well, we don't really forget the `disabled' fonts... */
- subfont_index = face_index;
+ subfont_index = (FT_UInt)( face_index & 0xFFFF );
- if ( subfont_index >= (FT_Int)font->name_index.count )
+ if ( face_index > 0 && subfont_index >= font->name_index.count )
{
FT_ERROR(( "cff_font_load:"
" invalid subfont index for pure CFF font (%d)\n",
diff --git a/src/3rdparty/freetype/src/cff/cffload.h b/src/3rdparty/freetype/src/cff/cffload.h
index 804961964b..459e7b0446 100644
--- a/src/3rdparty/freetype/src/cff/cffload.h
+++ b/src/3rdparty/freetype/src/cff/cffload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType & CFF data/program tables loader (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2007, 2008, 2010 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffobjs.c b/src/3rdparty/freetype/src/cff/cffobjs.c
index da3d0190fe..0e0d5b034b 100644
--- a/src/3rdparty/freetype/src/cff/cffobjs.c
+++ b/src/3rdparty/freetype/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -226,8 +226,8 @@
CFF_Font font = (CFF_Font)face->extra.data;
CFF_Internal internal = (CFF_Internal)size->internal;
- FT_ULong top_upm = font->top_font.font_dict.units_per_em;
- FT_UInt i;
+ FT_Long top_upm = (FT_Long)font->top_font.font_dict.units_per_em;
+ FT_UInt i;
funcs->set_scale( internal->topfont,
@@ -237,7 +237,7 @@
for ( i = font->num_subfonts; i > 0; i-- )
{
CFF_SubFont sub = font->subfonts[i - 1];
- FT_ULong sub_upm = sub->font_dict.units_per_em;
+ FT_Long sub_upm = (FT_Long)sub->font_dict.units_per_em;
FT_Pos x_scale, y_scale;
@@ -298,8 +298,8 @@
CFF_Font font = (CFF_Font)cffface->extra.data;
CFF_Internal internal = (CFF_Internal)size->internal;
- FT_ULong top_upm = font->top_font.font_dict.units_per_em;
- FT_UInt i;
+ FT_Long top_upm = (FT_Long)font->top_font.font_dict.units_per_em;
+ FT_UInt i;
funcs->set_scale( internal->topfont,
@@ -309,7 +309,7 @@
for ( i = font->num_subfonts; i > 0; i-- )
{
CFF_SubFont sub = font->subfonts[i - 1];
- FT_ULong sub_upm = sub->font_dict.units_per_em;
+ FT_Long sub_upm = (FT_Long)sub->font_dict.units_per_em;
FT_Pos x_scale, y_scale;
@@ -342,7 +342,7 @@
FT_LOCAL_DEF( void )
cff_slot_done( FT_GlyphSlot slot )
{
- slot->internal->glyph_hints = 0;
+ slot->internal->glyph_hints = NULL;
}
@@ -583,16 +583,21 @@
if ( error )
goto Exit;
+ /* if we are performing a simple font format check, exit immediately */
+ /* (this is here for pure CFF) */
+ if ( face_index < 0 )
+ return FT_Err_Ok;
+
cff->pshinter = pshinter;
cff->psnames = psnames;
- cffface->face_index = face_index;
+ cffface->face_index = face_index & 0xFFFF;
/* Complement the root flags with some interesting information. */
/* Note that this is only necessary for pure CFF and CEF fonts; */
/* SFNT based fonts use the `name' table instead. */
- cffface->num_glyphs = cff->num_glyphs;
+ cffface->num_glyphs = (FT_Long)cff->num_glyphs;
dict = &cff->top_font.font_dict;
@@ -629,7 +634,7 @@
if ( !dict->has_font_matrix )
dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
- /* Normalize the font matrix so that `matrix->xx' is 1; the */
+ /* Normalize the font matrix so that `matrix->yy' is 1; the */
/* scaling is done with `units_per_em' then (at this point, */
/* it already contains the scaling factor, but without */
/* normalization of the matrix). */
@@ -646,7 +651,7 @@
if ( temp != 0x10000L )
{
- *upm = FT_DivFix( *upm, temp );
+ *upm = (FT_ULong)FT_DivFix( (FT_Long)*upm, temp );
matrix->xx = FT_DivFix( matrix->xx, temp );
matrix->yx = FT_DivFix( matrix->yx, temp );
@@ -682,7 +687,8 @@
if ( top->has_font_matrix )
{
if ( top->units_per_em > 1 && sub->units_per_em > 1 )
- scaling = FT_MIN( top->units_per_em, sub->units_per_em );
+ scaling = (FT_Long)FT_MIN( top->units_per_em,
+ sub->units_per_em );
else
scaling = 1;
@@ -693,9 +699,10 @@
&top->font_matrix,
scaling );
- sub->units_per_em = FT_MulDiv( sub->units_per_em,
- top->units_per_em,
- scaling );
+ sub->units_per_em = (FT_ULong)
+ FT_MulDiv( (FT_Long)sub->units_per_em,
+ (FT_Long)top->units_per_em,
+ scaling );
}
}
else
@@ -713,7 +720,7 @@
if ( temp != 0x10000L )
{
- *upm = FT_DivFix( *upm, temp );
+ *upm = (FT_ULong)FT_DivFix( (FT_Long)*upm, temp );
matrix->xx = FT_DivFix( matrix->xx, temp );
matrix->yx = FT_DivFix( matrix->yx, temp );
@@ -733,13 +740,13 @@
/* set up num_faces */
- cffface->num_faces = cff->num_faces;
+ cffface->num_faces = (FT_Long)cff->num_faces;
/* compute number of glyphs */
if ( dict->cid_registry != 0xFFFFU )
- cffface->num_glyphs = cff->charset.max_cid + 1;
+ cffface->num_glyphs = (FT_Long)( cff->charset.max_cid + 1 );
else
- cffface->num_glyphs = cff->charstrings_index.count;
+ cffface->num_glyphs = (FT_Long)cff->charstrings_index.count;
/* set global bbox, as well as EM size */
cffface->bbox.xMin = dict->font_bbox.xMin >> 16;
@@ -763,7 +770,9 @@
(FT_Short)( dict->underline_thickness >> 16 );
/* retrieve font family & style name */
- cffface->family_name = cff_index_get_name( cff, face_index );
+ cffface->family_name = cff_index_get_name(
+ cff,
+ (FT_UInt)( face_index & 0xFFFF ) );
if ( cffface->family_name )
{
char* full = cff_index_get_sid_string( cff,
diff --git a/src/3rdparty/freetype/src/cff/cffobjs.h b/src/3rdparty/freetype/src/cff/cffobjs.h
index dfbf9a96b0..3cc953143b 100644
--- a/src/3rdparty/freetype/src/cff/cffobjs.h
+++ b/src/3rdparty/freetype/src/cff/cffobjs.h
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (specification). */
/* */
-/* Copyright 1996-2004, 2006-2008, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffparse.c b/src/3rdparty/freetype/src/cff/cffparse.c
index c79ab623dc..063b3517c5 100644
--- a/src/3rdparty/freetype/src/cff/cffparse.c
+++ b/src/3rdparty/freetype/src/cff/cffparse.c
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (body) */
/* */
-/* Copyright 1996-2004, 2007-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -129,7 +129,7 @@
FT_Long* scaling )
{
FT_Byte* p = start;
- FT_UInt nib;
+ FT_Int nib;
FT_UInt phase;
FT_Long result, number, exponent;
@@ -166,7 +166,7 @@
}
/* Get the nibble. */
- nib = ( p[0] >> phase ) & 0xF;
+ nib = (FT_Int)( p[0] >> phase ) & 0xF;
phase = 4 - phase;
if ( nib == 0xE )
@@ -559,7 +559,7 @@
offset->x = cff_parse_fixed_scaled( data++, scaling );
offset->y = cff_parse_fixed_scaled( data, scaling );
- *upm = power_tens[scaling];
+ *upm = (FT_ULong)power_tens[scaling];
FT_TRACE4(( " [%f %f %f %f %f %f]\n",
(double)matrix->xx / *upm / 65536,
@@ -617,14 +617,34 @@
if ( parser->top >= parser->stack + 2 )
{
- dict->private_size = cff_parse_num( data++ );
- dict->private_offset = cff_parse_num( data );
+ FT_Long tmp;
+
+
+ tmp = cff_parse_num( data++ );
+ if ( tmp < 0 )
+ {
+ FT_ERROR(( "cff_parse_private_dict: Invalid dictionary size\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+ dict->private_size = (FT_ULong)tmp;
+
+ tmp = cff_parse_num( data );
+ if ( tmp < 0 )
+ {
+ FT_ERROR(( "cff_parse_private_dict: Invalid dictionary offset\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+ dict->private_offset = (FT_ULong)tmp;
+
FT_TRACE4(( " %lu %lu\n",
dict->private_size, dict->private_offset ));
error = FT_Err_Ok;
}
+ Fail:
return error;
}
diff --git a/src/3rdparty/freetype/src/cff/cffparse.h b/src/3rdparty/freetype/src/cff/cffparse.h
index 61d91ed2e2..8ad02ea1e2 100644
--- a/src/3rdparty/freetype/src/cff/cffparse.h
+++ b/src/3rdparty/freetype/src/cff/cffparse.h
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (specification) */
/* */
-/* Copyright 1996-2003, 2011 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffpic.c b/src/3rdparty/freetype/src/cff/cffpic.c
index f22e4f0d53..d40dec50e9 100644
--- a/src/3rdparty/freetype/src/cff/cffpic.c
+++ b/src/3rdparty/freetype/src/cff/cffpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for cff module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cffpic.h b/src/3rdparty/freetype/src/cff/cffpic.h
index 50bab4c173..9a221a7b7e 100644
--- a/src/3rdparty/freetype/src/cff/cffpic.h
+++ b/src/3rdparty/freetype/src/cff/cffpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for cff module. */
/* */
-/* Copyright 2009, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,8 +20,6 @@
#define __CFFPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
@@ -49,6 +47,8 @@ FT_BEGIN_HEADER
#include FT_SERVICE_PROPERTIES_H
+FT_BEGIN_HEADER
+
typedef struct CffModulePIC_
{
FT_ServiceDescRec* cff_services;
@@ -96,12 +96,12 @@ FT_BEGIN_HEADER
FT_Error
cff_driver_class_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __CFFPIC_H__ */
diff --git a/src/3rdparty/freetype/src/cff/cfftoken.h b/src/3rdparty/freetype/src/cff/cfftoken.h
index bcb4276a78..5b32076ab8 100644
--- a/src/3rdparty/freetype/src/cff/cfftoken.h
+++ b/src/3rdparty/freetype/src/cff/cfftoken.h
@@ -4,7 +4,7 @@
/* */
/* CFF token definitions (specification only). */
/* */
-/* Copyright 1996-2003, 2011 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/cfftypes.h b/src/3rdparty/freetype/src/cff/cfftypes.h
index 8727446664..de8a5ee9b4 100644
--- a/src/3rdparty/freetype/src/cff/cfftypes.h
+++ b/src/3rdparty/freetype/src/cff/cfftypes.h
@@ -5,7 +5,7 @@
/* Basic OpenType/CFF type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2003, 2006-2008, 2010-2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cff/module.mk b/src/3rdparty/freetype/src/cff/module.mk
index ef1391c279..ba08ebcb79 100644
--- a/src/3rdparty/freetype/src/cff/module.mk
+++ b/src/3rdparty/freetype/src/cff/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/cff/rules.mk b/src/3rdparty/freetype/src/cff/rules.mk
index 13115c2550..7f6e857e28 100644
--- a/src/3rdparty/freetype/src/cff/rules.mk
+++ b/src/3rdparty/freetype/src/cff/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2001, 2003, 2011, 2013 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -18,7 +18,10 @@
CFF_DIR := $(SRC_DIR)/cff
-CFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR))
+CFF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(CFF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# CFF driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/cid/Jamfile b/src/3rdparty/freetype/src/cid/Jamfile
index ebeaed54ea..64e1523157 100644
--- a/src/3rdparty/freetype/src/cid/Jamfile
+++ b/src/3rdparty/freetype/src/cid/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/cid Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,12 @@ SubDir FT2_TOP $(FT2_SRC_DIR) cid ;
if $(FT2_MULTI)
{
- _sources = cidobjs cidload cidgload cidriver cidparse ;
+ _sources = cidgload
+ cidload
+ cidobjs
+ cidparse
+ cidriver
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/cid/ciderrs.h b/src/3rdparty/freetype/src/cid/ciderrs.h
index ef13155504..5e0e776ee1 100644
--- a/src/3rdparty/freetype/src/cid/ciderrs.h
+++ b/src/3rdparty/freetype/src/cid/ciderrs.h
@@ -4,7 +4,7 @@
/* */
/* CID error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cid/cidgload.c b/src/3rdparty/freetype/src/cid/cidgload.c
index 7febab81c4..d00674fe0d 100644
--- a/src/3rdparty/freetype/src/cid/cidgload.c
+++ b/src/3rdparty/freetype/src/cid/cidgload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2007, 2009, 2010, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -44,10 +44,10 @@
CID_Face face = (CID_Face)decoder->builder.face;
CID_FaceInfo cid = &face->cid;
FT_Byte* p;
- FT_UInt fd_select;
+ FT_ULong fd_select;
FT_Stream stream = face->cid_stream;
FT_Error error = FT_Err_Ok;
- FT_Byte* charstring = 0;
+ FT_Byte* charstring = NULL;
FT_Memory memory = face->root.memory;
FT_ULong glyph_length = 0;
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -75,11 +75,11 @@
goto Exit;
p = (FT_Byte*)glyph_data.pointer;
- fd_select = (FT_UInt)cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
+ fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
if ( glyph_data.length != 0 )
{
- glyph_length = glyph_data.length - cid->fd_bytes;
+ glyph_length = (FT_ULong)( glyph_data.length - cid->fd_bytes );
(void)FT_ALLOC( charstring, glyph_length );
if ( !error )
ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,
@@ -99,7 +99,7 @@
/* For ordinary fonts read the CID font dictionary index */
/* and charstring offset from the CIDMap. */
{
- FT_UInt entry_len = cid->fd_bytes + cid->gd_bytes;
+ FT_UInt entry_len = (FT_UInt)( cid->fd_bytes + cid->gd_bytes );
FT_ULong off1;
@@ -109,13 +109,13 @@
goto Exit;
p = (FT_Byte*)stream->cursor;
- fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
- off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
+ fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
+ off1 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
p += cid->fd_bytes;
glyph_length = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;
FT_FRAME_EXIT();
- if ( fd_select >= (FT_UInt)cid->num_dicts )
+ if ( fd_select >= (FT_ULong)cid->num_dicts )
{
error = FT_THROW( Invalid_Offset );
goto Exit;
@@ -133,7 +133,7 @@
{
CID_FaceDict dict;
CID_Subrs cid_subrs = face->subrs + fd_select;
- FT_Int cs_offset;
+ FT_UInt cs_offset;
/* Set up subrs */
@@ -151,7 +151,7 @@
/* Decode the charstring. */
/* Adjustment for seed bytes. */
- cs_offset = ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
+ cs_offset = decoder->lenIV >= 0 ? (FT_UInt)decoder->lenIV : 0;
/* Decrypt only if lenIV >= 0. */
if ( decoder->lenIV >= 0 )
@@ -159,7 +159,7 @@
error = decoder->funcs.parse_charstrings(
decoder, charstring + cs_offset,
- (FT_Int)glyph_length - cs_offset );
+ glyph_length - cs_offset );
}
FT_FREE( charstring );
@@ -357,7 +357,6 @@
{
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &cidglyph->metrics;
- FT_Vector advance;
/* copy the _unscaled_ advance width */
@@ -377,22 +376,27 @@
if ( cidsize->metrics.y_ppem < 24 )
cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
- /* apply the font matrix */
- FT_Outline_Transform( &cidglyph->outline, &font_matrix );
+ /* apply the font matrix, if any */
+ if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
+ font_matrix.xy != 0 || font_matrix.yx != 0 )
+ {
+ FT_Outline_Transform( &cidglyph->outline, &font_matrix );
- FT_Outline_Translate( &cidglyph->outline,
- font_offset.x,
- font_offset.y );
+ metrics->horiAdvance = FT_MulFix( metrics->horiAdvance,
+ font_matrix.xx );
+ metrics->vertAdvance = FT_MulFix( metrics->vertAdvance,
+ font_matrix.yy );
+ }
- advance.x = metrics->horiAdvance;
- advance.y = 0;
- FT_Vector_Transform( &advance, &font_matrix );
- metrics->horiAdvance = advance.x + font_offset.x;
+ if ( font_offset.x || font_offset.y )
+ {
+ FT_Outline_Translate( &cidglyph->outline,
+ font_offset.x,
+ font_offset.y );
- advance.x = 0;
- advance.y = metrics->vertAdvance;
- FT_Vector_Transform( &advance, &font_matrix );
- metrics->vertAdvance = advance.y + font_offset.y;
+ metrics->horiAdvance += font_offset.x;
+ metrics->vertAdvance += font_offset.y;
+ }
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
diff --git a/src/3rdparty/freetype/src/cid/cidgload.h b/src/3rdparty/freetype/src/cid/cidgload.h
index a0a91bfea8..4a10ce505c 100644
--- a/src/3rdparty/freetype/src/cid/cidgload.h
+++ b/src/3rdparty/freetype/src/cid/cidgload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cid/cidload.c b/src/3rdparty/freetype/src/cid/cidload.c
index 1cda0eee7a..e23b82f673 100644
--- a/src/3rdparty/freetype/src/cid/cidload.c
+++ b/src/3rdparty/freetype/src/cid/cidload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (body). */
/* */
-/* Copyright 1996-2006, 2009, 2011-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -38,7 +38,7 @@
/* read a single offset */
- FT_LOCAL_DEF( FT_Long )
+ FT_LOCAL_DEF( FT_ULong )
cid_get_offset( FT_Byte* *start,
FT_Byte offsize )
{
@@ -53,7 +53,7 @@
}
*start = p;
- return (FT_Long)result;
+ return result;
}
@@ -167,6 +167,7 @@
matrix = &dict->font_matrix;
offset = &dict->font_offset;
+ /* input is scaled by 1000 to accommodate default FontMatrix */
result = cid_parser_to_fixed_array( parser, 6, temp, 3 );
if ( result < 6 )
@@ -180,15 +181,12 @@
return FT_THROW( Invalid_File_Format );
}
- /* Set Units per EM based on FontMatrix values. We set the value to */
- /* 1000 / temp_scale, because temp_scale was already multiplied by */
- /* 1000 (in t1_tofixed, from psobjs.c). */
-
- root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
-
- /* we need to scale the values by 1.0/temp[3] */
+ /* atypical case */
if ( temp_scale != 0x10000L )
{
+ /* set units per EM based on FontMatrix values */
+ root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
+
temp[0] = FT_DivFix( temp[0], temp_scale );
temp[1] = FT_DivFix( temp[1], temp_scale );
temp[2] = FT_DivFix( temp[2], temp_scale );
@@ -222,6 +220,12 @@
num_dicts = cid_parser_to_int( parser );
+ if ( num_dicts < 0 )
+ {
+ FT_ERROR(( "parse_fd_array: invalid number of dictionaries\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
if ( !cid->font_dicts )
{
@@ -231,7 +235,7 @@
if ( FT_NEW_ARRAY( cid->font_dicts, num_dicts ) )
goto Exit;
- cid->num_dicts = (FT_UInt)num_dicts;
+ cid->num_dicts = num_dicts;
/* don't forget to set a few defaults */
for ( n = 0; n < cid->num_dicts; n++ )
@@ -290,7 +294,7 @@
cid_parse_dict( CID_Face face,
CID_Loader* loader,
FT_Byte* base,
- FT_Long size )
+ FT_ULong size )
{
CID_Parser* parser = &loader->parser;
@@ -342,11 +346,11 @@
/* look for immediates */
if ( *cur == '/' && cur + 2 < limit )
{
- FT_PtrDist len;
+ FT_UInt len;
cur++;
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
if ( len > 0 && len < 22 )
{
@@ -363,10 +367,10 @@
if ( !name )
break;
- if ( cur[0] == name[0] &&
- len == (FT_PtrDist)ft_strlen( (const char*)name ) )
+ if ( cur[0] == name[0] &&
+ len == ft_strlen( (const char*)name ) )
{
- FT_PtrDist n;
+ FT_UInt n;
for ( n = 1; n < len; n++ )
@@ -407,7 +411,7 @@
FT_Int n;
CID_Subrs subr;
FT_UInt max_offsets = 0;
- FT_ULong* offsets = 0;
+ FT_ULong* offsets = NULL;
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -450,8 +454,8 @@
}
/* read the subrmap's offsets */
- if ( FT_STREAM_SEEK( cid->data_offset + dict->subrmap_offset ) ||
- FT_FRAME_ENTER( ( num_subrs + 1 ) * dict->sd_bytes ) )
+ if ( FT_STREAM_SEEK( cid->data_offset + dict->subrmap_offset ) ||
+ FT_FRAME_ENTER( ( num_subrs + 1 ) * (FT_UInt)dict->sd_bytes ) )
goto Fail;
p = (FT_Byte*)stream->cursor;
@@ -500,7 +504,7 @@
}
}
- subr->num_subrs = num_subrs;
+ subr->num_subrs = (FT_Int)num_subrs;
}
Exit:
@@ -546,7 +550,7 @@
static FT_Error
cid_hex_to_binary( FT_Byte* data,
- FT_Long data_len,
+ FT_ULong data_len,
FT_ULong offset,
CID_Face face )
{
diff --git a/src/3rdparty/freetype/src/cid/cidload.h b/src/3rdparty/freetype/src/cid/cidload.h
index 8c172ffee2..d7776d2f88 100644
--- a/src/3rdparty/freetype/src/cid/cidload.h
+++ b/src/3rdparty/freetype/src/cid/cidload.h
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -36,7 +36,7 @@ FT_BEGIN_HEADER
} CID_Loader;
- FT_LOCAL( FT_Long )
+ FT_LOCAL( FT_ULong )
cid_get_offset( FT_Byte** start,
FT_Byte offsize );
diff --git a/src/3rdparty/freetype/src/cid/cidobjs.c b/src/3rdparty/freetype/src/cid/cidobjs.c
index 5932ffa973..bf1519bc6e 100644
--- a/src/3rdparty/freetype/src/cid/cidobjs.c
+++ b/src/3rdparty/freetype/src/cid/cidobjs.c
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (body). */
/* */
-/* Copyright 1996-2006, 2008, 2010-2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -49,7 +49,7 @@
FT_LOCAL_DEF( void )
cid_slot_done( FT_GlyphSlot slot )
{
- slot->internal->glyph_hints = 0;
+ slot->internal->glyph_hints = NULL;
}
@@ -122,7 +122,7 @@
if ( funcs )
funcs->destroy( (PSH_Globals)cidsize->internal );
- cidsize->internal = 0;
+ cidsize->internal = NULL;
}
}
@@ -243,8 +243,8 @@
FT_FREE( cid->registry );
FT_FREE( cid->ordering );
- cidface->family_name = 0;
- cidface->style_name = 0;
+ cidface->family_name = NULL;
+ cidface->style_name = NULL;
FT_FREE( face->binary_data );
FT_FREE( face->cid_stream );
@@ -334,7 +334,7 @@
/* check the face index */
/* XXX: handle CID fonts with more than a single face */
- if ( face_index != 0 )
+ if ( ( face_index & 0xFFFF ) != 0 )
{
FT_ERROR(( "cid_face_init: invalid face index\n" ));
error = FT_THROW( Invalid_Argument );
@@ -351,10 +351,10 @@
PS_FontInfo info = &cid->font_info;
- cidface->num_glyphs = cid->cid_count;
+ cidface->num_glyphs = (FT_Long)cid->cid_count;
cidface->num_charmaps = 0;
- cidface->face_index = face_index;
+ cidface->face_index = face_index & 0xFFFF;
cidface->face_flags |= FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
@@ -421,7 +421,7 @@
/* no embedded bitmap support */
cidface->num_fixed_sizes = 0;
- cidface->available_sizes = 0;
+ cidface->available_sizes = NULL;
cidface->bbox.xMin = cid->font_bbox.xMin >> 16;
cidface->bbox.yMin = cid->font_bbox.yMin >> 16;
diff --git a/src/3rdparty/freetype/src/cid/cidobjs.h b/src/3rdparty/freetype/src/cid/cidobjs.h
index aee346d1c8..e9095ca68e 100644
--- a/src/3rdparty/freetype/src/cid/cidobjs.h
+++ b/src/3rdparty/freetype/src/cid/cidobjs.h
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2006 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cid/cidparse.c b/src/3rdparty/freetype/src/cid/cidparse.c
index d8476cdae8..c276949779 100644
--- a/src/3rdparty/freetype/src/cid/cidparse.c
+++ b/src/3rdparty/freetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (body). */
/* */
-/* Copyright 1996-2007, 2009, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -86,13 +86,13 @@
/* `StartData' or `/sfnts' */
{
FT_Byte buffer[256 + 10];
- FT_Long read_len = 256 + 10; /* same as signed FT_Stream->size */
+ FT_ULong read_len = 256 + 10;
FT_Byte* p = buffer;
for ( offset = FT_STREAM_POS(); ; offset += 256 )
{
- FT_Long stream_len; /* same as signed FT_Stream->size */
+ FT_ULong stream_len;
stream_len = stream->size - FT_STREAM_POS();
@@ -176,7 +176,18 @@
if ( cur[0] == 'S' && ft_strncmp( (char*)cur, "StartData", 9 ) == 0 )
{
if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
- parser->binary_length = ft_atol( (const char *)arg2 );
+ {
+ FT_Long tmp = ft_atol( (const char *)arg2 );
+
+
+ if ( tmp < 0 )
+ {
+ FT_ERROR(( "cid_parser_new: invalid length of hex data\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ }
+ else
+ parser->binary_length = (FT_ULong)tmp;
+ }
goto Exit;
}
diff --git a/src/3rdparty/freetype/src/cid/cidparse.h b/src/3rdparty/freetype/src/cid/cidparse.h
index f27be65a60..f581bb43ff 100644
--- a/src/3rdparty/freetype/src/cid/cidparse.h
+++ b/src/3rdparty/freetype/src/cid/cidparse.h
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (specification). */
/* */
-/* Copyright 1996-2004, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -64,11 +64,11 @@ FT_BEGIN_HEADER
FT_Stream stream;
FT_Byte* postscript;
- FT_Long postscript_len;
+ FT_ULong postscript_len;
FT_ULong data_offset;
- FT_Long binary_length;
+ FT_ULong binary_length;
CID_FaceInfo cid;
FT_Int num_dict;
diff --git a/src/3rdparty/freetype/src/cid/cidriver.c b/src/3rdparty/freetype/src/cid/cidriver.c
index 6132a27763..07c4cc410b 100644
--- a/src/3rdparty/freetype/src/cid/cidriver.c
+++ b/src/3rdparty/freetype/src/cid/cidriver.c
@@ -4,7 +4,7 @@
/* */
/* CID driver interface (body). */
/* */
-/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,7 +24,7 @@
#include "ciderrs.h"
#include FT_SERVICE_POSTSCRIPT_NAME_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
#include FT_SERVICE_CID_H
@@ -168,7 +168,7 @@
static const FT_ServiceDescRec cid_services[] =
{
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CID },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CID },
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name },
{ FT_SERVICE_ID_POSTSCRIPT_INFO, &cid_service_ps_info },
{ FT_SERVICE_ID_CID, &cid_service_cid_info },
diff --git a/src/3rdparty/freetype/src/cid/cidriver.h b/src/3rdparty/freetype/src/cid/cidriver.h
index 3c45e06886..e5b8678464 100644
--- a/src/3rdparty/freetype/src/cid/cidriver.h
+++ b/src/3rdparty/freetype/src/cid/cidriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level CID driver interface (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cid/cidtoken.h b/src/3rdparty/freetype/src/cid/cidtoken.h
index 904cb09cf4..82eae0ca6b 100644
--- a/src/3rdparty/freetype/src/cid/cidtoken.h
+++ b/src/3rdparty/freetype/src/cid/cidtoken.h
@@ -4,7 +4,7 @@
/* */
/* CID token definitions (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/cid/module.mk b/src/3rdparty/freetype/src/cid/module.mk
index ce30bfd7ae..e312a3ca1a 100644
--- a/src/3rdparty/freetype/src/cid/module.mk
+++ b/src/3rdparty/freetype/src/cid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/cid/rules.mk b/src/3rdparty/freetype/src/cid/rules.mk
index f362744612..282f2aad7a 100644
--- a/src/3rdparty/freetype/src/cid/rules.mk
+++ b/src/3rdparty/freetype/src/cid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -18,7 +18,10 @@
CID_DIR := $(SRC_DIR)/cid
-CID_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CID_DIR))
+CID_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(CID_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# CID driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/cid/type1cid.c b/src/3rdparty/freetype/src/cid/type1cid.c
index 0b866e97c4..0d54ca7f44 100644
--- a/src/3rdparty/freetype/src/cid/type1cid.c
+++ b/src/3rdparty/freetype/src/cid/type1cid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType OpenType driver component (body only). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/Jamfile b/src/3rdparty/freetype/src/gxvalid/Jamfile
index 88049a625d..d367cad77c 100644
--- a/src/3rdparty/freetype/src/gxvalid/Jamfile
+++ b/src/3rdparty/freetype/src/gxvalid/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/gxvalid Jamfile
#
-# Copyright 2005 by
+# Copyright 2005-2015 by
# suzuki toshiya, Masatake YAMATO and Red Hat K.K.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -17,10 +17,29 @@ SubDir FT2_TOP $(FT2_SRC_DIR) gxvalid ;
if $(FT2_MULTI)
{
- _sources = gxvcommn gxvfeat gxvbsln gxvtrak gxvopbd gxvprop
- gxvmort gxvmort0 gxvmort1 gxvmort2 gxvmort4 gxvmort5
- gxvmorx gxvmorx0 gxvmorx1 gxvmorx2 gxvmorx4 gxvmorx5
- gxvlcar gxvkern gxvmod gxvjust ;
+ _sources = gxvbsln
+ gxvcommn
+ gxvfeat
+ gxvjust
+ gxvkern
+ gxvlcar
+ gxvmod
+ gxvmort
+ gxvmort0
+ gxvmort1
+ gxvmort2
+ gxvmort4
+ gxvmort5
+ gxvmorx
+ gxvmorx0
+ gxvmorx1
+ gxvmorx2
+ gxvmorx4
+ gxvmorx5
+ gxvopbd
+ gxvprop
+ gxvtrak
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/gxvalid/README b/src/3rdparty/freetype/src/gxvalid/README
index 28e535b0bc..60f2fc185e 100644
--- a/src/3rdparty/freetype/src/gxvalid/README
+++ b/src/3rdparty/freetype/src/gxvalid/README
@@ -518,7 +518,7 @@ gxvalid: TrueType GX validator
------------------------------------------------------------------------
-Copyright 2004, 2005, 2007 by
+Copyright 2004-2015 by
suzuki toshiya, Masatake YAMATO, Red hat K.K.,
David Turner, Robert Wilhelm, and Werner Lemberg.
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvalid.c b/src/3rdparty/freetype/src/gxvalid/gxvalid.c
index bc36e675d1..7b5b0914db 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvalid.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvalid.c
@@ -4,7 +4,8 @@
/* */
/* FreeType validator for TrueTypeGX/AAT tables (body only). */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvalid.h b/src/3rdparty/freetype/src/gxvalid/gxvalid.h
index 27be9ecca8..8c227d0e0b 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvalid.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxvalid.h
@@ -4,7 +4,8 @@
/* */
/* TrueTyeeGX/AAT table validation (specification only). */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvbsln.c b/src/3rdparty/freetype/src/gxvalid/gxvbsln.c
index d16511876a..1b17a5d033 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvbsln.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvbsln.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT bsln table validation (body). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -226,7 +227,7 @@
FT_INVALID_DATA;
}
else
- gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, gxvalid );
+ gxv_ctlPoint_validate( stdGlyph, ctlPoint, gxvalid );
}
GXV_EXIT;
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvcommn.c b/src/3rdparty/freetype/src/gxvalid/gxvcommn.c
index 8e72a72f4e..93f6ffbe23 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvcommn.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvcommn.c
@@ -4,8 +4,8 @@
/* */
/* TrueTypeGX/AAT common tables validation (body). */
/* */
-/* Copyright 2004, 2005, 2009, 2010, 2013 */
-/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -202,7 +202,7 @@
*max = (FT_Byte)FT_MAX( *max, val );
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -231,7 +231,7 @@
*max = (FT_Byte)FT_MAX( *max, val );
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -367,7 +367,7 @@
if ( *nUnits_p == 0 )
*nUnits_p = binSrchHeader.nUnits;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -449,7 +449,7 @@
gxvalid->lookupval_func( i, &value, gxvalid );
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -486,7 +486,7 @@
p += unitSize;
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -555,7 +555,7 @@
gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );
p += gxvalid->subtable_length;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -636,7 +636,7 @@
gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );
p += gxvalid->subtable_length;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -657,7 +657,7 @@
p += unitSize;
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -709,7 +709,7 @@
gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, gxvalid );
p += gxvalid->subtable_length;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -746,7 +746,7 @@
gxvalid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, gxvalid );
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -795,7 +795,7 @@
func( p, limit, gxvalid );
p += gxvalid->subtable_length;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -844,7 +844,7 @@
FT_LOCAL_DEF( void )
gxv_ctlPoint_validate( FT_UShort gid,
- FT_Short ctl_point,
+ FT_UShort ctl_point,
GXV_Validator gxvalid )
{
FT_Face face;
@@ -852,7 +852,7 @@
FT_GlyphSlot glyph;
FT_Outline outline;
- short n_points;
+ FT_UShort n_points;
face = gxvalid->face;
@@ -865,8 +865,7 @@
glyph = face->glyph;
outline = glyph->outline;
- n_points = outline.n_points;
-
+ n_points = (FT_UShort)outline.n_points;
if ( !( ctl_point < n_points ) )
FT_INVALID_DATA;
@@ -1449,7 +1448,7 @@
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
*maxState_p, *maxEntry_p ));
- *length_p = p - table;
+ *length_p = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -1550,7 +1549,7 @@
}
Exit:
- *length_p = p - table;
+ *length_p = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -1605,7 +1604,7 @@
else
setup_func = gxv_XStateTable_subtable_setup;
- setup_func( limit - table,
+ setup_func( (FT_ULong)( limit - table ),
classTable,
stateArray,
entryTable,
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvcommn.h b/src/3rdparty/freetype/src/gxvalid/gxvcommn.h
index f1143457ff..b24608c257 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvcommn.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxvcommn.h
@@ -4,8 +4,8 @@
/* */
/* TrueTypeGX/AAT common tables validation (specification). */
/* */
-/* Copyright 2004, 2005, 2012, 2014 */
-/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -404,7 +404,7 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
gxv_ctlPoint_validate( FT_UShort gid,
- FT_Short ctl_point,
+ FT_UShort ctl_point,
GXV_Validator gxvalid );
diff --git a/src/3rdparty/freetype/src/gxvalid/gxverror.h b/src/3rdparty/freetype/src/gxvalid/gxverror.h
index c573b72de7..6bbc23aa03 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxverror.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxverror.h
@@ -4,8 +4,8 @@
/* */
/* TrueTypeGX/AAT validation module error codes (specification only). */
/* */
-/* Copyright 2004, 2005, 2012-2013 */
-/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvfeat.c b/src/3rdparty/freetype/src/gxvalid/gxvfeat.c
index 69298b2869..0da9777642 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvfeat.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvfeat.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT feat table validation (body). */
/* */
-/* Copyright 2004, 2005, 2008, 2012 by */
+/* Copyright 2004-2015 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvfeat.h b/src/3rdparty/freetype/src/gxvalid/gxvfeat.h
index 049d23a0b9..b617df5d53 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvfeat.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxvfeat.h
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT feat table validation (specification). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvfgen.c b/src/3rdparty/freetype/src/gxvalid/gxvfgen.c
index e48778a2a1..75c5e20d22 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvfgen.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvfgen.c
@@ -5,7 +5,8 @@
/* Generate feature registry data for gxv `feat' validator. */
/* This program is derived from gxfeatreg.c in gxlayout. */
/* */
-/* Copyright 2004, 2005, 2006 by Masatake YAMATO and Redhat K.K. */
+/* Copyright 2004-2015 by */
+/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file may only be used, */
/* modified, and distributed under the terms of the FreeType project */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvjust.c b/src/3rdparty/freetype/src/gxvalid/gxvjust.c
index 24c26a5655..55b44bc2a8 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvjust.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvjust.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT just table validation (body). */
/* */
-/* Copyright 2005, 2014 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,7 +42,7 @@
/*
* referred `just' table format specification:
- * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6just.html
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6just.html
* last updated 2000.
* ----------------------------------------------
* [JUST HEADER]: GXV_JUST_HEADER_SIZE
@@ -120,7 +121,7 @@
GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -142,7 +143,7 @@
p += gxvalid->subtable_length;
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -167,7 +168,7 @@
p += gxvalid->subtable_length;
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -191,8 +192,8 @@
GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );
- lowerLimit = FT_NEXT_ULONG( p );
- upperLimit = FT_NEXT_ULONG( p );
+ lowerLimit = FT_NEXT_LONG( p );
+ upperLimit = FT_NEXT_LONG( p );
#ifdef GXV_LOAD_UNUSED_VARS
order = FT_NEXT_USHORT( p );
#else
@@ -217,7 +218,7 @@
gxv_just_check_max_gid( glyphs, "type0:glyphs", gxvalid );
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -235,7 +236,7 @@
gxv_just_check_max_gid( addGlyph, "type1:addGlyph", gxvalid );
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -266,7 +267,7 @@
gxv_just_check_max_gid( substGlyph, "type2:substGlyph", gxvalid );
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -284,11 +285,11 @@
GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
variantsAxis = FT_NEXT_ULONG( p );
- minimumLimit = FT_NEXT_ULONG( p );
- noStretchValue = FT_NEXT_ULONG( p );
- maximumLimit = FT_NEXT_ULONG( p );
+ minimumLimit = FT_NEXT_LONG( p );
+ noStretchValue = FT_NEXT_LONG( p );
+ maximumLimit = FT_NEXT_LONG( p );
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
if ( variantsAxis != 0x64756374L ) /* 'duct' */
GXV_TRACE(( "variantsAxis 0x%08x is non default value",
@@ -326,7 +327,7 @@
flags ));
gxv_just_check_max_gid( glyph, "type5:glyph", gxvalid );
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
}
@@ -394,7 +395,7 @@
p += gxvalid->subtable_length;
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -453,7 +454,7 @@
gxv_just_pcActionRecord_validate( p, limit, gxvalid );
p += gxvalid->subtable_length;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -676,7 +677,8 @@
format = FT_NEXT_USHORT( p );
horizOffset = FT_NEXT_USHORT( p );
vertOffset = FT_NEXT_USHORT( p );
- gxv_odtect_add_range( table, p - table, "just header", odtect );
+ gxv_odtect_add_range( table, (FT_ULong)( p - table ),
+ "just header", odtect );
/* Version 1.0 (always:2000) */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvkern.c b/src/3rdparty/freetype/src/gxvalid/gxvkern.c
index 787e3db830..f257c03760 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvkern.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvkern.c
@@ -4,8 +4,8 @@
/* */
/* TrueTypeGX/AAT kern table validation (body). */
/* */
-/* Copyright 2004-2007, 2013 */
-/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -549,7 +549,7 @@
}
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -779,7 +779,7 @@
#ifdef GXV_LOAD_TRACE_VARS
version = 0;
#endif
- length = ( u16[0] << 16 ) + u16[1];
+ length = ( (FT_ULong)u16[0] << 16 ) + u16[1];
#ifdef GXV_LOAD_TRACE_VARS
tupleIndex = 0;
#endif
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvlcar.c b/src/3rdparty/freetype/src/gxvalid/gxvlcar.c
index 48308b0246..af589fdb6f 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvlcar.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvlcar.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT lcar table validation (body). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -65,7 +66,7 @@
/*************************************************************************/
static void
- gxv_lcar_partial_validate( FT_UShort partial,
+ gxv_lcar_partial_validate( FT_Short partial,
FT_UShort glyph,
GXV_Validator gxvalid )
{
@@ -74,7 +75,7 @@
if ( GXV_LCAR_DATA( format ) != 1 )
goto Exit;
- gxv_ctlPoint_validate( glyph, partial, gxvalid );
+ gxv_ctlPoint_validate( glyph, (FT_UShort)partial, gxvalid );
Exit:
GXV_EXIT;
@@ -202,7 +203,7 @@
GXV_INIT;
GXV_LIMIT_CHECK( 4 + 2 );
- version = FT_NEXT_ULONG( p );
+ version = FT_NEXT_LONG( p );
GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p );
if ( version != 0x00010000UL)
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmod.c b/src/3rdparty/freetype/src/gxvalid/gxvmod.c
index 278d47688a..17a02e7b8b 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmod.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmod.c
@@ -4,8 +4,8 @@
/* */
/* FreeType's TrueTypeGX/AAT validation module implementation (body). */
/* */
-/* Copyright 2004-2006, 2013 */
-/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmod.h b/src/3rdparty/freetype/src/gxvalid/gxvmod.h
index 22732ba992..1ff2cfc8bb 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmod.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmod.h
@@ -5,7 +5,8 @@
/* FreeType's TrueTypeGX/AAT validation module implementation */
/* (specification). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort.c b/src/3rdparty/freetype/src/gxvalid/gxvmort.c
index 55ff5a851e..a9e7a58fea 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT mort table validation (body). */
/* */
-/* Copyright 2005, 2013 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -112,7 +113,7 @@
if ( !IS_GXV_MORT_FEATURE_OFF( f ) )
FT_INVALID_DATA;
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -213,7 +214,7 @@
/* TODO: validate subFeatureFlags */
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort.h b/src/3rdparty/freetype/src/gxvalid/gxvmort.h
index 8e62e52dbf..c95391b61f 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort.h
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT common definition for mort table (specification). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort0.c b/src/3rdparty/freetype/src/gxvalid/gxvmort0.c
index f19016efdb..0cace35ae2 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort0.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort0.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort1.c b/src/3rdparty/freetype/src/gxvalid/gxvmort1.c
index 0189504edf..aa02df5a99 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort1.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort1.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type1 (Contextual Substitution) subtable. */
/* */
-/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -155,7 +156,7 @@
setMark = (FT_UShort)( flags >> 15 );
dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
#endif
- reserved = (FT_Short)( flags & 0x3FFF );
+ reserved = (FT_UShort)( flags & 0x3FFF );
markOffset = (FT_Short)( glyphOffset_p->ul >> 16 );
currentOffset = (FT_Short)( glyphOffset_p->ul );
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort2.c b/src/3rdparty/freetype/src/gxvalid/gxvmort2.c
index 099ffd48c9..6f56c94ca7 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort2.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort2.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type2 (Ligature Substitution) subtable. */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -302,7 +303,7 @@
p += gxvalid->subtable_length;
gxv_mort_subtable_type2_ligatureTable_validate( table, gxvalid );
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort4.c b/src/3rdparty/freetype/src/gxvalid/gxvmort4.c
index 9e86af4dd5..535f37716d 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort4.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort4.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmort5.c b/src/3rdparty/freetype/src/gxvalid/gxvmort5.c
index 9498b10855..fb2f915fce 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmort5.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmort5.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type5 (Contextual Glyph Insertion) subtable. */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
index 96dba631c4..1c6b3f2973 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT morx table validation (body). */
/* */
-/* Copyright 2005, 2008, 2013 by */
+/* Copyright 2005-2015 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -107,7 +107,7 @@
p += rest;
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx.h b/src/3rdparty/freetype/src/gxvalid/gxvmorx.h
index 9ed907acd7..60efdfd0ce 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx.h
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx.h
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT common definition for morx table (specification). */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx0.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx0.c
index db165f4e89..e340baa5e4 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx0.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx0.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx1.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx1.c
index 49f53d1854..7ba290914d 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx1.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx1.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type1 (Contextual Substitution) subtable. */
/* */
-/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -148,11 +149,11 @@
if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 )
optdata->substitutionTable_num_lookupTables =
- (FT_Short)( markIndex + 1 );
+ (FT_UShort)( markIndex + 1 );
if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 )
optdata->substitutionTable_num_lookupTables =
- (FT_Short)( currentIndex + 1 );
+ (FT_UShort)( currentIndex + 1 );
}
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx2.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx2.c
index e44445d141..51e305580f 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx2.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx2.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type2 (Ligature Substitution) subtable. */
/* */
-/* Copyright 2005, 2013 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -188,7 +189,8 @@
/* it is different from the location offset in mort */
if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL )
{ /* negative offset */
- gid_limit = gxvalid->face->num_glyphs - ( offset & 0x0000FFFFUL );
+ gid_limit = gxvalid->face->num_glyphs -
+ (FT_Long)( offset & 0x0000FFFFUL );
if ( gid_limit > 0 )
return;
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx4.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx4.c
index 68ab678492..c42677d45b 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx4.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx4.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT morx table validation */
/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
-/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx5.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx5.c
index 5e095dd380..7ac872f9d7 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx5.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx5.c
@@ -5,7 +5,8 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type5 (Contextual Glyph Insertion) subtable. */
/* */
-/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2005-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvopbd.c b/src/3rdparty/freetype/src/gxvalid/gxvopbd.c
index ab0cd72bf2..7cd5163b17 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvopbd.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvopbd.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT opbd table validation (body). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -90,7 +91,7 @@
if ( delta_value == -1 )
continue;
- gxv_ctlPoint_validate( glyph, delta_value, gxvalid );
+ gxv_ctlPoint_validate( glyph, (FT_UShort)delta_value, gxvalid );
}
else /* format 0, value is distance */
continue;
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvprop.c b/src/3rdparty/freetype/src/gxvalid/gxvprop.c
index aa5c8eed31..ecc3c94d2c 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvprop.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvprop.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT prop table validation (body). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -278,7 +279,7 @@
GXV_INIT;
GXV_LIMIT_CHECK( 4 + 2 + 2 );
- version = FT_NEXT_ULONG( p );
+ version = FT_NEXT_LONG( p );
format = FT_NEXT_USHORT( p );
defaultProp = FT_NEXT_USHORT( p );
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvtrak.c b/src/3rdparty/freetype/src/gxvalid/gxvtrak.c
index 3ec1a56739..c4d29e4dff 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvtrak.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvtrak.c
@@ -4,7 +4,8 @@
/* */
/* TrueTypeGX/AAT trak table validation (body). */
/* */
-/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/* Copyright 2004-2015 by */
+/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,7 +49,7 @@
/*
* referred track table format specification:
- * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6trak.html
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6trak.html
* last update was 1996.
* ----------------------------------------------
* [MINIMUM HEADER]: GXV_TRAK_SIZE_MIN
@@ -134,7 +135,7 @@
}
}
- gxvalid->subtable_length = p - table;
+ gxvalid->subtable_length = (FT_ULong)( p - table );
GXV_EXIT;
}
@@ -161,7 +162,8 @@
nSizes = FT_NEXT_USHORT( p );
sizeTableOffset = FT_NEXT_ULONG( p );
- gxv_odtect_add_range( table, p - table, "trackData header", odtect );
+ gxv_odtect_add_range( table, (FT_ULong)( p - table ),
+ "trackData header", odtect );
/* validate trackTable */
gxv_trak_trackTable_validate( p, limit, nTracks, gxvalid );
diff --git a/src/3rdparty/freetype/src/gxvalid/module.mk b/src/3rdparty/freetype/src/gxvalid/module.mk
index 9fd098e2c5..1d7649478e 100644
--- a/src/3rdparty/freetype/src/gxvalid/module.mk
+++ b/src/3rdparty/freetype/src/gxvalid/module.mk
@@ -2,9 +2,9 @@
# FreeType 2 gxvalid module definition
#
-# Copyright 2004, 2005, 2006
-# by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
-# David Turner, Robert Wilhelm, and Werner Lemberg.
+# Copyright 2004-2015 by
+# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
diff --git a/src/3rdparty/freetype/src/gxvalid/rules.mk b/src/3rdparty/freetype/src/gxvalid/rules.mk
index 57bc0823db..44a2d43250 100644
--- a/src/3rdparty/freetype/src/gxvalid/rules.mk
+++ b/src/3rdparty/freetype/src/gxvalid/rules.mk
@@ -3,7 +3,8 @@
#
-# Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
+# Copyright 2004-2015 by
+# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +21,10 @@ GXV_DIR := $(SRC_DIR)/gxvalid
# compilation flags for the driver
#
-GXV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GXV_DIR))
+GXV_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(GXV_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# GXV driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/gzip/Jamfile b/src/3rdparty/freetype/src/gzip/Jamfile
index a7aafa0518..0944a5f2c4 100644
--- a/src/3rdparty/freetype/src/gzip/Jamfile
+++ b/src/3rdparty/freetype/src/gzip/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/gzip Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/gzip/ftgzip.c b/src/3rdparty/freetype/src/gzip/ftgzip.c
index 2d4200d9fa..422035c00b 100644
--- a/src/3rdparty/freetype/src/gzip/ftgzip.c
+++ b/src/3rdparty/freetype/src/gzip/ftgzip.c
@@ -8,7 +8,7 @@
/* parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2002-2006, 2009-2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -58,7 +58,6 @@
/* conflicts when a program is linked with both FreeType and the */
/* original ZLib. */
-#define NO_DUMMY_DECL
#ifndef USE_ZLIB_ZCALLOC
#define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutils.c */
#endif
@@ -378,7 +377,10 @@
size = stream->read( stream, stream->pos, zip->input,
FT_GZIP_BUFFER_SIZE );
if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
return FT_THROW( Invalid_Stream_Operation );
+ }
}
else
{
@@ -387,7 +389,10 @@
size = FT_GZIP_BUFFER_SIZE;
if ( size == 0 )
+ {
+ zip->limit = zip->cursor;
return FT_THROW( Invalid_Stream_Operation );
+ }
FT_MEM_COPY( zip->input, stream->base + stream->pos, size );
}
@@ -434,7 +439,8 @@
}
else if ( err != Z_OK )
{
- error = FT_THROW( Invalid_Stream_Operation );
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
break;
}
}
@@ -558,19 +564,22 @@
stream->descriptor.pointer = NULL;
}
+
+ if ( !stream->read )
+ FT_FREE( stream->base );
}
- static FT_ULong
- ft_gzip_stream_io( FT_Stream stream,
- FT_ULong pos,
- FT_Byte* buffer,
- FT_ULong count )
+ static unsigned long
+ ft_gzip_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
{
FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer;
- return ft_gzip_file_io( zip, pos, buffer, count );
+ return ft_gzip_file_io( zip, offset, buffer, count );
}
@@ -585,7 +594,7 @@
old_pos = stream->pos;
if ( !FT_Stream_Seek( stream, stream->size - 4 ) )
{
- result = FT_Stream_ReadULong( stream, &error );
+ result = FT_Stream_ReadULongLE( stream, &error );
if ( error )
result = 0;
@@ -686,7 +695,7 @@
stream->size = 0x7FFFFFFFL; /* don't know the real size! */
stream->pos = 0;
- stream->base = 0;
+ stream->base = NULL;
stream->read = ft_gzip_stream_io;
stream->close = ft_gzip_stream_close;
diff --git a/src/3rdparty/freetype/src/gzip/rules.mk b/src/3rdparty/freetype/src/gzip/rules.mk
index 37cd991765..a8f74ec3c3 100644
--- a/src/3rdparty/freetype/src/gzip/rules.mk
+++ b/src/3rdparty/freetype/src/gzip/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002, 2003, 2013 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -21,9 +21,14 @@ GZIP_DIR := $(SRC_DIR)/gzip
# compilation flags for the driver
#
ifeq ($(SYSTEM_ZLIB),)
- GZIP_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR))
+ GZIP_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
else
- GZIP_COMPILE := $(FT_COMPILE)
+ GZIP_COMPILE := $(CC) $(ANSIFLAGS) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
endif
diff --git a/src/3rdparty/freetype/src/lzw/Jamfile b/src/3rdparty/freetype/src/lzw/Jamfile
index 6f1f516e7c..91effe20c4 100644
--- a/src/3rdparty/freetype/src/lzw/Jamfile
+++ b/src/3rdparty/freetype/src/lzw/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/lzw Jamfile
#
-# Copyright 2004, 2006 by
+# Copyright 2004-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/lzw/ftlzw.c b/src/3rdparty/freetype/src/lzw/ftlzw.c
index e1b3564a5f..2f4e3b0f1d 100644
--- a/src/3rdparty/freetype/src/lzw/ftlzw.c
+++ b/src/3rdparty/freetype/src/lzw/ftlzw.c
@@ -8,11 +8,10 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2004-2006, 2009, 2010, 2012-2014 by */
+/* Copyright 2004-2015 by */
/* Albert Chin-A-Young. */
/* */
-/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* based on code in `src/gzip/ftgzip.c' */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -331,16 +330,16 @@
}
- static FT_ULong
- ft_lzw_stream_io( FT_Stream stream,
- FT_ULong pos,
- FT_Byte* buffer,
- FT_ULong count )
+ static unsigned long
+ ft_lzw_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
{
FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer;
- return ft_lzw_file_io( zip, pos, buffer, count );
+ return ft_lzw_file_io( zip, offset, buffer, count );
}
diff --git a/src/3rdparty/freetype/src/lzw/ftzopen.c b/src/3rdparty/freetype/src/lzw/ftzopen.c
index d7a64576ba..f96bb73d98 100644
--- a/src/3rdparty/freetype/src/lzw/ftzopen.c
+++ b/src/3rdparty/freetype/src/lzw/ftzopen.c
@@ -8,7 +8,8 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2005-2007, 2009, 2011 by David Turner. */
+/* Copyright 2005-2015 by */
+/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -54,7 +55,7 @@
ft_lzwstate_get_code( FT_LzwState state )
{
FT_UInt num_bits = state->num_bits;
- FT_Int offset = state->buf_offset;
+ FT_UInt offset = state->buf_offset;
FT_Byte* p;
FT_Int result;
diff --git a/src/3rdparty/freetype/src/lzw/ftzopen.h b/src/3rdparty/freetype/src/lzw/ftzopen.h
index cdc8fd7c1a..d35e380595 100644
--- a/src/3rdparty/freetype/src/lzw/ftzopen.h
+++ b/src/3rdparty/freetype/src/lzw/ftzopen.h
@@ -8,7 +8,8 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2005, 2006, 2007, 2008 by David Turner. */
+/* Copyright 2005-2015 by */
+/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -115,8 +116,8 @@
FT_Int in_eof;
FT_Byte buf_tab[16];
- FT_Int buf_offset;
- FT_Int buf_size;
+ FT_UInt buf_offset;
+ FT_UInt buf_size;
FT_Bool buf_clear;
FT_Offset buf_total;
diff --git a/src/3rdparty/freetype/src/lzw/rules.mk b/src/3rdparty/freetype/src/lzw/rules.mk
index 5550a48d64..ab1c02fb50 100644
--- a/src/3rdparty/freetype/src/lzw/rules.mk
+++ b/src/3rdparty/freetype/src/lzw/rules.mk
@@ -3,11 +3,10 @@
#
-# Copyright 2004, 2005, 2006 by
+# Copyright 2004-2015 by
# Albert Chin-A-Young.
#
-# Based on src/lzw/rules.mk, Copyright 2002 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
+# based on `src/lzw/rules.mk'
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
@@ -23,7 +22,10 @@ LZW_DIR := $(SRC_DIR)/lzw
# compilation flags for the driver
#
-LZW_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(LZW_DIR))
+LZW_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(LZW_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# LZW support sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/otvalid/Jamfile b/src/3rdparty/freetype/src/otvalid/Jamfile
index b457143de4..461a222174 100644
--- a/src/3rdparty/freetype/src/otvalid/Jamfile
+++ b/src/3rdparty/freetype/src/otvalid/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/otvalid Jamfile
#
-# Copyright 2004 by
+# Copyright 2004-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,15 @@ SubDir FT2_TOP $(FT2_SRC_DIR) otvalid ;
if $(FT2_MULTI)
{
- _sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod otvmath ;
+ _sources = otvbase
+ otvcommn
+ otvgdef
+ otvgpos
+ otvgsub
+ otvjstf
+ otvmath
+ otvmod
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/otvalid/module.mk b/src/3rdparty/freetype/src/otvalid/module.mk
index 9cadde55e4..3d8c0d9f2e 100644
--- a/src/3rdparty/freetype/src/otvalid/module.mk
+++ b/src/3rdparty/freetype/src/otvalid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004, 2006 by
+# Copyright 2004-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/otvalid/otvalid.c b/src/3rdparty/freetype/src/otvalid/otvalid.c
index d5c2b75abb..ca597d707c 100644
--- a/src/3rdparty/freetype/src/otvalid/otvalid.c
+++ b/src/3rdparty/freetype/src/otvalid/otvalid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType validator for OpenType tables (body only). */
/* */
-/* Copyright 2004, 2007 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvalid.h b/src/3rdparty/freetype/src/otvalid/otvalid.h
index eb99b9cc48..3475deb7a2 100644
--- a/src/3rdparty/freetype/src/otvalid/otvalid.h
+++ b/src/3rdparty/freetype/src/otvalid/otvalid.h
@@ -4,7 +4,7 @@
/* */
/* OpenType table validation (specification only). */
/* */
-/* Copyright 2004, 2008 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvbase.c b/src/3rdparty/freetype/src/otvalid/otvbase.c
index 4f9d2fa256..24038c63b7 100644
--- a/src/3rdparty/freetype/src/otvalid/otvbase.c
+++ b/src/3rdparty/freetype/src/otvalid/otvbase.c
@@ -4,7 +4,7 @@
/* */
/* OpenType BASE table validation (body). */
/* */
-/* Copyright 2004, 2007 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvcommn.c b/src/3rdparty/freetype/src/otvalid/otvcommn.c
index 3c3de63ca9..103ffba3e8 100644
--- a/src/3rdparty/freetype/src/otvalid/otvcommn.c
+++ b/src/3rdparty/freetype/src/otvalid/otvcommn.c
@@ -4,7 +4,7 @@
/* */
/* OpenType common tables validation (body). */
/* */
-/* Copyright 2004, 2005, 2006, 2007 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -687,7 +687,7 @@
OTV_TRACE(( " (Count = %d)\n", Count ));
- otv_Coverage_validate( table + Coverage, otvalid, Count );
+ otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)Count );
OTV_LIMIT_CHECK( Count * 2 );
diff --git a/src/3rdparty/freetype/src/otvalid/otvcommn.h b/src/3rdparty/freetype/src/otvalid/otvcommn.h
index 5c93ba7eff..3aebf0200d 100644
--- a/src/3rdparty/freetype/src/otvalid/otvcommn.h
+++ b/src/3rdparty/freetype/src/otvalid/otvcommn.h
@@ -4,7 +4,7 @@
/* */
/* OpenType common tables validation (specification). */
/* */
-/* Copyright 2004, 2005, 2007, 2009, 2014 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otverror.h b/src/3rdparty/freetype/src/otvalid/otverror.h
index b6f00c9dba..214795e170 100644
--- a/src/3rdparty/freetype/src/otvalid/otverror.h
+++ b/src/3rdparty/freetype/src/otvalid/otverror.h
@@ -4,7 +4,7 @@
/* */
/* OpenType validation module error codes (specification only). */
/* */
-/* Copyright 2004, 2005, 2012, 2013 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvgdef.c b/src/3rdparty/freetype/src/otvalid/otvgdef.c
index e60ef363d8..8269d2f5b8 100644
--- a/src/3rdparty/freetype/src/otvalid/otvgdef.c
+++ b/src/3rdparty/freetype/src/otvalid/otvgdef.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GDEF table validation (body). */
/* */
-/* Copyright 2004, 2005, 2007 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,7 +61,7 @@
OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
- otv_Coverage_validate( Coverage, otvalid, GlyphCount );
+ otv_Coverage_validate( Coverage, otvalid, (FT_Int)GlyphCount );
if ( GlyphCount != otv_Coverage_get_count( Coverage ) )
FT_INVALID_DATA;
diff --git a/src/3rdparty/freetype/src/otvalid/otvgpos.c b/src/3rdparty/freetype/src/otvalid/otvgpos.c
index 1a9dbaaa03..44c43c53a1 100644
--- a/src/3rdparty/freetype/src/otvalid/otvgpos.c
+++ b/src/3rdparty/freetype/src/otvalid/otvgpos.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GPOS table validation (body). */
/* */
-/* Copyright 2002, 2004, 2005, 2006, 2007, 2008 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -395,7 +395,9 @@
len_value = otv_value_length( ValueFormat );
- otv_Coverage_validate( table + Coverage, otvalid, ValueCount );
+ otv_Coverage_validate( table + Coverage,
+ otvalid,
+ (FT_Int)ValueCount );
OTV_LIMIT_CHECK( ValueCount * len_value );
@@ -605,7 +607,9 @@
OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount ));
- otv_Coverage_validate( table + Coverage, otvalid, EntryExitCount );
+ otv_Coverage_validate( table + Coverage,
+ otvalid,
+ (FT_Int)EntryExitCount );
OTV_LIMIT_CHECK( EntryExitCount * 4 );
diff --git a/src/3rdparty/freetype/src/otvalid/otvgpos.h b/src/3rdparty/freetype/src/otvalid/otvgpos.h
index 14ca408261..a792bd9519 100644
--- a/src/3rdparty/freetype/src/otvalid/otvgpos.h
+++ b/src/3rdparty/freetype/src/otvalid/otvgpos.h
@@ -4,7 +4,7 @@
/* */
/* OpenType GPOS table validator (specification). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvgsub.c b/src/3rdparty/freetype/src/otvalid/otvgsub.c
index 024b8ca68c..0f8b02cd20 100644
--- a/src/3rdparty/freetype/src/otvalid/otvgsub.c
+++ b/src/3rdparty/freetype/src/otvalid/otvgsub.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GSUB table validation (body). */
/* */
-/* Copyright 2004, 2005, 2007 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -70,11 +70,11 @@
otv_Coverage_validate( Coverage, otvalid, -1 );
- idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID;
+ idx = (FT_Long)otv_Coverage_get_first( Coverage ) + DeltaGlyphID;
if ( idx < 0 )
FT_INVALID_DATA;
- idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID;
+ idx = (FT_Long)otv_Coverage_get_last( Coverage ) + DeltaGlyphID;
if ( (FT_UInt)idx >= otvalid->glyph_count )
FT_INVALID_DATA;
}
@@ -91,7 +91,9 @@
OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
- otv_Coverage_validate( table + Coverage, otvalid, GlyphCount );
+ otv_Coverage_validate( table + Coverage,
+ otvalid,
+ (FT_Int)GlyphCount );
OTV_LIMIT_CHECK( GlyphCount * 2 );
diff --git a/src/3rdparty/freetype/src/otvalid/otvjstf.c b/src/3rdparty/freetype/src/otvalid/otvjstf.c
index f273be8bbc..fe68a60f60 100644
--- a/src/3rdparty/freetype/src/otvalid/otvjstf.c
+++ b/src/3rdparty/freetype/src/otvalid/otvjstf.c
@@ -4,7 +4,7 @@
/* */
/* OpenType JSTF table validation (body). */
/* */
-/* Copyright 2004, 2007 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvmath.c b/src/3rdparty/freetype/src/otvalid/otvmath.c
index d1791f8deb..db3d5f8f52 100644
--- a/src/3rdparty/freetype/src/otvalid/otvmath.c
+++ b/src/3rdparty/freetype/src/otvalid/otvmath.c
@@ -4,7 +4,7 @@
/* */
/* OpenType MATH table validation (body). */
/* */
-/* Copyright 2007, 2008 by */
+/* Copyright 2007-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by George Williams. */
@@ -108,7 +108,7 @@
table_size = 4 + 4 * cnt;
OTV_SIZE_CHECK( Coverage );
- otv_Coverage_validate( table + Coverage, otvalid, cnt );
+ otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)cnt );
for ( i = 0; i < cnt; ++i )
{
@@ -196,7 +196,7 @@
table_size = 4 + 8 * cnt;
OTV_SIZE_CHECK( Coverage );
- otv_Coverage_validate( table + Coverage, otvalid, cnt );
+ otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)cnt );
for ( i = 0; i < cnt; ++i )
{
@@ -378,11 +378,11 @@
OTV_SIZE_CHECK( VCoverage );
if ( VCoverage )
- otv_Coverage_validate( table + VCoverage, otvalid, vcnt );
+ otv_Coverage_validate( table + VCoverage, otvalid, (FT_Int)vcnt );
OTV_SIZE_CHECK( HCoverage );
if ( HCoverage )
- otv_Coverage_validate( table + HCoverage, otvalid, hcnt );
+ otv_Coverage_validate( table + HCoverage, otvalid, (FT_Int)hcnt );
for ( i = 0; i < vcnt; ++i )
{
diff --git a/src/3rdparty/freetype/src/otvalid/otvmod.c b/src/3rdparty/freetype/src/otvalid/otvmod.c
index 37c6e869dd..92f851398d 100644
--- a/src/3rdparty/freetype/src/otvalid/otvmod.c
+++ b/src/3rdparty/freetype/src/otvalid/otvmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType's OpenType validation module implementation (body). */
/* */
-/* Copyright 2004-2008, 2013 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/otvmod.h b/src/3rdparty/freetype/src/otvalid/otvmod.h
index f7e1550787..c3a0234e9e 100644
--- a/src/3rdparty/freetype/src/otvalid/otvmod.h
+++ b/src/3rdparty/freetype/src/otvalid/otvmod.h
@@ -5,7 +5,7 @@
/* FreeType's OpenType validation module implementation */
/* (specification). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/otvalid/rules.mk b/src/3rdparty/freetype/src/otvalid/rules.mk
index 53bd41e5e7..56d749cc97 100644
--- a/src/3rdparty/freetype/src/otvalid/rules.mk
+++ b/src/3rdparty/freetype/src/otvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004, 2007 by
+# Copyright 2004-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ OTV_DIR := $(SRC_DIR)/otvalid
# compilation flags for the driver
#
-OTV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(OTV_DIR))
+OTV_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(OTV_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# OTV driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/pcf/Jamfile b/src/3rdparty/freetype/src/pcf/Jamfile
index 752fcac2a1..f4789ea625 100644
--- a/src/3rdparty/freetype/src/pcf/Jamfile
+++ b/src/3rdparty/freetype/src/pcf/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/pcf Jamfile
#
-# Copyright 2001, 2003 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,10 @@ SubDir FT2_TOP $(FT2_SRC_DIR) pcf ;
if $(FT2_MULTI)
{
- _sources = pcfdrivr pcfread pcfutil ;
+ _sources = pcfdrivr
+ pcfread
+ pcfutil
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/pcf/pcf.h b/src/3rdparty/freetype/src/pcf/pcf.h
index af0ffc3378..c0da503412 100644
--- a/src/3rdparty/freetype/src/pcf/pcf.h
+++ b/src/3rdparty/freetype/src/pcf/pcf.h
@@ -148,9 +148,9 @@ FT_BEGIN_HEADER
int nprops;
PCF_Property properties;
- FT_Long nmetrics;
+ FT_ULong nmetrics;
PCF_Metric metrics;
- FT_Long nencodings;
+ FT_ULong nencodings;
PCF_Encoding encodings;
FT_Short defaultChar;
diff --git a/src/3rdparty/freetype/src/pcf/pcfdrivr.c b/src/3rdparty/freetype/src/pcf/pcfdrivr.c
index 96f6912ba9..8d2ed7cf4d 100644
--- a/src/3rdparty/freetype/src/pcf/pcfdrivr.c
+++ b/src/3rdparty/freetype/src/pcf/pcfdrivr.c
@@ -48,7 +48,7 @@ THE SOFTWARE.
#define FT_COMPONENT trace_pcfread
#include FT_SERVICE_BDF_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
/*************************************************************************/
@@ -64,7 +64,7 @@ THE SOFTWARE.
typedef struct PCF_CMapRec_
{
FT_CMapRec root;
- FT_UInt num_encodings;
+ FT_ULong num_encodings;
PCF_Encoding encodings;
} PCF_CMapRec, *PCF_CMap;
@@ -80,7 +80,7 @@ THE SOFTWARE.
FT_UNUSED( init_data );
- cmap->num_encodings = (FT_UInt)face->nencodings;
+ cmap->num_encodings = face->nencodings;
cmap->encodings = face->encodings;
return FT_Err_Ok;
@@ -104,7 +104,7 @@ THE SOFTWARE.
{
PCF_CMap cmap = (PCF_CMap)pcfcmap;
PCF_Encoding encodings = cmap->encodings;
- FT_UInt min, max, mid;
+ FT_ULong min, max, mid;
FT_UInt result = 0;
@@ -117,7 +117,7 @@ THE SOFTWARE.
mid = ( min + max ) >> 1;
- code = encodings[mid].enc;
+ code = (FT_ULong)encodings[mid].enc;
if ( charcode == code )
{
@@ -141,7 +141,7 @@ THE SOFTWARE.
{
PCF_CMap cmap = (PCF_CMap)pcfcmap;
PCF_Encoding encodings = cmap->encodings;
- FT_UInt min, max, mid;
+ FT_ULong min, max, mid;
FT_ULong charcode = *acharcode + 1;
FT_UInt result = 0;
@@ -155,7 +155,7 @@ THE SOFTWARE.
mid = ( min + max ) >> 1;
- code = encodings[mid].enc;
+ code = (FT_ULong)encodings[mid].enc;
if ( charcode == code )
{
@@ -172,7 +172,7 @@ THE SOFTWARE.
charcode = 0;
if ( min < cmap->num_encodings )
{
- charcode = encodings[min].enc;
+ charcode = (FT_ULong)encodings[min].enc;
result = encodings[min].glyph + 1;
}
@@ -345,13 +345,14 @@ THE SOFTWARE.
#endif
}
- /* PCF could not have multiple face in single font file.
- * XXX: non-zero face_index is already invalid argument, but
- * Type1, Type42 driver has a convention to return
+ /* PCF cannot have multiple faces in a single font file.
+ * XXX: A non-zero face_index is already an invalid argument, but
+ * Type1, Type42 drivers have a convention to return
* an invalid argument error when the font could be
* opened by the specified driver.
*/
- if ( face_index > 0 ) {
+ if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
+ {
FT_ERROR(( "PCF_Face_Init: invalid face index\n" ));
PCF_Face_Done( pcfface );
return FT_THROW( Invalid_Argument );
@@ -430,9 +431,9 @@ THE SOFTWARE.
FT_Select_Metrics( size->face, strike_index );
- size->metrics.ascender = accel->fontAscent << 6;
- size->metrics.descender = -accel->fontDescent << 6;
- size->metrics.max_advance = accel->maxbounds.characterWidth << 6;
+ size->metrics.ascender = accel->fontAscent * 64;
+ size->metrics.descender = -accel->fontDescent * 64;
+ size->metrics.max_advance = accel->maxbounds.characterWidth * 64;
return FT_Err_Ok;
}
@@ -487,7 +488,7 @@ THE SOFTWARE.
FT_Error error = FT_Err_Ok;
FT_Bitmap* bitmap = &slot->bitmap;
PCF_Metric metric;
- FT_Offset bytes;
+ FT_ULong bytes;
FT_UNUSED( load_flags );
@@ -513,8 +514,10 @@ THE SOFTWARE.
metric = face->metrics + glyph_index;
- bitmap->rows = metric->ascent + metric->descent;
- bitmap->width = metric->rightSideBearing - metric->leftSideBearing;
+ bitmap->rows = (unsigned int)( metric->ascent +
+ metric->descent );
+ bitmap->width = (unsigned int)( metric->rightSideBearing -
+ metric->leftSideBearing );
bitmap->num_grays = 1;
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
@@ -526,19 +529,19 @@ THE SOFTWARE.
switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) )
{
case 1:
- bitmap->pitch = ( bitmap->width + 7 ) >> 3;
+ bitmap->pitch = (int)( ( bitmap->width + 7 ) >> 3 );
break;
case 2:
- bitmap->pitch = ( ( bitmap->width + 15 ) >> 4 ) << 1;
+ bitmap->pitch = (int)( ( ( bitmap->width + 15 ) >> 4 ) << 1 );
break;
case 4:
- bitmap->pitch = ( ( bitmap->width + 31 ) >> 5 ) << 2;
+ bitmap->pitch = (int)( ( ( bitmap->width + 31 ) >> 5 ) << 2 );
break;
case 8:
- bitmap->pitch = ( ( bitmap->width + 63 ) >> 6 ) << 3;
+ bitmap->pitch = (int)( ( ( bitmap->width + 63 ) >> 6 ) << 3 );
break;
default:
@@ -546,7 +549,7 @@ THE SOFTWARE.
}
/* XXX: to do: are there cases that need repadding the bitmap? */
- bytes = bitmap->pitch * bitmap->rows;
+ bytes = (FT_ULong)bitmap->pitch * bitmap->rows;
error = ft_glyphslot_alloc_bitmap( slot, (FT_ULong)bytes );
if ( error )
@@ -581,16 +584,16 @@ THE SOFTWARE.
slot->bitmap_left = metric->leftSideBearing;
slot->bitmap_top = metric->ascent;
- slot->metrics.horiAdvance = metric->characterWidth << 6;
- slot->metrics.horiBearingX = metric->leftSideBearing << 6;
- slot->metrics.horiBearingY = metric->ascent << 6;
- slot->metrics.width = ( metric->rightSideBearing -
- metric->leftSideBearing ) << 6;
- slot->metrics.height = bitmap->rows << 6;
+ slot->metrics.horiAdvance = (FT_Pos)( metric->characterWidth * 64 );
+ slot->metrics.horiBearingX = (FT_Pos)( metric->leftSideBearing * 64 );
+ slot->metrics.horiBearingY = (FT_Pos)( metric->ascent * 64 );
+ slot->metrics.width = (FT_Pos)( ( metric->rightSideBearing -
+ metric->leftSideBearing ) * 64 );
+ slot->metrics.height = (FT_Pos)( bitmap->rows * 64 );
ft_synthesize_vertical_metrics( &slot->metrics,
( face->accel.fontAscent +
- face->accel.fontDescent ) << 6 );
+ face->accel.fontDescent ) * 64 );
Exit:
return error;
@@ -667,8 +670,8 @@ THE SOFTWARE.
static const FT_ServiceDescRec pcf_services[] =
{
- { FT_SERVICE_ID_BDF, &pcf_service_bdf },
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PCF },
+ { FT_SERVICE_ID_BDF, &pcf_service_bdf },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_PCF },
{ NULL, NULL }
};
diff --git a/src/3rdparty/freetype/src/pcf/pcfread.c b/src/3rdparty/freetype/src/pcf/pcfread.c
index a29a9e371b..afa1480771 100644
--- a/src/3rdparty/freetype/src/pcf/pcfread.c
+++ b/src/3rdparty/freetype/src/pcf/pcfread.c
@@ -448,14 +448,14 @@ THE SOFTWARE.
pcf_get_properties( FT_Stream stream,
PCF_Face face )
{
- PCF_ParseProperty props = 0;
+ PCF_ParseProperty props = NULL;
PCF_Property properties = NULL;
FT_ULong nprops, i;
FT_ULong format, size;
FT_Error error;
FT_Memory memory = FT_FACE( face )->memory;
FT_ULong string_size;
- FT_String* strings = 0;
+ FT_String* strings = NULL;
error = pcf_seek_to_table_type( stream,
@@ -485,9 +485,9 @@ THE SOFTWARE.
goto Bail;
FT_TRACE4(( " nprop = %d (truncate %d props)\n",
- (int)nprops, nprops - (int)nprops ));
+ (int)nprops, nprops - (FT_ULong)(int)nprops ));
- nprops = (int)nprops;
+ nprops = (FT_ULong)(int)nprops;
/* rough estimate */
if ( nprops > size / PCF_PROPERTY_SIZE )
@@ -620,7 +620,7 @@ THE SOFTWARE.
FT_Error error;
FT_Memory memory = FT_FACE( face )->memory;
FT_ULong format, size;
- PCF_Metric metrics = 0;
+ PCF_Metric metrics = NULL;
FT_ULong nmetrics, i;
@@ -766,8 +766,7 @@ THE SOFTWARE.
FT_TRACE4(( " number of bitmaps: %d\n", nbitmaps ));
- /* XXX: PCF_Face->nmetrics is signed FT_Long, see pcf.h */
- if ( face->nmetrics < 0 || nbitmaps != (FT_ULong)face->nmetrics )
+ if ( nbitmaps != face->nmetrics )
return FT_THROW( Invalid_File_Format );
if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
@@ -795,9 +794,10 @@ THE SOFTWARE.
if ( error )
goto Bail;
- sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
+ sizebitmaps = (FT_ULong)bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
- FT_TRACE4(( " padding %d implies a size of %ld\n", i, bitmapSizes[i] ));
+ FT_TRACE4(( " padding %d implies a size of %ld\n",
+ i, bitmapSizes[i] ));
}
FT_TRACE4(( " %d bitmaps, padding index %ld\n",
@@ -817,7 +817,7 @@ THE SOFTWARE.
" invalid offset to bitmap data of glyph %d\n", i ));
}
else
- face->metrics[i].bits = stream->pos + offsets[i];
+ face->metrics[i].bits = stream->pos + (FT_ULong)offsets[i];
}
face->bitmapsFormat = format;
@@ -837,8 +837,10 @@ THE SOFTWARE.
FT_ULong format, size;
int firstCol, lastCol;
int firstRow, lastRow;
- int nencoding, encodingOffset;
- int i, j, k;
+ FT_ULong nencoding;
+ int encodingOffset;
+ int i, j;
+ FT_ULong k;
PCF_Encoding encoding = NULL;
@@ -893,7 +895,8 @@ THE SOFTWARE.
FT_TRACE4(( " firstCol %d, lastCol %d, firstRow %d, lastRow %d\n",
firstCol, lastCol, firstRow, lastRow ));
- nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 );
+ nencoding = (FT_ULong)( lastCol - firstCol + 1 ) *
+ (FT_ULong)( lastRow - firstRow + 1 );
if ( FT_NEW_ARRAY( encoding, nencoding ) )
return FT_THROW( Out_Of_Memory );
@@ -912,10 +915,10 @@ THE SOFTWARE.
else
encodingOffset = FT_GET_SHORT_LE();
- if ( encodingOffset != -1 )
+ if ( encodingOffset > -1 )
{
encoding[k].enc = i * 256 + j;
- encoding[k].glyph = (FT_Short)encodingOffset;
+ encoding[k].glyph = (FT_UShort)encodingOffset;
FT_TRACE5(( " code %d (0x%04X): idx %d\n",
encoding[k].enc, encoding[k].enc, encoding[k].glyph ));
@@ -1256,7 +1259,7 @@ THE SOFTWARE.
*
* This implies bumping the number of `available' glyphs by 1.
*/
- root->num_glyphs = face->nmetrics + 1;
+ root->num_glyphs = (FT_Long)( face->nmetrics + 1 );
root->num_fixed_sizes = 1;
if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )
@@ -1269,51 +1272,91 @@ THE SOFTWARE.
FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );
+ /* for simplicity, we take absolute values of integer properties */
+
#if 0
bsize->height = face->accel.maxbounds.ascent << 6;
#endif
- bsize->height = (FT_Short)( face->accel.fontAscent +
- face->accel.fontDescent );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( face->accel.fontAscent + face->accel.fontDescent < 0 )
+ FT_TRACE0(( "pcf_load_font: negative height\n" ));
+#endif
+ bsize->height = FT_ABS( (FT_Short)( face->accel.fontAscent +
+ face->accel.fontDescent ) );
prop = pcf_find_property( face, "AVERAGE_WIDTH" );
if ( prop )
- bsize->width = (FT_Short)( ( prop->value.l + 5 ) / 10 );
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( prop->value.l < 0 )
+ FT_TRACE0(( "pcf_load_font: negative average width\n" ));
+#endif
+ bsize->width = FT_ABS( (FT_Short)( ( prop->value.l ) + 5 ) / 10 );
+ }
else
- bsize->width = (FT_Short)( bsize->height * 2/3 );
+ bsize->width = (FT_Short)FT_MulDiv( bsize->height, 2, 3 );
prop = pcf_find_property( face, "POINT_SIZE" );
if ( prop )
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( prop->value.l < 0 )
+ FT_TRACE0(( "pcf_load_font: negative point size\n" ));
+#endif
/* convert from 722.7 decipoints to 72 points per inch */
- bsize->size =
- (FT_Pos)( ( prop->value.l * 64 * 7200 + 36135L ) / 72270L );
+ bsize->size = FT_MulDiv( FT_ABS( prop->value.l ),
+ 64 * 7200,
+ 72270L );
+ }
prop = pcf_find_property( face, "PIXEL_SIZE" );
if ( prop )
- bsize->y_ppem = (FT_Short)prop->value.l << 6;
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( prop->value.l < 0 )
+ FT_TRACE0(( "pcf_load_font: negative pixel size\n" ));
+#endif
+ bsize->y_ppem = FT_ABS( (FT_Short)prop->value.l ) << 6;
+ }
prop = pcf_find_property( face, "RESOLUTION_X" );
if ( prop )
- resolution_x = (FT_Short)prop->value.l;
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( prop->value.l < 0 )
+ FT_TRACE0(( "pcf_load_font: negative X resolution\n" ));
+#endif
+ resolution_x = FT_ABS( (FT_Short)prop->value.l );
+ }
prop = pcf_find_property( face, "RESOLUTION_Y" );
if ( prop )
- resolution_y = (FT_Short)prop->value.l;
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( prop->value.l < 0 )
+ FT_TRACE0(( "pcf_load_font: negative Y resolution\n" ));
+#endif
+ resolution_y = FT_ABS( (FT_Short)prop->value.l );
+ }
if ( bsize->y_ppem == 0 )
{
bsize->y_ppem = bsize->size;
if ( resolution_y )
- bsize->y_ppem = bsize->y_ppem * resolution_y / 72;
+ bsize->y_ppem = FT_MulDiv( bsize->y_ppem, resolution_y, 72 );
}
if ( resolution_x && resolution_y )
- bsize->x_ppem = bsize->y_ppem * resolution_x / resolution_y;
+ bsize->x_ppem = FT_MulDiv( bsize->y_ppem,
+ resolution_x,
+ resolution_y );
else
bsize->x_ppem = bsize->y_ppem;
}
/* set up charset */
{
- PCF_Property charset_registry = 0, charset_encoding = 0;
+ PCF_Property charset_registry, charset_encoding;
charset_registry = pcf_find_property( face, "CHARSET_REGISTRY" );
diff --git a/src/3rdparty/freetype/src/pcf/rules.mk b/src/3rdparty/freetype/src/pcf/rules.mk
index 78641528fa..1b55daf4f4 100644
--- a/src/3rdparty/freetype/src/pcf/rules.mk
+++ b/src/3rdparty/freetype/src/pcf/rules.mk
@@ -30,7 +30,10 @@
PCF_DIR := $(SRC_DIR)/pcf
-PCF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PCF_DIR))
+PCF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PCF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# pcf driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/pfr/Jamfile b/src/3rdparty/freetype/src/pfr/Jamfile
index 9e2f2b8d05..c5b35be870 100644
--- a/src/3rdparty/freetype/src/pfr/Jamfile
+++ b/src/3rdparty/freetype/src/pfr/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/pfr Jamfile
#
-# Copyright 2002 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,13 @@ SubDir FT2_TOP $(FT2_SRC_DIR) pfr ;
if $(FT2_MULTI)
{
- _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap pfrsbit ;
+ _sources = pfrcmap
+ pfrdrivr
+ pfrgload
+ pfrload
+ pfrobjs
+ pfrsbit
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/pfr/module.mk b/src/3rdparty/freetype/src/pfr/module.mk
index 8d1d28a9d2..3f5a47e888 100644
--- a/src/3rdparty/freetype/src/pfr/module.mk
+++ b/src/3rdparty/freetype/src/pfr/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002, 2006 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/pfr/pfr.c b/src/3rdparty/freetype/src/pfr/pfr.c
index eb2c4edb7e..96e67300a5 100644
--- a/src/3rdparty/freetype/src/pfr/pfr.c
+++ b/src/3rdparty/freetype/src/pfr/pfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver component. */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrcmap.c b/src/3rdparty/freetype/src/pfr/pfrcmap.c
index 90ba0105ea..88ff55a806 100644
--- a/src/3rdparty/freetype/src/pfr/pfrcmap.c
+++ b/src/3rdparty/freetype/src/pfr/pfrcmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR cmap handling (body). */
/* */
-/* Copyright 2002, 2007, 2009, 2013 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrcmap.h b/src/3rdparty/freetype/src/pfr/pfrcmap.h
index a626953054..87e1e5b942 100644
--- a/src/3rdparty/freetype/src/pfr/pfrcmap.h
+++ b/src/3rdparty/freetype/src/pfr/pfrcmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR cmap handling (specification). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrdrivr.c b/src/3rdparty/freetype/src/pfr/pfrdrivr.c
index db66281acd..875374889c 100644
--- a/src/3rdparty/freetype/src/pfr/pfrdrivr.c
+++ b/src/3rdparty/freetype/src/pfr/pfrdrivr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver interface (body). */
/* */
-/* Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,7 +20,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_SERVICE_PFR_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#include "pfrdrivr.h"
#include "pfrobjs.h"
@@ -43,12 +43,14 @@
if ( phys->outline_resolution != phys->metrics_resolution )
{
if ( avector->x != 0 )
- avector->x = FT_MulDiv( avector->x, phys->outline_resolution,
- phys->metrics_resolution );
+ avector->x = FT_MulDiv( avector->x,
+ (FT_Long)phys->outline_resolution,
+ (FT_Long)phys->metrics_resolution );
if ( avector->y != 0 )
- avector->y = FT_MulDiv( avector->x, phys->outline_resolution,
- phys->metrics_resolution );
+ avector->y = FT_MulDiv( avector->y,
+ (FT_Long)phys->outline_resolution,
+ (FT_Long)phys->metrics_resolution );
}
return FT_Err_Ok;
@@ -118,10 +120,10 @@
if ( size )
{
x_scale = FT_DivFix( size->metrics.x_ppem << 6,
- phys->metrics_resolution );
+ (FT_Long)phys->metrics_resolution );
y_scale = FT_DivFix( size->metrics.y_ppem << 6,
- phys->metrics_resolution );
+ (FT_Long)phys->metrics_resolution );
}
if ( ametrics_x_scale )
@@ -151,7 +153,7 @@
static const FT_ServiceDescRec pfr_services[] =
{
{ FT_SERVICE_ID_PFR_METRICS, &pfr_metrics_service_rec },
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PFR },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_PFR },
{ NULL, NULL }
};
diff --git a/src/3rdparty/freetype/src/pfr/pfrdrivr.h b/src/3rdparty/freetype/src/pfr/pfrdrivr.h
index 75f86c5cdd..b5be4709c8 100644
--- a/src/3rdparty/freetype/src/pfr/pfrdrivr.h
+++ b/src/3rdparty/freetype/src/pfr/pfrdrivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type PFR driver interface (specification). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrerror.h b/src/3rdparty/freetype/src/pfr/pfrerror.h
index 94dc8c5e1c..978e7b2d34 100644
--- a/src/3rdparty/freetype/src/pfr/pfrerror.h
+++ b/src/3rdparty/freetype/src/pfr/pfrerror.h
@@ -4,7 +4,7 @@
/* */
/* PFR error codes (specification only). */
/* */
-/* Copyright 2002, 2012 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrgload.c b/src/3rdparty/freetype/src/pfr/pfrgload.c
index 2ce093779c..88df06a03d 100644
--- a/src/3rdparty/freetype/src/pfr/pfrgload.c
+++ b/src/3rdparty/freetype/src/pfr/pfrgload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (body). */
/* */
-/* Copyright 2002, 2003, 2005, 2007, 2010, 2013 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -143,7 +143,7 @@
error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 0 );
if ( !error )
{
- FT_UInt n = outline->n_points;
+ FT_Int n = outline->n_points;
outline->points[n] = *to;
@@ -632,14 +632,14 @@
if ( format & PFR_SUBGLYPH_XSCALE )
{
PFR_CHECK( 2 );
- subglyph->x_scale = PFR_NEXT_SHORT( p ) << 4;
+ subglyph->x_scale = PFR_NEXT_SHORT( p ) * 16;
}
subglyph->y_scale = 0x10000L;
if ( format & PFR_SUBGLYPH_YSCALE )
{
PFR_CHECK( 2 );
- subglyph->y_scale = PFR_NEXT_SHORT( p ) << 4;
+ subglyph->y_scale = PFR_NEXT_SHORT( p ) * 16;
}
/* read offset */
@@ -693,7 +693,7 @@
if ( format & PFR_SUBGLYPH_3BYTE_OFFSET )
{
PFR_CHECK( 3 );
- subglyph->gps_offset = PFR_NEXT_LONG( p );
+ subglyph->gps_offset = PFR_NEXT_ULONG( p );
}
else
{
@@ -736,7 +736,7 @@
if ( size > 0 && *p & PFR_GLYPH_IS_COMPOUND )
{
- FT_Int n, old_count, count;
+ FT_UInt n, old_count, count;
FT_GlyphLoader loader = glyph->loader;
FT_Outline* base = &loader->base.outline;
diff --git a/src/3rdparty/freetype/src/pfr/pfrgload.h b/src/3rdparty/freetype/src/pfr/pfrgload.h
index 7cc7a8702a..c7c8da15a1 100644
--- a/src/3rdparty/freetype/src/pfr/pfrgload.h
+++ b/src/3rdparty/freetype/src/pfr/pfrgload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (specification). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrload.c b/src/3rdparty/freetype/src/pfr/pfrload.c
index f68d016392..ec7311df56 100644
--- a/src/3rdparty/freetype/src/pfr/pfrload.c
+++ b/src/3rdparty/freetype/src/pfr/pfrload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (body). */
/* */
-/* Copyright 2002-2005, 2007, 2009, 2010, 2013, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -199,7 +199,7 @@
FT_LOCAL_DEF( FT_Error )
pfr_log_font_count( FT_Stream stream,
FT_UInt32 section_offset,
- FT_UInt *acount )
+ FT_Long *acount )
{
FT_Error error;
FT_UInt count;
@@ -212,7 +212,7 @@
result = count;
Exit:
- *acount = result;
+ *acount = (FT_Long)result;
return error;
}
@@ -449,9 +449,9 @@
FT_Byte* limit,
PFR_PhyFont phy_font )
{
- FT_Error error = FT_Err_Ok;
- FT_Memory memory = phy_font->memory;
- FT_PtrDist len = limit - p;
+ FT_Error error = FT_Err_Ok;
+ FT_Memory memory = phy_font->memory;
+ FT_UInt len = (FT_UInt)( limit - p );
if ( phy_font->font_id != NULL )
@@ -535,7 +535,8 @@
item->pair_count = PFR_NEXT_BYTE( p );
item->base_adj = PFR_NEXT_SHORT( p );
item->flags = PFR_NEXT_BYTE( p );
- item->offset = phy_font->offset + ( p - phy_font->cursor );
+ item->offset = phy_font->offset +
+ (FT_Offset)( p - phy_font->cursor );
#ifndef PFR_CONFIG_NO_CHECKS
item->pair_size = 3;
@@ -864,7 +865,7 @@
phy_font->num_chars = count = PFR_NEXT_USHORT( p );
- phy_font->chars_offset = offset + ( p - stream->cursor );
+ phy_font->chars_offset = offset + (FT_Offset)( p - stream->cursor );
if ( FT_NEW_ARRAY( phy_font->chars, count ) )
goto Fail;
@@ -898,7 +899,7 @@
cur->advance = ( flags & PFR_PHY_PROPORTIONAL )
? PFR_NEXT_SHORT( p )
- : (FT_Int) phy_font->standard_advance;
+ : phy_font->standard_advance;
#if 0
cur->ascii = ( flags & PFR_PHY_ASCII_CODE )
diff --git a/src/3rdparty/freetype/src/pfr/pfrload.h b/src/3rdparty/freetype/src/pfr/pfrload.h
index ed010715d1..0a512346b6 100644
--- a/src/3rdparty/freetype/src/pfr/pfrload.h
+++ b/src/3rdparty/freetype/src/pfr/pfrload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (specification). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -85,7 +85,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
pfr_log_font_count( FT_Stream stream,
FT_UInt32 log_section_offset,
- FT_UInt *acount );
+ FT_Long *acount );
/* load a pfr logical font entry */
FT_LOCAL( FT_Error )
diff --git a/src/3rdparty/freetype/src/pfr/pfrobjs.c b/src/3rdparty/freetype/src/pfr/pfrobjs.c
index 0c89242c74..b854b00ba8 100644
--- a/src/3rdparty/freetype/src/pfr/pfrobjs.c
+++ b/src/3rdparty/freetype/src/pfr/pfrobjs.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (body). */
/* */
-/* Copyright 2002-2008, 2010-2011, 2013, 2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -94,7 +94,7 @@
/* check face index */
{
- FT_UInt num_faces;
+ FT_Long num_faces;
error = pfr_log_font_count( stream,
@@ -109,7 +109,7 @@
if ( face_index < 0 )
goto Exit;
- if ( face_index >= pfrface->num_faces )
+ if ( ( face_index & 0xFFFF ) >= pfrface->num_faces )
{
FT_ERROR(( "pfr_face_init: invalid face index\n" ));
error = FT_THROW( Invalid_Argument );
@@ -118,7 +118,7 @@
/* load the face */
error = pfr_log_font_load(
- &face->log_font, stream, face_index,
+ &face->log_font, stream, (FT_UInt)( face_index & 0xFFFF ),
face->header.log_dir_offset,
FT_BOOL( face->header.phy_font_max_size_high != 0 ) );
if ( error )
@@ -136,8 +136,8 @@
PFR_PhyFont phy_font = &face->phy_font;
- pfrface->face_index = face_index;
- pfrface->num_glyphs = phy_font->num_chars + 1;
+ pfrface->face_index = face_index & 0xFFFF;
+ pfrface->num_glyphs = (FT_Long)phy_font->num_chars + 1;
pfrface->face_flags |= FT_FACE_FLAG_SCALABLE;
@@ -192,7 +192,7 @@
pfrface->style_name = phy_font->style_name;
pfrface->num_fixed_sizes = 0;
- pfrface->available_sizes = 0;
+ pfrface->available_sizes = NULL;
pfrface->bbox = phy_font->bbox;
pfrface->units_per_EM = (FT_UShort)phy_font->outline_resolution;
@@ -218,13 +218,13 @@
strike = phy_font->strikes;
for ( n = 0; n < count; n++, size++, strike++ )
{
- size->height = (FT_UShort)strike->y_ppm;
- size->width = (FT_UShort)strike->x_ppm;
- size->size = strike->y_ppm << 6;
- size->x_ppem = strike->x_ppm << 6;
- size->y_ppem = strike->y_ppm << 6;
+ size->height = (FT_Short)strike->y_ppm;
+ size->width = (FT_Short)strike->x_ppm;
+ size->size = (FT_Pos)( strike->y_ppm << 6 );
+ size->x_ppem = (FT_Pos)( strike->x_ppm << 6 );
+ size->y_ppem = (FT_Pos)( strike->y_ppm << 6 );
}
- pfrface->num_fixed_sizes = count;
+ pfrface->num_fixed_sizes = (FT_Int)count;
}
/* now compute maximum advance width */
@@ -366,7 +366,7 @@
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &pfrslot->metrics;
FT_Pos advance;
- FT_Int em_metrics, em_outline;
+ FT_UInt em_metrics, em_outline;
FT_Bool scaling;
@@ -390,7 +390,9 @@
em_outline = face->phy_font.outline_resolution;
if ( em_metrics != em_outline )
- advance = FT_MulDiv( advance, em_outline, em_metrics );
+ advance = FT_MulDiv( advance,
+ (FT_Long)em_outline,
+ (FT_Long)em_metrics );
if ( face->phy_font.flags & PFR_PHY_VERTICAL )
metrics->vertAdvance = advance;
diff --git a/src/3rdparty/freetype/src/pfr/pfrobjs.h b/src/3rdparty/freetype/src/pfr/pfrobjs.h
index f6aa8b44cc..e990b45a0a 100644
--- a/src/3rdparty/freetype/src/pfr/pfrobjs.h
+++ b/src/3rdparty/freetype/src/pfr/pfrobjs.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (specification). */
/* */
-/* Copyright 2002, 2003, 2004 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrsbit.c b/src/3rdparty/freetype/src/pfr/pfrsbit.c
index 979bf78a26..bb5df5c9f9 100644
--- a/src/3rdparty/freetype/src/pfr/pfrsbit.c
+++ b/src/3rdparty/freetype/src/pfr/pfrsbit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (body). */
/* */
-/* Copyright 2002, 2003, 2006, 2009, 2010, 2013 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -39,9 +39,9 @@
{
FT_Byte* line; /* current line start */
FT_Int pitch; /* line size in bytes */
- FT_Int width; /* width in pixels/bits */
- FT_Int rows; /* number of remaining rows to scan */
- FT_Int total; /* total number of bits to draw */
+ FT_UInt width; /* width in pixels/bits */
+ FT_UInt rows; /* number of remaining rows to scan */
+ FT_UInt total; /* total number of bits to draw */
} PFR_BitWriterRec, *PFR_BitWriter;
@@ -59,7 +59,7 @@
if ( !decreasing )
{
- writer->line += writer->pitch * ( target->rows - 1 );
+ writer->line += writer->pitch * (FT_Int)( target->rows - 1 );
writer->pitch = -writer->pitch;
}
}
@@ -70,15 +70,15 @@
FT_Byte* p,
FT_Byte* limit )
{
- FT_Int n, reload;
- FT_Int left = writer->width;
+ FT_UInt n, reload;
+ FT_UInt left = writer->width;
FT_Byte* cur = writer->line;
FT_UInt mask = 0x80;
FT_UInt val = 0;
FT_UInt c = 0;
- n = (FT_Int)( limit - p ) * 8;
+ n = (FT_UInt)( limit - p ) * 8;
if ( n > writer->total )
n = writer->total;
@@ -110,7 +110,7 @@
cur[0] = (FT_Byte)c;
mask = 0x80;
c = 0;
- cur ++;
+ cur++;
}
}
@@ -124,8 +124,9 @@
FT_Byte* p,
FT_Byte* limit )
{
- FT_Int n, phase, count, counts[2], reload;
- FT_Int left = writer->width;
+ FT_Int phase, count, counts[2];
+ FT_UInt n, reload;
+ FT_UInt left = writer->width;
FT_Byte* cur = writer->line;
FT_UInt mask = 0x80;
FT_UInt c = 0;
@@ -175,7 +176,7 @@
if ( --left <= 0 )
{
- cur[0] = (FT_Byte) c;
+ cur[0] = (FT_Byte)c;
left = writer->width;
mask = 0x80;
@@ -188,7 +189,7 @@
cur[0] = (FT_Byte)c;
mask = 0x80;
c = 0;
- cur ++;
+ cur++;
}
reload = ( --count <= 0 );
@@ -204,8 +205,9 @@
FT_Byte* p,
FT_Byte* limit )
{
- FT_Int n, phase, count, reload;
- FT_Int left = writer->width;
+ FT_Int phase, count;
+ FT_UInt n, reload;
+ FT_UInt left = writer->width;
FT_Byte* cur = writer->line;
FT_UInt mask = 0x80;
FT_UInt c = 0;
@@ -239,7 +241,7 @@
if ( --left <= 0 )
{
- cur[0] = (FT_Byte) c;
+ cur[0] = (FT_Byte)c;
c = 0;
mask = 0x80;
left = writer->width;
@@ -252,7 +254,7 @@
cur[0] = (FT_Byte)c;
c = 0;
mask = 0x80;
- cur ++;
+ cur++;
}
reload = ( --count <= 0 );
@@ -355,7 +357,8 @@
{
FT_Error error = FT_Err_Ok;
FT_Byte flags;
- FT_Char b;
+ FT_Char c;
+ FT_Byte b;
FT_Byte* p = *pdata;
FT_Long xpos, ypos, advance;
FT_UInt xsize, ysize;
@@ -374,9 +377,9 @@
{
case 0:
PFR_CHECK( 1 );
- b = PFR_NEXT_INT8( p );
- xpos = b >> 4;
- ypos = ( (FT_Char)( b << 4 ) ) >> 4;
+ c = PFR_NEXT_INT8( p );
+ xpos = c >> 4;
+ ypos = ( (FT_Char)( c << 4 ) ) >> 4;
break;
case 1:
@@ -609,8 +612,8 @@
advance = character->advance;
if ( phys->metrics_resolution != phys->outline_resolution )
advance = FT_MulDiv( advance,
- phys->outline_resolution,
- phys->metrics_resolution );
+ (FT_Long)phys->outline_resolution,
+ (FT_Long)phys->metrics_resolution );
glyph->root.linearHoriAdvance = advance;
@@ -618,7 +621,7 @@
/* overridden in the bitmap header of certain glyphs. */
advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8,
character->advance,
- phys->metrics_resolution );
+ (FT_Long)phys->metrics_resolution );
if ( FT_STREAM_SEEK( face->header.gps_section_offset + gps_offset ) ||
FT_FRAME_ENTER( gps_size ) )
@@ -632,12 +635,14 @@
&advance, &format );
/*
- * XXX: on 16bit system, we return an error for huge bitmap
- * which causes a size truncation, because truncated
- * size properties makes bitmap glyph broken.
+ * XXX: on 16bit systems we return an error for huge bitmaps
+ * that cause size truncation, because truncated
+ * size properties make bitmap glyphs broken.
*/
- if ( xpos > FT_INT_MAX || xpos < FT_INT_MIN ||
- ysize > FT_INT_MAX || ypos + ysize > FT_INT_MAX ||
+ if ( xpos > FT_INT_MAX ||
+ xpos < FT_INT_MIN ||
+ ysize > FT_INT_MAX ||
+ ypos > FT_INT_MAX - (FT_Long)ysize ||
ypos + (FT_Long)ysize < FT_INT_MIN )
{
FT_TRACE1(( "pfr_slot_load_bitmap:" ));
@@ -653,8 +658,8 @@
/* Set up glyph bitmap and metrics */
/* XXX: needs casts to fit FT_Bitmap.{width|rows|pitch} */
- glyph->root.bitmap.width = (FT_Int)xsize;
- glyph->root.bitmap.rows = (FT_Int)ysize;
+ glyph->root.bitmap.width = xsize;
+ glyph->root.bitmap.rows = ysize;
glyph->root.bitmap.pitch = (FT_Int)( xsize + 7 ) >> 3;
glyph->root.bitmap.pixel_mode = FT_PIXEL_MODE_MONO;
@@ -670,11 +675,11 @@
/* XXX: needs casts fit FT_GlyphSlotRec.bitmap_{left|top} */
glyph->root.bitmap_left = (FT_Int)xpos;
- glyph->root.bitmap_top = (FT_Int)(ypos + ysize);
+ glyph->root.bitmap_top = (FT_Int)( ypos + (FT_Long)ysize );
/* Allocate and read bitmap data */
{
- FT_ULong len = glyph->root.bitmap.pitch * ysize;
+ FT_ULong len = (FT_ULong)glyph->root.bitmap.pitch * ysize;
error = ft_glyphslot_alloc_bitmap( &glyph->root, len );
diff --git a/src/3rdparty/freetype/src/pfr/pfrsbit.h b/src/3rdparty/freetype/src/pfr/pfrsbit.h
index 015e9e6dad..0db2cd5ebd 100644
--- a/src/3rdparty/freetype/src/pfr/pfrsbit.h
+++ b/src/3rdparty/freetype/src/pfr/pfrsbit.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (specification). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pfr/pfrtypes.h b/src/3rdparty/freetype/src/pfr/pfrtypes.h
index 918310814c..5ffb1b14ee 100644
--- a/src/3rdparty/freetype/src/pfr/pfrtypes.h
+++ b/src/3rdparty/freetype/src/pfr/pfrtypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR data structures (specification only). */
/* */
-/* Copyright 2002, 2003, 2005, 2007 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -229,7 +229,7 @@ FT_BEGIN_HEADER
FT_UInt metrics_resolution;
FT_BBox bbox;
FT_UInt flags;
- FT_UInt standard_advance;
+ FT_Int standard_advance;
FT_Int ascent; /* optional, bbox.yMax if not present */
FT_Int descent; /* optional, bbox.yMin if not present */
@@ -260,7 +260,7 @@ FT_BEGIN_HEADER
PFR_KernItem* kern_items_tail;
/* not part of the spec, but used during load */
- FT_Long bct_offset;
+ FT_ULong bct_offset;
FT_Byte* cursor;
} PFR_PhyFontRec, *PFR_PhyFont;
diff --git a/src/3rdparty/freetype/src/pfr/rules.mk b/src/3rdparty/freetype/src/pfr/rules.mk
index 60b96c7415..e665460103 100644
--- a/src/3rdparty/freetype/src/pfr/rules.mk
+++ b/src/3rdparty/freetype/src/pfr/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002, 2003 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ PFR_DIR := $(SRC_DIR)/pfr
# compilation flags for the driver
#
-PFR_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PFR_DIR))
+PFR_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PFR_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# pfr driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/psaux/Jamfile b/src/3rdparty/freetype/src/psaux/Jamfile
index faeded9044..6793f0d581 100644
--- a/src/3rdparty/freetype/src/psaux/Jamfile
+++ b/src/3rdparty/freetype/src/psaux/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/psaux Jamfile
#
-# Copyright 2001, 2002 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,8 +16,12 @@ SubDir FT2_TOP $(FT2_SRC_DIR) psaux ;
if $(FT2_MULTI)
{
- _sources = psauxmod psobjs t1decode t1cmap
- psconv afmparse
+ _sources = afmparse
+ psauxmod
+ psconv
+ psobjs
+ t1cmap
+ t1decode
;
}
else
diff --git a/src/3rdparty/freetype/src/psaux/afmparse.c b/src/3rdparty/freetype/src/psaux/afmparse.c
index 6a40e110dc..3ad44ec724 100644
--- a/src/3rdparty/freetype/src/psaux/afmparse.c
+++ b/src/3rdparty/freetype/src/psaux/afmparse.c
@@ -4,7 +4,7 @@
/* */
/* AFM parser (body). */
/* */
-/* Copyright 2006-2010, 2012, 2013 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -75,8 +75,8 @@
#define AFM_STREAM_KEY_BEGIN( stream ) \
(char*)( (stream)->cursor - 1 )
-#define AFM_STREAM_KEY_LEN( stream, key ) \
- ( (char*)(stream)->cursor - key - 1 )
+#define AFM_STREAM_KEY_LEN( stream, key ) \
+ (FT_Offset)( (char*)(stream)->cursor - key - 1 )
#define AFM_STATUS_EOC( stream ) \
( (stream)->status >= AFM_STREAM_STATUS_EOC )
@@ -369,11 +369,11 @@
FT_LOCAL_DEF( FT_Int )
afm_parser_read_vals( AFM_Parser parser,
AFM_Value vals,
- FT_UInt n )
+ FT_Int n )
{
AFM_Stream stream = parser->stream;
char* str;
- FT_UInt i;
+ FT_Int i;
if ( n > AFM_MAX_ARGUMENTS )
@@ -446,7 +446,7 @@
FT_Offset* len )
{
AFM_Stream stream = parser->stream;
- char* key = 0; /* make stupid compiler happy */
+ char* key = NULL; /* make stupid compiler happy */
if ( line )
@@ -562,7 +562,7 @@
}
- FT_LOCAL_DEF( FT_Error )
+ static FT_Error
afm_parser_read_int( AFM_Parser parser,
FT_Int* aint )
{
@@ -590,11 +590,17 @@
char* key;
FT_Offset len;
int n = -1;
+ FT_Int tmp;
- if ( afm_parser_read_int( parser, &fi->NumTrackKern ) )
+ if ( afm_parser_read_int( parser, &tmp ) )
goto Fail;
+ if ( tmp < 0 )
+ goto Fail;
+
+ fi->NumTrackKern = (FT_UInt)tmp;
+
if ( fi->NumTrackKern )
{
FT_Memory memory = parser->memory;
@@ -615,7 +621,7 @@
case AFM_TOKEN_TRACKKERN:
n++;
- if ( n >= fi->NumTrackKern )
+ if ( n >= (int)fi->NumTrackKern )
goto Fail;
tk = fi->TrackKerns + n;
@@ -639,7 +645,7 @@
case AFM_TOKEN_ENDTRACKKERN:
case AFM_TOKEN_ENDKERNDATA:
case AFM_TOKEN_ENDFONTMETRICS:
- fi->NumTrackKern = n + 1;
+ fi->NumTrackKern = (FT_UInt)( n + 1 );
return FT_Err_Ok;
case AFM_TOKEN_UNKNOWN:
@@ -688,11 +694,17 @@
char* key;
FT_Offset len;
int n = -1;
+ FT_Int tmp;
+
+ if ( afm_parser_read_int( parser, &tmp ) )
+ goto Fail;
- if ( afm_parser_read_int( parser, &fi->NumKernPair ) )
+ if ( tmp < 0 )
goto Fail;
+ fi->NumKernPair = (FT_UInt)tmp;
+
if ( fi->NumKernPair )
{
FT_Memory memory = parser->memory;
@@ -720,7 +732,7 @@
n++;
- if ( n >= fi->NumKernPair )
+ if ( n >= (int)fi->NumKernPair )
goto Fail;
kp = fi->KernPairs + n;
@@ -733,8 +745,9 @@
if ( r < 3 )
goto Fail;
- kp->index1 = shared_vals[0].u.i;
- kp->index2 = shared_vals[1].u.i;
+ /* index values can't be negative */
+ kp->index1 = shared_vals[0].u.u;
+ kp->index2 = shared_vals[1].u.u;
if ( token == AFM_TOKEN_KPY )
{
kp->x = 0;
@@ -752,7 +765,7 @@
case AFM_TOKEN_ENDKERNPAIRS:
case AFM_TOKEN_ENDKERNDATA:
case AFM_TOKEN_ENDFONTMETRICS:
- fi->NumKernPair = n + 1;
+ fi->NumKernPair = (FT_UInt)( n + 1 );
ft_qsort( fi->KernPairs, fi->NumKernPair,
sizeof ( AFM_KernPairRec ),
afm_compare_kern_pairs );
@@ -815,7 +828,7 @@
static FT_Error
afm_parser_skip_section( AFM_Parser parser,
- FT_UInt n,
+ FT_Int n,
AFM_Token end_section )
{
char* key;
diff --git a/src/3rdparty/freetype/src/psaux/afmparse.h b/src/3rdparty/freetype/src/psaux/afmparse.h
index 35d96046c5..f922c4ebde 100644
--- a/src/3rdparty/freetype/src/psaux/afmparse.h
+++ b/src/3rdparty/freetype/src/psaux/afmparse.h
@@ -4,7 +4,7 @@
/* */
/* AFM parser (specification). */
/* */
-/* Copyright 2006 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,6 +61,7 @@ FT_BEGIN_HEADER
char* s;
FT_Fixed f;
FT_Int i;
+ FT_UInt u;
FT_Bool b;
} u;
@@ -72,7 +73,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Int )
afm_parser_read_vals( AFM_Parser parser,
AFM_Value vals,
- FT_UInt n );
+ FT_Int n );
/* read the next key from the next line or column */
FT_LOCAL( char* )
diff --git a/src/3rdparty/freetype/src/psaux/module.mk b/src/3rdparty/freetype/src/psaux/module.mk
index 42bf6f5199..1d90e14ce4 100644
--- a/src/3rdparty/freetype/src/psaux/module.mk
+++ b/src/3rdparty/freetype/src/psaux/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/psaux/psaux.c b/src/3rdparty/freetype/src/psaux/psaux.c
index a4b9c5c6e4..7f1d9aa595 100644
--- a/src/3rdparty/freetype/src/psaux/psaux.c
+++ b/src/3rdparty/freetype/src/psaux/psaux.c
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript driver component (body only). */
/* */
-/* Copyright 1996-2001, 2002, 2006 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psaux/psauxerr.h b/src/3rdparty/freetype/src/psaux/psauxerr.h
index d52375f8cb..97712f0795 100644
--- a/src/3rdparty/freetype/src/psaux/psauxerr.h
+++ b/src/3rdparty/freetype/src/psaux/psauxerr.h
@@ -4,7 +4,7 @@
/* */
/* PS auxiliary module error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psaux/psauxmod.c b/src/3rdparty/freetype/src/psaux/psauxmod.c
index 4b1249d49b..06fcab0c4a 100644
--- a/src/3rdparty/freetype/src/psaux/psauxmod.c
+++ b/src/3rdparty/freetype/src/psaux/psauxmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript module implementation (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2006 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psaux/psauxmod.h b/src/3rdparty/freetype/src/psaux/psauxmod.h
index 1217236924..ae6a8f9383 100644
--- a/src/3rdparty/freetype/src/psaux/psauxmod.h
+++ b/src/3rdparty/freetype/src/psaux/psauxmod.h
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript module implementation (specification). */
/* */
-/* Copyright 2000-2001 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psaux/psconv.c b/src/3rdparty/freetype/src/psaux/psconv.c
index 22e8cf2d14..aca741204f 100644
--- a/src/3rdparty/freetype/src/psaux/psconv.c
+++ b/src/3rdparty/freetype/src/psaux/psconv.c
@@ -4,7 +4,7 @@
/* */
/* Some convenience conversions (body). */
/* */
-/* Copyright 2006, 2008, 2009, 2012-2013 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -489,8 +489,8 @@
if ( c OP 0x80 )
break;
- c = ft_char_table[c & 0x7F];
- if ( (unsigned)c >= 16 )
+ c = (FT_UInt)ft_char_table[c & 0x7F];
+ if ( c >= 16 )
break;
pad = ( pad << 4 ) | c;
diff --git a/src/3rdparty/freetype/src/psaux/psconv.h b/src/3rdparty/freetype/src/psaux/psconv.h
index d91c762210..10f1ff7fb1 100644
--- a/src/3rdparty/freetype/src/psaux/psconv.h
+++ b/src/3rdparty/freetype/src/psaux/psconv.h
@@ -4,7 +4,7 @@
/* */
/* Some convenience conversions (specification). */
/* */
-/* Copyright 2006, 2012 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psaux/psobjs.c b/src/3rdparty/freetype/src/psaux/psobjs.c
index 7ec3b4cf5f..1d3c7e662c 100644
--- a/src/3rdparty/freetype/src/psaux/psobjs.c
+++ b/src/3rdparty/freetype/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -81,7 +81,7 @@
table->max_elems = count;
table->init = 0xDEADBEEFUL;
table->num_elems = 0;
- table->block = 0;
+ table->block = NULL;
table->capacity = 0;
table->cursor = 0;
@@ -165,10 +165,10 @@
/* reallocation fails. */
/* */
FT_LOCAL_DEF( FT_Error )
- ps_table_add( PS_Table table,
- FT_Int idx,
- void* object,
- FT_PtrDist length )
+ ps_table_add( PS_Table table,
+ FT_Int idx,
+ void* object,
+ FT_UInt length )
{
if ( idx < 0 || idx >= table->max_elems )
{
@@ -176,12 +176,6 @@
return FT_THROW( Invalid_Argument );
}
- if ( length < 0 )
- {
- FT_ERROR(( "ps_table_add: invalid length\n" ));
- return FT_THROW( Invalid_Argument );
- }
-
/* grow the base block if needed */
if ( table->cursor + length > table->capacity )
{
@@ -600,6 +594,9 @@
error = FT_THROW( Invalid_File_Format );
}
+ if ( cur > limit )
+ cur = limit;
+
parser->error = error;
parser->cursor = cur;
}
@@ -625,8 +622,8 @@
token->type = T1_TOKEN_TYPE_NONE;
- token->start = 0;
- token->limit = 0;
+ token->start = NULL;
+ token->limit = NULL;
/* first of all, skip leading whitespace */
ps_parser_skip_spaces( parser );
@@ -707,7 +704,7 @@
if ( !token->limit )
{
- token->start = 0;
+ token->start = NULL;
token->type = T1_TOKEN_TYPE_NONE;
}
@@ -932,7 +929,7 @@
FT_Memory memory )
{
FT_Byte* cur = *cursor;
- FT_PtrDist len = 0;
+ FT_UInt len = 0;
FT_Int count;
FT_String* result;
FT_Error error;
@@ -972,7 +969,7 @@
}
}
- len = cur - *cursor;
+ len = (FT_UInt)( cur - *cursor );
if ( cur >= limit || FT_ALLOC( result, len + 1 ) )
return 0;
@@ -1230,20 +1227,22 @@
for ( i = 0; i < 4; i++ )
{
- result = ps_tofixedarray( &cur, limit, max_objects,
+ result = ps_tofixedarray( &cur, limit, (FT_Int)max_objects,
temp + i * max_objects, 0 );
if ( result < 0 || (FT_UInt)result < max_objects )
{
FT_ERROR(( "ps_parser_load_field:"
- " expected %d integers in the %s subarray\n"
+ " expected %d integer%s in the %s subarray\n"
" "
" of /FontBBox in the /Blend dictionary\n",
- max_objects,
+ max_objects, max_objects > 1 ? "s" : "",
i == 0 ? "first"
: ( i == 1 ? "second"
: ( i == 2 ? "third"
: "fourth" ) ) ));
error = FT_THROW( Invalid_File_Format );
+
+ FT_FREE( temp );
goto Exit;
}
@@ -1321,7 +1320,7 @@
goto Exit;
}
if ( (FT_UInt)num_elements > field->array_max )
- num_elements = field->array_max;
+ num_elements = (FT_Int)field->array_max;
old_cursor = parser->cursor;
old_limit = parser->limit;
@@ -1379,7 +1378,7 @@
ps_parser_to_bytes( PS_Parser parser,
FT_Byte* bytes,
FT_Offset max_bytes,
- FT_Long* pnum_bytes,
+ FT_ULong* pnum_bytes,
FT_Bool delimiters )
{
FT_Error error = FT_Err_Ok;
@@ -1553,7 +1552,7 @@
FT_GlyphLoader_Rewind( loader );
builder->hints_globals = size->internal;
- builder->hints_funcs = 0;
+ builder->hints_funcs = NULL;
if ( hinting )
builder->hints_funcs = glyph->internal->glyph_hints;
diff --git a/src/3rdparty/freetype/src/psaux/psobjs.h b/src/3rdparty/freetype/src/psaux/psobjs.h
index e380c60dab..bf879c1faf 100644
--- a/src/3rdparty/freetype/src/psaux/psobjs.h
+++ b/src/3rdparty/freetype/src/psaux/psobjs.h
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -52,10 +52,10 @@ FT_BEGIN_HEADER
FT_Memory memory );
FT_LOCAL( FT_Error )
- ps_table_add( PS_Table table,
- FT_Int idx,
- void* object,
- FT_PtrDist length );
+ ps_table_add( PS_Table table,
+ FT_Int idx,
+ void* object,
+ FT_UInt length );
FT_LOCAL( void )
ps_table_done( PS_Table table );
@@ -112,7 +112,7 @@ FT_BEGIN_HEADER
ps_parser_to_bytes( PS_Parser parser,
FT_Byte* bytes,
FT_Offset max_bytes,
- FT_Long* pnum_bytes,
+ FT_ULong* pnum_bytes,
FT_Bool delimiters );
diff --git a/src/3rdparty/freetype/src/psaux/rules.mk b/src/3rdparty/freetype/src/psaux/rules.mk
index 7a1be37b69..0d2118c014 100644
--- a/src/3rdparty/freetype/src/psaux/rules.mk
+++ b/src/3rdparty/freetype/src/psaux/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2002, 2003, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ PSAUX_DIR := $(SRC_DIR)/psaux
# compilation flags for the driver
#
-PSAUX_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR))
+PSAUX_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# PSAUX driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/psaux/t1cmap.c b/src/3rdparty/freetype/src/psaux/t1cmap.c
index fb1353ae0f..2e2d433fc4 100644
--- a/src/3rdparty/freetype/src/psaux/t1cmap.c
+++ b/src/3rdparty/freetype/src/psaux/t1cmap.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 character map support (body). */
/* */
-/* Copyright 2002, 2003, 2006, 2007, 2012 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -39,7 +39,7 @@
FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames;
- cmap->num_glyphs = face->type1.num_glyphs;
+ cmap->num_glyphs = (FT_UInt)face->type1.num_glyphs;
cmap->glyph_names = (const char* const*)face->type1.glyph_names;
cmap->sid_to_string = psnames->adobe_std_strings;
cmap->code_to_sid = is_expert ? psnames->adobe_expert_encoding
@@ -189,8 +189,8 @@
FT_UNUSED( pointer );
- cmap->first = encoding->code_first;
- cmap->count = (FT_UInt)( encoding->code_last - cmap->first );
+ cmap->first = (FT_UInt)encoding->code_first;
+ cmap->count = (FT_UInt)encoding->code_last - cmap->first;
cmap->indices = encoding->char_index;
FT_ASSERT( cmap->indices != NULL );
@@ -295,7 +295,7 @@
return psnames->unicodes_init( memory,
unicodes,
- face->type1.num_glyphs,
+ (FT_UInt)face->type1.num_glyphs,
(PS_GetGlyphNameFunc)&psaux_get_glyph_name,
(PS_FreeGlyphNameFunc)NULL,
(FT_Pointer)face );
diff --git a/src/3rdparty/freetype/src/psaux/t1cmap.h b/src/3rdparty/freetype/src/psaux/t1cmap.h
index 7ae65d2fa1..b8ba06cc3b 100644
--- a/src/3rdparty/freetype/src/psaux/t1cmap.h
+++ b/src/3rdparty/freetype/src/psaux/t1cmap.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 character map support (specification). */
/* */
-/* Copyright 2002, 2003, 2006 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psaux/t1decode.c b/src/3rdparty/freetype/src/psaux/t1decode.c
index d67a05ebca..2e199286f6 100644
--- a/src/3rdparty/freetype/src/psaux/t1decode.c
+++ b/src/3rdparty/freetype/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (body). */
/* */
-/* Copyright 2000-2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -150,7 +150,7 @@
if ( name &&
name[0] == glyph_name[0] &&
ft_strcmp( name, glyph_name ) == 0 )
- return n;
+ return (FT_Int)n;
}
return -1;
@@ -298,7 +298,7 @@
/* the seac operator must not be nested */
decoder->seac = TRUE;
- error = t1_decoder_parse_glyph( decoder, bchar_index );
+ error = t1_decoder_parse_glyph( decoder, (FT_UInt)bchar_index );
decoder->seac = FALSE;
if ( error )
goto Exit;
@@ -320,7 +320,7 @@
/* the seac operator must not be nested */
decoder->seac = TRUE;
- error = t1_decoder_parse_glyph( decoder, achar_index );
+ error = t1_decoder_parse_glyph( decoder, (FT_UInt)achar_index );
decoder->seac = FALSE;
if ( error )
goto Exit;
@@ -381,10 +381,10 @@
/* compute random seed from stack address of parameter */
- seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed ^
- (FT_PtrDist)(char*)&decoder ^
- (FT_PtrDist)(char*)&charstring_base ) &
- FT_ULONG_MAX ) ;
+ seed = (FT_Fixed)( ( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&decoder ^
+ (FT_Offset)(char*)&charstring_base ) &
+ FT_ULONG_MAX );
seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
if ( seed == 0 )
seed = 0x7384;
@@ -796,7 +796,8 @@
known_othersubr_result_cnt = 1;
if ( hinter )
- hinter->reset( hinter->hints, builder->current->n_points );
+ hinter->reset( hinter->hints,
+ (FT_UInt)builder->current->n_points );
break;
case 12:
@@ -861,7 +862,7 @@
*values++ = tmp;
}
- known_othersubr_result_cnt = num_points;
+ known_othersubr_result_cnt = (FT_Int)num_points;
break;
}
@@ -879,8 +880,8 @@
idx = Fix2Int( top[0] );
- if ( idx < 0 ||
- idx + blend->num_designs > decoder->len_buildchar )
+ if ( idx < 0 ||
+ (FT_UInt)idx + blend->num_designs > decoder->len_buildchar )
goto Unexpected_OtherSubr;
ft_memcpy( &decoder->buildchar[idx],
@@ -1094,7 +1095,8 @@
/* close hints recording session */
if ( hinter )
{
- if ( hinter->close( hinter->hints, builder->current->n_points ) )
+ if ( hinter->close( hinter->hints,
+ (FT_UInt)builder->current->n_points ) )
goto Syntax_Error;
/* apply hints to the loaded glyph outline now */
@@ -1346,7 +1348,7 @@
FT_TRACE4(( " callsubr" ));
idx = Fix2Int( top[0] );
- if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
+ if ( idx < 0 || idx >= decoder->num_subrs )
{
FT_ERROR(( "t1_decoder_parse_charstrings:"
" invalid subrs index\n" ));
@@ -1579,7 +1581,7 @@
/* retrieve PSNames interface from list of current modules */
{
- FT_Service_PsCMaps psnames = 0;
+ FT_Service_PsCMaps psnames;
FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
diff --git a/src/3rdparty/freetype/src/psaux/t1decode.h b/src/3rdparty/freetype/src/psaux/t1decode.h
index 00728db501..e83078f719 100644
--- a/src/3rdparty/freetype/src/psaux/t1decode.h
+++ b/src/3rdparty/freetype/src/psaux/t1decode.h
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (specification). */
/* */
-/* Copyright 2000-2001, 2002, 2003 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/Jamfile b/src/3rdparty/freetype/src/pshinter/Jamfile
index 779f1b0b82..6fb3be11c7 100644
--- a/src/3rdparty/freetype/src/pshinter/Jamfile
+++ b/src/3rdparty/freetype/src/pshinter/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/pshinter Jamfile
#
-# Copyright 2001, 2003 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,12 @@ SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ;
if $(FT2_MULTI)
{
- _sources = pshrec pshglob pshalgo pshmod pshpic ;
+ _sources = pshalgo
+ pshglob
+ pshmod
+ pshpic
+ pshrec
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/pshinter/module.mk b/src/3rdparty/freetype/src/pshinter/module.mk
index ed24eb7fa8..1fd8e55a33 100644
--- a/src/3rdparty/freetype/src/pshinter/module.mk
+++ b/src/3rdparty/freetype/src/pshinter/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2001, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/pshinter/pshalgo.c b/src/3rdparty/freetype/src/pshinter/pshalgo.c
index 644c76d101..6e654cb1ef 100644
--- a/src/3rdparty/freetype/src/pshinter/pshalgo.c
+++ b/src/3rdparty/freetype/src/pshinter/pshalgo.c
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (body). */
/* */
-/* Copyright 2001-2010, 2012-2014 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -30,16 +30,14 @@
#ifdef DEBUG_HINTER
- PSH_Hint_Table ps_debug_hint_table = 0;
- PSH_HintFunc ps_debug_hint_func = 0;
- PSH_Glyph ps_debug_glyph = 0;
+ PSH_Hint_Table ps_debug_hint_table = NULL;
+ PSH_HintFunc ps_debug_hint_func = NULL;
+ PSH_Glyph ps_debug_glyph = NULL;
#endif
#define COMPUTE_INFLEXS /* compute inflection points to optimize `S' */
/* and similar glyphs */
-#define STRONGER /* slightly increase the contrast of smooth */
- /* hinting */
/*************************************************************************/
@@ -67,13 +65,13 @@
{
FT_FREE( table->zones );
table->num_zones = 0;
- table->zone = 0;
+ table->zone = NULL;
FT_FREE( table->sort );
FT_FREE( table->hints );
table->num_hints = 0;
table->max_hints = 0;
- table->sort_global = 0;
+ table->sort_global = NULL;
}
@@ -121,7 +119,7 @@
PSH_Hint hint2;
- hint->parent = 0;
+ hint->parent = NULL;
for ( ; count > 0; count--, sorted++ )
{
hint2 = sorted[0];
@@ -194,7 +192,7 @@
table->sort_global = table->sort + count;
table->num_hints = 0;
table->num_zones = 0;
- table->zone = 0;
+ table->zone = NULL;
/* initialize the `table->hints' array */
{
@@ -890,9 +888,6 @@
/*************************************************************************/
/*************************************************************************/
-#define PSH_ZONE_MIN -3200000L
-#define PSH_ZONE_MAX +3200000L
-
#define xxDEBUG_ZONES
@@ -910,10 +905,6 @@
zone->max );
}
-#else
-
-#define psh_print_zone( x ) do { } while ( 0 )
-
#endif /* DEBUG_ZONES */
@@ -925,103 +916,9 @@
/*************************************************************************/
/*************************************************************************/
-#if 1
-
#define psh_corner_is_flat ft_corner_is_flat
#define psh_corner_orientation ft_corner_orientation
-#else
-
- FT_LOCAL_DEF( FT_Int )
- psh_corner_is_flat( FT_Pos x_in,
- FT_Pos y_in,
- FT_Pos x_out,
- FT_Pos y_out )
- {
- FT_Pos ax = x_in;
- FT_Pos ay = y_in;
-
- FT_Pos d_in, d_out, d_corner;
-
-
- if ( ax < 0 )
- ax = -ax;
- if ( ay < 0 )
- ay = -ay;
- d_in = ax + ay;
-
- ax = x_out;
- if ( ax < 0 )
- ax = -ax;
- ay = y_out;
- if ( ay < 0 )
- ay = -ay;
- d_out = ax + ay;
-
- ax = x_out + x_in;
- if ( ax < 0 )
- ax = -ax;
- ay = y_out + y_in;
- if ( ay < 0 )
- ay = -ay;
- d_corner = ax + ay;
-
- return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
- }
-
- static FT_Int
- psh_corner_orientation( FT_Pos in_x,
- FT_Pos in_y,
- FT_Pos out_x,
- FT_Pos out_y )
- {
- FT_Int result;
-
-
- /* deal with the trivial cases quickly */
- if ( in_y == 0 )
- {
- if ( in_x >= 0 )
- result = out_y;
- else
- result = -out_y;
- }
- else if ( in_x == 0 )
- {
- if ( in_y >= 0 )
- result = -out_x;
- else
- result = out_x;
- }
- else if ( out_y == 0 )
- {
- if ( out_x >= 0 )
- result = in_y;
- else
- result = -in_y;
- }
- else if ( out_x == 0 )
- {
- if ( out_y >= 0 )
- result = -in_x;
- else
- result = in_x;
- }
- else /* general case */
- {
- long long delta = (long long)in_x * out_y - (long long)in_y * out_x;
-
- if ( delta == 0 )
- result = 0;
- else
- result = 1 - 2 * ( delta < 0 );
- }
-
- return result;
- }
-
-#endif /* !1 */
-
#ifdef COMPUTE_INFLEXS
@@ -1149,7 +1046,7 @@
glyph->num_points = 0;
glyph->num_contours = 0;
- glyph->memory = 0;
+ glyph->memory = NULL;
}
@@ -1274,8 +1171,8 @@
FT_NEW_ARRAY( glyph->contours, outline->n_contours ) )
goto Exit;
- glyph->num_points = outline->n_points;
- glyph->num_contours = outline->n_contours;
+ glyph->num_points = (FT_UInt)outline->n_points;
+ glyph->num_contours = (FT_UInt)outline->n_contours;
{
FT_UInt first = 0, next, n;
@@ -1285,15 +1182,15 @@
for ( n = 0; n < glyph->num_contours; n++ )
{
- FT_Int count;
+ FT_UInt count;
PSH_Point point;
- next = outline->contours[n] + 1;
+ next = (FT_UInt)outline->contours[n] + 1;
count = next - first;
contour->start = points + first;
- contour->count = (FT_UInt)count;
+ contour->count = count;
if ( count > 0 )
{
@@ -1696,16 +1593,12 @@
mask++;
for ( ; num_masks > 1; num_masks--, mask++ )
{
- FT_UInt next;
- FT_Int count;
+ FT_UInt next = FT_MIN( mask->end_point, glyph->num_points );
- next = mask->end_point > glyph->num_points
- ? glyph->num_points
- : mask->end_point;
- count = next - first;
- if ( count > 0 )
+ if ( next > first )
{
+ FT_UInt count = next - first;
PSH_Point point = glyph->points + first;
@@ -2048,7 +1941,7 @@
/* count the number of strong points in this contour */
next = start + contour->count;
fit_count = 0;
- first = 0;
+ first = NULL;
for ( point = start; point < next; point++ )
if ( psh_point_is_fitted( point ) )
diff --git a/src/3rdparty/freetype/src/pshinter/pshalgo.h b/src/3rdparty/freetype/src/pshinter/pshalgo.h
index c70f31ea94..8373e5ec29 100644
--- a/src/3rdparty/freetype/src/pshinter/pshalgo.h
+++ b/src/3rdparty/freetype/src/pshinter/pshalgo.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (specification). */
/* */
-/* Copyright 2001-2003, 2008, 2013 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,15 +30,12 @@ FT_BEGIN_HEADER
/* handle to Hint structure */
typedef struct PSH_HintRec_* PSH_Hint;
- /* hint bit-flags */
- typedef enum PSH_Hint_Flags_
- {
- PSH_HINT_GHOST = PS_HINT_FLAG_GHOST,
- PSH_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM,
- PSH_HINT_ACTIVE = 4,
- PSH_HINT_FITTED = 8
- } PSH_Hint_Flags;
+ /* hint bit-flags */
+#define PSH_HINT_GHOST PS_HINT_FLAG_GHOST
+#define PSH_HINT_BOTTOM PS_HINT_FLAG_BOTTOM
+#define PSH_HINT_ACTIVE 4U
+#define PSH_HINT_FITTED 8U
#define psh_hint_is_active( x ) ( ( (x)->flags & PSH_HINT_ACTIVE ) != 0 )
@@ -49,6 +46,7 @@ FT_BEGIN_HEADER
#define psh_hint_deactivate( x ) (x)->flags &= ~PSH_HINT_ACTIVE
#define psh_hint_set_fitted( x ) (x)->flags |= PSH_HINT_FITTED
+
/* hint structure */
typedef struct PSH_HintRec_
{
@@ -112,14 +110,12 @@ FT_BEGIN_HEADER
#define PSH_DIR_IS_VERTICAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_VERTICAL )
- /* the following bit-flags are computed once by the glyph */
- /* analyzer, for both dimensions */
- enum
- {
- PSH_POINT_OFF = 1, /* point is off the curve */
- PSH_POINT_SMOOTH = 2, /* point is smooth */
- PSH_POINT_INFLEX = 4 /* point is inflection */
- };
+ /* the following bit-flags are computed once by the glyph */
+ /* analyzer, for both dimensions */
+#define PSH_POINT_OFF 1U /* point is off the curve */
+#define PSH_POINT_SMOOTH 2U /* point is smooth */
+#define PSH_POINT_INFLEX 4U /* point is inflection */
+
#define psh_point_is_smooth( p ) ( (p)->flags & PSH_POINT_SMOOTH )
#define psh_point_is_off( p ) ( (p)->flags & PSH_POINT_OFF )
@@ -129,17 +125,16 @@ FT_BEGIN_HEADER
#define psh_point_set_off( p ) (p)->flags |= PSH_POINT_OFF
#define psh_point_set_inflex( p ) (p)->flags |= PSH_POINT_INFLEX
+
/* the following bit-flags are re-computed for each dimension */
- enum
- {
- PSH_POINT_STRONG = 16, /* point is strong */
- PSH_POINT_FITTED = 32, /* point is already fitted */
- PSH_POINT_EXTREMUM = 64, /* point is local extremum */
- PSH_POINT_POSITIVE = 128, /* extremum has positive contour flow */
- PSH_POINT_NEGATIVE = 256, /* extremum has negative contour flow */
- PSH_POINT_EDGE_MIN = 512, /* point is aligned to left/bottom stem edge */
- PSH_POINT_EDGE_MAX = 1024 /* point is aligned to top/right stem edge */
- };
+#define PSH_POINT_STRONG 16U /* point is strong */
+#define PSH_POINT_FITTED 32U /* point is already fitted */
+#define PSH_POINT_EXTREMUM 64U /* point is local extremum */
+#define PSH_POINT_POSITIVE 128U /* extremum has positive contour flow */
+#define PSH_POINT_NEGATIVE 256U /* extremum has negative contour flow */
+#define PSH_POINT_EDGE_MIN 512U /* point is aligned to left/bottom stem edge */
+#define PSH_POINT_EDGE_MAX 1024U /* point is aligned to top/right stem edge */
+
#define psh_point_is_strong( p ) ( (p)->flags2 & PSH_POINT_STRONG )
#define psh_point_is_fitted( p ) ( (p)->flags2 & PSH_POINT_FITTED )
diff --git a/src/3rdparty/freetype/src/pshinter/pshglob.c b/src/3rdparty/freetype/src/pshinter/pshglob.c
index 1bcc481b9b..4616bdc6cf 100644
--- a/src/3rdparty/freetype/src/pshinter/pshglob.c
+++ b/src/3rdparty/freetype/src/pshinter/pshglob.c
@@ -5,7 +5,7 @@
/* PostScript hinter global hinting management (body). */
/* Inspired by the new auto-hinter module. */
/* */
-/* Copyright 2001-2004, 2006, 2010, 2012-2014 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -23,7 +23,7 @@
#include "pshglob.h"
#ifdef DEBUG_HINTER
- PSH_Globals ps_debug_globals = 0;
+ PSH_Globals ps_debug_globals = NULL;
#endif
@@ -240,7 +240,7 @@
FT_Int family )
{
PSH_Blue_Table top_table, bot_table;
- FT_Int count_top, count_bot;
+ FT_UInt count_top, count_bot;
if ( family )
@@ -339,7 +339,7 @@
bot = zone[1].org_bottom;
delta = bot - top;
- if ( delta < 2 * fuzz )
+ if ( delta / 2 < fuzz )
zone[0].org_top = zone[1].org_bottom = top + delta / 2;
else
{
@@ -369,7 +369,7 @@
{
FT_UInt count;
FT_UInt num;
- PSH_Blue_Table table = 0;
+ PSH_Blue_Table table = NULL;
/* */
/* Determine whether we need to suppress overshoots or */
@@ -635,7 +635,7 @@
FT_FREE( globals );
#ifdef DEBUG_HINTER
- ps_debug_globals = 0;
+ ps_debug_globals = NULL;
#endif
}
}
diff --git a/src/3rdparty/freetype/src/pshinter/pshglob.h b/src/3rdparty/freetype/src/pshinter/pshglob.h
index 94d972a940..c376df7b9f 100644
--- a/src/3rdparty/freetype/src/pshinter/pshglob.h
+++ b/src/3rdparty/freetype/src/pshinter/pshglob.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinter global hinting management. */
/* */
-/* Copyright 2001, 2002, 2003, 2014 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/pshinter.c b/src/3rdparty/freetype/src/pshinter/pshinter.c
index b35a2a91c5..9e65fe2a42 100644
--- a/src/3rdparty/freetype/src/pshinter/pshinter.c
+++ b/src/3rdparty/freetype/src/pshinter/pshinter.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript Hinting module */
/* */
-/* Copyright 2001, 2003 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/pshmod.c b/src/3rdparty/freetype/src/pshinter/pshmod.c
index cdeaca18c9..961b468506 100644
--- a/src/3rdparty/freetype/src/pshinter/pshmod.c
+++ b/src/3rdparty/freetype/src/pshinter/pshmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript hinter module implementation (body). */
/* */
-/* Copyright 2001, 2002, 2007, 2009, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/pshmod.h b/src/3rdparty/freetype/src/pshinter/pshmod.h
index 0ae7e96f54..a58d856533 100644
--- a/src/3rdparty/freetype/src/pshinter/pshmod.h
+++ b/src/3rdparty/freetype/src/pshinter/pshmod.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinter module interface (specification). */
/* */
-/* Copyright 2001 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/pshnterr.h b/src/3rdparty/freetype/src/pshinter/pshnterr.h
index 7cc180f0ca..ce790a8ef5 100644
--- a/src/3rdparty/freetype/src/pshinter/pshnterr.h
+++ b/src/3rdparty/freetype/src/pshinter/pshnterr.h
@@ -4,7 +4,7 @@
/* */
/* PS Hinter error codes (specification only). */
/* */
-/* Copyright 2003, 2012 by */
+/* Copyright 2003-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/pshpic.c b/src/3rdparty/freetype/src/pshinter/pshpic.c
index 568f4ac4b0..afd8fb9678 100644
--- a/src/3rdparty/freetype/src/pshinter/pshpic.c
+++ b/src/3rdparty/freetype/src/pshinter/pshpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/pshinter/pshpic.h b/src/3rdparty/freetype/src/pshinter/pshpic.h
index b46f853113..ca35cd6fa9 100644
--- a/src/3rdparty/freetype/src/pshinter/pshpic.h
+++ b/src/3rdparty/freetype/src/pshinter/pshpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
-/* Copyright 2009, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,8 +20,6 @@
#define __PSHPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
@@ -33,6 +31,8 @@ FT_BEGIN_HEADER
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+FT_BEGIN_HEADER
+
typedef struct PSHinterPIC_
{
PSHinter_Interface pshinter_interface;
@@ -51,12 +51,12 @@ FT_BEGIN_HEADER
FT_Error
pshinter_module_class_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __PSHPIC_H__ */
diff --git a/src/3rdparty/freetype/src/pshinter/pshrec.c b/src/3rdparty/freetype/src/pshinter/pshrec.c
index 73a18ffd64..f8895fc8d6 100644
--- a/src/3rdparty/freetype/src/pshinter/pshrec.c
+++ b/src/3rdparty/freetype/src/pshinter/pshrec.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript hints recorder (body). */
/* */
-/* Copyright 2001-2004, 2007, 2009, 2013, 2014 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,7 +31,7 @@
#define FT_COMPONENT trace_pshrec
#ifdef DEBUG_HINTER
- PS_Hints ps_debug_hints = 0;
+ PS_Hints ps_debug_hints = NULL;
int ps_debug_no_horz_hints = 0;
int ps_debug_no_vert_hints = 0;
#endif
@@ -85,7 +85,7 @@
{
FT_Error error = FT_Err_Ok;
FT_UInt count;
- PS_Hint hint = 0;
+ PS_Hint hint = NULL;
count = table->num_hints;
@@ -167,12 +167,12 @@
/* clear a given bit */
static void
ps_mask_clear_bit( PS_Mask mask,
- FT_Int idx )
+ FT_UInt idx )
{
FT_Byte* p;
- if ( (FT_UInt)idx >= mask->num_bits )
+ if ( idx >= mask->num_bits )
return;
p = mask->bytes + ( idx >> 3 );
@@ -183,17 +183,14 @@
/* set a given bit, possibly grow the mask */
static FT_Error
ps_mask_set_bit( PS_Mask mask,
- FT_Int idx,
+ FT_UInt idx,
FT_Memory memory )
{
FT_Error error = FT_Err_Ok;
FT_Byte* p;
- if ( idx < 0 )
- goto Exit;
-
- if ( (FT_UInt)idx >= mask->num_bits )
+ if ( idx >= mask->num_bits )
{
error = ps_mask_ensure( mask, idx + 1, memory );
if ( error )
@@ -257,7 +254,7 @@
{
FT_UInt count;
FT_Error error = FT_Err_Ok;
- PS_Mask mask = 0;
+ PS_Mask mask = NULL;
count = table->num_masks;
@@ -372,8 +369,8 @@
/* test whether two masks in a table intersect */
static FT_Int
ps_mask_table_test_intersect( PS_Mask_Table table,
- FT_Int index1,
- FT_Int index2 )
+ FT_UInt index1,
+ FT_UInt index2 )
{
PS_Mask mask1 = table->masks + index1;
PS_Mask mask2 = table->masks + index2;
@@ -404,23 +401,25 @@
/* merge two masks, used by ps_mask_table_merge_all */
static FT_Error
ps_mask_table_merge( PS_Mask_Table table,
- FT_Int index1,
- FT_Int index2,
+ FT_UInt index1,
+ FT_UInt index2,
FT_Memory memory )
{
- FT_UInt temp;
FT_Error error = FT_Err_Ok;
/* swap index1 and index2 so that index1 < index2 */
if ( index1 > index2 )
{
+ FT_UInt temp;
+
+
temp = index1;
index1 = index2;
index2 = temp;
}
- if ( index1 < index2 && index1 >= 0 && index2 < (FT_Int)table->num_masks )
+ if ( index1 < index2 && index2 < table->num_masks )
{
/* we need to merge the bitsets of index1 and index2 with a */
/* simple union */
@@ -453,7 +452,7 @@
/* merge (unite) the bitsets */
read = mask2->bytes;
write = mask1->bytes;
- pos = (FT_UInt)( ( count2 + 7 ) >> 3 );
+ pos = ( count2 + 7 ) >> 3;
for ( ; pos > 0; pos-- )
{
@@ -468,14 +467,17 @@
mask2->num_bits = 0;
mask2->end_point = 0;
- delta = table->num_masks - 1 - index2; /* number of masks to move */
+ /* number of masks to move */
+ delta = (FT_Int)( table->num_masks - 1 - index2 );
if ( delta > 0 )
{
/* move to end of table for reuse */
PS_MaskRec dummy = *mask2;
- ft_memmove( mask2, mask2 + 1, delta * sizeof ( PS_MaskRec ) );
+ ft_memmove( mask2,
+ mask2 + 1,
+ (FT_UInt)delta * sizeof ( PS_MaskRec ) );
mask2[delta] = dummy;
}
@@ -502,13 +504,19 @@
FT_Error error = FT_Err_Ok;
- for ( index1 = table->num_masks - 1; index1 > 0; index1-- )
+ /* both loops go down to 0, thus FT_Int for index1 and index2 */
+ for ( index1 = (FT_Int)table->num_masks - 1; index1 > 0; index1-- )
{
for ( index2 = index1 - 1; index2 >= 0; index2-- )
{
- if ( ps_mask_table_test_intersect( table, index1, index2 ) )
+ if ( ps_mask_table_test_intersect( table,
+ (FT_UInt)index1,
+ (FT_UInt)index2 ) )
{
- error = ps_mask_table_merge( table, index2, index1, memory );
+ error = ps_mask_table_merge( table,
+ (FT_UInt)index2,
+ (FT_UInt)index1,
+ memory );
if ( error )
goto Exit;
@@ -670,8 +678,8 @@
{
PS_Mask mask;
FT_UInt idx;
- FT_UInt max = dim->hints.num_hints;
- PS_Hint hint = dim->hints.hints;
+ FT_UInt max = dim->hints.num_hints;
+ PS_Hint hint = dim->hints.hints;
for ( idx = 0; idx < max; idx++, hint++ )
@@ -742,17 +750,26 @@
}
/* now, set the bits for our hints in the counter mask */
- error = ps_mask_set_bit( counter, hint1, memory );
- if ( error )
- goto Exit;
+ if ( hint1 >= 0 )
+ {
+ error = ps_mask_set_bit( counter, (FT_UInt)hint1, memory );
+ if ( error )
+ goto Exit;
+ }
- error = ps_mask_set_bit( counter, hint2, memory );
- if ( error )
- goto Exit;
+ if ( hint2 >= 0 )
+ {
+ error = ps_mask_set_bit( counter, (FT_UInt)hint2, memory );
+ if ( error )
+ goto Exit;
+ }
- error = ps_mask_set_bit( counter, hint3, memory );
- if ( error )
- goto Exit;
+ if ( hint3 >= 0 )
+ {
+ error = ps_mask_set_bit( counter, (FT_UInt)hint3, memory );
+ if ( error )
+ goto Exit;
+ }
Exit:
return error;
@@ -793,7 +810,7 @@
ps_dimension_done( &hints->dimension[1], memory );
hints->error = FT_Err_Ok;
- hints->memory = 0;
+ hints->memory = NULL;
}
@@ -811,78 +828,57 @@
ps_hints_open( PS_Hints hints,
PS_Hint_Type hint_type )
{
- switch ( hint_type )
- {
- case PS_HINT_TYPE_1:
- case PS_HINT_TYPE_2:
- hints->error = FT_Err_Ok;
- hints->hint_type = hint_type;
+ hints->error = FT_Err_Ok;
+ hints->hint_type = hint_type;
- ps_dimension_init( &hints->dimension[0] );
- ps_dimension_init( &hints->dimension[1] );
- break;
-
- default:
- hints->error = FT_THROW( Invalid_Argument );
- hints->hint_type = hint_type;
-
- FT_TRACE0(( "ps_hints_open: invalid charstring type\n" ));
- break;
- }
+ ps_dimension_init( &hints->dimension[0] );
+ ps_dimension_init( &hints->dimension[1] );
}
/* add one or more stems to the current hints table */
static void
ps_hints_stem( PS_Hints hints,
- FT_Int dimension,
- FT_UInt count,
+ FT_UInt dimension,
+ FT_Int count,
FT_Long* stems )
{
- if ( !hints->error )
- {
- /* limit "dimension" to 0..1 */
- if ( dimension < 0 || dimension > 1 )
- {
- FT_TRACE0(( "ps_hints_stem: invalid dimension (%d) used\n",
- dimension ));
- dimension = ( dimension != 0 );
- }
+ PS_Dimension dim;
- /* record the stems in the current hints/masks table */
- switch ( hints->hint_type )
- {
- case PS_HINT_TYPE_1: /* Type 1 "hstem" or "vstem" operator */
- case PS_HINT_TYPE_2: /* Type 2 "hstem" or "vstem" operator */
- {
- PS_Dimension dim = &hints->dimension[dimension];
+ if ( hints->error )
+ return;
- for ( ; count > 0; count--, stems += 2 )
- {
- FT_Error error;
- FT_Memory memory = hints->memory;
+ /* limit "dimension" to 0..1 */
+ if ( dimension > 1 )
+ {
+ FT_TRACE0(( "ps_hints_stem: invalid dimension (%d) used\n",
+ dimension ));
+ dimension = ( dimension != 0 );
+ }
+ /* record the stems in the current hints/masks table */
+ /* (Type 1 & 2's `hstem' or `vstem' operators) */
+ dim = &hints->dimension[dimension];
- error = ps_dimension_add_t1stem(
- dim, (FT_Int)stems[0], (FT_Int)stems[1],
- memory, NULL );
- if ( error )
- {
- FT_ERROR(( "ps_hints_stem: could not add stem"
- " (%d,%d) to hints table\n", stems[0], stems[1] ));
+ for ( ; count > 0; count--, stems += 2 )
+ {
+ FT_Error error;
+ FT_Memory memory = hints->memory;
- hints->error = error;
- return;
- }
- }
- break;
- }
- default:
- FT_TRACE0(( "ps_hints_stem: called with invalid hint type (%d)\n",
- hints->hint_type ));
- break;
+ error = ps_dimension_add_t1stem( dim,
+ (FT_Int)stems[0],
+ (FT_Int)stems[1],
+ memory,
+ NULL );
+ if ( error )
+ {
+ FT_ERROR(( "ps_hints_stem: could not add stem"
+ " (%d,%d) to hints table\n", stems[0], stems[1] ));
+
+ hints->error = error;
+ return;
}
}
}
@@ -891,7 +887,7 @@
/* add one Type1 counter stem to the current hints table */
static void
ps_hints_t1stem3( PS_Hints hints,
- FT_Int dimension,
+ FT_UInt dimension,
FT_Fixed* stems )
{
FT_Error error = FT_Err_Ok;
@@ -906,7 +902,7 @@
/* limit "dimension" to 0..1 */
- if ( dimension < 0 || dimension > 1 )
+ if ( dimension > 1 )
{
FT_TRACE0(( "ps_hints_t1stem3: invalid dimension (%d) used\n",
dimension ));
@@ -1128,7 +1124,7 @@
static void
t1_hints_stem( T1_Hints hints,
- FT_Int dimension,
+ FT_UInt dimension,
FT_Fixed* coords )
{
FT_Pos stems[2];
@@ -1172,12 +1168,12 @@
static void
t2_hints_stems( T2_Hints hints,
- FT_Int dimension,
+ FT_UInt dimension,
FT_Int count,
FT_Fixed* coords )
{
- FT_Pos stems[32], y, n;
- FT_Int total = count;
+ FT_Pos stems[32], y;
+ FT_Int total = count, n;
y = 0;
diff --git a/src/3rdparty/freetype/src/pshinter/pshrec.h b/src/3rdparty/freetype/src/pshinter/pshrec.h
index a88fe6e834..2b1ad94936 100644
--- a/src/3rdparty/freetype/src/pshinter/pshrec.h
+++ b/src/3rdparty/freetype/src/pshinter/pshrec.h
@@ -4,7 +4,7 @@
/* */
/* Postscript (Type1/Type2) hints recorder (specification). */
/* */
-/* Copyright 2001, 2002, 2003, 2006, 2008, 2014 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,12 +61,8 @@ FT_BEGIN_HEADER
/* hint flags */
- typedef enum PS_Hint_Flags_
- {
- PS_HINT_FLAG_GHOST = 1,
- PS_HINT_FLAG_BOTTOM = 2
-
- } PS_Hint_Flags;
+#define PS_HINT_FLAG_GHOST 1U
+#define PS_HINT_FLAG_BOTTOM 2U
/* hint descriptor */
diff --git a/src/3rdparty/freetype/src/pshinter/rules.mk b/src/3rdparty/freetype/src/pshinter/rules.mk
index 888ece1058..7838e676ec 100644
--- a/src/3rdparty/freetype/src/pshinter/rules.mk
+++ b/src/3rdparty/freetype/src/pshinter/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2001, 2003, 2011 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ PSHINTER_DIR := $(SRC_DIR)/pshinter
# compilation flags for the driver
#
-PSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR))
+PSHINTER_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# PSHINTER driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/psnames/Jamfile b/src/3rdparty/freetype/src/psnames/Jamfile
index 06c0dda66f..6dcc8b8e94 100644
--- a/src/3rdparty/freetype/src/psnames/Jamfile
+++ b/src/3rdparty/freetype/src/psnames/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/psnames Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,9 @@ SubDir FT2_TOP $(FT2_SRC_DIR) psnames ;
if $(FT2_MULTI)
{
- _sources = psmodule pspic ;
+ _sources = psmodule
+ pspic
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/psnames/module.mk b/src/3rdparty/freetype/src/psnames/module.mk
index a6e908257c..3708f60362 100644
--- a/src/3rdparty/freetype/src/psnames/module.mk
+++ b/src/3rdparty/freetype/src/psnames/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/psnames/psmodule.c b/src/3rdparty/freetype/src/psnames/psmodule.c
index 42c9aff27b..0f04c2fa7d 100644
--- a/src/3rdparty/freetype/src/psnames/psmodule.c
+++ b/src/3rdparty/freetype/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
-/* Copyright 1996-2003, 2005-2008, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -312,7 +312,7 @@
/* we first allocate the table */
table->num_maps = 0;
- table->maps = 0;
+ table->maps = NULL;
if ( !FT_NEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )
{
diff --git a/src/3rdparty/freetype/src/psnames/psmodule.h b/src/3rdparty/freetype/src/psnames/psmodule.h
index 28fa14807c..f85f322193 100644
--- a/src/3rdparty/freetype/src/psnames/psmodule.h
+++ b/src/3rdparty/freetype/src/psnames/psmodule.h
@@ -4,7 +4,7 @@
/* */
/* High-level PSNames module interface (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psnames/psnamerr.h b/src/3rdparty/freetype/src/psnames/psnamerr.h
index acda7f967e..09cc247b7d 100644
--- a/src/3rdparty/freetype/src/psnames/psnamerr.h
+++ b/src/3rdparty/freetype/src/psnames/psnamerr.h
@@ -4,7 +4,7 @@
/* */
/* PS names module error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psnames/psnames.c b/src/3rdparty/freetype/src/psnames/psnames.c
index 1ede225dc9..a4385961e5 100644
--- a/src/3rdparty/freetype/src/psnames/psnames.c
+++ b/src/3rdparty/freetype/src/psnames/psnames.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PSNames module component (body only). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psnames/pspic.c b/src/3rdparty/freetype/src/psnames/pspic.c
index 3820f65a74..1394f977e0 100644
--- a/src/3rdparty/freetype/src/psnames/pspic.c
+++ b/src/3rdparty/freetype/src/psnames/pspic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for psnames module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psnames/pspic.h b/src/3rdparty/freetype/src/psnames/pspic.h
index 6ff002c603..443225af61 100644
--- a/src/3rdparty/freetype/src/psnames/pspic.h
+++ b/src/3rdparty/freetype/src/psnames/pspic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for psnames module. */
/* */
-/* Copyright 2009, 2012 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,10 +20,9 @@
#define __PSPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
+
#ifndef FT_CONFIG_OPTION_PIC
#define PSCMAPS_SERVICES_GET pscmaps_services
@@ -33,6 +32,9 @@ FT_BEGIN_HEADER
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+
+FT_BEGIN_HEADER
+
typedef struct PSModulePIC_
{
FT_ServiceDescRec* pscmaps_services;
@@ -54,12 +56,12 @@ FT_BEGIN_HEADER
FT_Error
psnames_module_class_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __PSPIC_H__ */
diff --git a/src/3rdparty/freetype/src/psnames/pstables.h b/src/3rdparty/freetype/src/psnames/pstables.h
index 0a6637f985..3f31c31b18 100644
--- a/src/3rdparty/freetype/src/psnames/pstables.h
+++ b/src/3rdparty/freetype/src/psnames/pstables.h
@@ -4,7 +4,7 @@
/* */
/* PostScript glyph names. */
/* */
-/* Copyright 2005, 2008, 2011 by */
+/* Copyright 2005-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/psnames/rules.mk b/src/3rdparty/freetype/src/psnames/rules.mk
index f321de2d64..3c774867fd 100644
--- a/src/3rdparty/freetype/src/psnames/rules.mk
+++ b/src/3rdparty/freetype/src/psnames/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2001, 2003, 2011, 2013 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ PSNAMES_DIR := $(SRC_DIR)/psnames
# compilation flags for the driver
#
-PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))
+PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# PSNames driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/raster/Jamfile b/src/3rdparty/freetype/src/raster/Jamfile
index 4f60e87c78..71df5689ee 100644
--- a/src/3rdparty/freetype/src/raster/Jamfile
+++ b/src/3rdparty/freetype/src/raster/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/raster Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,10 @@ SubDir FT2_TOP $(FT2_SRC_DIR) raster ;
if $(FT2_MULTI)
{
- _sources = ftraster ftrend1 rastpic ;
+ _sources = ftraster
+ ftrend1
+ rastpic
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/raster/ftmisc.h b/src/3rdparty/freetype/src/raster/ftmisc.h
index 703155a429..b87e0b62b7 100644
--- a/src/3rdparty/freetype/src/raster/ftmisc.h
+++ b/src/3rdparty/freetype/src/raster/ftmisc.h
@@ -5,7 +5,7 @@
/* Miscellaneous macros for stand-alone rasterizer (specification */
/* only). */
/* */
-/* Copyright 2005, 2009, 2010 by */
+/* Copyright 2005-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -37,7 +37,7 @@
#define FT_LOCAL_DEF( x ) static x
- /* from include/freetype2/fttypes.h */
+ /* from include/freetype/fttypes.h */
typedef unsigned char FT_Byte;
typedef signed int FT_Int;
@@ -54,7 +54,7 @@
(FT_ULong)_x4 )
- /* from include/freetype2/ftsystem.h */
+ /* from include/freetype/ftsystem.h */
typedef struct FT_MemoryRec_* FT_Memory;
diff --git a/src/3rdparty/freetype/src/raster/ftraster.c b/src/3rdparty/freetype/src/raster/ftraster.c
index b06ac333da..e4bab98728 100644
--- a/src/3rdparty/freetype/src/raster/ftraster.c
+++ b/src/3rdparty/freetype/src/raster/ftraster.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (body). */
/* */
-/* Copyright 1996-2003, 2005, 2007-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,8 +24,8 @@
/* */
/* - copy `src/raster/ftraster.c' (this file) to your current directory */
/* */
- /* - copy `include/ftimage.h' and `src/raster/ftmisc.h' to your current */
- /* directory */
+ /* - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h' to your */
+ /* current directory */
/* */
/* - compile `ftraster' with the _STANDALONE_ macro defined, as in */
/* */
@@ -49,6 +49,10 @@
#ifdef _STANDALONE_
+ /* The size in bytes of the render pool used by the scan-line converter */
+ /* to do all of its work. */
+#define FT_RENDER_POOL_SIZE 16384L
+
#define FT_CONFIG_STANDARD_LIBRARY_H <stdlib.h>
#include <string.h> /* for memset */
@@ -150,14 +154,6 @@
/* define DEBUG_RASTER if you want to compile a debugging version */
/* #define DEBUG_RASTER */
- /* define FT_RASTER_OPTION_ANTI_ALIASING if you want to support */
- /* 5-levels anti-aliasing */
-/* #define FT_RASTER_OPTION_ANTI_ALIASING */
-
- /* The size of the two-lines intermediate bitmap used */
- /* for anti-aliasing, in bytes. */
-#define RASTER_GRAY_LINES 2048
-
/*************************************************************************/
/*************************************************************************/
@@ -183,6 +179,8 @@
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
+#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
+
/* This macro is used to indicate that a function parameter is unused. */
/* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
@@ -199,6 +197,7 @@
#define FT_TRACE( x ) do { } while ( 0 ) /* nothing */
#define FT_TRACE1( x ) do { } while ( 0 ) /* nothing */
#define FT_TRACE6( x ) do { } while ( 0 ) /* nothing */
+#define FT_TRACE7( x ) do { } while ( 0 ) /* nothing */
#endif
#ifndef FT_THROW
@@ -318,7 +317,7 @@
typedef union Alignment_
{
- long l;
+ Long l;
void* p;
void (*f)(void);
@@ -334,9 +333,9 @@
/* values for the `flags' bit field */
-#define Flow_Up 0x8
-#define Overshoot_Top 0x10
-#define Overshoot_Bottom 0x20
+#define Flow_Up 0x08U
+#define Overshoot_Top 0x10U
+#define Overshoot_Bottom 0x20U
/* States of each line, arc, and profile */
@@ -358,14 +357,14 @@
FT_F26Dot6 X; /* current coordinate during sweep */
PProfile link; /* link to next profile (various purposes) */
PLong offset; /* start of profile's data in render pool */
- unsigned flags; /* Bit 0-2: drop-out mode */
+ UShort flags; /* Bit 0-2: drop-out mode */
/* Bit 3: profile orientation (up/down) */
/* Bit 4: is top profile? */
/* Bit 5: is bottom profile? */
- long height; /* profile's height in scanlines */
- long start; /* profile's starting scanline */
+ Long height; /* profile's height in scanlines */
+ Long start; /* profile's starting scanline */
- unsigned countL; /* number of lines to step before this */
+ Int countL; /* number of lines to step before this */
/* profile becomes drawable */
PProfile next; /* next profile in same contour, used */
@@ -387,7 +386,7 @@
#define AlignProfileSize \
- ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
+ ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( Long ) )
#undef RAS_ARG
@@ -451,7 +450,9 @@
#define CEILING( x ) ( ( (x) + ras.precision - 1 ) & -ras.precision )
#define TRUNC( x ) ( (Long)(x) >> ras.precision_bits )
#define FRAC( x ) ( (x) & ( ras.precision - 1 ) )
-#define SCALED( x ) ( ( (ULong)(x) << ras.scale_shift ) - ras.precision_half )
+#define SCALED( x ) ( ( (x) < 0 ? -( -(x) << ras.scale_shift ) \
+ : ( (x) << ras.scale_shift ) ) \
+ - ras.precision_half )
#define IS_BOTTOM_OVERSHOOT( x ) \
(Bool)( CEILING( x ) - x >= ras.precision_half )
@@ -514,9 +515,6 @@
Short traceIncr; /* sweep's increment in target bitmap */
- Short gray_min_x; /* current min x during gray rendering */
- Short gray_max_x; /* current max x during gray rendering */
-
/* dispatch variables */
Function_Sweep_Init* Proc_Sweep_Init;
@@ -529,45 +527,19 @@
Bool second_pass; /* indicates whether a horizontal pass */
/* should be performed to control */
/* drop-out accurately when calling */
- /* Render_Glyph. Note that there is */
- /* no horizontal pass during gray */
- /* rendering. */
+ /* Render_Glyph. */
TPoint arcs[3 * MaxBezier + 1]; /* The Bezier stack */
black_TBand band_stack[16]; /* band stack used for sub-banding */
Int band_top; /* band stack top */
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
-
- Byte* grays;
-
- Byte gray_lines[RASTER_GRAY_LINES];
- /* Intermediate table used to render the */
- /* graylevels pixmaps. */
- /* gray_lines is a buffer holding two */
- /* monochrome scanlines */
-
- Short gray_width; /* width in bytes of one monochrome */
- /* intermediate scanline of gray_lines. */
- /* Each gray pixel takes 2 bits long there */
-
- /* The gray_lines must hold 2 lines, thus with size */
- /* in bytes of at least `gray_width*2'. */
-
-#endif /* FT_RASTER_ANTI_ALIASING */
-
};
typedef struct black_TRaster_
{
- char* buffer;
- long buffer_size;
void* memory;
- black_PWorker worker;
- Byte grays[5];
- Short gray_width;
} black_TRaster, *black_PRaster;
@@ -583,70 +555,6 @@
#endif /* !FT_STATIC_RASTER */
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
-
- /* A lookup table used to quickly count set bits in four gray 2x2 */
- /* cells. The values of the table have been produced with the */
- /* following code: */
- /* */
- /* for ( i = 0; i < 256; i++ ) */
- /* { */
- /* l = 0; */
- /* j = i; */
- /* */
- /* for ( c = 0; c < 4; c++ ) */
- /* { */
- /* l <<= 4; */
- /* */
- /* if ( j & 0x80 ) l++; */
- /* if ( j & 0x40 ) l++; */
- /* */
- /* j = ( j << 2 ) & 0xFF; */
- /* } */
- /* printf( "0x%04X", l ); */
- /* } */
- /* */
-
- static const short count_table[256] =
- {
- 0x0000, 0x0001, 0x0001, 0x0002, 0x0010, 0x0011, 0x0011, 0x0012,
- 0x0010, 0x0011, 0x0011, 0x0012, 0x0020, 0x0021, 0x0021, 0x0022,
- 0x0100, 0x0101, 0x0101, 0x0102, 0x0110, 0x0111, 0x0111, 0x0112,
- 0x0110, 0x0111, 0x0111, 0x0112, 0x0120, 0x0121, 0x0121, 0x0122,
- 0x0100, 0x0101, 0x0101, 0x0102, 0x0110, 0x0111, 0x0111, 0x0112,
- 0x0110, 0x0111, 0x0111, 0x0112, 0x0120, 0x0121, 0x0121, 0x0122,
- 0x0200, 0x0201, 0x0201, 0x0202, 0x0210, 0x0211, 0x0211, 0x0212,
- 0x0210, 0x0211, 0x0211, 0x0212, 0x0220, 0x0221, 0x0221, 0x0222,
- 0x1000, 0x1001, 0x1001, 0x1002, 0x1010, 0x1011, 0x1011, 0x1012,
- 0x1010, 0x1011, 0x1011, 0x1012, 0x1020, 0x1021, 0x1021, 0x1022,
- 0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,
- 0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,
- 0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,
- 0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,
- 0x1200, 0x1201, 0x1201, 0x1202, 0x1210, 0x1211, 0x1211, 0x1212,
- 0x1210, 0x1211, 0x1211, 0x1212, 0x1220, 0x1221, 0x1221, 0x1222,
- 0x1000, 0x1001, 0x1001, 0x1002, 0x1010, 0x1011, 0x1011, 0x1012,
- 0x1010, 0x1011, 0x1011, 0x1012, 0x1020, 0x1021, 0x1021, 0x1022,
- 0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,
- 0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,
- 0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,
- 0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,
- 0x1200, 0x1201, 0x1201, 0x1202, 0x1210, 0x1211, 0x1211, 0x1212,
- 0x1210, 0x1211, 0x1211, 0x1212, 0x1220, 0x1221, 0x1221, 0x1222,
- 0x2000, 0x2001, 0x2001, 0x2002, 0x2010, 0x2011, 0x2011, 0x2012,
- 0x2010, 0x2011, 0x2011, 0x2012, 0x2020, 0x2021, 0x2021, 0x2022,
- 0x2100, 0x2101, 0x2101, 0x2102, 0x2110, 0x2111, 0x2111, 0x2112,
- 0x2110, 0x2111, 0x2111, 0x2112, 0x2120, 0x2121, 0x2121, 0x2122,
- 0x2100, 0x2101, 0x2101, 0x2102, 0x2110, 0x2111, 0x2111, 0x2112,
- 0x2110, 0x2111, 0x2111, 0x2112, 0x2120, 0x2121, 0x2121, 0x2122,
- 0x2200, 0x2201, 0x2201, 0x2202, 0x2210, 0x2211, 0x2211, 0x2212,
- 0x2210, 0x2211, 0x2211, 0x2212, 0x2220, 0x2221, 0x2221, 0x2222
- };
-
-#endif /* FT_RASTER_OPTION_ANTI_ALIASING */
-
-
-
/*************************************************************************/
/*************************************************************************/
/** **/
@@ -677,11 +585,11 @@
* approximating it as a straight segment. The default value of 32 (for
* low accuracy) corresponds to
*
- * 32 / 64 == 0.5 pixels ,
+ * 32 / 64 == 0.5 pixels,
*
* while for the high accuracy case we have
*
- * 256/ (1 << 12) = 0.0625 pixels .
+ * 256 / (1 << 12) = 0.0625 pixels.
*
* `precision_jitter' is an epsilon threshold used in
* `Vertical_Sweep_Span' to deal with small imperfections in the Bezier
@@ -764,13 +672,13 @@
if ( overshoot )
ras.cProfile->flags |= Overshoot_Bottom;
- FT_TRACE6(( "New ascending profile = %p\n", ras.cProfile ));
+ FT_TRACE6(( " new ascending profile = %p\n", ras.cProfile ));
break;
case Descending_State:
if ( overshoot )
ras.cProfile->flags |= Overshoot_Top;
- FT_TRACE6(( "New descending profile = %p\n", ras.cProfile ));
+ FT_TRACE6(( " new descending profile = %p\n", ras.cProfile ));
break;
default:
@@ -825,7 +733,7 @@
PProfile oldProfile;
- FT_TRACE6(( "Ending profile %p, start = %ld, height = %ld\n",
+ FT_TRACE6(( " ending profile %p, start = %ld, height = %ld\n",
ras.cProfile, ras.cProfile->start, h ));
ras.cProfile->height = h;
@@ -893,15 +801,14 @@
/* if it is <, simply insert it, ignore if == */
if ( n >= 0 && y > y_turns[n] )
- while ( n >= 0 )
+ do
{
Int y2 = (Int)y_turns[n];
y_turns[n] = y;
y = y2;
- n--;
- }
+ } while ( --n >= 0 );
if ( n < 0 )
{
@@ -942,7 +849,7 @@
if ( n > 1 && p )
{
- while ( n > 0 )
+ do
{
Int bottom, top;
@@ -970,8 +877,7 @@
return FAILURE;
p = p->link;
- n--;
- }
+ } while ( --n );
}
else
ras.fProfile = NULL;
@@ -1342,7 +1248,7 @@
start_arc = arc;
- while ( arc >= start_arc && e <= e2 )
+ do
{
ras.joint = FALSE;
@@ -1375,7 +1281,7 @@
}
arc -= degree;
}
- }
+ } while ( arc >= start_arc && e <= e2 );
Fin:
ras.top = top;
@@ -1813,7 +1719,7 @@
static Bool
Decompose_Curve( RAS_ARGS UShort first,
UShort last,
- int flipped )
+ Int flipped )
{
FT_Vector v_last;
FT_Vector v_control;
@@ -1824,7 +1730,7 @@
FT_Vector* limit;
char* tags;
- unsigned tag; /* current point's state */
+ UInt tag; /* current point's state */
points = ras.outline.points;
@@ -2035,10 +1941,10 @@
/* rendering. */
/* */
static Bool
- Convert_Glyph( RAS_ARGS int flipped )
+ Convert_Glyph( RAS_ARGS Int flipped )
{
- int i;
- unsigned start;
+ Int i;
+ UInt start;
ras.fProfile = NULL;
@@ -2064,12 +1970,12 @@
ras.state = Unknown_State;
ras.gProfile = NULL;
- if ( Decompose_Curve( RAS_VARS (unsigned short)start,
- ras.outline.contours[i],
+ if ( Decompose_Curve( RAS_VARS (UShort)start,
+ (UShort)ras.outline.contours[i],
flipped ) )
return FAILURE;
- start = ras.outline.contours[i] + 1;
+ start = (UShort)ras.outline.contours[i] + 1;
/* we must now check whether the extreme arcs join or not */
if ( FRAC( ras.lastY ) == 0 &&
@@ -2083,7 +1989,8 @@
/* to be drawn. */
lastProfile = ras.cProfile;
- if ( ras.cProfile->flags & Flow_Up )
+ if ( ras.top != ras.cProfile->offset &&
+ ( ras.cProfile->flags & Flow_Up ) )
o = IS_TOP_OVERSHOOT( ras.lastY );
else
o = IS_BOTTOM_OVERSHOOT( ras.lastY );
@@ -2207,7 +2114,7 @@
while ( current )
{
current->X = *current->offset;
- current->offset += current->flags & Flow_Up ? 1 : -1;
+ current->offset += ( current->flags & Flow_Up ) ? 1 : -1;
current->height--;
current = current->link;
}
@@ -2267,10 +2174,7 @@
ras.traceIncr = (Short)-pitch;
ras.traceOfs = -*min * pitch;
if ( pitch > 0 )
- ras.traceOfs += ( ras.target.rows - 1 ) * pitch;
-
- ras.gray_min_x = 0;
- ras.gray_max_x = 0;
+ ras.traceOfs += (Long)( ras.target.rows - 1 ) * pitch;
}
@@ -2291,6 +2195,14 @@
FT_UNUSED( right );
+ /* in high-precision mode, we need 12 digits after the comma to */
+ /* represent multiples of 1/(1<<12) = 1/4096 */
+ FT_TRACE7(( " y=%d x=[%.12f;%.12f], drop-out=%d",
+ y,
+ x1 / (double)ras.precision,
+ x2 / (double)ras.precision,
+ dropOutControl ));
+
/* Drop-out control */
e1 = TRUNC( CEILING( x1 ) );
@@ -2303,7 +2215,7 @@
if ( e2 >= 0 && e1 < ras.bWidth )
{
- int c1, c2;
+ Int c1, c2;
Byte f1, f2;
@@ -2312,17 +2224,14 @@
if ( e2 >= ras.bWidth )
e2 = ras.bWidth - 1;
+ FT_TRACE7(( " -> x=[%d;%d]", e1, e2 ));
+
c1 = (Short)( e1 >> 3 );
c2 = (Short)( e2 >> 3 );
f1 = (Byte) ( 0xFF >> ( e1 & 7 ) );
f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) );
- if ( ras.gray_min_x > c1 )
- ras.gray_min_x = (short)c1;
- if ( ras.gray_max_x < c2 )
- ras.gray_max_x = (short)c2;
-
target = ras.bTarget + ras.traceOfs + c1;
c2 -= c1;
@@ -2344,6 +2253,8 @@
else
*target |= ( f1 & f2 );
}
+
+ FT_TRACE7(( "\n" ));
}
@@ -2358,6 +2269,11 @@
Short c1, f1;
+ FT_TRACE7(( " y=%d x=[%.12f;%.12f]",
+ y,
+ x1 / (double)ras.precision,
+ x2 / (double)ras.precision ));
+
/* Drop-out control */
/* e2 x2 x1 e1 */
@@ -2390,6 +2306,8 @@
Int dropOutControl = left->flags & 7;
+ FT_TRACE7(( ", drop-out=%d", dropOutControl ));
+
if ( e1 == e2 + ras.precision )
{
switch ( dropOutControl )
@@ -2436,14 +2354,14 @@
left->height <= 0 &&
!( left->flags & Overshoot_Top &&
x2 - x1 >= ras.precision_half ) )
- return;
+ goto Exit;
/* lower stub test */
if ( right->next == left &&
left->start == y &&
!( left->flags & Overshoot_Bottom &&
x2 - x1 >= ras.precision_half ) )
- return;
+ goto Exit;
if ( dropOutControl == 1 )
pxl = e2;
@@ -2452,7 +2370,7 @@
break;
default: /* modes 2, 3, 6, 7 */
- return; /* no drop-out control */
+ goto Exit; /* no drop-out control */
}
/* undocumented but confirmed: If the drop-out would result in a */
@@ -2473,26 +2391,26 @@
if ( e1 >= 0 && e1 < ras.bWidth &&
ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) )
- return;
+ goto Exit;
}
else
- return;
+ goto Exit;
}
e1 = TRUNC( pxl );
if ( e1 >= 0 && e1 < ras.bWidth )
{
+ FT_TRACE7(( " -> x=%d (drop-out)", e1 ));
+
c1 = (Short)( e1 >> 3 );
f1 = (Short)( e1 & 7 );
- if ( ras.gray_min_x > c1 )
- ras.gray_min_x = c1;
- if ( ras.gray_max_x < c1 )
- ras.gray_max_x = c1;
-
ras.bTarget[ras.traceOfs + c1] |= (char)( 0x80 >> f1 );
}
+
+ Exit:
+ FT_TRACE7(( "\n" ));
}
@@ -2539,32 +2457,39 @@
Long e1, e2;
+ FT_TRACE7(( " x=%d y=[%.12f;%.12f]",
+ y,
+ x1 / (double)ras.precision,
+ x2 / (double)ras.precision ));
+
e1 = CEILING( x1 );
e2 = FLOOR ( x2 );
if ( e1 == e2 )
{
- Byte f1;
- PByte bits;
-
-
- bits = ras.bTarget + ( y >> 3 );
- f1 = (Byte)( 0x80 >> ( y & 7 ) );
-
e1 = TRUNC( e1 );
if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
{
+ Byte f1;
+ PByte bits;
PByte p;
- p = bits - e1 * ras.target.pitch;
+ FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
+
+ bits = ras.bTarget + ( y >> 3 );
+ f1 = (Byte)( 0x80 >> ( y & 7 ) );
+ p = bits - e1 * ras.target.pitch;
+
if ( ras.target.pitch > 0 )
- p += ( ras.target.rows - 1 ) * ras.target.pitch;
+ p += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
p[0] |= f1;
}
}
+
+ FT_TRACE7(( "\n" ));
}
}
@@ -2581,6 +2506,11 @@
Byte f1;
+ FT_TRACE7(( " x=%d y=[%.12f;%.12f]",
+ y,
+ x1 / (double)ras.precision,
+ x2 / (double)ras.precision ));
+
/* During the horizontal sweep, we only take care of drop-outs */
/* e1 + <-- pixel center */
@@ -2602,6 +2532,8 @@
Int dropOutControl = left->flags & 7;
+ FT_TRACE7(( ", dropout=%d", dropOutControl ));
+
if ( e1 == e2 + ras.precision )
{
switch ( dropOutControl )
@@ -2623,14 +2555,14 @@
left->height <= 0 &&
!( left->flags & Overshoot_Top &&
x2 - x1 >= ras.precision_half ) )
- return;
+ goto Exit;
/* leftmost stub test */
if ( right->next == left &&
left->start == y &&
!( left->flags & Overshoot_Bottom &&
x2 - x1 >= ras.precision_half ) )
- return;
+ goto Exit;
if ( dropOutControl == 1 )
pxl = e2;
@@ -2639,7 +2571,7 @@
break;
default: /* modes 2, 3, 6, 7 */
- return; /* no drop-out control */
+ goto Exit; /* no drop-out control */
}
/* undocumented but confirmed: If the drop-out would result in a */
@@ -2660,30 +2592,35 @@
bits -= e1 * ras.target.pitch;
if ( ras.target.pitch > 0 )
- bits += ( ras.target.rows - 1 ) * ras.target.pitch;
+ bits += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
if ( e1 >= 0 &&
(ULong)e1 < ras.target.rows &&
*bits & f1 )
- return;
+ goto Exit;
}
else
- return;
+ goto Exit;
}
- bits = ras.bTarget + ( y >> 3 );
- f1 = (Byte)( 0x80 >> ( y & 7 ) );
-
e1 = TRUNC( pxl );
if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
{
+ FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
+
+ bits = ras.bTarget + ( y >> 3 );
+ f1 = (Byte)( 0x80 >> ( y & 7 ) );
bits -= e1 * ras.target.pitch;
+
if ( ras.target.pitch > 0 )
- bits += ( ras.target.rows - 1 ) * ras.target.pitch;
+ bits += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
bits[0] |= f1;
}
+
+ Exit:
+ FT_TRACE7(( "\n" ));
}
@@ -2695,249 +2632,6 @@
}
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
-
-
- /*************************************************************************/
- /* */
- /* Vertical Gray Sweep Procedure Set */
- /* */
- /* These two routines are used during the vertical gray-levels sweep */
- /* phase by the generic Draw_Sweep() function. */
- /* */
- /* NOTES */
- /* */
- /* - The target pixmap's width *must* be a multiple of 4. */
- /* */
- /* - You have to use the function Vertical_Sweep_Span() for the gray */
- /* span call. */
- /* */
- /*************************************************************************/
-
- static void
- Vertical_Gray_Sweep_Init( RAS_ARGS Short* min,
- Short* max )
- {
- Long pitch, byte_len;
-
-
- *min = *min & -2;
- *max = ( *max + 3 ) & -2;
-
- ras.traceOfs = 0;
- pitch = ras.target.pitch;
- byte_len = -pitch;
- ras.traceIncr = (Short)byte_len;
- ras.traceG = ( *min / 2 ) * byte_len;
-
- if ( pitch > 0 )
- {
- ras.traceG += ( ras.target.rows - 1 ) * pitch;
- byte_len = -byte_len;
- }
-
- ras.gray_min_x = (Short)byte_len;
- ras.gray_max_x = -(Short)byte_len;
- }
-
-
- static void
- Vertical_Gray_Sweep_Step( RAS_ARG )
- {
- short* count = (short*)count_table;
- Byte* grays;
-
-
- ras.traceOfs += ras.gray_width;
-
- if ( ras.traceOfs > ras.gray_width )
- {
- PByte pix;
-
-
- pix = ras.gTarget + ras.traceG + ras.gray_min_x * 4;
- grays = ras.grays;
-
- if ( ras.gray_max_x >= 0 )
- {
- Long last_pixel = ras.target.width - 1;
- Int last_cell = last_pixel >> 2;
- Int last_bit = last_pixel & 3;
- Bool over = 0;
-
- Int c1, c2;
- PByte bit, bit2;
-
-
- if ( ras.gray_max_x >= last_cell && last_bit != 3 )
- {
- ras.gray_max_x = last_cell - 1;
- over = 1;
- }
-
- if ( ras.gray_min_x < 0 )
- ras.gray_min_x = 0;
-
- bit = ras.bTarget + ras.gray_min_x;
- bit2 = bit + ras.gray_width;
-
- c1 = ras.gray_max_x - ras.gray_min_x;
-
- while ( c1 >= 0 )
- {
- c2 = count[*bit] + count[*bit2];
-
- if ( c2 )
- {
- pix[0] = grays[(c2 >> 12) & 0x000F];
- pix[1] = grays[(c2 >> 8 ) & 0x000F];
- pix[2] = grays[(c2 >> 4 ) & 0x000F];
- pix[3] = grays[ c2 & 0x000F];
-
- *bit = 0;
- *bit2 = 0;
- }
-
- bit++;
- bit2++;
- pix += 4;
- c1--;
- }
-
- if ( over )
- {
- c2 = count[*bit] + count[*bit2];
- if ( c2 )
- {
- switch ( last_bit )
- {
- case 2:
- pix[2] = grays[(c2 >> 4 ) & 0x000F];
- case 1:
- pix[1] = grays[(c2 >> 8 ) & 0x000F];
- default:
- pix[0] = grays[(c2 >> 12) & 0x000F];
- }
-
- *bit = 0;
- *bit2 = 0;
- }
- }
- }
-
- ras.traceOfs = 0;
- ras.traceG += ras.traceIncr;
-
- ras.gray_min_x = 32000;
- ras.gray_max_x = -32000;
- }
- }
-
-
- static void
- Horizontal_Gray_Sweep_Span( RAS_ARGS Short y,
- FT_F26Dot6 x1,
- FT_F26Dot6 x2,
- PProfile left,
- PProfile right )
- {
- /* nothing, really */
- FT_UNUSED_RASTER;
- FT_UNUSED( y );
- FT_UNUSED( x1 );
- FT_UNUSED( x2 );
- FT_UNUSED( left );
- FT_UNUSED( right );
- }
-
-
- static void
- Horizontal_Gray_Sweep_Drop( RAS_ARGS Short y,
- FT_F26Dot6 x1,
- FT_F26Dot6 x2,
- PProfile left,
- PProfile right )
- {
- Long e1, e2;
- PByte pixel;
-
-
- /* During the horizontal sweep, we only take care of drop-outs */
-
- e1 = CEILING( x1 );
- e2 = FLOOR ( x2 );
-
- if ( e1 > e2 )
- {
- Int dropOutControl = left->flags & 7;
-
-
- if ( e1 == e2 + ras.precision )
- {
- switch ( dropOutControl )
- {
- case 0: /* simple drop-outs including stubs */
- e1 = e2;
- break;
-
- case 4: /* smart drop-outs including stubs */
- e1 = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );
- break;
-
- case 1: /* simple drop-outs excluding stubs */
- case 5: /* smart drop-outs excluding stubs */
- /* see Vertical_Sweep_Drop for details */
-
- /* rightmost stub test */
- if ( left->next == right && left->height <= 0 )
- return;
-
- /* leftmost stub test */
- if ( right->next == left && left->start == y )
- return;
-
- if ( dropOutControl == 1 )
- e1 = e2;
- else
- e1 = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );
-
- break;
-
- default: /* modes 2, 3, 6, 7 */
- return; /* no drop-out control */
- }
- }
- else
- return;
- }
-
- if ( e1 >= 0 )
- {
- Byte color;
-
-
- if ( x2 - x1 >= ras.precision_half )
- color = ras.grays[2];
- else
- color = ras.grays[1];
-
- e1 = TRUNC( e1 ) / 2;
- if ( e1 < ras.target.rows )
- {
- pixel = ras.gTarget - e1 * ras.target.pitch + y / 2;
- if ( ras.target.pitch > 0 )
- pixel += ( ras.target.rows - 1 ) * ras.target.pitch;
-
- if ( pixel[0] == ras.grays[0] )
- pixel[0] = color;
- }
- }
- }
-
-
-#endif /* FT_RASTER_OPTION_ANTI_ALIASING */
-
-
/*************************************************************************/
/* */
/* Generic Sweep Drawing routine */
@@ -3007,7 +2701,7 @@
while ( P )
{
- P->countL = (UShort)( P->start - min_Y );
+ P->countL = P->start - min_Y;
P = P->link;
}
@@ -3270,7 +2964,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
- FT_LOCAL_DEF( FT_Error )
+ static FT_Error
Render_Glyph( RAS_ARG )
{
FT_Error error;
@@ -3293,10 +2987,12 @@
ras.dropOutControl += 1;
}
- ras.second_pass = (FT_Byte)( !( ras.outline.flags &
- FT_OUTLINE_SINGLE_PASS ) );
+ ras.second_pass = (Bool)( !( ras.outline.flags &
+ FT_OUTLINE_SINGLE_PASS ) );
/* Vertical Sweep */
+ FT_TRACE7(( "Vertical pass (ftraster)\n" ));
+
ras.Proc_Sweep_Init = Vertical_Sweep_Init;
ras.Proc_Sweep_Span = Vertical_Sweep_Span;
ras.Proc_Sweep_Drop = Vertical_Sweep_Drop;
@@ -3304,9 +3000,9 @@
ras.band_top = 0;
ras.band_stack[0].y_min = 0;
- ras.band_stack[0].y_max = (short)( ras.target.rows - 1 );
+ ras.band_stack[0].y_max = (Short)( ras.target.rows - 1 );
- ras.bWidth = (unsigned short)ras.target.width;
+ ras.bWidth = (UShort)ras.target.width;
ras.bTarget = (Byte*)ras.target.buffer;
if ( ( error = Render_Single_Pass( RAS_VARS 0 ) ) != 0 )
@@ -3315,6 +3011,8 @@
/* Horizontal Sweep */
if ( ras.second_pass && ras.dropOutControl != 2 )
{
+ FT_TRACE7(( "Horizontal pass (ftraster)\n" ));
+
ras.Proc_Sweep_Init = Horizontal_Sweep_Init;
ras.Proc_Sweep_Span = Horizontal_Sweep_Span;
ras.Proc_Sweep_Drop = Horizontal_Sweep_Drop;
@@ -3322,7 +3020,7 @@
ras.band_top = 0;
ras.band_stack[0].y_min = 0;
- ras.band_stack[0].y_max = (short)( ras.target.width - 1 );
+ ras.band_stack[0].y_max = (Short)( ras.target.width - 1 );
if ( ( error = Render_Single_Pass( RAS_VARS 1 ) ) != 0 )
return error;
@@ -3332,118 +3030,10 @@
}
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Render_Gray_Glyph */
- /* */
- /* <Description> */
- /* Render a glyph with grayscaling. Sub-banding if needed. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- FT_LOCAL_DEF( FT_Error )
- Render_Gray_Glyph( RAS_ARG )
- {
- Long pixel_width;
- FT_Error error;
-
-
- Set_High_Precision( RAS_VARS ras.outline.flags &
- FT_OUTLINE_HIGH_PRECISION );
- ras.scale_shift = ras.precision_shift + 1;
-
- if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS )
- ras.dropOutControl = 2;
- else
- {
- if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS )
- ras.dropOutControl = 4;
- else
- ras.dropOutControl = 0;
-
- if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) )
- ras.dropOutControl += 1;
- }
-
- ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS );
-
- /* Vertical Sweep */
-
- ras.band_top = 0;
- ras.band_stack[0].y_min = 0;
- ras.band_stack[0].y_max = 2 * ras.target.rows - 1;
-
- ras.bWidth = ras.gray_width;
- pixel_width = 2 * ( ( ras.target.width + 3 ) >> 2 );
-
- if ( ras.bWidth > pixel_width )
- ras.bWidth = pixel_width;
-
- ras.bWidth = ras.bWidth * 8;
- ras.bTarget = (Byte*)ras.gray_lines;
- ras.gTarget = (Byte*)ras.target.buffer;
-
- ras.Proc_Sweep_Init = Vertical_Gray_Sweep_Init;
- ras.Proc_Sweep_Span = Vertical_Sweep_Span;
- ras.Proc_Sweep_Drop = Vertical_Sweep_Drop;
- ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step;
-
- error = Render_Single_Pass( RAS_VARS 0 );
- if ( error )
- return error;
-
- /* Horizontal Sweep */
- if ( ras.second_pass && ras.dropOutControl != 2 )
- {
- ras.Proc_Sweep_Init = Horizontal_Sweep_Init;
- ras.Proc_Sweep_Span = Horizontal_Gray_Sweep_Span;
- ras.Proc_Sweep_Drop = Horizontal_Gray_Sweep_Drop;
- ras.Proc_Sweep_Step = Horizontal_Sweep_Step;
-
- ras.band_top = 0;
- ras.band_stack[0].y_min = 0;
- ras.band_stack[0].y_max = ras.target.width * 2 - 1;
-
- error = Render_Single_Pass( RAS_VARS 1 );
- if ( error )
- return error;
- }
-
- return Raster_Err_None;
- }
-
-#else /* !FT_RASTER_OPTION_ANTI_ALIASING */
-
- FT_LOCAL_DEF( FT_Error )
- Render_Gray_Glyph( RAS_ARG )
- {
- FT_UNUSED_RASTER;
-
- return FT_THROW( Unsupported );
- }
-
-#endif /* !FT_RASTER_OPTION_ANTI_ALIASING */
-
-
static void
ft_black_init( black_PRaster raster )
{
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
- FT_UInt n;
-
-
- /* set default 5-levels gray palette */
- for ( n = 0; n < 5; n++ )
- raster->grays[n] = n * 255 / 4;
-
- raster->gray_width = RASTER_GRAY_LINES / 2;
-#else
FT_UNUSED( raster );
-#endif
}
@@ -3518,55 +3108,23 @@
static void
ft_black_reset( black_PRaster raster,
char* pool_base,
- long pool_size )
+ Long pool_size )
{
- if ( raster )
- {
- if ( pool_base && pool_size >= (long)sizeof ( black_TWorker ) + 2048 )
- {
- black_PWorker worker = (black_PWorker)pool_base;
-
-
- raster->buffer = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 );
- raster->buffer_size = (long)( pool_base + pool_size -
- (char*)raster->buffer );
- raster->worker = worker;
- }
- else
- {
- raster->buffer = NULL;
- raster->buffer_size = 0;
- raster->worker = NULL;
- }
- }
+ FT_UNUSED( raster );
+ FT_UNUSED( pool_base );
+ FT_UNUSED( pool_size );
}
static int
ft_black_set_mode( black_PRaster raster,
- unsigned long mode,
+ ULong mode,
const char* palette )
{
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
-
- if ( mode == FT_MAKE_TAG( 'p', 'a', 'l', '5' ) )
- {
- /* set 5-levels gray palette */
- raster->grays[0] = palette[0];
- raster->grays[1] = palette[1];
- raster->grays[2] = palette[2];
- raster->grays[3] = palette[3];
- raster->grays[4] = palette[4];
- }
-
-#else
-
FT_UNUSED( raster );
FT_UNUSED( mode );
FT_UNUSED( palette );
-#endif
-
return 0;
}
@@ -3577,10 +3135,13 @@
{
const FT_Outline* outline = (const FT_Outline*)params->source;
const FT_Bitmap* target_map = params->target;
- black_PWorker worker;
+ black_TWorker worker[1];
+
+ Long buffer[FT_MAX( FT_RENDER_POOL_SIZE, 2048 ) / sizeof ( Long )];
- if ( !raster || !raster->buffer || !raster->buffer_size )
+
+ if ( !raster )
return FT_THROW( Not_Ini );
if ( !outline )
@@ -3597,12 +3158,13 @@
outline->contours[outline->n_contours - 1] + 1 )
return FT_THROW( Invalid );
- worker = raster->worker;
-
/* this version of the raster does not support direct rendering, sorry */
if ( params->flags & FT_RASTER_FLAG_DIRECT )
return FT_THROW( Unsupported );
+ if ( params->flags & FT_RASTER_FLAG_AA )
+ return FT_THROW( Unsupported );
+
if ( !target_map )
return FT_THROW( Invalid );
@@ -3616,30 +3178,23 @@
ras.outline = *outline;
ras.target = *target_map;
- worker->buff = (PLong) raster->buffer;
- worker->sizeBuff = worker->buff +
- raster->buffer_size / sizeof ( Long );
-#ifdef FT_RASTER_OPTION_ANTI_ALIASING
- worker->grays = raster->grays;
- worker->gray_width = raster->gray_width;
+ worker->buff = buffer;
+ worker->sizeBuff = (&buffer)[1]; /* Points to right after buffer. */
- FT_MEM_ZERO( worker->gray_lines, worker->gray_width * 2 );
-#endif
-
- return ( params->flags & FT_RASTER_FLAG_AA )
- ? Render_Gray_Glyph( RAS_VAR )
- : Render_Glyph( RAS_VAR );
+ return Render_Glyph( RAS_VAR );
}
- FT_DEFINE_RASTER_FUNCS( ft_standard_raster,
+ FT_DEFINE_RASTER_FUNCS(
+ ft_standard_raster,
+
FT_GLYPH_FORMAT_OUTLINE,
+
(FT_Raster_New_Func) ft_black_new,
(FT_Raster_Reset_Func) ft_black_reset,
(FT_Raster_Set_Mode_Func)ft_black_set_mode,
(FT_Raster_Render_Func) ft_black_render,
- (FT_Raster_Done_Func) ft_black_done
- )
+ (FT_Raster_Done_Func) ft_black_done )
/* END */
diff --git a/src/3rdparty/freetype/src/raster/ftraster.h b/src/3rdparty/freetype/src/raster/ftraster.h
index 80fe46deba..a270d487b9 100644
--- a/src/3rdparty/freetype/src/raster/ftraster.h
+++ b/src/3rdparty/freetype/src/raster/ftraster.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/src/3rdparty/freetype/src/raster/ftrend1.c b/src/3rdparty/freetype/src/raster/ftrend1.c
index aa7f6d5664..f314392839 100644
--- a/src/3rdparty/freetype/src/raster/ftrend1.c
+++ b/src/3rdparty/freetype/src/raster/ftrend1.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (body). */
/* */
-/* Copyright 1996-2003, 2005, 2006, 2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -104,7 +104,7 @@
{
FT_Error error;
FT_Outline* outline;
- FT_BBox cbox;
+ FT_BBox cbox, cbox0;
FT_UInt width, height, pitch;
FT_Bitmap* bitmap;
FT_Memory memory;
@@ -120,38 +120,11 @@
}
/* check rendering mode */
-#ifndef FT_CONFIG_OPTION_PIC
if ( mode != FT_RENDER_MODE_MONO )
{
/* raster1 is only capable of producing monochrome bitmaps */
- if ( render->clazz == &ft_raster1_renderer_class )
- return FT_THROW( Cannot_Render_Glyph );
+ return FT_THROW( Cannot_Render_Glyph );
}
- else
- {
- /* raster5 is only capable of producing 5-gray-levels bitmaps */
- if ( render->clazz == &ft_raster5_renderer_class )
- return FT_THROW( Cannot_Render_Glyph );
- }
-#else /* FT_CONFIG_OPTION_PIC */
- /* When PIC is enabled, we cannot get to the class object */
- /* so instead we check the final character in the class name */
- /* ("raster5" or "raster1"). Yes this is a hack. */
- /* The "correct" thing to do is have different render function */
- /* for each of the classes. */
- if ( mode != FT_RENDER_MODE_MONO )
- {
- /* raster1 is only capable of producing monochrome bitmaps */
- if ( render->clazz->root.module_name[6] == '1' )
- return FT_THROW( Cannot_Render_Glyph );
- }
- else
- {
- /* raster5 is only capable of producing 5-gray-levels bitmaps */
- if ( render->clazz->root.module_name[6] == '5' )
- return FT_THROW( Cannot_Render_Glyph );
- }
-#endif /* FT_CONFIG_OPTION_PIC */
outline = &slot->outline;
@@ -160,14 +133,14 @@
FT_Outline_Translate( outline, origin->x, origin->y );
/* compute the control box, and grid fit it */
- FT_Outline_Get_CBox( outline, &cbox );
+ FT_Outline_Get_CBox( outline, &cbox0 );
/* undocumented but confirmed: bbox values get rounded */
#if 1
- cbox.xMin = FT_PIX_ROUND( cbox.xMin );
- cbox.yMin = FT_PIX_ROUND( cbox.yMin );
- cbox.xMax = FT_PIX_ROUND( cbox.xMax );
- cbox.yMax = FT_PIX_ROUND( cbox.yMax );
+ cbox.xMin = FT_PIX_ROUND( cbox0.xMin );
+ cbox.yMin = FT_PIX_ROUND( cbox0.yMin );
+ cbox.xMax = FT_PIX_ROUND( cbox0.xMax );
+ cbox.yMax = FT_PIX_ROUND( cbox0.yMax );
#else
cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
@@ -175,8 +148,28 @@
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
#endif
+ /* If either `width' or `height' round to 0, try */
+ /* explicitly rounding up/down. In the case of */
+ /* glyphs containing only one very narrow feature, */
+ /* this gives the drop-out compensation in the scan */
+ /* conversion code a chance to do its stuff. */
width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
+ if ( width == 0 )
+ {
+ cbox.xMin = FT_PIX_FLOOR( cbox0.xMin );
+ cbox.xMax = FT_PIX_CEIL( cbox0.xMax );
+
+ width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
+ }
+
height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+ if ( height == 0 )
+ {
+ cbox.yMin = FT_PIX_FLOOR( cbox0.yMin );
+ cbox.yMax = FT_PIX_CEIL( cbox0.yMax );
+
+ height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+ }
if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
{
@@ -194,23 +187,12 @@
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
- /* allocate new one, depends on pixel format */
- if ( !( mode & FT_RENDER_MODE_MONO ) )
- {
- /* we pad to 32 bits, only for backwards compatibility with FT 1.x */
- pitch = FT_PAD_CEIL( width, 4 );
- bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
- bitmap->num_grays = 256;
- }
- else
- {
- pitch = ( ( width + 15 ) >> 4 ) << 1;
- bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
- }
+ pitch = ( ( width + 15 ) >> 4 ) << 1;
+ bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
bitmap->width = width;
bitmap->rows = height;
- bitmap->pitch = pitch;
+ bitmap->pitch = (int)pitch;
if ( FT_ALLOC_MULT( bitmap->buffer, pitch, height ) )
goto Exit;
@@ -225,9 +207,6 @@
params.source = outline;
params.flags = 0;
- if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY )
- params.flags |= FT_RASTER_FLAG_AA;
-
/* render outline into the bitmap */
error = render->raster_render( render->raster, &params );
@@ -272,35 +251,4 @@
)
- /* This renderer is _NOT_ part of the default modules; you will need */
- /* to register it by hand in your application. It should only be */
- /* used for backwards-compatibility with FT 1.x anyway. */
- /* */
- FT_DEFINE_RENDERER( ft_raster5_renderer_class,
-
- FT_MODULE_RENDERER,
- sizeof ( FT_RendererRec ),
-
- "raster5",
- 0x10000L,
- 0x20000L,
-
- 0, /* module specific interface */
-
- (FT_Module_Constructor)ft_raster1_init,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
- ,
-
- FT_GLYPH_FORMAT_OUTLINE,
-
- (FT_Renderer_RenderFunc) ft_raster1_render,
- (FT_Renderer_TransformFunc)ft_raster1_transform,
- (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox,
- (FT_Renderer_SetModeFunc) ft_raster1_set_mode,
-
- (FT_Raster_Funcs*) &FT_STANDARD_RASTER_GET
- )
-
-
/* END */
diff --git a/src/3rdparty/freetype/src/raster/ftrend1.h b/src/3rdparty/freetype/src/raster/ftrend1.h
index 4cf128622a..edc5d13f4c 100644
--- a/src/3rdparty/freetype/src/raster/ftrend1.h
+++ b/src/3rdparty/freetype/src/raster/ftrend1.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,12 +29,6 @@ FT_BEGIN_HEADER
FT_DECLARE_RENDERER( ft_raster1_renderer_class )
- /* this renderer is _NOT_ part of the default modules, you'll need */
- /* to register it by hand in your application. It should only be */
- /* used for backwards-compatibility with FT 1.x anyway. */
- /* */
- FT_DECLARE_RENDERER( ft_raster5_renderer_class )
-
FT_END_HEADER
diff --git a/src/3rdparty/freetype/src/raster/module.mk b/src/3rdparty/freetype/src/raster/module.mk
index cbff5df96e..75ea107530 100644
--- a/src/3rdparty/freetype/src/raster/module.mk
+++ b/src/3rdparty/freetype/src/raster/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/raster/raster.c b/src/3rdparty/freetype/src/raster/raster.c
index 1202a116cd..21bb16de1e 100644
--- a/src/3rdparty/freetype/src/raster/raster.c
+++ b/src/3rdparty/freetype/src/raster/raster.c
@@ -4,7 +4,7 @@
/* */
/* FreeType monochrome rasterer module component (body only). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/raster/rasterrs.h b/src/3rdparty/freetype/src/raster/rasterrs.h
index ab85c002a3..e7f00bcace 100644
--- a/src/3rdparty/freetype/src/raster/rasterrs.h
+++ b/src/3rdparty/freetype/src/raster/rasterrs.h
@@ -4,7 +4,7 @@
/* */
/* monochrome renderer error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/raster/rastpic.c b/src/3rdparty/freetype/src/raster/rastpic.c
index 5e9f7cc9c4..77e7ec3f90 100644
--- a/src/3rdparty/freetype/src/raster/rastpic.c
+++ b/src/3rdparty/freetype/src/raster/rastpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for raster module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -59,8 +59,9 @@
FT_Memory memory = library->memory;
- /* since this function also serves raster5 renderer, */
- /* it implements reference counting */
+ /* XXX: since this function also served the no longer available */
+ /* raster5 renderer it uses reference counting, which could */
+ /* be removed now */
if ( pic_container->raster )
{
((RasterPIC*)pic_container->raster)->ref_count++;
@@ -82,21 +83,6 @@
return error;
}
-
- /* re-route these init and free functions to the above functions */
- FT_Error
- ft_raster5_renderer_class_pic_init( FT_Library library )
- {
- return ft_raster1_renderer_class_pic_init( library );
- }
-
-
- void
- ft_raster5_renderer_class_pic_free( FT_Library library )
- {
- ft_raster1_renderer_class_pic_free( library );
- }
-
#endif /* FT_CONFIG_OPTION_PIC */
diff --git a/src/3rdparty/freetype/src/raster/rastpic.h b/src/3rdparty/freetype/src/raster/rastpic.h
index e0ddba624e..408996a908 100644
--- a/src/3rdparty/freetype/src/raster/rastpic.h
+++ b/src/3rdparty/freetype/src/raster/rastpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for raster module. */
/* */
-/* Copyright 2009 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,11 +20,11 @@
#define __RASTPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
+FT_BEGIN_HEADER
+
#ifndef FT_CONFIG_OPTION_PIC
#define FT_STANDARD_RASTER_GET ft_standard_raster
@@ -48,15 +48,9 @@ FT_BEGIN_HEADER
void
ft_raster1_renderer_class_pic_free( FT_Library library );
- void
- ft_raster5_renderer_class_pic_free( FT_Library library );
-
FT_Error
ft_raster1_renderer_class_pic_init( FT_Library library );
- FT_Error
- ft_raster5_renderer_class_pic_init( FT_Library library );
-
#endif /* FT_CONFIG_OPTION_PIC */
/* */
diff --git a/src/3rdparty/freetype/src/raster/rules.mk b/src/3rdparty/freetype/src/raster/rules.mk
index 0e0b5e4ebd..c214b35d37 100644
--- a/src/3rdparty/freetype/src/raster/rules.mk
+++ b/src/3rdparty/freetype/src/raster/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001, 2003, 2008, 2009, 2011 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -19,7 +19,10 @@ RASTER_DIR := $(SRC_DIR)/raster
# compilation flags for the driver
#
-RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))
+RASTER_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# raster driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/sfnt/Jamfile b/src/3rdparty/freetype/src/sfnt/Jamfile
index cb20b1b04b..cc98d1011e 100644
--- a/src/3rdparty/freetype/src/sfnt/Jamfile
+++ b/src/3rdparty/freetype/src/sfnt/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/sfnt Jamfile
#
-# Copyright 2001, 2002, 2004, 2005 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,18 @@ SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ;
if $(FT2_MULTI)
{
- _sources = sfobjs sfdriver ttcmap ttmtx ttpost ttload ttsbit ttkern ttbdf sfntpic ;
+ _sources = pngshim
+ sfdriver
+ sfntpic
+ sfobjs
+ ttbdf
+ ttcmap
+ ttkern
+ ttload
+ ttmtx
+ ttpost
+ ttsbit
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/sfnt/module.mk b/src/3rdparty/freetype/src/sfnt/module.mk
index 95fd6a3143..535fe22afd 100644
--- a/src/3rdparty/freetype/src/sfnt/module.mk
+++ b/src/3rdparty/freetype/src/sfnt/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/sfnt/pngshim.c b/src/3rdparty/freetype/src/sfnt/pngshim.c
index 9bfcc2a779..ea60452635 100644
--- a/src/3rdparty/freetype/src/sfnt/pngshim.c
+++ b/src/3rdparty/freetype/src/sfnt/pngshim.c
@@ -4,7 +4,8 @@
/* */
/* PNG Bitmap glyph support. */
/* */
-/* Copyright 2013, 2014 by Google, Inc. */
+/* Copyright 2013-2015 by */
+/* Google, Inc. */
/* Written by Stuart Gill and Behdad Esfahbod. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -36,11 +37,11 @@
/* This code is freely based on cairo-png.c. There's so many ways */
/* to call libpng, and the way cairo does it is defacto standard. */
- static int
- multiply_alpha( int alpha,
- int color )
+ static unsigned int
+ multiply_alpha( unsigned int alpha,
+ unsigned int color )
{
- int temp = ( alpha * color ) + 0x80;
+ unsigned int temp = alpha * color + 0x80;
return ( temp + ( temp >> 8 ) ) >> 8;
@@ -81,10 +82,10 @@
blue = multiply_alpha( alpha, blue );
}
- base[0] = blue;
- base[1] = green;
- base[2] = red;
- base[3] = alpha;
+ base[0] = (unsigned char)blue;
+ base[1] = (unsigned char)green;
+ base[2] = (unsigned char)red;
+ base[3] = (unsigned char)alpha;
}
}
}
@@ -109,9 +110,9 @@
unsigned int blue = base[2];
- base[0] = blue;
- base[1] = green;
- base[2] = red;
+ base[0] = (unsigned char)blue;
+ base[1] = (unsigned char)green;
+ base[2] = (unsigned char)red;
base[3] = 0xFF;
}
}
@@ -257,16 +258,16 @@
if ( populate_map_and_metrics )
{
- FT_Long size;
+ FT_ULong size;
- metrics->width = (FT_Int)imgWidth;
- metrics->height = (FT_Int)imgHeight;
+ metrics->width = (FT_UShort)imgWidth;
+ metrics->height = (FT_UShort)imgHeight;
map->width = metrics->width;
map->rows = metrics->height;
map->pixel_mode = FT_PIXEL_MODE_BGRA;
- map->pitch = map->width * 4;
+ map->pitch = (int)( map->width * 4 );
map->num_grays = 256;
/* reject too large bitmaps similarly to the rasterizer */
@@ -277,7 +278,7 @@
}
/* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
- size = map->rows * map->pitch;
+ size = map->rows * (FT_ULong)map->pitch;
error = ft_glyphslot_alloc_bitmap( slot, size );
if ( error )
diff --git a/src/3rdparty/freetype/src/sfnt/pngshim.h b/src/3rdparty/freetype/src/sfnt/pngshim.h
index dc9ecaf918..4cc5c2b3a0 100644
--- a/src/3rdparty/freetype/src/sfnt/pngshim.h
+++ b/src/3rdparty/freetype/src/sfnt/pngshim.h
@@ -4,7 +4,8 @@
/* */
/* PNG Bitmap glyph support. */
/* */
-/* Copyright 2013 by Google, Inc. */
+/* Copyright 2013-2015 by */
+/* Google, Inc. */
/* Written by Stuart Gill and Behdad Esfahbod. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/rules.mk b/src/3rdparty/freetype/src/sfnt/rules.mk
index a6c956ab65..3cc76b3f7a 100644
--- a/src/3rdparty/freetype/src/sfnt/rules.mk
+++ b/src/3rdparty/freetype/src/sfnt/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2002-2007, 2009, 2011, 2013 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ SFNT_DIR := $(SRC_DIR)/sfnt
# compilation flags for the driver
#
-SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR))
+SFNT_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# SFNT driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/sfnt/sfdriver.c b/src/3rdparty/freetype/src/sfnt/sfdriver.c
index badb159dc3..6a3f0d9933 100644
--- a/src/3rdparty/freetype/src/sfnt/sfdriver.c
+++ b/src/3rdparty/freetype/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (body). */
/* */
-/* Copyright 1996-2007, 2009-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -266,7 +266,7 @@
{
FT_Stream stream = face->name_table.stream;
FT_String* r = (FT_String*)result;
- FT_Byte* p;
+ FT_Char* p;
if ( FT_STREAM_SEEK( name->stringOffset ) ||
@@ -280,11 +280,11 @@
goto Exit;
}
- p = (FT_Byte*)stream->cursor;
+ p = (FT_Char*)stream->cursor;
for ( ; len > 0; len--, p += 2 )
{
- if ( p[0] == 0 && p[1] >= 32 && p[1] < 128 )
+ if ( p[0] == 0 && p[1] >= 32 )
*r++ = p[1];
}
*r = '\0';
@@ -505,7 +505,9 @@
PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ),
PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
- tt_face_get_metrics
+ tt_face_get_metrics,
+
+ tt_face_get_name
)
diff --git a/src/3rdparty/freetype/src/sfnt/sfdriver.h b/src/3rdparty/freetype/src/sfnt/sfdriver.h
index 5de25d51ca..944119cc22 100644
--- a/src/3rdparty/freetype/src/sfnt/sfdriver.h
+++ b/src/3rdparty/freetype/src/sfnt/sfdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/sferrors.h b/src/3rdparty/freetype/src/sfnt/sferrors.h
index e981e1d26f..e3bef3f743 100644
--- a/src/3rdparty/freetype/src/sfnt/sferrors.h
+++ b/src/3rdparty/freetype/src/sfnt/sferrors.h
@@ -4,7 +4,7 @@
/* */
/* SFNT error codes (specification only). */
/* */
-/* Copyright 2001, 2004, 2012, 2013 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/sfnt.c b/src/3rdparty/freetype/src/sfnt/sfnt.c
index d62ed4e0b5..0b8b5f4578 100644
--- a/src/3rdparty/freetype/src/sfnt/sfnt.c
+++ b/src/3rdparty/freetype/src/sfnt/sfnt.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component. */
/* */
-/* Copyright 1996-2006, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/sfntpic.c b/src/3rdparty/freetype/src/sfnt/sfntpic.c
index b3fb24b3f0..2aaf4bcc40 100644
--- a/src/3rdparty/freetype/src/sfnt/sfntpic.c
+++ b/src/3rdparty/freetype/src/sfnt/sfntpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/sfntpic.h b/src/3rdparty/freetype/src/sfnt/sfntpic.h
index b09a9141e0..d99be6a824 100644
--- a/src/3rdparty/freetype/src/sfnt/sfntpic.h
+++ b/src/3rdparty/freetype/src/sfnt/sfntpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
-/* Copyright 2009, 2012 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,8 +20,6 @@
#define __SFNTPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
@@ -31,7 +29,6 @@ FT_BEGIN_HEADER
#define SFNT_SERVICE_GLYPH_DICT_GET sfnt_service_glyph_dict
#define SFNT_SERVICE_PS_NAME_GET sfnt_service_ps_name
#define TT_SERVICE_CMAP_INFO_GET tt_service_get_cmap_info
-#define SFNT_SERVICES_GET sfnt_services
#define TT_CMAP_CLASSES_GET tt_cmap_classes
#define SFNT_SERVICE_SFNT_TABLE_GET sfnt_service_sfnt_table
#define SFNT_SERVICE_BDF_GET sfnt_service_bdf
@@ -56,6 +53,8 @@ FT_BEGIN_HEADER
#include "ttcmap.h"
+FT_BEGIN_HEADER
+
typedef struct sfntModulePIC_
{
FT_ServiceDescRec* sfnt_services;
@@ -83,8 +82,6 @@ FT_BEGIN_HEADER
( GET_PIC( library )->sfnt_service_ps_name )
#define TT_SERVICE_CMAP_INFO_GET \
( GET_PIC( library )->tt_service_get_cmap_info )
-#define SFNT_SERVICES_GET \
- ( GET_PIC( library )->sfnt_services )
#define TT_CMAP_CLASSES_GET \
( GET_PIC( library )->tt_cmap_classes )
#define SFNT_SERVICE_SFNT_TABLE_GET \
@@ -102,12 +99,13 @@ FT_BEGIN_HEADER
FT_Error
sfnt_module_class_pic_init( FT_Library library );
+
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __SFNTPIC_H__ */
diff --git a/src/3rdparty/freetype/src/sfnt/sfobjs.c b/src/3rdparty/freetype/src/sfnt/sfobjs.c
index 70b988d650..14d3adef21 100644
--- a/src/3rdparty/freetype/src/sfnt/sfobjs.c
+++ b/src/3rdparty/freetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (base). */
/* */
-/* Copyright 1996-2008, 2010-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -120,27 +120,9 @@
FT_Memory memory );
- /*************************************************************************/
- /* */
- /* <Function> */
- /* tt_face_get_name */
- /* */
- /* <Description> */
- /* Returns a given ENGLISH name record in ASCII. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* nameid :: The name id of the name record to return. */
- /* */
- /* <InOut> */
- /* name :: The address of a string pointer. NULL if no name is */
- /* present. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- static FT_Error
+ /* documentation is in sfnt.h */
+
+ FT_LOCAL_DEF( FT_Error )
tt_face_get_name( TT_Face face,
FT_UShort nameid,
FT_String** name )
@@ -376,8 +358,8 @@
FT_FREE( stream->base );
stream->size = 0;
- stream->base = 0;
- stream->close = 0;
+ stream->base = NULL;
+ stream->close = NULL;
}
@@ -580,8 +562,8 @@
table->OrigOffset = sfnt_offset;
/* The offsets must be multiples of 4. */
- woff_offset += ( table->CompLength + 3 ) & ~3;
- sfnt_offset += ( table->OrigLength + 3 ) & ~3;
+ woff_offset += ( table->CompLength + 3 ) & ~3U;
+ sfnt_offset += ( table->OrigLength + 3 ) & ~3U;
}
/*
@@ -609,7 +591,7 @@
if ( woff.privOffset )
{
/* ... if it isn't the last block. */
- woff_offset = ( woff_offset + 3 ) & ~3;
+ woff_offset = ( woff_offset + 3 ) & ~3U;
if ( woff.privOffset != woff_offset ||
woff.privOffset + woff.privLength > woff.length )
@@ -839,13 +821,14 @@
FT_LOCAL_DEF( FT_Error )
sfnt_init_face( FT_Stream stream,
TT_Face face,
- FT_Int face_index,
+ FT_Int face_instance_index,
FT_Int num_params,
FT_Parameter* params )
{
- FT_Error error;
- FT_Library library = face->root.driver->root.library;
- SFNT_Service sfnt;
+ FT_Error error;
+ FT_Library library = face->root.driver->root.library;
+ SFNT_Service sfnt;
+ FT_Int face_index;
/* for now, parameters are unused */
@@ -878,22 +861,65 @@
/* Stream may have changed in sfnt_open_font. */
stream = face->root.stream;
- FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index ));
+ FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_instance_index ));
- if ( face_index < 0 )
- face_index = 0;
+ face_index = FT_ABS( face_instance_index ) & 0xFFFF;
if ( face_index >= face->ttc_header.count )
- return FT_THROW( Invalid_Argument );
+ {
+ if ( face_instance_index >= 0 )
+ return FT_THROW( Invalid_Argument );
+ else
+ face_index = 0;
+ }
if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) )
return error;
- /* check that we have a valid TrueType file */
+ /* check whether we have a valid TrueType file */
error = sfnt->load_font_dir( face, stream );
if ( error )
return error;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ {
+ FT_ULong fvar_len;
+ FT_UShort num_instances;
+ FT_Int instance_index;
+
+
+ instance_index = FT_ABS( face_instance_index ) >> 16;
+
+ /* test whether current face is a GX font with named instances */
+ if ( face->goto_table( face, TTAG_fvar, stream, &fvar_len ) ||
+ fvar_len < 20 ||
+ FT_STREAM_SKIP( 12 ) ||
+ FT_READ_USHORT( num_instances ) )
+ num_instances = 0;
+
+ /* we support at most 2^15 - 1 instances */
+ if ( num_instances >= ( 1U << 15 ) - 1 )
+ {
+ if ( face_instance_index >= 0 )
+ return FT_THROW( Invalid_Argument );
+ else
+ num_instances = 0;
+ }
+
+ /* instance indices in `face_instance_index' start with index 1, */
+ /* thus `>' and not `>=' */
+ if ( instance_index > num_instances )
+ {
+ if ( face_instance_index >= 0 )
+ return FT_THROW( Invalid_Argument );
+ else
+ num_instances = 0;
+ }
+
+ face->root.style_flags = (FT_Long)num_instances << 16;
+ }
+#endif
+
face->root.num_faces = face->ttc_header.count;
face->root.face_index = face_index;
@@ -946,7 +972,7 @@
FT_LOCAL_DEF( FT_Error )
sfnt_load_face( FT_Stream stream,
TT_Face face,
- FT_Int face_index,
+ FT_Int face_instance_index,
FT_Int num_params,
FT_Parameter* params )
{
@@ -962,7 +988,7 @@
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
- FT_UNUSED( face_index );
+ FT_UNUSED( face_instance_index );
/* Check parameters */
@@ -1284,7 +1310,7 @@
flags |= FT_STYLE_FLAG_ITALIC;
}
- root->style_flags = flags;
+ root->style_flags |= flags;
/*********************************************************************/
/* */
@@ -1431,8 +1457,8 @@
root->ascender = face->horizontal.Ascender;
root->descender = face->horizontal.Descender;
- root->height = (FT_Short)( root->ascender - root->descender +
- face->horizontal.Line_Gap );
+ root->height = root->ascender - root->descender +
+ face->horizontal.Line_Gap;
if ( !( root->ascender || root->descender ) )
{
@@ -1443,23 +1469,24 @@
root->ascender = face->os2.sTypoAscender;
root->descender = face->os2.sTypoDescender;
- root->height = (FT_Short)( root->ascender - root->descender +
- face->os2.sTypoLineGap );
+ root->height = root->ascender - root->descender +
+ face->os2.sTypoLineGap;
}
else
{
root->ascender = (FT_Short)face->os2.usWinAscent;
root->descender = -(FT_Short)face->os2.usWinDescent;
- root->height = (FT_UShort)( root->ascender - root->descender );
+ root->height = root->ascender - root->descender;
}
}
}
- root->max_advance_width = face->horizontal.advance_Width_Max;
- root->max_advance_height = (FT_Short)( face->vertical_info
- ? face->vertical.advance_Height_Max
- : root->height );
+ root->max_advance_width =
+ (FT_Short)face->horizontal.advance_Width_Max;
+ root->max_advance_height =
+ (FT_Short)( face->vertical_info ? face->vertical.advance_Height_Max
+ : root->height );
/* See http://www.microsoft.com/OpenType/OTSpec/post.htm -- */
/* Adjust underline position from top edge to centre of */
@@ -1569,7 +1596,7 @@
FT_FREE( face->postscript_name );
- face->sfnt = 0;
+ face->sfnt = NULL;
}
diff --git a/src/3rdparty/freetype/src/sfnt/sfobjs.h b/src/3rdparty/freetype/src/sfnt/sfobjs.h
index 6241c93b39..455f86772f 100644
--- a/src/3rdparty/freetype/src/sfnt/sfobjs.h
+++ b/src/3rdparty/freetype/src/sfnt/sfobjs.h
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,20 +31,25 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
sfnt_init_face( FT_Stream stream,
TT_Face face,
- FT_Int face_index,
+ FT_Int face_instance_index,
FT_Int num_params,
FT_Parameter* params );
FT_LOCAL( FT_Error )
sfnt_load_face( FT_Stream stream,
TT_Face face,
- FT_Int face_index,
+ FT_Int face_instance_index,
FT_Int num_params,
FT_Parameter* params );
FT_LOCAL( void )
sfnt_done_face( TT_Face face );
+ FT_LOCAL( FT_Error )
+ tt_face_get_name( TT_Face face,
+ FT_UShort nameid,
+ FT_String** name );
+
FT_END_HEADER
diff --git a/src/3rdparty/freetype/src/sfnt/ttbdf.c b/src/3rdparty/freetype/src/sfnt/ttbdf.c
index 9401dae5f8..098b781a14 100644
--- a/src/3rdparty/freetype/src/sfnt/ttbdf.c
+++ b/src/3rdparty/freetype/src/sfnt/ttbdf.c
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded BDF properties (body). */
/* */
-/* Copyright 2005, 2006, 2010, 2013 by */
+/* Copyright 2005-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttbdf.h b/src/3rdparty/freetype/src/sfnt/ttbdf.h
index 48a10d6e9b..fe4ba489e8 100644
--- a/src/3rdparty/freetype/src/sfnt/ttbdf.h
+++ b/src/3rdparty/freetype/src/sfnt/ttbdf.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded BDF properties (specification). */
/* */
-/* Copyright 2005 by */
+/* Copyright 2005-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttcmap.c b/src/3rdparty/freetype/src/sfnt/ttcmap.c
index f54de70691..c4d9abdfe6 100644
--- a/src/3rdparty/freetype/src/sfnt/ttcmap.c
+++ b/src/3rdparty/freetype/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2010, 2012-2014 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -51,6 +51,13 @@
#define TT_NEXT_ULONG FT_NEXT_ULONG
+ /* Too large glyph index return values are caught in `FT_Get_Char_Index' */
+ /* and `FT_Get_Next_Char' (the latter calls the internal `next' function */
+ /* again in this case). To mark character code return values as invalid */
+ /* it is sufficient to set the corresponding glyph index return value to */
+ /* zero. */
+
+
FT_CALLBACK_DEF( FT_Error )
tt_cmap_init( TT_CMap cmap,
FT_Byte* table )
@@ -199,7 +206,7 @@
/***** FORMAT 2 *****/
/***** *****/
/***** This is used for certain CJK encodings that encode text in a *****/
- /***** mixed 8/16 bits encoding along the following lines: *****/
+ /***** mixed 8/16 bits encoding along the following lines. *****/
/***** *****/
/***** * Certain byte values correspond to an 8-bit character code *****/
/***** (typically in the range 0..127 for ASCII compatibility). *****/
@@ -209,19 +216,19 @@
/***** second byte of a 2-byte character). *****/
/***** *****/
/***** The following charmap lookup and iteration functions all *****/
- /***** assume that the value "charcode" correspond to following: *****/
+ /***** assume that the value `charcode' fulfills the following. *****/
/***** *****/
- /***** - For one byte characters, "charcode" is simply the *****/
+ /***** - For one byte characters, `charcode' is simply the *****/
/***** character code. *****/
/***** *****/
- /***** - For two byte characters, "charcode" is the 2-byte *****/
- /***** character code in big endian format. More exactly: *****/
+ /***** - For two byte characters, `charcode' is the 2-byte *****/
+ /***** character code in big endian format. More precisely: *****/
/***** *****/
/***** (charcode >> 8) is the first byte value *****/
/***** (charcode & 0xFF) is the second byte value *****/
/***** *****/
- /***** Note that not all values of "charcode" are valid according *****/
- /***** to these rules, and the function moderately check the *****/
+ /***** Note that not all values of `charcode' are valid according *****/
+ /***** to these rules, and the function moderately checks the *****/
/***** arguments. *****/
/***** *****/
/*************************************************************************/
@@ -249,7 +256,7 @@
/* table, i.e., it is the corresponding sub-header index multiplied */
/* by 8. */
/* */
- /* Each sub-header has the following format: */
+ /* Each sub-header has the following format. */
/* */
/* NAME OFFSET TYPE DESCRIPTION */
/* */
@@ -264,11 +271,11 @@
/* according to the specification. */
/* */
/* If a character code is contained within a given sub-header, then */
- /* mapping it to a glyph index is done as follows: */
+ /* mapping it to a glyph index is done as follows. */
/* */
/* * The value of `offset' is read. This is a _byte_ distance from the */
/* location of the `offset' field itself into a slice of the */
- /* `glyph_ids' table. Let's call it `slice' (it is a USHORT[] too). */
+ /* `glyph_ids' table. Let's call it `slice' (it is a USHORT[], too). */
/* */
/* * The value `slice[char.lo - first]' is read. If it is 0, there is */
/* no glyph for the charcode. Otherwise, the value of `delta' is */
@@ -326,7 +333,7 @@
FT_ASSERT( p == table + 518 );
subs = p;
- glyph_ids = subs + (max_subs + 1) * 8;
+ glyph_ids = subs + ( max_subs + 1 ) * 8;
if ( glyph_ids > valid->limit )
FT_INVALID_TOO_SHORT;
@@ -360,7 +367,7 @@
ids = p - 2 + offset;
- if ( ids < glyph_ids || ids + code_count*2 > table + length )
+ if ( ids < glyph_ids || ids + code_count * 2 > table + length )
FT_INVALID_OFFSET;
/* check glyph IDs */
@@ -375,7 +382,7 @@
idx = TT_NEXT_USHORT( p );
if ( idx != 0 )
{
- idx = ( idx + delta ) & 0xFFFFU;
+ idx = (FT_UInt)( (FT_Int)idx + delta ) & 0xFFFFU;
if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )
FT_INVALID_GLYPH_ID;
}
@@ -436,6 +443,7 @@
}
result = sub;
}
+
Exit:
return result;
}
@@ -472,9 +480,10 @@
idx = TT_PEEK_USHORT( p );
if ( idx != 0 )
- result = (FT_UInt)( idx + delta ) & 0xFFFFU;
+ result = (FT_UInt)( (FT_Int)idx + delta ) & 0xFFFFU;
}
}
+
return result;
}
@@ -524,7 +533,7 @@
if ( idx != 0 )
{
- gindex = ( idx + delta ) & 0xFFFFU;
+ gindex = (FT_UInt)( (FT_Int)idx + delta ) & 0xFFFFU;
if ( gindex != 0 )
{
result = charcode;
@@ -786,7 +795,7 @@
if ( gindex != 0 )
{
- gindex = (FT_UInt)( ( gindex + delta ) & 0xFFFFU );
+ gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU;
if ( gindex != 0 )
{
cmap->cur_charcode = charcode;
@@ -800,7 +809,7 @@
{
do
{
- FT_UInt gindex = (FT_UInt)( ( charcode + delta ) & 0xFFFFU );
+ FT_UInt gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU;
if ( gindex != 0 )
@@ -973,7 +982,7 @@
/* segment if it contains only a single character. */
/* */
/* We thus omit the test here, delaying it to the */
- /* routines which actually access the cmap. */
+ /* routines that actually access the cmap. */
else if ( n != num_segs - 1 ||
!( start == 0xFFFFU && end == 0xFFFFU ) )
{
@@ -993,7 +1002,7 @@
idx = FT_NEXT_USHORT( p );
if ( idx != 0 )
{
- idx = (FT_UInt)( idx + delta ) & 0xFFFFU;
+ idx = (FT_UInt)( (FT_Int)idx + delta ) & 0xFFFFU;
if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )
FT_INVALID_GLYPH_ID;
@@ -1026,12 +1035,17 @@
FT_UInt32* pcharcode,
FT_Bool next )
{
+ TT_Face face = (TT_Face)cmap->cmap.charmap.face;
+ FT_Byte* limit = face->cmap_table + face->cmap_size;
+
+
FT_UInt num_segs2, start, end, offset;
FT_Int delta;
FT_UInt i, num_segs;
FT_UInt32 charcode = *pcharcode;
FT_UInt gindex = 0;
FT_Byte* p;
+ FT_Byte* q;
p = cmap->data + 6;
@@ -1045,65 +1059,106 @@
if ( next )
charcode++;
+ if ( charcode > 0xFFFFU )
+ return 0;
+
/* linear search */
- for ( ; charcode <= 0xFFFFU; charcode++ )
- {
- FT_Byte* q;
+ p = cmap->data + 14; /* ends table */
+ q = cmap->data + 16 + num_segs2; /* starts table */
+ for ( i = 0; i < num_segs; i++ )
+ {
+ end = TT_NEXT_USHORT( p );
+ start = TT_NEXT_USHORT( q );
- p = cmap->data + 14; /* ends table */
- q = cmap->data + 16 + num_segs2; /* starts table */
+ if ( charcode < start )
+ {
+ if ( next )
+ charcode = start;
+ else
+ break;
+ }
- for ( i = 0; i < num_segs; i++ )
+ Again:
+ if ( charcode <= end )
{
- end = TT_NEXT_USHORT( p );
- start = TT_NEXT_USHORT( q );
+ FT_Byte* r;
+
- if ( charcode >= start && charcode <= end )
+ r = q - 2 + num_segs2;
+ delta = TT_PEEK_SHORT( r );
+ r += num_segs2;
+ offset = TT_PEEK_USHORT( r );
+
+ /* some fonts have an incorrect last segment; */
+ /* we have to catch it */
+ if ( i >= num_segs - 1 &&
+ start == 0xFFFFU && end == 0xFFFFU )
{
- p = q - 2 + num_segs2;
- delta = TT_PEEK_SHORT( p );
- p += num_segs2;
- offset = TT_PEEK_USHORT( p );
-
- /* some fonts have an incorrect last segment; */
- /* we have to catch it */
- if ( i >= num_segs - 1 &&
- start == 0xFFFFU && end == 0xFFFFU )
+ if ( offset && r + offset + 2 > limit )
{
- TT_Face face = (TT_Face)cmap->cmap.charmap.face;
- FT_Byte* limit = face->cmap_table + face->cmap_size;
+ delta = 1;
+ offset = 0;
+ }
+ }
+ if ( offset == 0xFFFFU )
+ continue;
- if ( offset && p + offset + 2 > limit )
- {
- delta = 1;
- offset = 0;
- }
- }
+ if ( offset )
+ {
+ r += offset + ( charcode - start ) * 2;
- if ( offset == 0xFFFFU )
+ /* if r > limit, the whole segment is invalid */
+ if ( next && r > limit )
continue;
- if ( offset )
+ gindex = TT_PEEK_USHORT( r );
+ if ( gindex )
{
- p += offset + ( charcode - start ) * 2;
- gindex = TT_PEEK_USHORT( p );
- if ( gindex != 0 )
- gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU;
+ gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU;
+ if ( gindex >= (FT_UInt)face->root.num_glyphs )
+ gindex = 0;
}
- else
- gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU;
+ }
+ else
+ {
+ gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU;
- break;
+ if ( next && gindex >= (FT_UInt)face->root.num_glyphs )
+ {
+ /* we have an invalid glyph index; if there is an overflow, */
+ /* we can adjust `charcode', otherwise the whole segment is */
+ /* invalid */
+ gindex = 0;
+
+ if ( (FT_Int)charcode + delta < 0 &&
+ (FT_Int)end + delta >= 0 )
+ charcode = (FT_UInt)( -delta );
+
+ else if ( (FT_Int)charcode + delta < 0x10000L &&
+ (FT_Int)end + delta >= 0x10000L )
+ charcode = (FT_UInt)( 0x10000L - delta );
+
+ else
+ continue;
+ }
+ }
+
+ if ( next && !gindex )
+ {
+ if ( charcode >= 0xFFFFU )
+ break;
+
+ charcode++;
+ goto Again;
}
- }
- if ( !next || gindex )
break;
+ }
}
- if ( next && gindex )
+ if ( next )
*pcharcode = charcode;
return gindex;
@@ -1294,10 +1349,10 @@
p += offset + ( charcode - start ) * 2;
gindex = TT_PEEK_USHORT( p );
if ( gindex != 0 )
- gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU;
+ gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU;
}
else
- gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU;
+ gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU;
break;
}
@@ -1310,7 +1365,6 @@
/* if `charcode' is not in any segment, then `mid' is */
/* the segment nearest to `charcode' */
- /* */
if ( charcode > end )
{
@@ -1443,7 +1497,7 @@
/* */
/* NAME OFFSET TYPE DESCRIPTION */
/* */
- /* format 0 USHORT must be 4 */
+ /* format 0 USHORT must be 6 */
/* length 2 USHORT table length in bytes */
/* language 4 USHORT Mac language code */
/* */
@@ -1511,6 +1565,7 @@
p += 2 * idx;
result = TT_PEEK_USHORT( p );
}
+
return result;
}
@@ -1531,7 +1586,7 @@
if ( char_code >= 0x10000UL )
- goto Exit;
+ return 0;
if ( char_code < start )
char_code = start;
@@ -1547,10 +1602,13 @@
result = char_code;
break;
}
+
+ if ( char_code >= 0xFFFFU )
+ return 0;
+
char_code++;
}
- Exit:
*pchar_code = result;
return gindex;
}
@@ -1602,7 +1660,7 @@
/***** *****/
/***** The purpose of this format is to easily map UTF-16 text to *****/
/***** glyph indices. Basically, the `char_code' must be in one of *****/
- /***** the following formats: *****/
+ /***** the following formats. *****/
/***** *****/
/***** - A 16-bit value that isn't part of the Unicode Surrogates *****/
/***** Area (i.e. U+D800-U+DFFF). *****/
@@ -1615,7 +1673,7 @@
/***** The `is32' table embedded in the charmap indicates whether a *****/
/***** given 16-bit value is in the surrogates area or not. *****/
/***** *****/
- /***** So, for any given `char_code', we can assert the following: *****/
+ /***** So, for any given `char_code', we can assert the following. *****/
/***** *****/
/***** If `char_hi == 0' then we must have `is32[char_lo] == 0'. *****/
/***** *****/
@@ -1770,7 +1828,10 @@
if ( char_code <= end )
{
- result = (FT_UInt)( start_id + char_code - start );
+ if ( start_id > 0xFFFFFFFFUL - ( char_code - start ) )
+ return 0;
+
+ result = (FT_UInt)( start_id + ( char_code - start ) );
break;
}
}
@@ -1782,8 +1843,9 @@
tt_cmap8_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
+ FT_Face face = cmap->cmap.charmap.face;
FT_UInt32 result = 0;
- FT_UInt32 char_code = *pchar_code + 1;
+ FT_UInt32 char_code;
FT_UInt gindex = 0;
FT_Byte* table = cmap->data;
FT_Byte* p = table + 8204;
@@ -1791,6 +1853,11 @@
FT_UInt32 start, end, start_id;
+ if ( *pchar_code >= 0xFFFFFFFFUL )
+ return 0;
+
+ char_code = *pchar_code + 1;
+
p = table + 8208;
for ( ; num_groups > 0; num_groups-- )
@@ -1802,18 +1869,35 @@
if ( char_code < start )
char_code = start;
+ Again:
if ( char_code <= end )
{
- gindex = (FT_UInt)( char_code - start + start_id );
- if ( gindex != 0 )
+ /* ignore invalid group */
+ if ( start_id > 0xFFFFFFFFUL - ( char_code - start ) )
+ continue;
+
+ gindex = (FT_UInt)( start_id + ( char_code - start ) );
+
+ /* does first element of group point to `.notdef' glyph? */
+ if ( gindex == 0 )
{
- result = char_code;
- goto Exit;
+ if ( char_code >= 0xFFFFFFFFUL )
+ break;
+
+ char_code++;
+ goto Again;
}
+
+ /* if `gindex' is invalid, the remaining values */
+ /* in this group are invalid, too */
+ if ( gindex >= (FT_UInt)face->num_glyphs )
+ continue;
+
+ result = char_code;
+ break;
}
}
- Exit:
*pchar_code = result;
return gindex;
}
@@ -1930,14 +2014,20 @@
FT_Byte* p = table + 12;
FT_UInt32 start = TT_NEXT_ULONG( p );
FT_UInt32 count = TT_NEXT_ULONG( p );
- FT_UInt32 idx = (FT_ULong)( char_code - start );
+ FT_UInt32 idx;
+
+
+ if ( char_code < start )
+ return 0;
+ idx = char_code - start;
if ( idx < count )
{
p += 2 * idx;
result = TT_PEEK_USHORT( p );
}
+
return result;
}
@@ -1947,7 +2037,7 @@
FT_UInt32 *pchar_code )
{
FT_Byte* table = cmap->data;
- FT_UInt32 char_code = *pchar_code + 1;
+ FT_UInt32 char_code;
FT_UInt gindex = 0;
FT_Byte* p = table + 12;
FT_UInt32 start = TT_NEXT_ULONG( p );
@@ -1955,10 +2045,15 @@
FT_UInt32 idx;
+ if ( *pchar_code >= 0xFFFFFFFFUL )
+ return 0;
+
+ char_code = *pchar_code + 1;
+
if ( char_code < start )
char_code = start;
- idx = (FT_UInt32)( char_code - start );
+ idx = char_code - start;
p += 2 * idx;
for ( ; idx < count; idx++ )
@@ -1966,6 +2061,10 @@
gindex = TT_NEXT_USHORT( p );
if ( gindex != 0 )
break;
+
+ if ( char_code >= 0xFFFFFFFFUL )
+ return 0;
+
char_code++;
}
@@ -2134,6 +2233,7 @@
static void
tt_cmap12_next( TT_CMap12 cmap )
{
+ FT_Face face = cmap->cmap.cmap.charmap.face;
FT_Byte* p;
FT_ULong start, end, start_id, char_code;
FT_ULong n;
@@ -2155,18 +2255,35 @@
if ( char_code < start )
char_code = start;
- for ( ; char_code <= end; char_code++ )
+ Again:
+ if ( char_code <= end )
{
- gindex = (FT_UInt)( start_id + char_code - start );
+ /* ignore invalid group */
+ if ( start_id > 0xFFFFFFFFUL - ( char_code - start ) )
+ continue;
- if ( gindex )
+ gindex = (FT_UInt)( start_id + ( char_code - start ) );
+
+ /* does first element of group point to `.notdef' glyph? */
+ if ( gindex == 0 )
{
- cmap->cur_charcode = char_code;;
- cmap->cur_gindex = gindex;
- cmap->cur_group = n;
+ if ( char_code >= 0xFFFFFFFFUL )
+ goto Fail;
- return;
+ char_code++;
+ goto Again;
}
+
+ /* if `gindex' is invalid, the remaining values */
+ /* in this group are invalid, too */
+ if ( gindex >= (FT_UInt)face->num_glyphs )
+ continue;
+
+ cmap->cur_charcode = char_code;
+ cmap->cur_gindex = gindex;
+ cmap->cur_group = n;
+
+ return;
}
}
@@ -2196,7 +2313,12 @@
end = 0xFFFFFFFFUL;
if ( next )
+ {
+ if ( char_code >= 0xFFFFFFFFUL )
+ return 0;
+
char_code++;
+ }
min = 0;
max = num_groups;
@@ -2217,20 +2339,24 @@
else
{
start_id = TT_PEEK_ULONG( p );
- gindex = (FT_UInt)( start_id + char_code - start );
+ /* reject invalid glyph index */
+ if ( start_id > 0xFFFFFFFFUL - ( char_code - start ) )
+ gindex = 0;
+ else
+ gindex = (FT_UInt)( start_id + ( char_code - start ) );
break;
}
}
if ( next )
{
+ FT_Face face = cmap->cmap.charmap.face;
TT_CMap12 cmap12 = (TT_CMap12)cmap;
/* if `char_code' is not in any group, then `mid' is */
/* the group nearest to `char_code' */
- /* */
if ( char_code > end )
{
@@ -2243,6 +2369,9 @@
cmap12->cur_charcode = char_code;
cmap12->cur_group = mid;
+ if ( gindex >= (FT_UInt)face->num_glyphs )
+ gindex = 0;
+
if ( !gindex )
{
tt_cmap12_next( cmap12 );
@@ -2253,8 +2382,7 @@
else
cmap12->cur_gindex = gindex;
- if ( gindex )
- *pchar_code = cmap12->cur_charcode;
+ *pchar_code = cmap12->cur_charcode;
}
return gindex;
@@ -2274,11 +2402,8 @@
FT_UInt32 *pchar_code )
{
TT_CMap12 cmap12 = (TT_CMap12)cmap;
- FT_ULong gindex;
-
+ FT_UInt gindex;
- if ( cmap12->cur_charcode >= 0xFFFFFFFFUL )
- return 0;
/* no need to search */
if ( cmap12->valid && cmap12->cur_charcode == *pchar_code )
@@ -2286,11 +2411,8 @@
tt_cmap12_next( cmap12 );
if ( cmap12->valid )
{
- gindex = cmap12->cur_gindex;
-
- /* XXX: check cur_charcode overflow is expected */
- if ( gindex )
- *pchar_code = (FT_UInt32)cmap12->cur_charcode;
+ gindex = cmap12->cur_gindex;
+ *pchar_code = (FT_UInt32)cmap12->cur_charcode;
}
else
gindex = 0;
@@ -2298,8 +2420,7 @@
else
gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );
- /* XXX: check gindex overflow is expected */
- return (FT_UInt32)gindex;
+ return gindex;
}
@@ -2458,6 +2579,7 @@
static void
tt_cmap13_next( TT_CMap13 cmap )
{
+ FT_Face face = cmap->cmap.cmap.charmap.face;
FT_Byte* p;
FT_ULong start, end, glyph_id, char_code;
FT_ULong n;
@@ -2483,9 +2605,9 @@
{
gindex = (FT_UInt)glyph_id;
- if ( gindex )
+ if ( gindex && gindex < (FT_UInt)face->num_glyphs )
{
- cmap->cur_charcode = char_code;;
+ cmap->cur_charcode = char_code;
cmap->cur_gindex = gindex;
cmap->cur_group = n;
@@ -2520,7 +2642,12 @@
end = 0xFFFFFFFFUL;
if ( next )
+ {
+ if ( char_code >= 0xFFFFFFFFUL )
+ return 0;
+
char_code++;
+ }
min = 0;
max = num_groups;
@@ -2548,6 +2675,7 @@
if ( next )
{
+ FT_Face face = cmap->cmap.charmap.face;
TT_CMap13 cmap13 = (TT_CMap13)cmap;
@@ -2565,6 +2693,9 @@
cmap13->cur_charcode = char_code;
cmap13->cur_group = mid;
+ if ( gindex >= (FT_UInt)face->num_glyphs )
+ gindex = 0;
+
if ( !gindex )
{
tt_cmap13_next( cmap13 );
@@ -2575,8 +2706,7 @@
else
cmap13->cur_gindex = gindex;
- if ( gindex )
- *pchar_code = cmap13->cur_charcode;
+ *pchar_code = cmap13->cur_charcode;
}
return gindex;
@@ -2599,18 +2729,14 @@
FT_UInt gindex;
- if ( cmap13->cur_charcode >= 0xFFFFFFFFUL )
- return 0;
-
/* no need to search */
if ( cmap13->valid && cmap13->cur_charcode == *pchar_code )
{
tt_cmap13_next( cmap13 );
if ( cmap13->valid )
{
- gindex = cmap13->cur_gindex;
- if ( gindex )
- *pchar_code = cmap13->cur_charcode;
+ gindex = cmap13->cur_gindex;
+ *pchar_code = cmap13->cur_charcode;
}
else
gindex = 0;
diff --git a/src/3rdparty/freetype/src/sfnt/ttcmap.h b/src/3rdparty/freetype/src/sfnt/ttcmap.h
index 0fde1676bf..b7ea8ee377 100644
--- a/src/3rdparty/freetype/src/sfnt/ttcmap.h
+++ b/src/3rdparty/freetype/src/sfnt/ttcmap.h
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (specification). */
/* */
-/* Copyright 2002-2005, 2009, 2012 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttcmapc.h b/src/3rdparty/freetype/src/sfnt/ttcmapc.h
index 2ea204309c..4a489402cf 100644
--- a/src/3rdparty/freetype/src/sfnt/ttcmapc.h
+++ b/src/3rdparty/freetype/src/sfnt/ttcmapc.h
@@ -4,7 +4,7 @@
/* */
/* TT CMAP classes definitions (specification only). */
/* */
-/* Copyright 2009 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttkern.c b/src/3rdparty/freetype/src/sfnt/ttkern.c
index 455e7b5e3d..4fccc535ce 100644
--- a/src/3rdparty/freetype/src/sfnt/ttkern.c
+++ b/src/3rdparty/freetype/src/sfnt/ttkern.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2007, 2009, 2010, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -108,8 +108,8 @@
p_next = p_limit;
/* only use horizontal kerning tables */
- if ( ( coverage & ~8 ) != 0x0001 ||
- p + 8 > p_limit )
+ if ( ( coverage & ~8U ) != 0x0001 ||
+ p + 8 > p_limit )
goto NextTable;
num_pairs = FT_NEXT_USHORT( p );
diff --git a/src/3rdparty/freetype/src/sfnt/ttkern.h b/src/3rdparty/freetype/src/sfnt/ttkern.h
index df1da9b273..89cb24f07c 100644
--- a/src/3rdparty/freetype/src/sfnt/ttkern.h
+++ b/src/3rdparty/freetype/src/sfnt/ttkern.h
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2001, 2002, 2005, 2007 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttload.c b/src/3rdparty/freetype/src/sfnt/ttload.c
index 8338150abd..c1bd7f0c82 100644
--- a/src/3rdparty/freetype/src/sfnt/ttload.c
+++ b/src/3rdparty/freetype/src/sfnt/ttload.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (body). */
/* */
-/* Copyright 1996-2010, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -151,7 +151,8 @@
/* Here, we */
/* */
- /* - check that `num_tables' is valid (and adjust it if necessary) */
+ /* - check that `num_tables' is valid (and adjust it if necessary); */
+ /* also return the number of valid table entries */
/* */
/* - look for a `head' table, check its size, and parse it to check */
/* whether its `magic' field is correctly set */
@@ -167,7 +168,8 @@
/* */
static FT_Error
check_table_dir( SFNT_Header sfnt,
- FT_Stream stream )
+ FT_Stream stream,
+ FT_UShort* valid )
{
FT_Error error;
FT_UShort nn, valid_entries = 0;
@@ -208,13 +210,27 @@
/* we ignore invalid tables */
- /* table.Offset + table.Length > stream->size ? */
- if ( table.Length > stream->size ||
- table.Offset > stream->size - table.Length )
+ if ( table.Offset > stream->size )
{
FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn ));
continue;
}
+ else if ( table.Length > stream->size - table.Offset )
+ {
+ /* Some tables have such a simple structure that clipping its */
+ /* contents is harmless. This also makes FreeType less sensitive */
+ /* to invalid table lengths (which programs like Acroread seem to */
+ /* ignore in general). */
+
+ if ( table.Tag == TTAG_hmtx ||
+ table.Tag == TTAG_vmtx )
+ valid_entries++;
+ else
+ {
+ FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn ));
+ continue;
+ }
+ }
else
valid_entries++;
@@ -262,11 +278,11 @@
has_meta = 1;
}
- sfnt->num_tables = valid_entries;
+ *valid = valid_entries;
- if ( sfnt->num_tables == 0 )
+ if ( !valid_entries )
{
- FT_TRACE2(( "check_table_dir: no tables found\n" ));
+ FT_TRACE2(( "check_table_dir: no valid tables found\n" ));
error = FT_THROW( Unknown_File_Format );
goto Exit;
}
@@ -322,8 +338,7 @@
SFNT_HeaderRec sfnt;
FT_Error error;
FT_Memory memory = stream->memory;
- TT_TableRec* entry;
- FT_Int nn;
+ FT_UShort nn, valid_entries;
static const FT_Frame_Field offset_table_fields[] =
{
@@ -364,59 +379,114 @@
if ( sfnt.format_tag != TTAG_OTTO )
{
/* check first */
- error = check_table_dir( &sfnt, stream );
+ error = check_table_dir( &sfnt, stream, &valid_entries );
if ( error )
{
FT_TRACE2(( "tt_face_load_font_dir:"
" invalid table directory for TrueType\n" ));
-
goto Exit;
}
}
+ else
+ valid_entries = sfnt.num_tables;
- face->num_tables = sfnt.num_tables;
+ face->num_tables = valid_entries;
face->format_tag = sfnt.format_tag;
if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) )
goto Exit;
- if ( FT_STREAM_SEEK( sfnt.offset + 12 ) ||
- FT_FRAME_ENTER( face->num_tables * 16L ) )
+ if ( FT_STREAM_SEEK( sfnt.offset + 12 ) ||
+ FT_FRAME_ENTER( sfnt.num_tables * 16L ) )
goto Exit;
- entry = face->dir_tables;
-
FT_TRACE2(( "\n"
" tag offset length checksum\n"
" ----------------------------------\n" ));
+ valid_entries = 0;
for ( nn = 0; nn < sfnt.num_tables; nn++ )
{
- entry->Tag = FT_GET_TAG4();
- entry->CheckSum = FT_GET_ULONG();
- entry->Offset = FT_GET_ULONG();
- entry->Length = FT_GET_ULONG();
+ TT_TableRec entry;
+ FT_UShort i;
+ FT_Bool duplicate;
- /* ignore invalid tables */
- /* entry->Offset + entry->Length > stream->size ? */
- if ( entry->Length > stream->size ||
- entry->Offset > stream->size - entry->Length )
+ entry.Tag = FT_GET_TAG4();
+ entry.CheckSum = FT_GET_ULONG();
+ entry.Offset = FT_GET_ULONG();
+ entry.Length = FT_GET_ULONG();
+
+ /* ignore invalid tables that can't be sanitized */
+
+ if ( entry.Offset > stream->size )
continue;
+ else if ( entry.Length > stream->size - entry.Offset )
+ {
+ if ( entry.Tag == TTAG_hmtx ||
+ entry.Tag == TTAG_vmtx )
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_ULong old_length = entry.Length;
+#endif
+
+
+ /* make metrics table length a multiple of 4 */
+ entry.Length = ( stream->size - entry.Offset ) & ~3U;
+
+ FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx"
+ " (sanitized; original length %08lx)",
+ (FT_Char)( entry.Tag >> 24 ),
+ (FT_Char)( entry.Tag >> 16 ),
+ (FT_Char)( entry.Tag >> 8 ),
+ (FT_Char)( entry.Tag ),
+ entry.Offset,
+ entry.Length,
+ entry.CheckSum,
+ old_length ));
+ }
+ else
+ continue;
+ }
+#ifdef FT_DEBUG_LEVEL_TRACE
else
+ FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx",
+ (FT_Char)( entry.Tag >> 24 ),
+ (FT_Char)( entry.Tag >> 16 ),
+ (FT_Char)( entry.Tag >> 8 ),
+ (FT_Char)( entry.Tag ),
+ entry.Offset,
+ entry.Length,
+ entry.CheckSum ));
+#endif
+
+ /* ignore duplicate tables – the first one wins */
+ duplicate = 0;
+ for ( i = 0; i < valid_entries; i++ )
{
- FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx\n",
- (FT_Char)( entry->Tag >> 24 ),
- (FT_Char)( entry->Tag >> 16 ),
- (FT_Char)( entry->Tag >> 8 ),
- (FT_Char)( entry->Tag ),
- entry->Offset,
- entry->Length,
- entry->CheckSum ));
- entry++;
+ if ( face->dir_tables[i].Tag == entry.Tag )
+ {
+ duplicate = 1;
+ break;
+ }
+ }
+ if ( duplicate )
+ {
+ FT_TRACE2(( " (duplicate, ignored)\n" ));
+ continue;
+ }
+ else
+ {
+ FT_TRACE2(( "\n" ));
+
+ /* we finally have a valid entry */
+ face->dir_tables[valid_entries++] = entry;
}
}
+ /* final adjustment to number of tables */
+ face->num_tables = valid_entries;
+
FT_FRAME_EXIT();
FT_TRACE2(( "table directory loaded\n\n" ));
diff --git a/src/3rdparty/freetype/src/sfnt/ttload.h b/src/3rdparty/freetype/src/sfnt/ttload.h
index 49a1aee163..a6d91c5b70 100644
--- a/src/3rdparty/freetype/src/sfnt/ttload.h
+++ b/src/3rdparty/freetype/src/sfnt/ttload.h
@@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2005, 2006 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttmtx.c b/src/3rdparty/freetype/src/sfnt/ttmtx.c
index bb319577e2..58309aa496 100644
--- a/src/3rdparty/freetype/src/sfnt/ttmtx.c
+++ b/src/3rdparty/freetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (body). */
/* */
-/* Copyright 2006-2009, 2011-2014 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttmtx.h b/src/3rdparty/freetype/src/sfnt/ttmtx.h
index fb040394c0..096ee062cf 100644
--- a/src/3rdparty/freetype/src/sfnt/ttmtx.h
+++ b/src/3rdparty/freetype/src/sfnt/ttmtx.h
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (specification). */
/* */
-/* Copyright 2006, 2014 by */
+/* Copyright 2006-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttpost.c b/src/3rdparty/freetype/src/sfnt/ttpost.c
index 99d800549f..8d29d1e9f6 100644
--- a/src/3rdparty/freetype/src/sfnt/ttpost.c
+++ b/src/3rdparty/freetype/src/sfnt/ttpost.c
@@ -5,7 +5,7 @@
/* Postcript name table processing for TrueType and OpenType fonts */
/* (body). */
/* */
-/* Copyright 1996-2003, 2006-2010, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -52,7 +52,7 @@
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
-#define MAC_NAME( x ) ( (FT_String*)psnames->macintosh_name( x ) )
+#define MAC_NAME( x ) (FT_String*)psnames->macintosh_name( (FT_UInt)(x) )
#else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
@@ -62,7 +62,7 @@
/* table of Mac names. Thus, it is possible to build a version of */
/* FreeType without the Type 1 driver & PSNames module. */
-#define MAC_NAME( x ) ( (FT_String*)tt_post_default_names[x] )
+#define MAC_NAME( x ) (FT_String*)tt_post_default_names[x]
/* the 258 default Mac PS glyph names; see file `tools/glnames.py' */
@@ -155,7 +155,7 @@
static FT_Error
load_format_20( TT_Face face,
FT_Stream stream,
- FT_Long post_limit )
+ FT_ULong post_limit )
{
FT_Memory memory = stream->memory;
FT_Error error;
@@ -163,8 +163,8 @@
FT_Int num_glyphs;
FT_UShort num_names;
- FT_UShort* glyph_indices = 0;
- FT_Char** name_strings = 0;
+ FT_UShort* glyph_indices = NULL;
+ FT_Char** name_strings = NULL;
if ( FT_READ_USHORT( num_glyphs ) )
@@ -243,14 +243,17 @@
goto Fail1;
}
- if ( (FT_Int)len > post_limit ||
- FT_STREAM_POS() > post_limit - (FT_Int)len )
+ if ( len > post_limit ||
+ FT_STREAM_POS() > post_limit - len )
{
+ FT_Int d = (FT_Int)post_limit - (FT_Int)FT_STREAM_POS();
+
+
FT_ERROR(( "load_format_20:"
" exceeding string length (%d),"
" truncating at end of post table (%d byte left)\n",
- len, post_limit - FT_STREAM_POS() ));
- len = FT_MAX( 0, post_limit - FT_STREAM_POS() );
+ len, d ));
+ len = (FT_UInt)FT_MAX( 0, d );
}
if ( FT_NEW_ARRAY( name_strings[n], len + 1 ) ||
@@ -307,13 +310,13 @@
static FT_Error
load_format_25( TT_Face face,
FT_Stream stream,
- FT_Long post_limit )
+ FT_ULong post_limit )
{
FT_Memory memory = stream->memory;
FT_Error error;
FT_Int num_glyphs;
- FT_Char* offset_table = 0;
+ FT_Char* offset_table = NULL;
FT_UNUSED( post_limit );
@@ -377,7 +380,7 @@
FT_Error error;
FT_Fixed format;
FT_ULong post_len;
- FT_Long post_limit;
+ FT_ULong post_limit;
/* get a stream for the face's resource */
@@ -547,10 +550,7 @@
}
if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */
- {
- idx += table->offsets[idx];
- *PSname = MAC_NAME( idx );
- }
+ *PSname = MAC_NAME( (FT_Int)idx + table->offsets[idx] );
}
/* nothing to do for format == 0x00030000L */
diff --git a/src/3rdparty/freetype/src/sfnt/ttpost.h b/src/3rdparty/freetype/src/sfnt/ttpost.h
index 6f06d75a71..e3eca02c62 100644
--- a/src/3rdparty/freetype/src/sfnt/ttpost.h
+++ b/src/3rdparty/freetype/src/sfnt/ttpost.h
@@ -5,7 +5,7 @@
/* Postcript name table processing for TrueType and OpenType fonts */
/* (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/sfnt/ttsbit.c b/src/3rdparty/freetype/src/sfnt/ttsbit.c
index c2db96c6d8..3b351ecfce 100644
--- a/src/3rdparty/freetype/src/sfnt/ttsbit.c
+++ b/src/3rdparty/freetype/src/sfnt/ttsbit.c
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (body). */
/* */
-/* Copyright 2005-2009, 2013, 2014 by */
+/* Copyright 2005-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Copyright 2013 by Google, Inc. */
@@ -101,10 +101,10 @@
p = face->sbit_table;
- version = FT_NEXT_ULONG( p );
+ version = FT_NEXT_LONG( p );
num_strikes = FT_NEXT_ULONG( p );
- if ( ( version & 0xFFFF0000UL ) != 0x00020000UL )
+ if ( ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00020000UL )
{
error = FT_THROW( Unknown_File_Format );
goto Exit;
@@ -254,15 +254,15 @@
metrics->x_ppem = (FT_UShort)strike[44];
metrics->y_ppem = (FT_UShort)strike[45];
- metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */
- metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */
+ metrics->ascender = (FT_Char)strike[16] * 64; /* hori.ascender */
+ metrics->descender = (FT_Char)strike[17] * 64; /* hori.descender */
metrics->height = metrics->ascender - metrics->descender;
/* Is this correct? */
metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */
strike[18] + /* max_width */
(FT_Char)strike[23] /* min_advance_SB */
- ) << 6;
+ ) * 64;
return FT_Err_Ok;
}
@@ -273,6 +273,7 @@
FT_UShort ppem, resolution;
TT_HoriHeader *hori;
FT_ULong table_size;
+ FT_Pos ppem_, upem_; /* to reduce casts */
FT_Error error;
FT_Byte* p;
@@ -305,12 +306,15 @@
metrics->x_ppem = ppem;
metrics->y_ppem = ppem;
- metrics->ascender = ppem * hori->Ascender * 64 / upem;
- metrics->descender = ppem * hori->Descender * 64 / upem;
- metrics->height = ppem * ( hori->Ascender -
- hori->Descender +
- hori->Line_Gap ) * 64 / upem;
- metrics->max_advance = ppem * hori->advance_Width_Max * 64 / upem;
+ ppem_ = (FT_Pos)ppem;
+ upem_ = (FT_Pos)upem;
+
+ metrics->ascender = ppem_ * hori->Ascender * 64 / upem_;
+ metrics->descender = ppem_ * hori->Descender * 64 / upem_;
+ metrics->height = ppem_ * ( hori->Ascender -
+ hori->Descender +
+ hori->Line_Gap ) * 64 / upem_;
+ metrics->max_advance = ppem_ * hori->advance_Width_Max * 64 / upem_;
return error;
}
@@ -420,7 +424,7 @@
FT_Error error = FT_Err_Ok;
FT_UInt width, height;
FT_Bitmap* map = decoder->bitmap;
- FT_Long size;
+ FT_ULong size;
if ( !decoder->metrics_loaded )
@@ -432,38 +436,38 @@
width = decoder->metrics->width;
height = decoder->metrics->height;
- map->width = (int)width;
- map->rows = (int)height;
+ map->width = width;
+ map->rows = height;
switch ( decoder->bit_depth )
{
case 1:
map->pixel_mode = FT_PIXEL_MODE_MONO;
- map->pitch = ( map->width + 7 ) >> 3;
+ map->pitch = (int)( ( map->width + 7 ) >> 3 );
map->num_grays = 2;
break;
case 2:
map->pixel_mode = FT_PIXEL_MODE_GRAY2;
- map->pitch = ( map->width + 3 ) >> 2;
+ map->pitch = (int)( ( map->width + 3 ) >> 2 );
map->num_grays = 4;
break;
case 4:
map->pixel_mode = FT_PIXEL_MODE_GRAY4;
- map->pitch = ( map->width + 1 ) >> 1;
+ map->pitch = (int)( ( map->width + 1 ) >> 1 );
map->num_grays = 16;
break;
case 8:
map->pixel_mode = FT_PIXEL_MODE_GRAY;
- map->pitch = map->width;
+ map->pitch = (int)( map->width );
map->num_grays = 256;
break;
case 32:
map->pixel_mode = FT_PIXEL_MODE_BGRA;
- map->pitch = map->width * 4;
+ map->pitch = (int)( map->width * 4 );
map->num_grays = 256;
break;
@@ -472,7 +476,7 @@
goto Exit;
}
- size = map->rows * map->pitch;
+ size = map->rows * (FT_ULong)map->pitch;
/* check that there is no empty image */
if ( size == 0 )
@@ -561,7 +565,8 @@
{
FT_Error error = FT_Err_Ok;
FT_Byte* line;
- FT_Int bit_height, bit_width, pitch, width, height, line_bits, h;
+ FT_Int pitch, width, height, line_bits, h;
+ FT_UInt bit_height, bit_width;
FT_Bitmap* bitmap;
@@ -577,8 +582,8 @@
line_bits = width * decoder->bit_depth;
- if ( x_pos < 0 || x_pos + width > bit_width ||
- y_pos < 0 || y_pos + height > bit_height )
+ if ( x_pos < 0 || (FT_UInt)( x_pos + width ) > bit_width ||
+ y_pos < 0 || (FT_UInt)( y_pos + height ) > bit_height )
{
FT_TRACE1(( "tt_sbit_decoder_load_byte_aligned:"
" invalid bitmap dimensions\n" ));
@@ -699,7 +704,8 @@
{
FT_Error error = FT_Err_Ok;
FT_Byte* line;
- FT_Int bit_height, bit_width, pitch, width, height, line_bits, h, nbits;
+ FT_Int pitch, width, height, line_bits, h, nbits;
+ FT_UInt bit_height, bit_width;
FT_Bitmap* bitmap;
FT_UShort rval;
@@ -716,8 +722,8 @@
line_bits = width * decoder->bit_depth;
- if ( x_pos < 0 || x_pos + width > bit_width ||
- y_pos < 0 || y_pos + height > bit_height )
+ if ( x_pos < 0 || (FT_UInt)( x_pos + width ) > bit_width ||
+ y_pos < 0 || (FT_UInt)( y_pos + height ) > bit_height )
{
FT_TRACE1(( "tt_sbit_decoder_load_bit_aligned:"
" invalid bitmap dimensions\n" ));
@@ -1379,9 +1385,9 @@
metrics->horiBearingX = (FT_Short)originOffsetX;
metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height );
- metrics->horiAdvance = (FT_Short)( aadvance *
- face->root.size->metrics.x_ppem /
- face->header.Units_Per_EM );
+ metrics->horiAdvance = (FT_UShort)( aadvance *
+ face->root.size->metrics.x_ppem /
+ face->header.Units_Per_EM );
}
return error;
@@ -1442,7 +1448,7 @@
FT_Library library = face->root.glyph->library;
- FT_Bitmap_New( &new_map );
+ FT_Bitmap_Init( &new_map );
/* Convert to 8bit grayscale. */
error = FT_Bitmap_Convert( library, map, &new_map, 1 );
diff --git a/src/3rdparty/freetype/src/sfnt/ttsbit.h b/src/3rdparty/freetype/src/sfnt/ttsbit.h
index 695d0d8d02..d4e13aefb8 100644
--- a/src/3rdparty/freetype/src/sfnt/ttsbit.h
+++ b/src/3rdparty/freetype/src/sfnt/ttsbit.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (specification). */
/* */
-/* Copyright 1996-2008, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/smooth/Jamfile b/src/3rdparty/freetype/src/smooth/Jamfile
index a8496aa2c2..b1887c2c6e 100644
--- a/src/3rdparty/freetype/src/smooth/Jamfile
+++ b/src/3rdparty/freetype/src/smooth/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/smooth Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,10 @@ SubDir FT2_TOP $(FT2_SRC_DIR) smooth ;
if $(FT2_MULTI)
{
- _sources = ftgrays ftsmooth ftspic ;
+ _sources = ftgrays
+ ftsmooth
+ ftspic
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/smooth/ftgrays.c b/src/3rdparty/freetype/src/smooth/ftgrays.c
index 131ad27a0c..ba2944559c 100644
--- a/src/3rdparty/freetype/src/smooth/ftgrays.c
+++ b/src/3rdparty/freetype/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000-2003, 2005-2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,8 +24,8 @@
/* */
/* - copy `src/smooth/ftgrays.c' (this file) to your current directory */
/* */
- /* - copy `include/ftimage.h' and `src/smooth/ftgrays.h' to the same */
- /* directory */
+ /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */
+ /* same directory */
/* */
/* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */
/* */
@@ -94,6 +94,11 @@
#ifdef _STANDALONE_
+ /* The size in bytes of the render pool used by the scan-line converter */
+ /* to do all of its work. */
+#define FT_RENDER_POOL_SIZE 16384L
+
+
/* Auxiliary macros for token concatenation. */
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
@@ -101,6 +106,21 @@
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
+#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
+#define 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 FT_HYPOT( x, y ) \
+ ( x = FT_ABS( x ), \
+ y = FT_ABS( y ), \
+ x > y ? x + ( 3 * y >> 3 ) \
+ : y + ( 3 * x >> 3 ) )
+
/* define this to dump debugging information */
/* #define FT_DEBUG_LEVEL_TRACE */
@@ -297,7 +317,6 @@ typedef ptrdiff_t FT_PtrDist;
#undef SCALED
#define ONE_PIXEL ( 1L << PIXEL_BITS )
-#define PIXEL_MASK ( -1L << PIXEL_BITS )
#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) )
#define SUBPIXELS( x ) ( (TPos)(x) << PIXEL_BITS )
#define FLOOR( x ) ( (x) & -ONE_PIXEL )
@@ -420,11 +439,8 @@ typedef ptrdiff_t FT_PtrDist;
FT_PtrDist max_cells;
FT_PtrDist num_cells;
- TCoord cx, cy;
TPos x, y;
- TPos last_ey;
-
FT_Vector bez_stack[32 * 3 + 1];
int lev_stack[32];
@@ -464,11 +480,7 @@ typedef ptrdiff_t FT_PtrDist;
typedef struct gray_TRaster_
{
- void* buffer;
- long buffer_size;
- int band_size;
void* memory;
- gray_PWorker worker;
} gray_TRaster, *gray_PRaster;
@@ -480,7 +492,7 @@ typedef ptrdiff_t FT_PtrDist;
/* */
static void
gray_init_cells( RAS_ARG_ void* buffer,
- long byte_size )
+ long byte_size )
{
ras.buffer = buffer;
ras.buffer_size = byte_size;
@@ -638,8 +650,8 @@ typedef ptrdiff_t FT_PtrDist;
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 );
}
@@ -661,7 +673,6 @@ typedef ptrdiff_t FT_PtrDist;
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 );
@@ -742,7 +753,7 @@ typedef ptrdiff_t FT_PtrDist;
mod -= (int)dx;
- while ( ex1 != ex2 )
+ do
{
delta = lift;
mod += rem;
@@ -757,7 +768,7 @@ typedef ptrdiff_t FT_PtrDist;
y1 += delta;
ex1 += incr;
gray_set_cell( RAS_VAR_ ex1, ey );
- }
+ } while ( ex1 != ex2 );
}
delta = y2 - y1;
@@ -780,29 +791,18 @@ typedef ptrdiff_t FT_PtrDist;
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;
/* 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 )
@@ -880,7 +880,7 @@ typedef ptrdiff_t FT_PtrDist;
FT_DIV_MOD( int, p, dy, lift, rem );
mod -= (int)dy;
- while ( ey1 != ey2 )
+ do
{
delta = lift;
mod += rem;
@@ -898,7 +898,7 @@ typedef ptrdiff_t FT_PtrDist;
ey1 += incr;
gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );
- }
+ } while ( ey1 != ey2 );
}
gray_render_scanline( RAS_VAR_ ey1, x,
@@ -908,7 +908,6 @@ typedef ptrdiff_t FT_PtrDist;
End:
ras.x = to_x;
ras.y = to_y;
- ras.last_ey = SUBPIXELS( ey2 );
}
@@ -1212,7 +1211,7 @@ typedef ptrdiff_t FT_PtrDist;
/* first of all, compute the scanline offset */
p = (unsigned char*)map->buffer - y * map->pitch;
if ( map->pitch >= 0 )
- p += (unsigned)( ( map->rows - 1 ) * map->pitch );
+ p += ( map->rows - 1 ) * (unsigned int)map->pitch;
for ( ; count > 0; count--, spans++ )
{
@@ -1744,14 +1743,17 @@ typedef ptrdiff_t FT_PtrDist;
} gray_TBand;
- FT_DEFINE_OUTLINE_FUNCS(func_interface,
- (FT_Outline_MoveTo_Func) gray_move_to,
- (FT_Outline_LineTo_Func) gray_line_to,
- (FT_Outline_ConicTo_Func)gray_conic_to,
- (FT_Outline_CubicTo_Func)gray_cubic_to,
- 0,
- 0
- )
+
+ FT_DEFINE_OUTLINE_FUNCS(
+ func_interface,
+
+ (FT_Outline_MoveTo_Func) gray_move_to,
+ (FT_Outline_LineTo_Func) gray_line_to,
+ (FT_Outline_ConicTo_Func)gray_conic_to,
+ (FT_Outline_CubicTo_Func)gray_cubic_to,
+ 0,
+ 0 )
+
static int
gray_convert_glyph_inner( RAS_ARG )
@@ -1828,7 +1830,7 @@ typedef ptrdiff_t FT_PtrDist;
bands[0].max = max;
band = bands;
- while ( band >= bands )
+ do
{
TPos bottom, top, middle;
int error;
@@ -1842,13 +1844,13 @@ typedef ptrdiff_t FT_PtrDist;
ras.ycells = (PCell*)ras.buffer;
ras.ycount = band->max - band->min;
- cell_start = sizeof ( PCell ) * ras.ycount;
- cell_mod = cell_start % sizeof ( TCell );
+ cell_start = (long)sizeof ( PCell ) * ras.ycount;
+ cell_mod = cell_start % (long)sizeof ( TCell );
if ( cell_mod > 0 )
- cell_start += sizeof ( TCell ) - cell_mod;
+ cell_start += (long)sizeof ( TCell ) - cell_mod;
cell_end = ras.buffer_size;
- cell_end -= cell_end % sizeof ( TCell );
+ cell_end -= cell_end % (long)sizeof ( TCell );
cells_max = (PCell)( (char*)ras.buffer + cell_end );
ras.cells = (PCell)( (char*)ras.buffer + cell_start );
@@ -1904,7 +1906,7 @@ typedef ptrdiff_t FT_PtrDist;
band[0].min = middle;
band[0].max = top;
band++;
- }
+ } while ( band >= bands );
}
if ( ras.band_shoot > 8 && ras.band_size > 16 )
@@ -1918,12 +1920,18 @@ typedef ptrdiff_t FT_PtrDist;
gray_raster_render( gray_PRaster raster,
const FT_Raster_Params* params )
{
- const FT_Outline* outline = (const FT_Outline*)params->source;
- const FT_Bitmap* target_map = params->target;
- gray_PWorker worker;
+ const FT_Outline* outline = (const FT_Outline*)params->source;
+ const FT_Bitmap* target_map = params->target;
+
+ gray_TWorker worker[1];
+
+ TCell buffer[FT_MAX( FT_RENDER_POOL_SIZE, 2048 ) / sizeof ( TCell )];
+ long buffer_size = sizeof ( buffer );
+ int band_size = (int)( buffer_size /
+ (long)( sizeof ( TCell ) * 8 ) );
- if ( !raster || !raster->buffer || !raster->buffer_size )
+ if ( !raster )
return FT_THROW( Invalid_Argument );
if ( !outline )
@@ -1940,8 +1948,6 @@ typedef ptrdiff_t FT_PtrDist;
outline->contours[outline->n_contours - 1] + 1 )
return FT_THROW( Invalid_Outline );
- worker = raster->worker;
-
/* if direct mode is not set, we must have a target bitmap */
if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
{
@@ -1966,8 +1972,8 @@ typedef ptrdiff_t FT_PtrDist;
/* compute clip box from target pixmap */
ras.clip_box.xMin = 0;
ras.clip_box.yMin = 0;
- ras.clip_box.xMax = target_map->width;
- ras.clip_box.yMax = target_map->rows;
+ ras.clip_box.xMax = (FT_Pos)target_map->width;
+ ras.clip_box.yMax = (FT_Pos)target_map->rows;
}
else if ( params->flags & FT_RASTER_FLAG_CLIP )
ras.clip_box = params->clip_box;
@@ -1979,13 +1985,14 @@ typedef ptrdiff_t FT_PtrDist;
ras.clip_box.yMax = 32767L;
}
- gray_init_cells( RAS_VAR_ raster->buffer, raster->buffer_size );
+ gray_init_cells( RAS_VAR_ buffer, buffer_size );
ras.outline = *outline;
ras.num_cells = 0;
ras.invalid = 1;
- ras.band_size = raster->band_size;
+ ras.band_size = band_size;
ras.num_gray_spans = 0;
+ ras.span_y = 0;
if ( params->flags & FT_RASTER_FLAG_DIRECT )
{
@@ -2069,34 +2076,9 @@ typedef ptrdiff_t FT_PtrDist;
char* pool_base,
long pool_size )
{
- gray_PRaster rast = (gray_PRaster)raster;
-
-
- if ( raster )
- {
- if ( pool_base && pool_size >= (long)sizeof ( gray_TWorker ) + 2048 )
- {
- gray_PWorker worker = (gray_PWorker)pool_base;
-
-
- rast->worker = worker;
- rast->buffer = pool_base +
- ( ( sizeof ( gray_TWorker ) +
- sizeof ( TCell ) - 1 ) &
- ~( sizeof ( TCell ) - 1 ) );
- rast->buffer_size = (long)( ( pool_base + pool_size ) -
- (char*)rast->buffer ) &
- ~( sizeof ( TCell ) - 1 );
- rast->band_size = (int)( rast->buffer_size /
- ( sizeof ( TCell ) * 8 ) );
- }
- else
- {
- rast->buffer = NULL;
- rast->buffer_size = 0;
- rast->worker = NULL;
- }
- }
+ FT_UNUSED( raster );
+ FT_UNUSED( pool_base );
+ FT_UNUSED( pool_size );
}
@@ -2114,15 +2096,16 @@ typedef ptrdiff_t FT_PtrDist;
}
- FT_DEFINE_RASTER_FUNCS(ft_grays_raster,
+ FT_DEFINE_RASTER_FUNCS(
+ ft_grays_raster,
+
FT_GLYPH_FORMAT_OUTLINE,
(FT_Raster_New_Func) gray_raster_new,
(FT_Raster_Reset_Func) gray_raster_reset,
(FT_Raster_Set_Mode_Func)gray_raster_set_mode,
(FT_Raster_Render_Func) gray_raster_render,
- (FT_Raster_Done_Func) gray_raster_done
- )
+ (FT_Raster_Done_Func) gray_raster_done )
/* END */
diff --git a/src/3rdparty/freetype/src/smooth/ftgrays.h b/src/3rdparty/freetype/src/smooth/ftgrays.h
index f20f55f14b..1b5760330c 100644
--- a/src/3rdparty/freetype/src/smooth/ftgrays.h
+++ b/src/3rdparty/freetype/src/smooth/ftgrays.h
@@ -4,7 +4,7 @@
/* */
/* FreeType smooth renderer declaration */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/smooth/ftsmerrs.h b/src/3rdparty/freetype/src/smooth/ftsmerrs.h
index 413d2f1f70..cc38aa1996 100644
--- a/src/3rdparty/freetype/src/smooth/ftsmerrs.h
+++ b/src/3rdparty/freetype/src/smooth/ftsmerrs.h
@@ -4,7 +4,7 @@
/* */
/* smooth renderer error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/smooth/ftsmooth.c b/src/3rdparty/freetype/src/smooth/ftsmooth.c
index 4e2dee562b..3620550534 100644
--- a/src/3rdparty/freetype/src/smooth/ftsmooth.c
+++ b/src/3rdparty/freetype/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2006, 2009-2013 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -230,7 +230,7 @@
}
/* allocate new one */
- if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
+ if ( FT_ALLOC( bitmap->buffer, (FT_ULong)( pitch * height ) ) )
goto Exit;
else
have_buffer = TRUE;
@@ -243,8 +243,8 @@
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
bitmap->num_grays = 256;
- bitmap->width = width;
- bitmap->rows = height;
+ bitmap->width = (unsigned int)width;
+ bitmap->rows = (unsigned int)height;
bitmap->pitch = pitch;
/* translate outline to render it into the bitmap */
diff --git a/src/3rdparty/freetype/src/smooth/ftsmooth.h b/src/3rdparty/freetype/src/smooth/ftsmooth.h
index 3708790df1..765018c239 100644
--- a/src/3rdparty/freetype/src/smooth/ftsmooth.h
+++ b/src/3rdparty/freetype/src/smooth/ftsmooth.h
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/smooth/ftspic.c b/src/3rdparty/freetype/src/smooth/ftspic.c
index 67a2b8310c..8e6ed57eec 100644
--- a/src/3rdparty/freetype/src/smooth/ftspic.c
+++ b/src/3rdparty/freetype/src/smooth/ftspic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for smooth module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/smooth/ftspic.h b/src/3rdparty/freetype/src/smooth/ftspic.h
index 334b51c3f1..071afcff20 100644
--- a/src/3rdparty/freetype/src/smooth/ftspic.h
+++ b/src/3rdparty/freetype/src/smooth/ftspic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for smooth module. */
/* */
-/* Copyright 2009 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,10 +20,11 @@
#define __FTSPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
+
+FT_BEGIN_HEADER
+
#ifndef FT_CONFIG_OPTION_PIC
#define FT_GRAYS_RASTER_GET ft_grays_raster
diff --git a/src/3rdparty/freetype/src/smooth/module.mk b/src/3rdparty/freetype/src/smooth/module.mk
index 47f6c04076..740936f5b1 100644
--- a/src/3rdparty/freetype/src/smooth/module.mk
+++ b/src/3rdparty/freetype/src/smooth/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/smooth/rules.mk b/src/3rdparty/freetype/src/smooth/rules.mk
index 88d0aa53ac..f00ebd5f15 100644
--- a/src/3rdparty/freetype/src/smooth/rules.mk
+++ b/src/3rdparty/freetype/src/smooth/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001, 2003, 2011 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -17,9 +17,13 @@
#
SMOOTH_DIR := $(SRC_DIR)/smooth
+
# compilation flags for the driver
#
-SMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR))
+SMOOTH_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# smooth driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/smooth/smooth.c b/src/3rdparty/freetype/src/smooth/smooth.c
index a8ac51f9f8..4ca4344c89 100644
--- a/src/3rdparty/freetype/src/smooth/smooth.c
+++ b/src/3rdparty/freetype/src/smooth/smooth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType anti-aliasing rasterer module component (body only). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/tools/afblue.pl b/src/3rdparty/freetype/src/tools/afblue.pl
index 60fe6966a8..56b6452348 100644
--- a/src/3rdparty/freetype/src/tools/afblue.pl
+++ b/src/3rdparty/freetype/src/tools/afblue.pl
@@ -5,7 +5,7 @@
#
# Process a blue zone character data file.
#
-# Copyright 2013, 2014 by
+# Copyright 2013-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/src/tools/apinames.c b/src/3rdparty/freetype/src/tools/apinames.c
index c85df721a0..9f81b1a6c7 100644
--- a/src/3rdparty/freetype/src/tools/apinames.c
+++ b/src/3rdparty/freetype/src/tools/apinames.c
@@ -10,7 +10,7 @@
* accepted if you are using GCC for compilation (and probably by
* other compilers too).
*
- * Author: David Turner, 2005, 2006, 2008-2013
+ * Author: David Turner, 2005, 2006, 2008-2013, 2015
*
* This code is explicitly placed into the public domain.
*
@@ -156,6 +156,7 @@ names_dump( FILE* out,
case OUTPUT_WATCOM_LBC:
{
const char* dot;
+ char temp[512];
if ( dll_name == NULL )
@@ -169,8 +170,7 @@ names_dump( FILE* out,
dot = strchr( dll_name, '.' );
if ( dot != NULL )
{
- char temp[512];
- int len = dot - dll_name;
+ int len = dot - dll_name;
if ( len > (int)( sizeof ( temp ) - 1 ) )
diff --git a/src/3rdparty/freetype/src/tools/chktrcmp.py b/src/3rdparty/freetype/src/tools/chktrcmp.py
index ce6500c7e2..4c40bdafdb 100644
--- a/src/3rdparty/freetype/src/tools/chktrcmp.py
+++ b/src/3rdparty/freetype/src/tools/chktrcmp.py
@@ -15,7 +15,7 @@ USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
-TRACE_DEF_FILES = [ "include/internal/fttrace.h" ]
+TRACE_DEF_FILES = [ "include/freetype/internal/fttrace.h" ]
# --------------------------------------------------------------
diff --git a/src/3rdparty/freetype/src/tools/docmaker/content.py b/src/3rdparty/freetype/src/tools/docmaker/content.py
index adea6f1d70..1961878a7d 100644
--- a/src/3rdparty/freetype/src/tools/docmaker/content.py
+++ b/src/3rdparty/freetype/src/tools/docmaker/content.py
@@ -3,7 +3,7 @@
#
# Parse comment blocks to build content blocks (library file).
#
-# Copyright 2002, 2004, 2006-2009, 2012-2014 by
+# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -53,9 +53,10 @@ re_identifier = re.compile( r'((?:\w|-)*)' )
#
# We collect macro names ending in `_H' (group 1), as defined in
-# `config/ftheader.h'. While outputting the object data, we use this info
-# together with the object's file location (group 2) to emit the appropriate
-# header file macro and its associated file name before the object itself.
+# `freetype/config/ftheader.h'. While outputting the object data, we use
+# this info together with the object's file location (group 2) to emit the
+# appropriate header file macro and its associated file name before the
+# object itself.
#
# Example:
#
diff --git a/src/3rdparty/freetype/src/tools/docmaker/docmaker.py b/src/3rdparty/freetype/src/tools/docmaker/docmaker.py
index 4fb1abf235..de82d930f5 100644
--- a/src/3rdparty/freetype/src/tools/docmaker/docmaker.py
+++ b/src/3rdparty/freetype/src/tools/docmaker/docmaker.py
@@ -4,7 +4,7 @@
#
# Convert source code markup to HTML documentation.
#
-# Copyright 2002, 2004, 2008, 2013, 2014 by
+# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/src/tools/docmaker/formatter.py b/src/3rdparty/freetype/src/tools/docmaker/formatter.py
index 7152c019d7..f0a8808c47 100644
--- a/src/3rdparty/freetype/src/tools/docmaker/formatter.py
+++ b/src/3rdparty/freetype/src/tools/docmaker/formatter.py
@@ -3,7 +3,7 @@
#
# Convert parsed content blocks to a structured document (library file).
#
-# Copyright 2002, 2004, 2007, 2008, 2014 by
+# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/src/tools/docmaker/sources.py b/src/3rdparty/freetype/src/tools/docmaker/sources.py
index 61ecc22c40..be38132d1d 100644
--- a/src/3rdparty/freetype/src/tools/docmaker/sources.py
+++ b/src/3rdparty/freetype/src/tools/docmaker/sources.py
@@ -3,7 +3,7 @@
#
# Convert source code comments to multi-line blocks (library file).
#
-# Copyright 2002-2004, 2006-2009, 2012-2014 by
+# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -150,10 +150,11 @@ re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) # @foo
# Group 1 is the markup, group 2 the rest of the line.
#
# Note that the markup is limited to words consisting of letters, digits,
-# the character `_', or an apostrophe (but not as the first character).
+# the characters `_' and `-', or an apostrophe (but not as the first
+# character).
#
-re_italic = re.compile( r"_(\w(?:\w|')*)_(.*)" ) # _italic_
-re_bold = re.compile( r"\*(\w(?:\w|')*)\*(.*)" ) # *bold*
+re_italic = re.compile( r"_((?:\w|-)(?:\w|'|-)*)_(.*)" ) # _italic_
+re_bold = re.compile( r"\*((?:\w|-)(?:\w|'|-)*)\*(.*)" ) # *bold*
#
# This regular expression code to identify an URL has been taken from
diff --git a/src/3rdparty/freetype/src/tools/docmaker/tohtml.py b/src/3rdparty/freetype/src/tools/docmaker/tohtml.py
index 05fc08a92d..bc6bcf0511 100644
--- a/src/3rdparty/freetype/src/tools/docmaker/tohtml.py
+++ b/src/3rdparty/freetype/src/tools/docmaker/tohtml.py
@@ -3,7 +3,7 @@
#
# A sub-class container of the `Formatter' class to produce HTML.
#
-# Copyright 2002, 2003, 2005-2008, 2013, 2014 by
+# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/src/tools/docmaker/utils.py b/src/3rdparty/freetype/src/tools/docmaker/utils.py
index b35823ab74..254083e92e 100644
--- a/src/3rdparty/freetype/src/tools/docmaker/utils.py
+++ b/src/3rdparty/freetype/src/tools/docmaker/utils.py
@@ -3,7 +3,7 @@
#
# Auxiliary functions for the `docmaker' tool (library file).
#
-# Copyright 2002, 2004, 2007, 2008, 2014 by
+# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -79,7 +79,7 @@ def check_output():
if not os.path.isdir( output_dir ):
sys.stderr.write( "argument"
+ " '" + output_dir + "' "
- + "is not a valid directory" )
+ + "is not a valid directory\n" )
sys.exit( 2 )
else:
output_dir = None
diff --git a/src/3rdparty/freetype/src/tools/glnames.py b/src/3rdparty/freetype/src/tools/glnames.py
index 8810bf57f1..0ad554c72d 100644
--- a/src/3rdparty/freetype/src/tools/glnames.py
+++ b/src/3rdparty/freetype/src/tools/glnames.py
@@ -6,7 +6,7 @@
#
-# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -35,7 +35,7 @@ import sys, string, struct, re, os.path
#
# See
#
-# http://fonts.apple.com/TTRefMan/RM06/Chap6post.html
+# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html
#
# for the official list.
#
@@ -5267,7 +5267,7 @@ def main():
write( "/* */\n" )
write( "/* PostScript glyph names. */\n" )
write( "/* */\n" )
- write( "/* Copyright 2005, 2008, 2011 by */\n" )
+ write( "/* Copyright 2005-2015 by */\n" )
write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" )
write( "/* */\n" )
write( "/* This file is part of the FreeType project, and may only be used, */\n" )
diff --git a/src/3rdparty/freetype/src/tools/no-copyright b/src/3rdparty/freetype/src/tools/no-copyright
new file mode 100644
index 0000000000..5011e3fb62
--- /dev/null
+++ b/src/3rdparty/freetype/src/tools/no-copyright
@@ -0,0 +1,61 @@
+# Files that don't get a copyright, or which are taken from elsewhere.
+#
+# All lines in this file are patterns, including the comment lines; this
+# means that e.g. `FTL.TXT' matches all files that have this string in
+# the file name (including the path relative to the current directory,
+# always starting with `./').
+#
+# Don't put empty lines into this file!
+#
+.gitignore
+#
+builds/unix/pkg.m4
+#
+docs/FTL.TXT
+docs/GPLv2.TXT
+#
+src/base/md5.c
+src/base/md5.h
+#
+src/bdf/bdf.c
+src/bdf/bdf.h
+src/bdf/bdfdrivr.c
+src/bdf/bdfdrivr.h
+src/bdf/bdferror.h
+src/bdf/bdflib.c
+src/bdf/module.mk
+src/bdf/README
+src/bdf/rules.mk
+#
+src/pcf/module.mk
+src/pcf/pcf.c
+src/pcf/pcf.h
+src/pcf/pcfdrivr.c
+src/pcf/pcfdrivr.h
+src/pcf/pcferror.h
+src/pcf/pcfread.c
+src/pcf/pcfread.h
+src/pcf/pcfutil.c
+src/pcf/pcfutil.h
+src/pcf/README
+src/pcf/rules.mk
+#
+src/gzip/adler32.c
+src/gzip/infblock.c
+src/gzip/infblock.h
+src/gzip/infcodes.c
+src/gzip/infcodes.h
+src/gzip/inffixed.h
+src/gzip/inflate.c
+src/gzip/inftrees.c
+src/gzip/inftrees.h
+src/gzip/infutil.c
+src/gzip/infutil.h
+src/gzip/zconf.h
+src/gzip/zlib.h
+src/gzip/zutil.c
+src/gzip/zutil.h
+#
+src/tools/ftrandom/ftrandom.c
+#
+# EOF
diff --git a/src/3rdparty/freetype/src/tools/test_afm.c b/src/3rdparty/freetype/src/tools/test_afm.c
index 24cd0c4f0e..8de619bb03 100644
--- a/src/3rdparty/freetype/src/tools/test_afm.c
+++ b/src/3rdparty/freetype/src/tools/test_afm.c
@@ -9,7 +9,7 @@
void dump_fontinfo( AFM_FontInfo fi )
{
- FT_Int i;
+ FT_UInt i;
printf( "This AFM is for %sCID font.\n\n",
diff --git a/src/3rdparty/freetype/src/tools/update-copyright b/src/3rdparty/freetype/src/tools/update-copyright
new file mode 100644
index 0000000000..4a8bf9b0ea
--- /dev/null
+++ b/src/3rdparty/freetype/src/tools/update-copyright
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Run the `update-copyright-year' script on all files in the git repository,
+# taking care of exceptions stored in file `no-copyright'.
+
+topdir=`git rev-parse --show-toplevel`
+toolsdir=$topdir/src/tools
+
+git ls-files --full-name $topdir \
+| sed 's|^|../../|' \
+| grep -vFf $toolsdir/no-copyright \
+| xargs $toolsdir/update-copyright-year
+
+# EOF
diff --git a/src/3rdparty/freetype/src/tools/update-copyright-year b/src/3rdparty/freetype/src/tools/update-copyright-year
new file mode 100644
index 0000000000..107754183d
--- /dev/null
+++ b/src/3rdparty/freetype/src/tools/update-copyright-year
@@ -0,0 +1,135 @@
+eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}'
+ & eval 'exec perl -wS -i "$0" $argv:q'
+ if 0;
+
+# Copyright 2015 by
+# Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT. By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+# [Note: This script is expected to be called by the shell, which in turn
+# calls perl automatically. The nifty start-up code above is based on
+# gnulib's `update-copyright' script; it is a more portable replacement for
+# the shebang, using the first `perl' program in the shell's path instead.]
+
+# Usage:
+#
+# update-copyright-year file1 [file2 ...]
+
+
+# This script handles copyright entries like
+#
+# Copyright 2000 by
+# foobar
+#
+# or
+#
+# /* Copyright 2000, 2001, 2004-2007 by */
+# /* foobar */
+#
+# and replaces them uniformly with
+#
+# Copyright 2000-2015
+# foobar
+#
+# and
+#
+# /* Copyright 2000-2015 by */
+# /* foobar */
+#
+# (assuming that the current year is 2015). As can be seen, the line length
+# is retained if there is non-whitespace after the word `by' on the same
+# line.
+
+use strict;
+
+
+my (undef, undef, undef,
+ undef, undef, $year,
+ undef, undef, undef) = localtime(time);
+$year += 1900;
+
+my $replaced = 0;
+
+
+# Loop over all input files; option `-i' (issued at the very beginning of
+# this script) makes perl edit them in-place.
+while (<>)
+{
+ # Only handle the first copyright notice in a file.
+ if (!$replaced)
+ {
+ # First try: Search multiple copyright years.
+ s {
+ (?<begin>.*)
+ Copyright
+ (?<space1>\ +)
+ (?<first>[12][0-9][0-9][0-9])
+ (?<middle>.+)
+ (?<last>[12][0-9][0-9][0-9])
+ (?<space2>\ +)
+ by
+ (?<space3>\ *)
+ (?<end>.*)
+ }
+ {
+ # Fill line to the same length (if appropriate); we skip the middle
+ # part but insert two spaces and `-'.
+ my $space = length($+{space1}) - 1
+ + length($+{middle}) - 1
+ + length($+{space2}) - 1
+ + length($+{space3});
+
+ print "$+{begin}";
+ print "Copyright\ $+{first}-$year\ by";
+ print ' ' x $space if length($+{end});
+ print "$+{end}\n";
+ $replaced = 1;
+ }ex
+ ||
+ # Second try: Search a single copyright year.
+ s {
+ (?<begin>.*)
+ Copyright
+ (?<space1>\ +)
+ (?<first>[12][0-9][0-9][0-9])
+ (?<space2>\ +)
+ by
+ (?<space3>\ *)
+ (?<end>.*)
+ }
+ {
+ # Fill line to the same length (if appropriate); we insert two
+ # spaces, a `-', and the current year.
+ my $space = length($+{space1}) - 1
+ + length($+{space2}) - 1
+ + length($+{space3})
+ - (length($year) + 1);
+
+ print "$+{begin}";
+ print "Copyright $+{first}-$year by";
+ # If $space is negative this inserts nothing.
+ print ' ' x $space if length($+{end});
+ print "$+{end}\n";
+ $replaced = 1;
+ }ex
+ ||
+ # Otherwise print line unaltered.
+ print;
+ }
+ else
+ {
+ print;
+ }
+}
+continue
+{
+ # Reset $replaced before processing the next file.
+ $replaced = 0 if eof;
+}
+
+# EOF
diff --git a/src/3rdparty/freetype/src/truetype/Jamfile b/src/3rdparty/freetype/src/truetype/Jamfile
index a8cccfe137..88cc26f2b1 100644
--- a/src/3rdparty/freetype/src/truetype/Jamfile
+++ b/src/3rdparty/freetype/src/truetype/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/truetype Jamfile
#
-# Copyright 2001, 2004 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,15 @@ SubDir FT2_TOP $(FT2_SRC_DIR) truetype ;
if $(FT2_MULTI)
{
- _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ttpic ;
+ _sources = ttdriver
+ ttgload
+ ttgxvar
+ ttinterp
+ ttobjs
+ ttpic
+ ttpload
+ ttsubpix
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/truetype/module.mk b/src/3rdparty/freetype/src/truetype/module.mk
index baee81a773..c6dc6fa6e7 100644
--- a/src/3rdparty/freetype/src/truetype/module.mk
+++ b/src/3rdparty/freetype/src/truetype/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/truetype/rules.mk b/src/3rdparty/freetype/src/truetype/rules.mk
index d4b69f578b..1db16ba35f 100644
--- a/src/3rdparty/freetype/src/truetype/rules.mk
+++ b/src/3rdparty/freetype/src/truetype/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2001, 2003-2004, 2011-2012 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ TT_DIR := $(SRC_DIR)/truetype
# compilation flags for the driver
#
-TT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR))
+TT_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(TT_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# TrueType driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/truetype/truetype.c b/src/3rdparty/freetype/src/truetype/truetype.c
index 576912b219..f929437dc1 100644
--- a/src/3rdparty/freetype/src/truetype/truetype.c
+++ b/src/3rdparty/freetype/src/truetype/truetype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType TrueType driver component (body only). */
/* */
-/* Copyright 1996-2001, 2004, 2006, 2012 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/truetype/ttdriver.c b/src/3rdparty/freetype/src/truetype/ttdriver.c
index ecf4cdcb41..08b30c95ad 100644
--- a/src/3rdparty/freetype/src/truetype/ttdriver.c
+++ b/src/3rdparty/freetype/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
/* */
/* TrueType font driver implementation (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,7 +20,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_MULTIPLE_MASTERS_H
@@ -134,11 +134,6 @@
/*************************************************************************/
-#undef PAIR_TAG
-#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \
- (FT_ULong)right )
-
-
/*************************************************************************/
/* */
/* <Function> */
@@ -191,9 +186,6 @@
}
-#undef PAIR_TAG
-
-
static FT_Error
tt_get_advances( FT_Face ttface,
FT_UInt start,
@@ -456,7 +448,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_DEFINE_SERVICEDESCREC5(
tt_services,
- FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE,
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
FT_SERVICE_ID_MULTI_MASTERS, &TT_SERVICE_GX_MULTI_MASTERS_GET,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
@@ -464,7 +456,7 @@
#else
FT_DEFINE_SERVICEDESCREC4(
tt_services,
- FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE,
+ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TRUETYPE,
FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,
FT_SERVICE_ID_TT_GLYF, &TT_SERVICE_TRUETYPE_GLYF_GET,
FT_SERVICE_ID_PROPERTIES, &TT_SERVICE_PROPERTIES_GET )
diff --git a/src/3rdparty/freetype/src/truetype/ttdriver.h b/src/3rdparty/freetype/src/truetype/ttdriver.h
index aae00f2617..6cacd60966 100644
--- a/src/3rdparty/freetype/src/truetype/ttdriver.h
+++ b/src/3rdparty/freetype/src/truetype/ttdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level TrueType driver interface (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/truetype/tterrors.h b/src/3rdparty/freetype/src/truetype/tterrors.h
index 78d138fab2..ba32cf744c 100644
--- a/src/3rdparty/freetype/src/truetype/tterrors.h
+++ b/src/3rdparty/freetype/src/truetype/tterrors.h
@@ -4,7 +4,7 @@
/* */
/* TrueType error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/truetype/ttgload.c b/src/3rdparty/freetype/src/truetype/ttgload.c
index c5841c301d..a792ad44a0 100644
--- a/src/3rdparty/freetype/src/truetype/ttgload.c
+++ b/src/3rdparty/freetype/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (body). */
/* */
-/* Copyright 1996-2014 */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -100,13 +100,15 @@
else if ( face->os2.version != 0xFFFFU )
{
*tsb = (FT_Short)( face->os2.sTypoAscender - yMax );
- *ah = face->os2.sTypoAscender - face->os2.sTypoDescender;
+ *ah = (FT_UShort)FT_ABS( face->os2.sTypoAscender -
+ face->os2.sTypoDescender );
}
else
{
*tsb = (FT_Short)( face->horizontal.Ascender - yMax );
- *ah = face->horizontal.Ascender - face->horizontal.Descender;
+ *ah = (FT_UShort)FT_ABS( face->horizontal.Ascender -
+ face->horizontal.Descender );
}
FT_TRACE5(( " advance height (font units): %d\n", *ah ));
@@ -118,7 +120,7 @@
tt_get_metrics( TT_Loader loader,
FT_UInt glyph_index )
{
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
#endif
@@ -151,14 +153,16 @@
loader->vadvance = advance_height;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
+ loader->exec )
{
- if ( loader->exec )
- loader->exec->sph_tweak_flags = 0;
+ loader->exec->sph_tweak_flags = 0;
- /* this may not be the right place for this, but it works */
- if ( loader->exec && loader->exec->ignore_x_mode )
- sph_set_tweaks( loader, glyph_index );
+ /* This may not be the right place for this, but it works... */
+ /* Note that we have to unconditionally load the tweaks since */
+ /* it is possible that glyphs individually switch ClearType's */
+ /* backwards compatibility mode on and off. */
+ sph_set_tweaks( loader, glyph_index );
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -178,7 +182,7 @@
tt_get_metrics_incr_overrides( TT_Loader loader,
FT_UInt glyph_index )
{
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
FT_Short left_bearing = 0, top_bearing = 0;
FT_UShort advance_width = 0, advance_height = 0;
@@ -246,29 +250,6 @@
/*************************************************************************/
/* */
- /* Translates an array of coordinates. */
- /* */
- static void
- translate_array( FT_UInt n,
- FT_Vector* coords,
- FT_Pos delta_x,
- FT_Pos delta_y )
- {
- FT_UInt k;
-
-
- if ( delta_x )
- for ( k = 0; k < n; k++ )
- coords[k].x += delta_x;
-
- if ( delta_y )
- for ( k = 0; k < n; k++ )
- coords[k].y += delta_y;
- }
-
-
- /*************************************************************************/
- /* */
/* The following functions are used by default with TrueType fonts. */
/* However, they can be replaced by alternatives if we need to support */
/* TrueType-compressed formats (like MicroType) in the future. */
@@ -407,7 +388,7 @@
/* reading the bytecode instructions */
load->glyph->control_len = 0;
- load->glyph->control_data = 0;
+ load->glyph->control_data = NULL;
if ( p + 2 > limit )
goto Invalid_Outline;
@@ -555,8 +536,8 @@
*flag = (FT_Byte)( f & FT_CURVE_TAG_ON );
}
- outline->n_points = (FT_UShort)n_points;
- outline->n_contours = (FT_Short) n_contours;
+ outline->n_points = (FT_Short)n_points;
+ outline->n_contours = (FT_Short)n_contours;
load->cursor = p;
@@ -619,15 +600,31 @@
goto Invalid_Composite;
/* read arguments */
- if ( subglyph->flags & ARGS_ARE_WORDS )
+ if ( subglyph->flags & ARGS_ARE_XY_VALUES )
{
- subglyph->arg1 = FT_NEXT_SHORT( p );
- subglyph->arg2 = FT_NEXT_SHORT( p );
+ if ( subglyph->flags & ARGS_ARE_WORDS )
+ {
+ subglyph->arg1 = FT_NEXT_SHORT( p );
+ subglyph->arg2 = FT_NEXT_SHORT( p );
+ }
+ else
+ {
+ subglyph->arg1 = FT_NEXT_CHAR( p );
+ subglyph->arg2 = FT_NEXT_CHAR( p );
+ }
}
else
{
- subglyph->arg1 = FT_NEXT_CHAR( p );
- subglyph->arg2 = FT_NEXT_CHAR( p );
+ if ( subglyph->flags & ARGS_ARE_WORDS )
+ {
+ subglyph->arg1 = (FT_Int)FT_NEXT_USHORT( p );
+ subglyph->arg2 = (FT_Int)FT_NEXT_USHORT( p );
+ }
+ else
+ {
+ subglyph->arg1 = (FT_Int)FT_NEXT_BYTE( p );
+ subglyph->arg2 = (FT_Int)FT_NEXT_BYTE( p );
+ }
}
/* read transform */
@@ -636,20 +633,20 @@
if ( subglyph->flags & WE_HAVE_A_SCALE )
{
- xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
+ xx = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
yy = xx;
}
else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE )
{
- xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
- yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
+ xx = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
+ yy = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
}
else if ( subglyph->flags & WE_HAVE_A_2X2 )
{
- xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
- yx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
- xy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
- yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
+ xx = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
+ yx = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
+ xy = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
+ yy = (FT_Fixed)FT_NEXT_SHORT( p ) * 4;
}
subglyph->transform.xx = xx;
@@ -707,9 +704,10 @@
FT_UInt start_point,
FT_UInt start_contour )
{
- zone->n_points = (FT_UShort)( load->outline.n_points - start_point );
- zone->n_contours = (FT_Short) ( load->outline.n_contours -
- start_contour );
+ zone->n_points = (FT_UShort)load->outline.n_points -
+ (FT_UShort)start_point;
+ zone->n_contours = load->outline.n_contours -
+ (FT_Short)start_contour;
zone->org = load->extra_points + start_point;
zone->cur = load->outline.points + start_point;
zone->orus = load->extra_points2 + start_point;
@@ -733,14 +731,14 @@
FT_Bool is_composite )
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
#endif
TT_GlyphZone zone = &loader->zone;
#ifdef TT_USE_BYTECODE_INTERPRETER
- FT_UInt n_ins;
+ FT_Long n_ins;
#else
FT_UNUSED( is_composite );
#endif
@@ -753,14 +751,14 @@
FT_TRACE1(( " (0x%lx byte) is truncated\n",
loader->glyph->control_len ));
}
- n_ins = (FT_UInt)( loader->glyph->control_len );
+ n_ins = loader->glyph->control_len;
/* save original point position in org */
if ( n_ins > 0 )
FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points );
/* Reset graphics state. */
- loader->exec->GS = ((TT_Size)loader->size)->GS;
+ loader->exec->GS = loader->size->GS;
/* XXX: UNDOCUMENTED! Hinting instructions of a composite glyph */
/* completely refer to the (already) hinted subglyphs. */
@@ -773,10 +771,8 @@
}
else
{
- loader->exec->metrics.x_scale =
- ((TT_Size)loader->size)->metrics.x_scale;
- loader->exec->metrics.y_scale =
- ((TT_Size)loader->size)->metrics.y_scale;
+ loader->exec->metrics.x_scale = loader->size->metrics.x_scale;
+ loader->exec->metrics.y_scale = loader->size->metrics.y_scale;
}
#endif
@@ -794,7 +790,6 @@
if ( n_ins > 0 )
{
- FT_Bool debug;
FT_Error error;
FT_GlyphLoader gloader = loader->gloader;
@@ -807,10 +802,7 @@
loader->exec->is_composite = is_composite;
loader->exec->pts = *zone;
- debug = FT_BOOL( !( loader->load_flags & FT_LOAD_NO_SCALE ) &&
- ((TT_Size)loader->size)->debug );
-
- error = TT_Run_Context( loader->exec, debug );
+ error = TT_Run_Context( loader->exec );
if ( error && loader->exec->pedantic_hinting )
return error;
@@ -880,28 +872,15 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( ((TT_Face)loader->face)->doblend )
+ if ( loader->face->doblend )
{
/* Deltas apply to the unscaled data. */
- FT_Vector* deltas;
- FT_Memory memory = loader->face->memory;
- FT_Int i;
-
-
- error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
- loader->glyph_index,
- &deltas,
- n_points );
+ error = TT_Vary_Apply_Glyph_Deltas( loader->face,
+ loader->glyph_index,
+ outline,
+ (FT_UInt)n_points );
if ( error )
return error;
-
- for ( i = 0; i < n_points; ++i )
- {
- outline->points[i].x += deltas[i].x;
- outline->points[i].y += deltas[i].y;
- }
-
- FT_FREE( deltas );
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
@@ -916,13 +895,13 @@
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
FT_String* family = face->root.family_name;
- FT_Int ppem = loader->size->metrics.x_ppem;
+ FT_UInt ppem = loader->size->metrics.x_ppem;
FT_String* style = face->root.style_name;
- FT_Int x_scale_factor = 1000;
+ FT_UInt x_scale_factor = 1000;
#endif
FT_Vector* vec = outline->points;
@@ -949,9 +928,9 @@
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ||
x_scale_factor != 1000 )
{
- x_scale = FT_MulDiv( ((TT_Size)loader->size)->metrics.x_scale,
- x_scale_factor, 1000 );
- y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+ x_scale = FT_MulDiv( loader->size->metrics.x_scale,
+ (FT_Long)x_scale_factor, 1000 );
+ y_scale = loader->size->metrics.y_scale;
/* compensate for any scaling by de/emboldening; */
/* the amount was determined via experimentation */
@@ -971,8 +950,8 @@
/* scale the glyph */
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
- x_scale = ((TT_Size)loader->size)->metrics.x_scale;
- y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+ x_scale = loader->size->metrics.x_scale;
+ y_scale = loader->size->metrics.y_scale;
do_scale = TRUE;
}
@@ -1019,32 +998,31 @@
FT_UInt start_point,
FT_UInt num_base_points )
{
- FT_GlyphLoader gloader = loader->gloader;
- FT_Vector* base_vec = gloader->base.outline.points;
- FT_UInt num_points = gloader->base.outline.n_points;
+ FT_GlyphLoader gloader = loader->gloader;
+ FT_Outline current;
FT_Bool have_scale;
FT_Pos x, y;
+ current.points = gloader->base.outline.points +
+ num_base_points;
+ current.n_points = gloader->base.outline.n_points -
+ (short)num_base_points;
+
have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE |
WE_HAVE_AN_XY_SCALE |
WE_HAVE_A_2X2 ) );
/* perform the transform required for this subglyph */
if ( have_scale )
- {
- FT_UInt i;
-
-
- for ( i = num_base_points; i < num_points; i++ )
- FT_Vector_Transform( base_vec + i, &subglyph->transform );
- }
+ FT_Outline_Transform( &current, &subglyph->transform );
/* get offset */
if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) )
{
- FT_UInt k = subglyph->arg1;
- FT_UInt l = subglyph->arg2;
+ FT_UInt num_points = (FT_UInt)gloader->base.outline.n_points;
+ FT_UInt k = (FT_UInt)subglyph->arg1;
+ FT_UInt l = (FT_UInt)subglyph->arg2;
FT_Vector* p1;
FT_Vector* p2;
@@ -1131,8 +1109,8 @@
if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
{
- FT_Fixed x_scale = ((TT_Size)loader->size)->metrics.x_scale;
- FT_Fixed y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+ FT_Fixed x_scale = loader->size->metrics.x_scale;
+ FT_Fixed y_scale = loader->size->metrics.y_scale;
x = FT_MulFix( x, x_scale );
@@ -1147,9 +1125,7 @@
}
if ( x || y )
- translate_array( num_points - num_base_points,
- base_vec + num_base_points,
- x, y );
+ FT_Outline_Translate( &current, x, y );
return FT_Err_Ok;
}
@@ -1211,7 +1187,7 @@
FT_TRACE5(( " Instructions size = %d\n", n_ins ));
/* check it */
- max_ins = ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions;
+ max_ins = loader->face->max_profile.maxSizeOfInstructions;
if ( n_ins > max_ins )
{
/* don't trust `maxSizeOfInstructions'; */
@@ -1350,11 +1326,14 @@
#define TT_LOADER_SET_PP( loader ) \
do \
{ \
- FT_Bool subpixel_ = loader->exec ? loader->exec->subpixel \
- : 0; \
- FT_Bool grayscale_ = loader->exec ? loader->exec->grayscale \
- : 0; \
- FT_Bool use_aw_2_ = (FT_Bool)( subpixel_ && grayscale_ ); \
+ FT_Bool subpixel_hinting_ = loader->exec \
+ ? loader->exec->subpixel_hinting \
+ : 0; \
+ FT_Bool grayscale_ = loader->exec \
+ ? loader->exec->grayscale \
+ : 0; \
+ FT_Bool use_aw_2_ = (FT_Bool)( subpixel_hinting_ && \
+ grayscale_ ); \
\
\
(loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \
@@ -1405,14 +1384,10 @@
FT_Error error = FT_Err_Ok;
FT_Fixed x_scale, y_scale;
FT_ULong offset;
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
FT_GlyphLoader gloader = loader->gloader;
FT_Bool opened_frame = 0;
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Vector* deltas = NULL;
-#endif
-
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_StreamRec inc_stream;
FT_Data glyph_data;
@@ -1429,19 +1404,21 @@
goto Exit;
}
+#ifndef FT_CONFIG_OPTION_INCREMENTAL
/* check glyph index */
if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
{
error = FT_THROW( Invalid_Glyph_Index );
goto Exit;
}
+#endif
loader->glyph_index = glyph_index;
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
- x_scale = ((TT_Size)loader->size)->metrics.x_scale;
- y_scale = ((TT_Size)loader->size)->metrics.y_scale;
+ x_scale = loader->size->metrics.x_scale;
+ y_scale = loader->size->metrics.y_scale;
}
else
{
@@ -1472,7 +1449,8 @@
FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) );
FT_Stream_OpenMemory( &inc_stream,
- glyph_data.pointer, glyph_data.length );
+ glyph_data.pointer,
+ (FT_ULong)glyph_data.length );
loader->stream = &inc_stream;
}
@@ -1500,7 +1478,7 @@
error = face->access_glyph_frame( loader, glyph_index,
loader->glyf_offset + offset,
- loader->byte_len );
+ (FT_UInt)loader->byte_len );
if ( error )
goto Exit;
@@ -1546,28 +1524,49 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( ((TT_Face)(loader->face))->doblend )
+ if ( loader->face->doblend )
{
- /* this must be done before scaling */
- FT_Memory memory = loader->face->memory;
-
+ /* a small outline structure with four elements for */
+ /* communication with `TT_Vary_Apply_Glyph_Deltas' */
+ FT_Vector points[4];
+ char tags[4] = { 1, 1, 1, 1 };
+ short contours[4] = { 0, 1, 2, 3 };
+ FT_Outline outline;
+
+
+ points[0].x = loader->pp1.x;
+ points[0].y = loader->pp1.y;
+ points[1].x = loader->pp2.x;
+ points[1].y = loader->pp2.y;
+
+ points[2].x = loader->pp3.x;
+ points[2].y = loader->pp3.y;
+ points[3].x = loader->pp4.x;
+ points[3].y = loader->pp4.y;
+
+ outline.n_points = 4;
+ outline.n_contours = 4;
+ outline.points = points;
+ outline.tags = tags;
+ outline.contours = contours;
- error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
- glyph_index, &deltas, 4 );
+ /* this must be done before scaling */
+ error = TT_Vary_Apply_Glyph_Deltas( loader->face,
+ glyph_index,
+ &outline,
+ (FT_UInt)outline.n_points );
if ( error )
goto Exit;
- loader->pp1.x += deltas[0].x;
- loader->pp1.y += deltas[0].y;
- loader->pp2.x += deltas[1].x;
- loader->pp2.y += deltas[1].y;
-
- loader->pp3.x += deltas[2].x;
- loader->pp3.y += deltas[2].y;
- loader->pp4.x += deltas[3].x;
- loader->pp4.y += deltas[3].y;
+ loader->pp1.x = points[0].x;
+ loader->pp1.y = points[0].y;
+ loader->pp2.x = points[1].x;
+ loader->pp2.y = points[1].y;
- FT_FREE( deltas );
+ loader->pp3.x = points[2].x;
+ loader->pp3.y = points[2].y;
+ loader->pp4.x = points[3].x;
+ loader->pp4.y = points[3].y;
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
@@ -1633,8 +1632,8 @@
FT_ULong ins_pos; /* position of composite instructions, if any */
- start_point = gloader->base.outline.n_points;
- start_contour = gloader->base.outline.n_contours;
+ start_point = (FT_UInt)gloader->base.outline.n_points;
+ start_contour = (FT_UInt)gloader->base.outline.n_contours;
/* for each subglyph, read composite header */
error = face->read_composite_glyph( loader );
@@ -1652,47 +1651,106 @@
if ( face->doblend )
{
- FT_Int i, limit;
+ short i, limit;
FT_SubGlyph subglyph;
- FT_Memory memory = face->root.memory;
+ FT_Outline outline;
+ FT_Vector* points = NULL;
+ char* tags = NULL;
+ short* contours = NULL;
+
+ FT_Memory memory = face->root.memory;
+
+
+ limit = (short)gloader->current.num_subglyphs;
+
+ /* construct an outline structure for */
+ /* communication with `TT_Vary_Apply_Glyph_Deltas' */
+ outline.n_points = (short)( gloader->current.num_subglyphs + 4 );
+ outline.n_contours = outline.n_points;
- /* this provides additional offsets */
- /* for each component's translation */
+ if ( FT_NEW_ARRAY( points, outline.n_points ) ||
+ FT_NEW_ARRAY( tags, outline.n_points ) ||
+ FT_NEW_ARRAY( contours, outline.n_points ) )
+ goto Exit1;
- if ( ( error = TT_Vary_Get_Glyph_Deltas(
+ subglyph = gloader->current.subglyphs;
+
+ for ( i = 0; i < limit; i++, subglyph++ )
+ {
+ /* applying deltas for anchor points doesn't make sense, */
+ /* but we don't have to specially check this since */
+ /* unused delta values are zero anyways */
+ points[i].x = subglyph->arg1;
+ points[i].y = subglyph->arg2;
+ tags[i] = 1;
+ contours[i] = i;
+ }
+
+ points[i].x = loader->pp1.x;
+ points[i].y = loader->pp1.y;
+ tags[i] = 1;
+ contours[i] = i;
+
+ i++;
+ points[i].x = loader->pp2.x;
+ points[i].y = loader->pp2.y;
+ tags[i] = 1;
+ contours[i] = i;
+
+ i++;
+ points[i].x = loader->pp3.x;
+ points[i].y = loader->pp3.y;
+ tags[i] = 1;
+ contours[i] = i;
+
+ i++;
+ points[i].x = loader->pp4.x;
+ points[i].y = loader->pp4.y;
+ tags[i] = 1;
+ contours[i] = i;
+
+ outline.points = points;
+ outline.tags = tags;
+ outline.contours = contours;
+
+ /* this call provides additional offsets */
+ /* for each component's translation */
+ if ( ( error = TT_Vary_Apply_Glyph_Deltas(
face,
glyph_index,
- &deltas,
- gloader->current.num_subglyphs + 4 ) ) != 0 )
- goto Exit;
+ &outline,
+ (FT_UInt)outline.n_points ) ) != 0 )
+ goto Exit1;
- subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs;
- limit = gloader->current.num_subglyphs;
+ subglyph = gloader->current.subglyphs;
- for ( i = 0; i < limit; ++i, ++subglyph )
+ for ( i = 0; i < limit; i++, subglyph++ )
{
- if ( subglyph->flags & ARGS_ARE_XY_VALUES )
- {
- /* XXX: overflow check for subglyph->{arg1,arg2}. */
- /* deltas[i].{x,y} must be within signed 16-bit, */
- /* but the restriction of summed delta is not clear */
- subglyph->arg1 += (FT_Int16)deltas[i].x;
- subglyph->arg2 += (FT_Int16)deltas[i].y;
- }
+ /* XXX: overflow check for subglyph->{arg1,arg2}. */
+ /* Deltas must be within signed 16-bit, */
+ /* but the restriction of summed deltas is not clear */
+ subglyph->arg1 = (FT_Int16)points[i].x;
+ subglyph->arg2 = (FT_Int16)points[i].y;
}
- loader->pp1.x += deltas[i + 0].x;
- loader->pp1.y += deltas[i + 0].y;
- loader->pp2.x += deltas[i + 1].x;
- loader->pp2.y += deltas[i + 1].y;
+ loader->pp1.x = points[i + 0].x;
+ loader->pp1.y = points[i + 0].y;
+ loader->pp2.x = points[i + 1].x;
+ loader->pp2.y = points[i + 1].y;
+
+ loader->pp3.x = points[i + 2].x;
+ loader->pp3.y = points[i + 2].y;
+ loader->pp4.x = points[i + 3].x;
+ loader->pp4.y = points[i + 3].y;
- loader->pp3.x += deltas[i + 2].x;
- loader->pp3.y += deltas[i + 2].y;
- loader->pp4.x += deltas[i + 3].x;
- loader->pp4.y += deltas[i + 3].y;
+ Exit1:
+ FT_FREE( outline.points );
+ FT_FREE( outline.tags );
+ FT_FREE( outline.contours );
- FT_FREE( deltas );
+ if ( error )
+ goto Exit;
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
@@ -1728,7 +1786,7 @@
{
FT_UInt n, num_base_points;
- FT_SubGlyph subglyph = 0;
+ FT_SubGlyph subglyph = NULL;
FT_UInt num_points = start_point;
FT_UInt num_subglyphs = gloader->current.num_subglyphs;
@@ -1757,10 +1815,12 @@
pp[2] = loader->pp3;
pp[3] = loader->pp4;
- num_base_points = gloader->base.outline.n_points;
+ num_base_points = (FT_UInt)gloader->base.outline.n_points;
- error = load_truetype_glyph( loader, subglyph->index,
- recurse_count + 1, FALSE );
+ error = load_truetype_glyph( loader,
+ (FT_UInt)subglyph->index,
+ recurse_count + 1,
+ FALSE );
if ( error )
goto Exit;
@@ -1776,7 +1836,7 @@
loader->pp4 = pp[3];
}
- num_points = gloader->base.outline.n_points;
+ num_points = (FT_UInt)gloader->base.outline.n_points;
if ( num_points == num_base_points )
continue;
@@ -1847,7 +1907,7 @@
compute_glyph_metrics( TT_Loader loader,
FT_UInt glyph_index )
{
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
#endif
@@ -1855,7 +1915,7 @@
FT_BBox bbox;
FT_Fixed y_scale;
TT_GlyphSlot glyph = loader->glyph;
- TT_Size size = (TT_Size)loader->size;
+ TT_Size size = loader->size;
y_scale = 0x10000L;
@@ -1876,8 +1936,10 @@
glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
/* adjust advance width to the value contained in the hdmx table */
- if ( !face->postscript.isFixedPitch &&
- IS_HINTED( loader->load_flags ) )
+ /* unless FT_LOAD_COMPUTE_METRICS is set */
+ if ( !face->postscript.isFixedPitch &&
+ IS_HINTED( loader->load_flags ) &&
+ !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) )
{
FT_Byte* widthp;
@@ -1900,7 +1962,7 @@
( ( ignore_x_mode && loader->exec->compatible_widths ) ||
!ignore_x_mode ||
SPH_OPTION_BITMAP_WIDTHS ) )
- glyph->metrics.horiAdvance = *widthp << 6;
+ glyph->metrics.horiAdvance = *widthp * 64;
}
else
@@ -1908,7 +1970,7 @@
{
if ( widthp )
- glyph->metrics.horiAdvance = *widthp << 6;
+ glyph->metrics.horiAdvance = *widthp * 64;
}
}
@@ -2039,7 +2101,7 @@
error = sfnt->load_sbit_image( face,
size->strike_index,
glyph_index,
- (FT_Int)load_flags,
+ (FT_UInt)load_flags,
stream,
&glyph->bitmap,
&metrics );
@@ -2048,16 +2110,16 @@
glyph->outline.n_points = 0;
glyph->outline.n_contours = 0;
- glyph->metrics.width = (FT_Pos)metrics.width << 6;
- glyph->metrics.height = (FT_Pos)metrics.height << 6;
+ glyph->metrics.width = (FT_Pos)metrics.width * 64;
+ glyph->metrics.height = (FT_Pos)metrics.height * 64;
- glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;
- glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;
- glyph->metrics.horiAdvance = (FT_Pos)metrics.horiAdvance << 6;
+ glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX * 64;
+ glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY * 64;
+ glyph->metrics.horiAdvance = (FT_Pos)metrics.horiAdvance * 64;
- glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;
- glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;
- glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6;
+ glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX * 64;
+ glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY * 64;
+ glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance * 64;
glyph->format = FT_GLYPH_FORMAT_BITMAP;
@@ -2111,14 +2173,16 @@
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
- FT_Bool subpixel = FALSE;
+ FT_Bool subpixel_hinting = FALSE;
#if 0
/* not used yet */
FT_Bool compatible_widths;
FT_Bool symmetrical_smoothing;
FT_Bool bgr;
+ FT_Bool vertical_lcd;
FT_Bool subpixel_positioned;
+ FT_Bool gray_cleartype;
#endif
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -2137,8 +2201,7 @@
return size->cvt_ready;
/* query new execution context */
- exec = size->debug ? size->context
- : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
+ exec = size->context;
if ( !exec )
return FT_THROW( Could_Not_Find_Context );
@@ -2146,33 +2209,35 @@
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
- subpixel = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) !=
- FT_RENDER_MODE_MONO ) &&
- SPH_OPTION_SET_SUBPIXEL );
+ subpixel_hinting = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) !=
+ FT_RENDER_MODE_MONO ) &&
+ SPH_OPTION_SET_SUBPIXEL );
- if ( subpixel )
+ if ( subpixel_hinting )
grayscale = FALSE;
else if ( SPH_OPTION_SET_GRAYSCALE )
{
- grayscale = TRUE;
- subpixel = FALSE;
+ grayscale = TRUE;
+ subpixel_hinting = FALSE;
}
else
grayscale = FALSE;
if ( FT_IS_TRICKY( glyph->face ) )
- subpixel = FALSE;
+ subpixel_hinting = FALSE;
- exec->ignore_x_mode = subpixel || grayscale;
+ exec->ignore_x_mode = subpixel_hinting || grayscale;
exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
if ( exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
#if 1
exec->compatible_widths = SPH_OPTION_SET_COMPATIBLE_WIDTHS;
- exec->symmetrical_smoothing = FALSE;
+ exec->symmetrical_smoothing = TRUE;
exec->bgr = FALSE;
+ exec->vertical_lcd = FALSE;
exec->subpixel_positioned = TRUE;
+ exec->gray_cleartype = FALSE;
#else /* 0 */
exec->compatible_widths =
FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
@@ -2183,9 +2248,15 @@
exec->bgr =
FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
TT_LOAD_BGR );
+ exec->vertical_lcd =
+ FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+ TT_LOAD_VERTICAL_LCD );
exec->subpixel_positioned =
FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
TT_LOAD_SUBPIXEL_POSITIONED );
+ exec->gray_cleartype =
+ FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+ TT_LOAD_GRAY_CLEARTYPE );
#endif /* 0 */
}
@@ -2208,13 +2279,13 @@
{
/* a change from mono to subpixel rendering (and vice versa) */
/* requires a re-execution of the CVT program */
- if ( subpixel != exec->subpixel )
+ if ( subpixel_hinting != exec->subpixel_hinting )
{
FT_TRACE4(( "tt_loader_init: subpixel hinting change,"
" re-executing `prep' table\n" ));
- exec->subpixel = subpixel;
- reexecute = TRUE;
+ exec->subpixel_hinting = subpixel_hinting;
+ reexecute = TRUE;
}
/* a change from mono to grayscale rendering (and vice versa) */
@@ -2237,7 +2308,7 @@
/* requires a re-execution of the CVT program */
if ( grayscale != exec->grayscale )
{
- FT_TRACE4(( "tt_loader_init: grayscale change,"
+ FT_TRACE4(( "tt_loader_init: grayscale hinting change,"
" re-executing `prep' table\n" ));
exec->grayscale = grayscale;
@@ -2257,7 +2328,7 @@
return error;
}
- /* see whether the cvt program has disabled hinting */
+ /* check whether the cvt program has disabled hinting */
if ( exec->GS.instruct_control & 1 )
load_flags |= FT_LOAD_NO_HINTING;
@@ -2265,6 +2336,13 @@
if ( exec->GS.instruct_control & 2 )
exec->GS = tt_default_graphics_state;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+ /* check whether we have a font hinted for ClearType -- */
+ /* note that this flag can also be modified in a glyph's bytecode */
+ if ( exec->GS.instruct_control & 4 )
+ exec->ignore_x_mode = 0;
+#endif
+
exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
loader->exec = exec;
loader->instructions = exec->glyphIns;
@@ -2308,10 +2386,10 @@
loader->gloader = gloader;
}
- loader->load_flags = load_flags;
+ loader->load_flags = (FT_ULong)load_flags;
- loader->face = (FT_Face)face;
- loader->size = (FT_Size)size;
+ loader->face = face;
+ loader->size = size;
loader->glyph = (FT_GlyphSlot)glyph;
loader->stream = stream;
diff --git a/src/3rdparty/freetype/src/truetype/ttgload.h b/src/3rdparty/freetype/src/truetype/ttgload.h
index 3f1699e686..8e3255e106 100644
--- a/src/3rdparty/freetype/src/truetype/ttgload.h
+++ b/src/3rdparty/freetype/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2006, 2008, 2011 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/truetype/ttgxvar.c b/src/3rdparty/freetype/src/truetype/ttgxvar.c
index 1b35539fe1..dd9e250c94 100644
--- a/src/3rdparty/freetype/src/truetype/ttgxvar.c
+++ b/src/3rdparty/freetype/src/truetype/ttgxvar.c
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader */
/* */
-/* Copyright 2004-2014 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,7 +20,7 @@
/* */
/* Apple documents the `fvar', `gvar', `cvar', and `avar' tables at */
/* */
- /* http://developer.apple.com/fonts/TTRefMan/RM06/Chap6[fgca]var.html */
+ /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6[fgca]var.html */
/* */
/* The documentation for `fvar' is inconsistent. At one point it says */
/* that `countSizePairs' should be 3, at another point 2. It should */
@@ -60,9 +60,9 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-#define FT_Stream_FTell( stream ) \
+#define FT_Stream_FTell( stream ) \
(FT_ULong)( (stream)->cursor - (stream)->base )
-#define FT_Stream_SeekSet( stream, off ) \
+#define FT_Stream_SeekSet( stream, off ) \
( (stream)->cursor = (stream)->base + (off) )
@@ -96,8 +96,8 @@
#define ALL_POINTS (FT_UShort*)~(FT_PtrDist)0
-#define GX_PT_POINTS_ARE_WORDS 0x80
-#define GX_PT_POINT_RUN_COUNT_MASK 0x7F
+#define GX_PT_POINTS_ARE_WORDS 0x80U
+#define GX_PT_POINT_RUN_COUNT_MASK 0x7FU
/*************************************************************************/
@@ -126,52 +126,67 @@
FT_UInt *point_cnt )
{
FT_UShort *points = NULL;
- FT_Int n;
- FT_Int runcnt;
- FT_Int i;
- FT_Int j;
- FT_Int first;
+ FT_UInt n;
+ FT_UInt runcnt;
+ FT_UInt i, j;
+ FT_UShort first;
FT_Memory memory = stream->memory;
FT_Error error = FT_Err_Ok;
FT_UNUSED( error );
- *point_cnt = n = FT_GET_BYTE();
+ *point_cnt = 0;
+
+ n = FT_GET_BYTE();
if ( n == 0 )
return ALL_POINTS;
if ( n & GX_PT_POINTS_ARE_WORDS )
- n = FT_GET_BYTE() | ( ( n & GX_PT_POINT_RUN_COUNT_MASK ) << 8 );
+ {
+ n &= GX_PT_POINT_RUN_COUNT_MASK;
+ n <<= 8;
+ n |= FT_GET_BYTE();
+ }
if ( FT_NEW_ARRAY( points, n ) )
return NULL;
+ *point_cnt = n;
+
i = 0;
while ( i < n )
{
runcnt = FT_GET_BYTE();
if ( runcnt & GX_PT_POINTS_ARE_WORDS )
{
- runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
- first = points[i++] = FT_GET_USHORT();
+ runcnt &= GX_PT_POINT_RUN_COUNT_MASK;
+ first = FT_GET_USHORT();
+ points[i++] = first;
- if ( runcnt < 1 || i + runcnt >= n )
+ if ( runcnt < 1 || i + runcnt > n )
goto Exit;
- /* first point not included in runcount */
- for ( j = 0; j < runcnt; ++j )
- points[i++] = (FT_UShort)( first += FT_GET_USHORT() );
+ /* first point not included in run count */
+ for ( j = 0; j < runcnt; j++ )
+ {
+ first += FT_GET_USHORT();
+ points[i++] = first;
+ }
}
else
{
- first = points[i++] = FT_GET_BYTE();
+ first = FT_GET_BYTE();
+ points[i++] = first;
- if ( runcnt < 1 || i + runcnt >= n )
+ if ( runcnt < 1 || i + runcnt > n )
goto Exit;
- for ( j = 0; j < runcnt; ++j )
- points[i++] = (FT_UShort)( first += FT_GET_BYTE() );
+ for ( j = 0; j < runcnt; j++ )
+ {
+ first += FT_GET_BYTE();
+ points[i++] = first;
+ }
}
}
@@ -180,12 +195,9 @@
}
- enum
- {
- GX_DT_DELTAS_ARE_ZERO = 0x80,
- GX_DT_DELTAS_ARE_WORDS = 0x40,
- GX_DT_DELTA_RUN_COUNT_MASK = 0x3F
- };
+#define GX_DT_DELTAS_ARE_ZERO 0x80U
+#define GX_DT_DELTAS_ARE_WORDS 0x40U
+#define GX_DT_DELTA_RUN_COUNT_MASK 0x3FU
/*************************************************************************/
@@ -200,7 +212,7 @@
/* <Input> */
/* stream :: The data stream. */
/* */
- /* delta_cnt :: The number of to be read. */
+ /* delta_cnt :: The number of deltas to be read. */
/* */
/* <Return> */
/* An array of FT_Short containing the deltas for the affected */
@@ -210,12 +222,11 @@
/* */
static FT_Short*
ft_var_readpackeddeltas( FT_Stream stream,
- FT_Offset delta_cnt )
+ FT_UInt delta_cnt )
{
FT_Short *deltas = NULL;
- FT_UInt runcnt;
- FT_Offset i;
- FT_UInt j;
+ FT_UInt runcnt, cnt;
+ FT_UInt i, j;
FT_Memory memory = stream->memory;
FT_Error error = FT_Err_Ok;
@@ -229,34 +240,30 @@
while ( i < delta_cnt )
{
runcnt = FT_GET_BYTE();
+ cnt = runcnt & GX_DT_DELTA_RUN_COUNT_MASK;
+
if ( runcnt & GX_DT_DELTAS_ARE_ZERO )
{
- /* runcnt zeroes get added */
- for ( j = 0;
- j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;
- ++j )
+ /* `runcnt' zeroes get added */
+ for ( j = 0; j <= cnt && i < delta_cnt; j++ )
deltas[i++] = 0;
}
else if ( runcnt & GX_DT_DELTAS_ARE_WORDS )
{
- /* runcnt shorts from the stack */
- for ( j = 0;
- j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;
- ++j )
+ /* `runcnt' shorts from the stack */
+ for ( j = 0; j <= cnt && i < delta_cnt; j++ )
deltas[i++] = FT_GET_SHORT();
}
else
{
- /* runcnt signed bytes from the stack */
- for ( j = 0;
- j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;
- ++j )
+ /* `runcnt' signed bytes from the stack */
+ for ( j = 0; j <= cnt && i < delta_cnt; j++ )
deltas[i++] = FT_GET_CHAR();
}
- if ( j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) )
+ if ( j <= cnt )
{
- /* Bad format */
+ /* bad format */
FT_FREE( deltas );
return NULL;
}
@@ -281,12 +288,12 @@
static void
ft_var_load_avar( TT_Face face )
{
- FT_Stream stream = FT_FACE_STREAM(face);
+ FT_Stream stream = FT_FACE_STREAM( face );
FT_Memory memory = stream->memory;
GX_Blend blend = face->blend;
GX_AVarSegment segment;
FT_Error error = FT_Err_Ok;
- FT_ULong version;
+ FT_Long version;
FT_Long axisCount;
FT_Int i, j;
FT_ULong table_len;
@@ -294,9 +301,15 @@
FT_UNUSED( error );
+ FT_TRACE2(( "AVAR " ));
+
blend->avar_checked = TRUE;
- if ( (error = face->goto_table( face, TTAG_avar, stream, &table_len )) != 0 )
+ error = face->goto_table( face, TTAG_avar, stream, &table_len );
+ if ( error )
+ {
+ FT_TRACE2(( "is missing\n" ));
return;
+ }
if ( FT_FRAME_ENTER( table_len ) )
return;
@@ -304,23 +317,36 @@
version = FT_GET_LONG();
axisCount = FT_GET_LONG();
- if ( version != 0x00010000L ||
- axisCount != (FT_Long)blend->mmvar->num_axis )
+ if ( version != 0x00010000L )
+ {
+ FT_TRACE2(( "bad table version\n" ));
+ goto Exit;
+ }
+
+ FT_TRACE2(( "loaded\n" ));
+
+ if ( axisCount != (FT_Long)blend->mmvar->num_axis )
+ {
+ FT_TRACE2(( "ft_var_load_avar: number of axes in `avar' and `cvar'\n"
+ " table are different\n" ));
goto Exit;
+ }
if ( FT_NEW_ARRAY( blend->avar_segment, axisCount ) )
goto Exit;
segment = &blend->avar_segment[0];
- for ( i = 0; i < axisCount; ++i, ++segment )
+ for ( i = 0; i < axisCount; i++, segment++ )
{
+ FT_TRACE5(( " axis %d:\n", i ));
+
segment->pairCount = FT_GET_USHORT();
if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) )
{
/* Failure. Free everything we have done so far. We must do */
/* it right now since loading the `avar' table is optional. */
- for ( j = i - 1; j >= 0; --j )
+ for ( j = i - 1; j >= 0; j-- )
FT_FREE( blend->avar_segment[j].correspondence );
FT_FREE( blend->avar_segment );
@@ -328,13 +354,18 @@
goto Exit;
}
- for ( j = 0; j < segment->pairCount; ++j )
+ for ( j = 0; j < segment->pairCount; j++ )
{
- segment->correspondence[j].fromCoord =
- FT_GET_SHORT() << 2; /* convert to Fixed */
- segment->correspondence[j].toCoord =
- FT_GET_SHORT()<<2; /* convert to Fixed */
+ /* convert to Fixed */
+ segment->correspondence[j].fromCoord = FT_GET_SHORT() * 4;
+ segment->correspondence[j].toCoord = FT_GET_SHORT() * 4;
+
+ FT_TRACE5(( " mapping %.4f to %.4f\n",
+ segment->correspondence[j].fromCoord / 65536.0,
+ segment->correspondence[j].toCoord / 65536.0 ));
}
+
+ FT_TRACE5(( "\n" ));
}
Exit:
@@ -361,8 +392,8 @@
/* ft_var_load_gvar */
/* */
/* <Description> */
- /* Parses the `gvar' table if present. If `fvar' is there, `gvar' */
- /* had better be there too. */
+ /* Parse the `gvar' table if present. If `fvar' is there, `gvar' had */
+ /* better be there too. */
/* */
/* <InOut> */
/* face :: The font face. */
@@ -373,7 +404,7 @@
static FT_Error
ft_var_load_gvar( TT_Face face )
{
- FT_Stream stream = FT_FACE_STREAM(face);
+ FT_Stream stream = FT_FACE_STREAM( face );
FT_Memory memory = stream->memory;
GX_Blend blend = face->blend;
FT_Error error;
@@ -400,8 +431,17 @@
FT_FRAME_END
};
- if ( (error = face->goto_table( face, TTAG_gvar, stream, &table_len )) != 0 )
+
+ FT_TRACE2(( "GVAR " ));
+
+ if ( ( error = face->goto_table( face,
+ TTAG_gvar,
+ stream,
+ &table_len ) ) != 0 )
+ {
+ FT_TRACE2(( "is missing\n" ));
goto Exit;
+ }
gvar_start = FT_STREAM_POS( );
if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) )
@@ -411,13 +451,26 @@
blend->gv_glyphcnt = gvar_head.glyphCount;
offsetToData = gvar_start + gvar_head.offsetToData;
- if ( gvar_head.version != (FT_Long)0x00010000L ||
- gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )
+ if ( gvar_head.version != 0x00010000L )
+ {
+ FT_TRACE1(( "bad table version\n" ));
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ FT_TRACE2(( "loaded\n" ));
+
+ if ( gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )
{
+ FT_TRACE1(( "ft_var_load_gvar: number of axes in `gvar' and `cvar'\n"
+ " table are different\n" ));
error = FT_THROW( Invalid_Table );
goto Exit;
}
+ FT_TRACE5(( "gvar: there are %d shared coordinates:\n",
+ blend->tuplecount ));
+
if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) )
goto Exit;
@@ -427,8 +480,8 @@
if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) )
goto Exit;
- for ( i = 0; i <= blend->gv_glyphcnt; ++i )
- blend->glyphoffsets[i] = offsetToData + FT_GET_LONG();
+ for ( i = 0; i <= blend->gv_glyphcnt; i++ )
+ blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG();
FT_FRAME_EXIT();
}
@@ -438,9 +491,9 @@
if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) )
goto Exit;
- for ( i = 0; i <= blend->gv_glyphcnt; ++i )
+ for ( i = 0; i <= blend->gv_glyphcnt; i++ )
blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2;
- /* XXX: Undocumented: `*2'! */
+ /* XXX: Undocumented: `*2'! */
FT_FRAME_EXIT();
}
@@ -451,14 +504,24 @@
gvar_head.axisCount * blend->tuplecount ) )
goto Exit;
- if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) ||
- FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L ) )
+ if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) ||
+ FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L ) )
goto Exit;
- for ( i = 0; i < blend->tuplecount; ++i )
- for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; ++j )
+ for ( i = 0; i < blend->tuplecount; i++ )
+ {
+ FT_TRACE5(( " [ " ));
+ for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; j++ )
+ {
blend->tuplecoords[i * gvar_head.axisCount + j] =
- FT_GET_SHORT() << 2; /* convert to FT_Fixed */
+ FT_GET_SHORT() * 4; /* convert to FT_Fixed */
+ FT_TRACE5(( "%.4f ",
+ blend->tuplecoords[i * gvar_head.axisCount + j] / 65536.0 ));
+ }
+ FT_TRACE5(( "]\n" ));
+ }
+
+ FT_TRACE5(( "\n" ));
FT_FRAME_EXIT();
}
@@ -506,48 +569,83 @@
FT_Fixed apply = 0x10000L;
- for ( i = 0; i < blend->num_axis; ++i )
+ for ( i = 0; i < blend->num_axis; i++ )
{
+ FT_TRACE6(( " axis coordinate %d (%.4f):\n",
+ i, blend->normalizedcoords[i] / 65536.0 ));
+
+ /* It's not clear why (for intermediate tuples) we don't need */
+ /* to check against start/end -- the documentation says we don't. */
+ /* Similarly, it's unclear why we don't need to scale along the */
+ /* axis. */
+
if ( tuple_coords[i] == 0 )
- /* It's not clear why (for intermediate tuples) we don't need */
- /* to check against start/end -- the documentation says we don't. */
- /* Similarly, it's unclear why we don't need to scale along the */
- /* axis. */
+ {
+ FT_TRACE6(( " tuple coordinate is zero, ignored\n", i ));
continue;
+ }
+
+ else if ( blend->normalizedcoords[i] == 0 )
+ {
+ FT_TRACE6(( " axis coordinate is zero, stop\n" ));
+ apply = 0;
+ break;
+ }
- else if ( blend->normalizedcoords[i] == 0 ||
- ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) ||
+ else if ( ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) ||
( blend->normalizedcoords[i] > 0 && tuple_coords[i] < 0 ) )
{
+ FT_TRACE6(( " tuple coordinate value %.4f is exceeded, stop\n",
+ tuple_coords[i] / 65536.0 ));
apply = 0;
break;
}
else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
+ {
+ FT_TRACE6(( " tuple coordinate value %.4f fits\n",
+ tuple_coords[i] / 65536.0 ));
/* not an intermediate tuple */
apply = FT_MulFix( apply,
blend->normalizedcoords[i] > 0
? blend->normalizedcoords[i]
: -blend->normalizedcoords[i] );
+ }
- else if ( blend->normalizedcoords[i] <= im_start_coords[i] ||
- blend->normalizedcoords[i] >= im_end_coords[i] )
+ else if ( blend->normalizedcoords[i] < im_start_coords[i] ||
+ blend->normalizedcoords[i] > im_end_coords[i] )
{
+ FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] is exceeded,"
+ " stop\n",
+ im_start_coords[i] / 65536.0,
+ im_end_coords[i] / 65536.0 ));
apply = 0;
break;
}
else if ( blend->normalizedcoords[i] < tuple_coords[i] )
+ {
+ FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
+ im_start_coords[i] / 65536.0,
+ im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
blend->normalizedcoords[i] - im_start_coords[i],
tuple_coords[i] - im_start_coords[i] );
+ }
else
+ {
+ FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
+ im_start_coords[i] / 65536.0,
+ im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
im_end_coords[i] - blend->normalizedcoords[i],
im_end_coords[i] - tuple_coords[i] );
+ }
}
+ FT_TRACE6(( " apply factor is %.4f\n", apply / 65536.0 ));
+
return apply;
}
@@ -577,9 +675,9 @@
typedef struct fvar_axis_
{
FT_ULong axisTag;
- FT_ULong minValue;
- FT_ULong defaultValue;
- FT_ULong maxValue;
+ FT_Fixed minValue;
+ FT_Fixed defaultValue;
+ FT_Fixed maxValue;
FT_UShort flags;
FT_UShort nameID;
@@ -600,7 +698,8 @@
/* TT_Get_MM_Var initializes the blend structure. */
/* */
/* <Output> */
- /* master :: The `fvar' data (must be freed by caller). */
+ /* master :: The `fvar' data (must be freed by caller). Can be NULL, */
+ /* which makes this function simply load MM support. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
@@ -647,25 +746,37 @@
FT_FRAME_START( 20 ),
FT_FRAME_ULONG ( axisTag ),
- FT_FRAME_ULONG ( minValue ),
- FT_FRAME_ULONG ( defaultValue ),
- FT_FRAME_ULONG ( maxValue ),
+ FT_FRAME_LONG ( minValue ),
+ FT_FRAME_LONG ( defaultValue ),
+ FT_FRAME_LONG ( maxValue ),
FT_FRAME_USHORT( flags ),
FT_FRAME_USHORT( nameID ),
FT_FRAME_END
};
+ /* read the font data and set up the internal representation */
+ /* if not already done */
+
if ( face->blend == NULL )
{
+ FT_TRACE2(( "FVAR " ));
+
/* both `fvar' and `gvar' must be present */
- if ( (error = face->goto_table( face, TTAG_gvar,
- stream, &table_len )) != 0 )
+ if ( ( error = face->goto_table( face, TTAG_gvar,
+ stream, &table_len ) ) != 0 )
+ {
+ FT_TRACE1(( "\n"
+ "TT_Get_MM_Var: `gvar' table is missing\n" ));
goto Exit;
+ }
- if ( (error = face->goto_table( face, TTAG_fvar,
- stream, &table_len )) != 0 )
+ if ( ( error = face->goto_table( face, TTAG_fvar,
+ stream, &table_len ) ) != 0 )
+ {
+ FT_TRACE1(( "is missing\n" ));
goto Exit;
+ }
fvar_start = FT_STREAM_POS( );
@@ -673,7 +784,12 @@
goto Exit;
if ( fvar_head.version != (FT_Long)0x00010000L ||
+#if 0
+ /* fonts like `JamRegular.ttf' have an incorrect value for */
+ /* `countSizePairs'; since value 2 is hard-coded in `fvar' */
+ /* version 1.0, we simply ignore it */
fvar_head.countSizePairs != 2 ||
+#endif
fvar_head.axisSize != 20 ||
/* axisCount limit implied by 16-bit instanceSize */
fvar_head.axisCount > 0x3FFE ||
@@ -683,10 +799,16 @@
fvar_head.offsetToData + fvar_head.axisCount * 20U +
fvar_head.instanceCount * fvar_head.instanceSize > table_len )
{
+ FT_TRACE1(( "\n"
+ "TT_Get_MM_Var: invalid `fvar' header\n" ));
error = FT_THROW( Invalid_Table );
goto Exit;
}
+ FT_TRACE2(( "loaded\n" ));
+
+ FT_TRACE5(( "number of GX style axes: %d\n", fvar_head.axisCount ));
+
if ( FT_NEW( face->blend ) )
goto Exit;
@@ -702,6 +824,9 @@
goto Exit;
face->blend->mmvar = mmvar;
+ /* set up pointers and offsets into the `mmvar' array; */
+ /* the data gets filled in later on */
+
mmvar->num_axis =
fvar_head.axisCount;
mmvar->num_designs =
@@ -711,30 +836,32 @@
mmvar->num_namedstyles =
fvar_head.instanceCount;
mmvar->axis =
- (FT_Var_Axis*)&(mmvar[1]);
+ (FT_Var_Axis*)&( mmvar[1] );
mmvar->namedstyle =
- (FT_Var_Named_Style*)&(mmvar->axis[fvar_head.axisCount]);
+ (FT_Var_Named_Style*)&( mmvar->axis[fvar_head.axisCount] );
next_coords =
- (FT_Fixed*)&(mmvar->namedstyle[fvar_head.instanceCount]);
- for ( i = 0; i < fvar_head.instanceCount; ++i )
+ (FT_Fixed*)&( mmvar->namedstyle[fvar_head.instanceCount] );
+ for ( i = 0; i < fvar_head.instanceCount; i++ )
{
mmvar->namedstyle[i].coords = next_coords;
next_coords += fvar_head.axisCount;
}
next_name = (FT_String*)next_coords;
- for ( i = 0; i < fvar_head.axisCount; ++i )
+ for ( i = 0; i < fvar_head.axisCount; i++ )
{
mmvar->axis[i].name = next_name;
next_name += 5;
}
+ /* now fill in the data */
+
if ( FT_STREAM_SEEK( fvar_start + fvar_head.offsetToData ) )
goto Exit;
a = mmvar->axis;
- for ( i = 0; i < fvar_head.axisCount; ++i )
+ for ( i = 0; i < fvar_head.axisCount; i++ )
{
GX_FVar_Axis axis_rec;
@@ -742,22 +869,30 @@
if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
goto Exit;
a->tag = axis_rec.axisTag;
- a->minimum = axis_rec.minValue; /* A Fixed */
- a->def = axis_rec.defaultValue; /* A Fixed */
- a->maximum = axis_rec.maxValue; /* A Fixed */
+ a->minimum = axis_rec.minValue;
+ a->def = axis_rec.defaultValue;
+ a->maximum = axis_rec.maxValue;
a->strid = axis_rec.nameID;
a->name[0] = (FT_String)( a->tag >> 24 );
a->name[1] = (FT_String)( ( a->tag >> 16 ) & 0xFF );
a->name[2] = (FT_String)( ( a->tag >> 8 ) & 0xFF );
a->name[3] = (FT_String)( ( a->tag ) & 0xFF );
- a->name[4] = 0;
+ a->name[4] = '\0';
- ++a;
+ FT_TRACE5(( " \"%s\": minimum=%.4f, default=%.4f, maximum=%.4f\n",
+ a->name,
+ a->minimum / 65536.0,
+ a->def / 65536.0,
+ a->maximum / 65536.0 ));
+
+ a++;
}
+ FT_TRACE5(( "\n" ));
+
ns = mmvar->namedstyle;
- for ( i = 0; i < fvar_head.instanceCount; ++i, ++ns )
+ for ( i = 0; i < fvar_head.instanceCount; i++, ns++ )
{
if ( FT_FRAME_ENTER( 4L + 4L * fvar_head.axisCount ) )
goto Exit;
@@ -765,13 +900,15 @@
ns->strid = FT_GET_USHORT();
(void) /* flags = */ FT_GET_USHORT();
- for ( j = 0; j < fvar_head.axisCount; ++j )
- ns->coords[j] = FT_GET_ULONG(); /* A Fixed */
+ for ( j = 0; j < fvar_head.axisCount; j++ )
+ ns->coords[j] = FT_GET_LONG();
FT_FRAME_EXIT();
}
}
+ /* fill the output array if requested */
+
if ( master != NULL )
{
FT_UInt n;
@@ -782,36 +919,36 @@
FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len );
mmvar->axis =
- (FT_Var_Axis*)&(mmvar[1]);
+ (FT_Var_Axis*)&( mmvar[1] );
mmvar->namedstyle =
- (FT_Var_Named_Style*)&(mmvar->axis[mmvar->num_axis]);
+ (FT_Var_Named_Style*)&( mmvar->axis[mmvar->num_axis] );
next_coords =
- (FT_Fixed*)&(mmvar->namedstyle[mmvar->num_namedstyles]);
+ (FT_Fixed*)&( mmvar->namedstyle[mmvar->num_namedstyles] );
- for ( n = 0; n < mmvar->num_namedstyles; ++n )
+ for ( n = 0; n < mmvar->num_namedstyles; n++ )
{
mmvar->namedstyle[n].coords = next_coords;
next_coords += mmvar->num_axis;
}
- a = mmvar->axis;
+ a = mmvar->axis;
next_name = (FT_String*)next_coords;
- for ( n = 0; n < mmvar->num_axis; ++n )
+ for ( n = 0; n < mmvar->num_axis; n++ )
{
a->name = next_name;
/* standard PostScript names for some standard apple tags */
if ( a->tag == TTAG_wght )
- a->name = (char *)"Weight";
+ a->name = (char*)"Weight";
else if ( a->tag == TTAG_wdth )
- a->name = (char *)"Width";
+ a->name = (char*)"Width";
else if ( a->tag == TTAG_opsz )
- a->name = (char *)"OpticalSize";
+ a->name = (char*)"OpticalSize";
else if ( a->tag == TTAG_slnt )
- a->name = (char *)"Slant";
+ a->name = (char*)"Slant";
next_name += 5;
- ++a;
+ a++;
}
*master = mmvar;
@@ -837,9 +974,12 @@
/* Initialize the blend structure with `gvar' data. */
/* */
/* <Input> */
- /* num_coords :: Must be the axis count of the font. */
+ /* num_coords :: The number of available coordinates. If it is */
+ /* larger than the number of axes, ignore the excess */
+ /* values. If it is smaller than the number of axes, */
+ /* use the default value (0) for the remaining axes. */
/* */
- /* coords :: An array of num_coords, each between [-1,1]. */
+ /* coords :: An array of `num_coords', each between [-1,1]. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
@@ -868,33 +1008,44 @@
if ( face->blend == NULL )
{
- if ( (error = TT_Get_MM_Var( face, NULL)) != 0 )
+ if ( ( error = TT_Get_MM_Var( face, NULL ) ) != 0 )
goto Exit;
}
blend = face->blend;
mmvar = blend->mmvar;
- if ( num_coords != mmvar->num_axis )
+ if ( num_coords > mmvar->num_axis )
{
- error = FT_THROW( Invalid_Argument );
- goto Exit;
+ FT_TRACE2(( "TT_Set_MM_Blend: only using first %d of %d coordinates\n",
+ mmvar->num_axis, num_coords ));
+ num_coords = mmvar->num_axis;
}
- for ( i = 0; i < num_coords; ++i )
+ FT_TRACE5(( "normalized design coordinates:\n" ));
+
+ for ( i = 0; i < num_coords; i++ )
+ {
+ FT_TRACE5(( " %.4f\n", coords[i] / 65536.0 ));
if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
{
+ FT_TRACE1(( "TT_Set_MM_Blend: normalized design coordinate %.4f\n"
+ " is out of range [-1;1]\n",
+ coords[i] / 65536.0 ));
error = FT_THROW( Invalid_Argument );
goto Exit;
}
+ }
+
+ FT_TRACE5(( "\n" ));
if ( blend->glyphoffsets == NULL )
- if ( (error = ft_var_load_gvar( face )) != 0 )
+ if ( ( error = ft_var_load_gvar( face ) ) != 0 )
goto Exit;
if ( blend->normalizedcoords == NULL )
{
- if ( FT_NEW_ARRAY( blend->normalizedcoords, num_coords ) )
+ if ( FT_NEW_ARRAY( blend->normalizedcoords, mmvar->num_axis ) )
goto Exit;
manageCvt = mcvt_modify;
@@ -906,7 +1057,8 @@
else
{
manageCvt = mcvt_retain;
- for ( i = 0; i < num_coords; ++i )
+
+ for ( i = 0; i < num_coords; i++ )
{
if ( blend->normalizedcoords[i] != coords[i] )
{
@@ -915,13 +1067,22 @@
}
}
+ for ( ; i < mmvar->num_axis; i++ )
+ {
+ if ( blend->normalizedcoords[i] != 0 )
+ {
+ manageCvt = mcvt_load;
+ break;
+ }
+ }
+
/* If we don't change the blend coords then we don't need to do */
/* anything to the cvt table. It will be correct. Otherwise we */
/* no longer have the original cvt (it was modified when we set */
/* the blend last time), so we must reload and then modify it. */
}
- blend->num_axis = num_coords;
+ blend->num_axis = mmvar->num_axis;
FT_MEM_COPY( blend->normalizedcoords,
coords,
num_coords * sizeof ( FT_Fixed ) );
@@ -973,7 +1134,10 @@
/* Initialize the blend struct with `gvar' data. */
/* */
/* <Input> */
- /* num_coords :: This must be the axis count of the font. */
+ /* num_coords :: The number of available coordinates. If it is */
+ /* larger than the number of axes, ignore the excess */
+ /* values. If it is smaller than the number of axes, */
+ /* use the default values for the remaining axes. */
/* */
/* coords :: A coordinate array with `num_coords' elements. */
/* */
@@ -997,17 +1161,19 @@
if ( face->blend == NULL )
{
- if ( (error = TT_Get_MM_Var( face, NULL )) != 0 )
+ if ( ( error = TT_Get_MM_Var( face, NULL ) ) != 0 )
goto Exit;
}
blend = face->blend;
mmvar = blend->mmvar;
- if ( num_coords != mmvar->num_axis )
+ if ( num_coords > mmvar->num_axis )
{
- error = FT_THROW( Invalid_Argument );
- goto Exit;
+ FT_TRACE2(( "TT_Set_Var_Design:"
+ " only using first %d of %d coordinates\n",
+ mmvar->num_axis, num_coords ));
+ num_coords = mmvar->num_axis;
}
/* Axis normalization is a two stage process. First we normalize */
@@ -1017,32 +1183,52 @@
if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) )
goto Exit;
+ FT_TRACE5(( "design coordinates:\n" ));
+
a = mmvar->axis;
- for ( i = 0; i < mmvar->num_axis; ++i, ++a )
+ for ( i = 0; i < num_coords; i++, a++ )
{
+ FT_TRACE5(( " %.4f\n", coords[i] / 65536.0 ));
if ( coords[i] > a->maximum || coords[i] < a->minimum )
{
+ FT_TRACE1(( "TT_Set_Var_Design: normalized design coordinate %.4f\n"
+ " is out of range [%.4f;%.4f]\n",
+ coords[i] / 65536.0,
+ a->minimum / 65536.0,
+ a->maximum / 65536.0 ));
error = FT_THROW( Invalid_Argument );
goto Exit;
}
if ( coords[i] < a->def )
- normalized[i] = -FT_DivFix( coords[i] - a->def, a->minimum - a->def );
+ normalized[i] = -FT_DivFix( coords[i] - a->def,
+ a->minimum - a->def );
else if ( a->maximum == a->def )
normalized[i] = 0;
else
- normalized[i] = FT_DivFix( coords[i] - a->def, a->maximum - a->def );
+ normalized[i] = FT_DivFix( coords[i] - a->def,
+ a->maximum - a->def );
}
+ FT_TRACE5(( "\n" ));
+
+ for ( ; i < mmvar->num_axis; i++ )
+ normalized[i] = 0;
+
if ( !blend->avar_checked )
ft_var_load_avar( face );
if ( blend->avar_segment != NULL )
{
+ FT_TRACE5(( "normalized design coordinates"
+ " before applying `avar' data:\n" ));
+
av = blend->avar_segment;
- for ( i = 0; i < mmvar->num_axis; ++i, ++av )
+ for ( i = 0; i < mmvar->num_axis; i++, av++ )
{
- for ( j = 1; j < (FT_UInt)av->pairCount; ++j )
+ for ( j = 1; j < (FT_UInt)av->pairCount; j++ )
+ {
+ FT_TRACE5(( " %.4f\n", normalized[i] / 65536.0 ));
if ( normalized[i] < av->correspondence[j].fromCoord )
{
normalized[i] =
@@ -1054,10 +1240,11 @@
av->correspondence[j - 1].toCoord;
break;
}
+ }
}
}
- error = TT_Set_MM_Blend( face, num_coords, normalized );
+ error = TT_Set_MM_Blend( face, mmvar->num_axis, normalized );
Exit:
FT_FREE( normalized );
@@ -1120,16 +1307,16 @@
if ( blend == NULL )
{
- FT_TRACE2(( "tt_face_vary_cvt: no blend specified\n" ));
-
+ FT_TRACE2(( "\n"
+ "tt_face_vary_cvt: no blend specified\n" ));
error = FT_Err_Ok;
goto Exit;
}
if ( face->cvt == NULL )
{
- FT_TRACE2(( "tt_face_vary_cvt: no `cvt ' table\n" ));
-
+ FT_TRACE2(( "\n"
+ "tt_face_vary_cvt: no `cvt ' table\n" ));
error = FT_Err_Ok;
goto Exit;
}
@@ -1158,6 +1345,8 @@
goto FExit;
}
+ FT_TRACE2(( "loaded\n" ));
+
if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) ||
FT_NEW_ARRAY( im_start_coords, blend->num_axis ) ||
FT_NEW_ARRAY( im_end_coords, blend->num_axis ) )
@@ -1170,13 +1359,17 @@
/* tuplecount, but John Jenkins says that shared points don't apply */
/* to `cvar', and no other flags are defined. */
- for ( i = 0; i < ( tupleCount & 0xFFF ); ++i )
+ FT_TRACE5(( "cvar: there are %d tuples:\n", tupleCount ));
+
+ for ( i = 0; i < ( tupleCount & 0xFFF ); i++ )
{
FT_UInt tupleDataSize;
FT_UInt tupleIndex;
FT_Fixed apply;
+ FT_TRACE6(( " tuple %d:\n", i ));
+
tupleDataSize = FT_GET_USHORT();
tupleIndex = FT_GET_USHORT();
@@ -1185,8 +1378,8 @@
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
- for ( j = 0; j < blend->num_axis; ++j )
- tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from */
+ for ( j = 0; j < blend->num_axis; j++ )
+ tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */
/* short frac to fixed */
}
else
@@ -1194,7 +1387,7 @@
/* skip this tuple; it makes no sense */
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
- for ( j = 0; j < 2 * blend->num_axis; ++j )
+ for ( j = 0; j < 2 * blend->num_axis; j++ )
(void)FT_GET_SHORT();
offsetToData += tupleDataSize;
@@ -1203,10 +1396,10 @@
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
- for ( j = 0; j < blend->num_axis; ++j )
- im_start_coords[j] = FT_GET_SHORT() << 2;
- for ( j = 0; j < blend->num_axis; ++j )
- im_end_coords[j] = FT_GET_SHORT() << 2;
+ for ( j = 0; j < blend->num_axis; j++ )
+ im_start_coords[j] = FT_GET_SHORT() * 4;
+ for ( j = 0; j < blend->num_axis; j++ )
+ im_end_coords[j] = FT_GET_SHORT() * 4;
}
apply = ft_var_apply_tuple( blend,
@@ -1233,25 +1426,74 @@
point_count == 0 ? face->cvt_size
: point_count );
if ( localpoints == NULL || deltas == NULL )
- /* failure, ignore it */;
+ ; /* failure, ignore it */
else if ( localpoints == ALL_POINTS )
{
+#ifdef FT_DEBUG_LEVEL_TRACE
+ int count = 0;
+#endif
+
+
+ FT_TRACE7(( " CVT deltas:\n" ));
+
/* this means that there are deltas for every entry in cvt */
- for ( j = 0; j < face->cvt_size; ++j )
- face->cvt[j] = (FT_Short)( face->cvt[j] +
+ for ( j = 0; j < face->cvt_size; j++ )
+ {
+ FT_Long orig_cvt = face->cvt[j];
+
+
+ face->cvt[j] = (FT_Short)( orig_cvt +
FT_MulFix( deltas[j], apply ) );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( orig_cvt != face->cvt[j] )
+ {
+ FT_TRACE7(( " %d: %d -> %d\n",
+ j, orig_cvt, face->cvt[j] ));
+ count++;
+ }
+#endif
+ }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( !count )
+ FT_TRACE7(( " none\n" ));
+#endif
}
else
{
- for ( j = 0; j < point_count; ++j )
+#ifdef FT_DEBUG_LEVEL_TRACE
+ int count = 0;
+#endif
+
+
+ FT_TRACE7(( " CVT deltas:\n" ));
+
+ for ( j = 0; j < point_count; j++ )
{
- int pindex = localpoints[j];
+ int pindex = localpoints[j];
+ FT_Long orig_cvt = face->cvt[pindex];
+
- face->cvt[pindex] = (FT_Short)( face->cvt[pindex] +
+ face->cvt[pindex] = (FT_Short)( orig_cvt +
FT_MulFix( deltas[j], apply ) );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( orig_cvt != face->cvt[pindex] )
+ {
+ FT_TRACE7(( " %d: %d -> %d\n",
+ pindex, orig_cvt, face->cvt[pindex] ));
+ count++;
+ }
+#endif
}
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( !count )
+ FT_TRACE7(( " none\n" ));
+#endif
}
if ( localpoints != ALL_POINTS )
@@ -1263,6 +1505,8 @@
FT_Stream_SeekSet( stream, here );
}
+ FT_TRACE5(( "\n" ));
+
FExit:
FT_FRAME_EXIT();
@@ -1275,13 +1519,230 @@
}
+ /* Shift the original coordinates of all points between indices `p1' */
+ /* and `p2', using the same difference as given by index `ref'. */
+
+ /* modeled after `af_iup_shift' */
+
+ static void
+ tt_delta_shift( int p1,
+ int p2,
+ int ref,
+ FT_Vector* in_points,
+ FT_Vector* out_points )
+ {
+ int p;
+ FT_Vector delta;
+
+
+ delta.x = out_points[ref].x - in_points[ref].x;
+ delta.y = out_points[ref].y - in_points[ref].y;
+
+ if ( delta.x == 0 && delta.y == 0 )
+ return;
+
+ for ( p = p1; p < ref; p++ )
+ {
+ out_points[p].x += delta.x;
+ out_points[p].y += delta.y;
+ }
+
+ for ( p = ref + 1; p <= p2; p++ )
+ {
+ out_points[p].x += delta.x;
+ out_points[p].y += delta.y;
+ }
+ }
+
+
+ /* Interpolate the original coordinates of all points with indices */
+ /* between `p1' and `p2', using `ref1' and `ref2' as the reference */
+ /* point indices. */
+
+ /* modeled after `af_iup_interp', `_iup_worker_interpolate', and */
+ /* `Ins_IUP' */
+
+ static void
+ tt_delta_interpolate( int p1,
+ int p2,
+ int ref1,
+ int ref2,
+ FT_Vector* in_points,
+ FT_Vector* out_points )
+ {
+ int p, i;
+
+ FT_Pos out, in1, in2, out1, out2, d1, d2;
+
+
+ if ( p1 > p2 )
+ return;
+
+ /* handle both horizontal and vertical coordinates */
+ for ( i = 0; i <= 1; i++ )
+ {
+ /* shift array pointers so that we can access `foo.y' as `foo.x' */
+ in_points = (FT_Vector*)( (FT_Pos*)in_points + i );
+ out_points = (FT_Vector*)( (FT_Pos*)out_points + i );
+
+ if ( in_points[ref1].x > in_points[ref2].x )
+ {
+ p = ref1;
+ ref1 = ref2;
+ ref2 = p;
+ }
+
+ in1 = in_points[ref1].x;
+ in2 = in_points[ref2].x;
+ out1 = out_points[ref1].x;
+ out2 = out_points[ref2].x;
+ d1 = out1 - in1;
+ d2 = out2 - in2;
+
+ if ( out1 == out2 || in1 == in2 )
+ {
+ for ( p = p1; p <= p2; p++ )
+ {
+ out = in_points[p].x;
+
+ if ( out <= in1 )
+ out += d1;
+ else if ( out >= in2 )
+ out += d2;
+ else
+ out = out1;
+
+ out_points[p].x = out;
+ }
+ }
+ else
+ {
+ FT_Fixed scale = FT_DivFix( out2 - out1, in2 - in1 );
+
+
+ for ( p = p1; p <= p2; p++ )
+ {
+ out = in_points[p].x;
+
+ if ( out <= in1 )
+ out += d1;
+ else if ( out >= in2 )
+ out += d2;
+ else
+ out = out1 + FT_MulFix( out - in1, scale );
+
+ out_points[p].x = out;
+ }
+ }
+ }
+ }
+
+
+ /* Interpolate points without delta values, similar to */
+ /* the `IUP' hinting instruction. */
+
+ /* modeled after `Ins_IUP */
+
+ static void
+ tt_handle_deltas( FT_Outline* outline,
+ FT_Vector* in_points,
+ FT_Bool* has_delta )
+ {
+ FT_Vector* out_points;
+
+ FT_Int first_point;
+ FT_Int end_point;
+
+ FT_Int first_delta;
+ FT_Int cur_delta;
+
+ FT_Int point;
+ FT_Short contour;
+
+
+ /* ignore empty outlines */
+ if ( !outline->n_contours )
+ return;
+
+ out_points = outline->points;
+
+ contour = 0;
+ point = 0;
+
+ do
+ {
+ end_point = outline->contours[contour];
+ first_point = point;
+
+ /* search first point that has a delta */
+ while ( point <= end_point && !has_delta[point] )
+ point++;
+
+ if ( point <= end_point )
+ {
+ first_delta = point;
+ cur_delta = point;
+
+ point++;
+
+ while ( point <= end_point )
+ {
+ /* search next point that has a delta */
+ /* and interpolate intermediate points */
+ if ( has_delta[point] )
+ {
+ tt_delta_interpolate( cur_delta + 1,
+ point - 1,
+ cur_delta,
+ point,
+ in_points,
+ out_points );
+ cur_delta = point;
+ }
+
+ point++;
+ }
+
+ /* shift contour if we only have a single delta */
+ if ( cur_delta == first_delta )
+ tt_delta_shift( first_point,
+ end_point,
+ cur_delta,
+ in_points,
+ out_points );
+ else
+ {
+ /* otherwise handle remaining points */
+ /* at the end and beginning of the contour */
+ tt_delta_interpolate( cur_delta + 1,
+ end_point,
+ cur_delta,
+ first_delta,
+ in_points,
+ out_points );
+
+ if ( first_delta > 0 )
+ tt_delta_interpolate( first_point,
+ first_delta - 1,
+ cur_delta,
+ first_delta,
+ in_points,
+ out_points );
+ }
+ }
+ contour++;
+
+ } while ( contour < outline->n_contours );
+ }
+
+
/*************************************************************************/
/* */
/* <Function> */
- /* TT_Vary_Get_Glyph_Deltas */
+ /* TT_Vary_Apply_Glyph_Deltas */
/* */
/* <Description> */
- /* Load the appropriate deltas for the current glyph. */
+ /* Apply the appropriate deltas to the current glyph. */
/* */
/* <Input> */
/* face :: A handle to the target face object. */
@@ -1291,22 +1752,24 @@
/* n_points :: The number of the points in the glyph, including */
/* phantom points. */
/* */
- /* <Output> */
- /* deltas :: The array of points to change. */
+ /* <InOut> */
+ /* outline :: The outline to change. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- TT_Vary_Get_Glyph_Deltas( TT_Face face,
- FT_UInt glyph_index,
- FT_Vector* *deltas,
- FT_UInt n_points )
+ TT_Vary_Apply_Glyph_Deltas( TT_Face face,
+ FT_UInt glyph_index,
+ FT_Outline* outline,
+ FT_UInt n_points )
{
FT_Stream stream = face->root.stream;
FT_Memory memory = stream->memory;
GX_Blend blend = face->blend;
- FT_Vector* delta_xy = NULL;
+
+ FT_Vector* points_org = NULL;
+ FT_Bool* has_delta = NULL;
FT_Error error;
FT_ULong glyph_start;
@@ -1327,15 +1790,18 @@
if ( !face->doblend || blend == NULL )
return FT_THROW( Invalid_Argument );
- /* to be freed by the caller */
- if ( FT_NEW_ARRAY( delta_xy, n_points ) )
- goto Exit;
- *deltas = delta_xy;
-
if ( glyph_index >= blend->gv_glyphcnt ||
blend->glyphoffsets[glyph_index] ==
blend->glyphoffsets[glyph_index + 1] )
- return FT_Err_Ok; /* no variation data for this glyph */
+ {
+ FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
+ " no variation data for this glyph\n" ));
+ return FT_Err_Ok;
+ }
+
+ if ( FT_NEW_ARRAY( points_org, n_points ) ||
+ FT_NEW_ARRAY( has_delta, n_points ) )
+ goto Fail1;
if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) ||
FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] -
@@ -1367,41 +1833,43 @@
FT_Stream_SeekSet( stream, here );
}
- for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); ++i )
+ FT_TRACE5(( "gvar: there are %d tuples:\n", tupleCount ));
+
+ for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
{
FT_UInt tupleDataSize;
FT_UInt tupleIndex;
FT_Fixed apply;
+ FT_TRACE6(( " tuple %d:\n", i ));
+
tupleDataSize = FT_GET_USHORT();
tupleIndex = FT_GET_USHORT();
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
- for ( j = 0; j < blend->num_axis; ++j )
- tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from */
+ for ( j = 0; j < blend->num_axis; j++ )
+ tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */
/* short frac to fixed */
}
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
{
error = FT_THROW( Invalid_Table );
- goto Fail3;
+ goto Fail2;
}
else
- {
FT_MEM_COPY(
tuple_coords,
- &blend->tuplecoords[(tupleIndex & 0xFFF) * blend->num_axis],
+ &blend->tuplecoords[( tupleIndex & 0xFFF ) * blend->num_axis],
blend->num_axis * sizeof ( FT_Fixed ) );
- }
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
- for ( j = 0; j < blend->num_axis; ++j )
- im_start_coords[j] = FT_GET_SHORT() << 2;
- for ( j = 0; j < blend->num_axis; ++j )
- im_end_coords[j] = FT_GET_SHORT() << 2;
+ for ( j = 0; j < blend->num_axis; j++ )
+ im_start_coords[j] = FT_GET_SHORT() * 4;
+ for ( j = 0; j < blend->num_axis; j++ )
+ im_end_coords[j] = FT_GET_SHORT() * 4;
}
apply = ft_var_apply_tuple( blend,
@@ -1443,24 +1911,101 @@
else if ( points == ALL_POINTS )
{
+#ifdef FT_DEBUG_LEVEL_TRACE
+ int count = 0;
+#endif
+
+
+ FT_TRACE7(( " point deltas:\n" ));
+
/* this means that there are deltas for every point in the glyph */
- for ( j = 0; j < n_points; ++j )
+ for ( j = 0; j < n_points; j++ )
{
- delta_xy[j].x += FT_MulFix( deltas_x[j], apply );
- delta_xy[j].y += FT_MulFix( deltas_y[j], apply );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_Vector point_org = outline->points[j];
+#endif
+
+
+ outline->points[j].x += FT_MulFix( deltas_x[j], apply );
+ outline->points[j].y += FT_MulFix( deltas_y[j], apply );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( ( point_org.x != outline->points[j].x ) ||
+ ( point_org.y != outline->points[j].y ) )
+ {
+ FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n",
+ j,
+ point_org.x,
+ point_org.y,
+ outline->points[j].x,
+ outline->points[j].y ));
+ count++;
+ }
+#endif
}
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( !count )
+ FT_TRACE7(( " none\n" ));
+#endif
}
else
{
- for ( j = 0; j < point_count; ++j )
+#ifdef FT_DEBUG_LEVEL_TRACE
+ int count = 0;
+#endif
+
+
+ /* we have to interpolate the missing deltas similar to the */
+ /* IUP bytecode instruction */
+ for ( j = 0; j < n_points; j++ )
+ {
+ points_org[j] = outline->points[j];
+ has_delta[j] = FALSE;
+ }
+
+ for ( j = 0; j < point_count; j++ )
{
- if ( localpoints[j] >= n_points )
+ FT_UShort idx = localpoints[j];
+
+
+ if ( idx >= n_points )
continue;
- delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );
- delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );
+ has_delta[idx] = TRUE;
+
+ outline->points[idx].x += FT_MulFix( deltas_x[j], apply );
+ outline->points[idx].y += FT_MulFix( deltas_y[j], apply );
}
+
+ /* no need to handle phantom points here, */
+ /* since solitary points can't be interpolated */
+ tt_handle_deltas( outline,
+ points_org,
+ has_delta );
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE7(( " point deltas:\n" ));
+
+ for ( j = 0; j < n_points; j++)
+ {
+ if ( ( points_org[j].x != outline->points[j].x ) ||
+ ( points_org[j].y != outline->points[j].y ) )
+ {
+ FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n",
+ j,
+ points_org[j].x,
+ points_org[j].y,
+ outline->points[j].x,
+ outline->points[j].y ));
+ count++;
+ }
+ }
+
+ if ( !count )
+ FT_TRACE7(( " none\n" ));
+#endif
}
if ( localpoints != ALL_POINTS )
@@ -1473,22 +2018,19 @@
FT_Stream_SeekSet( stream, here );
}
- Fail3:
+ FT_TRACE5(( "\n" ));
+
+ Fail2:
FT_FREE( tuple_coords );
FT_FREE( im_start_coords );
FT_FREE( im_end_coords );
- Fail2:
FT_FRAME_EXIT();
Fail1:
- if ( error )
- {
- FT_FREE( delta_xy );
- *deltas = NULL;
- }
+ FT_FREE( points_org );
+ FT_FREE( has_delta );
- Exit:
return error;
}
@@ -1499,7 +2041,7 @@
/* tt_done_blend */
/* */
/* <Description> */
- /* Frees the blend internal data structure. */
+ /* Free the blend internal data structure. */
/* */
FT_LOCAL_DEF( void )
tt_done_blend( FT_Memory memory,
@@ -1515,7 +2057,7 @@
if ( blend->avar_segment != NULL )
{
- for ( i = 0; i < blend->num_axis; ++i )
+ for ( i = 0; i < blend->num_axis; i++ )
FT_FREE( blend->avar_segment[i].correspondence );
FT_FREE( blend->avar_segment );
}
diff --git a/src/3rdparty/freetype/src/truetype/ttgxvar.h b/src/3rdparty/freetype/src/truetype/ttgxvar.h
index 82dfc4431f..060d4d60ea 100644
--- a/src/3rdparty/freetype/src/truetype/ttgxvar.h
+++ b/src/3rdparty/freetype/src/truetype/ttgxvar.h
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader (specification) */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004-2015 by */
/* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -162,10 +162,10 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
- TT_Vary_Get_Glyph_Deltas( TT_Face face,
- FT_UInt glyph_index,
- FT_Vector* *deltas,
- FT_UInt n_points );
+ TT_Vary_Apply_Glyph_Deltas( TT_Face face,
+ FT_UInt glyph_index,
+ FT_Outline* outline,
+ FT_UInt n_points );
FT_LOCAL( void )
diff --git a/src/3rdparty/freetype/src/truetype/ttinterp.c b/src/3rdparty/freetype/src/truetype/ttinterp.c
index eccd4aaccb..ae2a82adc5 100644
--- a/src/3rdparty/freetype/src/truetype/ttinterp.c
+++ b/src/3rdparty/freetype/src/truetype/ttinterp.c
@@ -4,8 +4,8 @@
/* */
/* TrueType bytecode interpreter (body). */
/* */
-/* Copyright 1996-2014 */
-/* by David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* Copyright 1996-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -44,6 +44,7 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_ttinterp
+
/*************************************************************************/
/* */
/* In order to detect infinite loops in the code, we set up a counter */
@@ -53,174 +54,30 @@
#define MAX_RUNNABLE_OPCODES 1000000L
- /*************************************************************************/
- /* */
- /* There are two kinds of implementations: */
- /* */
- /* a. static implementation */
- /* */
- /* The current execution context is a static variable, which fields */
- /* are accessed directly by the interpreter during execution. The */
- /* context is named `cur'. */
- /* */
- /* This version is non-reentrant, of course. */
- /* */
- /* b. indirect implementation */
- /* */
- /* The current execution context is passed to _each_ function as its */
- /* first argument, and each field is thus accessed indirectly. */
- /* */
- /* This version is fully re-entrant. */
- /* */
- /* The idea is that an indirect implementation may be slower to execute */
- /* on low-end processors that are used in some systems (like 386s or */
- /* even 486s). */
- /* */
- /* As a consequence, the indirect implementation is now the default, as */
- /* its performance costs can be considered negligible in our context. */
- /* Note, however, that we kept the same source with macros because: */
- /* */
- /* - The code is kept very close in design to the Pascal code used for */
- /* development. */
- /* */
- /* - It's much more readable that way! */
- /* */
- /* - It's still open to experimentation and tuning. */
- /* */
- /*************************************************************************/
-
-
-#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */
-
-#define CUR (*exc) /* see ttobjs.h */
-
- /*************************************************************************/
- /* */
- /* This macro is used whenever `exec' is unused in a function, to avoid */
- /* stupid warnings from pedantic compilers. */
- /* */
-#define FT_UNUSED_EXEC FT_UNUSED( exc )
-
-#else /* static implementation */
-
-#define CUR cur
-
-#define FT_UNUSED_EXEC int __dummy = __dummy
-
- static
- TT_ExecContextRec cur; /* static exec. context variable */
-
- /* apparently, we have a _lot_ of direct indexing when accessing */
- /* the static `cur', which makes the code bigger (due to all the */
- /* four bytes addresses). */
-
-#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */
-
-
- /*************************************************************************/
- /* */
- /* The instruction argument stack. */
- /* */
-#define INS_ARG EXEC_OP_ FT_Long* args /* see ttobjs.h for EXEC_OP_ */
-
-
- /*************************************************************************/
- /* */
- /* This macro is used whenever `args' is unused in a function, to avoid */
- /* stupid warnings from pedantic compilers. */
- /* */
-#define FT_UNUSED_ARG FT_UNUSED_EXEC; FT_UNUSED( args )
-
-
-#define SUBPIXEL_HINTING \
- ( ((TT_Driver)FT_FACE_DRIVER( CUR.face ))->interpreter_version == \
+#define SUBPIXEL_HINTING \
+ ( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \
TT_INTERPRETER_VERSION_38 )
- /*************************************************************************/
- /* */
- /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to */
- /* increase readability of the code. */
- /* */
- /*************************************************************************/
-
-
-#define SKIP_Code() \
- SkipCode( EXEC_ARG )
-
-#define GET_ShortIns() \
- GetShortIns( EXEC_ARG )
-
-#define NORMalize( x, y, v ) \
- Normalize( EXEC_ARG_ x, y, v )
-
-#define SET_SuperRound( scale, flags ) \
- SetSuperRound( EXEC_ARG_ scale, flags )
-
-#define ROUND_None( d, c ) \
- Round_None( EXEC_ARG_ d, c )
-
-#define INS_Goto_CodeRange( range, ip ) \
- Ins_Goto_CodeRange( EXEC_ARG_ range, ip )
-
-#define CUR_Func_move( z, p, d ) \
- CUR.func_move( EXEC_ARG_ z, p, d )
-
-#define CUR_Func_move_orig( z, p, d ) \
- CUR.func_move_orig( EXEC_ARG_ z, p, d )
-
-#define CUR_Func_round( d, c ) \
- CUR.func_round( EXEC_ARG_ d, c )
-
-#define CUR_Func_cur_ppem() \
- CUR.func_cur_ppem( EXEC_ARG )
-
-#define CUR_Func_read_cvt( index ) \
- CUR.func_read_cvt( EXEC_ARG_ index )
-
-#define CUR_Func_write_cvt( index, val ) \
- CUR.func_write_cvt( EXEC_ARG_ index, val )
-
-#define CUR_Func_move_cvt( index, val ) \
- CUR.func_move_cvt( EXEC_ARG_ index, val )
-
-#define CURRENT_Ratio() \
- Current_Ratio( EXEC_ARG )
-
-#define INS_SxVTL( a, b, c, d ) \
- Ins_SxVTL( EXEC_ARG_ a, b, c, d )
-
-#define COMPUTE_Funcs() \
- Compute_Funcs( EXEC_ARG )
+#define PROJECT( v1, v2 ) \
+ exc->func_project( exc, (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-#define COMPUTE_Round( a ) \
- Compute_Round( EXEC_ARG_ a )
+#define DUALPROJ( v1, v2 ) \
+ exc->func_dualproj( exc, (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-#define COMPUTE_Point_Displacement( a, b, c, d ) \
- Compute_Point_Displacement( EXEC_ARG_ a, b, c, d )
+#define FAST_PROJECT( v ) \
+ exc->func_project( exc, (v)->x, (v)->y )
-#define MOVE_Zp2_Point( a, b, c, t ) \
- Move_Zp2_Point( EXEC_ARG_ a, b, c, t )
-
-
-#define CUR_Func_project( v1, v2 ) \
- CUR.func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-
-#define CUR_Func_dualproj( v1, v2 ) \
- CUR.func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-
-#define CUR_fast_project( v ) \
- CUR.func_project( EXEC_ARG_ (v)->x, (v)->y )
-
-#define CUR_fast_dualproj( v ) \
- CUR.func_dualproj( EXEC_ARG_ (v)->x, (v)->y )
+#define FAST_DUALPROJ( v ) \
+ exc->func_dualproj( exc, (v)->x, (v)->y )
/*************************************************************************/
/* */
/* Instruction dispatch function, as used by the interpreter. */
/* */
- typedef void (*TInstruction_Function)( INS_ARG );
+ typedef void (*TInstruction_Function)( TT_ExecContext exc,
+ FT_Long* args );
/*************************************************************************/
@@ -230,13 +87,6 @@
#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) )
#define BOUNDSL( x, n ) ( (FT_ULong)(x) >= (FT_ULong)(n) )
- /*************************************************************************/
- /* */
- /* This macro computes (a*2^14)/b and complements TT_MulFix14. */
- /* */
-#define TT_DivFix14( a, b ) \
- FT_DivFix( a, (b) << 2 )
-
#undef SUCCESS
#define SUCCESS 0
@@ -245,16 +95,20 @@
#define FAILURE 1
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
-#define GUESS_VECTOR( V ) \
- if ( CUR.face->unpatented_hinting ) \
- { \
- CUR.GS.V.x = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0x4000 : 0 ); \
- CUR.GS.V.y = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0 : 0x4000 ); \
- }
+#define GUESS_VECTOR( V ) \
+ do \
+ { \
+ if ( exc->face->unpatented_hinting ) \
+ { \
+ exc->GS.V.x = (FT_F2Dot14)( exc->GS.both_x_axis ? 0x4000 : 0 ); \
+ exc->GS.V.y = (FT_F2Dot14)( exc->GS.both_x_axis ? 0 : 0x4000 ); \
+ } \
+ } while (0)
#else
-#define GUESS_VECTOR( V )
+#define GUESS_VECTOR( V ) do { } while (0)
#endif
+
/*************************************************************************/
/* */
/* CODERANGE FUNCTIONS */
@@ -297,7 +151,7 @@
/* which will return to the first byte *after* the code */
/* range, we test for IP <= Size instead of IP < Size. */
/* */
- FT_ASSERT( (FT_ULong)IP <= coderange->size );
+ FT_ASSERT( IP <= coderange->size );
exec->code = coderange->base;
exec->codeSize = coderange->size;
@@ -498,7 +352,7 @@
FT_LOCAL_DEF( FT_Error )
Update_Max( FT_Memory memory,
FT_ULong* size,
- FT_Long multiplier,
+ FT_ULong multiplier,
void* _pbuff,
FT_ULong new_max )
{
@@ -591,13 +445,13 @@
/* XXX: We reserve a little more elements on the stack to deal safely */
/* with broken fonts like arialbs, courbs, timesbs, etc. */
- tmp = exec->stackSize;
+ tmp = (FT_ULong)exec->stackSize;
error = Update_Max( exec->memory,
&tmp,
sizeof ( FT_F26Dot6 ),
(void*)&exec->stack,
maxp->maxStackElements + 32 );
- exec->stackSize = (FT_UInt)tmp;
+ exec->stackSize = (FT_Long)tmp;
if ( error )
return error;
@@ -683,12 +537,8 @@
/* <Return> */
/* TrueType error code. 0 means success. */
/* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* */
FT_LOCAL_DEF( FT_Error )
- TT_Run_Context( TT_ExecContext exec,
- FT_Bool debug )
+ TT_Run_Context( TT_ExecContext exec )
{
TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 );
@@ -718,16 +568,7 @@
exec->top = 0;
exec->callTop = 0;
-#if 1
- FT_UNUSED( debug );
-
return exec->face->interpreter( exec );
-#else
- if ( !debug )
- return TT_RunIns( exec );
- else
- return FT_Err_Ok;
-#endif
}
@@ -761,6 +602,9 @@
TT_New_Context( TT_Driver driver )
{
FT_Memory memory;
+ FT_Error error;
+
+ TT_ExecContext exec = NULL;
if ( !driver )
@@ -768,26 +612,16 @@
memory = driver->root.root.memory;
- if ( !driver->context )
- {
- FT_Error error;
- TT_ExecContext exec;
-
-
- /* allocate object */
- if ( FT_NEW( exec ) )
- goto Fail;
-
- /* initialize it; in case of error this deallocates `exec' too */
- error = Init_Context( exec, memory );
- if ( error )
- goto Fail;
+ /* allocate object */
+ if ( FT_NEW( exec ) )
+ goto Fail;
- /* store it into the driver */
- driver->context = exec;
- }
+ /* initialize it; in case of error this deallocates `exec' too */
+ error = Init_Context( exec, memory );
+ if ( error )
+ goto Fail;
- return driver->context;
+ return exec;
Fail:
return NULL;
@@ -834,8 +668,8 @@
/* SFvTL + */ PACK( 2, 0 ),
/* SPvFS */ PACK( 2, 0 ),
/* SFvFS */ PACK( 2, 0 ),
- /* GPV */ PACK( 0, 2 ),
- /* GFV */ PACK( 0, 2 ),
+ /* GPv */ PACK( 0, 2 ),
+ /* GFv */ PACK( 0, 2 ),
/* SFvTPv */ PACK( 0, 0 ),
/* ISECT */ PACK( 5, 0 ),
@@ -964,8 +798,8 @@
/* INS_$83 */ PACK( 0, 0 ),
/* INS_$84 */ PACK( 0, 0 ),
/* ScanCTRL */ PACK( 1, 0 ),
- /* SDPVTL[0] */ PACK( 2, 0 ),
- /* SDPVTL[1] */ PACK( 2, 0 ),
+ /* SDPvTL[0] */ PACK( 2, 0 ),
+ /* SDPvTL[1] */ PACK( 2, 0 ),
/* GetINFO */ PACK( 1, 1 ),
/* IDEF */ PACK( 1, 0 ),
/* ROLL */ PACK( 3, 3 ),
@@ -1098,280 +932,284 @@
#ifdef FT_DEBUG_LEVEL_TRACE
+ /* the first hex digit gives the length of the opcode name; the space */
+ /* after the digit is here just to increase readability of the source */
+ /* code */
+
static
const char* const opcode_name[256] =
{
- "SVTCA y",
- "SVTCA x",
- "SPvTCA y",
- "SPvTCA x",
- "SFvTCA y",
- "SFvTCA x",
- "SPvTL ||",
- "SPvTL +",
- "SFvTL ||",
- "SFvTL +",
- "SPvFS",
- "SFvFS",
- "GPV",
- "GFV",
- "SFvTPv",
- "ISECT",
-
- "SRP0",
- "SRP1",
- "SRP2",
- "SZP0",
- "SZP1",
- "SZP2",
- "SZPS",
- "SLOOP",
- "RTG",
- "RTHG",
- "SMD",
- "ELSE",
- "JMPR",
- "SCvTCi",
- "SSwCi",
- "SSW",
-
- "DUP",
- "POP",
- "CLEAR",
- "SWAP",
- "DEPTH",
- "CINDEX",
- "MINDEX",
- "AlignPTS",
- "INS_$28",
- "UTP",
- "LOOPCALL",
- "CALL",
- "FDEF",
- "ENDF",
- "MDAP[0]",
- "MDAP[1]",
-
- "IUP[0]",
- "IUP[1]",
- "SHP[0]",
- "SHP[1]",
- "SHC[0]",
- "SHC[1]",
- "SHZ[0]",
- "SHZ[1]",
- "SHPIX",
- "IP",
- "MSIRP[0]",
- "MSIRP[1]",
- "AlignRP",
- "RTDG",
- "MIAP[0]",
- "MIAP[1]",
-
- "NPushB",
- "NPushW",
- "WS",
- "RS",
- "WCvtP",
- "RCvt",
- "GC[0]",
- "GC[1]",
- "SCFS",
- "MD[0]",
- "MD[1]",
- "MPPEM",
- "MPS",
- "FlipON",
- "FlipOFF",
- "DEBUG",
-
- "LT",
- "LTEQ",
- "GT",
- "GTEQ",
- "EQ",
- "NEQ",
- "ODD",
- "EVEN",
- "IF",
- "EIF",
- "AND",
- "OR",
- "NOT",
- "DeltaP1",
- "SDB",
- "SDS",
-
- "ADD",
- "SUB",
- "DIV",
- "MUL",
- "ABS",
- "NEG",
- "FLOOR",
- "CEILING",
- "ROUND[0]",
- "ROUND[1]",
- "ROUND[2]",
- "ROUND[3]",
- "NROUND[0]",
- "NROUND[1]",
- "NROUND[2]",
- "NROUND[3]",
-
- "WCvtF",
- "DeltaP2",
- "DeltaP3",
- "DeltaCn[0]",
- "DeltaCn[1]",
- "DeltaCn[2]",
- "SROUND",
- "S45Round",
- "JROT",
- "JROF",
- "ROFF",
- "INS_$7B",
- "RUTG",
- "RDTG",
- "SANGW",
- "AA",
-
- "FlipPT",
- "FlipRgON",
- "FlipRgOFF",
- "INS_$83",
- "INS_$84",
- "ScanCTRL",
- "SDVPTL[0]",
- "SDVPTL[1]",
- "GetINFO",
- "IDEF",
- "ROLL",
- "MAX",
- "MIN",
- "ScanTYPE",
- "InstCTRL",
- "INS_$8F",
-
- "INS_$90",
- "INS_$91",
- "INS_$92",
- "INS_$93",
- "INS_$94",
- "INS_$95",
- "INS_$96",
- "INS_$97",
- "INS_$98",
- "INS_$99",
- "INS_$9A",
- "INS_$9B",
- "INS_$9C",
- "INS_$9D",
- "INS_$9E",
- "INS_$9F",
-
- "INS_$A0",
- "INS_$A1",
- "INS_$A2",
- "INS_$A3",
- "INS_$A4",
- "INS_$A5",
- "INS_$A6",
- "INS_$A7",
- "INS_$A8",
- "INS_$A9",
- "INS_$AA",
- "INS_$AB",
- "INS_$AC",
- "INS_$AD",
- "INS_$AE",
- "INS_$AF",
-
- "PushB[0]",
- "PushB[1]",
- "PushB[2]",
- "PushB[3]",
- "PushB[4]",
- "PushB[5]",
- "PushB[6]",
- "PushB[7]",
- "PushW[0]",
- "PushW[1]",
- "PushW[2]",
- "PushW[3]",
- "PushW[4]",
- "PushW[5]",
- "PushW[6]",
- "PushW[7]",
-
- "MDRP[00]",
- "MDRP[01]",
- "MDRP[02]",
- "MDRP[03]",
- "MDRP[04]",
- "MDRP[05]",
- "MDRP[06]",
- "MDRP[07]",
- "MDRP[08]",
- "MDRP[09]",
- "MDRP[10]",
- "MDRP[11]",
- "MDRP[12]",
- "MDRP[13]",
- "MDRP[14]",
- "MDRP[15]",
-
- "MDRP[16]",
- "MDRP[17]",
- "MDRP[18]",
- "MDRP[19]",
- "MDRP[20]",
- "MDRP[21]",
- "MDRP[22]",
- "MDRP[23]",
- "MDRP[24]",
- "MDRP[25]",
- "MDRP[26]",
- "MDRP[27]",
- "MDRP[28]",
- "MDRP[29]",
- "MDRP[30]",
- "MDRP[31]",
-
- "MIRP[00]",
- "MIRP[01]",
- "MIRP[02]",
- "MIRP[03]",
- "MIRP[04]",
- "MIRP[05]",
- "MIRP[06]",
- "MIRP[07]",
- "MIRP[08]",
- "MIRP[09]",
- "MIRP[10]",
- "MIRP[11]",
- "MIRP[12]",
- "MIRP[13]",
- "MIRP[14]",
- "MIRP[15]",
-
- "MIRP[16]",
- "MIRP[17]",
- "MIRP[18]",
- "MIRP[19]",
- "MIRP[20]",
- "MIRP[21]",
- "MIRP[22]",
- "MIRP[23]",
- "MIRP[24]",
- "MIRP[25]",
- "MIRP[26]",
- "MIRP[27]",
- "MIRP[28]",
- "MIRP[29]",
- "MIRP[30]",
- "MIRP[31]"
+ "7 SVTCA y",
+ "7 SVTCA x",
+ "8 SPvTCA y",
+ "8 SPvTCA x",
+ "8 SFvTCA y",
+ "8 SFvTCA x",
+ "8 SPvTL ||",
+ "7 SPvTL +",
+ "8 SFvTL ||",
+ "7 SFvTL +",
+ "5 SPvFS",
+ "5 SFvFS",
+ "3 GPv",
+ "3 GFv",
+ "6 SFvTPv",
+ "5 ISECT",
+
+ "4 SRP0",
+ "4 SRP1",
+ "4 SRP2",
+ "4 SZP0",
+ "4 SZP1",
+ "4 SZP2",
+ "4 SZPS",
+ "5 SLOOP",
+ "3 RTG",
+ "4 RTHG",
+ "3 SMD",
+ "4 ELSE",
+ "4 JMPR",
+ "6 SCvTCi",
+ "5 SSwCi",
+ "3 SSW",
+
+ "3 DUP",
+ "3 POP",
+ "5 CLEAR",
+ "4 SWAP",
+ "5 DEPTH",
+ "6 CINDEX",
+ "6 MINDEX",
+ "8 AlignPTS",
+ "7 INS_$28",
+ "3 UTP",
+ "8 LOOPCALL",
+ "4 CALL",
+ "4 FDEF",
+ "4 ENDF",
+ "7 MDAP[0]",
+ "7 MDAP[1]",
+
+ "6 IUP[0]",
+ "6 IUP[1]",
+ "6 SHP[0]",
+ "6 SHP[1]",
+ "6 SHC[0]",
+ "6 SHC[1]",
+ "6 SHZ[0]",
+ "6 SHZ[1]",
+ "5 SHPIX",
+ "2 IP",
+ "8 MSIRP[0]",
+ "8 MSIRP[1]",
+ "7 AlignRP",
+ "4 RTDG",
+ "7 MIAP[0]",
+ "7 MIAP[1]",
+
+ "6 NPushB",
+ "6 NPushW",
+ "2 WS",
+ "2 RS",
+ "5 WCvtP",
+ "4 RCvt",
+ "5 GC[0]",
+ "5 GC[1]",
+ "4 SCFS",
+ "5 MD[0]",
+ "5 MD[1]",
+ "5 MPPEM",
+ "3 MPS",
+ "6 FlipON",
+ "7 FlipOFF",
+ "5 DEBUG",
+
+ "2 LT",
+ "4 LTEQ",
+ "2 GT",
+ "4 GTEQ",
+ "2 EQ",
+ "3 NEQ",
+ "3 ODD",
+ "4 EVEN",
+ "2 IF",
+ "3 EIF",
+ "3 AND",
+ "2 OR",
+ "3 NOT",
+ "7 DeltaP1",
+ "3 SDB",
+ "3 SDS",
+
+ "3 ADD",
+ "3 SUB",
+ "3 DIV",
+ "3 MUL",
+ "3 ABS",
+ "3 NEG",
+ "5 FLOOR",
+ "7 CEILING",
+ "8 ROUND[0]",
+ "8 ROUND[1]",
+ "8 ROUND[2]",
+ "8 ROUND[3]",
+ "9 NROUND[0]",
+ "9 NROUND[1]",
+ "9 NROUND[2]",
+ "9 NROUND[3]",
+
+ "5 WCvtF",
+ "7 DeltaP2",
+ "7 DeltaP3",
+ "A DeltaCn[0]",
+ "A DeltaCn[1]",
+ "A DeltaCn[2]",
+ "6 SROUND",
+ "8 S45Round",
+ "4 JROT",
+ "4 JROF",
+ "4 ROFF",
+ "7 INS_$7B",
+ "4 RUTG",
+ "4 RDTG",
+ "5 SANGW",
+ "2 AA",
+
+ "6 FlipPT",
+ "8 FlipRgON",
+ "9 FlipRgOFF",
+ "7 INS_$83",
+ "7 INS_$84",
+ "8 ScanCTRL",
+ "9 SDPvTL[0]",
+ "9 SDPvTL[1]",
+ "7 GetINFO",
+ "4 IDEF",
+ "4 ROLL",
+ "3 MAX",
+ "3 MIN",
+ "8 ScanTYPE",
+ "8 InstCTRL",
+ "7 INS_$8F",
+
+ "7 INS_$90",
+ "7 INS_$91",
+ "7 INS_$92",
+ "7 INS_$93",
+ "7 INS_$94",
+ "7 INS_$95",
+ "7 INS_$96",
+ "7 INS_$97",
+ "7 INS_$98",
+ "7 INS_$99",
+ "7 INS_$9A",
+ "7 INS_$9B",
+ "7 INS_$9C",
+ "7 INS_$9D",
+ "7 INS_$9E",
+ "7 INS_$9F",
+
+ "7 INS_$A0",
+ "7 INS_$A1",
+ "7 INS_$A2",
+ "7 INS_$A3",
+ "7 INS_$A4",
+ "7 INS_$A5",
+ "7 INS_$A6",
+ "7 INS_$A7",
+ "7 INS_$A8",
+ "7 INS_$A9",
+ "7 INS_$AA",
+ "7 INS_$AB",
+ "7 INS_$AC",
+ "7 INS_$AD",
+ "7 INS_$AE",
+ "7 INS_$AF",
+
+ "8 PushB[0]",
+ "8 PushB[1]",
+ "8 PushB[2]",
+ "8 PushB[3]",
+ "8 PushB[4]",
+ "8 PushB[5]",
+ "8 PushB[6]",
+ "8 PushB[7]",
+ "8 PushW[0]",
+ "8 PushW[1]",
+ "8 PushW[2]",
+ "8 PushW[3]",
+ "8 PushW[4]",
+ "8 PushW[5]",
+ "8 PushW[6]",
+ "8 PushW[7]",
+
+ "8 MDRP[00]",
+ "8 MDRP[01]",
+ "8 MDRP[02]",
+ "8 MDRP[03]",
+ "8 MDRP[04]",
+ "8 MDRP[05]",
+ "8 MDRP[06]",
+ "8 MDRP[07]",
+ "8 MDRP[08]",
+ "8 MDRP[09]",
+ "8 MDRP[10]",
+ "8 MDRP[11]",
+ "8 MDRP[12]",
+ "8 MDRP[13]",
+ "8 MDRP[14]",
+ "8 MDRP[15]",
+
+ "8 MDRP[16]",
+ "8 MDRP[17]",
+ "8 MDRP[18]",
+ "8 MDRP[19]",
+ "8 MDRP[20]",
+ "8 MDRP[21]",
+ "8 MDRP[22]",
+ "8 MDRP[23]",
+ "8 MDRP[24]",
+ "8 MDRP[25]",
+ "8 MDRP[26]",
+ "8 MDRP[27]",
+ "8 MDRP[28]",
+ "8 MDRP[29]",
+ "8 MDRP[30]",
+ "8 MDRP[31]",
+
+ "8 MIRP[00]",
+ "8 MIRP[01]",
+ "8 MIRP[02]",
+ "8 MIRP[03]",
+ "8 MIRP[04]",
+ "8 MIRP[05]",
+ "8 MIRP[06]",
+ "8 MIRP[07]",
+ "8 MIRP[08]",
+ "8 MIRP[09]",
+ "8 MIRP[10]",
+ "8 MIRP[11]",
+ "8 MIRP[12]",
+ "8 MIRP[13]",
+ "8 MIRP[14]",
+ "8 MIRP[15]",
+
+ "8 MIRP[16]",
+ "8 MIRP[17]",
+ "8 MIRP[18]",
+ "8 MIRP[19]",
+ "8 MIRP[20]",
+ "8 MIRP[21]",
+ "8 MIRP[22]",
+ "8 MIRP[23]",
+ "8 MIRP[24]",
+ "8 MIRP[25]",
+ "8 MIRP[26]",
+ "8 MIRP[27]",
+ "8 MIRP[28]",
+ "8 MIRP[29]",
+ "8 MIRP[30]",
+ "8 MIRP[31]"
};
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -1637,55 +1475,55 @@
/* The aspect ratio in 16.16 format, always <= 1.0 . */
/* */
static FT_Long
- Current_Ratio( EXEC_OP )
+ Current_Ratio( TT_ExecContext exc )
{
- if ( !CUR.tt_metrics.ratio )
+ if ( !exc->tt_metrics.ratio )
{
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
- if ( CUR.GS.both_x_axis )
- CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;
+ if ( exc->GS.both_x_axis )
+ exc->tt_metrics.ratio = exc->tt_metrics.x_ratio;
else
- CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;
+ exc->tt_metrics.ratio = exc->tt_metrics.y_ratio;
}
else
#endif
{
- if ( CUR.GS.projVector.y == 0 )
- CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;
+ if ( exc->GS.projVector.y == 0 )
+ exc->tt_metrics.ratio = exc->tt_metrics.x_ratio;
- else if ( CUR.GS.projVector.x == 0 )
- CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;
+ else if ( exc->GS.projVector.x == 0 )
+ exc->tt_metrics.ratio = exc->tt_metrics.y_ratio;
else
{
FT_F26Dot6 x, y;
- x = TT_MulFix14( CUR.tt_metrics.x_ratio,
- CUR.GS.projVector.x );
- y = TT_MulFix14( CUR.tt_metrics.y_ratio,
- CUR.GS.projVector.y );
- CUR.tt_metrics.ratio = FT_Hypot( x, y );
+ x = TT_MulFix14( exc->tt_metrics.x_ratio,
+ exc->GS.projVector.x );
+ y = TT_MulFix14( exc->tt_metrics.y_ratio,
+ exc->GS.projVector.y );
+ exc->tt_metrics.ratio = FT_Hypot( x, y );
}
}
}
- return CUR.tt_metrics.ratio;
+ return exc->tt_metrics.ratio;
}
FT_CALLBACK_DEF( FT_Long )
- Current_Ppem( EXEC_OP )
+ Current_Ppem( TT_ExecContext exc )
{
- return CUR.tt_metrics.ppem;
+ return exc->tt_metrics.ppem;
}
FT_CALLBACK_DEF( FT_Long )
- Current_Ppem_Stretched( EXEC_OP )
+ Current_Ppem_Stretched( TT_ExecContext exc )
{
- return FT_MulFix( CUR.tt_metrics.ppem, CURRENT_Ratio() );
+ return FT_MulFix( exc->tt_metrics.ppem, Current_Ratio( exc ) );
}
@@ -1697,48 +1535,54 @@
FT_CALLBACK_DEF( FT_F26Dot6 )
- Read_CVT( EXEC_OP_ FT_ULong idx )
+ Read_CVT( TT_ExecContext exc,
+ FT_ULong idx )
{
- return CUR.cvt[idx];
+ return exc->cvt[idx];
}
FT_CALLBACK_DEF( FT_F26Dot6 )
- Read_CVT_Stretched( EXEC_OP_ FT_ULong idx )
+ Read_CVT_Stretched( TT_ExecContext exc,
+ FT_ULong idx )
{
- return FT_MulFix( CUR.cvt[idx], CURRENT_Ratio() );
+ return FT_MulFix( exc->cvt[idx], Current_Ratio( exc ) );
}
FT_CALLBACK_DEF( void )
- Write_CVT( EXEC_OP_ FT_ULong idx,
- FT_F26Dot6 value )
+ Write_CVT( TT_ExecContext exc,
+ FT_ULong idx,
+ FT_F26Dot6 value )
{
- CUR.cvt[idx] = value;
+ exc->cvt[idx] = value;
}
FT_CALLBACK_DEF( void )
- Write_CVT_Stretched( EXEC_OP_ FT_ULong idx,
- FT_F26Dot6 value )
+ Write_CVT_Stretched( TT_ExecContext exc,
+ FT_ULong idx,
+ FT_F26Dot6 value )
{
- CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() );
+ exc->cvt[idx] = FT_DivFix( value, Current_Ratio( exc ) );
}
FT_CALLBACK_DEF( void )
- Move_CVT( EXEC_OP_ FT_ULong idx,
- FT_F26Dot6 value )
+ Move_CVT( TT_ExecContext exc,
+ FT_ULong idx,
+ FT_F26Dot6 value )
{
- CUR.cvt[idx] += value;
+ exc->cvt[idx] += value;
}
FT_CALLBACK_DEF( void )
- Move_CVT_Stretched( EXEC_OP_ FT_ULong idx,
- FT_F26Dot6 value )
+ Move_CVT_Stretched( TT_ExecContext exc,
+ FT_ULong idx,
+ FT_F26Dot6 value )
{
- CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() );
+ exc->cvt[idx] += FT_DivFix( value, Current_Ratio( exc ) );
}
@@ -1758,12 +1602,12 @@
/* This one could become a macro. */
/* */
static FT_Short
- GetShortIns( EXEC_OP )
+ GetShortIns( TT_ExecContext exc )
{
/* Reading a byte stream so there is no endianess (DaveP) */
- CUR.IP += 2;
- return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) +
- CUR.code[CUR.IP - 1] );
+ exc->IP += 2;
+ return (FT_Short)( ( exc->code[exc->IP - 2] << 8 ) +
+ exc->code[exc->IP - 1] );
}
@@ -1784,23 +1628,24 @@
/* SUCCESS or FAILURE. */
/* */
static FT_Bool
- Ins_Goto_CodeRange( EXEC_OP_ FT_Int aRange,
- FT_ULong aIP )
+ Ins_Goto_CodeRange( TT_ExecContext exc,
+ FT_Int aRange,
+ FT_Long aIP )
{
TT_CodeRange* range;
if ( aRange < 1 || aRange > 3 )
{
- CUR.error = FT_THROW( Bad_Argument );
+ exc->error = FT_THROW( Bad_Argument );
return FAILURE;
}
- range = &CUR.codeRangeTable[aRange - 1];
+ range = &exc->codeRangeTable[aRange - 1];
if ( range->base == NULL ) /* invalid coderange */
{
- CUR.error = FT_THROW( Invalid_CodeRange );
+ exc->error = FT_THROW( Invalid_CodeRange );
return FAILURE;
}
@@ -1810,14 +1655,14 @@
if ( aIP > range->size )
{
- CUR.error = FT_THROW( Code_Overflow );
+ exc->error = FT_THROW( Code_Overflow );
return FAILURE;
}
- CUR.code = range->base;
- CUR.codeSize = range->size;
- CUR.IP = aIP;
- CUR.curRange = aRange;
+ exc->code = range->base;
+ exc->codeSize = range->size;
+ exc->IP = aIP;
+ exc->curRange = aRange;
return SUCCESS;
}
@@ -1841,36 +1686,37 @@
/* zone :: The affected glyph zone. */
/* */
static void
- Direct_Move( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
FT_F26Dot6 v;
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- FT_ASSERT( !CUR.face->unpatented_hinting );
+ FT_ASSERT( !exc->face->unpatented_hinting );
#endif
- v = CUR.GS.freeVector.x;
+ v = exc->GS.freeVector.x;
if ( v != 0 )
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( !SUBPIXEL_HINTING ||
- ( !CUR.ignore_x_mode ||
- ( CUR.sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) )
+ if ( !SUBPIXEL_HINTING ||
+ ( !exc->ignore_x_mode ||
+ ( exc->sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) )
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- zone->cur[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );
+ zone->cur[point].x += FT_MulDiv( distance, v, exc->F_dot_P );
zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
}
- v = CUR.GS.freeVector.y;
+ v = exc->GS.freeVector.y;
if ( v != 0 )
{
- zone->cur[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );
+ zone->cur[point].y += FT_MulDiv( distance, v, exc->F_dot_P );
zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
}
@@ -1895,26 +1741,27 @@
/* zone :: The affected glyph zone. */
/* */
static void
- Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_Orig( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
FT_F26Dot6 v;
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- FT_ASSERT( !CUR.face->unpatented_hinting );
+ FT_ASSERT( !exc->face->unpatented_hinting );
#endif
- v = CUR.GS.freeVector.x;
+ v = exc->GS.freeVector.x;
if ( v != 0 )
- zone->org[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );
+ zone->org[point].x += FT_MulDiv( distance, v, exc->F_dot_P );
- v = CUR.GS.freeVector.y;
+ v = exc->GS.freeVector.y;
if ( v != 0 )
- zone->org[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );
+ zone->org[point].y += FT_MulDiv( distance, v, exc->F_dot_P );
}
@@ -1929,15 +1776,16 @@
static void
- Direct_Move_X( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_X( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( !SUBPIXEL_HINTING ||
- !CUR.ignore_x_mode )
+ if ( !SUBPIXEL_HINTING ||
+ !exc->ignore_x_mode )
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
zone->cur[point].x += distance;
@@ -1946,11 +1794,12 @@
static void
- Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_Y( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
zone->cur[point].y += distance;
zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
@@ -1968,22 +1817,24 @@
static void
- Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_Orig_X( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
zone->org[point].x += distance;
}
static void
- Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_Orig_Y( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
zone->org[point].y += distance;
}
@@ -2012,12 +1863,13 @@
/* before rounding. */
/* */
static FT_F26Dot6
- Round_None( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_None( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
if ( distance >= 0 )
@@ -2053,12 +1905,13 @@
/* Rounded distance. */
/* */
static FT_F26Dot6
- Round_To_Grid( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_To_Grid( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
if ( distance >= 0 )
@@ -2074,7 +1927,7 @@
val = 0;
}
- return val;
+ return val;
}
@@ -2095,12 +1948,13 @@
/* Rounded distance. */
/* */
static FT_F26Dot6
- Round_To_Half_Grid( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_To_Half_Grid( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
if ( distance >= 0 )
@@ -2137,12 +1991,13 @@
/* Rounded distance. */
/* */
static FT_F26Dot6
- Round_Down_To_Grid( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_Down_To_Grid( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
if ( distance >= 0 )
@@ -2179,12 +2034,13 @@
/* Rounded distance. */
/* */
static FT_F26Dot6
- Round_Up_To_Grid( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_Up_To_Grid( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
if ( distance >= 0 )
@@ -2221,12 +2077,13 @@
/* Rounded distance. */
/* */
static FT_F26Dot6
- Round_To_Double_Grid( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_To_Double_Grid( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
if ( distance >= 0 )
@@ -2269,27 +2126,28 @@
/* before rounding. */
/* */
static FT_F26Dot6
- Round_Super( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_Super( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
if ( distance >= 0 )
{
- val = ( distance - CUR.phase + CUR.threshold + compensation ) &
- -CUR.period;
- val += CUR.phase;
+ val = ( distance - exc->phase + exc->threshold + compensation ) &
+ -exc->period;
+ val += exc->phase;
if ( val < 0 )
- val = CUR.phase;
+ val = exc->phase;
}
else
{
- val = -( ( CUR.threshold - CUR.phase - distance + compensation ) &
- -CUR.period );
- val -= CUR.phase;
+ val = -( ( exc->threshold - exc->phase - distance + compensation ) &
+ -exc->period );
+ val -= exc->phase;
if ( val > 0 )
- val = -CUR.phase;
+ val = -exc->phase;
}
return val;
@@ -2317,27 +2175,28 @@
/* greater precision. */
/* */
static FT_F26Dot6
- Round_Super_45( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ Round_Super_45( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation )
{
FT_F26Dot6 val;
if ( distance >= 0 )
{
- val = ( ( distance - CUR.phase + CUR.threshold + compensation ) /
- CUR.period ) * CUR.period;
- val += CUR.phase;
+ val = ( ( distance - exc->phase + exc->threshold + compensation ) /
+ exc->period ) * exc->period;
+ val += exc->phase;
if ( val < 0 )
- val = CUR.phase;
+ val = exc->phase;
}
else
{
- val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) /
- CUR.period ) * CUR.period );
- val -= CUR.phase;
+ val = -( ( ( exc->threshold - exc->phase - distance + compensation ) /
+ exc->period ) * exc->period );
+ val -= exc->phase;
if ( val > 0 )
- val = -CUR.phase;
+ val = -exc->phase;
}
return val;
@@ -2356,40 +2215,41 @@
/* round_mode :: The rounding mode to be used. */
/* */
static void
- Compute_Round( EXEC_OP_ FT_Byte round_mode )
+ Compute_Round( TT_ExecContext exc,
+ FT_Byte round_mode )
{
switch ( round_mode )
{
case TT_Round_Off:
- CUR.func_round = (TT_Round_Func)Round_None;
+ exc->func_round = (TT_Round_Func)Round_None;
break;
case TT_Round_To_Grid:
- CUR.func_round = (TT_Round_Func)Round_To_Grid;
+ exc->func_round = (TT_Round_Func)Round_To_Grid;
break;
case TT_Round_Up_To_Grid:
- CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;
+ exc->func_round = (TT_Round_Func)Round_Up_To_Grid;
break;
case TT_Round_Down_To_Grid:
- CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;
+ exc->func_round = (TT_Round_Func)Round_Down_To_Grid;
break;
case TT_Round_To_Half_Grid:
- CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;
+ exc->func_round = (TT_Round_Func)Round_To_Half_Grid;
break;
case TT_Round_To_Double_Grid:
- CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;
+ exc->func_round = (TT_Round_Func)Round_To_Double_Grid;
break;
case TT_Round_Super:
- CUR.func_round = (TT_Round_Func)Round_Super;
+ exc->func_round = (TT_Round_Func)Round_Super;
break;
case TT_Round_Super_45:
- CUR.func_round = (TT_Round_Func)Round_Super_45;
+ exc->func_round = (TT_Round_Func)Round_Super_45;
break;
}
}
@@ -2409,57 +2269,58 @@
/* selector :: The SROUND opcode. */
/* */
static void
- SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod,
- FT_Long selector )
+ SetSuperRound( TT_ExecContext exc,
+ FT_F2Dot14 GridPeriod,
+ FT_Long selector )
{
switch ( (FT_Int)( selector & 0xC0 ) )
{
case 0:
- CUR.period = GridPeriod / 2;
+ exc->period = GridPeriod / 2;
break;
case 0x40:
- CUR.period = GridPeriod;
+ exc->period = GridPeriod;
break;
case 0x80:
- CUR.period = GridPeriod * 2;
+ exc->period = GridPeriod * 2;
break;
/* This opcode is reserved, but... */
-
case 0xC0:
- CUR.period = GridPeriod;
+ exc->period = GridPeriod;
break;
}
switch ( (FT_Int)( selector & 0x30 ) )
{
case 0:
- CUR.phase = 0;
+ exc->phase = 0;
break;
case 0x10:
- CUR.phase = CUR.period / 4;
+ exc->phase = exc->period / 4;
break;
case 0x20:
- CUR.phase = CUR.period / 2;
+ exc->phase = exc->period / 2;
break;
case 0x30:
- CUR.phase = CUR.period * 3 / 4;
+ exc->phase = exc->period * 3 / 4;
break;
}
if ( ( selector & 0x0F ) == 0 )
- CUR.threshold = CUR.period - 1;
+ exc->threshold = exc->period - 1;
else
- CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8;
+ exc->threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * exc->period / 8;
- CUR.period /= 256;
- CUR.phase /= 256;
- CUR.threshold /= 256;
+ /* convert to F26Dot6 format */
+ exc->period >>= 8;
+ exc->phase >>= 8;
+ exc->threshold >>= 8;
}
@@ -2480,16 +2341,17 @@
/* The distance in F26dot6 format. */
/* */
static FT_F26Dot6
- Project( EXEC_OP_ FT_Pos dx,
- FT_Pos dy )
+ Project( TT_ExecContext exc,
+ FT_Pos dx,
+ FT_Pos dy )
{
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- FT_ASSERT( !CUR.face->unpatented_hinting );
+ FT_ASSERT( !exc->face->unpatented_hinting );
#endif
- return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
- CUR.GS.projVector.x,
- CUR.GS.projVector.y );
+ return TT_DotFix14( dx, dy,
+ exc->GS.projVector.x,
+ exc->GS.projVector.y );
}
@@ -2510,12 +2372,13 @@
/* The distance in F26dot6 format. */
/* */
static FT_F26Dot6
- Dual_Project( EXEC_OP_ FT_Pos dx,
- FT_Pos dy )
+ Dual_Project( TT_ExecContext exc,
+ FT_Pos dx,
+ FT_Pos dy )
{
- return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
- CUR.GS.dualVector.x,
- CUR.GS.dualVector.y );
+ return TT_DotFix14( dx, dy,
+ exc->GS.dualVector.x,
+ exc->GS.dualVector.y );
}
@@ -2536,10 +2399,11 @@
/* The distance in F26dot6 format. */
/* */
static FT_F26Dot6
- Project_x( EXEC_OP_ FT_Pos dx,
- FT_Pos dy )
+ Project_x( TT_ExecContext exc,
+ FT_Pos dx,
+ FT_Pos dy )
{
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
FT_UNUSED( dy );
return dx;
@@ -2563,10 +2427,11 @@
/* The distance in F26dot6 format. */
/* */
static FT_F26Dot6
- Project_y( EXEC_OP_ FT_Pos dx,
- FT_Pos dy )
+ Project_y( TT_ExecContext exc,
+ FT_Pos dx,
+ FT_Pos dy )
{
- FT_UNUSED_EXEC;
+ FT_UNUSED( exc );
FT_UNUSED( dx );
return dy;
@@ -2583,101 +2448,101 @@
/* to the current graphics state. */
/* */
static void
- Compute_Funcs( EXEC_OP )
+ Compute_Funcs( TT_ExecContext exc )
{
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
- /* If both vectors point rightwards along the x axis, set */
- /* `both-x-axis' true, otherwise set it false. The x values only */
- /* need be tested because the vector has been normalised to a unit */
- /* vector of length 0x4000 = unity. */
- CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 &&
- CUR.GS.freeVector.x == 0x4000 );
+ /* If both vectors point rightwards along the x axis, set */
+ /* `both-x-axis' true, otherwise set it false. The x values only */
+ /* need be tested because the vector has been normalised to a unit */
+ /* vector of length 0x4000 = unity. */
+ exc->GS.both_x_axis = (FT_Bool)( exc->GS.projVector.x == 0x4000 &&
+ exc->GS.freeVector.x == 0x4000 );
/* Throw away projection and freedom vector information */
/* because the patents don't allow them to be stored. */
/* The relevant US Patents are 5155805 and 5325479. */
- CUR.GS.projVector.x = 0;
- CUR.GS.projVector.y = 0;
- CUR.GS.freeVector.x = 0;
- CUR.GS.freeVector.y = 0;
+ exc->GS.projVector.x = 0;
+ exc->GS.projVector.y = 0;
+ exc->GS.freeVector.x = 0;
+ exc->GS.freeVector.y = 0;
- if ( CUR.GS.both_x_axis )
+ if ( exc->GS.both_x_axis )
{
- CUR.func_project = Project_x;
- CUR.func_move = Direct_Move_X;
- CUR.func_move_orig = Direct_Move_Orig_X;
+ exc->func_project = Project_x;
+ exc->func_move = Direct_Move_X;
+ exc->func_move_orig = Direct_Move_Orig_X;
}
else
{
- CUR.func_project = Project_y;
- CUR.func_move = Direct_Move_Y;
- CUR.func_move_orig = Direct_Move_Orig_Y;
+ exc->func_project = Project_y;
+ exc->func_move = Direct_Move_Y;
+ exc->func_move_orig = Direct_Move_Orig_Y;
}
- if ( CUR.GS.dualVector.x == 0x4000 )
- CUR.func_dualproj = Project_x;
- else if ( CUR.GS.dualVector.y == 0x4000 )
- CUR.func_dualproj = Project_y;
+ if ( exc->GS.dualVector.x == 0x4000 )
+ exc->func_dualproj = Project_x;
+ else if ( exc->GS.dualVector.y == 0x4000 )
+ exc->func_dualproj = Project_y;
else
- CUR.func_dualproj = Dual_Project;
+ exc->func_dualproj = Dual_Project;
/* Force recalculation of cached aspect ratio */
- CUR.tt_metrics.ratio = 0;
+ exc->tt_metrics.ratio = 0;
return;
}
#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */
- if ( CUR.GS.freeVector.x == 0x4000 )
- CUR.F_dot_P = CUR.GS.projVector.x;
- else if ( CUR.GS.freeVector.y == 0x4000 )
- CUR.F_dot_P = CUR.GS.projVector.y;
+ if ( exc->GS.freeVector.x == 0x4000 )
+ exc->F_dot_P = exc->GS.projVector.x;
+ else if ( exc->GS.freeVector.y == 0x4000 )
+ exc->F_dot_P = exc->GS.projVector.y;
else
- CUR.F_dot_P = ( (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x +
- (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y ) >>
- 14;
-
- if ( CUR.GS.projVector.x == 0x4000 )
- CUR.func_project = (TT_Project_Func)Project_x;
- else if ( CUR.GS.projVector.y == 0x4000 )
- CUR.func_project = (TT_Project_Func)Project_y;
+ exc->F_dot_P =
+ ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x +
+ (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y ) >> 14;
+
+ if ( exc->GS.projVector.x == 0x4000 )
+ exc->func_project = (TT_Project_Func)Project_x;
+ else if ( exc->GS.projVector.y == 0x4000 )
+ exc->func_project = (TT_Project_Func)Project_y;
else
- CUR.func_project = (TT_Project_Func)Project;
+ exc->func_project = (TT_Project_Func)Project;
- if ( CUR.GS.dualVector.x == 0x4000 )
- CUR.func_dualproj = (TT_Project_Func)Project_x;
- else if ( CUR.GS.dualVector.y == 0x4000 )
- CUR.func_dualproj = (TT_Project_Func)Project_y;
+ if ( exc->GS.dualVector.x == 0x4000 )
+ exc->func_dualproj = (TT_Project_Func)Project_x;
+ else if ( exc->GS.dualVector.y == 0x4000 )
+ exc->func_dualproj = (TT_Project_Func)Project_y;
else
- CUR.func_dualproj = (TT_Project_Func)Dual_Project;
+ exc->func_dualproj = (TT_Project_Func)Dual_Project;
- CUR.func_move = (TT_Move_Func)Direct_Move;
- CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig;
+ exc->func_move = (TT_Move_Func)Direct_Move;
+ exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig;
- if ( CUR.F_dot_P == 0x4000L )
+ if ( exc->F_dot_P == 0x4000L )
{
- if ( CUR.GS.freeVector.x == 0x4000 )
+ if ( exc->GS.freeVector.x == 0x4000 )
{
- CUR.func_move = (TT_Move_Func)Direct_Move_X;
- CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
+ exc->func_move = (TT_Move_Func)Direct_Move_X;
+ exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
}
- else if ( CUR.GS.freeVector.y == 0x4000 )
+ else if ( exc->GS.freeVector.y == 0x4000 )
{
- CUR.func_move = (TT_Move_Func)Direct_Move_Y;
- CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
+ exc->func_move = (TT_Move_Func)Direct_Move_Y;
+ exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
}
}
/* at small sizes, F_dot_P can become too small, resulting */
/* in overflows and `spikes' in a number of glyphs like `w'. */
- if ( FT_ABS( CUR.F_dot_P ) < 0x400L )
- CUR.F_dot_P = 0x4000L;
+ if ( FT_ABS( exc->F_dot_P ) < 0x400L )
+ exc->F_dot_P = 0x4000L;
/* Disable cached aspect ratio */
- CUR.tt_metrics.ratio = 0;
+ exc->tt_metrics.ratio = 0;
}
@@ -2700,1107 +2565,49 @@
/* Returns FAILURE if a vector parameter is zero. */
/* */
/* <Note> */
- /* In case Vx and Vy are both zero, Normalize() returns SUCCESS, and */
+ /* In case Vx and Vy are both zero, `Normalize' returns SUCCESS, and */
/* R is undefined. */
/* */
static FT_Bool
- Normalize( EXEC_OP_ FT_F26Dot6 Vx,
- FT_F26Dot6 Vy,
- FT_UnitVector* R )
+ Normalize( FT_F26Dot6 Vx,
+ FT_F26Dot6 Vy,
+ FT_UnitVector* R )
{
- FT_F26Dot6 W;
-
- FT_UNUSED_EXEC;
+ FT_Vector V;
- if ( FT_ABS( Vx ) < 0x4000L && FT_ABS( Vy ) < 0x4000L )
+ if ( Vx == 0 && Vy == 0 )
{
- if ( Vx == 0 && Vy == 0 )
- {
- /* XXX: UNDOCUMENTED! It seems that it is possible to try */
- /* to normalize the vector (0,0). Return immediately. */
- return SUCCESS;
- }
-
- Vx *= 0x4000;
- Vy *= 0x4000;
+ /* XXX: UNDOCUMENTED! It seems that it is possible to try */
+ /* to normalize the vector (0,0). Return immediately. */
+ return SUCCESS;
}
- W = FT_Hypot( Vx, Vy );
-
- R->x = (FT_F2Dot14)TT_DivFix14( Vx, W );
- R->y = (FT_F2Dot14)TT_DivFix14( Vy, W );
-
- return SUCCESS;
- }
-
+ V.x = Vx;
+ V.y = Vy;
- /*************************************************************************/
- /* */
- /* Here we start with the implementation of the various opcodes. */
- /* */
- /*************************************************************************/
+ FT_Vector_NormLen( &V );
-
- static FT_Bool
- Ins_SxVTL( EXEC_OP_ FT_UShort aIdx1,
- FT_UShort aIdx2,
- FT_Int aOpc,
- FT_UnitVector* Vec )
- {
- FT_Long A, B, C;
- FT_Vector* p1;
- FT_Vector* p2;
-
-
- if ( BOUNDS( aIdx1, CUR.zp2.n_points ) ||
- BOUNDS( aIdx2, CUR.zp1.n_points ) )
- {
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
- return FAILURE;
- }
-
- p1 = CUR.zp1.cur + aIdx2;
- p2 = CUR.zp2.cur + aIdx1;
-
- A = p1->x - p2->x;
- B = p1->y - p2->y;
-
- /* If p1 == p2, SPVTL and SFVTL behave the same as */
- /* SPVTCA[X] and SFVTCA[X], respectively. */
- /* */
- /* Confirmed by Greg Hitchcock. */
-
- if ( A == 0 && B == 0 )
- {
- A = 0x4000;
- aOpc = 0;
- }
-
- if ( ( aOpc & 1 ) != 0 )
- {
- C = B; /* counter clockwise rotation */
- B = A;
- A = -C;
- }
-
- NORMalize( A, B, Vec );
+ R->x = (FT_F2Dot14)( V.x / 4 );
+ R->y = (FT_F2Dot14)( V.y / 4 );
return SUCCESS;
}
- /* When not using the big switch statements, the interpreter uses a */
- /* call table defined later below in this source. Each opcode must */
- /* thus have a corresponding function, even trivial ones. */
- /* */
- /* They are all defined there. */
-
-#define DO_SVTCA \
- { \
- FT_Short A, B; \
- \
- \
- A = (FT_Short)( CUR.opcode & 1 ) << 14; \
- B = A ^ (FT_Short)0x4000; \
- \
- CUR.GS.freeVector.x = A; \
- CUR.GS.projVector.x = A; \
- CUR.GS.dualVector.x = A; \
- \
- CUR.GS.freeVector.y = B; \
- CUR.GS.projVector.y = B; \
- CUR.GS.dualVector.y = B; \
- \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SPVTCA \
- { \
- FT_Short A, B; \
- \
- \
- A = (FT_Short)( CUR.opcode & 1 ) << 14; \
- B = A ^ (FT_Short)0x4000; \
- \
- CUR.GS.projVector.x = A; \
- CUR.GS.dualVector.x = A; \
- \
- CUR.GS.projVector.y = B; \
- CUR.GS.dualVector.y = B; \
- \
- GUESS_VECTOR( freeVector ); \
- \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SFVTCA \
- { \
- FT_Short A, B; \
- \
- \
- A = (FT_Short)( CUR.opcode & 1 ) << 14; \
- B = A ^ (FT_Short)0x4000; \
- \
- CUR.GS.freeVector.x = A; \
- CUR.GS.freeVector.y = B; \
- \
- GUESS_VECTOR( projVector ); \
- \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SPVTL \
- if ( INS_SxVTL( (FT_UShort)args[1], \
- (FT_UShort)args[0], \
- CUR.opcode, \
- &CUR.GS.projVector ) == SUCCESS ) \
- { \
- CUR.GS.dualVector = CUR.GS.projVector; \
- GUESS_VECTOR( freeVector ); \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SFVTL \
- if ( INS_SxVTL( (FT_UShort)args[1], \
- (FT_UShort)args[0], \
- CUR.opcode, \
- &CUR.GS.freeVector ) == SUCCESS ) \
- { \
- GUESS_VECTOR( projVector ); \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SFVTPV \
- GUESS_VECTOR( projVector ); \
- CUR.GS.freeVector = CUR.GS.projVector; \
- COMPUTE_Funcs();
-
-
-#define DO_SPVFS \
- { \
- FT_Short S; \
- FT_Long X, Y; \
- \
- \
- /* Only use low 16bits, then sign extend */ \
- S = (FT_Short)args[1]; \
- Y = (FT_Long)S; \
- S = (FT_Short)args[0]; \
- X = (FT_Long)S; \
- \
- NORMalize( X, Y, &CUR.GS.projVector ); \
- \
- CUR.GS.dualVector = CUR.GS.projVector; \
- GUESS_VECTOR( freeVector ); \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SFVFS \
- { \
- FT_Short S; \
- FT_Long X, Y; \
- \
- \
- /* Only use low 16bits, then sign extend */ \
- S = (FT_Short)args[1]; \
- Y = (FT_Long)S; \
- S = (FT_Short)args[0]; \
- X = S; \
- \
- NORMalize( X, Y, &CUR.GS.freeVector ); \
- GUESS_VECTOR( projVector ); \
- COMPUTE_Funcs(); \
- }
-
-
-#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
-#define DO_GPV \
- if ( CUR.face->unpatented_hinting ) \
- { \
- args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \
- args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \
- } \
- else \
- { \
- args[0] = CUR.GS.projVector.x; \
- args[1] = CUR.GS.projVector.y; \
- }
-#else
-#define DO_GPV \
- args[0] = CUR.GS.projVector.x; \
- args[1] = CUR.GS.projVector.y;
-#endif
-
-
-#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
-#define DO_GFV \
- if ( CUR.face->unpatented_hinting ) \
- { \
- args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \
- args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \
- } \
- else \
- { \
- args[0] = CUR.GS.freeVector.x; \
- args[1] = CUR.GS.freeVector.y; \
- }
-#else
-#define DO_GFV \
- args[0] = CUR.GS.freeVector.x; \
- args[1] = CUR.GS.freeVector.y;
-#endif
-
-
-#define DO_SRP0 \
- CUR.GS.rp0 = (FT_UShort)args[0];
-
-
-#define DO_SRP1 \
- CUR.GS.rp1 = (FT_UShort)args[0];
-
-
-#define DO_SRP2 \
- CUR.GS.rp2 = (FT_UShort)args[0];
-
-
-#define DO_RTHG \
- CUR.GS.round_state = TT_Round_To_Half_Grid; \
- CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;
-
-
-#define DO_RTG \
- CUR.GS.round_state = TT_Round_To_Grid; \
- CUR.func_round = (TT_Round_Func)Round_To_Grid;
-
-
-#define DO_RTDG \
- CUR.GS.round_state = TT_Round_To_Double_Grid; \
- CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;
-
-
-#define DO_RUTG \
- CUR.GS.round_state = TT_Round_Up_To_Grid; \
- CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;
-
-
-#define DO_RDTG \
- CUR.GS.round_state = TT_Round_Down_To_Grid; \
- CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;
-
-
-#define DO_ROFF \
- CUR.GS.round_state = TT_Round_Off; \
- CUR.func_round = (TT_Round_Func)Round_None;
-
-
-#define DO_SROUND \
- SET_SuperRound( 0x4000, args[0] ); \
- CUR.GS.round_state = TT_Round_Super; \
- CUR.func_round = (TT_Round_Func)Round_Super;
-
-
-#define DO_S45ROUND \
- SET_SuperRound( 0x2D41, args[0] ); \
- CUR.GS.round_state = TT_Round_Super_45; \
- CUR.func_round = (TT_Round_Func)Round_Super_45;
-
-
-#define DO_SLOOP \
- if ( args[0] < 0 ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- else \
- CUR.GS.loop = args[0];
-
-
-#define DO_SMD \
- CUR.GS.minimum_distance = args[0];
-
-
-#define DO_SCVTCI \
- CUR.GS.control_value_cutin = (FT_F26Dot6)args[0];
-
-
-#define DO_SSWCI \
- CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
-
-
-#define DO_SSW \
- CUR.GS.single_width_value = FT_MulFix( args[0], \
- CUR.tt_metrics.scale );
-
-
-#define DO_FLIPON \
- CUR.GS.auto_flip = TRUE;
-
-
-#define DO_FLIPOFF \
- CUR.GS.auto_flip = FALSE;
-
-
-#define DO_SDB \
- CUR.GS.delta_base = (FT_UShort)args[0];
-
-
-#define DO_SDS \
- if ( (FT_ULong)args[0] > 6UL ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- else \
- CUR.GS.delta_shift = (FT_UShort)args[0];
-
-
-#define DO_MD /* nothing */
-
-
-#define DO_MPPEM \
- args[0] = CUR_Func_cur_ppem();
-
-
- /* Note: The pointSize should be irrelevant in a given font program; */
- /* we thus decide to return only the ppem. */
-#if 0
-
-#define DO_MPS \
- args[0] = CUR.metrics.pointSize;
-
-#else
-
-#define DO_MPS \
- args[0] = CUR_Func_cur_ppem();
-
-#endif /* 0 */
-
-
-#define DO_DUP \
- args[1] = args[0];
-
-
-#define DO_CLEAR \
- CUR.new_top = 0;
-
-
-#define DO_SWAP \
- { \
- FT_Long L; \
- \
- \
- L = args[0]; \
- args[0] = args[1]; \
- args[1] = L; \
- }
-
-
-#define DO_DEPTH \
- args[0] = CUR.top;
-
-
-#define DO_CINDEX \
- { \
- FT_Long L; \
- \
- \
- L = args[0]; \
- \
- if ( L <= 0 || L > CUR.args ) \
- { \
- if ( CUR.pedantic_hinting ) \
- CUR.error = FT_THROW( Invalid_Reference ); \
- args[0] = 0; \
- } \
- else \
- args[0] = CUR.stack[CUR.args - L]; \
- }
-
-
-#define DO_JROT \
- if ( args[1] != 0 ) \
- { \
- if ( args[0] == 0 && CUR.args == 0 ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- CUR.IP += args[0]; \
- if ( CUR.IP < 0 || \
- ( CUR.callTop > 0 && \
- CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- CUR.step_ins = FALSE; \
- }
-
-
-#define DO_JMPR \
- if ( args[0] == 0 && CUR.args == 0 ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- CUR.IP += args[0]; \
- if ( CUR.IP < 0 || \
- ( CUR.callTop > 0 && \
- CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- CUR.step_ins = FALSE;
-
-
-#define DO_JROF \
- if ( args[1] == 0 ) \
- { \
- if ( args[0] == 0 && CUR.args == 0 ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- CUR.IP += args[0]; \
- if ( CUR.IP < 0 || \
- ( CUR.callTop > 0 && \
- CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \
- CUR.error = FT_THROW( Bad_Argument ); \
- CUR.step_ins = FALSE; \
- }
-
-
-#define DO_LT \
- args[0] = ( args[0] < args[1] );
-
-
-#define DO_LTEQ \
- args[0] = ( args[0] <= args[1] );
-
-
-#define DO_GT \
- args[0] = ( args[0] > args[1] );
-
-
-#define DO_GTEQ \
- args[0] = ( args[0] >= args[1] );
-
-
-#define DO_EQ \
- args[0] = ( args[0] == args[1] );
-
-
-#define DO_NEQ \
- args[0] = ( args[0] != args[1] );
-
-
-#define DO_ODD \
- args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 64 );
-
-
-#define DO_EVEN \
- args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 0 );
-
-
-#define DO_AND \
- args[0] = ( args[0] && args[1] );
-
-
-#define DO_OR \
- args[0] = ( args[0] || args[1] );
-
-
-#define DO_NOT \
- args[0] = !args[0];
-
-
-#define DO_ADD \
- args[0] += args[1];
-
-
-#define DO_SUB \
- args[0] -= args[1];
-
-
-#define DO_DIV \
- if ( args[1] == 0 ) \
- CUR.error = FT_THROW( Divide_By_Zero ); \
- else \
- args[0] = FT_MulDiv_No_Round( args[0], 64L, args[1] );
-
-
-#define DO_MUL \
- args[0] = FT_MulDiv( args[0], args[1], 64L );
-
-
-#define DO_ABS \
- args[0] = FT_ABS( args[0] );
-
-
-#define DO_NEG \
- args[0] = -args[0];
-
-
-#define DO_FLOOR \
- args[0] = FT_PIX_FLOOR( args[0] );
-
-
-#define DO_CEILING \
- args[0] = FT_PIX_CEIL( args[0] );
-
-#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
-
-#define DO_RS \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, CUR.storeSize ) ) \
- { \
- if ( CUR.pedantic_hinting ) \
- ARRAY_BOUND_ERROR; \
- else \
- args[0] = 0; \
- } \
- else \
- { \
- /* subpixel hinting - avoid Typeman Dstroke and */ \
- /* IStroke and Vacuform rounds */ \
- \
- if ( SUBPIXEL_HINTING && \
- CUR.ignore_x_mode && \
- ( ( I == 24 && \
- ( CUR.face->sph_found_func_flags & \
- ( SPH_FDEF_SPACING_1 | \
- SPH_FDEF_SPACING_2 ) ) ) || \
- ( I == 22 && \
- ( CUR.sph_in_func_flags & \
- SPH_FDEF_TYPEMAN_STROKES ) ) || \
- ( I == 8 && \
- ( CUR.face->sph_found_func_flags & \
- SPH_FDEF_VACUFORM_ROUND_1 ) && \
- CUR.iup_called ) ) ) \
- args[0] = 0; \
- else \
- args[0] = CUR.storage[I]; \
- } \
- }
-
-#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-
-#define DO_RS \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, CUR.storeSize ) ) \
- { \
- if ( CUR.pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- else \
- args[0] = 0; \
- } \
- else \
- args[0] = CUR.storage[I]; \
- }
-
-#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-
-
-#define DO_WS \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, CUR.storeSize ) ) \
- { \
- if ( CUR.pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- } \
- else \
- CUR.storage[I] = args[1]; \
- }
-
-
-#define DO_RCVT \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, CUR.cvtSize ) ) \
- { \
- if ( CUR.pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- else \
- args[0] = 0; \
- } \
- else \
- args[0] = CUR_Func_read_cvt( I ); \
- }
-
-
-#define DO_WCVTP \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, CUR.cvtSize ) ) \
- { \
- if ( CUR.pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- } \
- else \
- CUR_Func_write_cvt( I, args[1] ); \
- }
-
-
-#define DO_WCVTF \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, CUR.cvtSize ) ) \
- { \
- if ( CUR.pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- } \
- else \
- CUR.cvt[I] = FT_MulFix( args[1], CUR.tt_metrics.scale ); \
- }
-
-
-#define DO_DEBUG \
- CUR.error = FT_THROW( Debug_OpCode );
-
-
-#define DO_ROUND \
- args[0] = CUR_Func_round( \
- args[0], \
- CUR.tt_metrics.compensations[CUR.opcode - 0x68] );
-
-
-#define DO_NROUND \
- args[0] = ROUND_None( args[0], \
- CUR.tt_metrics.compensations[CUR.opcode - 0x6C] );
-
-
-#define DO_MAX \
- if ( args[1] > args[0] ) \
- args[0] = args[1];
-
-
-#define DO_MIN \
- if ( args[1] < args[0] ) \
- args[0] = args[1];
-
-
-#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
-
-#undef ARRAY_BOUND_ERROR
-#define ARRAY_BOUND_ERROR \
- { \
- CUR.error = FT_THROW( Invalid_Reference ); \
- return; \
- }
-
-
/*************************************************************************/
/* */
- /* SVTCA[a]: Set (F and P) Vectors to Coordinate Axis */
- /* Opcode range: 0x00-0x01 */
- /* Stack: --> */
- /* */
- static void
- Ins_SVTCA( INS_ARG )
- {
- DO_SVTCA
- }
-
-
- /*************************************************************************/
- /* */
- /* SPVTCA[a]: Set PVector to Coordinate Axis */
- /* Opcode range: 0x02-0x03 */
- /* Stack: --> */
- /* */
- static void
- Ins_SPVTCA( INS_ARG )
- {
- DO_SPVTCA
- }
-
-
- /*************************************************************************/
- /* */
- /* SFVTCA[a]: Set FVector to Coordinate Axis */
- /* Opcode range: 0x04-0x05 */
- /* Stack: --> */
- /* */
- static void
- Ins_SFVTCA( INS_ARG )
- {
- DO_SFVTCA
- }
-
-
- /*************************************************************************/
- /* */
- /* SPVTL[a]: Set PVector To Line */
- /* Opcode range: 0x06-0x07 */
- /* Stack: uint32 uint32 --> */
- /* */
- static void
- Ins_SPVTL( INS_ARG )
- {
- DO_SPVTL
- }
-
-
- /*************************************************************************/
- /* */
- /* SFVTL[a]: Set FVector To Line */
- /* Opcode range: 0x08-0x09 */
- /* Stack: uint32 uint32 --> */
- /* */
- static void
- Ins_SFVTL( INS_ARG )
- {
- DO_SFVTL
- }
-
-
- /*************************************************************************/
- /* */
- /* SFVTPV[]: Set FVector To PVector */
- /* Opcode range: 0x0E */
- /* Stack: --> */
- /* */
- static void
- Ins_SFVTPV( INS_ARG )
- {
- DO_SFVTPV
- }
-
-
- /*************************************************************************/
- /* */
- /* SPVFS[]: Set PVector From Stack */
- /* Opcode range: 0x0A */
- /* Stack: f2.14 f2.14 --> */
- /* */
- static void
- Ins_SPVFS( INS_ARG )
- {
- DO_SPVFS
- }
-
-
- /*************************************************************************/
- /* */
- /* SFVFS[]: Set FVector From Stack */
- /* Opcode range: 0x0B */
- /* Stack: f2.14 f2.14 --> */
- /* */
- static void
- Ins_SFVFS( INS_ARG )
- {
- DO_SFVFS
- }
-
-
- /*************************************************************************/
- /* */
- /* GPV[]: Get Projection Vector */
- /* Opcode range: 0x0C */
- /* Stack: ef2.14 --> ef2.14 */
- /* */
- static void
- Ins_GPV( INS_ARG )
- {
- DO_GPV
- }
-
-
- /*************************************************************************/
- /* GFV[]: Get Freedom Vector */
- /* Opcode range: 0x0D */
- /* Stack: ef2.14 --> ef2.14 */
- /* */
- static void
- Ins_GFV( INS_ARG )
- {
- DO_GFV
- }
-
-
- /*************************************************************************/
- /* */
- /* SRP0[]: Set Reference Point 0 */
- /* Opcode range: 0x10 */
- /* Stack: uint32 --> */
- /* */
- static void
- Ins_SRP0( INS_ARG )
- {
- DO_SRP0
- }
-
-
- /*************************************************************************/
- /* */
- /* SRP1[]: Set Reference Point 1 */
- /* Opcode range: 0x11 */
- /* Stack: uint32 --> */
- /* */
- static void
- Ins_SRP1( INS_ARG )
- {
- DO_SRP1
- }
-
-
- /*************************************************************************/
- /* */
- /* SRP2[]: Set Reference Point 2 */
- /* Opcode range: 0x12 */
- /* Stack: uint32 --> */
- /* */
- static void
- Ins_SRP2( INS_ARG )
- {
- DO_SRP2
- }
-
-
- /*************************************************************************/
- /* */
- /* RTHG[]: Round To Half Grid */
- /* Opcode range: 0x19 */
- /* Stack: --> */
- /* */
- static void
- Ins_RTHG( INS_ARG )
- {
- DO_RTHG
- }
-
-
- /*************************************************************************/
- /* */
- /* RTG[]: Round To Grid */
- /* Opcode range: 0x18 */
- /* Stack: --> */
- /* */
- static void
- Ins_RTG( INS_ARG )
- {
- DO_RTG
- }
-
-
- /*************************************************************************/
- /* RTDG[]: Round To Double Grid */
- /* Opcode range: 0x3D */
- /* Stack: --> */
- /* */
- static void
- Ins_RTDG( INS_ARG )
- {
- DO_RTDG
- }
-
-
- /*************************************************************************/
- /* RUTG[]: Round Up To Grid */
- /* Opcode range: 0x7C */
- /* Stack: --> */
- /* */
- static void
- Ins_RUTG( INS_ARG )
- {
- DO_RUTG
- }
-
-
- /*************************************************************************/
- /* */
- /* RDTG[]: Round Down To Grid */
- /* Opcode range: 0x7D */
- /* Stack: --> */
- /* */
- static void
- Ins_RDTG( INS_ARG )
- {
- DO_RDTG
- }
-
-
- /*************************************************************************/
- /* */
- /* ROFF[]: Round OFF */
- /* Opcode range: 0x7A */
- /* Stack: --> */
- /* */
- static void
- Ins_ROFF( INS_ARG )
- {
- DO_ROFF
- }
-
-
- /*************************************************************************/
- /* */
- /* SROUND[]: Super ROUND */
- /* Opcode range: 0x76 */
- /* Stack: Eint8 --> */
- /* */
- static void
- Ins_SROUND( INS_ARG )
- {
- DO_SROUND
- }
-
-
- /*************************************************************************/
- /* */
- /* S45ROUND[]: Super ROUND 45 degrees */
- /* Opcode range: 0x77 */
- /* Stack: uint32 --> */
- /* */
- static void
- Ins_S45ROUND( INS_ARG )
- {
- DO_S45ROUND
- }
-
-
- /*************************************************************************/
- /* */
- /* SLOOP[]: Set LOOP variable */
- /* Opcode range: 0x17 */
- /* Stack: int32? --> */
- /* */
- static void
- Ins_SLOOP( INS_ARG )
- {
- DO_SLOOP
- }
-
-
- /*************************************************************************/
- /* */
- /* SMD[]: Set Minimum Distance */
- /* Opcode range: 0x1A */
- /* Stack: f26.6 --> */
- /* */
- static void
- Ins_SMD( INS_ARG )
- {
- DO_SMD
- }
-
-
- /*************************************************************************/
- /* */
- /* SCVTCI[]: Set Control Value Table Cut In */
- /* Opcode range: 0x1D */
- /* Stack: f26.6 --> */
- /* */
- static void
- Ins_SCVTCI( INS_ARG )
- {
- DO_SCVTCI
- }
-
-
- /*************************************************************************/
- /* */
- /* SSWCI[]: Set Single Width Cut In */
- /* Opcode range: 0x1E */
- /* Stack: f26.6 --> */
- /* */
- static void
- Ins_SSWCI( INS_ARG )
- {
- DO_SSWCI
- }
-
-
- /*************************************************************************/
- /* */
- /* SSW[]: Set Single Width */
- /* Opcode range: 0x1F */
- /* Stack: int32? --> */
- /* */
- static void
- Ins_SSW( INS_ARG )
- {
- DO_SSW
- }
-
-
- /*************************************************************************/
- /* */
- /* FLIPON[]: Set auto-FLIP to ON */
- /* Opcode range: 0x4D */
- /* Stack: --> */
- /* */
- static void
- Ins_FLIPON( INS_ARG )
- {
- DO_FLIPON
- }
-
-
- /*************************************************************************/
- /* */
- /* FLIPOFF[]: Set auto-FLIP to OFF */
- /* Opcode range: 0x4E */
- /* Stack: --> */
- /* */
- static void
- Ins_FLIPOFF( INS_ARG )
- {
- DO_FLIPOFF
- }
-
-
- /*************************************************************************/
- /* */
- /* SANGW[]: Set ANGle Weight */
- /* Opcode range: 0x7E */
- /* Stack: uint32 --> */
+ /* Here we start with the implementation of the various opcodes. */
/* */
- static void
- Ins_SANGW( INS_ARG )
- {
- /* instruction not supported anymore */
- }
-
-
/*************************************************************************/
- /* */
- /* SDB[]: Set Delta Base */
- /* Opcode range: 0x5E */
- /* Stack: uint32 --> */
- /* */
- static void
- Ins_SDB( INS_ARG )
- {
- DO_SDB
- }
- /*************************************************************************/
- /* */
- /* SDS[]: Set Delta Shift */
- /* Opcode range: 0x5F */
- /* Stack: uint32 --> */
- /* */
- static void
- Ins_SDS( INS_ARG )
- {
- DO_SDS
- }
+#define ARRAY_BOUND_ERROR \
+ do \
+ { \
+ exc->error = FT_THROW( Invalid_Reference ); \
+ return; \
+ } while (0)
/*************************************************************************/
@@ -3810,9 +2617,10 @@
/* Stack: --> Euint16 */
/* */
static void
- Ins_MPPEM( INS_ARG )
+ Ins_MPPEM( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_MPPEM
+ args[0] = exc->func_cur_ppem( exc );
}
@@ -3823,22 +2631,29 @@
/* Stack: --> Euint16 */
/* */
static void
- Ins_MPS( INS_ARG )
+ Ins_MPS( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_MPS
+ /* Note: The point size should be irrelevant in a given font program; */
+ /* we thus decide to return only the PPEM value. */
+#if 0
+ args[0] = exc->metrics.pointSize;
+#else
+ args[0] = exc->func_cur_ppem( exc );
+#endif
}
/*************************************************************************/
/* */
- /* DUP[]: DUPlicate the top stack's element */
+ /* DUP[]: DUPlicate the stack's top element */
/* Opcode range: 0x20 */
/* Stack: StkElt --> StkElt StkElt */
/* */
static void
- Ins_DUP( INS_ARG )
+ Ins_DUP( FT_Long* args )
{
- DO_DUP
+ args[1] = args[0];
}
@@ -3849,7 +2664,7 @@
/* Stack: StkElt --> */
/* */
static void
- Ins_POP( INS_ARG )
+ Ins_POP( void )
{
/* nothing to do */
}
@@ -3862,9 +2677,9 @@
/* Stack: StkElt... --> */
/* */
static void
- Ins_CLEAR( INS_ARG )
+ Ins_CLEAR( TT_ExecContext exc )
{
- DO_CLEAR
+ exc->new_top = 0;
}
@@ -3875,9 +2690,14 @@
/* Stack: 2 * StkElt --> 2 * StkElt */
/* */
static void
- Ins_SWAP( INS_ARG )
+ Ins_SWAP( FT_Long* args )
{
- DO_SWAP
+ FT_Long L;
+
+
+ L = args[0];
+ args[0] = args[1];
+ args[1] = L;
}
@@ -3888,74 +2708,10 @@
/* Stack: --> uint32 */
/* */
static void
- Ins_DEPTH( INS_ARG )
- {
- DO_DEPTH
- }
-
-
- /*************************************************************************/
- /* */
- /* CINDEX[]: Copy INDEXed element */
- /* Opcode range: 0x25 */
- /* Stack: int32 --> StkElt */
- /* */
- static void
- Ins_CINDEX( INS_ARG )
- {
- DO_CINDEX
- }
-
-
- /*************************************************************************/
- /* */
- /* EIF[]: End IF */
- /* Opcode range: 0x59 */
- /* Stack: --> */
- /* */
- static void
- Ins_EIF( INS_ARG )
- {
- /* nothing to do */
- }
-
-
- /*************************************************************************/
- /* */
- /* JROT[]: Jump Relative On True */
- /* Opcode range: 0x78 */
- /* Stack: StkElt int32 --> */
- /* */
- static void
- Ins_JROT( INS_ARG )
- {
- DO_JROT
- }
-
-
- /*************************************************************************/
- /* */
- /* JMPR[]: JuMP Relative */
- /* Opcode range: 0x1C */
- /* Stack: int32 --> */
- /* */
- static void
- Ins_JMPR( INS_ARG )
- {
- DO_JMPR
- }
-
-
- /*************************************************************************/
- /* */
- /* JROF[]: Jump Relative On False */
- /* Opcode range: 0x79 */
- /* Stack: StkElt int32 --> */
- /* */
- static void
- Ins_JROF( INS_ARG )
+ Ins_DEPTH( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_JROF
+ args[0] = exc->top;
}
@@ -3966,9 +2722,9 @@
/* Stack: int32? int32? --> bool */
/* */
static void
- Ins_LT( INS_ARG )
+ Ins_LT( FT_Long* args )
{
- DO_LT
+ args[0] = ( args[0] < args[1] );
}
@@ -3979,9 +2735,9 @@
/* Stack: int32? int32? --> bool */
/* */
static void
- Ins_LTEQ( INS_ARG )
+ Ins_LTEQ( FT_Long* args )
{
- DO_LTEQ
+ args[0] = ( args[0] <= args[1] );
}
@@ -3992,9 +2748,9 @@
/* Stack: int32? int32? --> bool */
/* */
static void
- Ins_GT( INS_ARG )
+ Ins_GT( FT_Long* args )
{
- DO_GT
+ args[0] = ( args[0] > args[1] );
}
@@ -4005,9 +2761,9 @@
/* Stack: int32? int32? --> bool */
/* */
static void
- Ins_GTEQ( INS_ARG )
+ Ins_GTEQ( FT_Long* args )
{
- DO_GTEQ
+ args[0] = ( args[0] >= args[1] );
}
@@ -4018,9 +2774,9 @@
/* Stack: StkElt StkElt --> bool */
/* */
static void
- Ins_EQ( INS_ARG )
+ Ins_EQ( FT_Long* args )
{
- DO_EQ
+ args[0] = ( args[0] == args[1] );
}
@@ -4031,9 +2787,9 @@
/* Stack: StkElt StkElt --> bool */
/* */
static void
- Ins_NEQ( INS_ARG )
+ Ins_NEQ( FT_Long* args )
{
- DO_NEQ
+ args[0] = ( args[0] != args[1] );
}
@@ -4044,9 +2800,10 @@
/* Stack: f26.6 --> bool */
/* */
static void
- Ins_ODD( INS_ARG )
+ Ins_ODD( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_ODD
+ args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 127 ) == 64 );
}
@@ -4057,9 +2814,10 @@
/* Stack: f26.6 --> bool */
/* */
static void
- Ins_EVEN( INS_ARG )
+ Ins_EVEN( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_EVEN
+ args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 127 ) == 0 );
}
@@ -4070,9 +2828,9 @@
/* Stack: uint32 uint32 --> uint32 */
/* */
static void
- Ins_AND( INS_ARG )
+ Ins_AND( FT_Long* args )
{
- DO_AND
+ args[0] = ( args[0] && args[1] );
}
@@ -4083,9 +2841,9 @@
/* Stack: uint32 uint32 --> uint32 */
/* */
static void
- Ins_OR( INS_ARG )
+ Ins_OR( FT_Long* args )
{
- DO_OR
+ args[0] = ( args[0] || args[1] );
}
@@ -4096,9 +2854,9 @@
/* Stack: StkElt --> uint32 */
/* */
static void
- Ins_NOT( INS_ARG )
+ Ins_NOT( FT_Long* args )
{
- DO_NOT
+ args[0] = !args[0];
}
@@ -4109,9 +2867,9 @@
/* Stack: f26.6 f26.6 --> f26.6 */
/* */
static void
- Ins_ADD( INS_ARG )
+ Ins_ADD( FT_Long* args )
{
- DO_ADD
+ args[0] += args[1];
}
@@ -4122,9 +2880,9 @@
/* Stack: f26.6 f26.6 --> f26.6 */
/* */
static void
- Ins_SUB( INS_ARG )
+ Ins_SUB( FT_Long* args )
{
- DO_SUB
+ args[0] -= args[1];
}
@@ -4135,9 +2893,13 @@
/* Stack: f26.6 f26.6 --> f26.6 */
/* */
static void
- Ins_DIV( INS_ARG )
+ Ins_DIV( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_DIV
+ if ( args[1] == 0 )
+ exc->error = FT_THROW( Divide_By_Zero );
+ else
+ args[0] = FT_MulDiv_No_Round( args[0], 64L, args[1] );
}
@@ -4148,9 +2910,9 @@
/* Stack: f26.6 f26.6 --> f26.6 */
/* */
static void
- Ins_MUL( INS_ARG )
+ Ins_MUL( FT_Long* args )
{
- DO_MUL
+ args[0] = FT_MulDiv( args[0], args[1], 64L );
}
@@ -4161,9 +2923,9 @@
/* Stack: f26.6 --> f26.6 */
/* */
static void
- Ins_ABS( INS_ARG )
+ Ins_ABS( FT_Long* args )
{
- DO_ABS
+ args[0] = FT_ABS( args[0] );
}
@@ -4174,9 +2936,9 @@
/* Stack: f26.6 --> f26.6 */
/* */
static void
- Ins_NEG( INS_ARG )
+ Ins_NEG( FT_Long* args )
{
- DO_NEG
+ args[0] = -args[0];
}
@@ -4187,9 +2949,9 @@
/* Stack: f26.6 --> f26.6 */
/* */
static void
- Ins_FLOOR( INS_ARG )
+ Ins_FLOOR( FT_Long* args )
{
- DO_FLOOR
+ args[0] = FT_PIX_FLOOR( args[0] );
}
@@ -4200,9 +2962,9 @@
/* Stack: f26.6 --> f26.6 */
/* */
static void
- Ins_CEILING( INS_ARG )
+ Ins_CEILING( FT_Long* args )
{
- DO_CEILING
+ args[0] = FT_PIX_CEIL( args[0] );
}
@@ -4213,9 +2975,59 @@
/* Stack: uint32 --> uint32 */
/* */
static void
- Ins_RS( INS_ARG )
+ Ins_RS( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_RS
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+ FT_ULong I = (FT_ULong)args[0];
+
+
+ if ( BOUNDSL( I, exc->storeSize ) )
+ {
+ if ( exc->pedantic_hinting )
+ ARRAY_BOUND_ERROR;
+ else
+ args[0] = 0;
+ }
+ else
+ {
+ /* subpixel hinting - avoid Typeman Dstroke and */
+ /* IStroke and Vacuform rounds */
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ ( ( I == 24 &&
+ ( exc->face->sph_found_func_flags &
+ ( SPH_FDEF_SPACING_1 |
+ SPH_FDEF_SPACING_2 ) ) ) ||
+ ( I == 22 &&
+ ( exc->sph_in_func_flags &
+ SPH_FDEF_TYPEMAN_STROKES ) ) ||
+ ( I == 8 &&
+ ( exc->face->sph_found_func_flags &
+ SPH_FDEF_VACUFORM_ROUND_1 ) &&
+ exc->iup_called ) ) )
+ args[0] = 0;
+ else
+ args[0] = exc->storage[I];
+ }
+
+#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
+ FT_ULong I = (FT_ULong)args[0];
+
+
+ if ( BOUNDSL( I, exc->storeSize ) )
+ {
+ if ( exc->pedantic_hinting )
+ ARRAY_BOUND_ERROR;
+ else
+ args[0] = 0;
+ }
+ else
+ args[0] = exc->storage[I];
+
+#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
}
@@ -4226,9 +3038,19 @@
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_WS( INS_ARG )
+ Ins_WS( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_WS
+ FT_ULong I = (FT_ULong)args[0];
+
+
+ if ( BOUNDSL( I, exc->storeSize ) )
+ {
+ if ( exc->pedantic_hinting )
+ ARRAY_BOUND_ERROR;
+ }
+ else
+ exc->storage[I] = args[1];
}
@@ -4239,9 +3061,19 @@
/* Stack: f26.6 uint32 --> */
/* */
static void
- Ins_WCVTP( INS_ARG )
+ Ins_WCVTP( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_WCVTP
+ FT_ULong I = (FT_ULong)args[0];
+
+
+ if ( BOUNDSL( I, exc->cvtSize ) )
+ {
+ if ( exc->pedantic_hinting )
+ ARRAY_BOUND_ERROR;
+ }
+ else
+ exc->func_write_cvt( exc, I, args[1] );
}
@@ -4252,9 +3084,19 @@
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_WCVTF( INS_ARG )
+ Ins_WCVTF( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_WCVTF
+ FT_ULong I = (FT_ULong)args[0];
+
+
+ if ( BOUNDSL( I, exc->cvtSize ) )
+ {
+ if ( exc->pedantic_hinting )
+ ARRAY_BOUND_ERROR;
+ }
+ else
+ exc->cvt[I] = FT_MulFix( args[1], exc->tt_metrics.scale );
}
@@ -4265,9 +3107,21 @@
/* Stack: uint32 --> f26.6 */
/* */
static void
- Ins_RCVT( INS_ARG )
+ Ins_RCVT( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_RCVT
+ FT_ULong I = (FT_ULong)args[0];
+
+
+ if ( BOUNDSL( I, exc->cvtSize ) )
+ {
+ if ( exc->pedantic_hinting )
+ ARRAY_BOUND_ERROR;
+ else
+ args[0] = 0;
+ }
+ else
+ args[0] = exc->func_read_cvt( exc, I );
}
@@ -4278,7 +3132,7 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_AA( INS_ARG )
+ Ins_AA( void )
{
/* intentionally no longer supported */
}
@@ -4293,9 +3147,9 @@
/* Note: The original instruction pops a value from the stack. */
/* */
static void
- Ins_DEBUG( INS_ARG )
+ Ins_DEBUG( TT_ExecContext exc )
{
- DO_DEBUG
+ exc->error = FT_THROW( Debug_OpCode );
}
@@ -4306,9 +3160,13 @@
/* Stack: f26.6 --> f26.6 */
/* */
static void
- Ins_ROUND( INS_ARG )
+ Ins_ROUND( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_ROUND
+ args[0] = exc->func_round(
+ exc,
+ args[0],
+ exc->tt_metrics.compensations[exc->opcode - 0x68] );
}
@@ -4319,9 +3177,13 @@
/* Stack: f26.6 --> f26.6 */
/* */
static void
- Ins_NROUND( INS_ARG )
+ Ins_NROUND( TT_ExecContext exc,
+ FT_Long* args )
{
- DO_NROUND
+ args[0] = Round_None(
+ exc,
+ args[0],
+ exc->tt_metrics.compensations[exc->opcode - 0x6C] );
}
@@ -4332,9 +3194,10 @@
/* Stack: int32? int32? --> int32 */
/* */
static void
- Ins_MAX( INS_ARG )
+ Ins_MAX( FT_Long* args )
{
- DO_MAX
+ if ( args[1] > args[0] )
+ args[0] = args[1];
}
@@ -4345,22 +3208,13 @@
/* Stack: int32? int32? --> int32 */
/* */
static void
- Ins_MIN( INS_ARG )
+ Ins_MIN( FT_Long* args )
{
- DO_MIN
+ if ( args[1] < args[0] )
+ args[0] = args[1];
}
-#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */
-
-
- /*************************************************************************/
- /* */
- /* The following functions are called as is within the switch statement. */
- /* */
- /*************************************************************************/
-
-
/*************************************************************************/
/* */
/* MINDEX[]: Move INDEXed element */
@@ -4368,28 +3222,55 @@
/* Stack: int32? --> StkElt */
/* */
static void
- Ins_MINDEX( INS_ARG )
+ Ins_MINDEX( TT_ExecContext exc,
+ FT_Long* args )
{
FT_Long L, K;
L = args[0];
- if ( L <= 0 || L > CUR.args )
+ if ( L <= 0 || L > exc->args )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
}
else
{
- K = CUR.stack[CUR.args - L];
+ K = exc->stack[exc->args - L];
- FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ],
- &CUR.stack[CUR.args - L + 1],
+ FT_ARRAY_MOVE( &exc->stack[exc->args - L ],
+ &exc->stack[exc->args - L + 1],
( L - 1 ) );
- CUR.stack[CUR.args - 1] = K;
+ exc->stack[exc->args - 1] = K;
+ }
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* CINDEX[]: Copy INDEXed element */
+ /* Opcode range: 0x25 */
+ /* Stack: int32 --> StkElt */
+ /* */
+ static void
+ Ins_CINDEX( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ FT_Long L;
+
+
+ L = args[0];
+
+ if ( L <= 0 || L > exc->args )
+ {
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
+ args[0] = 0;
}
+ else
+ args[0] = exc->stack[exc->args - L];
}
@@ -4400,12 +3281,10 @@
/* Stack: 3 * StkElt --> 3 * StkElt */
/* */
static void
- Ins_ROLL( INS_ARG )
+ Ins_ROLL( FT_Long* args )
{
FT_Long A, B, C;
- FT_UNUSED_EXEC;
-
A = args[2];
B = args[1];
@@ -4421,34 +3300,49 @@
/* */
/* MANAGING THE FLOW OF CONTROL */
/* */
- /* Instructions appear in the specification's order. */
- /* */
/*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* SLOOP[]: Set LOOP variable */
+ /* Opcode range: 0x17 */
+ /* Stack: int32? --> */
+ /* */
+ static void
+ Ins_SLOOP( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( args[0] < 0 )
+ exc->error = FT_THROW( Bad_Argument );
+ else
+ exc->GS.loop = args[0];
+ }
+
+
static FT_Bool
- SkipCode( EXEC_OP )
+ SkipCode( TT_ExecContext exc )
{
- CUR.IP += CUR.length;
+ exc->IP += exc->length;
- if ( CUR.IP < CUR.codeSize )
+ if ( exc->IP < exc->codeSize )
{
- CUR.opcode = CUR.code[CUR.IP];
+ exc->opcode = exc->code[exc->IP];
- CUR.length = opcode_length[CUR.opcode];
- if ( CUR.length < 0 )
+ exc->length = opcode_length[exc->opcode];
+ if ( exc->length < 0 )
{
- if ( CUR.IP + 1 >= CUR.codeSize )
+ if ( exc->IP + 1 >= exc->codeSize )
goto Fail_Overflow;
- CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
+ exc->length = 2 - exc->length * exc->code[exc->IP + 1];
}
- if ( CUR.IP + CUR.length <= CUR.codeSize )
+ if ( exc->IP + exc->length <= exc->codeSize )
return SUCCESS;
}
Fail_Overflow:
- CUR.error = FT_THROW( Code_Overflow );
+ exc->error = FT_THROW( Code_Overflow );
return FAILURE;
}
@@ -4460,7 +3354,8 @@
/* Stack: StkElt --> */
/* */
static void
- Ins_IF( INS_ARG )
+ Ins_IF( TT_ExecContext exc,
+ FT_Long* args )
{
FT_Int nIfs;
FT_Bool Out;
@@ -4474,10 +3369,10 @@
do
{
- if ( SKIP_Code() == FAILURE )
+ if ( SkipCode( exc ) == FAILURE )
return;
- switch ( CUR.opcode )
+ switch ( exc->opcode )
{
case 0x58: /* IF */
nIfs++;
@@ -4503,21 +3398,19 @@
/* Stack: --> */
/* */
static void
- Ins_ELSE( INS_ARG )
+ Ins_ELSE( TT_ExecContext exc )
{
FT_Int nIfs;
- FT_UNUSED_ARG;
-
nIfs = 1;
do
{
- if ( SKIP_Code() == FAILURE )
+ if ( SkipCode( exc ) == FAILURE )
return;
- switch ( CUR.opcode )
+ switch ( exc->opcode )
{
case 0x58: /* IF */
nIfs++;
@@ -4533,9 +3426,71 @@
/*************************************************************************/
/* */
- /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS */
+ /* EIF[]: End IF */
+ /* Opcode range: 0x59 */
+ /* Stack: --> */
/* */
- /* Instructions appear in the specification's order. */
+ static void
+ Ins_EIF( void )
+ {
+ /* nothing to do */
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* JMPR[]: JuMP Relative */
+ /* Opcode range: 0x1C */
+ /* Stack: int32 --> */
+ /* */
+ static void
+ Ins_JMPR( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( args[0] == 0 && exc->args == 0 )
+ exc->error = FT_THROW( Bad_Argument );
+ exc->IP += args[0];
+ if ( exc->IP < 0 ||
+ ( exc->callTop > 0 &&
+ exc->IP > exc->callStack[exc->callTop - 1].Def->end ) )
+ exc->error = FT_THROW( Bad_Argument );
+ exc->step_ins = FALSE;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* JROT[]: Jump Relative On True */
+ /* Opcode range: 0x78 */
+ /* Stack: StkElt int32 --> */
+ /* */
+ static void
+ Ins_JROT( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( args[1] != 0 )
+ Ins_JMPR( exc, args );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* JROF[]: Jump Relative On False */
+ /* Opcode range: 0x79 */
+ /* Stack: StkElt int32 --> */
+ /* */
+ static void
+ Ins_JROF( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( args[1] == 0 )
+ Ins_JMPR( exc, args );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS */
/* */
/*************************************************************************/
@@ -4547,7 +3502,8 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_FDEF( INS_ARG )
+ Ins_FDEF( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong n;
TT_DefRecord* rec;
@@ -4657,9 +3613,9 @@
/* some font programs are broken enough to redefine functions! */
/* We will then parse the current table. */
- rec = CUR.FDefs;
- limit = rec + CUR.numFDefs;
- n = args[0];
+ rec = exc->FDefs;
+ limit = rec + exc->numFDefs;
+ n = (FT_ULong)args[0];
for ( ; rec < limit; rec++ )
{
@@ -4670,31 +3626,31 @@
if ( rec == limit )
{
/* check that there is enough room for new functions */
- if ( CUR.numFDefs >= CUR.maxFDefs )
+ if ( exc->numFDefs >= exc->maxFDefs )
{
- CUR.error = FT_THROW( Too_Many_Function_Defs );
+ exc->error = FT_THROW( Too_Many_Function_Defs );
return;
}
- CUR.numFDefs++;
+ exc->numFDefs++;
}
/* Although FDEF takes unsigned 32-bit integer, */
/* func # must be within unsigned 16-bit integer */
if ( n > 0xFFFFU )
{
- CUR.error = FT_THROW( Too_Many_Function_Defs );
+ exc->error = FT_THROW( Too_Many_Function_Defs );
return;
}
- rec->range = CUR.curRange;
+ rec->range = exc->curRange;
rec->opc = (FT_UInt16)n;
- rec->start = CUR.IP + 1;
+ rec->start = exc->IP + 1;
rec->active = TRUE;
rec->inline_delta = FALSE;
rec->sph_fdef_flags = 0x0000;
- if ( n > CUR.maxFunc )
- CUR.maxFunc = (FT_UInt16)n;
+ if ( n > exc->maxFunc )
+ exc->maxFunc = (FT_UInt16)n;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* We don't know for sure these are typeman functions, */
@@ -4706,7 +3662,7 @@
/* Now skip the whole function definition. */
/* We don't allow nested IDEFS & FDEFs. */
- while ( SKIP_Code() == SUCCESS )
+ while ( SkipCode( exc ) == SUCCESS )
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
@@ -4715,28 +3671,28 @@
{
for ( i = 0; i < opcode_patterns; i++ )
{
- if ( opcode_pointer[i] < opcode_size[i] &&
- CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )
+ if ( opcode_pointer[i] < opcode_size[i] &&
+ exc->opcode == opcode_pattern[i][opcode_pointer[i]] )
{
opcode_pointer[i] += 1;
if ( opcode_pointer[i] == opcode_size[i] )
{
- FT_TRACE7(( "sph: Function %d, opcode ptrn: %d, %s %s\n",
+ FT_TRACE6(( "sph: Function %d, opcode ptrn: %d, %s %s\n",
i, n,
- CUR.face->root.family_name,
- CUR.face->root.style_name ));
+ exc->face->root.family_name,
+ exc->face->root.style_name ));
switch ( i )
{
case 0:
- rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_1;
- CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1;
+ rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_1;
+ exc->face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1;
break;
case 1:
- rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_2;
- CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2;
+ rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_2;
+ exc->face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2;
break;
case 2:
@@ -4744,8 +3700,8 @@
{
/* needs to be implemented still */
case 58:
- rec->sph_fdef_flags |= SPH_FDEF_DIAGONAL_STROKE;
- CUR.face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE;
+ rec->sph_fdef_flags |= SPH_FDEF_DIAGONAL_STROKE;
+ exc->face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE;
}
break;
@@ -4753,15 +3709,15 @@
switch ( n )
{
case 0:
- rec->sph_fdef_flags |= SPH_FDEF_VACUFORM_ROUND_1;
- CUR.face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1;
+ rec->sph_fdef_flags |= SPH_FDEF_VACUFORM_ROUND_1;
+ exc->face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1;
}
break;
case 4:
/* probably not necessary to detect anymore */
- rec->sph_fdef_flags |= SPH_FDEF_TTFAUTOHINT_1;
- CUR.face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1;
+ rec->sph_fdef_flags |= SPH_FDEF_TTFAUTOHINT_1;
+ exc->face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1;
break;
case 5:
@@ -4773,8 +3729,8 @@
case 4:
case 7:
case 8:
- rec->sph_fdef_flags |= SPH_FDEF_SPACING_1;
- CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_1;
+ rec->sph_fdef_flags |= SPH_FDEF_SPACING_1;
+ exc->face->sph_found_func_flags |= SPH_FDEF_SPACING_1;
}
break;
@@ -4787,20 +3743,20 @@
case 4:
case 7:
case 8:
- rec->sph_fdef_flags |= SPH_FDEF_SPACING_2;
- CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_2;
+ rec->sph_fdef_flags |= SPH_FDEF_SPACING_2;
+ exc->face->sph_found_func_flags |= SPH_FDEF_SPACING_2;
}
break;
case 7:
- rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
- CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+ rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+ exc->face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
break;
case 8:
#if 0
- rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
- CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+ rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
+ exc->face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
#endif
break;
}
@@ -4813,22 +3769,22 @@
}
/* Set sph_compatibility_mode only when deltas are detected */
- CUR.face->sph_compatibility_mode =
- ( ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) |
- ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) );
+ exc->face->sph_compatibility_mode =
+ ( ( exc->face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) |
+ ( exc->face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) );
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- switch ( CUR.opcode )
+ switch ( exc->opcode )
{
case 0x89: /* IDEF */
case 0x2C: /* FDEF */
- CUR.error = FT_THROW( Nested_DEFS );
+ exc->error = FT_THROW( Nested_DEFS );
return;
case 0x2D: /* ENDF */
- rec->end = CUR.IP;
+ rec->end = exc->IP;
return;
}
}
@@ -4842,40 +3798,37 @@
/* Stack: --> */
/* */
static void
- Ins_ENDF( INS_ARG )
+ Ins_ENDF( TT_ExecContext exc )
{
TT_CallRec* pRec;
- FT_UNUSED_ARG;
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- CUR.sph_in_func_flags = 0x0000;
+ exc->sph_in_func_flags = 0x0000;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */
+ if ( exc->callTop <= 0 ) /* We encountered an ENDF without a call */
{
- CUR.error = FT_THROW( ENDF_In_Exec_Stream );
+ exc->error = FT_THROW( ENDF_In_Exec_Stream );
return;
}
- CUR.callTop--;
+ exc->callTop--;
- pRec = &CUR.callStack[CUR.callTop];
+ pRec = &exc->callStack[exc->callTop];
pRec->Cur_Count--;
- CUR.step_ins = FALSE;
+ exc->step_ins = FALSE;
if ( pRec->Cur_Count > 0 )
{
- CUR.callTop++;
- CUR.IP = pRec->Def->start;
+ exc->callTop++;
+ exc->IP = pRec->Def->start;
}
else
/* Loop through the current function */
- INS_Goto_CodeRange( pRec->Caller_Range,
- pRec->Caller_IP );
+ Ins_Goto_CodeRange( exc, pRec->Caller_Range, pRec->Caller_IP );
/* Exit the current call frame. */
@@ -4894,7 +3847,8 @@
/* Stack: uint32? --> */
/* */
static void
- Ins_CALL( INS_ARG )
+ Ins_CALL( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong F;
TT_CallRec* pCrec;
@@ -4903,28 +3857,28 @@
/* first of all, check the index */
- F = args[0];
- if ( BOUNDSL( F, CUR.maxFunc + 1 ) )
+ F = (FT_ULong)args[0];
+ if ( BOUNDSL( F, exc->maxFunc + 1 ) )
goto Fail;
/* Except for some old Apple fonts, all functions in a TrueType */
/* font are defined in increasing order, starting from 0. This */
/* means that we normally have */
/* */
- /* CUR.maxFunc+1 == CUR.numFDefs */
- /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */
+ /* exc->maxFunc+1 == exc->numFDefs */
+ /* exc->FDefs[n].opc == n for n in 0..exc->maxFunc */
/* */
/* If this isn't true, we need to look up the function table. */
- def = CUR.FDefs + F;
- if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )
+ def = exc->FDefs + F;
+ if ( exc->maxFunc + 1 != exc->numFDefs || def->opc != F )
{
/* look up the FDefs table */
TT_DefRecord* limit;
- def = CUR.FDefs;
- limit = def + CUR.numFDefs;
+ def = exc->FDefs;
+ limit = def + exc->numFDefs;
while ( def < limit && def->opc != F )
def++;
@@ -4938,41 +3892,40 @@
goto Fail;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- ( ( CUR.iup_called &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) ||
- ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ ( ( exc->iup_called &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) ||
+ ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) ) )
goto Fail;
else
- CUR.sph_in_func_flags = def->sph_fdef_flags;
+ exc->sph_in_func_flags = def->sph_fdef_flags;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/* check the call stack */
- if ( CUR.callTop >= CUR.callSize )
+ if ( exc->callTop >= exc->callSize )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
- pCrec = CUR.callStack + CUR.callTop;
+ pCrec = exc->callStack + exc->callTop;
- pCrec->Caller_Range = CUR.curRange;
- pCrec->Caller_IP = CUR.IP + 1;
+ pCrec->Caller_Range = exc->curRange;
+ pCrec->Caller_IP = exc->IP + 1;
pCrec->Cur_Count = 1;
pCrec->Def = def;
- CUR.callTop++;
+ exc->callTop++;
- INS_Goto_CodeRange( def->range,
- def->start );
+ Ins_Goto_CodeRange( exc, def->range, def->start );
- CUR.step_ins = FALSE;
+ exc->step_ins = FALSE;
return;
Fail:
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
}
@@ -4983,7 +3936,8 @@
/* Stack: uint32? Eint16? --> */
/* */
static void
- Ins_LOOPCALL( INS_ARG )
+ Ins_LOOPCALL( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong F;
TT_CallRec* pCrec;
@@ -4991,28 +3945,28 @@
/* first of all, check the index */
- F = args[1];
- if ( BOUNDSL( F, CUR.maxFunc + 1 ) )
+ F = (FT_ULong)args[1];
+ if ( BOUNDSL( F, exc->maxFunc + 1 ) )
goto Fail;
/* Except for some old Apple fonts, all functions in a TrueType */
/* font are defined in increasing order, starting from 0. This */
/* means that we normally have */
/* */
- /* CUR.maxFunc+1 == CUR.numFDefs */
- /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */
+ /* exc->maxFunc+1 == exc->numFDefs */
+ /* exc->FDefs[n].opc == n for n in 0..exc->maxFunc */
/* */
/* If this isn't true, we need to look up the function table. */
- def = CUR.FDefs + F;
- if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )
+ def = exc->FDefs + F;
+ if ( exc->maxFunc + 1 != exc->numFDefs || def->opc != F )
{
/* look up the FDefs table */
TT_DefRecord* limit;
- def = CUR.FDefs;
- limit = def + CUR.numFDefs;
+ def = exc->FDefs;
+ limit = def + exc->numFDefs;
while ( def < limit && def->opc != F )
def++;
@@ -5027,40 +3981,40 @@
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
+ exc->ignore_x_mode &&
( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) )
goto Fail;
else
- CUR.sph_in_func_flags = def->sph_fdef_flags;
+ exc->sph_in_func_flags = def->sph_fdef_flags;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/* check stack */
- if ( CUR.callTop >= CUR.callSize )
+ if ( exc->callTop >= exc->callSize )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
if ( args[0] > 0 )
{
- pCrec = CUR.callStack + CUR.callTop;
+ pCrec = exc->callStack + exc->callTop;
- pCrec->Caller_Range = CUR.curRange;
- pCrec->Caller_IP = CUR.IP + 1;
+ pCrec->Caller_Range = exc->curRange;
+ pCrec->Caller_IP = exc->IP + 1;
pCrec->Cur_Count = (FT_Int)args[0];
pCrec->Def = def;
- CUR.callTop++;
+ exc->callTop++;
- INS_Goto_CodeRange( def->range, def->start );
+ Ins_Goto_CodeRange( exc, def->range, def->start );
- CUR.step_ins = FALSE;
+ exc->step_ins = FALSE;
}
return;
Fail:
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
}
@@ -5071,7 +4025,8 @@
/* Stack: Eint8 --> */
/* */
static void
- Ins_IDEF( INS_ARG )
+ Ins_IDEF( TT_ExecContext exc,
+ FT_Long* args )
{
TT_DefRecord* def;
TT_DefRecord* limit;
@@ -5079,8 +4034,8 @@
/* First of all, look for the same function in our table */
- def = CUR.IDefs;
- limit = def + CUR.numIDefs;
+ def = exc->IDefs;
+ limit = def + exc->numIDefs;
for ( ; def < limit; def++ )
if ( def->opc == (FT_ULong)args[0] )
@@ -5089,39 +4044,39 @@
if ( def == limit )
{
/* check that there is enough room for a new instruction */
- if ( CUR.numIDefs >= CUR.maxIDefs )
+ if ( exc->numIDefs >= exc->maxIDefs )
{
- CUR.error = FT_THROW( Too_Many_Instruction_Defs );
+ exc->error = FT_THROW( Too_Many_Instruction_Defs );
return;
}
- CUR.numIDefs++;
+ exc->numIDefs++;
}
/* opcode must be unsigned 8-bit integer */
if ( 0 > args[0] || args[0] > 0x00FF )
{
- CUR.error = FT_THROW( Too_Many_Instruction_Defs );
+ exc->error = FT_THROW( Too_Many_Instruction_Defs );
return;
}
def->opc = (FT_Byte)args[0];
- def->start = CUR.IP + 1;
- def->range = CUR.curRange;
+ def->start = exc->IP + 1;
+ def->range = exc->curRange;
def->active = TRUE;
- if ( (FT_ULong)args[0] > CUR.maxIns )
- CUR.maxIns = (FT_Byte)args[0];
+ if ( (FT_ULong)args[0] > exc->maxIns )
+ exc->maxIns = (FT_Byte)args[0];
/* Now skip the whole function definition. */
/* We don't allow nested IDEFs & FDEFs. */
- while ( SKIP_Code() == SUCCESS )
+ while ( SkipCode( exc ) == SUCCESS )
{
- switch ( CUR.opcode )
+ switch ( exc->opcode )
{
case 0x89: /* IDEF */
case 0x2C: /* FDEF */
- CUR.error = FT_THROW( Nested_DEFS );
+ exc->error = FT_THROW( Nested_DEFS );
return;
case 0x2D: /* ENDF */
return;
@@ -5134,8 +4089,6 @@
/* */
/* PUSHING DATA ONTO THE INTERPRETER STACK */
/* */
- /* Instructions appear in the specification's order. */
- /* */
/*************************************************************************/
@@ -5146,23 +4099,24 @@
/* Stack: --> uint32... */
/* */
static void
- Ins_NPUSHB( INS_ARG )
+ Ins_NPUSHB( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort L, K;
- L = (FT_UShort)CUR.code[CUR.IP + 1];
+ L = (FT_UShort)exc->code[exc->IP + 1];
- if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
+ if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
for ( K = 1; K <= L; K++ )
- args[K - 1] = CUR.code[CUR.IP + K + 1];
+ args[K - 1] = exc->code[exc->IP + K + 1];
- CUR.new_top += L;
+ exc->new_top += L;
}
@@ -5173,26 +4127,27 @@
/* Stack: --> int32... */
/* */
static void
- Ins_NPUSHW( INS_ARG )
+ Ins_NPUSHW( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort L, K;
- L = (FT_UShort)CUR.code[CUR.IP + 1];
+ L = (FT_UShort)exc->code[exc->IP + 1];
- if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
+ if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
- CUR.IP += 2;
+ exc->IP += 2;
for ( K = 0; K < L; K++ )
- args[K] = GET_ShortIns();
+ args[K] = GetShortIns( exc );
- CUR.step_ins = FALSE;
- CUR.new_top += L;
+ exc->step_ins = FALSE;
+ exc->new_top += L;
}
@@ -5203,21 +4158,22 @@
/* Stack: --> uint32... */
/* */
static void
- Ins_PUSHB( INS_ARG )
+ Ins_PUSHB( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort L, K;
- L = (FT_UShort)( CUR.opcode - 0xB0 + 1 );
+ L = (FT_UShort)( exc->opcode - 0xB0 + 1 );
- if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
+ if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
for ( K = 1; K <= L; K++ )
- args[K - 1] = CUR.code[CUR.IP + K];
+ args[K - 1] = exc->code[exc->IP + K];
}
@@ -5228,25 +4184,26 @@
/* Stack: --> int32... */
/* */
static void
- Ins_PUSHW( INS_ARG )
+ Ins_PUSHW( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort L, K;
- L = (FT_UShort)( CUR.opcode - 0xB8 + 1 );
+ L = (FT_UShort)( exc->opcode - 0xB8 + 1 );
- if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
+ if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
- CUR.IP++;
+ exc->IP++;
for ( K = 0; K < L; K++ )
- args[K] = GET_ShortIns();
+ args[K] = GetShortIns( exc );
- CUR.step_ins = FALSE;
+ exc->step_ins = FALSE;
}
@@ -5254,9 +4211,559 @@
/* */
/* MANAGING THE GRAPHICS STATE */
/* */
- /* Instructions appear in the specs' order. */
+ /*************************************************************************/
+
+
+ static FT_Bool
+ Ins_SxVTL( TT_ExecContext exc,
+ FT_UShort aIdx1,
+ FT_UShort aIdx2,
+ FT_UnitVector* Vec )
+ {
+ FT_Long A, B, C;
+ FT_Vector* p1;
+ FT_Vector* p2;
+
+ FT_Byte opcode = exc->opcode;
+
+
+ if ( BOUNDS( aIdx1, exc->zp2.n_points ) ||
+ BOUNDS( aIdx2, exc->zp1.n_points ) )
+ {
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
+ return FAILURE;
+ }
+
+ p1 = exc->zp1.cur + aIdx2;
+ p2 = exc->zp2.cur + aIdx1;
+
+ A = p1->x - p2->x;
+ B = p1->y - p2->y;
+
+ /* If p1 == p2, SPvTL and SFvTL behave the same as */
+ /* SPvTCA[X] and SFvTCA[X], respectively. */
+ /* */
+ /* Confirmed by Greg Hitchcock. */
+
+ if ( A == 0 && B == 0 )
+ {
+ A = 0x4000;
+ opcode = 0;
+ }
+
+ if ( ( opcode & 1 ) != 0 )
+ {
+ C = B; /* counter clockwise rotation */
+ B = A;
+ A = -C;
+ }
+
+ Normalize( A, B, Vec );
+
+ return SUCCESS;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SVTCA[a]: Set (F and P) Vectors to Coordinate Axis */
+ /* Opcode range: 0x00-0x01 */
+ /* Stack: --> */
/* */
+ /* SPvTCA[a]: Set PVector to Coordinate Axis */
+ /* Opcode range: 0x02-0x03 */
+ /* Stack: --> */
+ /* */
+ /* SFvTCA[a]: Set FVector to Coordinate Axis */
+ /* Opcode range: 0x04-0x05 */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_SxyTCA( TT_ExecContext exc )
+ {
+ FT_Short AA, BB;
+
+ FT_Byte opcode = exc->opcode;
+
+
+ AA = (FT_Short)( ( opcode & 1 ) << 14 );
+ BB = (FT_Short)( AA ^ 0x4000 );
+
+ if ( opcode < 4 )
+ {
+ exc->GS.projVector.x = AA;
+ exc->GS.projVector.y = BB;
+
+ exc->GS.dualVector.x = AA;
+ exc->GS.dualVector.y = BB;
+ }
+ else
+ GUESS_VECTOR( projVector );
+
+ if ( ( opcode & 2 ) == 0 )
+ {
+ exc->GS.freeVector.x = AA;
+ exc->GS.freeVector.y = BB;
+ }
+ else
+ GUESS_VECTOR( freeVector );
+
+ Compute_Funcs( exc );
+ }
+
+
/*************************************************************************/
+ /* */
+ /* SPvTL[a]: Set PVector To Line */
+ /* Opcode range: 0x06-0x07 */
+ /* Stack: uint32 uint32 --> */
+ /* */
+ static void
+ Ins_SPVTL( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( Ins_SxVTL( exc,
+ (FT_UShort)args[1],
+ (FT_UShort)args[0],
+ &exc->GS.projVector ) == SUCCESS )
+ {
+ exc->GS.dualVector = exc->GS.projVector;
+ GUESS_VECTOR( freeVector );
+ Compute_Funcs( exc );
+ }
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SFvTL[a]: Set FVector To Line */
+ /* Opcode range: 0x08-0x09 */
+ /* Stack: uint32 uint32 --> */
+ /* */
+ static void
+ Ins_SFVTL( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( Ins_SxVTL( exc,
+ (FT_UShort)args[1],
+ (FT_UShort)args[0],
+ &exc->GS.freeVector ) == SUCCESS )
+ {
+ GUESS_VECTOR( projVector );
+ Compute_Funcs( exc );
+ }
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SFvTPv[]: Set FVector To PVector */
+ /* Opcode range: 0x0E */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_SFVTPV( TT_ExecContext exc )
+ {
+ GUESS_VECTOR( projVector );
+ exc->GS.freeVector = exc->GS.projVector;
+ Compute_Funcs( exc );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SPvFS[]: Set PVector From Stack */
+ /* Opcode range: 0x0A */
+ /* Stack: f2.14 f2.14 --> */
+ /* */
+ static void
+ Ins_SPVFS( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ FT_Short S;
+ FT_Long X, Y;
+
+
+ /* Only use low 16bits, then sign extend */
+ S = (FT_Short)args[1];
+ Y = (FT_Long)S;
+ S = (FT_Short)args[0];
+ X = (FT_Long)S;
+
+ Normalize( X, Y, &exc->GS.projVector );
+
+ exc->GS.dualVector = exc->GS.projVector;
+ GUESS_VECTOR( freeVector );
+ Compute_Funcs( exc );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SFvFS[]: Set FVector From Stack */
+ /* Opcode range: 0x0B */
+ /* Stack: f2.14 f2.14 --> */
+ /* */
+ static void
+ Ins_SFVFS( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ FT_Short S;
+ FT_Long X, Y;
+
+
+ /* Only use low 16bits, then sign extend */
+ S = (FT_Short)args[1];
+ Y = (FT_Long)S;
+ S = (FT_Short)args[0];
+ X = S;
+
+ Normalize( X, Y, &exc->GS.freeVector );
+ GUESS_VECTOR( projVector );
+ Compute_Funcs( exc );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* GPv[]: Get Projection Vector */
+ /* Opcode range: 0x0C */
+ /* Stack: ef2.14 --> ef2.14 */
+ /* */
+ static void
+ Ins_GPV( TT_ExecContext exc,
+ FT_Long* args )
+ {
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
+ if ( exc->face->unpatented_hinting )
+ {
+ args[0] = exc->GS.both_x_axis ? 0x4000 : 0;
+ args[1] = exc->GS.both_x_axis ? 0 : 0x4000;
+ }
+ else
+ {
+ args[0] = exc->GS.projVector.x;
+ args[1] = exc->GS.projVector.y;
+ }
+#else
+ args[0] = exc->GS.projVector.x;
+ args[1] = exc->GS.projVector.y;
+#endif
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* GFv[]: Get Freedom Vector */
+ /* Opcode range: 0x0D */
+ /* Stack: ef2.14 --> ef2.14 */
+ /* */
+ static void
+ Ins_GFV( TT_ExecContext exc,
+ FT_Long* args )
+ {
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
+ if ( exc->face->unpatented_hinting )
+ {
+ args[0] = exc->GS.both_x_axis ? 0x4000 : 0;
+ args[1] = exc->GS.both_x_axis ? 0 : 0x4000;
+ }
+ else
+ {
+ args[0] = exc->GS.freeVector.x;
+ args[1] = exc->GS.freeVector.y;
+ }
+#else
+ args[0] = exc->GS.freeVector.x;
+ args[1] = exc->GS.freeVector.y;
+#endif
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SRP0[]: Set Reference Point 0 */
+ /* Opcode range: 0x10 */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_SRP0( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.rp0 = (FT_UShort)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SRP1[]: Set Reference Point 1 */
+ /* Opcode range: 0x11 */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_SRP1( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.rp1 = (FT_UShort)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SRP2[]: Set Reference Point 2 */
+ /* Opcode range: 0x12 */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_SRP2( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.rp2 = (FT_UShort)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SMD[]: Set Minimum Distance */
+ /* Opcode range: 0x1A */
+ /* Stack: f26.6 --> */
+ /* */
+ static void
+ Ins_SMD( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.minimum_distance = args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SCVTCI[]: Set Control Value Table Cut In */
+ /* Opcode range: 0x1D */
+ /* Stack: f26.6 --> */
+ /* */
+ static void
+ Ins_SCVTCI( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.control_value_cutin = (FT_F26Dot6)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SSWCI[]: Set Single Width Cut In */
+ /* Opcode range: 0x1E */
+ /* Stack: f26.6 --> */
+ /* */
+ static void
+ Ins_SSWCI( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.single_width_cutin = (FT_F26Dot6)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SSW[]: Set Single Width */
+ /* Opcode range: 0x1F */
+ /* Stack: int32? --> */
+ /* */
+ static void
+ Ins_SSW( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.single_width_value = FT_MulFix( args[0],
+ exc->tt_metrics.scale );
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* FLIPON[]: Set auto-FLIP to ON */
+ /* Opcode range: 0x4D */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_FLIPON( TT_ExecContext exc )
+ {
+ exc->GS.auto_flip = TRUE;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* FLIPOFF[]: Set auto-FLIP to OFF */
+ /* Opcode range: 0x4E */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_FLIPOFF( TT_ExecContext exc )
+ {
+ exc->GS.auto_flip = FALSE;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SANGW[]: Set ANGle Weight */
+ /* Opcode range: 0x7E */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_SANGW( void )
+ {
+ /* instruction not supported anymore */
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SDB[]: Set Delta Base */
+ /* Opcode range: 0x5E */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_SDB( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ exc->GS.delta_base = (FT_UShort)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SDS[]: Set Delta Shift */
+ /* Opcode range: 0x5F */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_SDS( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ if ( (FT_ULong)args[0] > 6UL )
+ exc->error = FT_THROW( Bad_Argument );
+ else
+ exc->GS.delta_shift = (FT_UShort)args[0];
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* RTHG[]: Round To Half Grid */
+ /* Opcode range: 0x19 */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_RTHG( TT_ExecContext exc )
+ {
+ exc->GS.round_state = TT_Round_To_Half_Grid;
+ exc->func_round = (TT_Round_Func)Round_To_Half_Grid;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* RTG[]: Round To Grid */
+ /* Opcode range: 0x18 */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_RTG( TT_ExecContext exc )
+ {
+ exc->GS.round_state = TT_Round_To_Grid;
+ exc->func_round = (TT_Round_Func)Round_To_Grid;
+ }
+
+
+ /*************************************************************************/
+ /* RTDG[]: Round To Double Grid */
+ /* Opcode range: 0x3D */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_RTDG( TT_ExecContext exc )
+ {
+ exc->GS.round_state = TT_Round_To_Double_Grid;
+ exc->func_round = (TT_Round_Func)Round_To_Double_Grid;
+ }
+
+
+ /*************************************************************************/
+ /* RUTG[]: Round Up To Grid */
+ /* Opcode range: 0x7C */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_RUTG( TT_ExecContext exc )
+ {
+ exc->GS.round_state = TT_Round_Up_To_Grid;
+ exc->func_round = (TT_Round_Func)Round_Up_To_Grid;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* RDTG[]: Round Down To Grid */
+ /* Opcode range: 0x7D */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_RDTG( TT_ExecContext exc )
+ {
+ exc->GS.round_state = TT_Round_Down_To_Grid;
+ exc->func_round = (TT_Round_Func)Round_Down_To_Grid;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* ROFF[]: Round OFF */
+ /* Opcode range: 0x7A */
+ /* Stack: --> */
+ /* */
+ static void
+ Ins_ROFF( TT_ExecContext exc )
+ {
+ exc->GS.round_state = TT_Round_Off;
+ exc->func_round = (TT_Round_Func)Round_None;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* SROUND[]: Super ROUND */
+ /* Opcode range: 0x76 */
+ /* Stack: Eint8 --> */
+ /* */
+ static void
+ Ins_SROUND( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ SetSuperRound( exc, 0x4000, args[0] );
+
+ exc->GS.round_state = TT_Round_Super;
+ exc->func_round = (TT_Round_Func)Round_Super;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* S45ROUND[]: Super ROUND 45 degrees */
+ /* Opcode range: 0x77 */
+ /* Stack: uint32 --> */
+ /* */
+ static void
+ Ins_S45ROUND( TT_ExecContext exc,
+ FT_Long* args )
+ {
+ SetSuperRound( exc, 0x2D41, args[0] );
+
+ exc->GS.round_state = TT_Round_Super_45;
+ exc->func_round = (TT_Round_Func)Round_Super_45;
+ }
/*************************************************************************/
@@ -5269,7 +4776,8 @@
/* along the dual projection vector! */
/* */
static void
- Ins_GC( INS_ARG )
+ Ins_GC( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong L;
FT_F26Dot6 R;
@@ -5277,18 +4785,18 @@
L = (FT_ULong)args[0];
- if ( BOUNDSL( L, CUR.zp2.n_points ) )
+ if ( BOUNDSL( L, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
R = 0;
}
else
{
- if ( CUR.opcode & 1 )
- R = CUR_fast_dualproj( &CUR.zp2.org[L] );
+ if ( exc->opcode & 1 )
+ R = FAST_DUALPROJ( &exc->zp2.org[L] );
else
- R = CUR_fast_project( &CUR.zp2.cur[L] );
+ R = FAST_PROJECT( &exc->zp2.cur[L] );
}
args[0] = R;
@@ -5306,7 +4814,8 @@
/* OA := OA + ( value - OA.p )/( f.p ) * f */
/* */
static void
- Ins_SCFS( INS_ARG )
+ Ins_SCFS( TT_ExecContext exc,
+ FT_Long* args )
{
FT_Long K;
FT_UShort L;
@@ -5314,21 +4823,21 @@
L = (FT_UShort)args[0];
- if ( BOUNDS( L, CUR.zp2.n_points ) )
+ if ( BOUNDS( L, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- K = CUR_fast_project( &CUR.zp2.cur[L] );
+ K = FAST_PROJECT( &exc->zp2.cur[L] );
- CUR_Func_move( &CUR.zp2, L, args[1] - K );
+ exc->func_move( exc, &exc->zp2, L, args[1] - K );
/* UNDOCUMENTED! The MS rasterizer does that with */
/* twilight points (confirmed by Greg Hitchcock) */
- if ( CUR.GS.gep2 == 0 )
- CUR.zp2.org[L] = CUR.zp2.cur[L];
+ if ( exc->GS.gep2 == 0 )
+ exc->zp2.org[L] = exc->zp2.cur[L];
}
@@ -5348,7 +4857,8 @@
/* XXX: UNDOCUMENTED: `zp0 - zp1', and not `zp2 - zp1! */
/* */
static void
- Ins_MD( INS_ARG )
+ Ins_MD( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort K, L;
FT_F26Dot6 D;
@@ -5357,50 +4867,50 @@
K = (FT_UShort)args[1];
L = (FT_UShort)args[0];
- if ( BOUNDS( L, CUR.zp0.n_points ) ||
- BOUNDS( K, CUR.zp1.n_points ) )
+ if ( BOUNDS( L, exc->zp0.n_points ) ||
+ BOUNDS( K, exc->zp1.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
D = 0;
}
else
{
- if ( CUR.opcode & 1 )
- D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
+ if ( exc->opcode & 1 )
+ D = PROJECT( exc->zp0.cur + L, exc->zp1.cur + K );
else
{
/* XXX: UNDOCUMENTED: twilight zone special case */
- if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
+ if ( exc->GS.gep0 == 0 || exc->GS.gep1 == 0 )
{
- FT_Vector* vec1 = CUR.zp0.org + L;
- FT_Vector* vec2 = CUR.zp1.org + K;
+ FT_Vector* vec1 = exc->zp0.org + L;
+ FT_Vector* vec2 = exc->zp1.org + K;
- D = CUR_Func_dualproj( vec1, vec2 );
+ D = DUALPROJ( vec1, vec2 );
}
else
{
- FT_Vector* vec1 = CUR.zp0.orus + L;
- FT_Vector* vec2 = CUR.zp1.orus + K;
+ FT_Vector* vec1 = exc->zp0.orus + L;
+ FT_Vector* vec2 = exc->zp1.orus + K;
- if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
+ if ( exc->metrics.x_scale == exc->metrics.y_scale )
{
/* this should be faster */
- D = CUR_Func_dualproj( vec1, vec2 );
- D = FT_MulFix( D, CUR.metrics.x_scale );
+ D = DUALPROJ( vec1, vec2 );
+ D = FT_MulFix( D, exc->metrics.x_scale );
}
else
{
FT_Vector vec;
- vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );
- vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );
+ vec.x = FT_MulFix( vec1->x - vec2->x, exc->metrics.x_scale );
+ vec.y = FT_MulFix( vec1->y - vec2->y, exc->metrics.y_scale );
- D = CUR_fast_dualproj( &vec );
+ D = FAST_DUALPROJ( &vec );
}
}
}
@@ -5408,8 +4918,9 @@
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* Disable Type 2 Vacuform Rounds - e.g. Arial Narrow */
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode && FT_ABS( D ) == 64 )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ FT_ABS( D ) == 64 )
D += 1;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -5419,61 +4930,63 @@
/*************************************************************************/
/* */
- /* SDPVTL[a]: Set Dual PVector to Line */
+ /* SDPvTL[a]: Set Dual PVector to Line */
/* Opcode range: 0x86-0x87 */
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_SDPVTL( INS_ARG )
+ Ins_SDPVTL( TT_ExecContext exc,
+ FT_Long* args )
{
FT_Long A, B, C;
FT_UShort p1, p2; /* was FT_Int in pas type ERROR */
- FT_Int aOpc = CUR.opcode;
+
+ FT_Byte opcode = exc->opcode;
p1 = (FT_UShort)args[1];
p2 = (FT_UShort)args[0];
- if ( BOUNDS( p2, CUR.zp1.n_points ) ||
- BOUNDS( p1, CUR.zp2.n_points ) )
+ if ( BOUNDS( p2, exc->zp1.n_points ) ||
+ BOUNDS( p1, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
{
- FT_Vector* v1 = CUR.zp1.org + p2;
- FT_Vector* v2 = CUR.zp2.org + p1;
+ FT_Vector* v1 = exc->zp1.org + p2;
+ FT_Vector* v2 = exc->zp2.org + p1;
A = v1->x - v2->x;
B = v1->y - v2->y;
- /* If v1 == v2, SDPVTL behaves the same as */
+ /* If v1 == v2, SDPvTL behaves the same as */
/* SVTCA[X], respectively. */
/* */
/* Confirmed by Greg Hitchcock. */
if ( A == 0 && B == 0 )
{
- A = 0x4000;
- aOpc = 0;
+ A = 0x4000;
+ opcode = 0;
}
}
- if ( ( aOpc & 1 ) != 0 )
+ if ( ( opcode & 1 ) != 0 )
{
C = B; /* counter clockwise rotation */
B = A;
A = -C;
}
- NORMalize( A, B, &CUR.GS.dualVector );
+ Normalize( A, B, &exc->GS.dualVector );
{
- FT_Vector* v1 = CUR.zp1.cur + p2;
- FT_Vector* v2 = CUR.zp2.cur + p1;
+ FT_Vector* v1 = exc->zp1.cur + p2;
+ FT_Vector* v2 = exc->zp2.cur + p1;
A = v1->x - v2->x;
@@ -5481,23 +4994,21 @@
if ( A == 0 && B == 0 )
{
- A = 0x4000;
- aOpc = 0;
+ A = 0x4000;
+ opcode = 0;
}
}
- if ( ( aOpc & 1 ) != 0 )
+ if ( ( opcode & 1 ) != 0 )
{
C = B; /* counter clockwise rotation */
B = A;
A = -C;
}
- NORMalize( A, B, &CUR.GS.projVector );
-
+ Normalize( A, B, &exc->GS.projVector );
GUESS_VECTOR( freeVector );
-
- COMPUTE_Funcs();
+ Compute_Funcs( exc );
}
@@ -5508,25 +5019,26 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_SZP0( INS_ARG )
+ Ins_SZP0( TT_ExecContext exc,
+ FT_Long* args )
{
switch ( (FT_Int)args[0] )
{
case 0:
- CUR.zp0 = CUR.twilight;
+ exc->zp0 = exc->twilight;
break;
case 1:
- CUR.zp0 = CUR.pts;
+ exc->zp0 = exc->pts;
break;
default:
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- CUR.GS.gep0 = (FT_UShort)args[0];
+ exc->GS.gep0 = (FT_UShort)args[0];
}
@@ -5537,25 +5049,26 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_SZP1( INS_ARG )
+ Ins_SZP1( TT_ExecContext exc,
+ FT_Long* args )
{
switch ( (FT_Int)args[0] )
{
case 0:
- CUR.zp1 = CUR.twilight;
+ exc->zp1 = exc->twilight;
break;
case 1:
- CUR.zp1 = CUR.pts;
+ exc->zp1 = exc->pts;
break;
default:
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- CUR.GS.gep1 = (FT_UShort)args[0];
+ exc->GS.gep1 = (FT_UShort)args[0];
}
@@ -5566,25 +5079,26 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_SZP2( INS_ARG )
+ Ins_SZP2( TT_ExecContext exc,
+ FT_Long* args )
{
switch ( (FT_Int)args[0] )
{
case 0:
- CUR.zp2 = CUR.twilight;
+ exc->zp2 = exc->twilight;
break;
case 1:
- CUR.zp2 = CUR.pts;
+ exc->zp2 = exc->pts;
break;
default:
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- CUR.GS.gep2 = (FT_UShort)args[0];
+ exc->GS.gep2 = (FT_UShort)args[0];
}
@@ -5595,30 +5109,31 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_SZPS( INS_ARG )
+ Ins_SZPS( TT_ExecContext exc,
+ FT_Long* args )
{
switch ( (FT_Int)args[0] )
{
case 0:
- CUR.zp0 = CUR.twilight;
+ exc->zp0 = exc->twilight;
break;
case 1:
- CUR.zp0 = CUR.pts;
+ exc->zp0 = exc->pts;
break;
default:
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- CUR.zp1 = CUR.zp0;
- CUR.zp2 = CUR.zp0;
+ exc->zp1 = exc->zp0;
+ exc->zp2 = exc->zp0;
- CUR.GS.gep0 = (FT_UShort)args[0];
- CUR.GS.gep1 = (FT_UShort)args[0];
- CUR.GS.gep2 = (FT_UShort)args[0];
+ exc->GS.gep0 = (FT_UShort)args[0];
+ exc->GS.gep1 = (FT_UShort)args[0];
+ exc->GS.gep2 = (FT_UShort)args[0];
}
@@ -5629,26 +5144,47 @@
/* Stack: int32 int32 --> */
/* */
static void
- Ins_INSTCTRL( INS_ARG )
+ Ins_INSTCTRL( TT_ExecContext exc,
+ FT_Long* args )
{
- FT_Long K, L;
+ FT_ULong K, L, Kf;
- K = args[1];
- L = args[0];
+ K = (FT_ULong)args[1];
+ L = (FT_ULong)args[0];
- if ( K < 1 || K > 2 )
+ /* selector values cannot be `OR'ed; */
+ /* they are indices starting with index 1, not flags */
+ if ( K < 1 || K > 3 )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
+ /* convert index to flag value */
+ Kf = 1 << ( K - 1 );
+
if ( L != 0 )
- L = K;
+ {
+ /* arguments to selectors look like flag values */
+ if ( L != Kf )
+ {
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
+ return;
+ }
+ }
+
+ exc->GS.instruct_control &= ~(FT_Byte)Kf;
+ exc->GS.instruct_control |= (FT_Byte)L;
- CUR.GS.instruct_control = FT_BOOL(
- ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L );
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+ /* INSTCTRL modifying flag 3 also has an effect */
+ /* outside of the CVT program */
+ if ( K == 3 )
+ exc->ignore_x_mode = FT_BOOL( L == 4 );
+#endif
}
@@ -5659,7 +5195,8 @@
/* Stack: uint32? --> */
/* */
static void
- Ins_SCANCTRL( INS_ARG )
+ Ins_SCANCTRL( TT_ExecContext exc,
+ FT_Long* args )
{
FT_Int A;
@@ -5669,32 +5206,32 @@
if ( A == 0xFF )
{
- CUR.GS.scan_control = TRUE;
+ exc->GS.scan_control = TRUE;
return;
}
else if ( A == 0 )
{
- CUR.GS.scan_control = FALSE;
+ exc->GS.scan_control = FALSE;
return;
}
- if ( ( args[0] & 0x100 ) != 0 && CUR.tt_metrics.ppem <= A )
- CUR.GS.scan_control = TRUE;
+ if ( ( args[0] & 0x100 ) != 0 && exc->tt_metrics.ppem <= A )
+ exc->GS.scan_control = TRUE;
- if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated )
- CUR.GS.scan_control = TRUE;
+ if ( ( args[0] & 0x200 ) != 0 && exc->tt_metrics.rotated )
+ exc->GS.scan_control = TRUE;
- if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched )
- CUR.GS.scan_control = TRUE;
+ if ( ( args[0] & 0x400 ) != 0 && exc->tt_metrics.stretched )
+ exc->GS.scan_control = TRUE;
- if ( ( args[0] & 0x800 ) != 0 && CUR.tt_metrics.ppem > A )
- CUR.GS.scan_control = FALSE;
+ if ( ( args[0] & 0x800 ) != 0 && exc->tt_metrics.ppem > A )
+ exc->GS.scan_control = FALSE;
- if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated )
- CUR.GS.scan_control = FALSE;
+ if ( ( args[0] & 0x1000 ) != 0 && exc->tt_metrics.rotated )
+ exc->GS.scan_control = FALSE;
- if ( ( args[0] & 0x2000 ) != 0 && CUR.tt_metrics.stretched )
- CUR.GS.scan_control = FALSE;
+ if ( ( args[0] & 0x2000 ) != 0 && exc->tt_metrics.stretched )
+ exc->GS.scan_control = FALSE;
}
@@ -5705,10 +5242,11 @@
/* Stack: uint32? --> */
/* */
static void
- Ins_SCANTYPE( INS_ARG )
+ Ins_SCANTYPE( TT_ExecContext exc,
+ FT_Long* args )
{
if ( args[0] >= 0 )
- CUR.GS.scan_type = (FT_Int)args[0];
+ exc->GS.scan_type = (FT_Int)args[0];
}
@@ -5716,8 +5254,6 @@
/* */
/* MANAGING OUTLINES */
/* */
- /* Instructions appear in the specification's order. */
- /* */
/*************************************************************************/
@@ -5728,43 +5264,41 @@
/* Stack: uint32... --> */
/* */
static void
- Ins_FLIPPT( INS_ARG )
+ Ins_FLIPPT( TT_ExecContext exc )
{
FT_UShort point;
- FT_UNUSED_ARG;
-
- if ( CUR.top < CUR.GS.loop )
+ if ( exc->top < exc->GS.loop )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Too_Few_Arguments );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
goto Fail;
}
- while ( CUR.GS.loop > 0 )
+ while ( exc->GS.loop > 0 )
{
- CUR.args--;
+ exc->args--;
- point = (FT_UShort)CUR.stack[CUR.args];
+ point = (FT_UShort)exc->stack[exc->args];
- if ( BOUNDS( point, CUR.pts.n_points ) )
+ if ( BOUNDS( point, exc->pts.n_points ) )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
}
else
- CUR.pts.tags[point] ^= FT_CURVE_TAG_ON;
+ exc->pts.tags[point] ^= FT_CURVE_TAG_ON;
- CUR.GS.loop--;
+ exc->GS.loop--;
}
Fail:
- CUR.GS.loop = 1;
- CUR.new_top = CUR.args;
+ exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -5775,7 +5309,8 @@
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_FLIPRGON( INS_ARG )
+ Ins_FLIPRGON( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort I, K, L;
@@ -5783,16 +5318,16 @@
K = (FT_UShort)args[1];
L = (FT_UShort)args[0];
- if ( BOUNDS( K, CUR.pts.n_points ) ||
- BOUNDS( L, CUR.pts.n_points ) )
+ if ( BOUNDS( K, exc->pts.n_points ) ||
+ BOUNDS( L, exc->pts.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
for ( I = L; I <= K; I++ )
- CUR.pts.tags[I] |= FT_CURVE_TAG_ON;
+ exc->pts.tags[I] |= FT_CURVE_TAG_ON;
}
@@ -5803,7 +5338,8 @@
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_FLIPRGOFF( INS_ARG )
+ Ins_FLIPRGOFF( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort I, K, L;
@@ -5811,45 +5347,46 @@
K = (FT_UShort)args[1];
L = (FT_UShort)args[0];
- if ( BOUNDS( K, CUR.pts.n_points ) ||
- BOUNDS( L, CUR.pts.n_points ) )
+ if ( BOUNDS( K, exc->pts.n_points ) ||
+ BOUNDS( L, exc->pts.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
for ( I = L; I <= K; I++ )
- CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON;
+ exc->pts.tags[I] &= ~FT_CURVE_TAG_ON;
}
static FT_Bool
- Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x,
- FT_F26Dot6* y,
- TT_GlyphZone zone,
- FT_UShort* refp )
+ Compute_Point_Displacement( TT_ExecContext exc,
+ FT_F26Dot6* x,
+ FT_F26Dot6* y,
+ TT_GlyphZone zone,
+ FT_UShort* refp )
{
TT_GlyphZoneRec zp;
FT_UShort p;
FT_F26Dot6 d;
- if ( CUR.opcode & 1 )
+ if ( exc->opcode & 1 )
{
- zp = CUR.zp0;
- p = CUR.GS.rp1;
+ zp = exc->zp0;
+ p = exc->GS.rp1;
}
else
{
- zp = CUR.zp1;
- p = CUR.GS.rp2;
+ zp = exc->zp1;
+ p = exc->GS.rp2;
}
if ( BOUNDS( p, zp.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
*refp = 0;
return FAILURE;
}
@@ -5857,12 +5394,12 @@
*zone = zp;
*refp = p;
- d = CUR_Func_project( zp.cur + p, zp.org + p );
+ d = PROJECT( zp.cur + p, zp.org + p );
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
- if ( CUR.GS.both_x_axis )
+ if ( exc->GS.both_x_axis )
{
*x = d;
*y = 0;
@@ -5876,8 +5413,8 @@
else
#endif
{
- *x = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.x, CUR.F_dot_P );
- *y = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.y, CUR.F_dot_P );
+ *x = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.x, exc->F_dot_P );
+ *y = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.y, exc->F_dot_P );
}
return SUCCESS;
@@ -5885,42 +5422,43 @@
static void
- Move_Zp2_Point( EXEC_OP_ FT_UShort point,
- FT_F26Dot6 dx,
- FT_F26Dot6 dy,
- FT_Bool touch )
+ Move_Zp2_Point( TT_ExecContext exc,
+ FT_UShort point,
+ FT_F26Dot6 dx,
+ FT_F26Dot6 dy,
+ FT_Bool touch )
{
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
- if ( CUR.GS.both_x_axis )
+ if ( exc->GS.both_x_axis )
{
- CUR.zp2.cur[point].x += dx;
+ exc->zp2.cur[point].x += dx;
if ( touch )
- CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
+ exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
}
else
{
- CUR.zp2.cur[point].y += dy;
+ exc->zp2.cur[point].y += dy;
if ( touch )
- CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
+ exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
}
return;
}
#endif
- if ( CUR.GS.freeVector.x != 0 )
+ if ( exc->GS.freeVector.x != 0 )
{
- CUR.zp2.cur[point].x += dx;
+ exc->zp2.cur[point].x += dx;
if ( touch )
- CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
+ exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
}
- if ( CUR.GS.freeVector.y != 0 )
+ if ( exc->GS.freeVector.y != 0 )
{
- CUR.zp2.cur[point].y += dy;
+ exc->zp2.cur[point].y += dy;
if ( touch )
- CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
+ exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
}
}
@@ -5932,57 +5470,54 @@
/* Stack: uint32... --> */
/* */
static void
- Ins_SHP( INS_ARG )
+ Ins_SHP( TT_ExecContext exc )
{
TT_GlyphZoneRec zp;
FT_UShort refp;
- FT_F26Dot6 dx,
- dy;
+ FT_F26Dot6 dx, dy;
FT_UShort point;
- FT_UNUSED_ARG;
-
- if ( CUR.top < CUR.GS.loop )
+ if ( exc->top < exc->GS.loop )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
- if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
+ if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
- while ( CUR.GS.loop > 0 )
+ while ( exc->GS.loop > 0 )
{
- CUR.args--;
- point = (FT_UShort)CUR.stack[CUR.args];
+ exc->args--;
+ point = (FT_UShort)exc->stack[exc->args];
- if ( BOUNDS( point, CUR.zp2.n_points ) )
+ if ( BOUNDS( point, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
}
else
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* doesn't follow Cleartype spec but produces better result */
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode )
- MOVE_Zp2_Point( point, 0, dy, TRUE );
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode )
+ Move_Zp2_Point( exc, point, 0, dy, TRUE );
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
- CUR.GS.loop--;
+ exc->GS.loop--;
}
Fail:
- CUR.GS.loop = 1;
- CUR.new_top = CUR.args;
+ exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -5997,7 +5532,8 @@
/* zero which includes all points of it. */
/* */
static void
- Ins_SHC( INS_ARG )
+ Ins_SHC( TT_ExecContext exc,
+ FT_Long* args )
{
TT_GlyphZoneRec zp;
FT_UShort refp;
@@ -6007,36 +5543,36 @@
FT_UShort start, limit, i;
- contour = (FT_UShort)args[0];
- bounds = ( CUR.GS.gep2 == 0 ) ? 1 : CUR.zp2.n_contours;
+ contour = (FT_Short)args[0];
+ bounds = ( exc->GS.gep2 == 0 ) ? 1 : exc->zp2.n_contours;
if ( BOUNDS( contour, bounds ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
+ if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
if ( contour == 0 )
start = 0;
else
- start = (FT_UShort)( CUR.zp2.contours[contour - 1] + 1 -
- CUR.zp2.first_point );
+ start = (FT_UShort)( exc->zp2.contours[contour - 1] + 1 -
+ exc->zp2.first_point );
/* we use the number of points if in the twilight zone */
- if ( CUR.GS.gep2 == 0 )
- limit = CUR.zp2.n_points;
+ if ( exc->GS.gep2 == 0 )
+ limit = exc->zp2.n_points;
else
- limit = (FT_UShort)( CUR.zp2.contours[contour] -
- CUR.zp2.first_point + 1 );
+ limit = (FT_UShort)( exc->zp2.contours[contour] -
+ exc->zp2.first_point + 1 );
for ( i = start; i < limit; i++ )
{
- if ( zp.cur != CUR.zp2.cur || refp != i )
- MOVE_Zp2_Point( i, dx, dy, TRUE );
+ if ( zp.cur != exc->zp2.cur || refp != i )
+ Move_Zp2_Point( exc, i, dx, dy, TRUE );
}
}
@@ -6048,7 +5584,8 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_SHZ( INS_ARG )
+ Ins_SHZ( TT_ExecContext exc,
+ FT_Long* args )
{
TT_GlyphZoneRec zp;
FT_UShort refp;
@@ -6060,30 +5597,30 @@
if ( BOUNDS( args[0], 2 ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
+ if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
/* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points. */
/* Twilight zone has no real contours, so use `n_points'. */
/* Normal zone's `n_points' includes phantoms, so must */
/* use end of last contour. */
- if ( CUR.GS.gep2 == 0 )
- limit = (FT_UShort)CUR.zp2.n_points;
- else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )
- limit = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] + 1 );
+ if ( exc->GS.gep2 == 0 )
+ limit = (FT_UShort)exc->zp2.n_points;
+ else if ( exc->GS.gep2 == 1 && exc->zp2.n_contours > 0 )
+ limit = (FT_UShort)( exc->zp2.contours[exc->zp2.n_contours - 1] + 1 );
else
limit = 0;
/* XXX: UNDOCUMENTED! SHZ doesn't touch the points */
for ( i = 0; i < limit; i++ )
{
- if ( zp.cur != CUR.zp2.cur || refp != i )
- MOVE_Zp2_Point( i, dx, dy, FALSE );
+ if ( zp.cur != exc->zp2.cur || refp != i )
+ Move_Zp2_Point( exc, i, dx, dy, FALSE );
}
}
@@ -6095,7 +5632,8 @@
/* Stack: f26.6 uint32... --> */
/* */
static void
- Ins_SHPIX( INS_ARG )
+ Ins_SHPIX( TT_ExecContext exc,
+ FT_Long* args )
{
FT_F26Dot6 dx, dy;
FT_UShort point;
@@ -6104,17 +5642,17 @@
#endif
- if ( CUR.top < CUR.GS.loop + 1 )
+ if ( exc->top < exc->GS.loop + 1 )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
- if ( CUR.GS.both_x_axis )
+ if ( exc->GS.both_x_axis )
{
dx = (FT_UInt32)args[0];
dy = 0;
@@ -6128,115 +5666,115 @@
else
#endif
{
- dx = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.x );
- dy = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.y );
+ dx = TT_MulFix14( args[0], exc->GS.freeVector.x );
+ dy = TT_MulFix14( args[0], exc->GS.freeVector.y );
}
- while ( CUR.GS.loop > 0 )
+ while ( exc->GS.loop > 0 )
{
- CUR.args--;
+ exc->args--;
- point = (FT_UShort)CUR.stack[CUR.args];
+ point = (FT_UShort)exc->stack[exc->args];
- if ( BOUNDS( point, CUR.zp2.n_points ) )
+ if ( BOUNDS( point, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
}
else
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
{
- /* If not using ignore_x_mode rendering, allow ZP2 move. */
- /* If inline deltas aren't allowed, skip ZP2 move. */
- /* If using ignore_x_mode rendering, allow ZP2 point move if: */
- /* - freedom vector is y and sph_compatibility_mode is off */
- /* - the glyph is composite and the move is in the Y direction */
- /* - the glyph is specifically set to allow SHPIX moves */
- /* - the move is on a previously Y-touched point */
-
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode )
+ /* If not using ignore_x_mode rendering, allow ZP2 move. */
+ /* If inline deltas aren't allowed, skip ZP2 move. */
+ /* If using ignore_x_mode rendering, allow ZP2 point move if: */
+ /* - freedom vector is y and sph_compatibility_mode is off */
+ /* - the glyph is composite and the move is in the Y direction */
+ /* - the glyph is specifically set to allow SHPIX moves */
+ /* - the move is on a previously Y-touched point */
+
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode )
{
/* save point for later comparison */
- if ( CUR.GS.freeVector.y != 0 )
- B1 = CUR.zp2.cur[point].y;
+ if ( exc->GS.freeVector.y != 0 )
+ B1 = exc->zp2.cur[point].y;
else
- B1 = CUR.zp2.cur[point].x;
+ B1 = exc->zp2.cur[point].x;
- if ( !CUR.face->sph_compatibility_mode &&
- CUR.GS.freeVector.y != 0 )
+ if ( !exc->face->sph_compatibility_mode &&
+ exc->GS.freeVector.y != 0 )
{
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
/* save new point */
- if ( CUR.GS.freeVector.y != 0 )
+ if ( exc->GS.freeVector.y != 0 )
{
- B2 = CUR.zp2.cur[point].y;
+ B2 = exc->zp2.cur[point].y;
/* reverse any disallowed moves */
- if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
- ( B1 & 63 ) != 0 &&
- ( B2 & 63 ) != 0 &&
- B1 != B2 )
- MOVE_Zp2_Point( point, -dx, -dy, TRUE );
+ if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
+ ( B1 & 63 ) != 0 &&
+ ( B2 & 63 ) != 0 &&
+ B1 != B2 )
+ Move_Zp2_Point( exc, point, -dx, -dy, TRUE );
}
}
- else if ( CUR.face->sph_compatibility_mode )
+ else if ( exc->face->sph_compatibility_mode )
{
- if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
+ if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
{
dx = FT_PIX_ROUND( B1 + dx ) - B1;
dy = FT_PIX_ROUND( B1 + dy ) - B1;
}
/* skip post-iup deltas */
- if ( CUR.iup_called &&
- ( ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) ||
- ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) )
+ if ( exc->iup_called &&
+ ( ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) ||
+ ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) )
goto Skip;
- if ( !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) &&
- ( ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) ||
- ( CUR.zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ||
- ( CUR.sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) )
- MOVE_Zp2_Point( point, 0, dy, TRUE );
+ if ( !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) &&
+ ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
+ ( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ||
+ ( exc->sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) )
+ Move_Zp2_Point( exc, point, 0, dy, TRUE );
/* save new point */
- if ( CUR.GS.freeVector.y != 0 )
+ if ( exc->GS.freeVector.y != 0 )
{
- B2 = CUR.zp2.cur[point].y;
+ B2 = exc->zp2.cur[point].y;
/* reverse any disallowed moves */
if ( ( B1 & 63 ) == 0 &&
( B2 & 63 ) != 0 &&
B1 != B2 )
- MOVE_Zp2_Point( point, 0, -dy, TRUE );
+ Move_Zp2_Point( exc, point, 0, -dy, TRUE );
}
}
- else if ( CUR.sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
}
else
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
}
Skip:
#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR.GS.loop--;
+ exc->GS.loop--;
}
Fail:
- CUR.GS.loop = 1;
- CUR.new_top = CUR.args;
+ exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -6247,7 +5785,8 @@
/* Stack: f26.6 uint32 --> */
/* */
static void
- Ins_MSIRP( INS_ARG )
+ Ins_MSIRP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort point;
FT_F26Dot6 distance;
@@ -6258,11 +5797,11 @@
if ( SUBPIXEL_HINTING )
{
- control_value_cutin = CUR.GS.control_value_cutin;
+ control_value_cutin = exc->GS.control_value_cutin;
- if ( CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 &&
- !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+ if ( exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 &&
+ !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = 0;
}
@@ -6270,42 +5809,41 @@
point = (FT_UShort)args[0];
- if ( BOUNDS( point, CUR.zp1.n_points ) ||
- BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
+ if ( BOUNDS( point, exc->zp1.n_points ) ||
+ BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
/* UNDOCUMENTED! The MS rasterizer does that with */
/* twilight points (confirmed by Greg Hitchcock) */
- if ( CUR.GS.gep1 == 0 )
+ if ( exc->GS.gep1 == 0 )
{
- CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0];
- CUR_Func_move_orig( &CUR.zp1, point, args[1] );
- CUR.zp1.cur[point] = CUR.zp1.org[point];
+ exc->zp1.org[point] = exc->zp0.org[exc->GS.rp0];
+ exc->func_move_orig( exc, &exc->zp1, point, args[1] );
+ exc->zp1.cur[point] = exc->zp1.org[point];
}
- distance = CUR_Func_project( CUR.zp1.cur + point,
- CUR.zp0.cur + CUR.GS.rp0 );
+ distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* subpixel hinting - make MSIRP respect CVT cut-in; */
if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 &&
FT_ABS( distance - args[1] ) >= control_value_cutin )
distance = args[1];
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR_Func_move( &CUR.zp1, point, args[1] - distance );
+ exc->func_move( exc, &exc->zp1, point, args[1] - distance );
- CUR.GS.rp1 = CUR.GS.rp0;
- CUR.GS.rp2 = point;
+ exc->GS.rp1 = exc->GS.rp0;
+ exc->GS.rp2 = point;
- if ( ( CUR.opcode & 1 ) != 0 )
- CUR.GS.rp0 = point;
+ if ( ( exc->opcode & 1 ) != 0 )
+ exc->GS.rp0 = point;
}
@@ -6316,7 +5854,8 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_MDAP( INS_ARG )
+ Ins_MDAP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort point;
FT_F26Dot6 cur_dist;
@@ -6325,36 +5864,38 @@
point = (FT_UShort)args[0];
- if ( BOUNDS( point, CUR.zp0.n_points ) )
+ if ( BOUNDS( point, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- if ( ( CUR.opcode & 1 ) != 0 )
+ if ( ( exc->opcode & 1 ) != 0 )
{
- cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
+ cur_dist = FAST_PROJECT( &exc->zp0.cur[point] );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 )
- distance = ROUND_None(
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 )
+ distance = Round_None(
+ exc,
cur_dist,
- CUR.tt_metrics.compensations[0] ) - cur_dist;
+ exc->tt_metrics.compensations[0] ) - cur_dist;
else
#endif
- distance = CUR_Func_round(
+ distance = exc->func_round(
+ exc,
cur_dist,
- CUR.tt_metrics.compensations[0] ) - cur_dist;
+ exc->tt_metrics.compensations[0] ) - cur_dist;
}
else
distance = 0;
- CUR_Func_move( &CUR.zp0, point, distance );
+ exc->func_move( exc, &exc->zp0, point, distance );
- CUR.GS.rp0 = point;
- CUR.GS.rp1 = point;
+ exc->GS.rp0 = point;
+ exc->GS.rp1 = point;
}
@@ -6365,7 +5906,8 @@
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_MIAP( INS_ARG )
+ Ins_MIAP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong cvtEntry;
FT_UShort point;
@@ -6374,24 +5916,24 @@
FT_F26Dot6 control_value_cutin;
- control_value_cutin = CUR.GS.control_value_cutin;
+ control_value_cutin = exc->GS.control_value_cutin;
cvtEntry = (FT_ULong)args[1];
point = (FT_UShort)args[0];
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 &&
- CUR.GS.freeVector.y == 0 &&
- !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 &&
+ exc->GS.freeVector.y == 0 &&
+ !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- if ( BOUNDS( point, CUR.zp0.n_points ) ||
- BOUNDSL( cvtEntry, CUR.cvtSize ) )
+ if ( BOUNDS( point, exc->zp0.n_points ) ||
+ BOUNDSL( cvtEntry, exc->cvtSize ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
@@ -6415,56 +5957,58 @@
/* */
/* Confirmed by Greg Hitchcock. */
- distance = CUR_Func_read_cvt( cvtEntry );
+ distance = exc->func_read_cvt( exc, cvtEntry );
- if ( CUR.GS.gep0 == 0 ) /* If in twilight zone */
+ if ( exc->GS.gep0 == 0 ) /* If in twilight zone */
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* Only adjust if not in sph_compatibility_mode or ignore_x_mode. */
/* Determined via experimentation and may be incorrect... */
- if ( !SUBPIXEL_HINTING ||
- ( !CUR.ignore_x_mode ||
- !CUR.face->sph_compatibility_mode ) )
+ if ( !SUBPIXEL_HINTING ||
+ ( !exc->ignore_x_mode ||
+ !exc->face->sph_compatibility_mode ) )
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance,
- CUR.GS.freeVector.x );
- CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance,
- CUR.GS.freeVector.y ),
- CUR.zp0.cur[point] = CUR.zp0.org[point];
+ exc->zp0.org[point].x = TT_MulFix14( distance,
+ exc->GS.freeVector.x );
+ exc->zp0.org[point].y = TT_MulFix14( distance,
+ exc->GS.freeVector.y ),
+ exc->zp0.cur[point] = exc->zp0.org[point];
}
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) &&
- distance > 0 &&
- CUR.GS.freeVector.y != 0 )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) &&
+ distance > 0 &&
+ exc->GS.freeVector.y != 0 )
distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- org_dist = CUR_fast_project( &CUR.zp0.cur[point] );
+ org_dist = FAST_PROJECT( &exc->zp0.cur[point] );
- if ( ( CUR.opcode & 1 ) != 0 ) /* rounding and control cut-in flag */
+ if ( ( exc->opcode & 1 ) != 0 ) /* rounding and control cut-in flag */
{
if ( FT_ABS( distance - org_dist ) > control_value_cutin )
distance = org_dist;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 )
- distance = ROUND_None( distance,
- CUR.tt_metrics.compensations[0] );
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 )
+ distance = Round_None( exc,
+ distance,
+ exc->tt_metrics.compensations[0] );
else
#endif
- distance = CUR_Func_round( distance,
- CUR.tt_metrics.compensations[0] );
+ distance = exc->func_round( exc,
+ distance,
+ exc->tt_metrics.compensations[0] );
}
- CUR_Func_move( &CUR.zp0, point, distance - org_dist );
+ exc->func_move( exc, &exc->zp0, point, distance - org_dist );
Fail:
- CUR.GS.rp0 = point;
- CUR.GS.rp1 = point;
+ exc->GS.rp0 = point;
+ exc->GS.rp1 = point;
}
@@ -6475,29 +6019,30 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_MDRP( INS_ARG )
+ Ins_MDRP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort point;
FT_F26Dot6 org_dist, distance, minimum_distance;
- minimum_distance = CUR.GS.minimum_distance;
+ minimum_distance = exc->GS.minimum_distance;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 &&
- !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 &&
+ !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
minimum_distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
point = (FT_UShort)args[0];
- if ( BOUNDS( point, CUR.zp1.n_points ) ||
- BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
+ if ( BOUNDS( point, exc->zp1.n_points ) ||
+ BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
@@ -6506,74 +6051,77 @@
/* XXX: UNDOCUMENTED: twilight zone special case */
- if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
+ if ( exc->GS.gep0 == 0 || exc->GS.gep1 == 0 )
{
- FT_Vector* vec1 = &CUR.zp1.org[point];
- FT_Vector* vec2 = &CUR.zp0.org[CUR.GS.rp0];
+ FT_Vector* vec1 = &exc->zp1.org[point];
+ FT_Vector* vec2 = &exc->zp0.org[exc->GS.rp0];
- org_dist = CUR_Func_dualproj( vec1, vec2 );
+ org_dist = DUALPROJ( vec1, vec2 );
}
else
{
- FT_Vector* vec1 = &CUR.zp1.orus[point];
- FT_Vector* vec2 = &CUR.zp0.orus[CUR.GS.rp0];
+ FT_Vector* vec1 = &exc->zp1.orus[point];
+ FT_Vector* vec2 = &exc->zp0.orus[exc->GS.rp0];
- if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
+ if ( exc->metrics.x_scale == exc->metrics.y_scale )
{
/* this should be faster */
- org_dist = CUR_Func_dualproj( vec1, vec2 );
- org_dist = FT_MulFix( org_dist, CUR.metrics.x_scale );
+ org_dist = DUALPROJ( vec1, vec2 );
+ org_dist = FT_MulFix( org_dist, exc->metrics.x_scale );
}
else
{
FT_Vector vec;
- vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );
- vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );
+ vec.x = FT_MulFix( vec1->x - vec2->x, exc->metrics.x_scale );
+ vec.y = FT_MulFix( vec1->y - vec2->y, exc->metrics.y_scale );
- org_dist = CUR_fast_dualproj( &vec );
+ org_dist = FAST_DUALPROJ( &vec );
}
}
/* single width cut-in test */
- if ( FT_ABS( org_dist - CUR.GS.single_width_value ) <
- CUR.GS.single_width_cutin )
+ if ( FT_ABS( org_dist - exc->GS.single_width_value ) <
+ exc->GS.single_width_cutin )
{
if ( org_dist >= 0 )
- org_dist = CUR.GS.single_width_value;
+ org_dist = exc->GS.single_width_value;
else
- org_dist = -CUR.GS.single_width_value;
+ org_dist = -exc->GS.single_width_value;
}
/* round flag */
- if ( ( CUR.opcode & 4 ) != 0 )
+ if ( ( exc->opcode & 4 ) != 0 )
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 )
- distance = ROUND_None(
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 )
+ distance = Round_None(
+ exc,
org_dist,
- CUR.tt_metrics.compensations[CUR.opcode & 3] );
+ exc->tt_metrics.compensations[exc->opcode & 3] );
else
#endif
- distance = CUR_Func_round(
- org_dist,
- CUR.tt_metrics.compensations[CUR.opcode & 3] );
+ distance = exc->func_round(
+ exc,
+ org_dist,
+ exc->tt_metrics.compensations[exc->opcode & 3] );
}
else
- distance = ROUND_None(
+ distance = Round_None(
+ exc,
org_dist,
- CUR.tt_metrics.compensations[CUR.opcode & 3] );
+ exc->tt_metrics.compensations[exc->opcode & 3] );
/* minimum distance flag */
- if ( ( CUR.opcode & 8 ) != 0 )
+ if ( ( exc->opcode & 8 ) != 0 )
{
if ( org_dist >= 0 )
{
@@ -6589,17 +6137,16 @@
/* now move the point */
- org_dist = CUR_Func_project( CUR.zp1.cur + point,
- CUR.zp0.cur + CUR.GS.rp0 );
+ org_dist = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
- CUR_Func_move( &CUR.zp1, point, distance - org_dist );
+ exc->func_move( exc, &exc->zp1, point, distance - org_dist );
Fail:
- CUR.GS.rp1 = CUR.GS.rp0;
- CUR.GS.rp2 = point;
+ exc->GS.rp1 = exc->GS.rp0;
+ exc->GS.rp2 = point;
- if ( ( CUR.opcode & 16 ) != 0 )
- CUR.GS.rp0 = point;
+ if ( ( exc->opcode & 16 ) != 0 )
+ exc->GS.rp0 = point;
}
@@ -6610,7 +6157,8 @@
/* Stack: int32? uint32 --> */
/* */
static void
- Ins_MIRP( INS_ARG )
+ Ins_MIRP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort point;
FT_ULong cvtEntry;
@@ -6628,77 +6176,75 @@
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- minimum_distance = CUR.GS.minimum_distance;
- control_value_cutin = CUR.GS.control_value_cutin;
+ minimum_distance = exc->GS.minimum_distance;
+ control_value_cutin = exc->GS.control_value_cutin;
point = (FT_UShort)args[0];
cvtEntry = (FT_ULong)( args[1] + 1 );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.x != 0 &&
- !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 &&
+ !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = minimum_distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
- if ( BOUNDS( point, CUR.zp1.n_points ) ||
- BOUNDSL( cvtEntry, CUR.cvtSize + 1 ) ||
- BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
+ if ( BOUNDS( point, exc->zp1.n_points ) ||
+ BOUNDSL( cvtEntry, exc->cvtSize + 1 ) ||
+ BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
if ( !cvtEntry )
cvt_dist = 0;
else
- cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 );
+ cvt_dist = exc->func_read_cvt( exc, cvtEntry - 1 );
/* single width test */
- if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) <
- CUR.GS.single_width_cutin )
+ if ( FT_ABS( cvt_dist - exc->GS.single_width_value ) <
+ exc->GS.single_width_cutin )
{
if ( cvt_dist >= 0 )
- cvt_dist = CUR.GS.single_width_value;
+ cvt_dist = exc->GS.single_width_value;
else
- cvt_dist = -CUR.GS.single_width_value;
+ cvt_dist = -exc->GS.single_width_value;
}
/* UNDOCUMENTED! The MS rasterizer does that with */
/* twilight points (confirmed by Greg Hitchcock) */
- if ( CUR.GS.gep1 == 0 )
+ if ( exc->GS.gep1 == 0 )
{
- CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +
- TT_MulFix14( (FT_UInt32)cvt_dist,
- CUR.GS.freeVector.x );
- CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +
- TT_MulFix14( (FT_UInt32)cvt_dist,
- CUR.GS.freeVector.y );
- CUR.zp1.cur[point] = CUR.zp1.org[point];
+ exc->zp1.org[point].x = exc->zp0.org[exc->GS.rp0].x +
+ TT_MulFix14( cvt_dist,
+ exc->GS.freeVector.x );
+ exc->zp1.org[point].y = exc->zp0.org[exc->GS.rp0].y +
+ TT_MulFix14( cvt_dist,
+ exc->GS.freeVector.y );
+ exc->zp1.cur[point] = exc->zp1.org[point];
}
- org_dist = CUR_Func_dualproj( &CUR.zp1.org[point],
- &CUR.zp0.org[CUR.GS.rp0] );
- cur_dist = CUR_Func_project ( &CUR.zp1.cur[point],
- &CUR.zp0.cur[CUR.GS.rp0] );
+ org_dist = DUALPROJ( &exc->zp1.org[point], &exc->zp0.org[exc->GS.rp0] );
+ cur_dist = PROJECT ( &exc->zp1.cur[point], &exc->zp0.cur[exc->GS.rp0] );
/* auto-flip test */
- if ( CUR.GS.auto_flip )
+ if ( exc->GS.auto_flip )
{
if ( ( org_dist ^ cvt_dist ) < 0 )
cvt_dist = -cvt_dist;
}
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.freeVector.y != 0 &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.y != 0 &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) )
{
if ( cur_dist < -64 )
cvt_dist -= 16;
@@ -6709,12 +6255,12 @@
/* control value cut-in and round */
- if ( ( CUR.opcode & 4 ) != 0 )
+ if ( ( exc->opcode & 4 ) != 0 )
{
/* XXX: UNDOCUMENTED! Only perform cut-in test when both points */
/* refer to the same zone. */
- if ( CUR.GS.gep0 == CUR.GS.gep1 )
+ if ( exc->GS.gep0 == exc->GS.gep1 )
{
/* XXX: According to Greg Hitchcock, the following wording is */
/* the right one: */
@@ -6732,32 +6278,34 @@
cvt_dist = org_dist;
}
- distance = CUR_Func_round(
+ distance = exc->func_round(
+ exc,
cvt_dist,
- CUR.tt_metrics.compensations[CUR.opcode & 3] );
+ exc->tt_metrics.compensations[exc->opcode & 3] );
}
else
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* do cvt cut-in always in MIRP for sph */
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.GS.gep0 == CUR.GS.gep1 )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->GS.gep0 == exc->GS.gep1 )
{
if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
cvt_dist = org_dist;
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- distance = ROUND_None(
+ distance = Round_None(
+ exc,
cvt_dist,
- CUR.tt_metrics.compensations[CUR.opcode & 3] );
+ exc->tt_metrics.compensations[exc->opcode & 3] );
}
/* minimum distance test */
- if ( ( CUR.opcode & 8 ) != 0 )
+ if ( ( exc->opcode & 8 ) != 0 )
{
if ( org_dist >= 0 )
{
@@ -6774,59 +6322,59 @@
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( SUBPIXEL_HINTING )
{
- B1 = CUR.zp1.cur[point].y;
+ B1 = exc->zp1.cur[point].y;
/* Round moves if necessary */
- if ( CUR.ignore_x_mode &&
- CUR.GS.freeVector.y != 0 &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) )
+ if ( exc->ignore_x_mode &&
+ exc->GS.freeVector.y != 0 &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) )
distance = FT_PIX_ROUND( B1 + distance - cur_dist ) - B1 + cur_dist;
- if ( CUR.ignore_x_mode &&
- CUR.GS.freeVector.y != 0 &&
- ( CUR.opcode & 16 ) == 0 &&
- ( CUR.opcode & 8 ) == 0 &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) )
+ if ( exc->ignore_x_mode &&
+ exc->GS.freeVector.y != 0 &&
+ ( exc->opcode & 16 ) == 0 &&
+ ( exc->opcode & 8 ) == 0 &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) )
distance += 64;
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR_Func_move( &CUR.zp1, point, distance - cur_dist );
+ exc->func_move( exc, &exc->zp1, point, distance - cur_dist );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( SUBPIXEL_HINTING )
{
- B2 = CUR.zp1.cur[point].y;
+ B2 = exc->zp1.cur[point].y;
/* Reverse move if necessary */
- if ( CUR.ignore_x_mode )
+ if ( exc->ignore_x_mode )
{
- if ( CUR.face->sph_compatibility_mode &&
- CUR.GS.freeVector.y != 0 &&
- ( B1 & 63 ) == 0 &&
- ( B2 & 63 ) != 0 )
+ if ( exc->face->sph_compatibility_mode &&
+ exc->GS.freeVector.y != 0 &&
+ ( B1 & 63 ) == 0 &&
+ ( B2 & 63 ) != 0 )
reverse_move = TRUE;
- if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
- CUR.GS.freeVector.y != 0 &&
- ( B2 & 63 ) != 0 &&
- ( B1 & 63 ) != 0 )
+ if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
+ exc->GS.freeVector.y != 0 &&
+ ( B2 & 63 ) != 0 &&
+ ( B1 & 63 ) != 0 )
reverse_move = TRUE;
}
if ( reverse_move )
- CUR_Func_move( &CUR.zp1, point, -( distance - cur_dist ) );
+ exc->func_move( exc, &exc->zp1, point, -( distance - cur_dist ) );
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
Fail:
- CUR.GS.rp1 = CUR.GS.rp0;
+ exc->GS.rp1 = exc->GS.rp0;
- if ( ( CUR.opcode & 16 ) != 0 )
- CUR.GS.rp0 = point;
+ if ( ( exc->opcode & 16 ) != 0 )
+ exc->GS.rp0 = point;
- CUR.GS.rp2 = point;
+ exc->GS.rp2 = point;
}
@@ -6837,61 +6385,59 @@
/* Stack: uint32 uint32... --> */
/* */
static void
- Ins_ALIGNRP( INS_ARG )
+ Ins_ALIGNRP( TT_ExecContext exc )
{
FT_UShort point;
FT_F26Dot6 distance;
- FT_UNUSED_ARG;
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.iup_called &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->iup_called &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- if ( CUR.top < CUR.GS.loop ||
- BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
+ if ( exc->top < exc->GS.loop ||
+ BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
- while ( CUR.GS.loop > 0 )
+ while ( exc->GS.loop > 0 )
{
- CUR.args--;
+ exc->args--;
- point = (FT_UShort)CUR.stack[CUR.args];
+ point = (FT_UShort)exc->stack[exc->args];
- if ( BOUNDS( point, CUR.zp1.n_points ) )
+ if ( BOUNDS( point, exc->zp1.n_points ) )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
}
else
{
- distance = CUR_Func_project( CUR.zp1.cur + point,
- CUR.zp0.cur + CUR.GS.rp0 );
+ distance = PROJECT( exc->zp1.cur + point,
+ exc->zp0.cur + exc->GS.rp0 );
- CUR_Func_move( &CUR.zp1, point, -distance );
+ exc->func_move( exc, &exc->zp1, point, -distance );
}
- CUR.GS.loop--;
+ exc->GS.loop--;
}
Fail:
- CUR.GS.loop = 1;
- CUR.new_top = CUR.args;
+ exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -6902,7 +6448,8 @@
/* Stack: 5 * uint32 --> */
/* */
static void
- Ins_ISECT( INS_ARG )
+ Ins_ISECT( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort point,
a0, a1,
@@ -6926,29 +6473,27 @@
b0 = (FT_UShort)args[3];
b1 = (FT_UShort)args[4];
- if ( BOUNDS( b0, CUR.zp0.n_points ) ||
- BOUNDS( b1, CUR.zp0.n_points ) ||
- BOUNDS( a0, CUR.zp1.n_points ) ||
- BOUNDS( a1, CUR.zp1.n_points ) ||
- BOUNDS( point, CUR.zp2.n_points ) )
+ if ( BOUNDS( b0, exc->zp0.n_points ) ||
+ BOUNDS( b1, exc->zp0.n_points ) ||
+ BOUNDS( a0, exc->zp1.n_points ) ||
+ BOUNDS( a1, exc->zp1.n_points ) ||
+ BOUNDS( point, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
/* Cramer's rule */
- dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x;
- dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y;
+ dbx = exc->zp0.cur[b1].x - exc->zp0.cur[b0].x;
+ dby = exc->zp0.cur[b1].y - exc->zp0.cur[b0].y;
- dax = CUR.zp1.cur[a1].x - CUR.zp1.cur[a0].x;
- day = CUR.zp1.cur[a1].y - CUR.zp1.cur[a0].y;
+ dax = exc->zp1.cur[a1].x - exc->zp1.cur[a0].x;
+ day = exc->zp1.cur[a1].y - exc->zp1.cur[a0].y;
- dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x;
- dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y;
-
- CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;
+ dx = exc->zp0.cur[b0].x - exc->zp1.cur[a0].x;
+ dy = exc->zp0.cur[b0].y - exc->zp1.cur[a0].y;
discriminant = FT_MulDiv( dax, -dby, 0x40 ) +
FT_MulDiv( day, dbx, 0x40 );
@@ -6970,22 +6515,24 @@
R.x = FT_MulDiv( val, dax, discriminant );
R.y = FT_MulDiv( val, day, discriminant );
- CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x;
- CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y;
+ exc->zp2.cur[point].x = exc->zp1.cur[a0].x + R.x;
+ exc->zp2.cur[point].y = exc->zp1.cur[a0].y + R.y;
}
else
{
/* else, take the middle of the middles of A and B */
- CUR.zp2.cur[point].x = ( CUR.zp1.cur[a0].x +
- CUR.zp1.cur[a1].x +
- CUR.zp0.cur[b0].x +
- CUR.zp0.cur[b1].x ) / 4;
- CUR.zp2.cur[point].y = ( CUR.zp1.cur[a0].y +
- CUR.zp1.cur[a1].y +
- CUR.zp0.cur[b0].y +
- CUR.zp0.cur[b1].y ) / 4;
+ exc->zp2.cur[point].x = ( exc->zp1.cur[a0].x +
+ exc->zp1.cur[a1].x +
+ exc->zp0.cur[b0].x +
+ exc->zp0.cur[b1].x ) / 4;
+ exc->zp2.cur[point].y = ( exc->zp1.cur[a0].y +
+ exc->zp1.cur[a1].y +
+ exc->zp0.cur[b0].y +
+ exc->zp0.cur[b1].y ) / 4;
}
+
+ exc->zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;
}
@@ -6996,7 +6543,8 @@
/* Stack: uint32 uint32 --> */
/* */
static void
- Ins_ALIGNPTS( INS_ARG )
+ Ins_ALIGNPTS( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort p1, p2;
FT_F26Dot6 distance;
@@ -7005,19 +6553,18 @@
p1 = (FT_UShort)args[0];
p2 = (FT_UShort)args[1];
- if ( BOUNDS( p1, CUR.zp1.n_points ) ||
- BOUNDS( p2, CUR.zp0.n_points ) )
+ if ( BOUNDS( p1, exc->zp1.n_points ) ||
+ BOUNDS( p2, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
- distance = CUR_Func_project( CUR.zp0.cur + p2,
- CUR.zp1.cur + p1 ) / 2;
+ distance = PROJECT( exc->zp0.cur + p2, exc->zp1.cur + p1 ) / 2;
- CUR_Func_move( &CUR.zp1, p1, distance );
- CUR_Func_move( &CUR.zp0, p2, -distance );
+ exc->func_move( exc, &exc->zp1, p1, distance );
+ exc->func_move( exc, &exc->zp0, p2, -distance );
}
@@ -7031,50 +6578,48 @@
/* SOMETIMES, DUMBER CODE IS BETTER CODE */
static void
- Ins_IP( INS_ARG )
+ Ins_IP( TT_ExecContext exc )
{
FT_F26Dot6 old_range, cur_range;
FT_Vector* orus_base;
FT_Vector* cur_base;
FT_Int twilight;
- FT_UNUSED_ARG;
-
- if ( CUR.top < CUR.GS.loop )
+ if ( exc->top < exc->GS.loop )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
/*
* We need to deal in a special way with the twilight zone.
- * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0),
+ * Otherwise, by definition, the value of exc->twilight.orus[n] is (0,0),
* for every n.
*/
- twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0;
+ twilight = exc->GS.gep0 == 0 || exc->GS.gep1 == 0 || exc->GS.gep2 == 0;
- if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )
+ if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
if ( twilight )
- orus_base = &CUR.zp0.org[CUR.GS.rp1];
+ orus_base = &exc->zp0.org[exc->GS.rp1];
else
- orus_base = &CUR.zp0.orus[CUR.GS.rp1];
+ orus_base = &exc->zp0.orus[exc->GS.rp1];
- cur_base = &CUR.zp0.cur[CUR.GS.rp1];
+ cur_base = &exc->zp0.cur[exc->GS.rp1];
/* XXX: There are some glyphs in some braindead but popular */
/* fonts out there (e.g. [aeu]grave in monotype.ttf) */
/* calling IP[] with bad values of rp[12]. */
/* Do something sane when this odd thing happens. */
- if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ||
- BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) )
+ if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) ||
+ BOUNDS( exc->GS.rp2, exc->zp1.n_points ) )
{
old_range = 0;
cur_range = 0;
@@ -7082,62 +6627,60 @@
else
{
if ( twilight )
- old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2],
- orus_base );
- else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
- old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2],
- orus_base );
+ old_range = DUALPROJ( &exc->zp1.org[exc->GS.rp2], orus_base );
+ else if ( exc->metrics.x_scale == exc->metrics.y_scale )
+ old_range = DUALPROJ( &exc->zp1.orus[exc->GS.rp2], orus_base );
else
{
FT_Vector vec;
- vec.x = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].x - orus_base->x,
- CUR.metrics.x_scale );
- vec.y = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].y - orus_base->y,
- CUR.metrics.y_scale );
+ vec.x = FT_MulFix( exc->zp1.orus[exc->GS.rp2].x - orus_base->x,
+ exc->metrics.x_scale );
+ vec.y = FT_MulFix( exc->zp1.orus[exc->GS.rp2].y - orus_base->y,
+ exc->metrics.y_scale );
- old_range = CUR_fast_dualproj( &vec );
+ old_range = FAST_DUALPROJ( &vec );
}
- cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base );
+ cur_range = PROJECT( &exc->zp1.cur[exc->GS.rp2], cur_base );
}
- for ( ; CUR.GS.loop > 0; --CUR.GS.loop )
+ for ( ; exc->GS.loop > 0; --exc->GS.loop )
{
- FT_UInt point = (FT_UInt)CUR.stack[--CUR.args];
+ FT_UInt point = (FT_UInt)exc->stack[--exc->args];
FT_F26Dot6 org_dist, cur_dist, new_dist;
/* check point bounds */
- if ( BOUNDS( point, CUR.zp2.n_points ) )
+ if ( BOUNDS( point, exc->zp2.n_points ) )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
continue;
}
if ( twilight )
- org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base );
- else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
- org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
+ org_dist = DUALPROJ( &exc->zp2.org[point], orus_base );
+ else if ( exc->metrics.x_scale == exc->metrics.y_scale )
+ org_dist = DUALPROJ( &exc->zp2.orus[point], orus_base );
else
{
FT_Vector vec;
- vec.x = FT_MulFix( CUR.zp2.orus[point].x - orus_base->x,
- CUR.metrics.x_scale );
- vec.y = FT_MulFix( CUR.zp2.orus[point].y - orus_base->y,
- CUR.metrics.y_scale );
+ vec.x = FT_MulFix( exc->zp2.orus[point].x - orus_base->x,
+ exc->metrics.x_scale );
+ vec.y = FT_MulFix( exc->zp2.orus[point].y - orus_base->y,
+ exc->metrics.y_scale );
- org_dist = CUR_fast_dualproj( &vec );
+ org_dist = FAST_DUALPROJ( &vec );
}
- cur_dist = CUR_Func_project( &CUR.zp2.cur[point], cur_base );
+ cur_dist = PROJECT( &exc->zp2.cur[point], cur_base );
if ( org_dist )
{
@@ -7167,12 +6710,15 @@
else
new_dist = 0;
- CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
+ exc->func_move( exc,
+ &exc->zp2,
+ (FT_UShort)point,
+ new_dist - cur_dist );
}
Fail:
- CUR.GS.loop = 1;
- CUR.new_top = CUR.args;
+ exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -7183,7 +6729,8 @@
/* Stack: uint32 --> */
/* */
static void
- Ins_UTP( INS_ARG )
+ Ins_UTP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_UShort point;
FT_Byte mask;
@@ -7191,22 +6738,22 @@
point = (FT_UShort)args[0];
- if ( BOUNDS( point, CUR.zp0.n_points ) )
+ if ( BOUNDS( point, exc->zp0.n_points ) )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
mask = 0xFF;
- if ( CUR.GS.freeVector.x != 0 )
+ if ( exc->GS.freeVector.x != 0 )
mask &= ~FT_CURVE_TAG_TOUCH_X;
- if ( CUR.GS.freeVector.y != 0 )
+ if ( exc->GS.freeVector.y != 0 )
mask &= ~FT_CURVE_TAG_TOUCH_Y;
- CUR.zp0.tags[point] &= mask;
+ exc->zp0.tags[point] &= mask;
}
@@ -7251,7 +6798,7 @@
FT_UInt ref2 )
{
FT_UInt i;
- FT_F26Dot6 orus1, orus2, org1, org2, delta1, delta2;
+ FT_F26Dot6 orus1, orus2, org1, org2, cur1, cur2, delta1, delta2;
if ( p1 > p2 )
@@ -7281,12 +6828,15 @@
org1 = worker->orgs[ref1].x;
org2 = worker->orgs[ref2].x;
- delta1 = worker->curs[ref1].x - org1;
- delta2 = worker->curs[ref2].x - org2;
+ cur1 = worker->curs[ref1].x;
+ cur2 = worker->curs[ref2].x;
+ delta1 = cur1 - org1;
+ delta2 = cur2 - org2;
- if ( orus1 == orus2 )
+ if ( cur1 == cur2 || orus1 == orus2 )
{
- /* simple shift of untouched points */
+
+ /* trivial snap or shift of untouched points */
for ( i = p1; i <= p2; i++ )
{
FT_F26Dot6 x = worker->orgs[i].x;
@@ -7294,9 +6844,13 @@
if ( x <= org1 )
x += delta1;
- else
+
+ else if ( x >= org2 )
x += delta2;
+ else
+ x = cur1;
+
worker->curs[i].x = x;
}
}
@@ -7323,12 +6877,10 @@
if ( !scale_valid )
{
scale_valid = 1;
- scale = FT_DivFix( org2 + delta2 - ( org1 + delta1 ),
- orus2 - orus1 );
+ scale = FT_DivFix( cur2 - cur1, orus2 - orus1 );
}
- x = ( org1 + delta1 ) +
- FT_MulFix( worker->orus[i].x - orus1, scale );
+ x = cur1 + FT_MulFix( worker->orus[i].x - orus1, scale );
}
worker->curs[i].x = x;
}
@@ -7343,7 +6895,7 @@
/* Stack: --> */
/* */
static void
- Ins_IUP( INS_ARG )
+ Ins_IUP( TT_ExecContext exc )
{
IUP_WorkerRec V;
FT_Byte mask;
@@ -7357,51 +6909,49 @@
FT_UInt point; /* current point */
FT_Short contour; /* current contour */
- FT_UNUSED_ARG;
-
/* ignore empty outlines */
- if ( CUR.pts.n_contours == 0 )
+ if ( exc->pts.n_contours == 0 )
return;
- if ( CUR.opcode & 1 )
+ if ( exc->opcode & 1 )
{
mask = FT_CURVE_TAG_TOUCH_X;
- V.orgs = CUR.pts.org;
- V.curs = CUR.pts.cur;
- V.orus = CUR.pts.orus;
+ V.orgs = exc->pts.org;
+ V.curs = exc->pts.cur;
+ V.orus = exc->pts.orus;
}
else
{
mask = FT_CURVE_TAG_TOUCH_Y;
- V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 );
- V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 );
- V.orus = (FT_Vector*)( (FT_Pos*)CUR.pts.orus + 1 );
+ V.orgs = (FT_Vector*)( (FT_Pos*)exc->pts.org + 1 );
+ V.curs = (FT_Vector*)( (FT_Pos*)exc->pts.cur + 1 );
+ V.orus = (FT_Vector*)( (FT_Pos*)exc->pts.orus + 1 );
}
- V.max_points = CUR.pts.n_points;
+ V.max_points = exc->pts.n_points;
contour = 0;
point = 0;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode )
{
- CUR.iup_called = TRUE;
- if ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_IUP )
+ exc->iup_called = TRUE;
+ if ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_IUP )
return;
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
do
{
- end_point = CUR.pts.contours[contour] - CUR.pts.first_point;
+ end_point = exc->pts.contours[contour] - exc->pts.first_point;
first_point = point;
- if ( BOUNDS ( end_point, CUR.pts.n_points ) )
- end_point = CUR.pts.n_points - 1;
+ if ( BOUNDS( end_point, exc->pts.n_points ) )
+ end_point = exc->pts.n_points - 1;
- while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 )
+ while ( point <= end_point && ( exc->pts.tags[point] & mask ) == 0 )
point++;
if ( point <= end_point )
@@ -7413,7 +6963,7 @@
while ( point <= end_point )
{
- if ( ( CUR.pts.tags[point] & mask ) != 0 )
+ if ( ( exc->pts.tags[point] & mask ) != 0 )
{
_iup_worker_interpolate( &V,
cur_touched + 1,
@@ -7445,7 +6995,7 @@
}
}
contour++;
- } while ( contour < CUR.pts.n_contours );
+ } while ( contour < exc->pts.n_contours );
}
@@ -7456,7 +7006,8 @@
/* Stack: uint32 (2 * uint32)... --> */
/* */
static void
- Ins_DELTAP( INS_ARG )
+ Ins_DELTAP( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong nump, k;
FT_UShort A;
@@ -7466,52 +7017,52 @@
FT_UShort B1, B2;
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.iup_called &&
- ( CUR.sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) )
+ if ( SUBPIXEL_HINTING &&
+ exc->ignore_x_mode &&
+ exc->iup_called &&
+ ( exc->sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) )
goto Fail;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Delta hinting is covered by US Patent 5159668. */
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
FT_Long n = args[0] * 2;
- if ( CUR.args < n )
+ if ( exc->args < n )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Too_Few_Arguments );
- n = CUR.args;
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
+ n = exc->args;
}
- CUR.args -= n;
- CUR.new_top = CUR.args;
+ exc->args -= n;
+ exc->new_top = exc->args;
return;
}
#endif
- P = (FT_ULong)CUR_Func_cur_ppem();
+ P = (FT_ULong)exc->func_cur_ppem( exc );
nump = (FT_ULong)args[0]; /* some points theoretically may occur more
than once, thus UShort isn't enough */
for ( k = 1; k <= nump; k++ )
{
- if ( CUR.args < 2 )
+ if ( exc->args < 2 )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Too_Few_Arguments );
- CUR.args = 0;
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
+ exc->args = 0;
goto Fail;
}
- CUR.args -= 2;
+ exc->args -= 2;
- A = (FT_UShort)CUR.stack[CUR.args + 1];
- B = CUR.stack[CUR.args];
+ A = (FT_UShort)exc->stack[exc->args + 1];
+ B = exc->stack[exc->args];
/* XXX: Because some popular fonts contain some invalid DeltaP */
/* instructions, we simply ignore them when the stacked */
@@ -7519,11 +7070,11 @@
/* error. As a delta instruction doesn't change a glyph */
/* in great ways, this shouldn't be a problem. */
- if ( !BOUNDS( A, CUR.zp0.n_points ) )
+ if ( !BOUNDS( A, exc->zp0.n_points ) )
{
C = ( (FT_ULong)B & 0xF0 ) >> 4;
- switch ( CUR.opcode )
+ switch ( exc->opcode )
{
case 0x5D:
break;
@@ -7537,14 +7088,14 @@
break;
}
- C += CUR.GS.delta_base;
+ C += exc->GS.delta_base;
if ( P == C )
{
B = ( (FT_ULong)B & 0xF ) - 8;
if ( B >= 0 )
B++;
- B *= 1L << ( 6 - CUR.GS.delta_shift );
+ B *= 1L << ( 6 - exc->GS.delta_shift );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
@@ -7558,65 +7109,65 @@
* - glyph is composite and freedom vector is not in subpixel
* direction.
*/
- if ( !CUR.ignore_x_mode ||
- ( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
- ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) )
- CUR_Func_move( &CUR.zp0, A, B );
+ if ( !exc->ignore_x_mode ||
+ ( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
+ ( exc->is_composite && exc->GS.freeVector.y != 0 ) )
+ exc->func_move( exc, &exc->zp0, A, B );
/* Otherwise, apply subpixel hinting and compatibility mode */
/* rules, always skipping deltas in subpixel direction. */
- else if ( CUR.ignore_x_mode && CUR.GS.freeVector.y != 0 )
+ else if ( exc->ignore_x_mode && exc->GS.freeVector.y != 0 )
{
/* save the y value of the point now; compare after move */
- B1 = (FT_UShort)CUR.zp0.cur[A].y;
+ B1 = (FT_UShort)exc->zp0.cur[A].y;
/* Standard subpixel hinting: Allow y move for y-touched */
/* points. This messes up DejaVu ... */
- if ( !CUR.face->sph_compatibility_mode &&
- ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
- CUR_Func_move( &CUR.zp0, A, B );
+ if ( !exc->face->sph_compatibility_mode &&
+ ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
+ exc->func_move( exc, &exc->zp0, A, B );
/* compatibility mode */
- else if ( CUR.face->sph_compatibility_mode &&
- !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )
+ else if ( exc->face->sph_compatibility_mode &&
+ !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )
{
- if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
+ if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
B = FT_PIX_ROUND( B1 + B ) - B1;
/* Allow delta move if using sph_compatibility_mode, */
/* IUP has not been called, and point is touched on Y. */
- if ( !CUR.iup_called &&
- ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
- CUR_Func_move( &CUR.zp0, A, B );
+ if ( !exc->iup_called &&
+ ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
+ exc->func_move( exc, &exc->zp0, A, B );
}
- B2 = (FT_UShort)CUR.zp0.cur[A].y;
+ B2 = (FT_UShort)exc->zp0.cur[A].y;
/* Reverse this move if it results in a disallowed move */
- if ( CUR.GS.freeVector.y != 0 &&
- ( ( CUR.face->sph_compatibility_mode &&
+ if ( exc->GS.freeVector.y != 0 &&
+ ( ( exc->face->sph_compatibility_mode &&
( B1 & 63 ) == 0 &&
( B2 & 63 ) != 0 ) ||
- ( ( CUR.sph_tweak_flags &
+ ( ( exc->sph_tweak_flags &
SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) &&
( B1 & 63 ) != 0 &&
( B2 & 63 ) != 0 ) ) )
- CUR_Func_move( &CUR.zp0, A, -B );
+ exc->func_move( exc, &exc->zp0, A, -B );
}
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR_Func_move( &CUR.zp0, A, B );
+ exc->func_move( exc, &exc->zp0, A, B );
}
}
else
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Invalid_Reference );
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
}
Fail:
- CUR.new_top = CUR.args;
+ exc->new_top = exc->args;
}
@@ -7627,7 +7178,8 @@
/* Stack: uint32 (2 * uint32)... --> */
/* */
static void
- Ins_DELTAC( INS_ARG )
+ Ins_DELTAC( TT_ExecContext exc,
+ FT_Long* args )
{
FT_ULong nump, k;
FT_ULong A, C, P;
@@ -7636,47 +7188,47 @@
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Delta hinting is covered by US Patent 5159668. */
- if ( CUR.face->unpatented_hinting )
+ if ( exc->face->unpatented_hinting )
{
FT_Long n = args[0] * 2;
- if ( CUR.args < n )
+ if ( exc->args < n )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Too_Few_Arguments );
- n = CUR.args;
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
+ n = exc->args;
}
- CUR.args -= n;
- CUR.new_top = CUR.args;
+ exc->args -= n;
+ exc->new_top = exc->args;
return;
}
#endif
- P = (FT_ULong)CUR_Func_cur_ppem();
+ P = (FT_ULong)exc->func_cur_ppem( exc );
nump = (FT_ULong)args[0];
for ( k = 1; k <= nump; k++ )
{
- if ( CUR.args < 2 )
+ if ( exc->args < 2 )
{
- if ( CUR.pedantic_hinting )
- CUR.error = FT_THROW( Too_Few_Arguments );
- CUR.args = 0;
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
+ exc->args = 0;
goto Fail;
}
- CUR.args -= 2;
+ exc->args -= 2;
- A = (FT_ULong)CUR.stack[CUR.args + 1];
- B = CUR.stack[CUR.args];
+ A = (FT_ULong)exc->stack[exc->args + 1];
+ B = exc->stack[exc->args];
- if ( BOUNDSL( A, CUR.cvtSize ) )
+ if ( BOUNDSL( A, exc->cvtSize ) )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
return;
}
}
@@ -7684,7 +7236,7 @@
{
C = ( (FT_ULong)B & 0xF0 ) >> 4;
- switch ( CUR.opcode )
+ switch ( exc->opcode )
{
case 0x73:
break;
@@ -7698,22 +7250,22 @@
break;
}
- C += CUR.GS.delta_base;
+ C += exc->GS.delta_base;
if ( P == C )
{
B = ( (FT_ULong)B & 0xF ) - 8;
if ( B >= 0 )
B++;
- B *= 1L << ( 6 - CUR.GS.delta_shift );
+ B *= 1L << ( 6 - exc->GS.delta_shift );
- CUR_Func_move_cvt( A, B );
+ exc->func_move_cvt( exc, A, B );
}
}
}
Fail:
- CUR.new_top = CUR.args;
+ exc->new_top = exc->args;
}
@@ -7730,8 +7282,17 @@
/* Opcode range: 0x88 */
/* Stack: uint32 --> uint32 */
/* */
+ /* XXX: UNDOCUMENTED: Selector bits higher than 9 are currently (May */
+ /* 2015) not documented in the OpenType specification. */
+ /* */
+ /* Selector bit 11 is incorrectly described as bit 8, while the */
+ /* real meaning of bit 8 (vertical LCD subpixels) stays */
+ /* undocumented. The same mistake can be found in Greg Hitchcock's */
+ /* whitepaper. */
+ /* */
static void
- Ins_GETINFO( INS_ARG )
+ Ins_GETINFO( TT_ExecContext exc,
+ FT_Long* args )
{
FT_Long K;
@@ -7744,13 +7305,20 @@
/* Selector Bit: 0 */
/* Return Bit(s): 0-7 */
/* */
- if ( SUBPIXEL_HINTING &&
- ( args[0] & 1 ) != 0 &&
- CUR.ignore_x_mode )
+ if ( SUBPIXEL_HINTING &&
+ ( args[0] & 1 ) != 0 &&
+ exc->subpixel_hinting )
{
- K = CUR.rasterizer_version;
- FT_TRACE7(( "Setting rasterizer version %d\n",
- CUR.rasterizer_version ));
+ if ( exc->ignore_x_mode )
+ {
+ /* if in ClearType backwards compatibility mode, */
+ /* we sometimes change the TrueType version dynamically */
+ K = exc->rasterizer_version;
+ FT_TRACE6(( "Setting rasterizer version %d\n",
+ exc->rasterizer_version ));
+ }
+ else
+ K = TT_INTERPRETER_VERSION_38;
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -7762,7 +7330,7 @@
/* Selector Bit: 1 */
/* Return Bit(s): 8 */
/* */
- if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )
+ if ( ( args[0] & 2 ) != 0 && exc->tt_metrics.rotated )
K |= 0x80;
/********************************/
@@ -7770,7 +7338,7 @@
/* Selector Bit: 2 */
/* Return Bit(s): 9 */
/* */
- if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )
+ if ( ( args[0] & 4 ) != 0 && exc->tt_metrics.stretched )
K |= 1 << 8;
/********************************/
@@ -7778,24 +7346,23 @@
/* Selector Bit: 5 */
/* Return Bit(s): 12 */
/* */
- if ( ( args[0] & 32 ) != 0 && CUR.grayscale )
+ if ( ( args[0] & 32 ) != 0 && exc->grayscale )
K |= 1 << 12;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( SUBPIXEL_HINTING &&
- CUR.ignore_x_mode &&
- CUR.rasterizer_version >= TT_INTERPRETER_VERSION_35 )
+ if ( SUBPIXEL_HINTING &&
+ exc->rasterizer_version >= TT_INTERPRETER_VERSION_35 )
{
- if ( CUR.rasterizer_version >= 37 )
+ if ( exc->rasterizer_version >= 37 )
{
/********************************/
/* HINTING FOR SUBPIXEL */
/* Selector Bit: 6 */
/* Return Bit(s): 13 */
/* */
- if ( ( args[0] & 64 ) != 0 && CUR.subpixel )
+ if ( ( args[0] & 64 ) != 0 && exc->subpixel_hinting )
K |= 1 << 13;
/********************************/
@@ -7804,16 +7371,16 @@
/* Return Bit(s): 14 */
/* */
/* Functionality still needs to be added */
- if ( ( args[0] & 128 ) != 0 && CUR.compatible_widths )
+ if ( ( args[0] & 128 ) != 0 && exc->compatible_widths )
K |= 1 << 14;
/********************************/
- /* SYMMETRICAL SMOOTHING */
+ /* VERTICAL LCD SUBPIXELS? */
/* Selector Bit: 8 */
/* Return Bit(s): 15 */
/* */
/* Functionality still needs to be added */
- if ( ( args[0] & 256 ) != 0 && CUR.symmetrical_smoothing )
+ if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd )
K |= 1 << 15;
/********************************/
@@ -7822,10 +7389,10 @@
/* Return Bit(s): 16 */
/* */
/* Functionality still needs to be added */
- if ( ( args[0] & 512 ) != 0 && CUR.bgr )
+ if ( ( args[0] & 512 ) != 0 && exc->bgr )
K |= 1 << 16;
- if ( CUR.rasterizer_version >= 38 )
+ if ( exc->rasterizer_version >= 38 )
{
/********************************/
/* SUBPIXEL POSITIONED? */
@@ -7833,8 +7400,26 @@
/* Return Bit(s): 17 */
/* */
/* Functionality still needs to be added */
- if ( ( args[0] & 1024 ) != 0 && CUR.subpixel_positioned )
+ if ( ( args[0] & 1024 ) != 0 && exc->subpixel_positioned )
K |= 1 << 17;
+
+ /********************************/
+ /* SYMMETRICAL SMOOTHING */
+ /* Selector Bit: 11 */
+ /* Return Bit(s): 18 */
+ /* */
+ /* Functionality still needs to be added */
+ if ( ( args[0] & 2048 ) != 0 && exc->symmetrical_smoothing )
+ K |= 1 << 18;
+
+ /********************************/
+ /* GRAY CLEARTYPE */
+ /* Selector Bit: 12 */
+ /* Return Bit(s): 19 */
+ /* */
+ /* Functionality still needs to be added */
+ if ( ( args[0] & 4096 ) != 0 && exc->gray_cleartype )
+ K |= 1 << 19;
}
}
}
@@ -7846,331 +7431,43 @@
static void
- Ins_UNKNOWN( INS_ARG )
+ Ins_UNKNOWN( TT_ExecContext exc )
{
- TT_DefRecord* def = CUR.IDefs;
- TT_DefRecord* limit = def + CUR.numIDefs;
-
- FT_UNUSED_ARG;
+ TT_DefRecord* def = exc->IDefs;
+ TT_DefRecord* limit = def + exc->numIDefs;
for ( ; def < limit; def++ )
{
- if ( (FT_Byte)def->opc == CUR.opcode && def->active )
+ if ( (FT_Byte)def->opc == exc->opcode && def->active )
{
TT_CallRec* call;
- if ( CUR.callTop >= CUR.callSize )
+ if ( exc->callTop >= exc->callSize )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
return;
}
- call = CUR.callStack + CUR.callTop++;
+ call = exc->callStack + exc->callTop++;
- call->Caller_Range = CUR.curRange;
- call->Caller_IP = CUR.IP + 1;
+ call->Caller_Range = exc->curRange;
+ call->Caller_IP = exc->IP + 1;
call->Cur_Count = 1;
call->Def = def;
- INS_Goto_CodeRange( def->range, def->start );
+ Ins_Goto_CodeRange( exc, def->range, def->start );
- CUR.step_ins = FALSE;
+ exc->step_ins = FALSE;
return;
}
}
- CUR.error = FT_THROW( Invalid_Opcode );
+ exc->error = FT_THROW( Invalid_Opcode );
}
-#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
-
- static
- TInstruction_Function Instruct_Dispatch[256] =
- {
- /* Opcodes are gathered in groups of 16. */
- /* Please keep the spaces as they are. */
-
- /* SVTCA y */ Ins_SVTCA,
- /* SVTCA x */ Ins_SVTCA,
- /* SPvTCA y */ Ins_SPVTCA,
- /* SPvTCA x */ Ins_SPVTCA,
- /* SFvTCA y */ Ins_SFVTCA,
- /* SFvTCA x */ Ins_SFVTCA,
- /* SPvTL // */ Ins_SPVTL,
- /* SPvTL + */ Ins_SPVTL,
- /* SFvTL // */ Ins_SFVTL,
- /* SFvTL + */ Ins_SFVTL,
- /* SPvFS */ Ins_SPVFS,
- /* SFvFS */ Ins_SFVFS,
- /* GPV */ Ins_GPV,
- /* GFV */ Ins_GFV,
- /* SFvTPv */ Ins_SFVTPV,
- /* ISECT */ Ins_ISECT,
-
- /* SRP0 */ Ins_SRP0,
- /* SRP1 */ Ins_SRP1,
- /* SRP2 */ Ins_SRP2,
- /* SZP0 */ Ins_SZP0,
- /* SZP1 */ Ins_SZP1,
- /* SZP2 */ Ins_SZP2,
- /* SZPS */ Ins_SZPS,
- /* SLOOP */ Ins_SLOOP,
- /* RTG */ Ins_RTG,
- /* RTHG */ Ins_RTHG,
- /* SMD */ Ins_SMD,
- /* ELSE */ Ins_ELSE,
- /* JMPR */ Ins_JMPR,
- /* SCvTCi */ Ins_SCVTCI,
- /* SSwCi */ Ins_SSWCI,
- /* SSW */ Ins_SSW,
-
- /* DUP */ Ins_DUP,
- /* POP */ Ins_POP,
- /* CLEAR */ Ins_CLEAR,
- /* SWAP */ Ins_SWAP,
- /* DEPTH */ Ins_DEPTH,
- /* CINDEX */ Ins_CINDEX,
- /* MINDEX */ Ins_MINDEX,
- /* AlignPTS */ Ins_ALIGNPTS,
- /* INS_0x28 */ Ins_UNKNOWN,
- /* UTP */ Ins_UTP,
- /* LOOPCALL */ Ins_LOOPCALL,
- /* CALL */ Ins_CALL,
- /* FDEF */ Ins_FDEF,
- /* ENDF */ Ins_ENDF,
- /* MDAP[0] */ Ins_MDAP,
- /* MDAP[1] */ Ins_MDAP,
-
- /* IUP[0] */ Ins_IUP,
- /* IUP[1] */ Ins_IUP,
- /* SHP[0] */ Ins_SHP,
- /* SHP[1] */ Ins_SHP,
- /* SHC[0] */ Ins_SHC,
- /* SHC[1] */ Ins_SHC,
- /* SHZ[0] */ Ins_SHZ,
- /* SHZ[1] */ Ins_SHZ,
- /* SHPIX */ Ins_SHPIX,
- /* IP */ Ins_IP,
- /* MSIRP[0] */ Ins_MSIRP,
- /* MSIRP[1] */ Ins_MSIRP,
- /* AlignRP */ Ins_ALIGNRP,
- /* RTDG */ Ins_RTDG,
- /* MIAP[0] */ Ins_MIAP,
- /* MIAP[1] */ Ins_MIAP,
-
- /* NPushB */ Ins_NPUSHB,
- /* NPushW */ Ins_NPUSHW,
- /* WS */ Ins_WS,
- /* RS */ Ins_RS,
- /* WCvtP */ Ins_WCVTP,
- /* RCvt */ Ins_RCVT,
- /* GC[0] */ Ins_GC,
- /* GC[1] */ Ins_GC,
- /* SCFS */ Ins_SCFS,
- /* MD[0] */ Ins_MD,
- /* MD[1] */ Ins_MD,
- /* MPPEM */ Ins_MPPEM,
- /* MPS */ Ins_MPS,
- /* FlipON */ Ins_FLIPON,
- /* FlipOFF */ Ins_FLIPOFF,
- /* DEBUG */ Ins_DEBUG,
-
- /* LT */ Ins_LT,
- /* LTEQ */ Ins_LTEQ,
- /* GT */ Ins_GT,
- /* GTEQ */ Ins_GTEQ,
- /* EQ */ Ins_EQ,
- /* NEQ */ Ins_NEQ,
- /* ODD */ Ins_ODD,
- /* EVEN */ Ins_EVEN,
- /* IF */ Ins_IF,
- /* EIF */ Ins_EIF,
- /* AND */ Ins_AND,
- /* OR */ Ins_OR,
- /* NOT */ Ins_NOT,
- /* DeltaP1 */ Ins_DELTAP,
- /* SDB */ Ins_SDB,
- /* SDS */ Ins_SDS,
-
- /* ADD */ Ins_ADD,
- /* SUB */ Ins_SUB,
- /* DIV */ Ins_DIV,
- /* MUL */ Ins_MUL,
- /* ABS */ Ins_ABS,
- /* NEG */ Ins_NEG,
- /* FLOOR */ Ins_FLOOR,
- /* CEILING */ Ins_CEILING,
- /* ROUND[0] */ Ins_ROUND,
- /* ROUND[1] */ Ins_ROUND,
- /* ROUND[2] */ Ins_ROUND,
- /* ROUND[3] */ Ins_ROUND,
- /* NROUND[0] */ Ins_NROUND,
- /* NROUND[1] */ Ins_NROUND,
- /* NROUND[2] */ Ins_NROUND,
- /* NROUND[3] */ Ins_NROUND,
-
- /* WCvtF */ Ins_WCVTF,
- /* DeltaP2 */ Ins_DELTAP,
- /* DeltaP3 */ Ins_DELTAP,
- /* DeltaCn[0] */ Ins_DELTAC,
- /* DeltaCn[1] */ Ins_DELTAC,
- /* DeltaCn[2] */ Ins_DELTAC,
- /* SROUND */ Ins_SROUND,
- /* S45Round */ Ins_S45ROUND,
- /* JROT */ Ins_JROT,
- /* JROF */ Ins_JROF,
- /* ROFF */ Ins_ROFF,
- /* INS_0x7B */ Ins_UNKNOWN,
- /* RUTG */ Ins_RUTG,
- /* RDTG */ Ins_RDTG,
- /* SANGW */ Ins_SANGW,
- /* AA */ Ins_AA,
-
- /* FlipPT */ Ins_FLIPPT,
- /* FlipRgON */ Ins_FLIPRGON,
- /* FlipRgOFF */ Ins_FLIPRGOFF,
- /* INS_0x83 */ Ins_UNKNOWN,
- /* INS_0x84 */ Ins_UNKNOWN,
- /* ScanCTRL */ Ins_SCANCTRL,
- /* SDPVTL[0] */ Ins_SDPVTL,
- /* SDPVTL[1] */ Ins_SDPVTL,
- /* GetINFO */ Ins_GETINFO,
- /* IDEF */ Ins_IDEF,
- /* ROLL */ Ins_ROLL,
- /* MAX */ Ins_MAX,
- /* MIN */ Ins_MIN,
- /* ScanTYPE */ Ins_SCANTYPE,
- /* InstCTRL */ Ins_INSTCTRL,
- /* INS_0x8F */ Ins_UNKNOWN,
-
- /* INS_0x90 */ Ins_UNKNOWN,
- /* INS_0x91 */ Ins_UNKNOWN,
- /* INS_0x92 */ Ins_UNKNOWN,
- /* INS_0x93 */ Ins_UNKNOWN,
- /* INS_0x94 */ Ins_UNKNOWN,
- /* INS_0x95 */ Ins_UNKNOWN,
- /* INS_0x96 */ Ins_UNKNOWN,
- /* INS_0x97 */ Ins_UNKNOWN,
- /* INS_0x98 */ Ins_UNKNOWN,
- /* INS_0x99 */ Ins_UNKNOWN,
- /* INS_0x9A */ Ins_UNKNOWN,
- /* INS_0x9B */ Ins_UNKNOWN,
- /* INS_0x9C */ Ins_UNKNOWN,
- /* INS_0x9D */ Ins_UNKNOWN,
- /* INS_0x9E */ Ins_UNKNOWN,
- /* INS_0x9F */ Ins_UNKNOWN,
-
- /* INS_0xA0 */ Ins_UNKNOWN,
- /* INS_0xA1 */ Ins_UNKNOWN,
- /* INS_0xA2 */ Ins_UNKNOWN,
- /* INS_0xA3 */ Ins_UNKNOWN,
- /* INS_0xA4 */ Ins_UNKNOWN,
- /* INS_0xA5 */ Ins_UNKNOWN,
- /* INS_0xA6 */ Ins_UNKNOWN,
- /* INS_0xA7 */ Ins_UNKNOWN,
- /* INS_0xA8 */ Ins_UNKNOWN,
- /* INS_0xA9 */ Ins_UNKNOWN,
- /* INS_0xAA */ Ins_UNKNOWN,
- /* INS_0xAB */ Ins_UNKNOWN,
- /* INS_0xAC */ Ins_UNKNOWN,
- /* INS_0xAD */ Ins_UNKNOWN,
- /* INS_0xAE */ Ins_UNKNOWN,
- /* INS_0xAF */ Ins_UNKNOWN,
-
- /* PushB[0] */ Ins_PUSHB,
- /* PushB[1] */ Ins_PUSHB,
- /* PushB[2] */ Ins_PUSHB,
- /* PushB[3] */ Ins_PUSHB,
- /* PushB[4] */ Ins_PUSHB,
- /* PushB[5] */ Ins_PUSHB,
- /* PushB[6] */ Ins_PUSHB,
- /* PushB[7] */ Ins_PUSHB,
- /* PushW[0] */ Ins_PUSHW,
- /* PushW[1] */ Ins_PUSHW,
- /* PushW[2] */ Ins_PUSHW,
- /* PushW[3] */ Ins_PUSHW,
- /* PushW[4] */ Ins_PUSHW,
- /* PushW[5] */ Ins_PUSHW,
- /* PushW[6] */ Ins_PUSHW,
- /* PushW[7] */ Ins_PUSHW,
-
- /* MDRP[00] */ Ins_MDRP,
- /* MDRP[01] */ Ins_MDRP,
- /* MDRP[02] */ Ins_MDRP,
- /* MDRP[03] */ Ins_MDRP,
- /* MDRP[04] */ Ins_MDRP,
- /* MDRP[05] */ Ins_MDRP,
- /* MDRP[06] */ Ins_MDRP,
- /* MDRP[07] */ Ins_MDRP,
- /* MDRP[08] */ Ins_MDRP,
- /* MDRP[09] */ Ins_MDRP,
- /* MDRP[10] */ Ins_MDRP,
- /* MDRP[11] */ Ins_MDRP,
- /* MDRP[12] */ Ins_MDRP,
- /* MDRP[13] */ Ins_MDRP,
- /* MDRP[14] */ Ins_MDRP,
- /* MDRP[15] */ Ins_MDRP,
-
- /* MDRP[16] */ Ins_MDRP,
- /* MDRP[17] */ Ins_MDRP,
- /* MDRP[18] */ Ins_MDRP,
- /* MDRP[19] */ Ins_MDRP,
- /* MDRP[20] */ Ins_MDRP,
- /* MDRP[21] */ Ins_MDRP,
- /* MDRP[22] */ Ins_MDRP,
- /* MDRP[23] */ Ins_MDRP,
- /* MDRP[24] */ Ins_MDRP,
- /* MDRP[25] */ Ins_MDRP,
- /* MDRP[26] */ Ins_MDRP,
- /* MDRP[27] */ Ins_MDRP,
- /* MDRP[28] */ Ins_MDRP,
- /* MDRP[29] */ Ins_MDRP,
- /* MDRP[30] */ Ins_MDRP,
- /* MDRP[31] */ Ins_MDRP,
-
- /* MIRP[00] */ Ins_MIRP,
- /* MIRP[01] */ Ins_MIRP,
- /* MIRP[02] */ Ins_MIRP,
- /* MIRP[03] */ Ins_MIRP,
- /* MIRP[04] */ Ins_MIRP,
- /* MIRP[05] */ Ins_MIRP,
- /* MIRP[06] */ Ins_MIRP,
- /* MIRP[07] */ Ins_MIRP,
- /* MIRP[08] */ Ins_MIRP,
- /* MIRP[09] */ Ins_MIRP,
- /* MIRP[10] */ Ins_MIRP,
- /* MIRP[11] */ Ins_MIRP,
- /* MIRP[12] */ Ins_MIRP,
- /* MIRP[13] */ Ins_MIRP,
- /* MIRP[14] */ Ins_MIRP,
- /* MIRP[15] */ Ins_MIRP,
-
- /* MIRP[16] */ Ins_MIRP,
- /* MIRP[17] */ Ins_MIRP,
- /* MIRP[18] */ Ins_MIRP,
- /* MIRP[19] */ Ins_MIRP,
- /* MIRP[20] */ Ins_MIRP,
- /* MIRP[21] */ Ins_MIRP,
- /* MIRP[22] */ Ins_MIRP,
- /* MIRP[23] */ Ins_MIRP,
- /* MIRP[24] */ Ins_MIRP,
- /* MIRP[25] */ Ins_MIRP,
- /* MIRP[26] */ Ins_MIRP,
- /* MIRP[27] */ Ins_MIRP,
- /* MIRP[28] */ Ins_MIRP,
- /* MIRP[29] */ Ins_MIRP,
- /* MIRP[30] */ Ins_MIRP,
- /* MIRP[31] */ Ins_MIRP
- };
-
-
-#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */
-
-
/*************************************************************************/
/* */
/* RUN */
@@ -8198,8 +7495,6 @@
/* */
/* THIS IS THE INTERPRETER'S MAIN LOOP. */
/* */
- /* Instructions appear in the specification's order. */
- /* */
/*************************************************************************/
@@ -8225,90 +7520,100 @@
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-#ifdef TT_CONFIG_OPTION_STATIC_RASTER
- if ( !exc )
- return FT_THROW( Invalid_Argument );
-
- cur = *exc;
-#endif
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- CUR.iup_called = FALSE;
+ exc->iup_called = FALSE;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/* set PPEM and CVT functions */
- CUR.tt_metrics.ratio = 0;
- if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )
+ exc->tt_metrics.ratio = 0;
+ if ( exc->metrics.x_ppem != exc->metrics.y_ppem )
{
/* non-square pixels, use the stretched routines */
- CUR.func_cur_ppem = Current_Ppem_Stretched;
- CUR.func_read_cvt = Read_CVT_Stretched;
- CUR.func_write_cvt = Write_CVT_Stretched;
- CUR.func_move_cvt = Move_CVT_Stretched;
+ exc->func_cur_ppem = Current_Ppem_Stretched;
+ exc->func_read_cvt = Read_CVT_Stretched;
+ exc->func_write_cvt = Write_CVT_Stretched;
+ exc->func_move_cvt = Move_CVT_Stretched;
}
else
{
/* square pixels, use normal routines */
- CUR.func_cur_ppem = Current_Ppem;
- CUR.func_read_cvt = Read_CVT;
- CUR.func_write_cvt = Write_CVT;
- CUR.func_move_cvt = Move_CVT;
+ exc->func_cur_ppem = Current_Ppem;
+ exc->func_read_cvt = Read_CVT;
+ exc->func_write_cvt = Write_CVT;
+ exc->func_move_cvt = Move_CVT;
}
- COMPUTE_Funcs();
- COMPUTE_Round( (FT_Byte)exc->GS.round_state );
+ Compute_Funcs( exc );
+ Compute_Round( exc, (FT_Byte)exc->GS.round_state );
do
{
- CUR.opcode = CUR.code[CUR.IP];
+ exc->opcode = exc->code[exc->IP];
- FT_TRACE7(( " " ));
- FT_TRACE7(( opcode_name[CUR.opcode] ));
- FT_TRACE7(( "\n" ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_Long cnt = FT_MIN( 8, exc->top );
+ FT_Long n;
+
+
+ /* if tracing level is 7, show current code position */
+ /* and the first few stack elements also */
+ FT_TRACE6(( " " ));
+ FT_TRACE7(( "%06d ", exc->IP ));
+ FT_TRACE6(( opcode_name[exc->opcode] + 2 ));
+ FT_TRACE7(( "%*s", *opcode_name[exc->opcode] == 'A'
+ ? 2
+ : 12 - ( *opcode_name[exc->opcode] - '0' ),
+ "#" ));
+ for ( n = 0; n < cnt; n++ )
+ FT_TRACE7(( " %d", exc->stack[exc->top - n] ));
+ FT_TRACE6(( "\n" ));
+ }
+#endif /* FT_DEBUG_LEVEL_TRACE */
- if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 )
+ if ( ( exc->length = opcode_length[exc->opcode] ) < 0 )
{
- if ( CUR.IP + 1 >= CUR.codeSize )
+ if ( exc->IP + 1 >= exc->codeSize )
goto LErrorCodeOverflow_;
- CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
+ exc->length = 2 - exc->length * exc->code[exc->IP + 1];
}
- if ( CUR.IP + CUR.length > CUR.codeSize )
+ if ( exc->IP + exc->length > exc->codeSize )
goto LErrorCodeOverflow_;
/* First, let's check for empty stack and overflow */
- CUR.args = CUR.top - ( Pop_Push_Count[CUR.opcode] >> 4 );
+ exc->args = exc->top - ( Pop_Push_Count[exc->opcode] >> 4 );
/* `args' is the top of the stack once arguments have been popped. */
/* One can also interpret it as the index of the last argument. */
- if ( CUR.args < 0 )
+ if ( exc->args < 0 )
{
- if ( CUR.pedantic_hinting )
+ if ( exc->pedantic_hinting )
{
- CUR.error = FT_THROW( Too_Few_Arguments );
+ exc->error = FT_THROW( Too_Few_Arguments );
goto LErrorLabel_;
}
/* push zeroes onto the stack */
- for ( i = 0; i < Pop_Push_Count[CUR.opcode] >> 4; i++ )
- CUR.stack[i] = 0;
- CUR.args = 0;
+ for ( i = 0; i < Pop_Push_Count[exc->opcode] >> 4; i++ )
+ exc->stack[i] = 0;
+ exc->args = 0;
}
- CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 );
+ exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
/* `new_top' is the new top of the stack, after the instruction's */
/* execution. `top' will be set to `new_top' after the `switch' */
/* statement. */
- if ( CUR.new_top > CUR.stackSize )
+ if ( exc->new_top > exc->stackSize )
{
- CUR.error = FT_THROW( Stack_Overflow );
+ exc->error = FT_THROW( Stack_Overflow );
goto LErrorLabel_;
}
- CUR.step_ins = TRUE;
- CUR.error = FT_Err_Ok;
+ exc->step_ins = TRUE;
+ exc->error = FT_Err_Ok;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
@@ -8316,17 +7621,17 @@
{
for ( i = 0; i < opcode_patterns; i++ )
{
- if ( opcode_pointer[i] < opcode_size[i] &&
- CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )
+ if ( opcode_pointer[i] < opcode_size[i] &&
+ exc->opcode == opcode_pattern[i][opcode_pointer[i]] )
{
opcode_pointer[i] += 1;
if ( opcode_pointer[i] == opcode_size[i] )
{
- FT_TRACE7(( "sph: opcode ptrn: %d, %s %s\n",
+ FT_TRACE6(( "sph: opcode ptrn: %d, %s %s\n",
i,
- CUR.face->root.family_name,
- CUR.face->root.style_name ));
+ exc->face->root.family_name,
+ exc->face->root.style_name ));
switch ( i )
{
@@ -8343,15 +7648,9 @@
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-#ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
{
- FT_Long* args = CUR.stack + CUR.args;
- FT_Byte opcode = CUR.opcode;
-
-
-#undef ARRAY_BOUND_ERROR
-#define ARRAY_BOUND_ERROR goto Set_Invalid_Ref
+ FT_Long* args = exc->stack + exc->args;
+ FT_Byte opcode = exc->opcode;
switch ( opcode )
@@ -8362,580 +7661,543 @@
case 0x03: /* SPvTCA x */
case 0x04: /* SFvTCA y */
case 0x05: /* SFvTCA x */
- {
- FT_Short AA, BB;
-
-
- AA = (FT_Short)( ( opcode & 1 ) << 14 );
- BB = (FT_Short)( AA ^ 0x4000 );
-
- if ( opcode < 4 )
- {
- CUR.GS.projVector.x = AA;
- CUR.GS.projVector.y = BB;
-
- CUR.GS.dualVector.x = AA;
- CUR.GS.dualVector.y = BB;
- }
- else
- {
- GUESS_VECTOR( projVector );
- }
-
- if ( ( opcode & 2 ) == 0 )
- {
- CUR.GS.freeVector.x = AA;
- CUR.GS.freeVector.y = BB;
- }
- else
- {
- GUESS_VECTOR( freeVector );
- }
-
- COMPUTE_Funcs();
- }
+ Ins_SxyTCA( exc );
break;
case 0x06: /* SPvTL // */
case 0x07: /* SPvTL + */
- DO_SPVTL
+ Ins_SPVTL( exc, args );
break;
case 0x08: /* SFvTL // */
case 0x09: /* SFvTL + */
- DO_SFVTL
+ Ins_SFVTL( exc, args );
break;
case 0x0A: /* SPvFS */
- DO_SPVFS
+ Ins_SPVFS( exc, args );
break;
case 0x0B: /* SFvFS */
- DO_SFVFS
+ Ins_SFVFS( exc, args );
break;
- case 0x0C: /* GPV */
- DO_GPV
+ case 0x0C: /* GPv */
+ Ins_GPV( exc, args );
break;
- case 0x0D: /* GFV */
- DO_GFV
+ case 0x0D: /* GFv */
+ Ins_GFV( exc, args );
break;
case 0x0E: /* SFvTPv */
- DO_SFVTPV
+ Ins_SFVTPV( exc );
break;
case 0x0F: /* ISECT */
- Ins_ISECT( EXEC_ARG_ args );
+ Ins_ISECT( exc, args );
break;
case 0x10: /* SRP0 */
- DO_SRP0
+ Ins_SRP0( exc, args );
break;
case 0x11: /* SRP1 */
- DO_SRP1
+ Ins_SRP1( exc, args );
break;
case 0x12: /* SRP2 */
- DO_SRP2
+ Ins_SRP2( exc, args );
break;
case 0x13: /* SZP0 */
- Ins_SZP0( EXEC_ARG_ args );
+ Ins_SZP0( exc, args );
break;
case 0x14: /* SZP1 */
- Ins_SZP1( EXEC_ARG_ args );
+ Ins_SZP1( exc, args );
break;
case 0x15: /* SZP2 */
- Ins_SZP2( EXEC_ARG_ args );
+ Ins_SZP2( exc, args );
break;
case 0x16: /* SZPS */
- Ins_SZPS( EXEC_ARG_ args );
+ Ins_SZPS( exc, args );
break;
case 0x17: /* SLOOP */
- DO_SLOOP
+ Ins_SLOOP( exc, args );
break;
case 0x18: /* RTG */
- DO_RTG
+ Ins_RTG( exc );
break;
case 0x19: /* RTHG */
- DO_RTHG
+ Ins_RTHG( exc );
break;
case 0x1A: /* SMD */
- DO_SMD
+ Ins_SMD( exc, args );
break;
case 0x1B: /* ELSE */
- Ins_ELSE( EXEC_ARG_ args );
+ Ins_ELSE( exc );
break;
case 0x1C: /* JMPR */
- DO_JMPR
+ Ins_JMPR( exc, args );
break;
case 0x1D: /* SCVTCI */
- DO_SCVTCI
+ Ins_SCVTCI( exc, args );
break;
case 0x1E: /* SSWCI */
- DO_SSWCI
+ Ins_SSWCI( exc, args );
break;
case 0x1F: /* SSW */
- DO_SSW
+ Ins_SSW( exc, args );
break;
case 0x20: /* DUP */
- DO_DUP
+ Ins_DUP( args );
break;
case 0x21: /* POP */
- /* nothing :-) */
+ Ins_POP();
break;
case 0x22: /* CLEAR */
- DO_CLEAR
+ Ins_CLEAR( exc );
break;
case 0x23: /* SWAP */
- DO_SWAP
+ Ins_SWAP( args );
break;
case 0x24: /* DEPTH */
- DO_DEPTH
+ Ins_DEPTH( exc, args );
break;
case 0x25: /* CINDEX */
- DO_CINDEX
+ Ins_CINDEX( exc, args );
break;
case 0x26: /* MINDEX */
- Ins_MINDEX( EXEC_ARG_ args );
+ Ins_MINDEX( exc, args );
break;
case 0x27: /* ALIGNPTS */
- Ins_ALIGNPTS( EXEC_ARG_ args );
+ Ins_ALIGNPTS( exc, args );
break;
case 0x28: /* ???? */
- Ins_UNKNOWN( EXEC_ARG_ args );
+ Ins_UNKNOWN( exc );
break;
case 0x29: /* UTP */
- Ins_UTP( EXEC_ARG_ args );
+ Ins_UTP( exc, args );
break;
case 0x2A: /* LOOPCALL */
- Ins_LOOPCALL( EXEC_ARG_ args );
+ Ins_LOOPCALL( exc, args );
break;
case 0x2B: /* CALL */
- Ins_CALL( EXEC_ARG_ args );
+ Ins_CALL( exc, args );
break;
case 0x2C: /* FDEF */
- Ins_FDEF( EXEC_ARG_ args );
+ Ins_FDEF( exc, args );
break;
case 0x2D: /* ENDF */
- Ins_ENDF( EXEC_ARG_ args );
+ Ins_ENDF( exc );
break;
case 0x2E: /* MDAP */
case 0x2F: /* MDAP */
- Ins_MDAP( EXEC_ARG_ args );
+ Ins_MDAP( exc, args );
break;
case 0x30: /* IUP */
case 0x31: /* IUP */
- Ins_IUP( EXEC_ARG_ args );
+ Ins_IUP( exc );
break;
case 0x32: /* SHP */
case 0x33: /* SHP */
- Ins_SHP( EXEC_ARG_ args );
+ Ins_SHP( exc );
break;
case 0x34: /* SHC */
case 0x35: /* SHC */
- Ins_SHC( EXEC_ARG_ args );
+ Ins_SHC( exc, args );
break;
case 0x36: /* SHZ */
case 0x37: /* SHZ */
- Ins_SHZ( EXEC_ARG_ args );
+ Ins_SHZ( exc, args );
break;
case 0x38: /* SHPIX */
- Ins_SHPIX( EXEC_ARG_ args );
+ Ins_SHPIX( exc, args );
break;
case 0x39: /* IP */
- Ins_IP( EXEC_ARG_ args );
+ Ins_IP( exc );
break;
case 0x3A: /* MSIRP */
case 0x3B: /* MSIRP */
- Ins_MSIRP( EXEC_ARG_ args );
+ Ins_MSIRP( exc, args );
break;
case 0x3C: /* AlignRP */
- Ins_ALIGNRP( EXEC_ARG_ args );
+ Ins_ALIGNRP( exc );
break;
case 0x3D: /* RTDG */
- DO_RTDG
+ Ins_RTDG( exc );
break;
case 0x3E: /* MIAP */
case 0x3F: /* MIAP */
- Ins_MIAP( EXEC_ARG_ args );
+ Ins_MIAP( exc, args );
break;
case 0x40: /* NPUSHB */
- Ins_NPUSHB( EXEC_ARG_ args );
+ Ins_NPUSHB( exc, args );
break;
case 0x41: /* NPUSHW */
- Ins_NPUSHW( EXEC_ARG_ args );
+ Ins_NPUSHW( exc, args );
break;
case 0x42: /* WS */
- DO_WS
- break;
-
- Set_Invalid_Ref:
- CUR.error = FT_THROW( Invalid_Reference );
+ Ins_WS( exc, args );
break;
case 0x43: /* RS */
- DO_RS
+ Ins_RS( exc, args );
break;
case 0x44: /* WCVTP */
- DO_WCVTP
+ Ins_WCVTP( exc, args );
break;
case 0x45: /* RCVT */
- DO_RCVT
+ Ins_RCVT( exc, args );
break;
case 0x46: /* GC */
case 0x47: /* GC */
- Ins_GC( EXEC_ARG_ args );
+ Ins_GC( exc, args );
break;
case 0x48: /* SCFS */
- Ins_SCFS( EXEC_ARG_ args );
+ Ins_SCFS( exc, args );
break;
case 0x49: /* MD */
case 0x4A: /* MD */
- Ins_MD( EXEC_ARG_ args );
+ Ins_MD( exc, args );
break;
case 0x4B: /* MPPEM */
- DO_MPPEM
+ Ins_MPPEM( exc, args );
break;
case 0x4C: /* MPS */
- DO_MPS
+ Ins_MPS( exc, args );
break;
case 0x4D: /* FLIPON */
- DO_FLIPON
+ Ins_FLIPON( exc );
break;
case 0x4E: /* FLIPOFF */
- DO_FLIPOFF
+ Ins_FLIPOFF( exc );
break;
case 0x4F: /* DEBUG */
- DO_DEBUG
+ Ins_DEBUG( exc );
break;
case 0x50: /* LT */
- DO_LT
+ Ins_LT( args );
break;
case 0x51: /* LTEQ */
- DO_LTEQ
+ Ins_LTEQ( args );
break;
case 0x52: /* GT */
- DO_GT
+ Ins_GT( args );
break;
case 0x53: /* GTEQ */
- DO_GTEQ
+ Ins_GTEQ( args );
break;
case 0x54: /* EQ */
- DO_EQ
+ Ins_EQ( args );
break;
case 0x55: /* NEQ */
- DO_NEQ
+ Ins_NEQ( args );
break;
case 0x56: /* ODD */
- DO_ODD
+ Ins_ODD( exc, args );
break;
case 0x57: /* EVEN */
- DO_EVEN
+ Ins_EVEN( exc, args );
break;
case 0x58: /* IF */
- Ins_IF( EXEC_ARG_ args );
+ Ins_IF( exc, args );
break;
case 0x59: /* EIF */
- /* do nothing */
+ Ins_EIF();
break;
case 0x5A: /* AND */
- DO_AND
+ Ins_AND( args );
break;
case 0x5B: /* OR */
- DO_OR
+ Ins_OR( args );
break;
case 0x5C: /* NOT */
- DO_NOT
+ Ins_NOT( args );
break;
case 0x5D: /* DELTAP1 */
- Ins_DELTAP( EXEC_ARG_ args );
+ Ins_DELTAP( exc, args );
break;
case 0x5E: /* SDB */
- DO_SDB
+ Ins_SDB( exc, args );
break;
case 0x5F: /* SDS */
- DO_SDS
+ Ins_SDS( exc, args );
break;
case 0x60: /* ADD */
- DO_ADD
+ Ins_ADD( args );
break;
case 0x61: /* SUB */
- DO_SUB
+ Ins_SUB( args );
break;
case 0x62: /* DIV */
- DO_DIV
+ Ins_DIV( exc, args );
break;
case 0x63: /* MUL */
- DO_MUL
+ Ins_MUL( args );
break;
case 0x64: /* ABS */
- DO_ABS
+ Ins_ABS( args );
break;
case 0x65: /* NEG */
- DO_NEG
+ Ins_NEG( args );
break;
case 0x66: /* FLOOR */
- DO_FLOOR
+ Ins_FLOOR( args );
break;
case 0x67: /* CEILING */
- DO_CEILING
+ Ins_CEILING( args );
break;
case 0x68: /* ROUND */
case 0x69: /* ROUND */
case 0x6A: /* ROUND */
case 0x6B: /* ROUND */
- DO_ROUND
+ Ins_ROUND( exc, args );
break;
case 0x6C: /* NROUND */
case 0x6D: /* NROUND */
case 0x6E: /* NRRUND */
case 0x6F: /* NROUND */
- DO_NROUND
+ Ins_NROUND( exc, args );
break;
case 0x70: /* WCVTF */
- DO_WCVTF
+ Ins_WCVTF( exc, args );
break;
case 0x71: /* DELTAP2 */
case 0x72: /* DELTAP3 */
- Ins_DELTAP( EXEC_ARG_ args );
+ Ins_DELTAP( exc, args );
break;
case 0x73: /* DELTAC0 */
case 0x74: /* DELTAC1 */
case 0x75: /* DELTAC2 */
- Ins_DELTAC( EXEC_ARG_ args );
+ Ins_DELTAC( exc, args );
break;
case 0x76: /* SROUND */
- DO_SROUND
+ Ins_SROUND( exc, args );
break;
case 0x77: /* S45Round */
- DO_S45ROUND
+ Ins_S45ROUND( exc, args );
break;
case 0x78: /* JROT */
- DO_JROT
+ Ins_JROT( exc, args );
break;
case 0x79: /* JROF */
- DO_JROF
+ Ins_JROF( exc, args );
break;
case 0x7A: /* ROFF */
- DO_ROFF
+ Ins_ROFF( exc );
break;
case 0x7B: /* ???? */
- Ins_UNKNOWN( EXEC_ARG_ args );
+ Ins_UNKNOWN( exc );
break;
case 0x7C: /* RUTG */
- DO_RUTG
+ Ins_RUTG( exc );
break;
case 0x7D: /* RDTG */
- DO_RDTG
+ Ins_RDTG( exc );
break;
case 0x7E: /* SANGW */
- case 0x7F: /* AA */
- /* nothing - obsolete */
+ Ins_SANGW();
+ break;
+
+ case 0x7F: /* AA */
+ Ins_AA();
break;
case 0x80: /* FLIPPT */
- Ins_FLIPPT( EXEC_ARG_ args );
+ Ins_FLIPPT( exc );
break;
case 0x81: /* FLIPRGON */
- Ins_FLIPRGON( EXEC_ARG_ args );
+ Ins_FLIPRGON( exc, args );
break;
case 0x82: /* FLIPRGOFF */
- Ins_FLIPRGOFF( EXEC_ARG_ args );
+ Ins_FLIPRGOFF( exc, args );
break;
case 0x83: /* UNKNOWN */
case 0x84: /* UNKNOWN */
- Ins_UNKNOWN( EXEC_ARG_ args );
+ Ins_UNKNOWN( exc );
break;
case 0x85: /* SCANCTRL */
- Ins_SCANCTRL( EXEC_ARG_ args );
+ Ins_SCANCTRL( exc, args );
break;
- case 0x86: /* SDPVTL */
- case 0x87: /* SDPVTL */
- Ins_SDPVTL( EXEC_ARG_ args );
+ case 0x86: /* SDPvTL */
+ case 0x87: /* SDPvTL */
+ Ins_SDPVTL( exc, args );
break;
case 0x88: /* GETINFO */
- Ins_GETINFO( EXEC_ARG_ args );
+ Ins_GETINFO( exc, args );
break;
case 0x89: /* IDEF */
- Ins_IDEF( EXEC_ARG_ args );
+ Ins_IDEF( exc, args );
break;
case 0x8A: /* ROLL */
- Ins_ROLL( EXEC_ARG_ args );
+ Ins_ROLL( args );
break;
case 0x8B: /* MAX */
- DO_MAX
+ Ins_MAX( args );
break;
case 0x8C: /* MIN */
- DO_MIN
+ Ins_MIN( args );
break;
case 0x8D: /* SCANTYPE */
- Ins_SCANTYPE( EXEC_ARG_ args );
+ Ins_SCANTYPE( exc, args );
break;
case 0x8E: /* INSTCTRL */
- Ins_INSTCTRL( EXEC_ARG_ args );
+ Ins_INSTCTRL( exc, args );
break;
case 0x8F:
- Ins_UNKNOWN( EXEC_ARG_ args );
+ Ins_UNKNOWN( exc );
break;
default:
if ( opcode >= 0xE0 )
- Ins_MIRP( EXEC_ARG_ args );
+ Ins_MIRP( exc, args );
else if ( opcode >= 0xC0 )
- Ins_MDRP( EXEC_ARG_ args );
+ Ins_MDRP( exc, args );
else if ( opcode >= 0xB8 )
- Ins_PUSHW( EXEC_ARG_ args );
+ Ins_PUSHW( exc, args );
else if ( opcode >= 0xB0 )
- Ins_PUSHB( EXEC_ARG_ args );
+ Ins_PUSHB( exc, args );
else
- Ins_UNKNOWN( EXEC_ARG_ args );
+ Ins_UNKNOWN( exc );
}
-
}
-#else
-
- Instruct_Dispatch[CUR.opcode]( EXEC_ARG_ &CUR.stack[CUR.args] );
-
-#endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */
-
- if ( CUR.error )
+ if ( exc->error )
{
- switch ( CUR.error )
+ switch ( exc->error )
{
/* looking for redefined instructions */
case FT_ERR( Invalid_Opcode ):
{
- TT_DefRecord* def = CUR.IDefs;
- TT_DefRecord* limit = def + CUR.numIDefs;
+ TT_DefRecord* def = exc->IDefs;
+ TT_DefRecord* limit = def + exc->numIDefs;
for ( ; def < limit; def++ )
{
- if ( def->active && CUR.opcode == (FT_Byte)def->opc )
+ if ( def->active && exc->opcode == (FT_Byte)def->opc )
{
TT_CallRec* callrec;
- if ( CUR.callTop >= CUR.callSize )
+ if ( exc->callTop >= exc->callSize )
{
- CUR.error = FT_THROW( Invalid_Reference );
+ exc->error = FT_THROW( Invalid_Reference );
goto LErrorLabel_;
}
- callrec = &CUR.callStack[CUR.callTop];
+ callrec = &exc->callStack[exc->callTop];
- callrec->Caller_Range = CUR.curRange;
- callrec->Caller_IP = CUR.IP + 1;
+ callrec->Caller_Range = exc->curRange;
+ callrec->Caller_IP = exc->IP + 1;
callrec->Cur_Count = 1;
callrec->Def = def;
- if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE )
+ if ( Ins_Goto_CodeRange( exc,
+ def->range,
+ def->start ) == FAILURE )
goto LErrorLabel_;
goto LSuiteLabel_;
@@ -8943,7 +8205,7 @@
}
}
- CUR.error = FT_THROW( Invalid_Opcode );
+ exc->error = FT_THROW( Invalid_Opcode );
goto LErrorLabel_;
#if 0
@@ -8961,10 +8223,10 @@
}
}
- CUR.top = CUR.new_top;
+ exc->top = exc->new_top;
- if ( CUR.step_ins )
- CUR.IP += CUR.length;
+ if ( exc->step_ins )
+ exc->IP += exc->length;
/* increment instruction counter and check if we didn't */
/* run this program for too long (e.g. infinite loops). */
@@ -8972,48 +8234,38 @@
return FT_THROW( Execution_Too_Long );
LSuiteLabel_:
- if ( CUR.IP >= CUR.codeSize )
+ if ( exc->IP >= exc->codeSize )
{
- if ( CUR.callTop > 0 )
+ if ( exc->callTop > 0 )
{
- CUR.error = FT_THROW( Code_Overflow );
+ exc->error = FT_THROW( Code_Overflow );
goto LErrorLabel_;
}
else
goto LNo_Error_;
}
- } while ( !CUR.instruction_trap );
+ } while ( !exc->instruction_trap );
LNo_Error_:
-
-#ifdef TT_CONFIG_OPTION_STATIC_RASTER
- *exc = cur;
-#endif
-
return FT_Err_Ok;
LErrorCodeOverflow_:
- CUR.error = FT_THROW( Code_Overflow );
+ exc->error = FT_THROW( Code_Overflow );
LErrorLabel_:
-
-#ifdef TT_CONFIG_OPTION_STATIC_RASTER
- *exc = cur;
-#endif
-
/* If any errors have occurred, function tables may be broken. */
/* Force a re-execution of `prep' and `fpgm' tables if no */
/* bytecode debugger is run. */
- if ( CUR.error &&
- !CUR.instruction_trap &&
- CUR.curRange == tt_coderange_glyph )
+ if ( exc->error &&
+ !exc->instruction_trap &&
+ exc->curRange == tt_coderange_glyph )
{
- FT_TRACE1(( " The interpreter returned error 0x%x\n", CUR.error ));
+ FT_TRACE1(( " The interpreter returned error 0x%x\n", exc->error ));
exc->size->bytecode_ready = -1;
exc->size->cvt_ready = -1;
}
- return CUR.error;
+ return exc->error;
}
diff --git a/src/3rdparty/freetype/src/truetype/ttinterp.h b/src/3rdparty/freetype/src/truetype/ttinterp.h
index 333decc6a6..32706d0760 100644
--- a/src/3rdparty/freetype/src/truetype/ttinterp.h
+++ b/src/3rdparty/freetype/src/truetype/ttinterp.h
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (specification). */
/* */
-/* Copyright 1996-2007, 2010, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,23 +26,6 @@
FT_BEGIN_HEADER
-#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */
-
-#define EXEC_OP_ TT_ExecContext exc,
-#define EXEC_OP TT_ExecContext exc
-#define EXEC_ARG_ exc,
-#define EXEC_ARG exc
-
-#else /* static implementation */
-
-#define EXEC_OP_ /* void */
-#define EXEC_OP /* void */
-#define EXEC_ARG_ /* void */
-#define EXEC_ARG /* void */
-
-#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */
-
-
/*************************************************************************/
/* */
/* Rounding mode constants. */
@@ -67,33 +50,38 @@ FT_BEGIN_HEADER
/* Rounding function */
typedef FT_F26Dot6
- (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6 distance,
- FT_F26Dot6 compensation );
+ (*TT_Round_Func)( TT_ExecContext exc,
+ FT_F26Dot6 distance,
+ FT_F26Dot6 compensation );
/* Point displacement along the freedom vector routine */
typedef void
- (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance );
+ (*TT_Move_Func)( TT_ExecContext exc,
+ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance );
/* Distance projection along one of the projection vectors */
typedef FT_F26Dot6
- (*TT_Project_Func)( EXEC_OP_ FT_Pos dx,
- FT_Pos dy );
+ (*TT_Project_Func)( TT_ExecContext exc,
+ FT_Pos dx,
+ FT_Pos dy );
/* getting current ppem. Take care of non-square pixels if necessary */
typedef FT_Long
- (*TT_Cur_Ppem_Func)( EXEC_OP );
+ (*TT_Cur_Ppem_Func)( TT_ExecContext exc );
/* reading a cvt value. Take care of non-square pixels if necessary */
typedef FT_F26Dot6
- (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx );
+ (*TT_Get_CVT_Func)( TT_ExecContext exc,
+ FT_ULong idx );
/* setting or moving a cvt value. Take care of non-square pixels */
/* if necessary */
typedef void
- (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx,
- FT_F26Dot6 value );
+ (*TT_Set_CVT_Func)( TT_ExecContext exc,
+ FT_ULong idx,
+ FT_F26Dot6 value );
/*************************************************************************/
@@ -170,11 +158,11 @@ FT_BEGIN_HEADER
FT_Long top; /* top of exec. stack */
- FT_UInt stackSize; /* size of exec. stack */
+ FT_Long stackSize; /* size of exec. stack */
FT_Long* stack; /* current exec. stack */
FT_Long args;
- FT_UInt new_top; /* new top after exec. */
+ FT_Long new_top; /* new top after exec. */
TT_GlyphZoneRec zp0, /* zone records */
zp1,
@@ -264,18 +252,22 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
TT_Round_Func func_round_sphn; /* subpixel rounding function */
- FT_Bool subpixel; /* Using subpixel hinting? */
+ FT_Bool subpixel_hinting; /* Using subpixel hinting? */
FT_Bool ignore_x_mode; /* Standard rendering mode for */
/* subpixel hinting. On if gray */
/* or subpixel hinting is on. */
- /* The following 4 aren't fully implemented but here for MS rasterizer */
+ /* The following 6 aren't fully implemented but here for MS rasterizer */
/* compatibility. */
FT_Bool compatible_widths; /* compatible widths? */
FT_Bool symmetrical_smoothing; /* symmetrical_smoothing? */
FT_Bool bgr; /* bgr instead of rgb? */
+ FT_Bool vertical_lcd; /* long side of LCD subpixel */
+ /* rectangles is horizontal */
FT_Bool subpixel_positioned; /* subpixel positioned */
/* (DirectWrite ClearType)? */
+ FT_Bool gray_cleartype; /* ClearType hinting but */
+ /* grayscale rendering */
FT_Int rasterizer_version; /* MS rasterizer version */
@@ -315,7 +307,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
Update_Max( FT_Memory memory,
FT_ULong* size,
- FT_Long multiplier,
+ FT_ULong multiplier,
void* _pbuff,
FT_ULong new_max );
#endif /* TT_USE_BYTECODE_INTERPRETER */
@@ -339,6 +331,7 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* Only the glyph loader and debugger should call this function. */
+ /* (And right now only the glyph loader uses it.) */
/* */
FT_EXPORT( TT_ExecContext )
TT_New_Context( TT_Driver driver );
@@ -358,8 +351,7 @@ FT_BEGIN_HEADER
TT_Size ins );
FT_LOCAL( FT_Error )
- TT_Run_Context( TT_ExecContext exec,
- FT_Bool debug );
+ TT_Run_Context( TT_ExecContext exec );
#endif /* TT_USE_BYTECODE_INTERPRETER */
diff --git a/src/3rdparty/freetype/src/truetype/ttobjs.c b/src/3rdparty/freetype/src/truetype/ttobjs.c
index 4707dfe159..6060d6f5d1 100644
--- a/src/3rdparty/freetype/src/truetype/ttobjs.c
+++ b/src/3rdparty/freetype/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
/* */
/* Objects manager (body). */
/* */
-/* Copyright 1996-2013 */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -191,7 +191,7 @@
{
FT_Error error;
FT_UInt32 checksum = 0;
- int i;
+ FT_UInt i;
if ( FT_FRAME_ENTER( length ) )
@@ -200,8 +200,8 @@
for ( ; length > 3; length -= 4 )
checksum += (FT_UInt32)FT_GET_ULONG();
- for ( i = 3; length > 0; length --, i-- )
- checksum += (FT_UInt32)( FT_GET_BYTE() << ( i * 8 ) );
+ for ( i = 3; length > 0; length--, i-- )
+ checksum += (FT_UInt32)FT_GET_BYTE() << ( i * 8 );
FT_FRAME_EXIT();
@@ -490,7 +490,10 @@
/* <Input> */
/* stream :: The source font stream. */
/* */
- /* face_index :: The index of the font face in the resource. */
+ /* face_index :: The index of the TrueType font, if we are opening a */
+ /* collection, in bits 0-15. The numbered instance */
+ /* index~+~1 of a GX (sub)font, if applicable, in bits */
+ /* 16-30. */
/* */
/* num_params :: Number of additional generic parameters. Ignored. */
/* */
@@ -599,7 +602,7 @@
ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
}
-#else
+#else /* !FT_CONFIG_OPTION_INCREMENTAL */
if ( !error )
error = tt_face_load_loca( face, stream );
@@ -623,10 +626,56 @@
ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
}
-#endif
+#endif /* !FT_CONFIG_OPTION_INCREMENTAL */
}
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
+ {
+ FT_Int instance_index = face_index >> 16;
+
+
+ if ( FT_HAS_MULTIPLE_MASTERS( ttface ) &&
+ instance_index > 0 )
+ {
+ error = TT_Get_MM_Var( face, NULL );
+ if ( error )
+ goto Exit;
+
+ if ( face->blend->mmvar->namedstyle )
+ {
+ FT_Memory memory = ttface->memory;
+
+ FT_Var_Named_Style* named_style;
+ FT_String* style_name;
+
+
+ /* in `face_index', the instance index starts with value 1 */
+ named_style = face->blend->mmvar->namedstyle + instance_index - 1;
+ error = sfnt->get_name( face,
+ (FT_UShort)named_style->strid,
+ &style_name );
+ if ( error )
+ goto Exit;
+
+ /* set style name; if already set, replace it */
+ if ( face->root.style_name )
+ FT_FREE( face->root.style_name );
+ face->root.style_name = style_name;
+
+ /* finally, select the named instance */
+ error = TT_Set_Var_Design( face,
+ face->blend->mmvar->num_axis,
+ named_style->coords );
+ if ( error )
+ goto Exit;
+ }
+ }
+ }
+
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \
!defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER )
@@ -751,14 +800,7 @@
FT_Error error;
- /* debugging instances have their own context */
- if ( size->debug )
- exec = size->context;
- else
- exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
-
- if ( !exec )
- return FT_THROW( Could_Not_Find_Context );
+ exec = size->context;
error = TT_Load_Context( exec, face, size );
if ( error )
@@ -795,7 +837,7 @@
TT_Set_CodeRange( exec,
tt_coderange_font,
face->font_program,
- face->font_program_size );
+ (FT_Long)face->font_program_size );
/* disable CVT and glyph programs coderange */
TT_Clear_CodeRange( exec, tt_coderange_cvt );
@@ -845,14 +887,7 @@
FT_Error error;
- /* debugging instances have their own context */
- if ( size->debug )
- exec = size->context;
- else
- exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;
-
- if ( !exec )
- return FT_THROW( Could_Not_Find_Context );
+ exec = size->context;
error = TT_Load_Context( exec, face, size );
if ( error )
@@ -868,7 +903,7 @@
TT_Set_CodeRange( exec,
tt_coderange_cvt,
face->cvt_program,
- face->cvt_program_size );
+ (FT_Long)face->cvt_program_size );
TT_Clear_CodeRange( exec, tt_coderange_glyph );
@@ -876,12 +911,9 @@
{
TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
- if ( !size->debug )
- {
- FT_TRACE4(( "Executing `prep' table.\n" ));
+ FT_TRACE4(( "Executing `prep' table.\n" ));
- error = face->interpreter( exec );
- }
+ error = face->interpreter( exec );
}
else
error = FT_Err_Ok;
@@ -924,12 +956,10 @@
TT_Face face = (TT_Face)ftsize->face;
FT_Memory memory = face->root.memory;
-
- if ( size->debug )
+ if ( size->context )
{
- /* the debug context must be deleted by the debugger itself */
+ TT_Done_Context( size->context );
size->context = NULL;
- size->debug = FALSE;
}
FT_FREE( size->cvt );
@@ -973,9 +1003,21 @@
TT_MaxProfile* maxp = &face->max_profile;
+ /* clean up bytecode related data */
+ FT_FREE( size->function_defs );
+ FT_FREE( size->instruction_defs );
+ FT_FREE( size->cvt );
+ FT_FREE( size->storage );
+
+ if ( size->context )
+ TT_Done_Context( size->context );
+ tt_glyphzone_done( &size->twilight );
+
size->bytecode_ready = -1;
size->cvt_ready = -1;
+ size->context = TT_New_Context( (TT_Driver)face->root.driver );
+
size->max_function_defs = maxp->maxFunctionDefs;
size->max_instruction_defs = maxp->maxInstructionDefs;
@@ -1259,10 +1301,6 @@
TT_Driver driver = (TT_Driver)ttdriver;
-
- if ( !TT_New_Context( driver ) )
- return FT_THROW( Could_Not_Find_Context );
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
driver->interpreter_version = TT_INTERPRETER_VERSION_38;
#else
@@ -1293,20 +1331,7 @@
FT_LOCAL_DEF( void )
tt_driver_done( FT_Module ttdriver ) /* TT_Driver */
{
-#ifdef TT_USE_BYTECODE_INTERPRETER
- TT_Driver driver = (TT_Driver)ttdriver;
-
-
- /* destroy the execution context */
- if ( driver->context )
- {
- TT_Done_Context( driver->context );
- driver->context = NULL;
- }
-#else
FT_UNUSED( ttdriver );
-#endif
-
}
diff --git a/src/3rdparty/freetype/src/truetype/ttobjs.h b/src/3rdparty/freetype/src/truetype/ttobjs.h
index 859164f86b..9396089a99 100644
--- a/src/3rdparty/freetype/src/truetype/ttobjs.h
+++ b/src/3rdparty/freetype/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
/* */
/* Objects manager (specification). */
/* */
-/* Copyright 1996-2009, 2011-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -42,17 +42,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Type> */
- /* TT_Instance */
- /* */
- /* <Description> */
- /* A handle to a TrueType size object. */
- /* */
- typedef struct TT_SizeRec_* TT_Size;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
/* TT_GlyphSlot */
/* */
/* <Description> */
@@ -160,7 +149,7 @@ FT_BEGIN_HEADER
typedef struct TT_CodeRange_
{
FT_Byte* base;
- FT_ULong size;
+ FT_Long size;
} TT_CodeRange;
@@ -324,13 +313,6 @@ FT_BEGIN_HEADER
TT_GlyphZoneRec twilight; /* The instance's twilight zone */
- /* debugging variables */
-
- /* When using the debugger, we must keep the */
- /* execution context tied to the instance */
- /* object rather than asking it on demand. */
-
- FT_Bool debug;
TT_ExecContext context;
/* if negative, `fpgm' (resp. `prep'), wasn't executed yet; */
@@ -351,7 +333,6 @@ FT_BEGIN_HEADER
{
FT_DriverRec root;
- TT_ExecContext context; /* execution context */
TT_GlyphZoneRec zone; /* glyph loader points zone */
FT_UInt interpreter_version;
diff --git a/src/3rdparty/freetype/src/truetype/ttpic.c b/src/3rdparty/freetype/src/truetype/ttpic.c
index edefae72c5..242a6b76dd 100644
--- a/src/3rdparty/freetype/src/truetype/ttpic.c
+++ b/src/3rdparty/freetype/src/truetype/ttpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for truetype module. */
/* */
-/* Copyright 2009, 2010, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/truetype/ttpic.h b/src/3rdparty/freetype/src/truetype/ttpic.h
index cfb4ee6281..076ae56efa 100644
--- a/src/3rdparty/freetype/src/truetype/ttpic.h
+++ b/src/3rdparty/freetype/src/truetype/ttpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for truetype module. */
/* */
-/* Copyright 2009, 2012, 2013 by */
+/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,7 +20,8 @@
#define __TTPIC_H__
-FT_BEGIN_HEADER
+#include FT_INTERNAL_PIC_H
+
#ifndef FT_CONFIG_OPTION_PIC
@@ -37,6 +38,8 @@ FT_BEGIN_HEADER
#include FT_SERVICE_PROPERTIES_H
+FT_BEGIN_HEADER
+
typedef struct TTModulePIC_
{
FT_ServiceDescRec* tt_services;
@@ -68,13 +71,12 @@ FT_BEGIN_HEADER
FT_Error
tt_driver_class_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-
-FT_END_HEADER
-
#endif /* __TTPIC_H__ */
diff --git a/src/3rdparty/freetype/src/truetype/ttpload.c b/src/3rdparty/freetype/src/truetype/ttpload.c
index 9991925425..4647c938ae 100644
--- a/src/3rdparty/freetype/src/truetype/ttpload.c
+++ b/src/3rdparty/freetype/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (body). */
/* */
-/* Copyright 1996-2002, 2004-2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -118,20 +118,20 @@
/* we only handle the case where `maxp' gives a larger value */
if ( face->num_locations <= (FT_ULong)face->root.num_glyphs )
{
- FT_Long new_loca_len =
- ( (FT_Long)( face->root.num_glyphs ) + 1 ) << shift;
+ FT_ULong new_loca_len =
+ ( (FT_ULong)face->root.num_glyphs + 1 ) << shift;
TT_Table entry = face->dir_tables;
TT_Table limit = entry + face->num_tables;
- FT_Long pos = FT_Stream_Pos( stream );
+ FT_Long pos = (FT_Long)FT_STREAM_POS();
FT_Long dist = 0x7FFFFFFFL;
/* compute the distance to next table in font file */
for ( ; entry < limit; entry++ )
{
- FT_Long diff = entry->Offset - pos;
+ FT_Long diff = (FT_Long)entry->Offset - pos;
if ( diff > 0 && diff < dist )
@@ -141,17 +141,25 @@
if ( entry == limit )
{
/* `loca' is the last table */
- dist = stream->size - pos;
+ dist = (FT_Long)stream->size - pos;
}
- if ( new_loca_len <= dist )
+ if ( new_loca_len <= (FT_ULong)dist )
{
- face->num_locations = face->root.num_glyphs + 1;
+ face->num_locations = (FT_ULong)face->root.num_glyphs + 1;
table_len = new_loca_len;
FT_TRACE2(( "adjusting num_locations to %d\n",
face->num_locations ));
}
+ else
+ {
+ face->root.num_glyphs = face->num_locations
+ ? (FT_Long)face->num_locations - 1 : 0;
+
+ FT_TRACE2(( "adjusting num_glyphs to %d\n",
+ face->root.num_glyphs ));
+ }
}
}
diff --git a/src/3rdparty/freetype/src/truetype/ttpload.h b/src/3rdparty/freetype/src/truetype/ttpload.h
index f61ac079ce..bc92369827 100644
--- a/src/3rdparty/freetype/src/truetype/ttpload.h
+++ b/src/3rdparty/freetype/src/truetype/ttpload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2005, 2006 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/truetype/ttsubpix.c b/src/3rdparty/freetype/src/truetype/ttsubpix.c
index ca604518cf..0d391e95a0 100644
--- a/src/3rdparty/freetype/src/truetype/ttsubpix.c
+++ b/src/3rdparty/freetype/src/truetype/ttsubpix.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Subpixel Hinting. */
/* */
-/* Copyright 2010-2013 by */
+/* Copyright 2010-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -63,8 +63,8 @@
/* rules below. A blank entry "" is required at the end of these! */
#define FAMILY_CLASS_RULES_SIZE 7
- static const SPH_Font_Class FAMILY_CLASS_Rules
- [FAMILY_CLASS_RULES_SIZE] =
+ static const SPH_Font_Class FAMILY_CLASS_Rules
+ [FAMILY_CLASS_RULES_SIZE] =
{
{ "MS Legacy Fonts",
{ "Aharoni",
@@ -223,8 +223,8 @@
/* rules below. A blank entry "" is required at the end of these! */
#define STYLE_CLASS_RULES_SIZE 5
- const SPH_Font_Class STYLE_CLASS_Rules
- [STYLE_CLASS_RULES_SIZE] =
+ static const SPH_Font_Class STYLE_CLASS_Rules
+ [STYLE_CLASS_RULES_SIZE] =
{
{ "Regular Class",
{ "Regular",
@@ -279,8 +279,8 @@
/* Force special legacy fixes for fonts. */
#define COMPATIBILITY_MODE_RULES_SIZE 1
- const SPH_TweakRule COMPATIBILITY_MODE_Rules
- [COMPATIBILITY_MODE_RULES_SIZE] =
+ static const SPH_TweakRule COMPATIBILITY_MODE_Rules
+ [COMPATIBILITY_MODE_RULES_SIZE] =
{
{ "Verdana Clones", 0, "", 0 },
};
@@ -289,8 +289,8 @@
/* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */
#define PIXEL_HINTING_RULES_SIZE 2
- const SPH_TweakRule PIXEL_HINTING_Rules
- [PIXEL_HINTING_RULES_SIZE] =
+ static const SPH_TweakRule PIXEL_HINTING_Rules
+ [PIXEL_HINTING_RULES_SIZE] =
{
/* these characters are almost always safe */
{ "Courier New", 12, "Italic", 'z' },
@@ -301,8 +301,8 @@
/* Subpixel hinting ignores SHPIX rules on X. Force SHPIX for these. */
#define DO_SHPIX_RULES_SIZE 1
- const SPH_TweakRule DO_SHPIX_Rules
- [DO_SHPIX_RULES_SIZE] =
+ static const SPH_TweakRule DO_SHPIX_Rules
+ [DO_SHPIX_RULES_SIZE] =
{
{ "-", 0, "", 0 },
};
@@ -312,8 +312,8 @@
/* boundary and don't move that point to a Y pixel boundary. */
#define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 4
- const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
- [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
+ static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
+ [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
{
/* fix vwxyz thinness*/
{ "Consolas", 0, "", 0 },
@@ -328,8 +328,8 @@
#define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
- const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
- [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+ static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
+ [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
{
/* Fixes < and > */
{ "Courier New", 0, "Regular", 0 },
@@ -340,8 +340,8 @@
/* boundary and don't move that point to a Y pixel boundary. */
#define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE 2
- const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules
- [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] =
+ static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules
+ [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] =
{
/* Maintain thickness of diagonal in 'N' */
{ "Times New Roman", 0, "Regular/Bold Class", 'N' },
@@ -352,8 +352,8 @@
/* Skip Y moves that move a point off a Y pixel boundary. */
#define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 1
- const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules
- [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
+ static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules
+ [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
{
{ "-", 0, "", 0 },
};
@@ -361,8 +361,8 @@
#define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
- const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
- [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+ static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
+ [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
{
{ "-", 0, "", 0 },
};
@@ -371,8 +371,8 @@
/* Round moves that don't move a point to a Y pixel boundary. */
#define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 2
- const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules
- [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
+ static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules
+ [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
{
/* Droid font instructions don't snap Y to pixels */
{ "Droid Sans", 0, "Regular/Italic Class", 0 },
@@ -382,8 +382,8 @@
#define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
- const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
- [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+ static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
+ [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
{
{ "-", 0, "", 0 },
};
@@ -392,8 +392,8 @@
/* Allow a Direct_Move along X freedom vector if matched. */
#define ALLOW_X_DMOVE_RULES_SIZE 1
- const SPH_TweakRule ALLOW_X_DMOVE_Rules
- [ALLOW_X_DMOVE_RULES_SIZE] =
+ static const SPH_TweakRule ALLOW_X_DMOVE_Rules
+ [ALLOW_X_DMOVE_RULES_SIZE] =
{
/* Fixes vanishing diagonal in 4 */
{ "Verdana", 0, "Regular", '4' },
@@ -403,8 +403,8 @@
/* Return MS rasterizer version 35 if matched. */
#define RASTERIZER_35_RULES_SIZE 8
- const SPH_TweakRule RASTERIZER_35_Rules
- [RASTERIZER_35_RULES_SIZE] =
+ static const SPH_TweakRule RASTERIZER_35_Rules
+ [RASTERIZER_35_RULES_SIZE] =
{
/* This seems to be the only way to make these look good */
{ "Times New Roman", 0, "Regular", 'i' },
@@ -421,8 +421,8 @@
/* Don't round to the subpixel grid. Round to pixel grid. */
#define NORMAL_ROUND_RULES_SIZE 1
- const SPH_TweakRule NORMAL_ROUND_Rules
- [NORMAL_ROUND_RULES_SIZE] =
+ static const SPH_TweakRule NORMAL_ROUND_Rules
+ [NORMAL_ROUND_RULES_SIZE] =
{
/* Fix serif thickness for certain ppems */
/* Can probably be generalized somehow */
@@ -433,8 +433,8 @@
/* Skip IUP instructions if matched. */
#define SKIP_IUP_RULES_SIZE 1
- const SPH_TweakRule SKIP_IUP_Rules
- [SKIP_IUP_RULES_SIZE] =
+ static const SPH_TweakRule SKIP_IUP_Rules
+ [SKIP_IUP_RULES_SIZE] =
{
{ "Arial", 13, "Regular", 'a' },
};
@@ -443,8 +443,8 @@
/* Skip MIAP Twilight hack if matched. */
#define MIAP_HACK_RULES_SIZE 1
- const SPH_TweakRule MIAP_HACK_Rules
- [MIAP_HACK_RULES_SIZE] =
+ static const SPH_TweakRule MIAP_HACK_Rules
+ [MIAP_HACK_RULES_SIZE] =
{
{ "Geneva", 12, "", 0 },
};
@@ -453,8 +453,8 @@
/* Skip DELTAP instructions if matched. */
#define ALWAYS_SKIP_DELTAP_RULES_SIZE 23
- const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
- [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
+ static const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
+ [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
{
{ "Georgia", 0, "Regular", 'k' },
/* fix various problems with e in different versions */
@@ -489,8 +489,8 @@
/* Always do DELTAP instructions if matched. */
#define ALWAYS_DO_DELTAP_RULES_SIZE 1
- const SPH_TweakRule ALWAYS_DO_DELTAP_Rules
- [ALWAYS_DO_DELTAP_RULES_SIZE] =
+ static const SPH_TweakRule ALWAYS_DO_DELTAP_Rules
+ [ALWAYS_DO_DELTAP_RULES_SIZE] =
{
{ "-", 0, "", 0 },
};
@@ -744,7 +744,7 @@
#endif /* FORCE_NATURAL_WIDTHS */
- FT_LOCAL_DEF( FT_Bool )
+ static FT_Bool
is_member_of_family_class( const FT_String* detected_font_name,
const FT_String* rule_font_name )
{
@@ -779,7 +779,7 @@
}
- FT_LOCAL_DEF( FT_Bool )
+ static FT_Bool
is_member_of_style_class( const FT_String* detected_font_style,
const FT_String* rule_font_style )
{
@@ -903,9 +903,9 @@
sph_set_tweaks( TT_Loader loader,
FT_UInt glyph_index )
{
- TT_Face face = (TT_Face)loader->face;
+ TT_Face face = loader->face;
FT_String* family = face->root.family_name;
- int ppem = loader->size->metrics.x_ppem;
+ FT_UInt ppem = loader->size->metrics.x_ppem;
FT_String* style = face->root.style_name;
diff --git a/src/3rdparty/freetype/src/truetype/ttsubpix.h b/src/3rdparty/freetype/src/truetype/ttsubpix.h
index 8a54fc7cc7..9151aa3250 100644
--- a/src/3rdparty/freetype/src/truetype/ttsubpix.h
+++ b/src/3rdparty/freetype/src/truetype/ttsubpix.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Subpixel Hinting. */
/* */
-/* Copyright 2010-2013 by */
+/* Copyright 2010-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -50,26 +50,26 @@ FT_BEGIN_HEADER
/* Tweak flags that are set for each glyph by the below rules. */
/* */
/* */
-#define SPH_TWEAK_ALLOW_X_DMOVE 0x0000001
-#define SPH_TWEAK_ALWAYS_DO_DELTAP 0x0000002
-#define SPH_TWEAK_ALWAYS_SKIP_DELTAP 0x0000004
-#define SPH_TWEAK_COURIER_NEW_2_HACK 0x0000008
-#define SPH_TWEAK_DEEMBOLDEN 0x0000010
-#define SPH_TWEAK_DO_SHPIX 0x0000020
-#define SPH_TWEAK_EMBOLDEN 0x0000040
-#define SPH_TWEAK_MIAP_HACK 0x0000080
-#define SPH_TWEAK_NORMAL_ROUND 0x0000100
-#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP 0x0000200
-#define SPH_TWEAK_NO_CALL_AFTER_IUP 0x0000400
-#define SPH_TWEAK_NO_DELTAP_AFTER_IUP 0x0000800
-#define SPH_TWEAK_PIXEL_HINTING 0x0001000
-#define SPH_TWEAK_RASTERIZER_35 0x0002000
-#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES 0x0004000
-#define SPH_TWEAK_SKIP_IUP 0x0008000
-#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES 0x0010000
-#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES 0x0020000
-#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK 0x0040000
-#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP 0x0080000
+#define SPH_TWEAK_ALLOW_X_DMOVE 0x0000001UL
+#define SPH_TWEAK_ALWAYS_DO_DELTAP 0x0000002UL
+#define SPH_TWEAK_ALWAYS_SKIP_DELTAP 0x0000004UL
+#define SPH_TWEAK_COURIER_NEW_2_HACK 0x0000008UL
+#define SPH_TWEAK_DEEMBOLDEN 0x0000010UL
+#define SPH_TWEAK_DO_SHPIX 0x0000020UL
+#define SPH_TWEAK_EMBOLDEN 0x0000040UL
+#define SPH_TWEAK_MIAP_HACK 0x0000080UL
+#define SPH_TWEAK_NORMAL_ROUND 0x0000100UL
+#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP 0x0000200UL
+#define SPH_TWEAK_NO_CALL_AFTER_IUP 0x0000400UL
+#define SPH_TWEAK_NO_DELTAP_AFTER_IUP 0x0000800UL
+#define SPH_TWEAK_PIXEL_HINTING 0x0001000UL
+#define SPH_TWEAK_RASTERIZER_35 0x0002000UL
+#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES 0x0004000UL
+#define SPH_TWEAK_SKIP_IUP 0x0008000UL
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES 0x0010000UL
+#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES 0x0020000UL
+#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK 0x0040000UL
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP 0x0080000UL
FT_LOCAL( FT_Bool )
diff --git a/src/3rdparty/freetype/src/type1/Jamfile b/src/3rdparty/freetype/src/type1/Jamfile
index 8e366baae5..d1a3af57e9 100644
--- a/src/3rdparty/freetype/src/type1/Jamfile
+++ b/src/3rdparty/freetype/src/type1/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/type1 Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,13 @@ SubDir FT2_TOP $(FT2_SRC_DIR) type1 ;
if $(FT2_MULTI)
{
- _sources = t1afm t1driver t1objs t1load t1gload t1parse ;
+ _sources = t1afm
+ t1driver
+ t1gload
+ t1load
+ t1objs
+ t1parse
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/type1/module.mk b/src/3rdparty/freetype/src/type1/module.mk
index ade0210d76..feb3459d87 100644
--- a/src/3rdparty/freetype/src/type1/module.mk
+++ b/src/3rdparty/freetype/src/type1/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/type1/rules.mk b/src/3rdparty/freetype/src/type1/rules.mk
index 15087b0304..fbd0543531 100644
--- a/src/3rdparty/freetype/src/type1/rules.mk
+++ b/src/3rdparty/freetype/src/type1/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ T1_DIR := $(SRC_DIR)/type1
# compilation flags for the driver
#
-T1_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T1_DIR))
+T1_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(T1_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Type1 driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/type1/t1afm.c b/src/3rdparty/freetype/src/type1/t1afm.c
index de9c1997c4..7f32059f85 100644
--- a/src/3rdparty/freetype/src/type1/t1afm.c
+++ b/src/3rdparty/freetype/src/type1/t1afm.c
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
-/* Copyright 1996-2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -169,8 +169,8 @@
goto Exit;
/* now, read each kern pair */
- kp = fi->KernPairs;
- limit = p + 4 * fi->NumKernPair;
+ kp = fi->KernPairs;
+ limit = p + 4 * fi->NumKernPair;
/* PFM kerning data are stored by encoding rather than glyph index, */
/* so find the PostScript charmap of this font and install it */
@@ -362,7 +362,7 @@
FT_Fixed* kerning )
{
AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data;
- FT_Int i;
+ FT_UInt i;
if ( !fi )
diff --git a/src/3rdparty/freetype/src/type1/t1afm.h b/src/3rdparty/freetype/src/type1/t1afm.h
index 8eb1764de7..0f42f3e3a8 100644
--- a/src/3rdparty/freetype/src/type1/t1afm.h
+++ b/src/3rdparty/freetype/src/type1/t1afm.h
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2006 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/t1driver.c b/src/3rdparty/freetype/src/type1/t1driver.c
index 2602bdb6ff..571f2d2f8c 100644
--- a/src/3rdparty/freetype/src/type1/t1driver.c
+++ b/src/3rdparty/freetype/src/type1/t1driver.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 driver interface (body). */
/* */
-/* Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -32,7 +32,7 @@
#include FT_SERVICE_MULTIPLE_MASTERS_H
#include FT_SERVICE_GLYPH_DICT_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
@@ -176,9 +176,11 @@
PS_Dict_Keys key,
FT_UInt idx,
void *value,
- FT_Long value_len )
+ FT_Long value_len_ )
{
- FT_Long retval = -1;
+ FT_ULong retval = 0; /* always >= 1 if valid */
+ FT_ULong value_len = value_len_ < 0 ? 0 : (FT_ULong)value_len_;
+
T1_Face t1face = (T1_Face)face;
T1_Font type1 = &t1face->type1;
@@ -225,7 +227,7 @@
if ( idx < sizeof ( type1->font_bbox ) /
sizeof ( type1->font_bbox.xMin ) )
{
- FT_Fixed val = 0;
+ FT_Fixed val = 0;
retval = sizeof ( val );
@@ -258,7 +260,7 @@
break;
case PS_DICT_FONT_NAME:
- retval = (FT_Long)( ft_strlen( type1->font_name ) + 1 );
+ retval = ft_strlen( type1->font_name ) + 1;
if ( value && value_len >= retval )
ft_memcpy( value, (void *)( type1->font_name ), retval );
break;
@@ -278,7 +280,7 @@
case PS_DICT_CHAR_STRING_KEY:
if ( idx < (FT_UInt)type1->num_glyphs )
{
- retval = (FT_Long)( ft_strlen( type1->glyph_names[idx] ) + 1 );
+ retval = ft_strlen( type1->glyph_names[idx] ) + 1;
if ( value && value_len >= retval )
{
ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval );
@@ -290,7 +292,7 @@
case PS_DICT_CHAR_STRING:
if ( idx < (FT_UInt)type1->num_glyphs )
{
- retval = (FT_Long)( type1->charstrings_len[idx] + 1 );
+ retval = type1->charstrings_len[idx] + 1;
if ( value && value_len >= retval )
{
ft_memcpy( value, (void *)( type1->charstrings[idx] ),
@@ -310,7 +312,7 @@
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY &&
idx < (FT_UInt)type1->encoding.num_chars )
{
- retval = (FT_Long)( ft_strlen( type1->encoding.char_name[idx] ) + 1 );
+ retval = ft_strlen( type1->encoding.char_name[idx] ) + 1;
if ( value && value_len >= retval )
{
ft_memcpy( value, (void *)( type1->encoding.char_name[idx] ),
@@ -329,7 +331,7 @@
case PS_DICT_SUBR:
if ( idx < (FT_UInt)type1->num_subrs )
{
- retval = (FT_Long)( type1->subrs_len[idx] + 1 );
+ retval = type1->subrs_len[idx] + 1;
if ( value && value_len >= retval )
{
ft_memcpy( value, (void *)( type1->subrs[idx] ), retval - 1 );
@@ -523,31 +525,31 @@
break;
case PS_DICT_VERSION:
- retval = (FT_Long)( ft_strlen( type1->font_info.version ) + 1 );
+ retval = ft_strlen( type1->font_info.version ) + 1;
if ( value && value_len >= retval )
ft_memcpy( value, (void *)( type1->font_info.version ), retval );
break;
case PS_DICT_NOTICE:
- retval = (FT_Long)( ft_strlen( type1->font_info.notice ) + 1 );
+ retval = ft_strlen( type1->font_info.notice ) + 1;
if ( value && value_len >= retval )
ft_memcpy( value, (void *)( type1->font_info.notice ), retval );
break;
case PS_DICT_FULL_NAME:
- retval = (FT_Long)( ft_strlen( type1->font_info.full_name ) + 1 );
+ retval = ft_strlen( type1->font_info.full_name ) + 1;
if ( value && value_len >= retval )
ft_memcpy( value, (void *)( type1->font_info.full_name ), retval );
break;
case PS_DICT_FAMILY_NAME:
- retval = (FT_Long)( ft_strlen( type1->font_info.family_name ) + 1 );
+ retval = ft_strlen( type1->font_info.family_name ) + 1;
if ( value && value_len >= retval )
ft_memcpy( value, (void *)( type1->font_info.family_name ), retval );
break;
case PS_DICT_WEIGHT:
- retval = (FT_Long)( ft_strlen( type1->font_info.weight ) + 1 );
+ retval = ft_strlen( type1->font_info.weight ) + 1;
if ( value && value_len >= retval )
ft_memcpy( value, (void *)( type1->font_info.weight ), retval );
break;
@@ -559,7 +561,7 @@
break;
}
- return retval;
+ return retval == 0 ? -1 : (FT_Long)retval;
}
@@ -590,7 +592,7 @@
{
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name },
{ FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict },
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TYPE_1 },
{ FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info },
#ifndef T1_CONFIG_OPTION_NO_AFM
diff --git a/src/3rdparty/freetype/src/type1/t1driver.h b/src/3rdparty/freetype/src/type1/t1driver.h
index 639cd4a7ad..34bcf81ccf 100644
--- a/src/3rdparty/freetype/src/type1/t1driver.h
+++ b/src/3rdparty/freetype/src/type1/t1driver.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type 1 driver interface (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/t1errors.h b/src/3rdparty/freetype/src/type1/t1errors.h
index 8740530eef..fc7a9bd64e 100644
--- a/src/3rdparty/freetype/src/type1/t1errors.h
+++ b/src/3rdparty/freetype/src/type1/t1errors.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/t1gload.c b/src/3rdparty/freetype/src/type1/t1gload.c
index af102fd85e..85ada2ea6a 100644
--- a/src/3rdparty/freetype/src/type1/t1gload.c
+++ b/src/3rdparty/freetype/src/type1/t1gload.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2006, 2008-2010, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -54,7 +54,7 @@
/*************************************************************************/
- FT_LOCAL_DEF( FT_Error )
+ static FT_Error
T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder,
FT_UInt glyph_index,
FT_Data* char_string )
@@ -92,7 +92,7 @@
if ( !error )
error = decoder->funcs.parse_charstrings(
decoder, (FT_Byte*)char_string->pointer,
- char_string->length );
+ (FT_UInt)char_string->length );
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@@ -194,7 +194,7 @@
for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ )
{
/* now get load the unscaled outline */
- (void)T1_Parse_Glyph( &decoder, glyph_index );
+ (void)T1_Parse_Glyph( &decoder, (FT_UInt)glyph_index );
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
*max_advance = decoder.builder.advance.x;
@@ -395,7 +395,6 @@
{
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &t1glyph->metrics;
- FT_Vector advance;
/* copy the _unscaled_ advance width */
@@ -427,23 +426,26 @@
#if 1
/* apply the font matrix, if any */
- if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx ||
- font_matrix.xy != 0 || font_matrix.yx != 0 )
+ if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
+ font_matrix.xy != 0 || font_matrix.yx != 0 )
+ {
FT_Outline_Transform( &t1glyph->outline, &font_matrix );
+ metrics->horiAdvance = FT_MulFix( metrics->horiAdvance,
+ font_matrix.xx );
+ metrics->vertAdvance = FT_MulFix( metrics->vertAdvance,
+ font_matrix.yy );
+ }
+
if ( font_offset.x || font_offset.y )
+ {
FT_Outline_Translate( &t1glyph->outline,
font_offset.x,
font_offset.y );
- advance.x = metrics->horiAdvance;
- advance.y = 0;
- FT_Vector_Transform( &advance, &font_matrix );
- metrics->horiAdvance = advance.x + font_offset.x;
- advance.x = 0;
- advance.y = metrics->vertAdvance;
- FT_Vector_Transform( &advance, &font_matrix );
- metrics->vertAdvance = advance.y + font_offset.y;
+ metrics->horiAdvance += font_offset.x;
+ metrics->vertAdvance += font_offset.y;
+ }
#endif
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
@@ -504,7 +506,7 @@
/* Set the control data to null - it is no longer available if */
/* loaded incrementally. */
- t1glyph->control_data = 0;
+ t1glyph->control_data = NULL;
t1glyph->control_len = 0;
}
#endif
diff --git a/src/3rdparty/freetype/src/type1/t1gload.h b/src/3rdparty/freetype/src/type1/t1gload.h
index 0bdea3a8d5..05f60d586a 100644
--- a/src/3rdparty/freetype/src/type1/t1gload.h
+++ b/src/3rdparty/freetype/src/type1/t1gload.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2008, 2011 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/t1load.c b/src/3rdparty/freetype/src/type1/t1load.c
index 22b3f6b31d..dbf4eafd71 100644
--- a/src/3rdparty/freetype/src/type1/t1load.c
+++ b/src/3rdparty/freetype/src/type1/t1load.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 font loader (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -226,7 +226,7 @@
/* Given a normalized (blend) coordinate, figure out the design */
/* coordinate appropriate for that value. */
/* */
- FT_LOCAL_DEF( FT_Fixed )
+ static FT_Fixed
mm_axis_unmap( PS_DesignMap axismap,
FT_Fixed ncv )
{
@@ -255,7 +255,7 @@
/* Given a vector of weights, one for each design, figure out the */
/* normalized axis coordinates which gave rise to those weights. */
/* */
- FT_LOCAL_DEF( void )
+ static void
mm_weights_unmap( FT_Fixed* weights,
FT_Fixed* axiscoords,
FT_UInt axis_count )
@@ -368,44 +368,43 @@
FT_Fixed* coords )
{
PS_Blend blend = face->blend;
- FT_Error error;
FT_UInt n, m;
- error = FT_ERR( Invalid_Argument );
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ if ( num_coords > blend->num_axis )
+ num_coords = blend->num_axis;
- if ( blend && blend->num_axis == num_coords )
+ /* recompute the weight vector from the blend coordinates */
+ for ( n = 0; n < blend->num_designs; n++ )
{
- /* recompute the weight vector from the blend coordinates */
- for ( n = 0; n < blend->num_designs; n++ )
- {
- FT_Fixed result = 0x10000L; /* 1.0 fixed */
+ FT_Fixed result = 0x10000L; /* 1.0 fixed */
- for ( m = 0; m < blend->num_axis; m++ )
- {
- FT_Fixed factor;
+ for ( m = 0; m < blend->num_axis; m++ )
+ {
+ FT_Fixed factor;
- /* get current blend axis position */
- factor = coords[m];
- if ( factor < 0 )
- factor = 0;
- if ( factor > 0x10000L )
- factor = 0x10000L;
+ /* get current blend axis position; */
+ /* use a default value if we don't have a coordinate */
+ factor = m < num_coords ? coords[m] : 0x8000;
+ if ( factor < 0 )
+ factor = 0;
+ if ( factor > 0x10000L )
+ factor = 0x10000L;
- if ( ( n & ( 1 << m ) ) == 0 )
- factor = 0x10000L - factor;
+ if ( ( n & ( 1 << m ) ) == 0 )
+ factor = 0x10000L - factor;
- result = FT_MulFix( result, factor );
- }
- blend->weight_vector[n] = result;
+ result = FT_MulFix( result, factor );
}
-
- error = FT_Err_Ok;
+ blend->weight_vector[n] = result;
}
- return error;
+ return FT_Err_Ok;
}
@@ -415,68 +414,72 @@
FT_Long* coords )
{
PS_Blend blend = face->blend;
- FT_Error error;
FT_UInt n, p;
+ FT_Fixed final_blends[T1_MAX_MM_DESIGNS];
- error = FT_ERR( Invalid_Argument );
- if ( blend && blend->num_axis == num_coords )
- {
- /* compute the blend coordinates through the blend design map */
- FT_Fixed final_blends[T1_MAX_MM_DESIGNS];
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+ if ( num_coords > blend->num_axis )
+ num_coords = blend->num_axis;
- for ( n = 0; n < blend->num_axis; n++ )
- {
- FT_Long design = coords[n];
- FT_Fixed the_blend;
- PS_DesignMap map = blend->design_map + n;
- FT_Long* designs = map->design_points;
- FT_Fixed* blends = map->blend_points;
- FT_Int before = -1, after = -1;
+ /* compute the blend coordinates through the blend design map */
+ for ( n = 0; n < blend->num_axis; n++ )
+ {
+ FT_Long design;
+ FT_Fixed the_blend;
+ PS_DesignMap map = blend->design_map + n;
+ FT_Long* designs = map->design_points;
+ FT_Fixed* blends = map->blend_points;
+ FT_Int before = -1, after = -1;
- for ( p = 0; p < (FT_UInt)map->num_points; p++ )
- {
- FT_Long p_design = designs[p];
+ /* use a default value if we don't have a coordinate */
+ if ( n < num_coords )
+ design = coords[n];
+ else
+ design = ( designs[map->num_points - 1] - designs[0] ) / 2;
- /* exact match? */
- if ( design == p_design )
- {
- the_blend = blends[p];
- goto Found;
- }
+ for ( p = 0; p < (FT_UInt)map->num_points; p++ )
+ {
+ FT_Long p_design = designs[p];
- if ( design < p_design )
- {
- after = p;
- break;
- }
- before = p;
+ /* exact match? */
+ if ( design == p_design )
+ {
+ the_blend = blends[p];
+ goto Found;
}
- /* now interpolate if necessary */
- if ( before < 0 )
- the_blend = blends[0];
+ if ( design < p_design )
+ {
+ after = (FT_Int)p;
+ break;
+ }
- else if ( after < 0 )
- the_blend = blends[map->num_points - 1];
+ before = (FT_Int)p;
+ }
- else
- the_blend = FT_MulDiv( design - designs[before],
- blends [after] - blends [before],
- designs[after] - designs[before] );
+ /* now interpolate if necessary */
+ if ( before < 0 )
+ the_blend = blends[0];
- Found:
- final_blends[n] = the_blend;
- }
+ else if ( after < 0 )
+ the_blend = blends[map->num_points - 1];
- error = T1_Set_MM_Blend( face, num_coords, final_blends );
+ else
+ the_blend = FT_MulDiv( design - designs[before],
+ blends [after] - blends [before],
+ designs[after] - designs[before] );
+
+ Found:
+ final_blends[n] = the_blend;
}
- return error;
+ return T1_Set_MM_Blend( face, blend->num_axis, final_blends );
}
@@ -490,20 +493,17 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
- FT_Long lcoords[4]; /* maximum axis count is 4 */
- FT_UInt i;
- FT_Error error;
+ FT_Long lcoords[T1_MAX_MM_AXIS];
+ FT_UInt i;
+
+ if ( num_coords > T1_MAX_MM_AXIS )
+ num_coords = T1_MAX_MM_AXIS;
- error = FT_ERR( Invalid_Argument );
- if ( num_coords <= 4 && num_coords > 0 )
- {
- for ( i = 0; i < num_coords; ++i )
- lcoords[i] = FIXED_TO_INT( coords[i] );
- error = T1_Set_MM_Design( face, num_coords, lcoords );
- }
+ for ( i = 0; i < num_coords; ++i )
+ lcoords[i] = FIXED_TO_INT( coords[i] );
- return error;
+ return T1_Set_MM_Design( face, num_coords, lcoords );
}
@@ -599,23 +599,32 @@
/* each token is an immediate containing the name of the axis */
for ( n = 0; n < num_axis; n++ )
{
- T1_Token token = axis_tokens + n;
- FT_Byte* name;
- FT_PtrDist len;
+ T1_Token token = axis_tokens + n;
+ FT_Byte* name;
+ FT_UInt len;
/* skip first slash, if any */
if ( token->start[0] == '/' )
token->start++;
- len = token->limit - token->start;
+ len = (FT_UInt)( token->limit - token->start );
if ( len == 0 )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
- if ( FT_ALLOC( blend->axis_names[n], (FT_Long)( len + 1 ) ) )
+ name = (FT_Byte*)blend->axis_names[n];
+ if ( name )
+ {
+ FT_TRACE0(( "parse_blend_axis_types:"
+ " overwriting axis name `%s' with `%*.s'\n",
+ name, len, token->start ));
+ FT_FREE( name );
+ }
+
+ if ( FT_ALLOC( blend->axis_names[n], len + 1 ) )
goto Exit;
name = (FT_Byte*)blend->axis_names[n];
@@ -692,7 +701,9 @@
}
num_axis = n_axis;
- error = t1_allocate_blend( face, num_designs, num_axis );
+ error = t1_allocate_blend( face,
+ (FT_UInt)num_designs,
+ (FT_UInt)num_axis );
if ( error )
goto Exit;
blend = face->blend;
@@ -757,7 +768,7 @@
old_cursor = parser->root.cursor;
old_limit = parser->root.limit;
- error = t1_allocate_blend( face, 0, num_axis );
+ error = t1_allocate_blend( face, 0, (FT_UInt)num_axis );
if ( error )
goto Exit;
blend = face->blend;
@@ -785,6 +796,13 @@
goto Exit;
}
+ if ( map->design_points )
+ {
+ FT_ERROR(( "parse_blend_design_map: duplicate table\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
/* allocate design map data */
if ( FT_NEW_ARRAY( map->design_points, num_points * 2 ) )
goto Exit;
@@ -848,7 +866,7 @@
if ( !blend || !blend->num_designs )
{
- error = t1_allocate_blend( face, num_designs, 0 );
+ error = t1_allocate_blend( face, (FT_UInt)num_designs, 0 );
if ( error )
goto Exit;
blend = face->blend;
@@ -890,8 +908,8 @@
parse_buildchar( T1_Face face,
T1_Loader loader )
{
- face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 );
-
+ face->len_buildchar = (FT_UInt)T1_ToFixedArray( &loader->parser,
+ 0, NULL, 0 );
return;
}
@@ -1038,9 +1056,11 @@
}
+ /* return 1 in case of success */
+
static int
read_binary_data( T1_Parser parser,
- FT_Long* size,
+ FT_ULong* size,
FT_Byte** base,
FT_Bool incremental )
{
@@ -1072,7 +1092,7 @@
if ( s >= 0 && s < limit - *base )
{
parser->root.cursor += s + 1;
- *size = s;
+ *size = (FT_ULong)s;
return !parser->root.error;
}
}
@@ -1103,6 +1123,7 @@
FT_Int result;
+ /* input is scaled by 1000 to accommodate default FontMatrix */
result = T1_ToFixedArray( parser, 6, temp, 3 );
if ( result < 6 )
@@ -1120,15 +1141,12 @@
return;
}
- /* Set Units per EM based on FontMatrix values. We set the value to */
- /* 1000 / temp_scale, because temp_scale was already multiplied by */
- /* 1000 (in t1_tofixed, from psobjs.c). */
-
- root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
-
- /* we need to scale the values by 1.0/temp_scale */
+ /* atypical case */
if ( temp_scale != 0x10000L )
{
+ /* set units per EM based on FontMatrix values */
+ root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
+
temp[0] = FT_DivFix( temp[0], temp_scale );
temp[1] = FT_DivFix( temp[1], temp_scale );
temp[2] = FT_DivFix( temp[2], temp_scale );
@@ -1190,10 +1208,27 @@
else
count = (FT_Int)T1_ToInt( parser );
+ /* only composite fonts (which we don't support) */
+ /* can have larger values */
+ if ( count > 256 )
+ {
+ FT_ERROR(( "parse_encoding: invalid encoding array size\n" ));
+ parser->root.error = FT_THROW( Invalid_File_Format );
+ return;
+ }
+
T1_Skip_Spaces( parser );
if ( parser->root.cursor >= limit )
return;
+ /* PostScript happily allows overwriting of encoding arrays */
+ if ( encode->char_index )
+ {
+ FT_FREE( encode->char_index );
+ FT_FREE( encode->char_name );
+ T1_Release_Table( char_table );
+ }
+
/* we use a T1_Table to store our charnames */
loader->num_chars = encode->num_chars = count;
if ( FT_NEW_ARRAY( encode->char_index, count ) ||
@@ -1285,7 +1320,7 @@
if ( cur + 2 < limit && *cur == '/' && n < count )
{
- FT_PtrDist len;
+ FT_UInt len;
cur++;
@@ -1297,7 +1332,7 @@
if ( parser->root.error )
return;
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
parser->root.error = T1_Add_Table( char_table, charcode,
cur, len + 1 );
@@ -1407,7 +1442,8 @@
/* */
for (;;)
{
- FT_Long idx, size;
+ FT_Long idx;
+ FT_ULong size;
FT_Byte* base;
@@ -1457,7 +1493,7 @@
/* some fonts define empty subr records -- this is not totally */
/* compliant to the specification (which says they should at */
/* least contain a `return'), but we support them anyway */
- if ( size < face->type1.private_dict.lenIV )
+ if ( size < (FT_ULong)face->type1.private_dict.lenIV )
{
error = FT_THROW( Invalid_File_Format );
goto Fail;
@@ -1468,7 +1504,7 @@
goto Fail;
FT_MEM_COPY( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 );
- size -= face->type1.private_dict.lenIV;
+ size -= (FT_ULong)face->type1.private_dict.lenIV;
error = T1_Add_Table( table, (FT_Int)idx,
temp + face->type1.private_dict.lenIV, size );
FT_FREE( temp );
@@ -1505,10 +1541,10 @@
PSAux_Service psaux = (PSAux_Service)face->psaux;
- FT_Byte* cur;
+ FT_Byte* cur = parser->root.cursor;
FT_Byte* limit = parser->root.limit;
FT_Int n, num_glyphs;
- FT_UInt notdef_index = 0;
+ FT_Int notdef_index = 0;
FT_Byte notdef_found = 0;
@@ -1519,6 +1555,15 @@
goto Fail;
}
+ /* we certainly need more than 8 bytes per glyph */
+ if ( num_glyphs > ( limit - cur ) >> 3 )
+ {
+ FT_TRACE0(( "parse_charstrings: adjusting number of glyphs"
+ " (from %d to %d)\n",
+ num_glyphs, ( limit - cur ) >> 3 ));
+ num_glyphs = ( limit - cur ) >> 3;
+ }
+
/* some fonts like Optima-Oblique not only define the /CharStrings */
/* array but access it also */
if ( num_glyphs == 0 || parser->root.error )
@@ -1555,7 +1600,7 @@
for (;;)
{
- FT_Long size;
+ FT_ULong size;
FT_Byte* base;
@@ -1606,7 +1651,7 @@
if ( *cur == '/' )
{
- FT_PtrDist len;
+ FT_UInt len;
if ( cur + 2 >= limit )
@@ -1616,7 +1661,7 @@
}
cur++; /* skip `/' */
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
return;
@@ -1649,7 +1694,7 @@
FT_Byte* temp;
- if ( size <= face->type1.private_dict.lenIV )
+ if ( size <= (FT_ULong)face->type1.private_dict.lenIV )
{
error = FT_THROW( Invalid_File_Format );
goto Fail;
@@ -1660,7 +1705,7 @@
goto Fail;
FT_MEM_COPY( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 );
- size -= face->type1.private_dict.lenIV;
+ size -= (FT_ULong)face->type1.private_dict.lenIV;
error = T1_Add_Table( code_table, n,
temp + face->type1.private_dict.lenIV, size );
FT_FREE( temp );
@@ -1838,15 +1883,11 @@
};
-#define T1_FIELD_COUNT \
- ( sizeof ( t1_keywords ) / sizeof ( t1_keywords[0] ) )
-
-
static FT_Error
parse_dict( T1_Face face,
T1_Loader loader,
FT_Byte* base,
- FT_Long size )
+ FT_ULong size )
{
T1_Parser parser = &loader->parser;
FT_Byte *limit, *start_binary = NULL;
@@ -1902,7 +1943,7 @@
else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' &&
have_integer )
{
- FT_Long s;
+ FT_ULong s;
FT_Byte* b;
@@ -1915,7 +1956,7 @@
else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' &&
have_integer )
{
- FT_Long s;
+ FT_ULong s;
FT_Byte* b;
@@ -1928,7 +1969,7 @@
/* look for immediates */
else if ( *cur == '/' && cur + 2 < limit )
{
- FT_PtrDist len;
+ FT_UInt len;
cur++;
@@ -1938,7 +1979,7 @@
if ( parser->root.error )
goto Exit;
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
if ( len > 0 && len < 22 && parser->root.cursor < limit )
{
@@ -1955,9 +1996,9 @@
if ( !name )
break;
- if ( cur[0] == name[0] &&
- len == (FT_PtrDist)ft_strlen( (const char *)name ) &&
- ft_memcmp( cur, name, len ) == 0 )
+ if ( cur[0] == name[0] &&
+ len == ft_strlen( (const char *)name ) &&
+ ft_memcmp( cur, name, len ) == 0 )
{
/* We found it -- run the parsing callback! */
/* We record every instance of every field */
@@ -2212,8 +2253,8 @@
/* the `lengths' field must be released later */
type1->glyph_names_block = loader.glyph_names.block;
type1->glyph_names = (FT_String**)loader.glyph_names.elements;
- loader.glyph_names.block = 0;
- loader.glyph_names.elements = 0;
+ loader.glyph_names.block = NULL;
+ loader.glyph_names.elements = NULL;
/* we must now build type1.encoding when we have a custom array */
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
diff --git a/src/3rdparty/freetype/src/type1/t1load.h b/src/3rdparty/freetype/src/type1/t1load.h
index 546fc33530..de422e7ecd 100644
--- a/src/3rdparty/freetype/src/type1/t1load.h
+++ b/src/3rdparty/freetype/src/type1/t1load.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 font loader (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/t1objs.c b/src/3rdparty/freetype/src/type1/t1objs.c
index e11770feef..d921063eaa 100644
--- a/src/3rdparty/freetype/src/type1/t1objs.c
+++ b/src/3rdparty/freetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
-/* Copyright 1996-2009, 2011, 2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -86,7 +86,7 @@
if ( funcs )
funcs->destroy( (PSH_Globals)size->root.internal );
- size->root.internal = 0;
+ size->root.internal = NULL;
}
}
@@ -144,7 +144,7 @@
FT_LOCAL_DEF( void )
T1_GlyphSlot_Done( FT_GlyphSlot slot )
{
- slot->internal->glyph_hints = 0;
+ slot->internal->glyph_hints = NULL;
}
@@ -224,7 +224,7 @@
}
T1_Done_Blend( face );
- face->blend = 0;
+ face->blend = NULL;
#endif
/* release font info strings */
@@ -345,7 +345,7 @@
goto Exit;
/* check the face index */
- if ( face_index > 0 )
+ if ( ( face_index & 0xFFFF ) > 0 )
{
FT_ERROR(( "T1_Face_Init: invalid face index\n" ));
error = FT_THROW( Invalid_Argument );
@@ -375,9 +375,6 @@
if ( face->blend )
root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
- /* XXX: TODO -- add kerning with .afm support */
-
-
/* The following code to extract the family and the style is very */
/* simplistic and might get some things wrong. For a full-featured */
/* algorithm you might have a look at the whitepaper given at */
@@ -457,7 +454,7 @@
/* no embedded bitmap support */
root->num_fixed_sizes = 0;
- root->available_sizes = 0;
+ root->available_sizes = NULL;
root->bbox.xMin = type1->font_bbox.xMin >> 16;
root->bbox.yMin = type1->font_bbox.yMin >> 16;
diff --git a/src/3rdparty/freetype/src/type1/t1objs.h b/src/3rdparty/freetype/src/type1/t1objs.h
index 54ccbb996a..6b4f3cb56d 100644
--- a/src/3rdparty/freetype/src/type1/t1objs.h
+++ b/src/3rdparty/freetype/src/type1/t1objs.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2006, 2011 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/t1parse.c b/src/3rdparty/freetype/src/type1/t1parse.c
index ccf9f4cc56..0b68502606 100644
--- a/src/3rdparty/freetype/src/type1/t1parse.c
+++ b/src/3rdparty/freetype/src/type1/t1parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (body). */
/* */
-/* Copyright 1996-2005, 2008, 2009, 2012-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -143,13 +143,13 @@
FT_ULong size;
- psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
+ psaux->ps_parser_funcs->init( &parser->root, NULL, NULL, memory );
parser->stream = stream;
parser->base_len = 0;
- parser->base_dict = 0;
+ parser->base_dict = NULL;
parser->private_len = 0;
- parser->private_dict = 0;
+ parser->private_dict = NULL;
parser->in_pfb = 0;
parser->in_memory = 0;
parser->single_block = 0;
@@ -273,7 +273,7 @@
/* made of several segments. We thus first read the number of */
/* segments to compute the total size of the private dictionary */
/* then re-read them into memory. */
- FT_Long start_pos = FT_STREAM_POS();
+ FT_ULong start_pos = FT_STREAM_POS();
FT_UShort tag;
@@ -334,7 +334,6 @@
/* first of all, look at the `eexec' keyword */
FT_Byte* cur = parser->base_dict;
FT_Byte* limit = cur + parser->base_len;
- FT_Byte c;
FT_Pointer pos_lf;
FT_Bool test_cr;
@@ -342,9 +341,9 @@
Again:
for (;;)
{
- c = cur[0];
- if ( c == 'e' && cur + 9 < limit ) /* 9 = 5 letters for `eexec' + */
- /* whitespace + 4 chars */
+ if ( cur[0] == 'e' &&
+ cur + 9 < limit ) /* 9 = 5 letters for `eexec' + */
+ /* whitespace + 4 chars */
{
if ( cur[1] == 'e' &&
cur[2] == 'x' &&
@@ -374,8 +373,15 @@
while ( cur < limit )
{
- if ( *cur == 'e' && ft_strncmp( (char*)cur, "eexec", 5 ) == 0 )
- goto Found;
+ if ( cur[0] == 'e' &&
+ cur + 5 < limit )
+ {
+ if ( cur[1] == 'e' &&
+ cur[2] == 'x' &&
+ cur[3] == 'e' &&
+ cur[4] == 'c' )
+ goto Found;
+ }
T1_Skip_PS_Token( parser );
if ( parser->root.error )
@@ -389,6 +395,15 @@
cur = limit;
limit = parser->base_dict + parser->base_len;
+
+ if ( cur >= limit )
+ {
+ FT_ERROR(( "T1_Get_Private_Dict:"
+ " premature end in private dictionary\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
goto Again;
/* now determine where to write the _encrypted_ binary private */
@@ -411,9 +426,11 @@
/* fine that are violating this limitation, so we add a heuristic */
/* test to stop at \r only if it is not used for EOL. */
- pos_lf = ft_memchr( cur, '\n', limit - cur );
- test_cr = FT_BOOL( !pos_lf ||
- pos_lf > ft_memchr( cur, '\r', limit - cur ) );
+ pos_lf = ft_memchr( cur, '\n', (size_t)( limit - cur ) );
+ test_cr = FT_BOOL( !pos_lf ||
+ pos_lf > ft_memchr( cur,
+ '\r',
+ (size_t)( limit - cur ) ) );
while ( cur < limit &&
( *cur == ' ' ||
@@ -429,7 +446,7 @@
goto Exit;
}
- size = (FT_ULong)( parser->base_len - ( cur - parser->base_dict ) );
+ size = parser->base_len - (FT_ULong)( cur - parser->base_dict );
if ( parser->in_memory )
{
@@ -443,7 +460,7 @@
parser->single_block = 1;
parser->private_dict = parser->base_dict;
parser->private_len = size;
- parser->base_dict = 0;
+ parser->base_dict = NULL;
parser->base_len = 0;
}
@@ -459,7 +476,7 @@
ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) )
{
/* ASCII hexadecimal encoding */
- FT_Long len;
+ FT_ULong len;
parser->root.cursor = cur;
diff --git a/src/3rdparty/freetype/src/type1/t1parse.h b/src/3rdparty/freetype/src/type1/t1parse.h
index fb1c8a8830..93b02e3d31 100644
--- a/src/3rdparty/freetype/src/type1/t1parse.h
+++ b/src/3rdparty/freetype/src/type1/t1parse.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2008 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -77,12 +77,6 @@ FT_BEGIN_HEADER
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
-#define T1_Done_Table( p ) \
- do \
- { \
- if ( (p)->funcs.done ) \
- (p)->funcs.done( p ); \
- } while ( 0 )
#define T1_Release_Table( p ) \
do \
{ \
diff --git a/src/3rdparty/freetype/src/type1/t1tokens.h b/src/3rdparty/freetype/src/type1/t1tokens.h
index e37276b908..3992652435 100644
--- a/src/3rdparty/freetype/src/type1/t1tokens.h
+++ b/src/3rdparty/freetype/src/type1/t1tokens.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 tokenizer (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type1/type1.c b/src/3rdparty/freetype/src/type1/type1.c
index ccc12be103..4c70ea7630 100644
--- a/src/3rdparty/freetype/src/type1/type1.c
+++ b/src/3rdparty/freetype/src/type1/type1.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Type 1 driver component (body only). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type42/Jamfile b/src/3rdparty/freetype/src/type42/Jamfile
index 00371d54f3..722953d37f 100644
--- a/src/3rdparty/freetype/src/type42/Jamfile
+++ b/src/3rdparty/freetype/src/type42/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/type42 Jamfile
#
-# Copyright 2002 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -16,7 +16,10 @@ SubDir FT2_TOP $(FT2_SRC_DIR) type42 ;
if $(FT2_MULTI)
{
- _sources = t42objs t42parse t42drivr ;
+ _sources = t42drivr
+ t42objs
+ t42parse
+ ;
}
else
{
diff --git a/src/3rdparty/freetype/src/type42/module.mk b/src/3rdparty/freetype/src/type42/module.mk
index b3f10a8d3c..af7e651d95 100644
--- a/src/3rdparty/freetype/src/type42/module.mk
+++ b/src/3rdparty/freetype/src/type42/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002, 2006 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/type42/rules.mk b/src/3rdparty/freetype/src/type42/rules.mk
index eac1081eb1..4a8efca507 100644
--- a/src/3rdparty/freetype/src/type42/rules.mk
+++ b/src/3rdparty/freetype/src/type42/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002, 2003, 2008 by
+# Copyright 2002-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -20,7 +20,10 @@ T42_DIR := $(SRC_DIR)/type42
# compilation flags for the driver
#
-T42_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T42_DIR))
+T42_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(T42_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Type42 driver source
diff --git a/src/3rdparty/freetype/src/type42/t42drivr.c b/src/3rdparty/freetype/src/type42/t42drivr.c
index 3ad1bde79f..2907096c9f 100644
--- a/src/3rdparty/freetype/src/type42/t42drivr.c
+++ b/src/3rdparty/freetype/src/type42/t42drivr.c
@@ -4,7 +4,7 @@
/* */
/* High-level Type 42 driver interface (body). */
/* */
-/* Copyright 2002-2004, 2006, 2007, 2009, 2011, 2013 by */
+/* Copyright 2002-2015 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,7 +41,7 @@
#include "t42error.h"
#include FT_INTERNAL_DEBUG_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
@@ -180,7 +180,7 @@
{ FT_SERVICE_ID_GLYPH_DICT, &t42_service_glyph_dict },
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name },
{ FT_SERVICE_ID_POSTSCRIPT_INFO, &t42_service_ps_info },
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_42 },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TYPE_42 },
{ NULL, NULL }
};
diff --git a/src/3rdparty/freetype/src/type42/t42drivr.h b/src/3rdparty/freetype/src/type42/t42drivr.h
index 9a1e97e30e..b4d1753a23 100644
--- a/src/3rdparty/freetype/src/type42/t42drivr.h
+++ b/src/3rdparty/freetype/src/type42/t42drivr.h
@@ -4,7 +4,8 @@
/* */
/* High-level Type 42 driver interface (specification). */
/* */
-/* Copyright 2002 by Roberto Alameda. */
+/* Copyright 2002-2015 by */
+/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
diff --git a/src/3rdparty/freetype/src/type42/t42error.h b/src/3rdparty/freetype/src/type42/t42error.h
index 217ae8bd52..cddaf9e9ca 100644
--- a/src/3rdparty/freetype/src/type42/t42error.h
+++ b/src/3rdparty/freetype/src/type42/t42error.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 error codes (specification only). */
/* */
-/* Copyright 2002, 2003, 2012 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/type42/t42objs.c b/src/3rdparty/freetype/src/type42/t42objs.c
index 915e81fe74..430871aced 100644
--- a/src/3rdparty/freetype/src/type42/t42objs.c
+++ b/src/3rdparty/freetype/src/type42/t42objs.c
@@ -4,8 +4,8 @@
/* */
/* Type 42 objects manager (body). */
/* */
-/* Copyright 2002-2009, 2011, 2013 */
-/* by Roberto Alameda. */
+/* Copyright 2002-2015 by */
+/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -92,8 +92,8 @@
/* the `lengths' field must be released later */
type1->glyph_names_block = loader.glyph_names.block;
type1->glyph_names = (FT_String**)loader.glyph_names.elements;
- loader.glyph_names.block = 0;
- loader.glyph_names.elements = 0;
+ loader.glyph_names.block = NULL;
+ loader.glyph_names.elements = NULL;
/* we must now build type1.encoding when we have a custom array */
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
@@ -208,7 +208,7 @@
goto Exit;
/* check the face index */
- if ( face_index > 0 )
+ if ( ( face_index & 0xFFFF ) > 0 )
{
FT_ERROR(( "T42_Face_Init: invalid face index\n" ));
error = FT_THROW( Invalid_Argument );
@@ -285,7 +285,7 @@
/* no embedded bitmap support */
root->num_fixed_sizes = 0;
- root->available_sizes = 0;
+ root->available_sizes = NULL;
/* Load the TTF font embedded in the T42 font */
{
@@ -461,8 +461,8 @@
FT_FREE( face->unicode_map.maps );
face->unicode_map.num_maps = 0;
- face->root.family_name = 0;
- face->root.style_name = 0;
+ face->root.family_name = NULL;
+ face->root.style_name = NULL;
}
@@ -632,10 +632,10 @@
slot->bitmap_left = 0;
slot->bitmap_top = 0;
slot->num_subglyphs = 0;
- slot->subglyphs = 0;
- slot->control_data = 0;
+ slot->subglyphs = NULL;
+ slot->control_data = NULL;
slot->control_len = 0;
- slot->other = 0;
+ slot->other = NULL;
slot->format = FT_GLYPH_FORMAT_NONE;
slot->linearHoriAdvance = 0;
@@ -652,11 +652,16 @@
FT_Error error;
T42_GlyphSlot t42slot = (T42_GlyphSlot)glyph;
T42_Size t42size = (T42_Size)size;
+ T42_Face t42face = (T42_Face)size->face;
FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;
FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index ));
+ /* map T42 glyph index to embedded TTF's glyph index */
+ glyph_index = (FT_UInt)ft_atol(
+ (const char *)t42face->type1.charstrings[glyph_index] );
+
t42_glyphslot_clear( t42slot->ttslot );
error = ttclazz->load_glyph( t42slot->ttslot,
t42size->ttsize,
diff --git a/src/3rdparty/freetype/src/type42/t42objs.h b/src/3rdparty/freetype/src/type42/t42objs.h
index 02d13259be..3722c670f0 100644
--- a/src/3rdparty/freetype/src/type42/t42objs.h
+++ b/src/3rdparty/freetype/src/type42/t42objs.h
@@ -4,7 +4,8 @@
/* */
/* Type 42 objects manager (specification). */
/* */
-/* Copyright 2002, 2003, 2006, 2007, 2011 by Roberto Alameda. */
+/* Copyright 2002-2015 by */
+/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -55,7 +56,6 @@ FT_BEGIN_HEADER
{
FT_DriverRec root;
FT_Driver_Class ttclazz;
- void* extension_component;
} T42_DriverRec, *T42_Driver;
diff --git a/src/3rdparty/freetype/src/type42/t42parse.c b/src/3rdparty/freetype/src/type42/t42parse.c
index 50708537df..003b63ed77 100644
--- a/src/3rdparty/freetype/src/type42/t42parse.c
+++ b/src/3rdparty/freetype/src/type42/t42parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (body). */
/* */
-/* Copyright 2002-2014 by */
+/* Copyright 2002-2015 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -104,12 +104,6 @@
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
-#define T1_Done_Table( p ) \
- do \
- { \
- if ( (p)->funcs.done ) \
- (p)->funcs.done( p ); \
- } while ( 0 )
#define T1_Release_Table( p ) \
do \
{ \
@@ -148,11 +142,11 @@
FT_Long size;
- psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
+ psaux->ps_parser_funcs->init( &parser->root, NULL, NULL, memory );
parser->stream = stream;
parser->base_len = 0;
- parser->base_dict = 0;
+ parser->base_dict = NULL;
parser->in_memory = 0;
/*******************************************************************/
@@ -184,7 +178,7 @@
if ( error || FT_STREAM_SEEK( 0 ) )
goto Exit;
- size = stream->size;
+ size = (FT_Long)stream->size;
/* now, try to load `size' bytes of the `base' dictionary we */
/* found previously */
@@ -252,13 +246,12 @@
T42_Parser parser = &loader->parser;
FT_Matrix* matrix = &face->type1.font_matrix;
FT_Vector* offset = &face->type1.font_offset;
- FT_Face root = (FT_Face)&face->root;
FT_Fixed temp[6];
FT_Fixed temp_scale;
FT_Int result;
- result = T1_ToFixedArray( parser, 6, temp, 3 );
+ result = T1_ToFixedArray( parser, 6, temp, 0 );
if ( result < 6 )
{
@@ -270,18 +263,12 @@
if ( temp_scale == 0 )
{
- FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" ));
+ FT_ERROR(( "t42_parse_font_matrix: invalid font matrix\n" ));
parser->root.error = FT_THROW( Invalid_File_Format );
return;
}
- /* Set Units per EM based on FontMatrix values. We set the value to */
- /* 1000 / temp_scale, because temp_scale was already multiplied by */
- /* 1000 (in t1_tofixed, from psobjs.c). */
-
- root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
-
- /* we need to scale the values by 1.0/temp_scale */
+ /* atypical case */
if ( temp_scale != 0x10000L )
{
temp[0] = FT_DivFix( temp[0], temp_scale );
@@ -345,10 +332,27 @@
else
count = (FT_Int)T1_ToInt( parser );
+ /* only composite fonts (which we don't support) */
+ /* can have larger values */
+ if ( count > 256 )
+ {
+ FT_ERROR(( "t42_parse_encoding: invalid encoding array size\n" ));
+ parser->root.error = FT_THROW( Invalid_File_Format );
+ return;
+ }
+
T1_Skip_Spaces( parser );
if ( parser->root.cursor >= limit )
return;
+ /* PostScript happily allows overwriting of encoding arrays */
+ if ( encode->char_index )
+ {
+ FT_FREE( encode->char_index );
+ FT_FREE( encode->char_name );
+ T1_Release_Table( char_table );
+ }
+
/* we use a T1_Table to store our charnames */
loader->num_chars = encode->num_chars = count;
if ( FT_NEW_ARRAY( encode->char_index, count ) ||
@@ -427,13 +431,20 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ return;
+ }
}
cur = parser->root.cursor;
if ( cur + 2 < limit && *cur == '/' && n < count )
{
- FT_PtrDist len;
+ FT_UInt len;
cur++;
@@ -445,7 +456,7 @@
if ( parser->root.error )
return;
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
parser->root.error = T1_Add_Table( char_table, charcode,
cur, len + 1 );
@@ -461,10 +472,10 @@
/* immediates-only mode we would get an infinite loop if */
/* we don't do anything here. */
/* */
- /* This encoding array is not valid according to the type1 */
- /* specification (it might be an encoding for a CID type1 */
- /* font, however), so we conclude that this font is NOT a */
- /* type1 font. */
+ /* This encoding array is not valid according to the */
+ /* type42 specification (it might be an encoding for a CID */
+ /* type42 font, however), so we conclude that this font is */
+ /* NOT a type42 font. */
parser->root.error = FT_THROW( Unknown_File_Format );
return;
}
@@ -500,7 +511,7 @@
face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
else
- parser->root.error = FT_THROW( Ignore );
+ parser->root.error = FT_ERR( Ignore );
}
}
@@ -524,9 +535,9 @@
FT_Byte* limit = parser->root.limit;
FT_Error error;
FT_Int num_tables = 0;
- FT_ULong count;
+ FT_Long count;
- FT_Long n, string_size, old_string_size, real_size;
+ FT_ULong n, string_size, old_string_size, real_size;
FT_Byte* string_buf = NULL;
FT_Bool allocated = 0;
@@ -579,7 +590,7 @@
goto Exit;
/* don't include delimiters */
- string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 );
+ string_size = (FT_ULong)( ( parser->root.cursor - cur - 2 + 1 ) / 2 );
if ( !string_size )
{
FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
@@ -594,11 +605,14 @@
parser->root.cursor = cur;
(void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 );
old_string_size = string_size;
- string_size = real_size;
+ string_size = real_size;
}
else if ( ft_isdigit( *cur ) )
{
+ FT_Long tmp;
+
+
if ( allocated )
{
FT_ERROR(( "t42_parse_sfnts: "
@@ -607,13 +621,15 @@
goto Fail;
}
- string_size = T1_ToInt( parser );
- if ( string_size < 0 )
+ tmp = T1_ToInt( parser );
+ if ( tmp < 0 )
{
FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
error = FT_THROW( Invalid_File_Format );
goto Fail;
}
+ else
+ string_size = (FT_ULong)tmp;
T1_Skip_PS_Token( parser ); /* `RD' */
if ( parser->root.error )
@@ -621,7 +637,7 @@
string_buf = parser->root.cursor + 1; /* one space after `RD' */
- if ( limit - parser->root.cursor < string_size )
+ if ( (FT_ULong)( limit - parser->root.cursor ) < string_size )
{
FT_ERROR(( "t42_parse_sfnts: too much binary data\n" ));
error = FT_THROW( Invalid_File_Format );
@@ -667,7 +683,7 @@
status = BEFORE_TABLE_DIR;
face->ttf_size = 12 + 16 * num_tables;
- if ( (FT_ULong)( limit - parser->root.cursor ) < face->ttf_size )
+ if ( (FT_Long)( limit - parser->root.cursor ) < face->ttf_size )
{
FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
error = FT_THROW( Invalid_File_Format );
@@ -700,7 +716,7 @@
len = FT_PEEK_ULONG( p );
/* Pad to a 4-byte boundary length */
- face->ttf_size += ( len + 3 ) & ~3;
+ face->ttf_size += (FT_Long)( ( len + 3 ) & ~3U );
}
status = OTHER_TABLES;
@@ -754,8 +770,8 @@
FT_Byte* cur;
FT_Byte* limit = parser->root.limit;
- FT_UInt n;
- FT_UInt notdef_index = 0;
+ FT_Int n;
+ FT_Int notdef_index = 0;
FT_Byte notdef_found = 0;
@@ -770,15 +786,21 @@
if ( ft_isdigit( *parser->root.cursor ) )
{
- loader->num_glyphs = (FT_UInt)T1_ToInt( parser );
+ loader->num_glyphs = T1_ToInt( parser );
if ( parser->root.error )
return;
+ if ( loader->num_glyphs < 0 )
+ {
+ FT_ERROR(( "t42_parse_encoding: invalid number of glyphs\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
}
else if ( *parser->root.cursor == '<' )
{
/* We have `<< ... >>'. Count the number of `/' in the dictionary */
/* to get its size. */
- FT_UInt count = 0;
+ FT_Int count = 0;
T1_Skip_PS_Token( parser );
@@ -819,6 +841,15 @@
/* initialize tables */
+ /* contrary to Type1, we disallow multiple CharStrings arrays */
+ if ( swap_table->init )
+ {
+ FT_ERROR(( "t42_parse_charstrings:"
+ " only one CharStrings array allowed\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+
error = psaux->ps_table_funcs->init( code_table,
loader->num_glyphs,
memory );
@@ -873,7 +904,7 @@
if ( *cur == '/' )
{
- FT_PtrDist len;
+ FT_UInt len;
if ( cur + 2 >= limit )
@@ -884,7 +915,7 @@
}
cur++; /* skip `/' */
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
error = T1_Add_Table( name_table, n, cur, len + 1 );
if ( error )
@@ -914,7 +945,7 @@
goto Fail;
}
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
error = T1_Add_Table( code_table, n, cur, len + 1 );
if ( error )
@@ -1135,7 +1166,7 @@
/* look for immediates */
else if ( *cur == '/' && cur + 2 < limit )
{
- FT_PtrDist len;
+ FT_UInt len;
cur++;
@@ -1145,7 +1176,7 @@
if ( parser->root.error )
goto Exit;
- len = parser->root.cursor - cur;
+ len = (FT_UInt)( parser->root.cursor - cur );
if ( len > 0 && len < 22 && parser->root.cursor < limit )
{
@@ -1164,9 +1195,9 @@
if ( !name )
continue;
- if ( cur[0] == name[0] &&
- len == (FT_PtrDist)ft_strlen( (const char *)name ) &&
- ft_memcmp( cur, name, len ) == 0 )
+ if ( cur[0] == name[0] &&
+ len == ft_strlen( (const char *)name ) &&
+ ft_memcmp( cur, name, len ) == 0 )
{
/* we found it -- run the parsing callback! */
parser->root.error = t42_load_keyword( face,
diff --git a/src/3rdparty/freetype/src/type42/t42parse.h b/src/3rdparty/freetype/src/type42/t42parse.h
index f77ec4af4f..8ed2fde65d 100644
--- a/src/3rdparty/freetype/src/type42/t42parse.h
+++ b/src/3rdparty/freetype/src/type42/t42parse.h
@@ -4,7 +4,8 @@
/* */
/* Type 42 font parser (specification). */
/* */
-/* Copyright 2002, 2003 by Roberto Alameda. */
+/* Copyright 2002-2015 by */
+/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -42,11 +43,11 @@ FT_BEGIN_HEADER
{
T42_ParserRec parser; /* parser used to read the stream */
- FT_UInt num_chars; /* number of characters in encoding */
+ FT_Int num_chars; /* number of characters in encoding */
PS_TableRec encoding_table; /* PS_Table used to store the */
/* encoding character names */
- FT_UInt num_glyphs;
+ FT_Int num_glyphs;
PS_TableRec glyph_names;
PS_TableRec charstrings;
PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */
diff --git a/src/3rdparty/freetype/src/type42/t42types.h b/src/3rdparty/freetype/src/type42/t42types.h
index c7c2db490d..01286af827 100644
--- a/src/3rdparty/freetype/src/type42/t42types.h
+++ b/src/3rdparty/freetype/src/type42/t42types.h
@@ -4,7 +4,8 @@
/* */
/* Type 42 font data types (specification only). */
/* */
-/* Copyright 2002, 2003, 2006, 2008 by Roberto Alameda. */
+/* Copyright 2002-2015 by */
+/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -39,7 +40,7 @@ FT_BEGIN_HEADER
const void* afm_data;
#endif
FT_Byte* ttf_data;
- FT_ULong ttf_size;
+ FT_Long ttf_size;
FT_Face ttf_face;
FT_CharMapRec charmaprecs[2];
FT_CharMap charmaps[2];
diff --git a/src/3rdparty/freetype/src/type42/type42.c b/src/3rdparty/freetype/src/type42/type42.c
index d13df56b10..3332b7b7e6 100644
--- a/src/3rdparty/freetype/src/type42/type42.c
+++ b/src/3rdparty/freetype/src/type42/type42.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Type 42 driver component. */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/winfonts/Jamfile b/src/3rdparty/freetype/src/winfonts/Jamfile
index 71cf5678e8..86ee668196 100644
--- a/src/3rdparty/freetype/src/winfonts/Jamfile
+++ b/src/3rdparty/freetype/src/winfonts/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/winfonts Jamfile
#
-# Copyright 2001 by
+# Copyright 2001-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/winfonts/fnterrs.h b/src/3rdparty/freetype/src/winfonts/fnterrs.h
index 463ba77ee2..0bf4d0986d 100644
--- a/src/3rdparty/freetype/src/winfonts/fnterrs.h
+++ b/src/3rdparty/freetype/src/winfonts/fnterrs.h
@@ -4,7 +4,7 @@
/* */
/* Win FNT/FON error codes (specification only). */
/* */
-/* Copyright 2001, 2012 by */
+/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/3rdparty/freetype/src/winfonts/module.mk b/src/3rdparty/freetype/src/winfonts/module.mk
index b44d7f0570..8ba6d7584f 100644
--- a/src/3rdparty/freetype/src/winfonts/module.mk
+++ b/src/3rdparty/freetype/src/winfonts/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2006 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/3rdparty/freetype/src/winfonts/rules.mk b/src/3rdparty/freetype/src/winfonts/rules.mk
index 71a7df2d8a..4535f54d42 100644
--- a/src/3rdparty/freetype/src/winfonts/rules.mk
+++ b/src/3rdparty/freetype/src/winfonts/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001, 2003 by
+# Copyright 1996-2015 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -18,7 +18,10 @@
FNT_DIR := $(SRC_DIR)/winfonts
-FNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(FNT_DIR))
+FNT_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(FNT_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Windows driver sources (i.e., C files)
diff --git a/src/3rdparty/freetype/src/winfonts/winfnt.c b/src/3rdparty/freetype/src/winfonts/winfnt.c
index 4705c53963..4bfa55a429 100644
--- a/src/3rdparty/freetype/src/winfonts/winfnt.c
+++ b/src/3rdparty/freetype/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2004, 2006-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2003 Huw D M Davies for Codeweavers */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
@@ -28,7 +28,7 @@
#include "winfnt.h"
#include "fnterrs.h"
#include FT_SERVICE_WINFNT_H
-#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_FONT_FORMAT_H
/*************************************************************************/
/* */
@@ -201,7 +201,7 @@
FT_FREE( font->family_name );
FT_FREE( font );
- face->font = 0;
+ face->font = NULL;
}
@@ -269,15 +269,18 @@
static FT_Error
fnt_face_get_dll_font( FNT_Face face,
- FT_Int face_index )
+ FT_Int face_instance_index )
{
FT_Error error;
FT_Stream stream = FT_FACE( face )->stream;
FT_Memory memory = FT_FACE( face )->memory;
WinMZ_HeaderRec mz_header;
+ FT_Long face_index;
- face->font = 0;
+ face->font = NULL;
+
+ face_index = FT_ABS( face_instance_index ) & 0xFFFF;
/* does it begin with an MZ header? */
if ( FT_STREAM_SEEK( 0 ) ||
@@ -317,6 +320,21 @@
size_shift = FT_GET_USHORT_LE();
+ /* Microsoft's specification of the executable-file header format */
+ /* for `New Executable' (NE) doesn't give a limit for the */
+ /* alignment shift count; however, in 1985, the year of the */
+ /* specification release, only 32bit values were supported, thus */
+ /* anything larger than 16 doesn't make sense in general, given */
+ /* that file offsets are 16bit values, shifted by the alignment */
+ /* shift count */
+ if ( size_shift > 16 )
+ {
+ FT_TRACE2(( "invalid alignment shift count for resource data\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+
for (;;)
{
FT_UShort type_id, count;
@@ -331,8 +349,8 @@
if ( type_id == 0x8008U )
{
font_count = count;
- font_offset = (FT_ULong)( FT_STREAM_POS() + 4 +
- ( stream->cursor - stream->limit ) );
+ font_offset = FT_STREAM_POS() + 4 +
+ (FT_ULong)( stream->cursor - stream->limit );
break;
}
@@ -359,19 +377,20 @@
face->root.num_faces = font_count;
+ if ( face_instance_index < 0 )
+ goto Exit;
+
if ( face_index >= font_count )
{
error = FT_THROW( Invalid_Argument );
goto Exit;
}
- else if ( face_index < 0 )
- goto Exit;
if ( FT_NEW( face->font ) )
goto Exit;
- if ( FT_STREAM_SEEK( font_offset + face_index * 12 ) ||
- FT_FRAME_ENTER( 12 ) )
+ if ( FT_STREAM_SEEK( font_offset + (FT_ULong)face_index * 12 ) ||
+ FT_FRAME_ENTER( 12 ) )
goto Fail;
face->font->offset = (FT_ULong)FT_GET_USHORT_LE() << size_shift;
@@ -391,7 +410,7 @@
WinPE_RsrcDirEntryRec dir_entry1, dir_entry2, dir_entry3;
WinPE_RsrcDataEntryRec data_entry;
- FT_Long root_dir_offset, name_dir_offset, lang_dir_offset;
+ FT_ULong root_dir_offset, name_dir_offset, lang_dir_offset;
FT_UShort i, j, k;
@@ -689,13 +708,14 @@
static FT_Error
FNT_Face_Init( FT_Stream stream,
FT_Face fntface, /* FNT_Face */
- FT_Int face_index,
+ FT_Int face_instance_index,
FT_Int num_params,
FT_Parameter* params )
{
FNT_Face face = (FNT_Face)fntface;
FT_Error error;
FT_Memory memory = FT_FACE_MEMORY( face );
+ FT_Int face_index;
FT_UNUSED( num_params );
FT_UNUSED( params );
@@ -703,9 +723,11 @@
FT_TRACE2(( "Windows FNT driver\n" ));
+ face_index = FT_ABS( face_instance_index ) & 0xFFFF;
+
/* try to load font from a DLL */
- error = fnt_face_get_dll_font( face, face_index );
- if ( !error && face_index < 0 )
+ error = fnt_face_get_dll_font( face, face_instance_index );
+ if ( !error && face_instance_index < 0 )
goto Exit;
if ( FT_ERR_EQ( error, Unknown_File_Format ) )
@@ -726,10 +748,11 @@
if ( !error )
{
+ if ( face_instance_index < 0 )
+ goto Exit;
+
if ( face_index > 0 )
error = FT_THROW( Invalid_Argument );
- else if ( face_index < 0 )
- goto Exit;
}
}
@@ -739,9 +762,9 @@
/* we now need to fill the root FT_Face fields */
/* with relevant information */
{
- FT_Face root = FT_FACE( face );
- FNT_Font font = face->font;
- FT_PtrDist family_size;
+ FT_Face root = FT_FACE( face );
+ FNT_Font font = face->font;
+ FT_ULong family_size;
root->face_index = face_index;
@@ -769,9 +792,9 @@
FT_UShort x_res, y_res;
- bsize->width = font->header.avg_width;
- bsize->height = (FT_Short)(
- font->header.pixel_height + font->header.external_leading );
+ bsize->width = (FT_Short)font->header.avg_width;
+ bsize->height = (FT_Short)( font->header.pixel_height +
+ font->header.external_leading );
bsize->size = font->header.nominal_point_size << 6;
x_res = font->header.horizontal_resolution;
@@ -964,7 +987,7 @@
FNT_Font font;
FT_Error error = FT_Err_Ok;
FT_Byte* p;
- FT_Int len;
+ FT_UInt len;
FT_Bitmap* bitmap = &slot->bitmap;
FT_ULong offset;
FT_Bool new_format;
@@ -1009,7 +1032,7 @@
p = font->fnt_frame + offset;
- bitmap->width = FT_NEXT_SHORT_LE( p );
+ bitmap->width = FT_NEXT_USHORT_LE( p );
/* jump to glyph entry */
if ( new_format )
@@ -1030,12 +1053,12 @@
/* allocate and build bitmap */
{
FT_Memory memory = FT_FACE_MEMORY( slot->face );
- FT_Int pitch = ( bitmap->width + 7 ) >> 3;
+ FT_UInt pitch = ( bitmap->width + 7 ) >> 3;
FT_Byte* column;
FT_Byte* write;
- bitmap->pitch = pitch;
+ bitmap->pitch = (int)pitch;
bitmap->rows = font->header.pixel_height;
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
@@ -1069,14 +1092,14 @@
slot->format = FT_GLYPH_FORMAT_BITMAP;
/* now set up metrics */
- slot->metrics.width = bitmap->width << 6;
- slot->metrics.height = bitmap->rows << 6;
- slot->metrics.horiAdvance = bitmap->width << 6;
+ slot->metrics.width = (FT_Pos)( bitmap->width << 6 );
+ slot->metrics.height = (FT_Pos)( bitmap->rows << 6 );
+ slot->metrics.horiAdvance = (FT_Pos)( bitmap->width << 6 );
slot->metrics.horiBearingX = 0;
slot->metrics.horiBearingY = slot->bitmap_top << 6;
ft_synthesize_vertical_metrics( &slot->metrics,
- bitmap->rows << 6 );
+ (FT_Pos)( bitmap->rows << 6 ) );
Exit:
return error;
@@ -1108,8 +1131,8 @@
static const FT_ServiceDescRec winfnt_services[] =
{
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_WINFNT },
- { FT_SERVICE_ID_WINFNT, &winfnt_service_rec },
+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_WINFNT },
+ { FT_SERVICE_ID_WINFNT, &winfnt_service_rec },
{ NULL, NULL }
};
diff --git a/src/3rdparty/freetype/src/winfonts/winfnt.h b/src/3rdparty/freetype/src/winfonts/winfnt.h
index b7a80736d8..a39d26f449 100644
--- a/src/3rdparty/freetype/src/winfonts/winfnt.h
+++ b/src/3rdparty/freetype/src/winfonts/winfnt.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2007 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
/* */
diff --git a/src/3rdparty/harfbuzz-ng/NEWS b/src/3rdparty/harfbuzz-ng/NEWS
index c4950e2620..f2b0a32401 100644
--- a/src/3rdparty/harfbuzz-ng/NEWS
+++ b/src/3rdparty/harfbuzz-ng/NEWS
@@ -1,3 +1,118 @@
+Overview of changes leading to 1.0.6
+Thursday, October 15, 2015
+====================================
+
+- Reduce max nesting level in OT lookups from 8 to 6.
+ Should not affect any real font as far as I know.
+- Fix memory access issue in ot-font.
+- Revert default load-flags of fonts created using hb_ft_font_create()
+ back to FT_LOAD_DEFAULT|FT_LOAD_NO_HINTING. This was changed in
+ last release (1.0.5), but caused major issues, so revert.
+ https://github.com/behdad/harfbuzz/issues/143
+
+
+Overview of changes leading to 1.0.5
+Tuesday, October 13, 2015
+====================================
+
+- Fix multiple memory access bugs discovered using libFuzzer.
+ https://github.com/behdad/harfbuzz/issues/139
+ Everyone should upgrade to this version as soon as possible.
+ We now have continuous fuzzing set up, to avoid issues like
+ these creeping in again.
+- Misc fixes.
+
+- New API:
+ * hb_font_set_parent().
+ * hb_ft_font_[sg]et_load_flags()
+ The default flags for fonts created using hb_ft_font_create()
+ has changed to default to FT_LOAD_DEFAULT now. Previously it
+ was defaulting to FT_LOAD_DFEAULT|FT_LOAD_NO_HINTING.
+
+- API changes:
+ * Fonts now default to units-per-EM as their scale, instead of 0.
+ * hb_font_create_sub_font() does NOT make parent font immutable
+ anymore. hb_font_make_immutable() does.
+
+
+Overview of changes leading to 1.0.4
+Wednesday, September 30, 2015
+====================================
+
+- Fix minor out-of-bounds read error.
+
+
+Overview of changes leading to 1.0.3
+Tuesday, September 1, 2015
+====================================
+
+- Start of user documentation, from Simon Cozens!
+- Implement glyph_extents() for TrueType fonts in hb-ot-font.
+- Improve GPOS cursive attachments with conflicting lookups.
+- More fixes for cluster-level = 1.
+- Uniscribe positioning fix.
+
+
+Overview of changes leading to 1.0.2
+Wednesday, August 19, 2015
+====================================
+
+- Fix shaping with cluster-level > 0.
+- Fix Uniscribe backend font-size scaling.
+- Declare dependencies in harfbuzz.pc.
+ FreeType is not declared though, to avoid bugs in pkg-config
+ 0.26 with recursive dependencies.
+- Slightly improved debug infrastructure. More to come later.
+- Misc build fixes.
+
+
+Overview of changes leading to 1.0.1
+Monday, July 27, 2015
+====================================
+
+- Fix out-of-bounds access in USE shaper.
+
+
+Overview of changes leading to 1.0.0
+Sunday, July 26, 2015
+====================================
+
+- Implement Universal Shaping Engine:
+ https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm
+ http://blogs.windows.com/bloggingwindows/2015/02/23/windows-shapes-the-worlds-languages/
+- Bump version to 1.0.0. The soname was NOT bumped.
+
+
+Overview of changes leading to 0.9.42
+Thursday, July 26, 2015
+=====================================
+
+- New API to allow for retrieving finer-grained cluster
+ mappings if the client desires to handle them. Default
+ behavior is unchanged.
+- Fix cluster merging when removing default-ignorables.
+- Update to Unicode 8.0
+- hb-graphite2 fixes.
+- Misc fixes.
+- Removed HB_NO_MERGE_CLUSTERS hack.
+- New API:
+ hb_buffer_cluster_level_t enum
+ hb_buffer_get_cluster_level()
+ hb_buffer_set_cluster_level()
+ hb-shape / hb-view --cluster-level
+
+
+Overview of changes leading to 0.9.41
+Thursday, June 18, 2015
+=====================================
+
+- Fix hb-coretext with trailing whitespace in right-to-left.
+- New API: hb_buffer_reverse_range().
+- Allow implementing atomic ops in config.h.
+- Fix hb_language_t in language bindings.
+- Misc fixes.
+
+
Overview of changes leading to 0.9.40
Friday, March 20, 2015
=====================================
diff --git a/src/3rdparty/harfbuzz-ng/README b/src/3rdparty/harfbuzz-ng/README
index d34bc74f99..dea10688f3 100644
--- a/src/3rdparty/harfbuzz-ng/README
+++ b/src/3rdparty/harfbuzz-ng/README
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/behdad/harfbuzz.svg)](https://travis-ci.org/behdad/harfbuzz)
[![Coverage Status](https://img.shields.io/coveralls/behdad/harfbuzz.svg)](https://coveralls.io/r/behdad/harfbuzz)
+[![Coverity Scan](https://img.shields.io/coverity/scan/5450.svg)](https://scan.coverity.com/projects/5450)
This is HarfBuzz, a text shaping library.
diff --git a/src/3rdparty/harfbuzz-ng/config.h b/src/3rdparty/harfbuzz-ng/config.h
new file mode 100644
index 0000000000..b8b6b3c0fe
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/config.h
@@ -0,0 +1,47 @@
+/*
+* Copyright (C) 2015 The Qt Company Ltd.
+* Copyright (C) 2015 Konstantin Ritt
+*
+* Permission is hereby granted, without written agreement and without
+* license or royalty fees, to use, copy, modify, and distribute this
+* software and its documentation for any purpose, provided that the
+* above copyright notice and the following two paragraphs appear in
+* all copies of this software.
+*
+* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+*
+*/
+
+#include <QtCore/qatomic.h>
+
+QT_USE_NAMESPACE
+
+namespace {
+
+// We need to cast hb_atomic_int_t to QAtomicInt and pointers to
+// QAtomicPointer instead of using QAtomicOps, otherwise we get a failed
+// overload resolution of the template arguments for testAndSetOrdered.
+template <typename T>
+inline QAtomicPointer<T> *makeAtomicPointer(T * const &ptr)
+{
+ return reinterpret_cast<QAtomicPointer<T> *>(const_cast<T **>(&ptr));
+}
+
+} // namespace
+
+typedef int hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) reinterpret_cast<QAtomicInt &>(AI).fetchAndAddOrdered(V)
+
+#define hb_atomic_ptr_impl_get(P) makeAtomicPointer(*(P))->loadAcquire()
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) makeAtomicPointer(*(P))->testAndSetOrdered((O), (N))
diff --git a/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro b/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
index fb6771759b..031f7ecd58 100644
--- a/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
+++ b/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
@@ -7,7 +7,8 @@ CONFIG += \
load(qt_helper_lib)
-DEFINES += HAVE_OT HAVE_QT5_ATOMICS HB_NO_UNICODE_FUNCS HB_DISABLE_DEPRECATED
+DEFINES += HAVE_CONFIG_H
+DEFINES += HAVE_OT HB_NO_UNICODE_FUNCS HB_DISABLE_DEPRECATED
# platform/compiler specific definitions
DEFINES += HAVE_ATEXIT
@@ -45,6 +46,7 @@ HEADERS += \
$$PWD/src/hb-open-file-private.hh \
$$PWD/src/hb-open-type-private.hh \
$$PWD/src/hb-ot-cmap-table.hh \
+ $$PWD/src/hb-ot-glyf-table.hh \
$$PWD/src/hb-ot-head-table.hh \
$$PWD/src/hb-ot-hhea-table.hh \
$$PWD/src/hb-ot-hmtx-table.hh \
@@ -86,9 +88,10 @@ SOURCES += \
$$PWD/src/hb-ot-shape-complex-indic.cc \
$$PWD/src/hb-ot-shape-complex-indic-table.cc \
$$PWD/src/hb-ot-shape-complex-myanmar.cc \
- $$PWD/src/hb-ot-shape-complex-sea.cc \
$$PWD/src/hb-ot-shape-complex-thai.cc \
$$PWD/src/hb-ot-shape-complex-tibetan.cc \
+ $$PWD/src/hb-ot-shape-complex-use.cc \
+ $$PWD/src/hb-ot-shape-complex-use-table.cc \
$$PWD/src/hb-ot-shape-fallback.cc \
$$PWD/src/hb-ot-shape-normalize.cc
@@ -102,12 +105,14 @@ HEADERS += \
$$PWD/src/hb-ot-layout-private.hh \
$$PWD/src/hb-ot-map-private.hh \
$$PWD/src/hb-ot-shape-complex-arabic-fallback.hh \
+ $$PWD/src/hb-ot-shape-complex-arabic-private.hh \
$$PWD/src/hb-ot-shape-complex-arabic-table.hh \
$$PWD/src/hb-ot-shape-complex-indic-machine.hh \
$$PWD/src/hb-ot-shape-complex-indic-private.hh \
$$PWD/src/hb-ot-shape-complex-myanmar-machine.hh \
$$PWD/src/hb-ot-shape-complex-private.hh \
- $$PWD/src/hb-ot-shape-complex-sea-machine.hh \
+ $$PWD/src/hb-ot-shape-complex-use-machine.hh \
+ $$PWD/src/hb-ot-shape-complex-use-private.hh \
$$PWD/src/hb-ot-shape-fallback-private.hh \
$$PWD/src/hb-ot-shape-normalize-private.hh \
$$PWD/src/hb-ot-shape-private.hh
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh
index 48eb56141f..8179571ad2 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-atomic-private.hh
@@ -39,27 +39,12 @@
/* We need external help for these */
-#if 0
+#if defined(hb_atomic_int_impl_add) \
+ && defined(hb_atomic_ptr_impl_get) \
+ && defined(hb_atomic_ptr_impl_cmpexch)
-#elif !defined(HB_NO_MT) && defined(HAVE_QT5_ATOMICS)
-#include <QtCore/qatomic.h>
+/* Defined externally, i.e. in config.h; must have typedef'ed hb_atomic_int_impl_t as well. */
-QT_USE_NAMESPACE
-
-namespace {
-// We need to cast hb_atomic_int_t to QAtomicInt and pointers to
-// QAtomicPointer instead of using QAtomicOps, otherwise we get a failed
-// overload resolution of the template arguments for testAndSetOrdered.
-template <typename T> QAtomicPointer<T> *makeAtomicPointer(T * const &ptr)
-{
- return reinterpret_cast<QAtomicPointer<T> *>(const_cast<T **>(&ptr));
-}
-}
-
-typedef int hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) reinterpret_cast<QAtomicInt &>(AI).fetchAndAddOrdered(V)
-#define hb_atomic_ptr_get(P) makeAtomicPointer(*P)->loadAcquire()
-#define hb_atomic_ptr_cmpexch(P,O,N) makeAtomicPointer(*P)->testAndSetOrdered((O), (N))
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
@@ -77,11 +62,12 @@ static inline void _HBMemoryBarrier (void) {
#endif
}
-typedef LONG hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
+typedef LONG hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
-#define hb_atomic_ptr_get(P) (_HBMemoryBarrier (), (void *) *(P))
-#define hb_atomic_ptr_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
+#define hb_atomic_ptr_impl_get(P) (_HBMemoryBarrier (), (void *) *(P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
#elif !defined(HB_NO_MT) && defined(__APPLE__)
@@ -93,28 +79,31 @@ typedef LONG hb_atomic_int_t;
#include <Availability.h>
#endif
-typedef int32_t hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
-#define hb_atomic_ptr_get(P) (OSMemoryBarrier (), (void *) *(P))
+typedef int32_t hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
+
+#define hb_atomic_ptr_impl_get(P) (OSMemoryBarrier (), (void *) *(P))
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
-#define hb_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
#else
#if __ppc64__ || __x86_64__ || __aarch64__
-#define hb_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
#else
-#define hb_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P))
#endif
#endif
#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
-typedef int hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) __sync_fetch_and_add (&(AI), (V))
+typedef int hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) __sync_fetch_and_add (&(AI), (V))
-#define hb_atomic_ptr_get(P) (void *) (__sync_synchronize (), *(P))
-#define hb_atomic_ptr_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N))
+#define hb_atomic_ptr_impl_get(P) (void *) (__sync_synchronize (), *(P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N))
#elif !defined(HB_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS)
@@ -122,33 +111,54 @@ typedef int hb_atomic_int_t;
#include <atomic.h>
#include <mbarrier.h>
-typedef unsigned int hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V))
+typedef unsigned int hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V))
-#define hb_atomic_ptr_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P))
-#define hb_atomic_ptr_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((void **) (P), (void *) (O), (void *) (N)) == (void *) (O) ? true : false)
+#define hb_atomic_ptr_impl_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((void **) (P), (void *) (O), (void *) (N)) == (void *) (O) ? true : false)
#elif !defined(HB_NO_MT)
#define HB_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */
-typedef volatile int hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) (((AI) += (V)) - (V))
-#define hb_atomic_ptr_get(P) ((void *) *(P))
-#define hb_atomic_ptr_cmpexch(P,O,N) (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), true) : false)
+typedef volatile int hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V))
+
+#define hb_atomic_ptr_impl_get(P) ((void *) *(P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), true) : false)
#else /* HB_NO_MT */
-typedef int hb_atomic_int_t;
-#define hb_atomic_int_add(AI, V) (((AI) += (V)) - (V))
+typedef int hb_atomic_int_impl_t;
+#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
+#define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V))
+
+#define hb_atomic_ptr_impl_get(P) ((void *) *(P))
+#define hb_atomic_ptr_impl_cmpexch(P,O,N) (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), true) : false)
-#define hb_atomic_ptr_get(P) ((void *) *(P))
-#define hb_atomic_ptr_cmpexch(P,O,N) (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), true) : false)
#endif
-/* TODO Add tracing. */
+
+#define HB_ATOMIC_INT_INIT(V) {HB_ATOMIC_INT_IMPL_INIT(V)}
+
+struct hb_atomic_int_t
+{
+ hb_atomic_int_impl_t v;
+
+ inline void set_unsafe (int v_) { v = v_; }
+ inline int get_unsafe (void) const { return v; }
+ inline int inc (void) { return hb_atomic_int_impl_add (const_cast<hb_atomic_int_impl_t &> (v), 1); }
+ inline int dec (void) { return hb_atomic_int_impl_add (const_cast<hb_atomic_int_impl_t &> (v), -1); }
+};
+
+
+#define hb_atomic_ptr_get(P) hb_atomic_ptr_impl_get(P)
+#define hb_atomic_ptr_cmpexch(P,O,N) hb_atomic_ptr_impl_cmpexch((P),(O),(N))
+
#endif /* HB_ATOMIC_PRIVATE_HH */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-blob.cc b/src/3rdparty/harfbuzz-ng/src/hb-blob.cc
index 8759a252a5..a6870dc06e 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-blob.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-blob.cc
@@ -91,7 +91,7 @@ _hb_blob_destroy_user_data (hb_blob_t *blob)
* Return value: New blob, or the empty blob if something failed or if @length is
* zero. Destroy with hb_blob_destroy().
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_blob_t *
hb_blob_create (const char *data,
@@ -147,7 +147,7 @@ hb_blob_create (const char *data,
* @length is zero or @offset is beyond the end of @parent's data. Destroy
* with hb_blob_destroy().
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_blob_t *
hb_blob_create_sub_blob (hb_blob_t *parent,
@@ -179,7 +179,7 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
*
* Return value: (transfer full): the empty blob.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_blob_t *
hb_blob_get_empty (void)
@@ -210,7 +210,7 @@ hb_blob_get_empty (void)
*
* Return value: @blob.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_blob_t *
hb_blob_reference (hb_blob_t *blob)
@@ -228,7 +228,7 @@ hb_blob_reference (hb_blob_t *blob)
*
* See TODO:link object types for more information.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_blob_destroy (hb_blob_t *blob)
@@ -250,7 +250,7 @@ hb_blob_destroy (hb_blob_t *blob)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_blob_set_user_data (hb_blob_t *blob,
@@ -271,7 +271,7 @@ hb_blob_set_user_data (hb_blob_t *blob,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_blob_get_user_data (hb_blob_t *blob,
@@ -287,7 +287,7 @@ hb_blob_get_user_data (hb_blob_t *blob,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_blob_make_immutable (hb_blob_t *blob)
@@ -306,7 +306,7 @@ hb_blob_make_immutable (hb_blob_t *blob)
*
* Return value: TODO
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_blob_is_immutable (hb_blob_t *blob)
@@ -323,7 +323,7 @@ hb_blob_is_immutable (hb_blob_t *blob)
*
* Return value: the length of blob data in bytes.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_blob_get_length (hb_blob_t *blob)
@@ -340,7 +340,7 @@ hb_blob_get_length (hb_blob_t *blob)
*
* Returns: (transfer none) (array length=length):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
@@ -365,7 +365,7 @@ hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
* Returns: (transfer none) (array length=length): Writable blob data,
* or %NULL if failed.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
char *
hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length)
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer-deserialize-text.hh b/src/3rdparty/harfbuzz-ng/src/hb-buffer-deserialize-text.hh
index 7a46ab278b..d2d8daae7e 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-buffer-deserialize-text.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer-deserialize-text.hh
@@ -336,8 +336,8 @@ _hb_buffer_deserialize_glyphs_text (hb_buffer_t *buffer,
const char *eof = pe, *tok = NULL;
int cs;
- hb_glyph_info_t info;
- hb_glyph_position_t pos;
+ hb_glyph_info_t info = {0};
+ hb_glyph_position_t pos = {0};
#line 343 "hb-buffer-deserialize-text.hh"
{
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-buffer-private.hh
index 069f925581..7fed7386b0 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-buffer-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer-private.hh
@@ -50,6 +50,7 @@ struct hb_buffer_t {
/* Information about how the text in the buffer should be treated */
hb_unicode_funcs_t *unicode; /* Unicode functions */
hb_buffer_flags_t flags; /* BOT / EOT / etc. */
+ hb_buffer_cluster_level_t cluster_level;
hb_codepoint_t replacement; /* U+FFFD or something else. */
/* Buffer contents */
@@ -171,9 +172,18 @@ struct hb_buffer_t {
unsigned int cluster_end);
HB_INTERNAL void merge_clusters (unsigned int start,
- unsigned int end);
+ unsigned int end)
+ {
+ if (end - start < 2)
+ return;
+ merge_clusters_impl (start, end);
+ }
+ HB_INTERNAL void merge_clusters_impl (unsigned int start,
+ unsigned int end);
HB_INTERNAL void merge_out_clusters (unsigned int start,
unsigned int end);
+ /* Merge clusters for deleting current glyph, and skip it. */
+ HB_INTERNAL void delete_glyph (void);
/* Internal methods */
HB_INTERNAL bool enlarge (unsigned int size);
@@ -191,6 +201,8 @@ struct hb_buffer_t {
HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size);
inline void clear_context (unsigned int side) { context_len[side] = 0; }
+
+ HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *));
};
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc b/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc
index 406d69db75..7839cbc3f0 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer-serialize.cc
@@ -40,7 +40,7 @@ static const char *serialize_formats[] = {
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char **
hb_buffer_serialize_list_formats (void)
@@ -57,7 +57,7 @@ hb_buffer_serialize_list_formats (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_buffer_serialize_format_t
hb_buffer_serialize_format_from_string (const char *str, int len)
@@ -74,7 +74,7 @@ hb_buffer_serialize_format_from_string (const char *str, int len)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
@@ -99,7 +99,8 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
hb_buffer_serialize_flags_t flags)
{
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
- hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, NULL);
+ hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
+ NULL : hb_buffer_get_glyph_positions (buffer, NULL);
*buf_consumed = 0;
for (unsigned int i = start; i < end; i++)
@@ -144,6 +145,16 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
pos[i].x_advance, pos[i].y_advance);
}
+ if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
+ {
+ hb_glyph_extents_t extents;
+ hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
+ p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d",
+ extents.x_bearing, extents.y_bearing));
+ p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d",
+ extents.width, extents.height));
+ }
+
*p++ = '}';
unsigned int l = p - b;
@@ -172,7 +183,8 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
hb_buffer_serialize_flags_t flags)
{
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
- hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, NULL);
+ hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
+ NULL : hb_buffer_get_glyph_positions (buffer, NULL);
*buf_consumed = 0;
for (unsigned int i = start; i < end; i++)
@@ -208,6 +220,13 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance));
}
+ if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
+ {
+ hb_glyph_extents_t extents;
+ hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
+ p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "<%d,%d,%d,%d>", extents.x_bearing, extents.y_bearing, extents.width, extents.height));
+ }
+
unsigned int l = p - b;
if (buf_size > l)
{
@@ -240,7 +259,7 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
@@ -347,7 +366,7 @@ parse_int (const char *pp, const char *end, int32_t *pv)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc b/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc
index b9fe263ce5..50710dd23e 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc
@@ -36,6 +36,9 @@
#endif
+/**
+ * Since: 0.9.7
+ **/
hb_bool_t
hb_segment_properties_equal (const hb_segment_properties_t *a,
const hb_segment_properties_t *b)
@@ -48,6 +51,9 @@ hb_segment_properties_equal (const hb_segment_properties_t *a,
}
+/**
+ * Since: 0.9.7
+ **/
unsigned int
hb_segment_properties_hash (const hb_segment_properties_t *p)
{
@@ -498,14 +504,10 @@ hb_buffer_t::reverse_clusters (void)
}
void
-hb_buffer_t::merge_clusters (unsigned int start,
- unsigned int end)
+hb_buffer_t::merge_clusters_impl (unsigned int start,
+ unsigned int end)
{
-#ifdef HB_NO_MERGE_CLUSTERS
- return;
-#endif
-
- if (unlikely (end - start < 2))
+ if (cluster_level == HB_BUFFER_CLUSTER_LEVEL_CHARACTERS)
return;
unsigned int cluster = info[start].cluster;
@@ -523,7 +525,7 @@ hb_buffer_t::merge_clusters (unsigned int start,
/* If we hit the start of buffer, continue in out-buffer. */
if (idx == start)
- for (unsigned i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--)
+ for (unsigned int i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--)
out_info[i - 1].cluster = cluster;
for (unsigned int i = start; i < end; i++)
@@ -533,9 +535,8 @@ void
hb_buffer_t::merge_out_clusters (unsigned int start,
unsigned int end)
{
-#ifdef HB_NO_MERGE_CLUSTERS
- return;
-#endif
+ if (cluster_level == HB_BUFFER_CLUSTER_LEVEL_CHARACTERS)
+ return;
if (unlikely (end - start < 2))
return;
@@ -555,12 +556,44 @@ hb_buffer_t::merge_out_clusters (unsigned int start,
/* If we hit the end of out-buffer, continue in buffer. */
if (end == out_len)
- for (unsigned i = idx; i < len && info[i].cluster == out_info[end - 1].cluster; i++)
+ for (unsigned int i = idx; i < len && info[i].cluster == out_info[end - 1].cluster; i++)
info[i].cluster = cluster;
for (unsigned int i = start; i < end; i++)
out_info[i].cluster = cluster;
}
+void
+hb_buffer_t::delete_glyph ()
+{
+ unsigned int cluster = info[idx].cluster;
+ if (idx + 1 < len && cluster == info[idx + 1].cluster)
+ {
+ /* Cluster survives; do nothing. */
+ goto done;
+ }
+
+ if (out_len)
+ {
+ /* Merge cluster backward. */
+ if (cluster < out_info[out_len - 1].cluster)
+ {
+ unsigned int old_cluster = out_info[out_len - 1].cluster;
+ for (unsigned i = out_len; i && out_info[i - 1].cluster == old_cluster; i--)
+ out_info[i - 1].cluster = cluster;
+ }
+ goto done;
+ }
+
+ if (idx + 1 < len)
+ {
+ /* Merge cluster forward. */
+ merge_clusters (idx, idx + 2);
+ goto done;
+ }
+
+done:
+ skip_glyph ();
+}
void
hb_buffer_t::guess_segment_properties (void)
@@ -671,7 +704,7 @@ void hb_buffer_t::deallocate_var_all (void)
*
* Return value: (transfer full)
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_buffer_t *
hb_buffer_create (void)
@@ -693,7 +726,7 @@ hb_buffer_create (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_buffer_t *
hb_buffer_get_empty (void)
@@ -703,6 +736,7 @@ hb_buffer_get_empty (void)
const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil),
HB_BUFFER_FLAG_DEFAULT,
+ HB_BUFFER_CLUSTER_LEVEL_DEFAULT,
HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT,
HB_BUFFER_CONTENT_TYPE_INVALID,
@@ -725,7 +759,7 @@ hb_buffer_get_empty (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_buffer_t *
hb_buffer_reference (hb_buffer_t *buffer)
@@ -739,7 +773,7 @@ hb_buffer_reference (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_destroy (hb_buffer_t *buffer)
@@ -766,7 +800,7 @@ hb_buffer_destroy (hb_buffer_t *buffer)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_buffer_set_user_data (hb_buffer_t *buffer,
@@ -787,7 +821,7 @@ hb_buffer_set_user_data (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_buffer_get_user_data (hb_buffer_t *buffer,
@@ -804,7 +838,7 @@ hb_buffer_get_user_data (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.5
**/
void
hb_buffer_set_content_type (hb_buffer_t *buffer,
@@ -821,7 +855,7 @@ hb_buffer_set_content_type (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.5
**/
hb_buffer_content_type_t
hb_buffer_get_content_type (hb_buffer_t *buffer)
@@ -837,7 +871,7 @@ hb_buffer_get_content_type (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
@@ -863,7 +897,7 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_unicode_funcs_t *
hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
@@ -878,7 +912,7 @@ hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_set_direction (hb_buffer_t *buffer,
@@ -899,7 +933,7 @@ hb_buffer_set_direction (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_direction_t
hb_buffer_get_direction (hb_buffer_t *buffer)
@@ -914,7 +948,7 @@ hb_buffer_get_direction (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_set_script (hb_buffer_t *buffer,
@@ -934,7 +968,7 @@ hb_buffer_set_script (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_script_t
hb_buffer_get_script (hb_buffer_t *buffer)
@@ -949,7 +983,7 @@ hb_buffer_get_script (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_set_language (hb_buffer_t *buffer,
@@ -967,9 +1001,9 @@ hb_buffer_set_language (hb_buffer_t *buffer,
*
*
*
- * Return value:
+ * Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_language_t
hb_buffer_get_language (hb_buffer_t *buffer)
@@ -984,7 +1018,7 @@ hb_buffer_get_language (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_buffer_set_segment_properties (hb_buffer_t *buffer,
@@ -999,11 +1033,11 @@ hb_buffer_set_segment_properties (hb_buffer_t *buffer,
/**
* hb_buffer_get_segment_properties:
* @buffer: a buffer.
- * @props:
+ * @props: (out):
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_buffer_get_segment_properties (hb_buffer_t *buffer,
@@ -1020,7 +1054,7 @@ hb_buffer_get_segment_properties (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_buffer_set_flags (hb_buffer_t *buffer,
@@ -1040,7 +1074,7 @@ hb_buffer_set_flags (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_buffer_flags_t
hb_buffer_get_flags (hb_buffer_t *buffer)
@@ -1048,6 +1082,41 @@ hb_buffer_get_flags (hb_buffer_t *buffer)
return buffer->flags;
}
+/**
+ * hb_buffer_set_cluster_level:
+ * @buffer: a buffer.
+ * @cluster_level:
+ *
+ *
+ *
+ * Since: 0.9.42
+ **/
+void
+hb_buffer_set_cluster_level (hb_buffer_t *buffer,
+ hb_buffer_cluster_level_t cluster_level)
+{
+ if (unlikely (hb_object_is_inert (buffer)))
+ return;
+
+ buffer->cluster_level = cluster_level;
+}
+
+/**
+ * hb_buffer_get_cluster_level:
+ * @buffer: a buffer.
+ *
+ *
+ *
+ * Return value:
+ *
+ * Since: 0.9.42
+ **/
+hb_buffer_cluster_level_t
+hb_buffer_get_cluster_level (hb_buffer_t *buffer)
+{
+ return buffer->cluster_level;
+}
+
/**
* hb_buffer_set_replacement_codepoint:
@@ -1056,7 +1125,7 @@ hb_buffer_get_flags (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.31
**/
void
hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer,
@@ -1076,7 +1145,7 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.31
**/
hb_codepoint_t
hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer)
@@ -1091,7 +1160,7 @@ hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_reset (hb_buffer_t *buffer)
@@ -1105,7 +1174,7 @@ hb_buffer_reset (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.11
**/
void
hb_buffer_clear_contents (hb_buffer_t *buffer)
@@ -1122,7 +1191,7 @@ hb_buffer_clear_contents (hb_buffer_t *buffer)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
@@ -1138,7 +1207,7 @@ hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_buffer_allocation_successful (hb_buffer_t *buffer)
@@ -1154,7 +1223,7 @@ hb_buffer_allocation_successful (hb_buffer_t *buffer)
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_buffer_add (hb_buffer_t *buffer,
@@ -1174,7 +1243,7 @@ hb_buffer_add (hb_buffer_t *buffer,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_buffer_set_length (hb_buffer_t *buffer,
@@ -1213,7 +1282,7 @@ hb_buffer_set_length (hb_buffer_t *buffer,
*
* Return value: buffer length.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_buffer_get_length (hb_buffer_t *buffer)
@@ -1231,7 +1300,7 @@ hb_buffer_get_length (hb_buffer_t *buffer)
*
* Return value: (transfer none) (array length=length): buffer glyph information array.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_glyph_info_t *
hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
@@ -1253,7 +1322,7 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
*
* Return value: (transfer none) (array length=length): buffer glyph position array.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_glyph_position_t *
hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
@@ -1274,7 +1343,7 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
*
* Reverses buffer contents.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_reverse (hb_buffer_t *buffer)
@@ -1283,6 +1352,23 @@ hb_buffer_reverse (hb_buffer_t *buffer)
}
/**
+ * hb_buffer_reverse_range:
+ * @buffer: a buffer.
+ * @start: start index.
+ * @end: end index.
+ *
+ * Reverses buffer contents between start to end.
+ *
+ * Since: 0.9.41
+ **/
+void
+hb_buffer_reverse_range (hb_buffer_t *buffer,
+ unsigned int start, unsigned int end)
+{
+ buffer->reverse_range (start, end);
+}
+
+/**
* hb_buffer_reverse_clusters:
* @buffer: a buffer.
*
@@ -1290,7 +1376,7 @@ hb_buffer_reverse (hb_buffer_t *buffer)
* reversed, then each cluster (consecutive items having the
* same cluster number) are reversed again.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_reverse_clusters (hb_buffer_t *buffer)
@@ -1320,7 +1406,7 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
* hb_language_get_default(). This may change in the future by
* taking buffer script into consideration when choosing a language.
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_buffer_guess_segment_properties (hb_buffer_t *buffer)
@@ -1407,7 +1493,7 @@ hb_buffer_add_utf (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_add_utf8 (hb_buffer_t *buffer,
@@ -1429,7 +1515,7 @@ hb_buffer_add_utf8 (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_add_utf16 (hb_buffer_t *buffer,
@@ -1451,7 +1537,7 @@ hb_buffer_add_utf16 (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_add_utf32 (hb_buffer_t *buffer,
@@ -1473,7 +1559,7 @@ hb_buffer_add_utf32 (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.39
**/
void
hb_buffer_add_latin1 (hb_buffer_t *buffer,
@@ -1495,7 +1581,7 @@ hb_buffer_add_latin1 (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.31
**/
void
hb_buffer_add_codepoints (hb_buffer_t *buffer,
@@ -1550,7 +1636,7 @@ normalize_glyphs_cluster (hb_buffer_t *buffer,
pos[end - 1].x_advance = total_x_advance;
pos[end - 1].y_advance = total_y_advance;
- hb_bubble_sort (buffer->info + start, end - start - 1, compare_info_codepoint, buffer->pos + start);
+ hb_stable_sort (buffer->info + start, end - start - 1, compare_info_codepoint, buffer->pos + start);
} else {
/* Transfer all cluster advance to the first glyph. */
pos[start].x_advance += total_x_advance;
@@ -1559,7 +1645,7 @@ normalize_glyphs_cluster (hb_buffer_t *buffer,
pos[i].x_offset -= total_x_advance;
pos[i].y_offset -= total_y_advance;
}
- hb_bubble_sort (buffer->info + start + 1, end - start - 1, compare_info_codepoint, buffer->pos + start + 1);
+ hb_stable_sort (buffer->info + start + 1, end - start - 1, compare_info_codepoint, buffer->pos + start + 1);
}
}
@@ -1569,7 +1655,7 @@ normalize_glyphs_cluster (hb_buffer_t *buffer,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_buffer_normalize_glyphs (hb_buffer_t *buffer)
@@ -1592,3 +1678,24 @@ hb_buffer_normalize_glyphs (hb_buffer_t *buffer)
}
normalize_glyphs_cluster (buffer, start, end, backward);
}
+
+void
+hb_buffer_t::sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *))
+{
+ assert (!have_positions);
+ for (unsigned int i = start + 1; i < end; i++)
+ {
+ unsigned int j = i;
+ while (j > start && compar (&info[j - 1], &info[i]) > 0)
+ j--;
+ if (i == j)
+ continue;
+ /* Move item i to occupy place for item j, shift what's in between. */
+ merge_clusters (j, i + 1);
+ {
+ hb_glyph_info_t t = info[i];
+ memmove (&info[j + 1], &info[j], (i - j) * sizeof (hb_glyph_info_t));
+ info[j] = t;
+ }
+ }
+}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer.h b/src/3rdparty/harfbuzz-ng/src/hb-buffer.h
index e5b46d867a..bb89dc3de7 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-buffer.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer.h
@@ -171,6 +171,9 @@ void
hb_buffer_guess_segment_properties (hb_buffer_t *buffer);
+/*
+ * Since: 0.9.20
+ */
typedef enum { /*< flags >*/
HB_BUFFER_FLAG_DEFAULT = 0x00000000u,
HB_BUFFER_FLAG_BOT = 0x00000001u, /* Beginning-of-text */
@@ -185,7 +188,22 @@ hb_buffer_set_flags (hb_buffer_t *buffer,
hb_buffer_flags_t
hb_buffer_get_flags (hb_buffer_t *buffer);
+/*
+ * Since: 0.9.42
+ */
+typedef enum {
+ HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0,
+ HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1,
+ HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2,
+ HB_BUFFER_CLUSTER_LEVEL_DEFAULT = HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES
+} hb_buffer_cluster_level_t;
+void
+hb_buffer_set_cluster_level (hb_buffer_t *buffer,
+ hb_buffer_cluster_level_t cluster_level);
+
+hb_buffer_cluster_level_t
+hb_buffer_get_cluster_level (hb_buffer_t *buffer);
#define HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT 0xFFFDu
@@ -222,6 +240,10 @@ void
hb_buffer_reverse (hb_buffer_t *buffer);
void
+hb_buffer_reverse_range (hb_buffer_t *buffer,
+ unsigned int start, unsigned int end);
+
+void
hb_buffer_reverse_clusters (hb_buffer_t *buffer);
@@ -303,11 +325,15 @@ hb_buffer_normalize_glyphs (hb_buffer_t *buffer);
* Serialize
*/
+/*
+ * Since: 0.9.20
+ */
typedef enum { /*< flags >*/
HB_BUFFER_SERIALIZE_FLAG_DEFAULT = 0x00000000u,
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 0x00000001u,
HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 0x00000002u,
- HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004u
+ HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004u,
+ HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS = 0x00000008u
} hb_buffer_serialize_flags_t;
typedef enum {
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-common.cc b/src/3rdparty/harfbuzz-ng/src/hb-common.cc
index 1516211e96..e67059d10b 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-common.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-common.cc
@@ -64,7 +64,7 @@ _hb_options_init (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_tag_t
hb_tag_from_string (const char *str, int len)
@@ -92,7 +92,7 @@ hb_tag_from_string (const char *str, int len)
*
*
*
- * Since: 1.0
+ * Since: 0.9.5
**/
void
hb_tag_to_string (hb_tag_t tag, char *buf)
@@ -122,7 +122,7 @@ const char direction_strings[][4] = {
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_direction_t
hb_direction_from_string (const char *str, int len)
@@ -149,7 +149,7 @@ hb_direction_from_string (const char *str, int len)
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_direction_to_string (hb_direction_t direction)
@@ -179,7 +179,7 @@ static const char canon_map[256] = {
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, 0
};
-static hb_bool_t
+static bool
lang_equal (hb_language_t v1,
const void *v2)
{
@@ -286,28 +286,28 @@ retry:
*
*
*
- * Return value:
+ * Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_language_t
hb_language_from_string (const char *str, int len)
{
- char strbuf[64];
-
if (!str || !len || !*str)
return HB_LANGUAGE_INVALID;
+ hb_language_item_t *item = NULL;
if (len >= 0)
{
/* NUL-terminate it. */
+ char strbuf[64];
len = MIN (len, (int) sizeof (strbuf) - 1);
memcpy (strbuf, str, len);
strbuf[len] = '\0';
- str = strbuf;
+ item = lang_find_or_insert (strbuf);
}
-
- hb_language_item_t *item = lang_find_or_insert (str);
+ else
+ item = lang_find_or_insert (str);
return likely (item) ? item->lang : HB_LANGUAGE_INVALID;
}
@@ -320,7 +320,7 @@ hb_language_from_string (const char *str, int len)
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_language_to_string (hb_language_t language)
@@ -334,9 +334,9 @@ hb_language_to_string (hb_language_t language)
*
*
*
- * Return value:
+ * Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_language_t
hb_language_get_default (void)
@@ -363,7 +363,7 @@ hb_language_get_default (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_script_t
hb_script_from_iso15924_tag (hb_tag_t tag)
@@ -408,7 +408,7 @@ hb_script_from_iso15924_tag (hb_tag_t tag)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_script_t
hb_script_from_string (const char *s, int len)
@@ -424,7 +424,7 @@ hb_script_from_string (const char *s, int len)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_tag_t
hb_script_to_iso15924_tag (hb_script_t script)
@@ -440,7 +440,7 @@ hb_script_to_iso15924_tag (hb_script_t script)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_direction_t
hb_script_get_horizontal_direction (hb_script_t script)
@@ -493,6 +493,9 @@ hb_script_get_horizontal_direction (hb_script_t script)
case HB_SCRIPT_PALMYRENE:
case HB_SCRIPT_PSALTER_PAHLAVI:
+ /* Unicode-8.0 additions */
+ case HB_SCRIPT_OLD_HUNGARIAN:
+
return HB_DIRECTION_RTL;
}
@@ -542,7 +545,7 @@ hb_user_data_array_t::get (hb_user_data_key_t *key)
*
* Returns library version as three integer components.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_version (unsigned int *major,
@@ -561,7 +564,7 @@ hb_version (unsigned int *major,
*
* Return value: library version string.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_version_string (void)
@@ -579,7 +582,7 @@ hb_version_string (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.30
**/
hb_bool_t
hb_version_atleast (unsigned int major,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-common.h b/src/3rdparty/harfbuzz-ng/src/hb-common.h
index b6ce3f724d..c291dbbe94 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-common.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-common.h
@@ -272,6 +272,9 @@ typedef enum
/*6.1*/ HB_SCRIPT_SORA_SOMPENG = HB_TAG ('S','o','r','a'),
/*6.1*/ HB_SCRIPT_TAKRI = HB_TAG ('T','a','k','r'),
+ /*
+ * Since: 0.9.30
+ */
/*7.0*/ HB_SCRIPT_BASSA_VAH = HB_TAG ('B','a','s','s'),
/*7.0*/ HB_SCRIPT_CAUCASIAN_ALBANIAN = HB_TAG ('A','g','h','b'),
/*7.0*/ HB_SCRIPT_DUPLOYAN = HB_TAG ('D','u','p','l'),
@@ -296,6 +299,13 @@ typedef enum
/*7.0*/ HB_SCRIPT_TIRHUTA = HB_TAG ('T','i','r','h'),
/*7.0*/ HB_SCRIPT_WARANG_CITI = HB_TAG ('W','a','r','a'),
+ /*8.0*/ HB_SCRIPT_AHOM = HB_TAG ('A','h','o','m'),
+ /*8.0*/ HB_SCRIPT_ANATOLIAN_HIEROGLYPHS = HB_TAG ('H','l','u','w'),
+ /*8.0*/ HB_SCRIPT_HATRAN = HB_TAG ('H','a','t','r'),
+ /*8.0*/ HB_SCRIPT_MULTANI = HB_TAG ('M','u','l','t'),
+ /*8.0*/ HB_SCRIPT_OLD_HUNGARIAN = HB_TAG ('H','u','n','g'),
+ /*8.0*/ HB_SCRIPT_SIGNWRITING = HB_TAG ('S','g','n','w'),
+
/* No script set. */
HB_SCRIPT_INVALID = HB_TAG_NONE,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
index ab9e1d4a93..76c81e48f4 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
@@ -104,6 +104,7 @@ hb_coretext_shaper_face_data_t *
_hb_coretext_shaper_face_data_create (hb_face_t *face)
{
hb_coretext_shaper_face_data_t *data = NULL;
+
#if 0
if (face->destroy == (hb_destroy_func_t) CGFontRelease)
{
@@ -129,6 +130,7 @@ _hb_coretext_shaper_face_data_create (hb_face_t *face)
CoreTextFontEngineData *coreTextFontEngineData = (CoreTextFontEngineData *) fontEngineFaceData->user_data;
data = CGFontRetain (coreTextFontEngineData->cgFont);
#endif
+
if (unlikely (!data)) {
DEBUG_MSG (CORETEXT, face, "Face CGFontCreateWithDataProvider() failed");
}
@@ -142,6 +144,9 @@ _hb_coretext_shaper_face_data_destroy (hb_coretext_shaper_face_data_t *data)
CFRelease (data);
}
+/*
+ * Since: 0.9.10
+ */
CGFontRef
hb_coretext_face_get_cg_font (hb_face_t *face)
{
@@ -174,6 +179,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font)
hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
/* Choose a CoreText font size and calculate multipliers to convert to HarfBuzz space. */
+ /* TODO: use upem instead of 36? */
CGFloat font_size = 36.; /* Default... */
/* No idea if the following is even a good idea. */
if (font->y_ppem)
@@ -812,6 +818,17 @@ retry:
buffer->len = 0;
uint32_t status_and = ~0, status_or = 0;
double advances_so_far = 0;
+ /* For right-to-left runs, CoreText returns the glyphs positioned such that
+ * any trailing whitespace is to the left of (0,0). Adjust coordinate system
+ * to fix for that. Test with any RTL string with trailing spaces.
+ * https://code.google.com/p/chromium/issues/detail?id=469028
+ */
+ if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction))
+ {
+ advances_so_far -= CTLineGetTrailingWhitespaceWidth (line);
+ if (HB_DIRECTION_IS_VERTICAL (buffer->props.direction))
+ advances_so_far = -advances_so_far;
+ }
const CFRange range_all = CFRangeMake (0, 0);
@@ -929,8 +946,8 @@ retry:
info->cluster = log_clusters[j];
info->mask = advance;
- info->var1.u32 = x_offset;
- info->var2.u32 = y_offset;
+ info->var1.i32 = x_offset;
+ info->var2.i32 = y_offset;
info++;
buffer->len++;
@@ -1022,8 +1039,8 @@ retry:
else /* last glyph */
advance = run_advance - (positions[j].x - positions[0].x);
info->mask = advance * x_mult;
- info->var1.u32 = x_offset;
- info->var2.u32 = positions[j].y * y_mult;
+ info->var1.i32 = x_offset;
+ info->var2.i32 = positions[j].y * y_mult;
info++;
}
}
@@ -1038,8 +1055,8 @@ retry:
else /* last glyph */
advance = run_advance - (positions[j].y - positions[0].y);
info->mask = advance * y_mult;
- info->var1.u32 = positions[j].x * x_mult;
- info->var2.u32 = y_offset;
+ info->var1.i32 = positions[j].x * x_mult;
+ info->var2.i32 = y_offset;
info++;
}
}
@@ -1068,10 +1085,20 @@ retry:
buffer->len += num_glyphs;
}
- /* Make sure all runs had the expected direction. */
- bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction);
- assert (bool (status_and & kCTRunStatusRightToLeft) == backward);
- assert (bool (status_or & kCTRunStatusRightToLeft) == backward);
+ /* Mac OS 10.6 doesn't have kCTTypesetterOptionForcedEmbeddingLevel,
+ * or if it does, it doesn't resepct it. So we get runs with wrong
+ * directions. As such, disable the assert... It wouldn't crash, but
+ * cursoring will be off...
+ *
+ * http://crbug.com/419769
+ */
+ if (0)
+ {
+ /* Make sure all runs had the expected direction. */
+ bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction);
+ assert (bool (status_and & kCTRunStatusRightToLeft) == backward);
+ assert (bool (status_or & kCTRunStatusRightToLeft) == backward);
+ }
buffer->clear_positions ();
@@ -1082,16 +1109,16 @@ retry:
for (unsigned int i = 0; i < count; i++)
{
pos->x_advance = info->mask;
- pos->x_offset = info->var1.u32;
- pos->y_offset = info->var2.u32;
+ pos->x_offset = info->var1.i32;
+ pos->y_offset = info->var2.i32;
info++, pos++;
}
else
for (unsigned int i = 0; i < count; i++)
{
pos->y_advance = info->mask;
- pos->x_offset = info->var1.u32;
- pos->y_offset = info->var2.u32;
+ pos->x_offset = info->var1.i32;
+ pos->y_offset = info->var2.i32;
info++, pos++;
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-face.cc b/src/3rdparty/harfbuzz-ng/src/hb-face.cc
index 9348af7bf8..9effc41c88 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-face.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-face.cc
@@ -77,7 +77,7 @@ const hb_face_t _hb_face_nil = {
*
* Return value: (transfer full)
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_face_t *
hb_face_create_for_tables (hb_reference_table_func_t reference_table_func,
@@ -113,7 +113,7 @@ _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index)
{
hb_face_for_data_closure_t *closure;
- closure = (hb_face_for_data_closure_t *) malloc (sizeof (hb_face_for_data_closure_t));
+ closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_closure_t));
if (unlikely (!closure))
return NULL;
@@ -157,7 +157,7 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_face_t *
hb_face_create (hb_blob_t *blob,
@@ -165,8 +165,8 @@ hb_face_create (hb_blob_t *blob,
{
hb_face_t *face;
- if (unlikely (!blob || !hb_blob_get_length (blob)))
- return hb_face_get_empty ();
+ if (unlikely (!blob))
+ blob = hb_blob_get_empty ();
hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (OT::Sanitizer<OT::OpenTypeFontFile>::sanitize (hb_blob_reference (blob)), index);
@@ -189,7 +189,7 @@ hb_face_create (hb_blob_t *blob,
*
* Return value: (transfer full)
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_face_t *
hb_face_get_empty (void)
@@ -206,7 +206,7 @@ hb_face_get_empty (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_face_t *
hb_face_reference (hb_face_t *face)
@@ -220,7 +220,7 @@ hb_face_reference (hb_face_t *face)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_face_destroy (hb_face_t *face)
@@ -257,7 +257,7 @@ hb_face_destroy (hb_face_t *face)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_face_set_user_data (hb_face_t *face,
@@ -278,7 +278,7 @@ hb_face_set_user_data (hb_face_t *face,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_face_get_user_data (hb_face_t *face,
@@ -293,7 +293,7 @@ hb_face_get_user_data (hb_face_t *face,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_face_make_immutable (hb_face_t *face)
@@ -312,7 +312,7 @@ hb_face_make_immutable (hb_face_t *face)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_face_is_immutable (hb_face_t *face)
@@ -330,7 +330,7 @@ hb_face_is_immutable (hb_face_t *face)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_blob_t *
hb_face_reference_table (hb_face_t *face,
@@ -347,7 +347,7 @@ hb_face_reference_table (hb_face_t *face,
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_blob_t *
hb_face_reference_blob (hb_face_t *face)
@@ -362,7 +362,7 @@ hb_face_reference_blob (hb_face_t *face)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_face_set_index (hb_face_t *face,
@@ -382,7 +382,7 @@ hb_face_set_index (hb_face_t *face,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_face_get_index (hb_face_t *face)
@@ -397,7 +397,7 @@ hb_face_get_index (hb_face_t *face)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_face_set_upem (hb_face_t *face,
@@ -417,7 +417,7 @@ hb_face_set_upem (hb_face_t *face,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_face_get_upem (hb_face_t *face)
@@ -441,7 +441,7 @@ hb_face_t::load_upem (void) const
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_face_set_glyph_count (hb_face_t *face,
@@ -461,7 +461,7 @@ hb_face_set_glyph_count (hb_face_t *face,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
unsigned int
hb_face_get_glyph_count (hb_face_t *face)
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-font-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-font-private.hh
index 33bbf7143a..c05499d4c2 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-font-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-font-private.hh
@@ -268,7 +268,7 @@ struct hb_font_t {
{
*x = get_glyph_h_advance (glyph) / 2;
- /* TODO use font_metics.ascent */
+ /* TODO use font_metrics.ascent */
*y = y_scale;
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-font.cc b/src/3rdparty/harfbuzz-ng/src/hb-font.cc
index d42db59855..6a69cae313 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-font.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-font.cc
@@ -236,7 +236,7 @@ static const hb_font_funcs_t _hb_font_funcs_nil = {
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_funcs_t *
hb_font_funcs_create (void)
@@ -258,7 +258,7 @@ hb_font_funcs_create (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_funcs_t *
hb_font_funcs_get_empty (void)
@@ -274,7 +274,7 @@ hb_font_funcs_get_empty (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_funcs_t *
hb_font_funcs_reference (hb_font_funcs_t *ffuncs)
@@ -288,7 +288,7 @@ hb_font_funcs_reference (hb_font_funcs_t *ffuncs)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
@@ -315,7 +315,7 @@ hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
@@ -336,7 +336,7 @@ hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
@@ -352,7 +352,7 @@ hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
@@ -371,7 +371,7 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs)
@@ -425,7 +425,7 @@ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph (hb_font_t *font,
@@ -444,7 +444,7 @@ hb_font_get_glyph (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_position_t
hb_font_get_glyph_h_advance (hb_font_t *font,
@@ -462,7 +462,7 @@ hb_font_get_glyph_h_advance (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_position_t
hb_font_get_glyph_v_advance (hb_font_t *font,
@@ -482,7 +482,7 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_h_origin (hb_font_t *font,
@@ -503,7 +503,7 @@ hb_font_get_glyph_h_origin (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_v_origin (hb_font_t *font,
@@ -523,7 +523,7 @@ hb_font_get_glyph_v_origin (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_position_t
hb_font_get_glyph_h_kerning (hb_font_t *font,
@@ -542,7 +542,7 @@ hb_font_get_glyph_h_kerning (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_position_t
hb_font_get_glyph_v_kerning (hb_font_t *font,
@@ -561,7 +561,7 @@ hb_font_get_glyph_v_kerning (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_extents (hb_font_t *font,
@@ -583,7 +583,7 @@ hb_font_get_glyph_extents (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_contour_point (hb_font_t *font,
@@ -604,7 +604,7 @@ hb_font_get_glyph_contour_point (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_name (hb_font_t *font,
@@ -625,7 +625,7 @@ hb_font_get_glyph_name (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_from_name (hb_font_t *font,
@@ -648,7 +648,7 @@ hb_font_get_glyph_from_name (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_get_glyph_advance_for_direction (hb_font_t *font,
@@ -669,7 +669,7 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_get_glyph_origin_for_direction (hb_font_t *font,
@@ -690,7 +690,7 @@ hb_font_get_glyph_origin_for_direction (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_add_glyph_origin_for_direction (hb_font_t *font,
@@ -711,7 +711,7 @@ hb_font_add_glyph_origin_for_direction (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
@@ -733,7 +733,7 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
@@ -755,7 +755,7 @@ hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_extents_for_origin (hb_font_t *font,
@@ -779,7 +779,7 @@ hb_font_get_glyph_extents_for_origin (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
@@ -800,7 +800,7 @@ hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_glyph_to_string (hb_font_t *font,
@@ -822,7 +822,7 @@ hb_font_glyph_to_string (hb_font_t *font,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_glyph_from_string (hb_font_t *font,
@@ -845,7 +845,7 @@ hb_font_glyph_from_string (hb_font_t *font,
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_t *
hb_font_create (hb_face_t *face)
@@ -854,8 +854,6 @@ hb_font_create (hb_face_t *face)
if (unlikely (!face))
face = hb_face_get_empty ();
- if (unlikely (hb_object_is_inert (face)))
- return hb_font_get_empty ();
if (!(font = hb_object_create<hb_font_t> ()))
return hb_font_get_empty ();
@@ -863,6 +861,8 @@ hb_font_create (hb_face_t *face)
font->face = hb_face_reference (face);
font->klass = hb_font_funcs_get_empty ();
+ font->x_scale = font->y_scale = hb_face_get_upem (face);
+
return font;
}
@@ -874,20 +874,19 @@ hb_font_create (hb_face_t *face)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_t *
hb_font_create_sub_font (hb_font_t *parent)
{
if (unlikely (!parent))
- return hb_font_get_empty ();
+ parent = hb_font_get_empty ();
hb_font_t *font = hb_font_create (parent->face);
if (unlikely (hb_object_is_inert (font)))
return font;
- hb_font_make_immutable (parent);
font->parent = hb_font_reference (parent);
font->x_scale = parent->x_scale;
@@ -905,7 +904,7 @@ hb_font_create_sub_font (hb_font_t *parent)
*
* Return value: (transfer full)
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_t *
hb_font_get_empty (void)
@@ -946,7 +945,7 @@ hb_font_get_empty (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_t *
hb_font_reference (hb_font_t *font)
@@ -960,7 +959,7 @@ hb_font_reference (hb_font_t *font)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_destroy (hb_font_t *font)
@@ -993,7 +992,7 @@ hb_font_destroy (hb_font_t *font)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_set_user_data (hb_font_t *font,
@@ -1014,7 +1013,7 @@ hb_font_set_user_data (hb_font_t *font,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_font_get_user_data (hb_font_t *font,
@@ -1029,7 +1028,7 @@ hb_font_get_user_data (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_make_immutable (hb_font_t *font)
@@ -1037,6 +1036,9 @@ hb_font_make_immutable (hb_font_t *font)
if (unlikely (hb_object_is_inert (font)))
return;
+ if (font->parent)
+ hb_font_make_immutable (font->parent);
+
font->immutable = true;
}
@@ -1048,7 +1050,7 @@ hb_font_make_immutable (hb_font_t *font)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_font_is_immutable (hb_font_t *font)
@@ -1057,6 +1059,32 @@ hb_font_is_immutable (hb_font_t *font)
}
/**
+ * hb_font_set_parent:
+ * @font: a font.
+ * @parent: new parent.
+ *
+ * Sets parent font of @font.
+ *
+ * Since: 1.0.5
+ **/
+void
+hb_font_set_parent (hb_font_t *font,
+ hb_font_t *parent)
+{
+ if (font->immutable)
+ return;
+
+ if (!parent)
+ parent = hb_font_get_empty ();
+
+ hb_font_t *old = font->parent;
+
+ font->parent = hb_font_reference (parent);
+
+ hb_font_destroy (old);
+}
+
+/**
* hb_font_get_parent:
* @font: a font.
*
@@ -1064,7 +1092,7 @@ hb_font_is_immutable (hb_font_t *font)
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_font_t *
hb_font_get_parent (hb_font_t *font)
@@ -1080,7 +1108,7 @@ hb_font_get_parent (hb_font_t *font)
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_face_t *
hb_font_get_face (hb_font_t *font)
@@ -1098,7 +1126,7 @@ hb_font_get_face (hb_font_t *font)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_set_funcs (hb_font_t *font,
@@ -1133,7 +1161,7 @@ hb_font_set_funcs (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_set_funcs_data (hb_font_t *font,
@@ -1163,7 +1191,7 @@ hb_font_set_funcs_data (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_set_scale (hb_font_t *font,
@@ -1185,7 +1213,7 @@ hb_font_set_scale (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_get_scale (hb_font_t *font,
@@ -1204,7 +1232,7 @@ hb_font_get_scale (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_set_ppem (hb_font_t *font,
@@ -1226,7 +1254,7 @@ hb_font_set_ppem (hb_font_t *font,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_get_ppem (hb_font_t *font,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-font.h b/src/3rdparty/harfbuzz-ng/src/hb-font.h
index 7273db43ed..fb4a0eab5a 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-font.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-font.h
@@ -80,12 +80,13 @@ hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);
/* glyph extents */
+/* Note that height is negative in coordinate systems that grow up. */
typedef struct hb_glyph_extents_t
{
- hb_position_t x_bearing;
- hb_position_t y_bearing;
- hb_position_t width;
- hb_position_t height;
+ hb_position_t x_bearing; /* left side of glyph from origin. */
+ hb_position_t y_bearing; /* top side of glyph from origin. */
+ hb_position_t width; /* distance from left to right side. */
+ hb_position_t height; /* distance from top to bottom side. */
} hb_glyph_extents_t;
@@ -148,7 +149,7 @@ typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
@@ -164,7 +165,7 @@ hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
@@ -180,7 +181,7 @@ hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
@@ -196,7 +197,7 @@ hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
@@ -212,7 +213,7 @@ hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
@@ -228,7 +229,7 @@ hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
@@ -244,7 +245,7 @@ hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
@@ -260,7 +261,7 @@ hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
@@ -276,7 +277,7 @@ hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
@@ -292,7 +293,7 @@ hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
@@ -308,7 +309,7 @@ hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs,
@@ -458,6 +459,10 @@ hb_font_make_immutable (hb_font_t *font);
hb_bool_t
hb_font_is_immutable (hb_font_t *font);
+void
+hb_font_set_parent (hb_font_t *font,
+ hb_font_t *parent);
+
hb_font_t *
hb_font_get_parent (hb_font_t *font);
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh
index a8ea39ccfd..ed2703571c 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh
@@ -39,7 +39,13 @@
/* We need external help for these */
-#if 0
+#if defined(HB_MUTEX_IMPL_INIT) \
+ && defined(hb_mutex_impl_init) \
+ && defined(hb_mutex_impl_lock) \
+ && defined(hb_mutex_impl_unlock) \
+ && defined(hb_mutex_impl_finish)
+
+/* Defined externally, i.e. in config.h; must have typedef'ed hb_mutex_impl_t as well. */
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
@@ -113,10 +119,12 @@ typedef int hb_mutex_impl_t;
#define hb_mutex_impl_unlock(M) HB_STMT_START {} HB_STMT_END
#define hb_mutex_impl_finish(M) HB_STMT_START {} HB_STMT_END
+
#endif
#define HB_MUTEX_INIT {HB_MUTEX_IMPL_INIT}
+
struct hb_mutex_t
{
/* TODO Add tracing. */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-object-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-object-private.hh
index 7bd0f1624b..6b73ff92d0 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-object-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-object-private.hh
@@ -47,19 +47,22 @@
/* reference_count */
-#define HB_REFERENCE_COUNT_INVALID_VALUE ((hb_atomic_int_t) -1)
-#define HB_REFERENCE_COUNT_INVALID {HB_REFERENCE_COUNT_INVALID_VALUE}
+#define HB_REFERENCE_COUNT_INERT_VALUE -1
+#define HB_REFERENCE_COUNT_POISON_VALUE -0x0000DEAD
+#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INERT_VALUE)}
+
struct hb_reference_count_t
{
hb_atomic_int_t ref_count;
- inline void init (int v) { ref_count = v; }
- inline int inc (void) { return hb_atomic_int_add (const_cast<hb_atomic_int_t &> (ref_count), 1); }
- inline int dec (void) { return hb_atomic_int_add (const_cast<hb_atomic_int_t &> (ref_count), -1); }
- inline void finish (void) { ref_count = HB_REFERENCE_COUNT_INVALID_VALUE; }
-
- inline bool is_invalid (void) const { return ref_count == HB_REFERENCE_COUNT_INVALID_VALUE; }
+ inline void init (int v) { ref_count.set_unsafe (v); }
+ inline int get_unsafe (void) const { return ref_count.get_unsafe (); }
+ inline int inc (void) { return ref_count.inc (); }
+ inline int dec (void) { return ref_count.dec (); }
+ inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); }
+ inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; }
+ inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; }
};
@@ -102,7 +105,7 @@ struct hb_object_header_t
hb_reference_count_t ref_count;
hb_user_data_array_t user_data;
-#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INVALID, HB_USER_DATA_ARRAY_INIT}
+#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INIT, HB_USER_DATA_ARRAY_INIT}
private:
ASSERT_POD ();
@@ -117,7 +120,7 @@ static inline void hb_object_trace (const Type *obj, const char *function)
DEBUG_MSG (OBJECT, (void *) obj,
"%s refcount=%d",
function,
- obj ? obj->header.ref_count.ref_count : 0);
+ obj ? obj->header.ref_count.get_unsafe () : 0);
}
template <typename Type>
@@ -141,7 +144,12 @@ static inline void hb_object_init (Type *obj)
template <typename Type>
static inline bool hb_object_is_inert (const Type *obj)
{
- return unlikely (obj->header.ref_count.is_invalid ());
+ return unlikely (obj->header.ref_count.is_inert ());
+}
+template <typename Type>
+static inline bool hb_object_is_valid (const Type *obj)
+{
+ return likely (obj->header.ref_count.is_valid ());
}
template <typename Type>
static inline Type *hb_object_reference (Type *obj)
@@ -149,6 +157,7 @@ static inline Type *hb_object_reference (Type *obj)
hb_object_trace (obj, HB_FUNC);
if (unlikely (!obj || hb_object_is_inert (obj)))
return obj;
+ assert (hb_object_is_valid (obj));
obj->header.ref_count.inc ();
return obj;
}
@@ -158,6 +167,7 @@ static inline bool hb_object_destroy (Type *obj)
hb_object_trace (obj, HB_FUNC);
if (unlikely (!obj || hb_object_is_inert (obj)))
return false;
+ assert (hb_object_is_valid (obj));
if (obj->header.ref_count.dec () != 1)
return false;
@@ -174,6 +184,7 @@ static inline bool hb_object_set_user_data (Type *obj,
{
if (unlikely (!obj || hb_object_is_inert (obj)))
return false;
+ assert (hb_object_is_valid (obj));
return obj->header.user_data.set (key, data, destroy, replace);
}
@@ -183,6 +194,7 @@ static inline void *hb_object_get_user_data (Type *obj,
{
if (unlikely (!obj || hb_object_is_inert (obj)))
return NULL;
+ assert (hb_object_is_valid (obj));
return obj->header.user_data.get (key);
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh
index 178bc7ccb8..152230a0e5 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh
@@ -56,7 +56,7 @@ typedef struct TableRecord
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
Tag tag; /* 4-byte identifier. */
@@ -106,7 +106,7 @@ typedef struct OffsetTable
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables));
+ return_trace (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables));
}
protected:
@@ -135,7 +135,7 @@ struct TTCHeaderVersion1
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (table.sanitize (c, this));
+ return_trace (table.sanitize (c, this));
}
protected:
@@ -175,11 +175,11 @@ struct TTCHeader
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!u.header.version.sanitize (c))) return TRACE_RETURN (false);
+ if (unlikely (!u.header.version.sanitize (c))) return_trace (false);
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
- case 1: return TRACE_RETURN (u.version1.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 1: return_trace (u.version1.sanitize (c));
+ default:return_trace (true);
}
}
@@ -240,14 +240,14 @@ struct OpenTypeFontFile
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!u.tag.sanitize (c))) return TRACE_RETURN (false);
+ if (unlikely (!u.tag.sanitize (c))) return_trace (false);
switch (u.tag) {
case CFFTag: /* All the non-collection tags */
case TrueTag:
case Typ1Tag:
- case TrueTypeTag: return TRACE_RETURN (u.fontFace.sanitize (c));
- case TTCTag: return TRACE_RETURN (u.ttcHeader.sanitize (c));
- default: return TRACE_RETURN (true);
+ case TrueTypeTag: return_trace (u.fontFace.sanitize (c));
+ case TTCTag: return_trace (u.ttcHeader.sanitize (c));
+ default: return_trace (true);
}
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh
index 75a0f568d1..f053502ded 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh
@@ -154,6 +154,20 @@ ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
#define Null(Type) Null<Type>()
+/*
+ * Dispatch
+ */
+
+template <typename Context, typename Return, unsigned int MaxDebugDepth>
+struct hb_dispatch_context_t
+{
+ static const unsigned int max_debug_depth = MaxDebugDepth;
+ typedef Return return_t;
+ template <typename T, typename F>
+ inline bool may_dispatch (const T *obj, const F *format) { return true; }
+ static return_t no_dispatch_return_value (void) { return Context::default_return_value (); }
+};
+
/*
* Sanitize
@@ -174,17 +188,23 @@ ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
#define HB_SANITIZE_MAX_EDITS 100
#endif
-struct hb_sanitize_context_t
+struct hb_sanitize_context_t :
+ hb_dispatch_context_t<hb_sanitize_context_t, bool, HB_DEBUG_SANITIZE>
{
+ inline hb_sanitize_context_t (void) :
+ debug_depth (0),
+ start (NULL), end (NULL),
+ writable (false), edit_count (0),
+ blob (NULL) {}
+
inline const char *get_name (void) { return "SANITIZE"; }
- static const unsigned int max_debug_depth = HB_DEBUG_SANITIZE;
- typedef bool return_t;
template <typename T, typename F>
inline bool may_dispatch (const T *obj, const F *format)
{ return format->sanitize (this); }
template <typename T>
inline return_t dispatch (const T &obj) { return obj.sanitize (this); }
static return_t default_return_value (void) { return true; }
+ static return_t no_dispatch_return_value (void) { return false; }
bool stop_sublookup_iteration (const return_t r) const { return !r; }
inline void init (hb_blob_t *b)
@@ -295,7 +315,7 @@ template <typename Type>
struct Sanitizer
{
static hb_blob_t *sanitize (hb_blob_t *blob) {
- hb_sanitize_context_t c[1] = {{0, NULL, NULL, false, 0, NULL}};
+ hb_sanitize_context_t c[1];
bool sane;
/* TODO is_sane() stuff */
@@ -379,9 +399,9 @@ struct Sanitizer
struct hb_serialize_context_t
{
- inline hb_serialize_context_t (void *start, unsigned int size)
+ inline hb_serialize_context_t (void *start_, unsigned int size)
{
- this->start = (char *) start;
+ this->start = (char *) start_;
this->end = this->start + size;
this->ran_out_of_room = false;
@@ -475,10 +495,10 @@ struct hb_serialize_context_t
return reinterpret_cast<Type *> (&obj);
}
- inline void truncate (void *head)
+ inline void truncate (void *new_head)
{
- assert (this->start < head && head <= this->head);
- this->head = (char *) head;
+ assert (this->start < new_head && new_head <= this->head);
+ this->head = (char *) new_head;
}
unsigned int debug_depth;
@@ -536,6 +556,20 @@ struct Supplier
template <typename Type, int Bytes> struct BEInt;
template <typename Type>
+struct BEInt<Type, 1>
+{
+ public:
+ inline void set (Type V)
+ {
+ v = V;
+ }
+ inline operator Type (void) const
+ {
+ return v;
+ }
+ private: uint8_t v;
+};
+template <typename Type>
struct BEInt<Type, 2>
{
public:
@@ -610,7 +644,7 @@ struct IntType
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (likely (c->check_struct (this)));
+ return_trace (likely (c->check_struct (this)));
}
protected:
BEInt<Type, Size> v;
@@ -618,7 +652,7 @@ struct IntType
DEFINE_SIZE_STATIC (Size);
};
-typedef uint8_t BYTE; /* 8-bit unsigned integer. */
+typedef IntType<uint8_t , 1> BYTE; /* 8-bit unsigned integer. */
typedef IntType<uint16_t, 2> USHORT; /* 16-bit unsigned integer. */
typedef IntType<int16_t, 2> SHORT; /* 16-bit signed integer. */
typedef IntType<uint32_t, 4> ULONG; /* 32-bit unsigned integer. */
@@ -638,7 +672,7 @@ struct LONGDATETIME
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (likely (c->check_struct (this)));
+ return_trace (likely (c->check_struct (this)));
}
protected:
LONG major;
@@ -715,7 +749,7 @@ struct FixedVersion
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
USHORT major;
@@ -751,21 +785,21 @@ struct OffsetTo : Offset<OffsetType>
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false);
+ if (unlikely (!c->check_struct (this))) return_trace (false);
unsigned int offset = *this;
- if (unlikely (!offset)) return TRACE_RETURN (true);
+ if (unlikely (!offset)) return_trace (true);
const Type &obj = StructAtOffset<Type> (base, offset);
- return TRACE_RETURN (likely (obj.sanitize (c)) || neuter (c));
+ return_trace (likely (obj.sanitize (c)) || neuter (c));
}
template <typename T>
inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const
{
TRACE_SANITIZE (this);
- if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false);
+ if (unlikely (!c->check_struct (this))) return_trace (false);
unsigned int offset = *this;
- if (unlikely (!offset)) return TRACE_RETURN (true);
+ if (unlikely (!offset)) return_trace (true);
const Type &obj = StructAtOffset<Type> (base, offset);
- return TRACE_RETURN (likely (obj.sanitize (c, user_data)) || neuter (c));
+ return_trace (likely (obj.sanitize (c, user_data)) || neuter (c));
}
/* Set the offset to Null */
@@ -816,10 +850,10 @@ struct ArrayOf
unsigned int items_len)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
len.set (items_len); /* TODO(serialize) Overflow? */
- if (unlikely (!c->extend (*this))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!c->extend (*this))) return_trace (false);
+ return_trace (true);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -827,17 +861,17 @@ struct ArrayOf
unsigned int items_len)
{
TRACE_SERIALIZE (this);
- if (unlikely (!serialize (c, items_len))) return TRACE_RETURN (false);
+ if (unlikely (!serialize (c, items_len))) return_trace (false);
for (unsigned int i = 0; i < items_len; i++)
array[i] = items[i];
items.advance (items_len);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+ if (unlikely (!sanitize_shallow (c))) return_trace (false);
/* Note: for structs that do not reference other structs,
* we do not need to call their sanitize() as we already did
@@ -848,28 +882,28 @@ struct ArrayOf
*/
(void) (false && array[0].sanitize (c));
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+ if (unlikely (!sanitize_shallow (c))) return_trace (false);
unsigned int count = len;
for (unsigned int i = 0; i < count; i++)
if (unlikely (!array[i].sanitize (c, base)))
- return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ return_trace (false);
+ return_trace (true);
}
template <typename T>
inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const
{
TRACE_SANITIZE (this);
- if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+ if (unlikely (!sanitize_shallow (c))) return_trace (false);
unsigned int count = len;
for (unsigned int i = 0; i < count; i++)
if (unlikely (!array[i].sanitize (c, base, user_data)))
- return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ return_trace (false);
+ return_trace (true);
}
template <typename SearchType>
@@ -886,7 +920,7 @@ struct ArrayOf
inline bool sanitize_shallow (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && c->check_array (this, Type::static_size, len));
+ return_trace (c->check_struct (this) && c->check_array (array, Type::static_size, len));
}
public:
@@ -913,13 +947,13 @@ struct OffsetListOf : OffsetArrayOf<Type>
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (OffsetArrayOf<Type>::sanitize (c, this));
+ return_trace (OffsetArrayOf<Type>::sanitize (c, this));
}
template <typename T>
inline bool sanitize (hb_sanitize_context_t *c, T user_data) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (OffsetArrayOf<Type>::sanitize (c, this, user_data));
+ return_trace (OffsetArrayOf<Type>::sanitize (c, this, user_data));
}
};
@@ -941,14 +975,14 @@ struct HeadlessArrayOf
unsigned int items_len)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
len.set (items_len); /* TODO(serialize) Overflow? */
- if (unlikely (!items_len)) return TRACE_RETURN (true);
- if (unlikely (!c->extend (*this))) return TRACE_RETURN (false);
+ if (unlikely (!items_len)) return_trace (true);
+ if (unlikely (!c->extend (*this))) return_trace (false);
for (unsigned int i = 0; i < items_len - 1; i++)
array[i] = items[i];
items.advance (items_len - 1);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize_shallow (hb_sanitize_context_t *c) const
@@ -960,7 +994,7 @@ struct HeadlessArrayOf
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+ if (unlikely (!sanitize_shallow (c))) return_trace (false);
/* Note: for structs that do not reference other structs,
* we do not need to call their sanitize() as we already did
@@ -971,7 +1005,7 @@ struct HeadlessArrayOf
*/
(void) (false && array[0].sanitize (c));
- return TRACE_RETURN (true);
+ return_trace (true);
}
LenType len;
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh
index 0482312553..c9161f0ef4 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh
@@ -54,7 +54,7 @@ struct CmapSubtableFormat0
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
protected:
@@ -130,7 +130,7 @@ struct CmapSubtableFormat4
{
TRACE_SANITIZE (this);
if (unlikely (!c->check_struct (this)))
- return TRACE_RETURN (false);
+ return_trace (false);
if (unlikely (!c->check_range (this, length)))
{
@@ -141,10 +141,10 @@ struct CmapSubtableFormat4
(uintptr_t) (c->end -
(char *) this));
if (!c->try_set (&length, new_length))
- return TRACE_RETURN (false);
+ return_trace (false);
}
- return TRACE_RETURN (16 + 4 * (unsigned int) segCountX2 <= length);
+ return_trace (16 + 4 * (unsigned int) segCountX2 <= length);
}
protected:
@@ -187,7 +187,7 @@ struct CmapSubtableLongGroup
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
private:
@@ -215,7 +215,7 @@ struct CmapSubtableTrimmed
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c));
+ return_trace (c->check_struct (this) && glyphIdArray.sanitize (c));
}
protected:
@@ -248,7 +248,7 @@ struct CmapSubtableLongSegmented
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c));
+ return_trace (c->check_struct (this) && groups.sanitize (c));
}
protected:
@@ -295,7 +295,7 @@ struct UnicodeValueRange
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
UINT24 startUnicodeValue; /* First value in this range. */
@@ -317,7 +317,7 @@ struct UVSMapping
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
UINT24 unicodeValue; /* Base Unicode value of the UVS */
@@ -357,9 +357,9 @@ struct VariationSelectorRecord
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- defaultUVS.sanitize (c, base) &&
- nonDefaultUVS.sanitize (c, base));
+ return_trace (c->check_struct (this) &&
+ defaultUVS.sanitize (c, base) &&
+ nonDefaultUVS.sanitize (c, base));
}
UINT24 varSelector; /* Variation selector. */
@@ -383,8 +383,8 @@ struct CmapSubtableFormat14
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- record.sanitize (c, this));
+ return_trace (c->check_struct (this) &&
+ record.sanitize (c, this));
}
protected:
@@ -429,16 +429,16 @@ struct CmapSubtable
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+ if (!u.format.sanitize (c)) return_trace (false);
switch (u.format) {
- case 0: return TRACE_RETURN (u.format0 .sanitize (c));
- case 4: return TRACE_RETURN (u.format4 .sanitize (c));
- case 6: return TRACE_RETURN (u.format6 .sanitize (c));
- case 10: return TRACE_RETURN (u.format10.sanitize (c));
- case 12: return TRACE_RETURN (u.format12.sanitize (c));
- case 13: return TRACE_RETURN (u.format13.sanitize (c));
- case 14: return TRACE_RETURN (u.format14.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 0: return_trace (u.format0 .sanitize (c));
+ case 4: return_trace (u.format4 .sanitize (c));
+ case 6: return_trace (u.format6 .sanitize (c));
+ case 10: return_trace (u.format10.sanitize (c));
+ case 12: return_trace (u.format12.sanitize (c));
+ case 13: return_trace (u.format13.sanitize (c));
+ case 14: return_trace (u.format14.sanitize (c));
+ default:return_trace (true);
}
}
@@ -473,8 +473,8 @@ struct EncodingRecord
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- subtable.sanitize (c, base));
+ return_trace (c->check_struct (this) &&
+ subtable.sanitize (c, base));
}
USHORT platformID; /* Platform ID. */
@@ -509,9 +509,9 @@ struct cmap
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- likely (version == 0) &&
- encodingRecord.sanitize (c, this));
+ return_trace (c->check_struct (this) &&
+ likely (version == 0) &&
+ encodingRecord.sanitize (c, this));
}
USHORT version; /* Table version number (0). */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-font.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-font.cc
index 2af2f54a75..69d2503abb 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-font.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-font.cc
@@ -31,6 +31,8 @@
#include "hb-font-private.hh"
#include "hb-ot-cmap-table.hh"
+#include "hb-ot-glyf-table.hh"
+#include "hb-ot-head-table.hh"
#include "hb-ot-hhea-table.hh"
#include "hb-ot-hmtx-table.hh"
@@ -45,9 +47,9 @@ struct hb_ot_face_metrics_accelerator_t
inline void init (hb_face_t *face,
hb_tag_t _hea_tag, hb_tag_t _mtx_tag,
- unsigned int default_advance)
+ unsigned int default_advance_)
{
- this->default_advance = default_advance;
+ this->default_advance = default_advance_;
this->num_metrics = face->get_num_glyphs ();
hb_blob_t *_hea_blob = OT::Sanitizer<OT::_hea>::sanitize (face->reference_table (_hea_tag));
@@ -57,7 +59,7 @@ struct hb_ot_face_metrics_accelerator_t
this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
if (unlikely (!this->num_advances ||
- 2 * (this->num_advances + this->num_metrics) < hb_blob_get_length (this->blob)))
+ 2 * (this->num_advances + this->num_metrics) > hb_blob_get_length (this->blob)))
{
this->num_metrics = this->num_advances = 0;
hb_blob_destroy (this->blob);
@@ -76,8 +78,8 @@ struct hb_ot_face_metrics_accelerator_t
if (unlikely (glyph >= this->num_metrics))
{
/* If this->num_metrics is zero, it means we don't have the metrics table
- * for this direction: return one EM. Otherwise, it means that the glyph
- * index is out of bound: return zero. */
+ * for this direction: return default advance. Otherwise, it means that the
+ * glyph index is out of bound: return zero. */
if (this->num_metrics)
return 0;
else
@@ -91,6 +93,79 @@ struct hb_ot_face_metrics_accelerator_t
}
};
+struct hb_ot_face_glyf_accelerator_t
+{
+ bool short_offset;
+ unsigned int num_glyphs;
+ const OT::loca *loca;
+ const OT::glyf *glyf;
+ hb_blob_t *loca_blob;
+ hb_blob_t *glyf_blob;
+ unsigned int glyf_len;
+
+ inline void init (hb_face_t *face)
+ {
+ hb_blob_t *head_blob = OT::Sanitizer<OT::head>::sanitize (face->reference_table (HB_OT_TAG_head));
+ const OT::head *head = OT::Sanitizer<OT::head>::lock_instance (head_blob);
+ if ((unsigned int) head->indexToLocFormat > 1 || head->glyphDataFormat != 0)
+ {
+ /* Unknown format. Leave num_glyphs=0, that takes care of disabling us. */
+ hb_blob_destroy (head_blob);
+ return;
+ }
+ this->short_offset = 0 == head->indexToLocFormat;
+ hb_blob_destroy (head_blob);
+
+ this->loca_blob = OT::Sanitizer<OT::loca>::sanitize (face->reference_table (HB_OT_TAG_loca));
+ this->loca = OT::Sanitizer<OT::loca>::lock_instance (this->loca_blob);
+ this->glyf_blob = OT::Sanitizer<OT::glyf>::sanitize (face->reference_table (HB_OT_TAG_glyf));
+ this->glyf = OT::Sanitizer<OT::glyf>::lock_instance (this->glyf_blob);
+
+ this->num_glyphs = MAX (1u, hb_blob_get_length (this->loca_blob) / (this->short_offset ? 2 : 4)) - 1;
+ this->glyf_len = hb_blob_get_length (this->glyf_blob);
+ }
+
+ inline void fini (void)
+ {
+ hb_blob_destroy (this->loca_blob);
+ hb_blob_destroy (this->glyf_blob);
+ }
+
+ inline bool get_extents (hb_codepoint_t glyph,
+ hb_glyph_extents_t *extents) const
+ {
+ if (unlikely (glyph >= this->num_glyphs))
+ return false;
+
+ unsigned int start_offset, end_offset;
+ if (this->short_offset)
+ {
+ start_offset = 2 * this->loca->u.shortsZ[glyph];
+ end_offset = 2 * this->loca->u.shortsZ[glyph + 1];
+ }
+ else
+ {
+ start_offset = this->loca->u.longsZ[glyph];
+ end_offset = this->loca->u.longsZ[glyph + 1];
+ }
+
+ if (start_offset > end_offset || end_offset > this->glyf_len)
+ return false;
+
+ if (end_offset - start_offset < OT::glyfGlyphHeader::static_size)
+ return true; /* Empty glyph; zero extents. */
+
+ const OT::glyfGlyphHeader &glyph_header = OT::StructAtOffset<OT::glyfGlyphHeader> (this->glyf, start_offset);
+
+ extents->x_bearing = MIN (glyph_header.xMin, glyph_header.xMax);
+ extents->y_bearing = MAX (glyph_header.yMin, glyph_header.yMax);
+ extents->width = MAX (glyph_header.xMin, glyph_header.xMax) - extents->x_bearing;
+ extents->height = MIN (glyph_header.yMin, glyph_header.yMax) - extents->y_bearing;
+
+ return true;
+ }
+};
+
struct hb_ot_face_cmap_accelerator_t
{
const OT::CmapSubtable *table;
@@ -114,6 +189,7 @@ struct hb_ot_face_cmap_accelerator_t
if (!subtable) subtable = cmap->find_subtable (0, 2);
if (!subtable) subtable = cmap->find_subtable (0, 1);
if (!subtable) subtable = cmap->find_subtable (0, 0);
+ if (!subtable) subtable = cmap->find_subtable (3, 0);
/* Meh. */
if (!subtable) subtable = &OT::Null(OT::CmapSubtable);
@@ -157,14 +233,14 @@ struct hb_ot_font_t
hb_ot_face_cmap_accelerator_t cmap;
hb_ot_face_metrics_accelerator_t h_metrics;
hb_ot_face_metrics_accelerator_t v_metrics;
+ hb_ot_face_glyf_accelerator_t glyf;
};
static hb_ot_font_t *
-_hb_ot_font_create (hb_font_t *font)
+_hb_ot_font_create (hb_face_t *face)
{
hb_ot_font_t *ot_font = (hb_ot_font_t *) calloc (1, sizeof (hb_ot_font_t));
- hb_face_t *face = font->face;
if (unlikely (!ot_font))
return NULL;
@@ -174,6 +250,7 @@ _hb_ot_font_create (hb_font_t *font)
ot_font->cmap.init (face);
ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, upem>>1);
ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, upem); /* TODO Can we do this lazily? */
+ ot_font->glyf.init (face);
return ot_font;
}
@@ -184,6 +261,7 @@ _hb_ot_font_destroy (hb_ot_font_t *ot_font)
ot_font->cmap.fini ();
ot_font->h_metrics.fini ();
ot_font->v_metrics.fini ();
+ ot_font->glyf.fini ();
free (ot_font);
}
@@ -219,7 +297,7 @@ hb_ot_get_glyph_v_advance (hb_font_t *font HB_UNUSED,
void *user_data HB_UNUSED)
{
const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
- return font->em_scale_y (-ot_font->v_metrics.get_advance (glyph));
+ return font->em_scale_y (-(int) ot_font->v_metrics.get_advance (glyph));
}
static hb_bool_t
@@ -275,8 +353,13 @@ hb_ot_get_glyph_extents (hb_font_t *font HB_UNUSED,
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
- /* TODO */
- return false;
+ const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ bool ret = ot_font->glyf.get_extents (glyph, extents);
+ extents->x_bearing = font->em_scale_x (extents->x_bearing);
+ extents->y_bearing = font->em_scale_y (extents->y_bearing);
+ extents->width = font->em_scale_x (extents->width);
+ extents->height = font->em_scale_y (extents->height);
+ return ret;
}
static hb_bool_t
@@ -334,10 +417,13 @@ _hb_ot_get_font_funcs (void)
}
+/**
+ * Since: 0.9.28
+ **/
void
hb_ot_font_set_funcs (hb_font_t *font)
{
- hb_ot_font_t *ot_font = _hb_ot_font_create (font);
+ hb_ot_font_t *ot_font = _hb_ot_font_create (font->face);
if (unlikely (!ot_font))
return;
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-font.h b/src/3rdparty/harfbuzz-ng/src/hb-ot-font.h
index 7a8c04ac33..b9947a16bc 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-font.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-font.h
@@ -24,6 +24,10 @@
* Google Author(s): Behdad Esfahbod, Roozbeh Pournader
*/
+#ifndef HB_OT_H_IN
+#error "Include <hb-ot.h> instead."
+#endif
+
#ifndef HB_OT_FONT_H
#define HB_OT_FONT_H
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-glyf-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-glyf-table.hh
new file mode 100644
index 0000000000..9e5af6d10d
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-glyf-table.hh
@@ -0,0 +1,104 @@
+/*
+ * Copyright © 2015 Google, Inc.
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_GLYF_TABLE_HH
+#define HB_OT_GLYF_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+
+namespace OT {
+
+
+/*
+ * loca -- Index to Location
+ */
+
+#define HB_OT_TAG_loca HB_TAG('l','o','c','a')
+
+
+struct loca
+{
+ static const hb_tag_t tableTag = HB_OT_TAG_loca;
+
+ inline bool sanitize (hb_sanitize_context_t *c) const
+ {
+ TRACE_SANITIZE (this);
+ return_trace (true);
+ }
+
+ public:
+ union {
+ USHORT shortsZ[VAR]; /* Location offset divided by 2. */
+ ULONG longsZ[VAR]; /* Location offset. */
+ } u;
+ DEFINE_SIZE_ARRAY (0, u.longsZ);
+};
+
+
+/*
+ * glyf -- TrueType Glyph Data
+ */
+
+#define HB_OT_TAG_glyf HB_TAG('g','l','y','f')
+
+
+struct glyf
+{
+ static const hb_tag_t tableTag = HB_OT_TAG_glyf;
+
+ inline bool sanitize (hb_sanitize_context_t *c) const
+ {
+ TRACE_SANITIZE (this);
+ /* We don't check for anything specific here. The users of the
+ * struct do all the hard work... */
+ return_trace (true);
+ }
+
+ public:
+ BYTE dataX[VAR]; /* Glyphs data. */
+
+ DEFINE_SIZE_ARRAY (0, dataX);
+};
+
+struct glyfGlyphHeader
+{
+ SHORT numberOfContours; /* If the number of contours is
+ * greater than or equal to zero,
+ * this is a simple glyph; if negative,
+ * this is a composite glyph. */
+ SHORT xMin; /* Minimum x for coordinate data. */
+ SHORT yMin; /* Minimum y for coordinate data. */
+ SHORT xMax; /* Maximum x for coordinate data. */
+ SHORT yMax; /* Maximum y for coordinate data. */
+
+ DEFINE_SIZE_STATIC (10);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_GLYF_TABLE_HH */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh
index 268f133408..fc351cfb48 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh
@@ -55,7 +55,7 @@ struct head
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1));
+ return_trace (c->check_struct (this) && likely (version.major == 1));
}
protected:
@@ -138,9 +138,10 @@ struct head
* 2: Like 1 but also contains neutrals;
* -1: Only strongly right to left;
* -2: Like -1 but also contains neutrals. */
+ public:
SHORT indexToLocFormat; /* 0 for short offsets, 1 for long. */
SHORT glyphDataFormat; /* 0 for current format. */
- public:
+
DEFINE_SIZE_STATIC (54);
};
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh
index 992fe55202..24114534a7 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh
@@ -52,7 +52,7 @@ struct _hea
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1));
+ return_trace (c->check_struct (this) && likely (version.major == 1));
}
public:
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh
index a0e3855a84..49056e6769 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh
@@ -62,7 +62,7 @@ struct _mtx
TRACE_SANITIZE (this);
/* We don't check for anything specific here. The users of the
* struct do all the hard work... */
- return TRACE_RETURN (true);
+ return_trace (true);
}
public:
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh
index 3db7f57ab4..ea61f5c1bd 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh
@@ -44,7 +44,7 @@ namespace OT {
#define NOT_COVERED ((unsigned int) -1)
-#define MAX_NESTING_LEVEL 8
+#define MAX_NESTING_LEVEL 6
#define MAX_CONTEXT_LENGTH 64
@@ -75,7 +75,7 @@ struct Record
{
TRACE_SANITIZE (this);
const sanitize_closure_t closure = {tag, base};
- return TRACE_RETURN (c->check_struct (this) && offset.sanitize (c, base, &closure));
+ return_trace (c->check_struct (this) && offset.sanitize (c, base, &closure));
}
Tag tag; /* 4-byte Tag identifier */
@@ -131,7 +131,7 @@ struct RecordListOf : RecordArrayOf<Type>
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (RecordArrayOf<Type>::sanitize (c, this));
+ return_trace (RecordArrayOf<Type>::sanitize (c, this));
}
};
@@ -145,7 +145,7 @@ struct RangeRecord
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
inline bool intersects (const hb_set_t *glyphs) const {
@@ -211,7 +211,7 @@ struct LangSys
const Record<LangSys>::sanitize_closure_t * = NULL) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && featureIndex.sanitize (c));
+ return_trace (c->check_struct (this) && featureIndex.sanitize (c));
}
Offset<> lookupOrderZ; /* = Null (reserved for an offset to a
@@ -251,7 +251,7 @@ struct Script
const Record<Script>::sanitize_closure_t * = NULL) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
+ return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
}
protected:
@@ -274,7 +274,7 @@ struct FeatureParamsSize
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false);
+ if (unlikely (!c->check_struct (this))) return_trace (false);
/* This subtable has some "history", if you will. Some earlier versions of
* Adobe tools calculated the offset of the FeatureParams sutable from the
@@ -326,19 +326,19 @@ struct FeatureParamsSize
*/
if (!designSize)
- return TRACE_RETURN (false);
+ return_trace (false);
else if (subfamilyID == 0 &&
subfamilyNameID == 0 &&
rangeStart == 0 &&
rangeEnd == 0)
- return TRACE_RETURN (true);
+ return_trace (true);
else if (designSize < rangeStart ||
designSize > rangeEnd ||
subfamilyNameID < 256 ||
subfamilyNameID > 32767)
- return TRACE_RETURN (false);
+ return_trace (false);
else
- return TRACE_RETURN (true);
+ return_trace (true);
}
USHORT designSize; /* Represents the design size in 720/inch
@@ -388,7 +388,7 @@ struct FeatureParamsStylisticSet
TRACE_SANITIZE (this);
/* Right now minorVersion is at zero. Which means, any table supports
* the uiNameID field. */
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
USHORT version; /* (set to 0): This corresponds to a “minor”
@@ -420,8 +420,8 @@ struct FeatureParamsCharacterVariants
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- characters.sanitize (c));
+ return_trace (c->check_struct (this) &&
+ characters.sanitize (c));
}
USHORT format; /* Format number is set to 0. */
@@ -462,12 +462,12 @@ struct FeatureParams
{
TRACE_SANITIZE (this);
if (tag == HB_TAG ('s','i','z','e'))
- return TRACE_RETURN (u.size.sanitize (c));
+ return_trace (u.size.sanitize (c));
if ((tag & 0xFFFF0000u) == HB_TAG ('s','s','\0','\0')) /* ssXX */
- return TRACE_RETURN (u.stylisticSet.sanitize (c));
+ return_trace (u.stylisticSet.sanitize (c));
if ((tag & 0xFFFF0000u) == HB_TAG ('c','v','\0','\0')) /* cvXX */
- return TRACE_RETURN (u.characterVariants.sanitize (c));
- return TRACE_RETURN (true);
+ return_trace (u.characterVariants.sanitize (c));
+ return_trace (true);
}
inline const FeatureParamsSize& get_size_params (hb_tag_t tag) const
@@ -505,7 +505,7 @@ struct Feature
{
TRACE_SANITIZE (this);
if (unlikely (!(c->check_struct (this) && lookupIndex.sanitize (c))))
- return TRACE_RETURN (false);
+ return_trace (false);
/* Some earlier versions of Adobe tools calculated the offset of the
* FeatureParams subtable from the beginning of the FeatureList table!
@@ -520,10 +520,10 @@ struct Feature
OffsetTo<FeatureParams> orig_offset = featureParams;
if (unlikely (!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE)))
- return TRACE_RETURN (false);
+ return_trace (false);
if (likely (orig_offset.is_null ()))
- return TRACE_RETURN (true);
+ return_trace (true);
if (featureParams == 0 && closure &&
closure->tag == HB_TAG ('s','i','z','e') &&
@@ -538,10 +538,10 @@ struct Feature
if (new_offset == new_offset_int &&
c->try_set (&featureParams, new_offset) &&
!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE))
- return TRACE_RETURN (false);
+ return_trace (false);
}
- return TRACE_RETURN (true);
+ return_trace (true);
}
OffsetTo<FeatureParams>
@@ -613,9 +613,9 @@ struct Lookup
for (unsigned int i = 0; i < count; i++) {
typename context_t::return_t r = get_subtable<SubTableType> (i).dispatch (c, lookup_type);
if (c->stop_sublookup_iteration (r))
- return TRACE_RETURN (r);
+ return_trace (r);
}
- return TRACE_RETURN (c->default_return_value ());
+ return_trace (c->default_return_value ());
}
inline bool serialize (hb_serialize_context_t *c,
@@ -624,29 +624,29 @@ struct Lookup
unsigned int num_subtables)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
lookupType.set (lookup_type);
lookupFlag.set (lookup_props & 0xFFFFu);
- if (unlikely (!subTable.serialize (c, num_subtables))) return TRACE_RETURN (false);
+ if (unlikely (!subTable.serialize (c, num_subtables))) return_trace (false);
if (lookupFlag & LookupFlag::UseMarkFilteringSet)
{
USHORT &markFilteringSet = StructAfter<USHORT> (subTable);
markFilteringSet.set (lookup_props >> 16);
}
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
/* Real sanitize of the subtables is done by GSUB/GPOS/... */
- if (!(c->check_struct (this) && subTable.sanitize (c))) return TRACE_RETURN (false);
+ if (!(c->check_struct (this) && subTable.sanitize (c))) return_trace (false);
if (lookupFlag & LookupFlag::UseMarkFilteringSet)
{
const USHORT &markFilteringSet = StructAfter<USHORT> (subTable);
- if (!markFilteringSet.sanitize (c)) return TRACE_RETURN (false);
+ if (!markFilteringSet.sanitize (c)) return_trace (false);
}
- return TRACE_RETURN (true);
+ return_trace (true);
}
private:
@@ -685,19 +685,19 @@ struct CoverageFormat1
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
glyphArray.len.set (num_glyphs);
- if (unlikely (!c->extend (glyphArray))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend (glyphArray))) return_trace (false);
for (unsigned int i = 0; i < num_glyphs; i++)
glyphArray[i] = glyphs[i];
glyphs.advance (num_glyphs);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (glyphArray.sanitize (c));
+ return_trace (glyphArray.sanitize (c));
}
inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
@@ -754,16 +754,16 @@ struct CoverageFormat2
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
- if (unlikely (!num_glyphs)) return TRACE_RETURN (true);
+ if (unlikely (!num_glyphs)) return_trace (true);
unsigned int num_ranges = 1;
for (unsigned int i = 1; i < num_glyphs; i++)
if (glyphs[i - 1] + 1 != glyphs[i])
num_ranges++;
rangeRecord.len.set (num_ranges);
- if (unlikely (!c->extend (rangeRecord))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend (rangeRecord))) return_trace (false);
unsigned int range = 0;
rangeRecord[range].start = glyphs[0];
@@ -778,13 +778,13 @@ struct CoverageFormat2
rangeRecord[range].end = glyphs[i];
}
glyphs.advance (num_glyphs);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (rangeRecord.sanitize (c));
+ return_trace (rangeRecord.sanitize (c));
}
inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
@@ -864,27 +864,27 @@ struct Coverage
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
unsigned int num_ranges = 1;
for (unsigned int i = 1; i < num_glyphs; i++)
if (glyphs[i - 1] + 1 != glyphs[i])
num_ranges++;
u.format.set (num_glyphs * 2 < num_ranges * 3 ? 1 : 2);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, num_glyphs));
- case 2: return TRACE_RETURN (u.format2.serialize (c, glyphs, num_glyphs));
- default:return TRACE_RETURN (false);
+ case 1: return_trace (u.format1.serialize (c, glyphs, num_glyphs));
+ case 2: return_trace (u.format2.serialize (c, glyphs, num_glyphs));
+ default:return_trace (false);
}
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+ if (!u.format.sanitize (c)) return_trace (false);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.sanitize (c));
- case 2: return TRACE_RETURN (u.format2.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 1: return_trace (u.format1.sanitize (c));
+ case 2: return_trace (u.format2.sanitize (c));
+ default:return_trace (true);
}
}
@@ -993,7 +993,7 @@ struct ClassDefFormat1
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && classValue.sanitize (c));
+ return_trace (c->check_struct (this) && classValue.sanitize (c));
}
template <typename set_t>
@@ -1050,7 +1050,7 @@ struct ClassDefFormat2
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (rangeRecord.sanitize (c));
+ return_trace (rangeRecord.sanitize (c));
}
template <typename set_t>
@@ -1108,11 +1108,11 @@ struct ClassDef
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+ if (!u.format.sanitize (c)) return_trace (false);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.sanitize (c));
- case 2: return TRACE_RETURN (u.format2.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 1: return_trace (u.format1.sanitize (c));
+ case 2: return_trace (u.format2.sanitize (c));
+ default:return_trace (true);
}
}
@@ -1201,7 +1201,7 @@ struct Device
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && c->check_range (this, this->get_size ()));
+ return_trace (c->check_struct (this) && c->check_range (this, this->get_size ()));
}
protected:
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh
index 7a6c04d170..bc36436be7 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh
@@ -74,7 +74,7 @@ struct AttachList
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && attachPoint.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && attachPoint.sanitize (c, this));
}
protected:
@@ -105,7 +105,7 @@ struct CaretValueFormat1
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
protected:
@@ -132,7 +132,7 @@ struct CaretValueFormat2
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
protected:
@@ -156,7 +156,7 @@ struct CaretValueFormat3
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && deviceTable.sanitize (c, this));
+ return_trace (c->check_struct (this) && deviceTable.sanitize (c, this));
}
protected:
@@ -185,12 +185,12 @@ struct CaretValue
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+ if (!u.format.sanitize (c)) return_trace (false);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.sanitize (c));
- case 2: return TRACE_RETURN (u.format2.sanitize (c));
- case 3: return TRACE_RETURN (u.format3.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 1: return_trace (u.format1.sanitize (c));
+ case 2: return_trace (u.format2.sanitize (c));
+ case 3: return_trace (u.format3.sanitize (c));
+ default:return_trace (true);
}
}
@@ -227,7 +227,7 @@ struct LigGlyph
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (carets.sanitize (c, this));
+ return_trace (carets.sanitize (c, this));
}
protected:
@@ -262,7 +262,7 @@ struct LigCaretList
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this));
}
protected:
@@ -285,7 +285,7 @@ struct MarkGlyphSetsFormat1
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this));
}
protected:
@@ -310,10 +310,10 @@ struct MarkGlyphSets
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+ if (!u.format.sanitize (c)) return_trace (false);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 1: return_trace (u.format1.sanitize (c));
+ default:return_trace (true);
}
}
@@ -376,13 +376,13 @@ struct GDEF
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (version.sanitize (c) &&
- likely (version.major == 1) &&
- glyphClassDef.sanitize (c, this) &&
- attachList.sanitize (c, this) &&
- ligCaretList.sanitize (c, this) &&
- markAttachClassDef.sanitize (c, this) &&
- (version.to_int () < 0x00010002u || markGlyphSetsDef[0].sanitize (c, this)));
+ return_trace (version.sanitize (c) &&
+ likely (version.major == 1) &&
+ glyphClassDef.sanitize (c, this) &&
+ attachList.sanitize (c, this) &&
+ ligCaretList.sanitize (c, this) &&
+ markAttachClassDef.sanitize (c, this) &&
+ (version.to_int () < 0x00010002u || markGlyphSetsDef[0].sanitize (c, this)));
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
index d88f7876e0..568b5f63a9 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
@@ -181,7 +181,7 @@ struct ValueFormat : USHORT
inline bool sanitize_value (hb_sanitize_context_t *c, const void *base, const Value *values) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_range (values, get_size ()) && (!has_device () || sanitize_value_devices (c, base, values)));
+ return_trace (c->check_range (values, get_size ()) && (!has_device () || sanitize_value_devices (c, base, values)));
}
inline bool sanitize_values (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count) const
@@ -189,17 +189,17 @@ struct ValueFormat : USHORT
TRACE_SANITIZE (this);
unsigned int len = get_len ();
- if (!c->check_array (values, get_size (), count)) return TRACE_RETURN (false);
+ if (!c->check_array (values, get_size (), count)) return_trace (false);
- if (!has_device ()) return TRACE_RETURN (true);
+ if (!has_device ()) return_trace (true);
for (unsigned int i = 0; i < count; i++) {
if (!sanitize_value_devices (c, base, values))
- return TRACE_RETURN (false);
+ return_trace (false);
values += len;
}
- return TRACE_RETURN (true);
+ return_trace (true);
}
/* Just sanitize referenced Device tables. Doesn't check the values themselves. */
@@ -207,15 +207,15 @@ struct ValueFormat : USHORT
{
TRACE_SANITIZE (this);
- if (!has_device ()) return TRACE_RETURN (true);
+ if (!has_device ()) return_trace (true);
for (unsigned int i = 0; i < count; i++) {
if (!sanitize_value_devices (c, base, values))
- return TRACE_RETURN (false);
+ return_trace (false);
values += stride;
}
- return TRACE_RETURN (true);
+ return_trace (true);
}
};
@@ -232,7 +232,7 @@ struct AnchorFormat1
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
protected:
@@ -262,7 +262,7 @@ struct AnchorFormat2
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
protected:
@@ -291,7 +291,7 @@ struct AnchorFormat3
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this));
+ return_trace (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this));
}
protected:
@@ -327,12 +327,12 @@ struct Anchor
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+ if (!u.format.sanitize (c)) return_trace (false);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.sanitize (c));
- case 2: return TRACE_RETURN (u.format2.sanitize (c));
- case 3: return TRACE_RETURN (u.format3.sanitize (c));
- default:return TRACE_RETURN (true);
+ case 1: return_trace (u.format1.sanitize (c));
+ case 2: return_trace (u.format2.sanitize (c));
+ case 3: return_trace (u.format3.sanitize (c));
+ default:return_trace (true);
}
}
@@ -360,13 +360,13 @@ struct AnchorMatrix
inline bool sanitize (hb_sanitize_context_t *c, unsigned int cols) const
{
TRACE_SANITIZE (this);
- if (!c->check_struct (this)) return TRACE_RETURN (false);
- if (unlikely (rows > 0 && cols >= ((unsigned int) -1) / rows)) return TRACE_RETURN (false);
+ if (!c->check_struct (this)) return_trace (false);
+ if (unlikely (rows > 0 && cols >= ((unsigned int) -1) / rows)) return_trace (false);
unsigned int count = rows * cols;
- if (!c->check_array (matrixZ, matrixZ[0].static_size, count)) return TRACE_RETURN (false);
+ if (!c->check_array (matrixZ, matrixZ[0].static_size, count)) return_trace (false);
for (unsigned int i = 0; i < count; i++)
- if (!matrixZ[i].sanitize (c, this)) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (!matrixZ[i].sanitize (c, this)) return_trace (false);
+ return_trace (true);
}
USHORT rows; /* Number of rows */
@@ -386,7 +386,7 @@ struct MarkRecord
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && markAnchor.sanitize (c, base));
+ return_trace (c->check_struct (this) && markAnchor.sanitize (c, base));
}
protected:
@@ -415,7 +415,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
const Anchor& glyph_anchor = anchors.get_anchor (glyph_index, mark_class, class_count, &found);
/* If this subtable doesn't have an anchor for this base and this class,
* return false such that the subsequent subtables have a chance at it. */
- if (unlikely (!found)) return TRACE_RETURN (false);
+ if (unlikely (!found)) return_trace (false);
hb_position_t mark_x, mark_y, base_x, base_y;
@@ -428,13 +428,13 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
o.attach_lookback() = buffer->idx - glyph_pos;
buffer->idx++;
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (ArrayOf<MarkRecord>::sanitize (c, this));
+ return_trace (ArrayOf<MarkRecord>::sanitize (c, this));
}
};
@@ -459,21 +459,21 @@ struct SinglePosFormat1
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
valueFormat.apply_value (c->font, c->direction, this,
values, buffer->cur_pos());
buffer->idx++;
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this)
- && coverage.sanitize (c, this)
- && valueFormat.sanitize_value (c, this, values));
+ return_trace (c->check_struct (this) &&
+ coverage.sanitize (c, this) &&
+ valueFormat.sanitize_value (c, this, values));
}
protected:
@@ -508,24 +508,24 @@ struct SinglePosFormat2
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
- if (likely (index >= valueCount)) return TRACE_RETURN (false);
+ if (likely (index >= valueCount)) return_trace (false);
valueFormat.apply_value (c->font, c->direction, this,
&values[index * valueFormat.get_len ()],
buffer->cur_pos());
buffer->idx++;
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this)
- && coverage.sanitize (c, this)
- && valueFormat.sanitize_values (c, this, values, valueCount));
+ return_trace (c->check_struct (this) &&
+ coverage.sanitize (c, this) &&
+ valueFormat.sanitize_values (c, this, values, valueCount));
}
protected:
@@ -548,11 +548,11 @@ struct SinglePos
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- case 2: return TRACE_RETURN (c->dispatch (u.format2));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ case 2: return_trace (c->dispatch (u.format2));
+ default:return_trace (c->default_return_value ());
}
}
@@ -615,7 +615,7 @@ struct PairSet
/* Hand-coded bsearch. */
if (unlikely (!count))
- return TRACE_RETURN (false);
+ return_trace (false);
hb_codepoint_t x = buffer->info[pos].codepoint;
int min = 0, max = (int) count - 1;
while (min <= max)
@@ -636,11 +636,11 @@ struct PairSet
if (len2)
pos++;
buffer->idx = pos;
- return TRACE_RETURN (true);
+ return_trace (true);
}
}
- return TRACE_RETURN (false);
+ return_trace (false);
}
struct sanitize_closure_t {
@@ -654,12 +654,12 @@ struct PairSet
{
TRACE_SANITIZE (this);
if (!(c->check_struct (this)
- && c->check_array (arrayZ, USHORT::static_size * closure->stride, len))) return TRACE_RETURN (false);
+ && c->check_array (arrayZ, USHORT::static_size * closure->stride, len))) return_trace (false);
unsigned int count = len;
const PairValueRecord *record = CastP<PairValueRecord> (arrayZ);
- return TRACE_RETURN (closure->valueFormats[0].sanitize_values_stride_unsafe (c, closure->base, &record->values[0], count, closure->stride)
- && closure->valueFormats[1].sanitize_values_stride_unsafe (c, closure->base, &record->values[closure->len1], count, closure->stride));
+ return_trace (closure->valueFormats[0].sanitize_values_stride_unsafe (c, closure->base, &record->values[0], count, closure->stride) &&
+ closure->valueFormats[1].sanitize_values_stride_unsafe (c, closure->base, &record->values[closure->len1], count, closure->stride));
}
protected:
@@ -691,19 +691,21 @@ struct PairPosFormat1
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (buffer->idx, 1);
- if (!skippy_iter.next ()) return TRACE_RETURN (false);
+ if (!skippy_iter.next ()) return_trace (false);
- return TRACE_RETURN ((this+pairSet[index]).apply (c, &valueFormat1, skippy_iter.idx));
+ return_trace ((this+pairSet[index]).apply (c, &valueFormat1, skippy_iter.idx));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
+ if (!c->check_struct (this)) return_trace (false);
+
unsigned int len1 = valueFormat1.get_len ();
unsigned int len2 = valueFormat2.get_len ();
PairSet::sanitize_closure_t closure = {
@@ -713,7 +715,7 @@ struct PairPosFormat1
1 + len1 + len2
};
- return TRACE_RETURN (c->check_struct (this) && coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure));
+ return_trace (coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure));
}
protected:
@@ -762,11 +764,11 @@ struct PairPosFormat2
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (buffer->idx, 1);
- if (!skippy_iter.next ()) return TRACE_RETURN (false);
+ if (!skippy_iter.next ()) return_trace (false);
unsigned int len1 = valueFormat1.get_len ();
unsigned int len2 = valueFormat2.get_len ();
@@ -774,7 +776,7 @@ struct PairPosFormat2
unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint);
unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
- if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return TRACE_RETURN (false);
+ if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return_trace (false);
const Value *v = &values[record_len * (klass1 * class2Count + klass2)];
valueFormat1.apply_value (c->font, c->direction, this,
@@ -786,7 +788,7 @@ struct PairPosFormat2
if (len2)
buffer->idx++;
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
@@ -795,16 +797,16 @@ struct PairPosFormat2
if (!(c->check_struct (this)
&& coverage.sanitize (c, this)
&& classDef1.sanitize (c, this)
- && classDef2.sanitize (c, this))) return TRACE_RETURN (false);
+ && classDef2.sanitize (c, this))) return_trace (false);
unsigned int len1 = valueFormat1.get_len ();
unsigned int len2 = valueFormat2.get_len ();
unsigned int stride = len1 + len2;
unsigned int record_size = valueFormat1.get_size () + valueFormat2.get_size ();
unsigned int count = (unsigned int) class1Count * (unsigned int) class2Count;
- return TRACE_RETURN (c->check_array (values, record_size, count) &&
- valueFormat1.sanitize_values_stride_unsafe (c, this, &values[0], count, stride) &&
- valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride));
+ return_trace (c->check_array (values, record_size, count) &&
+ valueFormat1.sanitize_values_stride_unsafe (c, this, &values[0], count, stride) &&
+ valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride));
}
protected:
@@ -843,11 +845,11 @@ struct PairPos
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- case 2: return TRACE_RETURN (c->dispatch (u.format2));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ case 2: return_trace (c->dispatch (u.format2));
+ default:return_trace (c->default_return_value ());
}
}
@@ -867,7 +869,7 @@ struct EntryExitRecord
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base));
+ return_trace (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base));
}
protected:
@@ -883,6 +885,9 @@ struct EntryExitRecord
DEFINE_SIZE_STATIC (4);
};
+static void
+reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent);
+
struct CursivePosFormat1
{
inline void collect_glyphs (hb_collect_glyphs_context_t *c) const
@@ -902,17 +907,17 @@ struct CursivePosFormat1
hb_buffer_t *buffer = c->buffer;
/* We don't handle mark glyphs here. */
- if (unlikely (_hb_glyph_info_is_mark (&buffer->cur()))) return TRACE_RETURN (false);
+ if (unlikely (_hb_glyph_info_is_mark (&buffer->cur()))) return_trace (false);
const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage (buffer->cur().codepoint)];
- if (!this_record.exitAnchor) return TRACE_RETURN (false);
+ if (!this_record.exitAnchor) return_trace (false);
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (buffer->idx, 1);
- if (!skippy_iter.next ()) return TRACE_RETURN (false);
+ if (!skippy_iter.next ()) return_trace (false);
const EntryExitRecord &next_record = entryExitRecord[(this+coverage).get_coverage (buffer->info[skippy_iter.idx].codepoint)];
- if (!next_record.entryAnchor) return TRACE_RETURN (false);
+ if (!next_record.entryAnchor) return_trace (false);
unsigned int i = buffer->idx;
unsigned int j = skippy_iter.idx;
@@ -960,28 +965,47 @@ struct CursivePosFormat1
}
/* Cross-direction adjustment */
- if (c->lookup_props & LookupFlag::RightToLeft) {
- pos[i].cursive_chain() = j - i;
- if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
- pos[i].y_offset = entry_y - exit_y;
- else
- pos[i].x_offset = entry_x - exit_x;
- } else {
- pos[j].cursive_chain() = i - j;
- if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
- pos[j].y_offset = exit_y - entry_y;
- else
- pos[j].x_offset = exit_x - entry_x;
+
+ /* We attach child to parent (think graph theory and rooted trees whereas
+ * the root stays on baseline and each node aligns itself against its
+ * parent.
+ *
+ * Optimize things for the case of RightToLeft, as that's most common in
+ * Arabinc. */
+ unsigned int child = i;
+ unsigned int parent = j;
+ hb_position_t x_offset = entry_x - exit_x;
+ hb_position_t y_offset = entry_y - exit_y;
+ if (!(c->lookup_props & LookupFlag::RightToLeft))
+ {
+ unsigned int k = child;
+ child = parent;
+ parent = k;
+ x_offset = -x_offset;
+ y_offset = -y_offset;
}
+ /* If child was already connected to someone else, walk through its old
+ * chain and reverse the link direction, such that the whole tree of its
+ * previous connection now attaches to new parent. Watch out for case
+ * where new parent is on the path from old chain...
+ */
+ reverse_cursive_minor_offset (pos, child, c->direction, parent);
+
+ pos[child].cursive_chain() = parent - child;
+ if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
+ pos[child].y_offset = y_offset;
+ else
+ pos[child].x_offset = x_offset;
+
buffer->idx = j;
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
}
protected:
@@ -1002,10 +1026,10 @@ struct CursivePos
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -1041,33 +1065,36 @@ struct MarkBasePosFormat1
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int mark_index = (this+markCoverage).get_coverage (buffer->cur().codepoint);
- if (likely (mark_index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (mark_index == NOT_COVERED)) return_trace (false);
/* now we search backwards for a non-mark glyph */
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (buffer->idx, 1);
skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks);
do {
- if (!skippy_iter.prev ()) return TRACE_RETURN (false);
+ if (!skippy_iter.prev ()) return_trace (false);
/* We only want to attach to the first of a MultipleSubst sequence. Reject others. */
if (0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx])) break;
skippy_iter.reject ();
} while (1);
/* Checking that matched glyph is actually a base glyph by GDEF is too strong; disabled */
- if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { /*return TRACE_RETURN (false);*/ }
+ if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { /*return_trace (false);*/ }
unsigned int base_index = (this+baseCoverage).get_coverage (buffer->info[skippy_iter.idx].codepoint);
- if (base_index == NOT_COVERED) return TRACE_RETURN (false);
+ if (base_index == NOT_COVERED) return_trace (false);
- return TRACE_RETURN ((this+markArray).apply (c, mark_index, base_index, this+baseArray, classCount, skippy_iter.idx));
+ return_trace ((this+markArray).apply (c, mark_index, base_index, this+baseArray, classCount, skippy_iter.idx));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && markCoverage.sanitize (c, this) && baseCoverage.sanitize (c, this) &&
- markArray.sanitize (c, this) && baseArray.sanitize (c, this, (unsigned int) classCount));
+ return_trace (c->check_struct (this) &&
+ markCoverage.sanitize (c, this) &&
+ baseCoverage.sanitize (c, this) &&
+ markArray.sanitize (c, this) &&
+ baseArray.sanitize (c, this, (unsigned int) classCount));
}
protected:
@@ -1095,10 +1122,10 @@ struct MarkBasePos
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -1139,27 +1166,27 @@ struct MarkLigPosFormat1
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int mark_index = (this+markCoverage).get_coverage (buffer->cur().codepoint);
- if (likely (mark_index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (mark_index == NOT_COVERED)) return_trace (false);
/* now we search backwards for a non-mark glyph */
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (buffer->idx, 1);
skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks);
- if (!skippy_iter.prev ()) return TRACE_RETURN (false);
+ if (!skippy_iter.prev ()) return_trace (false);
/* Checking that matched glyph is actually a ligature by GDEF is too strong; disabled */
- if (!_hb_glyph_info_is_ligature (&buffer->info[skippy_iter.idx])) { /*return TRACE_RETURN (false);*/ }
+ if (!_hb_glyph_info_is_ligature (&buffer->info[skippy_iter.idx])) { /*return_trace (false);*/ }
unsigned int j = skippy_iter.idx;
unsigned int lig_index = (this+ligatureCoverage).get_coverage (buffer->info[j].codepoint);
- if (lig_index == NOT_COVERED) return TRACE_RETURN (false);
+ if (lig_index == NOT_COVERED) return_trace (false);
const LigatureArray& lig_array = this+ligatureArray;
const LigatureAttach& lig_attach = lig_array[lig_index];
/* Find component to attach to */
unsigned int comp_count = lig_attach.rows;
- if (unlikely (!comp_count)) return TRACE_RETURN (false);
+ if (unlikely (!comp_count)) return_trace (false);
/* We must now check whether the ligature ID of the current mark glyph
* is identical to the ligature ID of the found ligature. If yes, we
@@ -1174,14 +1201,17 @@ struct MarkLigPosFormat1
else
comp_index = comp_count - 1;
- return TRACE_RETURN ((this+markArray).apply (c, mark_index, comp_index, lig_attach, classCount, j));
+ return_trace ((this+markArray).apply (c, mark_index, comp_index, lig_attach, classCount, j));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && markCoverage.sanitize (c, this) && ligatureCoverage.sanitize (c, this) &&
- markArray.sanitize (c, this) && ligatureArray.sanitize (c, this, (unsigned int) classCount));
+ return_trace (c->check_struct (this) &&
+ markCoverage.sanitize (c, this) &&
+ ligatureCoverage.sanitize (c, this) &&
+ markArray.sanitize (c, this) &&
+ ligatureArray.sanitize (c, this, (unsigned int) classCount));
}
protected:
@@ -1210,10 +1240,10 @@ struct MarkLigPos
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -1249,15 +1279,15 @@ struct MarkMarkPosFormat1
TRACE_APPLY (this);
hb_buffer_t *buffer = c->buffer;
unsigned int mark1_index = (this+mark1Coverage).get_coverage (buffer->cur().codepoint);
- if (likely (mark1_index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (mark1_index == NOT_COVERED)) return_trace (false);
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (buffer->idx, 1);
skippy_iter.set_lookup_props (c->lookup_props & ~LookupFlag::IgnoreFlags);
- if (!skippy_iter.prev ()) return TRACE_RETURN (false);
+ if (!skippy_iter.prev ()) return_trace (false);
- if (!_hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx])) { return TRACE_RETURN (false); }
+ if (!_hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx])) { return_trace (false); }
unsigned int j = skippy_iter.idx;
@@ -1279,21 +1309,23 @@ struct MarkMarkPosFormat1
}
/* Didn't match. */
- return TRACE_RETURN (false);
+ return_trace (false);
good:
unsigned int mark2_index = (this+mark2Coverage).get_coverage (buffer->info[j].codepoint);
- if (mark2_index == NOT_COVERED) return TRACE_RETURN (false);
+ if (mark2_index == NOT_COVERED) return_trace (false);
- return TRACE_RETURN ((this+mark1Array).apply (c, mark1_index, mark2_index, this+mark2Array, classCount, j));
+ return_trace ((this+mark1Array).apply (c, mark1_index, mark2_index, this+mark2Array, classCount, j));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && mark1Coverage.sanitize (c, this) &&
- mark2Coverage.sanitize (c, this) && mark1Array.sanitize (c, this)
- && mark2Array.sanitize (c, this, (unsigned int) classCount));
+ return_trace (c->check_struct (this) &&
+ mark1Coverage.sanitize (c, this) &&
+ mark2Coverage.sanitize (c, this) &&
+ mark1Array.sanitize (c, this) &&
+ mark2Array.sanitize (c, this, (unsigned int) classCount));
}
protected:
@@ -1323,10 +1355,10 @@ struct MarkMarkPos
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -1374,19 +1406,18 @@ struct PosLookupSubTable
inline typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type) const
{
TRACE_DISPATCH (this, lookup_type);
- /* The sub_format passed to may_dispatch is unnecessary but harmless. */
- if (unlikely (!c->may_dispatch (this, &u.sub_format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.sub_format))) return_trace (c->no_dispatch_return_value ());
switch (lookup_type) {
- case Single: return TRACE_RETURN (u.single.dispatch (c));
- case Pair: return TRACE_RETURN (u.pair.dispatch (c));
- case Cursive: return TRACE_RETURN (u.cursive.dispatch (c));
- case MarkBase: return TRACE_RETURN (u.markBase.dispatch (c));
- case MarkLig: return TRACE_RETURN (u.markLig.dispatch (c));
- case MarkMark: return TRACE_RETURN (u.markMark.dispatch (c));
- case Context: return TRACE_RETURN (u.context.dispatch (c));
- case ChainContext: return TRACE_RETURN (u.chainContext.dispatch (c));
- case Extension: return TRACE_RETURN (u.extension.dispatch (c));
- default: return TRACE_RETURN (c->default_return_value ());
+ case Single: return_trace (u.single.dispatch (c));
+ case Pair: return_trace (u.pair.dispatch (c));
+ case Cursive: return_trace (u.cursive.dispatch (c));
+ case MarkBase: return_trace (u.markBase.dispatch (c));
+ case MarkLig: return_trace (u.markLig.dispatch (c));
+ case MarkMark: return_trace (u.markMark.dispatch (c));
+ case Context: return_trace (u.context.dispatch (c));
+ case ChainContext: return_trace (u.chainContext.dispatch (c));
+ case Extension: return_trace (u.extension.dispatch (c));
+ default: return_trace (c->default_return_value ());
}
}
@@ -1421,13 +1452,13 @@ struct PosLookup : Lookup
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY (this);
- return TRACE_RETURN (dispatch (c));
+ return_trace (dispatch (c));
}
inline hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
{
TRACE_COLLECT_GLYPHS (this);
- return TRACE_RETURN (dispatch (c));
+ return_trace (dispatch (c));
}
template <typename set_t>
@@ -1449,9 +1480,8 @@ struct PosLookup : Lookup
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!Lookup::sanitize (c))) return TRACE_RETURN (false);
- const OffsetArrayOf<PosLookupSubTable> &list = get_subtables<PosLookupSubTable> ();
- return TRACE_RETURN (dispatch (c));
+ if (unlikely (!Lookup::sanitize (c))) return_trace (false);
+ return_trace (dispatch (c));
}
};
@@ -1474,9 +1504,9 @@ struct GPOS : GSUBGPOS
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!GSUBGPOS::sanitize (c))) return TRACE_RETURN (false);
+ if (unlikely (!GSUBGPOS::sanitize (c))) return_trace (false);
const OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
- return TRACE_RETURN (list.sanitize (c, this));
+ return_trace (list.sanitize (c, this));
}
public:
DEFINE_SIZE_STATIC (10);
@@ -1484,6 +1514,30 @@ struct GPOS : GSUBGPOS
static void
+reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent)
+{
+ unsigned int j = pos[i].cursive_chain();
+ if (likely (!j))
+ return;
+
+ j += i;
+
+ pos[i].cursive_chain() = 0;
+
+ /* Stop if we see new parent in the chain. */
+ if (j == new_parent)
+ return;
+
+ reverse_cursive_minor_offset (pos, j, direction, new_parent);
+
+ if (HB_DIRECTION_IS_HORIZONTAL (direction))
+ pos[j].y_offset = -pos[i].y_offset;
+ else
+ pos[j].x_offset = -pos[i].x_offset;
+
+ pos[j].cursive_chain() = i - j;
+}
+static void
fix_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction)
{
unsigned int j = pos[i].cursive_chain();
@@ -1569,8 +1623,11 @@ template <typename context_t>
const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos);
const PosLookup &l = gpos.get_lookup (lookup_index);
unsigned int saved_lookup_props = c->lookup_props;
- c->set_lookup (l);
+ unsigned int saved_lookup_index = c->lookup_index;
+ c->set_lookup_index (lookup_index);
+ c->set_lookup_props (l.get_props ());
bool ret = l.dispatch (c);
+ c->set_lookup_index (saved_lookup_index);
c->set_lookup_props (saved_lookup_props);
return ret;
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
index ebe4c9ec4e..eebc87b4c5 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
@@ -67,7 +67,7 @@ struct SingleSubstFormat1
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY (this);
- return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+ return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
}
inline bool apply (hb_apply_context_t *c) const
@@ -75,14 +75,14 @@ struct SingleSubstFormat1
TRACE_APPLY (this);
hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
unsigned int index = (this+coverage).get_coverage (glyph_id);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
/* According to the Adobe Annotated OpenType Suite, result is always
* limited to 16bit. */
glyph_id = (glyph_id + deltaGlyphID) & 0xFFFFu;
c->replace_glyph (glyph_id);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -91,16 +91,16 @@ struct SingleSubstFormat1
int delta)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
deltaGlyphID.set (delta); /* TODO(serilaize) overflow? */
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && deltaGlyphID.sanitize (c));
+ return_trace (coverage.sanitize (c, this) && deltaGlyphID.sanitize (c));
}
protected:
@@ -144,7 +144,7 @@ struct SingleSubstFormat2
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY (this);
- return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+ return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
}
inline bool apply (hb_apply_context_t *c) const
@@ -152,14 +152,14 @@ struct SingleSubstFormat2
TRACE_APPLY (this);
hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
unsigned int index = (this+coverage).get_coverage (glyph_id);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
- if (unlikely (index >= substitute.len)) return TRACE_RETURN (false);
+ if (unlikely (index >= substitute.len)) return_trace (false);
glyph_id = substitute[index];
c->replace_glyph (glyph_id);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -168,16 +168,16 @@ struct SingleSubstFormat2
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!substitute.serialize (c, substitutes, num_glyphs))) return TRACE_RETURN (false);
- if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!substitute.serialize (c, substitutes, num_glyphs))) return_trace (false);
+ if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && substitute.sanitize (c));
+ return_trace (coverage.sanitize (c, this) && substitute.sanitize (c));
}
protected:
@@ -200,7 +200,7 @@ struct SingleSubst
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (u.format))) return_trace (false);
unsigned int format = 2;
int delta = 0;
if (num_glyphs) {
@@ -215,9 +215,9 @@ struct SingleSubst
}
u.format.set (format);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, num_glyphs, delta));
- case 2: return TRACE_RETURN (u.format2.serialize (c, glyphs, substitutes, num_glyphs));
- default:return TRACE_RETURN (false);
+ case 1: return_trace (u.format1.serialize (c, glyphs, num_glyphs, delta));
+ case 2: return_trace (u.format2.serialize (c, glyphs, substitutes, num_glyphs));
+ default:return_trace (false);
}
}
@@ -225,11 +225,11 @@ struct SingleSubst
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- case 2: return TRACE_RETURN (c->dispatch (u.format2));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ case 2: return_trace (c->dispatch (u.format2));
+ default:return_trace (c->default_return_value ());
}
}
@@ -273,14 +273,14 @@ struct Sequence
* buffer->move_to() makes assumptions about this too. Perhaps fix
* in the future after figuring out what to do with the clusters.
*/
- if (unlikely (!count)) return TRACE_RETURN (false);
+ if (unlikely (!count)) return_trace (false);
/* Special-case to make it in-place and not consider this
* as a "multiplied" substitution. */
if (unlikely (count == 1))
{
c->replace_glyph (substitute.array[0]);
- return TRACE_RETURN (true);
+ return_trace (true);
}
unsigned int klass = _hb_glyph_info_is_ligature (&c->buffer->cur()) ?
@@ -292,7 +292,7 @@ struct Sequence
}
c->buffer->skip_glyph ();
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -300,15 +300,15 @@ struct Sequence
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!substitute.serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!substitute.serialize (c, glyphs, num_glyphs))) return_trace (false);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (substitute.sanitize (c));
+ return_trace (substitute.sanitize (c));
}
protected:
@@ -347,7 +347,7 @@ struct MultipleSubstFormat1
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY (this);
- return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+ return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
}
inline bool apply (hb_apply_context_t *c) const
@@ -355,9 +355,9 @@ struct MultipleSubstFormat1
TRACE_APPLY (this);
unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
- return TRACE_RETURN ((this+sequence[index]).apply (c));
+ return_trace ((this+sequence[index]).apply (c));
}
inline bool serialize (hb_serialize_context_t *c,
@@ -367,21 +367,21 @@ struct MultipleSubstFormat1
Supplier<GlyphID> &substitute_glyphs_list)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!sequence.serialize (c, num_glyphs))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!sequence.serialize (c, num_glyphs))) return_trace (false);
for (unsigned int i = 0; i < num_glyphs; i++)
if (unlikely (!sequence[i].serialize (c, this).serialize (c,
substitute_glyphs_list,
- substitute_len_list[i]))) return TRACE_RETURN (false);
+ substitute_len_list[i]))) return_trace (false);
substitute_len_list.advance (num_glyphs);
- if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && sequence.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && sequence.sanitize (c, this));
}
protected:
@@ -405,12 +405,12 @@ struct MultipleSubst
Supplier<GlyphID> &substitute_glyphs_list)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (u.format))) return_trace (false);
unsigned int format = 1;
u.format.set (format);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, substitute_len_list, num_glyphs, substitute_glyphs_list));
- default:return TRACE_RETURN (false);
+ case 1: return_trace (u.format1.serialize (c, glyphs, substitute_len_list, num_glyphs, substitute_glyphs_list));
+ default:return_trace (false);
}
}
@@ -418,10 +418,10 @@ struct MultipleSubst
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -473,7 +473,7 @@ struct AlternateSubstFormat1
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY (this);
- return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+ return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
}
inline bool apply (hb_apply_context_t *c) const
@@ -482,11 +482,11 @@ struct AlternateSubstFormat1
hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
unsigned int index = (this+coverage).get_coverage (glyph_id);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const AlternateSet &alt_set = this+alternateSet[index];
- if (unlikely (!alt_set.len)) return TRACE_RETURN (false);
+ if (unlikely (!alt_set.len)) return_trace (false);
hb_mask_t glyph_mask = c->buffer->cur().mask;
hb_mask_t lookup_mask = c->lookup_mask;
@@ -495,13 +495,13 @@ struct AlternateSubstFormat1
unsigned int shift = _hb_ctz (lookup_mask);
unsigned int alt_index = ((lookup_mask & glyph_mask) >> shift);
- if (unlikely (alt_index > alt_set.len || alt_index == 0)) return TRACE_RETURN (false);
+ if (unlikely (alt_index > alt_set.len || alt_index == 0)) return_trace (false);
glyph_id = alt_set[alt_index - 1];
c->replace_glyph (glyph_id);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -511,21 +511,21 @@ struct AlternateSubstFormat1
Supplier<GlyphID> &alternate_glyphs_list)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!alternateSet.serialize (c, num_glyphs))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!alternateSet.serialize (c, num_glyphs))) return_trace (false);
for (unsigned int i = 0; i < num_glyphs; i++)
if (unlikely (!alternateSet[i].serialize (c, this).serialize (c,
alternate_glyphs_list,
- alternate_len_list[i]))) return TRACE_RETURN (false);
+ alternate_len_list[i]))) return_trace (false);
alternate_len_list.advance (num_glyphs);
- if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && alternateSet.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && alternateSet.sanitize (c, this));
}
protected:
@@ -549,12 +549,12 @@ struct AlternateSubst
Supplier<GlyphID> &alternate_glyphs_list)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (u.format))) return_trace (false);
unsigned int format = 1;
u.format.set (format);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, alternate_len_list, num_glyphs, alternate_glyphs_list));
- default:return TRACE_RETURN (false);
+ case 1: return_trace (u.format1.serialize (c, glyphs, alternate_len_list, num_glyphs, alternate_glyphs_list));
+ default:return_trace (false);
}
}
@@ -562,10 +562,10 @@ struct AlternateSubst
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -602,13 +602,13 @@ struct Ligature
{
TRACE_WOULD_APPLY (this);
if (c->len != component.len)
- return TRACE_RETURN (false);
+ return_trace (false);
for (unsigned int i = 1; i < c->len; i++)
if (likely (c->glyphs[i] != component[i]))
- return TRACE_RETURN (false);
+ return_trace (false);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool apply (hb_apply_context_t *c) const
@@ -616,14 +616,14 @@ struct Ligature
TRACE_APPLY (this);
unsigned int count = component.len;
- if (unlikely (!count)) return TRACE_RETURN (false);
+ if (unlikely (!count)) return_trace (false);
/* Special-case to make it in-place and not consider this
* as a "ligated" substitution. */
if (unlikely (count == 1))
{
c->replace_glyph (ligGlyph);
- return TRACE_RETURN (true);
+ return_trace (true);
}
bool is_mark_ligature = false;
@@ -640,7 +640,7 @@ struct Ligature
match_positions,
&is_mark_ligature,
&total_component_count)))
- return TRACE_RETURN (false);
+ return_trace (false);
ligate_input (c,
count,
@@ -650,7 +650,7 @@ struct Ligature
is_mark_ligature,
total_component_count);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -659,17 +659,17 @@ struct Ligature
unsigned int num_components /* Including first component */)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
ligGlyph = ligature;
- if (unlikely (!component.serialize (c, components, num_components))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!component.serialize (c, components, num_components))) return_trace (false);
+ return_trace (true);
}
public:
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (ligGlyph.sanitize (c) && component.sanitize (c));
+ return_trace (ligGlyph.sanitize (c) && component.sanitize (c));
}
protected:
@@ -708,9 +708,9 @@ struct LigatureSet
{
const Ligature &lig = this+ligature[i];
if (lig.would_apply (c))
- return TRACE_RETURN (true);
+ return_trace (true);
}
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool apply (hb_apply_context_t *c) const
@@ -720,10 +720,10 @@ struct LigatureSet
for (unsigned int i = 0; i < num_ligs; i++)
{
const Ligature &lig = this+ligature[i];
- if (lig.apply (c)) return TRACE_RETURN (true);
+ if (lig.apply (c)) return_trace (true);
}
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool serialize (hb_serialize_context_t *c,
@@ -733,22 +733,22 @@ struct LigatureSet
Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!ligature.serialize (c, num_ligatures))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!ligature.serialize (c, num_ligatures))) return_trace (false);
for (unsigned int i = 0; i < num_ligatures; i++)
if (unlikely (!ligature[i].serialize (c, this).serialize (c,
ligatures[i],
component_list,
- component_count_list[i]))) return TRACE_RETURN (false);
+ component_count_list[i]))) return_trace (false);
ligatures.advance (num_ligatures);
component_count_list.advance (num_ligatures);
- return TRACE_RETURN (true);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (ligature.sanitize (c, this));
+ return_trace (ligature.sanitize (c, this));
}
protected:
@@ -790,10 +790,10 @@ struct LigatureSubstFormat1
{
TRACE_WOULD_APPLY (this);
unsigned int index = (this+coverage).get_coverage (c->glyphs[0]);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const LigatureSet &lig_set = this+ligatureSet[index];
- return TRACE_RETURN (lig_set.would_apply (c));
+ return_trace (lig_set.would_apply (c));
}
inline bool apply (hb_apply_context_t *c) const
@@ -802,10 +802,10 @@ struct LigatureSubstFormat1
hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
unsigned int index = (this+coverage).get_coverage (glyph_id);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const LigatureSet &lig_set = this+ligatureSet[index];
- return TRACE_RETURN (lig_set.apply (c));
+ return_trace (lig_set.apply (c));
}
inline bool serialize (hb_serialize_context_t *c,
@@ -817,23 +817,23 @@ struct LigatureSubstFormat1
Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
- if (unlikely (!ligatureSet.serialize (c, num_first_glyphs))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (*this))) return_trace (false);
+ if (unlikely (!ligatureSet.serialize (c, num_first_glyphs))) return_trace (false);
for (unsigned int i = 0; i < num_first_glyphs; i++)
if (unlikely (!ligatureSet[i].serialize (c, this).serialize (c,
ligatures_list,
component_count_list,
ligature_per_first_glyph_count_list[i],
- component_list))) return TRACE_RETURN (false);
+ component_list))) return_trace (false);
ligature_per_first_glyph_count_list.advance (num_first_glyphs);
- if (unlikely (!coverage.serialize (c, this).serialize (c, first_glyphs, num_first_glyphs))) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (unlikely (!coverage.serialize (c, this).serialize (c, first_glyphs, num_first_glyphs))) return_trace (false);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && ligatureSet.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && ligatureSet.sanitize (c, this));
}
protected:
@@ -859,13 +859,18 @@ struct LigatureSubst
Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
{
TRACE_SERIALIZE (this);
- if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+ if (unlikely (!c->extend_min (u.format))) return_trace (false);
unsigned int format = 1;
u.format.set (format);
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.serialize (c, first_glyphs, ligature_per_first_glyph_count_list, num_first_glyphs,
- ligatures_list, component_count_list, component_list));
- default:return TRACE_RETURN (false);
+ case 1: return_trace (u.format1.serialize (c,
+ first_glyphs,
+ ligature_per_first_glyph_count_list,
+ num_first_glyphs,
+ ligatures_list,
+ component_count_list,
+ component_list));
+ default:return_trace (false);
}
}
@@ -873,10 +878,10 @@ struct LigatureSubst
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -959,17 +964,17 @@ struct ReverseChainSingleSubstFormat1
inline bool would_apply (hb_would_apply_context_t *c) const
{
TRACE_WOULD_APPLY (this);
- return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+ return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
}
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY (this);
if (unlikely (c->nesting_level_left != MAX_NESTING_LEVEL))
- return TRACE_RETURN (false); /* No chaining to this type */
+ return_trace (false); /* No chaining to this type */
unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
@@ -986,22 +991,22 @@ struct ReverseChainSingleSubstFormat1
/* Note: We DON'T decrease buffer->idx. The main loop does it
* for us. This is useful for preventing surprises if someone
* calls us through a Context lookup. */
- return TRACE_RETURN (true);
+ return_trace (true);
}
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
if (!(coverage.sanitize (c, this) && backtrack.sanitize (c, this)))
- return TRACE_RETURN (false);
+ return_trace (false);
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
if (!lookahead.sanitize (c, this))
- return TRACE_RETURN (false);
+ return_trace (false);
const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
- return TRACE_RETURN (substitute.sanitize (c));
+ return_trace (substitute.sanitize (c));
}
protected:
@@ -1030,10 +1035,10 @@ struct ReverseChainSingleSubst
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ default:return_trace (c->default_return_value ());
}
}
@@ -1069,18 +1074,17 @@ struct SubstLookupSubTable
inline typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type) const
{
TRACE_DISPATCH (this, lookup_type);
- /* The sub_format passed to may_dispatch is unnecessary but harmless. */
- if (unlikely (!c->may_dispatch (this, &u.sub_format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.sub_format))) return_trace (c->no_dispatch_return_value ());
switch (lookup_type) {
- case Single: return TRACE_RETURN (u.single.dispatch (c));
- case Multiple: return TRACE_RETURN (u.multiple.dispatch (c));
- case Alternate: return TRACE_RETURN (u.alternate.dispatch (c));
- case Ligature: return TRACE_RETURN (u.ligature.dispatch (c));
- case Context: return TRACE_RETURN (u.context.dispatch (c));
- case ChainContext: return TRACE_RETURN (u.chainContext.dispatch (c));
- case Extension: return TRACE_RETURN (u.extension.dispatch (c));
- case ReverseChainSingle: return TRACE_RETURN (u.reverseChainContextSingle.dispatch (c));
- default: return TRACE_RETURN (c->default_return_value ());
+ case Single: return_trace (u.single.dispatch (c));
+ case Multiple: return_trace (u.multiple.dispatch (c));
+ case Alternate: return_trace (u.alternate.dispatch (c));
+ case Ligature: return_trace (u.ligature.dispatch (c));
+ case Context: return_trace (u.context.dispatch (c));
+ case ChainContext: return_trace (u.chainContext.dispatch (c));
+ case Extension: return_trace (u.extension.dispatch (c));
+ case ReverseChainSingle: return_trace (u.reverseChainContextSingle.dispatch (c));
+ default: return_trace (c->default_return_value ());
}
}
@@ -1120,21 +1124,21 @@ struct SubstLookup : Lookup
inline bool apply (hb_apply_context_t *c) const
{
TRACE_APPLY (this);
- return TRACE_RETURN (dispatch (c));
+ return_trace (dispatch (c));
}
inline hb_closure_context_t::return_t closure (hb_closure_context_t *c) const
{
TRACE_CLOSURE (this);
c->set_recurse_func (dispatch_recurse_func<hb_closure_context_t>);
- return TRACE_RETURN (dispatch (c));
+ return_trace (dispatch (c));
}
inline hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
{
TRACE_COLLECT_GLYPHS (this);
c->set_recurse_func (dispatch_recurse_func<hb_collect_glyphs_context_t>);
- return TRACE_RETURN (dispatch (c));
+ return_trace (dispatch (c));
}
template <typename set_t>
@@ -1148,9 +1152,9 @@ struct SubstLookup : Lookup
const hb_ot_layout_lookup_accelerator_t *accel) const
{
TRACE_WOULD_APPLY (this);
- if (unlikely (!c->len)) return TRACE_RETURN (false);
- if (!accel->may_have (c->glyphs[0])) return TRACE_RETURN (false);
- return TRACE_RETURN (dispatch (c));
+ if (unlikely (!c->len)) return_trace (false);
+ if (!accel->may_have (c->glyphs[0])) return_trace (false);
+ return_trace (dispatch (c));
}
static bool apply_recurse_func (hb_apply_context_t *c, unsigned int lookup_index);
@@ -1166,8 +1170,8 @@ struct SubstLookup : Lookup
unsigned int num_glyphs)
{
TRACE_SERIALIZE (this);
- if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Single, lookup_props, 1))) return TRACE_RETURN (false);
- return TRACE_RETURN (serialize_subtable (c, 0).u.single.serialize (c, glyphs, substitutes, num_glyphs));
+ if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Single, lookup_props, 1))) return_trace (false);
+ return_trace (serialize_subtable (c, 0).u.single.serialize (c, glyphs, substitutes, num_glyphs));
}
inline bool serialize_multiple (hb_serialize_context_t *c,
@@ -1178,9 +1182,12 @@ struct SubstLookup : Lookup
Supplier<GlyphID> &substitute_glyphs_list)
{
TRACE_SERIALIZE (this);
- if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Multiple, lookup_props, 1))) return TRACE_RETURN (false);
- return TRACE_RETURN (serialize_subtable (c, 0).u.multiple.serialize (c, glyphs, substitute_len_list, num_glyphs,
- substitute_glyphs_list));
+ if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Multiple, lookup_props, 1))) return_trace (false);
+ return_trace (serialize_subtable (c, 0).u.multiple.serialize (c,
+ glyphs,
+ substitute_len_list,
+ num_glyphs,
+ substitute_glyphs_list));
}
inline bool serialize_alternate (hb_serialize_context_t *c,
@@ -1191,9 +1198,12 @@ struct SubstLookup : Lookup
Supplier<GlyphID> &alternate_glyphs_list)
{
TRACE_SERIALIZE (this);
- if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Alternate, lookup_props, 1))) return TRACE_RETURN (false);
- return TRACE_RETURN (serialize_subtable (c, 0).u.alternate.serialize (c, glyphs, alternate_len_list, num_glyphs,
- alternate_glyphs_list));
+ if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Alternate, lookup_props, 1))) return_trace (false);
+ return_trace (serialize_subtable (c, 0).u.alternate.serialize (c,
+ glyphs,
+ alternate_len_list,
+ num_glyphs,
+ alternate_glyphs_list));
}
inline bool serialize_ligature (hb_serialize_context_t *c,
@@ -1206,9 +1216,14 @@ struct SubstLookup : Lookup
Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
{
TRACE_SERIALIZE (this);
- if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Ligature, lookup_props, 1))) return TRACE_RETURN (false);
- return TRACE_RETURN (serialize_subtable (c, 0).u.ligature.serialize (c, first_glyphs, ligature_per_first_glyph_count_list, num_first_glyphs,
- ligatures_list, component_count_list, component_list));
+ if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Ligature, lookup_props, 1))) return_trace (false);
+ return_trace (serialize_subtable (c, 0).u.ligature.serialize (c,
+ first_glyphs,
+ ligature_per_first_glyph_count_list,
+ num_first_glyphs,
+ ligatures_list,
+ component_count_list,
+ component_list));
}
template <typename context_t>
@@ -1221,9 +1236,8 @@ struct SubstLookup : Lookup
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!Lookup::sanitize (c))) return TRACE_RETURN (false);
- const OffsetArrayOf<SubstLookupSubTable> &list = get_subtables<SubstLookupSubTable> ();
- if (unlikely (!dispatch (c))) return TRACE_RETURN (false);
+ if (unlikely (!Lookup::sanitize (c))) return_trace (false);
+ if (unlikely (!dispatch (c))) return_trace (false);
if (unlikely (get_type () == SubstLookupSubTable::Extension))
{
@@ -1234,9 +1248,9 @@ struct SubstLookup : Lookup
unsigned int count = get_subtable_count ();
for (unsigned int i = 1; i < count; i++)
if (get_subtable (i).u.extension.get_type () != type)
- return TRACE_RETURN (false);
+ return_trace (false);
}
- return TRACE_RETURN (true);
+ return_trace (true);
}
};
@@ -1259,9 +1273,9 @@ struct GSUB : GSUBGPOS
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (unlikely (!GSUBGPOS::sanitize (c))) return TRACE_RETURN (false);
+ if (unlikely (!GSUBGPOS::sanitize (c))) return_trace (false);
const OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
- return TRACE_RETURN (list.sanitize (c, this));
+ return_trace (list.sanitize (c, this));
}
public:
DEFINE_SIZE_STATIC (10);
@@ -1312,8 +1326,11 @@ template <typename context_t>
const GSUB &gsub = *(hb_ot_layout_from_face (c->face)->gsub);
const SubstLookup &l = gsub.get_lookup (lookup_index);
unsigned int saved_lookup_props = c->lookup_props;
- c->set_lookup (l);
+ unsigned int saved_lookup_index = c->lookup_index;
+ c->set_lookup_index (lookup_index);
+ c->set_lookup_props (l.get_props ());
bool ret = l.dispatch (c);
+ c->set_lookup_index (saved_lookup_index);
c->set_lookup_props (saved_lookup_props);
return ret;
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh
index cbc6840bc8..230b3b6851 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh
@@ -46,14 +46,11 @@ namespace OT {
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"");
-struct hb_closure_context_t
+struct hb_closure_context_t :
+ hb_dispatch_context_t<hb_closure_context_t, hb_void_t, HB_DEBUG_CLOSURE>
{
inline const char *get_name (void) { return "CLOSURE"; }
- static const unsigned int max_debug_depth = HB_DEBUG_CLOSURE;
- typedef hb_void_t return_t;
typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned int lookup_index);
- template <typename T, typename F>
- inline bool may_dispatch (const T *obj, const F *format) { return true; }
template <typename T>
inline return_t dispatch (const T &obj) { obj.closure (this); return HB_VOID; }
static return_t default_return_value (void) { return HB_VOID; }
@@ -98,13 +95,10 @@ struct hb_closure_context_t
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"%d glyphs", c->len);
-struct hb_would_apply_context_t
+struct hb_would_apply_context_t :
+ hb_dispatch_context_t<hb_would_apply_context_t, bool, HB_DEBUG_WOULD_APPLY>
{
inline const char *get_name (void) { return "WOULD_APPLY"; }
- static const unsigned int max_debug_depth = HB_DEBUG_WOULD_APPLY;
- typedef bool return_t;
- template <typename T, typename F>
- inline bool may_dispatch (const T *obj, const F *format) { return true; }
template <typename T>
inline return_t dispatch (const T &obj) { return obj.would_apply (this); }
static return_t default_return_value (void) { return false; }
@@ -138,14 +132,11 @@ struct hb_would_apply_context_t
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"");
-struct hb_collect_glyphs_context_t
+struct hb_collect_glyphs_context_t :
+ hb_dispatch_context_t<hb_collect_glyphs_context_t, hb_void_t, HB_DEBUG_COLLECT_GLYPHS>
{
inline const char *get_name (void) { return "COLLECT_GLYPHS"; }
- static const unsigned int max_debug_depth = HB_DEBUG_COLLECT_GLYPHS;
- typedef hb_void_t return_t;
typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index);
- template <typename T, typename F>
- inline bool may_dispatch (const T *obj, const F *format) { return true; }
template <typename T>
inline return_t dispatch (const T &obj) { obj.collect_glyphs (this); return HB_VOID; }
static return_t default_return_value (void) { return HB_VOID; }
@@ -232,14 +223,14 @@ struct hb_collect_glyphs_context_t
#define HB_DEBUG_GET_COVERAGE (HB_DEBUG+0)
#endif
+/* XXX Can we remove this? */
+
template <typename set_t>
-struct hb_add_coverage_context_t
+struct hb_add_coverage_context_t :
+ hb_dispatch_context_t<hb_add_coverage_context_t<set_t>, const Coverage &, HB_DEBUG_GET_COVERAGE>
{
inline const char *get_name (void) { return "GET_COVERAGE"; }
- static const unsigned int max_debug_depth = HB_DEBUG_GET_COVERAGE;
typedef const Coverage &return_t;
- template <typename T, typename F>
- inline bool may_dispatch (const T *obj, const F *format) { return true; }
template <typename T>
inline return_t dispatch (const T &obj) { return obj.get_coverage (); }
static return_t default_return_value (void) { return Null(Coverage); }
@@ -266,9 +257,11 @@ struct hb_add_coverage_context_t
#define TRACE_APPLY(this) \
hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
- "idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint);
+ "idx %d gid %u lookup %d", \
+ c->buffer->idx, c->buffer->cur().codepoint, (int) c->lookup_index);
-struct hb_apply_context_t
+struct hb_apply_context_t :
+ hb_dispatch_context_t<hb_apply_context_t, bool, HB_DEBUG_APPLY>
{
struct matcher_t
{
@@ -328,8 +321,7 @@ struct hb_apply_context_t
if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
(ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
- (ignore_zwj || !_hb_glyph_info_is_zwj (&info)) &&
- !_hb_glyph_info_ligated (&info)))
+ (ignore_zwj || !_hb_glyph_info_is_zwj (&info))))
return SKIP_MAYBE;
return SKIP_NO;
@@ -363,11 +355,11 @@ struct hb_apply_context_t
{
matcher.set_lookup_props (lookup_props);
}
- inline void set_match_func (matcher_t::match_func_t match_func,
- const void *match_data,
+ inline void set_match_func (matcher_t::match_func_t match_func_,
+ const void *match_data_,
const USHORT glyph_data[])
{
- matcher.set_match_func (match_func, match_data);
+ matcher.set_match_func (match_func_, match_data_);
match_glyph_data = glyph_data;
}
@@ -449,11 +441,7 @@ struct hb_apply_context_t
inline const char *get_name (void) { return "APPLY"; }
- static const unsigned int max_debug_depth = HB_DEBUG_APPLY;
- typedef bool return_t;
typedef return_t (*recurse_func_t) (hb_apply_context_t *c, unsigned int lookup_index);
- template <typename T, typename F>
- inline bool may_dispatch (const T *obj, const F *format) { return true; }
template <typename T>
inline return_t dispatch (const T &obj) { return obj.apply (this); }
static return_t default_return_value (void) { return false; }
@@ -482,6 +470,7 @@ struct hb_apply_context_t
const GDEF &gdef;
bool has_glyph_classes;
skipping_iterator_t iter_input, iter_context;
+ unsigned int lookup_index;
unsigned int debug_depth;
@@ -500,12 +489,13 @@ struct hb_apply_context_t
has_glyph_classes (gdef.has_glyph_classes ()),
iter_input (),
iter_context (),
+ lookup_index ((unsigned int) -1),
debug_depth (0) {}
inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; }
inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; }
inline void set_recurse_func (recurse_func_t func) { recurse_func = func; }
- inline void set_lookup (const Lookup &l) { set_lookup_props (l.get_props ()); }
+ inline void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
inline void set_lookup_props (unsigned int lookup_props_)
{
lookup_props = lookup_props_;
@@ -516,39 +506,39 @@ struct hb_apply_context_t
inline bool
match_properties_mark (hb_codepoint_t glyph,
unsigned int glyph_props,
- unsigned int lookup_props) const
+ unsigned int match_props) const
{
/* If using mark filtering sets, the high short of
- * lookup_props has the set index.
+ * match_props has the set index.
*/
- if (lookup_props & LookupFlag::UseMarkFilteringSet)
- return gdef.mark_set_covers (lookup_props >> 16, glyph);
+ if (match_props & LookupFlag::UseMarkFilteringSet)
+ return gdef.mark_set_covers (match_props >> 16, glyph);
- /* The second byte of lookup_props has the meaning
+ /* The second byte of match_props has the meaning
* "ignore marks of attachment type different than
* the attachment type specified."
*/
- if (lookup_props & LookupFlag::MarkAttachmentType)
- return (lookup_props & LookupFlag::MarkAttachmentType) == (glyph_props & LookupFlag::MarkAttachmentType);
+ if (match_props & LookupFlag::MarkAttachmentType)
+ return (match_props & LookupFlag::MarkAttachmentType) == (glyph_props & LookupFlag::MarkAttachmentType);
return true;
}
inline bool
check_glyph_property (const hb_glyph_info_t *info,
- unsigned int lookup_props) const
+ unsigned int match_props) const
{
hb_codepoint_t glyph = info->codepoint;
unsigned int glyph_props = _hb_glyph_info_get_glyph_props (info);
/* Not covered, if, for example, glyph class is ligature and
- * lookup_props includes LookupFlags::IgnoreLigatures
+ * match_props includes LookupFlags::IgnoreLigatures
*/
- if (glyph_props & lookup_props & LookupFlag::IgnoreFlags)
+ if (glyph_props & match_props & LookupFlag::IgnoreFlags)
return false;
if (unlikely (glyph_props & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
- return match_properties_mark (glyph, glyph_props, lookup_props);
+ return match_properties_mark (glyph, glyph_props, match_props);
return true;
}
@@ -720,7 +710,7 @@ static inline bool match_input (hb_apply_context_t *c,
{
TRACE_APPLY (NULL);
- if (unlikely (count > MAX_CONTEXT_LENGTH)) TRACE_RETURN (false);
+ if (unlikely (count > MAX_CONTEXT_LENGTH)) return_trace (false);
hb_buffer_t *buffer = c->buffer;
@@ -757,7 +747,7 @@ static inline bool match_input (hb_apply_context_t *c,
match_positions[0] = buffer->idx;
for (unsigned int i = 1; i < count; i++)
{
- if (!skippy_iter.next ()) return TRACE_RETURN (false);
+ if (!skippy_iter.next ()) return_trace (false);
match_positions[i] = skippy_iter.idx;
@@ -769,13 +759,13 @@ static inline bool match_input (hb_apply_context_t *c,
* all subsequent components should be attached to the same ligature
* component, otherwise we shouldn't ligate them. */
if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
- return TRACE_RETURN (false);
+ return_trace (false);
} else {
/* If first component was NOT attached to a previous ligature component,
* all subsequent components should also NOT be attached to any ligature
* component, unless they are attached to the first component itself! */
if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
- return TRACE_RETURN (false);
+ return_trace (false);
}
is_mark_ligature = is_mark_ligature && _hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx]);
@@ -790,9 +780,9 @@ static inline bool match_input (hb_apply_context_t *c,
if (p_total_component_count)
*p_total_component_count = total_component_count;
- return TRACE_RETURN (true);
+ return_trace (true);
}
-static inline void ligate_input (hb_apply_context_t *c,
+static inline bool ligate_input (hb_apply_context_t *c,
unsigned int count, /* Including the first glyph */
unsigned int match_positions[MAX_CONTEXT_LENGTH], /* Including the first glyph */
unsigned int match_length,
@@ -882,7 +872,7 @@ static inline void ligate_input (hb_apply_context_t *c,
break;
}
}
- TRACE_RETURN (true);
+ return_trace (true);
}
static inline bool match_backtrack (hb_apply_context_t *c,
@@ -899,9 +889,9 @@ static inline bool match_backtrack (hb_apply_context_t *c,
for (unsigned int i = 0; i < count; i++)
if (!skippy_iter.prev ())
- return TRACE_RETURN (false);
+ return_trace (false);
- return TRACE_RETURN (true);
+ return_trace (true);
}
static inline bool match_lookahead (hb_apply_context_t *c,
@@ -919,9 +909,9 @@ static inline bool match_lookahead (hb_apply_context_t *c,
for (unsigned int i = 0; i < count; i++)
if (!skippy_iter.next ())
- return TRACE_RETURN (false);
+ return_trace (false);
- return TRACE_RETURN (true);
+ return_trace (true);
}
@@ -931,7 +921,7 @@ struct LookupRecord
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this));
+ return_trace (c->check_struct (this));
}
USHORT sequenceIndex; /* Index into current glyph
@@ -1032,7 +1022,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
buffer->move_to (end);
- return TRACE_RETURN (true);
+ return_trace (true);
}
@@ -1141,14 +1131,14 @@ struct Rule
{
TRACE_WOULD_APPLY (this);
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (inputZ, inputZ[0].static_size * (inputCount ? inputCount - 1 : 0));
- return TRACE_RETURN (context_would_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
+ return_trace (context_would_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
}
inline bool apply (hb_apply_context_t *c, ContextApplyLookupContext &lookup_context) const
{
TRACE_APPLY (this);
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (inputZ, inputZ[0].static_size * (inputCount ? inputCount - 1 : 0));
- return TRACE_RETURN (context_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
+ return_trace (context_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
}
public:
@@ -1200,9 +1190,9 @@ struct RuleSet
for (unsigned int i = 0; i < num_rules; i++)
{
if ((this+rule[i]).would_apply (c, lookup_context))
- return TRACE_RETURN (true);
+ return_trace (true);
}
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool apply (hb_apply_context_t *c, ContextApplyLookupContext &lookup_context) const
@@ -1212,15 +1202,15 @@ struct RuleSet
for (unsigned int i = 0; i < num_rules; i++)
{
if ((this+rule[i]).apply (c, lookup_context))
- return TRACE_RETURN (true);
+ return_trace (true);
}
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (rule.sanitize (c, this));
+ return_trace (rule.sanitize (c, this));
}
protected:
@@ -1277,7 +1267,7 @@ struct ContextFormat1
{match_glyph},
NULL
};
- return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+ return_trace (rule_set.would_apply (c, lookup_context));
}
inline const Coverage &get_coverage (void) const
@@ -1290,20 +1280,20 @@ struct ContextFormat1
TRACE_APPLY (this);
unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
if (likely (index == NOT_COVERED))
- return TRACE_RETURN (false);
+ return_trace (false);
const RuleSet &rule_set = this+ruleSet[index];
struct ContextApplyLookupContext lookup_context = {
{match_glyph},
NULL
};
- return TRACE_RETURN (rule_set.apply (c, lookup_context));
+ return_trace (rule_set.apply (c, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
}
protected:
@@ -1369,7 +1359,7 @@ struct ContextFormat2
{match_class},
&class_def
};
- return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+ return_trace (rule_set.would_apply (c, lookup_context));
}
inline const Coverage &get_coverage (void) const
@@ -1381,7 +1371,7 @@ struct ContextFormat2
{
TRACE_APPLY (this);
unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const ClassDef &class_def = this+classDef;
index = class_def.get_class (c->buffer->cur().codepoint);
@@ -1390,13 +1380,13 @@ struct ContextFormat2
{match_class},
&class_def
};
- return TRACE_RETURN (rule_set.apply (c, lookup_context));
+ return_trace (rule_set.apply (c, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
}
protected:
@@ -1460,7 +1450,7 @@ struct ContextFormat3
{match_coverage},
this
};
- return TRACE_RETURN (context_would_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
+ return_trace (context_would_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
}
inline const Coverage &get_coverage (void) const
@@ -1472,27 +1462,27 @@ struct ContextFormat3
{
TRACE_APPLY (this);
unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverageZ, coverageZ[0].static_size * glyphCount);
struct ContextApplyLookupContext lookup_context = {
{match_coverage},
this
};
- return TRACE_RETURN (context_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
+ return_trace (context_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!c->check_struct (this)) return TRACE_RETURN (false);
+ if (!c->check_struct (this)) return_trace (false);
unsigned int count = glyphCount;
- if (!count) return TRACE_RETURN (false); /* We want to access coverageZ[0] freely. */
- if (!c->check_array (coverageZ, coverageZ[0].static_size, count)) return TRACE_RETURN (false);
+ if (!count) return_trace (false); /* We want to access coverageZ[0] freely. */
+ if (!c->check_array (coverageZ, coverageZ[0].static_size, count)) return_trace (false);
for (unsigned int i = 0; i < count; i++)
- if (!coverageZ[i].sanitize (c, this)) return TRACE_RETURN (false);
+ if (!coverageZ[i].sanitize (c, this)) return_trace (false);
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverageZ, coverageZ[0].static_size * count);
- return TRACE_RETURN (c->check_array (lookupRecord, lookupRecord[0].static_size, lookupCount));
+ return_trace (c->check_array (lookupRecord, lookupRecord[0].static_size, lookupCount));
}
protected:
@@ -1515,12 +1505,12 @@ struct Context
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- case 2: return TRACE_RETURN (c->dispatch (u.format2));
- case 3: return TRACE_RETURN (c->dispatch (u.format3));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ case 2: return_trace (c->dispatch (u.format2));
+ case 3: return_trace (c->dispatch (u.format3));
+ default:return_trace (c->default_return_value ());
}
}
@@ -1685,11 +1675,11 @@ struct ChainRule
const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
- return TRACE_RETURN (chain_context_would_apply_lookup (c,
- backtrack.len, backtrack.array,
- input.len, input.array,
- lookahead.len, lookahead.array, lookup.len,
- lookup.array, lookup_context));
+ return_trace (chain_context_would_apply_lookup (c,
+ backtrack.len, backtrack.array,
+ input.len, input.array,
+ lookahead.len, lookahead.array, lookup.len,
+ lookup.array, lookup_context));
}
inline bool apply (hb_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
@@ -1698,23 +1688,23 @@ struct ChainRule
const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
- return TRACE_RETURN (chain_context_apply_lookup (c,
- backtrack.len, backtrack.array,
- input.len, input.array,
- lookahead.len, lookahead.array, lookup.len,
- lookup.array, lookup_context));
+ return_trace (chain_context_apply_lookup (c,
+ backtrack.len, backtrack.array,
+ input.len, input.array,
+ lookahead.len, lookahead.array, lookup.len,
+ lookup.array, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!backtrack.sanitize (c)) return TRACE_RETURN (false);
+ if (!backtrack.sanitize (c)) return_trace (false);
const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
- if (!input.sanitize (c)) return TRACE_RETURN (false);
+ if (!input.sanitize (c)) return_trace (false);
const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
- if (!lookahead.sanitize (c)) return TRACE_RETURN (false);
+ if (!lookahead.sanitize (c)) return_trace (false);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
- return TRACE_RETURN (lookup.sanitize (c));
+ return_trace (lookup.sanitize (c));
}
protected:
@@ -1759,9 +1749,9 @@ struct ChainRuleSet
unsigned int num_rules = rule.len;
for (unsigned int i = 0; i < num_rules; i++)
if ((this+rule[i]).would_apply (c, lookup_context))
- return TRACE_RETURN (true);
+ return_trace (true);
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool apply (hb_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
@@ -1770,15 +1760,15 @@ struct ChainRuleSet
unsigned int num_rules = rule.len;
for (unsigned int i = 0; i < num_rules; i++)
if ((this+rule[i]).apply (c, lookup_context))
- return TRACE_RETURN (true);
+ return_trace (true);
- return TRACE_RETURN (false);
+ return_trace (false);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (rule.sanitize (c, this));
+ return_trace (rule.sanitize (c, this));
}
protected:
@@ -1833,7 +1823,7 @@ struct ChainContextFormat1
{match_glyph},
{NULL, NULL, NULL}
};
- return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+ return_trace (rule_set.would_apply (c, lookup_context));
}
inline const Coverage &get_coverage (void) const
@@ -1845,20 +1835,20 @@ struct ChainContextFormat1
{
TRACE_APPLY (this);
unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const ChainRuleSet &rule_set = this+ruleSet[index];
struct ChainContextApplyLookupContext lookup_context = {
{match_glyph},
{NULL, NULL, NULL}
};
- return TRACE_RETURN (rule_set.apply (c, lookup_context));
+ return_trace (rule_set.apply (c, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
}
protected:
@@ -1937,7 +1927,7 @@ struct ChainContextFormat2
&input_class_def,
&lookahead_class_def}
};
- return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+ return_trace (rule_set.would_apply (c, lookup_context));
}
inline const Coverage &get_coverage (void) const
@@ -1949,7 +1939,7 @@ struct ChainContextFormat2
{
TRACE_APPLY (this);
unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const ClassDef &backtrack_class_def = this+backtrackClassDef;
const ClassDef &input_class_def = this+inputClassDef;
@@ -1963,15 +1953,17 @@ struct ChainContextFormat2
&input_class_def,
&lookahead_class_def}
};
- return TRACE_RETURN (rule_set.apply (c, lookup_context));
+ return_trace (rule_set.apply (c, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (coverage.sanitize (c, this) && backtrackClassDef.sanitize (c, this) &&
- inputClassDef.sanitize (c, this) && lookaheadClassDef.sanitize (c, this) &&
- ruleSet.sanitize (c, this));
+ return_trace (coverage.sanitize (c, this) &&
+ backtrackClassDef.sanitize (c, this) &&
+ inputClassDef.sanitize (c, this) &&
+ lookaheadClassDef.sanitize (c, this) &&
+ ruleSet.sanitize (c, this));
}
protected:
@@ -2054,11 +2046,11 @@ struct ChainContextFormat3
{match_coverage},
{this, this, this}
};
- return TRACE_RETURN (chain_context_would_apply_lookup (c,
- backtrack.len, (const USHORT *) backtrack.array,
- input.len, (const USHORT *) input.array + 1,
- lookahead.len, (const USHORT *) lookahead.array,
- lookup.len, lookup.array, lookup_context));
+ return_trace (chain_context_would_apply_lookup (c,
+ backtrack.len, (const USHORT *) backtrack.array,
+ input.len, (const USHORT *) input.array + 1,
+ lookahead.len, (const USHORT *) lookahead.array,
+ lookup.len, lookup.array, lookup_context));
}
inline const Coverage &get_coverage (void) const
@@ -2073,7 +2065,7 @@ struct ChainContextFormat3
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
- if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+ if (likely (index == NOT_COVERED)) return_trace (false);
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
@@ -2081,24 +2073,24 @@ struct ChainContextFormat3
{match_coverage},
{this, this, this}
};
- return TRACE_RETURN (chain_context_apply_lookup (c,
- backtrack.len, (const USHORT *) backtrack.array,
- input.len, (const USHORT *) input.array + 1,
- lookahead.len, (const USHORT *) lookahead.array,
- lookup.len, lookup.array, lookup_context));
+ return_trace (chain_context_apply_lookup (c,
+ backtrack.len, (const USHORT *) backtrack.array,
+ input.len, (const USHORT *) input.array + 1,
+ lookahead.len, (const USHORT *) lookahead.array,
+ lookup.len, lookup.array, lookup_context));
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- if (!backtrack.sanitize (c, this)) return TRACE_RETURN (false);
+ if (!backtrack.sanitize (c, this)) return_trace (false);
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
- if (!input.sanitize (c, this)) return TRACE_RETURN (false);
- if (!input.len) return TRACE_RETURN (false); /* To be consistent with Context. */
+ if (!input.sanitize (c, this)) return_trace (false);
+ if (!input.len) return_trace (false); /* To be consistent with Context. */
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
- if (!lookahead.sanitize (c, this)) return TRACE_RETURN (false);
+ if (!lookahead.sanitize (c, this)) return_trace (false);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
- return TRACE_RETURN (lookup.sanitize (c));
+ return_trace (lookup.sanitize (c));
}
protected:
@@ -2128,12 +2120,12 @@ struct ChainContext
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (c->dispatch (u.format1));
- case 2: return TRACE_RETURN (c->dispatch (u.format2));
- case 3: return TRACE_RETURN (c->dispatch (u.format3));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1));
+ case 2: return_trace (c->dispatch (u.format2));
+ case 3: return_trace (c->dispatch (u.format3));
+ default:return_trace (c->default_return_value ());
}
}
@@ -2164,15 +2156,15 @@ struct ExtensionFormat1
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, format);
- if (unlikely (!c->may_dispatch (this, this))) TRACE_RETURN (c->default_return_value ());
- return get_subtable<typename T::LookupSubTable> ().dispatch (c, get_type ());
+ if (unlikely (!c->may_dispatch (this, this))) return_trace (c->no_dispatch_return_value ());
+ return_trace (get_subtable<typename T::LookupSubTable> ().dispatch (c, get_type ()));
}
/* This is called from may_dispatch() above with hb_sanitize_context_t. */
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) && extensionOffset != 0);
+ return_trace (c->check_struct (this) && extensionOffset != 0);
}
protected:
@@ -2209,10 +2201,10 @@ struct Extension
inline typename context_t::return_t dispatch (context_t *c) const
{
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+ if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
- case 1: return TRACE_RETURN (u.format1.dispatch (c));
- default:return TRACE_RETURN (c->default_return_value ());
+ case 1: return_trace (u.format1.dispatch (c));
+ default:return_trace (c->default_return_value ());
}
}
@@ -2267,10 +2259,11 @@ struct GSUBGPOS
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) &&
- scriptList.sanitize (c, this) &&
- featureList.sanitize (c, this) &&
- lookupList.sanitize (c, this));
+ return_trace (version.sanitize (c) &&
+ likely (version.major == 1) &&
+ scriptList.sanitize (c, this) &&
+ featureList.sanitize (c, this) &&
+ lookupList.sanitize (c, this));
}
protected:
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh
index 739dfd9106..7e199c2e14 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh
@@ -57,17 +57,17 @@ struct JstfPriority
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- shrinkageEnableGSUB.sanitize (c, this) &&
- shrinkageDisableGSUB.sanitize (c, this) &&
- shrinkageEnableGPOS.sanitize (c, this) &&
- shrinkageDisableGPOS.sanitize (c, this) &&
- shrinkageJstfMax.sanitize (c, this) &&
- extensionEnableGSUB.sanitize (c, this) &&
- extensionDisableGSUB.sanitize (c, this) &&
- extensionEnableGPOS.sanitize (c, this) &&
- extensionDisableGPOS.sanitize (c, this) &&
- extensionJstfMax.sanitize (c, this));
+ return_trace (c->check_struct (this) &&
+ shrinkageEnableGSUB.sanitize (c, this) &&
+ shrinkageDisableGSUB.sanitize (c, this) &&
+ shrinkageEnableGPOS.sanitize (c, this) &&
+ shrinkageDisableGPOS.sanitize (c, this) &&
+ shrinkageJstfMax.sanitize (c, this) &&
+ extensionEnableGSUB.sanitize (c, this) &&
+ extensionDisableGSUB.sanitize (c, this) &&
+ extensionEnableGPOS.sanitize (c, this) &&
+ extensionDisableGPOS.sanitize (c, this) &&
+ extensionJstfMax.sanitize (c, this));
}
protected:
@@ -127,7 +127,7 @@ struct JstfLangSys : OffsetListOf<JstfPriority>
const Record<JstfLangSys>::sanitize_closure_t * = NULL) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (OffsetListOf<JstfPriority>::sanitize (c));
+ return_trace (OffsetListOf<JstfPriority>::sanitize (c));
}
};
@@ -168,9 +168,9 @@ struct JstfScript
const Record<JstfScript>::sanitize_closure_t * = NULL) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (extenderGlyphs.sanitize (c, this) &&
- defaultLangSys.sanitize (c, this) &&
- langSys.sanitize (c, this));
+ return_trace (extenderGlyphs.sanitize (c, this) &&
+ defaultLangSys.sanitize (c, this) &&
+ langSys.sanitize (c, this));
}
protected:
@@ -212,8 +212,9 @@ struct JSTF
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) &&
- scriptList.sanitize (c, this));
+ return_trace (version.sanitize (c) &&
+ likely (version.major == 1) &&
+ scriptList.sanitize (c, this));
}
protected:
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-private.hh
index 47fecd216d..d168e27f53 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-private.hh
@@ -36,6 +36,15 @@
#include "hb-set-private.hh"
+/* Private API corresponding to hb-ot-layout.h: */
+
+HB_INTERNAL hb_bool_t
+hb_ot_layout_table_find_feature (hb_face_t *face,
+ hb_tag_t table_tag,
+ hb_tag_t feature_tag,
+ unsigned int *feature_index);
+
+
/*
* GDEF
*/
@@ -179,6 +188,30 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout);
#define lig_props() var1.u8[2] /* GSUB/GPOS ligature tracking */
#define syllable() var1.u8[3] /* GSUB/GPOS shaping boundaries */
+
+/* loop over syllables */
+
+#define foreach_syllable(buffer, start, end) \
+ for (unsigned int \
+ _count = buffer->len, \
+ start = 0, end = _count ? _next_syllable (buffer, 0) : 0; \
+ start < _count; \
+ start = end, end = _next_syllable (buffer, start))
+
+static inline unsigned int
+_next_syllable (hb_buffer_t *buffer, unsigned int start)
+{
+ hb_glyph_info_t *info = buffer->info;
+ unsigned int count = buffer->len;
+
+ unsigned int syllable = info[start].syllable();
+ while (++start < count && syllable == info[start].syllable())
+ ;
+
+ return start;
+}
+
+
/* unicode_props */
enum {
@@ -225,10 +258,12 @@ _hb_glyph_info_get_modified_combining_class (const hb_glyph_info_t *info)
return info->unicode_props1();
}
+static inline bool _hb_glyph_info_ligated (const hb_glyph_info_t *info);
+
static inline hb_bool_t
_hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
{
- return !!(info->unicode_props0() & MASK0_IGNORABLE);
+ return (info->unicode_props0() & MASK0_IGNORABLE) && !_hb_glyph_info_ligated (info);
}
static inline hb_bool_t
@@ -406,6 +441,14 @@ _hb_glyph_info_clear_ligated_and_multiplied (hb_glyph_info_t *info)
HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED);
}
+static inline void
+_hb_glyph_info_clear_substituted_and_ligated_and_multiplied (hb_glyph_info_t *info)
+{
+ info->glyph_props() &= ~(HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED |
+ HB_OT_LAYOUT_GLYPH_PROPS_LIGATED |
+ HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED);
+}
+
/* Allocation / deallocation. */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout.cc
index b1e69e89f4..275a960d58 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout.cc
@@ -28,6 +28,7 @@
* Google Author(s): Behdad Esfahbod
*/
+#include "hb-open-type-private.hh"
#include "hb-ot-layout-private.hh"
#include "hb-ot-layout-gdef-table.hh"
@@ -128,6 +129,9 @@ hb_ot_layout_has_glyph_classes (hb_face_t *face)
return _get_gdef (face).has_glyph_classes ();
}
+/**
+ * Since: 0.9.7
+ **/
hb_ot_layout_glyph_class_t
hb_ot_layout_get_glyph_class (hb_face_t *face,
hb_codepoint_t glyph)
@@ -135,6 +139,9 @@ hb_ot_layout_get_glyph_class (hb_face_t *face,
return (hb_ot_layout_glyph_class_t) _get_gdef (face).get_glyph_class (glyph);
}
+/**
+ * Since: 0.9.7
+ **/
void
hb_ot_layout_get_glyphs_in_class (hb_face_t *face,
hb_ot_layout_glyph_class_t klass,
@@ -285,6 +292,28 @@ hb_ot_layout_table_get_feature_tags (hb_face_t *face,
return g.get_feature_tags (start_offset, feature_count, feature_tags);
}
+hb_bool_t
+hb_ot_layout_table_find_feature (hb_face_t *face,
+ hb_tag_t table_tag,
+ hb_tag_t feature_tag,
+ unsigned int *feature_index)
+{
+ ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
+ const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
+
+ unsigned int num_features = g.get_feature_count ();
+ for (unsigned int i = 0; i < num_features; i++)
+ {
+ if (feature_tag == g.get_feature_tag (i)) {
+ if (feature_index) *feature_index = i;
+ return true;
+ }
+ }
+
+ if (feature_index) *feature_index = HB_OT_LAYOUT_NO_FEATURE_INDEX;
+ return false;
+}
+
unsigned int
hb_ot_layout_script_get_language_tags (hb_face_t *face,
@@ -335,6 +364,9 @@ hb_ot_layout_language_get_required_feature_index (hb_face_t *face,
NULL);
}
+/**
+ * Since: 0.9.30
+ **/
hb_bool_t
hb_ot_layout_language_get_required_feature (hb_face_t *face,
hb_tag_t table_tag,
@@ -419,6 +451,9 @@ hb_ot_layout_language_find_feature (hb_face_t *face,
return false;
}
+/**
+ * Since: 0.9.7
+ **/
unsigned int
hb_ot_layout_feature_get_lookups (hb_face_t *face,
hb_tag_t table_tag,
@@ -433,6 +468,9 @@ hb_ot_layout_feature_get_lookups (hb_face_t *face,
return f.get_lookup_indexes (start_offset, lookup_count, lookup_indexes);
}
+/**
+ * Since: 0.9.22
+ **/
unsigned int
hb_ot_layout_table_get_lookup_count (hb_face_t *face,
hb_tag_t table_tag)
@@ -590,6 +628,9 @@ _hb_ot_layout_collect_lookups_languages (hb_face_t *face,
}
}
+/**
+ * Since: 0.9.8
+ **/
void
hb_ot_layout_collect_lookups (hb_face_t *face,
hb_tag_t table_tag,
@@ -631,6 +672,9 @@ hb_ot_layout_collect_lookups (hb_face_t *face,
}
}
+/**
+ * Since: 0.9.7
+ **/
void
hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
hb_tag_t table_tag,
@@ -676,6 +720,9 @@ hb_ot_layout_has_substitution (hb_face_t *face)
return &_get_gsub (face) != &OT::Null(OT::GSUB);
}
+/**
+ * Since: 0.9.7
+ **/
hb_bool_t
hb_ot_layout_lookup_would_substitute (hb_face_t *face,
unsigned int lookup_index,
@@ -714,6 +761,9 @@ hb_ot_layout_substitute_finish (hb_font_t *font, hb_buffer_t *buffer)
OT::GSUB::substitute_finish (font, buffer);
}
+/**
+ * Since: 0.9.7
+ **/
void
hb_ot_layout_lookup_substitute_closure (hb_face_t *face,
unsigned int lookup_index,
@@ -748,6 +798,9 @@ hb_ot_layout_position_finish (hb_font_t *font, hb_buffer_t *buffer)
OT::GPOS::position_finish (font, buffer);
}
+/**
+ * Since: 0.9.10
+ **/
hb_bool_t
hb_ot_layout_get_size_params (hb_face_t *face,
unsigned int *design_size, /* OUT. May be NULL */
@@ -873,13 +926,10 @@ apply_backward (OT::hb_apply_context_t *c,
return ret;
}
-struct hb_apply_forward_context_t
+struct hb_apply_forward_context_t :
+ OT::hb_dispatch_context_t<hb_apply_forward_context_t, bool, HB_DEBUG_APPLY>
{
- inline const char *get_name (void) { return "APPLY_FORWARD"; }
- static const unsigned int max_debug_depth = HB_DEBUG_APPLY;
- typedef bool return_t;
- template <typename T, typename F>
- inline bool may_dispatch (const T *obj, const F *format) { return true; }
+ inline const char *get_name (void) { return "APPLY_FWD"; }
template <typename T>
inline return_t dispatch (const T &obj) { return apply_forward (c, obj, accel); }
static return_t default_return_value (void) { return false; }
@@ -907,7 +957,7 @@ apply_string (OT::hb_apply_context_t *c,
if (unlikely (!buffer->len || !c->lookup_mask))
return;
- c->set_lookup (lookup);
+ c->set_lookup_props (lookup.get_props ());
if (likely (!lookup.is_reverse ()))
{
@@ -958,7 +1008,20 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
const stage_map_t *stage = &stages[table_index][stage_index];
for (; i < stage->last_lookup; i++)
{
+#if 0
+ char buf[4096];
+ hb_buffer_serialize_glyphs (buffer, 0, buffer->len,
+ buf, sizeof (buf), NULL,
+ font,
+ HB_BUFFER_SERIALIZE_FORMAT_TEXT,
+ Proxy::table_index == 0 ?
+ HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS :
+ HB_BUFFER_SERIALIZE_FLAG_DEFAULT);
+ printf ("buf: [%s]\n", buf);
+#endif
+
unsigned int lookup_index = lookups[table_index][i].index;
+ c.set_lookup_index (lookup_index);
c.set_lookup_mask (lookups[table_index][i].mask);
c.set_auto_zwj (lookups[table_index][i].auto_zwj);
apply_string<Proxy> (&c,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-map-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-map-private.hh
index 86b7e9fafe..f9538af183 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-map-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-map-private.hh
@@ -154,9 +154,10 @@ struct hb_ot_map_t
enum hb_ot_map_feature_flags_t {
F_NONE = 0x0000u,
- F_GLOBAL = 0x0001u,
- F_HAS_FALLBACK = 0x0002u,
- F_MANUAL_ZWJ = 0x0004u
+ F_GLOBAL = 0x0001u, /* Feature applies to all characters; results in no mask allocated for it. */
+ F_HAS_FALLBACK = 0x0002u, /* Has fallback implementation, so include mask bit even if feature not found. */
+ F_MANUAL_ZWJ = 0x0004u, /* Don't skip over ZWJ when matching. */
+ F_GLOBAL_SEARCH = 0x0008u /* If feature not found in LangSys, look for it in global feature list and pick one. */
};
/* Macro version for where const is desired. */
#define F_COMBINE(l,r) (hb_ot_map_feature_flags_t ((unsigned int) (l) | (unsigned int) (r)))
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-map.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-map.cc
index 4985eb22b2..95bd04ee8e 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-map.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-map.cc
@@ -216,6 +216,16 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
info->tag,
&feature_index[table_index]);
}
+ if (!found && (info->flags & F_GLOBAL_SEARCH))
+ {
+ for (unsigned int table_index = 0; table_index < 2; table_index++)
+ {
+ found |= hb_ot_layout_table_find_feature (face,
+ table_tags[table_index],
+ info->tag,
+ &feature_index[table_index]);
+ }
+ }
if (!found && !(info->flags & F_HAS_FALLBACK))
continue;
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-maxp-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-maxp-table.hh
index 0d9a0fa1d8..27105af132 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-maxp-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-maxp-table.hh
@@ -51,8 +51,9 @@ struct maxp
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- likely (version.major == 1 || (version.major == 0 && version.minor == 0x5000u)));
+ return_trace (c->check_struct (this) &&
+ likely (version.major == 1 ||
+ (version.major == 0 && version.minor == 0x5000u)));
}
/* We only implement version 0.5 as none of the extra fields in version 1.0 are useful. */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-name-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-name-table.hh
index 21450c6138..870f123325 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-name-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-name-table.hh
@@ -60,7 +60,7 @@ struct NameRecord
{
TRACE_SANITIZE (this);
/* We can check from base all the way up to the end of string... */
- return TRACE_RETURN (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
+ return_trace (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
}
USHORT platformID; /* Platform ID. */
@@ -107,17 +107,17 @@ struct name
char *string_pool = (char *) this + stringOffset;
unsigned int _count = count;
for (unsigned int i = 0; i < _count; i++)
- if (!nameRecord[i].sanitize (c, string_pool)) return TRACE_RETURN (false);
- return TRACE_RETURN (true);
+ if (!nameRecord[i].sanitize (c, string_pool)) return_trace (false);
+ return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
- return TRACE_RETURN (c->check_struct (this) &&
- likely (format == 0 || format == 1) &&
- c->check_array (nameRecord, nameRecord[0].static_size, count) &&
- sanitize_records (c));
+ return_trace (c->check_struct (this) &&
+ likely (format == 0 || format == 1) &&
+ c->check_array (nameRecord, nameRecord[0].static_size, count) &&
+ sanitize_records (c));
}
/* We only implement format 0 for now. */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
index a77f24ec84..d97d285210 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
@@ -75,9 +75,9 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS
if (!num_glyphs)
return NULL;
- /* Bubble-sort!
+ /* Bubble-sort or something equally good!
* May not be good-enough for presidential candidate interviews, but good-enough for us... */
- hb_bubble_sort (&glyphs[0], num_glyphs, OT::GlyphID::cmp, &substitutes[0]);
+ hb_stable_sort (&glyphs[0], num_glyphs, OT::GlyphID::cmp, &substitutes[0]);
OT::Supplier<OT::GlyphID> glyphs_supplier (glyphs, num_glyphs);
OT::Supplier<OT::GlyphID> substitutes_supplier (substitutes, num_glyphs);
@@ -126,7 +126,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
first_glyphs_indirection[num_first_glyphs] = first_glyph_idx;
num_first_glyphs++;
}
- hb_bubble_sort (&first_glyphs[0], num_first_glyphs, OT::GlyphID::cmp, &first_glyphs_indirection[0]);
+ hb_stable_sort (&first_glyphs[0], num_first_glyphs, OT::GlyphID::cmp, &first_glyphs_indirection[0]);
/* Now that the first-glyphs are sorted, walk again, populate ligatures. */
for (unsigned int i = 0; i < num_first_glyphs; i++)
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-private.hh
new file mode 100644
index 0000000000..fcedc7d742
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-private.hh
@@ -0,0 +1,50 @@
+/*
+ * Copyright © 2015 Mozilla Foundation.
+ * Copyright © 2015 Google, Inc.
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Mozilla Author(s): Jonathan Kew
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_PRIVATE_HH
+#define HB_OT_SHAPE_COMPLEX_ARABIC_PRIVATE_HH
+
+#include "hb-private.hh"
+
+#include "hb-ot-shape-complex-private.hh"
+
+
+struct arabic_shape_plan_t;
+
+HB_INTERNAL void *
+data_create_arabic (const hb_ot_shape_plan_t *plan);
+
+HB_INTERNAL void
+data_destroy_arabic (void *data);
+
+HB_INTERNAL void
+setup_masks_arabic_plan (const arabic_shape_plan_t *arabic_plan,
+ hb_buffer_t *buffer,
+ hb_script_t script);
+
+#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_PRIVATE_HH */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-table.hh
index 17100497ec..80d5044354 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-table.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic-table.hh
@@ -6,10 +6,10 @@
*
* on files with these headers:
*
- * # ArabicShaping-7.0.0.txt
- * # Date: 2014-02-14, 21:00:00 GMT [RP, KW, LI]
- * # Blocks-7.0.0.txt
- * # Date: 2014-04-03, 23:23:00 GMT [RP, KW]
+ * # ArabicShaping-8.0.0.txt
+ * # Date: 2015-02-17, 23:33:00 GMT [RP]
+ * # Blocks-8.0.0.txt
+ * # Date: 2014-11-10, 23:04:00 GMT [KW]
* UnicodeData.txt does not have a header.
*/
@@ -76,9 +76,9 @@ static const uint8_t joining_table[] =
/* Arabic Extended-A */
- /* 08A0 */ D,D,D,D,D,D,D,D,D,D,R,R,R,U,R,D,D,R,R,
+ /* 08A0 */ D,D,D,D,D,D,D,D,D,D,R,R,R,U,R,D,D,R,R,D,D,
-#define joining_offset_0x1806u 691
+#define joining_offset_0x1806u 693
/* Mongolian */
@@ -89,40 +89,40 @@ static const uint8_t joining_table[] =
/* 1880 */ U,U,U,U,U,U,U,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 18A0 */ D,D,D,D,D,D,D,D,D,X,D,
-#define joining_offset_0x200cu 856
+#define joining_offset_0x200cu 858
/* General Punctuation */
/* 2000 */ U,C,
-#define joining_offset_0x2066u 858
+#define joining_offset_0x2066u 860
/* General Punctuation */
/* 2060 */ U,U,U,U,
-#define joining_offset_0xa840u 862
+#define joining_offset_0xa840u 864
/* Phags-pa */
/* A840 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* A860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,L,U,
-#define joining_offset_0x10ac0u 914
+#define joining_offset_0x10ac0u 916
/* Manichaean */
/* 10AC0 */ D,D,D,D,D,R,U,R,U,R,R,U,U,L,R,R,R,R,R,D,D,D,D,L,D,D,D,D,D,R,D,D,
/* 10AE0 */ D,R,U,U,R,X,X,X,X,X,X,D,D,D,D,R,
-#define joining_offset_0x10b80u 962
+#define joining_offset_0x10b80u 964
/* Psalter Pahlavi */
/* 10B80 */ D,R,D,R,R,R,D,D,D,R,D,D,R,D,R,R,D,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 10BA0 */ X,X,X,X,X,X,X,X,X,R,R,R,R,D,D,U,
-}; /* Table items: 1010; occupancy: 57% */
+}; /* Table items: 1012; occupancy: 57% */
static unsigned int
@@ -131,7 +131,7 @@ joining_type (hb_codepoint_t u)
switch (u >> 12)
{
case 0x0u:
- if (hb_in_range (u, 0x0600u, 0x08B2u)) return joining_table[u - 0x0600u + joining_offset_0x0600u];
+ if (hb_in_range (u, 0x0600u, 0x08B4u)) return joining_table[u - 0x0600u + joining_offset_0x0600u];
break;
case 0x1u:
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc
index ae90864127..cde02e0a56 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc
@@ -24,7 +24,7 @@
* Google Author(s): Behdad Esfahbod
*/
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex-arabic-private.hh"
#include "hb-ot-shape-private.hh"
@@ -33,9 +33,13 @@
/*
+ * Joining types:
+ */
+
+/*
* Bits used in the joining tables
*/
-enum {
+enum hb_arabic_joining_type_t {
JOINING_TYPE_U = 0,
JOINING_TYPE_L = 1,
JOINING_TYPE_R = 2,
@@ -49,10 +53,6 @@ enum {
JOINING_TYPE_X = 8 /* means: use general-category to choose between U or T. */
};
-/*
- * Joining types:
- */
-
#include "hb-ot-shape-complex-arabic-table.hh"
static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_category_t gen_cat)
@@ -61,7 +61,7 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
if (likely (j_type != JOINING_TYPE_X))
return j_type;
- return (FLAG(gen_cat) &
+ return (FLAG_SAFE(gen_cat) &
(FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) |
FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
FLAG(HB_UNICODE_GENERAL_CATEGORY_FORMAT))
@@ -212,7 +212,7 @@ struct arabic_shape_plan_t
arabic_fallback_plan_t *fallback_plan;
};
-static void *
+void *
data_create_arabic (const hb_ot_shape_plan_t *plan)
{
arabic_shape_plan_t *arabic_plan = (arabic_shape_plan_t *) calloc (1, sizeof (arabic_shape_plan_t));
@@ -230,7 +230,7 @@ data_create_arabic (const hb_ot_shape_plan_t *plan)
return arabic_plan;
}
-static void
+void
data_destroy_arabic (void *data)
{
arabic_shape_plan_t *arabic_plan = (arabic_shape_plan_t *) data;
@@ -305,17 +305,15 @@ mongolian_variation_selectors (hb_buffer_t *buffer)
info[i].arabic_shaping_action() = info[i - 1].arabic_shaping_action();
}
-static void
-setup_masks_arabic (const hb_ot_shape_plan_t *plan,
- hb_buffer_t *buffer,
- hb_font_t *font HB_UNUSED)
+void
+setup_masks_arabic_plan (const arabic_shape_plan_t *arabic_plan,
+ hb_buffer_t *buffer,
+ hb_script_t script)
{
HB_BUFFER_ALLOCATE_VAR (buffer, arabic_shaping_action);
- const arabic_shape_plan_t *arabic_plan = (const arabic_shape_plan_t *) plan->data;
-
arabic_joining (buffer);
- if (plan->props.script == HB_SCRIPT_MONGOLIAN)
+ if (script == HB_SCRIPT_MONGOLIAN)
mongolian_variation_selectors (buffer);
unsigned int count = buffer->len;
@@ -326,6 +324,15 @@ setup_masks_arabic (const hb_ot_shape_plan_t *plan,
HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action);
}
+static void
+setup_masks_arabic (const hb_ot_shape_plan_t *plan,
+ hb_buffer_t *buffer,
+ hb_font_t *font HB_UNUSED)
+{
+ const arabic_shape_plan_t *arabic_plan = (const arabic_shape_plan_t *) plan->data;
+ setup_masks_arabic_plan (arabic_plan, buffer, plan->props.script);
+}
+
static void
nuke_joiners (const hb_ot_shape_plan_t *plan HB_UNUSED,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc
index 6ac18b08bf..1fa79ce6d4 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc
@@ -205,17 +205,12 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan,
buffer->next_glyph ();
if (!is_zero_width_char (font, u))
{
+ buffer->merge_out_clusters (start, end + 1);
hb_glyph_info_t *info = buffer->out_info;
hb_glyph_info_t tone = info[end];
memmove (&info[start + 1], &info[start], (end - start) * sizeof (hb_glyph_info_t));
info[start] = tone;
}
- /* Merge clusters across the (possibly reordered) syllable+tone.
- * We want to merge even in the zero-width tone mark case here,
- * so that clustering behavior isn't dependent on how the tone mark
- * is handled by the font.
- */
- buffer->merge_out_clusters (start, end + 1);
}
else
{
@@ -296,7 +291,8 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan,
}
else
end = start + 2;
- buffer->merge_out_clusters (start, end);
+ if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
+ buffer->merge_out_clusters (start, end);
continue;
}
}
@@ -368,7 +364,8 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan,
info[i++].hangul_shaping_feature() = VJMO;
if (i < end)
info[i++].hangul_shaping_feature() = TJMO;
- buffer->merge_out_clusters (start, end);
+ if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
+ buffer->merge_out_clusters (start, end);
continue;
}
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic-private.hh
index d8dfc6507d..559ebe4986 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic-private.hh
@@ -161,8 +161,6 @@ enum indic_matra_category_t {
INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT = POS_PRE_M
};
-/* Note: We use ASSERT_STATIC_EXPR_ZERO() instead of ASSERT_STATIC_EXPR() and the comma operation
- * because gcc fails to optimize the latter and fills the table in at runtime. */
#define INDIC_COMBINE_CATEGORIES(S,M) \
(ASSERT_STATIC_EXPR_ZERO (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || \
( \
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
index 7723600410..44481dbb4c 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
@@ -142,7 +142,7 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
{
/* If it ligated, all bets are off. */
if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG (info.indic_category()) & flags);
+ return !!(FLAG_SAFE (info.indic_category()) & flags);
}
static inline bool
@@ -237,7 +237,7 @@ set_indic_properties (hb_glyph_info_t &info)
* Re-assign position.
*/
- if ((FLAG (cat) & CONSONANT_FLAGS))
+ if ((FLAG_SAFE (cat) & CONSONANT_FLAGS))
{
pos = POS_BASE_C;
if (is_ra (u))
@@ -247,7 +247,7 @@ set_indic_properties (hb_glyph_info_t &info)
{
pos = matra_position (u, pos);
}
- else if ((FLAG (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
+ else if ((FLAG_SAFE (cat) & (FLAG (OT_SM) | FLAG (OT_VD) | FLAG (OT_A) | FLAG (OT_Symbol))))
{
pos = POS_SMVD;
}
@@ -756,7 +756,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
{
default:
assert (false);
- /* fallthrough */
+ HB_FALLTHROUGH;
case BASE_POS_LAST:
{
@@ -963,7 +963,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
indic_position_t last_pos = POS_START;
for (unsigned int i = start; i < end; i++)
{
- if ((FLAG (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | HALANT_OR_COENG_FLAGS)))
+ if ((FLAG_SAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | HALANT_OR_COENG_FLAGS)))
{
info[i].indic_position() = last_pos;
if (unlikely (info[i].indic_category() == OT_H &&
@@ -1012,7 +1012,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
info[i].syllable() = i - start;
/* Sit tight, rock 'n roll! */
- hb_bubble_sort (info + start, end - start, compare_indic_order);
+ hb_stable_sort (info + start, end - start, compare_indic_order);
/* Find base again */
base = end;
for (unsigned int i = start; i < end; i++)
@@ -1025,7 +1025,11 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
* around like crazy. In old-spec mode, we move halants around, so in
* that case merge all clusters after base. Otherwise, check the sort
* order and merge as needed.
- * For pre-base stuff, we handle cluster issues in final reordering. */
+ * For pre-base stuff, we handle cluster issues in final reordering.
+ *
+ * We could use buffer->sort() for this, if there was no special
+ * reordering of pre-base stuff happening later...
+ */
if (indic_plan->is_old_spec || end - base > 127)
buffer->merge_clusters (base, end);
else
@@ -1161,17 +1165,6 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
}
}
-
-static void
-initial_reordering_vowel_syllable (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
-{
- /* We made the vowels look like consonants. So let's call the consonant logic! */
- initial_reordering_consonant_syllable (plan, face, buffer, start, end);
-}
-
static void
initial_reordering_standalone_cluster (const hb_ot_shape_plan_t *plan,
hb_face_t *face,
@@ -1194,50 +1187,27 @@ initial_reordering_standalone_cluster (const hb_ot_shape_plan_t *plan,
}
static void
-initial_reordering_broken_cluster (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
-{
- /* We already inserted dotted-circles, so just call the standalone_cluster. */
- initial_reordering_standalone_cluster (plan, face, buffer, start, end);
-}
-
-static void
-initial_reordering_symbol_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_face_t *face HB_UNUSED,
- hb_buffer_t *buffer HB_UNUSED,
- unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
-{
- /* Nothing to do right now. If we ever switch to using the output
- * buffer in the reordering process, we'd need to next_glyph() here. */
-}
-
-static void
-initial_reordering_non_indic_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_face_t *face HB_UNUSED,
- hb_buffer_t *buffer HB_UNUSED,
- unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
-{
- /* Nothing to do right now. If we ever switch to using the output
- * buffer in the reordering process, we'd need to next_glyph() here. */
-}
-
-
-static void
initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
hb_face_t *face,
hb_buffer_t *buffer,
unsigned int start, unsigned int end)
{
syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
- switch (syllable_type) {
- case consonant_syllable: initial_reordering_consonant_syllable (plan, face, buffer, start, end); return;
- case vowel_syllable: initial_reordering_vowel_syllable (plan, face, buffer, start, end); return;
- case standalone_cluster: initial_reordering_standalone_cluster (plan, face, buffer, start, end); return;
- case symbol_cluster: initial_reordering_symbol_cluster (plan, face, buffer, start, end); return;
- case broken_cluster: initial_reordering_broken_cluster (plan, face, buffer, start, end); return;
- case non_indic_cluster: initial_reordering_non_indic_cluster (plan, face, buffer, start, end); return;
+ switch (syllable_type)
+ {
+ case vowel_syllable: /* We made the vowels look like consonants. So let's call the consonant logic! */
+ case consonant_syllable:
+ initial_reordering_consonant_syllable (plan, face, buffer, start, end);
+ break;
+
+ case broken_cluster: /* We already inserted dotted-circles, so just call the standalone_cluster. */
+ case standalone_cluster:
+ initial_reordering_standalone_cluster (plan, face, buffer, start, end);
+ break;
+
+ case symbol_cluster:
+ case non_indic_cluster:
+ break;
}
}
@@ -1281,10 +1251,10 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
{
last_syllable = syllable;
- hb_glyph_info_t info = dottedcircle;
- info.cluster = buffer->cur().cluster;
- info.mask = buffer->cur().mask;
- info.syllable() = buffer->cur().syllable();
+ hb_glyph_info_t ginfo = dottedcircle;
+ ginfo.cluster = buffer->cur().cluster;
+ ginfo.mask = buffer->cur().mask;
+ ginfo.syllable() = buffer->cur().syllable();
/* TODO Set glyph_props? */
/* Insert dottedcircle after possible Repha. */
@@ -1293,7 +1263,7 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
buffer->cur().indic_category() == OT_Repha)
buffer->next_glyph ();
- buffer->output_info (info);
+ buffer->output_info (ginfo);
}
else
buffer->next_glyph ();
@@ -1310,18 +1280,8 @@ initial_reordering (const hb_ot_shape_plan_t *plan,
update_consonant_positions (plan, font, buffer);
insert_dotted_circles (plan, font, buffer);
- hb_glyph_info_t *info = buffer->info;
- unsigned int count = buffer->len;
- if (unlikely (!count)) return;
- unsigned int last = 0;
- unsigned int last_syllable = info[0].syllable();
- for (unsigned int i = 1; i < count; i++)
- if (last_syllable != info[i].syllable()) {
- initial_reordering_syllable (plan, font->face, buffer, last, i);
- last = i;
- last_syllable = info[last].syllable();
- }
- initial_reordering_syllable (plan, font->face, buffer, last, count);
+ foreach_syllable (buffer, start, end)
+ initial_reordering_syllable (plan, font->face, buffer, start, end);
}
static void
@@ -1448,12 +1408,17 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if (info[i - 1].indic_position () == POS_PRE_M)
{
unsigned int old_pos = i - 1;
+ if (old_pos < base && base <= new_pos) /* Shouldn't actually happen. */
+ base--;
+
hb_glyph_info_t tmp = info[old_pos];
memmove (&info[old_pos], &info[old_pos + 1], (new_pos - old_pos) * sizeof (info[0]));
info[new_pos] = tmp;
- if (old_pos < base && base <= new_pos) /* Shouldn't actually happen. */
- base--;
+
+ /* Note: this merge_clusters() is intentionally *after* the reordering.
+ * Indic matra reordering is special and tricky... */
buffer->merge_clusters (new_pos, MIN (end, base + 1));
+
new_pos--;
}
} else {
@@ -1550,7 +1515,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
new_reph_pos = base;
while (new_reph_pos < end &&
- !( FLAG (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD))))
+ !( FLAG_SAFE (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD))))
new_reph_pos++;
if (new_reph_pos < end)
goto reph_move;
@@ -1606,12 +1571,12 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
reph_move:
{
- buffer->merge_clusters (start, new_reph_pos + 1);
-
/* Move */
+ buffer->merge_clusters (start, new_reph_pos + 1);
hb_glyph_info_t reph = info[start];
memmove (&info[start], &info[start + 1], (new_reph_pos - start) * sizeof (info[0]));
info[new_reph_pos] = reph;
+
if (start < base && base <= new_reph_pos)
base--;
}
@@ -1666,8 +1631,8 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if (new_pos > start && info[new_pos - 1].indic_category() == OT_M)
{
unsigned int old_pos = i;
- for (unsigned int i = base + 1; i < old_pos; i++)
- if (info[i].indic_category() == OT_M)
+ for (unsigned int j = base + 1; j < old_pos; j++)
+ if (info[j].indic_category() == OT_M)
{
new_pos--;
break;
@@ -1684,10 +1649,12 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
unsigned int old_pos = i;
+
buffer->merge_clusters (new_pos, old_pos + 1);
hb_glyph_info_t tmp = info[old_pos];
memmove (&info[new_pos + 1], &info[new_pos], (old_pos - new_pos) * sizeof (info[0]));
info[new_pos] = tmp;
+
if (new_pos <= base && base < old_pos)
base++;
}
@@ -1701,7 +1668,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
/* Apply 'init' to the Left Matra if it's a word start. */
if (info[start].indic_position () == POS_PRE_M &&
(!start ||
- !(FLAG (_hb_glyph_info_get_general_category (&info[start - 1])) &
+ !(FLAG_SAFE (_hb_glyph_info_get_general_category (&info[start - 1])) &
FLAG_RANGE (HB_UNICODE_GENERAL_CATEGORY_FORMAT, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
info[start].mask |= indic_plan->mask_array[INIT];
@@ -1737,16 +1704,8 @@ final_reordering (const hb_ot_shape_plan_t *plan,
unsigned int count = buffer->len;
if (unlikely (!count)) return;
- hb_glyph_info_t *info = buffer->info;
- unsigned int last = 0;
- unsigned int last_syllable = info[0].syllable();
- for (unsigned int i = 1; i < count; i++)
- if (last_syllable != info[i].syllable()) {
- final_reordering_syllable (plan, buffer, last, i);
- last = i;
- last_syllable = info[last].syllable();
- }
- final_reordering_syllable (plan, buffer, last, count);
+ foreach_syllable (buffer, start, end)
+ final_reordering_syllable (plan, buffer, start, end);
HB_BUFFER_DEALLOCATE_VAR (buffer, indic_category);
HB_BUFFER_DEALLOCATE_VAR (buffer, indic_position);
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc
index d016380cc6..7f74f2df82 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc
@@ -154,7 +154,7 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
{
/* If it ligated, all bets are off. */
if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG (info.myanmar_category()) & flags);
+ return !!(FLAG_SAFE (info.myanmar_category()) & flags);
}
static inline bool
@@ -304,9 +304,7 @@ compare_myanmar_order (const hb_glyph_info_t *pa, const hb_glyph_info_t *pb)
* http://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm */
static void
-initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
+initial_reordering_consonant_syllable (hb_buffer_t *buffer,
unsigned int start, unsigned int end)
{
hb_glyph_info_t *info = buffer->info;
@@ -393,43 +391,11 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
}
}
- buffer->merge_clusters (start, end);
/* Sit tight, rock 'n roll! */
- hb_bubble_sort (info + start, end - start, compare_myanmar_order);
+ buffer->sort (start, end, compare_myanmar_order);
}
static void
-initial_reordering_broken_cluster (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
-{
- /* We already inserted dotted-circles, so just call the consonant_syllable. */
- initial_reordering_consonant_syllable (plan, face, buffer, start, end);
-}
-
-static void
-initial_reordering_punctuation_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_face_t *face HB_UNUSED,
- hb_buffer_t *buffer HB_UNUSED,
- unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
-{
- /* Nothing to do right now. If we ever switch to using the output
- * buffer in the reordering process, we'd need to next_glyph() here. */
-}
-
-static void
-initial_reordering_non_myanmar_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_face_t *face HB_UNUSED,
- hb_buffer_t *buffer HB_UNUSED,
- unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
-{
- /* Nothing to do right now. If we ever switch to using the output
- * buffer in the reordering process, we'd need to next_glyph() here. */
-}
-
-
-static void
initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
hb_face_t *face,
hb_buffer_t *buffer,
@@ -437,10 +403,15 @@ initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
switch (syllable_type) {
- case consonant_syllable: initial_reordering_consonant_syllable (plan, face, buffer, start, end); return;
- case punctuation_cluster: initial_reordering_punctuation_cluster (plan, face, buffer, start, end); return;
- case broken_cluster: initial_reordering_broken_cluster (plan, face, buffer, start, end); return;
- case non_myanmar_cluster: initial_reordering_non_myanmar_cluster (plan, face, buffer, start, end); return;
+
+ case broken_cluster: /* We already inserted dotted-circles, so just call the consonant_syllable. */
+ case consonant_syllable:
+ initial_reordering_consonant_syllable (buffer, start, end);
+ break;
+
+ case punctuation_cluster:
+ case non_myanmar_cluster:
+ break;
}
}
@@ -484,12 +455,12 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
{
last_syllable = syllable;
- hb_glyph_info_t info = dottedcircle;
- info.cluster = buffer->cur().cluster;
- info.mask = buffer->cur().mask;
- info.syllable() = buffer->cur().syllable();
+ hb_glyph_info_t ginfo = dottedcircle;
+ ginfo.cluster = buffer->cur().cluster;
+ ginfo.mask = buffer->cur().mask;
+ ginfo.syllable() = buffer->cur().syllable();
- buffer->output_info (info);
+ buffer->output_info (ginfo);
}
else
buffer->next_glyph ();
@@ -505,18 +476,8 @@ initial_reordering (const hb_ot_shape_plan_t *plan,
{
insert_dotted_circles (plan, font, buffer);
- hb_glyph_info_t *info = buffer->info;
- unsigned int count = buffer->len;
- if (unlikely (!count)) return;
- unsigned int last = 0;
- unsigned int last_syllable = info[0].syllable();
- for (unsigned int i = 1; i < count; i++)
- if (last_syllable != info[i].syllable()) {
- initial_reordering_syllable (plan, font->face, buffer, last, i);
- last = i;
- last_syllable = info[last].syllable();
- }
- initial_reordering_syllable (plan, font->face, buffer, last, count);
+ foreach_syllable (buffer, start, end)
+ initial_reordering_syllable (plan, font->face, buffer, start, end);
}
static void
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
index e268933ce4..8d03dee51f 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-private.hh
@@ -59,9 +59,9 @@ enum hb_ot_shape_zero_width_marks_type_t {
HB_COMPLEX_SHAPER_IMPLEMENT (myanmar_old) \
HB_COMPLEX_SHAPER_IMPLEMENT (indic) \
HB_COMPLEX_SHAPER_IMPLEMENT (myanmar) \
- HB_COMPLEX_SHAPER_IMPLEMENT (sea) \
HB_COMPLEX_SHAPER_IMPLEMENT (thai) \
HB_COMPLEX_SHAPER_IMPLEMENT (tibetan) \
+ HB_COMPLEX_SHAPER_IMPLEMENT (use) \
/* ^--- Add new shapers here */
@@ -179,9 +179,12 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_PSALTER_PAHLAVI:
/* For Arabic script, use the Arabic shaper even if no OT script tag was found.
- * This is because we do fallback shaping for Arabic script (and not others). */
- if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT ||
- planner->props.script == HB_SCRIPT_ARABIC)
+ * This is because we do fallback shaping for Arabic script (and not others).
+ * But note that Arabic shaping is applicable only to horizontal layout; for
+ * vertical text, just use the generic shaper instead. */
+ if ((planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT ||
+ planner->props.script == HB_SCRIPT_ARABIC) &&
+ HB_DIRECTION_IS_HORIZONTAL(planner->props.direction))
return &_hb_ot_complex_shaper_arabic;
else
return &_hb_ot_complex_shaper_default;
@@ -214,61 +217,9 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
/* ^--- Add new shapers here */
-
#if 0
- /* Note:
- *
- * These disabled scripts are listed in ucd/IndicSyllabicCategory.txt, but according
- * to Martin Hosken and Jonathan Kew do not require complex shaping.
- *
- * TODO We should automate figuring out which scripts do not need complex shaping
- *
- * TODO We currently keep data for these scripts in our indic table. Need to fix the
- * generator to not do that.
- */
-
-
- /* Simple? */
-
- /* Unicode-3.2 additions */
- case HB_SCRIPT_BUHID:
- case HB_SCRIPT_HANUNOO:
-
- /* Unicode-5.1 additions */
- case HB_SCRIPT_SAURASHTRA:
-
- /* Unicode-6.0 additions */
- case HB_SCRIPT_BATAK:
- case HB_SCRIPT_BRAHMI:
-
-
- /* Simple */
-
- /* Unicode-1.1 additions */
- /* These have their own shaper now. */
- case HB_SCRIPT_LAO:
- case HB_SCRIPT_THAI:
-
- /* Unicode-3.2 additions */
- case HB_SCRIPT_TAGALOG:
- case HB_SCRIPT_TAGBANWA:
-
- /* Unicode-4.0 additions */
- case HB_SCRIPT_LIMBU:
- case HB_SCRIPT_TAI_LE:
-
/* Unicode-4.1 additions */
- case HB_SCRIPT_KHAROSHTHI:
case HB_SCRIPT_NEW_TAI_LUE:
- case HB_SCRIPT_SYLOTI_NAGRI:
-
- /* Unicode-5.1 additions */
- case HB_SCRIPT_KAYAH_LI:
-
- /* Unicode-5.2 additions */
- case HB_SCRIPT_TAI_VIET:
-
-
#endif
/* Unicode-1.1 additions */
@@ -285,28 +236,11 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
/* Unicode-3.0 additions */
case HB_SCRIPT_SINHALA:
- /* Unicode-5.0 additions */
- case HB_SCRIPT_BALINESE:
-
- /* Unicode-5.1 additions */
- case HB_SCRIPT_LEPCHA:
- case HB_SCRIPT_REJANG:
- case HB_SCRIPT_SUNDANESE:
-
/* Unicode-5.2 additions */
case HB_SCRIPT_JAVANESE:
- case HB_SCRIPT_KAITHI:
- case HB_SCRIPT_MEETEI_MAYEK:
-
- /* Unicode-6.0 additions */
-
- /* Unicode-6.1 additions */
- case HB_SCRIPT_CHAKMA:
- case HB_SCRIPT_SHARADA:
- case HB_SCRIPT_TAKRI:
/* If the designer designed the font for the 'DFLT' script,
- * use the default shaper. Otherwise, use the Indic shaper.
+ * use the default shaper. Otherwise, use the specific shaper.
* Note that for some simple scripts, there may not be *any*
* GSUB/GPOS needed, so there may be no scripts found! */
if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
@@ -338,23 +272,82 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
else
return &_hb_ot_complex_shaper_default;
+
+ /* Unicode-2.0 additions */
+ //case HB_SCRIPT_TIBETAN:
+
+ /* Unicode-3.0 additions */
+ //case HB_SCRIPT_MONGOLIAN:
+ //case HB_SCRIPT_SINHALA:
+
+ /* Unicode-3.2 additions */
+ case HB_SCRIPT_BUHID:
+ case HB_SCRIPT_HANUNOO:
+ case HB_SCRIPT_TAGALOG:
+ case HB_SCRIPT_TAGBANWA:
+
+ /* Unicode-4.0 additions */
+ case HB_SCRIPT_LIMBU:
+ case HB_SCRIPT_TAI_LE:
+
/* Unicode-4.1 additions */
case HB_SCRIPT_BUGINESE:
+ case HB_SCRIPT_KHAROSHTHI:
+ case HB_SCRIPT_SYLOTI_NAGRI:
+ case HB_SCRIPT_TIFINAGH:
+
+ /* Unicode-5.0 additions */
+ case HB_SCRIPT_BALINESE:
+ //case HB_SCRIPT_NKO:
+ //case HB_SCRIPT_PHAGS_PA:
/* Unicode-5.1 additions */
case HB_SCRIPT_CHAM:
+ case HB_SCRIPT_KAYAH_LI:
+ case HB_SCRIPT_LEPCHA:
+ case HB_SCRIPT_REJANG:
+ case HB_SCRIPT_SAURASHTRA:
+ case HB_SCRIPT_SUNDANESE:
/* Unicode-5.2 additions */
+ case HB_SCRIPT_EGYPTIAN_HIEROGLYPHS:
+ //case HB_SCRIPT_JAVANESE:
+ case HB_SCRIPT_KAITHI:
+ case HB_SCRIPT_MEETEI_MAYEK:
case HB_SCRIPT_TAI_THAM:
+ case HB_SCRIPT_TAI_VIET:
+
+ /* Unicode-6.0 additions */
+ case HB_SCRIPT_BATAK:
+ case HB_SCRIPT_BRAHMI:
+ //case HB_SCRIPT_MANDAIC:
+
+ /* Unicode-6.1 additions */
+ case HB_SCRIPT_CHAKMA:
+ case HB_SCRIPT_SHARADA:
+ case HB_SCRIPT_TAKRI:
+
+ /* Unicode-7.0 additions */
+ case HB_SCRIPT_DUPLOYAN:
+ case HB_SCRIPT_GRANTHA:
+ case HB_SCRIPT_KHOJKI:
+ case HB_SCRIPT_KHUDAWADI:
+ case HB_SCRIPT_MAHAJANI:
+ //case HB_SCRIPT_MANICHAEAN:
+ case HB_SCRIPT_MODI:
+ case HB_SCRIPT_PAHAWH_HMONG:
+ //case HB_SCRIPT_PSALTER_PAHLAVI:
+ case HB_SCRIPT_SIDDHAM:
+ case HB_SCRIPT_TIRHUTA:
/* If the designer designed the font for the 'DFLT' script,
- * use the default shaper. Otherwise, use the Indic shaper.
+ * use the default shaper. Otherwise, use the specific shaper.
* Note that for some simple scripts, there may not be *any*
* GSUB/GPOS needed, so there may be no scripts found! */
if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T'))
return &_hb_ot_complex_shaper_default;
else
- return &_hb_ot_complex_shaper_sea;
+ return &_hb_ot_complex_shaper_use;
}
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea-machine.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea-machine.hh
deleted file mode 100644
index 15b862f5a1..0000000000
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea-machine.hh
+++ /dev/null
@@ -1,224 +0,0 @@
-
-#line 1 "hb-ot-shape-complex-sea-machine.rl"
-/*
- * Copyright © 2011,2012,2013 Google, Inc.
- *
- * This is part of HarfBuzz, a text shaping library.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- *
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
- * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- *
- * Google Author(s): Behdad Esfahbod
- */
-
-#ifndef HB_OT_SHAPE_COMPLEX_SEA_MACHINE_HH
-#define HB_OT_SHAPE_COMPLEX_SEA_MACHINE_HH
-
-#include "hb-private.hh"
-
-
-#line 36 "hb-ot-shape-complex-sea-machine.hh"
-static const unsigned char _sea_syllable_machine_trans_keys[] = {
- 1u, 1u, 1u, 1u, 1u, 29u, 3u, 29u, 3u, 29u, 1u, 1u, 0
-};
-
-static const char _sea_syllable_machine_key_spans[] = {
- 1, 1, 29, 27, 27, 1
-};
-
-static const char _sea_syllable_machine_index_offsets[] = {
- 0, 2, 4, 34, 62, 90
-};
-
-static const char _sea_syllable_machine_indicies[] = {
- 1, 0, 3, 2, 1, 1, 3, 5,
- 4, 4, 4, 4, 4, 3, 4, 1,
- 4, 4, 4, 4, 3, 4, 4, 4,
- 4, 3, 4, 4, 4, 3, 3, 3,
- 3, 4, 1, 7, 6, 6, 6, 6,
- 6, 1, 6, 6, 6, 6, 6, 6,
- 1, 6, 6, 6, 6, 1, 6, 6,
- 6, 1, 1, 1, 1, 6, 3, 9,
- 8, 8, 8, 8, 8, 3, 8, 8,
- 8, 8, 8, 8, 3, 8, 8, 8,
- 8, 3, 8, 8, 8, 3, 3, 3,
- 3, 8, 3, 10, 0
-};
-
-static const char _sea_syllable_machine_trans_targs[] = {
- 2, 3, 2, 4, 2, 5, 2, 0,
- 2, 1, 2
-};
-
-static const char _sea_syllable_machine_trans_actions[] = {
- 1, 2, 3, 2, 6, 0, 7, 0,
- 8, 0, 9
-};
-
-static const char _sea_syllable_machine_to_state_actions[] = {
- 0, 0, 4, 0, 0, 0
-};
-
-static const char _sea_syllable_machine_from_state_actions[] = {
- 0, 0, 5, 0, 0, 0
-};
-
-static const char _sea_syllable_machine_eof_trans[] = {
- 1, 3, 0, 7, 9, 11
-};
-
-static const int sea_syllable_machine_start = 2;
-static const int sea_syllable_machine_first_final = 2;
-static const int sea_syllable_machine_error = -1;
-
-static const int sea_syllable_machine_en_main = 2;
-
-
-#line 36 "hb-ot-shape-complex-sea-machine.rl"
-
-
-
-#line 67 "hb-ot-shape-complex-sea-machine.rl"
-
-
-#define found_syllable(syllable_type) \
- HB_STMT_START { \
- if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type); \
- for (unsigned int i = last; i < p+1; i++) \
- info[i].syllable() = (syllable_serial << 4) | syllable_type; \
- last = p+1; \
- syllable_serial++; \
- if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
- } HB_STMT_END
-
-static void
-find_syllables (hb_buffer_t *buffer)
-{
- unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED;
- int cs;
- hb_glyph_info_t *info = buffer->info;
-
-#line 117 "hb-ot-shape-complex-sea-machine.hh"
- {
- cs = sea_syllable_machine_start;
- ts = 0;
- te = 0;
- act = 0;
- }
-
-#line 88 "hb-ot-shape-complex-sea-machine.rl"
-
-
- p = 0;
- pe = eof = buffer->len;
-
- unsigned int last = 0;
- unsigned int syllable_serial = 1;
-
-#line 134 "hb-ot-shape-complex-sea-machine.hh"
- {
- int _slen;
- int _trans;
- const unsigned char *_keys;
- const char *_inds;
- if ( p == pe )
- goto _test_eof;
-_resume:
- switch ( _sea_syllable_machine_from_state_actions[cs] ) {
- case 5:
-#line 1 "NONE"
- {ts = p;}
- break;
-#line 148 "hb-ot-shape-complex-sea-machine.hh"
- }
-
- _keys = _sea_syllable_machine_trans_keys + (cs<<1);
- _inds = _sea_syllable_machine_indicies + _sea_syllable_machine_index_offsets[cs];
-
- _slen = _sea_syllable_machine_key_spans[cs];
- _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].sea_category()) &&
- ( info[p].sea_category()) <= _keys[1] ?
- ( info[p].sea_category()) - _keys[0] : _slen ];
-
-_eof_trans:
- cs = _sea_syllable_machine_trans_targs[_trans];
-
- if ( _sea_syllable_machine_trans_actions[_trans] == 0 )
- goto _again;
-
- switch ( _sea_syllable_machine_trans_actions[_trans] ) {
- case 2:
-#line 1 "NONE"
- {te = p+1;}
- break;
- case 6:
-#line 63 "hb-ot-shape-complex-sea-machine.rl"
- {te = p+1;{ found_syllable (non_sea_cluster); }}
- break;
- case 7:
-#line 61 "hb-ot-shape-complex-sea-machine.rl"
- {te = p;p--;{ found_syllable (consonant_syllable); }}
- break;
- case 8:
-#line 62 "hb-ot-shape-complex-sea-machine.rl"
- {te = p;p--;{ found_syllable (broken_cluster); }}
- break;
- case 9:
-#line 63 "hb-ot-shape-complex-sea-machine.rl"
- {te = p;p--;{ found_syllable (non_sea_cluster); }}
- break;
- case 1:
-#line 61 "hb-ot-shape-complex-sea-machine.rl"
- {{p = ((te))-1;}{ found_syllable (consonant_syllable); }}
- break;
- case 3:
-#line 62 "hb-ot-shape-complex-sea-machine.rl"
- {{p = ((te))-1;}{ found_syllable (broken_cluster); }}
- break;
-#line 194 "hb-ot-shape-complex-sea-machine.hh"
- }
-
-_again:
- switch ( _sea_syllable_machine_to_state_actions[cs] ) {
- case 4:
-#line 1 "NONE"
- {ts = 0;}
- break;
-#line 203 "hb-ot-shape-complex-sea-machine.hh"
- }
-
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- if ( _sea_syllable_machine_eof_trans[cs] > 0 ) {
- _trans = _sea_syllable_machine_eof_trans[cs] - 1;
- goto _eof_trans;
- }
- }
-
- }
-
-#line 97 "hb-ot-shape-complex-sea-machine.rl"
-
-}
-
-#undef found_syllable
-
-#endif /* HB_OT_SHAPE_COMPLEX_SEA_MACHINE_HH */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea.cc
deleted file mode 100644
index f08b7ccb9f..0000000000
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-sea.cc
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright © 2011,2012,2013 Google, Inc.
- *
- * This is part of HarfBuzz, a text shaping library.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- *
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
- * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
- * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- *
- * Google Author(s): Behdad Esfahbod
- */
-
-#include "hb-ot-shape-complex-indic-private.hh"
-
-/* buffer var allocations */
-#define sea_category() complex_var_u8_0() /* indic_category_t */
-#define sea_position() complex_var_u8_1() /* indic_position_t */
-
-
-/*
- * South-East Asian shaper.
- * Loosely based on the Myanmar spec / shaper.
- * There is no OpenType spec for this.
- */
-
-static const hb_tag_t
-basic_features[] =
-{
- /*
- * Basic features.
- * These features are applied in order, one at a time, after initial_reordering.
- */
- HB_TAG('p','r','e','f'),
- HB_TAG('a','b','v','f'),
- HB_TAG('b','l','w','f'),
- HB_TAG('p','s','t','f'),
-};
-static const hb_tag_t
-other_features[] =
-{
- /*
- * Other features.
- * These features are applied all at once, after final_reordering.
- */
- HB_TAG('p','r','e','s'),
- HB_TAG('a','b','v','s'),
- HB_TAG('b','l','w','s'),
- HB_TAG('p','s','t','s'),
- /* Positioning features, though we don't care about the types. */
- HB_TAG('d','i','s','t'),
-};
-
-static void
-setup_syllables (const hb_ot_shape_plan_t *plan,
- hb_font_t *font,
- hb_buffer_t *buffer);
-static void
-initial_reordering (const hb_ot_shape_plan_t *plan,
- hb_font_t *font,
- hb_buffer_t *buffer);
-static void
-final_reordering (const hb_ot_shape_plan_t *plan,
- hb_font_t *font,
- hb_buffer_t *buffer);
-
-static void
-collect_features_sea (hb_ot_shape_planner_t *plan)
-{
- hb_ot_map_builder_t *map = &plan->map;
-
- /* Do this before any lookups have been applied. */
- map->add_gsub_pause (setup_syllables);
-
- map->add_global_bool_feature (HB_TAG('l','o','c','l'));
- /* The Indic specs do not require ccmp, but we apply it here since if
- * there is a use of it, it's typically at the beginning. */
- map->add_global_bool_feature (HB_TAG('c','c','m','p'));
-
- map->add_gsub_pause (initial_reordering);
- for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
- {
- map->add_feature (basic_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
- map->add_gsub_pause (NULL);
- }
- map->add_gsub_pause (final_reordering);
- for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
- map->add_feature (other_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
-}
-
-static void
-override_features_sea (hb_ot_shape_planner_t *plan)
-{
- plan->map.add_feature (HB_TAG('l','i','g','a'), 0, F_GLOBAL);
-}
-
-
-enum syllable_type_t {
- consonant_syllable,
- broken_cluster,
- non_sea_cluster,
-};
-
-#include "hb-ot-shape-complex-sea-machine.hh"
-
-
-/* Note: This enum is duplicated in the -machine.rl source file.
- * Not sure how to avoid duplication. */
-enum sea_category_t {
-// OT_C = 1,
- OT_GB = 12, /* Generic Base XXX DOTTED CIRCLE only for now */
-// OT_H = 4, /* Halant */
- OT_IV = 2, /* Independent Vowel */
- OT_MR = 22, /* Medial Ra */
-// OT_CM = 17, /* Consonant Medial */
- OT_VAbv = 26,
- OT_VBlw = 27,
- OT_VPre = 28,
- OT_VPst = 29,
- OT_T = 3, /* Tone Marks */
-// OT_A = 10, /* Anusvara */
-};
-
-static inline void
-set_sea_properties (hb_glyph_info_t &info)
-{
- hb_codepoint_t u = info.codepoint;
- unsigned int type = hb_indic_get_categories (u);
- indic_category_t cat = (indic_category_t) (type & 0x7Fu);
- indic_position_t pos = (indic_position_t) (type >> 8);
-
- /* Medial Ra */
- if (u == 0x1A55u || u == 0xAA34u)
- cat = (indic_category_t) OT_MR;
-
- if (cat == OT_M)
- {
- switch ((int) pos)
- {
- case POS_PRE_C: cat = (indic_category_t) OT_VPre; break;
- case POS_ABOVE_C: cat = (indic_category_t) OT_VAbv; break;
- case POS_BELOW_C: cat = (indic_category_t) OT_VBlw; break;
- case POS_POST_C: cat = (indic_category_t) OT_VPst; break;
- }
- }
-
- info.sea_category() = (sea_category_t) cat;
- info.sea_position() = pos;
-}
-
-
-static void
-setup_masks_sea (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_buffer_t *buffer,
- hb_font_t *font HB_UNUSED)
-{
- HB_BUFFER_ALLOCATE_VAR (buffer, sea_category);
- HB_BUFFER_ALLOCATE_VAR (buffer, sea_position);
-
- /* We cannot setup masks here. We save information about characters
- * and setup masks later on in a pause-callback. */
-
- unsigned int count = buffer->len;
- hb_glyph_info_t *info = buffer->info;
- for (unsigned int i = 0; i < count; i++)
- set_sea_properties (info[i]);
-}
-
-static void
-setup_syllables (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_font_t *font HB_UNUSED,
- hb_buffer_t *buffer)
-{
- find_syllables (buffer);
-}
-
-static int
-compare_sea_order (const hb_glyph_info_t *pa, const hb_glyph_info_t *pb)
-{
- int a = pa->sea_position();
- int b = pb->sea_position();
-
- return a < b ? -1 : a == b ? 0 : +1;
-}
-
-
-static void
-initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
-{
- hb_glyph_info_t *info = buffer->info;
- unsigned int base = start;
-
- /* Reorder! */
- unsigned int i = start;
- for (; i < base; i++)
- info[i].sea_position() = POS_PRE_C;
- if (i < end)
- {
- info[i].sea_position() = POS_BASE_C;
- i++;
- }
- for (; i < end; i++)
- {
- if (info[i].sea_category() == OT_MR) /* Pre-base reordering */
- {
- info[i].sea_position() = POS_PRE_C;
- continue;
- }
- if (info[i].sea_category() == OT_VPre) /* Left matra */
- {
- info[i].sea_position() = POS_PRE_M;
- continue;
- }
-
- info[i].sea_position() = POS_AFTER_MAIN;
- }
-
- buffer->merge_clusters (start, end);
- /* Sit tight, rock 'n roll! */
- hb_bubble_sort (info + start, end - start, compare_sea_order);
-}
-
-static void
-initial_reordering_broken_cluster (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
-{
- /* We already inserted dotted-circles, so just call the consonant_syllable. */
- initial_reordering_consonant_syllable (plan, face, buffer, start, end);
-}
-
-static void
-initial_reordering_non_sea_cluster (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_face_t *face HB_UNUSED,
- hb_buffer_t *buffer HB_UNUSED,
- unsigned int start HB_UNUSED, unsigned int end HB_UNUSED)
-{
- /* Nothing to do right now. If we ever switch to using the output
- * buffer in the reordering process, we'd need to next_glyph() here. */
-}
-
-
-static void
-initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
-{
- syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
- switch (syllable_type) {
- case consonant_syllable: initial_reordering_consonant_syllable (plan, face, buffer, start, end); return;
- case broken_cluster: initial_reordering_broken_cluster (plan, face, buffer, start, end); return;
- case non_sea_cluster: initial_reordering_non_sea_cluster (plan, face, buffer, start, end); return;
- }
-}
-
-static inline void
-insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_font_t *font,
- hb_buffer_t *buffer)
-{
- /* Note: This loop is extra overhead, but should not be measurable. */
- bool has_broken_syllables = false;
- unsigned int count = buffer->len;
- hb_glyph_info_t *info = buffer->info;
- for (unsigned int i = 0; i < count; i++)
- if ((info[i].syllable() & 0x0F) == broken_cluster)
- {
- has_broken_syllables = true;
- break;
- }
- if (likely (!has_broken_syllables))
- return;
-
-
- hb_codepoint_t dottedcircle_glyph;
- if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
- return;
-
- hb_glyph_info_t dottedcircle = {0};
- dottedcircle.codepoint = 0x25CCu;
- set_sea_properties (dottedcircle);
- dottedcircle.codepoint = dottedcircle_glyph;
-
- buffer->clear_output ();
-
- buffer->idx = 0;
- unsigned int last_syllable = 0;
- while (buffer->idx < buffer->len)
- {
- unsigned int syllable = buffer->cur().syllable();
- syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F);
- if (unlikely (last_syllable != syllable && syllable_type == broken_cluster))
- {
- last_syllable = syllable;
-
- hb_glyph_info_t info = dottedcircle;
- info.cluster = buffer->cur().cluster;
- info.mask = buffer->cur().mask;
- info.syllable() = buffer->cur().syllable();
-
- buffer->output_info (info);
- }
- else
- buffer->next_glyph ();
- }
-
- buffer->swap_buffers ();
-}
-
-static void
-initial_reordering (const hb_ot_shape_plan_t *plan,
- hb_font_t *font,
- hb_buffer_t *buffer)
-{
- insert_dotted_circles (plan, font, buffer);
-
- hb_glyph_info_t *info = buffer->info;
- unsigned int count = buffer->len;
- if (unlikely (!count)) return;
- unsigned int last = 0;
- unsigned int last_syllable = info[0].syllable();
- for (unsigned int i = 1; i < count; i++)
- if (last_syllable != info[i].syllable()) {
- initial_reordering_syllable (plan, font->face, buffer, last, i);
- last = i;
- last_syllable = info[last].syllable();
- }
- initial_reordering_syllable (plan, font->face, buffer, last, count);
-}
-
-static void
-final_reordering (const hb_ot_shape_plan_t *plan,
- hb_font_t *font HB_UNUSED,
- hb_buffer_t *buffer)
-{
- hb_glyph_info_t *info = buffer->info;
- unsigned int count = buffer->len;
-
- /* Zero syllables now... */
- for (unsigned int i = 0; i < count; i++)
- info[i].syllable() = 0;
-
- HB_BUFFER_DEALLOCATE_VAR (buffer, sea_category);
- HB_BUFFER_DEALLOCATE_VAR (buffer, sea_position);
-}
-
-
-const hb_ot_complex_shaper_t _hb_ot_complex_shaper_sea =
-{
- "sea",
- collect_features_sea,
- override_features_sea,
- NULL, /* data_create */
- NULL, /* data_destroy */
- NULL, /* preprocess_text */
- HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
- NULL, /* decompose */
- NULL, /* compose */
- setup_masks_sea,
- HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
- false, /* fallback_position */
-};
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc
index feb7fc7a14..8a8f2f7991 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc
@@ -139,7 +139,7 @@ thai_pua_shape (hb_codepoint_t u, thai_action_t action, hb_font_t *font)
};
switch (action) {
- default: assert (false); /* Fallthrough */
+ default: assert (false); HB_FALLTHROUGH;
case NOP: return u;
case SD: pua_mappings = SD_mappings; break;
case SDL: pua_mappings = SDL_mappings; break;
@@ -353,7 +353,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan,
{
/* Since we decomposed, and NIKHAHIT is combining, merge clusters with the
* previous cluster. */
- if (start)
+ if (start && buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
buffer->merge_out_clusters (start - 1, end);
}
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-machine.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-machine.hh
new file mode 100644
index 0000000000..ced9d97f28
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-machine.hh
@@ -0,0 +1,548 @@
+
+#line 1 "hb-ot-shape-complex-use-machine.rl"
+/*
+ * Copyright © 2015 Mozilla Foundation.
+ * Copyright © 2015 Google, Inc.
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Mozilla Author(s): Jonathan Kew
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
+#define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
+
+#include "hb-private.hh"
+
+
+#line 38 "hb-ot-shape-complex-use-machine.hh"
+static const unsigned char _use_syllable_machine_trans_keys[] = {
+ 0u, 0u, 4u, 4u, 1u, 1u, 0u, 39u, 21u, 21u, 8u, 39u, 8u, 39u, 1u, 1u,
+ 8u, 39u, 8u, 39u, 8u, 39u, 8u, 26u, 8u, 26u, 8u, 26u, 8u, 39u, 8u, 39u,
+ 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u,
+ 8u, 39u, 8u, 39u, 8u, 39u, 1u, 1u, 8u, 39u, 8u, 39u, 8u, 26u, 8u, 26u,
+ 8u, 26u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u,
+ 8u, 39u, 12u, 21u, 12u, 13u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 26u,
+ 8u, 26u, 8u, 26u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u,
+ 8u, 39u, 8u, 39u, 8u, 39u, 8u, 39u, 1u, 39u, 8u, 39u, 21u, 42u, 41u, 42u,
+ 42u, 42u, 0
+};
+
+static const char _use_syllable_machine_key_spans[] = {
+ 0, 1, 1, 40, 1, 32, 32, 1,
+ 32, 32, 32, 19, 19, 19, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 1, 32, 32, 19, 19,
+ 19, 32, 32, 32, 32, 32, 32, 32,
+ 32, 10, 2, 32, 32, 32, 32, 19,
+ 19, 19, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 39, 32, 22, 2,
+ 1
+};
+
+static const short _use_syllable_machine_index_offsets[] = {
+ 0, 0, 2, 4, 45, 47, 80, 113,
+ 115, 148, 181, 214, 234, 254, 274, 307,
+ 340, 373, 406, 439, 472, 505, 538, 571,
+ 604, 637, 670, 703, 705, 738, 771, 791,
+ 811, 831, 864, 897, 930, 963, 996, 1029,
+ 1062, 1095, 1106, 1109, 1142, 1175, 1208, 1241,
+ 1261, 1281, 1301, 1334, 1367, 1400, 1433, 1466,
+ 1499, 1532, 1565, 1598, 1631, 1671, 1704, 1727,
+ 1730
+};
+
+static const char _use_syllable_machine_indicies[] = {
+ 1, 0, 3, 2, 4, 5, 6,
+ 4, 1, 5, 8, 8, 7, 8, 8,
+ 3, 9, 8, 8, 8, 4, 4, 10,
+ 11, 8, 8, 12, 13, 14, 15, 16,
+ 17, 18, 12, 19, 20, 21, 22, 23,
+ 24, 8, 25, 26, 27, 8, 29, 28,
+ 31, 30, 30, 32, 33, 30, 30, 30,
+ 30, 30, 30, 30, 30, 34, 35, 36,
+ 37, 38, 39, 40, 41, 35, 42, 34,
+ 43, 44, 45, 46, 30, 47, 48, 49,
+ 30, 31, 30, 30, 32, 33, 30, 30,
+ 30, 30, 30, 30, 30, 30, 50, 35,
+ 36, 37, 38, 39, 40, 41, 35, 42,
+ 43, 43, 44, 45, 46, 30, 47, 48,
+ 49, 30, 32, 51, 31, 30, 30, 32,
+ 33, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 35, 36, 37, 38, 39, 40,
+ 41, 35, 42, 43, 43, 44, 45, 46,
+ 30, 47, 48, 49, 30, 31, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 35, 36, 37, 38, 39,
+ 30, 30, 30, 30, 30, 30, 44, 45,
+ 46, 30, 47, 48, 49, 30, 31, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 36, 37, 38,
+ 39, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 47, 48, 49, 30, 31,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 37,
+ 38, 39, 30, 31, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 38, 39, 30, 31,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 39, 30, 31, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 37, 38, 39, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 47, 48, 49, 30, 31, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 37, 38, 39, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 48, 49, 30, 31, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 37, 38, 39,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 49, 30, 31, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 36, 37, 38,
+ 39, 30, 30, 30, 30, 30, 30, 44,
+ 45, 46, 30, 47, 48, 49, 30, 31,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 36, 37,
+ 38, 39, 30, 30, 30, 30, 30, 30,
+ 30, 45, 46, 30, 47, 48, 49, 30,
+ 31, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 36,
+ 37, 38, 39, 30, 30, 30, 30, 30,
+ 30, 30, 30, 46, 30, 47, 48, 49,
+ 30, 31, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 35,
+ 36, 37, 38, 39, 30, 41, 35, 30,
+ 30, 30, 44, 45, 46, 30, 47, 48,
+ 49, 30, 31, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 35, 36, 37, 38, 39, 30, 30, 35,
+ 30, 30, 30, 44, 45, 46, 30, 47,
+ 48, 49, 30, 31, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 35, 36, 37, 38, 39, 40, 41,
+ 35, 30, 30, 30, 44, 45, 46, 30,
+ 47, 48, 49, 30, 31, 30, 30, 32,
+ 33, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 35, 36, 37, 38, 39, 40,
+ 41, 35, 42, 30, 43, 44, 45, 46,
+ 30, 47, 48, 49, 30, 31, 30, 30,
+ 32, 33, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 35, 36, 37, 38, 39,
+ 40, 41, 35, 42, 34, 43, 44, 45,
+ 46, 30, 47, 48, 49, 30, 53, 52,
+ 52, 54, 55, 52, 52, 52, 52, 52,
+ 52, 52, 52, 56, 52, 57, 58, 59,
+ 60, 61, 62, 57, 63, 56, 64, 52,
+ 52, 52, 52, 65, 66, 67, 52, 53,
+ 52, 52, 54, 55, 52, 52, 52, 52,
+ 52, 52, 52, 52, 68, 52, 57, 58,
+ 59, 60, 61, 62, 57, 63, 64, 64,
+ 52, 52, 52, 52, 65, 66, 67, 52,
+ 54, 51, 53, 52, 52, 54, 55, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 57, 58, 59, 60, 61, 62, 57,
+ 63, 64, 64, 52, 52, 52, 52, 65,
+ 66, 67, 52, 53, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 57, 58, 59, 60, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 65, 66, 67, 52, 53, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 58, 59, 60, 52,
+ 53, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 59, 60, 52, 53, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 60, 52,
+ 53, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 58, 59, 60, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 65, 66, 67,
+ 52, 53, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 58, 59, 60, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 66,
+ 67, 52, 53, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 58, 59, 60, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 67, 52, 53, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 57, 58, 59, 60, 52, 62,
+ 57, 52, 52, 52, 52, 52, 52, 52,
+ 65, 66, 67, 52, 53, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 57, 58, 59, 60, 52,
+ 52, 57, 52, 52, 52, 52, 52, 52,
+ 52, 65, 66, 67, 52, 53, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 57, 58, 59, 60,
+ 61, 62, 57, 52, 52, 52, 52, 52,
+ 52, 52, 65, 66, 67, 52, 53, 52,
+ 52, 54, 55, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 57, 58, 59,
+ 60, 61, 62, 57, 63, 52, 64, 52,
+ 52, 52, 52, 65, 66, 67, 52, 53,
+ 52, 52, 54, 55, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 57, 58,
+ 59, 60, 61, 62, 57, 63, 56, 64,
+ 52, 52, 52, 52, 65, 66, 67, 52,
+ 70, 71, 69, 69, 69, 69, 69, 69,
+ 69, 72, 69, 70, 71, 69, 7, 73,
+ 73, 3, 9, 73, 73, 73, 73, 73,
+ 73, 73, 73, 74, 12, 13, 14, 15,
+ 16, 17, 18, 12, 19, 21, 21, 22,
+ 23, 24, 73, 25, 26, 27, 73, 7,
+ 73, 73, 3, 9, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 12, 13, 14,
+ 15, 16, 17, 18, 12, 19, 21, 21,
+ 22, 23, 24, 73, 25, 26, 27, 73,
+ 7, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 12, 13,
+ 14, 15, 16, 73, 73, 73, 73, 73,
+ 73, 22, 23, 24, 73, 25, 26, 27,
+ 73, 7, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 13, 14, 15, 16, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 25, 26,
+ 27, 73, 7, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 14, 15, 16, 73, 7, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 15,
+ 16, 73, 7, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 16, 73, 7, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 14, 15,
+ 16, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 25, 26, 27, 73, 7,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 14,
+ 15, 16, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 26, 27, 73,
+ 7, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 14, 15, 16, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 27,
+ 73, 7, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 13, 14, 15, 16, 73, 73, 73, 73,
+ 73, 73, 22, 23, 24, 73, 25, 26,
+ 27, 73, 7, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 13, 14, 15, 16, 73, 73, 73,
+ 73, 73, 73, 73, 23, 24, 73, 25,
+ 26, 27, 73, 7, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 13, 14, 15, 16, 73, 73,
+ 73, 73, 73, 73, 73, 73, 24, 73,
+ 25, 26, 27, 73, 7, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 12, 13, 14, 15, 16, 73,
+ 18, 12, 73, 73, 73, 22, 23, 24,
+ 73, 25, 26, 27, 73, 7, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 12, 13, 14, 15, 16,
+ 73, 73, 12, 73, 73, 73, 22, 23,
+ 24, 73, 25, 26, 27, 73, 7, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 12, 13, 14, 15,
+ 16, 17, 18, 12, 73, 73, 73, 22,
+ 23, 24, 73, 25, 26, 27, 73, 7,
+ 73, 73, 3, 9, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 12, 13, 14,
+ 15, 16, 17, 18, 12, 19, 73, 21,
+ 22, 23, 24, 73, 25, 26, 27, 73,
+ 5, 6, 73, 73, 5, 73, 73, 7,
+ 73, 73, 3, 9, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 12, 13, 14,
+ 15, 16, 17, 18, 12, 19, 20, 21,
+ 22, 23, 24, 73, 25, 26, 27, 73,
+ 7, 73, 73, 3, 9, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 12, 13,
+ 14, 15, 16, 17, 18, 12, 19, 20,
+ 21, 22, 23, 24, 73, 25, 26, 27,
+ 73, 76, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 76, 77, 75,
+ 76, 77, 75, 77, 75, 0
+};
+
+static const char _use_syllable_machine_trans_targs[] = {
+ 3, 41, 3, 43, 4, 5, 25, 3,
+ 0, 2, 60, 62, 45, 46, 47, 48,
+ 49, 56, 57, 58, 61, 59, 53, 54,
+ 55, 50, 51, 52, 3, 3, 3, 3,
+ 6, 7, 24, 9, 10, 11, 12, 13,
+ 20, 21, 22, 23, 17, 18, 19, 14,
+ 15, 16, 8, 3, 3, 3, 26, 27,
+ 40, 29, 30, 31, 32, 36, 37, 38,
+ 39, 33, 34, 35, 28, 3, 3, 1,
+ 42, 3, 44, 3, 63, 64
+};
+
+static const char _use_syllable_machine_trans_actions[] = {
+ 1, 2, 3, 4, 0, 0, 0, 7,
+ 0, 0, 4, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4, 4, 0, 0,
+ 0, 0, 0, 0, 8, 9, 10, 11,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 12, 13, 14, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 15, 16, 0,
+ 2, 17, 4, 18, 0, 0
+};
+
+static const char _use_syllable_machine_to_state_actions[] = {
+ 0, 0, 0, 5, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0
+};
+
+static const char _use_syllable_machine_from_state_actions[] = {
+ 0, 0, 0, 6, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0
+};
+
+static const short _use_syllable_machine_eof_trans[] = {
+ 0, 1, 3, 0, 29, 31, 31, 52,
+ 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 53, 53, 52, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53,
+ 53, 70, 70, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 76, 76,
+ 76
+};
+
+static const int use_syllable_machine_start = 3;
+static const int use_syllable_machine_first_final = 3;
+static const int use_syllable_machine_error = 0;
+
+static const int use_syllable_machine_en_main = 3;
+
+
+#line 38 "hb-ot-shape-complex-use-machine.rl"
+
+
+
+#line 145 "hb-ot-shape-complex-use-machine.rl"
+
+
+#define found_syllable(syllable_type) \
+ HB_STMT_START { \
+ if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type); \
+ for (unsigned int i = last; i < p+1; i++) \
+ info[i].syllable() = (syllable_serial << 4) | syllable_type; \
+ last = p+1; \
+ syllable_serial++; \
+ if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
+ } HB_STMT_END
+
+static void
+find_syllables (hb_buffer_t *buffer)
+{
+ unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED;
+ int cs;
+ hb_glyph_info_t *info = buffer->info;
+
+#line 388 "hb-ot-shape-complex-use-machine.hh"
+ {
+ cs = use_syllable_machine_start;
+ ts = 0;
+ te = 0;
+ act = 0;
+ }
+
+#line 166 "hb-ot-shape-complex-use-machine.rl"
+
+
+ p = 0;
+ pe = eof = buffer->len;
+
+ unsigned int last = 0;
+ unsigned int syllable_serial = 1;
+
+#line 405 "hb-ot-shape-complex-use-machine.hh"
+ {
+ int _slen;
+ int _trans;
+ const unsigned char *_keys;
+ const char *_inds;
+ if ( p == pe )
+ goto _test_eof;
+ if ( cs == 0 )
+ goto _out;
+_resume:
+ switch ( _use_syllable_machine_from_state_actions[cs] ) {
+ case 6:
+#line 1 "NONE"
+ {ts = p;}
+ break;
+#line 421 "hb-ot-shape-complex-use-machine.hh"
+ }
+
+ _keys = _use_syllable_machine_trans_keys + (cs<<1);
+ _inds = _use_syllable_machine_indicies + _use_syllable_machine_index_offsets[cs];
+
+ _slen = _use_syllable_machine_key_spans[cs];
+ _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].use_category()) &&
+ ( info[p].use_category()) <= _keys[1] ?
+ ( info[p].use_category()) - _keys[0] : _slen ];
+
+_eof_trans:
+ cs = _use_syllable_machine_trans_targs[_trans];
+
+ if ( _use_syllable_machine_trans_actions[_trans] == 0 )
+ goto _again;
+
+ switch ( _use_syllable_machine_trans_actions[_trans] ) {
+ case 2:
+#line 1 "NONE"
+ {te = p+1;}
+ break;
+ case 9:
+#line 134 "hb-ot-shape-complex-use-machine.rl"
+ {te = p+1;{ found_syllable (independent_cluster); }}
+ break;
+ case 11:
+#line 136 "hb-ot-shape-complex-use-machine.rl"
+ {te = p+1;{ found_syllable (consonant_cluster); }}
+ break;
+ case 14:
+#line 137 "hb-ot-shape-complex-use-machine.rl"
+ {te = p+1;{ found_syllable (vowel_cluster); }}
+ break;
+ case 16:
+#line 138 "hb-ot-shape-complex-use-machine.rl"
+ {te = p+1;{ found_syllable (number_joiner_terminated_cluster); }}
+ break;
+ case 7:
+#line 141 "hb-ot-shape-complex-use-machine.rl"
+ {te = p+1;{ found_syllable (broken_cluster); }}
+ break;
+ case 8:
+#line 134 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (independent_cluster); }}
+ break;
+ case 12:
+#line 135 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (virama_terminated_cluster); }}
+ break;
+ case 10:
+#line 136 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (consonant_cluster); }}
+ break;
+ case 13:
+#line 137 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (vowel_cluster); }}
+ break;
+ case 15:
+#line 139 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (numeral_cluster); }}
+ break;
+ case 18:
+#line 140 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (symbol_cluster); }}
+ break;
+ case 17:
+#line 141 "hb-ot-shape-complex-use-machine.rl"
+ {te = p;p--;{ found_syllable (broken_cluster); }}
+ break;
+ case 1:
+#line 139 "hb-ot-shape-complex-use-machine.rl"
+ {{p = ((te))-1;}{ found_syllable (numeral_cluster); }}
+ break;
+ case 3:
+#line 1 "NONE"
+ { switch( act ) {
+ case 0:
+ {{cs = 0; goto _again;}}
+ break;
+ case 8:
+ {{p = ((te))-1;} found_syllable (broken_cluster); }
+ break;
+ }
+ }
+ break;
+ case 4:
+#line 1 "NONE"
+ {te = p+1;}
+#line 141 "hb-ot-shape-complex-use-machine.rl"
+ {act = 8;}
+ break;
+#line 513 "hb-ot-shape-complex-use-machine.hh"
+ }
+
+_again:
+ switch ( _use_syllable_machine_to_state_actions[cs] ) {
+ case 5:
+#line 1 "NONE"
+ {ts = 0;}
+#line 1 "NONE"
+ {act = 0;}
+ break;
+#line 524 "hb-ot-shape-complex-use-machine.hh"
+ }
+
+ if ( cs == 0 )
+ goto _out;
+ if ( ++p != pe )
+ goto _resume;
+ _test_eof: {}
+ if ( p == eof )
+ {
+ if ( _use_syllable_machine_eof_trans[cs] > 0 ) {
+ _trans = _use_syllable_machine_eof_trans[cs] - 1;
+ goto _eof_trans;
+ }
+ }
+
+ _out: {}
+ }
+
+#line 175 "hb-ot-shape-complex-use-machine.rl"
+
+}
+
+#undef found_syllable
+
+#endif /* HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-private.hh
new file mode 100644
index 0000000000..a143736211
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-private.hh
@@ -0,0 +1,97 @@
+/*
+ * Copyright © 2015 Mozilla Foundation.
+ * Copyright © 2015 Google, Inc.
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Mozilla Author(s): Jonathan Kew
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH
+#define HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH
+
+#include "hb-private.hh"
+
+
+#include "hb-ot-shape-complex-private.hh"
+
+
+#define USE_TABLE_ELEMENT_TYPE uint8_t
+
+/* Cateories used in the Universal Shaping Engine spec:
+ * https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm
+ */
+/* Note: This enum is duplicated in the -machine.rl source file.
+ * Not sure how to avoid duplication. */
+enum use_category_t {
+ USE_O = 0, /* OTHER */
+
+ USE_B = 1, /* BASE */
+ USE_IV = 2, /* BASE_VOWEL */
+ USE_IND = 3, /* BASE_IND */
+ USE_N = 4, /* BASE_NUM */
+ USE_GB = 5, /* BASE_OTHER */
+ USE_CGJ = 6, /* CGJ */
+// USE_F = 7, /* CONS_FINAL */
+ USE_FM = 8, /* CONS_FINAL_MOD */
+// USE_M = 9, /* CONS_MED */
+// USE_CM = 10, /* CONS_MOD */
+ USE_SUB = 11, /* CONS_SUB */
+ USE_H = 12, /* HALANT */
+
+ USE_HN = 13, /* HALANT_NUM */
+ USE_ZWNJ = 14, /* Zero width non-joiner */
+ USE_ZWJ = 15, /* Zero width joiner */
+ USE_WJ = 16, /* Word joiner */
+ USE_Rsv = 17, /* Reserved characters */
+ USE_R = 18, /* REPHA */
+ USE_S = 19, /* SYM */
+// USE_SM = 20, /* SYM_MOD */
+ USE_VS = 21, /* VARIATION_SELECTOR */
+// USE_V = 36, /* VOWEL */
+// USE_VM = 40, /* VOWEL_MOD */
+
+ USE_FAbv = 24, /* CONS_FINAL_ABOVE */
+ USE_FBlw = 25, /* CONS_FINAL_BELOW */
+ USE_FPst = 26, /* CONS_FINAL_POST */
+ USE_MAbv = 27, /* CONS_MED_ABOVE */
+ USE_MBlw = 28, /* CONS_MED_BELOW */
+ USE_MPst = 29, /* CONS_MED_POST */
+ USE_MPre = 30, /* CONS_MED_PRE */
+ USE_CMAbv = 31, /* CONS_MOD_ABOVE */
+ USE_CMBlw = 32, /* CONS_MOD_BELOW */
+ USE_VAbv = 33, /* VOWEL_ABOVE / VOWEL_ABOVE_BELOW / VOWEL_ABOVE_BELOW_POST / VOWEL_ABOVE_POST */
+ USE_VBlw = 34, /* VOWEL_BELOW / VOWEL_BELOW_POST */
+ USE_VPst = 35, /* VOWEL_POST UIPC = Right */
+ USE_VPre = 22, /* VOWEL_PRE / VOWEL_PRE_ABOVE / VOWEL_PRE_ABOVE_POST / VOWEL_PRE_POST */
+ USE_VMAbv = 37, /* VOWEL_MOD_ABOVE */
+ USE_VMBlw = 38, /* VOWEL_MOD_BELOW */
+ USE_VMPst = 39, /* VOWEL_MOD_POST */
+ USE_VMPre = 23, /* VOWEL_MOD_PRE */
+ USE_SMAbv = 41, /* SYM_MOD_ABOVE */
+ USE_SMBlw = 42 /* SYM_MOD_BELOW */
+};
+
+HB_INTERNAL USE_TABLE_ELEMENT_TYPE
+hb_use_get_categories (hb_codepoint_t u);
+
+#endif /* HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-table.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-table.cc
new file mode 100644
index 0000000000..6cd1c5db75
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use-table.cc
@@ -0,0 +1,696 @@
+/* == Start of generated table == */
+/*
+ * The following table is generated by running:
+ *
+ * ./gen-use-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt UnicodeData.txt Blocks.txt
+ *
+ * on files with these headers:
+ *
+ * # IndicSyllabicCategory-8.0.0.txt
+ * # Date: 2015-05-12, 10:00:00 GMT [RP, KW, LI]
+ * # IndicPositionalCategory-8.0.0.txt
+ * # Date: 2015-05-12, 10:00:00 GMT [RP, KW, LI]
+ * # Blocks-8.0.0.txt
+ * # Date: 2014-11-10, 23:04:00 GMT [KW]
+ * UnicodeData.txt does not have a header.
+ */
+
+#include "hb-ot-shape-complex-use-private.hh"
+
+#define B USE_B /* BASE */
+#define CGJ USE_CGJ /* CGJ */
+#define FM USE_FM /* CONS_FINAL_MOD */
+#define GB USE_GB /* BASE_OTHER */
+#define H USE_H /* HALANT */
+#define HN USE_HN /* HALANT_NUM */
+#define IND USE_IND /* BASE_IND */
+#define IV USE_IV /* BASE_VOWEL */
+#define N USE_N /* BASE_NUM */
+#define O USE_O /* OTHER */
+#define R USE_R /* REPHA */
+#define Rsv USE_Rsv /* Reserved */
+#define S USE_S /* SYM */
+#define SUB USE_SUB /* CONS_SUB */
+#define VS USE_VS /* VARIATION_SELECTOR */
+#define WJ USE_WJ /* Word_Joiner */
+#define ZWJ USE_ZWJ /* ZWJ */
+#define ZWNJ USE_ZWNJ /* ZWNJ */
+#define CMBlw USE_CMBlw
+#define CMAbv USE_CMAbv
+#define FBlw USE_FBlw
+#define FPst USE_FPst
+#define FAbv USE_FAbv
+#define MPre USE_MPre
+#define MBlw USE_MBlw
+#define MPst USE_MPst
+#define MAbv USE_MAbv
+#define SMBlw USE_SMBlw
+#define SMAbv USE_SMAbv
+#define VPre USE_VPre
+#define VBlw USE_VBlw
+#define VPst USE_VPst
+#define VAbv USE_VAbv
+#define VMPre USE_VMPre
+#define VMBlw USE_VMBlw
+#define VMPst USE_VMPst
+#define VMAbv USE_VMAbv
+
+static const USE_TABLE_ELEMENT_TYPE use_table[] = {
+
+
+#define use_offset_0x0028u 0
+
+
+ /* Basic Latin */
+ O, O, O, O, O, GB, O, O,
+ /* 0030 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+#define use_offset_0x00a0u 24
+
+
+ /* Latin-1 Supplement */
+
+ /* 00A0 */ GB, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 00B0 */ O, O, FM, FM, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 00C0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 00D0 */ O, O, O, O, O, O, O, GB,
+
+#define use_offset_0x0900u 80
+
+
+ /* Devanagari */
+
+ /* 0900 */ VMAbv, VMAbv, VMAbv, VMPst, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* 0910 */ IV, IV, IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0920 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0930 */ B, B, B, B, B, B, B, B, B, B, VAbv, VPst, CMBlw, B, VPst, VPre,
+ /* 0940 */ VPst, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VAbv, VAbv, VPst, VPst, VPst, VPst, H, VPre, VPst,
+ /* 0950 */ O, VMAbv, VMBlw, O, O, VAbv, VBlw, VBlw, B, B, B, B, B, B, B, B,
+ /* 0960 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0970 */ O, O, IV, IV, IV, IV, IV, IV, B, B, B, B, B, B, B, B,
+
+ /* Bengali */
+
+ /* 0980 */ O, VMAbv, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, O, O, IV,
+ /* 0990 */ IV, O, O, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 09A0 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 09B0 */ B, O, B, O, O, O, B, B, B, B, O, O, CMBlw, B, VPst, VPre,
+ /* 09C0 */ VPst, VBlw, VBlw, VBlw, VBlw, O, O, VPre, VPre, O, O, VPre, VPre, H, IND, O,
+ /* 09D0 */ O, O, O, O, O, O, O, VPst, O, O, O, O, B, B, O, B,
+ /* 09E0 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 09F0 */ B, B, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Gurmukhi */
+
+ /* 0A00 */ O, VMAbv, VMAbv, VMPst, O, IV, IV, IV, IV, IV, IV, O, O, O, O, IV,
+ /* 0A10 */ IV, O, O, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0A20 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 0A30 */ B, O, B, B, O, B, B, O, B, B, O, O, CMBlw, O, VPst, VPre,
+ /* 0A40 */ VPst, VBlw, VBlw, O, O, O, O, VAbv, VAbv, O, O, VAbv, VAbv, H, O, O,
+ /* 0A50 */ O, O, O, O, O, O, O, O, O, B, B, B, B, O, B, O,
+ /* 0A60 */ O, O, O, O, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0A70 */ VMAbv, CMAbv, GB, GB, O, MBlw, O, O, O, O, O, O, O, O, O, O,
+
+ /* Gujarati */
+
+ /* 0A80 */ O, VMAbv, VMAbv, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, IV, O, IV,
+ /* 0A90 */ IV, IV, O, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0AA0 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 0AB0 */ B, O, B, B, O, B, B, B, B, B, O, O, CMBlw, B, VPst, VPre,
+ /* 0AC0 */ VPst, VBlw, VBlw, VBlw, VBlw, VAbv, O, VAbv, VAbv, VAbv, O, VPst, VPst, H, O, O,
+ /* 0AD0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 0AE0 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0AF0 */ O, O, O, O, O, O, O, O, O, B, O, O, O, O, O, O,
+
+ /* Oriya */
+
+ /* 0B00 */ O, VMAbv, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, O, O, IV,
+ /* 0B10 */ IV, O, O, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0B20 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 0B30 */ B, O, B, B, O, B, B, B, B, B, O, O, CMBlw, B, VPst, VAbv,
+ /* 0B40 */ VPst, VBlw, VBlw, VBlw, VBlw, O, O, VPre, VPre, O, O, VPre, VPre, H, O, O,
+ /* 0B50 */ O, O, O, O, O, O, VAbv, VAbv, O, O, O, O, B, B, O, B,
+ /* 0B60 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0B70 */ O, B, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Tamil */
+
+ /* 0B80 */ O, O, VMAbv, IND, O, IV, IV, IV, IV, IV, IV, O, O, O, IV, IV,
+ /* 0B90 */ IV, O, IV, IV, IV, B, O, O, O, B, B, O, B, O, B, B,
+ /* 0BA0 */ O, O, O, B, B, O, O, O, B, B, B, O, O, O, B, B,
+ /* 0BB0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, VPst, VPst,
+ /* 0BC0 */ VAbv, VPst, VPst, O, O, O, VPre, VPre, VPre, O, VPre, VPre, VPre, H, O, O,
+ /* 0BD0 */ O, O, O, O, O, O, O, VPst, O, O, O, O, O, O, O, O,
+ /* 0BE0 */ O, O, O, O, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0BF0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Telugu */
+
+ /* 0C00 */ VMAbv, VMPst, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, O, IV, IV,
+ /* 0C10 */ IV, O, IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0C20 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 0C30 */ B, B, B, B, B, B, B, B, B, B, O, O, O, B, VAbv, VAbv,
+ /* 0C40 */ VAbv, VPst, VPst, VPst, VPst, O, VAbv, VAbv, VAbv, O, VAbv, VAbv, VAbv, H, O, O,
+ /* 0C50 */ O, O, O, O, O, VAbv, VBlw, O, B, B, B, O, O, O, O, O,
+ /* 0C60 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0C70 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Kannada */
+
+ /* 0C80 */ O, VMAbv, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, O, IV, IV,
+ /* 0C90 */ IV, O, IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0CA0 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 0CB0 */ B, B, B, B, O, B, B, B, B, B, O, O, CMBlw, B, VPst, VAbv,
+ /* 0CC0 */ VAbv, VPst, VPst, VPst, VPst, O, VAbv, VAbv, VAbv, O, VAbv, VAbv, VAbv, H, O, O,
+ /* 0CD0 */ O, O, O, O, O, VPst, VPst, O, O, O, O, O, O, O, B, O,
+ /* 0CE0 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0CF0 */ O, R, R, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Malayalam */
+
+ /* 0D00 */ O, VMAbv, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, O, IV, IV,
+ /* 0D10 */ IV, O, IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0D20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0D30 */ B, B, B, B, B, B, B, B, B, B, B, O, O, B, VPst, VPst,
+ /* 0D40 */ VPst, VPst, VPst, VBlw, VBlw, O, VPre, VPre, VPre, O, VPre, VPre, VPre, H, R, O,
+ /* 0D50 */ O, O, O, O, O, O, O, VPst, O, O, O, O, O, O, O, IV,
+ /* 0D60 */ IV, IV, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0D70 */ O, O, O, O, O, O, O, O, O, O, IND, IND, IND, IND, IND, IND,
+
+ /* Sinhala */
+
+ /* 0D80 */ O, O, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* 0D90 */ IV, IV, IV, IV, IV, IV, IV, O, O, O, B, B, B, B, B, B,
+ /* 0DA0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 0DB0 */ B, B, O, B, B, B, B, B, B, B, B, B, O, B, O, O,
+ /* 0DC0 */ B, B, B, B, B, B, B, O, O, O, H, O, O, O, O, VPst,
+ /* 0DD0 */ VPst, VPst, VAbv, VAbv, VBlw, O, VBlw, O, VPst, VPre, VPre, VPre, VPre, VPre, VPre, VPst,
+ /* 0DE0 */ O, O, O, O, O, O, B, B, B, B, B, B, B, B, B, B,
+ /* 0DF0 */ O, O, VPst, VPst, O, O, O, O,
+
+#define use_offset_0x1000u 1352
+
+
+ /* Myanmar */
+
+ /* 1000 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1010 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1020 */ B, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, VPst, VPst, VAbv, VAbv, VBlw,
+ /* 1030 */ VBlw, VPre, VAbv, VAbv, VAbv, VAbv, VMAbv, VMBlw, VMPst, H, VAbv, MPst, MPre, MBlw, MBlw, B,
+ /* 1040 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, GB, O,
+ /* 1050 */ B, B, IV, IV, IV, IV, VPst, VPst, VBlw, VBlw, B, B, B, B, MBlw, MBlw,
+ /* 1060 */ MBlw, B, VPst, VMPst, VMPst, B, B, VPst, VPst, VMPst, VMPst, VMPst, VMPst, VMPst, B, B,
+ /* 1070 */ B, VAbv, VAbv, VAbv, VAbv, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1080 */ B, B, MBlw, VPst, VPre, VAbv, VAbv, VMPst, VMPst, VMPst, VMPst, VMPst, VMPst, VMBlw, B, VMPst,
+ /* 1090 */ B, B, B, B, B, B, B, B, B, B, VMPst, VMPst, VPst, VAbv, O, O,
+
+#define use_offset_0x1700u 1512
+
+
+ /* Tagalog */
+
+ /* 1700 */ IV, IV, IV, B, B, B, B, B, B, B, B, B, B, O, B, B,
+ /* 1710 */ B, B, VAbv, VBlw, VBlw, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Hanunoo */
+
+ /* 1720 */ IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1730 */ B, B, VAbv, VBlw, VBlw, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Buhid */
+
+ /* 1740 */ IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1750 */ B, B, VAbv, VBlw, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Tagbanwa */
+
+ /* 1760 */ IV, IV, IV, B, B, B, B, B, B, B, B, B, B, O, B, B,
+ /* 1770 */ B, O, VAbv, VBlw, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Khmer */
+
+ /* 1780 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1790 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 17A0 */ B, B, B, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* 17B0 */ IV, IV, IV, IV, O, O, VPst, VAbv, VAbv, VAbv, VAbv, VBlw, VBlw, VBlw, VPre, VPre,
+ /* 17C0 */ VPre, VPre, VPre, VPre, VPre, VPre, VMAbv, VMPst, VPst, VMAbv, VMAbv, FM, FAbv, CMAbv, FM, FM,
+ /* 17D0 */ FM, VAbv, H, FM, O, O, O, O, O, O, O, O, B, VAbv, O, O,
+ /* 17E0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+#define use_offset_0x1900u 1752
+
+
+ /* Limbu */
+
+ /* 1900 */ GB, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1910 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, O,
+ /* 1920 */ VAbv, VAbv, VBlw, VPst, VPst, VAbv, VAbv, VAbv, VAbv, SUB, SUB, SUB, O, O, O, O,
+ /* 1930 */ FPst, FPst, VMBlw, FPst, FPst, FPst, FPst, FPst, FPst, FBlw, VAbv, FM, O, O, O, O,
+ /* 1940 */ O, O, O, O, O, O, B, B, B, B, B, B, B, B, B, B,
+
+ /* Tai Le */
+
+ /* 1950 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1960 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, O, O,
+ /* 1970 */ B, B, B, B, B, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* New Tai Lue */
+
+ /* 1980 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1990 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 19A0 */ B, B, B, B, B, B, B, B, B, B, B, B, O, O, O, O,
+ /* 19B0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 19C0 */ B, B, B, B, B, B, B, B, VMPst, VMPst, O, O, O, O, O, O,
+ /* 19D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+ /* 19E0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 19F0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Buginese */
+
+ /* 1A00 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1A10 */ B, B, B, B, B, B, B, VAbv, VBlw, VPre, VPst, VAbv, O, O, O, O,
+
+ /* Tai Tham */
+
+ /* 1A20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1A30 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1A40 */ B, B, B, B, B, B, B, B, B, B, B, B, B, IV, IV, IV,
+ /* 1A50 */ IV, IV, IV, B, B, MPre, MBlw, FPst, FAbv, FAbv, FAbv, FBlw, FBlw, FBlw, FBlw, O,
+ /* 1A60 */ H, VPst, VAbv, VPst, VPst, VAbv, VAbv, VAbv, VAbv, VBlw, VBlw, VAbv, VBlw, VPst, VPre, VPre,
+ /* 1A70 */ VPre, VPre, VPre, VAbv, VAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, FM, FM, FM, O, O, FM,
+ /* 1A80 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+ /* 1A90 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+#define use_offset_0x1b00u 2168
+
+
+ /* Balinese */
+
+ /* 1B00 */ VMAbv, VMAbv, VMAbv, FAbv, VMPst, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* 1B10 */ IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1B20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1B30 */ B, B, B, B, CMAbv, VPst, VAbv, VAbv, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VPre, VPre,
+ /* 1B40 */ VPre, VPre, VAbv, VAbv, H, B, B, B, B, B, B, B, O, O, O, O,
+ /* 1B50 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+ /* 1B60 */ O, O, O, O, O, O, O, O, O, O, O, SMAbv, SMBlw, SMAbv, SMAbv, SMAbv,
+ /* 1B70 */ SMAbv, SMAbv, SMAbv, SMAbv, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Sundanese */
+
+ /* 1B80 */ VMAbv, FAbv, VMPst, IV, IV, IV, IV, IV, IV, IV, B, B, B, B, B, B,
+ /* 1B90 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1BA0 */ B, SUB, SUB, SUB, VAbv, VBlw, VPre, VPst, VAbv, VAbv, VPst, H, SUB, SUB, B, B,
+ /* 1BB0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+
+ /* Batak */
+
+ /* 1BC0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1BD0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1BE0 */ B, B, B, B, IV, IV, CMAbv, VPst, VAbv, VAbv, VPst, VPst, VPst, VAbv, VPst, VAbv,
+ /* 1BF0 */ FAbv, FAbv, VPst, VPst, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Lepcha */
+
+ /* 1C00 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1C10 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 1C20 */ B, B, B, B, SUB, SUB, VPst, VPre, VPre, VPre, VPst, VPst, VBlw, FAbv, FAbv, FAbv,
+ /* 1C30 */ FAbv, FAbv, FAbv, FAbv, VMPre, VMPre, FM, CMBlw, O, O, O, O, O, O, O, O,
+ /* 1C40 */ B, B, B, B, B, B, B, B, B, B, O, O, O, B, B, B,
+
+#define use_offset_0x1cd0u 2504
+
+
+ /* Vedic Extensions */
+
+ /* 1CD0 */ VMAbv, VMAbv, VMAbv, O, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMAbv, VMAbv, VMBlw, VMBlw, VMBlw, VMBlw,
+ /* 1CE0 */ VMAbv, VMPst, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, O, O, O, O, VMBlw, O, O,
+ /* 1CF0 */ O, O, VMPst, VMPst, VMAbv, O, O, O, VMAbv, VMAbv, O, O, O, O, O, O,
+
+#define use_offset_0x2008u 2552
+
+
+ /* General Punctuation */
+ O, O, O, O, ZWNJ, ZWJ, O, O,
+ /* 2010 */ GB, GB, GB, GB, GB, O, O, O,
+
+#define use_offset_0x2060u 2568
+
+ /* 2060 */ WJ, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Superscripts and Subscripts */
+
+ /* 2070 */ O, O, O, O, FM, O, O, O, O, O, O, O, O, O, O, O,
+ /* 2080 */ O, O, FM, FM, FM, O, O, O,
+
+#define use_offset_0xa800u 2608
+
+
+ /* Syloti Nagri */
+
+ /* A800 */ IV, IV, O, IV, IV, IV, VAbv, B, B, B, B, VMAbv, B, B, B, B,
+ /* A810 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A820 */ B, B, B, VPst, VPst, VBlw, VAbv, VPst, O, O, O, O, O, O, O, O,
+ /* A830 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Phags-pa */
+
+ /* A840 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A850 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A860 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A870 */ B, B, B, B, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Saurashtra */
+
+ /* A880 */ VMPst, VMPst, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* A890 */ IV, IV, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A8A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A8B0 */ B, B, B, B, FPst, VPst, VPst, VPst, VPst, VPst, VPst, VPst, VPst, VPst, VPst, VPst,
+ /* A8C0 */ VPst, VPst, VPst, VPst, H, O, O, O, O, O, O, O, O, O, O, O,
+ /* A8D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+ /* Devanagari Extended */
+
+ /* A8E0 */ VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv,
+ /* A8F0 */ VMAbv, VMAbv, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Kayah Li */
+
+ /* A900 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A910 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A920 */ B, B, B, B, B, B, VAbv, VAbv, VAbv, VAbv, VAbv, VMBlw, VMBlw, VMBlw, O, O,
+
+ /* Rejang */
+
+ /* A930 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A940 */ B, B, B, B, B, B, B, VBlw, VBlw, VBlw, VAbv, VBlw, VBlw, VBlw, VBlw, FAbv,
+ /* A950 */ FAbv, FAbv, FPst, VPst, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* A960 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* A970 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Javanese */
+
+ /* A980 */ VMAbv, VMAbv, FAbv, VMPst, IV, IV, IV, IV, IV, B, B, B, IV, IV, IV, B,
+ /* A990 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A9A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* A9B0 */ B, B, B, CMAbv, VPst, VPst, VAbv, VAbv, VBlw, VBlw, VPre, VPre, VAbv, SUB, MPst, MPst,
+ /* A9C0 */ H, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* A9D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+ /* Myanmar Extended-B */
+
+ /* A9E0 */ B, B, B, B, B, VAbv, O, B, B, B, B, B, B, B, B, B,
+ /* A9F0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, O,
+
+ /* Cham */
+
+ /* AA00 */ IV, IV, IV, IV, IV, IV, B, B, B, B, B, B, B, B, B, B,
+ /* AA10 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* AA20 */ B, B, B, B, B, B, B, B, B, VAbv, VAbv, VAbv, VAbv, VBlw, VAbv, VPre,
+ /* AA30 */ VPre, VAbv, VBlw, MPst, MPre, MBlw, MBlw, O, O, O, O, O, O, O, O, O,
+ /* AA40 */ B, B, B, FAbv, B, B, B, B, B, B, B, B, FAbv, FPst, O, O,
+ /* AA50 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+ /* Myanmar Extended-A */
+
+ /* AA60 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* AA70 */ O, B, B, B, O, O, O, O, O, O, B, VMPst, VMAbv, VMPst, B, B,
+
+ /* Tai Viet */
+
+ /* AA80 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* AA90 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* AAA0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* AAB0 */ VAbv, B, VAbv, VAbv, VBlw, B, B, VAbv, VAbv, B, B, B, B, B, VAbv, VMAbv,
+ /* AAC0 */ B, VMAbv, B, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* AAD0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Meetei Mayek Extensions */
+
+ /* AAE0 */ IV, IV, B, B, B, B, B, B, B, B, B, VPre, VBlw, VAbv, VPre, VPst,
+ /* AAF0 */ O, O, O, O, O, VMPst, H, O,
+
+#define use_offset_0xabc0u 3368
+
+
+ /* Meetei Mayek */
+
+ /* ABC0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, IV, IV,
+ /* ABD0 */ B, IV, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* ABE0 */ B, B, B, VPst, VPst, VAbv, VPst, VPst, VBlw, VPst, VPst, O, VMPst, VBlw, O, O,
+ /* ABF0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+#define use_offset_0xfe00u 3432
+
+
+ /* Variation Selectors */
+
+ /* FE00 */ VS, VS, VS, VS, VS, VS, VS, VS, VS, VS, VS, VS, VS, VS, VS, VS,
+
+#define use_offset_0x10a00u 3448
+
+
+ /* Kharoshthi */
+
+ /* 10A00 */ B, VBlw, VBlw, VBlw, O, VAbv, VBlw, O, O, O, O, O, VBlw, VBlw, VMBlw, VMAbv,
+ /* 10A10 */ B, B, B, B, O, B, B, B, O, B, B, B, B, B, B, B,
+ /* 10A20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 10A30 */ B, B, B, B, O, O, O, O, CMAbv, CMBlw, CMBlw, O, O, O, O, H,
+ /* 10A40 */ B, B, B, B, B, B, B, B,
+
+#define use_offset_0x11000u 3520
+
+
+ /* Brahmi */
+
+ /* 11000 */ VMPst, VMAbv, VMPst, R, R, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* 11010 */ IV, IV, IV, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11020 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11030 */ B, B, B, B, B, B, B, B, VAbv, VAbv, VAbv, VAbv, VBlw, VBlw, VBlw, VBlw,
+ /* 11040 */ VBlw, VBlw, VAbv, VAbv, VAbv, VAbv, H, O, O, O, O, O, O, O, O, O,
+ /* 11050 */ O, O, N, N, N, N, N, N, N, N, N, N, N, N, N, N,
+ /* 11060 */ N, N, N, N, N, N, B, B, B, B, B, B, B, B, B, B,
+ /* 11070 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Kaithi */
+
+ /* 11080 */ VMAbv, VMAbv, VMPst, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, B, B, B,
+ /* 11090 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 110A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 110B0 */ VPst, VPre, VPst, VBlw, VBlw, VAbv, VAbv, VPst, VPst, H, CMBlw, O, O, O, O, O,
+
+#define use_offset_0x11100u 3712
+
+
+ /* Chakma */
+
+ /* 11100 */ VMAbv, VMAbv, VMAbv, IV, IV, IV, IV, B, B, B, B, B, B, B, B, B,
+ /* 11110 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11120 */ B, B, B, B, B, B, B, VAbv, VAbv, VAbv, VBlw, VBlw, VPre, VAbv, VAbv, VAbv,
+ /* 11130 */ VAbv, VBlw, VBlw, H, VAbv, O, B, B, B, B, B, B, B, B, B, B,
+ /* 11140 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Mahajani */
+
+ /* 11150 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11160 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11170 */ B, B, B, CMBlw, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Sharada */
+
+ /* 11180 */ VMAbv, VMAbv, VMPst, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV,
+ /* 11190 */ IV, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 111A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 111B0 */ B, B, B, VPst, VPre, VPst, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VAbv, VAbv,
+ /* 111C0 */ H, B, R, R, O, O, O, O, O, O, CMBlw, VAbv, VBlw, O, O, O,
+ /* 111D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+ /* Sinhala Archaic Numbers */
+
+ /* 111E0 */ O, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 111F0 */ B, B, B, B, B, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Khojki */
+
+ /* 11200 */ IV, IV, IV, IV, IV, IV, IV, IV, B, B, B, B, B, B, B, B,
+ /* 11210 */ B, B, O, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11220 */ B, B, B, B, B, B, B, B, B, B, B, B, VPst, VPst, VPst, VBlw,
+ /* 11230 */ VAbv, VAbv, VAbv, VAbv, VMAbv, H, CMAbv, CMAbv,
+
+#define use_offset_0x11280u 4024
+
+
+ /* Multani */
+
+ /* 11280 */ IV, IV, IV, IV, B, B, B, O, B, O, B, B, B, B, O, B,
+ /* 11290 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, O, B,
+ /* 112A0 */ B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, O,
+
+ /* Khudawadi */
+
+ /* 112B0 */ IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, B, B, B, B, B, B,
+ /* 112C0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 112D0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, VMAbv,
+ /* 112E0 */ VPst, VPre, VPst, VBlw, VBlw, VAbv, VAbv, VAbv, VAbv, CMBlw, VBlw, O, O, O, O, O,
+ /* 112F0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+ /* Grantha */
+
+ /* 11300 */ VMAbv, VMAbv, VMPst, VMPst, O, IV, IV, IV, IV, IV, IV, IV, IV, O, O, IV,
+ /* 11310 */ IV, O, O, IV, IV, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11320 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
+ /* 11330 */ B, O, B, B, O, B, B, B, B, B, O, O, CMBlw, B, VPst, VPst,
+ /* 11340 */ VAbv, VPst, VPst, VPst, VPst, O, O, VPre, VPre, O, O, VPre, VPre, H, O, O,
+ /* 11350 */ O, O, O, O, O, O, O, VPst, O, O, O, O, O, O, O, O,
+ /* 11360 */ IV, IV, VPst, VPst, O, O, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, O, O, O,
+ /* 11370 */ VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, O, O, O,
+
+#define use_offset_0x11480u 4272
+
+
+ /* Tirhuta */
+
+ /* 11480 */ O, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, B,
+ /* 11490 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 114A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 114B0 */ VPst, VPre, VPst, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VPre, VAbv, VPre, VPre, VPst, VPre, VMAbv,
+ /* 114C0 */ VMAbv, VMPst, H, CMBlw, B, O, O, O, O, O, O, O, O, O, O, O,
+ /* 114D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+
+#define use_offset_0x11580u 4368
+
+
+ /* Siddham */
+
+ /* 11580 */ IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, B, B,
+ /* 11590 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 115A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, VPst,
+ /* 115B0 */ VPre, VPst, VBlw, VBlw, VBlw, VBlw, O, O, VPre, VPre, VPre, VPre, VMAbv, VMAbv, VMPst, H,
+ /* 115C0 */ CMBlw, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 115D0 */ O, O, O, O, O, O, O, O, IV, IV, IV, IV, VBlw, VBlw, O, O,
+ /* 115E0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 115F0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Modi */
+
+ /* 11600 */ IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, B, B,
+ /* 11610 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11620 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11630 */ VPst, VPst, VPst, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VPst, VPst, VMAbv, VMPst, H,
+ /* 11640 */ VAbv, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 11650 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+ /* 11660 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 11670 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Takri */
+
+ /* 11680 */ IV, IV, IV, IV, IV, IV, IV, IV, IV, IV, B, B, B, B, B, B,
+ /* 11690 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 116A0 */ B, B, B, B, B, B, B, B, B, B, B, VMAbv, VMPst, VAbv, VPre, VPst,
+ /* 116B0 */ VBlw, VBlw, VAbv, VAbv, VAbv, VAbv, H, CMBlw, O, O, O, O, O, O, O, O,
+ /* 116C0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O,
+ /* 116D0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 116E0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+ /* 116F0 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
+
+ /* Ahom */
+
+ /* 11700 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
+ /* 11710 */ B, B, B, B, B, B, B, B, B, B, O, O, O, MBlw, MPre, MAbv,
+ /* 11720 */ VPst, VPst, VAbv, VAbv, VBlw, VBlw, VPre, VAbv, VBlw, VAbv, VAbv, VAbv, O, O, O, O,
+ /* 11730 */ B, B, B, B, B, B, B, B, B, B, B, B, O, O, O, O,
+
+}; /* Table items: 4816; occupancy: 72% */
+
+USE_TABLE_ELEMENT_TYPE
+hb_use_get_categories (hb_codepoint_t u)
+{
+ switch (u >> 12)
+ {
+ case 0x0u:
+ if (hb_in_range (u, 0x0028u, 0x003Fu)) return use_table[u - 0x0028u + use_offset_0x0028u];
+ if (hb_in_range (u, 0x00A0u, 0x00D7u)) return use_table[u - 0x00A0u + use_offset_0x00a0u];
+ if (hb_in_range (u, 0x0900u, 0x0DF7u)) return use_table[u - 0x0900u + use_offset_0x0900u];
+ if (unlikely (u == 0x034Fu)) return CGJ;
+ break;
+
+ case 0x1u:
+ if (hb_in_range (u, 0x1000u, 0x109Fu)) return use_table[u - 0x1000u + use_offset_0x1000u];
+ if (hb_in_range (u, 0x1700u, 0x17EFu)) return use_table[u - 0x1700u + use_offset_0x1700u];
+ if (hb_in_range (u, 0x1900u, 0x1A9Fu)) return use_table[u - 0x1900u + use_offset_0x1900u];
+ if (hb_in_range (u, 0x1B00u, 0x1C4Fu)) return use_table[u - 0x1B00u + use_offset_0x1b00u];
+ if (hb_in_range (u, 0x1CD0u, 0x1CFFu)) return use_table[u - 0x1CD0u + use_offset_0x1cd0u];
+ break;
+
+ case 0x2u:
+ if (hb_in_range (u, 0x2008u, 0x2017u)) return use_table[u - 0x2008u + use_offset_0x2008u];
+ if (hb_in_range (u, 0x2060u, 0x2087u)) return use_table[u - 0x2060u + use_offset_0x2060u];
+ if (unlikely (u == 0x25CCu)) return GB;
+ break;
+
+ case 0xAu:
+ if (hb_in_range (u, 0xA800u, 0xAAF7u)) return use_table[u - 0xA800u + use_offset_0xa800u];
+ if (hb_in_range (u, 0xABC0u, 0xABFFu)) return use_table[u - 0xABC0u + use_offset_0xabc0u];
+ break;
+
+ case 0xFu:
+ if (hb_in_range (u, 0xFE00u, 0xFE0Fu)) return use_table[u - 0xFE00u + use_offset_0xfe00u];
+ break;
+
+ case 0x10u:
+ if (hb_in_range (u, 0x10A00u, 0x10A47u)) return use_table[u - 0x10A00u + use_offset_0x10a00u];
+ break;
+
+ case 0x11u:
+ if (hb_in_range (u, 0x11000u, 0x110BFu)) return use_table[u - 0x11000u + use_offset_0x11000u];
+ if (hb_in_range (u, 0x11100u, 0x11237u)) return use_table[u - 0x11100u + use_offset_0x11100u];
+ if (hb_in_range (u, 0x11280u, 0x11377u)) return use_table[u - 0x11280u + use_offset_0x11280u];
+ if (hb_in_range (u, 0x11480u, 0x114DFu)) return use_table[u - 0x11480u + use_offset_0x11480u];
+ if (hb_in_range (u, 0x11580u, 0x1173Fu)) return use_table[u - 0x11580u + use_offset_0x11580u];
+ if (unlikely (u == 0x1107Fu)) return HN;
+ break;
+
+ default:
+ break;
+ }
+ return USE_O;
+}
+
+#undef B
+#undef CGJ
+#undef FM
+#undef GB
+#undef H
+#undef HN
+#undef IND
+#undef IV
+#undef N
+#undef O
+#undef R
+#undef Rsv
+#undef S
+#undef SUB
+#undef VS
+#undef WJ
+#undef ZWJ
+#undef ZWNJ
+#undef CMBlw
+#undef CMAbv
+#undef FBlw
+#undef FPst
+#undef FAbv
+#undef MPre
+#undef MBlw
+#undef MPst
+#undef MAbv
+#undef SMBlw
+#undef SMAbv
+#undef VPre
+#undef VBlw
+#undef VPst
+#undef VAbv
+#undef VMPre
+#undef VMBlw
+#undef VMPst
+#undef VMAbv
+
+/* == End of generated table == */
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use.cc
new file mode 100644
index 0000000000..779a9cb1d0
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-use.cc
@@ -0,0 +1,585 @@
+/*
+ * Copyright © 2015 Mozilla Foundation.
+ * Copyright © 2015 Google, Inc.
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Mozilla Author(s): Jonathan Kew
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#include "hb-ot-shape-complex-use-private.hh"
+#include "hb-ot-shape-complex-arabic-private.hh"
+
+/* buffer var allocations */
+#define use_category() complex_var_u8_0()
+
+
+/*
+ * Universal Shaping Engine.
+ * https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm
+ */
+
+static const hb_tag_t
+basic_features[] =
+{
+ /*
+ * Basic features.
+ * These features are applied all at once, before reordering.
+ */
+ HB_TAG('r','k','r','f'),
+ HB_TAG('a','b','v','f'),
+ HB_TAG('b','l','w','f'),
+ HB_TAG('h','a','l','f'),
+ HB_TAG('p','s','t','f'),
+ HB_TAG('v','a','t','u'),
+ HB_TAG('c','j','c','t'),
+};
+static const hb_tag_t
+arabic_features[] =
+{
+ HB_TAG('i','s','o','l'),
+ HB_TAG('i','n','i','t'),
+ HB_TAG('m','e','d','i'),
+ HB_TAG('f','i','n','a'),
+ /* The spec doesn't specify these but we apply anyway, since our Arabic shaper
+ * does. These are only used in Syriac spec. */
+ HB_TAG('m','e','d','2'),
+ HB_TAG('f','i','n','2'),
+ HB_TAG('f','i','n','3'),
+};
+/* Same order as arabic_features. Don't need Syriac stuff.*/
+enum joining_form_t {
+ ISOL,
+ INIT,
+ MEDI,
+ FINA,
+ _NONE
+};
+static const hb_tag_t
+other_features[] =
+{
+ /*
+ * Other features.
+ * These features are applied all at once, after reordering.
+ */
+ HB_TAG('a','b','v','s'),
+ HB_TAG('b','l','w','s'),
+ HB_TAG('h','a','l','n'),
+ HB_TAG('p','r','e','s'),
+ HB_TAG('p','s','t','s'),
+ /* Positioning features, though we don't care about the types. */
+ HB_TAG('d','i','s','t'),
+ HB_TAG('a','b','v','m'),
+ HB_TAG('b','l','w','m'),
+};
+
+static void
+setup_syllables (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer);
+static void
+clear_substitution_flags (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer);
+static void
+record_rphf (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer);
+static void
+record_pref (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer);
+static void
+reorder (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer);
+
+static void
+collect_features_use (hb_ot_shape_planner_t *plan)
+{
+ hb_ot_map_builder_t *map = &plan->map;
+
+ /* Do this before any lookups have been applied. */
+ map->add_gsub_pause (setup_syllables);
+
+ /* "Default glyph pre-processing group" */
+ map->add_global_bool_feature (HB_TAG('l','o','c','l'));
+ map->add_global_bool_feature (HB_TAG('c','c','m','p'));
+ map->add_global_bool_feature (HB_TAG('n','u','k','t'));
+ map->add_global_bool_feature (HB_TAG('a','k','h','n'));
+
+ /* "Reordering group" */
+ map->add_gsub_pause (clear_substitution_flags);
+ map->add_feature (HB_TAG('r','p','h','f'), 1, F_MANUAL_ZWJ);
+ map->add_gsub_pause (record_rphf);
+ map->add_gsub_pause (clear_substitution_flags);
+ map->add_feature (HB_TAG('p','r','e','f'), 1, F_GLOBAL | F_MANUAL_ZWJ);
+ map->add_gsub_pause (record_pref);
+
+ /* "Orthographic unit shaping group" */
+ for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
+ map->add_feature (basic_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
+
+ map->add_gsub_pause (reorder);
+
+ /* "Topographical features" */
+ for (unsigned int i = 0; i < ARRAY_LENGTH (arabic_features); i++)
+ map->add_feature (arabic_features[i], 1, F_NONE);
+ map->add_gsub_pause (NULL);
+
+ /* "Standard typographic presentation" and "Positional feature application" */
+ for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
+ map->add_feature (other_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
+}
+
+struct use_shape_plan_t
+{
+ ASSERT_POD ();
+
+ hb_mask_t rphf_mask;
+
+ arabic_shape_plan_t *arabic_plan;
+};
+
+static bool
+has_arabic_joining (hb_script_t script)
+{
+ /* List of scripts that have data in arabic-table. */
+ switch ((int) script)
+ {
+ /* Unicode-1.1 additions */
+ case HB_SCRIPT_ARABIC:
+
+ /* Unicode-3.0 additions */
+ case HB_SCRIPT_MONGOLIAN:
+ case HB_SCRIPT_SYRIAC:
+
+ /* Unicode-5.0 additions */
+ case HB_SCRIPT_NKO:
+ case HB_SCRIPT_PHAGS_PA:
+
+ /* Unicode-6.0 additions */
+ case HB_SCRIPT_MANDAIC:
+
+ /* Unicode-7.0 additions */
+ case HB_SCRIPT_MANICHAEAN:
+ case HB_SCRIPT_PSALTER_PAHLAVI:
+
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+static void *
+data_create_use (const hb_ot_shape_plan_t *plan)
+{
+ use_shape_plan_t *use_plan = (use_shape_plan_t *) calloc (1, sizeof (use_shape_plan_t));
+ if (unlikely (!use_plan))
+ return NULL;
+
+ use_plan->rphf_mask = plan->map.get_1_mask (HB_TAG('r','p','h','f'));
+
+ if (has_arabic_joining (plan->props.script))
+ {
+ use_plan->arabic_plan = (arabic_shape_plan_t *) data_create_arabic (plan);
+ if (unlikely (!use_plan->arabic_plan))
+ {
+ free (use_plan);
+ return NULL;
+ }
+ }
+
+ return use_plan;
+}
+
+static void
+data_destroy_use (void *data)
+{
+ use_shape_plan_t *use_plan = (use_shape_plan_t *) data;
+
+ if (use_plan->arabic_plan)
+ data_destroy_arabic (use_plan->arabic_plan);
+
+ free (data);
+}
+
+enum syllable_type_t {
+ independent_cluster,
+ virama_terminated_cluster,
+ consonant_cluster,
+ vowel_cluster,
+ number_joiner_terminated_cluster,
+ numeral_cluster,
+ symbol_cluster,
+ broken_cluster,
+};
+
+#include "hb-ot-shape-complex-use-machine.hh"
+
+
+static void
+setup_masks_use (const hb_ot_shape_plan_t *plan,
+ hb_buffer_t *buffer,
+ hb_font_t *font HB_UNUSED)
+{
+ const use_shape_plan_t *use_plan = (const use_shape_plan_t *) plan->data;
+
+ /* Do this before allocating use_category(). */
+ if (use_plan->arabic_plan)
+ {
+ setup_masks_arabic_plan (use_plan->arabic_plan, buffer, plan->props.script);
+ }
+
+ HB_BUFFER_ALLOCATE_VAR (buffer, use_category);
+
+ /* We cannot setup masks here. We save information about characters
+ * and setup masks later on in a pause-callback. */
+
+ unsigned int count = buffer->len;
+ hb_glyph_info_t *info = buffer->info;
+ for (unsigned int i = 0; i < count; i++)
+ info[i].use_category() = hb_use_get_categories (info[i].codepoint);
+}
+
+static void
+setup_rphf_mask (const hb_ot_shape_plan_t *plan,
+ hb_buffer_t *buffer)
+{
+ const use_shape_plan_t *use_plan = (const use_shape_plan_t *) plan->data;
+
+ hb_mask_t mask = use_plan->rphf_mask;
+ if (!mask) return;
+
+ hb_glyph_info_t *info = buffer->info;
+
+ foreach_syllable (buffer, start, end)
+ {
+ unsigned int limit = info[start].use_category() == USE_R ? 1 : MIN (3u, end - start);
+ for (unsigned int i = start; i < start + limit; i++)
+ info[i].mask |= mask;
+ }
+}
+
+static void
+setup_topographical_masks (const hb_ot_shape_plan_t *plan,
+ hb_buffer_t *buffer)
+{
+
+ ASSERT_STATIC (INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4);
+ hb_mask_t masks[4], all_masks = 0;
+ for (unsigned int i = 0; i < 4; i++)
+ {
+ masks[i] = plan->map.get_1_mask (arabic_features[i]);
+ if (masks[i] == plan->map.get_global_mask ())
+ masks[i] = 0;
+ all_masks |= masks[i];
+ }
+ if (!all_masks)
+ return;
+ hb_mask_t other_masks = ~all_masks;
+
+ unsigned int last_start = 0;
+ joining_form_t last_form = _NONE;
+ hb_glyph_info_t *info = buffer->info;
+ foreach_syllable (buffer, start, end)
+ {
+ syllable_type_t syllable_type = (syllable_type_t) (info[start].syllable() & 0x0F);
+ switch (syllable_type)
+ {
+ case independent_cluster:
+ case symbol_cluster:
+ /* These don't join. Nothing to do. */
+ last_form = _NONE;
+ break;
+
+ case virama_terminated_cluster:
+ case consonant_cluster:
+ case vowel_cluster:
+ case number_joiner_terminated_cluster:
+ case numeral_cluster:
+ case broken_cluster:
+
+ bool join = last_form == FINA || last_form == ISOL;
+
+ if (join)
+ {
+ /* Fixup previous syllable's form. */
+ last_form = last_form == FINA ? MEDI : INIT;
+ for (unsigned int i = last_start; i < start; i++)
+ info[i].mask = (info[i].mask & other_masks) | masks[last_form];
+ }
+
+ /* Form for this syllable. */
+ last_form = join ? FINA : ISOL;
+ for (unsigned int i = start; i < end; i++)
+ info[i].mask = (info[i].mask & other_masks) | masks[last_form];
+
+ break;
+ }
+
+ last_start = start;
+ }
+}
+
+static void
+setup_syllables (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font HB_UNUSED,
+ hb_buffer_t *buffer)
+{
+ find_syllables (buffer);
+ setup_rphf_mask (plan, buffer);
+ setup_topographical_masks (plan, buffer);
+}
+
+static void
+clear_substitution_flags (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font HB_UNUSED,
+ hb_buffer_t *buffer)
+{
+ hb_glyph_info_t *info = buffer->info;
+ unsigned int count = buffer->len;
+ for (unsigned int i = 0; i < count; i++)
+ _hb_glyph_info_clear_substituted_and_ligated_and_multiplied (&info[i]);
+}
+
+static void
+record_rphf (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
+{
+ const use_shape_plan_t *use_plan = (const use_shape_plan_t *) plan->data;
+
+ hb_mask_t mask = use_plan->rphf_mask;
+ if (!mask) return;
+ hb_glyph_info_t *info = buffer->info;
+
+ foreach_syllable (buffer, start, end)
+ {
+ /* Mark a substituted repha as USE_R. */
+ for (unsigned int i = start; i < end && (info[i].mask & mask); i++)
+ if (_hb_glyph_info_substituted (&info[i]))
+ {
+ info[i].use_category() = USE_R;
+ break;
+ }
+ }
+}
+
+static void
+record_pref (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
+{
+ hb_glyph_info_t *info = buffer->info;
+
+ foreach_syllable (buffer, start, end)
+ {
+ /* Mark a substituted pref as VPre, as they behave the same way. */
+ for (unsigned int i = start; i < end; i++)
+ if (_hb_glyph_info_substituted (&info[i]))
+ {
+ info[i].use_category() = USE_VPre;
+ break;
+ }
+ }
+}
+
+static void
+reorder_syllable (hb_buffer_t *buffer, unsigned int start, unsigned int end)
+{
+ syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
+ /* Only a few syllable types need reordering. */
+ if (unlikely (!(FLAG_SAFE (syllable_type) &
+ (FLAG (virama_terminated_cluster) |
+ FLAG (consonant_cluster) |
+ FLAG (vowel_cluster) |
+ FLAG (broken_cluster) |
+ 0))))
+ return;
+
+ hb_glyph_info_t *info = buffer->info;
+
+#define HALANT_FLAGS FLAG(USE_H)
+#define BASE_FLAGS (FLAG (USE_B) | FLAG (USE_GB) | FLAG (USE_IV))
+
+ /* Move things forward. */
+ if (info[start].use_category() == USE_R && end - start > 1)
+ {
+ /* Got a repha. Reorder it to after first base, before first halant. */
+ for (unsigned int i = start + 1; i < end; i++)
+ if (FLAG_UNSAFE (info[i].use_category()) & (HALANT_FLAGS | BASE_FLAGS))
+ {
+ /* If we hit a halant, move before it; otherwise it's a base: move to it's
+ * place, and shift things in between backward. */
+
+ if (info[i].use_category() == USE_H)
+ i--;
+
+ buffer->merge_clusters (start, i + 1);
+ hb_glyph_info_t t = info[start];
+ memmove (&info[start], &info[start + 1], (i - start) * sizeof (info[0]));
+ info[i] = t;
+
+ break;
+ }
+ }
+
+ /* Move things back. */
+ unsigned int j = end;
+ for (unsigned int i = start; i < end; i++)
+ {
+ uint32_t flag = FLAG_UNSAFE (info[i].use_category());
+ if (flag & (HALANT_FLAGS | BASE_FLAGS))
+ {
+ /* If we hit a halant, move before it; otherwise it's a base: move to it's
+ * place, and shift things in between backward. */
+ if (info[i].use_category() == USE_H)
+ j = i + 1;
+ else
+ j = i;
+ }
+ else if (((flag) & (FLAG (USE_VPre) | FLAG (USE_VMPre))) &&
+ /* Only move the first component of a MultipleSubst. */
+ 0 == _hb_glyph_info_get_lig_comp (&info[i]) &&
+ j < i)
+ {
+ buffer->merge_clusters (j, i + 1);
+ hb_glyph_info_t t = info[i];
+ memmove (&info[j + 1], &info[j], (i - j) * sizeof (info[0]));
+ info[j] = t;
+ }
+ }
+}
+
+static inline void
+insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
+{
+ /* Note: This loop is extra overhead, but should not be measurable. */
+ bool has_broken_syllables = false;
+ unsigned int count = buffer->len;
+ hb_glyph_info_t *info = buffer->info;
+ for (unsigned int i = 0; i < count; i++)
+ if ((info[i].syllable() & 0x0F) == broken_cluster)
+ {
+ has_broken_syllables = true;
+ break;
+ }
+ if (likely (!has_broken_syllables))
+ return;
+
+
+ hb_codepoint_t dottedcircle_glyph;
+ if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
+ return;
+
+ hb_glyph_info_t dottedcircle = {0};
+ if (!font->get_glyph (0x25CCu, 0, &dottedcircle.codepoint))
+ return;
+ dottedcircle.use_category() = hb_use_get_categories (0x25CC);
+
+ buffer->clear_output ();
+
+ buffer->idx = 0;
+
+ unsigned int last_syllable = 0;
+ while (buffer->idx < buffer->len)
+ {
+ unsigned int syllable = buffer->cur().syllable();
+ syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F);
+ if (unlikely (last_syllable != syllable && syllable_type == broken_cluster))
+ {
+ last_syllable = syllable;
+
+ hb_glyph_info_t ginfo = dottedcircle;
+ ginfo.cluster = buffer->cur().cluster;
+ ginfo.mask = buffer->cur().mask;
+ ginfo.syllable() = buffer->cur().syllable();
+ /* TODO Set glyph_props? */
+
+ /* Insert dottedcircle after possible Repha. */
+ while (buffer->idx < buffer->len &&
+ last_syllable == buffer->cur().syllable() &&
+ buffer->cur().use_category() == USE_R)
+ buffer->next_glyph ();
+
+ buffer->output_info (ginfo);
+ }
+ else
+ buffer->next_glyph ();
+ }
+
+ buffer->swap_buffers ();
+}
+
+static void
+reorder (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
+{
+ insert_dotted_circles (plan, font, buffer);
+
+ hb_glyph_info_t *info = buffer->info;
+
+ foreach_syllable (buffer, start, end)
+ reorder_syllable (buffer, start, end);
+
+ /* Zero syllables now... */
+ unsigned int count = buffer->len;
+ for (unsigned int i = 0; i < count; i++)
+ info[i].syllable() = 0;
+
+ HB_BUFFER_DEALLOCATE_VAR (buffer, use_category);
+}
+
+static bool
+compose_use (const hb_ot_shape_normalize_context_t *c,
+ hb_codepoint_t a,
+ hb_codepoint_t b,
+ hb_codepoint_t *ab)
+{
+ /* Avoid recomposing split matras. */
+ if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (c->unicode->general_category (a)))
+ return false;
+
+ return c->unicode->compose (a, b, ab);
+}
+
+
+const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
+{
+ "use",
+ collect_features_use,
+ NULL, /* override_features */
+ data_create_use,
+ data_destroy_use,
+ NULL, /* preprocess_text */
+ HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
+ NULL, /* decompose */
+ compose_use,
+ setup_masks_use,
+ HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
+ false, /* fallback_position */
+};
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc
index 53274b502a..3cb3456f1a 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-fallback.cc
@@ -224,7 +224,7 @@ position_mark (const hb_ot_shape_plan_t *plan,
pos.x_offset += base_extents.x_bearing + base_extents.width - mark_extents.width / 2 - mark_extents.x_bearing;
break;
}
- /* Fall through */
+ HB_FALLTHROUGH;
default:
case HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW:
@@ -259,6 +259,7 @@ position_mark (const hb_ot_shape_plan_t *plan,
case HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT:
/* Add gap, fall-through. */
base_extents.height -= y_gap;
+ HB_FALLTHROUGH;
case HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT:
case HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW:
@@ -279,6 +280,7 @@ position_mark (const hb_ot_shape_plan_t *plan,
/* Add gap, fall-through. */
base_extents.y_bearing += y_gap;
base_extents.height -= y_gap;
+ HB_FALLTHROUGH;
case HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE:
case HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT:
@@ -418,13 +420,12 @@ _hb_ot_shape_fallback_position (const hb_ot_shape_plan_t *plan,
_hb_buffer_assert_gsubgpos_vars (buffer);
unsigned int start = 0;
- unsigned int last_cluster = buffer->info[0].cluster;
unsigned int count = buffer->len;
+ hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 1; i < count; i++)
- if (buffer->info[i].cluster != last_cluster) {
+ if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])))) {
position_cluster (plan, font, buffer, start, i);
start = i;
- last_cluster = buffer->info[i].cluster;
}
position_cluster (plan, font, buffer, start, count);
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-normalize.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-normalize.cc
index 8cc64af014..0a4d40499f 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-normalize.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-normalize.cc
@@ -62,24 +62,12 @@
* with previous base, use that. This needs the itemizer to have this
* knowledge too. We need to provide assistance to the itemizer.
*
- * - When a font does not support a character but supports its decomposition,
- * well, use the decomposition (preferring the canonical decomposition, but
- * falling back to the compatibility decomposition if necessary). The
- * compatibility decomposition is really nice to have, for characters like
- * ellipsis, or various-sized space characters.
+ * - When a font does not support a character but supports its canonical
+ * decomposition, well, use the decomposition.
*
* - The complex shapers can customize the compose and decompose functions to
* offload some of their requirements to the normalizer. For example, the
* Indic shaper may want to disallow recomposing of two matras.
- *
- * - We try compatibility decomposition if decomposing through canonical
- * decomposition alone failed to find a sequence that the font supports.
- * We don't try compatibility decomposition recursively during the canonical
- * decomposition phase. This has minimal impact. There are only a handful
- * of Greek letter that have canonical decompositions that include characters
- * with compatibility decomposition. Those can be found using this command:
- *
- * egrep "`echo -n ';('; grep ';<' UnicodeData.txt | cut -d';' -f1 | tr '\n' '|'; echo ') '`" UnicodeData.txt
*/
static bool
@@ -171,28 +159,6 @@ decompose (const hb_ot_shape_normalize_context_t *c, bool shortest, hb_codepoint
return 0;
}
-/* Returns 0 if didn't decompose, number of resulting characters otherwise. */
-static inline unsigned int
-decompose_compatibility (const hb_ot_shape_normalize_context_t *c, hb_codepoint_t u)
-{
- unsigned int len, i;
- hb_codepoint_t decomposed[HB_UNICODE_MAX_DECOMPOSITION_LEN];
- hb_codepoint_t glyphs[HB_UNICODE_MAX_DECOMPOSITION_LEN];
-
- len = c->buffer->unicode->decompose_compatibility (u, decomposed);
- if (!len)
- return 0;
-
- for (i = 0; i < len; i++)
- if (!c->font->get_glyph (decomposed[i], 0, &glyphs[i]))
- return 0;
-
- for (i = 0; i < len; i++)
- output_char (c->buffer, decomposed[i], glyphs[i]);
-
- return len;
-}
-
static inline void
decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shortest)
{
@@ -207,8 +173,6 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
skip_char (buffer);
else if (!shortest && c->font->get_glyph (u, 0, &glyph))
next_char (buffer, glyph);
- else if (decompose_compatibility (c, u))
- skip_char (buffer);
else
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
}
@@ -290,6 +254,8 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
hb_font_t *font)
{
+ if (unlikely (!buffer->len)) return;
+
_hb_buffer_assert_unicode_vars (buffer);
hb_ot_shape_normalization_mode_t mode = plan->shaper->normalization_preference;
@@ -323,7 +289,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
{
unsigned int end;
for (end = buffer->idx + 1; end < count; end++)
- if (buffer->cur().cluster != buffer->info[end].cluster)
+ if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[end]))))
break;
decompose_cluster (&c, end, might_short_circuit, always_short_circuit);
@@ -344,15 +310,13 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
if (_hb_glyph_info_get_modified_combining_class (&buffer->info[end]) == 0)
break;
- /* We are going to do a bubble-sort. Only do this if the
- * sequence is short. Doing it on long sequences can result
- * in an O(n^2) DoS. */
+ /* We are going to do a O(n^2). Only do this if the sequence is short. */
if (end - i > 10) {
i = end;
continue;
}
- hb_bubble_sort (buffer->info + i, end - i, compare_combining_class);
+ buffer->sort (i, end, compare_combining_class);
i = end;
}
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape.cc
index 07adb04f67..40332d69f1 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape.cc
@@ -59,10 +59,6 @@ static hb_tag_t horizontal_features[] = {
HB_TAG('r','c','l','t'),
};
-static hb_tag_t vertical_features[] = {
- HB_TAG('v','e','r','t'),
-};
-
static void
@@ -105,10 +101,13 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
(horizontal_features[i] == HB_TAG('k','e','r','n') ?
F_HAS_FALLBACK : F_NONE));
else
- for (unsigned int i = 0; i < ARRAY_LENGTH (vertical_features); i++)
- map->add_feature (vertical_features[i], 1, F_GLOBAL |
- (vertical_features[i] == HB_TAG('v','k','r','n') ?
- F_HAS_FALLBACK : F_NONE));
+ {
+ /* We really want to find a 'vert' feature if there's any in the font, no
+ * matter which script/langsys it is listed (or not) under.
+ * See various bugs referenced from:
+ * https://github.com/behdad/harfbuzz/issues/63 */
+ map->add_feature (HB_TAG ('v','e','r','t'), 1, F_GLOBAL | F_GLOBAL_SEARCH);
+ }
if (planner->shaper->override_features)
planner->shaper->override_features (planner);
@@ -264,11 +263,22 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font)
static void
hb_form_clusters (hb_buffer_t *buffer)
{
+ if (buffer->cluster_level != HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
+ return;
+
+ /* Loop duplicated in hb_ensure_native_direction(). */
+ unsigned int base = 0;
unsigned int count = buffer->len;
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 1; i < count; i++)
- if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])))
- buffer->merge_clusters (i - 1, i + 1);
+ {
+ if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i]))))
+ {
+ buffer->merge_clusters (base, i);
+ base = i;
+ }
+ }
+ buffer->merge_clusters (base, count);
}
static void
@@ -283,7 +293,28 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
if ((HB_DIRECTION_IS_HORIZONTAL (direction) && direction != hb_script_get_horizontal_direction (buffer->props.script)) ||
(HB_DIRECTION_IS_VERTICAL (direction) && direction != HB_DIRECTION_TTB))
{
- hb_buffer_reverse_clusters (buffer);
+ /* Same loop as hb_form_clusters().
+ * Since form_clusters() merged clusters already, we don't merge. */
+ unsigned int base = 0;
+ unsigned int count = buffer->len;
+ hb_glyph_info_t *info = buffer->info;
+ for (unsigned int i = 1; i < count; i++)
+ {
+ if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i]))))
+ {
+ if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)
+ buffer->merge_clusters (base, i);
+ buffer->reverse_range (base, i);
+
+ base = i;
+ }
+ }
+ if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)
+ buffer->merge_clusters (base, count);
+ buffer->reverse_range (base, count);
+
+ buffer->reverse ();
+
buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction);
}
}
@@ -305,7 +336,7 @@ hb_ot_mirror_chars (hb_ot_shape_context_t *c)
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 0; i < count; i++) {
hb_codepoint_t codepoint = unicode->mirroring (info[i].codepoint);
- if (likely (codepoint == info[i].codepoint))
+ if (likely (codepoint == info[i].codepoint || !c->font->has_glyph (codepoint)))
info[i].mask |= rtlm_mask;
else
info[i].codepoint = codepoint;
@@ -380,6 +411,101 @@ hb_ot_shape_setup_masks (hb_ot_shape_context_t *c)
}
}
+static void
+hb_ot_zero_width_default_ignorables (hb_ot_shape_context_t *c)
+{
+ hb_buffer_t *buffer = c->buffer;
+
+ if (buffer->flags & HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)
+ return;
+
+ unsigned int count = buffer->len;
+ hb_glyph_info_t *info = buffer->info;
+ hb_glyph_position_t *pos = buffer->pos;
+ unsigned int i = 0;
+ for (i = 0; i < count; i++)
+ if (unlikely (_hb_glyph_info_is_default_ignorable (&info[i])))
+ pos[i].x_advance = pos[i].y_advance = pos[i].x_offset = pos[i].y_offset = 0;
+}
+
+static void
+hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
+{
+ hb_buffer_t *buffer = c->buffer;
+
+ if (buffer->flags & HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)
+ return;
+
+ unsigned int count = buffer->len;
+ hb_glyph_info_t *info = buffer->info;
+ hb_glyph_position_t *pos = buffer->pos;
+ unsigned int i = 0;
+ for (i = 0; i < count; i++)
+ {
+ if (unlikely (_hb_glyph_info_is_default_ignorable (&info[i])))
+ break;
+ }
+
+ /* No default-ignorables found; return. */
+ if (i == count)
+ return;
+
+ hb_codepoint_t space;
+ if (c->font->get_glyph (' ', 0, &space))
+ {
+ /* Replace default-ignorables with a zero-advance space glyph. */
+ for (/*continue*/; i < count; i++)
+ {
+ if (_hb_glyph_info_is_default_ignorable (&info[i]))
+ info[i].codepoint = space;
+ }
+ }
+ else
+ {
+ /* Merge clusters and delete default-ignorables.
+ * NOTE! We can't use out-buffer as we have positioning data. */
+ unsigned int j = i;
+ for (; i < count; i++)
+ {
+ if (_hb_glyph_info_is_default_ignorable (&info[i]))
+ {
+ /* Merge clusters.
+ * Same logic as buffer->delete_glyph(), but for in-place removal. */
+
+ unsigned int cluster = info[i].cluster;
+ if (i + 1 < count && cluster == info[i + 1].cluster)
+ continue; /* Cluster survives; do nothing. */
+
+ if (j)
+ {
+ /* Merge cluster backward. */
+ if (cluster < info[j - 1].cluster)
+ {
+ unsigned int old_cluster = info[j - 1].cluster;
+ for (unsigned k = j; k && info[k - 1].cluster == old_cluster; k--)
+ info[k - 1].cluster = cluster;
+ }
+ continue;
+ }
+
+ if (i + 1 < count)
+ buffer->merge_clusters (i, i + 2); /* Merge cluster forward. */
+
+ continue;
+ }
+
+ if (j != i)
+ {
+ info[j] = info[i];
+ pos[j] = pos[i];
+ }
+ j++;
+ }
+ buffer->len = j;
+ }
+}
+
+
static inline void
hb_ot_map_glyphs_fast (hb_buffer_t *buffer)
{
@@ -388,6 +514,8 @@ hb_ot_map_glyphs_fast (hb_buffer_t *buffer)
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 0; i < count; i++)
info[i].codepoint = info[i].glyph_index();
+
+ buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
}
static inline void
@@ -625,6 +753,8 @@ hb_ot_position (hb_ot_shape_context_t *c)
hb_bool_t fallback = !hb_ot_position_complex (c);
+ hb_ot_zero_width_default_ignorables (c);
+
hb_ot_layout_position_finish (c->font, c->buffer);
if (fallback && c->plan->shaper->fallback_position)
@@ -642,53 +772,6 @@ hb_ot_position (hb_ot_shape_context_t *c)
}
-/* Post-process */
-
-static void
-hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
-{
- if (c->buffer->flags & HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)
- return;
-
- hb_codepoint_t space;
- enum {
- SPACE_DONT_KNOW,
- SPACE_AVAILABLE,
- SPACE_UNAVAILABLE
- } space_status = SPACE_DONT_KNOW;
-
- unsigned int count = c->buffer->len;
- hb_glyph_info_t *info = c->buffer->info;
- hb_glyph_position_t *pos = c->buffer->pos;
- unsigned int j = 0;
- for (unsigned int i = 0; i < count; i++)
- {
- if (unlikely (!_hb_glyph_info_ligated (&info[i]) &&
- _hb_glyph_info_is_default_ignorable (&info[i])))
- {
- if (space_status == SPACE_DONT_KNOW)
- space_status = c->font->get_glyph (' ', 0, &space) ? SPACE_AVAILABLE : SPACE_UNAVAILABLE;
-
- if (space_status == SPACE_AVAILABLE)
- {
- info[i].codepoint = space;
- pos[i].x_advance = 0;
- pos[i].y_advance = 0;
- }
- else
- continue; /* Delete it. XXX Merge clusters? */
- }
- if (j != i)
- {
- info[j] = info[i];
- pos[j] = pos[i];
- }
- j++;
- }
- c->buffer->len = j;
-}
-
-
/* Pull it all together! */
static void
@@ -736,6 +819,9 @@ _hb_ot_shape (hb_shape_plan_t *shape_plan,
}
+/**
+ * Since: 0.9.7
+ **/
void
hb_ot_shape_plan_collect_lookups (hb_shape_plan_t *shape_plan,
hb_tag_t table_tag,
@@ -766,6 +852,9 @@ add_char (hb_font_t *font,
}
+/**
+ * Since: 0.9.2
+ **/
void
hb_ot_shape_glyphs_closure (hb_font_t *font,
hb_buffer_t *buffer,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-tag.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-tag.cc
index 878dd79b62..a2e5728fcd 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-tag.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-tag.cc
@@ -175,6 +175,11 @@ typedef struct {
*
* Some items still missing. Those are commented out at the end.
* Keep sorted for bsearch.
+ *
+ * Updated as of 2015-05-06: OT1.7 on MS website has some newer
+ * items that we don't have here, eg. Zazaki. This is the new
+ * items in OpenType 1.7 (red items), most of which we have:
+ * http://www.microsoft.com/typography/otspec170/languagetags.htm
*/
static const LangTag ot_languages[] = {
@@ -217,9 +222,9 @@ static const LangTag ot_languages[] = {
{"bci", HB_TAG('B','A','U',' ')}, /* Baoulé */
{"bcl", HB_TAG('B','I','K',' ')}, /* Central Bikol */
{"bcq", HB_TAG('B','C','H',' ')}, /* Bench */
- {"be", HB_TAG('B','E','L',' ')}, /* Belarusian */
+ {"be", HB_TAG('B','E','L',' ')}, /* Belarusian */
{"bem", HB_TAG('B','E','M',' ')}, /* Bemba (Zambia) */
- {"ber", HB_TAG('B','E','R',' ')}, /* Berber [family] */
+ {"ber", HB_TAG('B','E','R',' ')}, /* Berber [family] */
{"bfq", HB_TAG('B','A','D',' ')}, /* Badaga */
{"bft", HB_TAG('B','L','T',' ')}, /* Balti */
{"bfy", HB_TAG('B','A','G',' ')}, /* Baghelkhandi */
@@ -346,9 +351,9 @@ static const LangTag ot_languages[] = {
{"gv", HB_TAG('M','N','X',' ')}, /* Manx */
{"ha", HB_TAG('H','A','U',' ')}, /* Hausa */
{"har", HB_TAG('H','R','I',' ')}, /* Harari */
- {"haw", HB_TAG('H','A','W',' ')}, /* Hawaiian */
- {"hay", HB_TAG('H','A','Y',' ')}, /* Haya */
- {"haz", HB_TAG('H','A','Z',' ')}, /* Hazaragi */
+ {"haw", HB_TAG('H','A','W',' ')}, /* Hawaiian */
+ {"hay", HB_TAG('H','A','Y',' ')}, /* Haya */
+ {"haz", HB_TAG('H','A','Z',' ')}, /* Hazaragi */
{"he", HB_TAG('I','W','R',' ')}, /* Hebrew */
{"hz", HB_TAG('H','E','R',' ')}, /* Herero */
{"hi", HB_TAG('H','I','N',' ')}, /* Hindi */
@@ -542,6 +547,7 @@ static const LangTag ot_languages[] = {
{"nr", HB_TAG('N','D','B',' ')}, /* [South] Ndebele */
{"nsk", HB_TAG('N','A','S',' ')}, /* Naskapi */
{"nso", HB_TAG('S','O','T',' ')}, /* [Northern] Sotho */
+ {"nv", HB_TAG('N','A','V',' ')}, /* Navajo */
{"ny", HB_TAG('C','H','I',' ')}, /* Chewa/Chichwa/Nyanja */
{"nym", HB_TAG('N','Y','M',' ')}, /* Nyamwezi */
{"nyn", HB_TAG('N','K','L',' ')}, /* Nyankole */
@@ -727,7 +733,6 @@ static const LangTag ot_languages[] = {
/*{"fuf?", HB_TAG('F','T','A',' ')},*/ /* Futa */
/*{"ar-Syrc?", HB_TAG('G','A','R',' ')},*/ /* Garshuni */
/*{"cfm/rnl?", HB_TAG('H','A','L',' ')},*/ /* Halam */
-/*{"fonipa", HB_TAG('I','P','P','H')},*/ /* Phonetic transcription—IPA conventions */
/*{"ga-Latg?/Latg?", HB_TAG('I','R','T',' ')},*/ /* Irish Traditional */
/*{"krc", HB_TAG('K','A','R',' ')},*/ /* Karachay */
/*{"alw?/ktb?", HB_TAG('K','E','B',' ')},*/ /* Kebena */
@@ -826,6 +831,14 @@ hb_ot_tag_from_language (hb_language_t language)
}
}
+ /*
+ * The International Phonetic Alphabet is a variant tag in BCP-47,
+ * which can be applied to any language.
+ */
+ if (strstr (lang_str, "-fonipa")) {
+ return HB_TAG('I','P','P','H'); /* Phonetic transcription—IPA conventions */
+ }
+
/* Find a language matching in the first component */
{
const LangTag *lang_tag;
@@ -864,6 +877,15 @@ hb_ot_tag_from_language (hb_language_t language)
return HB_OT_TAG_DEFAULT_LANGUAGE;
}
+/**
+ * hb_ot_tag_to_language:
+ *
+ *
+ *
+ * Return value: (transfer none):
+ *
+ * Since: 0.9.2
+ **/
hb_language_t
hb_ot_tag_to_language (hb_tag_t tag)
{
@@ -886,6 +908,12 @@ hb_ot_tag_to_language (hb_tag_t tag)
}
}
+ /* struct LangTag has only room for 3-letter language tags. */
+ switch (tag) {
+ case HB_TAG('I','P','P','H'): /* Phonetic transcription—IPA conventions */
+ return hb_language_from_string ("und-fonipa", -1);
+ }
+
/* Else return a custom language in the form of "x-hbotABCD" */
{
unsigned char buf[11] = "x-hbot";
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-private.hh
index 06b24a80f8..53e0510a92 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-private.hh
@@ -54,6 +54,23 @@
#include <stdarg.h>
+/* Compile-time custom allocator support. */
+
+#if defined(hb_malloc_impl) \
+ && defined(hb_calloc_impl) \
+ && defined(hb_realloc_impl) \
+ && defined(hb_free_impl)
+extern "C" void* hb_malloc_impl(size_t size);
+extern "C" void* hb_calloc_impl(size_t nmemb, size_t size);
+extern "C" void* hb_realloc_impl(void *ptr, size_t size);
+extern "C" void hb_free_impl(void *ptr);
+#define malloc hb_malloc_impl
+#define calloc hb_calloc_impl
+#define realloc hb_realloc_impl
+#define free hb_free_impl
+#endif
+
+
/* Compiler attributes */
@@ -102,6 +119,36 @@
#define HB_FUNC __func__
#endif
+/*
+ * Borrowed from https://bugzilla.mozilla.org/show_bug.cgi?id=1215411
+ * HB_FALLTHROUGH is an annotation to suppress compiler warnings about switch
+ * cases that fall through without a break or return statement. HB_FALLTHROUGH
+ * is only needed on cases that have code:
+ *
+ * switch (foo) {
+ * case 1: // These cases have no code. No fallthrough annotations are needed.
+ * case 2:
+ * case 3:
+ * foo = 4; // This case has code, so a fallthrough annotation is needed:
+ * HB_FALLTHROUGH;
+ * default:
+ * return foo;
+ * }
+ */
+#if defined(__clang__) && __cplusplus >= 201103L
+ /* clang's fallthrough annotations are only available starting in C++11. */
+# define HB_FALLTHROUGH [[clang::fallthrough]]
+#elif defined(_MSC_VER)
+ /*
+ * MSVC's __fallthrough annotations are checked by /analyze (Code Analysis):
+ * https://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx
+ */
+# include <sal.h>
+# define HB_FALLTHROUGH __fallthrough
+#else
+# define HB_FALLTHROUGH /* FALLTHROUGH */
+#endif
+
#if defined(_WIN32) || defined(__CYGWIN__)
/* We need Windows Vista for both Uniscribe backend and for
* MemoryBarrier. We don't support compiling on Windows XP,
@@ -121,16 +168,17 @@
# if defined(_WIN32_WCE)
/* Some things not defined on Windows CE. */
+# define strdup _strdup
# define getenv(Name) NULL
-# define setlocale(Category, Locale) "C"
+# if _WIN32_WCE < 0x800
+# define setlocale(Category, Locale) "C"
static int errno = 0; /* Use something better? */
+# endif
# elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
# define getenv(Name) NULL
# endif
-# if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
+# if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
- /* Windows CE only has _strdup, while rest of Windows has both. */
-# define strdup _strdup
# endif
#endif
@@ -192,8 +240,9 @@ static inline unsigned int ARRAY_LENGTH (const Type (&)[n]) { return n; }
#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
-#define ASSERT_STATIC_EXPR(_cond)((void) sizeof (char[(_cond) ? 1 : -1]))
-#define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * sizeof (char[(_cond) ? 1 : -1]))
+template <unsigned int cond> class hb_assert_constant_t {};
+
+#define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * (unsigned int) sizeof (hb_assert_constant_t<_cond>))
#define _PASTE1(a,b) a##b
#define PASTE(a,b) _PASTE1(a,b)
@@ -246,8 +295,8 @@ ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
/* Void! */
struct _hb_void_t {};
-typedef const _hb_void_t &hb_void_t;
-#define HB_VOID (* (const _hb_void_t *) NULL)
+typedef const _hb_void_t *hb_void_t;
+#define HB_VOID ((const _hb_void_t *) NULL)
/* Return the number of 1 bits in mask. */
static inline HB_CONST_FUNC unsigned int
@@ -738,7 +787,7 @@ template <typename T>
static inline void _hb_warn_no_return (bool returned)
{
if (unlikely (!returned)) {
- fprintf (stderr, "OUCH, returned with no call to TRACE_RETURN. This is a bug, please report.\n");
+ fprintf (stderr, "OUCH, returned with no call to return_trace(). This is a bug, please report.\n");
}
}
template <>
@@ -773,7 +822,7 @@ struct hb_auto_trace_t {
inline ret_t ret (ret_t v, unsigned int line = 0)
{
if (unlikely (returned)) {
- fprintf (stderr, "OUCH, double calls to TRACE_RETURN. This is a bug, please report.\n");
+ fprintf (stderr, "OUCH, double calls to return_trace(). This is a bug, please report.\n");
return v;
}
@@ -804,7 +853,7 @@ struct hb_auto_trace_t<0, ret_t> {
inline ret_t ret (ret_t v, unsigned int line HB_UNUSED = 0) { return v; }
};
-#define TRACE_RETURN(RET) trace.ret (RET, __LINE__)
+#define return_trace(RET) return trace.ret (RET, __LINE__)
/* Misc */
@@ -844,49 +893,43 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3)
/* Useful for set-operations on small enums.
* For example, for testing "x ∈ {x1, x2, x3}" use:
- * (FLAG(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
+ * (FLAG_SAFE(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
*/
-#define FLAG(x) (1<<(x))
+#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((x) < 32) + (1U << (x)))
+#define FLAG_SAFE(x) (1U << (x))
+#define FLAG_UNSAFE(x) ((x) < 32 ? FLAG_SAFE(x) : 0)
#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))
template <typename T, typename T2> static inline void
-hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *), T2 *array2)
+hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *), T2 *array2)
{
- if (unlikely (!len))
- return;
-
- unsigned int k = len - 1;
- do {
- unsigned int new_k = 0;
-
- for (unsigned int j = 0; j < k; j++)
- if (compar (&array[j], &array[j+1]) > 0)
- {
- {
- T t;
- t = array[j];
- array[j] = array[j + 1];
- array[j + 1] = t;
- }
- if (array2)
- {
- T2 t;
- t = array2[j];
- array2[j] = array2[j + 1];
- array2[j + 1] = t;
- }
-
- new_k = j;
- }
- k = new_k;
- } while (k);
+ for (unsigned int i = 1; i < len; i++)
+ {
+ unsigned int j = i;
+ while (j && compar (&array[j - 1], &array[i]) > 0)
+ j--;
+ if (i == j)
+ continue;
+ /* Move item i to occupy place for item j, shift what's in between. */
+ {
+ T t = array[i];
+ memmove (&array[j + 1], &array[j], (i - j) * sizeof (T));
+ array[j] = t;
+ }
+ if (array2)
+ {
+ T2 t = array2[i];
+ memmove (&array2[j + 1], &array2[j], (i - j) * sizeof (T2));
+ array2[j] = t;
+ }
+ }
}
template <typename T> static inline void
-hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *))
+hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *))
{
- hb_bubble_sort (array, len, compar, (int *) NULL);
+ hb_stable_sort (array, len, compar, (int *) NULL);
}
static inline hb_bool_t
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-set-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-set-private.hh
index acba4e946b..3c302b1daf 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-set-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-set-private.hh
@@ -36,7 +36,15 @@
* "approximate member query". Conceptually these are like Bloom
* Filter and Quotient Filter, however, much smaller, faster, and
* designed to fit the requirements of our uses for glyph coverage
- * queries. As a result, our filters have much higher.
+ * queries.
+ *
+ * Our filters are highly accurate if the lookup covers fairly local
+ * set of glyphs, but fully flooded and ineffective if coverage is
+ * all over the place.
+ *
+ * The frozen-set can be used instead of a digest, to trade more
+ * memory for 100% accuracy, but in practice, that doesn't look like
+ * an attractive trade-off.
*/
template <typename mask_t, unsigned int shift>
@@ -354,7 +362,6 @@ struct hb_frozen_set_t
return;
unsigned int min = set.get_min ();
const elt_t &min_elt = set.elt (min);
- const elt_t &max_elt = set.elt (max);
start = min & ~MASK;
count = max - start + 1;
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-set.cc b/src/3rdparty/harfbuzz-ng/src/hb-set.cc
index 59a0af46ed..cb7fcdbf64 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-set.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-set.cc
@@ -35,7 +35,7 @@
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_set_t *
hb_set_create (void)
@@ -55,7 +55,7 @@ hb_set_create (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_set_t *
hb_set_get_empty (void)
@@ -76,7 +76,7 @@ hb_set_get_empty (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_set_t *
hb_set_reference (hb_set_t *set)
@@ -88,7 +88,7 @@ hb_set_reference (hb_set_t *set)
* hb_set_destroy: (skip)
* @set: a set.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_destroy (hb_set_t *set)
@@ -110,7 +110,7 @@ hb_set_destroy (hb_set_t *set)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_set_set_user_data (hb_set_t *set,
@@ -129,7 +129,7 @@ hb_set_set_user_data (hb_set_t *set,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_set_get_user_data (hb_set_t *set,
@@ -147,7 +147,7 @@ hb_set_get_user_data (hb_set_t *set,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_set_allocation_successful (const hb_set_t *set HB_UNUSED)
@@ -161,7 +161,7 @@ hb_set_allocation_successful (const hb_set_t *set HB_UNUSED)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_clear (hb_set_t *set)
@@ -177,7 +177,7 @@ hb_set_clear (hb_set_t *set)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_set_is_empty (const hb_set_t *set)
@@ -194,7 +194,7 @@ hb_set_is_empty (const hb_set_t *set)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_set_has (const hb_set_t *set,
@@ -210,7 +210,7 @@ hb_set_has (const hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_add (hb_set_t *set,
@@ -227,7 +227,7 @@ hb_set_add (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_set_add_range (hb_set_t *set,
@@ -244,7 +244,7 @@ hb_set_add_range (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_del (hb_set_t *set,
@@ -261,7 +261,7 @@ hb_set_del (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_set_del_range (hb_set_t *set,
@@ -280,7 +280,7 @@ hb_set_del_range (hb_set_t *set,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_set_is_equal (const hb_set_t *set,
@@ -296,7 +296,7 @@ hb_set_is_equal (const hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_set (hb_set_t *set,
@@ -312,7 +312,7 @@ hb_set_set (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_union (hb_set_t *set,
@@ -328,7 +328,7 @@ hb_set_union (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_intersect (hb_set_t *set,
@@ -344,7 +344,7 @@ hb_set_intersect (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_subtract (hb_set_t *set,
@@ -360,7 +360,7 @@ hb_set_subtract (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_set_symmetric_difference (hb_set_t *set,
@@ -375,7 +375,7 @@ hb_set_symmetric_difference (hb_set_t *set,
*
*
*
- * Since: 1.0
+ * Since: 0.9.10
**/
void
hb_set_invert (hb_set_t *set)
@@ -391,7 +391,7 @@ hb_set_invert (hb_set_t *set)
*
* Return value: set population.
*
- * Since: 1.0
+ * Since: 0.9.7
**/
unsigned int
hb_set_get_population (const hb_set_t *set)
@@ -407,7 +407,7 @@ hb_set_get_population (const hb_set_t *set)
*
* Return value: minimum of the set, or %HB_SET_VALUE_INVALID if set is empty.
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_codepoint_t
hb_set_get_min (const hb_set_t *set)
@@ -423,7 +423,7 @@ hb_set_get_min (const hb_set_t *set)
*
* Return value: minimum of the set, or %HB_SET_VALUE_INVALID if set is empty.
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_codepoint_t
hb_set_get_max (const hb_set_t *set)
@@ -440,7 +440,7 @@ hb_set_get_max (const hb_set_t *set)
*
* Return value: whether there was a next value.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_set_next (const hb_set_t *set,
@@ -460,7 +460,7 @@ hb_set_next (const hb_set_t *set,
*
* Return value: whether there was a next range.
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_set_next_range (const hb_set_t *set,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-set.h b/src/3rdparty/harfbuzz-ng/src/hb-set.h
index bafdae9633..29bf6556ab 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-set.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-set.h
@@ -36,6 +36,9 @@
HB_BEGIN_DECLS
+/*
+ * Since: 0.9.21
+ */
#define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1)
typedef struct hb_set_t hb_set_t;
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-shape-plan.cc b/src/3rdparty/harfbuzz-ng/src/hb-shape-plan.cc
index 2166173f9e..56e2ea5c19 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-shape-plan.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-shape-plan.cc
@@ -106,7 +106,7 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_create (hb_face_t *face,
@@ -126,9 +126,9 @@ hb_shape_plan_create (hb_face_t *face,
if (unlikely (!face))
face = hb_face_get_empty ();
- if (unlikely (!props || hb_object_is_inert (face)))
+ if (unlikely (!props))
return hb_shape_plan_get_empty ();
- if (num_user_features && !(features = (hb_feature_t *) malloc (num_user_features * sizeof (hb_feature_t))))
+ if (num_user_features && !(features = (hb_feature_t *) calloc (num_user_features, sizeof (hb_feature_t))))
return hb_shape_plan_get_empty ();
if (!(shape_plan = hb_object_create<hb_shape_plan_t> ())) {
free (features);
@@ -158,7 +158,7 @@ hb_shape_plan_create (hb_face_t *face,
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_get_empty (void)
@@ -194,7 +194,7 @@ hb_shape_plan_get_empty (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_reference (hb_shape_plan_t *shape_plan)
@@ -208,7 +208,7 @@ hb_shape_plan_reference (hb_shape_plan_t *shape_plan)
*
*
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void
hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
@@ -236,7 +236,7 @@ hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
@@ -257,7 +257,7 @@ hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
void *
hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
@@ -279,7 +279,7 @@ hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_bool_t
hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
@@ -293,9 +293,13 @@ hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
num_features,
shape_plan->shaper_func);
- if (unlikely (hb_object_is_inert (shape_plan) ||
- hb_object_is_inert (font) ||
- hb_object_is_inert (buffer)))
+ if (unlikely (!buffer->len))
+ return true;
+
+ assert (!hb_object_is_inert (buffer));
+ assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE);
+
+ if (unlikely (hb_object_is_inert (shape_plan)))
return false;
assert (shape_plan->face_unsafe == font->face);
@@ -396,7 +400,7 @@ hb_non_global_user_features_present (const hb_feature_t *user_features,
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
hb_shape_plan_t *
hb_shape_plan_create_cached (hb_face_t *face,
@@ -453,6 +457,10 @@ retry:
hb_shape_plan_t *shape_plan = hb_shape_plan_create (face, props, user_features, num_user_features, shaper_list);
+ /* Don't add to the cache if face is inert. */
+ if (unlikely (hb_object_is_inert (face)))
+ return shape_plan;
+
/* Don't add the plan to the cache if there were user features with non-global ranges */
if (hb_non_global_user_features_present (user_features, num_user_features))
@@ -483,7 +491,7 @@ retry:
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.7
**/
const char *
hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan)
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-shape.cc b/src/3rdparty/harfbuzz-ng/src/hb-shape.cc
index 4e22c61862..8a98583989 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-shape.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-shape.cc
@@ -33,6 +33,17 @@
#include "hb-buffer-private.hh"
#include "hb-font-private.hh"
+/**
+ * SECTION:hb-shape
+ * @title: Shaping
+ * @short_description: Conversion of text strings into positioned glyphs
+ * @include: hb.h
+ *
+ * Shaping is the central operation of HarfBuzz. Shaping operates on buffers,
+ * which are sequences of Unicode characters that use the same font and have
+ * the same text direction, script and language. After shaping the buffer
+ * contains the output glyphs and their positions.
+ **/
static bool
parse_space (const char **pp, const char *end)
@@ -198,15 +209,16 @@ parse_one_feature (const char **pp, const char *end, hb_feature_t *feature)
/**
* hb_feature_from_string:
- * @str: (array length=len) (element-type uint8_t):
- * @len:
- * @feature: (out) (optional):
+ * @str: (array length=len) (element-type uint8_t): a string to parse
+ * @len: length of @str, or -1 if string is nul-terminated
+ * @feature: (out): the #hb_feature_t to initialize with the parsed values
*
- *
+ * Parses a string into a #hb_feature_t. If @len is -1 then @str is
+ * %NULL-terminated.
*
- * Return value:
+ * Return value: %TRUE if @str is successfully parsed, %FALSE otherwise
*
- * Since: 1.0
+ * Since: 0.9.5
**/
hb_bool_t
hb_feature_from_string (const char *str, int len,
@@ -231,13 +243,15 @@ hb_feature_from_string (const char *str, int len,
/**
* hb_feature_to_string:
- * @feature:
- * @buf: (array length=size):
- * @size:
+ * @feature: an #hb_feature_t to convert
+ * @buf: (array length=size) (out): output string
+ * @size: the allocated size of @buf
*
- *
+ * Converts a #hb_feature_t into a %NULL-terminated string in the format
+ * understood by hb_feature_from_string(). The client in responsible for
+ * allocating big enough size for @buf, 128 bytes is more than enough.
*
- * Since: 1.0
+ * Since: 0.9.5
**/
void
hb_feature_to_string (hb_feature_t *feature,
@@ -290,11 +304,12 @@ void free_static_shaper_list (void)
/**
* hb_shape_list_shapers:
*
- *
+ * Retrieves the list of shapers supported by HarfBuzz.
*
- * Return value: (transfer none):
+ * Return value: (transfer none) (array zero-terminated=1): an array of
+ * constant strings
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char **
hb_shape_list_shapers (void)
@@ -333,17 +348,21 @@ retry:
/**
* hb_shape_full:
- * @font: a font.
- * @buffer: a buffer.
- * @features: (array length=num_features):
- * @num_features:
- * @shaper_list: (array zero-terminated=1):
+ * @font: an #hb_font_t to use for shaping
+ * @buffer: an #hb_buffer_t to shape
+ * @features: (array length=num_features) (allow-none): an array of user
+ * specified #hb_feature_t or %NULL
+ * @num_features: the length of @features array
+ * @shaper_list: (array zero-terminated=1) (allow-none): a %NULL-terminated
+ * array of shapers to use or %NULL
*
- *
+ * See hb_shape() for details. If @shaper_list is not %NULL, the specified
+ * shapers will be used in the given order, otherwise the default shapers list
+ * will be used.
*
- * Return value:
+ * Return value: %FALSE if all shapers failed, %TRUE otherwise
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_shape_full (hb_font_t *font,
@@ -352,11 +371,6 @@ hb_shape_full (hb_font_t *font,
unsigned int num_features,
const char * const *shaper_list)
{
- if (unlikely (!buffer->len))
- return true;
-
- assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE);
-
hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props, features, num_features, shaper_list);
hb_bool_t res = hb_shape_plan_execute (shape_plan, font, buffer, features, num_features);
hb_shape_plan_destroy (shape_plan);
@@ -368,14 +382,19 @@ hb_shape_full (hb_font_t *font,
/**
* hb_shape:
- * @font: a font.
- * @buffer: a buffer.
- * @features: (array length=num_features):
- * @num_features:
+ * @font: an #hb_font_t to use for shaping
+ * @buffer: an #hb_buffer_t to shape
+ * @features: (array length=num_features) (allow-none): an array of user
+ * specified #hb_feature_t or %NULL
+ * @num_features: the length of @features array
+ *
+ * Shapes @buffer using @font turning its Unicode characters content to
+ * positioned glyphs. If @features is not %NULL, it will be used to control the
+ * features applied during shaping.
*
- *
+ * Return value: %FALSE if all shapers failed, %TRUE otherwise
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_shape (hb_font_t *font,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-shape.h b/src/3rdparty/harfbuzz-ng/src/hb-shape.h
index 10a35cb517..b665509a0d 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-shape.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-shape.h
@@ -47,13 +47,10 @@ typedef struct hb_feature_t {
unsigned int end;
} hb_feature_t;
-/* len=-1 means str is NUL-terminated */
hb_bool_t
hb_feature_from_string (const char *str, int len,
hb_feature_t *feature);
-/* Something like 128 bytes is more than enough.
- * nul-terminates. */
void
hb_feature_to_string (hb_feature_t *feature,
char *buf, unsigned int size);
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-shaper.cc b/src/3rdparty/harfbuzz-ng/src/hb-shaper.cc
index 580b95c84b..b25566d8a7 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-shaper.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-shaper.cc
@@ -64,7 +64,7 @@ retry:
}
/* Not found; allocate one. */
- shapers = (hb_shaper_pair_t *) malloc (sizeof (all_shapers));
+ shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers));
if (unlikely (!shapers)) {
(void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
return (const hb_shaper_pair_t *) all_shapers;
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-unicode-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-unicode-private.hh
index a2c59da274..968bca5567 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-unicode-private.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-unicode-private.hh
@@ -308,7 +308,7 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
/* Misc */
#define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
- (FLAG (gen_cat) & \
+ (FLAG_SAFE (gen_cat) & \
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-unicode.cc b/src/3rdparty/harfbuzz-ng/src/hb-unicode.cc
index fc19006d3e..487d10b939 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-unicode.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-unicode.cc
@@ -146,13 +146,8 @@ hb_unicode_funcs_get_default (void)
}
#if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL)
-#ifdef _MSC_VER
-#pragma message("Could not find any Unicode functions implementation, you have to provide your own")
-#pragma message("To suppress this warnings, define HB_NO_UNICODE_FUNCS")
-#else
-#warning "Could not find any Unicode functions implementation, you have to provide your own"
-#warning "To suppress this warning, define HB_NO_UNICODE_FUNCS"
-#endif
+#error "Could not find any Unicode functions implementation, you have to provide your own"
+#error "Consider building hb-ucdn.c. If you absolutely want to build without any, check the code."
#endif
/**
@@ -163,7 +158,7 @@ hb_unicode_funcs_get_default (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_unicode_funcs_t *
hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
@@ -209,7 +204,7 @@ const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_unicode_funcs_t *
hb_unicode_funcs_get_empty (void)
@@ -225,7 +220,7 @@ hb_unicode_funcs_get_empty (void)
*
* Return value: (transfer full):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_unicode_funcs_t *
hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs)
@@ -239,7 +234,7 @@ hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs)
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
@@ -268,7 +263,7 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
@@ -289,7 +284,7 @@ hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void *
hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
@@ -305,7 +300,7 @@ hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
@@ -324,7 +319,7 @@ hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs)
@@ -340,7 +335,7 @@ hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_unicode_funcs_t *
hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs)
@@ -400,7 +395,7 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
@@ -422,7 +417,7 @@ hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_bool_t
hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
@@ -443,7 +438,7 @@ hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
unsigned int
hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-unicode.h b/src/3rdparty/harfbuzz-ng/src/hb-unicode.h
index 1c4e097b92..3a12e2f9a2 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-unicode.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-unicode.h
@@ -283,7 +283,7 @@ typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
@@ -299,7 +299,7 @@ hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
@@ -315,7 +315,7 @@ hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
@@ -331,7 +331,7 @@ hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
@@ -347,7 +347,7 @@ hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
@@ -363,7 +363,7 @@ hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs,
@@ -379,7 +379,7 @@ hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_decompose_func (hb_unicode_funcs_t *ufuncs,
@@ -395,7 +395,7 @@ hb_unicode_funcs_set_decompose_func (hb_unicode_funcs_t *ufuncs,
*
*
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
@@ -404,37 +404,62 @@ hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
/* accessors */
+/**
+ * Since: 0.9.2
+ **/
hb_unicode_combining_class_t
hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);
+/**
+ * Since: 0.9.2
+ **/
unsigned int
hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);
+/**
+ * Since: 0.9.2
+ **/
hb_unicode_general_category_t
hb_unicode_general_category (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);
+/**
+ * Since: 0.9.2
+ **/
hb_codepoint_t
hb_unicode_mirroring (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);
+/**
+ * Since: 0.9.2
+ **/
hb_script_t
hb_unicode_script (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);
+/**
+ * Since: 0.9.2
+ **/
hb_bool_t
hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t a,
hb_codepoint_t b,
hb_codepoint_t *ab);
+
+/**
+ * Since: 0.9.2
+ **/
hb_bool_t
hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t ab,
hb_codepoint_t *a,
hb_codepoint_t *b);
+/**
+ * Since: 0.9.2
+ **/
unsigned int
hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t u,
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-version.h b/src/3rdparty/harfbuzz-ng/src/hb-version.h
index 648a46fde7..bd9ac3d1fc 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-version.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-version.h
@@ -36,11 +36,11 @@
HB_BEGIN_DECLS
-#define HB_VERSION_MAJOR 0
-#define HB_VERSION_MINOR 9
-#define HB_VERSION_MICRO 40
+#define HB_VERSION_MAJOR 1
+#define HB_VERSION_MINOR 0
+#define HB_VERSION_MICRO 6
-#define HB_VERSION_STRING "0.9.40"
+#define HB_VERSION_STRING "1.0.6"
#define HB_VERSION_ATLEAST(major,minor,micro) \
((major)*10000+(minor)*100+(micro) <= \
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-warning.cc b/src/3rdparty/harfbuzz-ng/src/hb-warning.cc
index e0f88e2d4a..8f322bcb10 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-warning.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-warning.cc
@@ -29,27 +29,11 @@
#if defined(HB_ATOMIC_INT_NIL)
-#ifdef _MSC_VER
-#pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe")
-#else
-#warning "Could not find any system to define atomic_int macros, library may NOT be thread-safe"
-#endif
+#error "Could not find any system to define atomic_int macros, library WILL NOT be thread-safe"
+#error "Check hb-atomic-private.hh for possible resolutions."
#endif
#if defined(HB_MUTEX_IMPL_NIL)
-#ifdef _MSC_VER
-#pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe")
-#else
-#warning "Could not find any system to define mutex macros, library may NOT be thread-safe"
-#endif
-#endif
-
-#if defined(HB_ATOMIC_INT_NIL) || defined(HB_MUTEX_IMPL_NIL)
-#ifdef _MSC_VER
-#pragma message("To suppress these warnings, define HB_NO_MT")
-#else
-#warning "To suppress these warnings, define HB_NO_MT"
+#error "Could not find any system to define mutex macros, library WILL NOT be thread-safe"
+#error "Check hb-mutex-private.hh for possible resolutions."
#endif
-#endif
-
-
diff --git a/src/3rdparty/libpng.pri b/src/3rdparty/libpng.pri
index f8516bd5db..a5fe32f867 100644
--- a/src/3rdparty/libpng.pri
+++ b/src/3rdparty/libpng.pri
@@ -1,4 +1,3 @@
-DEFINES *= QT_USE_BUNDLED_LIBPNG
DEFINES += PNG_ARM_NEON_OPT=0
INCLUDEPATH += $$PWD/libpng
SOURCES += $$PWD/libpng/png.c \
diff --git a/src/3rdparty/pcre/pcre.h b/src/3rdparty/pcre/pcre.h
index c2557cf4b1..609deb5be6 100644
--- a/src/3rdparty/pcre/pcre.h
+++ b/src/3rdparty/pcre/pcre.h
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */
#define PCRE_MAJOR 8
-#define PCRE_MINOR 38
+#define PCRE_MINOR 39
#define PCRE_PRERELEASE -RC1
-#define PCRE_DATE 2015-05-03
+#define PCRE_DATE 2015-11-23
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate
diff --git a/src/3rdparty/pcre/pcre_compile.c b/src/3rdparty/pcre/pcre_compile.c
index 866aa8c693..b9a239e554 100644
--- a/src/3rdparty/pcre/pcre_compile.c
+++ b/src/3rdparty/pcre/pcre_compile.c
@@ -4639,16 +4639,16 @@ for (;; ptr++)
/* In the real compile phase, just check the workspace used by the forward
reference list. */
- else if (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN)
+ else if (cd->hwm > cd->start_workspace + cd->workspace_size)
{
*errorcodeptr = ERR52;
goto FAILED;
}
- /* If in \Q...\E, check for the end; if not, we have a literal */
+ /* If in \Q...\E, check for the end; if not, we have a literal. Otherwise an
+ isolated \E is ignored. */
- if (inescq && c != CHAR_NULL)
+ if (c != CHAR_NULL)
{
if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
{
@@ -4656,7 +4656,7 @@ for (;; ptr++)
ptr++;
continue;
}
- else
+ else if (inescq)
{
if (previous_callout != NULL)
{
@@ -4671,18 +4671,27 @@ for (;; ptr++)
}
goto NORMAL_CHAR;
}
- /* Control does not reach here. */
+
+ /* 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. */
+
+ if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
+ {
+ inescq = TRUE;
+ ptr++;
+ continue;
+ }
}
- /* In extended mode, skip white space and comments. We need a loop in order
- to check for more white space and more comments after a comment. */
+ /* In extended mode, skip white space and comments. */
if ((options & PCRE_EXTENDED) != 0)
{
- for (;;)
+ const pcre_uchar *wscptr = ptr;
+ while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
+ if (c == CHAR_NUMBER_SIGN)
{
- while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
- if (c != CHAR_NUMBER_SIGN) break;
ptr++;
while (*ptr != CHAR_NULL)
{
@@ -4696,10 +4705,35 @@ for (;; ptr++)
if (utf) FORWARDCHAR(ptr);
#endif
}
- c = *ptr; /* Either NULL or the char after a newline */
+ }
+
+ /* If we skipped any characters, restart the loop. Otherwise, we didn't see
+ a comment. */
+
+ if (ptr > wscptr)
+ {
+ ptr--;
+ continue;
}
}
+ /* Skip over (?# comments. We need to do this here because we want to know if
+ the next thing is a quantifier, and these comments may come between an item
+ and its quantifier. */
+
+ if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK &&
+ ptr[2] == CHAR_NUMBER_SIGN)
+ {
+ ptr += 3;
+ while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
+ if (*ptr == CHAR_NULL)
+ {
+ *errorcodeptr = ERR18;
+ goto FAILED;
+ }
+ continue;
+ }
+
/* See if the next thing is a quantifier. */
is_quantifier =
@@ -4941,9 +4975,10 @@ for (;; ptr++)
(which is on the stack). We have to remember that there was XCLASS data,
however. */
+ if (class_uchardata > class_uchardata_base) xclass = TRUE;
+
if (lengthptr != NULL && class_uchardata > class_uchardata_base)
{
- xclass = TRUE;
*lengthptr += (int)(class_uchardata - class_uchardata_base);
class_uchardata = class_uchardata_base;
}
@@ -5046,10 +5081,28 @@ for (;; ptr++)
ptr = tempptr + 1;
continue;
- /* For all other POSIX classes, no special action is taken in UCP
- mode. Fall through to the non_UCP case. */
+ /* For the other POSIX classes (ascii, cntrl, 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. If we are in a negated
+ POSIX class, characters with code points greater than 255 must
+ either all match or all not match. In the special case where we
+ have not yet generated any xclass data, and this is the final item
+ in the overall class, we need do nothing: later on, the opcode
+ OP_NCLASS will be used to indicate that characters greater than 255
+ are acceptable. If we have already seen an xclass item or one may
+ follow (we have to assume that it might if this is not the end of
+ the class), explicitly list all wide codepoints, which will then
+ either not match or match, depending on whether the class is or is
+ not negated. */
default:
+ if (local_negate &&
+ (xclass || tempptr[2] != CHAR_RIGHT_SQUARE_BRACKET))
+ {
+ *class_uchardata++ = XCL_RANGE;
+ class_uchardata += PRIV(ord2utf)(0x100, class_uchardata);
+ class_uchardata += PRIV(ord2utf)(0x10ffff, class_uchardata);
+ }
break;
}
}
@@ -5388,16 +5441,20 @@ for (;; ptr++)
CLASS_SINGLE_CHARACTER:
if (class_one_char < 2) class_one_char++;
- /* If class_one_char is 1, 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 firstchar
- to be set. Otherwise, there can be no first char if this item is first,
- whatever repeat count may follow. In the case of reqchar, save the
- previous value for reinstating. */
+ /* If xclass_has_prop is false and class_one_char is 1, 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 firstchar to be set. Otherwise, there can be no first char if
+ this item is first, whatever repeat count may follow. In the case of
+ reqchar, save the previous value for reinstating. */
- if (!inescq && class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
+ if (!inescq &&
+#ifdef SUPPORT_UCP
+ !xclass_has_prop &&
+#endif
+ class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
{
ptr++;
zeroreqchar = reqchar;
@@ -5513,9 +5570,10 @@ for (;; ptr++)
actual compiled code. */
#ifdef SUPPORT_UTF
- if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0))
+ if (xclass && (xclass_has_prop || !should_flip_negation ||
+ (options & PCRE_UCP) != 0))
#elif !defined COMPILE_PCRE8
- if (xclass && !should_flip_negation)
+ if (xclass && (xclass_has_prop || !should_flip_negation))
#endif
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
{
@@ -6508,21 +6566,6 @@ for (;; ptr++)
case CHAR_LEFT_PARENTHESIS:
ptr++;
- /* First deal with comments. Putting this code right at the start ensures
- that comments have no bad side effects. */
-
- if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)
- {
- ptr += 2;
- while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
- if (*ptr == CHAR_NULL)
- {
- *errorcodeptr = ERR18;
- goto FAILED;
- }
- continue;
- }
-
/* Now deal with various "verbs" that can be introduced by '*'. */
if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
@@ -6613,9 +6656,17 @@ for (;; ptr++)
goto FAILED;
}
setverb = *code++ = verbs[i].op_arg;
- *code++ = arglen;
- memcpy(code, arg, IN_UCHARS(arglen));
- code += arglen;
+ if (lengthptr != NULL) /* In pass 1 just add in the length */
+ { /* to avoid potential workspace */
+ *lengthptr += arglen; /* overflow. */
+ *code++ = 0;
+ }
+ else
+ {
+ *code++ = arglen;
+ memcpy(code, arg, IN_UCHARS(arglen));
+ code += arglen;
+ }
*code++ = 0;
}
@@ -6668,7 +6719,7 @@ for (;; ptr++)
/* ------------------------------------------------------------ */
case CHAR_VERTICAL_LINE: /* Reset capture count for each branch */
reset_bracount = TRUE;
- cd->dupgroups = TRUE; /* Record (?| encountered */
+ cd->dupgroups = TRUE; /* Record (?| encountered */
/* Fall through */
/* ------------------------------------------------------------ */
@@ -6769,11 +6820,11 @@ for (;; ptr++)
{
while (IS_DIGIT(*ptr))
{
- if (recno > INT_MAX / 10 - 1) /* Integer overflow */
- {
- while (IS_DIGIT(*ptr)) ptr++;
- *errorcodeptr = ERR61;
- goto FAILED;
+ if (recno > INT_MAX / 10 - 1) /* Integer overflow */
+ {
+ while (IS_DIGIT(*ptr)) ptr++;
+ *errorcodeptr = ERR61;
+ goto FAILED;
}
recno = recno * 10 + (int)(*ptr - CHAR_0);
ptr++;
@@ -6909,11 +6960,11 @@ for (;; ptr++)
*errorcodeptr = ERR15;
goto FAILED;
}
- if (recno > INT_MAX / 10 - 1) /* Integer overflow */
- {
- *errorcodeptr = ERR61;
- goto FAILED;
- }
+ if (recno > INT_MAX / 10 - 1) /* Integer overflow */
+ {
+ *errorcodeptr = ERR61;
+ goto FAILED;
+ }
recno = recno * 10 + name[i] - CHAR_0;
}
if (recno == 0) recno = RREF_ANY;
@@ -7191,7 +7242,7 @@ for (;; ptr++)
{
named_group *ng;
recno = 0;
-
+
if (namelen == 0)
{
*errorcodeptr = ERR62;
@@ -7229,24 +7280,24 @@ for (;; ptr++)
issue is fixed "properly" in PCRE2. As PCRE1 is now in maintenance
only mode, we finesse the bug by allowing more memory always. */
- *lengthptr += 2 + 2*LINK_SIZE;
-
+ *lengthptr += 4 + 4*LINK_SIZE;
+
/* It is even worse than that. The current reference may be to an
existing named group with a different number (so apparently not
recursive) but which later on is also attached to a group with the
- current number. This can only happen if $(| has been previous
- encountered. In that case, we allow yet more memory, just in case.
+ current number. This can only happen if $(| has been previous
+ encountered. In that case, we allow yet more memory, just in case.
(Again, this is fixed "properly" in PCRE2. */
-
+
if (cd->dupgroups) *lengthptr += 4 + 4*LINK_SIZE;
/* Otherwise, check for recursion here. The name table does not exist
in the first pass; instead we must scan the list of names encountered
so far in order to get the number. If the name is not found, leave
the value of recno as 0 for a forward reference. */
-
+
else
- {
+ {
ng = cd->named_groups;
for (i = 0; i < cd->names_found; i++, ng++)
{
@@ -7266,7 +7317,7 @@ for (;; ptr++)
}
}
}
- }
+ }
}
/* In the real compile, search the name table. We check the name
@@ -7556,39 +7607,15 @@ for (;; ptr++)
newoptions = (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. If this
- item is right at the start of the pattern, the options can be
- abstracted and made external in the pre-compile phase, and ignored in
- the compile phase. This can be helpful when matching -- for instance in
- caseless checking of required bytes.
-
- If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are
- definitely *not* at the start of the pattern because something has been
- compiled. In the pre-compile phase, however, the code pointer can have
- that value after the start, because it gets reset as code is discarded
- during the pre-compile. However, this can happen only at top level - if
- we are within parentheses, the starting BRA will still be present. At
- any parenthesis level, the length value can be used to test if anything
- has been compiled at that level. Thus, a test for both these conditions
- is necessary to ensure we correctly detect the start of the pattern in
- both phases.
-
+ group with option changes, so the options change at this level.
If we are not at the pattern start, reset the greedy defaults and the
case value for firstchar and reqchar. */
if (*ptr == CHAR_RIGHT_PARENTHESIS)
{
- if (code == cd->start_code + 1 + LINK_SIZE &&
- (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
- {
- cd->external_options = newoptions;
- }
- else
- {
- greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
- greedy_non_default = greedy_default ^ 1;
- req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
- }
+ greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
+ greedy_non_default = greedy_default ^ 1;
+ req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
/* Change options at this level, and pass them back for use
in subsequent branches. */
@@ -7867,16 +7894,6 @@ for (;; ptr++)
c = ec;
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;
- continue;
- }
-
- if (escape == ESC_E) continue; /* Perl ignores an orphan \E */
-
/* For metasequences that actually match a character, we disable the
setting of a first character if it hasn't already been set. */
@@ -9296,7 +9313,7 @@ if (errorcode != 0) goto PCRE_EARLY_ERROR_RETURN;
DPRINTF(("end pre-compile: length=%d workspace=%d\n", length,
(int)(cd->hwm - cworkspace)));
-
+
if (length > MAX_PATTERN_SIZE)
{
errorcode = ERR20;
@@ -9434,16 +9451,16 @@ if (cd->hwm > cd->start_workspace)
int offset, recno;
cd->hwm -= LINK_SIZE;
offset = GET(cd->hwm, 0);
-
+
/* Check that the hwm handling hasn't gone wrong. This whole area is
- rewritten in PCRE2 because there are some obscure cases. */
-
+ rewritten in PCRE2 because there are some obscure cases. */
+
if (offset == 0 || codestart[offset-1] != OP_RECURSE)
{
- errorcode = ERR10;
+ errorcode = ERR10;
break;
- }
-
+ }
+
recno = GET(codestart, offset);
if (recno != prev_recno)
{
diff --git a/src/3rdparty/pcre/pcre_get.c b/src/3rdparty/pcre/pcre_get.c
index 8094b34bbf..cdd2abc80f 100644
--- a/src/3rdparty/pcre/pcre_get.c
+++ b/src/3rdparty/pcre/pcre_get.c
@@ -250,6 +250,7 @@ Arguments:
code the compiled regex
stringname the name of the capturing substring
ovector the vector of matched substrings
+ stringcount number of captured substrings
Returns: the number of the first that is set,
or the number of the last one if none are set,
@@ -258,13 +259,16 @@ Returns: the number of the first that is set,
#if defined COMPILE_PCRE8
static int
-get_first_set(const pcre *code, const char *stringname, int *ovector)
+get_first_set(const pcre *code, const char *stringname, int *ovector,
+ int stringcount)
#elif defined COMPILE_PCRE16
static int
-get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector)
+get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector,
+ int stringcount)
#elif defined COMPILE_PCRE32
static int
-get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector)
+get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector,
+ int stringcount)
#endif
{
const REAL_PCRE *re = (const REAL_PCRE *)code;
@@ -295,7 +299,7 @@ if (entrysize <= 0) return entrysize;
for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize)
{
int n = GET2(entry, 0);
- if (ovector[n*2] >= 0) return n;
+ if (n < stringcount && ovector[n*2] >= 0) return n;
}
return GET2(entry, 0);
}
@@ -402,7 +406,7 @@ pcre32_copy_named_substring(const pcre32 *code, PCRE_SPTR32 subject,
PCRE_UCHAR32 *buffer, int size)
#endif
{
-int n = get_first_set(code, stringname, ovector);
+int n = get_first_set(code, stringname, ovector, stringcount);
if (n <= 0) return n;
#if defined COMPILE_PCRE8
return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size);
@@ -457,7 +461,10 @@ pcre_uchar **stringlist;
pcre_uchar *p;
for (i = 0; i < double_count; i += 2)
- size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1);
+ {
+ size += sizeof(pcre_uchar *) + IN_UCHARS(1);
+ if (ovector[i+1] > ovector[i]) size += IN_UCHARS(ovector[i+1] - ovector[i]);
+ }
stringlist = (pcre_uchar **)(PUBL(malloc))(size);
if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
@@ -473,7 +480,7 @@ p = (pcre_uchar *)(stringlist + stringcount + 1);
for (i = 0; i < double_count; i += 2)
{
- int len = ovector[i+1] - ovector[i];
+ int len = (ovector[i+1] > ovector[i])? (ovector[i+1] - ovector[i]) : 0;
memcpy(p, subject + ovector[i], IN_UCHARS(len));
*stringlist++ = p;
p += len;
@@ -619,7 +626,7 @@ pcre32_get_named_substring(const pcre32 *code, PCRE_SPTR32 subject,
PCRE_SPTR32 *stringptr)
#endif
{
-int n = get_first_set(code, stringname, ovector);
+int n = get_first_set(code, stringname, ovector, stringcount);
if (n <= 0) return n;
#if defined COMPILE_PCRE8
return pcre_get_substring(subject, ovector, stringcount, n, stringptr);
diff --git a/src/3rdparty/pcre/pcre_internal.h b/src/3rdparty/pcre/pcre_internal.h
index 544d9c0709..f7a5ee7aa6 100644
--- a/src/3rdparty/pcre/pcre_internal.h
+++ b/src/3rdparty/pcre/pcre_internal.h
@@ -2454,7 +2454,7 @@ typedef struct compile_data {
BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */
BOOL check_lookbehind; /* Lookbehinds need later checking */
BOOL dupnames; /* Duplicate names exist */
- BOOL dupgroups; /* Duplicate groups exist: (?| found */
+ BOOL dupgroups; /* Duplicate groups exist: (?| found */
BOOL iscondassert; /* Next assert is a condition */
int nltype; /* Newline type */
int nllen; /* Newline string length */
diff --git a/src/3rdparty/pcre/pcre_jit_compile.c b/src/3rdparty/pcre/pcre_jit_compile.c
index 868d1d91bf..445de0cbef 100644
--- a/src/3rdparty/pcre/pcre_jit_compile.c
+++ b/src/3rdparty/pcre/pcre_jit_compile.c
@@ -4342,8 +4342,10 @@ switch(length)
case 4:
if ((ranges[1] - ranges[0]) == (ranges[3] - ranges[2])
&& (ranges[0] | (ranges[2] - ranges[0])) == ranges[2]
+ && (ranges[1] & (ranges[2] - ranges[0])) == 0
&& is_powerof2(ranges[2] - ranges[0]))
{
+ SLJIT_ASSERT((ranges[0] & (ranges[2] - ranges[0])) == 0 && (ranges[2] & ranges[3] & (ranges[2] - ranges[0])) != 0);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, ranges[2] - ranges[0]);
if (ranges[2] + 1 != ranges[3])
{
@@ -4931,9 +4933,10 @@ else if ((cc[-1] & XCL_MAP) != 0)
if (!check_class_ranges(common, (const pcre_uint8 *)cc, FALSE, TRUE, list))
{
#ifdef COMPILE_PCRE8
- SLJIT_ASSERT(common->utf);
+ jump = NULL;
+ if (common->utf)
#endif
- jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
+ jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
@@ -4942,7 +4945,10 @@ else if ((cc[-1] & XCL_MAP) != 0)
OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO));
- JUMPHERE(jump);
+#ifdef COMPILE_PCRE8
+ if (common->utf)
+#endif
+ JUMPHERE(jump);
}
OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
@@ -5250,7 +5256,7 @@ while (*cc != XCL_END)
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xff);
+ 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);
SET_TYPE_OFFSET(ucp_Pc);
@@ -8477,8 +8483,7 @@ while (cc < ccend)
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), STR_PTR, 0);
}
BACKTRACK_AS(braminzero_backtrack)->matchingpath = LABEL();
- if (cc[1] > OP_ASSERTBACK_NOT)
- count_match(common);
+ count_match(common);
break;
case OP_ONCE:
@@ -9660,7 +9665,7 @@ static SLJIT_INLINE void compile_recurse(compiler_common *common)
DEFINE_COMPILER;
pcre_uchar *cc = common->start + common->currententry->start;
pcre_uchar *ccbegin = cc + 1 + LINK_SIZE + (*cc == OP_BRA ? 0 : IMM2_SIZE);
-pcre_uchar *ccend = bracketend(cc);
+pcre_uchar *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);
diff --git a/src/3rdparty/pcre/pcre_study.c b/src/3rdparty/pcre/pcre_study.c
index 932e9a7c4c..7fd0ba0b3d 100644
--- a/src/3rdparty/pcre/pcre_study.c
+++ b/src/3rdparty/pcre/pcre_study.c
@@ -71,7 +71,7 @@ Arguments:
startcode pointer to start of the whole pattern's code
options the compiling options
recurses chain of recurse_check to catch mutual recursion
- countptr pointer to call count (to catch over complexity)
+ countptr pointer to call count (to catch over complexity)
Returns: the minimum length
-1 if \C in UTF-8 mode or (*ACCEPT) was encountered
diff --git a/src/3rdparty/pcre/pcre_xclass.c b/src/3rdparty/pcre/pcre_xclass.c
index c2b61f0f92..ef759a589a 100644
--- a/src/3rdparty/pcre/pcre_xclass.c
+++ b/src/3rdparty/pcre/pcre_xclass.c
@@ -246,7 +246,7 @@ while ((t = *data++) != XCL_END)
case PT_PXPUNCT:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||
- (c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
+ (c < 128 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
return !negated;
break;
diff --git a/src/3rdparty/pcre/sljit/sljitLir.h b/src/3rdparty/pcre/sljit/sljitLir.h
index f0969dac2e..2e2e9ac09c 100644
--- a/src/3rdparty/pcre/sljit/sljitLir.h
+++ b/src/3rdparty/pcre/sljit/sljitLir.h
@@ -869,34 +869,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op2(struct sljit_compiler *compiler
sljit_si src1, sljit_sw src1w,
sljit_si src2, sljit_sw src2w);
-/* The following function is a helper function for sljit_emit_op_custom.
- It returns with the real machine register index ( >=0 ) of any SLJIT_R,
- SLJIT_S and SLJIT_SP registers.
-
- Note: it returns with -1 for virtual registers (only on x86-32). */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
-
-/* The following function is a helper function for sljit_emit_op_custom.
- It returns with the real machine register index of any SLJIT_FLOAT register.
-
- Note: the index is always an even number on ARM (except ARM-64), MIPS, and SPARC. */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
-
-/* Any instruction can be inserted into the instruction stream by
- sljit_emit_op_custom. It has a similar purpose as inline assembly.
- The size parameter must match to the instruction size of the target
- architecture:
-
- x86: 0 < size <= 15. The instruction argument can be byte aligned.
- Thumb2: if size == 2, the instruction argument must be 2 byte aligned.
- if size == 4, the instruction argument must be 4 byte aligned.
- Otherwise: size must be 4 and instruction argument must be 4 byte aligned. */
-
-SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
- void *instruction, sljit_si size);
-
/* Returns with non-zero if fpu is available. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_is_fpu_available(void);
@@ -1214,4 +1186,64 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr, struct
#endif /* !(defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) */
+/* --------------------------------------------------------------------- */
+/* CPU specific functions */
+/* --------------------------------------------------------------------- */
+
+/* The following function is a helper function for sljit_emit_op_custom.
+ It returns with the real machine register index ( >=0 ) of any SLJIT_R,
+ SLJIT_S and SLJIT_SP registers.
+
+ Note: it returns with -1 for virtual registers (only on x86-32). */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
+
+/* The following function is a helper function for sljit_emit_op_custom.
+ It returns with the real machine register index of any SLJIT_FLOAT register.
+
+ Note: the index is always an even number on ARM (except ARM-64), MIPS, and SPARC. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
+
+/* Any instruction can be inserted into the instruction stream by
+ sljit_emit_op_custom. It has a similar purpose as inline assembly.
+ The size parameter must match to the instruction size of the target
+ architecture:
+
+ x86: 0 < size <= 15. The instruction argument can be byte aligned.
+ Thumb2: if size == 2, the instruction argument must be 2 byte aligned.
+ if size == 4, the instruction argument must be 4 byte aligned.
+ Otherwise: size must be 4 and instruction argument must be 4 byte aligned. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
+ void *instruction, sljit_si size);
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+
+/* Returns with non-zero if sse2 is available. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_sse2_available(void);
+
+/* Returns with non-zero if cmov instruction is available. */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si 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_INT_OP to perform 32 bit arithmetic
+ Flags: I - (never set any flags)
+ */
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_emit_cmov(struct sljit_compiler *compiler,
+ sljit_si type,
+ sljit_si dst_reg,
+ sljit_si src, sljit_sw srcw);
+
+#endif
+
#endif /* _SLJIT_LIR_H_ */
diff --git a/src/3rdparty/pcre/sljit/sljitNativeX86_common.c b/src/3rdparty/pcre/sljit/sljitNativeX86_common.c
index e148c34cd1..416c15afaf 100644
--- a/src/3rdparty/pcre/sljit/sljitNativeX86_common.c
+++ b/src/3rdparty/pcre/sljit/sljitNativeX86_common.c
@@ -2936,3 +2936,69 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
{
*(sljit_sw*)addr = new_constant;
}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si 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_si sljit_x86_is_cmov_available(void)
+{
+ if (cpu_has_cmov == -1)
+ get_cpu_features();
+ return cpu_has_cmov;
+}
+
+SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_emit_cmov(struct sljit_compiler *compiler,
+ sljit_si type,
+ sljit_si dst_reg,
+ sljit_si src, sljit_sw srcw)
+{
+ sljit_ub* inst;
+
+ CHECK_ERROR();
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+ CHECK_ARGUMENT(sljit_x86_is_cmov_available());
+ CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_INT_OP)));
+ CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_D_ORDERED);
+ CHECK_ARGUMENT(FUNCTION_CHECK_IS_REG(dst_reg & ~SLJIT_INT_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_INT_OP) ? "" : ".i",
+ JUMP_PREFIX(type), jump_names[type & 0xff]);
+ sljit_verbose_reg(compiler, dst_reg & ~SLJIT_INT_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_INT_OP;
+#endif
+ dst_reg &= ~SLJIT_INT_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/pixman/pixman-arm-neon-asm.S b/src/3rdparty/pixman/pixman-arm-neon-asm.S
index eb8cc4c966..bd9371eadb 100644
--- a/src/3rdparty/pixman/pixman-arm-neon-asm.S
+++ b/src/3rdparty/pixman/pixman-arm-neon-asm.S
@@ -34,6 +34,8 @@
* - pixman_composite_over_n_8_0565_asm_neon
*/
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
+
/* Prevent the stack from becoming executable for no reason... */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
@@ -1707,3 +1709,5 @@ generate_composite_function \
0, /* dst_r_basereg */ \
0, /* src_basereg */ \
0 /* mask_basereg */
+
+#endif \ No newline at end of file
diff --git a/src/3rdparty/png_dependency.pri b/src/3rdparty/png_dependency.pri
new file mode 100644
index 0000000000..78da861f77
--- /dev/null
+++ b/src/3rdparty/png_dependency.pri
@@ -0,0 +1,6 @@
+contains(QT_CONFIG, system-png) {
+ unix|mingw: LIBS_PRIVATE += -lpng
+ else: LIBS += libpng.lib
+} else: contains(QT_CONFIG, png) {
+ include($$PWD/libpng.pri)
+}
diff --git a/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros b/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros
index c0c9029873..c0c9029873 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros
diff --git a/src/3rdparty/sha3/KeccakF-1600-32.macros b/src/3rdparty/sha3/KeccakF-1600-32.macros
index 9ade600067..9ade600067 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-32.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-32.macros
diff --git a/src/3rdparty/sha3/KeccakF-1600-64.macros b/src/3rdparty/sha3/KeccakF-1600-64.macros
index 0c20bca40f..0c20bca40f 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-64.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-64.macros
diff --git a/src/3rdparty/sha3/KeccakF-1600-int-set.h b/src/3rdparty/sha3/KeccakF-1600-int-set.h
index 0ed1d802e3..0ed1d802e3 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-int-set.h
+++ b/src/3rdparty/sha3/KeccakF-1600-int-set.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-interface.h b/src/3rdparty/sha3/KeccakF-1600-interface.h
index ce2710eeb2..ce2710eeb2 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-interface.h
+++ b/src/3rdparty/sha3/KeccakF-1600-interface.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h b/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h
index b135918ca9..b135918ca9 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h
+++ b/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt32.c b/src/3rdparty/sha3/KeccakF-1600-opt32.c
index 4e32dca9cb..7d8ae6e19c 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt32.c
+++ b/src/3rdparty/sha3/KeccakF-1600-opt32.c
@@ -191,10 +191,10 @@ static UINT64 fromInterleaving(UINT64 x)
return x;
}
-static void setInterleavedWordsInto8bytes(UINT8* dest, UINT32* evenAndOdd)
+static void setInterleavedWordsInto8bytes(UINT8* dest, const UINT32* evenAndOdd)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
- ((UINT64*)dest)[0] = fromInterleaving(*(UINT64*)evenAndOdd);
+ ((UINT64*)dest)[0] = fromInterleaving(*(const UINT64*)evenAndOdd);
#else // (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN)
// This can be optimized
UINT64 evenAndOddWord = (UINT64)evenAndOdd[0] ^ ((UINT64)evenAndOdd[1] << 32);
@@ -214,7 +214,7 @@ static void setInterleavedWordsInto8bytes(UINT8* dest, UINT32* evenAndOdd)
{ \
unsigned i; \
for(i=0; i<(laneCount); i++) \
- setInterleavedWordsInto8bytes(data+i*8, (UINT32*)state+i*2); \
+ setInterleavedWordsInto8bytes(data+i*8, (const UINT32*)state+i*2); \
}
#endif // With or without interleaving tables
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h b/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h
index 8f16ada636..8f16ada636 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h
+++ b/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-unrolling.macros b/src/3rdparty/sha3/KeccakF-1600-unrolling.macros
index 83c694ca48..83c694ca48 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-unrolling.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-unrolling.macros
diff --git a/src/3rdparty/sha3/KeccakNISTInterface.c b/src/3rdparty/sha3/KeccakNISTInterface.c
index e530a11db5..e530a11db5 100755..100644
--- a/src/3rdparty/sha3/KeccakNISTInterface.c
+++ b/src/3rdparty/sha3/KeccakNISTInterface.c
diff --git a/src/3rdparty/sha3/KeccakNISTInterface.h b/src/3rdparty/sha3/KeccakNISTInterface.h
index cd85f24aa7..cd85f24aa7 100755..100644
--- a/src/3rdparty/sha3/KeccakNISTInterface.h
+++ b/src/3rdparty/sha3/KeccakNISTInterface.h
diff --git a/src/3rdparty/sha3/KeccakSponge.c b/src/3rdparty/sha3/KeccakSponge.c
index 6f3da95dbb..6f3da95dbb 100755..100644
--- a/src/3rdparty/sha3/KeccakSponge.c
+++ b/src/3rdparty/sha3/KeccakSponge.c
diff --git a/src/3rdparty/sha3/KeccakSponge.h b/src/3rdparty/sha3/KeccakSponge.h
index 8bb11a8a1d..8bb11a8a1d 100755..100644
--- a/src/3rdparty/sha3/KeccakSponge.h
+++ b/src/3rdparty/sha3/KeccakSponge.h
diff --git a/src/3rdparty/sha3/brg_endian.h b/src/3rdparty/sha3/brg_endian.h
index 7226eb3bec..7226eb3bec 100755..100644
--- a/src/3rdparty/sha3/brg_endian.h
+++ b/src/3rdparty/sha3/brg_endian.h
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index ff78701615..06f6d154f1 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -35209,6 +35209,7 @@ static void winLogIoerr(int nRetry, int lineno){
** create a substitute.
*/
/* #include <time.h> */
+# if _WIN32_WCE < 0x800
struct tm *__cdecl localtime(const time_t *t)
{
static struct tm y;
@@ -35230,6 +35231,7 @@ struct tm *__cdecl localtime(const time_t *t)
y.tm_sec = pTm.wSecond;
return &y;
}
+# endif
#endif
#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)]
diff --git a/src/3rdparty/xcb/README b/src/3rdparty/xcb/README
index 4de7a17409..d7c8eba294 100644
--- a/src/3rdparty/xcb/README
+++ b/src/3rdparty/xcb/README
@@ -1,6 +1,6 @@
Contains the header and sources files from selected xcb libraries:
- libxcb-1.5 together with xcb-proto-1.6 (sync, xfixes, randr sources)
+ libxcb-1.5 together with xcb-proto-1.6 (sync, xfixes, randr, xinerama sources)
# libxkbcommon-x11 requires libxcb-xkb >= 1.10
libxcb-1.10 together with xcb-proto-1.10 (xkb sources)
libxcb-util-image-0.3.9
diff --git a/src/3rdparty/xcb/include/xcb/xinerama.h b/src/3rdparty/xcb/include/xcb/xinerama.h
new file mode 100644
index 0000000000..74da5458d2
--- /dev/null
+++ b/src/3rdparty/xcb/include/xcb/xinerama.h
@@ -0,0 +1,808 @@
+/*
+ * This file generated automatically from xinerama.xml by c_client.py.
+ * Edit at your peril.
+ */
+
+/**
+ * @defgroup XCB_Xinerama_API XCB Xinerama API
+ * @brief Xinerama XCB Protocol Implementation.
+ * @{
+ **/
+
+#ifndef __XINERAMA_H
+#define __XINERAMA_H
+
+#include "xcb.h"
+#include "xproto.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define XCB_XINERAMA_MAJOR_VERSION 1
+#define XCB_XINERAMA_MINOR_VERSION 1
+
+extern xcb_extension_t xcb_xinerama_id;
+
+/**
+ * @brief xcb_xinerama_screen_info_t
+ **/
+typedef struct xcb_xinerama_screen_info_t {
+ int16_t x_org; /**< */
+ int16_t y_org; /**< */
+ uint16_t width; /**< */
+ uint16_t height; /**< */
+} xcb_xinerama_screen_info_t;
+
+/**
+ * @brief xcb_xinerama_screen_info_iterator_t
+ **/
+typedef struct xcb_xinerama_screen_info_iterator_t {
+ xcb_xinerama_screen_info_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xinerama_screen_info_iterator_t;
+
+/**
+ * @brief xcb_xinerama_query_version_cookie_t
+ **/
+typedef struct xcb_xinerama_query_version_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xinerama_query_version_cookie_t;
+
+/** Opcode for xcb_xinerama_query_version. */
+#define XCB_XINERAMA_QUERY_VERSION 0
+
+/**
+ * @brief xcb_xinerama_query_version_request_t
+ **/
+typedef struct xcb_xinerama_query_version_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ uint8_t major; /**< */
+ uint8_t minor; /**< */
+} xcb_xinerama_query_version_request_t;
+
+/**
+ * @brief xcb_xinerama_query_version_reply_t
+ **/
+typedef struct xcb_xinerama_query_version_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t pad0; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint16_t major; /**< */
+ uint16_t minor; /**< */
+} xcb_xinerama_query_version_reply_t;
+
+/**
+ * @brief xcb_xinerama_get_state_cookie_t
+ **/
+typedef struct xcb_xinerama_get_state_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xinerama_get_state_cookie_t;
+
+/** Opcode for xcb_xinerama_get_state. */
+#define XCB_XINERAMA_GET_STATE 1
+
+/**
+ * @brief xcb_xinerama_get_state_request_t
+ **/
+typedef struct xcb_xinerama_get_state_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_window_t window; /**< */
+} xcb_xinerama_get_state_request_t;
+
+/**
+ * @brief xcb_xinerama_get_state_reply_t
+ **/
+typedef struct xcb_xinerama_get_state_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t state; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ xcb_window_t window; /**< */
+} xcb_xinerama_get_state_reply_t;
+
+/**
+ * @brief xcb_xinerama_get_screen_count_cookie_t
+ **/
+typedef struct xcb_xinerama_get_screen_count_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xinerama_get_screen_count_cookie_t;
+
+/** Opcode for xcb_xinerama_get_screen_count. */
+#define XCB_XINERAMA_GET_SCREEN_COUNT 2
+
+/**
+ * @brief xcb_xinerama_get_screen_count_request_t
+ **/
+typedef struct xcb_xinerama_get_screen_count_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_window_t window; /**< */
+} xcb_xinerama_get_screen_count_request_t;
+
+/**
+ * @brief xcb_xinerama_get_screen_count_reply_t
+ **/
+typedef struct xcb_xinerama_get_screen_count_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t screen_count; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ xcb_window_t window; /**< */
+} xcb_xinerama_get_screen_count_reply_t;
+
+/**
+ * @brief xcb_xinerama_get_screen_size_cookie_t
+ **/
+typedef struct xcb_xinerama_get_screen_size_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xinerama_get_screen_size_cookie_t;
+
+/** Opcode for xcb_xinerama_get_screen_size. */
+#define XCB_XINERAMA_GET_SCREEN_SIZE 3
+
+/**
+ * @brief xcb_xinerama_get_screen_size_request_t
+ **/
+typedef struct xcb_xinerama_get_screen_size_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_window_t window; /**< */
+ uint32_t screen; /**< */
+} xcb_xinerama_get_screen_size_request_t;
+
+/**
+ * @brief xcb_xinerama_get_screen_size_reply_t
+ **/
+typedef struct xcb_xinerama_get_screen_size_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t pad0; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t width; /**< */
+ uint32_t height; /**< */
+ xcb_window_t window; /**< */
+ uint32_t screen; /**< */
+} xcb_xinerama_get_screen_size_reply_t;
+
+/**
+ * @brief xcb_xinerama_is_active_cookie_t
+ **/
+typedef struct xcb_xinerama_is_active_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xinerama_is_active_cookie_t;
+
+/** Opcode for xcb_xinerama_is_active. */
+#define XCB_XINERAMA_IS_ACTIVE 4
+
+/**
+ * @brief xcb_xinerama_is_active_request_t
+ **/
+typedef struct xcb_xinerama_is_active_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+} xcb_xinerama_is_active_request_t;
+
+/**
+ * @brief xcb_xinerama_is_active_reply_t
+ **/
+typedef struct xcb_xinerama_is_active_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t pad0; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t state; /**< */
+} xcb_xinerama_is_active_reply_t;
+
+/**
+ * @brief xcb_xinerama_query_screens_cookie_t
+ **/
+typedef struct xcb_xinerama_query_screens_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xinerama_query_screens_cookie_t;
+
+/** Opcode for xcb_xinerama_query_screens. */
+#define XCB_XINERAMA_QUERY_SCREENS 5
+
+/**
+ * @brief xcb_xinerama_query_screens_request_t
+ **/
+typedef struct xcb_xinerama_query_screens_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+} xcb_xinerama_query_screens_request_t;
+
+/**
+ * @brief xcb_xinerama_query_screens_reply_t
+ **/
+typedef struct xcb_xinerama_query_screens_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t pad0; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t number; /**< */
+ uint8_t pad1[20]; /**< */
+} xcb_xinerama_query_screens_reply_t;
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xinerama_screen_info_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xinerama_screen_info_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xinerama_screen_info_next
+ **
+ ** @param xcb_xinerama_screen_info_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xinerama_screen_info_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xinerama_screen_info_end
+ **
+ ** @param xcb_xinerama_screen_info_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version
+ **
+ ** @param xcb_connection_t *c
+ ** @param uint8_t major
+ ** @param uint8_t minor
+ ** @returns xcb_xinerama_query_version_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_version_cookie_t
+xcb_xinerama_query_version (xcb_connection_t *c /**< */,
+ uint8_t major /**< */,
+ uint8_t minor /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ * This form can be used only if the request will cause
+ * a reply to be generated. Any returned error will be
+ * placed in the event queue.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param uint8_t major
+ ** @param uint8_t minor
+ ** @returns xcb_xinerama_query_version_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_version_cookie_t
+xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */,
+ uint8_t major /**< */,
+ uint8_t minor /**< */);
+
+/**
+ * Return the reply
+ * @param c The connection
+ * @param cookie The cookie
+ * @param e The xcb_generic_error_t supplied
+ *
+ * Returns the reply of the request asked by
+ *
+ * The parameter @p e supplied to this function must be NULL if
+ * xcb_xinerama_query_version_unchecked(). is used.
+ * Otherwise, it stores the error if any.
+ *
+ * The returned value must be freed by the caller using free().
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_query_version_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_query_version_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_version_reply_t *
+xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_query_version_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_state_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_state_cookie_t
+xcb_xinerama_get_state (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ * This form can be used only if the request will cause
+ * a reply to be generated. Any returned error will be
+ * placed in the event queue.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_state_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_state_cookie_t
+xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */);
+
+/**
+ * Return the reply
+ * @param c The connection
+ * @param cookie The cookie
+ * @param e The xcb_generic_error_t supplied
+ *
+ * Returns the reply of the request asked by
+ *
+ * The parameter @p e supplied to this function must be NULL if
+ * xcb_xinerama_get_state_unchecked(). is used.
+ * Otherwise, it stores the error if any.
+ *
+ * The returned value must be freed by the caller using free().
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_get_state_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_get_state_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_state_reply_t *
+xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_get_state_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_screen_count_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_count_cookie_t
+xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ * This form can be used only if the request will cause
+ * a reply to be generated. Any returned error will be
+ * placed in the event queue.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_screen_count_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_count_cookie_t
+xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */);
+
+/**
+ * Return the reply
+ * @param c The connection
+ * @param cookie The cookie
+ * @param e The xcb_generic_error_t supplied
+ *
+ * Returns the reply of the request asked by
+ *
+ * The parameter @p e supplied to this function must be NULL if
+ * xcb_xinerama_get_screen_count_unchecked(). is used.
+ * Otherwise, it stores the error if any.
+ *
+ * The returned value must be freed by the caller using free().
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_get_screen_count_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_get_screen_count_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_count_reply_t *
+xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_get_screen_count_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @param uint32_t screen
+ ** @returns xcb_xinerama_get_screen_size_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_size_cookie_t
+xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */,
+ uint32_t screen /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ * This form can be used only if the request will cause
+ * a reply to be generated. Any returned error will be
+ * placed in the event queue.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @param uint32_t screen
+ ** @returns xcb_xinerama_get_screen_size_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_size_cookie_t
+xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */,
+ uint32_t screen /**< */);
+
+/**
+ * Return the reply
+ * @param c The connection
+ * @param cookie The cookie
+ * @param e The xcb_generic_error_t supplied
+ *
+ * Returns the reply of the request asked by
+ *
+ * The parameter @p e supplied to this function must be NULL if
+ * xcb_xinerama_get_screen_size_unchecked(). is used.
+ * Otherwise, it stores the error if any.
+ *
+ * The returned value must be freed by the caller using free().
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_get_screen_size_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_get_screen_size_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_size_reply_t *
+xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_get_screen_size_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_is_active_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_is_active_cookie_t
+xcb_xinerama_is_active (xcb_connection_t *c /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ * This form can be used only if the request will cause
+ * a reply to be generated. Any returned error will be
+ * placed in the event queue.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_is_active_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_is_active_cookie_t
+xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */);
+
+/**
+ * Return the reply
+ * @param c The connection
+ * @param cookie The cookie
+ * @param e The xcb_generic_error_t supplied
+ *
+ * Returns the reply of the request asked by
+ *
+ * The parameter @p e supplied to this function must be NULL if
+ * xcb_xinerama_is_active_unchecked(). is used.
+ * Otherwise, it stores the error if any.
+ *
+ * The returned value must be freed by the caller using free().
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_is_active_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_is_active_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_is_active_reply_t *
+xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_is_active_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_query_screens_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_screens_cookie_t
+xcb_xinerama_query_screens (xcb_connection_t *c /**< */);
+
+/**
+ * Delivers a request to the X server
+ * @param c The connection
+ * @return A cookie
+ *
+ * Delivers a request to the X server.
+ *
+ * This form can be used only if the request will cause
+ * a reply to be generated. Any returned error will be
+ * placed in the event queue.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_query_screens_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_screens_cookie_t
+xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */);
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info
+ **
+ ** @param const xcb_xinerama_query_screens_reply_t *R
+ ** @returns xcb_xinerama_screen_info_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_screen_info_t *
+xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */);
+
+
+/*****************************************************************************
+ **
+ ** int xcb_xinerama_query_screens_screen_info_length
+ **
+ ** @param const xcb_xinerama_query_screens_reply_t *R
+ ** @returns int
+ **
+ *****************************************************************************/
+
+int
+xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */);
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator
+ **
+ ** @param const xcb_xinerama_query_screens_reply_t *R
+ ** @returns xcb_xinerama_screen_info_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_screen_info_iterator_t
+xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */);
+
+/**
+ * Return the reply
+ * @param c The connection
+ * @param cookie The cookie
+ * @param e The xcb_generic_error_t supplied
+ *
+ * Returns the reply of the request asked by
+ *
+ * The parameter @p e supplied to this function must be NULL if
+ * xcb_xinerama_query_screens_unchecked(). is used.
+ * Otherwise, it stores the error if any.
+ *
+ * The returned value must be freed by the caller using free().
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_query_screens_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_query_screens_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_screens_reply_t *
+xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_query_screens_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/**
+ * @}
+ */
diff --git a/src/3rdparty/xcb/libxcb/xinerama.c b/src/3rdparty/xcb/libxcb/xinerama.c
new file mode 100644
index 0000000000..05b6b73707
--- /dev/null
+++ b/src/3rdparty/xcb/libxcb/xinerama.c
@@ -0,0 +1,655 @@
+/*
+ * This file generated automatically from xinerama.xml by c_client.py.
+ * Edit at your peril.
+ */
+
+#include <string.h>
+#include <assert.h>
+#include "xcbext.h"
+#include "xinerama.h"
+#include "xproto.h"
+
+xcb_extension_t xcb_xinerama_id = { "XINERAMA", 0 };
+
+
+/*****************************************************************************
+ **
+ ** void xcb_xinerama_screen_info_next
+ **
+ ** @param xcb_xinerama_screen_info_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */)
+{
+ --i->rem;
+ ++i->data;
+ i->index += sizeof(xcb_xinerama_screen_info_t);
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xinerama_screen_info_end
+ **
+ ** @param xcb_xinerama_screen_info_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */)
+{
+ xcb_generic_iterator_t ret;
+ ret.data = i.data + i.rem;
+ ret.index = i.index + ((char *) ret.data - (char *) i.data);
+ ret.rem = 0;
+ return ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version
+ **
+ ** @param xcb_connection_t *c
+ ** @param uint8_t major
+ ** @param uint8_t minor
+ ** @returns xcb_xinerama_query_version_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_version_cookie_t
+xcb_xinerama_query_version (xcb_connection_t *c /**< */,
+ uint8_t major /**< */,
+ uint8_t minor /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_QUERY_VERSION,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_query_version_cookie_t xcb_ret;
+ xcb_xinerama_query_version_request_t xcb_out;
+
+ xcb_out.major = major;
+ xcb_out.minor = minor;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param uint8_t major
+ ** @param uint8_t minor
+ ** @returns xcb_xinerama_query_version_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_version_cookie_t
+xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */,
+ uint8_t major /**< */,
+ uint8_t minor /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_QUERY_VERSION,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_query_version_cookie_t xcb_ret;
+ xcb_xinerama_query_version_request_t xcb_out;
+
+ xcb_out.major = major;
+ xcb_out.minor = minor;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_query_version_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_query_version_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_version_reply_t *
+xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_query_version_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */)
+{
+ return (xcb_xinerama_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_state_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_state_cookie_t
+xcb_xinerama_get_state (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_GET_STATE,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_get_state_cookie_t xcb_ret;
+ xcb_xinerama_get_state_request_t xcb_out;
+
+ xcb_out.window = window;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_state_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_state_cookie_t
+xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_GET_STATE,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_get_state_cookie_t xcb_ret;
+ xcb_xinerama_get_state_request_t xcb_out;
+
+ xcb_out.window = window;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_get_state_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_get_state_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_state_reply_t *
+xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_get_state_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */)
+{
+ return (xcb_xinerama_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_screen_count_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_count_cookie_t
+xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_get_screen_count_cookie_t xcb_ret;
+ xcb_xinerama_get_screen_count_request_t xcb_out;
+
+ xcb_out.window = window;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @returns xcb_xinerama_get_screen_count_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_count_cookie_t
+xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_get_screen_count_cookie_t xcb_ret;
+ xcb_xinerama_get_screen_count_request_t xcb_out;
+
+ xcb_out.window = window;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_get_screen_count_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_get_screen_count_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_count_reply_t *
+xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_get_screen_count_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */)
+{
+ return (xcb_xinerama_get_screen_count_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @param uint32_t screen
+ ** @returns xcb_xinerama_get_screen_size_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_size_cookie_t
+xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */,
+ uint32_t screen /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_get_screen_size_cookie_t xcb_ret;
+ xcb_xinerama_get_screen_size_request_t xcb_out;
+
+ xcb_out.window = window;
+ xcb_out.screen = screen;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_window_t window
+ ** @param uint32_t screen
+ ** @returns xcb_xinerama_get_screen_size_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_size_cookie_t
+xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */,
+ xcb_window_t window /**< */,
+ uint32_t screen /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_get_screen_size_cookie_t xcb_ret;
+ xcb_xinerama_get_screen_size_request_t xcb_out;
+
+ xcb_out.window = window;
+ xcb_out.screen = screen;
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_get_screen_size_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_get_screen_size_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_get_screen_size_reply_t *
+xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_get_screen_size_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */)
+{
+ return (xcb_xinerama_get_screen_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_is_active_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_is_active_cookie_t
+xcb_xinerama_is_active (xcb_connection_t *c /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_IS_ACTIVE,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_is_active_cookie_t xcb_ret;
+ xcb_xinerama_is_active_request_t xcb_out;
+
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_is_active_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_is_active_cookie_t
+xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_IS_ACTIVE,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_is_active_cookie_t xcb_ret;
+ xcb_xinerama_is_active_request_t xcb_out;
+
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_is_active_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_is_active_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_is_active_reply_t *
+xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_is_active_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */)
+{
+ return (xcb_xinerama_is_active_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_query_screens_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_screens_cookie_t
+xcb_xinerama_query_screens (xcb_connection_t *c /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_QUERY_SCREENS,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_query_screens_cookie_t xcb_ret;
+ xcb_xinerama_query_screens_request_t xcb_out;
+
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked
+ **
+ ** @param xcb_connection_t *c
+ ** @returns xcb_xinerama_query_screens_cookie_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_screens_cookie_t
+xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */)
+{
+ static const xcb_protocol_request_t xcb_req = {
+ /* count */ 2,
+ /* ext */ &xcb_xinerama_id,
+ /* opcode */ XCB_XINERAMA_QUERY_SCREENS,
+ /* isvoid */ 0
+ };
+
+ struct iovec xcb_parts[4];
+ xcb_xinerama_query_screens_cookie_t xcb_ret;
+ xcb_xinerama_query_screens_request_t xcb_out;
+
+
+ xcb_parts[2].iov_base = (char *) &xcb_out;
+ xcb_parts[2].iov_len = sizeof(xcb_out);
+ xcb_parts[3].iov_base = 0;
+ xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
+ xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
+ return xcb_ret;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info
+ **
+ ** @param const xcb_xinerama_query_screens_reply_t *R
+ ** @returns xcb_xinerama_screen_info_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_screen_info_t *
+xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */)
+{
+ return (xcb_xinerama_screen_info_t *) (R + 1);
+}
+
+
+/*****************************************************************************
+ **
+ ** int xcb_xinerama_query_screens_screen_info_length
+ **
+ ** @param const xcb_xinerama_query_screens_reply_t *R
+ ** @returns int
+ **
+ *****************************************************************************/
+
+int
+xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */)
+{
+ return R->number;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator
+ **
+ ** @param const xcb_xinerama_query_screens_reply_t *R
+ ** @returns xcb_xinerama_screen_info_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_xinerama_screen_info_iterator_t
+xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */)
+{
+ xcb_xinerama_screen_info_iterator_t i;
+ i.data = (xcb_xinerama_screen_info_t *) (R + 1);
+ i.rem = R->number;
+ i.index = (char *) i.data - (char *) R;
+ return i;
+}
+
+
+/*****************************************************************************
+ **
+ ** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply
+ **
+ ** @param xcb_connection_t *c
+ ** @param xcb_xinerama_query_screens_cookie_t cookie
+ ** @param xcb_generic_error_t **e
+ ** @returns xcb_xinerama_query_screens_reply_t *
+ **
+ *****************************************************************************/
+
+xcb_xinerama_query_screens_reply_t *
+xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */,
+ xcb_xinerama_query_screens_cookie_t cookie /**< */,
+ xcb_generic_error_t **e /**< */)
+{
+ return (xcb_xinerama_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
+}
+
diff --git a/src/3rdparty/zlib/0001-Fix-WEC2013-build-of-zlib.patch b/src/3rdparty/zlib/0001-Fix-WEC2013-build-of-zlib.patch
new file mode 100644
index 0000000000..ef6fb33eed
--- /dev/null
+++ b/src/3rdparty/zlib/0001-Fix-WEC2013-build-of-zlib.patch
@@ -0,0 +1,26 @@
+From f2652cfd83f34ec3e70a936e5ea9f8623b66bd95 Mon Sep 17 00:00:00 2001
+From: Bjoern Breitmeyer <bjoern.breitmeyer@kdab.com>
+Date: Fri, 27 Mar 2015 15:46:59 +0100
+Subject: [PATCH] Fix WEC2013 build of zlib.
+
+Change-Id: I4d1908f1175ed39e2df8717fb0b5a17befe88744
+---
+ src/3rdparty/zlib/zutil.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h
+index 8e535ac..4d367a9 100644
+--- a/src/3rdparty/zlib/zutil.h
++++ b/src/3rdparty/zlib/zutil.h
+@@ -143,7 +143,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+ #endif
+
+ #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
+-# if defined(_WIN32_WCE)
++# if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
+ # define fdopen(fd,mode) NULL /* No fdopen() */
+ # ifndef _PTRDIFF_T_DEFINED
+ typedef int ptrdiff_t;
+--
+1.8.1.msysgit.1
+
diff --git a/src/3rdparty/zlib/zlib.h b/src/3rdparty/zlib/zlib.h
index 5229707f52..d0908ab6e9 100644
--- a/src/3rdparty/zlib/zlib.h
+++ b/src/3rdparty/zlib/zlib.h
@@ -34,13 +34,8 @@
#include "zconf.h"
#include <qglobal.h>
-#if defined(QT_VISIBILITY_AVAILABLE)
-# undef ZEXTERN
-# define ZEXTERN __attribute__((visibility("default")))
-#else
-# undef ZEXTERN
-# define ZEXTERN Q_DECL_EXPORT
-#endif
+#undef ZEXTERN
+#define ZEXTERN Q_CORE_EXPORT
#ifdef __cplusplus
extern "C" {
diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h
index 8e535acf40..4d367a92db 100644
--- a/src/3rdparty/zlib/zutil.h
+++ b/src/3rdparty/zlib/zutil.h
@@ -143,7 +143,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
-# if defined(_WIN32_WCE)
+# if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED
typedef int ptrdiff_t;
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 3e55164419..dd5a7b4fec 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -59,12 +59,15 @@ import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
+import android.view.ViewTreeObserver;
+import android.graphics.Rect;
import java.io.BufferedReader;
import java.io.DataOutputStream;
@@ -76,7 +79,6 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
public class QtActivityDelegate
{
@@ -89,6 +91,7 @@ public class QtActivityDelegate
private Method m_super_onKeyUp = null;
private Method m_super_onConfigurationChanged = null;
private Method m_super_onActivityResult = null;
+ private Method m_super_dispatchGenericMotionEvent = null;
private static final String NATIVE_LIBRARIES_KEY = "native.libraries";
private static final String BUNDLED_LIBRARIES_KEY = "bundled.libraries";
@@ -131,37 +134,32 @@ public class QtActivityDelegate
if (m_fullScreen = enterFullScreen) {
m_activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
m_activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- if (Build.VERSION.SDK_INT >= 19) {
- try {
- int ui_flag_immersive_sticky = View.class.getDeclaredField("SYSTEM_UI_FLAG_IMMERSIVE_STICKY").getInt(null);
- int ui_flag_layout_stable = View.class.getDeclaredField("SYSTEM_UI_FLAG_LAYOUT_STABLE").getInt(null);
- int ui_flag_layout_hide_navigation = View.class.getDeclaredField("SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION").getInt(null);
- int ui_flag_layout_fullscreen = View.class.getDeclaredField("SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN").getInt(null);
- int ui_flag_hide_navigation = View.class.getDeclaredField("SYSTEM_UI_FLAG_HIDE_NAVIGATION").getInt(null);
- int ui_flag_fullscreen = View.class.getDeclaredField("SYSTEM_UI_FLAG_FULLSCREEN").getInt(null);
-
+ try {
+ if (Build.VERSION.SDK_INT >= 14) {
+ int flags = View.class.getDeclaredField("SYSTEM_UI_FLAG_HIDE_NAVIGATION").getInt(null);
+ if (Build.VERSION.SDK_INT >= 16) {
+ flags |= View.class.getDeclaredField("SYSTEM_UI_FLAG_LAYOUT_STABLE").getInt(null);
+ flags |= View.class.getDeclaredField("SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION").getInt(null);
+ flags |= View.class.getDeclaredField("SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN").getInt(null);
+ flags |= View.class.getDeclaredField("SYSTEM_UI_FLAG_FULLSCREEN").getInt(null);
+
+ if (Build.VERSION.SDK_INT >= 19)
+ flags |= View.class.getDeclaredField("SYSTEM_UI_FLAG_IMMERSIVE_STICKY").getInt(null);
+ }
Method m = View.class.getMethod("setSystemUiVisibility", int.class);
- m.invoke(m_activity.getWindow().getDecorView(),
- ui_flag_layout_stable
- | ui_flag_layout_hide_navigation
- | ui_flag_layout_fullscreen
- | ui_flag_hide_navigation
- | ui_flag_fullscreen
- | ui_flag_immersive_sticky
- | View.INVISIBLE);
- } catch (Exception e) {
- e.printStackTrace();
+ m.invoke(m_activity.getWindow().getDecorView(), flags | View.INVISIBLE);
}
+ } catch (Exception e) {
+ e.printStackTrace();
}
} else {
m_activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
m_activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- if (Build.VERSION.SDK_INT >= 19) {
+ if (Build.VERSION.SDK_INT >= 14) {
try {
int ui_flag_visible = View.class.getDeclaredField("SYSTEM_UI_FLAG_VISIBLE").getInt(null);
Method m = View.class.getMethod("setSystemUiVisibility", int.class);
- m.invoke(m_activity.getWindow().getDecorView(),
- ui_flag_visible);
+ m.invoke(m_activity.getWindow().getDecorView(), ui_flag_visible);
} catch (Exception e) {
e.printStackTrace();
}
@@ -203,11 +201,21 @@ public class QtActivityDelegate
private final int ImhUrlCharactersOnly = 0x400000;
private final int ImhLatinOnly = 0x800000;
+ // enter key type - must be kept in sync with QTDIR/src/corelib/global/qnamespace.h
+ private final int EnterKeyDefault = 0;
+ private final int EnterKeyReturn = 1;
+ private final int EnterKeyDone = 2;
+ private final int EnterKeyGo = 3;
+ private final int EnterKeySend = 4;
+ private final int EnterKeySearch = 5;
+ private final int EnterKeyNext = 6;
+ private final int EnterKeyPrevious = 7;
+
// application state
- private final int ApplicationSuspended = 0x0;
- private final int ApplicationHidden = 0x1;
- private final int ApplicationInactive = 0x2;
- private final int ApplicationActive = 0x4;
+ public static final int ApplicationSuspended = 0x0;
+ public static final int ApplicationHidden = 0x1;
+ public static final int ApplicationInactive = 0x2;
+ public static final int ApplicationActive = 0x4;
public boolean setKeyboardVisibility(boolean visibility, long timeStamp)
@@ -239,7 +247,7 @@ public class QtActivityDelegate
}, 5);
}
- public void showSoftwareKeyboard(int x, int y, int width, int height, int inputHints)
+ public void showSoftwareKeyboard(int x, int y, int width, int height, int inputHints, int enterKeyType)
{
if (m_imm == null)
return;
@@ -258,7 +266,31 @@ public class QtActivityDelegate
}
int initialCapsMode = 0;
+
int imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
+
+ switch (enterKeyType) {
+ case EnterKeyReturn:
+ imeOptions = android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION;
+ break;
+ case EnterKeyGo:
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_GO;
+ break;
+ case EnterKeySend:
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_SEND;
+ break;
+ case EnterKeySearch:
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH;
+ break;
+ case EnterKeyNext:
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_NEXT;
+ break;
+ case EnterKeyPrevious:
+ if (Build.VERSION.SDK_INT > 10)
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_PREVIOUS;
+ break;
+ }
+
int inputType = android.text.InputType.TYPE_CLASS_TEXT;
if ((inputHints & (ImhPreferNumbers | ImhDigitsOnly | ImhFormattedNumbersOnly)) != 0) {
@@ -284,7 +316,9 @@ public class QtActivityDelegate
if ((inputHints & (ImhEmailCharactersOnly | ImhUrlCharactersOnly)) != 0) {
if ((inputHints & ImhUrlCharactersOnly) != 0) {
inputType |= android.text.InputType.TYPE_TEXT_VARIATION_URI;
- imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_GO;
+
+ if (enterKeyType == 0) // not explicitly overridden
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_GO;
} else if ((inputHints & ImhEmailCharactersOnly) != 0) {
inputType |= android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
}
@@ -311,7 +345,7 @@ public class QtActivityDelegate
}
}
- if ((inputHints & ImhMultiLine) != 0)
+ if (enterKeyType == 0 && (inputHints & ImhMultiLine) != 0)
imeOptions = android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION;
m_editText.setInitialCapsMode(initialCapsMode);
@@ -444,6 +478,13 @@ public class QtActivityDelegate
m_super_onKeyUp = m_activity.getClass().getMethod("super_onKeyUp", Integer.TYPE, KeyEvent.class);
m_super_onConfigurationChanged = m_activity.getClass().getMethod("super_onConfigurationChanged", Configuration.class);
m_super_onActivityResult = m_activity.getClass().getMethod("super_onActivityResult", Integer.TYPE, Integer.TYPE, Intent.class);
+ if (Build.VERSION.SDK_INT >= 12) {
+ try {
+ m_super_dispatchGenericMotionEvent = m_activity.getClass().getMethod("super_dispatchGenericMotionEvent", MotionEvent.class);
+ } catch (Exception e) {
+ }
+ }
+
} catch (Exception e) {
e.printStackTrace();
return false;
@@ -820,6 +861,25 @@ public class QtActivityDelegate
QtNative.handleOrientationChanged(rotation, m_nativeOrientation);
m_currentRotation = rotation;
+
+ m_layout.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
+ @Override
+ public boolean onPreDraw() {
+ if (!m_keyboardIsVisible)
+ return true;
+
+ Rect r = new Rect();
+ m_activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);
+ DisplayMetrics metrics = new DisplayMetrics();
+ m_activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ final int kbHeight = metrics.heightPixels - r.bottom;
+ final int[] location = new int[2];
+ m_layout.getLocationOnScreen(location);
+ QtNative.keyboardGeometryChanged(location[0], r.bottom - location[1],
+ r.width(), kbHeight);
+ return true;
+ }
+ });
}
public void initializeAccessibility()
@@ -859,6 +919,7 @@ public class QtActivityDelegate
public void onDestroy()
{
if (m_quitApp) {
+ QtNative.terminateQt();
if (m_debuggerProcess != null)
m_debuggerProcess.destroy();
System.exit(0);// FIXME remove it or find a better way
@@ -867,24 +928,15 @@ public class QtActivityDelegate
public void onPause()
{
- QtNative.updateApplicationState(ApplicationInactive);
+ QtNative.setApplicationState(ApplicationInactive);
}
public void onResume()
{
- // fire all lostActions
- synchronized (QtNative.m_mainActivityMutex)
- {
- Iterator<Runnable> itr = QtNative.getLostActions().iterator();
- while (itr.hasNext())
- m_activity.runOnUiThread(itr.next());
-
- QtNative.updateApplicationState(ApplicationActive);
- if (m_started) {
- QtNative.clearLostActions();
- QtNative.updateWindow();
- updateFullScreen(); // Suspending the app clears the immersive mode, so we need to set it again.
- }
+ QtNative.setApplicationState(ApplicationActive);
+ if (m_started) {
+ QtNative.updateWindow();
+ updateFullScreen(); // Suspending the app clears the immersive mode, so we need to set it again.
}
}
@@ -907,7 +959,7 @@ public class QtActivityDelegate
public void onStop()
{
- QtNative.updateApplicationState(ApplicationSuspended);
+ QtNative.setApplicationState(ApplicationSuspended);
}
public Object onRetainNonConfigurationInstance()
@@ -1012,6 +1064,9 @@ public class QtActivityDelegate
QtNative.keyUp(0, event.getCharacters().charAt(0), event.getMetaState(), event.getRepeatCount() > 0);
}
+ if (QtNative.dispatchKeyEvent(event))
+ return true;
+
try {
return (Boolean) m_super_dispatchKeyEvent.invoke(m_activity, event);
} catch (Exception e) {
@@ -1278,4 +1333,17 @@ public class QtActivityDelegate
m_layout.moveChild(view, index);
}
}
+
+ public boolean dispatchGenericMotionEvent (MotionEvent ev)
+ {
+ if (m_started && QtNative.dispatchGenericMotionEvent(ev))
+ return true;
+
+ try {
+ return (Boolean) m_super_dispatchGenericMotionEvent.invoke(m_activity, ev);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java
index 0f3e9083d4..1536d60faa 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java
@@ -40,6 +40,9 @@ import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputMethodManager;
+import android.graphics.Rect;
+import android.app.Activity;
+import android.util.DisplayMetrics;
class QtExtractedText
{
@@ -80,7 +83,15 @@ class HideKeyboardRunnable implements Runnable {
@Override
public void run() {
- QtNative.activityDelegate().setKeyboardVisibility(false, m_hideTimeStamp);
+ // Check that the keyboard is really no longer there.
+ Activity activity = QtNative.activity();
+ Rect r = new Rect();
+ activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);
+ DisplayMetrics metrics = new DisplayMetrics();
+ activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ final int kbHeight = metrics.heightPixels - r.bottom;
+ if (kbHeight < 100)
+ QtNative.activityDelegate().setKeyboardVisibility(false, m_hideTimeStamp);
}
}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
index 408636dcf3..5181cc7e11 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
@@ -65,8 +65,8 @@ public class QtLayout extends ViewGroup
{
DisplayMetrics metrics = new DisplayMetrics();
((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(metrics);
- QtNative.setApplicationDisplayMetrics(metrics.widthPixels,
- metrics.heightPixels, w, h, metrics.xdpi, metrics.ydpi, metrics.scaledDensity);
+ QtNative.setApplicationDisplayMetrics(metrics.widthPixels, metrics.heightPixels, w, h,
+ metrics.xdpi, metrics.ydpi, metrics.scaledDensity, metrics.density);
if (m_startApplicationRunnable != null) {
m_startApplicationRunnable.run();
m_startApplicationRunnable = null;
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 11b6ad8cdc..2349ea6db1 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -41,16 +41,23 @@ import java.util.concurrent.Semaphore;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
import android.text.ClipboardManager;
+import android.os.Build;
import android.util.Log;
import android.view.ContextMenu;
+import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
+import java.lang.reflect.Method;
import java.security.KeyStore;
import java.security.cert.X509Certificate;
+import java.util.Iterator;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
@@ -58,6 +65,7 @@ import javax.net.ssl.X509TrustManager;
public class QtNative
{
private static Activity m_activity = null;
+ private static boolean m_activityPaused = false;
private static QtActivityDelegate m_activityDelegate = null;
public static Object m_mainActivityMutex = new Object(); // mutex used to synchronize runnable operations
@@ -71,9 +79,11 @@ public class QtNative
private static double m_displayMetricsXDpi = .0;
private static double m_displayMetricsYDpi = .0;
private static double m_displayMetricsScaledDensity = 1.0;
+ private static double m_displayMetricsDensity = 1.0;
private static int m_oldx, m_oldy;
private static final int m_moveThreshold = 0;
private static ClipboardManager m_clipboardManager = null;
+ private static Method m_checkSelfPermissionMethod = null;
private static ClassLoader m_classLoader = null;
public static ClassLoader classLoader()
@@ -164,24 +174,33 @@ public class QtNative
}
}
- static public ArrayList<Runnable> getLostActions()
+ public static void setApplicationState(int state)
{
- return m_lostActions;
- }
-
- static public void clearLostActions()
- {
- m_lostActions.clear();
+ synchronized (m_mainActivityMutex) {
+ switch (state) {
+ case QtActivityDelegate.ApplicationActive:
+ m_activityPaused = false;
+ Iterator<Runnable> itr = m_lostActions.iterator();
+ while (itr.hasNext())
+ runAction(itr.next());
+ m_lostActions.clear();
+ break;
+ default:
+ m_activityPaused = true;
+ break;
+ }
+ }
+ updateApplicationState(state);
}
- private static boolean runAction(Runnable action)
+ private static void runAction(Runnable action)
{
synchronized (m_mainActivityMutex) {
- if (m_activity == null)
+ final Looper mainLooper = Looper.getMainLooper();
+ final Handler handler = new Handler(mainLooper);
+ final boolean actionIsQueued = !m_activityPaused && m_activity != null && mainLooper != null && handler.post(action);
+ if (!actionIsQueued)
m_lostActions.add(action);
- else
- m_activity.runOnUiThread(action);
- return m_activity != null;
}
}
@@ -216,7 +235,8 @@ public class QtNative
m_displayMetricsDesktopHeightPixels,
m_displayMetricsXDpi,
m_displayMetricsYDpi,
- m_displayMetricsScaledDensity);
+ m_displayMetricsScaledDensity,
+ m_displayMetricsDensity);
if (params.length() > 0 && !params.startsWith("\t"))
params = "\t" + params;
startQtApplication(f.getAbsolutePath() + params, environment);
@@ -231,7 +251,8 @@ public class QtNative
int desktopHeightPixels,
double XDpi,
double YDpi,
- double scaledDensity)
+ double scaledDensity,
+ double density)
{
/* Fix buggy dpi report */
if (XDpi < android.util.DisplayMetrics.DENSITY_LOW)
@@ -247,7 +268,8 @@ public class QtNative
desktopHeightPixels,
XDpi,
YDpi,
- scaledDensity);
+ scaledDensity,
+ density);
} else {
m_displayMetricsScreenWidthPixels = screenWidthPixels;
m_displayMetricsScreenHeightPixels = screenHeightPixels;
@@ -256,6 +278,7 @@ public class QtNative
m_displayMetricsXDpi = XDpi;
m_displayMetricsYDpi = YDpi;
m_displayMetricsScaledDensity = scaledDensity;
+ m_displayMetricsDensity = density;
}
}
}
@@ -271,7 +294,12 @@ public class QtNative
private static void quitApp()
{
- m_activity.finish();
+ runAction(new Runnable() {
+ @Override
+ public void run() {
+ m_activity.finish();
+ }
+ });
}
//@ANDROID-9
@@ -303,32 +331,49 @@ public class QtNative
static public void sendTouchEvent(MotionEvent event, int id)
{
- //@ANDROID-5
- touchBegin(id);
- for (int i=0;i<event.getPointerCount();i++) {
- touchAdd(id,
- event.getPointerId(i),
- getAction(i, event),
- i == 0,
- (int)event.getX(i),
- (int)event.getY(i),
- event.getSize(i),
- event.getPressure(i));
- }
+ int pointerType = 0;
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- touchEnd(id,0);
+ if (Build.VERSION.SDK_INT >= 14) {
+ switch (event.getToolType(0)) {
+ case MotionEvent.TOOL_TYPE_STYLUS:
+ pointerType = 1; // QTabletEvent::Pen
break;
-
- case MotionEvent.ACTION_UP:
- touchEnd(id,2);
+ case MotionEvent.TOOL_TYPE_ERASER:
+ pointerType = 3; // QTabletEvent::Eraser
break;
+ // TODO TOOL_TYPE_MOUSE
+ }
+ }
- default:
- touchEnd(id,1);
+ if (pointerType != 0) {
+ tabletEvent(id, event.getDeviceId(), event.getEventTime(), event.getAction(), pointerType,
+ event.getButtonState(), event.getX(), event.getY(), event.getPressure());
+ } else {
+ touchBegin(id);
+ for (int i = 0; i < event.getPointerCount(); ++i) {
+ touchAdd(id,
+ event.getPointerId(i),
+ getAction(i, event),
+ i == 0,
+ (int)event.getX(i),
+ (int)event.getY(i),
+ event.getSize(i),
+ event.getPressure(i));
+ }
+
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ touchEnd(id, 0);
+ break;
+
+ case MotionEvent.ACTION_UP:
+ touchEnd(id, 2);
+ break;
+
+ default:
+ touchEnd(id, 1);
+ }
}
- //@ANDROID-5
}
static public void sendTrackballEvent(MotionEvent event, int id)
@@ -356,6 +401,29 @@ public class QtNative
}
}
+ public static int checkSelfPermission(final String permission)
+ {
+ int perm = PackageManager.PERMISSION_DENIED;
+ synchronized (m_mainActivityMutex) {
+ if (m_activity == null)
+ return perm;
+ try {
+ if (Build.VERSION.SDK_INT >= 23) {
+ if (m_checkSelfPermissionMethod == null)
+ m_checkSelfPermissionMethod = Context.class.getMethod("checkSelfPermission", String.class);
+ perm = (Integer)m_checkSelfPermissionMethod.invoke(m_activity, permission);
+ } else {
+ final PackageManager pm = m_activity.getPackageManager();
+ perm = pm.checkPermission(permission, m_activity.getPackageName());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ return perm;
+ }
+
private static void updateSelection(final int selStart,
final int selEnd,
final int candidatesStart,
@@ -373,12 +441,13 @@ public class QtNative
final int y,
final int width,
final int height,
- final int inputHints )
+ final int inputHints,
+ final int enterKeyType)
{
runAction(new Runnable() {
@Override
public void run() {
- m_activityDelegate.showSoftwareKeyboard(x, y, width, height, inputHints);
+ m_activityDelegate.showSoftwareKeyboard(x, y, width, height, inputHints, enterKeyType);
}
});
}
@@ -590,7 +659,8 @@ public class QtNative
int desktopHeightPixels,
double XDpi,
double YDpi,
- double scaledDensity);
+ double scaledDensity,
+ double density);
public static native void handleOrientationChanged(int newRotation, int nativeOrientation);
// screen methods
@@ -604,12 +674,22 @@ public class QtNative
public static native void longPress(int winId, int x, int y);
// pointer methods
+ // tablet methods
+ public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure);
+ // tablet methods
+
// keyboard methods
public static native void keyDown(int key, int unicode, int modifier, boolean autoRepeat);
public static native void keyUp(int key, int unicode, int modifier, boolean autoRepeat);
public static native void keyboardVisibilityChanged(boolean visibility);
+ public static native void keyboardGeometryChanged(int x, int y, int width, int height);
// keyboard methods
+ // dispatch events methods
+ public static native boolean dispatchGenericMotionEvent(MotionEvent ev);
+ public static native boolean dispatchKeyEvent(KeyEvent event);
+ // dispatch events methods
+
// surface methods
public static native void setSurface(int id, Object surface, int w, int h);
// surface methods
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
index 23e08f537a..f370b4f667 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
@@ -243,11 +243,11 @@ public class QtActivity extends Activity
@SuppressWarnings("rawtypes")
Class loaderClass = m_classLoader.loadClass(loaderParams.getString(LOADER_CLASS_NAME_KEY)); // load QtLoader class
Object qtLoader = loaderClass.newInstance(); // create an instance
- Method perpareAppMethod = qtLoader.getClass().getMethod("loadApplication",
+ Method prepareAppMethod = qtLoader.getClass().getMethod("loadApplication",
Activity.class,
ClassLoader.class,
Bundle.class);
- if (!(Boolean)perpareAppMethod.invoke(qtLoader, this, m_classLoader, loaderParams))
+ if (!(Boolean)prepareAppMethod.invoke(qtLoader, this, m_classLoader, loaderParams))
throw new Exception("");
QtApplication.setQtActivityDelegate(qtLoader);
@@ -454,7 +454,7 @@ public class QtActivity extends Activity
{
ArrayList<String> libs = new ArrayList<String>();
- String dataDir = getApplicationInfo().dataDir + "/";
+ String libsDir = getApplicationInfo().nativeLibraryDir + "/";
long packageVersion = -1;
try {
@@ -489,7 +489,7 @@ public class QtActivity extends Activity
for (String bundledImportBinary : list) {
String[] split = bundledImportBinary.split(":");
- String sourceFileName = dataDir + "lib/" + split[0];
+ String sourceFileName = libsDir + split[0];
String destinationFileName = pluginsPrefix + split[1];
createBundledBinary(sourceFileName, destinationFileName);
}
@@ -897,6 +897,12 @@ public class QtActivity extends Activity
} else {
ENVIRONMENT_VARIABLES += "QT_BLOCK_EVENT_LOOPS_WHEN_SUSPENDED=1\t";
}
+
+ if (m_activityInfo.metaData.containsKey("android.app.auto_screen_scale_factor")
+ && m_activityInfo.metaData.getBoolean("android.app.auto_screen_scale_factor")) {
+ ENVIRONMENT_VARIABLES += "QT_AUTO_SCREEN_SCALE_FACTOR=1\t";
+ }
+
startApp(true);
}
}
diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index ad240956ef..262a5f6dba 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -44,6 +44,10 @@
signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/>
<!-- Background running -->
+
+ <!-- auto screen scale factor -->
+ <meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
+ <!-- auto screen scale factor -->
</activity>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
diff --git a/src/angle/angle.pro b/src/angle/angle.pro
index c454fee8f9..8fae66dfb9 100644
--- a/src/angle/angle.pro
+++ b/src/angle/angle.pro
@@ -6,5 +6,6 @@ SUBDIRS += src
# 2) If we made a 'QtANGLE' module, the include directory would be flattened which won't work since
# we need to support "#include <GLES2/gl2.h>"
CONFIG += minimal_syncqt
-QMAKE_SYNCQT_OPTIONS = -module QtANGLE/KHR -module QtANGLE/EGL -module QtANGLE/GLES2 -module QtANGLE/GLES3 -version none
+MODULE_INCNAME = QtANGLE/KHR QtANGLE/EGL QtANGLE/GLES2 QtANGLE/GLES3
+VERSION = none
load(qt_module_headers)
diff --git a/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch b/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch
new file mode 100644
index 0000000000..cf383d7106
--- /dev/null
+++ b/src/angle/patches/0008-ANGLE-Use-pixel-sizes-in-the-XAML-swap-chain.patch
@@ -0,0 +1,361 @@
+From 333bb863e5c3e04fcc513e4750208fa3742be7a1 Mon Sep 17 00:00:00 2001
+From: Andrew Knight <andrew.knight@intopalo.com>
+Date: Sat, 8 Aug 2015 21:42:03 +0300
+Subject: [PATCH 2/4] ANGLE: Use pixel sizes in the XAML swap chain
+
+This is necessary for Qt applications, as they render to GL in physical
+pixels. This is consistent with the CoreWindow swap chain behavior.
+
+This includes a partial revert of "ANGLE: Improve Windows Phone Support"
+as the modifications to SwapChain11 are incompatible with the XAML swap
+chain.
+
+This change only affects Windows Runtime targets.
+
+Change-Id: I401ae81028a9dfdb9da37f51c60844467c476f76
+---
+ .../libANGLE/renderer/d3d/d3d11/SwapChain11.cpp | 46 ----------------------
+ .../d3d/d3d11/winrt/CoreWindowNativeWindow.cpp | 21 ----------
+ .../d3d/d3d11/winrt/CoreWindowNativeWindow.h | 4 +-
+ .../d3d/d3d11/winrt/InspectableNativeWindow.cpp | 21 ++++++++++
+ .../d3d/d3d11/winrt/InspectableNativeWindow.h | 10 +++--
+ .../d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp | 30 ++++++++------
+ .../d3d/d3d11/winrt/SwapChainPanelNativeWindow.h | 7 ++--
+ 7 files changed, 49 insertions(+), 90 deletions(-)
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+index dc539cf..0af2cf1 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+@@ -154,14 +154,8 @@ EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHei
+ const bool useSharedResource = !mNativeWindow.getNativeWindow() && mRenderer->getShareHandleSupport();
+
+ D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0};
+-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+- const int textureLength = std::max(backbufferWidth, backbufferHeight);
+- offscreenTextureDesc.Width = textureLength;
+- offscreenTextureDesc.Height = textureLength;
+-#else
+ offscreenTextureDesc.Width = backbufferWidth;
+ offscreenTextureDesc.Height = backbufferHeight;
+-#endif
+ offscreenTextureDesc.Format = backbufferFormatInfo.texFormat;
+ offscreenTextureDesc.MipLevels = 1;
+ offscreenTextureDesc.ArraySize = 1;
+@@ -241,14 +235,8 @@ EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHei
+ if (mDepthBufferFormat != GL_NONE)
+ {
+ D3D11_TEXTURE2D_DESC depthStencilTextureDesc;
+-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+- const int textureLength = std::max(backbufferWidth, backbufferHeight);
+- depthStencilTextureDesc.Width = textureLength;
+- depthStencilTextureDesc.Height = textureLength;
+-#else
+ depthStencilTextureDesc.Width = backbufferWidth;
+ depthStencilTextureDesc.Height = backbufferHeight;
+-#endif
+ depthStencilTextureDesc.Format = depthBufferFormatInfo.texFormat;
+ depthStencilTextureDesc.MipLevels = 1;
+ depthStencilTextureDesc.ArraySize = 1;
+@@ -349,7 +337,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
+ return EGL_SUCCESS;
+ }
+
+-#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
+ // Can only call resize if we have already created our swap buffer and resources
+ ASSERT(mSwapChain && mBackBufferTexture && mBackBufferRTView);
+
+@@ -392,12 +379,6 @@ EGLint SwapChain11::resize(EGLint backbufferWidth, EGLint backbufferHeight)
+ }
+
+ return resetOffscreenTexture(backbufferWidth, backbufferHeight);
+-#else
+- // Do nothing on Windows Phone apart from updating the internal buffer/width height
+- mWidth = backbufferWidth;
+- mHeight = backbufferHeight;
+- return EGL_SUCCESS;
+-#endif
+ }
+
+ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swapInterval)
+@@ -552,27 +533,6 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+
+ d3d11::PositionTexCoordVertex *vertices = static_cast<d3d11::PositionTexCoordVertex*>(mappedResource.pData);
+
+-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+- // Create a quad in homogeneous coordinates
+- float x1 = -1.0f;
+- float y1 = -1.0f;
+- float x2 = 1.0f;
+- float y2 = 1.0f;
+-
+- const float dim = std::max(mWidth, mHeight);
+- float u1 = 0;
+- float v1 = 0;
+- float u2 = float(width) / dim;
+- float v2 = float(height) / dim;
+-
+- const NativeWindow::RotationFlags flags = mNativeWindow.rotationFlags();
+- const bool rotateL = flags == NativeWindow::RotateLeft;
+- const bool rotateR = flags == NativeWindow::RotateRight;
+- d3d11::SetPositionTexCoordVertex(&vertices[0], x1, y1, rotateL ? u2 : u1, rotateR ? v2 : v1);
+- d3d11::SetPositionTexCoordVertex(&vertices[1], x1, y2, rotateR ? u2 : u1, rotateL ? v1 : v2);
+- d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, rotateR ? u1 : u2, rotateL ? v2 : v1);
+- d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, rotateL ? u1 : u2, rotateR ? v1 : v2);
+-#else
+ // Create a quad in homogeneous coordinates
+ float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
+ float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
+@@ -588,7 +548,6 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ d3d11::SetPositionTexCoordVertex(&vertices[1], x1, y2, u1, v2);
+ d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, u2, v1);
+ d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, u2, v2);
+-#endif
+
+ deviceContext->Unmap(mQuadVB, 0);
+
+@@ -618,13 +577,8 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ D3D11_VIEWPORT viewport;
+ viewport.TopLeftX = 0;
+ viewport.TopLeftY = 0;
+-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+- viewport.Width = (rotateL || rotateR) ? height : width;
+- viewport.Height = (rotateL || rotateR) ? width : height;
+-#else
+ viewport.Width = mWidth;
+ viewport.Height = mHeight;
+-#endif
+ viewport.MinDepth = 0.0f;
+ viewport.MaxDepth = 1.0f;
+ deviceContext->RSSetViewports(1, &viewport);
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+index fa9a69c..f45a077 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+@@ -191,25 +191,4 @@ HRESULT GetCoreWindowSizeInPixels(const ComPtr<ABI::Windows::UI::Core::ICoreWind
+
+ return result;
+ }
+-
+-static float GetLogicalDpi()
+-{
+- ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
+- float dpi = 96.0f;
+-
+- if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf())))
+- {
+- if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi)))
+- {
+- return dpi;
+- }
+- }
+- return dpi;
+-}
+-
+-long ConvertDipsToPixels(float dips)
+-{
+- static const float dipsPerInch = 96.0f;
+- return lround((dips * GetLogicalDpi() / dipsPerInch));
+-}
+ }
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
+index 59df9d5..87cdfe6 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h
+@@ -19,7 +19,6 @@ typedef ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CGraphics__CD
+
+ namespace rx
+ {
+-long ConvertDipsToPixels(float dips);
+
+ class CoreWindowNativeWindow : public InspectableNativeWindow, public std::enable_shared_from_this<CoreWindowNativeWindow>
+ {
+@@ -64,8 +63,7 @@ class CoreWindowSizeChangedHandler :
+ ABI::Windows::Foundation::Size windowSize;
+ if (SUCCEEDED(sizeChangedEventArgs->get_Size(&windowSize)))
+ {
+- SIZE windowSizeInPixels = { ConvertDipsToPixels(windowSize.Width), ConvertDipsToPixels(windowSize.Height) };
+- host->setNewClientSize(windowSizeInPixels);
++ host->setNewClientSize(windowSize);
+ }
+ }
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
+index 2bf48c5..e83f479 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp
+@@ -288,4 +288,25 @@ HRESULT GetOptionalSizePropertyValue(const ComPtr<ABI::Windows::Foundation::Coll
+
+ return result;
+ }
++
++static float GetLogicalDpi()
++{
++ ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties;
++ float dpi = 96.0f;
++
++ if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf())))
++ {
++ if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi)))
++ {
++ return dpi;
++ }
++ }
++ return dpi;
++}
++
++long ConvertDipsToPixels(float dips)
++{
++ static const float dipsPerInch = 96.0f;
++ return lround((dips * GetLogicalDpi() / dipsPerInch));
++}
+ }
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
+index 575bdf8..f053407 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h
+@@ -26,6 +26,8 @@ using namespace ABI::Windows::Foundation::Collections;
+
+ namespace rx
+ {
++long ConvertDipsToPixels(float dips);
++
+ class InspectableNativeWindow
+ {
+ public:
+@@ -45,7 +47,7 @@ class InspectableNativeWindow
+ virtual HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain) = 0;
+ virtual bool registerForSizeChangeEvents() = 0;
+ virtual void unregisterForSizeChangeEvents() = 0;
+- virtual HRESULT scaleSwapChain(const SIZE& newSize) { return S_OK; }
++ virtual HRESULT scaleSwapChain(const Size& newSize) { return S_OK; }
+
+ bool getClientRect(RECT *rect)
+ {
+@@ -59,11 +61,11 @@ class InspectableNativeWindow
+ return true;
+ }
+
+- void setNewClientSize(const SIZE &newSize)
++ void setNewClientSize(const Size &newSize)
+ {
+- if (mSupportsSwapChainResize && !mRequiresSwapChainScaling)
++ if (mSupportsSwapChainResize)
+ {
+- mNewClientRect = { 0, 0, newSize.cx, newSize.cy };
++ mNewClientRect = { 0, 0, ConvertDipsToPixels(newSize.Width), ConvertDipsToPixels(newSize.Height) };
+ mClientRectChanged = true;
+ }
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
+index 53899db..0b48b54 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp
+@@ -66,7 +66,7 @@ bool SwapChainPanelNativeWindow::initialize(EGLNativeWindowType window, IPropert
+ }
+ else
+ {
+- result = GetSwapChainPanelSize(mSwapChainPanel, &mClientRect);
++ result = GetSwapChainPanelSize(mSwapChainPanel, &mClientRect, &mRequiresSwapChainScaling);
+ }
+ }
+
+@@ -139,7 +139,6 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
+
+ ComPtr<IDXGISwapChain1> newSwapChain;
+ ComPtr<ISwapChainPanelNative> swapChainPanelNative;
+- RECT currentPanelSize = {};
+
+ HRESULT result = factory->CreateSwapChainForComposition(device, &swapChainDesc, nullptr, newSwapChain.ReleaseAndGetAddressOf());
+
+@@ -167,13 +166,13 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
+ // first reading the current size of the swapchain panel, then scaling
+ if (SUCCEEDED(result) && mRequiresSwapChainScaling)
+ {
+- result = GetSwapChainPanelSize(mSwapChainPanel, &currentPanelSize);
+- }
++ ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
++ result = mSwapChainPanel.As(&uiElement);
++ ASSERT(SUCCEEDED(result));
+
+- // Scale the swapchain to fit inside the contents of the panel.
+- if (SUCCEEDED(result) && mRequiresSwapChainScaling)
+- {
+- SIZE currentSize = { currentPanelSize.right, currentPanelSize.bottom };
++ Size currentSize;
++ result = uiElement->get_RenderSize(&currentSize);
++ ASSERT(SUCCEEDED(result));
+ result = scaleSwapChain(currentSize);
+ }
+
+@@ -190,9 +189,9 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, DXGIFa
+ return result;
+ }
+
+-HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &newSize)
++HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const Size &newSize)
+ {
+- ABI::Windows::Foundation::Size renderScale = { (float)newSize.cx/(float)mClientRect.right, (float)newSize.cy/(float)mClientRect.bottom };
++ ABI::Windows::Foundation::Size renderScale = { newSize.Width / mNewClientRect.right, newSize.Height / mNewClientRect.bottom };
+ // Setup a scale matrix for the swap chain
+ DXGI_MATRIX_3X2_F scaleMatrix = {};
+ scaleMatrix._11 = renderScale.Width;
+@@ -208,7 +207,7 @@ HRESULT SwapChainPanelNativeWindow::scaleSwapChain(const SIZE &newSize)
+ return result;
+ }
+
+-HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize)
++HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize, bool *scalingActive)
+ {
+ ComPtr<ABI::Windows::UI::Xaml::IUIElement> uiElement;
+ ABI::Windows::Foundation::Size renderSize = { 0, 0 };
+@@ -220,7 +219,14 @@ HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISw
+
+ if (SUCCEEDED(result))
+ {
+- *windowSize = { 0, 0, lround(renderSize.Width), lround(renderSize.Height) };
++ long width = ConvertDipsToPixels(renderSize.Width);
++ long height = ConvertDipsToPixels(renderSize.Height);
++ *windowSize = { 0, 0, width, height };
++
++ if (scalingActive)
++ {
++ *scalingActive = width != renderSize.Width || height != renderSize.Height;
++ }
+ }
+
+ return result;
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
+index caf327d..5debd2f 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h
+@@ -22,7 +22,7 @@ class SwapChainPanelNativeWindow : public InspectableNativeWindow, public std::e
+ bool registerForSizeChangeEvents();
+ void unregisterForSizeChangeEvents();
+ HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain);
+- HRESULT scaleSwapChain(const SIZE &newSize);
++ HRESULT scaleSwapChain(const Size &newSize) override;
+
+ private:
+ ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> mSwapChainPanel;
+@@ -62,8 +62,7 @@ class SwapChainPanelSizeChangedHandler :
+ HRESULT result = sizeChangedEventArgs->get_NewSize(&newSize);
+ if (SUCCEEDED(result))
+ {
+- SIZE windowSize = { lround(newSize.Width), lround(newSize.Height) };
+- host->setNewClientSize(windowSize);
++ host->setNewClientSize(newSize);
+ }
+ }
+
+@@ -74,6 +73,6 @@ class SwapChainPanelSizeChangedHandler :
+ std::weak_ptr<InspectableNativeWindow> mHost;
+ };
+
+-HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize);
++HRESULT GetSwapChainPanelSize(const ComPtr<ABI::Windows::UI::Xaml::Controls::ISwapChainPanel> &swapChainPanel, RECT *windowSize, bool *scalingActive = nullptr);
+ }
+ #endif // LIBANGLE_RENDERER_D3D_D3D11_WINRT_SWAPCHAINPANELNATIVEWINDOW_H_
+--
+1.9.5.msysgit.1
+
diff --git a/src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch b/src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch
new file mode 100644
index 0000000000..8f66b0c1d8
--- /dev/null
+++ b/src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch
@@ -0,0 +1,38 @@
+From 54461670e035ffcb41268a02e9b0c441cc008ddb Mon Sep 17 00:00:00 2001
+From: Samuel Nevala <samuel.nevala@intopalo.com>
+Date: Thu, 22 Oct 2015 14:02:28 +0300
+Subject: [PATCH] ANGLE: Fix winrt backing store to support feature level 9_3
+ devices.
+
+Partially revert c7abf81786f4a0c. Instead of using ES3 entry point
+use ES2 for blitting. Small change is also required to ANGLE that
+makes ES2 entry to behave same as ES3.
+
+Task-Id: QTBUG-48266
+Change-Id: Idc51f00a659c91f740876be071eb71bff69e0e38
+---
+ .../src/libGLESv2/entry_points_gles_2_0_ext.cpp | 4 +++
+ ...inrt-backing-store-to-support-feature-lev.patch | 33 ++++++++++++++++++++++
+ src/plugins/platforms/winrt/qwinrtbackingstore.cpp | 11 ++++----
+ 3 files changed, 42 insertions(+), 6 deletions(-)
+ create mode 100644 src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch
+
+diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+index 8be6ae7..d41c5a4 100644
+--- a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
++++ b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+@@ -659,7 +659,11 @@ void GL_APIENTRY BlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi
+ {
+ if (!ValidateBlitFramebufferParameters(context, srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1, mask, filter,
++#ifndef ANGLE_ENABLE_WINDOWS_STORE
+ true))
++#else
++ false))
++#endif
+ {
+ return;
+ }
+--
+1.9.5.msysgit.1
+
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index 735c841ad8..50dde6398b 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -7,6 +7,8 @@ INCLUDEPATH += \
LIBS_PRIVATE = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI
+TR_EXCLUDE += $$ANGLE_DIR/src/*
+
lib_replace.match = $$[QT_INSTALL_LIBS/get]
lib_replace.replace = \$\$\$\$[QT_INSTALL_LIBS]
lib_replace.CONFIG = path
@@ -42,8 +44,14 @@ winrt|if(msvc:!win32-msvc2005:!win32-msvc2008:!win32-msvc2010) {
# Similarly we want the MinGW linker to use the import libraries shipped with the compiler
# instead of those from the SDK which cause a crash on startup.
- LIBS_PRIVATE += -L\"$$DXLIB_DIR\"
+ LIBS_PRIVATE += -L$$DXLIB_DIR
}
}
+# static builds should still link ANGLE dynamically when dynamic GL is enabled
+static:contains(QT_CONFIG, dynamicgl) {
+ CONFIG -= static
+ CONFIG += shared
+}
+
static: DEFINES *= LIBGLESV2_EXPORT_H_ ANGLE_EXPORT=
diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri
index 085913ac83..fddb395ab2 100644
--- a/src/angle/src/config.pri
+++ b/src/angle/src/config.pri
@@ -16,13 +16,14 @@ equals(QMAKE_HOST.os, Windows) {
gnutools.value = $$absolute_path(../../../../gnuwin32/bin)
exists($$gnutools.value/gperf.exe) {
gnutools.name = PATH
- gnutools.CONFIG = prepend
+ gnutools.CONFIG = always_prepend
}
}
defineReplace(addGnuPath) {
gnuPath = $$1
!isEmpty(gnuPath):!isEmpty(gnutools.name) {
+ QT_TOOL_NAME = $$1
qtAddToolEnv(gnuPath, gnutools)
silent: gnuPath = @echo generating sources from ${QMAKE_FILE_IN} && $$gnuPath
}
diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro
index 94fcebda6b..695f7fd50c 100644
--- a/src/angle/src/libEGL/libEGL.pro
+++ b/src/angle/src/libEGL/libEGL.pro
@@ -1,9 +1,10 @@
CONFIG += installed
include(../common/common.pri)
-
+DEF_FILE_TARGET=$${TARGET}
+TARGET=$$qtLibraryTarget($${LIBEGL_NAME})
winrt: LIBS_PRIVATE += -ld3d11
-LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget(libGLESv2)
+LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME})
DEFINES += GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= LIBEGL_IMPLEMENTATION
@@ -14,8 +15,8 @@ SOURCES += \
$$ANGLE_DIR/src/libEGL/libEGL.cpp
!static {
- DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def
- mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}_mingw32.def
+ DEF_FILE = $$ANGLE_DIR/src/libEGL/$${DEF_FILE_TARGET}.def
+ mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${DEF_FILE_TARGET}_mingw32.def
}
egl_headers.files = \
diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro
index 5979b68098..1da079fd40 100644
--- a/src/angle/src/libGLESv2/libGLESv2.pro
+++ b/src/angle/src/libGLESv2/libGLESv2.pro
@@ -1,5 +1,7 @@
CONFIG += simd installed
include(../common/common.pri)
+DEF_FILE_TARGET=$${TARGET}
+TARGET=$$qtLibraryTarget($${LIBGLESV2_NAME})
INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libANGLE
@@ -327,8 +329,8 @@ angle_d3d11 {
}
!static {
- DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def
- mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}_mingw32.def
+ DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${DEF_FILE_TARGET}.def
+ mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${DEF_FILE_TARGET}_mingw32.def
} else {
DEFINES += DllMain=DllMain_ANGLE # prevent symbol from conflicting with the user's DllMain
}
diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf
index d8ee963ef5..3cd2fac075 100644
--- a/src/concurrent/doc/qtconcurrent.qdocconf
+++ b/src/concurrent/doc/qtconcurrent.qdocconf
@@ -4,7 +4,7 @@ project = QtConcurrent
description = Qt Concurrent Reference Documentation
version = $QT_VERSION
-examplesinstallpath = qtconcurrent
+examplesinstallpath = qtbase/qtconcurrent
qhp.projects = QtConcurrent
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h
index d68172e1e6..32acf03338 100644
--- a/src/concurrent/qtconcurrentiteratekernel.h
+++ b/src/concurrent/qtconcurrentiteratekernel.h
@@ -127,7 +127,7 @@ public:
inline ResultReporter(ThreadEngine<void> *) { }
inline void reserveSpace(int) { }
inline void reportResults(int) { }
- inline void * getPointer() { return 0; }
+ inline void * getPointer() { return Q_NULLPTR; }
};
inline bool selectIteration(std::bidirectional_iterator_tag)
diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h
index a9df3d24b5..5388f60a76 100644
--- a/src/concurrent/qtconcurrentthreadengine.h
+++ b/src/concurrent/qtconcurrentthreadengine.h
@@ -126,7 +126,7 @@ class ThreadEngine : public virtual ThreadEngineBase
public:
typedef T ResultType;
- virtual T *result() { return 0; }
+ virtual T *result() { return Q_NULLPTR; }
QFutureInterface<T> *futureInterfaceTyped()
{
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 65fd1f9383..91a4eb619a 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -70,7 +70,14 @@ set(_qt5_corelib_extra_includes)
# Qt5_POSITION_INDEPENDENT_CODE variable is used in the # qt5_use_module
# macro to add it.
set(Qt5_POSITION_INDEPENDENT_CODE True)
-set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\")
+
+# On x86 and x86-64 systems with ELF binaries (especially Linux), due to
+# a new optimization in GCC 5.x in combination with a recent version of
+# GNU binutils, compiling Qt applications with -fPIE is no longer
+# enough.
+# Applications now need to be compiled with the -fPIC option if the Qt option
+# \"reduce relocations\" is active. For backward compatibility only, Qt accepts
+# the use of -fPIE for GCC 4.x versions.
if (CMAKE_VERSION VERSION_LESS 2.8.12
AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
@@ -79,6 +86,20 @@ else()
set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP)
endif()
+# Applications using qmake or cmake >= 2.8.12 as their build system will
+# adapt automatically. Applications using an older release of cmake in
+# combination with GCC 5.x need to change their CMakeLists.txt to add
+# Qt5Core_EXECUTABLE_COMPILE_FLAGS to CMAKE_CXX_FLAGS. In particular,
+# applications using cmake >= 2.8.9 and < 2.8.11 will continue to build
+# with the -fPIE option and invoke the special compatibility mode if using
+# GCC 4.x.
+set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"\")
+if (CMAKE_VERSION VERSION_LESS 2.8.12
+ AND (CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
+ AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
+ set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\")
+endif()
+
!!IF !isEmpty(QT_NAMESPACE)
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 18563764ad..9fab04fb26 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -94,7 +94,7 @@ endmacro()
# helper macro to set up a moc rule
-macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
+macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target moc_depends)
# Pass the parameters in a file. Set the working directory to
# be that containing the parameters file and reference it by
# just the file name. This is necessary because the moc tool on
@@ -131,7 +131,7 @@ macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
set(_moc_extra_parameters_file @${_moc_parameters_file})
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
- DEPENDS ${infile}
+ DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
VERBATIM)
endmacro()
@@ -151,7 +151,7 @@ function(QT5_GENERATE_MOC infile outfile )
endif()
set(moc_target ${ARGV3})
endif()
- qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
+ qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "")
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
endfunction()
@@ -164,13 +164,14 @@ function(QT5_WRAP_CPP outfiles )
set(options)
set(oneValueArgs TARGET)
- set(multiValueArgs OPTIONS)
+ set(multiValueArgs OPTIONS DEPENDS)
cmake_parse_arguments(_WRAP_CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(moc_files ${_WRAP_CPP_UNPARSED_ARGUMENTS})
set(moc_options ${_WRAP_CPP_OPTIONS})
set(moc_target ${_WRAP_CPP_TARGET})
+ set(moc_depends ${_WRAP_CPP_DEPENDS})
if (moc_target AND CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "The TARGET parameter to qt5_wrap_cpp is only available when using CMake 2.8.12 or later.")
@@ -178,7 +179,7 @@ function(QT5_WRAP_CPP outfiles )
foreach(it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
qt5_make_output_file(${it} moc_ cpp outfile)
- qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
+ qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}")
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
@@ -335,7 +336,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
if (Qt5_POSITION_INDEPENDENT_CODE
AND (CMAKE_VERSION VERSION_LESS 2.8.12
- AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
+ AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)))
set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
endif()
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index da78341d90..7085a9fc5e 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -76,7 +76,7 @@ public:
DeleteWhenStopped
};
- QAbstractAnimation(QObject *parent = 0);
+ QAbstractAnimation(QObject *parent = Q_NULLPTR);
virtual ~QAbstractAnimation();
State state() const;
@@ -111,7 +111,7 @@ public Q_SLOTS:
void setCurrentTime(int msecs);
protected:
- QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0);
+ QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
virtual void updateCurrentTime(int currentTime) = 0;
@@ -130,7 +130,7 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
Q_DECLARE_PRIVATE(QAnimationDriver)
public:
- QAnimationDriver(QObject *parent = 0);
+ QAnimationDriver(QObject *parent = Q_NULLPTR);
~QAnimationDriver();
virtual void advance();
@@ -156,7 +156,7 @@ protected:
virtual void start();
virtual void stop();
- QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = 0);
+ QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = Q_NULLPTR);
private:
friend class QUnifiedTimer;
diff --git a/src/corelib/animation/qanimationgroup.h b/src/corelib/animation/qanimationgroup.h
index 9b180b1704..b668b503b4 100644
--- a/src/corelib/animation/qanimationgroup.h
+++ b/src/corelib/animation/qanimationgroup.h
@@ -47,7 +47,7 @@ class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation
Q_OBJECT
public:
- QAnimationGroup(QObject *parent = 0);
+ QAnimationGroup(QObject *parent = Q_NULLPTR);
~QAnimationGroup();
QAbstractAnimation *animationAt(int index) const;
diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h
index 52a61dafcd..7ce05d6344 100644
--- a/src/corelib/animation/qparallelanimationgroup.h
+++ b/src/corelib/animation/qparallelanimationgroup.h
@@ -47,7 +47,7 @@ class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup
Q_OBJECT
public:
- QParallelAnimationGroup(QObject *parent = 0);
+ QParallelAnimationGroup(QObject *parent = Q_NULLPTR);
~QParallelAnimationGroup();
int duration() const Q_DECL_OVERRIDE;
diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h
index 159d82f969..5207472623 100644
--- a/src/corelib/animation/qpauseanimation.h
+++ b/src/corelib/animation/qpauseanimation.h
@@ -48,8 +48,8 @@ class Q_CORE_EXPORT QPauseAnimation : public QAbstractAnimation
Q_OBJECT
Q_PROPERTY(int duration READ duration WRITE setDuration)
public:
- QPauseAnimation(QObject *parent = 0);
- QPauseAnimation(int msecs, QObject *parent = 0);
+ QPauseAnimation(QObject *parent = Q_NULLPTR);
+ QPauseAnimation(int msecs, QObject *parent = Q_NULLPTR);
~QPauseAnimation();
int duration() const Q_DECL_OVERRIDE;
diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h
index 8d06a9f354..c0d30ba0fd 100644
--- a/src/corelib/animation/qpropertyanimation.h
+++ b/src/corelib/animation/qpropertyanimation.h
@@ -49,8 +49,8 @@ class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject)
public:
- QPropertyAnimation(QObject *parent = 0);
- QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = 0);
+ QPropertyAnimation(QObject *parent = Q_NULLPTR);
+ QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = Q_NULLPTR);
~QPropertyAnimation();
QObject *targetObject() const;
diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h
index 1a4ead90d4..c8a84a1220 100644
--- a/src/corelib/animation/qsequentialanimationgroup.h
+++ b/src/corelib/animation/qsequentialanimationgroup.h
@@ -50,7 +50,7 @@ class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
Q_PROPERTY(QAbstractAnimation* currentAnimation READ currentAnimation NOTIFY currentAnimationChanged)
public:
- QSequentialAnimationGroup(QObject *parent = 0);
+ QSequentialAnimationGroup(QObject *parent = Q_NULLPTR);
~QSequentialAnimationGroup();
QPauseAnimation *addPause(int msecs);
diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h
index 035a553799..fdb97ca83c 100644
--- a/src/corelib/animation/qsequentialanimationgroup_p.h
+++ b/src/corelib/animation/qsequentialanimationgroup_p.h
@@ -86,7 +86,7 @@ public:
// this is the actual duration of uncontrolled animations
// it helps seeking and even going forward
- QList<int> actualDuration;
+ QVector<int> actualDuration;
void restart();
int lastLoop;
diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h
index 8a6524a594..4340a187a2 100644
--- a/src/corelib/animation/qvariantanimation.h
+++ b/src/corelib/animation/qvariantanimation.h
@@ -59,7 +59,7 @@ public:
typedef QPair<qreal, QVariant> KeyValue;
typedef QVector<KeyValue> KeyValues;
- QVariantAnimation(QObject *parent = 0);
+ QVariantAnimation(QObject *parent = Q_NULLPTR);
~QVariantAnimation();
QVariant startValue() const;
@@ -88,7 +88,7 @@ Q_SIGNALS:
void valueChanged(const QVariant &value);
protected:
- QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = 0);
+ QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
void updateCurrentTime(int) Q_DECL_OVERRIDE;
diff --git a/src/corelib/codecs/qbig5codec.cpp b/src/corelib/codecs/qbig5codec.cpp
index 6fd87bdfc9..6e6e3143bb 100644
--- a/src/corelib/codecs/qbig5codec.cpp
+++ b/src/corelib/codecs/qbig5codec.cpp
@@ -1794,7 +1794,7 @@ QByteArray QBig5Codec::convertFromUnicode(const QChar *uc, int len, ConverterSta
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -1916,7 +1916,7 @@ QByteArray QBig5hkscsCodec::convertFromUnicode(const QChar *uc, int len, Convert
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qeucjpcodec.cpp b/src/corelib/codecs/qeucjpcodec.cpp
index af218c1ab0..7b9665f1a0 100644
--- a/src/corelib/codecs/qeucjpcodec.cpp
+++ b/src/corelib/codecs/qeucjpcodec.cpp
@@ -92,7 +92,7 @@ QEucJpCodec::QEucJpCodec() : conv(QJpUnicodeConv::newConverter(QJpUnicodeConv::D
*/
QEucJpCodec::~QEucJpCodec()
{
- delete (QJpUnicodeConv*)conv;
+ delete (const QJpUnicodeConv*)conv;
conv = 0;
}
@@ -139,7 +139,7 @@ QByteArray QEucJpCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp
index 52776efa4d..9ef9e13ebb 100644
--- a/src/corelib/codecs/qeuckrcodec.cpp
+++ b/src/corelib/codecs/qeuckrcodec.cpp
@@ -108,7 +108,7 @@ QByteArray QEucKrCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -3421,7 +3421,7 @@ QByteArray QCP949Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt
}
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp
index feb485807f..f498072948 100644
--- a/src/corelib/codecs/qgb18030codec.cpp
+++ b/src/corelib/codecs/qgb18030codec.cpp
@@ -138,7 +138,7 @@ QByteArray QGb18030Codec::convertFromUnicode(const QChar *uc, int len, Converter
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -415,7 +415,7 @@ QByteArray QGbkCodec::convertFromUnicode(const QChar *uc, int len, ConverterStat
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
@@ -566,7 +566,7 @@ QByteArray QGb2312Codec::convertFromUnicode(const QChar *uc, int len, ConverterS
++invalid;
}
}
- rstr.resize(cursor - (uchar*)rstr.constData());
+ rstr.resize(cursor - (const uchar*)rstr.constData());
if (state) {
state->invalidChars += invalid;
diff --git a/src/corelib/codecs/qjiscodec.cpp b/src/corelib/codecs/qjiscodec.cpp
index 25d8cf0cff..ac1b47a944 100644
--- a/src/corelib/codecs/qjiscodec.cpp
+++ b/src/corelib/codecs/qjiscodec.cpp
@@ -97,7 +97,7 @@ QJisCodec::QJisCodec() : conv(QJpUnicodeConv::newConverter(QJpUnicodeConv::Defau
*/
QJisCodec::~QJisCodec()
{
- delete (QJpUnicodeConv*)conv;
+ delete (const QJpUnicodeConv*)conv;
conv = 0;
}
diff --git a/src/corelib/codecs/qsjiscodec.cpp b/src/corelib/codecs/qsjiscodec.cpp
index 58b91b9d9d..5164d9e4ce 100644
--- a/src/corelib/codecs/qsjiscodec.cpp
+++ b/src/corelib/codecs/qsjiscodec.cpp
@@ -73,7 +73,7 @@ QSjisCodec::QSjisCodec() : conv(QJpUnicodeConv::newConverter(QJpUnicodeConv::Def
*/
QSjisCodec::~QSjisCodec()
{
- delete (QJpUnicodeConv*)conv;
+ delete (const QJpUnicodeConv*)conv;
conv = 0;
}
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index c6d5c7388d..c55f93b949 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -993,7 +993,7 @@ QString QTextDecoder::toUnicode(const char *chars, int len)
}
// in qstring.cpp:
-void qt_from_latin1(ushort *dst, const char *str, size_t size);
+void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW;
/*! \overload
@@ -1155,7 +1155,6 @@ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba)
function returns 0 (the default), tr() assumes Latin-1.
*/
-
/*!
\internal
\since 4.3
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 1d5e25efcc..3e73872d64 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -88,7 +88,7 @@ public:
struct Q_CORE_EXPORT ConverterState {
ConverterState(ConversionFlags f = DefaultConversion)
- : flags(f), remainingChars(0), invalidChars(0), d(0) { state_data[0] = state_data[1] = state_data[2] = 0; }
+ : flags(f), remainingChars(0), invalidChars(0), d(Q_NULLPTR) { state_data[0] = state_data[1] = state_data[2] = 0; }
~ConverterState();
ConversionFlags flags;
int remainingChars;
@@ -99,9 +99,9 @@ public:
Q_DISABLE_COPY(ConverterState)
};
- QString toUnicode(const char *in, int length, ConverterState *state = 0) const
+ QString toUnicode(const char *in, int length, ConverterState *state = Q_NULLPTR) const
{ return convertToUnicode(in, length, state); }
- QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = 0) const
+ QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = Q_NULLPTR) const
{ return convertFromUnicode(in, length, state); }
QTextDecoder* makeDecoder(ConversionFlags flags = DefaultConversion) const;
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index a33c1bc9ce..476990fb7a 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -296,7 +296,6 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte
{
bool headerdone = false;
ushort replacement = QChar::ReplacementCharacter;
- int need = 0;
int invalid = 0;
int res;
uchar ch = 0;
@@ -311,7 +310,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte
// 1 of 2 bytes invalid continuation +1 (need to insert replacement and restart)
// 2 of 3 bytes same +1 (same)
// 3 of 4 bytes same +1 (same)
- QString result(need + len + 1, Qt::Uninitialized);
+ QString result(len + 1, Qt::Uninitialized);
ushort *dst = reinterpret_cast<ushort *>(const_cast<QChar *>(result.constData()));
const uchar *src = reinterpret_cast<const uchar *>(chars);
diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h
index 99887352c9..d97145c6fc 100644
--- a/src/corelib/codecs/qutfcodec_p.h
+++ b/src/corelib/codecs/qutfcodec_p.h
@@ -217,8 +217,6 @@ namespace QUtf8Functions
return Traits::Error;
if (bytesAvailable > 1 && !isContinuationByte(Traits::peekByte(src, 1)))
return Traits::Error;
- if (bytesAvailable > 2 && !isContinuationByte(Traits::peekByte(src, 2)))
- return Traits::Error;
return Traits::EndOfString;
}
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 2d78041752..5cd0bde87b 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -13,9 +13,6 @@ irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
CONFIG += optimize_full
-# otherwise mingw headers do not declare common functions like putenv
-mingw:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
-
QMAKE_DOCS = $$PWD/doc/qtcore.qdocconf
ANDROID_JAR_DEPENDENCIES = \
@@ -48,6 +45,9 @@ include(statemachine/statemachine.pri)
include(mimetypes/mimetypes.pri)
include(xml/xml.pri)
+# otherwise mingw headers do not declare common functions like putenv
+mingw: CONFIG -= strict_c++
+
mac|darwin {
!ios {
LIBS_PRIVATE += -framework ApplicationServices
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 3d64708def..e98f06d47d 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -4,7 +4,7 @@ project = QtCore
description = Qt Core Reference Documentation
version = $QT_VERSION
-examplesinstallpath = corelib
+examplesinstallpath = qtbase/corelib
qhp.projects = QtCore
diff --git a/src/corelib/doc/snippets/code/doc_src_containers.cpp b/src/corelib/doc/snippets/code/doc_src_containers.cpp
index 00971d69b9..395e48bc89 100644
--- a/src/corelib/doc/snippets/code/doc_src_containers.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_containers.cpp
@@ -176,7 +176,7 @@ QMap<int, int> map;
...
QMap<int, int>::const_iterator i;
for (i = map.constBegin(); i != map.constEnd(); ++i)
- qDebug() << i.key() << ":" << i.value();
+ qDebug() << i.key() << ':' << i.value();
//! [13]
@@ -236,7 +236,7 @@ foreach (const QString &str, list) {
QMap<QString, int> map;
...
foreach (const QString &str, map.keys())
- qDebug() << str << ":" << map.value(str);
+ qDebug() << str << ':' << map.value(str);
//! [19]
@@ -245,7 +245,7 @@ QMultiMap<QString, int> map;
...
foreach (const QString &str, map.uniqueKeys()) {
foreach (int i, map.values(str))
- qDebug() << str << ":" << i;
+ qDebug() << str << ':' << i;
}
//! [20]
diff --git a/src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp b/src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp
index e2cf761ff8..eacc94b19f 100644
--- a/src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp
@@ -63,13 +63,3 @@ while (new_data_available()) {
}
delete decoder;
//! [2]
-
-
-//! [3]
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QTextCodec::setCodecForTr(QTextCodec::codecForName("eucKR"));
- ...
-}
-//! [3]
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
index b0048014a4..8846437b7c 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
@@ -418,17 +418,17 @@ QString example = tr("Example");
//! [40]
//! [41]
-QPushButton *button = parentWidget->findChild<QPushButton *>("button1", Qt::FindDirectChildOnly);
+QPushButton *button = parentWidget->findChild<QPushButton *>("button1", Qt::FindDirectChildrenOnly);
//! [41]
//! [42]
-QListWidget *list = parentWidget->findChild<QListWidget *>(QString(), Qt::FindDirectChildOnly);
+QListWidget *list = parentWidget->findChild<QListWidget *>(QString(), Qt::FindDirectChildrenOnly);
//! [42]
//! [43]
-QList<QPushButton *> childButtons = parentWidget.findChildren<QPushButton *>(QString(), Qt::FindDirectChildOnly);
+QList<QPushButton *> childButtons = parentWidget.findChildren<QPushButton *>(QString(), Qt::FindDirectChildrenOnly);
//! [43]
//! [44]
@@ -486,6 +486,33 @@ QObject::connect(socket, &QTcpSocket::connected, this, [=] () {
}, Qt::AutoConnection);
//! [51]
+//! [52]
+class MyClass : public QWidget
+{
+ Q_OBJECT
+
+public:
+ MyClass(QWidget *parent = 0);
+ ~MyClass();
+
+ bool event(QEvent* ev)
+ {
+ if (ev->type() == QEvent::PolishRequest) {
+ // overwrite handling of PolishRequest if any
+ doThings();
+ return true;
+ } else if (ev->type() == QEvent::Show) {
+ // complement handling of Show if any
+ doThings2();
+ QWidget::event(ev);
+ return true;
+ }
+ // Make sure the rest of events are handled
+ return QWidget::event(ev);
+ }
+};
+//! [52]
+
//! [meta data]
//: This is a comment for the translator.
//= qtn_foo_bar
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp
index 43d64fc08e..0976488a48 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp
@@ -220,7 +220,7 @@ for (i = hash.begin(); i != hash.end(); ++i)
//! [19]
QHash<QString, int>::iterator i = hash.begin();
while (i != hash.end()) {
- if (i.key().startsWith("_"))
+ if (i.key().startsWith('_'))
i = hash.erase(i);
else
++i;
@@ -233,7 +233,7 @@ QHash<QString, int>::iterator i = hash.begin();
while (i != hash.end()) {
QHash<QString, int>::iterator prev = i;
++i;
- if (prev.key().startsWith("_"))
+ if (prev.key().startsWith('_'))
hash.erase(prev);
}
//! [20]
@@ -242,7 +242,7 @@ while (i != hash.end()) {
//! [21]
// WRONG
while (i != hash.end()) {
- if (i.key().startsWith("_"))
+ if (i.key().startsWith('_'))
hash.erase(i);
++i;
}
@@ -298,6 +298,25 @@ while (i != hash.end() && i.key() == "plenty") {
}
//! [26]
+//! [27]
+for (QHash<int, QString>::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it) {
+ cout << "The key: " << it.key() << endl
+ cout << "The value: " << it.value() << endl;
+ cout << "Also the value: " << (*it) << endl;
+}
+//! [27]
+
+//! [28]
+// Inefficient, keys() is expensive
+QList<int> keys = hash.keys();
+int numPrimes = std::count_if(keys.cbegin(), keys.cend(), isPrimeNumber);
+qDeleteAll(hash2.keys());
+
+// Efficient, no memory allocation needed
+int numPrimes = std::count_if(hash.keyBegin(), hash.keyEnd(), isPrimeNumber);
+qDeleteAll(hash2.keyBegin(), hash2.keyEnd());
+//! [28]
+
//! [qhashbits]
inline uint qHash(const std::vector<int> &key, uint seed = 0)
{
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp
index 014af8b0ee..f1cf644df6 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp
@@ -128,7 +128,7 @@ QLinkedList<QString> list;
...
QLinkedList<QString>::iterator i = list.begin();
while (i != list.end()) {
- if ((*i).startsWith("_"))
+ if ((*i).startsWith('_'))
i = list.erase(i);
else
++i;
@@ -141,7 +141,7 @@ QLinkedList<QString>::iterator i = list.begin();
while (i != list.end()) {
QLinkedList<QString>::iterator previous = i;
++i;
- if ((*previous).startsWith("_"))
+ if ((*previous).startsWith('_'))
list.erase(previous);
}
//! [11]
@@ -150,7 +150,7 @@ while (i != list.end()) {
//! [12]
// WRONG
while (i != list.end()) {
- if ((*i).startsWith("_"))
+ if ((*i).startsWith('_'))
list.erase(i);
++i;
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp
index 7580b6bbaf..3241991129 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp
@@ -234,7 +234,7 @@ for (i = map.begin(); i != map.end(); ++i)
//! [20]
QMap<QString, int>::iterator i = map.begin();
while (i != map.end()) {
- if (i.key().startsWith("_"))
+ if (i.key().startsWith('_'))
i = map.erase(i);
else
++i;
@@ -247,7 +247,7 @@ QMap<QString, int>::iterator i = map.begin();
while (i != map.end()) {
QMap<QString, int>::iterator prev = i;
++i;
- if (prev.key().startsWith("_"))
+ if (prev.key().startsWith('_'))
map.erase(prev);
}
//! [21]
@@ -256,7 +256,7 @@ while (i != map.end()) {
//! [22]
// WRONG
while (i != map.end()) {
- if (i.key().startsWith("_"))
+ if (i.key().startsWith('_'))
map.erase(i);
++i;
}
@@ -311,3 +311,22 @@ while (i != map.end() && i.key() == "plenty") {
++i;
}
//! [27]
+
+//! [keyiterator1]
+for (QMap<int, QString>::const_iterator it = map.cbegin(), end = map.cend(); it != end; ++it) {
+ cout << "The key: " << it.key() << endl
+ cout << "The value: " << it.value() << endl;
+ cout << "Also the value: " << (*it) << endl;
+}
+//! [keyiterator1]
+
+//! [keyiterator2]
+// Inefficient, keys() is expensive
+QList<int> keys = map.keys();
+int numPrimes = std::count_if(map.cbegin(), map.cend(), isPrimeNumber);
+qDeleteAll(map2.keys());
+
+// Efficient, no memory allocation needed
+int numPrimes = std::count_if(map.keyBegin(), map.keyEnd(), isPrimeNumber);
+qDeleteAll(map2.keyBegin(), map2.keyEnd());
+//! [keyiterator2]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp
index 77b34c95fc..5def361b83 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp
@@ -84,14 +84,27 @@ for (int i = 0; i < 10; ++i)
//! [7]
-QVector<QString> vector(0);
+QVector<QString> vector;
vector.append("one");
vector.append("two");
-vector.append("three");
+QString three = "three";
+vector.append(three);
// vector: ["one", "two", "three"]
+// three: "three"
//! [7]
+//! [move-append]
+QVector<QString> vector;
+vector.append("one");
+vector.append("two");
+QString three = "three";
+vector.append(std::move(three));
+// vector: ["one", "two", "three"]
+// three: ""
+//! [move-append]
+
+
//! [8]
QVector<QString> vector;
vector.prepend("one");
diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp
index e03e705a0b..07ff9301bf 100644
--- a/src/corelib/doc/snippets/qstring/main.cpp
+++ b/src/corelib/doc/snippets/qstring/main.cpp
@@ -408,12 +408,12 @@ void Widget::firstIndexOfFunction()
str.indexOf(QRegularExpression("m[aeiou]"), 0); // returns 4
//! [93]
- //! [97]
+ //! [99]
QString str = "the minimum";
QRegularExpressionMatch match;
str.indexOf(QRegularExpression("m[aeiou]"), 0, &match); // returns 4
// match.captured() == mi
- //! [97]
+ //! [99]
}
void Widget::insertFunction()
@@ -465,12 +465,12 @@ void Widget::lastIndexOfFunction()
str.lastIndexOf(QRegularExpression("m[aeiou]")); // returns 8
//! [94]
- //! [98]
+ //! [100]
QString str = "the minimum";
QRegularExpressionMatch match;
str.lastIndexOf(QRegularExpression("m[aeiou]"), -1, &match); // returns 8
// match.captured() == mu
- //! [98]
+ //! [100]
}
void Widget::leftFunction()
@@ -777,10 +777,10 @@ void Widget::splitCaseSensitiveFunction()
//! [62]
QString str = "a,,b,c";
- QStringList list1 = str.split(",");
+ QStringList list1 = str.split(',');
// list1: [ "a", "", "b", "c" ]
- QStringList list2 = str.split(",", QString::SkipEmptyParts);
+ QStringList list2 = str.split(',', QString::SkipEmptyParts);
// list2: [ "a", "b", "c" ]
//! [62]
}
diff --git a/src/corelib/doc/snippets/qstringlist/main.cpp b/src/corelib/doc/snippets/qstringlist/main.cpp
index 64f2061786..04d4dc8a89 100644
--- a/src/corelib/doc/snippets/qstringlist/main.cpp
+++ b/src/corelib/doc/snippets/qstringlist/main.cpp
@@ -82,7 +82,7 @@ Widget::Widget(QWidget *parent)
//! [5] //! [6]
QStringList list;
//! [5]
- list = str.split(",");
+ list = str.split(',');
// list: ["Arial", "Helvetica", "Times", "Courier"]
//! [6]
diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc
index f8d0d3eb05..0ae3817ac7 100644
--- a/src/corelib/doc/src/containers.qdoc
+++ b/src/corelib/doc/src/containers.qdoc
@@ -169,8 +169,8 @@
convenience, the containers are forward declared in \c
<QtContainerFwd>.
- \keyword assignable data type
- \keyword assignable data types
+ \target assignable data type
+ \target assignable data types
The values stored in the various containers can be of any
\e{assignable data type}. To qualify, a type must provide a
@@ -220,7 +220,7 @@
\codeline
\snippet streaming/main.cpp 2
- \keyword default-constructed value
+ \target default-constructed value
The documentation of certain container class functions refer to
\e{default-constructed values}; for example, QVector
@@ -546,7 +546,7 @@
The above example only shows a problem with QVector, but
the problem exists for all the implicitly shared Qt containers.
- \keyword foreach
+ \target foreach
\section1 The foreach Keyword
If you just want to iterate over all the items in a container
@@ -655,11 +655,11 @@
To describe algorithmic complexity, we use the following
terminology, based on the "big Oh" notation:
- \keyword constant time
- \keyword logarithmic time
- \keyword linear time
- \keyword linear-logarithmic time
- \keyword quadratic time
+ \target constant time
+ \target logarithmic time
+ \target linear time
+ \target linear-logarithmic time
+ \target quadratic time
\list
\li \b{Constant time:} O(1). A function is said to run in constant
diff --git a/src/corelib/doc/src/eventsandfilters.qdoc b/src/corelib/doc/src/eventsandfilters.qdoc
index a4710eb288..99a40bb1b8 100644
--- a/src/corelib/doc/src/eventsandfilters.qdoc
+++ b/src/corelib/doc/src/eventsandfilters.qdoc
@@ -100,7 +100,7 @@
event delivery mechanisms are flexible. The documentation for
QCoreApplication::notify() concisely tells the whole story; the
\e{Qt Quarterly} article
- \l{http://doc.qt.digia.com/qq/qq11-events.html}{Another Look at Events}
+ \l{http://doc.qt.io/archives/qq/qq11-events.html}{Another Look at Events}
rehashes it less concisely. Here we will explain enough for 95%
of applications.
diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc
index ec4715c933..3d01b9ee2d 100644
--- a/src/corelib/doc/src/external-resources.qdoc
+++ b/src/corelib/doc/src/external-resources.qdoc
@@ -57,12 +57,11 @@
*/
/*!
- \externalpage http://doc-snapshot.qt-project.org/qt5-5.4/qtdesigner-manual.html
- \title Using a Designer UI File in Your Application
+ \externalpage http://marcmutz.wordpress.com/effective-qt/containers/#containers-qlist
+ \title Pros and Cons of Using QList
*/
/*!
- \externalpage http://doc-snapshot.qt-project.org/qt5-5.4/designer-widget-mode.html#the-property-editor
- \title Qt Designer's Widget Editing Mode#The Property Editor
-*/
+ \externalpage http://marcmutz.wordpress.com/effective-qt/containers/
+ \title Understand the Qt Containers
*/
diff --git a/src/corelib/doc/src/implicit-sharing.qdoc b/src/corelib/doc/src/implicit-sharing.qdoc
index 57ebf55c17..d5a8e327ac 100644
--- a/src/corelib/doc/src/implicit-sharing.qdoc
+++ b/src/corelib/doc/src/implicit-sharing.qdoc
@@ -71,8 +71,8 @@
data. The shared data is deleted when the reference count becomes
zero.
- \keyword deep copy
- \keyword shallow copy
+ \target deep copy
+ \target shallow copy
When dealing with shared objects, there are two ways of copying an
object. We usually speak about \e deep and \e shallow copies. A deep
@@ -142,6 +142,6 @@
(QMap, QVector, etc.) while you use
\l{STL-style iterators}{STL-style iterator}. See \l{Implicit sharing iterator problem}.
- \keyword implicitly shared classes
+ \target implicitly shared classes
\annotatedlist shared
*/
diff --git a/src/corelib/doc/src/objectmodel/metaobjects.qdoc b/src/corelib/doc/src/objectmodel/metaobjects.qdoc
index a482c5cc8b..52c134c517 100644
--- a/src/corelib/doc/src/objectmodel/metaobjects.qdoc
+++ b/src/corelib/doc/src/objectmodel/metaobjects.qdoc
@@ -32,7 +32,7 @@
\ingroup qt-basic-concepts
\keyword meta-object
- \target Meta-Object System
+ \keyword Meta-Object System
Qt's meta-object system provides the signals and slots mechanism for
inter-object communication, run-time type information, and the dynamic
diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc
index abb0720fe9..28be328e3a 100644
--- a/src/corelib/doc/src/objectmodel/properties.qdoc
+++ b/src/corelib/doc/src/objectmodel/properties.qdoc
@@ -31,7 +31,7 @@
\brief An overview of Qt's property system.
\ingroup qt-basic-concepts
- \target Qt's Property System
+ \keyword Qt's Property System
Qt provides a sophisticated property system similar to the ones
supplied by some compiler vendors. However, as a compiler- and
@@ -160,13 +160,8 @@
Because QDate is user-defined, you must include the \c{<QDate>}
header file with the property declaration.
- For QMap, QList, and QValueList properties, the property value is
- a QVariant whose value is the entire list or map. Note that the
- Q_PROPERTY string cannot contain commas, because commas separate
- macro arguments. Therefore, you must use \c QMap as the property
- type instead of \c QMap<QString,QVariant>. For consistency, also
- use \c QList and \c QValueList instead of \c QList<QVariant> and
- \c QValueList<QVariant>.
+ For historical reasons, \a QMap and \a QList as property types
+ are synonym of \a QVariantMap and \a QVariantList.
\section1 Reading and Writing Properties with the Meta-Object System
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 6a8104bee2..aa4945f90e 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -17,7 +17,8 @@ HEADERS += \
global/qisenum.h \
global/qtypetraits.h \
global/qflags.h \
- global/qhooks_p.h
+ global/qhooks_p.h \
+ global/qversiontagging.h
SOURCES += \
global/archdetect.cpp \
@@ -27,7 +28,8 @@ SOURCES += \
global/qmalloc.cpp \
global/qnumeric.cpp \
global/qlogging.cpp \
- global/qhooks.cpp
+ global/qhooks.cpp \
+ global/qversiontagging.cpp
# qlibraryinfo.cpp includes qconfig.cpp
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
@@ -54,3 +56,7 @@ journald {
PKGCONFIG_PRIVATE += libsystemd-journal
DEFINES += QT_USE_JOURNALD
}
+
+syslog {
+ DEFINES += QT_USE_SYSLOG
+}
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 9f79b3e70c..ba830977ad 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -914,6 +914,13 @@
//# define Q_COMPILER_UNIFORM_INIT
# define Q_COMPILER_UNRESTRICTED_UNIONS
# endif
+# if _MSC_FULL_VER >= 190023419
+# define Q_COMPILER_ATTRIBUTES
+// Almost working, see https://connect.microsoft.com/VisualStudio/feedback/details/2011648
+//# define Q_COMPILER_CONSTEXPR
+# define Q_COMPILER_THREADSAFE_STATICS
+# define Q_COMPILER_UNIFORM_INIT
+# endif
# endif /* __cplusplus */
#endif /* Q_CC_MSVC */
@@ -922,24 +929,26 @@
# if defined(Q_OS_QNX)
// QNX: test if we are using libcpp (Dinkumware-based).
// Older versions (QNX 650) do not support C++11 features
-// _HAS_CPP0X is defined by toolchains that actually include
+// _HAS_* macros are set to 1 by toolchains that actually include
// Dinkum C++11 libcpp.
-# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CPP0X)
+# if !__GLIBCXX__
+# if !_HAS_CPP0X
// Disable C++11 features that depend on library support
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
# undef Q_COMPILER_UNICODE_STRINGS
# undef Q_COMPILER_NOEXCEPT
-# endif
-# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_NULLPTR_T)
+# endif // !_HAS_CPP0X
+# if !_HAS_NULLPTR_T
# undef Q_COMPILER_NULLPTR
-# endif
-# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CONSTEXPR)
+# endif //!_HAS_NULLPTR_T
+# if !_HAS_CONSTEXPR
// The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min()
// Disable constexpr support on QNX even if the compiler supports it
# undef Q_COMPILER_CONSTEXPR
-# endif
+# endif // !_HAS_CONSTEXPR
+# endif // !__GLIBCXX__
# endif // Q_OS_QNX
# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \
&& ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
@@ -1143,7 +1152,7 @@
# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
-# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too
+# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_MSVC(number)
#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index d3b9c3f5a7..f434e87c85 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -109,7 +109,7 @@ public:
inline QFlags &operator=(const QFlags &other);
#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) Q_DECL_NOTHROW : i(Int(f)) {}
- Q_DECL_CONSTEXPR inline QFlags(Zero = 0) Q_DECL_NOTHROW : i(0) {}
+ Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {}
Q_DECL_CONSTEXPR inline QFlags(QFlag f) Q_DECL_NOTHROW : i(f) {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index b5bdcedaa1..e8c50dff2b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -42,6 +42,7 @@
#include <private/qlocale_tools_p.h>
#include <private/qsystemlibrary_p.h>
+#include <qmutex.h>
#ifndef QT_NO_QOBJECT
#include <private/qthread_p.h>
@@ -64,14 +65,14 @@
# endif
#endif
+#ifdef Q_OS_WINRT
+#include <Ws2tcpip.h>
+#endif // Q_OS_WINRT
+
#if defined(Q_OS_VXWORKS) && defined(_WRS_KERNEL)
# include <envLib.h>
#endif
-#if defined(Q_OS_MACX)
-#include <CoreServices/CoreServices.h>
-#endif
-
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
#include <private/qjni_p.h>
#endif
@@ -89,6 +90,10 @@
#include <private/qcore_unix_p.h>
#endif
+#ifdef Q_OS_BSD4
+#include <sys/sysctl.h>
+#endif
+
#include "archdetect.cpp"
QT_BEGIN_NAMESPACE
@@ -105,7 +110,7 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
// (if this list becomes too long, consider factoring into a separate file)
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");
/*!
\class QFlag
@@ -1846,25 +1851,6 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qnamespace.h"
QT_END_INCLUDE_NAMESPACE
-#if defined(Q_OS_OSX)
-
-Q_CORE_EXPORT OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref)
-{
- return FSPathMakeRef(reinterpret_cast<const UInt8 *>(file.toUtf8().constData()), fsref, 0);
-}
-
-Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding encoding=0, int len=-1)
-{
- Q_UNUSED(encoding);
- Q_UNUSED(len);
- CFStringGetPascalString(QCFString(s), str, 256, CFStringGetSystemEncoding());
-}
-
-Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
- return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));
-}
-#endif // defined(Q_OS_OSX)
-
QSysInfo::MacVersion QSysInfo::macVersion()
{
const QAppleOperatingSystemVersion version = qt_apple_os_version(); // qtcore_mac_objc.mm
@@ -1884,93 +1870,97 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qt_windows.h"
QT_END_INCLUDE_NAMESPACE
-#ifndef Q_OS_WINRT
-
-# ifndef Q_OS_WINCE
-
-// Determine Windows versions >= 8 by querying the version of kernel32.dll.
-static inline bool determineWinOsVersionPost8(OSVERSIONINFO *result)
+# ifndef QT_BOOTSTRAPPED
+class QWindowsSockInit
{
- typedef WORD (WINAPI* PtrGetFileVersionInfoSizeW)(LPCWSTR, LPDWORD);
- typedef BOOL (WINAPI* PtrVerQueryValueW)(LPCVOID, LPCWSTR, LPVOID, PUINT);
- typedef BOOL (WINAPI* PtrGetFileVersionInfoW)(LPCWSTR, DWORD, DWORD, LPVOID);
+public:
+ QWindowsSockInit();
+ ~QWindowsSockInit();
+ int version;
+};
- QSystemLibrary versionLib(QStringLiteral("version"));
- if (!versionLib.load())
- return false;
- PtrGetFileVersionInfoSizeW getFileVersionInfoSizeW = (PtrGetFileVersionInfoSizeW)versionLib.resolve("GetFileVersionInfoSizeW");
- PtrVerQueryValueW verQueryValueW = (PtrVerQueryValueW)versionLib.resolve("VerQueryValueW");
- PtrGetFileVersionInfoW getFileVersionInfoW = (PtrGetFileVersionInfoW)versionLib.resolve("GetFileVersionInfoW");
- if (!getFileVersionInfoSizeW || !verQueryValueW || !getFileVersionInfoW)
- return false;
+QWindowsSockInit::QWindowsSockInit()
+: version(0)
+{
+ //### should we try for 2.2 on all platforms ??
+ WSAData wsadata;
- const wchar_t kernel32Dll[] = L"kernel32.dll";
- DWORD handle;
- const DWORD size = getFileVersionInfoSizeW(kernel32Dll, &handle);
- if (!size)
- return false;
- QScopedArrayPointer<BYTE> versionInfo(new BYTE[size]);
- if (!getFileVersionInfoW(kernel32Dll, handle, size, versionInfo.data()))
- return false;
- UINT uLen;
- VS_FIXEDFILEINFO *fileInfo = Q_NULLPTR;
- if (!verQueryValueW(versionInfo.data(), L"\\", (LPVOID *)&fileInfo, &uLen))
- return false;
- const DWORD fileVersionMS = fileInfo->dwFileVersionMS;
- const DWORD fileVersionLS = fileInfo->dwFileVersionLS;
- result->dwMajorVersion = HIWORD(fileVersionMS);
- result->dwMinorVersion = LOWORD(fileVersionMS);
- result->dwBuildNumber = HIWORD(fileVersionLS);
- return true;
+ // IPv6 requires Winsock v2.0 or better.
+ if (WSAStartup(MAKEWORD(2,0), &wsadata) != 0) {
+ qWarning("QTcpSocketAPI: WinSock v2.0 initialization failed.");
+ } else {
+ version = 0x20;
+ }
}
-// Fallback for determining Windows versions >= 8 by looping using the
-// version check macros. Note that it will return build number=0 to avoid
-// inefficient looping.
-static inline void determineWinOsVersionFallbackPost8(OSVERSIONINFO *result)
+QWindowsSockInit::~QWindowsSockInit()
{
- result->dwBuildNumber = 0;
- DWORDLONG conditionMask = 0;
- VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(conditionMask, VER_PLATFORMID, VER_EQUAL);
- OSVERSIONINFOEX checkVersion = { sizeof(OSVERSIONINFOEX), result->dwMajorVersion, 0,
- result->dwBuildNumber, result->dwPlatformId, {'\0'}, 0, 0, 0, 0, 0 };
- for ( ; VerifyVersionInfo(&checkVersion, VER_MAJORVERSION | VER_PLATFORMID, conditionMask); ++checkVersion.dwMajorVersion)
- result->dwMajorVersion = checkVersion.dwMajorVersion;
- conditionMask = 0;
- checkVersion.dwMajorVersion = result->dwMajorVersion;
- checkVersion.dwMinorVersion = 0;
- VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_EQUAL);
- VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(conditionMask, VER_PLATFORMID, VER_EQUAL);
- for ( ; VerifyVersionInfo(&checkVersion, VER_MAJORVERSION | VER_MINORVERSION | VER_PLATFORMID, conditionMask); ++checkVersion.dwMinorVersion)
- result->dwMinorVersion = checkVersion.dwMinorVersion;
+ WSACleanup();
}
+Q_GLOBAL_STATIC(QWindowsSockInit, winsockInit)
+# endif // QT_BOOTSTRAPPED
-# endif // !Q_OS_WINCE
+#ifdef Q_OS_WINRT
+static inline HMODULE moduleHandleForFunction(LPCVOID address)
+{
+ // This is a widely used, decades-old technique for retrieving the handle
+ // of a module and is effectively equivalent to GetModuleHandleEx
+ // (which is unavailable on WinRT)
+ MEMORY_BASIC_INFORMATION mbi = { 0, 0, 0, 0, 0, 0, 0 };
+ if (VirtualQuery(address, &mbi, sizeof(mbi)) == 0)
+ return 0;
+ return reinterpret_cast<HMODULE>(mbi.AllocationBase);
+}
+#endif
static inline OSVERSIONINFO winOsVersion()
{
OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}};
+
+#ifndef Q_OS_WINCE
+#define GetProcAddressA GetProcAddress
+#endif
+
+ // GetModuleHandle is not supported in WinRT and linking to it at load time
+ // will not pass the Windows App Certification Kit... but it exists and is functional,
+ // so use some unusual but widely used techniques to get a pointer to it
+#ifdef Q_OS_WINRT
+ // 1. Get HMODULE of kernel32.dll, using the address of some function exported by that DLL
+ HMODULE kernelModule = moduleHandleForFunction(reinterpret_cast<LPCVOID>(VirtualQuery));
+ if (Q_UNLIKELY(!kernelModule))
+ return result;
+
+ // 2. Get pointer to GetModuleHandle so we can then load other arbitrary modules (DLLs)
+ typedef HMODULE(WINAPI *GetModuleHandleFunction)(LPCWSTR);
+ GetModuleHandleFunction pGetModuleHandle = reinterpret_cast<GetModuleHandleFunction>(
+ GetProcAddressA(kernelModule, "GetModuleHandleW"));
+ if (Q_UNLIKELY(!pGetModuleHandle))
+ return result;
+#else
+#define pGetModuleHandle GetModuleHandleW
+#endif
+
+ HMODULE ntdll = pGetModuleHandle(L"ntdll.dll");
+ if (Q_UNLIKELY(!ntdll))
+ return result;
+
+ // NTSTATUS is not defined on WinRT
+ typedef LONG NTSTATUS;
+ typedef NTSTATUS (NTAPI *RtlGetVersionFunction)(LPOSVERSIONINFO);
+
+ // RtlGetVersion is documented public API but we must load it dynamically
+ // because linking to it at load time will not pass the Windows App Certification Kit
+ // https://msdn.microsoft.com/en-us/library/windows/hardware/ff561910.aspx
+ RtlGetVersionFunction pRtlGetVersion = reinterpret_cast<RtlGetVersionFunction>(
+ GetProcAddressA(ntdll, "RtlGetVersion"));
+ if (Q_UNLIKELY(!pRtlGetVersion))
+ return result;
+
// GetVersionEx() has been deprecated in Windows 8.1 and will return
- // only Windows 8 from that version on.
-# if defined(_MSC_VER) && _MSC_VER >= 1800
-# pragma warning( push )
-# pragma warning( disable : 4996 )
-# endif
- GetVersionEx(&result);
-# if defined(_MSC_VER) && _MSC_VER >= 1800
-# pragma warning( pop )
-# endif
-# ifndef Q_OS_WINCE
- if (result.dwMajorVersion == 6 && result.dwMinorVersion == 2) {
- if (!determineWinOsVersionPost8(&result))
- determineWinOsVersionFallbackPost8(&result);
- }
-# endif // !Q_OS_WINCE
+ // only Windows 8 from that version on, so use the kernel API function.
+ pRtlGetVersion(&result); // always returns STATUS_SUCCESS
return result;
}
-#endif // !Q_OS_WINRT
QSysInfo::WinVersion QSysInfo::windowsVersion()
{
@@ -1990,11 +1980,10 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
static QSysInfo::WinVersion winver;
if (winver)
return winver;
-#ifdef Q_OS_WINRT
- winver = QSysInfo::WV_WINDOWS8_1;
-#else
winver = QSysInfo::WV_NT;
const OSVERSIONINFO osver = winOsVersion();
+ if (osver.dwMajorVersion == 0)
+ return QSysInfo::WV_None;
#ifdef Q_OS_WINCE
DWORD qt_cever = 0;
qt_cever = osver.dwMajorVersion * 100;
@@ -2074,7 +2063,6 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
}
}
#endif
-#endif // !Q_OS_WINRT
return winver;
}
@@ -2545,10 +2533,7 @@ QString QSysInfo::kernelType()
*/
QString QSysInfo::kernelVersion()
{
-#ifdef Q_OS_WINRT
- // TBD
- return QString();
-#elif defined(Q_OS_WIN)
+#ifdef Q_OS_WIN
const OSVERSIONINFO osver = winOsVersion();
return QString::number(int(osver.dwMajorVersion)) + QLatin1Char('.') + QString::number(int(osver.dwMinorVersion))
+ QLatin1Char('.') + QString::number(int(osver.dwBuildNumber));
@@ -2774,6 +2759,46 @@ QString QSysInfo::prettyProductName()
return unknownText();
}
+#ifndef QT_BOOTSTRAPPED
+/*!
+ \since 5.6
+
+ Returns this machine's host name, if one is configured. Note that hostnames
+ are not guaranteed to be globally unique, especially if they were
+ configured automatically.
+
+ This function does not guarantee the returned host name is a Fully
+ Qualified Domain Name (FQDN). For that, use QHostInfo to resolve the
+ returned name to an FQDN.
+
+ This function returns the same as QHostInfo::localHostName().
+
+ \sa QHostInfo::localDomainName
+ */
+QString QSysInfo::machineHostName()
+{
+#if defined(Q_OS_LINUX)
+ // gethostname(3) on Linux just calls uname(2), so do it ourselves
+ // and avoid a memcpy
+ struct utsname u;
+ if (uname(&u) == 0)
+ return QString::fromLocal8Bit(u.nodename);
+#else
+# ifdef Q_OS_WIN
+ // Important: QtNetwork depends on machineHostName() initializing ws2_32.dll
+ winsockInit();
+# endif
+
+ char hostName[512];
+ if (gethostname(hostName, sizeof(hostName)) == -1)
+ return QString();
+ hostName[sizeof(hostName) - 1] = '\0';
+ return QString::fromLocal8Bit(hostName);
+#endif
+ return QString();
+}
+#endif // QT_BOOTSTRAPPED
+
/*!
\macro void Q_ASSERT(bool test)
\relates <QtGlobal>
@@ -2885,12 +2910,15 @@ QString QSysInfo::prettyProductName()
\macro void Q_CHECK_PTR(void *pointer)
\relates <QtGlobal>
- If \a pointer is 0, prints a warning message containing the source
+ If \a pointer is 0, prints a message containing the source
code's file name and line number, saying that the program ran out
- of memory.
+ of memory and aborts program execution. It throws \c std::bad_alloc instead
+ if exceptions are enabled.
- Q_CHECK_PTR does nothing if \c QT_NO_DEBUG was defined during
- compilation.
+ Q_CHECK_PTR does nothing if \c QT_NO_DEBUG and \c QT_NO_EXCEPTIONS were
+ defined during compilation. Therefore you must not use Q_CHECK_PTR to check
+ for successful memory allocations because the check will be disabled in
+ some cases.
Example:
@@ -3020,7 +3048,7 @@ namespace {
// depending on the return type
static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf)
{
- return QString::fromLocal8Bit(buf);
+ return QString::fromLocal8Bit(buf.constData());
}
static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &)
{
@@ -3098,6 +3126,10 @@ QString qt_error_string(int errorCode)
return ret.trimmed();
}
+// In the C runtime on all platforms access to the environment is not thread-safe. We
+// 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.
/*!
@@ -3115,6 +3147,7 @@ QString qt_error_string(int errorCode)
*/
QByteArray qgetenv(const char *varName)
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
size_t requiredSize = 0;
QByteArray buffer;
@@ -3148,6 +3181,7 @@ QByteArray qgetenv(const char *varName)
*/
bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
// we provide a buffer that can only hold the empty string, so
// when the env.var isn't empty, we'll get an ERANGE error (buffer
@@ -3179,6 +3213,7 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
*/
int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
// we provide a buffer that can hold any int value:
static const int NumBinaryDigitsPerOctalDigit = 3;
@@ -3227,6 +3262,7 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
*/
bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
size_t requiredSize = 0;
(void)getenv_s(&requiredSize, 0, 0, varName);
@@ -3256,6 +3292,7 @@ bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
*/
bool qputenv(const char *varName, const QByteArray& value)
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
return _putenv_s(varName, value.constData()) == 0;
#elif (defined(_POSIX_VERSION) && (_POSIX_VERSION-0) >= 200112L) || defined(Q_OS_HAIKU)
@@ -3286,6 +3323,7 @@ bool qputenv(const char *varName, const QByteArray& value)
*/
bool qunsetenv(const char *varName)
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
return _putenv_s(varName, "") == 0;
#elif (defined(_POSIX_VERSION) && (_POSIX_VERSION-0) >= 200112L) || defined(Q_OS_BSD4) || defined(Q_OS_HAIKU)
@@ -3749,7 +3787,8 @@ int qrand()
independent copy of the object.
\li \c Q_MOVABLE_TYPE specifies that \a Type has a constructor
and/or a destructor but can be moved in memory using \c
- memcpy().
+ memcpy(). Note: despite the name, this has nothing to do with move
+ constructors or C++ move semantics.
\li \c Q_COMPLEX_TYPE (the default) specifies that \a Type has
constructors and/or a destructor and that it may not be moved
in memory.
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 97c5f37cab..2551dcb5d3 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -41,11 +41,10 @@
#include <stddef.h>
-#define QT_VERSION_STR "5.5.1"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x050501
+#define QT_VERSION QT_VERSION_CHECK(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH)
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
@@ -55,6 +54,7 @@
#include <QtCore/qconfig.h>
#include <QtCore/qfeatures.h>
#endif
+
#ifdef _MSC_VER
# define QT_SUPPORTS(FEATURE) (!defined QT_NO_##FEATURE)
#else
@@ -193,18 +193,6 @@ typedef unsigned long long quint64; /* 64 bit unsigned */
typedef qint64 qlonglong;
typedef quint64 qulonglong;
-#ifndef QT_POINTER_SIZE
-# if defined(Q_OS_WIN64) || (defined(Q_OS_WINRT) && defined(_M_X64))
-# define QT_POINTER_SIZE 8
-# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
-# define QT_POINTER_SIZE 4
-# elif defined(Q_OS_ANDROID)
-# define QT_POINTER_SIZE 4 // ### Add auto-detection to Windows configure
-# elif !defined(QT_BOOTSTRAPPED)
-# error could not determine QT_POINTER_SIZE
-# endif
-#endif
-
/*
Useful type definitions for Qt
*/
@@ -322,6 +310,15 @@ typedef double qreal;
#endif
/*
+ Some classes do not permit copies to be made of an object. These
+ classes contains a private copy constructor and assignment
+ operator to disable copying (the compiler gives an error message).
+*/
+#define Q_DISABLE_COPY(Class) \
+ Class(const Class &) Q_DECL_EQ_DELETE;\
+ Class &operator=(const Class &) Q_DECL_EQ_DELETE;
+
+/*
No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
for Qt's internal unit tests. If you want slower loading times and more
symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
@@ -439,6 +436,9 @@ template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qin
template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };
+#if defined(Q_CC_GNU) && defined(__SIZEOF_INT128__)
+template <> struct QIntegerForSize<16> { __extension__ typedef unsigned __int128 Unsigned; __extension__ typedef __int128 Signed; };
+#endif
template <class T> struct QIntegerForSizeof: QIntegerForSize<sizeof(T)> { };
typedef QIntegerForSize<Q_PROCESSOR_WORDSIZE>::Signed qregisterint;
typedef QIntegerForSize<Q_PROCESSOR_WORDSIZE>::Unsigned qregisteruint;
@@ -487,10 +487,13 @@ typedef qptrdiff qintptr;
#ifdef Q_CC_MSVC
# define Q_NEVER_INLINE __declspec(noinline)
+# define Q_ALWAYS_INLINE __forceinline
#elif defined(Q_CC_GNU)
# define Q_NEVER_INLINE __attribute__((noinline))
+# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
#else
# define Q_NEVER_INLINE
+# define Q_ALWAYS_INLINE inline
#endif
//defines the type for the WNDPROC on windows
@@ -543,7 +546,21 @@ template <typename T>
Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max)
{ return qMax(min, qMin(max, val)); }
-#ifdef Q_OS_DARWIN
+#ifndef Q_FORWARD_DECLARE_OBJC_CLASS
+# ifdef __OBJC__
+# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
+# else
+# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
+# endif
+#endif
+#ifndef Q_FORWARD_DECLARE_CF_TYPE
+# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref
+#endif
+#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE
+# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref
+#endif
+
+#ifdef Q_OS_MAC
# define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) \
((defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && osx != __MAC_NA && __MAC_OS_X_VERSION_MAX_ALLOWED >= osx) || \
(defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MAX_ALLOWED >= ios))
@@ -561,7 +578,23 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_NA, ios)
# define QT_OSX_DEPLOYMENT_TARGET_BELOW(osx) \
QT_MAC_DEPLOYMENT_TARGET_BELOW(osx, __IPHONE_NA)
-#endif
+
+QT_END_NAMESPACE
+Q_FORWARD_DECLARE_OBJC_CLASS(NSAutoreleasePool);
+QT_BEGIN_NAMESPACE
+
+// Implemented in qcore_mac_objc.mm
+class Q_CORE_EXPORT QMacAutoReleasePool
+{
+public:
+ QMacAutoReleasePool();
+ ~QMacAutoReleasePool();
+private:
+ Q_DISABLE_COPY(QMacAutoReleasePool)
+ NSAutoreleasePool *pool;
+};
+
+#endif // Q_OS_MAC
/*
Data stream functions are provided by many classes (defined in qdatastream.h)
@@ -578,7 +611,6 @@ class QDataStream;
#if defined(Q_OS_WINRT)
# define QT_NO_FILESYSTEMWATCHER
-# define QT_NO_GETADDRINFO
# define QT_NO_NETWORKPROXY
# define QT_NO_PROCESS
# define QT_NO_SOCKETNOTIFIER
@@ -727,7 +759,7 @@ inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; }
typedef void (*QFunctionPointer)();
#if !defined(Q_UNIMPLEMENTED)
-# define Q_UNIMPLEMENTED() qWarning("%s:%d: %s: Unimplemented code.", __FILE__, __LINE__, Q_FUNC_INFO)
+# define Q_UNIMPLEMENTED() qWarning("Unimplemented code.")
#endif
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2) Q_REQUIRED_RESULT Q_DECL_UNUSED;
@@ -1033,15 +1065,6 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
{ return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
#endif
-/*
- Some classes do not permit copies to be made of an object. These
- classes contains a private copy constructor and assignment
- operator to disable copying (the compiler gives an error message).
-*/
-#define Q_DISABLE_COPY(Class) \
- Class(const Class &) Q_DECL_EQ_DELETE;\
- Class &operator=(const Class &) Q_DECL_EQ_DELETE;
-
class QByteArray;
Q_CORE_EXPORT QByteArray qgetenv(const char *varName);
Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
@@ -1049,7 +1072,7 @@ Q_CORE_EXPORT bool qunsetenv(const char *varName);
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT;
-Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=0) Q_DECL_NOEXCEPT;
+Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=Q_NULLPTR) Q_DECL_NOEXCEPT;
inline int qIntCast(double f) { return int(f); }
inline int qIntCast(float f) { return int(f); }
@@ -1077,20 +1100,6 @@ template <bool B, typename T, typename F> struct QConditional { typedef T Type;
template <typename T, typename F> struct QConditional<false, T, F> { typedef F Type; };
}
-#ifndef Q_FORWARD_DECLARE_OBJC_CLASS
-# ifdef __OBJC__
-# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
-# else
-# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
-# endif
-#endif
-#ifndef Q_FORWARD_DECLARE_CF_TYPE
-# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref
-#endif
-#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE
-# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref
-#endif
-
QT_END_NAMESPACE
// We need to keep QTypeInfo, QSysInfo, QFlags, qDebug & family in qglobal.h for compatibility with Qt 4.
@@ -1104,6 +1113,7 @@ QT_END_NAMESPACE
#include <QtCore/qatomic.h>
#include <QtCore/qglobalstatic.h>
#include <QtCore/qnumeric.h>
+#include <QtCore/qversiontagging.h>
#endif /* __cplusplus */
diff --git a/src/corelib/global/qhooks_p.h b/src/corelib/global/qhooks_p.h
index 12a59a1399..3ff4980abe 100644
--- a/src/corelib/global/qhooks_p.h
+++ b/src/corelib/global/qhooks_p.h
@@ -35,6 +35,17 @@
#ifndef QHOOKS_H
#define QHOOKS_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/qglobal.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index fca8656f9b..20c31f7ef8 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -65,6 +65,9 @@
# include <systemd/sd-journal.h>
# include <syslog.h>
#endif
+#if defined(QT_USE_SYSLOG) && !defined(QT_BOOTSTRAPPED)
+# include <syslog.h>
+#endif
#ifdef Q_OS_UNIX
# include <sys/types.h>
# include <sys/stat.h>
@@ -1436,6 +1439,32 @@ static void systemd_default_message_handler(QtMsgType type,
}
#endif
+#ifdef QT_USE_SYSLOG
+static void syslog_default_message_handler(QtMsgType type, const char *message)
+{
+ int priority = LOG_INFO; // Informational
+ switch (type) {
+ case QtDebugMsg:
+ priority = LOG_DEBUG; // Debug-level messages
+ break;
+ case QtInfoMsg:
+ priority = LOG_INFO; // Informational conditions
+ break;
+ case QtWarningMsg:
+ priority = LOG_WARNING; // Warning conditions
+ break;
+ case QtCriticalMsg:
+ priority = LOG_CRIT; // Critical conditions
+ break;
+ case QtFatalMsg:
+ priority = LOG_ALERT; // Action must be taken immediately
+ break;
+ }
+
+ syslog(priority, "%s", message);
+}
+#endif
+
#ifdef Q_OS_ANDROID
static void android_default_message_handler(QtMsgType type,
const QMessageLogContext &context,
@@ -1481,6 +1510,9 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
#elif defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)
systemd_default_message_handler(type, context, logMessage);
return;
+#elif defined(QT_USE_SYSLOG) && !defined(QT_BOOTSTRAPPED)
+ syslog_default_message_handler(type, logMessage.toUtf8().constData());
+ return;
#elif defined(Q_OS_ANDROID)
android_default_message_handler(type, context, logMessage);
return;
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index 679afddb20..c63346086a 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -57,7 +57,8 @@ class QMessageLogContext
{
Q_DISABLE_COPY(QMessageLogContext)
public:
- Q_DECL_CONSTEXPR QMessageLogContext() : version(2), line(0), file(0), function(0), category(0) {}
+ Q_DECL_CONSTEXPR QMessageLogContext()
+ : version(2), line(0), file(Q_NULLPTR), function(Q_NULLPTR), category(Q_NULLPTR) {}
Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)
: version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {}
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 82b383e69c..c4f5415a01 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -496,6 +496,8 @@ public:
AA_UseSoftwareOpenGL = 17,
AA_ShareOpenGLContexts = 18,
AA_SetPalette = 19,
+ AA_EnableHighDpiScaling = 20,
+ AA_DisableHighDpiScaling = 21,
// Add new attributes before this line
AA_AttributeCount
@@ -1326,6 +1328,7 @@ public:
ImAbsolutePosition = 0x400,
ImTextBeforeCursor = 0x800,
ImTextAfterCursor = 0x1000,
+ ImEnterKeyType = 0x2000,
ImPlatformData = 0x80000000,
ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
@@ -1365,6 +1368,17 @@ public:
};
Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
+ enum EnterKeyType {
+ EnterKeyDefault,
+ EnterKeyReturn,
+ EnterKeyDone,
+ EnterKeyGo,
+ EnterKeySend,
+ EnterKeySearch,
+ EnterKeyNext,
+ EnterKeyPrevious
+ };
+
enum ToolButtonStyle {
ToolButtonIconOnly,
ToolButtonTextOnly,
@@ -1449,7 +1463,10 @@ public:
ItemIsDropEnabled = 8,
ItemIsUserCheckable = 16,
ItemIsEnabled = 32,
- ItemIsTristate = 64,
+ ItemIsAutoTristate = 64,
+#if QT_DEPRECATED_SINCE(5, 6)
+ ItemIsTristate = ItemIsAutoTristate,
+#endif
ItemNeverHasChildren = 128,
ItemIsUserTristate = 256
};
@@ -1520,9 +1537,16 @@ public:
TitleBarArea // For move
};
+#if defined(Q_COMPILER_CLASS_ENUM) && defined(Q_COMPILER_CONSTEXPR)
+ enum class Initialization {
+ Uninitialized
+ };
+ static constexpr Q_DECL_UNUSED Initialization Uninitialized = Initialization::Uninitialized;
+#else
enum Initialization {
Uninitialized
};
+#endif
enum CoordinateSystem {
DeviceCoordinates,
@@ -1610,7 +1634,8 @@ public:
enum MouseEventSource {
MouseEventNotSynthesized,
MouseEventSynthesizedBySystem,
- MouseEventSynthesizedByQt
+ MouseEventSynthesizedByQt,
+ MouseEventSynthesizedByApplication
};
enum MouseEventFlag {
@@ -1685,6 +1710,7 @@ public:
QT_Q_ENUM(InputMethodHint)
QT_Q_ENUM(InputMethodQuery)
QT_Q_FLAG(InputMethodHints)
+ QT_Q_ENUM(EnterKeyType)
QT_Q_FLAG(InputMethodQueries)
QT_Q_FLAG(TouchPointStates)
QT_Q_ENUM(ScreenOrientation)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 2323ee2cb0..7c5263ddbd 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -28,7 +28,7 @@
/*!
\namespace Qt
\inmodule QtCore
- \target Qt Namespace
+ \keyword Qt Namespace
\brief The Qt namespace contains miscellaneous identifiers
used throughout the Qt library.
@@ -137,16 +137,14 @@
attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey
will also flip accordingly (i.e., QKeySequence::Copy will be
Command+C on the keyboard regardless of the value set, though what is output for
- QKeySequence::toString(QKeySequence::PortableText) will be different).
+ QKeySequence::toString() will be different).
\value AA_Use96Dpi Assume the screen has a resolution of 96 DPI rather
than using the OS-provided resolution. This will cause font rendering
to be consistent in pixels-per-point across devices rather than
defining 1 point as 1/72 inch.
- \value AA_X11InitThreads Calls \c XInitThreads() as part of the QApplication
- construction in order to make Xlib calls thread-safe. This
- attribute must be set before QApplication is constructed.
+ \value AA_X11InitThreads This value is obsolete and has no effect.
\value AA_SynthesizeTouchForUnhandledMouseEvents All mouse events
that are not accepted by the application will be translated
@@ -170,12 +168,13 @@
\value AA_UseDesktopOpenGL Forces the usage of desktop OpenGL (for example,
\e opengl32.dll or \e libGL.so) on platforms that use dynamic loading
- of the OpenGL implementation.
- This value has been added in Qt 5.3.
+ of the OpenGL implementation. This value has been added in Qt 5.3.
+ This attribute must be set before Q(Gui)Application is constructed.
\value AA_UseOpenGLES Forces the usage of OpenGL ES 2.0 or higher on
platforms that use dynamic loading of the OpenGL implementation.
- This value has been added in Qt 5.3.
+ This value has been added in Qt 5.3. This attribute must be set
+ before Q(Gui)Application is constructed.
\value AA_UseSoftwareOpenGL Forces the usage of a software based OpenGL
implementation on platforms that use dynamic loading of the OpenGL
@@ -186,17 +185,36 @@
\c opengl32sw.dll and can be overridden by setting the environment
variable \e QT_OPENGL_DLL. See the platform-specific pages, for
instance \l{Qt for Windows}, for more information. This value has
- been added in Qt 5.4.
+ been added in Qt 5.4. This attribute must be set before
+ Q(Gui)Application is constructed.
\value AA_ShareOpenGLContexts Enables resource sharing between the OpenGL
contexts used by classes like QOpenGLWidget and QQuickWidget. This
allows sharing OpenGL resources, like textures, between QOpenGLWidget
instances that belong to different top-level windows. This value has
- been added in Qt 5.4.
+ been added in Qt 5.4. This attribute must be set before
+ Q(Gui)Application is constructed.
\value AA_SetPalette Indicates whether a palette was explicitly set on the
QApplication/QGuiApplication. This value has been added in Qt 5.5.
+ \value AA_EnableHighDpiScaling. Enables high-DPI scaling in Qt on supported
+ platforms (see also \l{High DPI Displays}). Supported platforms are
+ X11, Windows and Android. Enabling makes Qt scale the main (device
+ independent) coordinate system according to display scale factors
+ provided by the operating system. This corresponds to setting the
+ QT_AUTO_SCREEN_SCALE_FACTOR environment variable to 1. This value
+ has been added in Qt 5.6. This attribute must be set before
+ Q(Gui)Application is constructed.
+
+ \value AA_DisableHighDpiScaling Disables high-DPI scaling in Qt, exposing window
+ system coordinates. Note that the window system may do its own scaling,
+ so this does not guarantee that QPaintDevice::devicePixelRatio() will
+ be equal to 1. In addition, scale factors set by QT_SCALE_FACTOR will not
+ be affected. This corresponds to setting the QT_AUTO_SCREEN_SCALE_FACTOR
+ environment variable to 0. This value has been added in Qt 5.6. This
+ attribute must be set before Q(Gui)Application is constructed.
+
The following values are obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
@@ -764,7 +782,7 @@
\value UI_FadeTooltip Show tooltip fading effects.
\value UI_AnimateToolBox Reserved
- \sa QApplication::setEffectEnabled(), QApplication::setDesktopSettingsAware()
+ \sa QApplication::setEffectEnabled(), QGuiApplication::setDesktopSettingsAware()
*/
/*! \enum Qt::AspectRatioMode
@@ -1670,12 +1688,22 @@
\value Key_Blue
\value Key_ChannelUp
\value Key_ChannelDown
+ \value Key_Guide
+ \value Key_Info
+ \value Key_Settings
+ \value Key_MicVolumeUp
+ \value Key_MicVolumeDown
+ \value Key_New
+ \value Key_Open
+ \value Key_Find
+ \value Key_Undo
+ \value Key_Redo
\value Key_MediaLast
\value Key_unknown
\value Key_Call A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
- \value Key_Camera A key to activate the camera shutter
- \value Key_CameraFocus A key to focus the camera
+ \value Key_Camera A key to activate the camera shutter. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
+ \value Key_CameraFocus A key to focus the camera. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
\value Key_Context1
\value Key_Context2
\value Key_Context3
@@ -1694,6 +1722,7 @@
\value Key_Play
\value Key_Sleep
\value Key_Zoom
+ \value Key_Exit
\value Key_Cancel
\value Key_MicVolumeUp
\value Key_Find
@@ -2397,7 +2426,7 @@
\value WhatsThisCursor \inlineimage cursor-whatsthis.png
An arrow with a question mark, typically used to indicate
the presence of What's This? help for a widget.
- \value BusyCursor \inlineimage cursor-wait.png
+ \value BusyCursor \inlineimage cursor-busy.png
An hourglass or watch cursor, usually shown during
operations that allow the user to interact with
the application while they are performed in the
@@ -2435,7 +2464,7 @@
When LayoutDirectionAuto is used in conjunction with text layouting, it will imply that the text
directionality is determined from the content of the string to be layouted.
- \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), QString::isRightToLeft()
+ \sa QGuiApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), QString::isRightToLeft()
*/
/*!
@@ -2527,6 +2556,7 @@
but \b{must} not return an empty string unless the cursor is at the start of the document.
\value ImTextAfterCursor The plain text after the cursor. The widget can decide how much text to return,
but \b{must} not return an empty string unless the cursor is at the end of the document.
+ \value ImEnterKeyType The Enter key type.
Masks:
@@ -2537,6 +2567,37 @@
*/
/*!
+ \enum Qt::EnterKeyType
+
+ This can be used to alter the appearance of the Return key on an on-screen keyboard.
+
+ \note Not all of these values are supported on all platforms.
+ For unsupported values the default key will be used instead.
+
+ \value EnterKeyDefault The default Enter key.
+ This can either be a button closing the keyboard, or a Return button
+ causing a new line in case of a multi-line input field.
+ \value EnterKeyReturn Show a Return button that inserts a new line.
+ The keyboard will not close when this button is pressed.
+ \value EnterKeyDone Show a "Done" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeyGo Show a "Go" button.
+ Typically used in an address bar when entering a URL; the keyboard
+ will close when this button is pressed.
+ \value EnterKeySend Show a "Send" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeySearch Show a "Search" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeyNext Show a "Next" button.
+ Typically used in a form to allow navigating to the next input field;
+ the keyboard will not close when this button is pressed.
+ \value EnterKeyPrevious Show a "Previous" button.
+ The keyboard will not close when this button is pressed.
+
+ \since 5.6
+*/
+
+/*!
\enum Qt::ItemDataRole
Each item in the model has a set of data elements associated with
@@ -2611,10 +2672,12 @@
\value ItemIsDropEnabled It can be used as a drop target.
\value ItemIsUserCheckable It can be checked or unchecked by the user.
\value ItemIsEnabled The user can interact with the item.
- \value ItemIsTristate The item can show three separate states.
+ \value ItemIsAutoTristate The item's state depends on the state of its children.
This enables automatic management of the state of parent items in QTreeWidget
(checked if all children are checked, unchecked if all children are unchecked,
or partially checked if only some children are checked).
+ \value ItemIsTristate \e{This enum value is deprecated.} Use Qt::ItemIsAutoTristate
+ instead.
\value ItemNeverHasChildren The item never has child items.
This is used for optimization purposes only.
\value ItemIsUserTristate The user can cycle through three separate states.
@@ -2673,7 +2736,7 @@
"\l{http://bugreports.qt.io/browse/QTWEBSITE-13}{http://bugreports.qt.../QTWEBSITE-13/}"),
whereas Qt::ElideRight is appropriate
for other strings (e.g.,
- "\l{http://doc.qt.digia.com/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}").
+ "\l{http://doc.qt.io/archives/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}").
\sa QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag, QTabBar::elideMode
*/
@@ -3035,6 +3098,12 @@
\value MouseEventSynthesizedByQt Indicates that the mouse event was
synthesized from an unhandled touch event by Qt.
+ \value MouseEventSynthesizedByApplication Indicates that the mouse
+ event was synthesized by the application. This allows
+ distinguishing application-generated mouse events from the ones
+ that are coming from the system or are synthesized by Qt. This
+ value was introduced in Qt 5.6
+
\sa Qt::AA_SynthesizeMouseForUnhandledTouchEvents
*/
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 5fa0a881a3..b18d521d05 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -47,6 +48,18 @@
#include "QtCore/qglobal.h"
+#include <limits>
+
+#if defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)
+# include <intrin.h>
+#elif defined(Q_CC_INTEL)
+# include <immintrin.h> // for _addcarry_u<nn>
+#endif
+
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+
QT_BEGIN_NAMESPACE
#if !defined(Q_CC_MIPS)
@@ -188,6 +201,110 @@ static inline bool qt_is_finite(float d)
}
}
+//
+// Overflow math
+//
+namespace {
+template <typename T> inline typename QtPrivate::QEnableIf<QtPrivate::is_unsigned<T>::value, bool>::Type
+add_overflow(T v1, T v2, T *r)
+{
+ // unsigned additions are well-defined
+ *r = v1 + v2;
+ return v1 > T(v1 + v2);
+}
+
+template <typename T> inline typename QtPrivate::QEnableIf<QtPrivate::is_unsigned<T>::value, bool>::Type
+mul_overflow(T v1, T v2, T *r)
+{
+ // use the next biggest type
+ // Note: for 64-bit systems where __int128 isn't supported, this will cause an error.
+ // A fallback is present below.
+ typedef typename QIntegerForSize<sizeof(T) * 2>::Unsigned Larger;
+ Larger lr = Larger(v1) * Larger(v2);
+ *r = T(lr);
+ return lr > std::numeric_limits<T>::max();
+}
+
+#if defined(__SIZEOF_INT128__)
+# define HAVE_MUL64_OVERFLOW
+#endif
+
+// GCC 5 and Clang have builtins to detect overflows
+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_uadd_overflow)
+template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r)
+{ return __builtin_uadd_overflow(v1, v2, r); }
+#endif
+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_uaddl_overflow)
+template <> inline bool add_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
+{ return __builtin_uaddl_overflow(v1, v2, r); }
+#endif
+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_uaddll_overflow)
+template <> inline bool add_overflow(unsigned long long v1, unsigned long long v2, unsigned long long *r)
+{ return __builtin_uaddll_overflow(v1, v2, r); }
+#endif
+
+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_umul_overflow)
+template <> inline bool mul_overflow(unsigned v1, unsigned v2, unsigned *r)
+{ return __builtin_umul_overflow(v1, v2, r); }
+#endif
+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_umull_overflow)
+template <> inline bool mul_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
+{ return __builtin_umull_overflow(v1, v2, r); }
+#endif
+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_umulll_overflow)
+template <> inline bool mul_overflow(unsigned long long v1, unsigned long long v2, unsigned long long *r)
+{ return __builtin_umulll_overflow(v1, v2, r); }
+# define HAVE_MUL64_OVERFLOW
+#endif
+
+#if ((defined(Q_CC_MSVC) && _MSC_VER >= 1800) || defined(Q_CC_INTEL)) && defined(Q_PROCESSOR_X86)
+template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r)
+{ return _addcarry_u32(0, v1, v2, r); }
+# ifdef Q_CC_MSVC // longs are 32-bit
+template <> inline bool add_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
+{ return _addcarry_u32(0, v1, v2, reinterpret_cast<unsigned *>(r)); }
+# endif
+#endif
+#if ((defined(Q_CC_MSVC) && _MSC_VER >= 1800) || defined(Q_CC_INTEL)) && defined(Q_PROCESSOR_X86_64)
+template <> inline bool add_overflow(quint64 v1, quint64 v2, quint64 *r)
+{ return _addcarry_u64(0, v1, v2, reinterpret_cast<unsigned __int64 *>(r)); }
+# ifndef Q_CC_MSVC // longs are 64-bit
+template <> inline bool add_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
+{ return _addcarry_u64(0, v1, v2, reinterpret_cast<unsigned __int64 *>(r)); }
+# endif
+#endif
+
+#if defined(Q_CC_MSVC) && (defined(Q_PROCESSOR_X86_64) || defined(Q_PROCESSOR_IA64))
+#pragma intrinsic(_umul128)
+template <> inline bool mul_overflow(quint64 v1, quint64 v2, quint64 *r)
+{
+ // use 128-bit multiplication with the _umul128 intrinsic
+ // https://msdn.microsoft.com/en-us/library/3dayytw9.aspx
+ quint64 high;
+ *r = _umul128(v1, v2, &high);
+ return high;
+}
+# define HAVE_MUL64_OVERFLOW
+#endif
+
+#if !defined(HAVE_MUL64_OVERFLOW) && defined(__LP64__)
+// no 128-bit multiplication, we need to figure out with a slow division
+template <> inline bool mul_overflow(quint64 v1, quint64 v2, quint64 *r)
+{
+ if (v2 && v1 > std::numeric_limits<quint64>::max() / v2)
+ return true;
+ *r = v1 * v2;
+ return false;
+}
+template <> inline bool mul_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
+{
+ return mul_overflow<quint64>(v1, v2, reinterpret_cast<quint64 *>(r));
+}
+#else
+# undef HAVE_MUL64_OVERFLOW
+#endif
+}
+
QT_END_NAMESPACE
#endif // QNUMERIC_P_H
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index a026224021..f80e9c1535 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -88,43 +88,51 @@
auto-detection implemented below.
*/
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__)
-# define Q_PROCESSOR_ARM
# if defined(__aarch64__)
# define Q_PROCESSOR_ARM_64
+# define Q_PROCESSOR_WORDSIZE 8
# else
# define Q_PROCESSOR_ARM_32
# endif
-# if defined(__ARM64_ARCH_8__)
-# define Q_PROCESSOR_ARM_V8
-# define Q_PROCESSOR_ARM_V7
-# define Q_PROCESSOR_ARM_V6
-# define Q_PROCESSOR_ARM_V5
+# if defined(__ARM_ARCH) && __ARM_ARCH > 1
+# define Q_PROCESSOR_ARM __ARM_ARCH
+# elif defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM > 1
+# define Q_PROCESSOR_ARM __TARGET_ARCH_ARM
+# elif defined(_M_ARM) && _M_ARM > 1
+# define Q_PROCESSOR_ARM _M_ARM
+# elif defined(__ARM64_ARCH_8__)
+# define Q_PROCESSOR_ARM 8
# elif defined(__ARM_ARCH_7__) \
|| defined(__ARM_ARCH_7A__) \
|| defined(__ARM_ARCH_7R__) \
|| defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7S__) \
- || defined(_ARM_ARCH_7) \
- || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) \
- || (defined(_M_ARM) && _M_ARM-0 >= 7)
-# define Q_PROCESSOR_ARM_V7
-# define Q_PROCESSOR_ARM_V6
-# define Q_PROCESSOR_ARM_V5
+ || defined(_ARM_ARCH_7)
+# define Q_PROCESSOR_ARM 7
# elif defined(__ARM_ARCH_6__) \
|| defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6T2__) \
|| defined(__ARM_ARCH_6Z__) \
|| defined(__ARM_ARCH_6K__) \
|| defined(__ARM_ARCH_6ZK__) \
- || defined(__ARM_ARCH_6M__) \
- || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) \
- || (defined(_M_ARM) && _M_ARM-0 >= 6)
-# define Q_PROCESSOR_ARM_V6
-# define Q_PROCESSOR_ARM_V5
+ || defined(__ARM_ARCH_6M__)
+# define Q_PROCESSOR_ARM 6
# elif defined(__ARM_ARCH_5TEJ__) \
- || defined(__ARM_ARCH_5TE__) \
- || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) \
- || (defined(_M_ARM) && _M_ARM-0 >= 5)
+ || defined(__ARM_ARCH_5TE__)
+# define Q_PROCESSOR_ARM 5
+# else
+# define Q_PROCESSOR_ARM 0
+# endif
+# if Q_PROCESSOR_ARM >= 8
+# define Q_PROCESSOR_ARM_V8
+# endif
+# if Q_PROCESSOR_ARM >= 7
+# define Q_PROCESSOR_ARM_V7
+# endif
+# if Q_PROCESSOR_ARM >= 6
+# define Q_PROCESSOR_ARM_V6
+# endif
+# if Q_PROCESSOR_ARM >= 5
# define Q_PROCESSOR_ARM_V5
# endif
# if defined(__ARMEL__)
@@ -228,6 +236,7 @@
# endif
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
# define Q_PROCESSOR_MIPS_64
+# define Q_PROCESSOR_WORDSIZE 8
# endif
# if defined(__MIPSEL__)
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
@@ -252,6 +261,7 @@
# define Q_PROCESSOR_POWER
# if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
# define Q_PROCESSOR_POWER_64
+# define Q_PROCESSOR_WORDSIZE 8
# else
# define Q_PROCESSOR_POWER_32
# endif
@@ -323,6 +333,28 @@
#endif
/*
+ Size of a pointer and the machine register size. We detect a 64-bit system by:
+ * GCC and compatible compilers (Clang, ICC on OS X and Windows) always define
+ __SIZEOF_POINTER__. This catches all known cases of ILP32 builds on 64-bit
+ processors.
+ * Most other Unix compilers define __LP64__ or _LP64 on 64-bit mode
+ (Long and Pointer 64-bit)
+ * If Q_PROCESSOR_WORDSIZE was defined above, it's assumed to match the pointer
+ size.
+ Otherwise, we assume to be 32-bit and then check in qglobal.cpp that it is right.
+*/
+
+#if defined __SIZEOF_POINTER__
+# define QT_POINTER_SIZE __SIZEOF_POINTER__
+#elif defined(__LP64__) || defined(_LP64)
+# define QT_POINTER_SIZE 8
+#elif defined(Q_PROCESSOR_WORDSIZE)
+# define QT_POINTER_SIZE Q_PROCESSOR_WORDSIZE
+#else
+# define QT_POINTER_SIZE 4
+#endif
+
+/*
Define Q_PROCESSOR_WORDSIZE to be the size of the machine's word (usually,
the size of the register). On some architectures where a pointer could be
smaller than the register, the macro is defined above.
@@ -330,14 +362,8 @@
Falls back to QT_POINTER_SIZE if not set explicitly for the platform.
*/
#ifndef Q_PROCESSOR_WORDSIZE
-# ifdef __SIZEOF_POINTER__
- /* GCC & friends define this */
-# define Q_PROCESSOR_WORDSIZE __SIZEOF_POINTER__
-# elif defined(_LP64) || defined(__LP64__) || defined(WIN64) || defined(_WIN64)
-# define Q_PROCESSOR_WORDSIZE 8
-# else
-# define Q_PROCESSOR_WORDSIZE QT_POINTER_SIZE
-# endif
+# define Q_PROCESSOR_WORDSIZE QT_POINTER_SIZE
#endif
+
#endif // QPROCESSORDETECTION_H
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index 625b366cc6..27a285fd36 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -125,19 +125,19 @@ public:
MV_Unknown = 0x0000,
/* version */
- MV_9 = 0x0001,
- MV_10_0 = 0x0002,
- MV_10_1 = 0x0003,
- MV_10_2 = 0x0004,
- MV_10_3 = 0x0005,
- MV_10_4 = 0x0006,
- MV_10_5 = 0x0007,
- MV_10_6 = 0x0008,
- MV_10_7 = 0x0009,
- MV_10_8 = 0x000A,
- MV_10_9 = 0x000B,
- MV_10_10 = 0x000C,
- MV_10_11 = 0x000D,
+ MV_9 = Q_MV_OSX(9, 0),
+ MV_10_0 = Q_MV_OSX(10, 0),
+ MV_10_1 = Q_MV_OSX(10, 1),
+ MV_10_2 = Q_MV_OSX(10, 2),
+ MV_10_3 = Q_MV_OSX(10, 3),
+ MV_10_4 = Q_MV_OSX(10, 4),
+ MV_10_5 = Q_MV_OSX(10, 5),
+ MV_10_6 = Q_MV_OSX(10, 6),
+ MV_10_7 = Q_MV_OSX(10, 7),
+ MV_10_8 = Q_MV_OSX(10, 8),
+ MV_10_9 = Q_MV_OSX(10, 9),
+ MV_10_10 = Q_MV_OSX(10, 10),
+ MV_10_11 = Q_MV_OSX(10, 11),
/* codenames */
MV_CHEETAH = MV_10_0,
@@ -186,6 +186,8 @@ public:
static QString productType();
static QString productVersion();
static QString prettyProductName();
+
+ static QString machineHostName();
};
QT_END_NAMESPACE
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 562427e4b9..751c6a9a0e 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -94,7 +94,7 @@
# else
# define Q_OS_DARWIN32
# endif
-#elif defined(ANDROID)
+#elif defined(__ANDROID__) || defined(ANDROID)
# define Q_OS_ANDROID
# define Q_OS_LINUX
#elif defined(__CYGWIN__)
@@ -109,7 +109,7 @@
# if defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP
# define Q_OS_WINPHONE
# define Q_OS_WINRT
-# elif WINAPI_FAMILY==WINAPI_FAMILY_APP
+# elif WINAPI_FAMILY==WINAPI_FAMILY_PC_APP
# define Q_OS_WINRT
# else
# define Q_OS_WIN32
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index 90ac8c6a0c..b42e5998fc 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -32,6 +32,7 @@
****************************************************************************/
#include <QtCore/qtypetraits.h>
+#include <QtCore/qisenum.h>
#ifndef QTYPEINFO_H
#define QTYPEINFO_H
@@ -55,6 +56,7 @@ public:
isIntegral = QtPrivate::is_integral<T>::value,
isComplex = true,
isStatic = true,
+ isRelocatable = Q_IS_ENUM(T),
isLarge = (sizeof(T)>sizeof(void*)),
isDummy = false, //### Qt6: remove
sizeOf = sizeof(T)
@@ -70,6 +72,7 @@ public:
isIntegral = false,
isComplex = false,
isStatic = false,
+ isRelocatable = false,
isLarge = false,
isDummy = false,
sizeOf = 0
@@ -85,6 +88,7 @@ public:
isIntegral = false,
isComplex = false,
isStatic = false,
+ isRelocatable = true,
isLarge = false,
isDummy = false,
sizeOf = sizeof(T*)
@@ -92,6 +96,32 @@ public:
};
/*!
+ \class QTypeInfoQuery
+ \inmodule QtCore
+ \internal
+ \brief QTypeInfoQuery is used to query the values of a given QTypeInfo<T>
+
+ We use it because there may be some QTypeInfo<T> specializations in user
+ code that don't provide certain flags that we added after Qt 5.0. They are:
+ \list
+ \li isRelocatable: defaults to !isStatic
+ \endlist
+
+ DO NOT specialize this class elsewhere.
+*/
+// apply defaults for a generic QTypeInfo<T> that didn't provide the new values
+template <typename T, typename = void>
+struct QTypeInfoQuery : QTypeInfo<T>
+{
+ enum { isRelocatable = !QTypeInfo<T>::isStatic };
+};
+
+// if QTypeInfo<T>::isRelocatable exists, use it
+template <typename T>
+struct QTypeInfoQuery<T, typename QtPrivate::QEnableIf<QTypeInfo<T>::isRelocatable || true>::Type> : QTypeInfo<T>
+{};
+
+/*!
\class QTypeInfoMerger
\inmodule QtCore
\internal
@@ -116,8 +146,12 @@ class QTypeInfoMerger
{
public:
enum {
- isComplex = QTypeInfo<T1>::isComplex || QTypeInfo<T2>::isComplex || QTypeInfo<T3>::isComplex || QTypeInfo<T4>::isComplex,
- isStatic = QTypeInfo<T1>::isStatic || QTypeInfo<T2>::isStatic || QTypeInfo<T3>::isStatic || QTypeInfo<T4>::isStatic,
+ isComplex = QTypeInfoQuery<T1>::isComplex || QTypeInfoQuery<T2>::isComplex
+ || QTypeInfoQuery<T3>::isComplex || QTypeInfoQuery<T4>::isComplex,
+ isStatic = QTypeInfoQuery<T1>::isStatic || QTypeInfoQuery<T2>::isStatic
+ || QTypeInfoQuery<T3>::isStatic || QTypeInfoQuery<T4>::isStatic,
+ isRelocatable = QTypeInfoQuery<T1>::isRelocatable && QTypeInfoQuery<T2>::isRelocatable
+ && QTypeInfoQuery<T3>::isRelocatable && QTypeInfoQuery<T4>::isRelocatable,
isLarge = sizeof(T) > sizeof(void*),
isPointer = false,
isIntegral = false,
@@ -136,19 +170,20 @@ public: \
isPointer = false, \
isIntegral = false, \
isComplex = true, \
+ isRelocatable = true, \
isStatic = false, \
isLarge = (sizeof(CONTAINER<T>) > sizeof(void*)), \
isDummy = false, \
sizeOf = sizeof(CONTAINER<T>) \
}; \
-};
+}
-Q_DECLARE_MOVABLE_CONTAINER(QList)
-Q_DECLARE_MOVABLE_CONTAINER(QVector)
-Q_DECLARE_MOVABLE_CONTAINER(QQueue)
-Q_DECLARE_MOVABLE_CONTAINER(QStack)
-Q_DECLARE_MOVABLE_CONTAINER(QLinkedList)
-Q_DECLARE_MOVABLE_CONTAINER(QSet)
+Q_DECLARE_MOVABLE_CONTAINER(QList);
+Q_DECLARE_MOVABLE_CONTAINER(QVector);
+Q_DECLARE_MOVABLE_CONTAINER(QQueue);
+Q_DECLARE_MOVABLE_CONTAINER(QStack);
+Q_DECLARE_MOVABLE_CONTAINER(QLinkedList);
+Q_DECLARE_MOVABLE_CONTAINER(QSet);
#undef Q_DECLARE_MOVABLE_CONTAINER
@@ -164,8 +199,9 @@ enum { /* TYPEINFO flags */
Q_COMPLEX_TYPE = 0,
Q_PRIMITIVE_TYPE = 0x1,
Q_STATIC_TYPE = 0,
- Q_MOVABLE_TYPE = 0x2,
- Q_DUMMY_TYPE = 0x4
+ Q_MOVABLE_TYPE = 0x2, // ### Qt6: merge movable and relocatable once QList no longer depends on it
+ Q_DUMMY_TYPE = 0x4,
+ Q_RELOCATABLE_TYPE = 0x8
};
#define Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) \
@@ -175,6 +211,7 @@ public: \
enum { \
isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \
isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \
+ isRelocatable = !isStatic || ((FLAGS) & Q_RELOCATABLE_TYPE), \
isLarge = (sizeof(TYPE)>sizeof(void*)), \
isPointer = false, \
isIntegral = QtPrivate::is_integral< TYPE >::value, \
@@ -201,13 +238,22 @@ Q_DECLARE_TYPEINFO_BODY(QFlags<T>, Q_PRIMITIVE_TYPE);
where 'type' is the name of the type to specialize. NOTE: shared
types must define a member-swap, and be defined in the same
namespace as Qt for this to work.
+
+ If the type was already released without Q_DECLARE_SHARED applied,
+ _and_ without an explicit Q_DECLARE_TYPEINFO(type, Q_MOVABLE_TYPE),
+ then use Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(type) to mark the
+ type shared (incl. swap()), without marking it movable (which
+ would change the memory layout of QList, a BiC change.
*/
-#define Q_DECLARE_SHARED(TYPE) \
-Q_DECLARE_TYPEINFO(TYPE, Q_MOVABLE_TYPE); \
+#define Q_DECLARE_SHARED_IMPL(TYPE, FLAGS) \
+Q_DECLARE_TYPEINFO(TYPE, FLAGS); \
inline void swap(TYPE &value1, TYPE &value2) \
Q_DECL_NOEXCEPT_EXPR(noexcept(value1.swap(value2))) \
{ value1.swap(value2); }
+#define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE)
+#define Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(TYPE) \
+ Q_DECLARE_SHARED_IMPL(TYPE, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE)
/*
QTypeInfo primitive specializations
diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp
new file mode 100644
index 0000000000..e7524f39ef
--- /dev/null
+++ b/src/corelib/global/qversiontagging.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 "qglobal.h"
+
+#define SYM QT_MANGLE_NAMESPACE(qt_version_tag)
+//#define SSYM QT_STRINGIFY(SYM)
+
+#if defined(Q_CC_GNU) && defined(Q_OF_ELF) && !defined(Q_OS_ANDROID)
+# define make_versioned_symbol2(sym, m, n, separator) \
+ Q_CORE_EXPORT extern const char sym ## _ ## m ## _ ## n = 0; \
+ asm(".symver " QT_STRINGIFY(sym) "_" QT_STRINGIFY(m) "_" QT_STRINGIFY(n) ", " \
+ QT_STRINGIFY(sym) separator "Qt_" QT_STRINGIFY(m) "." QT_STRINGIFY(n))
+#else
+# define make_versioned_symbol2(sym, m, n, separator)
+#endif
+#define make_versioned_symbol(sym, m, n, separator) make_versioned_symbol2(sym, m, n, separator)
+
+extern "C" {
+#if QT_VERSION_MINOR > 0
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 0, "@");
+#endif
+#if QT_VERSION_MINOR > 1
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 1, "@");
+#endif
+#if QT_VERSION_MINOR > 2
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 2, "@");
+#endif
+#if QT_VERSION_MINOR > 3
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 3, "@");
+#endif
+#if QT_VERSION_MINOR > 4
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 4, "@");
+#endif
+#if QT_VERSION_MINOR > 5
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 5, "@");
+#endif
+#if QT_VERSION_MINOR > 6
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 6, "@");
+#endif
+#if QT_VERSION_MINOR > 7
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 7, "@");
+#endif
+#if QT_VERSION_MINOR > 8
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 8, "@");
+#endif
+#if QT_VERSION_MINOR > 9
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 9, "@");
+#endif
+#if QT_VERSION_MINOR > 10
+# error "Please update this file with more Qt versions."
+#endif
+
+// the default version:
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, QT_VERSION_MINOR, "@@");
+}
diff --git a/src/corelib/global/qversiontagging.h b/src/corelib/global/qversiontagging.h
new file mode 100644
index 0000000000..4a1c01c89d
--- /dev/null
+++ b/src/corelib/global/qversiontagging.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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$
+**
+****************************************************************************/
+
+// qglobal.h includes this header, so keep it outside of our include guards
+#include <QtCore/qglobal.h>
+
+#if !defined(QVERSIONTAGGING_H)
+#define QVERSIONTAGGING_H
+
+QT_BEGIN_NAMESPACE
+
+/*
+ * Ugly hack warning and explanation:
+ *
+ * This file causes all ELF modules, be they libraries or applications, to use the
+ * qt_version_tag symbol that is present in QtCore. Such symbol is versioned,
+ * so the linker will automatically pull the current Qt version and add it to
+ * the ELF header of the library/application. The assembly produces one section
+ * called ".qtversion" containing two pointer-sized values. The first is a
+ * relocation to the qt_version_tag symbol (which is what causes the ELF
+ * version to get used). The second value is the current Qt version at the time
+ * of compilation.
+ *
+ * There will only be one copy of the section in the output library or application.
+ */
+
+#if defined(QT_BUILD_CORE_LIB) || defined(QT_BOOTSTRAPPED) || defined(QT_NO_VERSION_TAGGING)
+// don't make tags in QtCore, bootstrapped systems or if the user asked not to
+#elif defined(Q_CC_GNU) && !defined(Q_OS_ANDROID)
+# if defined(Q_PROCESSOR_X86) && (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD_KERNEL))
+# ifdef __LP64__
+# define QT_VERSION_TAG_RELOC(sym) ".quad " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOTPCREL\n"
+# elif defined(Q_PROCESSOR_X86_64) // x32
+# define QT_VERSION_TAG_RELOC(sym) ".long " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOTPCREL\n"
+# else // x86
+# define QT_VERSION_TAG_RELOC(sym) ".long " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOT\n"
+# endif
+# define QT_VERSION_TAG(sym) \
+ asm ( \
+ ".section .qtversion, \"aG\", @progbits, qt_version_tag, comdat\n" \
+ ".align 8\n" \
+ QT_VERSION_TAG_RELOC(sym) \
+ ".long " QT_STRINGIFY(QT_VERSION) "\n" \
+ ".align 8\n" \
+ ".previous" \
+ )
+# endif
+#endif
+
+#if defined(QT_VERSION_TAG)
+QT_VERSION_TAG(qt_version_tag);
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QVERSIONTAGGING_H
diff --git a/src/corelib/io/forkfd_qt.cpp b/src/corelib/io/forkfd_qt.cpp
index d282c08fbd..b226332cc1 100644
--- a/src/corelib/io/forkfd_qt.cpp
+++ b/src/corelib/io/forkfd_qt.cpp
@@ -32,22 +32,6 @@
****************************************************************************/
// these might be defined via precompiled headers
-#ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200809L
-#endif
-#if !defined(_XOPEN_SOURCE) && !defined(__QNXNTO__) && !defined(ANDROID)
-# define _XOPEN_SOURCE 700
-#endif
-
-// Define BSD visibility macros. These are also defined in forkfd.c, but the
-// headers using them may be included before forkfd.c itself.
-#ifndef _NETBSD_SOURCE
-# define _NETBSD_SOURCE 1
-#endif
-#ifndef __BSD_VISIBLE
-# define __BSD_VISIBLE 1
-#endif
-
#include <QtCore/qatomic.h>
#include "qprocess_p.h"
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index f496d037d8..b2bcbdf727 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -160,6 +160,7 @@ win32 {
} else:ios {
OBJECTIVE_SOURCES += io/qstandardpaths_ios.mm
SOURCES += io/qstorageinfo_mac.cpp
+ LIBS += -framework MobileCoreServices
} else {
SOURCES += io/qstandardpaths_unix.cpp
}
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 07270eb790..2ab789e0af 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -891,7 +891,6 @@ bool QAbstractFileEngine::unmap(uchar *address)
/*!
\typedef QAbstractFileEngine::Iterator
\since 4.3
- \relates QAbstractFileEngine
Synonym for QAbstractFileEngineIterator.
*/
diff --git a/src/corelib/io/qbuffer.h b/src/corelib/io/qbuffer.h
index 1b2758d040..233c702213 100644
--- a/src/corelib/io/qbuffer.h
+++ b/src/corelib/io/qbuffer.h
@@ -51,8 +51,8 @@ class Q_CORE_EXPORT QBuffer : public QIODevice
public:
#ifndef QT_NO_QOBJECT
- explicit QBuffer(QObject *parent = 0);
- QBuffer(QByteArray *buf, QObject *parent = 0);
+ explicit QBuffer(QObject *parent = Q_NULLPTR);
+ QBuffer(QByteArray *buf, QObject *parent = Q_NULLPTR);
#else
QBuffer();
explicit QBuffer(QByteArray *buf);
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 48672db2e9..675178ea80 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -526,6 +526,7 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_5_3 Same as Qt_5_2
\value Qt_5_4 Version 16 (Qt 5.4)
\value Qt_5_5 Same as Qt_5_4
+ \value Qt_5_6 Version 17 (Qt 5.6)
\omitvalue Qt_DefaultCompiledVersion
\sa setVersion(), version()
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index 436bf8dd57..5730c12907 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -83,10 +83,11 @@ public:
Qt_5_3 = Qt_5_2,
Qt_5_4 = 16,
Qt_5_5 = Qt_5_4,
-#if QT_VERSION >= 0x050600
+ Qt_5_6 = 17,
+#if QT_VERSION >= 0x050700
#error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion
#endif
- Qt_DefaultCompiledVersion = Qt_5_5
+ Qt_DefaultCompiledVersion = Qt_5_6
};
enum ByteOrder {
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 6b8f832eed..81af96b96b 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -351,6 +351,7 @@ QDebug &QDebug::resetFormat()
stream->space = true;
if (stream->context.version > 1)
stream->flags = 0;
+ stream->setVerbosity(Stream::defaultVerbosity);
return *this;
}
@@ -444,6 +445,32 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn int QDebug::verbosity() const
+ \since 5.6
+
+ Returns the verbosity of the debug stream.
+
+ Streaming operators can check the value to decide whether
+ verbose output is desired and print more information depending on the
+ level. Higher values indicate that more information is desired.
+
+ The allowed range is from 0 to 7. The default value is 2.
+
+ \sa setVerbosity()
+*/
+
+/*!
+ \fn void QDebug::setVerbosity(int verbosityLevel)
+ \since 5.6
+
+ Sets the verbosity of the stream to \a verbosityLevel.
+
+ The allowed range is from 0 to 7. The default value is 2.
+
+ \sa verbosity()
+*/
+
+/*!
\fn QDebug &QDebug::operator<<(QChar t)
Writes the character, \a t, to the stream and returns a reference to the
@@ -726,7 +753,7 @@ QDebug &QDebug::resetFormat()
/*!
\class QDebugStateSaver
-
+ \inmodule QtCore
\brief Convenience class for custom QDebug operators
Saves the settings used by QDebug, and restores them upon destruction,
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 7c75608e2a..b1a0396f35 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -53,9 +53,14 @@ class Q_CORE_EXPORT QDebug
friend class QMessageLogger;
friend class QDebugStateSaverPrivate;
struct Stream {
- Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false), flags(0) {}
- Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false), flags(0) {}
- Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), space(true), message_output(true), flags(0) {}
+ enum { defaultVerbosity = 2, verbosityShift = 29, verbosityMask = 0x7 };
+
+ Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg),
+ space(true), message_output(false), flags(defaultVerbosity << verbosityShift) {}
+ Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg),
+ space(true), message_output(false), flags(defaultVerbosity << verbosityShift) {}
+ Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t),
+ space(true), message_output(true), flags(defaultVerbosity << verbosityShift) {}
QTextStream ts;
QString buffer;
int ref;
@@ -64,7 +69,7 @@ class Q_CORE_EXPORT QDebug
bool message_output;
QMessageLogContext context;
- enum FormatFlag {
+ enum FormatFlag { // Note: Bits 29..31 are reserved for the verbose level introduced in 5.6.
NoQuotes = 0x1
};
@@ -72,7 +77,15 @@ class Q_CORE_EXPORT QDebug
bool testFlag(FormatFlag flag) const { return (context.version > 1) ? (flags & flag) : false; }
void setFlag(FormatFlag flag) { if (context.version > 1) { flags |= flag; } }
void unsetFlag(FormatFlag flag) { if (context.version > 1) { flags &= ~flag; } }
-
+ int verbosity() const
+ { return context.version > 1 ? (flags >> verbosityShift) & verbosityMask : int(Stream::defaultVerbosity); }
+ void setVerbosity(int v)
+ {
+ if (context.version > 1) {
+ flags &= ~(verbosityMask << verbosityShift);
+ flags |= (v & verbosityMask) << verbosityShift;
+ }
+ }
// added in 5.4
int flags;
} *stream;
@@ -96,6 +109,8 @@ public:
inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
inline QDebug &nospace() { stream->space = false; return *this; }
inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
+ int verbosity() const { return stream->verbosity(); }
+ void setVerbosity(int verbosityLevel) { stream->setVerbosity(verbosityLevel); }
bool autoInsertSpaces() const { return stream->space; }
void setAutoInsertSpaces(bool b) { stream->space = b; }
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index f6e132708e..4d2b36632f 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -138,7 +138,7 @@ inline QChar QDirPrivate::getFilterSepChar(const QString &nameFilter)
// static
inline QStringList QDirPrivate::splitFilters(const QString &nameFilter, QChar sep)
{
- if (sep == 0)
+ if (sep.isNull())
sep = getFilterSepChar(nameFilter);
QStringList ret = nameFilter.split(sep);
for (int i = 0; i < ret.count(); ++i)
@@ -1836,6 +1836,8 @@ QFileInfoList QDir::drives()
underlying operating system. If you want to display paths to the
user using their operating system's separator use
toNativeSeparators().
+
+ \sa listSeparator()
*/
QChar QDir::separator()
{
@@ -1847,6 +1849,16 @@ QChar QDir::separator()
}
/*!
+ \fn QDir::listSeparator()
+ \since 5.6
+
+ Returns the native path list separator: ':' under Unix
+ and ';' under Windows.
+
+ \sa separator()
+*/
+
+/*!
Sets the application's current working directory to \a path.
Returns \c true if the directory was successfully changed; otherwise
returns \c false.
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index e622011f98..ab3a331229 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -101,11 +101,10 @@ public:
QDir &operator=(const QDir &);
QDir &operator=(const QString &path);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QDir &operator=(QDir &&other)
- { qSwap(d_ptr, other.d_ptr); return *this; }
+ QDir &operator=(QDir &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- inline void swap(QDir &other)
+ void swap(QDir &other) Q_DECL_NOTHROW
{ qSwap(d_ptr, other.d_ptr); }
void setPath(const QString &path);
@@ -177,7 +176,16 @@ public:
static QFileInfoList drives();
- static QChar separator();
+ Q_DECL_CONSTEXPR static inline QChar listSeparator() Q_DECL_NOTHROW
+ {
+#if defined(Q_OS_WIN)
+ return QLatin1Char(';');
+#else
+ return QLatin1Char(':');
+#endif
+ }
+
+ static QChar separator(); // ### Qt6: Make it inline
static bool setCurrent(const QString &path);
static inline QDir current() { return QDir(currentPath()); }
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index 35a73680af..4eac710d4c 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -134,7 +134,7 @@ protected:
#ifdef QT_NO_QOBJECT
QFile(QFilePrivate &dd);
#else
- QFile(QFilePrivate &dd, QObject *parent = 0);
+ QFile(QFilePrivate &dd, QObject *parent = Q_NULLPTR);
#endif
private:
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index 2d6be5fb80..8531d32523 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -481,7 +481,7 @@ bool QFileDevicePrivate::putCharHelper(char c)
#else
// Cutoff for code that doesn't only touch the buffer.
- int writeBufferSize = writeBuffer.size();
+ qint64 writeBufferSize = writeBuffer.size();
if ((openMode & QIODevice::Unbuffered) || writeBufferSize + 1 >= QFILE_WRITEBUFFER_SIZE
#ifdef Q_OS_WIN
|| ((openMode & QIODevice::Text) && c == '\n' && writeBufferSize + 2 >= QFILE_WRITEBUFFER_SIZE)
diff --git a/src/corelib/io/qfiledevice.h b/src/corelib/io/qfiledevice.h
index e9320d8d31..afa42bd86b 100644
--- a/src/corelib/io/qfiledevice.h
+++ b/src/corelib/io/qfiledevice.h
@@ -119,7 +119,7 @@ protected:
QFileDevice(QFileDevicePrivate &dd);
#else
explicit QFileDevice(QObject *parent);
- QFileDevice(QFileDevicePrivate &dd, QObject *parent = 0);
+ QFileDevice(QFileDevicePrivate &dd, QObject *parent = Q_NULLPTR);
#endif
qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 58cf9a5c0f..59d12c3883 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -62,11 +62,10 @@ public:
QFileInfo &operator=(const QFileInfo &fileinfo);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QFileInfo&operator=(QFileInfo &&other)
- { qSwap(d_ptr, other.d_ptr); return *this; }
+ QFileInfo &operator=(QFileInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- inline void swap(QFileInfo &other)
+ void swap(QFileInfo &other) Q_DECL_NOTHROW
{ qSwap(d_ptr, other.d_ptr); }
bool operator==(const QFileInfo &fileinfo) const;
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index af8d9b2b36..52ac414645 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -227,9 +227,9 @@ QString QFileSelector::select(const QString &filePath) const
static bool isLocalScheme(const QString &file)
{
- bool local = file == QStringLiteral("qrc");
+ bool local = file == QLatin1String("qrc");
#ifdef Q_OS_ANDROID
- local |= file == QStringLiteral("assets");
+ local |= file == QLatin1String("assets");
#endif
return local;
}
diff --git a/src/corelib/io/qfileselector.h b/src/corelib/io/qfileselector.h
index 967d5eee75..9ee3588780 100644
--- a/src/corelib/io/qfileselector.h
+++ b/src/corelib/io/qfileselector.h
@@ -44,7 +44,7 @@ class Q_CORE_EXPORT QFileSelector : public QObject
{
Q_OBJECT
public:
- explicit QFileSelector(QObject *parent = 0);
+ explicit QFileSelector(QObject *parent = Q_NULLPTR);
~QFileSelector();
QString select(const QString &filePath) const;
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index df41457a18..a49d69d447 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -152,7 +152,7 @@ static bool _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry &ent
const QStringList &paths = QDir::searchPaths(filePath.left(prefixSeparator));
for (int i = 0; i < paths.count(); i++) {
- entry = QFileSystemEntry(QDir::cleanPath(paths.at(i) % QLatin1Char('/') % filePath.mid(prefixSeparator + 1)));
+ entry = QFileSystemEntry(QDir::cleanPath(paths.at(i) % QLatin1Char('/') % filePath.midRef(prefixSeparator + 1)));
// Recurse!
if (_q_resolveEntryAndCreateLegacyEngine_recursive(entry, data, engine, true))
return true;
@@ -264,7 +264,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
// Attributes
entryFlags |= QFileSystemMetaData::ExistsAttribute;
size_ = statBuffer.st_size;
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
if (statBuffer.st_flags & UF_HIDDEN) {
entryFlags |= QFileSystemMetaData::HiddenAttribute;
knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h
index 06d5db637a..6db9319836 100644
--- a/src/corelib/io/qfilesystemengine_p.h
+++ b/src/corelib/io/qfilesystemengine_p.h
@@ -76,7 +76,7 @@ public:
static QString resolveGroupName(uint groupId);
#endif
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
static QString bundleName(const QFileSystemEntry &entry);
#else
static QString bundleName(const QFileSystemEntry &entry) { Q_UNUSED(entry) return QString(); }
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 2c9fed530b..7bc2293b0d 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -51,26 +51,38 @@
# include <CoreFoundation/CFBundle.h>
#endif
+#ifdef Q_OS_OSX
+#include <CoreServices/CoreServices.h>
+#endif
+
+#ifdef Q_OS_IOS
+#include <MobileCoreServices/MobileCoreServices.h>
+#endif
+
QT_BEGIN_NAMESPACE
-#if defined(Q_OS_MACX)
-static inline bool _q_isMacHidden(const char *nativePath)
+#if defined(Q_OS_DARWIN)
+static inline bool hasResourcePropertyFlag(const QFileSystemMetaData &data,
+ const QFileSystemEntry &entry,
+ CFStringRef key)
{
- OSErr err;
-
- FSRef fsRef;
- err = FSPathMakeRefWithOptions(reinterpret_cast<const UInt8 *>(nativePath),
- kFSPathMakeRefDoNotFollowLeafSymlink, &fsRef, 0);
- if (err != noErr)
+ QCFString path = CFStringCreateWithFileSystemRepresentation(0,
+ entry.nativeFilePath().constData());
+ if (!path)
return false;
- FSCatalogInfo catInfo;
- err = FSGetCatalogInfo(&fsRef, kFSCatInfoFinderInfo, &catInfo, NULL, NULL, NULL);
- if (err != noErr)
+ QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle,
+ data.hasFlags(QFileSystemMetaData::DirectoryType));
+ if (!url)
return false;
- FileInfo * const fileInfo = reinterpret_cast<FileInfo*>(&catInfo.finderInfo);
- return (fileInfo->finderFlags & kIsInvisible);
+ CFBooleanRef value;
+ if (CFURLCopyResourcePropertyForKey(url, key, &value, NULL)) {
+ if (value == kCFBooleanTrue)
+ return true;
+ }
+
+ return false;
}
static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &entry)
@@ -97,6 +109,7 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
if (CFBundleGetPackageInfoInDirectory(url, &type, &creator))
return true;
+#ifdef Q_OS_OSX
// Find if an application other than Finder claims to know how to handle the package
QCFType<CFURLRef> application;
LSGetApplicationForURL(url,
@@ -111,30 +124,11 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
if (applicationId != QLatin1String("com.apple.finder"))
return true;
}
+#endif
}
// Third step: check if the directory has the package bit set
- FSRef packageRef;
- FSPathMakeRef((UInt8 *)entry.nativeFilePath().constData(), &packageRef, NULL);
-
- FSCatalogInfo catalogInfo;
- FSGetCatalogInfo(&packageRef,
- kFSCatInfoFinderInfo,
- &catalogInfo,
- NULL,
- NULL,
- NULL);
-
- FolderInfo *folderInfo = reinterpret_cast<FolderInfo *>(catalogInfo.finderInfo);
- return folderInfo->finderFlags & kHasBundle;
-}
-
-#else
-static inline bool _q_isMacHidden(const char *nativePath)
-{
- Q_UNUSED(nativePath);
- // no-op
- return false;
+ return hasResourcePropertyFlag(data, entry, kCFURLIsPackageKey);
}
#endif
@@ -194,21 +188,34 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
ret.chop(1);
return QFileSystemEntry(ret);
}
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
{
- FSRef fref;
- if (FSPathMakeRef((const UInt8 *)QFile::encodeName(QDir::cleanPath(link.filePath())).data(), &fref, 0) == noErr) {
- // TODO get the meta data info from the QFileSystemMetaData object
- Boolean isAlias, isFolder;
- if (FSResolveAliasFile(&fref, true, &isFolder, &isAlias) == noErr && isAlias) {
- AliasHandle alias;
- if (FSNewAlias(0, &fref, &alias) == noErr && alias) {
- QCFString cfstr;
- if (FSCopyAliasInfo(alias, 0, 0, &cfstr, 0, 0) == noErr)
- return QFileSystemEntry(QCFString::toQString(cfstr));
- }
- }
- }
+ QCFString path = CFStringCreateWithFileSystemRepresentation(0,
+ QFile::encodeName(QDir::cleanPath(link.filePath())).data());
+ if (!path)
+ return QFileSystemEntry();
+
+ QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle,
+ data.hasFlags(QFileSystemMetaData::DirectoryType));
+ if (!url)
+ return QFileSystemEntry();
+
+ QCFType<CFDataRef> bookmarkData = CFURLCreateBookmarkDataFromFile(0, url, NULL);
+ if (!bookmarkData)
+ return QFileSystemEntry();
+
+ QCFType<CFURLRef> resolvedUrl = CFURLCreateByResolvingBookmarkData(0,
+ bookmarkData,
+ (CFURLBookmarkResolutionOptions)(kCFBookmarkResolutionWithoutUIMask
+ | kCFBookmarkResolutionWithoutMountingMask), NULL, NULL, NULL, NULL);
+ if (!resolvedUrl)
+ return QFileSystemEntry();
+
+ QCFString cfstr(CFURLCopyFileSystemPath(resolvedUrl, kCFURLPOSIXPathStyle));
+ if (!cfstr)
+ return QFileSystemEntry();
+
+ return QFileSystemEntry(QCFString::toQString(cfstr));
}
#endif
return QFileSystemEntry();
@@ -226,31 +233,14 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));
#else
char *ret = 0;
-# if defined(Q_OS_MACX)
- // When using -mmacosx-version-min=10.4, we get the legacy realpath implementation,
- // which does not work properly with the realpath(X,0) form. See QTBUG-28282.
- if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) {
- ret = (char*)malloc(PATH_MAX + 1);
- if (ret && realpath(entry.nativeFilePath().constData(), (char*)ret) == 0) {
- const int savedErrno = errno; // errno is checked below, and free() might change it
- free(ret);
- errno = savedErrno;
- ret = 0;
- }
- } else {
- // on 10.5 we can use FSRef to resolve the file path.
- QString path = QDir::cleanPath(entry.filePath());
- FSRef fsref;
- if (FSPathMakeRef((const UInt8 *)path.toUtf8().data(), &fsref, 0) == noErr) {
- CFURLRef urlref = CFURLCreateFromFSRef(NULL, &fsref);
- CFStringRef canonicalPath = CFURLCopyFileSystemPath(urlref, kCFURLPOSIXPathStyle);
- QString ret = QCFString::toQString(canonicalPath);
- CFRelease(canonicalPath);
- CFRelease(urlref);
- return QFileSystemEntry(ret);
- }
+# if defined(Q_OS_DARWIN)
+ ret = (char*)malloc(PATH_MAX + 1);
+ if (ret && realpath(entry.nativeFilePath().constData(), (char*)ret) == 0) {
+ const int savedErrno = errno; // errno is checked below, and free() might change it
+ free(ret);
+ errno = savedErrno;
+ ret = 0;
}
-
# elif defined(Q_OS_ANDROID)
// On some Android versions, realpath() will return a path even if it does not exist
// To work around this, we check existence in advance.
@@ -406,7 +396,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
return QString();
}
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
//static
QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
{
@@ -426,7 +416,7 @@ QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what)
{
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
if (what & QFileSystemMetaData::BundleType) {
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
what |= QFileSystemMetaData::DirectoryType;
@@ -435,7 +425,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
// OS X >= 10.5: st_flags & UF_HIDDEN
what |= QFileSystemMetaData::PosixStatFlags;
}
-#endif // defined(Q_OS_MACX)
+#endif // defined(Q_OS_DARWIN)
if (what & QFileSystemMetaData::PosixStatFlags)
what |= QFileSystemMetaData::PosixStatFlags;
@@ -496,19 +486,11 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
| QFileSystemMetaData::ExistsAttribute;
}
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
if (what & QFileSystemMetaData::AliasType)
{
- if (entryExists) {
- FSRef fref;
- if (FSPathMakeRef((const UInt8 *)nativeFilePath, &fref, NULL) == noErr) {
- Boolean isAlias, isFolder;
- if (FSIsAliasFile(&fref, &isAlias, &isFolder) == noErr) {
- if (isAlias)
- data.entryFlags |= QFileSystemMetaData::AliasType;
- }
- }
- }
+ if (entryExists && hasResourcePropertyFlag(data, entry, kCFURLIsAliasFileKey))
+ data.entryFlags |= QFileSystemMetaData::AliasType;
data.knownFlagsMask |= QFileSystemMetaData::AliasType;
}
#endif
@@ -537,12 +519,15 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
&& !data.isHidden()) {
QString fileName = entry.fileName();
if ((fileName.size() > 0 && fileName.at(0) == QLatin1Char('.'))
- || (entryExists && _q_isMacHidden(nativeFilePath)))
+#if defined(Q_OS_DARWIN)
+ || (entryExists && hasResourcePropertyFlag(data, entry, kCFURLIsHiddenKey))
+#endif
+ )
data.entryFlags |= QFileSystemMetaData::HiddenAttribute;
data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
}
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
if (what & QFileSystemMetaData::BundleType) {
if (entryExists && isPackage(data, entry))
data.entryFlags |= QFileSystemMetaData::BundleType;
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index d62c120d7e..379095a83d 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -407,7 +407,7 @@ static QString readLink(const QFileSystemEntry &link)
Q_UNUSED(link);
return QString();
#endif // QT_NO_LIBRARY
-#else
+#elif !defined(QT_NO_WINCE_SHELLSDK)
wchar_t target[MAX_PATH];
QString result;
if (SHGetShortcutTarget((wchar_t*)QFileInfo(link.filePath()).absoluteFilePath().replace(QLatin1Char('/'),QLatin1Char('\\')).utf16(), target, MAX_PATH)) {
@@ -418,6 +418,9 @@ static QString readLink(const QFileSystemEntry &link)
result.remove(result.size()-1,1);
}
return result;
+#else // QT_NO_WINCE_SHELLSDK
+ Q_UNUSED(link);
+ return QString();
#endif // Q_OS_WINCE
}
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index 79f16a0839..709970e3ac 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -53,8 +53,7 @@ static bool isUncRoot(const QString &server)
if (idx == -1 || idx + 1 == localPath.length())
return true;
- localPath = localPath.right(localPath.length() - idx - 1).trimmed();
- return localPath.isEmpty();
+ return localPath.rightRef(localPath.length() - idx - 1).trimmed().isEmpty();
}
static inline QString fixIfRelativeUncPath(const QString &path)
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index da9576b5f8..828b5b329c 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -93,7 +93,7 @@ public:
LinkType = 0x00010000,
FileType = 0x00020000,
DirectoryType = 0x00040000,
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
BundleType = 0x00080000,
AliasType = 0x08000000,
#else
@@ -243,7 +243,7 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemMetaData::MetaDataFlags)
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_DARWIN)
inline bool QFileSystemMetaData::isBundle() const { return (entryFlags & BundleType); }
inline bool QFileSystemMetaData::isAlias() const { return (entryFlags & AliasType); }
#else
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 7fc3049f46..354e4931b9 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -177,7 +177,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
\note The act of monitoring files and directories for
modifications consumes system resources. This implies there is a
limit to the number of files and directories your process can
- monitor simultaneously. On Mac OS X 10.4 and all BSD variants, for
+ monitor simultaneously. On all BSD variants, for
example, an open file descriptor is required for each monitored
file. Some system limits the number of open file descriptors to 256
by default. This means that addPath() and addPaths() will fail if
@@ -185,7 +185,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
the file system monitor. Also note that your process may have
other file descriptors open in addition to the ones for files
being monitored, and these other open descriptors also count in
- the total. Mac OS X 10.5 and up use a different backend and do not
+ the total. OS X uses a different backend and does not
suffer from this issue.
@@ -296,7 +296,9 @@ QStringList QFileSystemWatcher::addPaths(const QStringList &paths)
QFileSystemWatcherEngine *engine = 0;
- if(!objectName().startsWith(QLatin1String("_qt_autotest_force_engine_"))) {
+ const QString on = objectName();
+
+ if (!on.startsWith(QLatin1String("_qt_autotest_force_engine_"))) {
// Normal runtime case - search intelligently for best engine
if(d->native) {
engine = d->native;
@@ -307,7 +309,7 @@ QStringList QFileSystemWatcher::addPaths(const QStringList &paths)
} else {
// Autotest override case - use the explicitly selected engine only
- QString forceName = objectName().mid(26);
+ const QStringRef forceName = on.midRef(26);
if(forceName == QLatin1String("poller")) {
qDebug() << "QFileSystemWatcher: skipping native engine, using only polling engine";
d_func()->initPollerEngine();
diff --git a/src/corelib/io/qfilesystemwatcher.h b/src/corelib/io/qfilesystemwatcher.h
index 13d1782913..095b50d1e5 100644
--- a/src/corelib/io/qfilesystemwatcher.h
+++ b/src/corelib/io/qfilesystemwatcher.h
@@ -49,8 +49,8 @@ class Q_CORE_EXPORT QFileSystemWatcher : public QObject
Q_DECLARE_PRIVATE(QFileSystemWatcher)
public:
- QFileSystemWatcher(QObject *parent = 0);
- QFileSystemWatcher(const QStringList &paths, QObject *parent = 0);
+ QFileSystemWatcher(QObject *parent = Q_NULLPTR);
+ QFileSystemWatcher(const QStringList &paths, QObject *parent = Q_NULLPTR);
~QFileSystemWatcher();
bool addPath(const QString &file);
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm
index 8a028c91e1..7656530a46 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.mm
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm
@@ -56,25 +56,6 @@
QT_BEGIN_NAMESPACE
-namespace {
-class RaiiAutoreleasePool
-{
- Q_DISABLE_COPY(RaiiAutoreleasePool)
-
-public:
- RaiiAutoreleasePool()
- : pool([[NSAutoreleasePool alloc] init])
- {}
-
- ~RaiiAutoreleasePool()
- { [pool release]; }
-
-private:
- NSAutoreleasePool *pool;
-};
-#define Q_AUTORELEASE_POOL(pool) RaiiAutoreleasePool pool; Q_UNUSED(pool);
-}
-
static void callBackFunction(ConstFSEventStreamRef streamRef,
void *clientCallBackInfo,
size_t numEvents,
@@ -82,7 +63,7 @@ static void callBackFunction(ConstFSEventStreamRef streamRef,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
char **paths = static_cast<char **>(eventPaths);
QFseventsFileSystemWatcherEngine *engine = static_cast<QFseventsFileSystemWatcherEngine *>(clientCallBackInfo);
@@ -297,7 +278,7 @@ void QFseventsFileSystemWatcherEngine::doEmitDirectoryChanged(const QString &pat
void QFseventsFileSystemWatcherEngine::restartStream()
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
QMutexLocker locker(&lock);
stopStream();
startStream();
@@ -328,7 +309,7 @@ QFseventsFileSystemWatcherEngine::QFseventsFileSystemWatcherEngine(QObject *pare
QFseventsFileSystemWatcherEngine::~QFseventsFileSystemWatcherEngine()
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
if (stream)
FSEventStreamStop(stream);
@@ -344,7 +325,7 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
if (stream) {
DEBUG("Flushing, last id is %llu", FSEventStreamGetLatestEventId(stream));
@@ -432,7 +413,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
QStringList *files,
QStringList *directories)
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
QMutexLocker locker(&lock);
@@ -489,7 +470,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
bool QFseventsFileSystemWatcherEngine::startStream()
{
Q_ASSERT(stream == 0);
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
if (stream) // This shouldn't happen, but let's be nice and handle it.
stopStream();
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index 4907a20a5f..410753868e 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -186,7 +186,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
}
if (!found) {
QWindowsFileSystemWatcherEngineThread *thread = new QWindowsFileSystemWatcherEngineThread();
- DEBUG() << " ###Creating new thread" << thread << "(" << (threads.count()+1) << "threads)";
+ DEBUG() << " ###Creating new thread" << thread << '(' << (threads.count()+1) << "threads)";
thread->handles.append(handle.handle);
thread->handleForDir.insert(QFileSystemWatcherPathKey(absolutePath), handle);
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index 8ba05fa8b9..0a7f551672 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -199,7 +199,6 @@ public:
bool closeFileHandle;
mutable uint is_sequential : 2;
- mutable uint could_stat : 1;
mutable uint tried_stat : 1;
#if !defined(Q_OS_WINCE)
mutable uint need_lstat : 1;
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 19343f22ff..cfd50955a6 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -711,7 +711,7 @@ bool QFSFileEngine::link(const QString &newName)
Q_UNUSED(newName);
return false;
#endif // QT_NO_LIBRARY
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_OS_WINCE) && !defined(QT_NO_WINCE_SHELLSDK)
QString linkName = newName;
linkName.replace(QLatin1Char('/'), QLatin1Char('\\'));
if (!linkName.endsWith(QLatin1String(".lnk")))
@@ -724,7 +724,7 @@ bool QFSFileEngine::link(const QString &newName)
if (!ret)
setError(QFile::RenameError, qt_error_string());
return ret;
-#else // Q_OS_WINCE
+#else // Q_OS_WINCE && !QT_NO_WINCE_SHELLSDK
Q_UNUSED(newName);
Q_UNIMPLEMENTED();
return false;
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index cd448ad9cf..3c7a7d69e4 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -39,6 +39,7 @@
#include "qfile.h"
#include "qstringlist.h"
#include "qdir.h"
+#include "private/qbytearray_p.h"
#include <algorithm>
@@ -144,7 +145,6 @@ QIODevicePrivate::QIODevicePrivate()
: openMode(QIODevice::NotOpen), buffer(QIODEVICE_BUFFERSIZE),
pos(0), devicePos(0)
, baseReadLineDataCalled(false)
- , firstRead(true)
, accessMode(Unset)
#ifdef QT_NO_QOBJECT
, q_ptr(0)
@@ -469,7 +469,6 @@ void QIODevice::setOpenMode(OpenMode openMode)
#endif
d->openMode = openMode;
d->accessMode = QIODevicePrivate::Unset;
- d->firstRead = true;
if (!isReadable())
d->buffer.clear();
}
@@ -561,7 +560,6 @@ bool QIODevice::open(OpenMode mode)
d->pos = (mode & Append) ? size() : qint64(0);
d->buffer.clear();
d->accessMode = QIODevicePrivate::Unset;
- d->firstRead = true;
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::open(0x%x)\n", this, quint32(mode));
#endif
@@ -591,7 +589,6 @@ void QIODevice::close()
d->errorString.clear();
d->pos = 0;
d->buffer.clear();
- d->firstRead = true;
}
/*!
@@ -698,12 +695,13 @@ bool QIODevice::seek(qint64 pos)
bool QIODevice::atEnd() const
{
Q_D(const QIODevice);
+ const bool result = (d->openMode == NotOpen || (d->buffer.isEmpty()
+ && bytesAvailable() == 0));
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::atEnd() returns %s, d->openMode == %d, d->pos == %lld\n", this,
- (d->openMode == NotOpen || d->pos == size()) ? "true" : "false", int(d->openMode),
- d->pos);
+ result ? "true" : "false", int(d->openMode), d->pos);
#endif
- return d->openMode == NotOpen || (d->buffer.isEmpty() && bytesAvailable() == 0);
+ return result;
}
/*!
@@ -820,12 +818,7 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
bufferReadChunkSize, readSoFar - bufferReadChunkSize);
#endif
} else {
- if (d->firstRead) {
- // this is the first time the file has been read, check it's valid and set up pos pointers
- // for fast pos updates.
- CHECK_READABLE(read, qint64(-1));
- d->firstRead = false;
- }
+ CHECK_READABLE(read, qint64(-1));
}
if (maxSize > 0 && !deviceAtEof) {
@@ -947,9 +940,9 @@ QByteArray QIODevice::read(qint64 maxSize)
Q_UNUSED(d);
#endif
- if (quint64(maxSize) >= QByteArray::MaxSize) {
+ if (maxSize >= MaxByteArraySize) {
checkWarnMessage(this, "read", "maxSize argument exceeds QByteArray size limit");
- maxSize = QByteArray::MaxSize - 1;
+ maxSize = MaxByteArraySize - 1;
}
qint64 readBytes = 0;
@@ -980,7 +973,7 @@ QByteArray QIODevice::read(qint64 maxSize)
/*!
\overload
- Reads all available data from the device, and returns it as a
+ Reads all remaining data from the device, and returns it as a
byte array.
This function has no way of reporting errors; returning an empty
@@ -996,40 +989,31 @@ QByteArray QIODevice::readAll()
#endif
QByteArray result;
- qint64 readBytes = 0;
- const bool sequential = d->isSequential();
-
- // flush internal read buffer
- if (!(d->openMode & Text) && !d->buffer.isEmpty()) {
- if (quint64(d->buffer.size()) >= QByteArray::MaxSize)
- return QByteArray();
- result = d->buffer.readAll();
- readBytes = result.size();
- if (!sequential)
- d->pos += readBytes;
- }
-
- qint64 theSize;
- if (sequential || (theSize = size()) == 0) {
+ qint64 readBytes = (d->isSequential() ? Q_INT64_C(0) : size());
+ if (readBytes == 0) {
// Size is unknown, read incrementally.
+ qint64 readChunkSize = qMax(d->buffer.size(), QIODEVICE_BUFFERSIZE);
qint64 readResult;
do {
- if (quint64(readBytes) + QIODEVICE_BUFFERSIZE > QByteArray::MaxSize) {
+ if (readBytes + readChunkSize >= MaxByteArraySize) {
// If resize would fail, don't read more, return what we have.
break;
}
- result.resize(readBytes + QIODEVICE_BUFFERSIZE);
- readResult = read(result.data() + readBytes, QIODEVICE_BUFFERSIZE);
- if (readResult > 0 || readBytes == 0)
+ result.resize(readBytes + readChunkSize);
+ readResult = read(result.data() + readBytes, readChunkSize);
+ if (readResult > 0 || readBytes == 0) {
readBytes += readResult;
+ readChunkSize = QIODEVICE_BUFFERSIZE;
+ }
} while (readResult > 0);
} else {
// Read it all in one go.
// If resize fails, don't read anything.
- if (quint64(readBytes + theSize - d->pos) > QByteArray::MaxSize)
+ readBytes -= d->pos;
+ if (readBytes >= MaxByteArraySize)
return QByteArray();
- result.resize(int(readBytes + theSize - d->pos));
- readBytes += read(result.data() + readBytes, result.size() - readBytes);
+ result.resize(readBytes);
+ readBytes = read(result.data(), readBytes);
}
if (readBytes <= 0)
@@ -1184,9 +1168,9 @@ QByteArray QIODevice::readLine(qint64 maxSize)
Q_UNUSED(d);
#endif
- if (quint64(maxSize) >= QByteArray::MaxSize) {
+ if (maxSize >= MaxByteArraySize) {
qWarning("QIODevice::read: maxSize argument exceeds QByteArray size limit");
- maxSize = QByteArray::MaxSize - 1;
+ maxSize = MaxByteArraySize - 1;
}
result.resize(int(maxSize));
@@ -1194,7 +1178,7 @@ QByteArray QIODevice::readLine(qint64 maxSize)
if (!result.size()) {
// If resize fails or maxSize == 0, read incrementally
if (maxSize == 0)
- maxSize = QByteArray::MaxSize - 1;
+ maxSize = MaxByteArraySize - 1;
// The first iteration needs to leave an extra byte for the terminating null
result.resize(1);
@@ -1305,6 +1289,7 @@ qint64 QIODevice::write(const char *data, qint64 maxSize)
const char *startOfBlock = data;
qint64 writtenSoFar = 0;
+ const qint64 savedPos = d->pos;
forever {
const char *endOfBlock = startOfBlock;
@@ -1316,7 +1301,7 @@ qint64 QIODevice::write(const char *data, qint64 maxSize)
qint64 ret = writeData(startOfBlock, blockSize);
if (ret <= 0) {
if (writtenSoFar && !sequential)
- d->buffer.skip(writtenSoFar);
+ d->buffer.skip(d->pos - savedPos);
return writtenSoFar ? writtenSoFar : ret;
}
if (!sequential) {
@@ -1332,7 +1317,7 @@ qint64 QIODevice::write(const char *data, qint64 maxSize)
qint64 ret = writeData("\r\n", 2);
if (ret <= 0) {
if (writtenSoFar && !sequential)
- d->buffer.skip(writtenSoFar);
+ d->buffer.skip(d->pos - savedPos);
return writtenSoFar ? writtenSoFar : ret;
}
if (!sequential) {
@@ -1345,7 +1330,7 @@ qint64 QIODevice::write(const char *data, qint64 maxSize)
}
if (writtenSoFar && !sequential)
- d->buffer.skip(writtenSoFar);
+ d->buffer.skip(d->pos - savedPos);
return writtenSoFar;
}
#endif
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 4f45805fca..b62c8d266c 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -140,7 +140,7 @@ protected:
#ifdef QT_NO_QOBJECT
QIODevice(QIODevicePrivate &dd);
#else
- QIODevice(QIODevicePrivate &dd, QObject *parent = 0);
+ QIODevice(QIODevicePrivate &dd, QObject *parent = Q_NULLPTR);
#endif
virtual qint64 readData(char *data, qint64 maxlen) = 0;
virtual qint64 readLineData(char *data, qint64 maxlen);
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 8342176cff..6ab1de27e0 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -216,7 +216,6 @@ public:
qint64 pos;
qint64 devicePos;
bool baseReadLineDataCalled;
- bool firstRead;
virtual bool putCharHelper(char c);
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index 667b108ba0..623968b869 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -202,6 +202,13 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
// We hold the lock, continue.
fileHandle = fd;
+ // Sync to disk if possible. Ignore errors (e.g. not supported).
+#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
+ fdatasync(fileHandle);
+#else
+ fsync(fileHandle);
+#endif
+
return QLockFile::NoError;
}
@@ -283,6 +290,7 @@ QString QLockFilePrivate::processNameByPid(qint64 pid)
free(proc);
return name;
#else
+ Q_UNUSED(pid);
return QString();
#endif
}
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index e6bc7caaeb..b51085ef42 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -147,8 +147,17 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
\c QT_LOGGING_CONF, and rules set by \c QT_LOGGING_RULES.
+ Since Qt 5.6, \c QT_LOGGING_RULES may contain multiple rules separated
+ by semicolons:
+
+ \code
+ QT_LOGGING_RULES="*.debug=false;driver.usb.debug=true"
+ \endcode
+
+
Order of evaluation:
\list
+ \li [QLibraryInfo::DataPath]/qtlogging.ini
\li QtProject/qtlogging.ini
\li \l setFilterRules()
\li \c QT_LOGGING_CONF
diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp
index 880e567562..b53e251102 100644
--- a/src/corelib/io/qloggingregistry.cpp
+++ b/src/corelib/io/qloggingregistry.cpp
@@ -34,6 +34,7 @@
#include "qloggingregistry_p.h"
#include <QtCore/qfile.h>
+#include <QtCore/qlibraryinfo.h>
#include <QtCore/qstandardpaths.h>
#include <QtCore/qtextstream.h>
#include <QtCore/qdir.h>
@@ -208,7 +209,7 @@ void QLoggingSettingsParser::setContent(QTextStream &stream)
continue;
}
- if (_section == QLatin1String("Rules")) {
+ if (_section.toLower() == QLatin1String("rules")) {
int equalPos = line.indexOf(QLatin1Char('='));
if (equalPos != -1) {
if (line.lastIndexOf(QLatin1Char('=')) == equalPos) {
@@ -247,6 +248,21 @@ static bool qtLoggingDebug()
return debugEnv;
}
+static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)
+{
+ QFile file(filePath);
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (qtLoggingDebug())
+ debugMsg("Loading \"%s\" ...",
+ QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
+ QTextStream stream(&file);
+ QLoggingSettingsParser parser;
+ parser.setContent(stream);
+ return parser.rules();
+ }
+ return QVector<QLoggingRule>();
+}
+
/*!
\internal
Initializes the rules database by loading
@@ -256,19 +272,10 @@ void QLoggingRegistry::init()
{
// get rules from environment
const QByteArray rulesFilePath = qgetenv("QT_LOGGING_CONF");
- if (!rulesFilePath.isEmpty()) {
- QFile file(QFile::decodeName(rulesFilePath));
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- if (qtLoggingDebug())
- debugMsg("Loading \"%s\" ...",
- QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
- QTextStream stream(&file);
- QLoggingSettingsParser parser;
- parser.setContent(stream);
- envRules = parser.rules();
- }
- }
- const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES");
+ if (!rulesFilePath.isEmpty())
+ envRules = loadRulesFromFile(QFile::decodeName(rulesFilePath));
+
+ const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES").replace(';', '\n');
if (!rulesSrc.isEmpty()) {
QTextStream stream(rulesSrc);
QLoggingSettingsParser parser;
@@ -277,23 +284,22 @@ void QLoggingRegistry::init()
envRules += parser.rules();
}
- // get rules from qt configuration
- QString envPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,
- QStringLiteral("QtProject/qtlogging.ini"));
- if (!envPath.isEmpty()) {
- QFile file(envPath);
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- if (qtLoggingDebug())
- debugMsg("Loading \"%s\" ...",
- QDir::toNativeSeparators(envPath).toUtf8().constData());
- QTextStream stream(&file);
- QLoggingSettingsParser parser;
- parser.setContent(stream);
- configRules = parser.rules();
- }
- }
+ const QString configFileName = QStringLiteral("qtlogging.ini");
+
+#if !defined(QT_BOOTSTRAPPED)
+ // get rules from Qt data configuration path
+ const QString qtConfigPath
+ = QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(configFileName);
+ qtConfigRules = loadRulesFromFile(qtConfigPath);
+#endif
+
+ // get rules from user's/system configuration
+ const QString envPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,
+ QString::fromLatin1("QtProject/") + configFileName);
+ if (!envPath.isEmpty())
+ configRules = loadRulesFromFile(envPath);
- if (!envRules.isEmpty() || !configRules.isEmpty()) {
+ if (!envRules.isEmpty() || !qtConfigRules.isEmpty() || !configRules.isEmpty()) {
QMutexLocker locker(&registryMutex);
updateRules();
}
@@ -356,7 +362,7 @@ void QLoggingRegistry::updateRules()
if (categoryFilter != defaultCategoryFilter)
return;
- rules = configRules + apiRules + envRules;
+ rules = qtConfigRules + configRules + apiRules + envRules;
foreach (QLoggingCategory *cat, categories.keys())
(*categoryFilter)(cat);
diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h
index 718e09d9bb..bb32a4996d 100644
--- a/src/corelib/io/qloggingregistry_p.h
+++ b/src/corelib/io/qloggingregistry_p.h
@@ -122,6 +122,7 @@ private:
QMutex registryMutex;
+ QVector<QLoggingRule> qtConfigRules;
QVector<QLoggingRule> configRules;
QVector<QLoggingRule> envRules;
QVector<QLoggingRule> apiRules;
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index c29b97b535..952116b9db 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -101,6 +101,19 @@ QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
/*!
+ \since 5.6
+
+ \macro QT_NO_PROCESS_COMBINED_ARGUMENT_START
+ \relates QProcess
+
+ Disables the QProcess::start() overload taking a single string.
+ In most cases where it is used, the user intends for the first argument
+ to be treated atomically as per the other overload.
+
+ \sa QProcess::start()
+*/
+
+/*!
\class QProcessEnvironment
\inmodule QtCore
@@ -110,7 +123,6 @@ QT_BEGIN_NAMESPACE
\ingroup io
\ingroup misc
\ingroup shared
- \mainclass
\reentrant
\since 4.6
@@ -144,16 +156,8 @@ QStringList QProcessEnvironmentPrivate::toList() const
{
QStringList result;
result.reserve(hash.size());
- Hash::ConstIterator it = hash.constBegin(),
- end = hash.constEnd();
- for ( ; it != end; ++it) {
- QString data = nameToString(it.key());
- QString value = valueToString(it.value());
- data.reserve(data.length() + value.length() + 1);
- data.append(QLatin1Char('='));
- data.append(value);
- result << data;
- }
+ for (Hash::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it)
+ result << nameToString(it.key()) + QLatin1Char('=') + valueToString(it.value());
return result;
}
@@ -265,11 +269,16 @@ bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const
{
if (d == other.d)
return true;
- if (d && other.d) {
- QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d);
- return d->hash == other.d->hash;
+ if (d) {
+ if (other.d) {
+ QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d);
+ return d->hash == other.d->hash;
+ } else {
+ return isEmpty();
+ }
+ } else {
+ return other.isEmpty();
}
- return false;
}
/*!
@@ -498,8 +507,8 @@ void QProcessPrivate::Channel::clear()
the process as arguments, and you can also call exitCode() to
obtain the exit code of the last process that finished, and
exitStatus() to obtain its exit status. If an error occurs at
- any point in time, QProcess will emit the error() signal. You
- can also call error() to find the type of error that occurred
+ any point in time, QProcess will emit the errorOccurred() signal.
+ You can also call error() to find the type of error that occurred
last, and state() to find the current process state.
\section1 Communicating via Channels
@@ -736,6 +745,14 @@ void QProcessPrivate::Channel::clear()
/*!
\fn void QProcess::error(QProcess::ProcessError error)
+ \obsolete
+
+ Use errorOccurred() instead.
+*/
+
+/*!
+ \fn void QProcess::errorOccurred(QProcess::ProcessError error)
+ \since 5.6
This signal is emitted when an error occurs with the process. The
specified \a error describes the type of error that occurred.
@@ -898,6 +915,50 @@ void QProcessPrivate::cleanup()
/*!
\internal
+*/
+void QProcessPrivate::setError(QProcess::ProcessError error, const QString &description)
+{
+ processError = error;
+ if (description.isEmpty()) {
+ switch (error) {
+ case QProcess::FailedToStart:
+ errorString = QProcess::tr("Process failed to start");
+ break;
+ case QProcess::Crashed:
+ errorString = QProcess::tr("Process crashed");
+ break;
+ case QProcess::Timedout:
+ errorString = QProcess::tr("Process operation timed out");
+ break;
+ case QProcess::ReadError:
+ errorString = QProcess::tr("Error reading from process");
+ break;
+ case QProcess::WriteError:
+ errorString = QProcess::tr("Error writing to process");
+ break;
+ case QProcess::UnknownError:
+ errorString.clear();
+ break;
+ }
+ } else {
+ errorString = description;
+ }
+}
+
+/*!
+ \internal
+*/
+void QProcessPrivate::setErrorAndEmit(QProcess::ProcessError error, const QString &description)
+{
+ Q_Q(QProcess);
+ Q_ASSERT(error != QProcess::UnknownError);
+ setError(error, description);
+ emit q->errorOccurred(processError);
+ emit q->error(processError);
+}
+
+/*!
+ \internal
Returns true if we emitted readyRead().
*/
bool QProcessPrivate::tryReadFromChannel(Channel *channel)
@@ -919,9 +980,7 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
return false;
}
if (readBytes == -1) {
- processError = QProcess::ReadError;
- q->setErrorString(QProcess::tr("Error reading from process"));
- emit q->error(processError);
+ setErrorAndEmit(QProcess::ReadError);
#if defined QPROCESS_DEBUG
qDebug("QProcessPrivate::tryReadFromChannel(%d), failed to read from the process", channel - &stdinChannel);
#endif
@@ -1005,9 +1064,7 @@ bool QProcessPrivate::_q_canWrite()
stdinChannel.buffer.nextDataBlockSize());
if (written < 0) {
closeChannel(&stdinChannel);
- processError = QProcess::WriteError;
- q->setErrorString(QProcess::tr("Error writing to process"));
- emit q->error(processError);
+ setErrorAndEmit(QProcess::WriteError);
return false;
}
@@ -1051,7 +1108,7 @@ bool QProcessPrivate::_q_processDied()
// the process may have died before it got a chance to report that it was
// either running or stopped, so we will call _q_startupNotification() and
- // give it a chance to emit started() or error(FailedToStart).
+ // give it a chance to emit started() or errorOccurred(FailedToStart).
if (processState == QProcess::Starting) {
if (!_q_startupNotification())
return true;
@@ -1076,9 +1133,7 @@ bool QProcessPrivate::_q_processDied()
if (crashed) {
exitStatus = QProcess::CrashExit;
- processError = QProcess::Crashed;
- q->setErrorString(QProcess::tr("Process crashed"));
- emit q->error(processError);
+ setErrorAndEmit(QProcess::Crashed);
} else {
#ifdef QPROCESS_USE_SPAWN
// if we're using posix_spawn, waitForStarted always succeeds.
@@ -1086,8 +1141,8 @@ bool QProcessPrivate::_q_processDied()
// 127 if anything prevents the target program from starting.
// http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
if (exitStatus == QProcess::NormalExit && exitCode == 127) {
- processError = QProcess::FailedToStart;
- q->setErrorString(QProcess::tr("Process failed to start (spawned process exited with code 127)"));
+ setError(QProcess::FailedToStart,
+ QProcess::tr("Process failed to start (spawned process exited with code 127)"));
}
#endif
}
@@ -1124,15 +1179,15 @@ bool QProcessPrivate::_q_startupNotification()
if (startupSocketNotifier)
startupSocketNotifier->setEnabled(false);
- if (processStarted()) {
+ QString errorMessage;
+ if (processStarted(&errorMessage)) {
q->setProcessState(QProcess::Running);
emit q->started(QProcess::QPrivateSignal());
return true;
}
q->setProcessState(QProcess::NotRunning);
- processError = QProcess::FailedToStart;
- emit q->error(processError);
+ setErrorAndEmit(QProcess::FailedToStart, errorMessage);
#ifdef Q_OS_UNIX
// make sure the process manager removes this entry
waitForDeadChild();
@@ -1911,12 +1966,12 @@ qint64 QProcess::readData(char *data, qint64 maxlen)
return 1;
}
- qint64 bytesToRead = qint64(qMin(readBuffer->size(), (int)maxlen));
+ qint64 bytesToRead = qMin(readBuffer->size(), maxlen);
qint64 readSoFar = 0;
while (readSoFar < bytesToRead) {
const char *ptr = readBuffer->readPointer();
- int bytesToReadFromThisBlock = qMin<qint64>(bytesToRead - readSoFar,
- readBuffer->nextDataBlockSize());
+ qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,
+ readBuffer->nextDataBlockSize());
memcpy(data + readSoFar, ptr, bytesToReadFromThisBlock);
readSoFar += bytesToReadFromThisBlock;
readBuffer->free(bytesToReadFromThisBlock);
@@ -1940,9 +1995,7 @@ qint64 QProcess::writeData(const char *data, qint64 len)
#if defined(Q_OS_WINCE)
Q_UNUSED(data);
Q_UNUSED(len);
- d->processError = QProcess::WriteError;
- setErrorString(tr("Error writing to process"));
- emit error(d->processError);
+ d->setErrorAndEmit(QProcess::WriteError);
return -1;
#endif
@@ -2033,10 +2086,10 @@ QByteArray QProcess::readAllStandardError()
The QProcess object will immediately enter the Starting state. If the
process starts successfully, QProcess will emit started(); otherwise,
- error() will be emitted.
+ errorOccurred() will be emitted.
\note Processes are started asynchronously, which means the started()
- and error() signals may be delayed. Call waitForStarted() to make
+ and errorOccurred() signals may be delayed. Call waitForStarted() to make
sure the process has started (or has failed to start) and those signals
have been emitted.
@@ -2045,7 +2098,9 @@ QByteArray QProcess::readAllStandardError()
\b{Windows:} The arguments are quoted and joined into a command line
that is compatible with the \c CommandLineToArgvW() Windows function.
For programs that have different command line quoting requirements,
- you need to use setNativeArguments().
+ you need to use setNativeArguments(). One notable program that does
+ not follow the \c CommandLineToArgvW() rules is cmd.exe and, by
+ consequence, all batch scripts.
The OpenMode is set to \a mode.
@@ -2147,6 +2202,16 @@ void QProcessPrivate::start(QIODevice::OpenMode mode)
mode &= ~QIODevice::ReadOnly; // not open for reading
if (mode == 0)
mode = QIODevice::Unbuffered;
+#ifndef Q_OS_WINCE
+ if ((mode & QIODevice::ReadOnly) == 0) {
+ if (stdoutChannel.type == QProcessPrivate::Channel::Normal)
+ q->setStandardOutputFile(q->nullDevice());
+ if (stderrChannel.type == QProcessPrivate::Channel::Normal
+ && processChannelMode != QProcess::MergedChannels)
+ q->setStandardErrorFile(q->nullDevice());
+ }
+#endif
+
q->QIODevice::open(mode);
stdinChannel.closed = false;
@@ -2226,15 +2291,26 @@ static QStringList parseCombinedArgString(const QString &program)
After the \a command string has been split and unquoted, this function
behaves like the overload which takes the arguments as a string list.
+ You can disable this overload by defining \c
+ QT_NO_PROCESS_COMBINED_ARGUMENT_START when you compile your applications.
+ This can be useful if you want to ensure that you are not splitting arguments
+ unintentionally, for example. In virtually all cases, using the other overload
+ is the preferred method.
+
+ On operating systems where the system API for passing command line
+ arguments to a subprocess natively uses a single string (Windows), one can
+ conceive command lines which cannot be passed via QProcess's portable
+ list-based API. In these rare cases you need to use setProgram() and
+ setNativeArguments() instead of this function.
+
*/
+#if !defined(QT_NO_PROCESS_COMBINED_ARGUMENT_START)
void QProcess::start(const QString &command, OpenMode mode)
{
QStringList args = parseCombinedArgString(command);
if (args.isEmpty()) {
Q_D(QProcess);
- d->processError = QProcess::FailedToStart;
- setErrorString(tr("No program defined"));
- emit error(d->processError);
+ d->setErrorAndEmit(QProcess::FailedToStart, tr("No program defined"));
return;
}
@@ -2243,6 +2319,7 @@ void QProcess::start(const QString &command, OpenMode mode)
start(prog, args, mode);
}
+#endif
/*!
\since 5.0
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index 078217ea0b..f95358250e 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -60,9 +60,12 @@ public:
QProcessEnvironment();
QProcessEnvironment(const QProcessEnvironment &other);
~QProcessEnvironment();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QProcessEnvironment &operator=(QProcessEnvironment && other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QProcessEnvironment &operator=(const QProcessEnvironment &other);
- inline void swap(QProcessEnvironment &other) { qSwap(d, other.d); }
+ void swap(QProcessEnvironment &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QProcessEnvironment &other) const;
inline bool operator!=(const QProcessEnvironment &other) const
@@ -104,15 +107,21 @@ public:
WriteError,
UnknownError
};
+ Q_ENUM(ProcessError)
+
enum ProcessState {
NotRunning,
Starting,
Running
};
+ Q_ENUM(ProcessState)
+
enum ProcessChannel {
StandardOutput,
StandardError
};
+ Q_ENUM(ProcessChannel)
+
enum ProcessChannelMode {
SeparateChannels,
MergedChannels,
@@ -120,20 +129,27 @@ public:
ForwardedOutputChannel,
ForwardedErrorChannel
};
+ Q_ENUM(ProcessChannelMode)
+
enum InputChannelMode {
ManagedInputChannel,
ForwardedInputChannel
};
+ Q_ENUM(InputChannelMode)
+
enum ExitStatus {
NormalExit,
CrashExit
};
+ Q_ENUM(ExitStatus)
- explicit QProcess(QObject *parent = 0);
+ explicit QProcess(QObject *parent = Q_NULLPTR);
virtual ~QProcess();
void start(const QString &program, const QStringList &arguments, OpenMode mode = ReadWrite);
+#if !defined(QT_NO_PROCESS_COMBINED_ARGUMENT_START)
void start(const QString &command, OpenMode mode = ReadWrite);
+#endif
void start(OpenMode mode = ReadWrite);
bool open(OpenMode mode = ReadWrite) Q_DECL_OVERRIDE;
@@ -208,7 +224,7 @@ public:
#if defined(Q_QDOC)
= QString()
#endif
- , qint64 *pid = 0);
+ , qint64 *pid = Q_NULLPTR);
#if !defined(Q_QDOC)
static bool startDetached(const QString &program, const QStringList &arguments); // ### Qt6: merge overloads
#endif
@@ -226,7 +242,10 @@ Q_SIGNALS:
void started(QPrivateSignal);
void finished(int exitCode); // ### Qt 6: merge the two signals with a default value
void finished(int exitCode, QProcess::ExitStatus exitStatus);
- void error(QProcess::ProcessError error);
+#if QT_DEPRECATED_SINCE(5,6)
+ QT_MOC_COMPAT void error(QProcess::ProcessError error);
+#endif
+ void errorOccurred(QProcess::ProcessError error);
void stateChanged(QProcess::ProcessState state, QPrivateSignal);
void readyReadStandardOutput(QPrivateSignal);
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index f6bd64fb87..d3f251c399 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -352,7 +352,7 @@ public:
#elif defined(QPROCESS_USE_SPAWN)
pid_t spawnChild(pid_t *ppid, const char *workingDirectory, char **argv, char **envp);
#endif
- bool processStarted();
+ bool processStarted(QString *errorMessage = Q_NULLPTR);
void terminateProcess();
void killProcess();
void findExitCode();
@@ -383,6 +383,8 @@ public:
qint64 writeToStdin(const char *data, qint64 maxlen);
void cleanup();
+ void setError(QProcess::ProcessError error, const QString &description = QString());
+ void setErrorAndEmit(QProcess::ProcessError error, const QString &description = QString());
#ifdef Q_OS_BLACKBERRY
QList<QSocketNotifier *> defaultNotifiers() const;
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 7b6da90b04..8eb5ac9564 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -92,8 +92,8 @@ QT_END_NAMESPACE
#include <private/qthread_p.h>
#include <qfile.h>
#include <qfileinfo.h>
+#include <qdir.h>
#include <qlist.h>
-#include <qhash.h>
#include <qmutex.h>
#include <qsemaphore.h>
#include <qsocketnotifier.h>
@@ -204,8 +204,8 @@ bool QProcessPrivate::openChannel(Channel &channel)
channel.pipe[1] = -1;
if ( (channel.pipe[0] = qt_safe_open(fname, O_RDONLY)) != -1)
return true; // success
-
- q->setErrorString(QProcess::tr("Could not open input redirection for reading"));
+ setErrorAndEmit(QProcess::FailedToStart,
+ QProcess::tr("Could not open input redirection for reading"));
} else {
int mode = O_WRONLY | O_CREAT;
if (channel.append)
@@ -217,12 +217,9 @@ bool QProcessPrivate::openChannel(Channel &channel)
if ( (channel.pipe[1] = qt_safe_open(fname, mode, 0666)) != -1)
return true; // success
- q->setErrorString(QProcess::tr("Could not open output redirection for writing"));
+ setErrorAndEmit(QProcess::FailedToStart,
+ QProcess::tr("Could not open input redirection for reading"));
}
-
- // could not open file
- processError = QProcess::FailedToStart;
- emit q->error(processError);
cleanup();
return false;
} else {
@@ -331,9 +328,7 @@ void QProcessPrivate::startProcess()
!openChannel(stdoutChannel) ||
!openChannel(stderrChannel) ||
qt_create_pipe(childStartedPipe) != 0) {
- processError = QProcess::FailedToStart;
- q->setErrorString(qt_error_string(errno));
- emit q->error(processError);
+ setErrorAndEmit(QProcess::FailedToStart, qt_error_string(errno));
cleanup();
return;
}
@@ -368,11 +363,14 @@ void QProcessPrivate::startProcess()
static QBasicMutex cfbundleMutex;
QMutexLocker lock(&cfbundleMutex);
QCFType<CFBundleRef> bundle = CFBundleCreate(0, url);
- url = CFBundleCopyExecutableURL(bundle);
+ // 'executableURL' can be either relative or absolute ...
+ QCFType<CFURLRef> executableURL = CFBundleCopyExecutableURL(bundle);
+ // not to depend on caching - make sure it's always absolute.
+ url = CFURLCopyAbsoluteURL(executableURL);
}
if (url) {
- QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
- encodedProgramName += "/Contents/MacOS/" + QCFString::toQString(str).toUtf8();
+ const QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
+ encodedProgramName += (QDir::separator() + QDir(program).relativeFilePath(QCFString::toQString(str))).toUtf8();
}
}
#endif
@@ -406,7 +404,7 @@ void QProcessPrivate::startProcess()
char **path = 0;
int pathc = 0;
if (!program.contains(QLatin1Char('/'))) {
- const QString pathEnv = QString::fromLocal8Bit(::getenv("PATH"));
+ const QString pathEnv = QString::fromLocal8Bit(qgetenv("PATH"));
if (!pathEnv.isEmpty()) {
QStringList pathEntries = pathEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);
if (!pathEntries.isEmpty()) {
@@ -459,9 +457,8 @@ void QProcessPrivate::startProcess()
qDebug("fork failed: %s", qPrintable(qt_error_string(lastForkErrno)));
#endif
q->setProcessState(QProcess::NotRunning);
- processError = QProcess::FailedToStart;
- q->setErrorString(QProcess::tr("Resource error (fork failure): %1").arg(qt_error_string(lastForkErrno)));
- emit q->error(processError);
+ setErrorAndEmit(QProcess::FailedToStart,
+ QProcess::tr("Resource error (fork failure): %1").arg(qt_error_string(lastForkErrno)));
cleanup();
return;
}
@@ -679,9 +676,9 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv
qt_safe_close(childStartedPipe[0]);
// enter the working directory
- if (workingDir) {
- if (QT_CHDIR(workingDir) == -1)
- qWarning("QProcessPrivate::execChild() failed to chdir to %s", workingDir);
+ if (workingDir && QT_CHDIR(workingDir) == -1) {
+ // failed, stop the process
+ goto report_errno;
}
// this is a virtual call, and it base behavior is to do nothing.
@@ -710,6 +707,7 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv
}
// notify failure
+report_errno:
QString error = qt_error_string(errno);
#if defined (QPROCESS_DEBUG)
fprintf(stderr, "QProcessPrivate::execChild() failed (%s), notifying parent process\n", qPrintable(error));
@@ -720,7 +718,7 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv
}
#endif
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString *errorMessage)
{
ushort buf[errorBufferMax];
int i = qt_safe_read(childStartedPipe[0], &buf, sizeof buf);
@@ -737,8 +735,8 @@ bool QProcessPrivate::processStarted()
#endif
// did we read an error message?
- if (i > 0)
- q_func()->setErrorString(QString((const QChar *)buf, i / sizeof(QChar)));
+ if ((i > 0) && errorMessage)
+ *errorMessage = QString((const QChar *)buf, i / sizeof(QChar));
return i <= 0;
}
@@ -809,8 +807,6 @@ void QProcessPrivate::killProcess()
bool QProcessPrivate::waitForStarted(int msecs)
{
- Q_Q(QProcess);
-
#if defined (QPROCESS_DEBUG)
qDebug("QProcessPrivate::waitForStarted(%d) waiting for child to start (fd = %d)", msecs,
childStartedPipe[0]);
@@ -820,8 +816,7 @@ bool QProcessPrivate::waitForStarted(int msecs)
FD_ZERO(&fds);
FD_SET(childStartedPipe[0], &fds);
if (qt_select_msecs(childStartedPipe[0] + 1, &fds, 0, msecs) == 0) {
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
#if defined (QPROCESS_DEBUG)
qDebug("QProcessPrivate::waitForStarted(%d) == false (timed out)", msecs);
#endif
@@ -848,7 +843,6 @@ QList<QSocketNotifier *> QProcessPrivate::defaultNotifiers() const
bool QProcessPrivate::waitForReadyRead(int msecs)
{
- Q_Q(QProcess);
#if defined (QPROCESS_DEBUG)
qDebug("QProcessPrivate::waitForReadyRead(%d)", msecs);
#endif
@@ -891,8 +885,7 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
break;
}
if (ret == 0) {
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
@@ -928,7 +921,6 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
bool QProcessPrivate::waitForBytesWritten(int msecs)
{
- Q_Q(QProcess);
#if defined (QPROCESS_DEBUG)
qDebug("QProcessPrivate::waitForBytesWritten(%d)", msecs);
#endif
@@ -973,8 +965,7 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
}
if (ret == 0) {
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
@@ -1003,7 +994,6 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
bool QProcessPrivate::waitForFinished(int msecs)
{
- Q_Q(QProcess);
#if defined (QPROCESS_DEBUG)
qDebug("QProcessPrivate::waitForFinished(%d)", msecs);
#endif
@@ -1047,8 +1037,7 @@ bool QProcessPrivate::waitForFinished(int msecs)
break;
}
if (ret == 0) {
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
@@ -1188,7 +1177,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
argv[arguments.size() + 1] = 0;
if (!program.contains(QLatin1Char('/'))) {
- const QString path = QString::fromLocal8Bit(::getenv("PATH"));
+ const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
if (!path.isEmpty()) {
QStringList pathEntries = path.split(QLatin1Char(':'));
for (int k = 0; k < pathEntries.size(); ++k) {
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index eb88ded2c9..80e6d5bb61 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -217,7 +217,8 @@ bool QProcessPrivate::openChannel(Channel &channel)
if (channel.pipe[0] != INVALID_Q_PIPE)
return true;
- q->setErrorString(QProcess::tr("Could not open input redirection for reading"));
+ setErrorAndEmit(QProcess::FailedToStart,
+ QProcess::tr("Could not open input redirection for reading"));
} else {
// open in write mode
channel.pipe[0] = INVALID_Q_PIPE;
@@ -237,12 +238,9 @@ bool QProcessPrivate::openChannel(Channel &channel)
return true;
}
- q->setErrorString(QProcess::tr("Could not open output redirection for writing"));
+ setErrorAndEmit(QProcess::FailedToStart,
+ QProcess::tr("Could not open output redirection for writing"));
}
-
- // could not open file
- processError = QProcess::FailedToStart;
- emit q->error(processError);
cleanup();
return false;
} else {
@@ -504,9 +502,10 @@ void QProcessPrivate::startProcess()
environment.isEmpty() ? 0 : envlist.data(),
workingDirectory.isEmpty() ? 0 : (wchar_t*)QDir::toNativeSeparators(workingDirectory).utf16(),
&startupInfo, pid);
+ QString errorString;
if (!success) {
// Capture the error string before we do CloseHandle below
- q->setErrorString(QProcess::tr("Process failed to start: %1").arg(qt_error_string()));
+ errorString = QProcess::tr("Process failed to start: %1").arg(qt_error_string());
}
if (stdinChannel.pipe[0] != INVALID_Q_PIPE) {
@@ -524,8 +523,7 @@ void QProcessPrivate::startProcess()
if (!success) {
cleanup();
- processError = QProcess::FailedToStart;
- emit q->error(processError);
+ setErrorAndEmit(QProcess::FailedToStart, errorString);
q->setProcessState(QProcess::NotRunning);
return;
}
@@ -545,7 +543,7 @@ void QProcessPrivate::startProcess()
_q_startupNotification();
}
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString * /*errorMessage*/)
{
return processState == QProcess::Running;
}
@@ -595,16 +593,13 @@ void QProcessPrivate::killProcess()
bool QProcessPrivate::waitForStarted(int)
{
- Q_Q(QProcess);
-
if (processStarted())
return true;
if (processError == QProcess::FailedToStart)
return false;
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
@@ -636,8 +631,6 @@ bool QProcessPrivate::drainOutputPipes()
bool QProcessPrivate::waitForReadyRead(int msecs)
{
- Q_Q(QProcess);
-
QIncrementalSleepTimer timer(msecs);
forever {
@@ -652,7 +645,7 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
if (!pid)
return false;
- if (WaitForSingleObject(pid->hProcess, 0) == WAIT_OBJECT_0) {
+ if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) {
bool readyReadEmitted = drainOutputPipes();
_q_processDied();
return readyReadEmitted;
@@ -663,15 +656,12 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
break;
}
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
bool QProcessPrivate::waitForBytesWritten(int msecs)
{
- Q_Q(QProcess);
-
QIncrementalSleepTimer timer(msecs);
forever {
@@ -723,7 +713,7 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
// Wait for the process to signal any change in its state,
// such as incoming data, or if the process died.
- if (WaitForSingleObject(pid->hProcess, 0) == WAIT_OBJECT_0) {
+ if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) {
_q_processDied();
return false;
}
@@ -733,14 +723,12 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
break;
}
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
bool QProcessPrivate::waitForFinished(int msecs)
{
- Q_Q(QProcess);
#if defined QPROCESS_DEBUG
qDebug("QProcessPrivate::waitForFinished(%d)", msecs);
#endif
@@ -772,8 +760,7 @@ bool QProcessPrivate::waitForFinished(int msecs)
break;
}
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
@@ -816,13 +803,10 @@ qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen)
bool QProcessPrivate::waitForWrite(int msecs)
{
- Q_Q(QProcess);
-
if (!stdinChannel.writer || stdinChannel.writer->waitForWrite(msecs))
return true;
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
diff --git a/src/corelib/io/qprocess_wince.cpp b/src/corelib/io/qprocess_wince.cpp
index 53767758c2..acacdb8540 100644
--- a/src/corelib/io/qprocess_wince.cpp
+++ b/src/corelib/io/qprocess_wince.cpp
@@ -138,8 +138,7 @@ void QProcessPrivate::startProcess()
if (!success) {
cleanup();
- processError = QProcess::FailedToStart;
- emit q->error(processError);
+ setErrorAndEmit(QProcess::FailedToStart);
q->setProcessState(QProcess::NotRunning);
return;
}
@@ -161,7 +160,7 @@ void QProcessPrivate::startProcess()
_q_startupNotification();
}
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString * /*errorMessage*/)
{
return processState == QProcess::Running;
}
@@ -210,8 +209,7 @@ bool QProcessPrivate::waitForStarted(int)
if (processError == QProcess::FailedToStart)
return false;
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+ setError(QProcess::Timedout);
return false;
}
@@ -237,22 +235,15 @@ bool QProcessPrivate::waitForFinished(int msecs)
qDebug("QProcessPrivate::waitForFinished(%d)", msecs);
#endif
- QIncrementalSleepTimer timer(msecs);
-
- forever {
- if (!pid)
- return true;
-
- if (WaitForSingleObject(pid->hProcess, timer.nextSleepTime()) == WAIT_OBJECT_0) {
- _q_processDied();
- return true;
- }
+ if (!pid)
+ return true;
- if (timer.hasTimedOut())
- break;
+ if (WaitForSingleObject(pid->hProcess, msecs == -1 ? INFINITE : msecs) == WAIT_OBJECT_0) {
+ _q_processDied();
+ return true;
}
- processError = QProcess::Timedout;
- q->setErrorString(QProcess::tr("Process operation timed out"));
+
+ setError(QProcess::Timedout);
return false;
}
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 6671333ffb..0674ef34e0 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -35,7 +35,6 @@
#include "qresource_p.h"
#include "qresource_iterator_p.h"
#include "qset.h"
-#include "qhash.h"
#include "qmutex.h"
#include "qdebug.h"
#include "qlocale.h"
@@ -791,6 +790,7 @@ QStringList QResourceRoot::children(int node) const
offset += 4;
const int child_off = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
+ ret.reserve(child_count);
for(int i = child_off; i < child_off+child_count; ++i)
ret << name(i);
}
@@ -800,8 +800,8 @@ bool QResourceRoot::mappingRootSubdir(const QString &path, QString *match) const
{
const QString root = mappingRoot();
if(!root.isEmpty()) {
- const QStringList root_segments = root.split(QLatin1Char('/'), QString::SkipEmptyParts),
- path_segments = path.split(QLatin1Char('/'), QString::SkipEmptyParts);
+ 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) {
@@ -811,7 +811,7 @@ bool QResourceRoot::mappingRootSubdir(const QString &path, QString *match) const
}
if(matched == path_segments.size()) {
if(match && root_segments.size() > matched)
- *match = root_segments.at(matched);
+ *match = root_segments.at(matched).toString();
return true;
}
}
diff --git a/src/corelib/io/qsavefile.h b/src/corelib/io/qsavefile.h
index 3f5f09bf5c..085378ed4e 100644
--- a/src/corelib/io/qsavefile.h
+++ b/src/corelib/io/qsavefile.h
@@ -58,7 +58,7 @@ class Q_CORE_EXPORT QSaveFile : public QFileDevice
public:
explicit QSaveFile(const QString &name);
- explicit QSaveFile(QObject *parent = 0);
+ explicit QSaveFile(QObject *parent = Q_NULLPTR);
explicit QSaveFile(const QString &name, QObject *parent);
~QSaveFile();
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 52bcb153ae..1c7ceed3c1 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -127,6 +127,7 @@ struct QConfFileCustomFormat
QSettings::WriteFunc writeFunc;
Qt::CaseSensitivity caseSensitivity;
};
+Q_DECLARE_TYPEINFO(QConfFileCustomFormat, Q_MOVABLE_TYPE);
typedef QHash<QString, QConfFile *> ConfFileHash;
typedef QCache<QString, QConfFile> ConfFileCache;
@@ -299,7 +300,7 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F
}
#endif
-void QSettingsPrivate::processChild(QString key, ChildSpec spec, QMap<QString, QString> &result)
+void QSettingsPrivate::processChild(QStringRef key, ChildSpec spec, QStringList &result)
{
if (spec != AllKeys) {
int slashPos = key.indexOf(QLatin1Char('/'));
@@ -312,7 +313,7 @@ void QSettingsPrivate::processChild(QString key, ChildSpec spec, QMap<QString, Q
key.truncate(slashPos);
}
}
- result.insert(key, QString());
+ result.append(key.toString());
}
void QSettingsPrivate::beginGroupOrArray(const QSettingsGroup &group)
@@ -357,6 +358,7 @@ void QSettingsPrivate::requestUpdate()
QStringList QSettingsPrivate::variantListToStringList(const QVariantList &l)
{
QStringList result;
+ result.reserve(l.count());
QVariantList::const_iterator it = l.constBegin();
for (; it != l.constEnd(); ++it)
result.append(variantToString(*it));
@@ -374,7 +376,9 @@ QVariant QSettingsPrivate::stringListToVariantList(const QStringList &l)
outStringList[i].remove(0, 1);
} else {
QVariantList variantList;
- for (int j = 0; j < l.count(); ++j)
+ const int stringCount = l.count();
+ variantList.reserve(stringCount);
+ for (int j = 0; j < stringCount; ++j)
variantList.append(stringToVariant(l.at(j)));
return variantList;
}
@@ -449,14 +453,23 @@ QString QSettingsPrivate::variantToString(const QVariant &v)
default: {
#ifndef QT_NO_DATASTREAM
+ QDataStream::Version version;
+ const char *typeSpec;
+ if (v.type() == QVariant::DateTime) {
+ version = QDataStream::Qt_5_6;
+ typeSpec = "@DateTime(";
+ } else {
+ version = QDataStream::Qt_4_0;
+ typeSpec = "@Variant(";
+ }
QByteArray a;
{
QDataStream s(&a, QIODevice::WriteOnly);
- s.setVersion(QDataStream::Qt_4_0);
+ s.setVersion(version);
s << v;
}
- result = QLatin1String("@Variant(");
+ result = QLatin1String(typeSpec);
result += QString::fromLatin1(a.constData(), a.size());
result += QLatin1Char(')');
#else
@@ -475,12 +488,22 @@ QVariant QSettingsPrivate::stringToVariant(const QString &s)
if (s.startsWith(QLatin1Char('@'))) {
if (s.endsWith(QLatin1Char(')'))) {
if (s.startsWith(QLatin1String("@ByteArray("))) {
- return QVariant(s.toLatin1().mid(11, s.size() - 12));
- } else if (s.startsWith(QLatin1String("@Variant("))) {
+ return QVariant(s.midRef(11, s.size() - 12).toLatin1());
+ } else if (s.startsWith(QLatin1String("@Variant("))
+ || s.startsWith(QLatin1String("@DateTime("))) {
#ifndef QT_NO_DATASTREAM
- QByteArray a(s.toLatin1().mid(9));
+ QDataStream::Version version;
+ int offset;
+ if (s.at(1) == QLatin1Char('D')) {
+ version = QDataStream::Qt_5_6;
+ offset = 10;
+ } else {
+ version = QDataStream::Qt_4_0;
+ offset = 9;
+ }
+ QByteArray a = s.midRef(offset).toLatin1();
QDataStream stream(&a, QIODevice::ReadOnly);
- stream.setVersion(QDataStream::Qt_4_0);
+ stream.setVersion(version);
QVariant result;
stream >> result;
return result;
@@ -609,8 +632,9 @@ void QSettingsPrivate::iniEscapedString(const QString &str, QByteArray &result,
int startPos = result.size();
result.reserve(startPos + str.size() * 3 / 2);
+ const QChar *unicode = str.unicode();
for (i = 0; i < str.size(); ++i) {
- uint ch = str.at(i).unicode();
+ uint ch = unicode[i].unicode();
if (ch == ';' || ch == ',' || ch == '=')
needsQuotes = true;
@@ -664,7 +688,7 @@ void QSettingsPrivate::iniEscapedString(const QString &str, QByteArray &result,
#ifndef QT_NO_TEXTCODEC
} else if (useCodec) {
// slow
- result += codec->fromUnicode(str.at(i));
+ result += codec->fromUnicode(&unicode[i], 1);
#endif
} else {
result += (char)ch;
@@ -1052,12 +1076,12 @@ static void initDefaultPaths(QMutexLocker *locker)
// Non XDG platforms (OS X, iOS, Blackberry, Android...) have used this code path erroneously
// for some time now. Moving away from that would require migrating existing settings.
QString userPath;
- char *env = getenv("XDG_CONFIG_HOME");
- if (env == 0) {
+ QByteArray env = qgetenv("XDG_CONFIG_HOME");
+ if (env.isEmpty()) {
userPath = QDir::homePath();
userPath += QLatin1Char('/');
userPath += QLatin1String(".config");
- } else if (*env == '/') {
+ } else if (env.startsWith('/')) {
userPath = QFile::decodeName(env);
} else {
userPath = QDir::homePath();
@@ -1269,7 +1293,7 @@ bool QConfFileSettingsPrivate::get(const QString &key, QVariant *value) const
QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec spec) const
{
- QMap<QString, QString> result;
+ QStringList result;
ParsedSettingsMap::const_iterator j;
QSettingsKey thePrefix(prefix, caseSensitivity);
@@ -1289,14 +1313,14 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
&confFile->originalKeys)->lowerBound( thePrefix);
while (j != confFile->originalKeys.constEnd() && j.key().startsWith(thePrefix)) {
if (!confFile->removedKeys.contains(j.key()))
- processChild(j.key().originalCaseKey().mid(startPos), spec, result);
+ processChild(j.key().originalCaseKey().midRef(startPos), spec, result);
++j;
}
j = const_cast<const ParsedSettingsMap *>(
&confFile->addedKeys)->lowerBound(thePrefix);
while (j != confFile->addedKeys.constEnd() && j.key().startsWith(thePrefix)) {
- processChild(j.key().originalCaseKey().mid(startPos), spec, result);
+ processChild(j.key().originalCaseKey().midRef(startPos), spec, result);
++j;
}
@@ -1304,7 +1328,10 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
break;
}
}
- return result.keys();
+ std::sort(result.begin(), result.end());
+ result.erase(std::unique(result.begin(), result.end()),
+ result.end());
+ return result;
}
void QConfFileSettingsPrivate::clear()
@@ -1759,6 +1786,7 @@ public:
int position;
};
+Q_DECLARE_TYPEINFO(QSettingsIniKey, Q_MOVABLE_TYPE);
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
{
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index f7a7bdbb19..8f41273ffa 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -105,13 +105,13 @@ public:
#ifndef QT_NO_QOBJECT
explicit QSettings(const QString &organization,
- const QString &application = QString(), QObject *parent = 0);
+ const QString &application = QString(), QObject *parent = Q_NULLPTR);
QSettings(Scope scope, const QString &organization,
- const QString &application = QString(), QObject *parent = 0);
+ const QString &application = QString(), QObject *parent = Q_NULLPTR);
QSettings(Format format, Scope scope, const QString &organization,
- const QString &application = QString(), QObject *parent = 0);
- QSettings(const QString &fileName, Format format, QObject *parent = 0);
- explicit QSettings(QObject *parent = 0);
+ const QString &application = QString(), QObject *parent = Q_NULLPTR);
+ QSettings(const QString &fileName, Format format, QObject *parent = Q_NULLPTR);
+ explicit QSettings(QObject *parent = Q_NULLPTR);
#else
explicit QSettings(const QString &organization,
const QString &application = QString());
diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp
index 51321c49e7..e0b317b4c2 100644
--- a/src/corelib/io/qsettings_mac.cpp
+++ b/src/corelib/io/qsettings_mac.cpp
@@ -386,7 +386,7 @@ QMacSettingsPrivate::QMacSettingsPrivate(QSettings::Scope scope, const QString &
if (main_bundle_identifier != NULL) {
QString bundle_identifier(qtKey(main_bundle_identifier));
// CFBundleGetIdentifier returns identifier separated by slashes rather than periods.
- QStringList bundle_identifier_components = bundle_identifier.split(QLatin1String("/"));
+ QStringList bundle_identifier_components = bundle_identifier.split(QLatin1Char('/'));
// pre-reverse them so that when they get reversed again below, they are in the com.company.product format.
QStringList bundle_identifier_components_reversed;
for (int i=0; i<bundle_identifier_components.size(); ++i) {
@@ -403,11 +403,11 @@ QMacSettingsPrivate::QMacSettingsPrivate(QSettings::Scope scope, const QString &
}
while ((nextDot = domainName.indexOf(QLatin1Char('.'), curPos)) != -1) {
- javaPackageName.prepend(domainName.mid(curPos, nextDot - curPos));
+ javaPackageName.prepend(domainName.midRef(curPos, nextDot - curPos));
javaPackageName.prepend(QLatin1Char('.'));
curPos = nextDot + 1;
}
- javaPackageName.prepend(domainName.mid(curPos));
+ javaPackageName.prepend(domainName.midRef(curPos));
javaPackageName = javaPackageName.toLower();
if (curPos == 0)
javaPackageName.prepend(QLatin1String("com."));
@@ -491,7 +491,7 @@ bool QMacSettingsPrivate::get(const QString &key, QVariant *value) const
QStringList QMacSettingsPrivate::children(const QString &prefix, ChildSpec spec) const
{
- QMap<QString, QString> result;
+ QStringList result;
int startPos = prefix.size();
for (int i = 0; i < numDomains; ++i) {
@@ -505,7 +505,7 @@ QStringList QMacSettingsPrivate::children(const QString &prefix, ChildSpec spec)
QString currentKey =
qtKey(static_cast<CFStringRef>(CFArrayGetValueAtIndex(cfarray, k)));
if (currentKey.startsWith(prefix))
- processChild(currentKey.mid(startPos), spec, result);
+ processChild(currentKey.midRef(startPos), spec, result);
}
}
}
@@ -513,7 +513,10 @@ QStringList QMacSettingsPrivate::children(const QString &prefix, ChildSpec spec)
if (!fallbacks)
break;
}
- return result.keys();
+ std::sort(result.begin(), result.end());
+ result.erase(std::unique(result.begin(), result.end()),
+ result.end());
+ return result;
}
void QMacSettingsPrivate::clear()
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index 93d63fd411..5a3eb58a58 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -127,6 +127,7 @@ public:
int num;
int maxNum;
};
+Q_DECLARE_TYPEINFO(QSettingsGroup, Q_MOVABLE_TYPE);
inline QString QSettingsGroup::toString() const
{
@@ -211,7 +212,7 @@ public:
const QString &organization, const QString &application);
static QSettingsPrivate *create(const QString &fileName, QSettings::Format format);
- static void processChild(QString key, ChildSpec spec, QMap<QString, QString> &result);
+ static void processChild(QStringRef key, ChildSpec spec, QStringList &result);
// Variant streaming functions
static QStringList variantListToStringList(const QVariantList &l);
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index 60b15f41a0..1546219c3b 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -319,11 +319,11 @@ private:
};
RegistryKey::RegistryKey(HKEY parent_handle, const QString &key, bool read_only)
+ : m_parent_handle(parent_handle),
+ m_handle(0),
+ m_key(key),
+ m_read_only(read_only)
{
- m_parent_handle = parent_handle;
- m_handle = 0;
- m_read_only = read_only;
- m_key = key;
}
QString RegistryKey::key() const
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 74252d1f0a..8828e09e8f 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -35,7 +35,6 @@
#include <qdir.h>
#include <qfileinfo.h>
-#include <qhash.h>
#ifndef QT_BOOTSTRAPPED
#include <qobject.h>
@@ -183,7 +182,7 @@ QT_BEGIN_NAMESPACE
\li "C:/Users/<USER>/AppData/Local/<APPNAME>/cache"
\row \li GenericDataLocation
\li "~/Library/Application Support", "/Library/Application Support"
- \li "C:/Users/<USER>/AppData/Local", "C:/ProgramData"
+ \li "C:/Users/<USER>/AppData/Local", "C:/ProgramData", "<APPDIR>", "<APPDIR>/data"
\row \li RuntimeLocation
\li "~/Library/Application Support"
\li "C:/Users/<USER>"
@@ -523,13 +522,8 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
QStringList searchPaths = paths;
if (paths.isEmpty()) {
QByteArray pEnv = qgetenv("PATH");
-#if defined(Q_OS_WIN)
- const QLatin1Char pathSep(';');
-#else
- const QLatin1Char pathSep(':');
-#endif
// Remove trailing slashes, which occur on Windows.
- const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, QString::SkipEmptyParts);
+ const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(QDir::listSeparator(), QString::SkipEmptyParts);
searchPaths.reserve(rawPaths.size());
foreach (const QString &rawPath, rawPaths) {
QString cleanPath = QDir::cleanPath(rawPath);
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index ed2faa742a..78f75482ea 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -113,21 +113,33 @@ QString QStandardPaths::writableLocation(StandardLocation type)
{
const uid_t myUid = geteuid();
// http://standards.freedesktop.org/basedir-spec/latest/
+ QFileInfo fileInfo;
QString xdgRuntimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR"));
if (xdgRuntimeDir.isEmpty()) {
const QString userName = QFileSystemEngine::resolveUserName(myUid);
xdgRuntimeDir = QDir::tempPath() + QLatin1String("/runtime-") + userName;
- QDir dir(xdgRuntimeDir);
- if (!dir.exists()) {
+ fileInfo.setFile(xdgRuntimeDir);
+ if (!fileInfo.isDir()) {
if (!QDir().mkdir(xdgRuntimeDir)) {
qWarning("QStandardPaths: error creating runtime directory %s: %s", qPrintable(xdgRuntimeDir), qPrintable(qt_error_string(errno)));
return QString();
}
}
qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));
+ } else {
+ fileInfo.setFile(xdgRuntimeDir);
+ if (!fileInfo.exists()) {
+ qWarning("QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '%s', "
+ "please create it with 0700 permissions.", qPrintable(xdgRuntimeDir));
+ return QString();
+ }
+ if (!fileInfo.isDir()) {
+ qWarning("QStandardPaths: XDG_RUNTIME_DIR points to '%s' which is not a directory",
+ qPrintable(xdgRuntimeDir));
+ return QString();
+ }
}
// "The directory MUST be owned by the user"
- QFileInfo fileInfo(xdgRuntimeDir);
if (fileInfo.ownerId() != myUid) {
qWarning("QStandardPaths: wrong ownership on runtime directory %s, %d instead of %d", qPrintable(xdgRuntimeDir),
fileInfo.ownerId(), myUid);
@@ -135,13 +147,15 @@ QString QStandardPaths::writableLocation(StandardLocation type)
}
// "and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700."
// since the current user is the owner, set both xxxUser and xxxOwner
- QFile file(xdgRuntimeDir);
const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser
| QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;
- if (file.permissions() != wantedPerms && !file.setPermissions(wantedPerms)) {
- qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",
- qPrintable(xdgRuntimeDir), qPrintable(file.errorString()));
- return QString();
+ if (fileInfo.permissions() != wantedPerms) {
+ QFile file(xdgRuntimeDir);
+ if (!file.setPermissions(wantedPerms)) {
+ qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",
+ qPrintable(xdgRuntimeDir), qPrintable(file.errorString()));
+ return QString();
+ }
}
return xdgRuntimeDir;
}
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index 615f85a279..ed1c14ad8a 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -212,10 +212,8 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
}
dirs.append(result);
#ifndef QT_BOOTSTRAPPED
- if (type != GenericDataLocation) {
- dirs.append(QCoreApplication::applicationDirPath());
- dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/data"));
- }
+ dirs.append(QCoreApplication::applicationDirPath());
+ dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/data"));
#endif
}
break;
diff --git a/src/corelib/io/qstandardpaths_winrt.cpp b/src/corelib/io/qstandardpaths_winrt.cpp
index b1e51c5082..cb4d1dd152 100644
--- a/src/corelib/io/qstandardpaths_winrt.cpp
+++ b/src/corelib/io/qstandardpaths_winrt.cpp
@@ -123,7 +123,8 @@ QString QStandardPaths::writableLocation(StandardLocation type)
QStringList QStandardPaths::standardLocations(StandardLocation type)
{
- return QStringList(writableLocation(type));
+ const QString writable = writableLocation(type);
+ return writable.isEmpty() ? QStringList() : QStringList(writable);
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp
index 337a9c7cef..99a2a1a42a 100644
--- a/src/corelib/io/qstorageinfo.cpp
+++ b/src/corelib/io/qstorageinfo.cpp
@@ -222,6 +222,18 @@ qint64 QStorageInfo::bytesTotal() const
}
/*!
+ \since 5.6
+ Returns the optimal transfer block size for this filesystem.
+
+ Returns -1 if QStorageInfo could not determine the size or if the QStorageInfo
+ object is not valid.
+ */
+int QStorageInfo::blockSize() const
+{
+ return d->blockSize;
+}
+
+/*!
Returns the type name of the filesystem.
This is a platform-dependent function, and filesystem names can vary
diff --git a/src/corelib/io/qstorageinfo.h b/src/corelib/io/qstorageinfo.h
index 848278e69f..c7a558bb4e 100644
--- a/src/corelib/io/qstorageinfo.h
+++ b/src/corelib/io/qstorageinfo.h
@@ -55,11 +55,10 @@ public:
QStorageInfo &operator=(const QStorageInfo &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QStorageInfo &operator=(QStorageInfo &&other)
- { qSwap(d, other.d); return *this; }
+ QStorageInfo &operator=(QStorageInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- inline void swap(QStorageInfo &other)
+ inline void swap(QStorageInfo &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
void setPath(const QString &path);
@@ -73,6 +72,7 @@ public:
qint64 bytesTotal() const;
qint64 bytesFree() const;
qint64 bytesAvailable() const;
+ int blockSize() const;
inline bool isRoot() const;
bool isReadOnly() const;
diff --git a/src/corelib/io/qstorageinfo_mac.cpp b/src/corelib/io/qstorageinfo_mac.cpp
index 539af33c5d..64ca6d7175 100644
--- a/src/corelib/io/qstorageinfo_mac.cpp
+++ b/src/corelib/io/qstorageinfo_mac.cpp
@@ -76,6 +76,7 @@ void QStorageInfoPrivate::retrievePosixInfo()
device = QByteArray(statfs_buf.f_mntfromname);
readOnly = (statfs_buf.f_flags & MNT_RDONLY) != 0;
fileSystemType = QByteArray(statfs_buf.f_fstypename);
+ blockSize = statfs_buf.f_bsize;
}
}
@@ -146,32 +147,24 @@ void QStorageInfoPrivate::retrieveUrlProperties(bool initRootPath)
void QStorageInfoPrivate::retrieveLabel()
{
-#if !defined(Q_OS_IOS)
- // deprecated since 10.8
- FSRef ref;
- FSPathMakeRef(reinterpret_cast<const UInt8*>(QFile::encodeName(rootPath).constData()),
- &ref,
- Q_NULLPTR);
-
- // deprecated since 10.8
- FSCatalogInfo catalogInfo;
- OSErr error;
- error = FSGetCatalogInfo(&ref, kFSCatInfoVolume, &catalogInfo, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR);
- if (error != noErr)
+ QCFString path = CFStringCreateWithFileSystemRepresentation(0,
+ QFile::encodeName(rootPath).constData());
+ if (!path)
return;
- // deprecated (use CFURLCopyResourcePropertiesForKeys for 10.7 and higher)
- HFSUniStr255 volumeName;
- error = FSGetVolumeInfo(catalogInfo.volume,
- 0,
- Q_NULLPTR,
- kFSVolInfoFSInfo,
- Q_NULLPTR,
- &volumeName,
- Q_NULLPTR);
- if (error == noErr)
- name = QCFString(FSCreateStringFromHFSUniStr(Q_NULLPTR, &volumeName));
-#endif
+ QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle, true);
+ if (!url)
+ return;
+
+ QCFType<CFURLRef> volumeUrl;
+ if (!CFURLCopyResourcePropertyForKey(url, kCFURLVolumeURLKey, &volumeUrl, NULL))
+ return;
+
+ QCFString volumeName;
+ if (!CFURLCopyResourcePropertyForKey(url, kCFURLNameKey, &volumeName, NULL))
+ return;
+
+ name = volumeName;
}
QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h
index 564321bedd..fb3bd8bd5b 100644
--- a/src/corelib/io/qstorageinfo_p.h
+++ b/src/corelib/io/qstorageinfo_p.h
@@ -53,7 +53,7 @@ class QStorageInfoPrivate : public QSharedData
{
public:
inline QStorageInfoPrivate() : QSharedData(),
- bytesTotal(-1), bytesFree(-1), bytesAvailable(-1),
+ bytesTotal(-1), bytesFree(-1), bytesAvailable(-1), blockSize(-1),
readOnly(false), ready(false), valid(false)
{}
@@ -84,6 +84,7 @@ public:
qint64 bytesTotal;
qint64 bytesFree;
qint64 bytesAvailable;
+ int blockSize;
bool readOnly;
bool ready;
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 6ae3338cbd..e365d8d7e6 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -49,7 +49,7 @@
# include <sys/mount.h>
# include <sys/vfs.h>
# include <mntent.h>
-#elif defined(Q_OS_LINUX)
+#elif defined(Q_OS_LINUX) || defined(Q_OS_HURD)
# include <mntent.h>
# include <sys/statvfs.h>
#elif defined(Q_OS_SOLARIS)
@@ -145,7 +145,7 @@ private:
QByteArray m_rootPath;
QByteArray m_fileSystemType;
QByteArray m_device;
-#elif defined(Q_OS_LINUX)
+#elif defined(Q_OS_LINUX) || defined(Q_OS_HURD)
FILE *fp;
mntent mnt;
QByteArray buffer;
@@ -238,7 +238,7 @@ inline QByteArray QStorageIterator::device() const
#elif defined(Q_OS_ANDROID)
-static const char pathMounted[] = "/proc/mounts";
+static const QLatin1String pathMounted("/proc/mounts");
inline QStorageIterator::QStorageIterator()
{
@@ -287,10 +287,11 @@ inline QByteArray QStorageIterator::device() const
return m_device;
}
-#elif defined(Q_OS_LINUX)
+#elif defined(Q_OS_LINUX) || defined(Q_OS_HURD)
static const char pathMounted[] = "/etc/mtab";
-static const int bufferSize = 3*PATH_MAX; // 2 paths (mount point+device) and metainfo
+static const int bufferSize = 1024; // 2 paths (mount point+device) and metainfo;
+ // should be enough
inline QStorageIterator::QStorageIterator() :
buffer(QByteArray(bufferSize, 0))
@@ -515,6 +516,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
bytesFree = statfs_buf.f_bfree * statfs_buf.f_frsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
#endif
+ blockSize = statfs_buf.f_bsize;
#if defined(Q_OS_ANDROID) || defined (Q_OS_BSD4)
#if defined(_STATFS_F_FLAGS)
readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0;
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 0beda22f24..71436c6497 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -38,6 +38,7 @@
#include "qdiriterator.h"
#include "qplatformdefs.h"
#include <QDebug>
+#include <QPair>
#if defined(QT_BUILD_CORE_LIB)
#include "qcoreapplication.h"
@@ -48,6 +49,10 @@
#include <private/qfilesystemengine_p.h>
#endif
+#if !defined(Q_OS_WIN)
+#include <errno.h>
+#endif
+
QT_BEGIN_NAMESPACE
//************* QTemporaryDirPrivate
@@ -59,7 +64,7 @@ public:
void create(const QString &templateName);
- QString path;
+ QString pathOrError;
bool autoRemove;
bool success;
};
@@ -97,7 +102,7 @@ static int nextRand(int &v)
return r;
}
-static char *q_mkdtemp(char *templateName)
+QPair<QString, bool> q_mkdtemp(char *templateName)
{
static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
@@ -105,8 +110,7 @@ static char *q_mkdtemp(char *templateName)
char *XXXXXX = templateName + length - 6;
- if ((length < 6u) || strncmp(XXXXXX, "XXXXXX", 6))
- return 0;
+ Q_ASSERT((length >= 6u) && strncmp(XXXXXX, "XXXXXX", 6) == 0);
for (int i = 0; i < 256; ++i) {
int v = qrand();
@@ -133,17 +137,27 @@ static char *q_mkdtemp(char *templateName)
qWarning() << "Unable to remove unused directory" << templateNameStr;
continue;
}
- return templateName;
+ return qMakePair(QFile::decodeName(templateName), true);
}
+# ifdef Q_OS_WIN
+ const int exists = ERROR_ALREADY_EXISTS;
+ int code = GetLastError();
+# else
+ const int exists = EEXIST;
+ int code = errno;
+# endif
+ if (code != exists)
+ return qMakePair(qt_error_string(code), false);
}
- return 0;
+ return qMakePair(qt_error_string(), false);
}
#else // defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID)
-static char *q_mkdtemp(char *templateName)
+QPair<QString, bool> q_mkdtemp(char *templateName)
{
- return mkdtemp(templateName);
+ bool ok = (mkdtemp(templateName) != 0);
+ return qMakePair(ok ? QFile::decodeName(templateName) : qt_error_string(), ok);
}
#endif
@@ -153,10 +167,9 @@ void QTemporaryDirPrivate::create(const QString &templateName)
QByteArray buffer = QFile::encodeName(templateName);
if (!buffer.endsWith("XXXXXX"))
buffer += "XXXXXX";
- if (q_mkdtemp(buffer.data())) { // modifies buffer
- success = true;
- path = QFile::decodeName(buffer.constData());
- }
+ QPair<QString, bool> result = q_mkdtemp(buffer.data()); // modifies buffer
+ pathOrError = result.first;
+ success = result.second;
}
//************* QTemporaryDir
@@ -256,12 +269,24 @@ bool QTemporaryDir::isValid() const
}
/*!
+ \since 5.6
+
+ If isValid() returns \c false, this function returns the error string that
+ explains why the creation of the temporary directory failed. Otherwise, this
+ function return an empty string.
+*/
+QString QTemporaryDir::errorString() const
+{
+ return d_ptr->success ? QString() : d_ptr->pathOrError;
+}
+
+/*!
Returns the path to the temporary directory.
Empty if the QTemporaryDir could not be created.
*/
QString QTemporaryDir::path() const
{
- return d_ptr->path;
+ return d_ptr->success ? d_ptr->pathOrError : QString();
}
/*!
diff --git a/src/corelib/io/qtemporarydir.h b/src/corelib/io/qtemporarydir.h
index 8b98226529..ab6d841cdf 100644
--- a/src/corelib/io/qtemporarydir.h
+++ b/src/corelib/io/qtemporarydir.h
@@ -52,6 +52,7 @@ public:
~QTemporaryDir();
bool isValid() const;
+ QString errorString() const;
bool autoRemove() const;
void setAutoRemove(bool b);
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 68ac85fffd..e8e8d8c878 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -236,9 +236,9 @@ QTemporaryFileEngine::~QTemporaryFileEngine()
QFSFileEngine::close();
}
-bool QTemporaryFileEngine::isReallyOpen()
+bool QTemporaryFileEngine::isReallyOpen() const
{
- Q_D(QFSFileEngine);
+ Q_D(const QFSFileEngine);
if (!((0 == d->fh) && (-1 == d->fd)
#if defined Q_OS_WIN
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index 2d4468fcf8..8002990270 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -91,7 +91,7 @@ public:
}
~QTemporaryFileEngine();
- bool isReallyOpen();
+ bool isReallyOpen() const;
void setFileName(const QString &file);
void setFileTemplate(const QString &fileTemplate);
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index aa14f545ec..a8fd2dd7ab 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -121,7 +121,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
digits of the generated number. Some extra number formatting
options are also available through setNumberFlags().
- \keyword QTextStream manipulators
+ \target QTextStream manipulators
Like \c <iostream> in the standard C++ library, QTextStream also
defines several global manipulator functions:
@@ -222,6 +222,8 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
#include "qbuffer.h"
#include "qfile.h"
#include "qnumeric.h"
+#include "qvarlengtharray.h"
+
#ifndef Q_OS_WINCE
#include <locale.h>
#endif
@@ -845,6 +847,21 @@ inline void QTextStreamPrivate::write(QChar ch)
/*!
\internal
*/
+void QTextStreamPrivate::write(QLatin1String data)
+{
+ if (string) {
+ // ### What about seek()??
+ string->append(data);
+ } else {
+ writeBuffer += data;
+ if (writeBuffer.size() > QTEXTSTREAM_BUFFERSIZE)
+ flushWriteBuffer();
+ }
+}
+
+/*!
+ \internal
+*/
inline bool QTextStreamPrivate::getChar(QChar *ch)
{
if ((string && stringOffset == string->size())
@@ -891,45 +908,97 @@ inline void QTextStreamPrivate::putChar(QChar ch)
write(ch);
}
+
+/*!
+ \internal
+*/
+QTextStreamPrivate::PaddingResult QTextStreamPrivate::padding(int len) const
+{
+ Q_ASSERT(params.fieldWidth > len); // calling padding() when no padding is needed is an error
+
+ // Do NOT break NRVO in this function or kittens will die!
+
+ PaddingResult result;
+
+ const int padSize = params.fieldWidth - len;
+
+ result.padding.resize(padSize);
+ std::fill_n(result.padding.begin(), padSize, params.padChar);
+
+ switch (params.fieldAlignment) {
+ case QTextStream::AlignLeft:
+ result.left = 0;
+ result.right = padSize;
+ break;
+ case QTextStream::AlignRight:
+ case QTextStream::AlignAccountingStyle:
+ result.left = padSize;
+ result.right = 0;
+ break;
+ case QTextStream::AlignCenter:
+ result.left = padSize/2;
+ result.right = padSize - padSize/2;
+ break;
+ }
+
+ return result;
+}
+
/*!
\internal
*/
void QTextStreamPrivate::putString(const QChar *data, int len, bool number)
{
- QString pad;
- int padLeft = 0, padRight = 0;
+ if (Q_UNLIKELY(params.fieldWidth > len)) {
- // handle padding
- int padSize = params.fieldWidth - len;
- if (padSize > 0) {
- pad = QString(padSize, params.padChar);
- switch (params.fieldAlignment) {
- case QTextStream::AlignLeft:
- padRight = padSize;
- break;
- case QTextStream::AlignRight:
- case QTextStream::AlignAccountingStyle:
- padLeft = padSize;
- if (params.fieldAlignment == QTextStream::AlignAccountingStyle && number) {
- const QChar sign = len > 0 ? data[0] : QChar();
- if (sign == locale.negativeSign() || sign == locale.positiveSign()) {
- // write the sign before the padding, then skip it later
- write(&sign, 1);
- ++data;
- --len;
- }
+ // handle padding:
+
+ const PaddingResult pad = padding(len);
+
+ if (params.fieldAlignment == QTextStream::AlignAccountingStyle && number) {
+ const QChar sign = len > 0 ? data[0] : QChar();
+ if (sign == locale.negativeSign() || sign == locale.positiveSign()) {
+ // write the sign before the padding, then skip it later
+ write(&sign, 1);
+ ++data;
+ --len;
}
- break;
- case QTextStream::AlignCenter:
- padLeft = padSize/2;
- padRight = padSize - padSize/2;
- break;
}
+
+ write(pad.padding.constData(), pad.left);
+ write(data, len);
+ write(pad.padding.constData(), pad.right);
+ } else {
+ write(data, len);
}
+}
+
+/*!
+ \internal
+*/
+void QTextStreamPrivate::putString(QLatin1String data, bool number)
+{
+ if (Q_UNLIKELY(params.fieldWidth > data.size())) {
- write(pad.constData(), padLeft);
- write(data, len);
- write(pad.constData(), padRight);
+ // handle padding
+
+ const PaddingResult pad = padding(data.size());
+
+ if (params.fieldAlignment == QTextStream::AlignAccountingStyle && number) {
+ const QChar sign = data.size() > 0 ? QLatin1Char(*data.data()) : QChar();
+ if (sign == locale.negativeSign() || sign == locale.positiveSign()) {
+ // write the sign before the padding, then skip it later
+ write(&sign, 1);
+ data = QLatin1String(data.data() + 1, data.size() - 1);
+ }
+ }
+
+ write(pad.padding.constData(), pad.left);
+ write(data);
+ write(pad.padding.constData(), pad.right);
+ } else {
+ write(data);
+ }
}
/*!
@@ -2503,14 +2572,28 @@ QTextStream &QTextStream::operator<<(const QString &string)
\overload
Writes \a string to the stream, and returns a reference to the
- QTextStream. The contents of \a string are converted with the
- QString constructor that takes a QLatin1String as argument.
+ QTextStream.
*/
QTextStream &QTextStream::operator<<(QLatin1String string)
{
Q_D(QTextStream);
CHECK_VALID_STREAM(*this);
- d->putString(QString(string));
+ d->putString(string);
+ return *this;
+}
+
+/*!
+ \since 5.6
+ \overload
+
+ Writes \a string to the stream, and returns a reference to the
+ QTextStream.
+*/
+QTextStream &QTextStream::operator<<(const QStringRef &string)
+{
+ Q_D(QTextStream);
+ CHECK_VALID_STREAM(*this);
+ d->putString(string.data(), string.size());
return *this;
}
@@ -2800,7 +2883,7 @@ QTextStream &scientific(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignLeft)
on \a stream and returns \a stream.
- \sa right(), center(), {QTextStream manipulators}
+ \sa {QTextStream::}{right()}, {QTextStream::}{center()}, {QTextStream manipulators}
*/
QTextStream &left(QTextStream &stream)
{
@@ -2814,7 +2897,7 @@ QTextStream &left(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignRight)
on \a stream and returns \a stream.
- \sa left(), center(), {QTextStream manipulators}
+ \sa {QTextStream::}{left()}, {QTextStream::}{center()}, {QTextStream manipulators}
*/
QTextStream &right(QTextStream &stream)
{
@@ -2828,7 +2911,7 @@ QTextStream &right(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignCenter)
on \a stream and returns \a stream.
- \sa left(), right(), {QTextStream manipulators}
+ \sa {QTextStream::}{left()}, {QTextStream::}{right()}, {QTextStream manipulators}
*/
QTextStream &center(QTextStream &stream)
{
diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h
index e5f429ae4d..d7566e6f7b 100644
--- a/src/corelib/io/qtextstream.h
+++ b/src/corelib/io/qtextstream.h
@@ -179,6 +179,7 @@ public:
QTextStream &operator<<(double f);
QTextStream &operator<<(const QString &s);
QTextStream &operator<<(QLatin1String s);
+ QTextStream &operator<<(const QStringRef &s);
QTextStream &operator<<(const QByteArray &array);
QTextStream &operator<<(const char *c);
QTextStream &operator<<(const void *ptr);
@@ -205,8 +206,8 @@ typedef void (QTextStream::*QTSMFC)(QChar); // manipulator w/QChar argument
class Q_CORE_EXPORT QTextStreamManipulator
{
public:
- QTextStreamManipulator(QTSMFI m, int a) { mf = m; mc = 0; arg = a; }
- QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; arg = -1; }
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW : mf(m), mc(Q_NULLPTR), arg(a), ch() {}
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(Q_NULLPTR), mc(m), arg(-1), ch(c) {}
void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
private:
diff --git a/src/corelib/io/qtextstream_p.h b/src/corelib/io/qtextstream_p.h
index 01289d7dc6..115408a6dd 100644
--- a/src/corelib/io/qtextstream_p.h
+++ b/src/corelib/io/qtextstream_p.h
@@ -168,11 +168,21 @@ public:
inline void write(const QString &data) { write(data.begin(), data.length()); }
inline void write(QChar ch);
void write(const QChar *data, int len);
+ void write(QLatin1String data);
inline void putString(const QString &ch, bool number = false) { putString(ch.constData(), ch.length(), number); }
void putString(const QChar *data, int len, bool number = false);
+ void putString(QLatin1String data, bool number = false);
inline void putChar(QChar ch);
void putNumber(qulonglong number, bool negative);
+ struct PaddingResult {
+ enum { PreallocatedPadding = 80 }; // typical line length
+
+ int left, right;
+ QVarLengthArray<QChar, PreallocatedPadding> padding;
+ };
+ PaddingResult padding(int len) const;
+
// buffers
bool fillReadBuffer(qint64 maxBytes = -1);
void resetReadBuffer();
diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp
index 2e787a1bc5..265055083e 100644
--- a/src/corelib/io/qtldurl.cpp
+++ b/src/corelib/io/qtldurl.cpp
@@ -37,7 +37,6 @@
#include "private/qtldurl_p.h"
#include "QtCore/qstring.h"
#include "QtCore/qvector.h"
-#include "QtCore/qhash.h"
QT_BEGIN_NAMESPACE
@@ -100,19 +99,14 @@ Q_CORE_EXPORT bool qIsEffectiveTLD(const QString &domain)
if (containsTLDEntry(domain))
return true;
- if (domain.contains(QLatin1Char('.'))) {
- int count = domain.size() - domain.indexOf(QLatin1Char('.'));
- QString wildCardDomain;
- wildCardDomain.reserve(count + 1);
- wildCardDomain.append(QLatin1Char('*'));
- wildCardDomain.append(domain.right(count));
+ const int dot = domain.indexOf(QLatin1Char('.'));
+ if (dot >= 0) {
+ int count = domain.size() - dot;
+ QString wildCardDomain = QLatin1Char('*') + domain.rightRef(count);
// 2. if table contains '*.bar.com',
// test if table contains '!foo.bar.com'
if (containsTLDEntry(wildCardDomain)) {
- QString exceptionDomain;
- exceptionDomain.reserve(domain.size() + 1);
- exceptionDomain.append(QLatin1Char('!'));
- exceptionDomain.append(domain);
+ QString exceptionDomain = QLatin1Char('!') + domain;
return (! containsTLDEntry(exceptionDomain));
}
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 89f5aad97f..775a870a27 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -2411,8 +2411,8 @@ void QUrl::setPort(int port)
d->clearError();
if (port < -1 || port > 65535) {
- port = -1;
d->setError(QUrlPrivate::InvalidPortError, QString::number(port), 0);
+ port = -1;
}
d->port = port;
@@ -2470,8 +2470,10 @@ void QUrl::setPath(const QString &path, ParsingMode mode)
mode = TolerantMode;
}
- data = qt_normalizePathSegments(data, false);
- d->setPath(data, 0, data.length());
+ int from = 0;
+ while (from < data.length() - 2 && data.midRef(from, 2) == QLatin1String("//"))
+ ++from;
+ d->setPath(data, from, data.length());
// optimized out, since there is no path delimiter
// if (path.isNull())
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index f9a0acf41a..46553d38a5 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -1503,7 +1503,7 @@ static bool isMappedToNothing(uint uc)
static bool containsProhibitedOuptut(const QString *str, int from)
{
const ushort *in = reinterpret_cast<const ushort *>(str->begin() + from);
- const ushort *end = (ushort *)str->data() + str->size();
+ const ushort *end = (const ushort *)str->data() + str->size();
for ( ; in < end; ++in) {
uint uc = *in;
if (QChar(uc).isHighSurrogate() && in < end - 1) {
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp
index 77d1ab3e24..2b695a4f7b 100644
--- a/src/corelib/io/qurlquery.cpp
+++ b/src/corelib/io/qurlquery.cpp
@@ -34,6 +34,7 @@
#include "qurlquery.h"
#include "qurl_p.h"
+#include <QtCore/qhashfunctions.h>
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
@@ -407,6 +408,7 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const
if (d == other.d)
return true;
if (d && other.d)
+ // keep in sync with qHash(QUrlQuery):
return d->valueDelimiter == other.d->valueDelimiter &&
d->pairDelimiter == other.d->pairDelimiter &&
d->itemList == other.d->itemList;
@@ -414,6 +416,25 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const
}
/*!
+ \since 5.6
+ \relates QUrlQuery
+
+ Returns the hash value for \a key,
+ using \a seed to seed the calculation.
+*/
+uint qHash(const QUrlQuery &key, uint seed) Q_DECL_NOTHROW
+{
+ if (const QUrlQueryPrivate *d = key.d) {
+ QtPrivate::QHashCombine hash;
+ // keep in sync with operator==:
+ seed = hash(seed, d->valueDelimiter);
+ seed = hash(seed, d->pairDelimiter);
+ seed = hash(seed, d->itemList);
+ }
+ return seed;
+}
+
+/*!
Returns \c true if this QUrlQuery object contains no key-value pairs, such as
after being default-constructed or after parsing an empty query string.
@@ -621,6 +642,7 @@ QList<QPair<QString, QString> > QUrlQuery::queryItems(QUrl::ComponentFormattingO
QList<QPair<QString, QString> > result;
Map::const_iterator it = d->itemList.constBegin();
Map::const_iterator end = d->itemList.constEnd();
+ result.reserve(d->itemList.count());
for ( ; it != end; ++it)
result << qMakePair(d->recodeToUser(it->first, encoding),
d->recodeToUser(it->second, encoding));
diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h
index 77a0b4a82d..8fcc1b13d5 100644
--- a/src/corelib/io/qurlquery.h
+++ b/src/corelib/io/qurlquery.h
@@ -44,6 +44,8 @@
QT_BEGIN_NAMESPACE
+Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed = 0) Q_DECL_NOTHROW;
+
class QUrlQueryPrivate;
class Q_CORE_EXPORT QUrlQuery
{
@@ -54,8 +56,7 @@ public:
QUrlQuery(const QUrlQuery &other);
QUrlQuery &operator=(const QUrlQuery &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QUrlQuery &operator=(QUrlQuery &&other)
- { qSwap(d, other.d); return *this; }
+ QUrlQuery &operator=(QUrlQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
~QUrlQuery();
@@ -63,7 +64,7 @@ public:
bool operator!=(const QUrlQuery &other) const
{ return !(*this == other); }
- void swap(QUrlQuery &other) { qSwap(d, other.d); }
+ void swap(QUrlQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool isEmpty() const;
bool isDetached() const;
@@ -95,6 +96,7 @@ public:
private:
friend class QUrl;
+ friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) Q_DECL_NOTHROW;
QSharedDataPointer<QUrlQueryPrivate> d;
public:
typedef QSharedDataPointer<QUrlQueryPrivate> DataPtr;
@@ -119,7 +121,7 @@ inline QStringList QUrl::allQueryItemValues(const QString &key) const
inline void QUrl::removeQueryItem(const QString &key)
{ QUrlQuery q(*this); q.removeQueryItem(key); setQuery(q); }
inline void QUrl::removeAllQueryItems(const QString &key)
-{ QUrlQuery q(*this); q.removeAllQueryItems(key); }
+{ QUrlQuery q(*this); q.removeAllQueryItems(key); setQuery(q); }
inline void QUrl::addEncodedQueryItem(const QByteArray &key, const QByteArray &value)
{ QUrlQuery q(*this); q.addQueryItem(fromEncodedComponent_helper(key), fromEncodedComponent_helper(value)); setQuery(q); }
@@ -130,7 +132,7 @@ inline QByteArray QUrl::encodedQueryItemValue(const QByteArray &key) const
inline void QUrl::removeEncodedQueryItem(const QByteArray &key)
{ QUrlQuery q(*this); q.removeQueryItem(fromEncodedComponent_helper(key)); setQuery(q); }
inline void QUrl::removeAllEncodedQueryItems(const QByteArray &key)
-{ QUrlQuery q(*this); q.removeAllQueryItems(fromEncodedComponent_helper(key)); }
+{ QUrlQuery q(*this); q.removeAllQueryItems(fromEncodedComponent_helper(key)); setQuery(q); }
inline void QUrl::setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &qry)
{
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index 3200a70c94..f0d6417483 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -136,12 +136,12 @@ qint64 QWindowsPipeReader::read(char *data, qint64 maxlen)
actualReadBufferSize--;
readSoFar = 1;
} else {
- qint64 bytesToRead = qMin(qint64(actualReadBufferSize), maxlen);
+ qint64 bytesToRead = qMin(actualReadBufferSize, maxlen);
readSoFar = 0;
while (readSoFar < bytesToRead) {
const char *ptr = readBuffer.readPointer();
- int bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,
- qint64(readBuffer.nextDataBlockSize()));
+ qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,
+ readBuffer.nextDataBlockSize());
memcpy(data + readSoFar, ptr, bytesToReadFromThisBlock);
readSoFar += bytesToReadFromThisBlock;
readBuffer.free(bytesToReadFromThisBlock);
diff --git a/src/corelib/io/qwindowspipereader_p.h b/src/corelib/io/qwindowspipereader_p.h
index 2c32eeb9ce..c8a66d9511 100644
--- a/src/corelib/io/qwindowspipereader_p.h
+++ b/src/corelib/io/qwindowspipereader_p.h
@@ -96,7 +96,7 @@ private:
QWinOverlappedIoNotifier *dataReadNotifier;
qint64 readBufferMaxSize;
QRingBuffer readBuffer;
- int actualReadBufferSize;
+ qint64 actualReadBufferSize;
bool stopped;
bool readSequenceStarted;
bool pipeBroken;
diff --git a/src/corelib/io/qwinoverlappedionotifier.cpp b/src/corelib/io/qwinoverlappedionotifier.cpp
index 8b7d70cf71..0cefa374fa 100644
--- a/src/corelib/io/qwinoverlappedionotifier.cpp
+++ b/src/corelib/io/qwinoverlappedionotifier.cpp
@@ -102,7 +102,8 @@ public:
OVERLAPPED *waitForAnyNotified(int msecs);
void notify(DWORD numberOfBytes, DWORD errorCode, OVERLAPPED *overlapped);
- OVERLAPPED *_q_notified();
+ void _q_notified();
+ OVERLAPPED *dispatchNextIoResult();
static QWinIoCompletionPort *iocp;
static HANDLE iocpInstanceLock;
@@ -302,8 +303,7 @@ OVERLAPPED *QWinOverlappedIoNotifierPrivate::waitForAnyNotified(int msecs)
const DWORD wfso = WaitForSingleObject(hSemaphore, msecs == -1 ? INFINITE : DWORD(msecs));
switch (wfso) {
case WAIT_OBJECT_0:
- ReleaseSemaphore(hSemaphore, 1, NULL);
- return _q_notified();
+ return dispatchNextIoResult();
case WAIT_TIMEOUT:
return 0;
default:
@@ -385,17 +385,20 @@ void QWinOverlappedIoNotifierPrivate::notify(DWORD numberOfBytes, DWORD errorCod
emit q->_q_notify();
}
-OVERLAPPED *QWinOverlappedIoNotifierPrivate::_q_notified()
+void QWinOverlappedIoNotifierPrivate::_q_notified()
+{
+ if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0)
+ dispatchNextIoResult();
+}
+
+OVERLAPPED *QWinOverlappedIoNotifierPrivate::dispatchNextIoResult()
{
Q_Q(QWinOverlappedIoNotifier);
- if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0) {
- WaitForSingleObject(hResultsMutex, INFINITE);
- IOResult ioresult = results.dequeue();
- ReleaseMutex(hResultsMutex);
- emit q->notified(ioresult.numberOfBytes, ioresult.errorCode, ioresult.overlapped);
- return ioresult.overlapped;
- }
- return 0;
+ WaitForSingleObject(hResultsMutex, INFINITE);
+ IOResult ioresult = results.dequeue();
+ ReleaseMutex(hResultsMutex);
+ emit q->notified(ioresult.numberOfBytes, ioresult.errorCode, ioresult.overlapped);
+ return ioresult.overlapped;
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qwinoverlappedionotifier_p.h b/src/corelib/io/qwinoverlappedionotifier_p.h
index 863f87353e..41945d6556 100644
--- a/src/corelib/io/qwinoverlappedionotifier_p.h
+++ b/src/corelib/io/qwinoverlappedionotifier_p.h
@@ -58,7 +58,7 @@ class Q_CORE_EXPORT QWinOverlappedIoNotifier : public QObject
Q_OBJECT
Q_DISABLE_COPY(QWinOverlappedIoNotifier)
Q_DECLARE_PRIVATE(QWinOverlappedIoNotifier)
- Q_PRIVATE_SLOT(d_func(), OVERLAPPED *_q_notified())
+ Q_PRIVATE_SLOT(d_func(), void _q_notified())
friend class QWinIoCompletionPort;
public:
QWinOverlappedIoNotifier(QObject *parent = 0);
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 60ac75133c..90297b9115 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -479,6 +479,11 @@ public:
Q_GLOBAL_STATIC(QEmptyItemModel, qEmptyModel)
+
+QAbstractItemModelPrivate::~QAbstractItemModelPrivate()
+{
+}
+
QAbstractItemModel *QAbstractItemModelPrivate::staticEmptyModel()
{
return qEmptyModel();
@@ -3217,6 +3222,7 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const
{
Q_D(const QAbstractItemModel);
QModelIndexList result;
+ result.reserve(d->persistent.indexes.count());
for (QHash<QModelIndex, QPersistentModelIndexData *>::const_iterator it = d->persistent.indexes.constBegin();
it != d->persistent.indexes.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index 5ca7bd0123..096e67c513 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -49,7 +49,7 @@ class Q_CORE_EXPORT QModelIndex
{
friend class QAbstractItemModel;
public:
- Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(0) {}
+ Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(Q_NULLPTR) {}
// compiler-generated copy/move ctors/assignment operators are fine!
Q_DECL_CONSTEXPR inline int row() const Q_DECL_NOTHROW { return r; }
Q_DECL_CONSTEXPR inline int column() const Q_DECL_NOTHROW { return c; }
@@ -61,7 +61,7 @@ public:
inline QVariant data(int role = Qt::DisplayRole) const;
inline Qt::ItemFlags flags() const;
Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const Q_DECL_NOTHROW { return m; }
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != 0); }
+ Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != Q_NULLPTR); }
Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const Q_DECL_NOTHROW
{ return (other.r == r) && (other.i == i) && (other.c == c) && (other.m == m); }
Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const Q_DECL_NOTHROW
@@ -161,7 +161,7 @@ class Q_CORE_EXPORT QAbstractItemModel : public QObject
friend class QIdentityProxyModel;
public:
- explicit QAbstractItemModel(QObject *parent = 0);
+ explicit QAbstractItemModel(QObject *parent = Q_NULLPTR);
virtual ~QAbstractItemModel();
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const;
@@ -276,9 +276,9 @@ protected Q_SLOTS:
void resetInternalData();
protected:
- QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = 0);
+ QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = Q_NULLPTR);
- inline QModelIndex createIndex(int row, int column, void *data = 0) const;
+ inline QModelIndex createIndex(int row, int column, void *data = Q_NULLPTR) const;
inline QModelIndex createIndex(int row, int column, quintptr id) const;
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const;
@@ -357,7 +357,7 @@ class Q_CORE_EXPORT QAbstractTableModel : public QAbstractItemModel
Q_OBJECT
public:
- explicit QAbstractTableModel(QObject *parent = 0);
+ explicit QAbstractTableModel(QObject *parent = Q_NULLPTR);
~QAbstractTableModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@@ -383,7 +383,7 @@ class Q_CORE_EXPORT QAbstractListModel : public QAbstractItemModel
Q_OBJECT
public:
- explicit QAbstractListModel(QObject *parent = 0);
+ explicit QAbstractListModel(QObject *parent = Q_NULLPTR);
~QAbstractListModel();
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@@ -420,7 +420,7 @@ inline QVariant QModelIndex::data(int arole) const
{ return m ? m->data(*this, arole) : QVariant(); }
inline Qt::ItemFlags QModelIndex::flags() const
-{ return m ? m->flags(*this) : Qt::ItemFlags(0); }
+{ return m ? m->flags(*this) : Qt::ItemFlags(); }
inline uint qHash(const QModelIndex &index) Q_DECL_NOTHROW
{ return uint((index.row() << 4) + index.column() + index.internalId()); }
diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h b/src/corelib/itemmodels/qabstractitemmodel_p.h
index 075e6a9018..c2cbaf5298 100644
--- a/src/corelib/itemmodels/qabstractitemmodel_p.h
+++ b/src/corelib/itemmodels/qabstractitemmodel_p.h
@@ -71,6 +71,8 @@ class Q_CORE_EXPORT QAbstractItemModelPrivate : public QObjectPrivate
public:
QAbstractItemModelPrivate() : QObjectPrivate(), supportedDragActions(-1), roleNames(defaultRoleNames()) {}
+ ~QAbstractItemModelPrivate();
+
void removePersistentIndexData(QPersistentModelIndexData *data);
void movePersistentIndexes(const QVector<QPersistentModelIndexData *> &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation);
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
@@ -162,6 +164,7 @@ public:
QHash<int,QByteArray> roleNames;
static const QHash<int,QByteArray> &defaultRoleNames();
};
+Q_DECLARE_TYPEINFO(QAbstractItemModelPrivate::Change, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp
index 4d08306d28..dbbbbb8ff4 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.cpp
+++ b/src/corelib/itemmodels/qabstractproxymodel.cpp
@@ -379,6 +379,7 @@ QMimeData* QAbstractProxyModel::mimeData(const QModelIndexList &indexes) const
{
Q_D(const QAbstractProxyModel);
QModelIndexList list;
+ list.reserve(indexes.count());
foreach(const QModelIndex &index, indexes)
list << mapToSource(index);
return d->model->mimeData(list);
diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h
index dc8d2d4dc8..a4cb74830b 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.h
+++ b/src/corelib/itemmodels/qabstractproxymodel.h
@@ -50,7 +50,7 @@ class Q_CORE_EXPORT QAbstractProxyModel : public QAbstractItemModel
Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
public:
- explicit QAbstractProxyModel(QObject *parent = 0);
+ explicit QAbstractProxyModel(QObject *parent = Q_NULLPTR);
~QAbstractProxyModel();
virtual void setSourceModel(QAbstractItemModel *sourceModel);
diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp
index f773219aeb..f46fd135ca 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.cpp
+++ b/src/corelib/itemmodels/qidentityproxymodel.cpp
@@ -212,6 +212,7 @@ QItemSelection QIdentityProxyModel::mapSelectionFromSource(const QItemSelection&
QItemSelection::const_iterator it = selection.constBegin();
const QItemSelection::const_iterator end = selection.constEnd();
+ proxySelection.reserve(selection.count());
for ( ; it != end; ++it) {
Q_ASSERT(it->model() == d->model);
const QItemSelectionRange range(mapFromSource(it->topLeft()), mapFromSource(it->bottomRight()));
@@ -234,6 +235,7 @@ QItemSelection QIdentityProxyModel::mapSelectionToSource(const QItemSelection& s
QItemSelection::const_iterator it = selection.constBegin();
const QItemSelection::const_iterator end = selection.constEnd();
+ sourceSelection.reserve(selection.count());
for ( ; it != end; ++it) {
Q_ASSERT(it->model() == this);
const QItemSelectionRange range(mapToSource(it->topLeft()), mapToSource(it->bottomRight()));
@@ -269,6 +271,7 @@ QModelIndexList QIdentityProxyModel::match(const QModelIndex& start, int role, c
QModelIndexList::const_iterator it = sourceList.constBegin();
const QModelIndexList::const_iterator end = sourceList.constEnd();
QModelIndexList proxyList;
+ proxyList.reserve(sourceList.count());
for ( ; it != end; ++it)
proxyList.append(mapFromSource(*it));
return proxyList;
diff --git a/src/corelib/itemmodels/qidentityproxymodel.h b/src/corelib/itemmodels/qidentityproxymodel.h
index e4587cb386..7578f8d380 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.h
+++ b/src/corelib/itemmodels/qidentityproxymodel.h
@@ -48,7 +48,7 @@ class Q_CORE_EXPORT QIdentityProxyModel : public QAbstractProxyModel
{
Q_OBJECT
public:
- explicit QIdentityProxyModel(QObject* parent = 0);
+ explicit QIdentityProxyModel(QObject* parent = Q_NULLPTR);
~QIdentityProxyModel();
int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index de28953fb5..51c670f79e 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -104,6 +104,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QItemSelectionRange::swap(QItemSelectionRange &other)
+ \since 5.6
+
+ Swaps this selection range's contents with \a other.
+ This function is very fast and never fails.
+*/
+
+/*!
\fn int QItemSelectionRange::top() const
Returns the row index corresponding to the uppermost selected row in the
@@ -721,11 +729,11 @@ void QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(const QModelIndex &pare
deselected.append(*it);
it = ranges.erase(it);
} else if (start <= it->top() && it->top() <= end) { // Top intersection
- deselected.append(QItemSelectionRange(it->topLeft(), model->index(end, it->left(), it->parent())));
+ deselected.append(QItemSelectionRange(it->topLeft(), model->index(end, it->right(), it->parent())));
*it = QItemSelectionRange(model->index(end + 1, it->left(), it->parent()), it->bottomRight());
++it;
} else if (start <= it->bottom() && it->bottom() <= end) { // Bottom intersection
- deselected.append(QItemSelectionRange(model->index(start, it->right(), it->parent()), it->bottomRight()));
+ deselected.append(QItemSelectionRange(model->index(start, it->left(), it->parent()), it->bottomRight()));
*it = QItemSelectionRange(it->topLeft(), model->index(start - 1, it->right(), it->parent()));
++it;
} else if (it->top() < start && end < it->bottom()) { // Middle intersection
@@ -733,8 +741,8 @@ void QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(const QModelIndex &pare
// and [4, 5] is removed, we need to split [3, 4, 5, 6] into [3], [4, 5] and [6].
// [4, 5] is appended to deselected, and [3] and [6] remain part of the selection
// in ranges.
- const QItemSelectionRange removedRange(model->index(start, it->right(), it->parent()),
- model->index(end, it->left(), it->parent()));
+ const QItemSelectionRange removedRange(model->index(start, it->left(), it->parent()),
+ model->index(end, it->right(), it->parent()));
deselected.append(removedRange);
QItemSelection::split(*it, removedRange, &newParts);
it = ranges.erase(it);
@@ -1770,7 +1778,7 @@ const QAbstractItemModel *QItemSelectionModel::model() const
/*!
\since 5.5
- Sets the model. The modelChanged() signal will be emitted.
+ Sets the model to \a model. The modelChanged() signal will be emitted.
\sa model(), modelChanged()
*/
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 4fe836c098..09b710175e 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -48,12 +48,28 @@ class Q_CORE_EXPORT QItemSelectionRange
{
public:
- inline QItemSelectionRange() {}
+ inline QItemSelectionRange() : tl(), br() {}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // ### Qt 6: remove them all, the compiler-generated ones are fine
inline QItemSelectionRange(const QItemSelectionRange &other)
: tl(other.tl), br(other.br) {}
- inline QItemSelectionRange(const QModelIndex &topLeft, const QModelIndex &bottomRight);
- explicit inline QItemSelectionRange(const QModelIndex &index)
- { tl = index; br = tl; }
+# ifdef Q_COMPILER_RVALUE_REFS
+ QItemSelectionRange(QItemSelectionRange &&other) Q_DECL_NOTHROW
+ : tl(std::move(other.tl)), br(std::move(other.br)) {}
+ QItemSelectionRange &operator=(QItemSelectionRange &&other) Q_DECL_NOTHROW
+ { tl = std::move(other.tl); br = std::move(other.br); return *this; }
+# endif
+ QItemSelectionRange &operator=(const QItemSelectionRange &other)
+ { tl = other.tl; br = other.br; return *this; }
+#endif // Qt < 6
+ QItemSelectionRange(const QModelIndex &topL, const QModelIndex &bottomR) : tl(topL), br(bottomR) {}
+ explicit QItemSelectionRange(const QModelIndex &index) : tl(index), br(tl) {}
+
+ void swap(QItemSelectionRange &other) Q_DECL_NOTHROW
+ {
+ qSwap(tl, other.tl);
+ qSwap(br, other.br);
+ }
inline int top() const { return tl.row(); }
inline int left() const { return tl.column(); }
@@ -133,10 +149,6 @@ private:
};
Q_DECLARE_TYPEINFO(QItemSelectionRange, Q_MOVABLE_TYPE);
-inline QItemSelectionRange::QItemSelectionRange(const QModelIndex &atopLeft,
- const QModelIndex &abottomRight)
-{ tl = atopLeft; br = abottomRight; }
-
class QItemSelection;
class QItemSelectionModelPrivate;
@@ -170,7 +182,7 @@ public:
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
Q_FLAG(SelectionFlags)
- explicit QItemSelectionModel(QAbstractItemModel *model = 0);
+ explicit QItemSelectionModel(QAbstractItemModel *model = Q_NULLPTR);
explicit QItemSelectionModel(QAbstractItemModel *model, QObject *parent);
virtual ~QItemSelectionModel();
@@ -235,8 +247,11 @@ inline uint qHash(const QItemSelectionRange &) { return 0; }
class Q_CORE_EXPORT QItemSelection : public QList<QItemSelectionRange>
{
public:
- QItemSelection() {}
+ QItemSelection() Q_DECL_NOTHROW : QList<QItemSelectionRange>() {}
QItemSelection(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+
+ // reusing QList::swap() here is OK!
+
void select(const QModelIndex &topLeft, const QModelIndex &bottomRight);
bool contains(const QModelIndex &index) const;
QModelIndexList indexes() const;
@@ -245,6 +260,7 @@ public:
const QItemSelectionRange &other,
QItemSelection *result);
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QItemSelection)
#ifndef QT_NO_DEBUG_STREAM
Q_CORE_EXPORT QDebug operator<<(QDebug, const QItemSelectionRange &);
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 6853cbd38f..0771fd0e30 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -272,6 +272,7 @@ public:
QModelIndexPairList store_persistent_indexes();
void update_persistent_indexes(const QModelIndexPairList &source_indexes);
+ void filter_about_to_be_changed(const QModelIndex &source_parent = QModelIndex());
void filter_changed(const QModelIndex &source_parent = QModelIndex());
QSet<int> handle_filter_changed(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
@@ -1011,6 +1012,7 @@ QModelIndexPairList QSortFilterProxyModelPrivate::store_persistent_indexes()
{
Q_Q(QSortFilterProxyModel);
QModelIndexPairList source_indexes;
+ source_indexes.reserve(persistent.indexes.count());
foreach (QPersistentModelIndexData *data, persistent.indexes) {
QModelIndex proxy_index = data->index;
QModelIndex source_index = q->mapToSource(proxy_index);
@@ -1030,7 +1032,10 @@ void QSortFilterProxyModelPrivate::update_persistent_indexes(
{
Q_Q(QSortFilterProxyModel);
QModelIndexList from, to;
- for (int i = 0; i < source_indexes.count(); ++i) {
+ const int numSourceIndexes = source_indexes.count();
+ from.reserve(numSourceIndexes);
+ to.reserve(numSourceIndexes);
+ for (int i = 0; i < numSourceIndexes; ++i) {
QModelIndex source_index = source_indexes.at(i).second;
QModelIndex old_proxy_index = source_indexes.at(i).first;
create_mapping(source_index.parent());
@@ -1041,6 +1046,19 @@ void QSortFilterProxyModelPrivate::update_persistent_indexes(
q->changePersistentIndexList(from, to);
}
+/*!
+ \internal
+
+ Updates the source_index mapping in case it's invalid and we
+ need it because we have a valid filter
+*/
+void QSortFilterProxyModelPrivate::filter_about_to_be_changed(const QModelIndex &source_parent)
+{
+ if (!filter_regexp.pattern().isEmpty() &&
+ source_index_mapping.constFind(source_parent) == source_index_mapping.constEnd())
+ create_mapping(source_parent);
+}
+
/*!
\internal
@@ -2013,7 +2031,9 @@ QMimeData *QSortFilterProxyModel::mimeData(const QModelIndexList &indexes) const
{
Q_D(const QSortFilterProxyModel);
QModelIndexList source_indexes;
- for (int i = 0; i < indexes.count(); ++i)
+ const int numIndexes = indexes.count();
+ source_indexes.reserve(numIndexes);
+ for (int i = 0; i < numIndexes; ++i)
source_indexes << mapToSource(indexes.at(i));
return d->model->mimeData(source_indexes);
}
@@ -2108,6 +2128,7 @@ bool QSortFilterProxyModel::removeRows(int row, int count, const QModelIndex &pa
// remove corresponding source intervals
// ### if this proves to be slow, we can switch to single-row removal
QVector<int> rows;
+ rows.reserve(count);
for (int i = row; i < row + count; ++i)
rows.append(m->source_rows.at(i));
std::sort(rows.begin(), rows.end());
@@ -2147,6 +2168,7 @@ bool QSortFilterProxyModel::removeColumns(int column, int count, const QModelInd
}
// remove corresponding source intervals
QVector<int> columns;
+ columns.reserve(count);
for (int i = column; i < column + count; ++i)
columns.append(m->source_columns.at(i));
@@ -2298,6 +2320,7 @@ QRegExp QSortFilterProxyModel::filterRegExp() const
void QSortFilterProxyModel::setFilterRegExp(const QRegExp &regExp)
{
Q_D(QSortFilterProxyModel);
+ d->filter_about_to_be_changed();
d->filter_regexp = regExp;
d->filter_changed();
}
@@ -2319,6 +2342,7 @@ int QSortFilterProxyModel::filterKeyColumn() const
void QSortFilterProxyModel::setFilterKeyColumn(int column)
{
Q_D(QSortFilterProxyModel);
+ d->filter_about_to_be_changed();
d->filter_column = column;
d->filter_changed();
}
@@ -2344,6 +2368,7 @@ void QSortFilterProxyModel::setFilterCaseSensitivity(Qt::CaseSensitivity cs)
Q_D(QSortFilterProxyModel);
if (cs == d->filter_regexp.caseSensitivity())
return;
+ d->filter_about_to_be_changed();
d->filter_regexp.setCaseSensitivity(cs);
d->filter_changed();
}
@@ -2409,6 +2434,7 @@ void QSortFilterProxyModel::setSortLocaleAware(bool on)
void QSortFilterProxyModel::setFilterRegExp(const QString &pattern)
{
Q_D(QSortFilterProxyModel);
+ d->filter_about_to_be_changed();
d->filter_regexp.setPatternSyntax(QRegExp::RegExp);
d->filter_regexp.setPattern(pattern);
d->filter_changed();
@@ -2423,6 +2449,7 @@ void QSortFilterProxyModel::setFilterRegExp(const QString &pattern)
void QSortFilterProxyModel::setFilterWildcard(const QString &pattern)
{
Q_D(QSortFilterProxyModel);
+ d->filter_about_to_be_changed();
d->filter_regexp.setPatternSyntax(QRegExp::Wildcard);
d->filter_regexp.setPattern(pattern);
d->filter_changed();
@@ -2437,6 +2464,7 @@ void QSortFilterProxyModel::setFilterWildcard(const QString &pattern)
void QSortFilterProxyModel::setFilterFixedString(const QString &pattern)
{
Q_D(QSortFilterProxyModel);
+ d->filter_about_to_be_changed();
d->filter_regexp.setPatternSyntax(QRegExp::FixedString);
d->filter_regexp.setPattern(pattern);
d->filter_changed();
@@ -2516,6 +2544,7 @@ void QSortFilterProxyModel::setFilterRole(int role)
Q_D(QSortFilterProxyModel);
if (d->filter_role == role)
return;
+ d->filter_about_to_be_changed();
d->filter_role = role;
d->filter_changed();
}
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h
index a08d7c6416..4be5aedd48 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.h
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.h
@@ -63,7 +63,7 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel
Q_PROPERTY(int filterRole READ filterRole WRITE setFilterRole)
public:
- explicit QSortFilterProxyModel(QObject *parent = 0);
+ explicit QSortFilterProxyModel(QObject *parent = Q_NULLPTR);
~QSortFilterProxyModel();
void setSourceModel(QAbstractItemModel *sourceModel) Q_DECL_OVERRIDE;
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index 2853be3fda..dad736b445 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -257,7 +257,9 @@ void QStringListModel::sort(int, Qt::SortOrder order)
emit layoutAboutToBeChanged(QList<QPersistentModelIndex>(), VerticalSortHint);
QList<QPair<QString, int> > list;
- for (int i = 0; i < lst.count(); ++i)
+ const int lstCount = lst.count();
+ list.reserve(lstCount);
+ for (int i = 0; i < lstCount; ++i)
list.append(QPair<QString, int>(lst.at(i), i));
if (order == Qt::AscendingOrder)
diff --git a/src/corelib/itemmodels/qstringlistmodel.h b/src/corelib/itemmodels/qstringlistmodel.h
index 973007995b..a1cb923dbb 100644
--- a/src/corelib/itemmodels/qstringlistmodel.h
+++ b/src/corelib/itemmodels/qstringlistmodel.h
@@ -46,8 +46,8 @@ class Q_CORE_EXPORT QStringListModel : public QAbstractListModel
{
Q_OBJECT
public:
- explicit QStringListModel(QObject *parent = 0);
- explicit QStringListModel(const QStringList &strings, QObject *parent = 0);
+ explicit QStringListModel(QObject *parent = Q_NULLPTR);
+ explicit QStringListModel(const QStringList &strings, QObject *parent = Q_NULLPTR);
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h
index 17f49d41c8..7f5a2d88a1 100644
--- a/src/corelib/json/qjson_p.h
+++ b/src/corelib/json/qjson_p.h
@@ -280,7 +280,7 @@ static inline int compressedNumber(double d)
if (non_int)
return INT_MAX;
- bool neg = (val >> 63);
+ bool neg = (val >> 63) != 0;
val &= fraction_mask;
val |= ((quint64)1 << 52);
int res = (int)(val >> (52 - exp));
@@ -543,7 +543,7 @@ public:
offset tableOffset;
// content follows here
- inline bool isObject() const { return is_object; }
+ inline bool isObject() const { return !!is_object; }
inline bool isArray() const { return !isObject(); }
inline offset *table() const { return (offset *) (((char *) this) + tableOffset); }
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index 77a3d0a2b8..bb33dbde74 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -271,6 +271,7 @@ QVariantList QJsonArray::toVariantList() const
QVariantList list;
if (a) {
+ list.reserve(a->length);
for (int i = 0; i < (int)a->length; ++i)
list.append(QJsonValue(d, a, a->at(i)).toVariant());
}
@@ -532,8 +533,8 @@ bool QJsonArray::contains(const QJsonValue &value) const
\a i must be a valid index position in the array (i.e., \c{0 <= i <
size()}).
- The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
- and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
+ The return value is of type QJsonValueRef, a helper class for QJsonArray
+ and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
the assignment will apply to the character in the QJsonArray of QJsonObject
from which you got the reference.
@@ -738,8 +739,8 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
You can change the value of an item by using operator*() on the
left side of an assignment.
- The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
- and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
+ The return value is of type QJsonValueRef, a helper class for QJsonArray
+ and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
the assignment will apply to the character in the QJsonArray of QJsonObject
from which you got the reference.
@@ -758,8 +759,8 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
This function is provided to make QJsonArray iterators behave like C++
pointers.
- The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
- and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
+ The return value is of type QJsonValueRef, a helper class for QJsonArray
+ and QJsonObject. When you get an object of type QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
the assignment will apply to the character in the QJsonArray of QJsonObject
from which you got the reference.
diff --git a/src/corelib/json/qjsonarray.h b/src/corelib/json/qjsonarray.h
index 6148642106..611e1f4193 100644
--- a/src/corelib/json/qjsonarray.h
+++ b/src/corelib/json/qjsonarray.h
@@ -107,7 +107,7 @@ public:
typedef QJsonValueRef reference;
typedef QJsonValueRefPtr pointer;
- inline iterator() : a(0), i(0) { }
+ inline iterator() : a(Q_NULLPTR), i(0) { }
explicit inline iterator(QJsonArray *array, int index) : a(array), i(index) { }
inline QJsonValueRef operator*() const { return QJsonValueRef(a, i); }
@@ -152,9 +152,11 @@ public:
typedef QJsonValue reference;
typedef QJsonValuePtr pointer;
- inline const_iterator() : a(0), i(0) { }
+ inline const_iterator() : a(Q_NULLPTR), i(0) { }
explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { }
- inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {} // ### Qt 6: Removed so class can be trivially-copyable
+#endif
inline const_iterator(const iterator &o) : a(o.a), i(o.i) {}
inline QJsonValue operator*() const { return a->at(i); }
diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp
index f5bad32233..3ef006d82d 100644
--- a/src/corelib/json/qjsondocument.cpp
+++ b/src/corelib/json/qjsondocument.cpp
@@ -574,7 +574,7 @@ QDebug operator<<(QDebug dbg, const QJsonDocument &o)
QJsonPrivate::Writer::objectToJson(static_cast<QJsonPrivate::Object *>(o.d->header->root()), json, 0, true);
dbg.nospace() << "QJsonDocument("
<< json.constData() // print as utf-8 string without extra quotation marks
- << ")";
+ << ')';
return dbg;
}
#endif
diff --git a/src/corelib/json/qjsondocument.h b/src/corelib/json/qjsondocument.h
index 285b42c6c8..d7a88b2f15 100644
--- a/src/corelib/json/qjsondocument.h
+++ b/src/corelib/json/qjsondocument.h
@@ -106,7 +106,7 @@ public:
Compact
};
- static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
+ static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = Q_NULLPTR);
#ifdef Q_QDOC
QByteArray toJson(JsonFormat format = Indented) const;
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index ae44cd9ff9..c225606717 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -274,7 +274,7 @@ QStringList QJsonObject::keys() const
return QStringList();
QStringList keys;
-
+ keys.reserve(o->length);
for (uint i = 0; i < o->length; ++i) {
QJsonPrivate::Entry *e = o->entryAt(i);
keys.append(e->key());
@@ -693,6 +693,11 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
\internal
*/
+/*! \typedef QJsonObject::iterator::pointer
+
+ \internal
+*/
+
/*! \fn QJsonObject::iterator::iterator()
Constructs an uninitialized iterator.
@@ -895,6 +900,11 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
\internal
*/
+/*! \typedef QJsonObject::const_iterator::pointer
+
+ \internal
+*/
+
/*! \fn QJsonObject::const_iterator::const_iterator()
Constructs an uninitialized iterator.
diff --git a/src/corelib/json/qjsonobject.h b/src/corelib/json/qjsonobject.h
index 5f24ac3ac8..5b475f52ae 100644
--- a/src/corelib/json/qjsonobject.h
+++ b/src/corelib/json/qjsonobject.h
@@ -104,8 +104,9 @@ public:
typedef int difference_type;
typedef QJsonValue value_type;
typedef QJsonValueRef reference;
+ typedef QJsonValuePtr pointer;
- Q_DECL_CONSTEXPR inline iterator() : o(0), i(0) {}
+ Q_DECL_CONSTEXPR inline iterator() : o(Q_NULLPTR), i(0) {}
Q_DECL_CONSTEXPR inline iterator(QJsonObject *obj, int index) : o(obj), i(index) {}
inline QString key() const { return o->keyAt(i); }
@@ -146,8 +147,9 @@ public:
typedef int difference_type;
typedef QJsonValue value_type;
typedef QJsonValue reference;
+ typedef QJsonValuePtr pointer;
- Q_DECL_CONSTEXPR inline const_iterator() : o(0), i(0) {}
+ Q_DECL_CONSTEXPR inline const_iterator() : o(Q_NULLPTR), i(0) {}
Q_DECL_CONSTEXPR inline const_iterator(const QJsonObject *obj, int index)
: o(obj), i(index) {}
inline const_iterator(const iterator &other)
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index ae6a3678bd..76e5ae562f 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -173,7 +173,7 @@ QJsonValue::QJsonValue(int n)
QJsonValue::QJsonValue(qint64 n)
: d(0), t(Double)
{
- this->dbl = n;
+ this->dbl = double(n);
}
/*!
@@ -420,6 +420,18 @@ QJsonValue QJsonValue::fromVariant(const QVariant &variant)
return QJsonValue(QJsonObject::fromVariantMap(variant.toMap()));
case QVariant::Hash:
return QJsonValue(QJsonObject::fromVariantHash(variant.toHash()));
+#ifndef QT_BOOTSTRAPPED
+ case QMetaType::QJsonValue:
+ return variant.toJsonValue();
+ case QMetaType::QJsonObject:
+ return variant.toJsonObject();
+ case QMetaType::QJsonArray:
+ return variant.toJsonArray();
+ case QMetaType::QJsonDocument: {
+ QJsonDocument doc = variant.toJsonDocument();
+ return doc.isArray() ? QJsonValue(doc.array()) : QJsonValue(doc.object());
+ }
+#endif
default:
break;
}
@@ -515,7 +527,7 @@ bool QJsonValue::toBool(bool defaultValue) const
int QJsonValue::toInt(int defaultValue) const
{
if (t == Double && int(dbl) == dbl)
- return dbl;
+ return int(dbl);
return defaultValue;
}
@@ -738,23 +750,23 @@ QDebug operator<<(QDebug dbg, const QJsonValue &o)
dbg << "QJsonValue(null)";
break;
case QJsonValue::Bool:
- dbg.nospace() << "QJsonValue(bool, " << o.toBool() << ")";
+ dbg.nospace() << "QJsonValue(bool, " << o.toBool() << ')';
break;
case QJsonValue::Double:
- dbg.nospace() << "QJsonValue(double, " << o.toDouble() << ")";
+ dbg.nospace() << "QJsonValue(double, " << o.toDouble() << ')';
break;
case QJsonValue::String:
- dbg.nospace() << "QJsonValue(string, " << o.toString() << ")";
+ dbg.nospace() << "QJsonValue(string, " << o.toString() << ')';
break;
case QJsonValue::Array:
dbg.nospace() << "QJsonValue(array, ";
dbg << o.toArray();
- dbg << ")";
+ dbg << ')';
break;
case QJsonValue::Object:
dbg.nospace() << "QJsonValue(object, ";
dbg << o.toObject();
- dbg << ")";
+ dbg << ')';
break;
}
return dbg;
diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp
index 99f83554c2..45a05e93a3 100644
--- a/src/corelib/json/qjsonwriter.cpp
+++ b/src/corelib/json/qjsonwriter.cpp
@@ -137,13 +137,13 @@ static void valueToJson(const QJsonPrivate::Base *b, const QJsonPrivate::Value &
json += compact ? "[" : "[\n";
arrayContentToJson(static_cast<QJsonPrivate::Array *>(v.base(b)), json, indent + (compact ? 0 : 1), compact);
json += QByteArray(4*indent, ' ');
- json += "]";
+ json += ']';
break;
case QJsonValue::Object:
json += compact ? "{" : "{\n";
objectContentToJson(static_cast<QJsonPrivate::Object *>(v.base(b)), json, indent + (compact ? 0 : 1), compact);
json += QByteArray(4*indent, ' ');
- json += "}";
+ json += '}';
break;
case QJsonValue::Null:
default:
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 65dc44def2..bc93791c2e 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -88,6 +88,7 @@ wince {
SOURCES += \
kernel/qfunctions_wince.cpp
HEADERS += \
+ kernel/qfunctions_fake_env_p.h \
kernel/qfunctions_wince.h
}
@@ -95,26 +96,33 @@ winrt {
SOURCES += \
kernel/qfunctions_winrt.cpp
HEADERS += \
+ kernel/qfunctions_fake_env_p.h \
kernel/qfunctions_winrt.h
}
mac {
HEADERS += \
- kernel/qcore_mac_p.h
+ kernel/qcfsocketnotifier_p.h \
+ kernel/qcore_mac_p.h \
+ kernel/qeventdispatcher_cf_p.h
SOURCES += \
+ kernel/qcfsocketnotifier.cpp \
kernel/qcoreapplication_mac.cpp \
kernel/qcore_mac.cpp
OBJECTIVE_SOURCES += \
- kernel/qcore_mac_objc.mm
+ kernel/qcore_mac_objc.mm \
+ kernel/qeventdispatcher_cf.mm
LIBS_PRIVATE += -framework Foundation
- osx: LIBS_PRIVATE += -framework CoreServices
+ osx: LIBS_PRIVATE += -framework CoreServices -framework AppKit
- # We need UIKit for UIDevice
- ios: LIBS_PRIVATE += -framework UIKit
+ ios {
+ # We need UIKit for UIDevice
+ LIBS_PRIVATE += -framework UIKit
+ }
}
nacl {
diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h
index c80f7d3d08..eb357cefe5 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.h
+++ b/src/corelib/kernel/qabstracteventdispatcher.h
@@ -64,10 +64,10 @@ public:
{ }
};
- explicit QAbstractEventDispatcher(QObject *parent = 0);
+ explicit QAbstractEventDispatcher(QObject *parent = Q_NULLPTR);
~QAbstractEventDispatcher();
- static QAbstractEventDispatcher *instance(QThread *thread = 0);
+ static QAbstractEventDispatcher *instance(QThread *thread = Q_NULLPTR);
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0;
virtual bool hasPendingEvents() = 0; // ### Qt6: remove, mark final or make protected
diff --git a/src/corelib/kernel/qcfsocketnotifier.cpp b/src/corelib/kernel/qcfsocketnotifier.cpp
new file mode 100644
index 0000000000..7f4c26d978
--- /dev/null
+++ b/src/corelib/kernel/qcfsocketnotifier.cpp
@@ -0,0 +1,307 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 "qcfsocketnotifier_p.h"
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qsocketnotifier.h>
+#include <QtCore/qthread.h>
+
+QT_BEGIN_NAMESPACE
+
+/**************************************************************************
+ Socket Notifiers
+ *************************************************************************/
+void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef,
+ const void *, void *info)
+{
+
+ QCFSocketNotifier *cfSocketNotifier = static_cast<QCFSocketNotifier *>(info);
+ int nativeSocket = CFSocketGetNative(s);
+ MacSocketInfo *socketInfo = cfSocketNotifier->macSockets.value(nativeSocket);
+ QEvent notifierEvent(QEvent::SockAct);
+
+ // There is a race condition that happen where we disable the notifier and
+ // the kernel still has a notification to pass on. We then get this
+ // notification after we've successfully disabled the CFSocket, but our Qt
+ // notifier is now gone. The upshot is we have to check the notifier
+ // every time.
+ if (callbackType == kCFSocketReadCallBack) {
+ if (socketInfo->readNotifier && socketInfo->readEnabled) {
+ socketInfo->readEnabled = false;
+ QCoreApplication::sendEvent(socketInfo->readNotifier, &notifierEvent);
+ }
+ } else if (callbackType == kCFSocketWriteCallBack) {
+ if (socketInfo->writeNotifier && socketInfo->writeEnabled) {
+ socketInfo->writeEnabled = false;
+ QCoreApplication::sendEvent(socketInfo->writeNotifier, &notifierEvent);
+ }
+ }
+
+ if (cfSocketNotifier->maybeCancelWaitForMoreEvents)
+ cfSocketNotifier->maybeCancelWaitForMoreEvents(cfSocketNotifier->eventDispatcher);
+}
+
+/*
+ Adds a loop source for the given socket to the current run loop.
+*/
+CFRunLoopSourceRef qt_mac_add_socket_to_runloop(const CFSocketRef socket)
+{
+ CFRunLoopSourceRef loopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
+ if (!loopSource)
+ return 0;
+
+ CFRunLoopAddSource(CFRunLoopGetMain(), loopSource, kCFRunLoopCommonModes);
+ return loopSource;
+}
+
+/*
+ Removes the loop source for the given socket from the current run loop.
+*/
+void qt_mac_remove_socket_from_runloop(const CFSocketRef socket, CFRunLoopSourceRef runloop)
+{
+ Q_ASSERT(runloop);
+ CFRunLoopRemoveSource(CFRunLoopGetMain(), runloop, kCFRunLoopCommonModes);
+ CFSocketDisableCallBacks(socket, kCFSocketReadCallBack);
+ CFSocketDisableCallBacks(socket, kCFSocketWriteCallBack);
+}
+
+QCFSocketNotifier::QCFSocketNotifier()
+ : eventDispatcher(0)
+ , maybeCancelWaitForMoreEvents(0)
+ , enableNotifiersObserver(0)
+{
+
+}
+
+QCFSocketNotifier::~QCFSocketNotifier()
+{
+
+}
+
+void QCFSocketNotifier::setHostEventDispatcher(QAbstractEventDispatcher *hostEventDispacher)
+{
+ eventDispatcher = hostEventDispacher;
+}
+
+void QCFSocketNotifier::setMaybeCancelWaitForMoreEventsCallback(MaybeCancelWaitForMoreEventsFn callBack)
+{
+ maybeCancelWaitForMoreEvents = callBack;
+}
+
+void QCFSocketNotifier::registerSocketNotifier(QSocketNotifier *notifier)
+{
+ Q_ASSERT(notifier);
+ int nativeSocket = notifier->socket();
+ int type = notifier->type();
+#ifndef QT_NO_DEBUG
+ if (nativeSocket < 0 || nativeSocket > FD_SETSIZE) {
+ qWarning("QSocketNotifier: Internal error");
+ return;
+ } else if (notifier->thread() != eventDispatcher->thread()
+ || eventDispatcher->thread() != QThread::currentThread()) {
+ qWarning("QSocketNotifier: socket notifiers cannot be enabled from another thread");
+ return;
+ }
+#endif
+
+ if (type == QSocketNotifier::Exception) {
+ qWarning("QSocketNotifier::Exception is not supported on iOS");
+ return;
+ }
+
+ // Check if we have a CFSocket for the native socket, create one if not.
+ MacSocketInfo *socketInfo = macSockets.value(nativeSocket);
+ if (!socketInfo) {
+ socketInfo = new MacSocketInfo();
+
+ // Create CFSocket, specify that we want both read and write callbacks (the callbacks
+ // are enabled/disabled later on).
+ const int callbackTypes = kCFSocketReadCallBack | kCFSocketWriteCallBack;
+ CFSocketContext context = {0, this, 0, 0, 0};
+ socketInfo->socket = CFSocketCreateWithNative(kCFAllocatorDefault, nativeSocket, callbackTypes, qt_mac_socket_callback, &context);
+ if (CFSocketIsValid(socketInfo->socket) == false) {
+ qWarning("QEventDispatcherMac::registerSocketNotifier: Failed to create CFSocket");
+ return;
+ }
+
+ CFOptionFlags flags = CFSocketGetSocketFlags(socketInfo->socket);
+ // QSocketNotifier doesn't close the socket upon destruction/invalidation
+ flags &= ~kCFSocketCloseOnInvalidate;
+ // Expicitly disable automatic re-enable, as we do that manually on each runloop pass
+ flags &= ~(kCFSocketAutomaticallyReenableWriteCallBack | kCFSocketAutomaticallyReenableReadCallBack);
+ CFSocketSetSocketFlags(socketInfo->socket, flags);
+
+ macSockets.insert(nativeSocket, socketInfo);
+ }
+
+ if (type == QSocketNotifier::Read) {
+ Q_ASSERT(socketInfo->readNotifier == 0);
+ socketInfo->readNotifier = notifier;
+ socketInfo->readEnabled = false;
+ } else if (type == QSocketNotifier::Write) {
+ Q_ASSERT(socketInfo->writeNotifier == 0);
+ socketInfo->writeNotifier = notifier;
+ socketInfo->writeEnabled = false;
+ }
+
+ if (!enableNotifiersObserver) {
+ // Create a run loop observer which enables the socket notifiers on each
+ // pass of the run loop, before any sources are processed.
+ CFRunLoopObserverContext context = {};
+ context.info = this;
+ enableNotifiersObserver = CFRunLoopObserverCreate(kCFAllocatorDefault, kCFRunLoopBeforeSources,
+ true, 0, enableSocketNotifiers, &context);
+ Q_ASSERT(enableNotifiersObserver);
+ CFRunLoopAddObserver(CFRunLoopGetMain(), enableNotifiersObserver, kCFRunLoopCommonModes);
+ }
+}
+
+void QCFSocketNotifier::unregisterSocketNotifier(QSocketNotifier *notifier)
+{
+ Q_ASSERT(notifier);
+ int nativeSocket = notifier->socket();
+ int type = notifier->type();
+#ifndef QT_NO_DEBUG
+ if (nativeSocket < 0 || nativeSocket > FD_SETSIZE) {
+ qWarning("QSocketNotifier: Internal error");
+ return;
+ } else if (notifier->thread() != eventDispatcher->thread() || eventDispatcher->thread() != QThread::currentThread()) {
+ qWarning("QSocketNotifier: socket notifiers cannot be disabled from another thread");
+ return;
+ }
+#endif
+
+ if (type == QSocketNotifier::Exception) {
+ qWarning("QSocketNotifier::Exception is not supported on iOS");
+ return;
+ }
+ MacSocketInfo *socketInfo = macSockets.value(nativeSocket);
+ if (!socketInfo) {
+ qWarning("QEventDispatcherMac::unregisterSocketNotifier: Tried to unregister a not registered notifier");
+ return;
+ }
+
+ // Decrement read/write counters and disable callbacks if necessary.
+ if (type == QSocketNotifier::Read) {
+ Q_ASSERT(notifier == socketInfo->readNotifier);
+ socketInfo->readNotifier = 0;
+ socketInfo->readEnabled = false;
+ CFSocketDisableCallBacks(socketInfo->socket, kCFSocketReadCallBack);
+ } else if (type == QSocketNotifier::Write) {
+ Q_ASSERT(notifier == socketInfo->writeNotifier);
+ socketInfo->writeNotifier = 0;
+ socketInfo->writeEnabled = false;
+ CFSocketDisableCallBacks(socketInfo->socket, kCFSocketWriteCallBack);
+ }
+
+ // Remove CFSocket from runloop if this was the last QSocketNotifier.
+ if (socketInfo->readNotifier == 0 && socketInfo->writeNotifier == 0) {
+ unregisterSocketInfo(socketInfo);
+ delete socketInfo;
+ macSockets.remove(nativeSocket);
+ }
+}
+
+void QCFSocketNotifier::removeSocketNotifiers()
+{
+ // Remove CFSockets from the runloop.
+ foreach (MacSocketInfo *socketInfo, macSockets) {
+ unregisterSocketInfo(socketInfo);
+ delete socketInfo;
+ }
+
+ macSockets.clear();
+
+ destroyRunLoopObserver();
+}
+
+void QCFSocketNotifier::destroyRunLoopObserver()
+{
+ if (!enableNotifiersObserver)
+ return;
+
+ CFRunLoopObserverInvalidate(enableNotifiersObserver);
+ CFRelease(enableNotifiersObserver);
+ enableNotifiersObserver = 0;
+}
+
+void QCFSocketNotifier::unregisterSocketInfo(MacSocketInfo *socketInfo)
+{
+ if (socketInfo->runloop) {
+ if (CFSocketIsValid(socketInfo->socket))
+ qt_mac_remove_socket_from_runloop(socketInfo->socket, socketInfo->runloop);
+ CFRunLoopSourceInvalidate(socketInfo->runloop);
+ CFRelease(socketInfo->runloop);
+ }
+ CFSocketInvalidate(socketInfo->socket);
+ CFRelease(socketInfo->socket);
+}
+
+void QCFSocketNotifier::enableSocketNotifiers(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info)
+{
+ Q_UNUSED(ref);
+ Q_UNUSED(activity);
+
+ QCFSocketNotifier *that = static_cast<QCFSocketNotifier *>(info);
+
+ foreach (MacSocketInfo *socketInfo, that->macSockets) {
+ if (!CFSocketIsValid(socketInfo->socket))
+ continue;
+
+ if (!socketInfo->runloop) {
+ // Add CFSocket to runloop.
+ if (!(socketInfo->runloop = qt_mac_add_socket_to_runloop(socketInfo->socket))) {
+ qWarning("QEventDispatcherMac::registerSocketNotifier: Failed to add CFSocket to runloop");
+ CFSocketInvalidate(socketInfo->socket);
+ continue;
+ }
+
+ if (!socketInfo->readNotifier)
+ CFSocketDisableCallBacks(socketInfo->socket, kCFSocketReadCallBack);
+ if (!socketInfo->writeNotifier)
+ CFSocketDisableCallBacks(socketInfo->socket, kCFSocketWriteCallBack);
+ }
+
+ if (socketInfo->readNotifier && !socketInfo->readEnabled) {
+ socketInfo->readEnabled = true;
+ CFSocketEnableCallBacks(socketInfo->socket, kCFSocketReadCallBack);
+ }
+ if (socketInfo->writeNotifier && !socketInfo->writeEnabled) {
+ socketInfo->writeEnabled = true;
+ CFSocketEnableCallBacks(socketInfo->socket, kCFSocketWriteCallBack);
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/corelib/kernel/qcfsocketnotifier_p.h b/src/corelib/kernel/qcfsocketnotifier_p.h
new file mode 100644
index 0000000000..947efecca3
--- /dev/null
+++ b/src/corelib/kernel/qcfsocketnotifier_p.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 QCFSOCKETNOTIFIER_P_H
+#define QCFSOCKETNOTIFIER_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/qabstracteventdispatcher.h>
+#include <QtCore/qhash.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+QT_BEGIN_NAMESPACE
+
+struct MacSocketInfo {
+ MacSocketInfo() : socket(0), runloop(0), readNotifier(0), writeNotifier(0),
+ readEnabled(false), writeEnabled(false) {}
+ CFSocketRef socket;
+ CFRunLoopSourceRef runloop;
+ QObject *readNotifier;
+ QObject *writeNotifier;
+ bool readEnabled;
+ bool writeEnabled;
+};
+typedef QHash<int, MacSocketInfo *> MacSocketHash;
+
+typedef void (*MaybeCancelWaitForMoreEventsFn)(QAbstractEventDispatcher *hostEventDispacher);
+
+// The CoreFoundationSocketNotifier class implements socket notifiers support using
+// CFSocket for event dispatchers running on top of the Core Foundation run loop system.
+// (currently Mac and iOS)
+//
+// The principal functions are registerSocketNotifier() and unregisterSocketNotifier().
+//
+// setHostEventDispatcher() should be called at startup.
+// removeSocketNotifiers() should be called at shutdown.
+//
+class Q_CORE_EXPORT QCFSocketNotifier
+{
+public:
+ QCFSocketNotifier();
+ ~QCFSocketNotifier();
+ void setHostEventDispatcher(QAbstractEventDispatcher *hostEventDispacher);
+ void setMaybeCancelWaitForMoreEventsCallback(MaybeCancelWaitForMoreEventsFn callBack);
+ void registerSocketNotifier(QSocketNotifier *notifier);
+ void unregisterSocketNotifier(QSocketNotifier *notifier);
+ void removeSocketNotifiers();
+
+private:
+ void destroyRunLoopObserver();
+
+ static void unregisterSocketInfo(MacSocketInfo *socketInfo);
+ static void enableSocketNotifiers(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info);
+
+ MacSocketHash macSockets;
+ QAbstractEventDispatcher *eventDispatcher;
+ MaybeCancelWaitForMoreEventsFn maybeCancelWaitForMoreEvents;
+ CFRunLoopObserverRef enableNotifiersObserver;
+
+ friend void qt_mac_socket_callback(CFSocketRef, CFSocketCallBackType, CFDataRef, const void *, void *);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index a215557aed..14c0f803b9 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -131,5 +131,22 @@ QAppleOperatingSystemVersion qt_apple_os_version()
return v;
}
+// -------------------------------------------------------------------------
+
+QMacAutoReleasePool::QMacAutoReleasePool()
+ : pool([[NSAutoreleasePool alloc] init])
+{
+}
+
+QMacAutoReleasePool::~QMacAutoReleasePool()
+{
+ // Drain behaves the same as release, with the advantage that
+ // if we're ever used in a garbage-collected environment, the
+ // drain acts as a hint to the garbage collector to collect.
+ [pool drain];
+}
+
+// -------------------------------------------------------------------------
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 4834c14ca8..16156d0f2c 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -57,10 +57,6 @@
#include "qglobal.h"
-#ifdef Q_OS_MACX
-#include <CoreServices/CoreServices.h>
-#endif
-
#ifdef __OBJC__
#include <Foundation/Foundation.h>
#endif
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index fa083a3f44..f80dcb5a50 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -47,6 +47,7 @@
#include "qplatformdefs.h"
#include "qatomic.h"
+#include "qhash.h"
#ifndef Q_OS_UNIX
# error "qcore_unix_p.h included on a non-Unix system"
@@ -67,24 +68,6 @@
struct sockaddr;
-#if defined(Q_OS_LINUX) && defined(O_CLOEXEC)
-# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 1
-QT_BEGIN_NAMESPACE
-namespace QtLibcSupplement {
- inline int accept4(int, sockaddr *, QT_SOCKLEN_T *, int)
- { errno = ENOSYS; return -1; }
- inline int dup3(int, int, int)
- { errno = ENOSYS; return -1; }
- inline int pipe2(int [], int )
- { errno = ENOSYS; return -1; }
-}
-QT_END_NAMESPACE
-using namespace QT_PREPEND_NAMESPACE(QtLibcSupplement);
-
-#else
-# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 0
-#endif
-
#define EINTR_LOOP(var, cmd) \
do { \
var = cmd; \
@@ -179,22 +162,14 @@ static inline int qt_safe_open(const char *pathname, int flags, mode_t mode = 07
// call qt_safe_pipe
static inline int qt_safe_pipe(int pipefd[2], int flags = 0)
{
-#ifdef O_CLOEXEC
- Q_ASSERT((flags & ~(O_CLOEXEC | O_NONBLOCK)) == 0);
-#else
Q_ASSERT((flags & ~O_NONBLOCK) == 0);
-#endif
- int ret;
-#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC)
+#ifdef QT_THREADSAFE_CLOEXEC
// use pipe2
flags |= O_CLOEXEC;
- ret = ::pipe2(pipefd, flags); // pipe2 is Linux-specific and is documented not to return EINTR
- if (ret == 0 || errno != ENOSYS)
- return ret;
-#endif
-
- ret = ::pipe(pipefd);
+ return ::pipe2(pipefd, flags); // pipe2 is documented not to return EINTR
+#else
+ int ret = ::pipe(pipefd);
if (ret == -1)
return -1;
@@ -208,6 +183,7 @@ static inline int qt_safe_pipe(int pipefd[2], int flags = 0)
}
return 0;
+#endif
}
#endif // Q_OS_VXWORKS
@@ -217,22 +193,19 @@ static inline int qt_safe_dup(int oldfd, int atleast = 0, int flags = FD_CLOEXEC
{
Q_ASSERT(flags == FD_CLOEXEC || flags == 0);
- int ret;
#ifdef F_DUPFD_CLOEXEC
- // use this fcntl
- if (flags & FD_CLOEXEC) {
- ret = ::fcntl(oldfd, F_DUPFD_CLOEXEC, atleast);
- if (ret != -1 || errno != EINVAL)
- return ret;
- }
-#endif
-
+ int cmd = F_DUPFD;
+ if (flags & FD_CLOEXEC)
+ cmd = F_DUPFD_CLOEXEC;
+ return ::fcntl(oldfd, cmd, atleast);
+#else
// use F_DUPFD
- ret = ::fcntl(oldfd, F_DUPFD, atleast);
+ int ret = ::fcntl(oldfd, F_DUPFD, atleast);
if (flags && ret != -1)
::fcntl(ret, F_SETFD, flags);
return ret;
+#endif
}
// don't call dup2
@@ -242,14 +215,11 @@ static inline int qt_safe_dup2(int oldfd, int newfd, int flags = FD_CLOEXEC)
Q_ASSERT(flags == FD_CLOEXEC || flags == 0);
int ret;
-#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC)
+#ifdef QT_THREADSAFE_CLOEXEC
// use dup3
- if (flags & FD_CLOEXEC) {
- EINTR_LOOP(ret, ::dup3(oldfd, newfd, O_CLOEXEC));
- if (ret == 0 || errno != ENOSYS)
- return ret;
- }
-#endif
+ EINTR_LOOP(ret, ::dup3(oldfd, newfd, flags ? O_CLOEXEC : 0));
+ return ret;
+#else
EINTR_LOOP(ret, ::dup2(oldfd, newfd));
if (ret == -1)
return -1;
@@ -257,6 +227,7 @@ static inline int qt_safe_dup2(int oldfd, int newfd, int flags = FD_CLOEXEC)
if (flags)
::fcntl(newfd, F_SETFD, flags);
return 0;
+#endif
}
static inline qint64 qt_safe_read(int fd, void *data, qint64 maxlen)
@@ -352,6 +323,19 @@ union qt_semun {
unsigned short *array; /* array for GETALL, SETALL */
};
+#ifndef QT_POSIX_IPC
+#ifndef QT_NO_SHAREDMEMORY
+#ifndef Q_OS_ANDROID
+static inline key_t qt_safe_ftok(const QByteArray &filename, int proj_id)
+{
+ // Unfortunately ftok can return colliding keys even for different files.
+ // Try to add some more entropy via qHash.
+ return ::ftok(filename.constData(), qHash(filename, proj_id));
+}
+#endif // !Q_OS_ANDROID
+#endif // !QT_NO_SHAREDMEMORY
+#endif // !QT_POSIX_IPC
+
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 24427bd1af..abc5af94cb 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -45,7 +46,6 @@
#include <qdir.h>
#include <qfile.h>
#include <qfileinfo.h>
-#include <qhash.h>
#include <qmutex.h>
#include <private/qloggingregistry_p.h>
#include <qstandardpaths.h>
@@ -70,6 +70,9 @@
# include "qeventdispatcher_blackberry_p.h"
# include <process.h>
# include <unistd.h>
+# elif defined(Q_OS_OSX)
+# include "qeventdispatcher_cf_p.h"
+# include "qeventdispatcher_unix_p.h"
# else
# if !defined(QT_NO_GLIB)
# include "qeventdispatcher_glib_p.h"
@@ -323,15 +326,9 @@ uint QCoreApplicationPrivate::attribs = (1 << Qt::AA_SynthesizeMouseForUnhandled
struct QCoreApplicationData {
QCoreApplicationData() Q_DECL_NOTHROW {
-#ifndef QT_NO_LIBRARY
- app_libpaths = 0;
-#endif
applicationNameSet = false;
}
~QCoreApplicationData() {
-#ifndef QT_NO_LIBRARY
- delete app_libpaths;
-#endif
#ifndef QT_NO_QOBJECT
// cleanup the QAdoptedThread created for the main() thread
if (QCoreApplicationPrivate::theMainThread) {
@@ -353,7 +350,7 @@ struct QCoreApplicationData {
QFile metafile(QStringLiteral("app/META-INF/MANIFEST.MF"));
if (!metafile.open(QIODevice::ReadOnly)) {
- qWarning() << Q_FUNC_INFO << "Could not open application metafile for reading";
+ qWarning("Could not open application metafile for reading")
} else {
while (!metafile.atEnd() && (application.isEmpty() || applicationVersion.isEmpty() || orgName.isEmpty())) {
QByteArray line = metafile.readLine();
@@ -375,7 +372,8 @@ struct QCoreApplicationData {
bool applicationNameSet; // true if setApplicationName was called
#ifndef QT_NO_LIBRARY
- QStringList *app_libpaths;
+ QScopedPointer<QStringList> app_libpaths;
+ QScopedPointer<QStringList> manual_libpaths;
#endif
};
@@ -510,12 +508,19 @@ void QCoreApplicationPrivate::createEventDispatcher()
#if defined(Q_OS_UNIX)
# if defined(Q_OS_BLACKBERRY)
eventDispatcher = new QEventDispatcherBlackberry(q);
-# else
-# if !defined(QT_NO_GLIB)
+# elif defined(Q_OS_OSX)
+ bool ok = false;
+ int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
+ if (ok && value > 0)
+ eventDispatcher = new QEventDispatcherCoreFoundation(q);
+ else
+ eventDispatcher = new QEventDispatcherUNIX(q);
+# elif !defined(QT_NO_GLIB)
if (qEnvironmentVariableIsEmpty("QT_NO_GLIB") && QEventDispatcherGlib::versionSupported())
eventDispatcher = new QEventDispatcherGlib(q);
else
-# endif
+ eventDispatcher = new QEventDispatcherUNIX(q);
+# else
eventDispatcher = new QEventDispatcherUNIX(q);
# endif
#elif defined(Q_OS_WINRT)
@@ -538,6 +543,14 @@ QThread *QCoreApplicationPrivate::mainThread()
return theMainThread.load();
}
+bool QCoreApplicationPrivate::threadRequiresCoreApplication()
+{
+ QThreadData *data = QThreadData::current(false);
+ if (!data)
+ return true; // default setting
+ return data->requiresCoreApplication;
+}
+
void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
{
QThread *currentThread = QThread::currentThread();
@@ -560,9 +573,9 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
{
#ifndef QT_NO_LIBRARY
- QStringList *app_libpaths = coreappdata()->app_libpaths;
+ QStringList *app_libpaths = coreappdata()->app_libpaths.data();
if (!app_libpaths)
- coreappdata()->app_libpaths = app_libpaths = new QStringList;
+ coreappdata()->app_libpaths.reset(app_libpaths = new QStringList);
QString app_location = QCoreApplication::applicationFilePath();
app_location.truncate(app_location.lastIndexOf(QLatin1Char('/')));
#ifdef Q_OS_WINRT
@@ -612,7 +625,7 @@ void QCoreApplicationPrivate::initLocale()
\section1 The Event Loop and Event Handling
- The event loop is started with a call to exec(). Long running
+ The event loop is started with a call to exec(). Long-running
operations can call processEvents() to keep the application
responsive.
@@ -648,8 +661,9 @@ void QCoreApplicationPrivate::initLocale()
The command line arguments which are passed to QCoreApplication's
constructor should be accessed using the arguments() function.
- Note that some arguments supplied by the user may have been
- processed and removed by QCoreApplication.
+
+ \note QCoreApplication removes option \c -qmljsdebugger="...". It parses the
+ argument of \c qmljsdebugger, and then removes this option plus its argument.
For more advanced command line option handling, create a QCommandLineParser.
@@ -693,7 +707,7 @@ QCoreApplication::QCoreApplication(QCoreApplicationPrivate &p)
#ifndef QT_NO_QOBJECT
/*!
- Flushes the platform specific event queues.
+ Flushes the platform-specific event queues.
If you are doing graphical changes inside a loop that does not
return to the event loop on asynchronous window systems like X11
@@ -711,9 +725,9 @@ void QCoreApplication::flush()
#endif
/*!
- Constructs a Qt kernel application. Kernel applications are
- applications without a graphical user interface. These type of
- applications are used at the console or as server processes.
+ Constructs a Qt core application. Core applications are applications without
+ a graphical user interface. Such applications are used at the console or as
+ server processes.
The \a argc and \a argv arguments are processed by the application,
and made available in a more convenient form by the arguments()
@@ -759,6 +773,36 @@ void QCoreApplication::init()
QLoggingRegistry::instance()->init();
+#ifndef QT_NO_LIBRARY
+ // Reset the lib paths, so that they will be recomputed, taking the availability of argv[0]
+ // into account. If necessary, recompute right away and replay the manual changes on top of the
+ // new lib paths.
+ QStringList *appPaths = coreappdata()->app_libpaths.take();
+ QStringList *manualPaths = coreappdata()->manual_libpaths.take();
+ if (appPaths) {
+ if (manualPaths) {
+ // Replay the delta. As paths can only be prepended to the front or removed from
+ // anywhere in the list, we can just linearly scan the lists and find the items that
+ // have been removed. Once the original list is exhausted we know all the remaining
+ // items have been added.
+ QStringList newPaths(libraryPaths());
+ for (int i = manualPaths->length(), j = appPaths->length(); i > 0 || j > 0; qt_noop()) {
+ if (--j < 0) {
+ newPaths.prepend((*manualPaths)[--i]);
+ } else if (--i < 0) {
+ newPaths.removeAll((*appPaths)[j]);
+ } else if ((*manualPaths)[i] != (*appPaths)[j]) {
+ newPaths.removeAll((*appPaths)[j]);
+ ++i; // try again with next item.
+ }
+ }
+ delete manualPaths;
+ coreappdata()->manual_libpaths.reset(new QStringList(newPaths));
+ }
+ delete appPaths;
+ }
+#endif
+
#ifndef QT_NO_QOBJECT
// use the event dispatcher created by the app programmer (if any)
if (!QCoreApplicationPrivate::eventDispatcher)
@@ -777,11 +821,6 @@ void QCoreApplication::init()
d->eventDispatcherReady();
#endif
-#ifndef QT_NO_LIBRARY
- if (coreappdata()->app_libpaths)
- d->appendApplicationPathToLibraryPaths();
-#endif
-
#ifdef QT_EVAL
extern void qt_core_eval_init(QCoreApplicationPrivate::Type);
qt_core_eval_init(d->application_type);
@@ -834,8 +873,8 @@ QCoreApplication::~QCoreApplication()
#endif
#ifndef QT_NO_LIBRARY
- delete coreappdata()->app_libpaths;
- coreappdata()->app_libpaths = 0;
+ coreappdata()->app_libpaths.reset();
+ coreappdata()->manual_libpaths.reset();
#endif
}
@@ -909,31 +948,21 @@ bool QCoreApplication::testAttribute(Qt::ApplicationAttribute attribute)
/*!
\property QCoreApplication::quitLockEnabled
- Returns \c true if the use of the QEventLoopLocker feature can cause the
- application to quit, otherwise returns \c false.
+ \brief Whether the use of the QEventLoopLocker feature can cause the
+ application to quit.
+
+ The default is \c true.
\sa QEventLoopLocker
*/
-/*!
- Returns \c true if the use of the QEventLoopLocker feature can cause the
- application to quit, otherwise returns \c false.
-
- \sa QEventLoopLocker
- */
bool QCoreApplication::isQuitLockEnabled()
{
return quitLockRefEnabled;
}
-/*!
- Enables the ability of the QEventLoopLocker feature to quit
- the application.
+static bool doNotify(QObject *, QEvent *);
- If disabled, the use of QEventLoopLocker will not quit the application.
-
- \sa QEventLoopLocker
- */
void QCoreApplication::setQuitLockEnabled(bool enabled)
{
quitLockRefEnabled = enabled;
@@ -941,12 +970,29 @@ void QCoreApplication::setQuitLockEnabled(bool enabled)
/*!
\internal
+ \deprecated
This function is here to make it possible for Qt extensions to
hook into event notification without subclassing QApplication
*/
bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
{
+ return notifyInternal2(receiver, event);
+}
+
+/*!
+ \internal
+ \since 5.6
+
+ This function is here to make it possible for Qt extensions to
+ hook into event notification without subclassing QApplication.
+*/
+bool QCoreApplication::notifyInternal2(QObject *receiver, QEvent *event)
+{
+ bool selfRequired = QCoreApplicationPrivate::threadRequiresCoreApplication();
+ if (!self && selfRequired)
+ return false;
+
// Make it possible for Qt Script to hook into events even
// though QApplication is subclassed...
bool result = false;
@@ -962,10 +1008,11 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
QObjectPrivate *d = receiver->d_func();
QThreadData *threadData = d->threadData;
QScopedLoopLevelCounter loopLevelCounter(threadData);
- return notify(receiver, event);
+ if (!selfRequired)
+ return doNotify(receiver, event);
+ return self->notify(receiver, event);
}
-
/*!
Sends \a event to \a receiver: \a {receiver}->event(\a event).
Returns the value that is returned from the receiver's event
@@ -1021,26 +1068,32 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
bool QCoreApplication::notify(QObject *receiver, QEvent *event)
{
- Q_D(QCoreApplication);
// no events are delivered after ~QCoreApplication() has started
if (QCoreApplicationPrivate::is_app_closing)
return true;
+ return doNotify(receiver, event);
+}
+static bool doNotify(QObject *receiver, QEvent *event)
+{
if (receiver == 0) { // serious error
qWarning("QCoreApplication::notify: Unexpected null receiver");
return true;
}
#ifndef QT_NO_DEBUG
- d->checkReceiverThread(receiver);
+ QCoreApplicationPrivate::checkReceiverThread(receiver);
#endif
- return receiver->isWidgetType() ? false : d->notify_helper(receiver, event);
+ return receiver->isWidgetType() ? false : QCoreApplicationPrivate::notify_helper(receiver, event);
}
bool QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject *receiver, QEvent *event)
{
- if (receiver->d_func()->threadData == this->threadData && extraData) {
+ // We can't access the application event filters outside of the main thread (race conditions)
+ Q_ASSERT(receiver->d_func()->threadData->thread == mainThread());
+
+ if (extraData) {
// application event filters are only called for objects in the GUI thread
for (int i = 0; i < extraData->eventFilters.size(); ++i) {
QObject *obj = extraData->eventFilters.at(i);
@@ -1059,8 +1112,7 @@ bool QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject *receiv
bool QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *receiver, QEvent *event)
{
- Q_Q(QCoreApplication);
- if (receiver != q && receiver->d_func()->extraData) {
+ if (receiver != QCoreApplication::instance() && receiver->d_func()->extraData) {
for (int i = 0; i < receiver->d_func()->extraData->eventFilters.size(); ++i) {
QObject *obj = receiver->d_func()->extraData->eventFilters.at(i);
if (!obj)
@@ -1079,12 +1131,14 @@ bool QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *receiver, Q
/*!
\internal
- Helper function called by notify()
+ Helper function called by QCoreApplicationPrivate::notify() and qapplication.cpp
*/
bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event)
{
- // send to all application event filters
- if (sendThroughApplicationEventFilters(receiver, event))
+ // send to all application event filters (only does anything in the main thread)
+ if (QCoreApplication::self
+ && receiver->d_func()->threadData->thread == mainThread()
+ && QCoreApplication::self->d_func()->sendThroughApplicationEventFilters(receiver, event))
return true;
// send to all receiver event filters
if (sendThroughObjectEventFilters(receiver, event))
@@ -1155,7 +1209,7 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags)
milliseconds or until there are no more events to process,
whichever is shorter.
- You can call this function occasionally when you program is busy
+ You can call this function occasionally when your program is busy
doing a long operation (e.g. copying a file).
Calling this function processes events only for the calling thread.
@@ -1182,9 +1236,9 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags, int m
*****************************************************************************/
/*!
- Enters the main event loop and waits until exit() is called.
- Returns the value that was set to exit() (which is 0 if exit() is
- called via quit()).
+ Enters the main event loop and waits until exit() is called. Returns
+ the value that was passed to exit() (which is 0 if exit() is called via
+ quit()).
It is necessary to call this function to start event handling. The
main event loop receives events from the window system and
@@ -1440,7 +1494,8 @@ bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEven
If \a receiver is null, the events of \a event_type are sent for all
objects. If \a event_type is 0, all the events are sent for \a receiver.
- \note This method must be called from the same thread as its QObject parameter, \a receiver.
+ \note This method must be called from the thread in which its QObject
+ parameter, \a receiver, lives.
\sa flush(), postEvent()
*/
@@ -1764,7 +1819,7 @@ void QCoreApplicationPrivate::maybeQuit()
Tells the application to exit with return code 0 (success).
Equivalent to calling QCoreApplication::exit(0).
- It's common to connect the QApplication::lastWindowClosed() signal
+ It's common to connect the QGuiApplication::lastWindowClosed() signal
to quit(), and you also often connect e.g. QAbstractButton::clicked() or
signals in QAction, QMenu, or QMenuBar to it.
@@ -1772,7 +1827,7 @@ void QCoreApplicationPrivate::maybeQuit()
\snippet code/src_corelib_kernel_qcoreapplication.cpp 1
- \sa exit(), aboutToQuit(), QApplication::lastWindowClosed()
+ \sa exit(), aboutToQuit(), QGuiApplication::lastWindowClosed()
*/
void QCoreApplication::quit()
@@ -1786,7 +1841,7 @@ void QCoreApplication::quit()
This signal is emitted when the application is about to quit the
main event loop, e.g. when the event loop level drops to zero.
This may happen either after a call to quit() from inside the
- application or when the users shuts down the entire desktop session.
+ application or when the user shuts down the entire desktop session.
The signal is particularly useful if your application has to do some
last-second cleanup. Note that no user interaction is possible in
@@ -2016,8 +2071,8 @@ void QCoreApplicationPrivate::setApplicationFilePath(const QString &path)
directory, and you run the \c{regexp} example, this function will
return "C:/Qt/examples/tools/regexp".
- On OS X and iOS this will point to the directory actually containing the
- executable, which may be inside of an application bundle (if the
+ On OS X and iOS this will point to the directory actually containing
+ the executable, which may be inside an application bundle (if the
application is bundled).
\warning On Linux, this function will try to get the path from the
@@ -2468,28 +2523,17 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
QStringList QCoreApplication::libraryPaths()
{
QMutexLocker locker(libraryPathMutex());
- if (!coreappdata()->app_libpaths) {
- QStringList *app_libpaths = coreappdata()->app_libpaths = new QStringList;
- QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
- if (QFile::exists(installPathPlugins)) {
- // Make sure we convert from backslashes to slashes.
- installPathPlugins = QDir(installPathPlugins).canonicalPath();
- if (!app_libpaths->contains(installPathPlugins))
- app_libpaths->append(installPathPlugins);
- }
- // If QCoreApplication is not yet instantiated,
- // make sure we add the application path when we construct the QCoreApplication
- if (self) self->d_func()->appendApplicationPathToLibraryPaths();
+ if (coreappdata()->manual_libpaths)
+ return *(coreappdata()->manual_libpaths);
+
+ if (!coreappdata()->app_libpaths) {
+ QStringList *app_libpaths = new QStringList;
+ coreappdata()->app_libpaths.reset(app_libpaths);
const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
if (!libPathEnv.isEmpty()) {
-#if defined(Q_OS_WIN)
- QLatin1Char pathSep(';');
-#else
- QLatin1Char pathSep(':');
-#endif
- QStringList paths = QFile::decodeName(libPathEnv).split(pathSep, QString::SkipEmptyParts);
+ QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts);
for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
QString canonicalPath = QDir(*it).canonicalPath();
if (!canonicalPath.isEmpty()
@@ -2498,6 +2542,18 @@ QStringList QCoreApplication::libraryPaths()
}
}
}
+
+ QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
+ if (QFile::exists(installPathPlugins)) {
+ // Make sure we convert from backslashes to slashes.
+ installPathPlugins = QDir(installPathPlugins).canonicalPath();
+ if (!app_libpaths->contains(installPathPlugins))
+ app_libpaths->append(installPathPlugins);
+ }
+
+ // If QCoreApplication is not yet instantiated,
+ // make sure we add the application path when we construct the QCoreApplication
+ if (self) self->d_func()->appendApplicationPathToLibraryPaths();
}
return *(coreappdata()->app_libpaths);
}
@@ -2510,14 +2566,26 @@ QStringList QCoreApplication::libraryPaths()
\a paths. All existing paths will be deleted and the path list
will consist of the paths given in \a paths.
+ The library paths are reset to the default when an instance of
+ QCoreApplication is destructed.
+
\sa libraryPaths(), addLibraryPath(), removeLibraryPath(), QLibrary
*/
void QCoreApplication::setLibraryPaths(const QStringList &paths)
{
QMutexLocker locker(libraryPathMutex());
+
+ // setLibraryPaths() is considered a "remove everything and then add some new ones" operation.
+ // When the application is constructed it should still amend the paths. So we keep the originals
+ // around, and even create them if they don't exist, yet.
if (!coreappdata()->app_libpaths)
- coreappdata()->app_libpaths = new QStringList;
- *(coreappdata()->app_libpaths) = paths;
+ libraryPaths();
+
+ if (coreappdata()->manual_libpaths)
+ *(coreappdata()->manual_libpaths) = paths;
+ else
+ coreappdata()->manual_libpaths.reset(new QStringList(paths));
+
locker.unlock();
QFactoryLoader::refreshAll();
}
@@ -2532,6 +2600,9 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths)
is \c INSTALL/plugins, where \c INSTALL is the directory where Qt was
installed.
+ The library paths are reset to the default when an instance of
+ QCoreApplication is destructed.
+
\sa removeLibraryPath(), libraryPaths(), setLibraryPaths()
*/
void QCoreApplication::addLibraryPath(const QString &path)
@@ -2539,24 +2610,38 @@ void QCoreApplication::addLibraryPath(const QString &path)
if (path.isEmpty())
return;
+ QString canonicalPath = QDir(path).canonicalPath();
+ if (canonicalPath.isEmpty())
+ return;
+
QMutexLocker locker(libraryPathMutex());
- // make sure that library paths is initialized
- libraryPaths();
+ QStringList *libpaths = coreappdata()->manual_libpaths.data();
+ if (libpaths) {
+ if (libpaths->contains(canonicalPath))
+ return;
+ } else {
+ // make sure that library paths are initialized
+ libraryPaths();
+ QStringList *app_libpaths = coreappdata()->app_libpaths.data();
+ if (app_libpaths->contains(canonicalPath))
+ return;
- QString canonicalPath = QDir(path).canonicalPath();
- if (!canonicalPath.isEmpty()
- && !coreappdata()->app_libpaths->contains(canonicalPath)) {
- coreappdata()->app_libpaths->prepend(canonicalPath);
- locker.unlock();
- QFactoryLoader::refreshAll();
+ coreappdata()->manual_libpaths.reset(libpaths = new QStringList(*app_libpaths));
}
+
+ libpaths->prepend(canonicalPath);
+ locker.unlock();
+ QFactoryLoader::refreshAll();
}
/*!
Removes \a path from the library path list. If \a path is empty or not
in the path list, the list is not changed.
+ The library paths are reset to the default when an instance of
+ QCoreApplication is destructed.
+
\sa addLibraryPath(), libraryPaths(), setLibraryPaths()
*/
void QCoreApplication::removeLibraryPath(const QString &path)
@@ -2564,13 +2649,28 @@ void QCoreApplication::removeLibraryPath(const QString &path)
if (path.isEmpty())
return;
+ QString canonicalPath = QDir(path).canonicalPath();
+ if (canonicalPath.isEmpty())
+ return;
+
QMutexLocker locker(libraryPathMutex());
- // make sure that library paths is initialized
- libraryPaths();
+ QStringList *libpaths = coreappdata()->manual_libpaths.data();
+ if (libpaths) {
+ if (libpaths->removeAll(canonicalPath) == 0)
+ return;
+ } else {
+ // make sure that library paths is initialized
+ libraryPaths();
+ QStringList *app_libpaths = coreappdata()->app_libpaths.data();
+ if (!app_libpaths->contains(canonicalPath))
+ return;
- QString canonicalPath = QDir(path).canonicalPath();
- coreappdata()->app_libpaths->removeAll(canonicalPath);
+ coreappdata()->manual_libpaths.reset(libpaths = new QStringList(*app_libpaths));
+ libpaths->removeAll(canonicalPath);
+ }
+
+ locker.unlock();
QFactoryLoader::refreshAll();
}
@@ -2585,11 +2685,11 @@ void QCoreApplication::removeLibraryPath(const QString &path)
The event filter \a filterObj receives events via its \l {QAbstractNativeEventFilter::}{nativeEventFilter()}
function, which is called for all native events received in the main thread.
- The QAbstractNativeEventFilter::nativeEventFilter() function should return true if the event should
- be filtered, (i.e. stopped). It should return false to allow
- normal Qt processing to continue: the native event can then be translated
- into a QEvent and handled by the standard Qt \l{QEvent} {event} filtering,
- e.g. QObject::installEventFilter().
+ The QAbstractNativeEventFilter::nativeEventFilter() function should
+ return true if the event should be filtered, i.e. stopped. It should
+ return false to allow normal Qt processing to continue: the native
+ event can then be translated into a QEvent and handled by the standard
+ Qt \l{QEvent} {event} filtering, e.g. QObject::installEventFilter().
If multiple event filters are installed, the filter that was
installed last is activated first.
@@ -2597,7 +2697,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
\note The filter function set here receives native messages,
i.e. MSG or XCB event structs.
- \note Native event filters will be disabled when the application the
+ \note Native event filters will be disabled in the application when the
Qt::AA_MacPluginApplication attribute is set.
For maximum portability, you should always try to use QEvent
@@ -2786,7 +2886,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
\snippet code/src_corelib_kernel_qcoreapplication.cpp 7
The \a context parameter is normally the class name, but it can
- be any string.
+ be any text.
\sa Q_OBJECT, QObject::tr(), QObject::trUtf8()
*/
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 1cd835daae..d865c4e7a8 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -117,7 +117,7 @@ public:
static bool sendEvent(QObject *receiver, QEvent *event);
static void postEvent(QObject *receiver, QEvent *event, int priority = Qt::NormalEventPriority);
- static void sendPostedEvents(QObject *receiver = 0, int event_type = 0);
+ static void sendPostedEvents(QObject *receiver = Q_NULLPTR, int event_type = 0);
static void removePostedEvents(QObject *receiver, int eventType = 0);
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED static bool hasPendingEvents();
@@ -149,7 +149,7 @@ public:
static QString translate(const char * context,
const char * key,
- const char * disambiguation = 0,
+ const char * disambiguation = Q_NULLPTR,
int n = -1);
#if QT_DEPRECATED_SINCE(5, 0)
enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = UnicodeUTF8, CodecForTr = UnicodeUTF8 };
@@ -194,7 +194,10 @@ protected:
private:
#ifndef QT_NO_QOBJECT
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event);
- bool notifyInternal(QObject *receiver, QEvent *event);
+# if QT_DEPRECATED_SINCE(5,6)
+ QT_DEPRECATED bool notifyInternal(QObject *receiver, QEvent *event); // ### Qt6 BIC: remove me
+# endif
+ static bool notifyInternal2(QObject *receiver, QEvent *);
#endif
void init();
@@ -221,23 +224,23 @@ private:
#ifndef QT_NO_QOBJECT
inline bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event)
-{ if (event) event->spont = false; return self ? self->notifyInternal(receiver, event) : false; }
+{ if (event) event->spont = false; return notifyInternal2(receiver, event); }
inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event)
-{ if (event) event->spont = true; return self ? self->notifyInternal(receiver, event) : false; }
+{ if (event) event->spont = true; return notifyInternal2(receiver, event); }
#endif
#ifdef QT_NO_DEPRECATED
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)
#else
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
- QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0, int n = -1) \
+ QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); }
#endif
#define Q_DECLARE_TR_FUNCTIONS(context) \
public: \
- static inline QString tr(const char *sourceText, const char *disambiguation = 0, int n = -1) \
+ static inline QString tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \
QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
private:
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index e985f8d052..9a9e8dd09a 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -86,8 +86,8 @@ public:
#ifndef QT_NO_QOBJECT
bool sendThroughApplicationEventFilters(QObject *, QEvent *);
- bool sendThroughObjectEventFilters(QObject *, QEvent *);
- bool notify_helper(QObject *, QEvent *);
+ static bool sendThroughObjectEventFilters(QObject *, QEvent *);
+ static bool notify_helper(QObject *, QEvent *);
static inline void setEventSpontaneous(QEvent *e, bool spontaneous) { e->spont = spontaneous; }
virtual void createEventDispatcher();
@@ -107,9 +107,11 @@ public:
static QBasicAtomicPointer<QThread> theMainThread;
static QThread *mainThread();
+ static bool threadRequiresCoreApplication();
+
static void sendPostedEvents(QObject *receiver, int event_type, QThreadData *data);
- void checkReceiverThread(QObject *receiver);
+ static void checkReceiverThread(QObject *receiver);
void cleanupThreadData();
#endif // QT_NO_QOBJECT
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 396d2f740a..324b664a1a 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -139,9 +139,10 @@ QString QCoreApplicationPrivate::appName() const
#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
-// ### Qt6: FIXME: Remove this function. It is only there since for binary
-// compatibility for applications built with Qt 5.3 using qtmain.lib which calls it.
-// In Qt 5.4, qtmain.lib was changed to use CommandLineToArgvW() without calling into Qt5Core.
+// ### Qt6: FIXME: Consider removing this function. It is here for Active Qt
+// servers and for binary for compatibility to applications built with Qt 5.3
+// using qtmain.lib which calls it In Qt 5.4, qtmain.lib was changed to use
+// CommandLineToArgvW() without calling into Qt5Core.
Q_CORE_EXPORT
void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
int cmdShow, int &argc, QVector<char *> &argv)
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index e9ae355d70..05c18995ff 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -150,7 +150,7 @@ QT_BEGIN_NAMESPACE
\value HoverLeave The mouse cursor leaves a hover widget (QHoverEvent).
\value HoverMove The mouse cursor moves inside a hover widget (QHoverEvent).
\value IconDrag The main icon of a window has been dragged away (QIconDragEvent).
- \value IconTextChange Widget's icon text has been changed.
+ \value IconTextChange Widget's icon text has been changed. (Deprecated)
\value InputMethod An input method is being used (QInputMethodEvent).
\value InputMethodQuery A input method query event (QInputMethodQueryEvent)
\value KeyboardLayoutChange The keyboard layout has changed.
@@ -219,7 +219,7 @@ QT_BEGIN_NAMESPACE
\value TouchEnd End of touch-event sequence (QTouchEvent).
\value TouchUpdate Touch-screen event (QTouchEvent).
\value UngrabKeyboard Item loses keyboard grab (QGraphicsItem only).
- \value UngrabMouse Item loses mouse grab (QGraphicsItem only).
+ \value UngrabMouse Item loses mouse grab (QGraphicsItem, QQuickItem).
\value UpdateLater The widget should be queued to be repainted at a later time.
\value UpdateRequest The widget should be repainted.
\value WhatsThis The widget should reveal "What's This?" help (QHelpEvent).
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index c208eb1180..53da4a849b 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -133,7 +133,7 @@ public:
EnabledChange = 98, // enabled state has changed
ActivationChange = 99, // window activation has changed
StyleChange = 100, // style has changed
- IconTextChange = 101, // icon text has changed
+ IconTextChange = 101, // icon text has changed. Deprecated.
ModifiedChange = 102, // modified state has changed
MouseTrackingChange = 109, // mouse tracking state has changed
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index 796daaa50a..a8e3d3c766 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -102,7 +102,7 @@ static int bpsUnblockDomain = -1;
static int bpsIOHandler(int fd, int io_events, void *data)
{
- qEventDispatcherDebug << Q_FUNC_INFO;
+ qEventDispatcherDebug;
// decode callback payload
bpsIOHandlerData *ioData = static_cast<bpsIOHandlerData*>(data);
@@ -223,7 +223,7 @@ void QEventDispatcherBlackberry::registerSocketNotifier(QSocketNotifier *notifie
int sockfd = notifier->socket();
int type = notifier->type();
- qEventDispatcherDebug << Q_FUNC_INFO << "fd =" << sockfd;
+ qEventDispatcherDebug << "fd =" << sockfd;
if (Q_UNLIKELY(sockfd >= FD_SETSIZE)) {
qWarning() << "QEventDispatcherBlackberry: cannot register QSocketNotifier (fd too high)"
@@ -267,7 +267,7 @@ void QEventDispatcherBlackberry::unregisterSocketNotifier(QSocketNotifier *notif
int sockfd = notifier->socket();
- qEventDispatcherDebug << Q_FUNC_INFO << "fd =" << sockfd;
+ qEventDispatcherDebug << "fd =" << sockfd;
if (Q_UNLIKELY(sockfd >= FD_SETSIZE)) {
qWarning() << "QEventDispatcherBlackberry: cannot unregister QSocketNotifier" << sockfd;
diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm
new file mode 100644
index 0000000000..8422345968
--- /dev/null
+++ b/src/corelib/kernel/qeventdispatcher_cf.mm
@@ -0,0 +1,633 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 "qeventdispatcher_cf_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qthread.h>
+#include <QtCore/private/qcoreapplication_p.h>
+#include <QtCore/private/qcore_unix_p.h>
+#include <QtCore/private/qcore_mac_p.h>
+#include <QtCore/private/qthread_p.h>
+
+#include <limits>
+
+#ifdef Q_OS_OSX
+# include <AppKit/NSApplication.h>
+#else
+# include <UIKit/UIApplication.h>
+#endif
+
+QT_USE_NAMESPACE
+
+@interface RunLoopModeTracker : NSObject {
+ QStack<CFStringRef> m_runLoopModes;
+}
+@end
+
+@implementation RunLoopModeTracker
+
+- (id) init
+{
+ if (self = [super init]) {
+ m_runLoopModes.push(kCFRunLoopDefaultMode);
+
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(receivedNotification:)
+ name:nil
+#ifdef Q_OS_OSX
+ object:[NSApplication sharedApplication]];
+#else
+ object:[UIApplication sharedApplication]];
+#endif
+ }
+
+ return self;
+}
+
+- (void) dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [super dealloc];
+}
+
+static CFStringRef runLoopMode(NSDictionary *dictionary)
+{
+ for (NSString *key in dictionary) {
+ if (CFStringHasSuffix((CFStringRef)key, CFSTR("RunLoopMode")))
+ return (CFStringRef)[dictionary objectForKey: key];
+ }
+
+ return nil;
+}
+
+- (void) receivedNotification:(NSNotification *) notification
+{
+ if (CFStringHasSuffix((CFStringRef)notification.name, CFSTR("RunLoopModePushNotification"))) {
+ if (CFStringRef mode = runLoopMode(notification.userInfo))
+ m_runLoopModes.push(mode);
+ else
+ qWarning("Encountered run loop push notification without run loop mode!");
+
+ } else if (CFStringHasSuffix((CFStringRef)notification.name, CFSTR("RunLoopModePopNotification"))) {
+ CFStringRef mode = runLoopMode(notification.userInfo);
+ if (CFStringCompare(mode, [self currentMode], 0) == kCFCompareEqualTo)
+ m_runLoopModes.pop();
+ else
+ qWarning("Tried to pop run loop mode '%s' that was never pushed!", qPrintable(QCFString::toQString(mode)));
+
+ Q_ASSERT(m_runLoopModes.size() >= 1);
+ }
+}
+
+- (CFStringRef) currentMode
+{
+ return m_runLoopModes.top();
+}
+
+@end
+
+QT_BEGIN_NAMESPACE
+
+class RunLoopDebugger : public QObject
+{
+ Q_OBJECT
+
+ Q_ENUMS(Activity)
+ Q_ENUMS(Result)
+
+public:
+
+ #define Q_MIRROR_ENUM(name) name = name
+
+ enum Activity {
+ Q_MIRROR_ENUM(kCFRunLoopEntry),
+ Q_MIRROR_ENUM(kCFRunLoopBeforeTimers),
+ Q_MIRROR_ENUM(kCFRunLoopBeforeSources),
+ Q_MIRROR_ENUM(kCFRunLoopBeforeWaiting),
+ Q_MIRROR_ENUM(kCFRunLoopAfterWaiting),
+ Q_MIRROR_ENUM(kCFRunLoopExit)
+ };
+
+ enum Result {
+ Q_MIRROR_ENUM(kCFRunLoopRunFinished),
+ Q_MIRROR_ENUM(kCFRunLoopRunStopped),
+ Q_MIRROR_ENUM(kCFRunLoopRunTimedOut),
+ Q_MIRROR_ENUM(kCFRunLoopRunHandledSource)
+ };
+};
+
+#define Q_ENUM_PRINTER(enumName) \
+ static const char* qPrintable##enumName(int value) \
+ { \
+ return RunLoopDebugger::staticMetaObject.enumerator(RunLoopDebugger::staticMetaObject.indexOfEnumerator(#enumName)).valueToKey(value); \
+ }
+
+Q_ENUM_PRINTER(Activity);
+Q_ENUM_PRINTER(Result);
+
+QDebug operator<<(QDebug s, timespec tv)
+{
+ s << tv.tv_sec << "." << qSetFieldWidth(9) << qSetPadChar(QChar(48)) << tv.tv_nsec << reset;
+ return s;
+}
+
+#if DEBUG_EVENT_DISPATCHER
+uint g_eventDispatcherIndentationLevel = 0;
+#endif
+
+static const CFTimeInterval kCFTimeIntervalMinimum = 0;
+static const CFTimeInterval kCFTimeIntervalDistantFuture = std::numeric_limits<CFTimeInterval>::max();
+
+#pragma mark - Class definition
+
+QEventDispatcherCoreFoundation::QEventDispatcherCoreFoundation(QObject *parent)
+ : QAbstractEventDispatcher(parent)
+ , m_processEvents(QEventLoop::EventLoopExec)
+ , m_postedEventsRunLoopSource(this, &QEventDispatcherCoreFoundation::processPostedEvents)
+ , m_runLoopActivityObserver(this, &QEventDispatcherCoreFoundation::handleRunLoopActivity,
+#if DEBUG_EVENT_DISPATCHER
+ kCFRunLoopAllActivities
+#else
+ kCFRunLoopBeforeWaiting | kCFRunLoopAfterWaiting
+#endif
+ )
+ , m_runLoopModeTracker([[RunLoopModeTracker alloc] init])
+ , m_runLoopTimer(0)
+ , m_blockedRunLoopTimer(0)
+ , m_overdueTimerScheduled(false)
+{
+ m_cfSocketNotifier.setHostEventDispatcher(this);
+
+ m_postedEventsRunLoopSource.addToMode(kCFRunLoopCommonModes);
+ m_runLoopActivityObserver.addToMode(kCFRunLoopCommonModes);
+}
+
+QEventDispatcherCoreFoundation::~QEventDispatcherCoreFoundation()
+{
+ invalidateTimer();
+ qDeleteAll(m_timerInfoList);
+
+ m_cfSocketNotifier.removeSocketNotifiers();
+}
+
+/*!
+ Processes all pending events that match \a flags until there are no
+ more events to process. Returns \c true if pending events were handled;
+ otherwise returns \c false.
+
+ Note:
+
+ - All events are considered equal. This function should process
+ both system/native events (that we may or may not care about),
+ as well as Qt-events (posted events and timers).
+
+ - The function should not return until all queued/available events
+ have been processed. If the WaitForMoreEvents is set, the
+ function should wait only if there were no events ready,
+ and _then_ process all newly queued/available events.
+
+ These notes apply to other function in this class as well, such as
+ hasPendingEvents().
+*/
+bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlags flags)
+{
+ bool eventsProcessed = false;
+
+ if (flags & (QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers))
+ qWarning() << "processEvents() flags" << flags << "not supported on iOS";
+
+ qEventDispatcherDebug() << "Entering with " << flags; qIndent();
+
+ if (m_blockedRunLoopTimer) {
+ Q_ASSERT(m_blockedRunLoopTimer == m_runLoopTimer);
+
+ qEventDispatcherDebug() << "Recursing from blocked timer " << m_blockedRunLoopTimer;
+ m_runLoopTimer = 0; // Unset current timer to force creation of new timer
+ updateTimers();
+ }
+
+ if (m_processEvents.deferredWakeUp) {
+ // We may be processing events recursivly as a result of processing a posted event,
+ // in which case we need to signal the run-loop source so that this iteration of
+ // processEvents will take care of the newly posted events.
+ m_postedEventsRunLoopSource.signal();
+ m_processEvents.deferredWakeUp = false;
+
+ qEventDispatcherDebug() << "Processed deferred wake-up";
+ }
+
+ // The documentation states that this signal is emitted after the event
+ // loop returns from a function that could block, which is not the case
+ // here, but all the other event dispatchers emit awake at the start of
+ // processEvents, and the QEventLoop auto-test has an explicit check for
+ // this behavior, so we assume it's for a good reason and do it as well.
+ emit awake();
+
+ ProcessEventsState previousState = m_processEvents;
+ m_processEvents = ProcessEventsState(flags);
+
+ bool returnAfterSingleSourceHandled = !(m_processEvents.flags & QEventLoop::EventLoopExec);
+
+ Q_FOREVER {
+ CFStringRef mode = [m_runLoopModeTracker currentMode];
+
+ CFTimeInterval duration = (m_processEvents.flags & QEventLoop::WaitForMoreEvents) ?
+ kCFTimeIntervalDistantFuture : kCFTimeIntervalMinimum;
+
+ qEventDispatcherDebug() << "Calling CFRunLoopRunInMode = " << qPrintable(QCFString::toQString(mode))
+ << " for " << duration << " ms, processing single source = " << returnAfterSingleSourceHandled; qIndent();
+
+ SInt32 result = CFRunLoopRunInMode(mode, duration, returnAfterSingleSourceHandled);
+
+ qUnIndent(); qEventDispatcherDebug() << "result = " << qPrintableResult(result);
+
+ eventsProcessed |= (result == kCFRunLoopRunHandledSource
+ || m_processEvents.processedPostedEvents
+ || m_processEvents.processedTimers);
+
+ if (result == kCFRunLoopRunFinished) {
+ // This should only happen at application shutdown, as the main runloop
+ // will presumably always have sources registered.
+ break;
+ } else if (m_processEvents.wasInterrupted) {
+
+ if (m_processEvents.flags & QEventLoop::EventLoopExec) {
+ Q_ASSERT(result == kCFRunLoopRunStopped);
+
+ // The runloop was potentially stopped (interrupted) by us, as a response to
+ // a Qt event loop being asked to exit. We check that the topmost eventloop
+ // is still supposed to keep going and return if not. Note that the runloop
+ // might get stopped as a result of a non-top eventloop being asked to exit,
+ // in which case we continue running the top event loop until that is asked
+ // to exit, and then unwind back to the previous event loop which will break
+ // immediately, since it has already been exited.
+
+ QEventLoop *currentEventLoop = QThreadData::current()->eventLoops.top();
+ Q_ASSERT(currentEventLoop);
+
+ if (!currentEventLoop->isRunning()) {
+ qEventDispatcherDebug() << "Top level event loop was exited";
+ break;
+ } else {
+ qEventDispatcherDebug() << "Top level event loop still running, making another pass";
+ }
+ } else {
+ // We were called manually, through processEvents(), and should stop processing
+ // events, even if we didn't finish processing all the queued events.
+ qEventDispatcherDebug() << "Top level processEvents was interrupted";
+ break;
+ }
+ }
+
+ if (m_processEvents.flags & QEventLoop::EventLoopExec) {
+ // We were called from QEventLoop's exec(), which blocks until the event
+ // loop is asked to exit by calling processEvents repeatedly. Instead of
+ // re-entering this method again and again from QEventLoop, we can block
+ // here, one lever closer to CFRunLoopRunInMode, by running the native
+ // event loop again and again until we're interrupted by QEventLoop.
+ continue;
+ } else {
+ // We were called 'manually', through processEvents()
+
+ if (result == kCFRunLoopRunHandledSource) {
+ // We processed one or more sources, but there might still be other
+ // sources that did not get a chance to process events, so we need
+ // to do another pass.
+
+ // But we should only wait for more events the first time
+ m_processEvents.flags &= ~QEventLoop::WaitForMoreEvents;
+ continue;
+
+ } else if (m_overdueTimerScheduled && !m_processEvents.processedTimers) {
+ // CFRunLoopRunInMode does not guarantee that a scheduled timer with a fire
+ // date in the past (overdue) will fire on the next run loop pass. The Qt
+ // APIs on the other hand document eg. zero-interval timers to always be
+ // handled after processing all available window-system events.
+ qEventDispatcherDebug() << "Manually processing timers due to overdue timer";
+ processTimers(0);
+ eventsProcessed = true;
+ }
+ }
+
+ break;
+ }
+
+ if (m_blockedRunLoopTimer) {
+ invalidateTimer();
+ m_runLoopTimer = m_blockedRunLoopTimer;
+ }
+
+ if (m_processEvents.deferredUpdateTimers)
+ updateTimers();
+
+ if (m_processEvents.deferredWakeUp) {
+ m_postedEventsRunLoopSource.signal();
+ qEventDispatcherDebug() << "Processed deferred wake-up";
+ }
+
+ bool wasInterrupted = m_processEvents.wasInterrupted;
+
+ // Restore state of previous processEvents() call
+ m_processEvents = previousState;
+
+ if (wasInterrupted) {
+ // The current processEvents run has been interrupted, but there may still be
+ // others below it (eg, in the case of nested event loops). We need to trigger
+ // another interrupt so that the parent processEvents call has a chance to check
+ // if it should continue.
+ qEventDispatcherDebug() << "Forwarding interrupt in case of nested processEvents";
+ interrupt();
+ }
+
+ qEventDispatcherDebug() << "Returning with eventsProcessed = " << eventsProcessed; qUnIndent();
+
+ return eventsProcessed;
+}
+
+bool QEventDispatcherCoreFoundation::processPostedEvents()
+{
+ if (m_processEvents.processedPostedEvents && !(m_processEvents.flags & QEventLoop::EventLoopExec)) {
+ qEventDispatcherDebug() << "Already processed events this pass";
+ return false;
+ }
+
+ m_processEvents.processedPostedEvents = true;
+
+ qEventDispatcherDebug() << "Sending posted events for " << m_processEvents.flags; qIndent();
+ QCoreApplication::sendPostedEvents();
+ qUnIndent();
+
+ return true;
+}
+
+void QEventDispatcherCoreFoundation::processTimers(CFRunLoopTimerRef timer)
+{
+ if (m_processEvents.processedTimers && !(m_processEvents.flags & QEventLoop::EventLoopExec)) {
+ qEventDispatcherDebug() << "Already processed timers this pass";
+ m_processEvents.deferredUpdateTimers = true;
+ return;
+ }
+
+ qEventDispatcherDebug() << "CFRunLoopTimer " << timer << " fired, activating Qt timers"; qIndent();
+
+ // Activating Qt timers might recurse into processEvents() if a timer-callback
+ // brings up a new event-loop or tries to processes events manually. Although
+ // a CFRunLoop can recurse inside its callbacks, a single CFRunLoopTimer can
+ // not. So, for each recursion into processEvents() from a timer-callback we
+ // need to set up a new timer-source. Instead of doing it preemtivly each
+ // time we activate Qt timers, we set a flag here, and let processEvents()
+ // decide whether or not it needs to bring up a new timer source.
+
+ // We may have multiple recused timers, so keep track of the previous blocked timer
+ CFRunLoopTimerRef previouslyBlockedRunLoopTimer = m_blockedRunLoopTimer;
+
+ m_blockedRunLoopTimer = timer;
+ m_timerInfoList.activateTimers();
+ m_blockedRunLoopTimer = previouslyBlockedRunLoopTimer;
+ m_processEvents.processedTimers = true;
+
+ qUnIndent();
+
+ // Now that the timer source is unblocked we may need to schedule it again
+ updateTimers();
+}
+
+void QEventDispatcherCoreFoundation::handleRunLoopActivity(CFRunLoopActivity activity)
+{
+ qEventDispatcherDebug() << qPrintableActivity(activity);
+
+ switch (activity) {
+ case kCFRunLoopBeforeWaiting:
+ if (m_processEvents.processedTimers
+ && !(m_processEvents.flags & QEventLoop::EventLoopExec)
+ && m_processEvents.flags & QEventLoop::WaitForMoreEvents) {
+ // CoreFoundation does not treat a timer as a reason to exit CFRunLoopRunInMode
+ // when asked to only process a single source, so we risk waiting a long time for
+ // a 'proper' source to fire (typically a system source that we don't control).
+ // To fix this we do an explicit interrupt after processing our timer, so that
+ // processEvents() gets a chance to re-evaluate the state of things.
+ interrupt();
+ }
+ emit aboutToBlock();
+ break;
+ case kCFRunLoopAfterWaiting:
+ emit awake();
+ break;
+#if DEBUG_EVENT_DISPATCHER
+ case kCFRunLoopEntry:
+ case kCFRunLoopBeforeTimers:
+ case kCFRunLoopBeforeSources:
+ case kCFRunLoopExit:
+ break;
+#endif
+ default:
+ Q_UNREACHABLE();
+ }
+}
+
+bool QEventDispatcherCoreFoundation::hasPendingEvents()
+{
+ // There doesn't seem to be any API on iOS to peek into the other sources
+ // to figure out if there are pending non-Qt events. As a workaround, we
+ // assume that if the run-loop is currently blocking and waiting for a
+ // source to signal then there are no system-events pending. If this
+ // function is called from the main thread then the second clause
+ // of the condition will always be true, as the run loop is
+ // never waiting in that case. The function would be more aptly named
+ // 'maybeHasPendingEvents' in our case.
+
+ extern uint qGlobalPostedEventsCount();
+ return qGlobalPostedEventsCount() || !CFRunLoopIsWaiting(CFRunLoopGetMain());
+}
+
+void QEventDispatcherCoreFoundation::wakeUp()
+{
+ if (m_processEvents.processedPostedEvents && !(m_processEvents.flags & QEventLoop::EventLoopExec)) {
+ // A manual processEvents call should only result in processing the events posted
+ // up until then. Any newly posted events as result of processing existing posted
+ // events should be handled in the next call to processEvents(). Since we're using
+ // a run-loop source to process our posted events we need to prevent it from being
+ // signaled as a result of posting new events, otherwise we end up in an infinite
+ // loop. We do however need to signal the source at some point, so that the newly
+ // posted event gets processed on the next processEvents() call, so we flag the
+ // need to do a deferred wake-up.
+ m_processEvents.deferredWakeUp = true;
+ qEventDispatcherDebug() << "Already processed posted events, deferring wakeUp";
+ return;
+ }
+
+ m_postedEventsRunLoopSource.signal();
+ CFRunLoopWakeUp(CFRunLoopGetMain());
+
+ qEventDispatcherDebug() << "Signaled posted event run-loop source";
+}
+
+void QEventDispatcherCoreFoundation::interrupt()
+{
+ qEventDispatcherDebug() << "Marking current processEvent as interrupted";
+ m_processEvents.wasInterrupted = true;
+ CFRunLoopStop(CFRunLoopGetMain());
+}
+
+void QEventDispatcherCoreFoundation::flush()
+{
+ // X11 only.
+}
+
+#pragma mark - Socket notifiers
+
+void QEventDispatcherCoreFoundation::registerSocketNotifier(QSocketNotifier *notifier)
+{
+ m_cfSocketNotifier.registerSocketNotifier(notifier);
+}
+
+void QEventDispatcherCoreFoundation::unregisterSocketNotifier(QSocketNotifier *notifier)
+{
+ m_cfSocketNotifier.unregisterSocketNotifier(notifier);
+}
+
+#pragma mark - Timers
+
+void QEventDispatcherCoreFoundation::registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object)
+{
+ qEventDispatcherDebug() << "id = " << timerId << ", interval = " << interval
+ << ", type = " << timerType << ", object = " << object;
+
+ Q_ASSERT(timerId > 0 && interval >= 0 && object);
+ Q_ASSERT(object->thread() == thread() && thread() == QThread::currentThread());
+
+ m_timerInfoList.registerTimer(timerId, interval, timerType, object);
+ updateTimers();
+}
+
+bool QEventDispatcherCoreFoundation::unregisterTimer(int timerId)
+{
+ Q_ASSERT(timerId > 0);
+ Q_ASSERT(thread() == QThread::currentThread());
+
+ bool returnValue = m_timerInfoList.unregisterTimer(timerId);
+
+ qEventDispatcherDebug() << "id = " << timerId << ", timers left: " << m_timerInfoList.size();
+
+ updateTimers();
+ return returnValue;
+}
+
+bool QEventDispatcherCoreFoundation::unregisterTimers(QObject *object)
+{
+ Q_ASSERT(object && object->thread() == thread() && thread() == QThread::currentThread());
+
+ bool returnValue = m_timerInfoList.unregisterTimers(object);
+
+ qEventDispatcherDebug() << "object = " << object << ", timers left: " << m_timerInfoList.size();
+
+ updateTimers();
+ return returnValue;
+}
+
+QList<QAbstractEventDispatcher::TimerInfo> QEventDispatcherCoreFoundation::registeredTimers(QObject *object) const
+{
+ Q_ASSERT(object);
+ return m_timerInfoList.registeredTimers(object);
+}
+
+int QEventDispatcherCoreFoundation::remainingTime(int timerId)
+{
+ Q_ASSERT(timerId > 0);
+ return m_timerInfoList.timerRemainingTime(timerId);
+}
+
+static double timespecToSeconds(const timespec &spec)
+{
+ static double nanosecondsPerSecond = 1.0 * 1000 * 1000 * 1000;
+ return spec.tv_sec + (spec.tv_nsec / nanosecondsPerSecond);
+}
+
+void QEventDispatcherCoreFoundation::updateTimers()
+{
+ if (m_timerInfoList.size() > 0) {
+ // We have Qt timers registered, so create or reschedule CF timer to match
+
+ timespec tv = { -1, -1 };
+ CFAbsoluteTime timeToFire = m_timerInfoList.timerWait(tv) ?
+ // We have a timer ready to fire right now, or some time in the future
+ CFAbsoluteTimeGetCurrent() + timespecToSeconds(tv)
+ // We have timers, but they are all currently blocked by callbacks
+ : kCFTimeIntervalDistantFuture;
+
+ if (!m_runLoopTimer) {
+ m_runLoopTimer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault,
+ timeToFire, kCFTimeIntervalDistantFuture, 0, 0, ^(CFRunLoopTimerRef timer) {
+ processTimers(timer);
+ });
+
+ CFRunLoopAddTimer(CFRunLoopGetMain(), m_runLoopTimer, kCFRunLoopCommonModes);
+ qEventDispatcherDebug() << "Created new CFRunLoopTimer " << m_runLoopTimer;
+
+ } else {
+ CFRunLoopTimerSetNextFireDate(m_runLoopTimer, timeToFire);
+ qEventDispatcherDebug() << "Re-scheduled CFRunLoopTimer " << m_runLoopTimer;
+ }
+
+ m_overdueTimerScheduled = !timespecToSeconds(tv);
+
+ qEventDispatcherDebug() << "Next timeout in " << tv << " seconds";
+
+ } else {
+ // No Qt timers are registered, so make sure we're not running any CF timers
+ invalidateTimer();
+
+ m_overdueTimerScheduled = false;
+ }
+}
+
+void QEventDispatcherCoreFoundation::invalidateTimer()
+{
+ if (!m_runLoopTimer || (m_runLoopTimer == m_blockedRunLoopTimer))
+ return;
+
+ CFRunLoopTimerInvalidate(m_runLoopTimer);
+ qEventDispatcherDebug() << "Invalidated CFRunLoopTimer " << m_runLoopTimer;
+
+ CFRelease(m_runLoopTimer);
+ m_runLoopTimer = 0;
+}
+
+#include "qeventdispatcher_cf.moc"
+#include "moc_qeventdispatcher_cf_p.cpp"
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_cf_p.h b/src/corelib/kernel/qeventdispatcher_cf_p.h
new file mode 100644
index 0000000000..5e8d2f0c85
--- /dev/null
+++ b/src/corelib/kernel/qeventdispatcher_cf_p.h
@@ -0,0 +1,280 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** Copyright (c) 2007-2008, Apple, Inc.
+**
+** All rights reserved.
+**
+** 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 Apple, Inc. 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.
+**
+****************************************************************************/
+
+#ifndef QEVENTDISPATCHER_CF_P_H
+#define QEVENTDISPATCHER_CF_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.
+//
+
+#define DEBUG_EVENT_DISPATCHER 0
+
+#include <QtCore/qabstracteventdispatcher.h>
+#include <QtCore/private/qtimerinfo_unix_p.h>
+#include <QtCore/private/qcfsocketnotifier_p.h>
+#include <QtCore/qdebug.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+#ifdef __OBJC__
+@class RunLoopModeTracker;
+#else
+typedef struct objc_object RunLoopModeTracker;
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QEventDispatcherCoreFoundation;
+
+template <class T = QEventDispatcherCoreFoundation>
+class RunLoopSource
+{
+public:
+ typedef bool (T::*CallbackFunction)();
+
+ enum { kHighestPriority = 0 } RunLoopSourcePriority;
+
+ RunLoopSource(T *delegate, CallbackFunction callback)
+ : m_delegate(delegate), m_callback(callback)
+ {
+ CFRunLoopSourceContext context = {};
+ context.info = this;
+ context.perform = RunLoopSource::process;
+
+ m_source = CFRunLoopSourceCreate(kCFAllocatorDefault, kHighestPriority, &context);
+ Q_ASSERT(m_source);
+ }
+
+ ~RunLoopSource()
+ {
+ CFRunLoopSourceInvalidate(m_source);
+ CFRelease(m_source);
+ }
+
+ void addToMode(CFStringRef mode, CFRunLoopRef runLoop = 0)
+ {
+ if (!runLoop)
+ runLoop = CFRunLoopGetCurrent();
+
+ CFRunLoopAddSource(runLoop, m_source, mode);
+ }
+
+ void signal() { CFRunLoopSourceSignal(m_source); }
+
+private:
+ static void process(void *info)
+ {
+ RunLoopSource *self = static_cast<RunLoopSource *>(info);
+ ((self->m_delegate)->*(self->m_callback))();
+ }
+
+ T *m_delegate;
+ CallbackFunction m_callback;
+ CFRunLoopSourceRef m_source;
+};
+
+template <class T = QEventDispatcherCoreFoundation>
+class RunLoopObserver
+{
+public:
+ typedef void (T::*CallbackFunction) (CFRunLoopActivity activity);
+
+ RunLoopObserver(T *delegate, CallbackFunction callback, CFOptionFlags activities)
+ : m_delegate(delegate), m_callback(callback)
+ {
+ CFRunLoopObserverContext context = {};
+ context.info = this;
+
+ m_observer = CFRunLoopObserverCreate(kCFAllocatorDefault, activities, true, 0, process, &context);
+ Q_ASSERT(m_observer);
+ }
+
+ ~RunLoopObserver()
+ {
+ CFRunLoopObserverInvalidate(m_observer);
+ CFRelease(m_observer);
+ }
+
+ void addToMode(CFStringRef mode, CFRunLoopRef runLoop = 0)
+ {
+ if (!runLoop)
+ runLoop = CFRunLoopGetCurrent();
+
+ if (!CFRunLoopContainsObserver(runLoop, m_observer, mode))
+ CFRunLoopAddObserver(runLoop, m_observer, mode);
+ }
+
+ void removeFromMode(CFStringRef mode, CFRunLoopRef runLoop = 0)
+ {
+ if (!runLoop)
+ runLoop = CFRunLoopGetCurrent();
+
+ if (CFRunLoopContainsObserver(runLoop, m_observer, mode))
+ CFRunLoopRemoveObserver(runLoop, m_observer, mode);
+ }
+
+private:
+ static void process(CFRunLoopObserverRef, CFRunLoopActivity activity, void *info)
+ {
+ RunLoopObserver *self = static_cast<RunLoopObserver *>(info);
+ ((self->m_delegate)->*(self->m_callback))(activity);
+ }
+
+ T *m_delegate;
+ CallbackFunction m_callback;
+ CFRunLoopObserverRef m_observer;
+};
+
+class Q_CORE_EXPORT QEventDispatcherCoreFoundation : public QAbstractEventDispatcher
+{
+ Q_OBJECT
+
+public:
+ explicit QEventDispatcherCoreFoundation(QObject *parent = 0);
+ ~QEventDispatcherCoreFoundation();
+
+ bool processEvents(QEventLoop::ProcessEventsFlags flags);
+ bool hasPendingEvents();
+
+ void registerSocketNotifier(QSocketNotifier *notifier);
+ void unregisterSocketNotifier(QSocketNotifier *notifier);
+
+ void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object);
+ bool unregisterTimer(int timerId);
+ bool unregisterTimers(QObject *object);
+ QList<QAbstractEventDispatcher::TimerInfo> registeredTimers(QObject *object) const;
+
+ int remainingTime(int timerId);
+
+ void wakeUp();
+ void interrupt();
+ void flush();
+
+protected:
+ virtual bool processPostedEvents();
+
+ struct ProcessEventsState
+ {
+ ProcessEventsState(QEventLoop::ProcessEventsFlags f)
+ : flags(f), wasInterrupted(false)
+ , processedPostedEvents(false), processedTimers(false)
+ , deferredWakeUp(false), deferredUpdateTimers(false) {}
+
+ QEventLoop::ProcessEventsFlags flags;
+ bool wasInterrupted;
+ bool processedPostedEvents;
+ bool processedTimers;
+ bool deferredWakeUp;
+ bool deferredUpdateTimers;
+ };
+
+ ProcessEventsState m_processEvents;
+
+private:
+ RunLoopSource<> m_postedEventsRunLoopSource;
+ RunLoopObserver<> m_runLoopActivityObserver;
+
+ RunLoopModeTracker *m_runLoopModeTracker;
+
+ QTimerInfoList m_timerInfoList;
+ CFRunLoopTimerRef m_runLoopTimer;
+ CFRunLoopTimerRef m_blockedRunLoopTimer;
+ bool m_overdueTimerScheduled;
+
+ QCFSocketNotifier m_cfSocketNotifier;
+
+ void processTimers(CFRunLoopTimerRef);
+
+ void handleRunLoopActivity(CFRunLoopActivity activity);
+
+ void updateTimers();
+ void invalidateTimer();
+};
+
+QT_END_NAMESPACE
+
+#if DEBUG_EVENT_DISPATCHER
+extern uint g_eventDispatcherIndentationLevel;
+#define qEventDispatcherDebug() qDebug().nospace() \
+ << qPrintable(QString(QLatin1String("| ")).repeated(g_eventDispatcherIndentationLevel)) \
+ << __FUNCTION__ << "(): "
+#define qIndent() ++g_eventDispatcherIndentationLevel
+#define qUnIndent() --g_eventDispatcherIndentationLevel
+#else
+#define qEventDispatcherDebug() QT_NO_QDEBUG_MACRO()
+#define qIndent()
+#define qUnIndent()
+#endif
+
+#endif // QEVENTDISPATCHER_CF_P_H
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 876825b5f0..d9bbd4d5f2 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -39,7 +39,6 @@
#include "qcoreapplication.h"
#include "qsocketnotifier.h"
-#include <QtCore/qhash.h>
#include <QtCore/qlist.h>
#include <QtCore/qpair.h>
diff --git a/src/corelib/kernel/qeventdispatcher_glib_p.h b/src/corelib/kernel/qeventdispatcher_glib_p.h
index afdb6b9317..2cb919df07 100644
--- a/src/corelib/kernel/qeventdispatcher_glib_p.h
+++ b/src/corelib/kernel/qeventdispatcher_glib_p.h
@@ -48,8 +48,6 @@
#include "qabstracteventdispatcher.h"
#include "qabstracteventdispatcher_p.h"
-#include <QtCore/qhash.h>
-
typedef struct _GMainContext GMainContext;
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 812494372d..1a14500bd4 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -34,7 +34,6 @@
#include "qeventdispatcher_win_p.h"
#include "qcoreapplication.h"
-#include "qhash.h"
#include <private/qsystemlibrary_p.h>
#include "qpair.h"
#include "qset.h"
@@ -530,7 +529,7 @@ QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext()
wc.lpszClassName = className;
atom = RegisterClass(&wc);
if (!atom) {
- qErrnoWarning("%s: RegisterClass() failed", Q_FUNC_INFO, qPrintable(qClassName));
+ qErrnoWarning("%s RegisterClass() failed", qPrintable(qClassName));
delete [] className;
className = 0;
}
@@ -566,7 +565,7 @@ static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatch
0); // windows creation data.
if (!wnd) {
- qErrnoWarning("%s: CreateWindow() for QEventDispatcherWin32 internal window failed", Q_FUNC_INFO);
+ qErrnoWarning("CreateWindow() for QEventDispatcherWin32 internal window failed");
return 0;
}
@@ -1132,11 +1131,10 @@ void QEventDispatcherWin32::activateEventNotifiers()
for (int i=0; i<d->winEventNotifierList.count(); i++) {
#if !defined(Q_OS_WINCE)
if (WaitForSingleObjectEx(d->winEventNotifierList.at(i)->handle(), 0, TRUE) == WAIT_OBJECT_0)
- d->activateEventNotifier(d->winEventNotifierList.at(i));
#else
if (WaitForSingleObject(d->winEventNotifierList.at(i)->handle(), 0) == WAIT_OBJECT_0)
- d->activateEventNotifier(d->winEventNotifierList.at(i));
#endif
+ d->activateEventNotifier(d->winEventNotifierList.at(i));
}
}
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
index eceba8d002..df070dd1ae 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp
@@ -40,6 +40,7 @@
#include <private/qabstracteventdispatcher_p.h>
#include <private/qcoreapplication_p.h>
+#include <functional>
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.system.threading.h>
@@ -70,6 +71,23 @@ struct WinRTTimerInfo : public QAbstractEventDispatcher::TimerInfo {
quint64 targetTime;
};
+class AgileDispatchedHandler : public RuntimeClass<RuntimeClassFlags<WinRtClassicComMix>, IDispatchedHandler, IAgileObject>
+{
+public:
+ AgileDispatchedHandler(const std::function<HRESULT()> &delegate)
+ : delegate(delegate)
+ {
+ }
+
+ HRESULT __stdcall Invoke()
+ {
+ return delegate();
+ }
+
+private:
+ std::function<HRESULT()> delegate;
+};
+
class QEventDispatcherWinRTPrivate : public QAbstractEventDispatcherPrivate
{
Q_DECLARE_PUBLIC(QEventDispatcherWinRT)
@@ -79,10 +97,6 @@ public:
~QEventDispatcherWinRTPrivate();
private:
- ComPtr<IThreadPoolTimerStatics> timerFactory;
- ComPtr<ICoreDispatcher> coreDispatcher;
- QPointer<QThread> thread;
-
QHash<int, QObject *> timerIdToObject;
QVector<WinRTTimerInfo> timerInfos;
QHash<HANDLE, int> timerHandleToId;
@@ -136,40 +150,11 @@ private:
}
return true;
}
-
- void fetchCoreDispatcher()
- {
- ComPtr<ICoreImmersiveApplication> application;
- HRESULT hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
- IID_PPV_ARGS(&application));
- RETURN_VOID_IF_FAILED("Failed to get the application factory");
-
- static ComPtr<ICoreApplicationView> view;
- if (view)
- return;
-
- hr = application->get_MainView(&view);
- RETURN_VOID_IF_FAILED("Failed to get the main view");
-
- ComPtr<ICoreApplicationView2> view2;
- hr = view.As(&view2);
- RETURN_VOID_IF_FAILED("Failed to cast the main view");
-
- hr = view2->get_Dispatcher(&coreDispatcher);
- if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) // expected in thread pool cases
- return;
- RETURN_VOID_IF_FAILED("Failed to get core dispatcher");
-
- thread = QThread::currentThread();
- }
};
QEventDispatcherWinRT::QEventDispatcherWinRT(QObject *parent)
: QAbstractEventDispatcher(*new QEventDispatcherWinRTPrivate, parent)
{
- Q_D(QEventDispatcherWinRT);
-
- d->fetchCoreDispatcher();
}
QEventDispatcherWinRT::QEventDispatcherWinRT(QEventDispatcherWinRTPrivate &dd, QObject *parent)
@@ -180,32 +165,52 @@ QEventDispatcherWinRT::~QEventDispatcherWinRT()
{
}
+HRESULT QEventDispatcherWinRT::runOnXamlThread(const std::function<HRESULT ()> &delegate, bool waitForRun)
+{
+ static __declspec(thread) ICoreDispatcher *dispatcher = nullptr;
+ if (!dispatcher) {
+ HRESULT hr;
+ ComPtr<ICoreImmersiveApplication> application;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
+ IID_PPV_ARGS(&application));
+ ComPtr<ICoreApplicationView> view;
+ hr = application->get_MainView(&view);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<ICoreWindow> window;
+ hr = view->get_CoreWindow(&window);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = window->get_Dispatcher(&dispatcher);
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+
+ HRESULT hr;
+ boolean onXamlThread;
+ hr = dispatcher->get_HasThreadAccess(&onXamlThread);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (onXamlThread) // Already there
+ return delegate();
+
+ ComPtr<IAsyncAction> op;
+ hr = dispatcher->RunAsync(CoreDispatcherPriority_Normal, Make<AgileDispatchedHandler>(delegate).Get(), &op);
+ if (FAILED(hr) || !waitForRun)
+ return hr;
+ return QWinRTFunctions::await(op);
+}
+
bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
{
Q_D(QEventDispatcherWinRT);
- if (d->thread && d->thread != QThread::currentThread())
- d->fetchCoreDispatcher();
-
+ DWORD waitTime = 0;
do {
- // Process native events
- if (d->coreDispatcher) {
- boolean hasThreadAccess;
- HRESULT hr = d->coreDispatcher->get_HasThreadAccess(&hasThreadAccess);
- if (SUCCEEDED(hr) && hasThreadAccess) {
- hr = d->coreDispatcher->ProcessEvents(CoreProcessEventsOption_ProcessAllIfPresent);
- if (FAILED(hr))
- qErrnoWarning(hr, "Failed to process events");
- }
- }
-
// Additional user events have to be handled before timer events, but the function may not
// return yet.
const bool userEventsSent = sendPostedEvents(flags);
- emit aboutToBlock();
const QVector<HANDLE> timerHandles = d->timerIdToHandle.values().toVector();
- DWORD waitResult = WaitForMultipleObjectsEx(timerHandles.count(), timerHandles.constData(), FALSE, 1, TRUE);
+ if (waitTime)
+ emit aboutToBlock();
+ DWORD waitResult = WaitForMultipleObjectsEx(timerHandles.count(), timerHandles.constData(), FALSE, waitTime, TRUE);
if (waitResult >= WAIT_OBJECT_0 && waitResult < WAIT_OBJECT_0 + timerHandles.count()) {
const HANDLE handle = timerHandles.value(waitResult - WAIT_OBJECT_0);
ResetEvent(handle);
@@ -228,6 +233,13 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
if (userEventsSent)
return true;
+
+ // We cannot wait infinitely like on other platforms, as
+ // WaitForMultipleObjectsEx might not return.
+ // For instance win32 uses MsgWaitForMultipleObjects to hook
+ // into the native event loop, while WinRT handles those
+ // via callbacks.
+ waitTime = 1;
} while (flags & QEventLoop::WaitForMoreEvents);
return false;
}
@@ -283,11 +295,20 @@ void QEventDispatcherWinRT::registerTimer(int timerId, int interval, Qt::TimerTy
}
TimeSpan period;
- period.Duration = interval ? (interval * 10000) : 1; // TimeSpan is based on 100-nanosecond units
- IThreadPoolTimer *timer;
+ // TimeSpan is based on 100-nanosecond units
+ period.Duration = qMax(qint64(1), qint64(interval) * 10000);
const HANDLE handle = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, SYNCHRONIZE | EVENT_MODIFY_STATE);
const HANDLE cancelHandle = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, SYNCHRONIZE|EVENT_MODIFY_STATE);
- HRESULT hr = d->timerFactory->CreatePeriodicTimerWithCompletion(
+ HRESULT hr = runOnXamlThread([cancelHandle, handle, period]() {
+ static ComPtr<IThreadPoolTimerStatics> timerFactory;
+ HRESULT hr;
+ if (!timerFactory) {
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(),
+ &timerFactory);
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ IThreadPoolTimer *timer;
+ hr = timerFactory->CreatePeriodicTimerWithCompletion(
Callback<ITimerElapsedHandler>([handle, cancelHandle](IThreadPoolTimer *timer) {
DWORD cancelResult = WaitForSingleObjectEx(cancelHandle, 0, TRUE);
if (cancelResult == WAIT_OBJECT_0) {
@@ -306,8 +327,10 @@ void QEventDispatcherWinRT::registerTimer(int timerId, int interval, Qt::TimerTy
CloseHandle(cancelHandle);
return S_OK;
}).Get(), &timer);
+ RETURN_HR_IF_FAILED("Failed to create periodic timer");
+ return hr;
+ }, false);
if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to create periodic timer");
CloseHandle(handle);
CloseHandle(cancelHandle);
return;
@@ -486,9 +509,6 @@ QEventDispatcherWinRTPrivate::QEventDispatcherWinRTPrivate()
const bool isGuiThread = QCoreApplication::instance() &&
QThread::currentThread() == QCoreApplication::instance()->thread();
CoInitializeEx(NULL, isGuiThread ? COINIT_APARTMENTTHREADED : COINIT_MULTITHREADED);
- HRESULT hr;
- hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(), &timerFactory);
- Q_ASSERT_SUCCEEDED(hr);
HANDLE interruptHandle = CreateEventEx(NULL, NULL, NULL, SYNCHRONIZE|EVENT_MODIFY_STATE);
timerIdToHandle.insert(INTERRUPT_HANDLE, interruptHandle);
timerHandleToId.insert(interruptHandle, INTERRUPT_HANDLE);
diff --git a/src/corelib/kernel/qeventdispatcher_winrt_p.h b/src/corelib/kernel/qeventdispatcher_winrt_p.h
index fd3d259c96..1f9826f048 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt_p.h
+++ b/src/corelib/kernel/qeventdispatcher_winrt_p.h
@@ -50,6 +50,8 @@
#include <qt_windows.h>
+namespace std { template <typename T> class function; }
+
QT_BEGIN_NAMESPACE
quint64 qt_msectime();
@@ -65,6 +67,8 @@ public:
explicit QEventDispatcherWinRT(QObject *parent = 0);
~QEventDispatcherWinRT();
+ static HRESULT runOnXamlThread(const std::function<HRESULT()> &delegate, bool waitForRun = true);
+
bool processEvents(QEventLoop::ProcessEventsFlags flags);
bool hasPendingEvents();
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index 1723db0ab9..dca25ce968 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -93,7 +93,7 @@ QEventLoop::QEventLoop(QObject *parent)
: QObject(*new QEventLoopPrivate, parent)
{
Q_D(QEventLoop);
- if (!QCoreApplication::instance()) {
+ if (!QCoreApplication::instance() && QCoreApplicationPrivate::threadRequiresCoreApplication()) {
qWarning("QEventLoop: Cannot be used without QApplication");
} else if (!d->threadData->eventDispatcher.load()) {
QThreadPrivate::createEventDispatcher(d->threadData);
diff --git a/src/corelib/kernel/qeventloop.h b/src/corelib/kernel/qeventloop.h
index 99c0cd50ff..375a63abdd 100644
--- a/src/corelib/kernel/qeventloop.h
+++ b/src/corelib/kernel/qeventloop.h
@@ -47,7 +47,7 @@ class Q_CORE_EXPORT QEventLoop : public QObject
Q_DECLARE_PRIVATE(QEventLoop)
public:
- explicit QEventLoop(QObject *parent = 0);
+ explicit QEventLoop(QObject *parent = Q_NULLPTR);
~QEventLoop();
enum ProcessEventsFlag {
diff --git a/src/corelib/kernel/qfunctions_fake_env_p.h b/src/corelib/kernel/qfunctions_fake_env_p.h
new file mode 100644
index 0000000000..b4c5ffb079
--- /dev/null
+++ b/src/corelib/kernel/qfunctions_fake_env_p.h
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 QFUNCTIONS_FAKE_ENV_P_H
+#define QFUNCTIONS_FAKE_ENV_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 QLibrary class. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qbytearray.h"
+#include "qvector.h"
+
+QT_BEGIN_NAMESPACE
+
+// Environment ------------------------------------------------------
+struct Variable {
+ Variable() { }
+
+ Variable(const QByteArray &name, const QByteArray &value)
+ : name(name), value(value) { }
+
+ QByteArray name;
+ QByteArray value;
+};
+
+Q_DECLARE_TYPEINFO(Variable, Q_MOVABLE_TYPE);
+
+struct NameEquals {
+ typedef bool result_type;
+ const char *name;
+ explicit NameEquals(const char *name) Q_DECL_NOTHROW : name(name) {}
+ result_type operator()(const Variable &other) const Q_DECL_NOTHROW
+ { return qstrcmp(other.name, name) == 0; }
+};
+
+Q_GLOBAL_STATIC(QVector<Variable>, qt_app_environment)
+
+errno_t qt_fake_getenv_s(size_t *sizeNeeded, char *buffer, size_t bufferSize, const char *varName)
+{
+ if (!sizeNeeded)
+ return EINVAL;
+
+ QVector<Variable>::const_iterator end = qt_app_environment->constEnd();
+ QVector<Variable>::const_iterator iterator = std::find_if(qt_app_environment->constBegin(),
+ end,
+ NameEquals(varName));
+ if (iterator == end) {
+ if (buffer)
+ buffer[0] = '\0';
+ return ENOENT;
+ }
+
+ const int size = iterator->value.size() + 1;
+ if (bufferSize < size_t(size)) {
+ *sizeNeeded = size;
+ return ERANGE;
+ }
+
+ qstrcpy(buffer, iterator->value.constData());
+ return 0;
+}
+
+errno_t qt_fake__putenv_s(const char *varName, const char *value)
+{
+ QVector<Variable>::iterator end = qt_app_environment->end();
+ QVector<Variable>::iterator iterator = std::find_if(qt_app_environment->begin(),
+ end,
+ NameEquals(varName));
+ if (!value || !*value) {
+ if (iterator != end)
+ qt_app_environment->erase(iterator);
+ } else {
+ if (iterator == end)
+ qt_app_environment->append(Variable(varName, value));
+ else
+ iterator->value = value;
+ }
+
+ return 0;
+}
+
+QT_END_NAMESPACE
+
+#endif // QFUNCTIONS_FAKE_ENV_P_H
diff --git a/src/corelib/kernel/qfunctions_wince.cpp b/src/corelib/kernel/qfunctions_wince.cpp
index 8f8fc21313..0619503c51 100644
--- a/src/corelib/kernel/qfunctions_wince.cpp
+++ b/src/corelib/kernel/qfunctions_wince.cpp
@@ -36,13 +36,16 @@
#include <winbase.h>
#include <kfuncs.h>
#include <stdio.h>
-#include <altcecrt.h>
+#if _WIN32_WCE < 0x800
+# include <altcecrt.h>
+#else
+# include <fcntl.h>
+#endif
#include "qplatformdefs.h"
#include "qfunctions_wince.h"
+#include "qfunctions_fake_env_p.h"
#include "qstring.h"
-#include "qbytearray.h"
-#include "qhash.h"
QT_USE_NAMESPACE
@@ -93,7 +96,9 @@ FILETIME qt_wince_time_tToFt( time_t tt )
}
// File I/O ---------------------------------------------------------
+#if _WIN32_WCE < 0x800
int errno = 0;
+#endif
int qt_wince__getdrive( void )
{
@@ -393,51 +398,4 @@ int qt_wince__getpid()
#ifdef __cplusplus
} // extern "C"
#endif
-// Environment ------------------------------------------------------
-inline QHash<QByteArray, QByteArray>& qt_app_environment()
-{
- static QHash<QByteArray, QByteArray> internalEnvironment;
- return internalEnvironment;
-}
-
-errno_t qt_wince_getenv_s(size_t* sizeNeeded, char* buffer, size_t bufferSize, const char* varName)
-{
- if (!sizeNeeded)
- return EINVAL;
-
- if (!qt_app_environment().contains(varName)) {
- if (buffer)
- buffer[0] = '\0';
- return ENOENT;
- }
-
- QByteArray value = qt_app_environment().value(varName);
- if (!value.endsWith('\0')) // win32 guarantees terminated string
- value.append('\0');
-
- if (bufferSize < (size_t)value.size()) {
- *sizeNeeded = value.size();
- return 0;
- }
-
- strcpy(buffer, value.constData());
- return 0;
-}
-
-errno_t qt_wince__putenv_s(const char* varName, const char* value)
-{
- QByteArray input = value;
- if (input.isEmpty()) {
- if (qt_app_environment().contains(varName))
- qt_app_environment().remove(varName);
- } else {
- // win32 guarantees terminated string
- if (!input.endsWith('\0'))
- input.append('\0');
- qt_app_environment()[varName] = input;
- }
-
- return 0;
-}
-
#endif // Q_OS_WINCE
diff --git a/src/corelib/kernel/qfunctions_wince.h b/src/corelib/kernel/qfunctions_wince.h
index 987342d29a..347f57f95d 100644
--- a/src/corelib/kernel/qfunctions_wince.h
+++ b/src/corelib/kernel/qfunctions_wince.h
@@ -37,6 +37,9 @@
#include <QtCore/qglobal.h>
#ifdef Q_OS_WINCE
+# ifndef NOMINMAX
+# define NOMINMAX
+# endif
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
@@ -47,7 +50,12 @@
#include <ctype.h>
#include <time.h>
#include <crtdefs.h>
-#include <altcecrt.h>
+#if _WIN32_WCE < 0x800
+# include <altcecrt.h>
+#else
+# include <fcntl.h>
+# include <stat.h>
+#endif
#include <winsock.h>
#include <ceconfig.h>
@@ -68,8 +76,8 @@ QT_END_NAMESPACE
#endif
// Environment ------------------------------------------------------
-errno_t qt_wince_getenv_s(size_t*, char*, size_t, const char*);
-errno_t qt_wince__putenv_s(const char*, const char*);
+errno_t qt_fake_getenv_s(size_t*, char*, size_t, const char*);
+errno_t qt_fake__putenv_s(const char*, const char*);
#ifdef __cplusplus // have this as tiff plugin is written in C
extern "C" {
@@ -95,13 +103,15 @@ struct tm {
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
- int tm_isdst; /* daylight savings time flag */
+ int tm_isdst; /* daylight-saving time flag */
};
#endif // _TM_DEFINED
FILETIME qt_wince_time_tToFt( time_t tt );
time_t qt_wince_ftToTime_t( const FILETIME ft );
+#if _WIN32_WCE < 0x800
+
// File I/O ---------------------------------------------------------
#define _O_RDONLY 0x0001
#define _O_RDWR 0x0002
@@ -161,6 +171,7 @@ struct stat
typedef int mode_t;
extern int errno;
+#endif // _WIN32_WCE < 0x800
int qt_wince__getdrive( void );
int qt_wince__waccess( const wchar_t *path, int pmode );
@@ -387,20 +398,20 @@ typedef DWORD OLE_COLOR;
{ \
return qt_wince_##funcname(p1); \
}
-#define generate_inline_return_func2(funcname, returntype, param1, param2) \
+#define generate_inline_return_func2(funcname, returntype, prependnamespace, param1, param2) \
inline returntype funcname(param1 p1, param2 p2) \
{ \
- return qt_wince_##funcname(p1, p2); \
+ return prependnamespace##funcname(p1, p2); \
}
#define generate_inline_return_func3(funcname, returntype, param1, param2, param3) \
inline returntype funcname(param1 p1, param2 p2, param3 p3) \
{ \
return qt_wince_##funcname(p1, p2, p3); \
}
-#define generate_inline_return_func4(funcname, returntype, param1, param2, param3, param4) \
+#define generate_inline_return_func4(funcname, returntype, prependnamespace, param1, param2, param3, param4) \
inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
- return qt_wince_##funcname(p1, p2, p3, p4); \
+ return prependnamespace##funcname(p1, p2, p3, p4); \
}
#define generate_inline_return_func5(funcname, returntype, param1, param2, param3, param4, param5) \
inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
@@ -422,26 +433,28 @@ typedef unsigned (__stdcall *StartAdressExFunc)(void *);
typedef void(*StartAdressFunc)(void *);
typedef int ( __cdecl *CompareFunc ) (const void *, const void *) ;
-generate_inline_return_func4(getenv_s, errno_t, size_t *, char *, size_t, const char *)
-generate_inline_return_func2(_putenv_s, errno_t, const char *, const char *)
+generate_inline_return_func4(getenv_s, errno_t, qt_fake_, size_t *, char *, size_t, const char *)
+generate_inline_return_func2(_putenv_s, errno_t, qt_fake_, const char *, const char *)
generate_inline_return_func0(_getpid, int)
generate_inline_return_func1(time_tToFt, FILETIME, time_t)
generate_inline_return_func1(ftToTime_t, time_t, FILETIME)
generate_inline_return_func0(_getdrive, int)
-generate_inline_return_func2(_waccess, int, const wchar_t *, int)
+generate_inline_return_func2(_waccess, int, qt_wince_, const wchar_t *, int)
generate_inline_return_func3(_wopen, int, const wchar_t *, int, int)
-generate_inline_return_func2(_fdopen, FILE *, int, const char *)
-generate_inline_return_func2(fdopen, FILE *, int, const char *)
+generate_inline_return_func2(_fdopen, FILE *, qt_wince_, int, const char *)
+generate_inline_return_func2(fdopen, FILE *, qt_wince_, int, const char *)
generate_inline_return_func1(rewind, void, FILE *)
generate_inline_return_func0(tmpfile, FILE *)
-generate_inline_return_func2(_rename, int, const char *, const char *)
+generate_inline_return_func2(_rename, int, qt_wince_, const char *, const char *)
generate_inline_return_func1(_remove, int, const char *)
generate_inline_return_func1(SetErrorMode, int, int)
-generate_inline_return_func2(_chmod, bool, const char *, int)
-generate_inline_return_func2(_wchmod, bool, const wchar_t *, int)
+#if _WIN32_WCE < 0x800
+generate_inline_return_func2(_chmod, bool, qt_wince_, const char *, int)
+generate_inline_return_func2(_wchmod, bool, qt_wince_, const wchar_t *, int)
+#endif
generate_inline_return_func7(CreateFileA, HANDLE, LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE)
-generate_inline_return_func4(SetWindowOrgEx, BOOL, HDC, int, int, LPPOINT)
-generate_inline_return_func2(calloc, void *, size_t, size_t)
+generate_inline_return_func4(SetWindowOrgEx, BOOL, qt_wince_, HDC, int, int, LPPOINT)
+generate_inline_return_func2(calloc, void *, qt_wince_, size_t, size_t)
generate_inline_return_func0(GetThreadLocale, DWORD)
generate_inline_return_func3(_beginthread, HANDLE, StartAdressFunc, unsigned, void *)
generate_inline_return_func6(_beginthreadex, unsigned long, void *, unsigned, StartAdressExFunc, void *, unsigned, unsigned *)
diff --git a/src/corelib/kernel/qfunctions_winrt.cpp b/src/corelib/kernel/qfunctions_winrt.cpp
index ea7f2ac671..f8fa19464f 100644
--- a/src/corelib/kernel/qfunctions_winrt.cpp
+++ b/src/corelib/kernel/qfunctions_winrt.cpp
@@ -35,59 +35,10 @@
#ifdef Q_OS_WINRT
-#include "qstring.h"
-#include "qbytearray.h"
-#include "qhash.h"
+#include "qfunctions_fake_env_p.h"
QT_BEGIN_NAMESPACE
-// Environment ------------------------------------------------------
-inline QHash<QByteArray, QByteArray> &qt_app_environment()
-{
- static QHash<QByteArray, QByteArray> internalEnvironment;
- return internalEnvironment;
-}
-
-errno_t qt_winrt_getenv_s(size_t* sizeNeeded, char* buffer, size_t bufferSize, const char* varName)
-{
- if (!sizeNeeded)
- return EINVAL;
-
- if (!qt_app_environment().contains(varName)) {
- if (buffer)
- buffer[0] = '\0';
- return ENOENT;
- }
-
- QByteArray value = qt_app_environment().value(varName);
- if (!value.endsWith('\0')) // win32 guarantees terminated string
- value.append('\0');
-
- if (bufferSize < (size_t)value.size()) {
- *sizeNeeded = value.size();
- return ERANGE;
- }
-
- strcpy(buffer, value.constData());
- return 0;
-}
-
-errno_t qt_winrt__putenv_s(const char* varName, const char* value)
-{
- QByteArray input = value;
- if (input.isEmpty()) {
- if (qt_app_environment().contains(varName))
- qt_app_environment().remove(varName);
- } else {
- // win32 on winrt guarantees terminated string
- if (!input.endsWith('\0'))
- input.append('\0');
- qt_app_environment()[varName] = input;
- }
-
- return 0;
-}
-
void qt_winrt_tzset()
{
}
diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h
index 7efd042456..dc1cbe0ade 100644
--- a/src/corelib/kernel/qfunctions_winrt.h
+++ b/src/corelib/kernel/qfunctions_winrt.h
@@ -40,6 +40,7 @@
#include <QtCore/QThread>
#include <QtCore/QAbstractEventDispatcher>
+#include <QtCore/QElapsedTimer>
#include <QtCore/qt_windows.h>
// Convenience macros for handling HRESULT values
@@ -49,10 +50,20 @@
ret; \
}
+#define RETURN_IF_FAILED_WITH_ARGS(msg, ret, ...) \
+ if (FAILED(hr)) { \
+ qErrnoWarning(hr, msg, __VA_ARGS__); \
+ ret; \
+ }
+
#define RETURN_HR_IF_FAILED(msg) RETURN_IF_FAILED(msg, return hr)
#define RETURN_OK_IF_FAILED(msg) RETURN_IF_FAILED(msg, return S_OK)
#define RETURN_FALSE_IF_FAILED(msg) RETURN_IF_FAILED(msg, return false)
#define RETURN_VOID_IF_FAILED(msg) RETURN_IF_FAILED(msg, return)
+#define RETURN_HR_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return hr, __VA_ARGS__)
+#define RETURN_OK_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return S_OK, __VA_ARGS__)
+#define RETURN_FALSE_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return false, __VA_ARGS__)
+#define RETURN_VOID_IF_FAILED_WITH_ARGS(msg, ...) RETURN_IF_FAILED_WITH_ARGS(msg, return, __VA_ARGS__)
#define Q_ASSERT_SUCCEEDED(hr) \
Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr)));
@@ -65,8 +76,8 @@ QT_BEGIN_NAMESPACE
#endif
// Environment ------------------------------------------------------
-errno_t qt_winrt_getenv_s(size_t*, char*, size_t, const char*);
-errno_t qt_winrt__putenv_s(const char*, const char*);
+errno_t qt_fake_getenv_s(size_t*, char*, size_t, const char*);
+errno_t qt_fake__putenv_s(const char*, const char*);
void qt_winrt_tzset();
void qt_winrt__tzset();
@@ -91,20 +102,20 @@ QT_END_NAMESPACE
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1); \
}
-#define generate_inline_return_func2(funcname, returntype, param1, param2) \
+#define generate_inline_return_func2(funcname, returntype, prependnamespace, param1, param2) \
inline returntype funcname(param1 p1, param2 p2) \
{ \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2); \
+ return QT_PREPEND_NAMESPACE(prependnamespace##funcname)(p1, p2); \
}
#define generate_inline_return_func3(funcname, returntype, param1, param2, param3) \
inline returntype funcname(param1 p1, param2 p2, param3 p3) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3); \
}
-#define generate_inline_return_func4(funcname, returntype, param1, param2, param3, param4) \
+#define generate_inline_return_func4(funcname, returntype, prependnamespace, param1, param2, param3, param4) \
inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
- return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4); \
+ return QT_PREPEND_NAMESPACE(prependnamespace##funcname)(p1, p2, p3, p4); \
}
#define generate_inline_return_func5(funcname, returntype, param1, param2, param3, param4, param5) \
inline returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
@@ -126,8 +137,8 @@ typedef unsigned (__stdcall *StartAdressExFunc)(void *);
typedef void(*StartAdressFunc)(void *);
typedef int ( __cdecl *CompareFunc ) (const void *, const void *) ;
-generate_inline_return_func4(getenv_s, errno_t, size_t *, char *, size_t, const char *)
-generate_inline_return_func2(_putenv_s, errno_t, const char *, const char *)
+generate_inline_return_func4(getenv_s, errno_t, qt_fake_, size_t *, char *, size_t, const char *)
+generate_inline_return_func2(_putenv_s, errno_t, qt_fake_, const char *, const char *)
generate_inline_return_func0(tzset, void)
generate_inline_return_func0(_tzset, void)
@@ -150,7 +161,7 @@ enum AwaitStyle
};
template <typename T>
-static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle)
+static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle, uint timeout)
{
Microsoft::WRL::ComPtr<IAsyncInfo> asyncInfo;
HRESULT hr = asyncOp.As(&asyncInfo);
@@ -158,22 +169,34 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
return hr;
AsyncStatus status;
+ QElapsedTimer t;
+ if (timeout)
+ t.start();
switch (awaitStyle) {
case ProcessMainThreadEvents:
- while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
+ while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) {
QCoreApplication::processEvents();
+ if (timeout && t.hasExpired(timeout))
+ return ERROR_TIMEOUT;
+ }
break;
case ProcessThreadEvents:
if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) {
- while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
+ while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) {
dispatcher->processEvents(QEventLoop::AllEvents);
+ if (timeout && t.hasExpired(timeout))
+ return ERROR_TIMEOUT;
+ }
break;
}
// fall through
default:
case YieldThread:
- while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
+ while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) {
QThread::yieldCurrentThread();
+ if (timeout && t.hasExpired(timeout))
+ return ERROR_TIMEOUT;
+ }
break;
}
@@ -189,9 +212,9 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
}
template <typename T>
-static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle = YieldThread)
+static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle = YieldThread, uint timeout = 0)
{
- HRESULT hr = _await_impl(asyncOp, awaitStyle);
+ HRESULT hr = _await_impl(asyncOp, awaitStyle, timeout);
if (FAILED(hr))
return hr;
@@ -199,9 +222,9 @@ static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle
}
template <typename T, typename U>
-static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results, AwaitStyle awaitStyle = YieldThread)
+static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results, AwaitStyle awaitStyle = YieldThread, uint timeout = 0)
{
- HRESULT hr = _await_impl(asyncOp, awaitStyle);
+ HRESULT hr = _await_impl(asyncOp, awaitStyle, timeout);
if (FAILED(hr))
return hr;
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index 2640ecaaaf..108a01aab7 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -225,6 +225,15 @@ static jfieldID getCachedFieldID(JNIEnv *env,
}
}
+void QJNILocalRefDeleter::cleanup(jobject obj)
+{
+ if (obj == 0)
+ return;
+
+ QJNIEnvironmentPrivate env;
+ env->DeleteLocalRef(obj);
+}
+
class QJNIEnvironmentPrivateTLS
{
public:
@@ -2371,4 +2380,3 @@ bool QJNIObjectPrivate::isSameObject(const QJNIObjectPrivate &other) const
}
QT_END_NAMESPACE
-
diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h
index a32d656ebf..1c23f2ab76 100644
--- a/src/corelib/kernel/qjni_p.h
+++ b/src/corelib/kernel/qjni_p.h
@@ -51,6 +51,14 @@
QT_BEGIN_NAMESPACE
+struct Q_CORE_EXPORT QJNILocalRefDeleter
+{
+ static void cleanup(jobject obj);
+};
+
+// To simplify this we only define it for jobjects.
+typedef QScopedPointer<_jobject, QJNILocalRefDeleter> QJNIScopedLocalRef;
+
class Q_CORE_EXPORT QJNIEnvironmentPrivate
{
public:
diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp
index dad2d5dc1e..0a5a5dffb9 100644
--- a/src/corelib/kernel/qjnihelpers.cpp
+++ b/src/corelib/kernel/qjnihelpers.cpp
@@ -34,6 +34,7 @@
#include "qjnihelpers_p.h"
#include "qmutex.h"
#include "qlist.h"
+#include "qvector.h"
#include <QtCore/qrunnable.h>
QT_BEGIN_NAMESPACE
@@ -57,6 +58,40 @@ static void onAndroidUiThread(JNIEnv *, jclass, jlong thiz)
}
namespace {
+ struct GenericMotionEventListeners {
+ QMutex mutex;
+ QVector<QtAndroidPrivate::GenericMotionEventListener *> listeners;
+ };
+}
+Q_GLOBAL_STATIC(GenericMotionEventListeners, g_genericMotionEventListeners)
+
+static jboolean dispatchGenericMotionEvent(JNIEnv *, jclass, jobject event)
+{
+ jboolean ret = JNI_FALSE;
+ QMutexLocker locker(&g_genericMotionEventListeners()->mutex);
+ foreach (auto listener, g_genericMotionEventListeners()->listeners)
+ ret |= listener->handleGenericMotionEvent(event);
+ return ret;
+}
+
+namespace {
+ struct KeyEventListeners {
+ QMutex mutex;
+ QVector<QtAndroidPrivate::KeyEventListener *> listeners;
+ };
+}
+Q_GLOBAL_STATIC(KeyEventListeners, g_keyEventListeners)
+
+static jboolean dispatchKeyEvent(JNIEnv *, jclass, jobject event)
+{
+ jboolean ret = JNI_FALSE;
+ QMutexLocker locker(&g_keyEventListeners()->mutex);
+ foreach (auto listener, g_keyEventListeners()->listeners)
+ ret |= listener->handleKeyEvent(event);
+ return ret;
+}
+
+namespace {
class ActivityResultListeners
{
public:
@@ -122,6 +157,45 @@ void QtAndroidPrivate::handleNewIntent(JNIEnv *env, jobject intent)
}
}
+namespace {
+ class ResumePauseListeners
+ {
+ public:
+ QMutex mutex;
+ QList<QtAndroidPrivate::ResumePauseListener *> listeners;
+ };
+}
+
+Q_GLOBAL_STATIC(ResumePauseListeners, g_resumePauseListeners)
+
+void QtAndroidPrivate::registerResumePauseListener(ResumePauseListener *listener)
+{
+ QMutexLocker locker(&g_resumePauseListeners()->mutex);
+ g_resumePauseListeners()->listeners.append(listener);
+}
+
+void QtAndroidPrivate::unregisterResumePauseListener(ResumePauseListener *listener)
+{
+ QMutexLocker locker(&g_resumePauseListeners()->mutex);
+ g_resumePauseListeners()->listeners.removeAll(listener);
+}
+
+void QtAndroidPrivate::handlePause()
+{
+ QMutexLocker locker(&g_resumePauseListeners()->mutex);
+ const QList<QtAndroidPrivate::ResumePauseListener *> &listeners = g_resumePauseListeners()->listeners;
+ for (int i=0; i<listeners.size(); ++i)
+ listeners.at(i)->handlePause();
+}
+
+void QtAndroidPrivate::handleResume()
+{
+ QMutexLocker locker(&g_resumePauseListeners()->mutex);
+ const QList<QtAndroidPrivate::ResumePauseListener *> &listeners = g_resumePauseListeners()->listeners;
+ for (int i=0; i<listeners.size(); ++i)
+ listeners.at(i)->handleResume();
+}
+
static inline bool exceptionCheck(JNIEnv *env)
{
if (env->ExceptionCheck()) {
@@ -188,7 +262,9 @@ jint QtAndroidPrivate::initJNI(JavaVM *vm, JNIEnv *env)
g_javaVM = vm;
static const JNINativeMethod methods[] = {
- {"onAndroidUiThread", "(J)V", reinterpret_cast<void *>(onAndroidUiThread)}
+ {"onAndroidUiThread", "(J)V", reinterpret_cast<void *>(onAndroidUiThread)},
+ {"dispatchGenericMotionEvent", "(Landroid/view/MotionEvent;)Z", reinterpret_cast<void *>(dispatchGenericMotionEvent)},
+ {"dispatchKeyEvent", "(Landroid/view/KeyEvent;)Z", reinterpret_cast<void *>(dispatchKeyEvent)},
};
const bool regOk = (env->RegisterNatives(jQtNative, methods, sizeof(methods) / sizeof(methods[0])) == JNI_OK);
@@ -235,4 +311,28 @@ void QtAndroidPrivate::runOnUiThread(QRunnable *runnable, JNIEnv *env)
delete runnable;
}
+void QtAndroidPrivate::registerGenericMotionEventListener(QtAndroidPrivate::GenericMotionEventListener *listener)
+{
+ QMutexLocker locker(&g_genericMotionEventListeners()->mutex);
+ g_genericMotionEventListeners()->listeners.push_back(listener);
+}
+
+void QtAndroidPrivate::unregisterGenericMotionEventListener(QtAndroidPrivate::GenericMotionEventListener *listener)
+{
+ QMutexLocker locker(&g_genericMotionEventListeners()->mutex);
+ g_genericMotionEventListeners()->listeners.removeOne(listener);
+}
+
+void QtAndroidPrivate::registerKeyEventListener(QtAndroidPrivate::KeyEventListener *listener)
+{
+ QMutexLocker locker(&g_keyEventListeners()->mutex);
+ g_keyEventListeners()->listeners.push_back(listener);
+}
+
+void QtAndroidPrivate::unregisterKeyEventListener(QtAndroidPrivate::KeyEventListener *listener)
+{
+ QMutexLocker locker(&g_keyEventListeners()->mutex);
+ g_keyEventListeners()->listeners.removeOne(listener);
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qjnihelpers_p.h b/src/corelib/kernel/qjnihelpers_p.h
index 3ed8338b18..536989b4fc 100644
--- a/src/corelib/kernel/qjnihelpers_p.h
+++ b/src/corelib/kernel/qjnihelpers_p.h
@@ -68,6 +68,28 @@ namespace QtAndroidPrivate
virtual bool handleNewIntent(JNIEnv *env, jobject intent) = 0;
};
+ class Q_CORE_EXPORT ResumePauseListener
+ {
+ public:
+ virtual ~ResumePauseListener() {}
+ virtual void handlePause() {};
+ virtual void handleResume() {};
+ };
+
+ class Q_CORE_EXPORT GenericMotionEventListener
+ {
+ public:
+ virtual ~GenericMotionEventListener() {}
+ virtual bool handleGenericMotionEvent(jobject event) = 0;
+ };
+
+ class Q_CORE_EXPORT KeyEventListener
+ {
+ public:
+ virtual ~KeyEventListener() {}
+ virtual bool handleKeyEvent(jobject event) = 0;
+ };
+
Q_CORE_EXPORT jobject activity();
Q_CORE_EXPORT JavaVM *javaVM();
Q_CORE_EXPORT jint initJNI(JavaVM *vm, JNIEnv *env);
@@ -82,6 +104,17 @@ namespace QtAndroidPrivate
Q_CORE_EXPORT void handleNewIntent(JNIEnv *env, jobject intent);
Q_CORE_EXPORT void registerNewIntentListener(NewIntentListener *listener);
Q_CORE_EXPORT void unregisterNewIntentListener(NewIntentListener *listener);
+
+ Q_CORE_EXPORT void handlePause();
+ Q_CORE_EXPORT void handleResume();
+ Q_CORE_EXPORT void registerResumePauseListener(ResumePauseListener *listener);
+ Q_CORE_EXPORT void unregisterResumePauseListener(ResumePauseListener *listener);
+
+ Q_CORE_EXPORT void registerGenericMotionEventListener(GenericMotionEventListener *listener);
+ Q_CORE_EXPORT void unregisterGenericMotionEventListener(GenericMotionEventListener *listener);
+
+ Q_CORE_EXPORT void registerKeyEventListener(KeyEventListener *listener);
+ Q_CORE_EXPORT void unregisterKeyEventListener(KeyEventListener *listener);
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h
index 5cc3ec586e..e60561c05f 100644
--- a/src/corelib/kernel/qmath.h
+++ b/src/corelib/kernel/qmath.h
@@ -40,8 +40,18 @@
#include <QtCore/qglobal.h>
+#ifndef _USE_MATH_DEFINES
+# define _USE_MATH_DEFINES
+# define undef_USE_MATH_DEFINES
+#endif
+
#include <cmath>
+#ifdef undef_USE_MATH_DEFINES
+# undef _USE_MATH_DEFINES
+# undef undef_USE_MATH_DEFINES
+#endif
+
QT_BEGIN_NAMESPACE
#define QT_SINE_TABLE_SIZE 256
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 1ef5ee0547..820af298c0 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2014 Olivier Goffart <ogoffart@woboq.com>
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -43,7 +43,6 @@
#include <qstringlist.h>
#include <qthread.h>
#include <qvariant.h>
-#include <qhash.h>
#include <qdebug.h>
#include <qsemaphore.h>
@@ -3029,6 +3028,11 @@ QVariant QMetaProperty::read(const QObject *object) const
Writes \a value as the property's value to the given \a object. Returns
true if the write succeeded; otherwise returns \c false.
+ If \a value is not of the same type type as the property, a conversion
+ is attempted. An empty QVariant() is equivalent to a call to reset()
+ if this property is resetable, or setting a default-constructed object
+ otherwise.
+
\sa read(), reset(), isWritable()
*/
bool QMetaProperty::write(QObject *object, const QVariant &value) const
@@ -3069,8 +3073,15 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const
if (t == QMetaType::UnknownType)
return false;
}
- if (t != QMetaType::QVariant && t != (uint)value.userType() && (t < QMetaType::User && !v.convert((QVariant::Type)t)))
- return false;
+ if (t != QMetaType::QVariant && int(t) != value.userType()) {
+ if (!value.isValid()) {
+ if (isResettable())
+ return reset(object);
+ v = QVariant(t, 0);
+ } else if (!v.convert(t)) {
+ return false;
+ }
+ }
}
// the status variable is changed by qt_metacall to indicate what it did
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index b522a211bb..1a282d3261 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -48,7 +48,7 @@ template <typename T> class QList;
class Q_CORE_EXPORT QMetaMethod
{
public:
- Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(0),handle(0) {}
+ Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(Q_NULLPTR), handle(0) {}
QByteArray methodSignature() const;
QByteArray name() const;
@@ -74,7 +74,7 @@ public:
bool invoke(QObject *object,
Qt::ConnectionType connectionType,
QGenericReturnArgument returnValue,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -86,7 +86,7 @@ public:
QGenericArgument val9 = QGenericArgument()) const;
inline bool invoke(QObject *object,
QGenericReturnArgument returnValue,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -102,7 +102,7 @@ public:
}
inline bool invoke(QObject *object,
Qt::ConnectionType connectionType,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -117,7 +117,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
inline bool invoke(QObject *object,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -134,7 +134,7 @@ public:
bool invokeOnGadget(void *gadget,
QGenericReturnArgument returnValue,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -145,7 +145,7 @@ public:
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument()) const;
inline bool invokeOnGadget(void *gadget,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -160,7 +160,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
- inline bool isValid() const { return mobj != 0; }
+ inline bool isValid() const { return mobj != Q_NULLPTR; }
#ifdef Q_QDOC
static QMetaMethod fromSignal(PointerToMemberFunction signal);
@@ -204,7 +204,7 @@ inline bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2)
class Q_CORE_EXPORT QMetaEnum
{
public:
- Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(0),handle(0) {}
+ Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(Q_NULLPTR), handle(0) {}
const char *name() const;
bool isFlag() const;
@@ -215,14 +215,14 @@ public:
const char *scope() const;
- int keyToValue(const char *key, bool *ok = 0) const;
+ int keyToValue(const char *key, bool *ok = Q_NULLPTR) const;
const char* valueToKey(int value) const;
- int keysToValue(const char * keys, bool *ok = 0) const;
+ int keysToValue(const char * keys, bool *ok = Q_NULLPTR) const;
QByteArray valueToKeys(int value) const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
- inline bool isValid() const { return name() != 0; }
+ inline bool isValid() const { return name() != Q_NULLPTR; }
template<typename T> static QMetaEnum fromType() {
Q_STATIC_ASSERT_X(QtPrivate::IsQEnumHelper<T>::Value,
@@ -253,11 +253,11 @@ public:
bool isReadable() const;
bool isWritable() const;
bool isResettable() const;
- bool isDesignable(const QObject *obj = 0) const;
- bool isScriptable(const QObject *obj = 0) const;
- bool isStored(const QObject *obj = 0) const;
- bool isEditable(const QObject *obj = 0) const;
- bool isUser(const QObject *obj = 0) const;
+ bool isDesignable(const QObject *obj = Q_NULLPTR) const;
+ bool isScriptable(const QObject *obj = Q_NULLPTR) const;
+ bool isStored(const QObject *obj = Q_NULLPTR) const;
+ bool isEditable(const QObject *obj = Q_NULLPTR) const;
+ bool isUser(const QObject *obj = Q_NULLPTR) const;
bool isConstant() const;
bool isFinal() const;
@@ -297,7 +297,7 @@ private:
class Q_CORE_EXPORT QMetaClassInfo
{
public:
- Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(0),handle(0) {}
+ Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(Q_NULLPTR), handle(0) {}
const char *name() const;
const char *value() const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index a1b8125121..021e137273 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -88,6 +88,7 @@ static inline Q_DECL_UNUSED const QMetaObjectPrivate *priv(const uint* data)
class QMetaMethodBuilderPrivate
{
public:
+ QMetaMethodBuilderPrivate() {} // for QVector, don't use
QMetaMethodBuilderPrivate
(QMetaMethod::MethodType _methodType,
const QByteArray& _signature,
@@ -139,10 +140,12 @@ public:
return signature.left(qMax(signature.indexOf('('), 0));
}
};
+Q_DECLARE_TYPEINFO(QMetaMethodBuilderPrivate, Q_MOVABLE_TYPE);
class QMetaPropertyBuilderPrivate
{
public:
+ QMetaPropertyBuilderPrivate() {} // for QVector, don't use
QMetaPropertyBuilderPrivate
(const QByteArray& _name, const QByteArray& _type, int notifierIdx=-1,
int _revision = 0)
@@ -176,10 +179,12 @@ public:
flags &= ~f;
}
};
+Q_DECLARE_TYPEINFO(QMetaPropertyBuilderPrivate, Q_MOVABLE_TYPE);
class QMetaEnumBuilderPrivate
{
public:
+ QMetaEnumBuilderPrivate() {} // for QVector, don't use
QMetaEnumBuilderPrivate(const QByteArray& _name)
: name(_name), isFlag(false)
{
@@ -188,8 +193,9 @@ public:
QByteArray name;
bool isFlag;
QList<QByteArray> keys;
- QList<int> values;
+ QVector<int> values;
};
+Q_DECLARE_TYPEINFO(QMetaEnumBuilderPrivate, Q_MOVABLE_TYPE);
class QMetaObjectBuilderPrivate
{
@@ -207,12 +213,12 @@ public:
QByteArray className;
const QMetaObject *superClass;
QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction;
- QList<QMetaMethodBuilderPrivate> methods;
- QList<QMetaMethodBuilderPrivate> constructors;
- QList<QMetaPropertyBuilderPrivate> properties;
+ QVector<QMetaMethodBuilderPrivate> methods;
+ QVector<QMetaMethodBuilderPrivate> constructors;
+ QVector<QMetaPropertyBuilderPrivate> properties;
QList<QByteArray> classInfoNames;
QList<QByteArray> classInfoValues;
- QList<QMetaEnumBuilderPrivate> enumerators;
+ QVector<QMetaEnumBuilderPrivate> enumerators;
QList<const QMetaObject *> relatedMetaObjects;
int flags;
};
@@ -1149,7 +1155,7 @@ void QMetaStringTable::writeBlob(char *out) const
// Returns the sum of all parameters (including return type) for the given
// \a methods. This is needed for calculating the size of the methods'
// parameter type/name meta-data.
-static int aggregateParameterCount(const QList<QMetaMethodBuilderPrivate> &methods)
+static int aggregateParameterCount(const QVector<QMetaMethodBuilderPrivate> &methods)
{
int sum = 0;
for (int i = 0; i < methods.size(); ++i)
@@ -1330,7 +1336,7 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
Q_ASSERT(!buf || dataIndex == pmeta->methodData + d->methods.size() * 5
+ (hasRevisionedMethods ? d->methods.size() : 0));
for (int x = 0; x < 2; ++x) {
- QList<QMetaMethodBuilderPrivate> &methods = (x == 0) ? d->methods : d->constructors;
+ QVector<QMetaMethodBuilderPrivate> &methods = (x == 0) ? d->methods : d->constructors;
for (index = 0; index < methods.size(); ++index) {
QMetaMethodBuilderPrivate *method = &(methods[index]);
QList<QByteArray> paramTypeNames = method->parameterTypes();
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 7fadb66319..e6d745bb74 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -1081,25 +1081,16 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName,
normalizedTypeName.constData(), idx, previousSize, size);
}
- // Do not compare types higher than 0x100:
- // Ignore WasDeclaredAsMetaType inconsitency, to many users were hitting the problem
- // Ignore IsGadget as it was added in Qt 5.5
- // Ignore all the future flags as well
- if ((previousFlags ^ flags) & 0xff) {
- const int maskForTypeInfo = NeedsConstruction | NeedsDestruction | MovableType;
+ // these flags cannot change in a binary compatible way:
+ const int binaryCompatibilityFlag = PointerToQObject | IsEnumeration | SharedPointerToQObject
+ | WeakPointerToQObject | TrackingPointerToQObject;
+ if ((previousFlags ^ flags) & binaryCompatibilityFlag) {
+
const char *msg = "QMetaType::registerType: Binary compatibility break. "
"\nType flags for type '%s' [%i] don't match. Previously "
- "registered TypeFlags(0x%x), now registering TypeFlags(0x%x). "
- "This is an ODR break, which means that your application depends on a C++ undefined behavior."
- "\nHint: %s";
- QT_PREPEND_NAMESPACE(QByteArray) hint;
- if ((previousFlags & maskForTypeInfo) != (flags & maskForTypeInfo)) {
- hint += "\nIt seems that the type was registered at least twice in a different translation units, "
- "but Q_DECLARE_TYPEINFO is not visible from all the translations unit or different flags were used."
- "Remember that Q_DECLARE_TYPEINFO should be declared before QMetaType registration, "
- "preferably it should be placed just after the type declaration and before Q_DECLARE_METATYPE";
- }
- qFatal(msg, normalizedTypeName.constData(), idx, previousFlags, int(flags), hint.constData());
+ "registered TypeFlags(0x%x), now registering TypeFlags(0x%x). ";
+
+ qFatal(msg, normalizedTypeName.constData(), idx, previousFlags, int(flags));
}
return idx;
@@ -1188,9 +1179,6 @@ bool QMetaType::isRegistered(int type)
return ((type >= User) && (ct && ct->count() > type - User) && !ct->at(type - User).typeName.isEmpty());
}
-/*!
- \internal
-*/
template <bool tryNormalizedType>
static inline int qMetaTypeTypeImpl(const char *typeName, int length)
{
@@ -2110,7 +2098,7 @@ const QMetaObject *QMetaType::metaObjectForType(int type)
\warning This function is useful only for registering an alias (typedef)
for every other use case Q_DECLARE_METATYPE and qMetaTypeId() should be used instead.
- \sa qRegisterMetaTypeStreamOperators(), QMetaType::isRegistered(),
+ \sa {QMetaType::}{qRegisterMetaTypeStreamOperators()}, {QMetaType::}{isRegistered()},
Q_DECLARE_METATYPE()
*/
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 1b214e9f74..3b8f8e7166 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -229,7 +229,7 @@ struct AbstractDebugStreamFunction
{
typedef void (*Stream)(const AbstractDebugStreamFunction *, QDebug&, const void *);
typedef void (*Destroy)(AbstractDebugStreamFunction *);
- explicit AbstractDebugStreamFunction(Stream s = 0, Destroy d = 0)
+ explicit AbstractDebugStreamFunction(Stream s = Q_NULLPTR, Destroy d = Q_NULLPTR)
: stream(s), destroy(d) {}
Q_DISABLE_COPY(AbstractDebugStreamFunction)
Stream stream;
@@ -259,7 +259,7 @@ struct AbstractComparatorFunction
typedef bool (*LessThan)(const AbstractComparatorFunction *, const void *, const void *);
typedef bool (*Equals)(const AbstractComparatorFunction *, const void *, const void *);
typedef void (*Destroy)(AbstractComparatorFunction *);
- explicit AbstractComparatorFunction(LessThan lt = 0, Equals e = 0, Destroy d = 0)
+ explicit AbstractComparatorFunction(LessThan lt = Q_NULLPTR, Equals e = Q_NULLPTR, Destroy d = Q_NULLPTR)
: lessThan(lt), equals(e), destroy(d) {}
Q_DISABLE_COPY(AbstractComparatorFunction)
LessThan lessThan;
@@ -296,7 +296,7 @@ template<typename T>
struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
{
BuiltInEqualsComparatorFunction()
- : AbstractComparatorFunction(0, equals, destroy) {}
+ : AbstractComparatorFunction(Q_NULLPTR, equals, destroy) {}
static bool equals(const AbstractComparatorFunction *, const void *l, const void *r)
{
const T *lhs = static_cast<const T *>(l);
@@ -313,7 +313,7 @@ struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
struct AbstractConverterFunction
{
typedef bool (*Converter)(const AbstractConverterFunction *, const void *, void*);
- explicit AbstractConverterFunction(Converter c = 0)
+ explicit AbstractConverterFunction(Converter c = Q_NULLPTR)
: convert(c) {}
Q_DISABLE_COPY(AbstractConverterFunction)
Converter convert;
@@ -510,9 +510,9 @@ public:
static TypeFlags typeFlags(int type);
static const QMetaObject *metaObjectForType(int type);
static bool isRegistered(int type);
- static void *create(int type, const void *copy = 0);
+ static void *create(int type, const void *copy = Q_NULLPTR);
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static void *construct(int type, const void *copy = 0)
+ QT_DEPRECATED static void *construct(int type, const void *copy = Q_NULLPTR)
{ return create(type, copy); }
#endif
static void destroy(int type, void *data);
@@ -533,9 +533,9 @@ public:
inline TypeFlags flags() const;
inline const QMetaObject *metaObject() const;
- inline void *create(const void *copy = 0) const;
+ inline void *create(const void *copy = Q_NULLPTR) const;
inline void destroy(void *data) const;
- inline void *construct(void *where, const void *copy = 0) const;
+ inline void *construct(void *where, const void *copy = Q_NULLPTR) const;
inline void destruct(void *data) const;
public:
@@ -611,7 +611,7 @@ public:
return registerConverterFunction(&f, fromTypeId, toTypeId);
}
- // member function as in "double QString::toDouble(bool *ok = 0) const"
+ // member function as in "double QString::toDouble(bool *ok = Q_NULLPTR) const"
template<typename From, typename To>
static bool registerConverter(To(From::*function)(bool*) const)
{
@@ -674,9 +674,9 @@ private:
uint sizeExtended() const;
QMetaType::TypeFlags flagsExtended() const;
const QMetaObject *metaObjectExtended() const;
- void *createExtended(const void *copy = 0) const;
+ void *createExtended(const void *copy = Q_NULLPTR) const;
void destroyExtended(void *data) const;
- void *constructExtended(void *where, const void *copy = 0) const;
+ void *constructExtended(void *where, const void *copy = Q_NULLPTR) const;
void destructExtended(void *data) const;
static bool registerComparatorFunction(const QtPrivate::AbstractComparatorFunction *f, int type);
@@ -740,6 +740,11 @@ ConverterFunctor<From, To, UnaryFunction>::~ConverterFunctor()
}
+#define QT_METATYPE_PRIVATE_DECLARE_TYPEINFO(C, F) \
+ } \
+ Q_DECLARE_TYPEINFO(QtMetaTypePrivate:: C, (F)); \
+ namespace QtMetaTypePrivate {
+
namespace QtMetaTypePrivate {
template <typename T, bool Accepted = true>
struct QMetaTypeFunctionHelper {
@@ -771,7 +776,7 @@ struct QMetaTypeFunctionHelper {
template <typename T>
struct QMetaTypeFunctionHelper<T, /* Accepted */ false> {
static void Destruct(void *) {}
- static void *Construct(void *, const void *) { return 0; }
+ static void *Construct(void *, const void *) { return Q_NULLPTR; }
#ifndef QT_NO_DATASTREAM
static void Save(QDataStream &, const void *) {}
static void Load(QDataStream &, void *) {}
@@ -1009,7 +1014,7 @@ public:
public:
template<class T> QSequentialIterableImpl(const T*p)
: _iterable(p)
- , _iterator(0)
+ , _iterator(Q_NULLPTR)
, _metaType_id(qMetaTypeId<typename T::value_type>())
, _metaType_flags(QTypeInfo<typename T::value_type>::isPointer)
, _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities)
@@ -1026,20 +1031,20 @@ public:
}
QSequentialIterableImpl()
- : _iterable(0)
- , _iterator(0)
+ : _iterable(Q_NULLPTR)
+ , _iterator(Q_NULLPTR)
, _metaType_id(QMetaType::UnknownType)
, _metaType_flags(0)
, _iteratorCapabilities(0)
- , _size(0)
- , _at(0)
- , _moveToBegin(0)
- , _moveToEnd(0)
- , _advance(0)
- , _get(0)
- , _destroyIter(0)
- , _equalIter(0)
- , _copyIter(0)
+ , _size(Q_NULLPTR)
+ , _at(Q_NULLPTR)
+ , _moveToBegin(Q_NULLPTR)
+ , _moveToEnd(Q_NULLPTR)
+ , _advance(Q_NULLPTR)
+ , _get(Q_NULLPTR)
+ , _destroyIter(Q_NULLPTR)
+ , _equalIter(Q_NULLPTR)
+ , _copyIter(Q_NULLPTR)
{
}
@@ -1067,6 +1072,7 @@ public:
_copyIter(&_iterator, &other._iterator);
}
};
+QT_METATYPE_PRIVATE_DECLARE_TYPEINFO(QSequentialIterableImpl, Q_MOVABLE_TYPE)
template<typename From>
struct QSequentialIterableConvertFunctor
@@ -1195,21 +1201,21 @@ public:
}
QAssociativeIterableImpl()
- : _iterable(0)
+ : _iterable(Q_NULLPTR)
, _metaType_id_key(QMetaType::UnknownType)
, _metaType_flags_key(0)
, _metaType_id_value(QMetaType::UnknownType)
, _metaType_flags_value(0)
- , _size(0)
- , _find(0)
- , _begin(0)
- , _end(0)
- , _advance(0)
- , _getKey(0)
- , _getValue(0)
- , _destroyIter(0)
- , _equalIter(0)
- , _copyIter(0)
+ , _size(Q_NULLPTR)
+ , _find(Q_NULLPTR)
+ , _begin(Q_NULLPTR)
+ , _end(Q_NULLPTR)
+ , _advance(Q_NULLPTR)
+ , _getKey(Q_NULLPTR)
+ , _getValue(Q_NULLPTR)
+ , _destroyIter(Q_NULLPTR)
+ , _equalIter(Q_NULLPTR)
+ , _copyIter(Q_NULLPTR)
{
}
@@ -1234,6 +1240,7 @@ public:
_copyIter(&_iterator, &other._iterator);
}
};
+QT_METATYPE_PRIVATE_DECLARE_TYPEINFO(QAssociativeIterableImpl, Q_MOVABLE_TYPE)
template<typename From>
struct QAssociativeIterableConvertFunctor
@@ -1277,15 +1284,20 @@ public:
}
QPairVariantInterfaceImpl()
- : _pair(0)
- , _getFirst(0)
- , _getSecond(0)
+ : _pair(Q_NULLPTR)
+ , _metaType_id_first(QMetaType::UnknownType)
+ , _metaType_flags_first(0)
+ , _metaType_id_second(QMetaType::UnknownType)
+ , _metaType_flags_second(0)
+ , _getFirst(Q_NULLPTR)
+ , _getSecond(Q_NULLPTR)
{
}
inline VariantData first() const { return _getFirst(&_pair, _metaType_id_first, _metaType_flags_first); }
inline VariantData second() const { return _getSecond(&_pair, _metaType_id_second, _metaType_flags_second); }
};
+QT_METATYPE_PRIVATE_DECLARE_TYPEINFO(QPairVariantInterfaceImpl, Q_MOVABLE_TYPE)
template<typename From>
struct QPairVariantInterfaceConvertFunctor;
@@ -1354,7 +1366,7 @@ namespace QtPrivate
#endif
static no_type checkType(...);
Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
- enum { Value = sizeof(checkType(static_cast<T*>(0))) == sizeof(yes_type) };
+ enum { Value = sizeof(checkType(static_cast<T*>(Q_NULLPTR))) == sizeof(yes_type) };
};
template<typename T, typename Enable = void>
@@ -1391,7 +1403,7 @@ QT_WARNING_POP
template<typename T, typename Enable = void>
struct MetaObjectForType
{
- static inline const QMetaObject *value() { return 0; }
+ static inline const QMetaObject *value() { return Q_NULLPTR; }
};
template<>
struct MetaObjectForType<void>
@@ -1615,7 +1627,7 @@ namespace QtPrivate {
template<typename T>
struct QMetaTypeTypeFlags
{
- enum { Flags = (!QTypeInfo<T>::isStatic ? QMetaType::MovableType : 0)
+ enum { Flags = (QTypeInfoQuery<T>::isRelocatable ? QMetaType::MovableType : 0)
| (QTypeInfo<T>::isComplex ? QMetaType::NeedsConstruction : 0)
| (QTypeInfo<T>::isComplex ? QMetaType::NeedsDestruction : 0)
| (IsPointerToTypeDerivedFromQObject<T>::Value ? QMetaType::PointerToQObject : 0)
@@ -1692,7 +1704,7 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef Q_QDOC
- , T * dummy = 0
+ , T * dummy = Q_NULLPTR
, typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
@@ -1709,7 +1721,7 @@ int qRegisterMetaType(const char *typeName
template <typename T>
void qRegisterMetaTypeStreamOperators(const char *typeName
#ifndef Q_QDOC
- , T * /* dummy */ = 0
+ , T * /* dummy */ = Q_NULLPTR
#endif
)
{
@@ -2095,7 +2107,7 @@ inline QMetaType::QMetaType(const ExtensionFlag extensionFlags, const QMetaTypeI
, m_loadOp(loadOp)
, m_constructor(constructor)
, m_destructor(destructor)
- , m_extension(0)
+ , m_extension(Q_NULLPTR)
, m_size(size)
, m_typeFlags(theTypeFlags)
, m_extensionFlags(extensionFlags)
@@ -2232,21 +2244,6 @@ namespace QtPrivate {
};
}
-namespace QtMetaTypePrivate {
-inline Q_DECL_CONSTEXPR bool isBuiltinSequentialType(int typeId)
-{
- return typeId == qMetaTypeId<QStringList>()
- || typeId == qMetaTypeId<QByteArrayList>()
- || typeId == qMetaTypeId<QVariantList>();
-}
-
-inline Q_DECL_CONSTEXPR bool isBuiltinAssociativeType(int typeId)
-{
- return typeId == qMetaTypeId<QVariantHash>()
- || typeId == qMetaTypeId<QVariantMap>();
-}
-} // QtMetaTypePrivate
-
QT_END_NAMESPACE
#endif // QMETATYPE_H
diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp
index 3e9cdac966..e7bf505ebc 100644
--- a/src/corelib/kernel/qmimedata.cpp
+++ b/src/corelib/kernel/qmimedata.cpp
@@ -354,7 +354,9 @@ void QMimeData::setUrls(const QList<QUrl> &urls)
{
Q_D(QMimeData);
QList<QVariant> list;
- for (int i = 0; i < urls.size(); ++i)
+ const int numUrls = urls.size();
+ list.reserve(numUrls);
+ for (int i = 0; i < numUrls; ++i)
list.append(urls.at(i));
d->setData(QLatin1String("text/uri-list"), list);
@@ -561,7 +563,7 @@ QByteArray QMimeData::data(const QString &mimeType) const
operators must then be registered with the qRegisterMetaTypeStreamOperators()
function.
- \sa hasFormat(), QMetaType, qRegisterMetaTypeStreamOperators()
+ \sa hasFormat(), QMetaType, {QMetaType::}{qRegisterMetaTypeStreamOperators()}
*/
void QMimeData::setData(const QString &mimeType, const QByteArray &data)
{
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index f2c67fb3a0..c316ebc69f 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -47,7 +47,6 @@
#include <qthread.h>
#include <private/qthread_p.h>
#include <qdebug.h>
-#include <qhash.h>
#include <qpair.h>
#include <qvarlengtharray.h>
#include <qset.h>
@@ -66,6 +65,16 @@ QT_BEGIN_NAMESPACE
static int DIRECT_CONNECTION_ONLY = 0;
+
+QDynamicMetaObjectData::~QDynamicMetaObjectData()
+{
+}
+
+QAbstractDynamicMetaObject::~QAbstractDynamicMetaObject()
+{
+}
+
+
struct QSlotObjectBaseDeleter { // for use with QScopedPointer<QSlotObjectBase,...>
static void cleanup(QtPrivate::QSlotObjectBase *slot) {
if (slot) slot->destroyIfLastRef();
@@ -494,6 +503,7 @@ void QMetaCallEvent::placeMetaCall(QObject *object)
\brief Exception-safe wrapper around QObject::blockSignals()
\since 5.3
\ingroup objectmodel
+ \inmodule QtCore
\reentrant
@@ -1209,6 +1219,13 @@ void QObject::setObjectName(const QString &name)
The event() function can be reimplemented to customize the
behavior of an object.
+ Make sure you call the parent event class implementation
+ for all the events you did not handle.
+
+ Example:
+
+ \snippet code/src_corelib_kernel_qobject.cpp 52
+
\sa installEventFilter(), timerEvent(), QCoreApplication::sendEvent(),
QCoreApplication::postEvent()
*/
@@ -1372,7 +1389,7 @@ bool QObject::eventFilter(QObject * /* watched */, QEvent * /* event */)
Signals are not blocked by default.
- \sa blockSignals()
+ \sa blockSignals(), QSignalBlocker
*/
/*!
@@ -1387,7 +1404,7 @@ bool QObject::eventFilter(QObject * /* watched */, QEvent * /* event */)
Signals emitted while being blocked are not buffered.
- \sa signalsBlocked()
+ \sa signalsBlocked(), QSignalBlocker
*/
bool QObject::blockSignals(bool block) Q_DECL_NOTHROW
@@ -3814,7 +3831,7 @@ int QObjectPrivate::signalIndex(const char *signalName,
\b{Note:} Dynamic properties starting with "_q_" are reserved for internal
purposes.
- \sa property(), metaObject(), dynamicPropertyNames()
+ \sa property(), metaObject(), dynamicPropertyNames(), QMetaProperty::write()
*/
bool QObject::setProperty(const char *name, const QVariant &value)
{
@@ -4805,7 +4822,7 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
\note It is not possible to use this overload to diconnect signals
connected to functors or lambda expressions. That is because it is not
- possible to compare them. Instead, use the olverload that take a
+ possible to compare them. Instead, use the overload that takes a
QMetaObject::Connection
\sa connect()
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 5f61dd984f..64c5b58fd4 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -110,23 +110,23 @@ class Q_CORE_EXPORT QObject
Q_DECLARE_PRIVATE(QObject)
public:
- Q_INVOKABLE explicit QObject(QObject *parent=0);
+ Q_INVOKABLE explicit QObject(QObject *parent=Q_NULLPTR);
virtual ~QObject();
virtual bool event(QEvent *);
virtual bool eventFilter(QObject *, QEvent *);
#ifdef Q_QDOC
- static QString tr(const char *sourceText, const char *comment = 0, int n = -1);
- static QString trUtf8(const char *sourceText, const char *comment = 0, int n = -1);
+ static QString tr(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
+ static QString trUtf8(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
virtual const QMetaObject *metaObject() const;
static const QMetaObject staticMetaObject;
#endif
#ifdef QT_NO_TRANSLATION
- static QString tr(const char *sourceText, const char * = 0, int = -1)
+ static QString tr(const char *sourceText, const char * = Q_NULLPTR, int = -1)
{ return QString::fromUtf8(sourceText); }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = 0, int = -1)
+ QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = Q_NULLPTR, int = -1)
{ return QString::fromUtf8(sourceText); }
#endif
#endif //QT_NO_TRANSLATION
@@ -228,7 +228,7 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
- const int *types = 0;
+ const int *types = Q_NULLPTR;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
@@ -268,11 +268,11 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
- const int *types = 0;
+ const int *types = Q_NULLPTR;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
- return connectImpl(sender, reinterpret_cast<void **>(&signal), context, 0,
+ return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
new QtPrivate::QStaticSlotObject<Func2,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
@@ -338,11 +338,11 @@ public:
Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
- const int *types = 0;
+ const int *types = Q_NULLPTR;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
- return connectImpl(sender, reinterpret_cast<void **>(&signal), context, 0,
+ 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),
@@ -354,11 +354,11 @@ public:
const QObject *receiver, const char *member);
static bool disconnect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &member);
- inline bool disconnect(const char *signal = 0,
- const QObject *receiver = 0, const char *member = 0) const
+ inline bool disconnect(const char *signal = Q_NULLPTR,
+ const QObject *receiver = Q_NULLPTR, const char *member = Q_NULLPTR) const
{ return disconnect(this, signal, receiver, member); }
- inline bool disconnect(const QObject *receiver, const char *member = 0) const
- { return disconnect(this, 0, receiver, member); }
+ inline bool disconnect(const QObject *receiver, const char *member = Q_NULLPTR) const
+ { return disconnect(this, Q_NULLPTR, receiver, member); }
static bool disconnect(const QMetaObject::Connection &);
#ifdef Q_QDOC
@@ -385,7 +385,7 @@ public:
static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const QObject *receiver, void **zero)
{
- // This is the overload for when one wish to disconnect a signal from any slot. (slot=0)
+ // This is the overload for when one wish to disconnect a signal from any slot. (slot=Q_NULLPTR)
// Since the function template parameter cannot be deduced from '0', we use a
// dummy void ** parameter that must be equal to 0
Q_ASSERT(!zero);
@@ -412,14 +412,14 @@ public:
#endif // QT_NO_USERDATA
Q_SIGNALS:
- void destroyed(QObject * = 0);
+ void destroyed(QObject * = Q_NULLPTR);
void objectNameChanged(const QString &objectName, QPrivateSignal);
public:
inline QObject *parent() const { return d_ptr->parent; }
inline bool inherits(const char *classname) const
- { return const_cast<QObject *>(this)->qt_metacast(classname) != 0; }
+ { return const_cast<QObject *>(this)->qt_metacast(classname) != Q_NULLPTR; }
public Q_SLOTS:
void deleteLater();
@@ -438,7 +438,7 @@ protected:
virtual void disconnectNotify(const QMetaMethod &signal);
protected:
- QObject(QObjectPrivate &dd, QObject *parent = 0);
+ QObject(QObjectPrivate &dd, QObject *parent = Q_NULLPTR);
protected:
QScopedPointer<QObjectData> d_ptr;
@@ -529,16 +529,16 @@ inline T qobject_cast(const QObject *object)
template <class T> inline const char * qobject_interface_iid()
-{ return 0; }
+{ return Q_NULLPTR; }
#ifndef Q_MOC_RUN
# define Q_DECLARE_INTERFACE(IFace, IId) \
template <> inline const char *qobject_interface_iid<IFace *>() \
{ return IId; } \
template <> inline IFace *qobject_cast<IFace *>(QObject *object) \
- { return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : 0)); } \
+ { return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : Q_NULLPTR)); } \
template <> inline IFace *qobject_cast<IFace *>(const QObject *object) \
- { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0)); }
+ { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : Q_NULLPTR)); }
#endif // Q_MOC_RUN
#ifndef QT_NO_DEBUG_STREAM
@@ -584,7 +584,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked(other.m_blocked),
m_inhibited(other.m_inhibited)
{
- other.m_o = 0;
+ other.m_o = Q_NULLPTR;
}
QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
@@ -598,7 +598,7 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked = other.m_blocked;
m_inhibited = other.m_inhibited;
// disable other:
- other.m_o = 0;
+ other.m_o = Q_NULLPTR;
}
return *this;
}
diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h
index 4d9e42ba76..09d52584c4 100644
--- a/src/corelib/kernel/qobject_impl.h
+++ b/src/corelib/kernel/qobject_impl.h
@@ -90,9 +90,9 @@ namespace QtPrivate {
{ enum { Value = QMetaTypeId2<Arg>::Defined && TypesAreDeclaredMetaType<List<Tail...>>::Value }; };
template <typename ArgList, bool Declared = TypesAreDeclaredMetaType<ArgList>::Value > struct ConnectionTypes
- { static const int *types() { return 0; } };
+ { static const int *types() { return Q_NULLPTR; } };
template <> struct ConnectionTypes<List<>, true>
- { static const int *types() { return 0; } };
+ { static const int *types() { return Q_NULLPTR; } };
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; } };
#endif
@@ -118,10 +118,10 @@ namespace QtPrivate {
inline int ref() Q_DECL_NOTHROW { return m_ref.ref(); }
inline void destroyIfLastRef() Q_DECL_NOTHROW
- { if (!m_ref.deref()) m_impl(Destroy, this, 0, 0, 0); }
+ { if (!m_ref.deref()) m_impl(Destroy, this, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); }
- inline bool compare(void **a) { bool ret; m_impl(Compare, this, 0, a, &ret); return ret; }
- inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, 0); }
+ inline bool compare(void **a) { bool ret; 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:
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 1b64103e40..b0690563d7 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -110,7 +110,7 @@ public:
QVector<QObjectUserData *> userData;
#endif
QList<QByteArray> propertyNames;
- QList<QVariant> propertyValues;
+ QVector<QVariant> propertyValues;
QVector<int> runningTimers;
QList<QPointer<QObject> > eventFilters;
QString objectName;
@@ -406,7 +406,7 @@ void Q_CORE_EXPORT qDeleteInEventHandler(QObject *o);
struct QAbstractDynamicMetaObject;
struct Q_CORE_EXPORT QDynamicMetaObjectData
{
- virtual ~QDynamicMetaObjectData() {}
+ virtual ~QDynamicMetaObjectData();
virtual void objectDestroyed(QObject *) { delete this; }
virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *) = 0;
@@ -415,6 +415,8 @@ struct Q_CORE_EXPORT QDynamicMetaObjectData
struct Q_CORE_EXPORT QAbstractDynamicMetaObject : public QDynamicMetaObjectData, public QMetaObject
{
+ ~QAbstractDynamicMetaObject();
+
virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *) Q_DECL_OVERRIDE { return this; }
virtual int createProperty(const char *, const char *) { return -1; }
virtual int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) Q_DECL_OVERRIDE
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 6484507a12..b1ed971eba 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -78,7 +78,11 @@ class QString;
#define Q_CLASSINFO(name, value)
#define Q_PLUGIN_METADATA(x)
#define Q_INTERFACES(x)
+#ifdef Q_COMPILER_VARIADIC_MACROS
+#define Q_PROPERTY(...)
+#else
#define Q_PROPERTY(text)
+#endif
#define Q_PRIVATE_PROPERTY(d, text)
#define Q_REVISION(v)
#define Q_OVERRIDE(text)
@@ -254,7 +258,7 @@ class QMetaClassInfo;
class Q_CORE_EXPORT QGenericArgument
{
public:
- inline QGenericArgument(const char *aName = 0, const void *aData = 0)
+ inline QGenericArgument(const char *aName = Q_NULLPTR, const void *aData = Q_NULLPTR)
: _data(aData), _name(aName) {}
inline void *data() const { return const_cast<void *>(_data); }
inline const char *name() const { return _name; }
@@ -267,7 +271,7 @@ private:
class Q_CORE_EXPORT QGenericReturnArgument: public QGenericArgument
{
public:
- inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)
+ inline QGenericReturnArgument(const char *aName = Q_NULLPTR, void *aData = Q_NULLPTR)
: QGenericArgument(aName, aData)
{}
};
@@ -347,7 +351,7 @@ struct Q_CORE_EXPORT QMetaObject
// internal index-based connect
static Connection connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
- int type = 0, int *types = 0);
+ int type = 0, int *types = Q_NULLPTR);
// internal index-based disconnect
static bool disconnect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index);
@@ -364,7 +368,7 @@ struct Q_CORE_EXPORT QMetaObject
static bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType,
QGenericReturnArgument ret,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -377,7 +381,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
QGenericReturnArgument ret,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -394,7 +398,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType type,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -410,7 +414,7 @@ struct Q_CORE_EXPORT QMetaObject
}
static inline bool invokeMethod(QObject *obj, const char *member,
- QGenericArgument val0 = QGenericArgument(0),
+ QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -425,7 +429,7 @@ struct Q_CORE_EXPORT QMetaObject
val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
- QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),
+ QObject *newInstance(QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -482,11 +486,11 @@ public:
operator bool() const;
#else
typedef void *Connection::*RestrictedBool;
- operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : 0; }
+ operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : Q_NULLPTR; }
#endif
#ifdef Q_COMPILER_RVALUE_REFS
- inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = 0; }
+ inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = Q_NULLPTR; }
inline Connection &operator=(Connection &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp
index 2c872716d1..f237498f4e 100644
--- a/src/corelib/kernel/qpointer.cpp
+++ b/src/corelib/kernel/qpointer.cpp
@@ -128,6 +128,14 @@
*/
/*!
+ \fn void QPointer::swap(QPointer &other)
+ \since 5.6
+
+ Swaps the contents of this QPointer with the contents of \a other.
+ This operation is very fast and never fails.
+*/
+
+/*!
\fn QPointer<T> & QPointer::operator=(T* p)
Assignment operator. This guarded pointer will now point to the
diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h
index af7c11e4d7..52bd368301 100644
--- a/src/corelib/kernel/qpointer.h
+++ b/src/corelib/kernel/qpointer.h
@@ -35,6 +35,7 @@
#define QPOINTER_H
#include <QtCore/qsharedpointer.h>
+#include <QtCore/qtypeinfo.h>
#ifndef QT_NO_QOBJECT
@@ -45,6 +46,8 @@ class QVariant;
template <class T>
class QPointer
{
+ Q_STATIC_ASSERT_X(!QtPrivate::is_pointer<T>::value, "QPointer's template type must not be a pointer type");
+
template<typename U>
struct TypeSelector
{
@@ -61,7 +64,14 @@ public:
inline QPointer() { }
inline QPointer(T *p) : wp(p, true) { }
// compiler-generated copy/move ctor/assignment operators are fine!
- inline ~QPointer() { }
+ // compiler-generated dtor is fine!
+
+#ifdef Q_QDOC
+ // Stop qdoc from complaining about missing function
+ ~QPointer();
+#endif
+
+ inline void swap(QPointer &other) { wp.swap(other.wp); }
inline QPointer<T> &operator=(T* p)
{ wp.assign(static_cast<QObjectType*>(p)); return *this; }
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index cef0ef0f7d..267cf95814 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -127,8 +127,8 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
specified. Interoperation with non-Qt applications is achieved by first creating
a default shared memory with QSharedMemory() and then setting a native key with
setNativeKey(). When using native keys, shared memory is not protected against
- multiple accesses on it (e.g. unable to lock()) and a user-defined mechanism
- should be used to achieve a such protection.
+ multiple accesses on it (for example, unable to lock()) and a user-defined mechanism
+ should be used to achieve such protection.
*/
/*!
diff --git a/src/corelib/kernel/qsharedmemory.h b/src/corelib/kernel/qsharedmemory.h
index c192910dc7..67558e3348 100644
--- a/src/corelib/kernel/qsharedmemory.h
+++ b/src/corelib/kernel/qsharedmemory.h
@@ -68,8 +68,8 @@ public:
UnknownError
};
- QSharedMemory(QObject *parent = 0);
- QSharedMemory(const QString &key, QObject *parent = 0);
+ QSharedMemory(QObject *parent = Q_NULLPTR);
+ QSharedMemory(const QString &key, QObject *parent = Q_NULLPTR);
~QSharedMemory();
void setKey(const QString &key);
diff --git a/src/corelib/kernel/qsharedmemory_android.cpp b/src/corelib/kernel/qsharedmemory_android.cpp
index cdcd5685e0..12afff5dce 100644
--- a/src/corelib/kernel/qsharedmemory_android.cpp
+++ b/src/corelib/kernel/qsharedmemory_android.cpp
@@ -50,12 +50,12 @@ QSharedMemoryPrivate::QSharedMemoryPrivate()
void QSharedMemoryPrivate::setErrorString(QLatin1String function)
{
Q_UNUSED(function);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
}
key_t QSharedMemoryPrivate::handle()
{
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return 0;
}
@@ -65,7 +65,7 @@ key_t QSharedMemoryPrivate::handle()
int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName)
{
Q_UNUSED(fileName);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return 0;
}
#endif // QT_NO_SHAREDMEMORY && QT_NO_SYSTEMSEMAPHORE
@@ -74,27 +74,27 @@ int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName)
bool QSharedMemoryPrivate::cleanHandle()
{
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return true;
}
bool QSharedMemoryPrivate::create(int size)
{
Q_UNUSED(size);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return false;
}
bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
{
Q_UNUSED(mode);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return false;
}
bool QSharedMemoryPrivate::detach()
{
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return false;
}
diff --git a/src/corelib/kernel/qsharedmemory_systemv.cpp b/src/corelib/kernel/qsharedmemory_systemv.cpp
index 29fee12c0b..0d2eea49e9 100644
--- a/src/corelib/kernel/qsharedmemory_systemv.cpp
+++ b/src/corelib/kernel/qsharedmemory_systemv.cpp
@@ -82,7 +82,7 @@ key_t QSharedMemoryPrivate::handle()
return 0;
}
- unix_key = ftok(QFile::encodeName(nativeKey).constData(), 'Q');
+ unix_key = qt_safe_ftok(QFile::encodeName(nativeKey), 'Q');
if (-1 == unix_key) {
errorString = QSharedMemory::tr("%1: ftok failed").arg(QLatin1String("QSharedMemory::handle:"));
error = QSharedMemory::KeyError;
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 5cc54b1def..f90763d308 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -58,7 +58,7 @@ void QSharedMemoryPrivate::setErrorString(QLatin1String function)
errorString = QSharedMemory::tr("%1: already exists").arg(function);
break;
case ERROR_FILE_NOT_FOUND:
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) || (defined(Q_OS_WINRT) && _MSC_VER < 1900)
// This happens on CE only if no file is present as CreateFileMappingW
// bails out with this error code
case ERROR_INVALID_PARAMETER:
@@ -101,7 +101,11 @@ HANDLE QSharedMemoryPrivate::handle()
Q_UNIMPLEMENTED();
hand = 0;
#elif defined(Q_OS_WINRT)
+#if _MSC_VER >= 1900
+ hand = OpenFileMappingFromApp(FILE_MAP_ALL_ACCESS, FALSE, reinterpret_cast<PCWSTR>(nativeKey.utf16()));
+#else
hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, (PCWSTR)nativeKey.utf16());
+#endif
#elif defined(Q_OS_WINCE)
// This works for opening a mapping too, but always opens it with read/write access in
// attach as it seems.
diff --git a/src/corelib/kernel/qsignalmapper.h b/src/corelib/kernel/qsignalmapper.h
index df2a0a52ea..7aaef6affc 100644
--- a/src/corelib/kernel/qsignalmapper.h
+++ b/src/corelib/kernel/qsignalmapper.h
@@ -45,7 +45,7 @@ class Q_CORE_EXPORT QSignalMapper : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QSignalMapper)
public:
- explicit QSignalMapper(QObject *parent = 0);
+ explicit QSignalMapper(QObject *parent = Q_NULLPTR);
~QSignalMapper();
void setMapping(QObject *sender, int id);
diff --git a/src/corelib/kernel/qsocketnotifier.h b/src/corelib/kernel/qsocketnotifier.h
index 4bafbfa69f..8a7af6ebbc 100644
--- a/src/corelib/kernel/qsocketnotifier.h
+++ b/src/corelib/kernel/qsocketnotifier.h
@@ -47,7 +47,7 @@ class Q_CORE_EXPORT QSocketNotifier : public QObject
public:
enum Type { Read, Write, Exception };
- QSocketNotifier(qintptr socket, Type, QObject *parent = 0);
+ QSocketNotifier(qintptr socket, Type, QObject *parent = Q_NULLPTR);
~QSocketNotifier();
qintptr socket() const;
diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp
index 19d84c2b3e..e333104add 100644
--- a/src/corelib/kernel/qsystemerror.cpp
+++ b/src/corelib/kernel/qsystemerror.cpp
@@ -145,7 +145,7 @@ static QString standardLibraryErrorString(int errorCode)
return ret.trimmed();
}
-QString QSystemError::toString()
+QString QSystemError::toString() const
{
switch(errorScope) {
case NativeError:
diff --git a/src/corelib/kernel/qsystemerror_p.h b/src/corelib/kernel/qsystemerror_p.h
index e7efb9bbf3..29e9e440e4 100644
--- a/src/corelib/kernel/qsystemerror_p.h
+++ b/src/corelib/kernel/qsystemerror_p.h
@@ -62,9 +62,9 @@ public:
inline QSystemError(int error, ErrorScope scope);
inline QSystemError();
- QString toString();
- inline ErrorScope scope();
- inline int error();
+ QString toString() const;
+ inline ErrorScope scope() const;
+ inline int error() const;
//data members
int errorCode;
@@ -83,12 +83,12 @@ QSystemError::QSystemError()
}
-QSystemError::ErrorScope QSystemError::scope()
+QSystemError::ErrorScope QSystemError::scope() const
{
return errorScope;
}
-int QSystemError::error()
+int QSystemError::error() const
{
return errorCode;
}
diff --git a/src/corelib/kernel/qsystemsemaphore_android.cpp b/src/corelib/kernel/qsystemsemaphore_android.cpp
index f501779db9..536b09bb41 100644
--- a/src/corelib/kernel/qsystemsemaphore_android.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_android.cpp
@@ -49,25 +49,25 @@ QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
void QSystemSemaphorePrivate::setErrorString(const QString &function)
{
Q_UNUSED(function);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
}
key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
{
Q_UNUSED(mode);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return -1;
}
void QSystemSemaphorePrivate::cleanHandle()
{
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
}
bool QSystemSemaphorePrivate::modifySemaphore(int count)
{
Q_UNUSED(count);
- qWarning() << Q_FUNC_INFO << "Not yet implemented on Android";
+ Q_UNIMPLEMENTED();
return false;
}
diff --git a/src/corelib/kernel/qsystemsemaphore_systemv.cpp b/src/corelib/kernel/qsystemsemaphore_systemv.cpp
index 32a4bdef51..490de5f9ee 100644
--- a/src/corelib/kernel/qsystemsemaphore_systemv.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_systemv.cpp
@@ -85,7 +85,7 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
createdFile = (1 == built);
// Get the unix key for the created file
- unix_key = ftok(QFile::encodeName(fileName).constData(), 'Q');
+ unix_key = qt_safe_ftok(QFile::encodeName(fileName), 'Q');
if (-1 == unix_key) {
errorString = QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
error = QSystemSemaphore::KeyError;
diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp
index ca55025c2a..89b8a87f2a 100644
--- a/src/corelib/kernel/qsystemsemaphore_win.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_win.cpp
@@ -115,7 +115,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return false;
}
} else {
-#if defined(Q_OS_WINRT)
+#if !defined(Q_OS_WINCE)
if (WAIT_OBJECT_0 != WaitForSingleObjectEx(semaphore, INFINITE, FALSE)) {
#else
if (WAIT_OBJECT_0 != WaitForSingleObject(semaphore, INFINITE)) {
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index b9109a96aa..af9a1be6ab 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -278,15 +278,10 @@ QSingleShotTimer::QSingleShotTimer(int msec, Qt::TimerType timerType, const QObj
{
timerId = startTimer(msec, timerType);
if (r && thread() != r->thread()) {
- // We need the invocation to happen in the receiver object's thread.
- // So, move QSingleShotTimer to the correct thread. Before that occurs, we
- // shall remove the parent from the object.
+ // Avoid leaking the QSingleShotTimer instance in case the application exits before the timer fires
+ connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &QObject::deleteLater);
setParent(0);
moveToThread(r->thread());
-
- // Given we're also parentless now, we should take defence against leaks
- // in case the application quits before we expire.
- connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &QObject::deleteLater);
}
}
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 163ef75291..889f5d7f70 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -53,7 +53,7 @@ class Q_CORE_EXPORT QTimer : public QObject
Q_PROPERTY(Qt::TimerType timerType READ timerType WRITE setTimerType)
Q_PROPERTY(bool active READ isActive)
public:
- explicit QTimer(QObject *parent = 0);
+ explicit QTimer(QObject *parent = Q_NULLPTR);
~QTimer();
inline bool isActive() const { return id >= 0; }
@@ -102,12 +102,16 @@ public:
}
// singleShot to a functor or function pointer (without context)
template <typename Func1>
- static inline void singleShot(int msec, Func1 slot)
+ static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
+ !QtPrivate::is_same<const char*, Func1>::value, void>::Type
+ singleShot(int msec, Func1 slot)
{
singleShot(msec, msec >= 2000 ? Qt::CoarseTimer : Qt::PreciseTimer, Q_NULLPTR, slot);
}
template <typename Func1>
- static inline void singleShot(int msec, Qt::TimerType timerType, Func1 slot)
+ static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
+ !QtPrivate::is_same<const char*, Func1>::value, void>::Type
+ singleShot(int msec, Qt::TimerType timerType, Func1 slot)
{
singleShot(msec, timerType, Q_NULLPTR, slot);
}
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 360c5873d4..794a4aaa0c 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -46,7 +46,6 @@
#include "qfile.h"
#include "qmap.h"
#include "qalgorithms.h"
-#include "qhash.h"
#include "qtranslator_p.h"
#include "qlocale.h"
#include "qendian.h"
diff --git a/src/corelib/kernel/qtranslator.h b/src/corelib/kernel/qtranslator.h
index 1552bbde35..78f714c5c6 100644
--- a/src/corelib/kernel/qtranslator.h
+++ b/src/corelib/kernel/qtranslator.h
@@ -49,11 +49,11 @@ class Q_CORE_EXPORT QTranslator : public QObject
{
Q_OBJECT
public:
- explicit QTranslator(QObject *parent = 0);
+ explicit QTranslator(QObject *parent = Q_NULLPTR);
~QTranslator();
virtual QString translate(const char *context, const char *sourceText,
- const char *disambiguation = 0, int n = -1) const;
+ const char *disambiguation = Q_NULLPTR, int n = -1) const;
virtual bool isEmpty() const;
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 811483d74f..9298093f44 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -413,7 +413,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
QString *str = static_cast<QString *>(result);
switch (d->type) {
case QVariant::Char:
- *str = QString(*v_cast<QChar>(d));
+ *str = *v_cast<QChar>(d);
break;
case QMetaType::Char:
case QMetaType::SChar:
@@ -3451,7 +3451,7 @@ static int numericCompare(const QVariant::Private *d1, const QVariant::Private *
Q_ASSERT(ok);
qreal r2 = qConvertToRealNumber(d2, &ok);
Q_ASSERT(ok);
- if (qFuzzyCompare(r1, r2))
+ if (r1 == r2 || qFuzzyCompare(r1, r2))
return 0;
return r1 < r2 ? -1 : 1;
}
@@ -3835,7 +3835,11 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
/*!
\internal
*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QSequentialIterable::QSequentialIterable(QtMetaTypePrivate::QSequentialIterableImpl impl)
+#else
+QSequentialIterable::QSequentialIterable(const QtMetaTypePrivate::QSequentialIterableImpl &impl)
+#endif
: m_impl(impl)
{
}
@@ -4143,7 +4147,11 @@ QSequentialIterable::const_iterator QSequentialIterable::const_iterator::operato
/*!
\internal
*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QAssociativeIterable::QAssociativeIterable(QtMetaTypePrivate::QAssociativeIterableImpl impl)
+#else
+QAssociativeIterable::QAssociativeIterable(const QtMetaTypePrivate::QAssociativeIterableImpl &impl)
+#endif
: m_impl(impl)
{
}
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 58dfc3aab0..bed0e193db 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -278,14 +278,14 @@ class Q_CORE_EXPORT QVariant
void detach();
inline bool isDetached() const;
- int toInt(bool *ok = 0) const;
- uint toUInt(bool *ok = 0) const;
- qlonglong toLongLong(bool *ok = 0) const;
- qulonglong toULongLong(bool *ok = 0) const;
+ int toInt(bool *ok = Q_NULLPTR) const;
+ uint toUInt(bool *ok = Q_NULLPTR) const;
+ qlonglong toLongLong(bool *ok = Q_NULLPTR) const;
+ qulonglong toULongLong(bool *ok = Q_NULLPTR) const;
bool toBool() const;
- double toDouble(bool *ok = 0) const;
- float toFloat(bool *ok = 0) const;
- qreal toReal(bool *ok = 0) const;
+ double toDouble(bool *ok = Q_NULLPTR) const;
+ float toFloat(bool *ok = Q_NULLPTR) const;
+ qreal toReal(bool *ok = Q_NULLPTR) const;
QByteArray toByteArray() const;
QBitArray toBitArray() const;
QString toString() const;
@@ -364,7 +364,7 @@ class Q_CORE_EXPORT QVariant
struct Private
{
inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
- { data.ptr = 0; }
+ { data.ptr = Q_NULLPTR; }
// Internal constructor for initialized variants.
explicit inline Private(uint variantType) Q_DECL_NOTHROW
@@ -607,7 +607,11 @@ public:
friend struct const_iterator;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
explicit QSequentialIterable(QtMetaTypePrivate::QSequentialIterableImpl impl);
+#else
+ explicit QSequentialIterable(const QtMetaTypePrivate::QSequentialIterableImpl &impl);
+#endif
const_iterator begin() const;
const_iterator end() const;
@@ -660,7 +664,11 @@ public:
friend struct const_iterator;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
explicit QAssociativeIterable(QtMetaTypePrivate::QAssociativeIterableImpl impl);
+#else
+ explicit QAssociativeIterable(const QtMetaTypePrivate::QAssociativeIterableImpl &impl);
+#endif
const_iterator begin() const;
const_iterator end() const;
@@ -742,7 +750,7 @@ namespace QtPrivate {
static QVariantList invoke(const QVariant &v)
{
const int typeId = v.userType();
- if (QtMetaTypePrivate::isBuiltinSequentialType(typeId) || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>())) {
+ if (typeId == qMetaTypeId<QStringList>() || typeId == qMetaTypeId<QByteArrayList>() || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>())) {
QSequentialIterable iter = QVariantValueHelperInterface<QSequentialIterable>::invoke(v);
QVariantList l;
l.reserve(iter.size());
@@ -759,12 +767,12 @@ namespace QtPrivate {
static QVariantHash invoke(const QVariant &v)
{
const int typeId = v.userType();
- if (QtMetaTypePrivate::isBuiltinAssociativeType(typeId) || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) {
+ if (typeId == qMetaTypeId<QVariantMap>() || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) {
QAssociativeIterable iter = QVariantValueHelperInterface<QAssociativeIterable>::invoke(v);
QVariantHash l;
l.reserve(iter.size());
for (QAssociativeIterable::const_iterator it = iter.begin(), end = iter.end(); it != end; ++it)
- l.insert(it.key().toString(), it.value());
+ l.insertMulti(it.key().toString(), it.value());
return l;
}
return QVariantValueHelper<QVariantHash>::invoke(v);
@@ -776,11 +784,11 @@ namespace QtPrivate {
static QVariantMap invoke(const QVariant &v)
{
const int typeId = v.userType();
- if (QtMetaTypePrivate::isBuiltinAssociativeType(typeId) || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) {
+ if (typeId == qMetaTypeId<QVariantHash>() || QMetaType::hasRegisteredConverterFunction(typeId, qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) {
QAssociativeIterable iter = QVariantValueHelperInterface<QAssociativeIterable>::invoke(v);
QVariantMap l;
for (QAssociativeIterable::const_iterator it = iter.begin(), end = iter.end(); it != end; ++it)
- l.insert(it.key().toString(), it.value());
+ l.insertMulti(it.key().toString(), it.value());
return l;
}
return QVariantValueHelper<QVariantMap>::invoke(v);
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 3b30b1286d..337e1406ec 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -58,7 +59,8 @@ template<typename T>
struct QVariantIntegrator
{
static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data)
- && ((!QTypeInfo<T>::isStatic) || Q_IS_ENUM(T));
+ && ((QTypeInfoQuery<T>::isRelocatable) || Q_IS_ENUM(T));
+ typedef QtPrivate::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
};
Q_STATIC_ASSERT(QVariantIntegrator<double>::CanUseInternalSpace);
Q_STATIC_ASSERT(QVariantIntegrator<long int>::CanUseInternalSpace);
@@ -109,31 +111,49 @@ private:
T m_t;
};
-// constructs a new variant if copy is 0, otherwise copy-constructs
template <class T>
-inline void v_construct(QVariant::Private *x, const void *copy, T * = 0)
+inline void v_construct_helper(QVariant::Private *x, const T &t, QtPrivate::true_type)
{
- if (!QVariantIntegrator<T>::CanUseInternalSpace) {
- x->data.shared = copy ? new QVariantPrivateSharedEx<T>(*static_cast<const T *>(copy))
- : new QVariantPrivateSharedEx<T>;
- x->is_shared = true;
- } else {
- if (copy)
- new (&x->data.ptr) T(*static_cast<const T *>(copy));
- else
- new (&x->data.ptr) T;
- }
+ new (&x->data) T(t);
+ x->is_shared = false;
+}
+
+template <class T>
+inline void v_construct_helper(QVariant::Private *x, const T &t, QtPrivate::false_type)
+{
+ x->data.shared = new QVariantPrivateSharedEx<T>(t);
+ x->is_shared = true;
+}
+
+template <class T>
+inline void v_construct_helper(QVariant::Private *x, QtPrivate::true_type)
+{
+ new (&x->data) T();
+ x->is_shared = false;
+}
+
+template <class T>
+inline void v_construct_helper(QVariant::Private *x, QtPrivate::false_type)
+{
+ x->data.shared = new QVariantPrivateSharedEx<T>;
+ x->is_shared = true;
}
template <class T>
inline void v_construct(QVariant::Private *x, const T &t)
{
- if (!QVariantIntegrator<T>::CanUseInternalSpace) {
- x->data.shared = new QVariantPrivateSharedEx<T>(t);
- x->is_shared = true;
- } else {
- new (&x->data.ptr) T(t);
- }
+ // dispatch
+ v_construct_helper(x, t, typename QVariantIntegrator<T>::CanUseInternalSpace_t());
+}
+
+// constructs a new variant if copy is 0, otherwise copy-constructs
+template <class T>
+inline void v_construct(QVariant::Private *x, const void *copy, T * = 0)
+{
+ if (copy)
+ v_construct<T>(x, *static_cast<const T *>(copy));
+ else
+ v_construct_helper<T>(x, typename QVariantIntegrator<T>::CanUseInternalSpace_t());
}
// deletes the internal structures
@@ -327,39 +347,11 @@ protected:
template<class Filter>
class QVariantConstructor
{
- template<typename T, bool CanUseInternalSpace = QVariantIntegrator<T>::CanUseInternalSpace>
- struct CallConstructor {};
-
- template<typename T>
- struct CallConstructor<T, /* CanUseInternalSpace = */ true>
- {
- CallConstructor(const QVariantConstructor &tc)
- {
- if (tc.m_copy)
- new (&tc.m_x->data.ptr) T(*static_cast<const T*>(tc.m_copy));
- else
- new (&tc.m_x->data.ptr) T();
- tc.m_x->is_shared = false;
- }
- };
-
- template<typename T>
- struct CallConstructor<T, /* CanUseInternalSpace = */ false>
- {
- CallConstructor(const QVariantConstructor &tc)
- {
- Q_STATIC_ASSERT(QTypeInfo<T>::isComplex || sizeof(T) > sizeof(QVariant::Private::Data));
- tc.m_x->data.shared = tc.m_copy ? new QVariantPrivateSharedEx<T>(*static_cast<const T*>(tc.m_copy))
- : new QVariantPrivateSharedEx<T>;
- tc.m_x->is_shared = true;
- }
- };
-
template<typename T, bool IsAcceptedType = Filter::template Acceptor<T>::IsAccepted>
struct FilteredConstructor {
FilteredConstructor(const QVariantConstructor &tc)
{
- CallConstructor<T> tmp(tc);
+ v_construct<T>(tc.m_x, tc.m_copy);
tc.m_x->is_null = !tc.m_copy;
}
};
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index 1ef890c46a..fd11dbc787 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -354,9 +354,10 @@ QMimeType QMimeDatabase::mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mo
#ifdef Q_OS_UNIX
// Cannot access statBuf.st_mode from the filesystem engine, so we have to stat again.
+ // In addition we want to follow symlinks.
const QByteArray nativeFilePath = QFile::encodeName(file.fileName());
QT_STATBUF statBuffer;
- if (QT_LSTAT(nativeFilePath.constData(), &statBuffer) == 0) {
+ if (QT_STAT(nativeFilePath.constData(), &statBuffer) == 0) {
if (S_ISCHR(statBuffer.st_mode))
return d->mimeTypeForName(QLatin1String("inode/chardevice"));
if (S_ISBLK(statBuffer.st_mode))
@@ -435,6 +436,7 @@ QList<QMimeType> QMimeDatabase::mimeTypesForFileName(const QString &fileName) co
QStringList matches = d->mimeTypeForFileName(fileName);
QList<QMimeType> mimes;
matches.sort(); // Make it deterministic
+ mimes.reserve(matches.count());
foreach (const QString &mime, matches)
mimes.append(d->mimeTypeForName(mime));
return mimes;
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h
index aa86f607c6..1ac7264a9e 100644
--- a/src/corelib/mimetypes/qmimedatabase_p.h
+++ b/src/corelib/mimetypes/qmimedatabase_p.h
@@ -53,7 +53,6 @@
#include "qmimetype_p.h"
#include "qmimeglobpattern_p.h"
-#include <QtCore/qhash.h>
#include <QtCore/qmutex.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index d26bfd0848..917c29b8d6 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -541,6 +541,7 @@ QList<QMimeType> QMimeBinaryProvider::allMimeTypes()
{
QList<QMimeType> result;
loadMimeTypeList();
+ result.reserve(m_mimetypeNames.count());
for (QSet<QString>::const_iterator it = m_mimetypeNames.constBegin();
it != m_mimetypeNames.constEnd(); ++it)
@@ -567,9 +568,9 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file); // pre-1.3
}
if (mimeFiles.isEmpty()) {
- qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist.";
- qWarning() << "Either it was just removed, or the directory doesn't have executable permission...";
- qWarning() << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);
+ qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist.\n"
+ "Either it was just removed, or the directory doesn't have executable permission..."
+ << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);
return;
}
@@ -577,11 +578,8 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
QString mainPattern;
const QString preferredLanguage = QLocale::system().name();
- QListIterator<QString> mimeFilesIter(mimeFiles);
- mimeFilesIter.toBack();
- while (mimeFilesIter.hasPrevious()) { // global first, then local.
- const QString fullPath = mimeFilesIter.previous();
- QFile qfile(fullPath);
+ for (QStringList::const_reverse_iterator it = mimeFiles.crbegin(), end = mimeFiles.crend(); it != end; ++it) { // global first, then local.
+ QFile qfile(*it);
if (!qfile.open(QFile::ReadOnly))
continue;
@@ -590,7 +588,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
if (xml.name() != QLatin1String("mime-type")) {
continue;
}
- const QString name = xml.attributes().value(QLatin1String("type")).toString();
+ const QStringRef name = xml.attributes().value(QLatin1String("type"));
if (name.isEmpty())
continue;
if (name != data.name) {
@@ -758,7 +756,7 @@ void QMimeXMLProvider::ensureLoaded()
foreach (const QString &packageDir, packageDirs) {
QDir dir(packageDir);
const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);
- //qDebug() << static_cast<const void *>(this) << Q_FUNC_INFO << packageDir << files;
+ //qDebug() << static_cast<const void *>(this) << packageDir << files;
if (!fdoXmlFound)
fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml"));
QStringList::const_iterator endIt(files.constEnd());
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 5398f9358e..e3b01bbb89 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -44,6 +44,7 @@
#include <QtCore/QDebug>
#include <QtCore/QLocale>
+#include <QtCore/QHashFunctions>
#include <memory>
@@ -182,6 +183,18 @@ bool QMimeType::operator==(const QMimeType &other) const
}
/*!
+ \since 5.6
+ \relates QMimeType
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+ */
+uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW
+{
+ return qHash(key.d->name, seed);
+}
+
+/*!
\fn bool QMimeType::operator!=(const QMimeType &other) const;
Returns \c true if \a other does not equal this QMimeType object, otherwise returns \c false.
*/
diff --git a/src/corelib/mimetypes/qmimetype.h b/src/corelib/mimetypes/qmimetype.h
index 13184905b8..6a00541ebc 100644
--- a/src/corelib/mimetypes/qmimetype.h
+++ b/src/corelib/mimetypes/qmimetype.h
@@ -45,8 +45,10 @@
QT_BEGIN_NAMESPACE
class QMimeTypePrivate;
-class QFileinfo;
class QStringList;
+class QMimeType;
+
+Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed = 0) Q_DECL_NOTHROW;
class Q_CORE_EXPORT QMimeType
{
@@ -55,13 +57,9 @@ public:
QMimeType(const QMimeType &other);
QMimeType &operator=(const QMimeType &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QMimeType &operator=(QMimeType &&other)
- {
- qSwap(d, other.d);
- return *this;
- }
+ QMimeType &operator=(QMimeType &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- void swap(QMimeType &other)
+ void swap(QMimeType &other) Q_DECL_NOTHROW
{
qSwap(d, other.d);
}
@@ -101,6 +99,7 @@ protected:
friend class QMimeXMLProvider;
friend class QMimeBinaryProvider;
friend class QMimeTypePrivate;
+ friend Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW;
QExplicitlySharedDataPointer<QMimeTypePrivate> d;
};
diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri
index 338b3d0972..8b64f93467 100644
--- a/src/corelib/plugin/plugin.pri
+++ b/src/corelib/plugin/plugin.pri
@@ -13,6 +13,7 @@ HEADERS += \
plugin/qmachparser_p.h
SOURCES += \
+ plugin/qfactoryinterface.cpp \
plugin/qpluginloader.cpp \
plugin/qfactoryloader.cpp \
plugin/quuid.cpp \
diff --git a/src/corelib/plugin/qfactoryinterface.cpp b/src/corelib/plugin/qfactoryinterface.cpp
new file mode 100644
index 0000000000..0307d58315
--- /dev/null
+++ b/src/corelib/plugin/qfactoryinterface.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 "qfactoryinterface.h"
+
+QT_BEGIN_NAMESPACE
+
+QFactoryInterface::~QFactoryInterface()
+{
+ // must be empty until ### Qt 6
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qfactoryinterface.h b/src/corelib/plugin/qfactoryinterface.h
index e20864cd31..86a46fabfa 100644
--- a/src/corelib/plugin/qfactoryinterface.h
+++ b/src/corelib/plugin/qfactoryinterface.h
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
struct Q_CORE_EXPORT QFactoryInterface
{
- virtual ~QFactoryInterface() {}
+ virtual ~QFactoryInterface();
virtual QStringList keys() const = 0;
};
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index cc5aa1394a..dcf1b1a81d 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -58,7 +58,9 @@ namespace {
// avoid duplicate QStringLiteral data:
inline QString iidKeyLiteral() { return QStringLiteral("IID"); }
+#ifdef QT_SHARED
inline QString versionKeyLiteral() { return QStringLiteral("version"); }
+#endif
inline QString metaDataKeyLiteral() { return QStringLiteral("MetaData"); }
inline QString keysKeyLiteral() { return QStringLiteral("Keys"); }
@@ -77,8 +79,6 @@ public:
QString suffix;
Qt::CaseSensitivity cs;
QStringList loadedPaths;
-
- void unloadPath(const QString &path);
};
QFactoryLoaderPrivate::~QFactoryLoaderPrivate()
@@ -162,8 +162,8 @@ void QFactoryLoader::update()
library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath());
if (!library->isPlugin()) {
if (qt_debug_component()) {
- qDebug() << library->errorString;
- qDebug() << " not a plugin";
+ qDebug() << library->errorString << endl
+ << " not a plugin";
}
library->release();
continue;
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 920e02ae5a..317c1dcdc1 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -337,12 +337,10 @@ static void installCoverageTool(QLibraryPrivate *libPrivate)
if (qt_debug_component()) {
if (ret >= 0) {
- qDebug("%s: coverage data for %s registered",
- Q_FUNC_INFO,
+ qDebug("coverage data for %s registered",
qPrintable(libPrivate->fileName));
} else {
- qWarning("%s: could not register %s: error %d; coverage data may be incomplete",
- Q_FUNC_INFO,
+ qWarning("could not register %s: error %d; coverage data may be incomplete",
qPrintable(libPrivate->fileName),
ret);
}
diff --git a/src/corelib/plugin/qlibrary.h b/src/corelib/plugin/qlibrary.h
index 16bdf79206..77ad107c6f 100644
--- a/src/corelib/plugin/qlibrary.h
+++ b/src/corelib/plugin/qlibrary.h
@@ -59,10 +59,10 @@ public:
Q_FLAG(LoadHint)
Q_FLAG(LoadHints)
- explicit QLibrary(QObject *parent = 0);
- explicit QLibrary(const QString& fileName, QObject *parent = 0);
- explicit QLibrary(const QString& fileName, int verNum, QObject *parent = 0);
- explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = 0);
+ explicit QLibrary(QObject *parent = Q_NULLPTR);
+ explicit QLibrary(const QString& fileName, QObject *parent = Q_NULLPTR);
+ explicit QLibrary(const QString& fileName, int verNum, QObject *parent = Q_NULLPTR);
+ explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = Q_NULLPTR);
~QLibrary();
QFunctionPointer resolve(const char *symbol);
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index c1ce198c84..f5604a24bd 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -124,7 +124,8 @@ bool QLibraryPrivate::load_sys()
SetErrorMode(oldmode);
#endif
if (!pHnd) {
- errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName).arg(qt_error_string());
+ errorString = QLibrary::tr("Cannot load library %1: %2").arg(
+ QDir::toNativeSeparators(fileName)).arg(qt_error_string());
} else {
// Query the actual name of the library that was loaded
errorString.clear();
@@ -148,7 +149,8 @@ bool QLibraryPrivate::load_sys()
bool QLibraryPrivate::unload_sys()
{
if (!FreeLibrary(pHnd)) {
- errorString = QLibrary::tr("Cannot unload library %1: %2").arg(fileName).arg(qt_error_string());
+ errorString = QLibrary::tr("Cannot unload library %1: %2").arg(
+ QDir::toNativeSeparators(fileName)).arg(qt_error_string());
return false;
}
errorString.clear();
@@ -164,7 +166,8 @@ QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
#endif
if (!address) {
errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
- QString::fromLatin1(symbol)).arg(fileName).arg(qt_error_string());
+ QString::fromLatin1(symbol)).arg(
+ QDir::toNativeSeparators(fileName)).arg(qt_error_string());
} else {
errorString.clear();
}
diff --git a/src/corelib/plugin/qplugin.qdoc b/src/corelib/plugin/qplugin.qdoc
index 94f5bc8a30..1b394c4174 100644
--- a/src/corelib/plugin/qplugin.qdoc
+++ b/src/corelib/plugin/qplugin.qdoc
@@ -28,7 +28,7 @@
/*!
\headerfile <QtPlugin>
\title Defining Plugins
- \target qtplugin-defining-plugins
+ \keyword qtplugin-defining-plugins
\ingroup plugins
\brief The <QtPlugin> header file defines macros for defining plugins.
@@ -93,9 +93,9 @@
\macro Q_IMPORT_PLUGIN(PluginName)
\relates <QtPlugin>
- This macro imports the plugin named \a PluginName, corresponding
- to the \l{qmake Variable Reference#TARGET}{TARGET} specified in the
- plugin's project file.
+ This macro imports the plugin named \a PluginName, which corresponds
+ with the name of the class that declares metadata for the plugin with
+ Q_PLUGIN_METADATA().
Inserting this macro into your application's source code will allow
you to make use of a static plugin.
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 988dad1d94..24101be87b 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -273,20 +273,33 @@ bool QPluginLoader::isLoaded() const
#if defined(QT_SHARED)
static QString locatePlugin(const QString& fileName)
{
+ const bool isAbsolute = QDir::isAbsolutePath(fileName);
+ if (isAbsolute) {
+ QFileInfo fi(fileName);
+ if (fi.isFile()) {
+ return fi.canonicalFilePath();
+ }
+ }
QStringList prefixes = QLibraryPrivate::prefixes_sys();
prefixes.prepend(QString());
QStringList suffixes = QLibraryPrivate::suffixes_sys(QString());
suffixes.prepend(QString());
// Split up "subdir/filename"
- const int slash = fileName.lastIndexOf('/');
- const QString baseName = fileName.mid(slash + 1);
- const QString basePath = fileName.left(slash + 1); // keep the '/'
+ const int slash = fileName.lastIndexOf(QLatin1Char('/'));
+ const QStringRef baseName = fileName.midRef(slash + 1);
+ const QStringRef basePath = isAbsolute ? QStringRef() : fileName.leftRef(slash + 1); // keep the '/'
const bool debug = qt_debug_component();
- QStringList paths = QCoreApplication::libraryPaths();
- paths.prepend(QStringLiteral("./")); // search in current dir first
+ QStringList paths;
+ if (isAbsolute) {
+ paths.append(fileName.left(slash)); // don't include the '/'
+ } else {
+ paths = QCoreApplication::libraryPaths();
+ paths.prepend(QStringLiteral(".")); // search in current dir first
+ }
+
foreach (const QString &path, paths) {
foreach (const QString &prefix, prefixes) {
foreach (const QString &suffix, suffixes) {
@@ -337,12 +350,7 @@ void QPluginLoader::setFileName(const QString &fileName)
did_load = false;
}
- QFileInfo fi(fileName);
- QString fn;
- if (fi.isAbsolute())
- fn = fi.canonicalFilePath();
- else
- fn = locatePlugin(fileName);
+ const QString fn = locatePlugin(fileName);
d = QLibraryPrivate::findOrCreate(fn, QString(), lh);
if (!fn.isEmpty())
@@ -427,7 +435,9 @@ QObjectList QPluginLoader::staticInstances()
QObjectList instances;
const StaticPluginList *plugins = staticPluginList();
if (plugins) {
- for (int i = 0; i < plugins->size(); ++i)
+ const int numPlugins = plugins->size();
+ instances.reserve(numPlugins);
+ for (int i = 0; i < numPlugins; ++i)
instances += plugins->at(i).instance();
}
return instances;
diff --git a/src/corelib/plugin/qpluginloader.h b/src/corelib/plugin/qpluginloader.h
index b947e6ed9e..0ab25bbb07 100644
--- a/src/corelib/plugin/qpluginloader.h
+++ b/src/corelib/plugin/qpluginloader.h
@@ -50,8 +50,8 @@ class Q_CORE_EXPORT QPluginLoader : public QObject
Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
Q_PROPERTY(QLibrary::LoadHints loadHints READ loadHints WRITE setLoadHints)
public:
- explicit QPluginLoader(QObject *parent = 0);
- explicit QPluginLoader(const QString &fileName, QObject *parent = 0);
+ explicit QPluginLoader(QObject *parent = Q_NULLPTR);
+ explicit QPluginLoader(const QString &fileName, QObject *parent = Q_NULLPTR);
~QPluginLoader();
QObject *instance();
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 812e2c9fb6..253789b4f0 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -857,7 +857,7 @@ bool QUuid::operator>(const QUuid &other) const Q_DECL_NOTHROW
different variant field, the return value is determined by
comparing the two \l{QUuid::Variant} {variants}.
- \sa variant()
+ \sa {QUuid::}{variant()}
*/
/*!
@@ -871,7 +871,7 @@ bool QUuid::operator>(const QUuid &other) const Q_DECL_NOTHROW
different variant field, the return value is determined by
comparing the two \l{QUuid::Variant} {variants}.
- \sa variant()
+ \sa {QUuid::}{variant()}
*/
/*!
@@ -891,7 +891,7 @@ bool QUuid::operator>(const QUuid &other) const Q_DECL_NOTHROW
\sa variant(), version()
*/
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN)
QT_BEGIN_INCLUDE_NAMESPACE
#include <objbase.h> // For CoCreateGuid
@@ -905,7 +905,7 @@ QUuid QUuid::createUuid()
return result;
}
-#else // !Q_OS_WIN32
+#else // Q_OS_WIN
QT_BEGIN_INCLUDE_NAMESPACE
#include "qdatetime.h"
@@ -963,7 +963,7 @@ QUuid QUuid::createUuid()
{
int *pseed = new int;
static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
- qsrand(*pseed = QDateTime::currentDateTime().toTime_t()
+ qsrand(*pseed = QDateTime::currentDateTimeUtc().toTime_t()
+ quintptr(&pseed)
+ serial.fetchAndAddRelaxed(1));
uuidseed.setLocalData(pseed);
@@ -971,7 +971,7 @@ QUuid QUuid::createUuid()
#else
static bool seeded = false;
if (!seeded)
- qsrand(QDateTime::currentDateTime().toTime_t()
+ qsrand(QDateTime::currentDateTimeUtc().toTime_t()
+ quintptr(&seeded));
#endif
@@ -989,7 +989,7 @@ QUuid QUuid::createUuid()
return result;
}
-#endif // !Q_OS_WIN32
+#endif // !Q_OS_WIN
/*!
\fn bool QUuid::operator==(const GUID &guid) const
diff --git a/src/corelib/qtzlib.pro b/src/corelib/qtzlib.pro
new file mode 100644
index 0000000000..744750fbbe
--- /dev/null
+++ b/src/corelib/qtzlib.pro
@@ -0,0 +1,7 @@
+TARGET = QtZlib
+MODULE = zlib
+MAKEFILE = Makefile.qtzlib
+CONFIG += internal_module header_module alien_syncqt
+QT =
+
+load(qt_module)
diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp
index 543edb2f98..2c412849e8 100644
--- a/src/corelib/statemachine/qabstractstate.cpp
+++ b/src/corelib/statemachine/qabstractstate.cpp
@@ -85,16 +85,6 @@ QAbstractStatePrivate::QAbstractStatePrivate(StateType type)
{
}
-QAbstractStatePrivate *QAbstractStatePrivate::get(QAbstractState *q)
-{
- return q->d_func();
-}
-
-const QAbstractStatePrivate *QAbstractStatePrivate::get(const QAbstractState *q)
-{
- return q->d_func();
-}
-
QStateMachine *QAbstractStatePrivate::machine() const
{
QObject *par = parent;
@@ -227,7 +217,7 @@ bool QAbstractState::active() const
\fn QAbstractState::activeChanged(bool active)
\since 5.4
- This signal is emitted when the active property is changed.
+ This signal is emitted when the active property is changed with \a active as argument.
\sa QAbstractState::active, entered(), exited()
*/
diff --git a/src/corelib/statemachine/qabstractstate.h b/src/corelib/statemachine/qabstractstate.h
index 592c841c18..3aa4b2fabb 100644
--- a/src/corelib/statemachine/qabstractstate.h
+++ b/src/corelib/statemachine/qabstractstate.h
@@ -63,7 +63,7 @@ Q_SIGNALS:
void activeChanged(bool active);
protected:
- QAbstractState(QState *parent = 0);
+ QAbstractState(QState *parent = Q_NULLPTR);
virtual void onEntry(QEvent *event) = 0;
virtual void onExit(QEvent *event) = 0;
diff --git a/src/corelib/statemachine/qabstractstate_p.h b/src/corelib/statemachine/qabstractstate_p.h
index 087e355b71..1eb3cbd420 100644
--- a/src/corelib/statemachine/qabstractstate_p.h
+++ b/src/corelib/statemachine/qabstractstate_p.h
@@ -46,12 +46,13 @@
//
#include <private/qobject_p.h>
+#include <QtCore/qabstractstate.h>
QT_BEGIN_NAMESPACE
class QStateMachine;
-class QAbstractState;
+class QState;
class QAbstractStatePrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QAbstractState)
@@ -66,8 +67,10 @@ public:
QAbstractStatePrivate(StateType type);
- static QAbstractStatePrivate *get(QAbstractState *q);
- static const QAbstractStatePrivate *get(const QAbstractState *q);
+ static QAbstractStatePrivate *get(QAbstractState *q)
+ { return q->d_func(); }
+ static const QAbstractStatePrivate *get(const QAbstractState *q)
+ { return q->d_func(); }
QStateMachine *machine() const;
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index 81b38ea4c4..56f2a15fdb 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -37,6 +37,7 @@
#include "qabstracttransition_p.h"
#include "qabstractstate.h"
+#include "qhistorystate.h"
#include "qstate.h"
#include "qstatemachine.h"
@@ -133,17 +134,14 @@ QAbstractTransitionPrivate::QAbstractTransitionPrivate()
{
}
-QAbstractTransitionPrivate *QAbstractTransitionPrivate::get(QAbstractTransition *q)
-{
- return q->d_func();
-}
-
QStateMachine *QAbstractTransitionPrivate::machine() const
{
- QState *source = sourceState();
- if (!source)
- return 0;
- return source->machine();
+ if (QState *source = sourceState())
+ return source->machine();
+ Q_Q(const QAbstractTransition);
+ if (QHistoryState *parent = qobject_cast<QHistoryState *>(q->parent()))
+ return parent->machine();
+ return 0;
}
bool QAbstractTransitionPrivate::callEventTest(QEvent *e)
@@ -254,26 +252,55 @@ QList<QAbstractState*> QAbstractTransition::targetStates() const
void QAbstractTransition::setTargetStates(const QList<QAbstractState*> &targets)
{
Q_D(QAbstractTransition);
- QList<QPointer<QAbstractState> > copy(d->targetStates);
- bool sameList = true;
+
+ // Verify if any of the new target states is a null-pointer:
for (int i = 0; i < targets.size(); ++i) {
- QAbstractState *target = targets.at(i);
- if (!target) {
+ if (targets.at(i) == Q_NULLPTR) {
qWarning("QAbstractTransition::setTargetStates: target state(s) cannot be null");
return;
+ }
+ }
+
+ // First clean out any target states that got destroyed, but for which we still have a QPointer
+ // around.
+ for (int i = 0; i < d->targetStates.size(); ) {
+ if (d->targetStates.at(i).isNull()) {
+ d->targetStates.remove(i);
} else {
- sameList &= copy.removeOne(target);
+ ++i;
+ }
+ }
+
+ // Easy check: if both lists are empty, we're done.
+ if (targets.isEmpty() && d->targetStates.isEmpty())
+ return;
+
+ bool sameList = true;
+
+ if (targets.size() != d->targetStates.size()) {
+ // If the sizes of the lists are different, we don't need to be smart: they're different. So
+ // we can just set the new list as the targetStates.
+ sameList = false;
+ } else {
+ QVector<QPointer<QAbstractState> > copy(d->targetStates);
+ for (int i = 0; i < targets.size(); ++i) {
+ sameList &= copy.removeOne(targets.at(i));
+ if (!sameList)
+ break; // ok, we now know the lists are not the same, so stop the loop.
}
+
+ sameList &= copy.isEmpty();
}
- sameList &= copy.isEmpty();
+ if (sameList)
+ return;
- d->targetStates.clear();
- for (int i = 0; i < targets.size(); ++i)
- d->targetStates.append(targets.at(i));
+ d->targetStates.resize(targets.size());
+ for (int i = 0; i < targets.size(); ++i) {
+ d->targetStates[i] = targets.at(i);
+ }
- if (!sameList)
- emit targetStatesChanged(QPrivateSignal());
+ emit targetStatesChanged(QPrivateSignal());
}
/*!
diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h
index 475a4dedfc..4398c41ca2 100644
--- a/src/corelib/statemachine/qabstracttransition.h
+++ b/src/corelib/statemachine/qabstracttransition.h
@@ -67,7 +67,7 @@ public:
};
Q_ENUM(TransitionType)
- QAbstractTransition(QState *sourceState = 0);
+ QAbstractTransition(QState *sourceState = Q_NULLPTR);
virtual ~QAbstractTransition();
QState *sourceState() const;
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index 4b0644acd9..ed726fa6ef 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -48,6 +48,7 @@
#include <private/qobject_p.h>
#include <QtCore/qlist.h>
+#include <QtCore/qvector.h>
#include <QtCore/qsharedpointer.h>
QT_BEGIN_NAMESPACE
@@ -64,7 +65,8 @@ class Q_CORE_EXPORT QAbstractTransitionPrivate
public:
QAbstractTransitionPrivate();
- static QAbstractTransitionPrivate *get(QAbstractTransition *q);
+ static QAbstractTransitionPrivate *get(QAbstractTransition *q)
+ { return q->d_func(); }
bool callEventTest(QEvent *e);
virtual void callOnTransition(QEvent *e);
@@ -72,7 +74,7 @@ public:
QStateMachine *machine() const;
void emitTriggered();
- QList<QPointer<QAbstractState> > targetStates;
+ QVector<QPointer<QAbstractState> > targetStates;
QAbstractTransition::TransitionType transitionType;
#ifndef QT_NO_ANIMATION
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index 096d667bc3..de6858ae42 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -102,9 +102,8 @@ QEventTransitionPrivate::QEventTransitionPrivate()
registered = false;
}
-QEventTransitionPrivate *QEventTransitionPrivate::get(QEventTransition *q)
+QEventTransitionPrivate::~QEventTransitionPrivate()
{
- return q->d_func();
}
void QEventTransitionPrivate::unregister()
diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h
index 6909e855b1..5ec3b7bb26 100644
--- a/src/corelib/statemachine/qeventtransition.h
+++ b/src/corelib/statemachine/qeventtransition.h
@@ -49,8 +49,8 @@ class Q_CORE_EXPORT QEventTransition : public QAbstractTransition
Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource)
Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType)
public:
- QEventTransition(QState *sourceState = 0);
- QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = 0);
+ QEventTransition(QState *sourceState = Q_NULLPTR);
+ QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = Q_NULLPTR);
~QEventTransition();
QObject *eventSource() const;
diff --git a/src/corelib/statemachine/qeventtransition_p.h b/src/corelib/statemachine/qeventtransition_p.h
index 59b0fcb30f..3f6c9475ea 100644
--- a/src/corelib/statemachine/qeventtransition_p.h
+++ b/src/corelib/statemachine/qeventtransition_p.h
@@ -55,8 +55,10 @@ class Q_CORE_EXPORT QEventTransitionPrivate : public QAbstractTransitionPrivate
Q_DECLARE_PUBLIC(QEventTransition)
public:
QEventTransitionPrivate();
+ ~QEventTransitionPrivate();
- static QEventTransitionPrivate *get(QEventTransition *q);
+ static QEventTransitionPrivate *get(QEventTransition *q)
+ { return q->d_func(); }
void unregister();
void maybeRegister();
diff --git a/src/corelib/statemachine/qfinalstate.h b/src/corelib/statemachine/qfinalstate.h
index 51c97b1545..2c76e7b6e6 100644
--- a/src/corelib/statemachine/qfinalstate.h
+++ b/src/corelib/statemachine/qfinalstate.h
@@ -46,7 +46,7 @@ class Q_CORE_EXPORT QFinalState : public QAbstractState
{
Q_OBJECT
public:
- QFinalState(QState *parent = 0);
+ QFinalState(QState *parent = Q_NULLPTR);
~QFinalState();
protected:
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index e58b0c16fc..8887ce27e5 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
A history state is a pseudo-state that represents the child state that the
parent state was in the last time the parent state was exited. A transition
- with a history state as its target is in fact a transition to one of the
+ with a history state as its target is in fact a transition to one or more
other child states of the parent state. QHistoryState is part of \l{The
State Machine Framework}.
@@ -79,11 +79,22 @@ QT_BEGIN_NAMESPACE
s1->addTransition(button, SIGNAL(clicked()), s1h);
\endcode
+ If more than one default state has to be entered, or if the transition to the default state(s)
+ has to be acted upon, the defaultTransition should be set instead. Note that the eventTest()
+ method of that transition will never be called: the selection and execution of the transition is
+ done automatically when entering the history state.
+
By default a history state is shallow, meaning that it won't remember nested
states. This can be configured through the historyType property.
*/
/*!
+ \property QHistoryState::defaultTransition
+
+ \brief the default transition of this history state
+*/
+
+/*!
\property QHistoryState::defaultState
\brief the default state of this history state
@@ -113,14 +124,17 @@ QT_BEGIN_NAMESPACE
*/
QHistoryStatePrivate::QHistoryStatePrivate()
- : QAbstractStatePrivate(HistoryState),
- defaultState(0), historyType(QHistoryState::ShallowHistory)
+ : QAbstractStatePrivate(HistoryState)
+ , defaultTransition(0)
+ , historyType(QHistoryState::ShallowHistory)
{
}
-QHistoryStatePrivate *QHistoryStatePrivate::get(QHistoryState *q)
+DefaultStateTransition::DefaultStateTransition(QHistoryState *source, QAbstractState *target)
+ : QAbstractTransition()
{
- return q->d_func();
+ setParent(source);
+ setTargetState(target);
}
/*!
@@ -149,13 +163,44 @@ QHistoryState::~QHistoryState()
}
/*!
+ Returns this history state's default transition. The default transition is
+ taken when the history state has never been entered before. The target states
+ of the default transition therefore make up the default state.
+
+ \since 5.6
+*/
+QAbstractTransition *QHistoryState::defaultTransition() const
+{
+ Q_D(const QHistoryState);
+ return d->defaultTransition;
+}
+
+/*!
+ Sets this history state's default transition to be the given \a transition.
+ This will set the source state of the \a transition to the history state.
+
+ Note that the eventTest method of the \a transition will never be called.
+
+ \since 5.6
+*/
+void QHistoryState::setDefaultTransition(QAbstractTransition *transition)
+{
+ Q_D(QHistoryState);
+ if (d->defaultTransition != transition) {
+ d->defaultTransition = transition;
+ transition->setParent(this);
+ emit defaultTransitionChanged(QHistoryState::QPrivateSignal());
+ }
+}
+
+/*!
Returns this history state's default state. The default state indicates the
state to transition to if the parent state has never been entered before.
*/
QAbstractState *QHistoryState::defaultState() const
{
Q_D(const QHistoryState);
- return d->defaultState;
+ return d->defaultTransition ? d->defaultTransition->targetState() : Q_NULLPTR;
}
/*!
@@ -173,8 +218,15 @@ void QHistoryState::setDefaultState(QAbstractState *state)
"to this history state's group (%p)", state, parentState());
return;
}
- if (d->defaultState != state) {
- d->defaultState = state;
+ if (!d->defaultTransition
+ || d->defaultTransition->targetStates().size() != 1
+ || d->defaultTransition->targetStates().first() != state) {
+ if (!d->defaultTransition || !qobject_cast<DefaultStateTransition*>(d->defaultTransition)) {
+ d->defaultTransition = new DefaultStateTransition(this, state);
+ emit defaultTransitionChanged(QHistoryState::QPrivateSignal());
+ } else {
+ d->defaultTransition->setTargetState(state);
+ }
emit defaultStateChanged(QHistoryState::QPrivateSignal());
}
}
@@ -242,6 +294,15 @@ bool QHistoryState::event(QEvent *e)
\sa QHistoryState::historyType
*/
+/*!
+ \fn QHistoryState::defaultTransitionChanged()
+ \since 5.6
+
+ This signal is emitted when the defaultTransition property is changed.
+
+ \sa QHistoryState::defaultTransition
+*/
+
QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qhistorystate.h b/src/corelib/statemachine/qhistorystate.h
index 549be15ab0..2f2081bf9c 100644
--- a/src/corelib/statemachine/qhistorystate.h
+++ b/src/corelib/statemachine/qhistorystate.h
@@ -41,11 +41,13 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_STATEMACHINE
+class QAbstractTransition;
class QHistoryStatePrivate;
class Q_CORE_EXPORT QHistoryState : public QAbstractState
{
Q_OBJECT
Q_PROPERTY(QAbstractState* defaultState READ defaultState WRITE setDefaultState NOTIFY defaultStateChanged)
+ Q_PROPERTY(QAbstractTransition* defaultTransition READ defaultTransition WRITE setDefaultTransition NOTIFY defaultTransitionChanged)
Q_PROPERTY(HistoryType historyType READ historyType WRITE setHistoryType NOTIFY historyTypeChanged)
public:
enum HistoryType {
@@ -54,10 +56,13 @@ public:
};
Q_ENUM(HistoryType)
- QHistoryState(QState *parent = 0);
- QHistoryState(HistoryType type, QState *parent = 0);
+ QHistoryState(QState *parent = Q_NULLPTR);
+ QHistoryState(HistoryType type, QState *parent = Q_NULLPTR);
~QHistoryState();
+ QAbstractTransition *defaultTransition() const;
+ void setDefaultTransition(QAbstractTransition *transition);
+
QAbstractState *defaultState() const;
void setDefaultState(QAbstractState *state);
@@ -65,6 +70,7 @@ public:
void setHistoryType(HistoryType type);
Q_SIGNALS:
+ void defaultTransitionChanged(QPrivateSignal);
void defaultStateChanged(QPrivateSignal);
void historyTypeChanged(QPrivateSignal);
diff --git a/src/corelib/statemachine/qhistorystate_p.h b/src/corelib/statemachine/qhistorystate_p.h
index b5c353fdff..b0865f7f46 100644
--- a/src/corelib/statemachine/qhistorystate_p.h
+++ b/src/corelib/statemachine/qhistorystate_p.h
@@ -47,11 +47,12 @@
#include "private/qabstractstate_p.h"
+#include <QtCore/qabstracttransition.h>
+#include <QtCore/qhistorystate.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
-class QHistoryState;
class QHistoryStatePrivate : public QAbstractStatePrivate
{
Q_DECLARE_PUBLIC(QHistoryState)
@@ -59,13 +60,31 @@ class QHistoryStatePrivate : public QAbstractStatePrivate
public:
QHistoryStatePrivate();
- static QHistoryStatePrivate *get(QHistoryState *q);
+ static QHistoryStatePrivate *get(QHistoryState *q)
+ { return q->d_func(); }
- QAbstractState *defaultState;
+ QAbstractTransition *defaultTransition;
QHistoryState::HistoryType historyType;
QList<QAbstractState*> configuration;
};
+class DefaultStateTransition: public QAbstractTransition
+{
+ Q_OBJECT
+
+public:
+ DefaultStateTransition(QHistoryState *source, QAbstractState *target);
+
+protected:
+ // It doesn't matter whether this transition matches any event or not. It is always associated
+ // with a QHistoryState, and as soon as the state-machine detects that it enters a history
+ // state, it will handle this transition as a special case. The history state itself is never
+ // entered either: either the stored configuration will be used, or the target(s) of this
+ // transition are used.
+ virtual bool eventTest(QEvent *event) { Q_UNUSED(event); return false; }
+ virtual void onTransition(QEvent *event) { Q_UNUSED(event); }
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index 41005fca41..7ec72df77c 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -108,11 +108,6 @@ QSignalTransitionPrivate::QSignalTransitionPrivate()
signalIndex = -1;
}
-QSignalTransitionPrivate *QSignalTransitionPrivate::get(QSignalTransition *q)
-{
- return q->d_func();
-}
-
void QSignalTransitionPrivate::unregister()
{
Q_Q(QSignalTransition);
diff --git a/src/corelib/statemachine/qsignaltransition.h b/src/corelib/statemachine/qsignaltransition.h
index bc56f4e9b7..c388323ec4 100644
--- a/src/corelib/statemachine/qsignaltransition.h
+++ b/src/corelib/statemachine/qsignaltransition.h
@@ -49,9 +49,9 @@ class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition
Q_PROPERTY(QByteArray signal READ signal WRITE setSignal NOTIFY signalChanged)
public:
- QSignalTransition(QState *sourceState = 0);
+ QSignalTransition(QState *sourceState = Q_NULLPTR);
QSignalTransition(const QObject *sender, const char *signal,
- QState *sourceState = 0);
+ QState *sourceState = Q_NULLPTR);
~QSignalTransition();
QObject *senderObject() const;
diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h
index bed0abd9ff..0bf4b1540b 100644
--- a/src/corelib/statemachine/qsignaltransition_p.h
+++ b/src/corelib/statemachine/qsignaltransition_p.h
@@ -56,7 +56,8 @@ class QSignalTransitionPrivate : public QAbstractTransitionPrivate
public:
QSignalTransitionPrivate();
- static QSignalTransitionPrivate *get(QSignalTransition *q);
+ static QSignalTransitionPrivate *get(QSignalTransition *q)
+ { return q->d_func(); }
void unregister();
void maybeRegister();
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 6e9fb63554..3b84230cb2 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -320,7 +320,7 @@ void QState::addTransition(QAbstractTransition *transition)
}
transition->setParent(this);
- const QList<QPointer<QAbstractState> > &targets = QAbstractTransitionPrivate::get(transition)->targetStates;
+ const QVector<QPointer<QAbstractState> > &targets = QAbstractTransitionPrivate::get(transition)->targetStates;
for (int i = 0; i < targets.size(); ++i) {
QAbstractState *t = targets.at(i).data();
if (!t) {
@@ -518,6 +518,14 @@ QState::ChildMode QState::childMode() const
void QState::setChildMode(ChildMode mode)
{
Q_D(QState);
+
+ if (mode == QState::ParallelStates && d->initialState) {
+ qWarning("QState::setChildMode: setting the child-mode of state %p to "
+ "parallel removes the initial state", this);
+ d->initialState = Q_NULLPTR;
+ emit initialStateChanged(QState::QPrivateSignal());
+ }
+
if (d->childMode != mode) {
d->childMode = mode;
emit childModeChanged(QState::QPrivateSignal());
diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h
index a74c782027..0300a9ef2d 100644
--- a/src/corelib/statemachine/qstate.h
+++ b/src/corelib/statemachine/qstate.h
@@ -66,8 +66,8 @@ public:
};
Q_ENUM(RestorePolicy)
- QState(QState *parent = 0);
- QState(ChildMode childMode, QState *parent = 0);
+ QState(QState *parent = Q_NULLPTR);
+ QState(ChildMode childMode, QState *parent = Q_NULLPTR);
~QState();
QAbstractState *errorState() const;
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 2ce0c13522..3b8dae9499 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -75,6 +75,7 @@ struct QPropertyAssignment
QVariant value;
bool explicitlySet; // false means the property is being restored to its old value
};
+Q_DECLARE_TYPEINFO(QPropertyAssignment, Q_MOVABLE_TYPE);
#endif // QT_NO_PROPERTIES
@@ -108,7 +109,7 @@ public:
mutable QList<QAbstractTransition*> transitionsList;
#ifndef QT_NO_PROPERTIES
- QList<QPropertyAssignment> propertyAssignments;
+ QVector<QPropertyAssignment> propertyAssignments;
#endif
};
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index ee522218ee..63cf7672cf 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -160,6 +160,8 @@ QT_BEGIN_NAMESPACE
\since 5.4
\brief the running state of this state machine
+
+ \sa start(), stop(), started(), stopped(), runningChanged()
*/
#ifndef QT_NO_ANIMATION
@@ -365,9 +367,9 @@ static QList<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *tra
if (!historyConfiguration.isEmpty()) {
// There is a saved history, so apply that.
targets.unite(historyConfiguration.toSet());
- } else if (QAbstractState *defaultState = historyState->defaultState()) {
- // Qt does not support initial transitions, but uses the default state of the history state for this.
- targets.insert(defaultState);
+ } else if (QAbstractTransition *defaultTransition = historyState->defaultTransition()) {
+ // No saved history, take all default transition targets.
+ targets.unite(defaultTransition->targetStates().toSet());
} else {
// Woops, we found a history state without a default state. That's not valid!
QStateMachinePrivate *m = QStateMachinePrivate::get(historyState->machine());
@@ -383,10 +385,6 @@ static QList<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *tra
return targetsList;
}
-template <class T>
-static uint qHash(const QPointer<T> &p)
-{ return qHash(p.data()); }
-
QStateMachinePrivate::QStateMachinePrivate()
{
isMachine = true;
@@ -408,13 +406,10 @@ QStateMachinePrivate::~QStateMachinePrivate()
{
qDeleteAll(internalEventQueue);
qDeleteAll(externalEventQueue);
-}
-QStateMachinePrivate *QStateMachinePrivate::get(QStateMachine *q)
-{
- if (q)
- return q->d_func();
- return 0;
+ for (QHash<int, DelayedEvent>::const_iterator it = delayedEvents.begin(), eit = delayedEvents.end(); it != eit; ++it) {
+ delete it.value().event;
+ }
}
QState *QStateMachinePrivate::rootState() const
@@ -629,7 +624,7 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio
foreach (QAbstractTransition *t1, enabledTransitions) {
bool t1Preempted = false;
- QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(t1, cache);
+ const QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(t1, cache);
QList<QAbstractTransition*>::iterator t2It = filteredTransitions.begin();
while (t2It != filteredTransitions.end()) {
QAbstractTransition *t2 = *t2It;
@@ -641,7 +636,7 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio
}
QSet<QAbstractState*> exitSetT2 = computeExitSet_Unordered(t2, cache);
- if (exitSetT1.intersect(exitSetT2).isEmpty()) {
+ if (!exitSetT1.intersects(exitSetT2)) {
// No conflict, no cry. Next patient please.
++t2It;
} else {
@@ -684,7 +679,7 @@ void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransit
qDebug() << q_func() << ": computed entry set:" << enteredStates;
#endif
- QHash<QAbstractState*, QList<QPropertyAssignment> > assignmentsForEnteredStates =
+ QHash<QAbstractState*, QVector<QPropertyAssignment> > assignmentsForEnteredStates =
computePropertyAssignments(enteredStates, pendingRestorables);
if (!pendingRestorables.isEmpty()) {
// Add "implicit" assignments for restored properties to the first
@@ -795,7 +790,7 @@ QSet<QAbstractState*> QStateMachinePrivate::computeExitSet_Unordered(QAbstractTr
}
void QStateMachinePrivate::exitStates(QEvent *event, const QList<QAbstractState*> &statesToExit_sorted,
- const QHash<QAbstractState*, QList<QPropertyAssignment> > &assignmentsForEnteredStates)
+ const QHash<QAbstractState*, QVector<QPropertyAssignment> > &assignmentsForEnteredStates)
{
for (int i = 0; i < statesToExit_sorted.size(); ++i) {
QAbstractState *s = statesToExit_sorted.at(i);
@@ -943,7 +938,7 @@ QAbstractState *QStateMachinePrivate::getTransitionDomain(QAbstractTransition *t
void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState*> &exitedStates_sorted,
const QList<QAbstractState*> &statesToEnter_sorted,
const QSet<QAbstractState*> &statesForDefaultEntry,
- QHash<QAbstractState*, QList<QPropertyAssignment> > &propertyAssignmentsForState
+ QHash<QAbstractState*, QVector<QPropertyAssignment> > &propertyAssignmentsForState
#ifndef QT_NO_ANIMATION
, const QList<QAbstractAnimation *> &selectedAnimations
#endif
@@ -966,7 +961,7 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState
// Immediately set the properties that are not animated.
{
- QList<QPropertyAssignment> assignments = propertyAssignmentsForState.value(s);
+ QVector<QPropertyAssignment> assignments = propertyAssignmentsForState.value(s);
for (int i = 0; i < assignments.size(); ++i) {
const QPropertyAssignment &assn = assignments.at(i);
if (globalRestorePolicy == QState::RestoreProperties) {
@@ -989,9 +984,16 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState
QAbstractStatePrivate::get(s)->callOnEntry(event);
QAbstractStatePrivate::get(s)->emitEntered();
- if (statesForDefaultEntry.contains(s)) {
- // ### executeContent(s.initial.transition.children())
- }
+
+ // FIXME:
+ // See the "initial transitions" comment in addDescendantStatesToEnter first, then implement:
+// if (statesForDefaultEntry.contains(s)) {
+// // ### executeContent(s.initial.transition.children())
+// }
+ Q_UNUSED(statesForDefaultEntry);
+
+ if (QHistoryState *h = toHistoryState(s))
+ QAbstractTransitionPrivate::get(h->defaultTransition())->callOnTransition(event);
// Emit propertiesAssigned signal if the state has no animated properties.
{
@@ -1052,69 +1054,6 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState
// qDebug() << "configuration:" << configuration.toList();
}
-void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root,
- QSet<QAbstractState*> &statesToEnter,
- QSet<QAbstractState*> &statesForDefaultEntry)
-{
- if (QHistoryState *h = toHistoryState(s)) {
- QList<QAbstractState*> hconf = QHistoryStatePrivate::get(h)->configuration;
- if (!hconf.isEmpty()) {
- for (int k = 0; k < hconf.size(); ++k) {
- QAbstractState *s0 = hconf.at(k);
- addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
- }
-#ifdef QSTATEMACHINE_DEBUG
- qDebug() << q_func() << ": restoring"
- << ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow")
- << "history from" << s << ':' << hconf;
-#endif
- } else {
- QList<QAbstractState*> hlst;
- if (QHistoryStatePrivate::get(h)->defaultState)
- hlst.append(QHistoryStatePrivate::get(h)->defaultState);
-
- if (hlst.isEmpty()) {
- setError(QStateMachine::NoDefaultStateInHistoryStateError, h);
- } else {
- for (int k = 0; k < hlst.size(); ++k) {
- QAbstractState *s0 = hlst.at(k);
- addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
- }
-#ifdef QSTATEMACHINE_DEBUG
- qDebug() << q_func() << ": initial history targets for" << s << ':' << hlst;
-#endif
- }
- }
- } else {
- if (s == rootState()) {
- // Error has already been set by exitStates().
- Q_ASSERT(error != QStateMachine::NoError);
- return;
- }
- statesToEnter.insert(s);
- if (isParallel(s)) {
- QState *grp = toStandardState(s);
- QList<QAbstractState*> lst = QStatePrivate::get(grp)->childStates();
- for (int i = 0; i < lst.size(); ++i) {
- QAbstractState *child = lst.at(i);
- addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry);
- }
- } else if (isCompound(s)) {
- statesForDefaultEntry.insert(s);
- QState *grp = toStandardState(s);
- QAbstractState *initial = grp->initialState();
- if (initial != 0) {
- Q_ASSERT(initial->machine() == q_func());
- addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry);
- } else {
- setError(QStateMachine::NoInitialStateError, grp);
- return;
- }
- }
- addAncestorStatesToEnter(s, root, statesToEnter, statesForDefaultEntry);
- }
-}
-
/* The algorithm as described in http://www.w3.org/TR/2014/WD-scxml-20140529/ has a bug. See
* QTBUG-44963 for details. The algorithm here is as described in
* http://www.w3.org/Voice/2013/scxml-irp/SCXML.htm as of Friday March 13, 2015.
@@ -1165,8 +1104,8 @@ void QStateMachinePrivate::addDescendantStatesToEnter(QAbstractState *state,
#endif
} else {
QList<QAbstractState*> defaultHistoryContent;
- if (QHistoryStatePrivate::get(h)->defaultState)
- defaultHistoryContent.append(QHistoryStatePrivate::get(h)->defaultState);
+ if (QAbstractTransition *t = QHistoryStatePrivate::get(h)->defaultTransition)
+ defaultHistoryContent = t->targetStates();
if (defaultHistoryContent.isEmpty()) {
setError(QStateMachine::NoDefaultStateInHistoryStateError, h);
@@ -1192,8 +1131,10 @@ void QStateMachinePrivate::addDescendantStatesToEnter(QAbstractState *state,
if (QAbstractState *initial = toStandardState(state)->initialState()) {
Q_ASSERT(initial->machine() == q_func());
+ // FIXME:
// Qt does not support initial transitions (which is a problem for parallel states).
// The way it simulates this for other states, is by having a single initial state.
+ // See also the FIXME in enterStates.
statesForDefaultEntry.insert(initial);
addDescendantStatesToEnter(initial, statesToEnter, statesForDefaultEntry);
@@ -1351,7 +1292,7 @@ QVariant QStateMachinePrivate::savedValueForRestorable(const QList<QAbstractStat
QObject *object, const QByteArray &propertyName) const
{
#ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG
- qDebug() << q_func() << ": savedValueForRestorable(" << exitedStates_sorted << object << propertyName << ")";
+ qDebug() << q_func() << ": savedValueForRestorable(" << exitedStates_sorted << object << propertyName << ')';
#endif
for (int i = exitedStates_sorted.size() - 1; i >= 0; --i) {
QAbstractState *s = exitedStates_sorted.at(i);
@@ -1374,7 +1315,7 @@ void QStateMachinePrivate::registerRestorable(QAbstractState *state, QObject *ob
const QVariant &value)
{
#ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG
- qDebug() << q_func() << ": registerRestorable(" << state << object << propertyName << value << ")";
+ qDebug() << q_func() << ": registerRestorable(" << state << object << propertyName << value << ')';
#endif
RestorableId id(object, propertyName);
QHash<RestorableId, QVariant> &restorables = registeredRestorablesForState[state];
@@ -1390,7 +1331,7 @@ void QStateMachinePrivate::unregisterRestorables(const QList<QAbstractState *> &
const QByteArray &propertyName)
{
#ifdef QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG
- qDebug() << q_func() << ": unregisterRestorables(" << states << object << propertyName << ")";
+ qDebug() << q_func() << ": unregisterRestorables(" << states << object << propertyName << ')';
#endif
RestorableId id(object, propertyName);
for (int i = 0; i < states.size(); ++i) {
@@ -1413,9 +1354,9 @@ void QStateMachinePrivate::unregisterRestorables(const QList<QAbstractState *> &
}
}
-QList<QPropertyAssignment> QStateMachinePrivate::restorablesToPropertyList(const QHash<RestorableId, QVariant> &restorables) const
+QVector<QPropertyAssignment> QStateMachinePrivate::restorablesToPropertyList(const QHash<RestorableId, QVariant> &restorables) const
{
- QList<QPropertyAssignment> result;
+ QVector<QPropertyAssignment> result;
QHash<RestorableId, QVariant>::const_iterator it;
for (it = restorables.constBegin(); it != restorables.constEnd(); ++it) {
const RestorableId &id = it.key();
@@ -1470,16 +1411,16 @@ QHash<QStateMachinePrivate::RestorableId, QVariant> QStateMachinePrivate::comput
properties that should not be restored because they are assigned by an
entered state).
*/
-QHash<QAbstractState*, QList<QPropertyAssignment> > QStateMachinePrivate::computePropertyAssignments(
+QHash<QAbstractState*, QVector<QPropertyAssignment> > QStateMachinePrivate::computePropertyAssignments(
const QList<QAbstractState*> &statesToEnter_sorted, QHash<RestorableId, QVariant> &pendingRestorables) const
{
- QHash<QAbstractState*, QList<QPropertyAssignment> > assignmentsForState;
+ QHash<QAbstractState*, QVector<QPropertyAssignment> > assignmentsForState;
for (int i = 0; i < statesToEnter_sorted.size(); ++i) {
QState *s = toStandardState(statesToEnter_sorted.at(i));
if (!s)
continue;
- QList<QPropertyAssignment> &assignments = QStatePrivate::get(s)->propertyAssignments;
+ QVector<QPropertyAssignment> &assignments = QStatePrivate::get(s)->propertyAssignments;
for (int j = 0; j < assignments.size(); ++j) {
const QPropertyAssignment &assn = assignments.at(j);
if (assn.objectDeleted()) {
@@ -1556,8 +1497,11 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": entering error state" << currentErrorState << "from" << currentContext;
#endif
- QState *lca = findLCA(QList<QAbstractState*>() << currentErrorState << currentContext);
- addStatesToEnter(currentErrorState, lca, pendingErrorStates, pendingErrorStatesForDefaultEntry);
+ pendingErrorStates.insert(currentErrorState);
+ addDescendantStatesToEnter(currentErrorState, pendingErrorStates, pendingErrorStatesForDefaultEntry);
+ addAncestorStatesToEnter(currentErrorState, rootState(), pendingErrorStates, pendingErrorStatesForDefaultEntry);
+ foreach (QAbstractState *s, configuration)
+ pendingErrorStates.remove(s);
} else {
qWarning("Unrecoverable error detected in running state machine: %s",
qPrintable(errorString));
@@ -1652,7 +1596,7 @@ QList<QAbstractAnimation *> QStateMachinePrivate::selectAnimations(const QList<Q
}
void QStateMachinePrivate::terminateActiveAnimations(QAbstractState *state,
- const QHash<QAbstractState*, QList<QPropertyAssignment> > &assignmentsForEnteredStates)
+ const QHash<QAbstractState*, QVector<QPropertyAssignment> > &assignmentsForEnteredStates)
{
Q_Q(QStateMachine);
QList<QAbstractAnimation*> animations = animationsForState.take(state);
@@ -1677,9 +1621,9 @@ void QStateMachinePrivate::terminateActiveAnimations(QAbstractState *state,
// If there is no property assignment that sets this property,
// set the property to its target value.
bool found = false;
- QHash<QAbstractState*, QList<QPropertyAssignment> >::const_iterator it;
+ QHash<QAbstractState*, QVector<QPropertyAssignment> >::const_iterator it;
for (it = assignmentsForEnteredStates.constBegin(); it != assignmentsForEnteredStates.constEnd(); ++it) {
- const QList<QPropertyAssignment> &assignments = it.value();
+ const QVector<QPropertyAssignment> &assignments = it.value();
for (int j = 0; j < assignments.size(); ++j) {
if (assignments.at(j).hasTarget(assn.object, assn.propertyName)) {
found = true;
@@ -1697,15 +1641,15 @@ void QStateMachinePrivate::terminateActiveAnimations(QAbstractState *state,
void QStateMachinePrivate::initializeAnimations(QAbstractState *state, const QList<QAbstractAnimation *> &selectedAnimations,
const QList<QAbstractState*> &exitedStates_sorted,
- QHash<QAbstractState*, QList<QPropertyAssignment> > &assignmentsForEnteredStates)
+ QHash<QAbstractState*, QVector<QPropertyAssignment> > &assignmentsForEnteredStates)
{
Q_Q(QStateMachine);
if (!assignmentsForEnteredStates.contains(state))
return;
- QList<QPropertyAssignment> &assignments = assignmentsForEnteredStates[state];
+ QVector<QPropertyAssignment> &assignments = assignmentsForEnteredStates[state];
for (int i = 0; i < selectedAnimations.size(); ++i) {
QAbstractAnimation *anim = selectedAnimations.at(i);
- QList<QPropertyAssignment>::iterator it;
+ QVector<QPropertyAssignment>::iterator it;
for (it = assignments.begin(); it != assignments.end(); ) {
QPair<QList<QAbstractAnimation*>, QList<QAbstractAnimation*> > ret;
const QPropertyAssignment &assn = *it;
@@ -1864,7 +1808,7 @@ void QStateMachinePrivate::_q_start()
QSet<QAbstractState*> statesForDefaultEntry;
QList<QAbstractState*> enteredStates = computeEntrySet(transitions, statesForDefaultEntry, &calculationCache);
QHash<RestorableId, QVariant> pendingRestorables;
- QHash<QAbstractState*, QList<QPropertyAssignment> > assignmentsForEnteredStates =
+ QHash<QAbstractState*, QVector<QPropertyAssignment> > assignmentsForEnteredStates =
computePropertyAssignments(enteredStates, pendingRestorables);
#ifndef QT_NO_ANIMATION
QList<QAbstractAnimation*> selectedAnimations = selectAnimations(transitions);
@@ -1894,6 +1838,7 @@ void QStateMachinePrivate::_q_start()
unregisterAllTransitions();
emitFinished();
emit q->runningChanged(false);
+ exitInterpreter();
} else {
_q_process();
}
@@ -1990,6 +1935,8 @@ void QStateMachinePrivate::_q_process()
break;
}
endMacrostep(didChange);
+ if (stopProcessingReason == Finished)
+ exitInterpreter();
}
void QStateMachinePrivate::_q_startDelayedEventTimer(int id, int delay)
@@ -2003,6 +1950,7 @@ void QStateMachinePrivate::_q_startDelayedEventTimer(int id, int delay)
e.timerId = q->startTimer(delay);
if (!e.timerId) {
qWarning("QStateMachine::postDelayedEvent: failed to start timer (id=%d, delay=%d)", id, delay);
+ delete e.event;
delayedEvents.erase(it);
delayedEventIdFreeList.release(id);
} else {
@@ -2099,23 +2047,6 @@ void QStateMachinePrivate::cancelAllDelayedEvents()
delayedEvents.clear();
}
-void QStateMachinePrivate::emitStateFinished(QState *forState, QFinalState *guiltyState)
-{
- Q_UNUSED(guiltyState);
- Q_ASSERT(guiltyState);
-
-#ifdef QSTATEMACHINE_DEBUG
- Q_Q(QStateMachine);
- qDebug() << q << ": emitting finished signal for" << forState;
-#endif
-
- QStatePrivate::get(forState)->emitFinished();
-}
-
-void QStateMachinePrivate::startupHook()
-{
-}
-
/*
This function is called when the state machine is performing no
microstep because no transition is enabled (i.e. an event is ignored).
@@ -2136,6 +2067,8 @@ void QStateMachinePrivate::noMicrostep()
4) the state machine either enters an infinite loop, or stops (runningChanged(false),
and either finished or stopped are emitted), or processedPendingEvents() is called.
5) if the machine is not in an infinite loop endMacrostep is called
+ 6) when the machine is finished and all processing (like signal emission) is done,
+ exitInterpreter() is called. (This is the same name as the SCXML specification uses.)
didChange is set to true if at least one microstep was performed, it is possible
that the machine returned to exactly the same state as before, but some transitions
@@ -2156,6 +2089,27 @@ void QStateMachinePrivate::endMacrostep(bool didChange)
Q_UNUSED(didChange);
}
+void QStateMachinePrivate::exitInterpreter()
+{
+}
+
+void QStateMachinePrivate::emitStateFinished(QState *forState, QFinalState *guiltyState)
+{
+ Q_UNUSED(guiltyState);
+ Q_ASSERT(guiltyState);
+
+#ifdef QSTATEMACHINE_DEBUG
+ Q_Q(QStateMachine);
+ qDebug() << q << ": emitting finished signal for" << forState;
+#endif
+
+ QStatePrivate::get(forState)->emitFinished();
+}
+
+void QStateMachinePrivate::startupHook()
+{
+}
+
namespace _QStateMachine_Internal{
class GoToStateTransition : public QAbstractTransition
@@ -2455,6 +2409,7 @@ void QStateMachinePrivate::handleTransitionSignal(QObject *sender, int signalInd
QMetaMethod method = meta->method(signalIndex);
int argc = method.parameterCount();
QList<QVariant> vargs;
+ vargs.reserve(argc);
for (int i = 0; i < argc; ++i) {
int type = method.parameterType(i);
vargs.append(QVariant(type, argv[i+1]));
@@ -2638,11 +2593,6 @@ void QStateMachine::removeState(QAbstractState *state)
state->setParent(0);
}
-/*!
- Returns whether this state machine is running.
-
- \sa start(), stop()
-*/
bool QStateMachine::isRunning() const
{
Q_D(const QStateMachine);
@@ -2705,11 +2655,6 @@ void QStateMachine::stop()
}
}
-/*!
- Convenience functions to start/stop this state machine.
-
- \sa start(), stop(), started(), finished(), stopped()
-*/
void QStateMachine::setRunning(bool running)
{
if (running)
@@ -3274,7 +3219,7 @@ QStateMachine::WrappedEvent::~WrappedEvent()
\fn QStateMachine::runningChanged(bool running)
\since 5.4
- This signal is emitted when the running property is changed.
+ This signal is emitted when the running property is changed with \a running as argument.
\sa QStateMachine::running
*/
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index d6c3b7bfa7..5fca034386 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -104,8 +104,8 @@ public:
NoCommonAncestorForTransitionError
};
- explicit QStateMachine(QObject *parent = 0);
- explicit QStateMachine(QState::ChildMode childMode, QObject *parent = 0);
+ explicit QStateMachine(QObject *parent = Q_NULLPTR);
+ explicit QStateMachine(QState::ChildMode childMode, QObject *parent = Q_NULLPTR);
~QStateMachine();
void addState(QAbstractState *state);
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index 426f2732df..45c6dfcb33 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -99,7 +99,8 @@ public:
QStateMachinePrivate();
~QStateMachinePrivate();
- static QStateMachinePrivate *get(QStateMachine *q);
+ static QStateMachinePrivate *get(QStateMachine *q)
+ { return q ? q->d_func() : 0; }
QState *findLCA(const QList<QAbstractState*> &states, bool onlyCompound = false) const;
QState *findLCCA(const QList<QAbstractState*> &states) const;
@@ -132,16 +133,17 @@ public:
virtual void processedPendingEvents(bool didChange);
virtual void beginMacrostep();
virtual void endMacrostep(bool didChange);
- void exitStates(QEvent *event, const QList<QAbstractState *> &statesToExit_sorted,
- const QHash<QAbstractState*, QList<QPropertyAssignment> > &assignmentsForEnteredStates);
+ virtual void exitInterpreter();
+ virtual void exitStates(QEvent *event, const QList<QAbstractState *> &statesToExit_sorted,
+ const QHash<QAbstractState*, QVector<QPropertyAssignment> > &assignmentsForEnteredStates);
QList<QAbstractState*> computeExitSet(const QList<QAbstractTransition*> &enabledTransitions, CalculationCache *cache);
QSet<QAbstractState*> computeExitSet_Unordered(const QList<QAbstractTransition*> &enabledTransitions, CalculationCache *cache);
QSet<QAbstractState*> computeExitSet_Unordered(QAbstractTransition *t, CalculationCache *cache);
void executeTransitionContent(QEvent *event, const QList<QAbstractTransition*> &transitionList);
- void enterStates(QEvent *event, const QList<QAbstractState*> &exitedStates_sorted,
- const QList<QAbstractState*> &statesToEnter_sorted,
- const QSet<QAbstractState*> &statesForDefaultEntry,
- QHash<QAbstractState *, QList<QPropertyAssignment> > &propertyAssignmentsForState
+ virtual void enterStates(QEvent *event, const QList<QAbstractState*> &exitedStates_sorted,
+ const QList<QAbstractState*> &statesToEnter_sorted,
+ const QSet<QAbstractState*> &statesForDefaultEntry,
+ QHash<QAbstractState *, QVector<QPropertyAssignment> > &propertyAssignmentsForState
#ifndef QT_NO_ANIMATION
, const QList<QAbstractAnimation*> &selectedAnimations
#endif
@@ -154,9 +156,6 @@ public:
void addDescendantStatesToEnter(QAbstractState *state,
QSet<QAbstractState*> &statesToEnter,
QSet<QAbstractState*> &statesForDefaultEntry);
- void addStatesToEnter(QAbstractState *s, QState *root,
- QSet<QAbstractState*> &statesToEnter,
- QSet<QAbstractState*> &statesForDefaultEntry);
void addAncestorStatesToEnter(QAbstractState *s, QAbstractState *ancestor,
QSet<QAbstractState*> &statesToEnter,
QSet<QAbstractState*> &statesForDefaultEntry);
@@ -232,9 +231,9 @@ public:
const QVariant &value);
void unregisterRestorables(const QList<QAbstractState*> &states, QObject *object,
const QByteArray &propertyName);
- QList<QPropertyAssignment> restorablesToPropertyList(const QHash<RestorableId, QVariant> &restorables) const;
+ QVector<QPropertyAssignment> restorablesToPropertyList(const QHash<RestorableId, QVariant> &restorables) const;
QHash<RestorableId, QVariant> computePendingRestorables(const QList<QAbstractState*> &statesToExit_sorted) const;
- QHash<QAbstractState*, QList<QPropertyAssignment> > computePropertyAssignments(
+ QHash<QAbstractState*, QVector<QPropertyAssignment> > computePropertyAssignments(
const QList<QAbstractState*> &statesToEnter_sorted,
QHash<RestorableId, QVariant> &pendingRestorables) const;
#endif
@@ -275,10 +274,10 @@ public:
QList<QAbstractAnimation *> selectAnimations(const QList<QAbstractTransition *> &transitionList) const;
void terminateActiveAnimations(QAbstractState *state,
- const QHash<QAbstractState*, QList<QPropertyAssignment> > &assignmentsForEnteredStates);
+ const QHash<QAbstractState*, QVector<QPropertyAssignment> > &assignmentsForEnteredStates);
void initializeAnimations(QAbstractState *state, const QList<QAbstractAnimation*> &selectedAnimations,
const QList<QAbstractState *> &exitedStates_sorted,
- QHash<QAbstractState *, QList<QPropertyAssignment> > &assignmentsForEnteredStates);
+ QHash<QAbstractState *, QVector<QPropertyAssignment> > &assignmentsForEnteredStates);
#endif // QT_NO_ANIMATION
QSignalEventGenerator *signalEventGenerator;
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 3c16cf5b9c..c29b80d3d0 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -39,11 +39,13 @@
#if defined(QT_BOOTSTRAPPED)
# include <QtCore/qatomic_bootstrap.h>
-// The following two are used for testing only.
-// Note that we don't check the compiler support -- you had better
-// know what you're doing if you set them
-#elif defined(QT_ATOMIC_FORCE_CXX11)
+// If C++11 atomics are supported, use them!
+#elif defined(Q_COMPILER_ATOMICS) && defined(Q_COMPILER_CONSTEXPR) && !defined(QT_ATOMIC_FORCE_NO_CXX11)
# include <QtCore/qatomic_cxx11.h>
+
+// The following is used for testing only.
+// Note that we don't check the compiler support -- you had better
+// know what you're doing if you set it
#elif defined(QT_ATOMIC_FORCE_GCC)
# include <QtCore/qatomic_gcc.h>
@@ -64,8 +66,6 @@
# include <QtCore/qatomic_x86.h>
// Fallback compiler dependent implementation
-#elif defined(Q_COMPILER_ATOMICS) && defined(Q_COMPILER_CONSTEXPR)
-# include <QtCore/qatomic_cxx11.h>
#elif defined(Q_CC_GNU)
# include <QtCore/qatomic_gcc.h>
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp
index acc3663936..cecd69c273 100644
--- a/src/corelib/thread/qexception.cpp
+++ b/src/corelib/thread/qexception.cpp
@@ -107,6 +107,16 @@ QT_BEGIN_NAMESPACE
\internal
*/
+QException::~QException()
+#ifdef Q_COMPILER_NOEXCEPT
+ noexcept
+#else
+ throw()
+#endif
+{
+ // must stay empty until ### Qt 6
+}
+
void QException::raise() const
{
QException e = *this;
@@ -118,6 +128,16 @@ QException *QException::clone() const
return new QException(*this);
}
+QUnhandledException::~QUnhandledException()
+#ifdef Q_COMPILER_NOEXCEPT
+ noexcept
+#else
+ throw()
+#endif
+{
+ // must stay empty until ### Qt 6
+}
+
void QUnhandledException::raise() const
{
QUnhandledException e = *this;
@@ -145,7 +165,7 @@ public:
};
ExceptionHolder::ExceptionHolder(QException *exception)
-: base(new Base(exception)) {}
+: base(exception ? new Base(exception) : Q_NULLPTR) {}
ExceptionHolder::ExceptionHolder(const ExceptionHolder &other)
: base(other.base)
@@ -161,6 +181,8 @@ ExceptionHolder::~ExceptionHolder()
QException *ExceptionHolder::exception() const
{
+ if (!base)
+ return Q_NULLPTR;
return base->exception;
}
diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h
index 55fc441020..dc988f9020 100644
--- a/src/corelib/thread/qexception.h
+++ b/src/corelib/thread/qexception.h
@@ -53,6 +53,13 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QException : public std::exception
{
public:
+ ~QException()
+#ifdef Q_COMPILER_NOEXCEPT
+ noexcept
+#else
+ throw()
+#endif
+ ;
virtual void raise() const;
virtual QException *clone() const;
};
@@ -60,6 +67,13 @@ public:
class Q_CORE_EXPORT QUnhandledException : public QException
{
public:
+ ~QUnhandledException()
+#ifdef Q_COMPILER_NOEXCEPT
+ noexcept
+#else
+ throw()
+#endif
+ ;
void raise() const Q_DECL_OVERRIDE;
QUnhandledException *clone() const Q_DECL_OVERRIDE;
};
@@ -70,9 +84,9 @@ class Base;
class Q_CORE_EXPORT ExceptionHolder
{
public:
- ExceptionHolder(QException *exception = 0);
+ ExceptionHolder(QException *exception = Q_NULLPTR);
ExceptionHolder(const ExceptionHolder &other);
- void operator=(const ExceptionHolder &other);
+ void operator=(const ExceptionHolder &other); // ### Qt6: copy-assign operator shouldn't return void. Remove this method and the copy-ctor, they are unneeded.
~ExceptionHolder();
QException *exception() const;
QExplicitlySharedDataPointer<Base> base;
diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc
index be4cee2bd6..ed0b26e121 100644
--- a/src/corelib/thread/qfuture.qdoc
+++ b/src/corelib/thread/qfuture.qdoc
@@ -352,6 +352,7 @@
/*! \class QFuture::const_iterator
\reentrant
\since 4.4
+ \inmodule QtCore
\brief The QFuture::const_iterator class provides an STL-style const
iterator for QFuture.
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h
index 01eb043a5e..8c1f7e7d82 100644
--- a/src/corelib/thread/qfutureinterface.h
+++ b/src/corelib/thread/qfutureinterface.h
@@ -299,7 +299,7 @@ public:
void reportResult(const void *, int) { }
void reportResults(const QVector<void> &, int) { }
- void reportFinished(const void * = 0) { QFutureInterfaceBase::reportFinished(); }
+ void reportFinished(const void * = Q_NULLPTR) { QFutureInterfaceBase::reportFinished(); }
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp
index 3056216f6e..43eff83116 100644
--- a/src/corelib/thread/qfuturewatcher.cpp
+++ b/src/corelib/thread/qfuturewatcher.cpp
@@ -248,7 +248,7 @@ bool QFutureWatcherBase::isStarted() const
/*! \fn bool QFutureWatcher::isFinished() const
Returns \c true if the asynchronous computation represented by the future()
- has finished; otherwise returns \c false.
+ has finished, or if no future has been set; otherwise returns \c false.
*/
bool QFutureWatcherBase::isFinished() const
{
@@ -304,15 +304,6 @@ void QFutureWatcherBase::waitForFinished()
futureInterface().waitForFinished();
}
-/*! \fn void QFutureWatcher::setPendingResultsLimit(int limit)
-
- The setPendingResultsLimit() provides throttling control. When the number
- of pending resultReadyAt() or resultsReadyAt() signals exceeds the
- \a limit, the computation represented by the future will be throttled
- automatically. The computation will resume once the number of pending
- signals drops below the \a limit.
-*/
-
bool QFutureWatcherBase::event(QEvent *event)
{
Q_D(QFutureWatcherBase);
@@ -342,6 +333,14 @@ bool QFutureWatcherBase::event(QEvent *event)
return QObject::event(event);
}
+/*! \fn void QFutureWatcher::setPendingResultsLimit(int limit)
+
+ The setPendingResultsLimit() provides throttling control. When the number
+ of pending resultReadyAt() or resultsReadyAt() signals exceeds the
+ \a limit, the computation represented by the future will be throttled
+ automatically. The computation will resume once the number of pending
+ signals drops below the \a limit.
+*/
void QFutureWatcherBase::setPendingResultsLimit(int limit)
{
Q_D(QFutureWatcherBase);
@@ -379,7 +378,8 @@ void QFutureWatcherBase::disconnectNotify(const QMetaMethod &signal)
*/
QFutureWatcherBasePrivate::QFutureWatcherBasePrivate()
: maximumPendingResultsReady(QThread::idealThreadCount() * 2),
- resultAtConnected(0)
+ resultAtConnected(0),
+ finished(true) /* the initial m_future is a canceledResult(), with Finished set */
{ }
/*!
@@ -400,7 +400,7 @@ void QFutureWatcherBase::disconnectOutputInterface(bool pendingAssignment)
d->pendingResultsReady.store(0);
qDeleteAll(d->pendingCallOutEvents);
d->pendingCallOutEvents.clear();
- d->finished = false;
+ d->finished = false; /* May soon be amended, during connectOutputInterface() */
}
futureInterface().d->disconnectOutputInterface(d_func());
diff --git a/src/corelib/thread/qfuturewatcher.h b/src/corelib/thread/qfuturewatcher.h
index 63558d4a0f..42a22d9063 100644
--- a/src/corelib/thread/qfuturewatcher.h
+++ b/src/corelib/thread/qfuturewatcher.h
@@ -52,7 +52,7 @@ class Q_CORE_EXPORT QFutureWatcherBase : public QObject
Q_DECLARE_PRIVATE(QFutureWatcherBase)
public:
- explicit QFutureWatcherBase(QObject *parent = 0);
+ explicit QFutureWatcherBase(QObject *parent = Q_NULLPTR);
// de-inline dtor
int progressValue() const;
@@ -179,7 +179,7 @@ template <>
class QFutureWatcher<void> : public QFutureWatcherBase
{
public:
- explicit QFutureWatcher(QObject *_parent = 0)
+ explicit QFutureWatcher(QObject *_parent = Q_NULLPTR)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()
diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h
index a9a790c14c..d3e7d51efd 100644
--- a/src/corelib/thread/qgenericatomic.h
+++ b/src/corelib/thread/qgenericatomic.h
@@ -46,13 +46,6 @@ QT_END_NAMESPACE
#pragma qt_sync_stop_processing
#endif
-#ifdef Q_CC_GNU
-// lowercase is fine, we'll undef it below
-#define always_inline __attribute__((always_inline, gnu_inline))
-#else
-#define always_inline
-#endif
-
template<int> struct QAtomicOpsSupport { enum { IsSupported = 0 }; };
template<> struct QAtomicOpsSupport<4> { enum { IsSupported = 1 }; };
@@ -84,19 +77,19 @@ template <typename BaseClass> struct QGenericAtomicOps
{
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T load(const T &_q_value) Q_DECL_NOTHROW
{
return _q_value;
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
void store(T &_q_value, X newValue) Q_DECL_NOTHROW
{
_q_value = newValue;
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T loadAcquire(const T &_q_value) Q_DECL_NOTHROW
{
T tmp = *static_cast<const volatile T *>(&_q_value);
@@ -104,7 +97,7 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
void storeRelease(T &_q_value, X newValue) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
@@ -115,13 +108,13 @@ template <typename BaseClass> struct QGenericAtomicOps
{ return BaseClass::isFetchAndAddNative(); }
static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW
{ return BaseClass::isFetchAndAddWaitFree(); }
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
bool ref(T &_q_value) Q_DECL_NOTHROW
{
return BaseClass::fetchAndAddRelaxed(_q_value, 1) != T(-1);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
bool deref(T &_q_value) Q_DECL_NOTHROW
{
return BaseClass::fetchAndAddRelaxed(_q_value, -1) != 1;
@@ -138,7 +131,7 @@ template <typename BaseClass> struct QGenericAtomicOps
bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW;
#endif
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
{
bool tmp = BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
@@ -146,21 +139,21 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
bool testAndSetRelease(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
{
bool tmp = BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
@@ -168,14 +161,14 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
bool testAndSetRelease(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
@@ -185,7 +178,7 @@ template <typename BaseClass> struct QGenericAtomicOps
static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return false; }
static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; }
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
T fetchAndStoreRelaxed(T &_q_value, X newValue) Q_DECL_NOTHROW
{
// implement fetchAndStore on top of testAndSet
@@ -196,7 +189,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
T fetchAndStoreAcquire(T &_q_value, X newValue) Q_DECL_NOTHROW
{
T tmp = BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
@@ -204,14 +197,14 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
T fetchAndStoreRelease(T &_q_value, X newValue) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
}
- template <typename T, typename X> static inline always_inline
+ template <typename T, typename X> static Q_ALWAYS_INLINE
T fetchAndStoreOrdered(T &_q_value, X newValue) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
@@ -220,7 +213,7 @@ template <typename BaseClass> struct QGenericAtomicOps
static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return false; }
static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; }
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
{
// implement fetchAndAdd on top of testAndSet
@@ -231,7 +224,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
{
T tmp = BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
@@ -239,28 +232,28 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAddRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAddOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndSubRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
{
// implement fetchAndSub on top of fetchAndAdd
return fetchAndAddRelaxed(_q_value, -operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndSubAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
{
T tmp = BaseClass::fetchAndSubRelaxed(_q_value, operand);
@@ -268,21 +261,21 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndSubRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndSubRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndSubOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndSubRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAndRelaxed(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
// implement fetchAndAnd on top of testAndSet
@@ -293,7 +286,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAndAcquire(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
T tmp = BaseClass::fetchAndAndRelaxed(_q_value, operand);
@@ -301,21 +294,21 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAndRelease(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndAndRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndAndOrdered(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndAndRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndOrRelaxed(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
// implement fetchAndOr on top of testAndSet
@@ -326,7 +319,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndOrAcquire(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
T tmp = BaseClass::fetchAndOrRelaxed(_q_value, operand);
@@ -334,21 +327,21 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndOrRelease(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndOrRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndOrOrdered(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndOrRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndXorRelaxed(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
// implement fetchAndXor on top of testAndSet
@@ -359,7 +352,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndXorAcquire(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
T tmp = BaseClass::fetchAndXorRelaxed(_q_value, operand);
@@ -367,14 +360,14 @@ template <typename BaseClass> struct QGenericAtomicOps
return tmp;
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndXorRelease(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndXorRelaxed(_q_value, operand);
}
- template <typename T> static inline always_inline
+ template <typename T> static Q_ALWAYS_INLINE
T fetchAndXorOrdered(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW
{
BaseClass::orderedMemoryFence(_q_value);
@@ -382,7 +375,5 @@ template <typename BaseClass> struct QGenericAtomicOps
}
};
-#undef always_inline
-
QT_END_NAMESPACE
#endif // QGENERICATOMIC_H
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 742a572bef..fa3bb080ae 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -139,6 +139,11 @@ public:
lock calls unlock(). A non-blocking alternative to lock() is
tryLock().
+ QMutex is optimized to be fast in the non-contended case. A non-recursive
+ QMutex will not allocate memory if there is no contention on that mutex.
+ It is constructed and destroyed with almost no overhead,
+ which means it is fine to have many mutexes as part of other classes.
+
\sa QMutexLocker, QReadWriteLock, QSemaphore, QWaitCondition
*/
@@ -165,6 +170,8 @@ public:
a thread may only lock a mutex once. The default is
QMutex::NonRecursive.
+ Recursive mutexes are slower and take more memory than non-recursive ones.
+
\sa lock(), unlock()
*/
QMutex::QMutex(RecursionMode mode)
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 63c488747f..0c5a73b4df 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -73,16 +73,16 @@ public:
private:
inline bool fastTryLock() Q_DECL_NOTHROW {
- return d_ptr.testAndSetAcquire(0, dummyLocked());
+ return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked());
}
inline bool fastTryUnlock() Q_DECL_NOTHROW {
- return d_ptr.testAndSetRelease(dummyLocked(), 0);
+ return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR);
}
inline bool fastTryLock(QMutexData *&current) Q_DECL_NOTHROW {
- return d_ptr.testAndSetAcquire(0, dummyLocked(), current);
+ return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked(), current);
}
inline bool fastTryUnlock(QMutexData *&current) Q_DECL_NOTHROW {
- return d_ptr.testAndSetRelease(dummyLocked(), 0, current);
+ return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR, current);
}
void lockInternal() QT_MUTEX_LOCK_NOEXCEPT;
diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp
index c4130fdba5..c24ea58868 100644
--- a/src/corelib/thread/qmutex_win.cpp
+++ b/src/corelib/thread/qmutex_win.cpp
@@ -55,10 +55,10 @@ QMutexPrivate::~QMutexPrivate()
bool QMutexPrivate::wait(int timeout)
{
-#ifndef Q_OS_WINRT
- return (WaitForSingleObject(event, timeout < 0 ? INFINITE : timeout) == WAIT_OBJECT_0);
-#else
+#ifndef Q_OS_WINCE
return (WaitForSingleObjectEx(event, timeout < 0 ? INFINITE : timeout, FALSE) == WAIT_OBJECT_0);
+#else
+ return (WaitForSingleObject(event, timeout < 0 ? INFINITE : timeout) == WAIT_OBJECT_0);
#endif
}
diff --git a/src/corelib/thread/qorderedmutexlocker_p.h b/src/corelib/thread/qorderedmutexlocker_p.h
index c73a790820..54887342e7 100644
--- a/src/corelib/thread/qorderedmutexlocker_p.h
+++ b/src/corelib/thread/qorderedmutexlocker_p.h
@@ -47,6 +47,8 @@
#include <QtCore/qmutex.h>
+#include <functional>
+
QT_BEGIN_NAMESPACE
/*
@@ -57,8 +59,8 @@ class QOrderedMutexLocker
{
public:
QOrderedMutexLocker(QMutex *m1, QMutex *m2)
- : mtx1((m1 == m2) ? m1 : (m1 < m2 ? m1 : m2)),
- mtx2((m1 == m2) ? 0 : (m1 < m2 ? m2 : m1)),
+ : mtx1((m1 == m2) ? m1 : (std::less<QMutex *>()(m1, m2) ? m1 : m2)),
+ mtx2((m1 == m2) ? 0 : (std::less<QMutex *>()(m1, m2) ? m2 : m1)),
locked(false)
{
relock();
diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h
index fbcb8ad3cd..7ecaa231b2 100644
--- a/src/corelib/thread/qresultstore.h
+++ b/src/corelib/thread/qresultstore.h
@@ -61,8 +61,8 @@ class ResultItem
public:
ResultItem(const void *_result, int _count) : m_count(_count), result(_result) { } // contruct with vector of results
ResultItem(const void *_result) : m_count(0), result(_result) { } // construct with result
- ResultItem() : m_count(0), result(0) { }
- bool isValid() const { return result != 0; }
+ ResultItem() : m_count(0), result(Q_NULLPTR) { }
+ bool isValid() const { return result != Q_NULLPTR; }
bool isVector() const { return m_count != 0; }
int count() const { return (m_count == 0) ? 1 : m_count; }
int m_count; // result is either a pointer to a result or to a vector of results,
diff --git a/src/corelib/thread/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp
index 64a2613d27..04aa39a81e 100644
--- a/src/corelib/thread/qrunnable.cpp
+++ b/src/corelib/thread/qrunnable.cpp
@@ -31,6 +31,15 @@
**
****************************************************************************/
+#include "qrunnable.h"
+
+QT_BEGIN_NAMESPACE
+
+QRunnable::~QRunnable()
+{
+ // Must be empty until ### Qt 6
+}
+
/*!
\class QRunnable
\inmodule QtCore
@@ -98,3 +107,5 @@
\sa autoDelete(), QThreadPool
*/
+
+QT_END_NAMESPACE
diff --git a/src/corelib/thread/qrunnable.h b/src/corelib/thread/qrunnable.h
index f00c58d51d..28d14a46c0 100644
--- a/src/corelib/thread/qrunnable.h
+++ b/src/corelib/thread/qrunnable.h
@@ -38,20 +38,21 @@
QT_BEGIN_NAMESPACE
-
-class QRunnable
+class Q_CORE_EXPORT QRunnable
{
int ref;
friend class QThreadPool;
friend class QThreadPoolPrivate;
friend class QThreadPoolThread;
-
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ Q_DISABLE_COPY(QRunnable)
+#endif
public:
virtual void run() = 0;
QRunnable() : ref(0) { }
- virtual ~QRunnable() { }
+ virtual ~QRunnable();
bool autoDelete() const { return ref != -1; }
void setAutoDelete(bool _autoDelete) { ref = _autoDelete ? 0 : -1; }
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index dc231a00f8..590479d68c 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -38,7 +38,6 @@
#include "qabstracteventdispatcher.h"
#include <qeventloop.h>
-#include <qhash.h>
#include "qthread_p.h"
#include "private/qcoreapplication_p.h"
@@ -51,7 +50,8 @@ QT_BEGIN_NAMESPACE
QThreadData::QThreadData(int initialRefCount)
: _ref(initialRefCount), loopLevel(0), thread(0), threadId(0),
- eventDispatcher(0), quitNow(false), canWait(true), isAdopted(false)
+ eventDispatcher(0),
+ quitNow(false), canWait(true), isAdopted(false), requiresCoreApplication(true)
{
// fprintf(stderr, "QThreadData %p created\n", this);
}
@@ -868,4 +868,28 @@ bool QThread::isInterruptionRequested() const
return d->interruptionRequested;
}
+/*!
+ \class QDaemonThread
+ \since 5.5
+ \brief The QDaemonThread provides a class to manage threads that outlive QCoreApplication
+ \internal
+
+ Note: don't try to deliver events from the started() signal.
+*/
+static void setThreadDoesNotRequireCoreApplication()
+{
+ QThreadData::current()->requiresCoreApplication = false;
+}
+
+QDaemonThread::QDaemonThread(QObject *parent)
+ : QThread(parent)
+{
+ // QThread::started() is emitted from the thread we start
+ connect(this, &QThread::started, setThreadDoesNotRequireCoreApplication);
+}
+
+QDaemonThread::~QDaemonThread()
+{
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index bfc469583d..d333980bf4 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -55,7 +55,7 @@ public:
static int idealThreadCount() Q_DECL_NOTHROW;
static void yieldCurrentThread();
- explicit QThread(QObject *parent = 0);
+ explicit QThread(QObject *parent = Q_NULLPTR);
~QThread();
enum Priority {
@@ -116,7 +116,7 @@ protected:
static void setTerminationEnabled(bool enabled = true);
protected:
- QThread(QThreadPrivate &dd, QObject *parent = 0);
+ QThread(QThreadPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QThread)
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 8331816729..a0d354acdc 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -135,6 +135,13 @@ private:
#ifndef QT_NO_THREAD
+class Q_CORE_EXPORT QDaemonThread : public QThread
+{
+public:
+ QDaemonThread(QObject *parent = 0);
+ ~QDaemonThread();
+};
+
class QThreadPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QThread)
@@ -224,7 +231,7 @@ public:
QThreadData(int initialRefCount = 1);
~QThreadData();
- static QThreadData *current(bool createIfNecessary = true);
+ static Q_AUTOTEST_EXPORT QThreadData *current(bool createIfNecessary = true);
static void clearCurrentThreadData();
static QThreadData *get2(QThread *thread)
{ Q_ASSERT_X(thread != 0, "QThread", "internal error"); return thread->d_func()->data; }
@@ -278,6 +285,7 @@ public:
bool quitNow;
bool canWait;
bool isAdopted;
+ bool requiresCoreApplication;
};
class QScopedLoopLevelCounter
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 5698a61326..af4ce7c59e 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -36,9 +36,13 @@
#include "qplatformdefs.h"
#include <private/qcoreapplication_p.h>
+#include <private/qcore_unix_p.h>
#if defined(Q_OS_BLACKBERRY)
# include <private/qeventdispatcher_blackberry_p.h>
+#elif defined(Q_OS_OSX)
+# include <private/qeventdispatcher_cf_p.h>
+# include <private/qeventdispatcher_unix_p.h>
#else
# if !defined(QT_NO_GLIB)
# include "../kernel/qeventdispatcher_glib_p.h"
@@ -75,9 +79,6 @@
# define old_qDebug qDebug
# undef qDebug
# endif
-#ifdef Q_OS_MACX
-# include <CoreServices/CoreServices.h>
-#endif // Q_OS_MACX
# ifdef old_qDebug
# undef qDebug
@@ -251,14 +252,21 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
{
#if defined(Q_OS_BLACKBERRY)
data->eventDispatcher.storeRelease(new QEventDispatcherBlackberry);
-#else
-#if !defined(QT_NO_GLIB)
+# elif defined(Q_OS_OSX)
+ bool ok = false;
+ int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
+ if (ok && value > 0)
+ data->eventDispatcher.storeRelease(new QEventDispatcherCoreFoundation);
+ else
+ data->eventDispatcher.storeRelease(new QEventDispatcherUNIX);
+# elif !defined(QT_NO_GLIB)
if (qEnvironmentVariableIsEmpty("QT_NO_GLIB")
&& qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB")
&& QEventDispatcherGlib::versionSupported())
data->eventDispatcher.storeRelease(new QEventDispatcherGlib);
else
-#endif
+ data->eventDispatcher.storeRelease(new QEventDispatcherUNIX);
+#else
data->eventDispatcher.storeRelease(new QEventDispatcherUNIX);
#endif
@@ -313,14 +321,15 @@ void *QThreadPrivate::start(void *arg)
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();
-
- if (Q_LIKELY(objectName.isEmpty()))
- setCurrentThreadName(thr->d_func()->thread_id, thr->metaObject()->className());
- else
- setCurrentThreadName(thr->d_func()->thread_id, objectName.toLocal8Bit());
+ {
+ // sets the name of the current thread.
+ QString objectName = thr->objectName();
+ if (Q_LIKELY(objectName.isEmpty()))
+ setCurrentThreadName(thr->d_func()->thread_id, thr->metaObject()->className());
+ else
+ setCurrentThreadName(thr->d_func()->thread_id, objectName.toLocal8Bit());
+ }
#endif
emit thr->started(QThread::QPrivateSignal());
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index a4b853d62e..32e8a52a28 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -32,7 +32,7 @@
****************************************************************************/
//#define WINVER 0x0500
-#if !defined Q_OS_WINRT && (_WIN32_WINNT < 0x0400)
+#if !defined(WINAPI_FAMILY) && (_WIN32_WINNT < 0x0400)
#define _WIN32_WINNT 0x0400
#endif
@@ -69,6 +69,30 @@
#ifndef QT_NO_THREAD
QT_BEGIN_NAMESPACE
+#ifdef Q_OS_WINRT
+inline DWORD qWinRTTlsAlloc() {
+ return FlsAlloc(0);
+}
+
+inline bool qWinRTTlsFree(DWORD dwTlsIndex) {
+ return FlsFree(dwTlsIndex);
+}
+
+inline LPVOID qWinRTTlsGetValue(DWORD dwTlsIndex) {
+ return FlsGetValue(dwTlsIndex);
+}
+
+inline bool qWinRTTlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) {
+ return FlsSetValue(dwTlsIndex, lpTlsValue);
+}
+
+#define TlsAlloc qWinRTTlsAlloc
+#define TlsFree qWinRTTlsFree
+#define TlsSetValue qWinRTTlsSetValue
+#define TlsGetValue qWinRTTlsGetValue
+
+#endif // Q_OS_WINRT
+
void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread);
DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID);
@@ -118,7 +142,7 @@ QThreadData *QThreadData::current(bool createIfNecessary)
}
threadData->deref();
threadData->isAdopted = true;
- threadData->threadId = reinterpret_cast<Qt::HANDLE>(GetCurrentThreadId());
+ threadData->threadId = reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
if (!QCoreApplicationPrivate::theMainThread) {
QCoreApplicationPrivate::theMainThread = threadData->thread.load();
@@ -340,7 +364,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
qt_create_tls();
TlsSetValue(qt_current_thread_data_tls_index, data);
- data->threadId = reinterpret_cast<Qt::HANDLE>(GetCurrentThreadId());
+ data->threadId = reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
QThread::setTerminationEnabled(false);
@@ -413,7 +437,7 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway)
Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
{
- return reinterpret_cast<Qt::HANDLE>(GetCurrentThreadId());
+ return reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
}
int QThread::idealThreadCount() Q_DECL_NOTHROW
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index b6b3be8d92..e4a5368281 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -204,8 +204,8 @@ void QThreadPoolPrivate::enqueueTask(QRunnable *runnable, int priority)
++runnable->ref;
// put it on the queue
- QList<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin();
- QList<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd();
+ QVector<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin();
+ QVector<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd();
if (it != begin && priority > (*(it - 1)).second)
it = std::upper_bound(begin, --it, priority);
queue.insert(it - begin, qMakePair(runnable, priority));
@@ -299,7 +299,7 @@ bool QThreadPoolPrivate::waitForDone(int msecs)
void QThreadPoolPrivate::clear()
{
QMutexLocker locker(&mutex);
- for (QList<QPair<QRunnable *, int> >::const_iterator it = queue.constBegin();
+ for (QVector<QPair<QRunnable *, int> >::const_iterator it = queue.constBegin();
it != queue.constEnd(); ++it) {
QRunnable* r = it->first;
if (r->autoDelete() && !--r->ref)
@@ -319,8 +319,8 @@ bool QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
return false;
{
QMutexLocker locker(&mutex);
- QList<QPair<QRunnable *, int> >::iterator it = queue.begin();
- QList<QPair<QRunnable *, int> >::iterator end = queue.end();
+ QVector<QPair<QRunnable *, int> >::iterator it = queue.begin();
+ QVector<QPair<QRunnable *, int> >::iterator end = queue.end();
while (it != end) {
if (it->first == runnable) {
diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h
index b1ca808a99..95b41a0417 100644
--- a/src/corelib/thread/qthreadpool.h
+++ b/src/corelib/thread/qthreadpool.h
@@ -55,7 +55,7 @@ class Q_CORE_EXPORT QThreadPool : public QObject
friend class QFutureInterfaceBase;
public:
- QThreadPool(QObject *parent = 0);
+ QThreadPool(QObject *parent = Q_NULLPTR);
~QThreadPool();
static QThreadPool *globalInstance();
diff --git a/src/corelib/thread/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h
index 34728ed3e2..b03eefcc94 100644
--- a/src/corelib/thread/qthreadpool_p.h
+++ b/src/corelib/thread/qthreadpool_p.h
@@ -83,7 +83,7 @@ public:
QSet<QThreadPoolThread *> allThreads;
QQueue<QThreadPoolThread *> waitingThreads;
QQueue<QThreadPoolThread *> expiredThreads;
- QList<QPair<QRunnable *, int> > queue;
+ QVector<QPair<QRunnable *, int> > queue;
QWaitCondition noActiveThreads;
bool isExiting;
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp
index fd6af7db39..89bf523263 100644
--- a/src/corelib/thread/qwaitcondition_unix.cpp
+++ b/src/corelib/thread/qwaitcondition_unix.cpp
@@ -77,7 +77,7 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
#if defined(Q_OS_ANDROID)
if (local_condattr_setclock && QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
local_condattr_setclock(&condattr, CLOCK_MONOTONIC);
-#elif !defined(Q_OS_MAC) && !defined(Q_OS_HAIKU)
+#elif !defined(Q_OS_MAC)
if (QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
#endif
diff --git a/src/corelib/thread/qwaitcondition_win.cpp b/src/corelib/thread/qwaitcondition_win.cpp
index ef8330570e..3ea34461d3 100644
--- a/src/corelib/thread/qwaitcondition_win.cpp
+++ b/src/corelib/thread/qwaitcondition_win.cpp
@@ -109,10 +109,10 @@ bool QWaitConditionPrivate::wait(QWaitConditionEvent *wce, unsigned long time)
{
// wait for the event
bool ret = false;
-#ifndef Q_OS_WINRT
- switch (WaitForSingleObject(wce->event, time)) {
-#else
+#ifndef Q_OS_WINCE
switch (WaitForSingleObjectEx(wce->event, time, FALSE)) {
+#else
+ switch (WaitForSingleObject(wce->event, time)) {
#endif
default: break;
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index ff4d5a3ebd..ffa3082d5e 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -584,6 +584,131 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigne
#undef QALGORITHMS_USE_BUILTIN_POPCOUNT
#endif
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_ctz(v) : 32U;
+#else
+ // see http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightParallel
+ unsigned int c = 32; // c will be the number of zero bits on the right
+ v &= -signed(v);
+ if (v) c--;
+ if (v & 0x0000FFFF) c -= 16;
+ if (v & 0x00FF00FF) c -= 8;
+ if (v & 0x0F0F0F0F) c -= 4;
+ if (v & 0x33333333) c -= 2;
+ if (v & 0x55555555) c -= 1;
+ return c;
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_ctz(v) : 8U;
+#else
+ unsigned int c = 8; // c will be the number of zero bits on the right
+ v &= -signed(v);
+ if (v) c--;
+ if (v & 0x0000000F) c -= 4;
+ if (v & 0x00000033) c -= 2;
+ if (v & 0x00000055) c -= 1;
+ return c;
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_ctz(v) : 16U;
+#else
+ unsigned int c = 16; // c will be the number of zero bits on the right
+ v &= -signed(v);
+ if (v) c--;
+ if (v & 0x000000FF) c -= 8;
+ if (v & 0x00000F0F) c -= 4;
+ if (v & 0x00003333) c -= 2;
+ if (v & 0x00005555) c -= 1;
+ return c;
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_ctzll(v) : 64;
+#else
+ quint32 x = static_cast<quint32>(v);
+ return x ? qCountTrailingZeroBits(x)
+ : 32 + qCountTrailingZeroBits(static_cast<quint32>(v >> 32));
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(unsigned long v) Q_DECL_NOTHROW
+{
+ return qCountTrailingZeroBits(QIntegerForSizeof<long>::Unsigned(v));
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_clz(v) : 32U;
+#else
+ // Hacker's Delight, 2nd ed. Fig 5-16, p. 102
+ v = v | (v >> 1);
+ v = v | (v >> 2);
+ v = v | (v >> 4);
+ v = v | (v >> 8);
+ v = v | (v >> 16);
+ return qPopulationCount(~v);
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_clz(v)-24U : 8U;
+#else
+ v = v | (v >> 1);
+ v = v | (v >> 2);
+ v = v | (v >> 4);
+ return qPopulationCount(static_cast<quint8>(~v));
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_clz(v)-16U : 16U;
+#else
+ v = v | (v >> 1);
+ v = v | (v >> 2);
+ v = v | (v >> 4);
+ v = v | (v >> 8);
+ return qPopulationCount(static_cast<quint16>(~v));
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOTHROW
+{
+#if defined(Q_CC_GNU)
+ return v ? __builtin_clzll(v) : 64U;
+#else
+ v = v | (v >> 1);
+ v = v | (v >> 2);
+ v = v | (v >> 4);
+ v = v | (v >> 8);
+ v = v | (v >> 16);
+ v = v | (v >> 32);
+ return qPopulationCount(~v);
+#endif
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) Q_DECL_NOTHROW
+{
+ return qCountLeadingZeroBits(QIntegerForSizeof<long>::Unsigned(v));
+}
+
QT_WARNING_POP
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc
index 193042e017..dac353fa70 100644
--- a/src/corelib/tools/qalgorithms.qdoc
+++ b/src/corelib/tools/qalgorithms.qdoc
@@ -785,3 +785,73 @@
\since 5.2
\overload
*/
+
+/*!
+ \fn uint qCountTrailingZeroBits(quint8 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+
+ Returns the number of consecutive zero bits in \a v, when searching from the LSB.
+ For example, qCountTrailingZeroBits(1) returns 0 and qCountTrailingZeroBits(8) returns 3.
+ */
+
+/*!
+ \fn uint qCountTrailingZeroBits(quint16 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+ \overload
+ */
+
+/*!
+ \fn uint qCountTrailingZeroBits(quint32 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+ \overload
+ */
+
+/*!
+ \fn uint qCountTrailingZeroBits(quint64 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+ \overload
+ */
+
+/*!
+ \fn uint qCountLeadingZeroBits(quint8 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+
+ Returns the number of consecutive zero bits in \a v, when searching from the MSB.
+ For example, qCountLeadingZeroBits(quint8(1)) returns 7 and
+ qCountLeadingZeroBits(quint8(8)) returns 4.
+ */
+
+/*!
+ \fn uint qCountLeadingZeroBits(quint16 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+
+ Returns the number of consecutive zero bits in \a v, when searching from the MSB.
+ For example, qCountLeadingZeroBits(quint16(1)) returns 15 and
+ qCountLeadingZeroBits(quint16(8)) returns 12.
+ */
+
+/*!
+ \fn uint qCountLeadingZeroBits(quint32 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+
+ Returns the number of consecutive zero bits in \a v, when searching from the MSB.
+ For example, qCountLeadingZeroBits(quint32(1)) returns 31 and
+ qCountLeadingZeroBits(quint32(8)) returns 28.
+ */
+
+/*!
+ \fn uint qCountLeadingZeroBits(quint64 v)
+ \relates <QtAlgorithms>
+ \since 5.6
+
+ Returns the number of consecutive zero bits in \a v, when searching from the MSB.
+ For example, qCountLeadingZeroBits(quint64(1)) returns 63 and
+ qCountLeadingZeroBits(quint64(8)) returns 60.
+ */
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index ef15fae83a..d9519745b0 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -103,7 +103,11 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
quintptr data = (quintptr(header) + sizeof(QArrayData) + alignment - 1)
& ~(alignment - 1);
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
header->ref.atomic.store(bool(!(options & Unsharable)));
+#else
+ header->ref.atomic.store(1);
+#endif
header->size = 0;
header->alloc = capacity;
header->capacityReserved = bool(options & CapacityReserved);
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index df35a1cb62..865bd4325d 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -132,7 +132,7 @@ struct QTypedArrayData
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(0) {}
+ inline iterator() : i(Q_NULLPTR) {}
inline iterator(T *n) : i(n) {}
inline iterator(const iterator &o): i(o.i){} // #### Qt 6: remove, the implicit version is fine
inline T &operator*() const { return *i; }
@@ -166,7 +166,7 @@ struct QTypedArrayData
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() : i(0) {}
+ inline const_iterator() : i(Q_NULLPTR) {}
inline const_iterator(const T *n) : i(n) {}
inline const_iterator(const const_iterator &o): i(o.i) {} // #### Qt 6: remove, the default version is fine
inline explicit const_iterator(const iterator &o): i(o.i) {}
@@ -249,11 +249,13 @@ struct QTypedArrayData
return allocate(/* capacity */ 0);
}
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
static QTypedArrayData *unsharableEmpty()
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
return allocate(/* capacity */ 0, Unsharable);
}
+#endif
};
template <class T, size_t N>
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 103eb073a9..9804d2c2d5 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -46,7 +46,7 @@ private:
typedef QArrayDataOps<T> DataOps;
public:
- QArrayDataPointer()
+ QArrayDataPointer() Q_DECL_NOTHROW
: d(Data::sharedNull())
{
}
@@ -77,15 +77,16 @@ public:
}
#ifdef Q_COMPILER_RVALUE_REFS
- QArrayDataPointer(QArrayDataPointer &&other)
+ QArrayDataPointer(QArrayDataPointer &&other) Q_DECL_NOTHROW
: d(other.d)
{
other.d = Data::sharedNull();
}
- QArrayDataPointer &operator=(QArrayDataPointer &&other)
+ QArrayDataPointer &operator=(QArrayDataPointer &&other) Q_DECL_NOTHROW
{
- this->swap(other);
+ QArrayDataPointer moved(std::move(other));
+ this->swap(moved);
return *this;
}
#endif
@@ -143,7 +144,7 @@ public:
bool isSharable() const { return d->isSharable(); }
#endif
- void swap(QArrayDataPointer &other)
+ void swap(QArrayDataPointer &other) Q_DECL_NOTHROW
{
qSwap(d, other.d);
}
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index 5a161f517e..a64edea77e 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -604,7 +604,7 @@ QBitArray QBitArray::operator~() const
Example:
\snippet code/src_corelib_tools_qbitarray.cpp 12
- \sa QBitArray::operator&=(), operator|(), operator^()
+ \sa {QBitArray::}{operator&=()}, {QBitArray::}{operator|()}, {QBitArray::}{operator^()}
*/
QBitArray operator&(const QBitArray &a1, const QBitArray &a2)
@@ -650,7 +650,7 @@ QBitArray operator|(const QBitArray &a1, const QBitArray &a2)
Example:
\snippet code/src_corelib_tools_qbitarray.cpp 14
- \sa QBitArray::operator^=(), operator&(), operator|()
+ \sa {QBitArray}{operator^=()}, {QBitArray}{operator&()}, {QBitArray}{operator|()}
*/
QBitArray operator^(const QBitArray &a1, const QBitArray &a2)
diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h
index 4e5c26b86a..e686d53db4 100644
--- a/src/corelib/tools/qbitarray.h
+++ b/src/corelib/tools/qbitarray.h
@@ -48,7 +48,7 @@ class Q_CORE_EXPORT QBitArray
QByteArray d;
public:
- inline QBitArray() {}
+ inline QBitArray() Q_DECL_NOTHROW {}
explicit QBitArray(int size, bool val = false);
QBitArray(const QBitArray &other) : d(other.d) {}
inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; }
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 9d6c9d4ed1..00d15fd518 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -41,6 +41,7 @@
#include "qlocale_p.h"
#include "qstringalgorithms_p.h"
#include "qscopedpointer.h"
+#include "qbytearray_p.h"
#include <qdatastream.h>
#include <qmath.h>
@@ -123,7 +124,7 @@ int qFindByteArray(
int qAllocMore(int alloc, int extra) Q_DECL_NOTHROW
{
- Q_ASSERT(alloc >= 0 && extra >= 0);
+ Q_ASSERT(alloc >= 0 && extra >= 0 && extra <= MaxAllocSize);
Q_ASSERT_X(alloc <= MaxAllocSize - extra, "qAllocMore", "Requested size is too large!");
unsigned nalloc = qNextPowerOfTwo(alloc + extra);
@@ -488,8 +489,8 @@ quint16 qChecksum(const char *data, uint len)
\overload
- Compresses the first \a nbytes of \a data and returns the
- compressed data in a new byte array.
+ Compresses the first \a nbytes of \a data at compression level
+ \a compressionLevel and returns the compressed data in a new byte array.
*/
#ifndef QT_NO_COMPRESS
@@ -577,8 +578,8 @@ QByteArray qUncompress(const uchar* data, int nbytes)
qWarning("qUncompress: Input data is corrupted");
return QByteArray();
}
- ulong expectedSize = (data[0] << 24) | (data[1] << 16) |
- (data[2] << 8) | (data[3] );
+ ulong expectedSize = uint((data[0] << 24) | (data[1] << 16) |
+ (data[2] << 8) | (data[3] ));
ulong len = qMax(expectedSize, 1ul);
QScopedPointer<QByteArray::Data, QScopedPointerPodDeleter> d;
@@ -838,15 +839,6 @@ static inline char qToLower(char c)
*/
/*!
- \variable QByteArray::MaxSize
- \internal
- \since 5.4
-
- The maximum size of a QByteArray, in bytes. Also applies to a the maximum
- storage size of QString and QVector, though not the number of elements.
-*/
-
-/*!
\enum QByteArray::Base64Option
\since 5.2
@@ -927,6 +919,52 @@ static inline char qToLower(char c)
\sa constBegin(), end()
*/
+/*! \fn QByteArray::reverse_iterator QByteArray::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ character in the byte-array, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QByteArray::const_reverse_iterator QByteArray::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QByteArray::const_reverse_iterator QByteArray::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ character in the byte-array, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QByteArray::reverse_iterator QByteArray::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last character in the byte-array, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QByteArray::const_reverse_iterator QByteArray::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QByteArray::const_reverse_iterator QByteArray::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last character in the byte-array, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*! \fn void QByteArray::push_back(const QByteArray &other)
This function is provided for STL compatibility. It is equivalent
@@ -1574,7 +1612,7 @@ void QByteArray::reallocData(uint alloc, Data::AllocationOptions options)
d = x;
} else {
if (options & Data::Grow) {
- if (alloc > uint(MaxAllocSize) - uint(sizeof(Data)))
+ if (alloc > MaxByteArraySize)
qBadAlloc();
alloc = qAllocMore(alloc, sizeof(Data));
}
@@ -2845,9 +2883,9 @@ QByteArray QByteArray::toUpper_helper(QByteArray &a)
/*! \fn void QByteArray::clear()
- Clears the contents of the byte array and makes it empty.
+ Clears the contents of the byte array and makes it null.
- \sa resize(), isEmpty()
+ \sa resize(), isNull()
*/
void QByteArray::clear()
@@ -4489,11 +4527,33 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA
*/
/*! \typedef QByteArray::const_iterator
- \internal
+
+ This typedef provides an STL-style const iterator for QByteArray.
+
+ \sa QByteArray::const_reverse_iterator, QByteArray::iterator
*/
/*! \typedef QByteArray::iterator
- \internal
+
+ This typedef provides an STL-style non-const iterator for QByteArray.
+
+ \sa QByteArray::reverse_iterator, QByteArray::const_iterator
+*/
+
+/*! \typedef QByteArray::const_reverse_iterator
+ \since 5.6
+
+ This typedef provides an STL-style const reverse iterator for QByteArray.
+
+ \sa QByteArray::reverse_iterator, QByteArray::const_iterator
+*/
+
+/*! \typedef QByteArray::reverse_iterator
+ \since 5.6
+
+ This typedef provides an STL-style non-const reverse iterator for QByteArray.
+
+ \sa QByteArray::const_reverse_iterator, QByteArray::iterator
*/
/*! \typedef QByteArray::size_type
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 6d14cd5131..f0032227e8 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -43,6 +43,7 @@
#include <stdarg.h>
#include <string>
+#include <iterator>
#ifdef truncate
#error qbytearray.h must be included before any header file that defines truncate
@@ -162,9 +163,6 @@ private:
typedef QTypedArrayData<char> Data;
public:
- // undocumented:
- static const quint64 MaxSize = (1 << 30) - sizeof(Data);
-
enum Base64Option {
Base64Encoding = 0,
Base64UrlEncoding = 1,
@@ -338,16 +336,16 @@ public:
inline QT_ASCII_CAST_WARN bool operator>=(const QString &s2) const;
#endif
- short toShort(bool *ok = 0, int base = 10) const;
- ushort toUShort(bool *ok = 0, int base = 10) const;
- int toInt(bool *ok = 0, int base = 10) const;
- uint toUInt(bool *ok = 0, int base = 10) const;
- long toLong(bool *ok = 0, int base = 10) const;
- ulong toULong(bool *ok = 0, int base = 10) const;
- qlonglong toLongLong(bool *ok = 0, int base = 10) const;
- qulonglong toULongLong(bool *ok = 0, int base = 10) const;
- float toFloat(bool *ok = 0) const;
- double toDouble(bool *ok = 0) const;
+ short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
+ ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
+ int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
+ uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
+ long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
+ ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
+ qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
+ qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
+ float toFloat(bool *ok = Q_NULLPTR) const;
+ double toDouble(bool *ok = Q_NULLPTR) const;
QByteArray toBase64(Base64Options options) const;
QByteArray toBase64() const; // ### Qt6 merge with previous
QByteArray toHex() const;
@@ -393,14 +391,22 @@ public:
typedef const char *const_iterator;
typedef iterator Iterator;
typedef const_iterator ConstIterator;
- iterator begin();
- const_iterator begin() const;
- const_iterator cbegin() const;
- const_iterator constBegin() const;
- iterator end();
- const_iterator end() const;
- const_iterator cend() const;
- const_iterator constEnd() const;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ inline iterator begin();
+ inline const_iterator begin() const;
+ inline const_iterator cbegin() const;
+ inline const_iterator constBegin() const;
+ inline iterator end();
+ inline const_iterator end() const;
+ inline const_iterator cend() const;
+ inline const_iterator constEnd() const;
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
// stl compatibility
typedef int size_type;
diff --git a/src/corelib/tools/qbytearray_p.h b/src/corelib/tools/qbytearray_p.h
new file mode 100644
index 0000000000..78c667aa90
--- /dev/null
+++ b/src/corelib/tools/qbytearray_p.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 QBYTEARRAY_P_H
+#define QBYTEARRAY_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qtypetraits.h>
+#include "qtools_p.h"
+
+QT_BEGIN_NAMESPACE
+
+enum {
+ // Define as enum to force inlining. Don't expose MaxAllocSize in a public header.
+ MaxByteArraySize = MaxAllocSize - sizeof(QtPrivate::remove_pointer<QByteArray::DataPtr>::type)
+};
+
+QT_END_NAMESPACE
+
+#endif // QBYTEARRAY_P_H
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h
index f8539ca07a..8b832b7760 100644
--- a/src/corelib/tools/qbytearraylist.h
+++ b/src/corelib/tools/qbytearraylist.h
@@ -61,7 +61,7 @@ protected:
#endif
public:
inline QByteArray join() const
- { return QtPrivate::QByteArrayList_join(self(), 0, 0); }
+ { return QtPrivate::QByteArrayList_join(self(), Q_NULLPTR, 0); }
inline QByteArray join(const QByteArray &sep) const
{ return QtPrivate::QByteArrayList_join(self(), sep.constData(), sep.size()); }
inline QByteArray join(char sep) const
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 014d91162a..78fa0bccf0 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -178,8 +178,10 @@ QT_BEGIN_NAMESPACE
\value Unicode_6_1 Version 6.1
\value Unicode_6_2 Version 6.2
\value Unicode_6_3 Version 6.3 Since Qt 5.3
+ \value Unicode_7_0 Version 7.0 Since Qt 5.5
+ \value Unicode_8_0 Version 8.0 Since Qt 5.6
\value Unicode_Unassigned The value is not assigned to any character
- in version 6.3 of Unicode.
+ in version 8.0 of Unicode.
\sa unicodeVersion(), currentUnicodeVersion()
*/
@@ -400,6 +402,12 @@ QT_BEGIN_NAMESPACE
\value Script_Khudawadi
\value Script_Tirhuta
\value Script_WarangCiti
+ \value Script_Ahom
+ \value Script_AnatolianHieroglyphs
+ \value Script_Hatran
+ \value Script_Multani
+ \value Script_OldHungarian
+ \value Script_SignWriting
\omitvalue ScriptCount
@@ -691,7 +699,7 @@ QT_BEGIN_NAMESPACE
Note that this gives no indication of whether the character is
available in a particular font.
*/
-bool QChar::isPrint(uint ucs4)
+bool QChar::isPrint(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -724,7 +732,7 @@ bool QChar::isPrint(uint ucs4)
/*!
\internal
*/
-bool QT_FASTCALL QChar::isSpace_helper(uint ucs4)
+bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -750,7 +758,7 @@ bool QT_FASTCALL QChar::isSpace_helper(uint ucs4)
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a mark (Mark_* categories); otherwise returns \c false.
*/
-bool QChar::isMark(uint ucs4)
+bool QChar::isMark(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -774,7 +782,7 @@ bool QChar::isMark(uint ucs4)
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a punctuation mark (Punctuation_* categories); otherwise returns \c false.
*/
-bool QChar::isPunct(uint ucs4)
+bool QChar::isPunct(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -802,7 +810,7 @@ bool QChar::isPunct(uint ucs4)
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a symbol (Symbol_* categories); otherwise returns \c false.
*/
-bool QChar::isSymbol(uint ucs4)
+bool QChar::isSymbol(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -832,7 +840,7 @@ bool QChar::isSymbol(uint ucs4)
/*!
\internal
*/
-bool QT_FASTCALL QChar::isLetter_helper(uint ucs4)
+bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -867,7 +875,7 @@ bool QT_FASTCALL QChar::isLetter_helper(uint ucs4)
/*!
\internal
*/
-bool QT_FASTCALL QChar::isNumber_helper(uint ucs4)
+bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -896,7 +904,7 @@ bool QT_FASTCALL QChar::isNumber_helper(uint ucs4)
/*!
\internal
*/
-bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4)
+bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -1059,7 +1067,7 @@ bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4)
Returns the numeric value of the digit specified by the UCS-4-encoded
character, \a ucs4, or -1 if the character is not a digit.
*/
-int QChar::digitValue(uint ucs4)
+int QChar::digitValue(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return -1;
@@ -1076,7 +1084,7 @@ int QChar::digitValue(uint ucs4)
\overload
Returns the category of the UCS-4-encoded character specified by \a ucs4.
*/
-QChar::Category QChar::category(uint ucs4)
+QChar::Category QChar::category(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return QChar::Other_NotAssigned;
@@ -1093,7 +1101,7 @@ QChar::Category QChar::category(uint ucs4)
\overload
Returns the direction of the UCS-4-encoded character specified by \a ucs4.
*/
-QChar::Direction QChar::direction(uint ucs4)
+QChar::Direction QChar::direction(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return QChar::DirL;
@@ -1116,7 +1124,7 @@ QChar::Direction QChar::direction(uint ucs4)
character specified by \a ucs4
(needed for certain languages such as Arabic or Syriac).
*/
-QChar::JoiningType QChar::joiningType(uint ucs4)
+QChar::JoiningType QChar::joiningType(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return QChar::Joining_None;
@@ -1139,7 +1147,7 @@ QChar::JoiningType QChar::joiningType(uint ucs4)
Returns information about the joining properties of the UCS-4-encoded
character specified by \a ucs4 (needed for certain languages such as Arabic).
*/
-QChar::Joining QChar::joining(uint ucs4)
+QChar::Joining QChar::joining(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return QChar::OtherJoining;
@@ -1175,7 +1183,7 @@ QChar::Joining QChar::joining(uint ucs4)
\sa mirroredChar()
*/
-bool QChar::hasMirrored(uint ucs4)
+bool QChar::hasMirrored(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -1257,7 +1265,7 @@ bool QChar::hasMirrored(uint ucs4)
\sa hasMirrored()
*/
-uint QChar::mirroredChar(uint ucs4)
+uint QChar::mirroredChar(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return ucs4;
@@ -1341,7 +1349,7 @@ QString QChar::decomposition(uint ucs4)
Returns the tag defining the composition of the UCS-4-encoded character
specified by \a ucs4. Returns QChar::NoDecomposition if no decomposition exists.
*/
-QChar::Decomposition QChar::decompositionTag(uint ucs4)
+QChar::Decomposition QChar::decompositionTag(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 >= Hangul_SBase && ucs4 < Hangul_SBase + Hangul_SCount)
return QChar::Canonical;
@@ -1367,7 +1375,7 @@ QChar::Decomposition QChar::decompositionTag(uint ucs4)
Returns the combining class for the UCS-4-encoded character specified by
\a ucs4, as defined in the Unicode standard.
*/
-unsigned char QChar::combiningClass(uint ucs4)
+unsigned char QChar::combiningClass(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return 0;
@@ -1388,7 +1396,7 @@ unsigned char QChar::combiningClass(uint ucs4)
Returns the Unicode script property value for the character specified in
its UCS-4-encoded form as \a ucs4.
*/
-QChar::Script QChar::script(uint ucs4)
+QChar::Script QChar::script(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return QChar::Script_Unknown;
@@ -1406,7 +1414,7 @@ QChar::Script QChar::script(uint ucs4)
Returns the Unicode version that introduced the character specified in
its UCS-4-encoded form as \a ucs4.
*/
-QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4)
+QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return QChar::Unicode_Unassigned;
@@ -1416,54 +1424,24 @@ QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4)
/*!
Returns the most recent supported Unicode version.
*/
-QChar::UnicodeVersion QChar::currentUnicodeVersion()
+QChar::UnicodeVersion QChar::currentUnicodeVersion() Q_DECL_NOTHROW
{
return UNICODE_DATA_VERSION;
}
-template <typename T>
-Q_DECL_CONST_FUNCTION static inline T toLowerCase_helper(T uc)
+template <typename Traits, typename T>
+Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc) Q_DECL_NOTHROW
{
- const QUnicodeTables::Properties *p = qGetProp(uc);
- if (p->lowerCaseSpecial) {
- const ushort *specialCase = specialCaseMap + p->lowerCaseDiff;
- return (*specialCase == 1) ? specialCase[1] : uc;
- }
- return uc + p->lowerCaseDiff;
-}
-
-template <typename T>
-Q_DECL_CONST_FUNCTION static inline T toUpperCase_helper(T uc)
-{
- const QUnicodeTables::Properties *p = qGetProp(uc);
- if (p->upperCaseSpecial) {
- const ushort *specialCase = specialCaseMap + p->upperCaseDiff;
- return (*specialCase == 1) ? specialCase[1] : uc;
- }
- return uc + p->upperCaseDiff;
-}
+ const QUnicodeTables::Properties *prop = qGetProp(uc);
-template <typename T>
-Q_DECL_CONST_FUNCTION static inline T toTitleCase_helper(T uc)
-{
- const QUnicodeTables::Properties *p = qGetProp(uc);
- if (p->titleCaseSpecial) {
- const ushort *specialCase = specialCaseMap + p->titleCaseDiff;
- return (*specialCase == 1) ? specialCase[1] : uc;
+ if (Q_UNLIKELY(Traits::caseSpecial(prop))) {
+ const ushort *specialCase = specialCaseMap + Traits::caseDiff(prop);
+ // so far, there are no special cases beyond BMP (guaranteed by the qunicodetables generator)
+ return *specialCase == 1 ? specialCase[1] : uc;
}
- return uc + p->titleCaseDiff;
-}
-template <typename T>
-Q_DECL_CONST_FUNCTION static inline T toCaseFolded_helper(T uc)
-{
- const QUnicodeTables::Properties *p = qGetProp(uc);
- if (p->caseFoldSpecial) {
- const ushort *specialCase = specialCaseMap + p->caseFoldDiff;
- return (*specialCase == 1) ? specialCase[1] : uc;
- }
- return uc + p->caseFoldDiff;
+ return uc + Traits::caseDiff(prop);
}
/*!
@@ -1479,11 +1457,11 @@ Q_DECL_CONST_FUNCTION static inline T toCaseFolded_helper(T uc)
by \a ucs4 if the character is uppercase or titlecase; otherwise returns
the character itself.
*/
-uint QChar::toLower(uint ucs4)
+uint QChar::toLower(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return toLowerCase_helper<uint>(ucs4);
+ return convertCase_helper<QUnicodeTables::LowercaseTraits>(ucs4);
}
/*!
@@ -1499,11 +1477,11 @@ uint QChar::toLower(uint ucs4)
by \a ucs4 if the character is lowercase or titlecase; otherwise returns
the character itself.
*/
-uint QChar::toUpper(uint ucs4)
+uint QChar::toUpper(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return toUpperCase_helper<uint>(ucs4);
+ return convertCase_helper<QUnicodeTables::UppercaseTraits>(ucs4);
}
/*!
@@ -1519,33 +1497,33 @@ uint QChar::toUpper(uint ucs4)
by \a ucs4 if the character is lowercase or uppercase; otherwise returns
the character itself.
*/
-uint QChar::toTitleCase(uint ucs4)
+uint QChar::toTitleCase(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return toTitleCase_helper<uint>(ucs4);
+ return convertCase_helper<QUnicodeTables::TitlecaseTraits>(ucs4);
}
static inline uint foldCase(const ushort *ch, const ushort *start)
{
- uint c = *ch;
- if (QChar(c).isLowSurrogate() && ch > start && QChar(*(ch - 1)).isHighSurrogate())
- c = QChar::surrogateToUcs4(*(ch - 1), c);
- return toCaseFolded_helper<uint>(c);
+ uint ucs4 = *ch;
+ if (QChar::isLowSurrogate(ucs4) && ch > start && QChar::isHighSurrogate(*(ch - 1)))
+ ucs4 = QChar::surrogateToUcs4(*(ch - 1), ucs4);
+ return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
}
-static inline uint foldCase(uint ch, uint &last)
+static inline uint foldCase(uint ch, uint &last) Q_DECL_NOTHROW
{
- uint c = ch;
- if (QChar(c).isLowSurrogate() && QChar(last).isHighSurrogate())
- c = QChar::surrogateToUcs4(last, c);
+ uint ucs4 = ch;
+ if (QChar::isLowSurrogate(ucs4) && QChar::isHighSurrogate(last))
+ ucs4 = QChar::surrogateToUcs4(last, ucs4);
last = ch;
- return toCaseFolded_helper<uint>(c);
+ return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
}
-static inline ushort foldCase(ushort ch)
+static inline ushort foldCase(ushort ch) Q_DECL_NOTHROW
{
- return toCaseFolded_helper<ushort>(ch);
+ return convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
}
/*!
@@ -1560,11 +1538,11 @@ static inline ushort foldCase(ushort ch)
Returns the case folded equivalent of the UCS-4-encoded character specified
by \a ucs4. For most Unicode characters this is the same as toLower().
*/
-uint QChar::toCaseFolded(uint ucs4)
+uint QChar::toCaseFolded(uint ucs4) Q_DECL_NOTHROW
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return toCaseFolded_helper<uint>(ucs4);
+ return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
}
/*!
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 97e2aa7088..9833380cc8 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -44,9 +44,9 @@ class QString;
struct QLatin1Char
{
public:
- Q_DECL_CONSTEXPR inline explicit QLatin1Char(char c) : ch(c) {}
- Q_DECL_CONSTEXPR inline char toLatin1() const { return ch; }
- Q_DECL_CONSTEXPR inline ushort unicode() const { return ushort(uchar(ch)); }
+ Q_DECL_CONSTEXPR inline explicit QLatin1Char(char c) Q_DECL_NOTHROW : ch(c) {}
+ Q_DECL_CONSTEXPR inline char toLatin1() const Q_DECL_NOTHROW { return ch; }
+ Q_DECL_CONSTEXPR inline ushort unicode() const Q_DECL_NOTHROW { return ushort(uchar(ch)); }
private:
char ch;
@@ -72,19 +72,19 @@ public:
LastValidCodePoint = 0x10ffff
};
- Q_DECL_CONSTEXPR QChar() : ucs(0) {}
- Q_DECL_CONSTEXPR QChar(ushort rc) : ucs(rc){} // implicit
- Q_DECL_CONSTEXPR QChar(uchar c, uchar r) : ucs(ushort((r << 8) | c)){}
- Q_DECL_CONSTEXPR QChar(short rc) : ucs(ushort(rc)){} // implicit
- Q_DECL_CONSTEXPR QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
- Q_DECL_CONSTEXPR QChar(int rc) : ucs(ushort(rc & 0xffff)){}
- Q_DECL_CONSTEXPR QChar(SpecialCharacter s) : ucs(ushort(s)) {} // implicit
- Q_DECL_CONSTEXPR QChar(QLatin1Char ch) : ucs(ch.unicode()) {} // implicit
+ Q_DECL_CONSTEXPR QChar() Q_DECL_NOTHROW : ucs(0) {}
+ Q_DECL_CONSTEXPR QChar(ushort rc) Q_DECL_NOTHROW : ucs(rc) {} // implicit
+ Q_DECL_CONSTEXPR QChar(uchar c, uchar r) Q_DECL_NOTHROW : ucs(ushort((r << 8) | c)) {}
+ Q_DECL_CONSTEXPR QChar(short rc) Q_DECL_NOTHROW : ucs(ushort(rc)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(uint rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
+ Q_DECL_CONSTEXPR QChar(int rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
+ Q_DECL_CONSTEXPR QChar(SpecialCharacter s) Q_DECL_NOTHROW : ucs(ushort(s)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(QLatin1Char ch) Q_DECL_NOTHROW : ucs(ch.unicode()) {} // implicit
#ifndef QT_NO_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) : ucs(uchar(c)) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) Q_DECL_NOTHROW : ucs(uchar(c)) { }
#ifndef QT_RESTRICTED_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) : ucs(c) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) Q_DECL_NOTHROW : ucs(c) { }
#endif
#endif
// Unicode information
@@ -275,6 +275,14 @@ public:
Script_Tirhuta,
Script_WarangCiti,
+ // Unicode 8.0 additions
+ Script_Ahom,
+ Script_AnatolianHieroglyphs,
+ Script_Hatran,
+ Script_Multani,
+ Script_OldHungarian,
+ Script_SignWriting,
+
ScriptCount
};
@@ -365,15 +373,16 @@ public:
Unicode_6_1,
Unicode_6_2,
Unicode_6_3,
- Unicode_7_0
+ Unicode_7_0,
+ Unicode_8_0
};
// ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
- inline Category category() const { return QChar::category(ucs); }
- inline Direction direction() const { return QChar::direction(ucs); }
- inline JoiningType joiningType() const { return QChar::joiningType(ucs); }
+ inline Category category() const Q_DECL_NOTHROW { return QChar::category(ucs); }
+ inline Direction direction() const Q_DECL_NOTHROW { return QChar::direction(ucs); }
+ inline JoiningType joiningType() const Q_DECL_NOTHROW { return QChar::joiningType(ucs); }
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED inline Joining joining() const
+ QT_DEPRECATED inline Joining joining() const Q_DECL_NOTHROW
{
switch (QChar::joiningType(ucs)) {
case QChar::Joining_Causing: return QChar::Center;
@@ -386,194 +395,177 @@ public:
}
}
#endif
- inline unsigned char combiningClass() const { return QChar::combiningClass(ucs); }
+ inline unsigned char combiningClass() const Q_DECL_NOTHROW { return QChar::combiningClass(ucs); }
- inline QChar mirroredChar() const { return QChar::mirroredChar(ucs); }
- inline bool hasMirrored() const { return QChar::hasMirrored(ucs); }
+ inline QChar mirroredChar() const Q_DECL_NOTHROW { return QChar::mirroredChar(ucs); }
+ inline bool hasMirrored() const Q_DECL_NOTHROW { return QChar::hasMirrored(ucs); }
QString decomposition() const;
- inline Decomposition decompositionTag() const { return QChar::decompositionTag(ucs); }
+ inline Decomposition decompositionTag() const Q_DECL_NOTHROW { return QChar::decompositionTag(ucs); }
- inline int digitValue() const { return QChar::digitValue(ucs); }
- inline QChar toLower() const { return QChar::toLower(ucs); }
- inline QChar toUpper() const { return QChar::toUpper(ucs); }
- inline QChar toTitleCase() const { return QChar::toTitleCase(ucs); }
- inline QChar toCaseFolded() const { return QChar::toCaseFolded(ucs); }
+ inline int digitValue() const Q_DECL_NOTHROW { return QChar::digitValue(ucs); }
+ inline QChar toLower() const Q_DECL_NOTHROW { return QChar::toLower(ucs); }
+ inline QChar toUpper() const Q_DECL_NOTHROW { return QChar::toUpper(ucs); }
+ inline QChar toTitleCase() const Q_DECL_NOTHROW { return QChar::toTitleCase(ucs); }
+ inline QChar toCaseFolded() const Q_DECL_NOTHROW { return QChar::toCaseFolded(ucs); }
- inline Script script() const { return QChar::script(ucs); }
+ inline Script script() const Q_DECL_NOTHROW { return QChar::script(ucs); }
- inline UnicodeVersion unicodeVersion() const { return QChar::unicodeVersion(ucs); }
+ inline UnicodeVersion unicodeVersion() const Q_DECL_NOTHROW { return QChar::unicodeVersion(ucs); }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED Q_DECL_CONSTEXPR inline char toAscii() const { return toLatin1(); }
+ QT_DEPRECATED Q_DECL_CONSTEXPR inline char toAscii() const Q_DECL_NOTHROW { return toLatin1(); }
#endif
- Q_DECL_CONSTEXPR inline char toLatin1() const;
- Q_DECL_CONSTEXPR inline ushort unicode() const { return ucs; }
- inline ushort &unicode() { return ucs; }
+ Q_DECL_CONSTEXPR inline char toLatin1() const Q_DECL_NOTHROW { return ucs > 0xff ? '\0' : char(ucs); }
+ Q_DECL_CONSTEXPR inline ushort unicode() const Q_DECL_NOTHROW { return ucs; }
+ Q_DECL_RELAXED_CONSTEXPR inline ushort &unicode() Q_DECL_NOTHROW { return ucs; }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static Q_DECL_CONSTEXPR inline QChar fromAscii(char c)
+ QT_DEPRECATED static Q_DECL_CONSTEXPR inline QChar fromAscii(char c) Q_DECL_NOTHROW
{ return fromLatin1(c); }
#endif
- Q_DECL_CONSTEXPR static inline QChar fromLatin1(char c);
-
- Q_DECL_CONSTEXPR inline bool isNull() const { return ucs == 0; }
-
- inline bool isPrint() const { return QChar::isPrint(ucs); }
- Q_DECL_CONSTEXPR inline bool isSpace() const { return QChar::isSpace(ucs); }
- inline bool isMark() const { return QChar::isMark(ucs); }
- inline bool isPunct() const { return QChar::isPunct(ucs); }
- inline bool isSymbol() const { return QChar::isSymbol(ucs); }
- Q_DECL_CONSTEXPR inline bool isLetter() const { return QChar::isLetter(ucs); }
- Q_DECL_CONSTEXPR inline bool isNumber() const { return QChar::isNumber(ucs); }
- Q_DECL_CONSTEXPR inline bool isLetterOrNumber() const { return QChar::isLetterOrNumber(ucs); }
- Q_DECL_CONSTEXPR inline bool isDigit() const { return QChar::isDigit(ucs); }
- Q_DECL_CONSTEXPR inline bool isLower() const { return QChar::isLower(ucs); }
- Q_DECL_CONSTEXPR inline bool isUpper() const { return QChar::isUpper(ucs); }
- Q_DECL_CONSTEXPR inline bool isTitleCase() const { return QChar::isTitleCase(ucs); }
-
- Q_DECL_CONSTEXPR inline bool isNonCharacter() const { return QChar::isNonCharacter(ucs); }
- Q_DECL_CONSTEXPR inline bool isHighSurrogate() const { return QChar::isHighSurrogate(ucs); }
- Q_DECL_CONSTEXPR inline bool isLowSurrogate() const { return QChar::isLowSurrogate(ucs); }
- Q_DECL_CONSTEXPR inline bool isSurrogate() const { return QChar::isSurrogate(ucs); }
-
- Q_DECL_CONSTEXPR inline uchar cell() const { return uchar(ucs & 0xff); }
- Q_DECL_CONSTEXPR inline uchar row() const { return uchar((ucs>>8)&0xff); }
- inline void setCell(uchar cell);
- inline void setRow(uchar row);
-
- static Q_DECL_CONSTEXPR inline bool isNonCharacter(uint ucs4)
+ static Q_DECL_CONSTEXPR inline QChar fromLatin1(char c) Q_DECL_NOTHROW { return QChar(ushort(uchar(c))); }
+
+ Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW { return ucs == 0; }
+
+ inline bool isPrint() const Q_DECL_NOTHROW { return QChar::isPrint(ucs); }
+ Q_DECL_CONSTEXPR inline bool isSpace() const Q_DECL_NOTHROW { return QChar::isSpace(ucs); }
+ inline bool isMark() const Q_DECL_NOTHROW { return QChar::isMark(ucs); }
+ inline bool isPunct() const Q_DECL_NOTHROW { return QChar::isPunct(ucs); }
+ inline bool isSymbol() const Q_DECL_NOTHROW { return QChar::isSymbol(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLetter() const Q_DECL_NOTHROW { return QChar::isLetter(ucs); }
+ Q_DECL_CONSTEXPR inline bool isNumber() const Q_DECL_NOTHROW { return QChar::isNumber(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLetterOrNumber() const Q_DECL_NOTHROW { return QChar::isLetterOrNumber(ucs); }
+ Q_DECL_CONSTEXPR inline bool isDigit() const Q_DECL_NOTHROW { return QChar::isDigit(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLower() const Q_DECL_NOTHROW { return QChar::isLower(ucs); }
+ Q_DECL_CONSTEXPR inline bool isUpper() const Q_DECL_NOTHROW { return QChar::isUpper(ucs); }
+ Q_DECL_CONSTEXPR inline bool isTitleCase() const Q_DECL_NOTHROW { return QChar::isTitleCase(ucs); }
+
+ Q_DECL_CONSTEXPR inline bool isNonCharacter() const Q_DECL_NOTHROW { return QChar::isNonCharacter(ucs); }
+ Q_DECL_CONSTEXPR inline bool isHighSurrogate() const Q_DECL_NOTHROW { return QChar::isHighSurrogate(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLowSurrogate() const Q_DECL_NOTHROW { return QChar::isLowSurrogate(ucs); }
+ Q_DECL_CONSTEXPR inline bool isSurrogate() const Q_DECL_NOTHROW { return QChar::isSurrogate(ucs); }
+
+ Q_DECL_CONSTEXPR inline uchar cell() const Q_DECL_NOTHROW { return uchar(ucs & 0xff); }
+ Q_DECL_CONSTEXPR inline uchar row() const Q_DECL_NOTHROW { return uchar((ucs>>8)&0xff); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setCell(uchar acell) Q_DECL_NOTHROW { ucs = ushort((ucs & 0xff00) + acell); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setRow(uchar arow) Q_DECL_NOTHROW { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
+
+ static Q_DECL_CONSTEXPR inline bool isNonCharacter(uint ucs4) Q_DECL_NOTHROW
{
return ucs4 >= 0xfdd0 && (ucs4 <= 0xfdef || (ucs4 & 0xfffe) == 0xfffe);
}
- static Q_DECL_CONSTEXPR inline bool isHighSurrogate(uint ucs4)
+ static Q_DECL_CONSTEXPR inline bool isHighSurrogate(uint ucs4) Q_DECL_NOTHROW
{
return ((ucs4 & 0xfffffc00) == 0xd800);
}
- static Q_DECL_CONSTEXPR inline bool isLowSurrogate(uint ucs4)
+ static Q_DECL_CONSTEXPR inline bool isLowSurrogate(uint ucs4) Q_DECL_NOTHROW
{
return ((ucs4 & 0xfffffc00) == 0xdc00);
}
- static Q_DECL_CONSTEXPR inline bool isSurrogate(uint ucs4)
+ static Q_DECL_CONSTEXPR inline bool isSurrogate(uint ucs4) Q_DECL_NOTHROW
{
return (ucs4 - 0xd800u < 2048u);
}
- static Q_DECL_CONSTEXPR inline bool requiresSurrogates(uint ucs4)
+ static Q_DECL_CONSTEXPR inline bool requiresSurrogates(uint ucs4) Q_DECL_NOTHROW
{
return (ucs4 >= 0x10000);
}
- static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(ushort high, ushort low)
+ static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(ushort high, ushort low) Q_DECL_NOTHROW
{
return (uint(high)<<10) + low - 0x35fdc00;
}
- static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(QChar high, QChar low)
+ static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(QChar high, QChar low) Q_DECL_NOTHROW
{
return surrogateToUcs4(high.ucs, low.ucs);
}
- static Q_DECL_CONSTEXPR inline ushort highSurrogate(uint ucs4)
+ static Q_DECL_CONSTEXPR inline ushort highSurrogate(uint ucs4) Q_DECL_NOTHROW
{
return ushort((ucs4>>10) + 0xd7c0);
}
- static Q_DECL_CONSTEXPR inline ushort lowSurrogate(uint ucs4)
+ static Q_DECL_CONSTEXPR inline ushort lowSurrogate(uint ucs4) Q_DECL_NOTHROW
{
return ushort(ucs4%0x400 + 0xdc00);
}
- static Category QT_FASTCALL category(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Direction QT_FASTCALL direction(uint ucs4) Q_DECL_CONST_FUNCTION;
- static JoiningType QT_FASTCALL joiningType(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static Category QT_FASTCALL category(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Direction QT_FASTCALL direction(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static JoiningType QT_FASTCALL joiningType(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED static Joining QT_FASTCALL joining(uint ucs4) Q_DECL_CONST_FUNCTION;
+ QT_DEPRECATED static Joining QT_FASTCALL joining(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
#endif
- static unsigned char QT_FASTCALL combiningClass(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static unsigned char QT_FASTCALL combiningClass(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL mirroredChar(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL hasMirrored(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL mirroredChar(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL hasMirrored(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
static QString QT_FASTCALL decomposition(uint ucs4);
- static Decomposition QT_FASTCALL decompositionTag(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static Decomposition QT_FASTCALL decompositionTag(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static int QT_FASTCALL digitValue(uint ucs4) Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toLower(uint ucs4) Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toUpper(uint ucs4) Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toTitleCase(uint ucs4) Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toCaseFolded(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static int QT_FASTCALL digitValue(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toLower(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toUpper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toTitleCase(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toCaseFolded(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Script QT_FASTCALL script(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static Script QT_FASTCALL script(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static UnicodeVersion QT_FASTCALL currentUnicodeVersion() Q_DECL_CONST_FUNCTION;
+ static UnicodeVersion QT_FASTCALL currentUnicodeVersion() Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isPrint(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isSpace(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isMark(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isPunct(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isSymbol(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isLetter(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isNumber(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isLetterOrNumber(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isDigit(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isLower(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isUpper(uint ucs4) Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isTitleCase(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isPrint(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Q_DECL_CONSTEXPR inline bool isSpace(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ {
+ // note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly
+ return ucs4 == 0x20 || (ucs4 <= 0x0d && ucs4 >= 0x09)
+ || (ucs4 > 127 && (ucs4 == 0x85 || ucs4 == 0xa0 || QChar::isSpace_helper(ucs4)));
+ }
+ static bool QT_FASTCALL isMark(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isPunct(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isSymbol(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Q_DECL_CONSTEXPR inline bool isLetter(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ {
+ return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
+ || (ucs4 > 127 && QChar::isLetter_helper(ucs4));
+ }
+ static Q_DECL_CONSTEXPR inline bool isNumber(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ { return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::isNumber_helper(ucs4)); }
+ static Q_DECL_CONSTEXPR inline bool isLetterOrNumber(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ {
+ return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
+ || (ucs4 >= '0' && ucs4 <= '9')
+ || (ucs4 > 127 && QChar::isLetterOrNumber_helper(ucs4));
+ }
+ static Q_DECL_CONSTEXPR inline bool isDigit(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ { return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::category(ucs4) == Number_DecimalDigit); }
+ static Q_DECL_CONSTEXPR inline bool isLower(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ { return (ucs4 <= 'z' && ucs4 >= 'a') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Lowercase); }
+ static Q_DECL_CONSTEXPR inline bool isUpper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ { return (ucs4 <= 'Z' && ucs4 >= 'A') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Uppercase); }
+ static Q_DECL_CONSTEXPR inline bool isTitleCase(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ { return ucs4 > 127 && QChar::category(ucs4) == Letter_Titlecase; }
private:
- static bool QT_FASTCALL isSpace_helper(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isLetter_helper(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isNumber_helper(uint ucs4) Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isLetterOrNumber_helper(uint ucs4) Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isSpace_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isLetter_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isNumber_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
#ifdef QT_NO_CAST_FROM_ASCII
- QChar(char c);
- QChar(uchar c);
+ QChar(char c) Q_DECL_NOTHROW;
+ QChar(uchar c) Q_DECL_NOTHROW;
#endif
- friend Q_DECL_CONSTEXPR bool operator==(QChar, QChar);
- friend Q_DECL_CONSTEXPR bool operator< (QChar, QChar);
+ friend Q_DECL_CONSTEXPR bool operator==(QChar, QChar) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR bool operator< (QChar, QChar) Q_DECL_NOTHROW;
ushort ucs;
};
Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
-Q_DECL_CONSTEXPR inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
-
-inline void QChar::setCell(uchar acell)
-{ ucs = ushort((ucs & 0xff00) + acell); }
-inline void QChar::setRow(uchar arow)
-{ ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
-
-Q_DECL_CONSTEXPR inline bool QChar::isSpace(uint ucs4)
-{
- // note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly
- return ucs4 == 0x20 || (ucs4 <= 0x0d && ucs4 >= 0x09)
- || (ucs4 > 127 && (ucs4 == 0x85 || ucs4 == 0xa0 || QChar::isSpace_helper(ucs4)));
-}
-Q_DECL_CONSTEXPR inline bool QChar::isLetter(uint ucs4)
-{
- return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
- || (ucs4 > 127 && QChar::isLetter_helper(ucs4));
-}
-Q_DECL_CONSTEXPR inline bool QChar::isNumber(uint ucs4)
-{ return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::isNumber_helper(ucs4)); }
-Q_DECL_CONSTEXPR inline bool QChar::isLetterOrNumber(uint ucs4)
-{
- return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
- || (ucs4 >= '0' && ucs4 <= '9')
- || (ucs4 > 127 && QChar::isLetterOrNumber_helper(ucs4));
-}
-Q_DECL_CONSTEXPR inline bool QChar::isDigit(uint ucs4)
-{ return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::category(ucs4) == Number_DecimalDigit); }
-Q_DECL_CONSTEXPR inline bool QChar::isLower(uint ucs4)
-{ return (ucs4 <= 'z' && ucs4 >= 'a') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Lowercase); }
-Q_DECL_CONSTEXPR inline bool QChar::isUpper(uint ucs4)
-{ return (ucs4 <= 'Z' && ucs4 >= 'A') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Uppercase); }
-Q_DECL_CONSTEXPR inline bool QChar::isTitleCase(uint ucs4)
-{ return ucs4 > 127 && QChar::category(ucs4) == Letter_Titlecase; }
-
-Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) { return c1.ucs == c2.ucs; }
-Q_DECL_CONSTEXPR inline bool operator< (QChar c1, QChar c2) { return c1.ucs < c2.ucs; }
+Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
+Q_DECL_CONSTEXPR inline bool operator< (QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs < c2.ucs; }
Q_DECL_CONSTEXPR inline bool operator!=(QChar c1, QChar c2) { return !operator==(c1, c2); }
Q_DECL_CONSTEXPR inline bool operator>=(QChar c1, QChar c2) { return !operator< (c1, c2); }
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 59f8f66869..bbe2e28ea8 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -248,6 +248,8 @@ bool QCollator::numericMode() const
The default is locale dependent.
+ \note This method is not currently supported on Apple platforms or if Qt is configured to not use ICU on Linux.
+
\sa ignorePunctuation()
*/
void QCollator::setIgnorePunctuation(bool on)
diff --git a/src/corelib/tools/qcollator.h b/src/corelib/tools/qcollator.h
index e1fa161257..57133165c4 100644
--- a/src/corelib/tools/qcollator.h
+++ b/src/corelib/tools/qcollator.h
@@ -83,7 +83,7 @@ public:
QCollator &operator=(const QCollator &);
#ifdef Q_COMPILER_RVALUE_REFS
QCollator(QCollator &&other) Q_DECL_NOTHROW
- : d(other.d) { other.d = 0; }
+ : d(other.d) { other.d = Q_NULLPTR; }
QCollator &operator=(QCollator &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
#endif
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index 7f898f68a8..8c0ba8cb2b 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -41,10 +41,19 @@ QT_BEGIN_NAMESPACE
class QCommandLineOptionPrivate : public QSharedData
{
public:
- inline QCommandLineOptionPrivate()
+ Q_NEVER_INLINE
+ explicit QCommandLineOptionPrivate(const QString &name)
+ : names(removeInvalidNames(QStringList(name))),
+ hidden(false)
{ }
- void setNames(const QStringList &nameList);
+ Q_NEVER_INLINE
+ explicit QCommandLineOptionPrivate(const QStringList &names)
+ : names(removeInvalidNames(names)),
+ hidden(false)
+ { }
+
+ static QStringList removeInvalidNames(QStringList nameList);
//! The list of names used for this option.
QStringList names;
@@ -58,6 +67,9 @@ public:
//! The list of default values used for this option.
QStringList defaultValues;
+
+ //! Show or hide in --help
+ bool hidden;
};
/*!
@@ -98,9 +110,8 @@ public:
\sa setDescription(), setValueName(), setDefaultValues()
*/
QCommandLineOption::QCommandLineOption(const QString &name)
- : d(new QCommandLineOptionPrivate)
+ : d(new QCommandLineOptionPrivate(name))
{
- d->setNames(QStringList(name));
}
/*!
@@ -117,9 +128,8 @@ QCommandLineOption::QCommandLineOption(const QString &name)
\sa setDescription(), setValueName(), setDefaultValues()
*/
QCommandLineOption::QCommandLineOption(const QStringList &names)
- : d(new QCommandLineOptionPrivate)
+ : d(new QCommandLineOptionPrivate(names))
{
- d->setNames(names);
}
/*!
@@ -148,9 +158,8 @@ QCommandLineOption::QCommandLineOption(const QStringList &names)
QCommandLineOption::QCommandLineOption(const QString &name, const QString &description,
const QString &valueName,
const QString &defaultValue)
- : d(new QCommandLineOptionPrivate)
+ : d(new QCommandLineOptionPrivate(name))
{
- d->setNames(QStringList(name));
setValueName(valueName);
setDescription(description);
setDefaultValue(defaultValue);
@@ -185,9 +194,8 @@ QCommandLineOption::QCommandLineOption(const QString &name, const QString &descr
QCommandLineOption::QCommandLineOption(const QStringList &names, const QString &description,
const QString &valueName,
const QString &defaultValue)
- : d(new QCommandLineOptionPrivate)
+ : d(new QCommandLineOptionPrivate(names))
{
- d->setNames(names);
setValueName(valueName);
setDescription(description);
setDefaultValue(defaultValue);
@@ -236,29 +244,47 @@ QStringList QCommandLineOption::names() const
return d->names;
}
-void QCommandLineOptionPrivate::setNames(const QStringList &nameList)
-{
- QStringList newNames;
- newNames.reserve(nameList.size());
- if (nameList.isEmpty())
- qWarning("QCommandLineOption: Options must have at least one name");
- foreach (const QString &name, nameList) {
- if (name.isEmpty()) {
- qWarning("QCommandLineOption: Option names cannot be empty");
- } else {
+namespace {
+ struct IsInvalidName
+ {
+ typedef bool result_type;
+ typedef QString argument_type;
+
+ Q_NEVER_INLINE
+ result_type operator()(const QString &name) const Q_DECL_NOEXCEPT
+ {
+ if (Q_UNLIKELY(name.isEmpty()))
+ return warn("be empty");
+
const QChar c = name.at(0);
- if (c == QLatin1Char('-'))
- qWarning("QCommandLineOption: Option names cannot start with a '-'");
- else if (c == QLatin1Char('/'))
- qWarning("QCommandLineOption: Option names cannot start with a '/'");
- else if (name.contains(QLatin1Char('=')))
- qWarning("QCommandLineOption: Option names cannot contain a '='");
- else
- newNames.append(name);
+ if (Q_UNLIKELY(c == QLatin1Char('-')))
+ return warn("start with a '-'");
+ if (Q_UNLIKELY(c == QLatin1Char('/')))
+ return warn("start with a '/'");
+ if (Q_UNLIKELY(name.contains(QLatin1Char('='))))
+ return warn("contain a '='");
+
+ return false;
}
- }
- // commit
- names.swap(newNames);
+
+ Q_NEVER_INLINE
+ static bool warn(const char *what) Q_DECL_NOEXCEPT
+ {
+ qWarning("QCommandLineOption: Option names cannot %s", what);
+ return true;
+ }
+ };
+} // unnamed namespace
+
+// static
+QStringList QCommandLineOptionPrivate::removeInvalidNames(QStringList nameList)
+{
+ if (Q_UNLIKELY(nameList.isEmpty()))
+ qWarning("QCommandLineOption: Options must have at least one name");
+ else
+ nameList.erase(std::remove_if(nameList.begin(), nameList.end(), IsInvalidName()),
+ nameList.end());
+ return nameList;
}
/*!
@@ -362,4 +388,30 @@ QStringList QCommandLineOption::defaultValues() const
return d->defaultValues;
}
+/*!
+ Sets whether to hide this option in the user-visible help output.
+
+ All options are visible by default. Setting \a hide to true for
+ a particular option makes it internal, i.e. not listed in the help output.
+
+ \since 5.6
+ \sa isHidden
+ */
+void QCommandLineOption::setHidden(bool hide)
+{
+ d->hidden = hide;
+}
+
+/*!
+ Returns true if this option is omitted from the help output,
+ false if the option is listed.
+
+ \since 5.6
+ \sa setHidden()
+ */
+bool QCommandLineOption::isHidden() const
+{
+ return d->hidden;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qcommandlineoption.h b/src/corelib/tools/qcommandlineoption.h
index cf4160ecd2..828522cbc5 100644
--- a/src/corelib/tools/qcommandlineoption.h
+++ b/src/corelib/tools/qcommandlineoption.h
@@ -58,11 +58,10 @@ public:
QCommandLineOption &operator=(const QCommandLineOption &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QCommandLineOption &operator=(QCommandLineOption &&other)
- { qSwap(d, other.d); return *this; }
+ QCommandLineOption &operator=(QCommandLineOption &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- inline void swap(QCommandLineOption &other)
+ void swap(QCommandLineOption &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
QStringList names() const;
@@ -77,6 +76,9 @@ public:
void setDefaultValues(const QStringList &defaultValues);
QStringList defaultValues() const;
+ void setHidden(bool hidden);
+ bool isHidden() const;
+
private:
QSharedDataPointer<QCommandLineOptionPrivate> d;
};
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index 0814921a58..2bc60c5b9e 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -53,6 +53,7 @@ class QCommandLineParserPrivate
public:
inline QCommandLineParserPrivate()
: singleDashWordOptionMode(QCommandLineParser::ParseAsCompactedShortOptions),
+ optionsAfterPositionalArgumentsMode(QCommandLineParser::ParseAsOptions),
builtinVersionOption(false),
builtinHelpOption(false),
needsParsing(true)
@@ -103,6 +104,9 @@ public:
//! The parsing mode for "-abc"
QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode;
+ //! How to parse "arg -option"
+ QCommandLineParser::OptionsAfterPositionalArgumentsMode optionsAfterPositionalArgumentsMode;
+
//! Whether addVersionOption was called
bool builtinVersionOption;
@@ -112,6 +116,7 @@ public:
//! True if parse() needs to be called
bool needsParsing;
};
+Q_DECLARE_TYPEINFO(QCommandLineParserPrivate::PositionalArgumentDefinition, Q_MOVABLE_TYPE);
QStringList QCommandLineParserPrivate::aliases(const QString &optionName) const
{
@@ -299,6 +304,41 @@ void QCommandLineParser::setSingleDashWordOptionMode(QCommandLineParser::SingleD
}
/*!
+ \enum QCommandLineParser::OptionsAfterPositionalArgumentsMode
+
+ This enum describes the way the parser interprets options that
+ occur after positional arguments.
+
+ \value ParseAsOptions \c{application argument --opt -t} is interpreted as setting
+ the options \c{opt} and \c{t}, just like \c{application --opt -t argument} would do.
+ This is the default parsing mode. In order to specify that \c{--opt} and \c{-t}
+ are positional arguments instead, the user can use \c{--}, as in
+ \c{application argument -- --opt -t}.
+
+ \value ParseAsPositionalArguments \c{application argument --opt} is interpreted as
+ having two positional arguments, \c{argument} and \c{--opt}.
+ This mode is useful for executables that aim to launch other executables
+ (e.g. wrappers, debugging tools, etc.) or that support internal commands
+ followed by options for the command. \c{argument} is the name of the command,
+ and all options occurring after it can be collected and parsed by another
+ command line parser, possibly in another executable.
+
+ \sa setOptionsAfterPositionalArgumentsMode()
+
+ \since 5.6
+*/
+
+/*!
+ Sets the parsing mode to \a parsingMode.
+ This must be called before process() or parse().
+ \since 5.6
+*/
+void QCommandLineParser::setOptionsAfterPositionalArgumentsMode(QCommandLineParser::OptionsAfterPositionalArgumentsMode parsingMode)
+{
+ d->optionsAfterPositionalArgumentsMode = parsingMode;
+}
+
+/*!
Adds the option \a option to look for while parsing.
Returns \c true if adding the option was successful; otherwise returns \c false.
@@ -500,7 +540,13 @@ static inline bool displayMessageBox()
static void showParserMessage(const QString &message, MessageType type)
{
-#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WINRT)
+ if (type == UsageMessage)
+ qInfo(qPrintable(message));
+ else
+ qCritical(qPrintable(message));
+ return;
+#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE)
if (displayMessageBox()) {
const UINT flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND
| (type == UsageMessage ? MB_ICONINFORMATION : MB_ICONERROR);
@@ -513,7 +559,7 @@ static void showParserMessage(const QString &message, MessageType type)
reinterpret_cast<const wchar_t *>(title.utf16()), flags);
return;
}
-#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WINCE
fputs(qPrintable(message), type == UsageMessage ? stdout : stderr);
}
@@ -640,7 +686,7 @@ bool QCommandLineParserPrivate::parse(const QStringList &args)
const QLatin1Char dashChar('-');
const QLatin1Char assignChar('=');
- bool doubleDashFound = false;
+ bool forcePositional = false;
errorText.clear();
positionalArgumentList.clear();
optionNames.clear();
@@ -658,7 +704,7 @@ bool QCommandLineParserPrivate::parse(const QStringList &args)
for (; argumentIterator != args.end() ; ++argumentIterator) {
QString argument = *argumentIterator;
- if (doubleDashFound) {
+ if (forcePositional) {
positionalArgumentList.append(argument);
} else if (argument.startsWith(doubleDashString)) {
if (argument.length() > 2) {
@@ -670,7 +716,7 @@ bool QCommandLineParserPrivate::parse(const QStringList &args)
error = true;
}
} else {
- doubleDashFound = true;
+ forcePositional = true;
}
} else if (argument.startsWith(dashChar)) {
if (argument.size() == 1) { // single dash ("stdin")
@@ -722,6 +768,8 @@ bool QCommandLineParserPrivate::parse(const QStringList &args)
}
} else {
positionalArgumentList.append(argument);
+ if (optionsAfterPositionalArgumentsMode == QCommandLineParser::ParseAsPositionalArguments)
+ forcePositional = true;
}
if (argumentIterator == args.end())
break;
@@ -1062,6 +1110,8 @@ QString QCommandLineParserPrivate::helpText() const
++longestOptionNameString;
for (int i = 0; i < commandLineOptionList.count(); ++i) {
const QCommandLineOption &option = commandLineOptionList.at(i);
+ if (option.isHidden())
+ continue;
text += wrapText(optionNameList.at(i), longestOptionNameString, option.description());
}
if (!positionalArgumentDefinitions.isEmpty()) {
diff --git a/src/corelib/tools/qcommandlineparser.h b/src/corelib/tools/qcommandlineparser.h
index 91a799b4d5..8c528ba69e 100644
--- a/src/corelib/tools/qcommandlineparser.h
+++ b/src/corelib/tools/qcommandlineparser.h
@@ -57,6 +57,12 @@ public:
};
void setSingleDashWordOptionMode(SingleDashWordOptionMode parsingMode);
+ enum OptionsAfterPositionalArgumentsMode {
+ ParseAsOptions,
+ ParseAsPositionalArguments
+ };
+ void setOptionsAfterPositionalArgumentsMode(OptionsAfterPositionalArgumentsMode mode);
+
bool addOption(const QCommandLineOption &commandLineOption);
bool addOptions(const QList<QCommandLineOption> &options);
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 42877ec664..1c74a602c6 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -65,7 +65,7 @@ typedef HashReturn (SHA3Init)(hashState *state, int hashbitlen);
typedef HashReturn (SHA3Update)(hashState *state, const BitSequence *data, DataLength databitlen);
typedef HashReturn (SHA3Final)(hashState *state, BitSequence *hashval);
-#if QT_POINTER_SIZE == 8 // 64 bit version
+#if Q_PROCESSOR_WORDSIZE == 8 // 64 bit version
#include "../../3rdparty/sha3/KeccakF-1600-opt64.c"
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index d6428920e5..ff20c57166 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -90,14 +90,25 @@ static inline QDate fixedDate(int y, int m, int d)
return result;
}
+/*
+ Until C++11, rounding direction is implementation-defined.
+
+ For negative operands, implementations may chose to round down instead of
+ towards zero (truncation). We only actually care about the case a < 0, as all
+ uses of floordiv have b > 0. In this case, if rounding is down we have a % b
+ >= 0 and simple division works fine; but a % b = a - (a / b) * b always, so
+ rounding towards zero gives a % b <= 0; when < 0, we need to adjust.
+
+ Once we assume C++11, we can safely test a < 0 instead of a % b < 0.
+ */
static inline qint64 floordiv(qint64 a, int b)
{
- return (a - (a < 0 ? b-1 : 0)) / b;
+ return (a - (a % b < 0 ? b - 1 : 0)) / b;
}
static inline int floordiv(int a, int b)
{
- return (a - (a < 0 ? b-1 : 0)) / b;
+ return (a - (a % b < 0 ? b - 1 : 0)) / b;
}
static inline qint64 julianDayFromDate(int year, int month, int day)
@@ -583,7 +594,7 @@ int QDate::weekNumber(int *yearNumber) const
Q_ASSERT(week == 52 || week == 53);
} else if (week == 53) {
// maybe first week of next year
- int w = (yday - 365 - (QDate::isLeapYear(year + 1) ? 1 : 0) - wday + 10) / 7;
+ int w = (yday - 365 - (QDate::isLeapYear(year) ? 1 : 0) - wday + 10) / 7;
if (w > 0) {
++year;
week = w;
@@ -1383,7 +1394,7 @@ bool QDate::isLeapYear(int y)
QTime uses the 24-hour clock format; it has no concept of AM/PM.
Unlike QDateTime, QTime knows nothing about time zones or
- daylight savings time (DST).
+ daylight-saving time (DST).
A QTime object is typically created either by giving the number
of hours, minutes, seconds, and milliseconds explicitly, or by
@@ -1728,7 +1739,7 @@ QTime QTime::addMSecs(int ms) const
QTime t;
if (isValid()) {
if (ms < 0) {
- // % not well-defined for -ve, but / is.
+ // %,/ not well-defined for -ve, so always work with +ve.
int negdays = (MSECS_PER_DAY - ms) / MSECS_PER_DAY;
t.mds = (ds() + ms + negdays * MSECS_PER_DAY) % MSECS_PER_DAY;
} else {
@@ -2059,7 +2070,7 @@ void QTime::start()
\warning If the system's clock setting has been changed since the
last time start() or restart() was called, the result is
- undefined. This can happen when daylight savings time is turned on
+ undefined. This can happen when daylight-saving time is turned on
or off.
\sa start(), elapsed(), currentTime()
@@ -2087,7 +2098,7 @@ int QTime::restart()
\warning If the system's clock setting has been changed since the
last time start() or restart() was called, the result is
- undefined. This can happen when daylight savings time is turned on
+ undefined. This can happen when daylight-saving time is turned on
or off.
\sa start(), restart()
@@ -2236,18 +2247,18 @@ static qint64 qt_mktime(QDate *date, QTime *time, QDateTimePrivate::DaylightStat
#else
// All other platforms provide standard C library time functions
tm local;
+ memset(&local, 0, sizeof(local)); // tm_[wy]day plus any non-standard fields
local.tm_sec = time->second();
local.tm_min = time->minute();
local.tm_hour = time->hour();
local.tm_mday = dd;
local.tm_mon = mm - 1;
local.tm_year = yy - 1900;
- local.tm_wday = 0;
- local.tm_yday = 0;
if (daylightStatus)
local.tm_isdst = int(*daylightStatus);
else
local.tm_isdst = -1;
+
#if defined(Q_OS_WIN)
int hh = local.tm_hour;
#endif // Q_OS_WIN
@@ -2301,7 +2312,7 @@ static qint64 qt_mktime(QDate *date, QTime *time, QDateTimePrivate::DaylightStat
}
// Calls the platform variant of localtime for the given msecs, and updates
-// the date, time, and daylight status with the returned values.
+// the date, time, and DST status with the returned values.
static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localTime,
QDateTimePrivate::DaylightStatus *daylightStatus)
{
@@ -2417,7 +2428,7 @@ static bool epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTime *localTi
*daylightStatus = QDateTimePrivate::StandardTime;
return true;
} else if (msecs > (qint64(TIME_T_MAX) * 1000)) {
- // Docs state any LocalTime after 2037-12-31 *will* have any Daylight Time applied
+ // Docs state any LocalTime after 2037-12-31 *will* have any DST applied
// but this may fall outside the supported time_t range, so need to fake it.
// Use existing method to fake the conversion, but this is deeply flawed as it may
// apply the conversion from the wrong day number, e.g. if rule is last Sunday of month
@@ -2442,7 +2453,7 @@ static bool epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTime *localTi
}
// Convert a LocalTime expressed in local msecs encoding and the corresponding
-// daylight status into a UTC epoch msecs. Optionally populate the returned
+// DST status into a UTC epoch msecs. Optionally populate the returned
// values from mktime for the adjusted local date and time.
static qint64 localMSecsToEpochMSecs(qint64 localMsecs,
QDateTimePrivate::DaylightStatus *daylightStatus,
@@ -2453,14 +2464,14 @@ static qint64 localMSecsToEpochMSecs(qint64 localMsecs,
QTime tm;
msecsToTime(localMsecs, &dt, &tm);
- qint64 msecsMax = qint64(TIME_T_MAX) * 1000;
+ const qint64 msecsMax = qint64(TIME_T_MAX) * 1000;
if (localMsecs <= qint64(MSECS_PER_DAY)) {
- // Docs state any LocalTime before 1970-01-01 will *not* have any Daylight Time applied
+ // Docs state any LocalTime before 1970-01-01 will *not* have any DST applied
// First, if localMsecs is within +/- 1 day of minimum time_t try mktime in case it does
- // fall after minimum and needs proper daylight conversion
+ // fall after minimum and needs proper DST conversion
if (localMsecs >= -qint64(MSECS_PER_DAY)) {
bool valid;
qint64 utcMsecs = qt_mktime(&dt, &tm, daylightStatus, abbreviation, &valid);
@@ -2488,11 +2499,11 @@ static qint64 localMSecsToEpochMSecs(qint64 localMsecs,
} else if (localMsecs >= msecsMax - MSECS_PER_DAY) {
- // Docs state any LocalTime after 2037-12-31 *will* have any Daylight Time applied
+ // Docs state any LocalTime after 2037-12-31 *will* have any DST applied
// but this may fall outside the supported time_t range, so need to fake it.
// First, if localMsecs is within +/- 1 day of maximum time_t try mktime in case it does
- // fall before maximum and can use proper daylight conversion
+ // fall before maximum and can use proper DST conversion
if (localMsecs <= msecsMax + MSECS_PER_DAY) {
bool valid;
qint64 utcMsecs = qt_mktime(&dt, &tm, daylightStatus, abbreviation, &valid);
@@ -2662,7 +2673,7 @@ void QDateTimePrivate::setDaylightStatus(QDateTimePrivate::DaylightStatus status
}
}
-// Get the Daylight Status if LocalTime set via msecs
+// Get the DST Status if LocalTime set via msecs
QDateTimePrivate::DaylightStatus QDateTimePrivate::daylightStatus() const
{
if ((m_status & SetToDaylightTime) == SetToDaylightTime)
@@ -2746,7 +2757,7 @@ void QDateTimePrivate::refreshDateTime()
#endif // QT_BOOTSTRAPPED
// We have a valid date and time and a Qt::LocalTime or Qt::TimeZone that needs calculating
- // LocalTime and TimeZone might fall into "missing" DaylightTime transition hour
+ // LocalTime and TimeZone might fall into a "missing" DST transition hour
// Calling toEpochMSecs will adjust the returned date/time if it does
QDate testDate;
QTime testTime;
@@ -2776,8 +2787,8 @@ qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone
{
// Get the effective data from QTimeZone
QTimeZonePrivate::Data data = zone.d->dataForLocalTime(zoneMSecs);
- // Docs state any LocalTime before 1970-01-01 will *not* have any Daylight Time applied
- // but all times afterwards will have Daylight Time applied.
+ // Docs state any LocalTime before 1970-01-01 will *not* have any DST applied
+ // but all affected times afterwards will have DST applied.
if (data.atMSecsSinceEpoch >= 0) {
msecsToTime(data.atMSecsSinceEpoch + (data.offsetFromUtc * 1000), localDate, localTime);
return data.atMSecsSinceEpoch;
@@ -2836,7 +2847,7 @@ qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone
QDateTime expressed as local time; use toUTC() to convert it to
UTC. You can also use timeSpec() to find out if a QDateTime
object stores a UTC time or a local time. Operations such as
- addSecs() and secsTo() are aware of daylight saving time (DST).
+ addSecs() and secsTo() are aware of daylight-saving time (DST).
\note QDateTime does not account for leap seconds.
@@ -2866,7 +2877,7 @@ qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone
correctly or not up-to-date, QDateTime will give wrong results as
well.
- \section2 Daylight Savings Time (DST)
+ \section2 Daylight-Saving Time (DST)
QDateTime takes into account the system's time zone information
when dealing with DST. On modern Unix systems, this means it
@@ -2884,7 +2895,7 @@ qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone
time zone before 1970, even if the system's time zone database
supports that information.
- QDateTime takes into consideration the Standard Time to Daylight Time
+ QDateTime takes into consideration the Standard Time to Daylight-Saving Time
transition. For example if the transition is at 2am and the clock goes
forward to 3am, then there is a "missing" hour from 02:00:00 to 02:59:59.999
which QDateTime considers to be invalid. Any date maths performed
@@ -2896,7 +2907,7 @@ qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone
to define a QDateTime relative to UTC at a fixed offset of a given number
of seconds from UTC. For example, an offset of +3600 seconds is one hour
ahead of UTC and is usually written in ISO standard notation as
- "UTC+01:00". Daylight Savings Time never applies with this TimeSpec.
+ "UTC+01:00". Daylight-Saving Time never applies with this TimeSpec.
There is no explicit size restriction to the offset seconds, but there is
an implicit limit imposed when using the toString() and fromString()
@@ -2908,8 +2919,8 @@ qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QTimeZone
A Qt::TimeSpec of Qt::TimeZone is also supported in conjunction with the
QTimeZone class. This allows you to define a datetime in a named time zone
- adhering to a consistent set of daylight savings transition rules. For
- example a time zone of "Europe/Berlin" will apply the daylight savings
+ adhering to a consistent set of daylight-saving transition rules. For
+ example a time zone of "Europe/Berlin" will apply the daylight-saving
rules as used in Germany since 1970. Note that the transition rules
applied depend on the platform support. See the QTimeZone documentation
for more details.
@@ -3051,7 +3062,7 @@ bool QDateTime::isNull() const
the current Qt::TimeSpec, otherwise returns \c false.
If the timeSpec() is Qt::LocalTime or Qt::TimeZone then the date and time are
- checked to see if they fall in the Standard Time to Daylight Time transition
+ checked to see if they fall in the Standard Time to Daylight-Saving Time transition
hour, i.e. if the transition is at 2am and the clock goes forward to 3am
then the time from 02:00:00 to 02:59:59.999 is considered to be invalid.
@@ -3142,10 +3153,10 @@ QTimeZone QDateTime::timeZone() const
If the timeSpec() is Qt::OffsetFromUTC this will be the value originally set.
If the timeSpec() is Qt::TimeZone this will be the offset effective in the
- Time Zone including any Daylight Saving Offset.
+ Time Zone including any Daylight-Saving Offset.
If the timeSpec() is Qt::LocalTime this will be the difference between the
- Local Time and UTC including any Daylight Saving Offset.
+ Local Time and UTC including any Daylight-Saving Offset.
If the timeSpec() is Qt::UTC this will be 0.
@@ -3202,7 +3213,7 @@ QString QDateTime::timeZoneAbbreviation() const
/*!
\since 5.2
- Returns if this datetime falls in Daylight Savings Time.
+ Returns if this datetime falls in Daylight-Saving Time.
If the Qt::TimeSpec is not Qt::LocalTime or Qt::TimeZone then will always
return false.
@@ -3415,8 +3426,8 @@ void QDateTime::setMSecsSinceEpoch(qint64 msecs)
break;
case Qt::TimeZone:
#ifndef QT_BOOTSTRAPPED
- // Docs state any LocalTime before 1970-01-01 will *not* have any Daylight Time applied
- // but all times afterwards will have Daylight Time applied.
+ // Docs state any LocalTime before 1970-01-01 will *not* have any DST applied
+ // but all affected times afterwards will have DST applied.
if (msecs >= 0)
d->m_offsetFromUtc = d->m_timeZone.d->offsetFromUtc(msecs);
else
@@ -3652,13 +3663,47 @@ QString QDateTime::toString(const QString& format) const
}
#endif //QT_NO_DATESTRING
+static void massageAdjustedDateTime(Qt::TimeSpec spec,
+#ifndef QT_BOOTSTRAPPED
+ const QTimeZone &zone,
+#endif // QT_BOOTSTRAPPED
+ QDate *date,
+ QTime *time)
+{
+ /*
+ If we have just adjusted to a day with a DST transition, our given time
+ may lie in the transition hour (either missing or duplicated). For any
+ other time, telling mktime (deep in the bowels of localMSecsToEpochMSecs)
+ we don't know its DST-ness will produce no adjustment (just a decision as
+ to its DST-ness); but for a time in spring's missing hour it'll adjust the
+ time while picking a DST-ness. (Handling of autumn is trickier, as either
+ DST-ness is valid, without adjusting the time. We might want to propagate
+ d->daylightStatus() in that case, but it's hard to do so without breaking
+ (far more common) other cases; and it makes little difference, as the two
+ answers do then differ only in DST-ness.)
+ */
+ if (spec == Qt::LocalTime) {
+ QDateTimePrivate::DaylightStatus status = QDateTimePrivate::UnknownDaylightTime;
+ localMSecsToEpochMSecs(timeToMSecs(*date, *time), &status, date, time);
+#ifndef QT_BOOTSTRAPPED
+ } else if (spec == Qt::TimeZone) {
+ QDateTimePrivate::zoneMSecsToEpochMSecs(timeToMSecs(*date, *time), zone, date, time);
+#endif // QT_BOOTSTRAPPED
+ }
+}
+#ifdef QT_BOOTSTRAPPED // Avoid duplicate #if-ery in uses.
+#define MASSAGEADJUSTEDDATETIME(s, z, d, t) massageAdjustedDateTime(s, d, t)
+#else
+#define MASSAGEADJUSTEDDATETIME(s, z, d, t) massageAdjustedDateTime(s, z, d, t)
+#endif // QT_BOOTSTRAPPED
+
/*!
Returns a QDateTime object containing a datetime \a ndays days
later than the datetime of this object (or earlier if \a ndays is
negative).
If the timeSpec() is Qt::LocalTime and the resulting
- date and time fall in the Standard Time to Daylight Time transition
+ date and time fall in the Standard Time to Daylight-Saving Time transition
hour then the result will be adjusted accordingly, i.e. if the transition
is at 2am and the clock goes forward to 3am and the result falls between
2am and 3am then the result will be adjusted to fall after 3am.
@@ -3673,16 +3718,7 @@ QDateTime QDateTime::addDays(qint64 ndays) const
QDate &date = p.first;
QTime &time = p.second;
date = date.addDays(ndays);
- // Result might fall into "missing" DaylightTime transition hour,
- // so call conversion and use the adjusted returned time
- if (d->m_spec == Qt::LocalTime) {
- QDateTimePrivate::DaylightStatus status = d->daylightStatus();
- localMSecsToEpochMSecs(timeToMSecs(date, time), &status, &date, &time);
-#ifndef QT_BOOTSTRAPPED
- } else if (d->m_spec == Qt::TimeZone) {
- QDateTimePrivate::zoneMSecsToEpochMSecs(timeToMSecs(date, time), d->m_timeZone, &date, &time);
-#endif // QT_BOOTSTRAPPED
- }
+ MASSAGEADJUSTEDDATETIME(d->m_spec, d->m_timeZone, &date, &time);
dt.d->setDateTime(date, time);
return dt;
}
@@ -3693,7 +3729,7 @@ QDateTime QDateTime::addDays(qint64 ndays) const
is negative).
If the timeSpec() is Qt::LocalTime and the resulting
- date and time fall in the Standard Time to Daylight Time transition
+ date and time fall in the Standard Time to Daylight-Saving Time transition
hour then the result will be adjusted accordingly, i.e. if the transition
is at 2am and the clock goes forward to 3am and the result falls between
2am and 3am then the result will be adjusted to fall after 3am.
@@ -3708,16 +3744,7 @@ QDateTime QDateTime::addMonths(int nmonths) const
QDate &date = p.first;
QTime &time = p.second;
date = date.addMonths(nmonths);
- // Result might fall into "missing" DaylightTime transition hour,
- // so call conversion and use the adjusted returned time
- if (d->m_spec == Qt::LocalTime) {
- QDateTimePrivate::DaylightStatus status = d->daylightStatus();
- localMSecsToEpochMSecs(timeToMSecs(date, time), &status, &date, &time);
-#ifndef QT_BOOTSTRAPPED
- } else if (d->m_spec == Qt::TimeZone) {
- QDateTimePrivate::zoneMSecsToEpochMSecs(timeToMSecs(date, time), d->m_timeZone, &date, &time);
-#endif // QT_BOOTSTRAPPED
- }
+ MASSAGEADJUSTEDDATETIME(d->m_spec, d->m_timeZone, &date, &time);
dt.d->setDateTime(date, time);
return dt;
}
@@ -3728,7 +3755,7 @@ QDateTime QDateTime::addMonths(int nmonths) const
negative).
If the timeSpec() is Qt::LocalTime and the resulting
- date and time fall in the Standard Time to Daylight Time transition
+ date and time fall in the Standard Time to Daylight-Saving Time transition
hour then the result will be adjusted accordingly, i.e. if the transition
is at 2am and the clock goes forward to 3am and the result falls between
2am and 3am then the result will be adjusted to fall after 3am.
@@ -3743,19 +3770,11 @@ QDateTime QDateTime::addYears(int nyears) const
QDate &date = p.first;
QTime &time = p.second;
date = date.addYears(nyears);
- // Result might fall into "missing" DaylightTime transition hour,
- // so call conversion and use the adjusted returned time
- if (d->m_spec == Qt::LocalTime) {
- QDateTimePrivate::DaylightStatus status = d->daylightStatus();
- localMSecsToEpochMSecs(timeToMSecs(date, time), &status, &date, &time);
-#ifndef QT_BOOTSTRAPPED
- } else if (d->m_spec == Qt::TimeZone) {
- QDateTimePrivate::zoneMSecsToEpochMSecs(timeToMSecs(date, time), d->m_timeZone, &date, &time);
-#endif // QT_BOOTSTRAPPED
- }
+ MASSAGEADJUSTEDDATETIME(d->m_spec, d->m_timeZone, &date, &time);
dt.d->setDateTime(date, time);
return dt;
}
+#undef MASSAGEADJUSTEDDATETIME
/*!
Returns a QDateTime object containing a datetime \a s seconds
@@ -3788,7 +3807,7 @@ QDateTime QDateTime::addMSecs(qint64 msecs) const
QDateTime dt(*this);
if (d->m_spec == Qt::LocalTime || d->m_spec == Qt::TimeZone)
- // Convert to real UTC first in case crosses daylight transition
+ // Convert to real UTC first in case crosses DST transition
dt.setMSecsSinceEpoch(d->toMSecsSinceEpoch() + msecs);
else
// No need to convert, just add on
@@ -3823,8 +3842,8 @@ qint64 QDateTime::daysTo(const QDateTime &other) const
the value returned is negative.
Before performing the comparison, the two datetimes are converted
- to Qt::UTC to ensure that the result is correct if one of the two
- datetimes has daylight saving time (DST) and the other doesn't.
+ to Qt::UTC to ensure that the result is correct if daylight-saving
+ (DST) applies to one of the two datetimes but not the other.
Returns 0 if either datetime is invalid.
@@ -3845,8 +3864,8 @@ qint64 QDateTime::secsTo(const QDateTime &other) const
the value returned is negative.
Before performing the comparison, the two datetimes are converted
- to Qt::UTC to ensure that the result is correct if one of the two
- datetimes has daylight saving time (DST) and the other doesn't.
+ to Qt::UTC to ensure that the result is correct if daylight-saving
+ (DST) applies to one of the two datetimes and but not the other.
Returns 0 if either datetime is invalid.
@@ -4793,23 +4812,21 @@ QDataStream &operator<<(QDataStream &out, const QDateTime &dateTime)
// From 4.0 to 5.1 (except 5.0) we used QDateTimePrivate::Spec
dateAndTime = dateTime.d->getDateTime();
out << dateAndTime;
- if (out.version() >= QDataStream::Qt_4_0) {
- switch (dateTime.timeSpec()) {
- case Qt::UTC:
- out << (qint8)QDateTimePrivate::UTC;
- break;
- case Qt::OffsetFromUTC:
- out << (qint8)QDateTimePrivate::OffsetFromUTC;
- break;
- case Qt::TimeZone:
+ switch (dateTime.timeSpec()) {
+ case Qt::UTC:
+ out << (qint8)QDateTimePrivate::UTC;
+ break;
+ case Qt::OffsetFromUTC:
+ out << (qint8)QDateTimePrivate::OffsetFromUTC;
+ break;
+ case Qt::TimeZone:
#ifndef QT_BOOTSTRAPPED
- out << (qint8)QDateTimePrivate::TimeZone;
- break;
+ out << (qint8)QDateTimePrivate::TimeZone;
+ break;
#endif // QT_BOOTSTRAPPED
- case Qt::LocalTime:
- out << (qint8)QDateTimePrivate::LocalUnknown;
- break;
- }
+ case Qt::LocalTime:
+ out << (qint8)QDateTimePrivate::LocalUnknown;
+ break;
}
} else { // version < QDataStream::Qt_4_0
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 6651efdc13..c44f7f8fee 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -74,7 +74,7 @@ public:
int dayOfYear() const;
int daysInMonth() const;
int daysInYear() const;
- int weekNumber(int *yearNum = 0) const;
+ int weekNumber(int *yearNum = Q_NULLPTR) const;
#ifndef QT_NO_TEXTDATE
static QString shortMonthName(int month, MonthNameType type = DateFormat);
@@ -222,9 +222,12 @@ public:
QDateTime(const QDateTime &other);
~QDateTime();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDateTime &operator=(QDateTime &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QDateTime &operator=(const QDateTime &other);
- inline void swap(QDateTime &other) { qSwap(d, other.d); }
+ void swap(QDateTime &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool isNull() const;
bool isValid() const;
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index 9457e35ad5..a1cf8f283f 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -252,6 +252,7 @@ public:
Qt::TimeSpec spec; // spec if used by QDateTimeEdit
Context context;
};
+Q_DECLARE_TYPEINFO(QDateTimeParser::SectionNode, Q_PRIMITIVE_TYPE);
Q_CORE_EXPORT bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::SectionNode &s2);
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 1bd9c5ebb9..012e6a95e8 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -170,7 +170,7 @@
\value OutSine \image qeasingcurve-outsine.png
\caption
Easing curve for a sinusoidal (sin(t)) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutSine \image qeasingcurve-inoutsine.png
\caption
Easing curve for a sinusoidal (sin(t)) function:
@@ -186,7 +186,7 @@
\value OutExpo \image qeasingcurve-outexpo.png
\caption
Easing curve for an exponential (2^t) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutExpo \image qeasingcurve-inoutexpo.png
\caption
Easing curve for an exponential (2^t) function:
@@ -202,7 +202,7 @@
\value OutCirc \image qeasingcurve-outcirc.png
\caption
Easing curve for a circular (sqrt(1-t^2)) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutCirc \image qeasingcurve-inoutcirc.png
\caption
Easing curve for a circular (sqrt(1-t^2)) function:
@@ -222,7 +222,7 @@
\caption
Easing curve for an elastic
(exponentially decaying sine wave) function:
- decelerating from zero velocity. The peak amplitude
+ decelerating to zero velocity. The peak amplitude
can be set with the \e amplitude parameter, and the
period of decay by the \e period parameter.
\value InOutElastic \image qeasingcurve-inoutelastic.png
@@ -340,6 +340,7 @@ struct TCBPoint {
qFuzzyCompare(_b, other._b);
}
};
+Q_DECLARE_TYPEINFO(TCBPoint, Q_PRIMITIVE_TYPE);
typedef QVector<TCBPoint> TCBPoints;
@@ -1219,6 +1220,7 @@ QVector<QPointF> static inline tcbToBezier(const TCBPoints &tcbPoints)
{
const int count = tcbPoints.count();
QVector<QPointF> bezierPoints;
+ bezierPoints.reserve(3 * (count - 1));
for (int i = 1; i < count; i++) {
const qreal t_0 = tcbPoints.at(i - 1)._t;
diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h
index 4065de1366..d04d5ef30a 100644
--- a/src/corelib/tools/qeasingcurve.h
+++ b/src/corelib/tools/qeasingcurve.h
@@ -75,7 +75,7 @@ public:
QEasingCurve &operator=(const QEasingCurve &other)
{ if ( this != &other ) { QEasingCurve copy(other); swap(copy); } return *this; }
#ifdef Q_COMPILER_RVALUE_REFS
- QEasingCurve(QEasingCurve &&other) : d_ptr(other.d_ptr) { other.d_ptr = 0; }
+ QEasingCurve(QEasingCurve &&other) : d_ptr(other.d_ptr) { other.d_ptr = Q_NULLPTR; }
QEasingCurve &operator=(QEasingCurve &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp
index 41e8b4854d..8360f11632 100644
--- a/src/corelib/tools/qelapsedtimer.cpp
+++ b/src/corelib/tools/qelapsedtimer.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
platforms that support it (see QElapsedTimer::isMonotonic()). This has
the added benefit that QElapsedTimer is immune to time adjustments, such
as the user correcting the time. Also unlike QTime, QElapsedTimer is
- immune to changes in the timezone settings, such as daylight saving
+ immune to changes in the timezone settings, such as daylight-saving
periods.
On the other hand, this means QElapsedTimer values can only be compared
diff --git a/src/corelib/tools/qharfbuzz.cpp b/src/corelib/tools/qharfbuzz.cpp
index afc8b23473..fa279949ea 100644
--- a/src/corelib/tools/qharfbuzz.cpp
+++ b/src/corelib/tools/qharfbuzz.cpp
@@ -65,6 +65,9 @@ HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch)
void (*HB_Library_Resolve(const char *library, int version, const char *symbol))()
{
#ifdef QT_NO_LIBRARY
+ Q_UNUSED(library);
+ Q_UNUSED(version);
+ Q_UNUSED(symbol);
return 0;
#else
return QLibrary::resolve(QLatin1String(library), version, symbol);
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index a8a461e868..b334a697a9 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -290,6 +290,53 @@ static void qt_initialize_qhash_seed()
}
}
+/*! \relates QHash
+ \since 5.6
+
+ Returns the current global QHash seed.
+
+ The seed is set in any newly created QHash. See \l{qHash} about how this seed
+ is being used by QHash.
+
+ \sa qSetGlobalQHashSeed
+ */
+int qGlobalQHashSeed()
+{
+ return qt_qhash_seed.load();
+}
+
+/*! \relates QHash
+ \since 5.6
+
+ Sets the global QHash seed.
+
+ Manually setting the global QHash seed value should be done only for testing
+ and debugging purposes, when deterministic and reproducible behavior on a QHash
+ is needed. We discourage to do it in production code as it can make your
+ application susceptible to \l{algorithmic complexity attacks}.
+
+ 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)
+{
+ if (qEnvironmentVariableIsSet("QT_HASH_SEED"))
+ return;
+ if (newSeed == -1) {
+ int x(qt_create_qhash_seed() & INT_MAX);
+ qt_qhash_seed.store(x);
+ } else {
+ qt_qhash_seed.store(newSeed & INT_MAX);
+ }
+}
+
/*!
\internal
@@ -1132,7 +1179,8 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
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().
+ decimal value, will be used as the seed for qHash(). Alternatively, you can
+ call the qSetGlobalQHashSeed() function.
\sa QHashIterator, QMutableHashIterator, QMap, QSet
*/
@@ -1536,6 +1584,15 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
\sa begin(), constEnd()
*/
+/*! \fn QHash::key_iterator QHash::keyBegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first key
+ in the hash.
+
+ \sa keyEnd()
+*/
+
/*! \fn QHash::iterator QHash::end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
@@ -1566,6 +1623,15 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
\sa cbegin(), end()
*/
+/*! \fn QHash::key_iterator QHash::keyEnd() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ item after the last key in the hash.
+
+ \sa keyBegin()
+*/
+
/*! \fn QHash::iterator QHash::erase(iterator pos)
Removes the (key, value) pair associated with the iterator \a pos
@@ -1729,6 +1795,26 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
\internal
*/
+/*! \typedef QHash::key_iterator::difference_type
+ \internal
+*/
+
+/*! \typedef QHash::key_iterator::iterator_category
+ \internal
+*/
+
+/*! \typedef QHash::key_iterator::pointer
+ \internal
+*/
+
+/*! \typedef QHash::key_iterator::reference
+ \internal
+*/
+
+/*! \typedef QHash::key_iterator::value_type
+ \internal
+*/
+
/*! \class QHash::iterator
\inmodule QtCore
\brief The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
@@ -1802,7 +1888,7 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
while iterators are active on that container. For more information,
read \l{Implicit sharing iterator problem}.
- \sa QHash::const_iterator, QMutableHashIterator
+ \sa QHash::const_iterator, QHash::key_iterator, QMutableHashIterator
*/
/*! \fn QHash::iterator::iterator()
@@ -2155,6 +2241,114 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
\sa operator+=(), operator-()
*/
+/*! \class QHash::key_iterator
+ \inmodule QtCore
+ \since 5.6
+ \brief The QHash::key_iterator class provides an STL-style const iterator for QHash and QMultiHash keys.
+
+ QHash::key_iterator is essentially the same as QHash::const_iterator
+ with the difference that operator*() and operator->() return a key
+ instead of a value.
+
+ For most uses QHash::iterator and QHash::const_iterator should be used,
+ you can easily access the key by calling QHash::iterator::key():
+
+ \snippet code/src_corelib_tools_qhash.cpp 27
+
+ However, to have interoperability between QHash's keys and STL-style
+ algorithms we need an iterator that dereferences to a key instead
+ of a value. With QHash::key_iterator we can apply an algorithm to a
+ range of keys without having to call QHash::keys(), which is inefficient
+ as it costs one QHash iteration and memory allocation to create a temporary
+ QList.
+
+ \snippet code/src_corelib_tools_qhash.cpp 28
+
+ QHash::key_iterator is const, it's not possible to modify the key.
+
+ The default QHash::key_iterator constructor creates an uninitialized
+ iterator. You must initialize it using a QHash function like
+ QHash::keyBegin() or QHash::keyEnd().
+
+ \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}.
+
+ \sa QHash::const_iterator, QHash::iterator
+*/
+
+/*! \fn const T &QHash::key_iterator::operator*() const
+
+ Returns the current item's key.
+*/
+
+/*! \fn const T *QHash::key_iterator::operator->() const
+
+ Returns a pointer to the current item's key.
+*/
+
+/*! \fn bool QHash::key_iterator::operator==(key_iterator other) const
+
+ Returns \c true if \a other points to the same item as this
+ iterator; otherwise returns \c false.
+
+ \sa operator!=()
+*/
+
+/*! \fn bool QHash::key_iterator::operator!=(key_iterator other) const
+
+ Returns \c true if \a other points to a different item than this
+ iterator; otherwise returns \c false.
+
+ \sa operator==()
+*/
+
+/*!
+ \fn QHash::key_iterator &QHash::key_iterator::operator++()
+
+ The prefix ++ operator (\c{++i}) advances the iterator to the
+ next item in the hash and returns an iterator to the new current
+ item.
+
+ Calling this function on QHash::keyEnd() leads to undefined results.
+
+ \sa operator--()
+*/
+
+/*! \fn QHash::key_iterator QHash::key_iterator::operator++(int)
+
+ \overload
+
+ The postfix ++ operator (\c{i++}) advances the iterator to the
+ next item in the hash and returns an iterator to the previous
+ item.
+*/
+
+/*! \fn QHash::key_iterator &QHash::key_iterator::operator--()
+
+ The prefix -- operator (\c{--i}) makes the preceding item
+ current and returns an iterator pointing to the new current item.
+
+ Calling this function on QHash::keyBegin() leads to undefined
+ results.
+
+ \sa operator++()
+*/
+
+/*! \fn QHash::key_iterator QHash::key_iterator::operator--(int)
+
+ \overload
+
+ The postfix -- operator (\c{i--}) makes the preceding item
+ current and returns an iterator pointing to the previous
+ item.
+*/
+
+/*! \fn const_iterator QHash::key_iterator::base() const
+ Returns the underlying const_iterator this key_iterator is based on.
+*/
+
/*! \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 a9ece12670..a18dd74706 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -38,10 +38,9 @@
#include <QtCore/qchar.h>
#include <QtCore/qiterator.h>
#include <QtCore/qlist.h>
-#include <QtCore/qpair.h>
#include <QtCore/qrefcount.h>
+#include <QtCore/qhashfunctions.h>
-#include <numeric> // for std::accumulate
#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
#endif
@@ -54,101 +53,6 @@
QT_BEGIN_NAMESPACE
-class QBitArray;
-class QByteArray;
-class QString;
-class QStringRef;
-class QLatin1String;
-
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW;
-
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uchar key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(signed char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ushort key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(short key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uint key, uint seed = 0) Q_DECL_NOTHROW { return key ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(int key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ulong key, uint seed = 0) Q_DECL_NOTHROW
-{
- return (sizeof(ulong) > sizeof(uint))
- ? (uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed)
- : (uint(key & (~0U)) ^ seed);
-}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(long key, uint seed = 0) Q_DECL_NOTHROW { return qHash(ulong(key), seed); }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(quint64 key, uint seed = 0) Q_DECL_NOTHROW
-{
- return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed;
-}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(qint64 key, uint seed = 0) Q_DECL_NOTHROW { return qHash(quint64(key), seed); }
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(float key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(double key, uint seed = 0) Q_DECL_NOTHROW;
-#ifndef Q_OS_DARWIN
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) Q_DECL_NOTHROW;
-#endif
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(const QChar key, uint seed = 0) Q_DECL_NOTHROW { return qHash(key.unicode(), seed); }
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QByteArray &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QString &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QStringRef &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const 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;
-
-template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW
-{
- return qHash(reinterpret_cast<quintptr>(key), seed);
-}
-template<typename T> inline uint qHash(const T &t, uint seed)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
-{ return (qHash(t) ^ seed); }
-
-namespace QtPrivate {
-
-struct QHashCombine {
- typedef uint result_type;
- template <typename T>
- Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
- // combiner taken from N3876 / boost::hash_combine
- { return seed ^ (qHash(t) + 0x9e3779b9 + (seed << 6) + (seed >> 2)) ; }
-};
-
-struct QHashCombineCommutative {
- // QHashCombine is a good hash combiner, but is not commutative,
- // ie. it depends on the order of the input elements. That is
- // usually what we want: {0,1,3} should hash differently than
- // {1,3,0}. Except when it isn't (e.g. for QSet and
- // QHash). Therefore, provide a commutative combiner, too.
- typedef uint result_type;
- template <typename T>
- Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
- { return seed + qHash(t); } // don't use xor!
-};
-
-} // namespace QtPrivate
-
-template <typename InputIterator>
-inline uint qHashRange(InputIterator first, InputIterator last, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw
-{
- return std::accumulate(first, last, seed, QtPrivate::QHashCombine());
-}
-
-template <typename InputIterator>
-inline uint qHashRangeCommutative(InputIterator first, InputIterator last, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw
-{
- return std::accumulate(first, last, seed, QtPrivate::QHashCombineCommutative());
-}
-
-template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed)))
-{
- uint h1 = qHash(key.first, seed);
- uint h2 = qHash(key.second, seed);
- return ((h1 << 16) | (h1 >> 16)) ^ h2 ^ seed;
-}
-
struct Q_CORE_EXPORT QHashData
{
struct Node {
@@ -345,7 +249,7 @@ public:
#ifdef Q_COMPILER_RVALUE_REFS
QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
QHash &operator=(QHash &&other) Q_DECL_NOTHROW
- { qSwap(d, other.d); return *this; }
+ { QHash moved(std::move(other)); swap(moved); return *this; }
#endif
void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
@@ -402,7 +306,7 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(0) { }
+ inline iterator() : i(Q_NULLPTR) { }
explicit inline iterator(void *node) : i(reinterpret_cast<QHashData::Node *>(node)) { }
inline const Key &key() const { return concrete(i)->key; }
@@ -449,6 +353,7 @@ public:
class const_iterator
{
friend class iterator;
+ friend class QSet<Key>;
QHashData::Node *i;
public:
@@ -458,7 +363,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() : i(0) { }
+ inline const_iterator() : i(Q_NULLPTR) { }
explicit inline const_iterator(void *node)
: i(reinterpret_cast<QHashData::Node *>(node)) { }
#ifdef QT_STRICT_ITERATORS
@@ -508,6 +413,31 @@ public:
};
friend class const_iterator;
+ class key_iterator
+ {
+ const_iterator i;
+
+ public:
+ typedef typename const_iterator::iterator_category iterator_category;
+ typedef typename const_iterator::difference_type difference_type;
+ typedef Key value_type;
+ typedef const Key *pointer;
+ typedef const Key &reference;
+
+ explicit key_iterator(const_iterator o) : i(o) { }
+
+ const Key &operator*() const { return i.key(); }
+ const Key *operator->() const { return &i.key(); }
+ bool operator==(key_iterator o) const { return i == o.i; }
+ bool operator!=(key_iterator o) const { return i != o.i; }
+
+ inline key_iterator &operator++() { ++i; return *this; }
+ inline key_iterator operator++(int) { return key_iterator(i++);}
+ inline key_iterator &operator--() { --i; return *this; }
+ inline key_iterator operator--(int) { return key_iterator(i--); }
+ const_iterator base() const { return i; }
+ };
+
// STL style
inline iterator begin() { detach(); return iterator(d->firstNode()); }
inline const_iterator begin() const { return const_iterator(d->firstNode()); }
@@ -517,6 +447,9 @@ public:
inline const_iterator end() const { return const_iterator(e); }
inline const_iterator cend() const { return const_iterator(e); }
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()); }
+
iterator erase(iterator it);
// more Qt
@@ -546,7 +479,8 @@ public:
private:
void detach_helper();
void freeData(QHashData *d);
- Node **findNode(const Key &key, uint *hp = 0) const;
+ Node **findNode(const Key &key, uint *hp = Q_NULLPTR) const;
+ Node **findNode(const Key &key, uint h) const;
Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
void deleteNode(Node *node);
static void deleteNode2(QHashData::Node *node);
@@ -590,7 +524,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
{
Node *concreteNode = concrete(node);
- new (newNode) Node(concreteNode->key, concreteNode->value, concreteNode->h, 0);
+ new (newNode) Node(concreteNode->key, concreteNode->value, concreteNode->h, Q_NULLPTR);
}
template <class Key, class T>
@@ -942,17 +876,10 @@ Q_INLINE_TEMPLATE bool QHash<Key, T>::contains(const Key &akey) const
}
template <class Key, class T>
-Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
- uint *ahp) const
+Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey, uint h) const
{
Node **node;
- uint h = 0;
- if (d->numBuckets || ahp) {
- h = qHash(akey, d->seed);
- if (ahp)
- *ahp = h;
- }
if (d->numBuckets) {
node = reinterpret_cast<Node **>(&d->buckets[h % d->numBuckets]);
Q_ASSERT(*node == e || (*node)->next);
@@ -965,6 +892,20 @@ Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(cons
}
template <class Key, class T>
+Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
+ uint *ahp) const
+{
+ uint h = 0;
+
+ if (d->numBuckets || ahp) {
+ h = qHash(akey, d->seed);
+ if (ahp)
+ *ahp = h;
+ }
+ return findNode(akey, h);
+}
+
+template <class Key, class T>
Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
{
if (size() != other.size())
@@ -994,7 +935,7 @@ template <class Key, class T>
class QMultiHash : public QHash<Key, T>
{
public:
- QMultiHash() {}
+ QMultiHash() Q_DECL_NOTHROW {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QMultiHash(std::initializer_list<std::pair<Key,T> > list)
{
@@ -1003,8 +944,14 @@ public:
insert(it->first, it->second);
}
#endif
+ // compiler-generated copy/move ctors/assignment operators are fine!
+ // compiler-generated destructor is fine!
+
QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
- void swap(QMultiHash &other) { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
+#ifdef Q_COMPILER_RVALUE_REFS
+ QMultiHash(QHash<Key, T> &&other) Q_DECL_NOTHROW : QHash<Key, T>(std::move(other)) {}
+#endif
+ void swap(QMultiHash &other) Q_DECL_NOTHROW { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
{ return QHash<Key, T>::insert(key, value); }
@@ -1093,6 +1040,9 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::count(const Key &key, const T &value)
return n;
}
+Q_CORE_EXPORT int qGlobalQHashSeed();
+Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
+
Q_DECLARE_ASSOCIATIVE_ITERATOR(Hash)
Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash)
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
new file mode 100644
index 0000000000..e15fbb07ac
--- /dev/null
+++ b/src/corelib/tools/qhashfunctions.h
@@ -0,0 +1,156 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 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: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 QHASHFUNCTIONS_H
+#define QHASHFUNCTIONS_H
+
+#include <QtCore/qchar.h>
+#include <QtCore/qpair.h>
+
+#include <numeric> // for std::accumulate
+
+#if 0
+#pragma qt_class(QHashFunctions)
+#endif
+
+#if defined(Q_CC_MSVC)
+#pragma warning( push )
+#pragma warning( disable : 4311 ) // disable pointer truncation warning
+#pragma warning( disable : 4127 ) // conditional expression is constant
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QBitArray;
+class QByteArray;
+class QString;
+class QStringRef;
+class QLatin1String;
+
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW;
+
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uchar key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(signed char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ushort key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(short key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uint key, uint seed = 0) Q_DECL_NOTHROW { return key ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(int key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ulong key, uint seed = 0) Q_DECL_NOTHROW
+{
+ return (sizeof(ulong) > sizeof(uint))
+ ? (uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed)
+ : (uint(key & (~0U)) ^ seed);
+}
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(long key, uint seed = 0) Q_DECL_NOTHROW { return qHash(ulong(key), seed); }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(quint64 key, uint seed = 0) Q_DECL_NOTHROW
+{
+ return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed;
+}
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(qint64 key, uint seed = 0) Q_DECL_NOTHROW { return qHash(quint64(key), seed); }
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(float key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(double key, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef Q_OS_DARWIN
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) Q_DECL_NOTHROW;
+#endif
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(const QChar key, uint seed = 0) Q_DECL_NOTHROW { return qHash(key.unicode(), seed); }
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QByteArray &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QString &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QStringRef &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const 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;
+
+template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW
+{
+ return qHash(reinterpret_cast<quintptr>(key), seed);
+}
+template<typename T> inline uint qHash(const T &t, uint seed)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
+{ return qHash(t) ^ seed; }
+
+namespace QtPrivate {
+
+struct QHashCombine {
+ typedef uint result_type;
+ template <typename T>
+ Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
+ // combiner taken from N3876 / boost::hash_combine
+ { return seed ^ (qHash(t) + 0x9e3779b9 + (seed << 6) + (seed >> 2)) ; }
+};
+
+struct QHashCombineCommutative {
+ // QHashCombine is a good hash combiner, but is not commutative,
+ // ie. it depends on the order of the input elements. That is
+ // usually what we want: {0,1,3} should hash differently than
+ // {1,3,0}. Except when it isn't (e.g. for QSet and
+ // QHash). Therefore, provide a commutative combiner, too.
+ typedef uint result_type;
+ template <typename T>
+ Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
+ { return seed + qHash(t); } // don't use xor!
+};
+
+} // namespace QtPrivate
+
+template <typename InputIterator>
+inline uint qHashRange(InputIterator first, InputIterator last, uint seed = 0)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw
+{
+ return std::accumulate(first, last, seed, QtPrivate::QHashCombine());
+}
+
+template <typename InputIterator>
+inline uint qHashRangeCommutative(InputIterator first, InputIterator last, uint seed = 0)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw
+{
+ return std::accumulate(first, last, seed, QtPrivate::QHashCombineCommutative());
+}
+
+template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key, uint seed = 0)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed)))
+{
+ uint h1 = qHash(key.first, seed);
+ uint h2 = qHash(key.second, seed);
+ return ((h1 << 16) | (h1 >> 16)) ^ h2 ^ seed;
+}
+
+QT_END_NAMESPACE
+
+#if defined(Q_CC_MSVC)
+#pragma warning( pop )
+#endif
+
+#endif // QHASHFUNCTIONS_H
diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp
index fbd263e88b..5d91bfe924 100644
--- a/src/corelib/tools/qlinkedlist.cpp
+++ b/src/corelib/tools/qlinkedlist.cpp
@@ -388,6 +388,52 @@ const QLinkedListData QLinkedListData::shared_null = {
\sa constBegin(), end()
*/
+/*! \fn QLinkedList::reverse_iterator QLinkedList::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the list, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QLinkedList::const_reverse_iterator QLinkedList::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QLinkedList::const_reverse_iterator QLinkedList::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the list, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QLinkedList::reverse_iterator QLinkedList::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last item in the list, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QLinkedList::const_reverse_iterator QLinkedList::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QLinkedList::const_reverse_iterator QLinkedList::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last item in the list, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*! \fn QLinkedList::iterator QLinkedList::insert(iterator before, const T &value)
Inserts \a value in front of the item pointed to by the iterator
@@ -423,6 +469,38 @@ const QLinkedListData QLinkedListData::shared_null = {
Qt-style synonym for QLinkedList::const_iterator.
*/
+/*! \typedef QLinkedList::reverse_iterator
+ \since 5.6
+
+ The QLinkedList::reverse_iterator typedef provides an STL-style non-const
+ reverse iterator for QLinkedList.
+
+ It is simply a typedef for \c{std::reverse_iterator<QLinkedList::iterator>}.
+
+ \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}.
+
+ \sa QLinkedList::rbegin(), QLinkedList::rend(), QLinkedList::const_reverse_iterator, QLinkedList::iterator
+*/
+
+/*! \typedef QLinkedList::const_reverse_iterator
+ \since 5.6
+
+ The QLinkedList::const_reverse_iterator typedef provides an STL-style const
+ reverse iterator for QLinkedList.
+
+ It is simply a typedef for \c{std::reverse_iterator<QLinkedList::const_iterator>}.
+
+ \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}.
+
+ \sa QLinkedList::rbegin(), QLinkedList::rend(), QLinkedList::reverse_iterator, QLinkedList::const_iterator
+*/
+
/*!
\typedef QLinkedList::size_type
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 7908bf5137..110529d843 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -74,7 +74,7 @@ class QLinkedList
union { QLinkedListData *d; QLinkedListNode<T> *e; };
public:
- inline QLinkedList() : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null)) { }
+ inline QLinkedList() Q_DECL_NOTHROW : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null)) { }
inline QLinkedList(const QLinkedList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach(); }
#if defined(Q_COMPILER_INITIALIZER_LISTS)
inline QLinkedList(std::initializer_list<T> list)
@@ -86,11 +86,12 @@ public:
~QLinkedList();
QLinkedList<T> &operator=(const QLinkedList<T> &);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QLinkedList(QLinkedList<T> &&other) : d(other.d) { other.d = const_cast<QLinkedListData *>(&QLinkedListData::shared_null); }
- inline QLinkedList<T> &operator=(QLinkedList<T> &&other)
- { qSwap(d, other.d); return *this; }
+ QLinkedList(QLinkedList<T> &&other) Q_DECL_NOTHROW
+ : d(other.d) { other.d = const_cast<QLinkedListData *>(&QLinkedListData::shared_null); }
+ QLinkedList<T> &operator=(QLinkedList<T> &&other) Q_DECL_NOTHROW
+ { QLinkedList moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QLinkedList<T> &other) { qSwap(d, other.d); }
+ inline void swap(QLinkedList<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QLinkedList<T> &l) const;
inline bool operator!=(const QLinkedList<T> &l) const { return !(*this == l); }
@@ -182,14 +183,25 @@ public:
friend class const_iterator;
// stl style
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
inline iterator begin() { detach(); return e->n; }
- inline const_iterator begin() const { return e->n; }
- inline const_iterator cbegin() const { return e->n; }
- inline const_iterator constBegin() const { return e->n; }
+ inline const_iterator begin() const Q_DECL_NOTHROW { return e->n; }
+ inline const_iterator cbegin() const Q_DECL_NOTHROW { return e->n; }
+ inline const_iterator constBegin() const Q_DECL_NOTHROW { return e->n; }
inline iterator end() { detach(); return e; }
- inline const_iterator end() const { return e; }
- inline const_iterator cend() const { return e; }
- inline const_iterator constEnd() const { return e; }
+ inline const_iterator end() const Q_DECL_NOTHROW { return e; }
+ inline const_iterator cend() const Q_DECL_NOTHROW { return e; }
+ inline const_iterator constEnd() const Q_DECL_NOTHROW { return e; }
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+
iterator insert(iterator before, const T &t);
iterator erase(iterator pos);
iterator erase(iterator first, iterator last);
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index db00dcb458..5710f3925b 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -148,6 +149,17 @@ void QListData::realloc(int alloc)
d->begin = d->end = 0;
}
+void QListData::realloc_grow(int growth)
+{
+ Q_ASSERT(!d->ref.isShared());
+ int alloc = grow(d->alloc + growth);
+ Data *x = static_cast<Data *>(::realloc(d, DataHeaderSize + alloc * sizeof(void *)));
+ Q_CHECK_PTR(x);
+
+ d = x;
+ d->alloc = alloc;
+}
+
void QListData::dispose(Data *d)
{
Q_ASSERT(!d->ref.isShared());
@@ -167,7 +179,7 @@ void **QListData::append(int n)
::memcpy(d->array, d->array + b, e * sizeof(void *));
d->begin = 0;
} else {
- realloc(grow(d->alloc + n));
+ realloc_grow(n);
}
}
d->end = e + n;
@@ -191,7 +203,7 @@ void **QListData::prepend()
Q_ASSERT(!d->ref.isShared());
if (d->begin == 0) {
if (d->end >= d->alloc / 3)
- realloc(grow(d->alloc + 1));
+ realloc_grow(1);
if (d->end < d->alloc / 3)
d->begin = d->alloc - 2 * d->end;
@@ -218,7 +230,7 @@ void **QListData::insert(int i)
if (d->begin == 0) {
if (d->end == d->alloc) {
// If the array is full, we expand it and move some items rightward
- realloc(grow(d->alloc + 1));
+ realloc_grow(1);
} else {
// If there is free space at the end of the array, we move some items rightward
}
@@ -332,41 +344,56 @@ void **QListData::erase(void **xi)
\reentrant
QList\<T\> is one of Qt's generic \l{container classes}. It
- stores a list of values and provides fast index-based access as
- well as fast insertions and removals.
+ stores items in a list that provides fast index-based access
+ and index-based insertions and removals.
QList\<T\>, QLinkedList\<T\>, and QVector\<T\> provide similar
- functionality. Here's an overview:
+ APIs and functionality. They are often interchangeable, but there
+ are performance consequences. Here is an overview of use cases:
\list
- \li For most purposes, QList is the right class to use. Its
- index-based API is more convenient than QLinkedList's
- iterator-based API, and it is usually faster than
- QVector because of the way it stores its items in
- memory. It also expands to less code in your executable.
- \li If you need a real linked list, with guarantees of \l{constant
- time} insertions in the middle of the list and iterators to
- items rather than indexes, use QLinkedList.
- \li If you want the items to occupy adjacent memory positions,
- use QVector.
+ \li QVector should be your default first choice.
+ QVector\<T\> will usually give better performance than QList\<T\>,
+ because QVector\<T\> always stores its items sequentially in memory,
+ where QList\<T\> will allocate its items on the heap unless
+ \c {sizeof(T) <= sizeof(void*)} and T has been declared to be
+ either a \c{Q_MOVABLE_TYPE} or a \c{Q_PRIMITIVE_TYPE} using
+ \l {Q_DECLARE_TYPEINFO}. See the \l {Pros and Cons of Using QList}
+ for an explanation.
+ \li However, QList is used throughout the Qt APIs for passing
+ parameters and for returning values. Use QList to interface with
+ those APIs.
+ \li If you need a real linked list, which guarantees
+ \l {Algorithmic Complexity}{constant time} insertions mid-list and
+ uses iterators to items rather than indexes, use QLinkedList.
\endlist
+ \note QVector and QVarLengthArray both guarantee C-compatible
+ array layout. QList does not. This might be important if your
+ application must interface with a C API.
- Internally, QList\<T\> is represented as an array of pointers to
- items of type T. If T is itself a pointer type or a basic type
- that is no larger than a pointer, or if T is one of Qt's \l{shared
- classes}, then QList\<T\> stores the items directly in the pointer
- array. For lists under a thousand items, this array representation
- allows for very fast insertions in the middle, and it allows
- index-based access. Furthermore, operations like prepend() and
- append() are very fast, because QList preallocates memory at both
+ \note Iterators into a QLinkedList and references into
+ heap-allocating QLists remain valid long as the referenced items
+ remain in the container. This is not true for iterators and
+ references into a QVector and non-heap-allocating QLists.
+
+ Internally, QList\<T\> is represented as an array of T if
+ \c{sizeof(T) <= sizeof(void*)} and T has been declared to be
+ either a \c{Q_MOVABLE_TYPE} or a \c{Q_PRIMITIVE_TYPE} using
+ \l {Q_DECLARE_TYPEINFO}. Otherwise, QList\<T\> is represented
+ as an array of T* and the items are allocated on the heap.
+
+ The array representation allows very fast insertions and
+ index-based access. The prepend() and append() operations are
+ also very fast because QList preallocates memory at both
ends of its internal array. (See \l{Algorithmic Complexity} for
- details.) Note, however, that for unshared list items that are
- larger than a pointer, each append or insert of a new item
- requires allocating the new item on the heap, and this per item
- allocation might make QVector a better choice in cases that do
- lots of appending or inserting, since QVector allocates memory for
- its items in a single heap allocation.
+ details.
+
+ Note, however, that when the conditions specified above are not met,
+ each append or insert of a new item requires allocating the new item
+ on the heap, and this per item allocation will make QVector a better
+ choice for use cases that do a lot of appending or inserting, because
+ QVector can allocate memory for many items in a single heap allocation.
Note that the internal array only ever gets bigger over the life
of the list. It never shrinks. The internal array is deallocated
@@ -401,9 +428,10 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 2
- Because QList is implemented as an array of pointers, this
- operation is very fast (\l{constant time}). For read-only access,
- an alternative syntax is to use at():
+ Because QList is implemented as an array of pointers for types
+ that are larger than a pointer or are not movable, this operation
+ requires (\l{Algorithmic Complexity}{constant time}). For read-only
+ access, an alternative syntax is to use at():
\snippet code/src_corelib_tools_qlistdata.cpp 3
@@ -417,10 +445,10 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 4
- Inserting and removing items at either ends of the list is very
- fast (\l{constant time} in most cases), because QList
- preallocates extra space on both sides of its internal buffer to
- allow for fast growth at both ends of the list.
+ Inserting and removing items at either end of the list is very
+ fast (\l{Algorithmic Complexity}{constant time} in most cases),
+ because QList preallocates extra space on both sides of its
+ internal buffer to allow for fast growth at both ends of the list.
If you want to find all occurrences of a particular value in a
list, use indexOf() or lastIndexOf(). The former searches forward
@@ -481,6 +509,11 @@ void **QListData::erase(void **xi)
\l{QStringList::removeDuplicates()}{removeDuplicates},
\l{QStringList::sort()}{sort}.
+ \section1 More Information on Using Qt Containers
+
+ For a detailed discussion comparing Qt containers with each other and
+ with STL containers, see \l {Understand the Qt Containers}.
+
\sa QListIterator, QMutableListIterator, QLinkedList, QVector
*/
@@ -512,10 +545,11 @@ void **QListData::erase(void **xi)
Constructs a copy of \a other.
- This operation takes \l{constant time}, because QList is
- \l{implicitly shared}. This makes returning a QList from a
- function very fast. If a shared instance is modified, it will be
- copied (copy-on-write), and that takes \l{linear time}.
+ This operation takes \l{Algorithmic Complexity}{constant time},
+ because QList is \l{implicitly shared}. This makes returning a
+ QList from a function very fast. If a shared instance is modified,
+ it will be copied (copy-on-write), and that takes
+ \l{Algorithmic Complexity}{linear time}.
\sa operator=()
*/
@@ -584,6 +618,65 @@ void **QListData::erase(void **xi)
\sa operator==()
*/
+/*! \fn bool operator<(const QList<T> &lhs, const QList<T> &rhs)
+ \since 5.6
+ \relates QList
+
+ Returns \c true if list \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator<=(const QList<T> &lhs, const QList<T> &rhs)
+ \since 5.6
+ \relates QList
+
+ Returns \c true if list \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>(const QList<T> &lhs, const QList<T> &rhs)
+ \since 5.6
+ \relates QList
+
+ Returns \c true if list \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>=(const QList<T> &lhs, const QList<T> &rhs)
+ \since 5.6
+ \relates QList
+
+ Returns \c true if list \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*!
+ \fn uint qHash(const QList<T> &key, uint seed = 0)
+ \since 5.6
+ \relates QList
+
+ Returns the hash value for \a key,
+ using \a seed to seed the calculation.
+
+ This function requires qHash() to be overloaded for the value type \c T.
+*/
+
/*!
\fn int QList::size() const
@@ -641,7 +734,7 @@ void **QListData::erase(void **xi)
Returns the item at index position \a i in the list. \a i must be
a valid index position in the list (i.e., 0 <= \a i < size()).
- This function is very fast (\l{constant time}).
+ This function is very fast (\l{Algorithmic Complexity}{constant time}).
\sa value(), operator[]()
*/
@@ -654,8 +747,8 @@ void **QListData::erase(void **xi)
If this function is called on a list that is currently being shared, it
will trigger a copy of all elements. Otherwise, this function runs in
- \l{constant time}. If you do not want to modify the list you should use
- QList::at().
+ \l{Algorithmic Complexity}{constant time}. If you do not want to modify
+ the list you should use QList::at().
\sa at(), value()
*/
@@ -664,7 +757,7 @@ void **QListData::erase(void **xi)
\overload
- Same as at(). This function runs in \l{constant time}.
+ Same as at(). This function runs in \l{Algorithmic Complexity}{constant time}.
*/
/*! \fn QList::reserve(int alloc)
@@ -690,9 +783,9 @@ void **QListData::erase(void **xi)
This is the same as list.insert(size(), \a value).
If this list is not shared, this operation is typically
- very fast (amortized \l{constant time}), because QList
- preallocates extra space on both sides of its internal
- buffer to allow for fast growth at both ends of the list.
+ very fast (amortized \l{Algorithmic Complexity}{constant time}),
+ because QList preallocates extra space on both sides of its
+ internal buffer to allow for fast growth at both ends of the list.
\sa operator<<(), prepend(), insert()
*/
@@ -718,17 +811,17 @@ void **QListData::erase(void **xi)
This is the same as list.insert(0, \a value).
If this list is not shared, this operation is typically
- very fast (amortized \l{constant time}), because QList
- preallocates extra space on both sides of its internal
- buffer to allow for fast growth at both ends of the list.
+ very fast (amortized \l{Algorithmic Complexity}{constant time}),
+ because QList preallocates extra space on both sides of its
+ internal buffer to allow for fast growth at both ends of the list.
\sa append(), insert()
*/
/*! \fn void QList::insert(int i, const T &value)
- Inserts \a value at index position \a i in the list. If \a i
- is 0, the value is prepended to the list. If \a i is size(), the
+ Inserts \a value at index position \a i in the list. If \a i <= 0,
+ the value is prepended to the list. If \a i >= size(), the
value is appended to the list.
Example:
@@ -811,7 +904,8 @@ void **QListData::erase(void **xi)
same as takeAt(0). This function assumes the list is not empty. To
avoid failure, call isEmpty() before calling this function.
- If this list is not shared, this operation takes \l{constant time}.
+ If this list is not shared, this operation takes
+ \l {Algorithmic Complexity}{constant time}.
If you don't use the return value, removeFirst() is more
efficient.
@@ -826,7 +920,8 @@ void **QListData::erase(void **xi)
not empty. To avoid failure, call isEmpty() before calling this
function.
- If this list is not shared, this operation takes \l{constant time}.
+ If this list is not shared, this operation takes
+ \l {Algorithmic Complexity}{constant time}.
If you don't use the return value, removeLast() is more
efficient.
@@ -1000,6 +1095,52 @@ void **QListData::erase(void **xi)
\sa constBegin(), end()
*/
+/*! \fn QList::reverse_iterator QList::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the list, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QList::const_reverse_iterator QList::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QList::const_reverse_iterator QList::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the list, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QList::reverse_iterator QList::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last item in the list, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QList::const_reverse_iterator QList::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QList::const_reverse_iterator QList::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last item in the list, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*! \fn QList::iterator QList::erase(iterator pos)
Removes the item associated with the iterator \a pos from the
@@ -1070,6 +1211,38 @@ void **QListData::erase(void **xi)
Typedef for const T &. Provided for STL compatibility.
*/
+/*! \typedef QList::reverse_iterator
+ \since 5.6
+
+ The QList::reverse_iterator typedef provides an STL-style non-const
+ reverse iterator for QList.
+
+ It is simply a typedef for \c{std::reverse_iterator<iterator>}.
+
+ \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}.
+
+ \sa QList::rbegin(), QList::rend(), QList::const_reverse_iterator, QList::iterator
+*/
+
+/*! \typedef QList::const_reverse_iterator
+ \since 5.6
+
+ The QList::const_reverse_iterator typedef provides an STL-style const
+ reverse iterator for QList.
+
+ It is simply a typedef for \c{std::reverse_iterator<const_iterator>}.
+
+ \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}.
+
+ \sa QList::rbegin(), QList::rend(), QList::reverse_iterator, QList::const_iterator
+*/
+
/*! \fn int QList::count() const
Returns the number of items in the list. This is effectively the
@@ -1090,7 +1263,7 @@ void **QListData::erase(void **xi)
not be empty. If the list can be empty, call isEmpty() before
calling this function.
- \sa last(), isEmpty()
+ \sa constFirst(), last(), isEmpty()
*/
/*! \fn const T& QList::first() const
@@ -1098,13 +1271,23 @@ void **QListData::erase(void **xi)
\overload
*/
+/*! \fn const T& QList::constFirst() const
+ \since 5.6
+
+ Returns a const reference to the first item in the list. The list must
+ not be empty. If the list can be empty, call isEmpty() before
+ calling this function.
+
+ \sa constLast(), isEmpty(), first()
+*/
+
/*! \fn T& QList::last()
Returns a reference to the last item in the list. The list must
not be empty. If the list can be empty, call isEmpty() before
calling this function.
- \sa first(), isEmpty()
+ \sa constLast(), first(), isEmpty()
*/
/*! \fn const T& QList::last() const
@@ -1112,6 +1295,16 @@ void **QListData::erase(void **xi)
\overload
*/
+/*! \fn const T& QList::constLast() const
+ \since 5.6
+
+ Returns a reference to the last item in the list. The list must
+ not be empty. If the list can be empty, call isEmpty() before
+ calling this function.
+
+ \sa constFirst(), isEmpty(), last()
+*/
+
/*! \fn void QList::removeFirst()
Removes the first item in the list. Calling this function is
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index f5ff952f97..9a57a2c6a5 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -38,6 +38,7 @@
#include <QtCore/qiterator.h>
#include <QtCore/qrefcount.h>
#include <QtCore/qarraydata.h>
+#include <QtCore/qhashfunctions.h>
#include <iterator>
#include <list>
@@ -89,6 +90,7 @@ struct Q_CORE_EXPORT QListData {
Data *detach(int alloc);
Data *detach_grow(int *i, int n);
void realloc(int alloc);
+ void realloc_grow(int growth);
inline void dispose() { dispose(d); }
static void dispose(Data *d);
static const Data shared_null;
@@ -102,11 +104,11 @@ struct Q_CORE_EXPORT QListData {
void remove(int i);
void remove(int i, int n);
void move(int from, int to);
- inline int size() const { return d->end - d->begin; }
- inline bool isEmpty() const { return d->end == d->begin; }
- inline void **at(int i) const { return d->array + d->begin + i; }
- inline void **begin() const { return d->array + d->begin; }
- inline void **end() const { return d->array + d->end; }
+ inline int size() const Q_DECL_NOTHROW { return d->end - d->begin; }
+ inline bool isEmpty() const Q_DECL_NOTHROW { return d->end == d->begin; }
+ inline void **at(int i) const Q_DECL_NOTHROW { return d->array + d->begin + i; }
+ inline void **begin() const Q_DECL_NOTHROW { return d->array + d->begin; }
+ inline void **end() const Q_DECL_NOTHROW { return d->array + d->end; }
};
template <typename T>
@@ -141,11 +143,12 @@ public:
~QList();
QList<T> &operator=(const QList<T> &l);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QList(QList<T> &&other) : d(other.d) { other.d = const_cast<QListData::Data *>(&QListData::shared_null); }
- inline QList &operator=(QList<T> &&other)
- { qSwap(d, other.d); return *this; }
+ inline QList(QList<T> &&other) Q_DECL_NOTHROW
+ : d(other.d) { other.d = const_cast<QListData::Data *>(&QListData::shared_null); }
+ inline QList &operator=(QList<T> &&other) Q_DECL_NOTHROW
+ { QList moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QList<T> &other) { qSwap(d, other.d); }
+ inline void swap(QList<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QList(std::initializer_list<T> args)
: d(const_cast<QListData::Data *>(&QListData::shared_null))
@@ -154,7 +157,7 @@ public:
bool operator==(const QList<T> &l) const;
inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
- inline int size() const { return p.size(); }
+ inline int size() const Q_DECL_NOTHROW { return p.size(); }
inline void detach() { if (d->ref.isShared()) detach_helper(); }
@@ -177,9 +180,9 @@ public:
d->ref.setSharable(sharable);
}
#endif
- inline bool isSharedWith(const QList<T> &other) const { return d == other.d; }
+ inline bool isSharedWith(const QList<T> &other) const Q_DECL_NOTHROW { return d == other.d; }
- inline bool isEmpty() const { return p.isEmpty(); }
+ inline bool isEmpty() const Q_DECL_NOTHROW { return p.isEmpty(); }
void clear();
@@ -218,30 +221,34 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(0) {}
- inline iterator(Node *n) : i(n) {}
- inline iterator(const iterator &o): i(o.i){}
+ inline iterator() Q_DECL_NOTHROW : i(Q_NULLPTR) {}
+ inline iterator(Node *n) Q_DECL_NOTHROW : i(n) {}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // can't remove it in Qt 5, since doing so would make the type trivial,
+ // which changes the way it's passed to functions by value.
+ inline iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i){}
+#endif
inline T &operator*() const { return i->t(); }
inline T *operator->() const { return &i->t(); }
inline T &operator[](difference_type j) const { return i[j].t(); }
- inline bool operator==(const iterator &o) const { return i == o.i; }
- inline bool operator!=(const iterator &o) const { return i != o.i; }
- inline bool operator<(const iterator& other) const { return i < other.i; }
- inline bool operator<=(const iterator& other) const { return i <= other.i; }
- inline bool operator>(const iterator& other) const { return i > other.i; }
- inline bool operator>=(const iterator& other) const { return i >= other.i; }
+ inline bool operator==(const iterator &o) const Q_DECL_NOTHROW { return i == o.i; }
+ inline bool operator!=(const iterator &o) const Q_DECL_NOTHROW { return i != o.i; }
+ inline bool operator<(const iterator& other) const Q_DECL_NOTHROW { return i < other.i; }
+ inline bool operator<=(const iterator& other) const Q_DECL_NOTHROW { return i <= other.i; }
+ inline bool operator>(const iterator& other) const Q_DECL_NOTHROW { return i > other.i; }
+ inline bool operator>=(const iterator& other) const Q_DECL_NOTHROW { return i >= other.i; }
#ifndef QT_STRICT_ITERATORS
- inline bool operator==(const const_iterator &o) const
+ inline bool operator==(const const_iterator &o) const Q_DECL_NOTHROW
{ return i == o.i; }
- inline bool operator!=(const const_iterator &o) const
+ inline bool operator!=(const const_iterator &o) const Q_DECL_NOTHROW
{ return i != o.i; }
- inline bool operator<(const const_iterator& other) const
+ inline bool operator<(const const_iterator& other) const Q_DECL_NOTHROW
{ return i < other.i; }
- inline bool operator<=(const const_iterator& other) const
+ inline bool operator<=(const const_iterator& other) const Q_DECL_NOTHROW
{ return i <= other.i; }
- inline bool operator>(const const_iterator& other) const
+ inline bool operator>(const const_iterator& other) const Q_DECL_NOTHROW
{ return i > other.i; }
- inline bool operator>=(const const_iterator& other) const
+ inline bool operator>=(const const_iterator& other) const Q_DECL_NOTHROW
{ return i >= other.i; }
#endif
inline iterator &operator++() { ++i; return *this; }
@@ -266,23 +273,27 @@ public:
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() : i(0) {}
- inline const_iterator(Node *n) : i(n) {}
- inline const_iterator(const const_iterator &o): i(o.i) {}
+ inline const_iterator() Q_DECL_NOTHROW : i(Q_NULLPTR) {}
+ inline const_iterator(Node *n) Q_DECL_NOTHROW : i(n) {}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // can't remove it in Qt 5, since doing so would make the type trivial,
+ // which changes the way it's passed to functions by value.
+ inline const_iterator(const const_iterator &o) Q_DECL_NOTHROW : i(o.i) {}
+#endif
#ifdef QT_STRICT_ITERATORS
- inline explicit const_iterator(const iterator &o): i(o.i) {}
+ inline explicit const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
#else
- inline const_iterator(const iterator &o): i(o.i) {}
+ inline const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
#endif
inline const T &operator*() const { return i->t(); }
inline const T *operator->() const { return &i->t(); }
inline const T &operator[](difference_type j) const { return i[j].t(); }
- inline bool operator==(const const_iterator &o) const { return i == o.i; }
- inline bool operator!=(const const_iterator &o) const { return i != o.i; }
- inline bool operator<(const const_iterator& other) const { return i < other.i; }
- inline bool operator<=(const const_iterator& other) const { return i <= other.i; }
- inline bool operator>(const const_iterator& other) const { return i > other.i; }
- inline bool operator>=(const const_iterator& other) const { return i >= other.i; }
+ inline bool operator==(const const_iterator &o) const Q_DECL_NOTHROW { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const Q_DECL_NOTHROW { return i != o.i; }
+ inline bool operator<(const const_iterator& other) const Q_DECL_NOTHROW { return i < other.i; }
+ inline bool operator<=(const const_iterator& other) const Q_DECL_NOTHROW { return i <= other.i; }
+ inline bool operator>(const const_iterator& other) const Q_DECL_NOTHROW { return i > other.i; }
+ inline bool operator>=(const const_iterator& other) const Q_DECL_NOTHROW { return i >= other.i; }
inline const_iterator &operator++() { ++i; return *this; }
inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
inline const_iterator &operator--() { i--; return *this; }
@@ -296,14 +307,22 @@ public:
friend class const_iterator;
// stl style
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator begin() const { return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator cbegin() const { return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator constBegin() const { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator begin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator cbegin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator constBegin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator end() const { return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator cend() const { return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator constEnd() const { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator end() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator cend() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator constEnd() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
iterator insert(iterator before, const T &t);
iterator erase(iterator pos);
iterator erase(iterator first, iterator last);
@@ -314,9 +333,11 @@ public:
inline int count() const { return p.size(); }
inline int length() const { return p.size(); } // Same as count()
inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); }
+ inline const T& constFirst() const { return first(); }
inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); }
T& last() { Q_ASSERT(!isEmpty()); return *(--end()); }
const T& last() const { Q_ASSERT(!isEmpty()); return at(count() - 1); }
+ inline const T& constLast() const { return last(); }
inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(begin()); }
inline void removeLast() { Q_ASSERT(!isEmpty()); erase(--end()); }
inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
@@ -378,7 +399,7 @@ private:
void node_copy(Node *from, Node *to, Node *src);
void node_destruct(Node *from, Node *to);
- bool isValidIterator(const iterator &i) const
+ bool isValidIterator(const iterator &i) const Q_DECL_NOTHROW
{
return (constBegin().i <= i.i) && (i.i <= constEnd().i);
}
@@ -1020,6 +1041,43 @@ inline int QList<T>::count_impl(const T &t, QListData::ArrayCompatibleLayout) co
Q_DECLARE_SEQUENTIAL_ITERATOR(List)
Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(List)
+template <typename T>
+uint qHash(const QList<T> &key, uint seed = 0)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
+{
+ return qHashRange(key.cbegin(), key.cend(), seed);
+}
+
+template <typename T>
+bool operator<(const QList<T> &lhs, const QList<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end())))
+{
+ return std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end());
+}
+
+template <typename T>
+inline bool operator>(const QList<T> &lhs, const QList<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return rhs < lhs;
+}
+
+template <typename T>
+inline bool operator<=(const QList<T> &lhs, const QList<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return !(lhs > rhs);
+}
+
+template <typename T>
+inline bool operator>=(const QList<T> &lhs, const QList<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return !(lhs < rhs);
+}
+
QT_END_NAMESPACE
#include <QtCore/qbytearraylist.h>
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 824b70c3fd..890a8fb95d 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -42,6 +42,7 @@
#include "qdatastream.h"
#include "qdebug.h"
+#include "qhashfunctions.h"
#include "qstring.h"
#include "qlocale.h"
#include "qlocale_p.h"
@@ -88,9 +89,9 @@ QLocale::Language QLocalePrivate::codeToLanguage(const QString &code)
int len = code.length();
if (len != 2 && len != 3)
return QLocale::C;
- ushort uc1 = len-- > 0 ? code[0].toLower().unicode() : 0;
- ushort uc2 = len-- > 0 ? code[1].toLower().unicode() : 0;
- ushort uc3 = len-- > 0 ? code[2].toLower().unicode() : 0;
+ ushort uc1 = code[0].toLower().unicode();
+ ushort uc2 = code[1].toLower().unicode();
+ ushort uc3 = len > 2 ? code[2].toLower().unicode() : 0;
const unsigned char *c = language_code_list;
for (; *c != 0; c += 3) {
@@ -115,6 +116,13 @@ QLocale::Language QLocalePrivate::codeToLanguage(const QString &code)
Q_STATIC_ASSERT(QLocale::Moldavian == QLocale::Romanian);
return QLocale::Moldavian;
}
+ // Android uses the following deprecated codes
+ if (uc1 == 'i' && uc2 == 'w' && uc3 == 0) // iw -> he
+ return QLocale::Hebrew;
+ if (uc1 == 'i' && uc2 == 'n' && uc3 == 0) // in -> id
+ return QLocale::Indonesian;
+ if (uc1 == 'j' && uc2 == 'i' && uc3 == 0) // ji -> yi
+ return QLocale::Yiddish;
return QLocale::C;
}
@@ -144,9 +152,9 @@ QLocale::Country QLocalePrivate::codeToCountry(const QString &code)
int len = code.length();
if (len != 2 && len != 3)
return QLocale::AnyCountry;
- ushort uc1 = len-- > 0 ? code[0].toUpper().unicode() : 0;
- ushort uc2 = len-- > 0 ? code[1].toUpper().unicode() : 0;
- ushort uc3 = len-- > 0 ? code[2].toUpper().unicode() : 0;
+ ushort uc1 = code[0].toUpper().unicode();
+ ushort uc2 = code[1].toUpper().unicode();
+ ushort uc3 = len > 2 ? code[2].toUpper().unicode() : 0;
const unsigned char *c = country_code_list;
for (; *c != 0; c += 3) {
@@ -420,7 +428,7 @@ bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QSt
state = ScriptState;
break;
case ScriptState: {
- QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list));
+ QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list) - 1);
if (value.length() == 4 && scripts.indexOf(value) % 4 == 0) {
// script name is always 4 characters
script = value;
@@ -525,7 +533,7 @@ static uint default_number_options = 0;
static const QLocaleData *const c_data = locale_data;
static QLocalePrivate *c_private()
{
- static QLocalePrivate c_locale = { c_data, Q_BASIC_ATOMIC_INITIALIZER(1), 0 };
+ static QLocalePrivate c_locale = { c_data, Q_BASIC_ATOMIC_INITIALIZER(1), QLocale::OmitGroupSeparator };
return &c_locale;
}
@@ -697,7 +705,8 @@ static QLocalePrivate *localePrivateByName(const QString &name)
{
if (name == QLatin1String("C"))
return c_private();
- return QLocalePrivate::create(findLocaleData(name));
+ const QLocaleData *data = findLocaleData(name);
+ return QLocalePrivate::create(data, data->m_language_id == QLocale::C ? QLocale::OmitGroupSeparator : 0);
}
static QLocalePrivate *findLocalePrivate(QLocale::Language language, QLocale::Script script,
@@ -866,6 +875,21 @@ bool QLocale::operator!=(const QLocale &other) const
}
/*!
+ \since 5.6
+ \relates QLocale
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.d->m_data);
+ seed = hash(seed, key.d->m_numberOptions);
+ return seed;
+}
+
+/*!
\since 4.2
Sets the \a options related to number conversions for this
@@ -2726,9 +2750,9 @@ QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const Q
const QChar exponential, const QChar group, const QChar decimal,
double d, int precision, DoubleForm form, int width, unsigned flags)
{
- if (precision == -1)
+ if (precision < 0)
precision = 6;
- if (width == -1)
+ if (width < 0)
width = 0;
bool negative = false;
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 61574ba44f..729fd73a5d 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
class QDataStream;
class QDate;
class QDateTime;
+class QLocale;
class QTime;
class QVariant;
class QTextStream;
@@ -52,6 +53,8 @@ class QTextStreamPrivate;
class QLocalePrivate;
+Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed = 0) Q_DECL_NOTHROW;
+
class Q_CORE_EXPORT QLocale
{
Q_GADGET
@@ -828,6 +831,7 @@ public:
Q_ENUM(Language)
Q_ENUM(Country)
+ Q_ENUM(Script)
enum MeasurementSystem {
MetricSystem,
@@ -868,23 +872,23 @@ public:
QString nativeLanguageName() const;
QString nativeCountryName() const;
- short toShort(const QString &s, bool *ok = 0) const;
- ushort toUShort(const QString &s, bool *ok = 0) const;
- int toInt(const QString &s, bool *ok = 0) const;
- uint toUInt(const QString &s, bool *ok = 0) const;
- qlonglong toLongLong(const QString &s, bool *ok = 0) const;
- qulonglong toULongLong(const QString &s, bool *ok = 0) const;
- float toFloat(const QString &s, bool *ok = 0) const;
- double toDouble(const QString &s, bool *ok = 0) const;
-
- short toShort(const QStringRef &s, bool *ok = 0) const;
- ushort toUShort(const QStringRef &s, bool *ok = 0) const;
- int toInt(const QStringRef &s, bool *ok = 0) const;
- uint toUInt(const QStringRef &s, bool *ok = 0) const;
- qlonglong toLongLong(const QStringRef &s, bool *ok = 0) const;
- qulonglong toULongLong(const QStringRef &s, bool *ok = 0) const;
- float toFloat(const QStringRef &s, bool *ok = 0) const;
- double toDouble(const QStringRef &s, bool *ok = 0) const;
+ 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;
+ uint toUInt(const QString &s, bool *ok = Q_NULLPTR) const;
+ qlonglong toLongLong(const QString &s, bool *ok = Q_NULLPTR) const;
+ qulonglong toULongLong(const QString &s, bool *ok = Q_NULLPTR) const;
+ float toFloat(const QString &s, bool *ok = Q_NULLPTR) const;
+ double toDouble(const QString &s, bool *ok = Q_NULLPTR) const;
+
+ short toShort(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+ ushort toUShort(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+ int toInt(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+ uint toUInt(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+ qlonglong toLongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+ 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;
QString toString(qlonglong i) const;
QString toString(qulonglong i) const;
@@ -979,6 +983,8 @@ public:
private:
QLocale(QLocalePrivate &dd);
friend class QLocalePrivate;
+ friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW;
+
QSharedDataPointer<QLocalePrivate> d;
};
Q_DECLARE_TYPEINFO(QLocale, Q_MOVABLE_TYPE);
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index 37a63a2ca4..c0818f07d7 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -44,18 +44,6 @@
QT_BEGIN_NAMESPACE
-namespace {
-class AutoReleasePool
-{
-public:
- AutoReleasePool(): pool([[NSAutoreleasePool alloc] init]) {}
- ~AutoReleasePool() { [pool release]; }
-
-private:
- NSAutoreleasePool *pool;
-};
-}
-
/******************************************************************************
** Wrappers for Mac locale system functions
*/
@@ -426,7 +414,7 @@ QLocale QSystemLocale::fallbackUiLocale() const
QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
{
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
switch(type) {
// case Name:
// return getMacLocaleName();
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index 430f95dcda..b3fd7a96b8 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -122,6 +122,8 @@ private:
QSystemLocale(bool);
friend class QSystemLocaleSingleton;
};
+Q_DECLARE_TYPEINFO(QSystemLocale::QueryType, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QSystemLocale::CurrencyToStringArgument, Q_MOVABLE_TYPE);
#endif
#ifdef QT_USE_ICU
@@ -153,6 +155,7 @@ struct QLocaleId
ushort language_id, script_id, country_id;
};
+Q_DECLARE_TYPEINFO(QLocaleId, Q_PRIMITIVE_TYPE);
struct QLocaleData
{
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 1cad9b32e3..a5eb7ec058 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -48,12 +48,12 @@
#endif
#ifdef Q_OS_WINRT
+#include <qfunctions_winrt.h>
+
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
-#ifndef Q_OS_WINPHONE
#include <windows.globalization.h>
-#endif
#endif // Q_OS_WINRT
QT_BEGIN_NAMESPACE
@@ -639,7 +639,6 @@ QVariant QSystemLocalePrivate::uiLanguages()
return QStringList(QString::fromLatin1(winLangCodeToIsoName(GetUserDefaultUILanguage())));
#else // !Q_OS_WINRT
QStringList result;
-#ifndef Q_OS_WINPHONE
ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> appLanguagesStatics;
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), &appLanguagesStatics))) {
qWarning("Could not obtain ApplicationLanguagesStatic");
@@ -647,23 +646,52 @@ QVariant QSystemLocalePrivate::uiLanguages()
}
ComPtr<ABI::Windows::Foundation::Collections::IVectorView<HSTRING> > languageList;
- appLanguagesStatics->get_ManifestLanguages(&languageList);
-
- if (!languageList)
- return QStringList();
-
+ // Languages is a ranked list of "long names" (e.g. en-US) of preferred languages, which matches
+ // languages from the manifest with languages from the user's system.
+ HRESULT hr = appLanguagesStatics->get_Languages(&languageList);
+ Q_ASSERT_SUCCEEDED(hr);
unsigned int size;
- languageList->get_Size(&size);
+ hr = languageList->get_Size(&size);
+ Q_ASSERT_SUCCEEDED(hr);
+ result.reserve(size);
for (unsigned int i = 0; i < size; ++i) {
HString language;
- languageList->GetAt(i, language.GetAddressOf());
+ hr = languageList->GetAt(i, language.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
UINT32 length;
PCWSTR rawString = language.GetRawBuffer(&length);
result << QString::fromWCharArray(rawString, length);
}
-#else // !Q_OS_WINPHONE
- result << QString::fromWCharArray(lcName);
-#endif // Q_OS_WINPHONE
+
+ // ManifestLanguages covers all languages given in the manifest and uses short names (like "en").
+ hr = appLanguagesStatics->get_ManifestLanguages(&languageList);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = languageList->get_Size(&size);
+ Q_ASSERT_SUCCEEDED(hr);
+ for (unsigned int i = 0; i < size; ++i) {
+ HString language;
+ hr = languageList->GetAt(i, language.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
+ UINT32 length;
+ PCWSTR rawString = language.GetRawBuffer(&length);
+ const QString qLanguage = QString::fromWCharArray(rawString, length);
+ bool found = false;
+ // Since ApplicationLanguages:::Languages uses long names, we compare the "pre-dash" part of
+ // the language and filter it out, if it is already covered by a more specialized form.
+ foreach (const QString &lang, result) {
+ int dashIndex = lang.indexOf('-');
+ // There will not be any long name after the first short name was found, so we can stop.
+ if (dashIndex == -1)
+ break;
+
+ if (lang.leftRef(dashIndex) == qLanguage) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ result << qLanguage;
+ }
return result;
#endif // Q_OS_WINRT
@@ -813,6 +841,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
case ZeroDigit:
return d->zeroDigit();
case LanguageId:
+ case ScriptId:
case CountryId: {
QString locale = QString::fromLatin1(getWinLocaleName());
QLocale::Language lang;
@@ -821,12 +850,12 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
QLocalePrivate::getLangAndCountry(locale, lang, script, cntry);
if (type == LanguageId)
return lang;
+ if (type == ScriptId)
+ return script == QLocale::AnyScript ? fallbackUiLocale().script() : script;
if (cntry == QLocale::AnyCountry)
return fallbackUiLocale().country();
return cntry;
}
- case ScriptId:
- return QVariant(QLocale::AnyScript);
case MeasurementSystem:
return d->measurementSystem();
case AMText:
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 1b7a8007cd..e49a1a098d 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -858,6 +858,15 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa begin(), constEnd()
*/
+/*! \fn QMap::key_iterator QMap::keyBegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first key
+ in the map.
+
+ \sa keyEnd(), firstKey()
+*/
+
/*! \fn QMap::iterator QMap::end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
@@ -888,6 +897,15 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa constBegin(), end()
*/
+/*! \fn QMap::key_iterator QMap::keyEnd() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
+ item after the last key in the map.
+
+ \sa keyBegin(), lastKey()
+*/
+
/*! \fn const Key &QMap::firstKey() const
\since 5.2
@@ -896,7 +914,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
This executes in \l{constant time}.
- \sa lastKey(), first(), isEmpty()
+ \sa lastKey(), first(), keyBegin(), isEmpty()
*/
/*! \fn const Key &QMap::lastKey() const
@@ -907,7 +925,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
This executes in \l{logarithmic time}.
- \sa firstKey(), last(), isEmpty()
+ \sa firstKey(), last(), keyEnd(), isEmpty()
*/
/*! \fn T &QMap::first()
@@ -1161,6 +1179,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
are stored under \a key.
*/
+/*!
+ \fn QPair<const_iterator, const_iterator> QMap::equal_range(const Key &key) const
+ \overload
+ \since 5.6
+*/
+
/*! \class QMap::iterator
\inmodule QtCore
@@ -1229,7 +1253,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
while iterators are active on that container. For more information,
read \l{Implicit sharing iterator problem}.
- \sa QMap::const_iterator, QMutableMapIterator
+ \sa QMap::const_iterator, QMap::key_iterator, QMutableMapIterator
*/
/*! \typedef QMap::iterator::difference_type
@@ -1452,7 +1476,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
while iterators are active on that container. For more information,
read \l{Implicit sharing iterator problem}.
- \sa QMap::iterator, QMapIterator
+ \sa QMap::iterator, QMap::key_iterator, QMapIterator
*/
/*! \typedef QMap::const_iterator::difference_type
@@ -1628,6 +1652,134 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator+=(), operator-()
*/
+/*! \class QMap::key_iterator
+ \inmodule QtCore
+ \since 5.6
+ \brief The QMap::key_iterator class provides an STL-style const iterator for QMap and QMultiMap keys.
+
+ QMap::key_iterator is essentially the same as QMap::const_iterator
+ with the difference that operator*() and operator->() return a key
+ instead of a value.
+
+ For most uses QMap::iterator and QMap::const_iterator should be used,
+ you can easily access the key by calling QMap::iterator::key():
+
+ \snippet code/src_corelib_tools_qmap.cpp keyiterator1
+
+ However, to have interoperability between QMap's keys and STL-style
+ algorithms we need an iterator that dereferences to a key instead
+ of a value. With QMap::key_iterator we can apply an algorithm to a
+ range of keys without having to call QMap::keys(), which is inefficient
+ as it costs one QMap iteration and memory allocation to create a temporary
+ QList.
+
+ \snippet code/src_corelib_tools_qmap.cpp keyiterator2
+
+ QMap::key_iterator is const, it's not possible to modify the key.
+
+ The default QMap::key_iterator constructor creates an uninitialized
+ iterator. You must initialize it using a QMap function like
+ QMap::keyBegin() or QMap::keyEnd().
+
+ \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}.
+
+ \sa QMap::const_iterator, QMap::iterator
+*/
+
+/*! \typedef QMap::key_iterator::difference_type
+ \internal
+*/
+
+/*! \typedef QMap::key_iterator::iterator_category
+ \internal
+*/
+
+/*! \typedef QMap::key_iterator::pointer
+ \internal
+*/
+
+/*! \typedef QMap::key_iterator::reference
+ \internal
+*/
+
+/*! \typedef QMap::key_iterator::value_type
+ \internal
+*/
+
+/*! \fn const T &QMap::key_iterator::operator*() const
+
+ Returns the current item's key.
+*/
+
+/*! \fn const T *QMap::key_iterator::operator->() const
+
+ Returns a pointer to the current item's key.
+*/
+
+/*! \fn bool QMap::key_iterator::operator==(key_iterator other) const
+
+ Returns \c true if \a other points to the same item as this
+ iterator; otherwise returns \c false.
+
+ \sa operator!=()
+*/
+
+/*! \fn bool QMap::key_iterator::operator!=(key_iterator other) const
+
+ Returns \c true if \a other points to a different item than this
+ iterator; otherwise returns \c false.
+
+ \sa operator==()
+*/
+
+/*!
+ \fn QMap::key_iterator &QMap::key_iterator::operator++()
+
+ The prefix ++ operator (\c{++i}) advances the iterator to the
+ next item in the hash and returns an iterator to the new current
+ item.
+
+ Calling this function on QMap::keyEnd() leads to undefined results.
+
+ \sa operator--()
+*/
+
+/*! \fn QMap::key_iterator QMap::key_iterator::operator++(int)
+
+ \overload
+
+ The postfix ++ operator (\c{i++}) advances the iterator to the
+ next item in the hash and returns an iterator to the previous
+ item.
+*/
+
+/*! \fn QMap::key_iterator &QMap::key_iterator::operator--()
+
+ The prefix -- operator (\c{--i}) makes the preceding item
+ current and returns an iterator pointing to the new current item.
+
+ Calling this function on QMap::keyBegin() leads to undefined
+ results.
+
+ \sa operator++()
+*/
+
+/*! \fn QMap::key_iterator QMap::key_iterator::operator--(int)
+
+ \overload
+
+ The postfix -- operator (\c{i--}) makes the preceding item
+ current and returns an iterator pointing to the previous
+ item.
+*/
+
+/*! \fn const_iterator QMap::key_iterator::base() const
+ Returns the underlying const_iterator this key_iterator is based on.
+*/
+
/*! \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 1f80e8f0f4..fe9ddaaa32 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -38,6 +38,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qrefcount.h>
#include <QtCore/qpair.h>
+#include <QtCore/qtypetraits.h>
#ifdef Q_MAP_DEBUG
#include <QtCore/qdebug.h>
@@ -94,6 +95,13 @@ struct Q_CORE_EXPORT QMapNodeBase
void setColor(Color c) { if (c == Black) p |= Black; else p &= ~Black; }
QMapNodeBase *parent() const { return reinterpret_cast<QMapNodeBase *>(p & ~Mask); }
void setParent(QMapNodeBase *pp) { p = (p & Mask) | quintptr(pp); }
+
+ template <typename T>
+ static typename QtPrivate::QEnableIf<QTypeInfo<T>::isComplex>::Type
+ callDestructorIfNecessary(T &t) Q_DECL_NOTHROW { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning
+ template <typename T>
+ static typename QtPrivate::QEnableIf<!QTypeInfo<T>::isComplex>::Type
+ callDestructorIfNecessary(T &) Q_DECL_NOTHROW {}
};
template <class Key, class T>
@@ -112,12 +120,26 @@ struct QMapNode : public QMapNodeBase
QMapNode<Key, T> *copy(QMapData<Key, T> *d) const;
- void destroySubTree();
+ void destroySubTree()
+ {
+ callDestructorIfNecessary(key);
+ callDestructorIfNecessary(value);
+ doDestroySubTree(QtPrivate::integral_constant<bool, QTypeInfo<T>::isComplex || QTypeInfo<Key>::isComplex>());
+ }
QMapNode<Key, T> *lowerBound(const Key &key);
QMapNode<Key, T> *upperBound(const Key &key);
private:
+ void doDestroySubTree(QtPrivate::false_type) {}
+ void doDestroySubTree(QtPrivate::true_type)
+ {
+ if (left)
+ leftNode()->destroySubTree();
+ if (right)
+ rightNode()->destroySubTree();
+ }
+
QMapNode() Q_DECL_EQ_DELETE;
Q_DISABLE_COPY(QMapNode)
};
@@ -126,7 +148,7 @@ template <class Key, class T>
inline QMapNode<Key, T> *QMapNode<Key, T>::lowerBound(const Key &akey)
{
QMapNode<Key, T> *n = this;
- QMapNode<Key, T> *lastNode = 0;
+ QMapNode<Key, T> *lastNode = Q_NULLPTR;
while (n) {
if (!qMapLessThanKey(n->key, akey)) {
lastNode = n;
@@ -142,7 +164,7 @@ template <class Key, class T>
inline QMapNode<Key, T> *QMapNode<Key, T>::upperBound(const Key &akey)
{
QMapNode<Key, T> *n = this;
- QMapNode<Key, T> *lastNode = 0;
+ QMapNode<Key, T> *lastNode = Q_NULLPTR;
while (n) {
if (qMapLessThanKey(akey, n->key)) {
lastNode = n;
@@ -194,7 +216,7 @@ struct QMapData : public QMapDataBase
Node *findNode(const Key &akey) const;
void nodeRange(const Key &akey, Node **firstNode, Node **lastNode);
- Node *createNode(const Key &k, const T &v, Node *parent = 0, bool left = false)
+ Node *createNode(const Key &k, const T &v, Node *parent = Q_NULLPTR, bool left = false)
{
Node *n = static_cast<Node *>(QMapDataBase::createNode(sizeof(Node), Q_ALIGNOF(Node),
parent, left));
@@ -235,48 +257,22 @@ QMapNode<Key, T> *QMapNode<Key, T>::copy(QMapData<Key, T> *d) const
n->left = leftNode()->copy(d);
n->left->setParent(n);
} else {
- n->left = 0;
+ n->left = Q_NULLPTR;
}
if (right) {
n->right = rightNode()->copy(d);
n->right->setParent(n);
} else {
- n->right = 0;
+ n->right = Q_NULLPTR;
}
return n;
}
-#if defined(Q_CC_MSVC)
-#pragma warning( push )
-#pragma warning( disable : 4127 ) // conditional expression is constant
-#endif
-
-template <class Key, class T>
-void QMapNode<Key, T>::destroySubTree()
-{
- if (QTypeInfo<Key>::isComplex)
- key.~Key();
- if (QTypeInfo<T>::isComplex)
- value.~T();
- if (QTypeInfo<Key>::isComplex || QTypeInfo<T>::isComplex) {
- if (left)
- leftNode()->destroySubTree();
- if (right)
- rightNode()->destroySubTree();
- }
-}
-
-#if defined(Q_CC_MSVC)
-#pragma warning( pop )
-#endif
-
template <class Key, class T>
void QMapData<Key, T>::deleteNode(QMapNode<Key, T> *z)
{
- if (QTypeInfo<Key>::isComplex)
- z->key.~Key();
- if (QTypeInfo<T>::isComplex)
- z->value.~T();
+ QMapNodeBase::callDestructorIfNecessary(z->key);
+ QMapNodeBase::callDestructorIfNecessary(z->value);
freeNodeAndRebalance(z);
}
@@ -288,7 +284,7 @@ QMapNode<Key, T> *QMapData<Key, T>::findNode(const Key &akey) const
if (lb && !qMapLessThanKey(akey, lb->key))
return lb;
}
- return 0;
+ return Q_NULLPTR;
}
@@ -304,10 +300,10 @@ void QMapData<Key, T>::nodeRange(const Key &akey, QMapNode<Key, T> **firstNode,
} else if (qMapLessThanKey(n->key, akey)) {
n = n->rightNode();
} else {
- *firstNode = n->leftNode() ? n->leftNode()->lowerBound(akey) : 0;
+ *firstNode = n->leftNode() ? n->leftNode()->lowerBound(akey) : Q_NULLPTR;
if (!*firstNode)
*firstNode = n;
- *lastNode = n->rightNode() ? n->rightNode()->upperBound(akey) : 0;
+ *lastNode = n->rightNode() ? n->rightNode()->upperBound(akey) : Q_NULLPTR;
if (!*lastNode)
*lastNode = l;
return;
@@ -325,7 +321,7 @@ class QMap
QMapData<Key, T> *d;
public:
- inline QMap() : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
+ inline QMap() Q_DECL_NOTHROW : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QMap(std::initializer_list<std::pair<Key,T> > list)
: d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null)))
@@ -340,17 +336,17 @@ public:
QMap<Key, T> &operator=(const QMap<Key, T> &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QMap(QMap<Key, T> &&other)
+ inline QMap(QMap<Key, T> &&other) Q_DECL_NOTHROW
: d(other.d)
{
other.d = static_cast<QMapData<Key, T> *>(
const_cast<QMapDataBase *>(&QMapDataBase::shared_null));
}
- inline QMap<Key, T> &operator=(QMap<Key, T> &&other)
- { qSwap(d, other.d); return *this; }
+ inline QMap<Key, T> &operator=(QMap<Key, T> &&other) Q_DECL_NOTHROW
+ { QMap moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QMap<Key, T> &other) { qSwap(d, other.d); }
+ inline void swap(QMap<Key, T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
explicit QMap(const typename std::map<Key, T> &other);
std::map<Key, T> toStdMap() const;
@@ -416,7 +412,7 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(0) { }
+ inline iterator() : i(Q_NULLPTR) { }
inline iterator(Node *node) : i(node) { }
inline const Key &key() const { return i->key; }
@@ -473,7 +469,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() : i(0) { }
+ inline const_iterator() : i(Q_NULLPTR) { }
inline const_iterator(const Node *node) : i(node) { }
#ifdef QT_STRICT_ITERATORS
explicit inline const_iterator(const iterator &o)
@@ -522,6 +518,32 @@ public:
};
friend class const_iterator;
+ class key_iterator
+ {
+ const_iterator i;
+
+ public:
+ typedef typename const_iterator::iterator_category iterator_category;
+ typedef typename const_iterator::difference_type difference_type;
+ typedef Key value_type;
+ typedef const Key *pointer;
+ typedef const Key &reference;
+
+ explicit key_iterator(const_iterator o) : i(o) { }
+
+ const Key &operator*() const { return i.key(); }
+ const Key *operator->() const { return &i.key(); }
+ bool operator==(key_iterator o) const { return i == o.i; }
+ bool operator!=(key_iterator o) const { return i != o.i; }
+
+ inline key_iterator &operator++() { ++i; return *this; }
+ inline key_iterator operator++(int) { return key_iterator(i++);}
+ inline key_iterator &operator--() { --i; return *this; }
+ inline key_iterator operator--(int) { return key_iterator(i--); }
+ const_iterator base() const { return i; }
+ };
+
+
// STL style
inline iterator begin() { detach(); return iterator(d->begin()); }
inline const_iterator begin() const { return const_iterator(d->begin()); }
@@ -531,6 +553,8 @@ public:
inline const_iterator end() const { return const_iterator(d->end()); }
inline const_iterator constEnd() const { return const_iterator(d->end()); }
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()); }
iterator erase(iterator it);
// more Qt
@@ -557,6 +581,7 @@ public:
typedef int size_type;
inline bool empty() const { return isEmpty(); }
QPair<iterator, iterator> equal_range(const Key &akey);
+ QPair<const_iterator, const_iterator> equal_range(const Key &akey) const;
#ifdef Q_MAP_DEBUG
void dump() const;
@@ -653,7 +678,7 @@ Q_INLINE_TEMPLATE int QMap<Key, T>::count(const Key &akey) const
template <class Key, class T>
Q_INLINE_TEMPLATE bool QMap<Key, T>::contains(const Key &akey) const
{
- return d->findNode(akey) != 0;
+ return d->findNode(akey) != Q_NULLPTR;
}
template <class Key, class T>
@@ -662,7 +687,7 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key
detach();
Node *n = d->root();
Node *y = d->end();
- Node *lastNode = 0;
+ Node *lastNode = Q_NULLPTR;
bool left = true;
while (n) {
y = n;
@@ -737,15 +762,15 @@ typename QMap<Key, T>::iterator QMap<Key, T>::insert(const_iterator pos, const K
}
// we need to insert (not overwrite)
- if (prev->right == 0) {
+ if (prev->right == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, prev, false);
return iterator(z);
}
- if (next->left == 0) {
+ if (next->left == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, next, true);
return iterator(z);
}
- Q_ASSERT(false); // We should have prev->right == 0 or next->left == 0.
+ Q_ASSERT(false); // We should have prev->right == Q_NULLPTR or next->left == Q_NULLPTR.
return this->insert(akey, avalue);
}
}
@@ -759,7 +784,7 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(cons
Node* y = d->end();
Node* x = static_cast<Node *>(d->root());
bool left = true;
- while (x != 0) {
+ while (x != Q_NULLPTR) {
left = !qMapLessThanKey(x->key, akey);
y = x;
x = left ? x->leftNode() : x->rightNode();
@@ -806,15 +831,15 @@ typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const_iterator pos, co
return this->insertMulti(akey, avalue); // ignore hint
// Hint is ok - do insert
- if (prev->right == 0) {
+ if (prev->right == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, prev, false);
return iterator(z);
}
- if (next->left == 0) {
+ if (next->left == Q_NULLPTR) {
Node *z = d->createNode(akey, avalue, next, true);
return iterator(z);
}
- Q_ASSERT(false); // We should have prev->right == 0 or next->left == 0.
+ Q_ASSERT(false); // We should have prev->right == Q_NULLPTR or next->left == Q_NULLPTR.
return this->insertMulti(akey, avalue);
}
}
@@ -864,6 +889,15 @@ QPair<typename QMap<Key, T>::iterator, typename QMap<Key, T>::iterator> QMap<Key
return QPair<iterator, iterator>(iterator(firstNode), iterator(lastNode));
}
+template <class Key, class T>
+QPair<typename QMap<Key, T>::const_iterator, typename QMap<Key, T>::const_iterator>
+QMap<Key, T>::equal_range(const Key &akey) const
+{
+ Node *firstNode, *lastNode;
+ d->nodeRange(akey, &firstNode, &lastNode);
+ return qMakePair(const_iterator(firstNode), const_iterator(lastNode));
+}
+
#ifdef Q_MAP_DEBUG
template <class Key, class T>
void QMap<Key, T>::dump() const
@@ -1051,7 +1085,7 @@ Q_OUTOFLINE_TEMPLATE QList<T> QMap<Key, T>::values(const Key &akey) const
template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::const_iterator QMap<Key, T>::lowerBound(const Key &akey) const
{
- Node *lb = d->root() ? d->root()->lowerBound(akey) : 0;
+ Node *lb = d->root() ? d->root()->lowerBound(akey) : Q_NULLPTR;
if (!lb)
lb = d->end();
return const_iterator(lb);
@@ -1061,7 +1095,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &akey)
{
detach();
- Node *lb = d->root() ? d->root()->lowerBound(akey) : 0;
+ Node *lb = d->root() ? d->root()->lowerBound(akey) : Q_NULLPTR;
if (!lb)
lb = d->end();
return iterator(lb);
@@ -1071,7 +1105,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::const_iterator
QMap<Key, T>::upperBound(const Key &akey) const
{
- Node *ub = d->root() ? d->root()->upperBound(akey) : 0;
+ Node *ub = d->root() ? d->root()->upperBound(akey) : Q_NULLPTR;
if (!ub)
ub = d->end();
return const_iterator(ub);
@@ -1081,7 +1115,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &akey)
{
detach();
- Node *ub = d->root() ? d->root()->upperBound(akey) : 0;
+ Node *ub = d->root() ? d->root()->upperBound(akey) : Q_NULLPTR;
if (!ub)
ub = d->end();
return iterator(ub);
@@ -1134,7 +1168,7 @@ template <class Key, class T>
class QMultiMap : public QMap<Key, T>
{
public:
- QMultiMap() {}
+ QMultiMap() Q_DECL_NOTHROW {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QMultiMap(std::initializer_list<std::pair<Key,T> > list)
{
@@ -1143,7 +1177,10 @@ public:
}
#endif
QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
- inline void swap(QMultiMap<Key, T> &other) { QMap<Key, T>::swap(other); }
+#ifdef Q_COMPILER_RVALUE_REFS
+ QMultiMap(QMap<Key, T> &&other) Q_DECL_NOTHROW : QMap<Key, T>(std::move(other)) {}
+#endif
+ void swap(QMultiMap<Key, T> &other) Q_DECL_NOTHROW { QMap<Key, T>::swap(other); }
inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
{ return QMap<Key, T>::insert(key, value); }
diff --git a/src/corelib/tools/qqueue.cpp b/src/corelib/tools/qqueue.cpp
index 65b50c4e03..a8b5051616 100644
--- a/src/corelib/tools/qqueue.cpp
+++ b/src/corelib/tools/qqueue.cpp
@@ -71,19 +71,6 @@
*/
/*!
- \fn QQueue::QQueue()
-
- Constructs an empty queue.
-*/
-
-/*!
- \fn QQueue::~QQueue()
-
- Destroys the queue. References to the values in the queue, and all
- iterators over this queue, become invalid.
-*/
-
-/*!
\fn void QQueue::swap(QQueue<T> &other)
\since 4.8
diff --git a/src/corelib/tools/qqueue.h b/src/corelib/tools/qqueue.h
index 9d5bda1210..0cb8353d0f 100644
--- a/src/corelib/tools/qqueue.h
+++ b/src/corelib/tools/qqueue.h
@@ -43,9 +43,8 @@ template <class T>
class QQueue : public QList<T>
{
public:
- inline QQueue() {}
- inline ~QQueue() {}
- inline void swap(QQueue<T> &other) { QList<T>::swap(other); } // prevent QList<->QQueue swaps
+ // compiler-generated special member functions are fine!
+ inline void swap(QQueue<T> &other) Q_DECL_NOTHROW { QList<T>::swap(other); } // prevent QList<->QQueue swaps
#ifndef Q_QDOC
// bring in QList::swap(int, int). We cannot say using QList<T>::swap,
// because we don't want to make swap(QList&) available.
diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp
index b2174745e4..847f650a70 100644
--- a/src/corelib/tools/qrect.cpp
+++ b/src/corelib/tools/qrect.cpp
@@ -2403,7 +2403,6 @@ QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
/*!
\fn QRectF QRectF::marginsAdded(const QMarginsF &margins) const
- \relates QRectF
\since 5.3
Returns a rectangle grown by the \a margins.
@@ -2413,7 +2412,6 @@ QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
/*!
\fn QRectF QRectF::marginsRemoved(const QMarginsF &margins) const
- \relates QRectF
\since 5.3
Removes the \a margins from the rectangle, shrinking it.
@@ -2423,7 +2421,6 @@ QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
/*!
\fn QRectF QRectF::operator+=(const QMarginsF &margins)
- \relates QRectF
\since 5.3
Adds the \a margins to the rectangle, growing it.
@@ -2433,7 +2430,6 @@ QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
/*!
\fn QRectF QRectF::operator-=(const QMarginsF &margins)
- \relates QRectF
\since 5.3
Returns a rectangle shrunk by the \a margins.
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index f896828e2e..82de664a56 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -38,6 +38,7 @@
#include "qcache.h"
#include "qdatastream.h"
#include "qdebug.h"
+#include "qhashfunctions.h"
#include "qlist.h"
#include "qmap.h"
#include "qmutex.h"
@@ -491,7 +492,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
when it is followed by 'char'.
\endtable
- \keyword QRegExp wildcard matching
+ \target QRegExp wildcard matching
\section1 Wildcard Matching
Most command shells such as \e bash or \e cmd.exe support "file
@@ -886,6 +887,15 @@ static bool operator==(const QRegExpEngineKey &key1, const QRegExpEngineKey &key
&& key1.cs == key2.cs;
}
+static uint qHash(const QRegExpEngineKey &key, uint seed = 0) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.pattern);
+ seed = hash(seed, key.patternSyntax);
+ seed = hash(seed, key.cs);
+ return seed;
+}
+
class QRegExpEngine;
//Q_DECLARE_TYPEINFO(QVector<int>, Q_MOVABLE_TYPE);
@@ -1019,9 +1029,6 @@ class QRegExpCharClass
{
public:
QRegExpCharClass();
- inline QRegExpCharClass(const QRegExpCharClass &cc) { operator=(cc); }
-
- QRegExpCharClass &operator=(const QRegExpCharClass &cc);
void clear();
bool negative() const { return n; }
@@ -2319,17 +2326,6 @@ QRegExpCharClass::QRegExpCharClass()
#endif
}
-QRegExpCharClass &QRegExpCharClass::operator=(const QRegExpCharClass &cc)
-{
- c = cc.c;
- r = cc.r;
- n = cc.n;
-#ifndef QT_NO_REGEXP_OPTIM
- occ1 = cc.occ1;
-#endif
- return *this;
-}
-
void QRegExpCharClass::clear()
{
c = 0;
@@ -3811,11 +3807,6 @@ struct QRegExpPrivate
};
#if !defined(QT_NO_REGEXP_OPTIM)
-uint qHash(const QRegExpEngineKey &key, uint seed = 0) Q_DECL_NOTHROW
-{
- return qHash(key.pattern, seed);
-}
-
typedef QCache<QRegExpEngineKey, QRegExpEngine> EngineCache;
Q_GLOBAL_STATIC(EngineCache, globalEngineCache)
static QBasicMutex globalEngineCacheMutex;
@@ -4037,6 +4028,21 @@ bool QRegExp::operator==(const QRegExp &rx) const
}
/*!
+ \since 5.6
+ \relates QRegExp
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.priv->engineKey);
+ seed = hash(seed, key.priv->minimal);
+ return seed;
+}
+
+/*!
\fn bool QRegExp::operator!=(const QRegExp &rx) const
Returns \c true if this regular expression is not equal to \a rx;
diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h
index b08a8bd282..f384e6c51f 100644
--- a/src/corelib/tools/qregexp.h
+++ b/src/corelib/tools/qregexp.h
@@ -45,6 +45,9 @@ QT_BEGIN_NAMESPACE
struct QRegExpPrivate;
class QStringList;
+class QRegExp;
+
+Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed = 0) Q_DECL_NOTHROW;
class Q_CORE_EXPORT QRegExp
{
@@ -104,6 +107,8 @@ public:
static QString escape(const QString &str);
+ friend Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW;
+
private:
QRegExpPrivate *priv;
};
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 070e68154f..81b108059b 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -38,6 +38,7 @@
#ifndef QT_NO_REGULAREXPRESSION
#include <QtCore/qcoreapplication.h>
+#include <QtCore/qhashfunctions.h>
#include <QtCore/qmutex.h>
#include <QtCore/qvector.h>
#include <QtCore/qstringlist.h>
@@ -1842,6 +1843,21 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const
*/
/*!
+ \since 5.6
+ \relates QRegularExpression
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QRegularExpression &key, uint seed) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.d->pattern);
+ seed = hash(seed, key.d->patternOptions);
+ return seed;
+}
+
+/*!
Escapes all characters of \a str so that they no longer have any special
meaning when used as a regular expression pattern string, and returns
the escaped string. For instance:
@@ -2109,7 +2125,8 @@ QStringRef QRegularExpressionMatch::capturedRef(const QString &name) const
QStringList QRegularExpressionMatch::capturedTexts() const
{
QStringList texts;
- for (int i = 0; i <= lastCapturedIndex(); ++i)
+ texts.reserve(d->capturedCount);
+ for (int i = 0; i < d->capturedCount; ++i)
texts << captured(i);
return texts;
}
@@ -2462,7 +2479,7 @@ QDataStream &operator>>(QDataStream &in, QRegularExpression &re)
QDebug operator<<(QDebug debug, const QRegularExpression &re)
{
QDebugStateSaver saver(debug);
- debug.nospace() << "QRegularExpression(" << re.pattern() << ", " << re.patternOptions() << ")";
+ debug.nospace() << "QRegularExpression(" << re.pattern() << ", " << re.patternOptions() << ')';
return debug;
}
@@ -2504,7 +2521,7 @@ QDebug operator<<(QDebug debug, QRegularExpression::PatternOptions patternOption
flags.chop(1);
}
- debug.nospace() << "QRegularExpression::PatternOptions(" << flags << ")";
+ debug.nospace() << "QRegularExpression::PatternOptions(" << flags << ')';
return debug;
}
@@ -2533,7 +2550,7 @@ QDebug operator<<(QDebug debug, const QRegularExpressionMatch &match)
for (int i = 0; i <= match.lastCapturedIndex(); ++i) {
debug << i
<< ":(" << match.capturedStart(i) << ", " << match.capturedEnd(i)
- << ", " << match.captured(i) << ")";
+ << ", " << match.captured(i) << ')';
if (i < match.lastCapturedIndex())
debug << ", ";
}
@@ -2541,12 +2558,12 @@ QDebug operator<<(QDebug debug, const QRegularExpressionMatch &match)
debug << ", has partial match: ("
<< match.capturedStart(0) << ", "
<< match.capturedEnd(0) << ", "
- << match.captured(0) << ")";
+ << match.captured(0) << ')';
} else {
debug << ", no match";
}
- debug << ")";
+ debug << ')';
return debug;
}
diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h
index d2abfc7701..2bca6a211b 100644
--- a/src/corelib/tools/qregularexpression.h
+++ b/src/corelib/tools/qregularexpression.h
@@ -49,6 +49,9 @@ QT_BEGIN_NAMESPACE
class QRegularExpressionMatch;
class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate;
+class QRegularExpression;
+
+Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed = 0) Q_DECL_NOTHROW;
class Q_CORE_EXPORT QRegularExpression
{
@@ -139,6 +142,7 @@ private:
friend class QRegularExpressionMatch;
friend struct QRegularExpressionMatchPrivate;
friend class QRegularExpressionMatchIterator;
+ friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) Q_DECL_NOTHROW;
QRegularExpression(QRegularExpressionPrivate &dd);
QExplicitlySharedDataPointer<QRegularExpressionPrivate> d;
diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp
new file mode 100644
index 0000000000..85cfdaf129
--- /dev/null
+++ b/src/corelib/tools/qringbuffer.cpp
@@ -0,0 +1,314 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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/qringbuffer_p.h"
+#include "private/qbytearray_p.h"
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+
+ Access the bytes at a specified position the out-variable length will
+ contain the amount of bytes readable from there, e.g. the amount still
+ the same QByteArray
+*/
+const char *QRingBuffer::readPointerAtPosition(qint64 pos, qint64 &length) const
+{
+ if (pos >= 0) {
+ pos += head;
+ for (int i = 0; i < buffers.size(); ++i) {
+ length = (i == tailBuffer ? tail : buffers[i].size());
+ if (length > pos) {
+ length -= pos;
+ return buffers[i].constData() + pos;
+ }
+ pos -= length;
+ }
+ }
+
+ length = 0;
+ return 0;
+}
+
+void QRingBuffer::free(qint64 bytes)
+{
+ while (bytes > 0) {
+ const qint64 blockSize = buffers.first().size() - head;
+
+ if (tailBuffer == 0 || blockSize > bytes) {
+ // keep a single block around if it does not exceed
+ // the basic block size, to avoid repeated allocations
+ // between uses of the buffer
+ if (bufferSize <= bytes) {
+ if (buffers.first().size() <= basicBlockSize) {
+ bufferSize = 0;
+ head = tail = 0;
+ } else {
+ clear(); // try to minify/squeeze us
+ }
+ } else {
+ Q_ASSERT(bytes < MaxByteArraySize);
+ head += int(bytes);
+ bufferSize -= bytes;
+ }
+ return;
+ }
+
+ bufferSize -= blockSize;
+ bytes -= blockSize;
+ buffers.removeFirst();
+ --tailBuffer;
+ head = 0;
+ }
+}
+
+char *QRingBuffer::reserve(qint64 bytes)
+{
+ if (bytes <= 0 || bytes >= MaxByteArraySize)
+ return 0;
+
+ const qint64 newSize = bytes + tail;
+ // if need buffer reallocation
+ if (newSize > buffers.last().size()) {
+ if (newSize > buffers.last().capacity() && (tail >= basicBlockSize
+ || newSize >= MaxByteArraySize)) {
+ // shrink this buffer to its current size
+ buffers.last().resize(tail);
+
+ // create a new QByteArray
+ buffers.append(QByteArray());
+ ++tailBuffer;
+ tail = 0;
+ }
+ buffers.last().resize(qMax(basicBlockSize, tail + int(bytes)));
+ }
+
+ char *writePtr = buffers.last().data() + tail;
+ bufferSize += bytes;
+ Q_ASSERT(bytes < MaxByteArraySize);
+ tail += int(bytes);
+ return writePtr;
+}
+
+/*!
+ \internal
+
+ Allocate data at buffer head
+*/
+char *QRingBuffer::reserveFront(qint64 bytes)
+{
+ if (bytes <= 0 || bytes >= MaxByteArraySize)
+ return 0;
+
+ if (head < bytes) {
+ buffers.first().remove(0, head);
+ if (tailBuffer == 0)
+ tail -= head;
+
+ head = qMax(basicBlockSize, int(bytes));
+ if (bufferSize == 0) {
+ tail = head;
+ } else {
+ buffers.prepend(QByteArray());
+ ++tailBuffer;
+ }
+ buffers.first().resize(head);
+ }
+
+ head -= int(bytes);
+ bufferSize += bytes;
+ return buffers.first().data() + head;
+}
+
+void QRingBuffer::chop(qint64 bytes)
+{
+ while (bytes > 0) {
+ if (tailBuffer == 0 || tail > bytes) {
+ // keep a single block around if it does not exceed
+ // the basic block size, to avoid repeated allocations
+ // between uses of the buffer
+ if (bufferSize <= bytes) {
+ if (buffers.first().size() <= basicBlockSize) {
+ bufferSize = 0;
+ head = tail = 0;
+ } else {
+ clear(); // try to minify/squeeze us
+ }
+ } else {
+ Q_ASSERT(bytes < MaxByteArraySize);
+ tail -= int(bytes);
+ bufferSize -= bytes;
+ }
+ return;
+ }
+
+ bufferSize -= tail;
+ bytes -= tail;
+ buffers.removeLast();
+ --tailBuffer;
+ tail = buffers.last().size();
+ }
+}
+
+void QRingBuffer::clear()
+{
+ buffers.erase(buffers.begin() + 1, buffers.end());
+ buffers.first().clear();
+
+ head = tail = 0;
+ tailBuffer = 0;
+ bufferSize = 0;
+}
+
+qint64 QRingBuffer::indexOf(char c, qint64 maxLength) const
+{
+ qint64 index = 0;
+ qint64 j = head;
+ for (int i = 0; index < maxLength && i < buffers.size(); ++i) {
+ const char *ptr = buffers[i].constData() + j;
+ j = qMin(index + (i == tailBuffer ? tail : buffers[i].size()) - j, maxLength);
+
+ while (index < j) {
+ if (*ptr++ == c)
+ return index;
+ ++index;
+ }
+ j = 0;
+ }
+ return -1;
+}
+
+qint64 QRingBuffer::read(char *data, qint64 maxLength)
+{
+ const qint64 bytesToRead = qMin(size(), maxLength);
+ qint64 readSoFar = 0;
+ while (readSoFar < bytesToRead) {
+ const qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,
+ nextDataBlockSize());
+ if (data)
+ memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock);
+ readSoFar += bytesToReadFromThisBlock;
+ free(bytesToReadFromThisBlock);
+ }
+ return readSoFar;
+}
+
+/*!
+ \internal
+
+ Read an unspecified amount (will read the first buffer)
+*/
+QByteArray QRingBuffer::read()
+{
+ if (bufferSize == 0)
+ return QByteArray();
+
+ QByteArray qba(buffers.takeFirst());
+
+ qba.reserve(0); // avoid that resizing needlessly reallocates
+ if (tailBuffer == 0) {
+ qba.resize(tail);
+ tail = 0;
+ buffers.append(QByteArray());
+ } else {
+ --tailBuffer;
+ }
+ qba.remove(0, head); // does nothing if head is 0
+ head = 0;
+ bufferSize -= qba.size();
+ return qba;
+}
+
+/*!
+ \internal
+
+ Peek the bytes from a specified position
+*/
+qint64 QRingBuffer::peek(char *data, qint64 maxLength, qint64 pos) const
+{
+ qint64 readSoFar = 0;
+
+ if (pos >= 0) {
+ pos += head;
+ for (int i = 0; readSoFar < maxLength && i < buffers.size(); ++i) {
+ qint64 blockLength = (i == tailBuffer ? tail : buffers[i].size());
+
+ if (pos < blockLength) {
+ blockLength = qMin(blockLength - pos, maxLength - readSoFar);
+ memcpy(data + readSoFar, buffers[i].constData() + pos, blockLength);
+ readSoFar += blockLength;
+ pos = 0;
+ } else {
+ pos -= blockLength;
+ }
+ }
+ }
+
+ return readSoFar;
+}
+
+/*!
+ \internal
+
+ Append a new buffer to the end
+*/
+void QRingBuffer::append(const QByteArray &qba)
+{
+ if (tail == 0) {
+ buffers.last() = qba;
+ } else {
+ buffers.last().resize(tail);
+ buffers.append(qba);
+ ++tailBuffer;
+ }
+ tail = qba.size();
+ bufferSize += tail;
+}
+
+qint64 QRingBuffer::readLine(char *data, qint64 maxLength)
+{
+ if (!data || --maxLength <= 0)
+ return -1;
+
+ qint64 i = indexOf('\n', maxLength);
+ i = read(data, i >= 0 ? (i + 1) : maxLength);
+
+ // Terminate it.
+ data[i] = '\0';
+ return i;
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index ead85e9da0..68509a6a80 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -58,7 +58,7 @@ public:
buffers.append(QByteArray());
}
- inline int nextDataBlockSize() const {
+ inline qint64 nextDataBlockSize() const {
return (tailBuffer == 0 ? tail : buffers.first().size()) - head;
}
@@ -66,112 +66,17 @@ public:
return bufferSize == 0 ? Q_NULLPTR : (buffers.first().constData() + head);
}
- // access the bytes at a specified position
- // the out-variable length will contain the amount of bytes readable
- // from there, e.g. the amount still the same QByteArray
- inline const char *readPointerAtPosition(qint64 pos, qint64 &length) const {
- if (pos >= 0) {
- pos += head;
- for (int i = 0; i < buffers.size(); ++i) {
- length = (i == tailBuffer ? tail : buffers[i].size());
- if (length > pos) {
- length -= pos;
- return buffers[i].constData() + pos;
- }
- pos -= length;
- }
- }
-
- length = 0;
- return 0;
- }
-
- inline void free(int bytes) {
- while (bytes > 0) {
- int blockSize = buffers.first().size() - head;
-
- if (tailBuffer == 0 || blockSize > bytes) {
- // keep a single block around if it does not exceed
- // the basic block size, to avoid repeated allocations
- // between uses of the buffer
- if (bufferSize <= bytes) {
- if (buffers.first().size() <= basicBlockSize) {
- bufferSize = 0;
- head = tail = 0;
- } else {
- clear(); // try to minify/squeeze us
- }
- } else {
- head += bytes;
- bufferSize -= bytes;
- }
- return;
- }
-
- bufferSize -= blockSize;
- bytes -= blockSize;
- buffers.removeFirst();
- --tailBuffer;
- head = 0;
- }
- }
-
- inline char *reserve(int bytes) {
- if (bytes <= 0)
- return 0;
-
- // if need buffer reallocation
- if (tail + bytes > buffers.last().size()) {
- if (tail + bytes > buffers.last().capacity() && tail >= basicBlockSize) {
- // shrink this buffer to its current size
- buffers.last().resize(tail);
-
- // create a new QByteArray
- buffers.append(QByteArray());
- ++tailBuffer;
- tail = 0;
- }
- buffers.last().resize(qMax(basicBlockSize, tail + bytes));
- }
+ Q_CORE_EXPORT const char *readPointerAtPosition(qint64 pos, qint64 &length) const;
+ Q_CORE_EXPORT void free(qint64 bytes);
+ Q_CORE_EXPORT char *reserve(qint64 bytes);
+ Q_CORE_EXPORT char *reserveFront(qint64 bytes);
- char *writePtr = buffers.last().data() + tail;
- bufferSize += bytes;
- tail += bytes;
- return writePtr;
- }
-
- inline void truncate(int pos) {
+ inline void truncate(qint64 pos) {
if (pos < size())
chop(size() - pos);
}
- inline void chop(int bytes) {
- while (bytes > 0) {
- if (tailBuffer == 0 || tail > bytes) {
- // keep a single block around if it does not exceed
- // the basic block size, to avoid repeated allocations
- // between uses of the buffer
- if (bufferSize <= bytes) {
- if (buffers.first().size() <= basicBlockSize) {
- bufferSize = 0;
- head = tail = 0;
- } else {
- clear(); // try to minify/squeeze us
- }
- } else {
- tail -= bytes;
- bufferSize -= bytes;
- }
- return;
- }
-
- bufferSize -= tail;
- bytes -= tail;
- buffers.removeLast();
- --tailBuffer;
- tail = buffers.last().size();
- }
- }
+ Q_CORE_EXPORT void chop(qint64 bytes);
inline bool isEmpty() const {
return bufferSize == 0;
@@ -190,131 +95,36 @@ public:
*ptr = c;
}
- inline void ungetChar(char c) {
- --head;
- if (head < 0) {
- if (bufferSize != 0) {
- buffers.prepend(QByteArray());
- ++tailBuffer;
- } else {
- tail = basicBlockSize;
- }
- buffers.first().resize(basicBlockSize);
- head = basicBlockSize - 1;
- }
- buffers.first()[head] = c;
- ++bufferSize;
- }
-
- inline int size() const {
- return bufferSize;
- }
-
- inline void clear() {
- buffers.erase(buffers.begin() + 1, buffers.end());
- buffers.first().clear();
-
- head = tail = 0;
- tailBuffer = 0;
- bufferSize = 0;
- }
-
- inline int indexOf(char c) const {
- int index = 0;
- int j = head;
- for (int i = 0; i < buffers.size(); ++i) {
- const char *ptr = buffers[i].constData() + j;
- j = index + (i == tailBuffer ? tail : buffers[i].size()) - j;
-
- while (index < j) {
- if (*ptr++ == c)
- return index;
- ++index;
- }
- j = 0;
- }
- return -1;
- }
-
- inline int indexOf(char c, int maxLength) const {
- int index = 0;
- int j = head;
- for (int i = 0; index < maxLength && i < buffers.size(); ++i) {
- const char *ptr = buffers[i].constData() + j;
- j = qMin(index + (i == tailBuffer ? tail : buffers[i].size()) - j, maxLength);
-
- while (index < j) {
- if (*ptr++ == c)
- return index;
- ++index;
- }
- j = 0;
- }
- return -1;
- }
-
- inline int read(char *data, int maxLength) {
- int bytesToRead = qMin(size(), maxLength);
- int readSoFar = 0;
- while (readSoFar < bytesToRead) {
- int bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar, nextDataBlockSize());
- if (data)
- memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock);
- readSoFar += bytesToReadFromThisBlock;
- free(bytesToReadFromThisBlock);
+ void ungetChar(char c)
+ {
+ if (head > 0) {
+ --head;
+ buffers.first()[head] = c;
+ ++bufferSize;
+ } else {
+ char *ptr = reserveFront(1);
+ *ptr = c;
}
- return readSoFar;
}
- // read an unspecified amount (will read the first buffer)
- inline QByteArray read() {
- if (bufferSize == 0)
- return QByteArray();
- QByteArray qba(buffers.takeFirst());
-
- qba.reserve(0); // avoid that resizing needlessly reallocates
- if (tailBuffer == 0) {
- qba.resize(tail);
- tail = 0;
- buffers.append(QByteArray());
- } else {
- --tailBuffer;
- }
- qba.remove(0, head); // does nothing if head is 0
- head = 0;
- bufferSize -= qba.size();
- return qba;
+ inline qint64 size() const {
+ return bufferSize;
}
- // append a new buffer to the end
- inline void append(const QByteArray &qba) {
- if (tail == 0) {
- buffers.last() = qba;
- } else {
- buffers.last().resize(tail);
- buffers.append(qba);
- ++tailBuffer;
- }
- tail = qba.size();
- bufferSize += tail;
- }
+ Q_CORE_EXPORT void clear();
+ inline qint64 indexOf(char c) const { return indexOf(c, size()); }
+ Q_CORE_EXPORT qint64 indexOf(char c, qint64 maxLength) const;
+ Q_CORE_EXPORT qint64 read(char *data, qint64 maxLength);
+ Q_CORE_EXPORT QByteArray read();
+ Q_CORE_EXPORT qint64 peek(char *data, qint64 maxLength, qint64 pos = 0) const;
+ Q_CORE_EXPORT void append(const QByteArray &qba);
- inline int skip(int length) {
+ inline qint64 skip(qint64 length) {
return read(0, length);
}
- inline int readLine(char *data, int maxLength) {
- if (!data || --maxLength <= 0)
- return -1;
-
- int i = indexOf('\n', maxLength);
- i = read(data, i >= 0 ? (i + 1) : maxLength);
-
- // Terminate it.
- data[i] = '\0';
- return i;
- }
+ Q_CORE_EXPORT qint64 readLine(char *data, qint64 maxLength);
inline bool canReadLine() const {
return indexOf('\n') >= 0;
@@ -325,7 +135,7 @@ private:
int head, tail;
int tailBuffer; // always buffers.size() - 1
const int basicBlockSize;
- int bufferSize;
+ qint64 bufferSize;
};
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 819ab00584..8d478f81f9 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -91,7 +91,7 @@ class QScopedPointer
{
typedef T *QScopedPointer:: *RestrictedBool;
public:
- explicit inline QScopedPointer(T *p = 0) : d(p)
+ explicit inline QScopedPointer(T *p = Q_NULLPTR) : d(p)
{
}
@@ -121,12 +121,12 @@ public:
#if defined(Q_QDOC)
inline operator bool() const
{
- return isNull() ? 0 : &QScopedPointer::d;
+ return isNull() ? Q_NULLPTR : &QScopedPointer::d;
}
#else
inline operator RestrictedBool() const
{
- return isNull() ? 0 : &QScopedPointer::d;
+ return isNull() ? Q_NULLPTR : &QScopedPointer::d;
}
#endif
@@ -140,7 +140,7 @@ public:
return !d;
}
- inline void reset(T *other = 0)
+ inline void reset(T *other = Q_NULLPTR)
{
if (d == other)
return;
@@ -152,7 +152,7 @@ public:
inline T *take()
{
T *oldD = d;
- d = 0;
+ d = Q_NULLPTR;
return oldD;
}
@@ -206,10 +206,10 @@ template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
{
public:
- inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(0) {}
+ inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(Q_NULLPTR) {}
template <typename D>
- explicit inline QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0)
+ explicit inline QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = Q_NULLPTR)
: QScopedPointer<T, Cleanup>(p)
{
}
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index e4688711d6..3f4208e8b3 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -39,6 +39,8 @@
#include <initializer_list>
#endif
+#include <iterator>
+
QT_BEGIN_NAMESPACE
@@ -48,7 +50,7 @@ class QSet
typedef QHash<T, QHashDummyValue> Hash;
public:
- inline QSet() {}
+ inline QSet() Q_DECL_NOTHROW {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QSet(std::initializer_list<T> list)
{
@@ -57,16 +59,10 @@ public:
insert(*it);
}
#endif
- inline QSet(const QSet<T> &other) : q_hash(other.q_hash) {}
-
- inline QSet<T> &operator=(const QSet<T> &other)
- { q_hash = other.q_hash; return *this; }
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QSet(QSet &&other) : q_hash(qMove(other.q_hash)) {}
- inline QSet<T> &operator=(QSet<T> &&other)
- { qSwap(q_hash, other.q_hash); return *this; }
-#endif
- inline void swap(QSet<T> &other) { q_hash.swap(other.q_hash); }
+ // compiler-generated copy/move ctor/assignment operators are fine!
+ // compiler-generated destructor is fine!
+
+ inline void swap(QSet<T> &other) Q_DECL_NOTHROW { q_hash.swap(other.q_hash); }
inline bool operator==(const QSet<T> &other) const
{ return q_hash == other.q_hash; }
@@ -137,6 +133,7 @@ public:
typedef QHash<T, QHashDummyValue> Hash;
typename Hash::const_iterator i;
friend class iterator;
+ friend class QSet<T>;
public:
typedef std::bidirectional_iterator_tag iterator_category;
@@ -166,14 +163,25 @@ public:
};
// STL style
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
inline iterator begin() { return q_hash.begin(); }
- inline const_iterator begin() const { return q_hash.begin(); }
- inline const_iterator cbegin() const { return q_hash.begin(); }
- inline const_iterator constBegin() const { return q_hash.constBegin(); }
+ inline const_iterator begin() const Q_DECL_NOTHROW { return q_hash.begin(); }
+ inline const_iterator cbegin() const Q_DECL_NOTHROW { return q_hash.begin(); }
+ inline const_iterator constBegin() const Q_DECL_NOTHROW { return q_hash.constBegin(); }
inline iterator end() { return q_hash.end(); }
- inline const_iterator end() const { return q_hash.end(); }
- inline const_iterator cend() const { return q_hash.end(); }
- inline const_iterator constEnd() const { return q_hash.constEnd(); }
+ inline const_iterator end() const Q_DECL_NOTHROW { return q_hash.end(); }
+ inline const_iterator cend() const Q_DECL_NOTHROW { return q_hash.end(); }
+ inline const_iterator constEnd() const Q_DECL_NOTHROW { return q_hash.constEnd(); }
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+
iterator erase(iterator i)
{
Q_ASSERT_X(isValidIterator(i), "QSet::erase", "The specified const_iterator argument 'i' is invalid");
@@ -191,6 +199,7 @@ public:
inline const_iterator constFind(const T &value) const { return find(value); }
QSet<T> &unite(const QSet<T> &other);
QSet<T> &intersect(const QSet<T> &other);
+ bool intersects(const QSet<T> &other) const;
QSet<T> &subtract(const QSet<T> &other);
// STL compatibility
@@ -284,6 +293,34 @@ Q_INLINE_TEMPLATE QSet<T> &QSet<T>::intersect(const QSet<T> &other)
}
template <class T>
+Q_INLINE_TEMPLATE bool QSet<T>::intersects(const QSet<T> &other) const
+{
+ const bool otherIsBigger = other.size() > size();
+ const QSet &smallestSet = otherIsBigger ? *this : other;
+ const QSet &biggestSet = otherIsBigger ? other : *this;
+ const bool equalSeeds = q_hash.d->seed == other.q_hash.d->seed;
+ typename QSet::const_iterator i = smallestSet.cbegin();
+ typename QSet::const_iterator e = smallestSet.cend();
+
+ if (Q_LIKELY(equalSeeds)) {
+ // If seeds are equal we take the fast path so no hash is recalculated.
+ while (i != e) {
+ if (*biggestSet.q_hash.findNode(*i, i.i.i->h) != biggestSet.q_hash.e)
+ return true;
+ ++i;
+ }
+ } else {
+ while (i != e) {
+ if (biggestSet.contains(*i))
+ return true;
+ ++i;
+ }
+ }
+
+ return false;
+}
+
+template <class T>
Q_INLINE_TEMPLATE QSet<T> &QSet<T>::subtract(const QSet<T> &other)
{
QSet<T> copy1(*this);
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index 072e65af0e..542def4651 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -114,40 +114,6 @@
*/
/*!
- \fn QSet::QSet(const QSet<T> &other)
-
- Constructs a copy of \a other.
-
- This operation occurs in \l{constant time}, because QSet is
- \l{implicitly shared}. This makes returning a QSet from a
- function very fast. If a shared instance is modified, it will be
- copied (copy-on-write), and this takes \l{linear time}.
-
- \sa operator=()
-*/
-
-/*!
- \fn QSet::QSet(QSet && other)
-
- Move-constructs a QSet instance, making it point to the same object that
- \a other was pointing to.
-*/
-
-
-/*!
- \fn QSet<T> &QSet::operator=(const QSet<T> &other)
-
- Assigns the \a other set to this set and returns a reference to
- this set.
-*/
-
-/*!
- \fn QSet<T> &QSet::operator=(QSet<T> &&other)
-
- Move-assigns the \a other set to this set.
-*/
-
-/*!
\fn void QSet::swap(QSet<T> &other)
Swaps set \a other with this set. This operation is very fast and
@@ -418,6 +384,52 @@
\sa constBegin(), end()
*/
+/*! \fn QSet::reverse_iterator QSet::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the set, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QSet::const_reverse_iterator QSet::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QSet::const_reverse_iterator QSet::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the set, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QSet::reverse_iterator QSet::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last item in the set, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QSet::const_reverse_iterator QSet::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QSet::const_reverse_iterator QSet::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last item in the set, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*!
\typedef QSet::Iterator
\since 4.2
@@ -479,6 +491,38 @@
Typedef for T. Provided for STL compatibility.
*/
+/*! \typedef QSet::reverse_iterator
+ \since 5.6
+
+ The QSet::reverse_iterator typedef provides an STL-style non-const
+ reverse iterator for QSet.
+
+ It is simply a typedef for \c{std::reverse_iterator<QSet::iterator>}.
+
+ \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}.
+
+ \sa QSet::rbegin(), QSet::rend(), QSet::const_reverse_iterator, QSet::iterator
+*/
+
+/*! \typedef QSet::const_reverse_iterator
+ \since 5.6
+
+ The QSet::const_reverse_iterator typedef provides an STL-style const
+ reverse iterator for QSet.
+
+ It is simply a typedef for \c{std::reverse_iterator<QSet::const_iterator>}.
+
+ \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}.
+
+ \sa QSet::rbegin(), QSet::rend(), QSet::reverse_iterator, QSet::const_iterator
+*/
+
/*!
\fn QSet::const_iterator QSet::insert(const T &value)
@@ -504,7 +548,17 @@
Removes all items from this set that are not contained in the
\a other set. A reference to this set is returned.
- \sa operator&=(), unite(), subtract()
+ \sa intersects(), operator&=(), unite(), subtract()
+*/
+
+/*!
+ \fn bool QSet::intersects(const QSet<T> &other) const
+ \since 5.6
+
+ Returns \c true if this set has at least one item in common with
+ \a other.
+
+ \sa contains(), intersect()
*/
/*!
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 9dd8fff9cb..6a0900cf3f 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -36,7 +36,10 @@
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/qhash.h>
+#endif
+#include <QtCore/qhashfunctions.h>
QT_BEGIN_NAMESPACE
@@ -76,7 +79,7 @@ public:
inline bool operator==(const QSharedDataPointer<T> &other) const { return d == other.d; }
inline bool operator!=(const QSharedDataPointer<T> &other) const { return d != other.d; }
- inline QSharedDataPointer() { d = 0; }
+ inline QSharedDataPointer() { d = Q_NULLPTR; }
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
explicit QSharedDataPointer(T *data) Q_DECL_NOTHROW;
@@ -142,17 +145,17 @@ public:
if(d && !d->ref.deref())
delete d;
- d = 0;
+ d = Q_NULLPTR;
}
- inline operator bool () const { return d != 0; }
+ inline operator bool () const { return d != Q_NULLPTR; }
inline bool operator==(const QExplicitlySharedDataPointer<T> &other) const { return d == other.d; }
inline bool operator!=(const QExplicitlySharedDataPointer<T> &other) const { return d != other.d; }
inline bool operator==(const T *ptr) const { return d == ptr; }
inline bool operator!=(const T *ptr) const { return d != ptr; }
- inline QExplicitlySharedDataPointer() { d = 0; }
+ inline QExplicitlySharedDataPointer() { d = Q_NULLPTR; }
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
explicit QExplicitlySharedDataPointer(T *data) Q_DECL_NOTHROW;
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 9e6b48a97d..bd98cb326c 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -55,7 +55,10 @@ QT_END_NAMESPACE
#include <new>
#include <QtCore/qatomic.h>
#include <QtCore/qobject.h> // for qobject_cast
-#include <QtCore/qhash.h> // for qHash
+#if QT_DEPRECATED_SINCE(5, 5)
+#include <QtCore/qhash.h>
+#endif
+#include <QtCore/qhashfunctions.h>
#if defined(Q_COMPILER_RVALUE_REFS) && defined(Q_COMPILER_VARIADIC_TEMPLATES)
# include <utility> // for std::forward
@@ -297,12 +300,12 @@ public:
inline T *data() const { return value; }
inline bool isNull() const { return !data(); }
- inline operator RestrictedBool() const { return isNull() ? 0 : &QSharedPointer::value; }
+ inline operator RestrictedBool() const { return isNull() ? Q_NULLPTR : &QSharedPointer::value; }
inline bool operator !() const { return isNull(); }
inline T &operator*() const { return *data(); }
inline T *operator->() const { return data(); }
- QSharedPointer() : value(0), d(0) { }
+ QSharedPointer() : value(Q_NULLPTR), d(Q_NULLPTR) { }
~QSharedPointer() { deref(); }
inline explicit QSharedPointer(T *ptr) : value(ptr) // noexcept
@@ -324,14 +327,32 @@ public:
inline QSharedPointer(QSharedPointer &&other)
: value(other.value), d(other.d)
{
- other.d = 0;
- other.value = 0;
+ other.d = Q_NULLPTR;
+ other.value = Q_NULLPTR;
}
inline QSharedPointer &operator=(QSharedPointer &&other)
{
- swap(other);
+ QSharedPointer moved(std::move(other));
+ swap(moved);
+ return *this;
+ }
+
+ template <class X>
+ QSharedPointer(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ : value(other.value), d(other.d)
+ {
+ other.d = Q_NULLPTR;
+ other.value = Q_NULLPTR;
+ }
+
+ template <class X>
+ QSharedPointer &operator=(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ {
+ QSharedPointer moved(std::move(other));
+ swap(moved);
return *this;
}
+
#endif
template <class X>
@@ -341,13 +362,13 @@ public:
template <class X>
inline QSharedPointer &operator=(const QSharedPointer<X> &other)
{
- QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid
- internalCopy(other);
+ QSharedPointer copy(other);
+ swap(copy);
return *this;
}
template <class X>
- inline QSharedPointer(const QWeakPointer<X> &other) : value(0), d(0)
+ inline QSharedPointer(const QWeakPointer<X> &other) : value(Q_NULLPTR), d(Q_NULLPTR)
{ *this = other; }
template <class X>
@@ -463,9 +484,9 @@ public:
private:
explicit QSharedPointer(Qt::Initialization) {}
- inline void deref()
+ void deref() Q_DECL_NOTHROW
{ deref(d); }
- static inline void deref(Data *d)
+ static void deref(Data *d) Q_DECL_NOTHROW
{
if (!d) return;
if (!d->strongref.deref()) {
@@ -478,7 +499,7 @@ private:
template <class X>
inline void enableSharedFromThis(const QEnableSharedFromThis<X> *ptr)
{
- ptr->initializeFromSharedPointer(*this);
+ ptr->initializeFromSharedPointer(constCast<typename QtPrivate::remove_cv<T>::type>());
}
inline void enableSharedFromThis(...) {}
@@ -487,7 +508,7 @@ private:
inline void internalConstruct(T *ptr, Deleter deleter)
{
if (!ptr) {
- d = 0;
+ d = Q_NULLPTR;
return;
}
@@ -506,19 +527,7 @@ private:
enableSharedFromThis(ptr);
}
- template <class X>
- inline void internalCopy(const QSharedPointer<X> &other)
- {
- Data *o = other.d;
- T *actual = other.value;
- if (o)
- other.ref();
- qSwap(d, o);
- qSwap(this->value, actual);
- deref(o);
- }
-
- inline void internalSwap(QSharedPointer &other)
+ void internalSwap(QSharedPointer &other) Q_DECL_NOTHROW
{
qSwap(d, other.d);
qSwap(this->value, other.value);
@@ -531,7 +540,7 @@ public:
template <class X> friend class QWeakPointer;
template <class X, class Y> friend QSharedPointer<X> QtSharedPointer::copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src);
#endif
- inline void ref() const { d->weakref.ref(); d->strongref.ref(); }
+ void ref() const Q_DECL_NOTHROW { d->weakref.ref(); d->strongref.ref(); }
inline void internalSet(Data *o, T *actual)
{
@@ -550,14 +559,14 @@ public:
o->weakref.ref();
} else {
o->checkQObjectShared(actual);
- o = 0;
+ o = Q_NULLPTR;
}
}
qSwap(d, o);
qSwap(this->value, actual);
if (!d || d->strongref.load() == 0)
- this->value = 0;
+ this->value = Q_NULLPTR;
// dereference saved data
deref(o);
@@ -582,19 +591,19 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- inline bool isNull() const { return d == 0 || d->strongref.load() == 0 || value == 0; }
- inline operator RestrictedBool() const { return isNull() ? 0 : &QWeakPointer::value; }
+ inline bool isNull() const { return d == Q_NULLPTR || d->strongref.load() == 0 || value == Q_NULLPTR; }
+ inline operator RestrictedBool() const { return isNull() ? Q_NULLPTR : &QWeakPointer::value; }
inline bool operator !() const { return isNull(); }
- inline T *data() const { return d == 0 || d->strongref.load() == 0 ? 0 : value; }
+ inline T *data() const { return d == Q_NULLPTR || d->strongref.load() == 0 ? Q_NULLPTR : value; }
- Q_DECL_CONSTEXPR inline QWeakPointer() : d(0), value(0) { }
+ inline QWeakPointer() : d(Q_NULLPTR), value(Q_NULLPTR) { }
inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
#ifndef QT_NO_QOBJECT
// special constructor that is enabled only if X derives from QObject
#if QT_DEPRECATED_SINCE(5, 0)
template <class X>
- QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : 0), value(ptr)
+ QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : Q_NULLPTR), value(ptr)
{ }
#endif
#endif
@@ -628,7 +637,7 @@ public:
}
template <class X>
- inline QWeakPointer(const QWeakPointer<X> &o) : d(0), value(0)
+ inline QWeakPointer(const QWeakPointer<X> &o) : d(Q_NULLPTR), value(Q_NULLPTR)
{ *this = o; }
template <class X>
@@ -649,7 +658,7 @@ public:
{ return !(*this == o); }
template <class X>
- inline QWeakPointer(const QSharedPointer<X> &o) : d(0), value(0)
+ inline QWeakPointer(const QSharedPointer<X> &o) : d(Q_NULLPTR), value(Q_NULLPTR)
{ *this = o; }
template <class X>
@@ -693,7 +702,7 @@ public:
#ifndef QT_NO_QOBJECT
template <class X>
- inline QWeakPointer(X *ptr, bool) : d(ptr ? Data::getAndRef(ptr) : 0), value(ptr)
+ inline QWeakPointer(X *ptr, bool) : d(ptr ? Data::getAndRef(ptr) : Q_NULLPTR), value(ptr)
{ }
#endif
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 4459d89e07..f07eb098f2 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -43,7 +43,9 @@
#if defined(Q_OS_WIN)
# if defined(Q_OS_WINCE)
# include <qt_windows.h>
-# include <cmnintrin.h>
+# if _WIN32_WCE < 0x800
+# include <cmnintrin.h>
+# endif
# endif
# if !defined(Q_CC_GNU)
# ifndef Q_OS_WINCE
@@ -76,28 +78,28 @@ static inline uint detectProcessorFeatures()
return 0;
}
#elif defined (Q_OS_WINCE)
-static inline uint detectProcessorFeatures()
+static inline quint64 detectProcessorFeatures()
{
- uint features = 0;
+ quint64 features = 0;
#if defined (ARM)
# ifdef PF_ARM_NEON
if (IsProcessorFeaturePresent(PF_ARM_NEON))
- features |= ARM_NEON;
+ features |= Q_UINT64_C(1) << CpuFeatureNEON;
# endif
#elif defined(_X86_)
if (IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE))
- features |= SSE2;
+ features |= Q_UINT64_C(1) << CpuFeatureSSE2;
if (IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE))
- features |= SSE3;
+ features |= Q_UINT64_C(1) << CpuFeatureSSE3;
#endif
return features;
}
#elif defined(Q_PROCESSOR_ARM)
-static inline uint detectProcessorFeatures()
+static inline quint64 detectProcessorFeatures()
{
- uint features = 0;
+ quint64 features = 0;
#if defined(Q_OS_LINUX)
int auxv = qt_safe_open("/proc/self/auxv", O_RDONLY);
@@ -115,7 +117,7 @@ static inline uint detectProcessorFeatures()
for (int i = 0; i < max; i += 2)
if (vector[i] == AT_HWCAP) {
if (vector[i+1] & HWCAP_NEON)
- features |= NEON;
+ features |= Q_UINT64_C(1) << CpuFeatureNEON;
break;
}
}
@@ -127,7 +129,7 @@ static inline uint detectProcessorFeatures()
#endif
#if defined(__ARM_NEON__)
- features = NEON;
+ features = Q_UINT64_C(1) << CpuFeatureNEON;
#endif
return features;
@@ -203,21 +205,24 @@ static void cpuidFeatures01(uint &ecx, uint &edx)
inline void __cpuidex(int info[4], int, __int64) { memset(info, 0, 4*sizeof(int));}
#endif
-static void cpuidFeatures07_00(uint &ebx)
+static void cpuidFeatures07_00(uint &ebx, uint &ecx)
{
#if defined(Q_CC_GNU)
qregisteruint rbx; // in case it's 64-bit
+ qregisteruint rcx = 0;
asm ("xchg " PICreg", %0\n"
"cpuid\n"
"xchg " PICreg", %0\n"
- : "=&r" (rbx)
- : "a" (7), "c" (0)
+ : "=&r" (rbx), "+&c" (rcx)
+ : "a" (7)
: "%edx");
ebx = rbx;
+ ecx = rcx;
#elif defined(Q_OS_WIN)
int info[4];
__cpuidex(info, 7, 0);
ebx = info[1];
+ ecx = info[2];
#endif
}
@@ -238,7 +243,7 @@ static void xgetbv(uint in, uint &eax, uint &edx)
#endif
}
-static inline uint detectProcessorFeatures()
+static quint64 detectProcessorFeatures()
{
// Flags from the CR0 / XCR0 state register
enum XCR0Flags {
@@ -255,8 +260,15 @@ static inline uint detectProcessorFeatures()
AVXState = XMM0_15 | YMM0_15Hi128,
AVX512State = AVXState | OpMask | ZMM0_15Hi256 | ZMM16_31
};
-
- uint features = 0;
+ static const quint64 AllAVX512 = (Q_UINT64_C(1) << CpuFeatureAVX512F) | (Q_UINT64_C(1) << CpuFeatureAVX512CD) |
+ (Q_UINT64_C(1) << CpuFeatureAVX512ER) | (Q_UINT64_C(1) << CpuFeatureAVX512PF) |
+ (Q_UINT64_C(1) << CpuFeatureAVX512BW) | (Q_UINT64_C(1) << CpuFeatureAVX512DQ) |
+ (Q_UINT64_C(1) << CpuFeatureAVX512VL) |
+ (Q_UINT64_C(1) << CpuFeatureAVX512IFMA) | (Q_UINT64_C(1) << CpuFeatureAVX512VBMI);
+ static const quint64 AllAVX2 = (Q_UINT64_C(1) << CpuFeatureAVX2) | AllAVX512;
+ static const quint64 AllAVX = (Q_UINT64_C(1) << CpuFeatureAVX) | AllAVX2;
+
+ quint64 features = 0;
int cpuidLevel = maxBasicCpuidSupported();
#if Q_PROCESSOR_X86 < 5
if (cpuidLevel < 1)
@@ -267,28 +279,23 @@ static inline uint detectProcessorFeatures()
uint cpuid01ECX = 0, cpuid01EDX = 0;
cpuidFeatures01(cpuid01ECX, cpuid01EDX);
+
+ // the low 32-bits of features is cpuid01ECX
+ // note: we need to check OS support for saving the AVX register state
+ features = cpuid01ECX;
+
#if defined(Q_PROCESSOR_X86_32)
// x86 might not have SSE2 support
if (cpuid01EDX & (1u << 26))
- features |= SSE2;
+ features |= Q_UINT64_C(1) << CpuFeatureSSE2;
+ else
+ features &= ~(Q_UINT64_C(1) << CpuFeatureSSE2);
// we should verify that the OS enabled saving of the SSE state...
#else
// x86-64 or x32
- features = SSE2;
+ features |= Q_UINT64_C(1) << CpuFeatureSSE2;
#endif
- // common part between 32- and 64-bit
- if (cpuid01ECX & (1u))
- features |= SSE3;
- if (cpuid01ECX & (1u << 9))
- features |= SSSE3;
- if (cpuid01ECX & (1u << 19))
- features |= SSE4_1;
- if (cpuid01ECX & (1u << 20))
- features |= SSE4_2;
- if (cpuid01ECX & (1u << 25))
- features |= 0; // AES, enable if needed
-
uint xgetbvA = 0, xgetbvD = 0;
if (cpuid01ECX & (1u << 27)) {
// XGETBV enabled
@@ -296,22 +303,27 @@ static inline uint detectProcessorFeatures()
}
uint cpuid0700EBX = 0;
- if (cpuidLevel >= 7)
- cpuidFeatures07_00(cpuid0700EBX);
-
- if ((xgetbvA & AVXState) == AVXState) {
- // support for YMM and XMM registers is enabled
- if (cpuid01ECX & (1u << 28))
- features |= AVX;
+ uint cpuid0700ECX = 0;
+ if (cpuidLevel >= 7) {
+ cpuidFeatures07_00(cpuid0700EBX, cpuid0700ECX);
- if (cpuid0700EBX & (1u << 5))
- features |= AVX2;
+ // the high 32-bits of features is cpuid0700EBX
+ features |= quint64(cpuid0700EBX) << 32;
}
- if (cpuid0700EBX & (1u << 4))
- features |= HLE; // Hardware Lock Ellision
- if (cpuid0700EBX & (1u << 11))
- features |= RTM; // Restricted Transactional Memory
+ if ((xgetbvA & AVXState) != AVXState) {
+ // support for YMM registers is disabled, disable all AVX
+ features &= ~AllAVX;
+ } else if ((xgetbvA & AVX512State) != AVX512State) {
+ // support for ZMM registers or mask registers is disabled, disable all AVX512
+ features &= ~AllAVX512;
+ } else {
+ // this feature is out of order
+ if (cpuid0700ECX & (1u << 1))
+ features |= Q_UINT64_C(1) << CpuFeatureAVX512VBMI;
+ else
+ features &= ~(Q_UINT64_C(1) << CpuFeatureAVX512VBMI);
+ }
return features;
}
@@ -428,24 +440,24 @@ static bool procCpuinfoContains(const char *prefix, const char *string)
}
#endif
-static inline uint detectProcessorFeatures()
+static inline quint64 detectProcessorFeatures()
{
// NOTE: MIPS 74K cores are the only ones supporting DSPr2.
- uint flags = 0;
+ quint64 flags = 0;
#if defined __mips_dsp
- flags |= DSP;
+ flags |= Q_UINT64_C(1) << CpuFeatureDSP;
# if defined __mips_dsp_rev && __mips_dsp_rev >= 2
- flags |= DSPR2;
+ flags |= Q_UINT64_C(1) << CpuFeatureDSPR2;
# elif defined(Q_OS_LINUX)
if (procCpuinfoContains("cpu model", "MIPS 74Kc") || procCpuinfoContains("cpu model", "MIPS 74Kf"))
- flags |= DSPR2;
+ flags |= Q_UINT64_C(1) << CpuFeatureDSPR2;
# endif
#elif defined(Q_OS_LINUX)
if (procCpuinfoContains("ASEs implemented", "dsp")) {
- flags |= DSP;
+ flags |= Q_UINT64_C(1) << CpuFeatureDSP;
if (procCpuinfoContains("cpu model", "MIPS 74Kc") || procCpuinfoContains("cpu model", "MIPS 74Kf"))
- flags |= DSPR2;
+ flags |= Q_UINT64_C(1) << CpuFeatureDSPR2;
}
#endif
@@ -460,70 +472,179 @@ static inline uint detectProcessorFeatures()
#endif
/*
- * Use kdesdk/scripts/generate_string_table.pl to update the table below.
- * Here's the data (don't forget the ONE leading space):
+ * Use kdesdk/scripts/generate_string_table.pl to update the table below. Note
+ * that the x86 version has a lot of blanks that must be kept and that the
+ * offset table's type is changed to make the table smaller. We also remove the
+ * terminating -1 that the script adds.
+ */
+// begin generated
+#if defined(Q_PROCESSOR_ARM)
+/* Data:
neon
- sse2
+ */
+static const char features_string[] = " neon\0";
+static const int features_indices[] = { 0 };
+#elif defined(Q_PROCESSOR_MIPS)
+/* Data:
+ dsp
+ dspr2
+*/
+static const char features_string[] =
+ " dsp\0"
+ " dspr2\0"
+ "\0";
+
+static const int features_indices[] = {
+ 0, 5
+};
+#elif defined(Q_PROCESSOR_X86)
+/* Data:
sse3
+ sse2
+ avx512vbmi
+
+
+
+
+
+
ssse3
+
+
+ fma
+ cmpxchg16b
+
+
+
+
+
sse4.1
sse4.2
+
+ movbe
+ popcnt
+
+ aes
+
+
avx
- avx2
+ f16c
+ rdrand
+
+
+
+
+ bmi
hle
+ avx2
+
+
+ bmi2
+
+
rtm
- dsp
- dspr2
- */
-// begin generated
+
+
+
+ avx512f
+ avx512dq
+ rdseed
+
+
+ avx512ifma
+
+
+
+
+ avx512pf
+ avx512er
+ avx512cd
+ sha
+ avx512bw
+ avx512vl
+ */
static const char features_string[] =
- "\0"
- " neon\0"
- " sse2\0"
" sse3\0"
+ " sse2\0"
+ " avx512vbmi\0"
" ssse3\0"
+ " fma\0"
+ " cmpxchg16b\0"
" sse4.1\0"
" sse4.2\0"
+ " movbe\0"
+ " popcnt\0"
+ " aes\0"
" avx\0"
- " avx2\0"
+ " f16c\0"
+ " rdrand\0"
+ " bmi\0"
" hle\0"
+ " avx2\0"
+ " bmi2\0"
" rtm\0"
- " dsp\0"
- " dspr2\0"
+ " avx512f\0"
+ " avx512dq\0"
+ " rdseed\0"
+ " avx512ifma\0"
+ " avx512pf\0"
+ " avx512er\0"
+ " avx512cd\0"
+ " sha\0"
+ " avx512bw\0"
+ " avx512vl\0"
"\0";
-static const int features_indices[] = {
- 0, 1, 7, 13, 19, 26, 34, 42,
- 47, 53, 58, 63, 68, -1
+static const quint8 features_indices[] = {
+ 0, 6, 12, 5, 5, 5, 5, 5,
+ 5, 24, 5, 5, 31, 36, 5, 5,
+ 5, 5, 5, 48, 56, 5, 64, 71,
+ 5, 79, 5, 5, 84, 89, 95, 5,
+ 5, 5, 5, 103, 108, 113, 5, 5,
+ 119, 5, 5, 125, 5, 5, 5, 5,
+ 130, 139, 149, 5, 5, 157, 5, 5,
+ 5, 5, 169, 179, 189, 199, 204, 214
};
+#else
+static const char features_string[] = "";
+static const int features_indices[] = { };
+#endif
// end generated
-static const int features_count = (sizeof features_indices - 1) / (sizeof features_indices[0]);
+static const int features_count = (sizeof features_indices) / (sizeof features_indices[0]);
// record what CPU features were enabled by default in this Qt build
-static const uint minFeature = qCompilerCpuFeatures;
+static const quint64 minFeature = qCompilerCpuFeatures;
#ifdef Q_OS_WIN
#if defined(Q_CC_GNU)
-# define ffs __builtin_ffs
+# define ffsll __builtin_ffsll
#else
-int ffs(int i)
+int ffsll(quint64 i)
{
-#ifndef Q_OS_WINCE
+#if defined(Q_OS_WIN64)
unsigned long result;
- return _BitScanForward(&result, i) ? result : 0;
+ return _BitScanForward64(&result, i) ? result : 0;
+#elif !defined(Q_OS_WINCE)
+ unsigned long result;
+ return _BitScanForward(&result, i) ? result :
+ _BitScanForward(&result, i >> 32) ? result + 32 : 0;
#else
return 0;
#endif
}
#endif
-#elif defined(Q_OS_ANDROID)
-# define ffs __builtin_ffs
+#elif defined(Q_OS_ANDROID) || defined(Q_OS_QNX) || defined(Q_OS_OSX) || defined(Q_OS_HAIKU)
+# define ffsll __builtin_ffsll
#endif
-QBasicAtomicInt qt_cpu_features = Q_BASIC_ATOMIC_INITIALIZER(0);
+#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
+Q_CORE_EXPORT QBasicAtomicInteger<quint64> qt_cpu_features[1] = { Q_BASIC_ATOMIC_INITIALIZER(0) };
+#else
+Q_CORE_EXPORT QBasicAtomicInteger<unsigned> qt_cpu_features[2] = { Q_BASIC_ATOMIC_INITIALIZER(0), Q_BASIC_ATOMIC_INITIALIZER(0) };
+#endif
void qDetectCpuFeatures()
{
@@ -545,17 +666,17 @@ void qDetectCpuFeatures()
// contains all the features that the code required. Qt 4 ran for years
// like that, so it shouldn't be a problem.
- qt_cpu_features.store(minFeature | QSimdInitialized);
+ qt_cpu_features.store(minFeature | quint32(QSimdInitialized));
return;
# endif
#endif
- uint f = detectProcessorFeatures();
+ quint64 f = detectProcessorFeatures();
QByteArray disable = qgetenv("QT_NO_CPU_FEATURE");
if (!disable.isEmpty()) {
disable.prepend(' ');
for (int i = 0; i < features_count; ++i) {
if (disable.contains(features_string + features_indices[i]))
- f &= ~(1 << i);
+ f &= ~(Q_UINT64_C(1) << i);
}
}
@@ -565,29 +686,32 @@ void qDetectCpuFeatures()
bool runningOnValgrind = false;
#endif
if (!runningOnValgrind && (minFeature != 0 && (f & minFeature) != minFeature)) {
- uint missing = minFeature & ~f;
+ quint64 missing = minFeature & ~f;
fprintf(stderr, "Incompatible processor. This Qt build requires the following features:\n ");
for (int i = 0; i < features_count; ++i) {
- if (missing & (1 << i))
+ if (missing & (Q_UINT64_C(1) << i))
fprintf(stderr, "%s", features_string + features_indices[i]);
}
fprintf(stderr, "\n");
fflush(stderr);
- qFatal("Aborted. Incompatible processor: missing feature 0x%x -%s.", missing,
- features_string + features_indices[ffs(missing) - 1]);
+ qFatal("Aborted. Incompatible processor: missing feature 0x%llx -%s.", missing,
+ features_string + features_indices[ffsll(missing) - 1]);
}
- qt_cpu_features.store(f | QSimdInitialized);
+ qt_cpu_features[0].store(f | quint32(QSimdInitialized));
+#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
+ qt_cpu_features[1].store(f >> 32);
+#endif
}
void qDumpCPUFeatures()
{
- uint features = qCpuFeatures();
+ quint64 features = qCpuFeatures() & ~quint64(QSimdInitialized);
printf("Processor features: ");
for (int i = 0; i < features_count; ++i) {
- if (features & (1 << i))
+ if (features & (Q_UINT64_C(1) << i))
printf("%s%s", features_string + features_indices[i],
- minFeature & (1 << i) ? "[required]" : "");
+ minFeature & (Q_UINT64_C(1) << i) ? "[required]" : "");
}
puts("");
}
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index dd93b4fd26..12a329f36c 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -149,7 +149,7 @@
# define QT_FUNCTION_TARGET(x)
# endif
#else
-# define QT_COMPILER_SUPPORTS_HERE(x) defined(__ ## x ## __)
+# define QT_COMPILER_SUPPORTS_HERE(x) (__ ## x ## __)
# define QT_FUNCTION_TARGET(x)
#endif
@@ -217,6 +217,23 @@
# endif
#endif
+#define QT_FUNCTION_TARGET_STRING_AVX512F "avx512f"
+#define QT_FUNCTION_TARGET_STRING_AVX512CD "avx512cd"
+#define QT_FUNCTION_TARGET_STRING_AVX512ER "avx512er"
+#define QT_FUNCTION_TARGET_STRING_AVX512PF "avx512pf"
+#define QT_FUNCTION_TARGET_STRING_AVX512BW "avx512bw"
+#define QT_FUNCTION_TARGET_STRING_AVX512DQ "avx512dq"
+#define QT_FUNCTION_TARGET_STRING_AVX512VL "avx512vl"
+#define QT_FUNCTION_TARGET_STRING_AVX512IFMA "avx512ifma"
+#define QT_FUNCTION_TARGET_STRING_AVX512VBMI "avx512vbmi"
+
+#define QT_FUNCTION_TARGET_STRING_F16C "f16c"
+#define QT_FUNCTION_TARGET_STRING_RDRAND "rdrnd"
+#define QT_FUNCTION_TARGET_STRING_BMI "bmi"
+#define QT_FUNCTION_TARGET_STRING_BMI2 "bmi2"
+#define QT_FUNCTION_TARGET_STRING_RDSEED "rdseed"
+#define QT_FUNCTION_TARGET_STRING_SHA "sha"
+
// other x86 intrinsics
#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (Q_CC_GNU >= 404)) \
|| (defined(Q_CC_CLANG) && (Q_CC_CLANG >= 208)) \
@@ -233,9 +250,13 @@
// NEON intrinsics
// note: as of GCC 4.9, does not support function targets for ARM
-#if defined __ARM_NEON__
+#if defined(__ARM_NEON) || defined(__ARM_NEON__)
#include <arm_neon.h>
#define QT_FUNCTION_TARGET_STRING_ARM_NEON "neon"
+#ifndef __ARM_NEON__
+// __ARM_NEON__ is not defined on AArch64, but we need it in our NEON detection.
+#define __ARM_NEON__
+#endif
#endif
#undef QT_COMPILER_SUPPORTS_SIMD_ALWAYS
@@ -244,74 +265,170 @@ QT_BEGIN_NAMESPACE
enum CPUFeatures {
- NEON = 0x2, ARM_NEON = NEON,
- SSE2 = 0x4,
- SSE3 = 0x8,
- SSSE3 = 0x10,
- SSE4_1 = 0x20,
- SSE4_2 = 0x40,
- AVX = 0x80,
- AVX2 = 0x100,
- HLE = 0x200,
- RTM = 0x400,
- DSP = 0x800,
- DSPR2 = 0x1000,
+#if defined(Q_PROCESSOR_ARM)
+ CpuFeatureNEON = 0,
+ CpuFeatureARM_NEON = CpuFeatureNEON,
+#elif defined(Q_PROCESSOR_MIPS)
+ CpuFeatureDSP = 0,
+ CpuFeatureDSPR2 = 1,
+#elif defined(Q_PROCESSOR_X86)
+ // The order of the flags is jumbled so it matches most closely the bits in CPUID
+ // Out of order:
+ CpuFeatureSSE2 = 1, // uses the bit for PCLMULQDQ
+ // in level 1, ECX
+ CpuFeatureSSE3 = (0 + 0),
+ CpuFeatureSSSE3 = (0 + 9),
+ CpuFeatureSSE4_1 = (0 + 19),
+ CpuFeatureSSE4_2 = (0 + 20),
+ CpuFeatureMOVBE = (0 + 22),
+ CpuFeaturePOPCNT = (0 + 23),
+ CpuFeatureAES = (0 + 25),
+ CpuFeatureAVX = (0 + 28),
+ CpuFeatureF16C = (0 + 29),
+ CpuFeatureRDRAND = (0 + 30),
+ // 31 is always zero and we've used it for the QSimdInitialized
+
+ // in level 7, leaf 0, EBX
+ CpuFeatureBMI = (32 + 3),
+ CpuFeatureHLE = (32 + 4),
+ CpuFeatureAVX2 = (32 + 5),
+ CpuFeatureBMI2 = (32 + 8),
+ CpuFeatureRTM = (32 + 11),
+ CpuFeatureAVX512F = (32 + 16),
+ CpuFeatureAVX512DQ = (32 + 17),
+ CpuFeatureRDSEED = (32 + 18),
+ CpuFeatureAVX512IFMA = (32 + 21),
+ CpuFeatureAVX512PF = (32 + 26),
+ CpuFeatureAVX512ER = (32 + 27),
+ CpuFeatureAVX512CD = (32 + 28),
+ CpuFeatureSHA = (32 + 29),
+ CpuFeatureAVX512BW = (32 + 30),
+ CpuFeatureAVX512VL = (32 + 31),
+
+ // in level 7, leaf 0, ECX (out of order, for now)
+ CpuFeatureAVX512VBMI = 2, // uses the bit for DTES64
+#endif
// used only to indicate that the CPU detection was initialised
QSimdInitialized = 0x80000000
};
-static const uint qCompilerCpuFeatures = 0
+static const quint64 qCompilerCpuFeatures = 0
+#if defined __SHA__
+ | (Q_UINT64_C(1) << CpuFeatureSHA)
+#endif
+#if defined __AES__
+ | (Q_UINT64_C(1) << CpuFeatureAES)
+#endif
#if defined __RTM__
- | RTM
+ | (Q_UINT64_C(1) << CpuFeatureRTM)
+#endif
+#ifdef __RDRND__
+ | (Q_UINT64_C(1) << CpuFeatureRDRAND)
+#endif
+#ifdef __RDSEED__
+ | (Q_UINT64_C(1) << CpuFeatureRDSEED)
+#endif
+#if defined __BMI__
+ | (Q_UINT64_C(1) << CpuFeatureBMI)
+#endif
+#if defined __BMI2__
+ | (Q_UINT64_C(1) << CpuFeatureBMI2)
+#endif
+#if defined __F16C__
+ | (Q_UINT64_C(1) << CpuFeatureF16C)
+#endif
+#if defined __POPCNT__
+ | (Q_UINT64_C(1) << CpuFeaturePOPCNT)
+#endif
+#if defined __MOVBE__ // GCC and Clang don't seem to define this
+ | (Q_UINT64_C(1) << CpuFeatureMOVBE)
+#endif
+#if defined __AVX512F__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512F)
+#endif
+#if defined __AVX512CD__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512CD)
+#endif
+#if defined __AVX512ER__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512ER)
+#endif
+#if defined __AVX512PF__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512PF)
+#endif
+#if defined __AVX512BW__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512BW)
+#endif
+#if defined __AVX512DQ__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512DQ)
+#endif
+#if defined __AVX512VL__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512VL)
+#endif
+#if defined __AVX512IFMA__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512IFMA)
+#endif
+#if defined __AVX512VBMI__
+ | (Q_UINT64_C(1) << CpuFeatureAVX512VBMI)
#endif
#if defined __AVX2__
- | AVX2
+ | (Q_UINT64_C(1) << CpuFeatureAVX2)
#endif
#if defined __AVX__
- | AVX
+ | (Q_UINT64_C(1) << CpuFeatureAVX)
#endif
#if defined __SSE4_2__
- | SSE4_2
+ | (Q_UINT64_C(1) << CpuFeatureSSE4_2)
#endif
#if defined __SSE4_1__
- | SSE4_1
+ | (Q_UINT64_C(1) << CpuFeatureSSE4_1)
#endif
#if defined __SSSE3__
- | SSSE3
+ | (Q_UINT64_C(1) << CpuFeatureSSSE3)
#endif
#if defined __SSE3__
- | SSE3
+ | (Q_UINT64_C(1) << CpuFeatureSSE3)
#endif
#if defined __SSE2__
- | SSE2
+ | (Q_UINT64_C(1) << CpuFeatureSSE2)
#endif
#if defined __ARM_NEON__
- | NEON
+ | (Q_UINT64_C(1) << CpuFeatureNEON)
#endif
#if defined __mips_dsp
- | DSP
+ | (Q_UINT64_C(1) << CpuFeatureDSP)
#endif
#if defined __mips_dspr2
- | DSPR2
+ | (Q_UINT64_C(1) << CpuFeatureDSPR2)
#endif
;
-extern Q_CORE_EXPORT QBasicAtomicInt qt_cpu_features;
+#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
+extern Q_CORE_EXPORT QBasicAtomicInteger<quint64> qt_cpu_features[1];
+#else
+extern Q_CORE_EXPORT QBasicAtomicInteger<unsigned> qt_cpu_features[2];
+#endif
Q_CORE_EXPORT void qDetectCpuFeatures();
-static inline uint qCpuFeatures()
+static inline quint64 qCpuFeatures()
{
- int features = qt_cpu_features.load();
+ quint64 features = qt_cpu_features[0].load();
+#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
+ features |= quint64(qt_cpu_features[1].load()) << 32;
+#endif
if (Q_UNLIKELY(features == 0)) {
qDetectCpuFeatures();
- features = qt_cpu_features.load();
+ features = qt_cpu_features[0].load();
+#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
+ features |= quint64(qt_cpu_features[1].load()) << 32;
+#endif
Q_ASSUME(features != 0);
}
- return uint(features);
+ return features;
}
-#define qCpuHasFeature(feature) ((qCompilerCpuFeatures & (feature)) || (qCpuFeatures() & (feature)))
+#define qCpuHasFeature(feature) ((qCompilerCpuFeatures & (Q_UINT64_C(1) << CpuFeature ## feature)) \
+ || (qCpuFeatures() & (Q_UINT64_C(1) << CpuFeature ## feature)))
#ifdef Q_PROCESSOR_X86
// Bit scan functions for x86
diff --git a/src/corelib/tools/qstack.cpp b/src/corelib/tools/qstack.cpp
index e367622c0d..224f72926b 100644
--- a/src/corelib/tools/qstack.cpp
+++ b/src/corelib/tools/qstack.cpp
@@ -71,19 +71,6 @@
*/
/*!
- \fn QStack::QStack()
-
- Constructs an empty stack.
-*/
-
-/*!
- \fn QStack::~QStack()
-
- Destroys the stack. References to the values in the stack, and all
- iterators over this stack, become invalid.
-*/
-
-/*!
\fn void QStack::swap(QStack<T> &other)
\since 4.8
diff --git a/src/corelib/tools/qstack.h b/src/corelib/tools/qstack.h
index fa05e22de1..cb72316c32 100644
--- a/src/corelib/tools/qstack.h
+++ b/src/corelib/tools/qstack.h
@@ -43,9 +43,8 @@ template<class T>
class QStack : public QVector<T>
{
public:
- inline QStack() {}
- inline ~QStack() {}
- inline void swap(QStack<T> &other) { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
+ // compiler-generated special member functions are fine!
+ inline void swap(QStack<T> &other) Q_DECL_NOTHROW { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
inline void push(const T &t) { QVector<T>::append(t); }
T pop();
T &top();
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index b623c62043..89d9889b2f 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -50,7 +50,6 @@
#include "qstringmatcher.h"
#include "qvarlengtharray.h"
#include "qtools_p.h"
-#include "qhash.h"
#include "qdebug.h"
#include "qendian.h"
#include "qcollator.h"
@@ -204,7 +203,7 @@ inline RetType UnrollTailLoop<0>::exec(int, RetType returnIfExited, Functor1, Fu
#endif
// conversion between Latin 1 and UTF-16
-void qt_from_latin1(ushort *dst, const char *str, size_t size)
+void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW
{
/* SIMD:
* Unpacking with SSE has been shown to improve performance on recent CPUs
@@ -1201,6 +1200,22 @@ const QString::Null QString::null = { };
\sa QString::const_iterator
*/
+/*! \typedef QString::const_reverse_iterator
+ \since 5.6
+
+ This typedef provides an STL-style const reverse iterator for QString.
+
+ \sa QString::reverse_iterator, QString::const_iterator
+*/
+
+/*! \typedef QString::reverse_iterator
+ \since 5.6
+
+ This typedef provides an STL-style non-const reverse iterator for QString.
+
+ \sa QString::const_reverse_iterator, QString::iterator
+*/
+
/*!
\typedef QString::size_type
@@ -1304,6 +1319,52 @@ const QString::Null QString::null = { };
\sa constBegin(), end()
*/
+/*! \fn QString::reverse_iterator QString::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ character in the string, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QString::const_reverse_iterator QString::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QString::const_reverse_iterator QString::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ character in the string, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QString::reverse_iterator QString::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last character in the string, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QString::const_reverse_iterator QString::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QString::const_reverse_iterator QString::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last character in the string, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*!
\fn QString::QString()
@@ -1448,7 +1509,7 @@ QString::QString(const QChar *unicode, int size)
} else {
if (size < 0) {
size = 0;
- while (unicode[size] != 0)
+ while (!unicode[size].isNull())
++size;
}
if (!size) {
@@ -1615,20 +1676,11 @@ void QString::resize(int size)
return;
}
- if (size == 0 && !d->capacityReserved) {
- Data *x = Data::allocate(0);
- if (!d->ref.deref())
- Data::deallocate(d);
- d = x;
- } else {
- if (d->ref.isShared() || uint(size) + 1u > d->alloc
- || (!d->capacityReserved && size < d->size
- && uint(size) + 1u < uint(d->alloc >> 1)))
- reallocData(uint(size) + 1u, true);
- if (d->alloc) {
- d->size = size;
- d->data()[size] = '\0';
- }
+ if (d->ref.isShared() || uint(size) + 1u > d->alloc)
+ reallocData(uint(size) + 1u, true);
+ if (d->alloc) {
+ d->size = size;
+ d->data()[size] = '\0';
}
}
@@ -1757,6 +1809,17 @@ QString &QString::operator=(const QString &other) Q_DECL_NOTHROW
Assigns the Latin-1 string \a str to this string.
*/
+QString &QString::operator=(QLatin1String other)
+{
+ if (isDetached() && other.size() <= capacity()) { // assumes d->alloc == 0 → !isDetached() (sharedNull)
+ d->size = other.size();
+ d->data()[other.size()] = 0;
+ qt_from_latin1(d->data(), other.latin1(), other.size());
+ } else {
+ *this = fromLatin1(other.latin1(), other.size());
+ }
+ return *this;
+}
/*! \fn QString &QString::operator=(const QByteArray &ba)
@@ -1807,7 +1870,16 @@ QString &QString::operator=(const QString &other) Q_DECL_NOTHROW
*/
QString &QString::operator=(QChar ch)
{
- return operator=(QString(ch));
+ if (isDetached() && capacity() >= 1) { // assumes d->alloc == 0 → !isDetached() (sharedNull)
+ // re-use existing capacity:
+ ushort *dat = d->data();
+ dat[0] = ch.unicode();
+ dat[1] = 0;
+ d->size = 1;
+ } else {
+ operator=(QString(ch));
+ }
+ return *this;
}
/*!
@@ -1828,6 +1900,51 @@ QString &QString::operator=(QChar ch)
/*!
+ \fn QString& QString::insert(int position, const QStringRef &str)
+ \since 5.5
+ \overload insert()
+
+ Inserts the string reference \a str at the given index \a position and
+ returns a reference to this string.
+
+ If the given \a position is greater than size(), the array is
+ first extended using resize().
+*/
+
+
+/*!
+ \fn QString& QString::insert(int position, const char *str)
+ \since 5.5
+ \overload insert()
+
+ Inserts the C string \a str at the given index \a position and
+ returns a reference to this string.
+
+ If the given \a position is greater than size(), the array is
+ first extended using resize().
+
+ This function is not available when QT_NO_CAST_FROM_ASCII is
+ defined.
+*/
+
+
+/*!
+ \fn QString& QString::insert(int position, const QByteArray &str)
+ \since 5.5
+ \overload insert()
+
+ Inserts the byte array \a str at the given index \a position and
+ returns a reference to this string.
+
+ If the given \a position is greater than size(), the array is
+ first extended using resize().
+
+ This function is not available when QT_NO_CAST_FROM_ASCII is
+ defined.
+*/
+
+
+/*!
\fn QString &QString::insert(int position, QLatin1String str)
\overload insert()
@@ -2027,6 +2144,22 @@ QString &QString::append(QChar ch)
Prepends the Latin-1 string \a str to this string.
*/
+/*! \fn QString &QString::prepend(const QChar *str, int len)
+ \since 5.5
+ \overload prepend()
+
+ Prepends \a len characters from the QChar array \a str to this string and
+ returns a reference to this string.
+*/
+
+/*! \fn QString &QString::prepend(const QStringRef &str)
+ \since 5.5
+ \overload prepend()
+
+ Prepends the string reference \a str to the beginning of this string and
+ returns a reference to this string.
+*/
+
/*! \fn QString &QString::prepend(const QByteArray &ba)
\overload prepend()
@@ -2558,6 +2691,8 @@ bool operator==(const QString &s1, const QString &s2)
/*!
\overload operator==()
+ Returns \c true if this string is equal to \a other; otherwise
+ returns \c false.
*/
bool QString::operator==(QLatin1String other) const
{
@@ -2616,7 +2751,7 @@ bool operator<(const QString &s1, const QString &s2)
}
/*!
\overload operator<()
- \relates QString
+
Returns \c true if this string is lexically less than the parameter
string called \a other; otherwise returns \c false.
*/
@@ -2659,9 +2794,9 @@ bool QString::operator<(QLatin1String other) const
go through QObject::tr(), for example.
*/
-/*! \fn bool QString::operator<=(const QString &s1, const QString &s2)
+/*! \fn bool operator<=(const QString &s1, const QString &s2)
- \relates Qstring
+ \relates QString
Returns \c true if string \a s1 is lexically less than or equal to
string \a s2; otherwise returns \c false.
@@ -2707,7 +2842,7 @@ bool QString::operator<(QLatin1String other) const
go through QObject::tr(), for example.
*/
-/*! \fn bool QString::operator>(const QString &s1, const QString &s2)
+/*! \fn bool operator>(const QString &s1, const QString &s2)
\relates QString
Returns \c true if string \a s1 is lexically greater than string \a s2;
@@ -2721,7 +2856,7 @@ bool QString::operator<(QLatin1String other) const
/*!
\overload operator>()
- \relates QString
+
Returns \c true if this string is lexically greater than the parameter
string \a other; otherwise returns \c false.
*/
@@ -3184,6 +3319,7 @@ struct QStringCapture
int len;
int no;
};
+Q_DECLARE_TYPEINFO(QStringCapture, Q_PRIMITIVE_TYPE);
#endif
#ifndef QT_NO_REGEXP
@@ -3491,9 +3627,14 @@ int QString::count(const QString &str, Qt::CaseSensitivity cs) const
}
/*!
- \overload count()
+ \overload count()
+
+ Returns the number of occurrences of character \a ch in the string.
+
+ If \a cs is Qt::CaseSensitive (default), the search is
+ case sensitive; otherwise the search is case insensitive.
- Returns the number of occurrences of character \a ch in the string.
+ \sa contains(), indexOf()
*/
int QString::count(QChar ch, Qt::CaseSensitivity cs) const
@@ -3716,7 +3857,7 @@ int QString::indexOf(const QRegularExpression& re, int from) const
Example:
- \snippet qstring/main.cpp 97
+ \snippet qstring/main.cpp 99
*/
int QString::indexOf(const QRegularExpression &re, int from, QRegularExpressionMatch *rmatch) const
{
@@ -3767,7 +3908,7 @@ int QString::lastIndexOf(const QRegularExpression &re, int from) const
Example:
- \snippet qstring/main.cpp 98
+ \snippet qstring/main.cpp 100
*/
int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpressionMatch *rmatch) const
{
@@ -3939,10 +4080,9 @@ int QString::count(const QRegularExpression &re) const
QString QString::section(const QString &sep, int start, int end, SectionFlags flags) const
{
- QStringList sections = split(sep, KeepEmptyParts,
- (flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
+ const QVector<QStringRef> sections = splitRef(sep, KeepEmptyParts,
+ (flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
const int sectionsSize = sections.size();
-
if (!(flags & SectionSkipEmpty)) {
if (start < 0)
start += sectionsSize;
@@ -3962,11 +4102,10 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
if (start >= sectionsSize || end < 0 || start > end)
return QString();
- int x = 0;
QString ret;
int first_i = start, last_i = end;
- for (int i = 0; x <= end && i < sectionsSize; ++i) {
- QString section = sections.at(i);
+ for (int x = 0, i = 0; x <= end && i < sectionsSize; ++i) {
+ const QStringRef &section = sections.at(i);
const bool empty = section.isEmpty();
if (x >= start) {
if(x == start)
@@ -3991,9 +4130,9 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
class qt_section_chunk {
public:
qt_section_chunk() {}
- qt_section_chunk(int l, QString s) : length(l), string(qMove(s)) {}
+ qt_section_chunk(int l, QStringRef s) : length(l), string(qMove(s)) {}
int length;
- QString string;
+ QStringRef string;
};
Q_DECLARE_TYPEINFO(qt_section_chunk, Q_MOVABLE_TYPE);
@@ -4086,12 +4225,12 @@ QString QString::section(const QRegExp &reg, int start, int end, SectionFlags fl
QVector<qt_section_chunk> sections;
int n = length(), m = 0, last_m = 0, last_len = 0;
while ((m = sep.indexIn(*this, m)) != -1) {
- sections.append(qt_section_chunk(last_len, QString(uc + last_m, m - last_m)));
+ sections.append(qt_section_chunk(last_len, QStringRef(this, last_m, m - last_m)));
last_m = m;
last_len = sep.matchedLength();
m += qMax(sep.matchedLength(), 1);
}
- sections.append(qt_section_chunk(last_len, QString(uc + last_m, n - last_m)));
+ sections.append(qt_section_chunk(last_len, QStringRef(this, last_m, n - last_m)));
return extractSections(sections, start, end, flags);
}
@@ -4134,11 +4273,11 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti
while (iterator.hasNext()) {
QRegularExpressionMatch match = iterator.next();
m = match.capturedStart();
- sections.append(qt_section_chunk(last_len, QString(uc + last_m, m - last_m)));
+ sections.append(qt_section_chunk(last_len, QStringRef(this, last_m, m - last_m)));
last_m = m;
last_len = match.capturedLength();
}
- sections.append(qt_section_chunk(last_len, QString(uc + last_m, n - last_m)));
+ sections.append(qt_section_chunk(last_len, QStringRef(this, last_m, n - last_m)));
return extractSections(sections, start, end, flags);
}
@@ -4149,8 +4288,8 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti
Returns a substring that contains the \a n leftmost characters
of the string.
- The entire string is returned if \a n is greater than size() or
- less than zero.
+ The entire string is returned if \a n is greater than or equal
+ to size(), or less than zero.
\snippet qstring/main.cpp 31
@@ -4167,8 +4306,8 @@ QString QString::left(int n) const
Returns a substring that contains the \a n rightmost characters
of the string.
- The entire string is returned if \a n is greater than size() or
- less than zero.
+ The entire string is returned if \a n is greater than or equal
+ to size(), or less than zero.
\snippet qstring/main.cpp 48
@@ -4822,7 +4961,7 @@ modifiable reference.
If \a position is negative, it is equivalent to passing zero.
- \sa chop(), resize(), left()
+ \sa chop(), resize(), left(), QStringRef::truncate()
*/
void QString::truncate(int pos)
@@ -4835,7 +4974,8 @@ void QString::truncate(int pos)
/*!
Removes \a n characters from the end of the string.
- If \a n is greater than size(), the result is an empty string.
+ If \a n is greater than or equal to size(), the result is an
+ empty string.
Example:
\snippet qstring/main.cpp 15
@@ -5537,34 +5677,36 @@ QString QString::rightJustified(int width, QChar fill, bool truncate) const
*/
namespace QUnicodeTables {
-struct LowercaseTraits
-{
- static signed short caseDiff(const Properties *prop)
- { return prop->lowerCaseDiff; }
- static bool caseSpecial(const Properties *prop)
- { return prop->lowerCaseSpecial; }
-};
-
-struct UppercaseTraits
-{
- static signed short caseDiff(const Properties *prop)
- { return prop->upperCaseDiff; }
- static bool caseSpecial(const Properties *prop)
- { return prop->upperCaseSpecial; }
-};
+/*
+ \internal
+ Converts the \a str string starting from the position pointed to by the \a
+ it iterator, using the Unicode case traits \c Traits, and returns the
+ result. The input string must not be empty (the convertCase function below
+ guarantees that).
+
+ The string type \c{T} is also a template and is either \c{const QString} or
+ \c{QString}. This function can do both copy-conversion and in-place
+ conversion depending on the state of the \a str parameter:
+ \list
+ \li \c{T} is \c{const QString}: copy-convert
+ \li \c{T} is \c{QString} and its refcount != 1: copy-convert
+ \li \c{T} is \c{QString} and its refcount == 1: in-place convert
+ \endlist
-struct CasefoldTraits
-{
- static signed short caseDiff(const Properties *prop)
- { return prop->caseFoldDiff; }
- static bool caseSpecial(const Properties *prop)
- { return prop->caseFoldSpecial; }
-};
+ In copy-convert mode, the local variable \c{s} is detached from the input
+ \a str. In the in-place convert mode, \a str is in moved-from state (which
+ this function requires to be a valid, empty string) and \c{s} contains the
+ only copy of the string, without reallocation (thus, \a it is still valid).
+ There's one pathological case left: when the in-place conversion needs to
+ reallocate memory to grow the buffer. In that case, we need to adjust the \a
+ it pointer.
+ */
template <typename Traits, typename T>
Q_NEVER_INLINE
static QString detachAndConvertCase(T &str, QStringIterator it)
{
+ Q_ASSERT(!str.isEmpty());
QString s = qMove(str); // will copy if T is const QString
QChar *pp = s.begin() + it.index(); // will detach if necessary
uint uc = it.nextUnchecked();
@@ -5573,12 +5715,19 @@ static QString detachAndConvertCase(T &str, QStringIterator it)
signed short caseDiff = Traits::caseDiff(prop);
if (Q_UNLIKELY(Traits::caseSpecial(prop))) {
- // slow path
+ // slow path: the string is growing
const ushort *specialCase = specialCaseMap + caseDiff;
ushort length = *specialCase++;
- int pos = pp - s.constBegin();
- s.replace(pos, 1, reinterpret_cast<const QChar *>(specialCase), length);
- pp = const_cast<QChar *>(s.constBegin()) + pos + length;
+ int inpos = it.index() - 1;
+ int outpos = pp - s.constBegin();
+
+ s.replace(outpos, 1, reinterpret_cast<const QChar *>(specialCase), length);
+ pp = const_cast<QChar *>(s.constBegin()) + outpos + length;
+
+ // do we need to adjust the input iterator too?
+ // if it is pointing to s's data, str is empty
+ if (str.isEmpty())
+ it = QStringIterator(s.constBegin(), inpos + length, s.constEnd());
} else if (QChar::requiresSurrogates(uc)) {
*pp++ = QChar::highSurrogate(uc + caseDiff);
*pp++ = QChar::lowSurrogate(uc + caseDiff);
@@ -7622,86 +7771,155 @@ static int getEscape(const QChar *uc, int *pos, int len, int maxNumber = 999)
return -1;
}
+/*
+ Algorithm for multiArg:
+
+ 1. Parse the string as a sequence of verbatim text and placeholders (%L?\d{,3}).
+ The L is parsed and accepted for compatibility with non-multi-arg, but since
+ multiArg only accepts strings as replacements, the localization request can
+ be safely ignored.
+ 2. The result of step (1) is a list of (string-ref,int)-tuples. The string-ref
+ either points at text to be copied verbatim (in which case the int is -1),
+ or, initially, at the textual representation of the placeholder. In that case,
+ the int contains the numerical number as parsed from the placeholder.
+ 3. Next, collect all the non-negative ints found, sort them in ascending order and
+ remove duplicates.
+ 3a. If the result has more entires than multiArg() was given replacement strings,
+ we have found placeholders we can't satisfy with replacement strings. That is
+ fine (there could be another .arg() call coming after this one), so just
+ truncate the result to the number of actual multiArg() replacement strings.
+ 3b. If the result has less entries than multiArg() was given replacement strings,
+ the string is missing placeholders. This is an error that the user should be
+ warned about.
+ 4. The result of step (3) is a mapping from the index of any replacement string to
+ placeholder number. This is the wrong way around, but since placeholder
+ numbers could get as large as 999, while we typically don't have more than 9
+ replacement strings, we trade 4K of sparsely-used memory for doing a reverse lookup
+ each time we need to map a placeholder number to a replacement string index
+ (that's a linear search; but still *much* faster than using an associative container).
+ 5. Next, for each of the tuples found in step (1), do the following:
+ 5a. If the int is negative, do nothing.
+ 5b. Otherwise, if the int is found in the result of step (3) at index I, replace
+ the string-ref with a string-ref for the (complete) I'th replacement string.
+ 5c. Otherwise, do nothing.
+ 6. Concatenate all string refs into a single result string.
+*/
+
namespace {
-class ArgMapper {
- QVarLengthArray<int, 16> argPosToNumberMap; // maps from argument position to number
-public:
- void found(int n) { argPosToNumberMap.push_back(n); }
+struct Part
+{
+ Part() : stringRef(), number(0) {}
+ Part(const QString &s, int pos, int len, int num = -1) Q_DECL_NOTHROW
+ : stringRef(&s, pos, len), number(num) {}
- struct AssignmentResult {
- int numArgs;
- int lastNumber;
- };
+ QStringRef stringRef;
+ int number;
+};
+} // unnamed namespace
- AssignmentResult assignArgumentNumberToEachOfTheNs(int numArgs)
- {
- std::sort(argPosToNumberMap.begin(), argPosToNumberMap.end());
- argPosToNumberMap.erase(std::unique(argPosToNumberMap.begin(), argPosToNumberMap.end()),
- argPosToNumberMap.end());
+template <>
+class QTypeInfo<Part> : public QTypeInfoMerger<Part, QStringRef, int> {}; // Q_DECLARE_METATYPE
- if (argPosToNumberMap.size() > numArgs)
- argPosToNumberMap.resize(numArgs);
- int lastNumber = argPosToNumberMap.empty() ? -1 : argPosToNumberMap.back();
- int arg = argPosToNumberMap.size();
+namespace {
- const AssignmentResult result = {arg, lastNumber};
- return result;
- }
+enum { ExpectedParts = 32 };
- int numberToArgsIndex(int number) const
- {
- if (number != -1) {
- const int * const it = std::find(argPosToNumberMap.begin(), argPosToNumberMap.end(), number);
- return it == argPosToNumberMap.end() ? -1 : it - argPosToNumberMap.begin();
- } else {
- return -1;
- }
- }
-};
-} // unnamed namespace
+typedef QVarLengthArray<Part, ExpectedParts> ParseResult;
+typedef QVarLengthArray<int, ExpectedParts/2> ArgIndexToPlaceholderMap;
-QString QString::multiArg(int numArgs, const QString **args) const
+static ParseResult parseMultiArgFormatString(const QString &s)
{
- QString result;
- ArgMapper mapper;
- const QChar *uc = (const QChar *) d->data();
- const int len = d->size;
+ ParseResult result;
+
+ const QChar *uc = s.constData();
+ const int len = s.size();
const int end = len - 1;
int i = 0;
+ int last = 0;
- // populate the arg-mapper with the %n's that actually occur in the string
while (i < end) {
if (uc[i] == QLatin1Char('%')) {
+ int percent = i;
int number = getEscape(uc, &i, len);
if (number != -1) {
- mapper.found(number);
+ if (last != percent)
+ result.push_back(Part(s, last, percent - last)); // literal text (incl. failed placeholders)
+ result.push_back(Part(s, percent, i - percent, number)); // parsed placeholder
+ last = i;
continue;
}
}
++i;
}
- const ArgMapper::AssignmentResult r = mapper.assignArgumentNumberToEachOfTheNs(numArgs);
+ if (last < len)
+ result.push_back(Part(s, last, len - last)); // trailing literal text
+
+ return result;
+}
+
+static ArgIndexToPlaceholderMap makeArgIndexToPlaceholderMap(const ParseResult &parts)
+{
+ ArgIndexToPlaceholderMap result;
- // sanity
- if (numArgs > r.numArgs) {
- qWarning("QString::arg: %d argument(s) missing in %s", numArgs - r.numArgs, toLocal8Bit().data());
- numArgs = r.numArgs;
+ for (ParseResult::const_iterator it = parts.begin(), end = parts.end(); it != end; ++it) {
+ if (it->number >= 0)
+ result.push_back(it->number);
}
- i = 0;
- while (i < len) {
- if (uc[i] == QLatin1Char('%') && i != end) {
- int number = getEscape(uc, &i, len, r.lastNumber);
- int arg = mapper.numberToArgsIndex(number);
- if (number != -1 && arg != -1) {
- result += *args[arg];
- continue;
- }
+ std::sort(result.begin(), result.end());
+ result.erase(std::unique(result.begin(), result.end()),
+ result.end());
+
+ return result;
+}
+
+static int resolveStringRefsAndReturnTotalSize(ParseResult &parts, const ArgIndexToPlaceholderMap &argIndexToPlaceholderMap, const QString *args[])
+{
+ int totalSize = 0;
+ for (ParseResult::iterator pit = parts.begin(), end = parts.end(); pit != end; ++pit) {
+ if (pit->number != -1) {
+ const ArgIndexToPlaceholderMap::const_iterator ait
+ = std::find(argIndexToPlaceholderMap.begin(), argIndexToPlaceholderMap.end(), pit->number);
+ if (ait != argIndexToPlaceholderMap.end())
+ pit->stringRef = QStringRef(args[ait - argIndexToPlaceholderMap.begin()]);
+ }
+ totalSize += pit->stringRef.size();
+ }
+ return totalSize;
+}
+
+} // unnamed namespace
+
+QString QString::multiArg(int numArgs, const QString **args) const
+{
+ // Step 1-2 above
+ ParseResult parts = parseMultiArgFormatString(*this);
+
+ // 3-4
+ ArgIndexToPlaceholderMap argIndexToPlaceholderMap = makeArgIndexToPlaceholderMap(parts);
+
+ if (argIndexToPlaceholderMap.size() > numArgs) // 3a
+ argIndexToPlaceholderMap.resize(numArgs);
+ else if (argIndexToPlaceholderMap.size() < numArgs) // 3b
+ qWarning("QString::arg: %d argument(s) missing in %s",
+ numArgs - argIndexToPlaceholderMap.size(), toLocal8Bit().data());
+
+ // 5
+ const int totalSize = resolveStringRefsAndReturnTotalSize(parts, argIndexToPlaceholderMap, args);
+
+ // 6:
+ QString result(totalSize, Qt::Uninitialized);
+ QChar *out = result.data();
+
+ for (ParseResult::const_iterator it = parts.begin(), end = parts.end(); it != end; ++it) {
+ if (const int sz = it->stringRef.size()) {
+ memcpy(out, it->stringRef.constData(), sz * sizeof(QChar));
+ out += sz;
}
- result += uc[i++];
}
+
return result;
}
@@ -8024,14 +8242,25 @@ QString &QString::setRawData(const QChar *unicode, int size)
\snippet code/src_corelib_tools_qstring.cpp 6
+ \note If the function you're calling with a QLatin1String
+ argument isn't actually overloaded to take QLatin1String, the
+ implicit conversion to QString will trigger a memory allocation,
+ which is usually what you want to avoid by using QLatin1String
+ in the first place. In those cases, using QStringLiteral may be
+ the better option.
+
\sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}
*/
+/*! \fn QLatin1String::QLatin1String()
+ \since 5.6
+
+ Constructs a QLatin1String object that stores a nullptr.
+*/
+
/*! \fn QLatin1String::QLatin1String(const char *str)
- Constructs a QLatin1String object that stores \a str. Note that if
- \a str is 0, an empty string is created; this case is handled by
- QString.
+ Constructs a QLatin1String object that stores \a str.
The string data is \e not copied. The caller must be able to
guarantee that \a str will not be deleted or modified as long as
@@ -8043,8 +8272,6 @@ QString &QString::setRawData(const QChar *unicode, int size)
/*! \fn QLatin1String::QLatin1String(const char *str, int size)
Constructs a QLatin1String object that stores \a str with \a size.
- Note that if \a str is 0, an empty string is created; this case
- is handled by QString.
The string data is \e not copied. The caller must be able to
guarantee that \a str will not be deleted or modified as long as
@@ -9125,8 +9352,8 @@ QString &QString::append(const QStringRef &str)
Returns a substring reference to the \a n leftmost characters
of the string.
- If \a n is greater than size() or less than zero, a reference to the entire
- string is returned.
+ 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()
*/
@@ -9143,8 +9370,8 @@ QStringRef QStringRef::left(int n) const
Returns a substring reference to the \a n leftmost characters
of the string.
- If \a n is greater than size() or less than zero, a reference to the entire
- string is returned.
+ If \a n is greater than or equal to size(), or less than zero,
+ a reference to the entire string is returned.
\snippet qstring/main.cpp leftRef
@@ -9164,8 +9391,8 @@ QStringRef QString::leftRef(int n) const
Returns a substring reference to the \a n rightmost characters
of the string.
- If \a n is greater than size() or less than zero, a reference to the entire
- string is returned.
+ 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()
*/
@@ -9182,8 +9409,8 @@ QStringRef QStringRef::right(int n) const
Returns a substring reference to the \a n rightmost characters
of the string.
- If \a n is greater than size() or less than zero, a reference to the entire
- string is returned.
+ If \a n is greater than or equal to size(), or less than zero,
+ a reference to the entire string is returned.
\snippet qstring/main.cpp rightRef
@@ -9268,6 +9495,20 @@ QStringRef QString::midRef(int position, int n) const
}
/*!
+ \fn void QStringRef::truncate(int position)
+ \since 5.6
+
+ Truncates the string at the given \a position index.
+
+ If the specified \a position index is beyond the end of the
+ string, nothing happens.
+
+ If \a position is negative, it is equivalent to passing zero.
+
+ \sa QString::truncate()
+*/
+
+/*!
\since 4.8
Returns the index position of the first occurrence of the string \a
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index d44a5baf2a..1fbcff35d1 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -44,6 +44,7 @@
#include <QtCore/qnamespace.h>
#include <string>
+#include <iterator>
#if defined(Q_OS_ANDROID)
// std::wstring is disabled on android's glibc, as bionic lacks certain features
@@ -82,20 +83,21 @@ template <typename T> class QVector;
class QLatin1String
{
public:
- Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) : m_size(s ? int(strlen(s)) : 0), m_data(s) {}
- Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int sz) : m_size(sz), m_data(s) {}
- inline explicit QLatin1String(const QByteArray &s) : m_size(int(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
-
- inline const char *latin1() const { return m_data; }
- inline int size() const { return m_size; }
- inline const char *data() const { return m_data; }
-
- inline bool operator==(const QString &s) const;
- inline bool operator!=(const QString &s) const;
- inline bool operator>(const QString &s) const;
- inline bool operator<(const QString &s) const;
- inline bool operator>=(const QString &s) const;
- inline bool operator<=(const QString &s) const;
+ 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 inline explicit QLatin1String(const char *s, int sz) Q_DECL_NOTHROW : m_size(sz), m_data(s) {}
+ inline explicit QLatin1String(const QByteArray &s) Q_DECL_NOTHROW : m_size(int(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
+
+ Q_DECL_CONSTEXPR const char *latin1() const Q_DECL_NOTHROW { return m_data; }
+ Q_DECL_CONSTEXPR int size() const Q_DECL_NOTHROW { return m_size; }
+ Q_DECL_CONSTEXPR const char *data() const Q_DECL_NOTHROW { return m_data; }
+
+ inline bool operator==(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator!=(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator>(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator<(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator>=(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator<=(const QString &s) const Q_DECL_NOTHROW;
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
inline QT_ASCII_CAST_WARN bool operator==(const char *s) const;
@@ -219,7 +221,7 @@ public:
inline ~QString();
QString &operator=(QChar c);
QString &operator=(const QString &) Q_DECL_NOTHROW;
- inline QString &operator=(QLatin1String latin1);
+ QString &operator=(QLatin1String latin1);
#ifdef Q_COMPILER_RVALUE_REFS
inline QString(QString && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
inline QString &operator=(QString &&other) Q_DECL_NOTHROW
@@ -420,6 +422,7 @@ public:
QString &insert(int i, QChar c);
QString &insert(int i, const QChar *uc, int len);
inline QString &insert(int i, const QString &s) { return insert(i, s.constData(), s.length()); }
+ inline QString &insert(int i, const QStringRef &s);
QString &insert(int i, QLatin1String s);
QString &append(QChar c);
QString &append(const QChar *uc, int len);
@@ -427,7 +430,9 @@ public:
QString &append(const QStringRef &s);
QString &append(QLatin1String s);
inline QString &prepend(QChar c) { return insert(0, c); }
+ inline QString &prepend(const QChar *uc, int len) { return insert(0, uc, len); }
inline QString &prepend(const QString &s) { return insert(0, s); }
+ inline QString &prepend(const QStringRef &s) { return insert(0, s); }
inline QString &prepend(QLatin1String s) { return insert(0, s); }
inline QString &operator+=(QChar c) {
@@ -534,11 +539,11 @@ public:
return fromLocal8Bit_helper(str, (str && size == -1) ? int(strlen(str)) : size);
}
static inline QString fromLatin1(const QByteArray &str)
- { return fromLatin1(str.data(), qstrnlen(str.constData(), str.size())); }
+ { return str.isNull() ? QString() : fromLatin1(str.data(), qstrnlen(str.constData(), str.size())); }
static inline QString fromUtf8(const QByteArray &str)
- { return fromUtf8(str.data(), qstrnlen(str.constData(), str.size())); }
+ { return str.isNull() ? QString() : fromUtf8(str.data(), qstrnlen(str.constData(), str.size())); }
static inline QString fromLocal8Bit(const QByteArray &str)
- { return fromLocal8Bit(str.data(), qstrnlen(str.constData(), str.size())); }
+ { return str.isNull() ? QString() : fromLocal8Bit(str.data(), qstrnlen(str.constData(), str.size())); }
static QString fromUtf16(const ushort *, int size = -1);
static QString fromUcs4(const uint *, int size = -1);
static QString fromRawData(const QChar *, int size);
@@ -591,16 +596,16 @@ public:
static int localeAwareCompare(const QString& s1, const QStringRef& s2);
// ### Qt6: make inline except for the long long versions
- short toShort(bool *ok=0, int base=10) const;
- ushort toUShort(bool *ok=0, int base=10) const;
- int toInt(bool *ok=0, int base=10) const;
- uint toUInt(bool *ok=0, int base=10) const;
- long toLong(bool *ok=0, int base=10) const;
- ulong toULong(bool *ok=0, int base=10) const;
- qlonglong toLongLong(bool *ok=0, int base=10) const;
- qulonglong toULongLong(bool *ok=0, int base=10) const;
- float toFloat(bool *ok=0) const;
- double toDouble(bool *ok=0) const;
+ short toShort(bool *ok=Q_NULLPTR, int base=10) const;
+ ushort toUShort(bool *ok=Q_NULLPTR, int base=10) const;
+ int toInt(bool *ok=Q_NULLPTR, int base=10) const;
+ uint toUInt(bool *ok=Q_NULLPTR, int base=10) const;
+ long toLong(bool *ok=Q_NULLPTR, int base=10) const;
+ ulong toULong(bool *ok=Q_NULLPTR, int base=10) const;
+ qlonglong toLongLong(bool *ok=Q_NULLPTR, int base=10) const;
+ qulonglong toULongLong(bool *ok=Q_NULLPTR, int base=10) const;
+ float toFloat(bool *ok=Q_NULLPTR) const;
+ double toDouble(bool *ok=Q_NULLPTR) const;
QString &setNum(short, int base=10);
QString &setNum(ushort, int base=10);
@@ -668,6 +673,10 @@ public:
{ return append(QString::fromUtf8(s)); }
inline QT_ASCII_CAST_WARN QString &append(const QByteArray &s)
{ return append(QString::fromUtf8(s)); }
+ inline QT_ASCII_CAST_WARN QString &insert(int i, const char *s)
+ { return insert(i, QString::fromUtf8(s)); }
+ inline QT_ASCII_CAST_WARN QString &insert(int i, const QByteArray &s)
+ { return insert(i, QString::fromUtf8(s)); }
inline QT_ASCII_CAST_WARN QString &operator+=(const char *s)
{ return append(QString::fromUtf8(s)); }
inline QT_ASCII_CAST_WARN QString &operator+=(const QByteArray &s)
@@ -708,14 +717,22 @@ public:
typedef const QChar *const_iterator;
typedef iterator Iterator;
typedef const_iterator ConstIterator;
- iterator begin();
- const_iterator begin() const;
- const_iterator cbegin() const;
- const_iterator constBegin() const;
- iterator end();
- const_iterator end() const;
- const_iterator cend() const;
- const_iterator constEnd() const;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ inline iterator begin();
+ inline const_iterator begin() const;
+ inline const_iterator cbegin() const;
+ inline const_iterator constBegin() const;
+ inline iterator end();
+ inline const_iterator end() const;
+ inline const_iterator cend() const;
+ inline const_iterator constEnd() const;
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
// STL compatibility
typedef int size_type;
@@ -867,11 +884,6 @@ inline void QString::detach()
{ if (d->ref.isShared() || (d->offset != sizeof(QStringData))) reallocData(uint(d->size) + 1u); }
inline bool QString::isDetached() const
{ return !d->ref.isShared(); }
-inline QString &QString::operator=(QLatin1String s)
-{
- *this = fromLatin1(s.latin1(), s.size());
- return *this;
-}
inline void QString::clear()
{ if (!isNull()) *this = QString(); }
inline QString::QString(const QString &other) Q_DECL_NOTHROW : d(other.d)
@@ -1114,34 +1126,34 @@ inline bool operator!=(QString::Null, QString::Null) { return false; }
inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); }
inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
-inline bool operator==(QLatin1String s1, QLatin1String s2)
+inline bool operator==(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ return (s1.size() == s2.size() && !memcmp(s1.latin1(), s2.latin1(), s1.size())); }
-inline bool operator!=(QLatin1String s1, QLatin1String s2)
+inline bool operator!=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ return (s1.size() != s2.size() || memcmp(s1.latin1(), s2.latin1(), s1.size())); }
-inline bool operator<(QLatin1String s1, QLatin1String s2)
+inline bool operator<(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ int r = memcmp(s1.latin1(), s2.latin1(), qMin(s1.size(), s2.size()));
return (r < 0) || (r == 0 && s1.size() < s2.size()); }
-inline bool operator<=(QLatin1String s1, QLatin1String s2)
+inline bool operator<=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ int r = memcmp(s1.latin1(), s2.latin1(), qMin(s1.size(), s2.size()));
return (r < 0) || (r == 0 && s1.size() <= s2.size()); }
-inline bool operator>(QLatin1String s1, QLatin1String s2)
+inline bool operator>(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ int r = memcmp(s1.latin1(), s2.latin1(), qMin(s1.size(), s2.size()));
return (r > 0) || (r == 0 && s1.size() > s2.size()); }
-inline bool operator>=(QLatin1String s1, QLatin1String s2)
+inline bool operator>=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ int r = memcmp(s1.latin1(), s2.latin1(), qMin(s1.size(), s2.size()));
return (r > 0) || (r == 0 && s1.size() >= s2.size()); }
-inline bool QLatin1String::operator==(const QString &s) const
+inline bool QLatin1String::operator==(const QString &s) const Q_DECL_NOTHROW
{ return s == *this; }
-inline bool QLatin1String::operator!=(const QString &s) const
+inline bool QLatin1String::operator!=(const QString &s) const Q_DECL_NOTHROW
{ return s != *this; }
-inline bool QLatin1String::operator>(const QString &s) const
+inline bool QLatin1String::operator>(const QString &s) const Q_DECL_NOTHROW
{ return s < *this; }
-inline bool QLatin1String::operator<(const QString &s) const
+inline bool QLatin1String::operator<(const QString &s) const Q_DECL_NOTHROW
{ return s > *this; }
-inline bool QLatin1String::operator>=(const QString &s) const
+inline bool QLatin1String::operator>=(const QString &s) const Q_DECL_NOTHROW
{ return s <= *this; }
-inline bool QLatin1String::operator<=(const QString &s) const
+inline bool QLatin1String::operator<=(const QString &s) const Q_DECL_NOTHROW
{ return s >= *this; }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
@@ -1215,26 +1227,26 @@ inline QT_ASCII_CAST_WARN bool QString::operator==(const QByteArray &s) const
inline QT_ASCII_CAST_WARN bool QString::operator!=(const QByteArray &s) const
{ return QString::compare_helper(constData(), size(), s.constData(), qstrnlen(s.constData(), s.size())) != 0; }
inline QT_ASCII_CAST_WARN bool QString::operator<(const QByteArray &s) const
-{ return QString::compare_helper(constData(), size(), s.constData(), qstrnlen(s.constData(), s.size())) < 0; }
+{ return QString::compare_helper(constData(), size(), s.constData(), s.size()) < 0; }
inline QT_ASCII_CAST_WARN bool QString::operator>(const QByteArray &s) const
-{ return QString::compare_helper(constData(), size(), s.constData(), qstrnlen(s.constData(), s.size())) > 0; }
+{ return QString::compare_helper(constData(), size(), s.constData(), s.size()) > 0; }
inline QT_ASCII_CAST_WARN bool QString::operator<=(const QByteArray &s) const
-{ return QString::compare_helper(constData(), size(), s.constData(), qstrnlen(s.constData(), s.size())) <= 0; }
+{ return QString::compare_helper(constData(), size(), s.constData(), s.size()) <= 0; }
inline QT_ASCII_CAST_WARN bool QString::operator>=(const QByteArray &s) const
-{ return QString::compare_helper(constData(), size(), s.constData(), qstrnlen(s.constData(), s.size())) >= 0; }
+{ return QString::compare_helper(constData(), size(), s.constData(), s.size()) >= 0; }
inline bool QByteArray::operator==(const QString &s) const
{ return QString::compare_helper(s.constData(), s.size(), constData(), qstrnlen(constData(), size())) == 0; }
inline bool QByteArray::operator!=(const QString &s) const
{ return QString::compare_helper(s.constData(), s.size(), constData(), qstrnlen(constData(), size())) != 0; }
inline bool QByteArray::operator<(const QString &s) const
-{ return QString::compare_helper(s.constData(), s.size(), constData(), qstrnlen(constData(), size())) > 0; }
+{ return QString::compare_helper(s.constData(), s.size(), constData(), size()) > 0; }
inline bool QByteArray::operator>(const QString &s) const
-{ return QString::compare_helper(s.constData(), s.size(), constData(), qstrnlen(constData(), size())) < 0; }
+{ return QString::compare_helper(s.constData(), s.size(), constData(), size()) < 0; }
inline bool QByteArray::operator<=(const QString &s) const
-{ return QString::compare_helper(s.constData(), s.size(), constData(), qstrnlen(constData(), size())) >= 0; }
+{ return QString::compare_helper(s.constData(), s.size(), constData(), size()) >= 0; }
inline bool QByteArray::operator>=(const QString &s) const
-{ return QString::compare_helper(s.constData(), s.size(), constData(), qstrnlen(constData(), size())) <= 0; }
+{ return QString::compare_helper(s.constData(), s.size(), constData(), size()) <= 0; }
#endif // !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
#ifndef QT_NO_CAST_TO_ASCII
@@ -1343,28 +1355,32 @@ public:
typedef QString::const_reference const_reference;
// ### Qt 6: make this constructor constexpr, after the destructor is made trivial
- inline QStringRef():m_string(0), m_position(0), m_size(0){}
+ inline QStringRef() : m_string(Q_NULLPTR), m_position(0), m_size(0) {}
inline QStringRef(const QString *string, int position, int size);
inline QStringRef(const QString *string);
- // ### Qt 6: remove this copy constructor, the implicit one is fine
- inline QStringRef(const QStringRef &other)
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // ### Qt 6: remove all of these, the implicit ones are fine
+ QStringRef(const QStringRef &other) Q_DECL_NOTHROW
:m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
{}
-
- // ### Qt 6: remove this destructor, the implicit one is fine
+#ifdef Q_COMPILER_RVALUE_REFS
+ QStringRef(QStringRef &&other) Q_DECL_NOTHROW : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
+ QStringRef &operator=(QStringRef &&other) Q_DECL_NOTHROW { return *this = other; }
+#endif
+ QStringRef &operator=(const QStringRef &other) Q_DECL_NOTHROW {
+ m_string = other.m_string; m_position = other.m_position;
+ m_size = other.m_size; return *this;
+ }
inline ~QStringRef(){}
+#endif // Qt < 6.0.0
+
inline const QString *string() const { return m_string; }
inline int position() const { return m_position; }
inline int size() const { return m_size; }
inline int count() const { return m_size; }
inline int length() const { return m_size; }
- inline QStringRef &operator=(const QStringRef &other) {
- m_string = other.m_string; m_position = other.m_position;
- m_size = other.m_size; return *this;
- }
-
int indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1392,6 +1408,8 @@ public:
QStringRef right(int n) const Q_REQUIRED_RESULT;
QStringRef mid(int pos, int n = -1) const Q_REQUIRED_RESULT;
+ void truncate(int pos) Q_DECL_NOTHROW { m_size = qBound(0, pos, m_size); }
+
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1425,10 +1443,10 @@ public:
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
- inline void clear() { m_string = 0; m_position = m_size = 0; }
+ inline void clear() { m_string = Q_NULLPTR; m_position = m_size = 0; }
QString toString() const;
inline bool isEmpty() const { return m_size == 0; }
- inline bool isNull() const { return m_string == 0 || m_string->isNull(); }
+ inline bool isNull() const { return m_string == Q_NULLPTR || m_string->isNull(); }
QStringRef appendTo(QString *string) const;
@@ -1461,16 +1479,16 @@ public:
static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
QStringRef trimmed() const Q_REQUIRED_RESULT;
- short toShort(bool *ok = 0, int base = 10) const;
- ushort toUShort(bool *ok = 0, int base = 10) const;
- int toInt(bool *ok = 0, int base = 10) const;
- uint toUInt(bool *ok = 0, int base = 10) const;
- long toLong(bool *ok = 0, int base = 10) const;
- ulong toULong(bool *ok = 0, int base = 10) const;
- qlonglong toLongLong(bool *ok = 0, int base = 10) const;
- qulonglong toULongLong(bool *ok = 0, int base = 10) const;
- float toFloat(bool *ok = 0) const;
- double toDouble(bool *ok = 0) const;
+ short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
+ ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
+ int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
+ uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
+ long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
+ ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
+ qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
+ qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
+ float toFloat(bool *ok = Q_NULLPTR) const;
+ double toDouble(bool *ok = Q_NULLPTR) const;
};
Q_DECLARE_TYPEINFO(QStringRef, Q_PRIMITIVE_TYPE);
@@ -1576,6 +1594,9 @@ inline bool QStringRef::contains(QChar c, Qt::CaseSensitivity cs) const
inline bool QStringRef::contains(const QStringRef &s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
+inline QString &QString::insert(int i, const QStringRef &s)
+{ return insert(i, s.constData(), s.length()); }
+
namespace Qt {
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline QString escape(const QString &plain) {
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 1dbc005bca..3d41aeee18 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -421,7 +421,7 @@ QString &operator+=(QString &a, const QStringBuilder<A, B> &b)
a.reserve(len);
QChar *it = a.data() + a.size();
QConcatenable< QStringBuilder<A, B> >::appendTo(b, it);
- a.resize(it - a.constData()); //may be smaller than len if there was conversion from utf8
+ a.resize(int(it - a.constData())); //may be smaller than len if there was conversion from utf8
return a;
}
diff --git a/src/corelib/tools/qstringiterator_p.h b/src/corelib/tools/qstringiterator_p.h
index 06b05de833..1c098a314d 100644
--- a/src/corelib/tools/qstringiterator_p.h
+++ b/src/corelib/tools/qstringiterator_p.h
@@ -69,6 +69,13 @@ public:
{
}
+ inline explicit QStringIterator(const QChar *begin, int idx, const QChar *end)
+ : i(begin),
+ pos(begin + idx),
+ e(end)
+ {
+ }
+
inline QString::const_iterator position() const
{
return pos;
diff --git a/src/corelib/tools/qtextboundaryfinder.h b/src/corelib/tools/qtextboundaryfinder.h
index beec5de607..a79fb50dad 100644
--- a/src/corelib/tools/qtextboundaryfinder.h
+++ b/src/corelib/tools/qtextboundaryfinder.h
@@ -68,7 +68,7 @@ public:
Q_DECLARE_FLAGS( BoundaryReasons, BoundaryReason )
QTextBoundaryFinder(BoundaryType type, const QString &string);
- QTextBoundaryFinder(BoundaryType type, const QChar *chars, int length, unsigned char *buffer = 0, int bufferSize = 0);
+ QTextBoundaryFinder(BoundaryType type, const QChar *chars, int length, unsigned char *buffer = Q_NULLPTR, int bufferSize = 0);
inline bool isValid() const { return d; }
diff --git a/src/corelib/tools/qtimeline.h b/src/corelib/tools/qtimeline.h
index 21139b37a8..94e60dce45 100644
--- a/src/corelib/tools/qtimeline.h
+++ b/src/corelib/tools/qtimeline.h
@@ -70,7 +70,7 @@ public:
CosineCurve
};
- explicit QTimeLine(int duration = 1000, QObject *parent = 0);
+ explicit QTimeLine(int duration = 1000, QObject *parent = Q_NULLPTR);
virtual ~QTimeLine();
State state() const;
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index 3627045a40..333a5c3471 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -116,8 +116,9 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
\class QTimeZone
\inmodule QtCore
\since 5.2
- \brief The QTimeZone class converts between between UTC and local time in a
- specific time zone.
+
+ \brief The QTimeZone class converts between UTC and local time in a specific
+ time zone.
\threadsafe
@@ -198,14 +199,15 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
The difference between UTC and the local time in a time zone is expressed
as an offset in seconds from UTC, i.e. the number of seconds to add to UTC
to obtain the local time. The total offset is comprised of two component
- parts, the standard time offset and the daylight time offset. The standard
- time offset is the number of seconds to add to UTC to obtain standard time
- in the time zone. The daylight time offset is the number of seconds to add
- to the standard time offset to obtain daylight time in the time zone.
+ parts, the standard time offset and the daylight-saving time offset. The
+ standard time offset is the number of seconds to add to UTC to obtain
+ standard time in the time zone. The daylight-saving time offset is the
+ number of seconds to add to the standard time offset to obtain
+ daylight-saving time (abbreviated DST and sometimes called "daylight time"
+ or "summer time") in the time zone.
- Note that the standard and daylight offsets for a time zone may change over
- time as countries have changed daylight time laws or even their standard
- time offset.
+ Note that the standard and DST offsets for a time zone may change over time
+ as countries have changed DST laws or even their standard time offset.
\section2 License
@@ -240,21 +242,20 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
\enum QTimeZone::TimeType
The type of time zone time, for example when requesting the name. In time
- zones that do not apply daylight time, all three values may return the
- same result.
+ zones that do not apply DST, all three values may return the same result.
\value StandardTime
- The standard time in a time zone, i.e. when Daylight Savings is not
+ The standard time in a time zone, i.e. when Daylight-Saving is not
in effect.
For example when formatting a display name this will show something
like "Pacific Standard Time".
\value DaylightTime
- A time when Daylight Savings is in effect.
+ A time when Daylight-Saving is in effect.
For example when formatting a display name this will show something
- like "Pacific daylight time".
+ like "Pacific daylight-saving time".
\value GenericTime
- A time which is not specifically Standard or Daylight time, either
- an unknown time or a neutral form.
+ A time which is not specifically Standard or Daylight-Saving time,
+ either an unknown time or a neutral form.
For example when formatting a display name this will show something
like "Pacific Time".
*/
@@ -285,11 +286,11 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
\li OffsetData::atUtc The datetime of the offset data in UTC time.
\li OffsetData::offsetFromUtc The total offset from UTC in effect at the datetime.
\li OffsetData::standardTimeOffset The standard time offset component of the total offset.
- \li OffsetData::daylightTimeOffset The daylight time offset component of the total offset.
+ \li OffsetData::daylightTimeOffset The DST offset component of the total offset.
\li OffsetData::abbreviation The abbreviation in effect at the datetime.
\endlist
- For example, for time zone "Europe/Berlin" the OffsetDate in standard and daylight time might be:
+ For example, for time zone "Europe/Berlin" the OffsetDate in standard and DST might be:
\list
\li atUtc = QDateTime(QDate(2013, 1, 1), QTime(0, 0, 0), Qt::UTC)
@@ -310,9 +311,8 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
/*!
\typedef QTimeZone::OffsetDataList
- \relates QTimeZone
- Synonym for QList<OffsetData>.
+ Synonym for QVector<OffsetData>.
*/
/*!
@@ -531,8 +531,7 @@ QString QTimeZone::comment() const
If the \a locale is not provided then the application default locale will
be used.
- The display name may change depending on daylight time or historical
- events.
+ The display name may change depending on DST or historical events.
\sa abbreviation()
*/
@@ -572,8 +571,7 @@ QString QTimeZone::displayName(TimeType timeType, NameType nameType,
/*!
Returns the time zone abbreviation at the given \a atDateTime. The
- abbreviation may change depending on daylight time or even
- historical events.
+ abbreviation may change depending on DST or even historical events.
Note that the abbreviation is not guaranteed to be unique to this time zone
and should not be used in place of the ID or display name.
@@ -592,13 +590,13 @@ QString QTimeZone::abbreviation(const QDateTime &atDateTime) const
/*!
Returns the total effective offset at the given \a atDateTime, i.e. the
number of seconds to add to UTC to obtain the local time. This includes
- any daylight time offset that may be in effect, i.e. it is the sum of
+ any DST offset that may be in effect, i.e. it is the sum of
standardTimeOffset() and daylightTimeOffset() for the given datetime.
For example, for the time zone "Europe/Berlin" the standard time offset is
- +3600 seconds and the daylight time offset is +3600 seconds. During standard
- time offsetFromUtc() will return +3600 (UTC+01:00), and during daylight time
- it will return +7200 (UTC+02:00).
+ +3600 seconds and the DST offset is +3600 seconds. During standard time
+ offsetFromUtc() will return +3600 (UTC+01:00), and during DST it will
+ return +7200 (UTC+02:00).
\sa standardTimeOffset(), daylightTimeOffset()
*/
@@ -614,11 +612,11 @@ int QTimeZone::offsetFromUtc(const QDateTime &atDateTime) const
/*!
Returns the standard time offset at the given \a atDateTime, i.e. the
number of seconds to add to UTC to obtain the local Standard Time. This
- excludes any daylight time offset that may be in effect.
+ excludes any DST offset that may be in effect.
For example, for the time zone "Europe/Berlin" the standard time offset is
- +3600 seconds. During both standard and daylight time offsetFromUtc() will
- return +3600 (UTC+01:00).
+ +3600 seconds. During both standard and DST offsetFromUtc() will return
+ +3600 (UTC+01:00).
\sa offsetFromUtc(), daylightTimeOffset()
*/
@@ -632,13 +630,13 @@ int QTimeZone::standardTimeOffset(const QDateTime &atDateTime) const
}
/*!
- Returns the daylight time offset at the given \a atDateTime, i.e. the
- number of seconds to add to the standard time offset to obtain the local
- daylight time.
+ Returns the daylight-saving time offset at the given \a atDateTime,
+ i.e. the number of seconds to add to the standard time offset to obtain the
+ local daylight-saving time.
- For example, for the time zone "Europe/Berlin" the daylight time offset
- is +3600 seconds. During standard time daylightTimeOffset() will return
- 0, and during daylight time it will return +3600.
+ For example, for the time zone "Europe/Berlin" the DST offset is +3600
+ seconds. During standard time daylightTimeOffset() will return 0, and when
+ daylight-saving is in effect it will return +3600.
\sa offsetFromUtc(), standardTimeOffset()
*/
@@ -652,7 +650,7 @@ int QTimeZone::daylightTimeOffset(const QDateTime &atDateTime) const
}
/*!
- Returns \c true if the time zone has observed daylight time at any time.
+ Returns \c true if the time zone has practiced daylight-saving at any time.
\sa isDaylightTime(), daylightTimeOffset()
*/
@@ -666,7 +664,7 @@ bool QTimeZone::hasDaylightTime() const
}
/*!
- Returns \c true if the given \a atDateTime is in daylight time.
+ Returns \c true if daylight-saving was in effect at the given \a atDateTime.
\sa hasDaylightTime(), daylightTimeOffset()
*/
@@ -697,6 +695,11 @@ QTimeZone::OffsetData QTimeZone::offsetData(const QDateTime &forDateTime) const
/*!
Returns \c true if the system backend supports obtaining transitions.
+
+ Transitions are changes in the time-zone: these happen when DST turns on or
+ off and when authorities alter the offsets for the time-zone.
+
+ \sa nextTransition(), previousTransition(), transitions()
*/
bool QTimeZone::hasTransitions() const
@@ -764,6 +767,7 @@ QTimeZone::OffsetDataList QTimeZone::transitions(const QDateTime &fromDateTime,
if (hasTransitions()) {
QTimeZonePrivate::DataList plist = d->transitions(fromDateTime.toMSecsSinceEpoch(),
toDateTime.toMSecsSinceEpoch());
+ list.reserve(plist.count());
foreach (const QTimeZonePrivate::Data &pdata, plist)
list.append(d->toOffsetData(pdata));
}
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp
index 8e6a0a0578..ab8332aea3 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/tools/qtimezoneprivate.cpp
@@ -246,8 +246,8 @@ QTimeZonePrivate::Data QTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs) const
{
if (!hasDaylightTime() ||!hasTransitions()) {
- // No daylight time means same offset for all local msecs
- // Having daylight time but no transitions means we can't calculate, so use nearest
+ // No DST means same offset for all local msecs
+ // Having DST but no transitions means we can't calculate, so use nearest
return data(forLocalMSecs - (standardTimeOffset(forLocalMSecs) * 1000));
}
@@ -276,16 +276,16 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs)
}
if (tran.daylightTimeOffset == 0) {
- // If tran is in StandardTime, then need to check if falls close either daylight transition
+ // If tran is in StandardTime, then need to check if falls close to either DST transition.
// If it does, then it may need adjusting for missing hour or for second occurrence
qint64 diffPrevTran = forLocalMSecs
- (tran.atMSecsSinceEpoch + (tran.offsetFromUtc * 1000));
qint64 diffNextTran = nextTran.atMSecsSinceEpoch + (nextTran.offsetFromUtc * 1000)
- forLocalMSecs;
if (diffPrevTran >= 0 && diffPrevTran < MSECS_TRAN_WINDOW) {
- // If tran picked is for standard time check if changed from daylight in last 6 hours,
+ // If tran picked is for standard time check if changed from DST in last 6 hours,
// as the local msecs may be ambiguous and represent two valid utc msecs.
- // If in last 6 hours then get prev tran and if diff falls within the daylight offset
+ // If in last 6 hours then get prev tran and if diff falls within the DST offset
// then use the prev tran as we default to the FirstOccurrence
// TODO Check if faster to just always get prev tran, or if faster using 6 hour check.
Data dstTran = previousTransition(tran.atMSecsSinceEpoch);
@@ -700,6 +700,7 @@ QByteArray QUtcTimeZonePrivate::systemTimeZoneId() const
QList<QByteArray> QUtcTimeZonePrivate::availableTimeZoneIds() const
{
QList<QByteArray> result;
+ result.reserve(utcDataTableSize);
for (int i = 0; i < utcDataTableSize; ++i)
result << utcId(utcData(i));
std::sort(result.begin(), result.end()); // ### or already sorted??
diff --git a/src/corelib/tools/qtimezoneprivate_android.cpp b/src/corelib/tools/qtimezoneprivate_android.cpp
index 6178fe935a..e66d00c67c 100644
--- a/src/corelib/tools/qtimezoneprivate_android.cpp
+++ b/src/corelib/tools/qtimezoneprivate_android.cpp
@@ -150,7 +150,7 @@ int QAndroidTimeZonePrivate::daylightTimeOffset(qint64 atMSecsSinceEpoch) const
bool QAndroidTimeZonePrivate::hasDaylightTime() const
{
if ( androidTimeZone.isValid() )
- /* note: the Java function only tests for future daylight transtions, not past */
+ /* note: the Java function only tests for future DST transtions, not past */
return androidTimeZone.callMethod<jboolean>("useDaylightTime" );
else
return false;
@@ -210,34 +210,34 @@ QTimeZonePrivate::Data QAndroidTimeZonePrivate::dataForLocalTime(qint64 forLocal
} else {
qint64 UTCepochMSecs;
- // compare the UTC time with standard offset against normal daylight offset of one hour
+ // compare the UTC time with standard offset against normal DST offset of one hour
qint64 standardUTCMSecs(forLocalMSecs - (standardTimeOffset(forLocalMSecs) * 1000));
qint64 daylightUTCMsecs;
- // Check if daylight time does apply,
- // checking also for daylight time boundaries
+ // Check if daylight-saving time applies,
+ // checking also for DST boundaries
if (isDaylightTime(standardUTCMSecs)) {
- // If daylight does apply, then standardUTCMSecs will be an hour or so ahead of the real epoch time
+ // If DST does apply, then standardUTCMSecs will be an hour or so ahead of the real epoch time
// so check that time
daylightUTCMsecs = standardUTCMSecs - daylightTimeOffset(standardUTCMSecs)*1000;
if (isDaylightTime(daylightUTCMsecs)) {
- // daylight time confirmed
+ // DST confirmed
UTCepochMSecs = daylightUTCMsecs;
} else {
- // daylight time has just finished
+ // DST has just finished
UTCepochMSecs = standardUTCMSecs;
}
} else {
// Standard time indicated, but check for a false negative.
- // Would a standard one-hour daylight offset indicate daylight time?
+ // Would a standard one-hour DST offset indicate DST?
daylightUTCMsecs = standardUTCMSecs - 3600000; // 3600000 MSECS_PER_HOUR
if (isDaylightTime(daylightUTCMsecs)) {
- // daylight time may have just started,
- // but double check against timezone's own daylight offset
+ // DST may have just started,
+ // but double check against timezone's own DST offset
// (don't necessarily assume a one-hour offset)
daylightUTCMsecs = standardUTCMSecs - daylightTimeOffset(daylightUTCMsecs)*1000;
if (isDaylightTime(daylightUTCMsecs)) {
- // daylight time confirmed
+ // DST confirmed
UTCepochMSecs = daylightUTCMsecs;
} else {
// false positive, apply standard time after all
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index e15ac801bc..14aeac3a02 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -165,6 +165,7 @@ public:
protected:
QByteArray m_id;
};
+Q_DECLARE_TYPEINFO(QTimeZonePrivate::Data, Q_MOVABLE_TYPE);
template<> QTimeZonePrivate *QSharedDataPointer<QTimeZonePrivate>::clone();
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 35380b882a..85ed345869 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -637,6 +637,7 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
}
// Now for each transition time calculate our rule and save them
+ m_tranTimes.reserve(tranList.count());
foreach (const QTzTransition &tz_tran, tranList) {
QTzTransitionTime tran;
QTzTransitionRule rule;
@@ -917,6 +918,13 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
if (!ianaId.isEmpty() && ianaId.at(0) == ':')
ianaId = ianaId.mid(1);
+ // The TZ value can be ":/etc/localtime" which libc considers
+ // to be a "default timezone", in which case it will be read
+ // by one of the blocks below, so unset it here so it is not
+ // considered as a valid/found ianaId
+ if (ianaId == "/etc/localtime")
+ ianaId.clear();
+
// On Debian Etch and later /etc/localtime is real file with name held in /etc/timezone
if (ianaId.isEmpty()) {
QFile tzif(QStringLiteral("/etc/timezone"));
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 73dce81d4a..14e4fd10aa 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-/* This file is autogenerated from the Unicode 7.0 database. Do not edit */
+/* This file is autogenerated from the Unicode 8.0 database. Do not edit */
#include "qunicodetables_p.h"
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
namespace QUnicodeTables {
static const unsigned short uc_property_trie[] = {
- // 0 - 0x11000
+ // [0x0..0x11000)
6256, 6288, 6320, 6352, 6384, 6416, 6448, 6480,
6512, 6544, 6576, 6608, 6640, 6672, 6704, 6736,
@@ -62,803 +62,803 @@ static const unsigned short uc_property_trie[] = {
10256, 10288, 10320, 10352, 10384, 10416, 10448, 10480,
10512, 10512, 10544, 10576, 10608, 10640, 10672, 10704,
10736, 10768, 10800, 10768, 10832, 10864, 10896, 10928,
- 10960, 10768, 10992, 11024, 11056, 11088, 11088, 11120,
- 11152, 11184, 11184, 11184, 11184, 11184, 11184, 11184,
- 11184, 11184, 11184, 11184, 11184, 11184, 11184, 11184,
- 11184, 11184, 11184, 11216, 11248, 11280, 11280, 11312,
- 11344, 11376, 11408, 11440, 11472, 11504, 11536, 11568,
- 11600, 11632, 11664, 11696, 11728, 11760, 11792, 11824,
- 11856, 11888, 11920, 11952, 11984, 12016, 12048, 12080,
- 12112, 12144, 12176, 12208, 12240, 12272, 9904, 9904,
- 12304, 12336, 12368, 12400, 12432, 12464, 12496, 12528,
- 12560, 12592, 12624, 12656, 9904, 9904, 12688, 12720,
- 12752, 12784, 12816, 12848, 12880, 12912, 12944, 12976,
- 13008, 13008, 13008, 13008, 13040, 13008, 13008, 13072,
- 13104, 13136, 13168, 13200, 13232, 13264, 13296, 13328,
-
- 13360, 13392, 13424, 13456, 13488, 13520, 13552, 13584,
- 13616, 13648, 13680, 13712, 13744, 13776, 13808, 13840,
- 13872, 13904, 13936, 13968, 14000, 14032, 14064, 14096,
- 14128, 14160, 14192, 14224, 14256, 14288, 14320, 14352,
- 14384, 14416, 14448, 14480, 14512, 14544, 14576, 14608,
- 14384, 14384, 14384, 14384, 14640, 14672, 14704, 14736,
- 14768, 14800, 14384, 14832, 14864, 14896, 14928, 14960,
- 14992, 15024, 15056, 15088, 15120, 15152, 15184, 15216,
- 15248, 15248, 15248, 15248, 15248, 15248, 15248, 15248,
- 15280, 15280, 15280, 15280, 15312, 15344, 15376, 15408,
- 15440, 15472, 15280, 15504, 15536, 15568, 15600, 15632,
- 15664, 15696, 15728, 15760, 15792, 15824, 15856, 9904,
- 15888, 15920, 15952, 15984, 16016, 16016, 16016, 16048,
- 16080, 16112, 16144, 16176, 16208, 16240, 16240, 16272,
- 16304, 16336, 16368, 9904, 16400, 16432, 16432, 16464,
- 16496, 16496, 16496, 16496, 16496, 16496, 16528, 16560,
-
- 16592, 16624, 16656, 16688, 16720, 16752, 16784, 16816,
- 16848, 16880, 16912, 16912, 16944, 16976, 17008, 17040,
- 17072, 17104, 17136, 17168, 17104, 17200, 17232, 17264,
- 17296, 17296, 17328, 17360, 17392, 17392, 17424, 17456,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
-
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17488, 17488, 17488,
- 17488, 17488, 17488, 17488, 17488, 17520, 17552, 17552,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
-
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
-
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
-
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
-
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
-
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17584, 17584, 17584,
- 17584, 17584, 17584, 17584, 17584, 17616, 17648, 17680,
-
- 17712, 17744, 17744, 17744, 17744, 17744, 17744, 17744,
- 17744, 17744, 17744, 17744, 17744, 17744, 17744, 17744,
- 17744, 17744, 17744, 17744, 17744, 17744, 17744, 17744,
- 17744, 17744, 17744, 17744, 17744, 17744, 17744, 17744,
- 17744, 17744, 17744, 17744, 17776, 17808, 17840, 17872,
- 17904, 17904, 17904, 17904, 17904, 17904, 17904, 17904,
- 17936, 17968, 18000, 18032, 18064, 18096, 18096, 18128,
- 18160, 18192, 18224, 18256, 18288, 18320, 9904, 18352,
- 18384, 18416, 18448, 18480, 18512, 18544, 18576, 18608,
- 18640, 18672, 18704, 18736, 18768, 18800, 18832, 18864,
- 18896, 18928, 18960, 18992, 19024, 19056, 19088, 19120,
- 19152, 19184, 19216, 19248, 9904, 9904, 19280, 19312,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
- 19376, 19408, 19440, 19472, 19504, 19536, 19344, 19376,
- 19408, 19440, 19472, 19504, 19536, 19344, 19376, 19408,
- 19440, 19472, 19504, 19536, 19344, 19376, 19408, 19440,
-
- 19472, 19504, 19536, 19344, 19376, 19408, 19440, 19472,
- 19504, 19536, 19344, 19376, 19408, 19440, 19472, 19504,
- 19536, 19344, 19376, 19408, 19440, 19472, 19504, 19536,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
- 19376, 19408, 19440, 19472, 19504, 19536, 19344, 19376,
- 19408, 19440, 19472, 19504, 19536, 19344, 19376, 19408,
- 19440, 19472, 19504, 19536, 19344, 19376, 19408, 19440,
- 19472, 19504, 19536, 19344, 19376, 19408, 19440, 19472,
- 19504, 19536, 19344, 19376, 19408, 19440, 19472, 19504,
- 19536, 19344, 19376, 19408, 19440, 19472, 19504, 19536,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
- 19376, 19408, 19440, 19472, 19504, 19536, 19344, 19376,
- 19408, 19440, 19472, 19504, 19536, 19344, 19376, 19408,
- 19440, 19472, 19504, 19536, 19344, 19376, 19408, 19440,
- 19472, 19504, 19536, 19344, 19376, 19408, 19440, 19472,
- 19504, 19536, 19344, 19376, 19408, 19440, 19472, 19504,
-
- 19536, 19344, 19376, 19408, 19440, 19472, 19504, 19536,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
- 19376, 19408, 19440, 19472, 19504, 19536, 19344, 19376,
- 19408, 19440, 19472, 19504, 19536, 19344, 19376, 19408,
- 19440, 19472, 19504, 19536, 19344, 19376, 19408, 19440,
- 19472, 19504, 19536, 19344, 19376, 19408, 19440, 19472,
- 19504, 19536, 19344, 19376, 19408, 19440, 19472, 19504,
- 19536, 19344, 19376, 19408, 19440, 19472, 19504, 19536,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
- 19376, 19408, 19440, 19472, 19504, 19536, 19344, 19376,
- 19408, 19440, 19472, 19504, 19536, 19344, 19376, 19408,
- 19440, 19472, 19504, 19536, 19344, 19376, 19408, 19440,
- 19472, 19504, 19536, 19344, 19376, 19408, 19440, 19472,
- 19504, 19536, 19344, 19376, 19408, 19440, 19472, 19504,
- 19536, 19344, 19376, 19408, 19440, 19472, 19504, 19536,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
-
- 19376, 19408, 19440, 19472, 19504, 19536, 19344, 19376,
- 19408, 19440, 19472, 19504, 19536, 19344, 19376, 19408,
- 19440, 19472, 19504, 19536, 19344, 19376, 19408, 19440,
- 19472, 19504, 19536, 19344, 19376, 19408, 19440, 19472,
- 19504, 19536, 19344, 19376, 19408, 19440, 19472, 19504,
- 19536, 19344, 19376, 19408, 19440, 19472, 19504, 19536,
- 19344, 19376, 19408, 19440, 19472, 19504, 19536, 19344,
- 19376, 19408, 19440, 19472, 19504, 19568, 19600, 19632,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
- 19664, 19664, 19664, 19664, 19664, 19664, 19664, 19664,
-
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
-
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19696, 19696, 19696, 19696, 19696, 19696, 19696, 19696,
- 19728, 19728, 19728, 19728, 19728, 19728, 19728, 19728,
- 19760, 19792, 19824, 19856, 19888, 19888, 19920, 17680,
- 19952, 19984, 20016, 20048, 20048, 20080, 20112, 20048,
- 20048, 20048, 20048, 20048, 20048, 20048, 20048, 20048,
- 20048, 20144, 20176, 20048, 20208, 20048, 20240, 20272,
- 20304, 20336, 20368, 20400, 20048, 20048, 20048, 20432,
- 20464, 20496, 20528, 20560, 20592, 20624, 20656, 20688,
-
- 20720, 20752, 20784, 9904, 20816, 20816, 20816, 20848,
- 20880, 20912, 20944, 20976, 21008, 21040, 21072, 21104,
- 9904, 9904, 9904, 9904, 21136, 21168, 21200, 21232,
- 21264, 21296, 21328, 21360, 21392, 21424, 21456, 9904,
- 21488, 21520, 21552, 21584, 21616, 21648, 9904, 9904,
- 21680, 21712, 21744, 21776, 9904, 9904, 9904, 9904,
- 21808, 21808, 21808, 21808, 21808, 21808, 21808, 21808,
+ 10960, 10768, 10992, 11024, 11056, 11088, 11120, 11152,
+ 11184, 11216, 11216, 11216, 11216, 11216, 11216, 11216,
+ 11216, 11216, 11216, 11216, 11216, 11216, 11216, 11216,
+ 11216, 11216, 11216, 11248, 11280, 11312, 11312, 11344,
+ 11376, 11408, 11440, 11472, 11504, 11536, 11568, 11600,
+ 11632, 11664, 11696, 11728, 11760, 11792, 11824, 11856,
+ 11888, 11920, 11952, 11984, 12016, 12048, 12080, 12112,
+ 12144, 12176, 12208, 12240, 12272, 12304, 9904, 9904,
+ 12336, 12368, 12400, 12432, 12464, 12496, 12528, 12560,
+ 12592, 12624, 12656, 12688, 9904, 9904, 12720, 12752,
+ 12784, 12816, 12848, 12880, 12912, 12944, 12976, 13008,
+ 13040, 13040, 13040, 13040, 13072, 13040, 13040, 13104,
+ 13136, 13168, 13200, 13232, 13264, 13296, 13328, 13360,
+
+ 13392, 13424, 13456, 13488, 13520, 13552, 13584, 13616,
+ 13648, 13680, 13712, 13744, 13776, 13808, 13840, 13872,
+ 13904, 13936, 13968, 14000, 14032, 14064, 14096, 14128,
+ 14160, 14192, 14224, 14256, 14288, 14320, 14352, 14384,
+ 14416, 14448, 14480, 14512, 14544, 14576, 14608, 14640,
+ 14416, 14416, 14416, 14416, 14672, 14704, 14736, 14768,
+ 14800, 14832, 14416, 14864, 14896, 14928, 14960, 14992,
+ 15024, 15056, 15088, 15120, 15152, 15184, 15216, 15248,
+ 15280, 15280, 15280, 15280, 15280, 15280, 15280, 15280,
+ 15312, 15312, 15312, 15312, 15344, 15376, 15408, 15440,
+ 15472, 15504, 15312, 15536, 15568, 15600, 15632, 15664,
+ 15696, 15728, 15760, 15792, 15824, 15856, 15888, 15920,
+ 15952, 15984, 16016, 16048, 16080, 16080, 16080, 16112,
+ 16144, 16176, 16208, 16240, 16272, 16304, 16304, 16336,
+ 16368, 16400, 16432, 9904, 16464, 16496, 16496, 16528,
+ 16560, 16560, 16560, 16560, 16560, 16560, 16592, 16624,
+
+ 16656, 16688, 16720, 16752, 16784, 16816, 16848, 16880,
+ 16912, 16944, 16976, 16976, 17008, 17040, 17072, 17104,
+ 17136, 17168, 17200, 17232, 17168, 17264, 17296, 17328,
+ 17360, 17360, 17392, 17424, 17456, 17456, 17488, 17520,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17552, 17552, 17552,
+ 17552, 17552, 17552, 17552, 17552, 17584, 17616, 17616,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17648, 17648, 17648,
+ 17648, 17648, 17648, 17648, 17648, 17680, 17712, 17744,
+
+ 17776, 17808, 17808, 17808, 17808, 17808, 17808, 17808,
+ 17808, 17808, 17808, 17808, 17808, 17808, 17808, 17808,
+ 17808, 17808, 17808, 17808, 17808, 17808, 17808, 17808,
+ 17808, 17808, 17808, 17808, 17808, 17808, 17808, 17808,
+ 17808, 17808, 17808, 17808, 17840, 17872, 17904, 17936,
+ 17968, 17968, 17968, 17968, 17968, 17968, 17968, 17968,
+ 18000, 18032, 18064, 18096, 18128, 18160, 18160, 18192,
+ 18224, 18256, 18288, 18320, 18352, 18384, 9904, 18416,
+ 18448, 18480, 18512, 18544, 18576, 18608, 18640, 18672,
+ 18704, 18736, 18768, 18800, 18832, 18864, 18896, 18928,
+ 18960, 18992, 19024, 19056, 19088, 19120, 19152, 19184,
+ 19216, 19248, 19280, 19312, 19344, 19376, 19408, 19440,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+ 19504, 19536, 19568, 19600, 19632, 19664, 19472, 19504,
+ 19536, 19568, 19600, 19632, 19664, 19472, 19504, 19536,
+ 19568, 19600, 19632, 19664, 19472, 19504, 19536, 19568,
+
+ 19600, 19632, 19664, 19472, 19504, 19536, 19568, 19600,
+ 19632, 19664, 19472, 19504, 19536, 19568, 19600, 19632,
+ 19664, 19472, 19504, 19536, 19568, 19600, 19632, 19664,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+ 19504, 19536, 19568, 19600, 19632, 19664, 19472, 19504,
+ 19536, 19568, 19600, 19632, 19664, 19472, 19504, 19536,
+ 19568, 19600, 19632, 19664, 19472, 19504, 19536, 19568,
+ 19600, 19632, 19664, 19472, 19504, 19536, 19568, 19600,
+ 19632, 19664, 19472, 19504, 19536, 19568, 19600, 19632,
+ 19664, 19472, 19504, 19536, 19568, 19600, 19632, 19664,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+ 19504, 19536, 19568, 19600, 19632, 19664, 19472, 19504,
+ 19536, 19568, 19600, 19632, 19664, 19472, 19504, 19536,
+ 19568, 19600, 19632, 19664, 19472, 19504, 19536, 19568,
+ 19600, 19632, 19664, 19472, 19504, 19536, 19568, 19600,
+ 19632, 19664, 19472, 19504, 19536, 19568, 19600, 19632,
+
+ 19664, 19472, 19504, 19536, 19568, 19600, 19632, 19664,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+ 19504, 19536, 19568, 19600, 19632, 19664, 19472, 19504,
+ 19536, 19568, 19600, 19632, 19664, 19472, 19504, 19536,
+ 19568, 19600, 19632, 19664, 19472, 19504, 19536, 19568,
+ 19600, 19632, 19664, 19472, 19504, 19536, 19568, 19600,
+ 19632, 19664, 19472, 19504, 19536, 19568, 19600, 19632,
+ 19664, 19472, 19504, 19536, 19568, 19600, 19632, 19664,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+ 19504, 19536, 19568, 19600, 19632, 19664, 19472, 19504,
+ 19536, 19568, 19600, 19632, 19664, 19472, 19504, 19536,
+ 19568, 19600, 19632, 19664, 19472, 19504, 19536, 19568,
+ 19600, 19632, 19664, 19472, 19504, 19536, 19568, 19600,
+ 19632, 19664, 19472, 19504, 19536, 19568, 19600, 19632,
+ 19664, 19472, 19504, 19536, 19568, 19600, 19632, 19664,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+
+ 19504, 19536, 19568, 19600, 19632, 19664, 19472, 19504,
+ 19536, 19568, 19600, 19632, 19664, 19472, 19504, 19536,
+ 19568, 19600, 19632, 19664, 19472, 19504, 19536, 19568,
+ 19600, 19632, 19664, 19472, 19504, 19536, 19568, 19600,
+ 19632, 19664, 19472, 19504, 19536, 19568, 19600, 19632,
+ 19664, 19472, 19504, 19536, 19568, 19600, 19632, 19664,
+ 19472, 19504, 19536, 19568, 19600, 19632, 19664, 19472,
+ 19504, 19536, 19568, 19600, 19632, 19696, 19728, 19760,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+ 19792, 19792, 19792, 19792, 19792, 19792, 19792, 19792,
+
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19824, 19824, 19824, 19824, 19824, 19824, 19824, 19824,
+ 19856, 19856, 19856, 19856, 19856, 19856, 19856, 19856,
+ 19888, 19920, 19952, 19984, 20016, 20016, 20048, 17744,
+ 20080, 20112, 20144, 20176, 20176, 20208, 20240, 20176,
+ 20176, 20176, 20176, 20176, 20176, 20176, 20176, 20176,
+ 20176, 20272, 20304, 20176, 20336, 20176, 20368, 20400,
+ 20432, 20464, 20496, 20528, 20176, 20176, 20176, 20560,
+ 20592, 20624, 20656, 20688, 20720, 20752, 20784, 20816,
+
+ 20848, 20880, 20912, 9904, 20944, 20944, 20944, 20976,
+ 21008, 21040, 21072, 21104, 21136, 21168, 21200, 21232,
+ 9904, 9904, 9904, 9904, 21264, 21296, 21328, 21360,
+ 21392, 21424, 21456, 21488, 21520, 21552, 21584, 9904,
+ 21616, 21648, 21680, 21712, 21744, 21776, 9904, 9904,
21808, 21840, 21872, 21904, 9904, 9904, 9904, 9904,
- 21936, 21968, 22000, 22032, 22064, 22096, 8400, 8400,
- 22128, 22160, 8400, 8400, 22192, 22224, 8400, 8400,
- 22256, 22288, 22320, 22352, 22384, 8400, 22416, 22448,
- 22480, 22512, 22544, 22576, 22608, 22640, 8400, 8400,
- 22672, 22672, 22704, 8400, 8400, 8400, 8400, 8400,
+ 21936, 21936, 21936, 21936, 21936, 21936, 21936, 21936,
+ 21936, 21968, 22000, 22032, 9904, 9904, 9904, 9904,
+ 22064, 22096, 22128, 22160, 22192, 22224, 8400, 22256,
+ 22288, 22320, 8400, 8400, 22352, 22384, 22416, 22448,
+ 22480, 22512, 22544, 22576, 22608, 8400, 22640, 22672,
+ 22704, 22736, 22768, 22800, 22832, 22864, 8400, 8400,
+ 22896, 22896, 22928, 8400, 22960, 22992, 23024, 23056,
8400, 8400, 8400, 8400, 8400, 8400, 8400, 8400,
- 8400, 8400, 8400, 22736, 8400, 8400, 8400, 8400,
+ 8400, 8400, 8400, 23088, 8400, 8400, 8400, 8400,
8400, 8400, 8400, 8400, 8400, 8400, 8400, 8400,
- // 0x11000 - 0x110000
-
- 22768, 23024, 23280, 23536, 23792, 24048, 24304, 24560,
- 24816, 24560, 25072, 24560, 24560, 24560, 24560, 24560,
- 25328, 25328, 25328, 25584, 25840, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 26096, 26096, 26352, 26608, 26864, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 27120, 27120, 27376, 27632, 24560, 24560, 24560, 27888,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 28144, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 28400, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 28656, 28912, 29168, 29424, 29680, 29936, 30192, 30448,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 30704, 30960, 30960, 30960, 30960, 30960, 31216, 30960,
- 31472, 31728, 31984, 32240, 32496, 32752, 33008, 33264,
- 33520, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
-
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34032, 34032,
- 34032, 34032, 34032, 34032, 34032, 34032, 34288, 34544,
- 34544, 34544, 34544, 34544, 34544, 34544, 34544, 34544,
- 34544, 34544, 34544, 34544, 34544, 34544, 34544, 34800,
- 35056, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35568, 35568, 35824, 35312, 35312, 35312, 35312, 36080,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
-
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 35312,
- 35312, 35312, 35312, 35312, 35312, 35312, 35312, 36080,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 36336, 36592, 36848, 36848, 36848, 36848, 36848, 36848,
- 36848, 36848, 36848, 36848, 36848, 36848, 36848, 36848,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
-
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 24560,
- 24560, 24560, 24560, 24560, 24560, 24560, 24560, 33776,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
-
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37360,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
-
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37104,
- 37104, 37104, 37104, 37104, 37104, 37104, 37104, 37360,
+ // [0x11000..0x110000)
+
+ 23120, 23376, 23632, 23888, 24144, 24400, 24656, 24912,
+ 25168, 25424, 25680, 25424, 25424, 25424, 25424, 25424,
+ 25936, 25936, 25936, 26192, 26448, 26704, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 26960, 26960, 27216, 27472, 27728, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 27984, 28240, 28496, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 28752, 28752, 29008, 29264, 25424, 25424, 25424, 29520,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 29776, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 30032, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 30288, 30544, 30800, 31056, 31312, 31568, 31824, 32080,
+ 32336, 32336, 32592, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 32848, 33104, 33104, 33104, 33104, 33104, 33360, 33104,
+ 33616, 33872, 34128, 34384, 34640, 34896, 35152, 35408,
+ 35664, 35920, 25424, 25424, 25424, 25424, 25424, 36176,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36432, 36432,
+ 36432, 36432, 36432, 36432, 36432, 36432, 36688, 36944,
+ 36944, 36944, 36944, 36944, 36944, 36944, 36944, 36944,
+ 36944, 36944, 36944, 36944, 36944, 36944, 36944, 37200,
+ 37456, 37712, 37712, 37712, 37712, 37712, 37712, 37712,
+ 37712, 37712, 37712, 37712, 37712, 37712, 37712, 37712,
+ 37712, 37712, 37712, 37712, 37712, 37712, 37968, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38480, 38480, 38736, 38224, 38224, 38224, 38224, 38992,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38224,
+ 38224, 38224, 38224, 38224, 38224, 38224, 38224, 38992,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 39248, 39504, 39760, 39760, 39760, 39760, 39760, 39760,
+ 39760, 39760, 39760, 39760, 39760, 39760, 39760, 39760,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 25424,
+ 25424, 25424, 25424, 25424, 25424, 25424, 25424, 36176,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40272,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40016,
+ 40016, 40016, 40016, 40016, 40016, 40016, 40016, 40272,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -964,594 +964,569 @@ static const unsigned short uc_property_trie[] = {
149, 78, 78, 149, 78, 78, 78, 150,
149, 151, 152, 152, 153, 78, 78, 78,
78, 78, 154, 78, 100, 78, 78, 78,
- 78, 78, 78, 78, 78, 78, 155, 78,
+ 78, 78, 78, 78, 78, 155, 156, 78,
78, 78, 78, 78, 78, 78, 78, 78,
- 78, 156, 156, 156, 156, 156, 114, 114,
- 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 158, 158, 159, 159, 159, 159, 159,
-
- 160, 160, 42, 42, 42, 42, 158, 158,
- 161, 158, 158, 158, 161, 158, 158, 158,
- 159, 159, 42, 42, 42, 42, 42, 162,
- 52, 52, 52, 52, 52, 52, 42, 163,
-
- 157, 157, 157, 157, 157, 42, 42, 42,
- 42, 42, 164, 164, 165, 166, 167, 168,
- 168, 168, 168, 168, 168, 168, 168, 168,
- 168, 168, 168, 168, 168, 168, 168, 168,
-
- 169, 169, 169, 169, 169, 170, 169, 169,
- 169, 169, 169, 169, 169, 170, 170, 169,
- 170, 169, 170, 169, 169, 171, 172, 172,
- 172, 172, 171, 173, 172, 172, 172, 172,
-
- 172, 174, 174, 175, 175, 175, 175, 176,
- 176, 172, 172, 172, 172, 175, 175, 172,
- 175, 175, 172, 172, 177, 177, 177, 177,
- 178, 172, 172, 172, 172, 170, 170, 170,
-
- 179, 179, 169, 179, 179, 180, 181, 182,
- 182, 182, 181, 181, 181, 182, 182, 183,
- 184, 184, 184, 185, 185, 185, 185, 184,
- 186, 187, 187, 188, 189, 190, 190, 191,
-
- 192, 192, 193, 194, 194, 194, 194, 194,
- 194, 194, 194, 194, 194, 194, 194, 194,
- 195, 196, 195, 196, 197, 198, 195, 196,
- 199, 199, 200, 201, 201, 201, 202, 203,
-
- 199, 199, 199, 199, 204, 205, 206, 207,
- 208, 208, 208, 199, 209, 199, 210, 210,
- 211, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212,
-
- 212, 212, 199, 212, 212, 212, 212, 212,
- 212, 212, 213, 213, 214, 215, 215, 215,
- 216, 217, 217, 217, 217, 217, 217, 217,
- 217, 217, 217, 217, 217, 217, 217, 217,
-
- 217, 217, 218, 217, 217, 217, 217, 217,
- 217, 217, 219, 219, 220, 221, 221, 222,
- 223, 224, 225, 226, 226, 227, 228, 229,
- 230, 231, 232, 233, 232, 233, 232, 233,
-
- 232, 233, 234, 235, 234, 235, 234, 235,
- 234, 235, 234, 235, 234, 235, 234, 235,
- 236, 237, 238, 239, 240, 241, 242, 243,
- 244, 245, 243, 244, 246, 247, 247, 247,
-
- 248, 249, 250, 249, 250, 250, 250, 249,
- 250, 250, 250, 250, 249, 248, 249, 250,
- 251, 251, 251, 251, 251, 251, 251, 251,
- 251, 252, 251, 251, 251, 251, 251, 251,
-
- 251, 251, 251, 251, 251, 251, 251, 251,
- 251, 251, 251, 251, 251, 251, 251, 251,
- 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 254, 253, 253, 253, 253, 253, 253,
-
- 253, 253, 253, 253, 253, 253, 253, 253,
- 253, 253, 253, 253, 253, 253, 253, 253,
- 255, 256, 257, 256, 257, 257, 257, 256,
- 257, 257, 257, 257, 256, 255, 256, 257,
-
- 258, 259, 258, 259, 258, 259, 258, 259,
- 258, 259, 258, 259, 258, 259, 258, 259,
- 258, 259, 258, 259, 258, 259, 260, 261,
- 258, 259, 258, 259, 258, 259, 258, 259,
-
- 258, 259, 262, 263, 263, 170, 170, 264,
- 265, 265, 266, 267, 268, 269, 268, 269,
- 258, 259, 258, 259, 258, 259, 258, 259,
- 258, 259, 258, 259, 258, 259, 258, 259,
-
- 258, 259, 258, 259, 258, 259, 258, 259,
- 258, 259, 258, 259, 258, 259, 258, 259,
- 258, 259, 258, 259, 258, 259, 258, 259,
- 258, 259, 258, 259, 258, 259, 258, 259,
-
- 270, 260, 261, 258, 259, 266, 267, 258,
- 259, 266, 267, 258, 259, 266, 267, 271,
- 260, 261, 260, 261, 258, 259, 260, 261,
- 258, 259, 260, 261, 260, 261, 260, 261,
-
- 258, 259, 260, 261, 260, 261, 260, 261,
- 258, 259, 260, 261, 272, 273, 260, 261,
- 260, 261, 260, 261, 260, 261, 274, 275,
- 260, 261, 276, 277, 276, 277, 276, 277,
-
- 266, 267, 266, 267, 266, 267, 266, 267,
- 266, 267, 266, 267, 266, 267, 266, 267,
- 276, 277, 276, 277, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 278, 279,
-
- 278, 279, 278, 279, 280, 281, 282, 283,
- 284, 285, 284, 285, 284, 285, 284, 285,
- 199, 286, 286, 286, 286, 286, 286, 286,
- 286, 286, 286, 286, 286, 286, 286, 286,
-
- 286, 286, 286, 286, 286, 286, 286, 286,
- 286, 286, 286, 286, 286, 286, 286, 286,
- 286, 286, 286, 286, 286, 286, 286, 199,
- 199, 287, 288, 288, 288, 289, 288, 288,
-
- 199, 290, 290, 290, 290, 290, 290, 290,
- 290, 290, 290, 290, 290, 290, 290, 290,
- 290, 290, 290, 290, 290, 290, 290, 290,
- 290, 290, 290, 290, 290, 290, 290, 290,
-
- 290, 290, 290, 290, 290, 290, 290, 291,
- 199, 292, 293, 199, 199, 294, 294, 295,
- 296, 297, 298, 298, 298, 298, 297, 298,
- 298, 298, 299, 297, 298, 298, 298, 298,
-
- 298, 298, 300, 297, 297, 297, 297, 297,
- 298, 298, 297, 298, 298, 299, 301, 298,
- 302, 303, 304, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, 317,
-
- 318, 319, 320, 318, 298, 300, 321, 322,
- 296, 296, 296, 296, 296, 296, 296, 296,
- 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, 296, 296, 296, 296, 296,
- 323, 323, 323, 324, 325, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
-
- 326, 326, 326, 326, 327, 328, 329, 329,
- 330, 331, 331, 332, 19, 333, 334, 334,
- 335, 335, 335, 335, 335, 335, 336, 336,
- 337, 338, 339, 340, 341, 342, 343, 344,
-
- 345, 346, 347, 347, 347, 347, 348, 349,
- 350, 349, 350, 350, 350, 350, 350, 349,
- 349, 349, 349, 350, 350, 350, 350, 350,
+ 78, 157, 157, 157, 157, 157, 114, 114,
+ 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 159, 159, 160, 160, 160, 160, 160,
+
+ 161, 161, 42, 42, 42, 42, 159, 159,
+ 162, 159, 159, 159, 162, 159, 159, 159,
+ 160, 160, 42, 42, 42, 42, 42, 163,
+ 52, 52, 52, 52, 52, 52, 42, 164,
+
+ 158, 158, 158, 158, 158, 42, 42, 42,
+ 42, 42, 165, 165, 166, 167, 168, 169,
+ 169, 169, 169, 169, 169, 169, 169, 169,
+ 169, 169, 169, 169, 169, 169, 169, 169,
+
+ 170, 170, 170, 170, 170, 171, 170, 170,
+ 170, 170, 170, 170, 170, 171, 171, 170,
+ 171, 170, 171, 170, 170, 172, 173, 173,
+ 173, 173, 172, 174, 173, 173, 173, 173,
+
+ 173, 175, 175, 176, 176, 176, 176, 177,
+ 177, 173, 173, 173, 173, 176, 176, 173,
+ 176, 176, 173, 173, 178, 178, 178, 178,
+ 179, 173, 173, 173, 173, 171, 171, 171,
+
+ 180, 180, 170, 180, 180, 181, 182, 183,
+ 183, 183, 182, 182, 182, 183, 183, 184,
+ 185, 185, 185, 186, 186, 186, 186, 185,
+ 187, 188, 188, 189, 190, 191, 191, 192,
+
+ 193, 193, 194, 195, 195, 195, 195, 195,
+ 195, 195, 195, 195, 195, 195, 195, 195,
+ 196, 197, 196, 197, 198, 199, 196, 197,
+ 200, 200, 201, 202, 202, 202, 203, 204,
+
+ 200, 200, 200, 200, 205, 206, 207, 208,
+ 209, 209, 209, 200, 210, 200, 211, 211,
+ 212, 213, 213, 213, 213, 213, 213, 213,
+ 213, 213, 213, 213, 213, 213, 213, 213,
+
+ 213, 213, 200, 213, 213, 213, 213, 213,
+ 213, 213, 214, 214, 215, 216, 216, 216,
+ 217, 218, 218, 218, 218, 218, 218, 218,
+ 218, 218, 218, 218, 218, 218, 218, 218,
+
+ 218, 218, 219, 218, 218, 218, 218, 218,
+ 218, 218, 220, 220, 221, 222, 222, 223,
+ 224, 225, 226, 227, 227, 228, 229, 230,
+ 231, 232, 233, 234, 233, 234, 233, 234,
+
+ 233, 234, 235, 236, 235, 236, 235, 236,
+ 235, 236, 235, 236, 235, 236, 235, 236,
+ 237, 238, 239, 240, 241, 242, 243, 244,
+ 245, 246, 244, 245, 247, 248, 248, 248,
+
+ 249, 250, 251, 250, 251, 251, 251, 250,
+ 251, 251, 251, 251, 250, 249, 250, 251,
+ 252, 252, 252, 252, 252, 252, 252, 252,
+ 252, 253, 252, 252, 252, 252, 252, 252,
+
+ 252, 252, 252, 252, 252, 252, 252, 252,
+ 252, 252, 252, 252, 252, 252, 252, 252,
+ 254, 254, 254, 254, 254, 254, 254, 254,
+ 254, 255, 254, 254, 254, 254, 254, 254,
+
+ 254, 254, 254, 254, 254, 254, 254, 254,
+ 254, 254, 254, 254, 254, 254, 254, 254,
+ 256, 257, 258, 257, 258, 258, 258, 257,
+ 258, 258, 258, 258, 257, 256, 257, 258,
+
+ 259, 260, 259, 260, 259, 260, 259, 260,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+ 259, 260, 259, 260, 259, 260, 261, 262,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+
+ 259, 260, 263, 264, 264, 171, 171, 265,
+ 266, 266, 267, 268, 269, 270, 269, 270,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+
+ 259, 260, 259, 260, 259, 260, 259, 260,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+ 259, 260, 259, 260, 259, 260, 259, 260,
+
+ 271, 261, 262, 259, 260, 267, 268, 259,
+ 260, 267, 268, 259, 260, 267, 268, 272,
+ 261, 262, 261, 262, 259, 260, 261, 262,
+ 259, 260, 261, 262, 261, 262, 261, 262,
+
+ 259, 260, 261, 262, 261, 262, 261, 262,
+ 259, 260, 261, 262, 273, 274, 261, 262,
+ 261, 262, 261, 262, 261, 262, 275, 276,
+ 261, 262, 277, 278, 277, 278, 277, 278,
+
+ 267, 268, 267, 268, 267, 268, 267, 268,
+ 267, 268, 267, 268, 267, 268, 267, 268,
+ 277, 278, 277, 278, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 279, 280,
+
+ 279, 280, 279, 280, 281, 282, 283, 284,
+ 285, 286, 285, 286, 285, 286, 285, 286,
+ 200, 287, 287, 287, 287, 287, 287, 287,
+ 287, 287, 287, 287, 287, 287, 287, 287,
+
+ 287, 287, 287, 287, 287, 287, 287, 287,
+ 287, 287, 287, 287, 287, 287, 287, 287,
+ 287, 287, 287, 287, 287, 287, 287, 200,
+ 200, 288, 289, 289, 289, 290, 289, 289,
+
+ 200, 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, 292,
+ 200, 293, 294, 200, 200, 295, 295, 296,
+ 297, 298, 299, 299, 299, 299, 298, 299,
+ 299, 299, 300, 298, 299, 299, 299, 299,
+
+ 299, 299, 301, 298, 298, 298, 298, 298,
+ 299, 299, 298, 299, 299, 300, 302, 299,
+ 303, 304, 305, 306, 307, 308, 309, 310,
+ 311, 312, 313, 314, 315, 316, 317, 318,
+
+ 319, 320, 321, 319, 299, 301, 322, 323,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 324, 324, 324, 324, 324, 324, 324, 324,
+ 324, 324, 324, 324, 324, 324, 324, 324,
+
+ 324, 324, 324, 324, 324, 324, 324, 324,
+ 324, 324, 324, 297, 297, 297, 297, 297,
+ 324, 324, 324, 325, 326, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 327, 327, 327, 327, 328, 329, 330, 330,
+ 331, 332, 332, 333, 19, 334, 335, 335,
+ 336, 336, 336, 336, 336, 336, 337, 337,
+ 338, 339, 340, 341, 342, 343, 344, 345,
+
+ 346, 347, 348, 348, 348, 348, 349, 350,
+ 351, 350, 351, 351, 351, 351, 351, 350,
350, 350, 350, 351, 351, 351, 351, 351,
+ 351, 351, 351, 352, 352, 352, 352, 352,
- 352, 350, 350, 350, 350, 350, 350, 350,
- 349, 350, 350, 353, 354, 355, 356, 357,
- 358, 359, 360, 361, 361, 362, 363, 335,
- 335, 364, 364, 364, 365, 364, 364, 366,
+ 353, 351, 351, 351, 351, 351, 351, 351,
+ 350, 351, 351, 354, 355, 356, 357, 358,
+ 359, 360, 361, 362, 362, 363, 364, 336,
+ 336, 365, 365, 365, 366, 365, 365, 367,
- 367, 368, 369, 370, 371, 372, 373, 374,
- 375, 376, 377, 378, 379, 380, 381, 381,
- 382, 349, 349, 349, 346, 383, 383, 383,
- 384, 350, 350, 350, 350, 350, 350, 350,
+ 368, 369, 370, 371, 372, 373, 374, 375,
+ 376, 377, 378, 379, 380, 381, 382, 382,
+ 383, 350, 350, 350, 347, 384, 384, 384,
+ 385, 351, 351, 351, 351, 351, 351, 351,
- 350, 350, 350, 350, 350, 350, 350, 350,
- 349, 349, 349, 349, 349, 349, 349, 349,
- 349, 349, 349, 349, 349, 349, 349, 349,
- 349, 349, 350, 350, 350, 350, 350, 350,
-
- 350, 350, 350, 350, 350, 350, 350, 350,
+ 351, 351, 351, 351, 351, 351, 351, 351,
350, 350, 350, 350, 350, 350, 350, 350,
350, 350, 350, 350, 350, 350, 350, 350,
- 385, 385, 350, 350, 350, 350, 350, 385,
-
- 347, 350, 348, 349, 349, 349, 349, 349,
- 349, 349, 349, 349, 350, 349, 350, 386,
- 350, 350, 349, 347, 387, 349, 388, 388,
- 388, 388, 388, 388, 388, 389, 390, 388,
-
- 388, 388, 388, 391, 388, 392, 392, 388,
- 388, 390, 391, 388, 388, 391, 393, 393,
- 394, 395, 396, 397, 398, 399, 400, 401,
- 402, 403, 385, 385, 385, 404, 404, 405,
-
- 406, 406, 406, 407, 407, 407, 407, 407,
- 407, 407, 407, 407, 407, 407, 342, 408,
- 409, 410, 411, 411, 411, 409, 409, 409,
- 409, 409, 411, 411, 411, 411, 409, 411,
-
- 411, 411, 411, 411, 411, 411, 411, 411,
- 409, 411, 409, 411, 409, 412, 412, 413,
- 414, 415, 414, 414, 415, 414, 414, 415,
- 415, 415, 414, 415, 415, 414, 415, 414,
-
- 414, 414, 415, 414, 415, 414, 415, 414,
- 415, 414, 414, 342, 342, 413, 412, 412,
- 416, 416, 416, 416, 416, 416, 416, 416,
- 416, 417, 417, 417, 416, 416, 416, 416,
-
- 416, 416, 416, 416, 416, 416, 416, 416,
- 416, 416, 416, 417, 417, 416, 351, 351,
- 351, 418, 351, 418, 418, 351, 351, 351,
- 418, 418, 351, 351, 351, 351, 351, 351,
-
- 419, 419, 419, 419, 419, 419, 419, 419,
- 419, 419, 419, 419, 419, 419, 419, 419,
- 419, 419, 419, 419, 419, 419, 419, 419,
- 419, 419, 419, 419, 419, 419, 419, 419,
-
- 419, 419, 419, 419, 419, 419, 420, 420,
+ 350, 350, 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,
+ 386, 386, 351, 351, 351, 351, 351, 386,
+
+ 348, 351, 349, 350, 350, 350, 350, 350,
+ 350, 350, 350, 350, 351, 350, 351, 387,
+ 351, 351, 350, 348, 388, 350, 389, 389,
+ 389, 389, 389, 389, 389, 390, 391, 389,
+
+ 389, 389, 389, 392, 389, 393, 393, 389,
+ 389, 391, 392, 389, 389, 392, 394, 394,
+ 395, 396, 397, 398, 399, 400, 401, 402,
+ 403, 404, 386, 386, 386, 405, 405, 406,
+
+ 407, 407, 407, 408, 408, 408, 408, 408,
+ 408, 408, 408, 408, 408, 408, 343, 409,
+ 410, 411, 412, 412, 412, 410, 410, 410,
+ 410, 410, 412, 412, 412, 412, 410, 412,
+
+ 412, 412, 412, 412, 412, 412, 412, 412,
+ 410, 412, 410, 412, 410, 413, 413, 414,
+ 415, 416, 415, 415, 416, 415, 415, 416,
+ 416, 416, 415, 416, 416, 415, 416, 415,
+
+ 415, 415, 416, 415, 416, 415, 416, 415,
+ 416, 415, 415, 343, 343, 414, 413, 413,
+ 417, 417, 417, 417, 417, 417, 417, 417,
+ 417, 418, 418, 418, 417, 417, 417, 417,
+
+ 417, 417, 417, 417, 417, 417, 417, 417,
+ 417, 417, 417, 418, 418, 417, 352, 352,
+ 352, 419, 352, 419, 419, 352, 352, 352,
+ 419, 419, 352, 352, 352, 352, 352, 352,
+
+ 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, 420, 420,
- 420, 421, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
-
- 422, 423, 424, 425, 426, 427, 428, 429,
- 430, 431, 432, 432, 432, 432, 432, 432,
- 432, 432, 432, 432, 432, 432, 432, 432,
- 432, 432, 432, 432, 432, 432, 432, 432,
-
- 432, 432, 432, 432, 432, 432, 432, 432,
- 432, 432, 432, 433, 433, 433, 433, 433,
- 433, 433, 434, 433, 435, 435, 436, 437,
- 438, 439, 440, 296, 296, 296, 296, 296,
-
- 441, 441, 441, 441, 441, 441, 441, 441,
- 441, 441, 441, 441, 441, 441, 441, 441,
- 441, 441, 441, 441, 441, 441, 442, 442,
- 442, 442, 443, 442, 442, 442, 442, 442,
-
- 442, 442, 442, 442, 443, 442, 442, 442,
- 443, 442, 442, 442, 442, 442, 296, 296,
- 444, 444, 444, 444, 444, 444, 444, 444,
- 444, 444, 444, 444, 444, 444, 444, 296,
-
- 445, 446, 446, 446, 446, 446, 445, 446,
- 446, 445, 446, 446, 446, 446, 446, 445,
- 446, 446, 446, 446, 445, 446, 447, 447,
- 447, 448, 448, 448, 296, 296, 449, 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,
-
- 450, 451, 450, 450, 450, 450, 450, 450,
- 450, 450, 452, 452, 452, 453, 454, 451,
- 451, 454, 454, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
-
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
-
- 342, 342, 342, 342, 455, 455, 456, 455,
- 455, 456, 455, 455, 455, 456, 456, 456,
- 457, 458, 459, 455, 455, 455, 456, 455,
- 455, 456, 456, 455, 455, 455, 455, 460,
-
- 461, 462, 462, 463, 464, 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, 466, 465, 465, 465, 465, 465, 465,
- 465, 466, 465, 465, 466, 465, 465, 465,
- 465, 465, 467, 468, 469, 465, 463, 463,
-
- 463, 462, 462, 462, 462, 462, 462, 462,
- 462, 463, 463, 463, 463, 470, 471, 468,
- 465, 170, 172, 472, 472, 461, 467, 467,
- 473, 473, 473, 473, 473, 473, 473, 473,
-
- 465, 465, 462, 462, 474, 474, 475, 476,
- 477, 478, 479, 480, 481, 482, 483, 484,
- 485, 486, 487, 488, 488, 488, 488, 488,
- 489, 490, 490, 491, 491, 492, 491, 491,
-
- 493, 494, 495, 495, 199, 496, 496, 496,
- 496, 496, 496, 496, 496, 199, 199, 496,
- 496, 199, 199, 496, 496, 496, 496, 496,
- 496, 496, 496, 496, 496, 496, 496, 496,
-
- 496, 496, 496, 496, 496, 496, 496, 496,
- 496, 199, 496, 496, 496, 496, 496, 496,
- 496, 199, 496, 199, 199, 199, 496, 496,
- 496, 496, 199, 199, 497, 498, 499, 495,
-
- 495, 494, 494, 494, 494, 199, 199, 495,
- 495, 199, 199, 500, 500, 501, 502, 199,
- 199, 199, 199, 199, 199, 199, 199, 499,
- 199, 199, 199, 199, 503, 503, 199, 503,
-
- 496, 496, 494, 494, 199, 199, 504, 505,
- 506, 507, 508, 509, 510, 511, 512, 513,
- 496, 496, 514, 514, 515, 515, 515, 515,
- 515, 516, 517, 518, 199, 199, 199, 199,
-
- 199, 519, 520, 521, 199, 522, 522, 522,
- 522, 522, 522, 199, 199, 199, 199, 522,
- 522, 199, 199, 522, 522, 522, 522, 522,
- 522, 522, 522, 522, 522, 522, 522, 522,
-
- 522, 522, 522, 522, 522, 522, 522, 522,
- 522, 199, 522, 522, 522, 522, 522, 522,
- 522, 199, 522, 523, 199, 522, 523, 199,
- 522, 522, 199, 199, 524, 199, 525, 525,
-
- 525, 520, 520, 199, 199, 199, 199, 520,
- 520, 199, 199, 520, 520, 526, 199, 199,
- 199, 527, 199, 199, 199, 199, 199, 199,
- 199, 523, 523, 523, 522, 199, 523, 199,
-
- 199, 199, 199, 199, 199, 199, 528, 529,
- 530, 531, 532, 533, 534, 535, 536, 537,
- 520, 520, 522, 522, 522, 527, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 538, 538, 539, 199, 540, 540, 540,
- 540, 540, 540, 540, 541, 540, 199, 540,
- 540, 540, 199, 540, 540, 540, 540, 540,
- 540, 540, 540, 540, 540, 540, 540, 540,
-
- 540, 540, 540, 540, 540, 540, 540, 540,
- 540, 199, 540, 540, 540, 540, 540, 540,
- 540, 199, 540, 540, 199, 540, 540, 540,
- 540, 540, 199, 199, 542, 540, 539, 539,
-
- 539, 538, 538, 538, 538, 538, 199, 538,
- 538, 539, 199, 539, 539, 543, 199, 199,
- 540, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 540, 541, 544, 544, 199, 199, 545, 546,
- 547, 548, 549, 550, 551, 552, 553, 554,
- 555, 556, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 557, 558, 558, 199, 559, 559, 559,
- 559, 559, 559, 559, 559, 199, 199, 559,
- 559, 199, 199, 559, 559, 559, 559, 559,
- 559, 559, 559, 559, 559, 559, 559, 559,
-
- 559, 559, 559, 559, 559, 559, 559, 559,
- 559, 199, 559, 559, 559, 559, 559, 559,
- 559, 199, 559, 559, 199, 560, 559, 559,
- 559, 559, 199, 199, 561, 559, 562, 557,
-
- 558, 557, 557, 557, 563, 199, 199, 558,
- 564, 199, 199, 564, 564, 565, 199, 199,
- 199, 199, 199, 199, 199, 199, 566, 562,
- 199, 199, 199, 199, 567, 567, 199, 559,
-
- 559, 559, 563, 563, 199, 199, 568, 569,
- 570, 571, 572, 573, 574, 575, 576, 577,
- 578, 560, 579, 579, 579, 579, 579, 579,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 199, 580, 581, 199, 581, 581, 581,
- 581, 581, 581, 199, 199, 199, 581, 581,
- 581, 199, 581, 581, 582, 581, 199, 199,
- 199, 581, 581, 199, 581, 199, 581, 581,
-
- 199, 199, 199, 581, 581, 199, 199, 199,
- 581, 581, 581, 199, 199, 199, 581, 581,
- 581, 581, 581, 581, 581, 581, 583, 581,
- 581, 581, 199, 199, 199, 199, 584, 585,
-
- 580, 585, 585, 199, 199, 199, 585, 585,
- 585, 199, 586, 586, 586, 587, 199, 199,
- 588, 199, 199, 199, 199, 199, 199, 584,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 199, 199, 199, 199, 199, 589, 590,
- 591, 592, 593, 594, 595, 596, 597, 598,
- 599, 599, 599, 600, 600, 600, 600, 600,
- 600, 601, 600, 199, 199, 199, 199, 199,
-
- 602, 603, 603, 603, 199, 604, 604, 604,
- 604, 604, 604, 604, 604, 199, 604, 604,
- 604, 199, 604, 604, 604, 604, 604, 604,
- 604, 604, 604, 604, 604, 604, 604, 604,
-
- 604, 604, 604, 604, 604, 604, 604, 604,
- 604, 199, 604, 604, 604, 604, 604, 604,
- 604, 604, 604, 604, 605, 604, 604, 604,
- 604, 604, 199, 199, 199, 606, 607, 607,
-
- 607, 603, 603, 603, 603, 199, 607, 607,
- 608, 199, 607, 607, 607, 609, 199, 199,
- 199, 199, 199, 199, 199, 610, 611, 199,
- 606, 606, 199, 199, 199, 199, 199, 199,
-
- 604, 604, 612, 612, 199, 199, 613, 614,
- 615, 616, 617, 618, 619, 620, 621, 622,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 623, 623, 623, 623, 623, 623, 623, 624,
-
- 199, 625, 626, 626, 199, 627, 627, 627,
- 627, 627, 627, 627, 627, 199, 627, 627,
- 627, 199, 627, 627, 627, 627, 627, 627,
- 627, 627, 627, 627, 627, 627, 627, 627,
-
- 627, 627, 627, 627, 627, 627, 627, 627,
- 627, 199, 627, 627, 627, 627, 627, 627,
- 627, 627, 627, 627, 199, 627, 627, 627,
- 627, 627, 199, 199, 628, 629, 626, 630,
-
- 631, 626, 632, 626, 626, 199, 630, 631,
- 631, 199, 631, 631, 633, 634, 199, 199,
- 199, 199, 199, 199, 199, 632, 632, 199,
- 199, 199, 199, 199, 199, 199, 627, 199,
-
- 627, 627, 635, 635, 199, 199, 636, 637,
- 638, 639, 640, 641, 642, 643, 644, 645,
- 199, 646, 646, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 647, 648, 648, 199, 649, 649, 649,
- 649, 649, 649, 649, 649, 199, 649, 649,
- 649, 199, 649, 649, 649, 649, 649, 649,
- 649, 649, 649, 649, 649, 649, 649, 649,
-
- 649, 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, 650, 199, 199, 651, 652, 648,
-
- 648, 653, 653, 653, 654, 199, 648, 648,
- 648, 199, 655, 655, 655, 656, 650, 199,
- 199, 199, 199, 199, 199, 199, 199, 652,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 649, 649, 654, 654, 199, 199, 657, 658,
- 659, 660, 661, 662, 663, 664, 665, 666,
- 667, 667, 667, 667, 667, 667, 199, 199,
- 199, 668, 651, 651, 651, 651, 651, 651,
-
- 199, 199, 669, 669, 199, 670, 670, 670,
- 670, 670, 670, 670, 670, 670, 670, 670,
- 670, 670, 670, 670, 670, 670, 670, 199,
- 199, 199, 670, 670, 670, 670, 670, 670,
-
- 670, 670, 670, 670, 670, 670, 670, 670,
- 670, 670, 670, 670, 670, 670, 670, 670,
- 670, 670, 199, 670, 670, 670, 670, 670,
- 670, 670, 670, 670, 199, 670, 199, 199,
-
- 670, 670, 670, 670, 670, 670, 670, 199,
- 199, 199, 671, 199, 199, 199, 199, 672,
- 669, 669, 673, 673, 673, 199, 673, 199,
- 669, 669, 674, 669, 674, 674, 674, 672,
-
- 199, 199, 199, 199, 199, 199, 675, 676,
- 677, 678, 679, 680, 681, 682, 683, 684,
- 199, 199, 669, 669, 685, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 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, 686, 688, 687, 687, 687, 687,
- 689, 689, 690, 199, 199, 199, 199, 12,
-
- 686, 686, 686, 686, 686, 686, 691, 687,
- 692, 692, 692, 692, 687, 687, 687, 693,
- 694, 695, 696, 697, 698, 699, 700, 701,
- 702, 703, 704, 704, 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, 199, 199, 199, 199, 199,
-
- 199, 705, 705, 199, 705, 199, 199, 705,
- 705, 199, 705, 199, 199, 705, 199, 199,
- 199, 199, 199, 199, 705, 705, 705, 705,
- 199, 705, 705, 705, 705, 705, 705, 705,
-
- 199, 705, 705, 705, 199, 705, 199, 705,
- 199, 199, 705, 705, 199, 705, 705, 705,
- 705, 706, 705, 707, 706, 706, 706, 706,
- 708, 708, 199, 706, 706, 705, 199, 199,
-
- 705, 705, 705, 705, 705, 199, 709, 199,
- 710, 710, 710, 710, 706, 706, 199, 199,
- 711, 712, 713, 714, 715, 716, 717, 718,
- 719, 720, 199, 199, 721, 721, 722, 722,
-
- 723, 724, 724, 724, 725, 726, 725, 725,
- 727, 725, 725, 728, 729, 730, 730, 730,
- 730, 730, 727, 731, 730, 731, 731, 731,
- 732, 732, 731, 731, 731, 731, 731, 731,
-
- 733, 734, 735, 736, 737, 738, 739, 740,
- 741, 742, 743, 743, 743, 743, 743, 743,
- 743, 743, 743, 743, 744, 732, 731, 732,
- 731, 745, 746, 747, 746, 747, 748, 748,
-
- 723, 723, 723, 749, 723, 723, 723, 723,
- 199, 723, 723, 723, 723, 749, 723, 723,
- 723, 723, 749, 723, 723, 723, 723, 749,
- 723, 723, 723, 723, 749, 723, 723, 723,
-
- 723, 723, 723, 723, 723, 723, 723, 723,
- 723, 749, 750, 751, 751, 199, 199, 199,
- 199, 752, 753, 754, 755, 754, 754, 756,
- 754, 756, 753, 753, 753, 753, 757, 758,
-
- 753, 754, 759, 759, 760, 728, 759, 759,
- 723, 723, 723, 723, 761, 762, 762, 762,
- 757, 757, 757, 754, 757, 757, 763, 757,
- 199, 757, 757, 757, 757, 754, 757, 757,
-
- 757, 757, 754, 757, 757, 757, 757, 754,
- 757, 757, 757, 757, 754, 757, 763, 763,
- 763, 757, 757, 757, 757, 757, 757, 757,
- 763, 754, 763, 763, 763, 199, 764, 764,
-
- 765, 765, 765, 765, 765, 765, 766, 765,
- 765, 765, 765, 765, 765, 199, 767, 765,
- 768, 768, 769, 770, 771, 772, 772, 772,
- 772, 773, 773, 199, 199, 199, 199, 199,
-
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
-
- 774, 774, 775, 774, 774, 774, 776, 774,
- 775, 774, 774, 777, 778, 779, 780, 779,
- 779, 781, 779, 782, 782, 782, 779, 783,
- 778, 784, 785, 786, 786, 782, 782, 775,
-
- 787, 788, 789, 790, 791, 792, 793, 794,
- 795, 796, 797, 797, 798, 798, 798, 798,
- 774, 774, 774, 774, 774, 774, 781, 781,
- 779, 779, 775, 775, 775, 775, 782, 782,
-
- 782, 775, 777, 777, 777, 775, 775, 777,
- 777, 777, 777, 777, 777, 777, 775, 775,
- 775, 782, 782, 782, 782, 775, 775, 775,
- 775, 775, 775, 775, 775, 775, 775, 775,
-
- 775, 775, 782, 777, 786, 782, 782, 777,
- 777, 777, 777, 777, 777, 799, 775, 777,
- 800, 801, 802, 803, 804, 805, 806, 807,
- 808, 809, 810, 810, 810, 811, 812, 812,
-
- 813, 813, 813, 813, 813, 813, 813, 813,
- 813, 813, 813, 813, 813, 813, 813, 813,
- 813, 813, 813, 813, 813, 813, 813, 813,
- 813, 813, 813, 813, 813, 813, 813, 813,
-
- 813, 813, 813, 813, 813, 813, 199, 814,
- 199, 199, 199, 199, 199, 814, 199, 199,
- 815, 815, 815, 815, 815, 815, 815, 815,
- 815, 815, 815, 815, 815, 815, 815, 815,
-
- 815, 815, 815, 815, 815, 815, 815, 815,
- 815, 815, 815, 815, 815, 815, 815, 815,
- 815, 815, 815, 815, 815, 815, 815, 816,
- 816, 817, 817, 818, 819, 820, 820, 820,
- 821, 821, 821, 821, 821, 821, 821, 821,
- 821, 821, 821, 821, 821, 821, 821, 821,
+ 420, 420, 420, 420, 420, 420, 421, 421,
+ 421, 421, 421, 421, 421, 421, 421, 421,
+ 421, 422, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 343, 343, 343, 343, 343,
+
+ 423, 424, 425, 426, 427, 428, 429, 430,
+ 431, 432, 433, 433, 433, 433, 433, 433,
+ 433, 433, 433, 433, 433, 433, 433, 433,
+ 433, 433, 433, 433, 433, 433, 433, 433,
+
+ 433, 433, 433, 433, 433, 433, 433, 433,
+ 433, 433, 433, 434, 434, 434, 434, 434,
+ 434, 434, 435, 434, 436, 436, 437, 438,
+ 439, 440, 441, 297, 297, 297, 297, 297,
+
+ 442, 442, 442, 442, 442, 442, 442, 442,
+ 442, 442, 442, 442, 442, 442, 442, 442,
+ 442, 442, 442, 442, 442, 442, 443, 443,
+ 443, 443, 444, 443, 443, 443, 443, 443,
+
+ 443, 443, 443, 443, 444, 443, 443, 443,
+ 444, 443, 443, 443, 443, 443, 297, 297,
+ 445, 445, 445, 445, 445, 445, 445, 445,
+ 445, 445, 445, 445, 445, 445, 445, 297,
+
+ 446, 447, 447, 447, 447, 447, 446, 446,
+ 447, 446, 447, 447, 447, 447, 447, 447,
+ 447, 447, 447, 447, 446, 447, 448, 448,
+ 448, 449, 449, 449, 297, 297, 450, 297,
+
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 451, 452, 451, 451, 451, 451, 451, 451,
+ 451, 451, 453, 453, 453, 454, 455, 452,
+ 452, 455, 455, 456, 456, 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, 457, 458, 458, 459, 458,
+ 458, 459, 458, 458, 458, 459, 459, 459,
+ 460, 461, 462, 458, 458, 458, 459, 458,
+ 458, 459, 459, 458, 458, 458, 458, 463,
+
+ 464, 465, 465, 466, 467, 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, 469, 468, 468, 468, 468, 468, 468,
+ 468, 469, 468, 468, 469, 468, 468, 468,
+ 468, 468, 470, 471, 472, 468, 466, 466,
+
+ 466, 465, 465, 465, 465, 465, 465, 465,
+ 465, 466, 466, 466, 466, 473, 474, 471,
+ 468, 171, 173, 475, 475, 464, 470, 470,
+ 476, 476, 476, 476, 476, 476, 476, 476,
+
+ 468, 468, 465, 465, 477, 477, 478, 479,
+ 480, 481, 482, 483, 484, 485, 486, 487,
+ 488, 489, 490, 491, 491, 491, 491, 491,
+ 492, 493, 493, 494, 494, 495, 494, 494,
+
+ 496, 497, 498, 498, 200, 499, 499, 499,
+ 499, 499, 499, 499, 499, 200, 200, 499,
+ 499, 200, 200, 499, 499, 499, 499, 499,
+ 499, 499, 499, 499, 499, 499, 499, 499,
+
+ 499, 499, 499, 499, 499, 499, 499, 499,
+ 499, 200, 499, 499, 499, 499, 499, 499,
+ 499, 200, 499, 200, 200, 200, 499, 499,
+ 499, 499, 200, 200, 500, 501, 502, 498,
+
+ 498, 497, 497, 497, 497, 200, 200, 498,
+ 498, 200, 200, 503, 503, 504, 505, 200,
+ 200, 200, 200, 200, 200, 200, 200, 502,
+ 200, 200, 200, 200, 506, 506, 200, 506,
+
+ 499, 499, 497, 497, 200, 200, 507, 508,
+ 509, 510, 511, 512, 513, 514, 515, 516,
+ 499, 499, 517, 517, 518, 518, 518, 518,
+ 518, 519, 520, 521, 200, 200, 200, 200,
+
+ 200, 522, 523, 524, 200, 525, 525, 525,
+ 525, 525, 525, 200, 200, 200, 200, 525,
+ 525, 200, 200, 525, 525, 525, 525, 525,
+ 525, 525, 525, 525, 525, 525, 525, 525,
+
+ 525, 525, 525, 525, 525, 525, 525, 525,
+ 525, 200, 525, 525, 525, 525, 525, 525,
+ 525, 200, 525, 526, 200, 525, 526, 200,
+ 525, 525, 200, 200, 527, 200, 528, 528,
+
+ 528, 523, 523, 200, 200, 200, 200, 523,
+ 523, 200, 200, 523, 523, 529, 200, 200,
+ 200, 530, 200, 200, 200, 200, 200, 200,
+ 200, 526, 526, 526, 525, 200, 526, 200,
+
+ 200, 200, 200, 200, 200, 200, 531, 532,
+ 533, 534, 535, 536, 537, 538, 539, 540,
+ 523, 523, 525, 525, 525, 530, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 541, 541, 542, 200, 543, 543, 543,
+ 543, 543, 543, 543, 544, 543, 200, 543,
+ 543, 543, 200, 543, 543, 543, 543, 543,
+ 543, 543, 543, 543, 543, 543, 543, 543,
+
+ 543, 543, 543, 543, 543, 543, 543, 543,
+ 543, 200, 543, 543, 543, 543, 543, 543,
+ 543, 200, 543, 543, 200, 543, 543, 543,
+ 543, 543, 200, 200, 545, 543, 542, 542,
+
+ 542, 541, 541, 541, 541, 541, 200, 541,
+ 541, 542, 200, 542, 542, 546, 200, 200,
+ 543, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 543, 544, 547, 547, 200, 200, 548, 549,
+ 550, 551, 552, 553, 554, 555, 556, 557,
+ 558, 559, 200, 200, 200, 200, 200, 200,
+ 200, 560, 200, 200, 200, 200, 200, 200,
+
+ 200, 561, 562, 562, 200, 563, 563, 563,
+ 563, 563, 563, 563, 563, 200, 200, 563,
+ 563, 200, 200, 563, 563, 563, 563, 563,
+ 563, 563, 563, 563, 563, 563, 563, 563,
+
+ 563, 563, 563, 563, 563, 563, 563, 563,
+ 563, 200, 563, 563, 563, 563, 563, 563,
+ 563, 200, 563, 563, 200, 564, 563, 563,
+ 563, 563, 200, 200, 565, 563, 566, 561,
+
+ 562, 561, 561, 561, 567, 200, 200, 562,
+ 568, 200, 200, 568, 568, 569, 200, 200,
+ 200, 200, 200, 200, 200, 200, 570, 566,
+ 200, 200, 200, 200, 571, 571, 200, 563,
+
+ 563, 563, 567, 567, 200, 200, 572, 573,
+ 574, 575, 576, 577, 578, 579, 580, 581,
+ 582, 564, 583, 583, 583, 583, 583, 583,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 584, 585, 200, 585, 585, 585,
+ 585, 585, 585, 200, 200, 200, 585, 585,
+ 585, 200, 585, 585, 586, 585, 200, 200,
+ 200, 585, 585, 200, 585, 200, 585, 585,
+
+ 200, 200, 200, 585, 585, 200, 200, 200,
+ 585, 585, 585, 200, 200, 200, 585, 585,
+ 585, 585, 585, 585, 585, 585, 587, 585,
+ 585, 585, 200, 200, 200, 200, 588, 589,
+
+ 584, 589, 589, 200, 200, 200, 589, 589,
+ 589, 200, 590, 590, 590, 591, 200, 200,
+ 592, 200, 200, 200, 200, 200, 200, 588,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 593, 594,
+ 595, 596, 597, 598, 599, 600, 601, 602,
+ 603, 603, 603, 604, 604, 604, 604, 604,
+ 604, 605, 604, 200, 200, 200, 200, 200,
+
+ 606, 607, 607, 607, 200, 608, 608, 608,
+ 608, 608, 608, 608, 608, 200, 608, 608,
+ 608, 200, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 608, 608, 608, 608,
+
+ 608, 608, 608, 608, 608, 608, 608, 608,
+ 608, 200, 608, 608, 608, 608, 608, 608,
+ 608, 608, 608, 608, 609, 608, 608, 608,
+ 608, 608, 200, 200, 200, 610, 611, 611,
+
+ 611, 607, 607, 607, 607, 200, 611, 611,
+ 612, 200, 611, 611, 611, 613, 200, 200,
+ 200, 200, 200, 200, 200, 614, 615, 200,
+ 610, 610, 616, 200, 200, 200, 200, 200,
+
+ 608, 608, 617, 617, 200, 200, 618, 619,
+ 620, 621, 622, 623, 624, 625, 626, 627,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 628, 628, 628, 628, 628, 628, 628, 629,
+
+ 200, 630, 631, 631, 200, 632, 632, 632,
+ 632, 632, 632, 632, 632, 200, 632, 632,
+ 632, 200, 632, 632, 632, 632, 632, 632,
+ 632, 632, 632, 632, 632, 632, 632, 632,
+
+ 632, 632, 632, 632, 632, 632, 632, 632,
+ 632, 200, 632, 632, 632, 632, 632, 632,
+ 632, 632, 632, 632, 200, 632, 632, 632,
+ 632, 632, 200, 200, 633, 634, 631, 635,
+
+ 636, 631, 637, 631, 631, 200, 635, 636,
+ 636, 200, 636, 636, 638, 639, 200, 200,
+ 200, 200, 200, 200, 200, 637, 637, 200,
+ 200, 200, 200, 200, 200, 200, 632, 200,
+
+ 632, 632, 640, 640, 200, 200, 641, 642,
+ 643, 644, 645, 646, 647, 648, 649, 650,
+ 200, 651, 651, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 652, 653, 653, 200, 654, 654, 654,
+ 654, 654, 654, 654, 654, 200, 654, 654,
+ 654, 200, 654, 654, 654, 654, 654, 654,
+ 654, 654, 654, 654, 654, 654, 654, 654,
+
+ 654, 654, 654, 654, 654, 654, 654, 654,
+ 654, 655, 654, 654, 654, 654, 654, 654,
+ 654, 654, 654, 654, 654, 654, 654, 654,
+ 654, 654, 655, 200, 200, 656, 657, 653,
+
+ 653, 658, 658, 658, 659, 200, 653, 653,
+ 653, 200, 660, 660, 660, 661, 655, 200,
+ 200, 200, 200, 200, 200, 200, 200, 657,
+ 200, 200, 200, 200, 200, 200, 200, 662,
+
+ 654, 654, 659, 659, 200, 200, 663, 664,
+ 665, 666, 667, 668, 669, 670, 671, 672,
+ 673, 673, 673, 673, 673, 673, 200, 200,
+ 200, 674, 656, 656, 656, 656, 656, 656,
+
+ 200, 200, 675, 675, 200, 676, 676, 676,
+ 676, 676, 676, 676, 676, 676, 676, 676,
+ 676, 676, 676, 676, 676, 676, 676, 200,
+ 200, 200, 676, 676, 676, 676, 676, 676,
+
+ 676, 676, 676, 676, 676, 676, 676, 676,
+ 676, 676, 676, 676, 676, 676, 676, 676,
+ 676, 676, 200, 676, 676, 676, 676, 676,
+ 676, 676, 676, 676, 200, 676, 200, 200,
+
+ 676, 676, 676, 676, 676, 676, 676, 200,
+ 200, 200, 677, 200, 200, 200, 200, 678,
+ 675, 675, 679, 679, 679, 200, 679, 200,
+ 675, 675, 680, 675, 680, 680, 680, 678,
+
+ 200, 200, 200, 200, 200, 200, 681, 682,
+ 683, 684, 685, 686, 687, 688, 689, 690,
+ 200, 200, 675, 675, 691, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 692, 692, 692, 692, 692, 692, 692,
+ 692, 692, 692, 692, 692, 692, 692, 692,
+ 692, 692, 692, 692, 692, 692, 692, 692,
+ 692, 692, 692, 692, 692, 692, 692, 692,
+
+ 692, 692, 692, 692, 692, 692, 692, 692,
+ 692, 692, 692, 692, 692, 692, 692, 692,
+ 692, 693, 692, 694, 693, 693, 693, 693,
+ 695, 695, 696, 200, 200, 200, 200, 12,
+
+ 692, 692, 692, 692, 692, 692, 697, 693,
+ 698, 698, 698, 698, 693, 693, 693, 699,
+ 700, 701, 702, 703, 704, 705, 706, 707,
+ 708, 709, 710, 710, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 711, 711, 200, 711, 200, 200, 711,
+ 711, 200, 711, 200, 200, 711, 200, 200,
+ 200, 200, 200, 200, 711, 711, 711, 711,
+ 200, 711, 711, 711, 711, 711, 711, 711,
+
+ 200, 711, 711, 711, 200, 711, 200, 711,
+ 200, 200, 711, 711, 200, 711, 711, 711,
+ 711, 712, 711, 713, 712, 712, 712, 712,
+ 714, 714, 200, 712, 712, 711, 200, 200,
+
+ 711, 711, 711, 711, 711, 200, 715, 200,
+ 716, 716, 716, 716, 712, 712, 200, 200,
+ 717, 718, 719, 720, 721, 722, 723, 724,
+ 725, 726, 200, 200, 727, 727, 728, 728,
+
+ 729, 730, 730, 730, 731, 732, 731, 731,
+ 733, 731, 731, 734, 735, 736, 736, 736,
+ 736, 736, 733, 737, 736, 737, 737, 737,
+ 738, 738, 737, 737, 737, 737, 737, 737,
+
+ 739, 740, 741, 742, 743, 744, 745, 746,
+ 747, 748, 749, 749, 749, 749, 749, 749,
+ 749, 749, 749, 749, 750, 738, 737, 738,
+ 737, 751, 752, 753, 752, 753, 754, 754,
+
+ 729, 729, 729, 755, 729, 729, 729, 729,
+ 200, 729, 729, 729, 729, 755, 729, 729,
+ 729, 729, 755, 729, 729, 729, 729, 755,
+ 729, 729, 729, 729, 755, 729, 729, 729,
+
+ 729, 729, 729, 729, 729, 729, 729, 729,
+ 729, 755, 756, 757, 757, 200, 200, 200,
+ 200, 758, 759, 760, 761, 760, 760, 762,
+ 760, 762, 759, 759, 759, 759, 763, 764,
+
+ 759, 760, 765, 765, 766, 734, 765, 765,
+ 729, 729, 729, 729, 767, 768, 768, 768,
+ 763, 763, 763, 760, 763, 763, 769, 763,
+ 200, 763, 763, 763, 763, 760, 763, 763,
+
+ 763, 763, 760, 763, 763, 763, 763, 760,
+ 763, 763, 763, 763, 760, 763, 769, 769,
+ 769, 763, 763, 763, 763, 763, 763, 763,
+ 769, 760, 769, 769, 769, 200, 770, 770,
+
+ 771, 771, 771, 771, 771, 771, 772, 771,
+ 771, 771, 771, 771, 771, 200, 773, 771,
+ 774, 774, 775, 776, 777, 778, 778, 778,
+ 778, 779, 779, 200, 200, 200, 200, 200,
+
+ 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, 780, 780,
+
+ 780, 780, 781, 780, 780, 780, 782, 780,
+ 781, 780, 780, 783, 784, 785, 786, 785,
+ 785, 787, 785, 788, 788, 788, 785, 789,
+ 784, 790, 791, 792, 792, 788, 788, 781,
+
+ 793, 794, 795, 796, 797, 798, 799, 800,
+ 801, 802, 803, 803, 804, 804, 804, 804,
+ 780, 780, 780, 780, 780, 780, 787, 787,
+ 785, 785, 781, 781, 781, 781, 788, 788,
+
+ 788, 781, 783, 783, 783, 781, 781, 783,
+ 783, 783, 783, 783, 783, 783, 781, 781,
+ 781, 788, 788, 788, 788, 781, 781, 781,
+ 781, 781, 781, 781, 781, 781, 781, 781,
+
+ 781, 781, 788, 783, 792, 788, 788, 783,
+ 783, 783, 783, 783, 783, 805, 781, 783,
+ 806, 807, 808, 809, 810, 811, 812, 813,
+ 814, 815, 816, 816, 816, 817, 818, 818,
+
+ 819, 819, 819, 819, 819, 819, 819, 819,
+ 819, 819, 819, 819, 819, 819, 819, 819,
+ 819, 819, 819, 819, 819, 819, 819, 819,
+ 819, 819, 819, 819, 819, 819, 819, 819,
+
+ 819, 819, 819, 819, 819, 819, 200, 820,
+ 200, 200, 200, 200, 200, 820, 200, 200,
821, 821, 821, 821, 821, 821, 821, 821,
821, 821, 821, 821, 821, 821, 821, 821,
821, 821, 821, 821, 821, 821, 821, 821,
821, 821, 821, 821, 821, 821, 821, 821,
- 821, 821, 821, 821, 821, 821, 821, 821,
- 821, 821, 822, 822, 822, 822, 822, 821,
-
- 823, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823,
+ 821, 821, 821, 821, 821, 821, 821, 822,
+ 822, 823, 823, 824, 825, 826, 826, 826,
- 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823,
-
- 823, 823, 823, 825, 825, 825, 825, 825,
- 826, 826, 826, 826, 826, 826, 826, 826,
- 826, 826, 826, 826, 826, 826, 826, 826,
- 826, 826, 826, 826, 826, 826, 826, 826,
-
- 826, 826, 826, 827, 827, 827, 827, 827,
+ 827, 827, 827, 827, 827, 827, 827, 827,
827, 827, 827, 827, 827, 827, 827, 827,
827, 827, 827, 827, 827, 827, 827, 827,
827, 827, 827, 827, 827, 827, 827, 827,
@@ -1559,202 +1534,202 @@ static const unsigned short uc_property_trie[] = {
827, 827, 827, 827, 827, 827, 827, 827,
827, 827, 827, 827, 827, 827, 827, 827,
827, 827, 827, 827, 827, 827, 827, 827,
- 827, 827, 828, 828, 828, 828, 828, 828,
-
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
+ 827, 827, 828, 828, 828, 828, 828, 827,
+ 829, 830, 830, 830, 830, 830, 830, 830,
+ 830, 830, 830, 830, 830, 830, 830, 830,
+ 830, 830, 830, 830, 830, 830, 829, 829,
829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
-
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 199, 829, 829, 829, 829, 199, 199,
- 829, 829, 829, 829, 829, 829, 829, 199,
- 829, 199, 829, 829, 829, 829, 199, 199,
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 199, 829, 829, 829, 829, 199, 199,
829, 829, 829, 829, 829, 829, 829, 829,
829, 829, 829, 829, 829, 829, 829, 829,
-
829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 199, 829, 829, 829, 829, 199, 199,
- 829, 829, 829, 829, 829, 829, 829, 199,
-
- 829, 199, 829, 829, 829, 829, 199, 199,
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 829, 829, 829, 829, 829, 829, 199,
829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
+ 829, 829, 829, 831, 831, 831, 831, 831,
+ 832, 832, 832, 832, 832, 832, 832, 832,
+ 832, 832, 832, 832, 832, 832, 832, 832,
+ 832, 832, 832, 832, 832, 832, 832, 832,
+
+ 832, 832, 832, 833, 833, 833, 833, 833,
+ 833, 833, 833, 833, 833, 833, 833, 833,
+ 833, 833, 833, 833, 833, 833, 833, 833,
+ 833, 833, 833, 833, 833, 833, 833, 833,
+
+ 833, 833, 833, 833, 833, 833, 833, 833,
+ 833, 833, 833, 833, 833, 833, 833, 833,
+ 833, 833, 833, 833, 833, 833, 833, 833,
+ 833, 833, 834, 834, 834, 834, 834, 834,
+
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 200, 835, 835, 835, 835, 200, 200,
+ 835, 835, 835, 835, 835, 835, 835, 200,
+ 835, 200, 835, 835, 835, 835, 200, 200,
+
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 200, 835, 835, 835, 835, 200, 200,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 200, 835, 835, 835, 835, 200, 200,
+ 835, 835, 835, 835, 835, 835, 835, 200,
+
+ 835, 200, 835, 835, 835, 835, 200, 200,
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 835, 835, 835, 835, 835, 835, 200,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 200, 835, 835, 835, 835, 200, 200,
+ 835, 835, 835, 835, 835, 835, 835, 836,
+
+ 835, 835, 835, 835, 835, 835, 835, 836,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 200, 200, 837, 837, 838,
+
+ 839, 840, 841, 842, 842, 842, 842, 841,
+ 841, 843, 844, 845, 846, 847, 848, 849,
+ 850, 851, 852, 852, 852, 852, 852, 852,
+ 852, 852, 852, 852, 852, 200, 200, 200,
+
+ 836, 836, 836, 836, 836, 836, 836, 836,
+ 836, 836, 836, 836, 836, 836, 836, 836,
+ 853, 853, 853, 853, 853, 853, 853, 853,
+ 853, 853, 200, 200, 200, 200, 200, 200,
+
+ 854, 855, 856, 857, 858, 859, 860, 861,
+ 862, 863, 864, 865, 866, 867, 868, 869,
+ 870, 871, 872, 873, 874, 875, 876, 877,
+ 878, 879, 880, 881, 882, 883, 884, 885,
+
+ 886, 887, 888, 889, 890, 891, 892, 893,
+ 894, 895, 896, 897, 898, 899, 900, 901,
+ 902, 903, 904, 905, 906, 907, 908, 909,
+ 910, 911, 912, 913, 914, 915, 916, 917,
+
+ 918, 919, 920, 921, 922, 923, 924, 925,
+ 926, 927, 928, 929, 930, 931, 932, 933,
+ 934, 934, 934, 934, 934, 935, 200, 200,
+ 936, 936, 936, 936, 936, 936, 200, 200,
+
+ 937, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 938, 938, 938,
+
+ 938, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 938, 938, 938,
+
+ 938, 938, 938, 938, 938, 938, 938, 938,
+ 938, 938, 938, 938, 938, 939, 940, 938,
+ 938, 938, 938, 938, 938, 938, 938, 941,
+ 941, 941, 941, 941, 941, 941, 941, 941,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 199, 829, 829, 829, 829, 199, 199,
- 829, 829, 829, 829, 829, 829, 829, 830,
+ 942, 943, 943, 943, 943, 943, 943, 943,
+ 943, 943, 943, 943, 943, 943, 943, 943,
+ 943, 943, 943, 943, 943, 943, 943, 943,
+ 943, 943, 943, 944, 945, 200, 200, 200,
- 829, 829, 829, 829, 829, 829, 829, 830,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 829, 829, 829, 829, 829,
- 829, 829, 829, 199, 199, 831, 831, 832,
+ 946, 946, 946, 946, 946, 946, 946, 946,
+ 946, 946, 946, 946, 946, 946, 946, 946,
+ 946, 946, 946, 946, 946, 946, 946, 946,
+ 946, 946, 946, 946, 946, 946, 946, 946,
- 833, 834, 835, 836, 836, 836, 836, 835,
- 835, 837, 838, 839, 840, 841, 842, 843,
- 844, 845, 846, 846, 846, 846, 846, 846,
- 846, 846, 846, 846, 846, 199, 199, 199,
+ 946, 946, 946, 946, 946, 946, 946, 946,
+ 946, 946, 946, 947, 947, 947, 948, 948,
+ 948, 949, 949, 949, 949, 949, 949, 949,
+ 949, 200, 200, 200, 200, 200, 200, 200,
- 830, 830, 830, 830, 830, 830, 830, 830,
- 830, 830, 830, 830, 830, 830, 830, 830,
- 847, 847, 847, 847, 847, 847, 847, 847,
- 847, 847, 199, 199, 199, 199, 199, 199,
-
- 848, 848, 848, 848, 848, 848, 848, 848,
- 848, 848, 848, 848, 848, 848, 848, 848,
- 848, 848, 848, 848, 848, 848, 848, 848,
- 848, 848, 848, 848, 848, 848, 848, 848,
-
- 848, 848, 848, 848, 848, 848, 848, 848,
- 848, 848, 848, 848, 848, 848, 848, 848,
- 848, 848, 848, 848, 848, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 849, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
-
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
-
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 851, 852, 850,
- 850, 850, 850, 850, 850, 850, 850, 853,
- 853, 853, 853, 853, 853, 853, 853, 853,
+ 950, 950, 950, 950, 950, 950, 950, 950,
+ 950, 950, 950, 950, 950, 200, 950, 950,
+ 950, 950, 951, 951, 952, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 854, 855, 855, 855, 855, 855, 855, 855,
- 855, 855, 855, 855, 855, 855, 855, 855,
- 855, 855, 855, 855, 855, 855, 855, 855,
- 855, 855, 855, 856, 857, 199, 199, 199,
-
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 858, 858,
-
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 859, 859, 859, 860, 860,
- 860, 861, 861, 861, 861, 861, 861, 861,
- 861, 199, 199, 199, 199, 199, 199, 199,
-
- 862, 862, 862, 862, 862, 862, 862, 862,
- 862, 862, 862, 862, 862, 199, 862, 862,
- 862, 862, 863, 863, 864, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 865, 865, 865, 865, 865, 865, 865, 865,
- 865, 865, 865, 865, 865, 865, 865, 865,
- 865, 865, 866, 866, 867, 868, 868, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 870, 870, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 199, 871, 871,
- 871, 199, 872, 872, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 873, 873, 873, 873, 873, 873, 873, 873,
- 873, 873, 873, 873, 873, 873, 873, 873,
- 873, 873, 873, 873, 873, 873, 873, 873,
- 873, 873, 873, 873, 873, 873, 873, 873,
-
- 873, 873, 873, 873, 873, 873, 873, 873,
- 873, 873, 873, 873, 873, 873, 873, 873,
- 873, 873, 873, 873, 874, 874, 875, 874,
- 874, 874, 874, 874, 874, 874, 875, 875,
-
- 875, 875, 875, 875, 875, 875, 874, 875,
- 875, 874, 874, 874, 874, 874, 874, 874,
- 874, 874, 876, 874, 877, 877, 878, 879,
- 877, 880, 877, 881, 873, 882, 199, 199,
-
- 883, 884, 885, 886, 887, 888, 889, 890,
- 891, 892, 199, 199, 199, 199, 199, 199,
- 893, 893, 893, 893, 893, 893, 893, 893,
- 893, 893, 199, 199, 199, 199, 199, 199,
-
- 894, 894, 895, 896, 897, 898, 899, 900,
- 901, 902, 903, 904, 904, 904, 905, 199,
- 906, 907, 908, 909, 910, 911, 912, 913,
- 914, 915, 199, 199, 199, 199, 199, 199,
-
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
-
- 916, 916, 916, 917, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
-
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 918, 918, 918, 918, 918, 918, 918, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 916, 916, 916, 916, 916, 916, 916,
-
- 916, 916, 916, 916, 916, 916, 916, 916,
- 916, 919, 920, 199, 199, 199, 199, 199,
- 853, 853, 853, 853, 853, 853, 853, 853,
- 853, 853, 853, 853, 853, 853, 853, 853,
+ 953, 953, 953, 953, 953, 953, 953, 953,
+ 953, 953, 953, 953, 953, 953, 953, 953,
+ 953, 953, 954, 954, 955, 956, 956, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 853, 853, 853, 853, 853, 853, 853, 853,
- 853, 853, 853, 853, 853, 853, 853, 853,
- 853, 853, 853, 853, 853, 853, 853, 853,
- 853, 853, 853, 853, 853, 853, 853, 853,
+ 957, 957, 957, 957, 957, 957, 957, 957,
+ 957, 957, 957, 957, 957, 957, 957, 957,
+ 957, 957, 958, 958, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 853, 853, 853, 853, 853, 853, 853, 853,
- 853, 853, 853, 853, 853, 853, 853, 853,
- 853, 853, 853, 853, 853, 853, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
+ 959, 959, 959, 959, 959, 959, 959, 959,
+ 959, 959, 959, 959, 959, 200, 959, 959,
+ 959, 200, 960, 960, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 921, 921, 921, 921, 921, 921, 921, 921,
- 921, 921, 921, 921, 921, 921, 921, 921,
- 921, 921, 921, 921, 921, 921, 921, 921,
- 921, 921, 921, 921, 921, 922, 922, 199,
+ 961, 961, 961, 961, 961, 961, 961, 961,
+ 961, 961, 961, 961, 961, 961, 961, 961,
+ 961, 961, 961, 961, 961, 961, 961, 961,
+ 961, 961, 961, 961, 961, 961, 961, 961,
- 923, 923, 923, 924, 924, 924, 924, 923,
- 923, 924, 924, 924, 199, 199, 199, 199,
- 924, 924, 923, 924, 924, 924, 924, 924,
- 924, 925, 926, 927, 199, 199, 199, 199,
+ 961, 961, 961, 961, 961, 961, 961, 961,
+ 961, 961, 961, 961, 961, 961, 961, 961,
+ 961, 961, 961, 961, 962, 962, 963, 962,
+ 962, 962, 962, 962, 962, 962, 963, 963,
- 928, 199, 199, 199, 929, 929, 930, 931,
- 932, 933, 934, 935, 936, 937, 938, 939,
- 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940,
+ 963, 963, 963, 963, 963, 963, 962, 963,
+ 963, 962, 962, 962, 962, 962, 962, 962,
+ 962, 962, 964, 962, 965, 965, 966, 967,
+ 965, 968, 965, 969, 961, 970, 200, 200,
- 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 199, 199,
- 940, 940, 940, 940, 940, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
+ 971, 972, 973, 974, 975, 976, 977, 978,
+ 979, 980, 200, 200, 200, 200, 200, 200,
+ 981, 981, 981, 981, 981, 981, 981, 981,
+ 981, 981, 200, 200, 200, 200, 200, 200,
+
+ 982, 982, 983, 984, 985, 986, 987, 988,
+ 989, 990, 991, 992, 992, 992, 993, 200,
+ 994, 995, 996, 997, 998, 999, 1000, 1001,
+ 1002, 1003, 200, 200, 200, 200, 200, 200,
+
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+
+ 1004, 1004, 1004, 1005, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+
+ 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,
+ 1004, 1007, 1008, 200, 200, 200, 200, 200,
+ 941, 941, 941, 941, 941, 941, 941, 941,
+ 941, 941, 941, 941, 941, 941, 941, 941,
941, 941, 941, 941, 941, 941, 941, 941,
941, 941, 941, 941, 941, 941, 941, 941,
@@ -1762,159 +1737,189 @@ static const unsigned short uc_property_trie[] = {
941, 941, 941, 941, 941, 941, 941, 941,
941, 941, 941, 941, 941, 941, 941, 941,
- 941, 941, 942, 942, 199, 199, 199, 199,
- 943, 943, 943, 943, 943, 944, 944, 944,
- 943, 943, 944, 943, 943, 943, 943, 943,
-
- 943, 941, 941, 941, 941, 941, 941, 941,
- 943, 943, 199, 199, 199, 199, 199, 199,
- 945, 946, 947, 948, 949, 950, 951, 952,
- 953, 954, 955, 199, 199, 199, 956, 956,
-
- 957, 957, 957, 957, 957, 957, 957, 957,
- 957, 957, 957, 957, 957, 957, 957, 957,
- 957, 957, 957, 957, 957, 957, 957, 957,
- 957, 957, 957, 957, 957, 957, 957, 957,
-
- 958, 958, 958, 958, 958, 958, 958, 958,
- 958, 958, 958, 958, 958, 958, 958, 958,
- 958, 958, 958, 958, 958, 958, 958, 959,
- 960, 961, 961, 962, 199, 199, 963, 963,
-
- 964, 964, 964, 964, 964, 964, 964, 964,
- 964, 964, 964, 964, 964, 964, 964, 964,
- 964, 964, 964, 964, 964, 964, 964, 964,
- 964, 964, 964, 964, 964, 964, 964, 964,
-
- 964, 964, 964, 964, 964, 964, 964, 964,
- 964, 964, 964, 964, 964, 964, 964, 964,
- 964, 964, 964, 964, 964, 965, 966, 965,
- 966, 966, 966, 966, 966, 966, 966, 199,
+ 941, 941, 941, 941, 941, 941, 941, 941,
+ 941, 941, 941, 941, 941, 941, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 967, 968, 966, 968, 968, 966, 966, 966,
- 966, 966, 966, 966, 966, 965, 965, 965,
- 965, 965, 965, 966, 966, 969, 969, 969,
- 969, 969, 969, 969, 969, 199, 199, 970,
+ 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009,
+ 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009,
+ 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009,
+ 1009, 1009, 1009, 1009, 1009, 1010, 1010, 200,
- 971, 972, 973, 974, 975, 976, 977, 978,
- 979, 980, 199, 199, 199, 199, 199, 199,
- 971, 972, 973, 974, 975, 976, 977, 978,
- 979, 980, 199, 199, 199, 199, 199, 199,
-
- 981, 981, 981, 981, 981, 981, 981, 982,
- 983, 983, 983, 983, 981, 981, 199, 199,
- 984, 984, 984, 984, 984, 985, 985, 985,
- 985, 985, 985, 984, 984, 985, 986, 199,
-
- 987, 987, 987, 987, 988, 989, 990, 989,
- 990, 989, 990, 989, 990, 989, 990, 989,
- 989, 989, 990, 989, 989, 989, 989, 989,
- 989, 989, 989, 989, 989, 989, 989, 989,
-
- 989, 989, 989, 989, 989, 989, 989, 989,
- 989, 989, 989, 989, 989, 989, 989, 989,
- 989, 989, 989, 989, 991, 992, 987, 987,
- 987, 987, 987, 993, 987, 993, 988, 988,
-
- 993, 993, 987, 993, 994, 989, 989, 989,
- 989, 989, 989, 989, 199, 199, 199, 199,
- 995, 996, 997, 998, 999, 1000, 1001, 1002,
- 1003, 1004, 1005, 1005, 1006, 1007, 1005, 1005,
-
- 1007, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1009, 1010, 1009, 1009, 1009,
- 1009, 1009, 1009, 1009, 1008, 1008, 1008, 1008,
- 1008, 1008, 1008, 1008, 1008, 199, 199, 199,
-
- 1011, 1011, 1012, 1013, 1013, 1013, 1013, 1013,
- 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013,
- 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013,
- 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013,
-
- 1013, 1012, 1011, 1011, 1011, 1011, 1012, 1012,
- 1011, 1011, 1014, 1015, 1016, 1016, 1013, 1013,
- 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024,
- 1025, 1026, 1027, 1027, 1027, 1027, 1027, 1027,
+ 1011, 1011, 1011, 1012, 1012, 1012, 1012, 1011,
+ 1011, 1012, 1012, 1012, 200, 200, 200, 200,
+ 1012, 1012, 1011, 1012, 1012, 1012, 1012, 1012,
+ 1012, 1013, 1014, 1015, 200, 200, 200, 200,
+ 1016, 200, 200, 200, 1017, 1017, 1018, 1019,
+ 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027,
1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,
1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,
+
1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,
- 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,
+ 1028, 1028, 1028, 1028, 1028, 1028, 200, 200,
+ 1028, 1028, 1028, 1028, 1028, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1029, 1030, 1030, 200, 200, 200, 200,
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+
+ 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1029, 200, 200, 200, 200, 200, 200,
+ 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038,
+ 1039, 1040, 1041, 200, 200, 200, 1042, 1042,
+
+ 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+ 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+ 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+ 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+
+ 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044,
+ 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044,
+ 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1045,
+ 1046, 1047, 1047, 1048, 200, 200, 1049, 1049,
+
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+ 1050, 1050, 1050, 1050, 1050, 1051, 1052, 1051,
+ 1052, 1052, 1052, 1052, 1052, 1052, 1052, 200,
+
+ 1053, 1054, 1052, 1054, 1054, 1052, 1052, 1052,
+ 1052, 1052, 1052, 1052, 1052, 1051, 1051, 1051,
+ 1051, 1051, 1051, 1052, 1052, 1055, 1055, 1055,
+ 1055, 1055, 1055, 1055, 1055, 200, 200, 1056,
+
+ 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064,
+ 1065, 1066, 200, 200, 200, 200, 200, 200,
+ 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064,
+ 1065, 1066, 200, 200, 200, 200, 200, 200,
+
+ 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1068,
+ 1069, 1069, 1069, 1069, 1067, 1067, 200, 200,
+ 1070, 1070, 1070, 1070, 1070, 1071, 1071, 1071,
+ 1071, 1071, 1071, 1070, 1070, 1071, 1072, 200,
+
+ 1073, 1073, 1073, 1073, 1074, 1075, 1076, 1075,
+ 1076, 1075, 1076, 1075, 1076, 1075, 1076, 1075,
+ 1075, 1075, 1076, 1075, 1075, 1075, 1075, 1075,
+ 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
- 1028, 1028, 1028, 1028, 1028, 1028, 1029, 1030,
- 1031, 1031, 1030, 1030, 1030, 1031, 1030, 1031,
- 1031, 1031, 1032, 1032, 199, 199, 199, 199,
- 199, 199, 199, 199, 1033, 1033, 1033, 1033,
-
- 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
- 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
- 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
- 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
-
- 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1035,
- 1035, 1035, 1035, 1035, 1036, 1036, 1036, 1036,
- 1036, 1036, 1036, 1036, 1035, 1035, 1036, 1037,
- 199, 199, 199, 1038, 1038, 1039, 1039, 1039,
-
- 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047,
- 1048, 1049, 199, 199, 199, 1034, 1034, 1034,
- 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057,
- 1058, 1059, 1060, 1060, 1060, 1060, 1060, 1060,
-
- 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,
- 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,
- 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,
- 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1062,
-
- 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1064, 1064, 1064, 1065, 1066, 1067, 1067, 1067,
- 1067, 1067, 1064, 1064, 1067, 1067, 1067, 1067,
-
- 1064, 1068, 1066, 1066, 1066, 1066, 1066, 1066,
- 1066, 1069, 1069, 1069, 1069, 1067, 1069, 1069,
- 1069, 1069, 1068, 1070, 1071, 1072, 1072, 199,
- 984, 984, 199, 199, 199, 199, 199, 199,
+ 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
+ 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
+ 1075, 1075, 1075, 1075, 1077, 1078, 1073, 1073,
+ 1073, 1073, 1073, 1079, 1073, 1079, 1074, 1074,
+
+ 1079, 1079, 1073, 1079, 1080, 1075, 1075, 1075,
+ 1075, 1075, 1075, 1075, 200, 200, 200, 200,
+ 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088,
+ 1089, 1090, 1091, 1091, 1092, 1093, 1091, 1091,
+
+ 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1094,
+ 1094, 1094, 1094, 1095, 1096, 1095, 1095, 1095,
+ 1095, 1095, 1095, 1095, 1094, 1094, 1094, 1094,
+ 1094, 1094, 1094, 1094, 1094, 200, 200, 200,
+
+ 1097, 1097, 1098, 1099, 1099, 1099, 1099, 1099,
+ 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099,
+ 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099,
+ 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099,
+
+ 1099, 1098, 1097, 1097, 1097, 1097, 1098, 1098,
+ 1097, 1097, 1100, 1101, 1102, 1102, 1099, 1099,
+ 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110,
+ 1111, 1112, 1113, 1113, 1113, 1113, 1113, 1113,
+
+ 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
+ 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
+ 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
+ 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
+
+ 1114, 1114, 1114, 1114, 1114, 1114, 1115, 1116,
+ 1117, 1117, 1116, 1116, 1116, 1117, 1116, 1117,
+ 1117, 1117, 1118, 1118, 200, 200, 200, 200,
+ 200, 200, 200, 200, 1119, 1119, 1119, 1119,
+
+ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120,
+ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120,
+ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120,
+ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120,
+
+ 1120, 1120, 1120, 1120, 1121, 1121, 1121, 1121,
+ 1121, 1121, 1121, 1121, 1122, 1122, 1122, 1122,
+ 1122, 1122, 1122, 1122, 1121, 1121, 1122, 1123,
+ 200, 200, 200, 1124, 1124, 1125, 1125, 1125,
+
+ 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133,
+ 1134, 1135, 200, 200, 200, 1120, 1120, 1120,
+ 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143,
+ 1144, 1145, 1146, 1146, 1146, 1146, 1146, 1146,
+
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1147, 1147, 1147, 1147, 1147, 1147, 1148, 1148,
+
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1150, 1150, 1150, 1151, 1152, 1153, 1153, 1153,
+ 1153, 1153, 1150, 1150, 1153, 1153, 1153, 1153,
+
+ 1150, 1154, 1152, 1152, 1152, 1152, 1152, 1152,
+ 1152, 1155, 1155, 1155, 1155, 1153, 1155, 1155,
+ 1155, 1155, 1154, 1156, 1157, 1158, 1158, 200,
+ 1070, 1070, 200, 200, 200, 200, 200, 200,
114, 114, 114, 114, 114, 114, 114, 114,
114, 114, 114, 114, 114, 114, 114, 114,
114, 114, 114, 114, 114, 114, 114, 114,
114, 114, 114, 114, 114, 114, 114, 114,
- 114, 114, 114, 114, 114, 114, 1073, 1073,
- 1073, 1073, 1073, 1074, 1075, 1075, 1075, 1076,
- 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
- 1075, 1075, 1075, 1076, 1075, 1075, 1075, 1075,
+ 114, 114, 114, 114, 114, 114, 1159, 1159,
+ 1159, 1159, 1159, 1160, 1161, 1161, 1161, 1162,
+ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+ 1161, 1161, 1161, 1162, 1161, 1161, 1161, 1161,
- 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
- 1075, 1075, 1075, 1075, 1075, 1075, 1076, 1075,
- 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
- 1075, 1075, 1075, 1075, 1075, 1077, 1077, 1077,
+ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+ 1161, 1161, 1161, 1161, 1161, 1161, 1162, 1161,
+ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+ 1161, 1161, 1161, 1161, 1161, 1163, 1163, 1163,
- 1077, 1077, 1075, 1075, 1075, 1075, 1077, 1077,
- 1077, 1077, 1077, 114, 115, 115, 115, 115,
+ 1163, 1163, 1161, 1161, 1161, 1161, 1163, 1163,
+ 1163, 1163, 1163, 114, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115,
- 1078, 1079, 115, 115, 115, 1080, 115, 115,
+ 1164, 1165, 115, 115, 115, 1166, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115,
115, 115, 115, 115, 115, 115, 115, 115,
- 115, 115, 115, 1081, 1081, 1081, 1081, 1081,
+ 115, 115, 115, 1167, 1167, 1167, 1167, 1167,
- 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081,
- 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081,
- 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081,
- 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1082,
+ 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167,
+ 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167,
+ 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167,
+ 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1168,
- 188, 188, 187, 188, 1083, 1083, 1083, 1083,
- 1083, 1083, 1084, 1085, 1085, 1086, 1087, 1088,
- 1089, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
- 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
+ 189, 189, 188, 189, 1169, 1169, 1169, 1169,
+ 1169, 1169, 1170, 1171, 1171, 1172, 1173, 1174,
+ 1175, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
- 1085, 1085, 1085, 1085, 1085, 1085, 1085, 984,
- 984, 984, 984, 984, 984, 984, 984, 984,
- 984, 984, 984, 984, 984, 984, 199, 199,
- 199, 199, 199, 199, 1090, 1067, 1083, 1084,
+ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1070,
+ 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070,
+ 1070, 1070, 1070, 1070, 1070, 1070, 200, 200,
+ 200, 200, 200, 200, 1176, 1153, 1169, 1170,
70, 71, 70, 71, 70, 71, 70, 71,
70, 71, 70, 71, 70, 71, 70, 71,
@@ -1923,258 +1928,258 @@ static const unsigned short uc_property_trie[] = {
70, 71, 70, 71, 70, 71, 70, 71,
70, 71, 70, 71, 70, 71, 70, 71,
- 70, 71, 70, 71, 70, 71, 1091, 1092,
- 1093, 1094, 1095, 1096, 1097, 1097, 1098, 1097,
+ 70, 71, 70, 71, 70, 71, 1177, 1178,
+ 1179, 1180, 1181, 1182, 1183, 1183, 1184, 1183,
70, 71, 70, 71, 70, 71, 70, 71,
70, 71, 70, 71, 70, 71, 70, 71,
70, 71, 70, 71, 70, 71, 70, 71,
- 70, 71, 1099, 1100, 1099, 1100, 1099, 1100,
-
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102,
- 1101, 1101, 1101, 1101, 1101, 1101, 199, 199,
- 1102, 1102, 1102, 1102, 1102, 1102, 199, 199,
-
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102,
-
- 1101, 1101, 1101, 1101, 1101, 1101, 199, 199,
- 1102, 1102, 1102, 1102, 1102, 1102, 199, 199,
- 1103, 1101, 1104, 1101, 1105, 1101, 1106, 1101,
- 199, 1102, 199, 1102, 199, 1102, 199, 1102,
-
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102,
- 1107, 1108, 1109, 1110, 1109, 1110, 1111, 1112,
- 1113, 1114, 1115, 1116, 1117, 1118, 199, 199,
-
- 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126,
- 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134,
- 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142,
- 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150,
-
- 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158,
- 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166,
- 1101, 1101, 1167, 1168, 1169, 199, 1170, 1171,
- 1102, 1102, 1172, 1173, 1174, 204, 1175, 204,
-
- 204, 1176, 1177, 1178, 1179, 199, 1180, 1181,
- 1182, 1183, 1182, 1183, 1184, 1176, 1176, 1176,
- 1101, 1101, 1185, 1186, 199, 199, 1187, 1188,
- 1102, 1102, 1189, 1190, 199, 1176, 1176, 1176,
-
- 1101, 1101, 1191, 1192, 1193, 1194, 1195, 1196,
- 1102, 1102, 1197, 1198, 1199, 1176, 1200, 1200,
- 199, 199, 1201, 1202, 1203, 199, 1204, 1205,
- 1206, 1207, 1208, 1209, 1210, 1211, 204, 199,
-
- 1212, 1212, 1213, 1213, 1213, 1213, 1213, 1214,
- 1213, 1213, 1213, 1215, 1216, 1217, 1218, 1219,
- 1220, 1221, 1220, 1222, 1223, 1224, 14, 1225,
- 1226, 1227, 1228, 1229, 1229, 1230, 1228, 1229,
-
- 14, 14, 14, 14, 1231, 1232, 1232, 1233,
- 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241,
- 13, 13, 13, 1242, 1242, 1243, 1244, 1244,
- 14, 1245, 1246, 14, 1247, 1248, 1225, 43,
-
- 43, 14, 14, 14, 1249, 16, 1250, 1251,
- 1252, 1252, 1253, 1253, 1253, 1253, 1254, 1254,
- 1254, 1254, 1255, 1256, 1257, 1258, 1259, 1260,
- 1259, 1259, 1259, 1259, 1258, 1259, 1259, 1261,
-
- 1262, 1263, 1263, 1263, 1264, 1265, 1266, 1267,
- 1268, 1269, 1270, 1270, 1270, 1270, 1270, 1270,
- 1271, 1272, 199, 199, 1273, 1274, 1275, 1276,
- 1277, 1278, 1279, 1279, 1280, 1281, 1282, 157,
-
- 1271, 63, 58, 59, 1273, 1274, 1275, 1276,
- 1277, 1278, 1279, 1279, 1280, 1281, 1282, 199,
- 1081, 1081, 1081, 1081, 1081, 1283, 1283, 1283,
- 1283, 1283, 1283, 1283, 1283, 199, 199, 199,
+ 70, 71, 1185, 1186, 1185, 1186, 1185, 1186,
+
+ 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187,
+ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
+ 1187, 1187, 1187, 1187, 1187, 1187, 200, 200,
+ 1188, 1188, 1188, 1188, 1188, 1188, 200, 200,
+
+ 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187,
+ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
+ 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187,
+ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
+
+ 1187, 1187, 1187, 1187, 1187, 1187, 200, 200,
+ 1188, 1188, 1188, 1188, 1188, 1188, 200, 200,
+ 1189, 1187, 1190, 1187, 1191, 1187, 1192, 1187,
+ 200, 1188, 200, 1188, 200, 1188, 200, 1188,
+
+ 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187,
+ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
+ 1193, 1194, 1195, 1196, 1195, 1196, 1197, 1198,
+ 1199, 1200, 1201, 1202, 1203, 1204, 200, 200,
+
+ 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212,
+ 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220,
+ 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228,
+ 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236,
+
+ 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244,
+ 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252,
+ 1187, 1187, 1253, 1254, 1255, 200, 1256, 1257,
+ 1188, 1188, 1258, 1259, 1260, 205, 1261, 205,
+
+ 205, 1262, 1263, 1264, 1265, 200, 1266, 1267,
+ 1268, 1269, 1268, 1269, 1270, 1262, 1262, 1262,
+ 1187, 1187, 1271, 1272, 200, 200, 1273, 1274,
+ 1188, 1188, 1275, 1276, 200, 1262, 1262, 1262,
+
+ 1187, 1187, 1277, 1278, 1279, 1280, 1281, 1282,
+ 1188, 1188, 1283, 1284, 1285, 1262, 1286, 1286,
+ 200, 200, 1287, 1288, 1289, 200, 1290, 1291,
+ 1292, 1293, 1294, 1295, 1296, 1297, 205, 200,
+
+ 1298, 1298, 1299, 1299, 1299, 1299, 1299, 1300,
+ 1299, 1299, 1299, 1301, 1302, 1303, 1304, 1305,
+ 1306, 1307, 1306, 1308, 1309, 1310, 14, 1311,
+ 1312, 1313, 1314, 1315, 1315, 1316, 1314, 1315,
+
+ 14, 14, 14, 14, 1317, 1318, 1318, 1319,
+ 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327,
+ 13, 13, 13, 1328, 1328, 1329, 1330, 1330,
+ 14, 1331, 1332, 14, 1333, 1334, 1311, 43,
+
+ 43, 14, 14, 14, 1335, 16, 1336, 1337,
+ 1338, 1338, 1339, 1339, 1339, 1339, 1340, 1340,
+ 1340, 1340, 1341, 1342, 1343, 1344, 1345, 1346,
+ 1345, 1345, 1345, 1345, 1344, 1345, 1345, 1347,
+
+ 1348, 1349, 1349, 1349, 1350, 1351, 1352, 1353,
+ 1354, 1355, 1356, 1356, 1356, 1356, 1356, 1356,
+ 1357, 1358, 200, 200, 1359, 1360, 1361, 1362,
+ 1363, 1364, 1365, 1365, 1366, 1367, 1368, 158,
+
+ 1357, 63, 58, 59, 1359, 1360, 1361, 1362,
+ 1363, 1364, 1365, 1365, 1366, 1367, 1368, 200,
+ 1167, 1167, 1167, 1167, 1167, 1369, 1369, 1369,
+ 1369, 1369, 1369, 1369, 1369, 200, 200, 200,
12, 12, 12, 12, 12, 12, 12, 50,
- 1284, 12, 12, 1285, 1286, 1287, 1287, 1287,
- 1288, 1288, 1289, 1289, 1289, 1289, 1290, 1291,
- 1291, 1292, 1293, 1294, 1295, 1295, 1296, 1296,
-
- 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296,
- 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296,
- 170, 170, 177, 177, 170, 170, 170, 170,
- 177, 177, 177, 170, 170, 1297, 1297, 1297,
-
- 1297, 170, 1298, 1298, 1299, 1300, 1300, 194,
- 1301, 194, 1300, 1302, 1084, 1084, 1084, 1084,
- 1085, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1303, 1303, 1304, 1305, 51, 1303, 1303, 1304,
- 51, 1305, 1306, 1304, 1304, 1304, 1306, 1306,
- 1304, 1304, 1304, 1306, 51, 1304, 1307, 51,
- 36, 1304, 1304, 1304, 1304, 1304, 51, 51,
-
- 1303, 1303, 1303, 51, 1304, 51, 1308, 51,
- 1304, 51, 1309, 1310, 1304, 1304, 1311, 1306,
- 1304, 1304, 1312, 1304, 1306, 1313, 1313, 1313,
- 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1319,
-
- 1320, 1255, 1255, 1255, 1255, 1319, 1318, 1318,
- 1318, 1318, 1321, 1255, 1322, 1323, 1324, 1325,
- 1326, 1326, 1326, 65, 65, 65, 65, 65,
+ 1370, 12, 12, 1371, 1372, 1373, 1373, 1373,
+ 1374, 1374, 1375, 1375, 1375, 1375, 1376, 1377,
+ 1377, 1378, 1379, 1380, 1381, 1381, 1382, 1383,
+
+ 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383,
+ 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383,
+ 171, 171, 178, 178, 171, 171, 171, 171,
+ 178, 178, 178, 171, 171, 1384, 1384, 1384,
+
+ 1384, 171, 1385, 1385, 1386, 1387, 1387, 195,
+ 1388, 195, 1387, 1389, 1170, 1170, 1170, 1170,
+ 1171, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1390, 1390, 1391, 1392, 51, 1390, 1390, 1391,
+ 51, 1392, 1393, 1391, 1391, 1391, 1393, 1393,
+ 1391, 1391, 1391, 1393, 51, 1391, 1394, 51,
+ 36, 1391, 1391, 1391, 1391, 1391, 51, 51,
+
+ 1390, 1390, 1390, 51, 1391, 51, 1395, 51,
+ 1391, 51, 1396, 1397, 1391, 1391, 1398, 1393,
+ 1391, 1391, 1399, 1391, 1393, 1400, 1400, 1400,
+ 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1406,
+
+ 1407, 1341, 1341, 1341, 1341, 1406, 1405, 1405,
+ 1405, 1405, 1408, 1341, 1409, 1410, 1411, 1412,
+ 1413, 1413, 1413, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65,
- 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327,
- 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327,
- 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328,
- 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328,
+ 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1414,
+ 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1414,
+ 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415,
+ 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415,
- 1329, 1329, 1329, 111, 123, 1330, 1330, 1330,
- 1330, 1326, 199, 199, 199, 199, 199, 199,
+ 1416, 1416, 1416, 111, 123, 1417, 1417, 1417,
+ 1417, 1413, 1418, 1418, 200, 200, 200, 200,
36, 36, 36, 36, 36, 51, 51, 51,
- 51, 51, 1331, 1331, 51, 51, 51, 51,
+ 51, 51, 1419, 1419, 51, 51, 51, 51,
36, 51, 51, 36, 51, 51, 36, 51,
- 51, 51, 51, 51, 51, 51, 1331, 51,
+ 51, 51, 51, 51, 51, 51, 1419, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 1332, 1331, 1331,
+ 51, 51, 51, 51, 51, 1420, 1419, 1419,
51, 51, 36, 51, 36, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 1315, 1315, 1315, 1315, 1315,
- 1315, 1315, 1315, 1315, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
+ 51, 51, 51, 1402, 1402, 1402, 1402, 1402,
+ 1402, 1402, 1402, 1402, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
- 36, 36, 36, 36, 1331, 36, 36, 36,
- 1333, 1334, 1333, 1335, 1336, 1335, 36, 36,
- 36, 36, 18, 57, 36, 1337, 36, 36,
+ 36, 36, 36, 36, 1419, 36, 36, 36,
+ 1421, 1422, 1421, 1423, 1424, 1423, 36, 36,
+ 36, 36, 18, 57, 36, 1425, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 1331, 36, 1331, 36,
- 36, 36, 36, 36, 1280, 1280, 36, 1280,
- 1280, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 1338, 1339, 36, 36,
+ 36, 36, 36, 36, 1419, 36, 1419, 36,
+ 36, 36, 36, 36, 1366, 1366, 36, 1366,
+ 1366, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 36, 36, 1426, 1427, 36, 36,
- 36, 1331, 36, 1340, 1331, 36, 36, 1331,
- 36, 1331, 36, 36, 36, 36, 36, 36,
- 36, 36, 1338, 1339, 1338, 1339, 36, 36,
+ 36, 1419, 36, 1428, 1419, 36, 36, 1419,
+ 36, 1419, 36, 36, 36, 36, 36, 36,
+ 36, 36, 1426, 1427, 1426, 1427, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 1331, 36, 1331, 36, 1338, 1339, 1338, 1339,
- 1338, 1339, 1338, 1339, 36, 1331, 1341, 1342,
- 1341, 1342, 1338, 1339, 1341, 1342, 1338, 1339,
- 1341, 1342, 1338, 1339, 1338, 1339, 1338, 1339,
+ 1419, 36, 1419, 36, 1426, 1427, 1426, 1427,
+ 1426, 1427, 1426, 1427, 36, 1419, 1429, 1430,
+ 1429, 1430, 1426, 1427, 1429, 1430, 1426, 1427,
+ 1429, 1430, 1426, 1427, 1426, 1427, 1426, 1427,
- 1341, 1342, 1338, 1339, 1341, 1342, 1338, 1339,
- 1341, 1342, 1338, 1339, 36, 36, 36, 1338,
- 1339, 1338, 1339, 36, 36, 36, 36, 36,
- 1343, 36, 36, 36, 36, 36, 36, 36,
+ 1429, 1430, 1426, 1427, 1429, 1430, 1426, 1427,
+ 1429, 1430, 1426, 1427, 36, 36, 36, 1426,
+ 1427, 1426, 1427, 36, 36, 36, 36, 36,
+ 1431, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 1338, 1339, 36, 36, 1344, 36,
- 1345, 1346, 36, 1346, 1331, 1331, 1331, 1331,
- 1338, 1339, 1338, 1339, 1338, 1339, 1338, 1339,
+ 36, 36, 1426, 1427, 36, 36, 1432, 36,
+ 1433, 1434, 36, 1434, 1419, 1419, 1419, 1419,
+ 1426, 1427, 1426, 1427, 1426, 1427, 1426, 1427,
36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 36, 1338, 1339, 1338, 1339, 1347, 36, 36,
- 1338, 1339, 36, 36, 36, 36, 1338, 1339,
- 1338, 1339, 1338, 1339, 1338, 1339, 1338, 1339,
+ 36, 1426, 1427, 1426, 1427, 1435, 36, 36,
+ 1426, 1427, 36, 36, 36, 36, 1426, 1427,
+ 1426, 1427, 1426, 1427, 1426, 1427, 1426, 1427,
- 1341, 1342, 1341, 1342, 1338, 1339, 1338, 1339,
- 1338, 1339, 1341, 1342, 1341, 1342, 36, 36,
- 1338, 1339, 1348, 1348, 1348, 1255, 1349, 1349,
- 1255, 1255, 1350, 1350, 1350, 1351, 1351, 1255,
+ 1429, 1430, 1429, 1430, 1426, 1427, 1426, 1427,
+ 1426, 1427, 1429, 1430, 1429, 1430, 36, 1436,
+ 1426, 1427, 1437, 1437, 1437, 1341, 1438, 1438,
+ 1341, 1341, 1439, 1439, 1439, 1440, 1440, 1341,
- 51, 1315, 51, 51, 51, 51, 51, 51,
- 16, 1250, 16, 1250, 51, 51, 51, 51,
+ 51, 1402, 51, 51, 51, 51, 51, 51,
+ 16, 1336, 16, 1336, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 1352, 1352, 51, 51, 51, 51,
+ 51, 51, 1441, 1441, 51, 51, 51, 51,
36, 36, 51, 51, 51, 51, 51, 51,
- 51, 1353, 1354, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 1355, 1355,
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
-
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
-
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
- 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355,
- 1355, 1355, 1355, 1315, 1255, 1315, 1315, 1315,
-
- 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315,
- 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315,
- 1315, 1315, 1315, 1315, 1315, 1356, 1315, 1315,
- 1315, 1315, 1315, 1255, 1255, 1255, 1255, 1255,
-
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1321, 1321, 1321, 1321,
- 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321,
-
- 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321,
- 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1357,
- 1357, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
- 1322, 1322, 1322, 1322, 1358, 1358, 1358, 1358,
-
- 1358, 1358, 1323, 1323, 1323, 1323, 1323, 1323,
- 1359, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1361, 1361, 1361, 1361, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 199, 199, 199, 199, 199,
+ 51, 1442, 1443, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 1444, 1444,
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+ 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
+ 1444, 1444, 1444, 1402, 1341, 1402, 1402, 1402,
+
+ 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+ 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+ 1402, 1402, 1402, 1402, 1402, 1445, 1402, 1402,
+ 1402, 1402, 1402, 1341, 1341, 1341, 1341, 1341,
+
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1408, 1408, 1408, 1408,
+ 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1408,
+
+ 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1408,
+ 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1446,
+ 1446, 1409, 1409, 1409, 1409, 1409, 1409, 1409,
+ 1409, 1409, 1409, 1409, 1447, 1447, 1447, 1447,
+
+ 1447, 1447, 1410, 1410, 1410, 1410, 1410, 1410,
+ 1448, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1450, 1450, 1450, 1450, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 200, 200, 200, 200, 200,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 1315, 1315, 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,
+ 51, 51, 51, 51, 51, 1402, 1402, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
+ 51, 51, 51, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370,
- 1371, 65, 65, 65, 65, 65, 65, 65,
- 65, 65, 65, 65, 1363, 1364, 1365, 1366,
- 1367, 1368, 1369, 1370, 1371, 65, 65, 65,
+ 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459,
+ 1460, 65, 65, 65, 65, 65, 65, 65,
+ 65, 65, 65, 65, 1452, 1453, 1454, 1455,
+ 1456, 1457, 1458, 1459, 1460, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65,
- 63, 58, 59, 1273, 1274, 1275, 1276, 1277,
- 1278, 1372, 1372, 1372, 1372, 1372, 1372, 1372,
- 1372, 1372, 1372, 1372, 1373, 1373, 1373, 1373,
+ 63, 58, 59, 1359, 1360, 1361, 1362, 1363,
+ 1364, 1461, 1461, 1461, 1461, 1461, 1461, 1461,
+ 1461, 1461, 1461, 1461, 1462, 1462, 1462, 1462,
- 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
- 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
- 1373, 1373, 1373, 1373, 1373, 1373, 1374, 1374,
- 1374, 1374, 1374, 1374, 1374, 1374, 1374, 1374,
+ 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
+ 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
+ 1462, 1462, 1462, 1462, 1462, 1462, 1463, 1463,
+ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
- 1374, 1374, 1374, 1374, 1374, 1374, 1374, 1374,
- 1374, 1374, 1374, 1374, 1374, 1374, 1374, 1374,
- 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1375,
- 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1375,
+ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
+ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
+ 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464,
+ 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464,
- 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1375,
- 1375, 1375, 1376, 1377, 1377, 1377, 1377, 1377,
- 1377, 1377, 1377, 1377, 1377, 1378, 1379, 1380,
- 1381, 1382, 1383, 1384, 1385, 1386, 1377, 1387,
+ 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464,
+ 1464, 1464, 1465, 1466, 1466, 1466, 1466, 1466,
+ 1466, 1466, 1466, 1466, 1466, 1467, 1468, 1469,
+ 1470, 1471, 1472, 1473, 1474, 1475, 1466, 1476,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 1321, 1321,
- 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321,
+ 51, 51, 51, 51, 51, 51, 1408, 1408,
+ 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1408,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
@@ -2188,3172 +2193,3552 @@ static const unsigned short uc_property_trie[] = {
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
+ 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
- 1352, 1352, 1352, 1352, 51, 51, 51, 51,
+ 1441, 1441, 1441, 1441, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 1388, 1388, 1321, 1321,
- 1389, 1315, 1352, 1352, 1352, 1352, 1352, 1352,
+ 51, 51, 51, 51, 1477, 1477, 1408, 1408,
+ 1478, 1402, 1441, 1441, 1441, 1441, 1441, 1441,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 1352, 1352, 1352, 51, 51, 51, 51,
+ 51, 1441, 1441, 1441, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 1352, 51, 51, 51, 51, 51, 51, 36,
- 1315, 1315, 1321, 1321, 1321, 1321, 1321, 1321,
- 1321, 1321, 1321, 1321, 1321, 1321, 1322, 1389,
-
- 1321, 1321, 1321, 1321, 1321, 1321, 1321, 1321,
- 1321, 1321, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1322, 1322, 1322, 1322, 1322, 1322,
- 1322, 1322, 1322, 1322, 1322, 1390, 1359, 1359,
-
- 1357, 1357, 1322, 1322, 1322, 1322, 1322, 1322,
- 1322, 1322, 1322, 1322, 1391, 1322, 1322, 1322,
- 1322, 1322, 1323, 1390, 1390, 1390, 1390, 1390,
- 1390, 1390, 1390, 1390, 1390, 1392, 1392, 1392,
-
- 1393, 1393, 1393, 1393, 1392, 1392, 1392, 1392,
- 1392, 1359, 1359, 1359, 1359, 1392, 1360, 1392,
- 1392, 1392, 1359, 1392, 1392, 1359, 1359, 1359,
- 1392, 1392, 1359, 1359, 1392, 1359, 1359, 1392,
-
- 1392, 1392, 1360, 1359, 1360, 1360, 1360, 1360,
- 1359, 1359, 1392, 1359, 1359, 1359, 1359, 1359,
- 1359, 1392, 1392, 1392, 1392, 1392, 1359, 1392,
- 1392, 1392, 1392, 1359, 1359, 1392, 1392, 1392,
-
- 1394, 1352, 1352, 1352, 1352, 1360, 51, 51,
- 1352, 1352, 1361, 1361, 1352, 1352, 51, 51,
+ 1441, 51, 51, 51, 51, 51, 51, 36,
+ 1402, 1402, 1408, 1408, 1408, 1408, 1408, 1408,
+ 1408, 1408, 1408, 1408, 1408, 1408, 1409, 1478,
+
+ 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1408,
+ 1408, 1408, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1409, 1409, 1409, 1409, 1409, 1409,
+ 1409, 1409, 1409, 1409, 1409, 1479, 1448, 1448,
+
+ 1446, 1446, 1409, 1409, 1409, 1409, 1409, 1409,
+ 1409, 1409, 1409, 1409, 1480, 1409, 1409, 1409,
+ 1409, 1409, 1410, 1479, 1479, 1479, 1479, 1479,
+ 1479, 1479, 1479, 1479, 1479, 1481, 1481, 1481,
+
+ 1482, 1482, 1482, 1482, 1481, 1481, 1481, 1481,
+ 1481, 1448, 1448, 1448, 1448, 1481, 1449, 1481,
+ 1481, 1481, 1448, 1481, 1481, 1448, 1448, 1448,
+ 1481, 1481, 1448, 1448, 1481, 1448, 1448, 1481,
+
+ 1481, 1481, 1449, 1448, 1449, 1449, 1449, 1449,
+ 1448, 1448, 1481, 1448, 1448, 1448, 1448, 1448,
+ 1448, 1481, 1481, 1481, 1481, 1481, 1448, 1481,
+ 1481, 1481, 1481, 1448, 1448, 1481, 1481, 1481,
+
+ 1483, 1441, 1441, 1441, 1441, 1449, 51, 51,
+ 1441, 1441, 1450, 1450, 1441, 1441, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 1360, 51, 51, 51, 51, 51, 51, 51,
+ 1449, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 1360, 51, 1360, 51,
- 51, 51, 51, 1360, 1360, 1360, 51, 1359,
- 51, 51, 51, 1395, 1395, 1395, 1395, 1396,
-
- 1396, 51, 1397, 1397, 51, 51, 51, 51,
- 1398, 1399, 1398, 1399, 1398, 1399, 1398, 1399,
- 1398, 1399, 1398, 1399, 1398, 1399, 1400, 1401,
- 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409,
-
- 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407,
- 1408, 1409, 1400, 1401, 1402, 1403, 1404, 1405,
- 1406, 1407, 1408, 1409, 51, 1360, 1360, 1360,
+ 51, 51, 51, 51, 1449, 51, 1449, 51,
+ 51, 51, 51, 1449, 1449, 1449, 51, 1448,
+ 51, 51, 51, 1484, 1484, 1484, 1484, 1485,
+
+ 1485, 51, 1486, 1486, 51, 51, 51, 51,
+ 1487, 1488, 1487, 1488, 1487, 1488, 1487, 1488,
+ 1487, 1488, 1487, 1488, 1487, 1488, 1489, 1490,
+ 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498,
+
+ 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496,
+ 1497, 1498, 1489, 1490, 1491, 1492, 1493, 1494,
+ 1495, 1496, 1497, 1498, 51, 1449, 1449, 1449,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51,
- 1360, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 1360,
-
- 1410, 1410, 1410, 1411, 1412, 1413, 1414, 1358,
- 1415, 1416, 1358, 1417, 1418, 1419, 1420, 1420,
- 1255, 1255, 1255, 1255, 1255, 1421, 1422, 1255,
- 1255, 1255, 1255, 1255, 1255, 1421, 1422, 1255,
-
- 1255, 1255, 1421, 1422, 1421, 1422, 1398, 1399,
- 1398, 1399, 1398, 1399, 1423, 1424, 1423, 1424,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
-
- 1425, 1425, 1425, 1425, 1425, 1425, 1425, 1425,
- 1425, 1425, 1425, 1425, 1425, 1425, 1425, 1425,
- 1425, 1425, 1425, 1425, 1425, 1425, 1425, 1425,
- 1425, 1425, 1425, 1425, 1425, 1425, 1425, 1425,
-
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
-
- 1255, 1255, 1255, 1398, 1399, 1398, 1399, 1398,
- 1399, 1398, 1399, 1398, 1399, 1426, 1427, 1428,
- 1429, 1398, 1399, 1398, 1399, 1398, 1399, 1398,
- 1399, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
-
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1430, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
-
- 1421, 1422, 1255, 1255, 1421, 1422, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1421,
- 1422, 1421, 1422, 1255, 1421, 1422, 1255, 1255,
- 1398, 1399, 1398, 1399, 1255, 1255, 1255, 1255,
-
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1431, 1255, 1255,
- 1421, 1422, 1255, 1255, 1398, 1399, 1255, 1255,
-
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1320, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
-
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1421, 1422, 1421, 1422, 1255,
- 1255, 1255, 1255, 1255, 1421, 1422, 1255, 1255,
- 1255, 1255, 1255, 1255, 1421, 1422, 1255, 1255,
-
- 1255, 1255, 1255, 1255, 1421, 1422, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,
- 1255, 1255, 1255, 1255, 1320, 1320, 1320, 1255,
- 1255, 1421, 1422, 1255, 1255, 1421, 1422, 1421,
-
- 1422, 1421, 1422, 1421, 1422, 1255, 1255, 1255,
- 1255, 1255, 1255, 1421, 1422, 1255, 1255, 1255,
- 1255, 1421, 1422, 1421, 1422, 1421, 1422, 1421,
- 1422, 1421, 1422, 1421, 1422, 1255, 1255, 1255,
-
- 1255, 1421, 1422, 1255, 1255, 1255, 1421, 1422,
- 1421, 1422, 1421, 1422, 1421, 1422, 1255, 1421,
- 1422, 1255, 1255, 1421, 1422, 1255, 1255, 1255,
- 1255, 1255, 1255, 1421, 1422, 1421, 1422, 1421,
-
- 1422, 1421, 1422, 1421, 1422, 1421, 1422, 1255,
- 1255, 1255, 1255, 1255, 1255, 1421, 1422, 1421,
- 1422, 1421, 1422, 1421, 1422, 1421, 1422, 1255,
- 1255, 1255, 1255, 1255, 1432, 1255, 1433, 1255,
-
- 1255, 1255, 1255, 1434, 1435, 1434, 1255, 1255,
- 1255, 1255, 1255, 1255, 1421, 1422, 1255, 1255,
- 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1421,
- 1422, 1421, 1422, 1255, 1255, 1255, 1255, 1255,
-
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1322, 1322,
- 1322, 1322, 1322, 1322, 1323, 1323, 1323, 1323,
- 1323, 1323, 1323, 1390, 1390, 1390, 1390, 1390,
-
- 1323, 1323, 1323, 1323, 1390, 1390, 1390, 1390,
- 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390,
- 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
- 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
-
- 1418, 1418, 1418, 1418, 1418, 1390, 1390, 1418,
- 1418, 1418, 1418, 1418, 1418, 1362, 1362, 1362,
- 1390, 1390, 1390, 1390, 1390, 1359, 1359, 1359,
- 1359, 1359, 1362, 1362, 1362, 1362, 1362, 1362,
-
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 199, 199, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
-
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 199, 199,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
-
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 199, 199, 199, 1362, 1362, 1362,
-
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 199, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436,
- 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436,
- 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436,
- 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436,
-
- 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436,
- 1436, 1436, 1436, 1436, 1436, 1436, 1436, 199,
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437,
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437,
-
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437,
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437,
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437,
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 199,
-
- 127, 123, 1438, 1439, 1440, 1441, 1442, 127,
- 123, 127, 123, 127, 123, 1443, 1444, 1445,
- 1446, 1097, 1099, 1100, 1447, 127, 123, 1447,
- 1097, 1097, 1097, 1097, 1448, 1448, 1449, 1450,
-
- 1451, 1452, 1451, 1452, 1451, 1452, 1451, 1452,
- 1451, 1452, 1451, 1452, 1451, 1452, 1451, 1452,
- 1451, 1452, 1451, 1452, 1451, 1452, 1451, 1452,
- 1451, 1452, 1451, 1452, 1451, 1452, 1451, 1452,
-
- 1451, 1452, 1451, 1452, 1453, 1454, 1454, 1454,
- 1454, 1454, 1454, 1455, 1456, 1455, 1456, 1457,
- 1457, 1457, 1458, 1459, 199, 199, 199, 199,
- 199, 1460, 1461, 1461, 1461, 1462, 1460, 1461,
+ 1449, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 1449,
+
+ 1499, 1499, 1499, 1500, 1501, 1502, 1503, 1447,
+ 1504, 1505, 1447, 1506, 1507, 1508, 1509, 1509,
+ 1341, 1341, 1341, 1341, 1341, 1510, 1511, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1510, 1511, 1341,
+
+ 1341, 1341, 1510, 1511, 1510, 1511, 1487, 1488,
+ 1487, 1488, 1487, 1488, 1512, 1513, 1512, 1513,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+
+ 1514, 1514, 1514, 1514, 1514, 1514, 1514, 1514,
+ 1514, 1514, 1514, 1514, 1514, 1514, 1514, 1514,
+ 1514, 1514, 1514, 1514, 1514, 1514, 1514, 1514,
+ 1514, 1514, 1514, 1514, 1514, 1514, 1514, 1514,
+
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+
+ 1341, 1341, 1341, 1487, 1488, 1487, 1488, 1487,
+ 1488, 1487, 1488, 1487, 1488, 1515, 1516, 1517,
+ 1518, 1487, 1488, 1487, 1488, 1487, 1488, 1487,
+ 1488, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1519, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+
+ 1510, 1511, 1341, 1341, 1510, 1511, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1510,
+ 1511, 1510, 1511, 1341, 1510, 1511, 1341, 1341,
+ 1487, 1488, 1487, 1488, 1341, 1341, 1341, 1341,
+
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1520, 1341, 1341,
+ 1510, 1511, 1341, 1341, 1487, 1488, 1341, 1341,
+
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1407, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1510, 1511, 1510, 1511, 1341,
+ 1341, 1341, 1341, 1341, 1510, 1511, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1510, 1511, 1341, 1341,
+
+ 1341, 1341, 1341, 1341, 1510, 1511, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1407, 1407, 1407, 1341,
+ 1341, 1510, 1511, 1341, 1341, 1510, 1511, 1510,
+
+ 1511, 1510, 1511, 1510, 1511, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1510, 1511, 1341, 1341, 1341,
+ 1341, 1510, 1511, 1510, 1511, 1510, 1511, 1510,
+ 1511, 1510, 1511, 1510, 1511, 1341, 1341, 1341,
+
+ 1341, 1510, 1511, 1341, 1341, 1341, 1510, 1511,
+ 1510, 1511, 1510, 1511, 1510, 1511, 1341, 1510,
+ 1511, 1341, 1341, 1510, 1511, 1341, 1341, 1341,
+ 1341, 1341, 1341, 1510, 1511, 1510, 1511, 1510,
+
+ 1511, 1510, 1511, 1510, 1511, 1510, 1511, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1510, 1511, 1510,
+ 1511, 1510, 1511, 1510, 1511, 1510, 1511, 1341,
+ 1341, 1341, 1341, 1341, 1521, 1341, 1522, 1341,
+
+ 1341, 1341, 1341, 1523, 1524, 1523, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1510, 1511, 1341, 1341,
+ 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1510,
+ 1511, 1510, 1511, 1341, 1341, 1341, 1341, 1341,
+
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1409, 1409,
+ 1409, 1409, 1409, 1409, 1410, 1410, 1410, 1410,
+ 1410, 1410, 1410, 1479, 1479, 1479, 1479, 1479,
+
+ 1410, 1410, 1410, 1410, 1479, 1479, 1479, 1479,
+ 1479, 1479, 1479, 1479, 1479, 1479, 1479, 1479,
+ 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507,
+ 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507,
+
+ 1507, 1507, 1507, 1507, 1507, 1479, 1479, 1507,
+ 1507, 1507, 1507, 1507, 1507, 1451, 1451, 1451,
+ 1479, 1479, 1479, 1479, 1479, 1448, 1448, 1448,
+ 1448, 1448, 1451, 1451, 1451, 1451, 1451, 1451,
+
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 200, 200, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 200, 200,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 200, 200, 200, 1451, 1451, 1451,
+
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 200, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 1418, 1418, 1418, 1418,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1525,
+ 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1525,
+ 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1525,
+ 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1525,
+
+ 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1525,
+ 1525, 1525, 1525, 1525, 1525, 1525, 1525, 200,
+ 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
+ 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
+
+ 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
+ 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
+ 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
+ 1526, 1526, 1526, 1526, 1526, 1526, 1526, 200,
+
+ 127, 123, 1527, 1528, 1529, 1530, 1531, 127,
+ 123, 127, 123, 127, 123, 1532, 1533, 1534,
+ 1535, 1183, 1185, 1186, 1536, 127, 123, 1536,
+ 1183, 1183, 1183, 1183, 1537, 1537, 1538, 1539,
+
+ 1540, 1541, 1540, 1541, 1540, 1541, 1540, 1541,
+ 1540, 1541, 1540, 1541, 1540, 1541, 1540, 1541,
+ 1540, 1541, 1540, 1541, 1540, 1541, 1540, 1541,
+ 1540, 1541, 1540, 1541, 1540, 1541, 1540, 1541,
+
+ 1540, 1541, 1540, 1541, 1542, 1543, 1543, 1543,
+ 1543, 1543, 1543, 1544, 1545, 1544, 1545, 1546,
+ 1546, 1546, 1547, 1548, 200, 200, 200, 200,
+ 200, 1549, 1550, 1550, 1550, 1551, 1549, 1550,
- 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
- 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
- 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
- 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463,
+ 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
+ 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
+ 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
+ 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
- 1463, 1463, 1463, 1463, 1463, 1463, 199, 1464,
- 199, 199, 199, 199, 199, 1464, 199, 199,
- 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
- 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ 1552, 1552, 1552, 1552, 1552, 1552, 200, 1553,
+ 200, 200, 200, 200, 200, 1553, 200, 200,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
- 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
- 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
- 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1465, 1465, 1465, 1465, 1465, 1465, 1466, 1466,
- 199, 199, 199, 199, 199, 199, 199, 1467,
- 1468, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 1469,
+ 1554, 1554, 1554, 1554, 1554, 1554, 1555, 1555,
+ 200, 200, 200, 200, 200, 200, 200, 1556,
+ 1557, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 1558,
+
+ 836, 836, 836, 836, 836, 836, 836, 836,
+ 836, 836, 836, 836, 836, 836, 836, 836,
+ 836, 836, 836, 836, 836, 836, 836, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 836, 836, 836, 836, 836, 836, 836, 200,
+ 836, 836, 836, 836, 836, 836, 836, 200,
+ 836, 836, 836, 836, 836, 836, 836, 200,
+ 836, 836, 836, 836, 836, 836, 836, 200,
+
+ 265, 265, 265, 265, 265, 265, 265, 265,
+ 265, 265, 265, 265, 265, 265, 265, 265,
+ 265, 265, 265, 265, 265, 265, 265, 265,
+ 265, 265, 265, 265, 265, 265, 265, 265,
+
+ 1559, 1559, 1560, 1561, 1560, 1561, 1559, 1559,
+ 1559, 1560, 1561, 1559, 1560, 1561, 1345, 1345,
+ 1345, 1345, 1345, 1345, 1345, 1345, 1344, 1562,
+ 1563, 1564, 1565, 1566, 1560, 1561, 1566, 1566,
+
+ 1567, 1568, 1512, 1513, 1512, 1513, 1512, 1513,
+ 1512, 1513, 1564, 1564, 1564, 1564, 1569, 1570,
+ 1564, 1571, 1572, 1573, 1573, 1572, 1572, 1572,
+ 1572, 1572, 1574, 1574, 1575, 1576, 1576, 1577,
+
+ 1578, 1576, 1579, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 200, 1580, 1580, 1580, 1580, 1581,
+
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
+ 1580, 1580, 1580, 1581, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
+ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
+ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
+ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
+
+ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
+ 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
+ 1581, 1581, 1581, 1581, 1581, 1581, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582,
+ 1582, 1582, 1582, 1582, 200, 200, 200, 200,
+
+ 1299, 1583, 1584, 1585, 1441, 1586, 1587, 1588,
+ 16, 1336, 16, 1336, 16, 1336, 16, 1336,
+ 16, 1336, 1441, 1441, 16, 1336, 16, 1336,
+ 16, 1336, 16, 1336, 1589, 1314, 1590, 1590,
+
+ 1441, 1588, 1588, 1588, 1588, 1588, 1588, 1588,
+ 1588, 1588, 1591, 1592, 172, 1593, 1594, 1594,
+ 1595, 1596, 1596, 1596, 1596, 1597, 1598, 1441,
+ 1599, 1599, 1599, 1600, 1601, 1602, 1582, 1441,
+
+ 200, 1603, 1604, 1603, 1604, 1603, 1604, 1603,
+ 1604, 1603, 1604, 1604, 1605, 1604, 1605, 1604,
+ 1605, 1604, 1605, 1604, 1605, 1604, 1605, 1604,
+ 1605, 1604, 1605, 1604, 1605, 1604, 1605, 1604,
+
+ 1605, 1604, 1605, 1603, 1604, 1605, 1604, 1605,
+ 1604, 1605, 1604, 1604, 1604, 1604, 1604, 1604,
+ 1605, 1605, 1604, 1605, 1605, 1604, 1605, 1605,
+ 1604, 1605, 1605, 1604, 1605, 1605, 1604, 1604,
+
+ 1604, 1604, 1604, 1603, 1604, 1603, 1604, 1603,
+ 1604, 1604, 1604, 1604, 1604, 1604, 1603, 1604,
+ 1604, 1604, 1604, 1604, 1605, 1606, 1606, 200,
+ 200, 1607, 1607, 1608, 1608, 1609, 1610, 1611,
+
+ 1612, 1613, 1614, 1613, 1614, 1613, 1614, 1613,
+ 1614, 1613, 1614, 1614, 1615, 1614, 1615, 1614,
+ 1615, 1614, 1615, 1614, 1615, 1614, 1615, 1614,
+ 1615, 1614, 1615, 1614, 1615, 1614, 1615, 1614,
+
+ 1615, 1614, 1615, 1613, 1614, 1615, 1614, 1615,
+ 1614, 1615, 1614, 1614, 1614, 1614, 1614, 1614,
+ 1615, 1615, 1614, 1615, 1615, 1614, 1615, 1615,
+ 1614, 1615, 1615, 1614, 1615, 1615, 1614, 1614,
+
+ 1614, 1614, 1614, 1613, 1614, 1613, 1614, 1613,
+ 1614, 1614, 1614, 1614, 1614, 1614, 1613, 1614,
+ 1614, 1614, 1614, 1614, 1615, 1613, 1613, 1615,
+ 1615, 1615, 1615, 1616, 1617, 1618, 1619, 1620,
+
+ 200, 200, 200, 200, 200, 1621, 1621, 1621,
+ 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621,
+ 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621,
+ 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621,
+
+ 1621, 1621, 1621, 1621, 1621, 1621, 1621, 1621,
+ 1621, 1621, 1621, 1621, 1621, 1622, 200, 200,
+ 200, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+ 1623, 1623, 1623, 1623, 1623, 1623, 1623, 200,
+ 1624, 1624, 1625, 1625, 1625, 1625, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
- 830, 830, 830, 830, 830, 830, 830, 830,
- 830, 830, 830, 830, 830, 830, 830, 830,
- 830, 830, 830, 830, 830, 830, 830, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 830, 830, 830, 830, 830, 830, 830, 199,
- 830, 830, 830, 830, 830, 830, 830, 199,
- 830, 830, 830, 830, 830, 830, 830, 199,
- 830, 830, 830, 830, 830, 830, 830, 199,
-
- 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 264,
-
- 1470, 1470, 1471, 1472, 1471, 1472, 1470, 1470,
- 1470, 1471, 1472, 1470, 1471, 1472, 1259, 1259,
- 1259, 1259, 1259, 1259, 1259, 1259, 1258, 1473,
- 1474, 1475, 1476, 1477, 1471, 1472, 1477, 1477,
-
- 1478, 1479, 1423, 1424, 1423, 1424, 1423, 1424,
- 1423, 1424, 1475, 1475, 1475, 1475, 1480, 1481,
- 1475, 1482, 1483, 1484, 1484, 1483, 1483, 1483,
- 1483, 1483, 1485, 1485, 1486, 1487, 1487, 1488,
-
- 1489, 1487, 1490, 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,
-
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 199, 1491, 1491, 1491, 1491, 1492,
-
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
-
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
- 1491, 1491, 1491, 1492, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
- 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
- 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
- 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
-
- 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
- 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
- 1492, 1492, 1492, 1492, 1492, 1492, 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,
- 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493,
- 1493, 1493, 1493, 1493, 199, 199, 199, 199,
-
- 1213, 1494, 1495, 1496, 1352, 1497, 1498, 1499,
- 16, 1250, 16, 1250, 16, 1250, 16, 1250,
- 16, 1250, 1352, 1352, 16, 1250, 16, 1250,
- 16, 1250, 16, 1250, 1500, 1228, 1501, 1501,
-
- 1352, 1499, 1499, 1499, 1499, 1499, 1499, 1499,
- 1499, 1499, 1502, 1503, 171, 1504, 1505, 1505,
- 1506, 1507, 1507, 1507, 1507, 1508, 1509, 1352,
- 1510, 1510, 1510, 1511, 1512, 1513, 1493, 1352,
-
- 199, 1514, 1515, 1514, 1515, 1514, 1515, 1514,
- 1515, 1514, 1515, 1515, 1516, 1515, 1516, 1515,
- 1516, 1515, 1516, 1515, 1516, 1515, 1516, 1515,
- 1516, 1515, 1516, 1515, 1516, 1515, 1516, 1515,
-
- 1516, 1515, 1516, 1514, 1515, 1516, 1515, 1516,
- 1515, 1516, 1515, 1515, 1515, 1515, 1515, 1515,
- 1516, 1516, 1515, 1516, 1516, 1515, 1516, 1516,
- 1515, 1516, 1516, 1515, 1516, 1516, 1515, 1515,
-
- 1515, 1515, 1515, 1514, 1515, 1514, 1515, 1514,
- 1515, 1515, 1515, 1515, 1515, 1515, 1514, 1515,
- 1515, 1515, 1515, 1515, 1516, 1517, 1517, 199,
- 199, 1518, 1518, 1519, 1519, 1520, 1521, 1522,
-
- 1523, 1524, 1525, 1524, 1525, 1524, 1525, 1524,
- 1525, 1524, 1525, 1525, 1526, 1525, 1526, 1525,
- 1526, 1525, 1526, 1525, 1526, 1525, 1526, 1525,
- 1526, 1525, 1526, 1525, 1526, 1525, 1526, 1525,
-
- 1526, 1525, 1526, 1524, 1525, 1526, 1525, 1526,
- 1525, 1526, 1525, 1525, 1525, 1525, 1525, 1525,
- 1526, 1526, 1525, 1526, 1526, 1525, 1526, 1526,
- 1525, 1526, 1526, 1525, 1526, 1526, 1525, 1525,
-
- 1525, 1525, 1525, 1524, 1525, 1524, 1525, 1524,
- 1525, 1525, 1525, 1525, 1525, 1525, 1524, 1525,
- 1525, 1525, 1525, 1525, 1526, 1524, 1524, 1526,
- 1526, 1526, 1526, 1527, 1528, 1529, 1530, 1531,
-
- 199, 199, 199, 199, 199, 1532, 1532, 1532,
- 1532, 1532, 1532, 1532, 1532, 1532, 1532, 1532,
- 1532, 1532, 1532, 1532, 1532, 1532, 1532, 1532,
- 1532, 1532, 1532, 1532, 1532, 1532, 1532, 1532,
-
- 1532, 1532, 1532, 1532, 1532, 1532, 1532, 1532,
- 1532, 1532, 1532, 1532, 1532, 1533, 199, 199,
- 199, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
-
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
-
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534,
- 1534, 1534, 1534, 1534, 1534, 1534, 1534, 199,
- 1535, 1535, 1536, 1536, 1536, 1536, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
-
- 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
- 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
- 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
- 1539, 1539, 1539, 199, 199, 199, 199, 199,
-
- 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
- 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
-
- 1393, 1393, 1393, 1393, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540,
- 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540,
-
- 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
- 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
- 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
- 1541, 1541, 1541, 1541, 1541, 1542, 1542, 199,
-
- 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,
- 1536, 1536, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
-
- 1537, 1537, 1537, 1537, 1543, 1543, 1543, 1543,
- 1544, 1544, 1544, 1544, 1544, 1544, 1544, 1544,
- 1545, 1546, 1546, 1546, 1546, 1546, 1546, 1546,
- 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546,
-
- 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
- 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
- 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
- 1541, 1541, 1541, 1541, 1542, 1542, 1547, 1535,
-
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1546, 1546, 1546, 1546, 1546, 1546, 1546,
- 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546,
-
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1545, 1545, 1545, 1545,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
+ 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627,
+ 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627,
+ 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627,
+ 1628, 1628, 1628, 200, 200, 200, 200, 200,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 199,
+ 1478, 1478, 1478, 1478, 1478, 1478, 1478, 1478,
+ 1478, 1478, 1478, 1478, 1478, 1478, 1478, 1478,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
+ 1482, 1482, 1482, 1482, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629,
+ 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
-
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1545,
- 1545, 1545, 1545, 1537, 1537, 1537, 1537, 1537,
-
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
-
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1545, 1545,
-
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537,
- 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1545,
-
- 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549,
- 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549,
- 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549,
- 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549,
-
- 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549,
- 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549,
- 1549, 1549, 1549, 1549, 1549, 1549, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
-
- 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551,
- 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551,
- 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551,
- 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551,
-
- 1551, 1551, 1551, 1551, 1551, 1551, 1552, 1552,
- 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
- 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
- 1552, 1552, 1552, 1552, 1553, 1553, 1553, 1553,
-
- 1553, 1553, 1553, 1553, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1555, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 1557, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
-
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
-
- 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556,
- 1556, 1556, 1556, 1556, 1556, 199, 199, 199,
- 1558, 1558, 1558, 1558, 1558, 1558, 1558, 1558,
- 1558, 1558, 1558, 1558, 1558, 1558, 1558, 1558,
-
- 1558, 1558, 1559, 1559, 1558, 1558, 1558, 1558,
- 1558, 1558, 1558, 1558, 1558, 1558, 1558, 1558,
- 1558, 1558, 1558, 1558, 1559, 1558, 1558, 1558,
- 1558, 1558, 1558, 1558, 1558, 1558, 1558, 1558,
-
- 1558, 1559, 1558, 1558, 1558, 1559, 1558, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1560,
- 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1560,
-
- 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1560,
- 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1560,
- 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1560,
- 1561, 1561, 1561, 1561, 1561, 1561, 1562, 1563,
-
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
-
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
- 1564, 1564, 1564, 1564, 1565, 1566, 1567, 1568,
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
- 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564,
-
- 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576,
- 1577, 1578, 1564, 1564, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 278, 279, 278, 279, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 278, 279,
-
- 282, 283, 278, 279, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 1579, 264,
- 1580, 1580, 1580, 1581, 1582, 1582, 1582, 1582,
- 1582, 1582, 1582, 1582, 264, 264, 1581, 1583,
-
- 278, 279, 278, 279, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 278, 279,
- 278, 279, 278, 279, 278, 279, 278, 279,
- 284, 285, 284, 285, 1584, 1584, 199, 1582,
-
- 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1585,
- 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1585,
- 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1585,
- 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1585,
-
- 1585, 1585, 1585, 1585, 1585, 1585, 1586, 1586,
- 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586,
- 1587, 1587, 1588, 1589, 1590, 1590, 1590, 1589,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591,
- 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591,
- 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1592,
- 1592, 1592, 1592, 1481, 1481, 1481, 1481, 1481,
-
- 1593, 1593, 1099, 1100, 1099, 1100, 1099, 1100,
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1097, 1097, 1099, 1100, 1099, 1100, 1099, 1100,
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
-
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
-
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1448, 1097, 1097, 1097, 1097, 1097, 1097, 1097,
- 1097, 1099, 1100, 1099, 1100, 1594, 1099, 1100,
-
- 1099, 1100, 1099, 1100, 1099, 1100, 1099, 1100,
- 1481, 1595, 1595, 1099, 1100, 1596, 1597, 199,
- 1598, 1599, 1600, 1601, 1602, 1602, 1603, 1604,
- 1603, 1604, 1603, 1604, 1603, 1604, 1603, 1604,
-
- 1598, 1599, 1598, 1599, 1598, 1599, 1598, 1599,
- 1598, 1599, 1605, 1606, 1607, 1608, 199, 199,
- 1609, 1610, 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, 199, 199, 199, 199, 199, 199, 1611,
- 1612, 1612, 1597, 1613, 1613, 1613, 1613, 1613,
-
- 1614, 1614, 1615, 1614, 1614, 1614, 1616, 1614,
- 1614, 1614, 1614, 1615, 1614, 1614, 1614, 1614,
- 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614,
- 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614,
-
- 1614, 1614, 1614, 1617, 1617, 1615, 1615, 1617,
- 1618, 1618, 1618, 1618, 199, 199, 199, 199,
- 1544, 1544, 1544, 1544, 1544, 1544, 772, 772,
- 1290, 1619, 199, 199, 199, 199, 199, 199,
-
- 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
- 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
- 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
- 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
-
- 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
- 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
- 1620, 1620, 1621, 1622, 1623, 1623, 1624, 1624,
- 199, 199, 199, 199, 199, 199, 199, 199,
+ 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+ 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+ 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+ 1630, 1630, 1630, 1630, 1630, 1631, 1631, 200,
+ 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625,
1625, 1625, 1626, 1626, 1626, 1626, 1626, 1626,
1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+
+ 1626, 1626, 1626, 1626, 1632, 1632, 1632, 1632,
+ 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633,
+ 1634, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
+ 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
+
+ 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+ 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+ 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+ 1630, 1630, 1630, 1630, 1631, 1631, 1636, 1624,
+
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
+ 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1634, 1634, 1634, 1634,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 200,
+
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+ 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
- 1626, 1626, 1626, 1626, 1625, 1625, 1625, 1625,
- 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625,
- 1625, 1625, 1625, 1625, 1627, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 1628, 1628,
- 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636,
- 1637, 1638, 199, 199, 199, 199, 199, 199,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1634,
+ 1634, 1634, 1634, 1626, 1626, 1626, 1626, 1626,
+
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1634, 1634,
+
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+ 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1634,
+ 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+ 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+ 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+ 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+
+ 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+ 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+ 1638, 1638, 1638, 1638, 1638, 1638, 1639, 1639,
1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+
+ 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640,
+ 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640,
+ 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640,
+ 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640,
+
+ 1640, 1640, 1640, 1640, 1640, 1640, 1641, 1641,
+ 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641,
+ 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641,
+ 1641, 1641, 1641, 1641, 1642, 1642, 1642, 1642,
+
+ 1642, 1642, 1642, 1642, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1644, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1639, 1639,
1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
- 1639, 1639, 490, 490, 490, 490, 490, 490,
- 1640, 1640, 1640, 490, 199, 199, 199, 199,
-
- 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648,
- 1649, 1650, 1651, 1651, 1651, 1651, 1651, 1651,
- 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651,
- 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651,
-
- 1651, 1651, 1651, 1651, 1651, 1651, 1652, 1652,
- 1652, 1652, 1652, 1653, 1653, 1653, 1654, 1655,
- 1656, 1656, 1656, 1656, 1656, 1656, 1656, 1656,
- 1656, 1656, 1656, 1656, 1656, 1656, 1656, 1656,
-
- 1656, 1656, 1656, 1656, 1656, 1656, 1656, 1657,
- 1657, 1657, 1657, 1657, 1657, 1657, 1657, 1657,
- 1657, 1657, 1658, 1659, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 1660,
-
- 822, 822, 822, 822, 822, 822, 822, 822,
- 822, 822, 822, 822, 822, 822, 822, 822,
- 822, 822, 822, 822, 822, 822, 822, 822,
- 822, 822, 822, 822, 822, 199, 199, 199,
-
- 1661, 1661, 1661, 1662, 1663, 1663, 1663, 1663,
- 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
- 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
- 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
-
- 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
- 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
- 1663, 1663, 1663, 1664, 1662, 1662, 1661, 1661,
- 1661, 1661, 1662, 1662, 1661, 1662, 1662, 1662,
-
- 1665, 1666, 1666, 1666, 1666, 1666, 1666, 1667,
- 1668, 1668, 1666, 1666, 1666, 1666, 199, 1669,
- 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677,
- 1678, 1679, 199, 199, 199, 199, 1666, 1666,
-
- 1680, 1680, 1680, 1680, 1680, 1681, 1682, 1680,
- 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680,
- 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690,
- 1691, 1692, 1680, 1680, 1680, 1680, 1680, 199,
-
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
-
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1694, 1694, 1694, 1694, 1694, 1694, 1695,
- 1695, 1694, 1694, 1695, 1695, 1694, 1694, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1693, 1693, 1693, 1694, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1694, 1695, 199, 199,
- 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703,
- 1704, 1705, 199, 199, 1706, 1707, 1707, 1707,
-
- 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708,
- 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708,
- 1709, 1708, 1708, 1708, 1708, 1708, 1708, 1710,
- 1710, 1710, 1708, 810, 1681, 1711, 1680, 1680,
-
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
-
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
- 1713, 1712, 1713, 1713, 1714, 1712, 1712, 1713,
- 1713, 1712, 1712, 1712, 1712, 1712, 1713, 1713,
-
- 1712, 1713, 1712, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 1712, 1712, 1715, 1716, 1716,
-
- 1717, 1717, 1717, 1717, 1717, 1717, 1717, 1717,
- 1717, 1717, 1717, 1718, 1719, 1719, 1718, 1718,
- 1720, 1720, 1717, 1721, 1721, 1718, 1722, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 199, 1723, 1723, 1723, 1723, 1723, 1723, 199,
- 199, 1723, 1723, 1723, 1723, 1723, 1723, 199,
- 199, 1723, 1723, 1723, 1723, 1723, 1723, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1723, 1723, 1723, 1723, 1723, 1723, 1723, 199,
- 1723, 1723, 1723, 1723, 1723, 1723, 1723, 199,
- 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1602,
- 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1602,
-
- 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1602,
- 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1602,
- 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1602,
- 1602, 1602, 1602, 1724, 1725, 1725, 1725, 1725,
-
- 199, 199, 199, 199, 1602, 1726, 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,
-
- 1727, 1727, 1727, 1727, 1727, 1727, 1727, 1727,
- 1727, 1727, 1727, 1727, 1727, 1727, 1727, 1727,
- 1727, 1727, 1727, 1727, 1727, 1727, 1727, 1727,
- 1727, 1727, 1727, 1727, 1727, 1727, 1727, 1727,
-
- 1727, 1727, 1727, 1728, 1728, 1729, 1728, 1728,
- 1729, 1728, 1728, 1730, 1728, 1731, 199, 199,
- 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739,
- 1740, 1741, 199, 199, 199, 199, 199, 199,
-
- 1742, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1742, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1742, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1742, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1742, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1742, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1742, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 1742, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
-
- 1743, 1743, 1743, 1743, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 825, 825, 825, 825, 825, 825, 825, 825,
- 825, 825, 825, 825, 825, 825, 825, 825,
-
- 825, 825, 825, 825, 825, 825, 825, 199,
- 199, 199, 199, 828, 828, 828, 828, 828,
- 828, 828, 828, 828, 828, 828, 828, 828,
- 828, 828, 828, 828, 828, 828, 828, 828,
+
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 1647, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+
+ 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+ 1646, 1646, 1646, 1646, 1646, 200, 200, 200,
+ 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
+ 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
+
+ 1648, 1648, 1649, 1649, 1648, 1648, 1648, 1648,
+ 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
+ 1648, 1648, 1648, 1648, 1649, 1648, 1648, 1648,
+ 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
+
+ 1648, 1649, 1648, 1648, 1648, 1649, 1648, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650,
+ 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650,
+
+ 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650,
+ 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650,
+ 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650,
+ 1651, 1651, 1651, 1651, 1651, 1651, 1652, 1653,
+
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+ 1654, 1654, 1654, 1654, 1655, 1656, 1657, 1658,
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+ 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
+
+ 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666,
+ 1667, 1668, 1654, 1654, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 279, 280, 279, 280, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 279, 280,
+
+ 283, 284, 279, 280, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 1669, 265,
+ 1670, 1670, 1670, 1671, 1672, 1672, 1672, 1672,
+ 1672, 1672, 1672, 1672, 265, 265, 1671, 1673,
+
+ 279, 280, 279, 280, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 279, 280,
+ 279, 280, 279, 280, 279, 280, 279, 280,
+ 285, 286, 285, 286, 1674, 1674, 1675, 1672,
+
+ 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676,
+ 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676,
+ 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676,
+ 1676, 1676, 1676, 1676, 1676, 1676, 1676, 1676,
+
+ 1676, 1676, 1676, 1676, 1676, 1676, 1677, 1677,
+ 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677,
+ 1678, 1678, 1679, 1680, 1681, 1681, 1681, 1680,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1682, 1682, 1682, 1682, 1682, 1682, 1682, 1682,
+ 1682, 1682, 1682, 1682, 1682, 1682, 1682, 1682,
+ 1682, 1682, 1682, 1682, 1682, 1682, 1682, 1683,
+ 1683, 1683, 1683, 1570, 1570, 1570, 1570, 1570,
+
+ 1684, 1684, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1183, 1183, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1537, 1183, 1183, 1183, 1183, 1183, 1183, 1183,
+ 1183, 1185, 1186, 1185, 1186, 1685, 1185, 1186,
+
+ 1185, 1186, 1185, 1186, 1185, 1186, 1185, 1186,
+ 1570, 1686, 1686, 1185, 1186, 1687, 1688, 1689,
+ 1690, 1691, 1692, 1693, 1694, 1694, 1695, 1696,
+ 1695, 1696, 1695, 1696, 1695, 1696, 1695, 1696,
+
+ 1690, 1691, 1690, 1691, 1690, 1691, 1690, 1691,
+ 1690, 1691, 1697, 1698, 1699, 1700, 200, 200,
+ 1701, 1702, 1703, 1704, 1705, 1706, 1705, 1706,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 1707,
+ 1708, 1708, 1688, 1709, 1709, 1709, 1709, 1709,
+
+ 1710, 1710, 1711, 1710, 1710, 1710, 1712, 1710,
+ 1710, 1710, 1710, 1711, 1710, 1710, 1710, 1710,
+ 1710, 1710, 1710, 1710, 1710, 1710, 1710, 1710,
+ 1710, 1710, 1710, 1710, 1710, 1710, 1710, 1710,
+
+ 1710, 1710, 1710, 1713, 1713, 1711, 1711, 1713,
+ 1714, 1714, 1714, 1714, 200, 200, 200, 200,
+ 1633, 1633, 1633, 1633, 1633, 1633, 778, 778,
+ 1376, 1715, 200, 200, 200, 200, 200, 200,
+
+ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+
+ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
+ 1716, 1716, 1717, 1718, 1719, 1719, 1720, 1720,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1721, 1721, 1722, 1722, 1722, 1722, 1722, 1722,
+ 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722,
+ 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722,
+ 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722,
+
+ 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722,
+ 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722,
+ 1722, 1722, 1722, 1722, 1721, 1721, 1721, 1721,
+ 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721,
+
+ 1721, 1721, 1721, 1721, 1723, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 1724, 1724,
+ 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732,
+ 1733, 1734, 200, 200, 200, 200, 200, 200,
+
+ 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735,
+ 1735, 1735, 1735, 1735, 1735, 1735, 1735, 1735,
+ 1735, 1735, 493, 493, 493, 493, 493, 493,
+ 1736, 1736, 1736, 493, 1737, 1738, 200, 200,
+
+ 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746,
+ 1747, 1748, 1749, 1749, 1749, 1749, 1749, 1749,
+ 1749, 1749, 1749, 1749, 1749, 1749, 1749, 1749,
+ 1749, 1749, 1749, 1749, 1749, 1749, 1749, 1749,
+
+ 1749, 1749, 1749, 1749, 1749, 1749, 1750, 1750,
+ 1750, 1750, 1750, 1751, 1751, 1751, 1752, 1753,
+ 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754,
+ 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1754,
+
+ 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1755,
+ 1755, 1755, 1755, 1755, 1755, 1755, 1755, 1755,
+ 1755, 1755, 1756, 1757, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 1758,
828, 828, 828, 828, 828, 828, 828, 828,
828, 828, 828, 828, 828, 828, 828, 828,
828, 828, 828, 828, 828, 828, 828, 828,
- 828, 828, 828, 828, 199, 199, 199, 199,
-
- 1744, 1744, 1744, 1744, 1744, 1744, 1744, 1744,
- 1744, 1744, 1744, 1744, 1744, 1744, 1744, 1744,
- 1744, 1744, 1744, 1744, 1744, 1744, 1744, 1744,
- 1744, 1744, 1744, 1744, 1744, 1744, 1744, 1744,
-
- 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745,
- 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745,
- 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745,
- 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745,
-
- 1746, 1746, 1746, 1746, 1746, 1746, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1746, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1746, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1746, 1746, 1746,
-
- 1746, 1746, 1746, 1746, 1746, 1746, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1746, 1551, 1551,
- 1746, 1551, 1746, 1551, 1551, 1746, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1746, 1746, 1551,
-
- 1746, 1551, 1746, 1551, 1551, 1746, 1746, 1551,
- 1551, 1551, 1746, 1746, 1746, 1746, 1747, 1747,
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
-
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
-
- 1748, 1748, 1748, 1748, 1748, 1748, 1748, 1748,
- 1748, 1748, 1748, 1749, 1749, 1749, 1550, 1550,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
-
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
-
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
- 1750, 1750, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 1751, 1752, 1753, 1754, 1755, 1756, 1756, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 1757, 1758, 1759, 1760, 1761,
- 199, 199, 199, 199, 199, 1762, 1763, 1764,
-
- 1765, 1765, 1765, 1765, 1765, 1765, 1765, 1765,
- 1765, 1766, 1764, 1764, 1764, 1764, 1764, 1764,
- 1764, 1764, 1764, 1764, 1764, 1764, 1764, 296,
- 1764, 1764, 1764, 1764, 1764, 296, 1764, 296,
-
- 1764, 1764, 296, 1764, 1764, 296, 1764, 1764,
- 1764, 1764, 1764, 1764, 1764, 1764, 1764, 1765,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
-
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
-
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1768, 1768, 1768, 1768, 1768, 1768,
- 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
-
- 1768, 1768, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
-
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1501, 1228,
-
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
-
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 342, 342, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
-
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 1769, 1769, 1769, 1769, 1769, 1769, 1769, 1769,
- 1769, 1769, 1769, 1769, 1769, 1769, 1769, 1769,
-
- 1769, 1769, 1769, 1769, 1769, 1769, 1769, 1769,
- 1769, 1769, 1769, 1769, 1769, 1769, 1769, 1769,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1770, 334, 342, 342,
-
- 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771,
- 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771,
- 1772, 1773, 1774, 1775, 1776, 1777, 1777, 1778,
- 1779, 1780, 199, 199, 199, 199, 199, 199,
-
- 170, 170, 170, 170, 1085, 1085, 1085, 985,
- 985, 985, 985, 985, 985, 985, 199, 199,
- 1781, 1782, 1782, 1783, 1783, 1784, 1785, 1784,
- 1785, 1784, 1785, 1784, 1785, 1784, 1785, 1784,
-
- 1785, 1784, 1785, 1784, 1785, 1513, 1513, 1786,
- 1787, 1781, 1781, 1781, 1781, 1783, 1783, 1783,
- 1788, 1789, 1790, 199, 1791, 1792, 1793, 1793,
- 1782, 1281, 1282, 1281, 1282, 1281, 1282, 1794,
-
- 1781, 1781, 1795, 1796, 1797, 1798, 1799, 199,
- 1781, 1284, 1242, 1781, 199, 199, 199, 199,
- 1767, 1767, 1767, 1800, 1767, 342, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
-
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 1767, 1767, 1767,
- 1767, 1767, 1767, 1767, 1767, 342, 342, 1801,
-
- 199, 1793, 1781, 1794, 1284, 1242, 1781, 1802,
- 1281, 1282, 1781, 1795, 1788, 1796, 1790, 1803,
- 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811,
- 1812, 1813, 1792, 1791, 1814, 1799, 1815, 1793,
-
- 1781, 1816, 1816, 1816, 1816, 1816, 1816, 1816,
- 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816,
- 1816, 1816, 1816, 1816, 1816, 1816, 1816, 1816,
- 1816, 1816, 1816, 1817, 1781, 1818, 1819, 1783,
-
- 1819, 1820, 1820, 1820, 1820, 1820, 1820, 1820,
- 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820,
- 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820,
- 1820, 1820, 1820, 1817, 1799, 1818, 1799, 1821,
-
- 1822, 1823, 1281, 1282, 1824, 1825, 1826, 1827,
- 1827, 1827, 1827, 1827, 1827, 1827, 1827, 1827,
- 1828, 1826, 1826, 1826, 1826, 1826, 1826, 1826,
- 1826, 1826, 1826, 1826, 1826, 1826, 1826, 1826,
-
- 1826, 1826, 1826, 1826, 1826, 1826, 1826, 1826,
- 1826, 1826, 1826, 1826, 1826, 1826, 1826, 1826,
- 1826, 1826, 1826, 1826, 1826, 1826, 1826, 1826,
- 1826, 1826, 1826, 1826, 1826, 1826, 1829, 1829,
-
- 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830,
- 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830,
- 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830,
- 1830, 1830, 1830, 1830, 1830, 1830, 1830, 199,
-
- 199, 199, 1830, 1830, 1830, 1830, 1830, 1830,
- 199, 199, 1830, 1830, 1830, 1830, 1830, 1830,
- 199, 199, 1830, 1830, 1830, 1830, 1830, 1830,
- 199, 199, 1830, 1830, 1830, 199, 199, 199,
-
- 1831, 1284, 1799, 1819, 1509, 1284, 1284, 199,
- 1303, 1280, 1280, 1280, 1280, 1303, 1303, 199,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1832, 1832, 1832, 1833, 51, 1834, 1834,
-
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 199, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
-
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 199,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 199, 1835, 1835, 199, 1835,
-
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 199, 199,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 199, 199,
-
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
-
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835,
- 1835, 1835, 1835, 199, 199, 199, 199, 199,
-
- 1836, 1837, 1836, 199, 199, 199, 199, 1838,
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 1838,
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 1838,
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 1838,
-
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 1838,
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 1838,
- 1838, 1838, 1838, 1838, 199, 199, 199, 1839,
- 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839,
-
- 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
- 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
- 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
- 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
-
- 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
- 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
- 1840, 1840, 1840, 1840, 1840, 1841, 1841, 1841,
- 1841, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
-
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1841, 1843, 1844, 199, 199, 199,
- 1390, 1390, 1390, 1390, 1390, 1390, 1390, 1390,
- 1390, 1390, 1390, 1390, 199, 199, 199, 199,
-
- 1844, 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,
-
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325,
- 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325,
-
- 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325,
- 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325,
- 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325,
- 1325, 1325, 1325, 1325, 1325, 1088, 199, 199,
-
- 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845,
- 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845,
- 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845,
- 1845, 1845, 1845, 1845, 1845, 199, 199, 199,
-
- 1846, 1846, 1846, 1846, 1846, 1846, 1846, 1846,
- 1846, 1846, 1846, 1846, 1846, 1846, 1846, 1846,
- 1846, 1846, 1846, 1846, 1846, 1846, 1846, 1846,
- 1846, 1846, 1846, 1846, 1846, 1846, 1846, 1846,
-
- 1846, 1846, 1846, 1846, 1846, 1846, 1846, 1846,
- 1846, 1846, 1846, 1846, 1846, 1846, 1846, 1846,
- 1846, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 985, 1847, 1847, 1847, 1847, 1847, 1847, 1847,
- 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847,
- 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847,
- 1847, 1847, 1847, 1847, 199, 199, 199, 199,
-
- 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848,
- 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848,
- 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1848,
- 1848, 1848, 1848, 1848, 1848, 1848, 1848, 1849,
-
- 1850, 1850, 1850, 1850, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851,
- 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851,
-
- 1851, 1852, 1851, 1851, 1851, 1851, 1851, 1851,
- 1851, 1851, 1852, 199, 199, 199, 199, 199,
- 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853,
- 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853,
-
- 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853,
- 1853, 1853, 1853, 1853, 1853, 1853, 1853, 1853,
- 1853, 1853, 1853, 1853, 1853, 1853, 1854, 1854,
- 1854, 1854, 1854, 199, 199, 199, 199, 199,
-
- 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855,
- 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855,
- 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855,
- 1855, 1855, 1855, 1855, 1855, 1855, 199, 1856,
-
- 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857,
- 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857,
- 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857,
- 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857,
-
- 1857, 1857, 1857, 1857, 199, 199, 199, 199,
- 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857,
- 1858, 1859, 1859, 1859, 1859, 1859, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860,
- 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860,
- 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860,
- 1860, 1860, 1860, 1860, 1860, 1860, 1860, 1860,
-
- 1860, 1860, 1860, 1860, 1860, 1860, 1861, 1861,
- 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
- 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
- 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
-
- 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
- 1862, 1862, 1862, 1862, 1862, 1862, 1863, 1863,
- 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
- 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
-
- 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
- 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
- 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
- 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
-
- 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865,
- 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865,
- 1865, 1865, 1865, 1865, 1865, 1865, 1865, 1865,
- 1865, 1865, 1865, 1865, 1865, 1865, 199, 199,
-
- 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873,
- 1874, 1875, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876,
- 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876,
- 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876,
- 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876,
-
- 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
-
- 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
-
- 1877, 1877, 1877, 1877, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 1878,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
-
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 1879, 1879, 1879, 1879, 1879, 1879, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1879, 1879, 1879, 1879, 1879, 1879, 1879, 1879,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1880, 1880, 1880, 1880, 1880, 1880, 296, 296,
- 1880, 296, 1880, 1880, 1880, 1880, 1880, 1880,
- 1880, 1880, 1880, 1880, 1880, 1880, 1880, 1880,
- 1880, 1880, 1880, 1880, 1880, 1880, 1880, 1880,
-
- 1880, 1880, 1880, 1880, 1880, 1880, 1880, 1880,
- 1880, 1880, 1880, 1880, 1880, 1880, 1880, 1880,
- 1880, 1880, 1880, 1880, 1880, 1880, 296, 1880,
- 1880, 296, 296, 296, 1880, 296, 296, 1880,
-
- 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881,
- 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881,
- 1881, 1881, 1881, 1881, 1881, 1881, 296, 1882,
- 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883,
-
- 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884,
- 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884,
- 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1885,
- 1885, 1886, 1886, 1886, 1886, 1886, 1886, 1886,
-
- 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
- 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
- 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
- 1887, 1887, 1887, 1887, 1887, 1887, 1887, 296,
-
- 296, 296, 296, 296, 296, 296, 296, 1888,
- 1888, 1888, 1888, 1888, 1888, 1888, 1888, 1888,
- 296, 296, 296, 296, 296, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
-
- 1889, 1889, 1889, 1889, 1889, 1889, 1889, 1889,
- 1889, 1889, 1889, 1889, 1889, 1889, 1889, 1889,
- 1889, 1889, 1889, 1889, 1889, 1889, 1890, 1890,
- 1890, 1890, 1891, 1891, 296, 296, 296, 1892,
-
- 1893, 1893, 1893, 1893, 1893, 1893, 1893, 1893,
- 1893, 1893, 1893, 1893, 1893, 1893, 1893, 1893,
- 1893, 1893, 1893, 1893, 1893, 1893, 1893, 1893,
- 1893, 1893, 296, 296, 296, 296, 296, 1894,
-
- 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
-
- 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
- 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
- 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
- 296, 296, 296, 296, 296, 296, 1896, 1896,
-
- 1897, 1898, 1898, 1898, 296, 1898, 1898, 296,
- 296, 296, 296, 296, 1898, 1899, 1898, 1900,
- 1897, 1897, 1897, 1897, 296, 1897, 1897, 1897,
- 296, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
-
- 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- 1897, 1897, 1897, 1897, 296, 296, 296, 296,
- 1900, 1901, 1899, 296, 296, 296, 296, 1902,
-
- 1903, 1904, 1905, 1906, 1907, 1907, 1907, 1907,
- 296, 296, 296, 296, 296, 296, 296, 296,
- 1908, 1908, 1908, 1908, 1908, 1908, 1909, 1909,
- 1910, 296, 296, 296, 296, 296, 296, 296,
-
- 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911,
- 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911,
- 1911, 1911, 1911, 1911, 1911, 1911, 1911, 1911,
- 1911, 1911, 1911, 1911, 1911, 1912, 1912, 1913,
-
- 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914,
- 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914,
- 1914, 1914, 1914, 1914, 1914, 1914, 1914, 1914,
- 1914, 1914, 1914, 1914, 1914, 1915, 1915, 1915,
-
- 1916, 1916, 1916, 1916, 1916, 1917, 1918, 1917,
- 1919, 1917, 1917, 1918, 1918, 1920, 1917, 1917,
- 1917, 1917, 1917, 1916, 1916, 1916, 1916, 1920,
- 1916, 1916, 1916, 1916, 1916, 1917, 1916, 1916,
-
- 1916, 1917, 1918, 1918, 1917, 1921, 1922, 296,
- 296, 296, 296, 1923, 1923, 1923, 1923, 1924,
- 1925, 1925, 1925, 1925, 1925, 1925, 1926, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
-
- 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927,
- 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927,
- 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927,
- 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927,
-
- 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927,
- 1927, 1927, 1927, 1927, 1927, 1927, 1927, 1927,
- 1927, 1927, 1927, 1927, 1927, 1927, 296, 296,
- 296, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
-
- 1929, 1929, 1929, 1929, 1929, 1929, 1929, 1929,
- 1929, 1929, 1929, 1929, 1929, 1929, 1929, 1929,
- 1929, 1929, 1929, 1929, 1929, 1929, 296, 296,
+ 828, 828, 828, 828, 828, 200, 200, 200,
+
+ 1759, 1759, 1759, 1760, 1761, 1761, 1761, 1761,
+ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
+ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
+ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
+
+ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
+ 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
+ 1761, 1761, 1761, 1762, 1760, 1760, 1759, 1759,
+ 1759, 1759, 1760, 1760, 1759, 1760, 1760, 1760,
+
+ 1763, 1764, 1764, 1764, 1764, 1764, 1764, 1765,
+ 1766, 1766, 1764, 1764, 1764, 1764, 200, 1767,
+ 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775,
+ 1776, 1777, 200, 200, 200, 200, 1764, 1764,
+
+ 1778, 1778, 1778, 1778, 1778, 1779, 1780, 1778,
+ 1778, 1778, 1778, 1778, 1778, 1778, 1778, 1778,
+ 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788,
+ 1789, 1790, 1778, 1778, 1778, 1778, 1778, 200,
+
+ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791,
+ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791,
+ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791,
+ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791,
+
+ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791,
+ 1791, 1792, 1792, 1792, 1792, 1792, 1792, 1793,
+ 1793, 1792, 1792, 1793, 1793, 1792, 1792, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1791, 1791, 1791, 1792, 1791, 1791, 1791, 1791,
+ 1791, 1791, 1791, 1791, 1792, 1793, 200, 200,
+ 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801,
+ 1802, 1803, 200, 200, 1804, 1805, 1805, 1805,
+
+ 1806, 1806, 1806, 1806, 1806, 1806, 1806, 1806,
+ 1806, 1806, 1806, 1806, 1806, 1806, 1806, 1806,
+ 1807, 1806, 1806, 1806, 1806, 1806, 1806, 1808,
+ 1808, 1808, 1806, 816, 1779, 1809, 1778, 1778,
+
+ 1810, 1810, 1810, 1810, 1810, 1810, 1810, 1810,
+ 1810, 1810, 1810, 1810, 1810, 1810, 1810, 1810,
+ 1810, 1810, 1810, 1810, 1810, 1810, 1810, 1810,
+ 1810, 1810, 1810, 1810, 1810, 1810, 1810, 1810,
+
+ 1810, 1810, 1810, 1810, 1810, 1810, 1810, 1810,
+ 1810, 1810, 1810, 1810, 1810, 1810, 1810, 1810,
+ 1811, 1810, 1811, 1811, 1812, 1810, 1810, 1811,
+ 1811, 1810, 1810, 1810, 1810, 1810, 1811, 1811,
+
+ 1810, 1811, 1810, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 1810, 1810, 1813, 1814, 1814,
+
+ 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815,
+ 1815, 1815, 1815, 1816, 1817, 1817, 1816, 1816,
+ 1818, 1818, 1815, 1819, 1819, 1816, 1820, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 1821, 1821, 1821, 1821, 1821, 1821, 200,
+ 200, 1821, 1821, 1821, 1821, 1821, 1821, 200,
+ 200, 1821, 1821, 1821, 1821, 1821, 1821, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1821, 1821, 1821, 1821, 1821, 1821, 1821, 200,
+ 1821, 1821, 1821, 1821, 1821, 1821, 1821, 200,
+ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+
+ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ 1694, 1694, 1694, 1694, 1694, 1694, 1694, 1694,
+ 1694, 1694, 1694, 1822, 1694, 1694, 1694, 1694,
+ 1694, 1694, 1694, 1823, 1824, 1824, 1824, 1824,
+
+ 1825, 1825, 1825, 1825, 1694, 1826, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834,
+ 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842,
+
+ 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850,
+ 1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858,
+ 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866,
+ 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874,
+
+ 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882,
+ 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890,
+ 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898,
+ 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906,
+
+ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907,
+ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907,
+ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907,
+ 1907, 1907, 1907, 1907, 1907, 1907, 1907, 1907,
+
+ 1907, 1907, 1907, 1908, 1908, 1909, 1908, 1908,
+ 1909, 1908, 1908, 1910, 1908, 1911, 200, 200,
+ 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919,
+ 1920, 1921, 200, 200, 200, 200, 200, 200,
+
+ 1922, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1922, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1922, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1922, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1922, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1922, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1922, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 1922, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+ 1923, 1923, 1923, 1923, 1923, 1923, 1923, 1923,
+
+ 1923, 1923, 1923, 1923, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 831, 831, 831, 831, 831, 831, 831, 831,
+ 831, 831, 831, 831, 831, 831, 831, 831,
+
+ 831, 831, 831, 831, 831, 831, 831, 200,
+ 200, 200, 200, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 834, 834, 834, 834,
+
+ 834, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 200, 200, 200, 200,
+
+ 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924,
+ 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924,
+ 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924,
+ 1924, 1924, 1924, 1924, 1924, 1924, 1924, 1924,
+
+ 1925, 1925, 1925, 1925, 1925, 1925, 1925, 1925,
+ 1925, 1925, 1925, 1925, 1925, 1925, 1925, 1925,
+ 1925, 1925, 1925, 1925, 1925, 1925, 1925, 1925,
+ 1925, 1925, 1925, 1925, 1925, 1925, 1925, 1925,
+
+ 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926,
+ 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926,
+ 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926,
+ 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926,
+
+ 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1926,
+ 1926, 1926, 1926, 1926, 1926, 1926, 1640, 1640,
+ 1926, 1640, 1926, 1640, 1640, 1926, 1926, 1926,
+ 1926, 1926, 1926, 1926, 1926, 1926, 1926, 1640,
+
+ 1926, 1640, 1926, 1640, 1640, 1926, 1926, 1640,
+ 1640, 1640, 1926, 1926, 1926, 1926, 1927, 1927,
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+
+ 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+ 1928, 1928, 1928, 1929, 1929, 1929, 1639, 1639,
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+ 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1930,
+ 1930, 1930, 1639, 1639, 1639, 1639, 1639, 1639,
+
+ 1931, 1932, 1933, 1934, 1935, 1936, 1936, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 1937, 1938, 1939, 1940, 1941,
+ 200, 200, 200, 200, 200, 1942, 1943, 1944,
+
+ 1945, 1945, 1945, 1945, 1945, 1945, 1945, 1945,
+ 1945, 1946, 1944, 1944, 1944, 1944, 1944, 1944,
+ 1944, 1944, 1944, 1944, 1944, 1944, 1944, 297,
+ 1944, 1944, 1944, 1944, 1944, 297, 1944, 297,
+
+ 1944, 1944, 297, 1944, 1944, 297, 1944, 1944,
+ 1944, 1944, 1944, 1944, 1944, 1944, 1944, 1945,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1948, 1948, 1948, 1948, 1948, 1948,
+ 1948, 1948, 1948, 1948, 1948, 1948, 1948, 1948,
+
+ 1948, 1948, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1590, 1314,
+
+ 343, 343, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 343, 343, 343, 343, 343,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 343, 343, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 343, 343, 343, 343, 343, 343, 343, 343,
+ 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949,
+ 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949,
- 1931, 1931, 1931, 1931, 1931, 1931, 1931, 1931,
- 1931, 1931, 1931, 1931, 1931, 1931, 1931, 1931,
- 1931, 1931, 1931, 296, 296, 296, 296, 296,
- 1932, 1932, 1932, 1932, 1932, 1932, 1932, 1932,
-
- 1933, 1934, 1933, 1934, 1934, 1934, 1933, 1933,
- 1933, 1934, 1933, 1933, 1934, 1933, 1934, 1934,
- 1933, 1934, 296, 296, 296, 296, 296, 296,
- 296, 1935, 1935, 1935, 1935, 296, 296, 296,
-
- 296, 296, 296, 296, 296, 296, 296, 296,
- 296, 1936, 1936, 1936, 1936, 1937, 1937, 1938,
- 296, 296, 296, 296, 296, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
-
- 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939,
- 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939,
- 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939,
- 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939,
-
- 1939, 1939, 1939, 1939, 1939, 1939, 1939, 1939,
- 1939, 296, 296, 296, 296, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
-
- 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947,
- 1948, 1949, 1949, 1949, 1949, 1949, 1949, 1949,
1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949,
- 1949, 1949, 1949, 1949, 1949, 1949, 1949, 296,
-
- 1950, 1951, 1950, 1952, 1952, 1952, 1952, 1952,
- 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952,
- 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952,
- 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952,
- 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952,
- 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952,
- 1952, 1952, 1952, 1952, 1952, 1952, 1952, 1952,
+ 1949, 1949, 1949, 1949, 1949, 1949, 1949, 1949,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1950, 335, 343, 343,
+
1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951,
- 1951, 1951, 1951, 1951, 1951, 1951, 1953, 1954,
- 1954, 1955, 1955, 1955, 1955, 1955, 199, 199,
- 199, 199, 1956, 1957, 1958, 1959, 1960, 1961,
- 1962, 1963, 1964, 1965, 1965, 1965, 1965, 1965,
- 1965, 1965, 1965, 1965, 1965, 1965, 1966, 1967,
- 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 1976,
- 1977, 1977, 1978, 1979, 1979, 1979, 1979, 1979,
- 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979,
- 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979,
- 1979, 1979, 1980, 1979, 1980, 1979, 1979, 1979,
- 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979,
- 1979, 1979, 1979, 1980, 1979, 1979, 1979, 1979,
- 1978, 1978, 1978, 1977, 1977, 1977, 1977, 1978,
- 1978, 1981, 1982, 1983, 1983, 1984, 1985, 1985,
- 1985, 1985, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986,
- 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986,
- 1986, 1986, 1986, 1986, 1986, 1986, 1986, 1986,
- 1986, 199, 199, 199, 199, 199, 199, 199,
- 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 199, 199, 199, 199, 199, 199,
-
- 1997, 1997, 1997, 1998, 1998, 1998, 1998, 1998,
- 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998,
- 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998,
- 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998,
- 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1999,
- 2000, 2000, 2000, 2000, 2001, 2000, 2002, 2002,
- 2000, 2000, 2000, 2003, 2003, 199, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
- 2014, 2015, 2015, 2015, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
- 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
- 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
- 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
- 2016, 2016, 2016, 2017, 2018, 2019, 2016, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2020, 2020, 2021, 2022, 2022, 2022, 2022, 2022,
- 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
- 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
- 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
- 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951,
+ 1952, 1953, 1954, 1955, 1956, 1957, 1957, 1958,
+ 1959, 1960, 200, 200, 200, 200, 200, 200,
+
+ 171, 171, 171, 171, 1171, 1171, 1171, 1071,
+ 1071, 1071, 1071, 1071, 1071, 1071, 1675, 1675,
+ 1961, 1962, 1962, 1963, 1963, 1964, 1965, 1964,
+ 1965, 1964, 1965, 1964, 1965, 1964, 1965, 1964,
+
+ 1965, 1964, 1965, 1964, 1965, 1602, 1602, 1966,
+ 1967, 1961, 1961, 1961, 1961, 1963, 1963, 1963,
+ 1968, 1969, 1970, 200, 1971, 1972, 1973, 1973,
+ 1962, 1367, 1368, 1367, 1368, 1367, 1368, 1974,
+
+ 1961, 1961, 1975, 1976, 1977, 1978, 1979, 200,
+ 1961, 1370, 1328, 1961, 200, 200, 200, 200,
+ 1947, 1947, 1947, 1980, 1947, 343, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947,
+ 1947, 1947, 1947, 1947, 1947, 343, 343, 1981,
+
+ 200, 1973, 1961, 1974, 1370, 1328, 1961, 1982,
+ 1367, 1368, 1961, 1975, 1968, 1976, 1970, 1983,
+ 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991,
+ 1992, 1993, 1972, 1971, 1994, 1979, 1995, 1973,
+
+ 1961, 1996, 1996, 1996, 1996, 1996, 1996, 1996,
+ 1996, 1996, 1996, 1996, 1996, 1996, 1996, 1996,
+ 1996, 1996, 1996, 1996, 1996, 1996, 1996, 1996,
+ 1996, 1996, 1996, 1997, 1961, 1998, 1999, 1963,
+
+ 1999, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
+ 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
+ 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
+ 2000, 2000, 2000, 1997, 1979, 1998, 1979, 2001,
+
+ 2002, 2003, 1367, 1368, 2004, 2005, 2006, 2007,
+ 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007,
+ 2008, 2006, 2006, 2006, 2006, 2006, 2006, 2006,
+ 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006,
+
+ 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006,
+ 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006,
+ 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006,
+ 2006, 2006, 2006, 2006, 2006, 2006, 2009, 2009,
+
+ 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010,
+ 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010,
+ 2010, 2010, 2010, 2010, 2010, 2010, 2010, 2010,
+ 2010, 2010, 2010, 2010, 2010, 2010, 2010, 200,
+
+ 200, 200, 2010, 2010, 2010, 2010, 2010, 2010,
+ 200, 200, 2010, 2010, 2010, 2010, 2010, 2010,
+ 200, 200, 2010, 2010, 2010, 2010, 2010, 2010,
+ 200, 200, 2010, 2010, 2010, 200, 200, 200,
+
+ 2011, 1370, 1979, 1999, 1598, 1370, 1370, 200,
+ 1390, 1366, 1366, 1366, 1366, 1390, 1390, 200,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 2012, 2012, 2012, 2013, 51, 2014, 2014,
+
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 200, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 200,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 200, 2015, 2015, 200, 2015,
+
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 200, 200,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 200, 200,
+
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
+ 2015, 2015, 2015, 200, 200, 200, 200, 200,
+
+ 2016, 2017, 2016, 200, 200, 200, 200, 2018,
+ 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,
+ 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,
+ 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,
+
+ 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,
+ 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,
+ 2018, 2018, 2018, 2018, 200, 200, 200, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+
+ 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
+ 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
+ 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
+ 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
+
+ 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
+ 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020,
+ 2020, 2020, 2020, 2020, 2020, 2021, 2021, 2021,
+ 2021, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+
2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
- 2022, 2022, 2022, 2021, 2021, 2021, 2020, 2020,
- 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2021,
- 2023, 2022, 2022, 2022, 2022, 2024, 2024, 2025,
- 2026, 199, 199, 199, 199, 2027, 199, 199,
- 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035,
- 2036, 2037, 2038, 199, 199, 199, 199, 199,
- 199, 2039, 2039, 2039, 2039, 2039, 2039, 2039,
- 2039, 2039, 2039, 2039, 2039, 2039, 2039, 2039,
- 2039, 2039, 2039, 2039, 2039, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
+ 2022, 2022, 2021, 2023, 2024, 200, 200, 200,
+ 1479, 1479, 1479, 1479, 1479, 1479, 1479, 1479,
+ 1479, 1479, 1479, 1479, 200, 200, 200, 200,
+
+ 2024, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412,
+ 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412,
+
+ 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412,
+ 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412,
+ 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412,
+ 1412, 1412, 1412, 1412, 1412, 1174, 200, 200,
+
+ 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025,
+ 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025,
+ 2025, 2025, 2025, 2025, 2025, 2025, 2025, 2025,
+ 2025, 2025, 2025, 2025, 2025, 200, 200, 200,
+
+ 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026,
+ 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026,
+ 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026,
+ 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026,
+
+ 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026,
+ 2026, 2026, 2026, 2026, 2026, 2026, 2026, 2026,
+ 2026, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1071, 2027, 2027, 2027, 2027, 2027, 2027, 2027,
+ 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027,
+ 2027, 2027, 2027, 2027, 2027, 2027, 2027, 2027,
+ 2027, 2027, 2027, 2027, 200, 200, 200, 200,
+
+ 2028, 2028, 2028, 2028, 2028, 2028, 2028, 2028,
+ 2028, 2028, 2028, 2028, 2028, 2028, 2028, 2028,
+ 2028, 2028, 2028, 2028, 2028, 2028, 2028, 2028,
+ 2028, 2028, 2028, 2028, 2028, 2028, 2028, 2029,
+
+ 2030, 2030, 2030, 2030, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031,
+ 2031, 2031, 2031, 2031, 2031, 2031, 2031, 2031,
+
+ 2031, 2032, 2031, 2031, 2031, 2031, 2031, 2031,
+ 2031, 2031, 2032, 200, 200, 200, 200, 200,
+ 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033,
+ 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033,
+
+ 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033,
+ 2033, 2033, 2033, 2033, 2033, 2033, 2033, 2033,
+ 2033, 2033, 2033, 2033, 2033, 2033, 2034, 2034,
+ 2034, 2034, 2034, 200, 200, 200, 200, 200,
+
+ 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035,
+ 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035,
+ 2035, 2035, 2035, 2035, 2035, 2035, 2035, 2035,
+ 2035, 2035, 2035, 2035, 2035, 2035, 200, 2036,
+
+ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
+ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
+ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
+ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
+
+ 2037, 2037, 2037, 2037, 200, 200, 200, 200,
+ 2037, 2037, 2037, 2037, 2037, 2037, 2037, 2037,
+ 2038, 2039, 2039, 2039, 2039, 2039, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040,
2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040,
- 2040, 2040, 199, 2040, 2040, 2040, 2040, 2040,
2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040,
2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040,
- 2040, 2040, 2040, 2040, 2041, 2041, 2041, 2042,
- 2042, 2042, 2041, 2041, 2042, 2043, 2044, 2042,
- 2045, 2045, 2046, 2045, 2045, 2046, 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, 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, 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, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047,
- 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047,
- 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047,
- 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047,
- 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047,
- 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2048,
- 2049, 2049, 2049, 2048, 2048, 2048, 2048, 2048,
- 2048, 2050, 2051, 199, 199, 199, 199, 199,
- 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059,
- 2060, 2061, 199, 199, 199, 199, 199, 199,
-
- 199, 2062, 2063, 2063, 199, 2064, 2064, 2064,
- 2064, 2064, 2064, 2064, 2064, 199, 199, 2064,
- 2064, 199, 199, 2064, 2064, 2064, 2064, 2064,
+
+ 2040, 2040, 2040, 2040, 2040, 2040, 2041, 2041,
+ 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042,
+ 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042,
+ 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042,
+
+ 2042, 2042, 2042, 2042, 2042, 2042, 2042, 2042,
+ 2042, 2042, 2042, 2042, 2042, 2042, 2043, 2043,
+ 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044,
+ 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044,
+
+ 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044,
+ 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044,
+ 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044,
+ 2044, 2044, 2044, 2044, 2044, 2044, 2044, 2044,
+
+ 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045,
+ 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045,
+ 2045, 2045, 2045, 2045, 2045, 2045, 2045, 2045,
+ 2045, 2045, 2045, 2045, 2045, 2045, 200, 200,
+
+ 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053,
+ 2054, 2055, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056,
+ 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056,
+ 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056,
+ 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056,
+
+ 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057,
+ 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057,
+
+ 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057,
+ 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057,
+ 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057,
+ 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057,
+
+ 2057, 2057, 2057, 2057, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 2058,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2060, 2060, 2060, 2060, 2060, 2060, 297, 297,
+ 2060, 297, 2060, 2060, 2060, 2060, 2060, 2060,
+ 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060,
+ 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060,
+
+ 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060,
+ 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060,
+ 2060, 2060, 2060, 2060, 2060, 2060, 297, 2060,
+ 2060, 297, 297, 297, 2060, 297, 297, 2060,
+
+ 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061,
+ 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061,
+ 2061, 2061, 2061, 2061, 2061, 2061, 297, 2062,
+ 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063,
+
2064, 2064, 2064, 2064, 2064, 2064, 2064, 2064,
2064, 2064, 2064, 2064, 2064, 2064, 2064, 2064,
- 2064, 199, 2064, 2064, 2064, 2064, 2064, 2064,
- 2064, 199, 2064, 2064, 199, 2064, 2064, 2064,
- 2064, 2064, 199, 199, 2065, 2064, 2066, 2063,
- 2062, 2063, 2063, 2063, 2063, 199, 199, 2063,
- 2063, 199, 199, 2067, 2067, 2068, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 2066,
- 199, 199, 199, 199, 199, 2064, 2064, 2064,
- 2064, 2064, 2063, 2063, 199, 199, 2069, 2069,
- 2069, 2069, 2069, 2069, 2069, 199, 199, 199,
- 2069, 2069, 2069, 2069, 2069, 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, 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, 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, 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, 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,
- 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, 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, 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, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,
- 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,
- 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,
- 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,
- 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,
- 2070, 2070, 2070, 2070, 2070, 2070, 2070, 2070,
- 2071, 2072, 2072, 2073, 2073, 2073, 2073, 2073,
- 2073, 2072, 2074, 2075, 2075, 2071, 2075, 2073,
- 2073, 2072, 2076, 2077, 2070, 2070, 2078, 2070,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086,
- 2087, 2088, 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, 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,
- 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, 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, 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, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089,
- 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089,
- 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089,
- 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089,
- 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089,
- 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2090,
- 2091, 2091, 2092, 2092, 2092, 2092, 199, 199,
- 2091, 2091, 2093, 2093, 2092, 2092, 2091, 2094,
- 2095, 2096, 2097, 2097, 2098, 2098, 2099, 2099,
- 2099, 2097, 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, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
- 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
- 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
- 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
- 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
- 2100, 2100, 2100, 2100, 2100, 2100, 2100, 2100,
- 2101, 2101, 2101, 2102, 2102, 2102, 2102, 2102,
- 2102, 2102, 2102, 2101, 2101, 2102, 2101, 2103,
- 2102, 2104, 2104, 2105, 2100, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113,
- 2114, 2115, 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, 199, 199, 199, 199, 199, 199, 199,
- 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116,
- 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116,
- 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116,
- 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116,
- 2116, 2116, 2116, 2116, 2116, 2116, 2116, 2116,
- 2116, 2116, 2116, 2117, 2118, 2117, 2118, 2118,
- 2117, 2117, 2117, 2117, 2117, 2117, 2119, 2120,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128,
- 2129, 2130, 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, 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,
- 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, 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, 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, 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, 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, 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, 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, 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,
-
- 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, 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, 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, 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, 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, 199, 199, 199, 199, 199,
- 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
- 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
- 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
- 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
- 2132, 2132, 2132, 2132, 2132, 2132, 2132, 2132,
- 2132, 2132, 2132, 2132, 2132, 2132, 2132, 2132,
- 2132, 2132, 2132, 2132, 2132, 2132, 2132, 2132,
- 2132, 2132, 2132, 2132, 2132, 2132, 2132, 2132,
- 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140,
- 2141, 2142, 2143, 2143, 2143, 2143, 2143, 2143,
- 2143, 2143, 2143, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 2144,
-
- 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, 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, 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, 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, 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, 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, 199, 199, 199, 199, 199, 199,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145,
- 2145, 199, 199, 199, 199, 199, 199, 199,
-
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
-
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2146,
- 2146, 2146, 2146, 2146, 2146, 2146, 2146, 2147,
- 2147, 2147, 2147, 2147, 2147, 2147, 2147, 2147,
- 2147, 2147, 2147, 2147, 2147, 2147, 2147, 2147,
- 2147, 2147, 2147, 2147, 2147, 2147, 2147, 2147,
- 2147, 2147, 2147, 2147, 2147, 2147, 2147, 2147,
- 2147, 2147, 2147, 2147, 2147, 2147, 2147, 2147,
- 2147, 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,
- 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, 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, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2148, 2148, 2148, 2148, 2148,
- 2148, 2148, 2148, 2149, 2149, 2149, 2149, 2149,
- 2149, 2149, 2149, 2149, 2149, 2149, 2149, 199,
- 2150, 2150, 2150, 2150, 2151, 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, 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, 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, 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, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
-
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2153, 2153, 2153, 2154, 2154, 2154, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2154, 2152, 2152, 2152, 2153, 2154,
- 2153, 2154, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
-
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2153, 2154, 2154, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
-
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 2152,
- 2152, 2152, 2152, 2152, 2152, 2152, 2152, 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, 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, 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, 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, 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, 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, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
-
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 2155, 2155, 2155, 2155, 2155, 2155, 2155,
- 2155, 199, 199, 199, 199, 199, 199, 199,
- 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156,
- 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156,
- 2156, 2156, 2156, 2156, 2156, 2156, 2156, 2156,
- 2156, 2156, 2156, 2156, 2156, 2156, 2156, 199,
- 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164,
- 2165, 2166, 199, 199, 199, 199, 2167, 2167,
- 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, 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, 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, 199, 199, 199,
- 2168, 2168, 2168, 2168, 2168, 2168, 2168, 2168,
- 2168, 2168, 2168, 2168, 2168, 2168, 2168, 2168,
- 2168, 2168, 2168, 2168, 2168, 2168, 2168, 2168,
- 2168, 2168, 2168, 2168, 2168, 2168, 199, 199,
- 2169, 2169, 2169, 2169, 2169, 2170, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2173,
- 2173, 2174, 2175, 2175, 2176, 2176, 2176, 2176,
- 2177, 2177, 2177, 2177, 2173, 2176, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185,
- 2186, 2187, 199, 2188, 2188, 2188, 2188, 2188,
- 2188, 2188, 199, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 199, 199, 199, 199, 199, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171,
- 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, 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, 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, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 2189, 2189, 2189,
- 2189, 2189, 2189, 2189, 2189, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2189, 2190, 2190, 2190, 2190, 2190, 2190, 2190,
- 2190, 2190, 2190, 2190, 2190, 2190, 2190, 2190,
- 2190, 2190, 2190, 2190, 2190, 2190, 2190, 2190,
- 2190, 2190, 2190, 2190, 2190, 2190, 2190, 2190,
- 2190, 2190, 2190, 2190, 2190, 2190, 2190, 2190,
- 2190, 2190, 2190, 2190, 2190, 2190, 2190, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 2191,
- 2191, 2191, 2191, 2192, 2192, 2192, 2192, 2192,
- 2192, 2192, 2192, 2192, 2192, 2192, 2192, 2192,
- 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, 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, 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, 199, 199, 199,
-
- 2193, 2194, 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, 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,
- 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, 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, 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, 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, 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, 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, 199, 199, 199, 199, 199, 199,
-
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 199, 199, 199, 199, 199,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 2195, 2195, 2195, 199, 199, 199,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 199, 199, 199, 199, 199, 199, 199,
- 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195,
- 2195, 2195, 199, 199, 2196, 2197, 2198, 2199,
- 2200, 2200, 2200, 2200, 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, 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, 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,
-
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 199,
- 199, 1325, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2202, 2202,
- 2202, 2202, 2202, 2202, 2202, 2203, 2204, 2205,
- 2205, 2205, 2201, 2201, 2201, 2206, 2203, 2203,
- 2203, 2203, 2203, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2208, 2208, 2208, 2208, 2208,
- 2208, 2208, 2208, 2201, 2201, 2209, 2209, 2209,
- 2209, 2209, 2208, 2208, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2209, 2209, 2209, 2209, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2202, 2202, 2202, 2202, 2202,
- 2202, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
- 2201, 2201, 2201, 2201, 2201, 2201, 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, 199, 199, 199,
-
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 2210, 2210, 2210, 1842, 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, 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, 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, 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, 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, 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,
-
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 1357, 1357, 1357, 1357, 1357, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 2211, 2211, 2211, 2211, 2211, 2211, 2211, 2211,
- 2211, 2211, 2211, 2211, 2211, 2211, 2211, 2211,
- 2211, 2211, 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, 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,
- 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, 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, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 199, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2212, 199, 2212, 2212,
- 199, 199, 2212, 199, 199, 2212, 2212, 199,
- 199, 2212, 2212, 2212, 2212, 199, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2213, 2213,
- 2213, 2213, 199, 2213, 199, 2213, 2213, 2213,
- 2213, 2214, 2213, 2213, 199, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
-
- 2213, 2213, 2213, 2213, 2212, 2212, 199, 2212,
- 2212, 2212, 2212, 199, 199, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 199, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 199, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 199, 2212, 2212, 2212, 2212, 199,
- 2212, 2212, 2212, 2212, 2212, 199, 2212, 199,
- 199, 199, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 199, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
-
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 1317, 1317, 199, 199,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2215, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2216, 2213, 2213, 2213, 2213,
- 2213, 2213, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2215, 2213, 2213, 2213, 2213,
-
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2216, 2213, 2213,
- 2213, 2213, 2213, 2213, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2215, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2216,
- 2213, 2213, 2213, 2213, 2213, 2213, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2215,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2216, 2213, 2213, 2213, 2213, 2213, 2213,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2212, 2212, 2212, 2212, 2212, 2212, 2212,
- 2212, 2215, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2213, 2213, 2213, 2213, 2213,
- 2213, 2213, 2213, 2216, 2213, 2213, 2213, 2213,
- 2213, 2213, 2217, 2218, 199, 199, 2219, 2220,
- 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228,
- 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226,
- 2227, 2228, 2219, 2220, 2221, 2222, 2223, 2224,
- 2225, 2226, 2227, 2228, 2219, 2220, 2221, 2222,
- 2223, 2224, 2225, 2226, 2227, 2228, 2219, 2220,
- 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228,
-
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 2229, 2229, 2229,
- 2229, 2229, 2229, 2229, 2229, 296, 296, 2230,
- 2230, 2230, 2230, 2230, 2230, 2230, 2230, 2230,
- 2231, 2231, 2231, 2231, 2231, 2231, 2231, 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, 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, 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, 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, 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, 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, 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, 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, 296,
- 296, 296, 296, 296, 296, 296, 296, 296,
-
- 2232, 2232, 2232, 2232, 342, 2232, 2232, 2232,
- 2232, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
+ 2064, 2064, 2064, 2064, 2064, 2064, 2064, 2065,
+ 2065, 2066, 2066, 2066, 2066, 2066, 2066, 2066,
+
+ 2067, 2067, 2067, 2067, 2067, 2067, 2067, 2067,
+ 2067, 2067, 2067, 2067, 2067, 2067, 2067, 2067,
+ 2067, 2067, 2067, 2067, 2067, 2067, 2067, 2067,
+ 2067, 2067, 2067, 2067, 2067, 2067, 2067, 297,
+
+ 297, 297, 297, 297, 297, 297, 297, 2068,
+ 2068, 2068, 2068, 2068, 2068, 2068, 2068, 2068,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069,
+ 2069, 2069, 2069, 2069, 2069, 2069, 2069, 2069,
+ 2069, 2069, 2069, 297, 2069, 2069, 297, 297,
+ 297, 297, 297, 2070, 2070, 2070, 2070, 2070,
+
+ 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071,
+ 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071,
+ 2071, 2071, 2071, 2071, 2071, 2071, 2072, 2072,
+ 2072, 2072, 2073, 2073, 297, 297, 297, 2074,
+
+ 2075, 2075, 2075, 2075, 2075, 2075, 2075, 2075,
+ 2075, 2075, 2075, 2075, 2075, 2075, 2075, 2075,
+ 2075, 2075, 2075, 2075, 2075, 2075, 2075, 2075,
+ 2075, 2075, 297, 297, 297, 297, 297, 2076,
+
+ 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077,
+ 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077,
+ 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077,
+ 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077,
+
+ 2078, 2078, 2078, 2078, 2078, 2078, 2078, 2078,
+ 2078, 2078, 2078, 2078, 2078, 2078, 2078, 2078,
+ 2078, 2078, 2078, 2078, 2078, 2078, 2078, 2078,
+ 297, 297, 297, 297, 2079, 2079, 2078, 2078,
+
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+ 297, 297, 2079, 2079, 2079, 2079, 2079, 2079,
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+ 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079,
+
+ 2080, 2081, 2081, 2081, 297, 2081, 2081, 297,
+ 297, 297, 297, 297, 2081, 2082, 2081, 2083,
+ 2080, 2080, 2080, 2080, 297, 2080, 2080, 2080,
+ 297, 2080, 2080, 2080, 2080, 2080, 2080, 2080,
+
+ 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080,
+ 2080, 2080, 2080, 2080, 2080, 2080, 2080, 2080,
+ 2080, 2080, 2080, 2080, 297, 297, 297, 297,
+ 2083, 2084, 2082, 297, 297, 297, 297, 2085,
+
+ 2086, 2087, 2088, 2089, 2090, 2090, 2090, 2090,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 2091, 2091, 2091, 2091, 2091, 2091, 2092, 2092,
+ 2093, 297, 297, 297, 297, 297, 297, 297,
+
+ 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
+ 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
+ 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
+ 2094, 2094, 2094, 2094, 2094, 2095, 2095, 2096,
+
+ 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097,
+ 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097,
+ 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097,
+ 2097, 2097, 2097, 2097, 2097, 2098, 2098, 2098,
+
+ 2099, 2099, 2099, 2099, 2099, 2100, 2101, 2100,
+ 2102, 2100, 2100, 2101, 2101, 2103, 2100, 2100,
+ 2100, 2100, 2100, 2099, 2099, 2099, 2099, 2103,
+ 2099, 2099, 2099, 2099, 2099, 2100, 2099, 2099,
+
+ 2099, 2100, 2101, 2101, 2100, 2104, 2105, 297,
+ 297, 297, 297, 2106, 2106, 2106, 2106, 2107,
+ 2108, 2108, 2108, 2108, 2108, 2108, 2109, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110,
+ 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110,
+ 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110,
+ 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110,
+
+ 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110,
+ 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110,
+ 2110, 2110, 2110, 2110, 2110, 2110, 297, 297,
+ 297, 2111, 2111, 2111, 2111, 2111, 2111, 2111,
+
+ 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112,
+ 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112,
+ 2112, 2112, 2112, 2112, 2112, 2112, 297, 297,
+ 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113,
+
+ 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114,
+ 2114, 2114, 2114, 2114, 2114, 2114, 2114, 2114,
+ 2114, 2114, 2114, 297, 297, 297, 297, 297,
+ 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115,
+
+ 2116, 2117, 2116, 2117, 2117, 2117, 2116, 2116,
+ 2116, 2117, 2116, 2116, 2117, 2116, 2117, 2117,
+ 2116, 2117, 297, 297, 297, 297, 297, 297,
+ 297, 2118, 2118, 2118, 2118, 297, 297, 297,
+
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 2119, 2119, 2119, 2119, 2120, 2120, 2121,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
+ 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
+ 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
+ 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
+
+ 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
+ 2122, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 2123, 2123, 2123, 2123, 2123, 2123, 2123, 2123,
+ 2123, 2123, 2123, 2123, 2123, 2123, 2123, 2123,
+ 2123, 2123, 2123, 2123, 2123, 2123, 2123, 2123,
+ 2123, 2123, 2123, 2123, 2123, 2123, 2123, 2123,
+
+ 2123, 2123, 2123, 2123, 2123, 2123, 2123, 2123,
+ 2123, 2123, 2123, 2123, 2123, 2123, 2123, 2123,
+ 2123, 2123, 2123, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124,
+ 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124,
+ 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124,
+ 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124,
+
+ 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124,
+ 2124, 2124, 2124, 2124, 2124, 2124, 2124, 2124,
+ 2124, 2124, 2124, 297, 297, 297, 297, 297,
+ 297, 297, 2125, 2125, 2125, 2125, 2125, 2125,
+
+ 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133,
+ 2134, 2135, 2135, 2135, 2135, 2135, 2135, 2135,
+ 2135, 2135, 2135, 2135, 2135, 2135, 2135, 2135,
+ 2135, 2135, 2135, 2135, 2135, 2135, 2135, 297,
+
+ 2136, 2137, 2136, 2138, 2138, 2138, 2138, 2138,
+ 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138,
+ 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138,
+ 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138,
+ 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138,
+ 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138,
+ 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138,
+ 2137, 2137, 2137, 2137, 2137, 2137, 2137, 2137,
+ 2137, 2137, 2137, 2137, 2137, 2137, 2139, 2140,
+ 2140, 2141, 2141, 2141, 2141, 2141, 200, 200,
+ 200, 200, 2142, 2143, 2144, 2145, 2146, 2147,
+ 2148, 2149, 2150, 2151, 2151, 2151, 2151, 2151,
+ 2151, 2151, 2151, 2151, 2151, 2151, 2152, 2153,
+ 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 2162,
+ 2163, 2163, 2164, 2165, 2165, 2165, 2165, 2165,
+ 2165, 2165, 2165, 2165, 2165, 2165, 2165, 2165,
+ 2165, 2165, 2165, 2165, 2165, 2165, 2165, 2165,
+ 2165, 2165, 2166, 2165, 2166, 2165, 2165, 2165,
+ 2165, 2165, 2165, 2165, 2165, 2165, 2165, 2165,
+ 2165, 2165, 2165, 2166, 2165, 2165, 2165, 2165,
+ 2164, 2164, 2164, 2163, 2163, 2163, 2163, 2164,
+ 2164, 2167, 2168, 2169, 2169, 2170, 2171, 2171,
+ 2171, 2171, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172,
+ 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172,
+ 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172,
+ 2172, 200, 200, 200, 200, 200, 200, 200,
+ 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180,
+ 2181, 2182, 200, 200, 200, 200, 200, 200,
+
+ 2183, 2183, 2183, 2184, 2184, 2184, 2184, 2184,
+ 2184, 2184, 2184, 2184, 2184, 2184, 2184, 2184,
+ 2184, 2184, 2184, 2184, 2184, 2184, 2184, 2184,
+ 2184, 2184, 2184, 2184, 2184, 2184, 2184, 2184,
+ 2184, 2184, 2184, 2184, 2184, 2184, 2184, 2185,
+ 2186, 2186, 2186, 2186, 2187, 2186, 2188, 2188,
+ 2186, 2186, 2186, 2189, 2189, 200, 2190, 2191,
+ 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199,
+ 2200, 2201, 2201, 2201, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2202, 2202, 2202, 2202, 2202, 2202, 2202, 2202,
+ 2202, 2202, 2202, 2202, 2202, 2202, 2202, 2202,
+ 2202, 2202, 2202, 2202, 2202, 2202, 2202, 2202,
+ 2202, 2202, 2202, 2202, 2202, 2202, 2202, 2202,
+ 2202, 2202, 2202, 2203, 2204, 2205, 2202, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2206, 2206, 2207, 2208, 2208, 2208, 2208, 2208,
+ 2208, 2208, 2208, 2208, 2208, 2208, 2208, 2208,
+ 2208, 2208, 2208, 2208, 2208, 2208, 2208, 2208,
+ 2208, 2208, 2208, 2208, 2208, 2208, 2208, 2208,
+ 2208, 2208, 2208, 2208, 2208, 2208, 2208, 2208,
+ 2208, 2208, 2208, 2208, 2208, 2208, 2208, 2208,
+ 2208, 2208, 2208, 2207, 2207, 2207, 2206, 2206,
+ 2206, 2206, 2206, 2206, 2206, 2206, 2206, 2207,
+ 2209, 2208, 2208, 2208, 2208, 2210, 2210, 2211,
+ 2212, 2213, 2214, 2215, 2215, 2216, 200, 200,
+ 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224,
+ 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2231,
+ 200, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
2232, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
- 342, 2232, 2232, 342, 2232, 342, 342, 2232,
- 342, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 342, 2232, 2232, 2232, 2232,
- 342, 2232, 342, 2232, 342, 342, 342, 342,
- 342, 342, 2232, 342, 342, 342, 342, 2232,
- 342, 2232, 342, 2232, 342, 2232, 2232, 2232,
- 342, 2232, 2232, 342, 2232, 342, 342, 2232,
- 342, 2232, 342, 2232, 342, 2232, 342, 2232,
- 342, 2232, 2232, 342, 2232, 342, 342, 2232,
- 2232, 2232, 2232, 342, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 342, 2232, 2232, 2232, 2232,
- 342, 2232, 2232, 2232, 2232, 342, 2232, 342,
- 2232, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 342, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 2232, 342, 342, 342, 342,
- 342, 2232, 2232, 2232, 342, 2232, 2232, 2232,
- 2232, 2232, 342, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 2232, 2232, 2232, 2232, 2232,
- 2232, 2232, 2232, 2232, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
- 2233, 2233, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342,
-
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 199, 199, 199, 199,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393,
- 1393, 1393, 1393, 1393, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 199,
- 199, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1394,
- 199, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 199, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 2234, 2234, 2235, 2236, 2237, 2238, 2239, 2240,
- 2241, 2242, 2243, 2244, 2244, 199, 199, 199,
- 2245, 2245, 2245, 2245, 2245, 2245, 2245, 2245,
- 2245, 2245, 2245, 2245, 2245, 2245, 2245, 2245,
- 2245, 2245, 2245, 2245, 2245, 2245, 2245, 2245,
- 2245, 2245, 2245, 2245, 2245, 2245, 2245, 199,
- 2246, 2247, 2246, 2246, 2246, 2246, 2246, 2246,
- 2246, 2246, 2246, 2246, 2246, 2247, 2246, 2247,
- 2246, 2246, 2247, 2246, 2246, 2246, 2247, 2246,
- 2246, 2246, 2245, 2245, 2245, 2245, 2245, 2248,
- 2249, 2249, 2249, 2249, 2249, 2249, 2249, 2250,
- 2249, 2249, 2249, 2249, 2249, 2249, 2249, 2250,
- 2249, 2249, 2249, 2249, 2249, 2249, 2249, 2249,
- 2249, 2249, 2251, 2251, 199, 199, 199, 199,
- 2249, 2249, 2249, 2249, 2249, 2249, 2249, 2249,
- 2249, 2250, 2249, 2250, 2250, 2249, 2249, 2250,
- 2249, 2249, 2249, 2249, 2249, 2249, 2249, 2249,
- 2249, 2249, 772, 772, 772, 772, 2252, 2252,
- 2245, 2252, 2252, 2252, 2252, 2252, 2252, 2252,
- 2252, 2252, 2252, 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, 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, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 2253, 2253,
- 2253, 2253, 2253, 2253, 2253, 2253, 2253, 2253,
- 2253, 2253, 2253, 2253, 2253, 2253, 2253, 2253,
- 2253, 2253, 2253, 2253, 2253, 2253, 2253, 2253,
-
- 2254, 2255, 2255, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
- 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
- 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
- 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
- 1543, 1543, 2255, 2255, 2255, 2255, 2255, 2255,
- 2255, 2255, 2255, 199, 199, 199, 199, 199,
- 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
- 1543, 199, 199, 199, 199, 199, 199, 199,
- 2255, 2255, 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, 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,
- 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, 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, 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, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 199, 199, 199,
- 1361, 1361, 1361, 1361, 1361, 1361, 1394, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1394, 199, 199,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1362, 1362, 1394, 1394,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1360, 1360, 1361,
- 1361, 1361, 1361, 1361, 1360, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1394, 1361, 1361,
- 1361, 1361, 1361, 1394, 1394, 1394, 1394, 199,
- 199, 199, 199, 199, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1394,
- 1361, 1394, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1360, 1361, 1360, 1361, 1360, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1360,
- 1361, 1360, 1360, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1394, 1361, 1361, 1361, 1361, 1394, 1394, 199,
-
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1362, 1362,
- 2256, 2256, 2256, 2256, 1362, 1362, 1362, 1362,
- 1362, 1362, 1394, 199, 199, 199, 199, 199,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 199, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 199, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1362, 1362, 1362, 1362,
- 1362, 1362, 1394, 1361, 1361, 1361, 1361, 1361,
-
- 2257, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 2257, 1361, 1361, 1361, 2257, 1361, 2257,
- 1361, 2257, 1361, 2257, 1361, 1361, 1361, 2257,
- 1361, 1361, 1361, 1361, 1361, 1361, 2257, 2257,
- 1361, 1361, 1361, 1361, 2257, 1361, 2257, 2257,
- 1361, 1361, 1361, 1361, 2257, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1394, 1394, 199, 199, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 2258, 2258,
- 2258, 2259, 2259, 2259, 1362, 1362, 1362, 1362,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
- 1361, 1361, 1361, 1361, 1361, 1361, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394,
- 1394, 1394, 1394, 1394, 1394, 199, 199, 199,
- 1394, 1394, 1394, 1394, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 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, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199,
-
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 199, 199, 199, 199,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 199, 199, 199, 199, 199, 199,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 199, 199, 199, 199, 199, 199, 199, 199,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
- 1362, 1362, 1362, 1362, 1362, 1362, 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, 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, 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, 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, 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, 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,
- 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, 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, 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, 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, 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, 2260, 2260,
-
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
-
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 2261,
- 2261, 2261, 2261, 2261, 2261, 2261, 2261, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
+ 2232, 2232, 2232, 2232, 2232, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2233, 2233, 2233, 2233, 2233, 2233, 2233, 2233,
+ 2233, 2233, 2233, 2233, 2233, 2233, 2233, 2233,
+ 2233, 2233, 200, 2233, 2233, 2233, 2233, 2233,
+ 2233, 2233, 2233, 2233, 2233, 2233, 2233, 2233,
+ 2233, 2233, 2233, 2233, 2233, 2233, 2233, 2233,
+ 2233, 2233, 2233, 2233, 2234, 2234, 2234, 2235,
+ 2235, 2235, 2234, 2234, 2235, 2236, 2237, 2235,
+ 2238, 2238, 2239, 2238, 2238, 2239, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2240, 2240, 2240, 2240, 2240, 2240, 2240, 200,
+ 2240, 200, 2240, 2240, 2240, 2240, 200, 2240,
+ 2240, 2240, 2240, 2240, 2240, 2240, 2240, 2240,
+ 2240, 2240, 2240, 2240, 2240, 2240, 200, 2240,
+ 2240, 2240, 2240, 2240, 2240, 2240, 2240, 2240,
+ 2240, 2241, 200, 200, 200, 200, 200, 200,
+ 2242, 2242, 2242, 2242, 2242, 2242, 2242, 2242,
+ 2242, 2242, 2242, 2242, 2242, 2242, 2242, 2242,
+ 2242, 2242, 2242, 2242, 2242, 2242, 2242, 2242,
+ 2242, 2242, 2242, 2242, 2242, 2242, 2242, 2242,
+ 2242, 2242, 2242, 2242, 2242, 2242, 2242, 2242,
+ 2242, 2242, 2242, 2242, 2242, 2242, 2242, 2243,
+ 2244, 2244, 2244, 2243, 2243, 2243, 2243, 2243,
+ 2243, 2245, 2246, 200, 200, 200, 200, 200,
+ 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254,
+ 2255, 2256, 200, 200, 200, 200, 200, 200,
+
+ 2257, 2258, 2259, 2259, 200, 2260, 2260, 2260,
+ 2260, 2260, 2260, 2260, 2260, 200, 200, 2260,
+ 2260, 200, 200, 2260, 2260, 2260, 2260, 2260,
+ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260,
+ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260,
+ 2260, 200, 2260, 2260, 2260, 2260, 2260, 2260,
+ 2260, 200, 2260, 2260, 200, 2260, 2260, 2260,
+ 2260, 2260, 200, 200, 2261, 2260, 2262, 2259,
+ 2258, 2259, 2259, 2259, 2259, 200, 200, 2259,
+ 2259, 200, 200, 2263, 2263, 2264, 200, 200,
+ 2265, 200, 200, 200, 200, 200, 200, 2262,
+ 200, 200, 200, 200, 200, 2260, 2260, 2260,
+ 2260, 2260, 2259, 2259, 200, 200, 2266, 2266,
+ 2266, 2266, 2266, 2266, 2266, 200, 200, 200,
+ 2266, 2266, 2266, 2266, 2266, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267,
+ 2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267,
+ 2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267,
+ 2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267,
+ 2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267,
+ 2267, 2267, 2267, 2267, 2267, 2267, 2267, 2267,
+ 2268, 2269, 2269, 2270, 2270, 2270, 2270, 2270,
+ 2270, 2269, 2271, 2272, 2272, 2268, 2272, 2270,
+ 2270, 2269, 2273, 2274, 2267, 2267, 2275, 2267,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283,
+ 2284, 2285, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2286, 2286, 2286, 2286, 2286, 2286, 2286, 2286,
+ 2286, 2286, 2286, 2286, 2286, 2286, 2286, 2286,
+ 2286, 2286, 2286, 2286, 2286, 2286, 2286, 2286,
+ 2286, 2286, 2286, 2286, 2286, 2286, 2286, 2286,
+ 2286, 2286, 2286, 2286, 2286, 2286, 2286, 2286,
+ 2286, 2286, 2286, 2286, 2286, 2286, 2286, 2287,
+ 2288, 2288, 2289, 2289, 2289, 2289, 200, 200,
+ 2288, 2288, 2290, 2290, 2289, 2289, 2288, 2291,
+ 2292, 2293, 2294, 2294, 2295, 2295, 2296, 2296,
+ 2296, 2294, 2297, 2297, 2297, 2297, 2297, 2297,
+ 2297, 2297, 2297, 2297, 2297, 2297, 2297, 2297,
+ 2298, 2298, 2298, 2298, 2299, 2299, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
+ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
+ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
+ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
+ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
+ 2300, 2300, 2300, 2300, 2300, 2300, 2300, 2300,
+ 2301, 2301, 2301, 2302, 2302, 2302, 2302, 2302,
+ 2302, 2302, 2302, 2301, 2301, 2302, 2301, 2303,
+ 2302, 2304, 2304, 2305, 2300, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313,
+ 2314, 2315, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2316, 2316, 2316, 2316, 2316, 2316, 2316, 2316,
+ 2316, 2316, 2316, 2316, 2316, 2316, 2316, 2316,
+ 2316, 2316, 2316, 2316, 2316, 2316, 2316, 2316,
+ 2316, 2316, 2316, 2316, 2316, 2316, 2316, 2316,
+ 2316, 2316, 2316, 2316, 2316, 2316, 2316, 2316,
+ 2316, 2316, 2316, 2317, 2318, 2317, 2318, 2318,
+ 2317, 2317, 2317, 2317, 2317, 2317, 2319, 2320,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328,
+ 2329, 2330, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2331, 2331, 2331, 2331, 2331, 2331, 2331, 2331,
+ 2331, 2331, 2331, 2331, 2331, 2331, 2331, 2331,
+ 2331, 2331, 2331, 2331, 2331, 2331, 2331, 2331,
+ 2331, 2331, 200, 200, 200, 2332, 2332, 2332,
+ 2333, 2333, 2332, 2332, 2332, 2332, 2333, 2332,
+ 2332, 2332, 2332, 2334, 200, 200, 200, 200,
+ 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342,
+ 2343, 2344, 2345, 2345, 2346, 2346, 2346, 2347,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2348, 2348, 2348, 2348, 2348, 2348, 2348, 2348,
+ 2348, 2348, 2348, 2348, 2348, 2348, 2348, 2348,
+ 2348, 2348, 2348, 2348, 2348, 2348, 2348, 2348,
+ 2348, 2348, 2348, 2348, 2348, 2348, 2348, 2348,
+ 2349, 2349, 2349, 2349, 2349, 2349, 2349, 2349,
+ 2349, 2349, 2349, 2349, 2349, 2349, 2349, 2349,
+ 2349, 2349, 2349, 2349, 2349, 2349, 2349, 2349,
+ 2349, 2349, 2349, 2349, 2349, 2349, 2349, 2349,
+ 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357,
+ 2358, 2359, 2360, 2360, 2360, 2360, 2360, 2360,
+ 2360, 2360, 2360, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 2361,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 2362, 2362, 2362, 2362, 2362, 2362, 2362,
+ 2362, 200, 200, 200, 200, 200, 200, 200,
+
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2363,
+ 2363, 2363, 2363, 2363, 2363, 2363, 2363, 2364,
+ 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364,
+ 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364,
+ 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364,
+ 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364,
+ 2364, 2364, 2364, 2364, 2364, 2364, 2364, 2364,
+ 2364, 2365, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2366, 2366, 2366, 2366, 2366,
+ 2366, 2366, 2366, 2367, 2367, 2367, 2367, 2367,
+ 2367, 2367, 2367, 2367, 2367, 2367, 2367, 200,
+ 2368, 2368, 2368, 2368, 2369, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 2365, 2365, 2365, 2365,
+ 2365, 2365, 2365, 2365, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2371, 2371, 2371, 2372, 2372, 2372, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2372, 2370, 2370, 2370, 2371, 2372,
+ 2371, 2372, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2371, 2372, 2372, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 2370,
+ 2370, 2370, 2370, 2370, 2370, 2370, 2370, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2374, 2375,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 2373,
+ 2373, 2373, 2373, 2373, 2373, 2373, 2373, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 2376, 2376, 2376, 2376, 2376, 2376, 2376,
+ 2376, 200, 200, 200, 200, 200, 200, 200,
+ 2377, 2377, 2377, 2377, 2377, 2377, 2377, 2377,
+ 2377, 2377, 2377, 2377, 2377, 2377, 2377, 2377,
+ 2377, 2377, 2377, 2377, 2377, 2377, 2377, 2377,
+ 2377, 2377, 2377, 2377, 2377, 2377, 2377, 200,
+ 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385,
+ 2386, 2387, 200, 200, 200, 200, 2388, 2388,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2389, 2389, 2389, 2389, 2389, 2389, 2389, 2389,
+ 2389, 2389, 2389, 2389, 2389, 2389, 2389, 2389,
+ 2389, 2389, 2389, 2389, 2389, 2389, 2389, 2389,
+ 2389, 2389, 2389, 2389, 2389, 2389, 200, 200,
+ 2390, 2390, 2390, 2390, 2390, 2391, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2393, 2393, 2393, 2393, 2393, 2393, 2393, 2394,
+ 2394, 2395, 2396, 2396, 2397, 2397, 2397, 2397,
+ 2398, 2398, 2398, 2398, 2394, 2397, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406,
+ 2407, 2408, 200, 2409, 2409, 2409, 2409, 2409,
+ 2409, 2409, 200, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 200, 200, 200, 200, 200, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410,
+ 2410, 2410, 2410, 2410, 2410, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2410, 2411, 2411, 2411, 2411, 2411, 2411, 2411,
+ 2411, 2411, 2411, 2411, 2411, 2411, 2411, 2411,
+ 2411, 2411, 2411, 2411, 2411, 2411, 2411, 2411,
+ 2411, 2411, 2411, 2411, 2411, 2411, 2411, 2411,
+ 2411, 2411, 2411, 2411, 2411, 2411, 2411, 2411,
+ 2411, 2411, 2411, 2411, 2411, 2411, 2411, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 2412,
+ 2412, 2412, 2412, 2413, 2413, 2413, 2413, 2413,
+ 2413, 2413, 2413, 2413, 2413, 2413, 2413, 2413,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2414, 2415, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 200, 200, 200, 200, 200,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 2416, 2416, 2416, 200, 200, 200,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 200, 200, 200, 200, 200, 200, 200,
+ 2416, 2416, 2416, 2416, 2416, 2416, 2416, 2416,
+ 2416, 2416, 200, 200, 2417, 2418, 2419, 2420,
+ 2421, 2421, 2421, 2421, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 200,
+ 200, 1412, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2423, 2423,
+ 2423, 2423, 2423, 2423, 2423, 2424, 2425, 2426,
+ 2426, 2426, 2422, 2422, 2422, 2427, 2424, 2424,
+ 2424, 2424, 2424, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2429, 2429, 2429, 2429, 2429,
+ 2429, 2429, 2429, 2422, 2422, 2430, 2430, 2430,
+ 2430, 2430, 2429, 2429, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2430, 2430, 2430, 2430, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2423, 2423, 2423, 2423, 2423,
+ 2423, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2422, 2422,
+ 2422, 2422, 2422, 2422, 2422, 2422, 2431, 2431,
+ 2431, 2431, 2431, 2431, 2431, 2431, 2431, 2431,
+ 2431, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022,
+ 2022, 2022, 2432, 2432, 2432, 2022, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
+ 1446, 1446, 1446, 1446, 1446, 1446, 1446, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
+ 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
+ 2433, 2433, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 200, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2434, 200, 2434, 2434,
+ 200, 200, 2434, 200, 200, 2434, 2434, 200,
+ 200, 2434, 2434, 2434, 2434, 200, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2435, 2435,
+ 2435, 2435, 200, 2435, 200, 2435, 2435, 2435,
+ 2435, 2436, 2435, 2435, 200, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+
+ 2435, 2435, 2435, 2435, 2434, 2434, 200, 2434,
+ 2434, 2434, 2434, 200, 200, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 200, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 200, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 200, 2434, 2434, 2434, 2434, 200,
+ 2434, 2434, 2434, 2434, 2434, 200, 2434, 200,
+ 200, 200, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 200, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 1404, 1404, 200, 200,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2437, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2438, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2437, 2435, 2435, 2435, 2435,
+
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2438, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2437, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2438,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2437,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2438, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2434, 2434, 2434, 2434, 2434, 2434, 2434,
+ 2434, 2437, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2435, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2435, 2438, 2435, 2435, 2435, 2435,
+ 2435, 2435, 2439, 2440, 200, 200, 2441, 2442,
+ 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450,
+ 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448,
+ 2449, 2450, 2441, 2442, 2443, 2444, 2445, 2446,
+ 2447, 2448, 2449, 2450, 2441, 2442, 2443, 2444,
+ 2445, 2446, 2447, 2448, 2449, 2450, 2441, 2442,
+ 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450,
+
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2451,
+ 2451, 2451, 2451, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2452, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451,
+ 2451, 2451, 2451, 2451, 2452, 2451, 2451, 2453,
+ 2454, 2453, 2453, 2455, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 2452, 2452, 2452, 2452, 2452,
+ 200, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 2452, 2452, 2452, 2452, 2452, 2452, 2452, 2452,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 2456, 2456, 2456,
+ 2456, 2456, 2456, 2456, 2456, 297, 297, 2457,
+ 2457, 2457, 2457, 2457, 2457, 2457, 2457, 2457,
+ 2458, 2458, 2458, 2458, 2458, 2458, 2458, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+ 297, 297, 297, 297, 297, 297, 297, 297,
+
+ 2459, 2459, 2459, 2459, 343, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 343, 2459, 2459, 343, 2459, 343, 343, 2459,
+ 343, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 343, 2459, 2459, 2459, 2459,
+ 343, 2459, 343, 2459, 343, 343, 343, 343,
+ 343, 343, 2459, 343, 343, 343, 343, 2459,
+ 343, 2459, 343, 2459, 343, 2459, 2459, 2459,
+ 343, 2459, 2459, 343, 2459, 343, 343, 2459,
+ 343, 2459, 343, 2459, 343, 2459, 343, 2459,
+ 343, 2459, 2459, 343, 2459, 343, 343, 2459,
+ 2459, 2459, 2459, 343, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 343, 2459, 2459, 2459, 2459,
+ 343, 2459, 2459, 2459, 2459, 343, 2459, 343,
+ 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 343, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 343, 343, 343, 343,
+ 343, 2459, 2459, 2459, 343, 2459, 2459, 2459,
+ 2459, 2459, 343, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+ 2459, 2459, 2459, 2459, 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,
+ 2460, 2460, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 343, 343, 343, 343, 343,
+
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 200, 200, 200, 200,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482,
+ 1482, 1482, 1482, 1482, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 200,
+ 200, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1483,
+ 200, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 200, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 2461, 2461, 2462, 2463, 2464, 2465, 2466, 2467,
+ 2468, 2469, 2470, 2471, 2471, 200, 200, 200,
+ 2472, 2472, 2472, 2472, 2472, 2472, 2472, 2472,
+ 2472, 2472, 2472, 2472, 2472, 2472, 2472, 2472,
+ 2472, 2472, 2472, 2472, 2472, 2472, 2472, 2472,
+ 2472, 2472, 2472, 2472, 2472, 2472, 2472, 200,
+ 2473, 2474, 2473, 2473, 2473, 2473, 2473, 2473,
+ 2473, 2473, 2473, 2473, 2473, 2474, 2473, 2474,
+ 2473, 2473, 2474, 2473, 2473, 2473, 2474, 2473,
+ 2473, 2473, 2472, 2472, 2472, 2472, 2472, 2475,
+ 2476, 2476, 2476, 2476, 2476, 2476, 2476, 2477,
+ 2476, 2476, 2476, 2476, 2476, 2476, 2476, 2477,
+ 2476, 2476, 2476, 2476, 2476, 2476, 2476, 2476,
+ 2476, 2476, 2478, 2478, 200, 200, 200, 200,
+ 2476, 2476, 2476, 2476, 2476, 2476, 2476, 2476,
+ 2476, 2477, 2476, 2477, 2477, 2476, 2476, 2477,
+ 2476, 2476, 2476, 2476, 2476, 2476, 2476, 2476,
+ 2476, 2476, 778, 778, 778, 778, 2479, 2479,
+ 2472, 2479, 2479, 2479, 2479, 2479, 2479, 2479,
+ 2479, 2479, 2479, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 2480, 2480,
+ 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480,
+ 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480,
+ 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480,
+
+ 2481, 2482, 2482, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,
+ 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,
+ 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,
+ 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,
+ 1632, 1632, 2482, 2482, 2482, 2482, 2482, 2482,
+ 2482, 2482, 2482, 200, 200, 200, 200, 200,
+ 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,
+ 1632, 200, 200, 200, 200, 200, 200, 200,
+ 2482, 2482, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 2483, 2483, 2483,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1483, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1483, 2483, 2483,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1451, 1451, 1483, 1483,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1449, 1449, 1450,
+ 1450, 1450, 1450, 1450, 1449, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1483, 1450, 1450,
+ 1450, 1450, 1450, 1483, 1483, 1483, 1483, 2483,
+ 2483, 2483, 2483, 2483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 2483, 2483, 2483, 2484, 2484, 2484, 2484, 2484,
+
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1483,
+ 1450, 1483, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1449, 1450, 1449, 1450, 1449, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1449,
+ 1450, 1449, 1449, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1483, 1450, 1450, 1450, 1450, 1483, 1483, 2483,
+
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1451, 1451,
+ 2485, 2485, 2485, 2485, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1483, 2483, 2483, 2483, 2483, 2483,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 200, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 200, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1483, 1450, 1450, 1450, 1450, 1450,
+
+ 2486, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 2486, 1450, 1450, 1450, 2486, 1450, 2486,
+ 1450, 2486, 1450, 2486, 1450, 1450, 1450, 2486,
+ 1450, 1450, 1450, 1450, 1450, 1450, 2486, 2486,
+ 1450, 1450, 1450, 1450, 2486, 1450, 2486, 2486,
+ 1450, 1450, 1450, 1450, 2486, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1483, 1483, 2483, 2483, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 2487, 2487,
+ 2487, 2488, 2488, 2488, 1451, 1451, 1451, 1451,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450,
+ 1450, 1450, 1450, 1450, 1450, 1450, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 2483, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
+ 1483, 1483, 1483, 1483, 1483, 200, 200, 200,
+ 1483, 1483, 1483, 1483, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
+ 1449, 1449, 1449, 1449, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 200, 200, 200, 200,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 200, 200, 200, 200, 200, 200,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+ 1451, 1451, 1451, 1451, 1451, 1451, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2483, 2483, 2483, 2483, 2483, 2483, 2483, 2483,
+ 2483, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2483, 2483, 2483, 2483, 2483, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 2483, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 2489, 2489,
+
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 2490,
+ 2490, 2490, 2490, 2490, 2490, 2490, 2490, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
- 1554, 1554, 1554, 1554, 1554, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
-
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262,
- 2262, 2262, 2262, 2262, 2262, 2262, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
-
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 2263, 2263,
- 2263, 2263, 2263, 2263, 2263, 2263, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
-
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
- 1550, 1550, 1550, 1550, 1550, 1550, 2260, 2260,
-
- 1265, 2207, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 2207, 2207, 2207, 2207, 2207, 2207, 2207, 2207,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
-
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 2264, 2264, 2264, 2264, 2264, 2264, 2264, 2264,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
-
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
- 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
-
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
-
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2265, 2265,
- 2265, 2265, 2265, 2265, 2265, 2265, 2260, 2260,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+ 1643, 1643, 1643, 1643, 1643, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 2491, 2491,
+ 2491, 2491, 2491, 2491, 2491, 2491, 1639, 1639,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
+ 1645, 1645, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 2492, 2492,
+ 2492, 2492, 2492, 2492, 2492, 2492, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
+ 1639, 1639, 1639, 1639, 1639, 1639, 2489, 2489,
+
+ 1351, 2428, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 2428, 2428, 2428, 2428, 2428, 2428, 2428, 2428,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 2493, 2493, 2493, 2493, 2493, 2493, 2493, 2493,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351,
+
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2494, 2494,
+ 2494, 2494, 2494, 2494, 2494, 2494, 2489, 2489
};
#define GET_PROP_INDEX(ucs4) \
@@ -5432,19 +5817,19 @@ static const Properties uc_properties[] = {
{ 24, 10, 0, 0, -1, -16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
{ 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
{ 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 17, 0, 8, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 80, 1, 77, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 404, 1, 401, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 121, 0, 121, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 17, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 83, 0, 0, 0, 0, 0, 0, 1, 17, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 407, 0, 0, 0, 0, 0, 0, 1, 17, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -232, 0, -232, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 80, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 162, 1, 162, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 486, 1, 486, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, -121, 0, 0, 0, 0, 0, -121, 1, 17, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -300, 0, -300, 0, -268, 1, 80, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 195, 0, 195, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
@@ -5471,7 +5856,7 @@ static const Properties uc_properties[] = {
{ 16, 0, 0, 0, -1, 0, 0, 1, 0, -1, 0, 0, 0, 1, 1, 80, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -2, 0, -1, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -79, 0, -79, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 173, 1, 173, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 497, 1, 497, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, -97, 0, 0, 0, 0, 0, -97, 4, 0, 0, 8, 7, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, -56, 0, 0, 0, 0, 0, -56, 4, 0, 0, 8, 7, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 4, 17, 0, 8, 7, 12, 3 },
@@ -5521,6 +5906,7 @@ static const Properties uc_properties[] = {
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -71, 0, -71, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -219, 0, -219, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 1, 33, 1, 33, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 35, 1, 35, 0, 0, 1, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 6, 12, 3 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
{ 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 12, 2 },
@@ -5576,12 +5962,12 @@ static const Properties uc_properties[] = {
{ 14, 0, 0, 0, -1, 0, 0, 37, 0, 0, 0, 0, 0, 37, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 64, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, 63, 0, 0, 0, 0, 0, 63, 1, 17, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 165, 1, 165, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 489, 1, 489, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 0, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 17, 0, 8, 7, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -38, 0, -38, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -37, 0, -37, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 169, 1, 169, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 493, 1, 493, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 0, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -31, 0, -31, 0, 1, 1, 0, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
@@ -5656,7 +6042,7 @@ static const Properties uc_properties[] = {
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 6 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 12, 6 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -48, 0, -48, 0, 0, 1, 0, 0, 8, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 129, 1, 126, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 453, 1, 450, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 13, 12, 8, 2 },
{ 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 6 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 6 },
@@ -5732,16 +6118,16 @@ static const Properties uc_properties[] = {
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 8 },
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 8 },
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 8 },
- { 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
- { 3, 5, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 2 },
+ { 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
+ { 3, 5, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
{ 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 8 },
{ 25, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 8 },
{ 25, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 13, 9, 11, 8 },
@@ -5820,6 +6206,8 @@ static const Properties uc_properties[] = {
{ 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 8, 8, 12, 8 },
{ 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 8 },
{ 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 8 },
+ { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 8 },
+ { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 8 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
{ 0, 17, 27, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
@@ -5922,6 +6310,7 @@ static const Properties uc_properties[] = {
{ 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 14 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 14 },
{ 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 9, 14 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 14 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 15 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 4, 4, 21, 15 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 12, 15 },
@@ -5977,6 +6366,7 @@ static const Properties uc_properties[] = {
{ 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 17 },
{ 0, 17, 84, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 17 },
{ 0, 17, 91, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 17 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 17 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 17 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 17 },
{ 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 17 },
@@ -6022,6 +6412,7 @@ static const Properties uc_properties[] = {
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 19 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 7, 4, 4, 21, 19 },
{ 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 19 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 19 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 19 },
{ 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 19 },
{ 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 19 },
@@ -6213,7 +6604,89 @@ static const Properties uc_properties[] = {
{ 5, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
{ 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 27 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 8, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 37, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 39, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 41, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 43, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 45, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 47, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 49, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 51, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 53, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 55, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 57, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 59, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 61, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 63, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 65, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 67, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 69, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 71, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 73, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 75, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 77, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 79, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 81, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 83, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 87, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 89, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 91, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 93, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 95, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 97, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 99, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 101, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 103, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 105, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 107, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 109, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 111, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 113, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 115, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 117, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 119, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 121, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 123, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 125, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 127, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 129, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 131, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 133, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 135, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 137, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 139, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 141, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 143, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 145, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 147, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 149, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 151, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 153, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 155, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 157, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 159, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 161, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 163, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 165, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 167, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 169, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 171, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 173, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 175, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 177, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 179, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 181, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 183, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 185, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 187, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 189, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 191, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 193, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 1, 195, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 7, 12, 28 },
+ { 14, 0, 0, 0, -1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 7, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 0, -8, 0, -8, 0, -8, 17, 0, 0, 8, 6, 12, 28 },
{ 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 29 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 8, 12, 29 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 29 },
@@ -6308,8 +6781,6 @@ static const Properties uc_properties[] = {
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 30, 48 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8, 30, 56 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 30, 56 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 4, 4, 30, 56 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 7, 4, 4, 30, 56 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 14, 9, 11, 56 },
{ 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 14, 9, 11, 56 },
{ 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 14, 9, 11, 56 },
@@ -6444,7 +6915,7 @@ static const Properties uc_properties[] = {
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 8, 6, 12, 3 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 8, 6, 12, 4 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 8, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 35, 1, 35, 0, 0, 8, 0, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 197, 1, 197, 0, 0, 8, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 3814, 0, 3814, 0, 0, 8, 0, 0, 8, 6, 12, 3 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 8, 6, 12, 3 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 8, 6, 12, 4 },
@@ -6456,11 +6927,11 @@ static const Properties uc_properties[] = {
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
{ 0, 17, 202, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
{ 0, 17, 233, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 1 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 176, 1, 176, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 179, 1, 179, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 182, 1, 182, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 185, 1, 185, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 188, 1, 188, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 500, 1, 500, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 503, 1, 503, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 506, 1, 506, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 509, 1, 509, 0, 0, 1, 17, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 512, 1, 512, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -59, 0, -59, 0, -58, 2, 81, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, -7615, 0, 0, 0, 0, 0, -7615, 10, 0, 0, 8, 7, 12, 3 },
@@ -6468,10 +6939,10 @@ static const Properties uc_properties[] = {
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 10, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 8, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -8, 0, 0, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 191, 1, 191, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 194, 1, 194, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 198, 1, 198, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 202, 1, 202, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 515, 1, 515, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 518, 1, 518, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 522, 1, 522, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 526, 1, 526, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 74, 0, 74, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 74, 0, 74, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 86, 0, 86, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
@@ -6484,98 +6955,98 @@ static const Properties uc_properties[] = {
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 112, 0, 112, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 126, 0, 126, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 126, 0, 126, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 240, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 243, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 246, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 249, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 252, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 255, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 258, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 261, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 240, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 243, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 246, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 249, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 252, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 255, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 258, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 261, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 264, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 267, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 270, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 273, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 276, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 279, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 282, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 285, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 264, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 267, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 270, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 273, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 276, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 279, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 282, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 285, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 288, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 291, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 294, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 297, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 300, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 303, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 306, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 309, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 288, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 291, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 294, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 297, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 300, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 303, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 306, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 309, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 324, 1, 321, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 312, 0, 9, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 330, 1, 327, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 206, 1, 206, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 361, 1, 357, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 564, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 567, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 570, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 573, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 576, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 579, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 582, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 585, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 564, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 567, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 570, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 573, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 576, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 579, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 582, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 585, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 588, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 591, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 594, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 597, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 600, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 603, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 606, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 609, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 588, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 591, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 594, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 597, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 600, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 603, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 606, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 609, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 612, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 615, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 618, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 621, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 624, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 627, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 630, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 633, 0, 8, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 612, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 615, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 618, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 621, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 624, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 627, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 630, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -8, 1, 633, 0, 0, 0, -8, 1, 17, 0, 8, 7, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 648, 1, 645, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 636, 0, 9, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 654, 1, 651, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 530, 1, 530, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 685, 1, 681, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -74, 0, 0, 0, 0, 0, -74, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -74, 0, 0, 0, 0, 0, -74, 1, 85, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -9, 1, 312, 0, 0, 0, -9, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -9, 1, 636, 0, 0, 0, -9, 1, 17, 0, 8, 7, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -7205, 0, -7205, 0, -7173, 1, 85, 0, 8, 6, 12, 4 },
{ 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 0, 0, 0, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 336, 1, 333, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 315, 0, 9, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 342, 1, 339, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 209, 1, 209, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 369, 1, 365, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 660, 1, 657, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 639, 0, 9, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 666, 1, 663, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 533, 1, 533, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 693, 1, 689, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -86, 0, 0, 0, 0, 0, -86, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -86, 0, 0, 0, 0, 0, -86, 1, 85, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -9, 1, 315, 0, 0, 0, -9, 1, 17, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 212, 1, 212, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 165, 1, 165, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 216, 1, 216, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 219, 1, 219, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -9, 1, 639, 0, 0, 0, -9, 1, 17, 0, 8, 7, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 536, 1, 536, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 489, 1, 489, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 540, 1, 540, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 543, 1, 543, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -100, 0, 0, 0, 0, 0, -100, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -100, 0, 0, 0, 0, 0, -100, 1, 85, 0, 8, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 223, 1, 223, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 169, 1, 169, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 227, 1, 227, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 547, 1, 547, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 493, 1, 493, 0, 0, 1, 85, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 551, 1, 551, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 7, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 230, 1, 230, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 233, 1, 233, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 554, 1, 554, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 557, 1, 557, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -112, 0, 0, 0, 0, 0, -112, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -112, 0, 0, 0, 0, 0, -112, 1, 85, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -7, 0, 0, 0, 0, 0, -7, 1, 17, 0, 8, 7, 12, 4 },
{ 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 0, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 348, 1, 345, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 318, 0, 9, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 354, 1, 351, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 237, 1, 237, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 377, 1, 373, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 672, 1, 669, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 642, 0, 9, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 678, 1, 675, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 561, 1, 561, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 701, 1, 697, 0, 0, 1, 17, 0, 8, 6, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -128, 0, 0, 0, 0, 0, -128, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -128, 0, 0, 0, 0, 0, -128, 1, 85, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -126, 0, 0, 0, 0, 0, -126, 1, 17, 0, 8, 7, 12, 4 },
{ 14, 0, 0, 0, -1, 0, 0, -126, 0, 0, 0, 0, 0, -126, 1, 85, 0, 8, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -9, 1, 318, 0, 0, 0, -9, 1, 17, 0, 8, 7, 12, 4 },
+ { 16, 0, 0, 0, -1, 0, 0, -9, 1, 642, 0, 0, 0, -9, 1, 17, 0, 8, 7, 12, 4 },
{ 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 0, 18, 4 },
{ 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 5, 17, 2 },
{ 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 5, 17, 2 },
@@ -6661,6 +7132,7 @@ static const Properties uc_properties[] = {
{ 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 9, 2 },
{ 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 10, 2 },
{ 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 9, 2 },
+ { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 10, 2 },
{ 13, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0 },
{ 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
{ 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 1 },
@@ -6674,8 +7146,8 @@ static const Properties uc_properties[] = {
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 6, 12, 2 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 9, 2 },
{ 14, 0, 0, 0, -1, 0, 0, -7517, 0, 0, 0, 0, 0, -7517, 1, 85, 0, 8, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 1, 37, 0, 0, 0, 0, 1, 37, 1, 85, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 39, 0, 0, 0, 0, 1, 39, 1, 85, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 199, 0, 0, 0, 0, 1, 199, 1, 85, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 201, 0, 0, 0, 0, 1, 201, 1, 85, 0, 8, 7, 12, 3 },
{ 29, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
{ 14, 0, 0, 0, -1, 0, 0, 28, 0, 0, 0, 0, 0, 28, 1, 0, 0, 8, 7, 12, 3 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 8, 12, 2 },
@@ -6696,6 +7168,7 @@ static const Properties uc_properties[] = {
{ 4, 0, 0, 0, -1, 0, 0, 0, 0, -16, 0, -16, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
{ 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 12, 3 },
{ 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 8, 8, 12, 3 },
+ { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 2 },
{ 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
{ 26, 10, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
@@ -6713,6 +7186,7 @@ static const Properties uc_properties[] = {
{ 26, 10, 0, 0, -1, 2108, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
{ 26, 10, 0, 0, -1, 2106, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
{ 26, 10, 0, 0, -1, -138, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
+ { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 15, 2 },
{ 26, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
{ 26, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
{ 26, 10, 0, 0, -1, -8, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
@@ -6803,19 +7277,19 @@ static const Properties uc_properties[] = {
{ 26, 10, 0, 0, -1, -2108, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
{ 14, 0, 0, 0, -1, 0, 0, 48, 0, 0, 0, 0, 0, 48, 8, 0, 0, 8, 7, 12, 57 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -48, 0, -48, 0, 0, 8, 0, 0, 8, 6, 12, 57 },
- { 14, 0, 0, 0, -1, 0, 1, 41, 0, 0, 0, 0, 1, 41, 9, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 203, 0, 0, 0, 0, 1, 203, 9, 0, 0, 8, 7, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, -3814, 0, 0, 0, 0, 0, -3814, 9, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 43, 0, 0, 0, 0, 1, 43, 9, 0, 0, 8, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 45, 1, 45, 0, 0, 9, 0, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 47, 1, 47, 0, 0, 9, 0, 0, 8, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 49, 0, 0, 0, 0, 1, 49, 10, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 51, 0, 0, 0, 0, 1, 51, 10, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 53, 0, 0, 0, 0, 1, 53, 10, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 55, 0, 0, 0, 0, 1, 55, 11, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 205, 0, 0, 0, 0, 1, 205, 9, 0, 0, 8, 7, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 207, 1, 207, 0, 0, 9, 0, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 209, 1, 209, 0, 0, 9, 0, 0, 8, 6, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 211, 0, 0, 0, 0, 1, 211, 10, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 213, 0, 0, 0, 0, 1, 213, 10, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 215, 0, 0, 0, 0, 1, 215, 10, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 217, 0, 0, 0, 0, 1, 217, 11, 0, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 8, 6, 12, 3 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 80, 0, 8, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 57, 0, 0, 0, 0, 1, 57, 11, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 59, 0, 0, 0, 0, 1, 59, 11, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 219, 0, 0, 0, 0, 1, 219, 11, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 221, 0, 0, 0, 0, 1, 221, 11, 0, 0, 8, 7, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 8, 0, 0, 8, 7, 12, 46 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 8, 0, 0, 8, 6, 12, 46 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 8, 6, 12, 46 },
@@ -6921,6 +7395,7 @@ static const Properties uc_properties[] = {
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 8, 14, 37 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 14, 37 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 8, 14, 37 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 8, 14, 37 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 8, 14, 38 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 8, 8, 5, 38 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 14, 38 },
@@ -6950,6 +7425,7 @@ static const Properties uc_properties[] = {
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 5 },
{ 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 8, 8, 12, 5 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 80, 0, 8, 6, 12, 5 },
+ { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 5 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 12, 84 },
{ 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 12, 84 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 84 },
@@ -6959,10 +7435,11 @@ static const Properties uc_properties[] = {
{ 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
{ 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 8, 8, 12, 2 },
{ 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 1, 61, 0, 0, 0, 0, 1, 61, 10, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 223, 0, 0, 0, 0, 1, 223, 10, 0, 0, 8, 7, 12, 3 },
{ 28, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 1, 63, 0, 0, 0, 0, 1, 63, 12, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 225, 0, 0, 0, 0, 1, 225, 12, 0, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 8, 6, 12, 3 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 12, 0, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 12, 0, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 13, 0, 0, 8, 7, 12, 3 },
@@ -6970,12 +7447,16 @@ static const Properties uc_properties[] = {
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 6, 12, 3 },
{ 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 16, 0, 0, 8, 7, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 16, 0, 0, 8, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 65, 0, 0, 0, 0, 1, 65, 13, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 67, 0, 0, 0, 0, 1, 67, 16, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 69, 0, 0, 0, 0, 1, 69, 16, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 71, 0, 0, 0, 0, 1, 71, 16, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 73, 0, 0, 0, 0, 1, 73, 16, 0, 0, 8, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 75, 0, 0, 0, 0, 1, 75, 16, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 227, 0, 0, 0, 0, 1, 227, 13, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 229, 0, 0, 0, 0, 1, 229, 16, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 231, 0, 0, 0, 0, 1, 231, 16, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 233, 0, 0, 0, 0, 1, 233, 16, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 235, 0, 0, 0, 0, 1, 235, 16, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 237, 0, 0, 0, 0, 1, 237, 16, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 239, 0, 0, 0, 0, 1, 239, 17, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 0, 928, 0, 0, 0, 0, 0, 928, 17, 0, 0, 8, 7, 12, 3 },
+ { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 17, 0, 0, 8, 7, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 17, 0, 0, 8, 6, 12, 3 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 3 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 80, 0, 8, 6, 12, 3 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 8, 8, 12, 3 },
@@ -7006,6 +7487,8 @@ static const Properties uc_properties[] = {
{ 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 14, 9, 11, 71 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 11 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 11 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 18, 11 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 11 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 14, 9, 11, 72 },
{ 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 14, 9, 11, 72 },
{ 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 14, 9, 11, 72 },
@@ -7089,9 +7572,91 @@ static const Properties uc_properties[] = {
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 8, 8, 12, 86 },
{ 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 86 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 8, 8, 12, 27 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 0, -928, 0, -928, 0, 0, 16, 0, 0, 8, 6, 12, 3 },
{ 28, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 2 },
{ 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 6, 12, 3 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 6, 12, 4 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 241, 1, 241, 1, 241, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 243, 1, 243, 1, 243, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 245, 1, 245, 1, 245, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 247, 1, 247, 1, 247, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 249, 1, 249, 1, 249, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 251, 1, 251, 1, 251, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 253, 1, 253, 1, 253, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 255, 1, 255, 1, 255, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 257, 1, 257, 1, 257, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 259, 1, 259, 1, 259, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 261, 1, 261, 1, 261, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 263, 1, 263, 1, 263, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 265, 1, 265, 1, 265, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 267, 1, 267, 1, 267, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 269, 1, 269, 1, 269, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 271, 1, 271, 1, 271, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 273, 1, 273, 1, 273, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 275, 1, 275, 1, 275, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 277, 1, 277, 1, 277, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 279, 1, 279, 1, 279, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 281, 1, 281, 1, 281, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 283, 1, 283, 1, 283, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 285, 1, 285, 1, 285, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 287, 1, 287, 1, 287, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 289, 1, 289, 1, 289, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 291, 1, 291, 1, 291, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 293, 1, 293, 1, 293, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 295, 1, 295, 1, 295, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 297, 1, 297, 1, 297, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 299, 1, 299, 1, 299, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 301, 1, 301, 1, 301, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 303, 1, 303, 1, 303, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 305, 1, 305, 1, 305, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 307, 1, 307, 1, 307, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 309, 1, 309, 1, 309, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 311, 1, 311, 1, 311, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 313, 1, 313, 1, 313, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 315, 1, 315, 1, 315, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 317, 1, 317, 1, 317, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 319, 1, 319, 1, 319, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 321, 1, 321, 1, 321, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 323, 1, 323, 1, 323, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 325, 1, 325, 1, 325, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 327, 1, 327, 1, 327, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 329, 1, 329, 1, 329, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 331, 1, 331, 1, 331, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 333, 1, 333, 1, 333, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 335, 1, 335, 1, 335, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 337, 1, 337, 1, 337, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 339, 1, 339, 1, 339, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 341, 1, 341, 1, 341, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 343, 1, 343, 1, 343, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 345, 1, 345, 1, 345, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 347, 1, 347, 1, 347, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 349, 1, 349, 1, 349, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 351, 1, 351, 1, 351, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 353, 1, 353, 1, 353, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 355, 1, 355, 1, 355, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 357, 1, 357, 1, 357, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 359, 1, 359, 1, 359, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 361, 1, 361, 1, 361, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 363, 1, 363, 1, 363, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 365, 1, 365, 1, 365, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 367, 1, 367, 1, 367, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 369, 1, 369, 1, 369, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 371, 1, 371, 1, 371, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 373, 1, 373, 1, 373, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 375, 1, 375, 1, 375, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 377, 1, 377, 1, 377, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 379, 1, 379, 1, 379, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 381, 1, 381, 1, 381, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 383, 1, 383, 1, 383, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 385, 1, 385, 1, 385, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 387, 1, 387, 1, 387, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 389, 1, 389, 1, 389, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 391, 1, 391, 1, 391, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 393, 1, 393, 1, 393, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 395, 1, 395, 1, 395, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 397, 1, 397, 1, 397, 17, 0, 0, 8, 6, 12, 28 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 399, 1, 399, 1, 399, 17, 0, 0, 8, 6, 12, 28 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 12, 86 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 7, 4, 4, 21, 86 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 86 },
@@ -7116,17 +7681,17 @@ static const Properties uc_properties[] = {
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 85, 0, 0, 8, 14, 37 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 85, 0, 0, 8, 14, 37 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 85, 0, 0, 8, 14, 37 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 89, 1, 86, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 95, 1, 92, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 101, 1, 98, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 108, 1, 104, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 116, 1, 112, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 123, 1, 120, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 135, 1, 132, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 141, 1, 138, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 147, 1, 144, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 153, 1, 150, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 159, 1, 156, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 413, 1, 410, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 419, 1, 416, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 425, 1, 422, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 432, 1, 428, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 440, 1, 436, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 447, 1, 444, 0, 0, 1, 80, 0, 8, 6, 12, 3 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 459, 1, 456, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 465, 1, 462, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 471, 1, 468, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 477, 1, 474, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
+ { 15, 0, 0, 0, -1, 0, 0, 0, 1, 483, 1, 480, 0, 0, 1, 80, 0, 8, 6, 12, 6 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 85, 0, 7, 8, 13, 7 },
{ 0, 17, 26, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 7, 8, 13, 7 },
@@ -7254,6 +7819,8 @@ static const Properties uc_properties[] = {
{ 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 118 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 117 },
{ 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 117 },
+ { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 128 },
+ { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 128 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 8, 8, 12, 64 },
{ 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 64 },
{ 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 64 },
@@ -7262,6 +7829,7 @@ static const Properties uc_properties[] = {
{ 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 76 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 8, 8, 12, 98 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 8, 8, 12, 97 },
+ { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 97 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 8, 8, 12, 61 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
@@ -7305,6 +7873,9 @@ static const Properties uc_properties[] = {
{ 5, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 121 },
{ 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 121 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 12, 91 },
+ { 14, 1, 0, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 64, 17, 0, 0, 8, 7, 12, 130 },
+ { 15, 1, 0, 0, -1, 0, 0, 0, 0, -64, 0, -64, 0, 0, 17, 0, 0, 8, 6, 12, 130 },
+ { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 130 },
{ 5, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
{ 5, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
{ 5, 5, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
@@ -7392,6 +7963,9 @@ static const Properties uc_properties[] = {
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 12, 17, 100 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 100 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 17, 100 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 100 },
+ { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 100 },
+ { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 100 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 12, 100 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 100 },
{ 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 100 },
@@ -7404,6 +7978,10 @@ static const Properties uc_properties[] = {
{ 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 100 },
{ 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 100 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 100 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 18, 100 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 100 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 17, 100 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 100 },
{ 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 20 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 109 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 7, 4, 4, 21, 109 },
@@ -7412,6 +7990,8 @@ static const Properties uc_properties[] = {
{ 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 109 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 109 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 109 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 129 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 129 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 123 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 123 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 7, 4, 4, 21, 123 },
@@ -7427,6 +8007,7 @@ static const Properties uc_properties[] = {
{ 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 14, 9, 11, 123 },
{ 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 14, 9, 11, 123 },
{ 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 14, 9, 11, 123 },
+ { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 107 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 107 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 7, 4, 4, 21, 107 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 107 },
@@ -7434,6 +8015,7 @@ static const Properties uc_properties[] = {
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 204, 4, 4, 4, 21, 107 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 7, 4, 4, 21, 107 },
{ 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 7, 4, 4, 21, 107 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 107 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 107 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 124 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 204, 4, 4, 4, 21, 124 },
@@ -7465,6 +8047,9 @@ static const Properties uc_properties[] = {
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 122 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 122 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 122 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 122 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 122 },
+ { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 122 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 114 },
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 7, 4, 4, 21, 114 },
{ 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 114 },
@@ -7496,6 +8081,23 @@ static const Properties uc_properties[] = {
{ 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 102 },
{ 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 102 },
{ 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 9, 11, 102 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 8, 30, 126 },
+ { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 30, 126 },
+ { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 7, 4, 4, 30, 126 },
+ { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 30, 126 },
+ { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 14, 9, 11, 126 },
+ { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 30, 126 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 126 },
+ { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 30, 126 },
{ 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 16, 0, 0, 8, 7, 12, 125 },
{ 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 16, 0, 0, 8, 6, 12, 125 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 14, 9, 11, 125 },
@@ -7513,6 +8115,7 @@ static const Properties uc_properties[] = {
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 119 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 8, 8, 12, 63 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 63 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 63 },
{ 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 8, 8, 12, 63 },
{ 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 63 },
{ 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 17, 63 },
@@ -7520,6 +8123,9 @@ static const Properties uc_properties[] = {
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 12, 81 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 0, 81 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 8, 8, 1, 81 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 12, 127 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 0, 127 },
+ { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 8, 8, 1, 127 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 8, 8, 12, 84 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 115 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 14, 9, 11, 115 },
@@ -7575,6 +8181,7 @@ static const Properties uc_properties[] = {
{ 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 4, 4, 21, 2 },
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 1 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 1 },
+ { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 2 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 4 },
{ 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
{ 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 8, 7, 12, 2 },
@@ -7594,6 +8201,11 @@ static const Properties uc_properties[] = {
{ 3, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 14, 9, 11, 2 },
{ 3, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 14, 9, 11, 2 },
{ 3, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 14, 9, 11, 2 },
+ { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 131 },
+ { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 131 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 17, 131 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 131 },
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 131 },
{ 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 8, 8, 12, 113 },
{ 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 113 },
{ 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 113 },
@@ -7621,6 +8233,8 @@ static const Properties uc_properties[] = {
{ 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 5, 5, 0, 28, 2 },
{ 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 14, 34 },
{ 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 80, 0, 0, 0, 14, 2 },
+ { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 14, 2 },
+ { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 2 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 2 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 14, 2 },
{ 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 13, 3, 2 },
@@ -7635,14 +8249,12 @@ static const Properties uc_properties[] = {
Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) Q_DECL_NOTHROW
{
- const int index = GET_PROP_INDEX(ucs4);
- return uc_properties + index;
+ return uc_properties + GET_PROP_INDEX(ucs4);
}
Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) Q_DECL_NOTHROW
{
- const int index = GET_PROP_INDEX_UCS2(ucs2);
- return uc_properties + index;
+ return uc_properties + GET_PROP_INDEX_UCS2(ucs2);
}
Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW
@@ -7657,26 +8269,26 @@ Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(us
Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW
{
- return (GraphemeBreakClass)qGetProp(ucs4)->graphemeBreakClass;
+ return static_cast<GraphemeBreakClass>(qGetProp(ucs4)->graphemeBreakClass);
}
Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW
{
- return (WordBreakClass)qGetProp(ucs4)->wordBreakClass;
+ return static_cast<WordBreakClass>(qGetProp(ucs4)->wordBreakClass);
}
Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW
{
- return (SentenceBreakClass)qGetProp(ucs4)->sentenceBreakClass;
+ return static_cast<SentenceBreakClass>(qGetProp(ucs4)->sentenceBreakClass);
}
Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW
{
- return (LineBreakClass)qGetProp(ucs4)->lineBreakClass;
+ return static_cast<LineBreakClass>(qGetProp(ucs4)->lineBreakClass);
}
-static const ushort specialCaseMap[] = {
+static const unsigned short specialCaseMap[] = {
0x0, // placeholder
0x1, 0x2c65,
0x1, 0x2c66,
@@ -7694,7 +8306,88 @@ static const ushort specialCaseMap[] = {
0x1, 0x2c6e,
0x1, 0x2c64,
0x1, 0xa7b1,
+ 0x1, 0xa7b2,
0x1, 0xa7b0,
+ 0x1, 0xab70,
+ 0x1, 0xab71,
+ 0x1, 0xab72,
+ 0x1, 0xab73,
+ 0x1, 0xab74,
+ 0x1, 0xab75,
+ 0x1, 0xab76,
+ 0x1, 0xab77,
+ 0x1, 0xab78,
+ 0x1, 0xab79,
+ 0x1, 0xab7a,
+ 0x1, 0xab7b,
+ 0x1, 0xab7c,
+ 0x1, 0xab7d,
+ 0x1, 0xab7e,
+ 0x1, 0xab7f,
+ 0x1, 0xab80,
+ 0x1, 0xab81,
+ 0x1, 0xab82,
+ 0x1, 0xab83,
+ 0x1, 0xab84,
+ 0x1, 0xab85,
+ 0x1, 0xab86,
+ 0x1, 0xab87,
+ 0x1, 0xab88,
+ 0x1, 0xab89,
+ 0x1, 0xab8a,
+ 0x1, 0xab8b,
+ 0x1, 0xab8c,
+ 0x1, 0xab8d,
+ 0x1, 0xab8e,
+ 0x1, 0xab8f,
+ 0x1, 0xab90,
+ 0x1, 0xab91,
+ 0x1, 0xab92,
+ 0x1, 0xab93,
+ 0x1, 0xab94,
+ 0x1, 0xab95,
+ 0x1, 0xab96,
+ 0x1, 0xab97,
+ 0x1, 0xab98,
+ 0x1, 0xab99,
+ 0x1, 0xab9a,
+ 0x1, 0xab9b,
+ 0x1, 0xab9c,
+ 0x1, 0xab9d,
+ 0x1, 0xab9e,
+ 0x1, 0xab9f,
+ 0x1, 0xaba0,
+ 0x1, 0xaba1,
+ 0x1, 0xaba2,
+ 0x1, 0xaba3,
+ 0x1, 0xaba4,
+ 0x1, 0xaba5,
+ 0x1, 0xaba6,
+ 0x1, 0xaba7,
+ 0x1, 0xaba8,
+ 0x1, 0xaba9,
+ 0x1, 0xabaa,
+ 0x1, 0xabab,
+ 0x1, 0xabac,
+ 0x1, 0xabad,
+ 0x1, 0xabae,
+ 0x1, 0xabaf,
+ 0x1, 0xabb0,
+ 0x1, 0xabb1,
+ 0x1, 0xabb2,
+ 0x1, 0xabb3,
+ 0x1, 0xabb4,
+ 0x1, 0xabb5,
+ 0x1, 0xabb6,
+ 0x1, 0xabb7,
+ 0x1, 0xabb8,
+ 0x1, 0xabb9,
+ 0x1, 0xabba,
+ 0x1, 0xabbb,
+ 0x1, 0xabbc,
+ 0x1, 0xabbd,
+ 0x1, 0xabbe,
+ 0x1, 0xabbf,
0x1, 0xa77d,
0x1, 0x6b,
0x1, 0xe5,
@@ -7716,6 +8409,87 @@ static const ushort specialCaseMap[] = {
0x1, 0x26c,
0x1, 0x29e,
0x1, 0x287,
+ 0x1, 0x29d,
+ 0x1, 0x13a0,
+ 0x1, 0x13a1,
+ 0x1, 0x13a2,
+ 0x1, 0x13a3,
+ 0x1, 0x13a4,
+ 0x1, 0x13a5,
+ 0x1, 0x13a6,
+ 0x1, 0x13a7,
+ 0x1, 0x13a8,
+ 0x1, 0x13a9,
+ 0x1, 0x13aa,
+ 0x1, 0x13ab,
+ 0x1, 0x13ac,
+ 0x1, 0x13ad,
+ 0x1, 0x13ae,
+ 0x1, 0x13af,
+ 0x1, 0x13b0,
+ 0x1, 0x13b1,
+ 0x1, 0x13b2,
+ 0x1, 0x13b3,
+ 0x1, 0x13b4,
+ 0x1, 0x13b5,
+ 0x1, 0x13b6,
+ 0x1, 0x13b7,
+ 0x1, 0x13b8,
+ 0x1, 0x13b9,
+ 0x1, 0x13ba,
+ 0x1, 0x13bb,
+ 0x1, 0x13bc,
+ 0x1, 0x13bd,
+ 0x1, 0x13be,
+ 0x1, 0x13bf,
+ 0x1, 0x13c0,
+ 0x1, 0x13c1,
+ 0x1, 0x13c2,
+ 0x1, 0x13c3,
+ 0x1, 0x13c4,
+ 0x1, 0x13c5,
+ 0x1, 0x13c6,
+ 0x1, 0x13c7,
+ 0x1, 0x13c8,
+ 0x1, 0x13c9,
+ 0x1, 0x13ca,
+ 0x1, 0x13cb,
+ 0x1, 0x13cc,
+ 0x1, 0x13cd,
+ 0x1, 0x13ce,
+ 0x1, 0x13cf,
+ 0x1, 0x13d0,
+ 0x1, 0x13d1,
+ 0x1, 0x13d2,
+ 0x1, 0x13d3,
+ 0x1, 0x13d4,
+ 0x1, 0x13d5,
+ 0x1, 0x13d6,
+ 0x1, 0x13d7,
+ 0x1, 0x13d8,
+ 0x1, 0x13d9,
+ 0x1, 0x13da,
+ 0x1, 0x13db,
+ 0x1, 0x13dc,
+ 0x1, 0x13dd,
+ 0x1, 0x13de,
+ 0x1, 0x13df,
+ 0x1, 0x13e0,
+ 0x1, 0x13e1,
+ 0x1, 0x13e2,
+ 0x1, 0x13e3,
+ 0x1, 0x13e4,
+ 0x1, 0x13e5,
+ 0x1, 0x13e6,
+ 0x1, 0x13e7,
+ 0x1, 0x13e8,
+ 0x1, 0x13e9,
+ 0x1, 0x13ea,
+ 0x1, 0x13eb,
+ 0x1, 0x13ec,
+ 0x1, 0x13ed,
+ 0x1, 0x13ee,
+ 0x1, 0x13ef,
0x2, 0x53, 0x73,
0x2, 0x53, 0x53,
0x2, 0x69, 0x307,
@@ -9631,8 +10405,8 @@ static const unsigned short uc_decomposition_trie[] = {
#define GET_DECOMPOSITION_INDEX(ucs4) \
(ucs4 < 0x3400 \
? (uc_decomposition_trie[uc_decomposition_trie[ucs4>>4] + (ucs4 & 0xf)]) \
- : (ucs4 < 0x30000\
- ? uc_decomposition_trie[uc_decomposition_trie[((ucs4 - 0x3400)>>8) + 0x340] + (ucs4 & 0xff)]\
+ : (ucs4 < 0x30000 \
+ ? uc_decomposition_trie[uc_decomposition_trie[((ucs4 - 0x3400)>>8) + 0x340] + (ucs4 & 0xff)] \
: 0xffff))
static const unsigned short uc_decomposition_map[] = {
@@ -11832,8 +12606,8 @@ static const unsigned short uc_ligature_trie[] = {
#define GET_LIGATURE_INDEX(ucs4) \
(ucs4 < 0x3100 \
? (uc_ligature_trie[uc_ligature_trie[ucs4>>5] + (ucs4 & 0x1f)]) \
- : (ucs4 < 0x12000\
- ? uc_ligature_trie[uc_ligature_trie[((ucs4 - 0x3100)>>8) + 0x188] + (ucs4 & 0xff)]\
+ : (ucs4 < 0x12000 \
+ ? uc_ligature_trie[uc_ligature_trie[((ucs4 - 0x3100)>>8) + 0x188] + (ucs4 & 0xff)] \
: 0xffff))
static const unsigned short uc_ligature_map[] = {
@@ -12098,7 +12872,7 @@ static const NormalizationCorrection uc_normalization_corrections[] = {
{ 0x2f874, 0x5f33, 7 },
{ 0x2f91f, 0x43ab, 7 },
{ 0x2f95f, 0x7aae, 7 },
- { 0x2f9bf, 0x4d57, 7 },
+ { 0x2f9bf, 0x4d57, 7 }
};
enum { NumNormalizationCorrections = 6 };
diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h
index 43c1f4e197..6a2797be0e 100644
--- a/src/corelib/tools/qunicodetables_p.h
+++ b/src/corelib/tools/qunicodetables_p.h
@@ -31,7 +31,7 @@
**
****************************************************************************/
-/* This file is autogenerated from the Unicode 7.0 database. Do not edit */
+/* This file is autogenerated from the Unicode 8.0 database. Do not edit */
//
// W A R N I N G
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-#define UNICODE_DATA_VERSION QChar::Unicode_7_0
+#define UNICODE_DATA_VERSION QChar::Unicode_8_0
namespace QUnicodeTables {
@@ -82,6 +82,38 @@ struct Properties {
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW;
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW;
+struct LowercaseTraits
+{
+ static inline signed short caseDiff(const Properties *prop)
+ { return prop->lowerCaseDiff; }
+ static inline bool caseSpecial(const Properties *prop)
+ { return prop->lowerCaseSpecial; }
+};
+
+struct UppercaseTraits
+{
+ static inline signed short caseDiff(const Properties *prop)
+ { return prop->upperCaseDiff; }
+ static inline bool caseSpecial(const Properties *prop)
+ { return prop->upperCaseSpecial; }
+};
+
+struct TitlecaseTraits
+{
+ static inline signed short caseDiff(const Properties *prop)
+ { return prop->titleCaseDiff; }
+ static inline bool caseSpecial(const Properties *prop)
+ { return prop->titleCaseSpecial; }
+};
+
+struct CasefoldTraits
+{
+ static inline signed short caseDiff(const Properties *prop)
+ { return prop->caseFoldDiff; }
+ static inline bool caseSpecial(const Properties *prop)
+ { return prop->caseFoldSpecial; }
+};
+
enum GraphemeBreakClass {
GraphemeBreak_Other,
GraphemeBreak_CR,
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index 56576c69f1..0df6b01b13 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -49,7 +49,7 @@ namespace QUnicodeTools {
// -----------------------------------------------------------------------------------------------------
//
// The text boundaries determination algorithm.
-// See http://www.unicode.org/reports/tr29/tr29-25.html
+// See http://www.unicode.org/reports/tr29/tr29-27.html
//
// -----------------------------------------------------------------------------------------------------
@@ -244,8 +244,9 @@ namespace SB {
enum State {
Initial,
+ Lower,
Upper,
- UpATerm,
+ LUATerm,
ATerm,
ATermC,
ACS,
@@ -260,10 +261,11 @@ enum State {
static const uchar breakTable[BAfter + 1][QUnicodeTables::SentenceBreak_Close + 1] = {
// Other CR LF Sep Extend Sp Lower Upper OLetter Numeric ATerm SContinue STerm Close
- { Initial, BAfterC, BAfter , BAfter , Initial, Initial, Initial, Upper , Initial, Initial, ATerm , Initial, STerm , Initial }, // Initial
- { Initial, BAfterC, BAfter , BAfter , Upper , Initial, Initial, Upper , Initial, Initial, UpATerm, STerm , STerm , Initial }, // Upper
+ { Initial, BAfterC, BAfter , BAfter , Initial, Initial, Lower , Upper , Initial, Initial, ATerm , Initial, STerm , Initial }, // Initial
+ { Initial, BAfterC, BAfter , BAfter , Lower , Initial, Initial, Initial, Initial, Initial, LUATerm, Initial, STerm , Initial }, // Lower
+ { Initial, BAfterC, BAfter , BAfter , Upper , Initial, Initial, Upper , Initial, Initial, LUATerm, STerm , STerm , Initial }, // Upper
- { Lookup , BAfterC, BAfter , BAfter , UpATerm, ACS , Initial, Upper , Break , Initial, ATerm , STerm , STerm , ATermC }, // UpATerm
+ { Lookup , BAfterC, BAfter , BAfter , LUATerm, ACS , Initial, Upper , Break , Initial, ATerm , STerm , STerm , ATermC }, // LUATerm
{ Lookup , BAfterC, BAfter , BAfter , ATerm , ACS , Initial, Break , Break , Initial, ATerm , STerm , STerm , ATermC }, // ATerm
{ Lookup , BAfterC, BAfter , BAfter , ATermC , ACS , Initial, Break , Break , Lookup , ATerm , STerm , STerm , ATermC }, // ATermC
{ Lookup , BAfterC, BAfter , BAfter , ACS , ACS , Initial, Break , Break , Lookup , ATerm , STerm , STerm , Lookup }, // ACS
@@ -341,7 +343,7 @@ static void getSentenceBreaks(const ushort *string, quint32 len, QCharAttributes
// -----------------------------------------------------------------------------------------------------
//
// The line breaking algorithm.
-// See http://www.unicode.org/reports/tr14/tr14-33.html
+// See http://www.unicode.org/reports/tr14/tr14-35.html
//
// -----------------------------------------------------------------------------------------------------
@@ -408,26 +410,29 @@ inline Class toClass(QUnicodeTables::LineBreakClass lbc, QChar::Category categor
/* In order to support the tailored implementation of LB25 properly
the following changes were made in the pair table to allow breaks
where the numeric expression doesn't match the template (i.e. [^NU](IS|SY)NU):
- CL->PO from IB to DB
- CP->PO from IB to DB
- CL->PR from IB to DB
- CP->PR from IB to DB
- PO->OP from IB to DB
- PR->OP from IB to DB
- IS->NU from IB to DB
- SY->NU from IB to DB
+ (CL)(PO) from IB to DB
+ (CP)(PO) from IB to DB
+ (CL)(PR) from IB to DB
+ (CP)(PR) from IB to DB
+ (PO)(OP) from IB to DB
+ (PR)(OP) from IB to DB
+ (IS)(NU) from IB to DB
+ (SY)(NU) from IB to DB
*/
-// The following line break classes are not treated by the pair table
-// and must be resolved outside:
-// AI, BK, CB, CJ, CR, LF, NL, SA, SG, SP, XX
+/* In order to implementat LB21a properly a special rule HH has been introduced and
+ the following changes were made in the pair table to disallow breaks after Hebrew + Hyphen:
+ (HL)(HY|BA) from IB to CI
+ (HY|BA)(!CB) from DB to HH
+*/
enum Action {
ProhibitedBreak, PB = ProhibitedBreak,
DirectBreak, DB = DirectBreak,
IndirectBreak, IB = IndirectBreak,
CombiningIndirectBreak, CI = CombiningIndirectBreak,
- CombiningProhibitedBreak, CP = CombiningProhibitedBreak
+ CombiningProhibitedBreak, CP = CombiningProhibitedBreak,
+ ProhibitedBreakAfterHebrewPlusHyphen, HH = ProhibitedBreakAfterHebrewPlusHyphen
};
static const uchar breakTable[QUnicodeTables::LineBreak_CB + 1][QUnicodeTables::LineBreak_CB + 1] = {
@@ -438,18 +443,18 @@ static const uchar breakTable[QUnicodeTables::LineBreak_CB + 1][QUnicodeTables::
/* QU */ { PB, PB, PB, IB, IB, IB, PB, PB, PB, IB, IB, IB, IB, IB, IB, IB, IB, IB, IB, IB, PB, CI, PB, IB, IB, IB, IB, IB, IB, IB },
/* GL */ { IB, PB, PB, IB, IB, IB, PB, PB, PB, IB, IB, IB, IB, IB, IB, IB, IB, IB, IB, IB, PB, CI, PB, IB, IB, IB, IB, IB, IB, IB },
/* NS */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
-/* EX */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
-/* SY */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
+/* EX */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, IB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
+/* SY */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, IB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* IS */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, IB, IB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* PR */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, IB, IB, IB, IB, DB, IB, IB, DB, DB, PB, CI, PB, IB, IB, IB, IB, IB, DB, DB },
/* PO */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, IB, IB, IB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* NU */ { IB, PB, PB, IB, IB, IB, PB, PB, PB, IB, IB, IB, IB, IB, DB, IB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* AL */ { IB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, IB, IB, IB, DB, IB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
-/* HL */ { IB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, IB, IB, IB, DB, IB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
+/* HL */ { IB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, IB, IB, IB, DB, IB, CI, CI, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* ID */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, IB, DB, DB, DB, DB, IB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* IN */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, IB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
-/* HY */ { DB, PB, PB, IB, DB, IB, PB, PB, PB, DB, DB, IB, DB, DB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
-/* BA */ { DB, PB, PB, IB, DB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, DB, IB, IB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
+/* HY */ { HH, PB, PB, IB, HH, IB, PB, PB, PB, HH, HH, IB, HH, HH, HH, HH, IB, IB, HH, HH, PB, CI, PB, HH, HH, HH, HH, HH, HH, DB },
+/* BA */ { HH, PB, PB, IB, HH, IB, PB, PB, PB, HH, HH, HH, HH, HH, HH, HH, IB, IB, HH, HH, PB, CI, PB, HH, HH, HH, HH, HH, HH, DB },
/* BB */ { IB, PB, PB, IB, IB, IB, PB, PB, PB, IB, IB, IB, IB, IB, IB, IB, IB, IB, IB, IB, PB, CI, PB, IB, IB, IB, IB, IB, IB, DB },
/* B2 */ { DB, PB, PB, IB, IB, IB, PB, PB, PB, DB, DB, DB, DB, DB, DB, DB, IB, IB, DB, PB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB },
/* ZW */ { DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, PB, DB, DB, DB, DB, DB, DB, DB, DB, DB },
@@ -464,6 +469,10 @@ static const uchar breakTable[QUnicodeTables::LineBreak_CB + 1][QUnicodeTables::
/* CB */ { DB, PB, PB, IB, IB, DB, PB, PB, PB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, DB, PB, CI, PB, DB, DB, DB, DB, DB, DB, DB }
};
+// The following line break classes are not treated by the pair table
+// and must be resolved outside:
+// AI, BK, CB, CJ, CR, LF, NL, SA, SG, SP, XX
+
} // namespace LB
static void getLineBreaks(const ushort *string, quint32 len, QCharAttributes *attributes)
@@ -555,6 +564,10 @@ static void getLineBreaks(const ushort *string, quint32 len, QCharAttributes *at
if (lcls != QUnicodeTables::LineBreak_SP)
goto next_no_cls_update;
break;
+ case LB::ProhibitedBreakAfterHebrewPlusHyphen:
+ if (lcls != QUnicodeTables::LineBreak_HL)
+ attributes[pos].lineBreak = true;
+ break;
case LB::ProhibitedBreak:
// nothing to do
default:
@@ -659,7 +672,7 @@ Q_CORE_EXPORT void initCharAttributes(const ushort *string, int length,
// ----------------------------------------------------------------------------
//
-// The Unicode script property. See http://www.unicode.org/reports/tr24/tr24-22.html
+// The Unicode script property. See http://www.unicode.org/reports/tr24/tr24-24.html
//
// ----------------------------------------------------------------------------
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 90b54b7297..bb15d66439 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -45,6 +45,7 @@
#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
#endif
+#include <iterator>
QT_BEGIN_NAMESPACE
@@ -174,6 +175,8 @@ public:
typedef T* iterator;
typedef const T* const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { return ptr; }
inline const_iterator begin() const { return ptr; }
@@ -183,6 +186,12 @@ public:
inline const_iterator end() const { return ptr + s; }
inline const_iterator cend() const { return ptr + s; }
inline const_iterator constEnd() const { return ptr + s; }
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
iterator insert(const_iterator before, int n, const T &x);
inline iterator insert(const_iterator before, const T &x) { return insert(before, 1, x); }
iterator erase(const_iterator begin, const_iterator end);
@@ -489,6 +498,36 @@ bool operator!=(const QVarLengthArray<T, Prealloc1> &l, const QVarLengthArray<T,
return !(l == r);
}
+template <typename T, int Prealloc1, int Prealloc2>
+bool operator<(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end())))
+{
+ return std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end());
+}
+
+template <typename T, int Prealloc1, int Prealloc2>
+inline bool operator>(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return rhs < lhs;
+}
+
+template <typename T, int Prealloc1, int Prealloc2>
+inline bool operator<=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return !(lhs > rhs);
+}
+
+template <typename T, int Prealloc1, int Prealloc2>
+inline bool operator>=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return !(lhs < rhs);
+}
+
QT_END_NAMESPACE
#endif // QVARLENGTHARRAY_H
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index a2d4c55f7a..2b7f9c5241 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -468,6 +468,20 @@
Typedef for T *. Provided for STL compatibility.
*/
+/*!
+ \typedef QVarLengthArray::const_reverse_iterator
+ \since 5.6
+
+ Typedef for \c{std::reverse_iterator<const T*>}. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::reverse_iterator
+ \since 5.6
+
+ Typedef for \c{std::reverse_iterator<T*>}. Provided for STL compatibility.
+*/
+
/*! \fn void QVarLengthArray::prepend(const T &value)
\since 4.8
@@ -582,6 +596,52 @@
\sa constBegin(), end()
*/
+/*! \fn QVarLengthArray::reverse_iterator QVarLengthArray::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the variable length array, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QVarLengthArray::const_reverse_iterator QVarLengthArray::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QVarLengthArray::const_reverse_iterator QVarLengthArray::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the variable length array, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QVarLengthArray::reverse_iterator QVarLengthArray::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last item in the variable length array, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QVarLengthArray::const_reverse_iterator QVarLengthArray::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QVarLengthArray::const_reverse_iterator QVarLengthArray::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last item in the variable length array, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*! \fn QVarLengthArray::iterator QVarLengthArray::erase(const_iterator pos)
\since 4.8
@@ -676,6 +736,54 @@
\sa operator==()
*/
+/*! \fn bool operator<(const QVarLengthArray<T,Prealloc1> &lhs, const QVarLengthArray<T,Prealloc2> &rhs)
+ \since 5.6
+ \relates QVarLengthArray
+
+ Returns \c true if variable length array \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator<=(const QVarLengthArray<T,Prealloc1> &lhs, const QVarLengthArray<T,Prealloc2> &rhs)
+ \since 5.6
+ \relates QVarLengthArray
+
+ Returns \c true if variable length array \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>(const QVarLengthArray<T,Prealloc1> &lhs, const QVarLengthArray<T,Prealloc2> &rhs)
+ \since 5.6
+ \relates QVarLengthArray
+
+ Returns \c true if variable length array \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>=(const QVarLengthArray<T,Prealloc1> &lhs, const QVarLengthArray<T,Prealloc2> &rhs)
+ \since 5.6
+ \relates QVarLengthArray
+
+ Returns \c true if variable length array \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
/*! \fn QVarLengthArray &QVarLengthArray::operator<<(const T &value)
\since 4.8
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index d10f82fbb4..f1cf23cc6a 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -45,34 +45,42 @@
stores its items in adjacent memory locations and provides fast
index-based access.
- QList\<T\>, QLinkedList\<T\>, and QVarLengthArray\<T\> provide
- similar functionality. Here's an overview:
+ QList\<T\>, QLinkedList\<T\>, QVector\<T\>, and QVarLengthArray\<T\>
+ provide similar APIs and functionality. They are often interchangeable,
+ but there are performance consequences. Here is an overview of use cases:
\list
- \li For most purposes, QList is the right class to use. Operations
- like prepend() and insert() are usually faster than with
- QVector because of the way QList stores its items in memory
- (see \l{Algorithmic Complexity} for details),
- and its index-based API is more convenient than QLinkedList's
- iterator-based API. It also expands to less code in your
- executable.
- \li If you need a real linked list, with guarantees of \l{constant
- time} insertions in the middle of the list and iterators to
- items rather than indexes, use QLinkedList.
- \li If you want the items to occupy adjacent memory positions, or
- if your items are larger than a pointer and you want to avoid
- the overhead of allocating them on the heap individually at
- insertion time, then use QVector.
- \li If you want a low-level variable-size array, QVarLengthArray
- may be sufficient.
+ \li QVector should be your default first choice.
+ QVector\<T\> will usually give better performance than QList\<T\>,
+ because QVector\<T\> always stores its items sequentially in memory,
+ where QList\<T\> will allocate its items on the heap unless
+ \c {sizeof(T) <= sizeof(void*)} and T has been declared to be
+ either a \c{Q_MOVABLE_TYPE} or a \c{Q_PRIMITIVE_TYPE} using
+ \l {Q_DECLARE_TYPEINFO}. See the \l {Pros and Cons of Using QList}
+ for an explanation.
+ \li However, QList is used throughout the Qt APIs for passing
+ parameters and for returning values. Use QList to interface with
+ those APIs.
+ \li If you need a real linked list, which guarantees
+ \l{Algorithmic Complexity}{constant time} insertions mid-list and
+ uses iterators to items rather than indexes, use QLinkedList.
\endlist
+ \note QVector and QVarLengthArray both guarantee C-compatible
+ array layout. QList does not. This might be important if your
+ application must interface with a C API.
+
+ \note Iterators into a QLinkedList and references into
+ heap-allocating QLists remain valid long as the referenced items
+ remain in the container. This is not true for iterators and
+ references into a QVector and non-heap-allocating QLists.
+
Here's an example of a QVector that stores integers and a QVector
that stores QString values:
\snippet code/src_corelib_tools_qvector.cpp 0
- QVector stores a vector (or array) of items. Typically, vectors
+ QVector stores its items in a vector (array). Typically, vectors
are created with an initial size. For example, the following code
constructs a QVector with 200 elements:
@@ -166,6 +174,11 @@
with references to its own values. Doing so will cause your application to
abort with an error message.
+ \section2 More Information on Using Qt Containers
+
+ For a detailed discussion comparing Qt containers with each other and
+ with STL containers, see \l {Understand the Qt Containers}.
+
\sa QVectorIterator, QMutableVectorIterator, QList, QLinkedList
*/
@@ -218,10 +231,11 @@
Constructs a copy of \a other.
- This operation takes \l{constant time}, because QVector is
- \l{implicitly shared}. This makes returning a QVector from a
- function very fast. If a shared instance is modified, it will be
- copied (copy-on-write), and that takes \l{linear time}.
+ This operation takes \l{Algorithmic Complexity}{constant time},
+ because QVector is \l{implicitly shared}. This makes returning
+ a QVector from a function very fast. If a shared instance is
+ modified, it will be copied (copy-on-write), and that takes
+ \l{Algorithmic Complexity}{linear time}.
\sa operator=()
*/
@@ -290,6 +304,65 @@
\sa operator==()
*/
+/*! \fn bool operator<(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator<=(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically less than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*! \fn bool operator>=(const QVector<T> &lhs, const QVector<T> &rhs)
+ \since 5.6
+ \relates QVector
+
+ Returns \c true if vector \a lhs is
+ \l{http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare}
+ {lexicographically greater than or equal to} \a rhs; otherwise returns \c false.
+
+ This function requires the value type to have an implementation
+ of \c operator<().
+*/
+
+/*!
+ \fn uint qHash(const QVector<T> &key, uint seed = 0)
+ \since 5.6
+ \relates QVector
+
+ Returns the hash value for \a key,
+ using \a seed to seed the calculation.
+
+ This function requires qHash() to be overloaded for the value type \c T.
+*/
+
/*! \fn int QVector::size() const
Returns the number of items in the vector.
@@ -311,6 +384,9 @@
initialized with a \l{default-constructed value}. If \a size is less
than the current size, elements are removed from the end.
+ Since Qt 5.6, resize() doesn't shrink the capacity anymore.
+ To shed excess capacity, use squeeze().
+
\sa size()
*/
@@ -330,15 +406,24 @@
/*! \fn void QVector::reserve(int size)
Attempts to allocate memory for at least \a size elements. If you
- know in advance how large the vector will be, you can call this
- function, and if you call resize() often you are likely to get
- better performance. If \a size is an underestimate, the worst
- that will happen is that the QVector will be a bit slower.
+ know in advance how large the vector will be, you should call this
+ function to prevent reallocations and memory fragmentation.
- The sole purpose of this function is to provide a means of fine
- tuning QVector's memory usage. In general, you will rarely ever
- need to call this function. If you want to change the size of the
- vector, call resize().
+ If \a size is an underestimate, the worst that will happen is that
+ the QVector will be a bit slower. If \a size is an overestimate, you
+ may have used more memory than the normal QVector growth strategy
+ would have allocated—or you may have used less.
+
+ An alternative to reserve() is calling resize(). Whether or not that is
+ faster than reserve() depends on the element type, because resize()
+ default-constructs all elements, and requires assignment to existing
+ entries rather than calling append(), which copy- or move-constructs.
+ For simple types, like \c int or \c double, resize() is typically faster,
+ but for anything more complex, you should prefer reserve().
+
+ \warning If the size passed to resize() was underestimated, you run out
+ of allocated space and into undefined behavior. This problem does not
+ exist with reserve(), because it treats the size as just a hint.
\sa squeeze(), capacity()
*/
@@ -463,6 +548,16 @@
\sa operator<<(), prepend(), insert()
*/
+/*!
+ \fn void QVector::append(T &&value)
+ \since 5.6
+
+ \overload
+
+ Example:
+ \snippet code/src_corelib_tools_qvector.cpp move-append
+*/
+
/*! \fn void QVector::append(const QVector<T> &value)
\overload
@@ -629,6 +724,16 @@
\sa takeFirst(), takeLast(), QList::takeAt()
*/
+/*! \fn void QVector::move(int from, int to)
+ \since 5.6
+
+ Moves the item at index position \a from to index position \a to.
+
+ Provided for compatibility with QList.
+
+ \sa QList::move()
+*/
+
/*! \fn void QVector::removeFirst()
\since 5.1
Removes the first item in the vector. Calling this function is
@@ -823,6 +928,52 @@
\sa constBegin(), end()
*/
+/*! \fn QVector::reverse_iterator QVector::rbegin()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the vector, in reverse order.
+
+ \sa begin(), crbegin(), rend()
+*/
+
+/*! \fn QVector::const_reverse_iterator QVector::rbegin() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QVector::const_reverse_iterator QVector::crbegin() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first
+ item in the vector, in reverse order.
+
+ \sa begin(), rbegin(), rend()
+*/
+
+/*! \fn QVector::reverse_iterator QVector::rend()
+ \since 5.6
+
+ Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past
+ the last item in the vector, in reverse order.
+
+ \sa end(), crend(), rbegin()
+*/
+
+/*! \fn QVector::const_reverse_iterator QVector::rend() const
+ \since 5.6
+ \overload
+*/
+
+/*! \fn QVector::const_reverse_iterator QVector::crend() const
+ \since 5.6
+
+ Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one
+ past the last item in the vector, in reverse order.
+
+ \sa end(), rend(), rbegin()
+*/
+
/*! \fn QVector::iterator QVector::erase(iterator pos)
Removes the item pointed to by the iterator \a pos from the
@@ -846,7 +997,7 @@
Returns a reference to the first item in the vector. This
function assumes that the vector isn't empty.
- \sa last(), isEmpty()
+ \sa last(), isEmpty(), constFirst()
*/
/*! \fn const T& QVector::first() const
@@ -854,12 +1005,21 @@
\overload
*/
+/*! \fn const T& QVector::constFirst() const
+ \since 5.6
+
+ Returns a const reference to the first item in the vector. This
+ function assumes that the vector isn't empty.
+
+ \sa constLast(), isEmpty(), first()
+*/
+
/*! \fn T& QVector::last()
Returns a reference to the last item in the vector. This function
assumes that the vector isn't empty.
- \sa first(), isEmpty()
+ \sa first(), isEmpty(), constLast()
*/
/*! \fn const T& QVector::last() const
@@ -867,6 +1027,15 @@
\overload
*/
+/*! \fn const T& QVector::constLast() const
+ \since 5.6
+
+ Returns a const reference to the last item in the vector. This function
+ assumes that the vector isn't empty.
+
+ \sa constFirst(), isEmpty(), last()
+*/
+
/*! \fn T QVector::value(int i) const
Returns the value at index position \a i in the vector.
@@ -893,6 +1062,11 @@
to append(\a value).
*/
+/*! \fn void QVector::push_back(T &&value)
+ \since 5.6
+ \overload
+*/
+
/*! \fn void QVector::push_front(const T &value)
This function is provided for STL compatibility. It is equivalent
@@ -1013,6 +1187,38 @@
\sa QVector::constBegin(), QVector::constEnd(), QVector::iterator, QVectorIterator
*/
+/*! \typedef QVector::reverse_iterator
+ \since 5.6
+
+ The QVector::reverse_iterator typedef provides an STL-style non-const
+ reverse iterator for QVector.
+
+ It is simply a typedef for \c{std::reverse_iterator<T*>}.
+
+ \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}.
+
+ \sa QVector::rbegin(), QVector::rend(), QVector::const_reverse_iterator, QVector::iterator
+*/
+
+/*! \typedef QVector::const_reverse_iterator
+ \since 5.6
+
+ The QVector::const_reverse_iterator typedef provides an STL-style const
+ reverse iterator for QVector.
+
+ It is simply a typedef for \c{std::reverse_iterator<const T*>}.
+
+ \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}.
+
+ \sa QVector::rbegin(), QVector::rend(), QVector::reverse_iterator, QVector::const_iterator
+*/
+
/*! \typedef QVector::Iterator
Qt-style synonym for QVector::iterator.
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index eed5d17cad..3ce33fb477 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -39,6 +39,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qrefcount.h>
#include <QtCore/qarraydata.h>
+#include <QtCore/qhashfunctions.h>
#include <iterator>
#include <vector>
@@ -68,11 +69,11 @@ public:
inline ~QVector() { if (!d->ref.deref()) freeData(d); }
QVector<T> &operator=(const QVector<T> &v);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QVector(QVector<T> &&other) : d(other.d) { other.d = Data::sharedNull(); }
- inline QVector<T> operator=(QVector<T> &&other)
- { qSwap(d, other.d); return *this; }
+ QVector(QVector<T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
+ QVector<T> &operator=(QVector<T> &&other) Q_DECL_NOTHROW
+ { QVector moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QVector<T> &other) { qSwap(d, other.d); }
+ void swap(QVector<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QVector(std::initializer_list<T> args);
#endif
@@ -128,6 +129,9 @@ public:
T &operator[](int i);
const T &operator[](int i) const;
void append(const T &t);
+#ifdef Q_COMPILER_RVALUE_REFS
+ void append(T &&t);
+#endif
inline void append(const QVector<T> &l) { *this += l; }
void prepend(const T &t);
void insert(int i, const T &t);
@@ -171,29 +175,50 @@ public:
}
int length() const { return size(); }
T takeAt(int i) { T t = at(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");
+ Q_ASSERT_X(to >= 0 && to < size(), "QVector::move(int,int)", "'to' is out-of-range");
+ if (from == to) // don't detach when no-op
+ return;
+ detach();
+ T * const b = d->begin();
+ if (from < to)
+ std::rotate(b + from, b + from + 1, b + to + 1);
+ else
+ std::rotate(b + to, b + from, b + from + 1);
+ }
// STL-style
typedef typename Data::iterator iterator;
typedef typename Data::const_iterator const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
#if !defined(QT_STRICT_ITERATORS) || defined(Q_QDOC)
inline iterator begin() { detach(); return d->begin(); }
- inline const_iterator begin() const { return d->constBegin(); }
- inline const_iterator cbegin() const { return d->constBegin(); }
- inline const_iterator constBegin() const { return d->constBegin(); }
+ inline const_iterator begin() const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator cbegin() const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator constBegin() const Q_DECL_NOTHROW { return d->constBegin(); }
inline iterator end() { detach(); return d->end(); }
- inline const_iterator end() const { return d->constEnd(); }
- inline const_iterator cend() const { return d->constEnd(); }
- inline const_iterator constEnd() const { return d->constEnd(); }
+ inline const_iterator end() const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator cend() const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator constEnd() const Q_DECL_NOTHROW { return d->constEnd(); }
#else
inline iterator begin(iterator = iterator()) { detach(); return d->begin(); }
- inline const_iterator begin(const_iterator = const_iterator()) const { return d->constBegin(); }
- inline const_iterator cbegin(const_iterator = const_iterator()) const { return d->constBegin(); }
- inline const_iterator constBegin(const_iterator = const_iterator()) const { return d->constBegin(); }
+ inline const_iterator begin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator cbegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator constBegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
inline iterator end(iterator = iterator()) { detach(); return d->end(); }
- inline const_iterator end(const_iterator = const_iterator()) const { return d->constEnd(); }
- inline const_iterator cend(const_iterator = const_iterator()) const { return d->constEnd(); }
- inline const_iterator constEnd(const_iterator = const_iterator()) const { return d->constEnd(); }
+ inline const_iterator end(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator cend(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator constEnd(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
#endif
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
iterator insert(iterator before, int n, const T &x);
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
iterator erase(iterator begin, iterator end);
@@ -203,8 +228,10 @@ public:
inline int count() const { return d->size; }
inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); }
inline const T &first() const { Q_ASSERT(!isEmpty()); return *begin(); }
+ inline const T &constFirst() const { Q_ASSERT(!isEmpty()); return *begin(); }
inline T& last() { Q_ASSERT(!isEmpty()); return *(end()-1); }
inline const T &last() const { Q_ASSERT(!isEmpty()); return *(end()-1); }
+ inline const T &constLast() const { Q_ASSERT(!isEmpty()); return *(end()-1); }
inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
QVector<T> mid(int pos, int len = -1) const;
@@ -223,6 +250,9 @@ public:
typedef const_iterator ConstIterator;
typedef int size_type;
inline void push_back(const T &t) { append(t); }
+#ifdef Q_COMPILER_RVALUE_REFS
+ void push_back(T &&t) { append(std::move(t)); }
+#endif
inline void push_front(const T &t) { prepend(t); }
void pop_back() { removeLast(); }
void pop_front() { removeFirst(); }
@@ -265,7 +295,6 @@ private:
{
return (i <= d->end()) && (d->begin() <= i);
}
- iterator c2m(const_iterator it) { return begin() + (it - cbegin()); }
class AlignmentDummy { Data header; T array[1]; };
};
@@ -377,9 +406,6 @@ void QVector<T>::resize(int asize)
if (asize > oldAlloc) { // there is not enough space
newAlloc = asize;
opt = QArrayData::Grow;
- } else if (!d->capacityReserved && asize < d->size && asize < (oldAlloc >> 1)) { // we want to shrink
- newAlloc = asize;
- opt = QArrayData::Grow;
} else {
newAlloc = oldAlloc;
}
@@ -602,14 +628,14 @@ void QVector<T>::append(const T &t)
{
const bool isTooSmall = uint(d->size + 1) > d->alloc;
if (!isDetached() || isTooSmall) {
- const T copy(t);
+ T copy(t);
QArrayData::AllocationOptions opt(isTooSmall ? QArrayData::Grow : QArrayData::Default);
reallocData(d->size, isTooSmall ? d->size + 1 : d->alloc, opt);
if (QTypeInfo<T>::isComplex)
- new (d->end()) T(copy);
+ new (d->end()) T(qMove(copy));
else
- *d->end() = copy;
+ *d->end() = qMove(copy);
} else {
if (QTypeInfo<T>::isComplex)
@@ -620,6 +646,22 @@ void QVector<T>::append(const T &t)
++d->size;
}
+#ifdef Q_COMPILER_RVALUE_REFS
+template <typename T>
+void QVector<T>::append(T &&t)
+{
+ const bool isTooSmall = uint(d->size + 1) > d->alloc;
+ if (!isDetached() || isTooSmall) {
+ QArrayData::AllocationOptions opt(isTooSmall ? QArrayData::Grow : QArrayData::Default);
+ reallocData(d->size, isTooSmall ? d->size + 1 : d->alloc, opt);
+ }
+
+ new (d->end()) T(std::move(t));
+
+ ++d->size;
+}
+#endif
+
template <typename T>
void QVector<T>::removeLast()
{
@@ -873,6 +915,43 @@ QList<T> QList<T>::fromVector(const QVector<T> &vector)
Q_DECLARE_SEQUENTIAL_ITERATOR(Vector)
Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(Vector)
+template <typename T>
+uint qHash(const QVector<T> &key, uint seed = 0)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
+{
+ return qHashRange(key.cbegin(), key.cend(), seed);
+}
+
+template <typename T>
+bool operator<(const QVector<T> &lhs, const QVector<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end())))
+{
+ return std::lexicographical_compare(lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end());
+}
+
+template <typename T>
+inline bool operator>(const QVector<T> &lhs, const QVector<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return rhs < lhs;
+}
+
+template <typename T>
+inline bool operator<=(const QVector<T> &lhs, const QVector<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return !(lhs > rhs);
+}
+
+template <typename T>
+inline bool operator>=(const QVector<T> &lhs, const QVector<T> &rhs)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+{
+ return !(lhs < rhs);
+}
+
/*
### Qt 5:
### This needs to be removed for next releases of Qt. It is a workaround for vc++ because
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp
index 660f40b107..f432820252 100644
--- a/src/corelib/tools/qversionnumber.cpp
+++ b/src/corelib/tools/qversionnumber.cpp
@@ -32,7 +32,7 @@
**
****************************************************************************/
-#include <QtCore/private/qversionnumber_p.h>
+#include <QtCore/qversionnumber.h>
#include <QtCore/qhash.h>
#include <QtCore/private/qlocale_tools_p.h>
#include <QtCore/qcollator.h>
@@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVersionNumber
\inmodule QtCore
- \internal
- \since 5.4
+ \since 5.6
\brief The QVersionNumber class contains a version number with an arbitrary
number of segments.
@@ -168,6 +167,17 @@ QT_BEGIN_NAMESPACE
\sa majorVersion(), minorVersion(), microVersion()
*/
+QVector<int> QVersionNumber::segments() const
+{
+ if (m_segments.isUsingPointer())
+ return *m_segments.pointer_segments;
+
+ QVector<int> result;
+ result.resize(segmentCount());
+ for (int i = 0; i < segmentCount(); ++i)
+ result[i] = segmentAt(i);
+ return result;
+}
/*!
\fn int QVersionNumber::segmentAt(int index) const
@@ -192,10 +202,21 @@ QT_BEGIN_NAMESPACE
Returns an equivalent version number but with all trailing zeros removed.
To check if two numbers are equivalent, use normalized() on both version
- numbers before perforing the compare.
+ numbers before performing the compare.
\snippet qversionnumber/main.cpp 4
*/
+QVersionNumber QVersionNumber::normalized() const
+{
+ int i;
+ for (i = m_segments.size(); i; --i)
+ if (m_segments.at(i - 1) != 0)
+ break;
+
+ QVersionNumber result(*this);
+ result.m_segments.resize(i);
+ return result;
+}
/*!
\fn bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const
@@ -209,8 +230,13 @@ QT_BEGIN_NAMESPACE
*/
bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW
{
- return m_segments.size() <= other.m_segments.size() &&
- std::equal(m_segments.begin(), m_segments.end(), other.m_segments.begin());
+ if (segmentCount() > other.segmentCount())
+ return false;
+ for (int i = 0; i < segmentCount(); ++i) {
+ if (segmentAt(i) != other.segmentAt(i))
+ return false;
+ }
+ return true;
}
/*!
@@ -228,30 +254,37 @@ bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHRO
*/
int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW
{
- QVector<int>::const_iterator i1 = v1.m_segments.constBegin();
- const QVector<int>::const_iterator e1 = v1.m_segments.constEnd();
- QVector<int>::const_iterator i2 = v2.m_segments.constBegin();
- const QVector<int>::const_iterator e2 = v2.m_segments.constEnd();
-
- while (i1 != e1 && i2 != e2) {
- if (*i1 != *i2)
- return (*i1 - *i2);
- ++i1;
- ++i2;
+ int commonlen;
+
+ if (Q_LIKELY(!v1.m_segments.isUsingPointer() && !v2.m_segments.isUsingPointer())) {
+ // we can't use memcmp because it interprets the data as unsigned bytes
+ const qint8 *ptr1 = v1.m_segments.inline_segments + InlineSegmentStartIdx;
+ const qint8 *ptr2 = v2.m_segments.inline_segments + InlineSegmentStartIdx;
+ commonlen = qMin(v1.m_segments.size(),
+ v2.m_segments.size());
+ for (int i = 0; i < commonlen; ++i)
+ if (int x = ptr1[i] - ptr2[i])
+ return x;
+ } else {
+ commonlen = qMin(v1.segmentCount(), v2.segmentCount());
+ for (int i = 0; i < commonlen; ++i) {
+ if (v1.segmentAt(i) != v2.segmentAt(i))
+ return v1.segmentAt(i) - v2.segmentAt(i);
+ }
}
// ran out of segments in v1 and/or v2 and need to check the first trailing
// segment to finish the compare
- if (i1 != e1) {
+ if (v1.segmentCount() > commonlen) {
// v1 is longer
- if (*i1 != 0)
- return *i1;
+ if (v1.segmentAt(commonlen) != 0)
+ return v1.segmentAt(commonlen);
else
return 1;
- } else if (i2 != e2) {
+ } else if (v2.segmentCount() > commonlen) {
// v2 is longer
- if (*i2 != 0)
- return -*i2;
+ if (v2.segmentAt(commonlen) != 0)
+ return -v2.segmentAt(commonlen);
else
return -1;
}
@@ -271,13 +304,20 @@ int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2)
QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1,
const QVersionNumber &v2)
{
- int min = qMin(v1.m_segments.size(), v2.m_segments.size());
- QVector<int>::const_iterator i1 = v1.m_segments.begin();
- QVector<int>::const_iterator e1;
- e1 = std::mismatch(i1,
- v1.m_segments.begin() + min,
- v2.m_segments.begin()).first;
- return QVersionNumber(v1.m_segments.mid(0, e1 - i1));
+ int commonlen = qMin(v1.segmentCount(), v2.segmentCount());
+ int i;
+ for (i = 0; i < commonlen; ++i) {
+ if (v1.segmentAt(i) != v2.segmentAt(i))
+ break;
+ }
+
+ if (i == 0)
+ return QVersionNumber();
+
+ // try to use the one with inline segments, if there's one
+ QVersionNumber result(!v1.m_segments.isUsingPointer() ? v1 : v2);
+ result.m_segments.resize(i);
+ return result;
}
/*!
@@ -348,12 +388,12 @@ QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1,
QString QVersionNumber::toString() const
{
QString version;
- version.reserve(qMax(m_segments.size() * 2 - 1, 0));
+ version.reserve(qMax(segmentCount() * 2 - 1, 0));
bool first = true;
- for (QVector<int>::const_iterator it = m_segments.begin(), end = m_segments.end(); it != end; ++it) {
+ for (int i = 0; i < segmentCount(); ++i) {
if (!first)
version += QLatin1Char('.');
- version += QString::number(*it);
+ version += QString::number(segmentAt(i));
first = false;
}
return version;
@@ -401,19 +441,17 @@ QVersionNumber QVersionNumber::fromString(const QString &string, int *suffixInde
return QVersionNumber(qMove(seg));
}
-/*!
- \fn QVersionNumber QVersionNumber::normalizedImpl(QVector<int> &segs)
-
- Implementation of the normalized() function. Takes the movable list \a segs
- and normalizes them.
-
- \internal
- */
-QVersionNumber QVersionNumber::normalizedImpl(QVector<int> &segs)
+void QVersionNumber::SegmentStorage::setVector(int len, int maj, int min, int mic)
{
- while (segs.size() && segs.last() == 0)
- segs.pop_back();
- return QVersionNumber(qMove(segs));
+ pointer_segments = new QVector<int>;
+ pointer_segments->resize(len);
+ pointer_segments->data()[0] = maj;
+ if (len > 1) {
+ pointer_segments->data()[1] = min;
+ if (len > 2) {
+ pointer_segments->data()[2] = mic;
+ }
+ }
}
#ifndef QT_NO_DATASTREAM
@@ -442,7 +480,9 @@ QDataStream& operator<<(QDataStream &out, const QVersionNumber &version)
*/
QDataStream& operator>>(QDataStream &in, QVersionNumber &version)
{
- in >> version.m_segments;
+ if (!version.m_segments.isUsingPointer())
+ version.m_segments.pointer_segments = new QVector<int>;
+ in >> *version.m_segments.pointer_segments;
return in;
}
#endif
@@ -459,14 +499,18 @@ QDebug operator<<(QDebug debug, const QVersionNumber &version)
/*!
\fn uint qHash(const QVersionNumber &key, uint seed)
\relates QHash
- \since 5.4
+ \since 5.6
Returns the hash value for the \a key, using \a seed to seed the
calculation.
*/
uint qHash(const QVersionNumber &key, uint seed)
{
- return qHashRange(key.m_segments.begin(), key.m_segments.end(), seed);
+ QtPrivate::QHashCombine hash;
+ for (int i = 0; i < key.segmentCount(); ++i)
+ seed = hash(seed, key.segmentAt(i));
+ return seed;
}
QT_END_NAMESPACE
+
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h
new file mode 100644
index 0000000000..ebf1844f38
--- /dev/null
+++ b/src/corelib/tools/qversionnumber.h
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2014 Keith Gardner <kreios4004@gmail.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module 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 QVERSIONNUMBER_H
+#define QVERSIONNUMBER_H
+
+#include <QtCore/qnamespace.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qmetatype.h>
+#include <QtCore/qtypeinfo.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVersionNumber;
+Q_CORE_EXPORT uint qHash(const QVersionNumber &key, uint seed = 0);
+
+#ifndef QT_NO_DATASTREAM
+Q_CORE_EXPORT QDataStream& operator<<(QDataStream &out, const QVersionNumber &version);
+Q_CORE_EXPORT QDataStream& operator>>(QDataStream &in, QVersionNumber &version);
+#endif
+
+class QVersionNumber
+{
+ /*
+ * QVersionNumber stores small values inline, without memory allocation.
+ * We do that by setting the LSB in the pointer that would otherwise hold
+ * the longer form of the segments.
+ * The constants below help us deal with the permutations for 32- and 64-bit,
+ * little- and big-endian architectures.
+ */
+ enum {
+ // in little-endian, inline_segments[0] is shared with the pointer's LSB, while
+ // in big-endian, it's inline_segments[7]
+ InlineSegmentMarker = Q_BYTE_ORDER == Q_LITTLE_ENDIAN ? 0 : sizeof(void*) - 1,
+ InlineSegmentStartIdx = !InlineSegmentMarker, // 0 for BE, 1 for LE
+ InlineSegmentCount = sizeof(void*) - 1
+ };
+ Q_STATIC_ASSERT(InlineSegmentCount >= 3); // at least major, minor, micro
+
+ struct SegmentStorage {
+ // Note: we alias the use of dummy and inline_segments in the use of the
+ // union below. This is undefined behavior in C++98, but most compilers implement
+ // the C++11 behavior. The one known exception is older versions of Sun Studio.
+ union {
+ quintptr dummy;
+ qint8 inline_segments[sizeof(void*)];
+ QVector<int> *pointer_segments;
+ };
+
+ // set the InlineSegmentMarker and set length to zero
+ SegmentStorage() Q_DECL_NOTHROW : dummy(1) {}
+
+ SegmentStorage(const QVector<int> &seg)
+ {
+ if (dataFitsInline(seg.begin(), seg.size()))
+ setInlineData(seg.begin(), seg.size());
+ else
+ pointer_segments = new QVector<int>(seg);
+ }
+
+ SegmentStorage(const SegmentStorage &other)
+ {
+ if (other.isUsingPointer())
+ pointer_segments = new QVector<int>(*other.pointer_segments);
+ else
+ dummy = other.dummy;
+ }
+
+ SegmentStorage &operator=(const SegmentStorage &other)
+ {
+ if (isUsingPointer() && other.isUsingPointer()) {
+ *pointer_segments = *other.pointer_segments;
+ } else if (other.isUsingPointer()) {
+ pointer_segments = new QVector<int>(*other.pointer_segments);
+ } else {
+ if (isUsingPointer())
+ delete pointer_segments;
+ dummy = other.dummy;
+ }
+ return *this;
+ }
+
+#ifdef Q_COMPILER_RVALUE_REFS
+ SegmentStorage(SegmentStorage &&other) Q_DECL_NOTHROW
+ : dummy(other.dummy)
+ {
+ other.dummy = 1;
+ }
+
+ SegmentStorage &operator=(SegmentStorage &&other) Q_DECL_NOTHROW
+ {
+ qSwap(dummy, other.dummy);
+ return *this;
+ }
+
+ explicit SegmentStorage(QVector<int> &&seg)
+ {
+ if (dataFitsInline(seg.begin(), seg.size()))
+ setInlineData(seg.begin(), seg.size());
+ else
+ pointer_segments = new QVector<int>(std::move(seg));
+ }
+#endif
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+ SegmentStorage(std::initializer_list<int> args)
+ {
+ if (dataFitsInline(args.begin(), int(args.size()))) {
+ setInlineData(args.begin(), int(args.size()));
+ } else {
+ pointer_segments = new QVector<int>(args);
+ }
+ }
+#endif
+
+ ~SegmentStorage() { if (isUsingPointer()) delete pointer_segments; }
+
+ bool isUsingPointer() const Q_DECL_NOTHROW
+ { return (inline_segments[InlineSegmentMarker] & 1) == 0; }
+
+ int size() const Q_DECL_NOTHROW
+ { return isUsingPointer() ? pointer_segments->size() : (inline_segments[InlineSegmentMarker] >> 1); }
+
+ void setInlineSize(int len)
+ { inline_segments[InlineSegmentMarker] = 1 + 2 * len; }
+
+ void resize(int len)
+ {
+ if (isUsingPointer())
+ pointer_segments->resize(len);
+ else
+ setInlineSize(len);
+ }
+
+ int at(int index) const
+ {
+ return isUsingPointer() ?
+ pointer_segments->at(index) :
+ inline_segments[InlineSegmentStartIdx + index];
+ }
+
+ void setSegments(int len, int maj, int min = 0, int mic = 0)
+ {
+ if (maj == qint8(maj) && min == qint8(min) && mic == qint8(mic)) {
+ int data[] = { maj, min, mic };
+ setInlineData(data, len);
+ } else {
+ setVector(len, maj, min, mic);
+ }
+ }
+
+ private:
+ static bool dataFitsInline(const int *data, int len)
+ {
+ if (len > InlineSegmentCount)
+ return false;
+ for (int i = 0; i < len; ++i)
+ if (data[i] != qint8(data[i]))
+ return false;
+ return true;
+ }
+ void setInlineData(const int *data, int len)
+ {
+ dummy = 1 + len * 2;
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ for (int i = 0; i < len; ++i)
+ dummy |= quintptr(data[i] & 0xFF) << (8 * (i + 1));
+#elif Q_BYTE_ORDER == Q_BIG_ENDIAN
+ for (int i = 0; i < len; ++i)
+ dummy |= quintptr(data[i] & 0xFF) << (8 * (sizeof(void *) - i - 1));
+#else
+ // the code above is equivalent to:
+ setInlineSize(len);
+ for (int i = 0; i < len; ++i)
+ inline_segments[InlineSegmentStartIdx + i] = data[i] & 0xFF;
+#endif
+ }
+
+ Q_CORE_EXPORT void setVector(int len, int maj, int min, int mic);
+ } m_segments;
+
+public:
+ inline QVersionNumber() Q_DECL_NOTHROW
+ : m_segments()
+ {}
+ inline explicit QVersionNumber(const QVector<int> &seg)
+ : m_segments(seg)
+ {}
+
+ // compiler-generated copy/move ctor/assignment operators and the destructor are ok
+
+#ifdef Q_COMPILER_RVALUE_REFS
+ explicit QVersionNumber(QVector<int> &&seg)
+ : m_segments(std::move(seg))
+ {}
+#endif
+
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+ inline QVersionNumber(std::initializer_list<int> args)
+ : m_segments(args)
+ {}
+#endif
+
+ inline explicit QVersionNumber(int maj)
+ { m_segments.setSegments(1, maj); }
+
+ inline explicit QVersionNumber(int maj, int min)
+ { m_segments.setSegments(2, maj, min); }
+
+ inline explicit QVersionNumber(int maj, int min, int mic)
+ { m_segments.setSegments(3, maj, min, mic); }
+
+ inline bool isNull() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return segmentCount() == 0; }
+
+ inline bool isNormalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return isNull() || segmentAt(segmentCount() - 1) != 0; }
+
+ inline int majorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return segmentAt(0); }
+
+ inline int minorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return segmentAt(1); }
+
+ inline int microVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return segmentAt(2); }
+
+ Q_CORE_EXPORT QVersionNumber normalized() const Q_REQUIRED_RESULT;
+
+ Q_CORE_EXPORT QVector<int> segments() const Q_REQUIRED_RESULT;
+
+ inline int segmentAt(int index) const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return (m_segments.size() > index) ? m_segments.at(index) : 0; }
+
+ inline int segmentCount() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
+ { return m_segments.size(); }
+
+ Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
+
+ Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW Q_REQUIRED_RESULT;
+
+ Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2) Q_REQUIRED_RESULT;
+
+ Q_CORE_EXPORT QString toString() const Q_REQUIRED_RESULT;
+ Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = 0) Q_REQUIRED_RESULT;
+
+private:
+#ifndef QT_NO_DATASTREAM
+ friend Q_CORE_EXPORT QDataStream& operator>>(QDataStream &in, QVersionNumber &version);
+#endif
+ friend Q_CORE_EXPORT uint qHash(const QVersionNumber &key, uint seed);
+};
+
+Q_DECLARE_TYPEINFO(QVersionNumber, Q_MOVABLE_TYPE);
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_CORE_EXPORT QDebug operator<<(QDebug, const QVersionNumber &version);
+#endif
+
+Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+{ return QVersionNumber::compare(lhs, rhs) > 0; }
+
+Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+{ return QVersionNumber::compare(lhs, rhs) >= 0; }
+
+Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+{ return QVersionNumber::compare(lhs, rhs) < 0; }
+
+Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+{ return QVersionNumber::compare(lhs, rhs) <= 0; }
+
+Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+{ return QVersionNumber::compare(lhs, rhs) == 0; }
+
+Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+{ return QVersionNumber::compare(lhs, rhs) != 0; }
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QVersionNumber)
+
+#endif //QVERSIONNUMBER_H
diff --git a/src/corelib/tools/qversionnumber_p.h b/src/corelib/tools/qversionnumber_p.h
deleted file mode 100644
index 2da3103be3..0000000000
--- a/src/corelib/tools/qversionnumber_p.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2014 Keith Gardner <kreios4004@gmail.com>
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtCore module 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 QVERSIONNUMBER_H
-#define QVERSIONNUMBER_H
-
-#include <QtCore/qnamespace.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qvector.h>
-#include <QtCore/qmetatype.h>
-#include <QtCore/qtypeinfo.h>
-
-QT_BEGIN_NAMESPACE
-
-class QVersionNumber;
-Q_CORE_EXPORT uint qHash(const QVersionNumber &key, uint seed = 0);
-
-#ifndef QT_NO_DATASTREAM
-Q_CORE_EXPORT QDataStream& operator<<(QDataStream &out, const QVersionNumber &version);
-Q_CORE_EXPORT QDataStream& operator>>(QDataStream &in, QVersionNumber &version);
-#endif
-
-class QVersionNumber
-{
-public:
- inline QVersionNumber() Q_DECL_NOTHROW
- : m_segments()
- {}
- // compiler-generated copy/move ctor/assignment operators are ok
-
- inline explicit QVersionNumber(const QVector<int> &seg) Q_DECL_NOTHROW
- : m_segments(seg)
- {}
-#ifdef Q_COMPILER_RVALUE_REFS
- inline explicit QVersionNumber(QVector<int> &&seg) Q_DECL_NOTHROW
- : m_segments(qMove(seg))
- {}
-#endif
-#ifdef Q_COMPILER_INITIALIZER_LISTS
- inline QVersionNumber(std::initializer_list<int> args)
- : m_segments(args)
- {}
-#endif
-
- inline explicit QVersionNumber(int maj)
- { m_segments.reserve(1); m_segments << maj; }
-
- inline explicit QVersionNumber(int maj, int min)
- { m_segments.reserve(2); m_segments << maj << min; }
-
- inline explicit QVersionNumber(int maj, int min, int mic)
- { m_segments.reserve(3); m_segments << maj << min << mic; }
-
- inline bool isNull() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return m_segments.isEmpty(); }
-
- inline bool isNormalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return isNull() || m_segments.last() != 0; }
-
- inline int majorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return segmentAt(0); }
-
- inline int minorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return segmentAt(1); }
-
- inline int microVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return segmentAt(2); }
-
-#if defined(Q_COMPILER_REF_QUALIFIERS)
-# if defined(Q_CC_GNU)
- // required due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941
-# pragma push_macro("Q_REQUIRED_RESULT")
-# undef Q_REQUIRED_RESULT
-# define Q_REQUIRED_RESULT
-# define Q_REQUIRED_RESULT_pushed
-# endif
- inline QVersionNumber normalized() const & Q_REQUIRED_RESULT
- {
- QVector<int> segs(m_segments);
- return normalizedImpl(segs);
- }
-
- inline QVersionNumber normalized() && Q_REQUIRED_RESULT
- {
- return normalizedImpl(m_segments);
- }
-
- inline QVector<int> segments() const & Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return m_segments; }
-
- inline QVector<int> segments() && Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return qMove(m_segments); }
-
-# ifdef Q_REQUIRED_RESULT_pushed
-# pragma pop_macro("Q_REQUIRED_RESULT")
-# endif
-#else
- inline QVersionNumber normalized() const Q_REQUIRED_RESULT
- {
- QVector<int> segs(m_segments);
- return normalizedImpl(segs);
- }
-
- inline QVector<int> segments() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return m_segments; }
-#endif
-
- inline int segmentAt(int index) const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return (m_segments.size() > index) ? m_segments.at(index) : 0; }
-
- inline int segmentCount() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
- { return m_segments.size(); }
-
- Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
-
- Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW Q_REQUIRED_RESULT;
-
- Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2) Q_REQUIRED_RESULT;
-
- Q_CORE_EXPORT QString toString() const Q_REQUIRED_RESULT;
- Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = 0) Q_REQUIRED_RESULT;
-
-private:
- Q_CORE_EXPORT static QVersionNumber normalizedImpl(QVector<int> &segs) Q_REQUIRED_RESULT;
-
-#ifndef QT_NO_DATASTREAM
- friend Q_CORE_EXPORT QDataStream& operator>>(QDataStream &in, QVersionNumber &version);
-#endif
- friend Q_CORE_EXPORT uint qHash(const QVersionNumber &key, uint seed);
-
- QVector<int> m_segments;
-};
-
-Q_DECLARE_TYPEINFO(QVersionNumber, Q_MOVABLE_TYPE);
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_CORE_EXPORT QDebug operator<<(QDebug, const QVersionNumber &version);
-#endif
-
-Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
-{ return QVersionNumber::compare(lhs, rhs) > 0; }
-
-Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
-{ return QVersionNumber::compare(lhs, rhs) >= 0; }
-
-Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
-{ return QVersionNumber::compare(lhs, rhs) < 0; }
-
-Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
-{ return QVersionNumber::compare(lhs, rhs) <= 0; }
-
-Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
-{ return QVersionNumber::compare(lhs, rhs) == 0; }
-
-Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
-{ return QVersionNumber::compare(lhs, rhs) != 0; }
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QVersionNumber)
-
-#endif //QVERSIONNUMBER_H
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 5de0c09a4d..ed07f70e87 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -9,6 +9,7 @@ HEADERS += \
tools/qarraydatapointer.h \
tools/qbitarray.h \
tools/qbytearray.h \
+ tools/qbytearray_p.h \
tools/qbytearraylist.h \
tools/qbytearraymatcher.h \
tools/qbytedata_p.h \
@@ -26,6 +27,7 @@ HEADERS += \
tools/qeasingcurve.h \
tools/qfreelist_p.h \
tools/qhash.h \
+ tools/qhashfunctions.h \
tools/qiterator.h \
tools/qline.h \
tools/qlinkedlist.h \
@@ -73,7 +75,7 @@ HEADERS += \
tools/qunicodetools_p.h \
tools/qvarlengtharray.h \
tools/qvector.h \
- tools/qversionnumber_p.h
+ tools/qversionnumber.h
SOURCES += \
@@ -105,6 +107,7 @@ SOURCES += \
tools/qrect.cpp \
tools/qregexp.cpp \
tools/qrefcount.cpp \
+ tools/qringbuffer.cpp \
tools/qshareddata.cpp \
tools/qsharedpointer.cpp \
tools/qsimd.cpp \
@@ -152,10 +155,6 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, zlib) {
include($$PWD/../../3rdparty/zlib.pri)
- corelib_zlib_headers.files = $$PWD/../../3rdparty/zlib/zconf.h\
- $$PWD/../../3rdparty/zlib/zlib.h
- corelib_zlib_headers.path = $$[QT_INSTALL_HEADERS]/QtZlib
- INSTALLS += corelib_zlib_headers
} else {
include($$PWD/../../3rdparty/zlib_dependency.pri)
}
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 13c84db9ae..64a130e45a 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -2622,6 +2622,13 @@ QXmlStreamEntityDeclaration::~QXmlStreamEntityDeclaration()
{
}
+/*! \fn QXmlStreamStringRef::swap(QXmlStreamStringRef &other)
+ \since 5.6
+
+ Swaps this string reference's contents with \a other.
+ This function is very fast and never fails.
+*/
+
/*! \fn QStringRef QXmlStreamEntityDeclaration::name() const
Returns the entity name.
@@ -3013,7 +3020,8 @@ void QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec()
#ifndef QT_NO_TEXTCODEC
Q_ASSERT(encoder);
// assumes ASCII-compatibility for all 8-bit encodings
- const QByteArray bytes = encoder->fromUnicode(QStringLiteral(" "));
+ QChar space = QLatin1Char(' ');
+ const QByteArray bytes = encoder->fromUnicode(&space, 1);
isCodecASCIICompatible = (bytes.count() == 1);
#else
isCodecASCIICompatible = true;
diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h
index 21188bc5e0..34f26cb953 100644
--- a/src/corelib/xml/qxmlstream.h
+++ b/src/corelib/xml/qxmlstream.h
@@ -53,13 +53,37 @@ public:
inline QXmlStreamStringRef(const QStringRef &aString)
:m_string(aString.string()?*aString.string():QString()), m_position(aString.position()), m_size(aString.size()){}
inline QXmlStreamStringRef(const QString &aString):m_string(aString), m_position(0), m_size(aString.size()){}
- inline ~QXmlStreamStringRef(){}
+
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ QXmlStreamStringRef(const QXmlStreamStringRef &other) // = default
+ : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ QXmlStreamStringRef(QXmlStreamStringRef &&other) Q_DECL_NOTHROW // = default
+ : m_string(std::move(other.m_string)), m_position(other.m_position), m_size(other.m_size) {}
+ QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) Q_DECL_NOTHROW // = default
+ { swap(other); return *this; }
+#endif
+ QXmlStreamStringRef &operator=(const QXmlStreamStringRef &other) // = default
+ { m_string = other.m_string; m_position = other.m_position; m_size = other.m_size; return *this; }
+ inline ~QXmlStreamStringRef() {} // ### this prevents (or deprecates) all the move/copy special member functions,
+ // ### that's why we need to provide them by hand above. We can't remove it in
+ // ### Qt 5, since that would change the way its passed to functions. In Qt 6, remove all.
+#endif // Qt < 6.0
+
+ void swap(QXmlStreamStringRef &other) Q_DECL_NOTHROW
+ {
+ qSwap(m_string, other.m_string);
+ qSwap(m_position, other.m_position);
+ qSwap(m_size, other.m_size);
+ }
+
inline void clear() { m_string.clear(); m_position = m_size = 0; }
inline operator QStringRef() const { return QStringRef(&m_string, m_position, m_size); }
inline const QString *string() const { return &m_string; }
inline int position() const { return m_position; }
inline int size() const { return m_size; }
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QXmlStreamStringRef)
class QXmlStreamReaderPrivate;
@@ -75,6 +99,28 @@ public:
QXmlStreamAttribute(const QString &qualifiedName, const QString &value);
QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value);
QXmlStreamAttribute(const QXmlStreamAttribute &);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QXmlStreamAttribute(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
+ : m_name(std::move(other.m_name)),
+ m_namespaceUri(std::move(other.m_namespaceUri)),
+ m_qualifiedName(std::move(other.m_qualifiedName)),
+ m_value(std::move(other.m_value)),
+ reserved(other.reserved),
+ m_isDefault(other.m_isDefault)
+ {
+ other.reserved = Q_NULLPTR;
+ }
+ QXmlStreamAttribute &operator=(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
+ {
+ m_name = std::move(other.m_name);
+ m_namespaceUri = std::move(other.m_namespaceUri);
+ m_qualifiedName = std::move(other.m_qualifiedName);
+ m_value = std::move(other.m_value);
+ qSwap(reserved, other.reserved);
+ m_isDefault = other.m_isDefault;
+ return *this;
+ }
+#endif
QXmlStreamAttribute& operator=(const QXmlStreamAttribute &);
~QXmlStreamAttribute();
inline QStringRef namespaceUri() const { return m_namespaceUri; }
diff --git a/src/dbus/dbus_minimal_p.h b/src/dbus/dbus_minimal_p.h
index 7ebd82dbf8..f0a29540c8 100644
--- a/src/dbus/dbus_minimal_p.h
+++ b/src/dbus/dbus_minimal_p.h
@@ -34,6 +34,17 @@
#ifndef DBUS_MINIMAL_P_H
#define DBUS_MINIMAL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
extern "C" {
// Equivalent to dbus-arch-deps.h
diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf
index ff46cc5961..fc8921ff35 100644
--- a/src/dbus/doc/qtdbus.qdocconf
+++ b/src/dbus/doc/qtdbus.qdocconf
@@ -19,7 +19,7 @@ sourcedirs += .. \
../../../examples/dbus/doc/src
excludedirs += ../../../examples/widgets/doc
-examplesinstallpath = dbus
+examplesinstallpath = qtbase/dbus
depends += qtdoc qtcore
diff --git a/src/dbus/doc/src/qtdbus-module.qdoc b/src/dbus/doc/src/qtdbus-module.qdoc
index 498da43d7a..87d35386c8 100644
--- a/src/dbus/doc/src/qtdbus-module.qdoc
+++ b/src/dbus/doc/src/qtdbus-module.qdoc
@@ -34,7 +34,7 @@
\ingroup modules
\qtvariable dbus
- \target The QDBus compiler
+ \keyword The QDBus compiler
Applications using the Qt D-Bus module can provide services to
diff --git a/src/dbus/qdbus_symbols.cpp b/src/dbus/qdbus_symbols.cpp
index b82d92b561..395a436869 100644
--- a/src/dbus/qdbus_symbols.cpp
+++ b/src/dbus/qdbus_symbols.cpp
@@ -48,7 +48,7 @@ void (*qdbus_resolve_me(const char *name))();
#if !defined QT_LINKED_LIBDBUS
-#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_LIBRARY
static QLibrary *qdbus_libdbus = 0;
void qdbus_unloadLibDBus()
@@ -65,7 +65,7 @@ void qdbus_unloadLibDBus()
bool qdbus_loadLibDBus()
{
-#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_LIBRARY
#ifdef QT_BUILD_INTERNAL
// this is to simulate a library load failure for our autotest suite.
if (!qEnvironmentVariableIsEmpty("QT_SIMULATE_DBUS_LIBFAIL"))
@@ -118,7 +118,7 @@ bool qdbus_loadLibDBus()
#endif
}
-#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_LIBRARY
void (*qdbus_resolve_conditionally(const char *name))()
{
if (qdbus_loadLibDBus())
@@ -129,7 +129,7 @@ void (*qdbus_resolve_conditionally(const char *name))()
void (*qdbus_resolve_me(const char *name))()
{
-#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_LIBRARY
if (!qdbus_loadLibDBus())
qFatal("Cannot find libdbus-1 in your system to resolve symbol '%s'.", name);
@@ -144,7 +144,7 @@ void (*qdbus_resolve_me(const char *name))()
#endif
}
-#else // QT_LINKED_LIBDBUS
+#else
static void qdbus_unloadLibDBus()
{
if (qEnvironmentVariableIsSet("QDBUS_FORCE_SHUTDOWN"))
@@ -153,7 +153,7 @@ static void qdbus_unloadLibDBus()
#endif // !QT_LINKED_LIBDBUS
-#ifndef QT_BOOTSTRAPPED
+#if defined(QT_LINKED_LIBDBUS) || !defined(QT_NO_LIBRARY)
Q_DESTRUCTOR_FUNCTION(qdbus_unloadLibDBus)
#endif
diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h
index 32b76ee5bd..1991a462e9 100644
--- a/src/dbus/qdbus_symbols_p.h
+++ b/src/dbus/qdbus_symbols_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -205,11 +206,6 @@ DEFINEFUNC(dbus_bool_t , dbus_connection_send_with_reply, (DBusConnection
DBusPendingCall **pending_return,
int timeout_milliseconds),
(connection, message, pending_return, timeout_milliseconds), return)
-DEFINEFUNC(DBusMessage * , dbus_connection_send_with_reply_and_block, (DBusConnection *connection,
- DBusMessage *message,
- int timeout_milliseconds,
- DBusError *error),
- (connection, message, timeout_milliseconds, error), return)
DEFINEFUNC(void , dbus_connection_set_exit_on_disconnect, (DBusConnection *connection,
dbus_bool_t exit_on_disconnect),
(connection, exit_on_disconnect), )
diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp
index e7529f794e..2864e076e9 100644
--- a/src/dbus/qdbusabstractadaptor.cpp
+++ b/src/dbus/qdbusabstractadaptor.cpp
@@ -317,7 +317,9 @@ void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **
}
QVariantList args;
- for (int i = 1; i < types.count(); ++i)
+ const int numTypes = types.count();
+ args.reserve(numTypes - 1);
+ for (int i = 1; i < numTypes; ++i)
args << QVariant(types.at(i), argv[i]);
// now emit the signal with all the information
diff --git a/src/dbus/qdbusabstractadaptor_p.h b/src/dbus/qdbusabstractadaptor_p.h
index 9e9375cefc..5ff33f8bef 100644
--- a/src/dbus/qdbusabstractadaptor_p.h
+++ b/src/dbus/qdbusabstractadaptor_p.h
@@ -50,7 +50,6 @@
#include <QtCore/qobject.h>
#include <QtCore/qmap.h>
-#include <QtCore/qhash.h>
#include <QtCore/qreadwritelock.h>
#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
@@ -127,6 +126,7 @@ public: // member variables
private:
static int relaySlotMethodIndex();
};
+Q_DECLARE_TYPEINFO(QDBusAdaptorConnector::AdaptorData, Q_PRIMITIVE_TYPE);
extern QDBusAdaptorConnector *qDBusFindAdaptorConnector(QObject *object);
extern QDBusAdaptorConnector *qDBusCreateAdaptorConnector(QObject *object);
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp
index a7c70bce70..d63a317612 100644
--- a/src/dbus/qdbusabstractinterface.cpp
+++ b/src/dbus/qdbusabstractinterface.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -34,6 +35,7 @@
#include "qdbusabstractinterface.h"
#include "qdbusabstractinterface_p.h"
+#include <qcoreapplication.h>
#include <qthread.h>
#include "qdbusargument.h"
@@ -41,6 +43,7 @@
#include "qdbusmessage_p.h"
#include "qdbusmetaobject_p.h"
#include "qdbusmetatype_p.h"
+#include "qdbusservicewatcher.h"
#include "qdbusutil_p.h"
#include <qdebug.h>
@@ -49,6 +52,29 @@
QT_BEGIN_NAMESPACE
+namespace {
+// ### Qt6: change to a regular QEvent (customEvent)
+// We need to use a QMetaCallEvent here because we can't override customEvent() in
+// Qt 5. Since QDBusAbstractInterface is meant to be derived from, the vtables of
+// classes in generated code will have a pointer to QObject::customEvent instead
+// of to QDBusAbstractInterface::customEvent.
+// See solution in Patch Set 1 of this change in the Qt Gerrit servers.
+// (https://codereview.qt-project.org/#/c/126384/1)
+class DisconnectRelayEvent : public QMetaCallEvent
+{
+public:
+ DisconnectRelayEvent(QObject *sender, const QMetaMethod &m)
+ : QMetaCallEvent(0, 0, Q_NULLPTR, sender, m.methodIndex())
+ {}
+
+ void placeMetaCall(QObject *object) Q_DECL_OVERRIDE
+ {
+ QDBusAbstractInterface *iface = static_cast<QDBusAbstractInterface *>(object);
+ QDBusAbstractInterfacePrivate::finishDisconnectNotify(iface, signalId());
+ }
+};
+}
+
static QDBusError checkIfValid(const QString &service, const QString &path,
const QString &interface, bool isDynamic, bool isPeer)
{
@@ -97,6 +123,15 @@ QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(const QString &serv
}
}
+void QDBusAbstractInterfacePrivate::initOwnerTracking()
+{
+ if (!isValid || !connection.isConnected() || !connectionPrivate()->shouldWatchService(service))
+ return;
+ QObject::connect(new QDBusServiceWatcher(service, connection, QDBusServiceWatcher::WatchForOwnerChange, q_func()),
+ SIGNAL(serviceOwnerChanged(QString,QString,QString)),
+ q_func(), SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
+}
+
bool QDBusAbstractInterfacePrivate::canMakeCalls() const
{
// recheck only if we have a wildcard (i.e. empty) service or path
@@ -218,9 +253,8 @@ void QDBusAbstractInterfacePrivate::_q_serviceOwnerChanged(const QString &name,
Q_UNUSED(oldOwner);
Q_UNUSED(name);
//qDebug() << "QDBusAbstractInterfacePrivate serviceOwnerChanged" << name << oldOwner << newOwner;
- if (name == service) {
- currentOwner = newOwner;
- }
+ Q_ASSERT(name == service);
+ currentOwner = newOwner;
}
QDBusAbstractInterfaceBase::QDBusAbstractInterfaceBase(QDBusAbstractInterfacePrivate &d, QObject *parent)
@@ -285,19 +319,7 @@ int QDBusAbstractInterfaceBase::qt_metacall(QMetaObject::Call _c, int _id, void
QDBusAbstractInterface::QDBusAbstractInterface(QDBusAbstractInterfacePrivate &d, QObject *parent)
: QDBusAbstractInterfaceBase(d, parent)
{
- // keep track of the service owner
- if (d.isValid &&
- d.connection.isConnected()
- && !d.service.isEmpty()
- && !d.service.startsWith(QLatin1Char(':'))
- && d.connectionPrivate()->mode != QDBusConnectionPrivate::PeerMode)
- d_func()->connection.connect(QDBusUtil::dbusService(), // service
- QString(), // path
- QDBusUtil::dbusInterface(), // interface
- QDBusUtil::nameOwnerChanged(),
- QStringList() << d.service,
- QString(), // signature
- this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
+ d.initOwnerTracking();
}
/*!
@@ -312,18 +334,7 @@ QDBusAbstractInterface::QDBusAbstractInterface(const QString &service, const QSt
con, false), parent)
{
// keep track of the service owner
- if (d_func()->isValid &&
- d_func()->connection.isConnected()
- && !service.isEmpty()
- && !service.startsWith(QLatin1Char(':'))
- && d_func()->connectionPrivate()->mode != QDBusConnectionPrivate::PeerMode)
- d_func()->connection.connect(QDBusUtil::dbusService(), // service
- QString(), // path
- QDBusUtil::dbusInterface(), // interface
- QDBusUtil::nameOwnerChanged(),
- QStringList() << service,
- QString(), //signature
- this, SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
+ d_func()->initOwnerTracking();
}
/*!
@@ -617,22 +628,38 @@ void QDBusAbstractInterface::disconnectNotify(const QMetaMethod &signal)
if (!d->isValid)
return;
+ // disconnection is just resource freeing, so it can be delayed;
+ // let's do that later, after all the QObject mutexes have been unlocked.
+ QCoreApplication::postEvent(this, new DisconnectRelayEvent(this, signal));
+}
+
+/*!
+ \internal
+ Continues the disconnect notification from above.
+*/
+void QDBusAbstractInterfacePrivate::finishDisconnectNotify(QDBusAbstractInterface *ptr, int signalId)
+{
+ QDBusAbstractInterfacePrivate *d = ptr->d_func();
QDBusConnectionPrivate *conn = d->connectionPrivate();
- if (conn && signal.isValid() && !isSignalConnected(signal))
- return conn->disconnectRelay(d->service, d->path, d->interface,
- this, signal);
if (!conn)
return;
- // wildcard disconnecting, we need to figure out which of our signals are
- // no longer connected to anything
- const QMetaObject *mo = metaObject();
- int midx = QObject::staticMetaObject.methodCount();
- const int end = mo->methodCount();
- for ( ; midx < end; ++midx) {
- QMetaMethod mm = mo->method(midx);
- if (mm.methodType() == QMetaMethod::Signal && !isSignalConnected(mm))
- conn->disconnectRelay(d->service, d->path, d->interface, this, mm);
+ const QMetaObject *mo = ptr->metaObject();
+ QMetaMethod signal = signalId >= 0 ? mo->method(signalId) : QMetaMethod();
+ if (signal.isValid()) {
+ if (!ptr->isSignalConnected(signal))
+ return conn->disconnectRelay(d->service, d->path, d->interface,
+ ptr, signal);
+ } else {
+ // wildcard disconnecting, we need to figure out which of our signals are
+ // no longer connected to anything
+ int midx = QObject::staticMetaObject.methodCount();
+ const int end = mo->methodCount();
+ for ( ; midx < end; ++midx) {
+ QMetaMethod mm = mo->method(midx);
+ if (mm.methodType() == QMetaMethod::Signal && !ptr->isSignalConnected(mm))
+ conn->disconnectRelay(d->service, d->path, d->interface, ptr, mm);
+ }
}
}
diff --git a/src/dbus/qdbusabstractinterface_p.h b/src/dbus/qdbusabstractinterface_p.h
index ba2bcadfb0..1d9290b746 100644
--- a/src/dbus/qdbusabstractinterface_p.h
+++ b/src/dbus/qdbusabstractinterface_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -78,6 +79,7 @@ public:
QDBusAbstractInterfacePrivate(const QString &serv, const QString &p,
const QString &iface, const QDBusConnection& con, bool dynamic);
virtual ~QDBusAbstractInterfacePrivate() { }
+ void initOwnerTracking();
bool canMakeCalls() const;
// these functions do not check if the property is valid
@@ -89,6 +91,8 @@ public:
{ return QDBusConnectionPrivate::d(connection); }
void _q_serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
+
+ static void finishDisconnectNotify(QDBusAbstractInterface *iface, int signalId);
};
QT_END_NAMESPACE
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 42b266792a..a6bc396861 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -70,9 +70,15 @@ public:
QDBusArgument();
QDBusArgument(const QDBusArgument &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDBusArgument(QDBusArgument &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ QDBusArgument &operator=(QDBusArgument &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QDBusArgument &operator=(const QDBusArgument &other);
~QDBusArgument();
+ void swap(QDBusArgument &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
// used for marshalling (Qt -> D-BUS)
QDBusArgument &operator<<(uchar arg);
QDBusArgument &operator<<(bool arg);
@@ -140,6 +146,7 @@ protected:
friend class QDBusArgumentPrivate;
mutable QDBusArgumentPrivate *d;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusArgument)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QDBusArgument)
@@ -147,7 +154,7 @@ QT_BEGIN_NAMESPACE
template<typename T> inline T qdbus_cast(const QDBusArgument &arg
#ifndef Q_QDOC
-, T * = 0
+, T * = Q_NULLPTR
#endif
)
{
@@ -158,7 +165,7 @@ template<typename T> inline T qdbus_cast(const QDBusArgument &arg
template<typename T> inline T qdbus_cast(const QVariant &v
#ifndef Q_QDOC
-, T * = 0
+, T * = Q_NULLPTR
#endif
)
{
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 0adb3dd748..0f2d799b92 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -37,6 +38,7 @@
#include <qdebug.h>
#include <qcoreapplication.h>
#include <qstringlist.h>
+#include <qtimer.h>
#include <qthread.h>
#include "qdbusconnectioninterface.h"
@@ -58,6 +60,65 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QDBusConnectionManager, _q_manager)
+// can be replaced with a lambda in Qt 5.7
+class QDBusConnectionDispatchEnabler : public QObject
+{
+ Q_OBJECT
+ QDBusConnectionPrivate *con;
+public:
+ QDBusConnectionDispatchEnabler(QDBusConnectionPrivate *con) : con(con) {}
+
+public slots:
+ void execute()
+ {
+ con->setDispatchEnabled(true);
+ if (!con->ref.deref())
+ con->deleteLater();
+ deleteLater();
+ }
+};
+
+struct QDBusConnectionManager::ConnectionRequestData
+{
+ enum RequestType {
+ ConnectToStandardBus,
+ ConnectToBusByAddress,
+ ConnectToPeerByAddress
+ } type;
+
+ union {
+ QDBusConnection::BusType busType;
+ const QString *busAddress;
+ };
+ const QString *name;
+
+ QDBusConnectionPrivate *result;
+
+ bool suspendedDelivery;
+};
+
+QDBusConnectionPrivate *QDBusConnectionManager::busConnection(QDBusConnection::BusType type)
+{
+ Q_STATIC_ASSERT(int(QDBusConnection::SessionBus) + int(QDBusConnection::SystemBus) == 1);
+ Q_ASSERT(type == QDBusConnection::SessionBus || type == QDBusConnection::SystemBus);
+
+ if (!qdbus_loadLibDBus())
+ return 0;
+
+ // we'll start in suspended delivery mode if we're in the main thread
+ // (the event loop will resume delivery)
+ bool suspendedDelivery = qApp && qApp->thread() == QThread::currentThread();
+
+ QMutexLocker lock(&defaultBusMutex);
+ if (defaultBuses[type])
+ return defaultBuses[type];
+
+ QString name = QStringLiteral("qt_default_session_bus");
+ if (type == QDBusConnection::SystemBus)
+ name = QStringLiteral("qt_default_system_bus");
+ return defaultBuses[type] = connectToBus(type, name, suspendedDelivery);
+}
+
QDBusConnectionPrivate *QDBusConnectionManager::connection(const QString &name) const
{
return connectionHash.value(name, 0);
@@ -68,7 +129,7 @@ void QDBusConnectionManager::removeConnection(const QString &name)
QDBusConnectionPrivate *d = 0;
d = connectionHash.take(name);
if (d && !d->ref.deref())
- d->deleteYourself();
+ d->deleteLater();
// Static objects may be keeping the connection open.
// However, it is harmless to have outstanding references to a connection that is
@@ -77,17 +138,22 @@ void QDBusConnectionManager::removeConnection(const QString &name)
// ### Output a warning if connections are being used after they have been removed.
}
+QDBusConnectionManager::QDBusConnectionManager()
+{
+ connect(this, &QDBusConnectionManager::connectionRequested,
+ this, &QDBusConnectionManager::executeConnectionRequest, Qt::BlockingQueuedConnection);
+ connect(this, &QDBusConnectionManager::serverRequested,
+ this, &QDBusConnectionManager::createServer, Qt::BlockingQueuedConnection);
+ moveToThread(this); // ugly, don't do this in other projects
+
+ defaultBuses[0] = defaultBuses[1] = Q_NULLPTR;
+ start();
+}
+
QDBusConnectionManager::~QDBusConnectionManager()
{
- for (QHash<QString, QDBusConnectionPrivate *>::const_iterator it = connectionHash.constBegin();
- it != connectionHash.constEnd(); ++it) {
- QDBusConnectionPrivate *d = it.value();
- if (!d->ref.deref())
- d->deleteYourself();
- else
- d->closeConnection();
- }
- connectionHash.clear();
+ quit();
+ wait();
}
QDBusConnectionManager* QDBusConnectionManager::instance()
@@ -106,6 +172,134 @@ void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionP
c->name = name;
}
+void QDBusConnectionManager::run()
+{
+ exec();
+
+ // cleanup:
+ QMutexLocker locker(&mutex);
+ for (QHash<QString, QDBusConnectionPrivate *>::const_iterator it = connectionHash.constBegin();
+ it != connectionHash.constEnd(); ++it) {
+ QDBusConnectionPrivate *d = it.value();
+ if (!d->ref.deref()) {
+ delete d;
+ } else {
+ d->closeConnection();
+ d->moveToThread(Q_NULLPTR); // allow it to be deleted in another thread
+ }
+ }
+ connectionHash.clear();
+
+ // allow deletion from any thread without warning
+ moveToThread(Q_NULLPTR);
+}
+
+QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::BusType type, const QString &name,
+ bool suspendedDelivery)
+{
+ ConnectionRequestData data;
+ data.type = ConnectionRequestData::ConnectToStandardBus;
+ data.busType = type;
+ data.name = &name;
+ data.suspendedDelivery = suspendedDelivery;
+
+ emit connectionRequested(&data);
+ if (suspendedDelivery) {
+ data.result->ref.ref();
+ QDBusConnectionDispatchEnabler *o = new QDBusConnectionDispatchEnabler(data.result);
+ QTimer::singleShot(0, o, SLOT(execute()));
+ o->moveToThread(qApp->thread()); // qApp was checked in the caller
+ }
+ return data.result;
+}
+
+QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(const QString &address, const QString &name)
+{
+ ConnectionRequestData data;
+ data.type = ConnectionRequestData::ConnectToBusByAddress;
+ data.busAddress = &address;
+ data.name = &name;
+ data.suspendedDelivery = false;
+
+ emit connectionRequested(&data);
+ return data.result;
+}
+
+QDBusConnectionPrivate *QDBusConnectionManager::connectToPeer(const QString &address, const QString &name)
+{
+ ConnectionRequestData data;
+ data.type = ConnectionRequestData::ConnectToPeerByAddress;
+ data.busAddress = &address;
+ data.name = &name;
+ data.suspendedDelivery = false;
+
+ emit connectionRequested(&data);
+ return data.result;
+}
+
+void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::ConnectionRequestData *data)
+{
+ QMutexLocker locker(&mutex);
+ const QString &name = *data->name;
+ QDBusConnectionPrivate *&d = data->result;
+
+ // check if the connection exists by name
+ d = connection(name);
+ if (d || name.isEmpty())
+ return;
+
+ d = new QDBusConnectionPrivate;
+ DBusConnection *c = 0;
+ QDBusErrorInternal error;
+ switch (data->type) {
+ case ConnectionRequestData::ConnectToStandardBus:
+ switch (data->busType) {
+ case QDBusConnection::SystemBus:
+ c = q_dbus_bus_get_private(DBUS_BUS_SYSTEM, error);
+ break;
+ case QDBusConnection::SessionBus:
+ c = q_dbus_bus_get_private(DBUS_BUS_SESSION, error);
+ break;
+ case QDBusConnection::ActivationBus:
+ c = q_dbus_bus_get_private(DBUS_BUS_STARTER, error);
+ break;
+ }
+ break;
+
+ case ConnectionRequestData::ConnectToBusByAddress:
+ case ConnectionRequestData::ConnectToPeerByAddress:
+ c = q_dbus_connection_open_private(data->busAddress->toUtf8().constData(), error);
+ if (c && data->type == ConnectionRequestData::ConnectToBusByAddress) {
+ // register on the bus
+ if (!q_dbus_bus_register(c, error)) {
+ q_dbus_connection_unref(c);
+ c = 0;
+ }
+ }
+ break;
+ }
+
+ setConnection(name, d);
+ if (data->type == ConnectionRequestData::ConnectToPeerByAddress) {
+ d->setPeer(c, error);
+ } else {
+ // create the bus service
+ // will lock in QDBusConnectionPrivate::connectRelay()
+ d->setConnection(c, error);
+ d->createBusService();
+ if (data->suspendedDelivery)
+ d->setDispatchEnabled(false);
+ }
+}
+
+void QDBusConnectionManager::createServer(const QString &address, void *server)
+{
+ QDBusErrorInternal error;
+ QDBusConnectionPrivate *d = new QDBusConnectionPrivate;
+ d->setServer(static_cast<QDBusServer *>(server),
+ q_dbus_server_listen(address.toUtf8().constData(), error), error);
+}
+
/*!
\class QDBusConnection
\inmodule QtDBus
@@ -268,7 +462,7 @@ QDBusConnection::QDBusConnection(QDBusConnectionPrivate *dd)
QDBusConnection::~QDBusConnection()
{
if (d && !d->ref.deref())
- d->deleteYourself();
+ d->deleteLater();
}
/*!
@@ -283,7 +477,7 @@ QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other)
if (other.d)
other.d->ref.ref();
if (d && !d->ref.deref())
- d->deleteYourself();
+ d->deleteLater();
d = other.d;
return *this;
}
@@ -295,44 +489,11 @@ QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other)
*/
QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
{
-// Q_ASSERT_X(QCoreApplication::instance(), "QDBusConnection::addConnection",
-// "Cannot create connection without a Q[Core]Application instance");
if (!qdbus_loadLibDBus()) {
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
-
- QMutexLocker locker(&_q_manager()->mutex);
-
- QDBusConnectionPrivate *d = _q_manager()->connection(name);
- if (d || name.isEmpty())
- return QDBusConnection(d);
-
- d = new QDBusConnectionPrivate;
- DBusConnection *c = 0;
- QDBusErrorInternal error;
- switch (type) {
- case SystemBus:
- c = q_dbus_bus_get_private(DBUS_BUS_SYSTEM, error);
- break;
- case SessionBus:
- c = q_dbus_bus_get_private(DBUS_BUS_SESSION, error);
- break;
- case ActivationBus:
- c = q_dbus_bus_get_private(DBUS_BUS_STARTER, error);
- break;
- }
- d->setConnection(c, error); //setConnection does the error handling for us
-
- _q_manager()->setConnection(name, d);
-
- QDBusConnection retval(d);
-
- // create the bus service
- // will lock in QDBusConnectionPrivate::connectRelay()
- d->setBusService(retval);
-
- return retval;
+ return QDBusConnection(_q_manager()->connectToBus(type, name, false));
}
/*!
@@ -342,39 +503,11 @@ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
QDBusConnection QDBusConnection::connectToBus(const QString &address,
const QString &name)
{
-// Q_ASSERT_X(QCoreApplication::instance(), "QDBusConnection::addConnection",
-// "Cannot create connection without a Q[Core]Application instance");
if (!qdbus_loadLibDBus()) {
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
-
- QMutexLocker locker(&_q_manager()->mutex);
-
- QDBusConnectionPrivate *d = _q_manager()->connection(name);
- if (d || name.isEmpty())
- return QDBusConnection(d);
-
- d = new QDBusConnectionPrivate;
- // setConnection does the error handling for us
- QDBusErrorInternal error;
- DBusConnection *c = q_dbus_connection_open_private(address.toUtf8().constData(), error);
- if (c) {
- if (!q_dbus_bus_register(c, error)) {
- q_dbus_connection_unref(c);
- c = 0;
- }
- }
- d->setConnection(c, error);
- _q_manager()->setConnection(name, d);
-
- QDBusConnection retval(d);
-
- // create the bus service
- // will lock in QDBusConnectionPrivate::connectRelay()
- d->setBusService(retval);
-
- return retval;
+ return QDBusConnection(_q_manager()->connectToBus(address, name));
}
/*!
\since 4.8
@@ -385,30 +518,11 @@ QDBusConnection QDBusConnection::connectToBus(const QString &address,
QDBusConnection QDBusConnection::connectToPeer(const QString &address,
const QString &name)
{
-// Q_ASSERT_X(QCoreApplication::instance(), "QDBusConnection::addConnection",
-// "Cannot create connection without a Q[Core]Application instance");
if (!qdbus_loadLibDBus()) {
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
-
- QMutexLocker locker(&_q_manager()->mutex);
-
- QDBusConnectionPrivate *d = _q_manager()->connection(name);
- if (d || name.isEmpty())
- return QDBusConnection(d);
-
- d = new QDBusConnectionPrivate;
- // setPeer does the error handling for us
- QDBusErrorInternal error;
- DBusConnection *c = q_dbus_connection_open_private(address.toUtf8().constData(), error);
-
- d->setPeer(c, error);
- _q_manager()->setConnection(name, d);
-
- QDBusConnection retval(d);
-
- return retval;
+ return QDBusConnection(_q_manager()->connectToPeer(address, name));
}
/*!
@@ -467,7 +581,7 @@ bool QDBusConnection::send(const QDBusMessage &message) const
d->lastError = err;
return false;
}
- return d->send(message) != 0;
+ return d->send(message);
}
/*!
@@ -688,7 +802,6 @@ bool QDBusConnection::connect(const QString &service, const QString &path, const
return false;
}
- QDBusWriteLocker locker(ConnectAction, d);
return d->connectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot);
}
@@ -744,7 +857,6 @@ bool QDBusConnection::disconnect(const QString &service, const QString &path, co
if (interface.isEmpty() && name.isEmpty())
return false;
- QDBusWriteLocker locker(DisconnectAction, d);
return d->disconnectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot);
}
@@ -929,7 +1041,7 @@ QObject *QDBusConnection::objectRegisteredAt(const QString &path) const
*/
QDBusConnectionInterface *QDBusConnection::interface() const
{
- if (!d)
+ if (!d || d->mode != QDBusConnectionPrivate::ClientMode)
return 0;
return d->busService;
}
@@ -1052,35 +1164,6 @@ bool QDBusConnection::unregisterService(const QString &serviceName)
return false;
}
-static const char _q_sessionBusName[] = "qt_default_session_bus";
-static const char _q_systemBusName[] = "qt_default_system_bus";
-
-class QDBusDefaultConnection: public QDBusConnection
-{
- const char *ownName;
-public:
- inline QDBusDefaultConnection(BusType type, const char *name)
- : QDBusConnection(connectToBus(type, QString::fromLatin1(name))), ownName(name)
- {
- // make sure this connection is running on the main thread
- QCoreApplication *instance = QCoreApplication::instance();
- if (!instance) {
- qWarning("QDBusConnection: %s D-Bus connection created before QCoreApplication. Application may misbehave.",
- type == SessionBus ? "session" : type == SystemBus ? "system" : "generic");
- } else if (QDBusConnectionPrivate::d(*this)) {
- QDBusConnectionPrivate::d(*this)->moveToThread(instance->thread());
- }
- }
-
- inline ~QDBusDefaultConnection()
- { disconnectFromBus(QString::fromLatin1(ownName)); }
-};
-
-Q_GLOBAL_STATIC_WITH_ARGS(QDBusDefaultConnection, _q_sessionBus,
- (QDBusConnection::SessionBus, _q_sessionBusName))
-Q_GLOBAL_STATIC_WITH_ARGS(QDBusDefaultConnection, _q_systemBus,
- (QDBusConnection::SystemBus, _q_systemBusName))
-
/*!
\fn QDBusConnection QDBusConnection::sessionBus()
@@ -1090,7 +1173,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QDBusDefaultConnection, _q_systemBus,
*/
QDBusConnection QDBusConnection::sessionBus()
{
- return *_q_sessionBus();
+ return QDBusConnection(_q_manager()->busConnection(SessionBus));
}
/*!
@@ -1102,7 +1185,7 @@ QDBusConnection QDBusConnection::sessionBus()
*/
QDBusConnection QDBusConnection::systemBus()
{
- return *_q_systemBus();
+ return QDBusConnection(_q_manager()->busConnection(SystemBus));
}
#if QT_DEPRECATED_SINCE(5,5)
@@ -1123,8 +1206,10 @@ QDBusConnection QDBusConnection::sender()
/*!
\internal
*/
-void QDBusConnectionPrivate::setBusService(const QDBusConnection &connection)
+void QDBusConnectionPrivate::createBusService()
{
+ Q_ASSERT(mode == ClientMode);
+ QDBusConnection connection(this);
busService = new QDBusConnectionInterface(connection, this);
ref.deref(); // busService has increased the refcounting to us
// avoid cyclic refcounting
@@ -1184,4 +1269,6 @@ QByteArray QDBusConnection::localMachineId()
QT_END_NAMESPACE
+#include "qdbusconnection.moc"
+
#endif // QT_NO_DBUS
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index 10598c0b7b..8b2e9234aa 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -99,11 +99,12 @@ public:
ExportChildObjects = 0x1000
// Reserved = 0xff000000
};
+ Q_DECLARE_FLAGS(RegisterOptions, RegisterOption)
+
enum UnregisterMode {
UnregisterNode,
UnregisterTree
};
- Q_DECLARE_FLAGS(RegisterOptions, RegisterOption)
enum VirtualObjectRegisterOption {
SingleNode = 0x0,
@@ -121,9 +122,14 @@ public:
explicit QDBusConnection(const QString &name);
QDBusConnection(const QDBusConnection &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDBusConnection(QDBusConnection &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ QDBusConnection &operator=(QDBusConnection &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QDBusConnection &operator=(const QDBusConnection &other);
~QDBusConnection();
- QDBusConnection &operator=(const QDBusConnection &other);
+ void swap(QDBusConnection &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool isConnected() const;
QString baseService() const;
@@ -199,9 +205,11 @@ private:
friend class QDBusConnectionPrivate;
QDBusConnectionPrivate *d;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusConnection)
Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::RegisterOptions)
Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::VirtualObjectRegisterOptions)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::ConnectionCapabilities)
QT_END_NAMESPACE
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index 5d8777c622..f030a3ff8c 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -62,6 +63,7 @@
#include "qdbus_symbols_p.h"
#include <qdbusmessage.h>
+#include <qdbusservicewatcher.h> // for the WatchMode enum
#ifndef QT_NO_DBUS
@@ -79,6 +81,7 @@ struct QDBusMetaObject;
class QDBusAbstractInterface;
class QDBusConnectionInterface;
class QDBusPendingCallPrivate;
+class QDBusServer;
#ifndef QT_BOOTSTRAPPED
@@ -166,12 +169,12 @@ public:
// typedefs
typedef QMultiHash<int, Watcher> WatcherHash;
typedef QHash<int, DBusTimeout *> TimeoutHash;
- typedef QList<QPair<DBusTimeout *, int> > PendingTimeoutList;
+ typedef QVector<QDBusMessage> PendingMessageList;
typedef QMultiHash<QString, SignalHook> SignalHookHash;
typedef QHash<QString, QDBusMetaObject* > MetaObjectHash;
typedef QHash<QByteArray, int> MatchRefCountHash;
- typedef QList<QDBusPendingCallPrivate*> PendingCallList;
+ typedef QVector<QDBusPendingCallPrivate*> PendingCallList;
struct WatchedServiceData {
WatchedServiceData() : refcount(0) {}
@@ -187,17 +190,23 @@ public:
// public methods are entry points from other objects
explicit QDBusConnectionPrivate(QObject *parent = 0);
~QDBusConnectionPrivate();
- void deleteYourself();
- void setBusService(const QDBusConnection &connection);
+ void createBusService();
+ void setDispatchEnabled(bool enable);
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error);
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error);
- void setServer(DBusServer *server, const QDBusErrorInternal &error);
+ void setServer(QDBusServer *object, DBusServer *server, const QDBusErrorInternal &error);
void closeConnection();
QString getNameOwner(const QString &service);
- int send(const QDBusMessage &message);
+ bool shouldWatchService(const QString &service);
+ void watchService(const QString &service, QDBusServiceWatcher::WatchMode mode,
+ QObject *obj, const char *member);
+ void unwatchService(const QString &service, QDBusServiceWatcher::WatchMode mode,
+ QObject *obj, const char *member);
+
+ bool send(const QDBusMessage &message);
QDBusMessage sendWithReply(const QDBusMessage &message, int mode, int timeout = -1);
QDBusMessage sendWithReplyLocal(const QDBusMessage &message);
QDBusPendingCallPrivate *sendWithReplyAsync(const QDBusMessage &message, QObject *receiver,
@@ -205,8 +214,6 @@ public:
bool connectSignal(const QString &service, const QString &path, const QString& interface,
const QString &name, const QStringList &argumentMatch, const QString &signature,
QObject *receiver, const char *slot);
- void connectSignal(const QString &key, const SignalHook &hook);
- SignalHookHash::Iterator disconnectSignal(SignalHookHash::Iterator &it);
bool disconnectSignal(const QString &service, const QString &path, const QString& interface,
const QString &name, const QStringList &argumentMatch, const QString &signature,
QObject *receiver, const char *slot);
@@ -222,16 +229,12 @@ public:
void unregisterService(const QString &serviceName);
bool handleMessage(const QDBusMessage &msg);
- void waitForFinished(QDBusPendingCallPrivate *pcall);
QDBusMetaObject *findMetaObject(const QString &service, const QString &path,
const QString &interface, QDBusError &error);
void postEventToThread(int action, QObject *target, QEvent *event);
- inline void serverConnection(const QDBusConnection &connection)
- { emit newServerConnection(connection); }
-
private:
void checkThread();
bool handleError(const QDBusErrorInternal &error);
@@ -245,16 +248,20 @@ private:
bool activateInternalFilters(const ObjectTreeNode &node, const QDBusMessage &msg);
bool activateCall(QObject *object, int flags, const QDBusMessage &msg);
+ void sendInternal(QDBusPendingCallPrivate *pcall, void *msg, int timeout);
void sendError(const QDBusMessage &msg, QDBusError::ErrorType code);
void deliverCall(QObject *object, int flags, const QDBusMessage &msg,
const QVector<int> &metaTypes, int slotIdx);
+ SignalHookHash::Iterator removeSignalHookNoLock(SignalHookHash::Iterator it);
+
bool isServiceRegisteredByThread(const QString &serviceName);
QString getNameOwnerNoCache(const QString &service);
+ void _q_newConnection(QDBusConnectionPrivate *newConnection);
+
protected:
- void customEvent(QEvent *e) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
public slots:
@@ -264,6 +271,8 @@ public slots:
void socketWrite(int);
void objectDestroyed(QObject *o);
void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args);
+ void addSignalHook(const QString &key, const SignalHook &hook);
+ bool removeSignalHook(const QString &key, const SignalHook &hook);
private slots:
void serviceOwnerChangedNoLock(const QString &name, const QString &oldOwner, const QString &newOwner);
@@ -271,9 +280,13 @@ private slots:
void unregisterServiceNoLock(const QString &serviceName);
signals:
+ void dispatchStatusChanged();
+ void messageNeedsSending(QDBusPendingCallPrivate *pcall, void *msg, int timeout = -1);
+ void signalNeedsConnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook);
+ bool signalNeedsDisconnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook);
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &message);
- void newServerConnection(const QDBusConnection &connection);
+ void newServerConnection(QDBusConnectionPrivate *newConnection);
public:
QAtomicInt ref;
@@ -283,16 +296,21 @@ public:
QStringList serverConnectionNames;
ConnectionMode mode;
- QDBusConnectionInterface *busService;
+ union {
+ QDBusConnectionInterface *busService;
+ QDBusServer *serverObject;
+ };
// the dispatch lock protects everything related to the DBusConnection or DBusServer
// including the timeouts and watches
QMutex dispatchLock;
- DBusConnection *connection;
- DBusServer *server;
+ union {
+ DBusConnection *connection;
+ DBusServer *server;
+ };
WatcherHash watchers;
TimeoutHash timeouts;
- PendingTimeoutList timeoutsPendingAdd;
+ PendingMessageList pendingMessages;
// the master lock protects our own internal state
QReadWriteLock lock;
@@ -306,10 +324,8 @@ public:
MetaObjectHash cachedMetaObjects;
PendingCallList pendingCalls;
- QMutex callDeliveryMutex;
- QDBusCallDeliveryEvent *callDeliveryState; // protected by the callDeliveryMutex mutex
-
bool anonymousAuthenticationAllowed;
+ bool dispatchEnabled; // protected by the dispatch lock, not the main lock
public:
// static methods
@@ -334,6 +350,7 @@ public:
friend class QDBusActivateObjectEvent;
friend class QDBusCallDeliveryEvent;
+ friend class QDBusServer;
};
// in qdbusmisc.cpp
diff --git a/src/dbus/qdbusconnectionmanager_p.h b/src/dbus/qdbusconnectionmanager_p.h
index fc0bb515e5..c0ab48e4ee 100644
--- a/src/dbus/qdbusconnectionmanager_p.h
+++ b/src/dbus/qdbusconnectionmanager_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -47,26 +48,47 @@
#define QDBUSCONNECTIONMANAGER_P_H
#include "qdbusconnection_p.h"
+#include "private/qthread_p.h"
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
-class QDBusConnectionManager
+class QDBusConnectionManager : public QDaemonThread
{
+ Q_OBJECT
+ struct ConnectionRequestData;
public:
- QDBusConnectionManager() {}
+ QDBusConnectionManager();
~QDBusConnectionManager();
static QDBusConnectionManager* instance();
+ QDBusConnectionPrivate *busConnection(QDBusConnection::BusType type);
QDBusConnectionPrivate *connection(const QString &name) const;
void removeConnection(const QString &name);
void setConnection(const QString &name, QDBusConnectionPrivate *c);
+ QDBusConnectionPrivate *connectToBus(QDBusConnection::BusType type, const QString &name, bool suspendedDelivery);
+ QDBusConnectionPrivate *connectToBus(const QString &address, const QString &name);
+ QDBusConnectionPrivate *connectToPeer(const QString &address, const QString &name);
mutable QMutex mutex;
+
+signals:
+ void connectionRequested(ConnectionRequestData *);
+ void serverRequested(const QString &address, void *server);
+
+protected:
+ void run() Q_DECL_OVERRIDE;
+
private:
+ void executeConnectionRequest(ConnectionRequestData *data);
+ void createServer(const QString &address, void *server);
+
QHash<QString, QDBusConnectionPrivate *> connectionHash;
+ QMutex defaultBusMutex;
+ QDBusConnectionPrivate *defaultBuses[2];
+
mutable QMutex senderMutex;
QString senderName; // internal; will probably change
};
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp
index 2b13f90fac..d6a329cfe8 100644
--- a/src/dbus/qdbuserror.cpp
+++ b/src/dbus/qdbuserror.cpp
@@ -130,11 +130,11 @@ static const int errorMessages_indices[] = {
0, 6, 40, 76, 118, 153, 191, 231,
273, 313, 349, 384, 421, 461, 501, 540,
581, 617, 661, 705, 746, 789, 833, 874,
- 916, 961, 1005, -1
+ 916, 961, 1005
};
static const int errorMessages_count = sizeof errorMessages_indices /
- sizeof errorMessages_indices[0] - 1;
+ sizeof errorMessages_indices[0];
static inline const char *get(QDBusError::ErrorType code)
{
@@ -142,6 +142,7 @@ static inline const char *get(QDBusError::ErrorType code)
return errorMessages_string + errorMessages_indices[intcode];
}
+#ifndef QT_BOOTSTRAPPED
static inline QDBusError::ErrorType get(const char *name)
{
if (!name || !*name)
@@ -151,6 +152,7 @@ static inline QDBusError::ErrorType get(const char *name)
return QDBusError::ErrorType(i + int(QDBusError::Other));
return QDBusError::Other;
}
+#endif
/*!
\class QDBusError
diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h
index c2c0ff8fc5..ce5275dee9 100644
--- a/src/dbus/qdbuserror.h
+++ b/src/dbus/qdbuserror.h
@@ -92,11 +92,25 @@ public:
#endif
QDBusError(ErrorType error, const QString &message);
QDBusError(const QDBusError &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDBusError(QDBusError &&other) Q_DECL_NOTHROW
+ : code(other.code), msg(std::move(other.msg)), nm(std::move(other.nm)), unused(other.unused)
+ { other.unused = Q_NULLPTR; }
+ QDBusError &operator=(QDBusError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QDBusError &operator=(const QDBusError &other);
#ifndef QT_BOOTSTRAPPED
QDBusError &operator=(const QDBusMessage &msg);
#endif
+ void swap(QDBusError &other) Q_DECL_NOTHROW
+ {
+ qSwap(code, other.code);
+ qSwap(msg, other.msg);
+ qSwap(nm, other.nm);
+ qSwap(unused, other.unused);
+ }
+
ErrorType type() const;
QString name() const;
QString message() const;
@@ -110,6 +124,7 @@ private:
QString nm;
void *unused;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusError)
#ifndef QT_NO_DEBUG_STREAM
Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &);
diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h
index 390ff6c91c..8495b3a320 100644
--- a/src/dbus/qdbusextratypes.h
+++ b/src/dbus/qdbusextratypes.h
@@ -39,7 +39,10 @@
#include <QtCore/qvariant.h>
#include <QtCore/qstring.h>
#include <QtDBus/qdbusmacros.h>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/qhash.h>
+#endif
+#include <QtCore/qhashfunctions.h>
#ifndef QT_NO_DBUS
@@ -50,11 +53,18 @@ class Q_DBUS_EXPORT QDBusObjectPath
{
QString m_path;
public:
- inline QDBusObjectPath() { }
+ QDBusObjectPath() Q_DECL_NOTHROW : m_path() {}
+ // compiler-generated copy/move constructor/assignment operators are ok!
+ // compiler-generated destructor is ok!
inline explicit QDBusObjectPath(const char *path);
inline explicit QDBusObjectPath(QLatin1String path);
inline explicit QDBusObjectPath(const QString &path);
+#ifdef Q_COMPILER_RVALUE_REFS
+ explicit QDBusObjectPath(QString &&p) : m_path(std::move(p)) { doCheck(); }
+#endif
+
+ void swap(QDBusObjectPath &other) Q_DECL_NOTHROW { qSwap(m_path, other.m_path); }
inline void setPath(const QString &path);
@@ -64,6 +74,7 @@ public:
private:
void doCheck();
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusObjectPath)
inline QDBusObjectPath::QDBusObjectPath(const char *objectPath)
: m_path(QString::fromLatin1(objectPath))
@@ -89,7 +100,7 @@ inline bool operator!=(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs)
inline bool operator<(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs)
{ return lhs.path() < rhs.path(); }
-inline uint qHash(const QDBusObjectPath &objectPath, uint seed)
+inline uint qHash(const QDBusObjectPath &objectPath, uint seed = 0)
{ return qHash(objectPath.path(), seed); }
@@ -97,11 +108,18 @@ class Q_DBUS_EXPORT QDBusSignature
{
QString m_signature;
public:
- inline QDBusSignature() { }
+ QDBusSignature() Q_DECL_NOTHROW : m_signature() {}
+ // compiler-generated copy/move constructor/assignment operators are ok!
+ // compiler-generated destructor is ok!
inline explicit QDBusSignature(const char *signature);
inline explicit QDBusSignature(QLatin1String signature);
inline explicit QDBusSignature(const QString &signature);
+#ifdef Q_COMPILER_RVALUE_REFS
+ explicit QDBusSignature(QString &&sig) : m_signature(std::move(sig)) { doCheck(); }
+#endif
+
+ void swap(QDBusSignature &other) Q_DECL_NOTHROW { qSwap(m_signature, other.m_signature); }
inline void setSignature(const QString &signature);
@@ -111,6 +129,7 @@ public:
private:
void doCheck();
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusSignature)
inline QDBusSignature::QDBusSignature(const char *dBusSignature)
: m_signature(QString::fromLatin1(dBusSignature))
@@ -136,21 +155,30 @@ inline bool operator!=(const QDBusSignature &lhs, const QDBusSignature &rhs)
inline bool operator<(const QDBusSignature &lhs, const QDBusSignature &rhs)
{ return lhs.signature() < rhs.signature(); }
-inline uint qHash(const QDBusSignature &signature, uint seed)
+inline uint qHash(const QDBusSignature &signature, uint seed = 0)
{ return qHash(signature.signature(), seed); }
class QDBusVariant
{
QVariant m_variant;
public:
- inline QDBusVariant() { }
+ QDBusVariant() Q_DECL_NOTHROW : m_variant() {}
+ // compiler-generated copy/move constructor/assignment operators are ok!
+ // compiler-generated destructor is ok!
+
inline explicit QDBusVariant(const QVariant &variant);
+#ifdef Q_COMPILER_RVALUE_REFS
+ explicit QDBusVariant(QVariant &&v) Q_DECL_NOTHROW : m_variant(std::move(v)) {}
+#endif
+
+ void swap(QDBusVariant &other) Q_DECL_NOTHROW { qSwap(m_variant, other.m_variant); }
inline void setVariant(const QVariant &variant);
inline QVariant variant() const
{ return m_variant; }
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusVariant)
inline QDBusVariant::QDBusVariant(const QVariant &dBusVariant)
: m_variant(dBusVariant) { }
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index cce8b9c28d..f6221d51b6 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -52,6 +53,7 @@
#include "qdbusmetatype_p.h"
#include "qdbusabstractadaptor.h"
#include "qdbusabstractadaptor_p.h"
+#include "qdbusserver.h"
#include "qdbusutil_p.h"
#include "qdbusvirtualobject.h"
#include "qdbusmessage_p.h"
@@ -92,12 +94,7 @@ static inline QDebug operator<<(QDebug dbg, const QDBusConnectionPrivate *conn)
<< "ptr=" << (const void*)conn
<< ", name=" << conn->name
<< ", baseService=" << conn->baseService
- << ", thread=";
- if (conn->thread() == QThread::currentThread())
- dbg.nospace() << "same thread";
- else
- dbg.nospace() << conn->thread();
- dbg.nospace() << ')';
+ << ')';
return dbg;
}
@@ -131,7 +128,6 @@ extern "C" {
// libdbus-1 callbacks
-static bool qDBusRealAddTimeout(QDBusConnectionPrivate *d, DBusTimeout *timeout, int ms);
static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
{
Q_ASSERT(timeout);
@@ -140,29 +136,17 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
// qDebug("addTimeout %d", q_dbus_timeout_get_interval(timeout));
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
+ Q_ASSERT(QThread::currentThread() == d->thread());
- if (!q_dbus_timeout_get_enabled(timeout))
- return true;
+ // we may get called from qDBusToggleTimeout
+ if (Q_UNLIKELY(!q_dbus_timeout_get_enabled(timeout)))
+ return false;
QDBusDispatchLocker locker(AddTimeoutAction, d);
- if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
- // correct thread
- return qDBusRealAddTimeout(d, timeout, q_dbus_timeout_get_interval(timeout));
- } else {
- // wrong thread: sync back
- QDBusConnectionCallbackEvent *ev = new QDBusConnectionCallbackEvent;
- ev->subtype = QDBusConnectionCallbackEvent::AddTimeout;
- d->timeoutsPendingAdd.append(qMakePair(timeout, q_dbus_timeout_get_interval(timeout)));
- d->postEventToThread(AddTimeoutAction, d, ev);
- return true;
- }
-}
-
-static bool qDBusRealAddTimeout(QDBusConnectionPrivate *d, DBusTimeout *timeout, int ms)
-{
- Q_ASSERT(d->timeouts.keys(timeout).isEmpty());
+ Q_ASSERT(d->timeouts.key(timeout, 0) == 0);
- int timerId = d->startTimer(ms);
+ int timerId = d->startTimer(q_dbus_timeout_get_interval(timeout));
+ Q_ASSERT_X(timerId, "QDBusConnection", "Failed to start a timer");
if (!timerId)
return false;
@@ -178,33 +162,14 @@ static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data)
// qDebug("removeTimeout");
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
+ Q_ASSERT(QThread::currentThread() == d->thread());
QDBusDispatchLocker locker(RemoveTimeoutAction, d);
- // is it pending addition?
- QDBusConnectionPrivate::PendingTimeoutList::iterator pit = d->timeoutsPendingAdd.begin();
- while (pit != d->timeoutsPendingAdd.end()) {
- if (pit->first == timeout)
- pit = d->timeoutsPendingAdd.erase(pit);
- else
- ++pit;
- }
-
- // is it a running timer?
- bool correctThread = QCoreApplication::instance() && QThread::currentThread() == d->thread();
QDBusConnectionPrivate::TimeoutHash::iterator it = d->timeouts.begin();
while (it != d->timeouts.end()) {
if (it.value() == timeout) {
- if (correctThread) {
- // correct thread
- d->killTimer(it.key());
- } else {
- // incorrect thread or no application, post an event for later
- QDBusConnectionCallbackEvent *ev = new QDBusConnectionCallbackEvent;
- ev->subtype = QDBusConnectionCallbackEvent::KillTimer;
- ev->timerId = it.key();
- d->postEventToThread(KillTimerAction, d, ev);
- }
+ d->killTimer(it.key());
it = d->timeouts.erase(it);
break;
} else {
@@ -224,52 +189,33 @@ static void qDBusToggleTimeout(DBusTimeout *timeout, void *data)
qDBusAddTimeout(timeout, data);
}
-static bool qDBusRealAddWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int flags, int fd);
static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data)
{
Q_ASSERT(watch);
Q_ASSERT(data);
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
+ Q_ASSERT(QThread::currentThread() == d->thread());
int flags = q_dbus_watch_get_flags(watch);
int fd = q_dbus_watch_get_unix_fd(watch);
- if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
- return qDBusRealAddWatch(d, watch, flags, fd);
- } else {
- QDBusConnectionCallbackEvent *ev = new QDBusConnectionCallbackEvent;
- ev->subtype = QDBusConnectionCallbackEvent::AddWatch;
- ev->watch = watch;
- ev->fd = fd;
- ev->extra = flags;
- d->postEventToThread(AddWatchAction, d, ev);
- return true;
- }
-}
-
-static bool qDBusRealAddWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int flags, int fd)
-{
QDBusConnectionPrivate::Watcher watcher;
QDBusDispatchLocker locker(AddWatchAction, d);
if (flags & DBUS_WATCH_READABLE) {
//qDebug("addReadWatch %d", fd);
watcher.watch = watch;
- if (QCoreApplication::instance()) {
- watcher.read = new QSocketNotifier(fd, QSocketNotifier::Read, d);
- watcher.read->setEnabled(q_dbus_watch_get_enabled(watch));
- d->connect(watcher.read, SIGNAL(activated(int)), SLOT(socketRead(int)));
- }
+ watcher.read = new QSocketNotifier(fd, QSocketNotifier::Read, d);
+ watcher.read->setEnabled(q_dbus_watch_get_enabled(watch));
+ d->connect(watcher.read, SIGNAL(activated(int)), SLOT(socketRead(int)));
}
if (flags & DBUS_WATCH_WRITABLE) {
//qDebug("addWriteWatch %d", fd);
watcher.watch = watch;
- if (QCoreApplication::instance()) {
- watcher.write = new QSocketNotifier(fd, QSocketNotifier::Write, d);
- watcher.write->setEnabled(q_dbus_watch_get_enabled(watch));
- d->connect(watcher.write, SIGNAL(activated(int)), SLOT(socketWrite(int)));
- }
+ watcher.write = new QSocketNotifier(fd, QSocketNotifier::Write, d);
+ watcher.write->setEnabled(q_dbus_watch_get_enabled(watch));
+ d->connect(watcher.write, SIGNAL(activated(int)), SLOT(socketWrite(int)));
}
d->watchers.insertMulti(fd, watcher);
@@ -284,23 +230,15 @@ static void qDBusRemoveWatch(DBusWatch *watch, void *data)
//qDebug("remove watch");
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
+ Q_ASSERT(QThread::currentThread() == d->thread());
int fd = q_dbus_watch_get_unix_fd(watch);
QDBusDispatchLocker locker(RemoveWatchAction, d);
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
while (i != d->watchers.end() && i.key() == fd) {
if (i.value().watch == watch) {
- if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
- // correct thread, delete the socket notifiers
- delete i.value().read;
- delete i.value().write;
- } else {
- // incorrect thread or no application, use delete later
- if (i->read)
- i->read->deleteLater();
- if (i->write)
- i->write->deleteLater();
- }
+ delete i.value().read;
+ delete i.value().write;
i = d->watchers.erase(i);
} else {
++i;
@@ -308,28 +246,15 @@ static void qDBusRemoveWatch(DBusWatch *watch, void *data)
}
}
-static void qDBusRealToggleWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int fd);
static void qDBusToggleWatch(DBusWatch *watch, void *data)
{
Q_ASSERT(watch);
Q_ASSERT(data);
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
+ Q_ASSERT(QThread::currentThread() == d->thread());
int fd = q_dbus_watch_get_unix_fd(watch);
- if (QCoreApplication::instance() && QThread::currentThread() == d->thread()) {
- qDBusRealToggleWatch(d, watch, fd);
- } else {
- QDBusConnectionCallbackEvent *ev = new QDBusConnectionCallbackEvent;
- ev->subtype = QDBusConnectionCallbackEvent::ToggleWatch;
- ev->watch = watch;
- ev->fd = fd;
- d->postEventToThread(ToggleWatchAction, d, ev);
- }
-}
-
-static void qDBusRealToggleWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int fd)
-{
QDBusDispatchLocker locker(ToggleWatchAction, d);
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
@@ -355,18 +280,8 @@ static void qDBusUpdateDispatchStatus(DBusConnection *connection, DBusDispatchSt
Q_ASSERT(connection);
Q_UNUSED(connection);
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
-
- static int slotId; // 0 is QObject::deleteLater()
- if (!slotId) {
- // it's ok to do this: there's no race condition because the store is atomic
- // and we always set to the same value
- slotId = QDBusConnectionPrivate::staticMetaObject.indexOfSlot("doDispatch()");
- }
-
- //qDBusDebug() << "Updating dispatcher status" << slotId;
if (new_status == DBUS_DISPATCH_DATA_REMAINS)
- QDBusConnectionPrivate::staticMetaObject.method(slotId).
- invoke(d, Qt::QueuedConnection);
+ emit d->dispatchStatusChanged();
}
static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, void *data)
@@ -393,10 +308,14 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v
QDBusErrorInternal error;
newConnection->setPeer(connection, error);
- QDBusConnection retval = QDBusConnectionPrivate::q(newConnection);
+ // this is a queued connection and will resume in the QDBusServer's thread
+ emit serverConnection->newServerConnection(newConnection);
+}
- // make QDBusServer emit the newConnection signal
- serverConnection->serverConnection(retval);
+void QDBusConnectionPrivate::_q_newConnection(QDBusConnectionPrivate *newConnection)
+{
+ Q_ASSERT(mode == ServerMode);
+ emit serverObject->newConnection(QDBusConnectionPrivate::q(newConnection));
}
} // extern "C"
@@ -521,11 +440,27 @@ static QObject *findChildObject(const QDBusConnectionPrivate::ObjectTreeNode *ro
return 0;
}
-static bool shouldWatchService(const QString &service)
+static QStringList matchArgsForService(const QString &service, QDBusServiceWatcher::WatchMode mode)
{
- return !service.isEmpty() && !service.startsWith(QLatin1Char(':'));
+ QStringList matchArgs;
+ matchArgs << service;
+
+ switch (mode) {
+ case QDBusServiceWatcher::WatchForOwnerChange:
+ break;
+
+ case QDBusServiceWatcher::WatchForRegistration:
+ matchArgs << QString::fromLatin1("", 0);
+ break;
+
+ case QDBusServiceWatcher::WatchForUnregistration:
+ matchArgs << QString() << QString::fromLatin1("", 0);
+ break;
+ }
+ return matchArgs;
}
+
extern Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
void qDBusAddSpyHook(QDBusSpyHook hook)
{
@@ -561,6 +496,11 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
if (!ref.load())
return false;
+ if (!dispatchEnabled && !QDBusMessagePrivate::isLocal(amsg)) {
+ // queue messages only, we'll handle them later
+ pendingMessages << amsg;
+ return amsg.type() == QDBusMessage::MethodCallMessage;
+ }
switch (amsg.type()) {
case QDBusMessage::SignalMessage:
@@ -755,6 +695,20 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
return -1;
}
+/*!
+ \internal
+ Enables or disables the delivery of incoming method calls and signals. If
+ \a enable is true, this will also cause any queued, pending messages to be
+ delivered.
+ */
+void QDBusConnectionPrivate::setDispatchEnabled(bool enable)
+{
+ QDBusDispatchLocker locker(SetDispatchEnabledAction, this);
+ dispatchEnabled = enable;
+ if (enable)
+ emit dispatchStatusChanged();
+}
+
static QDBusCallDeliveryEvent * const DIRECT_DELIVERY = (QDBusCallDeliveryEvent *)1;
QDBusCallDeliveryEvent* QDBusConnectionPrivate::prepareReply(QDBusConnectionPrivate *target,
@@ -952,14 +906,19 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q
}
// output arguments
+ const int numMetaTypes = metaTypes.count();
QVariantList outputArgs;
void *null = 0;
if (metaTypes[0] != QMetaType::Void && metaTypes[0] != QMetaType::UnknownType) {
+ outputArgs.reserve(numMetaTypes - i + 1);
QVariant arg(metaTypes[0], null);
outputArgs.append( arg );
params[0] = const_cast<void*>(outputArgs.at( outputArgs.count() - 1 ).constData());
+ } else {
+ outputArgs.reserve(numMetaTypes - i);
}
- for ( ; i < metaTypes.count(); ++i) {
+
+ for ( ; i < numMetaTypes; ++i) {
QVariant arg(metaTypes[i], null);
outputArgs.append( arg );
params.append(const_cast<void*>(outputArgs.at( outputArgs.count() - 1 ).constData()));
@@ -1004,9 +963,10 @@ extern bool qDBusInitThreads();
QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
: QObject(p), ref(1), capabilities(0), mode(InvalidMode), busService(0),
- dispatchLock(QMutex::Recursive), connection(0), server(0),
+ dispatchLock(QMutex::Recursive), connection(0),
rootNode(QString(QLatin1Char('/'))),
- anonymousAuthenticationAllowed(false)
+ anonymousAuthenticationAllowed(false),
+ dispatchEnabled(true)
{
static const bool threads = q_dbus_threads_init_default();
if (::isDebugging == -1)
@@ -1019,6 +979,14 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
#endif
QDBusMetaTypeId::init();
+ connect(this, &QDBusConnectionPrivate::dispatchStatusChanged,
+ this, &QDBusConnectionPrivate::doDispatch, Qt::QueuedConnection);
+ connect(this, &QDBusConnectionPrivate::messageNeedsSending,
+ this, &QDBusConnectionPrivate::sendInternal);
+ connect(this, &QDBusConnectionPrivate::signalNeedsConnecting,
+ this, &QDBusConnectionPrivate::addSignalHook, Qt::BlockingQueuedConnection);
+ connect(this, &QDBusConnectionPrivate::signalNeedsDisconnecting,
+ this, &QDBusConnectionPrivate::removeSignalHook, Qt::BlockingQueuedConnection);
rootNode.flags = 0;
@@ -1038,50 +1006,38 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate()
"Timer and socket errors will follow and the program will probably crash",
qPrintable(name));
- if (mode == ClientMode) {
- // the bus service object holds a reference back to us;
- // we need to destroy it before we finish destroying ourselves
- Q_ASSERT(ref.load() == 0);
- QObject *obj = (QObject *)busService;
- disconnect(obj, Q_NULLPTR, this, Q_NULLPTR);
- delete obj;
- }
-
closeConnection();
rootNode.children.clear(); // free resources
qDeleteAll(cachedMetaObjects);
- if (server)
- q_dbus_server_unref(server);
- if (connection)
- q_dbus_connection_unref(connection);
-
- connection = 0;
- server = 0;
-}
-
-void QDBusConnectionPrivate::deleteYourself()
-{
- if (thread() && thread() != QThread::currentThread()) {
- // last reference dropped while not in the correct thread
- // ask the correct thread to delete
-
- // note: since we're posting an event to another thread, we
- // must consider deleteLater() to take effect immediately
- deleteLater();
- } else {
- delete this;
+ if (mode == ClientMode || mode == PeerMode) {
+ // the bus service object holds a reference back to us;
+ // we need to destroy it before we finish destroying ourselves
+ Q_ASSERT(ref.load() == 0);
+ QObject *obj = (QObject *)busService;
+ if (obj) {
+ disconnect(obj, Q_NULLPTR, this, Q_NULLPTR);
+ delete obj;
+ }
+ if (connection)
+ q_dbus_connection_unref(connection);
+ connection = 0;
+ } else if (mode == ServerMode) {
+ if (server)
+ q_dbus_server_unref(server);
+ server = 0;
}
}
void QDBusConnectionPrivate::closeConnection()
{
QDBusWriteLocker locker(CloseConnectionAction, this);
+ qDBusDebug() << this << "Disconnected";
ConnectionMode oldMode = mode;
mode = InvalidMode; // prevent reentrancy
baseService.clear();
- if (server) {
+ if (oldMode == ServerMode && server) {
q_dbus_server_disconnect(server);
q_dbus_server_free_data_slot(&server_slot);
}
@@ -1096,19 +1052,12 @@ void QDBusConnectionPrivate::closeConnection()
}
qDeleteAll(pendingCalls);
-
- qDBusDebug() << this << "Disconnected";
}
void QDBusConnectionPrivate::checkThread()
{
- if (!thread()) {
- if (QCoreApplication::instance())
- moveToThread(QCoreApplication::instance()->thread());
- else
- qWarning("The thread that had QDBusConnection('%s') has died and there is no main thread",
- qPrintable(name));
- }
+ Q_ASSERT(thread() == QDBusConnectionManager::instance());
+ Q_ASSERT(QThread::currentThread() == thread());
}
bool QDBusConnectionPrivate::handleError(const QDBusErrorInternal &error)
@@ -1134,45 +1083,20 @@ void QDBusConnectionPrivate::timerEvent(QTimerEvent *e)
doDispatch();
}
-void QDBusConnectionPrivate::customEvent(QEvent *e)
-{
- Q_ASSERT(e->type() == QEvent::User);
-
- QDBusConnectionCallbackEvent *ev = static_cast<QDBusConnectionCallbackEvent *>(e);
- QDBusLockerBase::reportThreadAction(int(AddTimeoutAction) + int(ev->subtype),
- QDBusLockerBase::BeforeDeliver, this);
- switch (ev->subtype)
- {
- case QDBusConnectionCallbackEvent::AddTimeout: {
- QDBusDispatchLocker locker(RealAddTimeoutAction, this);
- while (!timeoutsPendingAdd.isEmpty()) {
- QPair<DBusTimeout *, int> entry = timeoutsPendingAdd.takeFirst();
- qDBusRealAddTimeout(this, entry.first, entry.second);
- }
- break;
- }
-
- case QDBusConnectionCallbackEvent::KillTimer:
- killTimer(ev->timerId);
- break;
-
- case QDBusConnectionCallbackEvent::AddWatch:
- qDBusRealAddWatch(this, ev->watch, ev->extra, ev->fd);
- break;
-
- case QDBusConnectionCallbackEvent::ToggleWatch:
- qDBusRealToggleWatch(this, ev->watch, ev->fd);
- break;
- }
- QDBusLockerBase::reportThreadAction(int(AddTimeoutAction) + int(ev->subtype),
- QDBusLockerBase::AfterDeliver, this);
-}
-
void QDBusConnectionPrivate::doDispatch()
{
QDBusDispatchLocker locker(DoDispatchAction, this);
- if (mode == ClientMode || mode == PeerMode)
+ if (mode == ClientMode || mode == PeerMode) {
while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) ;
+ if (dispatchEnabled && !pendingMessages.isEmpty()) {
+ // dispatch previously queued messages
+ PendingMessageList::Iterator it = pendingMessages.begin();
+ PendingMessageList::Iterator end = pendingMessages.end();
+ for ( ; it != end; ++it)
+ handleMessage(qMove(*it));
+ pendingMessages.clear();
+ }
+ }
}
void QDBusConnectionPrivate::socketRead(int fd)
@@ -1212,7 +1136,7 @@ void QDBusConnectionPrivate::objectDestroyed(QObject *obj)
SignalHookHash::iterator sit = signalHooks.begin();
while (sit != signalHooks.end()) {
if (static_cast<QObject *>(sit.value().obj) == obj)
- sit = disconnectSignal(sit);
+ sit = removeSignalHookNoLock(sit);
else
++sit;
}
@@ -1593,10 +1517,7 @@ void QDBusConnectionPrivate::handleSignal(const QString &key, const QDBusMessage
for ( ; it != end && it.key() == key; ++it) {
const SignalHook &hook = it.value();
if (!hook.service.isEmpty()) {
- const QString owner =
- shouldWatchService(hook.service) ?
- watchedServices.value(hook.service).owner :
- hook.service;
+ QString owner = watchedServices.value(hook.service, WatchedServiceData(hook.service)).owner;
if (owner != msg.service())
continue;
}
@@ -1654,9 +1575,11 @@ void QDBusConnectionPrivate::handleSignal(const QDBusMessage& msg)
handleSignal(key, msg); // third try
}
-void QDBusConnectionPrivate::setServer(DBusServer *s, const QDBusErrorInternal &error)
+void QDBusConnectionPrivate::setServer(QDBusServer *object, DBusServer *s, const QDBusErrorInternal &error)
{
mode = ServerMode;
+ serverObject = object;
+ object->d = this;
if (!s) {
handleError(error);
return;
@@ -1730,7 +1653,7 @@ static QDBusConnection::ConnectionCapabilities connectionCapabilies(DBusConnecti
# if DBUS_VERSION-0 >= 0x010400
can_send_type = dbus_connection_can_send_type;
# endif
-#else
+#elif !defined(QT_NO_LIBRARY)
// run-time check if the next functions are available
can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
#endif
@@ -1784,6 +1707,15 @@ void QDBusConnectionPrivate::setConnection(DBusConnection *dbc, const QDBusError
Q_ASSERT(hook.midx != -1);
signalHooks.insert(QLatin1String("NameLost:" DBUS_INTERFACE_DBUS), hook);
+ // And initialize the hook for the NameOwnerChanged signal;
+ // we don't use connectSignal here because the rules are added by connectSignal on a per-need basis
+ hook.params.clear();
+ hook.params.reserve(4);
+ hook.params << QMetaType::Void << QVariant::String << QVariant::String << QVariant::String;
+ hook.midx = staticMetaObject.indexOfSlot("serviceOwnerChangedNoLock(QString,QString,QString)");
+ Q_ASSERT(hook.midx != -1);
+ signalHooks.insert(QLatin1String("NameOwnerChanged:" DBUS_INTERFACE_DBUS), hook);
+
qDBusDebug() << this << ": connected successfully";
// schedule a dispatch:
@@ -1800,34 +1732,6 @@ static void qDBusResultReceived(DBusPendingCall *pending, void *user_data)
}
}
-void QDBusConnectionPrivate::waitForFinished(QDBusPendingCallPrivate *pcall)
-{
- Q_ASSERT(pcall->pending);
- //Q_ASSERT(pcall->mutex.isLocked()); // there's no such function
-
- if (pcall->waitingForFinished) {
- // another thread is already waiting
- pcall->waitForFinishedCondition.wait(&pcall->mutex);
- } else {
- pcall->waitingForFinished = true;
- pcall->mutex.unlock();
-
- {
- QDBusDispatchLocker locker(PendingCallBlockAction, this);
- q_dbus_pending_call_block(pcall->pending);
- // QDBusConnectionPrivate::processFinishedCall() is called automatically
- }
- pcall->mutex.lock();
-
- if (pcall->pending) {
- q_dbus_pending_call_unref(pcall->pending);
- pcall->pending = 0;
- }
-
- pcall->waitForFinishedCondition.wakeAll();
- }
-}
-
void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
{
QDBusConnectionPrivate *connection = const_cast<QDBusConnectionPrivate *>(call->connection);
@@ -1843,7 +1747,7 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
msg = QDBusMessagePrivate::fromDBusMessage(reply, connection->capabilities);
q_dbus_message_unref(reply);
}
- qDBusDebug() << connection << "got message reply (async):" << msg;
+ qDBusDebug() << connection << "got message reply:" << msg;
// Check if the reply has the expected signature
call->checkReceivedSignature();
@@ -1865,17 +1769,18 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
qDBusDebug() << "Deliver failed!";
}
- if (call->pending && !call->waitingForFinished) {
+ if (call->pending) {
q_dbus_pending_call_unref(call->pending);
call->pending = 0;
}
- locker.unlock();
-
// Are there any watchers?
if (call->watcherHelper)
call->watcherHelper->emitSignals(msg, call->sentMessage);
+ call->waitForFinishedCondition.wakeAll();
+ locker.unlock();
+
if (msg.type() == QDBusMessage::ErrorMessage)
emit connection->callWithCallbackFailed(QDBusError(msg), call->sentMessage);
@@ -1883,10 +1788,10 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
delete call;
}
-int QDBusConnectionPrivate::send(const QDBusMessage& message)
+bool QDBusConnectionPrivate::send(const QDBusMessage& message)
{
if (QDBusMessagePrivate::isLocal(message))
- return -1; // don't send; the reply will be retrieved by the caller
+ return true; // don't send; the reply will be retrieved by the caller
// through the d_ptr->localReply link
QDBusError error;
@@ -1898,7 +1803,8 @@ int QDBusConnectionPrivate::send(const QDBusMessage& message)
qPrintable(message.interface()), qPrintable(message.member()),
qPrintable(error.message()));
else if (message.type() == QDBusMessage::SignalMessage)
- qWarning("QDBusConnection: error: could not send signal path \"%s\" interface \"%s\" member \"%s\": %s",
+ qWarning("QDBusConnection: error: could not send signal to service \"%s\" path \"%s\" interface \"%s\" member \"%s\": %s",
+ qPrintable(message.service()),
qPrintable(message.path()), qPrintable(message.interface()),
qPrintable(message.member()),
qPrintable(error.message()));
@@ -1909,24 +1815,13 @@ int QDBusConnectionPrivate::send(const QDBusMessage& message)
"invalid", qPrintable(message.service()),
qPrintable(error.message()));
lastError = error;
- return 0;
+ return false;
}
q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
-
qDBusDebug() << this << "sending message (no reply):" << message;
- checkThread();
- bool isOk;
- {
- QDBusDispatchLocker locker(SendMessageAction, this);
- isOk = q_dbus_connection_send(connection, msg, 0);
- }
- int serial = 0;
- if (isOk)
- serial = q_dbus_message_get_serial(msg);
-
- q_dbus_message_unref(msg);
- return serial;
+ emit messageNeedsSending(Q_NULLPTR, msg);
+ return true;
}
// small helper to note long running blocking dbus calls.
@@ -2018,49 +1913,12 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
{
QDBusBlockingCallWatcher watcher(message);
- checkThread();
- if ((sendMode == QDBus::BlockWithGui || sendMode == QDBus::Block)
- && isServiceRegisteredByThread(message.service()))
- // special case for synchronous local calls
- return sendWithReplyLocal(message);
-
- if (!QCoreApplication::instance() || sendMode == QDBus::Block) {
- QDBusError err;
- DBusMessage *msg = QDBusMessagePrivate::toDBusMessage(message, capabilities, &err);
- if (!msg) {
- qWarning("QDBusConnection: error: could not send message to service \"%s\" path \"%s\" interface \"%s\" member \"%s\": %s",
- qPrintable(message.service()), qPrintable(message.path()),
- qPrintable(message.interface()), qPrintable(message.member()),
- qPrintable(err.message()));
- lastError = err;
- return QDBusMessage::createError(err);
- }
+ QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, 0, 0, 0, timeout);
+ Q_ASSERT(pcall);
- qDBusDebug() << this << "sending message (blocking):" << message;
- QDBusErrorInternal error;
- DBusMessage *reply;
- {
- QDBusDispatchLocker locker(SendWithReplyAndBlockAction, this);
- reply = q_dbus_connection_send_with_reply_and_block(connection, msg, timeout, error);
- }
-
- q_dbus_message_unref(msg);
-
- if (!!error) {
- lastError = err = error;
- return QDBusMessage::createError(err);
- }
-
- QDBusMessage amsg = QDBusMessagePrivate::fromDBusMessage(reply, capabilities);
- q_dbus_message_unref(reply);
- qDBusDebug() << this << "got message reply (blocking):" << amsg;
-
- return amsg;
- } else { // use the event loop
- QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, 0, 0, 0, timeout);
- Q_ASSERT(pcall);
-
- if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) {
+ if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) {
+ // need to wait for the reply
+ if (sendMode == QDBus::BlockWithGui) {
pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
QEventLoop loop;
loop.connect(pcall->watcherHelper, SIGNAL(reply(QDBusMessage)), SLOT(quit()));
@@ -2068,18 +1926,17 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
// enter the event loop and wait for a reply
loop.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents);
+ } else {
+ pcall->waitForFinished();
}
+ }
- QDBusMessage reply = pcall->replyMessage;
- lastError = QDBusError(reply); // set or clear error
-
- bool r = pcall->ref.deref();
- Q_ASSERT(!r);
- Q_UNUSED(r);
+ QDBusMessage reply = pcall->replyMessage;
+ lastError = QDBusError(reply); // set or clear error
+ if (!pcall->ref.deref())
delete pcall;
- return reply;
- }
+ return reply;
}
QDBusMessage QDBusConnectionPrivate::sendWithReplyLocal(const QDBusMessage &message)
@@ -2119,34 +1976,13 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
QObject *receiver, const char *returnMethod,
const char *errorMethod, int timeout)
{
- if (isServiceRegisteredByThread(message.service())) {
+ QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
+ bool isLoopback;
+ if ((isLoopback = isServiceRegisteredByThread(message.service()))) {
// special case for local calls
- QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
pcall->replyMessage = sendWithReplyLocal(message);
- if (receiver && returnMethod)
- pcall->setReplyCallback(receiver, returnMethod);
-
- if (errorMethod) {
- pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
- connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
- Qt::QueuedConnection);
- pcall->watcherHelper->moveToThread(thread());
- }
-
- if ((receiver && returnMethod) || errorMethod) {
- // no one waiting, will delete pcall in processFinishedCall()
- pcall->ref.store(1);
- } else {
- // set double ref to prevent race between processFinishedCall() and ref counting
- // by QDBusPendingCall::QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
- pcall->ref.store(2);
- }
- processFinishedCall(pcall);
- return pcall;
}
- checkThread();
- QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
if (receiver && returnMethod)
pcall->setReplyCallback(receiver, returnMethod);
@@ -2166,6 +2002,12 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
pcall->ref.store(2);
}
+ if (isLoopback) {
+ // a loopback call
+ processFinishedCall(pcall);
+ return pcall;
+ }
+
QDBusError error;
DBusMessage *msg = QDBusMessagePrivate::toDBusMessage(message, capabilities, &error);
if (!msg) {
@@ -2176,14 +2018,27 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
pcall->replyMessage = QDBusMessage::createError(error);
lastError = error;
processFinishedCall(pcall);
- return pcall;
+ } else {
+ qDBusDebug() << this << "sending message:" << message;
+ emit messageNeedsSending(pcall, msg, timeout);
}
+ return pcall;
+}
- qDBusDebug() << this << "sending message (async):" << message;
+void QDBusConnectionPrivate::sendInternal(QDBusPendingCallPrivate *pcall, void *message, int timeout)
+{
+ QDBusError error;
DBusPendingCall *pending = 0;
+ DBusMessage *msg = static_cast<DBusMessage *>(message);
+ bool isNoReply = !pcall;
+ Q_ASSERT(isNoReply == !!q_dbus_message_get_no_reply(msg));
- QDBusDispatchLocker locker(SendWithReplyAsyncAction, this);
- if (q_dbus_connection_send_with_reply(connection, msg, &pending, timeout)) {
+ checkThread();
+ QDBusDispatchLocker locker(SendMessageAction, this);
+
+ if (isNoReply && q_dbus_connection_send(connection, msg, Q_NULLPTR)) {
+ // success
+ } else if (!isNoReply && q_dbus_connection_send_with_reply(connection, msg, &pending, timeout)) {
if (pending) {
q_dbus_message_unref(msg);
@@ -2194,7 +2049,7 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
if (mode == QDBusConnectionPrivate::PeerMode)
pendingCalls.append(pcall);
- return pcall;
+ return;
} else {
// we're probably disconnected at this point
lastError = error = QDBusError(QDBusError::Disconnected, QDBusUtil::disconnectedErrorMessage());
@@ -2204,9 +2059,10 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
}
q_dbus_message_unref(msg);
- pcall->replyMessage = QDBusMessage::createError(error);
- processFinishedCall(pcall);
- return pcall;
+ if (pcall) {
+ pcall->replyMessage = QDBusMessage::createError(error);
+ processFinishedCall(pcall);
+ }
}
bool QDBusConnectionPrivate::connectSignal(const QString &service,
@@ -2225,6 +2081,15 @@ bool QDBusConnectionPrivate::connectSignal(const QString &service,
if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0, false))
return false; // don't connect
+ Q_ASSERT(thread() != QThread::currentThread());
+ emit signalNeedsConnecting(key, hook);
+ return true;
+}
+
+void QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook &hook)
+{
+ QDBusWriteLocker locker(ConnectAction, this);
+
// avoid duplicating:
QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.constFind(key);
QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd();
@@ -2237,24 +2102,18 @@ bool QDBusConnectionPrivate::connectSignal(const QString &service,
entry.midx == hook.midx &&
entry.argumentMatch == hook.argumentMatch) {
// no need to compare the parameters if it's the same slot
- return true; // already there
+ return; // already there
}
}
- connectSignal(key, hook);
- return true;
-}
-
-void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook &hook)
-{
signalHooks.insertMulti(key, hook);
connect(hook.obj, SIGNAL(destroyed(QObject*)), SLOT(objectDestroyed(QObject*)),
- Qt::ConnectionType(Qt::DirectConnection | Qt::UniqueConnection));
+ Qt::ConnectionType(Qt::BlockingQueuedConnection | Qt::UniqueConnection));
- MatchRefCountHash::iterator it = matchRefCounts.find(hook.matchRule);
+ MatchRefCountHash::iterator mit = matchRefCounts.find(hook.matchRule);
- if (it != matchRefCounts.end()) { // Match already present
- it.value() = it.value() + 1;
+ if (mit != matchRefCounts.end()) { // Match already present
+ mit.value() = mit.value() + 1;
return;
}
@@ -2262,7 +2121,7 @@ void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook
if (connection) {
if (mode != QDBusConnectionPrivate::PeerMode) {
- qDBusDebug("Adding rule: %s", hook.matchRule.constData());
+ qDBusDebug() << this << "Adding rule:" << hook.matchRule;
q_dbus_bus_add_match(connection, hook.matchRule, NULL);
// Successfully connected the signal
@@ -2271,9 +2130,10 @@ void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook
WatchedServicesHash::mapped_type &data = watchedServices[hook.service];
if (++data.refcount == 1) {
// we need to watch for this service changing
- connectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
- QStringLiteral("NameOwnerChanged"), QStringList() << hook.service, QString(),
- this, SLOT(serviceOwnerChangedNoLock(QString,QString,QString)));
+ q_dbus_bus_add_match(connection,
+ buildMatchRule(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
+ QDBusUtil::nameOwnerChanged(), QStringList() << hook.service, QString()),
+ NULL);
data.owner = getNameOwnerNoCache(hook.service);
qDBusDebug() << this << "Watching service" << hook.service << "for owner changes (current owner:"
<< data.owner << ")";
@@ -2299,7 +2159,14 @@ bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0, false))
return false; // don't disconnect
- // avoid duplicating:
+ Q_ASSERT(thread() != QThread::currentThread());
+ return emit signalNeedsDisconnecting(key, hook);
+}
+
+bool QDBusConnectionPrivate::removeSignalHook(const QString &key, const SignalHook &hook)
+{
+ // remove it from our list:
+ QDBusWriteLocker locker(ConnectAction, this);
QDBusConnectionPrivate::SignalHookHash::Iterator it = signalHooks.find(key);
QDBusConnectionPrivate::SignalHookHash::Iterator end = signalHooks.end();
for ( ; it != end && it.key() == key; ++it) {
@@ -2311,7 +2178,7 @@ bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
entry.midx == hook.midx &&
entry.argumentMatch == hook.argumentMatch) {
// no need to compare the parameters if it's the same slot
- disconnectSignal(it);
+ removeSignalHookNoLock(it);
return true; // it was there
}
}
@@ -2321,7 +2188,7 @@ bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
}
QDBusConnectionPrivate::SignalHookHash::Iterator
-QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it)
+QDBusConnectionPrivate::removeSignalHookNoLock(SignalHookHash::Iterator it)
{
const SignalHook &hook = it.value();
@@ -2342,7 +2209,7 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it)
// we don't care about errors here
if (connection && erase) {
if (mode != QDBusConnectionPrivate::PeerMode) {
- qDBusDebug("Removing rule: %s", hook.matchRule.constData());
+ qDBusDebug() << this << "Removing rule:" << hook.matchRule;
q_dbus_bus_remove_match(connection, hook.matchRule, NULL);
// Successfully disconnected the signal
@@ -2351,9 +2218,10 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it)
if (sit != watchedServices.end()) {
if (--sit.value().refcount == 0) {
watchedServices.erase(sit);
- disconnectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
- QStringLiteral("NameOwnerChanged"), QStringList() << hook.service, QString(),
- this, SLOT(serviceOwnerChangedNoLock(QString,QString,QString)));
+ q_dbus_bus_remove_match(connection,
+ buildMatchRule(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
+ QDBusUtil::nameOwnerChanged(), QStringList() << hook.service, QString()),
+ NULL);
}
}
}
@@ -2366,7 +2234,7 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it)
void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node)
{
connect(node->obj, SIGNAL(destroyed(QObject*)), SLOT(objectDestroyed(QObject*)),
- Qt::DirectConnection);
+ Qt::ConnectionType(Qt::BlockingQueuedConnection | Qt::UniqueConnection));
if (node->flags & (QDBusConnection::ExportAdaptors
| QDBusConnection::ExportScriptableSignals
@@ -2420,21 +2288,8 @@ void QDBusConnectionPrivate::connectRelay(const QString &service,
QDBusAbstractInterface::staticMetaObject.methodCount(), true))
return; // don't connect
- // add it to our list:
- QDBusWriteLocker locker(ConnectRelayAction, this);
- SignalHookHash::ConstIterator it = signalHooks.constFind(key);
- SignalHookHash::ConstIterator end = signalHooks.constEnd();
- for ( ; it != end && it.key() == key; ++it) {
- const SignalHook &entry = it.value();
- if (entry.service == hook.service &&
- entry.path == hook.path &&
- entry.signature == hook.signature &&
- entry.obj == hook.obj &&
- entry.midx == hook.midx)
- return; // already there, no need to re-add
- }
-
- connectSignal(key, hook);
+ Q_ASSERT(thread() != QThread::currentThread());
+ emit signalNeedsConnecting(key, hook);
}
void QDBusConnectionPrivate::disconnectRelay(const QString &service,
@@ -2452,24 +2307,55 @@ void QDBusConnectionPrivate::disconnectRelay(const QString &service,
sig.append(signal.methodSignature());
if (!prepareHook(hook, key, service, path, interface, QString(), QStringList(), receiver, sig,
QDBusAbstractInterface::staticMetaObject.methodCount(), true))
- return; // don't connect
+ return; // don't disconnect
- // remove it from our list:
- QDBusWriteLocker locker(DisconnectRelayAction, this);
- SignalHookHash::Iterator it = signalHooks.find(key);
- SignalHookHash::Iterator end = signalHooks.end();
- for ( ; it != end && it.key() == key; ++it) {
- const SignalHook &entry = it.value();
- if (entry.service == hook.service &&
- entry.path == hook.path &&
- entry.signature == hook.signature &&
- entry.obj == hook.obj &&
- entry.midx == hook.midx) {
- // found it
- disconnectSignal(it);
- return;
- }
- }
+ Q_ASSERT(thread() != QThread::currentThread());
+ emit signalNeedsDisconnecting(key, hook);
+}
+
+bool QDBusConnectionPrivate::shouldWatchService(const QString &service)
+{
+ // we don't have to watch anything in peer mode
+ if (mode != ClientMode)
+ return false;
+ // we don't have to watch wildcard services (empty strings)
+ if (service.isEmpty())
+ return false;
+ // we don't have to watch the bus driver
+ if (service == QDBusUtil::dbusService())
+ return false;
+ return true;
+}
+
+/*!
+ Sets up a watch rule for service \a service for the change described by
+ mode \a mode. When the change happens, slot \a member in object \a obj will
+ be called.
+
+ The caller should call QDBusConnectionPrivate::shouldWatchService() before
+ calling this function to check whether the service needs to be watched at
+ all. Failing to do so may add rules that are never activated.
+*/
+void QDBusConnectionPrivate::watchService(const QString &service, QDBusServiceWatcher::WatchMode mode, QObject *obj, const char *member)
+{
+ QStringList matchArgs = matchArgsForService(service, mode);
+ connectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
+ matchArgs, QString(), obj, member);
+}
+
+/*!
+ Removes a watch rule set up by QDBusConnectionPrivate::watchService(). The
+ arguments to this function must be the same as the ones for that function.
+
+ Sets up a watch rule for service \a service for the change described by
+ mode \a mode. When the change happens, slot \a member in object \a obj will
+ be called.
+*/
+void QDBusConnectionPrivate::unwatchService(const QString &service, QDBusServiceWatcher::WatchMode mode, QObject *obj, const char *member)
+{
+ QStringList matchArgs = matchArgsForService(service, mode);
+ disconnectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
+ matchArgs, QString(), obj, member);
}
QString QDBusConnectionPrivate::getNameOwner(const QString& serviceName)
@@ -2498,9 +2384,21 @@ QString QDBusConnectionPrivate::getNameOwnerNoCache(const QString &serviceName)
QStringLiteral("GetNameOwner"));
QDBusMessagePrivate::setParametersValidated(msg, true);
msg << serviceName;
- QDBusMessage reply = sendWithReply(msg, QDBus::Block);
- if (reply.type() == QDBusMessage::ReplyMessage)
- return reply.arguments().at(0).toString();
+
+ QDBusPendingCallPrivate *pcall = sendWithReplyAsync(msg, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR);
+ if (thread() == QThread::currentThread()) {
+ // this function may be called in our own thread and
+ // QDBusPendingCallPrivate::waitForFinished() would deadlock there
+ q_dbus_pending_call_block(pcall->pending);
+ }
+ pcall->waitForFinished();
+ msg = pcall->replyMessage;
+
+ if (!pcall->ref.deref())
+ delete pcall;
+
+ if (msg.type() == QDBusMessage::ReplyMessage)
+ return msg.arguments().at(0).toString();
return QString();
}
diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
index 3e4f79c43c..62106e4c0b 100644
--- a/src/dbus/qdbusintegrator_p.h
+++ b/src/dbus/qdbusintegrator_p.h
@@ -50,7 +50,6 @@
#include "qcoreevent.h"
#include "qeventloop.h"
-#include "qhash.h"
#include "qobject.h"
#include "private/qobject_p.h"
#include "qlist.h"
@@ -77,10 +76,21 @@ struct QDBusSlotCache
int flags;
int slotIdx;
QVector<int> metaTypes;
+
+ void swap(Data &other) Q_DECL_NOTHROW
+ {
+ qSwap(flags, other.flags);
+ qSwap(slotIdx, other.slotIdx);
+ qSwap(metaTypes, other.metaTypes);
+ }
};
typedef QMultiHash<QString, Data> Hash;
Hash hash;
+
+ void swap(QDBusSlotCache &other) Q_DECL_NOTHROW { qSwap(hash, other.hash); }
};
+Q_DECLARE_SHARED(QDBusSlotCache::Data)
+Q_DECLARE_SHARED(QDBusSlotCache)
class QDBusCallDeliveryEvent: public QMetaCallEvent
{
@@ -123,29 +133,6 @@ private:
bool handled;
};
-class QDBusConnectionCallbackEvent : public QEvent
-{
-public:
- QDBusConnectionCallbackEvent()
- : QEvent(User), subtype(Subtype(0))
- { }
-
- DBusWatch *watch;
- union {
- int timerId;
- int fd;
- };
- int extra;
-
- enum Subtype {
- AddTimeout = 0,
- KillTimer,
- AddWatch,
- //RemoveWatch,
- ToggleWatch
- } subtype;
-};
-
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QDBusSlotCache)
diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp
index 1fc313d8cc..421fc0bdb6 100644
--- a/src/dbus/qdbusinterface.cpp
+++ b/src/dbus/qdbusinterface.cpp
@@ -278,6 +278,7 @@ int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv)
// we will assume that the input arguments were passed correctly
QVariantList args;
+ args.reserve(inputTypesCount);
int i = 1;
for ( ; i <= inputTypesCount; ++i)
args << QVariant(inputTypes[i], argv[i]);
diff --git a/src/dbus/qdbusinterface.h b/src/dbus/qdbusinterface.h
index b63df10763..b48a206644 100644
--- a/src/dbus/qdbusinterface.h
+++ b/src/dbus/qdbusinterface.h
@@ -52,7 +52,7 @@ private:
public:
QDBusInterface(const QString &service, const QString &path, const QString &interface = QString(),
const QDBusConnection &connection = QDBusConnection::sessionBus(),
- QObject *parent = 0);
+ QObject *parent = Q_NULLPTR);
~QDBusInterface();
virtual const QMetaObject *metaObject() const Q_DECL_OVERRIDE;
diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp
index d9e5f7408b..fd6f91e65a 100644
--- a/src/dbus/qdbusinternalfilters.cpp
+++ b/src/dbus/qdbusinternalfilters.cpp
@@ -366,6 +366,9 @@ static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant
value = other;
}
+ if (mp.userType() == qMetaTypeId<QDBusVariant>())
+ value = QVariant::fromValue(QDBusVariant(value));
+
// the property type here should match
return mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;
}
diff --git a/src/dbus/qdbusintrospection_p.h b/src/dbus/qdbusintrospection_p.h
index ce3be00733..f34e336eb3 100644
--- a/src/dbus/qdbusintrospection_p.h
+++ b/src/dbus/qdbusintrospection_p.h
@@ -46,7 +46,7 @@
//
#include <QtCore/qstring.h>
-#include <QtCore/qlist.h>
+#include <QtCore/qvector.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qmap.h>
#include <QtCore/qpair.h>
@@ -71,7 +71,7 @@ public:
// typedefs
typedef QMap<QString, QString> Annotations;
- typedef QList<Argument> Arguments;
+ typedef QVector<Argument> Arguments;
typedef QMultiMap<QString, Method> Methods;
typedef QMultiMap<QString, Signal> Signals;
typedef QMap<QString, Property> Properties;
diff --git a/src/dbus/qdbusmacros.h b/src/dbus/qdbusmacros.h
index 1f774b0f08..2a1d0a22d7 100644
--- a/src/dbus/qdbusmacros.h
+++ b/src/dbus/qdbusmacros.h
@@ -45,7 +45,9 @@
#ifdef Q_CC_MSVC
#include <QtCore/qlist.h>
#include <QtCore/qset.h>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/qhash.h>
+#endif
#include <QtCore/qvector.h>
#endif
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp
index b92e7f5cd7..32b7787514 100644
--- a/src/dbus/qdbusmessage.cpp
+++ b/src/dbus/qdbusmessage.cpp
@@ -153,8 +153,10 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDB
}
break;
case QDBusMessage::SignalMessage:
- // nothing can be empty here
+ // only the service name can be empty here
if (!d_ptr->parametersValidated) {
+ if (!QDBusUtil::checkBusName(d_ptr->service, QDBusUtil::EmptyAllowed, error))
+ return 0;
if (!QDBusUtil::checkObjectPath(d_ptr->path, QDBusUtil::EmptyNotAllowed, error))
return 0;
if (!QDBusUtil::checkInterfaceName(d_ptr->interface, QDBusUtil::EmptyAllowed, error))
@@ -165,6 +167,7 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDB
msg = q_dbus_message_new_signal(d_ptr->path.toUtf8(), d_ptr->interface.toUtf8(),
d_ptr->name.toUtf8());
+ q_dbus_message_set_destination(msg, data(d_ptr->service.toUtf8()));
break;
}
@@ -372,6 +375,31 @@ QDBusMessage QDBusMessage::createSignal(const QString &path, const QString &inte
}
/*!
+ \since 5.6
+
+ Constructs a new DBus message with the given \a path, \a interface
+ and \a name, representing a signal emission to a specific destination.
+
+ A DBus signal is emitted from one application and is received only by
+ the application owning the destination \a service name.
+
+ The QDBusMessage object that is returned can be sent using the
+ QDBusConnection::send() function.
+*/
+QDBusMessage QDBusMessage::createTargetedSignal(const QString &service, const QString &path,
+ const QString &interface, const QString &name)
+{
+ QDBusMessage message;
+ message.d_ptr->type = SignalMessage;
+ message.d_ptr->service = service;
+ message.d_ptr->path = path;
+ message.d_ptr->interface = interface;
+ message.d_ptr->name = name;
+
+ return message;
+}
+
+/*!
Constructs a new DBus message representing a method call.
A method call always informs its destination address
(\a service, \a path, \a interface and \a method).
diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h
index 77f34ec5e2..e85d600080 100644
--- a/src/dbus/qdbusmessage.h
+++ b/src/dbus/qdbusmessage.h
@@ -62,11 +62,18 @@ public:
QDBusMessage();
QDBusMessage(const QDBusMessage &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDBusMessage &operator=(QDBusMessage &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QDBusMessage &operator=(const QDBusMessage &other);
~QDBusMessage();
+ void swap(QDBusMessage &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); }
+
static QDBusMessage createSignal(const QString &path, const QString &interface,
const QString &name);
+ static QDBusMessage createTargetedSignal(const QString &service, const QString &path,
+ const QString &interface, const QString &name);
static QDBusMessage createMethodCall(const QString &destination, const QString &path,
const QString &interface, const QString &method);
static QDBusMessage createError(const QString &name, const QString &msg);
@@ -115,6 +122,7 @@ private:
friend class QDBusMessagePrivate;
QDBusMessagePrivate *d_ptr;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusMessage)
#ifndef QT_NO_DEBUG_STREAM
Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &);
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index 09eff81107..c93d6acf84 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -180,7 +181,6 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb
void QDBusPendingCallPrivate::setMetaTypes(int count, const int *types)
{
- expectedReplyCount = count;
if (count == 0) {
expectedReplySignature = QLatin1String(""); // not null
return;
@@ -231,7 +231,7 @@ void QDBusPendingCallPrivate::waitForFinished()
if (replyMessage.type() != QDBusMessage::InvalidMessage)
return; // already finished
- connection->waitForFinished(this);
+ waitForFinishedCondition.wait(&mutex);
}
/*!
diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h
index 99d261d05b..d7d68825be 100644
--- a/src/dbus/qdbuspendingcall.h
+++ b/src/dbus/qdbuspendingcall.h
@@ -56,9 +56,12 @@ class Q_DBUS_EXPORT QDBusPendingCall
public:
QDBusPendingCall(const QDBusPendingCall &other);
~QDBusPendingCall();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDBusPendingCall &operator=(QDBusPendingCall &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QDBusPendingCall &operator=(const QDBusPendingCall &other);
- void swap(QDBusPendingCall &other) { qSwap(d, other.d); }
+ void swap(QDBusPendingCall &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
#ifndef Q_QDOC
// pretend that they aren't here
@@ -93,7 +96,7 @@ class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPending
{
Q_OBJECT
public:
- explicit QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent = 0);
+ explicit QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent = Q_NULLPTR);
~QDBusPendingCallWatcher();
#ifdef Q_QDOC
@@ -103,7 +106,7 @@ public:
void waitForFinished(); // non-virtual override
Q_SIGNALS:
- void finished(QDBusPendingCallWatcher *self);
+ void finished(QDBusPendingCallWatcher *self = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QDBusPendingCallWatcher)
diff --git a/src/dbus/qdbuspendingcall_p.h b/src/dbus/qdbuspendingcall_p.h
index ac39487fee..571a0eb028 100644
--- a/src/dbus/qdbuspendingcall_p.h
+++ b/src/dbus/qdbuspendingcall_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -88,12 +89,10 @@ public:
QDBusMessage replyMessage;
DBusPendingCall *pending;
QString expectedReplySignature;
- int expectedReplyCount;
- bool waitingForFinished;
// }
QDBusPendingCallPrivate(const QDBusMessage &sent, QDBusConnectionPrivate *connection)
- : sentMessage(sent), connection(connection), watcherHelper(0), pending(0), waitingForFinished(false)
+ : sentMessage(sent), connection(connection), watcherHelper(0), pending(0)
{ }
~QDBusPendingCallPrivate();
bool setReplyCallback(QObject *target, const char *member);
diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h
index 56830f698a..4cfe8db161 100644
--- a/src/dbus/qdbusreply.h
+++ b/src/dbus/qdbusreply.h
@@ -125,7 +125,7 @@ private:
template<> inline QDBusReply<QVariant>&
QDBusReply<QVariant>::operator=(const QDBusMessage &reply)
{
- void *null = 0;
+ void *null = Q_NULLPTR;
QVariant data(qMetaTypeId<QDBusVariant>(), null);
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<QDBusVariant>(data).variant();
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
index cf1b6e9665..babb270da0 100644
--- a/src/dbus/qdbusserver.cpp
+++ b/src/dbus/qdbusserver.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -53,22 +54,17 @@ QT_BEGIN_NAMESPACE
\a parent.
*/
QDBusServer::QDBusServer(const QString &address, QObject *parent)
- : QObject(parent)
+ : QObject(parent), d(0)
{
if (address.isEmpty())
return;
- if (!qdbus_loadLibDBus()) {
- d = 0;
+ if (!qdbus_loadLibDBus())
return;
- }
- d = new QDBusConnectionPrivate(this);
- QObject::connect(d, SIGNAL(newServerConnection(QDBusConnection)),
- this, SIGNAL(newConnection(QDBusConnection)));
-
- QDBusErrorInternal error;
- d->setServer(q_dbus_server_listen(address.toUtf8().constData(), error), error);
+ emit QDBusConnectionManager::instance()->serverRequested(address, this);
+ QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
+ this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
}
/*!
@@ -81,22 +77,19 @@ QDBusServer::QDBusServer(QObject *parent)
{
#ifdef Q_OS_UNIX
// Use Unix sockets on Unix systems only
- static const char address[] = "unix:tmpdir=/tmp";
+ const QString address = QStringLiteral("unix:tmpdir=/tmp");
#else
- static const char address[] = "tcp:";
+ const QString address = QStringLiteral("tcp:");
#endif
if (!qdbus_loadLibDBus()) {
d = 0;
return;
}
- d = new QDBusConnectionPrivate(this);
-
- QObject::connect(d, SIGNAL(newServerConnection(QDBusConnection)),
- this, SIGNAL(newConnection(QDBusConnection)));
- QDBusErrorInternal error;
- d->setServer(q_dbus_server_listen(address, error), error);
+ emit QDBusConnectionManager::instance()->serverRequested(address, this);
+ QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
+ this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
}
/*!
@@ -186,4 +179,6 @@ bool QDBusServer::isAnonymousAuthenticationAllowed() const
QT_END_NAMESPACE
+#include "moc_qdbusserver.cpp"
+
#endif // QT_NO_DBUS
diff --git a/src/dbus/qdbusserver.h b/src/dbus/qdbusserver.h
index cdd531802a..3cb2ec8c50 100644
--- a/src/dbus/qdbusserver.h
+++ b/src/dbus/qdbusserver.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -50,8 +51,8 @@ class Q_DBUS_EXPORT QDBusServer: public QObject
{
Q_OBJECT
public:
- explicit QDBusServer(const QString &address, QObject *parent = 0);
- explicit QDBusServer(QObject *parent = 0);
+ explicit QDBusServer(const QString &address, QObject *parent = Q_NULLPTR);
+ explicit QDBusServer(QObject *parent = Q_NULLPTR);
virtual ~QDBusServer();
bool isConnected() const;
@@ -66,7 +67,9 @@ Q_SIGNALS:
private:
Q_DISABLE_COPY(QDBusServer)
+ Q_PRIVATE_SLOT(d, void _q_newConnection(QDBusConnectionPrivate*))
QDBusConnectionPrivate *d;
+ friend class QDBusConnectionPrivate;
};
QT_END_NAMESPACE
diff --git a/src/dbus/qdbusservicewatcher.cpp b/src/dbus/qdbusservicewatcher.cpp
index 4adf049d17..72c1a12f2c 100644
--- a/src/dbus/qdbusservicewatcher.cpp
+++ b/src/dbus/qdbusservicewatcher.cpp
@@ -38,6 +38,7 @@
#include <QStringList>
#include <private/qobject_p.h>
+#include <private/qdbusconnection_p.h>
#ifndef QT_NO_DBUS
@@ -59,7 +60,6 @@ public:
void _q_serviceOwnerChanged(const QString &, const QString &, const QString &);
void setConnection(const QStringList &services, const QDBusConnection &c, QDBusServiceWatcher::WatchMode watchMode);
- QStringList matchArgsForService(const QString &service);
void addService(const QString &service);
void removeService(const QString &service);
};
@@ -93,40 +93,18 @@ void QDBusServiceWatcherPrivate::setConnection(const QStringList &s, const QDBus
}
}
-QStringList QDBusServiceWatcherPrivate::matchArgsForService(const QString &service)
-{
- QStringList matchArgs;
- matchArgs << service;
-
- switch (watchMode) {
- case QDBusServiceWatcher::WatchForOwnerChange:
- break;
-
- case QDBusServiceWatcher::WatchForRegistration:
- matchArgs << QString::fromLatin1("", 0);
- break;
-
- case QDBusServiceWatcher::WatchForUnregistration:
- matchArgs << QString() << QString::fromLatin1("", 0);
- break;
- }
- return matchArgs;
-}
-
void QDBusServiceWatcherPrivate::addService(const QString &service)
{
- QStringList matchArgs = matchArgsForService(service);
- connection.connect(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
- matchArgs, QString(), q_func(),
- SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
+ QDBusConnectionPrivate *d = QDBusConnectionPrivate::d(connection);
+ if (d && d->shouldWatchService(service))
+ d->watchService(service, watchMode, q_func(), SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
}
void QDBusServiceWatcherPrivate::removeService(const QString &service)
{
- QStringList matchArgs = matchArgsForService(service);
- connection.disconnect(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
- matchArgs, QString(), q_func(),
- SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
+ QDBusConnectionPrivate *d = QDBusConnectionPrivate::d(connection);
+ if (d && d->shouldWatchService(service))
+ d->unwatchService(service, watchMode, q_func(), SLOT(_q_serviceOwnerChanged(QString,QString,QString)));
}
/*!
diff --git a/src/dbus/qdbusservicewatcher.h b/src/dbus/qdbusservicewatcher.h
index 020ce13c30..71c0f0af68 100644
--- a/src/dbus/qdbusservicewatcher.h
+++ b/src/dbus/qdbusservicewatcher.h
@@ -37,7 +37,7 @@
#include <QtCore/qobject.h>
#include <QtDBus/qdbusmacros.h>
-#ifndef QT_NO_DBUS
+#if !defined(QT_NO_DBUS) && !defined(QT_NO_QOBJECT)
QT_BEGIN_NAMESPACE
@@ -58,9 +58,9 @@ public:
};
Q_DECLARE_FLAGS(WatchMode, WatchModeFlag)
- explicit QDBusServiceWatcher(QObject *parent = 0);
+ explicit QDBusServiceWatcher(QObject *parent = Q_NULLPTR);
QDBusServiceWatcher(const QString &service, const QDBusConnection &connection,
- WatchMode watchMode = WatchForOwnerChange, QObject *parent = 0);
+ WatchMode watchMode = WatchForOwnerChange, QObject *parent = Q_NULLPTR);
~QDBusServiceWatcher();
QStringList watchedServices() const;
@@ -89,5 +89,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusServiceWatcher::WatchMode)
QT_END_NAMESPACE
-#endif // QT_NO_DBUS
+#endif // QT_NO_DBUS || QT_NO_QOBJECT
#endif // QDBUSSERVICEWATCHER_H
diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h
index a8e126cf73..420f062615 100644
--- a/src/dbus/qdbusthreaddebug_p.h
+++ b/src/dbus/qdbusthreaddebug_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -82,13 +83,12 @@ enum ThreadAction {
HandleObjectCallPostEventAction = 22,
HandleObjectCallSemaphoreAction = 23,
DoDispatchAction = 24,
- SendWithReplyAsyncAction = 25,
+ SetDispatchEnabledAction = 25,
MessageResultReceivedAction = 26,
ActivateSignalAction = 27,
PendingCallBlockAction = 28,
SendMessageAction = 29,
- SendWithReplyAndBlockAction = 30,
- HuntAndEmitAction = 31,
+ HuntAndEmitAction = 30,
AddTimeoutAction = 50,
RealAddTimeoutAction = 51,
diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h
index 35e9d87cf3..9fb6eb44c7 100644
--- a/src/dbus/qdbusunixfiledescriptor.h
+++ b/src/dbus/qdbusunixfiledescriptor.h
@@ -55,10 +55,13 @@ public:
QDBusUnixFileDescriptor();
explicit QDBusUnixFileDescriptor(int fileDescriptor);
QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other);
+#if defined(Q_COMPILER_RVALUE_REFS)
+ QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other);
~QDBusUnixFileDescriptor();
- void swap(QDBusUnixFileDescriptor &other)
+ void swap(QDBusUnixFileDescriptor &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
bool isValid() const;
@@ -71,11 +74,6 @@ public:
static bool isSupported();
-#if defined(Q_COMPILER_RVALUE_REFS)
- inline QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other)
- { d.swap(other.d); return *this; }
-#endif
-
protected:
typedef QExplicitlySharedDataPointer<QDBusUnixFileDescriptorPrivate> Data;
Data d;
diff --git a/src/dbus/qdbusvirtualobject.h b/src/dbus/qdbusvirtualobject.h
index 469c41f363..740c5f712e 100644
--- a/src/dbus/qdbusvirtualobject.h
+++ b/src/dbus/qdbusvirtualobject.h
@@ -51,7 +51,7 @@ class Q_DBUS_EXPORT QDBusVirtualObject : public QObject
{
Q_OBJECT
public:
- explicit QDBusVirtualObject(QObject *parent = 0);
+ explicit QDBusVirtualObject(QObject *parent = Q_NULLPTR);
virtual ~QDBusVirtualObject();
virtual QString introspect(const QString &path) const = 0;
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index e0ebcd18ce..1a8d263f94 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -443,14 +443,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QAccessibleInterface::~QAccessibleInterface()
-
- Destroys the object.
+ Destroys the QAccessibleInterface.
*/
+QAccessibleInterface::~QAccessibleInterface()
+{
+}
/*!
\typedef QAccessible::Id
- \relates QAccessible
Synonym for unsigned, used by the QAccessibleInterface cache.
*/
@@ -461,12 +461,12 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QAccessibleFactoryInterface_iid, QLatin1String("/accessible")))
+typedef QHash<QString, QAccessiblePlugin*> QAccessiblePluginsHash;
+Q_GLOBAL_STATIC(QAccessiblePluginsHash, qAccessiblePlugins)
#endif
// FIXME turn this into one global static struct
Q_GLOBAL_STATIC(QList<QAccessible::InterfaceFactory>, qAccessibleFactories)
-typedef QHash<QString, QAccessiblePlugin*> QAccessiblePluginsHash;
-Q_GLOBAL_STATIC(QAccessiblePluginsHash, qAccessiblePlugins)
Q_GLOBAL_STATIC(QList<QAccessible::ActivationObserver *>, qAccessibleActivationObservers)
QAccessible::UpdateHandler QAccessible::updateHandler = 0;
@@ -608,6 +608,11 @@ QAccessible::RootObjectHandler QAccessible::installRootObjectHandler(RootObjectH
\sa installActivationObserver()
*/
+QAccessible::ActivationObserver::~ActivationObserver()
+{
+ // must be empty until ### Qt 6
+}
+
/*!
\internal
@@ -847,18 +852,17 @@ void QAccessible::updateAccessibility(QAccessibleEvent *event)
// during construction of widgets. If you see cases where the
// cache seems wrong, this call is "to blame", but the code that
// caches dynamic data should be updated to handle change events.
- if (!isActive() || !event->accessibleInterface())
- return;
-
- if (event->type() == QAccessible::TableModelChanged) {
- QAccessibleInterface *iface = event->accessibleInterface();
- if (iface && iface->tableInterface())
- iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event));
- }
+ QAccessibleInterface *iface = event->accessibleInterface();
+ if (isActive() && iface) {
+ if (event->type() == QAccessible::TableModelChanged) {
+ if (iface->tableInterface())
+ iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event));
+ }
- if (updateHandler) {
- updateHandler(event);
- return;
+ if (updateHandler) {
+ updateHandler(event);
+ return;
+ }
}
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
@@ -1254,10 +1258,6 @@ QColor QAccessibleInterface::backgroundColor() const
return QColor();
}
-QAccessibleInterface::~QAccessibleInterface()
-{
-}
-
/*!
\fn QAccessibleTextInterface *QAccessibleInterface::textInterface()
*/
@@ -1329,9 +1329,13 @@ QAccessibleInterface::~QAccessibleInterface()
the overload taking a \l QObject parameter as it might be cheaper.
*/
-/*! \fn QAccessibleEvent::~QAccessibleEvent()
+/*!
Destroys the event.
*/
+QAccessibleEvent::~QAccessibleEvent()
+{
+ // must be empty until ### Qt 6
+}
/*! \fn QAccessible::Event QAccessibleEvent::type() const
Returns the event type.
@@ -1400,6 +1404,13 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
Returns the new value of the accessible object of this event.
*/
+/*!
+ \internal
+*/
+QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent()
+{
+ // must be empty until ### Qt 6
+}
/*!
\class QAccessibleStateChangeEvent
@@ -1437,7 +1448,13 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
other hand tells about the change and has focused set to \c true since
the focus state is changed from \c true to \c false.
*/
-
+/*!
+ \internal
+*/
+QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent()
+{
+ // must be empty until ### Qt 6
+}
/*!
\class QAccessibleTableModelChangeEvent
@@ -1512,7 +1529,14 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
change type \a changeType.
*/
/*!
- \class QAccessibleTextCursorEvent
+ \internal
+*/
+QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent()
+{
+ // must be empty until ### Qt 6
+}
+/*!
+ \class QAccessibleTextCursorEvent
\ingroup accessibility
\inmodule QtGui
@@ -1533,6 +1557,14 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
Sets the cursor \a position for this event.
*/
+/*!
+ \internal
+*/
+QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent()
+{
+ // must be empty until ### Qt 6
+}
+
/*!
\fn QAccessibleTextCursorEvent(QAccessibleInterface *iface, int cursorPos)
@@ -1566,6 +1598,14 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
Returns the text that has been inserted.
*/
+/*!
+ \internal
+*/
+QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent()
+{
+ // must be empty until ### Qt 6
+}
+
/*!
\class QAccessibleTextRemoveEvent
@@ -1602,6 +1642,14 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
Returns the text that has been removed.
*/
/*!
+ \internal
+*/
+QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent()
+{
+ // must be empty until ### Qt 6
+}
+
+/*!
\fn QAccessibleTextSelectionEvent::QAccessibleTextSelectionEvent(QAccessibleInterface *iface, int start, int end)
Constructs a new QAccessibleTextSelectionEvent for \a iface. The new selection this
@@ -1655,6 +1703,14 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
Returns the removed text.
*/
+/*!
+ \internal
+*/
+QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent()
+{
+ // must be empty until ### Qt 6
+}
+
/*!
\class QAccessibleTextSelectionEvent
@@ -1682,6 +1738,13 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
Sets the selection for this event from position \a start to \a end.
*/
+/*!
+ \internal
+*/
+QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent()
+{
+ // must be empty until ### Qt 6
+}
@@ -1920,10 +1983,13 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
*/
/*!
- \fn QAccessibleTextInterface::~QAccessibleTextInterface()
Destroys the QAccessibleTextInterface.
*/
+QAccessibleTextInterface::~QAccessibleTextInterface()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn void QAccessibleTextInterface::addSelection(int startOffset, int endOffset)
@@ -2306,10 +2372,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
- \fn QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface()
Destroys the QAccessibleEditableTextInterface.
*/
+QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn void QAccessibleEditableTextInterface::deleteText(int startOffset, int endOffset)
@@ -2348,10 +2417,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
- \fn QAccessibleValueInterface::~QAccessibleValueInterface()
+ Destroys the QAccessibleValueInterface.
- Destructor.
*/
+QAccessibleValueInterface::~QAccessibleValueInterface()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn QVariant QAccessibleValueInterface::currentValue() const
@@ -2410,6 +2482,14 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
+ Destroys the QAccessibleImageInterface.
+*/
+QAccessibleImageInterface::~QAccessibleImageInterface()
+{
+ // must be empty until ### Qt 6
+}
+
+/*!
\class QAccessibleTableCellInterface
\inmodule QtGui
\ingroup accessibility
@@ -2421,10 +2501,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
- \fn virtual QAccessibleTableCellInterface::~QAccessibleTableCellInterface()
Destroys the QAccessibleTableCellInterface.
*/
+QAccessibleTableCellInterface::~QAccessibleTableCellInterface()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn virtual int QAccessibleTableCellInterface::columnExtent() const
@@ -2486,10 +2569,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
- \fn virtual QAccessibleTableInterface::~QAccessibleTableInterface()
Destroys the QAccessibleTableInterface.
*/
+QAccessibleTableInterface::~QAccessibleTableInterface()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn virtual QAccessibleInterface *QAccessibleTableInterface::cellAt(int row, int column) const
@@ -2659,10 +2745,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
- \fn QAccessibleActionInterface::~QAccessibleActionInterface()
Destroys the QAccessibleActionInterface.
*/
+QAccessibleActionInterface::~QAccessibleActionInterface()
+{
+ // must be empty until ### Qt 6
+}
/*!
\fn QStringList QAccessibleActionInterface::actionNames() const
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index bfe1e6c542..63658260fc 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -396,10 +396,10 @@ public:
static UpdateHandler installUpdateHandler(UpdateHandler);
static RootObjectHandler installRootObjectHandler(RootObjectHandler);
- class ActivationObserver
+ class Q_GUI_EXPORT ActivationObserver
{
public:
- virtual ~ActivationObserver() {}
+ virtual ~ActivationObserver();
virtual void accessibilityActiveChanged(bool active) = 0;
};
static void installActivationObserver(ActivationObserver *);
@@ -505,7 +505,7 @@ public:
virtual void virtual_hook(int id, void *data);
virtual void *interface_cast(QAccessible::InterfaceType)
- { return 0; }
+ { return Q_NULLPTR; }
protected:
friend class QAccessibleCache;
@@ -514,7 +514,7 @@ protected:
class Q_GUI_EXPORT QAccessibleTextInterface
{
public:
- virtual ~QAccessibleTextInterface() {}
+ virtual ~QAccessibleTextInterface();
// selection
virtual void selection(int selectionIndex, int *startOffset, int *endOffset) const = 0;
virtual int selectionCount() const = 0;
@@ -547,7 +547,7 @@ public:
class Q_GUI_EXPORT QAccessibleEditableTextInterface
{
public:
- virtual ~QAccessibleEditableTextInterface() {}
+ virtual ~QAccessibleEditableTextInterface();
virtual void deleteText(int startOffset, int endOffset) = 0;
virtual void insertText(int offset, const QString &text) = 0;
@@ -557,8 +557,7 @@ public:
class Q_GUI_EXPORT QAccessibleValueInterface
{
public:
-
- virtual ~QAccessibleValueInterface() {}
+ virtual ~QAccessibleValueInterface();
virtual QVariant currentValue() const = 0;
virtual void setCurrentValue(const QVariant &value) = 0;
@@ -570,7 +569,7 @@ public:
class Q_GUI_EXPORT QAccessibleTableCellInterface
{
public:
- virtual ~QAccessibleTableCellInterface() {}
+ virtual ~QAccessibleTableCellInterface();
virtual bool isSelected() const = 0;
@@ -587,7 +586,7 @@ public:
class Q_GUI_EXPORT QAccessibleTableInterface
{
public:
- virtual ~QAccessibleTableInterface() {}
+ virtual ~QAccessibleTableInterface();
virtual QAccessibleInterface *caption() const = 0;
virtual QAccessibleInterface *summary() const = 0;
@@ -622,7 +621,7 @@ class Q_GUI_EXPORT QAccessibleActionInterface
{
Q_DECLARE_TR_FUNCTIONS(QAccessibleActionInterface)
public:
- virtual ~QAccessibleActionInterface() {}
+ virtual ~QAccessibleActionInterface();
virtual QStringList actionNames() const = 0;
virtual QString localizedActionName(const QString &name) const;
@@ -647,7 +646,7 @@ public:
class Q_GUI_EXPORT QAccessibleImageInterface
{
public:
- virtual ~QAccessibleImageInterface() {}
+ virtual ~QAccessibleImageInterface();
virtual QString imageDescription() const = 0;
virtual QSize imageSize() const = 0;
@@ -677,7 +676,7 @@ public:
}
inline QAccessibleEvent(QAccessibleInterface *iface, QAccessible::Event typ)
- : m_type(typ), m_object(0)
+ : m_type(typ), m_object(Q_NULLPTR)
{
Q_ASSERT(iface);
Q_ASSERT(m_type != QAccessible::ValueChanged);
@@ -691,8 +690,7 @@ public:
m_uniqueId = QAccessible::uniqueId(iface);
}
- virtual ~QAccessibleEvent()
- {}
+ virtual ~QAccessibleEvent();
QAccessible::Event type() const { return m_type; }
QObject *object() const { return m_object; }
@@ -726,6 +724,7 @@ public:
{
m_type = QAccessible::StateChanged;
}
+ ~QAccessibleStateChangeEvent();
QAccessible::State changedStates() const {
return m_changedStates;
@@ -752,6 +751,8 @@ public:
m_type = QAccessible::TextCaretMoved;
}
+ ~QAccessibleTextCursorEvent();
+
void setCursorPosition(int position) { m_cursorPosition = position; }
int cursorPosition() const { return m_cursorPosition; }
@@ -776,6 +777,8 @@ public:
m_type = QAccessible::TextSelectionChanged;
}
+ ~QAccessibleTextSelectionEvent();
+
void setSelection(int start, int end) {
m_selectionStart = start;
m_selectionEnd = end;
@@ -805,6 +808,8 @@ public:
m_type = QAccessible::TextInserted;
}
+ ~QAccessibleTextInsertEvent();
+
QString textInserted() const {
return m_text;
}
@@ -833,6 +838,8 @@ public:
m_type = QAccessible::TextRemoved;
}
+ ~QAccessibleTextRemoveEvent();
+
QString textRemoved() const {
return m_text;
}
@@ -860,6 +867,9 @@ public:
{
m_type = QAccessible::TextUpdated;
}
+
+ ~QAccessibleTextUpdateEvent();
+
QString textRemoved() const {
return m_oldText;
}
@@ -892,6 +902,8 @@ public:
m_type = QAccessible::ValueChanged;
}
+ ~QAccessibleValueChangeEvent();
+
void setValue(const QVariant & val) { m_value= val; }
QVariant value() const { return m_value; }
@@ -926,6 +938,8 @@ public:
m_type = QAccessible::TableModelChanged;
}
+ ~QAccessibleTableModelChangeEvent();
+
void setModelChangeType(ModelChangeType changeType) { m_modelChangeType = changeType; }
ModelChangeType modelChangeType() const { return m_modelChangeType; }
diff --git a/src/gui/accessible/qaccessiblebridge.h b/src/gui/accessible/qaccessiblebridge.h
index f0df5e1f39..277a8d201b 100644
--- a/src/gui/accessible/qaccessiblebridge.h
+++ b/src/gui/accessible/qaccessiblebridge.h
@@ -59,7 +59,7 @@ class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject
{
Q_OBJECT
public:
- explicit QAccessibleBridgePlugin(QObject *parent = 0);
+ explicit QAccessibleBridgePlugin(QObject *parent = Q_NULLPTR);
~QAccessibleBridgePlugin();
virtual QAccessibleBridge *create(const QString &key) = 0;
diff --git a/src/gui/accessible/qaccessibleplugin.h b/src/gui/accessible/qaccessibleplugin.h
index a4b782af11..44261788c7 100644
--- a/src/gui/accessible/qaccessibleplugin.h
+++ b/src/gui/accessible/qaccessibleplugin.h
@@ -53,7 +53,7 @@ class Q_GUI_EXPORT QAccessiblePlugin : public QObject
{
Q_OBJECT
public:
- explicit QAccessiblePlugin(QObject *parent = 0);
+ explicit QAccessiblePlugin(QObject *parent = Q_NULLPTR);
~QAccessiblePlugin();
virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0;
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index 436e2e0b34..e34347b801 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -4,7 +4,7 @@ project = QtGui
description = Qt GUI Reference Documentation
version = $QT_VERSION
-examplesinstallpath = gui
+examplesinstallpath = qtbase/gui
qhp.projects = QtGui
diff --git a/src/gui/doc/snippets/qfileopenevent/Info.plist b/src/gui/doc/snippets/qfileopenevent/Info.plist
new file mode 100644
index 0000000000..6b8039bc7d
--- /dev/null
+++ b/src/gui/doc/snippets/qfileopenevent/Info.plist
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of 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$
+**
+****************************************************************************/
+
+//! [Custom Info.plist]
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>png</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ </array>
+</dict>
+</plist>
+//! [Custom Info.plist] \ No newline at end of file
diff --git a/src/gui/doc/snippets/qfileopenevent/main.cpp b/src/gui/doc/snippets/qfileopenevent/main.cpp
new file mode 100644
index 0000000000..3fd1757bd7
--- /dev/null
+++ b/src/gui/doc/snippets/qfileopenevent/main.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of 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$
+**
+****************************************************************************/
+
+//! [QApplication subclass]
+#include <QApplication>
+#include <QFileOpenEvent>
+#include <QtDebug>
+
+class MyApplication : public QApplication
+{
+public:
+ MyApplication(int &argc, char **argv)
+ : QApplication(argc, argv)
+ {
+ }
+
+ bool event(QEvent *event)
+ {
+ if (event->type() == QEvent::FileOpen) {
+ QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
+ qDebug() << "Open file" << openEvent->file();
+ }
+
+ return QApplication::event(event);
+ }
+};
+//! [QApplication subclass]
+
+int main(int argc, char *argv[])
+{
+ MyApplication app(argc, argv);
+ QPushButton closeButton("Quit");
+ QObject::connect(&closeButton, &QPushButton::clicked, &app, &QApplication::quit);
+ closeButton.show();
+ return app.exec();
+}
diff --git a/src/gui/doc/snippets/qfontdatabase/main.cpp b/src/gui/doc/snippets/qfontdatabase/main.cpp
index e33ad5f539..aacd6f47fa 100644
--- a/src/gui/doc/snippets/qfontdatabase/main.cpp
+++ b/src/gui/doc/snippets/qfontdatabase/main.cpp
@@ -60,7 +60,7 @@ int main(int argc, char **argv)
QString sizes;
foreach (int points, database.smoothSizes(family, style))
- sizes += QString::number(points) + " ";
+ sizes += QString::number(points) + ' ';
styleItem->setText(1, sizes.trimmed());
}
diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h
index f3ad90be20..be693af1cf 100644
--- a/src/gui/image/qbitmap.h
+++ b/src/gui/image/qbitmap.h
@@ -48,7 +48,7 @@ public:
QBitmap(const QPixmap &);
QBitmap(int w, int h);
explicit QBitmap(const QSize &);
- explicit QBitmap(const QString &fileName, const char *format=0);
+ explicit QBitmap(const QString &fileName, const char *format = Q_NULLPTR);
~QBitmap();
QBitmap &operator=(const QPixmap &);
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 66bb77795e..d9e1347e4b 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -45,11 +46,7 @@
#include "qcache.h"
#include "qdebug.h"
#include "qpalette.h"
-
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
-#include <private/qt_mac_p.h>
-#include <private/qt_cocoa_helpers_mac_p.h>
-#endif
+#include "qmath.h"
#include "private/qhexstring_p.h"
#include "private/qguiapplication_p.h"
@@ -134,7 +131,8 @@ static qreal qt_effective_device_pixel_ratio(QWindow *window = 0)
QIconPrivate::QIconPrivate()
: engine(0), ref(1),
serialNum(serialNumCounter.fetchAndAddRelaxed(1)),
- detach_no(0)
+ detach_no(0),
+ is_mask(false)
{
}
@@ -362,7 +360,7 @@ static inline int origIcoDepth(const QImage &image)
return s.isEmpty() ? 32 : s.toInt();
}
-static inline int findBySize(const QList<QImage> &images, const QSize &size)
+static inline int findBySize(const QVector<QImage> &images, const QSize &size)
{
for (int i = 0; i < images.size(); ++i) {
if (images.at(i).size() == size)
@@ -426,7 +424,7 @@ void QPixmapIconEngine::addFile(const QString &fileName, const QSize &size, QIco
// these files may contain low-resolution images. As this information is lost,
// ICOReader sets the original format as an image text key value. Read all matching
// images into a list trying to find the highest quality per size.
- QList<QImage> icoImages;
+ QVector<QImage> icoImages;
while (imageReader.read(&image)) {
if (ignoreSize || image.size() == size) {
const int position = findBySize(icoImages, image.size());
@@ -599,6 +597,8 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
\image icon.png QIcon
+ \note QIcon needs a QGuiApplication instance before the icon is created.
+
\sa {fowler}{GUI Design Handbook: Iconic Label}, {Icons Example}
*/
@@ -1028,19 +1028,13 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
} else {
detach();
}
+
d->engine->addFile(fileName, size, mode, state);
- // Check if a "@2x" file exists and add it.
- static bool disable2xImageLoading = !qEnvironmentVariableIsEmpty("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING");
- if (!disable2xImageLoading && qApp->devicePixelRatio() > 1.0) {
- QString at2xfileName = fileName;
- int dotIndex = fileName.lastIndexOf(QLatin1Char('.'));
- if (dotIndex == -1) /* no dot */
- dotIndex = fileName.size(); /* append */
- at2xfileName.insert(dotIndex, QStringLiteral("@2x"));
- if (QFile::exists(at2xfileName))
- d->engine->addFile(at2xfileName, size, mode, state);
- }
+ // Check if a "@Nx" file exists and add it.
+ QString atNxFileName = qt_findAtNxFile(fileName, qApp->devicePixelRatio());
+ if (atNxFileName != fileName)
+ d->engine->addFile(atNxFileName, size, mode, state);
}
/*!
@@ -1185,8 +1179,6 @@ QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback)
qtIconCache()->insert(name, cachedIcon);
}
- // Note the qapp check is to allow lazy loading of static icons
- // Supporting fallbacks will not work for this case.
if (qApp && icon.availableSizes().isEmpty())
return fallback;
@@ -1208,6 +1200,39 @@ bool QIcon::hasThemeIcon(const QString &name)
return icon.name() == name;
}
+/*!
+ \since 5.6
+
+ Indicate that this icon is a mask image, and hence can potentially
+ be modified based on where it's displayed.
+ \sa isMask()
+*/
+void QIcon::setIsMask(bool isMask)
+{
+ if (!d) {
+ d = new QIconPrivate;
+ d->engine = new QPixmapIconEngine;
+ } else {
+ detach();
+ }
+ d->is_mask = isMask;
+}
+
+/*!
+ \since 5.6
+
+ Returns \c true if this icon has been marked as a mask image.
+ Certain platforms render mask icons differently (for example,
+ menu icons on OS X).
+
+ \sa setIsMask()
+*/
+bool QIcon::isMask() const
+{
+ if (!d)
+ return false;
+ return d->is_mask;
+}
/*****************************************************************************
QIcon stream functions
@@ -1354,5 +1379,46 @@ QDebug operator<<(QDebug dbg, const QIcon &i)
\internal
*/
+/*!
+ \internal
+ \since 5.6
+ Attempts to find a suitable @Nx file for the given \a targetDevicePixelRatio
+ Returns the the \a baseFileName if no such file was found.
+
+ Given base foo.png and a target dpr of 2.5, this function will look for
+ foo@3x.png, then foo@2x, then fall back to foo.png if not found.
+
+ \a sourceDevicePixelRatio will be set to the value of N if the argument is
+ a non-null pointer
+*/
+QString qt_findAtNxFile(const QString &baseFileName, qreal targetDevicePixelRatio,
+ qreal *sourceDevicePixelRatio)
+{
+ if (targetDevicePixelRatio <= 1.0)
+ return baseFileName;
+
+ static bool disableNxImageLoading = !qEnvironmentVariableIsEmpty("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING");
+ if (disableNxImageLoading)
+ return baseFileName;
+
+ int dotIndex = baseFileName.lastIndexOf(QLatin1Char('.'));
+ if (dotIndex == -1) /* no dot */
+ dotIndex = baseFileName.size(); /* append */
+
+ QString atNxfileName = baseFileName;
+ atNxfileName.insert(dotIndex, QLatin1String("@2x"));
+ // Check for @Nx, ..., @3x, @2x file versions,
+ for (int n = qMin(qCeil(targetDevicePixelRatio), 9); n > 1; --n) {
+ atNxfileName[dotIndex + 1] = QLatin1Char('0' + n);
+ if (QFile::exists(atNxfileName)) {
+ if (sourceDevicePixelRatio)
+ *sourceDevicePixelRatio = n;
+ return atNxfileName;
+ }
+ }
+
+ return baseFileName;
+}
+
QT_END_NAMESPACE
#endif //QT_NO_ICON
diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h
index 63e77eef99..9ed7336502 100644
--- a/src/gui/image/qicon.h
+++ b/src/gui/image/qicon.h
@@ -56,8 +56,8 @@ public:
QIcon(const QIcon &other);
#ifdef Q_COMPILER_RVALUE_REFS
QIcon(QIcon &&other) Q_DECL_NOEXCEPT
- : d(0)
- { qSwap(d, other.d); }
+ : d(other.d)
+ { other.d = Q_NULLPTR; }
#endif
explicit QIcon(const QString &fileName); // file or resource name
explicit QIcon(QIconEngine *engine);
@@ -65,7 +65,7 @@ public:
QIcon &operator=(const QIcon &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QIcon &operator=(QIcon &&other) Q_DECL_NOEXCEPT
- { qSwap(d, other.d); return *this; }
+ { swap(other); return *this; }
#endif
inline void swap(QIcon &other) Q_DECL_NOEXCEPT
{ qSwap(d, other.d); }
@@ -102,6 +102,9 @@ public:
QList<QSize> availableSizes(Mode mode = Normal, State state = Off) const;
+ void setIsMask(bool isMask);
+ bool isMask() const;
+
static QIcon fromTheme(const QString &name, const QIcon &fallback = QIcon());
static bool hasThemeIcon(const QString &name);
@@ -136,6 +139,9 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QIcon &);
Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QIcon &);
#endif
+Q_GUI_EXPORT QString qt_findAtNxFile(const QString &baseFileName, qreal targetDevicePixelRatio,
+ qreal *sourceDevicePixelRatio = Q_NULLPTR);
+
QT_END_NAMESPACE
#endif // QICON_H
diff --git a/src/gui/image/qicon_p.h b/src/gui/image/qicon_p.h
index 8b42e770fa..2a4f584a0d 100644
--- a/src/gui/image/qicon_p.h
+++ b/src/gui/image/qicon_p.h
@@ -71,6 +71,7 @@ public:
QAtomicInt ref;
int serialNum;
int detach_no;
+ bool is_mask;
};
diff --git a/src/gui/image/qiconengine.cpp b/src/gui/image/qiconengine.cpp
index a25b216432..c09933d45f 100644
--- a/src/gui/image/qiconengine.cpp
+++ b/src/gui/image/qiconengine.cpp
@@ -77,6 +77,13 @@ QSize QIconEngine::actualSize(const QSize &size, QIcon::Mode /*mode*/, QIcon::St
return size;
}
+/*!
+ \since 5.6
+ Constructs the icon engine.
+ */
+QIconEngine::QIconEngine()
+{
+}
/*!
Destroys the icon engine.
diff --git a/src/gui/image/qiconengine.h b/src/gui/image/qiconengine.h
index 735da863fd..9977113054 100644
--- a/src/gui/image/qiconengine.h
+++ b/src/gui/image/qiconengine.h
@@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
class Q_GUI_EXPORT QIconEngine
{
public:
+ QIconEngine();
virtual ~QIconEngine();
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) = 0;
virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
diff --git a/src/gui/image/qiconengineplugin.h b/src/gui/image/qiconengineplugin.h
index 66684c871d..b05969f283 100644
--- a/src/gui/image/qiconengineplugin.h
+++ b/src/gui/image/qiconengineplugin.h
@@ -48,7 +48,7 @@ class Q_GUI_EXPORT QIconEnginePlugin : public QObject
{
Q_OBJECT
public:
- QIconEnginePlugin(QObject *parent = 0);
+ QIconEnginePlugin(QObject *parent = Q_NULLPTR);
~QIconEnginePlugin();
virtual QIconEngine *create(const QString &filename = QString()) = 0;
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index fa14c84e83..3ead72dfbb 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -42,15 +42,10 @@
#include <QtGui/QIconEngine>
#include <QtGui/QPalette>
#include <QtCore/QList>
-#include <QtCore/QHash>
#include <QtCore/QDir>
#include <QtCore/QSettings>
#include <QtGui/QPainter>
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
-#include <private/qt_cocoa_helpers_mac_p.h>
-#endif
-
#include <private/qhexstring_p.h>
QT_BEGIN_NAMESPACE
@@ -73,9 +68,6 @@ QIconLoader::QIconLoader() :
{
}
-// We lazily initialize the loader to make static icons
-// work. Though we do not officially support this.
-
static inline QString systemThemeName()
{
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
@@ -398,9 +390,6 @@ void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect,
QIcon::Mode mode, QIcon::State state)
{
QSize pixmapSize = rect.size();
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
- pixmapSize *= qt_mac_get_scalefactor();
-#endif
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
}
diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h
index 5b0362e218..ccf0a9d438 100644
--- a/src/gui/image/qiconloader_p.h
+++ b/src/gui/image/qiconloader_p.h
@@ -76,7 +76,7 @@ struct QIconDirInfo
short maxSize;
short minSize;
short threshold;
- Type type : 4;
+ Type type;
};
Q_DECLARE_TYPEINFO(QIconDirInfo, Q_MOVABLE_TYPE);
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 01cacad630..667b65431e 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -491,6 +491,10 @@ bool QImageData::checkForAlphaPixels() const
\snippet code/src_gui_image_qimage.cpp 1
\endtable
+ For images with more than 8-bit per color-channel. The methods
+ setPixelColor() and pixelColor() can be used to set and get
+ with QColor values.
+
QImage also provide the scanLine() function which returns a
pointer to the pixel data at the scanline with the given index,
and the bits() function which returns a pointer to the first pixel
@@ -1785,11 +1789,11 @@ void QImage::fill(const QColor &color)
break;
case QImage::Format_BGR30:
case QImage::Format_A2BGR30_Premultiplied:
- fill(qConvertArgb32ToA2rgb30<PixelOrderBGR>(color.rgba()));
+ fill(qConvertRgb64ToRgb30<PixelOrderBGR>(color.rgba64()));
break;
case QImage::Format_RGB30:
case QImage::Format_A2RGB30_Premultiplied:
- fill(qConvertArgb32ToA2rgb30<PixelOrderRGB>(color.rgba()));
+ fill(qConvertRgb64ToRgb30<PixelOrderRGB>(color.rgba64()));
break;
case QImage::Format_RGB16:
fill((uint) qConvertRgb32To16(color.rgba()));
@@ -2206,9 +2210,10 @@ int QImage::pixelIndex(int x, int y) const
If the \a position is not valid, the results are undefined.
\warning This function is expensive when used for massive pixel
- manipulations.
+ manipulations. Use constBits() or constScanLine() when many
+ pixels needs to be read.
- \sa setPixel(), valid(), {QImage#Pixel Manipulation}{Pixel
+ \sa setPixel(), valid(), constBits(), constScanLine(), {QImage#Pixel Manipulation}{Pixel
Manipulation}
*/
@@ -2219,12 +2224,12 @@ int QImage::pixelIndex(int x, int y) const
*/
QRgb QImage::pixel(int x, int y) const
{
- if (!d || x < 0 || x >= d->width || y < 0 || y >= height()) {
+ if (!d || x < 0 || x >= d->width || y < 0 || y >= d->height) {
qWarning("QImage::pixel: coordinate (%d,%d) out of range", x, y);
return 12345;
}
- const uchar * s = constScanLine(y);
+ const uchar *s = d->data + y * d->bytes_per_line;
switch(d->format) {
case Format_Mono:
return d->colortable.at((*(s + (x >> 3)) >> (~x & 7)) & 1);
@@ -2258,25 +2263,23 @@ QRgb QImage::pixel(int x, int y) const
return *layout->convertToARGB32PM(&result, ptr, 1, layout, 0);
}
-
/*!
\fn void QImage::setPixel(const QPoint &position, uint index_or_rgb)
Sets the pixel index or color at the given \a position to \a
index_or_rgb.
- If the image's format is either monochrome or 8-bit, the given \a
+ If the image's format is either monochrome or paletted, the given \a
index_or_rgb value must be an index in the image's color table,
otherwise the parameter must be a QRgb value.
If \a position is not a valid coordinate pair in the image, or if
\a index_or_rgb >= colorCount() in the case of monochrome and
- 8-bit images, the result is undefined.
+ paletted images, the result is undefined.
\warning This function is expensive due to the call of the internal
\c{detach()} function called within; if performance is a concern, we
- recommend the use of \l{QImage::}{scanLine()} to access pixel data
- directly.
+ recommend the use of scanLine() or bits() to access pixel data directly.
\sa pixel(), {QImage#Pixel Manipulation}{Pixel Manipulation}
*/
@@ -2364,6 +2367,116 @@ void QImage::setPixel(int x, int y, uint index_or_rgb)
}
/*!
+ \fn QColor QImage::pixelColor(const QPoint &position) const
+ \since 5.6
+
+ Returns the color of the pixel at the given \a position as a QColor.
+
+ If the \a position is not valid, an invalid QColor is returned.
+
+ \warning This function is expensive when used for massive pixel
+ manipulations. Use constBits() or constScanLine() when many
+ pixels needs to be read.
+
+ \sa setPixel(), valid(), constBits(), constScanLine(), {QImage#Pixel Manipulation}{Pixel
+ Manipulation}
+*/
+
+/*!
+ \overload
+ \since 5.6
+
+ Returns the color of the pixel at coordinates (\a x, \a y) as a QColor.
+*/
+QColor QImage::pixelColor(int x, int y) const
+{
+ if (!d || x < 0 || x >= d->width || y < 0 || y >= height()) {
+ qWarning("QImage::pixelColor: coordinate (%d,%d) out of range", x, y);
+ return QColor();
+ }
+
+ QRgba64 c;
+ const uchar * s = constScanLine(y);
+ switch (d->format) {
+ case Format_BGR30:
+ case Format_A2BGR30_Premultiplied:
+ c = qConvertA2rgb30ToRgb64<PixelOrderBGR>(reinterpret_cast<const quint32 *>(s)[x]);
+ break;
+ case Format_RGB30:
+ case Format_A2RGB30_Premultiplied:
+ c = qConvertA2rgb30ToRgb64<PixelOrderRGB>(reinterpret_cast<const quint32 *>(s)[x]);
+ break;
+ default:
+ c = QRgba64::fromArgb32(pixel(x, y));
+ break;
+ }
+ // QColor is always unpremultiplied
+ if (hasAlphaChannel() && qPixelLayouts[d->format].premultiplied)
+ c = c.unpremultiplied();
+ return QColor(c);
+}
+
+/*!
+ \fn void QImage::setPixelColor(const QPoint &position, const QColor &color)
+ \since 5.6
+
+ Sets the color at the given \a position to \a color.
+
+ If \a position is not a valid coordinate pair in the image, or
+ the image's format is either monochrome or paletted, the result is undefined.
+
+ \warning This function is expensive due to the call of the internal
+ \c{detach()} function called within; if performance is a concern, we
+ recommend the use of scanLine() or bits() to access pixel data directly.
+
+ \sa pixel(), bits(), scanLine(), {QImage#Pixel Manipulation}{Pixel Manipulation}
+*/
+
+/*!
+ \overload
+ \since 5.6
+
+ Sets the pixel color at (\a x, \a y) to \a color.
+*/
+void QImage::setPixelColor(int x, int y, const QColor &color)
+{
+ if (!d || x < 0 || x >= width() || y < 0 || y >= height() || !color.isValid()) {
+ qWarning("QImage::setPixelColor: coordinate (%d,%d) out of range", x, y);
+ return;
+ }
+ // QColor is always unpremultiplied
+ QRgba64 c = color.rgba64();
+ if (!hasAlphaChannel())
+ c.setAlpha(65535);
+ else if (qPixelLayouts[d->format].premultiplied)
+ c = c.premultiplied();
+ // detach is called from within scanLine
+ uchar * s = scanLine(y);
+ switch (d->format) {
+ case Format_Mono:
+ case Format_MonoLSB:
+ case Format_Indexed8:
+ qWarning("QImage::setPixelColor: called on monochrome or indexed format");
+ return;
+ case Format_BGR30:
+ ((uint *)s)[x] = qConvertRgb64ToRgb30<PixelOrderBGR>(c) | 0xc0000000;
+ return;
+ case Format_A2BGR30_Premultiplied:
+ ((uint *)s)[x] = qConvertRgb64ToRgb30<PixelOrderBGR>(c);
+ return;
+ case Format_RGB30:
+ ((uint *)s)[x] = qConvertRgb64ToRgb30<PixelOrderRGB>(c) | 0xc0000000;
+ return;
+ case Format_A2RGB30_Premultiplied:
+ ((uint *)s)[x] = qConvertRgb64ToRgb30<PixelOrderRGB>(c);
+ return;
+ default:
+ setPixel(x, y, c.toArgb32());
+ return;
+ }
+}
+
+/*!
Returns \c true if all the colors in the image are shades of gray
(i.e. their red, green and blue components are equal); otherwise
false.
@@ -3808,6 +3921,10 @@ int QImage::metric(PaintDeviceMetric metric) const
return d->devicePixelRatio;
break;
+ case PdmDevicePixelRatioScaled:
+ return d->devicePixelRatio * QPaintDevice::devicePixelRatioFScale();
+ break;
+
default:
qWarning("QImage::metric(): Unhandled metric type %d", metric);
break;
@@ -4521,32 +4638,7 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode
if (complex_xform || mode == Qt::SmoothTransformation) {
if (d->format < QImage::Format_RGB32 || !hasAlphaChannel()) {
- switch(d->format) {
- case QImage::Format_RGB16:
- target_format = Format_ARGB8565_Premultiplied;
- break;
- case QImage::Format_RGB555:
- target_format = Format_ARGB8555_Premultiplied;
- break;
- case QImage::Format_RGB666:
- target_format = Format_ARGB6666_Premultiplied;
- break;
- case QImage::Format_RGB444:
- target_format = Format_ARGB4444_Premultiplied;
- break;
- case QImage::Format_RGBX8888:
- target_format = Format_RGBA8888_Premultiplied;
- break;
- case QImage::Format_BGR30:
- target_format = Format_A2BGR30_Premultiplied;
- break;
- case QImage::Format_RGB30:
- target_format = Format_A2RGB30_Premultiplied;
- break;
- default:
- target_format = Format_ARGB32_Premultiplied;
- break;
- }
+ target_format = qt_alphaVersion(d->format);
}
}
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 26057f366c..888c7beb32 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -34,10 +34,11 @@
#ifndef QIMAGE_H
#define QIMAGE_H
-#include <QtGui/qtransform.h>
-#include <QtGui/qpaintdevice.h>
+#include <QtGui/qcolor.h>
#include <QtGui/qrgb.h>
+#include <QtGui/qpaintdevice.h>
#include <QtGui/qpixelformat.h>
+#include <QtGui/qtransform.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qrect.h>
#include <QtCore/qstring.h>
@@ -124,15 +125,15 @@ public:
QImage() Q_DECL_NOEXCEPT;
QImage(const QSize &size, Format format);
QImage(int width, int height, Format format);
- QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
- QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
- QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
- QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
+ QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
+ QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
+ QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
+ QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
#ifndef QT_NO_IMAGEFORMAT_XPM
explicit QImage(const char * const xpm[]);
#endif
- explicit QImage(const QString &fileName, const char *format = 0);
+ explicit QImage(const QString &fileName, const char *format = Q_NULLPTR);
QImage(const QImage &);
#ifdef Q_COMPILER_RVALUE_REFS
@@ -220,6 +221,12 @@ public:
void setPixel(int x, int y, uint index_or_rgb);
void setPixel(const QPoint &pt, uint index_or_rgb);
+ QColor pixelColor(int x, int y) const;
+ QColor pixelColor(const QPoint &pt) const;
+
+ void setPixelColor(int x, int y, const QColor &c);
+ void setPixelColor(const QPoint &pt, const QColor &c);
+
QVector<QRgb> colorTable() const;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
void setColorTable(const QVector<QRgb> &colors);
@@ -272,16 +279,16 @@ public:
bool load(QIODevice *device, const char* format);
- bool load(const QString &fileName, const char* format=0);
- bool loadFromData(const uchar *buf, int len, const char *format = 0);
- inline bool loadFromData(const QByteArray &data, const char* aformat=0)
+ bool load(const QString &fileName, const char *format = Q_NULLPTR);
+ bool loadFromData(const uchar *buf, int len, const char *format = Q_NULLPTR);
+ inline bool loadFromData(const QByteArray &data, const char *aformat = Q_NULLPTR)
{ return loadFromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), aformat); }
- bool save(const QString &fileName, const char* format=0, int quality=-1) const;
- bool save(QIODevice *device, const char* format=0, int quality=-1) const;
+ bool save(const QString &fileName, const char *format = Q_NULLPTR, int quality = -1) const;
+ bool save(QIODevice *device, const char *format = Q_NULLPTR, int quality = -1) const;
- static QImage fromData(const uchar *data, int size, const char *format = 0);
- inline static QImage fromData(const QByteArray &data, const char *format = 0)
+ static QImage fromData(const uchar *data, int size, const char *format = Q_NULLPTR);
+ inline static QImage fromData(const QByteArray &data, const char *format = Q_NULLPTR)
{ return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); }
#if QT_DEPRECATED_SINCE(5, 0)
@@ -352,6 +359,8 @@ inline bool QImage::valid(const QPoint &pt) const { return valid(pt.x(), pt.y())
inline int QImage::pixelIndex(const QPoint &pt) const { return pixelIndex(pt.x(), pt.y());}
inline QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y()); }
inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); }
+inline QColor QImage::pixelColor(const QPoint &pt) const { return pixelColor(pt.x(), pt.y()); }
+inline void QImage::setPixelColor(const QPoint &pt, const QColor &c) { setPixelColor(pt.x(), pt.y(), c); }
#if QT_DEPRECATED_SINCE(5, 0)
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 02f32aa34b..cc79e73534 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -375,7 +375,32 @@ static void convert_RGB888_to_RGB(QImageData *dest, const QImageData *src, Qt::I
}
}
+#ifdef __SSE2__
extern bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionFlags);
+#else
+static bool convert_ARGB_to_ARGB_PM_inplace(QImageData *data,Qt::ImageConversionFlags)
+{
+ Q_ASSERT(data->format == QImage::Format_ARGB32 || data->format == QImage::Format_RGBA8888);
+
+ const int pad = (data->bytes_per_line >> 2) - data->width;
+ QRgb *rgb_data = (QRgb *) data->data;
+
+ for (int i = 0; i < data->height; ++i) {
+ const QRgb *end = rgb_data + data->width;
+ while (rgb_data < end) {
+ *rgb_data = qPremultiply(*rgb_data);
+ ++rgb_data;
+ }
+ rgb_data += pad;
+ }
+
+ if (data->format == QImage::Format_ARGB32)
+ data->format = QImage::Format_ARGB32_Premultiplied;
+ else
+ data->format = QImage::Format_RGBA8888_Premultiplied;
+ return true;
+}
+#endif
static void convert_ARGB_to_RGBx(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
{
@@ -2592,7 +2617,7 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
#ifdef __SSE2__
convert_ARGB_to_ARGB_PM_inplace_sse2,
#else
- 0,
+ convert_ARGB_to_ARGB_PM_inplace,
#endif
0,
0,
@@ -2705,12 +2730,13 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0,
0,
mask_alpha_converter_rgbx_inplace,
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN && __SSE2__
0,
+#ifdef __SSE2__
convert_ARGB_to_ARGB_PM_inplace_sse2,
+#elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ convert_ARGB_to_ARGB_PM_inplace,
#else
0,
- 0,
#endif
0, 0, 0, 0, 0, 0
}, // Format_RGBA8888
@@ -2894,7 +2920,7 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
} // Format_Grayscale8
};
-void qInitImageConversions()
+static void qInitImageConversions()
{
#if defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSSE3)
if (qCpuHasFeature(SSSE3)) {
@@ -2921,7 +2947,7 @@ void qInitImageConversions()
}
#endif
-#if defined(__ARM_NEON__) && !defined(Q_PROCESSOR_ARM_64)
+#if defined(__ARM_NEON__)
extern void convert_RGB888_to_RGB32_neon(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);
qimage_converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_neon;
qimage_converter_map[QImage::Format_RGB888][QImage::Format_ARGB32] = convert_RGB888_to_RGB32_neon;
@@ -2941,4 +2967,6 @@ void qInitImageConversions()
#endif
}
+Q_CONSTRUCTOR_FUNCTION(qInitImageConversions);
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qimage_neon.cpp b/src/gui/image/qimage_neon.cpp
index b51c43aa9d..5853510ee1 100644
--- a/src/gui/image/qimage_neon.cpp
+++ b/src/gui/image/qimage_neon.cpp
@@ -35,7 +35,7 @@
#include <private/qimage_p.h>
#include <private/qsimd_p.h>
-#if defined(__ARM_NEON__) && !defined(Q_PROCESSOR_ARM_64)
+#if defined(__ARM_NEON__)
QT_BEGIN_NAMESPACE
@@ -55,6 +55,7 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, cons
if ((len - offsetToAlignOn8Bytes) >= 8) {
const quint32 *const simdEnd = end - 7;
+#if !defined(Q_PROCESSOR_ARM_64)
register uint8x8_t fullVector asm ("d3") = vdup_n_u8(0xff);
do {
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
@@ -76,6 +77,31 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, cons
);
#endif
} while (dst < simdEnd);
+#else
+ register uint8x8_t fullVector asm ("v3") = vdup_n_u8(0xff);
+ do {
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ asm volatile (
+ "ld3 { v4.8b, v5.8b, v6.8b }, [%[SRC]], #24 \n\t"
+ "st4 { v3.8b, v4.8b, v5.8b, v6.8b }, [%[DST]], #32 \n\t"
+ : [DST]"+r" (dst), [SRC]"+r" (src)
+ : "w"(fullVector)
+ : "memory", "v4", "v5", "v6"
+ );
+#else
+ asm volatile (
+ "ld3 { v0.8b, v1.8b, v2.8b }, [%[SRC]], #24 \n\t"
+ "mov v4.8b, v2.8b\n\t"
+ "mov v2.8b, v0.8b\n\t"
+ "mov v0.8b, v4.8b\n\t"
+ "st4 { v0.8b, v1.8b, v2.8b, v3.8b }, [%[DST]], #32 \n\t"
+ : [DST]"+r" (dst), [SRC]"+r" (src)
+ : "w"(fullVector)
+ : "memory", "v0", "v1", "v2", "v4"
+ );
+#endif
+ } while (dst < simdEnd);
+#endif
}
while (dst != end) {
@@ -103,4 +129,4 @@ void convert_RGB888_to_RGB32_neon(QImageData *dest, const QImageData *src, Qt::I
QT_END_NAMESPACE
-#endif // defined(__ARM_NEON__) && !defined(Q_PROCESSOR_ARM_64)
+#endif // defined(__ARM_NEON__)
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index feeab60abd..f9ad6c0ac0 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -111,8 +111,6 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
void dither_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags, bool fromalpha);
-void qInitImageConversions();
-
const uchar *qt_get_bitflip_array();
Q_GUI_EXPORT void qGamma_correct_back_to_linear_cs(QImage *image);
@@ -163,10 +161,45 @@ inline int qt_depthForFormat(QImage::Format format)
}
return depth;
}
+
#if defined(_M_ARM)
#pragma optimize("", on)
#endif
+inline QImage::Format qt_alphaVersion(QImage::Format format)
+{
+ switch (format) {
+ case QImage::Format_RGB16:
+ return QImage::Format_ARGB8565_Premultiplied;
+ case QImage::Format_RGB555:
+ return QImage::Format_ARGB8555_Premultiplied;
+ case QImage::Format_RGB666:
+ return QImage::Format_ARGB6666_Premultiplied;
+ case QImage::Format_RGB444:
+ return QImage::Format_ARGB4444_Premultiplied;
+ case QImage::Format_RGBX8888:
+ return QImage::Format_RGBA8888_Premultiplied;
+ case QImage::Format_BGR30:
+ return QImage::Format_A2BGR30_Premultiplied;
+ case QImage::Format_RGB30:
+ return QImage::Format_A2RGB30_Premultiplied;
+ default:
+ break;
+ }
+ return QImage::Format_ARGB32_Premultiplied;
+}
+
+inline QImage::Format qt_alphaVersionForPainting(QImage::Format format)
+{
+ QImage::Format toFormat = qt_alphaVersion(format);
+#if defined(__ARM_NEON__) || defined(__SSE2__)
+ // If we are switching depth anyway and we have optimized ARGB32PM routines, upgrade to that.
+ if (qt_depthForFormat(format) != qt_depthForFormat(toFormat))
+ toFormat = QImage::Format_ARGB32_Premultiplied;
+#endif
+ return toFormat;
+}
+
QT_END_NAMESPACE
#endif // QIMAGE_P_H
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index 80cd87c4c3..47a8a2b7c6 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -133,7 +133,7 @@ class Q_GUI_EXPORT QImageIOPlugin : public QObject
{
Q_OBJECT
public:
- explicit QImageIOPlugin(QObject *parent = 0);
+ explicit QImageIOPlugin(QObject *parent = Q_NULLPTR);
virtual ~QImageIOPlugin();
enum Capability {
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index a35442308f..0ef587f333 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -252,7 +252,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler( device =" << (void *)device << ", format =" << format << "),"
- << keyMap.values().size() << "plugins available: " << keyMap.values();
+ << keyMap.size() << "plugins available: " << keyMap.values();
#endif
int suffixPluginIndex = -1;
@@ -312,7 +312,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
const qint64 pos = device ? device->pos() : 0;
if (autoDetectImageFormat) {
- const int keyCount = keyMap.keys().size();
+ const int keyCount = keyMap.size();
for (int i = 0; i < keyCount; ++i) {
if (i != suffixPluginIndex) {
QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
@@ -392,7 +392,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) {
// check if any of our plugins recognize the file from its contents.
const qint64 pos = device ? device->pos() : 0;
- const int keyCount = keyMap.keys().size();
+ const int keyCount = keyMap.size();
for (int i = 0; i < keyCount; ++i) {
if (i != suffixPluginIndex) {
QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
@@ -1168,7 +1168,8 @@ QImageIOHandler::Transformations QImageReader::transformation() const
/*!
\since 5.5
- Sets if images returned by read() should have transformation metadata automatically applied.
+ Determines that images returned by read() should have transformation metadata automatically
+ applied if \a enabled is \c true.
\sa autoTransform(), transformation(), read()
*/
@@ -1203,6 +1204,39 @@ bool QImageReader::autoTransform() const
}
/*!
+ \since 5.6
+
+ This is an image format specific function that forces images with
+ gamma information to be gamma corrected to \a gamma. For image formats
+ that do not support gamma correction, this value is ignored.
+
+ To gamma correct to a standard PC color-space, set gamma to \c 1/2.2.
+
+ \sa gamma()
+*/
+void QImageReader::setGamma(float gamma)
+{
+ if (d->initHandler() && d->handler->supportsOption(QImageIOHandler::Gamma))
+ d->handler->setOption(QImageIOHandler::Gamma, gamma);
+}
+
+/*!
+ \since 5.6
+
+ Returns the gamma level of the decoded image. If setGamma() has been
+ called and gamma correction is supported it will return the gamma set.
+ If gamma level is not supported by the image format, \c 0.0 is returned.
+
+ \sa setGamma()
+*/
+float QImageReader::gamma() const
+{
+ if (d->initHandler() && d->handler->supportsOption(QImageIOHandler::Gamma))
+ return d->handler->option(QImageIOHandler::Gamma).toFloat();
+ return 0.0;
+}
+
+/*!
Returns \c true if an image can be read for the device (i.e., the
image format is supported, and the device seems to contain valid
data); otherwise returns \c false.
diff --git a/src/gui/image/qimagereader.h b/src/gui/image/qimagereader.h
index 27a29bed49..6745c55b97 100644
--- a/src/gui/image/qimagereader.h
+++ b/src/gui/image/qimagereader.h
@@ -110,6 +110,9 @@ public:
void setAutoTransform(bool enabled);
bool autoTransform() const;
+ void setGamma(float gamma);
+ float gamma() const;
+
QByteArray subType() const;
QList<QByteArray> supportedSubTypes() const;
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index e9de1db4b2..1cf75d8688 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -212,7 +212,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
#ifndef QT_NO_IMAGEFORMATPLUGIN
if (!testFormat.isEmpty()) {
- const int keyCount = keyMap.keys().size();
+ const int keyCount = keyMap.size();
for (int i = 0; i < keyCount; ++i) {
QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
if (plugin && (plugin->capabilities(device, testFormat) & QImageIOPlugin::CanWrite)) {
@@ -621,7 +621,7 @@ bool QImageWriter::progressiveScanWrite() const
/*!
\since 5.5
- Sets the image transformations metadata including orientation.
+ Sets the image transformations metadata including orientation to \a transform.
If transformation metadata is not supported by the image format,
the transform is applied before writing.
diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp
index e29f9783a6..68709b708d 100644
--- a/src/gui/image/qjpeghandler.cpp
+++ b/src/gui/image/qjpeghandler.cpp
@@ -68,6 +68,7 @@ extern "C" {
}
QT_BEGIN_NAMESPACE
+QT_WARNING_DISABLE_GCC("-Wclobbered")
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32(quint32 *dst, const uchar *src, int len);
typedef void (QT_FASTCALL *Rgb888ToRgb32Converter)(quint32 *dst, const uchar *src, int len);
@@ -977,9 +978,8 @@ extern "C" void qt_convert_rgb888_to_rgb32_mips_dspr2_asm(quint32 *dst, const uc
QJpegHandler::QJpegHandler()
: d(new QJpegHandlerPrivate(this))
{
-#if defined(__ARM_NEON__) && !defined(Q_PROCESSOR_ARM_64)
+#if defined(__ARM_NEON__)
// from qimage_neon.cpp
-
if (qCpuHasFeature(NEON))
d->rgb888ToRgb32ConverterPtr = qt_convert_rgb888_to_rgb32_neon;
#endif
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index 13bc381f8e..a750e4a9fc 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -73,9 +73,9 @@ public:
};
Q_ENUM(CacheMode)
- explicit QMovie(QObject *parent = 0);
- explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = 0);
- explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = 0);
+ explicit QMovie(QObject *parent = Q_NULLPTR);
+ explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = Q_NULLPTR);
+ explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = Q_NULLPTR);
~QMovie();
static QList<QByteArray> supportedFormats();
diff --git a/src/gui/image/qpaintengine_pic.cpp b/src/gui/image/qpaintengine_pic.cpp
index 9ab1e2c30b..47480ebbae 100644
--- a/src/gui/image/qpaintengine_pic.cpp
+++ b/src/gui/image/qpaintengine_pic.cpp
@@ -398,6 +398,7 @@ void QPicturePaintEngine::drawPolygon(const QPointF *points, int numPoints, Poly
int pos;
QPolygonF polygon;
+ polygon.reserve(numPoints);
for (int i=0; i<numPoints; ++i)
polygon << points[i];
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index b63be19153..2b184466f4 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -961,6 +961,9 @@ int QPicture::metric(PaintDeviceMetric m) const
case PdmDevicePixelRatio:
val = 1;
break;
+ case PdmDevicePixelRatioScaled:
+ val = 1 * QPaintDevice::devicePixelRatioFScale();
+ break;
default:
val = 0;
qWarning("QPicture::metric: Invalid metric command");
@@ -1216,7 +1219,9 @@ QList<QByteArray> QPicture::inputFormats()
static QStringList qToStringList(const QList<QByteArray> &arr)
{
QStringList list;
- for (int i = 0; i < arr.count(); ++i)
+ const int count = arr.count();
+ list.reserve(count);
+ for (int i = 0; i < count; ++i)
list.append(QString::fromLatin1(arr.at(i)));
return list;
}
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index c3897a1935..a71d1deb02 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -62,10 +62,10 @@ public:
bool play(QPainter *p);
- bool load(QIODevice *dev, const char *format = 0);
- bool load(const QString &fileName, const char *format = 0);
- bool save(QIODevice *dev, const char *format = 0);
- bool save(const QString &fileName, const char *format = 0);
+ bool load(QIODevice *dev, const char *format = Q_NULLPTR);
+ bool load(const QString &fileName, const char *format = Q_NULLPTR);
+ bool save(QIODevice *dev, const char *format = Q_NULLPTR);
+ bool save(const QString &fileName, const char *format = Q_NULLPTR);
QRect boundingRect() const;
void setBoundingRect(const QRect &r);
diff --git a/src/gui/image/qpicture_p.h b/src/gui/image/qpicture_p.h
index 56e6e1249c..a414a122f1 100644
--- a/src/gui/image/qpicture_p.h
+++ b/src/gui/image/qpicture_p.h
@@ -48,6 +48,7 @@
#include "QtCore/qatomic.h"
#include "QtCore/qbuffer.h"
#include "QtCore/qobjectdefs.h"
+#include "QtCore/qvector.h"
#include "QtGui/qpicture.h"
#include "QtGui/qpixmap.h"
#include "QtGui/qpen.h"
@@ -150,8 +151,8 @@ public:
QRect override_rect;
QScopedPointer<QPaintEngine> paintEngine;
bool in_memory_only;
- QList<QImage> image_list;
- QList<QPixmap> pixmap_list;
+ QVector<QImage> image_list;
+ QVector<QPixmap> pixmap_list;
QList<QBrush> brush_list;
QList<QPen> pen_list;
};
diff --git a/src/gui/image/qpictureformatplugin.h b/src/gui/image/qpictureformatplugin.h
index 773c0180d3..9ad938fa79 100644
--- a/src/gui/image/qpictureformatplugin.h
+++ b/src/gui/image/qpictureformatplugin.h
@@ -53,7 +53,7 @@ class Q_GUI_EXPORT QPictureFormatPlugin : public QObject
{
Q_OBJECT
public:
- explicit QPictureFormatPlugin(QObject *parent = 0);
+ explicit QPictureFormatPlugin(QObject *parent = Q_NULLPTR);
~QPictureFormatPlugin();
virtual bool loadPicture(const QString &format, const QString &filename, QPicture *pic);
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index e53af8038f..fb62889e40 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -907,7 +907,7 @@ void QPixmap::fill(const QPaintDevice *device, const QPoint &p)
{
Q_UNUSED(device)
Q_UNUSED(p)
- qWarning("%s is deprecated, ignored", Q_FUNC_INFO);
+ qWarning("this function is deprecated, ignored");
}
@@ -1703,8 +1703,8 @@ QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionF
QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
{
- qWarning("%s is deprecated, use QScreen::grabWindow() instead."
- " Defaulting to primary screen.", Q_FUNC_INFO);
+ qWarning("this function is deprecated, use QScreen::grabWindow() instead."
+ " Defaulting to primary screen.");
return QGuiApplication::primaryScreen()->grabWindow(window, x, y, w, h);
}
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 51b02acfcf..48db7a3840 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -58,7 +58,7 @@ public:
explicit QPixmap(QPlatformPixmap *data);
QPixmap(int w, int h);
explicit QPixmap(const QSize &);
- QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ QPixmap(const QString& fileName, const char *format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
#ifndef QT_NO_IMAGEFORMAT_XPM
explicit QPixmap(const char * const xpm[]);
#endif
@@ -131,19 +131,19 @@ public:
}
#endif
- bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
- bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
- inline bool loadFromData(const QByteArray &data, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
- bool save(const QString& fileName, const char* format = 0, int quality = -1) const;
- bool save(QIODevice* device, const char* format = 0, int quality = -1) const;
+ bool load(const QString& fileName, const char *format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool loadFromData(const uchar *buf, uint len, const char* format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline bool loadFromData(const QByteArray &data, const char* format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool save(const QString& fileName, const char* format = Q_NULLPTR, int quality = -1) const;
+ bool save(QIODevice* device, const char* format = Q_NULLPTR, int quality = -1) const;
bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor);
inline QPixmap copy(int x, int y, int width, int height) const;
QPixmap copy(const QRect &rect = QRect()) const;
- inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = 0);
- void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = 0);
+ inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = Q_NULLPTR);
+ void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = Q_NULLPTR);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline int serialNumber() const { return cacheKey() >> 32; }
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index f24cbc3db9..b254c5a2af 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -115,6 +115,8 @@ int QBlittablePlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) con
return qt_defaultDpiY();
case QPaintDevice::PdmDevicePixelRatio:
return devicePixelRatio();
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ return devicePixelRatio() * QPaintDevice::devicePixelRatioFScale();
default:
qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
break;
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 9c8835a7a0..bbdf77355e 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -178,20 +178,7 @@ void QRasterPlatformPixmap::fill(const QColor &color)
int alpha = color.alpha();
if (alpha != 255) {
if (!image.hasAlphaChannel()) {
- QImage::Format toFormat;
-#if !(defined(__ARM_NEON__) || defined(__SSE2__))
- if (image.format() == QImage::Format_RGB16)
- toFormat = QImage::Format_ARGB8565_Premultiplied;
- else if (image.format() == QImage::Format_RGB666)
- toFormat = QImage::Format_ARGB6666_Premultiplied;
- else if (image.format() == QImage::Format_RGB555)
- toFormat = QImage::Format_ARGB8555_Premultiplied;
- else if (image.format() == QImage::Format_RGB444)
- toFormat = QImage::Format_ARGB4444_Premultiplied;
- else
-#endif
- toFormat = QImage::Format_ARGB32_Premultiplied;
-
+ QImage::Format toFormat = qt_alphaVersionForPainting(image.format());
if (!image.isNull() && qt_depthForFormat(image.format()) == qt_depthForFormat(toFormat)) {
image.detach();
image.d->format = toFormat;
@@ -288,6 +275,9 @@ int QRasterPlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
return qt_defaultDpiY();
case QPaintDevice::PdmDevicePixelRatio:
return image.devicePixelRatio();
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ return image.devicePixelRatio() * QPaintDevice::devicePixelRatioFScale();
+
default:
qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
break;
@@ -311,17 +301,7 @@ void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageC
: QImage::Format_RGB32;
} else {
QImage::Format opaqueFormat = QNativeImage::systemFormat();
- QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
-
-#if !defined(__ARM_NEON__) && !defined(__SSE2__)
- switch (opaqueFormat) {
- case QImage::Format_RGB16:
- alphaFormat = QImage::Format_ARGB8565_Premultiplied;
- break;
- default: // We don't care about the others...
- break;
- }
-#endif
+ QImage::Format alphaFormat = qt_alphaVersionForPainting(opaqueFormat);
if (!sourceImage.hasAlphaChannel()) {
format = opaqueFormat;
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index 12e19440dc..a7a9b375ff 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -345,9 +345,22 @@ static QImage qt_imageFromWinIconHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
return image;
}
+static inline bool hasAlpha(const QImage &image)
+{
+ const int w = image.width();
+ const int h = image.height();
+ for (int y = 0; y < h; ++y) {
+ const QRgb *scanLine = reinterpret_cast<const QRgb *>(image.scanLine(y));
+ for (int x = 0; x < w; ++x) {
+ if (qAlpha(scanLine[x]) != 0)
+ return true;
+ }
+ }
+ return false;
+}
+
Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon)
{
- bool foundAlpha = false;
HDC screenDevice = GetDC(0);
HDC hdc = CreateCompatibleDC(screenDevice);
ReleaseDC(0, screenDevice);
@@ -356,6 +369,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon)
const bool result = GetIconInfo(icon, &iconinfo); //x and y Hotspot describes the icon center
if (!result) {
qErrnoWarning("QPixmap::fromWinHICON(), failed to GetIconInfo()");
+ DeleteDC(hdc);
return QPixmap();
}
@@ -371,17 +385,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon)
DrawIconEx( hdc, 0, 0, icon, iconinfo.xHotspot * 2, iconinfo.yHotspot * 2, 0, 0, DI_NORMAL);
QImage image = qt_imageFromWinIconHBITMAP(hdc, winBitmap, w, h);
- for (int y = 0 ; y < h && !foundAlpha ; y++) {
- const QRgb *scanLine= reinterpret_cast<const QRgb *>(image.scanLine(y));
- for (int x = 0; x < w ; x++) {
- if (qAlpha(scanLine[x]) != 0) {
- foundAlpha = true;
- break;
- }
- }
- }
- if (!foundAlpha) {
- //If no alpha was found, we use the mask to set alpha values
+ if (!image.isNull() && !hasAlpha(image)) { //If no alpha was found, we use the mask to set alpha values
DrawIconEx( hdc, 0, 0, icon, w, h, 0, 0, DI_MASK);
const QImage mask = qt_imageFromWinIconHBITMAP(hdc, winBitmap, w, h);
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 3836976975..d29ddcf978 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
memory.
The \e{Qt Quarterly} article
- \l{http://doc.qt.digia.com/qq/qq12-qpixmapcache.html}{Optimizing
+ \l{http://doc.qt.io/archives/qq/qq12-qpixmapcache.html}{Optimizing
with QPixmapCache} explains how to use QPixmapCache to speed up
applications by caching the results of painting.
@@ -138,6 +138,24 @@ bool QPixmapCache::Key::operator ==(const Key &key) const
*/
/*!
+ \fn QPixmapCache::Key::Key(Key &&)
+ \internal
+ \since 5.6
+*/
+
+/*!
+ \fn QPixmapCache::Key &QPixmapCache::Key::operator=(Key &&)
+ \internal
+ \since 5.6
+*/
+
+/*!
+ \fn void QPixmapCache::Key::swap(Key &)
+ \internal
+ \since 5.6
+*/
+
+/*!
\internal
*/
QPixmapCache::Key &QPixmapCache::Key::operator =(const Key &other)
@@ -179,7 +197,6 @@ public:
static QPixmapCache::KeyData* getKeyData(QPixmapCache::Key *key);
- QList< QPair<QString,QPixmap> > allPixmaps() const;
bool flushDetachedPixmaps(bool nt);
private:
@@ -423,20 +440,6 @@ QPixmapCache::KeyData* QPMCache::getKeyData(QPixmapCache::Key *key)
return key->d;
}
-QList< QPair<QString,QPixmap> > QPMCache::allPixmaps() const
-{
- QList< QPair<QString,QPixmap> > r;
- QHash<QString, QPixmapCache::Key>::const_iterator it = cacheKeys.begin();
- while (it != cacheKeys.end()) {
- QPixmap *ptr = QCache<QPixmapCache::Key, QPixmapCacheEntry>::object(it.value());
- if (ptr)
- r.append(QPair<QString,QPixmap>(it.key(),*ptr));
- ++it;
- }
- return r;
-}
-
-
Q_GLOBAL_STATIC(QPMCache, pm_cache)
int Q_AUTOTEST_EXPORT q_QPixmapCache_keyHashSize()
@@ -639,7 +642,8 @@ void QPixmapCache::remove(const Key &key)
void QPixmapCache::clear()
{
QT_TRY {
- pm_cache()->clear();
+ if (pm_cache.exists())
+ pm_cache->clear();
} QT_CATCH(const std::bad_alloc &) {
// if we ran out of memory during pm_cache(), it's no leak,
// so just ignore it.
@@ -656,10 +660,6 @@ int QPixmapCache::totalUsed()
return (pm_cache()->totalCost()+1023) / 1024;
}
-QList< QPair<QString,QPixmap> > QPixmapCache::allPixmaps()
-{
- return pm_cache()->allPixmaps();
-}
/*!
\fn QPixmapCache::KeyData::KeyData()
@@ -667,7 +667,6 @@ QList< QPair<QString,QPixmap> > QPixmapCache::allPixmaps()
*/
/*!
\fn QPixmapCache::KeyData::KeyData(const KeyData &other)
-
\internal
*/
/*!
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h
index 345389e987..37a0588e06 100644
--- a/src/gui/image/qpixmapcache.h
+++ b/src/gui/image/qpixmapcache.h
@@ -36,10 +36,6 @@
#include <QtGui/qpixmap.h>
-#ifdef Q_TEST_QPIXMAPCACHE
-#include <QtCore/qpair.h>
-#endif
-
QT_BEGIN_NAMESPACE
@@ -52,12 +48,18 @@ public:
public:
Key();
Key(const Key &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ Key(Key &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ Key &operator =(Key &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
~Key();
bool operator ==(const Key &key) const;
inline bool operator !=(const Key &key) const
{ return !operator==(key); }
Key &operator =(const Key &other);
+ void swap(Key &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
private:
KeyData *d;
friend class QPMCache;
@@ -80,9 +82,9 @@ public:
#ifdef Q_TEST_QPIXMAPCACHE
static void flushDetachedPixmaps();
static int totalUsed();
- static QList< QPair<QString,QPixmap> > allPixmaps();
#endif
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPixmapCache::Key)
QT_END_NAMESPACE
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index 7fbd24787e..e9944e1750 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -43,13 +43,8 @@
#include <qvariant.h>
#include <qvector.h>
-#ifdef QT_USE_BUNDLED_LIBPNG
-#include <../../3rdparty/libpng/png.h>
-#include <../../3rdparty/libpng/pngconf.h>
-#else
#include <png.h>
#include <pngconf.h>
-#endif
#if PNG_LIBPNG_VER >= 10400 && PNG_LIBPNG_VER <= 10502 \
&& defined(PNG_PEDANTIC_WARNINGS_SUPPORTED)
@@ -108,10 +103,11 @@ public:
};
QPngHandlerPrivate(QPngHandler *qq)
- : gamma(0.0), quality(2), png_ptr(0), info_ptr(0), end_info(0), state(Ready), q(qq)
+ : gamma(0.0), fileGamma(0.0), quality(2), png_ptr(0), info_ptr(0), end_info(0), state(Ready), q(qq)
{ }
float gamma;
+ float fileGamma;
int quality;
QString description;
QSize scaledSize;
@@ -234,13 +230,10 @@ void CALLBACK_CALL_TYPE qpiw_flush_fn(png_structp /* png_ptr */)
}
static
-void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scaledSize, bool *doScaledRead, float screen_gamma=0.0)
+void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scaledSize, bool *doScaledRead, float screen_gamma=0.0, float file_gamma=0.0)
{
- if (screen_gamma != 0.0 && png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) {
- double file_gamma;
- png_get_gAMA(png_ptr, info_ptr, &file_gamma);
- png_set_gamma(png_ptr, screen_gamma, file_gamma);
- }
+ if (screen_gamma != 0.0 && file_gamma != 0.0)
+ png_set_gamma(png_ptr, 1.0f / screen_gamma, file_gamma);
png_uint_32 width;
png_uint_32 height;
@@ -557,6 +550,12 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngHeader()
readPngTexts(info_ptr);
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) {
+ double file_gamma = 0.0;
+ png_get_gAMA(png_ptr, info_ptr, &file_gamma);
+ fileGamma = file_gamma;
+ }
+
state = ReadHeader;
return true;
}
@@ -580,7 +579,7 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
}
bool doScaledRead = false;
- setup_qt(*outImage, png_ptr, info_ptr, scaledSize, &doScaledRead, gamma);
+ setup_qt(*outImage, png_ptr, info_ptr, scaledSize, &doScaledRead, gamma, fileGamma);
if (outImage->isNull()) {
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
@@ -1063,7 +1062,7 @@ QVariant QPngHandler::option(ImageOption option) const
return QVariant();
if (option == Gamma)
- return d->gamma;
+ return d->gamma == 0.0 ? d->fileGamma : d->gamma;
else if (option == Quality)
return d->quality;
else if (option == Description)
diff --git a/src/gui/image/qpnghandler.pri b/src/gui/image/qpnghandler.pri
index 9ab175d628..505d214130 100644
--- a/src/gui/image/qpnghandler.pri
+++ b/src/gui/image/qpnghandler.pri
@@ -1,9 +1,4 @@
HEADERS += $$PWD/qpnghandler_p.h
SOURCES += $$PWD/qpnghandler.cpp
-contains(QT_CONFIG, system-png) {
- if(unix|mingw): LIBS_PRIVATE += -lpng
- else:win32: LIBS += libpng.lib
-} else {
- include($$PWD/../../3rdparty/libpng.pri)
-}
+include($$PWD/../../3rdparty/png_dependency.pri)
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp
index f460431c2b..7f23656c02 100644
--- a/src/gui/image/qppmhandler.cpp
+++ b/src/gui/image/qppmhandler.cpp
@@ -46,13 +46,21 @@ QT_BEGIN_NAMESPACE
PBM/PGM/PPM (ASCII and RAW) image read/write functions
*****************************************************************************/
+static void discard_pbm_line(QIODevice *d)
+{
+ const int buflen = 100;
+ char buf[buflen];
+ int res = 0;
+ do {
+ res = d->readLine(buf, buflen);
+ } while (res > 0 && buf[res-1] != '\n');
+}
+
static int read_pbm_int(QIODevice *d)
{
char c;
int val = -1;
bool digit;
- const int buflen = 100;
- char buf[buflen];
for (;;) {
if (!d->getChar(&c)) // end of file
break;
@@ -63,7 +71,7 @@ static int read_pbm_int(QIODevice *d)
continue;
} else {
if (c == '#') // comment
- d->readLine(buf, buflen);
+ discard_pbm_line(d);
break;
}
}
@@ -72,7 +80,7 @@ static int read_pbm_int(QIODevice *d)
else if (isspace((uchar) c))
continue;
else if (c == '#')
- (void)d->readLine(buf, buflen);
+ discard_pbm_line(d);
else
break;
}
diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp
index 8d848b662f..25b82b94b5 100644
--- a/src/gui/itemmodels/qstandarditemmodel.cpp
+++ b/src/gui/itemmodels/qstandarditemmodel.cpp
@@ -1224,7 +1224,7 @@ void QStandardItem::setSelectable(bool selectable)
The item delegate will render a checkable item with a check box next to the
item's text.
- \sa isCheckable(), setCheckState(), setTristate()
+ \sa isCheckable(), setCheckState(), setUserTristate(), setAutoTristate()
*/
void QStandardItem::setCheckable(bool checkable)
{
@@ -1244,34 +1244,88 @@ void QStandardItem::setCheckable(bool checkable)
The default value is false.
- \sa setCheckable(), checkState(), isTristate()
+ \sa setCheckable(), checkState(), isUserTristate(), isAutoTristate()
*/
/*!
- Sets whether the item is tristate. If \a tristate is true, the
- item is checkable with three separate states; otherwise, the item
- is checkable with two states. (Note that this also requires that
- the item is checkable; see isCheckable().)
+ \fn void QStandardItem::setTristate(bool tristate)
+ \obsolete
- \sa isTristate(), setCheckable(), setCheckState()
+ Use QStandardItem::setAutoTristate(bool tristate) instead.
+ For a tristate checkbox that the user can change between all three
+ states, use QStandardItem::setUserTristate(bool tristate) instead.
*/
-void QStandardItem::setTristate(bool tristate)
+
+/*!
+ \fn void QStandardItem::isTristate() const
+ \obsolete
+
+ Use QStandardItem::isAutoTristate() instead.
+ For a tristate checkbox that the user can change between all three
+ states, use QStandardItem::isUserTristate() instead.
+*/
+
+/*!
+ Determines that the item is tristate and controlled by QTreeWidget if \a tristate
+ is \c true.
+ This enables automatic management of the state of parent items in QTreeWidget
+ (checked if all children are checked, unchecked if all children are unchecked,
+ or partially checked if only some children are checked).
+
+ \since 5.6
+ \sa isAutoTristate(), setCheckable(), setCheckState()
+*/
+void QStandardItem::setAutoTristate(bool tristate)
{
Q_D(QStandardItem);
- d->changeFlags(tristate, Qt::ItemIsTristate);
+ d->changeFlags(tristate, Qt::ItemIsAutoTristate);
}
/*!
- \fn bool QStandardItem::isTristate() const
+ \fn bool QStandardItem::isAutoTristate() const
+
+ Returns whether the item is tristate and is controlled by QTreeWidget.
+
+ The default value is false.
+
+ \since 5.6
+ \sa setAutoTristate(), isCheckable(), checkState()
+*/
+
+/*!
+ Sets whether the item is tristate and controlled by the user.
+ If \a tristate is true, the user can cycle through three separate states;
+ otherwise, the item is checkable with two states.
+ (Note that this also requires that the item is checkable; see isCheckable().)
+
+ \since 5.6
+ \sa isUserTristate(), setCheckable(), setCheckState()
+*/
+void QStandardItem::setUserTristate(bool tristate)
+{
+ Q_D(QStandardItem);
+ d->changeFlags(tristate, Qt::ItemIsUserTristate);
+}
+
+/*!
+ \fn bool QStandardItem::isUserTristate() const
+ \since 5.6
Returns whether the item is tristate; that is, if it's checkable with three
- separate states.
+ separate states and the user can cycle through all three states.
The default value is false.
- \sa setTristate(), isCheckable(), checkState()
+ \sa setUserTristate(), isCheckable(), checkState()
*/
+#if QT_DEPRECATED_SINCE(5, 6)
+void QStandardItem::setTristate(bool tristate)
+{
+ setAutoTristate(tristate);
+}
+#endif
+
#ifndef QT_NO_DRAGANDDROP
/*!
@@ -1750,6 +1804,7 @@ QList<QStandardItem*> QStandardItem::takeRow(int row)
int index = d->childIndex(row, 0); // Will return -1 if there are no columns
if (index != -1) {
int col_count = d->columnCount();
+ items.reserve(col_count);
for (int column = 0; column < col_count; ++column) {
QStandardItem *ch = d->children.at(index + column);
if (ch)
@@ -2467,7 +2522,9 @@ QList<QStandardItem*> QStandardItemModel::findItems(const QString &text,
QModelIndexList indexes = match(index(0, column, QModelIndex()),
Qt::DisplayRole, text, -1, flags);
QList<QStandardItem*> items;
- for (int i = 0; i < indexes.size(); ++i)
+ const int numIndexes = indexes.size();
+ items.reserve(numIndexes);
+ for (int i = 0; i < numIndexes; ++i)
items.append(itemFromIndex(indexes.at(i)));
return items;
}
diff --git a/src/gui/itemmodels/qstandarditemmodel.h b/src/gui/itemmodels/qstandarditemmodel.h
index 3dd613f907..8740f7940b 100644
--- a/src/gui/itemmodels/qstandarditemmodel.h
+++ b/src/gui/itemmodels/qstandarditemmodel.h
@@ -158,10 +158,20 @@ public:
}
void setCheckable(bool checkable);
- inline bool isTristate() const {
- return (flags() & Qt::ItemIsTristate) != 0;
+ inline bool isAutoTristate() const {
+ return (flags() & Qt::ItemIsAutoTristate) != 0;
}
- void setTristate(bool tristate);
+ void setAutoTristate(bool tristate);
+
+ inline bool isUserTristate() const {
+ return (flags() & Qt::ItemIsUserTristate) != 0;
+ }
+ void setUserTristate(bool tristate);
+
+#if QT_DEPRECATED_SINCE(5, 6)
+ QT_DEPRECATED bool isTristate() const { return isAutoTristate(); }
+ QT_DEPRECATED void setTristate(bool tristate);
+#endif
#ifndef QT_NO_DRAGANDDROP
inline bool isDragEnabled() const {
@@ -310,8 +320,8 @@ class Q_GUI_EXPORT QStandardItemModel : public QAbstractItemModel
Q_PROPERTY(int sortRole READ sortRole WRITE setSortRole)
public:
- explicit QStandardItemModel(QObject *parent = 0);
- QStandardItemModel(int rows, int columns, QObject *parent = 0);
+ explicit QStandardItemModel(QObject *parent = Q_NULLPTR);
+ QStandardItemModel(int rows, int columns, QObject *parent = Q_NULLPTR);
~QStandardItemModel();
void setItemRoleNames(const QHash<int,QByteArray> &roleNames);
@@ -405,7 +415,7 @@ Q_SIGNALS:
void itemChanged(QStandardItem *item);
protected:
- QStandardItemModel(QStandardItemModelPrivate &dd, QObject *parent = 0);
+ QStandardItemModel(QStandardItemModelPrivate &dd, QObject *parent = Q_NULLPTR);
private:
friend class QStandardItemPrivate;
diff --git a/src/gui/itemmodels/qstandarditemmodel_p.h b/src/gui/itemmodels/qstandarditemmodel_p.h
index 491a49f9c2..b49045d283 100644
--- a/src/gui/itemmodels/qstandarditemmodel_p.h
+++ b/src/gui/itemmodels/qstandarditemmodel_p.h
@@ -61,7 +61,7 @@ class QStandardItemData
{
public:
inline QStandardItemData() : role(-1) {}
- inline QStandardItemData(int r, QVariant v) : role(r), value(v) {}
+ inline QStandardItemData(int r, const QVariant &v) : role(r), value(v) {}
int role;
QVariant value;
inline bool operator==(const QStandardItemData &other) const { return role == other.role && value == other.value; }
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index af6a417608..73a5a7b6ab 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -75,7 +75,9 @@ HEADERS += \
kernel/qplatformgraphicsbuffer.h \
kernel/qplatformgraphicsbufferhelper.h \
kernel/qinputdevicemanager_p.h \
- kernel/qinputdevicemanager_p_p.h
+ kernel/qinputdevicemanager_p_p.h \
+ kernel/qhighdpiscaling_p.h
+
SOURCES += \
kernel/qgenericpluginfactory.cpp \
@@ -131,7 +133,9 @@ SOURCES += \
kernel/qrasterwindow.cpp \
kernel/qplatformgraphicsbuffer.cpp \
kernel/qplatformgraphicsbufferhelper.cpp \
- kernel/qinputdevicemanager.cpp
+ kernel/qinputdevicemanager.cpp \
+ kernel/qhighdpiscaling.cpp
+
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
HEADERS += \
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index 6b01952647..c25f3c2665 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -43,6 +43,7 @@
#include <qpa/qplatformcursor.h>
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -177,9 +178,14 @@ QT_BEGIN_NAMESPACE
*/
QPoint QCursor::pos(const QScreen *screen)
{
- if (screen)
- if (const QPlatformCursor *cursor = screen->handle()->cursor())
- return cursor->pos();
+ if (screen) {
+ if (const QPlatformCursor *cursor = screen->handle()->cursor()) {
+ const QPlatformScreen *ps = screen->handle();
+ QPoint nativePos = cursor->pos();
+ ps = ps->screenForPosition(nativePos);
+ return QHighDpi::fromNativePixels(nativePos, ps->screen());
+ }
+ }
return QGuiApplicationPrivate::lastCursorPosition.toPoint();
}
@@ -231,12 +237,12 @@ void QCursor::setPos(QScreen *screen, int x, int y)
{
if (screen) {
if (QPlatformCursor *cursor = screen->handle()->cursor()) {
- const QPoint pos = QPoint(x, y);
+ const QPoint devicePos = QHighDpi::toNativePixels(QPoint(x, y), screen);
// Need to check, since some X servers generate null mouse move
// events, causing looping in applications which call setPos() on
// every mouse move event.
- if (pos != cursor->pos())
- cursor->setPos(pos);
+ if (devicePos != cursor->pos())
+ cursor->setPos(devicePos);
}
}
}
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index 3ce8ab95ec..b05da1bfd0 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -147,7 +147,9 @@ static QStringList imageReadMimeFormats()
{
QStringList formats;
QList<QByteArray> imageFormats = QImageReader::supportedImageFormats();
- for (int i = 0; i < imageFormats.size(); ++i) {
+ const int numImageFormats = imageFormats.size();
+ formats.reserve(numImageFormats);
+ for (int i = 0; i < numImageFormats; ++i) {
QString format = QLatin1String("image/");
format += QString::fromLatin1(imageFormats.at(i).toLower());
formats.append(format);
@@ -166,7 +168,9 @@ static QStringList imageWriteMimeFormats()
{
QStringList formats;
QList<QByteArray> imageFormats = QImageWriter::supportedImageFormats();
- for (int i = 0; i < imageFormats.size(); ++i) {
+ const int numImageFormats = imageFormats.size();
+ formats.reserve(numImageFormats);
+ for (int i = 0; i < numImageFormats; ++i) {
QString format = QLatin1String("image/");
format += QString::fromLatin1(imageFormats.at(i).toLower());
formats.append(format);
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index c231c47576..2ca17692db 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -171,6 +171,8 @@ QInputEvent::~QInputEvent()
\fn ulong QInputEvent::timestamp() const
Returns the window system's timestamp for this event.
+ It will normally be in milliseconds since some arbitrary point
+ in time, such as the time when the system was started.
*/
/*! \fn void QInputEvent::setTimestamp(ulong atimestamp)
@@ -309,6 +311,36 @@ QMouseEvent::QMouseEvent(Type type, const QPointF &localPos, const QPointF &wind
{}
/*!
+ \since 5.6
+
+ Constructs a mouse event object.
+
+ The \a type parameter must be QEvent::MouseButtonPress,
+ QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick,
+ or QEvent::MouseMove.
+
+ The points \a localPos, \a windowPos and \a screenPos specify the
+ mouse cursor's position relative to the receiving widget or item,
+ window, and screen, respectively.
+
+ The \a button that caused the event is given as a value from the
+ \l Qt::MouseButton enum. If the event \a type is \l MouseMove,
+ the appropriate button for this event is Qt::NoButton. \a buttons
+ is the state of all buttons at the time of the event, \a modifiers
+ is the state of all keyboard modifiers.
+
+ The source of the event is specified by \a source.
+
+*/
+QMouseEvent::QMouseEvent(QEvent::Type type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos,
+ Qt::MouseButton button, Qt::MouseButtons buttons,
+ Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source)
+ : QInputEvent(type, modifiers), l(localPos), w(windowPos), s(screenPos), b(button), mouseState(buttons), caps(0)
+{
+ QGuiApplicationPrivate::setMouseEventSource(this, source);
+}
+
+/*!
\internal
*/
QMouseEvent::~QMouseEvent()
@@ -997,8 +1029,10 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
when keys are pressed or released.
A key event contains a special accept flag that indicates whether
- the receiver will handle the key event. This flag is set by default,
- so there is no need to call accept() when acting on a key event.
+ the receiver will handle the key event. This flag is set by default
+ for QEvent::KeyPress and QEvent::KeyRelease, so there is no need to
+ call accept() when acting on a key event. For QEvent::ShortcutOverride
+ the receiver needs to explicitly accept the event to trigger the override.
Calling ignore() on a key event will propagate it to the parent widget.
The event is propagated up the parent widget chain until a widget
accepts it or an event filter consumes it.
@@ -1033,6 +1067,8 @@ QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const
nScanCode(0), nVirtualKey(0), nModifiers(0),
c(count), autor(autorep)
{
+ if (type == QEvent::ShortcutOverride)
+ ignore();
}
/*!
@@ -1060,6 +1096,8 @@ QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
nScanCode(nativeScanCode), nVirtualKey(nativeVirtualKey), nModifiers(nativeModifiers),
c(count), autor(autorep)
{
+ if (type == QEvent::ShortcutOverride)
+ ignore();
}
@@ -1987,6 +2025,11 @@ QInputMethodEvent::QInputMethodEvent(const QInputMethodEvent &other)
{
}
+QInputMethodEvent::~QInputMethodEvent()
+{
+ // must be empty until ### Qt 6
+}
+
/*!
Sets the commit string to \a commitString.
@@ -3374,6 +3417,21 @@ QShowEvent::~QShowEvent()
It may be safely ignored.
\note This class is currently supported for OS X only.
+
+ \section1 OS X Example
+
+ In order to trigger the event on OS X, the application must be configured
+ to let the OS know what kind of file(s) it should react on.
+
+ For example, the following \c Info.plist file declares that the application
+ can act as a viewer for files with a PNG extension:
+
+ \snippet qfileopenevent/Info.plist Custom Info.plist
+
+ The following implementation of a QApplication subclass prints the path to
+ the file that was, for example, dropped on the Dock icon of the application.
+
+ \snippet qfileopenevent/main.cpp QApplication subclass
*/
/*!
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index a1f32026ac..b90fce97e0 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -106,6 +106,9 @@ public:
QMouseEvent(Type type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos,
Qt::MouseButton button, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers);
+ QMouseEvent(Type type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos,
+ Qt::MouseButton button, Qt::MouseButtons buttons,
+ Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
~QMouseEvent();
#ifndef QT_NO_INTEGER_EVENT_COORDINATES
@@ -519,7 +522,7 @@ public:
};
class Attribute {
public:
- Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
+ Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(qMove(val)) {}
AttributeType type;
int start;
@@ -528,6 +531,8 @@ public:
};
QInputMethodEvent();
QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
+ ~QInputMethodEvent();
+
void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
inline const QList<Attribute> &attributes() const { return attrs; }
inline const QString &preeditString() const { return preedit; }
@@ -694,7 +699,7 @@ class Q_GUI_EXPORT QActionEvent : public QEvent
{
QAction *act, *bef;
public:
- QActionEvent(int type, QAction *action, QAction *before = 0);
+ QActionEvent(int type, QAction *action, QAction *before = Q_NULLPTR);
~QActionEvent();
inline QAction *action() const { return act; }
@@ -871,9 +876,9 @@ public:
#endif
explicit QTouchEvent(QEvent::Type eventType,
- QTouchDevice *device = 0,
+ QTouchDevice *device = Q_NULLPTR,
Qt::KeyboardModifiers modifiers = Qt::NoModifier,
- Qt::TouchPointStates touchPointStates = 0,
+ Qt::TouchPointStates touchPointStates = Qt::TouchPointStates(),
const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
~QTouchEvent();
diff --git a/src/gui/kernel/qgenericplugin.h b/src/gui/kernel/qgenericplugin.h
index cfab34d081..03c1df7fba 100644
--- a/src/gui/kernel/qgenericplugin.h
+++ b/src/gui/kernel/qgenericplugin.h
@@ -48,7 +48,7 @@ class Q_GUI_EXPORT QGenericPlugin : public QObject
{
Q_OBJECT
public:
- explicit QGenericPlugin(QObject *parent = 0);
+ explicit QGenericPlugin(QObject *parent = Q_NULLPTR);
~QGenericPlugin();
virtual QObject* create(const QString& name, const QString &spec) = 0;
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index c2b561aa93..0f015af2b9 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -99,6 +99,9 @@
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
# include <QtCore/qt_windows.h>
# include <QtCore/QLibraryInfo>
+# if defined(Q_OS_WINPHONE)
+# include <Objbase.h>
+# endif
#endif // Q_OS_WIN && !Q_OS_WINCE
#include <ctype.h>
@@ -124,8 +127,12 @@ Qt::MouseButtons QGuiApplicationPrivate::tabletState = Qt::NoButton;
QWindow *QGuiApplicationPrivate::tabletPressTarget = 0;
QWindow *QGuiApplicationPrivate::currentMouseWindow = 0;
+QString QGuiApplicationPrivate::styleOverride;
+
Qt::ApplicationState QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive;
+bool QGuiApplicationPrivate::highDpiScalingUpdated = false;
+
QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0;
QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0;
@@ -156,7 +163,7 @@ int QGuiApplicationPrivate::mouse_double_click_distance = -1;
QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0;
-static Qt::LayoutDirection layout_direction = Qt::LeftToRight;
+static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto;
static bool force_reverse = false;
QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0;
@@ -185,9 +192,6 @@ extern void qRegisterGuiVariant();
#ifndef QT_NO_ANIMATION
extern void qRegisterGuiGetInterpolator();
#endif
-extern void qInitBlendFunctions();
-extern void qInitDrawhelperAsm();
-extern void qInitImageConversions();
static bool qt_detectRTLLanguage()
{
@@ -869,7 +873,7 @@ QWindowList QGuiApplication::topLevelWindows()
if (!list.at(i)->parent() && list.at(i)->type() != Qt::Desktop) {
// Top windows of embedded QAxServers do not have QWindow parents,
// but they are not true top level windows, so do not include them.
- const bool embedded = list.at(i)->handle() && list.at(i)->handle()->isEmbedded(0);
+ const bool embedded = list.at(i)->handle() && list.at(i)->handle()->isEmbedded();
if (!embedded)
topLevelWindows.prepend(list.at(i));
}
@@ -877,16 +881,6 @@ QWindowList QGuiApplication::topLevelWindows()
return topLevelWindows;
}
-/*!
- Returns the primary (or default) screen of the application, or null if there is none
-
- This will be the screen where QWindows are initially shown, unless otherwise specified.
-
- On some platforms, it may be null when there are actually no screens connected.
- It is not possible to start a new QGuiApplication while there are no screens.
- Applications which were running at the time the primary screen was removed
- will stop rendering graphics until one or more screens are restored.
-*/
QScreen *QGuiApplication::primaryScreen()
{
if (QGuiApplicationPrivate::screen_list.isEmpty())
@@ -908,7 +902,7 @@ QList<QScreen *> QGuiApplication::screens()
This signal is emitted whenever a new screen \a screen has been added to the system.
- \sa screens(), primaryScreen(), screenRemoved()
+ \sa screens(), primaryScreen, screenRemoved()
*/
/*!
@@ -925,6 +919,23 @@ QList<QScreen *> QGuiApplication::screens()
/*!
+ \property QGuiApplication::primaryScreen
+
+ \brief the primary (or default) screen of the application, or null if there is none.
+
+ This will be the screen where QWindows are initially shown, unless otherwise specified.
+
+ On some platforms, it may be null when there are actually no screens connected.
+ It is not possible to start a new QGuiApplication while there are no screens.
+ Applications which were running at the time the primary screen was removed
+ will stop rendering graphics until one or more screens are restored.
+
+ The primaryScreenChanged signal was introduced in Qt 5.6.
+
+ \sa screens()
+*/
+
+/*!
Returns the highest screen device pixel ratio found on
the system. This is the ratio between physical pixels and
device-independent pixels.
@@ -955,16 +966,38 @@ qreal QGuiApplication::devicePixelRatio() const
*/
QWindow *QGuiApplication::topLevelAt(const QPoint &pos)
{
- QList<QScreen *> screens = QGuiApplication::screens();
- QList<QScreen *>::const_iterator screen = screens.constBegin();
- QList<QScreen *>::const_iterator end = screens.constEnd();
+ const QList<QScreen *> screens = QGuiApplication::screens();
+ if (!screens.isEmpty()) {
+ const QList<QScreen *> primaryScreens = screens.first()->virtualSiblings();
+ QScreen *windowScreen = Q_NULLPTR;
+
+ // Find the window on the primary virtual desktop first
+ foreach (QScreen *screen, primaryScreens) {
+ if (screen->geometry().contains(pos)) {
+ windowScreen = screen;
+ break;
+ }
+ }
- while (screen != end) {
- if ((*screen)->geometry().contains(pos))
- return (*screen)->handle()->topLevelAt(pos);
- ++screen;
+ // If the window is not found on primary virtual desktop, find it on all screens
+ // except the first which was for sure in the previous loop. Some other screens
+ // may repeat. Find only when there is more than one virtual desktop.
+ if (!windowScreen && screens.count() != primaryScreens.count()) {
+ for (int i = 1; i < screens.size(); ++i) {
+ QScreen *screen = screens[i];
+ if (screen->geometry().contains(pos)) {
+ windowScreen = screen;
+ break;
+ }
+ }
+ }
+
+ if (windowScreen) {
+ const QPoint devicePosition = QHighDpi::toNativePixels(pos, windowScreen);
+ return windowScreen->handle()->topLevelAt(devicePosition);
+ }
}
- return 0;
+ return Q_NULLPTR;
}
/*!
@@ -1041,6 +1074,13 @@ static void init_platform(const QString &pluginArgument, const QString &platform
return;
}
+ // Many platforms have created QScreens at this point. Finish initializing
+ // QHighDpiScaling to be prepared for early calls to qt_defaultDpi().
+ if (QGuiApplication::primaryScreen()) {
+ QGuiApplicationPrivate::highDpiScalingUpdated = true;
+ QHighDpiScaling::updateHighDpiScaling();
+ }
+
// Create the platform theme:
// 1) Fetch the platform name from the environment if present.
@@ -1117,6 +1157,9 @@ void QGuiApplicationPrivate::createPlatformIntegration()
// this flag.
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
+
+ QHighDpiScaling::initHighDpiScaling();
+
// Load the platform integration
QString platformPluginPath = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
@@ -1206,6 +1249,11 @@ void QGuiApplicationPrivate::eventDispatcherReady()
createPlatformIntegration();
platform_integration->initialize();
+
+ // All platforms should have added screens at this point. Finish
+ // QHighDpiScaling initialization if it has not been done so already.
+ if (!QGuiApplicationPrivate::highDpiScalingUpdated)
+ QHighDpiScaling::updateHighDpiScaling();
}
void QGuiApplicationPrivate::init()
@@ -1218,7 +1266,18 @@ void QGuiApplicationPrivate::init()
#ifndef QT_NO_SESSIONMANAGER
QString session_id;
QString session_key;
+# if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ wchar_t guidstr[40];
+ GUID guid;
+ CoCreateGuid(&guid);
+ StringFromGUID2(guid, guidstr, 40);
+ session_id = QString::fromWCharArray(guidstr);
+ CoCreateGuid(&guid);
+ StringFromGUID2(guid, guidstr, 40);
+ session_key = QString::fromWCharArray(guidstr);
+# endif
#endif
+ QString s;
int j = argc ? 1 : 0;
for (int i=1; i<argc; i++) {
if (argv[i] && *argv[i] != '-') {
@@ -1233,7 +1292,6 @@ void QGuiApplicationPrivate::init()
pluginList << argv[i];
} else if (arg == "-reverse") {
force_reverse = true;
- QGuiApplication::setLayoutDirection(Qt::RightToLeft);
#ifdef Q_OS_MAC
} else if (arg.startsWith("-psn_")) {
// eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder.
@@ -1261,9 +1319,16 @@ void QGuiApplicationPrivate::init()
#endif
} else if (arg == "-testability") {
loadTestability = true;
+ } else if (arg.indexOf("-style=", 0) != -1) {
+ s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower());
+ } else if (arg == "-style" && i < argc-1) {
+ s = QString::fromLocal8Bit(argv[++i]).toLower();
} else {
argv[j++] = argv[i];
}
+
+ if (!s.isEmpty())
+ styleOverride = s;
}
if (j < argc) {
@@ -1281,13 +1346,6 @@ void QGuiApplicationPrivate::init()
if (platform_integration == 0)
createPlatformIntegration();
- // Set up blend function tables.
- qInitBlendFunctions();
- // Set up which span functions should be used in raster engine...
- qInitDrawhelperAsm();
- // and QImage conversion functions
- qInitImageConversions();
-
initPalette();
QFont::initialize();
@@ -1330,6 +1388,9 @@ void QGuiApplicationPrivate::init()
#endif
#ifndef QT_NO_LIBRARY
+ if (qEnvironmentVariableIntValue("QT_LOAD_TESTABILITY") > 0)
+ loadTestability = true;
+
if (loadTestability) {
QLibrary testLib(QStringLiteral("qttestability"));
if (testLib.load()) {
@@ -1344,7 +1405,12 @@ void QGuiApplicationPrivate::init()
qCritical() << "Library qttestability load failed:" << testLib.errorString();
}
}
+#else
+ Q_UNUSED(loadTestability);
#endif // QT_NO_LIBRARY
+
+ if (layout_direction == Qt::LayoutDirectionAuto || force_reverse)
+ QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight);
}
extern void qt_cleanupFontDatabase();
@@ -1693,12 +1759,14 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
// 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
// with the current event, we split it in two.
- QWindowSystemInterfacePrivate::MouseEvent *mouseButtonEvent = new QWindowSystemInterfacePrivate::MouseEvent(
- e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers);
+ QWindowSystemInterfacePrivate::MouseEvent mouseButtonEvent(
+ 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;
- QWindowSystemInterfacePrivate::windowSystemEventQueue.prepend(mouseButtonEvent);
- stateChange = Qt::NoButton;
+ mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
+ e->buttons = buttons;
+ processMouseEvent(e);
+ processMouseEvent(&mouseButtonEvent);
+ return;
}
QWindow *window = e->window.data();
@@ -1767,17 +1835,23 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
if (!window)
return;
- QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers);
- ev.setTimestamp(e->timestamp);
- setMouseEventSource(&ev, e->source);
#ifndef QT_NO_CURSOR
if (!e->synthetic()) {
if (const QScreen *screen = window->screen())
- if (QPlatformCursor *cursor = screen->handle()->cursor())
+ if (QPlatformCursor *cursor = screen->handle()->cursor()) {
+ 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);
+ ev.setTimestamp(e->timestamp);
cursor->pointerEvent(ev);
+ }
}
#endif
+ QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source);
+ ev.setTimestamp(e->timestamp);
+
if (window->d_func()->blockedByModalWindow) {
// a modal window is blocking this window, don't allow mouse events through
return;
@@ -1789,6 +1863,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
}
QGuiApplication::sendSpontaneousEvent(window, &ev);
+ e->eventAccepted = ev.isAccepted();
if (!e->synthetic() && !ev.isAccepted()
&& !frameStrut
&& qApp->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)) {
@@ -1817,7 +1892,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
points << point;
QEvent::Type type;
- QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::convertTouchPoints(points, &type);
+ QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::fromNativeTouchPoints(points, window, &type);
QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers);
fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
@@ -1828,9 +1903,8 @@ 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);
+ button, buttons, e->modifiers, e->source);
dblClickEvent.setTimestamp(e->timestamp);
- setMouseEventSource(&dblClickEvent, e->source);
QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent);
}
}
@@ -1882,19 +1956,6 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
window = QGuiApplication::focusWindow();
}
-#if !defined(Q_OS_OSX)
- // On OS X the shortcut override is checked earlier, see: QWindowSystemInterface::handleKeyEvent()
- const bool checkShortcut = e->keyType == QEvent::KeyPress && window != 0;
- if (checkShortcut) {
- QKeyEvent override(QEvent::ShortcutOverride, e->key, e->modifiers,
- e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
- e->unicode, e->repeat, e->repeatCount);
- override.setTimestamp(e->timestamp);
- if (QWindowSystemInterface::tryHandleShortcutOverrideEvent(window, &override))
- return;
- }
-#endif // Q_OS_OSX
-
QKeyEvent ev(e->keyType, e->key, e->modifiers,
e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
e->unicode, e->repeat, e->repeatCount);
@@ -1922,6 +1983,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
}
}
#endif
+ e->eventAccepted = ev.isAccepted();
}
void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
@@ -2030,10 +2092,17 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa
void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse)
{
if (QWindow *window = wse->window.data()) {
- if (QScreen *screen = wse->screen.data())
- window->d_func()->setTopLevelScreen(screen, false /* recreate */);
- else // Fall back to default behavior, and try to find some appropriate screen
- window->setScreen(0);
+ if (window->isTopLevel()) {
+ if (QScreen *screen = wse->screen.data())
+ window->d_func()->setTopLevelScreen(screen, false /* recreate */);
+ else // Fall back to default behavior, and try to find some appropriate screen
+ window->setScreen(0);
+ }
+ // 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());
+ processGeometryChangeEvent(&gce);
+ }
}
}
@@ -3201,7 +3270,10 @@ void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction)
Qt::LayoutDirection QGuiApplication::layoutDirection()
{
- return layout_direction;
+ // layout_direction is only ever Qt::LayoutDirectionAuto if setLayoutDirection
+ // was never called, or called with Qt::LayoutDirectionAuto (which is a no-op).
+ // In that case we return the default LeftToRight.
+ return layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction;
}
/*!
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index c89268d8d4..d995387d66 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -70,6 +70,7 @@ class Q_GUI_EXPORT QGuiApplication : public QCoreApplication
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged)
Q_PROPERTY(QString platformName READ platformName STORED false)
Q_PROPERTY(bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed)
+ Q_PROPERTY(QScreen *primaryScreen READ primaryScreen NOTIFY primaryScreenChanged STORED false)
public:
#ifdef Q_QDOC
@@ -158,6 +159,7 @@ Q_SIGNALS:
void fontDatabaseChanged();
void screenAdded(QScreen *screen);
void screenRemoved(QScreen *screen);
+ void primaryScreenChanged(QScreen *screen);
void lastWindowClosed();
void focusObjectChanged(QObject *focusObject);
void focusWindowChanged(QWindow *focusWindow);
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 0559442049..7c7da9790b 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -202,6 +202,7 @@ public:
static QWindow *currentMouseWindow;
static QWindow *currentMousePressWindow;
static Qt::ApplicationState applicationState;
+ static bool highDpiScalingUpdated;
#ifndef QT_NO_CLIPBOARD
static QClipboard *qt_clipboard;
@@ -219,6 +220,7 @@ public:
static QFont *app_font;
+ static QString styleOverride;
static QStyleHints *styleHints;
static bool obey_desktop_settings;
QInputMethod *inputMethod;
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index ce4a0ec09e..a0769ca671 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -175,7 +175,8 @@ static bool convert(const QVariant::Private *d, int t,
switch (t) {
case QVariant::ByteArray:
if (d->type == QVariant::Color) {
- *static_cast<QByteArray *>(result) = v_cast<QColor>(d)->name().toLatin1();
+ const QColor *c = v_cast<QColor>(d);
+ *static_cast<QByteArray *>(result) = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb).toLatin1();
return true;
}
break;
@@ -190,9 +191,11 @@ static bool convert(const QVariant::Private *d, int t,
case QVariant::Font:
*str = v_cast<QFont>(d)->toString();
return true;
- case QVariant::Color:
- *str = v_cast<QColor>(d)->name();
+ case QVariant::Color: {
+ const QColor *c = v_cast<QColor>(d);
+ *str = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb);
return true;
+ }
default:
break;
}
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
new file mode 100644
index 0000000000..b0ef2a284f
--- /dev/null
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -0,0 +1,423 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 "qhighdpiscaling_p.h"
+#include "qguiapplication.h"
+#include "qscreen.h"
+#include "qplatformintegration.h"
+#include "private/qscreen_p.h"
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcScaling, "qt.scaling");
+
+#ifndef QT_NO_HIGHDPISCALING
+static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO";
+static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR";
+static const char autoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR";
+static const char screenFactorsEnvVar[] = "QT_SCREEN_SCALE_FACTORS";
+
+static inline qreal initialGlobalScaleFactor()
+{
+
+ qreal result = 1;
+ if (qEnvironmentVariableIsSet(scaleFactorEnvVar)) {
+ bool ok;
+ const qreal f = qgetenv(scaleFactorEnvVar).toDouble(&ok);
+ if (ok && f > 0) {
+ qCDebug(lcScaling) << "Apply " << scaleFactorEnvVar << f;
+ result = f;
+ }
+ } else {
+ if (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)) {
+ qWarning() << "Warning:" << legacyDevicePixelEnvVar << "is deprecated. Instead use:" << endl
+ << " " << autoScreenEnvVar << "to enable platform plugin controlled per-screen factors." << endl
+ << " " << screenFactorsEnvVar << "to set per-screen factors." << endl
+ << " " << scaleFactorEnvVar << "to set the application global scale factor.";
+
+ int dpr = qEnvironmentVariableIntValue(legacyDevicePixelEnvVar);
+ if (dpr > 0)
+ result = dpr;
+ }
+ }
+ return result;
+}
+
+/*!
+ \class QHighDpiScaling
+ \since 5.6
+ \internal
+ \preliminary
+ \ingroup qpa
+
+ \brief Collection of utility functions for UI scaling.
+
+ QHighDpiScaling implements utility functions for high-dpi scaling for use
+ on operating systems that provide limited support for native scaling. In
+ addition this functionality can be used for simulation and testing purposes.
+
+ The functions support scaling between the device independent coordinate
+ system used by Qt applications and the native coordinate system used by
+ the platform plugins. Intended usage locations are the low level / platform
+ plugin interfacing parts of QtGui, for example the QWindow, QScreen and
+ QWindowSystemInterface implementation.
+
+ There are now up to three active coordinate systems in Qt:
+
+ ---------------------------------------------------
+ | Application Device Independent Pixels | devicePixelRatio
+ | Qt Widgets | =
+ | Qt Gui |
+ |---------------------------------------------------| Qt Scale Factor
+ | Qt Gui QPlatform* Native Pixels | *
+ | Qt platform plugin |
+ |---------------------------------------------------| OS Scale Factor
+ | Display Device Pixels |
+ | (Graphics Buffers) |
+ -----------------------------------------------------
+
+ This is an simplification and shows the main coordinate system. All layers
+ may work with device pixels in specific cases: OpenGL, creating the backing
+ store, and QPixmap management. The "Native Pixels" coordinate system is
+ internal to Qt and should not be exposed to Qt users: Seen from the outside
+ there are only two coordinate systems: device independent pixels and device
+ pixels.
+
+ The devicePixelRatio seen by applications is the product of the Qt scale
+ factor and the OS scale factor. The value of the scale factors may be 1,
+ in which case two or more of the coordinate systems are equivalent. Platforms
+ that (may) have an OS scale factor include OS X, iOS and Wayland.
+
+ Note that the functions in this file do not work with the OS scale factor
+ directly and are limited to converting between device independent and native
+ pixels. The OS scale factor is accunted for by QWindow::devicePixelRatio()
+ and similar functions.
+
+ Configuration Examples:
+
+ 'Classic': Device Independent Pixels = Native Pixels = Device Pixels
+ --------------------------------------------------- devicePixelRatio: 1
+ | Application / Qt Gui 100 x 100 |
+ | | Qt Scale Factor: 1
+ | Qt Platform / OS 100 x 100 |
+ | | OS Scale Factor: 1
+ | Display 100 x 100 |
+ -----------------------------------------------------
+
+ 'Retina Device': Device Independent Pixels = Native Pixels
+ --------------------------------------------------- devicePixelRatio: 2
+ | Application / Qt Gui 100 x 100 |
+ | | Qt Scale Factor: 1
+ | Qt Platform / OS 100 x 100 |
+ |---------------------------------------------------| OS Scale Factor: 2
+ | Display 200 x 200 |
+ -----------------------------------------------------
+
+ '2x Qt Scaling': Native Pixels = Device Pixels
+ --------------------------------------------------- devicePixelRatio: 2
+ | Application / Qt Gui 100 x 100 |
+ |---------------------------------------------------| Qt Scale Factor: 2
+ | Qt Platform / OS 200 x 200 |
+ | | OS Scale Factor: 1
+ | Display 200 x 200 |
+ -----------------------------------------------------
+
+ The Qt Scale Factor is the product of two sub-scale factors, which
+ are independently either set or determined by the platform plugin.
+ Several APIs are offered for this, targeting both developers and
+ end users. All scale factors are of type qreal.
+
+ 1) A global scale factor
+ The QT_SCALE_FACTOR environment variable can be used to set
+ a global scale factor for all windows in the processs. This
+ is useful for testing and debugging (you can simulate any
+ devicePixelRatio without needing access to sepcial hardware),
+ and perhaps also for targeting a specific application to
+ a specific display type (embedded use cases).
+
+ 2) A per-screen scale factors
+ Some platform plugins support providing a per-screen scale
+ factor based on display density information. These platforms
+ include X11, Windows, and Android.
+
+ There are two APIs for enabling or disabling this behavior:
+ - The QT_AUTO_SCREEN_SCALE_FACTOR environment variable.
+ - The AA_EnableHighDpiScaling and AA_DisableHighDpiScaling
+ application attributes
+
+ Enabling either will make QHighDpiScaling call QPlatformScreen::pixelDensity()
+ and use the value provided as the scale factor for the screen in
+ question. Disabling is done on a 'veto' basis where either the
+ environment or the application source can disable. The intended use
+ cases are 'My system is not providing correct display density
+ information' and 'My application needs to work in display pixels',
+ respectively.
+
+ The QT_SCREEN_SCALE_FACTORS environment variable can be used to set the screen
+ scale factors manually.Set this to a semicolon-separated
+ list of scale factors (matching the order of QGuiApplications::screens()),
+ or to a list of name=value pairs (where name matches QScreen::name()).
+
+ Coordinate conversion functions must be used when writing code that passes
+ geometry across the Qt Gui / Platform plugin boundary. The main conversion
+ functions are:
+ T toNativePixels(T, QWindow *)
+ T fromNativePixels(T, QWindow*)
+
+ The following classes in QtGui use native pixels, for the convenience of the
+ plataform plugins:
+ QPlatformWindow
+ QPlatformScreen
+ QWindowSystemInterface (API only - Events are in device independent pixels)
+
+ As a special consideration platform plugin code should be careful about
+ calling QtGui geometry accessor functions:
+ QRect r = window->geometry();
+ Here the returned geometry is in device independent pixels. Add a conversion call:
+ QRect r = QHighDpi::toNativePixels(window->geometry());
+ (Avoiding calling QWindow and instead using the QPlatformWindow geometry
+ might be a better course of action in this case.)
+*/
+
+qreal QHighDpiScaling::m_factor = 1.0;
+bool QHighDpiScaling::m_active = false; //"overall active" - is there any scale factor set.
+bool QHighDpiScaling::m_usePixelDensity = false; // use scale factor from platform plugin
+bool QHighDpiScaling::m_pixelDensityScalingActive = false; // pixel density scale factor > 1
+bool QHighDpiScaling::m_globalScalingActive = false; // global scale factor is active
+bool QHighDpiScaling::m_screenFactorSet = false; // QHighDpiScaling::setScreenFactor has been used
+QDpi QHighDpiScaling::m_logicalDpi = QDpi(-1,-1); // The scaled logical DPI of the primary screen
+
+/*
+ Initializes the QHighDpiScaling global variables. Called before the
+ platform plugin is created.
+*/
+
+static inline bool usePixelDensity()
+{
+ // Determine if we should set a scale factor based on the pixel density
+ // reported by the platform plugin. There are several enablers and several
+ // disablers. A single disable may veto all other enablers.
+ if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling))
+ return false;
+ bool screenEnvValueOk;
+ const int screenEnvValue = qEnvironmentVariableIntValue(autoScreenEnvVar, &screenEnvValueOk);
+ if (screenEnvValueOk && screenEnvValue < 1)
+ return false;
+ return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling)
+ || (screenEnvValueOk && screenEnvValue > 0)
+ || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto");
+}
+
+void QHighDpiScaling::initHighDpiScaling()
+{
+ // Determine if there is a global scale factor set.
+ m_factor = initialGlobalScaleFactor();
+ m_globalScalingActive = !qFuzzyCompare(m_factor, qreal(1));
+
+ m_usePixelDensity = usePixelDensity();
+
+ m_pixelDensityScalingActive = false; //set in updateHighDpiScaling below
+
+ // we update m_active in updateHighDpiScaling, but while we create the
+ // screens, we have to assume that m_usePixelDensity implies scaling
+ m_active = m_globalScalingActive || m_usePixelDensity;
+}
+
+void QHighDpiScaling::updateHighDpiScaling()
+{
+ if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling))
+ return;
+
+ if (m_usePixelDensity && !m_pixelDensityScalingActive) {
+ Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
+ if (!qFuzzyCompare(screenSubfactor(screen->handle()), qreal(1))) {
+ m_pixelDensityScalingActive = true;
+ break;
+ }
+ }
+ }
+ if (qEnvironmentVariableIsSet(screenFactorsEnvVar)) {
+ int i = 0;
+ Q_FOREACH (const QByteArray &spec, qgetenv(screenFactorsEnvVar).split(';')) {
+ QScreen *screen = 0;
+ int equalsPos = spec.lastIndexOf('=');
+ double factor = 0;
+ if (equalsPos > 0) {
+ // support "name=factor"
+ QByteArray name = spec.mid(0, equalsPos);
+ QByteArray f = spec.mid(equalsPos + 1);
+ bool ok;
+ factor = f.toDouble(&ok);
+ if (ok) {
+ Q_FOREACH (QScreen *s, QGuiApplication::screens()) {
+ if (s->name() == QString::fromLocal8Bit(name)) {
+ screen = s;
+ break;
+ }
+ }
+ }
+ } else {
+ // listing screens in order
+ bool ok;
+ factor = spec.toDouble(&ok);
+ if (ok && i < QGuiApplication::screens().count())
+ screen = QGuiApplication::screens().at(i);
+ }
+ if (screen)
+ setScreenFactor(screen, factor);
+ ++i;
+ }
+ }
+ m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
+
+ QPlatformScreen *primaryScreen = QGuiApplication::primaryScreen()->handle();
+ qreal sf = screenSubfactor(primaryScreen);
+ QDpi primaryDpi = primaryScreen->logicalDpi();
+ m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf);
+}
+
+/*
+ Sets the global scale factor which is applied to all windows.
+*/
+void QHighDpiScaling::setGlobalFactor(qreal factor)
+{
+ if (qFuzzyCompare(factor, m_factor))
+ return;
+ if (!QGuiApplication::allWindows().isEmpty())
+ qWarning("QHighDpiScaling::setFactor: Should only be called when no windows exist.");
+
+ m_globalScalingActive = !qFuzzyCompare(factor, qreal(1));
+ m_factor = m_globalScalingActive ? factor : qreal(1);
+ m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
+ Q_FOREACH (QScreen *screen, QGuiApplication::screens())
+ screen->d_func()->updateHighDpi();
+}
+
+static const char scaleFactorProperty[] = "_q_scaleFactor";
+
+/*
+ Sets a per-screen scale factor.
+*/
+void QHighDpiScaling::setScreenFactor(QScreen *screen, qreal factor)
+{
+ m_screenFactorSet = true;
+ m_active = true;
+ screen->setProperty(scaleFactorProperty, QVariant(factor));
+
+ // hack to force re-evaluation of screen geometry
+ if (screen->handle())
+ screen->d_func()->setPlatformScreen(screen->handle()); // updates geometries based on scale factor
+}
+
+QPoint QHighDpiScaling::mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen)
+{
+ if (!platformScreen)
+ return pos;
+ const qreal scaleFactor = factor(platformScreen);
+ const QPoint topLeft = platformScreen->geometry().topLeft();
+ return (pos - topLeft) * scaleFactor + topLeft;
+}
+
+QPoint QHighDpiScaling::mapPositionFromNative(const QPoint &pos, const QPlatformScreen *platformScreen)
+{
+ if (!platformScreen)
+ return pos;
+ const qreal scaleFactor = factor(platformScreen);
+ const QPoint topLeft = platformScreen->geometry().topLeft();
+ return (pos - topLeft) / scaleFactor + topLeft;
+}
+
+qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen)
+{
+ qreal factor = qreal(1.0);
+ if (screen) {
+ if (m_usePixelDensity)
+ factor *= screen->pixelDensity();
+ if (m_screenFactorSet) {
+ QVariant screenFactor = screen->screen()->property(scaleFactorProperty);
+ if (screenFactor.isValid())
+ factor *= screenFactor.toReal();
+ }
+ }
+ return factor;
+}
+
+QDpi QHighDpiScaling::logicalDpi()
+{
+ return m_logicalDpi;
+}
+
+qreal QHighDpiScaling::factor(const QScreen *screen)
+{
+ // Fast path for when scaling in Qt is not used at all.
+ if (!m_active)
+ return qreal(1.0);
+
+ // The effective factor for a given screen is the product of the
+ // screen and global sub-factors
+ qreal factor = m_factor;
+ if (screen)
+ factor *= screenSubfactor(screen->handle());
+ return factor;
+}
+
+qreal QHighDpiScaling::factor(const QPlatformScreen *platformScreen)
+{
+ if (!m_active)
+ return qreal(1.0);
+
+ return m_factor * screenSubfactor(platformScreen);
+}
+
+qreal QHighDpiScaling::factor(const QWindow *window)
+{
+ if (!m_active)
+ return qreal(1.0);
+
+ return factor(window ? window->screen() : QGuiApplication::primaryScreen());
+}
+
+QPoint QHighDpiScaling::origin(const QScreen *screen)
+{
+ return screen->geometry().topLeft();
+}
+
+QPoint QHighDpiScaling::origin(const QPlatformScreen *platformScreen)
+{
+ return platformScreen->geometry().topLeft();
+}
+
+#endif //QT_NO_HIGHDPISCALING
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
new file mode 100644
index 0000000000..9e33787f53
--- /dev/null
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -0,0 +1,514 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 QHIGHDPISCALING_P_H
+#define QHIGHDPISCALING_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/qglobal.h>
+#include <QtCore/qmargins.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qloggingcategory.h>
+#include <QtGui/qregion.h>
+#include <QtGui/qscreen.h>
+#include <QtGui/qwindow.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_LOGGING_CATEGORY(lcScaling);
+
+class QScreen;
+class QPlatformScreen;
+typedef QPair<qreal, qreal> QDpi;
+
+#ifndef QT_NO_HIGHDPISCALING
+class Q_GUI_EXPORT QHighDpiScaling {
+public:
+ static void initHighDpiScaling();
+ static void updateHighDpiScaling();
+ static void setGlobalFactor(qreal factor);
+ static void setScreenFactor(QScreen *window, qreal factor);
+
+ static bool isActive() { return m_active; }
+ static qreal factor(const QWindow *window);
+ static qreal factor(const QScreen *screen);
+ static qreal factor(const QPlatformScreen *platformScreen);
+ static QPoint origin(const QScreen *screen);
+ static QPoint origin(const QPlatformScreen *platformScreen);
+ static QPoint mapPositionFromNative(const QPoint &pos, const QPlatformScreen *platformScreen);
+ static QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen);
+ static QDpi logicalDpi();
+
+private:
+ static qreal screenSubfactor(const QPlatformScreen *screen);
+
+ static qreal m_factor;
+ static bool m_active;
+ static bool m_usePixelDensity;
+ static bool m_globalScalingActive;
+ static bool m_pixelDensityScalingActive;
+ static bool m_screenFactorSet;
+ static QDpi m_logicalDpi;
+};
+
+// Coordinate system conversion functions:
+// QHighDpi::fromNativePixels : from physical(screen/backing) to logical pixels
+// QHighDpi::toNativePixels : from logical to physical pixels
+
+namespace QHighDpi {
+
+inline QPointF fromNative(const QPointF &pos, qreal scaleFactor, const QPointF &origin)
+{
+ return (pos - origin) / scaleFactor + origin;
+}
+
+inline QPointF toNative(const QPointF &pos, qreal scaleFactor, const QPointF &origin)
+{
+ return (pos - origin) * scaleFactor + origin;
+}
+
+inline QPoint fromNative(const QPoint &pos, qreal scaleFactor, const QPoint &origin)
+{
+ return (pos - origin) / scaleFactor + origin;
+}
+
+inline QPoint toNative(const QPoint &pos, qreal scaleFactor, const QPoint &origin)
+{
+ return (pos - origin) * scaleFactor + origin;
+}
+
+inline QPoint fromNative(const QPoint &pos, qreal scaleFactor)
+{
+ return pos / scaleFactor;
+}
+
+inline QPoint toNative(const QPoint &pos, qreal scaleFactor)
+{
+ return pos * scaleFactor;
+}
+
+inline QSize fromNative(const QSize &size, qreal scaleFactor)
+{
+ return size / scaleFactor; // TODO: should we round up?
+}
+
+inline QSize toNative(const QSize &size, qreal scaleFactor)
+{
+ return size * scaleFactor;
+}
+
+inline QSizeF fromNative(const QSizeF &size, qreal scaleFactor)
+{
+ return size / scaleFactor;
+}
+
+inline QSizeF toNative(const QSizeF &size, qreal scaleFactor)
+{
+ return size * scaleFactor;
+}
+
+inline QRect fromNative(const QRect &rect, qreal scaleFactor, const QPoint &origin)
+{
+ return QRect(fromNative(rect.topLeft(), scaleFactor, origin), fromNative(rect.size(), scaleFactor));
+}
+
+inline QRect toNative(const QRect &rect, qreal scaleFactor, const QPoint &origin)
+{
+ return QRect(toNative(rect.topLeft(), scaleFactor, origin), toNative(rect.size(), scaleFactor));
+
+}
+
+inline QRect fromNative(const QRect &rect, const QScreen *screen, const QPoint &screenOrigin)
+{
+ return toNative(rect, QHighDpiScaling::factor(screen), screenOrigin);
+}
+
+inline QRect fromNativeScreenGeometry(const QRect &nativeScreenGeometry, const QScreen *screen)
+{
+ return QRect(nativeScreenGeometry.topLeft(),
+ fromNative(nativeScreenGeometry.size(), QHighDpiScaling::factor(screen)));
+}
+
+inline QPoint fromNativeLocalPosition(const QPoint &pos, const QWindow *window)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return pos / scaleFactor;
+}
+
+inline QPoint toNativeLocalPosition(const QPoint &pos, const QWindow *window)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return pos * scaleFactor;
+}
+
+inline QPointF fromNativeLocalPosition(const QPointF &pos, const QWindow *window)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return pos / scaleFactor;
+}
+
+inline QPointF toNativeLocalPosition(const QPointF &pos, const QWindow *window)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return pos * scaleFactor;
+}
+
+inline QRect fromNativePixels(const QRect &pixelRect, const QPlatformScreen *platformScreen)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(platformScreen);
+ const QPoint origin = QHighDpiScaling::origin(platformScreen);
+ return QRect(fromNative(pixelRect.topLeft(), scaleFactor, origin),
+ fromNative(pixelRect.size(), scaleFactor));
+}
+
+inline QRect toNativePixels(const QRect &pointRect, const QPlatformScreen *platformScreen)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(platformScreen);
+ const QPoint origin = QHighDpiScaling::origin(platformScreen);
+ return QRect(toNative(pointRect.topLeft(), scaleFactor, origin),
+ toNative(pointRect.size(), scaleFactor));
+}
+
+inline QRect fromNativePixels(const QRect &pixelRect, const QScreen *screen)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(screen);
+ const QPoint origin = QHighDpiScaling::origin(screen);
+ return QRect(fromNative(pixelRect.topLeft(), scaleFactor, origin),
+ fromNative(pixelRect.size(), scaleFactor));
+}
+
+inline QRect toNativePixels(const QRect &pointRect, const QScreen *screen)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(screen);
+ const QPoint origin = QHighDpiScaling::origin(screen);
+ return QRect(toNative(pointRect.topLeft(), scaleFactor, origin),
+ toNative(pointRect.size(), scaleFactor));
+}
+
+inline QRect fromNativePixels(const QRect &pixelRect, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen()) {
+ return fromNativePixels(pixelRect, window->screen());
+ } else {
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return QRect(pixelRect.topLeft() / scaleFactor, fromNative(pixelRect.size(), scaleFactor));
+ }
+}
+
+inline QRectF toNativePixels(const QRectF &pointRect, const QScreen *screen)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(screen);
+ const QPoint origin = QHighDpiScaling::origin(screen);
+ return QRectF(toNative(pointRect.topLeft(), scaleFactor, origin),
+ toNative(pointRect.size(), scaleFactor));
+}
+
+inline QRect toNativePixels(const QRect &pointRect, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen()) {
+ return toNativePixels(pointRect, window->screen());
+ } else {
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return QRect(pointRect.topLeft() * scaleFactor, toNative(pointRect.size(), scaleFactor));
+ }
+}
+
+inline QRectF fromNativePixels(const QRectF &pixelRect, const QScreen *screen)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(screen);
+ const QPoint origin = QHighDpiScaling::origin(screen);
+ return QRectF(fromNative(pixelRect.topLeft(), scaleFactor, origin),
+ fromNative(pixelRect.size(), scaleFactor));
+}
+
+inline QRectF fromNativePixels(const QRectF &pixelRect, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen()) {
+ return fromNativePixels(pixelRect, window->screen());
+ } else {
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return QRectF(pixelRect.topLeft() / scaleFactor, pixelRect.size() / scaleFactor);
+ }
+}
+
+inline QRectF toNativePixels(const QRectF &pointRect, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen()) {
+ return toNativePixels(pointRect, window->screen());
+ } else {
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return QRectF(pointRect.topLeft() * scaleFactor, pointRect.size() * scaleFactor);
+ }
+}
+
+inline QSize fromNativePixels(const QSize &pixelSize, const QWindow *window)
+{
+ return pixelSize / QHighDpiScaling::factor(window);
+}
+
+inline QSize toNativePixels(const QSize &pointSize, const QWindow *window)
+{
+ return pointSize * QHighDpiScaling::factor(window);
+}
+
+inline QSizeF fromNativePixels(const QSizeF &pixelSize, const QWindow *window)
+{
+ return pixelSize / QHighDpiScaling::factor(window);
+}
+
+inline QSizeF toNativePixels(const QSizeF &pointSize, const QWindow *window)
+{
+ return pointSize * QHighDpiScaling::factor(window);
+}
+
+inline QPoint fromNativePixels(const QPoint &pixelPoint, const QScreen *screen)
+{
+ return fromNative(pixelPoint, QHighDpiScaling::factor(screen), QHighDpiScaling::origin(screen));
+}
+
+inline QPoint fromNativePixels(const QPoint &pixelPoint, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen())
+ return fromNativePixels(pixelPoint, window->screen());
+ else
+ return pixelPoint / QHighDpiScaling::factor(window);
+}
+
+inline QPoint toNativePixels(const QPoint &pointPoint, const QScreen *screen)
+{
+ return toNative(pointPoint, QHighDpiScaling::factor(screen), QHighDpiScaling::origin(screen));
+}
+
+inline QPoint toNativePixels(const QPoint &pointPoint, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen())
+ return toNativePixels(pointPoint, window->screen());
+ else
+ return pointPoint * QHighDpiScaling::factor(window);
+}
+
+inline QPointF fromNativePixels(const QPointF &pixelPoint, const QScreen *screen)
+{
+ return fromNative(pixelPoint, QHighDpiScaling::factor(screen), QHighDpiScaling::origin(screen));
+}
+
+inline QPointF fromNativePixels(const QPointF &pixelPoint, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen())
+ return fromNativePixels(pixelPoint, window->screen());
+ else
+ return pixelPoint / QHighDpiScaling::factor(window);
+}
+
+inline QPointF toNativePixels(const QPointF &pointPoint, const QScreen *screen)
+{
+ return toNative(pointPoint, QHighDpiScaling::factor(screen), QHighDpiScaling::origin(screen));
+}
+
+inline QPointF toNativePixels(const QPointF &pointPoint, const QWindow *window)
+{
+ if (window && window->isTopLevel() && window->screen())
+ return toNativePixels(pointPoint, window->screen());
+ else
+ return pointPoint * QHighDpiScaling::factor(window);
+}
+
+inline QMargins fromNativePixels(const QMargins &pixelMargins, const QWindow *window)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return QMargins(pixelMargins.left() / scaleFactor, pixelMargins.top() / scaleFactor,
+ pixelMargins.right() / scaleFactor, pixelMargins.bottom() / scaleFactor);
+}
+
+inline QMargins toNativePixels(const QMargins &pointMargins, const QWindow *window)
+{
+ const qreal scaleFactor = QHighDpiScaling::factor(window);
+ return QMargins(pointMargins.left() * scaleFactor, pointMargins.top() * scaleFactor,
+ pointMargins.right() * scaleFactor, pointMargins.bottom() * scaleFactor);
+}
+
+inline QRegion fromNativeLocalRegion(const QRegion &pixelRegion, const QWindow *window)
+{
+ if (!QHighDpiScaling::isActive())
+ return pixelRegion;
+
+ qreal scaleFactor = QHighDpiScaling::factor(window);
+ QRegion pointRegion;
+ foreach (const QRect &rect, pixelRegion.rects()) {
+ pointRegion += QRect(fromNative(rect.topLeft(), scaleFactor),
+ fromNative(rect.size(), scaleFactor));
+ }
+ return pointRegion;
+}
+
+inline QRegion toNativeLocalRegion(const QRegion &pointRegion, const QWindow *window)
+{
+ if (!QHighDpiScaling::isActive())
+ return pointRegion;
+
+ qreal scaleFactor = QHighDpiScaling::factor(window);
+ QRegion pixelRegon;
+ foreach (const QRect &rect, pointRegion.rects()) {
+ pixelRegon += QRect(toNative(rect.topLeft(), scaleFactor),
+ toNative(rect.size(), scaleFactor));
+ }
+ return pixelRegon;
+}
+
+// Any T that has operator/()
+template <typename T>
+T fromNativePixels(const T &pixelValue, const QWindow *window)
+{
+ if (!QHighDpiScaling::isActive())
+ return pixelValue;
+
+ return pixelValue / QHighDpiScaling::factor(window);
+
+}
+
+ //##### ?????
+template <typename T>
+T fromNativePixels(const T &pixelValue, const QScreen *screen)
+{
+ if (!QHighDpiScaling::isActive())
+ return pixelValue;
+
+ return pixelValue / QHighDpiScaling::factor(screen);
+
+}
+
+// Any T that has operator*()
+template <typename T>
+T toNativePixels(const T &pointValue, const QWindow *window)
+{
+ if (!QHighDpiScaling::isActive())
+ return pointValue;
+
+ return pointValue * QHighDpiScaling::factor(window);
+}
+
+template <typename T>
+T toNativePixels(const T &pointValue, const QScreen *screen)
+{
+ if (!QHighDpiScaling::isActive())
+ return pointValue;
+
+ return pointValue * QHighDpiScaling::factor(screen);
+}
+
+
+// Any QVector<T> where T has operator/()
+template <typename T>
+QVector<T> fromNativePixels(const QVector<T> &pixelValues, const QWindow *window)
+{
+ if (!QHighDpiScaling::isActive())
+ return pixelValues;
+
+ QVector<T> pointValues;
+ foreach (const T& pixelValue, pixelValues)
+ pointValues.append(pixelValue / QHighDpiScaling::factor(window));
+ return pointValues;
+}
+
+// Any QVector<T> where T has operator*()
+template <typename T>
+QVector<T> toNativePixels(const QVector<T> &pointValues, const QWindow *window)
+{
+ if (!QHighDpiScaling::isActive())
+ return pointValues;
+
+ QVector<T> pixelValues;
+ foreach (const T& pointValue, pointValues)
+ pixelValues.append(pointValue * QHighDpiScaling::factor(window));
+ return pixelValues;
+}
+
+} // namespace QHighDpi
+#else // QT_NO_HIGHDPISCALING
+class Q_GUI_EXPORT QHighDpiScaling {
+public:
+ static inline void initHighDpiScaling() {}
+ static inline void updateHighDpiScaling() {}
+ static inline void setGlobalFactor(qreal) {}
+ static inline void setScreenFactor(QScreen *, qreal) {}
+
+ static inline bool isActive() { return false; }
+ static inline qreal factor(const QWindow *) { return 1.0; }
+ static inline qreal factor(const QScreen *) { return 1.0; }
+ static inline qreal factor(const QPlatformScreen *) { return 1.0; }
+ static inline QPoint origin(const QScreen *) { return QPoint(); }
+ static inline QPoint origin(const QPlatformScreen *) { return QPoint(); }
+ static inline QPoint mapPositionFromNative(const QPoint &pos, const QPlatformScreen *) { return pos; }
+ static inline QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *) { return pos; }
+ static inline QDpi logicalDpi() { return QDpi(-1,-1); }
+};
+
+namespace QHighDpi {
+ template <typename T> inline
+ T toNative(const T &value, ...) { return value; }
+ template <typename T> inline
+ T fromNative(const T &value, ...) { return value; }
+
+ template <typename T> inline
+ T fromNativeLocalPosition(const T &value, ...) { return value; }
+ template <typename T> inline
+ T toNativeLocalPosition(const T &value, ...) { return value; }
+
+ template <typename T> inline
+ T fromNativeLocalRegion(const T &value, ...) { return value; }
+ template <typename T> inline
+ T toNativeLocalRegion(const T &value, ...) { return value; }
+
+ template <typename T> inline
+ T fromNativeScreenGeometry(const T &value, ...) { return value; }
+
+ template <typename T, typename U> inline
+ T toNativePixels(const T &value, const U*) {return value;}
+ template <typename T, typename U> inline
+ T fromNativePixels(const T &value, const U*) {return value;}
+}
+#endif // QT_NO_HIGHDPISCALING
+QT_END_NAMESPACE
+
+#endif // QHIGHDPISCALING_P_H
diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp
index 8d51be853a..2684c43518 100644
--- a/src/gui/kernel/qinputmethod.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -147,6 +147,9 @@ QRectF QInputMethod::cursorRectangle() const
/*!
\property QInputMethod::keyboardRectangle
\brief Virtual keyboard's geometry in window coordinates.
+
+ This might be an empty rectangle if it is not possible to know the geometry
+ of the keyboard. This is the case for a floating keyboard on android.
*/
QRectF QInputMethod::keyboardRectangle() const
{
diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h
index 3e801bff3c..d7a7b1db8a 100644
--- a/src/gui/kernel/qinputmethod.h
+++ b/src/gui/kernel/qinputmethod.h
@@ -82,7 +82,7 @@ public:
QLocale locale() const;
Qt::LayoutDirection inputDirection() const;
- static QVariant queryFocusObject(Qt::InputMethodQuery query, QVariant argument);
+ static QVariant queryFocusObject(Qt::InputMethodQuery query, QVariant argument); // ### Qt 6: QVariant by const-ref
public Q_SLOTS:
void show();
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index 20dcbbc139..34003cdf41 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -50,7 +50,6 @@
#include <qlist.h>
#include <qlocale.h>
#include <qevent.h>
-#include <qhash.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 5bf22b9394..881d7cc76a 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -39,6 +39,7 @@
#ifndef QT_NO_SHORTCUT
#include "qdebug.h"
+#include <QtCore/qhashfunctions.h>
#ifndef QT_NO_REGEXP
# include "qregexp.h"
#endif
@@ -290,6 +291,7 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
\row \li InsertParagraphSeparator \li Enter \li Enter \li Enter \li Enter
\row \li InsertLineSeparator \li Shift+Enter \li Meta+Enter, Meta+O \li Shift+Enter \li Shift+Enter
\row \li Backspace \li (none) \li Meta+H \li (none) \li (none)
+ \row \li Cancel \li Escape \li Escape, Ctrl+. \li Escape \li Escape
\endtable
Note that, since the key sequences used for the standard shortcuts differ
@@ -751,6 +753,7 @@ static const struct {
\value ZoomIn Zoom in.
\value ZoomOut Zoom out.
\value FullScreen Toggle the window state to/from full screen.
+ \value Cancel Cancel the current operation.
*/
/*!
@@ -818,6 +821,7 @@ QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat form
assign(key, format);
}
+Q_STATIC_ASSERT_X(QKeySequencePrivate::MaxKeyCount == 4, "Change docs and ctor impl below");
/*!
Constructs a key sequence with up to 4 keys \a k1, \a k2,
\a k3 and \a k4.
@@ -876,26 +880,19 @@ QKeySequence::~QKeySequence()
void QKeySequence::setKey(int key, int index)
{
- Q_ASSERT_X(index >= 0 && index < 4, "QKeySequence::setKey", "index out of range");
+ Q_ASSERT_X(index >= 0 && index < QKeySequencePrivate::MaxKeyCount, "QKeySequence::setKey", "index out of range");
qAtomicDetach(d);
d->key[index] = key;
}
+Q_STATIC_ASSERT_X(QKeySequencePrivate::MaxKeyCount == 4, "Change docs below");
/*!
Returns the number of keys in the key sequence.
The maximum is 4.
*/
int QKeySequence::count() const
{
- if (!d->key[0])
- return 0;
- if (!d->key[1])
- return 1;
- if (!d->key[2])
- return 2;
- if (!d->key[3])
- return 3;
- return 4;
+ return int(std::distance(d->key, std::find(d->key, d->key + QKeySequencePrivate::MaxKeyCount, 0)));
}
@@ -987,8 +984,8 @@ int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format)
int p = 0, diff = 0;
// Run through the whole string, but stop
- // if we have 4 keys before the end.
- while (keyseq.length() && n < 4) {
+ // if we have MaxKeyCount keys before the end.
+ while (keyseq.length() && n < QKeySequencePrivate::MaxKeyCount) {
// We MUST use something to separate each sequence, and space
// does not cut it, since some of the key names have space
// in them.. (Let's hope no one translate with a comma in it:)
@@ -1022,9 +1019,10 @@ struct QModifKeyName {
int qt_key;
QString name;
};
+Q_DECLARE_TYPEINFO(QModifKeyName, Q_MOVABLE_TYPE);
-Q_GLOBAL_STATIC(QList<QModifKeyName>, globalModifs)
-Q_GLOBAL_STATIC(QList<QModifKeyName>, globalPortableModifs)
+Q_GLOBAL_STATIC(QVector<QModifKeyName>, globalModifs)
+Q_GLOBAL_STATIC(QVector<QModifKeyName>, globalPortableModifs)
/*!
Constructs a single key from the string \a str.
@@ -1040,7 +1038,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
QString accel = str.toLower();
bool nativeText = (format == QKeySequence::NativeText);
- QList<QModifKeyName> *gmodifs;
+ QVector<QModifKeyName> *gmodifs;
if (nativeText) {
gmodifs = globalModifs();
if (gmodifs->isEmpty()) {
@@ -1076,7 +1074,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
if (!gmodifs) return ret;
- QList<QModifKeyName> modifs;
+ QVector<QModifKeyName> modifs;
if (nativeText) {
modifs << QModifKeyName(Qt::CTRL, QCoreApplication::translate("QShortcut", "Ctrl").toLower().append(QLatin1Char('+')))
<< QModifKeyName(Qt::SHIFT, QCoreApplication::translate("QShortcut", "Shift").toLower().append(QLatin1Char('+')))
@@ -1100,7 +1098,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
int i = 0;
int lastI = 0;
while ((i = sl.indexOf(QLatin1Char('+'), i + 1)) != -1) {
- const QString sub = sl.mid(lastI, i - lastI + 1);
+ const QStringRef sub = sl.midRef(lastI, i - lastI + 1);
// If we get here the shortcuts contains at least one '+'. We break up
// along the following strategy:
// Meta+Ctrl++ ( "Meta+", "Ctrl+", "+" )
@@ -1366,7 +1364,7 @@ QKeySequence::operator QVariant() const
*/
int QKeySequence::operator[](uint index) const
{
- Q_ASSERT_X(index < 4, "QKeySequence::operator[]", "index out of range");
+ Q_ASSERT_X(index < QKeySequencePrivate::MaxKeyCount, "QKeySequence::operator[]", "index out of range");
return d->key[index];
}
@@ -1409,6 +1407,16 @@ bool QKeySequence::operator==(const QKeySequence &other) const
d->key[3] == other.d->key[3]);
}
+/*!
+ \since 5.6
+
+ Calculates the hash value of \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW
+{
+ return qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed);
+}
/*!
Provides an arbitrary comparison of this key sequence and
@@ -1424,10 +1432,8 @@ bool QKeySequence::operator==(const QKeySequence &other) const
*/
bool QKeySequence::operator< (const QKeySequence &other) const
{
- for (int i = 0; i < 4; ++i)
- if (d->key[i] != other.d->key[i])
- return d->key[i] < other.d->key[i];
- return false;
+ return std::lexicographical_compare(d->key, d->key + QKeySequencePrivate::MaxKeyCount,
+ other.d->key, other.d->key + QKeySequencePrivate::MaxKeyCount);
}
/*!
@@ -1523,6 +1529,7 @@ QList<QKeySequence> QKeySequence::listFromString(const QString &str, SequenceFor
QList<QKeySequence> result;
QStringList strings = str.split(QLatin1String("; "));
+ result.reserve(strings.count());
foreach (const QString &string, strings) {
result << fromString(string, format);
}
@@ -1565,15 +1572,14 @@ QString QKeySequence::listToString(const QList<QKeySequence> &list, SequenceForm
*/
QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence)
{
- QList<quint32> list;
- list << keysequence.d->key[0];
-
- if (s.version() >= 5 && keysequence.count() > 1) {
- list << keysequence.d->key[1];
- list << keysequence.d->key[2];
- list << keysequence.d->key[3];
+ Q_STATIC_ASSERT_X(QKeySequencePrivate::MaxKeyCount == 4, "Forgot to adapt QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence) to new QKeySequence::MaxKeyCount");
+ const bool extended = s.version() >= 5 && keysequence.count() > 1;
+ s << quint32(extended ? 4 : 1) << quint32(keysequence.d->key[0]);
+ if (extended) {
+ s << quint32(keysequence.d->key[1])
+ << quint32(keysequence.d->key[2])
+ << quint32(keysequence.d->key[3]);
}
- s << list;
return s;
}
@@ -1588,11 +1594,19 @@ QDataStream &operator<<(QDataStream &s, const QKeySequence &keysequence)
*/
QDataStream &operator>>(QDataStream &s, QKeySequence &keysequence)
{
+ const quint32 MaxKeys = QKeySequencePrivate::MaxKeyCount;
+ quint32 c;
+ s >> c;
+ quint32 keys[MaxKeys] = {0};
+ for (uint i = 0; i < qMin(c, MaxKeys); ++i) {
+ if (s.atEnd()) {
+ qWarning("Premature EOF while reading QKeySequence");
+ return s;
+ }
+ s >> keys[i];
+ }
qAtomicDetach(keysequence.d);
- QList<quint32> list;
- s >> list;
- for (int i = 0; i < 4; ++i)
- keysequence.d->key[i] = list.value(i);
+ std::copy(keys, keys + MaxKeys, keysequence.d->key);
return s;
}
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index cd7af5718f..98a611aab5 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -43,11 +43,12 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_SHORTCUT
+class QKeySequence;
+
/*****************************************************************************
QKeySequence stream functions
*****************************************************************************/
#ifndef QT_NO_DATASTREAM
-class QKeySequence;
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &out, QKeySequence &ks);
#endif
@@ -59,6 +60,8 @@ void qt_set_sequence_auto_mnemonic(bool b);
class QVariant;
class QKeySequencePrivate;
+Q_GUI_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QKeySequence &key, uint seed = 0) Q_DECL_NOTHROW;
+
class Q_GUI_EXPORT QKeySequence
{
Q_GADGET
@@ -134,7 +137,8 @@ public:
FullScreen,
Deselect,
DeleteCompleteLine,
- Backspace
+ Backspace,
+ Cancel
};
Q_ENUM(StandardKey)
@@ -177,10 +181,10 @@ public:
int operator[](uint i) const;
QKeySequence &operator=(const QKeySequence &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QKeySequence &operator=(QKeySequence &&other)
- { qSwap(d, other.d); return *this; }
+ QKeySequence &operator=(QKeySequence &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- inline void swap(QKeySequence &other) { qSwap(d, other.d); }
+ void swap(QKeySequence &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
bool operator==(const QKeySequence &other) const;
inline bool operator!= (const QKeySequence &other) const
{ return !(*this == other); }
@@ -204,6 +208,7 @@ private:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
+ friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW;
friend class QShortcutMap;
friend class QShortcut;
diff --git a/src/gui/kernel/qkeysequence_p.h b/src/gui/kernel/qkeysequence_p.h
index 97416943d0..3e4c5bae88 100644
--- a/src/gui/kernel/qkeysequence_p.h
+++ b/src/gui/kernel/qkeysequence_p.h
@@ -47,6 +47,8 @@
#include "qkeysequence.h"
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SHORTCUT
@@ -61,20 +63,17 @@ struct Q_AUTOTEST_EXPORT QKeyBinding
class Q_AUTOTEST_EXPORT QKeySequencePrivate
{
public:
- enum { MaxKeyCount = 4 }; // used in QKeySequenceEdit
+ enum { MaxKeyCount = 4 }; // also used in QKeySequenceEdit
inline QKeySequencePrivate() : ref(1)
{
- key[0] = key[1] = key[2] = key[3] = 0;
+ std::fill_n(key, uint(MaxKeyCount), 0);
}
inline QKeySequencePrivate(const QKeySequencePrivate &copy) : ref(1)
{
- key[0] = copy.key[0];
- key[1] = copy.key[1];
- key[2] = copy.key[2];
- key[3] = copy.key[3];
+ std::copy(copy.key, copy.key + MaxKeyCount, key);
}
QAtomicInt ref;
- int key[4];
+ int key[MaxKeyCount];
static QString encodeString(int key, QKeySequence::SequenceFormat format);
static int decodeString(const QString &keyStr, QKeySequence::SequenceFormat format);
};
diff --git a/src/gui/kernel/qoffscreensurface.h b/src/gui/kernel/qoffscreensurface.h
index 909a1ef256..17bc8a7d17 100644
--- a/src/gui/kernel/qoffscreensurface.h
+++ b/src/gui/kernel/qoffscreensurface.h
@@ -51,7 +51,7 @@ class Q_GUI_EXPORT QOffscreenSurface : public QObject, public QSurface
public:
- explicit QOffscreenSurface(QScreen *screen = 0);
+ explicit QOffscreenSurface(QScreen *screen = Q_NULLPTR);
virtual ~QOffscreenSurface();
SurfaceType surfaceType() const Q_DECL_OVERRIDE;
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 56a3729a4a..3c033ea39e 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -226,7 +226,7 @@ public:
QOpenGLContext *context;
};
-static QThreadStorage<QGuiGLThreadContext *> qwindow_context_storage;
+Q_GLOBAL_STATIC(QThreadStorage<QGuiGLThreadContext *>, qwindow_context_storage);
static QOpenGLContext *global_share_context = 0;
#ifndef QT_NO_DEBUG
@@ -336,14 +336,14 @@ QOpenGLContext *qt_gl_global_share_context()
*/
QOpenGLContext *QOpenGLContextPrivate::setCurrentContext(QOpenGLContext *context)
{
- QGuiGLThreadContext *threadContext = qwindow_context_storage.localData();
+ QGuiGLThreadContext *threadContext = qwindow_context_storage()->localData();
if (!threadContext) {
if (!QThread::currentThread()) {
qWarning("No QTLS available. currentContext won't work");
return 0;
}
threadContext = new QGuiGLThreadContext;
- qwindow_context_storage.setLocalData(threadContext);
+ qwindow_context_storage()->setLocalData(threadContext);
}
QOpenGLContext *previous = threadContext->context;
threadContext->context = context;
@@ -412,8 +412,8 @@ int QOpenGLContextPrivate::maxTextureSize()
*/
QOpenGLContext* QOpenGLContext::currentContext()
{
- QGuiGLThreadContext *threadContext = qwindow_context_storage.localData();
- if(threadContext) {
+ QGuiGLThreadContext *threadContext = qwindow_context_storage()->localData();
+ if (threadContext) {
return threadContext->context;
}
return 0;
@@ -462,8 +462,7 @@ QPlatformOpenGLContext *QOpenGLContext::shareHandle() const
QOpenGLContext::QOpenGLContext(QObject *parent)
: QObject(*new QOpenGLContextPrivate(), parent)
{
- Q_D(QOpenGLContext);
- d->screen = QGuiApplication::primaryScreen();
+ setScreen(QGuiApplication::primaryScreen());
}
/*!
@@ -499,9 +498,20 @@ void QOpenGLContext::setShareContext(QOpenGLContext *shareContext)
void QOpenGLContext::setScreen(QScreen *screen)
{
Q_D(QOpenGLContext);
+ if (d->screen)
+ disconnect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(_q_screenDestroyed(QObject*)));
d->screen = screen;
if (!d->screen)
d->screen = QGuiApplication::primaryScreen();
+ if (d->screen)
+ connect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(_q_screenDestroyed(QObject*)));
+}
+
+void QOpenGLContextPrivate::_q_screenDestroyed(QObject *object)
+{
+ Q_Q(QOpenGLContext);
+ if (object == static_cast<QObject *>(screen))
+ q->setScreen(0);
}
/*!
@@ -719,6 +729,28 @@ QOpenGLFunctions *QOpenGLContext::functions() const
}
/*!
+ Get the QOpenGLExtraFunctions instance for this context.
+
+ QOpenGLContext offers this as a convenient way to access QOpenGLExtraFunctions
+ without having to manage it manually.
+
+ The context or a sharing context must be current.
+
+ The returned QOpenGLExtraFunctions instance is ready to be used and it
+ does not need initializeOpenGLFunctions() to be called.
+
+ \note QOpenGLExtraFunctions contains functionality that is not guaranteed to
+ be available at runtime. Runtime availability depends on the platform,
+ graphics driver, and the OpenGL version requested by the application.
+
+ \sa QOpenGLFunctions, QOpenGLExtraFunctions
+*/
+QOpenGLExtraFunctions *QOpenGLContext::extraFunctions() const
+{
+ return static_cast<QOpenGLExtraFunctions *>(functions());
+}
+
+/*!
\fn T *QOpenGLContext::versionFunctions() const
\overload versionFunctions()
@@ -1427,11 +1459,11 @@ void QOpenGLContextGroupPrivate::deletePendingResources(QOpenGLContext *ctx)
{
QMutexLocker locker(&m_mutex);
- QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
+ const QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
m_pendingDeletion.clear();
- QList<QOpenGLSharedResource *>::iterator it = pending.begin();
- QList<QOpenGLSharedResource *>::iterator end = pending.end();
+ QList<QOpenGLSharedResource *>::const_iterator it = pending.begin();
+ QList<QOpenGLSharedResource *>::const_iterator end = pending.end();
while (it != end) {
(*it)->freeResource(ctx);
delete *it;
@@ -1604,4 +1636,6 @@ void QOpenGLMultiGroupSharedResource::cleanup(QOpenGLContextGroup *group, QOpenG
m_groups.removeOne(group);
}
+#include "moc_qopenglcontext.cpp"
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index a529957ad6..841967a545 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -54,7 +54,10 @@
#include <QtGui/qopengl.h>
#include <QtGui/qopenglversionfunctions.h>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/qhash.h>
+#endif
+#include <QtCore/qhashfunctions.h>
#include <QtCore/qpair.h>
#include <QtCore/qvariant.h>
@@ -63,6 +66,7 @@ QT_BEGIN_NAMESPACE
class QOpenGLContextPrivate;
class QOpenGLContextGroupPrivate;
class QOpenGLFunctions;
+class QOpenGLExtraFunctions;
class QPlatformOpenGLContext;
class QScreen;
@@ -140,7 +144,7 @@ class Q_GUI_EXPORT QOpenGLContext : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QOpenGLContext)
public:
- explicit QOpenGLContext(QObject *parent = 0);
+ explicit QOpenGLContext(QObject *parent = Q_NULLPTR);
~QOpenGLContext();
void setFormat(const QSurfaceFormat &format);
@@ -174,6 +178,7 @@ public:
QPlatformOpenGLContext *shareHandle() const;
QOpenGLFunctions *functions() const;
+ QOpenGLExtraFunctions *extraFunctions() const;
QAbstractOpenGLFunctions *versionFunctions(const QOpenGLVersionProfile &versionProfile = QOpenGLVersionProfile()) const;
@@ -236,6 +241,8 @@ private:
void setTextureFunctions(QOpenGLTextureHelper* textureFuncs);
void destroy();
+
+ Q_PRIVATE_SLOT(d_func(), void _q_screenDestroyed(QObject *object))
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index f9f3ce2c5f..4a746bf12b 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -270,6 +270,8 @@ public:
static QHash<QOpenGLContext *, bool> makeCurrentTracker;
static QMutex makeCurrentTrackerMutex;
#endif
+
+ void _q_screenDestroyed(QObject *object);
};
Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index b2025faaf1..3a1126d318 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -664,15 +664,10 @@ int QOpenGLWindow::metric(PaintDeviceMetric metric) const
if (d->paintDevice)
return d->paintDevice->depth();
break;
- case PdmDevicePixelRatio:
- if (d->paintDevice)
- return devicePixelRatio();
- break;
default:
break;
}
return QPaintDeviceWindow::metric(metric);
-
}
/*!
diff --git a/src/gui/kernel/qopenglwindow.h b/src/gui/kernel/qopenglwindow.h
index f274275c3f..0c2b44c1c7 100644
--- a/src/gui/kernel/qopenglwindow.h
+++ b/src/gui/kernel/qopenglwindow.h
@@ -58,8 +58,8 @@ public:
PartialUpdateBlend
};
- explicit QOpenGLWindow(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = 0);
- explicit QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = 0);
+ explicit QOpenGLWindow(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = Q_NULLPTR);
+ explicit QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = Q_NULLPTR);
~QOpenGLWindow();
UpdateBehavior updateBehavior() const;
diff --git a/src/gui/kernel/qpaintdevicewindow.cpp b/src/gui/kernel/qpaintdevicewindow.cpp
index ff661d017d..cd894866c3 100644
--- a/src/gui/kernel/qpaintdevicewindow.cpp
+++ b/src/gui/kernel/qpaintdevicewindow.cpp
@@ -155,8 +155,10 @@ int QPaintDeviceWindow::metric(PaintDeviceMetric metric) const
return qRound(screen->physicalDotsPerInchY());
break;
case PdmDevicePixelRatio:
- if (screen)
- return screen->devicePixelRatio();
+ return int(QWindow::devicePixelRatio());
+ break;
+ case PdmDevicePixelRatioScaled:
+ return int(QWindow::devicePixelRatio() * devicePixelRatioFScale());
break;
default:
break;
diff --git a/src/gui/kernel/qpaintdevicewindow_p.h b/src/gui/kernel/qpaintdevicewindow_p.h
index e234906fe0..071f2ee54c 100644
--- a/src/gui/kernel/qpaintdevicewindow_p.h
+++ b/src/gui/kernel/qpaintdevicewindow_p.h
@@ -34,6 +34,17 @@
#ifndef QPAINTDEVICEWINDOW_P_H
#define QPAINTDEVICEWINDOW_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/QPaintDeviceWindow>
#include <QtCore/QCoreApplication>
#include <QtGui/private/qwindow_p.h>
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index 7239ac7ba4..cd43fc42fe 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the QtOpenVG module of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
diff --git a/src/gui/kernel/qplatformcursor.h b/src/gui/kernel/qplatformcursor.h
index 4f4f9cc6ae..8c788fd27b 100644
--- a/src/gui/kernel/qplatformcursor.h
+++ b/src/gui/kernel/qplatformcursor.h
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the QtOpenVG module of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 3d37088182..f69efe0935 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -36,7 +36,6 @@
#include <QtCore/QVariant>
#include <QtCore/QSharedData>
#include <QtCore/QSettings>
-#include <QtCore/QHash>
#include <QtCore/QUrl>
#include <QtGui/QColor>
@@ -120,6 +119,8 @@ static const int buttonRoleLayouts[2][5][14] =
QPlatformDialogHelper::QPlatformDialogHelper()
{
+ qRegisterMetaType<StandardButton>();
+ qRegisterMetaType<ButtonRole>();
}
QPlatformDialogHelper::~QPlatformDialogHelper()
@@ -423,6 +424,7 @@ public:
QUrl initialDirectory;
QString initiallySelectedNameFilter;
QList<QUrl> initiallySelectedFiles;
+ QStringList supportedSchemes;
};
QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate)
@@ -614,6 +616,18 @@ void QFileDialogOptions::setInitiallySelectedFiles(const QList<QUrl> &files)
d->initiallySelectedFiles = files;
}
+// Schemes supported by the application
+void QFileDialogOptions::setSupportedSchemes(const QStringList &schemes)
+{
+ d->supportedSchemes = schemes;
+}
+
+QStringList QFileDialogOptions::supportedSchemes() const
+{
+ return d->supportedSchemes;
+}
+
+// Return true if the URL is supported by the filedialog implementation *and* by the application.
bool QPlatformFileDialogHelper::isSupportedUrl(const QUrl &url) const
{
return url.isLocalFile();
@@ -639,12 +653,13 @@ void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptio
}
const char *QPlatformFileDialogHelper::filterRegExp =
-"^(.*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$";
+"^(.*)\\(([a-zA-Z0-9_.,*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$";
// Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)"
QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter)
{
QRegExp regexp(QString::fromLatin1(filterRegExp));
+ Q_ASSERT(regexp.isValid());
QString f = filter;
int i = regexp.indexIn(f);
if (i >= 0)
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index 8b2b9881b7..5b2f4ece77 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -104,6 +104,7 @@ public:
};
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
+ Q_FLAG(StandardButtons)
enum ButtonRole {
// keep this in sync with QDialogButtonBox::ButtonRole and QMessageBox::ButtonRole
@@ -128,6 +129,7 @@ public:
Reverse = 0x40000000,
EOL = InvalidRole
};
+ Q_ENUM(ButtonRole)
enum ButtonLayout {
// keep this in sync with QDialogButtonBox::ButtonLayout and QMessageBox::ButtonLayout
@@ -160,8 +162,14 @@ Q_SIGNALS:
void reject();
};
+QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QPlatformDialogHelper::StandardButton)
+Q_DECLARE_METATYPE(QPlatformDialogHelper::ButtonRole)
+QT_BEGIN_NAMESPACE
+
class Q_GUI_EXPORT QColorDialogOptions
{
+ Q_GADGET
public:
enum ColorDialogOption {
ShowAlphaChannel = 0x00000001,
@@ -170,6 +178,7 @@ public:
};
Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
+ Q_FLAG(ColorDialogOptions)
QColorDialogOptions();
QColorDialogOptions(const QColorDialogOptions &rhs);
@@ -221,6 +230,7 @@ private:
class Q_GUI_EXPORT QFontDialogOptions
{
+ Q_GADGET
public:
enum FontDialogOption {
NoButtons = 0x00000001,
@@ -232,6 +242,7 @@ public:
};
Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
+ Q_FLAG(FontDialogOptions)
QFontDialogOptions();
QFontDialogOptions(const QFontDialogOptions &rhs);
@@ -274,11 +285,19 @@ private:
class Q_GUI_EXPORT QFileDialogOptions
{
+ Q_GADGET
public:
enum ViewMode { Detail, List };
+ Q_ENUM(ViewMode)
+
enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly };
+ Q_ENUM(FileMode)
+
enum AcceptMode { AcceptOpen, AcceptSave };
+ Q_ENUM(AcceptMode)
+
enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount };
+ Q_ENUM(DialogLabel)
enum FileDialogOption
{
@@ -292,6 +311,7 @@ public:
DontUseCustomDirectoryIcons = 0x00000080
};
Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption)
+ Q_FLAG(FileDialogOptions)
QFileDialogOptions();
QFileDialogOptions(const QFileDialogOptions &rhs);
@@ -348,6 +368,9 @@ public:
QList<QUrl> initiallySelectedFiles() const;
void setInitiallySelectedFiles(const QList<QUrl> &);
+ void setSupportedSchemes(const QStringList &schemes);
+ QStringList supportedSchemes() const;
+
private:
QSharedDataPointer<QFileDialogOptionsPrivate> d;
};
@@ -388,9 +411,11 @@ private:
class Q_GUI_EXPORT QMessageDialogOptions
{
+ Q_GADGET
public:
// Keep in sync with QMessageBox::Icon
enum Icon { NoIcon, Information, Warning, Critical, Question };
+ Q_ENUM(Icon)
QMessageDialogOptions();
QMessageDialogOptions(const QMessageDialogOptions &rhs);
diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp
index 2749b05691..c0c51b8d5e 100644
--- a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp
+++ b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp
@@ -40,6 +40,14 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
+#ifndef GL_RGB10_A2
+#define GL_RGB10_A2 0x8059
+#endif
+
+#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -64,23 +72,25 @@ QT_BEGIN_NAMESPACE
bound texture, otherwise returns false.
*/
bool QPlatformGraphicsBufferHelper::lockAndBindToTexture(QPlatformGraphicsBuffer *graphicsBuffer,
- bool *swizzle,
+ bool *swizzle, bool *premultiplied,
const QRect &rect)
{
if (graphicsBuffer->lock(QPlatformGraphicsBuffer::TextureAccess)) {
if (!graphicsBuffer->bindToTexture(rect)) {
- qWarning() << Q_FUNC_INFO << "Failed to bind graphicsbuffer to texture";
+ qWarning("Failed to bind %sgraphicsbuffer to texture", "");
return false;
}
if (swizzle)
*swizzle = false;
+ if (premultiplied)
+ *premultiplied = false;
} else if (graphicsBuffer->lock(QPlatformGraphicsBuffer::SWReadAccess)) {
- if (!bindSWToTexture(graphicsBuffer, swizzle, rect)) {
- qWarning() << Q_FUNC_INFO << "Failed to bind SW graphcisbuffer to texture";
+ if (!bindSWToTexture(graphicsBuffer, swizzle, premultiplied, rect)) {
+ qWarning("Failed to bind %sgraphicsbuffer to texture", "SW ");
return false;
}
} else {
- qWarning() << Q_FUNC_INFO << "Failed to lock";
+ qWarning("Failed to lock");
return false;
}
return true;
@@ -109,11 +119,12 @@ bool QPlatformGraphicsBufferHelper::lockAndBindToTexture(QPlatformGraphicsBuffer
Returns true on success, otherwise false.
*/
bool QPlatformGraphicsBufferHelper::bindSWToTexture(const QPlatformGraphicsBuffer *graphicsBuffer,
- bool *swizzleRandB,
+ bool *swizzleRandB, bool *premultipliedB,
const QRect &subRect)
{
#ifndef QT_NO_OPENGL
- if (!QOpenGLContext::currentContext())
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (!ctx)
return false;
if (!(graphicsBuffer->isLocked() & QPlatformGraphicsBuffer::SWReadAccess))
@@ -123,27 +134,70 @@ bool QPlatformGraphicsBufferHelper::bindSWToTexture(const QPlatformGraphicsBuffe
Q_ASSERT(subRect.isEmpty() || QRect(QPoint(0,0), size).contains(subRect));
+ GLenum internalFormat = GL_RGBA;
+ GLuint pixelType = GL_UNSIGNED_BYTE;
+
+ bool needsConversion = false;
bool swizzle = false;
+ bool premultiplied = false;
QImage::Format imageformat = QImage::toImageFormat(graphicsBuffer->format());
QImage image(graphicsBuffer->data(), size.width(), size.height(), graphicsBuffer->bytesPerLine(), imageformat);
if (graphicsBuffer->bytesPerLine() != (size.width() * 4)) {
- image = image.convertToFormat(QImage::Format_RGBA8888);
- } else if (imageformat == QImage::Format_RGB32) {
- swizzle = true;
- } else if (imageformat != QImage::Format_RGBA8888) {
- image = image.convertToFormat(QImage::Format_RGBA8888);
+ needsConversion = true;
+ } else {
+ switch (imageformat) {
+ case QImage::Format_ARGB32_Premultiplied:
+ premultiplied = true;
+ // no break
+ case QImage::Format_RGB32:
+ case QImage::Format_ARGB32:
+ swizzle = true;
+ break;
+ case QImage::Format_RGBA8888_Premultiplied:
+ premultiplied = true;
+ // no break
+ case QImage::Format_RGBX8888:
+ case QImage::Format_RGBA8888:
+ break;
+ case QImage::Format_BGR30:
+ case QImage::Format_A2BGR30_Premultiplied:
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
+ pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
+ internalFormat = GL_RGB10_A2;
+ premultiplied = true;
+ } else {
+ needsConversion = true;
+ }
+ break;
+ case QImage::Format_RGB30:
+ case QImage::Format_A2RGB30_Premultiplied:
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
+ pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
+ internalFormat = GL_RGB10_A2;
+ premultiplied = true;
+ swizzle = true;
+ } else {
+ needsConversion = true;
+ }
+ break;
+ default:
+ needsConversion = true;
+ break;
+ }
}
+ if (needsConversion)
+ image = image.convertToFormat(QImage::Format_RGBA8888);
- QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
+ QOpenGLFunctions *funcs = ctx->functions();
QRect rect = subRect;
if (rect.isNull() || rect == QRect(QPoint(0,0),size)) {
- funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, image.constBits());
+ funcs->glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, size.width(), size.height(), 0, GL_RGBA, pixelType, image.constBits());
} else {
#ifndef QT_OPENGL_ES_2
- if (!QOpenGLContext::currentContext()->isOpenGLES()) {
+ if (!ctx->isOpenGLES()) {
funcs->glPixelStorei(GL_UNPACK_ROW_LENGTH, image.width());
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
image.constScanLine(rect.y()) + rect.x() * 4);
funcs->glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
} else
@@ -160,16 +214,18 @@ bool QPlatformGraphicsBufferHelper::bindSWToTexture(const QPlatformGraphicsBuffe
// OpenGL instead of copying, since there's no gap between scanlines
if (rect.width() == size.width()) {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
image.constScanLine(rect.y()));
} else {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
image.copy(rect).constBits());
}
}
}
if (swizzleRandB)
*swizzleRandB = swizzle;
+ if (premultipliedB)
+ *premultipliedB = premultiplied;
return true;
diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.h b/src/gui/kernel/qplatformgraphicsbufferhelper.h
index ded7810608..cc1a4918cd 100644
--- a/src/gui/kernel/qplatformgraphicsbufferhelper.h
+++ b/src/gui/kernel/qplatformgraphicsbufferhelper.h
@@ -39,8 +39,8 @@
QT_BEGIN_NAMESPACE
namespace QPlatformGraphicsBufferHelper {
- bool lockAndBindToTexture(QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB, const QRect &rect = QRect());
- bool bindSWToTexture(const QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB = Q_NULLPTR, const QRect &rect = QRect());
+ bool lockAndBindToTexture(QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB, bool *premultipliedB, const QRect &rect = QRect());
+ bool bindSWToTexture(const QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB = Q_NULLPTR, bool *premultipliedB = Q_NULLPTR, const QRect &rect = QRect());
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp
index a7660e76ae..fedf940dda 100644
--- a/src/gui/kernel/qplatforminputcontextfactory.cpp
+++ b/src/gui/kernel/qplatforminputcontextfactory.cpp
@@ -56,48 +56,34 @@ QStringList QPlatformInputContextFactory::keys()
#endif
}
-QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
+QString QPlatformInputContextFactory::requested()
{
- QStringList paramList = key.split(QLatin1Char(':'));
- const QString platform = paramList.takeFirst().toLower();
-
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- if (QPlatformInputContext *ret = qLoadPlugin1<QPlatformInputContext, QPlatformInputContextPlugin>(loader(), platform, paramList))
- return ret;
-#endif
- return 0;
+ QByteArray env = qgetenv("QT_IM_MODULE");
+ return env.isNull() ? QString() : QString::fromLocal8Bit(env);
}
-QPlatformInputContext *QPlatformInputContextFactory::create()
+QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
{
- QPlatformInputContext *ic = 0;
-
- QString icString = QString::fromLatin1(qgetenv("QT_IM_MODULE"));
-
- if (icString == QLatin1String("none"))
- return 0;
-
- ic = create(icString);
- if (ic && ic->isValid())
- return ic;
-
- delete ic;
- ic = 0;
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+ if (!key.isEmpty()) {
+ QStringList paramList = key.split(QLatin1Char(':'));
+ const QString platform = paramList.takeFirst().toLower();
- QStringList k = keys();
- for (int i = 0; i < k.size(); ++i) {
- if (k.at(i) == icString)
- continue;
- ic = create(k.at(i));
+ QPlatformInputContext *ic = qLoadPlugin1<QPlatformInputContext, QPlatformInputContextPlugin>
+ (loader(), platform, paramList);
if (ic && ic->isValid())
return ic;
+
delete ic;
- ic = 0;
}
-
+#endif
return 0;
}
+QPlatformInputContext *QPlatformInputContextFactory::create()
+{
+ return create(requested());
+}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatforminputcontextfactory_p.h b/src/gui/kernel/qplatforminputcontextfactory_p.h
index a74c4f5f80..38f4358287 100644
--- a/src/gui/kernel/qplatforminputcontextfactory_p.h
+++ b/src/gui/kernel/qplatforminputcontextfactory_p.h
@@ -56,6 +56,7 @@ class Q_GUI_EXPORT QPlatformInputContextFactory
{
public:
static QStringList keys();
+ static QString requested();
static QPlatformInputContext *create(const QString &key);
static QPlatformInputContext *create();
};
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 4d973d47a5..14633d8b30 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -39,7 +39,6 @@
#include <qpa/qplatformtheme.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qpixmap_raster_p.h>
-#include <qpa/qplatformscreen_p.h>
#include <private/qdnd_p.h>
#include <private/qsimpledrag_p.h>
@@ -209,8 +208,7 @@ QPlatformServices *QPlatformIntegration::services() const
behavior for desktop platforms.
\value ForeignWindows The platform allows creating QWindows which represent
- native windows created by other processes or anyway created by using native
- libraries.
+ native windows created by other processes or by using native libraries.
\value NonFullScreenWindows The platform supports top-level windows which do not
fill the screen. The default implementation returns \c true. Returning false for
@@ -450,13 +448,31 @@ QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const
void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)
{
QScreen *screen = new QScreen(ps);
- ps->d_func()->screen = screen;
+
if (isPrimary) {
QGuiApplicationPrivate::screen_list.prepend(screen);
} else {
QGuiApplicationPrivate::screen_list.append(screen);
}
emit qGuiApp->screenAdded(screen);
+
+ if (isPrimary)
+ emit qGuiApp->primaryScreenChanged(screen);
+}
+
+/*!
+ Just removes the screen, call destroyScreen instead.
+
+ \sa destroyScreen()
+*/
+
+void QPlatformIntegration::removeScreen(QScreen *screen)
+{
+ const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list[0] == screen);
+ QGuiApplicationPrivate::screen_list.removeOne(screen);
+
+ if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty())
+ emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list[0]);
}
/*!
@@ -469,11 +485,31 @@ void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)
*/
void QPlatformIntegration::destroyScreen(QPlatformScreen *screen)
{
- QGuiApplicationPrivate::screen_list.removeOne(screen->d_func()->screen);
- delete screen->d_func()->screen;
+ QScreen *qScreen = screen->screen();
+ removeScreen(qScreen);
+ delete qScreen;
delete screen;
}
+/*!
+ Should be called whenever the primary screen changes.
+
+ When the screen specified as primary changes, this method will notify
+ QGuiApplication and emit the QGuiApplication::primaryScreenChanged signal.
+ */
+
+void QPlatformIntegration::setPrimaryScreen(QPlatformScreen *newPrimary)
+{
+ QScreen* newPrimaryScreen = newPrimary->screen();
+ int idx = QGuiApplicationPrivate::screen_list.indexOf(newPrimaryScreen);
+ Q_ASSERT(idx >= 0);
+ if (idx == 0)
+ return;
+
+ QGuiApplicationPrivate::screen_list.swap(0, idx);
+ emit qGuiApp->primaryScreenChanged(newPrimaryScreen);
+}
+
QStringList QPlatformIntegration::themeNames() const
{
return QStringList();
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 2aa502b3d2..af89a73455 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -91,7 +91,8 @@ public:
SyncState,
RasterGLSurface,
AllGLFunctionsQueryable,
- ApplicationIcon
+ ApplicationIcon,
+ SwitchableWidgetComposition
};
virtual ~QPlatformIntegration() { }
@@ -172,9 +173,13 @@ public:
virtual QOpenGLContext::OpenGLModuleType openGLModuleType();
#endif
virtual void setApplicationIcon(const QIcon &icon) const;
+
+ void removeScreen(QScreen *screen);
+
protected:
void screenAdded(QPlatformScreen *screen, bool isPrimary = false);
void destroyScreen(QPlatformScreen *screen);
+ void setPrimaryScreen(QPlatformScreen *newPrimary);
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegrationfactory.cpp b/src/gui/kernel/qplatformintegrationfactory.cpp
index d58ac3a33f..5a1fb3ca83 100644
--- a/src/gui/kernel/qplatformintegrationfactory.cpp
+++ b/src/gui/kernel/qplatformintegrationfactory.cpp
@@ -72,6 +72,12 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platfor
}
if (QPlatformIntegration *ret = loadIntegration(loader(), platform, paramList, argc, argv))
return ret;
+#else
+ Q_UNUSED(platform);
+ Q_UNUSED(paramList);
+ Q_UNUSED(argc);
+ Q_UNUSED(argv);
+ Q_UNUSED(platformPluginPath);
#endif
return 0;
}
@@ -102,6 +108,7 @@ QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath)
list.append(loader()->keyMap().values());
return list;
#else
+ Q_UNUSED(platformPluginPath);
return QStringList();
#endif
}
diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h
index 1022d0ed4a..bc0b3a4870 100644
--- a/src/gui/kernel/qplatformmenu.h
+++ b/src/gui/kernel/qplatformmenu.h
@@ -63,6 +63,7 @@ public:
// They could be added as public QAction roles if necessary.
CutRole, CopyRole, PasteRole, SelectAllRole,
RoleCount };
+ Q_ENUM(MenuRole)
virtual void setTag(quintptr tag) = 0;
virtual quintptr tag()const = 0;
@@ -91,6 +92,7 @@ class Q_GUI_EXPORT QPlatformMenu : public QObject
Q_OBJECT
public:
enum MenuType { DefaultMenu = 0, EditMenu };
+ Q_ENUM(MenuType)
virtual void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) = 0;
virtual void removeMenuItem(QPlatformMenuItem *menuItem) = 0;
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index edf546799f..8e9767d69e 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -40,6 +40,7 @@
#include <qpa/qplatformintegration.h>
#include <QtGui/qscreen.h>
#include <QtGui/qwindow.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -55,7 +56,7 @@ QPlatformScreen::~QPlatformScreen()
Q_D(QPlatformScreen);
if (d->screen) {
qWarning("Manually deleting a QPlatformScreen. Call QPlatformIntegration::destroyScreen instead.");
- QGuiApplicationPrivate::screen_list.removeOne(d->screen);
+ QGuiApplicationPrivate::platformIntegration()->removeScreen(d->screen);
delete d->screen;
}
}
@@ -89,7 +90,7 @@ QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
QWindowList list = QGuiApplication::topLevelWindows();
for (int i = list.size()-1; i >= 0; --i) {
QWindow *w = list[i];
- if (w->isVisible() && w->geometry().contains(pos))
+ if (w->isVisible() && QHighDpi::toNativePixels(w->geometry(), w).contains(pos))
return w;
}
@@ -97,6 +98,23 @@ QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
}
/*!
+ Find the sibling screen corresponding to \a globalPos.
+
+ Returns this screen if no suitable screen is found at the position.
+ */
+const QPlatformScreen *QPlatformScreen::screenForPosition(const QPoint &point) const
+{
+ if (!geometry().contains(point)) {
+ Q_FOREACH (const QPlatformScreen* screen, virtualSiblings()) {
+ if (screen->geometry().contains(point))
+ return screen;
+ }
+ }
+ return this;
+}
+
+
+/*!
Returns a list of all the platform screens that are part of the same
virtual desktop.
@@ -156,11 +174,13 @@ QDpi QPlatformScreen::logicalDpi() const
}
/*!
- Reimplement this function in subclass to return the device pixel
- ratio for the screen. This is the ratio between physical pixels
- and device-independent pixels.
+ Reimplement this function in subclass to return the device pixel ratio
+ for the screen. This is the ratio between physical pixels and the
+ device-independent pixels of the windowing system. The default
+ implementation returns 1.0.
- \sa QPlatformWindow::devicePixelRatio();
+ \sa QPlatformWindow::devicePixelRatio()
+ \sa QPlatformScreen::pixelDensity()
*/
qreal QPlatformScreen::devicePixelRatio() const
{
@@ -168,6 +188,24 @@ qreal QPlatformScreen::devicePixelRatio() const
}
/*!
+ Reimplement this function in subclass to return the pixel density of the
+ screen. This is the scale factor needed to make a low-dpi application
+ usable on this screen. The default implementation returns 1.0.
+
+ Returning something else than 1.0 from this function causes Qt to
+ apply the scale factor to the application's coordinate system.
+ This is different from devicePixelRatio, which reports a scale
+ factor already applied by the windowing system. A platform plugin
+ typically implements one (or none) of these two functions.
+
+ \sa QPlatformWindow::devicePixelRatio()
+*/
+qreal QPlatformScreen::pixelDensity() const
+{
+ return 1.0;
+}
+
+/*!
Reimplement this function in subclass to return the vertical refresh rate
of the screen, in Hz.
@@ -290,8 +328,8 @@ void QPlatformScreen::resizeMaximizedWindows()
// 'screen()' still has the old geometry info while 'this' has the new geometry info
const QRect oldGeometry = screen()->geometry();
const QRect oldAvailableGeometry = screen()->availableGeometry();
- const QRect newGeometry = geometry();
- const QRect newAvailableGeometry = availableGeometry();
+ const QRect newGeometry = deviceIndependentGeometry();
+ const QRect newAvailableGeometry = QHighDpi::fromNative(availableGeometry(), QHighDpiScaling::factor(this), newGeometry.topLeft());
// make sure maximized and fullscreen windows are updated
for (int i = 0; i < windows.size(); ++i) {
@@ -324,7 +362,7 @@ static int log2(uint i)
int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
{
if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) {
- qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation";
+ qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "angle");
return 0;
}
@@ -346,7 +384,7 @@ int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation
QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target)
{
if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) {
- qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation";
+ qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "transform");
return QTransform();
}
@@ -377,7 +415,7 @@ QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::Screen
QRect QPlatformScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect)
{
if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) {
- qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation";
+ qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "map");
return rect;
}
@@ -393,6 +431,13 @@ QRect QPlatformScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation
return rect;
}
+QRect QPlatformScreen::deviceIndependentGeometry() const
+{
+ qreal scaleFactor = QHighDpiScaling::factor(this);
+ QRect nativeGeometry = geometry();
+ return QRect(nativeGeometry.topLeft(), QHighDpi::fromNative(nativeGeometry.size(), scaleFactor));
+}
+
/*!
Returns a hint about this screen's subpixel layout structure.
@@ -420,4 +465,22 @@ QPlatformScreen::SubpixelAntialiasingType QPlatformScreen::subpixelAntialiasingT
return static_cast<QPlatformScreen::SubpixelAntialiasingType>(type);
}
+/*!
+ Returns the current power state.
+
+ The default implementation always returns PowerStateOn.
+*/
+QPlatformScreen::PowerState QPlatformScreen::powerState() const
+{
+ return PowerStateOn;
+}
+
+/*!
+ Sets the power state for this screen.
+*/
+void QPlatformScreen::setPowerState(PowerState state)
+{
+ Q_UNUSED(state);
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h
index 551cb788c9..b32f9cf97c 100644
--- a/src/gui/kernel/qplatformscreen.h
+++ b/src/gui/kernel/qplatformscreen.h
@@ -82,6 +82,13 @@ public:
Subpixel_VBGR
};
+ enum PowerState {
+ PowerStateOn,
+ PowerStateStandby,
+ PowerStateSuspend,
+ PowerStateOff
+ };
+
QPlatformScreen();
virtual ~QPlatformScreen();
@@ -96,6 +103,7 @@ public:
virtual QSizeF physicalSize() const;
virtual QDpi logicalDpi() const;
virtual qreal devicePixelRatio() const;
+ virtual qreal pixelDensity() const;
virtual qreal refreshRate() const;
@@ -105,6 +113,7 @@ public:
virtual QWindow *topLevelAt(const QPoint &point) const;
virtual QList<QPlatformScreen *> virtualSiblings() const;
+ const QPlatformScreen *screenForPosition(const QPoint &point) const;
QScreen *screen() const;
@@ -117,10 +126,16 @@ public:
virtual QPlatformCursor *cursor() const;
virtual SubpixelAntialiasingType subpixelAntialiasingTypeHint() const;
+ virtual PowerState powerState() const;
+ virtual void setPowerState(PowerState state);
+
static int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
static QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target);
static QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect);
+ // The platform screen's geometry in device independent coordinates
+ QRect deviceIndependentGeometry() const;
+
protected:
void resizeMaximizedWindows();
@@ -129,7 +144,7 @@ protected:
private:
Q_DISABLE_COPY(QPlatformScreen)
- friend class QPlatformIntegration;
+ friend class QScreenPrivate;
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformsystemtrayicon.h b/src/gui/kernel/qplatformsystemtrayicon.h
index 437f5e02b1..6ef2d1538f 100644
--- a/src/gui/kernel/qplatformsystemtrayicon.h
+++ b/src/gui/kernel/qplatformsystemtrayicon.h
@@ -57,8 +57,10 @@ public:
Trigger,
MiddleClick
};
+ Q_ENUM(ActivationReason)
enum MessageIcon { NoIcon, Information, Warning, Critical };
+ Q_ENUM(MessageIcon)
QPlatformSystemTrayIcon();
~QPlatformSystemTrayIcon();
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index 36a71fe2da..ce8548f628 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -323,7 +323,9 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = {
{QKeySequence::FullScreen, 1, Qt::Key_F11, KB_Win | KB_KDE},
{QKeySequence::Deselect, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_A, KB_X11},
{QKeySequence::DeleteCompleteLine, 0, Qt::CTRL | Qt::Key_U, KB_X11},
- {QKeySequence::Backspace, 0, Qt::META | Qt::Key_H, KB_Mac}
+ {QKeySequence::Backspace, 0, Qt::META | Qt::Key_H, KB_Mac},
+ {QKeySequence::Cancel, 0, Qt::Key_Escape, KB_All},
+ {QKeySequence::Cancel, 0, Qt::CTRL | Qt::Key_Period, KB_Mac}
};
const uint QPlatformThemePrivate::numberOfKeyBindings = sizeof(QPlatformThemePrivate::keyBindings)/(sizeof(QKeyBinding));
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h
index 69cc2f90af..36fa7a65aa 100644
--- a/src/gui/kernel/qplatformtheme.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -164,6 +164,8 @@ public:
SmallFont,
MiniFont,
FixedFont,
+ GroupBoxTitleFont,
+ TabButtonFont,
NFonts
};
diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp
index d4902ac163..bcc37dad06 100644
--- a/src/gui/kernel/qplatformthemefactory.cpp
+++ b/src/gui/kernel/qplatformthemefactory.cpp
@@ -63,6 +63,9 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString
}
if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList))
return ret;
+#else
+ Q_UNUSED(key);
+ Q_UNUSED(platformPluginPath);
#endif
return 0;
}
@@ -93,6 +96,7 @@ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
list += loader()->keyMap().values();
return list;
#else
+ Q_UNUSED(platformPluginPath);
return QStringList();
#endif
}
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 114fcf8062..aea029b7f5 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -39,8 +39,10 @@
#include <qpa/qwindowsysteminterface.h>
#include <QtGui/qwindow.h>
#include <QtGui/qscreen.h>
+#include <private/qhighdpiscaling_p.h>
#include <private/qwindow_p.h>
+
QT_BEGIN_NAMESPACE
/*!
@@ -481,13 +483,27 @@ QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &
QPlatformScreen *QPlatformWindow::screenForGeometry(const QRect &newGeometry) const
{
QPlatformScreen *currentScreen = screen();
- if (!parent() && currentScreen && !currentScreen->geometry().intersects(newGeometry)) {
+ QPlatformScreen *fallback = currentScreen;
+ //QRect::center can return a value outside the rectangle if it's empty
+ const QPoint center = newGeometry.isEmpty() ? newGeometry.topLeft() : newGeometry.center();
+
+ if (!parent() && currentScreen && !currentScreen->geometry().contains(center)) {
Q_FOREACH (QPlatformScreen* screen, currentScreen->virtualSiblings()) {
- if (screen->geometry().intersects(newGeometry))
+ if (screen->geometry().contains(center))
return screen;
+ if (screen->geometry().intersects(newGeometry))
+ fallback = screen;
}
}
- return currentScreen;
+ return fallback;
+}
+
+/*!
+ Returns a size with both dimensions bounded to [0, QWINDOWSIZE_MAX]
+*/
+QSize QPlatformWindow::constrainWindowSize(const QSize &size)
+{
+ return size.expandedTo(QSize(0, 0)).boundedTo(QSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX));
}
/*!
@@ -565,7 +581,10 @@ void QPlatformWindow::invalidateSurface()
QRect QPlatformWindow::initialGeometry(const QWindow *w,
const QRect &initialGeometry, int defaultWidth, int defaultHeight)
{
- QRect rect(initialGeometry);
+ const QScreen *screen = effectiveScreen(w);
+ if (!screen)
+ return initialGeometry;
+ QRect rect(QHighDpi::fromNativePixels(initialGeometry, w));
if (rect.width() == 0) {
const int minWidth = w->minimumWidth();
rect.setWidth(minWidth > 0 ? minWidth : defaultWidth);
@@ -575,25 +594,23 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w,
rect.setHeight(minHeight > 0 ? minHeight : defaultHeight);
}
if (w->isTopLevel() && qt_window_private(const_cast<QWindow*>(w))->positionAutomatic
- && w->type() != Qt::Popup) {
- if (const QScreen *screen = effectiveScreen(w)) {
- const QRect availableGeometry = screen->availableGeometry();
- // Center unless the geometry ( + unknown window frame) is too large for the screen).
- if (rect.height() < (availableGeometry.height() * 8) / 9
+ && w->type() != Qt::Popup) {
+ const QRect availableGeometry = screen->availableGeometry();
+ // Center unless the geometry ( + unknown window frame) is too large for the screen).
+ if (rect.height() < (availableGeometry.height() * 8) / 9
&& rect.width() < (availableGeometry.width() * 8) / 9) {
- const QWindow *tp = w->transientParent();
- if (tp) {
- // A transient window should be centered w.r.t. its transient parent.
- rect.moveCenter(tp->geometry().center());
- } else {
- // Center the window on the screen. (Only applicable on platforms
- // which do not provide a better way.)
- rect.moveCenter(availableGeometry.center());
- }
+ const QWindow *tp = w->transientParent();
+ if (tp) {
+ // A transient window should be centered w.r.t. its transient parent.
+ rect.moveCenter(tp->geometry().center());
+ } else {
+ // Center the window on the screen. (Only applicable on platforms
+ // which do not provide a better way.)
+ rect.moveCenter(availableGeometry.center());
}
}
}
- return rect;
+ return QHighDpi::toNativePixels(rect, screen);
}
/*!
@@ -627,6 +644,82 @@ void QPlatformWindow::requestUpdate()
}
/*!
+ Returns the QWindow minimum size.
+*/
+QSize QPlatformWindow::windowMinimumSize() const
+{
+ return constrainWindowSize(QHighDpi::toNativePixels(window()->minimumSize(), window()));
+}
+
+/*!
+ Returns the QWindow maximum size.
+*/
+QSize QPlatformWindow::windowMaximumSize() const
+{
+ return constrainWindowSize(QHighDpi::toNativePixels(window()->maximumSize(), window()));
+}
+
+/*!
+ Returns the QWindow base size.
+*/
+QSize QPlatformWindow::windowBaseSize() const
+{
+ return QHighDpi::toNativePixels(window()->baseSize(), window());
+}
+
+/*!
+ Returns the QWindow size increment.
+*/
+QSize QPlatformWindow::windowSizeIncrement() const
+{
+ QSize increment = window()->sizeIncrement();
+ if (!QHighDpiScaling::isActive())
+ return increment;
+
+ // Normalize the increment. If not set the increment can be
+ // (-1, -1) or (0, 0). Make that (1, 1) which is scalable.
+ if (increment.isEmpty())
+ increment = QSize(1, 1);
+
+ return QHighDpi::toNativePixels(increment, window());
+}
+
+/*!
+ Returns the QWindow geometry.
+*/
+QRect QPlatformWindow::windowGeometry() const
+{
+ return QHighDpi::toNativePixels(window()->geometry(), window());
+}
+
+/*!
+ Returns the QWindow frame geometry.
+*/
+QRect QPlatformWindow::windowFrameGeometry() const
+{
+ return QHighDpi::toNativePixels(window()->frameGeometry(), window());
+}
+
+/*!
+ Returns the closest acceptable geometry for a given geometry before
+ a resize/move event for platforms that support it, for example to
+ implement heightForWidth().
+*/
+
+QRectF QPlatformWindow::closestAcceptableGeometry(const QWindow *qWindow, const QRectF &nativeRect)
+{
+ const QRectF rectF = QHighDpi::fromNativePixels(nativeRect, qWindow);
+ const QRectF correctedGeometryF = qt_window_private(const_cast<QWindow *>(qWindow))->closestAcceptableGeometry(rectF);
+ return !correctedGeometryF.isEmpty() && rectF != correctedGeometryF
+ ? QHighDpi::toNativePixels(correctedGeometryF, qWindow) : nativeRect;
+}
+
+QRectF QPlatformWindow::windowClosestAcceptableGeometry(const QRectF &nativeRect) const
+{
+ return QPlatformWindow::closestAcceptableGeometry(window(), nativeRect);
+}
+
+/*!
\class QPlatformWindow
\since 4.8
\internal
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index c7c1efdc58..850e2b4bfe 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -95,7 +95,7 @@ public:
virtual bool isExposed() const;
virtual bool isActive() const;
- virtual bool isEmbedded(const QPlatformWindow *parentWindow) const;
+ virtual bool isEmbedded(const QPlatformWindow *parentWindow = 0) const;
virtual QPoint mapToGlobal(const QPoint &pos) const;
virtual QPoint mapFromGlobal(const QPoint &pos) const;
@@ -130,9 +130,22 @@ public:
const QRect &initialGeometry, int defaultWidth, int defaultHeight);
virtual void requestUpdate();
+
+ // Window property accessors. Platform plugins should use these
+ // instead of accessing QWindow directly.
+ QSize windowMinimumSize() const;
+ QSize windowMaximumSize() const;
+ QSize windowBaseSize() const;
+ QSize windowSizeIncrement() const;
+ QRect windowGeometry() const;
+ QRect windowFrameGeometry() const;
+ QRectF windowClosestAcceptableGeometry(const QRectF &nativeRect) const;
+ static QRectF closestAcceptableGeometry(const QWindow *w, const QRectF &nativeRect);
+
protected:
static QString formatWindowTitle(const QString &title, const QString &separator);
QPlatformScreen *screenForGeometry(const QRect &newGeometry) const;
+ static QSize constrainWindowSize(const QSize &size);
QScopedPointer<QPlatformWindowPrivate> d_ptr;
private:
diff --git a/src/gui/kernel/qrasterwindow.cpp b/src/gui/kernel/qrasterwindow.cpp
index c04eb71420..fc1739ca0e 100644
--- a/src/gui/kernel/qrasterwindow.cpp
+++ b/src/gui/kernel/qrasterwindow.cpp
@@ -108,8 +108,6 @@ int QRasterWindow::metric(PaintDeviceMetric metric) const
switch (metric) {
case PdmDepth:
return d->backingstore->paintDevice()->depth();
- case PdmDevicePixelRatio:
- return d->backingstore->paintDevice()->devicePixelRatio();
default:
break;
}
diff --git a/src/gui/kernel/qrasterwindow.h b/src/gui/kernel/qrasterwindow.h
index 4912efad37..6db6baa8f5 100644
--- a/src/gui/kernel/qrasterwindow.h
+++ b/src/gui/kernel/qrasterwindow.h
@@ -46,7 +46,7 @@ class Q_GUI_EXPORT QRasterWindow : public QPaintDeviceWindow
Q_DECLARE_PRIVATE(QRasterWindow)
public:
- explicit QRasterWindow(QWindow *parent = 0);
+ explicit QRasterWindow(QWindow *parent = Q_NULLPTR);
protected:
int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index 038be09dc7..52e7686439 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -36,7 +36,9 @@
#include "qpixmap.h"
#include "qguiapplication_p.h"
#include <qpa/qplatformscreen.h>
+#include <qpa/qplatformscreen_p.h>
+#include <QtCore/QDebug>
#include <QtCore/private/qobject_p.h>
QT_BEGIN_NAMESPACE
@@ -62,8 +64,33 @@ QT_BEGIN_NAMESPACE
*/
QScreen::QScreen(QPlatformScreen *screen)
- : QObject(*new QScreenPrivate(screen), 0)
+ : QObject(*new QScreenPrivate(), 0)
{
+ Q_D(QScreen);
+ d->setPlatformScreen(screen);
+}
+
+void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen)
+{
+ Q_Q(QScreen);
+ platformScreen = screen;
+ platformScreen->d_func()->screen = q;
+ orientation = platformScreen->orientation();
+ geometry = platformScreen->deviceIndependentGeometry();
+ availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), QHighDpiScaling::factor(platformScreen), geometry.topLeft());
+ logicalDpi = platformScreen->logicalDpi();
+ refreshRate = platformScreen->refreshRate();
+ // safeguard ourselves against buggy platform behavior...
+ if (refreshRate < 1.0)
+ refreshRate = 60.0;
+
+ updatePrimaryOrientation();
+
+ filteredOrientation = orientation;
+ if (filteredOrientation == Qt::PrimaryOrientation)
+ filteredOrientation = primaryOrientation;
+
+ updateHighDpi();
}
@@ -89,8 +116,8 @@ QScreen::~QScreen()
bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle());
// Move any leftover windows to the primary screen
- foreach (QWindow *window, QGuiApplication::topLevelWindows()) {
- if (window->screen() != this)
+ foreach (QWindow *window, QGuiApplication::allWindows()) {
+ if (!window->isTopLevel() || window->screen() != this)
continue;
const bool wasVisible = window->isVisible();
@@ -207,6 +234,8 @@ qreal QScreen::physicalDotsPerInch() const
qreal QScreen::logicalDotsPerInchX() const
{
Q_D(const QScreen);
+ if (QHighDpiScaling::isActive())
+ return QHighDpiScaling::logicalDpi().first;
return d->logicalDpi.first;
}
@@ -221,6 +250,8 @@ qreal QScreen::logicalDotsPerInchX() const
qreal QScreen::logicalDotsPerInchY() const
{
Q_D(const QScreen);
+ if (QHighDpiScaling::isActive())
+ return QHighDpiScaling::logicalDpi().second;
return d->logicalDpi.second;
}
@@ -239,7 +270,7 @@ qreal QScreen::logicalDotsPerInchY() const
qreal QScreen::logicalDotsPerInch() const
{
Q_D(const QScreen);
- QDpi dpi = d->logicalDpi;
+ QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi() : d->logicalDpi;
return (dpi.first + dpi.second) * qreal(0.5);
}
@@ -258,7 +289,7 @@ qreal QScreen::logicalDotsPerInch() const
qreal QScreen::devicePixelRatio() const
{
Q_D(const QScreen);
- return d->platformScreen->devicePixelRatio();
+ return d->platformScreen->devicePixelRatio() * QHighDpiScaling::factor(this);
}
/*!
@@ -328,6 +359,7 @@ QList<QScreen *> QScreen::virtualSiblings() const
Q_D(const QScreen);
QList<QPlatformScreen *> platformScreens = d->platformScreen->virtualSiblings();
QList<QScreen *> screens;
+ screens.reserve(platformScreens.count());
foreach (QPlatformScreen *platformScreen, platformScreens)
screens << platformScreen->screen();
return screens;
@@ -589,7 +621,7 @@ bool QScreen::isLandscape(Qt::ScreenOrientation o) const
\fn void QScreen::orientationChanged(Qt::ScreenOrientation orientation)
This signal is emitted when the orientation of the screen
- changes.
+ changes with \a orientation as an argument.
\sa orientation()
*/
@@ -598,7 +630,7 @@ bool QScreen::isLandscape(Qt::ScreenOrientation o) const
\fn void QScreen::primaryOrientationChanged(Qt::ScreenOrientation orientation)
This signal is emitted when the primary orientation of the screen
- changes.
+ changes with \a orientation as an argument.
\sa primaryOrientation()
*/
@@ -648,10 +680,47 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height)
{
const QPlatformScreen *platformScreen = handle();
if (!platformScreen) {
- qWarning("%s invoked with handle==0", Q_FUNC_INFO);
+ qWarning("invoked with handle==0");
return QPixmap();
}
return platformScreen->grabWindow(window, x, y, width, height);
}
+#ifndef QT_NO_DEBUG_STREAM
+
+static inline void formatRect(QDebug &debug, const QRect r)
+{
+ debug << r.width() << 'x' << r.height()
+ << forcesign << r.x() << r.y() << noforcesign;
+}
+
+Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen)
+{
+ const QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QScreen(" << (const void *)screen;
+ if (screen) {
+ debug << ", name=" << screen->name();
+ if (debug.verbosity() > 2) {
+ if (screen == QGuiApplication::primaryScreen())
+ debug << ", primary";
+ debug << ", geometry=";
+ formatRect(debug, screen->geometry());
+ debug << ", available=";
+ formatRect(debug, screen->availableGeometry());
+ debug << ", logical DPI=" << screen->logicalDotsPerInchX()
+ << ',' << screen->logicalDotsPerInchY()
+ << ", physical DPI=" << screen->physicalDotsPerInchX()
+ << ',' << screen->physicalDotsPerInchY()
+ << ", devicePixelRatio=" << screen->devicePixelRatio()
+ << ", orientation=" << screen->orientation()
+ << ", physical size=" << screen->physicalSize().width()
+ << 'x' << screen->physicalSize().height() << "mm";
+ }
+ }
+ debug << ')';
+ return debug;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index 255e735baf..a6018128e2 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -52,6 +52,9 @@ class QScreenPrivate;
class QWindow;
class QRect;
class QPixmap;
+#ifndef QT_NO_DEBUG_STREAM
+class QDebug;
+#endif
class Q_GUI_EXPORT QScreen : public QObject
{
@@ -151,8 +154,13 @@ private:
friend class QGuiApplicationPrivate;
friend class QPlatformIntegration;
friend class QPlatformScreen;
+ friend class QHighDpiScaling;
};
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QScreen *);
+#endif
+
QT_END_NAMESPACE
#endif // QSCREEN_H
diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h
index d341b71932..4492eddd45 100644
--- a/src/gui/kernel/qscreen_p.h
+++ b/src/gui/kernel/qscreen_p.h
@@ -47,6 +47,7 @@
#include <QtGui/qscreen.h>
#include <qpa/qplatformscreen.h>
+#include "qhighdpiscaling_p.h"
#include <QtCore/private/qobject_p.h>
@@ -54,25 +55,19 @@ QT_BEGIN_NAMESPACE
class QScreenPrivate : public QObjectPrivate
{
+ Q_DECLARE_PUBLIC(QScreen)
public:
- QScreenPrivate(QPlatformScreen *screen)
- : platformScreen(screen)
+ QScreenPrivate()
+ : platformScreen(0)
, orientationUpdateMask(0)
{
- orientation = platformScreen->orientation();
- geometry = platformScreen->geometry();
- availableGeometry = platformScreen->availableGeometry();
- logicalDpi = platformScreen->logicalDpi();
- refreshRate = platformScreen->refreshRate();
- // safeguard ourselves against buggy platform behavior...
- if (refreshRate < 1.0)
- refreshRate = 60.0;
-
- updatePrimaryOrientation();
+ }
- filteredOrientation = orientation;
- if (filteredOrientation == Qt::PrimaryOrientation)
- filteredOrientation = primaryOrientation;
+ void setPlatformScreen(QPlatformScreen *screen);
+ void updateHighDpi()
+ {
+ geometry = platformScreen->deviceIndependentGeometry();
+ availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), QHighDpiScaling::factor(platformScreen), geometry.topLeft());
}
void updatePrimaryOrientation();
diff --git a/src/gui/kernel/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp
index 8f80789fb0..d77b6dc262 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow.cpp
+++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp
@@ -35,12 +35,16 @@
#include <QtGui/QPainter>
#include <QtGui/QCursor>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QPalette>
+#include <QtGui/QBitmap>
QT_BEGIN_NAMESPACE
-QShapedPixmapWindow::QShapedPixmapWindow()
- : QWindow(),
- m_backingStore(0)
+QShapedPixmapWindow::QShapedPixmapWindow(QScreen *screen)
+ : QWindow(screen),
+ m_backingStore(0),
+ m_useCompositing(true)
{
QSurfaceFormat format;
format.setAlphaBufferSize(8);
@@ -68,7 +72,10 @@ void QShapedPixmapWindow::render()
{
QPainter p(device);
- p.setCompositionMode(QPainter::CompositionMode_Source);
+ if (m_useCompositing)
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ else
+ p.fillRect(rect, QGuiApplication::palette().base());
p.drawPixmap(0, 0, m_pixmap);
}
@@ -79,6 +86,8 @@ void QShapedPixmapWindow::render()
void QShapedPixmapWindow::setPixmap(const QPixmap &pixmap)
{
m_pixmap = pixmap;
+ if (!m_useCompositing)
+ setMask(m_pixmap.mask());
}
void QShapedPixmapWindow::setHotspot(const QPoint &hotspot)
diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h
index fc311cff92..3d7974fa82 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow_p.h
+++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h
@@ -55,11 +55,12 @@ class QShapedPixmapWindow : public QWindow
{
Q_OBJECT
public:
- QShapedPixmapWindow();
+ explicit QShapedPixmapWindow(QScreen *screen = 0);
~QShapedPixmapWindow();
void render();
+ void setUseCompositing(bool on) { m_useCompositing = on; }
void setPixmap(const QPixmap &pixmap);
void setHotspot(const QPoint &hotspot);
@@ -72,6 +73,7 @@ private:
QBackingStore *m_backingStore;
QPixmap m_pixmap;
QPoint m_hotSpot;
+ bool m_useCompositing;
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 3e267f2e0b..3941f7233f 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -84,7 +84,7 @@ struct QShortcutEntry
QShortcutMap::ContextMatcher contextMatcher;
};
-#if 0 //ndef QT_NO_DEBUG_STREAM
+#ifdef Dump_QShortcutMap
/*! \internal
QDebug operator<< for easy debug output of the shortcut entries.
*/
@@ -99,7 +99,7 @@ static QDebug &operator<<(QDebug &dbg, const QShortcutEntry *se)
<< "), owner(" << se->owner << ')';
return dbg;
}
-#endif // QT_NO_DEBUGSTREAM
+#endif // Dump_QShortcutMap
/* \internal
Private data for QShortcutMap
@@ -309,59 +309,46 @@ QKeySequence::SequenceMatch QShortcutMap::state()
}
/*! \internal
- Uses ShortcutOverride event to see if any widgets want to override
- the event. If not, uses nextState(QKeyEvent) to check for a grabbed
- Shortcut, and dispatchEvent() is found and identical.
+ Uses nextState(QKeyEvent) to check for a grabbed shortcut.
- \note that this function should only be called from QWindowSystemInterface,
- otherwise it will result in duplicate events.
+ If so, it is dispatched using dispatchEvent().
+
+ Returns true if a shortcut handled the event.
\sa nextState, dispatchEvent
*/
-bool QShortcutMap::tryShortcutEvent(QObject *o, QKeyEvent *e)
+bool QShortcutMap::tryShortcut(QKeyEvent *e)
{
Q_D(QShortcutMap);
if (e->key() == Qt::Key_unknown)
return false;
- bool wasAccepted = e->isAccepted();
- bool wasSpontaneous = e->spont;
- if (d->currentState == QKeySequence::NoMatch) {
- ushort orgType = e->t;
- e->t = QEvent::ShortcutOverride;
- e->ignore();
- QCoreApplication::sendEvent(o, e);
- e->t = orgType;
- e->spont = wasSpontaneous;
- if (e->isAccepted()) {
- if (!wasAccepted)
- e->ignore();
- return false;
- }
- }
-
- QKeySequence::SequenceMatch result = nextState(e);
- bool stateWasAccepted = e->isAccepted();
- if (wasAccepted)
- e->accept();
- else
- e->ignore();
-
- int identicalMatches = d->identicals.count();
+ QKeySequence::SequenceMatch previousState = state();
- switch(result) {
+ switch (nextState(e)) {
case QKeySequence::NoMatch:
- return stateWasAccepted;
- case QKeySequence::ExactMatch:
+ // In the case of going from a partial match to no match we handled the
+ // event, since we already stated that we did for the partial match. But
+ // in the normal case of directly going to no match we say we didn't.
+ return previousState == QKeySequence::PartialMatch;
+ case QKeySequence::PartialMatch:
+ // For a partial match we don't know yet if we will handle the shortcut
+ // but we need to say we did, so that we get the follow-up key-presses.
+ return true;
+ case QKeySequence::ExactMatch: {
+ // Save number of identical matches before dispatching
+ // to keep QShortcutMap and tryShortcut reentrant.
+ const int identicalMatches = d->identicals.count();
resetState();
dispatchEvent(e);
+ // If there are no identicals we've only found disabled shortcuts, and
+ // shouldn't say that we handled the event.
+ return identicalMatches > 0;
+ }
default:
- break;
+ Q_UNREACHABLE();
}
- // If nextState is QKeySequence::ExactMatch && identicals.count == 0
- // we've only found disabled shortcuts
- return identicalMatches > 0 || result == QKeySequence::PartialMatch;
}
/*! \internal
@@ -396,10 +383,6 @@ QKeySequence::SequenceMatch QShortcutMap::nextState(QKeyEvent *e)
}
}
- // Should we eat this key press?
- if (d->currentState == QKeySequence::PartialMatch
- || (d->currentState == QKeySequence::ExactMatch && d->identicals.count()))
- e->accept();
// Does the new state require us to clean up?
if (result == QKeySequence::NoMatch)
clearSequence(d->currentSequences);
diff --git a/src/gui/kernel/qshortcutmap_p.h b/src/gui/kernel/qshortcutmap_p.h
index 2376d27c78..16542b078a 100644
--- a/src/gui/kernel/qshortcutmap_p.h
+++ b/src/gui/kernel/qshortcutmap_p.h
@@ -75,7 +75,9 @@ public:
int setShortcutEnabled(bool enable, int id, QObject *owner, const QKeySequence &key = QKeySequence());
int setShortcutAutoRepeat(bool on, int id, QObject *owner, const QKeySequence &key = QKeySequence());
- bool tryShortcutEvent(QObject *o, QKeyEvent *e);
+ QKeySequence::SequenceMatch state();
+
+ bool tryShortcut(QKeyEvent *e);
bool hasShortcutForKeySequence(const QKeySequence &seq) const;
#ifdef Dump_QShortcutMap
@@ -85,7 +87,6 @@ public:
private:
void resetState();
QKeySequence::SequenceMatch nextState(QKeyEvent *e);
- QKeySequence::SequenceMatch state();
void dispatchEvent(QKeyEvent *e);
QKeySequence::SequenceMatch find(QKeyEvent *e, int ignoredModifiers = 0);
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index b850f53014..9f38c9b78a 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -55,6 +55,7 @@
#include <private/qdnd_p.h>
#include <private/qshapedpixmapdndwindow_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -87,7 +88,7 @@ static QWindow* topLevelAt(const QPoint &pos)
QBasicDrag::QBasicDrag() :
m_restoreCursor(false), m_eventLoop(0),
m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false),
- m_drag(0), m_drag_icon_window(0)
+ m_drag(0), m_drag_icon_window(0), m_useCompositing(true)
{
}
@@ -106,6 +107,12 @@ void QBasicDrag::disableEventFilter()
qApp->removeEventFilter(this);
}
+
+static inline QPoint getNativeMousePos(QEvent *e, QObject *o)
+{
+ return QHighDpi::toNativePixels(static_cast<QMouseEvent *>(e)->globalPos(), qobject_cast<QWindow*>(o));
+}
+
bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
{
Q_UNUSED(o);
@@ -139,20 +146,22 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
}
case QEvent::MouseMove:
- move(static_cast<QMouseEvent *>(e));
- return true; // Eat all mouse events
-
+ {
+ QPoint nativePosition = getNativeMousePos(e, o);
+ move(nativePosition);
+ return true; // Eat all mouse move events
+ }
case QEvent::MouseButtonRelease:
disableEventFilter();
if (canDrop()) {
- drop(static_cast<QMouseEvent *>(e));
+ QPoint nativePosition = getNativeMousePos(e, o);
+ drop(nativePosition);
} else {
cancel();
}
exitDndEventLoop();
- return true; // Eat all mouse events
-
- case QEvent::MouseButtonPress:
+ QCoreApplication::postEvent(o, new QMouseEvent(*static_cast<QMouseEvent *>(e)));
+ return true; // defer mouse release events until drag event loop has returned
case QEvent::MouseButtonDblClick:
case QEvent::Wheel:
return true;
@@ -194,25 +203,15 @@ void QBasicDrag::restoreCursor()
void QBasicDrag::startDrag()
{
- // ### TODO Check if its really necessary to have m_drag_icon_window
- // when QDrag is used without a pixmap - QDrag::setPixmap()
- if (!m_drag_icon_window)
- m_drag_icon_window = new QShapedPixmapWindow();
-
- m_drag_icon_window->setPixmap(m_drag->pixmap());
- m_drag_icon_window->setHotspot(m_drag->hotSpot());
-
+ QPoint pos;
#ifndef QT_NO_CURSOR
- QPoint pos = QCursor::pos();
+ pos = QCursor::pos();
if (pos.x() == int(qInf())) {
// ### fixme: no mouse pos registered. Get pos from touch...
pos = QPoint();
}
- m_drag_icon_window->updateGeometry(pos);
#endif
-
- m_drag_icon_window->setVisible(true);
-
+ recreateShapedPixmapWindow(Q_NULLPTR, pos);
enableEventFilter();
}
@@ -220,6 +219,20 @@ void QBasicDrag::endDrag()
{
}
+void QBasicDrag::recreateShapedPixmapWindow(QScreen *screen, const QPoint &pos)
+{
+ delete m_drag_icon_window;
+ // ### TODO Check if its really necessary to have m_drag_icon_window
+ // when QDrag is used without a pixmap - QDrag::setPixmap()
+ m_drag_icon_window = new QShapedPixmapWindow(screen);
+
+ m_drag_icon_window->setUseCompositing(m_useCompositing);
+ m_drag_icon_window->setPixmap(m_drag->pixmap());
+ m_drag_icon_window->setHotspot(m_drag->hotSpot());
+ m_drag_icon_window->updateGeometry(pos);
+ m_drag_icon_window->setVisible(true);
+}
+
void QBasicDrag::cancel()
{
disableEventFilter();
@@ -227,13 +240,18 @@ void QBasicDrag::cancel()
m_drag_icon_window->setVisible(false);
}
-void QBasicDrag::move(const QMouseEvent *e)
+/*!
+ Move the drag label to \a globalPos, which is
+ interpreted in device independent coordinates. Typically called from reimplementations of move().
+ */
+
+void QBasicDrag::moveShapedPixmapWindow(const QPoint &globalPos)
{
if (m_drag)
- m_drag_icon_window->updateGeometry(e->globalPos());
+ m_drag_icon_window->updateGeometry(globalPos);
}
-void QBasicDrag::drop(const QMouseEvent *)
+void QBasicDrag::drop(const QPoint &)
{
disableEventFilter();
restoreCursor();
@@ -330,14 +348,15 @@ void QSimpleDrag::cancel()
}
}
-void QSimpleDrag::move(const QMouseEvent *me)
+void QSimpleDrag::move(const QPoint &globalPos)
{
- QBasicDrag::move(me);
- QWindow *window = topLevelAt(me->globalPos());
+ //### not high-DPI aware
+ moveShapedPixmapWindow(globalPos);
+ QWindow *window = topLevelAt(globalPos);
if (!window)
return;
- const QPoint pos = me->globalPos() - window->geometry().topLeft();
+ const QPoint pos = globalPos - window->geometry().topLeft();
const QPlatformDragQtResponse qt_response =
QWindowSystemInterface::handleDrag(window, drag()->mimeData(), pos, drag()->supportedActions());
@@ -345,14 +364,16 @@ void QSimpleDrag::move(const QMouseEvent *me)
setCanDrop(qt_response.isAccepted());
}
-void QSimpleDrag::drop(const QMouseEvent *me)
+void QSimpleDrag::drop(const QPoint &globalPos)
{
- QBasicDrag::drop(me);
- QWindow *window = topLevelAt(me->globalPos());
+ //### not high-DPI aware
+
+ QBasicDrag::drop(globalPos);
+ QWindow *window = topLevelAt(globalPos);
if (!window)
return;
- const QPoint pos = me->globalPos() - window->geometry().topLeft();
+ const QPoint pos = globalPos - window->geometry().topLeft();
const QPlatformDropQtResponse response =
QWindowSystemInterface::handleDrop(window, drag()->mimeData(),pos, drag()->supportedActions());
if (response.isAccepted()) {
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 7812f8b863..055136c436 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -58,6 +58,7 @@ class QWindow;
class QEventLoop;
class QDropData;
class QShapedPixmapWindow;
+class QScreen;
class Q_GUI_EXPORT QBasicDrag : public QPlatformDrag, public QObject
{
@@ -73,16 +74,22 @@ protected:
virtual void startDrag();
virtual void cancel();
- virtual void move(const QMouseEvent *me);
- virtual void drop(const QMouseEvent *me);
+ virtual void move(const QPoint &globalPos) = 0;
+ virtual void drop(const QPoint &globalPos) = 0;
virtual void endDrag();
+
+ void moveShapedPixmapWindow(const QPoint &deviceIndependentPosition);
QShapedPixmapWindow *shapedPixmapWindow() const { return m_drag_icon_window; }
+ void recreateShapedPixmapWindow(QScreen *screen, const QPoint &pos);
void updateCursor(Qt::DropAction action);
bool canDrop() const { return m_can_drop; }
void setCanDrop(bool c) { m_can_drop = c; }
+ bool useCompositing() const { return m_useCompositing; }
+ void setUseCompositing(bool on) { m_useCompositing = on; }
+
Qt::DropAction executedDropAction() const { return m_executed_drop_action; }
void setExecutedDropAction(Qt::DropAction da) { m_executed_drop_action = da; }
@@ -100,6 +107,7 @@ private:
bool m_can_drop;
QDrag *m_drag;
QShapedPixmapWindow *m_drag_icon_window;
+ bool m_useCompositing;
};
class Q_GUI_EXPORT QSimpleDrag : public QBasicDrag
@@ -111,8 +119,8 @@ public:
protected:
virtual void startDrag() Q_DECL_OVERRIDE;
virtual void cancel() Q_DECL_OVERRIDE;
- virtual void move(const QMouseEvent *me) Q_DECL_OVERRIDE;
- virtual void drop(const QMouseEvent *me) Q_DECL_OVERRIDE;
+ virtual void move(const QPoint &globalPos) Q_DECL_OVERRIDE;
+ virtual void drop(const QPoint &globalPos) Q_DECL_OVERRIDE;
private:
QWindow *m_current_window;
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 7ff0f9f860..7fc89112e6 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -305,7 +305,7 @@ int QStyleHints::cursorFlashTime() const
\note The platform may still choose to show certain windows non-fullscreen,
such as popups or dialogs. This property only reports the default behavior.
- \sa QWindow::show()
+ \sa QWindow::show(), showIsMaximized()
*/
bool QStyleHints::showIsFullScreen() const
{
@@ -313,6 +313,22 @@ bool QStyleHints::showIsFullScreen() const
}
/*!
+ \property QStyleHints::showIsMaximized
+ \brief \c true if the platform defaults to windows being maximized,
+ otherwise \c false.
+
+ \note The platform may still choose to show certain windows non-maximized,
+ such as popups or dialogs. This property only reports the default behavior.
+
+ \sa QWindow::show(), showIsFullScreen()
+ \since 5.6
+*/
+bool QStyleHints::showIsMaximized() const
+{
+ return hint(QPlatformIntegration::ShowIsMaximized).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 82eb8a6f7d..c5b8241e07 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -56,6 +56,7 @@ class Q_GUI_EXPORT QStyleHints : public QObject
Q_PROPERTY(int passwordMaskDelay READ passwordMaskDelay STORED false CONSTANT FINAL)
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(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)
@@ -78,6 +79,7 @@ public:
void setCursorFlashTime(int cursorFlashTime);
int cursorFlashTime() const;
bool showIsFullScreen() const;
+ bool showIsMaximized() const;
int passwordMaskDelay() const;
QChar passwordMaskCharacter() const;
qreal fontSmoothingGamma() const;
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp
index 1a6e9deba8..266b5308a2 100644
--- a/src/gui/kernel/qtouchdevice.cpp
+++ b/src/gui/kernel/qtouchdevice.cpp
@@ -195,7 +195,7 @@ void QTouchDevice::setName(const QString &name)
d->name = name;
}
-typedef QList<QTouchDevice *> TouchDevices;
+typedef QList<const QTouchDevice *> TouchDevices;
Q_GLOBAL_STATIC(TouchDevices, deviceList)
static QBasicMutex devicesMutex;
@@ -214,26 +214,22 @@ static void cleanupDevicesList()
QList<const QTouchDevice *> QTouchDevice::devices()
{
QMutexLocker lock(&devicesMutex);
- QList<QTouchDevice *> *devList = deviceList();
- QList<const QTouchDevice *> constDevList;
- for (int i = 0, count = devList->count(); i != count; ++i)
- constDevList.append(devList->at(i));
- return constDevList;
+ return *deviceList();
}
/*!
\internal
*/
-bool QTouchDevicePrivate::isRegistered(QTouchDevice *dev)
+bool QTouchDevicePrivate::isRegistered(const QTouchDevice *dev)
{
- QMutexLocker lock(&devicesMutex);
+ QMutexLocker locker(&devicesMutex);
return deviceList()->contains(dev);
}
/*!
\internal
*/
-void QTouchDevicePrivate::registerDevice(QTouchDevice *dev)
+void QTouchDevicePrivate::registerDevice(const QTouchDevice *dev)
{
QMutexLocker lock(&devicesMutex);
if (deviceList()->isEmpty())
@@ -241,6 +237,17 @@ void QTouchDevicePrivate::registerDevice(QTouchDevice *dev)
deviceList()->append(dev);
}
+/*!
+ \internal
+ */
+void QTouchDevicePrivate::unregisterDevice(const QTouchDevice *dev)
+{
+ QMutexLocker lock(&devicesMutex);
+ bool wasRemoved = deviceList()->removeOne(dev);
+ if (wasRemoved && deviceList()->isEmpty())
+ qRemovePostRoutine(cleanupDevicesList);
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, const QTouchDevice *device)
{
diff --git a/src/gui/kernel/qtouchdevice_p.h b/src/gui/kernel/qtouchdevice_p.h
index 9c0bcf3414..63b83d33ec 100644
--- a/src/gui/kernel/qtouchdevice_p.h
+++ b/src/gui/kernel/qtouchdevice_p.h
@@ -45,7 +45,6 @@
// We mean it.
//
-#include <QtCore/qobject.h>
#include <QtGui/qtouchdevice.h>
QT_BEGIN_NAMESPACE
@@ -65,8 +64,9 @@ public:
QString name;
int maxTouchPoints;
- static void registerDevice(QTouchDevice *dev);
- static bool isRegistered(QTouchDevice *dev);
+ static void registerDevice(const QTouchDevice *dev);
+ static void unregisterDevice(const QTouchDevice *dev);
+ static bool isRegistered(const QTouchDevice *dev);
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 871437efb1..21734f1619 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -47,6 +47,7 @@
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
+#include "qhighdpiscaling_p.h"
#include <private/qevent_p.h>
@@ -368,7 +369,7 @@ void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate)
{
Q_Q(QWindow);
if (parentWindow) {
- qWarning() << this << Q_FUNC_INFO << '(' << newScreen << "): Attempt to set a screen on a child window.";
+ qWarning() << this << '(' << newScreen << "): Attempt to set a screen on a child window.";
return;
}
if (newScreen != topLevelScreen) {
@@ -388,25 +389,31 @@ void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate)
void QWindowPrivate::create(bool recursive)
{
Q_Q(QWindow);
+ if (platformWindow)
+ return;
+
+ platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q);
+ Q_ASSERT(platformWindow);
+
if (!platformWindow) {
- platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q);
- QObjectList childObjects = q->children();
- for (int i = 0; i < childObjects.size(); i ++) {
- QObject *object = childObjects.at(i);
- if (object->isWindowType()) {
- QWindow *window = static_cast<QWindow *>(object);
- if (recursive)
- window->d_func()->create(true);
- if (window->d_func()->platformWindow)
- window->d_func()->platformWindow->setParent(platformWindow);
- }
- }
+ qWarning() << "Failed to create platform window for" << q << "with flags" << q->flags();
+ return;
+ }
- if (platformWindow) {
- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
- QGuiApplication::sendEvent(q, &e);
+ QObjectList childObjects = q->children();
+ for (int i = 0; i < childObjects.size(); i ++) {
+ QObject *object = childObjects.at(i);
+ if (object->isWindowType()) {
+ QWindow *window = static_cast<QWindow *>(object);
+ if (recursive)
+ window->d_func()->create(true);
+ if (window->d_func()->platformWindow)
+ window->d_func()->platformWindow->setParent(platformWindow);
}
}
+
+ QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
+ QGuiApplication::sendEvent(q, &e);
}
void QWindowPrivate::clearFocusObject()
@@ -587,8 +594,7 @@ QWindow *QWindow::parent() const
Setting \a parent to be 0 will make the window become a top level window.
If \a parent is a window created by fromWinId(), then the current window
- will be embedded inside \a parent, if the platform supports it. Window
- embedding is currently supported only by the X11 platform plugin.
+ will be embedded inside \a parent, if the platform supports it.
*/
void QWindow::setParent(QWindow *parent)
{
@@ -598,11 +604,13 @@ void QWindow::setParent(QWindow *parent)
QScreen *newScreen = parent ? parent->screen() : screen();
if (d->windowRecreationRequired(newScreen)) {
- qWarning() << this << Q_FUNC_INFO << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')';
+ qWarning() << this << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')';
return;
}
QObject::setParent(parent);
+ d->parentWindow = parent;
+
if (parent)
d->disconnectFromScreen();
else
@@ -616,8 +624,6 @@ void QWindow::setParent(QWindow *parent)
}
}
- d->parentWindow = parent;
-
QGuiApplicationPrivate::updateBlockedStatus(this);
}
@@ -1085,13 +1091,13 @@ qreal QWindow::devicePixelRatio() const
{
Q_D(const QWindow);
- // If there is no platform window, do the second best thing and
- // return the app global devicePixelRatio. This is the highest
- // devicePixelRatio found on the system screens, and will be
- // correct for single-display systems (a very common case).
+ // If there is no platform window use the app global devicePixelRatio,
+ // which is the the highest devicePixelRatio found on the system
+ // screens, and will be correct for single-display systems (a very common case).
if (!d->platformWindow)
return qApp->devicePixelRatio();
- return d->platformWindow->devicePixelRatio();
+
+ return d->platformWindow->devicePixelRatio() * QHighDpiScaling::factor(this);
}
/*!
@@ -1154,7 +1160,7 @@ void QWindow::setTransientParent(QWindow *parent)
{
Q_D(QWindow);
if (parent && !parent->isTopLevel()) {
- qWarning() << Q_FUNC_INFO << parent << "must be a top level window.";
+ qWarning() << parent << "must be a top level window.";
return;
}
@@ -1437,7 +1443,13 @@ void QWindow::setGeometry(const QRect &rect)
d->positionPolicy = QWindowPrivate::WindowFrameExclusive;
if (d->platformWindow) {
- d->platformWindow->setGeometry(rect);
+ QRect nativeRect;
+ QScreen *newScreen = d->screenForGeometry(rect);
+ if (newScreen && isTopLevel())
+ nativeRect = QHighDpi::toNativePixels(rect, newScreen);
+ else
+ nativeRect = QHighDpi::toNativePixels(rect, this);
+ d->platformWindow->setGeometry(nativeRect);
} else {
d->geometry = rect;
@@ -1452,6 +1464,30 @@ void QWindow::setGeometry(const QRect &rect)
}
}
+/*
+ This is equivalent to QPlatformWindow::screenForGeometry, but in platform
+ independent coordinates. The duplication is unfortunate, but there is a
+ chicken and egg problem here: we cannot convert to native coordinates
+ before we know which screen we are on.
+*/
+QScreen *QWindowPrivate::screenForGeometry(const QRect &newGeometry)
+{
+ Q_Q(QWindow);
+ QScreen *currentScreen = q->screen();
+ QScreen *fallback = currentScreen;
+ QPoint center = newGeometry.center();
+ if (!q->parent() && currentScreen && !currentScreen->geometry().contains(center)) {
+ Q_FOREACH (QScreen* screen, currentScreen->virtualSiblings()) {
+ if (screen->geometry().contains(center))
+ return screen;
+ if (screen->geometry().intersects(newGeometry))
+ fallback = screen;
+ }
+ }
+ return fallback;
+}
+
+
/*!
Returns the geometry of the window, excluding its window frame.
@@ -1461,7 +1497,7 @@ QRect QWindow::geometry() const
{
Q_D(const QWindow);
if (d->platformWindow)
- return d->platformWindow->geometry();
+ return QHighDpi::fromNativePixels(d->platformWindow->geometry(), this);
return d->geometry;
}
@@ -1474,7 +1510,7 @@ QMargins QWindow::frameMargins() const
{
Q_D(const QWindow);
if (d->platformWindow)
- return d->platformWindow->frameMargins();
+ return QHighDpi::fromNativePixels(d->platformWindow->frameMargins(), this);
return QMargins();
}
@@ -1488,7 +1524,7 @@ QRect QWindow::frameGeometry() const
Q_D(const QWindow);
if (d->platformWindow) {
QMargins m = frameMargins();
- return d->platformWindow->geometry().adjusted(-m.left(), -m.top(), m.right(), m.bottom());
+ return QHighDpi::fromNativePixels(d->platformWindow->geometry(), this).adjusted(-m.left(), -m.top(), m.right(), m.bottom());
}
return d->geometry;
}
@@ -1505,7 +1541,7 @@ QPoint QWindow::framePosition() const
Q_D(const QWindow);
if (d->platformWindow) {
QMargins margins = frameMargins();
- return d->platformWindow->geometry().topLeft() - QPoint(margins.left(), margins.top());
+ return QHighDpi::fromNativePixels(d->platformWindow->geometry().topLeft(), this) - QPoint(margins.left(), margins.top());
}
return d->geometry.topLeft();
}
@@ -1521,7 +1557,7 @@ void QWindow::setFramePosition(const QPoint &point)
d->positionPolicy = QWindowPrivate::WindowFrameInclusive;
d->positionAutomatic = false;
if (d->platformWindow) {
- d->platformWindow->setGeometry(QRect(point, size()));
+ d->platformWindow->setGeometry(QHighDpi::toNativePixels(QRect(point, size()), this));
} else {
d->geometry.moveTopLeft(point);
}
@@ -1581,7 +1617,7 @@ void QWindow::resize(const QSize &newSize)
{
Q_D(QWindow);
if (d->platformWindow) {
- d->platformWindow->setGeometry(QRect(position(), newSize));
+ d->platformWindow->setGeometry(QHighDpi::toNativePixels(QRect(position(), newSize), this));
} else {
const QSize oldSize = d->geometry.size();
d->geometry.setSize(newSize);
@@ -2261,10 +2297,10 @@ QPoint QWindow::mapToGlobal(const QPoint &pos) const
Q_D(const QWindow);
// QTBUG-43252, prefer platform implementation for foreign windows.
if (d->platformWindow
- && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded(0))) {
+ && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded())) {
return d->platformWindow->mapToGlobal(pos);
}
- return pos + d_func()->globalPosition();
+ return pos + d->globalPosition();
}
@@ -2281,10 +2317,10 @@ QPoint QWindow::mapFromGlobal(const QPoint &pos) const
Q_D(const QWindow);
// QTBUG-43252, prefer platform implementation for foreign windows.
if (d->platformWindow
- && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded(0))) {
+ && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded())) {
return d->platformWindow->mapFromGlobal(pos);
}
- return pos - d_func()->globalPosition();
+ return pos - d->globalPosition();
}
@@ -2346,9 +2382,16 @@ QWindow *QWindowPrivate::topLevelWindow() const
Given the handle \a id to a native window, this method creates a QWindow
object which can be used to represent the window when invoking methods like
setParent() and setTransientParent().
- This can be used, on platforms which support it, to embed a window inside a
- container or to make a window stick on top of a window created by another
- process.
+
+ This can be used, on platforms which support it, to embed a QWindow inside a
+ native window, or to embed a native window inside a QWindow.
+
+ If foreign windows are not supported, this function returns 0.
+
+ \note The resulting QWindow should not be used to manipulate the underlying
+ native window (besides re-parenting), or to observe state changes of the
+ native window. Any support for these kind of operations is incidental, highly
+ platform dependent and untested.
\sa setParent()
\sa setTransientParent()
@@ -2477,6 +2520,45 @@ void QWindowPrivate::applyCursor()
}
#endif // QT_NO_CURSOR
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QWindow *window)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ if (window) {
+ debug << window->metaObject()->className() << '(' << (const void *)window;
+ if (!window->objectName().isEmpty())
+ debug << ", name=" << window->objectName();
+ if (debug.verbosity() > 2) {
+ const QRect geometry = window->geometry();
+ if (window->isVisible())
+ debug << ", visible";
+ if (window->isExposed())
+ debug << ", exposed";
+ debug << ", state=" << window->windowState()
+ << ", type=" << window->type() << ", flags=" << window->flags()
+ << ", surface type=" << window->surfaceType();
+ if (window->isTopLevel())
+ debug << ", toplevel";
+ debug << ", " << geometry.width() << 'x' << geometry.height()
+ << forcesign << geometry.x() << geometry.y() << noforcesign;
+ const QMargins margins = window->frameMargins();
+ if (!margins.isNull())
+ debug << ", margins=" << margins;
+ debug << ", devicePixelRatio=" << window->devicePixelRatio();
+ if (const QPlatformWindow *platformWindow = window->handle())
+ debug << ", winId=0x" << hex << platformWindow->winId() << dec;
+ if (const QScreen *screen = window->screen())
+ debug << ", on " << screen->name();
+ }
+ debug << ')';
+ } else {
+ debug << "QWindow(0x0)";
+ }
+ return debug;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
QT_END_NAMESPACE
#include "moc_qwindow.cpp"
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index f9fe37718c..b29e7aaae7 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -78,6 +78,9 @@ class QBackingStore;
class QScreen;
class QAccessibleInterface;
class QWindowContainer;
+#ifndef QT_NO_DEBUG_STREAM
+class QDebug;
+#endif
class Q_GUI_EXPORT QWindow : public QObject, public QSurface
{
@@ -122,7 +125,7 @@ public:
};
Q_ENUM(Visibility)
- explicit QWindow(QScreen *screen = 0);
+ explicit QWindow(QScreen *screen = Q_NULLPTR);
explicit QWindow(QWindow *parent);
virtual ~QWindow();
@@ -357,16 +360,20 @@ private:
#ifndef Q_QDOC
template <> inline QWindow *qobject_cast<QWindow*>(QObject *o)
{
- if (!o || !o->isWindowType()) return 0;
+ if (!o || !o->isWindowType()) return Q_NULLPTR;
return static_cast<QWindow*>(o);
}
template <> inline const QWindow *qobject_cast<const QWindow*>(const QObject *o)
{
- if (!o || !o->isWindowType()) return 0;
+ if (!o || !o->isWindowType()) return Q_NULLPTR;
return static_cast<const QWindow*>(o);
}
#endif // !Q_QDOC
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QWindow *);
+#endif
+
QT_END_NAMESPACE
#endif // QWINDOW_H
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index 4fc63acf28..6880edaada 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -50,6 +50,7 @@
#include <qpa/qplatformwindow.h>
#include <QtCore/private/qobject_p.h>
+#include <QtCore/qelapsedtimer.h>
#include <QtGui/QIcon>
QT_BEGIN_NAMESPACE
@@ -136,6 +137,7 @@ public:
void connectToScreen(QScreen *topLevelScreen);
void disconnectFromScreen();
void emitScreenChangedRecursion(QScreen *newScreen);
+ QScreen *screenForGeometry(const QRect &rect);
virtual void clearFocusObject();
virtual QRectF closestAcceptableGeometry(const QRectF &rect) const;
@@ -186,6 +188,7 @@ public:
#endif
bool compositing;
+ QElapsedTimer lastComposeTime;
};
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 850b69d729..d17a1f1d5b 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -40,14 +40,18 @@
#include <qpa/qplatformdrag.h>
#include <qpa/qplatformintegration.h>
#include <qdebug.h>
+#include "qhighdpiscaling_p.h"
+#include <QtCore/qscopedvaluerollback.h>
QT_BEGIN_NAMESPACE
QElapsedTimer QWindowSystemInterfacePrivate::eventTime;
-bool QWindowSystemInterfacePrivate::synchronousWindowsSystemEvents = false;
+bool QWindowSystemInterfacePrivate::synchronousWindowSystemEvents = false;
QWaitCondition QWindowSystemInterfacePrivate::eventsFlushed;
QMutex QWindowSystemInterfacePrivate::flushEventMutex;
+QAtomicInt QWindowSystemInterfacePrivate::eventAccepted;
+QWindowSystemEventHandler *QWindowSystemInterfacePrivate::eventHandler;
//------------------------------------------------------------
//
@@ -93,14 +97,14 @@ void QWindowSystemInterface::handleLeaveEvent(QWindow *tlw)
*/
void QWindowSystemInterface::handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local, const QPointF& global)
{
- bool wasSynchronous = QWindowSystemInterfacePrivate::synchronousWindowsSystemEvents;
+ bool wasSynchronous = QWindowSystemInterfacePrivate::synchronousWindowSystemEvents;
if (wasSynchronous)
- setSynchronousWindowsSystemEvents(false);
+ setSynchronousWindowSystemEvents(false);
handleLeaveEvent(leave);
handleEnterEvent(enter, local, global);
if (wasSynchronous) {
flushWindowSystemEvents();
- setSynchronousWindowsSystemEvents(true);
+ setSynchronousWindowSystemEvents(true);
}
}
@@ -138,7 +142,7 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
*/
void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
{
- QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect, oldRect);
+ QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw, QHighDpi::fromNativePixels(newRect, tlw), QHighDpi::fromNativePixels(oldRect, tlw));
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -167,7 +171,7 @@ void QWindowSystemInterface::handleMouseEvent(QWindow *w, ulong timestamp, const
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
QWindowSystemInterfacePrivate::MouseEvent * e =
- new QWindowSystemInterfacePrivate::MouseEvent(w, timestamp, local, global, b, mods, source);
+ new QWindowSystemInterfacePrivate::MouseEvent(w, timestamp, QHighDpi::fromNativeLocalPosition(local, w), QHighDpi::fromNativePixels(global, w), b, mods, source);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -184,167 +188,102 @@ void QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *w, ulong timest
QWindowSystemInterfacePrivate::MouseEvent * e =
new QWindowSystemInterfacePrivate::MouseEvent(w, timestamp,
QWindowSystemInterfacePrivate::FrameStrutMouse,
- local, global, b, mods, source);
+ QHighDpi::fromNativeLocalPosition(local, w), QHighDpi::fromNativePixels(global, w), b, mods, source);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-bool QWindowSystemInterface::tryHandleShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
- const QString & text, bool autorep, ushort count)
-{
- unsigned long timestamp = QWindowSystemInterfacePrivate::eventTime.elapsed();
- return tryHandleShortcutEvent(w, timestamp, k, mods, text, autorep, count);
-}
-
-bool QWindowSystemInterface::tryHandleShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
- const QString & text, bool autorep, ushort count)
-{
-#ifndef QT_NO_SHORTCUT
- QGuiApplicationPrivate::modifier_buttons = mods;
-
- if (!w)
- w = QGuiApplication::focusWindow();
- if (!w)
- return false;
-
- QObject *focus = w->focusObject();
- if (!focus)
- focus = w;
-
- QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count);
- qevent.setTimestamp(timestamp);
- return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, &qevent);
-#else
- Q_UNUSED(w)
- Q_UNUSED(timestamp)
- Q_UNUSED(k)
- Q_UNUSED(mods)
- Q_UNUSED(text)
- Q_UNUSED(autorep)
- Q_UNUSED(count)
- return false;
-#endif
-}
-
-bool QWindowSystemInterface::tryHandleShortcutOverrideEvent(QWindow *w, QKeyEvent *ev)
-{
-#ifndef QT_NO_SHORTCUT
- Q_ASSERT(ev->type() == QKeyEvent::ShortcutOverride);
- QGuiApplicationPrivate::modifier_buttons = ev->modifiers();
-
- QObject *focus = w->focusObject();
- if (!focus)
- focus = w;
- return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, ev);
-#else
- Q_UNUSED(w)
- Q_UNUSED(ev)
- return false;
-#endif
-}
-
-// used by QTestLib to directly send shortcuts to objects
-bool QWindowSystemInterface::tryHandleShortcutEventToObject(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods,
- const QString &text, bool autorep, ushort count)
+bool QWindowSystemInterface::handleShortcutEvent(QWindow *window, ulong timestamp, int keyCode, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode,
+ quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text, bool autorepeat, ushort count)
{
#ifndef QT_NO_SHORTCUT
- QGuiApplicationPrivate::modifier_buttons = mods;
-
- QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count);
- qevent.setTimestamp(timestamp);
- return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(o, &qevent);
-#else
- Q_UNUSED(w)
- Q_UNUSED(timestamp)
- Q_UNUSED(k)
- Q_UNUSED(mods)
- Q_UNUSED(text)
- Q_UNUSED(autorep)
- Q_UNUSED(count)
- return false;
-#endif
-}
-
-bool QWindowSystemInterface::tryHandleExtendedShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
- quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
- const QString &text, bool autorep, ushort count)
-{
- unsigned long timestamp = QWindowSystemInterfacePrivate::eventTime.elapsed();
- return tryHandleExtendedShortcutEvent(w, timestamp, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
-}
-
-bool QWindowSystemInterface::tryHandleExtendedShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
- quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
- const QString &text, bool autorep, ushort count)
-{
-#ifndef QT_NO_SHORTCUT
- QGuiApplicationPrivate::modifier_buttons = mods;
+ if (!window)
+ window = QGuiApplication::focusWindow();
+
+ QShortcutMap &shortcutMap = QGuiApplicationPrivate::instance()->shortcutMap;
+ if (shortcutMap.state() == QKeySequence::NoMatch) {
+ // Check if the shortcut is overridden by some object in the event delivery path (typically the focus object).
+ // If so, we should not look up the shortcut in the shortcut map, but instead deliver the event as a regular
+ // key event, so that the target that accepted the shortcut override event can handle it. Note that we only
+ // do this if the shortcut map hasn't found a partial shortcut match yet. If it has, the shortcut can not be
+ // overridden.
+ QWindowSystemInterfacePrivate::KeyEvent *shortcutOverrideEvent = new QWindowSystemInterfacePrivate::KeyEvent(window, timestamp,
+ QEvent::ShortcutOverride, keyCode, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorepeat, count);
+
+ {
+ // FIXME: Template handleWindowSystemEvent to support both sync and async delivery
+ QScopedValueRollback<bool> syncRollback(QWindowSystemInterfacePrivate::synchronousWindowSystemEvents);
+ QWindowSystemInterfacePrivate::synchronousWindowSystemEvents = true;
+
+ if (QWindowSystemInterfacePrivate::handleWindowSystemEvent(shortcutOverrideEvent))
+ return false;
+ }
+ }
- QObject *focus = w->focusObject();
- if (!focus)
- focus = w;
+ // The shortcut event is dispatched as a QShortcutEvent, not a QKeyEvent, but we use
+ // the QKeyEvent as a container for the various properties that the shortcut map needs
+ // to inspect to determine if a shortcut matched the keys that were pressed.
+ QKeyEvent keyEvent(QEvent::ShortcutOverride, keyCode, modifiers, nativeScanCode,
+ nativeVirtualKey, nativeModifiers, text, autorepeat, count);
- QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
- qevent.setTimestamp(timestamp);
- return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, &qevent);
+ return shortcutMap.tryShortcut(&keyEvent);
#else
- Q_UNUSED(w)
+ Q_UNUSED(window)
Q_UNUSED(timestamp)
- Q_UNUSED(k)
- Q_UNUSED(mods)
+ Q_UNUSED(key)
+ Q_UNUSED(modifiers)
Q_UNUSED(nativeScanCode)
Q_UNUSED(nativeVirtualKey)
Q_UNUSED(nativeModifiers)
Q_UNUSED(text)
- Q_UNUSED(autorep)
+ Q_UNUSED(autorepeat)
Q_UNUSED(count)
return false;
#endif
}
-void QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) {
+bool QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) {
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
- handleKeyEvent(w, time, t, k, mods, text, autorep, count);
+ return handleKeyEvent(w, time, t, k, mods, text, autorep, count);
}
-void QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
+bool QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
{
- // This is special handling needed for OS X which eventually will call sendEvent(), on other platforms
- // this might not be safe, e.g., on Android. See: QGuiApplicationPrivate::processKeyEvent() for
- // shortcut overriding on other platforms.
-#if defined(Q_OS_OSX)
- if (t == QEvent::KeyPress && QWindowSystemInterface::tryHandleShortcutEvent(tlw, timestamp, k, mods, text))
- return;
-#endif // Q_OS_OSX
+ if (t == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(tlw, timestamp, k, mods, 0, 0, 0, text, autorep, count))
+ return true;
QWindowSystemInterfacePrivate::KeyEvent * e =
new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, t, k, mods, text, autorep, count);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
+ return QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
+bool QWindowSystemInterface::handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey,
quint32 nativeModifiers,
const QString& text, bool autorep,
- ushort count)
+ ushort count, bool tryShortcutOverride)
{
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
- handleExtendedKeyEvent(w, time, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers,
- text, autorep, count);
+ return handleExtendedKeyEvent(w, time, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers,
+ text, autorep, count, tryShortcutOverride);
}
-void QWindowSystemInterface::handleExtendedKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type type, int key,
+bool QWindowSystemInterface::handleExtendedKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type type, int key,
Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey,
quint32 nativeModifiers,
const QString& text, bool autorep,
ushort count, bool tryShortcutOverride)
{
- Q_UNUSED(tryShortcutOverride)
+ if (tryShortcutOverride && type == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(tlw,
+ timestamp, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count)) {
+ return true;
+ }
+
QWindowSystemInterfacePrivate::KeyEvent * e =
new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, type, key, modifiers,
nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
+ return QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods) {
@@ -382,14 +321,14 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, con
// Simple case: vertical deltas only:
if (angleDelta.y() != 0 && angleDelta.x() == 0) {
- e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, local, global, pixelDelta, angleDelta, angleDelta.y(), Qt::Vertical, mods, phase, source);
+ e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, QHighDpi::fromNativeLocalPosition(local, tlw), QHighDpi::fromNativePixels(global, tlw), pixelDelta, angleDelta, angleDelta.y(), Qt::Vertical, mods, phase, source);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
return;
}
// Simple case: horizontal deltas only:
if (angleDelta.y() == 0 && angleDelta.x() != 0) {
- e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, local, global, pixelDelta, angleDelta, angleDelta.x(), Qt::Horizontal, mods, phase, source);
+ e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, QHighDpi::fromNativeLocalPosition(local, tlw), QHighDpi::fromNativePixels(global, tlw), pixelDelta, angleDelta, angleDelta.x(), Qt::Horizontal, mods, phase, source);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
return;
}
@@ -397,12 +336,12 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, con
// Both horizontal and vertical deltas: Send two wheel events.
// The first event contains the Qt 5 pixel and angle delta as points,
// and in addition the Qt 4 compatibility vertical angle delta.
- e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, local, global, pixelDelta, angleDelta, angleDelta.y(), Qt::Vertical, mods, phase, source);
+ e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, QHighDpi::fromNativeLocalPosition(local, tlw), QHighDpi::fromNativePixels(global, tlw), pixelDelta, angleDelta, angleDelta.y(), Qt::Vertical, mods, phase, source);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
// The second event contains null pixel and angle points and the
// Qt 4 compatibility horizontal angle delta.
- e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, local, global, QPoint(), QPoint(), angleDelta.x(), Qt::Horizontal, mods, phase, source);
+ e = new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, QHighDpi::fromNativeLocalPosition(local, tlw), QHighDpi::fromNativePixels(global, tlw), QPoint(), QPoint(), angleDelta.x(), Qt::Horizontal, mods, phase, source);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -440,23 +379,60 @@ void QWindowSystemInterfacePrivate::removeWindowSystemEvent(WindowSystemEvent *e
windowSystemEventQueue.remove(event);
}
-void QWindowSystemInterfacePrivate::handleWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *ev)
+void QWindowSystemInterfacePrivate::postWindowSystemEvent(WindowSystemEvent *ev)
{
- if (synchronousWindowsSystemEvents) {
- QGuiApplicationPrivate::processWindowSystemEvent(ev);
+ windowSystemEventQueue.append(ev);
+ QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::qt_qpa_core_dispatcher();
+ if (dispatcher)
+ dispatcher->wakeUp();
+}
+
+/*!
+ Handles a window system event.
+
+ By default this function posts the event on the window system event queue and
+ wakes the Gui event dispatcher. Qt Gui will then handle the event asynchonously
+ at a later point. The return value is not used in asynchronous mode and will
+ always be true.
+
+ In synchronous mode Qt Gui will process the event immediately. The return value
+ indicates if Qt accepted the event.
+
+ \sa flushWindowSystemEvents(), setSynchronousWindowSystemEvents()
+*/
+bool QWindowSystemInterfacePrivate::handleWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *ev)
+{
+ bool accepted = true;
+ if (synchronousWindowSystemEvents) {
+ if (QThread::currentThread() == QGuiApplication::instance()->thread()) {
+ // Process the event immediately on the current thread and return the accepted state.
+ QGuiApplicationPrivate::processWindowSystemEvent(ev);
+ accepted = ev->eventAccepted;
+ delete ev;
+ } else {
+ // Post the event on the Qt main thread queue and flush the queue.
+ // This will wake up the Gui thread which will process the event.
+ // Return the accepted state for the last event on the queue,
+ // which is the event posted by this function.
+ postWindowSystemEvent(ev);
+ accepted = QWindowSystemInterface::flushWindowSystemEvents();
+ }
} else {
- windowSystemEventQueue.append(ev);
- QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::qt_qpa_core_dispatcher();
- if (dispatcher)
- dispatcher->wakeUp();
+ postWindowSystemEvent(ev);
}
+ return accepted;
}
-void QWindowSystemInterface::registerTouchDevice(QTouchDevice *device)
+void QWindowSystemInterface::registerTouchDevice(const QTouchDevice *device)
{
QTouchDevicePrivate::registerDevice(device);
}
+void QWindowSystemInterface::unregisterTouchDevice(const QTouchDevice *device)
+{
+ QTouchDevicePrivate::unregisterDevice(device);
+}
+
void QWindowSystemInterface::handleTouchEvent(QWindow *w, QTouchDevice *device,
const QList<TouchPoint> &points, Qt::KeyboardModifiers mods)
{
@@ -464,12 +440,16 @@ void QWindowSystemInterface::handleTouchEvent(QWindow *w, QTouchDevice *device,
handleTouchEvent(w, time, device, points, mods);
}
-QList<QTouchEvent::TouchPoint> QWindowSystemInterfacePrivate::convertTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points, QEvent::Type *type)
+QList<QTouchEvent::TouchPoint>
+ QWindowSystemInterfacePrivate::fromNativeTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points,
+ const QWindow *window,
+ QEvent::Type *type)
{
QList<QTouchEvent::TouchPoint> touchPoints;
Qt::TouchPointStates states;
QTouchEvent::TouchPoint p;
+ touchPoints.reserve(points.count());
QList<QWindowSystemInterface::TouchPoint>::const_iterator point = points.constBegin();
QList<QWindowSystemInterface::TouchPoint>::const_iterator end = points.constEnd();
while (point != end) {
@@ -479,16 +459,16 @@ QList<QTouchEvent::TouchPoint> QWindowSystemInterfacePrivate::convertTouchPoints
p.setState(point->state);
const QPointF screenPos = point->area.center();
- p.setScreenPos(screenPos);
- p.setScreenRect(point->area);
+ p.setScreenPos(QHighDpi::fromNativePixels(screenPos, window));
+ p.setScreenRect(QHighDpi::fromNativePixels(point->area, window));
// The local pos and rect are not set, they will be calculated
// when the event gets processed by QGuiApplication.
- p.setNormalizedPos(point->normalPosition);
- p.setVelocity(point->velocity);
+ p.setNormalizedPos(QHighDpi::fromNativePixels(point->normalPosition, window));
+ p.setVelocity(QHighDpi::fromNativePixels(point->velocity, window));
p.setFlags(point->flags);
- p.setRawScreenPositions(point->rawPositions);
+ p.setRawScreenPositions(QHighDpi::fromNativePixels(point->rawPositions, window));
touchPoints.append(p);
++point;
@@ -506,6 +486,27 @@ QList<QTouchEvent::TouchPoint> QWindowSystemInterfacePrivate::convertTouchPoints
return touchPoints;
}
+QList<QWindowSystemInterface::TouchPoint>
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(const QList<QTouchEvent::TouchPoint>& pointList,
+ const QWindow *window)
+{
+ QList<QWindowSystemInterface::TouchPoint> newList;
+ newList.reserve(pointList.size());
+ foreach (const QTouchEvent::TouchPoint &pt, pointList) {
+ QWindowSystemInterface::TouchPoint p;
+ p.id = pt.id();
+ p.flags = pt.flags();
+ p.normalPosition = QHighDpi::toNativeLocalPosition(pt.normalizedPos(), window);
+ p.area = QHighDpi::toNativePixels(pt.screenRect(), window);
+ p.pressure = pt.pressure();
+ p.state = pt.state();
+ p.velocity = pt.velocity();
+ p.rawPositions = pt.rawScreenPositions();
+ newList.append(p);
+ }
+ return newList;
+}
+
void QWindowSystemInterface::handleTouchEvent(QWindow *tlw, ulong timestamp, QTouchDevice *device,
const QList<TouchPoint> &points, Qt::KeyboardModifiers mods)
{
@@ -516,7 +517,7 @@ void QWindowSystemInterface::handleTouchEvent(QWindow *tlw, ulong timestamp, QTo
return;
QEvent::Type type;
- QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::convertTouchPoints(points, &type);
+ QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::fromNativeTouchPoints(points, tlw, &type);
QWindowSystemInterfacePrivate::TouchEvent *e =
new QWindowSystemInterfacePrivate::TouchEvent(tlw, timestamp, type, device, touchPoints, mods);
@@ -549,14 +550,14 @@ void QWindowSystemInterface::handleScreenOrientationChange(QScreen *screen, Qt::
void QWindowSystemInterface::handleScreenGeometryChange(QScreen *screen, const QRect &geometry, const QRect &availableGeometry)
{
QWindowSystemInterfacePrivate::ScreenGeometryEvent *e =
- new QWindowSystemInterfacePrivate::ScreenGeometryEvent(screen, geometry, availableGeometry);
+ new QWindowSystemInterfacePrivate::ScreenGeometryEvent(screen, QHighDpi::fromNativeScreenGeometry(geometry, screen), QHighDpi::fromNative(availableGeometry, screen, geometry.topLeft()));
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
void QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal dpiX, qreal dpiY)
{
QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e =
- new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, dpiX, dpiY);
+ new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, dpiX, dpiY); // ### tja
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -575,7 +576,7 @@ void QWindowSystemInterface::handleThemeChange(QWindow *tlw)
void QWindowSystemInterface::handleExposeEvent(QWindow *tlw, const QRegion &region)
{
- QWindowSystemInterfacePrivate::ExposeEvent *e = new QWindowSystemInterfacePrivate::ExposeEvent(tlw, region);
+ QWindowSystemInterfacePrivate::ExposeEvent *e = new QWindowSystemInterfacePrivate::ExposeEvent(tlw, QHighDpi::fromNativeLocalRegion(region, tlw));
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -584,30 +585,37 @@ void QWindowSystemInterface::deferredFlushWindowSystemEvents(QEventLoop::Process
Q_ASSERT(QThread::currentThread() == QGuiApplication::instance()->thread());
QMutexLocker locker(&QWindowSystemInterfacePrivate::flushEventMutex);
- flushWindowSystemEvents(flags);
+ sendWindowSystemEvents(flags);
QWindowSystemInterfacePrivate::eventsFlushed.wakeOne();
}
-void QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
+/*!
+ Make Qt Gui process all events on the event queue immediately. Return the
+ accepted state for the last event on the queue.
+*/
+bool QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
{
const int count = QWindowSystemInterfacePrivate::windowSystemEventQueue.count();
if (!count)
- return;
+ return false;
if (!QGuiApplication::instance()) {
qWarning().nospace()
<< "QWindowSystemInterface::flushWindowSystemEvents() invoked after "
"QGuiApplication destruction, discarding " << count << " events.";
QWindowSystemInterfacePrivate::windowSystemEventQueue.clear();
- return;
+ return false;
}
if (QThread::currentThread() != QGuiApplication::instance()->thread()) {
+ // Post a FlushEvents event which will trigger a call back to
+ // deferredFlushWindowSystemEvents from the Gui thread.
QMutexLocker locker(&QWindowSystemInterfacePrivate::flushEventMutex);
QWindowSystemInterfacePrivate::FlushEventsEvent *e = new QWindowSystemInterfacePrivate::FlushEventsEvent(flags);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
+ QWindowSystemInterfacePrivate::postWindowSystemEvent(e);
QWindowSystemInterfacePrivate::eventsFlushed.wait(&QWindowSystemInterfacePrivate::flushEventMutex);
} else {
sendWindowSystemEvents(flags);
}
+ return QWindowSystemInterfacePrivate::eventAccepted.load() > 0;
}
bool QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
@@ -621,17 +629,42 @@ bool QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::ProcessEventsFla
QWindowSystemInterfacePrivate::getWindowSystemEvent();
if (!event)
break;
- nevents++;
- QGuiApplicationPrivate::processWindowSystemEvent(event);
+
+ if (QWindowSystemInterfacePrivate::eventHandler) {
+ if (QWindowSystemInterfacePrivate::eventHandler->sendEvent(event))
+ nevents++;
+ } else {
+ nevents++;
+ QGuiApplicationPrivate::processWindowSystemEvent(event);
+ }
+
+ // Record the accepted state for the processed event
+ // (excluding flush events). This state can then be
+ // returned by flushWindowSystemEvents().
+ if (event->type != QWindowSystemInterfacePrivate::FlushEvents)
+ QWindowSystemInterfacePrivate::eventAccepted.store(event->eventAccepted);
+
delete event;
}
return (nevents > 0);
}
-void QWindowSystemInterface::setSynchronousWindowsSystemEvents(bool enable)
+void QWindowSystemInterfacePrivate::installWindowSystemEventHandler(QWindowSystemEventHandler *handler)
+{
+ if (!eventHandler)
+ eventHandler = handler;
+}
+
+void QWindowSystemInterfacePrivate::removeWindowSystemEventhandler(QWindowSystemEventHandler *handler)
+{
+ if (eventHandler == handler)
+ eventHandler = 0;
+}
+
+void QWindowSystemInterface::setSynchronousWindowSystemEvents(bool enable)
{
- QWindowSystemInterfacePrivate::synchronousWindowsSystemEvents = enable;
+ QWindowSystemInterfacePrivate::synchronousWindowSystemEvents = enable;
}
int QWindowSystemInterface::windowSystemEventsQueued()
@@ -642,12 +675,12 @@ int QWindowSystemInterface::windowSystemEventsQueued()
#ifndef QT_NO_DRAGANDDROP
QPlatformDragQtResponse QWindowSystemInterface::handleDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions)
{
- return QGuiApplicationPrivate::processDrag(w, dropData, p,supportedActions);
+ return QGuiApplicationPrivate::processDrag(w, dropData, QHighDpi::fromNativeLocalPosition(p, w) ,supportedActions);
}
QPlatformDropQtResponse QWindowSystemInterface::handleDrop(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions)
{
- return QGuiApplicationPrivate::processDrop(w, dropData, p,supportedActions);
+ return QGuiApplicationPrivate::processDrop(w, dropData, QHighDpi::fromNativeLocalPosition(p, w),supportedActions);
}
#endif // QT_NO_DRAGANDDROP
@@ -681,8 +714,11 @@ void QWindowSystemInterface::handleTabletEvent(QWindow *w, ulong timestamp, cons
Qt::KeyboardModifiers modifiers)
{
QWindowSystemInterfacePrivate::TabletEvent *e =
- new QWindowSystemInterfacePrivate::TabletEvent(w, timestamp, local, global, device, pointerType, buttons, pressure,
- xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
+ new QWindowSystemInterfacePrivate::TabletEvent(w,timestamp,
+ QHighDpi::fromNativeLocalPosition(local, w),
+ QHighDpi::fromNativePixels(global, w),
+ device, pointerType, buttons, pressure,
+ xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -807,18 +843,60 @@ Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QWindowSystemInterface::TouchPo
}
#endif
-Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier) {
- QWindowSystemInterface::handleMouseEvent(w, local, global, b, mods);
+// The following functions are used by testlib, and need to be synchronous to avoid
+// race conditions with plugins delivering native events from secondary threads.
+
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods, int timestamp)
+{
+ bool wasSynchronous = QWindowSystemInterfacePrivate::synchronousWindowSystemEvents;
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
+ QWindowSystemInterface::handleMouseEvent(w, timestamp, local, global, b, mods);
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(wasSynchronous);
}
Q_GUI_EXPORT void qt_handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1)
{
+ bool wasSynchronous = QWindowSystemInterfacePrivate::synchronousWindowSystemEvents;
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
QWindowSystemInterface::handleKeyEvent(w, t, k, mods, text, autorep, count);
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(wasSynchronous);
}
-Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString &text = QString(), bool autorep = false, ushort count = 1)
+Q_GUI_EXPORT bool qt_handleShortcutEvent(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString &text = QString(), bool autorep = false, ushort count = 1)
{
- return QWindowSystemInterface::tryHandleShortcutEventToObject(o, timestamp, k, mods, text, autorep, count);
+#ifndef QT_NO_SHORTCUT
+
+ // FIXME: This method should not allow targeting a specific object, but should
+ // instead forward the event to a window, which then takes care of normal event
+ // propagation. We need to fix a lot of tests before we can refactor this (the
+ // window needs to be exposed and active and have a focus object), so we leave
+ // it as is for now. See QTBUG-48577.
+
+ QGuiApplicationPrivate::modifier_buttons = mods;
+
+ QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count);
+ qevent.setTimestamp(timestamp);
+
+ QShortcutMap &shortcutMap = QGuiApplicationPrivate::instance()->shortcutMap;
+ if (shortcutMap.state() == QKeySequence::NoMatch) {
+ // Try sending as QKeyEvent::ShortcutOverride first
+ QCoreApplication::sendEvent(o, &qevent);
+ if (qevent.isAccepted())
+ return false;
+ }
+
+ // Then as QShortcutEvent
+ return shortcutMap.tryShortcut(&qevent);
+#else
+ Q_UNUSED(o)
+ Q_UNUSED(timestamp)
+ Q_UNUSED(k)
+ Q_UNUSED(mods)
+ Q_UNUSED(text)
+ Q_UNUSED(autorep)
+ Q_UNUSED(count)
+ return false;
+#endif
}
static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
@@ -839,17 +917,31 @@ static QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QLi
QList<struct QWindowSystemInterface::TouchPoint> newList;
Q_FOREACH (QTouchEvent::TouchPoint p, pointList)
- {
newList.append(touchPoint(p));
- }
+
return newList;
}
-Q_GUI_EXPORT void qt_handleTouchEvent(QWindow *w, QTouchDevice *device,
+Q_GUI_EXPORT void qt_handleTouchEvent(QWindow *w, QTouchDevice *device,
const QList<QTouchEvent::TouchPoint> &points,
Qt::KeyboardModifiers mods = Qt::NoModifier)
{
+ bool wasSynchronous = QWindowSystemInterfacePrivate::synchronousWindowSystemEvents;
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
QWindowSystemInterface::handleTouchEvent(w, device, touchPointList(points), mods);
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(wasSynchronous);
}
+QWindowSystemEventHandler::~QWindowSystemEventHandler()
+{
+ QWindowSystemInterfacePrivate::removeWindowSystemEventhandler(this);
+}
+
+bool QWindowSystemEventHandler::sendEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
+{
+ QGuiApplicationPrivate::processWindowSystemEvent(e);
+ return true;
+}
+
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index 448c5d0893..a27c68649e 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -78,32 +78,18 @@ public:
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
- static bool tryHandleShortcutOverrideEvent(QWindow *w, QKeyEvent *ev);
+ static bool handleShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, quint32 nativeScanCode,
+ quint32 nativeVirtualKey, quint32 nativeModifiers, const QString & text = QString(), bool autorep = false, ushort count = 1);
- static bool tryHandleShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
- const QString & text = QString(), bool autorep = false, ushort count = 1);
- static bool tryHandleShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
- const QString & text = QString(), bool autorep = false, ushort count = 1);
+ static bool handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
+ static bool handleKeyEvent(QWindow *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
- static bool tryHandleShortcutEventToObject(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods,
- const QString & text = QString(), bool autorep = false, ushort count = 1);
-
- static bool tryHandleExtendedShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
- quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
- const QString & text = QString(), bool autorep = false, ushort count = 1);
- static bool tryHandleExtendedShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
- quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
- const QString & text = QString(), bool autorep = false, ushort count = 1);
-
- static void handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
- static void handleKeyEvent(QWindow *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
-
- static void handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
+ static bool handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey,
quint32 nativeModifiers,
const QString& text = QString(), bool autorep = false,
- ushort count = 1);
- static void handleExtendedKeyEvent(QWindow *w, ulong timestamp, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
+ ushort count = 1, bool tryShortcutOverride = true);
+ static bool handleExtendedKeyEvent(QWindow *w, ulong timestamp, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey,
quint32 nativeModifiers,
const QString& text = QString(), bool autorep = false,
@@ -127,7 +113,8 @@ public:
QVector<QPointF> rawPositions; // in screen coordinates
};
- static void registerTouchDevice(QTouchDevice *device);
+ static void registerTouchDevice(const QTouchDevice *device);
+ static void unregisterTouchDevice(const QTouchDevice *device);
static void handleTouchEvent(QWindow *w, QTouchDevice *device,
const QList<struct TouchPoint> &points, Qt::KeyboardModifiers mods = Qt::NoModifier);
static void handleTouchEvent(QWindow *w, ulong timestamp, QTouchDevice *device,
@@ -212,8 +199,8 @@ public:
// For event dispatcher implementations
static bool sendWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
- static void setSynchronousWindowsSystemEvents(bool enable);
- static void flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents);
+ static void setSynchronousWindowSystemEvents(bool enable);
+ static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents);
static void deferredFlushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags);
static int windowSystemEventsQueued();
};
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index 2ec402a1e9..e48d1e965b 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -51,9 +51,12 @@
#include <QMutex>
#include <QList>
#include <QWaitCondition>
+#include <QAtomicInt>
QT_BEGIN_NAMESPACE
+class QWindowSystemEventHandler;
+
class Q_GUI_EXPORT QWindowSystemInterfacePrivate {
public:
enum EventType {
@@ -99,7 +102,7 @@ public:
};
explicit WindowSystemEvent(EventType t)
- : type(t), flags(0) { }
+ : type(t), flags(0), eventAccepted(true) { }
virtual ~WindowSystemEvent() { }
bool synthetic() const { return flags & Synthetic; }
@@ -107,6 +110,7 @@ public:
EventType type;
int flags;
+ bool eventAccepted;
};
class CloseEvent : public WindowSystemEvent {
@@ -478,15 +482,33 @@ public:
static WindowSystemEvent *getNonUserInputWindowSystemEvent();
static WindowSystemEvent *peekWindowSystemEvent(EventType t);
static void removeWindowSystemEvent(WindowSystemEvent *event);
- static void handleWindowSystemEvent(WindowSystemEvent *ev);
+ static void postWindowSystemEvent(WindowSystemEvent *ev);
+ static bool handleWindowSystemEvent(WindowSystemEvent *ev);
static QElapsedTimer eventTime;
- static bool synchronousWindowsSystemEvents;
+ static bool synchronousWindowSystemEvents;
static QWaitCondition eventsFlushed;
static QMutex flushEventMutex;
+ static QAtomicInt eventAccepted;
+
+ static QList<QTouchEvent::TouchPoint>
+ fromNativeTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points,
+ const QWindow *window, QEvent::Type *type = Q_NULLPTR);
+ static QList<QWindowSystemInterface::TouchPoint>
+ toNativeTouchPoints(const QList<QTouchEvent::TouchPoint>& pointList,
+ const QWindow *window);
+
+ static void installWindowSystemEventHandler(QWindowSystemEventHandler *handler);
+ static void removeWindowSystemEventhandler(QWindowSystemEventHandler *handler);
+ static QWindowSystemEventHandler *eventHandler;
+};
- static QList<QTouchEvent::TouchPoint> convertTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points, QEvent::Type *type);
+class Q_GUI_EXPORT QWindowSystemEventHandler
+{
+public:
+ virtual ~QWindowSystemEventHandler();
+ virtual bool sendEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *event);
};
QT_END_NAMESPACE
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 6f6ff235cf..cd5686be94 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -86,7 +86,7 @@ public:
inline void fill(float value);
double determinant() const;
- QMatrix4x4 inverted(bool *invertible = 0) const;
+ QMatrix4x4 inverted(bool *invertible = Q_NULLPTR) const;
QMatrix4x4 transposed() const;
QMatrix3x3 normalMatrix() const;
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index 5b0006ac56..3716220a60 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -164,12 +164,12 @@ inline QQuaternion::QQuaternion(float aScalar, float xpos, float ypos, float zpo
inline bool QQuaternion::isNull() const
{
- return xp == 0.0f && yp == 0.0f && zp == 0.0f && wp == 0.0f;
+ return wp == 0.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f;
}
inline bool QQuaternion::isIdentity() const
{
- return xp == 0.0f && yp == 0.0f && zp == 0.0f && wp == 1.0f;
+ return wp == 1.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f;
}
inline float QQuaternion::x() const { return xp; }
@@ -184,16 +184,16 @@ inline void QQuaternion::setScalar(float aScalar) { wp = aScalar; }
Q_DECL_CONSTEXPR inline float QQuaternion::dotProduct(const QQuaternion &q1, const QQuaternion &q2)
{
- return q1.xp * q2.xp + q1.yp * q2.yp + q1.zp * q2.zp + q1.wp * q2.wp;
+ return q1.wp * q2.wp + q1.xp * q2.xp + q1.yp * q2.yp + q1.zp * q2.zp;
}
inline QQuaternion QQuaternion::inverted() const
{
// Need some extra precision if the length is very small.
- double len = double(xp) * double(xp) +
+ double len = double(wp) * double(wp) +
+ double(xp) * double(xp) +
double(yp) * double(yp) +
- double(zp) * double(zp) +
- double(wp) * double(wp);
+ double(zp) * double(zp);
if (!qFuzzyIsNull(len))
return QQuaternion(wp / len, -xp / len, -yp / len, -zp / len);
return QQuaternion(0.0f, 0.0f, 0.0f, 0.0f);
@@ -213,28 +213,28 @@ inline QQuaternion QQuaternion::conjugate() const
inline QQuaternion &QQuaternion::operator+=(const QQuaternion &quaternion)
{
+ wp += quaternion.wp;
xp += quaternion.xp;
yp += quaternion.yp;
zp += quaternion.zp;
- wp += quaternion.wp;
return *this;
}
inline QQuaternion &QQuaternion::operator-=(const QQuaternion &quaternion)
{
+ wp -= quaternion.wp;
xp -= quaternion.xp;
yp -= quaternion.yp;
zp -= quaternion.zp;
- wp -= quaternion.wp;
return *this;
}
inline QQuaternion &QQuaternion::operator*=(float factor)
{
+ wp *= factor;
xp *= factor;
yp *= factor;
zp *= factor;
- wp *= factor;
return *this;
}
@@ -262,16 +262,16 @@ inline QQuaternion &QQuaternion::operator*=(const QQuaternion &quaternion)
inline QQuaternion &QQuaternion::operator/=(float divisor)
{
+ wp /= divisor;
xp /= divisor;
yp /= divisor;
zp /= divisor;
- wp /= divisor;
return *this;
}
inline bool operator==(const QQuaternion &q1, const QQuaternion &q2)
{
- return q1.xp == q2.xp && q1.yp == q2.yp && q1.zp == q2.zp && q1.wp == q2.wp;
+ return q1.wp == q2.wp && q1.xp == q2.xp && q1.yp == q2.yp && q1.zp == q2.zp;
}
inline bool operator!=(const QQuaternion &q1, const QQuaternion &q2)
@@ -311,10 +311,10 @@ inline const QQuaternion operator/(const QQuaternion &quaternion, float divisor)
inline bool qFuzzyCompare(const QQuaternion& q1, const QQuaternion& q2)
{
- return qFuzzyCompare(q1.xp, q2.xp) &&
+ return qFuzzyCompare(q1.wp, q2.wp) &&
+ qFuzzyCompare(q1.xp, q2.xp) &&
qFuzzyCompare(q1.yp, q2.yp) &&
- qFuzzyCompare(q1.zp, q2.zp) &&
- qFuzzyCompare(q1.wp, q2.wp);
+ qFuzzyCompare(q1.zp, q2.zp);
}
#ifndef QT_NO_VECTOR3D
diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h
index 137142f381..c4e62710d9 100644
--- a/src/gui/math3d/qvector2d.h
+++ b/src/gui/math3d/qvector2d.h
@@ -122,7 +122,7 @@ private:
friend class QVector4D;
};
-Q_DECLARE_TYPEINFO(QVector2D, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QVector2D, Q_PRIMITIVE_TYPE);
Q_DECL_CONSTEXPR inline QVector2D::QVector2D() : xp(0.0f), yp(0.0f) {}
diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h
index 5be637e0c5..b62d33da71 100644
--- a/src/gui/math3d/qvector3d.h
+++ b/src/gui/math3d/qvector3d.h
@@ -141,7 +141,7 @@ private:
#endif
};
-Q_DECLARE_TYPEINFO(QVector3D, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QVector3D, Q_PRIMITIVE_TYPE);
Q_DECL_CONSTEXPR inline QVector3D::QVector3D() : xp(0.0f), yp(0.0f), zp(0.0f) {}
diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h
index 72db8ac754..0543f0fbe3 100644
--- a/src/gui/math3d/qvector4d.h
+++ b/src/gui/math3d/qvector4d.h
@@ -131,7 +131,7 @@ private:
#endif
};
-Q_DECLARE_TYPEINFO(QVector4D, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QVector4D, Q_PRIMITIVE_TYPE);
Q_DECL_CONSTEXPR inline QVector4D::QVector4D() : xp(0.0f), yp(0.0f), zp(0.0f), wp(0.0f) {}
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index 8659bd6dea..b13f258fda 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -36,7 +36,8 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopengltexture.h \
opengl/qopengltexture_p.h \
opengl/qopengltexturehelper_p.h \
- opengl/qopenglpixeltransferoptions.h
+ opengl/qopenglpixeltransferoptions.h \
+ opengl/qopenglextrafunctions.h
SOURCES += opengl/qopengl.cpp \
opengl/qopenglfunctions.cpp \
diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp
index 1c008ccb42..a77d6743ad 100644
--- a/src/gui/opengl/qopengl.cpp
+++ b/src/gui/opengl/qopengl.cpp
@@ -135,20 +135,42 @@ static const char operators[][3] = {"!=", "<", "<=", "=", ">", ">="};
static inline QString valueKey() { return QStringLiteral("value"); }
static inline QString opKey() { return QStringLiteral("op"); }
static inline QString versionKey() { return QStringLiteral("version"); }
+static inline QString releaseKey() { return QStringLiteral("release"); }
static inline QString typeKey() { return QStringLiteral("type"); }
static inline QString osKey() { return QStringLiteral("os"); }
static inline QString vendorIdKey() { return QStringLiteral("vendor_id"); }
static inline QString glVendorKey() { return QStringLiteral("gl_vendor"); }
static inline QString deviceIdKey() { return QStringLiteral("device_id"); }
static inline QString driverVersionKey() { return QStringLiteral("driver_version"); }
+static inline QString driverDescriptionKey() { return QStringLiteral("driver_description"); }
static inline QString featuresKey() { return QStringLiteral("features"); }
static inline QString idKey() { return QStringLiteral("id"); }
static inline QString descriptionKey() { return QStringLiteral("description"); }
static inline QString exceptionsKey() { return QStringLiteral("exceptions"); }
+typedef QJsonArray::ConstIterator JsonArrayConstIt;
+
+static inline bool contains(const QJsonArray &haystack, unsigned needle)
+{
+ for (JsonArrayConstIt it = haystack.constBegin(), cend = haystack.constEnd(); it != cend; ++it) {
+ if (needle == it->toString().toUInt(Q_NULLPTR, /* base */ 0))
+ return true;
+ }
+ return false;
+}
+
+static inline bool contains(const QJsonArray &haystack, const QString &needle)
+{
+ for (JsonArrayConstIt it = haystack.constBegin(), cend = haystack.constEnd(); it != cend; ++it) {
+ if (needle == it->toString())
+ return true;
+ }
+ return false;
+}
+
namespace {
// VersionTerm describing a version term consisting of number and operator
-// found in "os", "driver_version", "gl_version".
+// found in os.version and driver_version.
struct VersionTerm {
VersionTerm() : op(NotEqual) {}
static VersionTerm fromJson(const QJsonValue &v);
@@ -162,7 +184,7 @@ struct VersionTerm {
bool VersionTerm::matches(const QVersionNumber &other) const
{
if (isNull() || other.isNull()) {
- qWarning() << Q_FUNC_INFO << "called with invalid parameters";
+ qWarning("called with invalid parameters");
return false;
}
switch (op) {
@@ -206,21 +228,56 @@ struct OsTypeTerm
static OsTypeTerm fromJson(const QJsonValue &v);
static QString hostOs();
static QVersionNumber hostKernelVersion() { return QVersionNumber::fromString(QSysInfo::kernelVersion()); }
+ static QString hostOsRelease() {
+ QString ver;
+#ifdef Q_OS_WIN
+ switch (QSysInfo::windowsVersion()) {
+ case QSysInfo::WV_XP:
+ case QSysInfo::WV_2003:
+ ver = QStringLiteral("xp");
+ break;
+ case QSysInfo::WV_VISTA:
+ ver = QStringLiteral("vista");
+ break;
+ case QSysInfo::WV_WINDOWS7:
+ ver = QStringLiteral("7");
+ break;
+ case QSysInfo::WV_WINDOWS8:
+ ver = QStringLiteral("8");
+ break;
+ case QSysInfo::WV_WINDOWS8_1:
+ ver = QStringLiteral("8.1");
+ break;
+ case QSysInfo::WV_WINDOWS10:
+ ver = QStringLiteral("10");
+ break;
+ default:
+ break;
+ }
+#endif
+ return ver;
+ }
bool isNull() const { return type.isEmpty(); }
- bool matches(const QString &osName, const QVersionNumber &kernelVersion) const
+ bool matches(const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease) const
{
if (isNull() || osName.isEmpty() || kernelVersion.isNull()) {
- qWarning() << Q_FUNC_INFO << "called with invalid parameters";
+ qWarning("called with invalid parameters");
return false;
}
if (type != osName)
return false;
- return versionTerm.isNull() || versionTerm.matches(kernelVersion);
+ if (!versionTerm.isNull() && !versionTerm.matches(kernelVersion))
+ return false;
+ // release is a list of Windows versions where the rule should match
+ if (!release.isEmpty() && !contains(release, osRelease))
+ return false;
+ return true;
}
QString type;
VersionTerm versionTerm;
+ QJsonArray release;
};
OsTypeTerm OsTypeTerm::fromJson(const QJsonValue &v)
@@ -231,6 +288,7 @@ OsTypeTerm OsTypeTerm::fromJson(const QJsonValue &v)
const QJsonObject o = v.toObject();
result.type = o.value(typeKey()).toString();
result.versionTerm = VersionTerm::fromJson(o.value(versionKey()));
+ result.release = o.value(releaseKey()).toArray();
return result;
}
@@ -251,17 +309,6 @@ QString OsTypeTerm::hostOs()
}
} // anonymous namespace
-typedef QJsonArray::ConstIterator JsonArrayConstIt;
-
-static inline bool contains(const QJsonArray &a, unsigned needle)
-{
- for (JsonArrayConstIt it = a.constBegin(), cend = a.constEnd(); it != cend; ++it) {
- if (needle == it->toString().toUInt(Q_NULLPTR, /* base */ 0))
- return true;
- }
- return false;
-}
-
static QString msgSyntaxWarning(const QJsonObject &object, const QString &what)
{
QString result;
@@ -277,17 +324,18 @@ static QString msgSyntaxWarning(const QJsonObject &object, const QString &what)
static bool matches(const QJsonObject &object,
const QString &osName,
const QVersionNumber &kernelVersion,
+ const QString &osRelease,
const QOpenGLConfig::Gpu &gpu)
{
const OsTypeTerm os = OsTypeTerm::fromJson(object.value(osKey()));
- if (!os.isNull() && !os.matches(osName, kernelVersion))
+ if (!os.isNull() && !os.matches(osName, kernelVersion, osRelease))
return false;
const QJsonValue exceptionsV = object.value(exceptionsKey());
if (exceptionsV.isArray()) {
const QJsonArray exceptionsA = exceptionsV.toArray();
for (JsonArrayConstIt it = exceptionsA.constBegin(), cend = exceptionsA.constEnd(); it != cend; ++it) {
- if (matches(it->toObject(), osName, kernelVersion, gpu))
+ if (matches(it->toObject(), osName, kernelVersion, osRelease, gpu))
return false;
}
}
@@ -336,12 +384,22 @@ static bool matches(const QJsonObject &object,
QLatin1String("Driver version must be of type object."));
}
}
+
+ if (!gpu.driverDescription.isEmpty()) {
+ const QJsonValue driverDescriptionV = object.value(driverDescriptionKey());
+ if (driverDescriptionV.isString()) {
+ if (!gpu.driverDescription.contains(driverDescriptionV.toString().toUtf8()))
+ return false;
+ }
+ }
+
return true;
}
static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
const QString &osName,
const QVersionNumber &kernelVersion,
+ const QString &osRelease,
const QJsonDocument &doc,
QSet<QString> *result,
QString *errorMessage)
@@ -358,7 +416,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
for (JsonArrayConstIt eit = entriesA.constBegin(), ecend = entriesA.constEnd(); eit != ecend; ++eit) {
if (eit->isObject()) {
const QJsonObject object = eit->toObject();
- if (matches(object, osName, kernelVersion, gpu)) {
+ if (matches(object, osName, kernelVersion, osRelease, gpu)) {
const QJsonValue featuresListV = object.value(featuresKey());
if (featuresListV.isArray()) {
const QJsonArray featuresListA = featuresListV.toArray();
@@ -374,6 +432,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
const QString &osName,
const QVersionNumber &kernelVersion,
+ const QString &osRelease,
const QByteArray &jsonAsciiData,
QSet<QString> *result, QString *errorMessage)
{
@@ -389,12 +448,13 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
<< error.offset << ").";
return false;
}
- return readGpuFeatures(gpu, osName, kernelVersion, document, result, errorMessage);
+ return readGpuFeatures(gpu, osName, kernelVersion, osRelease, document, result, errorMessage);
}
static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
const QString &osName,
const QVersionNumber &kernelVersion,
+ const QString &osRelease,
const QString &fileName,
QSet<QString> *result, QString *errorMessage)
{
@@ -407,7 +467,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
<< file.errorString();
return false;
}
- const bool success = readGpuFeatures(gpu, osName, kernelVersion, file.readAll(), result, errorMessage);
+ const bool success = readGpuFeatures(gpu, osName, kernelVersion, osRelease, file.readAll(), result, errorMessage);
if (!success) {
errorMessage->prepend(QLatin1String("Error reading \"")
+ QDir::toNativeSeparators(fileName)
@@ -417,37 +477,39 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
}
QSet<QString> QOpenGLConfig::gpuFeatures(const QOpenGLConfig::Gpu &gpu,
- const QString &osName,
- const QVersionNumber &kernelVersion,
- const QJsonDocument &doc)
+ const QString &osName,
+ const QVersionNumber &kernelVersion,
+ const QString &osRelease,
+ const QJsonDocument &doc)
{
QSet<QString> result;
QString errorMessage;
- if (!readGpuFeatures(gpu, osName, kernelVersion, doc, &result, &errorMessage))
+ if (!readGpuFeatures(gpu, osName, kernelVersion, osRelease, doc, &result, &errorMessage))
qWarning().noquote() << errorMessage;
return result;
}
QSet<QString> QOpenGLConfig::gpuFeatures(const QOpenGLConfig::Gpu &gpu,
- const QString &osName,
- const QVersionNumber &kernelVersion,
- const QString &fileName)
+ const QString &osName,
+ const QVersionNumber &kernelVersion,
+ const QString &osRelease,
+ const QString &fileName)
{
QSet<QString> result;
QString errorMessage;
- if (!readGpuFeatures(gpu, osName, kernelVersion, fileName, &result, &errorMessage))
+ if (!readGpuFeatures(gpu, osName, kernelVersion, osRelease, fileName, &result, &errorMessage))
qWarning().noquote() << errorMessage;
return result;
}
QSet<QString> QOpenGLConfig::gpuFeatures(const Gpu &gpu, const QJsonDocument &doc)
{
- return gpuFeatures(gpu, OsTypeTerm::hostOs(), OsTypeTerm::hostKernelVersion(), doc);
+ return gpuFeatures(gpu, OsTypeTerm::hostOs(), OsTypeTerm::hostKernelVersion(), OsTypeTerm::hostOsRelease(), doc);
}
QSet<QString> QOpenGLConfig::gpuFeatures(const Gpu &gpu, const QString &fileName)
{
- return gpuFeatures(gpu, OsTypeTerm::hostOs(), OsTypeTerm::hostKernelVersion(), fileName);
+ return gpuFeatures(gpu, OsTypeTerm::hostOs(), OsTypeTerm::hostKernelVersion(), OsTypeTerm::hostOsRelease(), fileName);
}
QOpenGLConfig::Gpu QOpenGLConfig::Gpu::fromContext()
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index 72abce760d..87dc2a830e 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -83,13 +83,11 @@ typedef void* GLeglImageOES;
// include headers on top of each other, meaning that applications can
// include gl2.h even if gl31.h gets included here.
-// This compile time differentation is important inside Qt because,
-// unlike desktop GL, GLES is different when it comes to versioning
-// and extensions: Standard functions that are new in a given version
-// are always available in a version-specific header and are not
-// guaranteed to be dynamically resolvable via eglGetProcAddress (and
-// are typically not available as extensions even if they were part of
-// an extension for a previous version).
+// NB! This file contains the only usages of the ES_3 and ES_3_1
+// macros. They are useless for pretty much anything else. The fact
+// that Qt was built against an SDK with f.ex. ES 2 only does not mean
+// applications cannot target ES 3. Therefore QOpenGLFunctions and
+// friends do everything dynamically and never rely on these macros.
# if defined(QT_OPENGL_ES_3_1)
# include <GLES3/gl31.h>
diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h
index 980e02aea6..6b66a3ba57 100644
--- a/src/gui/opengl/qopengl_p.h
+++ b/src/gui/opengl/qopengl_p.h
@@ -49,7 +49,7 @@
#include <private/qopenglcontext_p.h>
#include <QtCore/qset.h>
#include <QtCore/qstring.h>
-#include <private/qversionnumber_p.h>
+#include <QtCore/qversionnumber.h>
QT_BEGIN_NAMESPACE
@@ -79,19 +79,21 @@ public:
bool isValid() const { return deviceId || !glVendor.isEmpty(); }
bool equals(const Gpu &other) const {
return vendorId == other.vendorId && deviceId == other.deviceId && driverVersion == other.driverVersion
- && glVendor == other.glVendor;
+ && driverDescription == other.driverDescription && glVendor == other.glVendor;
}
uint vendorId;
uint deviceId;
QVersionNumber driverVersion;
+ QByteArray driverDescription;
QByteArray glVendor;
- static Gpu fromDevice(uint vendorId, uint deviceId, QVersionNumber driverVersion) {
+ static Gpu fromDevice(uint vendorId, uint deviceId, QVersionNumber driverVersion, const QByteArray &driverDescription) {
Gpu gpu;
gpu.vendorId = vendorId;
gpu.deviceId = deviceId;
gpu.driverVersion = driverVersion;
+ gpu.driverDescription = driverDescription;
return gpu;
}
@@ -105,10 +107,10 @@ public:
};
static QSet<QString> gpuFeatures(const Gpu &gpu,
- const QString &osName, const QVersionNumber &kernelVersion,
+ const QString &osName, const QVersionNumber &kernelVersion, const QString &osVersion,
const QJsonDocument &doc);
static QSet<QString> gpuFeatures(const Gpu &gpu,
- const QString &osName, const QVersionNumber &kernelVersion,
+ const QString &osName, const QVersionNumber &kernelVersion, const QString &osVersion,
const QString &fileName);
static QSet<QString> gpuFeatures(const Gpu &gpu, const QJsonDocument &doc);
static QSet<QString> gpuFeatures(const Gpu &gpu, const QString &fileName);
diff --git a/src/gui/opengl/qopenglbuffer.h b/src/gui/opengl/qopenglbuffer.h
index 847c1efaa0..ca3d85d8e0 100644
--- a/src/gui/opengl/qopenglbuffer.h
+++ b/src/gui/opengl/qopenglbuffer.h
@@ -118,7 +118,7 @@ public:
void write(int offset, const void *data, int count);
void allocate(const void *data, int count);
- inline void allocate(int count) { allocate(0, count); }
+ inline void allocate(int count) { allocate(Q_NULLPTR, count); }
void *map(QOpenGLBuffer::Access access);
void *mapRange(int offset, int count, QOpenGLBuffer::RangeAccessFlags access);
diff --git a/src/gui/opengl/qopengldebug.h b/src/gui/opengl/qopengldebug.h
index 425ab78d7a..3e93ad4120 100644
--- a/src/gui/opengl/qopengldebug.h
+++ b/src/gui/opengl/qopengldebug.h
@@ -97,14 +97,14 @@ public:
QOpenGLDebugMessage();
QOpenGLDebugMessage(const QOpenGLDebugMessage &debugMessage);
- ~QOpenGLDebugMessage();
QOpenGLDebugMessage &operator=(const QOpenGLDebugMessage &debugMessage);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&debugMessage)
- { d.swap(debugMessage.d); return *this; }
+ QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- inline void swap(QOpenGLDebugMessage &debugMessage) { d.swap(debugMessage.d); }
+ ~QOpenGLDebugMessage();
+
+ void swap(QOpenGLDebugMessage &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
Source source() const;
Type type() const;
@@ -156,7 +156,7 @@ public:
};
Q_ENUM(LoggingMode)
- explicit QOpenGLDebugLogger(QObject *parent = 0);
+ explicit QOpenGLDebugLogger(QObject *parent = Q_NULLPTR);
~QOpenGLDebugLogger();
bool initialize();
diff --git a/src/gui/opengl/qopenglengineshadermanager.cpp b/src/gui/opengl/qopenglengineshadermanager.cpp
index 7e53c01cba..40f4ce94c2 100644
--- a/src/gui/opengl/qopenglengineshadermanager.cpp
+++ b/src/gui/opengl/qopenglengineshadermanager.cpp
@@ -427,11 +427,10 @@ QOpenGLEngineShaderProg *QOpenGLEngineSharedShaders::findProgramInCache(const QO
if (!inCache)
shaderCache.store(newProg->program, QOpenGLContext::currentContext());
} else {
- QLatin1String none("none");
- QLatin1String br("\n");
QString error;
error = QLatin1String("Shader program failed to link,");
#if defined(QT_DEBUG)
+ QLatin1String br("\n");
error += QLatin1String("\n Shaders Used:\n");
for (int i = 0; i < newProg->program->shaders().count(); ++i) {
QOpenGLShader *shader = newProg->program->shaders().at(i);
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index 7def687f49..aa2a08242d 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -45,7 +45,7 @@
// We mean it.
//
-#include "qopenglfunctions.h"
+#include "qopenglextrafunctions.h"
#include <QtCore/qlibrary.h>
QT_BEGIN_NAMESPACE
@@ -57,32 +57,194 @@ class QOpenGLES3Helper
public:
QOpenGLES3Helper();
- GLvoid* (QOPENGLF_APIENTRYP MapBufferRange)(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr length, GLbitfield access);
+ // GLES3
+ void (QOPENGLF_APIENTRYP ReadBuffer)(GLenum mode);
+ void (QOPENGLF_APIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+ void (QOPENGLF_APIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+ void (QOPENGLF_APIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+ void (QOPENGLF_APIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+ void (QOPENGLF_APIENTRYP CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+ void (QOPENGLF_APIENTRYP GenQueries)(GLsizei n, GLuint *ids);
+ void (QOPENGLF_APIENTRYP DeleteQueries)(GLsizei n, const GLuint *ids);
+ GLboolean (QOPENGLF_APIENTRYP IsQuery)(GLuint id);
+ void (QOPENGLF_APIENTRYP BeginQuery)(GLenum target, GLuint id);
+ void (QOPENGLF_APIENTRYP EndQuery)(GLenum target);
+ void (QOPENGLF_APIENTRYP GetQueryiv)(GLenum target, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params);
GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
+ void (QOPENGLF_APIENTRYP GetBufferPointerv)(GLenum target, GLenum pname, void **params);
+ void (QOPENGLF_APIENTRYP DrawBuffers)(GLsizei n, const GLenum *bufs);
+ void (QOPENGLF_APIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
void (QOPENGLF_APIENTRYP BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
- void (QOPENGLF_APIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height);
-
- void (QOPENGLF_APIENTRYP GenVertexArrays)(GLsizei n, GLuint *arrays);
- void (QOPENGLF_APIENTRYP DeleteVertexArrays)(GLsizei n, const GLuint *arrays);
+ void (QOPENGLF_APIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+ void *(QOPENGLF_APIENTRYP MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+ void (QOPENGLF_APIENTRYP FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
void (QOPENGLF_APIENTRYP BindVertexArray)(GLuint array);
+ void (QOPENGLF_APIENTRYP DeleteVertexArrays)(GLsizei n, const GLuint *arrays);
+ void (QOPENGLF_APIENTRYP GenVertexArrays)(GLsizei n, GLuint *arrays);
GLboolean (QOPENGLF_APIENTRYP IsVertexArray)(GLuint array);
-
- void (QOPENGLF_APIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
- void (QOPENGLF_APIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
- void (QOPENGLF_APIENTRYP CompressedTexImage3D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
- void (QOPENGLF_APIENTRYP CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-
- void (QOPENGLF_APIENTRYP TexStorage3D)(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth);
- void (QOPENGLF_APIENTRYP TexStorage2D)(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP GetIntegeri_v)(GLenum target, GLuint index, GLint *data);
+ void (QOPENGLF_APIENTRYP BeginTransformFeedback)(GLenum primitiveMode);
+ void (QOPENGLF_APIENTRYP EndTransformFeedback)(void);
+ void (QOPENGLF_APIENTRYP BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+ void (QOPENGLF_APIENTRYP BindBufferBase)(GLenum target, GLuint index, GLuint buffer);
+ void (QOPENGLF_APIENTRYP TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+ void (QOPENGLF_APIENTRYP GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+ void (QOPENGLF_APIENTRYP VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+ void (QOPENGLF_APIENTRYP GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params);
+ void (QOPENGLF_APIENTRYP VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void (QOPENGLF_APIENTRYP VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void (QOPENGLF_APIENTRYP VertexAttribI4iv)(GLuint index, const GLint *v);
+ void (QOPENGLF_APIENTRYP VertexAttribI4uiv)(GLuint index, const GLuint *v);
+ void (QOPENGLF_APIENTRYP GetUniformuiv)(GLuint program, GLint location, GLuint *params);
+ GLint (QOPENGLF_APIENTRYP GetFragDataLocation)(GLuint program, const GLchar *name);
+ void (QOPENGLF_APIENTRYP Uniform1ui)(GLint location, GLuint v0);
+ void (QOPENGLF_APIENTRYP Uniform2ui)(GLint location, GLuint v0, GLuint v1);
+ void (QOPENGLF_APIENTRYP Uniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void (QOPENGLF_APIENTRYP Uniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void (QOPENGLF_APIENTRYP Uniform1uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP Uniform2uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP Uniform3uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP Uniform4uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value);
+ void (QOPENGLF_APIENTRYP ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+ const GLubyte *(QOPENGLF_APIENTRYP GetStringi)(GLenum name, GLuint index);
+ void (QOPENGLF_APIENTRYP CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+ void (QOPENGLF_APIENTRYP GetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+ void (QOPENGLF_APIENTRYP GetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+ GLuint (QOPENGLF_APIENTRYP GetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName);
+ void (QOPENGLF_APIENTRYP GetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+ void (QOPENGLF_APIENTRYP UniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+ void (QOPENGLF_APIENTRYP DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+ void (QOPENGLF_APIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+ GLsync (QOPENGLF_APIENTRYP FenceSync)(GLenum condition, GLbitfield flags);
+ GLboolean (QOPENGLF_APIENTRYP IsSync)(GLsync sync);
+ void (QOPENGLF_APIENTRYP DeleteSync)(GLsync sync);
+ GLenum (QOPENGLF_APIENTRYP ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void (QOPENGLF_APIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void (QOPENGLF_APIENTRYP GetInteger64v)(GLenum pname, GLint64 *data);
+ void (QOPENGLF_APIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+ void (QOPENGLF_APIENTRYP GetInteger64i_v)(GLenum target, GLuint index, GLint64 *data);
+ void (QOPENGLF_APIENTRYP GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params);
+ void (QOPENGLF_APIENTRYP GenSamplers)(GLsizei count, GLuint *samplers);
+ void (QOPENGLF_APIENTRYP DeleteSamplers)(GLsizei count, const GLuint *samplers);
+ GLboolean (QOPENGLF_APIENTRYP IsSampler)(GLuint sampler);
+ void (QOPENGLF_APIENTRYP BindSampler)(GLuint unit, GLuint sampler);
+ void (QOPENGLF_APIENTRYP SamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
+ void (QOPENGLF_APIENTRYP SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *param);
+ void (QOPENGLF_APIENTRYP SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
+ void (QOPENGLF_APIENTRYP SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *param);
+ void (QOPENGLF_APIENTRYP GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params);
+ void (QOPENGLF_APIENTRYP VertexAttribDivisor)(GLuint index, GLuint divisor);
+ void (QOPENGLF_APIENTRYP BindTransformFeedback)(GLenum target, GLuint id);
+ void (QOPENGLF_APIENTRYP DeleteTransformFeedbacks)(GLsizei n, const GLuint *ids);
+ void (QOPENGLF_APIENTRYP GenTransformFeedbacks)(GLsizei n, GLuint *ids);
+ GLboolean (QOPENGLF_APIENTRYP IsTransformFeedback)(GLuint id);
+ void (QOPENGLF_APIENTRYP PauseTransformFeedback)(void);
+ void (QOPENGLF_APIENTRYP ResumeTransformFeedback)(void);
+ void (QOPENGLF_APIENTRYP GetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ void (QOPENGLF_APIENTRYP ProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+ void (QOPENGLF_APIENTRYP ProgramParameteri)(GLuint program, GLenum pname, GLint value);
+ void (QOPENGLF_APIENTRYP InvalidateFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+ void (QOPENGLF_APIENTRYP InvalidateSubFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP TexStorage2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP TexStorage3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ void (QOPENGLF_APIENTRYP GetInternalformativ)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+
+ // GLES 3.1
+ void (QOPENGLF_APIENTRYP DispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+ void (QOPENGLF_APIENTRYP DispatchComputeIndirect)(GLintptr indirect);
+ void (QOPENGLF_APIENTRYP DrawArraysIndirect)(GLenum mode, const void *indirect);
+ void (QOPENGLF_APIENTRYP DrawElementsIndirect)(GLenum mode, GLenum type, const void *indirect);
+ void (QOPENGLF_APIENTRYP FramebufferParameteri)(GLenum target, GLenum pname, GLint param);
+ void (QOPENGLF_APIENTRYP GetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetProgramInterfaceiv)(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+ GLuint (QOPENGLF_APIENTRYP GetProgramResourceIndex)(GLuint program, GLenum programInterface, const GLchar *name);
+ void (QOPENGLF_APIENTRYP GetProgramResourceName)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+ void (QOPENGLF_APIENTRYP GetProgramResourceiv)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+ GLint (QOPENGLF_APIENTRYP GetProgramResourceLocation)(GLuint program, GLenum programInterface, const GLchar *name);
+ void (QOPENGLF_APIENTRYP UseProgramStages)(GLuint pipeline, GLbitfield stages, GLuint program);
+ void (QOPENGLF_APIENTRYP ActiveShaderProgram)(GLuint pipeline, GLuint program);
+ GLuint (QOPENGLF_APIENTRYP CreateShaderProgramv)(GLenum type, GLsizei count, const GLchar *const*strings);
+ void (QOPENGLF_APIENTRYP BindProgramPipeline)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP DeleteProgramPipelines)(GLsizei n, const GLuint *pipelines);
+ void (QOPENGLF_APIENTRYP GenProgramPipelines)(GLsizei n, GLuint *pipelines);
+ GLboolean (QOPENGLF_APIENTRYP IsProgramPipeline)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP GetProgramPipelineiv)(GLuint pipeline, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP ProgramUniform1i)(GLuint program, GLint location, GLint v0);
+ void (QOPENGLF_APIENTRYP ProgramUniform2i)(GLuint program, GLint location, GLint v0, GLint v1);
+ void (QOPENGLF_APIENTRYP ProgramUniform3i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+ void (QOPENGLF_APIENTRYP ProgramUniform4i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+ void (QOPENGLF_APIENTRYP ProgramUniform1ui)(GLuint program, GLint location, GLuint v0);
+ void (QOPENGLF_APIENTRYP ProgramUniform2ui)(GLuint program, GLint location, GLuint v0, GLuint v1);
+ void (QOPENGLF_APIENTRYP ProgramUniform3ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void (QOPENGLF_APIENTRYP ProgramUniform4ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void (QOPENGLF_APIENTRYP ProgramUniform1f)(GLuint program, GLint location, GLfloat v0);
+ void (QOPENGLF_APIENTRYP ProgramUniform2f)(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+ void (QOPENGLF_APIENTRYP ProgramUniform3f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+ void (QOPENGLF_APIENTRYP ProgramUniform4f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+ void (QOPENGLF_APIENTRYP ProgramUniform1iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform1uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform1fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ValidateProgramPipeline)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP GetProgramPipelineInfoLog)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ void (QOPENGLF_APIENTRYP BindImageTexture)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+ void (QOPENGLF_APIENTRYP GetBooleani_v)(GLenum target, GLuint index, GLboolean *data);
+ void (QOPENGLF_APIENTRYP MemoryBarrierFunc)(GLbitfield barriers);
+ void (QOPENGLF_APIENTRYP MemoryBarrierByRegion)(GLbitfield barriers);
+ void (QOPENGLF_APIENTRYP TexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+ void (QOPENGLF_APIENTRYP GetMultisamplefv)(GLenum pname, GLuint index, GLfloat *val);
+ void (QOPENGLF_APIENTRYP SampleMaski)(GLuint maskNumber, GLbitfield mask);
+ void (QOPENGLF_APIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+ void (QOPENGLF_APIENTRYP BindVertexBuffer)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+ void (QOPENGLF_APIENTRYP VertexAttribFormat)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+ void (QOPENGLF_APIENTRYP VertexAttribIFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+ void (QOPENGLF_APIENTRYP VertexAttribBinding)(GLuint attribindex, GLuint bindingindex);
+ void (QOPENGLF_APIENTRYP VertexBindingDivisor)(GLuint bindingindex, GLuint divisor);
+
+ QPair<int, int> supportedVersion() const { return m_supportedVersion; }
private:
bool init();
QFunctionPointer resolve(const char *name);
-
+#ifndef QT_NO_LIBRARY
QLibrary m_gl;
+#endif
+ QPair<int, int> m_supportedVersion;
};
-class Q_GUI_EXPORT QOpenGLExtensions : public QOpenGLFunctions
+class Q_GUI_EXPORT QOpenGLExtensions : public QOpenGLExtraFunctions
{
Q_DECLARE_PRIVATE(QOpenGLExtensions)
public:
@@ -113,7 +275,8 @@ public:
GeometryShaders = 0x00080000,
MapBufferRange = 0x00100000,
Sized8Formats = 0x00200000,
- DiscardFramebuffer = 0x00400000
+ DiscardFramebuffer = 0x00400000,
+ Sized16Formats = 0x00800000
};
Q_DECLARE_FLAGS(OpenGLExtensions, OpenGLExtension)
@@ -121,19 +284,7 @@ public:
bool hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension extension) const;
GLvoid *glMapBuffer(GLenum target, GLenum access);
- GLvoid *glMapBufferRange(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr length, GLbitfield access);
- GLboolean glUnmapBuffer(GLenum target);
-
- void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter);
-
- void glRenderbufferStorageMultisample(GLenum target, GLsizei samples,
- GLenum internalFormat,
- GLsizei width, GLsizei height);
-
void glGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data);
-
void glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
QOpenGLES3Helper *gles3Helper();
@@ -146,21 +297,12 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLExtensions::OpenGLExtensions)
-class QOpenGLExtensionsPrivate : public QOpenGLFunctionsPrivate
+class QOpenGLExtensionsPrivate : public QOpenGLExtraFunctionsPrivate
{
public:
explicit QOpenGLExtensionsPrivate(QOpenGLContext *ctx);
GLvoid* (QOPENGLF_APIENTRYP MapBuffer)(GLenum target, GLenum access);
- GLvoid* (QOPENGLF_APIENTRYP MapBufferRange)(GLenum target, qopengl_GLintptr offset,
- qopengl_GLsizeiptr length, GLbitfield access);
- GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
- void (QOPENGLF_APIENTRYP BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter);
- void (QOPENGLF_APIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples,
- GLenum internalFormat,
- GLsizei width, GLsizei height);
void (QOPENGLF_APIENTRYP GetBufferSubData)(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data);
void (QOPENGLF_APIENTRYP DiscardFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
@@ -177,45 +319,6 @@ inline GLvoid *QOpenGLExtensions::glMapBuffer(GLenum target, GLenum access)
return result;
}
-inline GLvoid *QOpenGLExtensions::glMapBufferRange(GLenum target, qopengl_GLintptr offset,
- qopengl_GLsizeiptr length, GLbitfield access)
-{
- Q_D(QOpenGLExtensions);
- Q_ASSERT(QOpenGLExtensions::isInitialized(d));
- GLvoid *result = d->MapBufferRange(target, offset, length, access);
- Q_OPENGL_FUNCTIONS_DEBUG
- return result;
-}
-
-inline GLboolean QOpenGLExtensions::glUnmapBuffer(GLenum target)
-{
- Q_D(QOpenGLExtensions);
- Q_ASSERT(QOpenGLExtensions::isInitialized(d));
- GLboolean result = d->UnmapBuffer(target);
- Q_OPENGL_FUNCTIONS_DEBUG
- return result;
-}
-
-inline void QOpenGLExtensions::glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter)
-{
- Q_D(QOpenGLExtensions);
- Q_ASSERT(QOpenGLExtensions::isInitialized(d));
- d->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
- Q_OPENGL_FUNCTIONS_DEBUG
-}
-
-inline void QOpenGLExtensions::glRenderbufferStorageMultisample(GLenum target, GLsizei samples,
- GLenum internalFormat,
- GLsizei width, GLsizei height)
-{
- Q_D(QOpenGLExtensions);
- Q_ASSERT(QOpenGLExtensions::isInitialized(d));
- d->RenderbufferStorageMultisample(target, samples, internalFormat, width, height);
- Q_OPENGL_FUNCTIONS_DEBUG
-}
-
inline void QOpenGLExtensions::glGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
{
Q_D(QOpenGLExtensions);
diff --git a/src/gui/opengl/qopenglextrafunctions.h b/src/gui/opengl/qopenglextrafunctions.h
new file mode 100644
index 0000000000..6558284bd0
--- /dev/null
+++ b/src/gui/opengl/qopenglextrafunctions.h
@@ -0,0 +1,1990 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 QOPENGLEXTRAFUNCTIONS_H
+#define QOPENGLEXTRAFUNCTIONS_H
+
+#include <QtCore/qglobal.h>
+
+#ifndef QT_NO_OPENGL
+
+#include <QtGui/qopenglfunctions.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLExtraFunctionsPrivate;
+
+#undef glReadBuffer
+#undef glDrawRangeElements
+#undef glTexImage3D
+#undef glTexSubImage3D
+#undef glCopyTexSubImage3D
+#undef glCompressedTexImage3D
+#undef glCompressedTexSubImage3D
+#undef glGenQueries
+#undef glDeleteQueries
+#undef glIsQuery
+#undef glBeginQuery
+#undef glEndQuery
+#undef glGetQueryiv
+#undef glGetQueryObjectuiv
+#undef glUnmapBuffer
+#undef glGetBufferPointerv
+#undef glDrawBuffers
+#undef glUniformMatrix2x3fv
+#undef glUniformMatrix3x2fv
+#undef glUniformMatrix2x4fv
+#undef glUniformMatrix4x2fv
+#undef glUniformMatrix3x4fv
+#undef glUniformMatrix4x3fv
+#undef glBlitFramebuffer
+#undef glRenderbufferStorageMultisample
+#undef glFramebufferTextureLayer
+#undef glMapBufferRange
+#undef glFlushMappedBufferRange
+#undef glBindVertexArray
+#undef glDeleteVertexArrays
+#undef glGenVertexArrays
+#undef glIsVertexArray
+#undef glGetIntegeri_v
+#undef glBeginTransformFeedback
+#undef glEndTransformFeedback
+#undef glBindBufferRange
+#undef glBindBufferBase
+#undef glTransformFeedbackVaryings
+#undef glGetTransformFeedbackVarying
+#undef glVertexAttribIPointer
+#undef glGetVertexAttribIiv
+#undef glGetVertexAttribIuiv
+#undef glVertexAttribI4i
+#undef glVertexAttribI4ui
+#undef glVertexAttribI4iv
+#undef glVertexAttribI4uiv
+#undef glGetUniformuiv
+#undef glGetFragDataLocation
+#undef glUniform1ui
+#undef glUniform2ui
+#undef glUniform3ui
+#undef glUniform4ui
+#undef glUniform1uiv
+#undef glUniform2uiv
+#undef glUniform3uiv
+#undef glUniform4uiv
+#undef glClearBufferiv
+#undef glClearBufferuiv
+#undef glClearBufferfv
+#undef glClearBufferfi
+#undef glGetStringi
+#undef glCopyBufferSubData
+#undef glGetUniformIndices
+#undef glGetActiveUniformsiv
+#undef glGetUniformBlockIndex
+#undef glGetActiveUniformBlockiv
+#undef glGetActiveUniformBlockName
+#undef glUniformBlockBinding
+#undef glDrawArraysInstanced
+#undef glDrawElementsInstanced
+#undef glFenceSync
+#undef glIsSync
+#undef glDeleteSync
+#undef glClientWaitSync
+#undef glWaitSync
+#undef glGetInteger64v
+#undef glGetSynciv
+#undef glGetInteger64i_v
+#undef glGetBufferParameteri64v
+#undef glGenSamplers
+#undef glDeleteSamplers
+#undef glIsSampler
+#undef glBindSampler
+#undef glSamplerParameteri
+#undef glSamplerParameteriv
+#undef glSamplerParameterf
+#undef glSamplerParameterfv
+#undef glGetSamplerParameteriv
+#undef glGetSamplerParameterfv
+#undef glVertexAttribDivisor
+#undef glBindTransformFeedback
+#undef glDeleteTransformFeedbacks
+#undef glGenTransformFeedbacks
+#undef glIsTransformFeedback
+#undef glPauseTransformFeedback
+#undef glResumeTransformFeedback
+#undef glGetProgramBinary
+#undef glProgramBinary
+#undef glProgramParameteri
+#undef glInvalidateFramebuffer
+#undef glInvalidateSubFramebuffer
+#undef glTexStorage2D
+#undef glTexStorage3D
+#undef glGetInternalformativ
+
+#undef glDispatchCompute
+#undef glDispatchComputeIndirect
+#undef glDrawArraysIndirect
+#undef glDrawElementsIndirect
+#undef glFramebufferParameteri
+#undef glGetFramebufferParameteriv
+#undef glGetProgramInterfaceiv
+#undef glGetProgramResourceIndex
+#undef glGetProgramResourceName
+#undef glGetProgramResourceiv
+#undef glGetProgramResourceLocation
+#undef glUseProgramStages
+#undef glActiveShaderProgram
+#undef glCreateShaderProgramv
+#undef glBindProgramPipeline
+#undef glDeleteProgramPipelines
+#undef glGenProgramPipelines
+#undef glIsProgramPipeline
+#undef glGetProgramPipelineiv
+#undef glProgramUniform1i
+#undef glProgramUniform2i
+#undef glProgramUniform3i
+#undef glProgramUniform4i
+#undef glProgramUniform1ui
+#undef glProgramUniform2ui
+#undef glProgramUniform3ui
+#undef glProgramUniform4ui
+#undef glProgramUniform1f
+#undef glProgramUniform2f
+#undef glProgramUniform3f
+#undef glProgramUniform4f
+#undef glProgramUniform1iv
+#undef glProgramUniform2iv
+#undef glProgramUniform3iv
+#undef glProgramUniform4iv
+#undef glProgramUniform1uiv
+#undef glProgramUniform2uiv
+#undef glProgramUniform3uiv
+#undef glProgramUniform4uiv
+#undef glProgramUniform1fv
+#undef glProgramUniform2fv
+#undef glProgramUniform3fv
+#undef glProgramUniform4fv
+#undef glProgramUniformMatrix2fv
+#undef glProgramUniformMatrix3fv
+#undef glProgramUniformMatrix4fv
+#undef glProgramUniformMatrix2x3fv
+#undef glProgramUniformMatrix3x2fv
+#undef glProgramUniformMatrix2x4fv
+#undef glProgramUniformMatrix4x2fv
+#undef glProgramUniformMatrix3x4fv
+#undef glProgramUniformMatrix4x3fv
+#undef glValidateProgramPipeline
+#undef glGetProgramPipelineInfoLog
+#undef glBindImageTexture
+#undef glGetBooleani_v
+#undef glMemoryBarrier
+#undef glMemoryBarrierByRegion
+#undef glTexStorage2DMultisample
+#undef glGetMultisamplefv
+#undef glSampleMaski
+#undef glGetTexLevelParameteriv
+#undef glGetTexLevelParameterfv
+#undef glBindVertexBuffer
+#undef glVertexAttribFormat
+#undef glVertexAttribIFormat
+#undef glVertexAttribBinding
+#undef glVertexBindingDivisor
+
+class Q_GUI_EXPORT QOpenGLExtraFunctions : public QOpenGLFunctions
+{
+ Q_DECLARE_PRIVATE(QOpenGLExtraFunctions)
+
+public:
+ QOpenGLExtraFunctions();
+ QOpenGLExtraFunctions(QOpenGLContext *context);
+ ~QOpenGLExtraFunctions() {}
+
+ // GLES3
+ void glReadBuffer(GLenum mode);
+ void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+ void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+ void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+ void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+ void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+ void glGenQueries(GLsizei n, GLuint *ids);
+ void glDeleteQueries(GLsizei n, const GLuint *ids);
+ GLboolean glIsQuery(GLuint id);
+ void glBeginQuery(GLenum target, GLuint id);
+ void glEndQuery(GLenum target);
+ void glGetQueryiv(GLenum target, GLenum pname, GLint *params);
+ void glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params);
+ GLboolean glUnmapBuffer(GLenum target);
+ void glGetBufferPointerv(GLenum target, GLenum pname, void **params);
+ void glDrawBuffers(GLsizei n, const GLenum *bufs);
+ void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+ void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+ void *glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+ void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
+ void glBindVertexArray(GLuint array);
+ void glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
+ void glGenVertexArrays(GLsizei n, GLuint *arrays);
+ GLboolean glIsVertexArray(GLuint array);
+ void glGetIntegeri_v(GLenum target, GLuint index, GLint *data);
+ void glBeginTransformFeedback(GLenum primitiveMode);
+ void glEndTransformFeedback(void);
+ void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+ void glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
+ void glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+ void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+ void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+ void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint *params);
+ void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params);
+ void glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void glVertexAttribI4iv(GLuint index, const GLint *v);
+ void glVertexAttribI4uiv(GLuint index, const GLuint *v);
+ void glGetUniformuiv(GLuint program, GLint location, GLuint *params);
+ GLint glGetFragDataLocation(GLuint program, const GLchar *name);
+ void glUniform1ui(GLint location, GLuint v0);
+ void glUniform2ui(GLint location, GLuint v0, GLuint v1);
+ void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void glUniform1uiv(GLint location, GLsizei count, const GLuint *value);
+ void glUniform2uiv(GLint location, GLsizei count, const GLuint *value);
+ void glUniform3uiv(GLint location, GLsizei count, const GLuint *value);
+ void glUniform4uiv(GLint location, GLsizei count, const GLuint *value);
+ void glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value);
+ void glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value);
+ void glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value);
+ void glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+ const GLubyte *glGetStringi(GLenum name, GLuint index);
+ void glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+ void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+ void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+ GLuint glGetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName);
+ void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+ void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+ void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+ void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+ void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+ GLsync glFenceSync(GLenum condition, GLbitfield flags);
+ GLboolean glIsSync(GLsync sync);
+ void glDeleteSync(GLsync sync);
+ GLenum glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void glGetInteger64v(GLenum pname, GLint64 *data);
+ void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+ void glGetInteger64i_v(GLenum target, GLuint index, GLint64 *data);
+ void glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
+ void glGenSamplers(GLsizei count, GLuint *samplers);
+ void glDeleteSamplers(GLsizei count, const GLuint *samplers);
+ GLboolean glIsSampler(GLuint sampler);
+ void glBindSampler(GLuint unit, GLuint sampler);
+ void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
+ void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint *param);
+ void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
+ void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *param);
+ void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params);
+ void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params);
+ void glVertexAttribDivisor(GLuint index, GLuint divisor);
+ void glBindTransformFeedback(GLenum target, GLuint id);
+ void glDeleteTransformFeedbacks(GLsizei n, const GLuint *ids);
+ void glGenTransformFeedbacks(GLsizei n, GLuint *ids);
+ GLboolean glIsTransformFeedback(GLuint id);
+ void glPauseTransformFeedback(void);
+ void glResumeTransformFeedback(void);
+ void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ void glProgramBinary(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+ void glProgramParameteri(GLuint program, GLenum pname, GLint value);
+ void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+ void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+ void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+
+ // GLES 3.1
+ void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+ void glDispatchComputeIndirect(GLintptr indirect);
+ void glDrawArraysIndirect(GLenum mode, const void *indirect);
+ void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect);
+ void glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
+ void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+ GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar *name);
+ void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+ void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+ GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar *name);
+ void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
+ void glActiveShaderProgram(GLuint pipeline, GLuint program);
+ GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const*strings);
+ void glBindProgramPipeline(GLuint pipeline);
+ void glDeleteProgramPipelines(GLsizei n, const GLuint *pipelines);
+ void glGenProgramPipelines(GLsizei n, GLuint *pipelines);
+ GLboolean glIsProgramPipeline(GLuint pipeline);
+ void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params);
+ void glProgramUniform1i(GLuint program, GLint location, GLint v0);
+ void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
+ void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+ void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+ void glProgramUniform1ui(GLuint program, GLint location, GLuint v0);
+ void glProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1);
+ void glProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void glProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void glProgramUniform1f(GLuint program, GLint location, GLfloat v0);
+ void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+ void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+ void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+ void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glValidateProgramPipeline(GLuint pipeline);
+ void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+ void glGetBooleani_v(GLenum target, GLuint index, GLboolean *data);
+ void glMemoryBarrier(GLbitfield barriers);
+ void glMemoryBarrierByRegion(GLbitfield barriers);
+ void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+ void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat *val);
+ void glSampleMaski(GLuint maskNumber, GLbitfield mask);
+ void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
+ void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
+ void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+ void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+ void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+ void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
+ void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
+
+private:
+ static bool isInitialized(const QOpenGLExtraFunctionsPrivate *d) { return d != 0; }
+};
+
+class QOpenGLExtraFunctionsPrivate : public QOpenGLFunctionsPrivate
+{
+public:
+ QOpenGLExtraFunctionsPrivate(QOpenGLContext *ctx);
+
+ // GLES3
+ void (QOPENGLF_APIENTRYP ReadBuffer)(GLenum mode);
+ void (QOPENGLF_APIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+ void (QOPENGLF_APIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+ void (QOPENGLF_APIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+ void (QOPENGLF_APIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP CompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+ void (QOPENGLF_APIENTRYP CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+ void (QOPENGLF_APIENTRYP GenQueries)(GLsizei n, GLuint *ids);
+ void (QOPENGLF_APIENTRYP DeleteQueries)(GLsizei n, const GLuint *ids);
+ GLboolean (QOPENGLF_APIENTRYP IsQuery)(GLuint id);
+ void (QOPENGLF_APIENTRYP BeginQuery)(GLenum target, GLuint id);
+ void (QOPENGLF_APIENTRYP EndQuery)(GLenum target);
+ void (QOPENGLF_APIENTRYP GetQueryiv)(GLenum target, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params);
+ GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target);
+ void (QOPENGLF_APIENTRYP GetBufferPointerv)(GLenum target, GLenum pname, void **params);
+ void (QOPENGLF_APIENTRYP DrawBuffers)(GLsizei n, const GLenum *bufs);
+ void (QOPENGLF_APIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+ void (QOPENGLF_APIENTRYP RenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP FramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+ void *(QOPENGLF_APIENTRYP MapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+ void (QOPENGLF_APIENTRYP FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
+ void (QOPENGLF_APIENTRYP BindVertexArray)(GLuint array);
+ void (QOPENGLF_APIENTRYP DeleteVertexArrays)(GLsizei n, const GLuint *arrays);
+ void (QOPENGLF_APIENTRYP GenVertexArrays)(GLsizei n, GLuint *arrays);
+ GLboolean (QOPENGLF_APIENTRYP IsVertexArray)(GLuint array);
+ void (QOPENGLF_APIENTRYP GetIntegeri_v)(GLenum target, GLuint index, GLint *data);
+ void (QOPENGLF_APIENTRYP BeginTransformFeedback)(GLenum primitiveMode);
+ void (QOPENGLF_APIENTRYP EndTransformFeedback)(void);
+ void (QOPENGLF_APIENTRYP BindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+ void (QOPENGLF_APIENTRYP BindBufferBase)(GLenum target, GLuint index, GLuint buffer);
+ void (QOPENGLF_APIENTRYP TransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+ void (QOPENGLF_APIENTRYP GetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+ void (QOPENGLF_APIENTRYP VertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+ void (QOPENGLF_APIENTRYP GetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params);
+ void (QOPENGLF_APIENTRYP VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void (QOPENGLF_APIENTRYP VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void (QOPENGLF_APIENTRYP VertexAttribI4iv)(GLuint index, const GLint *v);
+ void (QOPENGLF_APIENTRYP VertexAttribI4uiv)(GLuint index, const GLuint *v);
+ void (QOPENGLF_APIENTRYP GetUniformuiv)(GLuint program, GLint location, GLuint *params);
+ GLint (QOPENGLF_APIENTRYP GetFragDataLocation)(GLuint program, const GLchar *name);
+ void (QOPENGLF_APIENTRYP Uniform1ui)(GLint location, GLuint v0);
+ void (QOPENGLF_APIENTRYP Uniform2ui)(GLint location, GLuint v0, GLuint v1);
+ void (QOPENGLF_APIENTRYP Uniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void (QOPENGLF_APIENTRYP Uniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void (QOPENGLF_APIENTRYP Uniform1uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP Uniform2uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP Uniform3uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP Uniform4uiv)(GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value);
+ void (QOPENGLF_APIENTRYP ClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+ const GLubyte *(QOPENGLF_APIENTRYP GetStringi)(GLenum name, GLuint index);
+ void (QOPENGLF_APIENTRYP CopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+ void (QOPENGLF_APIENTRYP GetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+ void (QOPENGLF_APIENTRYP GetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+ GLuint (QOPENGLF_APIENTRYP GetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName);
+ void (QOPENGLF_APIENTRYP GetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+ void (QOPENGLF_APIENTRYP UniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+ void (QOPENGLF_APIENTRYP DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+ void (QOPENGLF_APIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+ GLsync (QOPENGLF_APIENTRYP FenceSync)(GLenum condition, GLbitfield flags);
+ GLboolean (QOPENGLF_APIENTRYP IsSync)(GLsync sync);
+ void (QOPENGLF_APIENTRYP DeleteSync)(GLsync sync);
+ GLenum (QOPENGLF_APIENTRYP ClientWaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void (QOPENGLF_APIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void (QOPENGLF_APIENTRYP GetInteger64v)(GLenum pname, GLint64 *data);
+ void (QOPENGLF_APIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+ void (QOPENGLF_APIENTRYP GetInteger64i_v)(GLenum target, GLuint index, GLint64 *data);
+ void (QOPENGLF_APIENTRYP GetBufferParameteri64v)(GLenum target, GLenum pname, GLint64 *params);
+ void (QOPENGLF_APIENTRYP GenSamplers)(GLsizei count, GLuint *samplers);
+ void (QOPENGLF_APIENTRYP DeleteSamplers)(GLsizei count, const GLuint *samplers);
+ GLboolean (QOPENGLF_APIENTRYP IsSampler)(GLuint sampler);
+ void (QOPENGLF_APIENTRYP BindSampler)(GLuint unit, GLuint sampler);
+ void (QOPENGLF_APIENTRYP SamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
+ void (QOPENGLF_APIENTRYP SamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *param);
+ void (QOPENGLF_APIENTRYP SamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
+ void (QOPENGLF_APIENTRYP SamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *param);
+ void (QOPENGLF_APIENTRYP GetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params);
+ void (QOPENGLF_APIENTRYP VertexAttribDivisor)(GLuint index, GLuint divisor);
+ void (QOPENGLF_APIENTRYP BindTransformFeedback)(GLenum target, GLuint id);
+ void (QOPENGLF_APIENTRYP DeleteTransformFeedbacks)(GLsizei n, const GLuint *ids);
+ void (QOPENGLF_APIENTRYP GenTransformFeedbacks)(GLsizei n, GLuint *ids);
+ GLboolean (QOPENGLF_APIENTRYP IsTransformFeedback)(GLuint id);
+ void (QOPENGLF_APIENTRYP PauseTransformFeedback)(void);
+ void (QOPENGLF_APIENTRYP ResumeTransformFeedback)(void);
+ void (QOPENGLF_APIENTRYP GetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ void (QOPENGLF_APIENTRYP ProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+ void (QOPENGLF_APIENTRYP ProgramParameteri)(GLuint program, GLenum pname, GLint value);
+ void (QOPENGLF_APIENTRYP InvalidateFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+ void (QOPENGLF_APIENTRYP InvalidateSubFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP TexStorage2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP TexStorage3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ void (QOPENGLF_APIENTRYP GetInternalformativ)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+
+ // GLES 3.1
+ void (QOPENGLF_APIENTRYP DispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+ void (QOPENGLF_APIENTRYP DispatchComputeIndirect)(GLintptr indirect);
+ void (QOPENGLF_APIENTRYP DrawArraysIndirect)(GLenum mode, const void *indirect);
+ void (QOPENGLF_APIENTRYP DrawElementsIndirect)(GLenum mode, GLenum type, const void *indirect);
+ void (QOPENGLF_APIENTRYP FramebufferParameteri)(GLenum target, GLenum pname, GLint param);
+ void (QOPENGLF_APIENTRYP GetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetProgramInterfaceiv)(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+ GLuint (QOPENGLF_APIENTRYP GetProgramResourceIndex)(GLuint program, GLenum programInterface, const GLchar *name);
+ void (QOPENGLF_APIENTRYP GetProgramResourceName)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+ void (QOPENGLF_APIENTRYP GetProgramResourceiv)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+ GLint (QOPENGLF_APIENTRYP GetProgramResourceLocation)(GLuint program, GLenum programInterface, const GLchar *name);
+ void (QOPENGLF_APIENTRYP UseProgramStages)(GLuint pipeline, GLbitfield stages, GLuint program);
+ void (QOPENGLF_APIENTRYP ActiveShaderProgram)(GLuint pipeline, GLuint program);
+ GLuint (QOPENGLF_APIENTRYP CreateShaderProgramv)(GLenum type, GLsizei count, const GLchar *const*strings);
+ void (QOPENGLF_APIENTRYP BindProgramPipeline)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP DeleteProgramPipelines)(GLsizei n, const GLuint *pipelines);
+ void (QOPENGLF_APIENTRYP GenProgramPipelines)(GLsizei n, GLuint *pipelines);
+ GLboolean (QOPENGLF_APIENTRYP IsProgramPipeline)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP GetProgramPipelineiv)(GLuint pipeline, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP ProgramUniform1i)(GLuint program, GLint location, GLint v0);
+ void (QOPENGLF_APIENTRYP ProgramUniform2i)(GLuint program, GLint location, GLint v0, GLint v1);
+ void (QOPENGLF_APIENTRYP ProgramUniform3i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+ void (QOPENGLF_APIENTRYP ProgramUniform4i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+ void (QOPENGLF_APIENTRYP ProgramUniform1ui)(GLuint program, GLint location, GLuint v0);
+ void (QOPENGLF_APIENTRYP ProgramUniform2ui)(GLuint program, GLint location, GLuint v0, GLuint v1);
+ void (QOPENGLF_APIENTRYP ProgramUniform3ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void (QOPENGLF_APIENTRYP ProgramUniform4ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void (QOPENGLF_APIENTRYP ProgramUniform1f)(GLuint program, GLint location, GLfloat v0);
+ void (QOPENGLF_APIENTRYP ProgramUniform2f)(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+ void (QOPENGLF_APIENTRYP ProgramUniform3f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+ void (QOPENGLF_APIENTRYP ProgramUniform4f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+ void (QOPENGLF_APIENTRYP ProgramUniform1iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform1uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform1fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ValidateProgramPipeline)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP GetProgramPipelineInfoLog)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ void (QOPENGLF_APIENTRYP BindImageTexture)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+ void (QOPENGLF_APIENTRYP GetBooleani_v)(GLenum target, GLuint index, GLboolean *data);
+ void (QOPENGLF_APIENTRYP MemoryBarrierFunc)(GLbitfield barriers);
+ void (QOPENGLF_APIENTRYP MemoryBarrierByRegion)(GLbitfield barriers);
+ void (QOPENGLF_APIENTRYP TexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+ void (QOPENGLF_APIENTRYP GetMultisamplefv)(GLenum pname, GLuint index, GLfloat *val);
+ void (QOPENGLF_APIENTRYP SampleMaski)(GLuint maskNumber, GLbitfield mask);
+ void (QOPENGLF_APIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+ void (QOPENGLF_APIENTRYP BindVertexBuffer)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+ void (QOPENGLF_APIENTRYP VertexAttribFormat)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+ void (QOPENGLF_APIENTRYP VertexAttribIFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+ void (QOPENGLF_APIENTRYP VertexAttribBinding)(GLuint attribindex, GLuint bindingindex);
+ void (QOPENGLF_APIENTRYP VertexBindingDivisor)(GLuint bindingindex, GLuint divisor);
+};
+
+// GLES 3.0 and 3.1
+
+inline void QOpenGLExtraFunctions::glBeginQuery(GLenum target, GLuint id)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BeginQuery(target, id);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBeginTransformFeedback(GLenum primitiveMode)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BeginTransformFeedback(primitiveMode);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindBufferBase(target, index, buffer);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindBufferRange(target, index, buffer, offset, size);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindSampler(GLuint unit, GLuint sampler)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindSampler(unit, sampler);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindTransformFeedback(GLenum target, GLuint id)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindTransformFeedback(target, id);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindVertexArray(GLuint array)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindVertexArray(array);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ClearBufferfi(buffer, drawbuffer, depth, stencil);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ClearBufferfv(buffer, drawbuffer, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ClearBufferiv(buffer, drawbuffer, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ClearBufferuiv(buffer, drawbuffer, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLenum QOpenGLExtraFunctions::glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLenum result = d->ClientWaitSync(sync, flags, timeout);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDeleteQueries(GLsizei n, const GLuint * ids)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DeleteQueries(n, ids);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDeleteSamplers(GLsizei count, const GLuint * samplers)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DeleteSamplers(count, samplers);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDeleteSync(GLsync sync)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DeleteSync(sync);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDeleteTransformFeedbacks(GLsizei n, const GLuint * ids)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DeleteTransformFeedbacks(n, ids);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDeleteVertexArrays(GLsizei n, const GLuint * arrays)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DeleteVertexArrays(n, arrays);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DrawArraysInstanced(mode, first, count, instancecount);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawBuffers(GLsizei n, const GLenum * bufs)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DrawBuffers(n, bufs);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DrawElementsInstanced(mode, count, type, indices, instancecount);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DrawRangeElements(mode, start, end, count, type, indices);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glEndQuery(GLenum target)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->EndQuery(target);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glEndTransformFeedback()
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->EndTransformFeedback();
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLsync QOpenGLExtraFunctions::glFenceSync(GLenum condition, GLbitfield flags)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLsync result = d->FenceSync(condition, flags);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->FlushMappedBufferRange(target, offset, length);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->FramebufferTextureLayer(target, attachment, texture, level, layer);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGenQueries(GLsizei n, GLuint* ids)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GenQueries(n, ids);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGenSamplers(GLsizei count, GLuint* samplers)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GenSamplers(count, samplers);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGenTransformFeedbacks(GLsizei n, GLuint* ids)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GenTransformFeedbacks(n, ids);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGenVertexArrays(GLsizei n, GLuint* arrays)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GenVertexArrays(n, arrays);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetBufferParameteri64v(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetBufferPointerv(GLenum target, GLenum pname, void ** params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetBufferPointerv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLint QOpenGLExtraFunctions::glGetFragDataLocation(GLuint program, const GLchar * name)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLint result = d->GetFragDataLocation(program, name);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetInteger64i_v(target, index, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetInteger64v(GLenum pname, GLint64* data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetInteger64v(pname, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetIntegeri_v(target, index, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetInternalformativ(target, internalformat, pname, bufSize, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void * binary)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetProgramBinary(program, bufSize, length, binaryFormat, binary);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetQueryObjectuiv(id, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetQueryiv(GLenum target, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetQueryiv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetSamplerParameterfv(sampler, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetSamplerParameteriv(sampler, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline const GLubyte * QOpenGLExtraFunctions::glGetStringi(GLenum name, GLuint index)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ const GLubyte * result = d->GetStringi(name, index);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetSynciv(sync, pname, bufSize, length, values);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLuint QOpenGLExtraFunctions::glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLuint result = d->GetUniformBlockIndex(program, uniformBlockName);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint* uniformIndices)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetUniformuiv(GLuint program, GLint location, GLuint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetUniformuiv(program, location, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetVertexAttribIiv(index, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetVertexAttribIuiv(index, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->InvalidateFramebuffer(target, numAttachments, attachments);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->InvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsQuery(GLuint id)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->IsQuery(id);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsSampler(GLuint sampler)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->IsSampler(sampler);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsSync(GLsync sync)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->IsSync(sync);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsTransformFeedback(GLuint id)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->IsTransformFeedback(id);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsVertexArray(GLuint array)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->IsVertexArray(array);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void * QOpenGLExtraFunctions::glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ void *result = d->MapBufferRange(target, offset, length, access);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glPauseTransformFeedback()
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->PauseTransformFeedback();
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramBinary(program, binaryFormat, binary, length);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramParameteri(GLuint program, GLenum pname, GLint value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramParameteri(program, pname, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glReadBuffer(GLenum src)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ReadBuffer(src);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->RenderbufferStorageMultisample(target, samples, internalformat, width, height);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glResumeTransformFeedback()
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ResumeTransformFeedback();
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->SamplerParameterf(sampler, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->SamplerParameterfv(sampler, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->SamplerParameteri(sampler, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->SamplerParameteriv(sampler, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->TexStorage2D(target, levels, internalformat, width, height);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->TexStorage3D(target, levels, internalformat, width, height, depth);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->TransformFeedbackVaryings(program, count, varyings, bufferMode);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform1ui(GLint location, GLuint v0)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform1ui(location, v0);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform1uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform1uiv(location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform2ui(GLint location, GLuint v0, GLuint v1)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform2ui(location, v0, v1);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform2uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform2uiv(location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform3ui(location, v0, v1, v2);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform3uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform3uiv(location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform4ui(location, v0, v1, v2, v3);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniform4uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->Uniform4uiv(location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformMatrix2x3fv(location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformMatrix2x4fv(location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformMatrix3x2fv(location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformMatrix3x4fv(location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformMatrix4x2fv(location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UniformMatrix4x3fv(location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLboolean QOpenGLExtraFunctions::glUnmapBuffer(GLenum target)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->UnmapBuffer(target);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribDivisor(GLuint index, GLuint divisor)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribDivisor(index, divisor);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribI4i(index, x, y, z, w);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribI4iv(GLuint index, const GLint * v)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribI4iv(index, v);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribI4ui(index, x, y, z, w);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribI4uiv(GLuint index, const GLuint * v)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribI4uiv(index, v);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribIPointer(index, size, type, stride, pointer);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->WaitSync(sync, flags, timeout);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glActiveShaderProgram(GLuint pipeline, GLuint program)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ActiveShaderProgram(pipeline, program);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindImageTexture(unit, texture, level, layered, layer, access, format);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindProgramPipeline(GLuint pipeline)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindProgramPipeline(pipeline);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->BindVertexBuffer(bindingindex, buffer, offset, stride);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLuint QOpenGLExtraFunctions::glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const* strings)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLuint result = d->CreateShaderProgramv(type, count, strings);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glDeleteProgramPipelines(GLsizei n, const GLuint * pipelines)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DeleteProgramPipelines(n, pipelines);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DispatchCompute(num_groups_x, num_groups_y, num_groups_z);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDispatchComputeIndirect(GLintptr indirect)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DispatchComputeIndirect(indirect);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawArraysIndirect(GLenum mode, const void * indirect)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DrawArraysIndirect(mode, indirect);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->DrawElementsIndirect(mode, type, indirect);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glFramebufferParameteri(GLenum target, GLenum pname, GLint param)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->FramebufferParameteri(target, pname, param);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGenProgramPipelines(GLsizei n, GLuint* pipelines)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GenProgramPipelines(n, pipelines);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetBooleani_v(GLenum target, GLuint index, GLboolean* data)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetBooleani_v(target, index, data);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetFramebufferParameteriv(target, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetMultisamplefv(pname, index, val);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetProgramInterfaceiv(program, programInterface, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetProgramPipelineiv(pipeline, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLuint QOpenGLExtraFunctions::glGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLuint result = d->GetProgramResourceIndex(program, programInterface, name);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline GLint QOpenGLExtraFunctions::glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLint result = d->GetProgramResourceLocation(program, programInterface, name);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar* name)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetProgramResourceName(program, programInterface, index, bufSize, length, name);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei* length, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetTexLevelParameterfv(target, level, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->GetTexLevelParameteriv(target, level, pname, params);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline GLboolean QOpenGLExtraFunctions::glIsProgramPipeline(GLuint pipeline)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ GLboolean result = d->IsProgramPipeline(pipeline);
+ Q_OPENGL_FUNCTIONS_DEBUG
+ return result;
+}
+
+inline void QOpenGLExtraFunctions::glMemoryBarrier(GLbitfield barriers)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->MemoryBarrierFunc(barriers);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glMemoryBarrierByRegion(GLbitfield barriers)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->MemoryBarrierByRegion(barriers);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform1f(GLuint program, GLint location, GLfloat v0)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform1f(program, location, v0);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform1fv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform1i(GLuint program, GLint location, GLint v0)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform1i(program, location, v0);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform1iv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform1ui(GLuint program, GLint location, GLuint v0)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform1ui(program, location, v0);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform1uiv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform2f(program, location, v0, v1);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform2fv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform2i(program, location, v0, v1);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform2iv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform2ui(program, location, v0, v1);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform2uiv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform3f(program, location, v0, v1, v2);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform3fv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform3i(program, location, v0, v1, v2);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform3iv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform3ui(program, location, v0, v1, v2);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform3uiv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform4f(program, location, v0, v1, v2, v3);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform4fv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform4i(program, location, v0, v1, v2, v3);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform4iv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform4ui(program, location, v0, v1, v2, v3);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniform4uiv(program, location, count, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix2fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix2x3fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix2x4fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix3fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix3x2fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix3x4fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix4fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix4x2fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ProgramUniformMatrix4x3fv(program, location, count, transpose, value);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glSampleMaski(GLuint maskNumber, GLbitfield mask)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->SampleMaski(maskNumber, mask);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->TexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->UseProgramStages(pipeline, stages, program);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glValidateProgramPipeline(GLuint pipeline)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->ValidateProgramPipeline(pipeline);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribBinding(attribindex, bindingindex);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribFormat(attribindex, size, type, normalized, relativeoffset);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexAttribIFormat(attribindex, size, type, relativeoffset);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+inline void QOpenGLExtraFunctions::glVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
+{
+ Q_D(QOpenGLExtraFunctions);
+ Q_ASSERT(QOpenGLExtraFunctions::isInitialized(d));
+ d->VertexBindingDivisor(bindingindex, divisor);
+ Q_OPENGL_FUNCTIONS_DEBUG
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_OPENGL
+
+#endif
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 1cf748d15f..5184283a31 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -167,7 +167,7 @@ void QOpenGLFramebufferObjectFormat::detach()
the format of an OpenGL framebuffer object.
By default the format specifies a non-multisample framebuffer object with no
- attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
+ depth/stencil attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
On OpenGL/ES systems, the default internal format is \c GL_RGBA.
\sa samples(), attachment(), internalTextureFormat()
@@ -437,10 +437,10 @@ namespace
}
}
-void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSize &sz,
- QOpenGLFramebufferObject::Attachment attachment,
- GLenum texture_target, GLenum internal_format,
- GLint samples, bool mipmap)
+void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSize &size,
+ QOpenGLFramebufferObject::Attachment attachment,
+ GLenum texture_target, GLenum internal_format,
+ GLint samples, bool mipmap)
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
@@ -459,9 +459,13 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
samples = qBound(0, int(samples), int(maxSamples));
}
+ colorAttachments.append(ColorAttachment(size, internal_format));
+
+ dsSize = size;
+
samples = qMax(0, samples);
requestedSamples = samples;
- size = sz;
+
target = texture_target;
QT_RESET_GLERROR(); // reset error state
@@ -472,64 +476,30 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true;
- GLuint color_buffer = 0;
-
QT_CHECK_GLERROR();
- // init texture
- if (samples == 0) {
- initTexture(texture_target, internal_format, size, mipmap);
- } else {
- GLenum storageFormat = internal_format;
- // ES requires a sized format. The older desktop extension does not. Correct the format on ES.
- if (ctx->isOpenGLES() && internal_format == GL_RGBA) {
- if (funcs.hasOpenGLExtension(QOpenGLExtensions::Sized8Formats))
- storageFormat = GL_RGBA8;
- else
- storageFormat = GL_RGBA4;
- }
-
- mipmap = false;
- funcs.glGenRenderbuffers(1, &color_buffer);
- funcs.glBindRenderbuffer(GL_RENDERBUFFER, color_buffer);
- funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storageFormat, size.width(), size.height());
- funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_RENDERBUFFER, color_buffer);
- QT_CHECK_GLERROR();
- valid = checkFramebufferStatus(ctx);
-
- if (valid) {
- // Query the actual number of samples. This can be greater than the requested
- // value since the typically supported values are 0, 4, 8, ..., and the
- // requests are mapped to the next supported value.
- funcs.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &samples);
- color_buffer_guard = new QOpenGLSharedResourceGuard(ctx, color_buffer, freeRenderbufferFunc);
- }
- }
format.setTextureTarget(target);
- format.setSamples(int(samples));
format.setInternalTextureFormat(internal_format);
format.setMipmap(mipmap);
- initAttachments(ctx, attachment);
+ if (samples == 0)
+ initTexture(0);
+ else
+ initColorBuffer(0, &samples);
+
+ format.setSamples(int(samples));
- if (valid) {
+ initDepthStencilAttachments(ctx, attachment);
+
+ if (valid)
fbo_guard = new QOpenGLSharedResourceGuard(ctx, fbo, freeFramebufferFunc);
- } else {
- if (color_buffer_guard) {
- color_buffer_guard->free();
- color_buffer_guard = 0;
- } else if (texture_guard) {
- texture_guard->free();
- texture_guard = 0;
- }
+ else
funcs.glDeleteFramebuffers(1, &fbo);
- }
+
QT_CHECK_GLERROR();
}
-void QOpenGLFramebufferObjectPrivate::initTexture(GLenum target, GLenum internal_format,
- const QSize &size, bool mipmap)
+void QOpenGLFramebufferObjectPrivate::initTexture(int idx)
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
GLuint texture = 0;
@@ -542,37 +512,76 @@ void QOpenGLFramebufferObjectPrivate::initTexture(GLenum target, GLenum internal
funcs.glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
funcs.glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ ColorAttachment &color(colorAttachments[idx]);
+
GLuint pixelType = GL_UNSIGNED_BYTE;
- if (internal_format == GL_RGB10_A2 || internal_format == GL_RGB10)
+ if (color.internalFormat == GL_RGB10_A2 || color.internalFormat == GL_RGB10)
pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
- funcs.glTexImage2D(target, 0, internal_format, size.width(), size.height(), 0,
+ funcs.glTexImage2D(target, 0, color.internalFormat, color.size.width(), color.size.height(), 0,
GL_RGBA, pixelType, NULL);
- if (mipmap) {
- int width = size.width();
- int height = size.height();
+ if (format.mipmap()) {
+ int width = color.size.width();
+ int height = color.size.height();
int level = 0;
while (width > 1 || height > 1) {
width = qMax(1, width >> 1);
height = qMax(1, height >> 1);
++level;
- funcs.glTexImage2D(target, level, internal_format, width, height, 0,
+ funcs.glTexImage2D(target, level, color.internalFormat, width, height, 0,
GL_RGBA, pixelType, NULL);
}
}
- funcs.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ funcs.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + idx,
target, texture, 0);
QT_CHECK_GLERROR();
funcs.glBindTexture(target, 0);
valid = checkFramebufferStatus(ctx);
- if (valid)
- texture_guard = new QOpenGLSharedResourceGuard(ctx, texture, freeTextureFunc);
- else
+ if (valid) {
+ color.guard = new QOpenGLSharedResourceGuard(ctx, texture, freeTextureFunc);
+ } else {
funcs.glDeleteTextures(1, &texture);
+ }
+}
+
+void QOpenGLFramebufferObjectPrivate::initColorBuffer(int idx, GLint *samples)
+{
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ GLuint color_buffer = 0;
+
+ ColorAttachment &color(colorAttachments[idx]);
+
+ GLenum storageFormat = color.internalFormat;
+ // ES requires a sized format. The older desktop extension does not. Correct the format on ES.
+ if (ctx->isOpenGLES() && color.internalFormat == GL_RGBA) {
+ if (funcs.hasOpenGLExtension(QOpenGLExtensions::Sized8Formats))
+ storageFormat = GL_RGBA8;
+ else
+ storageFormat = GL_RGBA4;
+ }
+
+ funcs.glGenRenderbuffers(1, &color_buffer);
+ funcs.glBindRenderbuffer(GL_RENDERBUFFER, color_buffer);
+ funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, *samples, storageFormat, color.size.width(), color.size.height());
+ funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + idx,
+ GL_RENDERBUFFER, color_buffer);
+
+ QT_CHECK_GLERROR();
+ valid = checkFramebufferStatus(ctx);
+ if (valid) {
+ // Query the actual number of samples. This can be greater than the requested
+ // value since the typically supported values are 0, 4, 8, ..., and the
+ // requests are mapped to the next supported value.
+ funcs.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, samples);
+ color.guard = new QOpenGLSharedResourceGuard(ctx, color_buffer, freeRenderbufferFunc);
+ } else {
+ funcs.glDeleteRenderbuffers(1, &color_buffer);
+ }
}
-void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpenGLFramebufferObject::Attachment attachment)
+void QOpenGLFramebufferObjectPrivate::initDepthStencilAttachments(QOpenGLContext *ctx,
+ QOpenGLFramebufferObject::Attachment attachment)
{
// Use the same sample count for all attachments. format.samples() already contains
// the actual number of samples for the color attachment and is not suitable. Use
@@ -609,10 +618,10 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
Q_ASSERT(funcs.glIsRenderbuffer(depth_buffer));
if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample))
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
- GL_DEPTH24_STENCIL8, size.width(), size.height());
+ GL_DEPTH24_STENCIL8, dsSize.width(), dsSize.height());
else
funcs.glRenderbufferStorage(GL_RENDERBUFFER,
- GL_DEPTH24_STENCIL8, size.width(), size.height());
+ GL_DEPTH24_STENCIL8, dsSize.width(), dsSize.height());
stencil_buffer = depth_buffer;
funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
@@ -637,25 +646,25 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
if (ctx->isOpenGLES()) {
if (funcs.hasOpenGLExtension(QOpenGLExtensions::Depth24))
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
- GL_DEPTH_COMPONENT24, size.width(), size.height());
+ GL_DEPTH_COMPONENT24, dsSize.width(), dsSize.height());
else
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
- GL_DEPTH_COMPONENT16, size.width(), size.height());
+ GL_DEPTH_COMPONENT16, dsSize.width(), dsSize.height());
} else {
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
- GL_DEPTH_COMPONENT, size.width(), size.height());
+ GL_DEPTH_COMPONENT, dsSize.width(), dsSize.height());
}
} else {
if (ctx->isOpenGLES()) {
if (funcs.hasOpenGLExtension(QOpenGLExtensions::Depth24)) {
funcs.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24,
- size.width(), size.height());
+ dsSize.width(), dsSize.height());
} else {
funcs.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16,
- size.width(), size.height());
+ dsSize.width(), dsSize.height());
}
} else {
- funcs.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, size.width(), size.height());
+ funcs.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, dsSize.width(), dsSize.height());
}
}
funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
@@ -679,9 +688,9 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
#endif
if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample))
- funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storage, size.width(), size.height());
+ funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storage, dsSize.width(), dsSize.height());
else
- funcs.glRenderbufferStorage(GL_RENDERBUFFER, storage, size.width(), size.height());
+ funcs.glRenderbufferStorage(GL_RENDERBUFFER, storage, dsSize.width(), dsSize.height());
funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GL_RENDERBUFFER, stencil_buffer);
@@ -757,6 +766,11 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
format, and will be bound to the \c GL_COLOR_ATTACHMENT0
attachment in the framebuffer object.
+ Multiple render targets are also supported, in case the OpenGL
+ implementation supports this. Here there will be multiple textures (or, in
+ case of multisampling, renderbuffers) present and each of them will get
+ attached to \c GL_COLOR_ATTACHMENT0, \c 1, \c 2, ...
+
If you want to use a framebuffer object with multisampling enabled
as a texture, you first need to copy from it to a regular framebuffer
object using QOpenGLContext::blitFramebuffer().
@@ -786,6 +800,16 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
\sa attachment()
*/
+static inline GLenum effectiveInternalFormat(GLenum internalFormat)
+{
+ if (!internalFormat)
+#ifdef QT_OPENGL_ES_2
+ internalFormat = GL_RGBA;
+#else
+ internalFormat = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
+#endif
+ return internalFormat;
+}
/*! \fn QOpenGLFramebufferObject::QOpenGLFramebufferObject(const QSize &size, GLenum target)
@@ -815,13 +839,7 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(const QSize &size, GLenum tar
: d_ptr(new QOpenGLFramebufferObjectPrivate)
{
Q_D(QOpenGLFramebufferObject);
- d->init(this, size, NoAttachment, target,
-#ifndef QT_OPENGL_ES_2
- QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8
-#else
- GL_RGBA
-#endif
- );
+ d->init(this, size, NoAttachment, target, effectiveInternalFormat(0));
}
/*! \overload
@@ -835,13 +853,7 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(int width, int height, GLenum
: d_ptr(new QOpenGLFramebufferObjectPrivate)
{
Q_D(QOpenGLFramebufferObject);
- d->init(this, QSize(width, height), NoAttachment, target,
-#ifndef QT_OPENGL_ES_2
- QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8
-#else
- GL_RGBA
-#endif
- );
+ d->init(this, QSize(width, height), NoAttachment, target, effectiveInternalFormat(0));
}
/*! \overload
@@ -878,7 +890,7 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(int width, int height, const
buffer of the given \a width and \a height.
The \a attachment parameter describes the depth/stencil buffer
- configuration, \a target the texture target and \a internal_format
+ configuration, \a target the texture target and \a internalFormat
the internal texture format. The default texture target is \c
GL_TEXTURE_2D, while the default internal format is \c GL_RGBA8
for desktop OpenGL and \c GL_RGBA for OpenGL/ES.
@@ -886,17 +898,11 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(int width, int height, const
\sa size(), texture(), attachment()
*/
QOpenGLFramebufferObject::QOpenGLFramebufferObject(int width, int height, Attachment attachment,
- GLenum target, GLenum internal_format)
+ GLenum target, GLenum internalFormat)
: d_ptr(new QOpenGLFramebufferObjectPrivate)
{
Q_D(QOpenGLFramebufferObject);
- if (!internal_format)
-#ifdef QT_OPENGL_ES_2
- internal_format = GL_RGBA;
-#else
- internal_format = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
-#endif
- d->init(this, QSize(width, height), attachment, target, internal_format);
+ d->init(this, QSize(width, height), attachment, target, effectiveInternalFormat(internalFormat));
}
/*! \overload
@@ -905,7 +911,7 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(int width, int height, Attach
buffer of the given \a size.
The \a attachment parameter describes the depth/stencil buffer
- configuration, \a target the texture target and \a internal_format
+ configuration, \a target the texture target and \a internalFormat
the internal texture format. The default texture target is \c
GL_TEXTURE_2D, while the default internal format is \c GL_RGBA8
for desktop OpenGL and \c GL_RGBA for OpenGL/ES.
@@ -913,17 +919,11 @@ QOpenGLFramebufferObject::QOpenGLFramebufferObject(int width, int height, Attach
\sa size(), texture(), attachment()
*/
QOpenGLFramebufferObject::QOpenGLFramebufferObject(const QSize &size, Attachment attachment,
- GLenum target, GLenum internal_format)
+ GLenum target, GLenum internalFormat)
: d_ptr(new QOpenGLFramebufferObjectPrivate)
{
Q_D(QOpenGLFramebufferObject);
- if (!internal_format)
-#ifdef QT_OPENGL_ES_2
- internal_format = GL_RGBA;
-#else
- internal_format = QOpenGLContext::currentContext()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
-#endif
- d->init(this, size, attachment, target, internal_format);
+ d->init(this, size, attachment, target, effectiveInternalFormat(internalFormat));
}
/*!
@@ -937,10 +937,12 @@ QOpenGLFramebufferObject::~QOpenGLFramebufferObject()
if (isBound())
release();
- if (d->texture_guard)
- d->texture_guard->free();
- if (d->color_buffer_guard)
- d->color_buffer_guard->free();
+ foreach (const QOpenGLFramebufferObjectPrivate::ColorAttachment &color, d->colorAttachments) {
+ if (color.guard)
+ color.guard->free();
+ }
+ d->colorAttachments.clear();
+
if (d->depth_buffer_guard)
d->depth_buffer_guard->free();
if (d->stencil_buffer_guard && d->stencil_buffer_guard != d->depth_buffer_guard)
@@ -950,6 +952,70 @@ QOpenGLFramebufferObject::~QOpenGLFramebufferObject()
}
/*!
+ Creates and attaches an additional texture or renderbuffer of \a size width
+ and height.
+
+ There is always an attachment at GL_COLOR_ATTACHMENT0. Call this function
+ to set up additional attachments at GL_COLOR_ATTACHMENT1,
+ GL_COLOR_ATTACHMENT2, ...
+
+ When \a internalFormat is not \c 0, it specifies the internal format of the
+ texture or renderbuffer. Otherwise a default of GL_RGBA or GL_RGBA8 is
+ used.
+
+ \note This is only functional when multiple render targets are supported by
+ the OpenGL implementation. When that is not the case, the function will not
+ add any additional color attachments. Call
+ QOpenGLFunctions::hasOpenGLFeature() with
+ QOpenGLFunctions::MultipleRenderTargets at runtime to check if MRT is
+ supported.
+
+ \note The internal format of the color attachments may differ but there may
+ be limitations on the supported combinations, depending on the drivers.
+
+ \note The size of the color attachments may differ but rendering is limited
+ to the area that fits all the attachments, according to the OpenGL
+ specification. Some drivers may not be fully conformant in this respect,
+ however.
+
+ \since 5.6
+ */
+void QOpenGLFramebufferObject::addColorAttachment(const QSize &size, GLenum internalFormat)
+{
+ Q_D(QOpenGLFramebufferObject);
+
+ if (!QOpenGLContext::currentContext()->functions()->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) {
+ qWarning("Multiple render targets not supported, ignoring extra color attachment request");
+ return;
+ }
+
+ QOpenGLFramebufferObjectPrivate::ColorAttachment color(size, effectiveInternalFormat(internalFormat));
+ d->colorAttachments.append(color);
+ const int idx = d->colorAttachments.count() - 1;
+
+ if (d->requestedSamples == 0) {
+ d->initTexture(idx);
+ } else {
+ GLint samples = d->requestedSamples;
+ d->initColorBuffer(idx, &samples);
+ }
+}
+
+/*! \overload
+
+ Creates and attaches an additional texture or renderbuffer of size \a width and \a height.
+
+ When \a internalFormat is not \c 0, it specifies the internal format of the texture or
+ renderbuffer. Otherwise a default of GL_RGBA or GL_RGBA8 is used.
+
+ \since 5.6
+ */
+void QOpenGLFramebufferObject::addColorAttachment(int width, int height, GLenum internalFormat)
+{
+ addColorAttachment(QSize(width, height), internalFormat);
+}
+
+/*!
\fn bool QOpenGLFramebufferObject::isValid() const
Returns \c true if the framebuffer object is valid.
@@ -1003,10 +1069,14 @@ bool QOpenGLFramebufferObject::bind()
QOpenGLContextPrivate::get(current)->qgl_current_fbo_invalid = true;
- if (d->texture_guard || d->format.samples() != 0)
- d->valid = d->checkFramebufferStatus(current);
- else
- d->initTexture(d->format.textureTarget(), d->format.internalTextureFormat(), d->size, d->format.mipmap());
+ if (d->format.samples() == 0) {
+ // Create new textures to replace the ones stolen via takeTexture().
+ for (int i = 0; i < d->colorAttachments.count(); ++i) {
+ if (!d->colorAttachments[i].guard)
+ d->initTexture(i);
+ }
+ }
+
return d->valid;
}
@@ -1053,12 +1123,36 @@ bool QOpenGLFramebufferObject::release()
If a multisample framebuffer object is used then the value returned
from this function will be invalid.
- \sa takeTexture()
+ When multiple textures are attached, the return value is the ID of
+ the first one.
+
+ \sa takeTexture(), textures()
*/
GLuint QOpenGLFramebufferObject::texture() const
{
Q_D(const QOpenGLFramebufferObject);
- return d->texture_guard ? d->texture_guard->id() : 0;
+ return d->colorAttachments[0].guard ? d->colorAttachments[0].guard->id() : 0;
+}
+
+/*!
+ Returns the texture id for all attached textures.
+
+ If a multisample framebuffer object is used, then an empty vector is returned.
+
+ \since 5.6
+
+ \sa takeTexture(), texture()
+*/
+QVector<GLuint> QOpenGLFramebufferObject::textures() const
+{
+ Q_D(const QOpenGLFramebufferObject);
+ QVector<GLuint> ids;
+ if (d->format.samples() != 0)
+ return ids;
+ ids.reserve(d->colorAttachments.count());
+ foreach (const QOpenGLFramebufferObjectPrivate::ColorAttachment &color, d->colorAttachments)
+ ids.append(color.guard ? color.guard->id() : 0);
+ return ids;
}
/*!
@@ -1081,30 +1175,68 @@ GLuint QOpenGLFramebufferObject::texture() const
*/
GLuint QOpenGLFramebufferObject::takeTexture()
{
+ return takeTexture(0);
+}
+
+/*! \overload
+
+ Returns the texture id for the texture attached to the color attachment of
+ index \a colorAttachmentIndex of this framebuffer object. The ownership of
+ the texture is transferred to the caller.
+
+ When \a colorAttachmentIndex is \c 0, the behavior is identical to the
+ parameter-less variant of this function.
+
+ If the framebuffer object is currently bound, an implicit release()
+ will be done. During the next call to bind() a new texture will be
+ created.
+
+ If a multisample framebuffer object is used, then there is no
+ texture and the return value from this function will be invalid.
+ Similarly, incomplete framebuffer objects will also return 0.
+
+ \since 5.6
+ */
+GLuint QOpenGLFramebufferObject::takeTexture(int colorAttachmentIndex)
+{
Q_D(QOpenGLFramebufferObject);
GLuint id = 0;
- if (isValid() && d->texture_guard) {
+ if (isValid() && d->format.samples() == 0 && d->colorAttachments.count() > colorAttachmentIndex) {
QOpenGLContext *current = QOpenGLContext::currentContext();
if (current && current->shareGroup() == d->fbo_guard->group() && isBound())
release();
- id = d->texture_guard->id();
+ id = d->colorAttachments[colorAttachmentIndex].guard ? d->colorAttachments[colorAttachmentIndex].guard->id() : 0;
// Do not call free() on texture_guard, just null it out.
// This way the texture will not be deleted when the guard is destroyed.
- d->texture_guard = 0;
+ d->colorAttachments[colorAttachmentIndex].guard = 0;
}
return id;
}
/*!
- \fn QSize QOpenGLFramebufferObject::size() const
+ \return the size of the color and depth/stencil attachments attached to
+ this framebuffer object.
+*/
+QSize QOpenGLFramebufferObject::size() const
+{
+ Q_D(const QOpenGLFramebufferObject);
+ return d->dsSize;
+}
- Returns the size of the texture attached to this framebuffer
+/*!
+ \return the sizes of all color attachments attached to this framebuffer
object.
+
+ \since 5.6
*/
-QSize QOpenGLFramebufferObject::size() const
+QVector<QSize> QOpenGLFramebufferObject::sizes() const
{
Q_D(const QOpenGLFramebufferObject);
- return d->size;
+ QVector<QSize> sz;
+ sz.reserve(d->colorAttachments.size());
+ foreach (const QOpenGLFramebufferObjectPrivate::ColorAttachment &color, d->colorAttachments)
+ sz.append(color.size);
+ return sz;
}
/*!
@@ -1243,6 +1375,37 @@ Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format,
QImage QOpenGLFramebufferObject::toImage(bool flipped) const
{
+ return toImage(flipped, 0);
+}
+
+/*!
+ \fn QImage QOpenGLFramebufferObject::toImage() const
+ \overload
+
+ Returns the contents of this framebuffer object as a QImage. This method flips
+ the image from OpenGL coordinates to raster coordinates.
+*/
+// ### Qt 6: Remove this method and make it a default argument instead.
+QImage QOpenGLFramebufferObject::toImage() const
+{
+ return toImage(true, 0);
+}
+
+/*! \overload
+
+ Returns the contents of the color attachment of index \a
+ colorAttachmentIndex of this framebuffer object as a QImage. This method
+ flips the image from OpenGL coordinates to raster coordinates when \a
+ flipped is set to \c true.
+
+ \note This overload is only fully functional when multiple render targets are
+ supported by the OpenGL implementation. When that is not the case, only one
+ color attachment will be set up.
+
+ \since 5.6
+*/
+QImage QOpenGLFramebufferObject::toImage(bool flipped, int colorAttachmentIndex) const
+{
Q_D(const QOpenGLFramebufferObject);
if (!d->valid)
return QImage();
@@ -1253,6 +1416,11 @@ QImage QOpenGLFramebufferObject::toImage(bool flipped) const
return QImage();
}
+ if (d->colorAttachments.count() <= colorAttachmentIndex) {
+ qWarning("QOpenGLFramebufferObject::toImage() called for missing color attachment");
+ return QImage();
+ }
+
GLuint prevFbo = 0;
ctx->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &prevFbo);
@@ -1260,16 +1428,33 @@ QImage QOpenGLFramebufferObject::toImage(bool flipped) const
const_cast<QOpenGLFramebufferObject *>(this)->bind();
QImage image;
+ QOpenGLExtraFunctions *extraFuncs = ctx->extraFunctions();
// qt_gl_read_framebuffer doesn't work on a multisample FBO
if (format().samples() != 0) {
- QOpenGLFramebufferObject temp(size(), QOpenGLFramebufferObjectFormat());
-
QRect rect(QPoint(0, 0), size());
- blitFramebuffer(&temp, rect, const_cast<QOpenGLFramebufferObject *>(this), rect);
-
- image = temp.toImage(flipped);
+ if (extraFuncs->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) {
+ QOpenGLFramebufferObject temp(d->colorAttachments[colorAttachmentIndex].size, QOpenGLFramebufferObjectFormat());
+ blitFramebuffer(&temp, rect, const_cast<QOpenGLFramebufferObject *>(this), rect,
+ GL_COLOR_BUFFER_BIT, GL_NEAREST,
+ colorAttachmentIndex, 0);
+ image = temp.toImage(flipped);
+ } else {
+ QOpenGLFramebufferObject temp(size(), QOpenGLFramebufferObjectFormat());
+ blitFramebuffer(&temp, rect, const_cast<QOpenGLFramebufferObject *>(this), rect);
+ image = temp.toImage(flipped);
+ }
} else {
- image = qt_gl_read_framebuffer(d->size, format().internalTextureFormat(), true, flipped);
+ if (extraFuncs->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) {
+ extraFuncs->glReadBuffer(GL_COLOR_ATTACHMENT0 + colorAttachmentIndex);
+ image = qt_gl_read_framebuffer(d->colorAttachments[colorAttachmentIndex].size,
+ d->colorAttachments[colorAttachmentIndex].internalFormat,
+ true, flipped);
+ extraFuncs->glReadBuffer(GL_COLOR_ATTACHMENT0);
+ } else {
+ image = qt_gl_read_framebuffer(d->colorAttachments[0].size,
+ d->colorAttachments[0].internalFormat,
+ true, flipped);
+ }
}
if (prevFbo != d->fbo())
@@ -1279,19 +1464,6 @@ QImage QOpenGLFramebufferObject::toImage(bool flipped) const
}
/*!
- \fn QImage QOpenGLFramebufferObject::toImage() const
- \overload
-
- Returns the contents of this framebuffer object as a QImage. This method flips
- the image from OpenGL coordinates to raster coordinates.
-*/
-// ### Qt 6: Remove this method and make it a default argument instead.
-QImage QOpenGLFramebufferObject::toImage() const
-{
- return toImage(true);
-}
-
-/*!
\fn bool QOpenGLFramebufferObject::bindDefault()
Switches rendering back to the default, windowing system provided
@@ -1377,7 +1549,7 @@ void QOpenGLFramebufferObject::setAttachment(QOpenGLFramebufferObject::Attachmen
#endif
d->funcs.glBindFramebuffer(GL_FRAMEBUFFER, d->fbo());
QOpenGLContextPrivate::get(current)->qgl_current_fbo_invalid = true;
- d->initAttachments(current, attachment);
+ d->initDepthStencilAttachments(current, attachment);
}
/*!
@@ -1439,6 +1611,18 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target,
buffers, filter);
}
+/*! \overload
+ *
+ Convenience overload to blit between two framebuffer objects.
+*/
+void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect,
+ QOpenGLFramebufferObject *source, const QRect &sourceRect,
+ GLbitfield buffers,
+ GLenum filter)
+{
+ blitFramebuffer(target, targetRect, source, sourceRect, buffers, filter, 0, 0);
+}
+
/*!
Blits from the \a sourceRect rectangle in the \a source framebuffer
object to the \a targetRect rectangle in the \a target framebuffer object.
@@ -1467,12 +1651,18 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target,
\note The scissor test will restrict the blit area if enabled.
+ When multiple render targets are in use, \a readColorAttachmentIndex and \a
+ drawColorAttachmentIndex specify the index of the color attachments in the
+ source and destination framebuffers.
+
\sa hasOpenGLFramebufferBlit()
*/
void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect,
- QOpenGLFramebufferObject *source, const QRect &sourceRect,
- GLbitfield buffers,
- GLenum filter)
+ QOpenGLFramebufferObject *source, const QRect &sourceRect,
+ GLbitfield buffers,
+ GLenum filter,
+ int readColorAttachmentIndex,
+ int drawColorAttachmentIndex)
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (!ctx)
@@ -1500,10 +1690,21 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target,
extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, source ? source->handle() : defaultFboId);
extensions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target ? target->handle() : defaultFboId);
+ if (extensions.hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) {
+ extensions.glReadBuffer(GL_COLOR_ATTACHMENT0 + readColorAttachmentIndex);
+ if (target) {
+ GLenum drawBuf = GL_COLOR_ATTACHMENT0 + drawColorAttachmentIndex;
+ extensions.glDrawBuffers(1, &drawBuf);
+ }
+ }
+
extensions.glBlitFramebuffer(sx0, sy0, sx1, sy1,
tx0, ty0, tx1, ty1,
buffers, filter);
+ if (extensions.hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets))
+ extensions.glReadBuffer(GL_COLOR_ATTACHMENT0);
+
ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, prevFbo); // sets both READ and DRAW
}
diff --git a/src/gui/opengl/qopenglframebufferobject.h b/src/gui/opengl/qopenglframebufferobject.h
index 4ce0ee26cb..cead4ad10f 100644
--- a/src/gui/opengl/qopenglframebufferobject.h
+++ b/src/gui/opengl/qopenglframebufferobject.h
@@ -63,15 +63,18 @@ public:
QOpenGLFramebufferObject(int width, int height, GLenum target = GL_TEXTURE_2D);
QOpenGLFramebufferObject(const QSize &size, Attachment attachment,
- GLenum target = GL_TEXTURE_2D, GLenum internal_format = 0);
+ GLenum target = GL_TEXTURE_2D, GLenum internalFormat = 0);
QOpenGLFramebufferObject(int width, int height, Attachment attachment,
- GLenum target = GL_TEXTURE_2D, GLenum internal_format = 0);
+ GLenum target = GL_TEXTURE_2D, GLenum internalFormat = 0);
QOpenGLFramebufferObject(const QSize &size, const QOpenGLFramebufferObjectFormat &format);
QOpenGLFramebufferObject(int width, int height, const QOpenGLFramebufferObjectFormat &format);
virtual ~QOpenGLFramebufferObject();
+ void addColorAttachment(const QSize &size, GLenum internalFormat = 0);
+ void addColorAttachment(int width, int height, GLenum internalFormat = 0);
+
QOpenGLFramebufferObjectFormat format() const;
bool isValid() const;
@@ -83,12 +86,19 @@ public:
int height() const { return size().height(); }
GLuint texture() const;
+ QVector<GLuint> textures() const;
+
GLuint takeTexture();
+ GLuint takeTexture(int colorAttachmentIndex);
+
QSize size() const;
+ QVector<QSize> sizes() const;
+
QImage toImage() const;
QImage toImage(bool flipped) const;
- Attachment attachment() const;
+ QImage toImage(bool flipped, int colorAttachmentIndex) const;
+ Attachment attachment() const;
void setAttachment(Attachment attachment);
GLuint handle() const;
@@ -100,6 +110,12 @@ public:
static bool hasOpenGLFramebufferBlit();
static void blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect,
QOpenGLFramebufferObject *source, const QRect &sourceRect,
+ GLbitfield buffers,
+ GLenum filter,
+ int readColorAttachmentIndex,
+ int drawColorAttachmentIndex);
+ static void blitFramebuffer(QOpenGLFramebufferObject *target, const QRect &targetRect,
+ QOpenGLFramebufferObject *source, const QRect &sourceRect,
GLbitfield buffers = GL_COLOR_BUFFER_BIT,
GLenum filter = GL_NEAREST);
static void blitFramebuffer(QOpenGLFramebufferObject *target,
diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/gui/opengl/qopenglframebufferobject_p.h
index 7f0068dfc4..6c45fda57f 100644
--- a/src/gui/opengl/qopenglframebufferobject_p.h
+++ b/src/gui/opengl/qopenglframebufferobject_p.h
@@ -102,32 +102,41 @@ public:
class QOpenGLFramebufferObjectPrivate
{
public:
- QOpenGLFramebufferObjectPrivate() : fbo_guard(0), texture_guard(0), depth_buffer_guard(0)
- , stencil_buffer_guard(0), color_buffer_guard(0)
+ QOpenGLFramebufferObjectPrivate() : fbo_guard(0), depth_buffer_guard(0)
+ , stencil_buffer_guard(0)
, valid(false) {}
~QOpenGLFramebufferObjectPrivate() {}
- void init(QOpenGLFramebufferObject *q, const QSize& sz,
+ void init(QOpenGLFramebufferObject *q, const QSize &size,
QOpenGLFramebufferObject::Attachment attachment,
- GLenum internal_format, GLenum texture_target,
+ GLenum texture_target, GLenum internal_format,
GLint samples = 0, bool mipmap = false);
- void initTexture(GLenum target, GLenum internal_format, const QSize &size, bool mipmap);
- void initAttachments(QOpenGLContext *ctx, QOpenGLFramebufferObject::Attachment attachment);
+ void initTexture(int idx);
+ void initColorBuffer(int idx, GLint *samples);
+ void initDepthStencilAttachments(QOpenGLContext *ctx, QOpenGLFramebufferObject::Attachment attachment);
bool checkFramebufferStatus(QOpenGLContext *ctx) const;
QOpenGLSharedResourceGuard *fbo_guard;
- QOpenGLSharedResourceGuard *texture_guard;
QOpenGLSharedResourceGuard *depth_buffer_guard;
QOpenGLSharedResourceGuard *stencil_buffer_guard;
- QOpenGLSharedResourceGuard *color_buffer_guard;
GLenum target;
- QSize size;
+ QSize dsSize;
QOpenGLFramebufferObjectFormat format;
int requestedSamples;
uint valid : 1;
QOpenGLFramebufferObject::Attachment fbo_attachment;
QOpenGLExtensions funcs;
+ struct ColorAttachment {
+ ColorAttachment() : internalFormat(0), guard(0) { }
+ ColorAttachment(const QSize &size, GLenum internalFormat)
+ : size(size), internalFormat(internalFormat), guard(0) { }
+ QSize size;
+ GLenum internalFormat;
+ QOpenGLSharedResourceGuard *guard;
+ };
+ QVector<ColorAttachment> colorAttachments;
+
inline GLuint fbo() const { return fbo_guard ? fbo_guard->id() : 0; }
};
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 8ddb693e73..be1a979c37 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -32,12 +32,14 @@
****************************************************************************/
#include "qopenglfunctions.h"
+#include "qopenglextrafunctions.h"
#include "qopenglextensions_p.h"
#include "qdebug.h"
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/private/qopengl_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
+#include <QtCore/qloggingcategory.h>
#ifdef Q_OS_IOS
#include <dlfcn.h>
@@ -49,6 +51,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcGLES3, "qt.opengl.es3")
+
/*!
\class QOpenGLFunctions
\brief The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API.
@@ -92,7 +96,7 @@ QT_BEGIN_NAMESPACE
// Setup scene and render it
initializeGL();
- paintGL()
+ paintGL();
}
void MyGLWindow::initializeGL()
@@ -155,6 +159,8 @@ QT_BEGIN_NAMESPACE
QOpenGLFunctions funcs(QOpenGLContext::currentContext());
bool npot = funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
\endcode
+
+ \sa QOpenGLContext, QSurfaceFormat
*/
/*!
@@ -178,6 +184,7 @@ QT_BEGIN_NAMESPACE
\value NPOTTextureRepeat Non power of two textures can use GL_REPEAT as wrap parameter.
\value FixedFunctionPipeline The fixed function pipeline is available.
\value TextureRGFormats The GL_RED and GL_RG texture formats are available.
+ \value MultipleRenderTargets Multiple color attachments to framebuffer objects are available.
*/
// Hidden private fields for additional extension data.
@@ -251,12 +258,11 @@ QOpenGLFunctions::QOpenGLFunctions(QOpenGLContext *context)
}
QOpenGLExtensions::QOpenGLExtensions()
- : QOpenGLFunctions()
{
}
QOpenGLExtensions::QOpenGLExtensions(QOpenGLContext *context)
- : QOpenGLFunctions(context)
+ : QOpenGLExtraFunctions(context)
{
}
@@ -270,7 +276,7 @@ static int qt_gl_resolve_features()
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (ctx->isOpenGLES()) {
- // OpenGL ES 2
+ // OpenGL ES
int features = QOpenGLFunctions::Multitexture |
QOpenGLFunctions::Shaders |
QOpenGLFunctions::Buffers |
@@ -295,6 +301,8 @@ static int qt_gl_resolve_features()
if (!(renderer && strstr(renderer, "Mesa")))
features |= QOpenGLFunctions::TextureRGFormats;
}
+ if (ctx->format().majorVersion() >= 3)
+ features |= QOpenGLFunctions::MultipleRenderTargets;
return features;
} else {
// OpenGL
@@ -303,10 +311,9 @@ static int qt_gl_resolve_features()
QOpenGLExtensionMatcher extensions;
if (format.majorVersion() >= 3)
- features |= QOpenGLFunctions::Framebuffers;
- else if (extensions.match("GL_EXT_framebuffer_object") ||
- extensions.match("GL_ARB_framebuffer_object"))
- features |= QOpenGLFunctions::Framebuffers;
+ features |= QOpenGLFunctions::Framebuffers | QOpenGLFunctions::MultipleRenderTargets;
+ else if (extensions.match("GL_EXT_framebuffer_object") || extensions.match("GL_ARB_framebuffer_object"))
+ features |= QOpenGLFunctions::Framebuffers | QOpenGLFunctions::MultipleRenderTargets;
if (format.majorVersion() >= 2) {
features |= QOpenGLFunctions::BlendColor |
@@ -423,11 +430,14 @@ static int qt_gl_resolve_extensions()
// We don't match GL_APPLE_texture_format_BGRA8888 here because it has different semantics.
if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888"))
extensions |= QOpenGLExtensions::BGRATextureFormat;
-
if (extensionMatcher.match("GL_EXT_discard_framebuffer"))
extensions |= QOpenGLExtensions::DiscardFramebuffer;
+ if (extensionMatcher.match("GL_EXT_texture_norm16"))
+ extensions |= QOpenGLExtensions::Sized16Formats;
} else {
- extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
+ extensions |= QOpenGLExtensions::ElementIndexUint
+ | QOpenGLExtensions::MapBuffer
+ | QOpenGLExtensions::Sized16Formats;
if (format.version() >= qMakePair(1, 2))
extensions |= QOpenGLExtensions::BGRATextureFormat;
@@ -2121,6 +2131,9 @@ public:
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
+ template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11>
+ ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11);
+
private:
FuncType Base::*funcPointerName;
FuncType fallbackFuncPointer;
@@ -2172,6 +2185,9 @@ public:
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
+ template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11>
+ void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11);
+
private:
FuncType Base::*funcPointerName;
FuncType fallbackFuncPointer;
@@ -2421,6 +2437,14 @@ void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4
(funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}
+template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11>
+void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
+{
+ RESOLVER_COMMON_VOID
+
+ (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
+}
+
template <typename ReturnType, int Policy, typename Base, typename FuncType>
Resolver<Base, FuncType, Policy, ReturnType> functionResolverWithFallback(FuncType Base::*func, FuncType fallback, const char *name, const char *alternate = 0)
{
@@ -2433,7 +2457,7 @@ Resolver<Base, FuncType, Policy, ReturnType> functionResolver(FuncType Base::*fu
return Resolver<Base, FuncType, Policy, ReturnType>(func, 0, name, alternate);
}
-}
+} // namespace
#define RESOLVE_FUNC(RETURN_TYPE, POLICY, NAME) \
return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
@@ -3201,79 +3225,7 @@ static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribPointer(GLuint indx, GL
#endif // !QT_OPENGL_ES_2
-// Functions part of the OpenGL ES 3.0+ standard need special handling. These,
-// just like the 2.0 functions, are not guaranteed to be resolvable via
-// eglGetProcAddress or similar. Calling them directly is, unlike the 2.0
-// functions, not feasible because one may build the binaries on a GLES3-capable
-// system and then deploy on a GLES2-only system that does not have these
-// symbols. Until ES3 gets universally available, they have to be dlsym'ed.
-
-Q_GLOBAL_STATIC(QOpenGLES3Helper, qgles3Helper)
-
-bool QOpenGLES3Helper::init()
-{
-#ifndef Q_OS_IOS
-# ifdef Q_OS_WIN
-# ifndef QT_DEBUG
- m_gl.setFileName(QStringLiteral("libGLESv2"));
-# else
- m_gl.setFileName(QStringLiteral("libGLESv2d"));
-# endif
-# else
-# ifdef Q_OS_ANDROID
- m_gl.setFileName(QStringLiteral("GLESv2"));
-# else
- m_gl.setFileNameAndVersion(QStringLiteral("GLESv2"), 2);
-# endif
-# endif // Q_OS_WIN
- return m_gl.load();
-#else
- return true;
-#endif // Q_OS_IOS
-}
-
-QFunctionPointer QOpenGLES3Helper::resolve(const char *name)
-{
-#ifdef Q_OS_IOS
- return QFunctionPointer(dlsym(RTLD_DEFAULT, name));
-#else
- return m_gl.resolve(name);
-#endif
-}
-
-QOpenGLES3Helper::QOpenGLES3Helper()
-{
- if (init()) {
- MapBufferRange = (GLvoid* (QOPENGLF_APIENTRYP)(GLenum, qopengl_GLintptr, qopengl_GLsizeiptr, GLbitfield)) resolve("glMapBufferRange");
- UnmapBuffer = (GLboolean (QOPENGLF_APIENTRYP)(GLenum)) resolve("glUnmapBuffer");
- BlitFramebuffer = (void (QOPENGLF_APIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)) resolve("glBlitFramebuffer");
- RenderbufferStorageMultisample = (void (QOPENGLF_APIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)) resolve("glRenderbufferStorageMultisample");
-
- GenVertexArrays = (void (QOPENGLF_APIENTRYP)(GLsizei, GLuint *)) resolve("glGenVertexArrays");
- DeleteVertexArrays = (void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint *)) resolve("glDeleteVertexArrays");
- BindVertexArray = (void (QOPENGLF_APIENTRYP)(GLuint)) resolve("glBindVertexArray");
- IsVertexArray = (GLboolean (QOPENGLF_APIENTRYP)(GLuint)) resolve("glIsVertexArray");
-
- TexImage3D = (void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *)) resolve("glTexImage3D");
- TexSubImage3D = (void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) resolve("glTexSubImage3D");
- CompressedTexImage3D = (void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)) resolve("glCompressedTexImage3D");
- CompressedTexSubImage3D = (void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)) resolve("glCompressedTexSubImage3D");
-
- TexStorage3D = (void (QOPENGLF_APIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei)) resolve("glTexStorage3D");
- TexStorage2D = (void (QOPENGLF_APIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)) resolve("glTexStorage2D");
-
- if (!MapBufferRange || !GenVertexArrays || !TexImage3D || !TexStorage3D)
- qFatal("OpenGL ES 3.0 entry points not found");
- } else {
- qFatal("Failed to load libGLESv2");
- }
-}
-
-static inline bool isES3()
-{
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- return ctx->isOpenGLES() && ctx->format().majorVersion() >= 3;
-}
+// Extensions not standard in any ES version
static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBuffer(GLenum target, GLenum access)
{
@@ -3281,7 +3233,8 @@ static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBuffer(GLenum target, GLenum
// differentiate between glUnmapBufferOES and glUnmapBuffer causes extra
// headache. QOpenGLBuffer::map() will handle this automatically, while direct
// calls are better off with migrating to the standard glMapBufferRange.
- if (isES3()) {
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (ctx->isOpenGLES() && ctx->format().majorVersion() >= 3) {
qWarning("QOpenGLFunctions: glMapBuffer is not available in OpenGL ES 3.0 and up. Use glMapBufferRange instead.");
return 0;
} else {
@@ -3289,44 +3242,6 @@ static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBuffer(GLenum target, GLenum
}
}
-static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBufferRange(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr length, GLbitfield access)
-{
- if (isES3())
- return qgles3Helper()->MapBufferRange(target, offset, length, access);
- else
- RESOLVE_FUNC(GLvoid *, 0, MapBufferRange)(target, offset, length, access);
-}
-
-static GLboolean QOPENGLF_APIENTRY qopenglfResolveUnmapBuffer(GLenum target)
-{
- if (isES3())
- return qgles3Helper()->UnmapBuffer(target);
- else
- RESOLVE_FUNC(GLboolean, ResolveOES, UnmapBuffer)(target);
-}
-
-static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter)
-{
- if (isES3())
- qgles3Helper()->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
- else
- RESOLVE_FUNC_VOID(ResolveEXT | ResolveANGLE | ResolveNV, BlitFramebuffer)
- (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-}
-
-static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLenum target, GLsizei samples,
- GLenum internalFormat,
- GLsizei width, GLsizei height)
-{
- if (isES3())
- qgles3Helper()->RenderbufferStorageMultisample(target, samples, internalFormat, width, height);
- else
- RESOLVE_FUNC_VOID(ResolveEXT | ResolveANGLE | ResolveNV, RenderbufferStorageMultisample)
- (target, samples, internalFormat, width, height);
-}
-
static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
{
RESOLVE_FUNC_VOID(ResolveEXT, GetBufferSubData)
@@ -3567,15 +3482,4129 @@ QOpenGLFunctionsPrivate::QOpenGLFunctionsPrivate(QOpenGLContext *)
#endif // !QT_OPENGL_ES_2
}
-QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx)
- : QOpenGLFunctionsPrivate(ctx),
- flushVendorChecked(false)
+/*!
+ \class QOpenGLExtraFunctions
+ \brief The QOpenGLExtraFunctions class provides cross-platform access to the OpenGL ES 3.0 and 3.1 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
+ 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
+ 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
+ on will require no or minimal changes to the application.
+
+ \note This class is different from the versioned OpenGL wrappers, for
+ instance QOpenGLFunctions_3_2_Core. The versioned function wrappers target a
+ given version and profile of OpenGL. They are therefore not suitable for
+ cross-OpenGL-OpenGLES development.
+ */
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBeginQuery(GLenum target, GLuint id)
+
+ Convenience function that calls glBeginQuery(\a target, \a id).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBeginQuery.xml}{glBeginQuery()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBeginTransformFeedback(GLenum primitiveMode)
+
+ Convenience function that calls glBeginTransformFeedback(\a primitiveMode).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBeginTransformFeedback.xml}{glBeginTransformFeedback()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+
+ Convenience function that calls glBindBufferBase(\a target, \a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindBufferBase.xml}{glBindBufferBase()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+
+ Convenience function that calls glBindBufferRange(\a target, \a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindBufferRange.xml}{glBindBufferRange()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindSampler(GLuint unit, GLuint sampler)
+
+ Convenience function that calls glBindSampler(\a unit, \a sampler).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindSampler.xml}{glBindSampler()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindTransformFeedback(GLenum target, GLuint id)
+
+ Convenience function that calls glBindTransformFeedback(\a target, \a id).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindTransformFeedback.xml}{glBindTransformFeedback()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindVertexArray(GLuint array)
+
+ Convenience function that calls glBindVertexArray(\a array).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindVertexArray.xml}{glBindVertexArray()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+
+ Convenience function that calls glBlitFramebuffer(\a srcX0, \a srcY0, \a srcX1, \a srcY1, \a dstX0, \a dstY0, \a dstX1, \a dstY1, \a mask, \a filter).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBlitFramebuffer.xml}{glBlitFramebuffer()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+
+ Convenience function that calls glClearBufferfi(\a buffer, \a drawbuffer, \a depth, \a stencil).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glClearBufferfi.xml}{glClearBufferfi()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat * value)
+
+ Convenience function that calls glClearBufferfv(\a buffer, \a drawbuffer, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glClearBufferfv.xml}{glClearBufferfv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint * value)
+
+ Convenience function that calls glClearBufferiv(\a buffer, \a drawbuffer, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glClearBufferiv.xml}{glClearBufferiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint * value)
+
+ Convenience function that calls glClearBufferuiv(\a buffer, \a drawbuffer, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glClearBufferuiv.xml}{glClearBufferuiv()}.
+*/
+
+/*!
+ \fn GLenum QOpenGLExtraFunctions::glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+
+ Convenience function that calls glClientWaitSync(\a sync, \a flags, \a timeout).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glClientWaitSync.xml}{glClientWaitSync()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data)
+
+ Convenience function that calls glCompressedTexImage3D(\a target, \a level, \a internalformat, \a width, \a height, \a depth, \a border, \a imageSize, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glCompressedTexImage3D.xml}{glCompressedTexImage3D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data)
+
+ Convenience function that calls glCompressedTexSubImage3D(\a target, \a level, \a xoffset, \a yoffset, \a zoffset, \a width, \a height, \a depth, \a format, \a imageSize, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glCompressedTexSubImage3D.xml}{glCompressedTexSubImage3D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+
+ Convenience function that calls glCopyBufferSubData(\a readTarget, \a writeTarget, \a readOffset, \a writeOffset, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glCopyBufferSubData.xml}{glCopyBufferSubData()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+
+ Convenience function that calls glCopyTexSubImage3D(\a target, \a level, \a xoffset, \a yoffset, \a zoffset, \a x, \a y, \a width, \a height).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glCopyTexSubImage3D.xml}{glCopyTexSubImage3D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDeleteQueries(GLsizei n, const GLuint * ids)
+
+ Convenience function that calls glDeleteQueries(\a n, \a ids).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDeleteQueries.xml}{glDeleteQueries()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDeleteSamplers(GLsizei count, const GLuint * samplers)
+
+ Convenience function that calls glDeleteSamplers(\a count, \a samplers).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDeleteSamplers.xml}{glDeleteSamplers()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDeleteSync(GLsync sync)
+
+ Convenience function that calls glDeleteSync(\a sync).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDeleteSync.xml}{glDeleteSync()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDeleteTransformFeedbacks(GLsizei n, const GLuint * ids)
+
+ Convenience function that calls glDeleteTransformFeedbacks(\a n, \a ids).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDeleteTransformFeedbacks.xml}{glDeleteTransformFeedbacks()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDeleteVertexArrays(GLsizei n, const GLuint * arrays)
+
+ Convenience function that calls glDeleteVertexArrays(\a n, \a arrays).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDeleteVertexArrays.xml}{glDeleteVertexArrays()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount)
+
+ Convenience function that calls glDrawArraysInstanced(\a mode, \a first, \a count, \a instancecount).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDrawArraysInstanced.xml}{glDrawArraysInstanced()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawBuffers(GLsizei n, const GLenum * bufs)
+
+ Convenience function that calls glDrawBuffers(\a n, \a bufs).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDrawBuffers.xml}{glDrawBuffers()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount)
+
+ Convenience function that calls glDrawElementsInstanced(\a mode, \a count, \a type, \a indices, \a instancecount).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDrawElementsInstanced.xml}{glDrawElementsInstanced()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices)
+
+ Convenience function that calls glDrawRangeElements(\a mode, \a start, \a end, \a count, \a type, \a indices).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDrawRangeElements.xml}{glDrawRangeElements()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glEndQuery(GLenum target)
+
+ Convenience function that calls glEndQuery(\a target).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glEndQuery.xml}{glEndQuery()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glEndTransformFeedback(void)
+
+ Convenience function that calls glEndTransformFeedback().
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glEndTransformFeedback.xml}{glEndTransformFeedback()}.
+*/
+
+/*!
+ \fn GLsync QOpenGLExtraFunctions::glFenceSync(GLenum condition, GLbitfield flags)
+
+ Convenience function that calls glFenceSync(\a condition, \a flags).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glFenceSync.xml}{glFenceSync()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+
+ Convenience function that calls glFlushMappedBufferRange(\a target, \a offset, \a length).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glFlushMappedBufferRange.xml}{glFlushMappedBufferRange()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+
+ Convenience function that calls glFramebufferTextureLayer(\a target, \a attachment, \a texture, \a level, \a layer).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glFramebufferTextureLayer.xml}{glFramebufferTextureLayer()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGenQueries(GLsizei n, GLuint* ids)
+
+ Convenience function that calls glGenQueries(\a n, \a ids).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGenQueries.xml}{glGenQueries()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGenSamplers(GLsizei count, GLuint* samplers)
+
+ Convenience function that calls glGenSamplers(\a count, \a samplers).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGenSamplers.xml}{glGenSamplers()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGenTransformFeedbacks(GLsizei n, GLuint* ids)
+
+ Convenience function that calls glGenTransformFeedbacks(\a n, \a ids).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGenTransformFeedbacks.xml}{glGenTransformFeedbacks()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGenVertexArrays(GLsizei n, GLuint* arrays)
+
+ Convenience function that calls glGenVertexArrays(\a n, \a arrays).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGenVertexArrays.xml}{glGenVertexArrays()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+
+ Convenience function that calls glGetActiveUniformBlockName(\a program, \a uniformBlockIndex, \a bufSize, \a length, \a uniformBlockName).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetActiveUniformBlockName.xml}{glGetActiveUniformBlockName()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetActiveUniformBlockiv(\a program, \a uniformBlockIndex, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetActiveUniformBlockiv.xml}{glGetActiveUniformBlockiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetActiveUniformsiv(\a program, \a uniformCount, \a uniformIndices, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetActiveUniformsiv.xml}{glGetActiveUniformsiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
+
+ Convenience function that calls glGetBufferParameteri64v(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetBufferParameteri64v.xml}{glGetBufferParameteri64v()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetBufferPointerv(GLenum target, GLenum pname, void ** params)
+
+ Convenience function that calls glGetBufferPointerv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetBufferPointerv.xml}{glGetBufferPointerv()}.
+*/
+
+/*!
+ \fn GLint QOpenGLExtraFunctions::glGetFragDataLocation(GLuint program, const GLchar * name)
+
+ Convenience function that calls glGetFragDataLocation(\a program, \a name).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetFragDataLocation.xml}{glGetFragDataLocation()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+
+ Convenience function that calls glGetInteger64i_v(\a target, \a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetInteger64i_v.xml}{glGetInteger64i_v()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetInteger64v(GLenum pname, GLint64* data)
+
+ Convenience function that calls glGetInteger64v(\a pname, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetInteger64v.xml}{glGetInteger64v()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
+
+ Convenience function that calls glGetIntegeri_v(\a target, \a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetIntegeri_v.xml}{glGetIntegeri_v()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+
+ Convenience function that calls glGetInternalformativ(\a target, \a internalformat, \a pname, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetInternalformativ.xml}{glGetInternalformativ()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void * binary)
+
+ Convenience function that calls glGetProgramBinary(\a program, \a bufSize, \a length, \a binaryFormat, \a binary).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramBinary.xml}{glGetProgramBinary()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
+
+ Convenience function that calls glGetQueryObjectuiv(\a id, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetQueryObjectuiv.xml}{glGetQueryObjectuiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetQueryiv(GLenum target, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetQueryiv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetQueryiv.xml}{glGetQueryiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+
+ Convenience function that calls glGetSamplerParameterfv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetSamplerParameterfv.xml}{glGetSamplerParameterfv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetSamplerParameteriv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetSamplerParameteriv.xml}{glGetSamplerParameteriv()}.
+*/
+
+/*!
+ \fn const GLubyte * QOpenGLExtraFunctions::glGetStringi(GLenum name, GLuint index)
+
+ Convenience function that calls glGetStringi(\a name, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetStringi.xml}{glGetStringi()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+
+ Convenience function that calls glGetSynciv(\a sync, \a pname, \a bufSize, \a length, \a values).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetSynciv.xml}{glGetSynciv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
+
+ Convenience function that calls glGetTransformFeedbackVarying(\a program, \a index, \a bufSize, \a length, \a size, \a type, \a name).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetTransformFeedbackVarying.xml}{glGetTransformFeedbackVarying()}.
+*/
+
+/*!
+ \fn GLuint QOpenGLExtraFunctions::glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName)
+
+ Convenience function that calls glGetUniformBlockIndex(\a program, \a uniformBlockName).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetUniformBlockIndex.xml}{glGetUniformBlockIndex()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint* uniformIndices)
+
+ Convenience function that calls glGetUniformIndices(\a program, \a uniformCount, \a uniformNames, \a uniformIndices).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetUniformIndices.xml}{glGetUniformIndices()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetUniformuiv(GLuint program, GLint location, GLuint* params)
+
+ Convenience function that calls glGetUniformuiv(\a program, \a location, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetUniformuiv.xml}{glGetUniformuiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetVertexAttribIiv(\a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetVertexAttribIiv.xml}{glGetVertexAttribIiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+
+ Convenience function that calls glGetVertexAttribIuiv(\a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetVertexAttribIuiv.xml}{glGetVertexAttribIuiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments)
+
+ Convenience function that calls glInvalidateFramebuffer(\a target, \a numAttachments, \a attachments).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glInvalidateFramebuffer.xml}{glInvalidateFramebuffer()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+
+ Convenience function that calls glInvalidateSubFramebuffer(\a target, \a numAttachments, \a attachments, \a x, \a y, \a width, \a height).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glInvalidateSubFramebuffer.xml}{glInvalidateSubFramebuffer()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glIsQuery(GLuint id)
+
+ Convenience function that calls glIsQuery(\a id).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glIsQuery.xml}{glIsQuery()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glIsSampler(GLuint sampler)
+
+ Convenience function that calls glIsSampler(\a sampler).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glIsSampler.xml}{glIsSampler()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glIsSync(GLsync sync)
+
+ Convenience function that calls glIsSync(\a sync).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glIsSync.xml}{glIsSync()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glIsTransformFeedback(GLuint id)
+
+ Convenience function that calls glIsTransformFeedback(\a id).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glIsTransformFeedback.xml}{glIsTransformFeedback()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glIsVertexArray(GLuint array)
+
+ Convenience function that calls glIsVertexArray(\a array).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glIsVertexArray.xml}{glIsVertexArray()}.
+*/
+
+/*!
+ \fn void * QOpenGLExtraFunctions::glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+
+ Convenience function that calls glMapBufferRange(\a target, \a offset, \a length, \a access).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glMapBufferRange.xml}{glMapBufferRange()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glPauseTransformFeedback(void)
+
+ Convenience function that calls glPauseTransformFeedback().
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glPauseTransformFeedback.xml}{glPauseTransformFeedback()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length)
+
+ Convenience function that calls glProgramBinary(\a program, \a binaryFormat, \a binary, \a length).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramBinary.xml}{glProgramBinary()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramParameteri(GLuint program, GLenum pname, GLint value)
+
+ Convenience function that calls glProgramParameteri(\a program, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramParameteri.xml}{glProgramParameteri()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glReadBuffer(GLenum src)
+
+ Convenience function that calls glReadBuffer(\a src).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glReadBuffer.xml}{glReadBuffer()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+
+ Convenience function that calls glRenderbufferStorageMultisample(\a target, \a samples, \a internalformat, \a width, \a height).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glRenderbufferStorageMultisample.xml}{glRenderbufferStorageMultisample()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glResumeTransformFeedback(void)
+
+ Convenience function that calls glResumeTransformFeedback().
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glResumeTransformFeedback.xml}{glResumeTransformFeedback()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+
+ Convenience function that calls glSamplerParameterf(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glSamplerParameterf.xml}{glSamplerParameterf()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * param)
+
+ Convenience function that calls glSamplerParameterfv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glSamplerParameterfv.xml}{glSamplerParameterfv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+
+ Convenience function that calls glSamplerParameteri(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glSamplerParameteri.xml}{glSamplerParameteri()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * param)
+
+ Convenience function that calls glSamplerParameteriv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glSamplerParameteriv.xml}{glSamplerParameteriv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels)
+
+ Convenience function that calls glTexImage3D(\a target, \a level, \a internalformat, \a width, \a height, \a depth, \a border, \a format, \a type, \a pixels).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glTexImage3D.xml}{glTexImage3D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+
+ Convenience function that calls glTexStorage2D(\a target, \a levels, \a internalformat, \a width, \a height).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glTexStorage2D.xml}{glTexStorage2D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+
+ Convenience function that calls glTexStorage3D(\a target, \a levels, \a internalformat, \a width, \a height, \a depth).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glTexStorage3D.xml}{glTexStorage3D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels)
+
+ Convenience function that calls glTexSubImage3D(\a target, \a level, \a xoffset, \a yoffset, \a zoffset, \a width, \a height, \a depth, \a format, \a type, \a pixels).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glTexSubImage3D.xml}{glTexSubImage3D()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode)
+
+ Convenience function that calls glTransformFeedbackVaryings(\a program, \a count, \a varyings, \a bufferMode).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glTransformFeedbackVaryings.xml}{glTransformFeedbackVaryings()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform1ui(GLint location, GLuint v0)
+
+ Convenience function that calls glUniform1ui(\a location, \a v0).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform1ui.xml}{glUniform1ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform1uiv(GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glUniform1uiv(\a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform1uiv.xml}{glUniform1uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform2ui(GLint location, GLuint v0, GLuint v1)
+
+ Convenience function that calls glUniform2ui(\a location, \a v0, \a v1).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform2ui.xml}{glUniform2ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform2uiv(GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glUniform2uiv(\a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform2uiv.xml}{glUniform2uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+
+ Convenience function that calls glUniform3ui(\a location, \a v0, \a v1, \a v2).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform3ui.xml}{glUniform3ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform3uiv(GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glUniform3uiv(\a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform3uiv.xml}{glUniform3uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+
+ Convenience function that calls glUniform4ui(\a location, \a v0, \a v1, \a v2, \a v3).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform4ui.xml}{glUniform4ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniform4uiv(GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glUniform4uiv(\a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniform4uiv.xml}{glUniform4uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+
+ Convenience function that calls glUniformBlockBinding(\a program, \a uniformBlockIndex, \a uniformBlockBinding).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformBlockBinding.xml}{glUniformBlockBinding()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glUniformMatrix2x3fv(\a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformMatrix2x3fv.xml}{glUniformMatrix2x3fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glUniformMatrix2x4fv(\a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformMatrix2x4fv.xml}{glUniformMatrix2x4fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glUniformMatrix3x2fv(\a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformMatrix3x2fv.xml}{glUniformMatrix3x2fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glUniformMatrix3x4fv(\a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformMatrix3x4fv.xml}{glUniformMatrix3x4fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glUniformMatrix4x2fv(\a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformMatrix4x2fv.xml}{glUniformMatrix4x2fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glUniformMatrix4x3fv(\a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUniformMatrix4x3fv.xml}{glUniformMatrix4x3fv()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glUnmapBuffer(GLenum target)
+
+ Convenience function that calls glUnmapBuffer(\a target).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUnmapBuffer.xml}{glUnmapBuffer()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribDivisor(GLuint index, GLuint divisor)
+
+ Convenience function that calls glVertexAttribDivisor(\a index, \a divisor).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribDivisor.xml}{glVertexAttribDivisor()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
+
+ Convenience function that calls glVertexAttribI4i(\a index, \a x, \a y, \a z, \a w).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribI4i.xml}{glVertexAttribI4i()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribI4iv(GLuint index, const GLint * v)
+
+ Convenience function that calls glVertexAttribI4iv(\a index, \a v).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribI4iv.xml}{glVertexAttribI4iv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+
+ Convenience function that calls glVertexAttribI4ui(\a index, \a x, \a y, \a z, \a w).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribI4ui.xml}{glVertexAttribI4ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribI4uiv(GLuint index, const GLuint * v)
+
+ Convenience function that calls glVertexAttribI4uiv(\a index, \a v).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribI4uiv.xml}{glVertexAttribI4uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer)
+
+ Convenience function that calls glVertexAttribIPointer(\a index, \a size, \a type, \a stride, \a pointer).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribIPointer.xml}{glVertexAttribIPointer()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+
+ Convenience function that calls glWaitSync(\a sync, \a flags, \a timeout).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glWaitSync.xml}{glWaitSync()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glActiveShaderProgram(GLuint pipeline, GLuint program)
+
+ Convenience function that calls glActiveShaderProgram(\a pipeline, \a program).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glActiveShaderProgram.xml}{glActiveShaderProgram()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+
+ Convenience function that calls glBindImageTexture(\a unit, \a texture, \a level, \a layered, \a layer, \a access, \a format).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindImageTexture.xml}{glBindImageTexture()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindProgramPipeline(GLuint pipeline)
+
+ Convenience function that calls glBindProgramPipeline(\a pipeline).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindProgramPipeline.xml}{glBindProgramPipeline()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
+
+ Convenience function that calls glBindVertexBuffer(\a bindingindex, \a buffer, \a offset, \a stride).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glBindVertexBuffer.xml}{glBindVertexBuffer()}.
+*/
+
+/*!
+ \fn GLuint QOpenGLExtraFunctions::glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const* strings)
+
+ Convenience function that calls glCreateShaderProgramv(\a type, \a count, \a strings).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glCreateShaderProgramv.xml}{glCreateShaderProgramv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDeleteProgramPipelines(GLsizei n, const GLuint * pipelines)
+
+ Convenience function that calls glDeleteProgramPipelines(\a n, \a pipelines).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDeleteProgramPipelines.xml}{glDeleteProgramPipelines()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+
+ Convenience function that calls glDispatchCompute(\a num_groups_x, \a num_groups_y, \a num_groups_z).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDispatchCompute.xml}{glDispatchCompute()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDispatchComputeIndirect(GLintptr indirect)
+
+ Convenience function that calls glDispatchComputeIndirect(\a indirect).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDispatchComputeIndirect.xml}{glDispatchComputeIndirect()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawArraysIndirect(GLenum mode, const void * indirect)
+
+ Convenience function that calls glDrawArraysIndirect(\a mode, \a indirect).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDrawArraysIndirect.xml}{glDrawArraysIndirect()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect)
+
+ Convenience function that calls glDrawElementsIndirect(\a mode, \a type, \a indirect).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glDrawElementsIndirect.xml}{glDrawElementsIndirect()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glFramebufferParameteri(GLenum target, GLenum pname, GLint param)
+
+ Convenience function that calls glFramebufferParameteri(\a target, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glFramebufferParameteri.xml}{glFramebufferParameteri()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGenProgramPipelines(GLsizei n, GLuint* pipelines)
+
+ Convenience function that calls glGenProgramPipelines(\a n, \a pipelines).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGenProgramPipelines.xml}{glGenProgramPipelines()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetBooleani_v(GLenum target, GLuint index, GLboolean* data)
+
+ Convenience function that calls glGetBooleani_v(\a target, \a index, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetBooleani_v.xml}{glGetBooleani_v()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetFramebufferParameteriv(\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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetFramebufferParameteriv.xml}{glGetFramebufferParameteriv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val)
+
+ Convenience function that calls glGetMultisamplefv(\a pname, \a index, \a val).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetMultisamplefv.xml}{glGetMultisamplefv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetProgramInterfaceiv(\a program, \a programInterface, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramInterfaceiv.xml}{glGetProgramInterfaceiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+
+ Convenience function that calls glGetProgramPipelineInfoLog(\a pipeline, \a bufSize, \a length, \a infoLog).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramPipelineInfoLog.xml}{glGetProgramPipelineInfoLog()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetProgramPipelineiv(\a pipeline, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramPipelineiv.xml}{glGetProgramPipelineiv()}.
+*/
+
+/*!
+ \fn GLuint QOpenGLExtraFunctions::glGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name)
+
+ Convenience function that calls glGetProgramResourceIndex(\a program, \a programInterface, \a name).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramResourceIndex.xml}{glGetProgramResourceIndex()}.
+*/
+
+/*!
+ \fn GLint QOpenGLExtraFunctions::glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name)
+
+ Convenience function that calls glGetProgramResourceLocation(\a program, \a programInterface, \a name).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramResourceLocation.xml}{glGetProgramResourceLocation()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar* name)
+
+ Convenience function that calls glGetProgramResourceName(\a program, \a programInterface, \a index, \a bufSize, \a length, \a name).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramResourceName.xml}{glGetProgramResourceName()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei* length, GLint* params)
+
+ Convenience function that calls glGetProgramResourceiv(\a program, \a programInterface, \a index, \a propCount, \a props, \a bufSize, \a length, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetProgramResourceiv.xml}{glGetProgramResourceiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params)
+
+ Convenience function that calls glGetTexLevelParameterfv(\a target, \a level, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetTexLevelParameterfv.xml}{glGetTexLevelParameterfv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
+
+ Convenience function that calls glGetTexLevelParameteriv(\a target, \a level, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glGetTexLevelParameteriv.xml}{glGetTexLevelParameteriv()}.
+*/
+
+/*!
+ \fn GLboolean QOpenGLExtraFunctions::glIsProgramPipeline(GLuint pipeline)
+
+ Convenience function that calls glIsProgramPipeline(\a pipeline).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glIsProgramPipeline.xml}{glIsProgramPipeline()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glMemoryBarrier(GLbitfield barriers)
+
+ Convenience function that calls glMemoryBarrier(\a barriers).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glMemoryBarrier.xml}{glMemoryBarrier()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glMemoryBarrierByRegion(GLbitfield barriers)
+
+ Convenience function that calls glMemoryBarrierByRegion(\a barriers).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glMemoryBarrierByRegion.xml}{glMemoryBarrierByRegion()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform1f(GLuint program, GLint location, GLfloat v0)
+
+ Convenience function that calls glProgramUniform1f(\a program, \a location, \a v0).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform1f.xml}{glProgramUniform1f()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+
+ Convenience function that calls glProgramUniform1fv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform1fv.xml}{glProgramUniform1fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform1i(GLuint program, GLint location, GLint v0)
+
+ Convenience function that calls glProgramUniform1i(\a program, \a location, \a v0).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform1i.xml}{glProgramUniform1i()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+
+ Convenience function that calls glProgramUniform1iv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform1iv.xml}{glProgramUniform1iv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform1ui(GLuint program, GLint location, GLuint v0)
+
+ Convenience function that calls glProgramUniform1ui(\a program, \a location, \a v0).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform1ui.xml}{glProgramUniform1ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glProgramUniform1uiv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform1uiv.xml}{glProgramUniform1uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+
+ Convenience function that calls glProgramUniform2f(\a program, \a location, \a v0, \a v1).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform2f.xml}{glProgramUniform2f()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+
+ Convenience function that calls glProgramUniform2fv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform2fv.xml}{glProgramUniform2fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
+
+ Convenience function that calls glProgramUniform2i(\a program, \a location, \a v0, \a v1).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform2i.xml}{glProgramUniform2i()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+
+ Convenience function that calls glProgramUniform2iv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform2iv.xml}{glProgramUniform2iv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
+
+ Convenience function that calls glProgramUniform2ui(\a program, \a location, \a v0, \a v1).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform2ui.xml}{glProgramUniform2ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glProgramUniform2uiv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform2uiv.xml}{glProgramUniform2uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+
+ Convenience function that calls glProgramUniform3f(\a program, \a location, \a v0, \a v1, \a v2).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform3f.xml}{glProgramUniform3f()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+
+ Convenience function that calls glProgramUniform3fv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform3fv.xml}{glProgramUniform3fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+
+ Convenience function that calls glProgramUniform3i(\a program, \a location, \a v0, \a v1, \a v2).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform3i.xml}{glProgramUniform3i()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+
+ Convenience function that calls glProgramUniform3iv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform3iv.xml}{glProgramUniform3iv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
+
+ Convenience function that calls glProgramUniform3ui(\a program, \a location, \a v0, \a v1, \a v2).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform3ui.xml}{glProgramUniform3ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glProgramUniform3uiv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform3uiv.xml}{glProgramUniform3uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+
+ Convenience function that calls glProgramUniform4f(\a program, \a location, \a v0, \a v1, \a v2, \a v3).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform4f.xml}{glProgramUniform4f()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+
+ Convenience function that calls glProgramUniform4fv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform4fv.xml}{glProgramUniform4fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+
+ Convenience function that calls glProgramUniform4i(\a program, \a location, \a v0, \a v1, \a v2, \a v3).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform4i.xml}{glProgramUniform4i()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+
+ Convenience function that calls glProgramUniform4iv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform4iv.xml}{glProgramUniform4iv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+
+ Convenience function that calls glProgramUniform4ui(\a program, \a location, \a v0, \a v1, \a v2, \a v3).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform4ui.xml}{glProgramUniform4ui()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+
+ Convenience function that calls glProgramUniform4uiv(\a program, \a location, \a count, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniform4uiv.xml}{glProgramUniform4uiv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix2fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix2fv.xml}{glProgramUniformMatrix2fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix2x3fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix2x3fv.xml}{glProgramUniformMatrix2x3fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix2x4fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix2x4fv.xml}{glProgramUniformMatrix2x4fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix3fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix3fv.xml}{glProgramUniformMatrix3fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix3x2fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix3x2fv.xml}{glProgramUniformMatrix3x2fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix3x4fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix3x4fv.xml}{glProgramUniformMatrix3x4fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix4fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix4fv.xml}{glProgramUniformMatrix4fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix4x2fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix4x2fv.xml}{glProgramUniformMatrix4x2fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+
+ Convenience function that calls glProgramUniformMatrix4x3fv(\a program, \a location, \a count, \a transpose, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glProgramUniformMatrix4x3fv.xml}{glProgramUniformMatrix4x3fv()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glSampleMaski(GLuint maskNumber, GLbitfield mask)
+
+ Convenience function that calls glSampleMaski(\a maskNumber, \a mask).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glSampleMaski.xml}{glSampleMaski()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+
+ Convenience function that calls glTexStorage2DMultisample(\a target, \a samples, \a internalformat, \a width, \a height, \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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glTexStorage2DMultisample.xml}{glTexStorage2DMultisample()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
+
+ Convenience function that calls glUseProgramStages(\a pipeline, \a stages, \a program).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glUseProgramStages.xml}{glUseProgramStages()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glValidateProgramPipeline(GLuint pipeline)
+
+ Convenience function that calls glValidateProgramPipeline(\a pipeline).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glValidateProgramPipeline.xml}{glValidateProgramPipeline()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
+
+ Convenience function that calls glVertexAttribBinding(\a attribindex, \a bindingindex).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribBinding.xml}{glVertexAttribBinding()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+
+ Convenience function that calls glVertexAttribFormat(\a attribindex, \a size, \a type, \a normalized, \a relativeoffset).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribFormat.xml}{glVertexAttribFormat()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+
+ Convenience function that calls glVertexAttribIFormat(\a attribindex, \a size, \a type, \a relativeoffset).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexAttribIFormat.xml}{glVertexAttribIFormat()}.
+*/
+
+/*!
+ \fn void QOpenGLExtraFunctions::glVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
+
+ Convenience function that calls glVertexBindingDivisor(\a bindingindex, \a divisor).
+
+ 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.x documentation for
+ \l{http://www.khronos.org/opengles/sdk/docs/man31/glVertexBindingDivisor.xml}{glVertexBindingDivisor()}.
+*/
+
+/*!
+ \fn bool QOpenGLExtraFunctions::isInitialized(const QOpenGLExtraFunctionsPrivate *d)
+ \internal
+*/
+
+// Functions part of the OpenGL ES 3.0+ standard need special handling. These, just like
+// the 2.0 functions, are not guaranteed to be resolvable via eglGetProcAddress or
+// similar. (we cannot count on EGL_KHR_(client_)get_all_proc_addresses being available)
+
+// Calling them directly is, unlike the 2.0 functions, not feasible because one may build
+// the binaries on a GLES3-capable system and then deploy on a GLES2-only system that does
+// not have these symbols, and vice versa. Until ES3 becomes universally available, they
+// have to be dlsym'ed.
+
+Q_GLOBAL_STATIC(QOpenGLES3Helper, qgles3Helper)
+
+bool QOpenGLES3Helper::init()
{
- MapBuffer = qopenglfResolveMapBuffer;
- MapBufferRange = qopenglfResolveMapBufferRange;
+#ifdef QT_NO_LIBRARY
+ return false;
+#elif !defined(Q_OS_IOS)
+# ifdef Q_OS_WIN
+# ifndef QT_DEBUG
+ m_gl.setFileName(QStringLiteral("libGLESv2"));
+# else
+ m_gl.setFileName(QStringLiteral("libGLESv2d"));
+# endif
+# else
+# ifdef Q_OS_ANDROID
+ m_gl.setFileName(QStringLiteral("GLESv2"));
+# else
+ m_gl.setFileNameAndVersion(QStringLiteral("GLESv2"), 2);
+# endif
+# endif // Q_OS_WIN
+ return m_gl.load();
+#else
+ return true;
+#endif // Q_OS_IOS
+}
+
+QFunctionPointer QOpenGLES3Helper::resolve(const char *name)
+{
+#ifdef Q_OS_IOS
+ return QFunctionPointer(dlsym(RTLD_DEFAULT, name));
+#elif !defined(QT_NO_LIBRARY)
+ return m_gl.resolve(name);
+#else
+ Q_UNUSED(name);
+ return 0;
+#endif
+}
+
+QOpenGLES3Helper::QOpenGLES3Helper()
+{
+ m_supportedVersion = qMakePair(2, 0);
+
+ if (init()) {
+ const QPair<int, int> contextVersion = QOpenGLContext::currentContext()->format().version();
+
+ qCDebug(lcGLES3, "Resolving OpenGL ES 3.0 entry points");
+
+ BeginQuery = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint)) resolve("glBeginQuery");
+ BeginTransformFeedback = (void (QOPENGLF_APIENTRYP) (GLenum)) resolve("glBeginTransformFeedback");
+ BindBufferBase = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLuint)) resolve("glBindBufferBase");
+ BindBufferRange = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr)) resolve("glBindBufferRange");
+ BindSampler = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint)) resolve("glBindSampler");
+ BindTransformFeedback = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint)) resolve("glBindTransformFeedback");
+ BindVertexArray = (void (QOPENGLF_APIENTRYP) (GLuint)) resolve("glBindVertexArray");
+ BlitFramebuffer = (void (QOPENGLF_APIENTRYP) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)) resolve("glBlitFramebuffer");
+ ClearBufferfi = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLfloat, GLint)) resolve("glClearBufferfi");
+ ClearBufferfv = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, const GLfloat *)) resolve("glClearBufferfv");
+ ClearBufferiv = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, const GLint *)) resolve("glClearBufferiv");
+ ClearBufferuiv = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, const GLuint *)) resolve("glClearBufferuiv");
+ ClientWaitSync = (GLenum (QOPENGLF_APIENTRYP) (GLsync, GLbitfield, GLuint64)) resolve("glClientWaitSync");
+ CompressedTexImage3D = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const void *)) resolve("glCompressedTexImage3D");
+ CompressedTexSubImage3D = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const void *)) resolve("glCompressedTexSubImage3D");
+ CopyBufferSubData = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr)) resolve("glCopyBufferSubData");
+ CopyTexSubImage3D = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei)) resolve("glCopyTexSubImage3D");
+ DeleteQueries = (void (QOPENGLF_APIENTRYP) (GLsizei, const GLuint *)) resolve("glDeleteQueries");
+ DeleteSamplers = (void (QOPENGLF_APIENTRYP) (GLsizei, const GLuint *)) resolve("glDeleteSamplers");
+ DeleteSync = (void (QOPENGLF_APIENTRYP) (GLsync)) resolve("glDeleteSync");
+ DeleteTransformFeedbacks = (void (QOPENGLF_APIENTRYP) (GLsizei, const GLuint *)) resolve("glDeleteTransformFeedbacks");
+ DeleteVertexArrays = (void (QOPENGLF_APIENTRYP) (GLsizei, const GLuint *)) resolve("glDeleteVertexArrays");
+ DrawArraysInstanced = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLsizei, GLsizei)) resolve("glDrawArraysInstanced");
+ DrawBuffers = (void (QOPENGLF_APIENTRYP) (GLsizei, const GLenum *)) resolve("glDrawBuffers");
+ DrawElementsInstanced = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, GLenum, const void *, GLsizei)) resolve("glDrawElementsInstanced");
+ DrawRangeElements = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLuint, GLsizei, GLenum, const void *)) resolve("glDrawRangeElements");
+ EndQuery = (void (QOPENGLF_APIENTRYP) (GLenum)) resolve("glEndQuery");
+ EndTransformFeedback = (void (QOPENGLF_APIENTRYP) ()) resolve("glEndTransformFeedback");
+ FenceSync = (GLsync (QOPENGLF_APIENTRYP) (GLenum, GLbitfield)) resolve("glFenceSync");
+ FlushMappedBufferRange = (void (QOPENGLF_APIENTRYP) (GLenum, GLintptr, GLsizeiptr)) resolve("glFlushMappedBufferRange");
+ FramebufferTextureLayer = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLuint, GLint, GLint)) resolve("glFramebufferTextureLayer");
+ GenQueries = (void (QOPENGLF_APIENTRYP) (GLsizei, GLuint*)) resolve("glGenQueries");
+ GenSamplers = (void (QOPENGLF_APIENTRYP) (GLsizei, GLuint*)) resolve("glGenSamplers");
+ GenTransformFeedbacks = (void (QOPENGLF_APIENTRYP) (GLsizei, GLuint*)) resolve("glGenTransformFeedbacks");
+ GenVertexArrays = (void (QOPENGLF_APIENTRYP) (GLsizei, GLuint*)) resolve("glGenVertexArrays");
+ GetActiveUniformBlockName = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLsizei, GLsizei*, GLchar*)) resolve("glGetActiveUniformBlockName");
+ GetActiveUniformBlockiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLenum, GLint*)) resolve("glGetActiveUniformBlockiv");
+ GetActiveUniformsiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLsizei, const GLuint *, GLenum, GLint*)) resolve("glGetActiveUniformsiv");
+ GetBufferParameteri64v = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLint64*)) resolve("glGetBufferParameteri64v");
+ GetBufferPointerv = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, void **)) resolve("glGetBufferPointerv");
+ GetFragDataLocation = (GLint (QOPENGLF_APIENTRYP) (GLuint, const GLchar *)) resolve("glGetFragDataLocation");
+ GetInteger64i_v = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLint64*)) resolve("glGetInteger64i_v");
+ GetInteger64v = (void (QOPENGLF_APIENTRYP) (GLenum, GLint64*)) resolve("glGetInteger64v");
+ GetIntegeri_v = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLint*)) resolve("glGetIntegeri_v");
+ GetInternalformativ = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLenum, GLsizei, GLint*)) resolve("glGetInternalformativ");
+ GetProgramBinary = (void (QOPENGLF_APIENTRYP) (GLuint, GLsizei, GLsizei*, GLenum*, void *)) resolve("glGetProgramBinary");
+ GetQueryObjectuiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLuint*)) resolve("glGetQueryObjectuiv");
+ GetQueryiv = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLint*)) resolve("glGetQueryiv");
+ GetSamplerParameterfv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLfloat*)) resolve("glGetSamplerParameterfv");
+ GetSamplerParameteriv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLint*)) resolve("glGetSamplerParameteriv");
+ GetStringi = (const GLubyte * (QOPENGLF_APIENTRYP) (GLenum, GLuint)) resolve("glGetStringi");
+ GetSynciv = (void (QOPENGLF_APIENTRYP) (GLsync, GLenum, GLsizei, GLsizei*, GLint*)) resolve("glGetSynciv");
+ GetTransformFeedbackVarying = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLsizei, GLsizei*, GLsizei*, GLenum*, GLchar*)) resolve("glGetTransformFeedbackVarying");
+ GetUniformBlockIndex = (GLuint (QOPENGLF_APIENTRYP) (GLuint, const GLchar *)) resolve("glGetUniformBlockIndex");
+ GetUniformIndices = (void (QOPENGLF_APIENTRYP) (GLuint, GLsizei, const GLchar *const*, GLuint*)) resolve("glGetUniformIndices");
+ GetUniformuiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLuint*)) resolve("glGetUniformuiv");
+ GetVertexAttribIiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLint*)) resolve("glGetVertexAttribIiv");
+ GetVertexAttribIuiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLuint*)) resolve("glGetVertexAttribIuiv");
+ InvalidateFramebuffer = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, const GLenum *)) resolve("glInvalidateFramebuffer");
+ InvalidateSubFramebuffer = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, const GLenum *, GLint, GLint, GLsizei, GLsizei)) resolve("glInvalidateSubFramebuffer");
+ IsQuery = (GLboolean (QOPENGLF_APIENTRYP) (GLuint)) resolve("glIsQuery");
+ IsSampler = (GLboolean (QOPENGLF_APIENTRYP) (GLuint)) resolve("glIsSampler");
+ IsSync = (GLboolean (QOPENGLF_APIENTRYP) (GLsync)) resolve("glIsSync");
+ IsTransformFeedback = (GLboolean (QOPENGLF_APIENTRYP) (GLuint)) resolve("glIsTransformFeedback");
+ IsVertexArray = (GLboolean (QOPENGLF_APIENTRYP) (GLuint)) resolve("glIsVertexArray");
+ MapBufferRange = (void * (QOPENGLF_APIENTRYP) (GLenum, GLintptr, GLsizeiptr, GLbitfield)) resolve("glMapBufferRange");
+ PauseTransformFeedback = (void (QOPENGLF_APIENTRYP) ()) resolve("glPauseTransformFeedback");
+ ProgramBinary = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, const void *, GLsizei)) resolve("glProgramBinary");
+ ProgramParameteri = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLint)) resolve("glProgramParameteri");
+ ReadBuffer = (void (QOPENGLF_APIENTRYP) (GLenum)) resolve("glReadBuffer");
+ RenderbufferStorageMultisample = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, GLenum, GLsizei, GLsizei)) resolve("glRenderbufferStorageMultisample");
+ ResumeTransformFeedback = (void (QOPENGLF_APIENTRYP) ()) resolve("glResumeTransformFeedback");
+ SamplerParameterf = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLfloat)) resolve("glSamplerParameterf");
+ SamplerParameterfv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, const GLfloat *)) resolve("glSamplerParameterfv");
+ SamplerParameteri = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLint)) resolve("glSamplerParameteri");
+ SamplerParameteriv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, const GLint *)) resolve("glSamplerParameteriv");
+ TexImage3D = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *)) resolve("glTexImage3D");
+ TexStorage2D = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, GLenum, GLsizei, GLsizei)) resolve("glTexStorage2D");
+ TexStorage3D = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei)) resolve("glTexStorage3D");
+ TexSubImage3D = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const void *)) resolve("glTexSubImage3D");
+ TransformFeedbackVaryings = (void (QOPENGLF_APIENTRYP) (GLuint, GLsizei, const GLchar *const*, GLenum)) resolve("glTransformFeedbackVaryings");
+ Uniform1ui = (void (QOPENGLF_APIENTRYP) (GLint, GLuint)) resolve("glUniform1ui");
+ Uniform1uiv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, const GLuint *)) resolve("glUniform1uiv");
+ Uniform2ui = (void (QOPENGLF_APIENTRYP) (GLint, GLuint, GLuint)) resolve("glUniform2ui");
+ Uniform2uiv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, const GLuint *)) resolve("glUniform2uiv");
+ Uniform3ui = (void (QOPENGLF_APIENTRYP) (GLint, GLuint, GLuint, GLuint)) resolve("glUniform3ui");
+ Uniform3uiv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, const GLuint *)) resolve("glUniform3uiv");
+ Uniform4ui = (void (QOPENGLF_APIENTRYP) (GLint, GLuint, GLuint, GLuint, GLuint)) resolve("glUniform4ui");
+ Uniform4uiv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, const GLuint *)) resolve("glUniform4uiv");
+ UniformBlockBinding = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLuint)) resolve("glUniformBlockBinding");
+ UniformMatrix2x3fv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glUniformMatrix2x3fv");
+ UniformMatrix2x4fv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glUniformMatrix2x4fv");
+ UniformMatrix3x2fv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glUniformMatrix3x2fv");
+ UniformMatrix3x4fv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glUniformMatrix3x4fv");
+ UniformMatrix4x2fv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glUniformMatrix4x2fv");
+ UniformMatrix4x3fv = (void (QOPENGLF_APIENTRYP) (GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glUniformMatrix4x3fv");
+ UnmapBuffer = (GLboolean (QOPENGLF_APIENTRYP) (GLenum)) resolve("glUnmapBuffer");
+ VertexAttribDivisor = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint)) resolve("glVertexAttribDivisor");
+ VertexAttribI4i = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLint, GLint, GLint)) resolve("glVertexAttribI4i");
+ VertexAttribI4iv = (void (QOPENGLF_APIENTRYP) (GLuint, const GLint *)) resolve("glVertexAttribI4iv");
+ VertexAttribI4ui = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLuint, GLuint, GLuint)) resolve("glVertexAttribI4ui");
+ VertexAttribI4uiv = (void (QOPENGLF_APIENTRYP) (GLuint, const GLuint *)) resolve("glVertexAttribI4uiv");
+ VertexAttribIPointer = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLenum, GLsizei, const void *)) resolve("glVertexAttribIPointer");
+ WaitSync = (void (QOPENGLF_APIENTRYP) (GLsync, GLbitfield, GLuint64)) resolve("glWaitSync");
+
+ if (!BeginQuery || !BlitFramebuffer || !GenTransformFeedbacks || !GenVertexArrays || !MapBufferRange
+ || !RenderbufferStorageMultisample || !TexStorage2D || !WaitSync) {
+ qWarning("OpenGL ES 3.0 entry points not found. This is odd because the driver returned a context of version %d.%d",
+ contextVersion.first, contextVersion.second);
+ return;
+ }
+ m_supportedVersion = qMakePair(3, 0);
+
+ if (contextVersion >= qMakePair(3, 1)) {
+ qCDebug(lcGLES3, "Resolving OpenGL ES 3.1 entry points");
+
+ ActiveShaderProgram = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint)) resolve("glActiveShaderProgram");
+ BindImageTexture = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum)) resolve("glBindImageTexture");
+ BindProgramPipeline = (void (QOPENGLF_APIENTRYP) (GLuint)) resolve("glBindProgramPipeline");
+ BindVertexBuffer = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLintptr, GLsizei)) resolve("glBindVertexBuffer");
+ CreateShaderProgramv = (GLuint (QOPENGLF_APIENTRYP) (GLenum, GLsizei, const GLchar *const*)) resolve("glCreateShaderProgramv");
+ DeleteProgramPipelines = (void (QOPENGLF_APIENTRYP) (GLsizei, const GLuint *)) resolve("glDeleteProgramPipelines");
+ DispatchCompute = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint, GLuint)) resolve("glDispatchCompute");
+ DispatchComputeIndirect = (void (QOPENGLF_APIENTRYP) (GLintptr)) resolve("glDispatchComputeIndirect");
+ DrawArraysIndirect = (void (QOPENGLF_APIENTRYP) (GLenum, const void *)) resolve("glDrawArraysIndirect");
+ DrawElementsIndirect = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, const void *)) resolve("glDrawElementsIndirect");
+ FramebufferParameteri = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLint)) resolve("glFramebufferParameteri");
+ GenProgramPipelines = (void (QOPENGLF_APIENTRYP) (GLsizei, GLuint*)) resolve("glGenProgramPipelines");
+ GetBooleani_v = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLboolean*)) resolve("glGetBooleani_v");
+ GetFramebufferParameteriv = (void (QOPENGLF_APIENTRYP) (GLenum, GLenum, GLint*)) resolve("glGetFramebufferParameteriv");
+ GetMultisamplefv = (void (QOPENGLF_APIENTRYP) (GLenum, GLuint, GLfloat*)) resolve("glGetMultisamplefv");
+ GetProgramInterfaceiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLenum, GLint*)) resolve("glGetProgramInterfaceiv");
+ GetProgramPipelineInfoLog = (void (QOPENGLF_APIENTRYP) (GLuint, GLsizei, GLsizei*, GLchar*)) resolve("glGetProgramPipelineInfoLog");
+ GetProgramPipelineiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLint*)) resolve("glGetProgramPipelineiv");
+ GetProgramResourceIndex = (GLuint (QOPENGLF_APIENTRYP) (GLuint, GLenum, const GLchar *)) resolve("glGetProgramResourceIndex");
+ GetProgramResourceLocation = (GLint (QOPENGLF_APIENTRYP) (GLuint, GLenum, const GLchar *)) resolve("glGetProgramResourceLocation");
+ GetProgramResourceName = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLuint, GLsizei, GLsizei*, GLchar*)) resolve("glGetProgramResourceName");
+ GetProgramResourceiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLenum, GLuint, GLsizei, const GLenum *, GLsizei, GLsizei*, GLint*)) resolve("glGetProgramResourceiv");
+ GetTexLevelParameterfv = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLenum, GLfloat*)) resolve("glGetTexLevelParameterfv");
+ GetTexLevelParameteriv = (void (QOPENGLF_APIENTRYP) (GLenum, GLint, GLenum, GLint*)) resolve("glGetTexLevelParameteriv");
+ IsProgramPipeline = (GLboolean (QOPENGLF_APIENTRYP) (GLuint)) resolve("glIsProgramPipeline");
+ MemoryBarrierFunc = (void (QOPENGLF_APIENTRYP) (GLbitfield)) resolve("glMemoryBarrier");
+ MemoryBarrierByRegion = (void (QOPENGLF_APIENTRYP) (GLbitfield)) resolve("glMemoryBarrierByRegion");
+ ProgramUniform1f = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLfloat)) resolve("glProgramUniform1f");
+ ProgramUniform1fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLfloat *)) resolve("glProgramUniform1fv");
+ ProgramUniform1i = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLint)) resolve("glProgramUniform1i");
+ ProgramUniform1iv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLint *)) resolve("glProgramUniform1iv");
+ ProgramUniform1ui = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLuint)) resolve("glProgramUniform1ui");
+ ProgramUniform1uiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLuint *)) resolve("glProgramUniform1uiv");
+ ProgramUniform2f = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLfloat, GLfloat)) resolve("glProgramUniform2f");
+ ProgramUniform2fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLfloat *)) resolve("glProgramUniform2fv");
+ ProgramUniform2i = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLint, GLint)) resolve("glProgramUniform2i");
+ ProgramUniform2iv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLint *)) resolve("glProgramUniform2iv");
+ ProgramUniform2ui = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLuint, GLuint)) resolve("glProgramUniform2ui");
+ ProgramUniform2uiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLuint *)) resolve("glProgramUniform2uiv");
+ ProgramUniform3f = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLfloat, GLfloat, GLfloat)) resolve("glProgramUniform3f");
+ ProgramUniform3fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLfloat *)) resolve("glProgramUniform3fv");
+ ProgramUniform3i = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLint, GLint, GLint)) resolve("glProgramUniform3i");
+ ProgramUniform3iv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLint *)) resolve("glProgramUniform3iv");
+ ProgramUniform3ui = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLuint, GLuint, GLuint)) resolve("glProgramUniform3ui");
+ ProgramUniform3uiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLuint *)) resolve("glProgramUniform3uiv");
+ ProgramUniform4f = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat)) resolve("glProgramUniform4f");
+ ProgramUniform4fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLfloat *)) resolve("glProgramUniform4fv");
+ ProgramUniform4i = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLint, GLint, GLint, GLint)) resolve("glProgramUniform4i");
+ ProgramUniform4iv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLint *)) resolve("glProgramUniform4iv");
+ ProgramUniform4ui = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLuint, GLuint, GLuint, GLuint)) resolve("glProgramUniform4ui");
+ ProgramUniform4uiv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, const GLuint *)) resolve("glProgramUniform4uiv");
+ ProgramUniformMatrix2fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix2fv");
+ ProgramUniformMatrix2x3fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix2x3fv");
+ ProgramUniformMatrix2x4fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix2x4fv");
+ ProgramUniformMatrix3fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix3fv");
+ ProgramUniformMatrix3x2fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix3x2fv");
+ ProgramUniformMatrix3x4fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix3x4fv");
+ ProgramUniformMatrix4fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix4fv");
+ ProgramUniformMatrix4x2fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix4x2fv");
+ ProgramUniformMatrix4x3fv = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLsizei, GLboolean, const GLfloat *)) resolve("glProgramUniformMatrix4x3fv");
+ SampleMaski = (void (QOPENGLF_APIENTRYP) (GLuint, GLbitfield)) resolve("glSampleMaski");
+ TexStorage2DMultisample = (void (QOPENGLF_APIENTRYP) (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean)) resolve("glTexStorage2DMultisample");
+ UseProgramStages = (void (QOPENGLF_APIENTRYP) (GLuint, GLbitfield, GLuint)) resolve("glUseProgramStages");
+ ValidateProgramPipeline = (void (QOPENGLF_APIENTRYP) (GLuint)) resolve("glValidateProgramPipeline");
+ VertexAttribBinding = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint)) resolve("glVertexAttribBinding");
+ VertexAttribFormat = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLenum, GLboolean, GLuint)) resolve("glVertexAttribFormat");
+ VertexAttribIFormat = (void (QOPENGLF_APIENTRYP) (GLuint, GLint, GLenum, GLuint)) resolve("glVertexAttribIFormat");
+ VertexBindingDivisor = (void (QOPENGLF_APIENTRYP) (GLuint, GLuint)) resolve("glVertexBindingDivisor");
+
+ if (!ActiveShaderProgram || !BindImageTexture || !DispatchCompute || !DrawArraysIndirect
+ || !GenProgramPipelines || !MemoryBarrierFunc) {
+ qWarning("OpenGL ES 3.1 entry points not found. This is odd because the driver returned a context of version %d.%d",
+ contextVersion.first, contextVersion.second);
+ return;
+ }
+ m_supportedVersion = qMakePair(3, 1);
+ }
+ } else {
+ qFatal("Failed to load libGLESv2");
+ }
+}
+
+// GLES 3.0 and 3.1
+
+// Checks for true OpenGL ES 3.x. OpenGL with GL_ARB_ES3_compatibility
+// does not count because there the plain resolvers work anyhow.
+static inline bool isES3(int minor)
+{
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+
+ const bool libMatches = QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES;
+ const bool contextMatches = ctx->isOpenGLES() && ctx->format().version() >= qMakePair(3, minor);
+
+ // Resolving happens whenever qgles3Helper() is called first. So do it only
+ // when the driver gives a 3.0+ context.
+ if (libMatches && contextMatches)
+ return qgles3Helper()->supportedVersion() >= qMakePair(3, minor);
+
+ return false;
+}
+
+// Go through the dlsym-based helper for real ES 3, resolve using
+// wglGetProcAddress or similar when on plain OpenGL.
+
+static void QOPENGLF_APIENTRY qopenglfResolveBeginQuery(GLenum target, GLuint id)
+{
+ if (isES3(0))
+ qgles3Helper()->BeginQuery(target, id);
+ else
+ RESOLVE_FUNC_VOID(0, BeginQuery)(target, id);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBeginTransformFeedback(GLenum primitiveMode)
+{
+ if (isES3(0))
+ qgles3Helper()->BeginTransformFeedback(primitiveMode);
+ else
+ RESOLVE_FUNC_VOID(0, BeginTransformFeedback)(primitiveMode);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+{
+ if (isES3(0))
+ qgles3Helper()->BindBufferBase(target, index, buffer);
+ else
+ RESOLVE_FUNC_VOID(0, BindBufferBase)(target, index, buffer);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+ if (isES3(0))
+ qgles3Helper()->BindBufferRange(target, index, buffer, offset, size);
+ else
+ RESOLVE_FUNC_VOID(0, BindBufferRange)(target, index, buffer, offset, size);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindSampler(GLuint unit, GLuint sampler)
+{
+ if (isES3(0))
+ qgles3Helper()->BindSampler(unit, sampler);
+ else
+ RESOLVE_FUNC_VOID(0, BindSampler)(unit, sampler);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindTransformFeedback(GLenum target, GLuint id)
+{
+ if (isES3(0))
+ qgles3Helper()->BindTransformFeedback(target, id);
+ else
+ RESOLVE_FUNC_VOID(0, BindTransformFeedback)(target, id);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindVertexArray(GLuint array)
+{
+ if (isES3(0))
+ qgles3Helper()->BindVertexArray(array);
+ else
+ RESOLVE_FUNC_VOID(0, BindVertexArray)(array);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ if (isES3(0))
+ qgles3Helper()->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+ else
+ RESOLVE_FUNC_VOID(ResolveEXT | ResolveANGLE | ResolveNV, BlitFramebuffer)
+ (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
+{
+ if (isES3(0))
+ qgles3Helper()->ClearBufferfi(buffer, drawbuffer, depth, stencil);
+ else
+ RESOLVE_FUNC_VOID(0, ClearBufferfi)(buffer, drawbuffer, depth, stencil);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->ClearBufferfv(buffer, drawbuffer, value);
+ else
+ RESOLVE_FUNC_VOID(0, ClearBufferfv)(buffer, drawbuffer, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint * value)
+{
+ if (isES3(0))
+ qgles3Helper()->ClearBufferiv(buffer, drawbuffer, value);
+ else
+ RESOLVE_FUNC_VOID(0, ClearBufferiv)(buffer, drawbuffer, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint * value)
+{
+ if (isES3(0))
+ qgles3Helper()->ClearBufferuiv(buffer, drawbuffer, value);
+ else
+ RESOLVE_FUNC_VOID(0, ClearBufferuiv)(buffer, drawbuffer, value);
+}
+
+static GLenum QOPENGLF_APIENTRY qopenglfResolveClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ if (isES3(0))
+ return qgles3Helper()->ClientWaitSync(sync, flags, timeout);
+ else
+ RESOLVE_FUNC(GLenum, 0, ClientWaitSync)(sync, flags, timeout);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data)
+{
+ if (isES3(0))
+ qgles3Helper()->CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
+ else
+ RESOLVE_FUNC_VOID(0, CompressedTexImage3D)(target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data)
+{
+ if (isES3(0))
+ qgles3Helper()->CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+ else
+ RESOLVE_FUNC_VOID(0, CompressedTexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
+{
+ if (isES3(0))
+ qgles3Helper()->CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
+ else
+ RESOLVE_FUNC_VOID(0, CopyBufferSubData)(readTarget, writeTarget, readOffset, writeOffset, size);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ if (isES3(0))
+ qgles3Helper()->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+ else
+ RESOLVE_FUNC_VOID(0, CopyTexSubImage3D)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDeleteQueries(GLsizei n, const GLuint * ids)
+{
+ if (isES3(0))
+ qgles3Helper()->DeleteQueries(n, ids);
+ else
+ RESOLVE_FUNC_VOID(0, DeleteQueries)(n, ids);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDeleteSamplers(GLsizei count, const GLuint * samplers)
+{
+ if (isES3(0))
+ qgles3Helper()->DeleteSamplers(count, samplers);
+ else
+ RESOLVE_FUNC_VOID(0, DeleteSamplers)(count, samplers);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDeleteSync(GLsync sync)
+{
+ if (isES3(0))
+ qgles3Helper()->DeleteSync(sync);
+ else
+ RESOLVE_FUNC_VOID(0, DeleteSync)(sync);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDeleteTransformFeedbacks(GLsizei n, const GLuint * ids)
+{
+ if (isES3(0))
+ qgles3Helper()->DeleteTransformFeedbacks(n, ids);
+ else
+ RESOLVE_FUNC_VOID(0, DeleteTransformFeedbacks)(n, ids);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDeleteVertexArrays(GLsizei n, const GLuint * arrays)
+{
+ if (isES3(0))
+ qgles3Helper()->DeleteVertexArrays(n, arrays);
+ else
+ RESOLVE_FUNC_VOID(0, DeleteVertexArrays)(n, arrays);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount)
+{
+ if (isES3(0))
+ qgles3Helper()->DrawArraysInstanced(mode, first, count, instancecount);
+ else
+ RESOLVE_FUNC_VOID(0, DrawArraysInstanced)(mode, first, count, instancecount);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDrawBuffers(GLsizei n, const GLenum * bufs)
+{
+ if (isES3(0))
+ qgles3Helper()->DrawBuffers(n, bufs);
+ else
+ RESOLVE_FUNC_VOID(0, DrawBuffers)(n, bufs);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount)
+{
+ if (isES3(0))
+ qgles3Helper()->DrawElementsInstanced(mode, count, type, indices, instancecount);
+ else
+ RESOLVE_FUNC_VOID(0, DrawElementsInstanced)(mode, count, type, indices, instancecount);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices)
+{
+ if (isES3(0))
+ qgles3Helper()->DrawRangeElements(mode, start, end, count, type, indices);
+ else
+ RESOLVE_FUNC_VOID(0, DrawRangeElements)(mode, start, end, count, type, indices);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveEndQuery(GLenum target)
+{
+ if (isES3(0))
+ qgles3Helper()->EndQuery(target);
+ else
+ RESOLVE_FUNC_VOID(0, EndQuery)(target);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveEndTransformFeedback()
+{
+ if (isES3(0))
+ qgles3Helper()->EndTransformFeedback();
+ else
+ RESOLVE_FUNC_VOID(0, EndTransformFeedback)();
+}
+
+static GLsync QOPENGLF_APIENTRY qopenglfResolveFenceSync(GLenum condition, GLbitfield flags)
+{
+ if (isES3(0))
+ return qgles3Helper()->FenceSync(condition, flags);
+ else
+ RESOLVE_FUNC(GLsync, 0, FenceSync)(condition, flags);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+ if (isES3(0))
+ qgles3Helper()->FlushMappedBufferRange(target, offset, length);
+ else
+ RESOLVE_FUNC_VOID(0, FlushMappedBufferRange)(target, offset, length);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+ if (isES3(0))
+ qgles3Helper()->FramebufferTextureLayer(target, attachment, texture, level, layer);
+ else
+ RESOLVE_FUNC_VOID(0, FramebufferTextureLayer)(target, attachment, texture, level, layer);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGenQueries(GLsizei n, GLuint* ids)
+{
+ if (isES3(0))
+ qgles3Helper()->GenQueries(n, ids);
+ else
+ RESOLVE_FUNC_VOID(0, GenQueries)(n, ids);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGenSamplers(GLsizei count, GLuint* samplers)
+{
+ if (isES3(0))
+ qgles3Helper()->GenSamplers(count, samplers);
+ else
+ RESOLVE_FUNC_VOID(0, GenSamplers)(count, samplers);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGenTransformFeedbacks(GLsizei n, GLuint* ids)
+{
+ if (isES3(0))
+ qgles3Helper()->GenTransformFeedbacks(n, ids);
+ else
+ RESOLVE_FUNC_VOID(0, GenTransformFeedbacks)(n, ids);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGenVertexArrays(GLsizei n, GLuint* arrays)
+{
+ if (isES3(0))
+ qgles3Helper()->GenVertexArrays(n, arrays);
+ else
+ RESOLVE_FUNC_VOID(0, GenVertexArrays)(n, arrays);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+{
+ if (isES3(0))
+ qgles3Helper()->GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
+ else
+ RESOLVE_FUNC_VOID(0, GetActiveUniformBlockName)(program, uniformBlockIndex, bufSize, length, uniformBlockName);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetActiveUniformBlockiv)(program, uniformBlockIndex, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetActiveUniformsiv)(program, uniformCount, uniformIndices, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetBufferParameteri64v(target, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetBufferParameteri64v)(target, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetBufferPointerv(GLenum target, GLenum pname, void ** params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetBufferPointerv(target, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetBufferPointerv)(target, pname, params);
+}
+
+static GLint QOPENGLF_APIENTRY qopenglfResolveGetFragDataLocation(GLuint program, const GLchar * name)
+{
+ if (isES3(0))
+ return qgles3Helper()->GetFragDataLocation(program, name);
+ else
+ RESOLVE_FUNC(GLint, 0, GetFragDataLocation)(program, name);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+{
+ if (isES3(0))
+ qgles3Helper()->GetInteger64i_v(target, index, data);
+ else
+ RESOLVE_FUNC_VOID(0, GetInteger64i_v)(target, index, data);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetInteger64v(GLenum pname, GLint64* data)
+{
+ if (isES3(0))
+ qgles3Helper()->GetInteger64v(pname, data);
+ else
+ RESOLVE_FUNC_VOID(0, GetInteger64v)(pname, data);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetIntegeri_v(GLenum target, GLuint index, GLint* data)
+{
+ if (isES3(0))
+ qgles3Helper()->GetIntegeri_v(target, index, data);
+ else
+ RESOLVE_FUNC_VOID(0, GetIntegeri_v)(target, index, data);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetInternalformativ(target, internalformat, pname, bufSize, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetInternalformativ)(target, internalformat, pname, bufSize, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void * binary)
+{
+ if (isES3(0))
+ qgles3Helper()->GetProgramBinary(program, bufSize, length, binaryFormat, binary);
+ else
+ RESOLVE_FUNC_VOID(0, GetProgramBinary)(program, bufSize, length, binaryFormat, binary);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetQueryObjectuiv(id, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetQueryObjectuiv)(id, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetQueryiv(GLenum target, GLenum pname, GLint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetQueryiv(target, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetQueryiv)(target, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetSamplerParameterfv(sampler, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetSamplerParameterfv)(sampler, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetSamplerParameteriv(sampler, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetSamplerParameteriv)(sampler, pname, params);
+}
+
+static const GLubyte * QOPENGLF_APIENTRY qopenglfResolveGetStringi(GLenum name, GLuint index)
+{
+ if (isES3(0))
+ return qgles3Helper()->GetStringi(name, index);
+ else
+ RESOLVE_FUNC(const GLubyte *, 0, GetStringi)(name, index);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+ if (isES3(0))
+ qgles3Helper()->GetSynciv(sync, pname, bufSize, length, values);
+ else
+ RESOLVE_FUNC_VOID(0, GetSynciv)(sync, pname, bufSize, length, values);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
+{
+ if (isES3(0))
+ qgles3Helper()->GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
+ else
+ RESOLVE_FUNC_VOID(0, GetTransformFeedbackVarying)(program, index, bufSize, length, size, type, name);
+}
+
+static GLuint QOPENGLF_APIENTRY qopenglfResolveGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName)
+{
+ if (isES3(0))
+ return qgles3Helper()->GetUniformBlockIndex(program, uniformBlockName);
+ else
+ RESOLVE_FUNC(GLuint, 0, GetUniformBlockIndex)(program, uniformBlockName);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint* uniformIndices)
+{
+ if (isES3(0))
+ qgles3Helper()->GetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
+ else
+ RESOLVE_FUNC_VOID(0, GetUniformIndices)(program, uniformCount, uniformNames, uniformIndices);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetUniformuiv(GLuint program, GLint location, GLuint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetUniformuiv(program, location, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetUniformuiv)(program, location, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetVertexAttribIiv(index, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetVertexAttribIiv)(index, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+{
+ if (isES3(0))
+ qgles3Helper()->GetVertexAttribIuiv(index, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetVertexAttribIuiv)(index, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments)
+{
+ if (isES3(0))
+ qgles3Helper()->InvalidateFramebuffer(target, numAttachments, attachments);
+ else
+ RESOLVE_FUNC_VOID(0, InvalidateFramebuffer)(target, numAttachments, attachments);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ if (isES3(0))
+ qgles3Helper()->InvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
+ else
+ RESOLVE_FUNC_VOID(0, InvalidateSubFramebuffer)(target, numAttachments, attachments, x, y, width, height);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsQuery(GLuint id)
+{
+ if (isES3(0))
+ return qgles3Helper()->IsQuery(id);
+ else
+ RESOLVE_FUNC(GLboolean, 0, IsQuery)(id);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsSampler(GLuint sampler)
+{
+ if (isES3(0))
+ return qgles3Helper()->IsSampler(sampler);
+ else
+ RESOLVE_FUNC(GLboolean, 0, IsSampler)(sampler);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsSync(GLsync sync)
+{
+ if (isES3(0))
+ return qgles3Helper()->IsSync(sync);
+ else
+ RESOLVE_FUNC(GLboolean, 0, IsSync)(sync);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsTransformFeedback(GLuint id)
+{
+ if (isES3(0))
+ return qgles3Helper()->IsTransformFeedback(id);
+ else
+ RESOLVE_FUNC(GLboolean, 0, IsTransformFeedback)(id);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsVertexArray(GLuint array)
+{
+ if (isES3(0))
+ return qgles3Helper()->IsVertexArray(array);
+ else
+ RESOLVE_FUNC(GLboolean, 0, IsVertexArray)(array);
+}
+
+static void * QOPENGLF_APIENTRY qopenglfResolveMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+ if (isES3(0))
+ return qgles3Helper()->MapBufferRange(target, offset, length, access);
+ else
+ RESOLVE_FUNC(void *, 0, MapBufferRange)(target, offset, length, access);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolvePauseTransformFeedback()
+{
+ if (isES3(0))
+ qgles3Helper()->PauseTransformFeedback();
+ else
+ RESOLVE_FUNC_VOID(0, PauseTransformFeedback)();
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length)
+{
+ if (isES3(0))
+ qgles3Helper()->ProgramBinary(program, binaryFormat, binary, length);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramBinary)(program, binaryFormat, binary, length);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramParameteri(GLuint program, GLenum pname, GLint value)
+{
+ if (isES3(0))
+ qgles3Helper()->ProgramParameteri(program, pname, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramParameteri)(program, pname, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveReadBuffer(GLenum src)
+{
+ if (isES3(0))
+ qgles3Helper()->ReadBuffer(src);
+ else
+ RESOLVE_FUNC_VOID(0, ReadBuffer)(src);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ if (isES3(0))
+ qgles3Helper()->RenderbufferStorageMultisample(target, samples, internalformat, width, height);
+ else
+ RESOLVE_FUNC_VOID(ResolveEXT | ResolveANGLE | ResolveNV, RenderbufferStorageMultisample)
+ (target, samples, internalformat, width, height);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveResumeTransformFeedback()
+{
+ if (isES3(0))
+ qgles3Helper()->ResumeTransformFeedback();
+ else
+ RESOLVE_FUNC_VOID(0, ResumeTransformFeedback)();
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+{
+ if (isES3(0))
+ qgles3Helper()->SamplerParameterf(sampler, pname, param);
+ else
+ RESOLVE_FUNC_VOID(0, SamplerParameterf)(sampler, pname, param);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * param)
+{
+ if (isES3(0))
+ qgles3Helper()->SamplerParameterfv(sampler, pname, param);
+ else
+ RESOLVE_FUNC_VOID(0, SamplerParameterfv)(sampler, pname, param);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+{
+ if (isES3(0))
+ qgles3Helper()->SamplerParameteri(sampler, pname, param);
+ else
+ RESOLVE_FUNC_VOID(0, SamplerParameteri)(sampler, pname, param);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * param)
+{
+ if (isES3(0))
+ qgles3Helper()->SamplerParameteriv(sampler, pname, param);
+ else
+ RESOLVE_FUNC_VOID(0, SamplerParameteriv)(sampler, pname, param);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels)
+{
+ if (isES3(0))
+ qgles3Helper()->TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
+ else
+ RESOLVE_FUNC_VOID(0, TexImage3D)(target, level, internalformat, width, height, depth, border, format, type, pixels);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ if (isES3(0))
+ qgles3Helper()->TexStorage2D(target, levels, internalformat, width, height);
+ else
+ RESOLVE_FUNC_VOID(0, TexStorage2D)(target, levels, internalformat, width, height);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+ if (isES3(0))
+ qgles3Helper()->TexStorage3D(target, levels, internalformat, width, height, depth);
+ else
+ RESOLVE_FUNC_VOID(0, TexStorage3D)(target, levels, internalformat, width, height, depth);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels)
+{
+ if (isES3(0))
+ qgles3Helper()->TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+ else
+ RESOLVE_FUNC_VOID(0, TexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode)
+{
+ if (isES3(0))
+ qgles3Helper()->TransformFeedbackVaryings(program, count, varyings, bufferMode);
+ else
+ RESOLVE_FUNC_VOID(0, TransformFeedbackVaryings)(program, count, varyings, bufferMode);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform1ui(GLint location, GLuint v0)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform1ui(location, v0);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform1ui)(location, v0);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform1uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform1uiv(location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform1uiv)(location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform2ui(GLint location, GLuint v0, GLuint v1)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform2ui(location, v0, v1);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform2ui)(location, v0, v1);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform2uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform2uiv(location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform2uiv)(location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform3ui(location, v0, v1, v2);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform3ui)(location, v0, v1, v2);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform3uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform3uiv(location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform3uiv)(location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform4ui(location, v0, v1, v2, v3);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform4ui)(location, v0, v1, v2, v3);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniform4uiv(GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(0))
+ qgles3Helper()->Uniform4uiv(location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, Uniform4uiv)(location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
+ else
+ RESOLVE_FUNC_VOID(0, UniformBlockBinding)(program, uniformBlockIndex, uniformBlockBinding);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformMatrix2x3fv(location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, UniformMatrix2x3fv)(location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformMatrix2x4fv(location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, UniformMatrix2x4fv)(location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformMatrix3x2fv(location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, UniformMatrix3x2fv)(location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformMatrix3x4fv(location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, UniformMatrix3x4fv)(location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformMatrix4x2fv(location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, UniformMatrix4x2fv)(location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(0))
+ qgles3Helper()->UniformMatrix4x3fv(location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, UniformMatrix4x3fv)(location, count, transpose, value);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveUnmapBuffer(GLenum target)
+{
+ if (isES3(0))
+ return qgles3Helper()->UnmapBuffer(target);
+ else
+ RESOLVE_FUNC(GLboolean, ResolveOES, UnmapBuffer)(target);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribDivisor(GLuint index, GLuint divisor)
+{
+ if (isES3(0))
+ qgles3Helper()->VertexAttribDivisor(index, divisor);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribDivisor)(index, divisor);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ if (isES3(0))
+ qgles3Helper()->VertexAttribI4i(index, x, y, z, w);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribI4i)(index, x, y, z, w);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribI4iv(GLuint index, const GLint * v)
+{
+ if (isES3(0))
+ qgles3Helper()->VertexAttribI4iv(index, v);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribI4iv)(index, v);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
+{
+ if (isES3(0))
+ qgles3Helper()->VertexAttribI4ui(index, x, y, z, w);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribI4ui)(index, x, y, z, w);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribI4uiv(GLuint index, const GLuint * v)
+{
+ if (isES3(0))
+ qgles3Helper()->VertexAttribI4uiv(index, v);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribI4uiv)(index, v);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer)
+{
+ if (isES3(0))
+ qgles3Helper()->VertexAttribIPointer(index, size, type, stride, pointer);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribIPointer)(index, size, type, stride, pointer);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ if (isES3(0))
+ qgles3Helper()->WaitSync(sync, flags, timeout);
+ else
+ RESOLVE_FUNC_VOID(0, WaitSync)(sync, flags, timeout);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveActiveShaderProgram(GLuint pipeline, GLuint program)
+{
+ if (isES3(1))
+ qgles3Helper()->ActiveShaderProgram(pipeline, program);
+ else
+ RESOLVE_FUNC_VOID(0, ActiveShaderProgram)(pipeline, program);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+ if (isES3(1))
+ qgles3Helper()->BindImageTexture(unit, texture, level, layered, layer, access, format);
+ else
+ RESOLVE_FUNC_VOID(0, BindImageTexture)(unit, texture, level, layered, layer, access, format);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindProgramPipeline(GLuint pipeline)
+{
+ if (isES3(1))
+ qgles3Helper()->BindProgramPipeline(pipeline);
+ else
+ RESOLVE_FUNC_VOID(0, BindProgramPipeline)(pipeline);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
+{
+ if (isES3(1))
+ qgles3Helper()->BindVertexBuffer(bindingindex, buffer, offset, stride);
+ else
+ RESOLVE_FUNC_VOID(0, BindVertexBuffer)(bindingindex, buffer, offset, stride);
+}
+
+static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const* strings)
+{
+ if (isES3(1))
+ return qgles3Helper()->CreateShaderProgramv(type, count, strings);
+ else
+ RESOLVE_FUNC(GLuint, 0, CreateShaderProgramv)(type, count, strings);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDeleteProgramPipelines(GLsizei n, const GLuint * pipelines)
+{
+ if (isES3(1))
+ qgles3Helper()->DeleteProgramPipelines(n, pipelines);
+ else
+ RESOLVE_FUNC_VOID(0, DeleteProgramPipelines)(n, pipelines);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+ if (isES3(1))
+ qgles3Helper()->DispatchCompute(num_groups_x, num_groups_y, num_groups_z);
+ else
+ RESOLVE_FUNC_VOID(0, DispatchCompute)(num_groups_x, num_groups_y, num_groups_z);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDispatchComputeIndirect(GLintptr indirect)
+{
+ if (isES3(1))
+ qgles3Helper()->DispatchComputeIndirect(indirect);
+ else
+ RESOLVE_FUNC_VOID(0, DispatchComputeIndirect)(indirect);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDrawArraysIndirect(GLenum mode, const void * indirect)
+{
+ if (isES3(1))
+ qgles3Helper()->DrawArraysIndirect(mode, indirect);
+ else
+ RESOLVE_FUNC_VOID(0, DrawArraysIndirect)(mode, indirect);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect)
+{
+ if (isES3(1))
+ qgles3Helper()->DrawElementsIndirect(mode, type, indirect);
+ else
+ RESOLVE_FUNC_VOID(0, DrawElementsIndirect)(mode, type, indirect);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveFramebufferParameteri(GLenum target, GLenum pname, GLint param)
+{
+ if (isES3(1))
+ qgles3Helper()->FramebufferParameteri(target, pname, param);
+ else
+ RESOLVE_FUNC_VOID(0, FramebufferParameteri)(target, pname, param);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGenProgramPipelines(GLsizei n, GLuint* pipelines)
+{
+ if (isES3(1))
+ qgles3Helper()->GenProgramPipelines(n, pipelines);
+ else
+ RESOLVE_FUNC_VOID(0, GenProgramPipelines)(n, pipelines);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetBooleani_v(GLenum target, GLuint index, GLboolean* data)
+{
+ if (isES3(1))
+ qgles3Helper()->GetBooleani_v(target, index, data);
+ else
+ RESOLVE_FUNC_VOID(0, GetBooleani_v)(target, index, data);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+ if (isES3(1))
+ qgles3Helper()->GetFramebufferParameteriv(target, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetFramebufferParameteriv)(target, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val)
+{
+ if (isES3(1))
+ qgles3Helper()->GetMultisamplefv(pname, index, val);
+ else
+ RESOLVE_FUNC_VOID(0, GetMultisamplefv)(pname, index, val);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+{
+ if (isES3(1))
+ qgles3Helper()->GetProgramInterfaceiv(program, programInterface, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetProgramInterfaceiv)(program, programInterface, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+{
+ if (isES3(1))
+ qgles3Helper()->GetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
+ else
+ RESOLVE_FUNC_VOID(0, GetProgramPipelineInfoLog)(pipeline, bufSize, length, infoLog);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params)
+{
+ if (isES3(1))
+ qgles3Helper()->GetProgramPipelineiv(pipeline, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetProgramPipelineiv)(pipeline, pname, params);
+}
+
+static GLuint QOPENGLF_APIENTRY qopenglfResolveGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name)
+{
+ if (isES3(1))
+ return qgles3Helper()->GetProgramResourceIndex(program, programInterface, name);
+ else
+ RESOLVE_FUNC(GLuint, 0, GetProgramResourceIndex)(program, programInterface, name);
+}
+
+static GLint QOPENGLF_APIENTRY qopenglfResolveGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name)
+{
+ if (isES3(1))
+ return qgles3Helper()->GetProgramResourceLocation(program, programInterface, name);
+ else
+ RESOLVE_FUNC(GLint, 0, GetProgramResourceLocation)(program, programInterface, name);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar* name)
+{
+ if (isES3(1))
+ qgles3Helper()->GetProgramResourceName(program, programInterface, index, bufSize, length, name);
+ else
+ RESOLVE_FUNC_VOID(0, GetProgramResourceName)(program, programInterface, index, bufSize, length, name);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei* length, GLint* params)
+{
+ if (isES3(1))
+ qgles3Helper()->GetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetProgramResourceiv)(program, programInterface, index, propCount, props, bufSize, length, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params)
+{
+ if (isES3(1))
+ qgles3Helper()->GetTexLevelParameterfv(target, level, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetTexLevelParameterfv)(target, level, pname, params);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
+{
+ if (isES3(1))
+ qgles3Helper()->GetTexLevelParameteriv(target, level, pname, params);
+ else
+ RESOLVE_FUNC_VOID(0, GetTexLevelParameteriv)(target, level, pname, params);
+}
+
+static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsProgramPipeline(GLuint pipeline)
+{
+ if (isES3(1))
+ return qgles3Helper()->IsProgramPipeline(pipeline);
+ else
+ RESOLVE_FUNC(GLboolean, 0, IsProgramPipeline)(pipeline);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveMemoryBarrier(GLbitfield barriers)
+{
+ if (isES3(1))
+ qgles3Helper()->MemoryBarrierFunc(barriers);
+ else
+ RESOLVE_FUNC_VOID(0, MemoryBarrierFunc)(barriers);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveMemoryBarrierByRegion(GLbitfield barriers)
+{
+ if (isES3(1))
+ qgles3Helper()->MemoryBarrierByRegion(barriers);
+ else
+ RESOLVE_FUNC_VOID(0, MemoryBarrierByRegion)(barriers);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform1f(GLuint program, GLint location, GLfloat v0)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform1f(program, location, v0);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform1f)(program, location, v0);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform1fv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform1fv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform1i(GLuint program, GLint location, GLint v0)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform1i(program, location, v0);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform1i)(program, location, v0);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform1iv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform1iv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform1ui(GLuint program, GLint location, GLuint v0)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform1ui(program, location, v0);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform1ui)(program, location, v0);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform1uiv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform1uiv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform2f(program, location, v0, v1);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform2f)(program, location, v0, v1);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform2fv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform2fv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform2i(program, location, v0, v1);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform2i)(program, location, v0, v1);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform2iv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform2iv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform2ui(program, location, v0, v1);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform2ui)(program, location, v0, v1);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform2uiv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform2uiv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform3f(program, location, v0, v1, v2);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform3f)(program, location, v0, v1, v2);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform3fv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform3fv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform3i(program, location, v0, v1, v2);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform3i)(program, location, v0, v1, v2);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform3iv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform3iv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform3ui(program, location, v0, v1, v2);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform3ui)(program, location, v0, v1, v2);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform3uiv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform3uiv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform4f(program, location, v0, v1, v2, v3);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform4f)(program, location, v0, v1, v2, v3);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform4fv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform4fv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform4i(program, location, v0, v1, v2, v3);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform4i)(program, location, v0, v1, v2, v3);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform4iv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform4iv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform4ui(program, location, v0, v1, v2, v3);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform4ui)(program, location, v0, v1, v2, v3);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniform4uiv(program, location, count, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniform4uiv)(program, location, count, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix2fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix2fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix2x3fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix2x3fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix2x4fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix2x4fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix3fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix3fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix3x2fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix3x2fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix3x4fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix3x4fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix4fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix4fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix4x2fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix4x2fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
+{
+ if (isES3(1))
+ qgles3Helper()->ProgramUniformMatrix4x3fv(program, location, count, transpose, value);
+ else
+ RESOLVE_FUNC_VOID(0, ProgramUniformMatrix4x3fv)(program, location, count, transpose, value);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveSampleMaski(GLuint maskNumber, GLbitfield mask)
+{
+ if (isES3(1))
+ qgles3Helper()->SampleMaski(maskNumber, mask);
+ else
+ RESOLVE_FUNC_VOID(0, SampleMaski)(maskNumber, mask);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+ if (isES3(1))
+ qgles3Helper()->TexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
+ else
+ RESOLVE_FUNC_VOID(0, TexStorage2DMultisample)(target, samples, internalformat, width, height, fixedsamplelocations);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+ if (isES3(1))
+ qgles3Helper()->UseProgramStages(pipeline, stages, program);
+ else
+ RESOLVE_FUNC_VOID(0, UseProgramStages)(pipeline, stages, program);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveValidateProgramPipeline(GLuint pipeline)
+{
+ if (isES3(1))
+ qgles3Helper()->ValidateProgramPipeline(pipeline);
+ else
+ RESOLVE_FUNC_VOID(0, ValidateProgramPipeline)(pipeline);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
+{
+ if (isES3(1))
+ qgles3Helper()->VertexAttribBinding(attribindex, bindingindex);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribBinding)(attribindex, bindingindex);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+ if (isES3(1))
+ qgles3Helper()->VertexAttribFormat(attribindex, size, type, normalized, relativeoffset);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribFormat)(attribindex, size, type, normalized, relativeoffset);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+ if (isES3(1))
+ qgles3Helper()->VertexAttribIFormat(attribindex, size, type, relativeoffset);
+ else
+ RESOLVE_FUNC_VOID(0, VertexAttribIFormat)(attribindex, size, type, relativeoffset);
+}
+
+static void QOPENGLF_APIENTRY qopenglfResolveVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
+{
+ if (isES3(1))
+ qgles3Helper()->VertexBindingDivisor(bindingindex, divisor);
+ else
+ RESOLVE_FUNC_VOID(0, VertexBindingDivisor)(bindingindex, divisor);
+}
+
+/*!
+ Constructs a default function resolver. The resolver cannot be used until
+ \l {QOpenGLFunctions::}{initializeOpenGLFunctions()} is called to specify
+ the context.
+*/
+QOpenGLExtraFunctions::QOpenGLExtraFunctions()
+{
+}
+
+/*!
+ Constructs a function resolver for context. If \a context is null, then
+ the resolver will be created for the current QOpenGLContext.
+
+ The context or another context in the group must be current.
+
+ An object constructed in this way can only be used with context and other
+ contexts that share with it. Use \l {QOpenGLFunctions::}
+ {initializeOpenGLFunctions()} to change the object's context association.
+*/
+QOpenGLExtraFunctions::QOpenGLExtraFunctions(QOpenGLContext *context)
+ : QOpenGLFunctions(context)
+{
+}
+
+QOpenGLExtraFunctionsPrivate::QOpenGLExtraFunctionsPrivate(QOpenGLContext *ctx)
+ : QOpenGLFunctionsPrivate(ctx)
+{
+ ReadBuffer = qopenglfResolveReadBuffer;
+ DrawRangeElements = qopenglfResolveDrawRangeElements;
+ TexImage3D = qopenglfResolveTexImage3D;
+ TexSubImage3D = qopenglfResolveTexSubImage3D;
+ CopyTexSubImage3D = qopenglfResolveCopyTexSubImage3D;
+ CompressedTexImage3D = qopenglfResolveCompressedTexImage3D;
+ CompressedTexSubImage3D = qopenglfResolveCompressedTexSubImage3D;
+ GenQueries = qopenglfResolveGenQueries;
+ DeleteQueries = qopenglfResolveDeleteQueries;
+ IsQuery = qopenglfResolveIsQuery;
+ BeginQuery = qopenglfResolveBeginQuery;
+ EndQuery = qopenglfResolveEndQuery;
+ GetQueryiv = qopenglfResolveGetQueryiv;
+ GetQueryObjectuiv = qopenglfResolveGetQueryObjectuiv;
UnmapBuffer = qopenglfResolveUnmapBuffer;
+ GetBufferPointerv = qopenglfResolveGetBufferPointerv;
+ DrawBuffers = qopenglfResolveDrawBuffers;
+ UniformMatrix2x3fv = qopenglfResolveUniformMatrix2x3fv;
+ UniformMatrix3x2fv = qopenglfResolveUniformMatrix3x2fv;
+ UniformMatrix2x4fv = qopenglfResolveUniformMatrix2x4fv;
+ UniformMatrix4x2fv = qopenglfResolveUniformMatrix4x2fv;
+ UniformMatrix3x4fv = qopenglfResolveUniformMatrix3x4fv;
+ UniformMatrix4x3fv = qopenglfResolveUniformMatrix4x3fv;
BlitFramebuffer = qopenglfResolveBlitFramebuffer;
RenderbufferStorageMultisample = qopenglfResolveRenderbufferStorageMultisample;
+ FramebufferTextureLayer = qopenglfResolveFramebufferTextureLayer;
+ MapBufferRange = qopenglfResolveMapBufferRange;
+ FlushMappedBufferRange = qopenglfResolveFlushMappedBufferRange;
+ BindVertexArray = qopenglfResolveBindVertexArray;
+ DeleteVertexArrays = qopenglfResolveDeleteVertexArrays;
+ GenVertexArrays = qopenglfResolveGenVertexArrays;
+ IsVertexArray = qopenglfResolveIsVertexArray;
+ GetIntegeri_v = qopenglfResolveGetIntegeri_v;
+ BeginTransformFeedback = qopenglfResolveBeginTransformFeedback;
+ EndTransformFeedback = qopenglfResolveEndTransformFeedback;
+ BindBufferRange = qopenglfResolveBindBufferRange;
+ BindBufferBase = qopenglfResolveBindBufferBase;
+ TransformFeedbackVaryings = qopenglfResolveTransformFeedbackVaryings;
+ GetTransformFeedbackVarying = qopenglfResolveGetTransformFeedbackVarying;
+ VertexAttribIPointer = qopenglfResolveVertexAttribIPointer;
+ GetVertexAttribIiv = qopenglfResolveGetVertexAttribIiv;
+ GetVertexAttribIuiv = qopenglfResolveGetVertexAttribIuiv;
+ VertexAttribI4i = qopenglfResolveVertexAttribI4i;
+ VertexAttribI4ui = qopenglfResolveVertexAttribI4ui;
+ VertexAttribI4iv = qopenglfResolveVertexAttribI4iv;
+ VertexAttribI4uiv = qopenglfResolveVertexAttribI4uiv;
+ GetUniformuiv = qopenglfResolveGetUniformuiv;
+ GetFragDataLocation = qopenglfResolveGetFragDataLocation;
+ Uniform1ui = qopenglfResolveUniform1ui;
+ Uniform2ui = qopenglfResolveUniform2ui;
+ Uniform3ui = qopenglfResolveUniform3ui;
+ Uniform4ui = qopenglfResolveUniform4ui;
+ Uniform1uiv = qopenglfResolveUniform1uiv;
+ Uniform2uiv = qopenglfResolveUniform2uiv;
+ Uniform3uiv = qopenglfResolveUniform3uiv;
+ Uniform4uiv = qopenglfResolveUniform4uiv;
+ ClearBufferiv = qopenglfResolveClearBufferiv;
+ ClearBufferuiv = qopenglfResolveClearBufferuiv;
+ ClearBufferfv = qopenglfResolveClearBufferfv;
+ ClearBufferfi = qopenglfResolveClearBufferfi;
+ GetStringi = qopenglfResolveGetStringi;
+ CopyBufferSubData = qopenglfResolveCopyBufferSubData;
+ GetUniformIndices = qopenglfResolveGetUniformIndices;
+ GetActiveUniformsiv = qopenglfResolveGetActiveUniformsiv;
+ GetUniformBlockIndex = qopenglfResolveGetUniformBlockIndex;
+ GetActiveUniformBlockiv = qopenglfResolveGetActiveUniformBlockiv;
+ GetActiveUniformBlockName = qopenglfResolveGetActiveUniformBlockName;
+ UniformBlockBinding = qopenglfResolveUniformBlockBinding;
+ DrawArraysInstanced = qopenglfResolveDrawArraysInstanced;
+ DrawElementsInstanced = qopenglfResolveDrawElementsInstanced;
+ FenceSync = qopenglfResolveFenceSync;
+ IsSync = qopenglfResolveIsSync;
+ DeleteSync = qopenglfResolveDeleteSync;
+ ClientWaitSync = qopenglfResolveClientWaitSync;
+ WaitSync = qopenglfResolveWaitSync;
+ GetInteger64v = qopenglfResolveGetInteger64v;
+ GetSynciv = qopenglfResolveGetSynciv;
+ GetInteger64i_v = qopenglfResolveGetInteger64i_v;
+ GetBufferParameteri64v = qopenglfResolveGetBufferParameteri64v;
+ GenSamplers = qopenglfResolveGenSamplers;
+ DeleteSamplers = qopenglfResolveDeleteSamplers;
+ IsSampler = qopenglfResolveIsSampler;
+ BindSampler = qopenglfResolveBindSampler;
+ SamplerParameteri = qopenglfResolveSamplerParameteri;
+ SamplerParameteriv = qopenglfResolveSamplerParameteriv;
+ SamplerParameterf = qopenglfResolveSamplerParameterf;
+ SamplerParameterfv = qopenglfResolveSamplerParameterfv;
+ GetSamplerParameteriv = qopenglfResolveGetSamplerParameteriv;
+ GetSamplerParameterfv = qopenglfResolveGetSamplerParameterfv;
+ VertexAttribDivisor = qopenglfResolveVertexAttribDivisor;
+ BindTransformFeedback = qopenglfResolveBindTransformFeedback;
+ DeleteTransformFeedbacks = qopenglfResolveDeleteTransformFeedbacks;
+ GenTransformFeedbacks = qopenglfResolveGenTransformFeedbacks;
+ IsTransformFeedback = qopenglfResolveIsTransformFeedback;
+ PauseTransformFeedback = qopenglfResolvePauseTransformFeedback;
+ ResumeTransformFeedback = qopenglfResolveResumeTransformFeedback;
+ GetProgramBinary = qopenglfResolveGetProgramBinary;
+ ProgramBinary = qopenglfResolveProgramBinary;
+ ProgramParameteri = qopenglfResolveProgramParameteri;
+ InvalidateFramebuffer = qopenglfResolveInvalidateFramebuffer;
+ InvalidateSubFramebuffer = qopenglfResolveInvalidateSubFramebuffer;
+ TexStorage2D = qopenglfResolveTexStorage2D;
+ TexStorage3D = qopenglfResolveTexStorage3D;
+ GetInternalformativ = qopenglfResolveGetInternalformativ;
+
+ DispatchCompute = qopenglfResolveDispatchCompute;
+ DispatchComputeIndirect = qopenglfResolveDispatchComputeIndirect;
+ DrawArraysIndirect = qopenglfResolveDrawArraysIndirect;
+ DrawElementsIndirect = qopenglfResolveDrawElementsIndirect;
+ FramebufferParameteri = qopenglfResolveFramebufferParameteri;
+ GetFramebufferParameteriv = qopenglfResolveGetFramebufferParameteriv;
+ GetProgramInterfaceiv = qopenglfResolveGetProgramInterfaceiv;
+ GetProgramResourceIndex = qopenglfResolveGetProgramResourceIndex;
+ GetProgramResourceName = qopenglfResolveGetProgramResourceName;
+ GetProgramResourceiv = qopenglfResolveGetProgramResourceiv;
+ GetProgramResourceLocation = qopenglfResolveGetProgramResourceLocation;
+ UseProgramStages = qopenglfResolveUseProgramStages;
+ ActiveShaderProgram = qopenglfResolveActiveShaderProgram;
+ CreateShaderProgramv = qopenglfResolveCreateShaderProgramv;
+ BindProgramPipeline = qopenglfResolveBindProgramPipeline;
+ DeleteProgramPipelines = qopenglfResolveDeleteProgramPipelines;
+ GenProgramPipelines = qopenglfResolveGenProgramPipelines;
+ IsProgramPipeline = qopenglfResolveIsProgramPipeline;
+ GetProgramPipelineiv = qopenglfResolveGetProgramPipelineiv;
+ ProgramUniform1i = qopenglfResolveProgramUniform1i;
+ ProgramUniform2i = qopenglfResolveProgramUniform2i;
+ ProgramUniform3i = qopenglfResolveProgramUniform3i;
+ ProgramUniform4i = qopenglfResolveProgramUniform4i;
+ ProgramUniform1ui = qopenglfResolveProgramUniform1ui;
+ ProgramUniform2ui = qopenglfResolveProgramUniform2ui;
+ ProgramUniform3ui = qopenglfResolveProgramUniform3ui;
+ ProgramUniform4ui = qopenglfResolveProgramUniform4ui;
+ ProgramUniform1f = qopenglfResolveProgramUniform1f;
+ ProgramUniform2f = qopenglfResolveProgramUniform2f;
+ ProgramUniform3f = qopenglfResolveProgramUniform3f;
+ ProgramUniform4f = qopenglfResolveProgramUniform4f;
+ ProgramUniform1iv = qopenglfResolveProgramUniform1iv;
+ ProgramUniform2iv = qopenglfResolveProgramUniform2iv;
+ ProgramUniform3iv = qopenglfResolveProgramUniform3iv;
+ ProgramUniform4iv = qopenglfResolveProgramUniform4iv;
+ ProgramUniform1uiv = qopenglfResolveProgramUniform1uiv;
+ ProgramUniform2uiv = qopenglfResolveProgramUniform2uiv;
+ ProgramUniform3uiv = qopenglfResolveProgramUniform3uiv;
+ ProgramUniform4uiv = qopenglfResolveProgramUniform4uiv;
+ ProgramUniform1fv = qopenglfResolveProgramUniform1fv;
+ ProgramUniform2fv = qopenglfResolveProgramUniform2fv;
+ ProgramUniform3fv = qopenglfResolveProgramUniform3fv;
+ ProgramUniform4fv = qopenglfResolveProgramUniform4fv;
+ ProgramUniformMatrix2fv = qopenglfResolveProgramUniformMatrix2fv;
+ ProgramUniformMatrix3fv = qopenglfResolveProgramUniformMatrix3fv;
+ ProgramUniformMatrix4fv = qopenglfResolveProgramUniformMatrix4fv;
+ ProgramUniformMatrix2x3fv = qopenglfResolveProgramUniformMatrix2x3fv;
+ ProgramUniformMatrix3x2fv = qopenglfResolveProgramUniformMatrix3x2fv;
+ ProgramUniformMatrix2x4fv = qopenglfResolveProgramUniformMatrix2x4fv;
+ ProgramUniformMatrix4x2fv = qopenglfResolveProgramUniformMatrix4x2fv;
+ ProgramUniformMatrix3x4fv = qopenglfResolveProgramUniformMatrix3x4fv;
+ ProgramUniformMatrix4x3fv = qopenglfResolveProgramUniformMatrix4x3fv;
+ ValidateProgramPipeline = qopenglfResolveValidateProgramPipeline;
+ GetProgramPipelineInfoLog = qopenglfResolveGetProgramPipelineInfoLog;
+ BindImageTexture = qopenglfResolveBindImageTexture;
+ GetBooleani_v = qopenglfResolveGetBooleani_v;
+ MemoryBarrierFunc = qopenglfResolveMemoryBarrier;
+ MemoryBarrierByRegion = qopenglfResolveMemoryBarrierByRegion;
+ TexStorage2DMultisample = qopenglfResolveTexStorage2DMultisample;
+ GetMultisamplefv = qopenglfResolveGetMultisamplefv;
+ SampleMaski = qopenglfResolveSampleMaski;
+ GetTexLevelParameteriv = qopenglfResolveGetTexLevelParameteriv;
+ GetTexLevelParameterfv = qopenglfResolveGetTexLevelParameterfv;
+ BindVertexBuffer = qopenglfResolveBindVertexBuffer;
+ VertexAttribFormat = qopenglfResolveVertexAttribFormat;
+ VertexAttribIFormat = qopenglfResolveVertexAttribIFormat;
+ VertexAttribBinding = qopenglfResolveVertexAttribBinding;
+ VertexBindingDivisor = qopenglfResolveVertexBindingDivisor;
+}
+
+QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx)
+ : QOpenGLExtraFunctionsPrivate(ctx),
+ flushVendorChecked(false)
+{
+ MapBuffer = qopenglfResolveMapBuffer;
GetBufferSubData = qopenglfResolveGetBufferSubData;
DiscardFramebuffer = qopenglfResolveDiscardFramebuffer;
}
diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
index b7cb4e53e9..e295f68e44 100644
--- a/src/gui/opengl/qopenglfunctions.h
+++ b/src/gui/opengl/qopenglfunctions.h
@@ -241,7 +241,8 @@ public:
NPOTTextures = 0x1000,
NPOTTextureRepeat = 0x2000,
FixedFunctionPipeline = 0x4000,
- TextureRGFormats = 0x8000
+ TextureRGFormats = 0x8000,
+ MultipleRenderTargets = 0x10000
};
Q_DECLARE_FLAGS(OpenGLFeatures, OpenGLFeature)
@@ -402,7 +403,7 @@ public:
protected:
QOpenGLFunctionsPrivate *d_ptr;
- static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }
+ static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != Q_NULLPTR; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLFunctions::OpenGLFeatures)
diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp
index ab493fa85c..13bad9aabb 100644
--- a/src/gui/opengl/qopenglgradientcache.cpp
+++ b/src/gui/opengl/qopenglgradientcache.cpp
@@ -34,8 +34,14 @@
#include "qopenglgradientcache_p.h"
#include <private/qdrawhelper_p.h>
#include <private/qopenglcontext_p.h>
+#include <private/qrgba64_p.h>
#include <QtCore/qmutex.h>
-#include <QtGui/qopenglfunctions.h>
+#include "qopenglfunctions.h"
+#include "qopenglextensions_p.h"
+
+#ifndef GL_RGBA16
+#define GL_RGBA16 0x805B
+#endif
QT_BEGIN_NAMESPACE
@@ -137,17 +143,79 @@ GLuint QOpenGL2GradientCache::addCacheElement(quint64 hash_val, const QGradient
}
CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
- uint buffer[1024];
- generateGradientColorTable(gradient, buffer, paletteSize(), opacity);
funcs->glGenTextures(1, &cache_entry.texId);
funcs->glBindTexture(GL_TEXTURE_2D, cache_entry.texId);
- funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, paletteSize(), 1,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+ if (static_cast<QOpenGLExtensions *>(funcs)->hasOpenGLExtension(QOpenGLExtensions::Sized16Formats)) {
+ QRgba64 buffer[1024];
+ generateGradientColorTable(gradient, buffer, paletteSize(), opacity);
+ funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, paletteSize(), 1,
+ 0, GL_RGBA, GL_UNSIGNED_SHORT, buffer);
+ } else {
+ uint buffer[1024];
+ generateGradientColorTable(gradient, buffer, paletteSize(), opacity);
+ funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, paletteSize(), 1,
+ 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+ }
return cache.insert(hash_val, cache_entry).value().texId;
}
//TODO: Let GL generate the texture using an FBO
+void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient, QRgba64 *colorTable, int size, qreal opacity) const
+{
+ int pos = 0;
+ QGradientStops s = gradient.stops();
+ QVector<QRgba64> colors(s.size());
+
+ for (int i = 0; i < s.size(); ++i)
+ colors[i] = s[i].second.rgba64();
+
+ bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation);
+
+ uint alpha = qRound(opacity * 256);
+ QRgba64 current_color = combineAlpha256(colors[0], alpha);
+ qreal incr = 1.0 / qreal(size);
+ qreal fpos = 1.5 * incr;
+ colorTable[pos++] = qPremultiply(current_color);
+
+ while (fpos <= s.first().first) {
+ colorTable[pos] = colorTable[pos - 1];
+ pos++;
+ fpos += incr;
+ }
+
+ if (colorInterpolation)
+ current_color = qPremultiply(current_color);
+
+ for (int i = 0; i < s.size() - 1; ++i) {
+ qreal delta = 1/(s[i+1].first - s[i].first);
+ QRgba64 next_color = combineAlpha256(colors[i+1], alpha);
+ if (colorInterpolation)
+ next_color = qPremultiply(next_color);
+
+ while (fpos < s[i+1].first && pos < size) {
+ int dist = int(256 * ((fpos - s[i].first) * delta));
+ int idist = 256 - dist;
+ if (colorInterpolation)
+ colorTable[pos] = interpolate256(current_color, idist, next_color, dist);
+ else
+ colorTable[pos] = qPremultiply(interpolate256(current_color, idist, next_color, dist));
+ ++pos;
+ fpos += incr;
+ }
+ current_color = next_color;
+ }
+
+ Q_ASSERT(s.size() > 0);
+
+ QRgba64 last_color = qPremultiply(combineAlpha256(colors[s.size() - 1], alpha));
+ for (;pos < size; ++pos)
+ colorTable[pos] = last_color;
+
+ // Make sure the last color stop is represented at the end of the table
+ colorTable[size-1] = last_color;
+}
+
void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, qreal opacity) const
{
int pos = 0;
diff --git a/src/gui/opengl/qopenglgradientcache_p.h b/src/gui/opengl/qopenglgradientcache_p.h
index bcdf3f4fcf..f2cc082250 100644
--- a/src/gui/opengl/qopenglgradientcache_p.h
+++ b/src/gui/opengl/qopenglgradientcache_p.h
@@ -50,6 +50,7 @@
#include <private/qopenglcontext_p.h>
#include <QtCore/qmutex.h>
#include <QGradient>
+#include <qrgba64.h>
QT_BEGIN_NAMESPACE
@@ -58,7 +59,7 @@ class QOpenGL2GradientCache : public QOpenGLSharedResource
struct CacheInfo
{
inline CacheInfo(QGradientStops s, qreal op, QGradient::InterpolationMode mode) :
- stops(s), opacity(op), interpolationMode(mode) {}
+ stops(qMove(s)), opacity(op), interpolationMode(mode) {}
GLuint texId;
QGradientStops stops;
@@ -83,6 +84,9 @@ public:
private:
inline int maxCacheSize() const { return 60; }
inline void generateGradientColorTable(const QGradient& gradient,
+ QRgba64 *colorTable,
+ int size, qreal opacity) const;
+ inline void generateGradientColorTable(const QGradient& gradient,
uint *colorTable,
int size, qreal opacity) const;
GLuint addCacheElement(quint64 hash_val, const QGradient &gradient, qreal opacity);
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index c0657feaa0..17a32774d8 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -169,6 +169,10 @@ QOpenGLPaintDevicePrivate::QOpenGLPaintDevicePrivate(const QSize &sz)
{
}
+QOpenGLPaintDevicePrivate::~QOpenGLPaintDevicePrivate()
+{
+}
+
class QOpenGLEngineThreadStorage
{
public:
@@ -271,6 +275,9 @@ int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
return qRound(d_ptr->dpmy * 0.0254);
case PdmDevicePixelRatio:
return d_ptr->devicePixelRatio;
+ case PdmDevicePixelRatioScaled:
+ return d_ptr->devicePixelRatio * QPaintDevice::devicePixelRatioFScale();
+
default:
qWarning("QOpenGLPaintDevice::metric() - metric %d not known", metric);
return 0;
diff --git a/src/gui/opengl/qopenglpaintdevice_p.h b/src/gui/opengl/qopenglpaintdevice_p.h
index 57d93ee80a..54ea09240d 100644
--- a/src/gui/opengl/qopenglpaintdevice_p.h
+++ b/src/gui/opengl/qopenglpaintdevice_p.h
@@ -56,7 +56,7 @@ class Q_GUI_EXPORT QOpenGLPaintDevicePrivate
{
public:
QOpenGLPaintDevicePrivate(const QSize &size);
- virtual ~QOpenGLPaintDevicePrivate() { }
+ virtual ~QOpenGLPaintDevicePrivate();
static QOpenGLPaintDevicePrivate *get(QOpenGLPaintDevice *dev) { return dev->d_func(); }
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index a9a4adaddc..4836dde343 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -2076,7 +2076,7 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->device->ensureActiveTarget();
- if (d->device->context() != QOpenGLContext::currentContext()) {
+ if (d->device->context() != QOpenGLContext::currentContext() || !d->device->context()) {
qWarning("QPainter::begin(): QOpenGLPaintDevice's context needs to be current");
return false;
}
diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/gui/opengl/qopenglpixeltransferoptions.h
index bf726813bd..cb4697ec7c 100644
--- a/src/gui/opengl/qopenglpixeltransferoptions.h
+++ b/src/gui/opengl/qopenglpixeltransferoptions.h
@@ -49,15 +49,14 @@ class Q_GUI_EXPORT QOpenGLPixelTransferOptions
public:
QOpenGLPixelTransferOptions();
QOpenGLPixelTransferOptions(const QOpenGLPixelTransferOptions &);
- QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
- ~QOpenGLPixelTransferOptions();
-
#ifdef Q_COMPILER_RVALUE_REFS
- QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other)
+ QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
#endif
+ QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
+ ~QOpenGLPixelTransferOptions();
- void swap(QOpenGLPixelTransferOptions &other)
+ void swap(QOpenGLPixelTransferOptions &other) Q_DECL_NOTHROW
{ data.swap(other.data); }
void setAlignment(int alignment);
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index 04b796ddb0..9714aa4bec 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -1783,7 +1783,7 @@ void QOpenGLShaderProgram::setAttributeBuffer
Q_UNUSED(d);
if (location != -1) {
d->glfuncs->glVertexAttribPointer(location, tupleSize, type, GL_TRUE, stride,
- reinterpret_cast<const void *>(offset));
+ reinterpret_cast<const void *>(qintptr(offset)));
}
}
diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/gui/opengl/qopenglshaderprogram.h
index 9f5957e612..b959954718 100644
--- a/src/gui/opengl/qopenglshaderprogram.h
+++ b/src/gui/opengl/qopenglshaderprogram.h
@@ -66,7 +66,7 @@ public:
};
Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit)
- explicit QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = 0);
+ explicit QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = Q_NULLPTR);
virtual ~QOpenGLShader();
QOpenGLShader::ShaderType shaderType() const;
@@ -83,7 +83,7 @@ public:
GLuint shaderId() const;
- static bool hasOpenGLShaders(ShaderType type, QOpenGLContext *context = 0);
+ static bool hasOpenGLShaders(ShaderType type, QOpenGLContext *context = Q_NULLPTR);
private:
friend class QOpenGLShaderProgram;
@@ -101,7 +101,7 @@ class Q_GUI_EXPORT QOpenGLShaderProgram : public QObject
{
Q_OBJECT
public:
- explicit QOpenGLShaderProgram(QObject *parent = 0);
+ explicit QOpenGLShaderProgram(QObject *parent = Q_NULLPTR);
virtual ~QOpenGLShaderProgram();
bool addShader(QOpenGLShader *shader);
@@ -288,7 +288,7 @@ public:
void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count);
void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count);
- static bool hasOpenGLShaderPrograms(QOpenGLContext *context = 0);
+ static bool hasOpenGLShaderPrograms(QOpenGLContext *context = Q_NULLPTR);
private Q_SLOTS:
void shaderDestroyed();
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index c58ddbd71e..6b83c17fd4 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -97,9 +97,11 @@ QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarge
break;
case QOpenGLTexture::TargetCubeMap:
bindingTarget = QOpenGLTexture::BindingTargetCubeMap;
+ faces = 6;
break;
case QOpenGLTexture::TargetCubeMapArray:
bindingTarget = QOpenGLTexture::BindingTargetCubeMapArray;
+ faces = 6;
break;
case QOpenGLTexture::Target2DMultisample:
bindingTarget = QOpenGLTexture::BindingTarget2DMultisample;
@@ -175,7 +177,7 @@ bool QOpenGLTexturePrivate::create()
void QOpenGLTexturePrivate::destroy()
{
- if (!context) {
+ if (!textureId) {
// not created or already destroyed
return;
}
@@ -401,6 +403,9 @@ static bool isSizedTextureFormat(QOpenGLTexture::TextureFormat internalFormat)
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
return true;
+ case QOpenGLTexture::RGB8_ETC1:
+ return false;
+
case QOpenGLTexture::DepthFormat:
case QOpenGLTexture::AlphaFormat:
@@ -442,20 +447,23 @@ static bool isTextureTargetMultisample(QOpenGLTexture::Target target)
return false;
}
-void QOpenGLTexturePrivate::allocateStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType)
+bool QOpenGLTexturePrivate::isUsingImmutableStorage() const
{
- // Resolve the actual number of mipmap levels we can use
- mipLevels = evaluateMipLevels();
-
// Use immutable storage whenever possible, falling back to mutable
// Note that if multisample textures are not supported at all, we'll still fail into
// the mutable storage allocation
- const bool useImmutableStorage = isSizedTextureFormat(format)
+ return isSizedTextureFormat(format)
&& (isTextureTargetMultisample(target)
? features.testFlag(QOpenGLTexture::ImmutableMultisampleStorage)
: features.testFlag(QOpenGLTexture::ImmutableStorage));
+}
+
+void QOpenGLTexturePrivate::allocateStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType)
+{
+ // Resolve the actual number of mipmap levels we can use
+ mipLevels = evaluateMipLevels();
- if (useImmutableStorage)
+ if (isUsingImmutableStorage())
allocateImmutableStorage();
else
allocateMutableStorage(pixelFormat, pixelType);
@@ -663,6 +671,7 @@ static QOpenGLTexture::PixelFormat pixelFormatCompatibleWithInternalFormat(QOpen
case QOpenGLTexture::SRGB_Alpha_DXT3:
case QOpenGLTexture::SRGB_Alpha_DXT5:
case QOpenGLTexture::SRGB_BP_UNorm:
+ case QOpenGLTexture::RGB8_ETC1:
return QOpenGLTexture::RGBA;
case QOpenGLTexture::R11_EAC_UNorm:
@@ -840,6 +849,7 @@ static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTe
case QOpenGLTexture::SRGB8_PunchThrough_Alpha1_ETC2:
case QOpenGLTexture::RGBA8_ETC2_EAC:
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
+ case QOpenGLTexture::RGB8_ETC1:
return QOpenGLTexture::UInt8;
case QOpenGLTexture::DepthFormat:
@@ -857,8 +867,133 @@ static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTe
return QOpenGLTexture::NoPixelType;
}
+static bool isCompressedFormat(QOpenGLTexture::TextureFormat internalFormat)
+{
+ switch (internalFormat) {
+ case QOpenGLTexture::NoFormat:
+
+ case QOpenGLTexture::R8_UNorm:
+ case QOpenGLTexture::RG8_UNorm:
+ case QOpenGLTexture::RGB8_UNorm:
+ case QOpenGLTexture::RGBA8_UNorm:
+ case QOpenGLTexture::R16_UNorm:
+ case QOpenGLTexture::RG16_UNorm:
+ case QOpenGLTexture::RGB16_UNorm:
+ case QOpenGLTexture::RGBA16_UNorm:
+ case QOpenGLTexture::R8_SNorm:
+ case QOpenGLTexture::RG8_SNorm:
+ case QOpenGLTexture::RGB8_SNorm:
+ case QOpenGLTexture::RGBA8_SNorm:
+ case QOpenGLTexture::R16_SNorm:
+ case QOpenGLTexture::RG16_SNorm:
+ case QOpenGLTexture::RGB16_SNorm:
+ case QOpenGLTexture::RGBA16_SNorm:
+ case QOpenGLTexture::R8U:
+ case QOpenGLTexture::RG8U:
+ case QOpenGLTexture::RGB8U:
+ case QOpenGLTexture::RGBA8U:
+ case QOpenGLTexture::R16U:
+ case QOpenGLTexture::RG16U:
+ case QOpenGLTexture::RGB16U:
+ case QOpenGLTexture::RGBA16U:
+ case QOpenGLTexture::R32U:
+ case QOpenGLTexture::RG32U:
+ case QOpenGLTexture::RGB32U:
+ case QOpenGLTexture::RGBA32U:
+ case QOpenGLTexture::R8I:
+ case QOpenGLTexture::RG8I:
+ case QOpenGLTexture::RGB8I:
+ case QOpenGLTexture::RGBA8I:
+ case QOpenGLTexture::R16I:
+ case QOpenGLTexture::RG16I:
+ case QOpenGLTexture::RGB16I:
+ case QOpenGLTexture::RGBA16I:
+ case QOpenGLTexture::R32I:
+ case QOpenGLTexture::RG32I:
+ case QOpenGLTexture::RGB32I:
+ case QOpenGLTexture::RGBA32I:
+ case QOpenGLTexture::R16F:
+ case QOpenGLTexture::RG16F:
+ case QOpenGLTexture::RGB16F:
+ case QOpenGLTexture::RGBA16F:
+ case QOpenGLTexture::R32F:
+ case QOpenGLTexture::RG32F:
+ case QOpenGLTexture::RGB32F:
+ case QOpenGLTexture::RGBA32F:
+ case QOpenGLTexture::RGB9E5:
+ case QOpenGLTexture::RG11B10F:
+ case QOpenGLTexture::RG3B2:
+ case QOpenGLTexture::R5G6B5:
+ case QOpenGLTexture::RGB5A1:
+ case QOpenGLTexture::RGBA4:
+ case QOpenGLTexture::RGB10A2:
+
+ case QOpenGLTexture::D16:
+ case QOpenGLTexture::D24:
+ case QOpenGLTexture::D32:
+ case QOpenGLTexture::D32F:
+
+ case QOpenGLTexture::D24S8:
+ case QOpenGLTexture::D32FS8X24:
+
+ case QOpenGLTexture::S8:
+ return false;
+
+ case QOpenGLTexture::RGB_DXT1:
+ case QOpenGLTexture::RGBA_DXT1:
+ case QOpenGLTexture::RGBA_DXT3:
+ case QOpenGLTexture::RGBA_DXT5:
+ case QOpenGLTexture::R_ATI1N_UNorm:
+ case QOpenGLTexture::R_ATI1N_SNorm:
+ case QOpenGLTexture::RG_ATI2N_UNorm:
+ case QOpenGLTexture::RG_ATI2N_SNorm:
+ case QOpenGLTexture::RGB_BP_UNSIGNED_FLOAT:
+ case QOpenGLTexture::RGB_BP_SIGNED_FLOAT:
+ case QOpenGLTexture::RGB_BP_UNorm:
+ case QOpenGLTexture::SRGB8:
+ case QOpenGLTexture::SRGB8_Alpha8:
+ case QOpenGLTexture::SRGB_DXT1:
+ case QOpenGLTexture::SRGB_Alpha_DXT1:
+ case QOpenGLTexture::SRGB_Alpha_DXT3:
+ case QOpenGLTexture::SRGB_Alpha_DXT5:
+ case QOpenGLTexture::SRGB_BP_UNorm:
+ case QOpenGLTexture::R11_EAC_UNorm:
+ case QOpenGLTexture::R11_EAC_SNorm:
+ case QOpenGLTexture::RG11_EAC_UNorm:
+ case QOpenGLTexture::RG11_EAC_SNorm:
+ case QOpenGLTexture::RGB8_ETC2:
+ case QOpenGLTexture::SRGB8_ETC2:
+ case QOpenGLTexture::RGB8_PunchThrough_Alpha1_ETC2:
+ case QOpenGLTexture::SRGB8_PunchThrough_Alpha1_ETC2:
+ case QOpenGLTexture::RGBA8_ETC2_EAC:
+ case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
+ case QOpenGLTexture::RGB8_ETC1:
+ return true;
+
+ case QOpenGLTexture::DepthFormat:
+ case QOpenGLTexture::AlphaFormat:
+ case QOpenGLTexture::RGBFormat:
+ case QOpenGLTexture::RGBAFormat:
+ case QOpenGLTexture::LuminanceFormat:
+ case QOpenGLTexture::LuminanceAlphaFormat:
+ return false;
+ }
+
+ Q_UNREACHABLE();
+ return false;
+}
+
void QOpenGLTexturePrivate::allocateMutableStorage(QOpenGLTexture::PixelFormat pixelFormat, QOpenGLTexture::PixelType pixelType)
{
+ // There is no way to allocate mutable storage for compressed textures in in
+ // versions older than OpenGL 3.1 and OpenGL ES 3.0, because the older specs
+ // do not mandate accepting null data pointers for glCompressedTexImage*D,
+ // unlike glTexImage*D (which in turn does not accept compressed formats).
+ if (isCompressedFormat(format)) {
+ storageAllocated = true;
+ return;
+ }
+
switch (target) {
case QOpenGLTexture::TargetBuffer:
// Buffer textures get their storage from an external OpenGL buffer
@@ -1196,86 +1331,121 @@ void QOpenGLTexturePrivate::setCompressedData(int mipLevel, int layer, QOpenGLTe
int dataSize, const void *data,
const QOpenGLPixelTransferOptions * const options)
{
+ if (!isCompressedFormat(format)) {
+ qWarning("Cannot set compressed data for non-compressed format 0x%x", format);
+ return;
+ }
+
+ const bool needsFullSpec = !isUsingImmutableStorage(); // was allocateStorage() a no-op?
+
switch (target) {
case QOpenGLTexture::Target1D:
Q_UNUSED(layer);
Q_UNUSED(cubeFace);
- texFuncs->glCompressedTextureSubImage1D(textureId, target, bindingTarget, mipLevel,
- 0, mipLevelSize( mipLevel, dimensions[0] ),
- format, dataSize, data, options);
+ if (needsFullSpec) {
+ texFuncs->glCompressedTextureImage1D(textureId, target, bindingTarget, mipLevel,
+ format,
+ mipLevelSize(mipLevel, dimensions[0]),
+ 0, dataSize, data, options);
+ } else {
+ texFuncs->glCompressedTextureSubImage1D(textureId, target, bindingTarget, mipLevel,
+ 0, mipLevelSize( mipLevel, dimensions[0] ),
+ format, dataSize, data, options);
+ }
break;
case QOpenGLTexture::Target1DArray:
Q_UNUSED(cubeFace);
- texFuncs->glCompressedTextureSubImage2D(textureId, target, bindingTarget, mipLevel,
- 0, layer,
- mipLevelSize(mipLevel, dimensions[0]),
- 1,
- format, dataSize, data, options);
+ if (!needsFullSpec) {
+ texFuncs->glCompressedTextureSubImage2D(textureId, target, bindingTarget, mipLevel,
+ 0, layer,
+ mipLevelSize(mipLevel, dimensions[0]),
+ 1,
+ format, dataSize, data, options);
+ }
break;
case QOpenGLTexture::Target2D:
Q_UNUSED(layer);
Q_UNUSED(cubeFace);
- texFuncs->glCompressedTextureSubImage2D(textureId, target, bindingTarget, mipLevel,
- 0, 0,
- mipLevelSize(mipLevel, dimensions[0]),
- mipLevelSize(mipLevel, dimensions[1]),
- format, dataSize, data, options);
+ if (needsFullSpec) {
+ texFuncs->glCompressedTextureImage2D(textureId, target, bindingTarget, mipLevel,
+ format,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ 0, dataSize, data, options);
+ } else {
+ texFuncs->glCompressedTextureSubImage2D(textureId, target, bindingTarget, mipLevel,
+ 0, 0,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ format, dataSize, data, options);
+ }
break;
case QOpenGLTexture::Target2DArray:
Q_UNUSED(cubeFace);
- texFuncs->glCompressedTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
- 0, 0, layer,
- mipLevelSize(mipLevel, dimensions[0]),
- mipLevelSize(mipLevel, dimensions[1]),
- 1,
- format, dataSize, data, options);
+ if (!needsFullSpec) {
+ texFuncs->glCompressedTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
+ 0, 0, layer,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ 1,
+ format, dataSize, data, options);
+ }
break;
case QOpenGLTexture::Target3D:
Q_UNUSED(cubeFace);
- texFuncs->glCompressedTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
- 0, 0, layer,
- mipLevelSize(mipLevel, dimensions[0]),
- mipLevelSize(mipLevel, dimensions[1]),
- mipLevelSize(mipLevel, dimensions[2]),
- format, dataSize, data, options);
+ if (needsFullSpec) {
+ texFuncs->glCompressedTextureImage3D(textureId, target, bindingTarget, mipLevel,
+ format,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ mipLevelSize(mipLevel, dimensions[2]),
+ 0, dataSize, data, options);
+ } else {
+ texFuncs->glCompressedTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
+ 0, 0, layer,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ mipLevelSize(mipLevel, dimensions[2]),
+ format, dataSize, data, options);
+ }
break;
case QOpenGLTexture::TargetCubeMap:
Q_UNUSED(layer);
- texFuncs->glCompressedTextureSubImage2D(textureId, cubeFace, bindingTarget, mipLevel,
- 0, 0,
- mipLevelSize(mipLevel, dimensions[0]),
- mipLevelSize(mipLevel, dimensions[1]),
- format, dataSize, data, options);
+ if (needsFullSpec) {
+ texFuncs->glCompressedTextureImage2D(textureId, cubeFace, bindingTarget, mipLevel,
+ format,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ 0, dataSize, data, options);
+ } else {
+ texFuncs->glCompressedTextureSubImage2D(textureId, cubeFace, bindingTarget, mipLevel,
+ 0, 0,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ format, dataSize, data, options);
+ }
break;
case QOpenGLTexture::TargetCubeMapArray: {
int faceIndex = cubeFace - QOpenGLTexture::CubeMapPositiveX;
int layerFace = 6 * layer + faceIndex;
- texFuncs->glCompressedTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
- 0, 0, layerFace,
- mipLevelSize(mipLevel, dimensions[0]),
- mipLevelSize(mipLevel, dimensions[1]),
- 1,
- format, dataSize, data, options);
+ if (!needsFullSpec) {
+ texFuncs->glCompressedTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
+ 0, 0, layerFace,
+ mipLevelSize(mipLevel, dimensions[0]),
+ mipLevelSize(mipLevel, dimensions[1]),
+ 1,
+ format, dataSize, data, options);
+ }
break;
}
case QOpenGLTexture::TargetRectangle:
- Q_UNUSED(mipLevel);
- Q_UNUSED(layer);
- Q_UNUSED(cubeFace);
- texFuncs->glCompressedTextureSubImage2D(textureId, target, bindingTarget, 0,
- 0, 0,
- dimensions[0],
- dimensions[1],
- format, dataSize, data, options);
- break;
-
case QOpenGLTexture::Target2DMultisample:
case QOpenGLTexture::Target2DMultisampleArray:
case QOpenGLTexture::TargetBuffer:
@@ -1857,6 +2027,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value SRGB8_PunchThrough_Alpha1_ETC2 Equivalent to GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
\value RGBA8_ETC2_EAC Equivalent to GL_COMPRESSED_RGBA8_ETC2_EAC
\value SRGB8_Alpha8_ETC2_EAC Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ \value RGB8_ETC1 Equivalent to GL_ETC1_RGB8_OES
\value SRGB8 Equivalent to GL_SRGB8
\value SRGB8_Alpha8 Equivalent to GL_SRGB8_ALPHA8
@@ -2394,6 +2565,7 @@ void QOpenGLTexture::setFormat(TextureFormat format)
case QOpenGLTexture::SRGB8_PunchThrough_Alpha1_ETC2:
case QOpenGLTexture::RGBA8_ETC2_EAC:
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
+ case QOpenGLTexture::RGB8_ETC1:
case RG3B2:
case R5G6B5:
case RGB5A1:
@@ -3464,6 +3636,8 @@ QPair<int, int> QOpenGLTexture::mipLevelRange() const
The automatic mipmap generation is enabled by default.
+ \note Mipmap generation is not supported for compressed textures with OpenGL ES 2.0.
+
\sa isAutoMipMapGenerationEnabled(), generateMipMaps()
*/
void QOpenGLTexture::setAutoMipMapGenerationEnabled(bool enabled)
@@ -3489,6 +3663,9 @@ bool QOpenGLTexture::isAutoMipMapGenerationEnabled() const
have disabled automatic mipmap generation then you need to call this function
or the overload to create the mipmap chain.
+ \note Mipmap generation is not supported for compressed textures with OpenGL
+ ES 2.0.
+
\sa setAutoMipMapGenerationEnabled(), setMipLevels(), mipLevels()
*/
void QOpenGLTexture::generateMipMaps()
@@ -3496,6 +3673,11 @@ void QOpenGLTexture::generateMipMaps()
Q_D(QOpenGLTexture);
Q_ASSERT(d->texFuncs);
Q_ASSERT(d->textureId);
+ if (isCompressedFormat(d->format)) {
+ if (QOpenGLContext *ctx = QOpenGLContext::currentContext())
+ if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3)
+ return;
+ }
d->texFuncs->glGenerateTextureMipmap(d->textureId, d->target, d->bindingTarget);
}
@@ -3516,6 +3698,11 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel)
Q_D(QOpenGLTexture);
Q_ASSERT(d->texFuncs);
Q_ASSERT(d->textureId);
+ if (isCompressedFormat(d->format)) {
+ if (QOpenGLContext *ctx = QOpenGLContext::currentContext())
+ if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3)
+ return;
+ }
int oldBaseLevel;
if (resetBaseLevel)
oldBaseLevel = mipBaseLevel();
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index 3017aac737..ec52a192fa 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -196,6 +196,7 @@ public:
SRGB8_PunchThrough_Alpha1_ETC2 = 0x9277, // GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
RGBA8_ETC2_EAC = 0x9278, // GL_COMPRESSED_RGBA8_ETC2_EAC
SRGB8_Alpha8_ETC2_EAC = 0x9279, // GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ RGB8_ETC1 = 0x8D64, // GL_ETC1_RGB8_OES
// sRGB formats
SRGB8 = 0x8C41, // GL_SRGB8
@@ -409,54 +410,54 @@ public:
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED void setData(int mipLevel, int layer, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
QT_DEPRECATED void setData(int mipLevel, int layer,
PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
QT_DEPRECATED void setData(int mipLevel,
PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
QT_DEPRECATED void setData(PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
#endif // QT_DEPRECATED_SINCE(5, 3)
void setData(int mipLevel, int layer, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
void setData(int mipLevel, int layer,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
void setData(int mipLevel,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
void setData(PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = 0);
+ const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
// Compressed data upload
// ### Qt 6: remove the non-const void * overloads
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace,
int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
QT_DEPRECATED void setCompressedData(int mipLevel, int layer,
int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
QT_DEPRECATED void setCompressedData(int mipLevel, int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
QT_DEPRECATED void setCompressedData(int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
#endif // QT_DEPRECATED_SINCE(5, 3)
void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace,
int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
void setCompressedData(int mipLevel, int layer,
int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
void setCompressedData(int mipLevel, int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
void setCompressedData(int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = 0);
+ const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
// Helpful overloads for setData
void setData(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
diff --git a/src/gui/opengl/qopengltexture_p.h b/src/gui/opengl/qopengltexture_p.h
index be4bf0e93c..40ceb1936c 100644
--- a/src/gui/opengl/qopengltexture_p.h
+++ b/src/gui/opengl/qopengltexture_p.h
@@ -117,6 +117,8 @@ public:
return std::floor(double(qMax(1, baseLevelSize >> mipLevel)));
}
+ bool isUsingImmutableStorage() const;
+
QOpenGLTexture *q_ptr;
QOpenGLContext *context;
QOpenGLTexture::Target target;
@@ -154,7 +156,6 @@ public:
bool autoGenerateMipMaps;
bool storageAllocated;
- QPair<int, int> glVersion;
QOpenGLTextureHelper *texFuncs;
QOpenGLTexture::Features features;
diff --git a/src/gui/opengl/qopengltextureblitter.cpp b/src/gui/opengl/qopengltextureblitter.cpp
index 0f9fa6400d..9e611a160d 100644
--- a/src/gui/opengl/qopengltextureblitter.cpp
+++ b/src/gui/opengl/qopengltextureblitter.cpp
@@ -39,6 +39,10 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
+#ifndef GL_TEXTURE_EXTERNAL_OES
+#define GL_TEXTURE_EXTERNAL_OES 0x8D65
+#endif
+
QT_BEGIN_NAMESPACE
static const char vertex_shader150[] =
@@ -88,6 +92,18 @@ static const char fragment_shader[] =
" gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
"}";
+static const char fragment_shader_external_oes[] =
+ "#extension GL_OES_EGL_image_external : require\n"
+ "varying highp vec2 uv;"
+ "uniform samplerExternalOES textureSampler;\n"
+ "uniform bool swizzle;"
+ "uniform highp float opacity;"
+ "void main() {"
+ " highp vec4 tmpFragColor = texture2D(textureSampler, uv);"
+ " tmpFragColor.a *= opacity;"
+ " gl_FragColor = swizzle ? tmpFragColor.bgra : tmpFragColor;"
+ "}";
+
static const GLfloat vertex_buffer_data[] = {
-1,-1, 0,
-1, 1, 0,
@@ -109,14 +125,17 @@ static const GLfloat texture_buffer_data[] = {
class TextureBinder
{
public:
- TextureBinder(GLuint textureId)
+ TextureBinder(GLenum target, GLuint textureId) : m_target(target)
{
- QOpenGLContext::currentContext()->functions()->glBindTexture(GL_TEXTURE_2D, textureId);
+ QOpenGLContext::currentContext()->functions()->glBindTexture(m_target, textureId);
}
~TextureBinder()
{
- QOpenGLContext::currentContext()->functions()->glBindTexture(GL_TEXTURE_2D, 0);
+ QOpenGLContext::currentContext()->functions()->glBindTexture(m_target, 0);
}
+
+private:
+ GLenum m_target;
};
class QOpenGLTextureBlitterPrivate
@@ -128,74 +147,106 @@ public:
IdentityFlipped
};
- QOpenGLTextureBlitterPrivate()
- : program(0)
- , vertexCoordAttribPos(0)
- , vertexTransformUniformPos(0)
- , textureCoordAttribPos(0)
- , textureTransformUniformPos(0)
- , swizzle(false)
- , swizzleOld(false)
- , opacity(1.0f)
- , opacityOld(0.0f)
- , textureMatrixUniformState(User)
- , vao(new QOpenGLVertexArrayObject())
+ enum ProgramIndex {
+ TEXTURE_2D,
+ TEXTURE_EXTERNAL_OES
+ };
+
+ QOpenGLTextureBlitterPrivate() :
+ swizzle(false),
+ opacity(1.0f),
+ vao(new QOpenGLVertexArrayObject),
+ currentTarget(TEXTURE_2D)
{ }
+ bool buildProgram(ProgramIndex idx, const char *vs, const char *fs);
+
void blit(GLuint texture, const QMatrix4x4 &vertexTransform, const QMatrix3x3 &textureTransform);
void blit(GLuint texture, const QMatrix4x4 &vertexTransform, QOpenGLTextureBlitter::Origin origin);
- void prepareProgram(const QMatrix4x4 &vertexTransform)
- {
- vertexBuffer.bind();
- program->setAttributeBuffer(vertexCoordAttribPos, GL_FLOAT, 0, 3, 0);
- program->enableAttributeArray(vertexCoordAttribPos);
- vertexBuffer.release();
-
- program->setUniformValue(vertexTransformUniformPos, vertexTransform);
-
- textureBuffer.bind();
- program->setAttributeBuffer(textureCoordAttribPos, GL_FLOAT, 0, 2, 0);
- program->enableAttributeArray(textureCoordAttribPos);
- textureBuffer.release();
-
- if (swizzle != swizzleOld) {
- program->setUniformValue(swizzleUniformPos, swizzle);
- swizzleOld = swizzle;
- }
-
- if (opacity != opacityOld) {
- program->setUniformValue(opacityUniformPos, opacity);
- opacityOld = opacity;
- }
- }
+ void prepareProgram(const QMatrix4x4 &vertexTransform);
QOpenGLBuffer vertexBuffer;
QOpenGLBuffer textureBuffer;
- QScopedPointer<QOpenGLShaderProgram> program;
- GLuint vertexCoordAttribPos;
- GLuint vertexTransformUniformPos;
- GLuint textureCoordAttribPos;
- GLuint textureTransformUniformPos;
- GLuint swizzleUniformPos;
- GLuint opacityUniformPos;
+ struct Program {
+ Program() :
+ vertexCoordAttribPos(0),
+ vertexTransformUniformPos(0),
+ textureCoordAttribPos(0),
+ textureTransformUniformPos(0),
+ swizzleUniformPos(0),
+ opacityUniformPos(0),
+ swizzle(false),
+ opacity(0.0f),
+ textureMatrixUniformState(User)
+ { }
+ QScopedPointer<QOpenGLShaderProgram> glProgram;
+ GLuint vertexCoordAttribPos;
+ GLuint vertexTransformUniformPos;
+ GLuint textureCoordAttribPos;
+ GLuint textureTransformUniformPos;
+ GLuint swizzleUniformPos;
+ GLuint opacityUniformPos;
+ bool swizzle;
+ float opacity;
+ TextureMatrixUniform textureMatrixUniformState;
+ } programs[2];
bool swizzle;
- bool swizzleOld;
float opacity;
- float opacityOld;
- TextureMatrixUniform textureMatrixUniformState;
QScopedPointer<QOpenGLVertexArrayObject> vao;
+ GLenum currentTarget;
};
+static inline QOpenGLTextureBlitterPrivate::ProgramIndex targetToProgramIndex(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_2D:
+ return QOpenGLTextureBlitterPrivate::TEXTURE_2D;
+ case GL_TEXTURE_EXTERNAL_OES:
+ return QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES;
+ default:
+ qWarning("Unsupported texture target 0x%x", target);
+ return QOpenGLTextureBlitterPrivate::TEXTURE_2D;
+ }
+}
+
+void QOpenGLTextureBlitterPrivate::prepareProgram(const QMatrix4x4 &vertexTransform)
+{
+ Program *program = &programs[targetToProgramIndex(currentTarget)];
+
+ vertexBuffer.bind();
+ program->glProgram->setAttributeBuffer(program->vertexCoordAttribPos, GL_FLOAT, 0, 3, 0);
+ program->glProgram->enableAttributeArray(program->vertexCoordAttribPos);
+ vertexBuffer.release();
+
+ program->glProgram->setUniformValue(program->vertexTransformUniformPos, vertexTransform);
+
+ textureBuffer.bind();
+ program->glProgram->setAttributeBuffer(program->textureCoordAttribPos, GL_FLOAT, 0, 2, 0);
+ program->glProgram->enableAttributeArray(program->textureCoordAttribPos);
+ textureBuffer.release();
+
+ if (swizzle != program->swizzle) {
+ program->glProgram->setUniformValue(program->swizzleUniformPos, swizzle);
+ program->swizzle = swizzle;
+ }
+
+ if (opacity != program->opacity) {
+ program->glProgram->setUniformValue(program->opacityUniformPos, opacity);
+ program->opacity = opacity;
+ }
+}
+
void QOpenGLTextureBlitterPrivate::blit(GLuint texture,
const QMatrix4x4 &vertexTransform,
const QMatrix3x3 &textureTransform)
{
- TextureBinder binder(texture);
+ TextureBinder binder(currentTarget, texture);
prepareProgram(vertexTransform);
- program->setUniformValue(textureTransformUniformPos, textureTransform);
- textureMatrixUniformState = User;
+ Program *program = &programs[targetToProgramIndex(currentTarget)];
+ program->glProgram->setUniformValue(program->textureTransformUniformPos, textureTransform);
+ program->textureMatrixUniformState = User;
QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLES, 0, 6);
}
@@ -204,25 +255,54 @@ void QOpenGLTextureBlitterPrivate::blit(GLuint texture,
const QMatrix4x4 &vertexTransform,
QOpenGLTextureBlitter::Origin origin)
{
- TextureBinder binder(texture);
+ TextureBinder binder(currentTarget, texture);
prepareProgram(vertexTransform);
+ Program *program = &programs[targetToProgramIndex(currentTarget)];
if (origin == QOpenGLTextureBlitter::OriginTopLeft) {
- if (textureMatrixUniformState != IdentityFlipped) {
+ if (program->textureMatrixUniformState != IdentityFlipped) {
QMatrix3x3 flipped;
flipped(1,1) = -1;
flipped(1,2) = 1;
- program->setUniformValue(textureTransformUniformPos, flipped);
- textureMatrixUniformState = IdentityFlipped;
+ program->glProgram->setUniformValue(program->textureTransformUniformPos, flipped);
+ program->textureMatrixUniformState = IdentityFlipped;
}
- } else if (textureMatrixUniformState != Identity) {
- program->setUniformValue(textureTransformUniformPos, QMatrix3x3());
- textureMatrixUniformState = Identity;
+ } else if (program->textureMatrixUniformState != Identity) {
+ program->glProgram->setUniformValue(program->textureTransformUniformPos, QMatrix3x3());
+ program->textureMatrixUniformState = Identity;
}
QOpenGLContext::currentContext()->functions()->glDrawArrays(GL_TRIANGLES, 0, 6);
}
+bool QOpenGLTextureBlitterPrivate::buildProgram(ProgramIndex idx, const char *vs, const char *fs)
+{
+ Program *p = &programs[idx];
+
+ p->glProgram.reset(new QOpenGLShaderProgram);
+
+ p->glProgram->addShaderFromSourceCode(QOpenGLShader::Vertex, vs);
+ p->glProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, fs);
+ p->glProgram->link();
+ if (!p->glProgram->isLinked()) {
+ qWarning() << "Could not link shader program:\n" << p->glProgram->log();
+ return false;
+ }
+
+ p->glProgram->bind();
+
+ p->vertexCoordAttribPos = p->glProgram->attributeLocation("vertexCoord");
+ p->vertexTransformUniformPos = p->glProgram->uniformLocation("vertexTransform");
+ p->textureCoordAttribPos = p->glProgram->attributeLocation("textureCoord");
+ p->textureTransformUniformPos = p->glProgram->uniformLocation("textureTransform");
+ p->swizzleUniformPos = p->glProgram->uniformLocation("swizzle");
+ p->opacityUniformPos = p->glProgram->uniformLocation("opacity");
+
+ p->glProgram->setUniformValue(p->swizzleUniformPos, false);
+
+ return true;
+}
+
QOpenGLTextureBlitter::QOpenGLTextureBlitter()
: d_ptr(new QOpenGLTextureBlitterPrivate)
{
@@ -241,28 +321,21 @@ bool QOpenGLTextureBlitter::create()
Q_D(QOpenGLTextureBlitter);
- if (d->program)
+ if (d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_2D].glProgram)
return true;
- d->program.reset(new QOpenGLShaderProgram());
-
QSurfaceFormat format = currentContext->format();
-
if (format.profile() == QSurfaceFormat::CoreProfile && format.version() >= qMakePair(3,2)) {
- d->program->addShaderFromSourceCode(QOpenGLShader::Vertex, vertex_shader150);
- d->program->addShaderFromSourceCode(QOpenGLShader::Fragment, fragment_shader150);
+ if (!d->buildProgram(QOpenGLTextureBlitterPrivate::TEXTURE_2D, vertex_shader150, fragment_shader150))
+ return false;
} else {
- d->program->addShaderFromSourceCode(QOpenGLShader::Vertex, vertex_shader);
- d->program->addShaderFromSourceCode(QOpenGLShader::Fragment, fragment_shader);
- }
- d->program->link();
- if (!d->program->isLinked()) {
- qWarning() << Q_FUNC_INFO << "Could not link shader program:\n" << d->program->log();
- return false;
+ if (!d->buildProgram(QOpenGLTextureBlitterPrivate::TEXTURE_2D, vertex_shader, fragment_shader))
+ return false;
+ if (supportsExternalOESTarget())
+ if (!d->buildProgram(QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES, vertex_shader, fragment_shader_external_oes))
+ return false;
}
- d->program->bind();
-
// Create and bind the VAO, if supported.
QOpenGLVertexArrayObject::Binder vaoBinder(d->vao.data());
@@ -276,22 +349,13 @@ bool QOpenGLTextureBlitter::create()
d->textureBuffer.allocate(texture_buffer_data, sizeof(texture_buffer_data));
d->textureBuffer.release();
- d->vertexCoordAttribPos = d->program->attributeLocation("vertexCoord");
- d->vertexTransformUniformPos = d->program->uniformLocation("vertexTransform");
- d->textureCoordAttribPos = d->program->attributeLocation("textureCoord");
- d->textureTransformUniformPos = d->program->uniformLocation("textureTransform");
- d->swizzleUniformPos = d->program->uniformLocation("swizzle");
- d->opacityUniformPos = d->program->uniformLocation("opacity");
-
- d->program->setUniformValue(d->swizzleUniformPos,false);
-
return true;
}
bool QOpenGLTextureBlitter::isCreated() const
{
Q_D(const QOpenGLTextureBlitter);
- return d->program;
+ return d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_2D].glProgram;
}
void QOpenGLTextureBlitter::destroy()
@@ -299,36 +363,45 @@ void QOpenGLTextureBlitter::destroy()
if (!isCreated())
return;
Q_D(QOpenGLTextureBlitter);
- d->program.reset();
+ d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_2D].glProgram.reset();
+ d->programs[QOpenGLTextureBlitterPrivate::TEXTURE_EXTERNAL_OES].glProgram.reset();
d->vertexBuffer.destroy();
d->textureBuffer.destroy();
d->vao.reset();
}
-void QOpenGLTextureBlitter::bind()
+bool QOpenGLTextureBlitter::supportsExternalOESTarget() const
+{
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ return ctx && ctx->isOpenGLES() && ctx->hasExtension("GL_OES_EGL_image_external");
+}
+
+void QOpenGLTextureBlitter::bind(GLenum target)
{
Q_D(QOpenGLTextureBlitter);
if (d->vao->isCreated())
d->vao->bind();
- d->program->bind();
+ d->currentTarget = target;
+ QOpenGLTextureBlitterPrivate::Program *p = &d->programs[targetToProgramIndex(target)];
+ p->glProgram->bind();
d->vertexBuffer.bind();
- d->program->setAttributeBuffer(d->vertexCoordAttribPos, GL_FLOAT, 0, 3, 0);
- d->program->enableAttributeArray(d->vertexCoordAttribPos);
+ p->glProgram->setAttributeBuffer(p->vertexCoordAttribPos, GL_FLOAT, 0, 3, 0);
+ p->glProgram->enableAttributeArray(p->vertexCoordAttribPos);
d->vertexBuffer.release();
d->textureBuffer.bind();
- d->program->setAttributeBuffer(d->textureCoordAttribPos, GL_FLOAT, 0, 2, 0);
- d->program->enableAttributeArray(d->textureCoordAttribPos);
+ p->glProgram->setAttributeBuffer(p->textureCoordAttribPos, GL_FLOAT, 0, 2, 0);
+ p->glProgram->enableAttributeArray(p->textureCoordAttribPos);
d->textureBuffer.release();
}
void QOpenGLTextureBlitter::release()
{
Q_D(QOpenGLTextureBlitter);
- d->program->release();
+ d->programs[targetToProgramIndex(d->currentTarget)].glProgram->release();
if (d->vao->isCreated())
d->vao->release();
}
diff --git a/src/gui/opengl/qopengltextureblitter_p.h b/src/gui/opengl/qopengltextureblitter_p.h
index 8f7eae1c32..ebf3a4bfbb 100644
--- a/src/gui/opengl/qopengltextureblitter_p.h
+++ b/src/gui/opengl/qopengltextureblitter_p.h
@@ -68,7 +68,9 @@ public:
bool isCreated() const;
void destroy();
- void bind();
+ bool supportsExternalOESTarget() const;
+
+ void bind(GLenum target = GL_TEXTURE_2D);
void release();
void setSwizzleRB(bool swizzle);
diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/gui/opengl/qopengltexturehelper.cpp
index bf8b514449..df2945a479 100644
--- a/src/gui/opengl/qopengltexturehelper.cpp
+++ b/src/gui/opengl/qopengltexturehelper.cpp
@@ -453,260 +453,192 @@ void QOpenGLTextureHelper::dsa_CompressedTextureImage3D(GLuint texture, GLenum t
CompressedTextureImage3DEXT(texture, target, level, internalFormat, width, height, depth, border, imageSize, bits);
}
+namespace {
+
+class TextureBinder
+{
+public:
+ TextureBinder(QOpenGLTextureHelper *textureFunctions, GLuint texture, GLenum target, GLenum bindingTarget)
+ : m_textureFunctions(textureFunctions)
+ {
+ // For cubemaps we can't use the standard DSA emulation as it is illegal to
+ // try to bind a texture to one of the cubemap face targets. So we force the
+ // target and binding target to the cubemap values in this case.
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ bindingTarget = GL_TEXTURE_BINDING_CUBE_MAP;
+ m_target = GL_TEXTURE_CUBE_MAP;
+ break;
+
+ default:
+ m_target = target;
+ break;
+ }
+
+ m_textureFunctions->glGetIntegerv(bindingTarget, &m_oldTexture);
+ m_textureFunctions->glBindTexture(m_target, texture);
+ }
+
+ ~TextureBinder()
+ {
+ m_textureFunctions->glBindTexture(m_target, m_oldTexture);
+ }
+
+private:
+ QOpenGLTextureHelper *m_textureFunctions;
+ GLenum m_target;
+ GLint m_oldTexture;
+};
+
+} // namespace
+
void QOpenGLTextureHelper::qt_TextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexParameteri(target, pname, param);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexParameteriv(target, pname, params);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexParameterf(target, pname, param);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexParameterfv(target, pname, params);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_GenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glGenerateMipmap(target);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage3D(target, levels, internalFormat, width, height, depth);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage2D(target, levels, internalFormat, width, height);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage1D(target, levels, internalFormat, width);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage3DMultisample(target, samples, internalFormat, width, height, depth, fixedSampleLocations);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage2DMultisample(target, samples, internalFormat, width, height, fixedSampleLocations);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
- // For cubemaps we can't use the standard DSA emulation as it is illegal to
- // try to bind a texture to one of the cubemap face targets. So we force the
- // target and binding target to the cubemap values in this case.
- GLint oldTexture;
-
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &oldTexture);
- glBindTexture(GL_TEXTURE_CUBE_MAP, texture);
- glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
- glBindTexture(GL_TEXTURE_CUBE_MAP, oldTexture);
- break;
-
- default:
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
- glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
- glBindTexture(target, oldTexture);
- break;
- }
+ TextureBinder binder(this, texture, target, bindingTarget);
+ glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
}
void QOpenGLTextureHelper::qt_TextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexImage1D(target, level, internalFormat, width, border, format, type, pixels);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
{
- // For cubemaps we can't use the standard DSA emulation as it is illegal to
- // try to bind a texture to one of the cubemap face targets. So we force the
- // target and binding target to the cubemap values in this case.
- GLint oldTexture;
-
- switch (target) {
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &oldTexture);
- glBindTexture(GL_TEXTURE_CUBE_MAP, texture);
- glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
- glBindTexture(GL_TEXTURE_CUBE_MAP, oldTexture);
- break;
-
- default:
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
- glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
- glBindTexture(target, oldTexture);
- break;
- }
+ TextureBinder binder(this, texture, target, bindingTarget);
+ glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
}
void QOpenGLTextureHelper::qt_TextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexImage3DMultisample(target, samples, internalFormat, width, height, depth, fixedSampleLocations);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glTexImage2DMultisample(target, samples, internalFormat, width, height, fixedSampleLocations);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, bits);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, bits);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexImage1D(target, level, internalFormat, width, border, imageSize, bits);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, bits);
- glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits)
{
- GLint oldTexture;
- glGetIntegerv(bindingTarget, &oldTexture);
- glBindTexture(target, texture);
+ TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexImage3D(target, level, internalFormat, width, height, depth, border, imageSize, bits);
- glBindTexture(target, oldTexture);
}
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index 5a56516b49..d659fcedfb 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -253,23 +253,48 @@ public:
inline void glCompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width,
- GLint border, GLsizei imageSize, const GLvoid *bits)
+ GLint border, GLsizei imageSize, const GLvoid *bits,
+ const QOpenGLPixelTransferOptions * const options = 0)
{
- (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
+ if (options) {
+ QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
+ setPixelUploadOptions(*options);
+ (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
+ setPixelUploadOptions(oldOptions);
+ } else {
+ (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
+ }
}
inline void glCompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height,
- GLint border, GLsizei imageSize, const GLvoid *bits)
+ GLint border, GLsizei imageSize, const GLvoid *bits,
+ const QOpenGLPixelTransferOptions * const options = 0)
+
{
- (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
+ if (options) {
+ QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
+ setPixelUploadOptions(*options);
+ (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
+ setPixelUploadOptions(oldOptions);
+ } else {
+ (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
+ }
}
inline void glCompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth,
- GLint border, GLsizei imageSize, const GLvoid *bits)
+ GLint border, GLsizei imageSize, const GLvoid *bits,
+ const QOpenGLPixelTransferOptions * const options = 0)
{
- (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
+ if (options) {
+ QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
+ setPixelUploadOptions(*options);
+ (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
+ setPixelUploadOptions(oldOptions);
+ } else {
+ (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
+ }
}
private:
diff --git a/src/gui/opengl/qopengltimerquery.h b/src/gui/opengl/qopengltimerquery.h
index 7e46250546..ad111dc03c 100644
--- a/src/gui/opengl/qopengltimerquery.h
+++ b/src/gui/opengl/qopengltimerquery.h
@@ -50,7 +50,7 @@ class Q_GUI_EXPORT QOpenGLTimerQuery : public QObject
Q_OBJECT
public:
- explicit QOpenGLTimerQuery(QObject *parent = 0);
+ explicit QOpenGLTimerQuery(QObject *parent = Q_NULLPTR);
~QOpenGLTimerQuery();
bool create();
@@ -78,7 +78,7 @@ class Q_GUI_EXPORT QOpenGLTimeMonitor : public QObject
Q_OBJECT
public:
- explicit QOpenGLTimeMonitor(QObject *parent = 0);
+ explicit QOpenGLTimeMonitor(QObject *parent = Q_NULLPTR);
~QOpenGLTimeMonitor();
void setSampleCount(int sampleCount);
diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h
index fcf665f97e..a5d5677938 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/gui/opengl/qopenglversionfunctions.h
@@ -47,7 +47,10 @@
#ifndef QT_NO_OPENGL
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/qhash.h>
+#endif
+#include <QtCore/qhashfunctions.h>
#include <QtCore/qpair.h>
#include <QtGui/qopengl.h>
@@ -120,7 +123,7 @@ class QAbstractOpenGLFunctionsPrivate
{
public:
QAbstractOpenGLFunctionsPrivate()
- : owningContext(0),
+ : owningContext(Q_NULLPTR),
initialized(false)
{}
diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h
index 3e01d31202..e8ebf41071 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.h
+++ b/src/gui/opengl/qopenglvertexarrayobject.h
@@ -50,7 +50,7 @@ class Q_GUI_EXPORT QOpenGLVertexArrayObject : public QObject
Q_OBJECT
public:
- explicit QOpenGLVertexArrayObject(QObject* parent = 0);
+ explicit QOpenGLVertexArrayObject(QObject* parent = Q_NULLPTR);
~QOpenGLVertexArrayObject();
bool create();
diff --git a/src/gui/opengl/qtriangulatingstroker.cpp b/src/gui/opengl/qtriangulatingstroker.cpp
index cfbf8a75c5..5967bd6e89 100644
--- a/src/gui/opengl/qtriangulatingstroker.cpp
+++ b/src/gui/opengl/qtriangulatingstroker.cpp
@@ -127,7 +127,7 @@ void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen, co
m_roundness = 1;
} else if (cosmetic) {
m_curvyness_add = realWidth / 2;
- m_curvyness_mul = CURVE_FLATNESS;
+ m_curvyness_mul = float(CURVE_FLATNESS);
m_roundness = qMax<int>(4, realWidth * CURVE_FLATNESS);
} else {
m_curvyness_add = m_width;
@@ -543,7 +543,7 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, c
curvynessMul = CURVE_FLATNESS / m_inv_scale;
} else if (cosmetic) {
curvynessAdd= width / 2;
- curvynessMul= CURVE_FLATNESS;
+ curvynessMul= float(CURVE_FLATNESS);
} else {
curvynessAdd = width * m_inv_scale;
curvynessMul = CURVE_FLATNESS / m_inv_scale;
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index a861516821..1e516e4581 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -9,6 +9,7 @@ HEADERS += \
painting/qcolor.h \
painting/qcolor_p.h \
painting/qcosmeticstroker_p.h \
+ painting/qdatabuffer_p.h \
painting/qdrawhelper_p.h \
painting/qdrawhelper_x86_p.h \
painting/qdrawingprimitive_sse2_p.h \
@@ -43,6 +44,8 @@ HEADERS += \
painting/qrasterizer_p.h \
painting/qregion.h \
painting/qrgb.h \
+ painting/qrgba64.h \
+ painting/qrgba64_p.h \
painting/qstroker_p.h \
painting/qtextureglyphcache_p.h \
painting/qtransform.h \
@@ -58,6 +61,7 @@ SOURCES += \
painting/qbrush.cpp \
painting/qcolor.cpp \
painting/qcolor_p.cpp \
+ painting/qcompositionfunctions.cpp \
painting/qcosmeticstroker.cpp \
painting/qcssutil.cpp \
painting/qdrawhelper.cpp \
@@ -97,12 +101,10 @@ SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \
painting/qimagescale_sse4.cpp
AVX2_SOURCES += painting/qdrawhelper_avx2.cpp
-!ios {
- CONFIG += no_clang_integrated_as
- NEON_SOURCES += painting/qdrawhelper_neon.cpp
- NEON_HEADERS += painting/qdrawhelper_neon_p.h
- NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
-}
+NEON_SOURCES += painting/qdrawhelper_neon.cpp
+NEON_HEADERS += painting/qdrawhelper_neon_p.h
+NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
+!ios:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index f2fee99b99..8a5a6d4fcf 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -38,10 +38,13 @@
#include <qpa/qplatformintegration.h>
#include <qscreen.h>
#include <qdebug.h>
+#include <qscopedpointer.h>
#include <private/qguiapplication_p.h>
#include <private/qwindow_p.h>
+#include <private/qhighdpiscaling_p.h>
+
QT_BEGIN_NAMESPACE
class QBackingStorePrivate
@@ -54,6 +57,7 @@ public:
QWindow *window;
QPlatformBackingStore *platformBackingStore;
+ QScopedPointer<QImage> highDpiBackingstore;
QRegion staticContents;
QSize size;
};
@@ -102,7 +106,7 @@ void QBackingStore::flush(const QRegion &region, QWindow *win, const QPoint &off
}
#endif
- d_ptr->platformBackingStore->flush(win, region, offset);
+ d_ptr->platformBackingStore->flush(win, QHighDpi::toNativeLocalRegion(region, d_ptr->window), offset);
}
/*!
@@ -112,7 +116,12 @@ void QBackingStore::flush(const QRegion &region, QWindow *win, const QPoint &off
*/
QPaintDevice *QBackingStore::paintDevice()
{
- return d_ptr->platformBackingStore->paintDevice();
+ QPaintDevice *device = d_ptr->platformBackingStore->paintDevice();
+
+ if (QHighDpiScaling::isActive() && device->devType() == QInternal::Image)
+ return d_ptr->highDpiBackingstore.data();
+
+ return device;
}
/*!
@@ -150,7 +159,37 @@ QWindow* QBackingStore::window() const
void QBackingStore::beginPaint(const QRegion &region)
{
- d_ptr->platformBackingStore->beginPaint(region);
+ if (d_ptr->highDpiBackingstore &&
+ d_ptr->highDpiBackingstore->devicePixelRatio() != d_ptr->window->devicePixelRatio())
+ resize(size());
+
+ d_ptr->platformBackingStore->beginPaint(QHighDpi::toNativeLocalRegion(region, d_ptr->window));
+
+ // When QtGui is applying a high-dpi scale factor the backing store
+ // creates a "large" backing store image. This image needs to be
+ // painted on as a high-dpi image, which is done by setting
+ // devicePixelRatio. Do this on a separate image instance that shares
+ // the image data to avoid having the new devicePixelRatio be propagated
+ // back to the platform plugin.
+ QPaintDevice *device = d_ptr->platformBackingStore->paintDevice();
+ if (QHighDpiScaling::isActive() && device->devType() == QInternal::Image) {
+ QImage *source = static_cast<QImage *>(device);
+ const bool needsNewImage = d_ptr->highDpiBackingstore.isNull()
+ || source->data_ptr() != d_ptr->highDpiBackingstore->data_ptr()
+ || source->size() != d_ptr->highDpiBackingstore->size()
+ || source->devicePixelRatio() != d_ptr->highDpiBackingstore->devicePixelRatio();
+ if (needsNewImage) {
+ qCDebug(lcScaling) << "QBackingStore::beginPaint new backingstore for" << d_ptr->window;
+ qCDebug(lcScaling) << " source size" << source->size() << "dpr" << source->devicePixelRatio();
+ d_ptr->highDpiBackingstore.reset(
+ new QImage(source->bits(), source->width(), source->height(), source->bytesPerLine(), source->format()));
+
+ qreal targetDevicePixelRatio = d_ptr->window->devicePixelRatio();
+ d_ptr->highDpiBackingstore->setDevicePixelRatio(targetDevicePixelRatio);
+ qCDebug(lcScaling) <<" destination size" << d_ptr->highDpiBackingstore->size()
+ << "dpr" << targetDevicePixelRatio;
+ }
+ }
}
/*!
@@ -171,7 +210,7 @@ void QBackingStore::endPaint()
void QBackingStore::resize(const QSize &size)
{
d_ptr->size = size;
- d_ptr->platformBackingStore->resize(size, d_ptr->staticContents);
+ d_ptr->platformBackingStore->resize(QHighDpi::toNativePixels(size, d_ptr->window), d_ptr->staticContents);
}
/*!
@@ -194,7 +233,7 @@ bool QBackingStore::scroll(const QRegion &area, int dx, int dy)
Q_UNUSED(dx);
Q_UNUSED(dy);
- return d_ptr->platformBackingStore->scroll(area, dx, dy);
+ return d_ptr->platformBackingStore->scroll(QHighDpi::toNativeLocalRegion(area, d_ptr->window), QHighDpi::toNativePixels(dx, d_ptr->window), QHighDpi::toNativePixels(dy, d_ptr->window));
}
/*!
diff --git a/src/gui/painting/qbackingstore.h b/src/gui/painting/qbackingstore.h
index ee3c05f7a9..331fa8c534 100644
--- a/src/gui/painting/qbackingstore.h
+++ b/src/gui/painting/qbackingstore.h
@@ -61,7 +61,7 @@ public:
// '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 = 0, const QPoint &offset = QPoint());
+ void flush(const QRegion &region, QWindow *window = Q_NULLPTR, const QPoint &offset = QPoint());
void resize(const QSize &size);
QSize size() const;
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index dbdd82e432..0898a20998 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -395,169 +395,6 @@ void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl,
}
}
-template<QtPixelOrder PixelOrder>
-static void qt_blend_argb32pm_on_a2rgb30pm(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
-#ifdef QT_DEBUG_DRAW
- fprintf(stdout, "qt_blend_argb32pm_on_a2rgb30pm: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
- destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- fflush(stdout);
-#endif
-
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- if (const_alpha == 256) {
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint s = src[x];
- dst[x] = qConvertArgb32ToA2rgb30<PixelOrder>(s) + BYTE_MUL_RGB30(dst[x], 255 - qAlpha(s));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- } else if (const_alpha != 0) {
- const_alpha = (const_alpha * 255) >> 8;
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint s = src[x];
- dst[x] = BYTE_MUL_RGB30(qConvertArgb32ToA2rgb30<PixelOrder>(s), const_alpha) + BYTE_MUL_RGB30(dst[x], 255 - qt_div_255(qAlpha(s) * const_alpha));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- }
-}
-
-template<QtPixelOrder PixelOrder>
-static void qt_blend_rgb32_on_rgb30(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
-#ifdef QT_DEBUG_DRAW
- fprintf(stdout, "qt_blend_rgb32_on_rgb30: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
- destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- fflush(stdout);
-#endif
-
- if (const_alpha != 256) {
- qt_blend_argb32pm_on_a2rgb30pm<PixelOrder>(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- return;
- }
-
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- for (int y = 0; y < h; ++y) {
- for (int x = 0; x < w; ++x) {
- dst[x] = qConvertRgb32ToRgb30<PixelOrder>(src[x]);
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
-}
-
-static void qt_blend_a2rgb30pm_on_a2rgb30pm(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
-#ifdef QT_DEBUG_DRAW
- fprintf(stdout, "qt_blend_a2rgb30pm_on_a2rgb30pm: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
- destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- fflush(stdout);
-#endif
-
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- if (const_alpha == 256) {
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint s = src[x];
- dst[x] = s + BYTE_MUL_RGB30(dst[x], 255 - qAlphaRgb30(s));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- } else if (const_alpha != 0) {
- const uint const_alpha255 = (const_alpha * 255) >> 8;
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint a = (qAlphaRgb30(src[x]) * const_alpha) >> 8;
- uint s = BYTE_MUL_RGB30(src[x], const_alpha255);
- dst[x] = s + BYTE_MUL_RGB30(dst[x], 255 - a);
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- }
-}
-
-
-static void qt_blend_rgb30_on_rgb30(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
-#ifdef QT_DEBUG_DRAW
- fprintf(stdout, "qt_blend_rgb30_on_rgb30: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
- destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- fflush(stdout);
-#endif
-
- if (const_alpha != 256) {
- qt_blend_a2rgb30pm_on_a2rgb30pm(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- return;
- }
-
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- int len = w * 4;
- for (int y=0; y<h; ++y) {
- memcpy(dst, src, len);
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
-}
-
-static void qt_blend_a2bgr30pm_on_a2rgb30pm(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
-#ifdef QT_DEBUG_DRAW
- fprintf(stdout, "qt_blend_a2bgr30pm_on_a2rgb32pm: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
- destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- fflush(stdout);
-#endif
-
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- if (const_alpha == 256) {
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint s = qRgbSwapRgb30(src[x]);
- dst[x] = s + BYTE_MUL_RGB30(dst[x], 255 - qAlphaRgb30(s));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- } else if (const_alpha != 0) {
- const uint const_alpha255 = (const_alpha * 255) >> 8;
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint a = (qAlphaRgb30(src[x]) * const_alpha) >> 8;
- uint s = BYTE_MUL_RGB30(src[x], const_alpha255);
- dst[x] = qRgbSwapRgb30(s) + BYTE_MUL_RGB30(dst[x], 255 - a);
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- }
-}
-
struct Blend_RGB32_on_RGB32_NoAlpha {
inline void write(quint32 *dst, quint32 src) { *dst = src; }
@@ -772,30 +609,6 @@ void qInitBlendFunctions()
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32;
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32;
#endif
- qBlendFunctions[QImage::Format_BGR30][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30<PixelOrderBGR>;
- qBlendFunctions[QImage::Format_BGR30][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm<PixelOrderBGR>;
- qBlendFunctions[QImage::Format_BGR30][QImage::Format_BGR30] = qt_blend_rgb30_on_rgb30;
- qBlendFunctions[QImage::Format_BGR30][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_BGR30][QImage::Format_RGB30] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_BGR30][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30<PixelOrderBGR>;
- qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm<PixelOrderBGR>;
- qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_BGR30] = qt_blend_rgb30_on_rgb30;
- qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_RGB30] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_RGB30][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30<PixelOrderRGB>;
- qBlendFunctions[QImage::Format_RGB30][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm<PixelOrderRGB>;
- qBlendFunctions[QImage::Format_RGB30][QImage::Format_BGR30] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_RGB30][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_RGB30][QImage::Format_RGB30] = qt_blend_rgb30_on_rgb30;
- qBlendFunctions[QImage::Format_RGB30][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30<PixelOrderRGB>;
- qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm<PixelOrderRGB>;
- qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_BGR30] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm;
- qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_RGB30] = qt_blend_rgb30_on_rgb30;
- qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm;
qTransformFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_transform_image_rgb32_on_rgb32;
qTransformFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_argb32;
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index c3a0f5c615..9e039b7ae4 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -1163,6 +1163,7 @@ QDataStream &operator>>(QDataStream &s, QBrush &b)
QColor c;
s >> numStops;
+ stops.reserve(numStops);
for (quint32 i = 0; i < numStops; ++i) {
s >> n >> c;
stops << QPair<qreal, QColor>(n, c);
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index d50c42f1ee..3f30c061dc 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -416,6 +416,18 @@ QColor::QColor(QRgb color)
ct.argb.pad = 0;
}
+/*!
+ \since 5.6
+
+ Constructs a color with the value \a rgba64.
+
+ \sa fromRgba64()
+*/
+
+QColor::QColor(QRgba64 rgba64)
+{
+ setRgba64(rgba64);
+}
/*!
\internal
@@ -469,6 +481,7 @@ QColor::QColor(Spec spec)
\sa setNamedColor(), name(), isValid()
*/
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
/*!
\fn QColor::QColor(const QColor &color)
@@ -476,6 +489,7 @@ QColor::QColor(Spec spec)
\sa isValid()
*/
+#endif
/*!
\fn bool QColor::isValid() const
@@ -941,7 +955,7 @@ void QColor::setRgb(int r, int g, int b, int a)
For an invalid color, the alpha value of the returned color is unspecified.
- \sa setRgba(), rgb()
+ \sa setRgba(), rgb(), rgba64()
*/
QRgb QColor::rgba() const
@@ -954,7 +968,7 @@ QRgb QColor::rgba() const
/*!
Sets the RGB value to \a rgba, including its alpha.
- \sa rgba(), rgb()
+ \sa rgba(), rgb(), setRgba64()
*/
void QColor::setRgba(QRgb rgba)
{
@@ -967,6 +981,40 @@ void QColor::setRgba(QRgb rgba)
}
/*!
+ \since 5.6
+
+ Returns the RGB64 value of the color, including its alpha.
+
+ For an invalid color, the alpha value of the returned color is unspecified.
+
+ \sa setRgba64(), rgba(), rgb()
+*/
+
+QRgba64 QColor::rgba64() const
+{
+ if (cspec != Invalid && cspec != Rgb)
+ return toRgb().rgba64();
+ return qRgba64(ct.argb.red, ct.argb.green, ct.argb.blue, ct.argb.alpha);
+}
+
+/*!
+ \since 5.6
+
+ Sets the RGB64 value to \a rgba, including its alpha.
+
+ \sa \setRgba(), rgba64()
+*/
+void QColor::setRgba64(QRgba64 rgba)
+{
+ cspec = Rgb;
+ ct.argb.alpha = rgba.alpha();
+ ct.argb.red = rgba.red();
+ ct.argb.green = rgba.green();
+ ct.argb.blue = rgba.blue();
+ ct.argb.pad = 0;
+}
+
+/*!
\fn QRgb QColor::rgb() const
Returns the RGB value of the color. The alpha value is opaque.
@@ -1850,7 +1898,7 @@ QColor QColor::fromRgb(QRgb rgb)
Unlike the fromRgb() function, the alpha-channel specified by the given
QRgb value is included.
- \sa fromRgb(), isValid()
+ \sa fromRgb(), fromRgba64(), isValid()
*/
QColor QColor::fromRgba(QRgb rgba)
@@ -1865,7 +1913,7 @@ QColor QColor::fromRgba(QRgb rgba)
All the values must be in the range 0-255.
- \sa toRgb(), fromRgbF(), isValid()
+ \sa toRgb(), fromRgba64(), fromRgbF(), isValid()
*/
QColor QColor::fromRgb(int r, int g, int b, int a)
{
@@ -1894,7 +1942,7 @@ QColor QColor::fromRgb(int r, int g, int b, int a)
All the values must be in the range 0.0-1.0.
- \sa fromRgb(), toRgb(), isValid()
+ \sa fromRgb(), fromRgba64(), toRgb(), isValid()
*/
QColor QColor::fromRgbF(qreal r, qreal g, qreal b, qreal a)
{
@@ -1916,6 +1964,38 @@ QColor QColor::fromRgbF(qreal r, qreal g, qreal b, qreal a)
return color;
}
+
+/*!
+ \since 5.6
+
+ Static convenience function that returns a QColor constructed from the RGBA64
+ color values, \a r (red), \a g (green), \a b (blue), and \a a
+ (alpha-channel, i.e. transparency).
+
+ \sa fromRgb(), fromRgbF(), toRgb(), isValid()
+*/
+QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a)
+{
+ QColor color;
+ color.setRgba64(qRgba64(r, g, b, a));
+ return color;
+}
+
+/*!
+ \since 5.6
+
+ Static convenience function that returns a QColor constructed from the
+ given QRgba64 value \a rgba64.
+
+ \sa fromRgb(), fromRgbF(), toRgb(), isValid()
+*/
+QColor QColor::fromRgba64(QRgba64 rgba64)
+{
+ QColor color;
+ color.setRgba64(rgba64);
+ return color;
+}
+
/*!
Static convenience function that returns a QColor constructed from the HSV
color values, \a h (hue), \a s (saturation), \a v (value), and \a a
@@ -1995,7 +2075,7 @@ QColor QColor::fromHsl(int h, int s, int l, int a)
|| s < 0 || s > 255
|| l < 0 || l > 255
|| a < 0 || a > 255) {
- qWarning("QColor::fromHsv: HSV parameters out of range");
+ qWarning("QColor::fromHsl: HSL parameters out of range");
return QColor();
}
@@ -2027,7 +2107,7 @@ QColor QColor::fromHslF(qreal h, qreal s, qreal l, qreal a)
|| (s < qreal(0.0) || s > qreal(1.0))
|| (l < qreal(0.0) || l > qreal(1.0))
|| (a < qreal(0.0) || a > qreal(1.0))) {
- qWarning("QColor::fromHsvF: HSV parameters out of range");
+ qWarning("QColor::fromHslF: HSL parameters out of range");
return QColor();
}
@@ -2307,6 +2387,7 @@ QColor QColor::dark(int factor) const
return hsv.convertTo(cspec);
}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
/*!
Assigns a copy of \a color to this color, and returns a reference to it.
*/
@@ -2316,6 +2397,7 @@ QColor &QColor::operator=(const QColor &color)
ct.argb = color.ct.argb;
return *this;
}
+#endif
/*! \overload
Assigns a copy of \a color and returns a reference to this color.
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index 06c218365b..b0192662cc 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -37,6 +37,7 @@
#include <QtGui/qrgb.h>
#include <QtCore/qnamespace.h>
#include <QtCore/qstringlist.h>
+#include <QtGui/qrgba64.h>
QT_BEGIN_NAMESPACE
@@ -63,11 +64,23 @@ public:
QColor(Qt::GlobalColor color);
QColor(int r, int g, int b, int a = 255);
QColor(QRgb rgb);
+ QColor(QRgba64 rgba64);
QColor(const QString& name);
QColor(const char *name);
- QColor(const QColor &color); // ### Qt 6: remove, the trivial one is fine.
QColor(Spec spec);
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ QColor(const QColor &color); // ### Qt 6: remove all of these, the trivial ones are fine.
+# ifdef Q_COMPILER_RVALUE_REFS
+ QColor(QColor &&other) Q_DECL_NOTHROW : cspec(other.cspec), ct(other.ct) {}
+ QColor &operator=(QColor &&other) Q_DECL_NOTHROW
+ { cspec = other.cspec; ct = other.ct; return *this; }
+# endif
+ QColor &operator=(const QColor &);
+#endif // Qt < 6
+
+ QColor &operator=(Qt::GlobalColor color);
+
bool isValid() const;
// ### Qt 6: merge overloads
@@ -100,15 +113,18 @@ public:
void setGreenF(qreal green);
void setBlueF(qreal blue);
- void getRgb(int *r, int *g, int *b, int *a = 0) const;
+ void getRgb(int *r, int *g, int *b, int *a = Q_NULLPTR) const;
void setRgb(int r, int g, int b, int a = 255);
- void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = 0) const;
+ void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = Q_NULLPTR) const;
void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
QRgb rgba() const;
void setRgba(QRgb rgba);
+ QRgba64 rgba64() const;
+ void setRgba64(QRgba64 rgba);
+
QRgb rgb() const;
void setRgb(QRgb rgb);
@@ -124,10 +140,10 @@ public:
qreal hsvSaturationF() const;
qreal valueF() const;
- void getHsv(int *h, int *s, int *v, int *a = 0) const;
+ void getHsv(int *h, int *s, int *v, int *a = Q_NULLPTR) const;
void setHsv(int h, int s, int v, int a = 255);
- void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = 0) const;
+ void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = Q_NULLPTR) const;
void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
int cyan() const;
@@ -140,10 +156,10 @@ public:
qreal yellowF() const;
qreal blackF() const;
- void getCmyk(int *c, int *m, int *y, int *k, int *a = 0);
+ void getCmyk(int *c, int *m, int *y, int *k, int *a = Q_NULLPTR);
void setCmyk(int c, int m, int y, int k, int a = 255);
- void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = 0);
+ void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = Q_NULLPTR);
void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
int hslHue() const; // 0 <= hue < 360
@@ -154,10 +170,10 @@ public:
qreal hslSaturationF() const;
qreal lightnessF() const;
- void getHsl(int *h, int *s, int *l, int *a = 0) const;
+ void getHsl(int *h, int *s, int *l, int *a = Q_NULLPTR) const;
void setHsl(int h, int s, int l, int a = 255);
- void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = 0) const;
+ void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = Q_NULLPTR) const;
void setHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
QColor toRgb() const;
@@ -173,6 +189,9 @@ public:
static QColor fromRgb(int r, int g, int b, int a = 255);
static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
+ static QColor fromRgba64(ushort r, ushort g, ushort b, ushort a = USHRT_MAX);
+ static QColor fromRgba64(QRgba64 rgba);
+
static QColor fromHsv(int h, int s, int v, int a = 255);
static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
@@ -187,9 +206,6 @@ public:
QColor dark(int f = 200) const Q_REQUIRED_RESULT;
QColor darker(int f = 200) const Q_REQUIRED_RESULT;
- QColor &operator=(const QColor &);
- QColor &operator=(Qt::GlobalColor color);
-
bool operator==(const QColor &c) const;
bool operator!=(const QColor &c) const;
@@ -254,9 +270,11 @@ inline QColor::QColor(const char *aname)
inline QColor::QColor(const QString& aname)
{ setNamedColor(aname); }
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
inline QColor::QColor(const QColor &acolor)
: cspec(acolor.cspec)
{ ct.argb = acolor.ct.argb; }
+#endif
inline bool QColor::isValid() const
{ return cspec != Invalid; }
diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp
new file mode 100644
index 0000000000..ba428a7938
--- /dev/null
+++ b/src/gui/painting/qcompositionfunctions.cpp
@@ -0,0 +1,2197 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 <qglobal.h>
+#include <private/qdrawhelper_p.h>
+#include <private/qrgba64_p.h>
+
+QT_BEGIN_NAMESPACE
+
+# define PRELOAD_INIT(x)
+# define PRELOAD_INIT2(x,y)
+# define PRELOAD_COND(x)
+# define PRELOAD_COND2(x,y)
+
+/* The constant alpha factor describes an alpha factor that gets applied
+ to the result of the composition operation combining it with the destination.
+
+ The intent is that if const_alpha == 0. we get back dest, and if const_alpha == 1.
+ we get the unmodified operation
+
+ result = src op dest
+ dest = result * const_alpha + dest * (1. - const_alpha)
+
+ This means that in the comments below, the first line is the const_alpha==255 case, the
+ second line the general one.
+
+ In the lines below:
+ s == src, sa == alpha(src), sia = 1 - alpha(src)
+ d == dest, da == alpha(dest), dia = 1 - alpha(dest)
+ ca = const_alpha, cia = 1 - const_alpha
+
+ The methods exist in two variants. One where we have a constant source, the other
+ where the source is an array of pixels.
+*/
+
+/*
+ result = 0
+ d = d * cia
+*/
+#define comp_func_Clear_impl(dest, length, const_alpha)\
+{\
+ if (const_alpha == 255) {\
+ QT_MEMFILL_UINT(dest, length, 0);\
+ } else {\
+ int ialpha = 255 - const_alpha;\
+ PRELOAD_INIT(dest)\
+ for (int i = 0; i < length; ++i) {\
+ PRELOAD_COND(dest)\
+ dest[i] = BYTE_MUL(dest[i], ialpha);\
+ }\
+ }\
+}
+
+void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)
+{
+ comp_func_Clear_impl(dest, length, const_alpha);
+}
+
+void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest, int length, QRgba64, uint const_alpha)
+{
+ if (const_alpha == 255)
+ qt_memfill64((quint64*)dest, 0, length);
+ else {
+ int ialpha = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha255(dest[i], ialpha);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
+{
+ comp_func_Clear_impl(dest, length, const_alpha);
+}
+
+void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest, const QRgba64 *, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ qt_memfill64((quint64*)dest, 0, length);
+ else {
+ int ialpha = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha255(dest[i], ialpha);
+ }
+ }
+}
+
+/*
+ result = s
+ dest = s * ca + d * cia
+*/
+void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ QT_MEMFILL_UINT(dest, length, color);
+ } else {
+ int ialpha = 255 - const_alpha;
+ color = BYTE_MUL(color, const_alpha);
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = color + BYTE_MUL(dest[i], ialpha);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ qt_memfill64((quint64*)dest, color, length);
+ else {
+ int ialpha = 255 - const_alpha;
+ color = multiplyAlpha255(color, const_alpha);
+ for (int i = 0; i < length; ++i) {
+ dest[i] = color + multiplyAlpha255(dest[i], ialpha);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ ::memcpy(dest, src, length * sizeof(uint));
+ } else {
+ int ialpha = 255 - const_alpha;
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ dest[i] = INTERPOLATE_PIXEL_255(src[i], const_alpha, dest[i], ialpha);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ ::memcpy(dest, src, length * sizeof(quint64));
+ else {
+ int ialpha = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = interpolate255(src[i], const_alpha, dest[i], ialpha);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)
+{
+}
+
+void QT_FASTCALL comp_func_solid_Destination_rgb64(QRgba64 *, int, QRgba64, uint)
+{
+}
+
+void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
+{
+}
+
+void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *, const QRgba64 *, int, uint)
+{
+}
+
+/*
+ result = s + d * sia
+ dest = (s + d * sia) * ca + d * cia
+ = s * ca + d * (sia * ca + cia)
+ = s * ca + d * (1 - sa*ca)
+*/
+void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha)
+{
+ if ((const_alpha & qAlpha(color)) == 255) {
+ QT_MEMFILL_UINT(dest, length, color);
+ } else {
+ if (const_alpha != 255)
+ color = BYTE_MUL(color, const_alpha);
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = color + BYTE_MUL(dest[i], qAlpha(~color));
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha == 255 && color.isOpaque()) {
+ qt_memfill64((quint64*)dest, color, length);
+ } else {
+ if (const_alpha != 255)
+ color = multiplyAlpha255(color, const_alpha);
+ for (int i = 0; i < length; ++i) {
+ dest[i] = color + multiplyAlpha65535(dest[i], 65535 - color.alpha());
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = src[i];
+ if (s >= 0xff000000)
+ dest[i] = s;
+ else if (s != 0)
+ dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = BYTE_MUL(src[i], const_alpha);
+ dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 s = src[i];
+ if (s.isOpaque())
+ dest[i] = s;
+ else if (!s.isTransparent())
+ dest[i] = s + multiplyAlpha65535(dest[i], 65535 - s.alpha());
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 s = multiplyAlpha255(src[i], const_alpha);
+ dest[i] = s + multiplyAlpha65535(dest[i], 65535 - s.alpha());
+ }
+ }
+}
+
+/*
+ result = d + s * dia
+ dest = (d + s * dia) * ca + d * cia
+ = d + s * dia * ca
+*/
+void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha != 255)
+ color = BYTE_MUL(color, const_alpha);
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ dest[i] = d + BYTE_MUL(color, qAlpha(~d));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha != 255)
+ color = multiplyAlpha255(color, const_alpha);
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ dest[i] = d + multiplyAlpha65535(color, 65535 - d.alpha());
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ dest[i] = d + BYTE_MUL(src[i], qAlpha(~d));
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = BYTE_MUL(src[i], const_alpha);
+ dest[i] = d + BYTE_MUL(s, qAlpha(~d));
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ dest[i] = d + multiplyAlpha65535(src[i], 65535 - d.alpha());
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = multiplyAlpha255(src[i], const_alpha);
+ dest[i] = d + multiplyAlpha65535(s, 65535 - d.alpha());
+ }
+ }
+}
+
+/*
+ result = s * da
+ dest = s * da * ca + d * cia
+*/
+void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)
+{
+ PRELOAD_INIT(dest)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = BYTE_MUL(color, qAlpha(dest[i]));
+ }
+ } else {
+ color = BYTE_MUL(color, const_alpha);
+ uint cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(d), d, cia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(color, dest[i].alpha());
+ }
+ } else {
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
+ color = multiplyAlpha65535(color, ca);
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(color, d.alpha(), d, cia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ dest[i] = BYTE_MUL(src[i], qAlpha(dest[i]));
+ }
+ } else {
+ uint cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = BYTE_MUL(src[i], const_alpha);
+ dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, cia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(src[i], dest[i].alpha());
+ }
+ } else {
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = multiplyAlpha65535(src[i], ca);
+ dest[i] = interpolate65535(s, d.alpha(), d, cia);
+ }
+ }
+}
+
+/*
+ result = d * sa
+ dest = d * sa * ca + d * cia
+ = d * (sa * ca + cia)
+*/
+void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha)
+{
+ uint a = qAlpha(color);
+ if (const_alpha != 255) {
+ a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
+ }
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = BYTE_MUL(dest[i], a);
+ }
+}
+
+void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ uint a = color.alpha();
+ uint ca64k = const_alpha * 257;
+ if (const_alpha != 255)
+ a = qt_div_65535(a * ca64k) + 65535 - ca64k;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(dest[i], a);
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ dest[i] = BYTE_MUL(dest[i], qAlpha(src[i]));
+ }
+ } else {
+ int cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint a = BYTE_MUL(qAlpha(src[i]), const_alpha) + cia;
+ dest[i] = BYTE_MUL(dest[i], a);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(dest[i], src[i].alpha());
+ }
+ } else {
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
+ for (int i = 0; i < length; ++i) {
+ uint a = qt_div_65535(src[i].alpha() * ca) + cia;
+ dest[i] = multiplyAlpha65535(dest[i], a);
+ }
+ }
+}
+
+/*
+ result = s * dia
+ dest = s * dia * ca + d * cia
+*/
+
+void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)
+{
+ PRELOAD_INIT(dest)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = BYTE_MUL(color, qAlpha(~dest[i]));
+ }
+ } else {
+ color = BYTE_MUL(color, const_alpha);
+ int cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, cia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(color, 65535 - dest[i].alpha());
+ }
+ } else {
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
+ color = multiplyAlpha65535(color, ca);
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(color, 65535 - d.alpha(), d, cia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ dest[i] = BYTE_MUL(src[i], qAlpha(~dest[i]));
+ }
+ } else {
+ int cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = BYTE_MUL(src[i], const_alpha);
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, cia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(src[i], 65535 - dest[i].alpha());
+ }
+ } else {
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = multiplyAlpha65535(src[i], ca);
+ dest[i] = interpolate65535(s, 65535 - d.alpha(), d, cia);
+ }
+ }
+}
+
+/*
+ result = d * sia
+ dest = d * sia * ca + d * cia
+ = d * (sia * ca + cia)
+*/
+void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha)
+{
+ uint a = qAlpha(~color);
+ if (const_alpha != 255)
+ a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = BYTE_MUL(dest[i], a);
+ }
+}
+
+void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ uint a = 65535 - color.alpha();
+ uint ca64k = const_alpha * 257;
+ if (const_alpha != 255)
+ a = qt_div_65535(a * ca64k) + 65535 - ca64k;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(dest[i], a);
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ dest[i] = BYTE_MUL(dest[i], qAlpha(~src[i]));
+ }
+ } else {
+ int cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint sia = BYTE_MUL(qAlpha(~src[i]), const_alpha) + cia;
+ dest[i] = BYTE_MUL(dest[i], sia);
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = multiplyAlpha65535(dest[i], 65535 - src[i].alpha());
+ }
+ } else {
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
+ for (int i = 0; i < length; ++i) {
+ uint a = qt_div_65535((65535 - src[i].alpha()) * ca) + cia;
+ dest[i] = multiplyAlpha65535(dest[i], a);
+ }
+ }
+}
+
+/*
+ result = s*da + d*sia
+ dest = s*da*ca + d*sia*ca + d *cia
+ = s*ca * da + d * (sia*ca + cia)
+ = s*ca * da + d * (1 - sa*ca)
+*/
+void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha != 255) {
+ color = BYTE_MUL(color, const_alpha);
+ }
+ uint sia = qAlpha(~color);
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(dest[i]), dest[i], sia);
+ }
+}
+
+void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha != 255)
+ color = multiplyAlpha255(color, const_alpha);
+ uint sia = 65535 - color.alpha();
+ for (int i = 0; i < length; ++i) {
+ dest[i] = interpolate65535(color, dest[i].alpha(), dest[i], sia);
+ }
+}
+
+void QT_FASTCALL comp_func_SourceAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = src[i];
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = BYTE_MUL(src[i], const_alpha);
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_SourceAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 s = src[i];
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(s, d.alpha(), d, 65535 - s.alpha());
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 s = multiplyAlpha255(src[i], const_alpha);
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(s, d.alpha(), d, 65535 - s.alpha());
+ }
+ }
+}
+
+/*
+ result = d*sa + s*dia
+ dest = d*sa*ca + s*dia*ca + d *cia
+ = s*ca * dia + d * (sa*ca + cia)
+*/
+void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha)
+{
+ uint a = qAlpha(color);
+ if (const_alpha != 255) {
+ color = BYTE_MUL(color, const_alpha);
+ a = qAlpha(color) + 255 - const_alpha;
+ }
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(d, a, color, qAlpha(~d));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ uint a = color.alpha();
+ if (const_alpha != 255) {
+ color = multiplyAlpha255(color, const_alpha);
+ a = color.alpha() + 65535 - (const_alpha * 257);
+ }
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(d, a, color, 65535 - d.alpha());
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = src[i];
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(d, qAlpha(s), s, qAlpha(~d));
+ }
+ } else {
+ int cia = 255 - const_alpha;
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint s = BYTE_MUL(src[i], const_alpha);
+ uint d = dest[i];
+ uint a = qAlpha(s) + cia;
+ dest[i] = INTERPOLATE_PIXEL_255(d, a, s, qAlpha(~d));
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 s = src[i];
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(d, s.alpha(), s, 65535 - d.alpha());
+ }
+ } else {
+ int ca = const_alpha * 257;
+ int cia = 65535 - ca;
+ for (int i = 0; i < length; ++i) {
+ QRgba64 s = multiplyAlpha65535(src[i], ca);
+ QRgba64 d = dest[i];
+ uint a = s.alpha() + cia;
+ dest[i] = interpolate65535(d, a, s, 65535 - d.alpha());
+ }
+ }
+}
+
+/*
+ result = d*sia + s*dia
+ dest = d*sia*ca + s*dia*ca + d *cia
+ = s*ca * dia + d * (sia*ca + cia)
+ = s*ca * dia + d * (1 - sa*ca)
+*/
+void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha != 255)
+ color = BYTE_MUL(color, const_alpha);
+ uint sia = qAlpha(~color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, sia);
+ }
+}
+
+void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha != 255)
+ color = multiplyAlpha255(color, const_alpha);
+ uint sia = 65535 - color.alpha();
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ dest[i] = interpolate65535(color, 65535 - d.alpha(), d, sia);
+ }
+}
+
+void QT_FASTCALL comp_func_XOR(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ PRELOAD_INIT2(dest, src)
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+ dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = BYTE_MUL(src[i], const_alpha);
+ dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
+ }
+ }
+}
+
+void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = src[i];
+ dest[i] = interpolate65535(s, 65535 - d.alpha(), d, 65535 - s.alpha());
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = dest[i];
+ QRgba64 s = multiplyAlpha255(src[i], const_alpha);
+ dest[i] = interpolate65535(s, 65535 - d.alpha(), d, 65535 - s.alpha());
+ }
+ }
+}
+
+struct QFullCoverage {
+ inline void store(uint *dest, const uint src) const
+ {
+ *dest = src;
+ }
+};
+
+struct QPartialCoverage {
+ inline QPartialCoverage(uint const_alpha)
+ : ca(const_alpha)
+ , ica(255 - const_alpha)
+ {
+ }
+
+ inline void store(uint *dest, const uint src) const
+ {
+ *dest = INTERPOLATE_PIXEL_255(src, ca, *dest, ica);
+ }
+
+private:
+ const uint ca;
+ const uint ica;
+};
+
+static inline int mix_alpha(int da, int sa)
+{
+ return 255 - ((255 - sa) * (255 - da) >> 8);
+}
+
+/*
+ Dca' = Sca.Da + Dca.Sa + Sca.(1 - Da) + Dca.(1 - Sa)
+ = Sca + Dca
+*/
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ uint s = color;
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ d = comp_func_Plus_one_pixel(d, s);
+ coverage.store(&dest[i], d);
+ }
+}
+
+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)
+ comp_func_solid_Plus_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Plus_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = addWithSaturation(dest[i], color);
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = addWithSaturation(dest[i], color);
+ dest[i] = interpolate255(d, const_alpha, dest[i], 255 - const_alpha);
+ }
+ }
+}
+
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Plus_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ d = comp_func_Plus_one_pixel(d, s);
+
+ coverage.store(&dest[i], d);
+ }
+}
+
+void QT_FASTCALL comp_func_Plus(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Plus_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Plus_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+void QT_FASTCALL comp_func_Plus_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ for (int i = 0; i < length; ++i) {
+ dest[i] = addWithSaturation(dest[i], src[i]);
+ }
+ } else {
+ for (int i = 0; i < length; ++i) {
+ QRgba64 d = addWithSaturation(dest[i], src[i]);
+ dest[i] = interpolate255(d, const_alpha, dest[i], 255 - const_alpha);
+ }
+ }
+}
+
+/*
+ Dca' = Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
+*/
+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));
+}
+
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) multiply_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) multiply_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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
+*/
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) 255 - qt_div_255((255-a) * (255-b))
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) 255 - (((255-a) * (255-b)) >> 8)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Screen_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+/*
+ if 2.Dca < Da
+ Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
+ otherwise
+ Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)
+*/
+static inline int overlay_op(int dst, int src, int da, int sa)
+{
+ const int temp = src * (255 - da) + dst * (255 - sa);
+ if (2 * dst < da)
+ return qt_div_255(2 * src * dst + temp);
+ else
+ return qt_div_255(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)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) overlay_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) overlay_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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
+*/
+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));
+}
+
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) darken_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) darken_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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
+*/
+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));
+}
+
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) lighten_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) lighten_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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)
+ otherwise
+ Dca' = Dca.Sa/(1-Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
+*/
+static inline int color_dodge_op(int dst, int src, int da, int sa)
+{
+ const int sa_da = sa * da;
+ const int dst_sa = dst * sa;
+ const int src_da = src * da;
+
+ const int temp = src * (255 - da) + dst * (255 - sa);
+ if (src_da + dst_sa >= sa_da)
+ return qt_div_255(sa_da + temp);
+ else
+ return qt_div_255(255 * dst_sa / (255 - 255 * 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)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a,b) color_dodge_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) color_dodge_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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)
+ otherwise
+ Dca' = Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa)
+*/
+static inline int color_burn_op(int dst, int src, int da, int sa)
+{
+ const int src_da = src * da;
+ const int dst_sa = dst * sa;
+ const int sa_da = sa * da;
+
+ const int temp = src * (255 - da) + dst * (255 - sa);
+
+ if (src == 0 || src_da + dst_sa <= sa_da)
+ return qt_div_255(temp);
+ return qt_div_255(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)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) color_burn_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) color_burn_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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)
+ otherwise
+ Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)
+*/
+static inline uint hardlight_op(int dst, int src, int da, int sa)
+{
+ const uint temp = src * (255 - da) + dst * (255 - sa);
+
+ if (2 * src < sa)
+ return qt_div_255(2 * src * dst + temp);
+ else
+ return qt_div_255(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)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) hardlight_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) hardlight_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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)
+ otherwise if 2.Sca > Sa and 4.Dca <= Da
+ Dca' = Dca.Sa + Da.(2.Sca - Sa).(4.Dca/Da.(4.Dca/Da + 1).(Dca/Da - 1) + 7.Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)
+ otherwise if 2.Sca > Sa and 4.Dca > Da
+ Dca' = Dca.Sa + Da.(2.Sca - Sa).((Dca/Da)^0.5 - Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)
+*/
+static inline int soft_light_op(int dst, int src, int da, int sa)
+{
+ const int src2 = src << 1;
+ const int dst_np = da != 0 ? (255 * dst) / da : 0;
+ const int temp = (src * (255 - da) + dst * (255 - sa)) * 255;
+
+ if (src2 < sa)
+ return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025;
+ else if (4 * dst <= da)
+ return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
+ else {
+ return (dst * sa * 255 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
+ }
+}
+
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) soft_light_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint 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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) soft_light_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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)
+*/
+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));
+}
+
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) difference_op(a, b, da, sa)
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) difference_op(a, b, da, sa)
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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)
+*/
+template <typename T>
+Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_impl(uint *dest, int length, uint color, const T &coverage)
+{
+ int sa = qAlpha(color);
+ int sr = qRed(color);
+ int sg = qGreen(color);
+ int sb = qBlue(color);
+
+ PRELOAD_INIT(dest)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND(dest)
+ uint d = dest[i];
+ int da = qAlpha(d);
+
+#define OP(a, b) (a + b - qt_div_255(2*(a*b)))
+ int r = OP( qRed(d), sr);
+ int b = OP( qBlue(d), sb);
+ int g = OP(qGreen(d), sg);
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(r, g, b, a));
+ }
+}
+
+void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+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)
+{
+ PRELOAD_INIT2(dest, src)
+ for (int i = 0; i < length; ++i) {
+ PRELOAD_COND2(dest, src)
+ uint d = dest[i];
+ uint s = src[i];
+
+ int da = qAlpha(d);
+ int sa = qAlpha(s);
+
+#define OP(a, b) (a + b - ((a*b) >> 7))
+ int r = OP( qRed(d), qRed(s));
+ int b = OP( qBlue(d), qBlue(s));
+ int g = OP(qGreen(d), qGreen(s));
+ int a = mix_alpha(da, sa);
+#undef OP
+
+ coverage.store(&dest[i], qRgba(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)
+ 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,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--)
+ *dest++ |= color;
+}
+
+void QT_FASTCALL rasterop_SourceOrDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--)
+ *dest++ |= *src++;
+}
+
+void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color |= 0xff000000;
+ while (length--)
+ *dest++ &= color;
+}
+
+void QT_FASTCALL rasterop_SourceAndDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (*src & *dest) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color &= 0x00ffffff;
+ while (length--)
+ *dest++ ^= color;
+}
+
+void QT_FASTCALL rasterop_SourceXorDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (*src ^ *dest) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color = ~color;
+ while (length--) {
+ *dest = (color & ~(*dest)) | 0xff000000;
+ ++dest;
+ }
+}
+
+void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (~(*src) & ~(*dest)) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color = ~color | 0xff000000;
+ while (length--) {
+ *dest = color | ~(*dest);
+ ++dest;
+ }
+}
+
+void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = ~(*src) | ~(*dest) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color = ~color & 0x00ffffff;
+ while (length--) {
+ *dest = color ^ (*dest);
+ ++dest;
+ }
+}
+
+void QT_FASTCALL rasterop_NotSourceXorDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = ((~(*src)) ^ (*dest)) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length,
+ uint color, uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ qt_memfill(dest, ~color | 0xff000000, length);
+}
+
+void QT_FASTCALL rasterop_NotSource(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src,
+ int length, uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--)
+ *dest++ = ~(*src++) | 0xff000000;
+}
+
+void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color = ~color | 0xff000000;
+ while (length--) {
+ *dest = color & *dest;
+ ++dest;
+ }
+}
+
+void QT_FASTCALL rasterop_NotSourceAndDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (~(*src) & *dest) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (color & ~(*dest)) | 0xff000000;
+ ++dest;
+ }
+}
+
+void QT_FASTCALL rasterop_SourceAndNotDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (*src & ~(*dest)) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_NotSourceOrDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (~(*src) | *dest) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_NotSourceOrDestination(uint *Q_DECL_RESTRICT dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ color = ~color | 0xff000000;
+ while (length--)
+ *dest++ |= color;
+}
+
+void QT_FASTCALL rasterop_SourceOrNotDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (*src | ~(*dest)) | 0xff000000;
+ ++dest; ++src;
+ }
+}
+
+void QT_FASTCALL rasterop_solid_SourceOrNotDestination(uint *Q_DECL_RESTRICT dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(const_alpha);
+ while (length--) {
+ *dest = (color | ~(*dest)) | 0xff000000;
+ ++dest;
+ }
+}
+
+void QT_FASTCALL rasterop_ClearDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(src);
+ comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
+}
+
+void QT_FASTCALL rasterop_solid_ClearDestination(uint *Q_DECL_RESTRICT dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(color);
+ comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
+}
+
+void QT_FASTCALL rasterop_SetDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(src);
+ comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
+}
+
+void QT_FASTCALL rasterop_solid_SetDestination(uint *Q_DECL_RESTRICT dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(color);
+ comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
+}
+
+void QT_FASTCALL rasterop_NotDestination(uint *Q_DECL_RESTRICT dest,
+ const uint *Q_DECL_RESTRICT src,
+ int length,
+ uint const_alpha)
+{
+ Q_UNUSED(src);
+ rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
+}
+
+void QT_FASTCALL rasterop_solid_NotDestination(uint *Q_DECL_RESTRICT dest,
+ int length,
+ uint color,
+ uint const_alpha)
+{
+ Q_UNUSED(color);
+ rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
+}
+
+CompositionFunctionSolid qt_functionForModeSolid_C[] = {
+ comp_func_solid_SourceOver,
+ comp_func_solid_DestinationOver,
+ comp_func_solid_Clear,
+ comp_func_solid_Source,
+ comp_func_solid_Destination,
+ comp_func_solid_SourceIn,
+ comp_func_solid_DestinationIn,
+ comp_func_solid_SourceOut,
+ comp_func_solid_DestinationOut,
+ comp_func_solid_SourceAtop,
+ comp_func_solid_DestinationAtop,
+ comp_func_solid_XOR,
+ comp_func_solid_Plus,
+ comp_func_solid_Multiply,
+ comp_func_solid_Screen,
+ comp_func_solid_Overlay,
+ comp_func_solid_Darken,
+ comp_func_solid_Lighten,
+ comp_func_solid_ColorDodge,
+ comp_func_solid_ColorBurn,
+ comp_func_solid_HardLight,
+ comp_func_solid_SoftLight,
+ comp_func_solid_Difference,
+ comp_func_solid_Exclusion,
+ rasterop_solid_SourceOrDestination,
+ rasterop_solid_SourceAndDestination,
+ rasterop_solid_SourceXorDestination,
+ rasterop_solid_NotSourceAndNotDestination,
+ rasterop_solid_NotSourceOrNotDestination,
+ rasterop_solid_NotSourceXorDestination,
+ rasterop_solid_NotSource,
+ rasterop_solid_NotSourceAndDestination,
+ rasterop_solid_SourceAndNotDestination,
+ rasterop_solid_NotSourceOrDestination,
+ rasterop_solid_SourceOrNotDestination,
+ rasterop_solid_ClearDestination,
+ rasterop_solid_SetDestination,
+ rasterop_solid_NotDestination
+};
+
+CompositionFunctionSolid64 qt_functionForModeSolid64_C[] = {
+ comp_func_solid_SourceOver_rgb64,
+ comp_func_solid_DestinationOver_rgb64,
+ comp_func_solid_Clear_rgb64,
+ comp_func_solid_Source_rgb64,
+ comp_func_solid_Destination_rgb64,
+ comp_func_solid_SourceIn_rgb64,
+ comp_func_solid_DestinationIn_rgb64,
+ comp_func_solid_SourceOut_rgb64,
+ comp_func_solid_DestinationOut_rgb64,
+ comp_func_solid_SourceAtop_rgb64,
+ 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,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+CompositionFunction qt_functionForMode_C[] = {
+ comp_func_SourceOver,
+ comp_func_DestinationOver,
+ comp_func_Clear,
+ comp_func_Source,
+ comp_func_Destination,
+ comp_func_SourceIn,
+ comp_func_DestinationIn,
+ comp_func_SourceOut,
+ comp_func_DestinationOut,
+ comp_func_SourceAtop,
+ comp_func_DestinationAtop,
+ comp_func_XOR,
+ comp_func_Plus,
+ comp_func_Multiply,
+ comp_func_Screen,
+ comp_func_Overlay,
+ comp_func_Darken,
+ comp_func_Lighten,
+ comp_func_ColorDodge,
+ comp_func_ColorBurn,
+ comp_func_HardLight,
+ comp_func_SoftLight,
+ comp_func_Difference,
+ comp_func_Exclusion,
+ rasterop_SourceOrDestination,
+ rasterop_SourceAndDestination,
+ rasterop_SourceXorDestination,
+ rasterop_NotSourceAndNotDestination,
+ rasterop_NotSourceOrNotDestination,
+ rasterop_NotSourceXorDestination,
+ rasterop_NotSource,
+ rasterop_NotSourceAndDestination,
+ rasterop_SourceAndNotDestination,
+ rasterop_NotSourceOrDestination,
+ rasterop_SourceOrNotDestination,
+ rasterop_ClearDestination,
+ rasterop_SetDestination,
+ rasterop_NotDestination
+};
+
+CompositionFunction64 qt_functionForMode64_C[] = {
+ comp_func_SourceOver_rgb64,
+ comp_func_DestinationOver_rgb64,
+ comp_func_Clear_rgb64,
+ comp_func_Source_rgb64,
+ comp_func_Destination_rgb64,
+ comp_func_SourceIn_rgb64,
+ comp_func_DestinationIn_rgb64,
+ comp_func_SourceOut_rgb64,
+ comp_func_DestinationOut_rgb64,
+ comp_func_SourceAtop_rgb64,
+ comp_func_DestinationAtop_rgb64,
+ comp_func_XOR_rgb64,
+ comp_func_Plus_rgb64,
+ 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index e9fada10a5..8c3fd2ce4f 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -33,6 +33,7 @@
#include "qcosmeticstroker_p.h"
#include "private/qpainterpath_p.h"
+#include "private/qrgba64_p.h"
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -280,7 +281,7 @@ void QCosmeticStroker::setup()
drawCaps = state->lastPen.capStyle() != Qt::FlatCap;
if (strokeSelection & FastDraw) {
- color = INTERPOLATE_PIXEL_256(state->penData.solid.color, opacity, 0, 0);
+ color = multiplyAlpha256(state->penData.solid.color, opacity).toArgb32();
QRasterBuffer *buffer = state->penData.rasterBuffer;
pixels = (uint *)buffer->buffer();
ppl = buffer->bytesPerLine()>>2;
diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h
index 0a4a3d5c9e..3fe39efdde 100644
--- a/src/gui/painting/qdatabuffer_p.h
+++ b/src/gui/painting/qdatabuffer_p.h
@@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
template <typename Type> class QDataBuffer
{
+ Q_DISABLE_COPY(QDataBuffer);
public:
QDataBuffer(int res)
{
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index d74b48a3ca..87ceb9a89d 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -32,11 +32,6 @@
****************************************************************************/
#include <qglobal.h>
-#ifdef Q_OS_IOS
-// We don't build the NEON drawhelpers as they are implemented partly
-// in GAS syntax assembly, which is not supported by the iOS toolchain.
-#undef __ARM_NEON__
-#endif
#include <qstylehints.h>
#include <qguiapplication.h>
@@ -51,6 +46,7 @@
#include <private/qdrawhelper_mips_dsp_p.h>
#endif
#include <private/qguiapplication_p.h>
+#include <private/qrgba64_p.h>
#include <qmath.h>
QT_BEGIN_NAMESPACE
@@ -184,6 +180,36 @@ static const uint *QT_FASTCALL convertToRGB32(uint *buffer, const uint *src, int
}
template<QImage::Format Format>
+static const QRgba64 *QT_FASTCALL convertToRGB64(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+ Q_CONSTEXPR uint redMask = ((1 << redWidth<Format>()) - 1);
+ Q_CONSTEXPR uint greenMask = ((1 << greenWidth<Format>()) - 1);
+ Q_CONSTEXPR uint blueMask = ((1 << blueWidth<Format>()) - 1);
+
+ Q_CONSTEXPR uchar redLeftShift = 8 - redWidth<Format>();
+ Q_CONSTEXPR uchar greenLeftShift = 8 - greenWidth<Format>();
+ Q_CONSTEXPR uchar blueLeftShift = 8 - blueWidth<Format>();
+
+ Q_CONSTEXPR uchar redRightShift = 2 * redWidth<Format>() - 8;
+ Q_CONSTEXPR uchar greenRightShift = 2 * greenWidth<Format>() - 8;
+ Q_CONSTEXPR uchar blueRightShift = 2 * blueWidth<Format>() - 8;
+
+ for (int i = 0; i < count; ++i) {
+ uint red = (src[i] >> redShift<Format>()) & redMask;
+ uint green = (src[i] >> greenShift<Format>()) & greenMask;
+ uint blue = (src[i] >> blueShift<Format>()) & blueMask;
+
+ red = ((red << redLeftShift) | (red >> redRightShift)) << 16;
+ green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8;
+ blue = (blue << blueLeftShift) | (blue >> blueRightShift);
+ buffer[i] = QRgba64::fromRgba(red, green, blue, 255);
+ }
+
+ return buffer;
+}
+
+template<QImage::Format Format>
static const uint *QT_FASTCALL convertARGBPMToARGB32PM(uint *buffer, const uint *src, int count,
const QPixelLayout *, const QRgb *)
{
@@ -219,6 +245,41 @@ static const uint *QT_FASTCALL convertARGBPMToARGB32PM(uint *buffer, const uint
}
template<QImage::Format Format>
+static const QRgba64 *QT_FASTCALL convertARGBPMToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+ Q_CONSTEXPR uint alphaMask = ((1 << alphaWidth<Format>()) - 1);
+ Q_CONSTEXPR uint redMask = ((1 << redWidth<Format>()) - 1);
+ Q_CONSTEXPR uint greenMask = ((1 << greenWidth<Format>()) - 1);
+ Q_CONSTEXPR uint blueMask = ((1 << blueWidth<Format>()) - 1);
+
+ Q_CONSTEXPR uchar alphaLeftShift = 8 - alphaWidth<Format>();
+ Q_CONSTEXPR uchar redLeftShift = 8 - redWidth<Format>();
+ Q_CONSTEXPR uchar greenLeftShift = 8 - greenWidth<Format>();
+ Q_CONSTEXPR uchar blueLeftShift = 8 - blueWidth<Format>();
+
+ Q_CONSTEXPR uchar alphaRightShift = 2 * alphaWidth<Format>() - 8;
+ Q_CONSTEXPR uchar redRightShift = 2 * redWidth<Format>() - 8;
+ Q_CONSTEXPR uchar greenRightShift = 2 * greenWidth<Format>() - 8;
+ Q_CONSTEXPR uchar blueRightShift = 2 * blueWidth<Format>() - 8;
+
+ for (int i = 0; i < count; ++i) {
+ uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask;
+ uint red = (src[i] >> redShift<Format>()) & redMask;
+ uint green = (src[i] >> greenShift<Format>()) & greenMask;
+ uint blue = (src[i] >> blueShift<Format>()) & blueMask;
+
+ alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift);
+ red = qMin(alpha, (red << redLeftShift) | (red >> redRightShift));
+ green = qMin(alpha, (green << greenLeftShift) | (green >> greenRightShift));
+ blue = qMin(alpha, (blue << blueLeftShift) | (blue >> blueRightShift));
+ buffer[i] = QRgba64::fromRgba(red, green, blue, alpha);
+ }
+
+ return buffer;
+}
+
+template<QImage::Format Format>
static const uint *QT_FASTCALL convertRGBFromARGB32PM(uint *buffer, const uint *src, int count,
const QPixelLayout *, const QRgb *)
{
@@ -313,28 +374,30 @@ static const uint *QT_FASTCALL convertARGBPMFromARGB32PM(uint *buffer, const uin
template<QImage::Format Format> Q_DECL_CONSTEXPR static inline QPixelLayout pixelLayoutRGB()
{
return QPixelLayout{
- redWidth<Format>(), redShift<Format>(),
- greenWidth<Format>(), greenShift<Format>(),
- blueWidth<Format>(), blueShift<Format>(),
+ uchar(redWidth<Format>()), uchar(redShift<Format>()),
+ uchar(greenWidth<Format>()), uchar(greenShift<Format>()),
+ uchar(blueWidth<Format>()), uchar(blueShift<Format>()),
0, 0,
false, bitsPerPixel<Format>(),
convertToRGB32<Format>,
convertRGBFromARGB32PM<Format>,
- convertRGBFromRGB32<Format>
+ convertRGBFromRGB32<Format>,
+ convertToRGB64<Format>
};
}
template<QImage::Format Format> Q_DECL_CONSTEXPR static inline QPixelLayout pixelLayoutARGBPM()
{
return QPixelLayout{
- redWidth<Format>(), redShift<Format>(),
- greenWidth<Format>(), greenShift<Format>(),
- blueWidth<Format>(), blueShift<Format>(),
- alphaWidth<Format>(), alphaShift<Format>(),
+ uchar(redWidth<Format>()), uchar(redShift<Format>()),
+ uchar(greenWidth<Format>()), uchar(greenShift<Format>()),
+ uchar(blueWidth<Format>()), uchar(blueShift<Format>()),
+ uchar(alphaWidth<Format>()), uchar(alphaShift<Format>()),
true, bitsPerPixel<Format>(),
convertARGBPMToARGB32PM<Format>,
convertARGBPMFromARGB32PM<Format>,
- convertARGBPMFromRGB32<Format>
+ convertARGBPMFromRGB32<Format>,
+ convertARGBPMToARGB64PM<Format>
};
}
@@ -349,6 +412,14 @@ static const uint *QT_FASTCALL convertIndexedToARGB32PM(uint *buffer, const uint
return buffer;
}
+static const QRgba64 *QT_FASTCALL convertIndexedToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *clut)
+{
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromArgb32(clut[src[i]]).premultiplied();
+ return buffer;
+}
+
static const uint *QT_FASTCALL convertPassThrough(uint *, const uint *src, int,
const QPixelLayout *, const QRgb *)
{
@@ -391,6 +462,22 @@ static const uint *QT_FASTCALL convertGrayscale8ToRGB32(uint *buffer, const uint
return buffer;
}
+static const QRgba64 *QT_FASTCALL convertAlpha8ToRGB64(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromRgba(0, 0, 0, src[i]);
+ return buffer;
+}
+
+static const QRgba64 *QT_FASTCALL convertGrayscale8ToRGB64(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromRgba(src[i], src[i], src[i], 255);
+ return buffer;
+}
+
static const uint *QT_FASTCALL convertARGB32FromARGB32PM(uint *buffer, const uint *src, int count,
const QPixelLayout *, const QRgb *)
{
@@ -407,6 +494,113 @@ static const uint *QT_FASTCALL convertRGBA8888PMFromARGB32PM(uint *buffer, const
return buffer;
}
+#ifdef __SSE2__
+template<bool RGBA, bool maskAlpha>
+static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count)
+{
+ if (count <= 0)
+ return;
+
+ const __m128i amask = _mm_set1_epi32(0xff000000);
+ int i = 0;
+ for (; ((uintptr_t)buffer & 0xf) && i < count; ++i) {
+ uint s = *src++;
+ if (RGBA)
+ s = RGBA2ARGB(s);
+ *buffer++ = QRgba64::fromArgb32(s);
+ }
+ for (; i < count-3; i += 4) {
+ __m128i vs = _mm_loadu_si128((const __m128i*)src);
+ if (maskAlpha)
+ vs = _mm_or_si128(vs, amask);
+ src += 4;
+ __m128i v1 = _mm_unpacklo_epi8(vs, vs);
+ __m128i v2 = _mm_unpackhi_epi8(vs, vs);
+ if (!RGBA) {
+ v1 = _mm_shufflelo_epi16(v1, _MM_SHUFFLE(3, 0, 1, 2));
+ v2 = _mm_shufflelo_epi16(v2, _MM_SHUFFLE(3, 0, 1, 2));
+ v1 = _mm_shufflehi_epi16(v1, _MM_SHUFFLE(3, 0, 1, 2));
+ v2 = _mm_shufflehi_epi16(v2, _MM_SHUFFLE(3, 0, 1, 2));
+ }
+ _mm_store_si128((__m128i*)(buffer), v1);
+ buffer += 2;
+ _mm_store_si128((__m128i*)(buffer), v2);
+ buffer += 2;
+ }
+
+ for (; i < count; ++i) {
+ uint s = *src++;
+ if (RGBA)
+ s = RGBA2ARGB(s);
+ *buffer++ = QRgba64::fromArgb32(s);
+ }
+}
+#endif
+
+static const QRgba64 *QT_FASTCALL convertRGB32ToRGB64(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+#ifdef __SSE2__
+ qConvertARGB32PMToARGB64PM_sse2<false, true>(buffer, src, count);
+#else
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromArgb32(0xff000000 | src[i]);
+#endif
+ return buffer;
+}
+
+static const QRgba64 *QT_FASTCALL convertARGB32ToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+#ifdef __SSE2__
+ qConvertARGB32PMToARGB64PM_sse2<false, false>(buffer, src, count);
+ for (int i = 0; i < count; ++i)
+ buffer[i] = buffer[i].premultiplied();
+#else
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromArgb32(src[i]).premultiplied();
+#endif
+ return buffer;
+}
+
+static const QRgba64 *QT_FASTCALL convertARGB32PMToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+#ifdef __SSE2__
+ qConvertARGB32PMToARGB64PM_sse2<false, false>(buffer, src, count);
+#else
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromArgb32(src[i]);
+#endif
+ return buffer;
+}
+
+static const QRgba64 *QT_FASTCALL convertRGBA8888ToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+#ifdef __SSE2__
+ qConvertARGB32PMToARGB64PM_sse2<true, false>(buffer, src, count);
+ for (int i = 0; i < count; ++i)
+ buffer[i] = buffer[i].premultiplied();
+#else
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromArgb32(RGBA2ARGB(src[i])).premultiplied();
+#endif
+ return buffer;
+}
+
+static const QRgba64 *QT_FASTCALL convertRGBA8888PMToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+#ifdef __SSE2__
+ qConvertARGB32PMToARGB64PM_sse2<true, false>(buffer, src, count);
+#else
+ for (int i = 0; i < count; ++i)
+ buffer[i] = QRgba64::fromArgb32(RGBA2ARGB(src[i]));
+#endif
+ return buffer;
+}
+
static const uint *QT_FASTCALL convertRGBA8888FromARGB32PM(uint *buffer, const uint *src, int count,
const QPixelLayout *, const QRgb *)
{
@@ -440,6 +634,63 @@ static const uint *QT_FASTCALL convertA2RGB30PMToARGB32PM(uint *buffer, const ui
return buffer;
}
+#ifdef __SSE2__
+template<QtPixelOrder PixelOrder>
+static inline void qConvertA2RGB30PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count)
+{
+ if (count <= 0)
+ return;
+
+ const __m128i rmask = _mm_set1_epi32(0x3ff00000);
+ const __m128i gmask = _mm_set1_epi32(0x000ffc00);
+ const __m128i bmask = _mm_set1_epi32(0x000003ff);
+ const __m128i afactor = _mm_set1_epi16(0x5555);
+ int i = 0;
+
+ for (; ((uintptr_t)buffer & 0xf) && i < count; ++i)
+ *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);
+
+ for (; i < count-3; i += 4) {
+ __m128i vs = _mm_loadu_si128((const __m128i*)src);
+ src += 4;
+ __m128i va = _mm_srli_epi32(vs, 30);
+ __m128i vr = _mm_and_si128(vs, rmask);
+ __m128i vb = _mm_and_si128(vs, bmask);
+ __m128i vg = _mm_and_si128(vs, gmask);
+ va = _mm_mullo_epi16(va, afactor);
+ vr = _mm_or_si128(_mm_srli_epi32(vr, 14), _mm_srli_epi32(vr, 24));
+ vg = _mm_or_si128(_mm_srli_epi32(vg, 4), _mm_srli_epi32(vg, 14));
+ vb = _mm_or_si128(_mm_slli_epi32(vb, 6), _mm_srli_epi32(vb, 4));
+ __m128i vrb;
+ if (PixelOrder == PixelOrderRGB)
+ vrb = _mm_or_si128(vr, _mm_slli_si128(vb, 2));
+ else
+ vrb = _mm_or_si128(vb, _mm_slli_si128(vr, 2));
+ __m128i vga = _mm_or_si128(vg, _mm_slli_si128(va, 2));
+ _mm_store_si128((__m128i*)(buffer), _mm_unpacklo_epi16(vrb, vga));
+ buffer += 2;
+ _mm_store_si128((__m128i*)(buffer), _mm_unpackhi_epi16(vrb, vga));
+ buffer += 2;
+ }
+
+ for (; i < count; ++i)
+ *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);
+}
+#endif
+
+template<QtPixelOrder PixelOrder>
+static const QRgba64 *QT_FASTCALL convertA2RGB30PMToARGB64PM(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+#ifdef __SSE2__
+ qConvertA2RGB30PMToARGB64PM_sse2<PixelOrder>(buffer, src, count);
+#else
+ for (int i = 0; i < count; ++i)
+ buffer[i] = qConvertA2rgb30ToRgb64<PixelOrder>(src[i]);
+#endif
+ return buffer;
+}
+
template<QtPixelOrder PixelOrder>
static const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM(uint *buffer, const uint *src, int count,
const QPixelLayout *, const QRgb *)
@@ -601,15 +852,15 @@ inline void QT_FASTCALL storePixels<QPixelLayout::BPP32>(uchar *dest, const uint
// convertFromArgb32() assumes that no color channel is more than 8 bits.
// QImage::rgbSwapped() assumes that the red and blue color channels have the same number of bits.
QPixelLayout qPixelLayouts[QImage::NImageFormats] = {
- { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPPNone, 0, 0, 0 }, // Format_Invalid
- { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1MSB, convertIndexedToARGB32PM, 0, 0 }, // Format_Mono
- { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1LSB, convertIndexedToARGB32PM, 0, 0 }, // Format_MonoLSB
- { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertIndexedToARGB32PM, 0, 0 }, // Format_Indexed8
+ { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPPNone, 0, 0, 0, 0 }, // Format_Invalid
+ { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1MSB, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, // Format_Mono
+ { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1LSB, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, // Format_MonoLSB
+ { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, // Format_Indexed8
// Technically using convertPassThrough to convert from ARGB32PM to RGB32 is wrong,
// but everywhere this generic conversion would be wrong is currently overloaded.
- { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough }, // Format_RGB32
- { 8, 16, 8, 8, 8, 0, 8, 24, false, QPixelLayout::BPP32, convertARGB32ToARGB32PM, convertARGB32FromARGB32PM, convertPassThrough }, // Format_ARGB32
- { 8, 16, 8, 8, 8, 0, 8, 24, true, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough }, // Format_ARGB32_Premultiplied
+ { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough, convertRGB32ToRGB64 }, // Format_RGB32
+ { 8, 16, 8, 8, 8, 0, 8, 24, false, QPixelLayout::BPP32, convertARGB32ToARGB32PM, convertARGB32FromARGB32PM, convertPassThrough, convertARGB32ToARGB64PM }, // Format_ARGB32
+ { 8, 16, 8, 8, 8, 0, 8, 24, true, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough, convertARGB32PMToARGB64PM }, // Format_ARGB32_Premultiplied
#ifdef Q_COMPILER_CONSTEXPR
pixelLayoutRGB<QImage::Format_RGB16>(),
pixelLayoutARGBPM<QImage::Format_ARGB8565_Premultiplied>(),
@@ -624,55 +875,73 @@ QPixelLayout qPixelLayouts[QImage::NImageFormats] = {
{ 5, 11, 6, 5, 5, 0, 0, 0, false, QPixelLayout::BPP16,
convertToRGB32<QImage::Format_RGB16>,
convertRGBFromARGB32PM<QImage::Format_RGB16>,
- convertRGBFromRGB32<QImage::Format_RGB16>},
+ convertRGBFromRGB32<QImage::Format_RGB16>,
+ convertToRGB64<QImage::Format_RGB16>,
+ },
{ 5, 19, 6, 13, 5, 8, 8, 0, true, QPixelLayout::BPP24,
convertARGBPMToARGB32PM<QImage::Format_ARGB8565_Premultiplied>,
convertARGBPMFromARGB32PM<QImage::Format_ARGB8565_Premultiplied>,
- convertARGBPMFromRGB32<QImage::Format_ARGB8565_Premultiplied>},
+ convertARGBPMFromRGB32<QImage::Format_ARGB8565_Premultiplied>,
+ convertARGBPMToARGB64PM<QImage::Format_ARGB8565_Premultiplied>,
+ },
{ 6, 12, 6, 6, 6, 0, 0, 0, false, QPixelLayout::BPP24,
convertToRGB32<QImage::Format_RGB666>,
convertRGBFromARGB32PM<QImage::Format_RGB666>,
- convertRGBFromRGB32<QImage::Format_RGB666>},
+ convertRGBFromRGB32<QImage::Format_RGB666>,
+ convertToRGB64<QImage::Format_RGB666>,
+ },
{ 6, 12, 6, 6, 6, 0, 6, 18, true, QPixelLayout::BPP24,
convertARGBPMToARGB32PM<QImage::Format_ARGB6666_Premultiplied>,
convertARGBPMFromARGB32PM<QImage::Format_ARGB6666_Premultiplied>,
- convertARGBPMFromRGB32<QImage::Format_ARGB6666_Premultiplied>},
+ convertARGBPMFromRGB32<QImage::Format_ARGB6666_Premultiplied>,
+ convertARGBPMToARGB64PM<QImage::Format_ARGB6666_Premultiplied>,
+ },
{ 5, 10, 5, 5, 5, 0, 0, 0, false, QPixelLayout::BPP16,
convertToRGB32<QImage::Format_RGB555>,
convertRGBFromARGB32PM<QImage::Format_RGB555>,
- convertRGBFromRGB32<QImage::Format_RGB555> },
+ convertRGBFromRGB32<QImage::Format_RGB555>,
+ convertToRGB64<QImage::Format_RGB555>,
+ },
{ 5, 18, 5, 13, 5, 8, 8, 0, true, QPixelLayout::BPP24,
convertARGBPMToARGB32PM<QImage::Format_ARGB8555_Premultiplied>,
convertARGBPMFromARGB32PM<QImage::Format_ARGB8555_Premultiplied>,
- convertARGBPMFromRGB32<QImage::Format_ARGB8555_Premultiplied>},
+ convertARGBPMFromRGB32<QImage::Format_ARGB8555_Premultiplied>,
+ convertARGBPMToARGB64PM<QImage::Format_ARGB8555_Premultiplied>,
+ },
{ 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP24,
convertToRGB32<QImage::Format_RGB888>,
convertRGBFromARGB32PM<QImage::Format_RGB888>,
- convertRGBFromRGB32<QImage::Format_RGB888>},
+ convertRGBFromRGB32<QImage::Format_RGB888>,
+ convertToRGB64<QImage::Format_RGB888>,
+ },
{ 4, 8, 4, 4, 4, 0, 0, 0, false, QPixelLayout::BPP16,
convertToRGB32<QImage::Format_RGB444>,
convertRGBFromARGB32PM<QImage::Format_RGB444>,
- convertRGBFromRGB32<QImage::Format_RGB444>},
+ convertRGBFromRGB32<QImage::Format_RGB444>,
+ convertToRGB64<QImage::Format_RGB444>,
+ },
{ 4, 8, 4, 4, 4, 0, 4, 12, true, QPixelLayout::BPP16,
convertARGBPMToARGB32PM<QImage::Format_ARGB4444_Premultiplied>,
convertARGBPMFromARGB32PM<QImage::Format_ARGB4444_Premultiplied>,
- convertARGBPMFromRGB32<QImage::Format_ARGB4444_Premultiplied>},
+ convertARGBPMFromRGB32<QImage::Format_ARGB4444_Premultiplied>,
+ convertARGBPMToARGB64PM<QImage::Format_ARGB4444_Premultiplied>,
+ },
#endif
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- { 8, 24, 8, 16, 8, 8, 0, 0, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32 }, // Format_RGBX8888
- { 8, 24, 8, 16, 8, 8, 8, 0, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32 }, // Format_RGBA8888
- { 8, 24, 8, 16, 8, 8, 8, 0, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32}, // Format_RGBA8888_Premultiplied
+ { 8, 24, 8, 16, 8, 8, 0, 0, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, // Format_RGBX8888
+ { 8, 24, 8, 16, 8, 8, 8, 0, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32, convertRGBA8888ToARGB64PM }, // Format_RGBA8888
+ { 8, 24, 8, 16, 8, 8, 8, 0, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM}, // Format_RGBA8888_Premultiplied
#else
- { 8, 0, 8, 8, 8, 16, 0, 24, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32 }, // Format_RGBX8888
- { 8, 0, 8, 8, 8, 16, 8, 24, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32 }, // Format_RGBA8888 (ABGR32)
- { 8, 0, 8, 8, 8, 16, 8, 24, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32 }, // Format_RGBA8888_Premultiplied
+ { 8, 0, 8, 8, 8, 16, 0, 24, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, // Format_RGBX8888
+ { 8, 0, 8, 8, 8, 16, 8, 24, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32, convertRGBA8888ToARGB64PM }, // Format_RGBA8888 (ABGR32)
+ { 8, 0, 8, 8, 8, 16, 8, 24, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, // Format_RGBA8888_Premultiplied
#endif
- { 10, 20, 10, 10, 10, 0, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertRGB30FromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR> }, // Format_BGR30
- { 10, 20, 10, 10, 10, 0, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertA2RGB30PMFromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR> }, // Format_A2BGR30_Premultiplied
- { 10, 0, 10, 10, 10, 20, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertRGB30FromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB> }, // Format_RGB30
- { 10, 0, 10, 10, 10, 20, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertA2RGB30PMFromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB> }, // Format_A2RGB30_Premultiplied
- { 0, 0, 0, 0, 0, 0, 8, 0, false, QPixelLayout::BPP8, convertAlpha8ToRGB32, convertAlpha8FromARGB32PM, 0 }, // Format_Alpha8
- { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertGrayscale8ToRGB32, convertGrayscale8FromARGB32PM, convertGrayscale8FromRGB32 } // Format_Grayscale8
+ { 10, 20, 10, 10, 10, 0, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertRGB30FromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR>, convertA2RGB30PMToARGB64PM<PixelOrderBGR> }, // Format_BGR30
+ { 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, 0, 0, false, QPixelLayout::BPP8, convertGrayscale8ToRGB32, convertGrayscale8FromARGB32PM, convertGrayscale8FromRGB32, convertGrayscale8ToRGB64 } // Format_Grayscale8
};
const FetchPixelsFunc qFetchPixels[QPixelLayout::BPPCount] = {
@@ -758,6 +1027,20 @@ static uint *QT_FASTCALL destFetch(uint *buffer, QRasterBuffer *rasterBuffer, in
return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0));
}
+static QRgba64 *QT_FASTCALL destFetch64(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
+{
+ const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];
+ uint buffer32[buffer_size];
+ const uint *ptr = qFetchPixels[layout->bpp](buffer32, rasterBuffer->scanLine(y), x, length);
+ return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, ptr, length, layout, 0));
+}
+
+static QRgba64 *QT_FASTCALL destFetch64uint32(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
+{
+ const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];
+ const uint *src = ((const uint *)rasterBuffer->scanLine(y)) + x;
+ return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, src, length, layout, 0));
+}
static DestFetchProc destFetchProc[QImage::NImageFormats] =
{
@@ -788,6 +1071,35 @@ static DestFetchProc destFetchProc[QImage::NImageFormats] =
destFetch, // Format_Grayscale8
};
+static DestFetchProc64 destFetchProc64[QImage::NImageFormats] =
+{
+ 0, // Format_Invalid
+ destFetch64, // Format_Mono,
+ destFetch64, // Format_MonoLSB
+ 0, // Format_Indexed8
+ destFetch64uint32, // Format_RGB32
+ destFetch64uint32, // Format_ARGB32,
+ destFetch64uint32, // Format_ARGB32_Premultiplied
+ destFetch64, // Format_RGB16
+ destFetch64, // Format_ARGB8565_Premultiplied
+ destFetch64, // Format_RGB666
+ destFetch64, // Format_ARGB6666_Premultiplied
+ destFetch64, // Format_RGB555
+ destFetch64, // Format_ARGB8555_Premultiplied
+ destFetch64, // Format_RGB888
+ destFetch64, // Format_RGB444
+ destFetch64, // Format_ARGB4444_Premultiplied
+ destFetch64uint32, // Format_RGBX8888
+ destFetch64uint32, // Format_RGBA8888
+ destFetch64uint32, // Format_RGBA8888_Premultiplied
+ destFetch64uint32, // Format_BGR30
+ destFetch64uint32, // Format_A2BGR30_Premultiplied
+ destFetch64uint32, // Format_RGB30
+ destFetch64uint32, // Format_A2RGB30_Premultiplied
+ destFetch64, // Format_Alpha8
+ destFetch64, // Format_Grayscale8
+};
+
/*
Returns the color in the mono destination color table
that is the "nearest" to /color/.
@@ -904,6 +1216,125 @@ static void QT_FASTCALL destStore(QRasterBuffer *rasterBuffer, int x, int y, con
}
}
+static void QT_FASTCALL convertFromRgb64(uint *dest, const QRgba64 *src, int length)
+{
+ for (int i = 0; i < length; ++i) {
+ dest[i] = src[i].toArgb32();
+ }
+}
+
+static void QT_FASTCALL destStore64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
+{
+ uint buf[buffer_size];
+ const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];
+ StorePixelsFunc store = qStorePixels[layout->bpp];
+ uchar *dest = rasterBuffer->scanLine(y);
+ while (length) {
+ int l = qMin(length, buffer_size);
+ const uint *ptr = 0;
+ convertFromRgb64(buf, buffer, l);
+ if (!layout->premultiplied && !layout->alphaWidth)
+ ptr = layout->convertFromRGB32(buf, buf, l, layout, 0);
+ else
+ ptr = layout->convertFromARGB32PM(buf, buf, l, layout, 0);
+ store(dest, ptr, x, l);
+ length -= l;
+ buffer += l;
+ x += l;
+ }
+}
+
+#ifdef __SSE2__
+template<QtPixelOrder PixelOrder>
+static inline void qConvertARGB64PMToA2RGB30PM_sse2(uint *dest, const QRgba64 *buffer, int count)
+{
+ const __m128i gmask = _mm_set1_epi32(0x000ffc00);
+ const __m128i cmask = _mm_set1_epi32(0x000003ff);
+ int i = 0;
+ __m128i vr, vg, vb, va;
+ for (; i < count && (const uintptr_t)buffer & 0xF; ++i) {
+ *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
+ }
+
+ for (; i < count-15; i += 16) {
+ // Repremultiplying is really expensive and hard to do in SIMD without AVX2,
+ // so we try to avoid it by checking if it is needed 16 samples at a time.
+ __m128i vOr = _mm_set1_epi32(0);
+ __m128i vAnd = _mm_set1_epi32(0xffffffff);
+ for (int j = 0; j < 16; j += 2) {
+ __m128i vs = _mm_load_si128((const __m128i*)(buffer + j));
+ vOr = _mm_or_si128(vOr, vs);
+ vAnd = _mm_and_si128(vAnd, vs);
+ }
+ const quint16 orAlpha = ((uint)_mm_extract_epi16(vOr, 3)) | ((uint)_mm_extract_epi16(vOr, 7));
+ const quint16 andAlpha = ((uint)_mm_extract_epi16(vAnd, 3)) & ((uint)_mm_extract_epi16(vAnd, 7));
+
+ if (andAlpha == 0xffff) {
+ for (int j = 0; j < 16; j += 2) {
+ __m128i vs = _mm_load_si128((const __m128i*)buffer);
+ buffer += 2;
+ vr = _mm_srli_epi64(vs, 6);
+ vg = _mm_srli_epi64(vs, 16 + 6 - 10);
+ vb = _mm_srli_epi64(vs, 32 + 6);
+ vr = _mm_and_si128(vr, cmask);
+ vg = _mm_and_si128(vg, gmask);
+ vb = _mm_and_si128(vb, cmask);
+ va = _mm_srli_epi64(vs, 48 + 14);
+ if (PixelOrder == PixelOrderRGB)
+ vr = _mm_slli_epi32(vr, 20);
+ else
+ vb = _mm_slli_epi32(vb, 20);
+ va = _mm_slli_epi32(va, 30);
+ __m128i vd = _mm_or_si128(_mm_or_si128(vr, vg), _mm_or_si128(vb, va));
+ vd = _mm_shuffle_epi32(vd, _MM_SHUFFLE(3, 1, 2, 0));
+ _mm_storel_epi64((__m128i*)dest, vd);
+ dest += 2;
+ }
+ } else if (orAlpha == 0) {
+ for (int j = 0; j < 16; ++j) {
+ *dest++ = 0;
+ buffer++;
+ }
+ } else {
+ for (int j = 0; j < 16; ++j)
+ *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
+ }
+ }
+
+ for (; i < count; ++i)
+ *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
+}
+#endif
+
+static void QT_FASTCALL destStore64ARGB32(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
+{
+ uint *dest = (uint*)rasterBuffer->scanLine(y) + x;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = buffer[i].unpremultiplied().toArgb32();
+ }
+}
+
+static void QT_FASTCALL destStore64RGBA8888(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
+{
+ uint *dest = (uint*)rasterBuffer->scanLine(y) + x;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = ARGB2RGBA(buffer[i].unpremultiplied().toArgb32());
+ }
+}
+
+template<QtPixelOrder PixelOrder>
+static void QT_FASTCALL destStore64RGB30(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
+{
+ uint *dest = (uint*)rasterBuffer->scanLine(y) + x;
+#ifdef __SSE2__
+ qConvertARGB64PMToA2RGB30PM_sse2<PixelOrder>(dest, buffer, length);
+#else
+ for (int i = 0; i < length; ++i) {
+ dest[i] = qConvertRgb64ToRgb30<PixelOrder>(buffer[i]);
+ }
+#endif
+}
+
static DestStoreProc destStoreProc[QImage::NImageFormats] =
{
0, // Format_Invalid
@@ -933,6 +1364,35 @@ static DestStoreProc destStoreProc[QImage::NImageFormats] =
destStore, // Format_Grayscale8
};
+static DestStoreProc64 destStoreProc64[QImage::NImageFormats] =
+{
+ 0, // Format_Invalid
+ destStore64, // Format_Mono,
+ destStore64, // Format_MonoLSB
+ 0, // Format_Indexed8
+ destStore64, // Format_RGB32
+ destStore64ARGB32, // Format_ARGB32,
+ destStore64, // Format_ARGB32_Premultiplied
+ destStore64, // Format_RGB16
+ destStore64, // Format_ARGB8565_Premultiplied
+ destStore64, // Format_RGB666
+ destStore64, // Format_ARGB6666_Premultiplied
+ destStore64, // Format_RGB555
+ destStore64, // Format_ARGB8555_Premultiplied
+ destStore64, // Format_RGB888
+ destStore64, // Format_RGB444
+ destStore64, // Format_ARGB4444_Premultiplied
+ destStore64, // Format_RGBX8888
+ destStore64RGBA8888, // Format_RGBA8888
+ destStore64, // Format_RGBA8888_Premultiplied
+ destStore64RGB30<PixelOrderBGR>, // Format_BGR30
+ destStore64RGB30<PixelOrderBGR>, // Format_A2BGR30_Premultiplied
+ destStore64RGB30<PixelOrderRGB>, // Format_RGB30
+ destStore64RGB30<PixelOrderRGB>, // Format_A2RGB30_Premultiplied
+ destStore64, // Format_Alpha8
+ destStore64, // Format_Grayscale8
+};
+
/*
Source fetches
@@ -988,6 +1448,21 @@ static const uint *QT_FASTCALL fetchUntransformedRGB16(uint *buffer, const Opera
return buffer;
}
+static const QRgba64 *QT_FASTCALL fetchUntransformed64(QRgba64 *buffer, const Operator *,
+ const QSpanData *data, int y, int x, int length)
+{
+ const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
+ const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;
+ if (layout->bpp != QPixelLayout::BPP32) {
+ uint buffer32[buffer_size];
+ const uint *ptr = qFetchPixels[layout->bpp](buffer32, data->texture.scanLine(y), x, length);
+ return layout->convertToARGB64PM(buffer, ptr, length, layout, clut);
+ } else {
+ const uint *src = (const uint *)data->texture.scanLine(y) + x;
+ return layout->convertToARGB64PM(buffer, src, length, layout, clut);
+ }
+}
+
// blendType is either BlendTransformed or BlendTransformedTiled
template<TextureBlendType blendType>
static const uint *QT_FASTCALL fetchTransformedARGB32PM(uint *buffer, const Operator *, const QSpanData *data,
@@ -1155,6 +1630,111 @@ static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *,
return layout->convertToARGB32PM(buffer, buffer, length, layout, clut);
}
+template<TextureBlendType blendType> /* either BlendTransformed or BlendTransformedTiled */
+static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Operator *, const QSpanData *data,
+ int y, int x, int length)
+{
+ int image_width = data->texture.width;
+ int image_height = data->texture.height;
+
+ const qreal cx = x + qreal(0.5);
+ const qreal cy = y + qreal(0.5);
+
+ const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
+ FetchPixelFunc fetch = qFetchPixel[layout->bpp];
+ const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;
+
+ uint buffer32[buffer_size];
+ QRgba64 *b = buffer;
+ if (data->fast_matrix) {
+ // The increment pr x in the scanline
+ int fdx = (int)(data->m11 * fixed_scale);
+ int fdy = (int)(data->m12 * fixed_scale);
+
+ int fx = int((data->m21 * cy
+ + data->m11 * cx + data->dx) * fixed_scale);
+ int fy = int((data->m22 * cy
+ + data->m12 * cx + data->dy) * fixed_scale);
+
+ int i = 0, j = 0;
+ while (i < length) {
+ if (j == buffer_size) {
+ layout->convertToARGB64PM(b, buffer32, buffer_size, layout, clut);
+ b += buffer_size;
+ j = 0;
+ }
+ int px = fx >> 16;
+ int py = fy >> 16;
+
+ if (blendType == BlendTransformedTiled) {
+ px %= image_width;
+ py %= image_height;
+ if (px < 0) px += image_width;
+ if (py < 0) py += image_height;
+ } else {
+ px = qBound(0, px, image_width - 1);
+ py = qBound(0, py, image_height - 1);
+ }
+ buffer32[j] = fetch(data->texture.scanLine(py), px);
+
+ fx += fdx;
+ fy += fdy;
+ ++i; ++j;
+ }
+ if (j > 0) {
+ layout->convertToARGB64PM(b, buffer32, j, layout, clut);
+ b += j;
+ }
+ } else {
+ 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;
+
+ int i = 0, j = 0;
+ while (i < length) {
+ if (j == buffer_size) {
+ layout->convertToARGB64PM(b, buffer32, buffer_size, layout, clut);
+ b += buffer_size;
+ j = 0;
+ }
+ const qreal iw = fw == 0 ? 1 : 1 / fw;
+ const qreal tx = fx * iw;
+ const qreal ty = fy * iw;
+ int px = int(tx) - (tx < 0);
+ int py = int(ty) - (ty < 0);
+
+ if (blendType == BlendTransformedTiled) {
+ px %= image_width;
+ py %= image_height;
+ if (px < 0) px += image_width;
+ if (py < 0) py += image_height;
+ } else {
+ px = qBound(0, px, image_width - 1);
+ py = qBound(0, py, image_height - 1);
+ }
+ buffer32[j] = fetch(data->texture.scanLine(py), px);
+
+ fx += fdx;
+ fy += fdy;
+ fw += fdw;
+ //force increment to avoid /0
+ if (!fw) {
+ fw += fdw;
+ }
+ ++i; ++j;
+ }
+ if (j > 0) {
+ layout->convertToARGB64PM(b, buffer32, j, layout, clut);
+ b += j;
+ }
+ }
+ return buffer;
+}
+
/** \internal
interpolate 4 argb pixels with the distx and disty factor.
distx and disty bust be between 0 and 16
@@ -1245,6 +1825,42 @@ static inline uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, i
}
#endif
+#if defined(__SSE2__)
+static inline QRgba64 interpolate_4_pixels_rgb64(QRgba64 t[], QRgba64 b[], uint distx, uint disty)
+{
+ const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));
+ const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));
+
+ __m128i vt = _mm_loadu_si128((const __m128i*)t);
+ if (disty) {
+ __m128i vb = _mm_loadu_si128((const __m128i*)b);
+ vt = _mm_mulhi_epu16(vt, _mm_set1_epi16(0x10000 - disty));
+ vb = _mm_mulhi_epu16(vb, _mm_set1_epi16(disty));
+ vt = _mm_add_epi16(vt, vb);
+ }
+ vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));
+ vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));
+#ifdef Q_PROCESSOR_X86_64
+ return QRgba64::fromRgba64(_mm_cvtsi128_si64(vt));
+#else
+ QRgba64 out;
+ _mm_storel_epi64((__m128i*)&out, vt);
+ return out;
+#endif
+}
+#else
+static inline QRgba64 interpolate_4_pixels_rgb64(QRgba64 t[], QRgba64 b[], uint distx, uint disty)
+{
+ const uint dx = distx>>8;
+ const uint dy = disty>>8;
+ const uint idx = 256 - dx;
+ const uint idy = 256 - dy;
+ QRgba64 xtop = interpolate256(t[0], idx, t[1], dx);
+ QRgba64 xbot = interpolate256(b[0], idx, b[1], dx);
+ return interpolate256(xtop, idy, xbot, dy);
+}
+#endif
+
template<TextureBlendType blendType>
void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2);
@@ -2130,6 +2746,349 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
return buffer;
}
+template<TextureBlendType blendType>
+static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, const Operator *,
+ const QSpanData *data, int y, int x, int length)
+{
+ const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
+ const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;
+
+ 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);
+ int fdy = (int)(data->m12 * fixed_scale);
+
+ int fx = int((data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale);
+ int fy = int((data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale);
+
+ 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);
+
+ FetchPixelFunc fetch = qFetchPixel[layout->bpp];
+ uint sbuf1[buffer_size];
+ uint sbuf2[buffer_size];
+ QRgba64 buf1[buffer_size];
+ QRgba64 buf2[buffer_size];
+ 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] = ((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;
+ }
+
+ 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 < len-3; 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);
+ }
+
+ fx += fdx;
+ }
+ layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut);
+ if (disty)
+ layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);
+
+ for (int i = 0; i < len; ++i) {
+ int distx = (fracX & 0x0000ffff);
+#if defined(__SSE2__)
+ const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));
+ const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));
+ __m128i vt = _mm_loadu_si128((const __m128i*)(buf1 + i*2));
+ if (disty) {
+ __m128i vb = _mm_loadu_si128((const __m128i*)(buf2 + i*2));
+ vt = _mm_mulhi_epu16(vt, vidy);
+ vb = _mm_mulhi_epu16(vb, vdy);
+ vt = _mm_add_epi16(vt, vb);
+ }
+ vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));
+ vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));
+ _mm_storel_epi64((__m128i*)(b+i), vt);
+#else
+ b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty);
+#endif
+ fracX += fdx;
+ }
+ length -= len;
+ b += len;
+ }
+ } else { //rotation
+ FetchPixelFunc fetch = qFetchPixel[layout->bpp];
+ uint sbuf1[buffer_size];
+ uint sbuf2[buffer_size];
+ QRgba64 buf1[buffer_size];
+ QRgba64 buf2[buffer_size];
+ QRgba64 *end = buffer + length;
+ QRgba64 *b = buffer;
+
+ 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;
+ }
+
+ 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 < len-3; i+=4) {
+ if (fdx > 0 && (short)_mm_extract_epi16(v_fx, 7) >= image_x2)
+ break;
+ if (fdx < 0 && (short)_mm_extract_epi16(v_fx, 7) < image_x1)
+ break;
+ if (fdy > 0 && (short)_mm_extract_epi16(v_fy, 7) >= image_y2)
+ break;
+ if (fdy < 0 && (short)_mm_extract_epi16(v_fy, 7) < image_y1)
+ break;
+ 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);
+ }
+
+ fx += fdx;
+ fy += fdy;
+ }
+ layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut);
+ layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);
+
+ for (int i = 0; i < len; ++i) {
+ int distx = (fracX & 0x0000ffff);
+ int disty = (fracY & 0x0000ffff);
+ b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty);
+ fracX += fdx;
+ fracY += fdy;
+ }
+
+ length -= len;
+ b += len;
+ }
+ }
+ } else {
+ 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;
+
+ FetchPixelFunc fetch = qFetchPixel[layout->bpp];
+ uint sbuf1[buffer_size];
+ uint sbuf2[buffer_size];
+ QRgba64 buf1[buffer_size];
+ QRgba64 buf2[buffer_size];
+ QRgba64 *b = buffer;
+
+ int distxs[buffer_size / 2];
+ int distys[buffer_size / 2];
+
+ while (length) {
+ int len = qMin(length, buffer_size / 2);
+ for (int i = 0; i < len; ++i) {
+ const qreal iw = fw == 0 ? 1 : 1 / fw;
+ const qreal px = fx * iw - qreal(0.5);
+ const qreal py = fy * iw - qreal(0.5);
+
+ int x1 = int(px) - (px < 0);
+ int x2;
+ int y1 = int(py) - (py < 0);
+ int y2;
+
+ 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);
+
+ 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);
+ }
+
+ fx += fdx;
+ fy += fdy;
+ fw += fdw;
+ //force increment to avoid /0
+ if (!fw)
+ fw += fdw;
+ }
+
+ layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut);
+ layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);
+
+ for (int i = 0; i < len; ++i) {
+ int distx = distxs[i];
+ int disty = distys[i];
+ b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty);
+ }
+
+ length -= len;
+ b += len;
+ }
+ }
+
+ return buffer;
+}
+
static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = {
// Untransformed
{
@@ -2298,12 +3257,186 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = {
},
};
+static SourceFetchProc64 sourceFetch64[NBlendTypes][QImage::NImageFormats] = {
+ // Untransformed
+ {
+ 0, // Invalid
+ fetchUntransformed64, // Mono
+ fetchUntransformed64, // MonoLsb
+ fetchUntransformed64, // Indexed8
+ fetchUntransformed64, // RGB32
+ fetchUntransformed64, // ARGB32
+ fetchUntransformed64, // ARGB32_Premultiplied
+ fetchUntransformed64, // RGB16
+ fetchUntransformed64, // ARGB8565_Premultiplied
+ fetchUntransformed64, // RGB666
+ fetchUntransformed64, // ARGB6666_Premultiplied
+ fetchUntransformed64, // RGB555
+ fetchUntransformed64, // ARGB8555_Premultiplied
+ fetchUntransformed64, // RGB888
+ fetchUntransformed64, // RGB444
+ fetchUntransformed64, // ARGB4444_Premultiplied
+ fetchUntransformed64, // RGBX8888
+ fetchUntransformed64, // RGBA8888
+ fetchUntransformed64, // RGBA8888_Premultiplied
+ fetchUntransformed64, // Format_BGR30
+ fetchUntransformed64, // Format_A2BGR30_Premultiplied
+ fetchUntransformed64, // Format_RGB30
+ fetchUntransformed64, // Format_A2RGB30_Premultiplied
+ fetchUntransformed64, // Alpha8
+ fetchUntransformed64, // Grayscale8
+ },
+ // Tiled
+ {
+ 0, // Invalid
+ fetchUntransformed64, // Mono
+ fetchUntransformed64, // MonoLsb
+ fetchUntransformed64, // Indexed8
+ fetchUntransformed64, // RGB32
+ fetchUntransformed64, // ARGB32
+ fetchUntransformed64, // ARGB32_Premultiplied
+ fetchUntransformed64, // RGB16
+ fetchUntransformed64, // ARGB8565_Premultiplied
+ fetchUntransformed64, // RGB666
+ fetchUntransformed64, // ARGB6666_Premultiplied
+ fetchUntransformed64, // RGB555
+ fetchUntransformed64, // ARGB8555_Premultiplied
+ fetchUntransformed64, // RGB888
+ fetchUntransformed64, // RGB444
+ fetchUntransformed64, // ARGB4444_Premultiplied
+ fetchUntransformed64, // RGBX8888
+ fetchUntransformed64, // RGBA8888
+ fetchUntransformed64, // RGBA8888_Premultiplied
+ fetchUntransformed64, // BGR30
+ fetchUntransformed64, // A2BGR30_Premultiplied
+ fetchUntransformed64, // RGB30
+ fetchUntransformed64, // A2RGB30_Premultiplied
+ fetchUntransformed64, // Alpha8
+ fetchUntransformed64, // Grayscale8
+ },
+ // Transformed
+ {
+ 0, // Invalid
+ fetchTransformed64<BlendTransformed>, // Mono
+ fetchTransformed64<BlendTransformed>, // MonoLsb
+ fetchTransformed64<BlendTransformed>, // Indexed8
+ fetchTransformed64<BlendTransformed>, // RGB32
+ fetchTransformed64<BlendTransformed>, // ARGB32
+ fetchTransformed64<BlendTransformed>, // ARGB32_Premultiplied
+ fetchTransformed64<BlendTransformed>, // RGB16
+ fetchTransformed64<BlendTransformed>, // ARGB8565_Premultiplied
+ fetchTransformed64<BlendTransformed>, // RGB666
+ fetchTransformed64<BlendTransformed>, // ARGB6666_Premultiplied
+ fetchTransformed64<BlendTransformed>, // RGB555
+ fetchTransformed64<BlendTransformed>, // ARGB8555_Premultiplied
+ fetchTransformed64<BlendTransformed>, // RGB888
+ fetchTransformed64<BlendTransformed>, // RGB444
+ fetchTransformed64<BlendTransformed>, // ARGB4444_Premultiplied
+ fetchTransformed64<BlendTransformed>, // RGBX8888
+ fetchTransformed64<BlendTransformed>, // RGBA8888
+ fetchTransformed64<BlendTransformed>, // RGBA8888_Premultiplied
+ fetchTransformed64<BlendTransformed>, // BGR30
+ fetchTransformed64<BlendTransformed>, // A2BGR30_Premultiplied
+ fetchTransformed64<BlendTransformed>, // RGB30
+ fetchTransformed64<BlendTransformed>, // A2RGB30_Premultiplied
+ fetchTransformed64<BlendTransformed>, // Alpah8
+ fetchTransformed64<BlendTransformed>, // Grayscale8
+ },
+ {
+ 0, // TransformedTiled
+ fetchTransformed64<BlendTransformedTiled>, // Mono
+ fetchTransformed64<BlendTransformedTiled>, // MonoLsb
+ fetchTransformed64<BlendTransformedTiled>, // Indexed8
+ fetchTransformed64<BlendTransformedTiled>, // RGB32
+ fetchTransformed64<BlendTransformedTiled>, // ARGB32
+ fetchTransformed64<BlendTransformedTiled>, // ARGB32_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // RGB16
+ fetchTransformed64<BlendTransformedTiled>, // ARGB8565_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // RGB666
+ fetchTransformed64<BlendTransformedTiled>, // ARGB6666_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // RGB555
+ fetchTransformed64<BlendTransformedTiled>, // ARGB8555_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // RGB888
+ fetchTransformed64<BlendTransformedTiled>, // RGB444
+ fetchTransformed64<BlendTransformedTiled>, // ARGB4444_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // RGBX8888
+ fetchTransformed64<BlendTransformedTiled>, // RGBA8888
+ fetchTransformed64<BlendTransformedTiled>, // RGBA8888_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // BGR30
+ fetchTransformed64<BlendTransformedTiled>, // A2BGR30_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // RGB30
+ fetchTransformed64<BlendTransformedTiled>, // A2RGB30_Premultiplied
+ fetchTransformed64<BlendTransformedTiled>, // Alpha8
+ fetchTransformed64<BlendTransformedTiled>, // Grayscale8
+ },
+ {
+ 0, // Bilinear
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // Mono
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // MonoLsb
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // Indexed8
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB32
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB32
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB32_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB16
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB8565_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB666
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB6666_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB555
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB8555_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB888
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB444
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB4444_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGBX8888
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGBA8888
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGBA8888_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // BGR30
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // A2BGR30_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB30
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // A2RGB30_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // Alpha8
+ fetchTransformedBilinear64<BlendTransformedBilinear>, // Grayscale8
+ },
+ {
+ 0, // BilinearTiled
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Mono
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // MonoLsb
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Indexed8
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB32
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB32
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB32_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB16
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB8565_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB666
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB6666_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB555
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB8555_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB888
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB444
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB4444_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGBX8888
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGBA8888
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGBA8888_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // BGR30
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // A2BGR30_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB30
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // A2RGB30_Premultiplied
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Alpha8
+ fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Grayscale8
+ },
+};
+
#define FIXPT_BITS 8
#define FIXPT_SIZE (1<<FIXPT_BITS)
static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos)
{
int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
+ return data->colorTable[qt_gradient_clamp(data, ipos)].toArgb32();
+}
+
+static const QRgba64& qt_gradient_pixel64_fixed(const QGradientData *data, int fixed_pos)
+{
+ int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
return data->colorTable[qt_gradient_clamp(data, ipos)];
}
@@ -2320,10 +3453,50 @@ static void QT_FASTCALL getLinearGradientValues(LinearGradientValues *v, const Q
}
}
-static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Operator *op, const QSpanData *data,
- int y, int x, int length)
+class GradientBase32
+{
+public:
+ typedef uint Type;
+ static Type null() { return 0; }
+ static Type fetchSingle(const QGradientData& gradient, qreal v)
+ {
+ return qt_gradient_pixel(&gradient, v);
+ }
+ static Type fetchSingle(const QGradientData& gradient, int v)
+ {
+ return qt_gradient_pixel_fixed(&gradient, v);
+ }
+ static void memfill(Type *buffer, Type fill, int length)
+ {
+ qt_memfill32(buffer, fill, length);
+ }
+};
+
+class GradientBase64
+{
+public:
+ typedef QRgba64 Type;
+ static Type null() { return QRgba64::fromRgba64(0); }
+ static Type fetchSingle(const QGradientData& gradient, qreal v)
+ {
+ return qt_gradient_pixel64(&gradient, v);
+ }
+ static Type fetchSingle(const QGradientData& gradient, int v)
+ {
+ return qt_gradient_pixel64_fixed(&gradient, v);
+ }
+ static void memfill(Type *buffer, Type fill, int length)
+ {
+ qt_memfill64((quint64*)buffer, fill, length);
+ }
+};
+
+template<class GradientBase, typename BlendType>
+static inline const BlendType * QT_FASTCALL qt_fetch_linear_gradient_template(
+ BlendType *buffer, const Operator *op, const QSpanData *data,
+ int y, int x, int length)
{
- const uint *b = buffer;
+ const BlendType *b = buffer;
qreal t, inc;
bool affine = true;
@@ -2343,10 +3516,10 @@ static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Ope
}
}
- const uint *end = buffer + length;
+ const BlendType *end = buffer + length;
if (affine) {
if (inc > qreal(-1e-5) && inc < qreal(1e-5)) {
- QT_MEMFILL_UINT(buffer, length, qt_gradient_pixel_fixed(&data->gradient, int(t * FIXPT_SIZE)));
+ GradientBase::memfill(buffer, GradientBase::fetchSingle(data->gradient, int(t * FIXPT_SIZE)), length);
} else {
if (t+inc*length < qreal(INT_MAX >> (FIXPT_BITS + 1)) &&
t+inc*length > qreal(INT_MIN >> (FIXPT_BITS + 1))) {
@@ -2354,14 +3527,14 @@ static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Ope
int t_fixed = int(t * FIXPT_SIZE);
int inc_fixed = int(inc * FIXPT_SIZE);
while (buffer < end) {
- *buffer = qt_gradient_pixel_fixed(&data->gradient, t_fixed);
+ *buffer = GradientBase::fetchSingle(data->gradient, t_fixed);
t_fixed += inc_fixed;
++buffer;
}
} else {
// we have to fall back to float math
while (buffer < end) {
- *buffer = qt_gradient_pixel(&data->gradient, t/GRADIENT_STOPTABLE_SIZE);
+ *buffer = GradientBase::fetchSingle(data->gradient, t/GRADIENT_STOPTABLE_SIZE);
t += inc;
++buffer;
}
@@ -2374,7 +3547,7 @@ static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Ope
qreal y = ry/rw;
t = (op->linear.dx*x + op->linear.dy *y) + op->linear.off;
- *buffer = qt_gradient_pixel(&data->gradient, t);
+ *buffer = GradientBase::fetchSingle(data->gradient, t);
rx += data->m11;
ry += data->m12;
rw += data->m13;
@@ -2388,6 +3561,18 @@ static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Ope
return b;
}
+static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Operator *op, const QSpanData *data,
+ int y, int x, int length)
+{
+ return qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length);
+}
+
+static const QRgba64 * QT_FASTCALL qt_fetch_linear_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data,
+ int y, int x, int length)
+{
+ return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length);
+}
+
static void QT_FASTCALL getRadialGradientValues(RadialGradientValues *v, const QSpanData *data)
{
v->dx = data->gradient.radial.center.x - data->gradient.radial.focal.x;
@@ -2402,19 +3587,22 @@ static void QT_FASTCALL getRadialGradientValues(RadialGradientValues *v, const Q
v->extended = !qFuzzyIsNull(data->gradient.radial.focal.radius) || v->a <= 0;
}
-class RadialFetchPlain
+template <class GradientBase>
+class RadialFetchPlain : public GradientBase
{
public:
- static inline void fetch(uint *buffer, uint *end, const Operator *op, const QSpanData *data, qreal det,
- qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b)
+ typedef typename GradientBase::Type BlendType;
+ static void fetch(BlendType *buffer, BlendType *end,
+ const Operator *op, const QSpanData *data, qreal det,
+ qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b)
{
if (op->radial.extended) {
while (buffer < end) {
- quint32 result = 0;
+ BlendType result = GradientBase::null();
if (det >= 0) {
qreal w = qSqrt(det) - b;
if (data->gradient.radial.focal.radius + op->radial.dr * w >= 0)
- result = qt_gradient_pixel(&data->gradient, w);
+ result = GradientBase::fetchSingle(data->gradient, w);
}
*buffer = result;
@@ -2427,7 +3615,7 @@ public:
}
} else {
while (buffer < end) {
- *buffer++ = qt_gradient_pixel(&data->gradient, qSqrt(det) - b);
+ *buffer++ = GradientBase::fetchSingle(data->gradient, qSqrt(det) - b);
det += delta_det;
delta_det += delta_delta_det;
@@ -2440,15 +3628,23 @@ public:
const uint * QT_FASTCALL qt_fetch_radial_gradient_plain(uint *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length)
{
- return qt_fetch_radial_gradient_template<RadialFetchPlain>(buffer, op, data, y, x, length);
+ return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, uint>(buffer, op, data, y, x, length);
}
static SourceFetchProc qt_fetch_radial_gradient = qt_fetch_radial_gradient_plain;
-static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Operator *, const QSpanData *data,
- int y, int x, int length)
+const QRgba64 * QT_FASTCALL qt_fetch_radial_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data,
+ int y, int x, int length)
{
- const uint *b = buffer;
+ return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length);
+}
+
+template <class GradientBase, typename BlendType>
+static inline const BlendType * QT_FASTCALL qt_fetch_conical_gradient_template(
+ BlendType *buffer, const QSpanData *data,
+ int y, int x, int length)
+{
+ const BlendType *b = buffer;
qreal rx = data->m21 * (y + qreal(0.5))
+ data->dx + data->m11 * (x + qreal(0.5));
qreal ry = data->m22 * (y + qreal(0.5))
@@ -2457,14 +3653,14 @@ static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Op
const qreal inv2pi = M_1_PI / 2.0;
- const uint *end = buffer + length;
+ const BlendType *end = buffer + length;
if (affine) {
rx -= data->gradient.conical.center.x;
ry -= data->gradient.conical.center.y;
while (buffer < end) {
qreal angle = qAtan2(ry, rx) + data->gradient.conical.angle;
- *buffer = qt_gradient_pixel(&data->gradient, 1 - angle * inv2pi);
+ *buffer = GradientBase::fetchSingle(data->gradient, 1 - angle * inv2pi);
rx += data->m11;
ry += data->m12;
@@ -2480,7 +3676,7 @@ static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Op
rx/rw - data->gradient.conical.center.y)
+ data->gradient.conical.angle;
- *buffer = qt_gradient_pixel(&data->gradient, 1 - angle * inv2pi);
+ *buffer = GradientBase::fetchSingle(data->gradient, 1 - angle * inv2pi);
rx += data->m11;
ry += data->m12;
@@ -2494,1763 +3690,29 @@ static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Op
return b;
}
-# define PRELOAD_INIT(x)
-# define PRELOAD_INIT2(x,y)
-# define PRELOAD_COND(x)
-# define PRELOAD_COND2(x,y)
-
-/* The constant alpha factor describes an alpha factor that gets applied
- to the result of the composition operation combining it with the destination.
-
- The intent is that if const_alpha == 0. we get back dest, and if const_alpha == 1.
- we get the unmodified operation
-
- result = src op dest
- dest = result * const_alpha + dest * (1. - const_alpha)
-
- This means that in the comments below, the first line is the const_alpha==255 case, the
- second line the general one.
-
- In the lines below:
- s == src, sa == alpha(src), sia = 1 - alpha(src)
- d == dest, da == alpha(dest), dia = 1 - alpha(dest)
- ca = const_alpha, cia = 1 - const_alpha
-
- The methods exist in two variants. One where we have a constant source, the other
- where the source is an array of pixels.
-*/
-
-/*
- result = 0
- d = d * cia
-*/
-#define comp_func_Clear_impl(dest, length, const_alpha)\
-{\
- if (const_alpha == 255) {\
- QT_MEMFILL_UINT(dest, length, 0);\
- } else {\
- int ialpha = 255 - const_alpha;\
- PRELOAD_INIT(dest)\
- for (int i = 0; i < length; ++i) {\
- PRELOAD_COND(dest)\
- dest[i] = BYTE_MUL(dest[i], ialpha);\
- }\
- }\
-}
-
-void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)
-{
- comp_func_Clear_impl(dest, length, const_alpha);
-}
-
-void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
-{
- comp_func_Clear_impl(dest, length, const_alpha);
-}
-
-/*
- result = s
- dest = s * ca + d * cia
-*/
-void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255) {
- QT_MEMFILL_UINT(dest, length, color);
- } else {
- int ialpha = 255 - const_alpha;
- color = BYTE_MUL(color, const_alpha);
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = color + BYTE_MUL(dest[i], ialpha);
- }
- }
-}
-
-void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255) {
- ::memcpy(dest, src, length * sizeof(uint));
- } else {
- int ialpha = 255 - const_alpha;
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- dest[i] = INTERPOLATE_PIXEL_255(src[i], const_alpha, dest[i], ialpha);
- }
- }
-}
-
-void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)
-{
-}
-
-void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
-{
-}
-
-/*
- result = s + d * sia
- dest = (s + d * sia) * ca + d * cia
- = s * ca + d * (sia * ca + cia)
- = s * ca + d * (1 - sa*ca)
-*/
-void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha)
-{
- if ((const_alpha & qAlpha(color)) == 255) {
- QT_MEMFILL_UINT(dest, length, color);
- } else {
- if (const_alpha != 255)
- color = BYTE_MUL(color, const_alpha);
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = color + BYTE_MUL(dest[i], qAlpha(~color));
- }
- }
-}
-
-void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = src[i];
- if (s >= 0xff000000)
- dest[i] = s;
- else if (s != 0)
- dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
- }
- } else {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = BYTE_MUL(src[i], const_alpha);
- dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
- }
- }
-}
-
-/*
- result = d + s * dia
- dest = (d + s * dia) * ca + d * cia
- = d + s * dia * ca
-*/
-void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha != 255)
- color = BYTE_MUL(color, const_alpha);
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- dest[i] = d + BYTE_MUL(color, qAlpha(~d));
- }
-}
-
-void QT_FASTCALL comp_func_DestinationOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- dest[i] = d + BYTE_MUL(src[i], qAlpha(~d));
- }
- } else {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = BYTE_MUL(src[i], const_alpha);
- dest[i] = d + BYTE_MUL(s, qAlpha(~d));
- }
- }
-}
-
-/*
- result = s * da
- dest = s * da * ca + d * cia
-*/
-void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)
-{
- PRELOAD_INIT(dest)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = BYTE_MUL(color, qAlpha(dest[i]));
- }
- } else {
- color = BYTE_MUL(color, const_alpha);
- uint cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(d), d, cia);
- }
- }
-}
-
-void QT_FASTCALL comp_func_SourceIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- dest[i] = BYTE_MUL(src[i], qAlpha(dest[i]));
- }
- } else {
- uint cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = BYTE_MUL(src[i], const_alpha);
- dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, cia);
- }
- }
-}
-
-/*
- result = d * sa
- dest = d * sa * ca + d * cia
- = d * (sa * ca + cia)
-*/
-void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha)
-{
- uint a = qAlpha(color);
- if (const_alpha != 255) {
- a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
- }
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = BYTE_MUL(dest[i], a);
- }
-}
-
-void QT_FASTCALL comp_func_DestinationIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- dest[i] = BYTE_MUL(dest[i], qAlpha(src[i]));
- }
- } else {
- int cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint a = BYTE_MUL(qAlpha(src[i]), const_alpha) + cia;
- dest[i] = BYTE_MUL(dest[i], a);
- }
- }
-}
-
-/*
- result = s * dia
- dest = s * dia * ca + d * cia
-*/
-
-void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)
-{
- PRELOAD_INIT(dest)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = BYTE_MUL(color, qAlpha(~dest[i]));
- }
- } else {
- color = BYTE_MUL(color, const_alpha);
- int cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, cia);
- }
- }
-}
-
-void QT_FASTCALL comp_func_SourceOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- dest[i] = BYTE_MUL(src[i], qAlpha(~dest[i]));
- }
- } else {
- int cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = BYTE_MUL(src[i], const_alpha);
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, cia);
- }
- }
-}
-
-/*
- result = d * sia
- dest = d * sia * ca + d * cia
- = d * (sia * ca + cia)
-*/
-void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha)
-{
- uint a = qAlpha(~color);
- if (const_alpha != 255)
- a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = BYTE_MUL(dest[i], a);
- }
-}
-
-void QT_FASTCALL comp_func_DestinationOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- dest[i] = BYTE_MUL(dest[i], qAlpha(~src[i]));
- }
- } else {
- int cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint sia = BYTE_MUL(qAlpha(~src[i]), const_alpha) + cia;
- dest[i] = BYTE_MUL(dest[i], sia);
- }
- }
-}
-
-/*
- result = s*da + d*sia
- dest = s*da*ca + d*sia*ca + d *cia
- = s*ca * da + d * (sia*ca + cia)
- = s*ca * da + d * (1 - sa*ca)
-*/
-void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha != 255) {
- color = BYTE_MUL(color, const_alpha);
- }
- uint sia = qAlpha(~color);
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(dest[i]), dest[i], sia);
- }
-}
-
-void QT_FASTCALL comp_func_SourceAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = src[i];
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
- }
- } else {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = BYTE_MUL(src[i], const_alpha);
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
- }
- }
-}
-
-/*
- result = d*sa + s*dia
- dest = d*sa*ca + s*dia*ca + d *cia
- = s*ca * dia + d * (sa*ca + cia)
-*/
-void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha)
-{
- uint a = qAlpha(color);
- if (const_alpha != 255) {
- color = BYTE_MUL(color, const_alpha);
- a = qAlpha(color) + 255 - const_alpha;
- }
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(d, a, color, qAlpha(~d));
- }
-}
-
-void QT_FASTCALL comp_func_DestinationAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = src[i];
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(d, qAlpha(s), s, qAlpha(~d));
- }
- } else {
- int cia = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint s = BYTE_MUL(src[i], const_alpha);
- uint d = dest[i];
- uint a = qAlpha(s) + cia;
- dest[i] = INTERPOLATE_PIXEL_255(d, a, s, qAlpha(~d));
- }
- }
-}
-
-/*
- result = d*sia + s*dia
- dest = d*sia*ca + s*dia*ca + d *cia
- = s*ca * dia + d * (sia*ca + cia)
- = s*ca * dia + d * (1 - sa*ca)
-*/
-void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha != 255)
- color = BYTE_MUL(color, const_alpha);
- uint sia = qAlpha(~color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, sia);
- }
-}
-
-void QT_FASTCALL comp_func_XOR(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- PRELOAD_INIT2(dest, src)
- if (const_alpha == 255) {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
- dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
- }
- } else {
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = BYTE_MUL(src[i], const_alpha);
- dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
- }
- }
-}
-
-struct QFullCoverage {
- inline void store(uint *dest, const uint src) const
- {
- *dest = src;
- }
-};
-
-struct QPartialCoverage {
- inline QPartialCoverage(uint const_alpha)
- : ca(const_alpha)
- , ica(255 - const_alpha)
- {
- }
-
- inline void store(uint *dest, const uint src) const
- {
- *dest = INTERPOLATE_PIXEL_255(src, ca, *dest, ica);
- }
-
-private:
- const uint ca;
- const uint ica;
-};
-
-static inline int mix_alpha(int da, int sa)
-{
- return 255 - ((255 - sa) * (255 - da) >> 8);
-}
-
-/*
- Dca' = Sca.Da + Dca.Sa + Sca.(1 - Da) + Dca.(1 - Sa)
- = Sca + Dca
-*/
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int length, uint color, const T &coverage)
-{
- uint s = color;
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint 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)
- comp_func_solid_Plus_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Plus_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Plus_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- d = comp_func_Plus_one_pixel(d, s);
-
- coverage.store(&dest[i], d);
- }
-}
-
-void QT_FASTCALL comp_func_Plus(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Plus_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Plus_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
-/*
- Dca' = Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
-*/
-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));
-}
-
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) multiply_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) multiply_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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
-*/
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) 255 - qt_div_255((255-a) * (255-b))
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) 255 - (((255-a) * (255-b)) >> 8)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Screen_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
-/*
- if 2.Dca < Da
- Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
- otherwise
- Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)
-*/
-static inline int overlay_op(int dst, int src, int da, int sa)
-{
- const int temp = src * (255 - da) + dst * (255 - sa);
- if (2 * dst < da)
- return qt_div_255(2 * src * dst + temp);
- else
- return qt_div_255(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)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) overlay_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) overlay_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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
-*/
-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));
-}
-
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) darken_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) darken_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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
-*/
-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));
-}
-
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) lighten_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) lighten_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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)
- otherwise
- Dca' = Dca.Sa/(1-Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
-*/
-static inline int color_dodge_op(int dst, int src, int da, int sa)
-{
- const int sa_da = sa * da;
- const int dst_sa = dst * sa;
- const int src_da = src * da;
-
- const int temp = src * (255 - da) + dst * (255 - sa);
- if (src_da + dst_sa >= sa_da)
- return qt_div_255(sa_da + temp);
- else
- return qt_div_255(255 * dst_sa / (255 - 255 * 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)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a,b) color_dodge_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) color_dodge_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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)
- otherwise
- Dca' = Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa)
-*/
-static inline int color_burn_op(int dst, int src, int da, int sa)
-{
- const int src_da = src * da;
- const int dst_sa = dst * sa;
- const int sa_da = sa * da;
-
- const int temp = src * (255 - da) + dst * (255 - sa);
-
- if (src == 0 || src_da + dst_sa <= sa_da)
- return qt_div_255(temp);
- return qt_div_255(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)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) color_burn_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) color_burn_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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)
- otherwise
- Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)
-*/
-static inline uint hardlight_op(int dst, int src, int da, int sa)
-{
- const uint temp = src * (255 - da) + dst * (255 - sa);
-
- if (2 * src < sa)
- return qt_div_255(2 * src * dst + temp);
- else
- return qt_div_255(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)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) hardlight_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) hardlight_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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)
- otherwise if 2.Sca > Sa and 4.Dca <= Da
- Dca' = Dca.Sa + Da.(2.Sca - Sa).(4.Dca/Da.(4.Dca/Da + 1).(Dca/Da - 1) + 7.Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)
- otherwise if 2.Sca > Sa and 4.Dca > Da
- Dca' = Dca.Sa + Da.(2.Sca - Sa).((Dca/Da)^0.5 - Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)
-*/
-static inline int soft_light_op(int dst, int src, int da, int sa)
-{
- const int src2 = src << 1;
- const int dst_np = da != 0 ? (255 * dst) / da : 0;
- const int temp = (src * (255 - da) + dst * (255 - sa)) * 255;
-
- if (src2 < sa)
- return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025;
- else if (4 * dst <= da)
- return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
- else {
- return (dst * sa * 255 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
- }
-}
-
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) soft_light_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint 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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) soft_light_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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)
-*/
-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));
-}
-
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) difference_op(a, b, da, sa)
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) difference_op(a, b, da, sa)
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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)
-*/
-template <typename T>
-Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_impl(uint *dest, int length, uint color, const T &coverage)
-{
- int sa = qAlpha(color);
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
-
- PRELOAD_INIT(dest)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
- uint d = dest[i];
- int da = qAlpha(d);
-
-#define OP(a, b) (a + b - qt_div_255(2*(a*b)))
- int r = OP( qRed(d), sr);
- int b = OP( qBlue(d), sb);
- int g = OP(qGreen(d), sg);
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(r, g, b, a));
- }
-}
-
-void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
-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)
-{
- PRELOAD_INIT2(dest, src)
- for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
- uint d = dest[i];
- uint s = src[i];
-
- int da = qAlpha(d);
- int sa = qAlpha(s);
-
-#define OP(a, b) (a + b - ((a*b) >> 7))
- int r = OP( qRed(d), qRed(s));
- int b = OP( qBlue(d), qBlue(s));
- int g = OP(qGreen(d), qGreen(s));
- int a = mix_alpha(da, sa);
-#undef OP
-
- coverage.store(&dest[i], qRgba(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)
- 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,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--)
- *dest++ |= color;
-}
-
-void QT_FASTCALL rasterop_SourceOrDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--)
- *dest++ |= *src++;
-}
-
-void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- color |= 0xff000000;
- while (length--)
- *dest++ &= color;
-}
-
-void QT_FASTCALL rasterop_SourceAndDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (*src & *dest) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- color &= 0x00ffffff;
- while (length--)
- *dest++ ^= color;
-}
-
-void QT_FASTCALL rasterop_SourceXorDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (*src ^ *dest) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- color = ~color;
- while (length--) {
- *dest = (color & ~(*dest)) | 0xff000000;
- ++dest;
- }
-}
-
-void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (~(*src) & ~(*dest)) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- color = ~color | 0xff000000;
- while (length--) {
- *dest = color | ~(*dest);
- ++dest;
- }
-}
-
-void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = ~(*src) | ~(*dest) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- color = ~color & 0x00ffffff;
- while (length--) {
- *dest = color ^ (*dest);
- ++dest;
- }
-}
-
-void QT_FASTCALL rasterop_NotSourceXorDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = ((~(*src)) ^ (*dest)) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length,
- uint color, uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- qt_memfill(dest, ~color | 0xff000000, length);
-}
-
-void QT_FASTCALL rasterop_NotSource(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src,
- int length, uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--)
- *dest++ = ~(*src++) | 0xff000000;
-}
-
-void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- color = ~color | 0xff000000;
- while (length--) {
- *dest = color & *dest;
- ++dest;
- }
-}
-
-void QT_FASTCALL rasterop_NotSourceAndDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (~(*src) & *dest) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (color & ~(*dest)) | 0xff000000;
- ++dest;
- }
-}
-
-void QT_FASTCALL rasterop_SourceAndNotDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (*src & ~(*dest)) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_NotSourceOrDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (~(*src) | *dest) | 0xff000000;
- ++dest; ++src;
- }
-}
-
-void QT_FASTCALL rasterop_solid_NotSourceOrDestination(uint *Q_DECL_RESTRICT dest,
- int length,
- uint color,
- uint const_alpha)
+static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Operator *, const QSpanData *data,
+ int y, int x, int length)
{
- Q_UNUSED(const_alpha);
- color = ~color | 0xff000000;
- while (length--)
- *dest++ |= color;
+ return qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length);
}
-void QT_FASTCALL rasterop_SourceOrNotDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
+static const QRgba64 * QT_FASTCALL qt_fetch_conical_gradient_rgb64(QRgba64 *buffer, const Operator *, const QSpanData *data,
+ int y, int x, int length)
{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (*src | ~(*dest)) | 0xff000000;
- ++dest; ++src;
- }
+ return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length);
}
-void QT_FASTCALL rasterop_solid_SourceOrNotDestination(uint *Q_DECL_RESTRICT dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(const_alpha);
- while (length--) {
- *dest = (color | ~(*dest)) | 0xff000000;
- ++dest;
- }
-}
+extern CompositionFunctionSolid qt_functionForModeSolid_C[];
+extern CompositionFunctionSolid64 qt_functionForModeSolid64_C[];
-void QT_FASTCALL rasterop_ClearDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(src);
- comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
-}
-
-void QT_FASTCALL rasterop_solid_ClearDestination(uint *Q_DECL_RESTRICT dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(color);
- comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
-}
-
-void QT_FASTCALL rasterop_SetDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(src);
- comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
-}
-
-void QT_FASTCALL rasterop_solid_SetDestination(uint *Q_DECL_RESTRICT dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(color);
- comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
-}
-
-void QT_FASTCALL rasterop_NotDestination(uint *Q_DECL_RESTRICT dest,
- const uint *Q_DECL_RESTRICT src,
- int length,
- uint const_alpha)
-{
- Q_UNUSED(src);
- rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
-}
-
-void QT_FASTCALL rasterop_solid_NotDestination(uint *Q_DECL_RESTRICT dest,
- int length,
- uint color,
- uint const_alpha)
-{
- Q_UNUSED(color);
- rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
-}
-
-static CompositionFunctionSolid functionForModeSolid_C[] = {
- comp_func_solid_SourceOver,
- comp_func_solid_DestinationOver,
- comp_func_solid_Clear,
- comp_func_solid_Source,
- comp_func_solid_Destination,
- comp_func_solid_SourceIn,
- comp_func_solid_DestinationIn,
- comp_func_solid_SourceOut,
- comp_func_solid_DestinationOut,
- comp_func_solid_SourceAtop,
- comp_func_solid_DestinationAtop,
- comp_func_solid_XOR,
- comp_func_solid_Plus,
- comp_func_solid_Multiply,
- comp_func_solid_Screen,
- comp_func_solid_Overlay,
- comp_func_solid_Darken,
- comp_func_solid_Lighten,
- comp_func_solid_ColorDodge,
- comp_func_solid_ColorBurn,
- comp_func_solid_HardLight,
- comp_func_solid_SoftLight,
- comp_func_solid_Difference,
- comp_func_solid_Exclusion,
- rasterop_solid_SourceOrDestination,
- rasterop_solid_SourceAndDestination,
- rasterop_solid_SourceXorDestination,
- rasterop_solid_NotSourceAndNotDestination,
- rasterop_solid_NotSourceOrNotDestination,
- rasterop_solid_NotSourceXorDestination,
- rasterop_solid_NotSource,
- rasterop_solid_NotSourceAndDestination,
- rasterop_solid_SourceAndNotDestination,
- rasterop_solid_NotSourceOrDestination,
- rasterop_solid_SourceOrNotDestination,
- rasterop_solid_ClearDestination,
- rasterop_solid_SetDestination,
- rasterop_solid_NotDestination
-};
+static const CompositionFunctionSolid *functionForModeSolid = qt_functionForModeSolid_C;
+static const CompositionFunctionSolid64 *functionForModeSolid64 = qt_functionForModeSolid64_C;
-static const CompositionFunctionSolid *functionForModeSolid = functionForModeSolid_C;
-
-static CompositionFunction functionForMode_C[] = {
- comp_func_SourceOver,
- comp_func_DestinationOver,
- comp_func_Clear,
- comp_func_Source,
- comp_func_Destination,
- comp_func_SourceIn,
- comp_func_DestinationIn,
- comp_func_SourceOut,
- comp_func_DestinationOut,
- comp_func_SourceAtop,
- comp_func_DestinationAtop,
- comp_func_XOR,
- comp_func_Plus,
- comp_func_Multiply,
- comp_func_Screen,
- comp_func_Overlay,
- comp_func_Darken,
- comp_func_Lighten,
- comp_func_ColorDodge,
- comp_func_ColorBurn,
- comp_func_HardLight,
- comp_func_SoftLight,
- comp_func_Difference,
- comp_func_Exclusion,
- rasterop_SourceOrDestination,
- rasterop_SourceAndDestination,
- rasterop_SourceXorDestination,
- rasterop_NotSourceAndNotDestination,
- rasterop_NotSourceOrNotDestination,
- rasterop_NotSourceXorDestination,
- rasterop_NotSource,
- rasterop_NotSourceAndDestination,
- rasterop_SourceAndNotDestination,
- rasterop_NotSourceOrDestination,
- rasterop_SourceOrNotDestination,
- rasterop_ClearDestination,
- rasterop_SetDestination,
- rasterop_NotDestination
-};
+extern CompositionFunction qt_functionForMode_C[];
+extern CompositionFunction64 qt_functionForMode64_C[];
-static const CompositionFunction *functionForMode = functionForMode_C;
+static const CompositionFunction *functionForMode = qt_functionForMode_C;
+static const CompositionFunction64 *functionForMode64 = qt_functionForMode64_C;
static TextureBlendType getBlendType(const QSpanData *data)
{
@@ -4280,26 +3742,34 @@ static inline Operator getOperator(const QSpanData *data, const QSpan *spans, in
switch(data->type) {
case QSpanData::Solid:
- solidSource = (qAlpha(data->solid.color) == 255);
+ solidSource = data->solid.color.isOpaque();
+ op.srcFetch = 0;
+ op.srcFetch64 = 0;
break;
case QSpanData::LinearGradient:
solidSource = !data->gradient.alphaColor;
getLinearGradientValues(&op.linear, data);
- op.src_fetch = qt_fetch_linear_gradient;
+ op.srcFetch = qt_fetch_linear_gradient;
+ op.srcFetch64 = qt_fetch_linear_gradient_rgb64;
break;
case QSpanData::RadialGradient:
solidSource = !data->gradient.alphaColor;
getRadialGradientValues(&op.radial, data);
- op.src_fetch = qt_fetch_radial_gradient;
+ op.srcFetch = qt_fetch_radial_gradient;
+ op.srcFetch64 = qt_fetch_radial_gradient_rgb64;
break;
case QSpanData::ConicalGradient:
solidSource = !data->gradient.alphaColor;
- op.src_fetch = qt_fetch_conical_gradient;
+ op.srcFetch = qt_fetch_conical_gradient;
+ op.srcFetch64 = qt_fetch_conical_gradient_rgb64;
break;
case QSpanData::Texture:
- op.src_fetch = sourceFetch[getBlendType(data)][data->texture.format];
solidSource = !data->texture.hasAlpha;
+ op.srcFetch = sourceFetch[getBlendType(data)][data->texture.format];
+ op.srcFetch64 = sourceFetch64[getBlendType(data)][data->texture.format];
+ break;
default:
+ Q_UNREACHABLE();
break;
}
@@ -4307,12 +3777,13 @@ static inline Operator getOperator(const QSpanData *data, const QSpan *spans, in
if (op.mode == QPainter::CompositionMode_SourceOver && solidSource)
op.mode = QPainter::CompositionMode_Source;
- op.dest_fetch = destFetchProc[data->rasterBuffer->format];
+ op.destFetch = destFetchProc[data->rasterBuffer->format];
+ op.destFetch64 = destFetchProc64[data->rasterBuffer->format];
if (op.mode == QPainter::CompositionMode_Source) {
switch (data->rasterBuffer->format) {
case QImage::Format_RGB32:
case QImage::Format_ARGB32_Premultiplied:
- // don't clear dest_fetch as it sets up the pointer correctly to save one copy
+ // don't clear destFetch as it sets up the pointer correctly to save one copy
break;
default: {
if (data->type == QSpanData::Texture && data->texture.const_alpha != 256)
@@ -4327,15 +3798,18 @@ static inline Operator getOperator(const QSpanData *data, const QSpan *spans, in
++spans;
}
if (!alphaSpans)
- op.dest_fetch = 0;
+ op.destFetch = 0;
}
}
}
- op.dest_store = destStoreProc[data->rasterBuffer->format];
+ op.destStore = destStoreProc[data->rasterBuffer->format];
+ op.destStore64 = destStoreProc64[data->rasterBuffer->format];
op.funcSolid = functionForModeSolid[op.mode];
+ op.funcSolid64 = functionForModeSolid64[op.mode];
op.func = functionForMode[op.mode];
+ op.func64 = functionForMode64[op.mode];
return op;
}
@@ -4352,16 +3826,17 @@ void blend_color_generic(int count, const QSpan *spans, void *userData)
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
uint buffer[buffer_size];
Operator op = getOperator(data, spans, count);
+ const uint color = data->solid.color.toArgb32();
while (count--) {
int x = spans->x;
int length = spans->len;
while (length) {
int l = qMin(buffer_size, length);
- uint *dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
- op.funcSolid(dest, l, data->solid.color, spans->coverage);
- if (op.dest_store)
- op.dest_store(data->rasterBuffer, x, spans->y, dest, l);
+ uint *dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
+ op.funcSolid(dest, l, color, spans->coverage);
+ if (op.destStore)
+ op.destStore(data->rasterBuffer, x, spans->y, dest, l);
length -= l;
x += l;
}
@@ -4374,15 +3849,16 @@ static void blend_color_argb(int count, const QSpan *spans, void *userData)
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
Operator op = getOperator(data, spans, count);
+ const uint color = data->solid.color.toArgb32();
if (op.mode == QPainter::CompositionMode_Source) {
// inline for performance
while (count--) {
uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
if (spans->coverage == 255) {
- QT_MEMFILL_UINT(target, spans->len, data->solid.color);
+ QT_MEMFILL_UINT(target, spans->len, color);
} else {
- uint c = BYTE_MUL(data->solid.color, spans->coverage);
+ uint c = BYTE_MUL(color, spans->coverage);
int ialpha = 255 - spans->coverage;
for (int i = 0; i < spans->len; ++i)
target[i] = c + BYTE_MUL(target[i], ialpha);
@@ -4394,7 +3870,34 @@ static void blend_color_argb(int count, const QSpan *spans, void *userData)
while (count--) {
uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
- op.funcSolid(target, spans->len, data->solid.color, spans->coverage);
+ op.funcSolid(target, spans->len, color, spans->coverage);
+ ++spans;
+ }
+}
+
+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");
+ return blend_color_generic(count, spans, userData);
+ }
+
+ QRgba64 buffer[buffer_size];
+ const QRgba64 color = data->solid.color;
+
+ while (count--) {
+ int x = spans->x;
+ int length = spans->len;
+ while (length) {
+ int l = qMin(buffer_size, length);
+ QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l);
+ op.funcSolid64(dest, l, color, spans->coverage);
+ op.destStore64(data->rasterBuffer, x, spans->y, dest, l);
+ length -= l;
+ x += l;
+ }
++spans;
}
}
@@ -4409,13 +3912,12 @@ static void blend_color_rgb16(int count, const QSpan *spans, void *userData)
from qt_gradient_quint16 with minimal overhead.
*/
QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;
- if (mode == QPainter::CompositionMode_SourceOver &&
- qAlpha(data->solid.color) == 255)
+ if (mode == QPainter::CompositionMode_SourceOver && data->solid.color.isOpaque())
mode = QPainter::CompositionMode_Source;
if (mode == QPainter::CompositionMode_Source) {
// inline for performance
- ushort c = qConvertRgb32To16(data->solid.color);
+ ushort c = data->solid.color.toRgb16();
while (count--) {
ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
if (spans->coverage == 255) {
@@ -4436,7 +3938,7 @@ static void blend_color_rgb16(int count, const QSpan *spans, void *userData)
if (mode == QPainter::CompositionMode_SourceOver) {
while (count--) {
- uint color = BYTE_MUL(data->solid.color, spans->coverage);
+ uint color = BYTE_MUL(data->solid.color.toArgb32(), spans->coverage);
int ialpha = qAlpha(~color);
ushort c = qConvertRgb32To16(color);
ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
@@ -4500,7 +4002,7 @@ void handleSpans(int count, const QSpan *spans, const QSpanData *data, T &handle
int process_length = l;
int process_x = x;
- const uint *src = handler.fetch(process_x, y, process_length);
+ const typename T::BlendType *src = handler.fetch(process_x, y, process_length);
int offset = 0;
while (l > 0) {
if (x == spans->x) // new span?
@@ -4525,8 +4027,10 @@ void handleSpans(int count, const QSpan *spans, const QSpanData *data, T &handle
}
}
+template<typename T>
struct QBlendBase
{
+ typedef T BlendType;
QBlendBase(QSpanData *d, Operator o)
: data(d)
, op(o)
@@ -4537,24 +4041,24 @@ struct QBlendBase
QSpanData *data;
Operator op;
- uint *dest;
+ BlendType *dest;
- uint buffer[buffer_size];
- uint src_buffer[buffer_size];
+ BlendType buffer[buffer_size];
+ BlendType src_buffer[buffer_size];
};
-class BlendSrcGeneric : public QBlendBase
+class BlendSrcGeneric : public QBlendBase<uint>
{
public:
BlendSrcGeneric(QSpanData *d, Operator o)
- : QBlendBase(d, o)
+ : QBlendBase<uint>(d, o)
{
}
const uint *fetch(int x, int y, int len)
{
- dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, y, len) : buffer;
- return op.src_fetch(src_buffer, &op, data, y, x, len);
+ dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, y, len) : buffer;
+ return op.srcFetch(src_buffer, &op, data, y, x, len);
}
void process(int, int, int len, int coverage, const uint *src, int offset)
@@ -4564,8 +4068,38 @@ public:
void store(int x, int y, int len)
{
- if (op.dest_store)
- op.dest_store(data->rasterBuffer, x, y, dest, len);
+ if (op.destStore)
+ op.destStore(data->rasterBuffer, x, y, dest, len);
+ }
+};
+
+class BlendSrcGenericRGB64 : public QBlendBase<QRgba64>
+{
+public:
+ BlendSrcGenericRGB64(QSpanData *d, Operator o)
+ : QBlendBase<QRgba64>(d, o)
+ {
+ }
+
+ bool isSupported() const
+ {
+ return op.func64 && op.destFetch64 && op.destStore64;
+ }
+
+ const QRgba64 *fetch(int x, int y, int len)
+ {
+ dest = op.destFetch64(buffer, data->rasterBuffer, x, y, len);
+ return op.srcFetch64(src_buffer, &op, data, y, x, len);
+ }
+
+ void process(int, int, int len, int coverage, const QRgba64 *src, int offset)
+ {
+ op.func64(dest + offset, src + offset, len, coverage);
+ }
+
+ void store(int x, int y, int len)
+ {
+ op.destStore64(data->rasterBuffer, x, y, dest, len);
}
};
@@ -4576,6 +4110,20 @@ static void blend_src_generic(int count, const QSpan *spans, void *userData)
handleSpans(count, spans, data, blend);
}
+static void blend_src_generic_rgb64(int count, const QSpan *spans, void *userData)
+{
+ QSpanData *data = reinterpret_cast<QSpanData *>(userData);
+ Operator op = getOperator(data, spans, count);
+ BlendSrcGenericRGB64 blend64(data, op);
+ if (blend64.isSupported())
+ handleSpans(count, spans, data, blend64);
+ else {
+ qDebug("blend_src_generic_rgb64: unsupported 64-bit blend attempted");
+ BlendSrcGeneric blend32(data, op);
+ handleSpans(count, spans, data, blend32);
+ }
+}
+
static void blend_untransformed_generic(int count, const QSpan *spans, void *userData)
{
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
@@ -4606,11 +4154,59 @@ static void blend_untransformed_generic(int count, const QSpan *spans, void *use
const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;
while (length) {
int l = qMin(buffer_size, length);
- const uint *src = op.src_fetch(src_buffer, &op, data, sy, sx, l);
- uint *dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
+ const uint *src = op.srcFetch(src_buffer, &op, data, sy, sx, l);
+ uint *dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
op.func(dest, src, l, coverage);
- if (op.dest_store)
- op.dest_store(data->rasterBuffer, x, spans->y, dest, l);
+ if (op.destStore)
+ op.destStore(data->rasterBuffer, x, spans->y, dest, l);
+ x += l;
+ sx += l;
+ length -= l;
+ }
+ }
+ }
+ ++spans;
+ }
+}
+
+static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, void *userData)
+{
+ QSpanData *data = reinterpret_cast<QSpanData *>(userData);
+
+ Operator op = getOperator(data, spans, count);
+ if (!op.func64) {
+ qWarning("Unsupported blend");
+ return blend_untransformed_generic(count, spans, userData);
+ }
+ QRgba64 buffer[buffer_size];
+ QRgba64 src_buffer[buffer_size];
+
+ const int image_width = data->texture.width;
+ const int image_height = data->texture.height;
+ int xoff = -qRound(-data->dx);
+ int yoff = -qRound(-data->dy);
+
+ while (count--) {
+ int x = spans->x;
+ int length = spans->len;
+ int sx = xoff + x;
+ int sy = yoff + spans->y;
+ if (sy >= 0 && sy < image_height && sx < image_width) {
+ if (sx < 0) {
+ x -= sx;
+ length += sx;
+ sx = 0;
+ }
+ if (sx + length > image_width)
+ length = image_width - sx;
+ if (length > 0) {
+ const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;
+ while (length) {
+ int l = qMin(buffer_size, length);
+ const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l);
+ QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l);
+ op.func64(dest, src, l, coverage);
+ op.destStore64(data->rasterBuffer, x, spans->y, dest, l);
x += l;
sx += l;
length -= l;
@@ -4799,11 +4395,62 @@ static void blend_tiled_generic(int count, const QSpan *spans, void *userData)
int l = qMin(image_width - sx, length);
if (buffer_size < l)
l = buffer_size;
- const uint *src = op.src_fetch(src_buffer, &op, data, sy, sx, l);
- uint *dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
+ const uint *src = op.srcFetch(src_buffer, &op, data, sy, sx, l);
+ uint *dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
op.func(dest, src, l, coverage);
- if (op.dest_store)
- op.dest_store(data->rasterBuffer, x, spans->y, dest, l);
+ if (op.destStore)
+ op.destStore(data->rasterBuffer, x, spans->y, dest, l);
+ x += l;
+ sx += l;
+ length -= l;
+ if (sx >= image_width)
+ sx = 0;
+ }
+ ++spans;
+ }
+}
+
+static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userData)
+{
+ QSpanData *data = reinterpret_cast<QSpanData *>(userData);
+
+ Operator op = getOperator(data, spans, count);
+ if (!op.func64) {
+ qDebug("unsupported rgb64 blend");
+ return blend_tiled_generic(count, spans, userData);
+ }
+ QRgba64 buffer[buffer_size];
+ QRgba64 src_buffer[buffer_size];
+
+ const int image_width = data->texture.width;
+ const int image_height = data->texture.height;
+ int xoff = -qRound(-data->dx) % image_width;
+ int yoff = -qRound(-data->dy) % image_height;
+
+ if (xoff < 0)
+ xoff += image_width;
+ if (yoff < 0)
+ yoff += image_height;
+
+ while (count--) {
+ int x = spans->x;
+ int length = spans->len;
+ int sx = (xoff + spans->x) % image_width;
+ int sy = (spans->y + yoff) % image_height;
+ if (sx < 0)
+ sx += image_width;
+ if (sy < 0)
+ sy += image_height;
+
+ const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;
+ while (length) {
+ int l = qMin(image_width - sx, length);
+ if (buffer_size < l)
+ l = buffer_size;
+ const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l);
+ QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l);
+ op.func64(dest, src, l, coverage);
+ op.destStore64(data->rasterBuffer, x, spans->y, dest, l);
x += l;
sx += l;
length -= l;
@@ -5684,10 +5331,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_untransformed_generic,
blend_untransformed_generic,
blend_untransformed_generic,
- blend_untransformed_generic,
- blend_untransformed_generic,
- blend_untransformed_generic,
- blend_untransformed_generic,
+ blend_untransformed_generic_rgb64,
+ blend_untransformed_generic_rgb64,
+ blend_untransformed_generic_rgb64,
+ blend_untransformed_generic_rgb64,
blend_untransformed_generic,
blend_untransformed_generic,
},
@@ -5712,10 +5359,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_tiled_generic,
blend_tiled_generic,
blend_tiled_generic,
- blend_tiled_generic,
- blend_tiled_generic,
- blend_tiled_generic,
- blend_tiled_generic,
+ blend_tiled_generic_rgb64,
+ blend_tiled_generic_rgb64,
+ blend_tiled_generic_rgb64,
+ blend_tiled_generic_rgb64,
blend_tiled_generic,
blend_tiled_generic,
},
@@ -5740,10 +5387,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic,
blend_src_generic,
blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
blend_src_generic,
blend_src_generic,
},
@@ -5767,12 +5414,12 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic,
blend_src_generic,
blend_src_generic,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
blend_src_generic,
blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic
},
// Bilinear
{
@@ -5795,10 +5442,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic,
blend_src_generic,
blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
+ blend_src_generic_rgb64,
blend_src_generic,
blend_src_generic,
},
@@ -5823,10 +5470,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic, // RGBX8888
blend_src_generic, // RGBA8888
blend_src_generic, // RGBA8888_Premultiplied
- blend_src_generic, // BGR30
- blend_src_generic, // A2BGR30_Premultiplied
- blend_src_generic, // RGB30
- blend_src_generic, // A2RGB30_Premultiplied
+ blend_src_generic_rgb64, // BGR30
+ blend_src_generic_rgb64, // A2BGR30_Premultiplied
+ blend_src_generic_rgb64, // RGB30
+ blend_src_generic_rgb64, // A2RGB30_Premultiplied
blend_src_generic, // Alpha8
blend_src_generic, // Grayscale8
}
@@ -5982,13 +5629,11 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)
int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);
int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));
- uint oldColor = data->solid.color;
+ QRgba64 oldColor = data->solid.color;
while (count--) {
int y = spans->y;
- quint32 color = qt_gradient_pixel_fixed(&data->gradient, yinc * y + off);
-
- data->solid.color = color;
+ data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off));
blend_color_rgb16(1, spans, userData);
++spans;
}
@@ -6000,39 +5645,49 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)
}
inline static void qt_bitmapblit_argb32(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *map,
int mapWidth, int mapHeight, int mapStride)
{
- qt_bitmapblit_template<quint32>(rasterBuffer, x, y, color,
+ qt_bitmapblit_template<quint32>(rasterBuffer, x, y, color.toArgb32(),
map, mapWidth, mapHeight, mapStride);
}
inline static void qt_bitmapblit_rgba8888(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
+ const uchar *map,
+ int mapWidth, int mapHeight, int mapStride)
+{
+ qt_bitmapblit_template<quint32>(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()),
+ map, mapWidth, mapHeight, mapStride);
+}
+
+template<QtPixelOrder PixelOrder>
+inline static void qt_bitmapblit_rgb30(QRasterBuffer *rasterBuffer,
+ int x, int y, const QRgba64 &color,
const uchar *map,
int mapWidth, int mapHeight, int mapStride)
{
- qt_bitmapblit_template<quint32>(rasterBuffer, x, y, ARGB2RGBA(color),
+ qt_bitmapblit_template<quint32>(rasterBuffer, x, y, qConvertRgb64ToRgb30<PixelOrder>(color),
map, mapWidth, mapHeight, mapStride);
}
inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *map,
int mapWidth, int mapHeight, int mapStride)
{
- qt_bitmapblit_template<quint16>(rasterBuffer, x, y, qConvertRgb32To16(color),
+ qt_bitmapblit_template<quint16>(rasterBuffer, x, y, color.toRgb16(),
map, mapWidth, mapHeight, mapStride);
}
static void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *map,
int mapWidth, int mapHeight, int mapStride,
const QClipData *)
{
- const quint16 c = qConvertRgb32To16(color);
+ const quint16 c = color.toRgb16();
quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x;
const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);
@@ -6130,7 +5785,7 @@ static inline void grayBlendPixel(quint32 *dst, int coverage, int sr, int sg, in
}
#endif
-static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,
+static void qt_alphamapblit_uint32(QRasterBuffer *rasterBuffer,
int x, int y, quint32 color,
const uchar *map,
int mapWidth, int mapHeight, int mapStride,
@@ -6226,28 +5881,38 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,
}
}
+
+static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,
+ int x, int y, const QRgba64 &color,
+ const uchar *map,
+ int mapWidth, int mapHeight, int mapStride,
+ const QClipData *clip)
+{
+ qt_alphamapblit_uint32(rasterBuffer, x, y, color.toArgb32(), map, mapWidth, mapHeight, mapStride, clip);
+}
+
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
static void qt_alphamapblit_rgba8888(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *map,
int mapWidth, int mapHeight, int mapStride,
const QClipData *clip)
{
- qt_alphamapblit_argb32(rasterBuffer, x, y, ARGB2RGBA(color), map, mapWidth, mapHeight, mapStride, clip);
+ qt_alphamapblit_uint32(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()), map, mapWidth, mapHeight, mapStride, clip);
}
#endif
static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uint *src, int mapWidth, int mapHeight, int srcStride,
const QClipData *clip)
{
- const quint32 c = color;
+ const quint32 c = color.toArgb32();
- int sr = qRed(color);
- int sg = qGreen(color);
- int sb = qBlue(color);
- int sa = qAlpha(color);
+ int sr = qRed(c);
+ int sg = qGreen(c);
+ int sb = qBlue(c);
+ int sa = qAlpha(c);
const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables();
if (!tables)
@@ -6314,58 +5979,67 @@ static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer,
static void qt_rectfill_argb32(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),
- color, x, y, width, height, rasterBuffer->bytesPerLine());
+ color.toArgb32(), x, y, width, height, rasterBuffer->bytesPerLine());
}
static void qt_rectfill_quint16(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint16>(reinterpret_cast<quint16 *>(rasterBuffer->buffer()),
- qConvertRgb32To16(color), x, y, width, height, rasterBuffer->bytesPerLine());
+ color.toRgb16(), x, y, width, height, rasterBuffer->bytesPerLine());
}
static void qt_rectfill_nonpremul_argb32(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),
- qUnpremultiply(color), x, y, width, height, rasterBuffer->bytesPerLine());
+ color.unpremultiplied().toArgb32(), x, y, width, height, rasterBuffer->bytesPerLine());
}
static void qt_rectfill_rgba(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),
- ARGB2RGBA(color), x, y, width, height, rasterBuffer->bytesPerLine());
+ ARGB2RGBA(color.toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine());
}
static void qt_rectfill_nonpremul_rgba(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),
- ARGB2RGBA(qUnpremultiply(color)), x, y, width, height, rasterBuffer->bytesPerLine());
+ ARGB2RGBA(color.unpremultiplied().toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine());
+}
+
+template<QtPixelOrder PixelOrder>
+static void qt_rectfill_rgb30(QRasterBuffer *rasterBuffer,
+ int x, int y, int width, int height,
+ const QRgba64 &color)
+{
+ qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),
+ qConvertRgb64ToRgb30<PixelOrder>(color), x, y, width, height, rasterBuffer->bytesPerLine());
}
static void qt_rectfill_alpha(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint8>(reinterpret_cast<quint8 *>(rasterBuffer->buffer()),
- qAlpha(color), x, y, width, height, rasterBuffer->bytesPerLine());
+ color.alpha() >> 8, x, y, width, height, rasterBuffer->bytesPerLine());
}
static void qt_rectfill_gray(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color)
+ const QRgba64 &color)
{
qt_rectfill<quint8>(reinterpret_cast<quint8 *>(rasterBuffer->buffer()),
- qGray(color), x, y, width, height, rasterBuffer->bytesPerLine());
+ qGray(color.toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine());
}
// Map table for destination image format. Contains function pointers
@@ -6518,39 +6192,39 @@ DrawHelper qDrawHelper[QImage::NImageFormats] =
},
// Format_BGR30
{
- blend_color_generic,
- blend_src_generic,
- 0,
+ blend_color_generic_rgb64,
+ blend_src_generic_rgb64,
+ qt_bitmapblit_rgb30<PixelOrderBGR>,
0,
0,
- 0
+ qt_rectfill_rgb30<PixelOrderBGR>
},
// Format_A2BGR30_Premultiplied
{
- blend_color_generic,
- blend_src_generic,
- 0,
+ blend_color_generic_rgb64,
+ blend_src_generic_rgb64,
+ qt_bitmapblit_rgb30<PixelOrderBGR>,
0,
0,
- 0
+ qt_rectfill_rgb30<PixelOrderBGR>
},
// Format_RGB30
{
- blend_color_generic,
- blend_src_generic,
- 0,
+ blend_color_generic_rgb64,
+ blend_src_generic_rgb64,
+ qt_bitmapblit_rgb30<PixelOrderRGB>,
0,
0,
- 0
+ qt_rectfill_rgb30<PixelOrderRGB>
},
// Format_A2RGB30_Premultiplied
{
- blend_color_generic,
- blend_src_generic,
- 0,
+ blend_color_generic_rgb64,
+ blend_src_generic_rgb64,
+ qt_bitmapblit_rgb30<PixelOrderRGB>,
0,
0,
- 0
+ qt_rectfill_rgb30<PixelOrderRGB>
},
// Format_Alpha8
{
@@ -6619,6 +6293,11 @@ inline void qt_memfill_template(quint16 *dest, quint16 value, int count)
}
#endif
+void qt_memfill64(quint64 *dest, quint64 color, int count)
+{
+ qt_memfill_template<quint64>(dest, color, count);
+}
+
#if !defined(__SSE2__)
void qt_memfill16(quint16 *dest, quint16 color, int count)
{
@@ -6644,13 +6323,13 @@ void qt_memfill32(quint32 *dest, quint32 color, int count)
template<QtPixelOrder> const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);
#endif
-void qInitDrawhelperAsm()
+extern void qInitBlendFunctions();
+
+static void qInitDrawhelperFunctions()
{
- CompositionFunction *functionForModeAsm = 0;
- CompositionFunctionSolid *functionForModeSolidAsm = 0;
+ // Set up basic blend function tables.
+ qInitBlendFunctions();
- const uint features = qCpuFeatures();
- Q_UNUSED(features);
#ifdef __SSE2__
qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_sse2;
qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_sse2;
@@ -6695,7 +6374,7 @@ void qInitDrawhelperAsm()
qt_fetch_radial_gradient = qt_fetch_radial_gradient_sse2;
#ifdef QT_COMPILER_SUPPORTS_SSSE3
- if (features & SSSE3) {
+ if (qCpuHasFeature(SSSE3)) {
extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
int w, int h,
@@ -6735,19 +6414,22 @@ void qInitDrawhelperAsm()
qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_avx2;
}
#endif
+ extern void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);
+ extern void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha);
+ extern void QT_FASTCALL comp_func_Source_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);
+ extern void QT_FASTCALL comp_func_Plus_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);
+ qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_sse2;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_sse2;
+ qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_sse2;
+ qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2;
- functionForModeAsm = qt_functionForMode_SSE2;
- functionForModeSolidAsm = qt_functionForModeSolid_SSE2;
#endif // SSE2
-#if defined(__ARM_NEON__) && !defined(Q_OS_IOS)
+#if defined(__ARM_NEON__)
qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
- qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
- qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon;
@@ -6755,6 +6437,21 @@ void qInitDrawhelperAsm()
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_neon;
#endif
+ qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
+ qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
+
+ extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data,
+ int y, int x, int length);
+
+ qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon;
+
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
+ // The RGB16 helpers are using Arm32 assemblythat has not been ported to AArch64
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
+
qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
@@ -6763,19 +6460,13 @@ void qInitDrawhelperAsm()
qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
- functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
- functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
- functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;
qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;
+#endif
- extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data,
- int y, int x, int length);
-
- qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon;
#endif
#if defined(Q_PROCESSOR_MIPS_32) && defined(QT_COMPILER_SUPPORTS_MIPS_DSP)
@@ -6783,27 +6474,27 @@ void qInitDrawhelperAsm()
#endif // Q_PROCESSOR_MIPS_32
#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
- if (features & (DSP | DSPR2)) {
+ if (qCpuHasFeature(DSP) && qCpuHasFeature(DSPR2)) {
// Composition functions are all DSP r1
- functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_DestinationOver] = comp_func_DestinationOver_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_SourceIn] = comp_func_SourceIn_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_DestinationIn] = comp_func_DestinationIn_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_DestinationOut] = comp_func_DestinationOut_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_SourceAtop] = comp_func_SourceAtop_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_DestinationAtop] = comp_func_DestinationAtop_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_Xor] = comp_func_XOR_mips_dsp;
- functionForMode_C[QPainter::CompositionMode_SourceOut] = comp_func_SourceOut_mips_dsp;
-
- functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_DestinationOver] = comp_func_solid_DestinationOver_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_SourceIn] = comp_func_solid_SourceIn_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_DestinationIn] = comp_func_solid_DestinationIn_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_SourceAtop] = comp_func_solid_SourceAtop_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_DestinationAtop] = comp_func_solid_DestinationAtop_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_Xor] = comp_func_solid_XOR_mips_dsp;
- functionForModeSolid_C[QPainter::CompositionMode_SourceOut] = comp_func_solid_SourceOut_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_DestinationOver] = comp_func_DestinationOver_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_SourceIn] = comp_func_SourceIn_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_DestinationIn] = comp_func_DestinationIn_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_DestinationOut] = comp_func_DestinationOut_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_SourceAtop] = comp_func_SourceAtop_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_DestinationAtop] = comp_func_DestinationAtop_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_Xor] = comp_func_XOR_mips_dsp;
+ qt_functionForMode_C[QPainter::CompositionMode_SourceOut] = comp_func_SourceOut_mips_dsp;
+
+ qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_DestinationOver] = comp_func_solid_DestinationOver_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_SourceIn] = comp_func_solid_SourceIn_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_DestinationIn] = comp_func_solid_DestinationIn_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_SourceAtop] = comp_func_solid_SourceAtop_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_DestinationAtop] = comp_func_solid_DestinationAtop_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_Xor] = comp_func_solid_XOR_mips_dsp;
+ qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOut] = comp_func_solid_SourceOut_mips_dsp;
qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp;
@@ -6830,20 +6521,9 @@ void qInitDrawhelperAsm()
#endif // QT_COMPILER_SUPPORTS_MIPS_DSPR2
}
#endif // QT_COMPILER_SUPPORTS_MIPS_DSP || QT_COMPILER_SUPPORTS_MIPS_DSPR2
-
- if (functionForModeSolidAsm) {
- const int destinationMode = QPainter::CompositionMode_Destination;
- functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode];
-
- // use the default qdrawhelper implementation for the
- // extended composition modes
- for (int mode = 12; mode < 24; ++mode)
- functionForModeSolidAsm[mode] = functionForModeSolid_C[mode];
-
- functionForModeSolid = functionForModeSolidAsm;
- }
- if (functionForModeAsm)
- functionForMode = functionForModeAsm;
}
+// Ensure initialization if this object file is linked.
+Q_CONSTRUCTOR_FUNCTION(qInitDrawhelperFunctions);
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 7e12e62151..e3f5d5bac7 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -31,21 +31,20 @@
**
****************************************************************************/
-#include <private/qdrawhelper_p.h>
+#include <private/qdrawhelper_neon_p.h>
#include <private/qblendfunctions_p.h>
#include <private/qmath_p.h>
#ifdef __ARM_NEON__
-#include <private/qdrawhelper_neon_p.h>
#include <private/qpaintengine_raster_p.h>
-#include <arm_neon.h>
QT_BEGIN_NAMESPACE
void qt_memfill32(quint32 *dest, quint32 value, int count)
{
const int epilogueSize = count % 16;
+#if !defined(Q_PROCESSOR_ARM_64)
if (count >= 16) {
quint32 *const neonEnd = dest + count - epilogueSize;
register uint32x4_t valueVector1 asm ("q0") = vdupq_n_u32(value);
@@ -60,6 +59,22 @@ void qt_memfill32(quint32 *dest, quint32 value, int count)
);
}
}
+#else
+ if (count >= 16) {
+ quint32 *const neonEnd = dest + count - epilogueSize;
+ register uint32x4_t valueVector1 asm ("v0") = vdupq_n_u32(value);
+ register uint32x4_t valueVector2 asm ("v1") = valueVector1;
+ while (dest != neonEnd) {
+ asm volatile (
+ "st2 { v0.4s, v1.4s }, [%[DST]], #32 \n\t"
+ "st2 { v0.4s, v1.4s }, [%[DST]], #32 \n\t"
+ : [DST]"+r" (dest)
+ : [VALUE1]"w"(valueVector1), [VALUE2]"w"(valueVector2)
+ : "memory"
+ );
+ }
+ }
+#endif
switch (epilogueSize)
{
@@ -120,6 +135,7 @@ static inline uint16x8_t qvsource_over_u16(uint16x8_t src16, uint16x8_t dst16, u
return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half));
}
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
extern "C" void
pixman_composite_over_8888_0565_asm_neon (int32_t w,
int32_t h,
@@ -166,7 +182,6 @@ pixman_composite_src_0565_0565_asm_neon (int32_t w,
int32_t dst_stride,
uint16_t *src,
int32_t src_stride);
-
// qblendfunctions.cpp
void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
@@ -206,6 +221,7 @@ void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl,
int w, int h,
int const_alpha);
+
template <int N>
static inline void scanLineBlit16(quint16 *dst, quint16 *src, int dstride)
{
@@ -331,11 +347,16 @@ void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
pixman_composite_over_8888_0565_asm_neon(w, h, dst, dbpl / 2, src, sbpl / 4);
}
+#endif
void qt_blend_argb32_on_argb32_scanline_neon(uint *dest, const uint *src, int length, uint const_alpha)
{
if (const_alpha == 255) {
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
pixman_composite_scanline_over_asm_neon(length, dest, src);
+#else
+ qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, 256);
+#endif
} else {
qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, (const_alpha * 256) / 255);
}
@@ -351,7 +372,51 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
uint16x8_t half = vdupq_n_u16(0x80);
uint16x8_t full = vdupq_n_u16(0xff);
if (const_alpha == 256) {
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
pixman_composite_over_8888_8888_asm_neon(w, h, (uint32_t *)destPixels, dbpl / 4, (uint32_t *)srcPixels, sbpl / 4);
+#else
+ for (int y=0; y<h; ++y) {
+ int x = 0;
+ for (; x < w-3; x += 4) {
+ if (src[x] | src[x+1] | src[x+2] | src[x+3]) {
+ uint32x4_t src32 = vld1q_u32((uint32_t *)&src[x]);
+ uint32x4_t dst32 = vld1q_u32((uint32_t *)&dst[x]);
+
+ const uint8x16_t src8 = vreinterpretq_u8_u32(src32);
+ const uint8x16_t dst8 = vreinterpretq_u8_u32(dst32);
+
+ const uint8x8_t src8_low = vget_low_u8(src8);
+ const uint8x8_t dst8_low = vget_low_u8(dst8);
+
+ const uint8x8_t src8_high = vget_high_u8(src8);
+ const uint8x8_t dst8_high = vget_high_u8(dst8);
+
+ const uint16x8_t src16_low = vmovl_u8(src8_low);
+ const uint16x8_t dst16_low = vmovl_u8(dst8_low);
+
+ const uint16x8_t src16_high = vmovl_u8(src8_high);
+ const uint16x8_t dst16_high = vmovl_u8(dst8_high);
+
+ const uint16x8_t result16_low = qvsource_over_u16(src16_low, dst16_low, half, full);
+ const uint16x8_t result16_high = qvsource_over_u16(src16_high, dst16_high, half, full);
+
+ const uint32x2_t result32_low = vreinterpret_u32_u8(vmovn_u16(result16_low));
+ const uint32x2_t result32_high = vreinterpret_u32_u8(vmovn_u16(result16_high));
+
+ vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
+ }
+ }
+ for (; x<w; ++x) {
+ uint s = src[x];
+ if (s >= 0xff000000)
+ dst[x] = s;
+ else if (s != 0)
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+#endif
} else if (const_alpha != 0) {
const_alpha = (const_alpha * 255) >> 8;
uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha);
@@ -465,8 +530,9 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
}
}
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *bitmap,
int mapWidth, int mapHeight, int mapStride,
const QClipData *)
@@ -475,8 +541,9 @@ void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);
uchar *mask = const_cast<uchar *>(bitmap);
+ const uint c = color.toArgb32();
- pixman_composite_over_n_8_0565_asm_neon(mapWidth, mapHeight, dest, destStride, color, 0, mask, mapStride);
+ pixman_composite_over_n_8_0565_asm_neon(mapWidth, mapHeight, dest, destStride, c, 0, mask, mapStride);
}
extern "C" void blend_8_pixels_rgb16_on_rgb16_neon(quint16 *dst, const quint16 *src, int const_alpha);
@@ -704,6 +771,7 @@ void QT_FASTCALL qt_destStoreRGB16_neon(QRasterBuffer *rasterBuffer, int x, int
data[i + j] = dstBuffer[j];
}
}
+#endif
void QT_FASTCALL comp_func_solid_SourceOver_neon(uint *destPixels, int length, uint color, uint const_alpha)
{
@@ -755,16 +823,13 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin
uint *const neonEnd = end - 3;
while (dst < neonEnd) {
- asm volatile (
- "vld2.8 { d0, d1 }, [%[SRC]] !\n\t"
- "vld2.8 { d2, d3 }, [%[DST]]\n\t"
- "vqadd.u8 q0, q0, q1\n\t"
- "vst2.8 { d0, d1 }, [%[DST]] !\n\t"
- : [DST]"+r" (dst), [SRC]"+r" (src)
- :
- : "memory", "d0", "d1", "d2", "d3", "q0", "q1"
- );
- }
+ uint8x16_t vs = vld1q_u8((const uint8_t*)src);
+ const uint8x16_t vd = vld1q_u8((uint8_t*)dst);
+ vs = vqaddq_u8(vs, vd);
+ vst1q_u8((uint8_t*)dst, vs);
+ src += 4;
+ dst += 4;
+ };
while (dst != end) {
*dst = comp_func_Plus_one_pixel(*dst, *src);
@@ -803,6 +868,7 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin
}
}
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
static const int tileSize = 32;
extern "C" void qt_rotate90_16_neon(quint16 *dst, const quint16 *src, int sstride, int dstride, int count);
@@ -946,6 +1012,7 @@ void qt_memrotate270_16_neon(const uchar *srcPixels, int w, int h,
}
}
}
+#endif
class QSimdNeon
{
@@ -985,7 +1052,7 @@ public:
const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length)
{
- return qt_fetch_radial_gradient_template<QRadialFetchSimd<QSimdNeon> >(buffer, op, data, y, x, length);
+ return qt_fetch_radial_gradient_template<QRadialFetchSimd<QSimdNeon>,uint>(buffer, op, data, y, x, length);
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_neon_asm.S b/src/gui/painting/qdrawhelper_neon_asm.S
index 42a2084bbd..927a03f8ec 100644
--- a/src/gui/painting/qdrawhelper_neon_asm.S
+++ b/src/gui/painting/qdrawhelper_neon_asm.S
@@ -31,6 +31,8 @@
**
****************************************************************************/
+#if defined(ENABLE_PIXMAN_DRAWHELPERS)
+
/* Prevent the stack from becoming executable for no reason... */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
@@ -287,3 +289,5 @@ qt_rotate90_16_neon:
pop { r4-r11, pc }
.endfunc
+
+#endif \ No newline at end of file
diff --git a/src/gui/painting/qdrawhelper_neon_p.h b/src/gui/painting/qdrawhelper_neon_p.h
index bd030a8bf3..37e060f147 100644
--- a/src/gui/painting/qdrawhelper_neon_p.h
+++ b/src/gui/painting/qdrawhelper_neon_p.h
@@ -82,7 +82,7 @@ void qt_blend_rgb16_on_rgb16_neon(uchar *destPixels, int dbpl,
int const_alpha);
void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *bitmap,
int mapWidth, int mapHeight, int mapStride,
const QClipData *clip);
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 73ff21812a..1ff19f4e04 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -50,6 +50,7 @@
#include "QtGui/qcolor.h"
#include "QtGui/qpainter.h"
#include "QtGui/qimage.h"
+#include "QtGui/qrgba64.h"
#ifndef QT_FT_BEGIN_HEADER
#define QT_FT_BEGIN_HEADER
#define QT_FT_END_HEADER
@@ -61,15 +62,12 @@ QT_BEGIN_NAMESPACE
#if defined(Q_CC_GNU)
# define Q_STATIC_TEMPLATE_FUNCTION static
-# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
# define Q_DECL_RESTRICT __restrict__
#elif defined(Q_CC_MSVC)
# define Q_STATIC_TEMPLATE_FUNCTION static
-# define Q_ALWAYS_INLINE __forceinline
# define Q_DECL_RESTRICT __restrict
#else
# define Q_STATIC_TEMPLATE_FUNCTION static
-# define Q_ALWAYS_INLINE inline
# define Q_DECL_RESTRICT
#endif
@@ -99,25 +97,25 @@ class QRasterPaintEngineState;
typedef QT_FT_SpanFunc ProcessSpans;
typedef void (*BitmapBlitFunc)(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *bitmap,
int mapWidth, int mapHeight, int mapStride);
typedef void (*AlphamapBlitFunc)(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uchar *bitmap,
int mapWidth, int mapHeight, int mapStride,
const QClipData *clip);
typedef void (*AlphaRGBBlitFunc)(QRasterBuffer *rasterBuffer,
- int x, int y, quint32 color,
+ int x, int y, const QRgba64 &color,
const uint *rgbmask,
int mapWidth, int mapHeight, int mapStride,
const QClipData *clip);
typedef void (*RectFillFunc)(QRasterBuffer *rasterBuffer,
int x, int y, int width, int height,
- quint32 color);
+ const QRgba64 &color);
typedef void (*SrcOverBlendFunc)(uchar *destPixels, int dbpl,
const uchar *src, int spbl,
@@ -158,11 +156,14 @@ extern MemRotateFunc qMemRotateFunctions[QImage::NImageFormats][3];
extern DrawHelper qDrawHelper[QImage::NImageFormats];
void qBlendTexture(int count, const QSpan *spans, void *userData);
+extern void qt_memfill64(quint64 *dest, quint64 value, int count);
extern void qt_memfill32(quint32 *dest, quint32 value, int count);
extern void qt_memfill16(quint16 *dest, quint16 value, int count);
typedef void (QT_FASTCALL *CompositionFunction)(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha);
+typedef void (QT_FASTCALL *CompositionFunction64)(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha);
typedef void (QT_FASTCALL *CompositionFunctionSolid)(uint *dest, int length, uint color, uint const_alpha);
+typedef void (QT_FASTCALL *CompositionFunctionSolid64)(QRgba64 *dest, int length, QRgba64 color, uint const_alpha);
struct LinearGradientValues
{
@@ -185,30 +186,38 @@ struct RadialGradientValues
struct Operator;
typedef uint* (QT_FASTCALL *DestFetchProc)(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length);
+typedef QRgba64* (QT_FASTCALL *DestFetchProc64)(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length);
typedef void (QT_FASTCALL *DestStoreProc)(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length);
+typedef void (QT_FASTCALL *DestStoreProc64)(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length);
typedef const uint* (QT_FASTCALL *SourceFetchProc)(uint *buffer, const Operator *o, const QSpanData *data, int y, int x, int length);
+typedef const QRgba64* (QT_FASTCALL *SourceFetchProc64)(QRgba64 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length);
struct Operator
{
QPainter::CompositionMode mode;
- DestFetchProc dest_fetch;
- DestStoreProc dest_store;
- SourceFetchProc src_fetch;
+ DestFetchProc destFetch;
+ DestStoreProc destStore;
+ SourceFetchProc srcFetch;
CompositionFunctionSolid funcSolid;
CompositionFunction func;
+
+ DestFetchProc64 destFetch64;
+ DestStoreProc64 destStore64;
+ SourceFetchProc64 srcFetch64;
+ CompositionFunctionSolid64 funcSolid64;
+ CompositionFunction64 func64;
+
union {
LinearGradientValues linear;
RadialGradientValues radial;
};
};
-void qInitDrawhelperAsm();
-
class QRasterPaintEngine;
struct QSolidData
{
- uint color;
+ QRgba64 color;
};
struct QLinearGradientData
@@ -259,7 +268,7 @@ struct QGradientData
#define GRADIENT_STOPTABLE_SIZE 1024
#define GRADIENT_STOPTABLE_SIZE_SHIFT 10
- uint* colorTable; //[GRADIENT_STOPTABLE_SIZE];
+ QRgba64* colorTable; //[GRADIENT_STOPTABLE_SIZE];
uint alphaColor : 1;
};
@@ -367,6 +376,12 @@ static inline uint qt_gradient_clamp(const QGradientData *data, int ipos)
static inline uint qt_gradient_pixel(const QGradientData *data, qreal pos)
{
int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5));
+ return data->colorTable[qt_gradient_clamp(data, ipos)].toArgb32();
+}
+
+static inline const QRgba64& qt_gradient_pixel64(const QGradientData *data, qreal pos)
+{
+ int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5));
return data->colorTable[qt_gradient_clamp(data, ipos)];
}
@@ -375,24 +390,24 @@ static inline qreal qRadialDeterminant(qreal a, qreal b, qreal c)
return (b * b) - (4 * a * c);
}
-template <class RadialFetchFunc> Q_STATIC_TEMPLATE_FUNCTION
-const uint * QT_FASTCALL qt_fetch_radial_gradient_template(uint *buffer, const Operator *op, const QSpanData *data,
- int y, int x, int length)
+template <class RadialFetchFunc, typename BlendType> static
+const BlendType * QT_FASTCALL qt_fetch_radial_gradient_template(BlendType *buffer, const Operator *op,
+ const QSpanData *data, int y, int x, int length)
{
// avoid division by zero
if (qFuzzyIsNull(op->radial.a)) {
- qt_memfill32(buffer, 0, length);
+ RadialFetchFunc::memfill(buffer, RadialFetchFunc::null(), length);
return buffer;
}
- const uint *b = buffer;
+ const BlendType *b = buffer;
qreal rx = data->m21 * (y + qreal(0.5))
+ data->dx + data->m11 * (x + qreal(0.5));
qreal ry = data->m22 * (y + qreal(0.5))
+ data->dy + data->m12 * (x + qreal(0.5));
bool affine = !data->m13 && !data->m23;
- uint *end = buffer + length;
+ BlendType *end = buffer + length;
if (affine) {
rx -= data->gradient.radial.focal.x;
ry -= data->gradient.radial.focal.y;
@@ -439,7 +454,7 @@ const uint * QT_FASTCALL qt_fetch_radial_gradient_template(uint *buffer, const O
qreal b = 2*(op->radial.dr*data->gradient.radial.focal.radius + gx*op->radial.dx + gy*op->radial.dy);
qreal det = qRadialDeterminant(op->radial.a, b, op->radial.sqrfr - (gx*gx + gy*gy));
- quint32 result = 0;
+ BlendType result = RadialFetchFunc::null();
if (det >= 0) {
qreal detSqrt = qSqrt(det);
@@ -449,7 +464,7 @@ const uint * QT_FASTCALL qt_fetch_radial_gradient_template(uint *buffer, const O
qreal s = qMax(s0, s1);
if (data->gradient.radial.focal.radius + op->radial.dr * s >= 0)
- result = qt_gradient_pixel(&data->gradient, s);
+ result = RadialFetchFunc::fetchSingle(data->gradient, s);
}
*buffer = result;
@@ -470,6 +485,15 @@ template <class Simd>
class QRadialFetchSimd
{
public:
+ static uint null() { return 0; }
+ static uint fetchSingle(const QGradientData& gradient, qreal v)
+ {
+ return qt_gradient_pixel(&gradient, v);
+ }
+ static void memfill(uint *buffer, uint fill, int length)
+ {
+ qt_memfill32(buffer, fill, length);
+ }
static void fetch(uint *buffer, uint *end, const Operator *op, const QSpanData *data, qreal det,
qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b)
{
@@ -526,7 +550,7 @@ public:
delta_det4_vec.v = Simd::v_add(delta_det4_vec.v, v_delta_delta_det16); \
b_vec.v = Simd::v_add(b_vec.v, v_delta_b4); \
for (int i = 0; i < 4; ++i) \
- *buffer++ = (extended_mask | v_buffer_mask.i[i]) & data->gradient.colorTable[index_vec.i[i]]; \
+ *buffer++ = (extended_mask | v_buffer_mask.i[i]) & data->gradient.colorTable[index_vec.i[i]].toArgb32(); \
}
#define FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP) \
@@ -562,7 +586,7 @@ static Q_ALWAYS_INLINE uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b
return x;
}
-#if QT_POINTER_SIZE == 8 // 64-bit versions
+#if Q_PROCESSOR_WORDSIZE == 8 // 64-bit versions
static Q_ALWAYS_INLINE uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) {
quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a;
@@ -680,19 +704,8 @@ static Q_ALWAYS_INLINE uint BYTE_MUL_RGB16_32(uint x, uint a) {
return t;
}
-static Q_ALWAYS_INLINE int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; }
-
-static Q_ALWAYS_INLINE uint BYTE_MUL_RGB30(uint x, uint a) {
- uint xa = x >> 30;
- uint xr = (x >> 20) & 0x3ff;
- uint xg = (x >> 10) & 0x3ff;
- uint xb = x & 0x3ff;
- xa = qt_div_255(xa * a);
- xr = qt_div_255(xr * a);
- xg = qt_div_255(xg * a);
- xb = qt_div_255(xb * a);
- return (xa << 30) | (xr << 20) | (xg << 10) | xb;
-}
+static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; }
+static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_div_65535(uint x) { return (x + (x>>16) + 0x8000U) >> 16; }
static Q_ALWAYS_INLINE uint qAlphaRgb30(uint c)
{
@@ -723,6 +736,11 @@ inline quint24::operator uint() const
template <class T> Q_STATIC_TEMPLATE_FUNCTION
void qt_memfill(T *dest, T value, int count);
+template<> inline void qt_memfill(quint64 *dest, quint64 color, int count)
+{
+ qt_memfill64(dest, color, count);
+}
+
template<> inline void qt_memfill(quint32 *dest, quint32 color, int count)
{
qt_memfill32(dest, color, count);
@@ -862,6 +880,18 @@ inline QRgb qRepremultiply(QRgb p)
return qPremultiply(p);
}
+template<unsigned int Shift>
+inline QRgba64 qRepremultiply(QRgba64 p)
+{
+ const uint alpha = p.alpha();
+ if (alpha == 65535 || alpha == 0)
+ return p;
+ p = p.unpremultiplied();
+ Q_CONSTEXPR uint mult = 65535 / (65535 >> Shift);
+ p.setAlpha(mult * (alpha >> Shift));
+ return p.premultiplied();
+}
+
template<>
inline uint qConvertArgb32ToA2rgb30<PixelOrderBGR>(QRgb c)
{
@@ -924,6 +954,66 @@ inline QRgb qConvertA2rgb30ToArgb32<PixelOrderRGB>(uint c)
| ((c >> 2) & 0x000000ff);
}
+template<enum QtPixelOrder> inline QRgba64 qConvertA2rgb30ToRgb64(uint rgb);
+
+template<>
+inline QRgba64 qConvertA2rgb30ToRgb64<PixelOrderBGR>(uint rgb)
+{
+ quint16 alpha = rgb >> 30;
+ quint16 blue = (rgb >> 20) & 0x3ff;
+ quint16 green = (rgb >> 10) & 0x3ff;
+ quint16 red = rgb & 0x3ff;
+ // Expand the range.
+ alpha |= (alpha << 2);
+ alpha |= (alpha << 4);
+ alpha |= (alpha << 8);
+ red = (red << 6) | (red >> 4);
+ green = (green << 6) | (green >> 4);
+ blue = (blue << 6) | (blue >> 4);
+ return qRgba64(red, green, blue, alpha);
+}
+
+template<>
+inline QRgba64 qConvertA2rgb30ToRgb64<PixelOrderRGB>(uint rgb)
+{
+ quint16 alpha = rgb >> 30;
+ quint16 red = (rgb >> 20) & 0x3ff;
+ quint16 green = (rgb >> 10) & 0x3ff;
+ quint16 blue = rgb & 0x3ff;
+ // Expand the range.
+ alpha |= (alpha << 2);
+ alpha |= (alpha << 4);
+ alpha |= (alpha << 8);
+ red = (red << 6) | (red >> 4);
+ green = (green << 6) | (green >> 4);
+ blue = (blue << 6) | (blue >> 4);
+ return qRgba64(red, green, blue, alpha);
+}
+
+template<enum QtPixelOrder> inline unsigned int qConvertRgb64ToRgb30(QRgba64);
+
+template<>
+inline unsigned int qConvertRgb64ToRgb30<PixelOrderBGR>(QRgba64 c)
+{
+ c = qRepremultiply<14>(c);
+ const uint a = c.alpha() >> 14;
+ const uint r = c.red() >> 6;
+ const uint g = c.green() >> 6;
+ const uint b = c.blue() >> 6;
+ return (a << 30) | (b << 20) | (g << 10) | r;
+}
+
+template<>
+inline unsigned int qConvertRgb64ToRgb30<PixelOrderRGB>(QRgba64 c)
+{
+ c = qRepremultiply<14>(c);
+ const uint a = c.alpha() >> 14;
+ const uint r = c.red() >> 6;
+ const uint g = c.green() >> 6;
+ const uint b = c.blue() >> 6;
+ return (a << 30) | (r << 20) | (g << 10) | b;
+}
+
inline uint qRgbSwapRgb30(uint c)
{
const uint ag = c & 0xc00ffc00;
@@ -1001,7 +1091,7 @@ const uint qt_bayer_matrix[16][16] = {
((((argb >> 24) * alpha) >> 8) << 24) | (argb & 0x00ffffff)
-#if QT_POINTER_SIZE == 8 // 64-bit versions
+#if Q_PROCESSOR_WORDSIZE == 8 // 64-bit versions
#define AMIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
#define MIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
#else // 32 bits
@@ -1025,89 +1115,11 @@ inline int comp_func_Plus_one_pixel(uint d, const uint s)
#undef MIX
#undef AMIX
-// prototypes of all the composition functions
-void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Source(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint);
-void QT_FASTCALL comp_func_SourceIn(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_SourceOut(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_DestinationOut(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_SourceAtop(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Plus(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Multiply(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Overlay(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Darken(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Lighten(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_ColorDodge(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_ColorBurn(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_HardLight(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_SoftLight(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Difference(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL comp_func_Exclusion(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_SourceOrDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_SourceAndDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_SourceXorDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotSourceXorDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotSource(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotSourceAndDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_SourceAndNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotSourceOrDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_SourceOrNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_ClearDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_SetDestination(uint *dest, const uint *src, int length, uint const_alpha);
-void QT_FASTCALL rasterop_NotDestination(uint *dest, const uint *src, int length, uint const_alpha);
-// prototypes of all the solid composition functions
-void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Destination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotSourceOrDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_SourceOrNotDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_ClearDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_SetDestination(uint *dest, int length, uint color, uint const_alpha);
-void QT_FASTCALL rasterop_solid_NotDestination(uint *dest, int length, uint color, uint const_alpha);
-
-
struct QPixelLayout;
typedef const uint *(QT_FASTCALL *ConvertFunc)(uint *buffer, const uint *src, int count,
const QPixelLayout *layout, const QRgb *clut);
+typedef const QRgba64 *(QT_FASTCALL *ConvertFunc64)(QRgba64 *buffer, const uint *src, int count,
+ const QPixelLayout *layout, const QRgb *clut);
struct QPixelLayout
{
@@ -1137,6 +1149,7 @@ struct QPixelLayout
ConvertFunc convertToARGB32PM;
ConvertFunc convertFromARGB32PM;
ConvertFunc convertFromRGB32;
+ ConvertFunc64 convertToARGB64PM;
};
typedef const uint *(QT_FASTCALL *FetchPixelsFunc)(uint *buffer, const uchar *src, int index, int count);
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 84eb3b7909..d7f3686e54 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -311,90 +311,6 @@ void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, u
}
}
-#ifndef QDRAWHELPER_AVX
-CompositionFunctionSolid qt_functionForModeSolid_SSE2[numCompositionFunctions] = {
- comp_func_solid_SourceOver_sse2,
- comp_func_solid_DestinationOver,
- comp_func_solid_Clear,
- comp_func_solid_Source,
- comp_func_solid_Destination,
- comp_func_solid_SourceIn,
- comp_func_solid_DestinationIn,
- comp_func_solid_SourceOut,
- comp_func_solid_DestinationOut,
- comp_func_solid_SourceAtop,
- comp_func_solid_DestinationAtop,
- comp_func_solid_XOR,
- comp_func_solid_Plus,
- comp_func_solid_Multiply,
- comp_func_solid_Screen,
- comp_func_solid_Overlay,
- comp_func_solid_Darken,
- comp_func_solid_Lighten,
- comp_func_solid_ColorDodge,
- comp_func_solid_ColorBurn,
- comp_func_solid_HardLight,
- comp_func_solid_SoftLight,
- comp_func_solid_Difference,
- comp_func_solid_Exclusion,
- rasterop_solid_SourceOrDestination,
- rasterop_solid_SourceAndDestination,
- rasterop_solid_SourceXorDestination,
- rasterop_solid_NotSourceAndNotDestination,
- rasterop_solid_NotSourceOrNotDestination,
- rasterop_solid_NotSourceXorDestination,
- rasterop_solid_NotSource,
- rasterop_solid_NotSourceAndDestination,
- rasterop_solid_SourceAndNotDestination,
- rasterop_solid_NotSourceOrDestination,
- rasterop_solid_SourceOrNotDestination,
- rasterop_solid_ClearDestination,
- rasterop_solid_SetDestination,
- rasterop_solid_NotDestination
-};
-
-CompositionFunction qt_functionForMode_SSE2[numCompositionFunctions] = {
- comp_func_SourceOver_sse2,
- comp_func_DestinationOver,
- comp_func_Clear,
- comp_func_Source_sse2,
- comp_func_Destination,
- comp_func_SourceIn,
- comp_func_DestinationIn,
- comp_func_SourceOut,
- comp_func_DestinationOut,
- comp_func_SourceAtop,
- comp_func_DestinationAtop,
- comp_func_XOR,
- comp_func_Plus_sse2,
- comp_func_Multiply,
- comp_func_Screen,
- comp_func_Overlay,
- comp_func_Darken,
- comp_func_Lighten,
- comp_func_ColorDodge,
- comp_func_ColorBurn,
- comp_func_HardLight,
- comp_func_SoftLight,
- comp_func_Difference,
- comp_func_Exclusion,
- rasterop_SourceOrDestination,
- rasterop_SourceAndDestination,
- rasterop_SourceXorDestination,
- rasterop_NotSourceAndNotDestination,
- rasterop_NotSourceOrNotDestination,
- rasterop_NotSourceXorDestination,
- rasterop_NotSource,
- rasterop_NotSourceAndDestination,
- rasterop_SourceAndNotDestination,
- rasterop_NotSourceOrDestination,
- rasterop_SourceOrNotDestination,
- rasterop_ClearDestination,
- rasterop_SetDestination,
- rasterop_NotDestination
-};
-#endif
-
void qt_memfill16(quint16 *dest, quint16 value, int count)
{
if (count < 3) {
@@ -417,7 +333,7 @@ void qt_memfill16(quint16 *dest, quint16 value, int count)
dest[count - 1] = value;
}
-void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
+void qt_bitmapblit32_sse2_base(QRasterBuffer *rasterBuffer, int x, int y,
quint32 color,
const uchar *src, int width, int height, int stride)
{
@@ -468,18 +384,25 @@ void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
}
}
+void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
+ const QRgba64 &color,
+ const uchar *src, int width, int height, int stride)
+{
+ qt_bitmapblit32_sse2_base(rasterBuffer, x, y, color.toArgb32(), src, width, height, stride);
+}
+
void qt_bitmapblit8888_sse2(QRasterBuffer *rasterBuffer, int x, int y,
- quint32 color,
+ const QRgba64 &color,
const uchar *src, int width, int height, int stride)
{
- qt_bitmapblit32_sse2(rasterBuffer, x, y, ARGB2RGBA(color), src, width, height, stride);
+ qt_bitmapblit32_sse2_base(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()), src, width, height, stride);
}
void qt_bitmapblit16_sse2(QRasterBuffer *rasterBuffer, int x, int y,
- quint32 color,
+ const QRgba64 &color,
const uchar *src, int width, int height, int stride)
{
- const quint16 c = qConvertRgb32To16(color);
+ const quint16 c = qConvertRgb32To16(color.toArgb32());
quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x;
const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);
@@ -543,7 +466,7 @@ public:
const uint * QT_FASTCALL qt_fetch_radial_gradient_sse2(uint *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length)
{
- return qt_fetch_radial_gradient_template<QRadialFetchSimd<QSimdSse2> >(buffer, op, data, y, x, length);
+ return qt_fetch_radial_gradient_template<QRadialFetchSimd<QSimdSse2>,uint>(buffer, op, data, y, x, length);
}
void qt_scale_image_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h
index 4d203c4f9d..50ee83aa2c 100644
--- a/src/gui/painting/qdrawhelper_x86_p.h
+++ b/src/gui/painting/qdrawhelper_x86_p.h
@@ -53,13 +53,13 @@ QT_BEGIN_NAMESPACE
void qt_memfill32(quint32 *dest, quint32 value, int count);
void qt_memfill16(quint16 *dest, quint16 value, int count);
void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
- quint32 color,
+ const QRgba64 &color,
const uchar *src, int width, int height, int stride);
void qt_bitmapblit8888_sse2(QRasterBuffer *rasterBuffer, int x, int y,
- quint32 color,
+ const QRgba64 &color,
const uchar *src, int width, int height, int stride);
void qt_bitmapblit16_sse2(QRasterBuffer *rasterBuffer, int x, int y,
- quint32 color,
+ const QRgba64 &color,
const uchar *src, int width, int height, int stride);
void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp
index 2f85e90c49..33dccc5374 100644
--- a/src/gui/painting/qimagescale.cpp
+++ b/src/gui/painting/qimagescale.cpp
@@ -77,8 +77,9 @@ QT_BEGIN_NAMESPACE
*
* Changes include formatting, namespaces and other C++'ings, removal of old
* #ifdef'ed code, and removal of unneeded border calculation code.
- * Later the code has been refactored and an SSE4.1 optimizated path have been
- * added instead of the removed MMX assembler.
+ * Later the code has been refactored, an SSE4.1 optimizated path have been
+ * added instead of the removed MMX assembler, and scaling of clipped area
+ * removed.
*
* Imlib2 is (C) Carsten Haitzler and various contributors. The MMX code
* is by Willem Monsuwe <willem@stack.nl>. All other modifications are
@@ -256,34 +257,27 @@ QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img,
static void qt_qimageScaleAARGBA_up_x_down_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow);
+ int dw, int dh, int dow, int sow);
#if defined(QT_COMPILER_SUPPORTS_SSE4_1)
template<bool RGB>
void qt_qimageScaleAARGBA_up_x_down_y_sse4(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template<bool RGB>
void qt_qimageScaleAARGBA_down_x_up_y_sse4(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template<bool RGB>
void qt_qimageScaleAARGBA_down_xy_sse4(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
#endif
static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
@@ -291,15 +285,14 @@ static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
/* calculate the source line we'll scan from */
- const unsigned int *sptr = ypoints[dyy + y];
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- const int yap = yapoints[dyy + y];
+ const unsigned int *sptr = ypoints[y];
+ unsigned int *dptr = dest + (y * dow);
+ const int yap = yapoints[y];
if (yap > 0) {
- for (int x = dxx; x < end; x++) {
+ for (int x = 0; x < dw; x++) {
const unsigned int *pix = sptr + xpoints[x];
const int xap = xapoints[x];
if (xap > 0)
@@ -309,7 +302,7 @@ static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
dptr++;
}
} else {
- for (int x = dxx; x < end; x++) {
+ for (int x = 0; x < dw; x++) {
const unsigned int *pix = sptr + xpoints[x];
const int xap = xapoints[x];
if (xap > 0)
@@ -324,39 +317,38 @@ static void qt_qimageScaleAARGBA_up_xy(QImageScaleInfo *isi, unsigned int *dest,
/* scale by area sampling */
static void qt_qimageScaleAARGBA(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow)
+ int dw, int dh, int dow, int sow)
{
/* scaling up both ways */
if (isi->xup_yup == 3) {
- qt_qimageScaleAARGBA_up_xy(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_up_xy(isi, dest, dw, dh, dow, sow);
}
/* if we're scaling down vertically */
else if (isi->xup_yup == 1) {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
- qt_qimageScaleAARGBA_up_x_down_y_sse4<false>(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_up_x_down_y_sse4<false>(isi, dest, dw, dh, dow, sow);
else
#endif
- qt_qimageScaleAARGBA_up_x_down_y(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_up_x_down_y(isi, dest, dw, dh, dow, sow);
}
/* if we're scaling down horizontally */
else if (isi->xup_yup == 2) {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
- qt_qimageScaleAARGBA_down_x_up_y_sse4<false>(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_down_x_up_y_sse4<false>(isi, dest, dw, dh, dow, sow);
else
#endif
- qt_qimageScaleAARGBA_down_x_up_y(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_down_x_up_y(isi, dest, dw, dh, dow, sow);
}
/* if we're scaling down horizontally & vertically */
else {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
- qt_qimageScaleAARGBA_down_xy_sse4<false>(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_down_xy_sse4<false>(isi, dest, dw, dh, dow, sow);
else
#endif
- qt_qimageScaleAARGBA_down_xy(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_down_xy(isi, dest, dw, dh, dow, sow);
}
}
@@ -382,7 +374,6 @@ inline static void qt_qimageScaleAARGBA_helper(const unsigned int *pix, int xyap
}
static void qt_qimageScaleAARGBA_up_x_down_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
@@ -390,16 +381,14 @@ static void qt_qimageScaleAARGBA_up_x_down_y(QImageScaleInfo *isi, unsigned int
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
- int Cy = (yapoints[dyy + y]) >> 16;
- int yap = (yapoints[dyy + y]) & 0xffff;
+ int Cy = yapoints[y] >> 16;
+ int yap = yapoints[y] & 0xffff;
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
int r, g, b, a;
qt_qimageScaleAARGBA_helper(sptr, yap, Cy, sow, r, g, b, a);
@@ -423,7 +412,6 @@ static void qt_qimageScaleAARGBA_up_x_down_y(QImageScaleInfo *isi, unsigned int
}
static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
@@ -431,20 +419,18 @@ static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
int Cx = xapoints[x] >> 16;
int xap = xapoints[x] & 0xffff;
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
int r, g, b, a;
qt_qimageScaleAARGBA_helper(sptr, xap, Cx, 1, r, g, b, a);
- int yap = yapoints[dyy + y];
+ int yap = yapoints[y];
if (yap > 0) {
int rr, gg, bb, aa;
qt_qimageScaleAARGBA_helper(sptr + sow, xap, Cx, 1, rr, gg, bb, aa);
@@ -465,26 +451,23 @@ static void qt_qimageScaleAARGBA_down_x_up_y(QImageScaleInfo *isi, unsigned int
}
static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow)
+ int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
int *xpoints = isi->xpoints;
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
for (int y = 0; y < dh; y++) {
- int Cy = (yapoints[dyy + y]) >> 16;
- int yap = (yapoints[dyy + y]) & 0xffff;
+ int Cy = (yapoints[y]) >> 16;
+ int yap = (yapoints[y]) & 0xffff;
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
int Cx = xapoints[x] >> 16;
int xap = xapoints[x] & 0xffff;
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
int rx, gx, bx, ax;
qt_qimageScaleAARGBA_helper(sptr, xap, Cx, 1, rx, gx, bx, ax);
@@ -517,52 +500,48 @@ static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *des
}
static void qt_qimageScaleAARGB_up_x_down_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow);
+ int dw, int dh, int dow, int sow);
static void qt_qimageScaleAARGB_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow);
+ int dw, int dh, int dow, int sow);
static void qt_qimageScaleAARGB_down_xy(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow);
+ int dw, int dh, int dow, int sow);
/* scale by area sampling - IGNORE the ALPHA byte*/
static void qt_qimageScaleAARGB(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
/* scaling up both ways */
if (isi->xup_yup == 3) {
- qt_qimageScaleAARGBA_up_xy(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_up_xy(isi, dest, dw, dh, dow, sow);
}
/* if we're scaling down vertically */
else if (isi->xup_yup == 1) {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
- qt_qimageScaleAARGBA_up_x_down_y_sse4<true>(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_up_x_down_y_sse4<true>(isi, dest, dw, dh, dow, sow);
else
#endif
- qt_qimageScaleAARGB_up_x_down_y(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGB_up_x_down_y(isi, dest, dw, dh, dow, sow);
}
/* if we're scaling down horizontally */
else if (isi->xup_yup == 2) {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
- qt_qimageScaleAARGBA_down_x_up_y_sse4<true>(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_down_x_up_y_sse4<true>(isi, dest, dw, dh, dow, sow);
else
#endif
- qt_qimageScaleAARGB_down_x_up_y(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGB_down_x_up_y(isi, dest, dw, dh, dow, sow);
}
/* if we're scaling down horizontally & vertically */
else {
#ifdef QT_COMPILER_SUPPORTS_SSE4_1
if (qCpuHasFeature(SSE4_1))
- qt_qimageScaleAARGBA_down_xy_sse4<true>(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGBA_down_xy_sse4<true>(isi, dest, dw, dh, dow, sow);
else
#endif
- qt_qimageScaleAARGB_down_xy(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow);
+ qt_qimageScaleAARGB_down_xy(isi, dest, dw, dh, dow, sow);
}
}
@@ -586,24 +565,21 @@ inline static void qt_qimageScaleAARGB_helper(const unsigned int *pix, int xyap,
}
static void qt_qimageScaleAARGB_up_x_down_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow)
+ int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
int *xpoints = isi->xpoints;
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
- int Cy = (yapoints[dyy + y]) >> 16;
- int yap = (yapoints[dyy + y]) & 0xffff;
+ int Cy = yapoints[y] >> 16;
+ int yap = yapoints[y] & 0xffff;
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
int r, g, b;
qt_qimageScaleAARGB_helper(sptr, yap, Cy, sow, r, g, b);
@@ -625,28 +601,25 @@ static void qt_qimageScaleAARGB_up_x_down_y(QImageScaleInfo *isi, unsigned int *
}
static void qt_qimageScaleAARGB_down_x_up_y(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow)
+ int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
int *xpoints = isi->xpoints;
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
int Cx = xapoints[x] >> 16;
int xap = xapoints[x] & 0xffff;
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
int r, g, b;
qt_qimageScaleAARGB_helper(sptr, xap, Cx, 1, r, g, b);
- int yap = yapoints[dyy + y];
+ int yap = yapoints[y];
if (yap > 0) {
int rr, bb, gg;
qt_qimageScaleAARGB_helper(sptr + sow, xap, Cx, 1, rr, gg, bb);
@@ -664,26 +637,23 @@ static void qt_qimageScaleAARGB_down_x_up_y(QImageScaleInfo *isi, unsigned int *
}
static void qt_qimageScaleAARGB_down_xy(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy, int dw,
- int dh, int dow, int sow)
+ int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
int *xpoints = isi->xpoints;
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
for (int y = 0; y < dh; y++) {
- int Cy = (yapoints[dyy + y]) >> 16;
- int yap = (yapoints[dyy + y]) & 0xffff;
+ int Cy = yapoints[y] >> 16;
+ int yap = yapoints[y] & 0xffff;
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
int Cx = xapoints[x] >> 16;
int xap = xapoints[x] & 0xffff;
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
int rx, gx, bx;
qt_qimageScaleAARGB_helper(sptr, xap, Cx, 1, rx, gx, bx);
@@ -735,10 +705,10 @@ QImage qSmoothScaleImage(const QImage &src, int dw, int dh)
if (src.hasAlphaChannel())
qt_qimageScaleAARGBA(scaleinfo, (unsigned int *)buffer.scanLine(0),
- 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);
+ dw, dh, dw, src.bytesPerLine() / 4);
else
qt_qimageScaleAARGB(scaleinfo, (unsigned int *)buffer.scanLine(0),
- 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);
+ dw, dh, dw, src.bytesPerLine() / 4);
qimageFreeScaleInfo(scaleinfo);
return buffer;
diff --git a/src/gui/painting/qimagescale_sse4.cpp b/src/gui/painting/qimagescale_sse4.cpp
index 303e0fd980..8712b5d324 100644
--- a/src/gui/painting/qimagescale_sse4.cpp
+++ b/src/gui/painting/qimagescale_sse4.cpp
@@ -59,7 +59,6 @@ inline static __m128i qt_qimageScaleAARGBA_helper(const unsigned int *pix, int x
template<bool RGB>
void qt_qimageScaleAARGBA_up_x_down_y_sse4(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
@@ -67,20 +66,18 @@ void qt_qimageScaleAARGBA_up_x_down_y_sse4(QImageScaleInfo *isi, unsigned int *d
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
const __m128i v256 = _mm_set1_epi32(256);
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
- int Cy = (yapoints[dyy + y]) >> 16;
- int yap = (yapoints[dyy + y]) & 0xffff;
+ int Cy = yapoints[y] >> 16;
+ int yap = yapoints[y] & 0xffff;
const __m128i vCy = _mm_set1_epi32(Cy);
const __m128i vyap = _mm_set1_epi32(yap);
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
__m128i vx = qt_qimageScaleAARGBA_helper(sptr, yap, Cy, sow, vyap, vCy);
int xap = xapoints[x];
@@ -107,7 +104,6 @@ void qt_qimageScaleAARGBA_up_x_down_y_sse4(QImageScaleInfo *isi, unsigned int *d
template<bool RGB>
void qt_qimageScaleAARGBA_down_x_up_y_sse4(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
@@ -115,23 +111,21 @@ void qt_qimageScaleAARGBA_down_x_up_y_sse4(QImageScaleInfo *isi, unsigned int *d
int *xapoints = isi->xapoints;
int *yapoints = isi->yapoints;
- int end = dxx + dw;
-
const __m128i v256 = _mm_set1_epi32(256);
/* go through every scanline in the output buffer */
for (int y = 0; y < dh; y++) {
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- for (int x = dxx; x < end; x++) {
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
int Cx = xapoints[x] >> 16;
int xap = xapoints[x] & 0xffff;
const __m128i vCx = _mm_set1_epi32(Cx);
const __m128i vxap = _mm_set1_epi32(xap);
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
__m128i vx = qt_qimageScaleAARGBA_helper(sptr, xap, Cx, 1, vxap, vCx);
- int yap = yapoints[dyy + y];
+ int yap = yapoints[y];
if (yap > 0) {
const __m128i vyap = _mm_set1_epi32(yap);
const __m128i vinvyap = _mm_sub_epi32(v256, vyap);
@@ -155,7 +149,6 @@ void qt_qimageScaleAARGBA_down_x_up_y_sse4(QImageScaleInfo *isi, unsigned int *d
template<bool RGB>
void qt_qimageScaleAARGBA_down_xy_sse4(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow)
{
const unsigned int **ypoints = isi->ypoints;
@@ -164,20 +157,19 @@ void qt_qimageScaleAARGBA_down_xy_sse4(QImageScaleInfo *isi, unsigned int *dest,
int *yapoints = isi->yapoints;
for (int y = 0; y < dh; y++) {
- int Cy = (yapoints[dyy + y]) >> 16;
- int yap = (yapoints[dyy + y]) & 0xffff;
+ int Cy = yapoints[y] >> 16;
+ int yap = yapoints[y] & 0xffff;
const __m128i vCy = _mm_set1_epi32(Cy);
const __m128i vyap = _mm_set1_epi32(yap);
- unsigned int *dptr = dest + dx + ((y + dy) * dow);
- int end = dxx + dw;
- for (int x = dxx; x < end; x++) {
+ unsigned int *dptr = dest + (y * dow);
+ for (int x = 0; x < dw; x++) {
const int Cx = xapoints[x] >> 16;
const int xap = xapoints[x] & 0xffff;
const __m128i vCx = _mm_set1_epi32(Cx);
const __m128i vxap = _mm_set1_epi32(xap);
- const unsigned int *sptr = ypoints[dyy + y] + xpoints[x];
+ const unsigned int *sptr = ypoints[y] + xpoints[x];
__m128i vx = qt_qimageScaleAARGBA_helper(sptr, xap, Cx, 1, vxap, vCx);
__m128i vr = _mm_mullo_epi32(_mm_srli_epi32(vx, 4), vyap);
@@ -203,27 +195,21 @@ void qt_qimageScaleAARGBA_down_xy_sse4(QImageScaleInfo *isi, unsigned int *dest,
}
template void qt_qimageScaleAARGBA_up_x_down_y_sse4<false>(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template void qt_qimageScaleAARGBA_up_x_down_y_sse4<true>(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template void qt_qimageScaleAARGBA_down_x_up_y_sse4<false>(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template void qt_qimageScaleAARGBA_down_x_up_y_sse4<true>(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template void qt_qimageScaleAARGBA_down_xy_sse4<false>(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
template void qt_qimageScaleAARGBA_down_xy_sse4<true>(QImageScaleInfo *isi, unsigned int *dest,
- int dxx, int dyy, int dx, int dy,
int dw, int dh, int dow, int sow);
QT_END_NAMESPACE
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index acedc6a7ba..e4d756c18d 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -31,9 +31,11 @@
**
****************************************************************************/
+#include "qmatrix.h"
+
#include "qdatastream.h"
#include "qdebug.h"
-#include "qmatrix.h"
+#include "qhashfunctions.h"
#include "qregion.h"
#include "qpainterpath.h"
#include "qpainterpath_p.h"
@@ -972,6 +974,26 @@ bool QMatrix::operator==(const QMatrix &m) const
_dy == m._dy;
}
+
+/*!
+ \since 5.6
+ \relates QMatrix
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QMatrix &key, uint seed) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(key.m11(), seed);
+ seed = hash(key.m12(), seed);
+ seed = hash(key.m21(), seed);
+ seed = hash(key.m22(), seed);
+ seed = hash(key.dx(), seed);
+ seed = hash(key.dy(), seed);
+ return seed;
+}
+
/*!
\fn bool QMatrix::operator!=(const QMatrix &matrix) const
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index ddffa8a8b9..809a19a0b8 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -92,7 +92,7 @@ public:
bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); }
qreal determinant() const { return _m11*_m22 - _m12*_m21; }
- QMatrix inverted(bool *invertible = 0) const Q_REQUIRED_RESULT;
+ QMatrix inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT;
bool operator==(const QMatrix &) const;
bool operator!=(const QMatrix &) const;
@@ -126,6 +126,8 @@ private:
};
Q_DECLARE_TYPEINFO(QMatrix, Q_MOVABLE_TYPE);
+Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QMatrix &key, uint seed = 0) Q_DECL_NOTHROW;
+
// mathematical semantics
inline QPoint operator*(const QPoint &p, const QMatrix &m)
{ return m.map(p); }
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index 3adc5e9411..547cedf51f 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -36,6 +36,10 @@
QT_BEGIN_NAMESPACE
+QPagedPaintDevicePrivate::~QPagedPaintDevicePrivate()
+{
+}
+
/*!
\class QPagedPaintDevice
\inmodule QtGui
diff --git a/src/gui/painting/qpagedpaintdevice_p.h b/src/gui/painting/qpagedpaintdevice_p.h
index 62f69747db..30b1c0a1e6 100644
--- a/src/gui/painting/qpagedpaintdevice_p.h
+++ b/src/gui/painting/qpagedpaintdevice_p.h
@@ -61,9 +61,7 @@ public:
{
}
- virtual ~QPagedPaintDevicePrivate()
- {
- }
+ virtual ~QPagedPaintDevicePrivate();
// ### Qt6 Remove these and make public class methods virtual
virtual bool setPageLayout(const QPageLayout &newPageLayout)
diff --git a/src/gui/painting/qpagelayout.h b/src/gui/painting/qpagelayout.h
index 17e5eeece2..7eac348c43 100644
--- a/src/gui/painting/qpagelayout.h
+++ b/src/gui/painting/qpagelayout.h
@@ -75,14 +75,13 @@ public:
const QMarginsF &margins, Unit units = Point,
const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
QPageLayout(const QPageLayout &other);
- ~QPageLayout();
-
- QPageLayout &operator=(const QPageLayout &other);
- #ifdef Q_COMPILER_RVALUE_REFS
- QPageLayout &operator=(QPageLayout &&other) { swap(other); return *this; }
+#ifdef Q_COMPILER_RVALUE_REFS
+ QPageLayout &operator=(QPageLayout &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
+ QPageLayout &operator=(const QPageLayout &other);
+ ~QPageLayout();
- void swap(QPageLayout &other) { d.swap(other.d); }
+ void swap(QPageLayout &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
friend Q_GUI_EXPORT bool operator==(const QPageLayout &lhs, const QPageLayout &rhs);
bool isEquivalentTo(const QPageLayout &other) const;
diff --git a/src/gui/painting/qpagesize.h b/src/gui/painting/qpagesize.h
index 00e22a243f..9119a582ac 100644
--- a/src/gui/painting/qpagesize.h
+++ b/src/gui/painting/qpagesize.h
@@ -229,14 +229,14 @@ public:
const QString &name = QString(),
SizeMatchPolicy matchPolicy = FuzzyMatch);
QPageSize(const QPageSize &other);
- ~QPageSize();
-
- QPageSize &operator=(const QPageSize &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QPageSize &operator=(QPageSize &&other) { swap(other); return *this; }
+ QPageSize &operator=(QPageSize &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
+ QPageSize &operator=(const QPageSize &other);
+ ~QPageSize();
+
- void swap(QPageSize &other) { d.swap(other.d); }
+ void swap(QPageSize &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
friend Q_GUI_EXPORT bool operator==(const QPageSize &lhs, const QPageSize &rhs);
bool isEquivalentTo(const QPageSize &other) const;
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index bbf8e8f170..2332d11a03 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -79,7 +79,13 @@ Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice
int QPaintDevice::metric(PaintDeviceMetric m) const
{
+ // Fallback: A subclass has not implemented PdmDevicePixelRatioScaled but might
+ // have implemented PdmDevicePixelRatio.
+ if (m == PdmDevicePixelRatioScaled)
+ return this->metric(PdmDevicePixelRatio) * devicePixelRatioFScale();
+
qWarning("QPaintDevice::metrics: Device has no metric information");
+
if (m == PdmDpiX) {
return 72;
} else if (m == PdmDpiY) {
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h
index 4eb972786b..72a6ca4cb3 100644
--- a/src/gui/painting/qpaintdevice.h
+++ b/src/gui/painting/qpaintdevice.h
@@ -58,7 +58,8 @@ public:
PdmDpiY,
PdmPhysicalDpiX,
PdmPhysicalDpiY,
- PdmDevicePixelRatio
+ PdmDevicePixelRatio,
+ PdmDevicePixelRatioScaled
};
virtual ~QPaintDevice();
@@ -76,9 +77,11 @@ public:
int physicalDpiX() const { return metric(PdmPhysicalDpiX); }
int physicalDpiY() const { return metric(PdmPhysicalDpiY); }
int devicePixelRatio() const { return metric(PdmDevicePixelRatio); }
+ qreal devicePixelRatioF() const { return metric(PdmDevicePixelRatioScaled) / devicePixelRatioFScale(); }
int colorCount() const { return metric(PdmNumColors); }
int depth() const { return metric(PdmDepth); }
+ static inline qreal devicePixelRatioFScale() { return 0x10000; }
protected:
QPaintDevice() Q_DECL_NOEXCEPT;
virtual int metric(PaintDeviceMetric metric) const;
@@ -87,7 +90,6 @@ protected:
virtual QPainter *sharedPainter() const;
ushort painters; // refcount
-
private:
Q_DISABLE_COPY(QPaintDevice)
diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc
index 8db65af18e..ef5deb154d 100644
--- a/src/gui/painting/qpaintdevice.qdoc
+++ b/src/gui/painting/qpaintdevice.qdoc
@@ -118,7 +118,13 @@
values are 1 for normal-dpi displays and 2 for high-dpi "retina"
displays.
- \sa metric()
+ \value PdmDevicePixelRatioScaled The scaled device pixel ratio for the device.
+ This is identical to PdmDevicePixelRatio, except that the value is scaled by a
+ constant factor in order to support paint devices with fractional scale factors.
+ The constant scaling factor used is devicePixelRatioFScale(). This enum value
+ has been introduced in Qt 5.6.
+
+ \sa metric(), devicePixelRatioF()
*/
/*!
@@ -286,3 +292,24 @@
Common values are 1 for normal-dpi displays and 2 for high-dpi
"retina" displays.
*/
+
+/*!
+ \fn qreal QPaintDevice::devicePixelRatioF() const
+
+ Returns the device pixel ratio for the device as a floating point number.
+
+ \since 5.6
+*/
+
+/*!
+ \fn qreal QPaintDevice::devicePixelRatioFScale()
+
+ \internal
+
+ Returns the scaling factor used for \c PdmDevicePixelRatioScaled. Classes
+ that are not QPaintDevice subclasses are implementing metric(), and need to
+ access this constant. Since it's a qreal, it cannot be an enum, and an inline
+ function is more efficient than a static member variable.
+
+ \since 5.6
+*/
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 6ba26df3b4..ef93094387 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -968,6 +968,10 @@ QRect QPaintEngine::systemRect() const
return d_func()->systemRect;
}
+QPaintEnginePrivate::~QPaintEnginePrivate()
+{
+}
+
void QPaintEnginePrivate::drawBoxTextItem(const QPointF &p, const QTextItemInt &ti)
{
if (!ti.glyphs.numGlyphs)
diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h
index eeca87ce16..fa3fad1caa 100644
--- a/src/gui/painting/qpaintengine.h
+++ b/src/gui/painting/qpaintengine.h
@@ -137,7 +137,7 @@ public:
PolylineMode
};
- explicit QPaintEngine(PaintEngineFeatures features=0);
+ explicit QPaintEngine(PaintEngineFeatures features=PaintEngineFeatures());
virtual ~QPaintEngine();
bool isActive() const { return active; }
@@ -220,7 +220,7 @@ public:
inline bool isExtended() const { return extended; }
protected:
- QPaintEngine(QPaintEnginePrivate &data, PaintEngineFeatures devcaps=0);
+ QPaintEngine(QPaintEnginePrivate &data, PaintEngineFeatures devcaps=PaintEngineFeatures());
QPaintEngineState *state;
PaintEngineFeatures gccaps;
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index c58662ede4..918c98997b 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -60,7 +60,8 @@ class Q_GUI_EXPORT QPaintEnginePrivate
public:
QPaintEnginePrivate() : pdev(0), q_ptr(0), currentClipDevice(0), hasSystemTransform(0),
hasSystemViewport(0) {}
- virtual ~QPaintEnginePrivate() { }
+ virtual ~QPaintEnginePrivate();
+
QPaintDevice *pdev;
QPaintEngine *q_ptr;
QRegion systemClip;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index a5957ca86e..05ccff5de0 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -42,7 +42,6 @@
#include <qpainterpath.h>
#include <qdebug.h>
-#include <qhash.h>
#include <qbitmap.h>
#include <qmath.h>
@@ -57,6 +56,7 @@
#include <private/qstatictext_p.h>
#include <private/qcosmeticstroker_p.h>
#include "qmemrotate_p.h"
+#include "qrgba64_p.h"
#include "qpaintengine_raster_p.h"
// #include "qbezier_p.h"
@@ -830,7 +830,7 @@ void QRasterPaintEngine::updateRasterState()
&& s->intOpacity == 256
&& (mode == QPainter::CompositionMode_Source
|| (mode == QPainter::CompositionMode_SourceOver
- && qAlpha(s->penData.solid.color) == 255));
+ && s->penData.solid.color.isOpaque()));
}
s->dirty = 0;
@@ -1412,10 +1412,9 @@ static void fillRect_normalized(const QRect &r, QSpanData *data,
if (data->fillRect && (mode == QPainter::CompositionMode_Source
|| (mode == QPainter::CompositionMode_SourceOver
- && qAlpha(data->solid.color) == 255)))
+ && data->solid.color.isOpaque())))
{
- data->fillRect(data->rasterBuffer, x1, y1, width, height,
- data->solid.color);
+ data->fillRect(data->rasterBuffer, x1, y1, width, height, data->solid.color);
return;
}
}
@@ -1773,8 +1772,9 @@ void QRasterPaintEngine::fillRect(const QRectF &r, const QColor &color)
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
- d->solid_color_filler.solid.color = qPremultiply(ARGB_COMBINE_ALPHA(color.rgba(), s->intOpacity));
- if ((d->solid_color_filler.solid.color & 0xff000000) == 0
+ d->solid_color_filler.solid.color = qPremultiply(combineAlpha256(color.rgba64(), s->intOpacity));
+
+ if (d->solid_color_filler.solid.color.isTransparent()
&& s->composition_mode == QPainter::CompositionMode_SourceOver) {
return;
}
@@ -2219,19 +2219,15 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
case QImage::Format_A2BGR30_Premultiplied:
case QImage::Format_A2RGB30_Premultiplied:
// Combine premultiplied color with the opacity set on the painter.
- d->solid_color_filler.solid.color =
- ((((color & 0x00ff00ff) * s->intOpacity) >> 8) & 0x00ff00ff)
- | ((((color & 0xff00ff00) >> 8) * s->intOpacity) & 0xff00ff00);
+ d->solid_color_filler.solid.color = multiplyAlpha256(QRgba64::fromArgb32(color), s->intOpacity);
break;
default:
- d->solid_color_filler.solid.color = qPremultiply(ARGB_COMBINE_ALPHA(color, s->intOpacity));
+ d->solid_color_filler.solid.color = qPremultiply(combineAlpha256(QRgba64::fromArgb32(color), s->intOpacity));
break;
}
- if ((d->solid_color_filler.solid.color & 0xff000000) == 0
- && s->composition_mode == QPainter::CompositionMode_SourceOver) {
+ if (d->solid_color_filler.solid.color.isTransparent() && s->composition_mode == QPainter::CompositionMode_SourceOver)
return;
- }
d->solid_color_filler.clip = d->clip();
d->solid_color_filler.adjustSpanMethods();
@@ -3657,8 +3653,9 @@ QImage::Format QRasterBuffer::prepare(QImage *image)
drawHelper = qDrawHelper + format;
if (image->depth() == 1 && image->colorTable().size() == 2) {
monoDestinationWithClut = true;
- destColor0 = qPremultiply(image->colorTable()[0]);
- destColor1 = qPremultiply(image->colorTable()[1]);
+ const QVector<QRgb> colorTable = image->colorTable();
+ destColor0 = qPremultiply(colorTable[0]);
+ destColor1 = qPremultiply(colorTable[1]);
}
return format;
@@ -4140,8 +4137,8 @@ class QGradientCache
struct CacheInfo
{
inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) :
- stops(s), opacity(op), interpolationMode(mode) {}
- uint buffer[GRADIENT_STOPTABLE_SIZE];
+ stops(qMove(s)), opacity(op), interpolationMode(mode) {}
+ QRgba64 buffer[GRADIENT_STOPTABLE_SIZE];
QGradientStops stops;
int opacity;
QGradient::InterpolationMode interpolationMode;
@@ -4150,12 +4147,12 @@ class QGradientCache
typedef QMultiHash<quint64, CacheInfo> QGradientColorTableHash;
public:
- inline const uint *getBuffer(const QGradient &gradient, int opacity) {
+ inline const QRgba64 *getBuffer(const QGradient &gradient, int opacity) {
quint64 hash_val = 0;
- QGradientStops stops = gradient.stops();
+ const QGradientStops stops = gradient.stops();
for (int i = 0; i < stops.size() && i <= 2; i++)
- hash_val += stops[i].second.rgba();
+ hash_val += stops[i].second.rgba64();
QMutexLocker lock(&mutex);
QGradientColorTableHash::const_iterator it = cache.constFind(hash_val);
@@ -4178,9 +4175,9 @@ public:
protected:
inline int maxCacheSize() const { return 60; }
inline void generateGradientColorTable(const QGradient& g,
- uint *colorTable,
+ QRgba64 *colorTable,
int size, int opacity) const;
- uint *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
+ QRgba64 *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
if (cache.size() == maxCacheSize()) {
// may remove more than 1, but OK
cache.erase(cache.begin() + (qrand() % maxCacheSize()));
@@ -4194,23 +4191,25 @@ protected:
QMutex mutex;
};
-void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, int opacity) const
+void QGradientCache::generateGradientColorTable(const QGradient& gradient, QRgba64 *colorTable, int size, int opacity) const
{
- QGradientStops stops = gradient.stops();
+ const QGradientStops stops = gradient.stops();
int stopCount = stops.count();
Q_ASSERT(stopCount > 0);
bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation);
if (stopCount == 2) {
- uint first_color = ARGB_COMBINE_ALPHA(stops[0].second.rgba(), opacity);
- uint second_color = ARGB_COMBINE_ALPHA(stops[1].second.rgba(), opacity);
+ QRgba64 first_color = combineAlpha256(stops[0].second.rgba64(), opacity);
+ QRgba64 second_color = combineAlpha256(stops[1].second.rgba64(), opacity);
qreal first_stop = stops[0].first;
qreal second_stop = stops[1].first;
if (second_stop < first_stop) {
- qSwap(first_color, second_color);
+ quint64 tmp = first_color;
+ first_color = second_color;
+ second_color = tmp;
qSwap(first_stop, second_stop);
}
@@ -4222,15 +4221,15 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
int first_index = qRound(first_stop * (GRADIENT_STOPTABLE_SIZE-1));
int second_index = qRound(second_stop * (GRADIENT_STOPTABLE_SIZE-1));
- uint red_first = qRed(first_color) << 16;
- uint green_first = qGreen(first_color) << 16;
- uint blue_first = qBlue(first_color) << 16;
- uint alpha_first = qAlpha(first_color) << 16;
+ uint red_first = uint(first_color.red()) << 16;
+ uint green_first = uint(first_color.green()) << 16;
+ uint blue_first = uint(first_color.blue()) << 16;
+ uint alpha_first = uint(first_color.alpha()) << 16;
- uint red_second = qRed(second_color) << 16;
- uint green_second = qGreen(second_color) << 16;
- uint blue_second = qBlue(second_color) << 16;
- uint alpha_second = qAlpha(second_color) << 16;
+ uint red_second = uint(second_color.red()) << 16;
+ uint green_second = uint(second_color.green()) << 16;
+ uint blue_second = uint(second_color.blue()) << 16;
+ uint alpha_second = uint(second_color.alpha()) << 16;
int i = 0;
for (; i <= qMin(GRADIENT_STOPTABLE_SIZE, first_index); ++i) {
@@ -4243,10 +4242,10 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
if (i < second_index) {
qreal reciprocal = qreal(1) / (second_index - first_index);
- int red_delta = qRound(int(red_second - red_first) * reciprocal);
- int green_delta = qRound(int(green_second - green_first) * reciprocal);
- int blue_delta = qRound(int(blue_second - blue_first) * reciprocal);
- int alpha_delta = qRound(int(alpha_second - alpha_first) * reciprocal);
+ int red_delta = qRound((qreal(red_second) - red_first) * reciprocal);
+ int green_delta = qRound((qreal(green_second) - green_first) * reciprocal);
+ int blue_delta = qRound((qreal(blue_second) - blue_first) * reciprocal);
+ int alpha_delta = qRound((qreal(alpha_second) - alpha_first) * reciprocal);
// rounding
red_first += 1 << 15;
@@ -4260,8 +4259,7 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
blue_first += blue_delta;
alpha_first += alpha_delta;
- const uint color = ((alpha_first << 8) & 0xff000000) | (red_first & 0xff0000)
- | ((green_first >> 8) & 0xff00) | (blue_first >> 16);
+ const QRgba64 color = qRgba64(red_first >> 16, green_first >> 16, blue_first >> 16, alpha_first >> 16);
if (colorInterpolation)
colorTable[i] = color;
@@ -4280,7 +4278,7 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
return;
}
- uint current_color = ARGB_COMBINE_ALPHA(stops[0].second.rgba(), opacity);
+ QRgba64 current_color = combineAlpha256(stops[0].second.rgba64(), opacity);
if (stopCount == 1) {
current_color = qPremultiply(current_color);
for (int i = 0; i < size; ++i)
@@ -4293,7 +4291,7 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
qreal end_pos = stops[stopCount-1].first;
int pos = 0; // The position in the color table.
- uint next_color;
+ QRgba64 next_color;
qreal incr = 1 / qreal(size); // the double increment.
qreal dpos = 1.5 * incr; // current position in gradient stop list (0 to 1)
@@ -4317,8 +4315,8 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
++current_stop;
if (current_stop != 0)
- current_color = ARGB_COMBINE_ALPHA(stops[current_stop].second.rgba(), opacity);
- next_color = ARGB_COMBINE_ALPHA(stops[current_stop+1].second.rgba(), opacity);
+ current_color = combineAlpha256(stops[current_stop].second.rgba64(), opacity);
+ next_color = combineAlpha256(stops[current_stop+1].second.rgba64(), opacity);
if (colorInterpolation) {
current_color = qPremultiply(current_color);
@@ -4337,9 +4335,9 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
int idist = 256 - dist;
if (colorInterpolation)
- colorTable[pos] = INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist);
+ colorTable[pos] = interpolate256(current_color, idist, next_color, dist);
else
- colorTable[pos] = qPremultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
+ colorTable[pos] = qPremultiply(interpolate256(current_color, idist, next_color, dist));
++pos;
dpos += incr;
@@ -4358,8 +4356,8 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
if (skip == 1)
current_color = next_color;
else
- current_color = ARGB_COMBINE_ALPHA(stops[current_stop].second.rgba(), opacity);
- next_color = ARGB_COMBINE_ALPHA(stops[current_stop+1].second.rgba(), opacity);
+ current_color = combineAlpha256(stops[current_stop].second.rgba64(), opacity);
+ next_color = combineAlpha256(stops[current_stop+1].second.rgba64(), opacity);
if (colorInterpolation) {
if (skip != 1)
@@ -4376,7 +4374,7 @@ void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint
}
// After last point
- current_color = qPremultiply(ARGB_COMBINE_ALPHA(stops[stopCount - 1].second.rgba(), opacity));
+ current_color = qPremultiply(combineAlpha256(stops[stopCount - 1].second.rgba64(), opacity));
while (pos < size - 1) {
colorTable[pos] = current_color;
++pos;
@@ -4409,12 +4407,9 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
case Qt::SolidPattern: {
type = Solid;
QColor c = qbrush_color(brush);
- QRgb rgba = c.rgba();
- solid.color = qPremultiply(ARGB_COMBINE_ALPHA(rgba, alpha));
- if ((solid.color & 0xff000000) == 0
- && compositionMode == QPainter::CompositionMode_SourceOver) {
+ solid.color = qPremultiply(combineAlpha256(c.rgba64(), alpha));
+ if (solid.color.isTransparent() && compositionMode == QPainter::CompositionMode_SourceOver)
type = None;
- }
break;
}
@@ -4423,7 +4418,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
type = LinearGradient;
const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
+ gradient.colorTable = const_cast<QRgba64*>(qt_gradient_cache()->getBuffer(*g, alpha));
gradient.spread = g->spread();
QLinearGradientData &linearData = gradient.linear;
@@ -4440,7 +4435,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
type = RadialGradient;
const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
+ gradient.colorTable = const_cast<QRgba64*>(qt_gradient_cache()->getBuffer(*g, alpha));
gradient.spread = g->spread();
QRadialGradientData &radialData = gradient.radial;
@@ -4461,7 +4456,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
type = ConicalGradient;
const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
- gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
+ gradient.colorTable = const_cast<QRgba64*>(qt_gradient_cache()->getBuffer(*g, alpha));
gradient.spread = QGradient::RepeatSpread;
QConicalGradientData &conicalData = gradient.conical;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 20608e5aee..5dcab11f0a 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -219,18 +219,18 @@ QTransform QPainterPrivate::viewTransform() const
return QTransform();
}
-int QPainterPrivate::effectiveDevicePixelRatio() const
+qreal QPainterPrivate::effectiveDevicePixelRatio() const
{
// Special cases for devices that does not support PdmDevicePixelRatio go here:
if (device->devType() == QInternal::Printer)
- return 1;
+ return qreal(1);
- return qMax(1, device->metric(QPaintDevice::PdmDevicePixelRatio));
+ return qMax(qreal(1), device->devicePixelRatioF());
}
QTransform QPainterPrivate::hidpiScaleTransform() const
{
- int devicePixelRatio = effectiveDevicePixelRatio();
+ const qreal devicePixelRatio = effectiveDevicePixelRatio();
return QTransform::fromScale(devicePixelRatio, devicePixelRatio);
}
@@ -3154,7 +3154,7 @@ void QPainter::shear(qreal sh, qreal sv)
/*!
\fn void QPainter::rotate(qreal angle)
- Rotates the coordinate system clockwise. The given \a angle parameter uses degree unit.
+ Rotates the coordinate system clockwise. The given \a angle parameter is in degrees.
\sa setWorldTransform(), {QPainter#Coordinate Transformations}{Coordinate Transformations}
*/
@@ -5110,7 +5110,7 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm)
x += d->state->matrix.dx();
y += d->state->matrix.dy();
}
- int scale = pm.devicePixelRatio();
+ qreal scale = pm.devicePixelRatio();
d->engine->drawPixmap(QRectF(x, y, w / scale, h / scale), pm, QRectF(0, 0, w, h));
}
}
@@ -7470,7 +7470,7 @@ start_lengthVariant:
}
}
- QList<QTextLayout::FormatRange> underlineFormats;
+ QVector<QTextLayout::FormatRange> underlineFormats;
int length = offset - old_offset;
if ((hidemnmemonic || showmnemonic) && maxUnderlines > 0) {
QChar *cout = text.data() + old_offset;
@@ -7526,6 +7526,7 @@ start_lengthVariant:
if (engine.option.tabs().isEmpty() && ta) {
QList<qreal> tabs;
+ tabs.reserve(tabarraylen);
for (int i = 0; i < tabarraylen; i++)
tabs.append(qreal(ta[i]));
engine.option.setTabArray(tabs);
@@ -7544,7 +7545,7 @@ start_lengthVariant:
engine.forceJustification = true;
QTextLayout textLayout(&engine);
textLayout.setCacheEnabled(true);
- textLayout.setAdditionalFormats(underlineFormats);
+ textLayout.setFormats(underlineFormats);
if (finalText.isEmpty()) {
height = fm.height();
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 51776a9642..8e2d17d3a5 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -374,7 +374,7 @@ public:
inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
void drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount,
- const QPixmap &pixmap, PixmapFragmentHints hints = 0);
+ const QPixmap &pixmap, PixmapFragmentHints hints = PixmapFragmentHints());
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
Qt::ImageConversionFlags flags = Qt::AutoColor);
@@ -408,9 +408,9 @@ public:
void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
- void drawText(const QRectF &r, int flags, const QString &text, QRectF *br=0);
- void drawText(const QRect &r, int flags, const QString &text, QRect *br=0);
- inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br=0);
+ void drawText(const QRectF &r, int flags, const QString &text, QRectF *br = Q_NULLPTR);
+ void drawText(const QRect &r, int flags, const QString &text, QRect *br = Q_NULLPTR);
+ inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br = Q_NULLPTR);
void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
@@ -453,7 +453,7 @@ public:
static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement,
const QPoint& offset = QPoint());
- static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = 0);
+ static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = Q_NULLPTR);
static void restoreRedirected(const QPaintDevice *device);
void beginNativePainting();
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 7c32dc1694..e8b675365f 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -53,7 +53,6 @@
#include "QtGui/qpainter.h"
#include "QtGui/qpainterpath.h"
#include "QtGui/qpaintengine.h"
-#include <QtCore/qhash.h>
#include <private/qpen_p.h>
@@ -241,7 +240,7 @@ public:
}
QTransform viewTransform() const;
- int effectiveDevicePixelRatio() const;
+ qreal effectiveDevicePixelRatio() const;
QTransform hidpiScaleTransform() const;
static bool attachPainterPrivate(QPainter *q, QPaintDevice *pdev);
void detachPainterPrivate(QPainter *q);
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index 0798418c17..3a686bd209 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -548,11 +548,11 @@ void SegmentTree::produceIntersectionsLeaf(const TreeNode &node, int segment)
for (int k = 0; k < m_intersections.size(); ++k) {
QPathSegments::Intersection i_isect, j_isect;
- i_isect.vertex = j_isect.vertex = m_segments.addPoint(m_intersections.at(k).pos);
-
i_isect.t = m_intersections.at(k).alphaA;
j_isect.t = m_intersections.at(k).alphaB;
+ i_isect.vertex = j_isect.vertex = m_segments.addPoint(m_intersections.at(k).pos);
+
i_isect.next = 0;
j_isect.next = 0;
@@ -1889,10 +1889,10 @@ bool QPathClipper::handleCrossingEdges(QWingedEdge &list, qreal y, ClipperMode m
namespace {
-QList<QPainterPath> toSubpaths(const QPainterPath &path)
+QVector<QPainterPath> toSubpaths(const QPainterPath &path)
{
- QList<QPainterPath> subpaths;
+ QVector<QPainterPath> subpaths;
if (path.isEmpty())
return subpaths;
@@ -2092,7 +2092,7 @@ QPainterPath clip(const QPainterPath &path, qreal t)
QPainterPath intersectPath(const QPainterPath &path, const QRectF &rect)
{
- QList<QPainterPath> subpaths = toSubpaths(path);
+ QVector<QPainterPath> subpaths = toSubpaths(path);
QPainterPath result;
result.setFillRule(path.fillRule());
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index 36330052dd..d1caea4a1a 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -156,9 +156,8 @@ class QPathSegments
{
public:
struct Intersection {
- int vertex;
qreal t;
-
+ int vertex;
int next;
bool operator<(const Intersection &o) const {
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 54e656e339..d746ab9379 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -377,8 +377,8 @@ QByteArray QPdf::generateDashes(const QPen &pen)
s << dw;
}
s << ']';
- //qDebug() << "dasharray: pen has" << dasharray;
- //qDebug() << " => " << result;
+ s << pen.dashOffset() * w;
+ s << " d\n";
return result;
}
@@ -996,6 +996,34 @@ void QPdfEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
*d->currentPage << "Q\n";
}
+void QPdfEngine::drawHyperlink(const QRectF &r, const QUrl &url)
+{
+ Q_D(QPdfEngine);
+
+ const uint annot = d->addXrefEntry(-1);
+ const QByteArray urlascii = url.toEncoded();
+ int len = urlascii.size();
+ QVarLengthArray<char> url_esc(0);
+ for (int j = 0; j < len; j++) {
+ if (urlascii[j] == '(' || urlascii[j] == ')' || urlascii[j] == '\\')
+ url_esc.append('\\');
+ url_esc.append(urlascii[j]);
+ }
+ url_esc.append('\0');
+
+ char buf[256];
+ const QRectF rr = d->pageMatrix().mapRect(r);
+ d->xprintf("<<\n/Type /Annot\n/Subtype /Link\n/Rect [");
+ d->xprintf("%s ", qt_real_to_string(rr.left(), buf));
+ d->xprintf("%s ", qt_real_to_string(rr.top(), buf));
+ d->xprintf("%s ", qt_real_to_string(rr.right(), buf));
+ d->xprintf("%s", qt_real_to_string(rr.bottom(), buf));
+ d->xprintf("]\n/Border [0 0 0]\n/A <<\n");
+ d->xprintf("/Type /Action\n/S /URI\n/URI (%s)\n", url_esc.constData());
+ d->xprintf(">>\n>>\n");
+ d->xprintf("endobj\n");
+ d->currentPage->annotations.append(annot);
+}
void QPdfEngine::updateState(const QPaintEngineState &state)
{
@@ -1181,7 +1209,7 @@ void QPdfEngine::setPen()
}
*d->currentPage << pdfJoinStyle << "j ";
- *d->currentPage << QPdf::generateDashes(d->pen) << " 0 d\n";
+ *d->currentPage << QPdf::generateDashes(d->pen);
}
@@ -1318,6 +1346,9 @@ int QPdfEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const
case QPaintDevice::PdmDevicePixelRatio:
val = 1;
break;
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ val = 1 * QPaintDevice::devicePixelRatioFScale();
+ break;
default:
qWarning("QPdfWriter::metric: Invalid metric command");
return 0;
@@ -1467,7 +1498,7 @@ void QPdfEnginePrivate::writeInfo()
printString(creator);
xprintf("\n/Producer ");
printString(QString::fromLatin1("Qt " QT_VERSION_STR));
- QDateTime now = QDateTime::currentDateTime().toUTC();
+ QDateTime now = QDateTime::currentDateTimeUtc();
QTime t = now.time();
QDate d = now.date();
xprintf("\n/CreationDate (D:%d%02d%02d%02d%02d%02d)\n",
@@ -1762,7 +1793,7 @@ void QPdfEnginePrivate::printString(const QString &string) {
array.append(part[j]);
}
}
- array.append(")");
+ array.append(')');
write(array);
}
@@ -1952,7 +1983,9 @@ int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from
stops.append(QGradientStop(1, stops.at(stops.size() - 1).second));
QVector<int> functions;
- for (int i = 0; i < stops.size() - 1; ++i) {
+ const int numStops = stops.size();
+ functions.reserve(numStops - 1);
+ for (int i = 0; i < numStops - 1; ++i) {
int f = addXrefEntry(-1);
QByteArray data;
QPdf::ByteStream s(&data);
@@ -2098,9 +2131,9 @@ int QPdfEnginePrivate::generateLinearGradientShader(const QLinearGradient *gradi
int QPdfEnginePrivate::generateRadialGradientShader(const QRadialGradient *gradient, const QTransform &matrix, bool alpha)
{
QPointF p1 = gradient->center();
- double r1 = gradient->centerRadius();
+ qreal r1 = gradient->centerRadius();
QPointF p0 = gradient->focalPoint();
- double r0 = gradient->focalRadius();
+ qreal r0 = gradient->focalRadius();
Q_ASSERT(gradient->coordinateMode() == QGradient::LogicalMode);
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index 94e74f30b9..de30744ca2 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -188,6 +188,8 @@ public:
Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
void drawTiledPixmap (const QRectF & rectangle, const QPixmap & pixmap, const QPointF & point) Q_DECL_OVERRIDE;
+ void drawHyperlink(const QRectF &r, const QUrl &url);
+
void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;
int metric(QPaintDevice::PaintDeviceMetric metricType) const;
@@ -243,7 +245,7 @@ public:
QPointF brushOrigin;
QBrush brush;
QPen pen;
- QList<QPainterPath> clips;
+ QVector<QPainterPath> clips;
bool clipEnabled;
bool allClipped;
bool hasPen;
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 6263d18b01..073d254b49 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -980,6 +980,7 @@ QDataStream &operator>>(QDataStream &s, QPen &p)
quint32 numDashes;
s >> numDashes;
double dash;
+ dashPattern.reserve(numDashes);
for (quint32 i = 0; i < numDashes; ++i) {
s >> dash;
dashPattern << dash;
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 22f5662c34..83b75ae605 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -48,6 +48,22 @@
#include <qpa/qplatformgraphicsbuffer.h>
#include <qpa/qplatformgraphicsbufferhelper.h>
+#ifndef GL_TEXTURE_BASE_LEVEL
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#endif
+#ifndef GL_TEXTURE_MAX_LEVEL
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#endif
+#ifndef GL_UNPACK_ROW_LENGTH
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#endif
+#ifndef GL_RGB10_A2
+#define GL_RGB10_A2 0x8059
+#endif
+#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#endif
+
QT_BEGIN_NAMESPACE
class QPlatformBackingStorePrivate
@@ -82,6 +98,7 @@ public:
mutable GLuint textureId;
mutable QSize textureSize;
mutable bool needsSwizzle;
+ mutable bool premultiplied;
QOpenGLTextureBlitter *blitter;
#endif
};
@@ -107,7 +124,7 @@ public:
{
}
- QList<QBackingstoreTextureInfo> textures;
+ QVector<QBackingstoreTextureInfo> textures;
bool locked;
};
@@ -221,14 +238,16 @@ static inline QRect deviceRect(const QRect &rect, QWindow *window)
return deviceRect;
}
-static QRegion deviceRegion(const QRegion &region, QWindow *window)
+static QRegion deviceRegion(const QRegion &region, QWindow *window, const QPoint &offset)
{
- if (!(window->devicePixelRatio() > 1))
+ if (offset.isNull() && window->devicePixelRatio() <= 1)
return region;
QVector<QRect> rects;
- foreach (QRect rect, region.rects())
- rects.append(deviceRect(rect, window));
+ const QVector<QRect> regionRects = region.rects();
+ rects.reserve(regionRects.count());
+ foreach (const QRect &rect, regionRects)
+ rects.append(deviceRect(rect.translated(offset), window));
QRegion deviceRegion;
deviceRegion.setRects(rects.constData(), rects.count());
@@ -241,10 +260,12 @@ static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight)
topLeftRect.width(), topLeftRect.height());
}
-static void blit(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect,
- QOpenGLTextureBlitter *blitter)
+static void blitTextureForWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect,
+ QOpenGLTextureBlitter *blitter, const QPoint &offset)
{
- const QRect rectInWindow = textures->geometry(idx);
+ QRect rectInWindow = textures->geometry(idx);
+ // relative to the TLW, not necessarily our window (if the flush is for a native child widget), have to adjust
+ rectInWindow.translate(-offset);
QRect clipRect = textures->clipRect(idx);
if (clipRect.isEmpty())
clipRect = QRect(QPoint(0, 0), rectInWindow.size());
@@ -269,7 +290,9 @@ static void blit(const QPlatformTextureList *textures, int idx, QWindow *window,
and composes using OpenGL. May be reimplemented in subclasses if there
is a more efficient native way to do it.
- Note that the \a offset parameter is currently unused.
+ \note \a region is relative to the window which may not be top-level in case
+ \a window corresponds to a native child widget. \a offset is the position of
+ the native child relative to the top-level window.
*/
void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &region,
@@ -277,13 +300,16 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
QPlatformTextureList *textures, QOpenGLContext *context,
bool translucentBackground)
{
- Q_UNUSED(offset);
+ if (!qt_window_private(window)->receivedExpose)
+ return;
if (!context->makeCurrent(window)) {
qWarning("composeAndFlush: makeCurrent() failed");
return;
}
+ QWindowPrivate::get(window)->lastComposeTime.start();
+
QOpenGLFunctions *funcs = context->functions();
funcs->glViewport(0, 0, window->width() * window->devicePixelRatio(), window->height() * window->devicePixelRatio());
funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1);
@@ -301,16 +327,9 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
// Textures for renderToTexture widgets.
for (int i = 0; i < textures->count(); ++i) {
if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))
- blit(textures, i, window, deviceWindowRect, d_ptr->blitter);
+ blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
}
- funcs->glEnable(GL_BLEND);
- funcs->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- // Do not write out alpha. We need blending, but only for RGB. The toplevel may have
- // alpha enabled in which case blending (writing out < 1.0 alpha values) would lead to
- // semi-transparency even when it is not wanted.
- funcs->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
-
// Backingstore texture with the normal widgets.
GLuint textureId = 0;
QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft;
@@ -320,18 +339,17 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
funcs->glDeleteTextures(1, &d_ptr->textureId);
funcs->glGenTextures(1, &d_ptr->textureId);
funcs->glBindTexture(GL_TEXTURE_2D, d_ptr->textureId);
-#ifndef QT_OPENGL_ES_2
- if (!QOpenGLContext::currentContext()->isOpenGLES()) {
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
}
-#endif
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- if (QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle)) {
+ if (QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle, &d_ptr->premultiplied)) {
d_ptr->textureSize = graphicsBuffer->size();
} else {
d_ptr->textureSize = QSize(0,0);
@@ -340,7 +358,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
graphicsBuffer->unlock();
} else if (!region.isEmpty()){
funcs->glBindTexture(GL_TEXTURE_2D, d_ptr->textureId);
- QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle);
+ QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle, &d_ptr->premultiplied);
}
if (graphicsBuffer->origin() == QPlatformGraphicsBuffer::OriginBottomLeft)
@@ -348,17 +366,29 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
textureId = d_ptr->textureId;
} else {
TextureFlags flags = 0;
- textureId = toTexture(deviceRegion(region, window), &d_ptr->textureSize, &flags);
+ textureId = toTexture(deviceRegion(region, window, offset), &d_ptr->textureSize, &flags);
d_ptr->needsSwizzle = (flags & TextureSwizzle) != 0;
+ d_ptr->premultiplied = (flags & TexturePremultiplied) != 0;
if (flags & TextureFlip)
origin = QOpenGLTextureBlitter::OriginBottomLeft;
}
+ funcs->glEnable(GL_BLEND);
+ if (d_ptr->premultiplied)
+ funcs->glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
+ else
+ funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
+
if (textureId) {
- QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(QRect(QPoint(), d_ptr->textureSize), deviceWindowRect);
if (d_ptr->needsSwizzle)
d_ptr->blitter->setSwizzleRB(true);
- d_ptr->blitter->blit(textureId, target, origin);
+ // The backingstore is for the entire tlw.
+ // In case of native children offset tells the position relative to the tlw.
+ const QRect srcRect = toBottomLeftRect(deviceWindowRect.translated(offset), d_ptr->textureSize.height());
+ const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(deviceRect(srcRect, window),
+ d_ptr->textureSize,
+ origin);
+ d_ptr->blitter->blit(textureId, QMatrix4x4(), source);
if (d_ptr->needsSwizzle)
d_ptr->blitter->setSwizzleRB(false);
}
@@ -366,10 +396,9 @@ 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))
- blit(textures, i, window, deviceWindowRect, d_ptr->blitter);
+ blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
}
- funcs->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
funcs->glDisable(GL_BLEND);
d_ptr->blitter->release();
@@ -414,6 +443,8 @@ QImage QPlatformBackingStore::toImage() const
If the image has to be flipped (e.g. because the texture is attached to an FBO), \a
flags will be set to include \c TextureFlip.
+
+ \note \a dirtyRegion is relative to the backingstore so no adjustment is needed.
*/
GLuint QPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const
{
@@ -423,10 +454,50 @@ GLuint QPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textu
QImage image = toImage();
QSize imageSize = image.size();
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ GLenum internalFormat = GL_RGBA;
+ GLuint pixelType = GL_UNSIGNED_BYTE;
+
+ bool needsConversion = false;
*flags = 0;
- if (image.format() == QImage::Format_RGB32)
+ switch (image.format()) {
+ case QImage::Format_ARGB32_Premultiplied:
+ *flags |= TexturePremultiplied;
+ // no break
+ case QImage::Format_RGB32:
+ case QImage::Format_ARGB32:
*flags |= TextureSwizzle;
-
+ break;
+ case QImage::Format_RGBA8888_Premultiplied:
+ *flags |= TexturePremultiplied;
+ // no break
+ case QImage::Format_RGBX8888:
+ case QImage::Format_RGBA8888:
+ break;
+ case QImage::Format_BGR30:
+ case QImage::Format_A2BGR30_Premultiplied:
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
+ pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
+ internalFormat = GL_RGB10_A2;
+ *flags |= TexturePremultiplied;
+ } else {
+ needsConversion = true;
+ }
+ break;
+ case QImage::Format_RGB30:
+ case QImage::Format_A2RGB30_Premultiplied:
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
+ pixelType = GL_UNSIGNED_INT_2_10_10_10_REV;
+ internalFormat = GL_RGB10_A2;
+ *flags |= TextureSwizzle | TexturePremultiplied;
+ } else {
+ needsConversion = true;
+ }
+ break;
+ default:
+ needsConversion = true;
+ break;
+ }
if (imageSize.isEmpty()) {
*textureSize = imageSize;
return 0;
@@ -440,44 +511,37 @@ GLuint QPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textu
*textureSize = imageSize;
- // Fast path for RGB32 and RGBA8888, convert everything else to RGBA8888.
- if (image.format() != QImage::Format_RGB32 && image.format() != QImage::Format_RGBA8888)
+ if (needsConversion)
image = image.convertToFormat(QImage::Format_RGBA8888);
- QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
-
+ QOpenGLFunctions *funcs = ctx->functions();
if (resized) {
if (d_ptr->textureId)
funcs->glDeleteTextures(1, &d_ptr->textureId);
funcs->glGenTextures(1, &d_ptr->textureId);
funcs->glBindTexture(GL_TEXTURE_2D, d_ptr->textureId);
-#ifndef QT_OPENGL_ES_2
- if (!QOpenGLContext::currentContext()->isOpenGLES()) {
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
}
-#endif
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imageSize.width(), imageSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, imageSize.width(), imageSize.height(), 0, GL_RGBA, pixelType,
const_cast<uchar*>(image.constBits()));
} else {
funcs->glBindTexture(GL_TEXTURE_2D, d_ptr->textureId);
QRect imageRect = image.rect();
QRect rect = dirtyRegion.boundingRect() & imageRect;
-#ifndef QT_OPENGL_ES_2
- if (!QOpenGLContext::currentContext()->isOpenGLES()) {
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
funcs->glPixelStorei(GL_UNPACK_ROW_LENGTH, image.width());
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
image.constScanLine(rect.y()) + rect.x() * 4);
funcs->glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- } else
-#endif
- {
+ } else {
// if the rect is wide enough it's cheaper to just
// extend it instead of doing an image copy
if (rect.width() >= imageRect.width() / 2) {
@@ -489,10 +553,10 @@ GLuint QPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textu
// OpenGL instead of copying, since there's no gap between scanlines
if (rect.width() == imageRect.width()) {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
image.constScanLine(rect.y()));
} else {
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, pixelType,
image.copy(rect).constBits());
}
}
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index eac97e9cf6..9c8da0d1db 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -118,7 +118,8 @@ public:
virtual QImage toImage() const;
enum TextureFlag {
TextureSwizzle = 0x01,
- TextureFlip = 0x02
+ TextureFlip = 0x02,
+ TexturePremultiplied = 0x04,
};
Q_DECLARE_FLAGS(TextureFlags, TextureFlag)
virtual GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const;
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index 1549ebe2b5..1e503c03b7 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -52,11 +52,19 @@ public:
inline QPolygon() {}
inline ~QPolygon() {}
inline explicit QPolygon(int size);
- inline QPolygon(const QPolygon &a) : QVector<QPoint>(a) {}
inline /*implicit*/ QPolygon(const QVector<QPoint> &v) : QVector<QPoint>(v) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ /*implicit*/ QPolygon(QVector<QPoint> &&v) Q_DECL_NOTHROW : QVector<QPoint>(std::move(v)) {}
+#endif
QPolygon(const QRect &r, bool closed=false);
QPolygon(int nPoints, const int *points);
- inline void swap(QPolygon &other) { QVector<QPoint>::swap(other); } // prevent QVector<QPoint><->QPolygon swaps
+ QPolygon(const QPolygon &other) : QVector<QPoint>(other) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ QPolygon(QPolygon &&other) Q_DECL_NOTHROW : QVector<QPoint>(std::move(other)) {}
+ QPolygon &operator=(QPolygon &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QPolygon &operator=(const QPolygon &other) { QVector<QPoint>::operator=(other); return *this; }
+ void swap(QPolygon &other) Q_DECL_NOTHROW { QVector<QPoint>::swap(other); } // prevent QVector<QPoint><->QPolygon swaps
operator QVariant() const;
@@ -126,10 +134,18 @@ public:
inline QPolygonF() {}
inline ~QPolygonF() {}
inline explicit QPolygonF(int size);
- inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
inline /*implicit*/ QPolygonF(const QVector<QPointF> &v) : QVector<QPointF>(v) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ /* implicit */ QPolygonF(QVector<QPointF> &&v) Q_DECL_NOTHROW : QVector<QPointF>(std::move(v)) {}
+#endif
QPolygonF(const QRectF &r);
/*implicit*/ QPolygonF(const QPolygon &a);
+ inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ QPolygonF(QPolygonF &&other) Q_DECL_NOTHROW : QVector<QPointF>(std::move(other)) {}
+ QPolygonF &operator=(QPolygonF &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QPolygonF &operator=(const QPolygonF &other) { QVector<QPointF>::operator=(other); return *this; }
inline void swap(QPolygonF &other) { QVector<QPointF>::swap(other); } // prevent QVector<QPointF><->QPolygonF swaps
operator QVariant() const;
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index e6b777a30e..5e648eabf5 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -41,7 +41,7 @@
#include "qimage.h"
#include "qbitmap.h"
-#include <qdebug.h>
+#include <private/qdebug_p.h>
QT_BEGIN_NAMESPACE
@@ -422,11 +422,32 @@ QDataStream &operator>>(QDataStream &s, QRegion &r)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug s, const QRegion &r)
{
- QVector<QRect> rects = r.rects();
- s.nospace() << "QRegion(size=" << rects.size() << "), "
- << "bounds = " << r.boundingRect() << '\n';
- for (int i=0; i<rects.size(); ++i)
- s << "- " << i << rects.at(i) << '\n';
+ QDebugStateSaver saver(s);
+ s.nospace();
+ s << "QRegion(";
+ if (r.isNull()) {
+ s << "null";
+ } else if (r.isEmpty()) {
+ s << "empty";
+ } else {
+ const QVector<QRect> rects = r.rects();
+ const int count = rects.size();
+ if (count > 1)
+ s << "size=" << count << ", bounds=(";
+ QtDebugUtils::formatQRect(s, r.boundingRect());
+ if (count > 1) {
+ s << ") - [";
+ for (int i = 0; i < count; ++i) {
+ if (i)
+ s << ", ";
+ s << '(';
+ QtDebugUtils::formatQRect(s, rects.at(i));
+ s << ')';
+ }
+ s << ']';
+ }
+ }
+ s << ')';
return s;
}
#endif
diff --git a/src/gui/painting/qrgb.h b/src/gui/painting/qrgb.h
index f7f2185bef..ca9fc03d14 100644
--- a/src/gui/painting/qrgb.h
+++ b/src/gui/painting/qrgb.h
@@ -58,10 +58,10 @@ inline Q_DECL_CONSTEXPR int qAlpha(QRgb rgb) // get alpha part of
{ return rgb >> 24; }
inline Q_DECL_CONSTEXPR QRgb qRgb(int r, int g, int b)// set RGB value
-{ return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
+{ return (0xffu << 24) | ((r & 0xffu) << 16) | ((g & 0xffu) << 8) | (b & 0xffu); }
inline Q_DECL_CONSTEXPR QRgb qRgba(int r, int g, int b, int a)// set RGBA value
-{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
+{ return ((a & 0xffu) << 24) | ((r & 0xffu) << 16) | ((g & 0xffu) << 8) | (b & 0xffu); }
inline Q_DECL_CONSTEXPR int qGray(int r, int g, int b)// convert R,G,B to gray 0..255
{ return (r*11+g*16+b*5)/32; }
diff --git a/src/gui/painting/qrgba64.h b/src/gui/painting/qrgba64.h
new file mode 100644
index 0000000000..fab9506ff2
--- /dev/null
+++ b/src/gui/painting/qrgba64.h
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 QRGBA64_H
+#define QRGBA64_H
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qprocessordetection.h>
+
+QT_BEGIN_NAMESPACE
+
+class QRgba64 {
+ quint64 rgba;
+
+ // Make sure that the representation always has the order: red green blue alpha, independent
+ // of byte order. This way, vector operations that assume 4 16-bit values see the correct ones.
+ enum {
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ RedShift = 48,
+ GreenShift = 32,
+ BlueShift = 16,
+ AlphaShift = 0
+#else // little endian:
+ RedShift = 0,
+ GreenShift = 16,
+ BlueShift = 32,
+ AlphaShift = 48
+#endif
+ };
+
+ // No constructors are allowed in C++98, since this needs to be usable in a union.
+ // We however require one for constexprs in C++11/C++14
+#ifdef Q_COMPILER_CONSTEXPR
+ explicit Q_ALWAYS_INLINE Q_DECL_CONSTEXPR QRgba64(quint64 c) : rgba(c) { }
+#endif
+public:
+#ifdef Q_COMPILER_CONSTEXPR
+ Q_ALWAYS_INLINE Q_DECL_CONSTEXPR QRgba64() : rgba(0) { }
+#endif
+
+ Q_DECL_CONSTEXPR static
+ QRgba64 fromRgba64(quint64 c)
+ {
+#ifdef Q_COMPILER_CONSTEXPR
+ return QRgba64(c);
+#else
+ QRgba64 rgba64;
+ rgba64.rgba = c;
+ return rgba64;
+#endif
+ }
+ Q_DECL_CONSTEXPR static
+ QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
+ {
+ return fromRgba64(quint64(red) << RedShift
+ | quint64(green) << GreenShift
+ | quint64(blue) << BlueShift
+ | quint64(alpha) << AlphaShift);
+ }
+ Q_DECL_RELAXED_CONSTEXPR static QRgba64 fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
+ {
+ QRgba64 rgb64 = fromRgba64(red, green, blue, alpha);
+ // Expand the range so that 0x00 maps to 0x0000 and 0xff maps to 0xffff.
+ rgb64.rgba |= rgb64.rgba << 8;
+ return rgb64;
+ }
+ Q_DECL_RELAXED_CONSTEXPR static
+ QRgba64 fromArgb32(uint rgb)
+ {
+ return fromRgba(rgb >> 16, rgb >> 8, rgb, rgb >> 24);
+ }
+
+ Q_DECL_CONSTEXPR bool isOpaque() const
+ {
+ return (rgba & alphaMask()) == alphaMask();
+ }
+ Q_DECL_CONSTEXPR bool isTransparent() const
+ {
+ return (rgba & alphaMask()) == 0;
+ }
+
+ Q_DECL_CONSTEXPR quint16 red() const { return rgba >> RedShift; }
+ Q_DECL_CONSTEXPR quint16 green() const { return rgba >> GreenShift; }
+ Q_DECL_CONSTEXPR quint16 blue() const { return rgba >> BlueShift; }
+ Q_DECL_CONSTEXPR quint16 alpha() const { return rgba >> AlphaShift; }
+ void setRed(quint16 _red) { rgba = (rgba & ~(Q_UINT64_C(0xffff) << RedShift)) | (quint64(_red) << RedShift); }
+ void setGreen(quint16 _green) { rgba = (rgba & ~(Q_UINT64_C(0xffff) << GreenShift)) | (quint64(_green) << GreenShift); }
+ void setBlue(quint16 _blue) { rgba = (rgba & ~(Q_UINT64_C(0xffff) << BlueShift)) | (quint64(_blue) << BlueShift); }
+ void setAlpha(quint16 _alpha) { rgba = (rgba & ~(Q_UINT64_C(0xffff) << AlphaShift)) | (quint64(_alpha) << AlphaShift); }
+
+ Q_DECL_CONSTEXPR quint8 red8() const { return div_257(red()); }
+ Q_DECL_CONSTEXPR quint8 green8() const { return div_257(green()); }
+ Q_DECL_CONSTEXPR quint8 blue8() const { return div_257(blue()); }
+ Q_DECL_CONSTEXPR quint8 alpha8() const { return div_257(alpha()); }
+ Q_DECL_CONSTEXPR uint toArgb32() const
+ {
+ return (alpha8() << 24) | (red8() << 16) | (green8() << 8) | blue8();
+ }
+ Q_DECL_CONSTEXPR ushort toRgb16() const
+ {
+ return (red() & 0xf800) | ((green() >> 10) << 5) | (blue() >> 11);
+ }
+
+ Q_DECL_RELAXED_CONSTEXPR QRgba64 premultiplied() const
+ {
+ const quint32 a = alpha();
+ const quint16 r = div_65535(red() * a);
+ const quint16 g = div_65535(green() * a);
+ const quint16 b = div_65535(blue() * a);
+ return fromRgba64(r, g, b, a);
+ }
+
+ Q_DECL_RELAXED_CONSTEXPR QRgba64 unpremultiplied() const
+ {
+#if Q_PROCESSOR_WORDSIZE < 8
+ return unpremultiplied_32bit();
+#else
+ return unpremultiplied_64bit();
+#endif
+ }
+
+ Q_DECL_CONSTEXPR operator quint64() const
+ {
+ return rgba;
+ }
+
+ QRgba64 operator=(quint64 _rgba)
+ {
+ rgba = _rgba;
+ return *this;
+ }
+
+private:
+ static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE quint64 alphaMask() { return Q_UINT64_C(0xffff) << AlphaShift; }
+
+ static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint div_257_floor(uint x) { return (x - (x >> 8)) >> 8; }
+ static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint div_257(uint x) { return div_257_floor(x + 128); }
+ static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint div_65535(uint x) { return (x + (x>>16) + 0x8000U) >> 16; }
+ Q_DECL_RELAXED_CONSTEXPR Q_ALWAYS_INLINE QRgba64 unpremultiplied_32bit() const
+ {
+ if (isOpaque() || isTransparent())
+ return *this;
+ const quint32 a = alpha();
+ const quint16 r = (quint32(red()) * 0xffff + a/2) / a;
+ const quint16 g = (quint32(green()) * 0xffff + a/2) / a;
+ const quint16 b = (quint32(blue()) * 0xffff + a/2) / a;
+ return fromRgba64(r, g, b, a);
+ }
+ Q_DECL_RELAXED_CONSTEXPR Q_ALWAYS_INLINE QRgba64 unpremultiplied_64bit() const
+ {
+ if (isOpaque() || isTransparent())
+ return *this;
+ const quint64 a = alpha();
+ const quint64 fa = (Q_UINT64_C(0xffff00008000) + a/2) / a;
+ const quint16 r = (red() * fa + 0x80000000) >> 32;
+ const quint16 g = (green() * fa + 0x80000000) >> 32;
+ const quint16 b = (blue() * fa + 0x80000000) >> 32;
+ return fromRgba64(r, g, b, a);
+ }
+};
+
+Q_DECLARE_TYPEINFO(QRgba64, Q_PRIMITIVE_TYPE);
+
+Q_DECL_CONSTEXPR inline QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
+{
+ return QRgba64::fromRgba64(r, g, b, a);
+}
+
+Q_DECL_CONSTEXPR inline QRgba64 qRgba64(quint64 c)
+{
+ return QRgba64::fromRgba64(c);
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline QRgba64 qPremultiply(QRgba64 c)
+{
+ return c.premultiplied();
+}
+
+Q_DECL_RELAXED_CONSTEXPR inline QRgba64 qUnpremultiply(QRgba64 c)
+{
+ return c.unpremultiplied();
+}
+
+inline Q_DECL_CONSTEXPR uint qRed(QRgba64 rgb)
+{ return rgb.red8(); }
+
+inline Q_DECL_CONSTEXPR uint qGreen(QRgba64 rgb)
+{ return rgb.green8(); }
+
+inline Q_DECL_CONSTEXPR uint qBlue(QRgba64 rgb)
+{ return rgb.blue8(); }
+
+inline Q_DECL_CONSTEXPR uint qAlpha(QRgba64 rgb)
+{ return rgb.alpha8(); }
+
+QT_END_NAMESPACE
+
+#endif // QRGBA64_H
diff --git a/src/gui/painting/qrgba64.qdoc b/src/gui/painting/qrgba64.qdoc
new file mode 100644
index 0000000000..b786e91b03
--- /dev/null
+++ b/src/gui/painting/qrgba64.qdoc
@@ -0,0 +1,303 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class QRgba64
+ \brief The QRgba64 struct contains a 64-bit RGB color.
+ \since 5.6
+
+ \ingroup painting
+ \inmodule QtGui
+
+ QRgba64 is a 64-bit data-structure containing four 16-bit color channels: Red, green, blue and alpha.
+
+ QRgba64 can be used a replacement for QRgb when higher precision is needed. In particular a
+ premultiplied QRgba64 can operate on unpremultiplied QRgb without loss of precision except
+ for alpha 0.
+
+ \sa QRgb, QColor
+*/
+
+/*!
+ \fn QRgba64 QRgba64::operator=(quint64 rgba)
+
+ Assigns the value \a rgba to this instance of QRgba64 and returns it.
+*/
+
+/*!
+ \fn static QRgba64 QRgba64::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
+
+ Returns the QRgba64 quadruplet (\a{r}, \a{g}, \a{b}, \a{a}).
+
+ \sa fromRgba()
+*/
+
+/*!
+ \fn static QRgba64 QRgba64::fromRgba64(quint64 c)
+
+ Returns \a c as a QRgba64 struct.
+
+ \sa fromArgb32()
+*/
+
+/*!
+ \fn static QRgba64 QRgba64::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
+
+ Constructs a QRgba64 value from the four 8-bit color channels \a red, \a green, \a blue and \a alpha.
+
+ \sa fromArgb32()
+*/
+
+/*!
+ \fn static QRgba64 QRgba64::fromArgb32(uint rgb)
+
+ Constructs a QRgba64 value from the 32bit ARGB value \a rgb.
+
+ \sa fromRgba()
+*/
+
+/*!
+ \fn bool QRgba64::isOpaque() const
+
+ Returns whether the color is fully opaque.
+
+ \sa isTransparent(), alpha()
+*/
+
+/*!
+ \fn bool QRgba64::isTransparent() const
+
+ Returns whether the color is transparent.
+
+ \sa isOpaque(), alpha()
+*/
+
+/*!
+ \fn quint16 QRgba64::red() const
+
+ Returns the 16-bit red color component.
+
+ \sa setRed()
+*/
+
+/*!
+ \fn QRgba64::setRed(quint16 red)
+
+ Sets the red color component of this color to \a red.
+
+ \sa red()
+*/
+
+/*!
+ \fn quint16 QRgba64::green() const
+
+ Returns the 16-bit green color component.
+
+ \sa setGreen()
+*/
+
+/*!
+ \fn QRgba64::setGreen(quint16 green)
+
+ Sets the green color component of this color to \a green.
+
+ \sa green()
+*/
+
+/*!
+ \fn quint16 QRgba64::blue() const
+
+ Returns the 16-bit blue color component.
+
+ \sa setBlue()
+*/
+
+/*!
+ \fn QRgba64::setBlue(quint16 blue)
+
+ Sets the blue color component of this color to \a blue.
+
+ \sa blue()
+*/
+
+/*!
+ \fn quint16 QRgba64::alpha() const
+
+ Returns the 16-bit alpha channel.
+
+ \sa setAlpha()
+*/
+
+/*!
+ \fn QRgba64::setAlpha(quint16 alpha)
+
+ Sets the alpha of this color to \a alpha.
+
+ \sa alpha()
+*/
+
+/*!
+ \fn quint8 QRgba64::red8() const
+
+ Returns the red color component as an 8-bit.
+*/
+
+/*!
+ \fn quint8 QRgba64::green8() const
+
+ Returns the green color component as an 8-bit.
+*/
+
+/*!
+ \fn quint8 QRgba64::blue8() const
+
+ Returns the blue color component as an 8-bit.
+*/
+
+/*!
+ \fn quint8 QRgba64::alpha8() const
+
+ Returns the alpha channel as an 8-bit.
+*/
+
+/*!
+ \fn uint QRgba64::toArgb32() const
+
+ Returns the color as a 32-bit ARGB value.
+
+ \sa fromArgb32()
+*/
+
+/*!
+ \fn ushort QRgba64::toRgb16() const
+
+ Returns the color as a 16-bit RGB value.
+
+ \sa toArgb32()
+*/
+
+/*!
+ \fn QRgba64 QRgba64::premultiplied() const
+
+ Returns the color with the alpha premultiplied.
+
+ \sa unpremultiplied()
+*/
+
+/*!
+ \fn QRgba64 QRgba64::unpremultiplied() const
+
+ Returns the color with the alpha unpremultiplied.
+
+ \sa premultiplied()
+*/
+
+/*!
+ \fn QRgba64::operator quint64() const
+
+ Returns the color as a 64bit unsigned integer
+*/
+
+/*!
+ \fn QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
+ \relates QColor
+ \since 5.6
+
+ Returns the QRgba64 quadruplet (\a{r}, \a{g}, \a{b}, \a{a}).
+
+ \sa qRgba()
+*/
+
+/*!
+ \fn QRgba64 qRgba64(quint64 c)
+ \relates QColor
+ \since 5.6
+
+ Returns \a c as a QRgba64 struct.
+
+ \sa qRgba()
+*/
+
+/*!
+ \fn QRgba64 qPremultiply(QRgba64 rgba64)
+ \since 5.6
+ \relates QColor
+
+ Converts an unpremultiplied QRgba64 quadruplet \a rgba64 into a premultiplied QRgba64 quadruplet.
+
+ \sa QRgba64::premultiplied(), qUnpremultiply()
+*/
+
+/*!
+ \fn QRgba64 qUnpremultiply(QRgba64 rgba64)
+ \since 5.6
+ \relates QColor
+
+ Converts a premultiplied QRgba64 quadruplet \a rgba64 into an unpremultiplied QRgba64 quadruplet.
+
+ \sa QRgba64::unpremultiplied(), qPremultiply()
+*/
+
+/*!
+ \fn uint qRed(QRgba64 rgba64)
+ \since 5.6
+ \relates QColor
+
+ Returns the red component of \a rgba64 as an 8-bit value.
+
+ \sa QRgba64::red8(), QColor::red()
+*/
+
+/*!
+ \fn uint qGreen(QRgba64 rgba64)
+ \since 5.6
+ \relates QColor
+
+ Returns the green component of \a rgba64 as an 8-bit value.
+
+ \sa QRgba64::green8(), QColor::green()
+*/
+
+/*!
+ \fn uint qBlue(QRgba64 rgba64)
+ \since 5.6
+ \relates QColor
+
+ Returns the blue component of \a rgba64 as an 8-bit value.
+
+ \sa QRgba64::blue8(), QColor::blue()
+*/
+
+/*!
+ \fn uint qAlpha(QRgba64 rgba64)
+ \since 5.6
+ \relates QColor
+
+ Returns the alpha component of \a rgba64 as an 8-bit value.
+
+ \sa QRgba64::alpha8(), QColor::alpha()
+*/
diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h
new file mode 100644
index 0000000000..724658ad94
--- /dev/null
+++ b/src/gui/painting/qrgba64_p.h
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 QRGBA64_P_H
+#define QRGBA64_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/qrgba64.h>
+#include <QtGui/private/qdrawhelper_p.h>
+#include <private/qsimd_p.h>
+
+QT_BEGIN_NAMESPACE
+
+inline QRgba64 combineAlpha256(QRgba64 rgba64, uint alpha256)
+{
+ return QRgba64::fromRgba64(rgba64.red(), rgba64.green(), rgba64.blue(), (rgba64.alpha() * alpha256) >> 8);
+}
+
+inline QRgba64 multiplyAlpha256(QRgba64 rgba64, uint alpha256)
+{
+ return QRgba64::fromRgba64((rgba64.red() * alpha256) >> 8,
+ (rgba64.green() * alpha256) >> 8,
+ (rgba64.blue() * alpha256) >> 8,
+ (rgba64.alpha() * alpha256) >> 8);
+}
+
+inline QRgba64 multiplyAlpha65535(QRgba64 rgba64, uint alpha65535)
+{
+#ifdef __SSE2__
+ const __m128i va = _mm_shufflelo_epi16(_mm_cvtsi32_si128(alpha65535), _MM_SHUFFLE(0, 0, 0, 0));
+ __m128i vs = _mm_loadl_epi64((__m128i*)&rgba64);
+ vs = _mm_unpacklo_epi16(_mm_mullo_epi16(vs, va), _mm_mulhi_epu16(vs, va));
+ vs = _mm_add_epi32(vs, _mm_srli_epi32(vs, 16));
+ vs = _mm_add_epi32(vs, _mm_set1_epi32(0x8000));
+ vs = _mm_srai_epi32(vs, 16);
+ vs = _mm_packs_epi32(vs, _mm_setzero_si128());
+ _mm_storel_epi64((__m128i*)&rgba64, vs);
+ return rgba64;
+#else
+ return QRgba64::fromRgba64(qt_div_65535(rgba64.red() * alpha65535),
+ qt_div_65535(rgba64.green() * alpha65535),
+ qt_div_65535(rgba64.blue() * alpha65535),
+ qt_div_65535(rgba64.alpha() * alpha65535));
+#endif
+}
+
+inline QRgba64 multiplyAlpha255(QRgba64 rgba64, uint alpha255)
+{
+#ifdef __SSE2__
+ return multiplyAlpha65535(rgba64, alpha255 * 257);
+#else
+ return QRgba64::fromRgba64(qt_div_255(rgba64.red() * alpha255),
+ qt_div_255(rgba64.green() * alpha255),
+ qt_div_255(rgba64.blue() * alpha255),
+ qt_div_255(rgba64.alpha() * alpha255));
+#endif
+}
+
+inline QRgba64 interpolate256(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2)
+{
+ return QRgba64::fromRgba64(multiplyAlpha256(x, alpha1) + multiplyAlpha256(y, alpha2));
+}
+
+inline QRgba64 interpolate255(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2)
+{
+ return QRgba64::fromRgba64(multiplyAlpha255(x, alpha1) + multiplyAlpha255(y, alpha2));
+}
+
+inline QRgba64 interpolate65535(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2)
+{
+ return QRgba64::fromRgba64(multiplyAlpha65535(x, alpha1) + multiplyAlpha65535(y, alpha2));
+}
+
+inline QRgba64 addWithSaturation(QRgba64 a, QRgba64 b)
+{
+#if defined(__SSE2__) && defined(Q_PROCESSOR_X86_64)
+ __m128i va = _mm_cvtsi64_si128((quint64)a);
+ __m128i vb = _mm_cvtsi64_si128((quint64)b);
+ va = _mm_adds_epu16(va, vb);
+ return QRgba64::fromRgba64(_mm_cvtsi128_si64(va));
+#else
+ return QRgba64::fromRgba64(qMin(a.red() + b.red(), 65535),
+ qMin(a.green() + b.green(), 65535),
+ qMin(a.blue() + b.blue(), 65535),
+ qMin(a.alpha() + b.alpha(), 65535));
+#endif
+}
+
+QT_END_NAMESPACE
+
+#endif // QRGBA64_P_H
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 4c879cf05d..97f82d16d3 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -42,16 +42,24 @@ QT_BEGIN_NAMESPACE
// #define CACHE_DEBUG
+// out-of-line to avoid vtable duplication, breaking e.g. RTTI
+QTextureGlyphCache::~QTextureGlyphCache()
+{
+}
+
int QTextureGlyphCache::calculateSubPixelPositionCount(glyph_t glyph) const
{
// Test 12 different subpixel positions since it factors into 3*4 so it gives
// the coverage we need.
- QList<QImage> images;
- for (int i=0; i<12; ++i) {
+ const int NumSubpixelPositions = 12;
+
+ QImage images[NumSubpixelPositions];
+ int numImages = 0;
+ for (int i = 0; i < NumSubpixelPositions; ++i) {
QImage img = textureMapForGlyph(glyph, QFixed::fromReal(i / 12.0));
- if (images.isEmpty()) {
+ if (numImages == 0) {
QPainterPath path;
QFixedPoint point;
m_current_fontengine->addGlyphsToPath(&glyph, &point, 1, &path, QTextItem::RenderFlags());
@@ -60,21 +68,21 @@ int QTextureGlyphCache::calculateSubPixelPositionCount(glyph_t glyph) const
if (path.isEmpty())
break;
- images.append(img);
+ images[numImages++] = qMove(img);
} else {
bool found = false;
- for (int j=0; j<images.size(); ++j) {
- if (images.at(j) == img) {
+ for (int j = 0; j < numImages; ++j) {
+ if (images[j] == img) {
found = true;
break;
}
}
if (!found)
- images.append(img);
+ images[numImages++] = qMove(img);
}
}
- return images.size();
+ return numImages;
}
bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
@@ -262,6 +270,11 @@ QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition
* QImageTextureGlyphCache
*/
+// out-of-line to avoid vtable duplication, breaking e.g. RTTI
+QImageTextureGlyphCache::~QImageTextureGlyphCache()
+{
+}
+
void QImageTextureGlyphCache::resizeTextureData(int width, int height)
{
m_image = m_image.copy(0, 0, width, height);
@@ -273,9 +286,9 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
case QFontEngine::Format_Mono:
m_image = QImage(width, height, QImage::Format_Mono);
break;
- case QFontEngine::Format_A8: {
+ case QFontEngine::Format_A8:
m_image = QImage(width, height, QImage::Format_Alpha8);
- break; }
+ break;
case QFontEngine::Format_A32:
m_image = QImage(width, height, QImage::Format_RGB32);
break;
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index c9e7060b0d..7dd8277a45 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -72,7 +72,7 @@ public:
m_w(0), m_h(0), m_cx(0), m_cy(0), m_currentRowHeight(0)
{ }
- virtual ~QTextureGlyphCache() { }
+ ~QTextureGlyphCache();
struct GlyphAndSubPixelPosition
{
@@ -158,6 +158,8 @@ class Q_GUI_EXPORT QImageTextureGlyphCache : public QTextureGlyphCache
public:
QImageTextureGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix)
: QTextureGlyphCache(format, matrix) { }
+ ~QImageTextureGlyphCache();
+
virtual void createTextureData(int width, int height) Q_DECL_OVERRIDE;
virtual void resizeTextureData(int width, int height) Q_DECL_OVERRIDE;
virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index a3e9db2057..a23aabe559 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -34,6 +34,7 @@
#include "qdatastream.h"
#include "qdebug.h"
+#include "qhashfunctions.h"
#include "qmatrix.h"
#include "qregion.h"
#include "qpainterpath.h"
@@ -776,6 +777,29 @@ bool QTransform::operator==(const QTransform &o) const
}
/*!
+ \since 5.6
+ \relates QTransform
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QTransform &key, uint seed) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(key.m11(), seed);
+ seed = hash(key.m12(), seed);
+ seed = hash(key.m21(), seed);
+ seed = hash(key.m22(), seed);
+ seed = hash(key.dx(), seed);
+ seed = hash(key.dy(), seed);
+ seed = hash(key.m13(), seed);
+ seed = hash(key.m23(), seed);
+ seed = hash(key.m33(), seed);
+ return seed;
+}
+
+
+/*!
\fn bool QTransform::operator!=(const QTransform &matrix) const
Returns \c true if this matrix is not equal to the given \a matrix,
otherwise returns \c false.
@@ -1357,7 +1381,9 @@ static QPolygonF mapProjective(const QTransform &transform, const QPolygonF &pol
path = transform.map(path);
QPolygonF result;
- for (int i = 0; i < path.elementCount(); ++i)
+ const int elementCount = path.elementCount();
+ result.reserve(elementCount);
+ for (int i = 0; i < elementCount; ++i)
result << path.elementAt(i);
return result;
}
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index cf8d4d1970..8874996e19 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -96,7 +96,7 @@ public:
qreal m21, qreal m22, qreal m23,
qreal m31, qreal m32, qreal m33);
- QTransform inverted(bool *invertible = 0) const Q_REQUIRED_RESULT;
+ QTransform inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT;
QTransform adjoint() const Q_REQUIRED_RESULT;
QTransform transposed() const Q_REQUIRED_RESULT;
@@ -180,6 +180,8 @@ private:
};
Q_DECLARE_TYPEINFO(QTransform, Q_MOVABLE_TYPE);
+Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QTransform &key, uint seed = 0) Q_DECL_NOTHROW;
+
/******* inlines *****/
inline QTransform::TransformationType QTransform::inline_type() const
{
diff --git a/src/gui/text/qabstracttextdocumentlayout.cpp b/src/gui/text/qabstracttextdocumentlayout.cpp
index 70be92535d..7735fd6b46 100644
--- a/src/gui/text/qabstracttextdocumentlayout.cpp
+++ b/src/gui/text/qabstracttextdocumentlayout.cpp
@@ -40,6 +40,15 @@
QT_BEGIN_NAMESPACE
+QAbstractTextDocumentLayoutPrivate::~QAbstractTextDocumentLayoutPrivate()
+{
+}
+
+QTextObjectInterface::~QTextObjectInterface()
+{
+ // must be empty until ### Qt 6
+}
+
/*!
\class QAbstractTextDocumentLayout
\reentrant
diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h
index 27135b0476..cdcfed7535 100644
--- a/src/gui/text/qabstracttextdocumentlayout.h
+++ b/src/gui/text/qabstracttextdocumentlayout.h
@@ -90,7 +90,7 @@ public:
QTextDocument *document() const;
void registerHandler(int objectType, QObject *component);
- void unregisterHandler(int objectType, QObject *component = 0);
+ void unregisterHandler(int objectType, QObject *component = Q_NULLPTR);
QTextObjectInterface *handlerForObject(int objectType) const;
Q_SIGNALS:
@@ -126,7 +126,7 @@ private:
class Q_GUI_EXPORT QTextObjectInterface
{
public:
- virtual ~QTextObjectInterface() {}
+ virtual ~QTextObjectInterface();
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
};
diff --git a/src/gui/text/qabstracttextdocumentlayout_p.h b/src/gui/text/qabstracttextdocumentlayout_p.h
index 505135fa4b..a7f28ebf96 100644
--- a/src/gui/text/qabstracttextdocumentlayout_p.h
+++ b/src/gui/text/qabstracttextdocumentlayout_p.h
@@ -58,13 +58,14 @@ struct QTextObjectHandler
};
typedef QHash<int, QTextObjectHandler> HandlerHash;
-class QAbstractTextDocumentLayoutPrivate : public QObjectPrivate
+class Q_GUI_EXPORT QAbstractTextDocumentLayoutPrivate : public QObjectPrivate
{
public:
Q_DECLARE_PUBLIC(QAbstractTextDocumentLayout)
inline QAbstractTextDocumentLayoutPrivate()
: paintDevice(0) {}
+ ~QAbstractTextDocumentLayoutPrivate();
inline void setDocument(QTextDocument *doc) {
document = doc;
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 3c98cb568d..adbb3df3bf 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -461,6 +461,7 @@ void ValueExtractor::lengthValues(const Declaration &decl, int *m)
}
QList<QVariant> v;
+ v.reserve(4);
for (i = 0; i < 4; i++) {
v += QVariant::fromValue<LengthData>(datas[i]);
m[i] = lengthValueFromData(datas[i], f);
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 16550c0b3c..bc9da5b564 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1860,14 +1860,9 @@ void QFont::removeSubstitutions(const QString &familyName)
*/
QStringList QFont::substitutions()
{
- typedef QFontSubst::const_iterator QFontSubstConstIterator;
-
QFontSubst *fontSubst = globalFontSubst();
Q_ASSERT(fontSubst != 0);
- QStringList ret;
- const QFontSubstConstIterator cend = fontSubst->constEnd();
- for (QFontSubstConstIterator it = fontSubst->constBegin(); it != cend; ++it)
- ret.append(it.key());
+ QStringList ret = fontSubst->keys();
ret.sort();
return ret;
@@ -2115,6 +2110,9 @@ QString QFont::lastResortFamily() const
return QString::fromLatin1("helvetica");
}
+extern QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style,
+ QFont::StyleHint styleHint, QChar::Script script);
+
/*!
\fn QString QFont::defaultFamily() const
@@ -2125,8 +2123,7 @@ QString QFont::lastResortFamily() const
*/
QString QFont::defaultFamily() const
{
- QPlatformFontDatabase *fontDB = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
- const QStringList fallbacks = fontDB->fallbacksForFamily(QString(), QFont::StyleNormal
+ const QStringList fallbacks = qt_fallbacksForFamily(QString(), QFont::StyleNormal
, QFont::StyleHint(d->request.styleHint), QChar::Script_Common);
if (!fallbacks.isEmpty())
return fallbacks.first();
@@ -2223,6 +2220,8 @@ QDataStream &operator<<(QDataStream &s, const QFont &font)
}
if (s.version() >= QDataStream::Qt_5_4)
s << (quint8)font.d->request.hintingPreference;
+ if (s.version() >= QDataStream::Qt_5_6)
+ s << (quint8)font.d->capital;
return s;
}
@@ -2313,7 +2312,11 @@ QDataStream &operator>>(QDataStream &s, QFont &font)
s >> value;
font.d->request.hintingPreference = QFont::HintingPreference(value);
}
-
+ if (s.version() >= QDataStream::Qt_5_6) {
+ quint8 value;
+ s >> value;
+ font.d->capital = QFont::Capitalization(value);
+ }
return s;
}
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 85a804acfe..aae84dc988 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -47,6 +47,7 @@
#include <qpa/qplatformfontdatabase.h>
#include <qpa/qplatformtheme.h>
+#include <QtCore/qcache.h>
#include <QtCore/qmath.h>
#include <stdlib.h>
@@ -413,11 +414,45 @@ void QtFontFamily::ensurePopulated()
Q_ASSERT_X(populated, Q_FUNC_INFO, qPrintable(name));
}
+
+struct FallbacksCacheKey {
+ QString family;
+ QFont::Style style;
+ QFont::StyleHint styleHint;
+ QChar::Script script;
+};
+
+inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) Q_DECL_NOTHROW
+{
+ return lhs.script == rhs.script &&
+ lhs.styleHint == rhs.styleHint &&
+ lhs.style == rhs.style &&
+ lhs.family == rhs.family;
+}
+
+inline bool operator!=(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) Q_DECL_NOTHROW
+{
+ return !operator==(lhs, rhs);
+}
+
+inline uint qHash(const FallbacksCacheKey &key, uint seed = 0) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.family);
+ seed = hash(seed, int(key.style));
+ seed = hash(seed, int(key.styleHint));
+ seed = hash(seed, int(key.script));
+ return seed;
+}
+
+
class QFontDatabasePrivate
{
public:
QFontDatabasePrivate()
- : count(0), families(0), reregisterAppFonts(false)
+ : count(0), families(0),
+ fallbacksCache(64),
+ reregisterAppFonts(false)
{ }
~QFontDatabasePrivate() {
@@ -443,6 +478,7 @@ public:
int count;
QtFontFamily **families;
+ QCache<FallbacksCacheKey, QStringList> fallbacksCache;
struct ApplicationFont {
@@ -461,6 +497,8 @@ public:
void QFontDatabasePrivate::invalidate()
{
QFontCache::instance()->clear();
+
+ fallbacksCache.clear();
free();
QGuiApplicationPrivate::platformIntegration()->fontDatabase()->invalidate();
emit static_cast<QGuiApplication *>(QCoreApplication::instance())->fontDatabaseChanged();
@@ -680,8 +718,10 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, fontDatabaseMutex, (QMutex::Recursive))
void qt_cleanupFontDatabase()
{
QFontDatabasePrivate *db = privateDb();
- if (db)
+ if (db) {
+ db->fallbacksCache.clear();
db->free();
+ }
}
// used in qfontengine_x11.cpp
@@ -798,11 +838,17 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFo
return retList;
}
-QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
+static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
{
+ QFontDatabasePrivate *db = privateDb();
+
+ const FallbacksCacheKey cacheKey = { family, style, styleHint, script };
+
+ if (const QStringList *fallbacks = db->fallbacksCache.object(cacheKey))
+ return *fallbacks;
+
// make sure that the db has all fallback families
QStringList retList = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,styleHint,script);
- QFontDatabasePrivate *db = privateDb();
QStringList::iterator i;
for (i = retList.begin(); i != retList.end(); ++i) {
@@ -818,9 +864,18 @@ QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFo
--i;
}
}
+
+ db->fallbacksCache.insert(cacheKey, new QStringList(retList));
+
return retList;
}
+QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
+{
+ QMutexLocker locker(fontDatabaseMutex());
+ return fallbacksForFamily(family, style, styleHint, script);
+}
+
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt);
static void initializeDb()
@@ -935,7 +990,7 @@ QFontEngine *loadEngine(int script, const QFontDef &request,
if (styleHint == QFont::AnyStyle && request.fixedPitch)
styleHint = QFont::TypeWriter;
- fallbacks += qt_fallbacksForFamily(family->name, QFont::Style(style->key.style), styleHint, QChar::Script(script));
+ fallbacks += fallbacksForFamily(family->name, QFont::Style(style->key.style), styleHint, QChar::Script(script));
pfMultiEngine->setFallbackFamiliesList(fallbacks);
}
@@ -1413,22 +1468,30 @@ QList<QFontDatabase::WritingSystem> QFontDatabase::writingSystems() const
QT_PREPEND_NAMESPACE(load)();
- QList<WritingSystem> list;
+ quint64 writingSystemsFound = 0;
+ Q_STATIC_ASSERT(WritingSystemsCount < 64);
+
for (int i = 0; i < d->count; ++i) {
QtFontFamily *family = d->families[i];
family->ensurePopulated();
if (family->count == 0)
continue;
- for (int x = Latin; x < WritingSystemsCount; ++x) {
- const WritingSystem writingSystem = WritingSystem(x);
- if (!(family->writingSystems[writingSystem] & QtFontFamily::Supported))
- continue;
- if (!list.contains(writingSystem))
- list.append(writingSystem);
+ for (uint x = Latin; x < uint(WritingSystemsCount); ++x) {
+ if (family->writingSystems[x] & QtFontFamily::Supported)
+ writingSystemsFound |= quint64(1) << x;
}
}
- std::sort(list.begin(), list.end());
+
+ // mutex protection no longer needed - just working on local data now:
+ locker.unlock();
+
+ QList<WritingSystem> list;
+ list.reserve(qPopulationCount(writingSystemsFound));
+ for (uint x = Latin ; x < uint(WritingSystemsCount); ++x) {
+ if (writingSystemsFound & (quint64(1) << x))
+ list.push_back(WritingSystem(x));
+ }
return list;
}
@@ -2607,10 +2670,10 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script)
styleHint = QFont::TypeWriter;
QStringList fallbacks = request.fallBackFamilies
- + qt_fallbacksForFamily(request.family,
- QFont::Style(request.style),
- styleHint,
- QChar::Script(script));
+ + fallbacksForFamily(request.family,
+ QFont::Style(request.style),
+ styleHint,
+ QChar::Script(script));
if (script > QChar::Script_Common)
fallbacks += QString(); // Find the first font matching the specified script.
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 2087bad9f6..f267b2d147 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -54,6 +54,7 @@
#include <private/qharfbuzz_p.h>
#include <algorithm>
+#include <limits.h>
QT_BEGIN_NAMESPACE
@@ -235,10 +236,14 @@ Q_AUTOTEST_EXPORT QList<QFontEngine *> QFontEngine_stopCollectingEngines()
// QFontEngine
+#define kBearingNotInitialized std::numeric_limits<qreal>::max()
+
QFontEngine::QFontEngine(Type type)
: m_type(type), ref(0),
font_(0), font_destroy_func(0),
- face_(0), face_destroy_func(0)
+ face_(0), face_destroy_func(0),
+ m_minLeftBearing(kBearingNotInitialized),
+ m_minRightBearing(kBearingNotInitialized)
{
faceData.user_data = this;
faceData.get_font_table = qt_get_font_table_default;
@@ -365,17 +370,15 @@ bool QFontEngine::supportsScript(QChar::Script script) const
return true;
}
-#ifdef Q_OS_MAC
- {
+#ifdef QT_ENABLE_HARFBUZZ_NG
+ if (qt_useHarfbuzzNG()) {
+#if defined(Q_OS_DARWIN)
// in AAT fonts, 'gsub' table is effectively replaced by 'mort'/'morx' table
uint len;
if (getSfntTableData(MAKE_TAG('m','o','r','t'), 0, &len) || getSfntTableData(MAKE_TAG('m','o','r','x'), 0, &len))
return true;
- }
#endif
-#ifdef QT_ENABLE_HARFBUZZ_NG
- if (qt_useHarfbuzzNG()) {
bool ret = false;
if (hb_face_t *face = hb_qt_face_get_for_engine(const_cast<QFontEngine *>(this))) {
hb_tag_t script_tag_1, script_tag_2;
@@ -562,11 +565,91 @@ void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform
void QFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
{
glyph_metrics_t gi = boundingBox(glyph);
- bool isValid = gi.isValid();
if (leftBearing != 0)
- *leftBearing = isValid ? gi.x.toReal() : 0.0;
+ *leftBearing = gi.leftBearing().toReal();
if (rightBearing != 0)
- *rightBearing = isValid ? (gi.xoff - gi.x - gi.width).toReal() : 0.0;
+ *rightBearing = gi.rightBearing().toReal();
+}
+
+qreal QFontEngine::minLeftBearing() const
+{
+ if (m_minLeftBearing == kBearingNotInitialized)
+ minRightBearing(); // Initializes both (see below)
+
+ return m_minLeftBearing;
+}
+
+#define q16Dot16ToFloat(i) ((i) / 65536.0)
+
+#define kMinLeftSideBearingOffset 12
+#define kMinRightSideBearingOffset 14
+
+qreal QFontEngine::minRightBearing() const
+{
+ if (m_minRightBearing == kBearingNotInitialized) {
+
+ // Try the 'hhea' font table first, which covers the entire font
+ QByteArray hheaTable = getSfntTable(MAKE_TAG('h', 'h', 'e', 'a'));
+ if (hheaTable.size() >= int(kMinRightSideBearingOffset + sizeof(qint16))) {
+ const uchar *tableData = reinterpret_cast<const uchar *>(hheaTable.constData());
+ Q_ASSERT(q16Dot16ToFloat(qFromBigEndian<quint32>(tableData)) == 1.0);
+
+ qint16 minLeftSideBearing = qFromBigEndian<qint16>(tableData + kMinLeftSideBearingOffset);
+ qint16 minRightSideBearing = qFromBigEndian<qint16>(tableData + kMinRightSideBearingOffset);
+
+ // The table data is expressed as FUnits, meaning we have to take the number
+ // of units per em into account. Since pixelSize already has taken DPI into
+ // account we can use that directly instead of the point size.
+ int unitsPerEm = emSquareSize().toInt();
+ qreal funitToPixelFactor = fontDef.pixelSize / unitsPerEm;
+
+ // Some fonts on OS X (such as Gurmukhi Sangam MN, Khmer MN, Lao Sangam MN, etc.), have
+ // invalid values for their NBSPACE left bearing, causing the 'hhea' minimum bearings to
+ // be way off. We detect this by assuming that the minimum bearsings are within a certain
+ // range of the em square size.
+ static const int largestValidBearing = 4 * unitsPerEm;
+
+ if (qAbs(minLeftSideBearing) < largestValidBearing)
+ m_minLeftBearing = minLeftSideBearing * funitToPixelFactor;
+ if (qAbs(minRightSideBearing) < largestValidBearing)
+ m_minRightBearing = minRightSideBearing * funitToPixelFactor;
+ }
+
+ // Fallback in case of missing 'hhea' table (bitmap fonts e.g.) or broken 'hhea' values
+ if (m_minLeftBearing == kBearingNotInitialized || m_minRightBearing == kBearingNotInitialized) {
+
+ // To balance performance and correctness we only look at a subset of the
+ // possible glyphs in the font, based on which characters are more likely
+ // to have a left or right bearing.
+ static const ushort characterSubset[] = {
+ '(', 'C', 'F', 'K', 'V', 'X', 'Y', ']', '_', 'f', 'r', '|',
+ 127, 205, 645, 884, 922, 1070, 12386
+ };
+
+ // The font may have minimum bearings larger than 0, so we have to start at the max
+ m_minLeftBearing = m_minRightBearing = std::numeric_limits<qreal>::max();
+
+ for (uint i = 0; i < (sizeof(characterSubset) / sizeof(ushort)); ++i) {
+ const glyph_t glyph = glyphIndex(characterSubset[i]);
+ if (!glyph)
+ continue;
+
+ glyph_metrics_t glyphMetrics = const_cast<QFontEngine *>(this)->boundingBox(glyph);
+
+ // Glyphs with no contours shouldn't contribute to bearings
+ if (!glyphMetrics.width || !glyphMetrics.height)
+ continue;
+
+ m_minLeftBearing = qMin(m_minLeftBearing, glyphMetrics.leftBearing().toReal());
+ m_minRightBearing = qMin(m_minRightBearing, glyphMetrics.rightBearing().toReal());
+ }
+ }
+
+ if (m_minLeftBearing == kBearingNotInitialized || m_minRightBearing == kBearingNotInitialized)
+ qWarning() << "Failed to compute left/right minimum bearings for" << fontDef.family;
+ }
+
+ return m_minRightBearing;
}
glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
@@ -875,7 +958,8 @@ QImage QFontEngine::alphaMapForGlyph(glyph_t glyph)
pt.x = -glyph_x;
pt.y = -glyph_y; // the baseline
QPainterPath path;
- QImage im(glyph_width + 4, glyph_height, QImage::Format_ARGB32_Premultiplied);
+ path.setFillRule(Qt::WindingFill);
+ QImage im(glyph_width, glyph_height, QImage::Format_ARGB32_Premultiplied);
im.fill(Qt::transparent);
QPainter p(&im);
p.setRenderHint(QPainter::Antialiasing);
@@ -1469,8 +1553,7 @@ QFixed QFontEngine::lastRightBearing(const QGlyphLayout &glyphs, bool round)
glyph_t glyph = glyphs.glyphs[glyphs.numGlyphs - 1];
glyph_metrics_t gi = boundingBox(glyph);
if (gi.isValid())
- return round ? QFixed(qRound(gi.xoff - gi.x - gi.width))
- : QFixed(gi.xoff - gi.x - gi.width);
+ return round ? qRound(gi.rightBearing()) : gi.rightBearing();
}
return 0;
}
@@ -1752,7 +1835,10 @@ QFontEngine *QFontEngineMulti::loadEngine(int at)
request.family = fallbackFamilyAt(at - 1);
if (QFontEngine *engine = QFontDatabase::findFont(request, m_script)) {
- engine->fontDef = request;
+ if (request.weight > QFont::Normal)
+ engine->fontDef.weight = request.weight;
+ if (request.style > QFont::StyleNormal)
+ engine->fontDef.style = request.style;
return engine;
}
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 1177305f6e..4dd2ee35b1 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -99,6 +99,13 @@ static bool ft_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *leng
static QFontEngineFT::Glyph emptyGlyph = {0, 0, 0, 0, 0, 0, 0, 0};
+static const QFontEngine::HintStyle ftInitialDefaultHintStyle =
+#ifdef Q_OS_WIN
+ QFontEngineFT::HintFull;
+#else
+ QFontEngineFT::HintNone;
+#endif
+
// -------------------------- Freetype support ------------------------------
class QtFreetypeData
@@ -527,69 +534,87 @@ QFontEngineFT::Glyph::~Glyph()
delete [] data;
}
-static const uint subpixel_filter[3][3] = {
- { 180, 60, 16 },
- { 38, 180, 38 },
- { 16, 60, 180 }
+struct LcdFilterDummy
+{
+ static inline void filterPixel(uchar &, uchar &, uchar &)
+ {}
};
-static inline uint filterPixel(uint red, uint green, uint blue, bool legacyFilter)
+struct LcdFilterLegacy
{
- uint res;
- if (legacyFilter) {
- uint high = (red*subpixel_filter[0][0] + green*subpixel_filter[0][1] + blue*subpixel_filter[0][2]) >> 8;
- uint mid = (red*subpixel_filter[1][0] + green*subpixel_filter[1][1] + blue*subpixel_filter[1][2]) >> 8;
- uint low = (red*subpixel_filter[2][0] + green*subpixel_filter[2][1] + blue*subpixel_filter[2][2]) >> 8;
- res = (mid << 24) + (high << 16) + (mid << 8) + low;
- } else {
- uint alpha = green;
- res = (alpha << 24) + (red << 16) + (green << 8) + blue;
+ static inline void filterPixel(uchar &red, uchar &green, uchar &blue)
+ {
+ uint r = red, g = green, b = blue;
+ // intra-pixel filter used by the legacy filter (adopted from _ft_lcd_filter_legacy)
+ red = (r * uint(65538 * 9/13) + g * uint(65538 * 1/6) + b * uint(65538 * 1/13)) / 65536;
+ green = (r * uint(65538 * 3/13) + g * uint(65538 * 4/6) + b * uint(65538 * 3/13)) / 65536;
+ blue = (r * uint(65538 * 1/13) + g * uint(65538 * 1/6) + b * uint(65538 * 9/13)) / 65536;
}
- return res;
-}
+};
-static void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
+template <typename LcdFilter>
+static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
{
- int h = height;
const int offs = bgr ? -1 : 1;
const int w = width * 3;
- while (h--) {
+ while (height--) {
uint *dd = dst;
for (int x = 0; x < w; x += 3) {
- uint red = src[x+1-offs];
- uint green = src[x+1];
- uint blue = src[x+1+offs];
- *dd = filterPixel(red, green, blue, legacyFilter);
- ++dd;
+ uchar red = src[x + 1 - offs];
+ uchar green = src[x + 1];
+ uchar blue = src[x + 1 + offs];
+ LcdFilter::filterPixel(red, green, blue);
+ // alpha = green
+ *dd++ = (green << 24) | (red << 16) | (green << 8) | blue;
}
dst += width;
src += src_pitch;
}
}
-static void convertRGBToARGB_V(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
+static inline void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
+{
+ if (!legacyFilter)
+ convertRGBToARGB_helper<LcdFilterDummy>(src, dst, width, height, src_pitch, bgr);
+ else
+ convertRGBToARGB_helper<LcdFilterLegacy>(src, dst, width, height, src_pitch, bgr);
+}
+
+template <typename LcdFilter>
+static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
{
- int h = height;
const int offs = bgr ? -src_pitch : src_pitch;
- while (h--) {
+ while (height--) {
for (int x = 0; x < width; x++) {
- uint red = src[x+src_pitch-offs];
- uint green = src[x+src_pitch];
- uint blue = src[x+src_pitch+offs];
- dst[x] = filterPixel(red, green, blue, legacyFilter);
+ uchar red = src[x + src_pitch - offs];
+ uchar green = src[x + src_pitch];
+ uchar blue = src[x + src_pitch + offs];
+ LcdFilter::filterPixel(red, green, blue);
+ // alpha = green
+ *dst++ = (green << 24) | (red << 16) | (green << 8) | blue;
}
- dst += width;
src += 3*src_pitch;
}
}
-static void convertGRAYToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch) {
- for (int y = 0; y < height; ++y) {
- int readpos = (y * src_pitch);
- int writepos = (y * width);
- for (int x = 0; x < width; ++x) {
- dst[writepos + x] = (0xFF << 24) + (src[readpos + x] << 16) + (src[readpos + x] << 8) + src[readpos + x];
+static inline void convertRGBToARGB_V(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
+{
+ if (!legacyFilter)
+ convertRGBToARGB_V_helper<LcdFilterDummy>(src, dst, width, height, src_pitch, bgr);
+ else
+ convertRGBToARGB_V_helper<LcdFilterLegacy>(src, dst, width, height, src_pitch, bgr);
+}
+
+static inline void convertGRAYToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch)
+{
+ while (height--) {
+ const uchar *p = src;
+ const uchar * const e = p + width;
+ while (p < e) {
+ uchar gray = *p++;
+ *dst++ = (0xFF << 24) | (gray << 16) | (gray << 8) | gray;
}
+ src += src_pitch;
}
}
@@ -629,11 +654,7 @@ QFontEngineFT::QFontEngineFT(const QFontDef &fd)
antialias = true;
freetype = 0;
default_load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
-#ifndef Q_OS_WIN
- default_hint_style = HintNone;
-#else
- default_hint_style = HintFull;
-#endif
+ default_hint_style = ftInitialDefaultHintStyle;
subpixelType = Subpixel_None;
lcdFilterType = 0;
#if defined(FT_LCD_FILTER_H)
@@ -685,7 +706,6 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
symbol = bool(fontDef.family.contains(QLatin1String("symbol"), Qt::CaseInsensitive));
}
- lbearing = rbearing = SHRT_MIN;
freetype->computeSize(fontDef, &xsize, &ysize, &defaultGlyphSet.outline_drawing);
FT_Face face = lockFace();
@@ -697,8 +717,12 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
FT_Set_Transform(face, &matrix, 0);
freetype->matrix = matrix;
// fake bold
- if ((fontDef.weight >= QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face))
- embolden = true;
+ if ((fontDef.weight >= QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face)) {
+ if (const TT_OS2 *os2 = reinterpret_cast<const TT_OS2 *>(FT_Get_Sfnt_Table(face, ft_sfnt_os2))) {
+ if (os2->usWeightClass < 750)
+ embolden = true;
+ }
+ }
// underline metrics
line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale));
underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale));
@@ -760,6 +784,24 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
return true;
}
+void QFontEngineFT::setQtDefaultHintStyle(QFont::HintingPreference hintingPreference)
+{
+ switch (hintingPreference) {
+ case QFont::PreferNoHinting:
+ setDefaultHintStyle(HintNone);
+ break;
+ case QFont::PreferFullHinting:
+ setDefaultHintStyle(HintFull);
+ break;
+ case QFont::PreferVerticalHinting:
+ setDefaultHintStyle(HintLight);
+ break;
+ case QFont::PreferDefaultHinting:
+ setDefaultHintStyle(ftInitialDefaultHintStyle);
+ break;
+ }
+}
+
void QFontEngineFT::setDefaultHintStyle(HintStyle style)
{
default_hint_style = style;
@@ -1237,54 +1279,6 @@ qreal QFontEngineFT::maxCharWidth() const
return metrics.max_advance >> 6;
}
-static const ushort char_table[] = {
- 40,
- 67,
- 70,
- 75,
- 86,
- 88,
- 89,
- 91,
- 95,
- 102,
- 114,
- 124,
- 127,
- 205,
- 645,
- 884,
- 922,
- 1070,
- 12386
-};
-
-static const int char_table_entries = sizeof(char_table)/sizeof(ushort);
-
-
-qreal QFontEngineFT::minLeftBearing() const
-{
- if (lbearing == SHRT_MIN)
- (void) minRightBearing(); // calculates both
- return lbearing.toReal();
-}
-
-qreal QFontEngineFT::minRightBearing() const
-{
- if (rbearing == SHRT_MIN) {
- lbearing = rbearing = 0;
- for (int i = 0; i < char_table_entries; ++i) {
- const glyph_t glyph = glyphIndex(char_table[i]);
- if (glyph != 0) {
- glyph_metrics_t gi = const_cast<QFontEngineFT *>(this)->boundingBox(glyph);
- lbearing = qMin(lbearing, gi.x);
- rbearing = qMin(rbearing, (gi.xoff - gi.x - gi.width));
- }
- }
- }
- return rbearing.toReal();
-}
-
QFixed QFontEngineFT::lineThickness() const
{
return line_thickness;
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 7b28a4064f..83f9a4ef3d 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -208,8 +208,6 @@ private:
virtual QFixed averageCharWidth() const Q_DECL_OVERRIDE;
virtual qreal maxCharWidth() const Q_DECL_OVERRIDE;
- virtual qreal minLeftBearing() const Q_DECL_OVERRIDE;
- virtual qreal minRightBearing() const Q_DECL_OVERRIDE;
virtual QFixed lineThickness() const Q_DECL_OVERRIDE;
virtual QFixed underlinePosition() const Q_DECL_OVERRIDE;
@@ -281,7 +279,7 @@ private:
virtual int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints) Q_DECL_OVERRIDE;
-
+ void setQtDefaultHintStyle(QFont::HintingPreference hintingPreference);
virtual void setDefaultHintStyle(HintStyle style) Q_DECL_OVERRIDE;
virtual QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
@@ -307,6 +305,7 @@ private:
friend class QFontEngineFTRawFont;
friend class QFontconfigDatabase;
friend class QBasicFontDatabase;
+ friend class QCoreTextFontDatabase;
friend class QFontEngineMultiFontConfig;
int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const;
@@ -323,8 +322,6 @@ private:
int xsize;
int ysize;
- mutable QFixed lbearing;
- mutable QFixed rbearing;
QFixed line_thickness;
QFixed underline_position;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 6f4fabe1f6..be9eaa5020 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -49,6 +49,7 @@
#include "QtCore/qatomic.h"
#include <QtCore/qvarlengtharray.h>
#include <QtCore/QLinkedList>
+#include <QtCore/qhashfunctions.h>
#include "private/qtextengine_p.h"
#include "private/qfont_p.h"
@@ -213,8 +214,8 @@ public:
virtual QFixed underlinePosition() const;
virtual qreal maxCharWidth() const = 0;
- virtual qreal minLeftBearing() const { return qreal(); }
- virtual qreal minRightBearing() const { return qreal(); }
+ virtual qreal minLeftBearing() const;
+ virtual qreal minRightBearing() const;
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
@@ -322,18 +323,28 @@ private:
private:
QVariant m_userData;
+
+ mutable qreal m_minLeftBearing;
+ mutable qreal m_minRightBearing;
+
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QFontEngine::ShaperFlags)
inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2)
{
- return (f1.index == f2.index) && (f1.encoding == f2.encoding) && (f1.filename == f2.filename);
+ return f1.index == f2.index && f1.encoding == f2.encoding && f1.filename == f2.filename && f1.uuid == f2.uuid;
}
-inline uint qHash(const QFontEngine::FaceId &f)
+inline uint qHash(const QFontEngine::FaceId &f, uint seed = 0)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(f.filename)))
{
- return qHash((f.index << 16) + f.encoding) + qHash(f.filename + f.uuid);
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, f.filename);
+ seed = hash(seed, f.uuid);
+ seed = hash(seed, f.index);
+ seed = hash(seed, f.encoding);
+ return seed;
}
diff --git a/src/gui/text/qfontengineglyphcache.cpp b/src/gui/text/qfontengineglyphcache.cpp
new file mode 100644
index 0000000000..f6fdfa3ce3
--- /dev/null
+++ b/src/gui/text/qfontengineglyphcache.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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/qfontengineglyphcache_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// out-of-line to avoid vtable duplication, breaking e.g. RTTI
+QFontEngineGlyphCache::~QFontEngineGlyphCache()
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h
index 6cf4d2f1ba..def42c22a3 100644
--- a/src/gui/text/qfontengineglyphcache_p.h
+++ b/src/gui/text/qfontengineglyphcache_p.h
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
-class QFontEngineGlyphCache: public QSharedData
+class Q_GUI_EXPORT QFontEngineGlyphCache: public QSharedData
{
public:
QFontEngineGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix) : m_format(format), m_transform(matrix)
@@ -64,7 +64,7 @@ public:
Q_ASSERT(m_format != QFontEngine::Format_None);
}
- virtual ~QFontEngineGlyphCache() { }
+ virtual ~QFontEngineGlyphCache();
QFontEngine::GlyphFormat glyphFormat() const { return m_format; }
const QTransform &transform() const { return m_transform; }
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index 2031f022d4..4c2c6317ba 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -93,11 +93,11 @@ public:
QRect boundingRect(QChar) const;
QRect boundingRect(const QString &text) const;
- QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops=0, int *tabarray=0) const;
+ QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text,
- int tabstops=0, int *tabarray=0) const
+ int tabstops = 0, int *tabarray = Q_NULLPTR) const
{ return boundingRect(QRect(x, y, w, h), flags, text, tabstops, tabarray); }
- QSize size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
+ QSize size(int flags, const QString& str, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
QRect tightBoundingRect(const QString &text) const;
@@ -161,8 +161,8 @@ public:
QRectF boundingRect(const QString &string) const;
QRectF boundingRect(QChar) const;
- QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops=0, int *tabarray=0) const;
- QSizeF size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
+ QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
+ QSizeF size(int flags, const QString& str, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
QRectF tightBoundingRect(const QString &text) const;
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index 9f652084be..dc32405f36 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -350,6 +350,7 @@ struct qttf_head_table {
quint16 macStyle;
qint16 indexToLocFormat;
};
+Q_DECLARE_TYPEINFO(qttf_head_table, Q_PRIMITIVE_TYPE);
struct qttf_hhea_table {
@@ -362,6 +363,7 @@ struct qttf_hhea_table {
qint16 xMaxExtent;
quint16 numberOfHMetrics;
};
+Q_DECLARE_TYPEINFO(qttf_hhea_table, Q_PRIMITIVE_TYPE);
struct qttf_maxp_table {
@@ -373,6 +375,7 @@ struct qttf_maxp_table {
quint16 maxComponentElements;
quint16 maxComponentDepth;
};
+Q_DECLARE_TYPEINFO(qttf_maxp_table, Q_PRIMITIVE_TYPE);
struct qttf_name_table {
QString copyright;
@@ -380,6 +383,7 @@ struct qttf_name_table {
QString subfamily;
QString postscript_name;
};
+Q_DECLARE_TYPEINFO(qttf_name_table, Q_MOVABLE_TYPE);
static QTtfTable generateHead(const qttf_head_table &head);
@@ -411,9 +415,9 @@ Q_DECLARE_TYPEINFO(QTtfGlyph, Q_MOVABLE_TYPE);
static QTtfGlyph generateGlyph(int index, const QPainterPath &path, qreal advance, qreal lsb, qreal ppem);
// generates glyf, loca and hmtx
-static QList<QTtfTable> generateGlyphTables(qttf_font_tables &tables, const QList<QTtfGlyph> &_glyphs);
+static QVector<QTtfTable> generateGlyphTables(qttf_font_tables &tables, const QVector<QTtfGlyph> &_glyphs);
-static QByteArray bindFont(const QList<QTtfTable>& _tables);
+static QByteArray bindFont(const QVector<QTtfTable>& _tables);
static quint32 checksum(const QByteArray &table)
@@ -607,12 +611,13 @@ struct QTtfNameRecord {
quint16 nameId;
QString value;
};
+Q_DECLARE_TYPEINFO(QTtfNameRecord, Q_MOVABLE_TYPE);
-static QTtfTable generateName(const QList<QTtfNameRecord> &name);
+static QTtfTable generateName(const QVector<QTtfNameRecord> &name);
static QTtfTable generateName(const qttf_name_table &name)
{
- QList<QTtfNameRecord> list;
+ QVector<QTtfNameRecord> list;
QTtfNameRecord rec;
rec.nameId = 0;
rec.value = name.copyright;
@@ -636,7 +641,7 @@ static QTtfTable generateName(const qttf_name_table &name)
}
// ####### should probably generate Macintosh/Roman name entries as well
-static QTtfTable generateName(const QList<QTtfNameRecord> &name)
+static QTtfTable generateName(const QVector<QTtfNameRecord> &name)
{
const int char_size = 2;
@@ -707,7 +712,7 @@ struct TTF_POINT {
};
Q_DECLARE_TYPEINFO(TTF_POINT, Q_PRIMITIVE_TYPE);
-static void convertPath(const QPainterPath &path, QList<TTF_POINT> *points, QList<int> *endPoints, qreal ppem)
+static void convertPath(const QPainterPath &path, QVector<TTF_POINT> *points, QVector<int> *endPoints, qreal ppem)
{
int numElements = path.elementCount();
for (int i = 0; i < numElements - 1; ++i) {
@@ -829,7 +834,7 @@ static void convertPath(const QPainterPath &path, QList<TTF_POINT> *points, QLis
endPoints->append(points->size() - 1);
}
-static void getBounds(const QList<TTF_POINT> &points, qint16 *xmin, qint16 *xmax, qint16 *ymin, qint16 *ymax)
+static void getBounds(const QVector<TTF_POINT> &points, qint16 *xmin, qint16 *xmax, qint16 *ymin, qint16 *ymax)
{
*xmin = points.at(0).x;
*xmax = *xmin;
@@ -844,7 +849,7 @@ static void getBounds(const QList<TTF_POINT> &points, qint16 *xmin, qint16 *xmax
}
}
-static int convertToRelative(QList<TTF_POINT> *points)
+static int convertToRelative(QVector<TTF_POINT> *points)
{
// convert points to relative and setup flags
// qDebug() << "relative points:";
@@ -897,7 +902,7 @@ static int convertToRelative(QList<TTF_POINT> *points)
return point_array_size;
}
-static void getGlyphData(QTtfGlyph *glyph, const QList<TTF_POINT> &points, const QList<int> &endPoints, int point_array_size)
+static void getGlyphData(QTtfGlyph *glyph, const QVector<TTF_POINT> &points, const QVector<int> &endPoints, int point_array_size)
{
const int max_size = 5*sizeof(qint16) // header
+ endPoints.size()*sizeof(quint16) // end points of contours
@@ -947,8 +952,8 @@ static void getGlyphData(QTtfGlyph *glyph, const QList<TTF_POINT> &points, const
static QTtfGlyph generateGlyph(int index, const QPainterPath &path, qreal advance, qreal lsb, qreal ppem)
{
- QList<TTF_POINT> points;
- QList<int> endPoints;
+ QVector<TTF_POINT> points;
+ QVector<int> endPoints;
QTtfGlyph glyph;
glyph.index = index;
glyph.advanceWidth = qRound(advance * 2048. / ppem);
@@ -983,10 +988,10 @@ static bool operator <(const QTtfGlyph &g1, const QTtfGlyph &g2)
return g1.index < g2.index;
}
-static QList<QTtfTable> generateGlyphTables(qttf_font_tables &tables, const QList<QTtfGlyph> &_glyphs)
+static QVector<QTtfTable> generateGlyphTables(qttf_font_tables &tables, const QVector<QTtfGlyph> &_glyphs)
{
const int max_size_small = 65536*2;
- QList<QTtfGlyph> glyphs = _glyphs;
+ QVector<QTtfGlyph> glyphs = _glyphs;
std::sort(glyphs.begin(), glyphs.end());
Q_ASSERT(tables.maxp.numGlyphs == glyphs.at(glyphs.size()-1).index + 1);
@@ -1049,7 +1054,7 @@ static QList<QTtfTable> generateGlyphTables(qttf_font_tables &tables, const QLis
Q_ASSERT(loca.data.size() == ls.offset());
Q_ASSERT(hmtx.data.size() == hs.offset());
- QList<QTtfTable> list;
+ QVector<QTtfTable> list;
list.append(glyf);
list.append(loca);
list.append(hmtx);
@@ -1061,9 +1066,9 @@ static bool operator <(const QTtfTable &t1, const QTtfTable &t2)
return t1.tag < t2.tag;
}
-static QByteArray bindFont(const QList<QTtfTable>& _tables)
+static QByteArray bindFont(const QVector<QTtfTable>& _tables)
{
- QList<QTtfTable> tables = _tables;
+ QVector<QTtfTable> tables = _tables;
std::sort(tables.begin(), tables.end());
@@ -1154,7 +1159,7 @@ QByteArray QFontSubset::toTruetype() const
qreal ppem = fontEngine->fontDef.pixelSize;
#define TO_TTF(x) qRound(x * 2048. / ppem)
- QList<QTtfGlyph> glyphs;
+ QVector<QTtfGlyph> glyphs;
QFontEngine::Properties properties = fontEngine->properties();
// initialize some stuff needed in createWidthArray
@@ -1225,7 +1230,7 @@ QByteArray QFontSubset::toTruetype() const
}
- QList<QTtfTable> tables = generateGlyphTables(font, glyphs);
+ QVector<QTtfTable> tables = generateGlyphTables(font, glyphs);
tables.append(generateHead(font.head));
tables.append(generateHhea(font.hhea));
tables.append(generateMaxp(font.maxp));
diff --git a/src/gui/text/qfontsubset_p.h b/src/gui/text/qfontsubset_p.h
index da8589de3f..4abdb48c0d 100644
--- a/src/gui/text/qfontsubset_p.h
+++ b/src/gui/text/qfontsubset_p.h
@@ -79,7 +79,7 @@ public:
const int object_id;
bool noEmbed;
QFontEngine *fontEngine;
- QList<int> glyph_indices;
+ QVector<int> glyph_indices;
mutable int downloaded_glyphs;
mutable bool standard_font;
int nGlyphs() const { return glyph_indices.size(); }
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index e6d6863134..642313d340 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE
\ingroup text
\ingroup shared
- \mainclass
When Qt displays a string of text encoded in Unicode, it will first convert the Unicode points
into a list of glyph indexes and a list of positions based on one or more fonts. The Unicode
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index d3034b7546..9f51a49a6d 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -59,9 +59,13 @@ public:
QGlyphRun();
QGlyphRun(const QGlyphRun &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QGlyphRun &operator=(QGlyphRun &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QGlyphRun &operator=(const QGlyphRun &other);
~QGlyphRun();
- void swap(QGlyphRun &other) { qSwap(d, other.d); }
+ void swap(QGlyphRun &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
@@ -78,8 +82,6 @@ public:
void clear();
- QGlyphRun &operator=(const QGlyphRun &other);
-
bool operator==(const QGlyphRun &other) const;
inline bool operator!=(const QGlyphRun &other) const
{ return !operator==(other); }
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp
index 102c62ea8a..b2edfc00a0 100644
--- a/src/gui/text/qharfbuzzng.cpp
+++ b/src/gui/text/qharfbuzzng.cpp
@@ -188,7 +188,15 @@ static const hb_script_t _qtscript_to_hbscript[] = {
HB_SCRIPT_SIDDHAM,
HB_SCRIPT_KHUDAWADI,
HB_SCRIPT_TIRHUTA,
- HB_SCRIPT_WARANG_CITI
+ HB_SCRIPT_WARANG_CITI,
+
+ // Unicode 8.0 additions
+ HB_SCRIPT_AHOM,
+ HB_SCRIPT_ANATOLIAN_HIEROGLYPHS,
+ HB_SCRIPT_HATRAN,
+ HB_SCRIPT_MULTANI,
+ HB_SCRIPT_OLD_HUNGARIAN,
+ HB_SCRIPT_SIGNWRITING
};
Q_STATIC_ASSERT(QChar::ScriptCount == sizeof(_qtscript_to_hbscript) / sizeof(_qtscript_to_hbscript[0]));
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 8764c8cebf..0695c2eff4 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -40,6 +40,9 @@
#include <QtCore/QLibraryInfo>
#include <QtCore/QDir>
+#include <algorithm>
+#include <iterator>
+
QT_BEGIN_NAMESPACE
void qt_registerFont(const QString &familyname, const QString &stylename,
@@ -450,11 +453,11 @@ bool QPlatformFontDatabase::fontsAlwaysScalable() const
QList<int> QPlatformFontDatabase::standardSizes() const
{
QList<int> ret;
- static const unsigned short standard[] =
- { 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 0 };
- ret.reserve(int(sizeof(standard) / sizeof(standard[0])));
- const unsigned short *sizes = standard;
- while (*sizes) ret << *sizes++;
+ static const quint8 standard[] =
+ { 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 };
+ static const int num_standards = int(sizeof standard / sizeof *standard);
+ ret.reserve(num_standards);
+ std::copy(standard, standard + num_standards, std::back_inserter(ret));
return ret;
}
@@ -471,7 +474,7 @@ QFontEngine::SubpixelAntialiasingType QPlatformFontDatabase::subpixelAntialiasin
// ### copied to tools/makeqpf/qpf2.cpp
// see the Unicode subset bitfields in the MSDN docs
-static const ushort requiredUnicodeBits[QFontDatabase::WritingSystemsCount][2] = {
+static const quint8 requiredUnicodeBits[QFontDatabase::WritingSystemsCount][2] = {
{ 127, 127 }, // Any
{ 0, 127 }, // Latin
{ 7, 127 }, // Greek
diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h
index 0615df65d6..3331d96f8b 100644
--- a/src/gui/text/qplatformfontdatabase.h
+++ b/src/gui/text/qplatformfontdatabase.h
@@ -47,7 +47,9 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QList>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/QHash>
+#endif
#include <QtGui/QFontDatabase>
#include <QtGui/private/qfontengine_p.h>
#include <QtGui/private/qfont_p.h>
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index fedf58872b..0fd5f510c7 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -55,7 +55,6 @@ QT_BEGIN_NAMESPACE
\ingroup text
\ingroup shared
- \mainclass
\note QRawFont is a low level class. For most purposes QFont is a more appropriate class.
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index 3798555de5..d710658a9b 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -72,13 +72,15 @@ public:
qreal pixelSize,
QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
QRawFont(const QRawFont &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QRawFont &operator=(QRawFont &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QRawFont &operator=(const QRawFont &other);
~QRawFont();
- bool isValid() const;
+ void swap(QRawFont &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
- QRawFont &operator=(const QRawFont &other);
-
- void swap(QRawFont &other) { qSwap(d, other.d); }
+ bool isValid() const;
bool operator==(const QRawFont &other) const;
inline bool operator!=(const QRawFont &other) const
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index fc95a859e7..74f4b10305 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -39,6 +39,10 @@
QT_BEGIN_NAMESPACE
+QStaticTextUserData::~QStaticTextUserData()
+{
+}
+
/*!
\class QStaticText
\brief The QStaticText class enables optimized drawing of text when the text and its layout
@@ -49,7 +53,6 @@ QT_BEGIN_NAMESPACE
\ingroup multimedia
\ingroup text
\ingroup shared
- \mainclass
QStaticText provides a way to cache layout data for a block of text so that it can be drawn
more efficiently than by using QPainter::drawText() in which the layout information is
@@ -555,6 +558,9 @@ namespace {
case PdmDevicePixelRatio:
val = 1;
break;
+ case PdmDevicePixelRatioScaled:
+ val = devicePixelRatioFScale();
+ break;
default:
val = 0;
qWarning("DrawTextItemDevice::metric: Invalid metric command");
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index d2825e73ac..0a1d9429b4 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -57,9 +57,13 @@ public:
QStaticText();
QStaticText(const QString &text);
QStaticText(const QStaticText &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QStaticText &operator=(QStaticText &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QStaticText &operator=(const QStaticText &);
~QStaticText();
- void swap(QStaticText &other) { qSwap(data, other.data); }
+ void swap(QStaticText &other) Q_DECL_NOTHROW { qSwap(data, other.data); }
void setText(const QString &text);
QString text() const;
@@ -80,7 +84,6 @@ public:
void setPerformanceHint(PerformanceHint performanceHint);
PerformanceHint performanceHint() const;
- QStaticText &operator=(const QStaticText &);
bool operator==(const QStaticText &) const;
bool operator!=(const QStaticText &) const;
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 088e49e2fc..49ca24d51c 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -52,7 +52,8 @@
QT_BEGIN_NAMESPACE
-class QStaticTextUserData
+// ### Qt 6: Unexport again, if QOpenGLStaticTextUserData (the one from QtOpenGL) is gone by then
+class Q_GUI_EXPORT QStaticTextUserData
{
public:
enum Type {
@@ -61,7 +62,7 @@ public:
};
QStaticTextUserData(Type t) : ref(0), type(t) {}
- virtual ~QStaticTextUserData() {}
+ virtual ~QStaticTextUserData();
QAtomicInt ref;
Type type;
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 162c646a98..f180a839b7 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -90,13 +90,13 @@ void QSyntaxHighlighterPrivate::applyFormatChanges()
QTextLayout *layout = currentBlock.layout();
- QList<QTextLayout::FormatRange> ranges = layout->additionalFormats();
+ QVector<QTextLayout::FormatRange> ranges = layout->formats();
const int preeditAreaStart = layout->preeditAreaPosition();
const int preeditAreaLength = layout->preeditAreaText().length();
if (preeditAreaLength != 0) {
- QList<QTextLayout::FormatRange>::Iterator it = ranges.begin();
+ QVector<QTextLayout::FormatRange>::Iterator it = ranges.begin();
while (it != ranges.end()) {
if (it->start >= preeditAreaStart
&& it->start + it->length <= preeditAreaStart + preeditAreaLength) {
@@ -142,7 +142,7 @@ void QSyntaxHighlighterPrivate::applyFormatChanges()
}
if (formatsChanged) {
- layout->setAdditionalFormats(ranges);
+ layout->setFormats(ranges);
doc->markContentsDirty(currentBlock.position(), currentBlock.length());
}
}
@@ -329,7 +329,7 @@ void QSyntaxHighlighter::setDocument(QTextDocument *doc)
QTextCursor cursor(d->doc);
cursor.beginEditBlock();
for (QTextBlock blk = d->doc->begin(); blk.isValid(); blk = blk.next())
- blk.layout()->clearAdditionalFormats();
+ blk.layout()->clearFormats();
cursor.endEditBlock();
}
d->doc = doc;
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index f04055603c..350f38cd02 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -66,10 +66,13 @@ public:
explicit QTextCursor(const QTextBlock &block);
explicit QTextCursor(QTextCursorPrivate *d);
QTextCursor(const QTextCursor &cursor);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QTextCursor &operator=(QTextCursor &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QTextCursor &operator=(const QTextCursor &other);
~QTextCursor();
- void swap(QTextCursor &other) { qSwap(d, other.d); }
+ void swap(QTextCursor &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool isNull() const;
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 29e00d481e..0affd3239d 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -532,7 +532,7 @@ QTextOption QTextDocument::defaultTextOption() const
/*!
\since 4.3
- Sets the default text option.
+ Sets the default text option to \a option.
*/
void QTextDocument::setDefaultTextOption(const QTextOption &option)
{
@@ -1401,7 +1401,9 @@ static bool findInBlock(const QTextBlock &block, const QRegExp &expression, int
/*!
\overload
- Finds the next occurrence, matching the regular expression, \a expr, in the document.
+ Finds the next occurrence that matches the given regular expression,
+ \a expr, within the same paragraph in the document.
+
The search starts at the given \a from position, and proceeds forwards
through the document unless specified otherwise in the search options.
The \a options control the type of search performed. The FindCaseSensitively
@@ -1454,7 +1456,9 @@ QTextCursor QTextDocument::find(const QRegExp & expr, int from, FindFlags option
/*!
\overload
- Finds the next occurrence, matching the regular expression, \a expr, in the document.
+ Finds the next occurrence that matches the given regular expression,
+ \a expr, within the same paragraph in the document.
+
The search starts at the position of the given from \a cursor, and proceeds
forwards through the document unless specified otherwise in the search
options. The \a options control the type of search performed. The FindCaseSensitively
@@ -1463,7 +1467,7 @@ QTextCursor QTextDocument::find(const QRegExp & expr, int from, FindFlags option
Returns a cursor with the match selected if a match was found; otherwise
returns a null cursor.
- If the given \a from cursor has a selection, the search begins after the
+ If the given \a cursor has a selection, the search begins after the
selection; otherwise it begins at the cursor's position.
By default the search is case-sensitive, and can match text anywhere in the
@@ -1525,7 +1529,9 @@ static bool findInBlock(const QTextBlock &block, const QRegularExpression &expre
/*!
\since 5.5
- Finds the next occurrence, matching the regular expression, \a expr, in the document.
+ Finds the next occurrence that matches the given regular expression,
+ \a expr, within the same paragraph in the document.
+
The search starts at the given \a from position, and proceeds forwards
through the document unless specified otherwise in the search options.
The \a options control the type of search performed.
@@ -1578,7 +1584,9 @@ QTextCursor QTextDocument::find(const QRegularExpression &expr, int from, FindFl
/*!
\since 5.5
- Finds the next occurrence, matching the regular expression, \a expr, in the document.
+ Finds the next occurrence that matches the given regular expression,
+ \a expr, within the same paragraph in the document.
+
The search starts at the position of the given \a cursor, and proceeds
forwards through the document unless specified otherwise in the search
options. The \a options control the type of search performed.
@@ -1948,7 +1956,7 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
for (QTextBlock srcBlock = firstBlock(), dstBlock = clonedDoc->firstBlock();
srcBlock.isValid() && dstBlock.isValid();
srcBlock = srcBlock.next(), dstBlock = dstBlock.next()) {
- dstBlock.layout()->setAdditionalFormats(srcBlock.layout()->additionalFormats());
+ dstBlock.layout()->setFormats(srcBlock.layout()->formats());
}
QAbstractTextDocumentLayout *layout = doc->documentLayout();
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h
index ca80a88033..f05b624704 100644
--- a/src/gui/text/qtextdocument.h
+++ b/src/gui/text/qtextdocument.h
@@ -109,11 +109,11 @@ class Q_GUI_EXPORT QTextDocument : public QObject
Q_PROPERTY(QUrl baseUrl READ baseUrl WRITE setBaseUrl NOTIFY baseUrlChanged)
public:
- explicit QTextDocument(QObject *parent = 0);
- explicit QTextDocument(const QString &text, QObject *parent = 0);
+ explicit QTextDocument(QObject *parent = Q_NULLPTR);
+ explicit QTextDocument(const QString &text, QObject *parent = Q_NULLPTR);
~QTextDocument();
- QTextDocument *clone(QObject *parent = 0) const;
+ QTextDocument *clone(QObject *parent = Q_NULLPTR) const;
bool isEmpty() const;
virtual void clear();
@@ -157,17 +157,17 @@ public:
};
Q_DECLARE_FLAGS(FindFlags, FindFlag)
- QTextCursor find(const QString &subString, int from = 0, FindFlags options = 0) const;
- QTextCursor find(const QString &subString, const QTextCursor &cursor, FindFlags options = 0) const;
+ QTextCursor find(const QString &subString, int from = 0, FindFlags options = FindFlags()) const;
+ QTextCursor find(const QString &subString, const QTextCursor &cursor, FindFlags options = FindFlags()) const;
#ifndef QT_NO_REGEXP
- QTextCursor find(const QRegExp &expr, int from = 0, FindFlags options = 0) const;
- QTextCursor find(const QRegExp &expr, const QTextCursor &cursor, FindFlags options = 0) const;
+ QTextCursor find(const QRegExp &expr, int from = 0, FindFlags options = FindFlags()) const;
+ QTextCursor find(const QRegExp &expr, const QTextCursor &cursor, FindFlags options = FindFlags()) const;
#endif
#ifndef QT_NO_REGULAREXPRESSION
- QTextCursor find(const QRegularExpression &expr, int from = 0, FindFlags options = 0) const;
- QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, FindFlags options = 0) const;
+ QTextCursor find(const QRegularExpression &expr, int from = 0, FindFlags options = FindFlags()) const;
+ QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, FindFlags options = FindFlags()) const;
#endif
QTextFrame *frameAt(int pos) const;
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 5864ca0b1a..c7bbcea4f4 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -106,7 +106,7 @@ public:
bool sizeDirty;
bool layoutDirty;
- QList<QPointer<QTextFrame> > floats;
+ QVector<QPointer<QTextFrame> > floats;
};
QTextFrameData::QTextFrameData()
@@ -467,9 +467,9 @@ public:
void drawFlow(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,
QTextFrame::Iterator it, const QList<QTextFrame *> &floats, QTextBlock *cursorBlockNeedingRepaint) const;
void drawBlock(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,
- QTextBlock bl, bool inRootFrame) const;
+ const QTextBlock &bl, bool inRootFrame) const;
void drawListItem(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,
- QTextBlock bl, const QTextCharFormat *selectionFormat) const;
+ const QTextBlock &bl, const QTextCharFormat *selectionFormat) const;
void drawTableCell(const QRectF &cellRect, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &cell_context,
QTextTable *table, QTextTableData *td, int r, int c,
QTextBlock *cursorBlockNeedingRepaint, QPointF *cursorBlockOffset) const;
@@ -487,7 +487,7 @@ public:
HitPoint hitTest(QTextFrame::Iterator it, HitPoint hit, const QFixedPoint &p,
int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;
HitPoint hitTest(QTextTable *table, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;
- HitPoint hitTest(QTextBlock bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;
+ HitPoint hitTest(const QTextBlock &bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;
QTextLayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,
int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY,
@@ -749,7 +749,7 @@ QTextDocumentLayoutPrivate::hitTest(QTextTable *table, const QFixedPoint &point,
}
QTextDocumentLayoutPrivate::HitPoint
-QTextDocumentLayoutPrivate::hitTest(QTextBlock bl, const QFixedPoint &point, int *position, QTextLayout **l,
+QTextDocumentLayoutPrivate::hitTest(const QTextBlock &bl, const QFixedPoint &point, int *position, QTextLayout **l,
Qt::HitTestAccuracy accuracy) const
{
QTextLayout *tl = bl.layout();
@@ -1071,7 +1071,9 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
it = frameIteratorForYPosition(QFixed::fromReal(context.clip.top()));
QList<QTextFrame *> floats;
- for (int i = 0; i < fd->floats.count(); ++i)
+ const int numFloats = fd->floats.count();
+ floats.reserve(numFloats);
+ for (int i = 0; i < numFloats; ++i)
floats.append(fd->floats.at(i));
drawFlow(off, painter, context, it, floats, &cursorBlockNeedingRepaint);
@@ -1283,7 +1285,7 @@ void QTextDocumentLayoutPrivate::drawFlow(const QPointF &offset, QPainter *paint
void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *painter,
const QAbstractTextDocumentLayout::PaintContext &context,
- QTextBlock bl, bool inRootFrame) const
+ const QTextBlock &bl, bool inRootFrame) const
{
const QTextLayout *tl = bl.layout();
QRectF r = tl->boundingRect();
@@ -1377,7 +1379,7 @@ void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *pain
void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *painter,
const QAbstractTextDocumentLayout::PaintContext &context,
- QTextBlock bl, const QTextCharFormat *selectionFormat) const
+ const QTextBlock &bl, const QTextCharFormat *selectionFormat) const
{
Q_Q(const QTextDocumentLayout);
const QTextBlockFormat blockFormat = bl.blockFormat();
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 29a633f350..1c924175e2 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -918,10 +918,11 @@ void QTextEngine::shapeLine(const QScriptLine &line)
{
QFixed x;
bool first = true;
- const int end = findItem(line.from + line.length - 1);
int item = findItem(line.from);
if (item == -1)
return;
+
+ const int end = findItem(line.from + line.length - 1, item);
for ( ; item <= end; ++item) {
QScriptItem &si = layoutData->items[item];
if (si.analysis.flags == QScriptAnalysis::Tab) {
@@ -1172,7 +1173,23 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
};
const int num_features = 1;
- bool shapedOk = hb_shape_full(hb_font, buffer, features, num_features, 0);
+ const char *const *shaper_list = Q_NULLPTR;
+#if defined(Q_OS_DARWIN)
+ // What's behind QFontEngine::FaceData::user_data isn't compatible between different font engines
+ // - specifically functions in hb-coretext.cc would run into undefined behavior with data
+ // from non-CoreText engine. The other shapers works with that engine just fine.
+ if (actualFontEngine->type() != QFontEngine::Mac) {
+ static const char *s_shaper_list_without_coretext[] = {
+ "graphite2",
+ "ot",
+ "fallback",
+ Q_NULLPTR
+ };
+ shaper_list = s_shaper_list_without_coretext;
+ }
+#endif
+
+ bool shapedOk = hb_shape_full(hb_font, buffer, features, num_features, shaper_list);
if (Q_UNLIKELY(!shapedOk)) {
hb_buffer_destroy(buffer);
return 0;
@@ -1251,21 +1268,22 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
g.glyphs[i] |= (engineIdx << 24);
}
-#ifdef Q_OS_MAC
- // CTRunGetPosition has a bug which applies matrix on 10.6, so we disable
- // scaling the advances for this particular version
- if (actualFontEngine->fontDef.stretch != 100
- && QSysInfo::MacintoshVersion != QSysInfo::MV_10_6) {
- QFixed stretch = QFixed(int(actualFontEngine->fontDef.stretch)) / QFixed(100);
- for (uint i = 0; i < num_glyphs; ++i)
- g.advances[i] *= stretch;
+#ifdef Q_OS_DARWIN
+ if (actualFontEngine->type() == QFontEngine::Mac) {
+ // CTRunGetPosition has a bug which applies matrix on 10.6, so we disable
+ // scaling the advances for this particular version
+ if (QSysInfo::MacintoshVersion != QSysInfo::MV_10_6 && actualFontEngine->fontDef.stretch != 100) {
+ QFixed stretch = QFixed(int(actualFontEngine->fontDef.stretch)) / QFixed(100);
+ for (uint i = 0; i < num_glyphs; ++i)
+ g.advances[i] *= stretch;
+ }
}
+#endif
- if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ if (!actualFontEngine->supportsSubPixelPositions() || (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics)) {
for (uint i = 0; i < num_glyphs; ++i)
g.advances[i] = g.advances[i].round();
}
-#endif
glyphs_shaped += num_glyphs;
}
@@ -1730,13 +1748,13 @@ bool QTextEngine::isRightToLeft() const
}
-int QTextEngine::findItem(int strPos) const
+int QTextEngine::findItem(int strPos, int firstItem) const
{
itemize();
- if (strPos < 0 || strPos >= layoutData->string.size())
+ if (strPos < 0 || strPos >= layoutData->string.size() || firstItem < 0)
return -1;
- int left = 1;
+ int left = firstItem + 1;
int right = layoutData->items.size()-1;
while(left <= right) {
int middle = ((right-left)/2)+left;
@@ -2155,7 +2173,7 @@ void QTextEngine::justify(const QScriptLine &line)
return;
int firstItem = findItem(line.from);
- int lastItem = findItem(line.from + line_length - 1);
+ int lastItem = findItem(line.from + line_length - 1, firstItem);
int nItems = (firstItem >= 0 && lastItem >= firstItem)? (lastItem-firstItem+1) : 0;
QVarLengthArray<QJustificationPoint> justificationPoints;
@@ -2571,7 +2589,7 @@ void QTextEngine::setPreeditArea(int position, const QString &preeditText)
clearLineData();
}
-void QTextEngine::setFormats(const QList<QTextLayout::FormatRange> &formats)
+void QTextEngine::setFormats(const QVector<QTextLayout::FormatRange> &formats)
{
if (formats.isEmpty()) {
if (!specialData)
@@ -2863,6 +2881,7 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
if (!tabArray.isEmpty()) {
if (isRightToLeft()) { // rebase the tabArray positions.
QList<QTextOption::Tab> newTabs;
+ newTabs.reserve(tabArray.count());
QList<QTextOption::Tab>::Iterator iter = tabArray.begin();
while(iter != tabArray.end()) {
QTextOption::Tab tab = *iter;
@@ -2946,17 +2965,17 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
namespace {
class FormatRangeComparatorByStart {
- const QList<QTextLayout::FormatRange> &list;
+ const QVector<QTextLayout::FormatRange> &list;
public:
- FormatRangeComparatorByStart(const QList<QTextLayout::FormatRange> &list) : list(list) { }
+ FormatRangeComparatorByStart(const QVector<QTextLayout::FormatRange> &list) : list(list) { }
bool operator()(int a, int b) {
return list.at(a).start < list.at(b).start;
}
};
class FormatRangeComparatorByEnd {
- const QList<QTextLayout::FormatRange> &list;
+ const QVector<QTextLayout::FormatRange> &list;
public:
- FormatRangeComparatorByEnd(const QList<QTextLayout::FormatRange> &list) : list(list) { }
+ FormatRangeComparatorByEnd(const QVector<QTextLayout::FormatRange> &list) : list(list) { }
bool operator()(int a, int b) {
return list.at(a).start + list.at(a).length < list.at(b).start + list.at(b).length;
}
@@ -3511,7 +3530,7 @@ QTextLineItemIterator::QTextLineItemIterator(QTextEngine *_eng, int _lineNum, co
lineNum(_lineNum),
lineEnd(line.from + line.length),
firstItem(eng->findItem(line.from)),
- lastItem(eng->findItem(lineEnd - 1)),
+ lastItem(eng->findItem(lineEnd - 1, firstItem)),
nItems((firstItem >= 0 && lastItem >= firstItem)? (lastItem-firstItem+1) : 0),
logicalItem(-1),
item(-1),
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 39b9e0cb5a..39c228fd52 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -107,6 +107,22 @@ struct Q_GUI_EXPORT glyph_metrics_t
glyph_metrics_t transformed(const QTransform &xform) const;
inline bool isValid() const {return x != 100000 && y != 100000;}
+
+ inline QFixed leftBearing() const
+ {
+ if (!isValid())
+ return QFixed();
+
+ return x;
+ }
+
+ inline QFixed rightBearing() const
+ {
+ if (!isValid())
+ return QFixed();
+
+ return xoff - x - width;
+ }
};
Q_DECLARE_TYPEINFO(glyph_metrics_t, Q_PRIMITIVE_TYPE);
@@ -351,8 +367,7 @@ struct Q_AUTOTEST_EXPORT QScriptLine
uint leadingIncluded : 1;
QFixed height() const { return ascent + descent
+ (leadingIncluded? qMax(QFixed(),leading) : QFixed()); }
- QFixed base() const { return ascent
- + (leadingIncluded ? qMax(QFixed(),leading) : QFixed()); }
+ QFixed base() const { return ascent; }
void setDefaultHeight(QTextEngine *eng);
void operator+=(const QScriptLine &other);
};
@@ -400,6 +415,7 @@ public:
};
struct ItemDecoration {
+ ItemDecoration() {} // for QVector, don't use
ItemDecoration(qreal x1, qreal x2, qreal y, const QPen &pen):
x1(x1), x2(x2), y(y), pen(pen) {}
@@ -409,7 +425,7 @@ public:
QPen pen;
};
- typedef QList<ItemDecoration> ItemDecorationList;
+ typedef QVector<ItemDecoration> ItemDecorationList;
QTextEngine();
QTextEngine(const QString &str, const QFont &f);
@@ -496,7 +512,7 @@ public:
void freeMemory();
- int findItem(int strPos) const;
+ int findItem(int strPos, int firstItem = 0) const;
inline QTextFormatCollection *formatCollection() const {
if (block.docHandle())
return block.docHandle()->formatCollection();
@@ -570,9 +586,9 @@ public:
inline bool hasFormats() const
{ return block.docHandle() || (specialData && !specialData->formats.isEmpty()); }
- inline QList<QTextLayout::FormatRange> formats() const
- { return specialData ? specialData->formats : QList<QTextLayout::FormatRange>(); }
- void setFormats(const QList<QTextLayout::FormatRange> &formats);
+ inline QVector<QTextLayout::FormatRange> formats() const
+ { return specialData ? specialData->formats : QVector<QTextLayout::FormatRange>(); }
+ void setFormats(const QVector<QTextLayout::FormatRange> &formats);
private:
static void init(QTextEngine *e);
@@ -580,7 +596,7 @@ private:
struct SpecialData {
int preeditPosition;
QString preeditText;
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QVector<QTextCharFormat> resolvedFormats;
// only used when no docHandle is available
QScopedPointer<QTextFormatCollection> formatCollection;
@@ -643,6 +659,7 @@ public:
LayoutData _layoutData;
void *_memory[MemSize];
};
+Q_DECLARE_TYPEINFO(QTextEngine::ItemDecoration, Q_MOVABLE_TYPE);
struct QTextLineItemIterator
{
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index ba4bdcc5ad..7dcd060ba1 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -38,7 +38,7 @@
#include <qdatastream.h>
#include <qdebug.h>
#include <qmap.h>
-#include <qhash.h>
+#include <qhashfunctions.h>
QT_BEGIN_NAMESPACE
@@ -1115,7 +1115,9 @@ void QTextFormat::setProperty(int propertyId, const QVector<QTextLength> &value)
if (!d)
d = new QTextFormatPrivate;
QVariantList list;
- for (int i=0; i<value.size(); ++i)
+ const int numValues = value.size();
+ list.reserve(numValues);
+ for (int i = 0; i < numValues; ++i)
list << value.at(i);
d->insertProperty(propertyId, list);
}
@@ -2041,6 +2043,7 @@ QTextBlockFormat::QTextBlockFormat(const QTextFormat &fmt)
void QTextBlockFormat::setTabPositions(const QList<QTextOption::Tab> &tabs)
{
QList<QVariant> list;
+ list.reserve(tabs.count());
QList<QTextOption::Tab>::ConstIterator iter = tabs.constBegin();
while (iter != tabs.constEnd()) {
QVariant v;
@@ -2065,6 +2068,7 @@ QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
QList<QTextOption::Tab> answer;
QList<QVariant> variantsList = qvariant_cast<QList<QVariant> >(variant);
QList<QVariant>::Iterator iter = variantsList.begin();
+ answer.reserve(variantsList.count());
while(iter != variantsList.end()) {
answer.append( qvariant_cast<QTextOption::Tab>(*iter));
++iter;
diff --git a/src/gui/text/qtextformat_p.h b/src/gui/text/qtextformat_p.h
index 29656bbafe..928cef6488 100644
--- a/src/gui/text/qtextformat_p.h
+++ b/src/gui/text/qtextformat_p.h
@@ -47,7 +47,6 @@
#include "QtGui/qtextformat.h"
#include "QtCore/qvector.h"
-#include "QtCore/qhash.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp
index e85890baf2..16d81a7d6d 100644
--- a/src/gui/text/qtextimagehandler.cpp
+++ b/src/gui/text/qtextimagehandler.cpp
@@ -44,7 +44,10 @@
QT_BEGIN_NAMESPACE
-static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePixelRatio)
+extern QString qt_findAtNxFile(const QString &baseFileName, qreal targetDevicePixelRatio,
+ qreal *sourceDevicePixelRatio);
+static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePixelRatio,
+ qreal *sourceDevicePixelRatio)
{
// We might use the fileName for loading if url loading fails
// try to make sure it is a valid file path.
@@ -62,19 +65,8 @@ static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePi
if (targetDevicePixelRatio <= 1.0)
return fileName;
- // try to find a 2x version
-
- const int dotIndex = fileName.lastIndexOf(QLatin1Char('.'));
- if (dotIndex != -1) {
- QString at2xfileName = fileName;
- at2xfileName.insert(dotIndex, QStringLiteral("@2x"));
- if (QFile::exists(at2xfileName)) {
- fileName = at2xfileName;
- *url = QUrl(fileName);
- }
- }
-
- return fileName;
+ // try to find a Nx version
+ return qt_findAtNxFile(fileName, targetDevicePixelRatio, sourceDevicePixelRatio);
}
@@ -86,7 +78,8 @@ static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format, con
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources and convert them to url
name.prepend(QLatin1String("qrc"));
QUrl url = QUrl(name);
- name = resolveFileName(name, &url, devicePixelRatio);
+ qreal sourcePixelRatio = 1.0;
+ name = resolveFileName(name, &url, devicePixelRatio, &sourcePixelRatio);
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
if (data.type() == QVariant::Pixmap || data.type() == QVariant::Image) {
pm = qvariant_cast<QPixmap>(data);
@@ -112,7 +105,7 @@ static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format, con
}
if (name.contains(QStringLiteral("@2x")))
- pm.setDevicePixelRatio(2.0);
+ pm.setDevicePixelRatio(sourcePixelRatio);
return pm;
}
@@ -167,7 +160,8 @@ static QImage getImage(QTextDocument *doc, const QTextImageFormat &format, const
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
name.prepend(QLatin1String("qrc"));
QUrl url = QUrl(name);
- name = resolveFileName(name, &url, devicePixelRatio);
+ qreal sourcePixelRatio = 1.0;
+ name = resolveFileName(name, &url, devicePixelRatio, &sourcePixelRatio);
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
if (data.type() == QVariant::Image) {
image = qvariant_cast<QImage>(data);
@@ -191,8 +185,8 @@ static QImage getImage(QTextDocument *doc, const QTextImageFormat &format, const
doc->addResource(QTextDocument::ImageResource, url, image);
}
- if (name.contains(QStringLiteral("@2x")))
- image.setDevicePixelRatio(2.0);
+ if (sourcePixelRatio != 1.0)
+ image.setDevicePixelRatio(sourcePixelRatio);
return image;
}
@@ -256,10 +250,10 @@ void QTextImageHandler::drawObject(QPainter *p, const QRectF &rect, QTextDocumen
const QTextImageFormat imageFormat = format.toImageFormat();
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
- const QImage image = getImage(doc, imageFormat, p->device()->devicePixelRatio());
+ const QImage image = getImage(doc, imageFormat, p->device()->devicePixelRatioF());
p->drawImage(rect, image, image.rect());
} else {
- const QPixmap pixmap = getPixmap(doc, imageFormat, p->device()->devicePixelRatio());
+ const QPixmap pixmap = getPixmap(doc, imageFormat, p->device()->devicePixelRatioF());
p->drawPixmap(rect, pixmap, pixmap.rect());
}
}
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 013cd8ae0f..65650504ac 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
for a specified area in the text layout's content.
\inmodule QtGui
- \sa QTextLayout::setAdditionalFormats(), QTextLayout::draw()
+ \sa QTextLayout::setFormats(), QTextLayout::draw()
*/
/*!
@@ -87,6 +87,20 @@ QT_BEGIN_NAMESPACE
Specifies the format to apply.
*/
+/*! \fn bool operator==(const FormatRange &lhs, const FormatRange &rhs)
+ \relates QTextLayout::FormatRange
+
+ Returns true if the \c {start}, \c {length}, and \c {format} fields
+ in \a lhs and \a rhs contain the same values respectively.
+ */
+
+/*! \fn bool operator!=(const FormatRange &lhs, const FormatRange &rhs)
+ \relates QTextLayout::FormatRange
+
+ Returns true if any of the \c {start}, \c {length}, or \c {format} fields
+ in \a lhs and \a rhs contain different values respectively.
+ */
+
/*!
\class QTextInlineObject
\reentrant
@@ -485,39 +499,76 @@ QString QTextLayout::preeditAreaText() const
return d->preeditAreaText();
}
+#if QT_DEPRECATED_SINCE(5, 6)
+/*!
+ \obsolete Use setFormats() instead.
+*/
+void QTextLayout::setAdditionalFormats(const QList<FormatRange> &formatList)
+{
+ setFormats(formatList.toVector());
+}
+#endif // deprecated since 5.6
/*!
- Sets the additional formats supported by the text layout to \a formatList.
+ \since 5.6
+
+ Sets the additional formats supported by the text layout to \a formats.
The formats are applied with preedit area text in place.
- \sa additionalFormats(), clearAdditionalFormats()
+ \sa formats(), clearFormats()
*/
-void QTextLayout::setAdditionalFormats(const QList<FormatRange> &formatList)
+void QTextLayout::setFormats(const QVector<FormatRange> &formats)
{
- d->setFormats(formatList);
+ d->setFormats(formats);
if (d->block.docHandle())
d->block.docHandle()->documentChange(d->block.position(), d->block.length());
}
+#if QT_DEPRECATED_SINCE(5, 6)
/*!
- Returns the list of additional formats supported by the text layout.
+ \obsolete Use formats() instead.
\sa setAdditionalFormats(), clearAdditionalFormats()
*/
QList<QTextLayout::FormatRange> QTextLayout::additionalFormats() const
{
+ return formats().toList();
+}
+#endif // deprecated since 5.6
+
+/*!
+ \since 5.6
+
+ Returns the list of additional formats supported by the text layout.
+
+ \sa setFormats(), clearFormats()
+*/
+QVector<QTextLayout::FormatRange> QTextLayout::formats() const
+{
return d->formats();
}
+#if QT_DEPRECATED_SINCE(5, 6)
/*!
+ \obsolete Use clearFormats() instead.
+*/
+void QTextLayout::clearAdditionalFormats()
+{
+ clearFormats();
+}
+#endif // deprecated since 5.6
+
+/*!
+ \since 5.6
+
Clears the list of additional formats supported by the text layout.
- \sa additionalFormats(), setAdditionalFormats()
+ \sa formats(), setFormats()
*/
-void QTextLayout::clearAdditionalFormats()
+void QTextLayout::clearFormats()
{
- setAdditionalFormats(QList<FormatRange>());
+ setFormats(QVector<FormatRange>());
}
/*!
@@ -1915,9 +1966,16 @@ void QTextLine::layout_helper(int maxGlyphs)
// end up breaking due to the current glyph being too wide.
QFixed previousRightBearing = lbh.rightBearing;
- // We ignore the right bearing if the minimum negative bearing is too little to
- // expand the text beyond the edge.
- if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width)
+ // We skip calculating the right bearing if the minimum negative bearing is too
+ // small to possibly expand the text beyond the edge. Note that this optimization
+ // will in some cases fail, as the minimum right bearing reported by the font
+ // engine may not cover all the glyphs in the font. The result is that we think
+ // we don't need to break at the current glyph (because the right bearing is 0),
+ // and when we then end up breaking on the next glyph we compute the right bearing
+ // and end up with a line width that is slightly larger width than what was requested.
+ // Unfortunately we can't remove this optimization as it will slow down text
+ // layouting significantly, so we accept the slight correctnes issue.
+ if ((lbh.calculateNewWidth(line) + qAbs(lbh.minimumRightBearing)) > line.width)
lbh.calculateRightBearing();
if (lbh.checkFullOtherwiseExtend(line)) {
@@ -2559,33 +2617,31 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
inside the line, taking account of the \a edge.
If \a cursorPos is not a valid cursor position, the nearest valid
- cursor position will be used instead, and cpos will be modified to
+ cursor position will be used instead, and \a cursorPos will be modified to
point to this valid cursor position.
\sa xToCursor()
*/
qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
{
- if (!eng->layoutData)
- eng->itemize();
-
const QScriptLine &line = eng->lines[index];
bool lastLine = index >= eng->lines.size() - 1;
- QFixed x = line.x;
- x += eng->alignLine(line) - eng->leadingSpaceWidth(line);
+ QFixed x = line.x + eng->alignLine(line) - eng->leadingSpaceWidth(line);
- if (!index && !eng->layoutData->items.size()) {
- *cursorPos = 0;
+ if (!eng->layoutData)
+ eng->itemize();
+ if (!eng->layoutData->items.size()) {
+ *cursorPos = line.from;
return x.toReal();
}
int lineEnd = line.from + line.length + line.trailingSpaces;
- int pos = qBound(0, *cursorPos, lineEnd);
+ int pos = qBound(line.from, *cursorPos, lineEnd);
int itm;
const QCharAttributes *attributes = eng->attributes();
if (!attributes) {
- *cursorPos = 0;
+ *cursorPos = line.from;
return x.toReal();
}
while (pos < lineEnd && !attributes[pos].graphemeBoundary)
@@ -2597,7 +2653,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
else
itm = eng->findItem(pos);
if (itm < 0) {
- *cursorPos = 0;
+ *cursorPos = line.from;
return x.toReal();
}
eng->shapeLine(line);
@@ -2605,18 +2661,14 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
const QScriptItem *si = &eng->layoutData->items[itm];
if (!si->num_glyphs)
eng->shape(itm);
- pos -= si->position;
+
+ const int l = eng->length(itm);
+ pos = qBound(0, pos - si->position, l);
QGlyphLayout glyphs = eng->shapedGlyphs(si);
unsigned short *logClusters = eng->logClusters(si);
Q_ASSERT(logClusters);
- int l = eng->length(itm);
- if (pos > l)
- pos = l;
- if (pos < 0)
- pos = 0;
-
int glyph_pos = pos == l ? si->num_glyphs : logClusters[pos];
if (edge == Trailing && glyph_pos < si->num_glyphs) {
// trailing edge is leading edge of next cluster
@@ -2625,13 +2677,13 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
glyph_pos++;
}
- bool reverse = eng->layoutData->items[itm].analysis.bidiLevel % 2;
+ bool reverse = si->analysis.bidiLevel % 2;
// add the items left of the cursor
int firstItem = eng->findItem(line.from);
- int lastItem = eng->findItem(lineEnd - 1);
+ int lastItem = eng->findItem(lineEnd - 1, itm);
int nItems = (firstItem >= 0 && lastItem >= firstItem)? (lastItem-firstItem+1) : 0;
QVarLengthArray<int> visualOrder(nItems);
@@ -2652,13 +2704,15 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
x += si.width;
continue;
}
+
+ const int itemLength = eng->length(item);
int start = qMax(line.from, si.position);
- int end = qMin(lineEnd, si.position + eng->length(item));
+ int end = qMin(lineEnd, si.position + itemLength);
logClusters = eng->logClusters(&si);
int gs = logClusters[start-si.position];
- int ge = (end == si.position + eng->length(item)) ? si.num_glyphs-1 : logClusters[end-si.position-1];
+ int ge = (end == si.position + itemLength) ? si.num_glyphs-1 : logClusters[end-si.position-1];
QGlyphLayout glyphs = eng->shapedGlyphs(&si);
@@ -2730,7 +2784,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
return line.from;
int firstItem = eng->findItem(line.from);
- int lastItem = eng->findItem(line.from + line_length - 1);
+ int lastItem = eng->findItem(line.from + line_length - 1, firstItem);
int nItems = (firstItem >= 0 && lastItem >= firstItem)? (lastItem-firstItem+1) : 0;
if (!nItems)
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index 47dcd388e2..f74d4d4229 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -62,7 +62,7 @@ class Q_GUI_EXPORT QTextInlineObject
{
public:
QTextInlineObject(int i, QTextEngine *e) : itm(i), eng(e) {}
- inline QTextInlineObject() : itm(0), eng(0) {}
+ inline QTextInlineObject() : itm(0), eng(Q_NULLPTR) {}
inline bool isValid() const { return eng; }
QRectF rect() const;
@@ -100,7 +100,7 @@ public:
// does itemization
QTextLayout();
QTextLayout(const QString& text);
- QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = 0);
+ QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = Q_NULLPTR);
QTextLayout(const QTextBlock &b);
~QTextLayout();
@@ -125,10 +125,20 @@ public:
int start;
int length;
QTextCharFormat format;
+
+ friend bool operator==(const FormatRange &lhs, const FormatRange &rhs)
+ { return lhs.start == rhs.start && lhs.length == rhs.length && lhs.format == rhs.format; }
+ friend bool operator!=(const FormatRange &lhs, const FormatRange &rhs)
+ { return !operator==(lhs, rhs); }
};
- void setAdditionalFormats(const QList<FormatRange> &overrides);
- QList<FormatRange> additionalFormats() const;
- void clearAdditionalFormats();
+#if QT_DEPRECATED_SINCE(5, 6)
+ QT_DEPRECATED_X("Use setFormats()") void setAdditionalFormats(const QList<FormatRange> &overrides);
+ QT_DEPRECATED_X("Use formats()") QList<FormatRange> additionalFormats() const;
+ QT_DEPRECATED_X("Use clearFormats()") void clearAdditionalFormats();
+#endif
+ void setFormats(const QVector<FormatRange> &overrides);
+ QVector<FormatRange> formats() const;
+ void clearFormats();
void setCacheEnabled(bool enable);
bool cacheEnabled() const;
@@ -192,7 +202,7 @@ private:
class Q_GUI_EXPORT QTextLine
{
public:
- inline QTextLine() : index(0), eng(0) {}
+ inline QTextLine() : index(0), eng(Q_NULLPTR) {}
inline bool isValid() const { return eng; }
QRectF rect() const;
@@ -237,7 +247,7 @@ public:
int lineNumber() const { return index; }
- void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = 0) const;
+ void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = Q_NULLPTR) const;
#if !defined(QT_NO_RAWFONT)
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 9ad912d992..fbb90e42b0 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -190,7 +190,7 @@ class Q_GUI_EXPORT QTextBlock
friend class QSyntaxHighlighter;
public:
inline QTextBlock(QTextDocumentPrivate *priv, int b) : p(priv), n(b) {}
- inline QTextBlock() : p(0), n(0) {}
+ inline QTextBlock() : p(Q_NULLPTR), n(0) {}
inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
@@ -247,7 +247,7 @@ public:
friend class QTextBlock;
iterator(const QTextDocumentPrivate *priv, int begin, int end, int f) : p(priv), b(begin), e(end), n(f) {}
public:
- iterator() : p(0), b(0), e(0), n(0) {}
+ iterator() : p(Q_NULLPTR), b(0), e(0), n(0) {}
iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {}
QTextFragment fragment() const;
@@ -289,7 +289,7 @@ class Q_GUI_EXPORT QTextFragment
{
public:
inline QTextFragment(const QTextDocumentPrivate *priv, int f, int fe) : p(priv), n(f), ne(fe) {}
- inline QTextFragment() : p(0), n(0), ne(0) {}
+ inline QTextFragment() : p(Q_NULLPTR), n(0), ne(0) {}
inline QTextFragment(const QTextFragment &o) : p(o.p), n(o.n), ne(o.ne) {}
inline QTextFragment &operator=(const QTextFragment &o) { p = o.p; n = o.n; ne = o.ne; return *this; }
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 6b17a264b1..1fd20cfbef 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -279,6 +279,12 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1")
.arg(block.blockFormatIndex()));
for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) {
+ bool isHyperlink = frag.fragment().charFormat().hasProperty(QTextFormat::AnchorHref);
+ if (isHyperlink) {
+ QString value = frag.fragment().charFormat().property(QTextFormat::AnchorHref).toString();
+ writer.writeStartElement(textNS, QString::fromLatin1("a"));
+ writer.writeAttribute(xlinkNS, QString::fromLatin1("href"), value);
+ }
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it.
writer.writeStartElement(textNS, QString::fromLatin1("span"));
@@ -335,6 +341,9 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
writer.writeCharacters(fragmentText.mid(exportedIndex));
writer.writeEndElement(); // span
+ writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it.
+ if (isHyperlink)
+ writer.writeEndElement(); // a
}
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it.
writer.writeEndElement(); // p
@@ -396,7 +405,7 @@ void QTextOdfWriter::writeInlineCharacter(QXmlStreamWriter &writer, const QTextF
writer.writeEndElement(); // frame
}
-void QTextOdfWriter::writeFormats(QXmlStreamWriter &writer, QSet<int> formats) const
+void QTextOdfWriter::writeFormats(QXmlStreamWriter &writer, const QSet<int> &formats) const
{
writer.writeStartElement(officeNS, QString::fromLatin1("automatic-styles"));
QVector<QTextFormat> allStyles = m_document->allFormats();
diff --git a/src/gui/text/qtextodfwriter_p.h b/src/gui/text/qtextodfwriter_p.h
index 20805a8d27..15a4b40796 100644
--- a/src/gui/text/qtextodfwriter_p.h
+++ b/src/gui/text/qtextodfwriter_p.h
@@ -83,7 +83,7 @@ public:
bool createArchive() const { return m_createArchive; }
void writeBlock(QXmlStreamWriter &writer, const QTextBlock &block);
- void writeFormats(QXmlStreamWriter &writer, QSet<int> formatIds) const;
+ void writeFormats(QXmlStreamWriter &writer, const QSet<int> &formatIds) const;
void writeBlockFormat(QXmlStreamWriter &writer, QTextBlockFormat format, int formatIndex) const;
void writeCharacterFormat(QXmlStreamWriter &writer, QTextCharFormat format, int formatIndex) const;
void writeListFormat(QXmlStreamWriter &writer, QTextListFormat format, int formatIndex) const;
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index dbafcfd58e..5a4f6b7954 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -146,6 +146,7 @@ void QTextOption::setTabArray(const QList<qreal> &tabStops)
d = new QTextOptionPrivate;
QList<QTextOption::Tab> tabs;
QTextOption::Tab tab;
+ tabs.reserve(tabStops.count());
foreach (qreal pos, tabStops) {
tab.position = pos;
tabs.append(tab);
@@ -174,10 +175,11 @@ void QTextOption::setTabs(const QList<QTextOption::Tab> &tabStops)
*/
QList<qreal> QTextOption::tabArray() const
{
+ QList<qreal> answer;
if (!d)
- return QList<qreal>();
+ return answer;
- QList<qreal> answer;
+ answer.reserve(d->tabStops.count());
QList<QTextOption::Tab>::ConstIterator iter = d->tabStops.constBegin();
while(iter != d->tabStops.constEnd()) {
answer.append( (*iter).position);
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index a75a1aae54..454d3440d6 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -986,8 +986,8 @@ void QTextTable::removeColumns(int pos, int num)
Merges the cell at the specified \a row and \a column with the adjacent cells
into one cell. The new cell will span \a numRows rows and \a numCols columns.
- If \a numRows or \a numCols is less than the current number of rows or columns
- the cell spans then this method does nothing.
+ This method does nothing if \a numRows or \a numCols is less than the current
+ number of rows or columns spanned by the cell.
\sa splitCell()
*/
diff --git a/src/gui/text/qtexttable.h b/src/gui/text/qtexttable.h
index 6ceb1fdd0f..4ff7d19e85 100644
--- a/src/gui/text/qtexttable.h
+++ b/src/gui/text/qtexttable.h
@@ -48,7 +48,7 @@ class QTextTablePrivate;
class Q_GUI_EXPORT QTextTableCell
{
public:
- QTextTableCell() : table(0) {}
+ QTextTableCell() : table(Q_NULLPTR) {}
~QTextTableCell() {}
QTextTableCell(const QTextTableCell &o) : table(o.table), fragment(o.fragment) {}
QTextTableCell &operator=(const QTextTableCell &o)
@@ -63,7 +63,7 @@ public:
int rowSpan() const;
int columnSpan() const;
- inline bool isValid() const { return table != 0; }
+ inline bool isValid() const { return table != Q_NULLPTR; }
QTextCursor firstCursorPosition() const;
QTextCursor lastCursorPosition() const;
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index 1d621db0e6..31ef8f87be 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -243,11 +243,11 @@ static QFile::Permissions modeToPermissions(quint32 mode)
static quint32 permissionsToMode(QFile::Permissions perms)
{
quint32 mode = 0;
- if (mode & (QFile::ReadOwner | QFile::ReadUser))
+ if (perms & (QFile::ReadOwner | QFile::ReadUser))
mode |= UnixFileAttributes::ReadUser;
- if (mode & (QFile::WriteOwner | QFile::WriteUser))
+ if (perms & (QFile::WriteOwner | QFile::WriteUser))
mode |= UnixFileAttributes::WriteUser;
- if (mode & (QFile::ExeOwner | QFile::ExeUser))
+ if (perms & (QFile::ExeOwner | QFile::ExeUser))
mode |= UnixFileAttributes::WriteUser;
if (perms & QFile::ReadGroup)
mode |= UnixFileAttributes::ReadGroup;
@@ -303,6 +303,7 @@ enum HostOS {
HostOS400 = 18,
HostOSX = 19
};
+Q_DECLARE_TYPEINFO(HostOS, Q_PRIMITIVE_TYPE);
enum GeneralPurposeFlag {
Encrypted = 0x01,
@@ -314,6 +315,7 @@ enum GeneralPurposeFlag {
Utf8Names = 0x0800,
CentralDirectoryEncrypted = 0x2000
};
+Q_DECLARE_TYPEINFO(GeneralPurposeFlag, Q_PRIMITIVE_TYPE);
enum CompressionMethod {
CompressionMethodStored = 0,
@@ -340,6 +342,7 @@ enum CompressionMethod {
CompressionMethodPPMd = 98,
CompressionMethodWzAES = 99
};
+Q_DECLARE_TYPEINFO(CompressionMethod, Q_PRIMITIVE_TYPE);
struct LocalFileHeader
{
@@ -354,6 +357,7 @@ struct LocalFileHeader
uchar file_name_length[2];
uchar extra_field_length[2];
};
+Q_DECLARE_TYPEINFO(LocalFileHeader, Q_PRIMITIVE_TYPE);
struct DataDescriptor
{
@@ -361,6 +365,7 @@ struct DataDescriptor
uchar compressed_size[4];
uchar uncompressed_size[4];
};
+Q_DECLARE_TYPEINFO(DataDescriptor, Q_PRIMITIVE_TYPE);
struct CentralFileHeader
{
@@ -382,6 +387,7 @@ struct CentralFileHeader
uchar offset_local_header[4];
LocalFileHeader toLocalHeader() const;
};
+Q_DECLARE_TYPEINFO(CentralFileHeader, Q_PRIMITIVE_TYPE);
struct EndOfDirectory
{
@@ -394,6 +400,7 @@ struct EndOfDirectory
uchar dir_start_offset[4];
uchar comment_length[2];
};
+Q_DECLARE_TYPEINFO(EndOfDirectory, Q_PRIMITIVE_TYPE);
struct FileHeader
{
@@ -402,38 +409,7 @@ struct FileHeader
QByteArray extra_field;
QByteArray file_comment;
};
-
-QZipReader::FileInfo::FileInfo()
- : isDir(false), isFile(false), isSymLink(false), crc(0), size(0)
-{
-}
-
-QZipReader::FileInfo::~FileInfo()
-{
-}
-
-QZipReader::FileInfo::FileInfo(const FileInfo &other)
-{
- operator=(other);
-}
-
-QZipReader::FileInfo& QZipReader::FileInfo::operator=(const FileInfo &other)
-{
- filePath = other.filePath;
- isDir = other.isDir;
- isFile = other.isFile;
- isSymLink = other.isSymLink;
- permissions = other.permissions;
- crc = other.crc;
- size = other.size;
- lastModified = other.lastModified;
- return *this;
-}
-
-bool QZipReader::FileInfo::isValid() const
-{
- return isDir || isFile || isSymLink;
-}
+Q_DECLARE_TYPEINFO(FileHeader, Q_MOVABLE_TYPE);
class QZipPrivate
{
@@ -449,18 +425,19 @@ public:
delete device;
}
- void fillFileInfo(int index, QZipReader::FileInfo &fileInfo) const;
+ QZipReader::FileInfo fillFileInfo(int index) const;
QIODevice *device;
bool ownDevice;
bool dirtyFileTree;
- QList<FileHeader> fileHeaders;
+ QVector<FileHeader> fileHeaders;
QByteArray comment;
uint start_of_directory;
};
-void QZipPrivate::fillFileInfo(int index, QZipReader::FileInfo &fileInfo) const
+QZipReader::FileInfo QZipPrivate::fillFileInfo(int index) const
{
+ QZipReader::FileInfo fileInfo;
FileHeader header = fileHeaders.at(index);
quint32 mode = readUInt(header.h.external_file_attributes);
const HostOS hostOS = HostOS(readUShort(header.h.version_made) >> 8);
@@ -502,7 +479,7 @@ void QZipPrivate::fillFileInfo(int index, QZipReader::FileInfo &fileInfo) const
break;
default:
qWarning("QZip: Zip entry format at %d is not supported.", index);
- return; // we don't support anything else
+ return fileInfo; // we don't support anything else
}
ushort general_purpose_bits = readUShort(header.h.general_purpose_bits);
@@ -519,6 +496,8 @@ void QZipPrivate::fillFileInfo(int index, QZipReader::FileInfo &fileInfo) const
fileInfo.filePath = fileInfo.filePath.mid(1);
while (!fileInfo.filePath.isEmpty() && fileInfo.filePath.at(fileInfo.filePath.size() - 1) == QLatin1Char('/'))
fileInfo.filePath.chop(1);
+
+ return fileInfo;
}
class QZipReaderPrivate : public QZipPrivate
@@ -816,12 +795,6 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const
*/
/*!
- \variable FileInfo::d
- \internal
- private pointer.
-*/
-
-/*!
\class QZipReader
\internal
\since 4.5
@@ -913,15 +886,14 @@ bool QZipReader::exists() const
/*!
Returns the list of files the archive contains.
*/
-QList<QZipReader::FileInfo> QZipReader::fileInfoList() const
+QVector<QZipReader::FileInfo> QZipReader::fileInfoList() const
{
d->scanFiles();
- QList<QZipReader::FileInfo> files;
- for (int i = 0; i < d->fileHeaders.size(); ++i) {
- QZipReader::FileInfo fi;
- d->fillFileInfo(i, fi);
- files.append(fi);
- }
+ QVector<FileInfo> files;
+ const int numFileHeaders = d->fileHeaders.size();
+ files.reserve(numFileHeaders);
+ for (int i = 0; i < numFileHeaders; ++i)
+ files.append(d->fillFileInfo(i));
return files;
}
@@ -945,10 +917,9 @@ int QZipReader::count() const
QZipReader::FileInfo QZipReader::entryInfoAt(int index) const
{
d->scanFiles();
- QZipReader::FileInfo fi;
if (index >= 0 && index < d->fileHeaders.count())
- d->fillFileInfo(index, fi);
- return fi;
+ return d->fillFileInfo(index);
+ return QZipReader::FileInfo();
}
/*!
@@ -1044,7 +1015,7 @@ bool QZipReader::extractAll(const QString &destinationDir) const
QDir baseDir(destinationDir);
// create directories first
- QList<FileInfo> allFiles = fileInfoList();
+ const QVector<FileInfo> allFiles = fileInfoList();
foreach (const FileInfo &fi, allFiles) {
const QString absPath = destinationDir + QDir::separator() + fi.filePath;
if (fi.isDir) {
diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h
index df7e2d26e9..7f26bfb184 100644
--- a/src/gui/text/qzipreader_p.h
+++ b/src/gui/text/qzipreader_p.h
@@ -70,13 +70,14 @@ public:
bool isReadable() const;
bool exists() const;
- struct Q_GUI_EXPORT FileInfo
+ struct FileInfo
{
- FileInfo();
- FileInfo(const FileInfo &other);
- ~FileInfo();
- FileInfo &operator=(const FileInfo &other);
- bool isValid() const;
+ FileInfo() Q_DECL_NOTHROW
+ : isDir(false), isFile(false), isSymLink(false), crc(0), size(0)
+ {}
+
+ bool isValid() const Q_DECL_NOTHROW { return isDir || isFile || isSymLink; }
+
QString filePath;
uint isDir : 1;
uint isFile : 1;
@@ -85,10 +86,9 @@ public:
uint crc;
qint64 size;
QDateTime lastModified;
- void *d;
};
- QList<FileInfo> fileInfoList() const;
+ QVector<FileInfo> fileInfoList() const;
int count() const;
FileInfo entryInfoAt(int index) const;
@@ -111,6 +111,8 @@ private:
QZipReaderPrivate *d;
Q_DISABLE_COPY(QZipReader)
};
+Q_DECLARE_TYPEINFO(QZipReader::FileInfo, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QZipReader::Status, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index 61e239f678..be60ba72cc 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -21,6 +21,7 @@ HEADERS += \
text/qtextdocument_p.h \
text/qtexthtmlparser_p.h \
text/qabstracttextdocumentlayout.h \
+ text/qabstracttextdocumentlayout_p.h \
text/qtextdocumentlayout_p.h \
text/qtextcursor.h \
text/qtextcursor_p.h \
@@ -47,6 +48,7 @@ HEADERS += \
SOURCES += \
text/qfont.cpp \
text/qfontengine.cpp \
+ text/qfontengineglyphcache.cpp \
text/qfontsubset.cpp \
text/qfontmetrics.cpp \
text/qfontdatabase.cpp \
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 4c92e5d000..70daf55b61 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -197,7 +197,7 @@ bool QDesktopServices::openUrl(const QUrl &url)
QPlatformServices *platformServices = platformIntegration->services();
if (!platformServices) {
- qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO);
+ qWarning("The platform plugin does not support services.");
return false;
}
return url.scheme() == QLatin1String("file") ?
@@ -231,13 +231,13 @@ void QDesktopServices::setUrlHandler(const QString &scheme, QObject *receiver, c
QOpenUrlHandlerRegistry *registry = handlerRegistry();
QMutexLocker locker(&registry->mutex);
if (!receiver) {
- registry->handlers.remove(scheme);
+ registry->handlers.remove(scheme.toLower());
return;
}
QOpenUrlHandlerRegistry::Handler h;
h.receiver = receiver;
h.name = method;
- registry->handlers.insert(scheme, h);
+ registry->handlers.insert(scheme.toLower(), h);
QObject::connect(receiver, SIGNAL(destroyed(QObject*)),
registry, SLOT(handlerDestroyed(QObject*)));
}
diff --git a/src/gui/util/qvalidator.h b/src/gui/util/qvalidator.h
index 0435e4e9ff..a979a268aa 100644
--- a/src/gui/util/qvalidator.h
+++ b/src/gui/util/qvalidator.h
@@ -52,7 +52,7 @@ class Q_GUI_EXPORT QValidator : public QObject
{
Q_OBJECT
public:
- explicit QValidator(QObject * parent = 0);
+ explicit QValidator(QObject * parent = Q_NULLPTR);
~QValidator();
enum State {
@@ -86,8 +86,8 @@ class Q_GUI_EXPORT QIntValidator : public QValidator
Q_PROPERTY(int top READ top WRITE setTop NOTIFY topChanged)
public:
- explicit QIntValidator(QObject * parent = 0);
- QIntValidator(int bottom, int top, QObject *parent = 0);
+ explicit QIntValidator(QObject * parent = Q_NULLPTR);
+ QIntValidator(int bottom, int top, QObject *parent = Q_NULLPTR);
~QIntValidator();
QValidator::State validate(QString &, int &) const Q_DECL_OVERRIDE;
@@ -123,8 +123,8 @@ class Q_GUI_EXPORT QDoubleValidator : public QValidator
Q_PROPERTY(Notation notation READ notation WRITE setNotation NOTIFY notationChanged)
public:
- explicit QDoubleValidator(QObject * parent = 0);
- QDoubleValidator(double bottom, double top, int decimals, QObject *parent = 0);
+ explicit QDoubleValidator(QObject * parent = Q_NULLPTR);
+ QDoubleValidator(double bottom, double top, int decimals, QObject *parent = Q_NULLPTR);
~QDoubleValidator();
enum Notation {
@@ -167,8 +167,8 @@ class Q_GUI_EXPORT QRegExpValidator : public QValidator
Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp NOTIFY regExpChanged)
public:
- explicit QRegExpValidator(QObject *parent = 0);
- explicit QRegExpValidator(const QRegExp& rx, QObject *parent = 0);
+ explicit QRegExpValidator(QObject *parent = Q_NULLPTR);
+ explicit QRegExpValidator(const QRegExp& rx, QObject *parent = Q_NULLPTR);
~QRegExpValidator();
virtual QValidator::State validate(QString& input, int& pos) const Q_DECL_OVERRIDE;
@@ -197,8 +197,8 @@ class Q_GUI_EXPORT QRegularExpressionValidator : public QValidator
Q_PROPERTY(QRegularExpression regularExpression READ regularExpression WRITE setRegularExpression NOTIFY regularExpressionChanged)
public:
- explicit QRegularExpressionValidator(QObject *parent = 0);
- explicit QRegularExpressionValidator(const QRegularExpression &re, QObject *parent = 0);
+ explicit QRegularExpressionValidator(QObject *parent = Q_NULLPTR);
+ explicit QRegularExpressionValidator(const QRegularExpression &re, QObject *parent = Q_NULLPTR);
~QRegularExpressionValidator();
virtual QValidator::State validate(QString &input, int &pos) const Q_DECL_OVERRIDE;
diff --git a/src/network/access/qabstractnetworkcache.h b/src/network/access/qabstractnetworkcache.h
index 352daa9700..326891b3dc 100644
--- a/src/network/access/qabstractnetworkcache.h
+++ b/src/network/access/qabstractnetworkcache.h
@@ -60,9 +60,12 @@ public:
QNetworkCacheMetaData(const QNetworkCacheMetaData &other);
~QNetworkCacheMetaData();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkCacheMetaData &operator=(QNetworkCacheMetaData &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkCacheMetaData &operator=(const QNetworkCacheMetaData &other);
- void swap(QNetworkCacheMetaData &other)
+ void swap(QNetworkCacheMetaData &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
bool operator==(const QNetworkCacheMetaData &other) const;
@@ -121,7 +124,7 @@ public Q_SLOTS:
virtual void clear() = 0;
protected:
- explicit QAbstractNetworkCache(QObject *parent = 0);
+ explicit QAbstractNetworkCache(QObject *parent = Q_NULLPTR);
QAbstractNetworkCache(QAbstractNetworkCachePrivate &dd, QObject *parent);
private:
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index a83d56f31f..74c95ecd5e 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -46,7 +46,6 @@
#include "qregexp.h"
#include "qtimer.h"
#include "qfileinfo.h"
-#include "qhash.h"
#include "qtcpserver.h"
#include "qlocale.h"
diff --git a/src/network/access/qhttpmultipart.h b/src/network/access/qhttpmultipart.h
index 2e08a3d6f8..5f865c059b 100644
--- a/src/network/access/qhttpmultipart.h
+++ b/src/network/access/qhttpmultipart.h
@@ -51,9 +51,12 @@ public:
QHttpPart();
QHttpPart(const QHttpPart &other);
~QHttpPart();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QHttpPart &operator=(QHttpPart &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QHttpPart &operator=(const QHttpPart &other);
- void swap(QHttpPart &other) { qSwap(d, other.d); }
+ void swap(QHttpPart &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QHttpPart &other) const;
inline bool operator!=(const QHttpPart &other) const
@@ -88,8 +91,8 @@ public:
AlternativeType
};
- explicit QHttpMultiPart(QObject *parent = 0);
- explicit QHttpMultiPart(ContentType contentType, QObject *parent = 0);
+ explicit QHttpMultiPart(QObject *parent = Q_NULLPTR);
+ explicit QHttpMultiPart(ContentType contentType, QObject *parent = Q_NULLPTR);
~QHttpMultiPart();
void append(const QHttpPart &httpPart);
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index f810df5711..c4cb8e65c0 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -326,7 +326,7 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair)
QByteArray host;
if (add.setAddress(hostName)) {
if (add.protocol() == QAbstractSocket::IPv6Protocol)
- host = "[" + hostName.toLatin1() + "]";//format the ipv6 in the standard way
+ host = '[' + hostName.toLatin1() + ']'; //format the ipv6 in the standard way
else
host = hostName.toLatin1();
@@ -506,6 +506,53 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
return false;
}
+QUrl QHttpNetworkConnectionPrivate::parseRedirectResponse(QAbstractSocket *socket, QHttpNetworkReply *reply)
+{
+ if (!reply->request().isFollowRedirects())
+ return QUrl();
+
+ QUrl rUrl;
+ QList<QPair<QByteArray, QByteArray> > fields = reply->header();
+ foreach (const QNetworkReply::RawHeaderPair &header, fields) {
+ if (header.first.toLower() == "location") {
+ rUrl = QUrl::fromEncoded(header.second);
+ break;
+ }
+ }
+
+ // If the location url is invalid/empty, we emit ProtocolUnknownError
+ if (!rUrl.isValid()) {
+ emitReplyError(socket, reply, QNetworkReply::ProtocolUnknownError);
+ return QUrl();
+ }
+
+ // Check if we have exceeded max redirects allowed
+ if (reply->request().redirectCount() <= 0) {
+ emitReplyError(socket, reply, QNetworkReply::TooManyRedirectsError);
+ return QUrl();
+ }
+
+ // Resolve the URL if it's relative
+ if (rUrl.isRelative())
+ rUrl = reply->request().url().resolved(rUrl);
+
+ // Check redirect url protocol
+ QString scheme = rUrl.scheme();
+ if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) {
+ QString previousUrlScheme = reply->request().url().scheme();
+ // Check if we're doing an unsecure redirect (https -> http)
+ if (previousUrlScheme == QLatin1String("https")
+ && scheme == QLatin1String("http")) {
+ emitReplyError(socket, reply, QNetworkReply::InsecureRedirectError);
+ return QUrl();
+ }
+ } else {
+ emitReplyError(socket, reply, QNetworkReply::ProtocolUnknownError);
+ return QUrl();
+ }
+ return rUrl;
+}
+
void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request)
{
Q_ASSERT(socket);
@@ -802,6 +849,12 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e
case QNetworkReply::SslHandshakeFailedError:
errorString = QCoreApplication::translate("QHttp", "SSL handshake failed");
break;
+ case QNetworkReply::TooManyRedirectsError:
+ errorString = QCoreApplication::translate("QHttp", "Too many redirects");
+ break;
+ case QNetworkReply::InsecureRedirectError:
+ errorString = QCoreApplication::translate("QHttp", "Insecure redirect");
+ break;
default:
// all other errors are treated as QNetworkReply::UnknownNetworkError
errorString = extraDetail;
@@ -1394,7 +1447,7 @@ void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpN
// but that does not matter because the signal will ultimately be emitted
// by the QNetworkAccessManager.
Q_ASSERT(chan->spdyRequestsToSend.count() > 0);
- reply = chan->spdyRequestsToSend.values().first().second;
+ reply = chan->spdyRequestsToSend.cbegin().value().second;
} else { // HTTP
#endif // QT_NO_SSL
reply = chan->reply;
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 115eef581e..9af39d416a 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -250,6 +250,7 @@ public:
void emitReplyError(QAbstractSocket *socket, QHttpNetworkReply *reply, QNetworkReply::NetworkError errorCode);
bool handleAuthenticateChallenge(QAbstractSocket *socket, QHttpNetworkReply *reply, bool isProxy, bool &resend);
+ QUrl parseRedirectResponse(QAbstractSocket *socket, QHttpNetworkReply *reply);
#ifndef QT_NO_NETWORKPROXY
QNetworkProxy networkProxy;
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 453a0c71b6..f591abc28b 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -254,6 +254,10 @@ void QHttpNetworkConnectionChannel::handleUnexpectedEOF()
close();
reply->d_func()->errorString = connection->d_func()->errorDetail(QNetworkReply::RemoteHostClosedError, socket);
emit reply->finishedWithError(QNetworkReply::RemoteHostClosedError, reply->d_func()->errorString);
+ reply = 0;
+ if (protocolHandler)
+ protocolHandler->setReply(0);
+ request = QHttpNetworkRequest();
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
} else {
reconnectAttempts--;
@@ -536,6 +540,20 @@ void QHttpNetworkConnectionChannel::handleStatus()
bool resend = false;
switch (statusCode) {
+ case 301:
+ case 302:
+ case 303:
+ case 305:
+ case 307: {
+ // Parse the response headers and get the "location" url
+ QUrl redirectUrl = connection->d_func()->parseRedirectResponse(socket, reply);
+ if (redirectUrl.isValid())
+ reply->setRedirectUrl(redirectUrl);
+
+ if (qobject_cast<QHttpNetworkConnection *>(connection))
+ QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ break;
+ }
case 401: // auth required
case 407: // proxy auth required
if (connection->d_func()->handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend)) {
diff --git a/src/network/access/qhttpnetworkheader.cpp b/src/network/access/qhttpnetworkheader.cpp
index af9f38cdec..cf8259294d 100644
--- a/src/network/access/qhttpnetworkheader.cpp
+++ b/src/network/access/qhttpnetworkheader.cpp
@@ -79,16 +79,8 @@ QByteArray QHttpNetworkHeaderPrivate::headerField(const QByteArray &name, const
QList<QByteArray> allValues = headerFieldValues(name);
if (allValues.isEmpty())
return defaultValue;
-
- QByteArray result;
- bool first = true;
- foreach (const QByteArray &value, allValues) {
- if (!first)
- result += ", ";
- first = false;
- result += value;
- }
- return result;
+ else
+ return allValues.join(", ");
}
QList<QByteArray> QHttpNetworkHeaderPrivate::headerFieldValues(const QByteArray &name) const
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index b744a99f0f..a0f05523e3 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -78,6 +78,23 @@ void QHttpNetworkReply::setUrl(const QUrl &url)
d->url = url;
}
+QUrl QHttpNetworkReply::redirectUrl() const
+{
+ return d_func()->redirectUrl;
+}
+
+void QHttpNetworkReply::setRedirectUrl(const QUrl &url)
+{
+ Q_D(QHttpNetworkReply);
+ d->redirectUrl = url;
+}
+
+bool QHttpNetworkReply::isHttpRedirect(int statusCode)
+{
+ return (statusCode == 301 || statusCode == 302 || statusCode == 303
+ || statusCode == 305 || statusCode == 307);
+}
+
qint64 QHttpNetworkReply::contentLength() const
{
return d_func()->contentLength();
@@ -278,6 +295,11 @@ void QHttpNetworkReply::setSpdyWasUsed(bool spdy)
d_func()->spdyUsed = spdy;
}
+bool QHttpNetworkReply::isRedirecting() const
+{
+ return d_func()->isRedirecting();
+}
+
QHttpNetworkConnection* QHttpNetworkReply::connection()
{
return d_func()->connection;
@@ -921,6 +943,14 @@ qint64 QHttpNetworkReplyPrivate::getChunkSize(QAbstractSocket *socket, qint64 *c
return bytes;
}
+bool QHttpNetworkReplyPrivate::isRedirecting() const
+{
+ // We're in the process of redirecting - if the HTTP status code says so and
+ // followRedirect is switched on
+ return (QHttpNetworkReply::isHttpRedirect(statusCode)
+ && request.isFollowRedirects());
+}
+
bool QHttpNetworkReplyPrivate::shouldEmitSignals()
{
// for 401 & 407 don't emit the data signals. Content along with these
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index 46b6541dfa..e8ed73fdac 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -130,8 +130,15 @@ public:
bool isSpdyUsed() const;
void setSpdyWasUsed(bool spdy);
+ bool isRedirecting() const;
+
QHttpNetworkConnection* connection();
+ QUrl redirectUrl() const;
+ void setRedirectUrl(const QUrl &url);
+
+ static bool isHttpRedirect(int statusCode);
+
#ifndef QT_NO_SSL
QSslConfiguration sslConfiguration() const;
void setSslConfiguration(const QSslConfiguration &config);
@@ -156,6 +163,7 @@ Q_SIGNALS:
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
#endif
void authenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
+ void redirected(const QUrl &url, int httpStatus, int maxRedirectsRemaining);
private:
Q_DECLARE_PRIVATE(QHttpNetworkReply)
friend class QHttpSocketEngine;
@@ -188,6 +196,7 @@ public:
qint64 readReplyBodyChunked(QAbstractSocket *in, QByteDataBuffer *out);
qint64 getChunkSize(QAbstractSocket *in, qint64 *chunkSize);
+ bool isRedirecting() const;
bool shouldEmitSignals();
bool expectContent();
void eraseData();
@@ -249,6 +258,7 @@ public:
bool downstreamLimited;
char* userProvidedDownloadBuffer;
+ QUrl redirectUrl;
#ifndef QT_NO_COMPRESS
z_stream_s *inflateStrm;
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp
index ea1cd3d591..64172fc4fd 100644
--- a/src/network/access/qhttpnetworkrequest.cpp
+++ b/src/network/access/qhttpnetworkrequest.cpp
@@ -42,7 +42,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Oper
QHttpNetworkRequest::Priority pri, const QUrl &newUrl)
: QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0),
autoDecompress(false), pipeliningAllowed(false), spdyAllowed(false),
- withCredentials(true), preConnect(false)
+ withCredentials(true), preConnect(false), followRedirect(false), redirectCount(0)
{
}
@@ -59,6 +59,8 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest
withCredentials = other.withCredentials;
ssl = other.ssl;
preConnect = other.preConnect;
+ followRedirect = other.followRedirect;
+ redirectCount = other.redirectCount;
}
QHttpNetworkRequestPrivate::~QHttpNetworkRequestPrivate()
@@ -217,6 +219,26 @@ void QHttpNetworkRequest::setPreConnect(bool preConnect)
d->preConnect = preConnect;
}
+bool QHttpNetworkRequest::isFollowRedirects() const
+{
+ return d->followRedirect;
+}
+
+void QHttpNetworkRequest::setFollowRedirects(bool followRedirect)
+{
+ d->followRedirect = followRedirect;
+}
+
+int QHttpNetworkRequest::redirectCount() const
+{
+ return d->redirectCount;
+}
+
+void QHttpNetworkRequest::setRedirectCount(int count)
+{
+ d->redirectCount = count;
+}
+
qint64 QHttpNetworkRequest::contentLength() const
{
return d->contentLength();
diff --git a/src/network/access/qhttpnetworkrequest_p.h b/src/network/access/qhttpnetworkrequest_p.h
index d136f22b7d..1add3c6150 100644
--- a/src/network/access/qhttpnetworkrequest_p.h
+++ b/src/network/access/qhttpnetworkrequest_p.h
@@ -118,6 +118,12 @@ public:
bool isPreConnect() const;
void setPreConnect(bool preConnect);
+ bool isFollowRedirects() const;
+ void setFollowRedirects(bool followRedirect);
+
+ int redirectCount() const;
+ void setRedirectCount(int count);
+
void setUploadByteDevice(QNonContiguousByteDevice *bd);
QNonContiguousByteDevice* uploadByteDevice() const;
@@ -154,6 +160,8 @@ public:
bool withCredentials;
bool ssl;
bool preConnect;
+ bool followRedirect;
+ int redirectCount;
};
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index e4931db304..b0e366d2f8 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -492,11 +492,14 @@ void QHttpThreadDelegate::finishedSlot()
if (httpReply->statusCode() >= 400) {
// it's an error reply
QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
- "Error downloading %1 - server replied: %2"));
+ "Error transferring %1 - server replied: %2"));
msg = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase());
emit error(statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()), msg);
}
+ if (httpRequest.isFollowRedirects() && httpReply->isRedirecting())
+ emit redirected(httpReply->redirectUrl(), httpReply->statusCode(), httpReply->request().redirectCount() - 1);
+
emit downloadFinished();
QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);
@@ -515,7 +518,7 @@ void QHttpThreadDelegate::synchronousFinishedSlot()
if (httpReply->statusCode() >= 400) {
// it's an error reply
QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
- "Error downloading %1 - server replied: %2"));
+ "Error transferring %1 - server replied: %2"));
incomingErrorDetail = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase());
incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url());
}
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
index 9573d500ea..784e9c14b8 100644
--- a/src/network/access/qhttpthreaddelegate_p.h
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -139,6 +139,8 @@ signals:
void downloadData(QByteArray);
void error(QNetworkReply::NetworkError, const QString);
void downloadFinished();
+ void redirected(const QUrl &url, int httpStatus, int maxRedirectsRemainig);
+
public slots:
// This are called via QueuedConnection from user thread
void startRequest();
diff --git a/src/network/access/qnetworkaccessauthenticationmanager_p.h b/src/network/access/qnetworkaccessauthenticationmanager_p.h
index 8f06ecb6b7..462827d7fc 100644
--- a/src/network/access/qnetworkaccessauthenticationmanager_p.h
+++ b/src/network/access/qnetworkaccessauthenticationmanager_p.h
@@ -64,7 +64,7 @@ public:
QString domain;
QString user;
QString password;
- bool isNull() {
+ bool isNull() const {
return domain.isNull() && user.isNull() && password.isNull();
}
};
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index 692af1b2fc..321352e045 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -37,7 +37,6 @@
#include "qnetworkrequest.h"
#include "qnetworkreply.h"
#include "qnetworkreply_p.h"
-#include "QtCore/qhash.h"
#include "QtCore/qmutex.h"
#include "QtCore/qstringlist.h"
#include "QtNetwork/private/qnetworksession_p.h"
diff --git a/src/network/access/qnetworkaccesscache.cpp b/src/network/access/qnetworkaccesscache.cpp
index 19316bda75..3d029f118b 100644
--- a/src/network/access/qnetworkaccesscache.cpp
+++ b/src/network/access/qnetworkaccesscache.cpp
@@ -151,7 +151,7 @@ void QNetworkAccessCache::linkEntry(const QByteArray &key)
oldest = node;
}
- node->timestamp = QDateTime::currentDateTime().addSecs(ExpiryTime);
+ node->timestamp = QDateTime::currentDateTimeUtc().addSecs(ExpiryTime);
newest = node;
}
@@ -190,7 +190,7 @@ void QNetworkAccessCache::updateTimer()
if (!oldest)
return;
- int interval = QDateTime::currentDateTime().secsTo(oldest->timestamp);
+ int interval = QDateTime::currentDateTimeUtc().secsTo(oldest->timestamp);
if (interval <= 0) {
interval = 0;
} else {
@@ -216,7 +216,7 @@ bool QNetworkAccessCache::emitEntryReady(Node *node, QObject *target, const char
void QNetworkAccessCache::timerEvent(QTimerEvent *)
{
// expire old items
- QDateTime now = QDateTime::currentDateTime();
+ const QDateTime now = QDateTime::currentDateTimeUtc();
while (oldest && oldest->timestamp < now) {
Node *next = oldest->newer;
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index f9e9513c55..0e5870a235 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -448,7 +448,6 @@ static void ensureInitialized()
QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
: QObject(*new QNetworkAccessManagerPrivate, parent)
{
- Q_D(QNetworkAccessManager);
ensureInitialized();
qRegisterMetaType<QNetworkReply::NetworkError>();
@@ -468,6 +467,7 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
qRegisterMetaType<QSharedPointer<char> >();
#ifndef QT_NO_BEARERMANAGEMENT
+ Q_D(QNetworkAccessManager);
// if a session is required, we track online state through
// the QNetworkSession's signals if a request is already made.
// we need to track current accessibility state by default
@@ -976,7 +976,6 @@ QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccess
else
return NotAccessible;
} else {
- // Network accessibility is either disabled or unknown.
if (d->defaultAccessControl) {
if (d->online)
return d->networkAccessible;
@@ -1161,7 +1160,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
#ifndef QT_NO_BEARERMANAGEMENT
// Return a disabled network reply if network access is disabled.
// Except if the scheme is empty or file://.
- if (!d->networkAccessible && !isLocalFile) {
+ if (d->networkAccessible == NotAccessible && !isLocalFile) {
return new QDisabledNetworkReply(this, req, op);
}
@@ -1704,7 +1703,7 @@ QNetworkRequest QNetworkAccessManagerPrivate::prepareMultipart(const QNetworkReq
break;
}
// putting the boundary into quotes, recommended in RFC 2046 section 5.1.1
- contentType += "; boundary=\"" + multiPart->d_func()->boundary + "\"";
+ contentType += "; boundary=\"" + multiPart->d_func()->boundary + '"';
newRequest.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(contentType));
}
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index 988eafa18b..c8df213ead 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -90,7 +90,7 @@ public:
};
#endif
- explicit QNetworkAccessManager(QObject *parent = 0);
+ explicit QNetworkAccessManager(QObject *parent = Q_NULLPTR);
~QNetworkAccessManager();
// ### Qt 6: turn into virtual
@@ -120,7 +120,7 @@ public:
QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data);
QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *multiPart);
QNetworkReply *deleteResource(const QNetworkRequest &request);
- QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = 0);
+ QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = Q_NULLPTR);
#ifndef QT_NO_BEARERMANAGEMENT
void setConfiguration(const QNetworkConfiguration &config);
@@ -157,7 +157,7 @@ Q_SIGNALS:
protected:
virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &request,
- QIODevice *outgoingData = 0);
+ QIODevice *outgoingData = Q_NULLPTR);
protected Q_SLOTS:
QStringList supportedSchemesImplementation() const;
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index 54ae114581..3fc33b5c15 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -93,6 +93,8 @@ public:
online = (networkConfiguration.state().testFlag(QNetworkConfiguration::Active));
if (online)
networkAccessible = QNetworkAccessManager::Accessible;
+ else if (networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined))
+ networkAccessible = QNetworkAccessManager::UnknownAccessibility;
else
networkAccessible = QNetworkAccessManager::NotAccessible;
#endif
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 8a24fc55fd..2d8f192d03 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -901,7 +901,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
// We do not support RFC 2965 Set-Cookie2-style cookies
QList<QNetworkCookie> result;
- QDateTime now = QDateTime::currentDateTime().toUTC();
+ const QDateTime now = QDateTime::currentDateTimeUtc();
int position = 0;
const int length = cookieString.length();
diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h
index 2da86d3f81..27925c8201 100644
--- a/src/network/access/qnetworkcookie.h
+++ b/src/network/access/qnetworkcookie.h
@@ -59,9 +59,12 @@ public:
explicit QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray());
QNetworkCookie(const QNetworkCookie &other);
~QNetworkCookie();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkCookie &operator=(QNetworkCookie &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkCookie &operator=(const QNetworkCookie &other);
- void swap(QNetworkCookie &other) { qSwap(d, other.d); }
+ void swap(QNetworkCookie &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkCookie &other) const;
inline bool operator!=(const QNetworkCookie &other) const
diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp
index 3cefb28f68..39f94a451f 100644
--- a/src/network/access/qnetworkcookiejar.cpp
+++ b/src/network/access/qnetworkcookiejar.cpp
@@ -216,7 +216,7 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const
// It does not implement a very good cross-domain verification yet.
Q_D(const QNetworkCookieJar);
- QDateTime now = QDateTime::currentDateTime();
+ const QDateTime now = QDateTime::currentDateTimeUtc();
QList<QNetworkCookie> result;
bool isEncrypted = url.scheme().toLower() == QLatin1String("https");
@@ -265,7 +265,7 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const
bool QNetworkCookieJar::insertCookie(const QNetworkCookie &cookie)
{
Q_D(QNetworkCookieJar);
- QDateTime now = QDateTime::currentDateTime();
+ const QDateTime now = QDateTime::currentDateTimeUtc();
bool isDeletion = !cookie.isSessionCookie() &&
cookie.expirationDate() < now;
diff --git a/src/network/access/qnetworkcookiejar.h b/src/network/access/qnetworkcookiejar.h
index 59ba7f8738..3ac78ea1c3 100644
--- a/src/network/access/qnetworkcookiejar.h
+++ b/src/network/access/qnetworkcookiejar.h
@@ -47,7 +47,7 @@ class Q_NETWORK_EXPORT QNetworkCookieJar: public QObject
{
Q_OBJECT
public:
- explicit QNetworkCookieJar(QObject *parent = 0);
+ explicit QNetworkCookieJar(QObject *parent = Q_NULLPTR);
virtual ~QNetworkCookieJar();
virtual QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const;
diff --git a/src/network/access/qnetworkdiskcache.h b/src/network/access/qnetworkdiskcache.h
index 568d34dc0f..533eabce9b 100644
--- a/src/network/access/qnetworkdiskcache.h
+++ b/src/network/access/qnetworkdiskcache.h
@@ -47,7 +47,7 @@ class Q_NETWORK_EXPORT QNetworkDiskCache : public QAbstractNetworkCache
Q_OBJECT
public:
- explicit QNetworkDiskCache(QObject *parent = 0);
+ explicit QNetworkDiskCache(QObject *parent = Q_NULLPTR);
~QNetworkDiskCache();
QString cacheDirectory() const;
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index 3e77e1b874..26f7034c09 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -132,6 +132,14 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
\value BackgroundRequestNotAllowedError the background request
is not currently allowed due to platform policy.
+ \value TooManyRedirectsError while following redirects, the maximum
+ limit was reached. The limit is by default set to 50 or as set by
+ QNetworkRequest::setMaxRedirectsAllowed().
+
+ \value InsecureRedirectError while following redirects, the network
+ access API detected a redirect from a encrypted protocol (https) to an
+ unencrypted one (http).
+
\value ProxyConnectionRefusedError the connection to the proxy
server was refused (the proxy server is not accepting requests)
@@ -276,6 +284,19 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
*/
/*!
+ \fn void QNetworkReply::redirected(const QUrl &url)
+ \since 5.6
+
+ This signal is emitted if the QNetworkRequest::FollowRedirectsAttribute was
+ set in the request and the server responded with a 3xx status (specifically
+ 301, 302, 303, 305 or 307 status code) with a valid url in the location
+ header, indicating a HTTP redirect. The \a url parameter contains the new
+ redirect url as returned by the server in the location header.
+
+ \sa QNetworkRequest::FollowRedirectsAttribute
+*/
+
+/*!
\fn void QNetworkReply::metaDataChanged()
\omit FIXME: Update name? \endomit
@@ -498,7 +519,7 @@ QNetworkAccessManager *QNetworkReply::manager() const
*/
QNetworkRequest QNetworkReply::request() const
{
- return d_func()->request;
+ return d_func()->originalRequest;
}
/*!
@@ -549,9 +570,12 @@ bool QNetworkReply::isRunning() const
/*!
Returns the URL of the content downloaded or uploaded. Note that
- the URL may be different from that of the original request.
+ the URL may be different from that of the original request. If the
+ QNetworkRequest::FollowRedirectsAttribute was set in the request, then this
+ function returns the current url that the network API is accessing, i.e the
+ url emitted in the QNetworkReply::redirected signal.
- \sa request(), setUrl(), QNetworkRequest::url()
+ \sa request(), setUrl(), QNetworkRequest::url(), redirected()
*/
QUrl QNetworkReply::url() const
{
@@ -794,7 +818,7 @@ void QNetworkReply::setOperation(QNetworkAccessManager::Operation operation)
void QNetworkReply::setRequest(const QNetworkRequest &request)
{
Q_D(QNetworkReply);
- d->request = request;
+ d->originalRequest = request;
}
/*!
diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h
index 91c9e77d8d..254dd3ff12 100644
--- a/src/network/access/qnetworkreply.h
+++ b/src/network/access/qnetworkreply.h
@@ -69,6 +69,8 @@ public:
TemporaryNetworkFailureError,
NetworkSessionFailedError,
BackgroundRequestNotAllowedError,
+ TooManyRedirectsError,
+ InsecureRedirectError,
UnknownNetworkError = 99,
// proxy errors (101-199):
@@ -153,12 +155,13 @@ Q_SIGNALS:
void sslErrors(const QList<QSslError> &errors);
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
#endif
+ void redirected(const QUrl &url);
void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
protected:
- explicit QNetworkReply(QObject *parent = 0);
+ explicit QNetworkReply(QObject *parent = Q_NULLPTR);
QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent);
virtual qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
diff --git a/src/network/access/qnetworkreply_p.h b/src/network/access/qnetworkreply_p.h
index f5fe7bd844..2a3a2e4297 100644
--- a/src/network/access/qnetworkreply_p.h
+++ b/src/network/access/qnetworkreply_p.h
@@ -69,6 +69,7 @@ public:
QNetworkReplyPrivate();
QNetworkRequest request;
+ QNetworkRequest originalRequest;
QUrl url;
QPointer<QNetworkAccessManager> manager;
qint64 readBufferMaxSize;
diff --git a/src/network/access/qnetworkreplyfileimpl.cpp b/src/network/access/qnetworkreplyfileimpl.cpp
index 8f51b2ca3b..1e5608bc90 100644
--- a/src/network/access/qnetworkreplyfileimpl.cpp
+++ b/src/network/access/qnetworkreplyfileimpl.cpp
@@ -36,7 +36,6 @@
#include "QtCore/qdatetime.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
-#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -136,6 +135,7 @@ QNetworkReplyFileImpl::QNetworkReplyFileImpl(QObject *parent, const QNetworkRequ
QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
}
+
void QNetworkReplyFileImpl::close()
{
Q_D(QNetworkReplyFileImpl);
@@ -182,8 +182,11 @@ qint64 QNetworkReplyFileImpl::readData(char *data, qint64 maxlen)
d->realFile.close();
if (ret == 0 && bytesAvailable() == 0)
return -1;
- else
+ else {
+ setAttribute(QNetworkRequest::HttpStatusCodeAttribute, 200);
+ setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, QLatin1String("OK"));
return ret;
+ }
}
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 76c2f57380..04d391a14c 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -49,6 +49,8 @@
#include "qthread.h"
#include "QtCore/qcoreapplication.h"
+#include <QtCore/private/qthread_p.h>
+
#include "qnetworkcookiejar.h"
#ifndef QT_NO_HTTP
@@ -166,6 +168,7 @@ QNetworkReplyHttpImpl::QNetworkReplyHttpImpl(QNetworkAccessManager* const manage
d->manager = manager;
d->managerPrivate = manager->d_func();
d->request = request;
+ d->originalRequest = request;
d->operation = operation;
d->outgoingData = outgoingData;
d->url = request.url();
@@ -483,7 +486,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h
if (!nc)
return false; // no local cache
- QNetworkCacheMetaData metaData = nc->metaData(request.url());
+ QNetworkCacheMetaData metaData = nc->metaData(httpRequest.url());
if (!metaData.isValid())
return false; // not in cache
@@ -509,7 +512,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h
return false;
}
- QDateTime currentDateTime = QDateTime::currentDateTime();
+ QDateTime currentDateTime = QDateTime::currentDateTimeUtc();
QDateTime expirationDate = metaData.expirationDate();
bool response_is_fresh;
@@ -542,7 +545,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h
date_value = dateHeader.toTime_t();
}
- int now = currentDateTime.toUTC().toTime_t();
+ int now = currentDateTime.toTime_t();
int request_time = now;
int response_time = now;
@@ -597,7 +600,7 @@ QHttpNetworkRequest::Priority QNetworkReplyHttpImplPrivate::convert(const QNetwo
}
}
-void QNetworkReplyHttpImplPrivate::postRequest()
+void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpRequest)
{
Q_Q(QNetworkReplyHttpImpl);
@@ -621,8 +624,9 @@ void QNetworkReplyHttpImplPrivate::postRequest()
thread = managerPrivate->httpThread;
}
- QUrl url = request.url();
+ QUrl url = newHttpRequest.url();
httpRequest.setUrl(url);
+ httpRequest.setRedirectCount(newHttpRequest.maximumRedirectsAllowed());
QString scheme = url.scheme().toLower();
bool ssl = (scheme == QLatin1String("https")
@@ -638,7 +642,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
QNetworkProxy transparentProxy, cacheProxy;
// FIXME the proxy stuff should be done in the HTTP thread
- foreach (const QNetworkProxy &p, managerPrivate->queryProxy(QNetworkProxyQuery(request.url()))) {
+ foreach (const QNetworkProxy &p, managerPrivate->queryProxy(QNetworkProxyQuery(newHttpRequest.url()))) {
// use the first proxy that works
// for non-encrypted connections, any transparent or HTTP proxy
// for encrypted, only transparent proxies
@@ -669,9 +673,11 @@ void QNetworkReplyHttpImplPrivate::postRequest()
}
#endif
+ if (newHttpRequest.attribute(QNetworkRequest::FollowRedirectsAttribute).toBool())
+ httpRequest.setFollowRedirects(true);
bool loadedFromCache = false;
- httpRequest.setPriority(convert(request.priority()));
+ httpRequest.setPriority(convert(newHttpRequest.priority()));
switch (operation) {
case QNetworkAccessManager::GetOperation:
@@ -705,7 +711,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
invalidateCache(); // for safety reasons, we don't know what the operation does
httpRequest.setOperation(QHttpNetworkRequest::Custom);
createUploadByteDevice();
- httpRequest.setCustomVerb(request.attribute(
+ httpRequest.setCustomVerb(newHttpRequest.attribute(
QNetworkRequest::CustomVerbAttribute).toByteArray());
break;
@@ -717,7 +723,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
return; // no need to send the request! :)
}
- QList<QByteArray> headers = request.rawHeaderList();
+ QList<QByteArray> headers = newHttpRequest.rawHeaderList();
if (resumeOffset != 0) {
if (headers.contains("Range")) {
// Need to adjust resume offset for user specified range
@@ -725,7 +731,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
headers.removeOne("Range");
// We've already verified that requestRange starts with "bytes=", see canResume.
- QByteArray requestRange = request.rawHeader("Range").mid(6);
+ QByteArray requestRange = newHttpRequest.rawHeader("Range").mid(6);
int index = requestRange.indexOf('-');
@@ -742,16 +748,16 @@ void QNetworkReplyHttpImplPrivate::postRequest()
}
foreach (const QByteArray &header, headers)
- httpRequest.setHeaderField(header, request.rawHeader(header));
+ httpRequest.setHeaderField(header, newHttpRequest.rawHeader(header));
- if (request.attribute(QNetworkRequest::HttpPipeliningAllowedAttribute).toBool() == true)
+ if (newHttpRequest.attribute(QNetworkRequest::HttpPipeliningAllowedAttribute).toBool() == true)
httpRequest.setPipeliningAllowed(true);
if (request.attribute(QNetworkRequest::SpdyAllowedAttribute).toBool() == true)
httpRequest.setSPDYAllowed(true);
if (static_cast<QNetworkRequest::LoadControl>
- (request.attribute(QNetworkRequest::AuthenticationReuseAttribute,
+ (newHttpRequest.attribute(QNetworkRequest::AuthenticationReuseAttribute,
QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Manual)
httpRequest.setWithCredentials(false);
@@ -778,7 +784,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
delegate->ssl = ssl;
#ifndef QT_NO_SSL
if (ssl)
- delegate->incomingSslConfiguration = request.sslConfiguration();
+ delegate->incomingSslConfiguration = newHttpRequest.sslConfiguration();
#endif
// Do we use synchronous HTTP?
@@ -790,7 +796,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
if (!synchronous) {
// Tell our zerocopy policy to the delegate
- QVariant downloadBufferMaximumSizeAttribute = request.attribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute);
+ QVariant downloadBufferMaximumSizeAttribute = newHttpRequest.attribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute);
if (downloadBufferMaximumSizeAttribute.isValid()) {
delegate->downloadBufferMaximumSize = downloadBufferMaximumSizeAttribute.toLongLong();
} else {
@@ -825,6 +831,9 @@ void QNetworkReplyHttpImplPrivate::postRequest()
QObject::connect(delegate, SIGNAL(error(QNetworkReply::NetworkError,QString)),
q, SLOT(httpError(QNetworkReply::NetworkError,QString)),
Qt::QueuedConnection);
+ QObject::connect(delegate, SIGNAL(redirected(QUrl,int,int)),
+ q, SLOT(onRedirected(QUrl,int,int)),
+ Qt::QueuedConnection);
#ifndef QT_NO_SSL
QObject::connect(delegate, SIGNAL(sslConfigurationChanged(QSslConfiguration)),
q, SLOT(replySslConfigurationChanged(QSslConfiguration)),
@@ -951,7 +960,7 @@ void QNetworkReplyHttpImplPrivate::invalidateCache()
{
QAbstractNetworkCache *nc = managerPrivate->networkCache;
if (nc)
- nc->remove(request.url());
+ nc->remove(httpRequest.url());
}
void QNetworkReplyHttpImplPrivate::initCacheSaveDevice()
@@ -1031,21 +1040,30 @@ void QNetworkReplyHttpImplPrivate::replyDownloadData(QByteArray d)
for (int i = 0; i < pendingDownloadDataCopy.bufferCount(); i++) {
QByteArray const &item = pendingDownloadDataCopy[i];
+ // This is going to look a little strange. When downloading data while a
+ // HTTP redirect is happening (and enabled), we write the redirect
+ // response to the cache. However, we do not append it to our internal
+ // buffer as that will contain the response data only for the final
+ // response
if (cacheSaveDevice)
cacheSaveDevice->write(item.constData(), item.size());
- downloadMultiBuffer.append(item);
+
+ if (!isHttpRedirectResponse())
+ downloadMultiBuffer.append(item);
bytesWritten += item.size();
}
pendingDownloadDataCopy.clear();
- bytesDownloaded += bytesWritten;
-
-
QVariant totalSize = cookedHeaders.value(QNetworkRequest::ContentLengthHeader);
if (preMigrationDownloaded != Q_INT64_C(-1))
totalSize = totalSize.toLongLong() + preMigrationDownloaded;
+ if (isHttpRedirectResponse())
+ return;
+
+ bytesDownloaded += bytesWritten;
+
emit q->readyRead();
// emit readyRead before downloadProgress incase this will cause events to be
// processed and we get into a recursive call (as in QProgressDialog).
@@ -1067,6 +1085,64 @@ void QNetworkReplyHttpImplPrivate::replyFinished()
finished();
}
+QNetworkAccessManager::Operation QNetworkReplyHttpImplPrivate::getRedirectOperation(QNetworkAccessManager::Operation currentOp, int httpStatus)
+{
+ // HTTP status code can be used to decide if we can redirect with a GET
+ // operation or not. See http://www.ietf.org/rfc/rfc2616.txt [Sec 10.3] for
+ // more details
+ Q_UNUSED(httpStatus);
+
+ switch (currentOp) {
+ case QNetworkAccessManager::HeadOperation:
+ return QNetworkAccessManager::HeadOperation;
+ default:
+ break;
+ }
+ // For now, we're always returning GET for anything other than HEAD
+ return QNetworkAccessManager::GetOperation;
+}
+
+bool QNetworkReplyHttpImplPrivate::isHttpRedirectResponse() const
+{
+ return httpRequest.isFollowRedirects() && QHttpNetworkReply::isHttpRedirect(statusCode);
+}
+
+QNetworkRequest QNetworkReplyHttpImplPrivate::createRedirectRequest(const QNetworkRequest &originalRequest,
+ const QUrl &url,
+ int maxRedirectsRemaining)
+{
+ QNetworkRequest newRequest(originalRequest);
+ newRequest.setUrl(url);
+ newRequest.setMaximumRedirectsAllowed(maxRedirectsRemaining);
+
+ return newRequest;
+}
+
+void QNetworkReplyHttpImplPrivate::onRedirected(const QUrl &redirectUrl, int httpStatus, int maxRedirectsRemaining)
+{
+ Q_Q(QNetworkReplyHttpImpl);
+
+ if (isFinished)
+ return;
+
+ if (httpRequest.isFollowRedirects()) // update the reply's url as it could've changed
+ url = redirectUrl;
+
+ QNetworkRequest redirectRequest = createRedirectRequest(originalRequest, redirectUrl, maxRedirectsRemaining);
+ operation = getRedirectOperation(operation, httpStatus);
+
+ cookedHeaders.clear();
+
+ if (managerPrivate->httpThread)
+ managerPrivate->httpThread->disconnect();
+
+ // Recurse
+ QMetaObject::invokeMethod(q, "start", Qt::QueuedConnection,
+ Q_ARG(QNetworkRequest, redirectRequest));
+
+ emit q->redirected(redirectUrl);
+}
+
void QNetworkReplyHttpImplPrivate::checkForRedirect(const int statusCode)
{
Q_Q(QNetworkReplyHttpImpl);
@@ -1115,7 +1191,16 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData
end = headerMap.constEnd();
for (; it != end; ++it) {
QByteArray value = q->rawHeader(it->first);
+
+ // Reset any previous "location" header set in the reply. In case of
+ // redirects, we don't want to 'append' multiple location header values,
+ // rather we keep only the latest one
+ if (it->first.toLower() == "location")
+ value.clear();
+
if (!value.isEmpty()) {
+ // Why are we appending values for headers which are already
+ // present?
if (qstricmp(it->first.constData(), "set-cookie") == 0)
value += '\n';
else
@@ -1129,12 +1214,13 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData
q->setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, reasonPhrase);
// is it a redirection?
- checkForRedirect(statusCode);
+ if (!isHttpRedirectResponse())
+ checkForRedirect(statusCode);
if (statusCode >= 500 && statusCode < 600) {
QAbstractNetworkCache *nc = managerPrivate->networkCache;
if (nc) {
- QNetworkCacheMetaData metaData = nc->metaData(request.url());
+ QNetworkCacheMetaData metaData = nc->metaData(httpRequest.url());
QNetworkHeadersPrivate cacheHeaders;
cacheHeaders.setAllRawHeaders(metaData.rawHeaders());
QNetworkHeadersPrivate::RawHeadersList::ConstIterator it;
@@ -1156,7 +1242,7 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData
#endif
QAbstractNetworkCache *nc = managerPrivate->networkCache;
if (nc) {
- QNetworkCacheMetaData oldMetaData = nc->metaData(request.url());
+ QNetworkCacheMetaData oldMetaData = nc->metaData(httpRequest.url());
QNetworkCacheMetaData metaData = fetchCacheMetaData(oldMetaData);
if (oldMetaData != metaData)
nc->updateMetaData(metaData);
@@ -1203,6 +1289,9 @@ void QNetworkReplyHttpImplPrivate::replyDownloadProgressSlot(qint64 bytesReceive
// FIXME where is it closed?
}
+ if (isHttpRedirectResponse())
+ return;
+
bytesDownloaded = bytesReceived;
downloadBufferCurrentSize = bytesReceived;
@@ -1361,6 +1450,8 @@ bool QNetworkReplyHttpImplPrivate::sendCacheContents(const QNetworkCacheMetaData
if (status < 100)
status = 200; // fake it
+ statusCode = status;
+
q->setAttribute(QNetworkRequest::HttpStatusCodeAttribute, status);
q->setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute));
q->setAttribute(QNetworkRequest::SourceIsFromCacheAttribute, true);
@@ -1368,10 +1459,16 @@ bool QNetworkReplyHttpImplPrivate::sendCacheContents(const QNetworkCacheMetaData
QNetworkCacheMetaData::RawHeaderList rawHeaders = metaData.rawHeaders();
QNetworkCacheMetaData::RawHeaderList::ConstIterator it = rawHeaders.constBegin(),
end = rawHeaders.constEnd();
- for ( ; it != end; ++it)
+ QUrl redirectUrl;
+ for ( ; it != end; ++it) {
+ if (httpRequest.isFollowRedirects() &&
+ !qstricmp(it->first.toLower().constData(), "location"))
+ redirectUrl = QUrl::fromEncoded(it->second);
setRawHeader(it->first, it->second);
+ }
- checkForRedirect(status);
+ if (!isHttpRedirectResponse())
+ checkForRedirect(status);
cacheLoadDevice = contents;
q->connect(cacheLoadDevice, SIGNAL(readyRead()), SLOT(_q_cacheLoadReadyRead()));
@@ -1388,6 +1485,14 @@ bool QNetworkReplyHttpImplPrivate::sendCacheContents(const QNetworkCacheMetaData
qDebug() << "Successfully sent cache:" << url << contents->size() << "bytes";
#endif
+ // Do redirect processing
+ if (httpRequest.isFollowRedirects() && QHttpNetworkReply::isHttpRedirect(status)) {
+ QMetaObject::invokeMethod(q, "onRedirected", Qt::QueuedConnection,
+ Q_ARG(QUrl, redirectUrl),
+ Q_ARG(int, status),
+ Q_ARG(int, httpRequest.redirectCount() - 1));
+ }
+
// Set the following flag so we can ignore some signals from HTTP thread
// that would still come
loadingFromCache = true;
@@ -1480,7 +1585,7 @@ QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNe
QByteArray maxAge = cacheControl.value("max-age");
if (!maxAge.isEmpty()) {
checkExpired = false;
- QDateTime dt = QDateTime::currentDateTime();
+ QDateTime dt = QDateTime::currentDateTimeUtc();
dt = dt.addSecs(maxAge.toInt());
metaData.setExpirationDate(dt);
}
@@ -1583,13 +1688,13 @@ void QNetworkReplyHttpImplPrivate::setResumeOffset(quint64 offset)
could not be started due to an unopened or roaming session. The caller should recall this
function once the session has been opened or the roaming process has finished.
*/
-bool QNetworkReplyHttpImplPrivate::start()
+bool QNetworkReplyHttpImplPrivate::start(const QNetworkRequest &newHttpRequest)
{
#ifndef QT_NO_BEARERMANAGEMENT
QSharedPointer<QNetworkSession> networkSession(managerPrivate->getNetworkSession());
if (!networkSession) {
#endif
- postRequest();
+ postRequest(newHttpRequest);
return true;
#ifndef QT_NO_BEARERMANAGEMENT
}
@@ -1599,7 +1704,7 @@ bool QNetworkReplyHttpImplPrivate::start()
if (host == QLatin1String("localhost") ||
QHostAddress(host).isLoopback()) {
// Don't need an open session for localhost access.
- postRequest();
+ postRequest(newHttpRequest);
return true;
}
@@ -1608,13 +1713,13 @@ bool QNetworkReplyHttpImplPrivate::start()
Q_Q(QNetworkReplyHttpImpl);
QObject::connect(networkSession.data(), SIGNAL(usagePoliciesChanged(QNetworkSession::UsagePolicies)),
q, SLOT(_q_networkSessionUsagePoliciesChanged(QNetworkSession::UsagePolicies)));
- postRequest();
+ postRequest(newHttpRequest);
return true;
} else if (synchronous) {
// Command line applications using the synchronous path such as xmlpatterns may need an extra push.
networkSession->open();
if (networkSession->waitForOpened()) {
- postRequest();
+ postRequest(newHttpRequest);
return true;
}
}
@@ -1646,7 +1751,7 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
}
#endif
- if (!start()) {
+ if (!start(request)) {
#ifndef QT_NO_BEARERMANAGEMENT
// backend failed to start because the session state is not Connected.
// QNetworkAccessManager will call reply->backend->start() again for us when the session
@@ -1714,18 +1819,20 @@ void QNetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead()
// emit readyRead before downloadProgress incase this will cause events to be
// processed and we get into a recursive call (as in QProgressDialog).
- // This readyRead() goes to the user. The user then may or may not read() anything.
- emit q->readyRead();
- if (downloadProgressSignalChoke.elapsed() >= progressSignalInterval) {
- downloadProgressSignalChoke.restart();
- emit q->downloadProgress(bytesDownloaded,
- totalSize.isNull() ? Q_INT64_C(-1) : totalSize.toLongLong());
- }
+ if (!(isHttpRedirectResponse())) {
+ // This readyRead() goes to the user. The user then may or may not read() anything.
+ emit q->readyRead();
+ if (downloadProgressSignalChoke.elapsed() >= progressSignalInterval) {
+ downloadProgressSignalChoke.restart();
+ emit q->downloadProgress(bytesDownloaded,
+ totalSize.isNull() ? Q_INT64_C(-1) : totalSize.toLongLong());
+ }
+ }
// If there are still bytes available in the cacheLoadDevice then the user did not read
// in response to the readyRead() signal. This means we have to load from the cacheLoadDevice
// and buffer that stuff. This is needed to be able to properly emit finished() later.
- while (cacheLoadDevice->bytesAvailable()) {
+ while (cacheLoadDevice->bytesAvailable() && !isHttpRedirectResponse()) {
downloadMultiBuffer.append(cacheLoadDevice->readAll());
}
@@ -1748,7 +1855,6 @@ void QNetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead()
cacheLoadDevice = 0;
QMetaObject::invokeMethod(q, "_q_finished", Qt::QueuedConnection);
}
-
}
@@ -1978,6 +2084,15 @@ void QNetworkReplyHttpImplPrivate::finished()
#endif
}
+ // if we don't know the total size of or we received everything save the cache
+ if (totalSize.isNull() || totalSize == -1 || bytesDownloaded == totalSize)
+ completeCacheSave();
+
+ // We check for errorCode too as in case of SSL handshake failure, we still
+ // get the HTTP redirect status code (301, 303 etc)
+ if (isHttpRedirectResponse() && errorCode == QNetworkReply::NoError)
+ return;
+
state = Finished;
q->setFinished(true);
@@ -1990,10 +2105,6 @@ void QNetworkReplyHttpImplPrivate::finished()
if (bytesUploaded == -1 && (outgoingData || outgoingDataBuffer))
emit q->uploadProgress(0, 0);
- // if we don't know the total size of or we received everything save the cache
- if (totalSize.isNull() || totalSize == -1 || bytesDownloaded == totalSize)
- completeCacheSave();
-
emit q->readChannelFinished();
emit q->finished();
}
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index cfc05edbd8..44d51d82a4 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -89,6 +89,7 @@ public:
Q_DECLARE_PRIVATE(QNetworkReplyHttpImpl)
Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
+ Q_PRIVATE_SLOT(d_func(), bool start(const QNetworkRequest &))
Q_PRIVATE_SLOT(d_func(), void _q_cacheLoadReadyRead())
Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingData())
Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingDataFinished())
@@ -127,7 +128,7 @@ public:
Q_PRIVATE_SLOT(d_func(), void emitReplyUploadProgress(qint64, qint64))
Q_PRIVATE_SLOT(d_func(), void _q_cacheSaveDeviceAboutToClose())
Q_PRIVATE_SLOT(d_func(), void _q_metaDataChanged())
-
+ Q_PRIVATE_SLOT(d_func(), void onRedirected(const QUrl &, int, int))
#ifndef QT_NO_SSL
protected:
@@ -158,7 +159,7 @@ public:
QNetworkReplyHttpImplPrivate();
~QNetworkReplyHttpImplPrivate();
- bool start();
+ bool start(const QNetworkRequest &newHttpRequest);
void _q_startOperation();
void _q_cacheLoadReadyRead();
@@ -203,6 +204,7 @@ public:
QIODevice *outgoingData;
QSharedPointer<QRingBuffer> outgoingDataBuffer;
void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal); // dup?
+ void onRedirected(const QUrl &redirectUrl, int httpStatus, int maxRedirectsRemainig);
qint64 bytesUploaded;
@@ -262,9 +264,10 @@ public:
QNetworkCacheMetaData fetchCacheMetaData(const QNetworkCacheMetaData &metaData) const;
- void postRequest();
-
-
+ void postRequest(const QNetworkRequest& newHttpRequest);
+ QNetworkAccessManager::Operation getRedirectOperation(QNetworkAccessManager::Operation currentOp, int httpStatus);
+ QNetworkRequest createRedirectRequest(const QNetworkRequest &originalRequests, const QUrl &url, int maxRedirectsRemainig);
+ bool isHttpRedirectResponse() const;
public:
// From HTTP thread:
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 18f322f45d..7961a1dbae 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -65,8 +65,6 @@ inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate()
void QNetworkReplyImplPrivate::_q_startOperation()
{
- Q_Q(QNetworkReplyImpl);
-
// ensure this function is only being called once
if (state == Working || state == Finished) {
qDebug("QNetworkReplyImpl::_q_startOperation was called more than once");
@@ -85,6 +83,7 @@ void QNetworkReplyImplPrivate::_q_startOperation()
}
#ifndef QT_NO_BEARERMANAGEMENT
+ Q_Q(QNetworkReplyImpl);
// Do not start background requests if they are not allowed by session policy
QSharedPointer<QNetworkSession> session(manager->d_func()->getNetworkSession());
QVariant isBackground = backend->request().attribute(QNetworkRequest::BackgroundRequestAttribute, QVariant::fromValue(false));
@@ -128,8 +127,10 @@ void QNetworkReplyImplPrivate::_q_startOperation()
return;
} else {
#ifndef QT_NO_BEARERMANAGEMENT
- QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
- q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
+ if (session) {
+ QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
+ q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
+ }
#endif
}
@@ -930,13 +931,11 @@ void QNetworkReplyImpl::abort()
QNetworkReply::close();
- if (d->state != QNetworkReplyPrivate::Finished) {
- // call finished which will emit signals
- d->error(OperationCanceledError, tr("Operation canceled"));
- if (d->state == QNetworkReplyPrivate::WaitingForSession)
- d->state = QNetworkReplyPrivate::Working;
- d->finished();
- }
+ // call finished which will emit signals
+ d->error(OperationCanceledError, tr("Operation canceled"));
+ if (d->state == QNetworkReplyPrivate::WaitingForSession)
+ d->state = QNetworkReplyPrivate::Working;
+ d->finished();
d->state = QNetworkReplyPrivate::Aborted;
// finished may access the backend
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index 5883c9d1c3..209bf40b72 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -116,8 +116,6 @@ public:
QNetworkReplyImplPrivate();
void _q_startOperation();
- void _q_sourceReadyRead();
- void _q_sourceReadChannelFinished();
void _q_copyReadyRead();
void _q_copyReadChannelFinished();
void _q_bufferOutgoingData();
@@ -205,6 +203,7 @@ public:
Q_DECLARE_PUBLIC(QNetworkReplyImpl)
};
+Q_DECLARE_TYPEINFO(QNetworkReplyImplPrivate::InternalNotifications, Q_PRIMITIVE_TYPE);
#ifndef QT_NO_BEARERMANAGEMENT
class QDisabledNetworkReply : public QNetworkReply
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index c7cb16c71c..558e015ae4 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -140,7 +140,9 @@ QT_BEGIN_NAMESPACE
request to a different URL. The Network Access API does not by
default follow redirections: it's up to the application to
determine if the requested redirection should be allowed,
- according to its security policies.
+ according to its security policies. However, if
+ QNetworkRequest::FollowRedirectsAttribute is set, then this attribute
+ will not be present in the reply.
The returned URL might be relative. Use QUrl::resolved()
to create an absolute URL out of it.
@@ -256,6 +258,12 @@ QT_BEGIN_NAMESPACE
in 100 millisecond intervals.
(This value was introduced in 5.5.)
+ \value FollowRedirectsAttribute
+ Requests only, type: QMetaType::Bool (default: false)
+ Indicates whether the Network Access API should automatically follow a
+ HTTP redirect response or not. Currently redirects that are insecure,
+ that is redirecting from "https" to "http" protocol, are not allowed.
+
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default
@@ -306,11 +314,13 @@ QT_BEGIN_NAMESPACE
class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate
{
public:
+ static const int maxRedirectCount = 50;
inline QNetworkRequestPrivate()
: priority(QNetworkRequest::NormalPriority)
#ifndef QT_NO_SSL
, sslConfiguration(0)
#endif
+ , maxRedirectsAllowed(maxRedirectCount)
{ qRegisterMetaType<QNetworkRequest>(); }
~QNetworkRequestPrivate()
{
@@ -325,7 +335,7 @@ public:
{
url = other.url;
priority = other.priority;
-
+ maxRedirectsAllowed = other.maxRedirectsAllowed;
#ifndef QT_NO_SSL
sslConfiguration = 0;
if (other.sslConfiguration)
@@ -338,7 +348,8 @@ public:
return url == other.url &&
priority == other.priority &&
rawHeaders == other.rawHeaders &&
- attributes == other.attributes;
+ attributes == other.attributes &&
+ maxRedirectsAllowed == other.maxRedirectsAllowed;
// don't compare cookedHeaders
}
@@ -347,6 +358,7 @@ public:
#ifndef QT_NO_SSL
mutable QSslConfiguration *sslConfiguration;
#endif
+ int maxRedirectsAllowed;
};
/*!
@@ -657,6 +669,32 @@ void QNetworkRequest::setPriority(Priority priority)
d->priority = priority;
}
+/*!
+ \since 5.6
+
+ Returns the maximum number of redirects allowed to be followed for this
+ request.
+
+ \sa setMaximumRedirectsAllowed()
+*/
+int QNetworkRequest::maximumRedirectsAllowed() const
+{
+ return d->maxRedirectsAllowed;
+}
+
+/*!
+ \since 5.6
+
+ Sets the maximum number of redirects allowed to be followed for this
+ request to \a maxRedirectsAllowed.
+
+ \sa maximumRedirectsAllowed()
+*/
+void QNetworkRequest::setMaximumRedirectsAllowed(int maxRedirectsAllowed)
+{
+ d->maxRedirectsAllowed = maxRedirectsAllowed;
+}
+
static QByteArray headerName(QNetworkRequest::KnownHeaders header)
{
switch (header) {
@@ -881,6 +919,7 @@ QNetworkHeadersPrivate::RawHeadersList QNetworkHeadersPrivate::allRawHeaders() c
QList<QByteArray> QNetworkHeadersPrivate::rawHeadersKeys() const
{
QList<QByteArray> result;
+ result.reserve(rawHeaders.size());
RawHeadersList::ConstIterator it = rawHeaders.constBegin(),
end = rawHeaders.constEnd();
for ( ; it != end; ++it)
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index d6d907bdc4..eb343c97df 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -81,6 +81,7 @@ public:
SpdyAllowedAttribute,
SpdyWasUsedAttribute,
EmitAllUploadProgressSignalsAttribute,
+ FollowRedirectsAttribute,
User = 1000,
UserMax = 32767
@@ -105,9 +106,12 @@ public:
explicit QNetworkRequest(const QUrl &url = QUrl());
QNetworkRequest(const QNetworkRequest &other);
~QNetworkRequest();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkRequest &operator=(QNetworkRequest &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkRequest &operator=(const QNetworkRequest &other);
- inline void swap(QNetworkRequest &other) { qSwap(d, other.d); }
+ void swap(QNetworkRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkRequest &other) const;
inline bool operator!=(const QNetworkRequest &other) const
@@ -141,6 +145,10 @@ public:
Priority priority() const;
void setPriority(Priority priority);
+ // HTTP redirect related
+ int maximumRedirectsAllowed() const;
+ void setMaximumRedirectsAllowed(int maximumRedirectsAllowed);
+
private:
QSharedDataPointer<QNetworkRequestPrivate> d;
friend class QNetworkRequestPrivate;
diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp
index 7430ca029d..5f9697ab92 100644
--- a/src/network/access/qspdyprotocolhandler.cpp
+++ b/src/network/access/qspdyprotocolhandler.cpp
@@ -288,16 +288,14 @@ bool QSpdyProtocolHandler::sendRequest()
m_channel->state = QHttpNetworkConnectionChannel::WritingState;
- // requests will be ordered by priority (see QMultiMap doc)
- QList<HttpMessagePair> requests = m_channel->spdyRequestsToSend.values();
- QList<int> priorities = m_channel->spdyRequestsToSend.keys();
-
- int requestsToSend = qMin(requests.count(), maxPossibleRequests);
+ int requestsToSend = qMin(m_channel->spdyRequestsToSend.size(), maxPossibleRequests);
+ QMultiMap<int, HttpMessagePair>::iterator it = m_channel->spdyRequestsToSend.begin();
+ // requests will be ordered by priority (see QMultiMap doc)
for (int a = 0; a < requestsToSend; ++a) {
- HttpMessagePair currentPair = requests.at(a);
- QHttpNetworkRequest currentRequest = requests.at(a).first;
- QHttpNetworkReply *currentReply = requests.at(a).second;
+ HttpMessagePair currentPair = *it;
+ QHttpNetworkRequest currentRequest = currentPair.first;
+ QHttpNetworkReply *currentReply = currentPair.second;
currentReply->setSpdyWasUsed(true);
qint32 streamID = generateNextStreamID();
@@ -310,10 +308,7 @@ bool QSpdyProtocolHandler::sendRequest()
connect(currentReply, SIGNAL(destroyed(QObject*)), this, SLOT(_q_replyDestroyed(QObject*)));
sendSYN_STREAM(currentPair, streamID, /* associatedToStreamID = */ 0);
- int requestsRemoved = m_channel->spdyRequestsToSend.remove(
- priorities.at(a), currentPair);
- Q_ASSERT(requestsRemoved == 1);
- Q_UNUSED(requestsRemoved); // silence -Wunused-variable
+ m_channel->spdyRequestsToSend.erase(it++);
}
m_channel->state = QHttpNetworkConnectionChannel::IdleState;
return true;
@@ -457,7 +452,7 @@ bool QSpdyProtocolHandler::uncompressHeader(const QByteArray &input, QByteArray
break;
}
default: {
- qWarning() << Q_FUNC_INFO << "got unexpected zlib return value:" << zlibRet;
+ qWarning() << "got unexpected zlib return value:" << zlibRet;
return false;
}
}
@@ -693,7 +688,7 @@ bool QSpdyProtocolHandler::uploadData(qint32 streamID)
Q_ASSERT(replyPrivate);
if (reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYHalfClosed || reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYClosed) {
- qWarning() << Q_FUNC_INFO << "Trying to upload to closed stream";
+ qWarning("Trying to upload to closed stream");
return false;
}
@@ -848,7 +843,7 @@ void QSpdyProtocolHandler::handleControlFrame(const QByteArray &frameHeaders) //
break;
}
default:
- qWarning() << Q_FUNC_INFO << "cannot handle frame of type" << type;
+ qWarning() << "cannot handle frame of type" << type;
}
}
@@ -892,13 +887,13 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
QByteArray uncompressedHeader;
if (!uncompressHeader(headerValuePairs, &uncompressedHeader)) {
- qWarning() << Q_FUNC_INFO << "error reading header from SYN_REPLY message";
+ qWarning("error reading header from SYN_REPLY message");
return;
}
qint32 headerCount = fourBytesToInt(uncompressedHeader.constData());
if (headerCount * 8 > uncompressedHeader.size()) {
- qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message";
+ qWarning("error parsing header from SYN_REPLY message");
sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR);
return;
}
@@ -909,7 +904,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
QByteArray name = uncompressedHeader.mid(readPointer, count);
readPointer += count;
if (readPointer > uncompressedHeader.size()) {
- qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message";
+ qWarning("error parsing header from SYN_REPLY message");
sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR);
return;
}
@@ -918,7 +913,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
QByteArray value = uncompressedHeader.mid(readPointer, count);
readPointer += count;
if (readPointer > uncompressedHeader.size()) {
- qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message";
+ qWarning("error parsing header from SYN_REPLY message");
sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR);
return;
}
@@ -1019,7 +1014,7 @@ void QSpdyProtocolHandler::handleRST_STREAM(char /*flags*/, quint32 length,
errorMessage = "server cannot process the frame because it is too large";
break;
default:
- qWarning() << Q_FUNC_INFO << "could not understand servers RST_STREAM status code";
+ qWarning("could not understand servers RST_STREAM status code");
errorCode = QNetworkReply::ProtocolFailure;
errorMessage = "got SPDY RST_STREAM message with unknown error code";
}
@@ -1083,7 +1078,7 @@ void QSpdyProtocolHandler::handleSETTINGS(char flags, quint32 /*length*/, const
break;
}
default:
- qWarning() << Q_FUNC_INFO << "found unknown settings value" << value;
+ qWarning() << "found unknown settings value" << value;
}
}
}
@@ -1122,7 +1117,7 @@ void QSpdyProtocolHandler::handleGOAWAY(char /*flags*/, quint32 /*length*/,
break;
}
default:
- qWarning() << Q_FUNC_INFO << "unexpected status code" << statusCode;
+ qWarning() << "unexpected status code" << statusCode;
errorCode = QNetworkReply::ProtocolUnknownError;
}
@@ -1257,7 +1252,7 @@ void QSpdyProtocolHandler::handleDataFrame(const QByteArray &frameHeaders)
}
if (flag_compress) {
- qWarning() << Q_FUNC_INFO << "SPDY level compression is not supported";
+ qWarning("SPDY level compression is not supported");
}
if (flag_fin) {
diff --git a/src/network/bearer/qnetworkconfigmanager.h b/src/network/bearer/qnetworkconfigmanager.h
index b62a44c422..84080ba83e 100644
--- a/src/network/bearer/qnetworkconfigmanager.h
+++ b/src/network/bearer/qnetworkconfigmanager.h
@@ -59,13 +59,13 @@ public:
Q_DECLARE_FLAGS(Capabilities, Capability)
- explicit QNetworkConfigurationManager(QObject *parent = 0);
+ explicit QNetworkConfigurationManager(QObject *parent = Q_NULLPTR);
virtual ~QNetworkConfigurationManager();
QNetworkConfigurationManager::Capabilities capabilities() const;
QNetworkConfiguration defaultConfiguration() const;
- QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = 0) const;
+ QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = QNetworkConfiguration::StateFlags()) const;
QNetworkConfiguration configurationFromIdentifier(const QString &identifier) const;
bool isOnline() const;
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 8ff6ee828d..71e435b771 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -41,6 +41,11 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qthread.h>
#include <QtCore/private/qcoreapplication_p.h>
+#include <QtCore/private/qthread_p.h>
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qglobal.h>
+
#ifndef QT_NO_BEARERMANAGEMENT
@@ -61,7 +66,7 @@ QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
void QNetworkConfigurationManagerPrivate::initialize()
{
//Two stage construction, because we only want to do this heavyweight work for the winner of the Q_GLOBAL_STATIC race.
- bearerThread = new QThread();
+ bearerThread = new QDaemonThread();
bearerThread->setObjectName(QStringLiteral("Qt bearer thread"));
bearerThread->moveToThread(QCoreApplicationPrivate::mainThread()); // because cleanup() is called in main thread context.
@@ -374,6 +379,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
updating = false;
#ifndef QT_NO_LIBRARY
+ bool envOK = false;
+ const int skipGeneric = qgetenv("QT_EXCLUDE_GENERIC_BEARER").toInt(&envOK);
QBearerEngine *generic = 0;
QFactoryLoader *l = loader();
const PluginKeyMap keyMap = l->keyMap();
@@ -408,8 +415,10 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
}
}
- if (generic)
- sessionEngines.append(generic);
+ if (generic) {
+ if (!envOK || skipGeneric <= 0)
+ sessionEngines.append(generic);
+ }
#endif // QT_NO_LIBRARY
}
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index 6b56d3ec88..378245ce3e 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -211,30 +211,30 @@ static QNetworkConfiguration::BearerType cellularStatus()
int cellularStatusFD;
if ((cellularStatusFD = qt_safe_open(cellularStatusFile, O_RDONLY)) == -1) {
- qWarning() << Q_FUNC_INFO << "failed to open" << cellularStatusFile;
+ qWarning() << "failed to open" << cellularStatusFile;
return ret;
}
char buf[2048];
if (qt_safe_read(cellularStatusFD, &buf, sizeof(buf)) == -1) {
- qWarning() << Q_FUNC_INFO << "read from PPS file failed:" << strerror(errno);
+ qWarning() << "read from PPS file failed:" << strerror(errno);
qt_safe_close(cellularStatusFD);
return ret;
}
pps_decoder_t ppsDecoder;
if (pps_decoder_initialize(&ppsDecoder, buf) != PPS_DECODER_OK) {
- qWarning() << Q_FUNC_INFO << "failed to initialize PPS decoder";
+ qWarning("failed to initialize PPS decoder");
qt_safe_close(cellularStatusFD);
return ret;
}
pps_decoder_error_t err;
if ((err = pps_decoder_push(&ppsDecoder, 0)) != PPS_DECODER_OK) {
- qWarning() << Q_FUNC_INFO << "pps_decoder_push failed" << err;
+ qWarning() << "pps_decoder_push failed" << err;
pps_decoder_cleanup(&ppsDecoder);
qt_safe_close(cellularStatusFD);
return ret;
}
if (!pps_decoder_is_integer(&ppsDecoder, "network_technology")) {
- qWarning() << Q_FUNC_INFO << "field has not the expected data type";
+ qWarning("field has not the expected data type");
pps_decoder_cleanup(&ppsDecoder);
qt_safe_close(cellularStatusFD);
return ret;
@@ -242,7 +242,7 @@ static QNetworkConfiguration::BearerType cellularStatus()
int type;
if (!pps_decoder_get_int(&ppsDecoder, "network_technology", &type)
== PPS_DECODER_OK) {
- qWarning() << Q_FUNC_INFO << "could not read bearer type from PPS";
+ qWarning("could not read bearer type from PPS");
pps_decoder_cleanup(&ppsDecoder);
qt_safe_close(cellularStatusFD);
return ret;
@@ -264,7 +264,7 @@ static QNetworkConfiguration::BearerType cellularStatus()
ret = QNetworkConfiguration::BearerLTE;
break;
default:
- qWarning() << Q_FUNC_INFO << "unhandled bearer type" << type;
+ qWarning() << "unhandled bearer type" << type;
break;
}
pps_decoder_cleanup(&ppsDecoder);
diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h
index dbef344e69..317c232bea 100644
--- a/src/network/bearer/qnetworkconfiguration.h
+++ b/src/network/bearer/qnetworkconfiguration.h
@@ -49,10 +49,13 @@ class Q_NETWORK_EXPORT QNetworkConfiguration
public:
QNetworkConfiguration();
QNetworkConfiguration(const QNetworkConfiguration& other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkConfiguration &operator=(QNetworkConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkConfiguration &operator=(const QNetworkConfiguration &other);
~QNetworkConfiguration();
- void swap(QNetworkConfiguration &other) { qSwap(d, other.d); }
+ void swap(QNetworkConfiguration &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkConfiguration &other) const;
inline bool operator!=(const QNetworkConfiguration &other) const
diff --git a/src/network/bearer/qnetworksession.h b/src/network/bearer/qnetworksession.h
index 34d721f484..bee4be7eb6 100644
--- a/src/network/bearer/qnetworksession.h
+++ b/src/network/bearer/qnetworksession.h
@@ -80,7 +80,7 @@ public:
Q_DECLARE_FLAGS(UsagePolicies, UsagePolicy)
- explicit QNetworkSession(const QNetworkConfiguration &connConfig, QObject *parent = 0);
+ explicit QNetworkSession(const QNetworkConfiguration &connConfig, QObject *parent = Q_NULLPTR);
virtual ~QNetworkSession();
bool isOpen() const;
diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf
index 2a8e577dda..87e322d6c0 100644
--- a/src/network/doc/qtnetwork.qdocconf
+++ b/src/network/doc/qtnetwork.qdocconf
@@ -4,7 +4,7 @@ project = QtNetwork
description = Qt Network Reference Documentation
version = $QT_VERSION
-examplesinstallpath = network
+examplesinstallpath = qtbase/network
qhp.projects = QtNetwork
diff --git a/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp b/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
index cd05ad63fb..00bcf35c07 100644
--- a/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
+++ b/src/network/doc/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp
@@ -40,9 +40,9 @@
//! [0]
QNetworkConfigurationManager mgr;
-QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Active)
+QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Active);
if (activeConfigs.count() > 0)
- Q_ASSERT(mgr.isOnline())
+ Q_ASSERT(mgr.isOnline());
else
- Q_ASSERT(!mgr.isOnline())
+ Q_ASSERT(!mgr.isOnline());
//! [0]
diff --git a/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp b/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp
index a7ab8c0977..3bd57f1d44 100644
--- a/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_ssl_qsslsocket.cpp
@@ -51,7 +51,8 @@ void SslServer::incomingConnection(qintptr socketDescriptor)
{
QSslSocket *serverSocket = new QSslSocket;
if (serverSocket->setSocketDescriptor(socketDescriptor)) {
- connect(serverSocket, SIGNAL(encrypted()), this, SLOT(ready()));
+ addPendingConnection(serverSocket);
+ connect(serverSocket, &QSslSocket::encrypted, this, &SslServer::ready);
serverSocket->startServerEncryption();
} else {
delete serverSocket;
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index e539388b81..ddb30b7b6f 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -33,15 +33,16 @@ android {
}
win32: {
+ SOURCES += kernel/qhostinfo_win.cpp
+
!winrt {
- HEADERS += kernel/qnetworkinterface_win_p.h
SOURCES += kernel/qdnslookup_win.cpp \
- kernel/qhostinfo_win.cpp \
kernel/qnetworkinterface_win.cpp
- LIBS_PRIVATE += -ldnsapi
+ LIBS_PRIVATE += -ldnsapi -liphlpapi
+ DEFINES += WINVER=0x0600 _WIN32_WINNT=0x0600
+
} else {
SOURCES += kernel/qdnslookup_winrt.cpp \
- kernel/qhostinfo_winrt.cpp \
kernel/qnetworkinterface_winrt.cpp
}
}
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index d626d0bcfc..95994653e6 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -693,13 +693,13 @@ QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge,
credentials += "uri=\"" + path + "\", ";
if (!opaque.isEmpty())
credentials += "opaque=\"" + opaque + "\", ";
- credentials += "response=\"" + response + '\"';
+ credentials += "response=\"" + response + '"';
if (!options.value("algorithm").isEmpty())
credentials += ", algorithm=" + options.value("algorithm");
if (!options.value("qop").isEmpty()) {
credentials += ", qop=" + qop + ", ";
credentials += "nc=" + nonceCountString + ", ";
- credentials += "cnonce=\"" + cnonce + '\"';
+ credentials += "cnonce=\"" + cnonce + '"';
}
return credentials;
diff --git a/src/network/kernel/qdnslookup.cpp b/src/network/kernel/qdnslookup.cpp
index 150beb4d39..4a275f0700 100644
--- a/src/network/kernel/qdnslookup.cpp
+++ b/src/network/kernel/qdnslookup.cpp
@@ -148,6 +148,9 @@ static void qt_qdnsservicerecord_sort(QList<QDnsServiceRecord> &records)
}
}
+const char *QDnsLookupPrivate::msgNoIpV6NameServerAdresses =
+ QT_TRANSLATE_NOOP("QDnsLookupRunnable", "IPv6 addresses for nameservers are currently not supported");
+
/*!
\class QDnsLookup
\brief The QDnsLookup class represents a DNS lookup.
diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h
index 01ebbb6535..ae015a22b8 100644
--- a/src/network/kernel/qdnslookup.h
+++ b/src/network/kernel/qdnslookup.h
@@ -55,16 +55,18 @@ class Q_NETWORK_EXPORT QDnsDomainNameRecord
public:
QDnsDomainNameRecord();
QDnsDomainNameRecord(const QDnsDomainNameRecord &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDnsDomainNameRecord &operator=(QDnsDomainNameRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QDnsDomainNameRecord &operator=(const QDnsDomainNameRecord &other);
~QDnsDomainNameRecord();
- void swap(QDnsDomainNameRecord &other) { qSwap(d, other.d); }
+ void swap(QDnsDomainNameRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
QString value() const;
- QDnsDomainNameRecord &operator=(const QDnsDomainNameRecord &other);
-
private:
QSharedDataPointer<QDnsDomainNameRecordPrivate> d;
friend class QDnsLookupRunnable;
@@ -77,16 +79,18 @@ class Q_NETWORK_EXPORT QDnsHostAddressRecord
public:
QDnsHostAddressRecord();
QDnsHostAddressRecord(const QDnsHostAddressRecord &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDnsHostAddressRecord &operator=(QDnsHostAddressRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QDnsHostAddressRecord &operator=(const QDnsHostAddressRecord &other);
~QDnsHostAddressRecord();
- void swap(QDnsHostAddressRecord &other) { qSwap(d, other.d); }
+ void swap(QDnsHostAddressRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
QHostAddress value() const;
- QDnsHostAddressRecord &operator=(const QDnsHostAddressRecord &other);
-
private:
QSharedDataPointer<QDnsHostAddressRecordPrivate> d;
friend class QDnsLookupRunnable;
@@ -99,17 +103,19 @@ class Q_NETWORK_EXPORT QDnsMailExchangeRecord
public:
QDnsMailExchangeRecord();
QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDnsMailExchangeRecord &operator=(QDnsMailExchangeRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QDnsMailExchangeRecord &operator=(const QDnsMailExchangeRecord &other);
~QDnsMailExchangeRecord();
- void swap(QDnsMailExchangeRecord &other) { qSwap(d, other.d); }
+ void swap(QDnsMailExchangeRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QString exchange() const;
QString name() const;
quint16 preference() const;
quint32 timeToLive() const;
- QDnsMailExchangeRecord &operator=(const QDnsMailExchangeRecord &other);
-
private:
QSharedDataPointer<QDnsMailExchangeRecordPrivate> d;
friend class QDnsLookupRunnable;
@@ -122,9 +128,13 @@ class Q_NETWORK_EXPORT QDnsServiceRecord
public:
QDnsServiceRecord();
QDnsServiceRecord(const QDnsServiceRecord &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDnsServiceRecord &operator=(QDnsServiceRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QDnsServiceRecord &operator=(const QDnsServiceRecord &other);
~QDnsServiceRecord();
- void swap(QDnsServiceRecord &other) { qSwap(d, other.d); }
+ void swap(QDnsServiceRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QString name() const;
quint16 port() const;
@@ -133,8 +143,6 @@ public:
quint32 timeToLive() const;
quint16 weight() const;
- QDnsServiceRecord &operator=(const QDnsServiceRecord &other);
-
private:
QSharedDataPointer<QDnsServiceRecordPrivate> d;
friend class QDnsLookupRunnable;
@@ -147,16 +155,18 @@ class Q_NETWORK_EXPORT QDnsTextRecord
public:
QDnsTextRecord();
QDnsTextRecord(const QDnsTextRecord &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QDnsTextRecord &operator=(QDnsTextRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
+ QDnsTextRecord &operator=(const QDnsTextRecord &other);
~QDnsTextRecord();
- void swap(QDnsTextRecord &other) { qSwap(d, other.d); }
+ void swap(QDnsTextRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
QList<QByteArray> values() const;
- QDnsTextRecord &operator=(const QDnsTextRecord &other);
-
private:
QSharedDataPointer<QDnsTextRecordPrivate> d;
friend class QDnsLookupRunnable;
@@ -201,9 +211,9 @@ public:
};
Q_ENUM(Type)
- explicit QDnsLookup(QObject *parent = 0);
- QDnsLookup(Type type, const QString &name, QObject *parent = 0);
- QDnsLookup(Type type, const QString &name, const QHostAddress &nameserver, QObject *parent = 0);
+ explicit QDnsLookup(QObject *parent = Q_NULLPTR);
+ QDnsLookup(Type type, const QString &name, QObject *parent = Q_NULLPTR);
+ QDnsLookup(Type type, const QString &name, const QHostAddress &nameserver, QObject *parent = Q_NULLPTR);
~QDnsLookup();
Error error() const;
diff --git a/src/network/kernel/qdnslookup_android.cpp b/src/network/kernel/qdnslookup_android.cpp
index b03c63c320..978da57609 100644
--- a/src/network/kernel/qdnslookup_android.cpp
+++ b/src/network/kernel/qdnslookup_android.cpp
@@ -41,7 +41,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
Q_UNUSED(requestName);
Q_UNUSED(nameserver);
Q_UNUSED(reply);
- qWarning() << Q_FUNC_INFO << "Not yet supported on Android";
+ qWarning("Not yet supported on Android");
reply->error = QDnsLookup::ResolverError;
reply->errorString = tr("Not yet supported on Android");
return;
diff --git a/src/network/kernel/qdnslookup_p.h b/src/network/kernel/qdnslookup_p.h
index 0ac37f6636..3c8c4d5824 100644
--- a/src/network/kernel/qdnslookup_p.h
+++ b/src/network/kernel/qdnslookup_p.h
@@ -89,6 +89,8 @@ public:
void _q_lookupFinished(const QDnsLookupReply &reply);
+ static const char *msgNoIpV6NameServerAdresses;
+
bool isFinished;
QString name;
QDnsLookup::Type type;
diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
index fa782dadf7..dc8ec5a300 100644
--- a/src/network/kernel/qdnslookup_unix.cpp
+++ b/src/network/kernel/qdnslookup_unix.cpp
@@ -166,9 +166,9 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
ns->sin6_addr.s6_addr[i] = ipv6Address[i];
}
#else
- qWarning() << Q_FUNC_INFO << "IPv6 addresses for nameservers is currently not supported";
+ qWarning("%s", QDnsLookupPrivate::msgNoIpV6NameServerAdresses);
reply->error = QDnsLookup::ResolverError;
- reply->errorString = tr("IPv6 addresses for nameservers is currently not supported");
+ reply->errorString = tr(QDnsLookupPrivate::msgNoIpV6NameServerAdresses);
return;
#endif
}
diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp
index 056a9c7a62..df0203bebb 100644
--- a/src/network/kernel/qdnslookup_win.cpp
+++ b/src/network/kernel/qdnslookup_win.cpp
@@ -60,9 +60,9 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
// For supoprting IPv6 nameserver addresses, we'll need to switch
// from DnsQuey() to DnsQueryEx() as it supports passing an IPv6
// address in the nameserver list
- qWarning() << Q_FUNC_INFO << "IPv6 addresses for nameservers is currently not supported";
+ qWarning("%s", QDnsLookupPrivate::msgNoIpV6NameServerAdresses);
reply->error = QDnsLookup::ResolverError;
- reply->errorString = tr("IPv6 addresses for nameservers is currently not supported");
+ reply->errorString = tr(QDnsLookupPrivate::msgNoIpV6NameServerAdresses);
return;
}
}
diff --git a/src/network/kernel/qdnslookup_winrt.cpp b/src/network/kernel/qdnslookup_winrt.cpp
index 8c6f9bfda5..8be63f1846 100644
--- a/src/network/kernel/qdnslookup_winrt.cpp
+++ b/src/network/kernel/qdnslookup_winrt.cpp
@@ -33,6 +33,7 @@
#include "qdnslookup_p.h"
+#include <qfunctions_winrt.h>
#include <qurl.h>
#include <qdebug.h>
@@ -50,6 +51,8 @@ using namespace ABI::Windows::Networking;
using namespace ABI::Windows::Networking::Connectivity;
using namespace ABI::Windows::Networking::Sockets;
+#define E_NO_SUCH_HOST 0x80072af9
+
QT_BEGIN_NAMESPACE
void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestName, const QHostAddress &nameserver, QDnsLookupReply *reply)
@@ -83,40 +86,47 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
}
ComPtr<IHostName> host;
HStringReference hostNameRef((const wchar_t*)aceHostname.utf16());
- hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
+ hr = hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IDatagramSocketStatics> datagramSocketStatics;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IAsyncOperation<IVectorView<EndpointPair *> *>> op;
- datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
+ hr = datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
HString::MakeReference(L"0").Get(),
&op);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IVectorView<EndpointPair *>> endpointPairs;
- hr = op->GetResults(&endpointPairs);
- int waitCount = 0;
- while (hr == E_ILLEGAL_METHOD_CALL) {
- WaitForSingleObjectEx(GetCurrentThread(), 50, FALSE);
- hr = op->GetResults(&endpointPairs);
- if (++waitCount > 1200) // Wait for 1 minute max
- return;
+ hr = QWinRTFunctions::await(op, endpointPairs.GetAddressOf(), QWinRTFunctions::YieldThread, 60 * 1000);
+ if (hr == E_NO_SUCH_HOST || !endpointPairs) {
+ reply->error = QDnsLookup::NotFoundError;
+ reply->errorString = tr("Host %1 could not be found.").arg(aceHostname);
+ return;
}
-
- if (!endpointPairs)
+ if (FAILED(hr)) {
+ reply->error = QDnsLookup::ServerFailureError;
+ reply->errorString = tr("Unknown error");
return;
+ }
unsigned int size;
- endpointPairs->get_Size(&size);
+ hr = endpointPairs->get_Size(&size);
+ Q_ASSERT_SUCCEEDED(hr);
// endpoint pairs might contain duplicates so we temporarily store addresses in a QSet
QSet<QHostAddress> addresses;
for (unsigned int i = 0; i < size; ++i) {
ComPtr<IEndpointPair> endpointpair;
- endpointPairs->GetAt(i, &endpointpair);
+ hr = endpointPairs->GetAt(i, &endpointpair);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IHostName> remoteHost;
- endpointpair->get_RemoteHostName(&remoteHost);
+ hr = endpointpair->get_RemoteHostName(&remoteHost);
+ Q_ASSERT_SUCCEEDED(hr);
HostNameType type;
- remoteHost->get_Type(&type);
+ hr = remoteHost->get_Type(&type);
+ Q_ASSERT_SUCCEEDED(hr);
if (type == HostNameType_Bluetooth || type == HostNameType_DomainName
|| (requestType != QDnsLookup::ANY
&& ((type == HostNameType_Ipv4 && requestType == QDnsLookup::AAAA)
@@ -124,7 +134,8 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
continue;
HString name;
- remoteHost->get_CanonicalName(name.GetAddressOf());
+ hr = remoteHost->get_CanonicalName(name.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
UINT32 length;
PCWSTR rawString = name.GetRawBuffer(&length);
addresses.insert(QHostAddress(QString::fromWCharArray(rawString, length)));
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 58c0de1f3b..d775007f46 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -46,6 +46,9 @@
#ifndef QT_NO_DATASTREAM
#include <qdatastream.h>
#endif
+#ifdef __SSE2__
+# include <private/qsimd_p.h>
+#endif
#ifdef QT_LINUXBASE
# include <arpa/inet.h>
@@ -106,7 +109,11 @@ public:
QString scopeId;
quint32 a; // IPv4 address
- Q_IPV6ADDR a6; // IPv6 address
+ union {
+ Q_IPV6ADDR a6; // IPv6 address
+ struct { quint64 c[2]; } a6_64;
+ struct { quint32 c[4]; } a6_32;
+ };
QAbstractSocket::NetworkLayerProtocol protocol;
bool isParsed;
@@ -123,24 +130,17 @@ QHostAddressPrivate::QHostAddressPrivate()
void QHostAddressPrivate::setAddress(quint32 a_)
{
a = a_;
+ protocol = QAbstractSocket::IPv4Protocol;
+ isParsed = true;
+
//create mapped address, except for a_ == 0 (any)
- memset(&a6, 0, sizeof(a6));
+ a6_64.c[0] = 0;
if (a) {
- a6[11] = 0xFF;
- a6[10] = 0xFF;
+ a6_32.c[2] = qToBigEndian(0xffff);
+ a6_32.c[3] = qToBigEndian(a);
} else {
- a6[11] = 0;
- a6[10] = 0;
+ a6_64.c[1] = 0;
}
-
- int i;
- for (i=15; a_ != 0; i--) {
- a6[i] = a_ & 0xFF;
- a_ >>=8;
- }
- Q_ASSERT(i >= 11);
- protocol = QAbstractSocket::IPv4Protocol;
- isParsed = true;
}
/// parses v4-mapped addresses or the AnyIPv6 address and stores in \a a;
@@ -163,21 +163,16 @@ static bool convertToIpv4(quint32& a, const Q_IPV6ADDR &a6)
void QHostAddressPrivate::setAddress(const quint8 *a_)
{
- for (int i = 0; i < 16; i++)
- a6[i] = a_[i];
- a = 0;
- convertToIpv4(a, a6);
protocol = QAbstractSocket::IPv6Protocol;
isParsed = true;
+ memcpy(a6.c, a_, sizeof(a6));
+ a = 0;
+ convertToIpv4(a, a6);
}
void QHostAddressPrivate::setAddress(const Q_IPV6ADDR &a_)
{
- a6 = a_;
- a = 0;
- convertToIpv4(a, a6);
- protocol = QAbstractSocket::IPv6Protocol;
- isParsed = true;
+ setAddress(a_.c);
}
static bool parseIp6(const QString &address, QIPAddressUtils::IPv6Address &addr, QString *scopeId)
@@ -193,7 +188,7 @@ static bool parseIp6(const QString &address, QIPAddressUtils::IPv6Address &addr,
return QIPAddressUtils::parseIp6(addr, tmp.constBegin(), tmp.constEnd()) == 0;
}
-bool QHostAddressPrivate::parse()
+Q_NEVER_INLINE bool QHostAddressPrivate::parse()
{
isParsed = true;
protocol = QAbstractSocket::UnknownNetworkLayerProtocol;
@@ -384,7 +379,7 @@ void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol prot
\value Any The dual stack any-address. A socket bound with this address will listen on both IPv4 and IPv6 interfaces.
*/
-/*! Constructs a host address object with the IP address 0.0.0.0.
+/*! Constructs a null host address object, i.e. an address which is not valid for any host or interface.
\sa clear()
*/
@@ -486,31 +481,35 @@ QHostAddress::QHostAddress(SpecialAddress address)
{
Q_IPV6ADDR ip6;
memset(&ip6, 0, sizeof ip6);
+ quint32 ip4 = INADDR_ANY;
switch (address) {
case Null:
- break;
+ return;
+
case Broadcast:
- d->setAddress(quint32(-1));
+ ip4 = INADDR_BROADCAST;
break;
case LocalHost:
- d->setAddress(0x7f000001);
- break;
- case LocalHostIPv6:
- ip6[15] = 1;
- d->setAddress(ip6);
+ ip4 = INADDR_LOOPBACK;
break;
case AnyIPv4:
- setAddress(0u);
break;
+
+ case LocalHostIPv6:
+ ip6[15] = 1;
+ // fall through
case AnyIPv6:
d->setAddress(ip6);
- break;
+ return;
+
case Any:
- d->clear();
d->protocol = QAbstractSocket::AnyIPProtocol;
- break;
+ return;
}
+
+ // common IPv4 part
+ d->setAddress(ip4);
}
/*!
@@ -775,11 +774,6 @@ QString QHostAddress::toString() const
on your host. Link-local addresses ("fe80...") are generated from the MAC
address of the local network adaptor, and are not guaranteed to be unique.
- \li Site-local: Addresses that are local to the site / private network
- (e.g., the company intranet). Site-local addresses ("fec0...") are
- usually distributed by the site router, and are not guaranteed to be
- unique outside of the local site.
-
\li Global: For globally routable addresses, such as public servers on the
Internet.
@@ -790,7 +784,7 @@ QString QHostAddress::toString() const
usually the same as the interface name (e.g., "eth0", "en1") or number
(e.g., "1", "2").
- \sa setScopeId()
+ \sa setScopeId(), QNetworkInterface, QNetworkInterface::interfaceFromName
*/
QString QHostAddress::scopeId() const
{
@@ -801,8 +795,14 @@ QString QHostAddress::scopeId() const
/*!
\since 4.1
- Sets the IPv6 scope ID of the address to \a id. If the address
- protocol is not IPv6, this function does nothing.
+ Sets the IPv6 scope ID of the address to \a id. If the address protocol is
+ not IPv6, this function does nothing. The scope ID may be set as an
+ interface name (such as "eth0" or "en1") or as an integer representing the
+ interface index. If \a id is an interface name, QtNetwork will convert to
+ an interface index using QNetworkInterface::interfaceIndexFromName() before
+ calling the operating system networking functions.
+
+ \sa scopeId(), QNetworkInterface, QNetworkInterface::interfaceFromName
*/
void QHostAddress::setScopeId(const QString &id)
{
@@ -836,34 +836,36 @@ bool QHostAddress::operator==(const QHostAddress &other) const
bool QHostAddress::operator ==(SpecialAddress other) const
{
QT_ENSURE_PARSED(this);
+ quint32 ip4 = INADDR_ANY;
switch (other) {
case Null:
return d->protocol == QAbstractSocket::UnknownNetworkLayerProtocol;
case Broadcast:
- return d->protocol == QAbstractSocket::IPv4Protocol && d->a == INADDR_BROADCAST;
+ ip4 = INADDR_BROADCAST;
+ break;
case LocalHost:
- return d->protocol == QAbstractSocket::IPv4Protocol && d->a == INADDR_LOOPBACK;
+ ip4 = INADDR_LOOPBACK;
+ break;
case Any:
return d->protocol == QAbstractSocket::AnyIPProtocol;
case AnyIPv4:
- return d->protocol == QAbstractSocket::IPv4Protocol && d->a == INADDR_ANY;
+ break;
case LocalHostIPv6:
case AnyIPv6:
if (d->protocol == QAbstractSocket::IPv6Protocol) {
- Q_IPV6ADDR ip6 = { { 0 } };
- ip6[15] = quint8(other == LocalHostIPv6); // 1 for localhost, 0 for any
- return memcmp(&d->a6, &ip6, sizeof ip6) == 0;
+ quint64 second = quint8(other == LocalHostIPv6); // 1 for localhost, 0 for any
+ return d->a6_64.c[0] == 0 && d->a6_64.c[1] == qToBigEndian(second);
}
return false;
}
- Q_UNREACHABLE();
- return false;
+ // common IPv4 part
+ return d->protocol == QAbstractSocket::IPv4Protocol && d->a == ip4;
}
/*!
@@ -1085,16 +1087,36 @@ bool QHostAddress::isLoopback() const
if ((d->a & 0xFF000000) == 0x7F000000)
return true; // v4 range (including IPv6 wrapped IPv4 addresses)
if (d->protocol == QAbstractSocket::IPv6Protocol) {
- if (d->a6.c[15] != 1)
+#ifdef __SSE2__
+ const __m128i loopback = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
+ __m128i ipv6 = _mm_loadu_si128((const __m128i *)d->a6.c);
+ __m128i cmp = _mm_cmpeq_epi8(ipv6, loopback);
+ return _mm_movemask_epi8(cmp) == 0xffff;
+#else
+ if (d->a6_64.c[0] != 0 || qFromBigEndian(d->a6_64.c[1]) != 1)
return false;
- for (int i = 0; i < 15; i++)
- if (d->a6[i] != 0)
- return false;
+#endif
return true;
}
return false;
}
+/*!
+ \since 5.6
+
+ Returns \c true if the address is an IPv4 or IPv6 multicast address, \c
+ false otherwise.
+*/
+bool QHostAddress::isMulticast() const
+{
+ QT_ENSURE_PARSED(this);
+ if ((d->a & 0xF0000000) == 0xE0000000)
+ return true; // 224.0.0.0-239.255.255.255 (including v4-mapped IPv6 addresses)
+ if (d->protocol == QAbstractSocket::IPv6Protocol)
+ return d->a6.c[0] == 0xff;
+ return false;
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QHostAddress &address)
{
@@ -1112,7 +1134,7 @@ uint qHash(const QHostAddress &key, uint seed)
{
// both lines might throw
QT_ENSURE_PARSED(&key);
- return qHash(QByteArray::fromRawData(reinterpret_cast<const char *>(key.d->a6.c), 16), seed);
+ return qHashBits(key.d->a6.c, 16, seed);
}
#ifndef QT_NO_DATASTREAM
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h
index 0c2229c334..9e3ee43d04 100644
--- a/src/network/kernel/qhostaddress.h
+++ b/src/network/kernel/qhostaddress.h
@@ -84,9 +84,16 @@ public:
QHostAddress(SpecialAddress address);
~QHostAddress();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QHostAddress &operator=(QHostAddress &&other) Q_DECL_NOTHROW
+ { swap(other); return *this; }
+#endif
+
QHostAddress &operator=(const QHostAddress &other);
QHostAddress &operator=(const QString &address);
+ void swap(QHostAddress &other) Q_DECL_NOTHROW { d.swap(other.d); }
+
void setAddress(quint32 ip4Addr);
void setAddress(quint8 *ip6Addr); // ### Qt 6: remove me
void setAddress(const quint8 *ip6Addr);
@@ -117,6 +124,7 @@ public:
bool isInSubnet(const QPair<QHostAddress, int> &subnet) const;
bool isLoopback() const;
+ bool isMulticast() const;
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
@@ -124,6 +132,7 @@ public:
protected:
QScopedPointer<QHostAddressPrivate> d;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QHostAddress)
inline bool operator ==(QHostAddress::SpecialAddress address1, const QHostAddress &address2)
{ return address2 == address1; }
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index a2ac9065fd..c6c09542e7 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -415,10 +415,22 @@ void QHostInfo::setErrorString(const QString &str)
/*!
\fn QString QHostInfo::localHostName()
- Returns the host name of this machine.
+ Returns this machine's host name, if one is configured. Note that hostnames
+ are not guaranteed to be globally unique, especially if they were
+ configured automatically.
- \sa hostName()
+ This function does not guarantee the returned host name is a Fully
+ Qualified Domain Name (FQDN). For that, use fromName() to resolve the
+ returned name to an FQDN.
+
+ This function returns the same as QSysInfo::machineHostName().
+
+ \sa hostName(), localDomainName()
*/
+QString QHostInfo::localHostName()
+{
+ return QSysInfo::machineHostName();
+}
/*!
\fn QString QHostInfo::localDomainName()
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 90a6f763f7..266a67771c 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -315,15 +315,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
return results;
}
-QString QHostInfo::localHostName()
-{
- char hostName[512];
- if (gethostname(hostName, sizeof(hostName)) == -1)
- return QString();
- hostName[sizeof(hostName) - 1] = '\0';
- return QString::fromLocal8Bit(hostName);
-}
-
QString QHostInfo::localDomainName()
{
#if !defined(Q_OS_VXWORKS) && !defined(Q_OS_ANDROID)
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp
index e044728198..7e45e9f949 100644
--- a/src/network/kernel/qhostinfo_win.cpp
+++ b/src/network/kernel/qhostinfo_win.cpp
@@ -34,7 +34,6 @@
#include <winsock2.h>
#include "qhostinfo_p.h"
-#include "private/qnativesocketengine_p.h"
#include <ws2tcpip.h>
#include <private/qsystemlibrary_p.h>
#include <qmutex.h>
@@ -77,14 +76,18 @@ static void resolveLibrary()
{
// Attempt to resolve getaddrinfo(); without it we'll have to fall
// back to gethostbyname(), which has no IPv6 support.
-#if !defined(Q_OS_WINCE)
- local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getaddrinfo");
- local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "freeaddrinfo");
- local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getnameinfo");
-#else
+#if defined(Q_OS_WINCE)
local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getaddrinfo");
local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "freeaddrinfo");
local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getnameinfo");
+#elif defined (Q_OS_WINRT)
+ local_getaddrinfo = (getaddrinfoProto) &getaddrinfo;
+ local_freeaddrinfo = (freeaddrinfoProto) &freeaddrinfo;
+ local_getnameinfo = (getnameinfoProto) getnameinfo;
+#else
+ local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getaddrinfo");
+ local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "freeaddrinfo");
+ local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getnameinfo");
#endif
}
@@ -111,7 +114,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
QMutexLocker locker(&qPrivCEMutex);
#endif
- QWindowsSockInit winSock;
+ QSysInfo::machineHostName(); // this initializes ws2_32.dll
// Load res_init on demand.
static QBasicAtomicInt triedResolve = Q_BASIC_ATOMIC_INITIALIZER(false);
@@ -136,7 +139,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
// Reverse lookup
if (local_getnameinfo) {
sockaddr_in sa4;
- qt_sockaddr_in6 sa6;
+ sockaddr_in6 sa6;
sockaddr *sa;
QT_SOCKLEN_T saSize;
if (address.protocol() == QAbstractSocket::IPv4Protocol) {
@@ -150,7 +153,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
saSize = sizeof(sa6);
memset(&sa6, 0, sizeof(sa6));
sa6.sin6_family = AF_INET6;
- memcpy(sa6.sin6_addr.qt_s6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr.qt_s6_addr));
+ memcpy(&sa6.sin6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr));
}
char hbuf[NI_MAXHOST];
@@ -197,7 +200,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
break;
case AF_INET6: {
QHostAddress addr;
- addr.setAddress(((qt_sockaddr_in6 *) p->ai_addr)->sin6_addr.qt_s6_addr);
+ addr.setAddress(((sockaddr_in6 *) p->ai_addr)->sin6_addr.s6_addr);
if (!addresses.contains(addr))
addresses.append(addr);
}
@@ -256,17 +259,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
return results;
}
-QString QHostInfo::localHostName()
-{
- QWindowsSockInit winSock;
-
- char hostName[512];
- if (gethostname(hostName, sizeof(hostName)) == -1)
- return QString();
- hostName[sizeof(hostName) - 1] = '\0';
- return QString::fromLocal8Bit(hostName);
-}
-
// QString QHostInfo::localDomainName() defined in qnetworkinterface_win.cpp
QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostinfo_winrt.cpp b/src/network/kernel/qhostinfo_winrt.cpp
deleted file mode 100644
index 1a97fe0e40..0000000000
--- a/src/network/kernel/qhostinfo_winrt.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module 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 "qhostinfo_p.h"
-
-#include <qurl.h>
-
-#include <wrl.h>
-#include <windows.networking.h>
-#include <windows.networking.sockets.h>
-#include <windows.networking.connectivity.h>
-using namespace Microsoft::WRL;
-using namespace Microsoft::WRL::Wrappers;
-using namespace ABI::Windows::Foundation;
-using namespace ABI::Windows::Foundation::Collections;
-using namespace ABI::Windows::Networking;
-using namespace ABI::Windows::Networking::Connectivity;
-using namespace ABI::Windows::Networking::Sockets;
-
-QT_BEGIN_NAMESPACE
-
-//#define QHOSTINFO_DEBUG
-
-QHostInfo QHostInfoAgent::fromName(const QString &hostName)
-{
- QHostInfo results;
-
- QHostAddress address;
- if (address.setAddress(hostName)) {
- // Reverse lookup
- // TODO: is there a replacement for getnameinfo for winrt?
- Q_UNIMPLEMENTED();
- return results;
- }
-
- QByteArray aceHostname = QUrl::toAce(hostName);
- results.setHostName(hostName);
- if (aceHostname.isEmpty()) {
- results.setError(QHostInfo::HostNotFound);
- results.setErrorString(hostName.isEmpty() ? tr("No host name given") : tr("Invalid hostname"));
- return results;
- }
-
- ComPtr<IHostNameFactory> hostnameFactory;
- HRESULT hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- IID_PPV_ARGS(&hostnameFactory));
- Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr)));
-
- ComPtr<IHostName> host;
- HStringReference hostNameRef((const wchar_t*)hostName.utf16());
- hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
-
- ComPtr<IDatagramSocketStatics> datagramSocketStatics;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
-
- ComPtr<IAsyncOperation<IVectorView<EndpointPair *> *>> op;
- datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
- HString::MakeReference(L"0").Get(),
- &op);
-
- ComPtr<IVectorView<EndpointPair *>> endpointPairs;
- hr = op->GetResults(&endpointPairs);
- int waitCount = 0;
- while (hr == E_ILLEGAL_METHOD_CALL) {
- WaitForSingleObjectEx(GetCurrentThread(), 50, FALSE);
- hr = op->GetResults(&endpointPairs);
- if (++waitCount > 1200) // Wait for 1 minute max
- return results;
- }
-
- if (!endpointPairs)
- return results;
-
- unsigned int size;
- endpointPairs->get_Size(&size);
- QList<QHostAddress> addresses;
- for (unsigned int i = 0; i < size; ++i) {
- ComPtr<IEndpointPair> endpointpair;
- endpointPairs->GetAt(i, &endpointpair);
- ComPtr<IHostName> remoteHost;
- endpointpair->get_RemoteHostName(&remoteHost);
- if (!remoteHost)
- continue;
- HostNameType type;
- remoteHost->get_Type(&type);
- if (type == HostNameType_DomainName)
- continue;
-
- HString name;
- remoteHost->get_CanonicalName(name.GetAddressOf());
- UINT32 length;
- PCWSTR rawString = name.GetRawBuffer(&length);
- QHostAddress addr;
- addr.setAddress(QString::fromWCharArray(rawString, length));
- if (!addresses.contains(addr))
- addresses.append(addr);
- }
- results.setAddresses(addresses);
-
- return results;
-}
-
-QString QHostInfo::localHostName()
-{
- ComPtr<INetworkInformationStatics> statics;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &statics);
-
- ComPtr<IVectorView<HostName *>> hostNames;
- statics->GetHostNames(&hostNames);
- if (!hostNames)
- return QString();
-
- unsigned int size;
- hostNames->get_Size(&size);
- if (size == 0)
- return QString();
-
- for (unsigned int i = 0; i < size; ++i) {
- ComPtr<IHostName> hostName;
- hostNames->GetAt(i, &hostName);
- HostNameType type;
- hostName->get_Type(&type);
- if (type != HostNameType_DomainName)
- continue;
-
- HString name;
- hostName->get_CanonicalName(name.GetAddressOf());
- UINT32 length;
- PCWSTR rawString = name.GetRawBuffer(&length);
- return QString::fromWCharArray(rawString, length);
- }
- ComPtr<IHostName> firstHost;
- hostNames->GetAt(0, &firstHost);
-
- HString name;
- firstHost->get_CanonicalName(name.GetAddressOf());
- UINT32 length;
- PCWSTR rawString = name.GetRawBuffer(&length);
- return QString::fromWCharArray(rawString, length);
-}
-
-// QString QHostInfo::localDomainName() defined in qnetworkinterface_win.cpp
-
-QT_END_NAMESPACE
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 8d891733ac..4a527052d1 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -86,9 +86,16 @@ QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interface
{
QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();
QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();
- for ( ; it != interfaceList.constEnd(); ++it)
- if ((*it)->name == name)
+
+ bool ok;
+ uint index = name.toUInt(&ok);
+
+ for ( ; it != interfaceList.constEnd(); ++it) {
+ if (ok && (*it)->index == int(index))
return *it;
+ else if ((*it)->name == name)
+ return *it;
+ }
return empty;
}
@@ -108,6 +115,7 @@ QList<QSharedDataPointer<QNetworkInterfacePrivate> > QNetworkInterfaceManager::a
{
QList<QNetworkInterfacePrivate *> list = postProcess(scan());
QList<QSharedDataPointer<QNetworkInterfacePrivate> > result;
+ result.reserve(list.size());
foreach (QNetworkInterfacePrivate *ptr, list)
result << QSharedDataPointer<QNetworkInterfacePrivate>(ptr);
@@ -515,6 +523,9 @@ QList<QNetworkAddressEntry> QNetworkInterface::addressEntries() const
name. If no such interface exists, this function returns an
invalid QNetworkInterface object.
+ The string \a name may be either an actual interface name (such as "eth0"
+ or "en1") or an interface index in string form ("1", "2", etc.).
+
\sa name(), isValid()
*/
QNetworkInterface QNetworkInterface::interfaceFromName(const QString &name)
@@ -549,6 +560,7 @@ QList<QNetworkInterface> QNetworkInterface::allInterfaces()
{
QList<QSharedDataPointer<QNetworkInterfacePrivate> > privs = manager()->allInterfaces();
QList<QNetworkInterface> result;
+ result.reserve(privs.size());
foreach (const QSharedDataPointer<QNetworkInterfacePrivate> &p, privs) {
QNetworkInterface item;
item.d = p;
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h
index a4d93156fb..b3daa3d4a0 100644
--- a/src/network/kernel/qnetworkinterface.h
+++ b/src/network/kernel/qnetworkinterface.h
@@ -51,10 +51,13 @@ class Q_NETWORK_EXPORT QNetworkAddressEntry
public:
QNetworkAddressEntry();
QNetworkAddressEntry(const QNetworkAddressEntry &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkAddressEntry &operator=(QNetworkAddressEntry &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other);
~QNetworkAddressEntry();
- void swap(QNetworkAddressEntry &other) { qSwap(d, other.d); }
+ void swap(QNetworkAddressEntry &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkAddressEntry &other) const;
inline bool operator!=(const QNetworkAddressEntry &other) const
@@ -93,10 +96,13 @@ public:
QNetworkInterface();
QNetworkInterface(const QNetworkInterface &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkInterface &operator=(QNetworkInterface &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkInterface &operator=(const QNetworkInterface &other);
~QNetworkInterface();
- void swap(QNetworkInterface &other) { qSwap(d, other.d); }
+ void swap(QNetworkInterface &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool isValid() const;
@@ -127,6 +133,9 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networ
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QNetworkAddressEntry)
+Q_DECLARE_METATYPE(QNetworkInterface)
+
#endif // QT_NO_NETWORKINTERFACE
#endif
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp
index 9c5ba4e799..5e6d24dd44 100644
--- a/src/network/kernel/qnetworkinterface_unix.cpp
+++ b/src/network/kernel/qnetworkinterface_unix.cpp
@@ -127,14 +127,13 @@ static QNetworkInterface::InterfaceFlags convertFlags(uint rawFlags)
#ifdef QT_NO_GETIFADDRS
// getifaddrs not available
-static const int STORAGEBUFFER_GROWTH = 256;
-
static QSet<QByteArray> interfaceNames(int socket)
{
QSet<QByteArray> result;
#ifdef QT_NO_IPV6IFNAME
QByteArray storageBuffer;
struct ifconf interfaceList;
+ static const int STORAGEBUFFER_GROWTH = 256;
forever {
// grow the storage buffer
@@ -186,9 +185,14 @@ static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfa
QNetworkInterfacePrivate *iface = 0;
int ifindex = 0;
-#ifndef QT_NO_IPV6IFNAME
+#if !defined(QT_NO_IPV6IFNAME) || defined(SIOCGIFINDEX)
// Get the interface index
+# ifdef SIOCGIFINDEX
+ if (qt_safe_ioctl(socket, SIOCGIFINDEX, &req) >= 0)
+ ifindex = req.ifr_ifindex;
+# else
ifindex = if_nametoindex(req.ifr_name);
+# endif
// find the interface data
QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin();
@@ -214,6 +218,27 @@ static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfa
iface = new QNetworkInterfacePrivate;
iface->index = ifindex;
interfaces << iface;
+ }
+
+ return iface;
+}
+
+static QList<QNetworkInterfacePrivate *> interfaceListing()
+{
+ QList<QNetworkInterfacePrivate *> interfaces;
+
+ int socket;
+ if ((socket = qt_safe_socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) == -1)
+ return interfaces; // error
+
+ QSet<QByteArray> names = interfaceNames(socket);
+ QSet<QByteArray>::ConstIterator it = names.constBegin();
+ for ( ; it != names.constEnd(); ++it) {
+ ifreq req;
+ memset(&req, 0, sizeof(ifreq));
+ memcpy(req.ifr_name, *it, qMin<int>(it->length() + 1, sizeof(req.ifr_name) - 1));
+
+ QNetworkInterfacePrivate *iface = findInterface(socket, interfaces, req);
#ifdef SIOCGIFNAME
// Get the canonical name
@@ -242,27 +267,6 @@ static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfa
iface->hardwareAddress = iface->makeHwAddress(6, addr);
}
#endif
- }
-
- return iface;
-}
-
-static QList<QNetworkInterfacePrivate *> interfaceListing()
-{
- QList<QNetworkInterfacePrivate *> interfaces;
-
- int socket;
- if ((socket = qt_safe_socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) == -1)
- return interfaces; // error
-
- QSet<QByteArray> names = interfaceNames(socket);
- QSet<QByteArray>::ConstIterator it = names.constBegin();
- for ( ; it != names.constEnd(); ++it) {
- ifreq req;
- memset(&req, 0, sizeof(ifreq));
- memcpy(req.ifr_name, *it, qMin<int>(it->length() + 1, sizeof(req.ifr_name) - 1));
-
- QNetworkInterfacePrivate *iface = findInterface(socket, interfaces, req);
// Get the interface broadcast address
QNetworkAddressEntry entry;
@@ -310,10 +314,15 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
{
QList<QNetworkInterfacePrivate *> interfaces;
QSet<QString> seenInterfaces;
-
- // on Linux, AF_PACKET addresses carry the hardware address and interface index;
- // scan for them first (they're usually first, but we have no guarantee this
- // will be the case forever)
+ QVarLengthArray<int, 16> seenIndexes; // faster than QSet<int>
+
+ // On Linux, glibc, uClibc and MUSL obtain the address listing via two
+ // netlink calls: first an RTM_GETLINK to obtain the interface listing,
+ // then one RTM_GETADDR to get all the addresses (uClibc implementation is
+ // copied from glibc; Bionic currently doesn't support getifaddrs). They
+ // synthesize AF_PACKET addresses from the RTM_GETLINK responses, which
+ // means by construction they currently show up first in the interface
+ // listing.
for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) {
if (ptr->ifa_addr && ptr->ifa_addr->sa_family == AF_PACKET) {
sockaddr_ll *sll = (sockaddr_ll *)ptr->ifa_addr;
@@ -324,23 +333,30 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
iface->flags = convertFlags(ptr->ifa_flags);
iface->hardwareAddress = iface->makeHwAddress(sll->sll_halen, (uchar*)sll->sll_addr);
+ Q_ASSERT(!seenIndexes.contains(iface->index));
+ seenIndexes.append(iface->index);
seenInterfaces.insert(iface->name);
}
}
// see if we missed anything:
- // virtual interfaces with no HW address have no AF_PACKET
+ // - virtual interfaces with no HW address have no AF_PACKET
+ // - interface labels have no AF_PACKET, but shouldn't be shown as a new interface
for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) {
if (ptr->ifa_addr && ptr->ifa_addr->sa_family != AF_PACKET) {
QString name = QString::fromLatin1(ptr->ifa_name);
if (seenInterfaces.contains(name))
continue;
+ int ifindex = if_nametoindex(ptr->ifa_name);
+ if (seenIndexes.contains(ifindex))
+ continue;
+
QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
interfaces << iface;
iface->name = name;
iface->flags = convertFlags(ptr->ifa_flags);
- iface->index = if_nametoindex(ptr->ifa_name);
+ iface->index = ifindex;
}
}
@@ -419,7 +435,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
interfaces = createInterfaces(interfaceListing);
for (ifaddrs *ptr = interfaceListing; ptr; ptr = ptr->ifa_next) {
- // Get the interface index
+ // Find the interface
QString name = QString::fromLatin1(ptr->ifa_name);
QNetworkInterfacePrivate *iface = 0;
QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin();
@@ -429,6 +445,18 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
iface = *if_it;
break;
}
+
+ if (!iface) {
+ // it may be an interface label, search by interface index
+ int ifindex = if_nametoindex(ptr->ifa_name);
+ for (if_it = interfaces.begin(); if_it != interfaces.end(); ++if_it)
+ if ((*if_it)->index == ifindex) {
+ // found this interface already
+ iface = *if_it;
+ break;
+ }
+ }
+
if (!iface) {
// skip all non-IP interfaces
continue;
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp
index ddeb6c111f..907638f73e 100644
--- a/src/network/kernel/qnetworkinterface_win.cpp
+++ b/src/network/kernel/qnetworkinterface_win.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -31,7 +32,7 @@
**
****************************************************************************/
-#include "qnetworkinterface_win_p.h"
+#define WIN32_LEAN_AND_MEAN 1
#include "qnetworkinterface.h"
#include "qnetworkinterface_p.h"
@@ -41,16 +42,23 @@
#include <qhostinfo.h>
#include <qhash.h>
#include <qurl.h>
-#include <private/qsystemlibrary_p.h>
+
+// Since we need to include winsock2.h, we need to define WIN32_LEAN_AND_MEAN
+// (above) so windows.h won't include winsock.h.
+// In addition, we need to include winsock2.h before iphlpapi.h and we need
+// to include ws2ipdef.h to work around an MinGW-w64 bug
+// (http://sourceforge.net/p/mingw-w64/mailman/message/32935366/)
+#include <winsock2.h>
+#include <ws2ipdef.h>
+#include <iphlpapi.h>
+#include <ws2tcpip.h>
+
+#include <qt_windows.h>
QT_BEGIN_NAMESPACE
-typedef DWORD (WINAPI *PtrGetAdaptersInfo)(PIP_ADAPTER_INFO, PULONG);
-static PtrGetAdaptersInfo ptrGetAdaptersInfo = 0;
-typedef ULONG (WINAPI *PtrGetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
-static PtrGetAdaptersAddresses ptrGetAdaptersAddresses = 0;
-typedef DWORD (WINAPI *PtrGetNetworkParams)(PFIXED_INFO, PULONG);
-static PtrGetNetworkParams ptrGetNetworkParams = 0;
+typedef NETIO_STATUS (WINAPI *PtrConvertInterfaceLuidToName)(const NET_LUID *, PWSTR, SIZE_T);
+static PtrConvertInterfaceLuidToName ptrConvertInterfaceLuidToName = 0;
static void resolveLibs()
{
@@ -58,21 +66,17 @@ static void resolveLibs()
static bool done = false;
if (!done) {
- done = true;
-
- HINSTANCE iphlpapiHnd = QSystemLibrary::load(L"iphlpapi");
- if (iphlpapiHnd == NULL)
- return;
+ HINSTANCE iphlpapiHnd = GetModuleHandle(L"iphlpapi");
+ Q_ASSERT(iphlpapiHnd);
#if defined(Q_OS_WINCE)
- ptrGetAdaptersInfo = (PtrGetAdaptersInfo)GetProcAddress(iphlpapiHnd, L"GetAdaptersInfo");
- ptrGetAdaptersAddresses = (PtrGetAdaptersAddresses)GetProcAddress(iphlpapiHnd, L"GetAdaptersAddresses");
- ptrGetNetworkParams = (PtrGetNetworkParams)GetProcAddress(iphlpapiHnd, L"GetNetworkParams");
+ // since Windows Embedded Compact 7
+ ptrConvertInterfaceLuidToName = (PtrConvertInterfaceLuidToName)GetProcAddress(iphlpapiHnd, L"ConvertInterfaceLuidToNameW");
#else
- ptrGetAdaptersInfo = (PtrGetAdaptersInfo)GetProcAddress(iphlpapiHnd, "GetAdaptersInfo");
- ptrGetAdaptersAddresses = (PtrGetAdaptersAddresses)GetProcAddress(iphlpapiHnd, "GetAdaptersAddresses");
- ptrGetNetworkParams = (PtrGetNetworkParams)GetProcAddress(iphlpapiHnd, "GetNetworkParams");
+ // since Windows Vista
+ ptrConvertInterfaceLuidToName = (PtrConvertInterfaceLuidToName)GetProcAddress(iphlpapiHnd, "ConvertInterfaceLuidToNameW");
#endif
+ done = true;
}
}
@@ -85,8 +89,8 @@ static QHostAddress addressFromSockaddr(sockaddr *sa)
if (sa->sa_family == AF_INET)
address.setAddress(htonl(((sockaddr_in *)sa)->sin_addr.s_addr));
else if (sa->sa_family == AF_INET6) {
- address.setAddress(((qt_sockaddr_in6 *)sa)->sin6_addr.qt_s6_addr);
- int scope = ((qt_sockaddr_in6 *)sa)->sin6_scope_id;
+ address.setAddress(((sockaddr_in6 *)sa)->sin6_addr.s6_addr);
+ int scope = ((sockaddr_in6 *)sa)->sin6_scope_id;
if (scope)
address.setScopeId(QString::number(scope));
} else
@@ -103,14 +107,14 @@ static QHash<QHostAddress, QHostAddress> ipv4Netmasks()
ULONG bufSize = sizeof staticBuf;
QHash<QHostAddress, QHostAddress> ipv4netmasks;
- DWORD retval = ptrGetAdaptersInfo(pAdapter, &bufSize);
+ DWORD retval = GetAdaptersInfo(pAdapter, &bufSize);
if (retval == ERROR_BUFFER_OVERFLOW) {
// need more memory
pAdapter = (IP_ADAPTER_INFO *)malloc(bufSize);
if (!pAdapter)
return ipv4netmasks;
// try again
- if (ptrGetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) {
+ if (GetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) {
free(pAdapter);
return ipv4netmasks;
}
@@ -145,14 +149,14 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
ULONG flags = GAA_FLAG_INCLUDE_PREFIX |
GAA_FLAG_SKIP_DNS_SERVER |
GAA_FLAG_SKIP_MULTICAST;
- ULONG retval = ptrGetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize);
+ ULONG retval = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize);
if (retval == ERROR_BUFFER_OVERFLOW) {
// need more memory
pAdapter = (IP_ADAPTER_ADDRESSES *)malloc(bufSize);
if (!pAdapter)
return interfaces;
// try again
- if (ptrGetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize) != ERROR_SUCCESS) {
+ if (GetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize) != ERROR_SUCCESS) {
free(pAdapter);
return interfaces;
}
@@ -180,7 +184,16 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
if (ptr->IfType == IF_TYPE_PPP)
iface->flags |= QNetworkInterface::IsPointToPoint;
- iface->name = QString::fromLocal8Bit(ptr->AdapterName);
+ if (ptrConvertInterfaceLuidToName && ptr->Length >= offsetof(IP_ADAPTER_ADDRESSES, Luid)) {
+ // use ConvertInterfaceLuidToName 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)
+ iface->name = QString::fromWCharArray(buf);
+ }
+ if (iface->name.isEmpty())
+ iface->name = QString::fromLocal8Bit(ptr->AdapterName);
+
iface->friendlyName = QString::fromWCharArray(ptr->FriendlyName);
if (ptr->PhysicalAddressLength)
iface->hardwareAddress = iface->makeHwAddress(ptr->PhysicalAddressLength,
@@ -221,92 +234,25 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP()
return interfaces;
}
-static QList<QNetworkInterfacePrivate *> interfaceListingWin2k()
-{
- QList<QNetworkInterfacePrivate *> interfaces;
- IP_ADAPTER_INFO staticBuf[2]; // 2 is arbitrary
- PIP_ADAPTER_INFO pAdapter = staticBuf;
- ULONG bufSize = sizeof staticBuf;
-
- DWORD retval = ptrGetAdaptersInfo(pAdapter, &bufSize);
- if (retval == ERROR_BUFFER_OVERFLOW) {
- // need more memory
- pAdapter = (IP_ADAPTER_INFO *)malloc(bufSize);
- if (!pAdapter)
- return interfaces;
- // try again
- if (ptrGetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) {
- free(pAdapter);
- return interfaces;
- }
- } else if (retval != ERROR_SUCCESS) {
- // error
- return interfaces;
- }
-
- // iterate over the list and add the entries to our listing
- for (PIP_ADAPTER_INFO ptr = pAdapter; ptr; ptr = ptr->Next) {
- QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
- interfaces << iface;
-
- iface->index = ptr->Index;
- iface->flags = QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
- if (ptr->Type == MIB_IF_TYPE_PPP)
- iface->flags |= QNetworkInterface::IsPointToPoint;
- else
- iface->flags |= QNetworkInterface::CanBroadcast;
- iface->name = QString::fromLocal8Bit(ptr->AdapterName);
- iface->hardwareAddress = QNetworkInterfacePrivate::makeHwAddress(ptr->AddressLength,
- ptr->Address);
-
- for (PIP_ADDR_STRING addr = &ptr->IpAddressList; addr; addr = addr->Next) {
- QNetworkAddressEntry entry;
- entry.setIp(QHostAddress(QLatin1String(addr->IpAddress.String)));
- entry.setNetmask(QHostAddress(QLatin1String(addr->IpMask.String)));
- // broadcast address is set on postProcess()
-
- iface->addressEntries << entry;
- }
- }
-
- if (pAdapter != staticBuf)
- free(pAdapter);
-
- return interfaces;
-}
-
-static QList<QNetworkInterfacePrivate *> interfaceListing()
-{
- resolveLibs();
- if (ptrGetAdaptersAddresses != NULL)
- return interfaceListingWinXP();
- else if (ptrGetAdaptersInfo != NULL)
- return interfaceListingWin2k();
-
- // failed
- return QList<QNetworkInterfacePrivate *>();
-}
-
QList<QNetworkInterfacePrivate *> QNetworkInterfaceManager::scan()
{
- return interfaceListing();
+ resolveLibs();
+ return interfaceListingWinXP();
}
QString QHostInfo::localDomainName()
{
resolveLibs();
- if (ptrGetNetworkParams == NULL)
- return QString(); // couldn't resolve
FIXED_INFO info, *pinfo;
ULONG bufSize = sizeof info;
pinfo = &info;
- if (ptrGetNetworkParams(pinfo, &bufSize) == ERROR_BUFFER_OVERFLOW) {
+ if (GetNetworkParams(pinfo, &bufSize) == ERROR_BUFFER_OVERFLOW) {
pinfo = (FIXED_INFO *)malloc(bufSize);
if (!pinfo)
return QString();
// try again
- if (ptrGetNetworkParams(pinfo, &bufSize) != ERROR_SUCCESS) {
+ if (GetNetworkParams(pinfo, &bufSize) != ERROR_SUCCESS) {
free(pinfo);
return QString(); // error
}
diff --git a/src/network/kernel/qnetworkinterface_win_p.h b/src/network/kernel/qnetworkinterface_win_p.h
deleted file mode 100644
index 88c1945fe6..0000000000
--- a/src/network/kernel/qnetworkinterface_win_p.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtNetwork module 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 QNETWORKINTERFACE_WIN_P_H
-#define QNETWORKINTERFACE_WIN_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 QLibrary class. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qglobal.h>
-#include <winsock2.h>
-#include <qt_windows.h>
-#include <time.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef GAA_FLAG_INCLUDE_ALL_INTERFACES
-# define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x0100
-#endif
-#ifndef MAX_ADAPTER_ADDRESS_LENGTH
-// definitions from iptypes.h
-# define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
-# define MAX_ADAPTER_NAME_LENGTH 256 // arb.
-# define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
-# define DEFAULT_MINIMUM_ENTITIES 32 // arb.
-# define MAX_HOSTNAME_LEN 128 // arb.
-# define MAX_DOMAIN_NAME_LEN 128 // arb.
-# define MAX_SCOPE_ID_LEN 256 // arb.
-
-# define GAA_FLAG_SKIP_UNICAST 0x0001
-# define GAA_FLAG_SKIP_ANYCAST 0x0002
-# define GAA_FLAG_SKIP_MULTICAST 0x0004
-# define GAA_FLAG_SKIP_DNS_SERVER 0x0008
-# define GAA_FLAG_INCLUDE_PREFIX 0x0010
-# define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
-
-# define IP_ADAPTER_DDNS_ENABLED 0x01
-# define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x02
-# define IP_ADAPTER_DHCP_ENABLED 0x04
-# define IP_ADAPTER_RECEIVE_ONLY 0x08
-# define IP_ADAPTER_NO_MULTICAST 0x10
-# define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20
-
-# define MIB_IF_TYPE_OTHER 1
-# define MIB_IF_TYPE_ETHERNET 6
-# define MIB_IF_TYPE_TOKENRING 9
-# define MIB_IF_TYPE_FDDI 15
-# define MIB_IF_TYPE_PPP 23
-# define MIB_IF_TYPE_LOOPBACK 24
-# define MIB_IF_TYPE_SLIP 28
-
-// definitions from Ipifcons.h
-#define IF_TYPE_PPP 23
-
-#endif
-// copied from qnativesocketengine_win.cpp
-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;
-
-// copied from MSDN online help
-typedef enum {
- IpPrefixOriginOther = 0,
- IpPrefixOriginManual,
- IpPrefixOriginWellKnown,
- IpPrefixOriginDhcp,
- IpPrefixOriginRouterAdvertisement
-} IP_PREFIX_ORIGIN;
-
-typedef enum {
- IpSuffixOriginOther = 0,
- IpSuffixOriginManual,
- IpSuffixOriginWellKnown,
- IpSuffixOriginDhcp,
- IpSuffixOriginLinkLayerAddress,
- IpSuffixOriginRandom
-} IP_SUFFIX_ORIGIN;
-
-typedef enum {
- IpDadStateInvalid = 0,
- IpDadStateTentative,
- IpDadStateDuplicate,
- IpDadStateDeprecated,
- IpDadStatePreferred,
-} IP_DAD_STATE;
-
-typedef enum {
- IfOperStatusUp = 1,
- IfOperStatusDown,
- IfOperStatusTesting,
- IfOperStatusUnknown,
- IfOperStatusDormant,
- IfOperStatusNotPresent,
- IfOperStatusLowerLayerDown
-} IF_OPER_STATUS;
-
-typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Flags;
- };
- };
- struct _IP_ADAPTER_UNICAST_ADDRESS* Next;
- SOCKET_ADDRESS Address;
- IP_PREFIX_ORIGIN PrefixOrigin;
- IP_SUFFIX_ORIGIN SuffixOrigin;
- IP_DAD_STATE DadState;
- ULONG ValidLifetime;
- ULONG PreferredLifetime;
- ULONG LeaseLifetime;
-} IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS;
-
-typedef struct _IP_ADAPTER_ANYCAST_ADDRESS
- IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS;
-
-typedef struct _IP_ADAPTER_MULTICAST_ADDRESS
- IP_ADAPTER_MULTICAST_ADDRESS,
- *PIP_ADAPTER_MULTICAST_ADDRESS;
-
-typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS
- IP_ADAPTER_DNS_SERVER_ADDRESS,
- *PIP_ADAPTER_DNS_SERVER_ADDRESS;
-
-typedef struct _IP_ADAPTER_PREFIX {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD Flags;
- };
- };
- struct _IP_ADAPTER_PREFIX* Next;
- SOCKET_ADDRESS Address;
- ULONG PrefixLength;
-} IP_ADAPTER_PREFIX,
- *PIP_ADAPTER_PREFIX;
-
-typedef struct _IP_ADAPTER_ADDRESSES {
- union {
- ULONGLONG Alignment;
- struct {
- ULONG Length;
- DWORD IfIndex;
- };
- };
- struct _IP_ADAPTER_ADDRESSES* Next;
- PCHAR AdapterName;
- PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
- PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress;
- PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress;
- PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress;
- PWCHAR DnsSuffix;
- PWCHAR Description;
- PWCHAR FriendlyName;
- BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
- DWORD PhysicalAddressLength;
- DWORD Flags;
- DWORD Mtu;
- DWORD IfType;
- IF_OPER_STATUS OperStatus;
- DWORD Ipv6IfIndex;
- DWORD ZoneIndices[16];
- PIP_ADAPTER_PREFIX FirstPrefix;
-} IP_ADAPTER_ADDRESSES,
- *PIP_ADAPTER_ADDRESSES;
-
-typedef struct {
- char String[4 * 4];
-} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
-
-typedef struct _IP_ADDR_STRING {
- struct _IP_ADDR_STRING* Next;
- IP_ADDRESS_STRING IpAddress;
- IP_MASK_STRING IpMask;
- DWORD Context;
-} IP_ADDR_STRING,
- *PIP_ADDR_STRING;
-
-typedef struct _IP_ADAPTER_INFO {
- struct _IP_ADAPTER_INFO* Next;
- DWORD ComboIndex;
- char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
- char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
- UINT AddressLength;
- BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
- DWORD Index;
- UINT Type;
- UINT DhcpEnabled;
- PIP_ADDR_STRING CurrentIpAddress;
- IP_ADDR_STRING IpAddressList;
- IP_ADDR_STRING GatewayList;
- IP_ADDR_STRING DhcpServer;
- BOOL HaveWins;
- IP_ADDR_STRING PrimaryWinsServer;
- IP_ADDR_STRING SecondaryWinsServer;
- time_t LeaseObtained;
- time_t LeaseExpires;
-} IP_ADAPTER_INFO,
- *PIP_ADAPTER_INFO;
-
-typedef struct {
- char HostName[MAX_HOSTNAME_LEN + 4];
- char DomainName[MAX_DOMAIN_NAME_LEN + 4];
- PIP_ADDR_STRING CurrentDnsServer;
- IP_ADDR_STRING DnsServerList;
- UINT NodeType;
- char ScopeId[MAX_SCOPE_ID_LEN + 4];
- UINT EnableRouting;
- UINT EnableProxy;
- UINT EnableDns;
-} FIXED_INFO, *PFIXED_INFO;
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/network/kernel/qnetworkinterface_winrt.cpp b/src/network/kernel/qnetworkinterface_winrt.cpp
index 0234154427..1945b2427f 100644
--- a/src/network/kernel/qnetworkinterface_winrt.cpp
+++ b/src/network/kernel/qnetworkinterface_winrt.cpp
@@ -36,6 +36,8 @@
#ifndef QT_NO_NETWORKINTERFACE
+#include <qfunctions_winrt.h>
+
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
@@ -59,6 +61,57 @@ struct HostNameInfo {
QString address;
};
+static QNetworkInterfacePrivate *interfaceFromProfile(IConnectionProfile *profile, QList<HostNameInfo> *hostList)
+{
+ if (!profile)
+ return 0;
+
+ QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
+
+ NetworkConnectivityLevel connectivityLevel;
+ HRESULT hr = profile->GetNetworkConnectivityLevel(&connectivityLevel);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (connectivityLevel != NetworkConnectivityLevel_None)
+ iface->flags = QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
+
+ ComPtr<INetworkAdapter> adapter;
+ hr = profile->get_NetworkAdapter(&adapter);
+ // Indicates that no internet connection is available/the device is in airplane mode
+ if (hr == E_INVALIDARG)
+ return 0;
+ Q_ASSERT_SUCCEEDED(hr);
+ UINT32 type;
+ hr = adapter->get_IanaInterfaceType(&type);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (type == 23)
+ iface->flags |= QNetworkInterface::IsPointToPoint;
+ GUID id;
+ hr = adapter->get_NetworkAdapterId(&id);
+ Q_ASSERT_SUCCEEDED(hr);
+ OLECHAR adapterName[39]={0};
+ StringFromGUID2(id, adapterName, 39);
+ iface->name = QString::fromWCharArray(adapterName);
+
+ // According to http://stackoverflow.com/questions/12936193/how-unique-is-the-ethernet-network-adapter-id-in-winrt-it-is-derived-from-the-m
+ // obtaining the MAC address using WinRT API is impossible
+ // iface->hardwareAddress = ?
+
+ for (int i = 0; i < hostList->length(); ++i) {
+ const HostNameInfo hostInfo = hostList->at(i);
+ if (id != hostInfo.adapterId)
+ continue;
+
+ QNetworkAddressEntry entry;
+ entry.setIp(QHostAddress(hostInfo.address));
+ entry.setPrefixLength(hostInfo.prefixLength);
+ iface->addressEntries << entry;
+
+ hostList->takeAt(i);
+ --i;
+ }
+ return iface;
+}
+
static QList<QNetworkInterfacePrivate *> interfaceListing()
{
QList<QNetworkInterfacePrivate *> interfaces;
@@ -66,36 +119,46 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
QList<HostNameInfo> hostList;
ComPtr<INetworkInformationStatics> hostNameStatics;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &hostNameStatics);
+ HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &hostNameStatics);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IVectorView<HostName *>> hostNames;
- hostNameStatics->GetHostNames(&hostNames);
+ hr = hostNameStatics->GetHostNames(&hostNames);
+ Q_ASSERT_SUCCEEDED(hr);
if (!hostNames)
return interfaces;
unsigned int hostNameCount;
- hostNames->get_Size(&hostNameCount);
+ hr = hostNames->get_Size(&hostNameCount);
+ Q_ASSERT_SUCCEEDED(hr);
for (unsigned i = 0; i < hostNameCount; ++i) {
HostNameInfo hostInfo;
ComPtr<IHostName> hostName;
- hostNames->GetAt(i, &hostName);
+ hr = hostNames->GetAt(i, &hostName);
+ Q_ASSERT_SUCCEEDED(hr);
HostNameType type;
- hostName->get_Type(&type);
+ hr = hostName->get_Type(&type);
+ Q_ASSERT_SUCCEEDED(hr);
if (type == HostNameType_DomainName)
continue;
ComPtr<IIPInformation> ipInformation;
- hostName->get_IPInformation(&ipInformation);
+ hr = hostName->get_IPInformation(&ipInformation);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<INetworkAdapter> currentAdapter;
- ipInformation->get_NetworkAdapter(&currentAdapter);
+ hr = ipInformation->get_NetworkAdapter(&currentAdapter);
+ Q_ASSERT_SUCCEEDED(hr);
- currentAdapter->get_NetworkAdapterId(&hostInfo.adapterId);
+ hr = currentAdapter->get_NetworkAdapterId(&hostInfo.adapterId);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IReference<unsigned char>> prefixLengthReference;
- ipInformation->get_PrefixLength(&prefixLengthReference);
+ hr = ipInformation->get_PrefixLength(&prefixLengthReference);
+ Q_ASSERT_SUCCEEDED(hr);
- prefixLengthReference->get_Value(&hostInfo.prefixLength);
+ hr = prefixLengthReference->get_Value(&hostInfo.prefixLength);
+ Q_ASSERT_SUCCEEDED(hr);
// invalid prefixes
if ((type == HostNameType_Ipv4 && hostInfo.prefixLength > 32)
@@ -103,7 +166,8 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
continue;
HString name;
- hostName->get_CanonicalName(name.GetAddressOf());
+ hr = hostName->get_CanonicalName(name.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
UINT32 length;
PCWSTR rawString = name.GetRawBuffer(&length);
hostInfo.address = QString::fromWCharArray(rawString, length);
@@ -112,54 +176,35 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
}
INetworkInformationStatics *networkInfoStatics;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &networkInfoStatics);
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &networkInfoStatics);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IConnectionProfile> connectionProfile;
+ hr = networkInfoStatics->GetInternetConnectionProfile(&connectionProfile);
+ Q_ASSERT_SUCCEEDED(hr);
+ QNetworkInterfacePrivate *iface = interfaceFromProfile(connectionProfile.Get(), &hostList);
+ if (iface) {
+ iface->index = 0;
+ interfaces << iface;
+ }
+
ComPtr<IVectorView<ConnectionProfile *>> connectionProfiles;
- networkInfoStatics->GetConnectionProfiles(&connectionProfiles);
+ hr = networkInfoStatics->GetConnectionProfiles(&connectionProfiles);
+ Q_ASSERT_SUCCEEDED(hr);
if (!connectionProfiles)
return interfaces;
unsigned int size;
- connectionProfiles->get_Size(&size);
+ hr = connectionProfiles->get_Size(&size);
+ Q_ASSERT_SUCCEEDED(hr);
for (unsigned int i = 0; i < size; ++i) {
- QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
- interfaces << iface;
-
ComPtr<IConnectionProfile> profile;
- connectionProfiles->GetAt(i, &profile);
-
- NetworkConnectivityLevel connectivityLevel;
- profile->GetNetworkConnectivityLevel(&connectivityLevel);
- if (connectivityLevel != NetworkConnectivityLevel_None)
- iface->flags = QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
-
- ComPtr<INetworkAdapter> adapter;
- profile->get_NetworkAdapter(&adapter);
- UINT32 type;
- adapter->get_IanaInterfaceType(&type);
- if (type == 23)
- iface->flags |= QNetworkInterface::IsPointToPoint;
- GUID id;
- adapter->get_NetworkAdapterId(&id);
- OLECHAR adapterName[39]={0};
- StringFromGUID2(id, adapterName, 39);
- iface->name = QString::fromWCharArray(adapterName);
-
- // According to http://stackoverflow.com/questions/12936193/how-unique-is-the-ethernet-network-adapter-id-in-winrt-it-is-derived-from-the-m
- // obtaining the MAC address using WinRT API is impossible
- // iface->hardwareAddress = ?
-
- for (int i = 0; i < hostList.length(); ++i) {
- const HostNameInfo hostInfo = hostList.at(i);
- if (id != hostInfo.adapterId)
- continue;
-
- QNetworkAddressEntry entry;
- entry.setIp(QHostAddress(hostInfo.address));
- entry.setPrefixLength(hostInfo.prefixLength);
- iface->addressEntries << entry;
-
- hostList.takeAt(i);
- --i;
+ hr = connectionProfiles->GetAt(i, &profile);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ iface = interfaceFromProfile(profile.Get(), &hostList);
+ if (iface) {
+ iface->index = i + 1;
+ interfaces << iface;
}
}
return interfaces;
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 53c4410fab..4c7c0c5442 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -218,7 +218,6 @@
#include "private/qhttpsocketengine_p.h"
#include "qauthenticator.h"
#include "qdebug.h"
-#include "qhash.h"
#include "qmutex.h"
#include "qstringlist.h"
#include "qurl.h"
@@ -1606,7 +1605,7 @@ QDebug operator<<(QDebug debug, const QNetworkProxy &proxy)
debug << "Unknown proxy " << int(type);
break;
}
- debug << "\"" << proxy.hostName() << ":" << proxy.port() << "\" ";
+ debug << '"' << proxy.hostName() << ':' << proxy.port() << "\" ";
QNetworkProxy::Capabilities caps = proxy.capabilities();
QStringList scaps;
if (caps & QNetworkProxy::TunnelingCapability)
@@ -1619,7 +1618,7 @@ QDebug operator<<(QDebug debug, const QNetworkProxy &proxy)
scaps << QStringLiteral("Caching");
if (caps & QNetworkProxy::HostNameLookupCapability)
scaps << QStringLiteral("NameLookup");
- debug << "[" << scaps.join(QLatin1Char(' ')) << "]";
+ debug << '[' << scaps.join(QLatin1Char(' ')) << ']';
return debug;
}
#endif
diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h
index 6b0f4a3937..717c141d60 100644
--- a/src/network/kernel/qnetworkproxy.h
+++ b/src/network/kernel/qnetworkproxy.h
@@ -63,7 +63,6 @@ public:
QueryType queryType = TcpSocket);
explicit QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(),
QueryType queryType = TcpServer);
- QNetworkProxyQuery(const QNetworkProxyQuery &other);
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
const QUrl &requestUrl, QueryType queryType = UrlRequest);
@@ -74,10 +73,14 @@ public:
quint16 bindPort, const QString &protocolTag = QString(),
QueryType queryType = TcpServer);
#endif
- ~QNetworkProxyQuery();
+ QNetworkProxyQuery(const QNetworkProxyQuery &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkProxyQuery &operator=(const QNetworkProxyQuery &other);
+ ~QNetworkProxyQuery();
- void swap(QNetworkProxyQuery &other) { qSwap(d, other.d); }
+ void swap(QNetworkProxyQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkProxyQuery &other) const;
inline bool operator!=(const QNetworkProxyQuery &other) const
@@ -139,10 +142,13 @@ public:
QNetworkProxy(ProxyType type, const QString &hostName = QString(), quint16 port = 0,
const QString &user = QString(), const QString &password = QString());
QNetworkProxy(const QNetworkProxy &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ QNetworkProxy &operator=(QNetworkProxy &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QNetworkProxy &operator=(const QNetworkProxy &other);
~QNetworkProxy();
- void swap(QNetworkProxy &other) { qSwap(d, other.d); }
+ void swap(QNetworkProxy &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkProxy &other) const;
inline bool operator!=(const QNetworkProxy &other) const
diff --git a/src/network/kernel/qnetworkproxy_generic.cpp b/src/network/kernel/qnetworkproxy_generic.cpp
index d3295376da..145ba18e3f 100644
--- a/src/network/kernel/qnetworkproxy_generic.cpp
+++ b/src/network/kernel/qnetworkproxy_generic.cpp
@@ -58,7 +58,7 @@ static bool ignoreProxyFor(const QNetworkProxyQuery &query)
QString peerHostName = query.peerHostName();
// Since we use suffix matching, "*" is our 'default' behaviour
- if (token.startsWith("*"))
+ if (token.startsWith('*'))
token = token.mid(1);
// Harmonize trailing dot notation
diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp
index 51400f55bb..05d4c6955a 100644
--- a/src/network/kernel/qnetworkproxy_mac.cpp
+++ b/src/network/kernel/qnetworkproxy_mac.cpp
@@ -35,6 +35,7 @@
#ifndef QT_NO_NETWORKPROXY
+#include <CFNetwork/CFNetwork.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index e22c5ccca4..385146bb95 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -426,8 +426,8 @@
\value ReuseAddressHint Provides a hint to QAbstractSocket that it should try
to rebind the service even if the address and port are already bound by
- another socket. On Windows, this is equivalent to the SO_REUSEADDR
- socket option. On Unix, this option is ignored.
+ another socket. On Windows and Unix, this is equivalent to the SO_REUSEADDR
+ socket option.
\value DefaultForPlatform The default option for the current platform.
On Unix and OS X, this is equivalent to (DontShareAddress
@@ -559,7 +559,6 @@ QAbstractSocketPrivate::QAbstractSocketPrivate()
readBufferMaxSize(0),
writeBuffer(QABSTRACTSOCKET_BUFFERSIZE),
isBuffered(false),
- blockingTimeout(30000),
connectTimer(0),
disconnectTimer(0),
connectTimeElapsed(0),
@@ -631,8 +630,8 @@ bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtoc
resetSocketLayer();
socketEngine = QAbstractSocketEngine::createSocketEngine(q->socketType(), proxyInUse, q);
if (!socketEngine) {
- socketError = QAbstractSocket::UnsupportedSocketOperationError;
- q->setErrorString(QAbstractSocket::tr("Operation on socket is not supported"));
+ setError(QAbstractSocket::UnsupportedSocketOperationError,
+ QAbstractSocket::tr("Operation on socket is not supported"));
return false;
}
#ifndef QT_NO_BEARERMANAGEMENT
@@ -645,11 +644,12 @@ bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtoc
typeStr.toLatin1().constData(), protocolStr.toLatin1().constData(),
socketEngine->errorString().toLatin1().constData());
#endif
- socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
+ setError(socketEngine->error(), socketEngine->errorString());
return false;
}
+ configureCreatedSocket();
+
if (threadData->hasEventDispatcher())
socketEngine->setReceiver(this);
@@ -661,6 +661,12 @@ bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtoc
}
/*! \internal
+*/
+void QAbstractSocketPrivate::configureCreatedSocket()
+{
+}
+
+/*! \internal
Slot connected to the read socket notifier. This slot is called
when new data is available for reading, or when the socket has
@@ -811,7 +817,7 @@ bool QAbstractSocketPrivate::canWriteNotification()
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::canWriteNotification() flushing");
#endif
- int tmp = writeBuffer.size();
+ qint64 tmp = writeBuffer.size();
flush();
if (socketEngine) {
@@ -871,18 +877,16 @@ bool QAbstractSocketPrivate::flush()
return false;
}
- int nextSize = writeBuffer.nextDataBlockSize();
+ qint64 nextSize = writeBuffer.nextDataBlockSize();
const char *ptr = writeBuffer.readPointer();
// Attempt to write it all in one chunk.
qint64 written = socketEngine->write(ptr, nextSize);
if (written < 0) {
- socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug() << "QAbstractSocketPrivate::flush() write error, aborting." << socketEngine->errorString();
#endif
- emit q->error(socketError);
+ setErrorAndEmit(socketEngine->error(), socketEngine->errorString());
// an unexpected error so close the socket.
q->abort();
return false;
@@ -984,8 +988,7 @@ void QAbstractSocketPrivate::startConnectingByName(const QString &host)
}
// failed to connect
- socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
+ setError(socketEngine->error(), socketEngine->errorString());
}
state = QAbstractSocket::UnconnectedState;
@@ -1044,8 +1047,7 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo)
qDebug("QAbstractSocketPrivate::_q_startConnecting(), host not found");
#endif
state = QAbstractSocket::UnconnectedState;
- socketError = QAbstractSocket::HostNotFoundError;
- q->setErrorString(QAbstractSocket::tr("Host not found"));
+ setError(QAbstractSocket::HostNotFoundError, QAbstractSocket::tr("Host not found"));
emit q->stateChanged(state);
emit q->error(QAbstractSocket::HostNotFoundError);
return;
@@ -1094,11 +1096,10 @@ void QAbstractSocketPrivate::_q_connectToNextAddress()
|| socketEngine->error() == QAbstractSocket::UnsupportedSocketOperationError
#endif
) && socketEngine->state() == QAbstractSocket::ConnectingState) {
- socketError = QAbstractSocket::ConnectionRefusedError;
- q->setErrorString(QAbstractSocket::tr("Connection refused"));
+ setError(QAbstractSocket::ConnectionRefusedError,
+ QAbstractSocket::tr("Connection refused"));
} else {
- socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
+ setError(socketEngine->error(), socketEngine->errorString());
}
} else {
// socketError = QAbstractSocket::ConnectionRefusedError;
@@ -1222,8 +1223,8 @@ void QAbstractSocketPrivate::_q_abortConnectionAttempt()
if (addresses.isEmpty()) {
state = QAbstractSocket::UnconnectedState;
- socketError = QAbstractSocket::SocketTimeoutError;
- q->setErrorString(QAbstractSocket::tr("Connection timed out"));
+ setError(QAbstractSocket::SocketTimeoutError,
+ QAbstractSocket::tr("Connection timed out"));
emit q->stateChanged(state);
emit q->error(socketError);
} else {
@@ -1247,7 +1248,10 @@ void QAbstractSocketPrivate::_q_forceDisconnect()
*/
bool QAbstractSocketPrivate::readFromSocket()
{
+#ifdef QABSTRACTSOCKET_DEBUG
Q_Q(QAbstractSocket);
+#endif
+
// Find how many bytes we can read from the socket layer.
qint64 bytesToRead = socketEngine->bytesAvailable();
if (bytesToRead == 0) {
@@ -1283,9 +1287,7 @@ bool QAbstractSocketPrivate::readFromSocket()
#endif
if (!socketEngine->isValid()) {
- socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
- emit q->error(socketError);
+ setErrorAndEmit(socketEngine->error(), socketEngine->errorString());
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::readFromSocket() read failed: %s",
q->errorString().toLatin1().constData());
@@ -1355,6 +1357,31 @@ QAbstractSocketEngine* QAbstractSocketPrivate::getSocketEngine(QAbstractSocket *
return socket->d_func()->socketEngine;
}
+/*!
+ \internal
+
+ Sets the socket error state to \c errorCode and \a errorString.
+*/
+void QAbstractSocketPrivate::setError(QAbstractSocket::SocketError errorCode,
+ const QString &errStr)
+{
+ socketError = errorCode;
+ errorString = errStr;
+}
+
+/*!
+ \internal
+
+ Sets the socket error state to \c errorCode and \a errorString,
+ and emits the QAbstractSocket::error() signal.
+*/
+void QAbstractSocketPrivate::setErrorAndEmit(QAbstractSocket::SocketError errorCode,
+ const QString &errorString)
+{
+ Q_Q(QAbstractSocket);
+ setError(errorCode, errorString);
+ emit q->error(errorCode);
+}
/*! \internal
@@ -1519,9 +1546,7 @@ bool QAbstractSocketPrivate::bind(const QHostAddress &address, quint16 port, QAb
cachedSocketDescriptor = socketEngine->socketDescriptor();
if (!result) {
- socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
- emit q->error(socketError);
+ setErrorAndEmit(socketEngine->error(), socketEngine->errorString());
return false;
}
@@ -1599,9 +1624,7 @@ void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,
if (d->state == ConnectedState || d->state == ConnectingState
|| d->state == ClosingState || d->state == HostLookupState) {
qWarning("QAbstractSocket::connectToHost() called when already looking up or connecting/connected to \"%s\"", qPrintable(hostName));
- d->socketError = QAbstractSocket::OperationError;
- setErrorString(QAbstractSocket::tr("Trying to connect while connection is in progress"));
- emit error(d->socketError);
+ d->setErrorAndEmit(OperationError, tr("Trying to connect while connection is in progress"));
return;
}
@@ -1630,9 +1653,8 @@ void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,
d->resolveProxy(hostName, port);
if (d->proxyInUse.type() == QNetworkProxy::DefaultProxy) {
// failed to setup the proxy
- d->socketError = QAbstractSocket::UnsupportedSocketOperationError;
- setErrorString(QAbstractSocket::tr("Operation on socket is not supported"));
- emit error(d->socketError);
+ d->setErrorAndEmit(UnsupportedSocketOperationError,
+ tr("Operation on socket is not supported"));
return;
}
#endif
@@ -1707,9 +1729,9 @@ qint64 QAbstractSocket::bytesToWrite() const
{
Q_D(const QAbstractSocket);
#if defined(QABSTRACTSOCKET_DEBUG)
- qDebug("QAbstractSocket::bytesToWrite() == %i", d->writeBuffer.size());
+ qDebug("QAbstractSocket::bytesToWrite() == %lld", d->writeBuffer.size());
#endif
- return (qint64)d->writeBuffer.size();
+ return d->writeBuffer.size();
}
/*!
@@ -1803,12 +1825,12 @@ QString QAbstractSocket::peerName() const
*/
bool QAbstractSocket::canReadLine() const
{
- bool hasLine = d_func()->buffer.canReadLine();
+ bool hasLine = QIODevice::canReadLine();
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::canReadLine() == %s, buffer size = %lld, size = %lld",
hasLine ? "true" : "false", d_func()->buffer.size(), d_func()->buffer.size());
#endif
- return hasLine || QIODevice::canReadLine();
+ return hasLine;
}
/*!
@@ -1852,8 +1874,7 @@ bool QAbstractSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState
d->buffer.clear();
d->socketEngine = QAbstractSocketEngine::createSocketEngine(socketDescriptor, this);
if (!d->socketEngine) {
- d->socketError = UnsupportedSocketOperationError;
- setErrorString(tr("Operation on socket is not supported"));
+ d->setError(UnsupportedSocketOperationError, tr("Operation on socket is not supported"));
return false;
}
#ifndef QT_NO_BEARERMANAGEMENT
@@ -1862,8 +1883,7 @@ bool QAbstractSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState
#endif
bool result = d->socketEngine->initialize(socketDescriptor, socketState);
if (!result) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
+ d->setError(d->socketEngine->error(), d->socketEngine->errorString());
return false;
}
@@ -2073,11 +2093,10 @@ bool QAbstractSocket::waitForConnected(int msecs)
}
if ((timedOut && state() != ConnectedState) || state() == ConnectingState) {
- d->socketError = SocketTimeoutError;
+ d->setError(SocketTimeoutError, tr("Socket operation timed out"));
d->state = UnconnectedState;
emit stateChanged(d->state);
d->resetSocketLayer();
- setErrorString(tr("Socket operation timed out"));
}
#if defined (QABSTRACTSOCKET_DEBUG)
@@ -2136,13 +2155,11 @@ bool QAbstractSocket::waitForReadyRead(int msecs)
bool readyToWrite = false;
if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, true, !d->writeBuffer.isEmpty(),
qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::waitForReadyRead(%i) failed (%i, %s)",
- msecs, d->socketError, errorString().toLatin1().constData());
+ msecs, d->socketEngine->error(), d->socketEngine->errorString().toLatin1().constData());
#endif
- emit error(d->socketError);
+ d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());
if (d->socketError != SocketTimeoutError)
close();
return false;
@@ -2208,13 +2225,11 @@ bool QAbstractSocket::waitForBytesWritten(int msecs)
bool readyToWrite = false;
if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, true, !d->writeBuffer.isEmpty(),
qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::waitForBytesWritten(%i) failed (%i, %s)",
- msecs, d->socketError, errorString().toLatin1().constData());
+ msecs, d->socketEngine->error(), d->socketEngine->errorString().toLatin1().constData());
#endif
- emit error(d->socketError);
+ d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());
if (d->socketError != SocketTimeoutError)
close();
return false;
@@ -2290,13 +2305,11 @@ bool QAbstractSocket::waitForDisconnected(int msecs)
if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, state() == ConnectedState,
!d->writeBuffer.isEmpty(),
qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::waitForReadyRead(%i) failed (%i, %s)",
- msecs, d->socketError, errorString().toLatin1().constData());
+ msecs, d->socketEngine->error(), d->socketEngine->errorString().toLatin1().constData());
#endif
- emit error(d->socketError);
+ d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());
if (d->socketError != SocketTimeoutError)
close();
return false;
@@ -2427,8 +2440,7 @@ qint64 QAbstractSocket::readData(char *data, qint64 maxSize)
// -2 from the engine means no bytes available (EAGAIN) so read more later
return 0;
} else if (readBytes < 0) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
+ d->setError(d->socketEngine->error(), d->socketEngine->errorString());
d->resetSocketLayer();
d->state = QAbstractSocket::UnconnectedState;
} else if (!d->socketEngine->isReadNotificationEnabled()) {
@@ -2459,8 +2471,7 @@ qint64 QAbstractSocket::writeData(const char *data, qint64 size)
Q_D(QAbstractSocket);
if (d->state == QAbstractSocket::UnconnectedState
|| (!d->socketEngine && d->socketType != TcpSocket && !d->isBuffered)) {
- d->socketError = QAbstractSocket::UnknownSocketError;
- setErrorString(tr("Socket is not connected"));
+ d->setError(UnknownSocketError, tr("Socket is not connected"));
return -1;
}
@@ -2469,8 +2480,7 @@ qint64 QAbstractSocket::writeData(const char *data, qint64 size)
// This code is for the new Unbuffered QTcpSocket use case
qint64 written = d->socketEngine->write(data, size);
if (written < 0) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
+ d->setError(d->socketEngine->error(), d->socketEngine->errorString());
return written;
} else if (written < size) {
// Buffer what was not written yet
@@ -2483,8 +2493,7 @@ qint64 QAbstractSocket::writeData(const char *data, qint64 size)
// This is for a QUdpSocket that was connect()ed
qint64 written = d->socketEngine->write(data, size);
if (written < 0) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
+ d->setError(d->socketEngine->error(), d->socketEngine->errorString());
} else if (!d->writeBuffer.isEmpty()) {
d->socketEngine->setWriteNotificationEnabled(true);
}
diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h
index f3d7f13f48..23f0d26cbd 100644
--- a/src/network/socket/qabstractsocket.h
+++ b/src/network/socket/qabstractsocket.h
@@ -149,7 +149,7 @@ public:
qint64 bytesAvailable() const Q_DECL_OVERRIDE;
qint64 bytesToWrite() const Q_DECL_OVERRIDE;
- bool canReadLine() const Q_DECL_OVERRIDE;
+ bool canReadLine() const Q_DECL_OVERRIDE; // ### Qt6: remove me
quint16 localPort() const;
QHostAddress localAddress() const;
@@ -213,7 +213,7 @@ protected:
void setPeerAddress(const QHostAddress &address);
void setPeerName(const QString &name);
- QAbstractSocket(SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent = 0);
+ QAbstractSocket(SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QAbstractSocket)
diff --git a/src/network/socket/qabstractsocket_p.h b/src/network/socket/qabstractsocket_p.h
index 63440b6416..a905625b19 100644
--- a/src/network/socket/qabstractsocket_p.h
+++ b/src/network/socket/qabstractsocket_p.h
@@ -130,16 +130,19 @@ public:
bool flush();
bool initSocketLayer(QAbstractSocket::NetworkLayerProtocol protocol);
+ virtual void configureCreatedSocket();
void startConnectingByName(const QString &host);
void fetchConnectionParameters();
void setupSocketNotifiers();
bool readFromSocket();
+ void setError(QAbstractSocket::SocketError errorCode, const QString &errorString);
+ void setErrorAndEmit(QAbstractSocket::SocketError errorCode, const QString &errorString);
+
qint64 readBufferMaxSize;
QRingBuffer writeBuffer;
bool isBuffered;
- int blockingTimeout;
QTimer *connectTimer;
QTimer *disconnectTimer;
diff --git a/src/network/socket/qabstractsocketengine_p.h b/src/network/socket/qabstractsocketengine_p.h
index f2a3149678..3771cdb135 100644
--- a/src/network/socket/qabstractsocketengine_p.h
+++ b/src/network/socket/qabstractsocketengine_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -58,6 +59,30 @@ class QNetworkInterface;
#endif
class QNetworkProxy;
+class QIpPacketHeader
+{
+public:
+ QIpPacketHeader(const QHostAddress &dstAddr = QHostAddress(), quint16 port = 0)
+ : destinationAddress(dstAddr), ifindex(0), hopLimit(-1), destinationPort(port)
+ {}
+
+ void clear()
+ {
+ senderAddress.clear();
+ destinationAddress.clear();
+ ifindex = 0;
+ hopLimit = -1;
+ }
+
+ QHostAddress senderAddress;
+ QHostAddress destinationAddress;
+
+ uint ifindex;
+ int hopLimit;
+ quint16 senderPort;
+ quint16 destinationPort;
+};
+
class QAbstractSocketEngineReceiver {
public:
virtual ~QAbstractSocketEngineReceiver(){}
@@ -93,9 +118,21 @@ public:
KeepAliveOption,
MulticastTtlOption,
MulticastLoopbackOption,
- TypeOfServiceOption
+ TypeOfServiceOption,
+ ReceivePacketInformation,
+ ReceiveHopLimit
};
+ enum PacketHeaderOption {
+ WantNone = 0,
+ WantDatagramSender = 0x01,
+ WantDatagramDestination = 0x02,
+ WantDatagramHopLimit = 0x04,
+
+ WantAll = 0xff
+ };
+ Q_DECLARE_FLAGS(PacketHeaderOptions, PacketHeaderOption)
+
virtual bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) = 0;
virtual bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) = 0;
@@ -126,10 +163,9 @@ public:
virtual bool setMulticastInterface(const QNetworkInterface &iface) = 0;
#endif // QT_NO_NETWORKINTERFACE
- virtual qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0,
- quint16 *port = 0) = 0;
- virtual qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &addr,
- quint16 port) = 0;
+ virtual qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader *header = 0,
+ PacketHeaderOptions = WantNone) = 0;
+ virtual qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header) = 0;
virtual bool hasPendingDatagrams() const = 0;
virtual qint64 pendingDatagramSize() const = 0;
#endif // QT_NO_UDPSOCKET
@@ -225,6 +261,8 @@ private:
friend class QAbstractSocketEngine;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractSocketEngine::PacketHeaderOptions)
+
QT_END_NAMESPACE
#endif // QABSTRACTSOCKETENGINE_P_H
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 23347ce08b..a744688f29 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -271,14 +271,12 @@ bool QHttpSocketEngine::setMulticastInterface(const QNetworkInterface &)
}
#endif // QT_NO_NETWORKINTERFACE
-qint64 QHttpSocketEngine::readDatagram(char *, qint64, QHostAddress *,
- quint16 *)
+qint64 QHttpSocketEngine::readDatagram(char *, qint64, QIpPacketHeader *, PacketHeaderOptions)
{
return 0;
}
-qint64 QHttpSocketEngine::writeDatagram(const char *, qint64, const QHostAddress &,
- quint16)
+qint64 QHttpSocketEngine::writeDatagram(const char *, qint64, const QIpPacketHeader &)
{
return 0;
}
@@ -441,8 +439,11 @@ void QHttpSocketEngine::setReadNotificationEnabled(bool enable)
d->readNotificationEnabled = enable;
if (enable) {
// Enabling read notification can trigger a notification.
- if (bytesAvailable())
+ if (bytesAvailable()) {
slotSocketReadNotification();
+ } else if (d->socket && d->socket->state() == QAbstractSocket::UnconnectedState) {
+ emitReadNotification();
+ }
}
}
@@ -483,7 +484,7 @@ void QHttpSocketEngine::slotSocketConnected()
QUrl::toAce(d->peerName);
QByteArray path = peerAddress + ':' + QByteArray::number(d->peerPort);
QByteArray data = method;
- data += " ";
+ data += ' ';
data += path;
data += " HTTP/1.1\r\n";
data += "Proxy-Connection: keep-alive\r\n";
diff --git a/src/network/socket/qhttpsocketengine_p.h b/src/network/socket/qhttpsocketengine_p.h
index 4d90487679..41c63fe11e 100644
--- a/src/network/socket/qhttpsocketengine_p.h
+++ b/src/network/socket/qhttpsocketengine_p.h
@@ -105,10 +105,9 @@ public:
bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
#endif // QT_NO_NETWORKINTERFACE
- qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0,
- quint16 *port = 0) Q_DECL_OVERRIDE;
- qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &addr,
- quint16 port) Q_DECL_OVERRIDE;
+ qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader *,
+ PacketHeaderOptions) Q_DECL_OVERRIDE;
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
#endif // QT_NO_UDPSOCKET
diff --git a/src/network/socket/qlocalserver.h b/src/network/socket/qlocalserver.h
index a03cdb726d..24908db4aa 100644
--- a/src/network/socket/qlocalserver.h
+++ b/src/network/socket/qlocalserver.h
@@ -64,7 +64,7 @@ public:
};
Q_DECLARE_FLAGS(SocketOptions, SocketOption)
- explicit QLocalServer(QObject *parent = 0);
+ explicit QLocalServer(QObject *parent = Q_NULLPTR);
~QLocalServer();
void close();
@@ -80,7 +80,7 @@ public:
static bool removeServer(const QString &name);
QAbstractSocket::SocketError serverError() const;
void setMaxPendingConnections(int numConnections);
- bool waitForNewConnection(int msec = 0, bool *timedOut = 0);
+ bool waitForNewConnection(int msec = 0, bool *timedOut = Q_NULLPTR);
void setSocketOptions(SocketOptions options);
SocketOptions socketOptions() const;
diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp
index 634074d91f..a356e21214 100644
--- a/src/network/socket/qlocalserver_unix.cpp
+++ b/src/network/socket/qlocalserver_unix.cpp
@@ -209,7 +209,7 @@ bool QLocalServerPrivate::listen(qintptr socketDescriptor)
QString name = QString::fromLatin1(addr.sun_path);
if (!name.isEmpty()) {
fullServerName = name;
- serverName = fullServerName.mid(fullServerName.lastIndexOf(QLatin1String("/"))+1);
+ serverName = fullServerName.mid(fullServerName.lastIndexOf(QLatin1Char('/')) + 1);
if (serverName.isEmpty()) {
serverName = fullServerName;
}
diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h
index a4d8405912..4b39a7c562 100644
--- a/src/network/socket/qlocalsocket.h
+++ b/src/network/socket/qlocalsocket.h
@@ -73,7 +73,7 @@ public:
ClosingState = QAbstractSocket::ClosingState
};
- QLocalSocket(QObject *parent = 0);
+ QLocalSocket(QObject *parent = Q_NULLPTR);
~QLocalSocket();
void connectToServer(OpenMode openMode = ReadWrite);
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index dfece60036..805acde860 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -88,6 +88,25 @@
errorString() can be called to determine the cause of the error.
*/
+/*!
+ \enum QAbstractSocketEngine::PacketHeaderOption
+
+ Specifies which fields in the IP packet header are desired in the call to
+ readDatagram().
+
+ \value WantNone caller isn't interested in the packet metadata
+ \value WantDatagramSender caller wants the sender address and port number
+ \value WantDatagramDestination caller wants the packet's destination address and port number
+ (this option is useful to distinguish multicast packets from unicast)
+ \value WantDatagramHopLimit caller wants the packet's remaining hop limit or time to live
+ (this option is useful in IPv4 multicasting, where the TTL is used
+ to indicate the realm)
+ \value WantAll this is a catch-all value to indicate the caller is
+ interested in all the available information
+
+ \sa readDatagram(), QUdpDatagram
+*/
+
#include "qnativesocketengine_p.h"
#include <qabstracteventdispatcher.h>
@@ -152,10 +171,6 @@ QT_BEGIN_NAMESPACE
/*! \internal
Constructs the private class and initializes all data members.
-
- On Windows, WSAStartup is called "recursively" for every
- concurrent QNativeSocketEngine. This is safe, because WSAStartup and
- WSACleanup are reference counted.
*/
QNativeSocketEnginePrivate::QNativeSocketEnginePrivate() :
socketDescriptor(-1),
@@ -163,6 +178,9 @@ QNativeSocketEnginePrivate::QNativeSocketEnginePrivate() :
writeNotifier(0),
exceptNotifier(0)
{
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ QSysInfo::machineHostName(); // this initializes ws2_32.dll
+#endif
}
/*! \internal
@@ -401,13 +419,18 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb
return false;
}
- // Set the broadcasting flag if it's a UDP socket.
- if (socketType == QAbstractSocket::UdpSocket
- && !setOption(BroadcastSocketOption, 1)) {
- d->setError(QAbstractSocket::UnsupportedSocketOperationError,
- QNativeSocketEnginePrivate::BroadcastingInitFailedErrorString);
- close();
- return false;
+ if (socketType == QAbstractSocket::UdpSocket) {
+ // Set the broadcasting flag if it's a UDP socket.
+ if (!setOption(BroadcastSocketOption, 1)) {
+ d->setError(QAbstractSocket::UnsupportedSocketOperationError,
+ QNativeSocketEnginePrivate::BroadcastingInitFailedErrorString);
+ close();
+ return false;
+ }
+
+ // Set some extra flags that are interesting to us, but accept failure
+ setOption(ReceivePacketInformation, 1);
+ setOption(ReceiveHopLimit, 1);
}
@@ -431,8 +454,6 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb
// setReceiveBufferSize(49152);
// setSendBufferSize(49152);
- d->socketType = socketType;
- d->socketProtocol = protocol;
return true;
}
@@ -769,9 +790,8 @@ qint64 QNativeSocketEngine::pendingDatagramSize() const
/*!
Reads up to \a maxSize bytes of a datagram from the socket,
stores it in \a data and returns the number of bytes read. The
- address and port of the sender are stored in \a address and \a
- port. If either of these pointers is 0, the corresponding value is
- discarded.
+ address, port, and other IP header fields are stored in \a header
+ according to the request in \a options.
To avoid unnecessarily loss of data, call pendingDatagramSize() to
determine the size of the pending message before reading it. If \a
@@ -781,20 +801,23 @@ qint64 QNativeSocketEngine::pendingDatagramSize() const
\sa hasPendingDatagrams()
*/
-qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxSize, QHostAddress *address,
- quint16 *port)
+qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxSize, QIpPacketHeader *header,
+ PacketHeaderOptions options)
{
Q_D(QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::readDatagram(), -1);
Q_CHECK_TYPE(QNativeSocketEngine::readDatagram(), QAbstractSocket::UdpSocket, -1);
- return d->nativeReceiveDatagram(data, maxSize, address, port);
+ return d->nativeReceiveDatagram(data, maxSize, header, options);
}
/*!
Writes a UDP datagram of size \a size bytes to the socket from
- \a data to the address \a host on port \a port, and returns the
- number of bytes written, or -1 if an error occurred.
+ \a data to the destination contained in \a header, and returns the
+ number of bytes written, or -1 if an error occurred. If \a header
+ contains other settings like hop limit or source address, this function
+ will try to pass them to the operating system too, but will not
+ indicate an error if it could not pass them.
Only one datagram is sent, and if there is too much data to fit
into a single datagram, the operation will fail and error()
@@ -804,18 +827,19 @@ qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxSize, QHostAddres
disadvised, as even if they are sent successfully, they are likely
to be fragmented before arriving at their destination.
- Experience has shown that it is in general safe to send datagrams
- no larger than 512 bytes.
+ Experience has shown that it is in general safe to send IPv4 datagrams
+ no larger than 512 bytes or IPv6 datagrams no larger than 1280 (the
+ minimum MTU).
\sa readDatagram()
*/
-qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 size,
- const QHostAddress &host, quint16 port)
+qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 size, const QIpPacketHeader &header)
{
Q_D(QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::writeDatagram(), -1);
Q_CHECK_TYPE(QNativeSocketEngine::writeDatagram(), QAbstractSocket::UdpSocket, -1);
- return d->nativeSendDatagram(data, size, d->adjustAddressProtocol(host), port);
+
+ return d->nativeSendDatagram(data, size, header);
}
#endif // QT_NO_UDPSOCKET
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index e540b47069..10e34c485a 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -51,46 +51,51 @@
# include <netinet/in.h>
#else
# include <winsock2.h>
+# include <ws2tcpip.h>
+# include <mswsock.h>
#endif
QT_BEGIN_NAMESPACE
-// Use our own defines and structs which we know are correct
-# define QT_SS_MAXSIZE 128
-# define QT_SS_ALIGNSIZE (sizeof(qint64))
-# define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short))
-# define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE))
-struct qt_sockaddr_storage {
- short ss_family;
- char __ss_pad1[QT_SS_PAD1SIZE];
- qint64 __ss_align;
- char __ss_pad2[QT_SS_PAD2SIZE];
-};
-
#ifdef Q_OS_WIN
#define QT_SOCKLEN_T int
#define QT_SOCKOPTLEN_T int
-#endif
-// sockaddr_in6 size changed between old and new SDK
-// Only the new version is the correct one, so always
-// use this structure.
-struct qt_in6_addr {
- quint8 qt_s6_addr[16];
-};
-struct qt_sockaddr_in6 {
- short sin6_family; /* AF_INET6 */
- quint16 sin6_port; /* Transport level port number */
- quint32 sin6_flowinfo; /* IPv6 flow information */
- struct qt_in6_addr sin6_addr; /* IPv6 address */
- quint32 sin6_scope_id; /* set of interfaces for a scope */
-};
+// The following definitions are copied from the MinGW header mswsock.h which
+// was placed in the public domain. The WSASendMsg and WSARecvMsg functions
+// were introduced with Windows Vista, so some Win32 headers are lacking them.
+// There are no known versions of Windows CE or Embedded that contain them.
+#ifndef Q_OS_WINCE
+# ifndef WSAID_WSARECVMSG
+typedef INT (WINAPI *LPFN_WSARECVMSG)(SOCKET s, LPWSAMSG lpMsg,
+ LPDWORD lpdwNumberOfBytesRecvd,
+ LPWSAOVERLAPPED lpOverlapped,
+ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
+# define WSAID_WSARECVMSG {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}}
+# endif
+# ifndef WSAID_WSASENDMSG
+typedef struct {
+ LPWSAMSG lpMsg;
+ DWORD dwFlags;
+ LPDWORD lpNumberOfBytesSent;
+ LPWSAOVERLAPPED lpOverlapped;
+ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine;
+} WSASENDMSG, *LPWSASENDMSG;
+
+typedef INT (WSAAPI *LPFN_WSASENDMSG)(SOCKET s, LPWSAMSG lpMsg, DWORD dwFlags,
+ LPDWORD lpNumberOfBytesSent,
+ LPWSAOVERLAPPED lpOverlapped,
+ LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
+
+# define WSAID_WSASENDMSG {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}}
+# endif
+#endif
+#endif
union qt_sockaddr {
sockaddr a;
sockaddr_in a4;
- qt_sockaddr_in6 a6;
- qt_sockaddr_storage storage;
+ sockaddr_in6 a6;
};
class QNativeSocketEnginePrivate;
@@ -134,10 +139,9 @@ public:
bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
#endif
- qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0,
- quint16 *port = 0) Q_DECL_OVERRIDE;
- qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &addr,
- quint16 port) Q_DECL_OVERRIDE;
+ qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
+ PacketHeaderOptions = WantNone) Q_DECL_OVERRIDE;
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
#endif // QT_NO_UDPSOCKET
@@ -175,16 +179,6 @@ private:
Q_DISABLE_COPY(QNativeSocketEngine)
};
-#ifdef Q_OS_WIN
-class QWindowsSockInit
-{
-public:
- QWindowsSockInit();
- ~QWindowsSockInit();
- int version;
-};
-#endif
-
class QSocketNotifier;
class QNativeSocketEnginePrivate : public QAbstractSocketEnginePrivate
@@ -198,10 +192,10 @@ public:
QSocketNotifier *readNotifier, *writeNotifier, *exceptNotifier;
-#ifdef Q_OS_WIN
- QWindowsSockInit winSock;
-#endif
-
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ LPFN_WSASENDMSG sendmsg;
+ LPFN_WSARECVMSG recvmsg;
+# endif
enum ErrorString {
NonBlockingInitFailedErrorString,
BroadcastingInitFailedErrorString,
@@ -260,24 +254,48 @@ public:
bool nativeHasPendingDatagrams() const;
qint64 nativePendingDatagramSize() const;
- qint64 nativeReceiveDatagram(char *data, qint64 maxLength,
- QHostAddress *address, quint16 *port);
- qint64 nativeSendDatagram(const char *data, qint64 length,
- const QHostAddress &host, quint16 port);
+ qint64 nativeReceiveDatagram(char *data, qint64 maxLength, QIpPacketHeader *header,
+ QAbstractSocketEngine::PacketHeaderOptions options);
+ qint64 nativeSendDatagram(const char *data, qint64 length, const QIpPacketHeader &header);
qint64 nativeRead(char *data, qint64 maxLength);
qint64 nativeWrite(const char *data, qint64 length);
int nativeSelect(int timeout, bool selectForRead) const;
int nativeSelect(int timeout, bool checkRead, bool checkWrite,
bool *selectForRead, bool *selectForWrite) const;
-#ifdef Q_OS_WIN
- void setPortAndAddress(sockaddr_in * sockAddrIPv4, qt_sockaddr_in6 * sockAddrIPv6,
- quint16 port, const QHostAddress & address, sockaddr ** sockAddrPtr, QT_SOCKLEN_T *sockAddrSize);
-#endif
void nativeClose();
bool checkProxy(const QHostAddress &address);
bool fetchConnectionParameters();
+
+ static uint scopeIdFromString(const QString &scopeid);
+
+ /*! \internal
+ Sets \a address and \a port in the \a aa sockaddr structure and the size in \a sockAddrSize.
+ The address \a is converted to IPv6 if the current socket protocol is also IPv6.
+ */
+ void setPortAndAddress(quint16 port, const QHostAddress &address, qt_sockaddr *aa, QT_SOCKLEN_T *sockAddrSize)
+ {
+ if (address.protocol() == QAbstractSocket::IPv6Protocol
+ || address.protocol() == QAbstractSocket::AnyIPProtocol
+ || socketProtocol == QAbstractSocket::IPv6Protocol
+ || socketProtocol == QAbstractSocket::AnyIPProtocol) {
+ memset(&aa->a6, 0, sizeof(sockaddr_in6));
+ aa->a6.sin6_family = AF_INET6;
+ aa->a6.sin6_scope_id = scopeIdFromString(address.scopeId());
+ aa->a6.sin6_port = htons(port);
+ Q_IPV6ADDR tmp = address.toIPv6Address();
+ memcpy(&aa->a6.sin6_addr, &tmp, sizeof(tmp));
+ *sockAddrSize = sizeof(sockaddr_in6);
+ } else {
+ memset(&aa->a, 0, sizeof(sockaddr_in));
+ aa->a4.sin_family = AF_INET;
+ aa->a4.sin_port = htons(port);
+ aa->a4.sin_addr.s_addr = htonl(address.toIPv4Address());
+ *sockAddrSize = sizeof(sockaddr_in);
+ }
+ }
+
};
QT_END_NAMESPACE
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 8869d75c8b..6a740f4c30 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -49,6 +49,9 @@
#ifdef QT_LINUXBASE
#include <arpa/inet.h>
#endif
+#ifdef Q_OS_BSD4
+#include <net/if_dl.h>
+#endif
#if defined QNATIVESOCKETENGINE_DEBUG
#include <qstring.h>
@@ -128,9 +131,9 @@ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *po
}
}
-static inline uint makeScopeId(const QHostAddress &addr)
+// inline on purpose
+inline uint QNativeSocketEnginePrivate::scopeIdFromString(const QString &scopeid)
{
- QString scopeid = addr.scopeId();
if (scopeid.isEmpty())
return 0;
@@ -202,6 +205,32 @@ static void convertToLevelAndOption(QNativeSocketEngine::SocketOption opt,
n = IP_TOS;
}
break;
+ case QNativeSocketEngine::ReceivePacketInformation:
+ if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) {
+ level = IPPROTO_IPV6;
+ n = IPV6_RECVPKTINFO;
+ } else if (socketProtocol == QAbstractSocket::IPv4Protocol) {
+ level = IPPROTO_IP;
+#ifdef IP_PKTINFO
+ n = IP_PKTINFO;
+#elif defined(IP_RECVDSTADDR)
+ // variant found in QNX and FreeBSD; it will get us only the
+ // destination address, not the interface; we need IP_RECVIF for that.
+ n = IP_RECVDSTADDR;
+#endif
+ }
+ break;
+ case QNativeSocketEngine::ReceiveHopLimit:
+ if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) {
+ level = IPPROTO_IPV6;
+ n = IPV6_RECVHOPLIMIT;
+ } else if (socketProtocol == QAbstractSocket::IPv4Protocol) {
+#ifdef IP_RECVTTL // IP_RECVTTL is a non-standard extension supported on some OS
+ level = IPPROTO_IP;
+ n = IP_RECVTTL;
+#endif
+ }
+ break;
}
}
@@ -259,6 +288,10 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
#endif
socketDescriptor = socket;
+ if (socket != -1) {
+ this->socketProtocol = socketProtocol;
+ this->socketType = socketType;
+ }
return true;
}
@@ -281,7 +314,7 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co
QT_SOCKOPTLEN_T len = sizeof(v);
convertToLevelAndOption(opt, socketProtocol, level, n);
- if (::getsockopt(socketDescriptor, level, n, (char *) &v, &len) != -1)
+ if (n != -1 && ::getsockopt(socketDescriptor, level, n, (char *) &v, &len) != -1)
return v;
return -1;
@@ -356,37 +389,11 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16
qDebug() << "QNativeSocketEnginePrivate::nativeConnect() " << socketDescriptor;
#endif
- struct sockaddr_in sockAddrIPv4;
- struct sockaddr *sockAddrPtr = 0;
- QT_SOCKLEN_T sockAddrSize = 0;
-
- struct sockaddr_in6 sockAddrIPv6;
-
- if (addr.protocol() == QAbstractSocket::IPv6Protocol) {
- memset(&sockAddrIPv6, 0, sizeof(sockAddrIPv6));
- sockAddrIPv6.sin6_family = AF_INET6;
- sockAddrIPv6.sin6_port = htons(port);
- sockAddrIPv6.sin6_scope_id = makeScopeId(addr);
-
- Q_IPV6ADDR ip6 = addr.toIPv6Address();
- memcpy(&sockAddrIPv6.sin6_addr.s6_addr, &ip6, sizeof(ip6));
-
- sockAddrSize = sizeof(sockAddrIPv6);
- sockAddrPtr = (struct sockaddr *) &sockAddrIPv6;
- } else
- if (addr.protocol() == QAbstractSocket::IPv4Protocol) {
- memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4));
- sockAddrIPv4.sin_family = AF_INET;
- sockAddrIPv4.sin_port = htons(port);
- sockAddrIPv4.sin_addr.s_addr = htonl(addr.toIPv4Address());
-
- sockAddrSize = sizeof(sockAddrIPv4);
- sockAddrPtr = (struct sockaddr *) &sockAddrIPv4;
- } else {
- // unreachable
- }
+ qt_sockaddr aa;
+ QT_SOCKLEN_T sockAddrSize;
+ setPortAndAddress(port, addr, &aa, &sockAddrSize);
- int connectResult = qt_safe_connect(socketDescriptor, sockAddrPtr, sockAddrSize);
+ int connectResult = qt_safe_connect(socketDescriptor, &aa.a, sockAddrSize);
#if defined (QNATIVESOCKETENGINE_DEBUG)
int ecopy = errno;
#endif
@@ -458,51 +465,28 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16
bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &address, quint16 port)
{
- struct sockaddr_in sockAddrIPv4;
- struct sockaddr *sockAddrPtr = 0;
- QT_SOCKLEN_T sockAddrSize = 0;
-
-
- struct sockaddr_in6 sockAddrIPv6;
+ qt_sockaddr aa;
+ QT_SOCKLEN_T sockAddrSize;
+ setPortAndAddress(port, address, &aa, &sockAddrSize);
- if (address.protocol() == QAbstractSocket::IPv6Protocol || address.protocol() == QAbstractSocket::AnyIPProtocol) {
#ifdef IPV6_V6ONLY
+ if (aa.a.sa_family == AF_INET6) {
int ipv6only = 0;
if (address.protocol() == QAbstractSocket::IPv6Protocol)
ipv6only = 1;
//default value of this socket option varies depending on unix variant (or system configuration on BSD), so always set it explicitly
::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
+ }
#endif
- memset(&sockAddrIPv6, 0, sizeof(sockAddrIPv6));
- sockAddrIPv6.sin6_family = AF_INET6;
- sockAddrIPv6.sin6_port = htons(port);
- sockAddrIPv6.sin6_scope_id = makeScopeId(address);
-
- Q_IPV6ADDR tmp = address.toIPv6Address();
- memcpy(&sockAddrIPv6.sin6_addr.s6_addr, &tmp, sizeof(tmp));
- sockAddrSize = sizeof(sockAddrIPv6);
- sockAddrPtr = (struct sockaddr *) &sockAddrIPv6;
- } else
- if (address.protocol() == QAbstractSocket::IPv4Protocol) {
- memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4));
- sockAddrIPv4.sin_family = AF_INET;
- sockAddrIPv4.sin_port = htons(port);
- sockAddrIPv4.sin_addr.s_addr = htonl(address.toIPv4Address());
- sockAddrSize = sizeof(sockAddrIPv4);
- sockAddrPtr = (struct sockaddr *) &sockAddrIPv4;
- } else {
- // unreachable
- }
- int bindResult = QT_SOCKET_BIND(socketDescriptor, sockAddrPtr, sockAddrSize);
+ int bindResult = QT_SOCKET_BIND(socketDescriptor, &aa.a, sockAddrSize);
if (bindResult < 0 && errno == EAFNOSUPPORT && address.protocol() == QAbstractSocket::AnyIPProtocol) {
- memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4));
- sockAddrIPv4.sin_family = AF_INET;
- sockAddrIPv4.sin_port = htons(port);
- sockAddrIPv4.sin_addr.s_addr = htonl(address.toIPv4Address());
- sockAddrSize = sizeof(sockAddrIPv4);
- sockAddrPtr = (struct sockaddr *) &sockAddrIPv4;
- bindResult = QT_SOCKET_BIND(socketDescriptor, sockAddrPtr, sockAddrSize);
+ // retry with v4
+ aa.a4.sin_family = AF_INET;
+ aa.a4.sin_port = htons(port);
+ aa.a4.sin_addr.s_addr = htonl(address.toIPv4Address());
+ sockAddrSize = sizeof(aa.a4);
+ bindResult = QT_SOCKET_BIND(socketDescriptor, &aa.a, sockAddrSize);
}
if (bindResult < 0) {
@@ -840,68 +824,189 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
return qint64(recvResult);
}
-qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxSize,
- QHostAddress *address, quint16 *port)
+qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxSize, QIpPacketHeader *header,
+ QAbstractSocketEngine::PacketHeaderOptions options)
{
+ // we use quintptr to force the alignment
+ quintptr cbuf[(CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int))
+#if !defined(IP_PKTINFO) && defined(IP_RECVIF) && defined(Q_OS_BSD4)
+ + CMSG_SPACE(sizeof(sockaddr_dl))
+#endif
+ + sizeof(quintptr) - 1) / sizeof(quintptr)];
+
+ struct msghdr msg;
+ struct iovec vec;
qt_sockaddr aa;
+ char c;
+ memset(&msg, 0, sizeof(msg));
memset(&aa, 0, sizeof(aa));
- QT_SOCKLEN_T sz;
- sz = sizeof(aa);
- ssize_t recvFromResult = 0;
+ // we need to receive at least one byte, even if our user isn't interested in it
+ vec.iov_base = maxSize ? data : &c;
+ vec.iov_len = maxSize ? maxSize : 1;
+ msg.msg_iov = &vec;
+ msg.msg_iovlen = 1;
+ if (options & QAbstractSocketEngine::WantDatagramSender) {
+ msg.msg_name = &aa;
+ msg.msg_namelen = sizeof(aa);
+ }
+ if (options & (QAbstractSocketEngine::WantDatagramHopLimit | QAbstractSocketEngine::WantDatagramDestination)) {
+ msg.msg_control = cbuf;
+ msg.msg_controllen = sizeof(cbuf);
+ }
+
+ ssize_t recvResult = 0;
do {
- char c;
- recvFromResult = ::recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1,
- 0, &aa.a, &sz);
- } while (recvFromResult == -1 && errno == EINTR);
+ recvResult = ::recvmsg(socketDescriptor, &msg, 0);
+ } while (recvResult == -1 && errno == EINTR);
- if (recvFromResult == -1) {
+ if (recvResult == -1) {
setError(QAbstractSocket::NetworkError, ReceiveDatagramErrorString);
- } else if (port || address) {
- qt_socket_getPortAndAddress(&aa, port, address);
+ if (header)
+ header->clear();
+ } else if (options != QAbstractSocketEngine::WantNone) {
+ Q_ASSERT(header);
+ qt_socket_getPortAndAddress(&aa, &header->senderPort, &header->senderAddress);
+ header->destinationPort = localPort;
+
+ // parse the ancillary data
+ struct cmsghdr *cmsgptr;
+ for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
+ cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
+ if (cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_PKTINFO
+ && cmsgptr->cmsg_len >= CMSG_LEN(sizeof(in6_pktinfo))) {
+ in6_pktinfo *info = reinterpret_cast<in6_pktinfo *>(CMSG_DATA(cmsgptr));
+
+ header->destinationAddress.setAddress(reinterpret_cast<quint8 *>(&info->ipi6_addr));
+ header->ifindex = info->ipi6_ifindex;
+ if (header->ifindex)
+ header->destinationAddress.setScopeId(QString::number(info->ipi6_ifindex));
+ }
+
+#ifdef IP_PKTINFO
+ if (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_PKTINFO
+ && cmsgptr->cmsg_len >= CMSG_LEN(sizeof(in_pktinfo))) {
+ in_pktinfo *info = reinterpret_cast<in_pktinfo *>(CMSG_DATA(cmsgptr));
+
+ header->destinationAddress.setAddress(ntohl(info->ipi_addr.s_addr));
+ header->ifindex = info->ipi_ifindex;
+ }
+#else
+# ifdef IP_RECVDSTADDR
+ if (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_RECVDSTADDR
+ && cmsgptr->cmsg_len >= CMSG_LEN(sizeof(in_addr))) {
+ in_addr *addr = reinterpret_cast<in_addr *>(CMSG_DATA(cmsgptr));
+
+ header->destinationAddress.setAddress(ntohl(addr->s_addr));
+ }
+# endif
+# if defined(IP_RECVIF) && defined(Q_OS_BSD4)
+ if (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_RECVIF
+ && cmsgptr->cmsg_len >= CMSG_LEN(sizeof(sockaddr_dl))) {
+ sockaddr_dl *sdl = reinterpret_cast<sockaddr_dl *>(CMSG_DATA(cmsgptr));
+
+ header->ifindex = LLINDEX(sdl);
+ }
+# endif
+#endif
+
+ if (cmsgptr->cmsg_len == CMSG_LEN(sizeof(int))
+ && ((cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_HOPLIMIT)
+ || (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_TTL))) {
+ header->hopLimit = *reinterpret_cast<int *>(CMSG_DATA(cmsgptr));
+ }
+ }
}
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativeReceiveDatagram(%p \"%s\", %lli, %s, %i) == %lli",
- data, qt_prettyDebug(data, qMin(recvFromResult, ssize_t(16)), recvFromResult).data(), maxSize,
- address ? address->toString().toLatin1().constData() : "(nil)",
- port ? *port : 0, (qint64) recvFromResult);
+ data, qt_prettyDebug(data, qMin(recvResult, ssize_t(16)), recvResult).data(), maxSize,
+ (recvResult != -1 && options != QAbstractSocketEngine::WantNone)
+ ? header->senderAddress.toString().toLatin1().constData() : "(unknown)",
+ (recvResult != -1 && options != QAbstractSocketEngine::WantNone)
+ ? header->senderPort : 0, (qint64) recvResult);
#endif
- return qint64(maxSize ? recvFromResult : recvFromResult == -1 ? -1 : 0);
+ return qint64(maxSize ? recvResult : recvResult == -1 ? -1 : 0);
}
-qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 len,
- const QHostAddress &host, quint16 port)
+qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 len, const QIpPacketHeader &header)
{
- struct sockaddr_in sockAddrIPv4;
- struct sockaddr *sockAddrPtr = 0;
- QT_SOCKLEN_T sockAddrSize = 0;
-
- struct sockaddr_in6 sockAddrIPv6;
- if (host.protocol() == QAbstractSocket::IPv6Protocol
- || socketProtocol == QAbstractSocket::IPv6Protocol
- || socketProtocol == QAbstractSocket::AnyIPProtocol) {
- memset(&sockAddrIPv6, 0, sizeof(sockAddrIPv6));
- sockAddrIPv6.sin6_family = AF_INET6;
- sockAddrIPv6.sin6_port = htons(port);
- sockAddrIPv6.sin6_scope_id = makeScopeId(host);
-
- Q_IPV6ADDR tmp = host.toIPv6Address();
- memcpy(&sockAddrIPv6.sin6_addr.s6_addr, &tmp, sizeof(tmp));
- sockAddrSize = sizeof(sockAddrIPv6);
- sockAddrPtr = (struct sockaddr *)&sockAddrIPv6;
- } else if (host.protocol() == QAbstractSocket::IPv4Protocol) {
- memset(&sockAddrIPv4, 0, sizeof(sockAddrIPv4));
- sockAddrIPv4.sin_family = AF_INET;
- sockAddrIPv4.sin_port = htons(port);
- sockAddrIPv4.sin_addr.s_addr = htonl(host.toIPv4Address());
- sockAddrSize = sizeof(sockAddrIPv4);
- sockAddrPtr = (struct sockaddr *)&sockAddrIPv4;
+ // we use quintptr to force the alignment
+ quintptr cbuf[(CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int)) + sizeof(quintptr) - 1) / sizeof(quintptr)];
+
+ struct cmsghdr *cmsgptr = reinterpret_cast<struct cmsghdr *>(cbuf);
+ struct msghdr msg;
+ struct iovec vec;
+ qt_sockaddr aa;
+
+ memset(&msg, 0, sizeof(msg));
+ memset(&aa, 0, sizeof(aa));
+ vec.iov_base = const_cast<char *>(data);
+ vec.iov_len = len;
+ msg.msg_iov = &vec;
+ msg.msg_iovlen = 1;
+ msg.msg_name = &aa.a;
+ msg.msg_control = &cbuf;
+
+ setPortAndAddress(header.destinationPort, header.destinationAddress, &aa, &msg.msg_namelen);
+
+ if (msg.msg_namelen == sizeof(aa.a6)) {
+ if (header.hopLimit != -1) {
+ msg.msg_controllen += CMSG_SPACE(sizeof(int));
+ cmsgptr->cmsg_len = CMSG_LEN(sizeof(int));
+ cmsgptr->cmsg_level = IPPROTO_IPV6;
+ cmsgptr->cmsg_type = IPV6_HOPLIMIT;
+ memcpy(CMSG_DATA(cmsgptr), &header.hopLimit, sizeof(int));
+ cmsgptr = reinterpret_cast<cmsghdr *>(reinterpret_cast<char *>(cmsgptr) + CMSG_SPACE(sizeof(int)));
+ }
+ if (header.ifindex != 0 || !header.senderAddress.isNull()) {
+ struct in6_pktinfo *data = reinterpret_cast<in6_pktinfo *>(CMSG_DATA(cmsgptr));
+ memset(data, 0, sizeof(*data));
+ msg.msg_controllen += CMSG_SPACE(sizeof(*data));
+ cmsgptr->cmsg_len = CMSG_LEN(sizeof(*data));
+ cmsgptr->cmsg_level = IPPROTO_IPV6;
+ cmsgptr->cmsg_type = IPV6_PKTINFO;
+ data->ipi6_ifindex = header.ifindex;
+
+ QIPv6Address tmp = header.senderAddress.toIPv6Address();
+ memcpy(&data->ipi6_addr, &tmp, sizeof(tmp));
+ cmsgptr = reinterpret_cast<cmsghdr *>(reinterpret_cast<char *>(cmsgptr) + CMSG_SPACE(sizeof(*data)));
+ }
+ } else {
+ if (header.hopLimit != -1) {
+ msg.msg_controllen += CMSG_SPACE(sizeof(int));
+ cmsgptr->cmsg_len = CMSG_LEN(sizeof(int));
+ cmsgptr->cmsg_level = IPPROTO_IP;
+ cmsgptr->cmsg_type = IP_TTL;
+ memcpy(CMSG_DATA(cmsgptr), &header.hopLimit, sizeof(int));
+ cmsgptr = reinterpret_cast<cmsghdr *>(reinterpret_cast<char *>(cmsgptr) + CMSG_SPACE(sizeof(int)));
+ }
+
+#if defined(IP_PKTINFO) || defined(IP_SENDSRCADDR)
+ if (header.ifindex != 0 || !header.senderAddress.isNull()) {
+# ifdef IP_PKTINFO
+ struct in_pktinfo *data = reinterpret_cast<in_pktinfo *>(CMSG_DATA(cmsgptr));
+ memset(data, 0, sizeof(*data));
+ cmsgptr->cmsg_type = IP_PKTINFO;
+ data->ipi_ifindex = header.ifindex;
+ data->ipi_addr.s_addr = htonl(header.senderAddress.toIPv4Address());
+# elif defined(IP_SENDSRCADDR)
+ struct in_addr *data = reinterpret_cast<in_addr *>(CMSG_DATA(cmsgptr));
+ cmsgptr->cmsg_type = IP_SENDSRCADDR;
+ data->s_addr = htonl(header.senderAddress.toIPv4Address());
+# endif
+ cmsgptr->cmsg_level = IPPROTO_IP;
+ msg.msg_controllen += CMSG_SPACE(sizeof(*data));
+ cmsgptr->cmsg_len = CMSG_LEN(sizeof(*data));
+ cmsgptr = reinterpret_cast<cmsghdr *>(reinterpret_cast<char *>(cmsgptr) + CMSG_SPACE(sizeof(*data)));
+ }
+#endif
}
- ssize_t sentBytes = qt_safe_sendto(socketDescriptor, data, len,
- 0, sockAddrPtr, sockAddrSize);
+ if (msg.msg_controllen == 0)
+ msg.msg_control = 0;
+ ssize_t sentBytes = qt_safe_sendmsg(socketDescriptor, &msg, 0);
if (sentBytes < 0) {
switch (errno) {
@@ -915,8 +1020,9 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEngine::sendDatagram(%p \"%s\", %lli, \"%s\", %i) == %lli", data,
- qt_prettyDebug(data, qMin<int>(len, 16), len).data(), len, host.toString().toLatin1().constData(),
- port, (qint64) sentBytes);
+ qt_prettyDebug(data, qMin<int>(len, 16), len).data(), len,
+ header.destinationAddress.toString().toLatin1().constData(),
+ header.destinationPort, (qint64) sentBytes);
#endif
return qint64(sentBytes);
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index d673d3a15e..ca0a8b95d5 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -59,6 +59,9 @@ QT_BEGIN_NAMESPACE
#ifndef IPV6_V6ONLY
#define IPV6_V6ONLY 27
#endif
+#ifndef IP_HOPLIMIT
+#define IP_HOPLIMIT 21 // Receive packet hop limit.
+#endif
#if defined(QNATIVESOCKETENGINE_DEBUG)
@@ -168,10 +171,10 @@ static QByteArray qt_prettyDebug(const char *data, int len, int maxLength)
static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt_sockaddr *sa, quint16 *port, QHostAddress *address)
{
if (sa->a.sa_family == AF_INET6) {
- const qt_sockaddr_in6 *sa6 = &sa->a6;
+ const sockaddr_in6 *sa6 = &sa->a6;
Q_IPV6ADDR tmp;
for (int i = 0; i < 16; ++i)
- tmp.c[i] = sa6->sin6_addr.qt_s6_addr[i];
+ tmp.c[i] = sa6->sin6_addr.s6_addr[i];
if (address) {
QHostAddress a;
a.setAddress(tmp);
@@ -252,40 +255,24 @@ static void convertToLevelAndOption(QNativeSocketEngine::SocketOption opt,
n = IP_MULTICAST_LOOP;
}
break;
- }
-}
-
-/*! \internal
-
- Sets the port and address to a sockaddr. Requires that sa point to the IPv6 struct if the address is IPv6.
-*/
-void QNativeSocketEnginePrivate::setPortAndAddress(sockaddr_in * sockAddrIPv4, qt_sockaddr_in6 * sockAddrIPv6,
- quint16 port, const QHostAddress & address, sockaddr ** sockAddrPtr, QT_SOCKLEN_T *sockAddrSize)
-{
- if (address.protocol() == QAbstractSocket::IPv6Protocol
- || address.protocol() == QAbstractSocket::AnyIPProtocol
- || socketProtocol == QAbstractSocket::IPv6Protocol
- || socketProtocol == QAbstractSocket::AnyIPProtocol) {
- memset(sockAddrIPv6, 0, sizeof(qt_sockaddr_in6));
- sockAddrIPv6->sin6_family = AF_INET6;
- sockAddrIPv6->sin6_scope_id = address.scopeId().toUInt();
- WSAHtons(socketDescriptor, port, &(sockAddrIPv6->sin6_port));
- Q_IPV6ADDR tmp = address.toIPv6Address();
- memcpy(&(sockAddrIPv6->sin6_addr.qt_s6_addr), &tmp, sizeof(tmp));
- *sockAddrSize = sizeof(qt_sockaddr_in6);
- *sockAddrPtr = (struct sockaddr *) sockAddrIPv6;
- } else
-
- if (address.protocol() == QAbstractSocket::IPv4Protocol
- || address.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol) {
- memset(sockAddrIPv4, 0, sizeof(sockaddr_in));
- sockAddrIPv4->sin_family = AF_INET;
- WSAHtons(socketDescriptor, port, &(sockAddrIPv4->sin_port));
- WSAHtonl(socketDescriptor, address.toIPv4Address(), &(sockAddrIPv4->sin_addr.s_addr));
- *sockAddrSize = sizeof(sockaddr_in);
- *sockAddrPtr = (struct sockaddr *) sockAddrIPv4;
- } else {
- // unreachable
+ case QNativeSocketEngine::ReceivePacketInformation:
+ if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) {
+ level = IPPROTO_IPV6;
+ n = IPV6_PKTINFO;
+ } else if (socketProtocol == QAbstractSocket::IPv4Protocol) {
+ level = IPPROTO_IP;
+ n = IP_PKTINFO;
+ }
+ break;
+ case QNativeSocketEngine::ReceiveHopLimit:
+ if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) {
+ level = IPPROTO_IPV6;
+ n = IPV6_HOPLIMIT;
+ } else if (socketProtocol == QAbstractSocket::IPv4Protocol) {
+ level = IPPROTO_IP;
+ n = IP_HOPLIMIT;
+ }
+ break;
}
}
@@ -320,25 +307,6 @@ static inline int qt_socket_getMaxMsgSize(qintptr socketDescriptor)
return value;
}
-QWindowsSockInit::QWindowsSockInit()
-: version(0)
-{
- //### should we try for 2.2 on all platforms ??
- WSAData wsadata;
-
- // IPv6 requires Winsock v2.0 or better.
- if (WSAStartup(MAKEWORD(2,0), &wsadata) != 0) {
- qWarning("QTcpSocketAPI: WinSock v2.0 initialization failed.");
- } else {
- version = 0x20;
- }
-}
-
-QWindowsSockInit::~QWindowsSockInit()
-{
- WSACleanup();
-}
-
// MS Transport Provider IOCTL to control
// reporting PORT_UNREACHABLE messages
// on UDP sockets via recv/WSARecv/etc.
@@ -354,6 +322,12 @@ QWindowsSockInit::~QWindowsSockInit()
# define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
#endif
+// inline on purpose
+inline uint QNativeSocketEnginePrivate::scopeIdFromString(const QString &scopeid)
+{
+ return scopeid.toUInt();
+}
+
bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
{
@@ -439,9 +413,27 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
WS_ERROR_DEBUG(err);
}
}
+
+ // get the pointer to sendmsg and recvmsg
+ DWORD bytesReturned;
+ GUID recvmsgguid = WSAID_WSARECVMSG;
+ if (WSAIoctl(socketDescriptor, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &recvmsgguid, sizeof(recvmsgguid),
+ &recvmsg, sizeof(recvmsg), &bytesReturned, NULL, NULL) == SOCKET_ERROR)
+ recvmsg = 0;
+
+ GUID sendmsgguid = WSAID_WSASENDMSG;
+ if (WSAIoctl(socketDescriptor, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &sendmsgguid, sizeof(sendmsgguid),
+ &sendmsg, sizeof(sendmsg), &bytesReturned, NULL, NULL) == SOCKET_ERROR)
+ sendmsg = 0;
#endif
socketDescriptor = socket;
+ if (socket != INVALID_SOCKET) {
+ this->socketProtocol = socketProtocol;
+ this->socketType = socketType;
+ }
// Make the socket nonblocking.
if (!setOption(QAbstractSocketEngine::NonBlockingSocketOption, 1)) {
@@ -626,12 +618,10 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
qDebug("QNativeSocketEnginePrivate::nativeConnect() to %s :: %i", address.toString().toLatin1().constData(), port);
#endif
- struct sockaddr_in sockAddrIPv4;
- qt_sockaddr_in6 sockAddrIPv6;
- struct sockaddr *sockAddrPtr = 0;
+ qt_sockaddr aa;
QT_SOCKLEN_T sockAddrSize = 0;
- setPortAndAddress(&sockAddrIPv4, &sockAddrIPv6, port, address, &sockAddrPtr, &sockAddrSize);
+ setPortAndAddress(port, address, &aa, &sockAddrSize);
if ((socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) && address.toIPv4Address()) {
//IPV6_V6ONLY option must be cleared to connect to a V4 mapped address
@@ -642,7 +632,7 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
}
forever {
- int connectResult = ::WSAConnect(socketDescriptor, sockAddrPtr, sockAddrSize, 0,0,0,0);
+ int connectResult = ::WSAConnect(socketDescriptor, &aa.a, sockAddrSize, 0,0,0,0);
if (connectResult == SOCKET_ERROR) {
int err = WSAGetLastError();
WS_ERROR_DEBUG(err);
@@ -765,46 +755,36 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port)
{
QHostAddress address = a;
- DWORD ipv6only = 0;
- switch (address.protocol()) {
- case QAbstractSocket::IPv6Protocol:
- if (address.toIPv6Address()[0] == 0xff) {
- // binding to a multicast address
- address = QHostAddress(QHostAddress::AnyIPv6);
- }
- //This is default in current windows versions, it may change in future so set it explicitly
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) {
- ipv6only = 1;
- ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
- }
- break;
- case QAbstractSocket::IPv4Protocol:
+ if (address.protocol() == QAbstractSocket::IPv4Protocol) {
if ((address.toIPv4Address() & 0xffff0000) == 0xefff0000) {
// binding to a multicast address
address = QHostAddress(QHostAddress::AnyIPv4);
}
- break;
- case QAbstractSocket::AnyIPProtocol:
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) {
- ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
- } else {
- address = QHostAddress(QHostAddress::AnyIPv4); //xp/WS2003 and earlier don't support dual stack, so bind to IPv4
- socketProtocol = QAbstractSocket::IPv4Protocol;
- }
- break;
- default:
- break;
}
- struct sockaddr_in sockAddrIPv4;
- qt_sockaddr_in6 sockAddrIPv6;
- struct sockaddr *sockAddrPtr = 0;
+ qt_sockaddr aa;
QT_SOCKLEN_T sockAddrSize = 0;
+ setPortAndAddress(port, address, &aa, &sockAddrSize);
- setPortAndAddress(&sockAddrIPv4, &sockAddrIPv6, port, address, &sockAddrPtr, &sockAddrSize);
+ if (aa.a.sa_family == AF_INET6) {
+ // The default may change in future, so set it explicitly
+ int ipv6only = 0;
+ if (address.protocol() == QAbstractSocket::IPv6Protocol)
+ ipv6only = 1;
+ ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
+ }
- int bindResult = ::bind(socketDescriptor, sockAddrPtr, sockAddrSize);
+ int bindResult = ::bind(socketDescriptor, &aa.a, sockAddrSize);
+ if (bindResult == SOCKET_ERROR && WSAGetLastError() == WSAEAFNOSUPPORT
+ && address.protocol() == QAbstractSocket::AnyIPProtocol) {
+ // retry with v4
+ aa.a4.sin_family = AF_INET;
+ aa.a4.sin_port = htons(port);
+ aa.a4.sin_addr.s_addr = htonl(address.toIPv4Address());
+ sockAddrSize = sizeof(aa.a4);
+ bindResult = ::bind(socketDescriptor, &aa.a, sockAddrSize);
+ }
if (bindResult == SOCKET_ERROR) {
int err = WSAGetLastError();
WS_ERROR_DEBUG(err);
@@ -1216,33 +1196,47 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const
return ret;
}
+#ifdef Q_OS_WINCE
+// Windows CE has no support for sendmsg or recvmsg. We set it to null here to simplify the code below.
+static int (*const recvmsg)(...) = 0;
+static int (*const sendmsg)(...) = 0;
+#endif
-qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxLength,
- QHostAddress *address, quint16 *port)
+qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxLength, QIpPacketHeader *header,
+ QAbstractSocketEngine::PacketHeaderOptions options)
{
- qint64 ret = 0;
-
+ union {
+ char cbuf[WSA_CMSG_SPACE(sizeof(struct in6_pktinfo)) + WSA_CMSG_SPACE(sizeof(int))];
+ WSACMSGHDR align; // only to ensure alignment
+ };
+ WSAMSG msg;
+ WSABUF buf;
qt_sockaddr aa;
+ char c;
+ memset(&msg, 0, sizeof(msg));
memset(&aa, 0, sizeof(aa));
- QT_SOCKLEN_T sz;
- sz = sizeof(aa);
- WSABUF buf;
- buf.buf = data;
- buf.len = maxLength;
-#if !defined(Q_OS_WINCE)
- buf.buf = data;
- buf.len = maxLength;
-#else
- char tmpChar;
- buf.buf = data ? data : &tmpChar;
- buf.len = maxLength;
-#endif
+ // we need to receive at least one byte, even if our user isn't interested in it
+ buf.buf = maxLength ? data : &c;
+ buf.len = maxLength ? maxLength : 1;
+ msg.lpBuffers = &buf;
+ msg.dwBufferCount = 1;
+ msg.name = reinterpret_cast<LPSOCKADDR>(&aa);
+ msg.namelen = sizeof(aa);
+ if (options & (QAbstractSocketEngine::WantDatagramHopLimit | QAbstractSocketEngine::WantDatagramDestination)) {
+ msg.Control.buf = cbuf;
+ msg.Control.len = sizeof(cbuf);
+ }
DWORD flags = 0;
DWORD bytesRead = 0;
- int wsaRet = ::WSARecvFrom(socketDescriptor, &buf, 1, &bytesRead, &flags, &aa.a, &sz,0,0);
- if (wsaRet == SOCKET_ERROR) {
+ qint64 ret;
+
+ if (recvmsg)
+ ret = recvmsg(socketDescriptor, &msg, &bytesRead, 0,0);
+ else
+ ret = ::WSARecvFrom(socketDescriptor, &buf, 1, &bytesRead, &flags, msg.name, &msg.namelen,0,0);
+ if (ret == SOCKET_ERROR) {
int err = WSAGetLastError();
if (err == WSAEMSGSIZE) {
// it is ok the buffer was to small if bytesRead is larger than
@@ -1262,12 +1256,44 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxL
break;
}
ret = -1;
+ if (header)
+ header->clear();
}
} else {
ret = qint64(bytesRead);
+ if (options & QNativeSocketEngine::WantDatagramSender)
+ qt_socket_getPortAndAddress(socketDescriptor, &aa, &header->senderPort, &header->senderAddress);
}
- qt_socket_getPortAndAddress(socketDescriptor, &aa, port, address);
+ if (ret != -1 && recvmsg) {
+ // get the ancillary data
+ WSACMSGHDR *cmsgptr;
+ for (cmsgptr = WSA_CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
+ cmsgptr = WSA_CMSG_NXTHDR(&msg, cmsgptr)) {
+ if (cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_PKTINFO
+ && cmsgptr->cmsg_len >= WSA_CMSG_LEN(sizeof(in6_pktinfo))) {
+ in6_pktinfo *info = reinterpret_cast<in6_pktinfo *>(WSA_CMSG_DATA(cmsgptr));
+ QHostAddress target(reinterpret_cast<quint8 *>(&info->ipi6_addr));
+ if (info->ipi6_ifindex)
+ target.setScopeId(QString::number(info->ipi6_ifindex));
+ }
+ if (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_PKTINFO
+ && cmsgptr->cmsg_len >= WSA_CMSG_LEN(sizeof(in_pktinfo))) {
+ in_pktinfo *info = reinterpret_cast<in_pktinfo *>(WSA_CMSG_DATA(cmsgptr));
+ u_long addr;
+ WSANtohl(socketDescriptor, info->ipi_addr.s_addr, &addr);
+ QHostAddress target(addr);
+ if (info->ipi_ifindex)
+ target.setScopeId(QString::number(info->ipi_ifindex));
+ }
+
+ if (cmsgptr->cmsg_len == WSA_CMSG_LEN(sizeof(int))
+ && ((cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_HOPLIMIT)
+ || (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_TTL))) {
+ header->hopLimit = *reinterpret_cast<int *>(WSA_CMSG_DATA(cmsgptr));
+ }
+ }
+ }
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativeReceiveDatagram(%p \"%s\", %li, %s, %i) == %li",
@@ -1281,27 +1307,94 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxL
qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 len,
- const QHostAddress &address, quint16 port)
+ const QIpPacketHeader &header)
{
- qint64 ret = -1;
- struct sockaddr_in sockAddrIPv4;
- qt_sockaddr_in6 sockAddrIPv6;
- struct sockaddr *sockAddrPtr = 0;
- QT_SOCKLEN_T sockAddrSize = 0;
-
- setPortAndAddress(&sockAddrIPv4, &sockAddrIPv6, port, address, &sockAddrPtr, &sockAddrSize);
-
+ union {
+ char cbuf[WSA_CMSG_SPACE(sizeof(struct in6_pktinfo)) + WSA_CMSG_SPACE(sizeof(int))];
+ WSACMSGHDR align; // ensures alignment
+ };
+ WSACMSGHDR *cmsgptr = &align;
+ WSAMSG msg;
WSABUF buf;
+ qt_sockaddr aa;
+
+ memset(&msg, 0, sizeof(msg));
+ memset(&aa, 0, sizeof(aa));
#if !defined(Q_OS_WINCE)
buf.buf = len ? (char*)data : 0;
#else
char tmp;
buf.buf = len ? (char*)data : &tmp;
#endif
+ msg.lpBuffers = &buf;
+ msg.dwBufferCount = 1;
+ msg.name = &aa.a;
buf.len = len;
+
+ setPortAndAddress(header.destinationPort, header.destinationAddress, &aa, &msg.namelen);
+
+ if (msg.namelen == sizeof(aa.a6)) {
+ // sending IPv6
+ if (header.hopLimit != -1) {
+ msg.Control.len += WSA_CMSG_SPACE(sizeof(int));
+ cmsgptr->cmsg_len = WSA_CMSG_LEN(sizeof(int));
+ cmsgptr->cmsg_level = IPPROTO_IPV6;
+ cmsgptr->cmsg_type = IPV6_HOPLIMIT;
+ memcpy(WSA_CMSG_DATA(cmsgptr), &header.hopLimit, sizeof(int));
+ cmsgptr = reinterpret_cast<WSACMSGHDR *>(reinterpret_cast<char *>(cmsgptr)
+ + WSA_CMSG_SPACE(sizeof(int)));
+ }
+ if (header.ifindex != 0 || !header.senderAddress.isNull()) {
+ struct in6_pktinfo *data = reinterpret_cast<in6_pktinfo *>(WSA_CMSG_DATA(cmsgptr));
+ memset(data, 0, sizeof(*data));
+ msg.Control.len += WSA_CMSG_SPACE(sizeof(*data));
+ cmsgptr->cmsg_len = WSA_CMSG_LEN(sizeof(*data));
+ cmsgptr->cmsg_level = IPPROTO_IPV6;
+ cmsgptr->cmsg_type = IPV6_PKTINFO;
+ data->ipi6_ifindex = header.ifindex;
+
+ Q_IPV6ADDR tmp = header.senderAddress.toIPv6Address();
+ memcpy(&data->ipi6_addr, &tmp, sizeof(tmp));
+ cmsgptr = reinterpret_cast<WSACMSGHDR *>(reinterpret_cast<char *>(cmsgptr)
+ + WSA_CMSG_SPACE(sizeof(*data)));
+ }
+ } else {
+ // sending IPv4
+ if (header.hopLimit != -1) {
+ msg.Control.len += WSA_CMSG_SPACE(sizeof(int));
+ cmsgptr->cmsg_len = WSA_CMSG_LEN(sizeof(int));
+ cmsgptr->cmsg_level = IPPROTO_IP;
+ cmsgptr->cmsg_type = IP_TTL;
+ memcpy(WSA_CMSG_DATA(cmsgptr), &header.hopLimit, sizeof(int));
+ cmsgptr = reinterpret_cast<WSACMSGHDR *>(reinterpret_cast<char *>(cmsgptr)
+ + WSA_CMSG_SPACE(sizeof(int)));
+ }
+ if (header.ifindex != 0 || !header.senderAddress.isNull()) {
+ struct in_pktinfo *data = reinterpret_cast<in_pktinfo *>(WSA_CMSG_DATA(cmsgptr));
+ memset(data, 0, sizeof(*data));
+ msg.Control.len += WSA_CMSG_SPACE(sizeof(*data));
+ cmsgptr->cmsg_len = WSA_CMSG_LEN(sizeof(*data));
+ cmsgptr->cmsg_level = IPPROTO_IP;
+ cmsgptr->cmsg_type = IP_PKTINFO;
+ data->ipi_ifindex = header.ifindex;
+ WSAHtonl(socketDescriptor, header.senderAddress.toIPv4Address(), &data->ipi_addr.s_addr);
+ cmsgptr = reinterpret_cast<WSACMSGHDR *>(reinterpret_cast<char *>(cmsgptr)
+ + WSA_CMSG_SPACE(sizeof(*data)));
+ }
+ }
+
+ if (msg.Control.len != 0)
+ msg.Control.buf = cbuf;
+
DWORD flags = 0;
DWORD bytesSent = 0;
- if (::WSASendTo(socketDescriptor, &buf, 1, &bytesSent, flags, sockAddrPtr, sockAddrSize, 0,0) == SOCKET_ERROR) {
+ qint64 ret = -1;
+ if (sendmsg) {
+ ret = sendmsg(socketDescriptor, &msg, flags, &bytesSent, 0,0);
+ } else {
+ ret = ::WSASendTo(socketDescriptor, &buf, 1, &bytesSent, flags, msg.name, msg.namelen, 0,0);
+ }
+ if (ret == SOCKET_ERROR) {
int err = WSAGetLastError();
WS_ERROR_DEBUG(err);
switch (err) {
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 378a539411..1c68b28784 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -47,11 +47,13 @@
#include <private/qthread_p.h>
#include <private/qabstractsocket_p.h>
+#include <private/qeventdispatcher_winrt_p.h>
#ifndef QT_NO_SSL
#include <QSslSocket>
#endif
+#include <functional>
#include <wrl.h>
#include <windows.foundation.collections.h>
#include <windows.storage.streams.h>
@@ -76,6 +78,21 @@ typedef IAsyncOperationWithProgress<IBuffer *, UINT32> IAsyncBufferOperation;
QT_BEGIN_NAMESPACE
+static QByteArray socketDescription(const QAbstractSocketEngine *s)
+{
+ QByteArray result;
+ if (const QObject *o = s->parent()) {
+ const QString name = o->objectName();
+ if (!name.isEmpty()) {
+ result += '"';
+ result += name.toLocal8Bit();
+ result += "\"/";
+ }
+ result += o->metaObject()->className();
+ }
+ return result;
+}
+
// Common constructs
#define Q_CHECK_VALID_SOCKETLAYER(function, returnValue) do { \
if (!isValid()) { \
@@ -150,16 +167,10 @@ static AsyncStatus opStatus(const ComPtr<T> &op)
{
ComPtr<IAsyncInfo> info;
HRESULT hr = op.As(&info);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to cast op to IAsyncInfo.");
- return Error;
- }
+ Q_ASSERT_SUCCEEDED(hr);
AsyncStatus status;
hr = info->get_Status(&status);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to get AsyncStatus.");
- return Error;
- }
+ Q_ASSERT_SUCCEEDED(hr);
return status;
}
@@ -265,25 +276,27 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
Q_D(QNativeSocketEngine);
HStringReference hostNameRef(reinterpret_cast<LPCWSTR>(name.utf16()));
ComPtr<IHostNameFactory> hostNameFactory;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
- &hostNameFactory);
+ HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
+ &hostNameFactory);
+ Q_ASSERT_SUCCEEDED(hr);
ComPtr<IHostName> remoteHost;
- if (FAILED(hostNameFactory->CreateHostName(hostNameRef.Get(), &remoteHost))) {
- qWarning("QNativeSocketEnginePrivate::nativeConnect:: Could not create hostname");
- return false;
- }
+ hr = hostNameFactory->CreateHostName(hostNameRef.Get(), &remoteHost);
+ RETURN_FALSE_IF_FAILED("QNativeSocketEngine::connectToHostByName: Could not create hostname.");
const QString portString = QString::number(port);
HStringReference portReference(reinterpret_cast<LPCWSTR>(portString.utf16()));
- HRESULT hr = E_FAIL;
if (d->socketType == QAbstractSocket::TcpSocket)
hr = d->tcpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp);
else if (d->socketType == QAbstractSocket::UdpSocket)
hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp);
- if (FAILED(hr)) {
- qWarning("QNativeSocketEnginePrivate::nativeConnect:: Could not obtain connect action");
+ if (hr == E_ACCESSDENIED) {
+ qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host (%s:%hu/%s). "
+ "Please check your manifest capabilities.",
+ qPrintable(name), port, socketDescription(this).constData());
return false;
}
+ Q_ASSERT_SUCCEEDED(hr);
+
d->socketState = QAbstractSocket::ConnectingState;
hr = d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
d, &QNativeSocketEnginePrivate::handleConnectToHost).Get());
@@ -295,68 +308,55 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
{
Q_D(QNativeSocketEngine);
+ HRESULT hr;
ComPtr<IHostName> hostAddress;
+
if (address != QHostAddress::Any && address != QHostAddress::AnyIPv4 && address != QHostAddress::AnyIPv6) {
ComPtr<IHostNameFactory> hostNameFactory;
- GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
&hostNameFactory);
+ Q_ASSERT_SUCCEEDED(hr);
const QString addressString = address.toString();
HStringReference addressRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
- hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
+ hr = hostNameFactory->CreateHostName(addressRef.Get(), &hostAddress);
+ RETURN_FALSE_IF_FAILED("QNativeSocketEngine::bind: Could not create hostname.");
}
- HRESULT hr;
QString portQString = port ? QString::number(port) : QString();
HStringReference portString(reinterpret_cast<LPCWSTR>(portQString.utf16()));
ComPtr<IAsyncAction> op;
if (d->socketType == QAbstractSocket::TcpSocket) {
- if (!d->tcpListener
- && FAILED(RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
- &d->tcpListener))) {
- qWarning("Failed to create listener");
- return false;
+ if (!d->tcpListener) {
+ hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocketListener).Get(),
+ &d->tcpListener);
+ Q_ASSERT_SUCCEEDED(hr);
}
- d->tcpListener->add_ConnectionReceived(Callback<ClientConnectedHandler>(d, &QNativeSocketEnginePrivate::handleClientConnection).Get(), &d->connectionToken);
+ hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
+ return d->tcpListener->add_ConnectionReceived(
+ Callback<ClientConnectedHandler>(d, &QNativeSocketEnginePrivate::handleClientConnection).Get(),
+ &d->connectionToken);
+ });
+ Q_ASSERT_SUCCEEDED(hr);
hr = d->tcpListener->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Unable to bind socket."); // ### Set error message
- return false;
- }
} else if (d->socketType == QAbstractSocket::UdpSocket) {
hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Unable to bind socket."); // ### Set error message
- return false;
- }
- hr = op->put_Completed(Callback<IAsyncActionCompletedHandler>(d, &QNativeSocketEnginePrivate::handleBindCompleted).Get());
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Unable to set bind callback.");
- return false;
- }
}
-
- if (op) {
- while (opStatus(op) == Started)
- d->eventLoop.processEvents();
-
- AsyncStatus status = opStatus(op);
- if (status == Error || status == Canceled)
- return false;
-
- hr = op->GetResults();
- if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to bind socket");
- return false;
- }
-
- d->socketState = QAbstractSocket::BoundState;
- d->fetchConnectionParameters();
- return true;
+ if (hr == E_ACCESSDENIED) {
+ qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
+ qPrintable(address.toString()), port, socketDescription(this).constData());
+ return false;
}
+ Q_ASSERT_SUCCEEDED(hr);
- return false;
+ hr = op->put_Completed(Callback<IAsyncActionCompletedHandler>(d, &QNativeSocketEnginePrivate::handleBindCompleted).Get());
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = QWinRTFunctions::await(op);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ d->socketState = QAbstractSocket::BoundState;
+ return d->fetchConnectionParameters();
}
bool QNativeSocketEngine::listen()
@@ -380,8 +380,10 @@ int QNativeSocketEngine::accept()
Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, -1);
Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, -1);
- if (d->socketDescriptor == -1 || d->pendingConnections.isEmpty())
+ if (d->socketDescriptor == -1 || d->pendingConnections.isEmpty()) {
+ d->setError(QAbstractSocket::TemporaryError, QNativeSocketEnginePrivate::TemporaryErrorString);
return -1;
+ }
// Start processing incoming data
if (d->socketType == QAbstractSocket::TcpSocket) {
@@ -398,12 +400,14 @@ int QNativeSocketEngine::accept()
ComPtr<IAsyncBufferOperation> op;
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, &op);
if (FAILED(hr)) {
- qErrnoWarning(hr, "Faild to read from the socket buffer.");
+ qErrnoWarning(hr, "accept(): Failed to read from the socket buffer (%s).",
+ socketDescription(this).constData());
return -1;
}
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to set socket read callback.");
+ qErrnoWarning(hr, "accept(): Failed to set socket read callback (%s).",
+ socketDescription(this).constData());
return -1;
}
d->currentConnections.append(socket);
@@ -420,28 +424,46 @@ void QNativeSocketEngine::close()
{
Q_D(QNativeSocketEngine);
+ if (d->closingDown)
+ return;
+
+ d->closingDown = true;
+
+
+ d->notifyOnRead = false;
+ d->notifyOnWrite = false;
+ d->notifyOnException = false;
+
+ HRESULT hr;
if (d->connectOp) {
ComPtr<IAsyncInfo> info;
- d->connectOp.As(&info);
+ hr = d->connectOp.As(&info);
+ Q_ASSERT_SUCCEEDED(hr);
if (info) {
- info->Cancel();
- info->Close();
+ hr = info->Cancel();
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = info->Close();
+ Q_ASSERT_SUCCEEDED(hr);
}
}
if (d->socketDescriptor != -1) {
ComPtr<IClosable> socket;
if (d->socketType == QAbstractSocket::TcpSocket) {
- d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket));
- d->tcpSocket()->Release();
+ hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->tcpSocket()->Release();
+ Q_ASSERT_SUCCEEDED(hr);
} else if (d->socketType == QAbstractSocket::UdpSocket) {
- d->udpSocket()->QueryInterface(IID_PPV_ARGS(&socket));
- d->udpSocket()->Release();
+ hr = d->udpSocket()->QueryInterface(IID_PPV_ARGS(&socket));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->udpSocket()->Release();
+ Q_ASSERT_SUCCEEDED(hr);
}
if (socket) {
- d->closingDown = true;
- socket->Close();
+ hr = socket->Close();
+ Q_ASSERT_SUCCEEDED(hr);
d->socketDescriptor = -1;
}
d->socketDescriptor = -1;
@@ -498,6 +520,14 @@ qint64 QNativeSocketEngine::read(char *data, qint64 maxlen)
if (d->socketType != QAbstractSocket::TcpSocket)
return -1;
+ // There will be a read notification when the socket was closed by the remote host. If that
+ // happens and there isn't anything left in the buffer, we have to return -1 in order to signal
+ // the closing of the socket.
+ if (d->readBytes.pos() == d->readBytes.size() && d->socketState != QAbstractSocket::ConnectedState) {
+ close();
+ return -1;
+ }
+
QMutexLocker mutexLocker(&d->readMutex);
return d->readBytes.read(data, maxlen);
}
@@ -514,7 +544,7 @@ qint64 QNativeSocketEngine::write(const char *data, qint64 len)
hr = d->tcpSocket()->get_OutputStream(&stream);
else if (d->socketType == QAbstractSocket::UdpSocket)
hr = d->udpSocket()->get_OutputStream(&stream);
- RETURN_IF_FAILED("Failed to get output stream to socket", return -1);
+ Q_ASSERT_SUCCEEDED(hr);
qint64 bytesWritten = writeIOStream(stream, data, len);
if (bytesWritten < 0)
@@ -525,18 +555,19 @@ qint64 QNativeSocketEngine::write(const char *data, qint64 len)
return bytesWritten;
}
-qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxlen, QHostAddress *addr, quint16 *port)
+qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxlen, QIpPacketHeader *header,
+ PacketHeaderOptions)
{
Q_D(QNativeSocketEngine);
- if (d->socketType != QAbstractSocket::UdpSocket || d->pendingDatagrams.isEmpty())
+ if (d->socketType != QAbstractSocket::UdpSocket || d->pendingDatagrams.isEmpty()) {
+ if (header)
+ header->clear();
return -1;
+ }
WinRtDatagram datagram = d->pendingDatagrams.takeFirst();
- if (addr)
- *addr = datagram.address;
-
- if (port)
- *port = datagram.port;
+ if (header)
+ *header = datagram.header;
QByteArray readOrigin;
// Do not read the whole datagram. Put the rest of it back into the "queue"
@@ -551,7 +582,7 @@ qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxlen, QHostAddress
return readOrigin.length();
}
-qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 len, const QHostAddress &addr, quint16 port)
+qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header)
{
Q_D(QNativeSocketEngine);
if (d->socketType != QAbstractSocket::UdpSocket)
@@ -562,20 +593,21 @@ qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 len, const QH
HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
&hostNameFactory);
- RETURN_IF_FAILED("Could not obtain hostname factory", return -1);
- const QString addressString = addr.toString();
+ Q_ASSERT_SUCCEEDED(hr);
+ const QString addressString = header.destinationAddress.toString();
HStringReference hostNameRef(reinterpret_cast<LPCWSTR>(addressString.utf16()));
- hostNameFactory->CreateHostName(hostNameRef.Get(), &remoteHost);
+ hr = hostNameFactory->CreateHostName(hostNameRef.Get(), &remoteHost);
+ RETURN_IF_FAILED("QNativeSocketEngine::writeDatagram: Could not create hostname.", return -1);
ComPtr<IAsyncOperation<IOutputStream *>> streamOperation;
ComPtr<IOutputStream> stream;
- const QString portString = QString::number(port);
+ const QString portString = QString::number(header.destinationPort);
HStringReference portRef(reinterpret_cast<LPCWSTR>(portString.utf16()));
hr = d->udpSocket()->GetOutputStreamAsync(remoteHost.Get(), portRef.Get(), &streamOperation);
- RETURN_IF_FAILED("Failed to get output stream to socket", return -1);
+ Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(streamOperation, stream.GetAddressOf());
- RETURN_IF_FAILED("Failed to get output stream to socket", return -1);
+ Q_ASSERT_SUCCEEDED(hr);
return writeIOStream(stream, data, len);
}
@@ -760,26 +792,23 @@ void QNativeSocketEngine::establishRead()
bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
{
Q_UNUSED(socketProtocol);
+ HRESULT hr;
+
switch (socketType) {
case QAbstractSocket::TcpSocket: {
ComPtr<IStreamSocket> socket;
- HRESULT hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocket).Get(), &socket);
- if (FAILED(hr)) {
- qWarning("Failed to create StreamSocket instance");
- return false;
- }
+ hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_StreamSocket).Get(), &socket);
+ Q_ASSERT_SUCCEEDED(hr);
socketDescriptor = qintptr(socket.Detach());
break;
}
case QAbstractSocket::UdpSocket: {
ComPtr<IDatagramSocket> socket;
- HRESULT hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &socket);
- if (FAILED(hr)) {
- qWarning("Failed to create stream socket");
- return false;
- }
+ hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &socket);
+ Q_ASSERT_SUCCEEDED(hr);
socketDescriptor = qintptr(socket.Detach());
- udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &connectionToken);
+ hr = udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &connectionToken);
+ Q_ASSERT_SUCCEEDED(hr);
break;
}
default:
@@ -787,6 +816,8 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
return false;
}
+ this->socketType = socketType;
+
// Make the socket nonblocking.
if (!setOption(QAbstractSocketEngine::NonBlockingSocketOption, 1)) {
setError(QAbstractSocket::UnsupportedSocketOperationError, NonBlockingInitFailedErrorString);
@@ -814,10 +845,12 @@ QNativeSocketEnginePrivate::~QNativeSocketEnginePrivate()
if (socketDescriptor == -1 || connectionToken.value == -1)
return;
+ HRESULT hr;
if (socketType == QAbstractSocket::UdpSocket)
- udpSocket()->remove_MessageReceived(connectionToken);
+ hr = udpSocket()->remove_MessageReceived(connectionToken);
else if (socketType == QAbstractSocket::TcpSocket)
- tcpListener->remove_ConnectionReceived(connectionToken);
+ hr = tcpListener->remove_ConnectionReceived(connectionToken);
+ Q_ASSERT_SUCCEEDED(hr);
}
void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, ErrorString errorString) const
@@ -1044,56 +1077,66 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
peerPort = 0;
peerAddress.clear();
+ HRESULT hr;
if (socketType == QAbstractSocket::TcpSocket) {
ComPtr<IHostName> hostName;
HString tmpHString;
ComPtr<IStreamSocketInformation> info;
- if (FAILED(tcpSocket()->get_Information(&info))) {
- qWarning("QNativeSocketEnginePrivate::fetchConnectionParameters: Could not obtain socket info");
- return false;
- }
- info->get_LocalAddress(&hostName);
+ hr = tcpSocket()->get_Information(&info);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = info->get_LocalAddress(&hostName);
+ Q_ASSERT_SUCCEEDED(hr);
if (hostName) {
- hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
localAddress.setAddress(qt_QStringFromHString(tmpHString));
- info->get_LocalPort(tmpHString.GetAddressOf());
+ hr = info->get_LocalPort(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
localPort = qt_QStringFromHString(tmpHString).toInt();
}
if (!localPort && tcpListener) {
ComPtr<IStreamSocketListenerInformation> listenerInfo = 0;
- tcpListener->get_Information(&listenerInfo);
- listenerInfo->get_LocalPort(tmpHString.GetAddressOf());
+ hr = tcpListener->get_Information(&listenerInfo);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = listenerInfo->get_LocalPort(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
localPort = qt_QStringFromHString(tmpHString).toInt();
- localAddress == QHostAddress::Any;
+ localAddress = QHostAddress::Any;
}
info->get_RemoteAddress(&hostName);
if (hostName) {
- hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
peerAddress.setAddress(qt_QStringFromHString(tmpHString));
- info->get_RemotePort(tmpHString.GetAddressOf());
+ hr = info->get_RemotePort(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
peerPort = qt_QStringFromHString(tmpHString).toInt();
}
} else if (socketType == QAbstractSocket::UdpSocket) {
ComPtr<IHostName> hostName;
HString tmpHString;
ComPtr<IDatagramSocketInformation> info;
- if (FAILED(udpSocket()->get_Information(&info))) {
- qWarning("QNativeSocketEnginePrivate::fetchConnectionParameters: Could not obtain socket information");
- return false;
- }
- info->get_LocalAddress(&hostName);
+ hr = udpSocket()->get_Information(&info);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = info->get_LocalAddress(&hostName);
+ Q_ASSERT_SUCCEEDED(hr);
if (hostName) {
- hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
localAddress.setAddress(qt_QStringFromHString(tmpHString));
- info->get_LocalPort(tmpHString.GetAddressOf());
+ hr = info->get_LocalPort(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
localPort = qt_QStringFromHString(tmpHString).toInt();
}
- info->get_RemoteAddress(&hostName);
+ hr = info->get_RemoteAddress(&hostName);
+ Q_ASSERT_SUCCEEDED(hr);
if (hostName) {
- hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ hr = hostName->get_CanonicalName(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
peerAddress.setAddress(qt_QStringFromHString(tmpHString));
- info->get_RemotePort(tmpHString.GetAddressOf());
+ hr = info->get_RemotePort(tmpHString.GetAddressOf());
+ Q_ASSERT_SUCCEEDED(hr);
peerPort = qt_QStringFromHString(tmpHString).toInt();
}
}
@@ -1154,12 +1197,16 @@ void QNativeSocketEnginePrivate::handleConnectionEstablished(IAsyncAction *actio
// The callback might be triggered several times if we do not cancel/reset it here
if (connectOp) {
ComPtr<IAsyncInfo> info;
- connectOp.As(&info);
+ hr = connectOp.As(&info);
+ Q_ASSERT_SUCCEEDED(hr);
if (info) {
- info->Cancel();
- info->Close();
+ hr = info->Cancel();
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = info->Close();
+ Q_ASSERT_SUCCEEDED(hr);
}
- connectOp.Reset();
+ hr = connectOp.Reset();
+ Q_ASSERT_SUCCEEDED(hr);
}
socketState = QAbstractSocket::ConnectedState;
@@ -1181,8 +1228,16 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
if (wasDeleted || isDeletingChildren)
return S_OK;
- if (status == Error || status == Canceled)
+ // A read in UnconnectedState will close the socket and return -1 and thus tell the caller,
+ // that the connection was closed. The socket cannot be closed here, as the subsequent read
+ // might fail then.
+ if (status == Error || status == Canceled) {
+ setError(QAbstractSocket::NetworkError, RemoteHostClosedErrorString);
+ socketState = QAbstractSocket::UnconnectedState;
+ if (notifyOnRead)
+ emit q->readReady();
return S_OK;
+ }
ComPtr<IBuffer> buffer;
HRESULT hr = asyncInfo->GetResults(&buffer);
@@ -1191,7 +1246,13 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
UINT32 bufferLength;
hr = buffer->get_Length(&bufferLength);
Q_ASSERT_SUCCEEDED(hr);
+ // A zero sized buffer length signals, that the remote host closed the connection. The socket
+ // cannot be closed though, as the following read might have socket descriptor -1 and thus and
+ // the closing of the socket won't be communicated to the caller. So only the error is set. The
+ // actual socket close happens inside of read.
if (!bufferLength) {
+ setError(QAbstractSocket::NetworkError, RemoteHostClosedErrorString);
+ socketState = QAbstractSocket::UnconnectedState;
if (notifyOnRead)
emit q->readReady();
return S_OK;
@@ -1232,12 +1293,14 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
ComPtr<IAsyncBufferOperation> op;
hr = stream->ReadAsync(buffer.Get(), bufferLength, InputStreamOptions_Partial, &op);
if (FAILED(hr)) {
- qErrnoWarning(hr, "Could not read into socket stream buffer.");
+ qErrnoWarning(hr, "handleReadyRead(): Could not read into socket stream buffer (%s).",
+ socketDescription(q).constData());
return S_OK;
}
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(this, &QNativeSocketEnginePrivate::handleReadyRead).Get());
if (FAILED(hr)) {
- qErrnoWarning(hr, "Failed to set socket read callback.");
+ qErrnoWarning(hr, "handleReadyRead(): Failed to set socket read callback (%s).",
+ socketDescription(q).constData());
return S_OK;
}
return S_OK;
@@ -1257,11 +1320,11 @@ HRESULT QNativeSocketEnginePrivate::handleNewDatagram(IDatagramSocket *socket, I
remoteHost->get_CanonicalName(remoteHostString.GetAddressOf());
RETURN_OK_IF_FAILED("Could not obtain remote host's canonical name");
returnAddress.setAddress(qt_QStringFromHString(remoteHostString));
- datagram.address = returnAddress;
+ datagram.header.senderAddress = returnAddress;
HString remotePort;
hr = args->get_RemotePort(remotePort.GetAddressOf());
RETURN_OK_IF_FAILED("Could not obtain remote port");
- datagram.port = qt_QStringFromHString(remotePort).toInt();
+ datagram.header.senderPort = qt_QStringFromHString(remotePort).toInt();
ComPtr<IDataReader> reader;
hr = args->GetDataReader(&reader);
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
index 79e1a3391e..c48b0e85d9 100644
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ b/src/network/socket/qnativesocketengine_winrt_p.h
@@ -58,8 +58,7 @@ class QNativeSocketEnginePrivate;
struct WinRtDatagram {
QByteArray data;
- int port;
- QHostAddress address;
+ QIpPacketHeader header;
};
class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine
@@ -97,10 +96,8 @@ public:
qint64 read(char *data, qint64 maxlen);
qint64 write(const char *data, qint64 len);
- qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0,
- quint16 *port = 0);
- qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &addr,
- quint16 port);
+ qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0, PacketHeaderOptions = WantNone);
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header);
bool hasPendingDatagrams() const;
qint64 pendingDatagramSize() const;
diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h
index 979afb82ba..9626c53711 100644
--- a/src/network/socket/qnet_unix_p.h
+++ b/src/network/socket/qnet_unix_p.h
@@ -77,15 +77,13 @@ static inline int qt_safe_socket(int domain, int type, int protocol, int flags =
Q_ASSERT((flags & ~O_NONBLOCK) == 0);
int fd;
-#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+#ifdef QT_THREADSAFE_CLOEXEC
int newtype = type | SOCK_CLOEXEC;
if (flags & O_NONBLOCK)
newtype |= SOCK_NONBLOCK;
fd = ::socket(domain, newtype, protocol);
- if (fd != -1 || errno != EINVAL)
- return fd;
-#endif
-
+ return fd;
+#else
fd = ::socket(domain, type, protocol);
if (fd == -1)
return -1;
@@ -97,6 +95,7 @@ static inline int qt_safe_socket(int domain, int type, int protocol, int flags =
::fcntl(fd, F_SETFL, ::fcntl(fd, F_GETFL) | O_NONBLOCK);
return fd;
+#endif
}
// Tru64 redefines accept -> _accept with _XOPEN_SOURCE_EXTENDED
@@ -105,16 +104,14 @@ static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *add
Q_ASSERT((flags & ~O_NONBLOCK) == 0);
int fd;
-#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+#ifdef QT_THREADSAFE_CLOEXEC
// use accept4
int sockflags = SOCK_CLOEXEC;
if (flags & O_NONBLOCK)
sockflags |= SOCK_NONBLOCK;
fd = ::accept4(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen), sockflags);
- if (fd != -1 || !(errno == ENOSYS || errno == EINVAL))
- return fd;
-#endif
-
+ return fd;
+#else
fd = ::accept(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen));
if (fd == -1)
return -1;
@@ -126,6 +123,7 @@ static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *add
::fcntl(fd, F_SETFL, ::fcntl(fd, F_GETFL) | O_NONBLOCK);
return fd;
+#endif
}
// UnixWare 7 redefines listen -> _listen
@@ -175,8 +173,7 @@ static inline in_addr_t qt_safe_inet_addr(const char *cp)
#endif
}
-// VxWorks' headers do not specify any const modifiers
-static inline int qt_safe_sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *to, QT_SOCKLEN_T tolen)
+static inline int qt_safe_sendmsg(int sockfd, const struct msghdr *msg, int flags)
{
#ifdef MSG_NOSIGNAL
flags |= MSG_NOSIGNAL;
@@ -185,11 +182,15 @@ static inline int qt_safe_sendto(int sockfd, const void *buf, size_t len, int fl
#endif
int ret;
-#ifdef Q_OS_VXWORKS
- EINTR_LOOP(ret, ::sendto(sockfd, (char *) buf, len, flags, (struct sockaddr *) to, tolen));
-#else
- EINTR_LOOP(ret, ::sendto(sockfd, buf, len, flags, to, tolen));
-#endif
+ EINTR_LOOP(ret, ::sendmsg(sockfd, msg, flags));
+ return ret;
+}
+
+static inline int qt_safe_recvmsg(int sockfd, struct msghdr *msg, int flags)
+{
+ int ret;
+
+ EINTR_LOOP(ret, ::recvmsg(sockfd, msg, flags));
return ret;
}
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index a6eafd2601..6868e8c73a 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -1111,14 +1111,16 @@ bool QSocks5SocketEngine::connectInternal()
}
}
- if (d->socks5State == QSocks5SocketEnginePrivate::Uninitialized
- && d->socketState != QAbstractSocket::ConnectingState) {
- setState(QAbstractSocket::ConnectingState);
- //limit buffer in internal socket, data is buffered in the external socket under application control
- d->data->controlSocket->setReadBufferSize(65536);
+ if (d->socketState != QAbstractSocket::ConnectingState) {
+ if (d->socks5State == QSocks5SocketEnginePrivate::Uninitialized) {
+ setState(QAbstractSocket::ConnectingState);
+ //limit buffer in internal socket, data is buffered in the external socket under application control
+ d->data->controlSocket->setReadBufferSize(65536);
+ }
+
d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port());
- return false;
}
+
return false;
}
@@ -1383,7 +1385,7 @@ bool QSocks5SocketEngine::bind(const QHostAddress &addr, quint16 port)
#endif
dummy.setProxy(QNetworkProxy::NoProxy);
if (!dummy.bind()
- || writeDatagram(0,0, d->data->controlSocket->localAddress(), dummy.localPort()) != 0
+ || writeDatagram(0,0, QIpPacketHeader(d->data->controlSocket->localAddress(), dummy.localPort())) != 0
|| !dummy.waitForReadyRead(qt_subtract_from_timeout(msecs, stopWatch.elapsed()))
|| dummy.readDatagram(0,0, &d->localAddress, &d->localPort) != 0) {
QSOCKS5_DEBUG << "udp actual address and port lookup failed";
@@ -1555,7 +1557,7 @@ qint64 QSocks5SocketEngine::write(const char *data, qint64 len)
#ifndef QT_NO_UDPSOCKET
} else if (d->mode == QSocks5SocketEnginePrivate::UdpAssociateMode) {
// send to connected address
- return writeDatagram(data, len, d->peerAddress, d->peerPort);
+ return writeDatagram(data, len, QIpPacketHeader(d->peerAddress, d->peerPort));
#endif
}
//### set an error ???
@@ -1594,8 +1596,7 @@ bool QSocks5SocketEngine::setMulticastInterface(const QNetworkInterface &)
}
#endif // QT_NO_NETWORKINTERFACE
-qint64 QSocks5SocketEngine::readDatagram(char *data, qint64 maxlen, QHostAddress *addr,
- quint16 *port)
+qint64 QSocks5SocketEngine::readDatagram(char *data, qint64 maxlen, QIpPacketHeader *header, PacketHeaderOptions)
{
Q_D(QSocks5SocketEngine);
@@ -1607,15 +1608,12 @@ qint64 QSocks5SocketEngine::readDatagram(char *data, qint64 maxlen, QHostAddress
QSocks5RevivedDatagram datagram = d->udpData->pendingDatagrams.dequeue();
int copyLen = qMin<int>(maxlen, datagram.data.size());
memcpy(data, datagram.data.constData(), copyLen);
- if (addr)
- *addr = datagram.address;
- if (port)
- *port = datagram.port;
+ header->senderAddress = datagram.address;
+ header->senderPort = datagram.port;
return copyLen;
}
-qint64 QSocks5SocketEngine::writeDatagram(const char *data, qint64 len, const QHostAddress &address,
- quint16 port)
+qint64 QSocks5SocketEngine::writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header)
{
Q_D(QSocks5SocketEngine);
@@ -1634,7 +1632,7 @@ qint64 QSocks5SocketEngine::writeDatagram(const char *data, qint64 len, const QH
outBuf[0] = 0x00;
outBuf[1] = 0x00;
outBuf[2] = 0x00;
- if (!qt_socks5_set_host_address_and_port(address, port, &outBuf)) {
+ if (!qt_socks5_set_host_address_and_port(header.destinationAddress, header.destinationPort, &outBuf)) {
}
outBuf += QByteArray(data, len);
QSOCKS5_DEBUG << "sending" << dump(outBuf);
diff --git a/src/network/socket/qsocks5socketengine_p.h b/src/network/socket/qsocks5socketengine_p.h
index c97b0e89ce..de20e0ef0e 100644
--- a/src/network/socket/qsocks5socketengine_p.h
+++ b/src/network/socket/qsocks5socketengine_p.h
@@ -93,10 +93,9 @@ public:
bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
#endif // QT_NO_NETWORKINTERFACE
- qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0,
- quint16 *port = 0) Q_DECL_OVERRIDE;
- qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &addr,
- quint16 port) Q_DECL_OVERRIDE;
+ qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
+ PacketHeaderOptions = WantNone) Q_DECL_OVERRIDE;
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
#endif // QT_NO_UDPSOCKET
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp
index b41d207947..bf75666548 100644
--- a/src/network/socket/qtcpserver.cpp
+++ b/src/network/socket/qtcpserver.cpp
@@ -160,6 +160,23 @@ QNetworkProxy QTcpServerPrivate::resolveProxy(const QHostAddress &address, quint
/*! \internal
*/
+void QTcpServerPrivate::configureCreatedSocket()
+{
+#if defined(Q_OS_UNIX)
+ // Under Unix, we want to be able to bind to the port, even if a socket on
+ // the same address-port is in TIME_WAIT. Under Windows this is possible
+ // anyway -- furthermore, the meaning of reusable on Windows is different:
+ // it means that you can use the same address-port for multiple listening
+ // sockets.
+ // Don't abort though if we can't set that option. For example the socks
+ // engine doesn't support that option, but that shouldn't prevent us from
+ // trying to bind/listen.
+ socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);
+#endif
+}
+
+/*! \internal
+*/
void QTcpServerPrivate::readNotification()
{
Q_Q(QTcpServer);
@@ -205,6 +222,9 @@ void QTcpServerPrivate::readNotification()
QTcpServer::QTcpServer(QObject *parent)
: QObject(*new QTcpServerPrivate, parent)
{
+#if defined(QTCPSERVER_DEBUG)
+ qDebug("QTcpServer::QTcpServer(%p)", parent);
+#endif
}
/*!
@@ -218,6 +238,9 @@ QTcpServer::QTcpServer(QObject *parent)
*/
QTcpServer::~QTcpServer()
{
+#if defined(QTCPSERVER_DEBUG)
+ qDebug("QTcpServer::~QTcpServer()");
+#endif
close();
}
@@ -226,6 +249,9 @@ QTcpServer::~QTcpServer()
QTcpServer::QTcpServer(QTcpServerPrivate &dd, QObject *parent)
: QObject(dd, parent)
{
+#if defined(QTCPSERVER_DEBUG)
+ qDebug("QTcpServer::QTcpServer(QTcpServerPrivate == %p, parent == %p)", &dd, parent);
+#endif
}
/*!
@@ -275,17 +301,7 @@ bool QTcpServer::listen(const QHostAddress &address, quint16 port)
if (addr.protocol() == QAbstractSocket::AnyIPProtocol && proto == QAbstractSocket::IPv4Protocol)
addr = QHostAddress::AnyIPv4;
-#if defined(Q_OS_UNIX)
- // Under Unix, we want to be able to bind to the port, even if a socket on
- // the same address-port is in TIME_WAIT. Under Windows this is possible
- // anyway -- furthermore, the meaning of reusable on Windows is different:
- // it means that you can use the same address-port for multiple listening
- // sockets.
- // Don't abort though if we can't set that option. For example the socks
- // engine doesn't support that option, but that shouldn't prevent us from
- // trying to bind/listen.
- d->socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);
-#endif
+ d->configureCreatedSocket();
if (!d->socketEngine->bind(addr, port)) {
d->serverSocketError = d->socketEngine->error();
@@ -543,6 +559,10 @@ QTcpSocket *QTcpServer::nextPendingConnection()
may not be usable with native socket functions, and should only be
used with QTcpSocket::setSocketDescriptor().
+ \note If another socket is created in the reimplementation
+ of this method, it needs to be added to the Pending Connections mechanism
+ by calling addPendingConnection().
+
\note If you want to handle an incoming connection as a new QTcpSocket
object in another thread you have to pass the socketDescriptor
to the other thread and create the QTcpSocket object there and
diff --git a/src/network/socket/qtcpserver.h b/src/network/socket/qtcpserver.h
index 8c7537a9b1..dd7b12c96a 100644
--- a/src/network/socket/qtcpserver.h
+++ b/src/network/socket/qtcpserver.h
@@ -51,7 +51,7 @@ class Q_NETWORK_EXPORT QTcpServer : public QObject
{
Q_OBJECT
public:
- explicit QTcpServer(QObject *parent = 0);
+ explicit QTcpServer(QObject *parent = Q_NULLPTR);
virtual ~QTcpServer();
bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
@@ -68,7 +68,7 @@ public:
qintptr socketDescriptor() const;
bool setSocketDescriptor(qintptr socketDescriptor);
- bool waitForNewConnection(int msec = 0, bool *timedOut = 0);
+ bool waitForNewConnection(int msec = 0, bool *timedOut = Q_NULLPTR);
virtual bool hasPendingConnections() const;
virtual QTcpSocket *nextPendingConnection();
@@ -87,7 +87,7 @@ protected:
virtual void incomingConnection(qintptr handle);
void addPendingConnection(QTcpSocket* socket);
- QTcpServer(QTcpServerPrivate &dd, QObject *parent = 0);
+ QTcpServer(QTcpServerPrivate &dd, QObject *parent = Q_NULLPTR);
Q_SIGNALS:
void newConnection();
diff --git a/src/network/socket/qtcpserver_p.h b/src/network/socket/qtcpserver_p.h
index 415a0e190a..47505e7e91 100644
--- a/src/network/socket/qtcpserver_p.h
+++ b/src/network/socket/qtcpserver_p.h
@@ -80,6 +80,8 @@ public:
QNetworkProxy resolveProxy(const QHostAddress &address, quint16 port);
#endif
+ virtual void configureCreatedSocket();
+
// from QAbstractSocketEngineReceiver
void readNotification() Q_DECL_OVERRIDE;
void closeNotification() Q_DECL_OVERRIDE { readNotification(); }
diff --git a/src/network/socket/qtcpsocket.cpp b/src/network/socket/qtcpsocket.cpp
index b6072b2909..13865fbc9c 100644
--- a/src/network/socket/qtcpsocket.cpp
+++ b/src/network/socket/qtcpsocket.cpp
@@ -103,4 +103,13 @@ QTcpSocket::QTcpSocket(QTcpSocketPrivate &dd, QObject *parent)
d_func()->isBuffered = true;
}
+/*!
+ \internal
+*/
+QTcpSocket::QTcpSocket(QAbstractSocket::SocketType socketType,
+ QTcpSocketPrivate &dd, QObject *parent)
+ : QAbstractSocket(socketType, dd, parent)
+{
+}
+
QT_END_NAMESPACE
diff --git a/src/network/socket/qtcpsocket.h b/src/network/socket/qtcpsocket.h
index 3449beeceb..8e3cb5946f 100644
--- a/src/network/socket/qtcpsocket.h
+++ b/src/network/socket/qtcpsocket.h
@@ -46,11 +46,13 @@ class Q_NETWORK_EXPORT QTcpSocket : public QAbstractSocket
{
Q_OBJECT
public:
- explicit QTcpSocket(QObject *parent = 0);
+ explicit QTcpSocket(QObject *parent = Q_NULLPTR);
virtual ~QTcpSocket();
protected:
- QTcpSocket(QTcpSocketPrivate &dd, QObject *parent = 0);
+ QTcpSocket(QTcpSocketPrivate &dd, QObject *parent = Q_NULLPTR);
+ QTcpSocket(QAbstractSocket::SocketType socketType, QTcpSocketPrivate &dd,
+ QObject *parent = Q_NULLPTR);
private:
Q_DISABLE_COPY(QTcpSocket)
diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp
index 87686f94e1..a46e6ade04 100644
--- a/src/network/socket/qudpsocket.cpp
+++ b/src/network/socket/qudpsocket.cpp
@@ -333,15 +333,13 @@ qint64 QUdpSocket::writeDatagram(const char *data, qint64 size, const QHostAddre
if (state() == UnconnectedState)
bind();
- qint64 sent = d->socketEngine->writeDatagram(data, size, address, port);
+ qint64 sent = d->socketEngine->writeDatagram(data, size, QIpPacketHeader(address, port));
d->cachedSocketDescriptor = d->socketEngine->socketDescriptor();
if (sent >= 0) {
emit bytesWritten(sent);
} else {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
- emit error(d->socketError);
+ d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());
}
return sent;
}
@@ -379,13 +377,23 @@ qint64 QUdpSocket::readDatagram(char *data, qint64 maxSize, QHostAddress *addres
qDebug("QUdpSocket::readDatagram(%p, %llu, %p, %p)", data, maxSize, address, port);
#endif
QT_CHECK_BOUND("QUdpSocket::readDatagram()", -1);
- qint64 readBytes = d->socketEngine->readDatagram(data, maxSize, address, port);
- d_func()->socketEngine->setReadNotificationEnabled(true);
- if (readBytes < 0) {
- d->socketError = d->socketEngine->error();
- setErrorString(d->socketEngine->errorString());
- emit error(d->socketError);
+
+ qint64 readBytes;
+ if (address || port) {
+ QIpPacketHeader header;
+ readBytes = d->socketEngine->readDatagram(data, maxSize, &header,
+ QAbstractSocketEngine::WantDatagramSender);
+ if (address)
+ *address = header.senderAddress;
+ if (port)
+ *port = header.senderPort;
+ } else {
+ readBytes = d->socketEngine->readDatagram(data, maxSize);
}
+
+ d_func()->socketEngine->setReadNotificationEnabled(true);
+ if (readBytes < 0)
+ d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());
return readBytes;
}
#endif // QT_NO_UDPSOCKET
diff --git a/src/network/socket/qudpsocket.h b/src/network/socket/qudpsocket.h
index fcf16fb345..e902984b4f 100644
--- a/src/network/socket/qudpsocket.h
+++ b/src/network/socket/qudpsocket.h
@@ -49,7 +49,7 @@ class Q_NETWORK_EXPORT QUdpSocket : public QAbstractSocket
{
Q_OBJECT
public:
- explicit QUdpSocket(QObject *parent = 0);
+ explicit QUdpSocket(QObject *parent = Q_NULLPTR);
virtual ~QUdpSocket();
#ifndef QT_NO_NETWORKINTERFACE
@@ -66,7 +66,7 @@ public:
bool hasPendingDatagrams() const;
qint64 pendingDatagramSize() const;
- qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host = 0, quint16 *port = 0);
+ qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host = Q_NULLPTR, quint16 *port = Q_NULLPTR);
qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &host, quint16 port);
inline qint64 writeDatagram(const QByteArray &datagram, const QHostAddress &host, quint16 port)
{ return writeDatagram(datagram.constData(), datagram.size(), host, port); }
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index 26381fcb8e..84aa9d7dca 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -166,6 +166,10 @@ Q_LOGGING_CATEGORY(lcSsl, "qt.network.ssl");
in ASN.1 format as returned by QSslConfiguration::sessionTicket(). Enabling
this feature adds memory overhead of approximately 1K per used session
ticket.
+ \value SslOptionDisableServerCipherPreference Disables selecting the cipher
+ chosen based on the servers preferences rather than the order ciphers were
+ sent by the client. This option is only relevant to server sockets, and is
+ only honored by the OpenSSL backend.
By default, SslOptionDisableEmptyFragments is turned on since this causes
problems with a large number of servers. SslOptionDisableLegacyRenegotiation
diff --git a/src/network/ssl/qssl.h b/src/network/ssl/qssl.h
index f56c36b219..03497ecf76 100644
--- a/src/network/ssl/qssl.h
+++ b/src/network/ssl/qssl.h
@@ -95,7 +95,8 @@ namespace QSsl {
SslOptionDisableServerNameIndication = 0x08,
SslOptionDisableLegacyRenegotiation = 0x10,
SslOptionDisableSessionSharing = 0x20,
- SslOptionDisableSessionPersistence = 0x40
+ SslOptionDisableSessionPersistence = 0x40,
+ SslOptionDisableServerCipherPreference = 0x80
};
Q_DECLARE_FLAGS(SslOptions, SslOption)
}
diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h
index ef0767ae8f..d58cfcf5d1 100644
--- a/src/network/ssl/qsslcertificate.h
+++ b/src/network/ssl/qsslcertificate.h
@@ -83,9 +83,12 @@ public:
explicit QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem);
QSslCertificate(const QSslCertificate &other);
~QSslCertificate();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QSslCertificate &operator=(QSslCertificate &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QSslCertificate &operator=(const QSslCertificate &other);
- inline void swap(QSslCertificate &other)
+ void swap(QSslCertificate &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
bool operator==(const QSslCertificate &other) const;
@@ -94,7 +97,7 @@ public:
bool isNull() const;
#if QT_DEPRECATED_SINCE(5,0)
QT_DEPRECATED inline bool isValid() const {
- const QDateTime currentTime = QDateTime::currentDateTime();
+ const QDateTime currentTime = QDateTime::currentDateTimeUtc();
return currentTime >= effectiveDate() &&
currentTime <= expiryDate() &&
!isBlacklisted();
@@ -144,7 +147,7 @@ public:
static bool importPkcs12(QIODevice *device,
QSslKey *key, QSslCertificate *cert,
- QList<QSslCertificate> *caCertificates=0,
+ QList<QSslCertificate> *caCertificates = Q_NULLPTR,
const QByteArray &passPhrase=QByteArray());
Qt::HANDLE handle() const;
diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp
index ad88ea5d56..3324587821 100644
--- a/src/network/ssl/qsslcertificate_openssl.cpp
+++ b/src/network/ssl/qsslcertificate_openssl.cpp
@@ -464,8 +464,9 @@ QList<QSslCertificateExtension> QSslCertificate::extensions() const
return result;
int count = q_X509_get_ext_count(d->x509);
+ result.reserve(count);
- for (int i=0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
X509_EXTENSION *ext = q_X509_get_ext(d->x509, i);
result << QSslCertificatePrivate::convertExtension(ext);
}
diff --git a/src/network/ssl/qsslcertificateextension.h b/src/network/ssl/qsslcertificateextension.h
index 7c958eff30..8dd0e8eb4b 100644
--- a/src/network/ssl/qsslcertificateextension.h
+++ b/src/network/ssl/qsslcertificateextension.h
@@ -51,11 +51,13 @@ class Q_NETWORK_EXPORT QSslCertificateExtension
public:
QSslCertificateExtension();
QSslCertificateExtension(const QSslCertificateExtension &other);
- ~QSslCertificateExtension();
-
+#ifdef Q_COMPILER_RVALUE_REFS
+ QSslCertificateExtension &operator=(QSslCertificateExtension &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QSslCertificateExtension &operator=(const QSslCertificateExtension &other);
+ ~QSslCertificateExtension();
- void swap(QSslCertificateExtension &other) { qSwap(d, other.d); }
+ void swap(QSslCertificateExtension &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
QString oid() const;
QString name() const;
diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h
index dc65e32111..64122cdd53 100644
--- a/src/network/ssl/qsslcipher.h
+++ b/src/network/ssl/qsslcipher.h
@@ -52,10 +52,13 @@ public:
explicit QSslCipher(const QString &name);
QSslCipher(const QString &name, QSsl::SslProtocol protocol);
QSslCipher(const QSslCipher &other);
- ~QSslCipher();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QSslCipher &operator=(QSslCipher &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QSslCipher &operator=(const QSslCipher &other);
+ ~QSslCipher();
- inline void swap(QSslCipher &other)
+ void swap(QSslCipher &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
bool operator==(const QSslCipher &other) const;
diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h
index 960aec60ce..2cbc31b032 100644
--- a/src/network/ssl/qsslconfiguration.h
+++ b/src/network/ssl/qsslconfiguration.h
@@ -71,9 +71,12 @@ public:
QSslConfiguration();
QSslConfiguration(const QSslConfiguration &other);
~QSslConfiguration();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QSslConfiguration &operator=(QSslConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QSslConfiguration &operator=(const QSslConfiguration &other);
- inline void swap(QSslConfiguration &other)
+ void swap(QSslConfiguration &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
bool operator==(const QSslConfiguration &other) const;
diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp
index b88ab54038..68caaeb6dc 100644
--- a/src/network/ssl/qsslcontext_openssl.cpp
+++ b/src/network/ssl/qsslcontext_openssl.cpp
@@ -215,6 +215,8 @@ init_context:
return sslContext;
}
+ const QDateTime now = QDateTime::currentDateTimeUtc();
+
// Add all our CAs to this store.
foreach (const QSslCertificate &caCertificate, sslContext->sslConfiguration.caCertificates()) {
// From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
@@ -228,7 +230,7 @@ init_context:
// certificates mixed with valid ones.
//
// See also: QSslSocketBackendPrivate::verify()
- if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
+ if (caCertificate.expiryDate() >= now) {
q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
}
}
diff --git a/src/network/ssl/qsslellipticcurve.cpp b/src/network/ssl/qsslellipticcurve.cpp
index b4396d567b..0824a61e8d 100644
--- a/src/network/ssl/qsslellipticcurve.cpp
+++ b/src/network/ssl/qsslellipticcurve.cpp
@@ -170,7 +170,7 @@ QDebug operator<<(QDebug debug, QSslEllipticCurve curve)
{
QDebugStateSaver saver(debug);
debug.resetFormat().nospace();
- debug << "QSslEllipticCurve(" << curve.shortName() << ")";
+ debug << "QSslEllipticCurve(" << curve.shortName() << ')';
return debug;
}
#endif
diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h
index a991881b93..5716e3447d 100644
--- a/src/network/ssl/qsslellipticcurve.h
+++ b/src/network/ssl/qsslellipticcurve.h
@@ -37,7 +37,10 @@
#include <QtCore/QtGlobal>
#include <QtCore/QString>
#include <QtCore/QMetaType>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/QHash>
+#endif
+#include <QtCore/qhashfunctions.h>
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h
index b149f86d9e..bc2a2d5220 100644
--- a/src/network/ssl/qsslerror.h
+++ b/src/network/ssl/qsslerror.h
@@ -84,10 +84,13 @@ public:
QSslError(const QSslError &other);
- inline void swap(QSslError &other)
+ void swap(QSslError &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
~QSslError();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QSslError &operator=(QSslError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QSslError &operator=(const QSslError &other);
bool operator==(const QSslError &other) const;
inline bool operator!=(const QSslError &other) const
diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h
index b89069e4cb..d02c031015 100644
--- a/src/network/ssl/qsslkey.h
+++ b/src/network/ssl/qsslkey.h
@@ -64,10 +64,13 @@ public:
const QByteArray &passPhrase = QByteArray());
explicit QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey);
QSslKey(const QSslKey &other);
- ~QSslKey();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QSslKey &operator=(QSslKey &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+#endif
QSslKey &operator=(const QSslKey &other);
+ ~QSslKey();
- inline void swap(QSslKey &other) { qSwap(d, other.d); }
+ void swap(QSslKey &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool isNull() const;
void clear();
diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp
index 33cb81ce71..a90c9411b7 100644
--- a/src/network/ssl/qsslkey_openssl.cpp
+++ b/src/network/ssl/qsslkey_openssl.cpp
@@ -265,4 +265,53 @@ 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;
+ const EVP_CIPHER* type = 0;
+ int i = 0, len = 0;
+
+ switch (cipher) {
+ case QSslKeyPrivate::DesCbc:
+ type = q_EVP_des_cbc();
+ break;
+ case QSslKeyPrivate::DesEde3Cbc:
+ type = q_EVP_des_ede3_cbc();
+ break;
+ case QSslKeyPrivate::Rc2Cbc:
+ type = q_EVP_rc2_cbc();
+ break;
+ }
+
+ 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 (cipher == QSslKeyPrivate::Rc2Cbc)
+ q_EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
+ q_EVP_CipherInit(&ctx, NULL,
+ reinterpret_cast<const unsigned char *>(key.constData()),
+ reinterpret_cast<const unsigned char *>(iv.constData()), enc);
+ q_EVP_CipherUpdate(&ctx,
+ reinterpret_cast<unsigned char *>(output.data()), &len,
+ reinterpret_cast<const unsigned char *>(data.constData()), data.size());
+ q_EVP_CipherFinal(&ctx,
+ reinterpret_cast<unsigned char *>(output.data()) + len, &i);
+ len += i;
+ q_EVP_CIPHER_CTX_cleanup(&ctx);
+
+ return output.left(len);
+}
+
+QByteArray QSslKeyPrivate::decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv)
+{
+ return doCrypt(cipher, data, key, iv, 0);
+}
+
+QByteArray QSslKeyPrivate::encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv)
+{
+ return doCrypt(cipher, data, key, iv, 1);
+}
+
QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslkey_p.h b/src/network/ssl/qsslkey_p.h
index be981bb484..fea0e30bbc 100644
--- a/src/network/ssl/qsslkey_p.h
+++ b/src/network/ssl/qsslkey_p.h
@@ -90,6 +90,16 @@ public:
bool isNull;
QSsl::KeyType type;
QSsl::KeyAlgorithm algorithm;
+
+ enum Cipher {
+ DesCbc,
+ DesEde3Cbc,
+ Rc2Cbc
+ };
+
+ Q_AUTOTEST_EXPORT static QByteArray decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
+ Q_AUTOTEST_EXPORT static QByteArray encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
+
#ifndef QT_NO_OPENSSL
union {
EVP_PKEY *opaque;
@@ -100,15 +110,6 @@ public:
#endif
};
#else
- enum Cipher {
- DesCbc,
- DesEde3Cbc,
- Rc2Cbc
- };
-
- Q_AUTOTEST_EXPORT static QByteArray decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
- Q_AUTOTEST_EXPORT static QByteArray encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
-
Qt::HANDLE opaque;
QByteArray derData;
int keyLength;
diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h
index 159b16d563..34e5d6fd50 100644
--- a/src/network/ssl/qsslpresharedkeyauthenticator.h
+++ b/src/network/ssl/qsslpresharedkeyauthenticator.h
@@ -52,14 +52,10 @@ public:
Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&authenticator)
- { d.swap(authenticator.d); return *this; }
+ QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
- void swap(QSslPreSharedKeyAuthenticator &authenticator)
- {
- d.swap(authenticator.d);
- }
+ void swap(QSslPreSharedKeyAuthenticator &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
Q_NETWORK_EXPORT QByteArray identityHint() const;
diff --git a/src/network/ssl/qsslpresharedkeyauthenticator_p.h b/src/network/ssl/qsslpresharedkeyauthenticator_p.h
index ba7a740907..c57b6b10ca 100644
--- a/src/network/ssl/qsslpresharedkeyauthenticator_p.h
+++ b/src/network/ssl/qsslpresharedkeyauthenticator_p.h
@@ -34,6 +34,17 @@
#ifndef QSSLPRESHAREDKEYAUTHENTICATOR_P_H
#define QSSLPRESHAREDKEYAUTHENTICATOR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QSharedData>
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 9b5d90225f..805adc734f 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -131,19 +131,18 @@
before the handshake phase with setLocalCertificate() and
setPrivateKey().
\li The CA certificate database can be extended and customized with
- addCaCertificate(), addCaCertificates(), setCaCertificates(),
- addDefaultCaCertificate(), addDefaultCaCertificates(), and
- setDefaultCaCertificates().
+ addCaCertificate(), addCaCertificates(), addDefaultCaCertificate(),
+ addDefaultCaCertificates(), and QSslConfiguration::defaultConfiguration().setCaCertificates().
\endlist
\note If available, root certificates on Unix (excluding OS X) will be
- loaded on demand from the standard certificate directories. If
- you do not want to load root certificates on demand, you need to call either
- the static function setDefaultCaCertificates() before the first SSL handshake
- is made in your application, (e.g. via
- "QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());"),
- or call setCaCertificates() on your QSslSocket instance prior to the SSL
- handshake.
+ loaded on demand from the standard certificate directories. If you do not
+ want to load root certificates on demand, you need to call either
+ QSslConfiguration::defaultConfiguration().setCaCertificates() before the first
+ SSL handshake is made in your application (for example, via passing
+ QSslSocket::systemCaCertificates() to it), or call
+ QSslConfiguration::defaultConfiguration()::setCaCertificates() on your QSslSocket instance
+ prior to the SSL handshake.
For more information about ciphers and certificates, refer to QSslCipher and
QSslCertificate.
@@ -499,8 +498,7 @@ bool QSslSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState state
d->createPlainSocket(openMode);
bool retVal = d->plainSocket->setSocketDescriptor(socketDescriptor, state, openMode);
d->cachedSocketDescriptor = d->plainSocket->socketDescriptor();
- setSocketError(d->plainSocket->error());
- setErrorString(d->plainSocket->errorString());
+ d->setError(d->plainSocket->error(), d->plainSocket->errorString());
setSocketState(state);
setOpenMode(openMode);
setLocalPort(d->plainSocket->localPort());
@@ -1243,7 +1241,7 @@ void QSslSocket::setCiphers(const QString &ciphers)
{
Q_D(QSslSocket);
d->configuration.ciphers.clear();
- foreach (const QString &cipherName, ciphers.split(QLatin1String(":"),QString::SkipEmptyParts)) {
+ foreach (const QString &cipherName, ciphers.split(QLatin1Char(':'), QString::SkipEmptyParts)) {
QSslCipher cipher(cipherName);
if (!cipher.isNull())
d->configuration.ciphers << cipher;
@@ -1532,8 +1530,7 @@ bool QSslSocket::waitForConnected(int msecs)
bool retVal = d->plainSocket->waitForConnected(msecs);
if (!retVal) {
setSocketState(d->plainSocket->state());
- setSocketError(d->plainSocket->error());
- setErrorString(d->plainSocket->errorString());
+ d->setError(d->plainSocket->error(), d->plainSocket->errorString());
}
return retVal;
}
@@ -1688,8 +1685,7 @@ bool QSslSocket::waitForDisconnected(int msecs)
bool retVal = d->plainSocket->waitForDisconnected(qt_subtract_from_timeout(msecs, stopWatch.elapsed()));
if (!retVal) {
setSocketState(d->plainSocket->state());
- setSocketError(d->plainSocket->error());
- setErrorString(d->plainSocket->errorString());
+ d->setError(d->plainSocket->error(), d->plainSocket->errorString());
}
return retVal;
}
@@ -2402,8 +2398,9 @@ void QSslSocketPrivate::_q_stateChangedSlot(QAbstractSocket::SocketState state)
*/
void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error)
{
- Q_Q(QSslSocket);
+ Q_UNUSED(error)
#ifdef QSSLSOCKET_DEBUG
+ Q_Q(QSslSocket);
qCDebug(lcSsl) << "QSslSocket::_q_errorSlot(" << error << ')';
qCDebug(lcSsl) << "\tstate =" << q->state();
qCDebug(lcSsl) << "\terrorString =" << q->errorString();
@@ -2416,9 +2413,7 @@ void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error)
readBufferMaxSize = tmpReadBufferMaxSize;
}
- q->setSocketError(plainSocket->error());
- q->setErrorString(plainSocket->errorString());
- emit q->error(error);
+ setErrorAndEmit(plainSocket->error(), plainSocket->errorString());
}
/*!
@@ -2483,7 +2478,6 @@ void QSslSocketPrivate::_q_flushReadBuffer()
*/
void QSslSocketPrivate::_q_resumeImplementation()
{
- Q_Q(QSslSocket);
if (plainSocket)
plainSocket->resume();
paused = false;
@@ -2491,9 +2485,7 @@ void QSslSocketPrivate::_q_resumeImplementation()
if (verifyErrorsHaveBeenIgnored()) {
continueHandshake();
} else {
- q->setErrorString(sslErrors.first().errorString());
- q->setSocketError(QAbstractSocket::SslHandshakeFailedError);
- emit q->error(QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, sslErrors.first().errorString());
plainSocket->disconnectFromHost();
return;
}
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index 4124f5b7e5..22856c6ea9 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -72,7 +72,7 @@ public:
AutoVerifyPeer
};
- explicit QSslSocket(QObject *parent = 0);
+ explicit QSslSocket(QObject *parent = Q_NULLPTR);
~QSslSocket();
void resume() Q_DECL_OVERRIDE; // to continue after proxy authentication required, SSL errors etc.
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index aabae81eed..4e090f96cb 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -600,7 +600,7 @@ void QSslSocketBackendPrivate::startClientEncryption()
// Error description/code were set, 'error' emitted
// by initSslContext, but OpenSSL socket also sets error
// emits a signal twice, so ...
- setError("Unable to init SSL Context", QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError, "Unable to init SSL Context");
return;
}
@@ -613,7 +613,7 @@ void QSslSocketBackendPrivate::startServerEncryption()
// Error description/code were set, 'error' emitted
// by initSslContext, but OpenSSL socket also sets error
// emits a signal twice, so ...
- setError("Unable to init SSL Context", QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError, "Unable to init SSL Context");
return;
}
@@ -642,8 +642,8 @@ void QSslSocketBackendPrivate::transmit()
qCDebug(lcSsl) << plainSocket << "SSLWrite returned" << err;
#endif
if (err != noErr && err != errSSLWouldBlock) {
- setError(QStringLiteral("SSLWrite failed: %1").arg(err),
- QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QStringLiteral("SSLWrite failed: %1").arg(err));
break;
}
@@ -677,12 +677,12 @@ void QSslSocketBackendPrivate::transmit()
#endif
if (err == errSSLClosedGraceful) {
shutdown = true; // the other side shut down, make sure we do not send shutdown ourselves
- setError(QSslSocket::tr("The TLS/SSL connection has been closed"),
- QAbstractSocket::RemoteHostClosedError);
+ setErrorAndEmit(QAbstractSocket::RemoteHostClosedError,
+ QSslSocket::tr("The TLS/SSL connection has been closed"));
break;
} else if (err != noErr && err != errSSLWouldBlock) {
- setError(QStringLiteral("SSLRead failed: %1").arg(err),
- QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QStringLiteral("SSLRead failed: %1").arg(err));
break;
}
@@ -936,7 +936,7 @@ bool QSslSocketBackendPrivate::initSslContext()
context.reset(qt_createSecureTransportContext(mode));
if (!context) {
- setError("SSLCreateContext failed", QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError, "SSLCreateContext failed");
return false;
}
@@ -944,8 +944,8 @@ bool QSslSocketBackendPrivate::initSslContext()
reinterpret_cast<SSLWriteFunc>(&_q_SSLWrite));
if (err != noErr) {
destroySslContext();
- setError(QStringLiteral("SSLSetIOFuncs failed: %1").arg(err),
- QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QStringLiteral("SSLSetIOFuncs failed: %1").arg(err));
return false;
}
@@ -957,14 +957,14 @@ bool QSslSocketBackendPrivate::initSslContext()
QAbstractSocket::SocketError errorCode = QAbstractSocket::UnknownSocketError;
if (!setSessionCertificate(errorDescription, errorCode)) {
destroySslContext();
- setError(errorDescription, errorCode);
+ setErrorAndEmit(errorCode, errorDescription);
return false;
}
}
if (!setSessionProtocol()) {
destroySslContext();
- setError("Failed to set protocol version", QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError, "Failed to set protocol version");
return false;
}
@@ -976,8 +976,8 @@ bool QSslSocketBackendPrivate::initSslContext()
const OSStatus err = SSLSetEnableCertVerify(context, false);
if (err != noErr) {
destroySslContext();
- setError(QStringLiteral("SSLSetEnableCertVerify failed: %1").arg(err),
- QSslSocket::SslInternalError);
+ setErrorAndEmit(QSslSocket::SslInternalError,
+ QStringLiteral("SSLSetEnableCertVerify failed: %1").arg(err));
return false;
}
}
@@ -998,8 +998,8 @@ bool QSslSocketBackendPrivate::initSslContext()
if (err != noErr) {
destroySslContext();
- setError(QStringLiteral("SSLSetSessionOption failed: %1").arg(err),
- QSslSocket::SslInternalError);
+ setErrorAndEmit(QSslSocket::SslInternalError,
+ QStringLiteral("SSLSetSessionOption failed: %1").arg(err));
return false;
}
//
@@ -1015,8 +1015,8 @@ bool QSslSocketBackendPrivate::initSslContext()
if (err != noErr) {
destroySslContext();
- setError(QStringLiteral("failed to set SSL context option in server mode: %1").arg(err),
- QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QStringLiteral("failed to set SSL context option in server mode: %1").arg(err));
return false;
}
}
@@ -1192,8 +1192,8 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
// !trust - SSLCopyPeerTrust can return noErr but null trust.
if (err != noErr || !trust) {
if (!canIgnoreVerify) {
- setError(QStringLiteral("Failed to obtain peer trust: %1").arg(err),
- QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
+ QStringLiteral("Failed to obtain peer trust: %1").arg(err));
plainSocket->disconnectFromHost();
return false;
} else {
@@ -1216,8 +1216,8 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
if (err != noErr) {
// We can not ignore this, it's not even about trust verification
// probably ...
- setError(QStringLiteral("SecTrustEvaluate failed: %1").arg(err),
- QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
+ QStringLiteral("SecTrustEvaluate failed: %1").arg(err));
plainSocket->disconnectFromHost();
return false;
}
@@ -1335,8 +1335,8 @@ bool QSslSocketBackendPrivate::checkSslErrors()
pauseSocketNotifiers(q);
paused = true;
} else {
- setError(sslErrors.first().errorString(),
- QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
+ sslErrors.first().errorString());
plainSocket->disconnectFromHost();
}
return false;
@@ -1373,7 +1373,7 @@ bool QSslSocketBackendPrivate::startHandshake()
// setSessionCertificate does not fail if we have no certificate.
// Failure means a real error (invalid certificate, no private key, etc).
if (!setSessionCertificate(errorDescription, errorCode)) {
- setError(errorDescription, errorCode);
+ setErrorAndEmit(errorCode, errorDescription);
return false;
} else {
// We try to resume a handshake, even if have no
@@ -1388,8 +1388,8 @@ bool QSslSocketBackendPrivate::startHandshake()
return startHandshake();
}
- setError(QStringLiteral("SSLHandshake failed: %1").arg(err),
- QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
+ QStringLiteral("SSLHandshake failed: %1").arg(err));
plainSocket->disconnectFromHost();
return false;
}
@@ -1403,8 +1403,8 @@ bool QSslSocketBackendPrivate::startHandshake()
// check protocol version ourselves, as Secure Transport does not enforce
// the requested min / max versions.
if (!verifySessionProtocol()) {
- setError("Protocol version mismatch",
- QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
+ "Protocol version mismatch");
plainSocket->disconnectFromHost();
return false;
}
@@ -1417,16 +1417,6 @@ bool QSslSocketBackendPrivate::startHandshake()
}
}
-void QSslSocketBackendPrivate::setError(const QString &errorString,
- QAbstractSocket::SocketError errorCode)
-{
- Q_Q(QSslSocket);
-
- q->setErrorString(errorString);
- q->setSocketError(errorCode);
- emit q->error(errorCode);
-}
-
/*
PKCS12 helpers.
*/
diff --git a/src/network/ssl/qsslsocket_mac_p.h b/src/network/ssl/qsslsocket_mac_p.h
index 0479e30d97..7a622db185 100644
--- a/src/network/ssl/qsslsocket_mac_p.h
+++ b/src/network/ssl/qsslsocket_mac_p.h
@@ -113,13 +113,6 @@ private:
bool checkSslErrors();
bool startHandshake();
- // Aux. function, sets:
- //1) socket error code,
- //2) error string (description)
- //3) emits a signal.
- void setError(const QString &errorString,
- QAbstractSocket::SocketError errorCode);
-
QSecureTransportContext context;
Q_DISABLE_COPY(QSslSocketBackendPrivate);
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index a21317d0f2..dd47dfc45f 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -225,7 +225,7 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph
char buf [256];
QString descriptionOneLine = QString::fromLatin1(q_SSL_CIPHER_description(cipher, buf, sizeof(buf)));
- QStringList descriptionList = descriptionOneLine.split(QLatin1String(" "), QString::SkipEmptyParts);
+ QStringList descriptionList = descriptionOneLine.split(QLatin1Char(' '), QString::SkipEmptyParts);
if (descriptionList.size() > 5) {
// ### crude code.
ciph.d->isNull = false;
@@ -290,7 +290,7 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx)
<< "OU=" << cert.subjectInfo(QSslCertificate::OrganizationalUnitName)
<< "C=" << cert.subjectInfo(QSslCertificate::CountryName)
<< "ST=" << cert.subjectInfo(QSslCertificate::StateOrProvinceName);
- qCDebug(lcSsl) << "Valid:" << cert.effectiveDate() << "-" << cert.expiryDate();
+ qCDebug(lcSsl) << "Valid:" << cert.effectiveDate() << '-' << cert.expiryDate();
}
#endif
}
@@ -344,6 +344,9 @@ long QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SslProtocol protocol, Q
options |= SSL_OP_NO_COMPRESSION;
#endif
+ if (!(sslOptions & QSsl::SslOptionDisableServerCipherPreference))
+ options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
+
return options;
}
@@ -361,9 +364,7 @@ bool QSslSocketBackendPrivate::initSslContext()
}
if (sslContextPointer->error() != QSslError::NoError) {
- q->setErrorString(sslContextPointer->errorString());
- q->setSocketError(QAbstractSocket::SslInvalidUserDataError);
- emit q->error(QAbstractSocket::SslInvalidUserDataError);
+ setErrorAndEmit(QAbstractSocket::SslInvalidUserDataError, sslContextPointer->errorString());
sslContextPointer.clear(); // deletes the QSslContext
return false;
}
@@ -371,9 +372,8 @@ bool QSslSocketBackendPrivate::initSslContext()
// Create and initialize SSL session
if (!(ssl = sslContextPointer->createSsl())) {
// ### Bad error code
- q->setErrorString(QSslSocket::tr("Error creating SSL session, %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Error creating SSL session, %1").arg(getErrorsFromOpenSsl()));
return false;
}
@@ -402,9 +402,8 @@ bool QSslSocketBackendPrivate::initSslContext()
readBio = q_BIO_new(q_BIO_s_mem());
writeBio = q_BIO_new(q_BIO_s_mem());
if (!readBio || !writeBio) {
- q->setErrorString(QSslSocket::tr("Error creating SSL session: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Error creating SSL session: %1").arg(getErrorsFromOpenSsl()));
return false;
}
@@ -488,30 +487,8 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
// Initialize OpenSSL's random seed.
if (!q_RAND_status()) {
- struct {
- int msec;
- int sec;
- void *stack;
- } randomish;
-
- int attempts = 500;
- do {
- if (attempts < 500) {
-#ifdef Q_OS_UNIX
- struct timespec ts = {0, 33333333};
- nanosleep(&ts, 0);
-#else
- Sleep(3);
-#endif
- randomish.msec = attempts;
- }
- randomish.stack = (void *)&randomish;
- randomish.msec = QTime::currentTime().msec();
- randomish.sec = QTime::currentTime().second();
- q_RAND_seed((const char *)&randomish, sizeof(randomish));
- } while (!q_RAND_status() && --attempts);
- if (!attempts)
- return false;
+ qWarning("Random number generator not seeded, disabling SSL support");
+ return false;
}
}
return true;
@@ -659,8 +636,10 @@ void QSslSocketPrivate::resetDefaultCiphers()
if (SSL_CIPHER *cipher = q_sk_SSL_CIPHER_value(supportedCiphers, i)) {
QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher);
if (!ciph.isNull()) {
- // Unconditionally exclude ADH ciphers since they offer no MITM protection
- if (!ciph.name().toLower().startsWith(QLatin1String("adh")))
+ // Unconditionally exclude ADH and AECDH ciphers since they offer no MITM protection
+ if (!ciph.name().toLower().startsWith(QLatin1String("adh")) &&
+ !ciph.name().toLower().startsWith(QLatin1String("exp-adh")) &&
+ !ciph.name().toLower().startsWith(QLatin1String("aecdh")))
ciphers << ciph;
if (ciph.usedBits() >= 128)
defaultCiphers << ciph;
@@ -685,6 +664,7 @@ void QSslSocketPrivate::resetDefaultEllipticCurves()
QVarLengthArray<EC_builtin_curve> builtinCurves(static_cast<int>(curveCount));
if (q_EC_get_builtin_curves(builtinCurves.data(), curveCount) == curveCount) {
+ curves.reserve(int(curveCount));
for (size_t i = 0; i < curveCount; ++i) {
QSslEllipticCurve curve;
curve.id = builtinCurves[int(i)].nid;
@@ -824,11 +804,9 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
void QSslSocketBackendPrivate::startClientEncryption()
{
- Q_Q(QSslSocket);
if (!initSslContext()) {
- q->setErrorString(QSslSocket::tr("Unable to init SSL Context: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Unable to init SSL Context: %1").arg(getErrorsFromOpenSsl()));
return;
}
@@ -840,11 +818,9 @@ void QSslSocketBackendPrivate::startClientEncryption()
void QSslSocketBackendPrivate::startServerEncryption()
{
- Q_Q(QSslSocket);
if (!initSslContext()) {
- q->setErrorString(QSslSocket::tr("Unable to init SSL Context: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Unable to init SSL Context: %1").arg(getErrorsFromOpenSsl()));
return;
}
@@ -890,9 +866,9 @@ void QSslSocketBackendPrivate::transmit()
break;
} else {
// ### Better error handling.
- q->setErrorString(QSslSocket::tr("Unable to write data: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Unable to write data: %1").arg(
+ getErrorsFromOpenSsl()));
return;
}
}
@@ -934,9 +910,7 @@ void QSslSocketBackendPrivate::transmit()
#endif
if (actualWritten < 0) {
//plain socket write fails if it was in the pending close state.
- q->setErrorString(plainSocket->errorString());
- q->setSocketError(plainSocket->error());
- emit q->error(plainSocket->error());
+ setErrorAndEmit(plainSocket->error(), plainSocket->errorString());
return;
}
transmitting = true;
@@ -962,9 +936,9 @@ void QSslSocketBackendPrivate::transmit()
plainSocket->read(data.data(), writtenToBio);
} else {
// ### Better error handling.
- q->setErrorString(QSslSocket::tr("Unable to decrypt data: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Unable to decrypt data: %1").arg(
+ getErrorsFromOpenSsl()));
return;
}
@@ -1038,17 +1012,15 @@ void QSslSocketBackendPrivate::transmit()
qCDebug(lcSsl) << "QSslSocketBackendPrivate::transmit: remote disconnect";
#endif
shutdown = true; // the other side shut down, make sure we do not send shutdown ourselves
- q->setErrorString(QSslSocket::tr("The TLS/SSL connection has been closed"));
- q->setSocketError(QAbstractSocket::RemoteHostClosedError);
- emit q->error(QAbstractSocket::RemoteHostClosedError);
+ setErrorAndEmit(QAbstractSocket::RemoteHostClosedError,
+ QSslSocket::tr("The TLS/SSL connection has been closed"));
return;
case SSL_ERROR_SYSCALL: // some IO error
case SSL_ERROR_SSL: // error in the SSL library
// we do not know exactly what the error is, nor whether we can recover from it,
// so just return to prevent an endless loop in the outer "while" statement
- q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Error while reading: %1").arg(getErrorsFromOpenSsl()));
return;
default:
// SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT: can only happen with a
@@ -1056,9 +1028,8 @@ void QSslSocketBackendPrivate::transmit()
// SSL_ERROR_WANT_X509_LOOKUP: can only happen with a
// SSL_CTX_set_client_cert_cb(), which we do not call.
// So this default case should never be triggered.
- q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Error while reading: %1").arg(getErrorsFromOpenSsl()));
break;
}
} while (ssl && readBytes > 0);
@@ -1150,12 +1121,12 @@ bool QSslSocketBackendPrivate::startHandshake()
// The handshake is not yet complete.
break;
default:
- q->setErrorString(QSslSocket::tr("Error during SSL handshake: %1").arg(getErrorsFromOpenSsl()));
- q->setSocketError(QAbstractSocket::SslHandshakeFailedError);
+ QString errorString
+ = QSslSocket::tr("Error during SSL handshake: %1").arg(getErrorsFromOpenSsl());
#ifdef QSSLSOCKET_DEBUG
- qCDebug(lcSsl) << "QSslSocketBackendPrivate::startHandshake: error!" << q->errorString();
+ qCDebug(lcSsl) << "QSslSocketBackendPrivate::startHandshake: error!" << errorString;
#endif
- emit q->error(QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, errorString);
q->abort();
}
return false;
@@ -1213,7 +1184,9 @@ bool QSslSocketBackendPrivate::startHandshake()
}
// Translate errors from the error list into QSslErrors.
- for (int i = 0; i < errorList.size(); ++i) {
+ const int numErrors = errorList.size();
+ errors.reserve(errors.size() + numErrors);
+ for (int i = 0; i < numErrors; ++i) {
const QPair<int, int> &errorAndDepth = errorList.at(i);
int err = errorAndDepth.first;
int depth = errorAndDepth.second;
@@ -1304,9 +1277,7 @@ bool QSslSocketBackendPrivate::checkSslErrors()
pauseSocketNotifiers(q);
paused = true;
} else {
- q->setErrorString(sslErrors.first().errorString());
- q->setSocketError(QAbstractSocket::SslHandshakeFailedError);
- emit q->error(QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, sslErrors.first().errorString());
plainSocket->disconnectFromHost();
}
return false;
@@ -1689,6 +1660,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
setDefaultCaCertificates(defaultCaCertificates() + systemCaCertificates());
}
+ const QDateTime now = QDateTime::currentDateTimeUtc();
foreach (const QSslCertificate &caCertificate, QSslConfiguration::defaultConfiguration().caCertificates()) {
// From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
//
@@ -1701,7 +1673,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
// certificates mixed with valid ones.
//
// See also: QSslContext::fromConfiguration()
- if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
+ if (caCertificate.expiryDate() >= now) {
q_X509_STORE_add_cert(certStore, reinterpret_cast<X509 *>(caCertificate.handle()));
}
}
@@ -1782,7 +1754,9 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
}
// Translate errors from the error list into QSslErrors.
- for (int i = 0; i < errorList.size(); ++i) {
+ const int numErrors = errorList.size();
+ errors.reserve(errors.size() + numErrors);
+ for (int i = 0; i < numErrors; ++i) {
const QPair<int, int> &errorAndDepth = errorList.at(i);
int err = errorAndDepth.first;
int depth = errorAndDepth.second;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index e2700df3cc..e7829bac90 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -119,10 +119,13 @@ void qsslSocketUnresolvedSymbolWarning(const char *functionName)
qCWarning(lcSsl, "QSslSocket: cannot call unresolved function %s", functionName);
}
+#ifndef QT_NO_LIBRARY
void qsslSocketCannotResolveSymbolWarning(const char *functionName)
{
qCWarning(lcSsl, "QSslSocket: cannot resolve %s", functionName);
}
+#endif
+
}
#endif // QT_LINKED_OPENSSL
@@ -156,7 +159,16 @@ DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, const unsigned char **b, b, long c, c
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);
+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);
+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)
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)
@@ -309,13 +321,17 @@ DEFINEFUNC(const SSL_METHOD *, TLSv1_1_server_method, DUMMYARG, DUMMYARG, 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
@@ -436,39 +452,41 @@ bool q_resolveOpenSslSymbols()
#else
# ifdef Q_OS_UNIX
-static bool libGreaterThan(const QString &lhs, const QString &rhs)
+struct NumericallyLess
{
- QStringList lhsparts = lhs.split(QLatin1Char('.'));
- QStringList rhsparts = rhs.split(QLatin1Char('.'));
- Q_ASSERT(lhsparts.count() > 1 && rhsparts.count() > 1);
-
- for (int i = 1; i < rhsparts.count(); ++i) {
- if (lhsparts.count() <= i)
- // left hand side is shorter, so it's less than rhs
- return false;
-
+ typedef bool result_type;
+ result_type operator()(const QStringRef &lhs, const QStringRef &rhs) const
+ {
bool ok = false;
int b = 0;
- int a = lhsparts.at(i).toInt(&ok);
+ int a = lhs.toInt(&ok);
if (ok)
- b = rhsparts.at(i).toInt(&ok);
+ b = rhs.toInt(&ok);
if (ok) {
// both toInt succeeded
- if (a == b)
- continue;
- return a > b;
+ return a < b;
} else {
// compare as strings;
- if (lhsparts.at(i) == rhsparts.at(i))
- continue;
- return lhsparts.at(i) > rhsparts.at(i);
+ return lhs < rhs;
}
}
+};
- // they compared strictly equally so far
- // lhs cannot be less than rhs
- return true;
-}
+struct LibGreaterThan
+{
+ typedef bool result_type;
+ result_type operator()(const QString &lhs, const QString &rhs) const
+ {
+ const QVector<QStringRef> lhsparts = lhs.splitRef(QLatin1Char('.'));
+ const QVector<QStringRef> rhsparts = rhs.splitRef(QLatin1Char('.'));
+ Q_ASSERT(lhsparts.count() > 1 && rhsparts.count() > 1);
+
+ // note: checking rhs < lhs, the same as lhs > rhs
+ return std::lexicographical_compare(rhsparts.begin() + 1, rhsparts.end(),
+ lhsparts.begin() + 1, lhsparts.end(),
+ NumericallyLess());
+ }
+};
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
static int dlIterateCallback(struct dl_phdr_info *info, size_t size, void *data)
@@ -522,39 +540,33 @@ static QStringList libraryPathList()
return paths;
}
-
-static QStringList findAllLibSsl()
+Q_NEVER_INLINE
+static QStringList findAllLibs(QLatin1String filter)
{
QStringList paths = libraryPathList();
- QStringList foundSsls;
+ QStringList found;
+ const QStringList filters((QString(filter)));
foreach (const QString &path, paths) {
QDir dir(path);
- QStringList entryList = dir.entryList(QStringList() << QLatin1String("libssl.*"), QDir::Files);
+ QStringList entryList = dir.entryList(filters, QDir::Files);
- std::sort(entryList.begin(), entryList.end(), libGreaterThan);
+ std::sort(entryList.begin(), entryList.end(), LibGreaterThan());
foreach (const QString &entry, entryList)
- foundSsls << path + QLatin1Char('/') + entry;
+ found << path + QLatin1Char('/') + entry;
}
- return foundSsls;
+ return found;
}
-static QStringList findAllLibCrypto()
+static QStringList findAllLibSsl()
{
- QStringList paths = libraryPathList();
-
- QStringList foundCryptos;
- foreach (const QString &path, paths) {
- QDir dir(path);
- QStringList entryList = dir.entryList(QStringList() << QLatin1String("libcrypto.*"), QDir::Files);
-
- std::sort(entryList.begin(), entryList.end(), libGreaterThan);
- foreach (const QString &entry, entryList)
- foundCryptos << path + QLatin1Char('/') + entry;
- }
+ return findAllLibs(QLatin1String("libssl.*"));
+}
- return foundCryptos;
+static QStringList findAllLibCrypto()
+{
+ return findAllLibs(QLatin1String("libcrypto.*"));
}
# endif
@@ -759,7 +771,16 @@ bool q_resolveOpenSslSymbols()
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_ctrl)
+ RESOLVEFUNC(EVP_CIPHER_CTX_set_key_length)
+ RESOLVEFUNC(EVP_CipherInit)
+ RESOLVEFUNC(EVP_CipherUpdate)
+ RESOLVEFUNC(EVP_CipherFinal)
+ RESOLVEFUNC(EVP_des_cbc)
RESOLVEFUNC(EVP_des_ede3_cbc)
+ RESOLVEFUNC(EVP_rc2_cbc)
RESOLVEFUNC(EVP_PKEY_assign)
RESOLVEFUNC(EVP_PKEY_set1_RSA)
RESOLVEFUNC(EVP_PKEY_set1_DSA)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 626c049629..7f87f11b7c 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -235,7 +235,16 @@ 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);
+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_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();
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);
@@ -363,27 +372,43 @@ typedef unsigned int (*q_psk_client_callback_t)(SSL *ssl, const char *hint, char
void q_SSL_set_psk_client_callback(SSL *ssl, q_psk_client_callback_t callback);
#endif // 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();
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
index aba3ea8170..b03f234d49 100644
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ b/src/network/ssl/qsslsocket_winrt.cpp
@@ -251,9 +251,8 @@ void QSslSocketBackendPrivate::startClientEncryption()
case QSsl::TlsV1_2OrLater:
// TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater are disabled on WinRT
// because there is no good way to map them to the native API.
- q->setErrorString(QStringLiteral("unsupported protocol"));
- q->setSocketError(QAbstractSocket::SslInvalidUserDataError);
- emit q->error(QAbstractSocket::SslInvalidUserDataError);
+ setErrorAndEmit(QAbstractSocket::SslInvalidUserDataError,
+ QStringLiteral("unsupported protocol"));
return;
default:
protectionLevel = SocketProtectionLevel_Tls12; // default to highest
@@ -347,13 +346,10 @@ QSsl::SslProtocol QSslSocketBackendPrivate::sessionProtocol() const
void QSslSocketBackendPrivate::continueHandshake()
{
- Q_Q(QSslSocket);
-
IStreamSocket *socket = reinterpret_cast<IStreamSocket *>(plainSocket->socketDescriptor());
if (qintptr(socket) == -1) {
- q->setErrorString(QStringLiteral("At attempt was made to continue the handshake on an invalid socket."));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QStringLiteral("At attempt was made to continue the handshake on an invalid socket."));
return;
}
@@ -372,9 +368,7 @@ void QSslSocketBackendPrivate::continueHandshake()
Q_ASSERT_SUCCEEDED(hr);
}
if (FAILED(hr)) {
- q->setErrorString(qt_error_string(hr));
- q->setSocketError(QAbstractSocket::SslInvalidUserDataError);
- emit q->error(QAbstractSocket::SslInvalidUserDataError);
+ setErrorAndEmit(QAbstractSocket::SslInvalidUserDataError, qt_error_string(hr));
return;
}
@@ -440,10 +434,8 @@ void QSslSocketBackendPrivate::continueHandshake()
ComPtr<IAsyncAction> op;
hr = socket->UpgradeToSslAsync(protectionLevel, hostName.Get(), &op);
if (FAILED(hr)) {
- q->setErrorString(QSslSocket::tr("Error creating SSL session: %1")
- .arg(qt_error_string(hr)));
- q->setSocketError(QAbstractSocket::SslInternalError);
- emit q->error(QAbstractSocket::SslInternalError);
+ setErrorAndEmit(QAbstractSocket::SslInternalError,
+ QSslSocket::tr("Error creating SSL session: %1").arg(qt_error_string(hr)));
return;
}
@@ -467,9 +459,7 @@ HRESULT QSslSocketBackendPrivate::onSslUpgrade(IAsyncAction *action, AsyncStatus
QSet<QSslError> errors;
switch (hr) {
case SEC_E_INVALID_TOKEN: // Occurs when the server doesn't support the requested protocol
- q->setErrorString(qt_error_string(hr));
- q->setSocketError(QAbstractSocket::SslHandshakeFailedError);
- emit q->error(QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, qt_error_string(hr));
q->disconnectFromHost();
return S_OK;
default:
@@ -628,9 +618,7 @@ HRESULT QSslSocketBackendPrivate::onSslUpgrade(IAsyncAction *action, AsyncStatus
if (!sslErrors.isEmpty()) {
emit q->sslErrors(sslErrors);
- q->setErrorString(sslErrors.first().errorString());
- q->setSocketError(QAbstractSocket::SslHandshakeFailedError);
- emit q->error(QAbstractSocket::SslHandshakeFailedError);
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError, sslErrors.first().errorString());
// Disconnect if there are any non-ignorable errors
foreach (const QSslError &error, sslErrors) {
diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf
index 6ff6cae2cb..3c5fc280bd 100644
--- a/src/opengl/doc/qtopengl.qdocconf
+++ b/src/opengl/doc/qtopengl.qdocconf
@@ -21,7 +21,7 @@ imagedirs += images \
depends += qtdoc qtcore qtgui qtwidgets qmake
-examplesinstallpath = opengl
+examplesinstallpath = qtbase/opengl
# The following parameters are for creating a qhp file, the qhelpgenerator
# program can convert the qhp file into a qch file which can be opened in
diff --git a/src/opengl/doc/src/qtopengl-index.qdoc b/src/opengl/doc/src/qtopengl-index.qdoc
index d8e63547b7..a01ccc67f6 100644
--- a/src/opengl/doc/src/qtopengl-index.qdoc
+++ b/src/opengl/doc/src/qtopengl-index.qdoc
@@ -32,7 +32,7 @@
use OpenGL in Qt applications.
\warning This module should not be used anymore for new code. Please
- use the corresponding OpenGL classes in \l{Qt Gui}.
+ use the corresponding OpenGL classes in \l{Qt GUI}.
OpenGL is a standard API for rendering 3D graphics. OpenGL only
deals with 3D rendering and provides little or no support for GUI
diff --git a/src/opengl/doc/src/qtopengl-module.qdoc b/src/opengl/doc/src/qtopengl-module.qdoc
index 824db48754..80742dd588 100644
--- a/src/opengl/doc/src/qtopengl-module.qdoc
+++ b/src/opengl/doc/src/qtopengl-module.qdoc
@@ -35,7 +35,7 @@
use OpenGL in Qt applications.
\warning This module should not be used anymore for new code. Please
- use the corresponding OpenGL classes in \l{Qt Gui}.
+ use the corresponding OpenGL classes in \l{Qt GUI}.
OpenGL is a standard API for rendering 3D graphics. OpenGL only
deals with 3D rendering and provides little or no support for GUI
diff --git a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
index 1551d1c7cb..6bf152b83d 100644
--- a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
+++ b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
@@ -63,6 +63,7 @@ QGLCustomShaderStage::~QGLCustomShaderStage()
d->m_manager->removeCustomStage();
d->m_manager->sharedShaders->cleanupCustomStage(this);
}
+ delete d_ptr;
}
void QGLCustomShaderStage::setUniformsDirty()
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index eae9a4c228..d84b59efff 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -4357,8 +4357,7 @@ void QGLWidget::resizeOverlayGL(int, int)
{
}
-/*!
- Handles the event \a e passed as a parameter.
+/*!\reimp
*/
bool QGLWidget::event(QEvent *e)
{
@@ -4500,7 +4499,7 @@ QImage QGLWidget::grabFrameBuffer(bool withAlpha)
{
makeCurrent();
QImage res;
- qreal pixelRatio = devicePixelRatio();
+ qreal pixelRatio = devicePixelRatioF();
int w = pixelRatio * width();
int h = pixelRatio * height();
if (format().rgba())
@@ -4913,7 +4912,7 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
GLdouble win_x = 0, win_y = 0, win_z = 0;
qgluProject(x, y, z, &model[0], &proj[0], &view[0],
&win_x, &win_y, &win_z);
- const int dpr = d->glcx->device()->devicePixelRatio();
+ const int dpr = d->glcx->device()->devicePixelRatioF();
win_x /= dpr;
win_y /= dpr;
win_y = height - win_y; // y is inverted
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 8c55cffbb3..99abdd2ad6 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -235,7 +235,7 @@ public:
QGLContext(const QGLFormat& format);
virtual ~QGLContext();
- virtual bool create(const QGLContext* shareContext = 0);
+ virtual bool create(const QGLContext* shareContext = Q_NULLPTR);
bool isValid() const;
bool isSharing() const;
void reset();
@@ -303,7 +303,7 @@ public:
QOpenGLContext *contextHandle() const;
protected:
- virtual bool chooseContext(const QGLContext* shareContext = 0);
+ virtual bool chooseContext(const QGLContext* shareContext = Q_NULLPTR);
bool deviceIsPixmap() const;
bool windowCreated() const;
@@ -356,12 +356,12 @@ class Q_OPENGL_EXPORT QGLWidget : public QWidget
Q_OBJECT
Q_DECLARE_PRIVATE(QGLWidget)
public:
- explicit QGLWidget(QWidget* parent=0,
- const QGLWidget* shareWidget = 0, Qt::WindowFlags f=0);
- explicit QGLWidget(QGLContext *context, QWidget* parent=0,
- const QGLWidget* shareWidget = 0, Qt::WindowFlags f=0);
- explicit QGLWidget(const QGLFormat& format, QWidget* parent=0,
- const QGLWidget* shareWidget = 0, Qt::WindowFlags f=0);
+ explicit QGLWidget(QWidget* parent=Q_NULLPTR,
+ const QGLWidget* shareWidget = Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QGLWidget(QGLContext *context, QWidget* parent=Q_NULLPTR,
+ const QGLWidget* shareWidget = Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QGLWidget(const QGLFormat& format, QWidget* parent=Q_NULLPTR,
+ const QGLWidget* shareWidget = Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
~QGLWidget();
void qglColor(const QColor& c) const;
@@ -380,7 +380,7 @@ public:
void setFormat(const QGLFormat& format);
QGLContext* context() const;
- void setContext(QGLContext* context, const QGLContext* shareContext = 0,
+ void setContext(QGLContext* context, const QGLContext* shareContext = Q_NULLPTR,
bool deleteOldContext = true);
QPixmap renderPixmap(int w = 0, int h = 0, bool useContext = false);
@@ -442,9 +442,9 @@ protected:
QGLWidget(QGLWidgetPrivate &dd,
const QGLFormat &format = QGLFormat(),
- QWidget *parent = 0,
- const QGLWidget* shareWidget = 0,
- Qt::WindowFlags f = 0);
+ QWidget *parent = Q_NULLPTR,
+ const QGLWidget* shareWidget = Q_NULLPTR,
+ Qt::WindowFlags f = Qt::WindowFlags());
private:
Q_DISABLE_COPY(QGLWidget)
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index fd7f2b328c..ad5386d8bc 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -50,7 +50,7 @@
#include "QtCore/qmap.h"
#include "QtCore/qthread.h"
#include "QtCore/qthreadstorage.h"
-#include "QtCore/qhash.h"
+#include "QtCore/qhashfunctions.h"
#include "QtCore/qatomic.h"
#include "QtWidgets/private/qwidget_p.h"
#include "QtGui/private/qopenglcontext_p.h"
diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h
index e424ff2b5c..67b1a68072 100644
--- a/src/opengl/qglbuffer.h
+++ b/src/opengl/qglbuffer.h
@@ -103,7 +103,7 @@ public:
void write(int offset, const void *data, int count);
void allocate(const void *data, int count);
- inline void allocate(int count) { allocate(0, count); }
+ inline void allocate(int count) { allocate(Q_NULLPTR, count); }
void *map(QGLBuffer::Access access);
bool unmap();
diff --git a/src/opengl/qglcolormap.h b/src/opengl/qglcolormap.h
index f16f94c7f5..53031fd98f 100644
--- a/src/opengl/qglcolormap.h
+++ b/src/opengl/qglcolormap.h
@@ -63,7 +63,7 @@ public:
int findNearest(QRgb color) const;
protected:
- Qt::HANDLE handle() { return d ? d->cmapHandle : 0; }
+ Qt::HANDLE handle() { return d ? d->cmapHandle : Q_NULLPTR; }
void setHandle(Qt::HANDLE ahandle) { d->cmapHandle = ahandle; }
private:
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 3479fccf58..b636f90918 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -1285,6 +1285,9 @@ int QGLFramebufferObject::metric(PaintDeviceMetric metric) const
case QPaintDevice::PdmDevicePixelRatio:
return 1;
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ return 1 * QPaintDevice::devicePixelRatioFScale();
+
default:
qWarning("QGLFramebufferObject::metric(), Unhandled metric type: %d.\n", metric);
break;
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index 80b8596a20..ddb7b89d98 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -70,7 +70,7 @@ public:
QGLFunctions::OpenGLFeatures openGLFeatures() const;
bool hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const;
- void initializeGLFunctions(const QGLContext *context = 0);
+ void initializeGLFunctions(const QGLContext *context = Q_NULLPTR);
void glActiveTexture(GLenum texture);
void glAttachShader(GLuint program, GLuint shader);
@@ -172,14 +172,14 @@ public:
private:
QGLFunctionsPrivate *d_ptr;
- static bool isInitialized(const QGLFunctionsPrivate *d) { return d != 0; }
+ static bool isInitialized(const QGLFunctionsPrivate *d) { return d != Q_NULLPTR; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFunctions::OpenGLFeatures)
struct QGLFunctionsPrivate
{
- QGLFunctionsPrivate(const QGLContext *context = 0);
+ QGLFunctionsPrivate(const QGLContext *context = Q_NULLPTR);
QOpenGLFunctions *funcs;
};
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index 89cf01d8ec..b5df45bcc8 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -62,6 +62,8 @@ int QGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
}
case PdmDevicePixelRatio:
return 1;
+ case PdmDevicePixelRatioScaled:
+ return 1 * QPaintDevice::devicePixelRatioFScale();
default:
qWarning("QGLPaintDevice::metric() - metric %d not known", metric);
return 0;
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 42fa3415ef..943ec7ad30 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -458,6 +458,9 @@ int QGLPixelBuffer::metric(PaintDeviceMetric metric) const
case QPaintDevice::PdmDevicePixelRatio:
return 1;
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ return QPaintDevice::devicePixelRatioFScale();
+
default:
qWarning("QGLPixelBuffer::metric(), Unhandled metric type: %d\n", metric);
break;
diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h
index 0f0110da96..2aad76b002 100644
--- a/src/opengl/qglpixelbuffer.h
+++ b/src/opengl/qglpixelbuffer.h
@@ -47,9 +47,9 @@ class Q_OPENGL_EXPORT QGLPixelBuffer : public QPaintDevice
Q_DECLARE_PRIVATE(QGLPixelBuffer)
public:
QGLPixelBuffer(const QSize &size, const QGLFormat &format = QGLFormat::defaultFormat(),
- QGLWidget *shareWidget = 0);
+ QGLWidget *shareWidget = Q_NULLPTR);
QGLPixelBuffer(int width, int height, const QGLFormat &format = QGLFormat::defaultFormat(),
- QGLWidget *shareWidget = 0);
+ QGLWidget *shareWidget = Q_NULLPTR);
virtual ~QGLPixelBuffer();
bool isValid() const;
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index c0122eb59f..0617c36236 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -246,8 +246,7 @@ bool QGLShaderPrivate::create()
else
shader = glfuncs->glCreateShader(GL_FRAGMENT_SHADER);
if (!shader) {
- qWarning("%s: Could not create shader of type %d.",
- Q_FUNC_INFO, int(shaderType));
+ qWarning("Could not create shader of type %d.", int(shaderType));
return false;
}
shaderGuard = createSharedResourceGuard(context, shader, freeShaderFunc);
@@ -1706,7 +1705,7 @@ void QGLShaderProgram::setAttributeBuffer
Q_UNUSED(d);
if (location != -1) {
d->glfuncs->glVertexAttribPointer(location, tupleSize, type, GL_TRUE, stride,
- reinterpret_cast<const void *>(offset));
+ reinterpret_cast<const void *>(qintptr(offset)));
}
}
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index 5d9fe22b0b..8f2c74fae7 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -58,8 +58,8 @@ public:
};
Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit)
- explicit QGLShader(QGLShader::ShaderType type, QObject *parent = 0);
- QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
+ explicit QGLShader(QGLShader::ShaderType type, QObject *parent = Q_NULLPTR);
+ QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = Q_NULLPTR);
virtual ~QGLShader();
QGLShader::ShaderType shaderType() const;
@@ -76,7 +76,7 @@ public:
GLuint shaderId() const;
- static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = 0);
+ static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = Q_NULLPTR);
private:
friend class QGLShaderProgram;
@@ -94,8 +94,8 @@ class Q_OPENGL_EXPORT QGLShaderProgram : public QObject
{
Q_OBJECT
public:
- explicit QGLShaderProgram(QObject *parent = 0);
- explicit QGLShaderProgram(const QGLContext *context, QObject *parent = 0);
+ explicit QGLShaderProgram(QObject *parent = Q_NULLPTR);
+ explicit QGLShaderProgram(const QGLContext *context, QObject *parent = Q_NULLPTR);
virtual ~QGLShaderProgram();
bool addShader(QGLShader *shader);
@@ -280,7 +280,7 @@ public:
void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count);
void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count);
- static bool hasOpenGLShaderPrograms(const QGLContext *context = 0);
+ static bool hasOpenGLShaderPrograms(const QGLContext *context = Q_NULLPTR);
private Q_SLOTS:
void shaderDestroyed();
diff --git a/src/platformheaders/cocoafunctions/cocoafunctions.pri b/src/platformheaders/cocoafunctions/cocoafunctions.pri
new file mode 100644
index 0000000000..3987523f9a
--- /dev/null
+++ b/src/platformheaders/cocoafunctions/cocoafunctions.pri
@@ -0,0 +1 @@
+HEADERS += $$PWD/qcocoawindowfunctions.h
diff --git a/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h
new file mode 100644
index 0000000000..997f440e65
--- /dev/null
+++ b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QXCBWINDOWFUNCTIONS_H
+#define QXCBWINDOWFUNCTIONS_H
+
+#include <QtPlatformHeaders/QPlatformHeaderHelper>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+
+class QCocoaWindowFunctions {
+public:
+ typedef QPoint (*BottomLeftClippedByNSWindowOffset)(QWindow *window);
+ static const QByteArray bottomLeftClippedByNSWindowOffsetIdentifier() { return QByteArrayLiteral("CocoaBottomLeftClippedByNSWindowOffset"); }
+
+ static QPoint bottomLeftClippedByNSWindowOffset(QWindow *window)
+ {
+ return QPlatformHeaderHelper::callPlatformFunction<QPoint, BottomLeftClippedByNSWindowOffset>(bottomLeftClippedByNSWindowOffsetIdentifier(),window);
+ }
+};
+
+
+QT_END_NAMESPACE
+
+#endif // QXCBWINDOWFUNCTIONS_H
diff --git a/src/platformheaders/cocoafunctions/qcocoawindowfunctions.qdoc b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.qdoc
new file mode 100644
index 0000000000..e95f92edb5
--- /dev/null
+++ b/src/platformheaders/cocoafunctions/qcocoawindowfunctions.qdoc
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class QCocoaWindowFunctions
+ \inmodule QtPlatformHeaders
+
+ \brief The QCocoaWindowFunctions class is an inline class containing
+ miscellaneous functionality for NSWindow and NSView window specific functionality.
+
+ \note There is no binary compatibility guarantee for this class,
+ meaning that an application using it is only guaranteed to work with the Qt
+ version it was developed against.
+*/
+
+/*!
+ \typedef QCocoaWindowFunctions::BottomLeftClippedByNSWindowOffset
+
+ This is the typedef for the function returned by QGuiApplication::platformFunction when passed clippedByNSWindowIdentifier.
+*/
+
+/*!
+ \fn QByteArray QCocoaWindowFunctions::bottomLeftClippedByNSWindowOffsetIdentifier()
+
+ This function returnes the bytearray that can be used to query
+ QGuiApplication::platformFunction to retrieve the BottomLeftClippedByNSWindowOffset function.
+*/
+
+/*!
+ \fn QPoint QCocoaWindowFunctions::bottomLeftClippedByNSWindowOffset(QWindow *window)
+
+ This is a convenience function that can be used directly instead of resolving the function pointer.
+ \a window will be relayed to the function retrieved by QGuiApplication
+*/
diff --git a/src/platformheaders/doc/qtplatformheaders.qdocconf b/src/platformheaders/doc/qtplatformheaders.qdocconf
index 1c09971e23..fc8a9d8731 100644
--- a/src/platformheaders/doc/qtplatformheaders.qdocconf
+++ b/src/platformheaders/doc/qtplatformheaders.qdocconf
@@ -4,7 +4,7 @@ project = QtPlatformHeaders
description = Qt Platform Headers Reference Documentation
version = $QT_VERSION
-examplesinstallpath = qtplatformheaders
+examplesinstallpath = qtbase/qtplatformheaders
qhp.projects = QtPlatformHeaders
diff --git a/src/platformheaders/helper/helper.pri b/src/platformheaders/helper/helper.pri
new file mode 100644
index 0000000000..2f6e766214
--- /dev/null
+++ b/src/platformheaders/helper/helper.pri
@@ -0,0 +1,2 @@
+HEADERS += \
+ $$PWD/qplatformheaderhelper.h
diff --git a/src/platformheaders/helper/qplatformheaderhelper.h b/src/platformheaders/helper/qplatformheaderhelper.h
new file mode 100644
index 0000000000..52302dbfba
--- /dev/null
+++ b/src/platformheaders/helper/qplatformheaderhelper.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QPLATFORMHEADERHELPER_H
+#define QPLATFORMHEADERHELPER_H
+
+#include <QtCore/QByteArray>
+#include <QtGui/QGuiApplication>
+
+#if 0
+#pragma qt_class(QPlatformHeaderHelper)
+#endif
+
+QT_BEGIN_NAMESPACE
+
+namespace QPlatformHeaderHelper {
+
+template<typename ReturnT, typename FunctionT>
+ReturnT callPlatformFunction(const QByteArray &functionName)
+{
+ FunctionT func = reinterpret_cast<FunctionT>(QGuiApplication::platformFunction(functionName));
+ return func ? func() : ReturnT();
+}
+
+template<typename ReturnT, typename FunctionT, typename Arg1>
+ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1)
+{
+ FunctionT func = reinterpret_cast<FunctionT>(QGuiApplication::platformFunction(functionName));
+ return func ? func(a1) : ReturnT();
+}
+
+template<typename ReturnT, typename FunctionT, typename Arg1, typename Arg2>
+ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2)
+{
+ FunctionT func = reinterpret_cast<FunctionT>(QGuiApplication::platformFunction(functionName));
+ return func ? func(a1, a2) : ReturnT();
+}
+
+template<typename ReturnT, typename FunctionT, typename Arg1, typename Arg2, typename Arg3>
+ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2, Arg3 a3)
+{
+ FunctionT func = reinterpret_cast<FunctionT>(QGuiApplication::platformFunction(functionName));
+ return func ? func(a1, a2, a3) : ReturnT();
+}
+
+template<typename ReturnT, typename FunctionT, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ReturnT callPlatformFunction(const QByteArray &functionName, Arg1 a1, Arg2 a2, Arg3 a3, Arg4 a4)
+{
+ FunctionT func = reinterpret_cast<FunctionT>(QGuiApplication::platformFunction(functionName));
+ return func ? func(a1, a2, a3, a4) : ReturnT();
+}
+
+}
+
+QT_END_NAMESPACE
+
+#endif /*QPLATFORMHEADERHELPER_H*/
diff --git a/src/platformheaders/platformheaders.pro b/src/platformheaders/platformheaders.pro
index 5e875f7d2d..1ced4f1c95 100644
--- a/src/platformheaders/platformheaders.pro
+++ b/src/platformheaders/platformheaders.pro
@@ -7,6 +7,8 @@ include(nativecontexts/nativecontexts.pri)
include(xcbfunctions/xcbfunctions.pri)
include(eglfsfunctions/eglfsfunctions.pri)
include(windowsfunctions/windowsfunctions.pri)
+include(helper/helper.pri)
+include(cocoafunctions/cocoafunctions.pri)
QMAKE_DOCS = $$PWD/doc/qtplatformheaders.qdocconf
diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h
index 4c6d01cc52..720f7f31be 100644
--- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h
+++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h
@@ -60,6 +60,15 @@ public:
if (func)
func(window, type);
}
+
+ typedef void (*SetHasBorderInFullScreen)(QWindow *window, bool border);
+ static const QByteArray setHasBorderInFullScreenIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreen"); }
+ static void setHasBorderInFullScreen(QWindow *window, bool border)
+ {
+ SetHasBorderInFullScreen func = reinterpret_cast<SetHasBorderInFullScreen>(QGuiApplication::platformFunction(setHasBorderInFullScreenIdentifier()));
+ if (func)
+ func(window, border);
+ }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsWindowFunctions::TouchWindowTouchTypes)
diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc
index 84fae2f56d..d6b8764e7b 100644
--- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc
+++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc
@@ -69,3 +69,29 @@
This is a convenience function that can be used directly instead of resolving the function pointer.
\a window and \a type will be relayed to the function retrieved by QGuiApplication
*/
+
+/*!
+ \typedef QWindowsWindowFunctions::SetHasBorderInFullScreen
+
+ This is the typedef for the function returned by QGuiApplication::platformFunction when passed setHasBorderInFullScreenIdentifier.
+*/
+
+/*!
+ \fn QByteArray QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()
+ \since 5.6
+
+ This function returns the bytearray that can be used to query
+ QGuiApplication::platformFunction to retrieve the SetHasBorderInFullScreen function.
+*/
+
+/*!
+ \fn void QWindowsWindowFunctions::setHasBorderInFullScreen(QWindow *window, bool border)
+ \since 5.6
+
+ This is a convenience function that can be used directly instead of resolving the function pointer.
+ \a window and \a border will be relayed to the function retrieved by QGuiApplication. When \a border
+ is true then it will enable the WS_BORDER flag in full screen mode to enable other top level windows
+ inside the application to appear on top when required.
+
+ See also \l [QtDoc] {Fullscreen OpenGL Based Windows}
+*/
diff --git a/src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h b/src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h
new file mode 100644
index 0000000000..66bfb72307
--- /dev/null
+++ b/src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QXCBINTEGRATIONFUNCTIONS_H
+#define QXCBINTEGRATIONFUNCTIONS_H
+
+#include <QtPlatformHeaders/QPlatformHeaderHelper>
+
+QT_BEGIN_NAMESPACE
+
+class QXcbIntegrationFunctions
+{
+public:
+ typedef bool (*XEmbedSystemTrayVisualHasAlphaChannel)();
+ static const QByteArray xEmbedSystemTrayVisualHasAlphaChannelIdentifier() { return QByteArrayLiteral("XcbXEmbedSystemTrayVisualHasAlphaChannel"); }
+ static bool xEmbedSystemTrayVisualHasAlphaChannel()
+ {
+ return QPlatformHeaderHelper::callPlatformFunction<bool, XEmbedSystemTrayVisualHasAlphaChannel>(xEmbedSystemTrayVisualHasAlphaChannelIdentifier());
+ }
+};
+
+QT_END_NAMESPACE
+
+#endif /*QXCBINTEGRATIONFUNCTIONS_H*/
diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h
index ae05cf52a9..0db2e2a09d 100644
--- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h
+++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.h
@@ -34,8 +34,7 @@
#ifndef QXCBWINDOWFUNCTIONS_H
#define QXCBWINDOWFUNCTIONS_H
-#include <QtCore/QByteArray>
-#include <QtGui/QGuiApplication>
+#include <QtPlatformHeaders/QPlatformHeaderHelper>
QT_BEGIN_NAMESPACE
@@ -65,12 +64,37 @@ public:
typedef void (*SetWmWindowType)(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowType);
static const QByteArray setWmWindowTypeIdentifier() { return QByteArrayLiteral("XcbSetWmWindowType"); }
-
static void setWmWindowType(QWindow *window, WmWindowType type)
{
- SetWmWindowType func = reinterpret_cast<SetWmWindowType>(QGuiApplication::platformFunction(setWmWindowTypeIdentifier()));
- if (func)
- func(window, type);
+ return QPlatformHeaderHelper::callPlatformFunction<void, SetWmWindowType, QWindow *, WmWindowType>(setWmWindowTypeIdentifier(), window, type);
+ }
+
+ typedef void (*SetWmWindowIconText)(QWindow *window, const QString &text);
+ static const QByteArray setWmWindowIconTextIdentifier() { return QByteArrayLiteral("XcbSetWmWindowIconText"); }
+ static void setWmWindowIconText(QWindow *window, const QString &text)
+ {
+ return QPlatformHeaderHelper::callPlatformFunction<void, SetWmWindowIconText, QWindow *, const QString &>(setWmWindowIconTextIdentifier(), window, text);
+ }
+
+ typedef void (*SetParentRelativeBackPixmap)(const QWindow *window);
+ static const QByteArray setParentRelativeBackPixmapIdentifier() { return QByteArrayLiteral("XcbSetParentRelativeBackPixmap"); }
+ static void setParentRelativeBackPixmap(const QWindow *window)
+ {
+ return QPlatformHeaderHelper::callPlatformFunction<void, SetParentRelativeBackPixmap, const QWindow *>(setParentRelativeBackPixmapIdentifier(), window);
+ }
+
+ typedef bool (*RequestSystemTrayWindowDock)(const QWindow *window);
+ static const QByteArray requestSystemTrayWindowDockIdentifier() { return QByteArrayLiteral("XcbRequestSystemTrayWindowDockIdentifier"); }
+ static bool requestSystemTrayWindowDock(const QWindow *window)
+ {
+ return QPlatformHeaderHelper::callPlatformFunction<bool, RequestSystemTrayWindowDock, const QWindow *>(requestSystemTrayWindowDockIdentifier(), window);
+ }
+
+ typedef QRect (*SystemTrayWindowGlobalGeometry)(const QWindow *window);
+ static const QByteArray systemTrayWindowGlobalGeometryIdentifier() { return QByteArrayLiteral("XcbSystemTrayWindowGlobalGeometryIdentifier"); }
+ static QRect systemTrayWindowGlobalGeometry(const QWindow *window)
+ {
+ return QPlatformHeaderHelper::callPlatformFunction<QRect, SystemTrayWindowGlobalGeometry, const QWindow *>(systemTrayWindowGlobalGeometryIdentifier(), window);
}
typedef uint (*VisualId)(QWindow *window);
diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc
index ab6ef9089f..b26255553f 100644
--- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc
+++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc
@@ -65,7 +65,9 @@
/*!
\typedef QXcbWindowFunctions::SetWmWindowType
- This is the typedef for the function returned by QGuiApplication::platformFunction when passed setWmWindowTypeIdentifier.
+ This is the typedef for the function returned by
+ QGuiApplication::platformFunction when passed the
+ value returned by setWmWindowTypeIdentifier().
*/
/*!
@@ -78,7 +80,132 @@
/*!
\fn void QXcbWindowFunctions::setWmWindowType(QWindow *window, WmWindowType type)
- This is a convenience function that can be used directly instead of resolving the function pointer.
- \a window and \a type will be relayed to the function retrieved by QGuiApplication
+ This is a convenience function that can be used directly instead
+ of resolving the function pointer. \a window and \a type will be
+ relayed to the function retrieved by QGuiApplication.
+*/
+
+/*!
+ \typedef QXcbWindowFunctions::SetWmWindowIconText
+
+ This is the typedef for the function returned by
+ QGuiApplication::platformFunction when passed the
+ value returned by setWmWindowIconTextIdentifier().
+*/
+
+/*!
+ \fn const QByteArray QXcbWindowFunctions::setWmWindowIconTextIdentifier()
+
+ This function returns the byte array that can be used to query
+ QGuiApplication::platformFunction to retrieve the SetWmWindowIconText function.
+*/
+
+/*!
+ \fn void QXcbWindowFunctions::setWmWindowIconText(QWindow *window, const QString& text)
+
+ This is a convenience function that can be used directly instead
+ of resolving the function pointer. \a window and \a text will be
+ relayed to the function retrieved by QGuiApplication.
+*/
+
+/*!
+ \typedef QXcbWindowFunctions::SetParentRelativeBackPixmap
+
+ This is the typedef for the function returned by
+ QGuiApplication::platformFunction when passed the
+ value returned by setParentRelativeBackPixmapIdentifier().
+*/
+
+/*!
+ \fn const QByteArray QXcbWindowFunctions::setParentRelativeBackPixmapIdentifier()
+
+ This function returns the byte array that can be used to query
+ QGuiApplication::platformFunction to retrieve the SetParentRelativeBackPixmap function.
+*/
+
+/*!
+ \fn void QXcbWindowFunctions::setParentRelativeBackPixmap(const QWindow *window)
+
+ This is a convenience function that can be used directly instead
+ of resolving the function pointer. \a window will be
+ relayed to the function retrieved by QGuiApplication.
+*/
+
+/*!
+ \typedef QXcbWindowFunctions::RequestSystemTrayWindowDock
+
+ This is the typedef for the function returned by
+ QGuiApplication::platformFunction when passed the
+ value returned by requestSystemTrayWindowDockIdentifier().
+*/
+
+/*!
+ \fn const QByteArray QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier()
+
+ This function returns the byte array that can be used to query
+ QGuiApplication::platformFunction to retrieve the RequestSystemTrayWindowDock function.
+*/
+
+/*!
+ \fn bool QXcbWindowFunctions::requestSystemTrayWindowDock(const QWindow *window)
+
+ This is a convenience function that can be used directly instead
+ of resolving the function pointer. \a window will be
+ relayed to the function retrieved by QGuiApplication.
+
+ Returns the boolean result of calling the function or false if the
+ function was not found.
+*/
+
+/*!
+ \typedef QXcbWindowFunctions::SystemTrayWindowGlobalGeometry
+
+ This is the typedef for the function returned by
+ QGuiApplication::platformFunction when passed the
+ value returned by systemTrayWindowGlobalGeometryIdentifier().
+*/
+
+/*!
+ \fn const QByteArray QXcbWindowFunctions::systemTrayWindowGlobalGeometryIdentifier()
+
+ This function returns the byte array that can be used to query
+ QGuiApplication::platformFunction to retrieve the SystemTrayWindowGlobalGeometry function.
+*/
+
+/*!
+ \fn QRect QXcbWindowFunctions::systemTrayWindowGlobalGeometry(const QWindow *window)
+
+ This is a convenience function that can be used directly instead
+ of resolving the function pointer. \a window will be
+ relayed to the function retrieved by QGuiApplication.
+
+ Returns the QRect result of calling the function or an empty
+ QRect if the function was not found.
+*/
+
+/*!
+ \typedef QXcbWindowFunctions::VisualId
+
+ This is the typedef for the function returned by
+ QGuiApplication::platformFunction when passed the
+ value returned by visualIdIdentifier().
+*/
+
+/*!
+ \fn const QByteArray QXcbWindowFunctions::visualIdIdentifier()
+
+ This function returns the byte array that can be used to query
+ QGuiApplication::platformFunction to retrieve the VisualId function.
+*/
+
+/*!
+ \fn uint QXcbWindowFunctions::visualId(QWindow *window)
+
+ This is a convenience function that can be used directly instead
+ of resolving the function pointer. \a window will be
+ relayed to the function retrieved by QGuiApplication.
+
+ Returns the unsigned integer result of calling the function or
+ UINT_MAX if the function was not found.
*/
diff --git a/src/platformheaders/xcbfunctions/xcbfunctions.pri b/src/platformheaders/xcbfunctions/xcbfunctions.pri
index 8844913cd1..7f611d80bd 100644
--- a/src/platformheaders/xcbfunctions/xcbfunctions.pri
+++ b/src/platformheaders/xcbfunctions/xcbfunctions.pri
@@ -1 +1,3 @@
-HEADERS += $$PWD/qxcbwindowfunctions.h
+HEADERS += \
+ $$PWD/qxcbwindowfunctions.h \
+ $$PWD/qxcbintegrationfunctions.h
diff --git a/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h b/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h
index fca3e16a68..4e52e4b6fc 100644
--- a/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h
+++ b/src/platformsupport/accessibility/qaccessiblebridgeutils_p.h
@@ -34,6 +34,17 @@
#ifndef QACCESSIBLEBRIDGEUTILS_H
#define QACCESSIBLEBRIDGEUTILS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qstringlist.h>
#include <QtGui/qaccessible.h>
diff --git a/src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri b/src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri
deleted file mode 100644
index 9a19d3c278..0000000000
--- a/src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-mac {
- HEADERS += $$PWD/qcfsocketnotifier_p.h
- SOURCES += $$PWD/qcfsocketnotifier.cpp
-}
diff --git a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp b/src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp
deleted file mode 100644
index b3a85292d0..0000000000
--- a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtGui module 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 "qcfsocketnotifier_p.h"
-#include <QtGui/qguiapplication.h>
-#include <QtCore/qsocketnotifier.h>
-#include <QtCore/qthread.h>
-
-QT_BEGIN_NAMESPACE
-
-/**************************************************************************
- Socket Notifiers
- *************************************************************************/
-void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef,
- const void *, void *info)
-{
-
- QCFSocketNotifier *cfSocketNotifier = static_cast<QCFSocketNotifier *>(info);
- int nativeSocket = CFSocketGetNative(s);
- MacSocketInfo *socketInfo = cfSocketNotifier->macSockets.value(nativeSocket);
- QEvent notifierEvent(QEvent::SockAct);
-
- // There is a race condition that happen where we disable the notifier and
- // the kernel still has a notification to pass on. We then get this
- // notification after we've successfully disabled the CFSocket, but our Qt
- // notifier is now gone. The upshot is we have to check the notifier
- // every time.
- if (callbackType == kCFSocketReadCallBack) {
- if (socketInfo->readNotifier && socketInfo->readEnabled) {
- socketInfo->readEnabled = false;
- QGuiApplication::sendEvent(socketInfo->readNotifier, &notifierEvent);
- }
- } else if (callbackType == kCFSocketWriteCallBack) {
- if (socketInfo->writeNotifier && socketInfo->writeEnabled) {
- socketInfo->writeEnabled = false;
- QGuiApplication::sendEvent(socketInfo->writeNotifier, &notifierEvent);
- }
- }
-
- if (cfSocketNotifier->maybeCancelWaitForMoreEvents)
- cfSocketNotifier->maybeCancelWaitForMoreEvents(cfSocketNotifier->eventDispatcher);
-}
-
-/*
- Adds a loop source for the given socket to the current run loop.
-*/
-CFRunLoopSourceRef qt_mac_add_socket_to_runloop(const CFSocketRef socket)
-{
- CFRunLoopSourceRef loopSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
- if (!loopSource)
- return 0;
-
- CFRunLoopAddSource(CFRunLoopGetMain(), loopSource, kCFRunLoopCommonModes);
- return loopSource;
-}
-
-/*
- Removes the loop source for the given socket from the current run loop.
-*/
-void qt_mac_remove_socket_from_runloop(const CFSocketRef socket, CFRunLoopSourceRef runloop)
-{
- Q_ASSERT(runloop);
- CFRunLoopRemoveSource(CFRunLoopGetMain(), runloop, kCFRunLoopCommonModes);
- CFSocketDisableCallBacks(socket, kCFSocketReadCallBack);
- CFSocketDisableCallBacks(socket, kCFSocketWriteCallBack);
-}
-
-QCFSocketNotifier::QCFSocketNotifier()
- : eventDispatcher(0)
- , maybeCancelWaitForMoreEvents(0)
- , enableNotifiersObserver(0)
-{
-
-}
-
-QCFSocketNotifier::~QCFSocketNotifier()
-{
-
-}
-
-void QCFSocketNotifier::setHostEventDispatcher(QAbstractEventDispatcher *hostEventDispacher)
-{
- eventDispatcher = hostEventDispacher;
-}
-
-void QCFSocketNotifier::setMaybeCancelWaitForMoreEventsCallback(MaybeCancelWaitForMoreEventsFn callBack)
-{
- maybeCancelWaitForMoreEvents = callBack;
-}
-
-void QCFSocketNotifier::registerSocketNotifier(QSocketNotifier *notifier)
-{
- Q_ASSERT(notifier);
- int nativeSocket = notifier->socket();
- int type = notifier->type();
-#ifndef QT_NO_DEBUG
- if (nativeSocket < 0 || nativeSocket > FD_SETSIZE) {
- qWarning("QSocketNotifier: Internal error");
- return;
- } else if (notifier->thread() != eventDispatcher->thread()
- || eventDispatcher->thread() != QThread::currentThread()) {
- qWarning("QSocketNotifier: socket notifiers cannot be enabled from another thread");
- return;
- }
-#endif
-
- if (type == QSocketNotifier::Exception) {
- qWarning("QSocketNotifier::Exception is not supported on iOS");
- return;
- }
-
- // Check if we have a CFSocket for the native socket, create one if not.
- MacSocketInfo *socketInfo = macSockets.value(nativeSocket);
- if (!socketInfo) {
- socketInfo = new MacSocketInfo();
-
- // Create CFSocket, specify that we want both read and write callbacks (the callbacks
- // are enabled/disabled later on).
- const int callbackTypes = kCFSocketReadCallBack | kCFSocketWriteCallBack;
- CFSocketContext context = {0, this, 0, 0, 0};
- socketInfo->socket = CFSocketCreateWithNative(kCFAllocatorDefault, nativeSocket, callbackTypes, qt_mac_socket_callback, &context);
- if (CFSocketIsValid(socketInfo->socket) == false) {
- qWarning("QEventDispatcherMac::registerSocketNotifier: Failed to create CFSocket");
- return;
- }
-
- CFOptionFlags flags = CFSocketGetSocketFlags(socketInfo->socket);
- // QSocketNotifier doesn't close the socket upon destruction/invalidation
- flags &= ~kCFSocketCloseOnInvalidate;
- // Expicitly disable automatic re-enable, as we do that manually on each runloop pass
- flags &= ~(kCFSocketAutomaticallyReenableWriteCallBack | kCFSocketAutomaticallyReenableReadCallBack);
- CFSocketSetSocketFlags(socketInfo->socket, flags);
-
- macSockets.insert(nativeSocket, socketInfo);
- }
-
- if (type == QSocketNotifier::Read) {
- Q_ASSERT(socketInfo->readNotifier == 0);
- socketInfo->readNotifier = notifier;
- socketInfo->readEnabled = false;
- } else if (type == QSocketNotifier::Write) {
- Q_ASSERT(socketInfo->writeNotifier == 0);
- socketInfo->writeNotifier = notifier;
- socketInfo->writeEnabled = false;
- }
-
- if (!enableNotifiersObserver) {
- // Create a run loop observer which enables the socket notifiers on each
- // pass of the run loop, before any sources are processed.
- CFRunLoopObserverContext context = {};
- context.info = this;
- enableNotifiersObserver = CFRunLoopObserverCreate(kCFAllocatorDefault, kCFRunLoopBeforeSources,
- true, 0, enableSocketNotifiers, &context);
- Q_ASSERT(enableNotifiersObserver);
- CFRunLoopAddObserver(CFRunLoopGetMain(), enableNotifiersObserver, kCFRunLoopCommonModes);
- }
-}
-
-void QCFSocketNotifier::unregisterSocketNotifier(QSocketNotifier *notifier)
-{
- Q_ASSERT(notifier);
- int nativeSocket = notifier->socket();
- int type = notifier->type();
-#ifndef QT_NO_DEBUG
- if (nativeSocket < 0 || nativeSocket > FD_SETSIZE) {
- qWarning("QSocketNotifier: Internal error");
- return;
- } else if (notifier->thread() != eventDispatcher->thread() || eventDispatcher->thread() != QThread::currentThread()) {
- qWarning("QSocketNotifier: socket notifiers cannot be disabled from another thread");
- return;
- }
-#endif
-
- if (type == QSocketNotifier::Exception) {
- qWarning("QSocketNotifier::Exception is not supported on iOS");
- return;
- }
- MacSocketInfo *socketInfo = macSockets.value(nativeSocket);
- if (!socketInfo) {
- qWarning("QEventDispatcherMac::unregisterSocketNotifier: Tried to unregister a not registered notifier");
- return;
- }
-
- // Decrement read/write counters and disable callbacks if necessary.
- if (type == QSocketNotifier::Read) {
- Q_ASSERT(notifier == socketInfo->readNotifier);
- socketInfo->readNotifier = 0;
- socketInfo->readEnabled = false;
- CFSocketDisableCallBacks(socketInfo->socket, kCFSocketReadCallBack);
- } else if (type == QSocketNotifier::Write) {
- Q_ASSERT(notifier == socketInfo->writeNotifier);
- socketInfo->writeNotifier = 0;
- socketInfo->writeEnabled = false;
- CFSocketDisableCallBacks(socketInfo->socket, kCFSocketWriteCallBack);
- }
-
- // Remove CFSocket from runloop if this was the last QSocketNotifier.
- if (socketInfo->readNotifier == 0 && socketInfo->writeNotifier == 0) {
- unregisterSocketInfo(socketInfo);
- delete socketInfo;
- macSockets.remove(nativeSocket);
- }
-}
-
-void QCFSocketNotifier::removeSocketNotifiers()
-{
- // Remove CFSockets from the runloop.
- foreach (MacSocketInfo *socketInfo, macSockets) {
- unregisterSocketInfo(socketInfo);
- delete socketInfo;
- }
-
- macSockets.clear();
-
- destroyRunLoopObserver();
-}
-
-void QCFSocketNotifier::destroyRunLoopObserver()
-{
- if (!enableNotifiersObserver)
- return;
-
- CFRunLoopObserverInvalidate(enableNotifiersObserver);
- CFRelease(enableNotifiersObserver);
- enableNotifiersObserver = 0;
-}
-
-void QCFSocketNotifier::unregisterSocketInfo(MacSocketInfo *socketInfo)
-{
- if (socketInfo->runloop) {
- if (CFSocketIsValid(socketInfo->socket))
- qt_mac_remove_socket_from_runloop(socketInfo->socket, socketInfo->runloop);
- CFRunLoopSourceInvalidate(socketInfo->runloop);
- CFRelease(socketInfo->runloop);
- }
- CFSocketInvalidate(socketInfo->socket);
- CFRelease(socketInfo->socket);
-}
-
-void QCFSocketNotifier::enableSocketNotifiers(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info)
-{
- Q_UNUSED(ref);
- Q_UNUSED(activity);
-
- QCFSocketNotifier *that = static_cast<QCFSocketNotifier *>(info);
-
- foreach (MacSocketInfo *socketInfo, that->macSockets) {
- if (!CFSocketIsValid(socketInfo->socket))
- continue;
-
- if (!socketInfo->runloop) {
- // Add CFSocket to runloop.
- if (!(socketInfo->runloop = qt_mac_add_socket_to_runloop(socketInfo->socket))) {
- qWarning("QEventDispatcherMac::registerSocketNotifier: Failed to add CFSocket to runloop");
- CFSocketInvalidate(socketInfo->socket);
- continue;
- }
-
- if (!socketInfo->readNotifier)
- CFSocketDisableCallBacks(socketInfo->socket, kCFSocketReadCallBack);
- if (!socketInfo->writeNotifier)
- CFSocketDisableCallBacks(socketInfo->socket, kCFSocketWriteCallBack);
- }
-
- if (socketInfo->readNotifier && !socketInfo->readEnabled) {
- socketInfo->readEnabled = true;
- CFSocketEnableCallBacks(socketInfo->socket, kCFSocketReadCallBack);
- }
- if (socketInfo->writeNotifier && !socketInfo->writeEnabled) {
- socketInfo->writeEnabled = true;
- CFSocketEnableCallBacks(socketInfo->socket, kCFSocketWriteCallBack);
- }
- }
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h b/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
deleted file mode 100644
index 9bccc1bf98..0000000000
--- a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtGui module 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 QCFSOCKETNOTIFIER_P_H
-#define QCFSOCKETNOTIFIER_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/qabstracteventdispatcher.h>
-#include <QtCore/qhash.h>
-
-#include <CoreFoundation/CoreFoundation.h>
-
-QT_BEGIN_NAMESPACE
-
-struct MacSocketInfo {
- MacSocketInfo() : socket(0), runloop(0), readNotifier(0), writeNotifier(0),
- readEnabled(false), writeEnabled(false) {}
- CFSocketRef socket;
- CFRunLoopSourceRef runloop;
- QObject *readNotifier;
- QObject *writeNotifier;
- bool readEnabled;
- bool writeEnabled;
-};
-typedef QHash<int, MacSocketInfo *> MacSocketHash;
-
-typedef void (*MaybeCancelWaitForMoreEventsFn)(QAbstractEventDispatcher *hostEventDispacher);
-
-// The CoreFoundationSocketNotifier class implements socket notifiers support using
-// CFSocket for event dispatchers running on top of the Core Foundation run loop system.
-// (currently Mac and iOS)
-//
-// The principal functions are registerSocketNotifier() and unregisterSocketNotifier().
-//
-// setHostEventDispatcher() should be called at startup.
-// removeSocketNotifiers() should be called at shutdown.
-//
-class QCFSocketNotifier
-{
-public:
- QCFSocketNotifier();
- ~QCFSocketNotifier();
- void setHostEventDispatcher(QAbstractEventDispatcher *hostEventDispacher);
- void setMaybeCancelWaitForMoreEventsCallback(MaybeCancelWaitForMoreEventsFn callBack);
- void registerSocketNotifier(QSocketNotifier *notifier);
- void unregisterSocketNotifier(QSocketNotifier *notifier);
- void removeSocketNotifiers();
-
-private:
- void destroyRunLoopObserver();
-
- static void unregisterSocketInfo(MacSocketInfo *socketInfo);
- static void enableSocketNotifiers(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info);
-
- MacSocketHash macSockets;
- QAbstractEventDispatcher *eventDispatcher;
- MaybeCancelWaitForMoreEventsFn maybeCancelWaitForMoreEvents;
- CFRunLoopObserverRef enableNotifiersObserver;
-
- friend void qt_mac_socket_callback(CFSocketRef, CFSocketCallBackType, CFDataRef, const void *, void *);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/platformsupport/clipboard/clipboard.pri b/src/platformsupport/clipboard/clipboard.pri
index 2532430f1e..cb8315d003 100644
--- a/src/platformsupport/clipboard/clipboard.pri
+++ b/src/platformsupport/clipboard/clipboard.pri
@@ -1,5 +1,7 @@
mac {
HEADERS += $$PWD/qmacmime_p.h
OBJECTIVE_SOURCES += $$PWD/qmacmime.mm
+
+ osx: LIBS_PRIVATE += -framework AppKit
}
diff --git a/src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h b/src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h
index 85b5bd8d49..41ab761f12 100644
--- a/src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h
+++ b/src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h
@@ -45,6 +45,17 @@
#ifndef DBUSMENUADAPTOR_H
#define DBUSMENUADAPTOR_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/QObject>
#include <QtDBus/QtDBus>
#include "qdbusmenutypes_p.h"
diff --git a/src/platformsupport/dbusmenu/qdbusmenutypes.cpp b/src/platformsupport/dbusmenu/qdbusmenutypes.cpp
index 73957eacfe..8d5d96353c 100644
--- a/src/platformsupport/dbusmenu/qdbusmenutypes.cpp
+++ b/src/platformsupport/dbusmenu/qdbusmenutypes.cpp
@@ -208,6 +208,7 @@ QDBusMenuItemList QDBusMenuItem::items(const QList<int> &ids, const QStringList
Q_UNUSED(propertyNames)
QDBusMenuItemList ret;
QList<const QDBusPlatformMenuItem *> items = QDBusPlatformMenuItem::byIds(ids);
+ ret.reserve(items.size());
Q_FOREACH (const QDBusPlatformMenuItem *item, items)
ret << QDBusMenuItem(item);
return ret;
@@ -246,7 +247,7 @@ QDebug operator<<(QDebug d, const QDBusMenuItem &item)
{
QDebugStateSaver saver(d);
d.nospace();
- d << "QDBusMenuItem(id=" << item.m_id << ", properties=" << item.m_properties << ")";
+ d << "QDBusMenuItem(id=" << item.m_id << ", properties=" << item.m_properties << ')';
return d;
}
diff --git a/src/platformsupport/dbusmenu/qdbusmenutypes_p.h b/src/platformsupport/dbusmenu/qdbusmenutypes_p.h
index 28d16b32d5..bc9f064f88 100644
--- a/src/platformsupport/dbusmenu/qdbusmenutypes_p.h
+++ b/src/platformsupport/dbusmenu/qdbusmenutypes_p.h
@@ -34,6 +34,17 @@
#ifndef QDBUSMENUTYPES_H
#define QDBUSMENUTYPES_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
#include <QDBusArgument>
@@ -46,7 +57,7 @@ QT_BEGIN_NAMESPACE
class QDBusPlatformMenu;
class QDBusPlatformMenuItem;
class QDBusMenuItem;
-typedef QList<QDBusMenuItem> QDBusMenuItemList;
+typedef QVector<QDBusMenuItem> QDBusMenuItemList;
class QDBusMenuItem
{
@@ -61,6 +72,7 @@ public:
int m_id;
QVariantMap m_properties;
};
+Q_DECLARE_TYPEINFO(QDBusMenuItem, Q_MOVABLE_TYPE);
const QDBusArgument &operator<<(QDBusArgument &arg, const QDBusMenuItem &item);
const QDBusArgument &operator>>(const QDBusArgument &arg, QDBusMenuItem &item);
@@ -72,11 +84,12 @@ public:
int id;
QStringList properties;
};
+Q_DECLARE_TYPEINFO(QDBusMenuItemKeys, Q_MOVABLE_TYPE);
const QDBusArgument &operator<<(QDBusArgument &arg, const QDBusMenuItemKeys &keys);
const QDBusArgument &operator>>(const QDBusArgument &arg, QDBusMenuItemKeys &keys);
-typedef QList<QDBusMenuItemKeys> QDBusMenuItemKeysList;
+typedef QVector<QDBusMenuItemKeys> QDBusMenuItemKeysList;
class QDBusMenuLayoutItem
{
@@ -87,13 +100,14 @@ public:
int m_id;
QVariantMap m_properties;
- QList<QDBusMenuLayoutItem> m_children;
+ QVector<QDBusMenuLayoutItem> m_children;
};
+Q_DECLARE_TYPEINFO(QDBusMenuLayoutItem, Q_MOVABLE_TYPE);
const QDBusArgument &operator<<(QDBusArgument &arg, const QDBusMenuLayoutItem &);
const QDBusArgument &operator>>(const QDBusArgument &arg, QDBusMenuLayoutItem &item);
-typedef QList<QDBusMenuLayoutItem> QDBusMenuLayoutItemList;
+typedef QVector<QDBusMenuLayoutItem> QDBusMenuLayoutItemList;
class QDBusMenuEvent
{
@@ -103,11 +117,13 @@ public:
QDBusVariant m_data;
uint m_timestamp;
};
+Q_DECLARE_TYPEINFO(QDBusMenuEvent, Q_MOVABLE_TYPE); // QDBusVariant is movable, even though it cannot
+ // be marked as such until Qt 6.
const QDBusArgument &operator<<(QDBusArgument &arg, const QDBusMenuEvent &ev);
const QDBusArgument &operator>>(const QDBusArgument &arg, QDBusMenuEvent &ev);
-typedef QList<QDBusMenuEvent> QDBusMenuEventList;
+typedef QVector<QDBusMenuEvent> QDBusMenuEventList;
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QDBusMenuItem &item);
diff --git a/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h b/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h
index fdad7990e9..6d2d27463f 100644
--- a/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h
+++ b/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h
@@ -33,6 +33,17 @@
#ifndef QDBUSPLATFORMMENU_H
#define QDBUSPLATFORMMENU_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.
+//
//
// W A R N I N G
// -------------
diff --git a/src/platformsupport/dbustray/qdbustraytypes.cpp b/src/platformsupport/dbustray/qdbustraytypes.cpp
index 7b7d31b7c3..83b5d5da3f 100644
--- a/src/platformsupport/dbustray/qdbustraytypes.cpp
+++ b/src/platformsupport/dbustray/qdbustraytypes.cpp
@@ -82,6 +82,8 @@ QXdgDBusImageVector iconToQXdgDBusImageVector(const QIcon &icon)
sizes.append(QSize(IconNormalSmallSize * dpr, IconNormalSmallSize * dpr));
if (!hasMediumIcon)
sizes.append(QSize(IconNormalMediumSize * dpr, IconNormalMediumSize * dpr));
+
+ ret.reserve(sizes.size());
foreach (QSize size, sizes) {
// Protocol specifies ARGB32 format in network byte order
QImage im = icon.pixmap(size).toImage().convertToFormat(QImage::Format_ARGB32);
diff --git a/src/platformsupport/dbustray/qdbustraytypes_p.h b/src/platformsupport/dbustray/qdbustraytypes_p.h
index 4e7ae70a96..d8e52b932d 100644
--- a/src/platformsupport/dbustray/qdbustraytypes_p.h
+++ b/src/platformsupport/dbustray/qdbustraytypes_p.h
@@ -35,6 +35,17 @@
#ifndef QDBUSTRAYTYPES_P_H
#define QDBUSTRAYTYPES_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef QT_NO_SYSTEMTRAYICON
#include <QObject>
@@ -56,6 +67,7 @@ struct QXdgDBusImageStruct
int height;
QByteArray data;
};
+Q_DECLARE_TYPEINFO(QXdgDBusImageStruct, Q_MOVABLE_TYPE);
typedef QVector<QXdgDBusImageStruct> QXdgDBusImageVector;
@@ -69,6 +81,7 @@ struct QXdgDBusToolTipStruct
QString title;
QString subTitle;
};
+Q_DECLARE_TYPEINFO(QXdgDBusToolTipStruct, Q_MOVABLE_TYPE);
const QDBusArgument &operator<<(QDBusArgument &argument, const QXdgDBusImageStruct &icon);
const QDBusArgument &operator>>(const QDBusArgument &argument, QXdgDBusImageStruct &icon);
diff --git a/src/platformsupport/dbustray/qstatusnotifieritemadaptor_p.h b/src/platformsupport/dbustray/qstatusnotifieritemadaptor_p.h
index 56fbb75d7a..c3849f0e03 100644
--- a/src/platformsupport/dbustray/qstatusnotifieritemadaptor_p.h
+++ b/src/platformsupport/dbustray/qstatusnotifieritemadaptor_p.h
@@ -45,6 +45,17 @@
#ifndef QSTATUSNOTIFIERITEMADAPTER_P_H
#define QSTATUSNOTIFIERITEMADAPTER_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.
+//
+
#ifndef QT_NO_SYSTEMTRAYICON
#include <QtCore/QObject>
diff --git a/src/platformsupport/dbustray/qxdgnotificationproxy_p.h b/src/platformsupport/dbustray/qxdgnotificationproxy_p.h
index 3e573cb118..5c74405ae8 100644
--- a/src/platformsupport/dbustray/qxdgnotificationproxy_p.h
+++ b/src/platformsupport/dbustray/qxdgnotificationproxy_p.h
@@ -45,6 +45,17 @@
#ifndef QXDGNOTIFICATIONPROXY_P_H
#define QXDGNOTIFICATIONPROXY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
index 1bc834b5ef..3aab785b34 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
@@ -90,7 +90,7 @@ QStringList QDeviceDiscoveryStatic::scanConnectedDevices()
if (m_types & Device_InputMask) {
dir.setPath(QString::fromLatin1(QT_EVDEV_DEVICE_PATH));
foreach (const QString &deviceFile, dir.entryList()) {
- QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
+ QString absoluteFilePath = dir.absolutePath() + QLatin1Char('/') + deviceFile;
if (checkDeviceType(absoluteFilePath))
devices << absoluteFilePath;
}
@@ -100,7 +100,7 @@ QStringList QDeviceDiscoveryStatic::scanConnectedDevices()
if (m_types & Device_VideoMask) {
dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH));
foreach (const QString &deviceFile, dir.entryList()) {
- QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
+ QString absoluteFilePath = dir.absolutePath() + QLatin1Char('/') + deviceFile;
if (checkDeviceType(absoluteFilePath))
devices << absoluteFilePath;
}
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
index 8fa82e2ad7..f285e61a9f 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
@@ -210,7 +210,7 @@ bool QDeviceDiscoveryUDev::checkDeviceType(udev_device *dev)
if ((m_types & Device_Keyboard) && (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 )) {
const char *capabilities_key = udev_device_get_sysattr_value(dev, "capabilities/key");
- QStringList val = QString::fromUtf8(capabilities_key).split(QString::fromUtf8(" "), QString::SkipEmptyParts);
+ QStringList val = QString::fromUtf8(capabilities_key).split(QLatin1Char(' '), QString::SkipEmptyParts);
if (!val.isEmpty()) {
bool ok;
unsigned long long keys = val.last().toULongLong(&ok, 16);
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index d102203d5e..f1e0d58a6d 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -1,29 +1,18 @@
contains(QT_CONFIG,egl) {
HEADERS += \
$$PWD/qeglconvenience_p.h \
- $$PWD/qeglpbuffer_p.h
+ $$PWD/qeglstreamconvenience_p.h
SOURCES += \
$$PWD/qeglconvenience.cpp \
- $$PWD/qeglpbuffer.cpp
+ $$PWD/qeglstreamconvenience.cpp
contains(QT_CONFIG,opengl) {
- HEADERS += $$PWD/qeglplatformcontext_p.h
- SOURCES += $$PWD/qeglplatformcontext.cpp
+ HEADERS += $$PWD/qeglplatformcontext_p.h \
+ $$PWD/qeglpbuffer_p.h
- unix {
- HEADERS += \
- $$PWD/qeglplatformcursor_p.h \
- $$PWD/qeglplatformwindow_p.h \
- $$PWD/qeglplatformscreen_p.h \
- $$PWD/qeglplatformintegration_p.h
-
- SOURCES += \
- $$PWD/qeglplatformcursor.cpp \
- $$PWD/qeglplatformwindow.cpp \
- $$PWD/qeglplatformscreen.cpp \
- $$PWD/qeglplatformintegration.cpp
- }
+ SOURCES += $$PWD/qeglplatformcontext.cpp \
+ $$PWD/qeglpbuffer.cpp
}
# Avoid X11 header collision
@@ -34,6 +23,7 @@ contains(QT_CONFIG,egl) {
$$PWD/qxlibeglintegration_p.h
SOURCES += \
$$PWD/qxlibeglintegration.cpp
+ LIBS_PRIVATE += $$QMAKE_LIBS_X11
}
CONFIG += egl
}
diff --git a/src/platformsupport/eglconvenience/qeglconvenience_p.h b/src/platformsupport/eglconvenience/qeglconvenience_p.h
index 59441d8c9a..ec6f668cba 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglconvenience_p.h
@@ -88,7 +88,6 @@ public:
protected:
virtual bool filterConfig(EGLConfig config) const;
-private:
QSurfaceFormat m_format;
EGLDisplay m_display;
EGLint m_surfaceType;
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer.cpp b/src/platformsupport/eglconvenience/qeglpbuffer.cpp
index 756609a641..d1a31642b2 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer.cpp
+++ b/src/platformsupport/eglconvenience/qeglpbuffer.cpp
@@ -49,13 +49,15 @@ QT_BEGIN_NAMESPACE
and return a new instance of this class.
*/
-QEGLPbuffer::QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface)
+QEGLPbuffer::QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface,
+ QEGLPlatformContext::Flags flags)
: QPlatformOffscreenSurface(offscreenSurface)
, m_format(format)
, m_display(display)
, m_pbuffer(EGL_NO_SURFACE)
{
- bool hasSurfaceless = q_hasEglExtension(display, "EGL_KHR_surfaceless_context");
+ bool hasSurfaceless = !flags.testFlag(QEGLPlatformContext::NoSurfaceless)
+ && q_hasEglExtension(display, "EGL_KHR_surfaceless_context");
// Disable surfaceless contexts on Mesa for now. As of 10.6.0 and Intel at least, some
// operations (glReadPixels) are unable to work without a surface since they at some
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 3372c0735d..81fdab8901 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -47,13 +47,15 @@
#include <EGL/egl.h>
#include <qpa/qplatformoffscreensurface.h>
+#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
QT_BEGIN_NAMESPACE
class QEGLPbuffer : public QPlatformOffscreenSurface
{
public:
- QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface);
+ QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface,
+ QEGLPlatformContext::Flags flags = 0);
~QEGLPbuffer();
QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; }
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index bffb0eb4e8..acd6197ed5 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -106,11 +106,12 @@ QT_BEGIN_NAMESPACE
#endif
QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
- EGLConfig *config, const QVariant &nativeHandle)
+ EGLConfig *config, const QVariant &nativeHandle, Flags flags)
: m_eglDisplay(display)
, m_swapInterval(-1)
, m_swapIntervalEnvChecked(false)
, m_swapIntervalFromEnv(-1)
+ , m_flags(flags)
{
if (nativeHandle.isNull()) {
m_eglConfig = config ? *config : q_configFromGLFormat(display, format);
@@ -158,6 +159,7 @@ void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLCont
}
}
contextAttrs.append(EGL_NONE);
+ m_contextAttrs = contextAttrs;
switch (m_format.renderableType()) {
case QSurfaceFormat::OpenVG:
@@ -248,6 +250,8 @@ void QEGLPlatformContext::initialize()
updateFormatFromGL();
}
+// Base implementation for pbuffers. Subclasses will handle the specialized cases for
+// platforms without pbuffers.
EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface()
{
// Make the context current to ensure the GL version query works. This needs a surface too.
@@ -287,10 +291,18 @@ void QEGLPlatformContext::updateFormatFromGL()
// avoid creating an extra pbuffer surface which is apparently troublesome with some
// drivers (Mesa) when certain attributes are present (multisampling).
EGLSurface tempSurface = EGL_NO_SURFACE;
- if (!q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context"))
+ EGLContext tempContext = EGL_NO_CONTEXT;
+ if (m_flags.testFlag(NoSurfaceless) || !q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context"))
tempSurface = createTemporaryOffscreenSurface();
- if (eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, m_eglContext)) {
+ EGLBoolean ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, m_eglContext);
+ if (!ok) {
+ EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT);
+ tempContext = eglCreateContext(m_eglDisplay, config, 0, m_contextAttrs.constData());
+ if (tempContext != EGL_NO_CONTEXT)
+ ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, tempContext);
+ }
+ if (ok) {
if (m_format.renderableType() == QSurfaceFormat::OpenGL
|| m_format.renderableType() == QSurfaceFormat::OpenGLES) {
const GLubyte *s = glGetString(GL_VERSION);
@@ -336,10 +348,12 @@ void QEGLPlatformContext::updateFormatFromGL()
}
eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext);
} else {
- qWarning("QEGLPlatformContext: Failed to make temporary surface current, format not updated");
+ qWarning("QEGLPlatformContext: Failed to make temporary surface current, format not updated (%x)", eglGetError());
}
if (tempSurface != EGL_NO_SURFACE)
destroyTemporaryOffscreenSurface(tempSurface);
+ if (tempContext != EGL_NO_CONTEXT)
+ eglDestroyContext(m_eglDisplay, tempContext);
#endif // QT_NO_OPENGL
}
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index 50c264e1dc..2fa465556b 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -56,8 +56,14 @@ QT_BEGIN_NAMESPACE
class QEGLPlatformContext : public QPlatformOpenGLContext
{
public:
+ enum Flag {
+ NoSurfaceless = 0x01
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
- EGLConfig *config = 0, const QVariant &nativeHandle = QVariant());
+ EGLConfig *config = 0, const QVariant &nativeHandle = QVariant(),
+ Flags flags = 0);
~QEGLPlatformContext();
void initialize() Q_DECL_OVERRIDE;
@@ -93,9 +99,13 @@ private:
int m_swapInterval;
bool m_swapIntervalEnvChecked;
int m_swapIntervalFromEnv;
+ Flags m_flags;
bool m_ownsContext;
+ QVector<EGLint> m_contextAttrs;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QEGLPlatformContext::Flags)
+
QT_END_NAMESPACE
#endif //QEGLPLATFORMCONTEXT_H
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
deleted file mode 100644
index 09243487c7..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 <qpa/qwindowsysteminterface.h>
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLShaderProgram>
-#include <QtCore/QJsonDocument>
-#include <QtCore/QJsonArray>
-#include <QtCore/QJsonObject>
-#include <QtDebug>
-
-#include <QtGui/private/qguiapplication_p.h>
-
-#include "qeglplatformcursor_p.h"
-#include "qeglplatformintegration_p.h"
-#include "qeglplatformscreen_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QEGLPlatformCursor
- \brief Mouse cursor implementation using OpenGL.
- \since 5.2
- \internal
- \ingroup qpa
- */
-
-QEGLPlatformCursor::QEGLPlatformCursor(QPlatformScreen *screen)
- : m_visible(true),
- m_screen(static_cast<QEGLPlatformScreen *>(screen)),
- m_program(0),
- m_vertexCoordEntry(0),
- m_textureCoordEntry(0),
- m_textureEntry(0),
- m_deviceListener(0),
- m_updateRequested(false)
-{
- QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR");
- if (!hideCursorVal.isEmpty())
- m_visible = hideCursorVal.toInt() == 0;
- if (!m_visible)
- return;
-
- // Try to load the cursor atlas. If this fails, m_visible is set to false and
- // paintOnScreen() and setCurrentCursor() become no-ops.
- initCursorAtlas();
-
- // initialize the cursor
-#ifndef QT_NO_CURSOR
- QCursor cursor(Qt::ArrowCursor);
- setCurrentCursor(&cursor);
-#endif
-
- m_deviceListener = new QEGLPlatformCursorDeviceListener(this);
- connect(QGuiApplicationPrivate::inputDeviceManager(), &QInputDeviceManager::deviceListChanged,
- m_deviceListener, &QEGLPlatformCursorDeviceListener::onDeviceListChanged);
- updateMouseStatus();
-}
-
-QEGLPlatformCursor::~QEGLPlatformCursor()
-{
- resetResources();
- delete m_deviceListener;
-}
-
-void QEGLPlatformCursor::updateMouseStatus()
-{
- m_visible = m_deviceListener->hasMouse();
-}
-
-bool QEGLPlatformCursorDeviceListener::hasMouse() const
-{
- return QGuiApplicationPrivate::inputDeviceManager()->deviceCount(QInputDeviceManager::DeviceTypePointer) > 0;
-}
-
-void QEGLPlatformCursorDeviceListener::onDeviceListChanged(QInputDeviceManager::DeviceType type)
-{
- if (type == QInputDeviceManager::DeviceTypePointer)
- m_cursor->updateMouseStatus();
-}
-
-void QEGLPlatformCursor::resetResources()
-{
- if (QOpenGLContext::currentContext()) {
- delete m_program;
- glDeleteTextures(1, &m_cursor.customCursorTexture);
- glDeleteTextures(1, &m_cursorAtlas.texture);
- }
- m_program = 0;
- m_cursor.customCursorTexture = 0;
- m_cursor.customCursorPending = !m_cursor.customCursorImage.isNull();
- m_cursorAtlas.texture = 0;
-}
-
-void QEGLPlatformCursor::createShaderPrograms()
-{
- static const char *textureVertexProgram =
- "attribute highp vec2 vertexCoordEntry;\n"
- "attribute highp vec2 textureCoordEntry;\n"
- "varying highp vec2 textureCoord;\n"
- "void main() {\n"
- " textureCoord = textureCoordEntry;\n"
- " gl_Position = vec4(vertexCoordEntry, 1.0, 1.0);\n"
- "}\n";
-
- static const char *textureFragmentProgram =
- "uniform sampler2D texture;\n"
- "varying highp vec2 textureCoord;\n"
- "void main() {\n"
- " gl_FragColor = texture2D(texture, textureCoord).bgra;\n"
- "}\n";
-
- m_program = new QOpenGLShaderProgram;
- m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
- m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
- m_program->link();
-
- m_vertexCoordEntry = m_program->attributeLocation("vertexCoordEntry");
- m_textureCoordEntry = m_program->attributeLocation("textureCoordEntry");
- m_textureEntry = m_program->uniformLocation("texture");
-}
-
-void QEGLPlatformCursor::createCursorTexture(uint *texture, const QImage &image)
-{
- if (!*texture)
- glGenTextures(1, texture);
- glBindTexture(GL_TEXTURE_2D, *texture);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- glTexImage2D(GL_TEXTURE_2D, 0 /* level */, GL_RGBA, image.width(), image.height(), 0 /* border */,
- GL_RGBA, GL_UNSIGNED_BYTE, image.constBits());
-}
-
-void QEGLPlatformCursor::initCursorAtlas()
-{
- static QByteArray json = qgetenv("QT_QPA_EGLFS_CURSOR");
- if (json.isEmpty())
- json = ":/cursor.json";
-
- QFile file(QString::fromUtf8(json));
- if (!file.open(QFile::ReadOnly)) {
- m_visible = false;
- return;
- }
-
- QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
- QJsonObject object = doc.object();
-
- QString atlas = object.value(QLatin1String("image")).toString();
- Q_ASSERT(!atlas.isEmpty());
-
- const int cursorsPerRow = object.value(QLatin1String("cursorsPerRow")).toDouble();
- Q_ASSERT(cursorsPerRow);
- m_cursorAtlas.cursorsPerRow = cursorsPerRow;
-
- const QJsonArray hotSpots = object.value(QLatin1String("hotSpots")).toArray();
- Q_ASSERT(hotSpots.count() == Qt::LastCursor + 1);
- for (int i = 0; i < hotSpots.count(); i++) {
- QPoint hotSpot(hotSpots[i].toArray()[0].toDouble(), hotSpots[i].toArray()[1].toDouble());
- m_cursorAtlas.hotSpots << hotSpot;
- }
-
- QImage image = QImage(atlas).convertToFormat(QImage::Format_ARGB32_Premultiplied);
- m_cursorAtlas.cursorWidth = image.width() / m_cursorAtlas.cursorsPerRow;
- m_cursorAtlas.cursorHeight = image.height() / ((Qt::LastCursor + cursorsPerRow) / cursorsPerRow);
- m_cursorAtlas.width = image.width();
- m_cursorAtlas.height = image.height();
- m_cursorAtlas.image = image;
-}
-
-#ifndef QT_NO_CURSOR
-void QEGLPlatformCursor::changeCursor(QCursor *cursor, QWindow *window)
-{
- Q_UNUSED(window);
- const QRect oldCursorRect = cursorRect();
- if (setCurrentCursor(cursor))
- update(oldCursorRect | cursorRect());
-}
-
-bool QEGLPlatformCursor::setCurrentCursor(QCursor *cursor)
-{
- if (!m_visible)
- return false;
-
- const Qt::CursorShape newShape = cursor ? cursor->shape() : Qt::ArrowCursor;
- if (m_cursor.shape == newShape && newShape != Qt::BitmapCursor)
- return false;
-
- if (m_cursor.shape == Qt::BitmapCursor) {
- m_cursor.customCursorImage = QImage();
- m_cursor.customCursorPending = false;
- }
- m_cursor.shape = newShape;
- if (newShape != Qt::BitmapCursor) { // standard cursor
- const float ws = (float)m_cursorAtlas.cursorWidth / m_cursorAtlas.width,
- hs = (float)m_cursorAtlas.cursorHeight / m_cursorAtlas.height;
- m_cursor.textureRect = QRectF(ws * (m_cursor.shape % m_cursorAtlas.cursorsPerRow),
- hs * (m_cursor.shape / m_cursorAtlas.cursorsPerRow),
- ws, hs);
- m_cursor.hotSpot = m_cursorAtlas.hotSpots[m_cursor.shape];
- m_cursor.texture = m_cursorAtlas.texture;
- m_cursor.size = QSize(m_cursorAtlas.cursorWidth, m_cursorAtlas.cursorHeight);
- } else {
- QImage image = cursor->pixmap().toImage();
- m_cursor.textureRect = QRectF(0, 0, 1, 1);
- m_cursor.hotSpot = cursor->hotSpot();
- m_cursor.texture = 0; // will get updated in the next render()
- m_cursor.size = image.size();
- m_cursor.customCursorImage = image;
- m_cursor.customCursorPending = true;
- }
-
- return true;
-}
-#endif
-
-class CursorUpdateEvent : public QEvent
-{
-public:
- CursorUpdateEvent(const QPoint &pos, const QRegion &rgn)
- : QEvent(QEvent::Type(QEvent::User + 1)),
- m_pos(pos),
- m_region(rgn)
- { }
- QPoint pos() const { return m_pos; }
- QRegion region() const { return m_region; }
-
-private:
- QPoint m_pos;
- QRegion m_region;
-};
-
-bool QEGLPlatformCursor::event(QEvent *e)
-{
- if (e->type() == QEvent::User + 1) {
- CursorUpdateEvent *ev = static_cast<CursorUpdateEvent *>(e);
- m_updateRequested = false;
- QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(ev->pos()), ev->region());
- QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
- return true;
- }
- return QPlatformCursor::event(e);
-}
-
-void QEGLPlatformCursor::update(const QRegion &rgn)
-{
- if (!m_updateRequested) {
- // Must not flush the window system events directly from here since we are likely to
- // be a called directly from QGuiApplication's processMouseEvents. Flushing events
- // could cause reentering by dispatching more queued mouse events.
- m_updateRequested = true;
- QCoreApplication::postEvent(this, new CursorUpdateEvent(m_cursor.pos, rgn));
- }
-}
-
-QRect QEGLPlatformCursor::cursorRect() const
-{
- return QRect(m_cursor.pos - m_cursor.hotSpot, m_cursor.size);
-}
-
-QPoint QEGLPlatformCursor::pos() const
-{
- return m_cursor.pos;
-}
-
-void QEGLPlatformCursor::setPos(const QPoint &pos)
-{
- QGuiApplicationPrivate::inputDeviceManager()->setCursorPos(pos);
- const QRect oldCursorRect = cursorRect();
- m_cursor.pos = pos;
- update(oldCursorRect | cursorRect());
- m_screen->handleCursorMove(m_cursor.pos);
-}
-
-void QEGLPlatformCursor::pointerEvent(const QMouseEvent &event)
-{
- if (event.type() != QEvent::MouseMove)
- return;
- const QRect oldCursorRect = cursorRect();
- m_cursor.pos = event.screenPos().toPoint();
- update(oldCursorRect | cursorRect());
- m_screen->handleCursorMove(m_cursor.pos);
-}
-
-void QEGLPlatformCursor::paintOnScreen()
-{
- if (!m_visible)
- return;
-
- const QRectF cr = cursorRect();
- const QRect screenRect(m_screen->geometry());
- const GLfloat x1 = 2 * (cr.left() / screenRect.width()) - 1;
- const GLfloat x2 = 2 * (cr.right() / screenRect.width()) - 1;
- const GLfloat y1 = 1 - (cr.top() / screenRect.height()) * 2;
- const GLfloat y2 = 1 - (cr.bottom() / screenRect.height()) * 2;
- QRectF r(QPointF(x1, y1), QPointF(x2, y2));
-
- draw(r);
-}
-
-void QEGLPlatformCursor::draw(const QRectF &r)
-{
- if (!m_program) {
- // one time initialization
- initializeOpenGLFunctions();
-
- createShaderPrograms();
-
- if (!m_cursorAtlas.texture) {
- createCursorTexture(&m_cursorAtlas.texture, m_cursorAtlas.image);
-
- if (m_cursor.shape != Qt::BitmapCursor)
- m_cursor.texture = m_cursorAtlas.texture;
- }
- }
-
- if (m_cursor.shape == Qt::BitmapCursor && m_cursor.customCursorPending) {
- // upload the custom cursor
- createCursorTexture(&m_cursor.customCursorTexture, m_cursor.customCursorImage);
- m_cursor.texture = m_cursor.customCursorTexture;
- m_cursor.customCursorPending = false;
- }
-
- Q_ASSERT(m_cursor.texture);
-
- m_program->bind();
-
- const GLfloat x1 = r.left();
- const GLfloat x2 = r.right();
- const GLfloat y1 = r.top();
- const GLfloat y2 = r.bottom();
- const GLfloat cursorCoordinates[] = {
- x1, y2,
- x2, y2,
- x1, y1,
- x2, y1
- };
-
- const GLfloat s1 = m_cursor.textureRect.left();
- const GLfloat s2 = m_cursor.textureRect.right();
- const GLfloat t1 = m_cursor.textureRect.top();
- const GLfloat t2 = m_cursor.textureRect.bottom();
- const GLfloat textureCoordinates[] = {
- s1, t2,
- s2, t2,
- s1, t1,
- s2, t1
- };
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, m_cursor.texture);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
-
- m_program->enableAttributeArray(m_vertexCoordEntry);
- m_program->enableAttributeArray(m_textureCoordEntry);
-
- m_program->setAttributeArray(m_vertexCoordEntry, cursorCoordinates, 2);
- m_program->setAttributeArray(m_textureCoordEntry, textureCoordinates, 2);
-
- m_program->setUniformValue(m_textureEntry, 0);
-
- glDisable(GL_CULL_FACE);
- glFrontFace(GL_CCW);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- glDisable(GL_DEPTH_TEST); // disable depth testing to make sure cursor is always on top
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- glDisable(GL_BLEND);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- m_program->disableAttributeArray(m_textureCoordEntry);
- m_program->disableAttributeArray(m_vertexCoordEntry);
-
- m_program->release();
-}
-
-QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
deleted file mode 100644
index b89dd1ca43..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QEGLPLATFORMCURSOR_H
-#define QEGLPLATFORMCURSOR_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/qplatformcursor.h>
-#include <qpa/qplatformscreen.h>
-#include <QtGui/QOpenGLFunctions>
-#include <QtGui/private/qinputdevicemanager_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLShaderProgram;
-class QEGLPlatformCursor;
-class QEGLPlatformScreen;
-
-class QEGLPlatformCursorDeviceListener : public QObject
-{
- Q_OBJECT
-
-public:
- QEGLPlatformCursorDeviceListener(QEGLPlatformCursor *cursor) : m_cursor(cursor) { }
- bool hasMouse() const;
-
-public slots:
- void onDeviceListChanged(QInputDeviceManager::DeviceType type);
-
-private:
- QEGLPlatformCursor *m_cursor;
-};
-
-class QEGLPlatformCursor : public QPlatformCursor, protected QOpenGLFunctions
-{
- Q_OBJECT
-public:
- QEGLPlatformCursor(QPlatformScreen *screen);
- ~QEGLPlatformCursor();
-
-#ifndef QT_NO_CURSOR
- void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE;
-#endif
- void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE;
- QPoint pos() const Q_DECL_OVERRIDE;
- void setPos(const QPoint &pos) Q_DECL_OVERRIDE;
-
- QRect cursorRect() const;
- void paintOnScreen();
- void resetResources();
-
- void updateMouseStatus();
-
-private:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
-#ifndef QT_NO_CURSOR
- bool setCurrentCursor(QCursor *cursor);
-#endif
- void draw(const QRectF &rect);
- void update(const QRegion &region);
- void createShaderPrograms();
- void createCursorTexture(uint *texture, const QImage &image);
- void initCursorAtlas();
-
- // current cursor information
- struct Cursor {
- Cursor() : texture(0), shape(Qt::BlankCursor), customCursorTexture(0), customCursorPending(false) { }
- uint texture; // a texture from 'image' or the atlas
- Qt::CursorShape shape;
- QRectF textureRect; // normalized rect inside texture
- QSize size; // size of the cursor
- QPoint hotSpot;
- QImage customCursorImage;
- QPoint pos; // current cursor position
- uint customCursorTexture;
- bool customCursorPending;
- } m_cursor;
-
- // cursor atlas information
- struct CursorAtlas {
- CursorAtlas() : cursorsPerRow(0), texture(0), cursorWidth(0), cursorHeight(0) { }
- int cursorsPerRow;
- uint texture;
- int width, height; // width and height of the atlas
- int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
- QList<QPoint> hotSpots;
- QImage image; // valid until it's uploaded
- } m_cursorAtlas;
-
- bool m_visible;
- QEGLPlatformScreen *m_screen;
- QOpenGLShaderProgram *m_program;
- int m_vertexCoordEntry;
- int m_textureCoordEntry;
- int m_textureEntry;
- QEGLPlatformCursorDeviceListener *m_deviceListener;
- bool m_updateRequested;
-};
-
-QT_END_NAMESPACE
-
-#endif // QEGLPLATFORMCURSOR_H
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp
deleted file mode 100644
index 1868ff1665..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 <QtGui/QWindow>
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QOffscreenSurface>
-#include <QtGui/QGuiApplication>
-#include <QtGui/private/qguiapplication_p.h>
-#include <qpa/qwindowsysteminterface.h>
-#include <qpa/qplatforminputcontextfactory_p.h>
-
-#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtPlatformSupport/private/qgenericunixservices_p.h>
-#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
-#include <QtPlatformSupport/private/qfbvthandler_p.h>
-#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h>
-
-#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
-#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
-#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
-#include <QtPlatformSupport/private/qevdevtouchmanager_p.h>
-#endif
-
-#if !defined(QT_NO_TSLIB) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
-#include <QtPlatformSupport/private/qtslib_p.h>
-#endif
-
-#include <QtPlatformHeaders/qeglfsfunctions.h>
-
-#include "qeglplatformintegration_p.h"
-#include "qeglplatformcontext_p.h"
-#include "qeglplatformwindow_p.h"
-#include "qeglplatformscreen_p.h"
-#include "qeglplatformcursor_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QEGLPlatformIntegration
- \brief Base class for EGL-based QPlatformIntegration implementations.
- \since 5.2
- \internal
- \ingroup qpa
-
- This class provides most of the necessary platform integration for
- an EGL-based Unix system. Platform plugins must subclass this and
- reimplement the virtuals for creating platform screens and windows
- since they will most likely wish to use a subclass for these.
-
- The backing store, native interface accessors, font database,
- basic capability flags, etc. are provided out of the box, no
- further customization is needed.
-
- \note It is critical that this class' implementation of
- initialize() is called. Therefore subclasses should either avoid
- to reimplement this function or call the base class
- implementation.
- */
-
-QEGLPlatformIntegration::QEGLPlatformIntegration()
- : m_display(EGL_NO_DISPLAY),
- m_inputContext(0),
- m_fontDb(new QGenericUnixFontDatabase),
- m_services(new QGenericUnixServices),
- m_kbdMgr(0)
-{
-}
-
-QEGLPlatformIntegration::~QEGLPlatformIntegration()
-{
-}
-
-void QEGLPlatformIntegration::initialize()
-{
- m_display = eglGetDisplay(nativeDisplay());
- if (m_display == EGL_NO_DISPLAY)
- qFatal("Could not open egl display");
-
- EGLint major, minor;
- if (!eglInitialize(m_display, &major, &minor))
- qFatal("Could not initialize egl display");
-
- m_inputContext = QPlatformInputContextFactory::create();
-
- m_vtHandler.reset(new QFbVtHandler);
-}
-
-void QEGLPlatformIntegration::destroy()
-{
- foreach (QWindow *w, qGuiApp->topLevelWindows())
- w->destroy();
-
- if (m_display != EGL_NO_DISPLAY)
- eglTerminate(m_display);
-}
-
-QAbstractEventDispatcher *QEGLPlatformIntegration::createEventDispatcher() const
-{
- return createUnixEventDispatcher();
-}
-
-QPlatformServices *QEGLPlatformIntegration::services() const
-{
- return m_services.data();
-}
-
-QPlatformFontDatabase *QEGLPlatformIntegration::fontDatabase() const
-{
- return m_fontDb.data();
-}
-
-QPlatformBackingStore *QEGLPlatformIntegration::createPlatformBackingStore(QWindow *window) const
-{
- QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window);
- if (!window->handle())
- window->create();
- static_cast<QEGLPlatformWindow *>(window->handle())->setBackingStore(bs);
- return bs;
-}
-
-QPlatformWindow *QEGLPlatformIntegration::createPlatformWindow(QWindow *window) const
-{
- QWindowSystemInterface::flushWindowSystemEvents();
- QEGLPlatformWindow *w = createWindow(window);
- w->create();
- if (window->type() != Qt::ToolTip)
- w->requestActivateWindow();
- return w;
-}
-
-QPlatformOpenGLContext *QEGLPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
-{
- // If there is a "root" window into which raster and QOpenGLWidget content is
- // composited, all other contexts must share with its context.
- QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context();
- QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
- QVariant nativeHandle = context->nativeHandle();
- QPlatformOpenGLContext *platformContext = createContext(context->format(),
- share,
- display(),
- &nativeHandle);
- context->setNativeHandle(nativeHandle);
- return platformContext;
-}
-
-QPlatformOffscreenSurface *QEGLPlatformIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
-{
- QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(surface->screen()->handle());
- return createOffscreenSurface(screen->display(), surface->requestedFormat(), surface);
-}
-
-bool QEGLPlatformIntegration::hasCapability(QPlatformIntegration::Capability cap) const
-{
- switch (cap) {
- case ThreadedPixmaps: return true;
- case OpenGL: return true;
- case ThreadedOpenGL: return true;
- case WindowManagement: return false;
- case RasterGLSurface: return true;
- default: return QPlatformIntegration::hasCapability(cap);
- }
-}
-
-QPlatformNativeInterface *QEGLPlatformIntegration::nativeInterface() const
-{
- return const_cast<QEGLPlatformIntegration *>(this);
-}
-
-enum ResourceType {
- EglDisplay,
- EglWindow,
- EglContext,
- EglConfig,
- NativeDisplay,
- XlibDisplay
-};
-
-static int resourceType(const QByteArray &key)
-{
- static const QByteArray names[] = { // match ResourceType
- QByteArrayLiteral("egldisplay"),
- QByteArrayLiteral("eglwindow"),
- QByteArrayLiteral("eglcontext"),
- QByteArrayLiteral("eglconfig"),
- QByteArrayLiteral("nativedisplay"),
- QByteArrayLiteral("display")
- };
- const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
- const QByteArray *result = std::find(names, end, key);
- if (result == end)
- result = std::find(names, end, key.toLower());
- return int(result - names);
-}
-
-void *QEGLPlatformIntegration::nativeResourceForIntegration(const QByteArray &resource)
-{
- void *result = 0;
-
- switch (resourceType(resource)) {
- case EglDisplay:
- result = display();
- break;
- case NativeDisplay:
- result = reinterpret_cast<void*>(nativeDisplay());
- break;
- default:
- break;
- }
-
- return result;
-}
-
-void *QEGLPlatformIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *)
-{
- void *result = 0;
-
- switch (resourceType(resource)) {
- case XlibDisplay:
- // Play nice when using the x11 hooks: Be compatible with xcb that allows querying
- // the X Display pointer, which is nothing but our native display.
- result = reinterpret_cast<void*>(nativeDisplay());
- break;
- default:
- break;
- }
-
- return result;
-}
-
-void *QEGLPlatformIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
-{
- void *result = 0;
-
- switch (resourceType(resource)) {
- case EglDisplay:
- if (window && window->handle())
- result = static_cast<QEGLPlatformScreen *>(window->handle()->screen())->display();
- else
- result = display();
- break;
- case EglWindow:
- if (window && window->handle())
- result = reinterpret_cast<void*>(static_cast<QEGLPlatformWindow *>(window->handle())->eglWindow());
- break;
- default:
- break;
- }
-
- return result;
-}
-
-void *QEGLPlatformIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
-{
- void *result = 0;
-
- switch (resourceType(resource)) {
- case EglContext:
- if (context->handle())
- result = static_cast<QEGLPlatformContext *>(context->handle())->eglContext();
- break;
- case EglConfig:
- if (context->handle())
- result = static_cast<QEGLPlatformContext *>(context->handle())->eglConfig();
- break;
- case EglDisplay:
- if (context->handle())
- result = static_cast<QEGLPlatformContext *>(context->handle())->eglDisplay();
- break;
- default:
- break;
- }
-
- return result;
-}
-
-static void *eglContextForContext(QOpenGLContext *context)
-{
- Q_ASSERT(context);
-
- QEGLPlatformContext *handle = static_cast<QEGLPlatformContext *>(context->handle());
- if (!handle)
- return 0;
-
- return handle->eglContext();
-}
-
-QPlatformNativeInterface::NativeResourceForContextFunction QEGLPlatformIntegration::nativeResourceFunctionForContext(const QByteArray &resource)
-{
- QByteArray lowerCaseResource = resource.toLower();
- if (lowerCaseResource == "get_egl_context")
- return NativeResourceForContextFunction(eglContextForContext);
-
- return 0;
-}
-
-QFunctionPointer QEGLPlatformIntegration::platformFunction(const QByteArray &function) const
-{
-#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
- if (function == QEglFSFunctions::loadKeymapTypeIdentifier())
- return QFunctionPointer(loadKeymapStatic);
-#else
- Q_UNUSED(function)
-#endif
-
- return 0;
-}
-
-void QEGLPlatformIntegration::loadKeymapStatic(const QString &filename)
-{
-#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
- QEGLPlatformIntegration *self = static_cast<QEGLPlatformIntegration *>(QGuiApplicationPrivate::platformIntegration());
- if (self->m_kbdMgr)
- self->m_kbdMgr->loadKeymap(filename);
- else
- qWarning("QEGLPlatformIntegration: Cannot load keymap, no keyboard handler found");
-#else
- Q_UNUSED(filename);
-#endif
-}
-
-void QEGLPlatformIntegration::createInputHandlers()
-{
-#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
- m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
- new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
-#ifndef QT_NO_TSLIB
- const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB");
- if (useTslib)
- new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */);
- else
-#endif // QT_NO_TSLIB
- new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
deleted file mode 100644
index 42fbf8c8a1..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QEGLPLATFORMINTEGRATION_H
-#define QEGLPLATFORMINTEGRATION_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/QVariant>
-#include <qpa/qplatformintegration.h>
-#include <qpa/qplatformnativeinterface.h>
-#include <EGL/egl.h>
-
-QT_BEGIN_NAMESPACE
-
-class QEGLPlatformWindow;
-class QEGLPlatformContext;
-class QFbVtHandler;
-class QEvdevKeyboardManager;
-
-class QEGLPlatformIntegration : public QPlatformIntegration, public QPlatformNativeInterface
-{
-public:
- QEGLPlatformIntegration();
- ~QEGLPlatformIntegration();
-
- void initialize() Q_DECL_OVERRIDE;
- void destroy() Q_DECL_OVERRIDE;
-
- EGLDisplay display() const { return m_display; }
-
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QPlatformServices *services() const Q_DECL_OVERRIDE;
- QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
-
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
- QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
-
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
-
- QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
- // QPlatformNativeInterface
- void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
- void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE;
- void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE;
- void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE;
- NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE;
-
- QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
-
- QFbVtHandler *vtHandler() { return m_vtHandler.data(); }
-
-protected:
- virtual QEGLPlatformWindow *createWindow(QWindow *window) const = 0;
- virtual QEGLPlatformContext *createContext(const QSurfaceFormat &format,
- QPlatformOpenGLContext *shareContext,
- EGLDisplay display,
- QVariant *nativeHandle) const = 0;
- virtual QPlatformOffscreenSurface *createOffscreenSurface(EGLDisplay display,
- const QSurfaceFormat &format,
- QOffscreenSurface *surface) const = 0;
-
- virtual EGLNativeDisplayType nativeDisplay() const { return EGL_DEFAULT_DISPLAY; }
-
- void createInputHandlers();
-
-private:
- static void loadKeymapStatic(const QString &filename);
-
- EGLDisplay m_display;
- QPlatformInputContext *m_inputContext;
- QScopedPointer<QPlatformFontDatabase> m_fontDb;
- QScopedPointer<QPlatformServices> m_services;
- QScopedPointer<QFbVtHandler> m_vtHandler;
- QEvdevKeyboardManager *m_kbdMgr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QEGLPLATFORMINTEGRATION_H
diff --git a/src/platformsupport/eglconvenience/qeglplatformscreen.cpp b/src/platformsupport/eglconvenience/qeglplatformscreen.cpp
deleted file mode 100644
index 61f8cdd9b4..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformscreen.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qeglplatformscreen_p.h"
-#include "qeglplatformwindow_p.h"
-#include <QtGui/qwindow.h>
-#include <qpa/qwindowsysteminterface.h>
-#include <QtPlatformSupport/private/qopenglcompositor_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QEGLPlatformScreen
- \brief Base class for EGL-based platform screen implementations.
- \since 5.2
- \internal
- \ingroup qpa
- */
-
-QEGLPlatformScreen::QEGLPlatformScreen(EGLDisplay dpy)
- : m_dpy(dpy),
- m_pointerWindow(0)
-{
-}
-
-QEGLPlatformScreen::~QEGLPlatformScreen()
-{
- QOpenGLCompositor::destroy();
-}
-
-void QEGLPlatformScreen::handleCursorMove(const QPoint &pos)
-{
- const QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
- const QList<QOpenGLCompositorWindow *> windows = compositor->windows();
-
- // Generate enter and leave events like a real windowing system would do.
- if (windows.isEmpty())
- return;
-
- // First window is always fullscreen.
- if (windows.count() == 1) {
- QWindow *window = windows[0]->sourceWindow();
- if (m_pointerWindow != window) {
- m_pointerWindow = window;
- QWindowSystemInterface::handleEnterEvent(window, window->mapFromGlobal(pos), pos);
- }
- return;
- }
-
- QWindow *enter = 0, *leave = 0;
- for (int i = windows.count() - 1; i >= 0; --i) {
- QWindow *window = windows[i]->sourceWindow();
- const QRect geom = window->geometry();
- if (geom.contains(pos)) {
- if (m_pointerWindow != window) {
- leave = m_pointerWindow;
- m_pointerWindow = window;
- enter = window;
- }
- break;
- }
- }
-
- if (enter && leave)
- QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos);
-}
-
-QPixmap QEGLPlatformScreen::grabWindow(WId wid, int x, int y, int width, int height) const
-{
- QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
- const QList<QOpenGLCompositorWindow *> windows = compositor->windows();
- Q_ASSERT(!windows.isEmpty());
-
- QImage img;
-
- if (static_cast<QEGLPlatformWindow *>(windows.first()->sourceWindow()->handle())->isRaster()) {
- // Request the compositor to render everything into an FBO and read it back. This
- // is of course slow, but it's safe and reliable. It will not include the mouse
- // cursor, which is a plus.
- img = compositor->grab();
- } else {
- // Just a single OpenGL window without compositing. Do not support this case for now. Doing
- // glReadPixels is not an option since it would read from the back buffer which may have
- // undefined content when calling right after a swapBuffers (unless preserved swap is
- // available and enabled, but we have no support for that).
- qWarning("grabWindow: Not supported for non-composited OpenGL content. Use QQuickWindow::grabWindow() instead.");
- return QPixmap();
- }
-
- if (!wid) {
- const QSize screenSize = geometry().size();
- if (width < 0)
- width = screenSize.width() - x;
- if (height < 0)
- height = screenSize.height() - y;
- return QPixmap::fromImage(img).copy(x, y, width, height);
- }
-
- foreach (QOpenGLCompositorWindow *w, windows) {
- const QWindow *window = w->sourceWindow();
- if (window->winId() == wid) {
- const QRect geom = window->geometry();
- if (width < 0)
- width = geom.width() - x;
- if (height < 0)
- height = geom.height() - y;
- QRect rect(geom.topLeft() + QPoint(x, y), QSize(width, height));
- rect &= window->geometry();
- return QPixmap::fromImage(img).copy(rect);
- }
- }
-
- return QPixmap();
-}
-
-QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
deleted file mode 100644
index 4a987f6860..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QEGLPLATFORMSCREEN_H
-#define QEGLPLATFORMSCREEN_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/QList>
-#include <QtCore/QPoint>
-#include <QtCore/qtextstream.h>
-#include <qpa/qplatformscreen.h>
-#include <EGL/egl.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLContext;
-class QWindow;
-class QEGLPlatformWindow;
-
-class QEGLPlatformScreen : public QPlatformScreen
-{
-public:
- QEGLPlatformScreen(EGLDisplay dpy);
- ~QEGLPlatformScreen();
-
- EGLDisplay display() const { return m_dpy; }
-
- void handleCursorMove(const QPoint &pos);
-
- QPixmap grabWindow(WId wid, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
-
-private:
- EGLDisplay m_dpy;
- QWindow *m_pointerWindow;
-};
-
-QT_END_NAMESPACE
-
-#endif // QEGLPLATFORMSCREEN_H
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow.cpp b/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
deleted file mode 100644
index 35f38ac29a..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 <qpa/qwindowsysteminterface.h>
-#include <QtPlatformSupport/private/qopenglcompositor_p.h>
-#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h>
-
-#include "qeglplatformwindow_p.h"
-#include "qeglplatformscreen_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QEGLPlatformWindow
- \brief Base class for EGL-based platform window implementations.
- \since 5.2
- \internal
- \ingroup qpa
-
- Lightweight class providing some basic platform window operations
- and interfacing with QOpenGLCompositorBackingStore.
-
- Almost no QPlatformWindow functions are implemented here. This is
- intentional because different platform plugins may use different
- strategies for their window management (some may force fullscreen
- windows, some may not, some may share the underlying native
- surface, some may not, etc.) and therefore it is not sensible to
- enforce anything for these functions.
-
- \note Subclasses are responsible for invoking this class'
- implementation of create() and are expected to utilize the window
- stack management functions (addWindow() etc.) in
- QOpenGLCompositor.
- */
-
-QEGLPlatformWindow::QEGLPlatformWindow(QWindow *w)
- : QPlatformWindow(w),
- m_backingStore(0),
- m_raster(false),
- m_winId(0)
-{
-}
-
-static WId newWId()
-{
- static WId id = 0;
-
- if (id == std::numeric_limits<WId>::max())
- qWarning("QEGLPlatformWindow: Out of window IDs");
-
- return ++id;
-}
-
-void QEGLPlatformWindow::create()
-{
- m_winId = newWId();
-
- // Save the original surface type before changing to OpenGLSurface.
- m_raster = (window()->surfaceType() == QSurface::RasterSurface);
- if (m_raster) // change to OpenGL, but not for RasterGLSurface
- window()->setSurfaceType(QSurface::OpenGLSurface);
-
- if (window()->type() == Qt::Desktop) {
- QRect fullscreenRect(QPoint(), screen()->availableGeometry().size());
- QPlatformWindow::setGeometry(fullscreenRect);
- QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect);
- return;
- }
-}
-
-bool QEGLPlatformWindow::isRaster() const
-{
- return m_raster || window()->surfaceType() == QSurface::RasterGLSurface;
-}
-
-QWindow *QEGLPlatformWindow::sourceWindow() const
-{
- return window();
-}
-
-const QPlatformTextureList *QEGLPlatformWindow::textures() const
-{
- if (m_backingStore)
- return m_backingStore->textures();
-
- return 0;
-}
-
-void QEGLPlatformWindow::endCompositing()
-{
- if (m_backingStore)
- m_backingStore->notifyComposited();
-}
-
-WId QEGLPlatformWindow::winId() const
-{
- return m_winId;
-}
-
-void QEGLPlatformWindow::setOpacity(qreal)
-{
- if (!isRaster())
- qWarning("QEGLPlatformWindow: Cannot set opacity for non-raster windows");
-
- // Nothing to do here. The opacity is stored in the QWindow.
-}
-
-QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
deleted file mode 100644
index 852d690c92..0000000000
--- a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QEGLPLATFORMWINDOW_H
-#define QEGLPLATFORMWINDOW_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/qplatformwindow.h>
-#include <QtPlatformSupport/private/qopenglcompositor_p.h>
-#include <EGL/egl.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLCompositorBackingStore;
-class QPlatformTextureList;
-
-class QEGLPlatformWindow : public QPlatformWindow, public QOpenGLCompositorWindow
-{
-public:
- QEGLPlatformWindow(QWindow *w);
-
- virtual void create();
-
- QOpenGLCompositorBackingStore *backingStore() { return m_backingStore; }
- void setBackingStore(QOpenGLCompositorBackingStore *backingStore) { m_backingStore = backingStore; }
- bool isRaster() const;
-
- QWindow *sourceWindow() const Q_DECL_OVERRIDE;
- const QPlatformTextureList *textures() const Q_DECL_OVERRIDE;
- void endCompositing() Q_DECL_OVERRIDE;
-
- WId winId() const Q_DECL_OVERRIDE;
- void setOpacity(qreal opacity) Q_DECL_OVERRIDE;
-
- virtual EGLNativeWindowType eglWindow() const = 0;
-
-private:
- QOpenGLCompositorBackingStore *m_backingStore;
- bool m_raster;
- WId m_winId;
-};
-
-QT_END_NAMESPACE
-
-#endif // QEGLPLATFORMWINDOW_H
diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp b/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp
new file mode 100644
index 0000000000..2ace144811
--- /dev/null
+++ b/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "qeglstreamconvenience_p.h"
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+
+QEGLStreamConvenience::QEGLStreamConvenience()
+ : initialized(false),
+ has_egl_platform_device(false),
+ has_egl_device_base(false),
+ has_egl_stream(false),
+ has_egl_stream_producer_eglsurface(false),
+ has_egl_stream_consumer_egloutput(false),
+ has_egl_output_drm(false),
+ has_egl_output_base(false),
+ has_egl_stream_cross_process_fd(false),
+ has_egl_stream_consumer_gltexture(false)
+{
+ const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ if (!extensions) {
+ qWarning("Failed to query EGL extensions");
+ return;
+ }
+
+ query_devices = reinterpret_cast<PFNEGLQUERYDEVICESEXTPROC>(eglGetProcAddress("eglQueryDevicesEXT"));
+ query_device_string = reinterpret_cast<PFNEGLQUERYDEVICESTRINGEXTPROC>(eglGetProcAddress("eglQueryDeviceStringEXT"));
+ get_platform_display = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
+
+ has_egl_device_base = strstr(extensions, "EGL_EXT_device_base");
+ has_egl_platform_device = strstr(extensions, "EGL_EXT_platform_device");
+}
+
+void QEGLStreamConvenience::initialize(EGLDisplay dpy)
+{
+ if (initialized)
+ return;
+
+ if (!eglBindAPI(EGL_OPENGL_ES_API)) {
+ qWarning("Failed to bind OpenGL ES API");
+ return;
+ }
+
+ const char *extensions = eglQueryString(dpy, EGL_EXTENSIONS);
+ if (!extensions) {
+ qWarning("Failed to query EGL extensions");
+ return;
+ }
+
+ create_stream = reinterpret_cast<PFNEGLCREATESTREAMKHRPROC>(eglGetProcAddress("eglCreateStreamKHR"));
+ destroy_stream = reinterpret_cast<PFNEGLDESTROYSTREAMKHRPROC>(eglGetProcAddress("eglDestroyStreamKHR"));
+ stream_attrib = reinterpret_cast<PFNEGLSTREAMATTRIBKHRPROC>(eglGetProcAddress("eglStreamAttribKHR"));
+ query_stream = reinterpret_cast<PFNEGLQUERYSTREAMKHRPROC>(eglGetProcAddress("eglQueryStreamKHR"));
+ query_stream_u64 = reinterpret_cast<PFNEGLQUERYSTREAMU64KHRPROC>(eglGetProcAddress("eglQueryStreamu64KHR"));
+ create_stream_producer_surface = reinterpret_cast<PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC>(eglGetProcAddress("eglCreateStreamProducerSurfaceKHR"));
+ stream_consumer_output = reinterpret_cast<PFNEGLSTREAMCONSUMEROUTPUTEXTPROC>(eglGetProcAddress("eglStreamConsumerOutputEXT"));
+ get_output_layers = reinterpret_cast<PFNEGLGETOUTPUTLAYERSEXTPROC>(eglGetProcAddress("eglGetOutputLayersEXT"));
+ get_output_ports = reinterpret_cast<PFNEGLGETOUTPUTPORTSEXTPROC>(eglGetProcAddress("eglGetOutputPortsEXT"));
+ output_layer_attrib = reinterpret_cast<PFNEGLOUTPUTLAYERATTRIBEXTPROC>(eglGetProcAddress("eglOutputLayerAttribEXT"));
+ query_output_layer_attrib = reinterpret_cast<PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC>(eglGetProcAddress("eglQueryOutputLayerAttribEXT"));
+ query_output_layer_string = reinterpret_cast<PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC>(eglGetProcAddress("eglQueryOutputLayerStringEXT"));
+ query_output_port_attrib = reinterpret_cast<PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC>(eglGetProcAddress("eglQueryOutputPortAttribEXT"));
+ query_output_port_string = reinterpret_cast<PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC>(eglGetProcAddress("eglQueryOutputPortStringEXT"));
+ get_stream_file_descriptor = reinterpret_cast<PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC>(eglGetProcAddress("eglGetStreamFileDescriptorKHR"));
+ create_stream_from_file_descriptor = reinterpret_cast<PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC>(eglGetProcAddress("eglCreateStreamFromFileDescriptorKHR"));
+ stream_consumer_gltexture = reinterpret_cast<PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC>(eglGetProcAddress("eglStreamConsumerGLTextureExternalKHR"));
+ stream_consumer_acquire = reinterpret_cast<PFNEGLSTREAMCONSUMERACQUIREKHRPROC>(eglGetProcAddress("eglStreamConsumerAcquireKHR"));
+ stream_consumer_release = reinterpret_cast<PFNEGLSTREAMCONSUMERRELEASEKHRPROC>(eglGetProcAddress("eglStreamConsumerReleaseKHR"));
+
+ has_egl_stream = strstr(extensions, "EGL_KHR_stream");
+ has_egl_stream_producer_eglsurface = strstr(extensions, "EGL_KHR_stream_producer_eglsurface");
+ has_egl_stream_consumer_egloutput = strstr(extensions, "EGL_EXT_stream_consumer_egloutput");
+ has_egl_output_drm = strstr(extensions, "EGL_EXT_output_drm");
+ has_egl_output_base = strstr(extensions, "EGL_EXT_output_base");
+ has_egl_stream_cross_process_fd = strstr(extensions, "EGL_KHR_stream_cross_process_fd");
+ has_egl_stream_consumer_gltexture = strstr(extensions, "EGL_KHR_stream_consumer_gltexture");
+
+ initialized = true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
new file mode 100644
index 0000000000..648b129579
--- /dev/null
+++ b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
@@ -0,0 +1,184 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QEGLSTREAMCONVENIENCE_H
+#define QEGLSTREAMCONVENIENCE_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 <qglobal.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+// This provides runtime EGLDevice/Output/Stream support even when eglext.h in
+// the sysroot is not up-to-date.
+
+#ifndef EGL_VERSION_1_5
+typedef intptr_t EGLAttrib;
+#endif
+
+#ifndef EGL_EXT_platform_base
+typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
+#endif
+
+#ifndef EGL_EXT_device_base
+typedef void *EGLDeviceEXT;
+#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0))
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
+typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name);
+#endif
+
+#ifndef EGL_EXT_output_base
+typedef void *EGLOutputLayerEXT;
+typedef void *EGLOutputPortEXT;
+#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0)
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value);
+typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value);
+typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name);
+#endif
+
+#ifndef EGL_KHR_stream
+typedef void *EGLStreamKHR;
+typedef quint64 EGLuint64KHR;
+#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
+#define EGL_STREAM_STATE_KHR 0x3214
+#define EGL_STREAM_STATE_CREATED_KHR 0x3215
+#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
+#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
+#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
+#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
+#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
+#define EGL_BAD_STREAM_KHR 0x321B
+#define EGL_BAD_STATE_KHR 0x321C
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
+#endif
+
+#ifndef EGL_KHR_stream_producer_eglsurface
+#define EGL_STREAM_BIT_KHR 0x0800
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
+#endif
+
+#ifndef EGL_KHR_stream_cross_process_fd
+typedef int EGLNativeFileDescriptorKHR;
+#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
+typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
+#endif
+
+#ifndef EGL_KHR_stream_consumer_gltexture
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
+#endif
+
+#ifndef EGL_EXT_stream_consumer_egloutput
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer);
+#endif
+
+#ifndef EGL_EXT_platform_device
+#define EGL_PLATFORM_DEVICE_EXT 0x313F
+#endif
+
+#ifndef EGL_EXT_device_drm
+#define EGL_DRM_DEVICE_FILE_EXT 0x3233
+#endif
+
+#ifndef EGL_EXT_output_drm
+#define EGL_DRM_CRTC_EXT 0x3234
+#define EGL_DRM_PLANE_EXT 0x3235
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QEGLStreamConvenience
+{
+public:
+ QEGLStreamConvenience();
+ void initialize(EGLDisplay dpy);
+
+ PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display;
+ PFNEGLQUERYDEVICESEXTPROC query_devices;
+ PFNEGLQUERYDEVICESTRINGEXTPROC query_device_string;
+ PFNEGLCREATESTREAMKHRPROC create_stream;
+ PFNEGLDESTROYSTREAMKHRPROC destroy_stream;
+ PFNEGLSTREAMATTRIBKHRPROC stream_attrib;
+ PFNEGLQUERYSTREAMKHRPROC query_stream;
+ PFNEGLQUERYSTREAMU64KHRPROC query_stream_u64;
+ PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface;
+ PFNEGLSTREAMCONSUMEROUTPUTEXTPROC stream_consumer_output;
+ PFNEGLGETOUTPUTLAYERSEXTPROC get_output_layers;
+ PFNEGLGETOUTPUTPORTSEXTPROC get_output_ports;
+ PFNEGLOUTPUTLAYERATTRIBEXTPROC output_layer_attrib;
+ PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC query_output_layer_attrib;
+ PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC query_output_layer_string;
+ PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC query_output_port_attrib;
+ PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC query_output_port_string;
+ PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC get_stream_file_descriptor;
+ PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC create_stream_from_file_descriptor;
+ PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC stream_consumer_gltexture;
+ PFNEGLSTREAMCONSUMERACQUIREKHRPROC stream_consumer_acquire;
+ PFNEGLSTREAMCONSUMERRELEASEKHRPROC stream_consumer_release;
+
+ bool initialized;
+
+ bool has_egl_platform_device;
+ bool has_egl_device_base;
+ bool has_egl_stream;
+ bool has_egl_stream_producer_eglsurface;
+ bool has_egl_stream_consumer_egloutput;
+ bool has_egl_output_drm;
+ bool has_egl_output_base;
+ bool has_egl_stream_cross_process_fd;
+ bool has_egl_stream_consumer_gltexture;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/platformsupport/eventdispatchers/eventdispatchers.pri b/src/platformsupport/eventdispatchers/eventdispatchers.pri
index c9bbe1f5b7..a0b37cae1a 100644
--- a/src/platformsupport/eventdispatchers/eventdispatchers.pri
+++ b/src/platformsupport/eventdispatchers/eventdispatchers.pri
@@ -6,14 +6,12 @@ SOURCES +=\
HEADERS +=\
$$PWD/qunixeventdispatcher_qpa_p.h\
$$PWD/qgenericunixeventdispatcher_p.h\
-}
-
-ios {
-OBJECTIVE_SOURCES +=\
- $$PWD/qeventdispatcher_cf.mm
+} else: win32 {
+SOURCES +=\
+ $$PWD/qwindowsguieventdispatcher.cpp
HEADERS +=\
- $$PWD/qeventdispatcher_cf_p.h
+ $$PWD/qwindowsguieventdispatcher_p.h
}
contains(QT_CONFIG, glib) {
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm
deleted file mode 100644
index 13b7dc4358..0000000000
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm
+++ /dev/null
@@ -1,628 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qeventdispatcher_cf_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qmetaobject.h>
-#include <QtCore/qthread.h>
-#include <QtCore/private/qcoreapplication_p.h>
-#include <QtCore/private/qcore_unix_p.h>
-#include <QtCore/private/qcore_mac_p.h>
-#include <QtCore/private/qthread_p.h>
-
-#include <qpa/qwindowsysteminterface.h>
-
-#include <limits>
-
-#include <UIKit/UIApplication.h>
-
-@interface RunLoopModeTracker : NSObject {
- QStack<CFStringRef> m_runLoopModes;
-}
-@end
-
-@implementation RunLoopModeTracker
-
-- (id) init
-{
- if (self = [super init]) {
- m_runLoopModes.push(kCFRunLoopDefaultMode);
-
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(receivedNotification:)
- name:nil
- object:[UIApplication sharedApplication]];
- }
-
- return self;
-}
-
-- (void) dealloc
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
-
- [super dealloc];
-}
-
-static CFStringRef runLoopMode(NSDictionary *dictionary)
-{
- for (NSString *key in dictionary) {
- if (CFStringHasSuffix((CFStringRef)key, CFSTR("RunLoopMode")))
- return (CFStringRef)[dictionary objectForKey: key];
- }
-
- return nil;
-}
-
-- (void) receivedNotification:(NSNotification *) notification
-{
- if (CFStringHasSuffix((CFStringRef)notification.name, CFSTR("RunLoopModePushNotification"))) {
- if (CFStringRef mode = runLoopMode(notification.userInfo))
- m_runLoopModes.push(mode);
- else
- qWarning("Encountered run loop push notification without run loop mode!");
-
- } else if (CFStringHasSuffix((CFStringRef)notification.name, CFSTR("RunLoopModePopNotification"))) {
- CFStringRef mode = runLoopMode(notification.userInfo);
- if (CFStringCompare(mode, [self currentMode], 0) == kCFCompareEqualTo)
- m_runLoopModes.pop();
- else
- qWarning("Tried to pop run loop mode '%s' that was never pushed!", qPrintable(QCFString::toQString(mode)));
-
- Q_ASSERT(m_runLoopModes.size() >= 1);
- }
-}
-
-- (CFStringRef) currentMode
-{
- return m_runLoopModes.top();
-}
-
-@end
-
-QT_BEGIN_NAMESPACE
-QT_USE_NAMESPACE
-
-class RunLoopDebugger : public QObject
-{
- Q_OBJECT
-
- Q_ENUMS(Activity)
- Q_ENUMS(Result)
-
-public:
-
- #define Q_MIRROR_ENUM(name) name = name
-
- enum Activity {
- Q_MIRROR_ENUM(kCFRunLoopEntry),
- Q_MIRROR_ENUM(kCFRunLoopBeforeTimers),
- Q_MIRROR_ENUM(kCFRunLoopBeforeSources),
- Q_MIRROR_ENUM(kCFRunLoopBeforeWaiting),
- Q_MIRROR_ENUM(kCFRunLoopAfterWaiting),
- Q_MIRROR_ENUM(kCFRunLoopExit)
- };
-
- enum Result {
- Q_MIRROR_ENUM(kCFRunLoopRunFinished),
- Q_MIRROR_ENUM(kCFRunLoopRunStopped),
- Q_MIRROR_ENUM(kCFRunLoopRunTimedOut),
- Q_MIRROR_ENUM(kCFRunLoopRunHandledSource)
- };
-};
-
-#define Q_ENUM_PRINTER(enumName) \
- static const char* qPrintable##enumName(int value) \
- { \
- return RunLoopDebugger::staticMetaObject.enumerator(RunLoopDebugger::staticMetaObject.indexOfEnumerator(#enumName)).valueToKey(value); \
- }
-
-Q_ENUM_PRINTER(Activity);
-Q_ENUM_PRINTER(Result);
-
-QDebug operator<<(QDebug s, timespec tv)
-{
- s << tv.tv_sec << "." << qSetFieldWidth(9) << qSetPadChar(QChar(48)) << tv.tv_nsec << reset;
- return s;
-}
-
-#if DEBUG_EVENT_DISPATCHER
-uint g_eventDispatcherIndentationLevel = 0;
-#endif
-
-static const CFTimeInterval kCFTimeIntervalMinimum = 0;
-static const CFTimeInterval kCFTimeIntervalDistantFuture = std::numeric_limits<CFTimeInterval>::max();
-
-#pragma mark - Class definition
-
-QEventDispatcherCoreFoundation::QEventDispatcherCoreFoundation(QObject *parent)
- : QAbstractEventDispatcher(parent)
- , m_postedEventsRunLoopSource(this, &QEventDispatcherCoreFoundation::processPostedEvents)
- , m_runLoopActivityObserver(this, &QEventDispatcherCoreFoundation::handleRunLoopActivity,
-#if DEBUG_EVENT_DISPATCHER
- kCFRunLoopAllActivities
-#else
- kCFRunLoopBeforeWaiting | kCFRunLoopAfterWaiting
-#endif
- )
- , m_runLoopModeTracker([[RunLoopModeTracker alloc] init])
- , m_runLoopTimer(0)
- , m_blockedRunLoopTimer(0)
- , m_overdueTimerScheduled(false)
- , m_processEvents(QEventLoop::EventLoopExec)
-{
- m_cfSocketNotifier.setHostEventDispatcher(this);
-
- m_postedEventsRunLoopSource.addToMode(kCFRunLoopCommonModes);
- m_runLoopActivityObserver.addToMode(kCFRunLoopCommonModes);
-}
-
-QEventDispatcherCoreFoundation::~QEventDispatcherCoreFoundation()
-{
- invalidateTimer();
- qDeleteAll(m_timerInfoList);
-
- m_cfSocketNotifier.removeSocketNotifiers();
-}
-
-/*!
- Processes all pending events that match \a flags until there are no
- more events to process. Returns \c true if pending events were handled;
- otherwise returns \c false.
-
- Note:
-
- - All events are considered equal. This function should process
- both system/native events (that we may or may not care about),
- as well as Qt-events (posted events and timers).
-
- - The function should not return until all queued/available events
- have been processed. If the WaitForMoreEvents is set, the
- function should wait only if there were no events ready,
- and _then_ process all newly queued/available events.
-
- These notes apply to other function in this class as well, such as
- hasPendingEvents().
-*/
-bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlags flags)
-{
- bool eventsProcessed = false;
-
- if (flags & (QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers))
- qWarning() << "processEvents() flags" << flags << "not supported on iOS";
-
- qEventDispatcherDebug() << "Entering with " << flags; qIndent();
-
- if (m_blockedRunLoopTimer) {
- Q_ASSERT(m_blockedRunLoopTimer == m_runLoopTimer);
-
- qEventDispatcherDebug() << "Recursing from blocked timer " << m_blockedRunLoopTimer;
- m_runLoopTimer = 0; // Unset current timer to force creation of new timer
- updateTimers();
- }
-
- if (m_processEvents.deferredWakeUp) {
- // We may be processing events recursivly as a result of processing a posted event,
- // in which case we need to signal the run-loop source so that this iteration of
- // processEvents will take care of the newly posted events.
- m_postedEventsRunLoopSource.signal();
- m_processEvents.deferredWakeUp = false;
-
- qEventDispatcherDebug() << "Processed deferred wake-up";
- }
-
- // The documentation states that this signal is emitted after the event
- // loop returns from a function that could block, which is not the case
- // here, but all the other event dispatchers emit awake at the start of
- // processEvents, and the QEventLoop auto-test has an explicit check for
- // this behavior, so we assume it's for a good reason and do it as well.
- emit awake();
-
- ProcessEventsState previousState = m_processEvents;
- m_processEvents = ProcessEventsState(flags);
-
- bool returnAfterSingleSourceHandled = !(m_processEvents.flags & QEventLoop::EventLoopExec);
-
- Q_FOREVER {
- CFStringRef mode = [m_runLoopModeTracker currentMode];
-
- CFTimeInterval duration = (m_processEvents.flags & QEventLoop::WaitForMoreEvents) ?
- kCFTimeIntervalDistantFuture : kCFTimeIntervalMinimum;
-
- qEventDispatcherDebug() << "Calling CFRunLoopRunInMode = " << qPrintable(QCFString::toQString(mode))
- << " for " << duration << " ms, processing single source = " << returnAfterSingleSourceHandled; qIndent();
-
- SInt32 result = CFRunLoopRunInMode(mode, duration, returnAfterSingleSourceHandled);
-
- qUnIndent(); qEventDispatcherDebug() << "result = " << qPrintableResult(result);
-
- eventsProcessed |= (result == kCFRunLoopRunHandledSource
- || m_processEvents.processedPostedEvents
- || m_processEvents.processedTimers);
-
- if (result == kCFRunLoopRunFinished) {
- // This should only happen at application shutdown, as the main runloop
- // will presumably always have sources registered.
- break;
- } else if (m_processEvents.wasInterrupted) {
-
- if (m_processEvents.flags & QEventLoop::EventLoopExec) {
- Q_ASSERT(result == kCFRunLoopRunStopped);
-
- // The runloop was potentially stopped (interrupted) by us, as a response to
- // a Qt event loop being asked to exit. We check that the topmost eventloop
- // is still supposed to keep going and return if not. Note that the runloop
- // might get stopped as a result of a non-top eventloop being asked to exit,
- // in which case we continue running the top event loop until that is asked
- // to exit, and then unwind back to the previous event loop which will break
- // immediately, since it has already been exited.
-
- QEventLoop *currentEventLoop = QThreadData::current()->eventLoops.top();
- Q_ASSERT(currentEventLoop);
-
- if (!currentEventLoop->isRunning()) {
- qEventDispatcherDebug() << "Top level event loop was exited";
- break;
- } else {
- qEventDispatcherDebug() << "Top level event loop still running, making another pass";
- }
- } else {
- // We were called manually, through processEvents(), and should stop processing
- // events, even if we didn't finish processing all the queued events.
- qEventDispatcherDebug() << "Top level processEvents was interrupted";
- break;
- }
- }
-
- if (m_processEvents.flags & QEventLoop::EventLoopExec) {
- // We were called from QEventLoop's exec(), which blocks until the event
- // loop is asked to exit by calling processEvents repeatedly. Instead of
- // re-entering this method again and again from QEventLoop, we can block
- // here, one lever closer to CFRunLoopRunInMode, by running the native
- // event loop again and again until we're interrupted by QEventLoop.
- continue;
- } else {
- // We were called 'manually', through processEvents()
-
- if (result == kCFRunLoopRunHandledSource) {
- // We processed one or more sources, but there might still be other
- // sources that did not get a chance to process events, so we need
- // to do another pass.
-
- // But we should only wait for more events the first time
- m_processEvents.flags &= ~QEventLoop::WaitForMoreEvents;
- continue;
-
- } else if (m_overdueTimerScheduled && !m_processEvents.processedTimers) {
- // CFRunLoopRunInMode does not guarantee that a scheduled timer with a fire
- // date in the past (overdue) will fire on the next run loop pass. The Qt
- // APIs on the other hand document eg. zero-interval timers to always be
- // handled after processing all available window-system events.
- qEventDispatcherDebug() << "Manually processing timers due to overdue timer";
- processTimers(0);
- eventsProcessed = true;
- }
- }
-
- break;
- }
-
- if (m_blockedRunLoopTimer) {
- invalidateTimer();
- m_runLoopTimer = m_blockedRunLoopTimer;
- }
-
- if (m_processEvents.deferredUpdateTimers)
- updateTimers();
-
- if (m_processEvents.deferredWakeUp) {
- m_postedEventsRunLoopSource.signal();
- qEventDispatcherDebug() << "Processed deferred wake-up";
- }
-
- bool wasInterrupted = m_processEvents.wasInterrupted;
-
- // Restore state of previous processEvents() call
- m_processEvents = previousState;
-
- if (wasInterrupted) {
- // The current processEvents run has been interrupted, but there may still be
- // others below it (eg, in the case of nested event loops). We need to trigger
- // another interrupt so that the parent processEvents call has a chance to check
- // if it should continue.
- qEventDispatcherDebug() << "Forwarding interrupt in case of nested processEvents";
- interrupt();
- }
-
- qEventDispatcherDebug() << "Returning with eventsProcessed = " << eventsProcessed; qUnIndent();
-
- return eventsProcessed;
-}
-
-void QEventDispatcherCoreFoundation::processPostedEvents()
-{
- if (m_processEvents.processedPostedEvents && !(m_processEvents.flags & QEventLoop::EventLoopExec)) {
- qEventDispatcherDebug() << "Already processed events this pass";
- return;
- }
-
- m_processEvents.processedPostedEvents = true;
-
- qEventDispatcherDebug() << "Sending posted events for " << m_processEvents.flags; qIndent();
- QCoreApplication::sendPostedEvents();
- qUnIndent();
-
- qEventDispatcherDebug() << "Sending window system events for " << m_processEvents.flags; qIndent();
- QWindowSystemInterface::sendWindowSystemEvents(m_processEvents.flags);
- qUnIndent();
-}
-
-void QEventDispatcherCoreFoundation::processTimers(CFRunLoopTimerRef timer)
-{
- if (m_processEvents.processedTimers && !(m_processEvents.flags & QEventLoop::EventLoopExec)) {
- qEventDispatcherDebug() << "Already processed timers this pass";
- m_processEvents.deferredUpdateTimers = true;
- return;
- }
-
- qEventDispatcherDebug() << "CFRunLoopTimer " << timer << " fired, activating Qt timers"; qIndent();
-
- // Activating Qt timers might recurse into processEvents() if a timer-callback
- // brings up a new event-loop or tries to processes events manually. Although
- // a CFRunLoop can recurse inside its callbacks, a single CFRunLoopTimer can
- // not. So, for each recursion into processEvents() from a timer-callback we
- // need to set up a new timer-source. Instead of doing it preemtivly each
- // time we activate Qt timers, we set a flag here, and let processEvents()
- // decide whether or not it needs to bring up a new timer source.
-
- // We may have multiple recused timers, so keep track of the previous blocked timer
- CFRunLoopTimerRef previouslyBlockedRunLoopTimer = m_blockedRunLoopTimer;
-
- m_blockedRunLoopTimer = timer;
- m_timerInfoList.activateTimers();
- m_blockedRunLoopTimer = previouslyBlockedRunLoopTimer;
- m_processEvents.processedTimers = true;
-
- qUnIndent();
-
- // Now that the timer source is unblocked we may need to schedule it again
- updateTimers();
-}
-
-void QEventDispatcherCoreFoundation::handleRunLoopActivity(CFRunLoopActivity activity)
-{
- qEventDispatcherDebug() << qPrintableActivity(activity);
-
- switch (activity) {
- case kCFRunLoopBeforeWaiting:
- if (m_processEvents.processedTimers
- && !(m_processEvents.flags & QEventLoop::EventLoopExec)
- && m_processEvents.flags & QEventLoop::WaitForMoreEvents) {
- // CoreFoundation does not treat a timer as a reason to exit CFRunLoopRunInMode
- // when asked to only process a single source, so we risk waiting a long time for
- // a 'proper' source to fire (typically a system source that we don't control).
- // To fix this we do an explicit interrupt after processing our timer, so that
- // processEvents() gets a chance to re-evaluate the state of things.
- interrupt();
- }
- emit aboutToBlock();
- break;
- case kCFRunLoopAfterWaiting:
- emit awake();
- break;
-#if DEBUG_EVENT_DISPATCHER
- case kCFRunLoopEntry:
- case kCFRunLoopBeforeTimers:
- case kCFRunLoopBeforeSources:
- case kCFRunLoopExit:
- break;
-#endif
- default:
- Q_UNREACHABLE();
- }
-}
-
-bool QEventDispatcherCoreFoundation::hasPendingEvents()
-{
- // There doesn't seem to be any API on iOS to peek into the other sources
- // to figure out if there are pending non-Qt events. As a workaround, we
- // assume that if the run-loop is currently blocking and waiting for a
- // source to signal then there are no system-events pending. If this
- // function is called from the main thread then the second clause
- // of the condition will always be true, as the run loop is
- // never waiting in that case. The function would be more aptly named
- // 'maybeHasPendingEvents' in our case.
-
- extern uint qGlobalPostedEventsCount();
- return qGlobalPostedEventsCount() || !CFRunLoopIsWaiting(CFRunLoopGetMain());
-}
-
-void QEventDispatcherCoreFoundation::wakeUp()
-{
- if (m_processEvents.processedPostedEvents && !(m_processEvents.flags & QEventLoop::EventLoopExec)) {
- // A manual processEvents call should only result in processing the events posted
- // up until then. Any newly posted events as result of processing existing posted
- // events should be handled in the next call to processEvents(). Since we're using
- // a run-loop source to process our posted events we need to prevent it from being
- // signaled as a result of posting new events, otherwise we end up in an infinite
- // loop. We do however need to signal the source at some point, so that the newly
- // posted event gets processed on the next processEvents() call, so we flag the
- // need to do a deferred wake-up.
- m_processEvents.deferredWakeUp = true;
- qEventDispatcherDebug() << "Already processed posted events, deferring wakeUp";
- return;
- }
-
- m_postedEventsRunLoopSource.signal();
- CFRunLoopWakeUp(CFRunLoopGetMain());
-
- qEventDispatcherDebug() << "Signaled posted event run-loop source";
-}
-
-void QEventDispatcherCoreFoundation::interrupt()
-{
- qEventDispatcherDebug() << "Marking current processEvent as interrupted";
- m_processEvents.wasInterrupted = true;
- CFRunLoopStop(CFRunLoopGetMain());
-}
-
-void QEventDispatcherCoreFoundation::flush()
-{
- // X11 only.
-}
-
-#pragma mark - Socket notifiers
-
-void QEventDispatcherCoreFoundation::registerSocketNotifier(QSocketNotifier *notifier)
-{
- m_cfSocketNotifier.registerSocketNotifier(notifier);
-}
-
-void QEventDispatcherCoreFoundation::unregisterSocketNotifier(QSocketNotifier *notifier)
-{
- m_cfSocketNotifier.unregisterSocketNotifier(notifier);
-}
-
-#pragma mark - Timers
-
-void QEventDispatcherCoreFoundation::registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object)
-{
- qEventDispatcherDebug() << "id = " << timerId << ", interval = " << interval
- << ", type = " << timerType << ", object = " << object;
-
- Q_ASSERT(timerId > 0 && interval >= 0 && object);
- Q_ASSERT(object->thread() == thread() && thread() == QThread::currentThread());
-
- m_timerInfoList.registerTimer(timerId, interval, timerType, object);
- updateTimers();
-}
-
-bool QEventDispatcherCoreFoundation::unregisterTimer(int timerId)
-{
- Q_ASSERT(timerId > 0);
- Q_ASSERT(thread() == QThread::currentThread());
-
- bool returnValue = m_timerInfoList.unregisterTimer(timerId);
-
- qEventDispatcherDebug() << "id = " << timerId << ", timers left: " << m_timerInfoList.size();
-
- updateTimers();
- return returnValue;
-}
-
-bool QEventDispatcherCoreFoundation::unregisterTimers(QObject *object)
-{
- Q_ASSERT(object && object->thread() == thread() && thread() == QThread::currentThread());
-
- bool returnValue = m_timerInfoList.unregisterTimers(object);
-
- qEventDispatcherDebug() << "object = " << object << ", timers left: " << m_timerInfoList.size();
-
- updateTimers();
- return returnValue;
-}
-
-QList<QAbstractEventDispatcher::TimerInfo> QEventDispatcherCoreFoundation::registeredTimers(QObject *object) const
-{
- Q_ASSERT(object);
- return m_timerInfoList.registeredTimers(object);
-}
-
-int QEventDispatcherCoreFoundation::remainingTime(int timerId)
-{
- Q_ASSERT(timerId > 0);
- return m_timerInfoList.timerRemainingTime(timerId);
-}
-
-static double timespecToSeconds(const timespec &spec)
-{
- static double nanosecondsPerSecond = 1.0 * 1000 * 1000 * 1000;
- return spec.tv_sec + (spec.tv_nsec / nanosecondsPerSecond);
-}
-
-void QEventDispatcherCoreFoundation::updateTimers()
-{
- if (m_timerInfoList.size() > 0) {
- // We have Qt timers registered, so create or reschedule CF timer to match
-
- timespec tv = { -1, -1 };
- CFAbsoluteTime timeToFire = m_timerInfoList.timerWait(tv) ?
- // We have a timer ready to fire right now, or some time in the future
- CFAbsoluteTimeGetCurrent() + timespecToSeconds(tv)
- // We have timers, but they are all currently blocked by callbacks
- : kCFTimeIntervalDistantFuture;
-
- if (!m_runLoopTimer) {
- m_runLoopTimer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault,
- timeToFire, kCFTimeIntervalDistantFuture, 0, 0, ^(CFRunLoopTimerRef timer) {
- processTimers(timer);
- });
-
- CFRunLoopAddTimer(CFRunLoopGetMain(), m_runLoopTimer, kCFRunLoopCommonModes);
- qEventDispatcherDebug() << "Created new CFRunLoopTimer " << m_runLoopTimer;
-
- } else {
- CFRunLoopTimerSetNextFireDate(m_runLoopTimer, timeToFire);
- qEventDispatcherDebug() << "Re-scheduled CFRunLoopTimer " << m_runLoopTimer;
- }
-
- m_overdueTimerScheduled = !timespecToSeconds(tv);
-
- qEventDispatcherDebug() << "Next timeout in " << tv << " seconds";
-
- } else {
- // No Qt timers are registered, so make sure we're not running any CF timers
- invalidateTimer();
-
- m_overdueTimerScheduled = false;
- }
-}
-
-void QEventDispatcherCoreFoundation::invalidateTimer()
-{
- if (!m_runLoopTimer || (m_runLoopTimer == m_blockedRunLoopTimer))
- return;
-
- CFRunLoopTimerInvalidate(m_runLoopTimer);
- qEventDispatcherDebug() << "Invalidated CFRunLoopTimer " << m_runLoopTimer;
-
- CFRelease(m_runLoopTimer);
- m_runLoopTimer = 0;
-}
-
-#include "qeventdispatcher_cf.moc"
-#include "moc_qeventdispatcher_cf_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
deleted file mode 100644
index 1cd9ae4ebf..0000000000
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
+++ /dev/null
@@ -1,278 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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$
-**
-****************************************************************************/
-
-/****************************************************************************
-**
-** Copyright (c) 2007-2008, Apple, Inc.
-**
-** All rights reserved.
-**
-** 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 Apple, Inc. 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.
-**
-****************************************************************************/
-
-#ifndef QEVENTDISPATCHER_CF_P_H
-#define QEVENTDISPATCHER_CF_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.
-//
-
-#define DEBUG_EVENT_DISPATCHER 0
-
-#include <QtCore/qabstracteventdispatcher.h>
-#include <QtCore/private/qtimerinfo_unix_p.h>
-#include <QtCore/qdebug.h>
-#include <QtPlatformSupport/private/qcfsocketnotifier_p.h>
-#include <CoreFoundation/CoreFoundation.h>
-
-#ifdef __OBJC__
-@class RunLoopModeTracker;
-#else
-typedef struct objc_object RunLoopModeTracker;
-#endif
-
-QT_BEGIN_NAMESPACE
-
-class QEventDispatcherCoreFoundation;
-
-template <class T = QEventDispatcherCoreFoundation>
-class RunLoopSource
-{
-public:
- typedef void (T::*CallbackFunction) ();
-
- enum { kHighestPriority = 0 } RunLoopSourcePriority;
-
- RunLoopSource(T *delegate, CallbackFunction callback)
- : m_delegate(delegate), m_callback(callback)
- {
- CFRunLoopSourceContext context = {};
- context.info = this;
- context.perform = RunLoopSource::process;
-
- m_source = CFRunLoopSourceCreate(kCFAllocatorDefault, kHighestPriority, &context);
- Q_ASSERT(m_source);
- }
-
- ~RunLoopSource()
- {
- CFRunLoopSourceInvalidate(m_source);
- CFRelease(m_source);
- }
-
- void addToMode(CFStringRef mode, CFRunLoopRef runLoop = 0)
- {
- if (!runLoop)
- runLoop = CFRunLoopGetCurrent();
-
- CFRunLoopAddSource(runLoop, m_source, mode);
- }
-
- void signal() { CFRunLoopSourceSignal(m_source); }
-
-private:
- static void process(void *info)
- {
- RunLoopSource *self = static_cast<RunLoopSource *>(info);
- ((self->m_delegate)->*(self->m_callback))();
- }
-
- T *m_delegate;
- CallbackFunction m_callback;
- CFRunLoopSourceRef m_source;
-};
-
-template <class T = QEventDispatcherCoreFoundation>
-class RunLoopObserver
-{
-public:
- typedef void (T::*CallbackFunction) (CFRunLoopActivity activity);
-
- RunLoopObserver(T *delegate, CallbackFunction callback, CFOptionFlags activities)
- : m_delegate(delegate), m_callback(callback)
- {
- CFRunLoopObserverContext context = {};
- context.info = this;
-
- m_observer = CFRunLoopObserverCreate(kCFAllocatorDefault, activities, true, 0, process, &context);
- Q_ASSERT(m_observer);
- }
-
- ~RunLoopObserver()
- {
- CFRunLoopObserverInvalidate(m_observer);
- CFRelease(m_observer);
- }
-
- void addToMode(CFStringRef mode, CFRunLoopRef runLoop = 0)
- {
- if (!runLoop)
- runLoop = CFRunLoopGetCurrent();
-
- if (!CFRunLoopContainsObserver(runLoop, m_observer, mode))
- CFRunLoopAddObserver(runLoop, m_observer, mode);
- }
-
- void removeFromMode(CFStringRef mode, CFRunLoopRef runLoop = 0)
- {
- if (!runLoop)
- runLoop = CFRunLoopGetCurrent();
-
- if (CFRunLoopContainsObserver(runLoop, m_observer, mode))
- CFRunLoopRemoveObserver(runLoop, m_observer, mode);
- }
-
-private:
- static void process(CFRunLoopObserverRef, CFRunLoopActivity activity, void *info)
- {
- RunLoopObserver *self = static_cast<RunLoopObserver *>(info);
- ((self->m_delegate)->*(self->m_callback))(activity);
- }
-
- T *m_delegate;
- CallbackFunction m_callback;
- CFRunLoopObserverRef m_observer;
-};
-
-class QEventDispatcherCoreFoundation : public QAbstractEventDispatcher
-{
- Q_OBJECT
-
-public:
- explicit QEventDispatcherCoreFoundation(QObject *parent = 0);
- ~QEventDispatcherCoreFoundation();
-
- bool processEvents(QEventLoop::ProcessEventsFlags flags);
- bool hasPendingEvents();
-
- void registerSocketNotifier(QSocketNotifier *notifier);
- void unregisterSocketNotifier(QSocketNotifier *notifier);
-
- void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object);
- bool unregisterTimer(int timerId);
- bool unregisterTimers(QObject *object);
- QList<QAbstractEventDispatcher::TimerInfo> registeredTimers(QObject *object) const;
-
- int remainingTime(int timerId);
-
- void wakeUp();
- void interrupt();
- void flush();
-
-private:
- RunLoopSource<> m_postedEventsRunLoopSource;
- RunLoopObserver<> m_runLoopActivityObserver;
-
- RunLoopModeTracker *m_runLoopModeTracker;
-
- QTimerInfoList m_timerInfoList;
- CFRunLoopTimerRef m_runLoopTimer;
- CFRunLoopTimerRef m_blockedRunLoopTimer;
- bool m_overdueTimerScheduled;
-
- QCFSocketNotifier m_cfSocketNotifier;
-
- struct ProcessEventsState
- {
- ProcessEventsState(QEventLoop::ProcessEventsFlags f)
- : flags(f), wasInterrupted(false)
- , processedPostedEvents(false), processedTimers(false)
- , deferredWakeUp(false), deferredUpdateTimers(false) {}
-
- QEventLoop::ProcessEventsFlags flags;
- bool wasInterrupted;
- bool processedPostedEvents;
- bool processedTimers;
- bool deferredWakeUp;
- bool deferredUpdateTimers;
- };
-
- ProcessEventsState m_processEvents;
-
- void processPostedEvents();
- void processTimers(CFRunLoopTimerRef);
-
- void handleRunLoopActivity(CFRunLoopActivity activity);
-
- void updateTimers();
- void invalidateTimer();
-};
-
-QT_END_NAMESPACE
-
-#if DEBUG_EVENT_DISPATCHER
-extern uint g_eventDispatcherIndentationLevel;
-#define qEventDispatcherDebug() qDebug().nospace() \
- << qPrintable(QString(QLatin1String("| ")).repeated(g_eventDispatcherIndentationLevel)) \
- << __FUNCTION__ << "(): "
-#define qIndent() ++g_eventDispatcherIndentationLevel
-#define qUnIndent() --g_eventDispatcherIndentationLevel
-#else
-#define qEventDispatcherDebug() QT_NO_QDEBUG_MACRO()
-#define qIndent()
-#define qUnIndent()
-#endif
-
-#endif // QEVENTDISPATCHER_CF_P_H
diff --git a/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp
new file mode 100644
index 0000000000..f57d16f51d
--- /dev/null
+++ b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Copyright (C) 2015 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 "qwindowsguieventdispatcher_p.h"
+
+#include <qpa/qwindowsysteminterface.h>
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWindowsGuiEventDispatcher
+ \brief Event dispatcher for Windows
+
+ Maintains a global stack storing the current event dispatcher and
+ its processing flags for access from the Windows procedure
+ qWindowsWndProc. Handling the Lighthouse gui events should be done
+ from within the qWindowsWndProc to ensure correct processing of messages.
+
+ \internal
+ \ingroup qt-lighthouse-win
+*/
+
+QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(QObject *parent) :
+ QEventDispatcherWin32(parent), m_flags(0)
+{
+ setObjectName(QStringLiteral("QWindowsGuiEventDispatcher"));
+ createInternalHwnd(); // QTBUG-40881: Do not delay registering timers, etc. for QtMfc.
+}
+
+bool QWindowsGuiEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
+{
+ const QEventLoop::ProcessEventsFlags oldFlags = m_flags;
+ m_flags = flags;
+ const bool rc = QEventDispatcherWin32::processEvents(flags);
+ m_flags = oldFlags;
+ return rc;
+}
+
+void QWindowsGuiEventDispatcher::sendPostedEvents()
+{
+ QEventDispatcherWin32::sendPostedEvents();
+ QWindowSystemInterface::sendWindowSystemEvents(m_flags);
+}
+
+// Helpers for printing debug output for WM_* messages.
+struct MessageDebugEntry
+{
+ UINT message;
+ const char *description;
+ bool interesting;
+};
+
+static const MessageDebugEntry
+messageDebugEntries[] = {
+ {WM_CREATE, "WM_CREATE", true},
+ {WM_PAINT, "WM_PAINT", true},
+ {WM_CLOSE, "WM_CLOSE", true},
+ {WM_DESTROY, "WM_DESTROY", true},
+ {WM_MOVE, "WM_MOVE", true},
+ {WM_SIZE, "WM_SIZE", true},
+ {WM_GETICON, "WM_GETICON", false},
+ {WM_KEYDOWN, "WM_KEYDOWN", true},
+ {WM_SYSKEYDOWN, "WM_SYSKEYDOWN", true},
+ {WM_SYSCOMMAND, "WM_SYSCOMMAND", true},
+ {WM_KEYUP, "WM_KEYUP", true},
+ {WM_SYSKEYUP, "WM_SYSKEYUP", true},
+#if defined(WM_APPCOMMAND)
+ {WM_APPCOMMAND, "WM_APPCOMMAND", true},
+#endif
+ {WM_IME_CHAR, "WM_IMECHAR", true},
+ {WM_IME_KEYDOWN, "WM_IMECHAR", true},
+ {WM_CANCELMODE, "WM_CANCELMODE", true},
+ {WM_CHAR, "WM_CHAR", true},
+ {WM_DEADCHAR, "WM_DEADCHAR", true},
+ {WM_ACTIVATE, "WM_ACTIVATE", true},
+ {WM_SETFOCUS, "WM_SETFOCUS", true},
+ {WM_KILLFOCUS, "WM_KILLFOCUS", true},
+ {WM_ENABLE, "WM_ENABLE", true},
+ {WM_SHOWWINDOW, "WM_SHOWWINDOW", true},
+ {WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED", true},
+ {WM_SETCURSOR, "WM_SETCURSOR", false},
+ {WM_GETFONT, "WM_GETFONT", true},
+ {WM_LBUTTONDOWN, "WM_LBUTTONDOWN", true},
+ {WM_LBUTTONUP, "WM_LBUTTONUP", true},
+ {WM_LBUTTONDBLCLK, "WM_LBUTTONDBLCLK", true},
+ {WM_RBUTTONDOWN, "WM_RBUTTONDOWN", true},
+ {WM_RBUTTONUP, "WM_RBUTTONUP", true},
+ {WM_RBUTTONDBLCLK, "WM_RBUTTONDBLCLK", true},
+ {WM_MBUTTONDOWN, "WM_MBUTTONDOWN", true},
+ {WM_MBUTTONUP, "WM_MBUTTONUP", true},
+ {WM_MBUTTONDBLCLK, "WM_MBUTTONDBLCLK", true},
+ {WM_MOUSEWHEEL, "WM_MOUSEWHEEL", true},
+ {WM_XBUTTONDOWN, "WM_XBUTTONDOWN", true},
+ {WM_XBUTTONUP, "WM_XBUTTONUP", true},
+ {WM_XBUTTONDBLCLK, "WM_XBUTTONDBLCLK", true},
+ {WM_MOUSEHWHEEL, "WM_MOUSEHWHEEL", true},
+ {WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
+ {WM_INPUTLANGCHANGE, "WM_INPUTLANGCHANGE", true},
+ {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
+#if defined(WM_DWMNCRENDERINGCHANGED)
+ {WM_DWMNCRENDERINGCHANGED, "WM_DWMNCRENDERINGCHANGED", true},
+#endif
+ {WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
+ {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
+ {WM_RENDERFORMAT, "WM_RENDERFORMAT", true},
+ {WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS", true},
+ {WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD", true},
+ {WM_CAPTURECHANGED, "WM_CAPTURECHANGED", true},
+ {WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION", true},
+ {WM_IME_COMPOSITION, "WM_IME_COMPOSITION", true},
+ {WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION", true},
+ {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
+ {WM_IME_REQUEST, "WM_IME_REQUEST", true},
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
+ {WM_QUERYENDSESSION, "WM_QUERYENDSESSION", true},
+ {WM_ENDSESSION, "WM_ENDSESSION", true},
+#endif
+#ifndef Q_OS_WINCE
+ {WM_MOUSEACTIVATE,"WM_MOUSEACTIVATE", true},
+ {WM_CHILDACTIVATE, "WM_CHILDACTIVATE", true},
+ {WM_PARENTNOTIFY, "WM_PARENTNOTIFY", true},
+ {WM_ENTERIDLE, "WM_ENTERIDLE", false},
+ {WM_GETMINMAXINFO, "WM_GETMINMAXINFO", true},
+ {WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
+ {WM_NCCREATE, "WM_NCCREATE", true},
+ {WM_NCCALCSIZE, "WM_NCCALCSIZE", true},
+ {WM_NCACTIVATE, "WM_NCACTIVATE", true},
+ {WM_NCMOUSEMOVE, "WM_NCMOUSEMOVE", true},
+ {WM_NCMOUSELEAVE, "WM_NCMOUSELEAVE", true},
+ {WM_NCLBUTTONDOWN, "WM_NCLBUTTONDOWN", true},
+ {WM_NCLBUTTONUP, "WM_NCLBUTTONUP", true},
+ {WM_ACTIVATEAPP, "WM_ACTIVATEAPP", true},
+ {WM_NCPAINT, "WM_NCPAINT", true},
+ {WM_ERASEBKGND, "WM_ERASEBKGND", true},
+ {WM_MOUSEMOVE, "WM_MOUSEMOVE", true},
+ {WM_MOUSELEAVE, "WM_MOUSELEAVE", true},
+ {WM_NCHITTEST, "WM_NCHITTEST", false},
+#ifdef WM_TOUCH
+ {WM_TOUCH, "WM_TOUCH", true},
+#endif
+ {WM_CHANGECBCHAIN, "WM_CHANGECBCHAIN", true},
+ {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
+ {WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD", true},
+#endif // !Q_OS_WINCE
+ {WM_THEMECHANGED, "WM_THEMECHANGED", true}
+};
+
+static inline const MessageDebugEntry *messageDebugEntry(UINT msg)
+{
+ for (size_t i = 0; i < sizeof(messageDebugEntries)/sizeof(MessageDebugEntry); i++)
+ if (messageDebugEntries[i].message == msg)
+ return messageDebugEntries + i;
+ return 0;
+}
+
+const char *QWindowsGuiEventDispatcher::windowsMessageName(UINT msg)
+{
+ if (const MessageDebugEntry *e = messageDebugEntry(msg))
+ return e->description;
+ return "Unknown";
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
new file mode 100644
index 0000000000..1e9c906cc8
--- /dev/null
+++ b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QWINDOWSGUIEVENTDISPATCHER_H
+#define QWINDOWSGUIEVENTDISPATCHER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of the QLibrary class. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qeventdispatcher_win_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWindowsGuiEventDispatcher : public QEventDispatcherWin32
+{
+ Q_OBJECT
+public:
+ explicit QWindowsGuiEventDispatcher(QObject *parent = 0);
+
+ static const char *windowsMessageName(UINT msg);
+
+ bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
+ void sendPostedEvents() Q_DECL_OVERRIDE;
+
+private:
+ QEventLoop::ProcessEventsFlags m_flags;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWINDOWSGUIEVENTDISPATCHER_H
diff --git a/src/platformsupport/fbconvenience/qfbscreen.cpp b/src/platformsupport/fbconvenience/qfbscreen.cpp
index 566f84c9ea..d00954375d 100644
--- a/src/platformsupport/fbconvenience/qfbscreen.cpp
+++ b/src/platformsupport/fbconvenience/qfbscreen.cpp
@@ -206,10 +206,11 @@ void QFbScreen::generateRects()
}
#endif
}
- foreach (const QRect &rect, remainingScreen.rects())
+ const QVector<QRect> remainingScreenRects = remainingScreen.rects();
+ mCachedRects.reserve(mCachedRects.count() + remainingScreenRects.count());
+ foreach (const QRect &rect, remainingScreenRects)
mCachedRects += QPair<QRect, int>(rect, -1);
mIsUpToDate = true;
- return;
}
QRegion QFbScreen::doRedraw()
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index c46e470c34..5e062b3f0a 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -79,87 +79,79 @@ static void setTTYCursor(bool enable)
}
#endif
+#ifdef VTH_ENABLED
+static QFbVtHandler *vth;
+
+void QFbVtHandler::signalHandler(int sigNo)
+{
+ char a = sigNo;
+ QT_WRITE(vth->m_sigFd[0], &a, sizeof(a));
+}
+#endif
+
QFbVtHandler::QFbVtHandler(QObject *parent)
: QObject(parent),
m_tty(-1),
- m_signalFd(-1),
m_signalNotifier(0)
{
#ifdef VTH_ENABLED
- setTTYCursor(false);
-
- if (isatty(0)) {
+ if (isatty(0))
m_tty = 0;
- ioctl(m_tty, KDGKBMODE, &m_oldKbdMode);
- if (!qEnvironmentVariableIntValue("QT_QPA_ENABLE_TERMINAL_KEYBOARD")) {
- // Disable the tty keyboard.
- ioctl(m_tty, KDSKBMUTE, 1);
- ioctl(m_tty, KDSKBMODE, KBD_OFF_MODE);
- }
+ if (::socketpair(AF_UNIX, SOCK_STREAM, 0, m_sigFd)) {
+ qErrnoWarning(errno, "QFbVtHandler: socketpair() failed");
+ return;
}
- // SIGSEGV and such cannot safely be blocked. We cannot handle them in an
- // async-safe manner either. Restoring the keyboard, video mode, etc. may
- // all contain calls that cannot safely be made from a signal handler.
-
- // Other signals: block them and use signalfd.
- sigset_t mask;
- sigemptyset(&mask);
-
- // Catch Ctrl+C.
- sigaddset(&mask, SIGINT);
-
- // Ctrl+Z. Up to the platform plugins to handle it in a meaningful way.
- sigaddset(&mask, SIGTSTP);
- sigaddset(&mask, SIGCONT);
-
- // Default signal used by kill. To overcome the common issue of no cleaning
- // up when killing a locally started app via a remote session.
- sigaddset(&mask, SIGTERM);
-
- m_signalFd = signalfd(-1, &mask, SFD_CLOEXEC);
- if (m_signalFd < 0) {
- qErrnoWarning(errno, "signalfd() failed");
- } else {
- m_signalNotifier = new QSocketNotifier(m_signalFd, QSocketNotifier::Read, this);
- connect(m_signalNotifier, &QSocketNotifier::activated, this, &QFbVtHandler::handleSignal);
-
- // Block the signals that are handled via signalfd. Applies only to the current
- // thread, but new threads will inherit the creator's signal mask.
- pthread_sigmask(SIG_BLOCK, &mask, 0);
- }
+ vth = this;
+ setTTYCursor(false);
+ setKeyboardEnabled(false);
+
+ m_signalNotifier = new QSocketNotifier(m_sigFd[1], QSocketNotifier::Read, this);
+ connect(m_signalNotifier, &QSocketNotifier::activated, this, &QFbVtHandler::handleSignal);
+
+ struct sigaction sa;
+ sa.sa_flags = 0;
+ sa.sa_handler = signalHandler;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGINT, &sa, 0); // Ctrl+C
+ sigaction(SIGTSTP, &sa, 0); // Ctrl+Z
+ sigaction(SIGCONT, &sa, 0);
+ sigaction(SIGTERM, &sa, 0); // default signal used by kill
#endif
}
QFbVtHandler::~QFbVtHandler()
{
#ifdef VTH_ENABLED
- restoreKeyboard();
+ setKeyboardEnabled(true);
setTTYCursor(true);
- if (m_signalFd != -1)
- close(m_signalFd);
+ if (m_signalNotifier) {
+ close(m_sigFd[0]);
+ close(m_sigFd[1]);
+ }
#endif
}
-void QFbVtHandler::restoreKeyboard()
+void QFbVtHandler::setKeyboardEnabled(bool enable)
{
#ifdef VTH_ENABLED
if (m_tty == -1)
return;
- ioctl(m_tty, KDSKBMUTE, 0);
- ioctl(m_tty, KDSKBMODE, m_oldKbdMode);
-#endif
-}
-
-// To be called from the slot connected to suspendRequested() in case the
-// platform plugin does in fact allow suspending on Ctrl+Z.
-void QFbVtHandler::suspend()
-{
-#ifdef VTH_ENABLED
- kill(getpid(), SIGSTOP);
+ if (enable) {
+ ::ioctl(m_tty, KDSKBMUTE, 0);
+ ::ioctl(m_tty, KDSKBMODE, m_oldKbdMode);
+ } else {
+ ::ioctl(m_tty, KDGKBMODE, &m_oldKbdMode);
+ if (!qEnvironmentVariableIntValue("QT_QPA_ENABLE_TERMINAL_KEYBOARD")) {
+ ::ioctl(m_tty, KDSKBMUTE, 1);
+ ::ioctl(m_tty, KDSKBMODE, KBD_OFF_MODE);
+ }
+ }
+#else
+ Q_UNUSED(enable);
#endif
}
@@ -168,17 +160,22 @@ void QFbVtHandler::handleSignal()
#ifdef VTH_ENABLED
m_signalNotifier->setEnabled(false);
- signalfd_siginfo sig;
- if (read(m_signalFd, &sig, sizeof(sig)) == sizeof(sig)) {
- switch (sig.ssi_signo) {
+ char sigNo;
+ if (QT_READ(m_sigFd[1], &sigNo, sizeof(sigNo)) == sizeof(sigNo)) {
+ switch (sigNo) {
case SIGINT: // fallthrough
case SIGTERM:
handleInt();
break;
case SIGTSTP:
- emit suspendRequested();
+ emit aboutToSuspend();
+ setKeyboardEnabled(true);
+ setTTYCursor(true);
+ ::kill(getpid(), SIGSTOP);
break;
case SIGCONT:
+ setTTYCursor(false);
+ setKeyboardEnabled(false);
emit resumed();
break;
default:
@@ -194,7 +191,7 @@ void QFbVtHandler::handleInt()
{
#ifdef VTH_ENABLED
emit interrupted();
- restoreKeyboard();
+ setKeyboardEnabled(true);
setTTYCursor(true);
_exit(1);
#endif
diff --git a/src/platformsupport/fbconvenience/qfbvthandler_p.h b/src/platformsupport/fbconvenience/qfbvthandler_p.h
index 3681def9f0..91eba248fe 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler_p.h
+++ b/src/platformsupport/fbconvenience/qfbvthandler_p.h
@@ -59,23 +59,22 @@ public:
QFbVtHandler(QObject *parent = 0);
~QFbVtHandler();
- void suspend();
-
signals:
void interrupted();
- void suspendRequested();
+ void aboutToSuspend();
void resumed();
private slots:
void handleSignal();
private:
- void restoreKeyboard();
+ void setKeyboardEnabled(bool enable);
void handleInt();
+ static void signalHandler(int sigNo);
int m_tty;
int m_oldKbdMode;
- int m_signalFd;
+ int m_sigFd[2];
QSocketNotifier *m_signalNotifier;
};
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
index c41061a9fd..728b166b71 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
@@ -76,24 +76,6 @@ void QBasicFontDatabase::populateFontDatabase()
}
}
-inline static void setHintingPreference(QFontEngine *engine, QFont::HintingPreference hintingPreference)
-{
- switch (hintingPreference) {
- case QFont::PreferNoHinting:
- engine->setDefaultHintStyle(QFontEngineFT::HintNone);
- break;
- case QFont::PreferFullHinting:
- engine->setDefaultHintStyle(QFontEngineFT::HintFull);
- break;
- case QFont::PreferVerticalHinting:
- engine->setDefaultHintStyle(QFontEngineFT::HintLight);
- break;
- case QFont::PreferDefaultHinting:
- // Leave it as it is
- break;
- }
-}
-
QFontEngine *QBasicFontDatabase::fontEngine(const QFontDef &fontDef, void *usrPtr)
{
FontFile *fontfile = static_cast<FontFile *> (usrPtr);
@@ -119,7 +101,7 @@ QFontEngine *QBasicFontDatabase::fontEngine(const QFontDef &fontDef, void *usrPt
delete engine;
engine = 0;
} else {
- setHintingPreference(engine, static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
+ engine->setQtDefaultHintStyle(static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
}
return engine;
@@ -172,7 +154,7 @@ QFontEngine *QBasicFontDatabase::fontEngine(const QByteArray &fontData, qreal pi
}
fe->updateFamilyNameAndStyle();
- setHintingPreference(fe, hintingPreference);
+ fe->setQtDefaultHintStyle(static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
return fe;
}
@@ -206,7 +188,7 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
error = FT_New_Face(library, file.constData(), index, &face);
}
if (error != FT_Err_Ok) {
- qDebug() << "FT_New_Face failed with index" << index << ":" << hex << error;
+ qDebug() << "FT_New_Face failed with index" << index << ':' << hex << error;
break;
}
numFaces = face->num_faces;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 112bb8e0a6..a5fe88871d 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -44,6 +44,7 @@
#include <QtGui/private/qfontengine_ft_p.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qguiapplication.h>
@@ -241,7 +242,13 @@ static const char *specialLanguages[] = {
"sa", // Siddham
"sd", // Khudawadi
"mai", // Tirhuta
- "hoc" // WarangCiti
+ "hoc", // WarangCiti
+ "", // Ahom
+ "", // AnatolianHieroglyphs
+ "", // Hatran
+ "", // Multani
+ "", // OldHungarian
+ "" // SignWriting
};
Q_STATIC_ASSERT(sizeof(specialLanguages) / sizeof(const char *) == QChar::ScriptCount);
@@ -553,10 +560,8 @@ QFontEngine::HintStyle defaultHintStyleFromMatch(QFont::HintingPreference hintin
break;
}
- if (QGuiApplication::platformNativeInterface()->nativeResourceForScreen("nofonthinting",
- QGuiApplication::primaryScreen())) {
+ if (QHighDpiScaling::isActive())
return QFontEngine::HintNone;
- }
int hint_style = 0;
if (FcPatternGetInteger (match, FC_HINT_STYLE, 0, &hint_style) == FcResultMatch) {
@@ -711,15 +716,19 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString &family, QFont
FcPatternDestroy(pattern);
if (fontSet) {
+ QSet<QString> duplicates;
+ duplicates.reserve(fontSet->nfont + 1);
+ duplicates.insert(family.toCaseFolded());
for (int i = 0; i < fontSet->nfont; i++) {
FcChar8 *value = 0;
if (FcPatternGetString(fontSet->fonts[i], FC_FAMILY, 0, &value) != FcResultMatch)
continue;
// capitalize(value);
- QString familyName = QString::fromUtf8((const char *)value);
- if (!fallbackFamilies.contains(familyName,Qt::CaseInsensitive) &&
- familyName.compare(family, Qt::CaseInsensitive)) {
+ const QString familyName = QString::fromUtf8((const char *)value);
+ const QString familyNameCF = familyName.toCaseFolded();
+ if (!duplicates.contains(familyNameCF)) {
fallbackFamilies << familyName;
+ duplicates.insert(familyNameCF);
}
}
FcFontSetDestroy(fontSet);
diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri
index f67f00672a..ebb64d15b4 100644
--- a/src/platformsupport/fontdatabases/mac/coretext.pri
+++ b/src/platformsupport/fontdatabases/mac/coretext.pri
@@ -1,6 +1,13 @@
HEADERS += $$PWD/qcoretextfontdatabase_p.h $$PWD/qfontengine_coretext_p.h
OBJECTIVE_SOURCES += $$PWD/qfontengine_coretext.mm $$PWD/qcoretextfontdatabase.mm
+contains(QT_CONFIG, freetype) {
+ include($$QT_SOURCE_TREE/src/3rdparty/freetype_dependency.pri)
+ HEADERS += $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft_p.h
+ SOURCES += $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft.cpp
+ CONFIG += opentype
+}
+
ios: \
# On iOS CoreText and CoreGraphics are stand-alone frameworks
LIBS_PRIVATE += -framework CoreText -framework CoreGraphics
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index be70092010..0af779097c 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -33,6 +33,8 @@
#include "qglobal.h"
+#include <sys/param.h>
+
#if defined(Q_OS_MACX)
#import <Cocoa/Cocoa.h>
#import <IOKit/graphics/IOGraphicsLib.h>
@@ -43,23 +45,13 @@
#include "qcoretextfontdatabase_p.h"
#include "qfontengine_coretext_p.h"
#include <QtCore/QSettings>
-#include <QtGui/QGuiApplication>
#include <QtCore/QtEndian>
+#ifndef QT_NO_FREETYPE
+#include <QtGui/private/qfontengine_ft_p.h>
+#endif
QT_BEGIN_NAMESPACE
-namespace {
-class AutoReleasePool
-{
-public:
- AutoReleasePool(): pool([[NSAutoreleasePool alloc] init]) {}
- ~AutoReleasePool() { [pool release]; }
-
-private:
- NSAutoreleasePool *pool;
-};
-}
-
// this could become a list of all languages used for each writing
// system, instead of using the single most common language.
static const char *languageForWritingSystem[] = {
@@ -114,8 +106,12 @@ static NSInteger languageMapSort(id obj1, id obj2, void *context)
}
#endif
-QCoreTextFontDatabase::QCoreTextFontDatabase()
+QCoreTextFontDatabase::QCoreTextFontDatabase(bool useFreeType)
+#ifndef QT_NO_FREETYPE
+ : m_useFreeType(useFreeType)
+#endif
{
+ Q_UNUSED(useFreeType)
#ifdef Q_OS_MACX
QSettings appleSettings(QLatin1String("apple.com"));
QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
@@ -360,22 +356,56 @@ void QCoreTextFontDatabase::releaseHandle(void *handle)
CFRelease(CTFontDescriptorRef(handle));
}
+#ifndef QT_NO_FREETYPE
+static QByteArray filenameForCFUrl(CFURLRef url)
+{
+ // The on-stack buffer prevents that a QByteArray allocated for the worst case (MAXPATHLEN)
+ // stays around for the lifetime of the font. Additionally, it helps to move the char
+ // signedness cast to an acceptable place.
+ uchar buffer[MAXPATHLEN];
+ QByteArray filename;
+
+ if (!CFURLGetFileSystemRepresentation(url, true, buffer, sizeof(buffer))) {
+ qWarning("QCoreTextFontDatabase::filenameForCFUrl: could not resolve file for URL %s",
+ qPrintable(QString::fromCFString(CFURLGetString(url))));
+ } else {
+ QCFType<CFStringRef> scheme = CFURLCopyScheme(url);
+ if (QString::fromCFString(scheme) == QLatin1String("qrc"))
+ filename = ":";
+
+ filename += reinterpret_cast<char *>(buffer);
+ }
+
+ return filename;
+}
+#endif
+
extern CGAffineTransform qt_transform_from_fontdef(const QFontDef &fontDef);
QFontEngine *QCoreTextFontDatabase::fontEngine(const QFontDef &f, void *usrPtr)
{
- qreal scaledPointSize = f.pixelSize;
+ CTFontDescriptorRef descriptor = static_cast<CTFontDescriptorRef>(usrPtr);
+
+#ifndef QT_NO_FREETYPE
+ if (m_useFreeType) {
+ QCFType<CFURLRef> url(static_cast<CFURLRef>(CTFontDescriptorCopyAttribute(descriptor, kCTFontURLAttribute)));
- // When 96 DPI is forced, the Mac plugin will use DPI 72 for some
- // fonts (hardcoded in qcocoaintegration.mm) and 96 for others. This
- // discrepancy makes it impossible to find the correct point size
- // here without having the DPI used for the font. Until a proper
- // solution (requiring API change) can be made, we simply fall back
- // to passing in the point size to retain old behavior.
- if (QGuiApplication::testAttribute(Qt::AA_Use96Dpi))
- scaledPointSize = f.pointSize;
+ QByteArray filename;
+ if (url)
+ filename = filenameForCFUrl(url);
+
+ return freeTypeFontEngine(f, filename);
+ }
+#endif
+
+ // Since we do not pass in the destination DPI to CoreText when making
+ // the font, we need to pass in a point size which is scaled to include
+ // the DPI. The default DPI for the screen is 72, thus the scale factor
+ // is destinationDpi / 72, but since pixelSize = pointSize / 72 * dpi,
+ // the pixelSize is actually the scaled point size for the destination
+ // DPI, and we can use that directly.
+ qreal scaledPointSize = f.pixelSize;
- CTFontDescriptorRef descriptor = (CTFontDescriptorRef) usrPtr;
CGAffineTransform matrix = qt_transform_from_fontdef(f);
CTFontRef font = CTFontCreateWithFontDescriptor(descriptor, scaledPointSize, &matrix);
if (font) {
@@ -397,6 +427,29 @@ static void releaseFontData(void* info, const void* data, size_t size)
QFontEngine *QCoreTextFontDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
{
+#ifndef QT_NO_FREETYPE
+ if (m_useFreeType) {
+ QByteArray *fontDataCopy = new QByteArray(fontData);
+ QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(fontDataCopy,
+ fontDataCopy->constData(), fontDataCopy->size(), releaseFontData);
+ QCFType<CGFontRef> cgFont(CGFontCreateWithDataProvider(dataProvider));
+
+ if (!cgFont) {
+ qWarning("QCoreTextFontDatabase::fontEngine: CGFontCreateWithDataProvider failed");
+ return Q_NULLPTR;
+ }
+
+ QFontDef fontDef;
+ fontDef.pixelSize = pixelSize;
+ fontDef.pointSize = pixelSize * 72.0 / qt_defaultDpi();
+ fontDef.hintingPreference = hintingPreference;
+ CGAffineTransform transform = qt_transform_from_fontdef(fontDef);
+ QCFType<CTFontRef> ctFont(CTFontCreateWithGraphicsFont(cgFont, fontDef.pixelSize, &transform, Q_NULLPTR));
+ QCFType<CFURLRef> url(static_cast<CFURLRef>(CTFontCopyAttribute(ctFont, kCTFontURLAttribute)));
+ return freeTypeFontEngine(fontDef, filenameForCFUrl(url), fontData);
+ }
+#endif
+
Q_UNUSED(hintingPreference);
QByteArray* fontDataCopy = new QByteArray(fontData);
@@ -453,7 +506,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
Q_UNUSED(style);
Q_UNUSED(script);
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
static QHash<QString, QStringList> fallbackLists;
@@ -568,10 +621,36 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
}
#if HAVE_CORETEXT
-static CFArrayRef createDescriptorArrayForFont(CTFontRef font)
+static CFArrayRef createDescriptorArrayForFont(CTFontRef font, const QString &fileName = QString())
{
CFMutableArrayRef array = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
- CFArrayAppendValue(array, QCFType<CTFontDescriptorRef>(CTFontCopyFontDescriptor(font)));
+ QCFType<CTFontDescriptorRef> descriptor = CTFontCopyFontDescriptor(font);
+
+ Q_UNUSED(fileName)
+#ifndef QT_NO_FREETYPE
+ // The physical font source URL (usually a local file or Qt resource) is only required for
+ // FreeType, when using non-system fonts, and needs some hackery to attach in a format
+ // agreeable to OSX.
+ if (!fileName.isEmpty()) {
+ QCFType<CFURLRef> fontURL;
+
+ if (fileName.startsWith(QLatin1String(":/"))) {
+ // QUrl::fromLocalFile() doesn't accept qrc pseudo-paths like ":/fonts/myfont.ttf".
+ // Therefore construct from QString with the qrc:// scheme -> "qrc:///fonts/myfont.ttf".
+ fontURL = QUrl(QStringLiteral("qrc://") + fileName.mid(1)).toCFURL();
+ } else if (!fileName.isEmpty()) {
+ // At this point we hope that filename is in a format that QUrl can handle.
+ fontURL = QUrl::fromLocalFile(fileName).toCFURL();
+ }
+
+ QCFType<CFMutableDictionaryRef> attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 1,
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFDictionaryAddValue(attributes, kCTFontURLAttribute, fontURL);
+ descriptor = CTFontDescriptorCreateCopyWithAttributes(descriptor, attributes);
+ }
+#endif
+
+ CFArrayAppendValue(array, descriptor);
return array;
}
#endif
@@ -592,7 +671,11 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData
if (cgFont) {
if (CTFontManagerRegisterGraphicsFont(cgFont, &error)) {
QCFType<CTFontRef> font = CTFontCreateWithGraphicsFont(cgFont, 0.0, NULL, NULL);
- fonts = createDescriptorArrayForFont(font);
+ fonts = createDescriptorArrayForFont(font
+#ifndef QT_NO_FREETYPE
+ , m_useFreeType ? fileName : QString()
+#endif
+ );
m_applicationFonts.append(QVariant::fromValue(QCFType<CGFontRef>::constructFromGet(cgFont)));
}
}
@@ -638,8 +721,8 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData
kATSOptionFlagsDefault, &fontContainer);
} else {
FSRef ref;
- OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref);
- if (qt_mac_create_fsref(fileName, &ref) != noErr)
+ if (FSPathMakeRef(reinterpret_cast<const UInt8 *>(fileName.toUtf8().constData()),
+ &ref, 0) != noErr)
return QStringList();
e = ATSFontActivateFromFileReference(&ref, kATSFontContextLocal, kATSFontFormatUnspecified, 0,
kATSOptionFlagsDefault, &fontContainer);
@@ -892,5 +975,36 @@ void QCoreTextFontDatabase::removeApplicationFonts()
#endif
}
+#ifndef QT_NO_FREETYPE
+QFontEngine *QCoreTextFontDatabase::freeTypeFontEngine(const QFontDef &fontDef, const QByteArray &filename,
+ const QByteArray &fontData)
+{
+ QFontEngine::FaceId faceId;
+ faceId.filename = filename;
+ const bool antialias = !(fontDef.styleStrategy & QFont::NoAntialias);
+
+ QScopedPointer<QFontEngineFT> engine(new QFontEngineFT(fontDef));
+ QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_Mono;
+ if (antialias) {
+ QFontEngine::SubpixelAntialiasingType subpixelType = subpixelAntialiasingTypeHint();
+ if (subpixelType == QFontEngine::Subpixel_None || (fontDef.styleStrategy & QFont::NoSubpixelAntialias)) {
+ format = QFontEngineFT::Format_A8;
+ engine->subpixelType = QFontEngine::Subpixel_None;
+ } else {
+ format = QFontEngineFT::Format_A32;
+ engine->subpixelType = subpixelType;
+ }
+ }
+
+ if (!engine->init(faceId, antialias, format, fontData) || engine->invalid()) {
+ qWarning() << "QCoreTextFontDatabase::freeTypefontEngine Failed to create engine";
+ return Q_NULLPTR;
+ }
+ engine->setQtDefaultHintStyle(static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
+
+ return engine.take();
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index a423ed5ae2..95af1210b3 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
class QCoreTextFontDatabase : public QPlatformFontDatabase
{
public:
- QCoreTextFontDatabase();
+ QCoreTextFontDatabase(bool useFreeType = false);
~QCoreTextFontDatabase();
void populateFontDatabase() Q_DECL_OVERRIDE;
void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
@@ -95,6 +95,11 @@ public:
private:
void populateFromDescriptor(CTFontDescriptorRef font);
+#ifndef QT_NO_FREETYPE
+ bool m_useFreeType;
+ QFontEngine *freeTypeFontEngine(const QFontDef &fontDef, const QByteArray &filename,
+ const QByteArray &fontData = QByteArray());
+#endif
mutable QString defaultFontName;
void removeApplicationFonts();
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 7e1dfd9275..732aead62a 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -361,16 +361,6 @@ qreal QCoreTextFontEngine::maxCharWidth() const
return bb.xoff.toReal();
}
-qreal QCoreTextFontEngine::minLeftBearing() const
-{
- return 0;
-}
-
-qreal QCoreTextFontEngine::minRightBearing() const
-{
- return 0;
-}
-
void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight)
{
QVarLengthArray<QFixedPoint> positions;
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index f8ec1d326f..1c33ae7d84 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -96,8 +96,6 @@ public:
QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE;
QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- qreal minRightBearing() const Q_DECL_OVERRIDE;
- qreal minLeftBearing() const Q_DECL_OVERRIDE;
QFixed emSquareSize() const Q_DECL_OVERRIDE;
bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE;
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 2e9723329e..76d8aab8f2 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -43,6 +43,7 @@
#include <qplatformdefs.h>
#include <private/qcore_unix_p.h> // overrides QT_OPEN
+#include <private/qhighdpiscaling_p.h>
#include <errno.h>
@@ -141,14 +142,15 @@ bool QEvdevMouseHandler::getHardwareMaximum()
m_hardwareHeight = absInfo.maximum - absInfo.minimum;
- QRect g = QGuiApplication::primaryScreen()->virtualGeometry();
+ QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ QRect g = QHighDpi::toNativePixels(primaryScreen->virtualGeometry(), primaryScreen);
m_hardwareScalerX = static_cast<qreal>(m_hardwareWidth) / (g.right() - g.left());
m_hardwareScalerY = static_cast<qreal>(m_hardwareHeight) / (g.bottom() - g.top());
qCDebug(qLcEvdevMouse) << "Absolute pointing device"
<< "hardware max x" << m_hardwareWidth
<< "hardware max y" << m_hardwareHeight
- << "hardware scalers x" << m_hardwareScalerX << "y" << m_hardwareScalerY;
+ << "hardware scalers x" << m_hardwareScalerX << 'y' << m_hardwareScalerY;
return true;
}
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 805397f021..68db0b26ba 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -41,6 +41,7 @@
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
#include <private/qguiapplication_p.h>
#include <private/qinputdevicemanager_p_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -106,7 +107,8 @@ QEvdevMouseManager::~QEvdevMouseManager()
void QEvdevMouseManager::clampPosition()
{
// clamp to screen geometry
- QRect g = QGuiApplication::primaryScreen()->virtualGeometry();
+ QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ QRect g = QHighDpi::toNativePixels(primaryScreen->virtualGeometry(), primaryScreen);
if (m_x + m_xoffset < g.left())
m_x = g.left() - m_xoffset;
else if (m_x + m_xoffset > g.right())
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablet.cpp b/src/platformsupport/input/evdevtablet/qevdevtablet.cpp
index c59f0f390a..c6f952c64d 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablet.cpp
+++ b/src/platformsupport/input/evdevtablet/qevdevtablet.cpp
@@ -292,7 +292,7 @@ void QEvdevTabletHandler::readData()
QEvdevTabletHandlerThread::QEvdevTabletHandlerThread(const QString &spec, QObject *parent)
- : QThread(parent), m_spec(spec), m_handler(0)
+ : QDaemonThread(parent), m_spec(spec), m_handler(0)
{
start();
}
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
index f9682290d9..f546f9a88a 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
@@ -48,6 +48,7 @@
#include <QObject>
#include <QString>
#include <QThread>
+#include <QtCore/private/qthread_p.h>
QT_BEGIN_NAMESPACE
@@ -68,7 +69,7 @@ private:
QEvdevTabletData *d;
};
-class QEvdevTabletHandlerThread : public QThread
+class QEvdevTabletHandlerThread : public QDaemonThread
{
public:
explicit QEvdevTabletHandlerThread(const QString &spec, QObject *parent = 0);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 885326e512..ad348cc083 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -38,6 +38,7 @@
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <linux/input.h>
@@ -106,9 +107,8 @@ public:
int m_currentSlot;
int findClosestContact(const QHash<int, Contact> &contacts, int x, int y, int *dist);
- void reportPoints();
- void registerDevice();
void addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates);
+ void reportPoints();
int hw_range_x_min;
int hw_range_x_max;
@@ -118,7 +118,6 @@ public:
int hw_pressure_max;
QString hw_name;
bool m_forceToActiveWindow;
- QTouchDevice *m_device;
bool m_typeB;
QTransform m_rotate;
bool m_singleTouch;
@@ -131,23 +130,11 @@ QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, co
hw_range_x_min(0), hw_range_x_max(0),
hw_range_y_min(0), hw_range_y_max(0),
hw_pressure_min(0), hw_pressure_max(0),
- m_device(0), m_typeB(false), m_singleTouch(false)
+ m_typeB(false), m_singleTouch(false)
{
m_forceToActiveWindow = args.contains(QLatin1String("force_window"));
}
-void QEvdevTouchScreenData::registerDevice()
-{
- m_device = new QTouchDevice;
- m_device->setName(hw_name);
- m_device->setType(QTouchDevice::TouchScreen);
- m_device->setCapabilities(QTouchDevice::Position | QTouchDevice::Area);
- if (hw_pressure_max > hw_pressure_min)
- m_device->setCapabilities(m_device->capabilities() | QTouchDevice::Pressure);
-
- QWindowSystemInterface::registerTouchDevice(m_device);
-}
-
#define LONG_BITS (sizeof(long) << 3)
#define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS)
@@ -159,9 +146,9 @@ static inline bool testBit(long bit, const long *array)
#endif
QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent)
- : QObject(parent), m_notify(0), m_fd(-1), d(0)
+ : QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR)
#if !defined(QT_NO_MTDEV)
- , m_mtdev(0)
+ , m_mtdev(Q_NULLPTR)
#endif
{
setObjectName(QLatin1String("Evdev Touch Handler"));
@@ -298,7 +285,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
if (inverty)
d->m_rotate *= QTransform::fromTranslate(0.5, 0.5).scale(1.0, -1.0).translate(-0.5, -0.5);
- d->registerDevice();
+ registerTouchDevice();
}
QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler()
@@ -314,6 +301,13 @@ QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler()
QT_CLOSE(m_fd);
delete d;
+
+ unregisterTouchDevice();
+}
+
+QTouchDevice *QEvdevTouchScreenHandler::touchDevice() const
+{
+ return m_device;
}
void QEvdevTouchScreenHandler::readData()
@@ -367,15 +361,44 @@ err:
qErrnoWarning(errno, "evdevtouch: Could not read from input device");
if (errno == ENODEV) { // device got disconnected -> stop reading
delete m_notify;
- m_notify = 0;
+ m_notify = Q_NULLPTR;
+
QT_CLOSE(m_fd);
m_fd = -1;
+
+ unregisterTouchDevice();
}
return;
}
}
}
+void QEvdevTouchScreenHandler::registerTouchDevice()
+{
+ if (m_device)
+ return;
+
+ m_device = new QTouchDevice;
+ m_device->setName(d->hw_name);
+ m_device->setType(QTouchDevice::TouchScreen);
+ m_device->setCapabilities(QTouchDevice::Position | QTouchDevice::Area);
+ if (d->hw_pressure_max > d->hw_pressure_min)
+ m_device->setCapabilities(m_device->capabilities() | QTouchDevice::Pressure);
+
+ QWindowSystemInterface::registerTouchDevice(m_device);
+}
+
+void QEvdevTouchScreenHandler::unregisterTouchDevice()
+{
+ if (!m_device)
+ return;
+
+ QWindowSystemInterface::unregisterTouchDevice(m_device);
+
+ delete m_device;
+ m_device = Q_NULLPTR;
+}
+
void QEvdevTouchScreenData::addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates)
{
QWindowSystemInterface::TouchPoint tp;
@@ -418,11 +441,11 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
m_currentData.y = qBound(hw_range_y_min, data->value, hw_range_y_max);
if (m_singleTouch)
m_contacts[m_currentSlot].y = m_currentData.y;
- if (m_typeB) {
- m_contacts[m_currentSlot].y = m_currentData.y;
- if (m_contacts[m_currentSlot].state == Qt::TouchPointStationary)
- m_contacts[m_currentSlot].state = Qt::TouchPointMoved;
- }
+ if (m_typeB) {
+ m_contacts[m_currentSlot].y = m_currentData.y;
+ if (m_contacts[m_currentSlot].state == Qt::TouchPointStationary)
+ m_contacts[m_currentSlot].state = Qt::TouchPointMoved;
+ }
} else if (data->code == ABS_MT_TRACKING_ID) {
m_currentData.trackingId = data->value;
if (m_typeB) {
@@ -604,9 +627,10 @@ void QEvdevTouchScreenData::reportPoints()
QWindow *win = QGuiApplication::focusWindow();
if (!win)
return;
- winRect = win->geometry();
+ winRect = QHighDpi::toNativePixels(win->geometry(), win);
} else {
- winRect = QGuiApplication::primaryScreen()->geometry();
+ QScreen *primary = QGuiApplication::primaryScreen();
+ winRect = QHighDpi::toNativePixels(primary->geometry(), primary);
}
const int hw_w = hw_range_x_max - hw_range_x_min;
@@ -637,12 +661,12 @@ void QEvdevTouchScreenData::reportPoints()
tp.pressure = (tp.pressure - hw_pressure_min) / qreal(hw_pressure_max - hw_pressure_min);
}
- QWindowSystemInterface::handleTouchEvent(0, m_device, m_touchPoints);
+ QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, q->touchDevice(), m_touchPoints);
}
QEvdevTouchScreenHandlerThread::QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent)
- : QThread(parent), m_device(device), m_spec(spec), m_handler(0)
+ : QDaemonThread(parent), m_device(device), m_spec(spec), m_handler(Q_NULLPTR), m_touchDeviceRegistered(false)
{
start();
}
@@ -656,9 +680,24 @@ QEvdevTouchScreenHandlerThread::~QEvdevTouchScreenHandlerThread()
void QEvdevTouchScreenHandlerThread::run()
{
m_handler = new QEvdevTouchScreenHandler(m_device, m_spec);
+ // Report the registration to the parent thread by invoking the method asynchronously
+ QMetaObject::invokeMethod(this, "notifyTouchDeviceRegistered", Qt::QueuedConnection);
+
exec();
+
delete m_handler;
- m_handler = 0;
+ m_handler = Q_NULLPTR;
+}
+
+bool QEvdevTouchScreenHandlerThread::isTouchDeviceRegistered() const
+{
+ return m_touchDeviceRegistered;
+}
+
+void QEvdevTouchScreenHandlerThread::notifyTouchDeviceRegistered()
+{
+ m_touchDeviceRegistered = true;
+ emit touchDeviceRegistered();
}
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
index a6d3a860f5..ca9756d5de 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
@@ -49,6 +49,7 @@
#include <QString>
#include <QList>
#include <QThread>
+#include <QtCore/private/qthread_p.h>
#include <qpa/qwindowsysteminterface.h>
#if !defined(QT_NO_MTDEV)
@@ -65,33 +66,47 @@ class QEvdevTouchScreenHandler : public QObject
Q_OBJECT
public:
- explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = 0);
+ explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = Q_NULLPTR);
~QEvdevTouchScreenHandler();
+ QTouchDevice *touchDevice() const;
+
private slots:
void readData();
private:
+ void registerTouchDevice();
+ void unregisterTouchDevice();
+
QSocketNotifier *m_notify;
int m_fd;
QEvdevTouchScreenData *d;
+ QTouchDevice *m_device;
#if !defined(QT_NO_MTDEV)
mtdev *m_mtdev;
#endif
};
-class QEvdevTouchScreenHandlerThread : public QThread
+class QEvdevTouchScreenHandlerThread : public QDaemonThread
{
+ Q_OBJECT
public:
- explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = 0);
+ explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = Q_NULLPTR);
~QEvdevTouchScreenHandlerThread();
void run() Q_DECL_OVERRIDE;
- QEvdevTouchScreenHandler *handler() { return m_handler; }
+
+ bool isTouchDeviceRegistered() const;
+
+signals:
+ void touchDeviceRegistered();
private:
+ Q_INVOKABLE void notifyTouchDeviceRegistered();
+
QString m_device;
QString m_spec;
QEvdevTouchScreenHandler *m_handler;
+ bool m_touchDeviceRegistered;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
index 98fc83700c..57028495c5 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
@@ -95,13 +95,12 @@ QEvdevTouchManager::~QEvdevTouchManager()
void QEvdevTouchManager::addDevice(const QString &deviceNode)
{
- qCDebug(qLcEvdevTouch) << "Adding device at" << deviceNode;
+ qCDebug(qLcEvdevTouch) << "evdevtouch: Adding device at" << deviceNode;
QEvdevTouchScreenHandlerThread *handler;
handler = new QEvdevTouchScreenHandlerThread(deviceNode, m_spec);
if (handler) {
m_activeDevices.insert(deviceNode, handler);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypeTouch, m_activeDevices.count());
+ connect(handler, &QEvdevTouchScreenHandlerThread::touchDeviceRegistered, this, &QEvdevTouchManager::updateInputDeviceCount);
} else {
qWarning("evdevtouch: Failed to open touch device %s", qPrintable(deviceNode));
}
@@ -110,13 +109,28 @@ void QEvdevTouchManager::addDevice(const QString &deviceNode)
void QEvdevTouchManager::removeDevice(const QString &deviceNode)
{
if (m_activeDevices.contains(deviceNode)) {
- qCDebug(qLcEvdevTouch) << "Removing device at" << deviceNode;
+ qCDebug(qLcEvdevTouch) << "evdevtouch: Removing device at" << deviceNode;
QEvdevTouchScreenHandlerThread *handler = m_activeDevices.value(deviceNode);
m_activeDevices.remove(deviceNode);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypeTouch, m_activeDevices.count());
delete handler;
+
+ updateInputDeviceCount();
}
}
+void QEvdevTouchManager::updateInputDeviceCount()
+{
+ int registeredTouchDevices = 0;
+ Q_FOREACH (QEvdevTouchScreenHandlerThread *handler, m_activeDevices) {
+ if (handler->isTouchDeviceRegistered())
+ ++registeredTouchDevices;
+ }
+
+ qCDebug(qLcEvdevTouch) << "evdevtouch: Updating QInputDeviceManager device count:" << registeredTouchDevices << " touch devices,"
+ << m_activeDevices.count() - registeredTouchDevices << "pending handler(s)" ;
+
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypeTouch, registeredTouchDevices);
+}
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
index bf484fd88b..289c345ac4 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
@@ -65,6 +65,8 @@ private slots:
void addDevice(const QString &deviceNode);
void removeDevice(const QString &deviceNode);
+ void updateInputDeviceCount();
+
private:
QString m_spec;
QDeviceDiscovery *m_deviceDiscovery;
diff --git a/src/platformsupport/input/libinput/qlibinputhandler.cpp b/src/platformsupport/input/libinput/qlibinputhandler.cpp
index 1a64ad5a30..5aa66a4eaf 100644
--- a/src/platformsupport/input/libinput/qlibinputhandler.cpp
+++ b/src/platformsupport/input/libinput/qlibinputhandler.cpp
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(qLcInput, "qt.qpa.input")
+Q_LOGGING_CATEGORY(qLcLibInput, "qt.qpa.input")
static int liOpen(const char *path, int flags, void *user_data)
{
@@ -75,7 +75,7 @@ static void liLogHandler(libinput *libinput, libinput_log_priority priority, con
if (n > 0) {
if (buf[n - 1] == '\n')
buf[n - 1] = '\0';
- qCDebug(qLcInput, "libinput: %s", buf);
+ qCDebug(qLcLibInput, "libinput: %s", buf);
}
}
@@ -93,7 +93,7 @@ QLibInputHandler::QLibInputHandler(const QString &key, const QString &spec)
qFatal("Failed to get libinput context");
libinput_log_set_handler(m_li, liLogHandler);
- if (qLcInput().isDebugEnabled())
+ if (qLcLibInput().isDebugEnabled())
libinput_log_set_priority(m_li, LIBINPUT_LOG_PRIORITY_DEBUG);
if (libinput_udev_assign_seat(m_li, "seat0"))
diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
index 5f1bc550b4..ec7ea7ef0d 100644
--- a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
+++ b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
@@ -33,6 +33,7 @@
#include "qlibinputkeyboard_p.h"
#include <QtCore/QTextCodec>
+#include <QtCore/QLoggingCategory>
#include <qpa/qwindowsysteminterface.h>
#include <libinput.h>
#ifndef QT_NO_XKBCOMMON_EVDEV
@@ -42,6 +43,8 @@
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qLcLibInput)
+
const int REPEAT_DELAY = 500;
const int REPEAT_RATE = 100;
@@ -128,6 +131,7 @@ QLibInputKeyboard::QLibInputKeyboard()
#endif
{
#ifndef QT_NO_XKBCOMMON_EVDEV
+ qCDebug(qLcLibInput) << "Using xkbcommon for key mapping";
m_ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
if (!m_ctx) {
qWarning("Failed to create xkb context");
@@ -150,6 +154,8 @@ QLibInputKeyboard::QLibInputKeyboard()
m_repeatTimer.setSingleShot(true);
connect(&m_repeatTimer, &QTimer::timeout, this, &QLibInputKeyboard::handleRepeat);
+#else
+ qCWarning(qLcLibInput) << "X-less xkbcommon not available, not performing key mapping";
#endif
}
@@ -174,10 +180,13 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e)
const uint32_t k = libinput_event_keyboard_get_key(e) + 8;
const bool pressed = libinput_event_keyboard_get_key_state(e) == LIBINPUT_KEY_STATE_PRESSED;
- QByteArray chars;
- chars.resize(1 + xkb_state_key_get_utf8(m_state, k, Q_NULLPTR, 0));
- xkb_state_key_get_utf8(m_state, k, chars.data(), chars.size());
- const QString text = QString::fromUtf8(chars);
+ QVarLengthArray<char, 32> chars(32);
+ const int size = xkb_state_key_get_utf8(m_state, k, chars.data(), chars.size());
+ if (Q_UNLIKELY(size + 1 > chars.size())) { // +1 for NUL
+ chars.resize(size + 1);
+ xkb_state_key_get_utf8(m_state, k, chars.data(), chars.size());
+ }
+ const QString text = QString::fromUtf8(chars.constData(), size);
const xkb_keysym_t sym = xkb_state_key_get_one_sym(m_state, k);
diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp
index 48e5a6cf1c..55339a841a 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer.cpp
+++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp
@@ -36,6 +36,7 @@
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
#include <qpa/qwindowsysteminterface.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -81,7 +82,8 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e)
{
const double dx = libinput_event_pointer_get_dx(e);
const double dy = libinput_event_pointer_get_dy(e);
- const QRect g = QGuiApplication::primaryScreen()->virtualGeometry();
+ QScreen * const primaryScreen = QGuiApplication::primaryScreen();
+ const QRect g = QHighDpi::toNativePixels(primaryScreen->virtualGeometry(), primaryScreen);
m_pos.setX(qBound(g.left(), qRound(m_pos.x() + dx), g.right()));
m_pos.setY(qBound(g.top(), qRound(m_pos.y() + dy), g.bottom()));
@@ -110,7 +112,9 @@ void QLibInputPointer::processAxis(libinput_event_pointer *e)
void QLibInputPointer::setPos(const QPoint &pos)
{
- const QRect g = QGuiApplication::primaryScreen()->virtualGeometry();
+ QScreen * const primaryScreen = QGuiApplication::primaryScreen();
+ const QRect g = QHighDpi::toNativePixels(primaryScreen->virtualGeometry(), primaryScreen);
+
m_pos.setX(qBound(g.left(), pos.x(), g.right()));
m_pos.setY(qBound(g.top(), pos.y(), g.bottom()));
}
diff --git a/src/platformsupport/input/tslib/qtslib_p.h b/src/platformsupport/input/tslib/qtslib_p.h
index c3ee6697fa..b6448c67d7 100644
--- a/src/platformsupport/input/tslib/qtslib_p.h
+++ b/src/platformsupport/input/tslib/qtslib_p.h
@@ -34,6 +34,17 @@
#ifndef QTSLIB_H
#define QTSLIB_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
struct tsdev;
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index c040dab5e1..0293c74fb9 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -1431,7 +1431,9 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
QSpiObjectReference(connection, QDBusObjectPath(QSPI_OBJECT_PATH_ROOT))));
} else if (function == QLatin1String("GetChildren")) {
QSpiObjectReferenceArray children;
- for (int i = 0; i < interface->childCount(); ++i) {
+ const int numChildren = interface->childCount();
+ children.reserve(numChildren);
+ for (int i = 0; i < numChildren; ++i) {
QString childPath = pathForInterface(interface->child(i));
QSpiObjectReference ref(connection, QDBusObjectPath(childPath));
children << ref;
@@ -1507,7 +1509,7 @@ QSpiRelationArray AtSpiAdaptor::relationSet(QAccessibleInterface *interface, con
Q_FOREACH (const RelationPair &pair, relationInterfaces) {
// FIXME: this loop seems a bit strange... "related" always have one item when we check.
//And why is it a list, when it always have one item? And it seems to assume that the QAccessible::Relation enum maps directly to AtSpi
- QList<QSpiObjectReference> related;
+ QSpiObjectReferenceArray related;
QDBusObjectPath path = QDBusObjectPath(pathForInterface(pair.first));
related.append(QSpiObjectReference(connection, path));
@@ -1747,7 +1749,9 @@ QSpiActionArray AtSpiAdaptor::getActions(QAccessibleInterface *interface) const
{
QAccessibleActionInterface *actionInterface = interface->actionInterface();
QSpiActionArray actions;
- Q_FOREACH (const QString &actionName, QAccessibleBridgeUtils::effectiveActionNames(interface)) {
+ const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);
+ actions.reserve(actionNames.size());
+ Q_FOREACH (const QString &actionName, actionNames) {
QSpiAction action;
QStringList keyBindings;
@@ -2308,7 +2312,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 << ")";
+ qAtspiDebug() << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ')';
return false;
}
@@ -2327,7 +2331,7 @@ 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;
+ qAtspiDebug() << "WARNING: AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell. " << interface;
return false;
}
int index = interface->indexOfChild(cell);
diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp
index 55ef7161d1..bd02b032f9 100644
--- a/src/platformsupport/linuxaccessibility/bridge.cpp
+++ b/src/platformsupport/linuxaccessibility/bridge.cpp
@@ -99,7 +99,7 @@ void QSpiAccessibleBridge::notifyAccessibilityUpdate(QAccessibleEvent *event)
{
if (!dbusAdaptor)
return;
- if (isActive())
+ if (isActive() && event->accessibleInterface())
dbusAdaptor->notify(event);
}
diff --git a/src/platformsupport/linuxaccessibility/cache.cpp b/src/platformsupport/linuxaccessibility/cache.cpp
index 2ece905fdf..0ccd2cba6e 100644
--- a/src/platformsupport/linuxaccessibility/cache.cpp
+++ b/src/platformsupport/linuxaccessibility/cache.cpp
@@ -78,8 +78,7 @@ void QSpiDBusCache::emitRemoveAccessible(const QSpiObjectReference& item)
QSpiAccessibleCacheArray QSpiDBusCache::GetItems()
{
- QList <QSpiAccessibleCacheItem> cacheArray;
- return cacheArray;
+ return QSpiAccessibleCacheArray();
}
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection.cpp b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
index 45729fa065..ae1ba1819a 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection.cpp
+++ b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
@@ -42,10 +42,16 @@
#include <QDBusConnectionInterface>
#include "bus_interface.h"
+#include <QtGui/qguiapplication.h>
+#include <qplatformnativeinterface.h>
+
QT_BEGIN_NAMESPACE
-QString A11Y_SERVICE = QStringLiteral("org.a11y.Bus");
-QString A11Y_PATH = QStringLiteral("/org/a11y/bus");
+/* note: do not change these to QStringLiteral;
+ we are unloaded before QtDBus is done using the strings.
+ */
+#define A11Y_SERVICE QLatin1String("org.a11y.Bus")
+#define A11Y_PATH QLatin1String("/org/a11y/bus")
/*!
\class DBusConnection
@@ -65,6 +71,29 @@ DBusConnection::DBusConnection(QObject *parent)
// If it is registered already, setup a11y right away
if (c.interface()->isServiceRegistered(A11Y_SERVICE))
serviceRegistered();
+
+ // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work
+ QString address = getAddressFromXCB();
+ if (!address.isEmpty()) {
+ m_enabled = true;
+ connectA11yBus(address);
+ }
+}
+
+QString DBusConnection::getAddressFromXCB()
+{
+ QGuiApplication *app = qobject_cast<QGuiApplication *>(QCoreApplication::instance());
+ if (!app)
+ return QString();
+ QPlatformNativeInterface *platformNativeInterface = app->platformNativeInterface();
+ QByteArray *addressByteArray = reinterpret_cast<QByteArray*>(
+ platformNativeInterface->nativeResourceForIntegration(QByteArrayLiteral("AtspiBus")));
+ if (addressByteArray) {
+ QString address = QString::fromLatin1(*addressByteArray);
+ delete addressByteArray;
+ return address;
+ }
+ return QString();
}
// We have the a11y registry on the session bus.
@@ -111,7 +140,7 @@ void DBusConnection::connectA11yBus(const QString &address)
qWarning("Could not find Accessibility DBus address.");
return;
}
- m_a11yConnection = QDBusConnection(QDBusConnection::connectToBus(address, QStringLiteral("a11y")));
+ m_a11yConnection = QDBusConnection(QDBusConnection::connectToBus(address, QLatin1String("a11y")));
if (m_enabled)
emit enabledChanged(true);
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection_p.h b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
index a0bd6450bf..30707a3f95 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection_p.h
+++ b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
@@ -68,6 +68,7 @@ Q_SIGNALS:
void enabledChanged(bool enabled);
private Q_SLOTS:
+ QString getAddressFromXCB();
void serviceRegistered();
void serviceUnregistered();
void connectA11yBus(const QString &address);
diff --git a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
index 7788ceb7cc..61d79e6daa 100644
--- a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
+++ b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
@@ -46,7 +46,7 @@
// We mean it.
//
-#include <QtCore/qlist.h>
+#include <QtCore/qvector.h>
#include <QtCore/qpair.h>
#include <QtDBus/QDBusArgument>
#include <QtDBus/QDBusConnection>
@@ -55,8 +55,8 @@
#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
-typedef QList <int> QSpiIntList;
-typedef QList <uint> QSpiUIntList;
+typedef QVector<int> QSpiIntList;
+typedef QVector<uint> QSpiUIntList;
// FIXME: make this copy on write
struct QSpiObjectReference
@@ -68,26 +68,29 @@ struct QSpiObjectReference
QSpiObjectReference(const QDBusConnection& connection, const QDBusObjectPath& path)
: service(connection.baseService()), path(path) {}
};
+Q_DECLARE_TYPEINFO(QSpiObjectReference, Q_MOVABLE_TYPE); // QDBusObjectPath is movable, even though it
+ // cannot be marked that way until Qt 6
QDBusArgument &operator<<(QDBusArgument &argument, const QSpiObjectReference &address);
const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiObjectReference &address);
-typedef QList <QSpiObjectReference> QSpiObjectReferenceArray;
+typedef QVector<QSpiObjectReference> QSpiObjectReferenceArray;
struct QSpiAccessibleCacheItem
{
QSpiObjectReference path;
QSpiObjectReference application;
QSpiObjectReference parent;
- QList <QSpiObjectReference> children;
+ QSpiObjectReferenceArray children;
QStringList supportedInterfaces;
QString name;
uint role;
QString description;
QSpiUIntList state;
};
+Q_DECLARE_TYPEINFO(QSpiAccessibleCacheItem, Q_MOVABLE_TYPE);
-typedef QList <QSpiAccessibleCacheItem> QSpiAccessibleCacheArray;
+typedef QVector<QSpiAccessibleCacheItem> QSpiAccessibleCacheArray;
QDBusArgument &operator<<(QDBusArgument &argument, const QSpiAccessibleCacheItem &item);
const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiAccessibleCacheItem &item);
@@ -98,8 +101,9 @@ struct QSpiAction
QString description;
QString keyBinding;
};
+Q_DECLARE_TYPEINFO(QSpiAction, Q_MOVABLE_TYPE);
-typedef QList <QSpiAction> QSpiActionArray;
+typedef QVector<QSpiAction> QSpiActionArray;
QDBusArgument &operator<<(QDBusArgument &argument, const QSpiAction &action);
const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiAction &action);
@@ -109,14 +113,15 @@ struct QSpiEventListener
QString listenerAddress;
QString eventName;
};
+Q_DECLARE_TYPEINFO(QSpiEventListener, Q_MOVABLE_TYPE);
-typedef QList <QSpiEventListener> QSpiEventListenerArray;
+typedef QVector<QSpiEventListener> QSpiEventListenerArray;
QDBusArgument &operator<<(QDBusArgument &argument, const QSpiEventListener &action);
const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiEventListener &action);
-typedef QPair < unsigned int, QList < QSpiObjectReference > > QSpiRelationArrayEntry;
-typedef QList< QSpiRelationArrayEntry > QSpiRelationArray;
+typedef QPair<unsigned int, QSpiObjectReferenceArray> QSpiRelationArrayEntry;
+typedef QVector<QSpiRelationArrayEntry> QSpiRelationArray;
//a(iisv)
struct QSpiTextRange {
@@ -125,18 +130,22 @@ struct QSpiTextRange {
QString contents;
QVariant v;
};
-typedef QList <QSpiTextRange> QSpiTextRangeList;
+Q_DECLARE_TYPEINFO(QSpiTextRange, Q_MOVABLE_TYPE);
+
+typedef QVector<QSpiTextRange> QSpiTextRangeList;
typedef QMap <QString, QString> QSpiAttributeSet;
enum QSpiAppUpdateType {
QSPI_APP_UPDATE_ADDED = 0,
QSPI_APP_UPDATE_REMOVED = 1
};
+Q_DECLARE_TYPEINFO(QSpiAppUpdateType, Q_PRIMITIVE_TYPE);
struct QSpiAppUpdate {
int type; /* Is an application added or removed */
QString address; /* D-Bus address of application added or removed */
};
+Q_DECLARE_TYPEINFO(QSpiAppUpdate, Q_MOVABLE_TYPE);
QDBusArgument &operator<<(QDBusArgument &argument, const QSpiAppUpdate &update);
const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiAppUpdate &update);
@@ -150,6 +159,7 @@ struct QSpiDeviceEvent {
QString text;
bool isText;
};
+Q_DECLARE_TYPEINFO(QSpiDeviceEvent, Q_MOVABLE_TYPE);
QDBusArgument &operator<<(QDBusArgument &argument, const QSpiDeviceEvent &event);
const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiDeviceEvent &event);
diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
index 55f8ea160c..fee3146f04 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
@@ -35,10 +35,15 @@
#include <QtGui/QWindow>
#include <QtGui/QPainter>
#include <qpa/qplatformbackingstore.h>
+#include <private/qwindow_p.h>
#include "qopenglcompositorbackingstore_p.h"
#include "qopenglcompositor_p.h"
+#ifndef GL_UNPACK_ROW_LENGTH
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -111,29 +116,39 @@ void QOpenGLCompositorBackingStore::updateTexture()
QRegion fixed;
QRect imageRect = m_image.rect();
- foreach (const QRect &rect, m_dirty.rects()) {
- // intersect with image rect to be sure
- QRect r = imageRect & rect;
-
- // if the rect is wide enough it's cheaper to just
- // extend it instead of doing an image copy
- if (r.width() >= imageRect.width() / 2) {
- r.setX(0);
- r.setWidth(imageRect.width());
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) {
+ foreach (const QRect &rect, m_dirty.rects()) {
+ QRect r = imageRect & rect;
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, m_image.width());
+ glTexSubImage2D(GL_TEXTURE_2D, 0, r.x(), r.y(), r.width(), r.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ m_image.constScanLine(r.y()) + r.x() * 4);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
}
-
- fixed |= r;
- }
-
- foreach (const QRect &rect, fixed.rects()) {
- // if the sub-rect is full-width we can pass the image data directly to
- // OpenGL instead of copying, since there's no gap between scanlines
- if (rect.width() == imageRect.width()) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
- m_image.constScanLine(rect.y()));
- } else {
- glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
- m_image.copy(rect).constBits());
+ } else {
+ foreach (const QRect &rect, m_dirty.rects()) {
+ // intersect with image rect to be sure
+ QRect r = imageRect & rect;
+
+ // if the rect is wide enough it's cheaper to just
+ // extend it instead of doing an image copy
+ if (r.width() >= imageRect.width() / 2) {
+ r.setX(0);
+ r.setWidth(imageRect.width());
+ }
+
+ fixed |= r;
+ }
+ foreach (const QRect &rect, fixed.rects()) {
+ // if the sub-rect is full-width we can pass the image data directly to
+ // OpenGL instead of copying, since there's no gap between scanlines
+ if (rect.width() == imageRect.width()) {
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ m_image.constScanLine(rect.y()));
+ } else {
+ glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ m_image.copy(rect).constBits());
+ }
}
}
@@ -184,6 +199,8 @@ void QOpenGLCompositorBackingStore::composeAndFlush(QWindow *window, const QRegi
dstCtx->makeCurrent(dstWin);
+ QWindowPrivate::get(window)->lastComposeTime.start();
+
m_textures->clear();
for (int i = 0; i < textures->count(); ++i)
m_textures->appendTexture(textures->source(i), textures->textureId(i), textures->geometry(i),
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 34e2ed3c9b..1ea6d0eb69 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -7,7 +7,6 @@ mac:LIBS_PRIVATE += -lz
DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
-include(cfsocketnotifier/cfsocketnotifier.pri)
include(cglconvenience/cglconvenience.pri)
include(eglconvenience/eglconvenience.pri)
include(eventdispatchers/eventdispatchers.pri)
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index b59ae431f4..33cb4391f0 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -134,7 +134,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
return openDocument(url);
if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
- qWarning("%s: Unable to detect a web browser to launch '%s'", Q_FUNC_INFO, qPrintable(url.toString()));
+ qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString()));
return false;
}
return launch(m_webBrowser, url);
@@ -143,7 +143,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
bool QGenericUnixServices::openDocument(const QUrl &url)
{
if (m_documentLauncher.isEmpty() && !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) {
- qWarning("%s: Unable to detect a launcher for '%s'", Q_FUNC_INFO, qPrintable(url.toString()));
+ qWarning("Unable to detect a launcher for '%s'", qPrintable(url.toString()));
return false;
}
return launch(m_documentLauncher, url);
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 2963b0502d..8f6171f217 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QLoggingCategory>
#include <QtCore/QSettings>
#include <QtCore/QVariant>
+#include <QtCore/QStandardPaths>
#include <QtCore/QStringList>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
@@ -209,14 +210,16 @@ public:
, wheelScrollLines(3)
{ }
- static QString kdeGlobals(const QString &kdeDir)
+ static QString kdeGlobals(const QString &kdeDir, int kdeVersion)
{
+ if (kdeVersion > 4)
+ return kdeDir + QStringLiteral("/kdeglobals");
return kdeDir + QStringLiteral("/share/config/kdeglobals");
}
void refresh();
- static QVariant readKdeSetting(const QString &key, const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings);
- static void readKdeSystemPalette(const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings, QPalette *pal);
+ static QVariant readKdeSetting(const QString &key, const QStringList &kdeDirs, int kdeVersion, QHash<QString, QSettings*> &kdeSettings);
+ static void readKdeSystemPalette(const QStringList &kdeDirs, int kdeVersion, QHash<QString, QSettings*> &kdeSettings, QPalette *pal);
static QFont *kdeFont(const QVariant &fontValue);
static QStringList kdeIconThemeSearchPaths(const QStringList &kdeDirs);
@@ -251,30 +254,30 @@ void QKdeThemePrivate::refresh()
QHash<QString, QSettings*> kdeSettings;
QPalette systemPalette = QPalette();
- readKdeSystemPalette(kdeDirs, kdeSettings, &systemPalette);
+ readKdeSystemPalette(kdeDirs, kdeVersion, kdeSettings, &systemPalette);
resources.palettes[QPlatformTheme::SystemPalette] = new QPalette(systemPalette);
//## TODO tooltip color
- const QVariant styleValue = readKdeSetting(QStringLiteral("widgetStyle"), kdeDirs, kdeSettings);
+ const QVariant styleValue = readKdeSetting(QStringLiteral("widgetStyle"), kdeDirs, kdeVersion, kdeSettings);
if (styleValue.isValid()) {
const QString style = styleValue.toString();
if (style != styleNames.front())
styleNames.push_front(style);
}
- const QVariant singleClickValue = readKdeSetting(QStringLiteral("KDE/SingleClick"), kdeDirs, kdeSettings);
+ const QVariant singleClickValue = readKdeSetting(QStringLiteral("KDE/SingleClick"), kdeDirs, kdeVersion, kdeSettings);
if (singleClickValue.isValid())
singleClick = singleClickValue.toBool();
- const QVariant themeValue = readKdeSetting(QStringLiteral("Icons/Theme"), kdeDirs, kdeSettings);
+ const QVariant themeValue = readKdeSetting(QStringLiteral("Icons/Theme"), kdeDirs, kdeVersion, kdeSettings);
if (themeValue.isValid())
iconThemeName = themeValue.toString();
- const QVariant toolBarIconSizeValue = readKdeSetting(QStringLiteral("ToolbarIcons/Size"), kdeDirs, kdeSettings);
+ const QVariant toolBarIconSizeValue = readKdeSetting(QStringLiteral("ToolbarIcons/Size"), kdeDirs, kdeVersion, kdeSettings);
if (toolBarIconSizeValue.isValid())
toolBarIconSize = toolBarIconSizeValue.toInt();
- const QVariant toolbarStyleValue = readKdeSetting(QStringLiteral("Toolbar style/ToolButtonStyle"), kdeDirs, kdeSettings);
+ const QVariant toolbarStyleValue = readKdeSetting(QStringLiteral("Toolbar style/ToolButtonStyle"), kdeDirs, kdeVersion, kdeSettings);
if (toolbarStyleValue.isValid()) {
const QString toolBarStyle = toolbarStyleValue.toString();
if (toolBarStyle == QLatin1String("TextBesideIcon"))
@@ -285,17 +288,17 @@ void QKdeThemePrivate::refresh()
toolButtonStyle = Qt::ToolButtonTextUnderIcon;
}
- const QVariant wheelScrollLinesValue = readKdeSetting(QStringLiteral("KDE/WheelScrollLines"), kdeDirs, kdeSettings);
+ const QVariant wheelScrollLinesValue = readKdeSetting(QStringLiteral("KDE/WheelScrollLines"), kdeDirs, kdeVersion, kdeSettings);
if (wheelScrollLinesValue.isValid())
wheelScrollLines = wheelScrollLinesValue.toInt();
// Read system font, ignore 'smallestReadableFont'
- if (QFont *systemFont = kdeFont(readKdeSetting(QStringLiteral("font"), kdeDirs, kdeSettings)))
+ if (QFont *systemFont = kdeFont(readKdeSetting(QStringLiteral("font"), kdeDirs, kdeVersion, kdeSettings)))
resources.fonts[QPlatformTheme::SystemFont] = systemFont;
else
resources.fonts[QPlatformTheme::SystemFont] = new QFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize);
- if (QFont *fixedFont = kdeFont(readKdeSetting(QStringLiteral("fixed"), kdeDirs, kdeSettings))) {
+ if (QFont *fixedFont = kdeFont(readKdeSetting(QStringLiteral("fixed"), kdeDirs, kdeVersion, kdeSettings))) {
resources.fonts[QPlatformTheme::FixedFont] = fixedFont;
} else {
fixedFont = new QFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize);
@@ -306,12 +309,12 @@ void QKdeThemePrivate::refresh()
qDeleteAll(kdeSettings);
}
-QVariant QKdeThemePrivate::readKdeSetting(const QString &key, const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings)
+QVariant QKdeThemePrivate::readKdeSetting(const QString &key, const QStringList &kdeDirs, int kdeVersion, QHash<QString, QSettings*> &kdeSettings)
{
foreach (const QString &kdeDir, kdeDirs) {
QSettings *settings = kdeSettings.value(kdeDir);
if (!settings) {
- const QString kdeGlobalsPath = kdeGlobals(kdeDir);
+ const QString kdeGlobalsPath = kdeGlobals(kdeDir, kdeVersion);
if (QFileInfo(kdeGlobalsPath).isReadable()) {
settings = new QSettings(kdeGlobalsPath, QSettings::IniFormat);
kdeSettings.insert(kdeDir, settings);
@@ -339,9 +342,9 @@ static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role, const QVari
return true;
}
-void QKdeThemePrivate::readKdeSystemPalette(const QStringList &kdeDirs, QHash<QString, QSettings*> &kdeSettings, QPalette *pal)
+void QKdeThemePrivate::readKdeSystemPalette(const QStringList &kdeDirs, int kdeVersion, QHash<QString, QSettings*> &kdeSettings, QPalette *pal)
{
- if (!kdeColor(pal, QPalette::Button, readKdeSetting(QStringLiteral("Colors:Button/BackgroundNormal"), kdeDirs, kdeSettings))) {
+ if (!kdeColor(pal, QPalette::Button, readKdeSetting(QStringLiteral("Colors:Button/BackgroundNormal"), kdeDirs, kdeVersion, kdeSettings))) {
// kcolorscheme.cpp: SetDefaultColors
const QColor defaultWindowBackground(214, 210, 208);
const QColor defaultButtonBackground(223, 220, 217);
@@ -349,18 +352,18 @@ void QKdeThemePrivate::readKdeSystemPalette(const QStringList &kdeDirs, QHash<QS
return;
}
- kdeColor(pal, QPalette::Window, readKdeSetting(QStringLiteral("Colors:Window/BackgroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::Text, readKdeSetting(QStringLiteral("Colors:View/ForegroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::WindowText, readKdeSetting(QStringLiteral("Colors:Window/ForegroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::Base, readKdeSetting(QStringLiteral("Colors:View/BackgroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::Highlight, readKdeSetting(QStringLiteral("Colors:Selection/BackgroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::HighlightedText, readKdeSetting(QStringLiteral("Colors:Selection/ForegroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::AlternateBase, readKdeSetting(QStringLiteral("Colors:View/BackgroundAlternate"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::ButtonText, readKdeSetting(QStringLiteral("Colors:Button/ForegroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::Link, readKdeSetting(QStringLiteral("Colors:View/ForegroundLink"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::LinkVisited, readKdeSetting(QStringLiteral("Colors:View/ForegroundVisited"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::ToolTipBase, readKdeSetting(QStringLiteral("Colors:Tooltip/BackgroundNormal"), kdeDirs, kdeSettings));
- kdeColor(pal, QPalette::ToolTipText, readKdeSetting(QStringLiteral("Colors:Tooltip/ForegroundNormal"), kdeDirs, kdeSettings));
+ kdeColor(pal, QPalette::Window, readKdeSetting(QStringLiteral("Colors:Window/BackgroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::Text, readKdeSetting(QStringLiteral("Colors:View/ForegroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::WindowText, readKdeSetting(QStringLiteral("Colors:Window/ForegroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::Base, readKdeSetting(QStringLiteral("Colors:View/BackgroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::Highlight, readKdeSetting(QStringLiteral("Colors:Selection/BackgroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::HighlightedText, readKdeSetting(QStringLiteral("Colors:Selection/ForegroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::AlternateBase, readKdeSetting(QStringLiteral("Colors:View/BackgroundAlternate"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::ButtonText, readKdeSetting(QStringLiteral("Colors:Button/ForegroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::Link, readKdeSetting(QStringLiteral("Colors:View/ForegroundLink"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::LinkVisited, readKdeSetting(QStringLiteral("Colors:View/ForegroundVisited"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::ToolTipBase, readKdeSetting(QStringLiteral("Colors:Tooltip/BackgroundNormal"), kdeDirs, kdeVersion, kdeSettings));
+ kdeColor(pal, QPalette::ToolTipText, readKdeSetting(QStringLiteral("Colors:Tooltip/ForegroundNormal"), kdeDirs, kdeVersion, kdeSettings));
// The above code sets _all_ color roles to "normal" colors. In KDE, the disabled
// color roles are calculated by applying various effects described in kdeglobals.
@@ -502,6 +505,11 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
if (kdeVersion < 4)
return 0;
+ if (kdeVersion > 4)
+ // Plasma 5 follows XDG spec
+ // but uses the same config file format:
+ return new QKdeTheme(QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation), kdeVersion);
+
// Determine KDE prefixes in the following priority order:
// - KDEHOME and KDEDIRS environment variables
// - ~/.kde(<version>)
@@ -538,7 +546,7 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
kdeDirs.removeDuplicates();
if (kdeDirs.isEmpty()) {
- qWarning("%s: Unable to determine KDE dirs", Q_FUNC_INFO);
+ qWarning("Unable to determine KDE dirs");
return 0;
}
@@ -601,8 +609,9 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
case QPlatformTheme::DialogButtonBoxLayout:
return QVariant(QPlatformDialogHelper::GnomeLayout);
case QPlatformTheme::SystemIconThemeName:
+ return QVariant(QStringLiteral("Adwaita"));
case QPlatformTheme::SystemIconFallbackThemeName:
- return QVariant(QString(QStringLiteral("gnome")));
+ return QVariant(QStringLiteral("gnome"));
case QPlatformTheme::IconThemeSearchPaths:
return QVariant(QGenericUnixTheme::xdgIconThemePaths());
case QPlatformTheme::StyleNames: {
@@ -683,7 +692,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name)
#endif
if (name == QLatin1String(QGnomeTheme::name))
return new QGnomeTheme;
- return new QGenericUnixTheme;
+ return Q_NULLPTR;
}
QStringList QGenericUnixTheme::themeNames()
@@ -715,8 +724,7 @@ QStringList QGenericUnixTheme::themeNames()
if (!session.isEmpty() && session != QLatin1String("default") && !result.contains(session))
result.push_back(session);
} // desktopSettingsAware
- if (result.isEmpty())
- result.push_back(QLatin1String(QGenericUnixTheme::name));
+ result.append(QLatin1String(QGenericUnixTheme::name));
return result;
}
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 2239d52737..a1434fc2ea 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -8,7 +8,7 @@ TEMPLATE = subdirs
#win32:SUBDIRS += nla
win32:SUBDIRS += generic
blackberry:SUBDIRS += blackberry
-win32:!wince: SUBDIRS += nativewifi
+win32:!wince:!winrt: SUBDIRS += nativewifi
mac:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan
mac:SUBDIRS += generic
android:!android-no-sdk:SUBDIRS += android
diff --git a/src/plugins/bearer/blackberry/qbbengine.cpp b/src/plugins/bearer/blackberry/qbbengine.cpp
index d90d9fa217..5483c48eaa 100644
--- a/src/plugins/bearer/blackberry/qbbengine.cpp
+++ b/src/plugins/bearer/blackberry/qbbengine.cpp
@@ -151,14 +151,14 @@ void QBBEngine::disconnectFromId(const QString &id)
void QBBEngine::initialize()
{
if (initialized) {
- qWarning() << Q_FUNC_INFO << "called, but instance already initialized.";
+ qWarning("called, but instance already initialized.");
return;
}
instanceStorage()->setLocalData(new EngineInstanceHolder(this));
if (netstatus_request_events(0) != BPS_SUCCESS) {
- qWarning() << Q_FUNC_INFO << "cannot register for network events. Polling enabled.";
+ qWarning("cannot register for network events. Polling enabled.");
const QMutexLocker locker(&pollingMutex);
pollingRequired = true;
@@ -176,12 +176,12 @@ void QBBEngine::requestUpdate()
void QBBEngine::doRequestUpdate()
{
- qBearerDebug() << Q_FUNC_INFO << "entered method";
+ qBearerDebug("entered method");
netstatus_interface_list_t interfaceList;
if ((netstatus_get_interfaces(&interfaceList)) != BPS_SUCCESS) {
- qBearerDebug() << Q_FUNC_INFO << "cannot retrieve interface list";
+ qBearerDebug("cannot retrieve interface list");
return;
}
@@ -193,7 +193,7 @@ void QBBEngine::doRequestUpdate()
for (int i = 0; i < interfaceList.num_interfaces; i++) {
const char *interface = interfaceList.interfaces[i];
- qBearerDebug() << Q_FUNC_INFO << "discovered interface" << interface;
+ qBearerDebug() << "discovered interface" << interface;
updateConfiguration(interface);
@@ -262,7 +262,7 @@ QNetworkConfigurationPrivatePointer QBBEngine::defaultConfiguration()
const QMutexLocker locker(&mutex);
if (accessPointConfigurations.contains(id)) {
- qBearerDebug() << Q_FUNC_INFO << "found default interface:" << id;
+ qBearerDebug() << "found default interface:" << id;
return accessPointConfigurations.value(id);
}
@@ -287,7 +287,7 @@ bool QBBEngine::nativeEventFilter(const QByteArray &eventType, void *message, lo
Q_ASSERT(event);
if (bps_event_get_domain(event) == netstatus_get_domain()) {
- qBearerDebug() << Q_FUNC_INFO << "got update request.";
+ qBearerDebug("got update request.");
doRequestUpdate();
}
@@ -299,7 +299,7 @@ void QBBEngine::updateConfiguration(const char *interface)
netstatus_interface_details_t *details = 0;
if (netstatus_get_interface_details(interface, &details) != BPS_SUCCESS) {
- qBearerDebug() << Q_FUNC_INFO << "cannot retrieve details for interface" << interface;
+ qBearerDebug() << "cannot retrieve details for interface" << interface;
return;
}
@@ -355,12 +355,12 @@ void QBBEngine::updateConfiguration(const char *interface)
locker.unlock();
if (changed) {
- qBearerDebug() << Q_FUNC_INFO << "configuration changed:" << interface;
+ qBearerDebug() << "configuration changed:" << interface;
Q_EMIT configurationChanged(ptr);
} else {
// maybe Wifi has changed but gateway not yet ready etc.
- qBearerDebug() << Q_FUNC_INFO << "configuration has not changed.";
+ qBearerDebug("configuration has not changed.");
if (oldIpStatus != ipStatus) { // if IP status changed
if (ipStatus != NETSTATUS_IP_STATUS_OK
&& ipStatus != NETSTATUS_IP_STATUS_ERROR_NOT_UP
@@ -389,7 +389,7 @@ void QBBEngine::updateConfiguration(const char *interface)
locker.unlock();
- qBearerDebug() << Q_FUNC_INFO << "configuration added:" << interface;
+ qBearerDebug() << "configuration added:" << interface;
Q_EMIT configurationAdded(ptr);
}
diff --git a/src/plugins/bearer/connman/main.cpp b/src/plugins/bearer/connman/main.cpp
index a84121e89b..f1e9d763a7 100644
--- a/src/plugins/bearer/connman/main.cpp
+++ b/src/plugins/bearer/connman/main.cpp
@@ -36,7 +36,6 @@
#include <QtCore/qdebug.h>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -78,4 +77,3 @@ QT_END_NAMESPACE
#include "main.moc"
#endif
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index 7911857ff5..b7cc5f949c 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -46,7 +46,6 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusReply>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -122,8 +121,10 @@ QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
QMutexLocker locker(&mutex);
QList<QNetworkConfigurationPrivate *> fetchedConfigurations;
QNetworkConfigurationPrivate* cpPriv = 0;
+ const int numFoundConfigurations = foundConfigurations.count();
+ fetchedConfigurations.reserve(numFoundConfigurations);
- for (int i = 0; i < foundConfigurations.count(); ++i) {
+ for (int i = 0; i < numFoundConfigurations; ++i) {
QNetworkConfigurationPrivate *config = new QNetworkConfigurationPrivate;
cpPriv = foundConfigurations.at(i);
@@ -556,4 +557,3 @@ void QConnmanEngine::reEvaluateCellular()
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index 2c1f5490e3..8c79b22bf9 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -53,7 +53,6 @@
#include <QMap>
#include <QVariant>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -135,7 +134,6 @@ protected:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
#endif
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 155e6970fa..10d8285a4a 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -45,7 +45,6 @@
#include "qconnmanservice_linux_p.h"
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -175,11 +174,10 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal)
void QConnmanManagerInterface::onServicesChanged(const ConnmanMapList &changed, const QList<QDBusObjectPath> &removed)
{
- ConnmanMap connmanobj;
servicesList.clear(); //connman list changes order
- Q_FOREACH (connmanobj, changed) {
+ Q_FOREACH (const ConnmanMap &connmanobj, changed) {
const QString svcPath(connmanobj.objectPath.path());
- servicesList << svcPath;
+ servicesList << svcPath;
}
Q_EMIT servicesChanged(changed, removed);
@@ -221,7 +219,7 @@ QStringList QConnmanManagerInterface::getTechnologies()
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetTechnologies"));
reply.waitForFinished();
if (!reply.isError()) {
- Q_FOREACH (ConnmanMap map, reply.value()) {
+ Q_FOREACH (const ConnmanMap &map, reply.value()) {
if (!technologiesMap.contains(map.objectPath.path())) {
technologyAdded(map.objectPath, map.propertyMap);
}
@@ -237,7 +235,7 @@ QStringList QConnmanManagerInterface::getServices()
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetServices"));
reply.waitForFinished();
if (!reply.isError()) {
- Q_FOREACH (ConnmanMap map, reply.value()) {
+ Q_FOREACH (const ConnmanMap &map, reply.value()) {
servicesList << map.objectPath.path();
}
}
@@ -504,5 +502,3 @@ void QConnmanTechnologyInterface::scanReply(QDBusPendingCallWatcher *call)
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
-
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
index 49ca9f391c..1a10a2260a 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux_p.h
+++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
@@ -58,7 +58,6 @@
#include <QtDBus/QDBusContext>
#include <QMap>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
#ifndef __CONNMAN_DBUS_H
@@ -219,6 +218,5 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
#endif //QCONNMANSERVICE_H
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index eb756db39e..6d16b59d35 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -77,12 +77,11 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
- (id) init
{
[locker lock];
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
notificationCenter = [NSNotificationCenter defaultCenter];
currentInterface = [CWInterface interfaceWithName:nil];
[notificationCenter addObserver:self selector:@selector(notificationHandler:) name:CWPowerDidChangeNotification object:nil];
[locker unlock];
- [autoreleasepool release];
return self;
}
@@ -154,7 +153,7 @@ void QScanThread::quit()
void QScanThread::run()
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QStringList found;
mutex.lock();
CWInterface *currentInterface = [CWInterface interfaceWithName: QCFString::toNSString(interfaceName)];
@@ -236,7 +235,6 @@ void QScanThread::run()
}
}
emit networksChanged();
- [autoreleasepool release];
}
QStringList QScanThread::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose)
@@ -276,7 +274,7 @@ void QScanThread::getUserConfigurations()
{
QMutexLocker locker(&mutex);
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
userProfiles.clear();
NSSet *wifiInterfaces = [CWInterface interfaceNames];
@@ -357,7 +355,6 @@ void QScanThread::getUserConfigurations()
}
}
}
- [autoreleasepool release];
}
QString QScanThread::getSsidFromNetworkName(const QString &name)
@@ -436,7 +433,7 @@ QCoreWlanEngine::~QCoreWlanEngine()
void QCoreWlanEngine::initialize()
{
QMutexLocker locker(&mutex);
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
if ([[CWInterface interfaceNames] count] > 0 && !listener) {
listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init];
@@ -448,7 +445,6 @@ void QCoreWlanEngine::initialize()
storeSession = NULL;
startNetworkChangeLoop();
- [autoreleasepool release];
}
@@ -469,7 +465,7 @@ bool QCoreWlanEngine::hasIdentifier(const QString &id)
void QCoreWlanEngine::connectToId(const QString &id)
{
QMutexLocker locker(&mutex);
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QString interfaceString = getInterfaceFromId(id);
CWInterface *wifiInterface =
@@ -541,7 +537,6 @@ void QCoreWlanEngine::connectToId(const QString &id)
locker.unlock();
emit connectionError(id, InterfaceLookupError);
- [autoreleasepool release];
}
void QCoreWlanEngine::disconnectFromId(const QString &id)
@@ -554,7 +549,7 @@ void QCoreWlanEngine::disconnectFromId(const QString &id)
emit connectionError(id, DisconnectionError);
return;
}
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
CWInterface *wifiInterface =
[CWInterface interfaceWithName: QCFString::toNSString(interfaceString)];
@@ -563,14 +558,13 @@ void QCoreWlanEngine::disconnectFromId(const QString &id)
[wifiInterface disassociate];
QTimer::singleShot(1000, this,SLOT(checkDisconnect()));
- [autoreleasepool release];
}
void QCoreWlanEngine::checkDisconnect()
{
QMutexLocker locker(&mutex);
if (!disconnectedInterfaceString.isEmpty()) {
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
CWInterface *wifiInterface =
[CWInterface interfaceWithName: QCFString::toNSString(disconnectedInterfaceString)];
@@ -582,7 +576,6 @@ void QCoreWlanEngine::checkDisconnect()
emit connectionError(id, DisconnectionError);
locker.relock();
}
- [autoreleasepool release];
disconnectedInterfaceString.clear();
}
}
@@ -597,7 +590,7 @@ void QCoreWlanEngine::doRequestUpdate()
{
QMutexLocker locker(&mutex);
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
NSSet *wifiInterfaces = [CWInterface interfaceNames];
for (NSString *ifName in wifiInterfaces) {
@@ -607,7 +600,6 @@ void QCoreWlanEngine::doRequestUpdate()
locker.unlock();
if ([wifiInterfaces count] == 0)
networksChanged();
- [autoreleasepool release];
}
bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName)
@@ -615,12 +607,11 @@ bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName)
QMutexLocker locker(&mutex);
bool haswifi = false;
if(hasWifi) {
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
CWInterface *defaultInterface = [CWInterface interfaceWithName: QCFString::toNSString(wifiDeviceName)];
if (defaultInterface.powerOn) {
haswifi = true;
}
- [autoreleasepool release];
}
return haswifi;
}
@@ -814,7 +805,7 @@ quint64 QCoreWlanEngine::bytesReceived(const QString &id)
quint64 QCoreWlanEngine::startTime(const QString &identifier)
{
QMutexLocker locker(&mutex);
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
quint64 timestamp = 0;
NSString *filePath = @"/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist";
@@ -861,7 +852,6 @@ quint64 QCoreWlanEngine::startTime(const QString &identifier)
}
}
}
- [autoreleasepool release];
return timestamp;
}
diff --git a/src/plugins/bearer/generic/main.cpp b/src/plugins/bearer/generic/main.cpp
index 112c7420e1..4f79807128 100644
--- a/src/plugins/bearer/generic/main.cpp
+++ b/src/plugins/bearer/generic/main.cpp
@@ -37,8 +37,6 @@
#include <QtCore/qdebug.h>
-#ifndef QT_NO_BEARERMANAGEMENT
-
QT_BEGIN_NAMESPACE
class QGenericEnginePlugin : public QBearerEnginePlugin
@@ -72,5 +70,3 @@ QBearerEngine *QGenericEnginePlugin::create(const QString &key) const
QT_END_NAMESPACE
#include "main.moc"
-
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index e1b3d79b38..1e424dc223 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -44,14 +44,34 @@
#include <QtCore/qdebug.h>
#include <QtCore/private/qcoreapplication_p.h>
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
#include "../platformdefs_win.h"
#endif
#ifdef Q_OS_WINCE
typedef ULONG NDIS_OID, *PNDIS_OID;
-#include <nuiouser.h>
-#endif
+# ifndef QT_NO_WINCE_NUIOUSER
+# include <nuiouser.h>
+# endif
+#endif // Q_OS_WINCE
+
+#ifdef Q_OS_WINRT
+#include <qfunctions_winrt.h>
+
+#include <wrl.h>
+#include <windows.foundation.h>
+#include <windows.foundation.collections.h>
+#include <windows.networking.connectivity.h>
+
+using namespace Microsoft::WRL;
+using namespace Microsoft::WRL::Wrappers;
+using namespace ABI::Windows::Foundation;
+using namespace ABI::Windows::Foundation::Collections;
+using namespace ABI::Windows::Networking;
+using namespace ABI::Windows::Networking::Connectivity;
+// needed as interface is used as parameter name in qGetInterfaceType
+#undef interface
+#endif // Q_OS_WINRT
#ifdef Q_OS_LINUX
#include <sys/socket.h>
@@ -61,19 +81,17 @@ typedef ULONG NDIS_OID, *PNDIS_OID;
#include <unistd.h>
#endif
-#ifndef QT_NO_BEARERMANAGEMENT
-
QT_BEGIN_NAMESPACE
#ifndef QT_NO_NETWORKINTERFACE
static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface)
{
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
DWORD bytesWritten;
NDIS_MEDIUM medium;
NDIS_PHYSICAL_MEDIUM physicalMedium;
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) && !defined(QT_NO_WINCE_NUIOUSER)
NDISUIO_QUERY_OID nicGetOid;
HANDLE handle = CreateFile((PTCHAR)NDISUIO_DEVICE_NAME, 0,
FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
@@ -87,7 +105,7 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
bytesWritten = 0;
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) && !defined(QT_NO_WINCE_NUIOUSER)
ZeroMemory(&nicGetOid, sizeof(NDISUIO_QUERY_OID));
nicGetOid.Oid = OID_GEN_MEDIA_SUPPORTED;
nicGetOid.ptcDeviceName = (PTCHAR)interface.utf16();
@@ -105,7 +123,7 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
bytesWritten = 0;
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) && !defined(QT_NO_WINCE_NUIOUSER)
medium = NDIS_MEDIUM( *(LPDWORD)nicGetOid.Data );
ZeroMemory(&nicGetOid, sizeof(NDISUIO_QUERY_OID));
@@ -163,6 +181,87 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
if (result >= 0 && request.ifr_hwaddr.sa_family == ARPHRD_ETHER)
return QNetworkConfiguration::BearerEthernet;
+#elif defined(Q_OS_WINRT)
+ ComPtr<INetworkInformationStatics> networkInfoStatics;
+ HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &networkInfoStatics);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IVectorView<ConnectionProfile *>> connectionProfiles;
+ hr = networkInfoStatics->GetConnectionProfiles(&connectionProfiles);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (!connectionProfiles)
+ return QNetworkConfiguration::BearerUnknown;
+
+ unsigned int size;
+ hr = connectionProfiles->get_Size(&size);
+ Q_ASSERT_SUCCEEDED(hr);
+ for (unsigned int i = 0; i < size; ++i) {
+ ComPtr<IConnectionProfile> profile;
+ hr = connectionProfiles->GetAt(i, &profile);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ ComPtr<INetworkAdapter> adapter;
+ hr = profile->get_NetworkAdapter(&adapter);
+ // Indicates that no internet connection is available/the device is in airplane mode
+ if (hr == E_INVALIDARG)
+ return QNetworkConfiguration::BearerUnknown;
+ Q_ASSERT_SUCCEEDED(hr);
+ GUID id;
+ hr = adapter->get_NetworkAdapterId(&id);
+ Q_ASSERT_SUCCEEDED(hr);
+ OLECHAR adapterName[39]={0};
+ int length = StringFromGUID2(id, adapterName, 39);
+ // "length - 1" as we have to remove the null terminator from it in order to compare
+ if (!length
+ || QString::fromRawData(reinterpret_cast<const QChar *>(adapterName), length - 1) != interface)
+ continue;
+
+ ComPtr<IConnectionProfile2> profile2;
+ hr = profile.As(&profile2);
+ Q_ASSERT_SUCCEEDED(hr);
+ boolean isWLan;
+ hr = profile2->get_IsWlanConnectionProfile(&isWLan);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (isWLan)
+ return QNetworkConfiguration::BearerWLAN;
+
+ boolean isWWan;
+ hr = profile2->get_IsWwanConnectionProfile(&isWWan);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (isWWan) {
+ ComPtr<IWwanConnectionProfileDetails> details;
+ hr = profile2->get_WwanConnectionProfileDetails(&details);
+ Q_ASSERT_SUCCEEDED(hr);
+ WwanDataClass dataClass;
+ hr = details->GetCurrentDataClass(&dataClass);
+ Q_ASSERT_SUCCEEDED(hr);
+ switch (dataClass) {
+ case WwanDataClass_Edge:
+ case WwanDataClass_Gprs:
+ return QNetworkConfiguration::Bearer2G;
+ case WwanDataClass_Umts:
+ return QNetworkConfiguration::BearerWCDMA;
+ case WwanDataClass_LteAdvanced:
+ return QNetworkConfiguration::BearerLTE;
+ case WwanDataClass_Hsdpa:
+ case WwanDataClass_Hsupa:
+ return QNetworkConfiguration::BearerHSPA;
+ case WwanDataClass_Cdma1xRtt:
+ case WwanDataClass_Cdma3xRtt:
+ case WwanDataClass_CdmaUmb:
+ return QNetworkConfiguration::BearerCDMA2000;
+ case WwanDataClass_Cdma1xEvdv:
+ case WwanDataClass_Cdma1xEvdo:
+ case WwanDataClass_Cdma1xEvdoRevA:
+ case WwanDataClass_Cdma1xEvdoRevB:
+ return QNetworkConfiguration::BearerEVDO;
+ case WwanDataClass_Custom:
+ case WwanDataClass_None:
+ default:
+ return QNetworkConfiguration::BearerUnknown;
+ }
+ }
+ return QNetworkConfiguration::BearerEthernet;
+ }
#else
Q_UNUSED(interface);
#endif
@@ -243,9 +342,11 @@ void QGenericEngine::doRequestUpdate()
if (interface.flags() & QNetworkInterface::IsLoopBack)
continue;
+#ifndef Q_OS_WINRT
// ignore WLAN interface handled in separate engine
if (qGetInterfaceType(interface.name()) == QNetworkConfiguration::BearerWLAN)
continue;
+#endif
uint identifier;
if (interface.index())
@@ -385,5 +486,3 @@ bool QGenericEngine::requiresPolling() const
}
QT_END_NAMESPACE
-
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h
index 9acd6c4c2e..4b99c90051 100644
--- a/src/plugins/bearer/generic/qgenericengine.h
+++ b/src/plugins/bearer/generic/qgenericengine.h
@@ -39,8 +39,6 @@
#include <QMap>
#include <QTimer>
-#ifndef QT_NO_BEARERMANAGEMENT
-
QT_BEGIN_NAMESPACE
class QNetworkConfigurationPrivate;
@@ -82,7 +80,5 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_BEARERMANAGEMENT
-
#endif
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
index 6e427544fa..e9e91f9855 100644
--- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
+++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
@@ -45,7 +45,6 @@
#include "qofonoservice_linux_p.h"
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QDBusArgument &operator<<(QDBusArgument &argument, const ObjectPathProperties &item)
@@ -98,7 +97,7 @@ QStringList QOfonoManagerInterface::getModems()
QDBusPendingReply<PathPropertiesList> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList);
reply.waitForFinished();
if (!reply.isError()) {
- foreach (ObjectPathProperties modem, reply.value()) {
+ foreach (const ObjectPathProperties &modem, reply.value()) {
modemList << modem.path.path();
}
}
@@ -261,7 +260,7 @@ QStringList QOfonoDataConnectionManagerInterface::contexts()
QDBusPendingReply<PathPropertiesList > reply = call(QLatin1String("GetContexts"));
reply.waitForFinished();
if (!reply.isError()) {
- foreach (ObjectPathProperties context, reply.value()) {
+ foreach (const ObjectPathProperties &context, reply.value()) {
contextList << context.path.path();
}
}
@@ -382,4 +381,3 @@ QString QOfonoConnectionContextInterface::name()
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux_p.h b/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
index b051b8feaa..57ea089ec8 100644
--- a/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
+++ b/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
@@ -57,7 +57,6 @@
#include <QtDBus/QDBusContext>
#include <QMap>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
#define OFONO_SERVICE "org.ofono"
@@ -193,6 +192,5 @@ private slots:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
#endif //QOFONOSERVICE_H
diff --git a/src/plugins/bearer/networkmanager/main.cpp b/src/plugins/bearer/networkmanager/main.cpp
index 8a872cf08f..0d22846c44 100644
--- a/src/plugins/bearer/networkmanager/main.cpp
+++ b/src/plugins/bearer/networkmanager/main.cpp
@@ -37,7 +37,6 @@
#include <QtCore/qdebug.h>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -77,4 +76,3 @@ QT_END_NAMESPACE
#include "main.moc"
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index e662d5f2d3..3b8a85a26b 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -49,7 +49,6 @@
#include <QDBusReply>
#include "../linux_common/qofonoservice_linux_p.h"
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -846,7 +845,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
while (i.hasNext()) {
i.next();
- const QString path = i.key() +"/"+contextPart;
+ const QString path = i.key() + QLatin1Char('/') +contextPart;
if (isActiveContext(path)) {
cpPriv->state |= QNetworkConfiguration::Active;
break;
@@ -1025,7 +1024,7 @@ QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const
QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
while (i.hasNext()) {
i.next();
- QString contextPath = i.key() +"/"+contextPart;
+ QString contextPath = i.key() + QLatin1Char('/') +contextPart;
if (i.value()->contexts().contains(contextPath)) {
@@ -1129,4 +1128,3 @@ void QNetworkManagerEngine::ofonoUnRegistered(const QString &)
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
index 3d90fcd0e5..1f578890dc 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
@@ -54,7 +54,6 @@
#include <QMap>
#include <QVariant>
-#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -150,7 +149,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
-#endif // QT_NO_BEARERMANAGEMENT
#endif
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
index 75c4ce2014..fc9a3281b8 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
@@ -74,7 +74,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
if (!propsReply.isError()) {
propertyMap = propsReply.value();
} else {
- qWarning() << Q_FUNC_INFO << "propsReply"<<propsReply.error().message();
+ qWarning() << "propsReply" << propsReply.error().message();
}
QDBusPendingReply<QList <QDBusObjectPath> > nmReply
@@ -83,7 +83,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
if (!nmReply.isError()) {
devicesPathList = nmReply.value();
} else {
- qWarning() << Q_FUNC_INFO <<"nmReply"<<nmReply.error().message();
+ qWarning() << "nmReply" << nmReply.error().message();
}
QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
@@ -789,7 +789,7 @@ bool QNetworkManagerSettings::setConnections()
QLatin1String("NewConnection"),
this, SIGNAL(newConnection(QDBusObjectPath)))) {
allOk = false;
- qWarning() << Q_FUNC_INFO << "NewConnection could not be connected";
+ qWarning("NewConnection could not be connected");
}
return allOk;
diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp
index 3680eb7305..cc65364a02 100644
--- a/src/plugins/bearer/nla/qnlaengine.cpp
+++ b/src/plugins/bearer/nla/qnlaengine.cpp
@@ -69,39 +69,39 @@ QWindowsSockInit2::~QWindowsSockInit2()
#ifdef BEARER_MANAGEMENT_DEBUG
static void printBlob(NLA_BLOB *blob)
{
- qDebug() << "==== BEGIN NLA_BLOB ====";
+ qDebug() << "==== BEGIN NLA_BLOB ====" << endl
- qDebug() << "type:" << blob->header.type;
- qDebug() << "size:" << blob->header.dwSize;
- qDebug() << "next offset:" << blob->header.nextOffset;
+ << "type:" << blob->header.type << endl
+ << "size:" << blob->header.dwSize << endl
+ << "next offset:" << blob->header.nextOffset;
switch (blob->header.type) {
case NLA_RAW_DATA:
- qDebug() << "Raw Data";
- qDebug() << '\t' << blob->data.rawData;
+ qDebug() << "Raw Data" << endl
+ << '\t' << blob->data.rawData;
break;
case NLA_INTERFACE:
- qDebug() << "Interface";
- qDebug() << "\ttype:" << blob->data.interfaceData.dwType;
- qDebug() << "\tspeed:" << blob->data.interfaceData.dwSpeed;
- qDebug() << "\tadapter:" << blob->data.interfaceData.adapterName;
+ qDebug() << "Interface" << endl
+ << "\ttype:" << blob->data.interfaceData.dwType << endl
+ << "\tspeed:" << blob->data.interfaceData.dwSpeed << endl
+ << "\tadapter:" << blob->data.interfaceData.adapterName;
break;
case NLA_802_1X_LOCATION:
- qDebug() << "802.1x Location";
- qDebug() << '\t' << blob->data.locationData.information;
+ qDebug() << "802.1x Location" << endl
+ << '\t' << blob->data.locationData.information;
break;
case NLA_CONNECTIVITY:
- qDebug() << "Connectivity";
- qDebug() << "\ttype:" << blob->data.connectivity.type;
- qDebug() << "\tinternet:" << blob->data.connectivity.internet;
+ qDebug() << "Connectivity" << endl
+ << "\ttype:" << blob->data.connectivity.type << endl
+ << "\tinternet:" << blob->data.connectivity.internet;
break;
case NLA_ICS:
- qDebug() << "ICS";
- qDebug() << "\tspeed:" << blob->data.ICS.remote.speed;
- qDebug() << "\ttype:" << blob->data.ICS.remote.type;
- qDebug() << "\tstate:" << blob->data.ICS.remote.state;
- qDebug() << "\tmachine name:" << blob->data.ICS.remote.machineName;
- qDebug() << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
+ qDebug() << "ICS" << endl
+ << "\tspeed:" << blob->data.ICS.remote.speed << endl
+ << "\ttype:" << blob->data.ICS.remote.type << endl
+ << "\tstate:" << blob->data.ICS.remote.state << endl
+ << "\tmachine name:" << blob->data.ICS.remote.machineName << endl
+ << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
break;
default:
qDebug() << "UNKNOWN BLOB TYPE";
diff --git a/src/plugins/bearer/qbearerengine_impl.h b/src/plugins/bearer/qbearerengine_impl.h
index 6db4d8c6b2..a343474f2c 100644
--- a/src/plugins/bearer/qbearerengine_impl.h
+++ b/src/plugins/bearer/qbearerengine_impl.h
@@ -36,8 +36,6 @@
#include <QtNetwork/private/qbearerengine_p.h>
-#ifndef QT_NO_BEARERMANAGEMENT
-
QT_BEGIN_NAMESPACE
class QBearerEngineImpl : public QBearerEngine
@@ -74,6 +72,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QBearerEngineImpl::ConnectionError)
-#endif // QT_NO_BEARERMANAGEMENT
-
#endif // QBEARERENGINE_IMPL_H
diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp
index f3f3729504..8139040f84 100644
--- a/src/plugins/bearer/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/qnetworksession_impl.cpp
@@ -42,8 +42,6 @@
#include <QtCore/qmutex.h>
#include <QtCore/qstringlist.h>
-#ifndef QT_NO_BEARERMANAGEMENT
-
QT_BEGIN_NAMESPACE
static QBearerEngineImpl *getEngineFromId(const QString &id)
@@ -281,7 +279,7 @@ quint64 QNetworkSessionPrivateImpl::bytesReceived() const
quint64 QNetworkSessionPrivateImpl::activeTime() const
{
if (state == QNetworkSession::Connected && startTime != Q_UINT64_C(0))
- return QDateTime::currentDateTime().toTime_t() - startTime;
+ return QDateTime::currentDateTimeUtc().toTime_t() - startTime;
return Q_UINT64_C(0);
}
@@ -423,5 +421,3 @@ void QNetworkSessionPrivateImpl::decrementTimeout()
}
QT_END_NAMESPACE
-
-#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h
index 87a2b29bd4..a26b05ab3b 100644
--- a/src/plugins/bearer/qnetworksession_impl.h
+++ b/src/plugins/bearer/qnetworksession_impl.h
@@ -50,8 +50,6 @@
#include <QtNetwork/private/qnetworkconfigmanager_p.h>
#include <QtNetwork/private/qnetworksession_p.h>
-#ifndef QT_NO_BEARERMANAGEMENT
-
QT_BEGIN_NAMESPACE
class QBearerEngineImpl;
@@ -123,6 +121,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_BEARERMANAGEMENT
-
#endif // QNETWORKSESSION_IMPL_H
diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
index 5211ed8381..2b42889cb1 100644
--- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp
+++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
@@ -202,7 +202,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 << ")";
+ qWarning() << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')';
return;
}
@@ -317,6 +317,7 @@ void QTuioHandler::process2DCurFseq(const QOscMessage &message)
return;
QList<QWindowSystemInterface::TouchPoint> tpl;
+ tpl.reserve(m_activeCursors.size() + m_deadCursors.size());
foreach (const QTuioCursor &tc, m_activeCursors) {
QWindowSystemInterface::TouchPoint tp = cursorToTouchPoint(tc, win);
diff --git a/src/plugins/imageformats/gif/main.cpp b/src/plugins/imageformats/gif/main.cpp
index 8181900adb..62c4f4b597 100644
--- a/src/plugins/imageformats/gif/main.cpp
+++ b/src/plugins/imageformats/gif/main.cpp
@@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
#include "main.h"
#ifdef QT_NO_IMAGEFORMAT_GIF
@@ -69,6 +67,4 @@ QImageIOHandler *QGifPlugin::create(QIODevice *device, const QByteArray &format)
return handler;
}
-#endif // QT_NO_IMAGEFORMATPLUGIN
-
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/gif/main.h b/src/plugins/imageformats/gif/main.h
index 1b02d5eaf6..56e0655b1f 100644
--- a/src/plugins/imageformats/gif/main.h
+++ b/src/plugins/imageformats/gif/main.h
@@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
#ifdef QT_NO_IMAGEFORMAT_GIF
#undef QT_NO_IMAGEFORMAT_GIF
#endif
@@ -56,5 +54,3 @@ public:
};
QT_END_NAMESPACE
-
-#endif // QT_NO_IMAGEFORMATPLUGIN
diff --git a/src/plugins/imageformats/ico/main.cpp b/src/plugins/imageformats/ico/main.cpp
index 80182fb665..03448d4ae1 100644
--- a/src/plugins/imageformats/ico/main.cpp
+++ b/src/plugins/imageformats/ico/main.cpp
@@ -33,8 +33,6 @@
#include "main.h"
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
QT_BEGIN_NAMESPACE
QImageIOPlugin::Capabilities QICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
@@ -63,5 +61,3 @@ QImageIOHandler *QICOPlugin::create(QIODevice *device, const QByteArray &format)
}
QT_END_NAMESPACE
-
-#endif /* QT_NO_IMAGEFORMATPLUGIN */
diff --git a/src/plugins/imageformats/ico/main.h b/src/plugins/imageformats/ico/main.h
index a254a626d1..d17dbe824d 100644
--- a/src/plugins/imageformats/ico/main.h
+++ b/src/plugins/imageformats/ico/main.h
@@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qdebug.h>
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
#ifdef QT_NO_IMAGEFORMAT_ICO
#undef QT_NO_IMAGEFORMAT_ICO
#endif
@@ -53,5 +51,3 @@ public:
};
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 4cb5e22bf7..19525397fa 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -96,13 +96,14 @@ public:
QImage iconAt(int index);
static bool canRead(QIODevice *iodev);
- static QList<QImage> read(QIODevice * device);
+ static QVector<QImage> read(QIODevice *device);
- static bool write(QIODevice * device, const QList<QImage> & images);
+ static bool write(QIODevice *device, const QVector<QImage> &images);
+
+ bool readIconEntry(int index, ICONDIRENTRY * iconEntry);
private:
bool readHeader();
- bool readIconEntry(int index, ICONDIRENTRY * iconEntry);
bool readBMPHeader(quint32 imageOffset, BMP_INFOHDR * header);
void findColorInfo(QImage & image);
@@ -341,7 +342,7 @@ bool ICOReader::readHeader()
bool ICOReader::readIconEntry(int index, ICONDIRENTRY *iconEntry)
{
- if (iod) {
+ if (readHeader()) {
if (iod->seek(startpos + ICONDIR_SIZE + (index * ICONDIRENTRY_SIZE))) {
return readIconDirEntry(iod, iconEntry);
}
@@ -558,10 +559,10 @@ QImage ICOReader::iconAt(int index)
if (icoAttrib.ncolors > 256) //color table can't be more than 256
return img;
icoAttrib.w = iconEntry.bWidth;
- if (icoAttrib.w == 0)
+ if (icoAttrib.w == 0) // means 256 pixels
icoAttrib.w = header.biWidth;
icoAttrib.h = iconEntry.bHeight;
- if (icoAttrib.h == 0)
+ if (icoAttrib.h == 0) // means 256 pixels
icoAttrib.h = header.biHeight/2;
QImage::Format format = QImage::Format_ARGB32;
@@ -612,12 +613,14 @@ QImage ICOReader::iconAt(int index)
\sa write()
*/
-QList<QImage> ICOReader::read(QIODevice * device)
+QVector<QImage> ICOReader::read(QIODevice *device)
{
- QList<QImage> images;
+ QVector<QImage> images;
ICOReader reader(device);
- for (int i = 0; i < reader.count(); i++)
+ const int N = reader.count();
+ images.reserve(N);
+ for (int i = 0; i < N; i++)
images += reader.iconAt(i);
return images;
@@ -636,7 +639,7 @@ QList<QImage> ICOReader::read(QIODevice * device)
\sa read()
*/
-bool ICOReader::write(QIODevice * device, const QList<QImage> & images)
+bool ICOReader::write(QIODevice *device, const QVector<QImage> &images)
{
bool retValue = false;
@@ -656,10 +659,11 @@ bool ICOReader::write(QIODevice * device, const QList<QImage> & images)
for (int i=0; i<id.idCount; i++) {
QImage image = images[i];
- // Scale down the image if it is larger than 128 pixels in either width or height
- if (image.width() > 128 || image.height() > 128)
+ // Scale down the image if it is larger than 256 pixels in either width or height
+ // because this is a maximum size of image in the ICO file.
+ if (image.width() > 256 || image.height() > 256)
{
- image = image.scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ image = image.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
QImage maskImage(image.width(), image.height(), QImage::Format_Mono);
image = image.convertToFormat(QImage::Format_ARGB32);
@@ -776,25 +780,37 @@ QtIcoHandler::~QtIcoHandler()
QVariant QtIcoHandler::option(ImageOption option) const
{
- if (option == Size) {
- QIODevice *device = QImageIOHandler::device();
- qint64 oldPos = device->pos();
+ if (option == Size || option == ImageFormat) {
ICONDIRENTRY iconEntry;
- if (device->seek(oldPos + ICONDIR_SIZE + (m_currentIconIndex * ICONDIRENTRY_SIZE))) {
- if (readIconDirEntry(device, &iconEntry)) {
- device->seek(oldPos);
- return QSize(iconEntry.bWidth, iconEntry.bHeight);
+ if (m_pICOReader->readIconEntry(m_currentIconIndex, &iconEntry)) {
+ switch (option) {
+ case Size:
+ return QSize(iconEntry.bWidth ? iconEntry.bWidth : 256,
+ iconEntry.bHeight ? iconEntry.bHeight : 256);
+
+ case ImageFormat:
+ switch (iconEntry.wBitCount) {
+ case 2:
+ return QImage::Format_Mono;
+ case 24:
+ return QImage::Format_RGB32;
+ case 32:
+ return QImage::Format_ARGB32;
+ default:
+ return QImage::Format_Indexed8;
+ }
+ break;
+ default:
+ break;
}
}
- if (!device->isSequential())
- device->seek(oldPos);
}
return QVariant();
}
bool QtIcoHandler::supportsOption(ImageOption option) const
{
- return option == Size;
+ return (option == Size || option == ImageFormat);
}
/*!
@@ -849,7 +865,7 @@ bool QtIcoHandler::read(QImage *image)
bool QtIcoHandler::write(const QImage &image)
{
QIODevice *device = QImageIOHandler::device();
- QList<QImage> imgs;
+ QVector<QImage> imgs;
imgs.append(image);
return ICOReader::write(device, imgs);
}
@@ -879,9 +895,10 @@ bool QtIcoHandler::jumpToImage(int imageNumber)
{
if (imageNumber < imageCount()) {
m_currentIconIndex = imageNumber;
+ return true;
}
- return imageNumber < imageCount();
+ return false;
}
/*! \reimp
diff --git a/src/plugins/imageformats/jpeg/main.cpp b/src/plugins/imageformats/jpeg/main.cpp
index d009707fa0..c8a575cb43 100644
--- a/src/plugins/imageformats/jpeg/main.cpp
+++ b/src/plugins/imageformats/jpeg/main.cpp
@@ -33,8 +33,6 @@
#include "main.h"
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
#ifdef QT_NO_IMAGEFORMAT_JPEG
#undef QT_NO_IMAGEFORMAT_JPEG
#endif
@@ -68,5 +66,3 @@ QImageIOHandler *QJpegPlugin::create(QIODevice *device, const QByteArray &format
}
QT_END_NAMESPACE
-
-#endif // QT_NO_IMAGEFORMATPLUGIN
diff --git a/src/plugins/imageformats/jpeg/main.h b/src/plugins/imageformats/jpeg/main.h
index 2d79c84666..77ee33faca 100644
--- a/src/plugins/imageformats/jpeg/main.h
+++ b/src/plugins/imageformats/jpeg/main.h
@@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
#ifdef QT_NO_IMAGEFORMAT_JPEG
#undef QT_NO_IMAGEFORMAT_JPEG
#endif
@@ -52,5 +50,3 @@ public:
};
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforminputcontexts/compose/compose.json b/src/plugins/platforminputcontexts/compose/compose.json
index 2daf89ed30..fb95f1bfb0 100644
--- a/src/plugins/platforminputcontexts/compose/compose.json
+++ b/src/plugins/platforminputcontexts/compose/compose.json
@@ -1,3 +1,3 @@
{
- "Keys": [ "compose" ]
+ "Keys": [ "compose", "xim" ]
}
diff --git a/src/plugins/platforminputcontexts/compose/compose.pro b/src/plugins/platforminputcontexts/compose/compose.pro
index a9da36c473..a4b5280e64 100644
--- a/src/plugins/platforminputcontexts/compose/compose.pro
+++ b/src/plugins/platforminputcontexts/compose/compose.pro
@@ -5,7 +5,7 @@ PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QComposePlatformInputContextPlugin
load(qt_plugin)
-QT += gui-private
+QT += core-private gui-private
DEFINES += X11_PREFIX='\\"$$QMAKE_X11_PREFIX\\"'
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
index 65020eb848..4126456f90 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
@@ -36,8 +36,12 @@
#include <QtCore/QByteArray>
#include <QtCore/QTextCodec>
#include <QtCore/QDebug>
+#include <QtCore/QDir>
#include <QtCore/QStringList>
#include <QtCore/QString>
+#include <QtCore/QSaveFile>
+#include <QtCore/QStandardPaths>
+#include <private/qcore_unix_p.h>
#include <algorithm>
@@ -48,12 +52,191 @@
#include <strings.h> // strncasecmp
#include <clocale> // LC_CTYPE
+static const quint32 SupportedCacheVersion = 1;
+
+/*
+ In short on how and why the "Compose" file is cached:
+
+ The "Compose" file is large, for en_US it's likely located at:
+ /usr/share/X11/locale/en_US.UTF-8/Compose
+ and it has about 6000 string lines.
+ Q(Gui)Applications parse this file each time they're created. On modern CPUs
+ it incurs a 4-10 ms startup penalty of each Qt gui app, on older CPUs -
+ tens of ms or more.
+ Since the "Compose" file (almost) never changes using a pre-parsed
+ cache file instead of the "Compose" file is a good idea to improve Qt5
+ application startup time by about 5+ ms (or tens of ms on older CPUs).
+
+ The cache file contains the contents of the QComposeCacheFileHeader struct at the
+ beginning followed by the pre-parsed contents of the "Compose" file.
+
+ struct QComposeCacheFileHeader stores
+ (a) The cache version - in the unlikely event that some day one might need
+ to break compatibility.
+ (b) The (cache) file size.
+ (c) The lastModified field tracks if anything changed since the last time
+ the cache file was saved.
+ If anything did change then we read the compose file and save (cache) it
+ in binary/pre-parsed format, which should happen extremely rarely if at all.
+*/
+
+struct QComposeCacheFileHeader
+{
+ quint32 cacheVersion;
+ // The compiler will add 4 padding bytes anyway.
+ // Reserve them explicitly to possibly use in the future.
+ quint32 reserved;
+ quint64 fileSize;
+ qint64 lastModified;
+};
+
+// localHostName() copied from qtbase/src/corelib/io/qlockfile_unix.cpp
+static QByteArray localHostName()
+{
+ QByteArray hostName(512, Qt::Uninitialized);
+ if (gethostname(hostName.data(), hostName.size()) == -1)
+ return QByteArray();
+ hostName.truncate(strlen(hostName.data()));
+ return hostName;
+}
+
+/*
+ Reads metadata about the Compose file. Later used to determine if the
+ compose cache should be updated. The fileSize field will be zero on failure.
+*/
+static QComposeCacheFileHeader readFileMetadata(const QString &path)
+{
+ QComposeCacheFileHeader info;
+ info.reserved = 0;
+ info.fileSize = 0;
+ const QByteArray pathBytes = QFile::encodeName(path);
+ QT_STATBUF st;
+ if (QT_STAT(pathBytes.data(), &st) != 0)
+ return info;
+ info.lastModified = st.st_mtime;
+ info.fileSize = st.st_size;
+ return info;
+}
+
+static const QString getCacheFilePath()
+{
+ QFile machineIdFile("/var/lib/dbus/machine-id");
+ QString machineId;
+ if (machineIdFile.exists()) {
+ if (machineIdFile.open(QIODevice::ReadOnly))
+ machineId = QString::fromLatin1(machineIdFile.readAll().trimmed());
+ }
+ if (machineId.isEmpty())
+ machineId = localHostName();
+ const QString dirPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation);
+
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
+ return dirPath + QLatin1String("/qt_compose_cache_big_endian_") + machineId;
+ return dirPath + QLatin1String("/qt_compose_cache_little_endian_") + machineId;
+}
+
+// Returns empty vector on failure
+static QVector<QComposeTableElement> loadCache(const QComposeCacheFileHeader &composeInfo)
+{
+ QVector<QComposeTableElement> vec;
+ const QString cacheFilePath = getCacheFilePath();
+ QFile inputFile(cacheFilePath);
+
+ if (!inputFile.open(QIODevice::ReadOnly))
+ return vec;
+ QComposeCacheFileHeader cacheInfo;
+ // use a "buffer" variable to make the line after this one more readable.
+ char *buffer = reinterpret_cast<char*>(&cacheInfo);
+
+ if (inputFile.read(buffer, sizeof cacheInfo) != sizeof cacheInfo)
+ return vec;
+ if (cacheInfo.fileSize == 0)
+ return vec;
+ // using "!=" just in case someone replaced with a backup that existed before
+ if (cacheInfo.lastModified != composeInfo.lastModified)
+ return vec;
+ if (cacheInfo.cacheVersion != SupportedCacheVersion)
+ return vec;
+ const QByteArray pathBytes = QFile::encodeName(cacheFilePath);
+ QT_STATBUF st;
+ if (QT_STAT(pathBytes.data(), &st) != 0)
+ return vec;
+ const off_t fileSize = st.st_size;
+ if (fileSize > 1024 * 1024 * 5) {
+ // The cache file size is usually about 150KB, so if its size is over
+ // say 5MB then somebody inflated the file, abort.
+ return vec;
+ }
+ const off_t bufferSize = fileSize - (sizeof cacheInfo);
+ const size_t elemSize = sizeof (struct QComposeTableElement);
+ const int elemCount = bufferSize / elemSize;
+ const QByteArray ba = inputFile.read(bufferSize);
+ const char *data = ba.data();
+ // Since we know the number of the (many) elements and their size in
+ // advance calling vector.reserve(..) seems reasonable.
+ vec.reserve(elemCount);
+
+ for (int i = 0; i < elemCount; i++) {
+ const QComposeTableElement *elem =
+ reinterpret_cast<const QComposeTableElement*>(data + (i * elemSize));
+ vec.push_back(*elem);
+ }
+ return vec;
+}
+
+// Returns true on success, false otherwise.
+static bool saveCache(const QComposeCacheFileHeader &info, const QVector<QComposeTableElement> &vec)
+{
+ const QString filePath = getCacheFilePath();
+ QSaveFile outputFile(filePath);
+
+ if (!outputFile.open(QIODevice::WriteOnly))
+ return false;
+ const char *data = reinterpret_cast<const char*>(&info);
+
+ if (outputFile.write(data, sizeof info) != sizeof info)
+ return false;
+ data = reinterpret_cast<const char*>(vec.constData());
+ const qint64 size = vec.size() * (sizeof (struct QComposeTableElement));
+
+ if (outputFile.write(data, size) != size)
+ return false;
+ return outputFile.commit();
+}
+
TableGenerator::TableGenerator() : m_state(NoErrors),
m_systemComposeDir(QString())
{
initPossibleLocations();
- findComposeFile();
- orderComposeTable();
+ QString composeFilePath = findComposeFile();
+#ifdef DEBUG_GENERATOR
+// don't use cache when in debug mode.
+ if (!composeFilePath.isEmpty())
+ qDebug() << "Using Compose file from: " << composeFilePath;
+#else
+ QComposeCacheFileHeader fileInfo = readFileMetadata(composeFilePath);
+ if (fileInfo.fileSize != 0)
+ m_composeTable = loadCache(fileInfo);
+#endif
+ if (m_composeTable.isEmpty() && cleanState()) {
+ if (composeFilePath.isEmpty()) {
+ m_state = MissingComposeFile;
+ } else {
+ QFile composeFile(composeFilePath);
+ composeFile.open(QIODevice::ReadOnly);
+ parseComposeFile(&composeFile);
+ orderComposeTable();
+ if (m_composeTable.isEmpty()) {
+ m_state = EmptyTable;
+#ifndef DEBUG_GENERATOR
+// don't save cache when in debug mode
+ } else {
+ fileInfo.cacheVersion = SupportedCacheVersion;
+ saveCache(fileInfo, m_composeTable);
+#endif
+ }
+ }
+ }
#ifdef DEBUG_GENERATOR
printComposeTable();
#endif
@@ -76,53 +259,39 @@ void TableGenerator::initPossibleLocations()
m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale"));
}
-void TableGenerator::findComposeFile()
+QString TableGenerator::findComposeFile()
{
- bool found = false;
// check if XCOMPOSEFILE points to a Compose file
if (qEnvironmentVariableIsSet("XCOMPOSEFILE")) {
- QString composeFile(qgetenv("XCOMPOSEFILE"));
- if (composeFile.endsWith(QLatin1String("Compose")))
- found = processFile(composeFile);
+ const QString path = QFile::decodeName(qgetenv("XCOMPOSEFILE"));
+ if (QFile::exists(path))
+ return path;
else
- qWarning("Qt Warning: XCOMPOSEFILE doesn't point to a valid Compose file");
-#ifdef DEBUG_GENERATOR
- if (found)
- qDebug() << "Using Compose file from: " << composeFile;
-#endif
+ qWarning("$XCOMPOSEFILE doesn't point to an existing file");
}
+
// check if user’s home directory has a file named .XCompose
- if (!found && cleanState()) {
- QString composeFile = qgetenv("HOME") + QStringLiteral("/.XCompose");
- if (QFile(composeFile).exists())
- found = processFile(composeFile);
-#ifdef DEBUG_GENERATOR
- if (found)
- qDebug() << "Using Compose file from: " << composeFile;
-#endif
+ if (cleanState()) {
+ QString path = qgetenv("HOME") + QStringLiteral("/.XCompose");
+ if (QFile(path).exists())
+ return path;
}
+
// check for the system provided compose files
- if (!found && cleanState()) {
+ if (cleanState()) {
QString table = composeTableForLocale();
if (cleanState()) {
if (table.isEmpty())
// no table mappings for the system's locale in the compose.dir
m_state = UnsupportedLocale;
- else
- found = processFile(systemComposeDir() + QLatin1Char('/') + table);
-#ifdef DEBUG_GENERATOR
- if (found)
- qDebug() << "Using Compose file from: " <<
- systemComposeDir() + QLatin1Char('/') + table;
-#endif
+ else {
+ QString path = QDir(systemComposeDir()).filePath(table);
+ if (QFile(path).exists())
+ return path;
+ }
}
}
-
- if (found && m_composeTable.isEmpty())
- m_state = EmptyTable;
-
- if (!found)
- m_state = MissingComposeFile;
+ return QString();
}
QString TableGenerator::composeTableForLocale()
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
index 468da4cad1..8ad081bea5 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
@@ -43,6 +43,8 @@
//#define DEBUG_GENERATOR
+/* Whenever QComposeTableElement gets modified supportedCacheVersion
+ from qtablegenerator.cpp must be bumped. */
struct QComposeTableElement {
uint keys[QT_KEYSEQUENCE_MAX_LEN];
uint value;
@@ -107,7 +109,7 @@ protected:
void parseKeySequence(char *line);
void parseIncludeInstruction(QString line);
- void findComposeFile();
+ QString findComposeFile();
bool findSystemComposeDir();
QString systemComposeDir();
QString composeTableForLocale();
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
index 96f6424ba2..15c98ed006 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
@@ -52,7 +52,8 @@ QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &
{
Q_UNUSED(paramList);
- if (system.compare(system, QLatin1String("compose"), Qt::CaseInsensitive) == 0)
+ if (system.compare(system, QLatin1String("compose"), Qt::CaseInsensitive) == 0
+ || system.compare(system, QLatin1String("xim"), Qt::CaseInsensitive) == 0)
return new QComposeInputContext;
return 0;
}
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 673942b5d9..a952123576 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -39,6 +39,10 @@
#include <qwindow.h>
#include <qevent.h>
+#include <qpa/qplatformcursor.h>
+#include <qpa/qplatformscreen.h>
+#include <qpa/qwindowsysteminterface.h>
+
#include "qibusproxy.h"
#include "qibusinputcontextproxy.h"
#include "qibustypes.h"
@@ -48,6 +52,10 @@
#include <QtDBus>
+#ifndef IBUS_RELEASE_MASK
+#define IBUS_RELEASE_MASK (1 << 30)
+#endif
+
QT_BEGIN_NAMESPACE
enum { debug = 0 };
@@ -63,29 +71,51 @@ public:
delete connection;
}
+ static QString getSocketPath();
static QDBusConnection *createConnection();
+ void initBus();
+ void createBusProxy();
+
QDBusConnection *connection;
QIBusProxy *bus;
QIBusInputContextProxy *context;
bool valid;
+ bool busConnected;
QString predit;
bool needsSurroundingText;
+ QLocale locale;
};
QIBusPlatformInputContext::QIBusPlatformInputContext ()
: d(new QIBusPlatformInputContextPrivate())
{
- if (d->context) {
- connect(d->context, SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant)));
- connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
- connect(d->context, SIGNAL(DeleteSurroundingText(int,uint)), this, SLOT(deleteSurroundingText(int,uint)));
- connect(d->context, SIGNAL(RequireSurroundingText()), this, SLOT(surroundingTextRequired()));
+ QString socketPath = QIBusPlatformInputContextPrivate::getSocketPath();
+ QFile file(socketPath);
+ if (file.open(QFile::ReadOnly)) {
+ // If KDE session save is used or restart ibus-daemon,
+ // the applications could run before ibus-daemon runs.
+ // We watch the getSocketPath() to get the launching ibus-daemon.
+ m_socketWatcher.addPath(socketPath);
+ connect(&m_socketWatcher, SIGNAL(fileChanged(QString)), this, SLOT(socketChanged(QString)));
}
+
+ m_timer.setSingleShot(true);
+ connect(&m_timer, SIGNAL(timeout()), this, SLOT(connectToBus()));
+
+ connectToContextSignals();
+
QInputMethod *p = qApp->inputMethod();
connect(p, SIGNAL(cursorRectangleChanged()), this, SLOT(cursorRectChanged()));
+ m_eventFilterUseSynchronousMode = false;
+ if (qEnvironmentVariableIsSet("IBUS_ENABLE_SYNC_MODE")) {
+ bool ok;
+ int enableSync = qgetenv("IBUS_ENABLE_SYNC_MODE").toInt(&ok);
+ if (ok && enableSync == 1)
+ m_eventFilterUseSynchronousMode = true;
+ }
}
QIBusPlatformInputContext::~QIBusPlatformInputContext (void)
@@ -100,7 +130,7 @@ bool QIBusPlatformInputContext::isValid() const
void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int)
{
- if (!d->valid)
+ if (!d->busConnected)
return;
if (a == QInputMethod::Click)
@@ -111,7 +141,7 @@ void QIBusPlatformInputContext::reset()
{
QPlatformInputContext::reset();
- if (!d->valid)
+ if (!d->busConnected)
return;
d->context->Reset();
@@ -122,7 +152,7 @@ void QIBusPlatformInputContext::commit()
{
QPlatformInputContext::commit();
- if (!d->valid)
+ if (!d->busConnected)
return;
QObject *input = qApp->focusObject();
@@ -176,7 +206,7 @@ void QIBusPlatformInputContext::update(Qt::InputMethodQueries q)
void QIBusPlatformInputContext::cursorRectChanged()
{
- if (!d->valid)
+ if (!d->busConnected)
return;
QRect r = qApp->inputMethod()->cursorRectangle().toRect();
@@ -194,7 +224,7 @@ void QIBusPlatformInputContext::cursorRectChanged()
void QIBusPlatformInputContext::setFocusObject(QObject *object)
{
- if (!d->valid)
+ if (!d->busConnected)
return;
if (debug)
@@ -272,33 +302,205 @@ void QIBusPlatformInputContext::deleteSurroundingText(int offset, uint n_chars)
QCoreApplication::sendEvent(input, &event);
}
-bool
-QIBusPlatformInputContext::x11FilterEvent(uint keyval, uint keycode, uint state, bool press)
+bool QIBusPlatformInputContext::filterEvent(const QEvent *event)
{
- if (!d->valid)
+ if (!d->busConnected)
return false;
if (!inputMethodAccepted())
return false;
- if (!press)
- return false;
+ const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event);
+ quint32 sym = keyEvent->nativeVirtualKey();
+ quint32 code = keyEvent->nativeScanCode();
+ quint32 state = keyEvent->nativeModifiers();
+ quint32 ibusState = state;
+
+ if (keyEvent->type() != QEvent::KeyPress)
+ ibusState |= IBUS_RELEASE_MASK;
+
+ QDBusPendingReply<bool> reply = d->context->ProcessKeyEvent(sym, code - 8, ibusState);
+
+ if (m_eventFilterUseSynchronousMode || reply.isFinished()) {
+ bool retval = reply.value();
+ qCDebug(qtQpaInputMethods) << "filterEvent return" << code << sym << state << retval;
+ return retval;
+ }
+
+ Qt::KeyboardModifiers modifiers = keyEvent->modifiers();
+ const int qtcode = keyEvent->key();
+
+ // From QKeyEvent::modifiers()
+ switch (qtcode) {
+ case Qt::Key_Shift:
+ modifiers ^= Qt::ShiftModifier;
+ break;
+ case Qt::Key_Control:
+ modifiers ^= Qt::ControlModifier;
+ break;
+ case Qt::Key_Alt:
+ modifiers ^= Qt::AltModifier;
+ break;
+ case Qt::Key_Meta:
+ modifiers ^= Qt::MetaModifier;
+ break;
+ case Qt::Key_AltGr:
+ modifiers ^= Qt::GroupSwitchModifier;
+ break;
+ }
+
+ QVariantList args;
+ args << QVariant::fromValue(keyEvent->timestamp());
+ args << QVariant::fromValue(static_cast<uint>(keyEvent->type()));
+ args << QVariant::fromValue(qtcode);
+ args << QVariant::fromValue(code) << QVariant::fromValue(sym) << QVariant::fromValue(state);
+ args << QVariant::fromValue(keyEvent->text());
+ args << QVariant::fromValue(keyEvent->isAutoRepeat());
+
+ QIBusFilterEventWatcher *watcher = new QIBusFilterEventWatcher(reply, this, QGuiApplication::focusWindow(), modifiers, args);
+ QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &QIBusPlatformInputContext::filterEventFinished);
+
+ return true;
+}
+
+void QIBusPlatformInputContext::filterEventFinished(QDBusPendingCallWatcher *call)
+{
+ QIBusFilterEventWatcher *watcher = (QIBusFilterEventWatcher *) call;
+ QDBusPendingReply<bool> reply = *call;
+
+ if (reply.isError()) {
+ call->deleteLater();
+ return;
+ }
+
+ // Use watcher's window instead of the current focused window
+ // since there is a time lag until filterEventFinished() returns.
+ QWindow *window = watcher->window();
+
+ if (!window) {
+ call->deleteLater();
+ return;
+ }
+
+ Qt::KeyboardModifiers modifiers = watcher->modifiers();
+ QVariantList args = watcher->arguments();
+ const ulong time = static_cast<const ulong>(args.at(0).toUInt());
+ const QEvent::Type type = static_cast<const QEvent::Type>(args.at(1).toUInt());
+ const int qtcode = args.at(2).toInt();
+ const quint32 code = args.at(3).toUInt();
+ const quint32 sym = args.at(4).toUInt();
+ const quint32 state = args.at(5).toUInt();
+ const QString string = args.at(6).toString();
+ const bool isAutoRepeat = args.at(7).toBool();
+
+ // copied from QXcbKeyboard::handleKeyEvent()
+ bool retval = reply.value();
+ qCDebug(qtQpaInputMethods) << "filterEventFinished return" << code << sym << state << retval;
+ if (!retval) {
+ if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu
+ && window != NULL) {
+ const QPoint globalPos = window->screen()->handle()->cursor()->pos();
+ const QPoint pos = window->mapFromGlobal(globalPos);
+ QWindowSystemInterface::handleContextMenuEvent(window, false, pos,
+ globalPos, modifiers);
+ }
+ QWindowSystemInterface::handleExtendedKeyEvent(window, time, type, qtcode, modifiers,
+ code, sym, state, string, isAutoRepeat);
+
+ }
+ call->deleteLater();
+}
+
+QLocale QIBusPlatformInputContext::locale() const
+{
+ return d->locale;
+}
+
+void QIBusPlatformInputContext::socketChanged(const QString &str)
+{
+ qCDebug(qtQpaInputMethods) << "socketChanged";
+ Q_UNUSED (str);
+
+ m_timer.stop();
+
+ if (d->context)
+ disconnect(d->context);
+ if (d->bus && d->bus->isValid())
+ disconnect(d->bus);
+ if (d->connection)
+ d->connection->disconnectFromBus(QLatin1String("QIBusProxy"));
- keycode -= 8; // ###
- QDBusReply<bool> reply = d->context->ProcessKeyEvent(keyval, keycode, state);
+ m_timer.start(100);
+}
-// qDebug() << "x11FilterEvent return" << reply.value();
+// When getSocketPath() is modified, the bus is not established yet
+// so use m_timer.
+void QIBusPlatformInputContext::connectToBus()
+{
+ qCDebug(qtQpaInputMethods) << "QIBusPlatformInputContext::connectToBus";
+ d->initBus();
+ connectToContextSignals();
- return reply.value();
+ if (m_socketWatcher.files().size() == 0)
+ m_socketWatcher.addPath(QIBusPlatformInputContextPrivate::getSocketPath());
+}
+
+void QIBusPlatformInputContext::globalEngineChanged(const QString &engine_name)
+{
+ if (!d->bus || !d->bus->isValid())
+ return;
+
+ QIBusEngineDesc desc = d->bus->getGlobalEngine();
+ Q_ASSERT(engine_name == desc.engine_name);
+ QLocale locale(desc.language);
+ if (d->locale != locale) {
+ d->locale = locale;
+ emitLocaleChanged();
+ }
+}
+
+void QIBusPlatformInputContext::connectToContextSignals()
+{
+ if (d->bus && d->bus->isValid()) {
+ connect(d->bus, SIGNAL(GlobalEngineChanged(QString)), this, SLOT(globalEngineChanged(QString)));
+ }
+
+ if (d->context) {
+ connect(d->context, SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant)));
+ connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
+ connect(d->context, SIGNAL(DeleteSurroundingText(int,uint)), this, SLOT(deleteSurroundingText(int,uint)));
+ connect(d->context, SIGNAL(RequireSurroundingText()), this, SLOT(surroundingTextRequired()));
+ }
}
QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
- : connection(createConnection()),
+ : connection(0),
bus(0),
context(0),
valid(false),
+ busConnected(false),
needsSurroundingText(false)
{
+ valid = !QStandardPaths::findExecutable(QString::fromLocal8Bit("ibus-daemon"), QStringList()).isEmpty();
+ if (!valid)
+ return;
+ initBus();
+
+ if (bus && bus->isValid()) {
+ QIBusEngineDesc desc = bus->getGlobalEngine();
+ locale = QLocale(desc.language);
+ }
+}
+
+void QIBusPlatformInputContextPrivate::initBus()
+{
+ connection = createConnection();
+ busConnected = false;
+ createBusProxy();
+}
+
+void QIBusPlatformInputContextPrivate::createBusProxy()
+{
if (!connection || !connection->isConnected())
return;
@@ -334,13 +536,13 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
context->SetCapabilities(IBUS_CAP_PREEDIT_TEXT|IBUS_CAP_FOCUS|IBUS_CAP_SURROUNDING_TEXT);
if (debug)
- qDebug(">>>> valid!");
- valid = true;
+ qDebug(">>>> bus connected!");
+ busConnected = true;
}
-QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
+QString QIBusPlatformInputContextPrivate::getSocketPath()
{
- QByteArray display(getenv("DISPLAY"));
+ QByteArray display(qgetenv("DISPLAY"));
QByteArray host = "unix";
QByteArray displayNumber = "0";
@@ -356,9 +558,14 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
if (debug)
qDebug() << "host=" << host << "displayNumber" << displayNumber;
- QFile file(QDir::homePath() + QLatin1String("/.config/ibus/bus/") +
+ return QDir::homePath() + QLatin1String("/.config/ibus/bus/") +
QLatin1String(QDBusConnection::localMachineId()) +
- QLatin1Char('-') + QString::fromLocal8Bit(host) + QLatin1Char('-') + QString::fromLocal8Bit(displayNumber));
+ QLatin1Char('-') + QString::fromLocal8Bit(host) + QLatin1Char('-') + QString::fromLocal8Bit(displayNumber);
+}
+
+QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
+{
+ QFile file(getSocketPath());
if (!file.open(QFile::ReadOnly))
return 0;
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index 816da8d377..824e9c2073 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -35,11 +35,44 @@
#include <qpa/qplatforminputcontext.h>
+#include <QtCore/qpointer.h>
+#include <QtCore/QLocale>
+#include <QtDBus/qdbuspendingreply.h>
+#include <QFileSystemWatcher>
+#include <QTimer>
+#include <QWindow>
+
QT_BEGIN_NAMESPACE
class QIBusPlatformInputContextPrivate;
class QDBusVariant;
+class QIBusFilterEventWatcher: public QDBusPendingCallWatcher
+{
+public:
+ explicit QIBusFilterEventWatcher(const QDBusPendingCall &call,
+ QObject *parent = 0,
+ QWindow *window = 0,
+ const Qt::KeyboardModifiers modifiers = 0,
+ const QVariantList arguments = QVariantList())
+ : QDBusPendingCallWatcher(call, parent)
+ , m_window(window)
+ , m_modifiers(modifiers)
+ , m_arguments(arguments)
+ {}
+ ~QIBusFilterEventWatcher()
+ {}
+
+ inline QWindow *window() const { return m_window; }
+ inline const Qt::KeyboardModifiers modifiers() const { return m_modifiers; }
+ inline const QVariantList arguments() const { return m_arguments; }
+
+private:
+ QPointer<QWindow> m_window;
+ const Qt::KeyboardModifiers m_modifiers;
+ const QVariantList m_arguments;
+};
+
class QIBusPlatformInputContext : public QPlatformInputContext
{
Q_OBJECT
@@ -54,8 +87,8 @@ public:
void reset() Q_DECL_OVERRIDE;
void commit() Q_DECL_OVERRIDE;
void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
-
- Q_INVOKABLE bool x11FilterEvent(uint keyval, uint keycode, uint state, bool press);
+ bool filterEvent(const QEvent *event) Q_DECL_OVERRIDE;
+ QLocale locale() const Q_DECL_OVERRIDE;
public Q_SLOTS:
void commitText(const QDBusVariant &text);
@@ -63,9 +96,18 @@ public Q_SLOTS:
void cursorRectChanged();
void deleteSurroundingText(int offset, uint n_chars);
void surroundingTextRequired();
+ void filterEventFinished(QDBusPendingCallWatcher *call);
+ void socketChanged(const QString &str);
+ void connectToBus();
+ void globalEngineChanged(const QString &engine_name);
private:
QIBusPlatformInputContextPrivate *d;
+ bool m_eventFilterUseSynchronousMode;
+ QFileSystemWatcher m_socketWatcher;
+ QTimer m_timer;
+
+ void connectToContextSignals();
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp b/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp
index e6b255a06d..9efa6f7eb0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp
@@ -9,6 +9,8 @@
* before re-generating it.
*/
+#include <QtDBus/qdbusextratypes.h>
+
#include "qibusproxy.h"
/*
@@ -18,9 +20,36 @@
QIBusProxy::QIBusProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
{
+ this->connection().connect(service,
+ path,
+ this->interface(), // interface
+ QStringLiteral("GlobalEngineChanged"),
+ QStringList(),
+ QString(), // signature
+ this, SLOT(globalEngineChanged(QString)));
}
QIBusProxy::~QIBusProxy()
{
}
+QIBusEngineDesc QIBusProxy::getGlobalEngine()
+{
+ QIBusEngineDesc desc;
+ QDBusReply<QDBusVariant> reply = GetGlobalEngine();
+ QVariant variant = reply.value().variant();
+ if (!variant.isValid())
+ return desc;
+ QVariant child = variant.value<QDBusVariant>().variant();
+ if (!child.isValid())
+ return desc;
+ const QDBusArgument argument = child.value<QDBusArgument>();
+ argument >> desc;
+ return desc;
+}
+
+void QIBusProxy::globalEngineChanged(const QString &engine_name)
+{
+ emit GlobalEngineChanged(engine_name);
+}
+
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxy.h b/src/plugins/platforminputcontexts/ibus/qibusproxy.h
index 69443a524d..bbaebe1b96 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxy.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxy.h
@@ -20,6 +20,8 @@
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
+#include "qibustypes.h"
+
/*
* Proxy class for interface org.freedesktop.IBus
*/
@@ -29,6 +31,8 @@ class QIBusProxy: public QDBusAbstractInterface
public:
static inline const char *staticInterfaceName()
{ return "org.freedesktop.IBus"; }
+ static inline QString dbusInterfaceProperties()
+ { return QStringLiteral("org.freedesktop.DBus.Properties"); }
public:
QIBusProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
@@ -82,7 +86,26 @@ public Q_SLOTS: // METHODS
return asyncCallWithArgumentList(QLatin1String("RegisterComponent"), argumentList);
}
+ inline QDBusPendingReply<QDBusVariant> GetGlobalEngine()
+ {
+ if (!this->isValid() || this->service().isEmpty() || this->path().isEmpty())
+ return QDBusMessage::createError(this->lastError());
+
+ QDBusMessage msg = QDBusMessage::createMethodCall(this->service(),
+ this->path(),
+ dbusInterfaceProperties(),
+ QStringLiteral("Get"));
+ msg << this->interface() << QStringLiteral("GlobalEngine");
+ return this->connection().asyncCall(msg, this->timeout());
+ }
+
+ QIBusEngineDesc getGlobalEngine();
+
+private:
+ void globalEngineChanged(const QString &engine_name);
+
Q_SIGNALS: // SIGNALS
+ void GlobalEngineChanged(const QString &engine_name);
};
#endif
diff --git a/src/plugins/platforminputcontexts/ibus/qibustypes.cpp b/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
index d6be6cbb31..7cf3b24570 100644
--- a/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
@@ -37,6 +37,9 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(qtQpaInputMethods, "qt.qpa.input.methods")
+Q_LOGGING_CATEGORY(qtQpaInputMethodsSerialize, "qt.qpa.input.methods.serialize")
+
QIBusSerializable::QIBusSerializable()
{
}
@@ -202,7 +205,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const QIBusAttributeList &att
const QDBusArgument &operator>>(const QDBusArgument &arg, QIBusAttributeList &attrList)
{
-// qDebug() << "QIBusAttributeList::fromDBusArgument()" << arg.currentSignature();
+ qCDebug(qtQpaInputMethodsSerialize) << "QIBusAttributeList::fromDBusArgument()" << arg.currentSignature();
arg.beginStructure();
arg >> static_cast<QIBusSerializable &>(attrList);
@@ -225,9 +228,10 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, QIBusAttributeList &at
QList<QInputMethodEvent::Attribute> QIBusAttributeList::imAttributes() const
{
QHash<QPair<int, int>, QTextCharFormat> rangeAttrs;
+ const int numAttributes = attributes.size();
// Merge text fomats for identical ranges into a single QTextFormat.
- for (int i = 0; i < attributes.size(); ++i) {
+ for (int i = 0; i < numAttributes; ++i) {
const QIBusAttribute &attr = attributes.at(i);
const QTextCharFormat &format = attr.format();
@@ -239,8 +243,9 @@ QList<QInputMethodEvent::Attribute> QIBusAttributeList::imAttributes() const
// Assemble list in original attribute order.
QList<QInputMethodEvent::Attribute> imAttrs;
+ imAttrs.reserve(numAttributes);
- for (int i = 0; i < attributes.size(); ++i) {
+ for (int i = 0; i < numAttributes; ++i) {
const QIBusAttribute &attr = attributes.at(i);
const QTextFormat &format = attr.format();
@@ -275,7 +280,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const QIBusText &text)
const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusText &text)
{
-// qDebug() << "QIBusText::fromDBusArgument()" << arg.currentSignature();
+ qCDebug(qtQpaInputMethodsSerialize) << "QIBusText::fromDBusArgument()" << argument.currentSignature();
argument.beginStructure();
argument >> static_cast<QIBusSerializable &>(text);
@@ -289,4 +294,107 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusText &text)
return argument;
}
+QIBusEngineDesc::QIBusEngineDesc()
+ : engine_name(""),
+ longname(""),
+ description(""),
+ language(""),
+ license(""),
+ author(""),
+ icon(""),
+ layout(""),
+ rank(0),
+ hotkeys(""),
+ symbol(""),
+ setup(""),
+ layout_variant(""),
+ layout_option(""),
+ version(""),
+ textdomain(""),
+ iconpropkey("")
+{
+ name = "IBusEngineDesc";
+}
+
+QIBusEngineDesc::~QIBusEngineDesc()
+{
+}
+
+QDBusArgument &operator<<(QDBusArgument &argument, const QIBusEngineDesc &desc)
+{
+ argument.beginStructure();
+
+ argument << static_cast<const QIBusSerializable &>(desc);
+
+ argument << desc.engine_name;
+ argument << desc.longname;
+ argument << desc.description;
+ argument << desc.language;
+ argument << desc.license;
+ argument << desc.author;
+ argument << desc.icon;
+ argument << desc.layout;
+ argument << desc.rank;
+ argument << desc.hotkeys;
+ argument << desc.symbol;
+ argument << desc.setup;
+ argument << desc.layout_variant;
+ argument << desc.layout_option;
+ argument << desc.version;
+ argument << desc.textdomain;
+ argument << desc.iconpropkey;
+
+ argument.endStructure();
+ return argument;
+}
+
+const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusEngineDesc &desc)
+{
+ qCDebug(qtQpaInputMethodsSerialize) << "QIBusEngineDesc::fromDBusArgument()" << argument.currentSignature();
+ argument.beginStructure();
+
+ argument >> static_cast<QIBusSerializable &>(desc);
+
+ argument >> desc.engine_name;
+ argument >> desc.longname;
+ argument >> desc.description;
+ argument >> desc.language;
+ argument >> desc.license;
+ argument >> desc.author;
+ argument >> desc.icon;
+ argument >> desc.layout;
+ argument >> desc.rank;
+ argument >> desc.hotkeys;
+ argument >> desc.symbol;
+ argument >> desc.setup;
+ // Previous IBusEngineDesc supports the arguments between engine_name
+ // and setup.
+ if (argument.currentSignature() == "") {
+ argument.endStructure();
+ return argument;
+ }
+ argument >> desc.layout_variant;
+ argument >> desc.layout_option;
+ // Previous IBusEngineDesc supports the arguments between engine_name
+ // and layout_option.
+ if (argument.currentSignature() == "") {
+ argument.endStructure();
+ return argument;
+ }
+ argument >> desc.version;
+ if (argument.currentSignature() == "") {
+ argument.endStructure();
+ return argument;
+ }
+ argument >> desc.textdomain;
+ if (argument.currentSignature() == "") {
+ argument.endStructure();
+ return argument;
+ }
+ argument >> desc.iconpropkey;
+
+ argument.endStructure();
+ return argument;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforminputcontexts/ibus/qibustypes.h b/src/plugins/platforminputcontexts/ibus/qibustypes.h
index cb0d9ff2aa..b4145863bc 100644
--- a/src/plugins/platforminputcontexts/ibus/qibustypes.h
+++ b/src/plugins/platforminputcontexts/ibus/qibustypes.h
@@ -37,9 +37,13 @@
#include <qevent.h>
#include <QDBusArgument>
#include <QTextCharFormat>
+#include <QLoggingCategory>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qtQpaInputMethods)
+Q_DECLARE_LOGGING_CATEGORY(qtQpaInputMethodsSerialize)
+
class QIBusSerializable
{
public:
@@ -100,6 +104,31 @@ public:
QIBusAttributeList attributes;
};
+class QIBusEngineDesc : public QIBusSerializable
+{
+public:
+ QIBusEngineDesc();
+ ~QIBusEngineDesc();
+
+ QString engine_name;
+ QString longname;
+ QString description;
+ QString language;
+ QString license;
+ QString author;
+ QString icon;
+ QString layout;
+ unsigned int rank;
+ QString hotkeys;
+ QString symbol;
+ QString setup;
+ QString layout_variant;
+ QString layout_option;
+ QString version;
+ QString textdomain;
+ QString iconpropkey;
+};
+
QDBusArgument &operator<<(QDBusArgument &argument, const QIBusSerializable &object);
const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusSerializable &object);
@@ -112,11 +141,15 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, QIBusAttributeList &at
QDBusArgument &operator<<(QDBusArgument &argument, const QIBusText &text);
const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusText &text);
+QDBusArgument &operator<<(QDBusArgument &argument, const QIBusEngineDesc &desc);
+const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusEngineDesc &desc);
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QIBusSerializable)
Q_DECLARE_METATYPE(QIBusAttribute)
Q_DECLARE_METATYPE(QIBusAttributeList)
Q_DECLARE_METATYPE(QIBusText)
+Q_DECLARE_METATYPE(QIBusEngineDesc)
#endif
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp
index 8ee3ff88d1..9cc5e95378 100644
--- a/src/plugins/platforms/android/androidjniinput.cpp
+++ b/src/plugins/platforms/android/androidjniinput.cpp
@@ -51,6 +51,7 @@ namespace QtAndroidInput
static bool m_ignoreMouseEvents = false;
static bool m_softwareKeyboardVisible = false;
+ static QRect m_softwareKeyboardRect;
static QList<QWindowSystemInterface::TouchPoint> m_touchPoints;
@@ -70,18 +71,20 @@ namespace QtAndroidInput
candidatesEnd);
}
- void showSoftwareKeyboard(int left, int top, int width, int height, int inputHints)
+ void showSoftwareKeyboard(int left, int top, int width, int height, int inputHints, int enterKeyType)
{
QJNIObjectPrivate::callStaticMethod<void>(applicationClass(),
"showSoftwareKeyboard",
- "(IIIII)V",
+ "(IIIIII)V",
left,
top,
width,
height,
- inputHints);
+ inputHints,
+ enterKeyType
+ );
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
- qDebug() << "@@@ SHOWSOFTWAREKEYBOARD" << left << top << width << height << inputHints;
+ qDebug() << "@@@ SHOWSOFTWAREKEYBOARD" << left << top << width << height << inputHints << enterKeyType;
#endif
}
@@ -106,6 +109,11 @@ namespace QtAndroidInput
return m_softwareKeyboardVisible;
}
+ QRect softwareKeyboardRect()
+ {
+ return m_softwareKeyboardRect;
+ }
+
static void mouseDown(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
{
@@ -238,6 +246,52 @@ namespace QtAndroidInput
QWindowSystemInterface::handleTouchEvent(window, touchDevice, m_touchPoints);
}
+ static void tabletEvent(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint deviceId, jlong time, jint action,
+ jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure)
+ {
+ QPointF globalPosF(x, y);
+ QPoint globalPos((int)x, (int)y);
+ QWindow *tlw = topLevelWindowAt(globalPos);
+ QPointF localPos = tlw ? (globalPosF - tlw->position()) : globalPosF;
+
+ // Galaxy Note with plain Android:
+ // 0 1 0 stylus press
+ // 2 1 0 stylus drag
+ // 1 1 0 stylus release
+ // 0 1 2 stylus press with side-button held
+ // 2 1 2 stylus drag with side-button held
+ // 1 1 2 stylus release with side-button held
+ // Galaxy Note 4 with Samsung firmware:
+ // 0 1 0 stylus press
+ // 2 1 0 stylus drag
+ // 1 1 0 stylus release
+ // 211 1 2 stylus press with side-button held
+ // 213 1 2 stylus drag with side-button held
+ // 212 1 2 stylus release with side-button held
+ // when action == ACTION_UP (1) it's a release; otherwise we say which button is pressed
+ Qt::MouseButtons buttons = Qt::NoButton;
+ switch (action) {
+ case 1: // ACTION_UP
+ case 212: // stylus release while side-button held on Galaxy Note 4
+ buttons = Qt::NoButton;
+ break;
+ default: // action is press or drag
+ if (buttonState == 0)
+ buttons = Qt::LeftButton;
+ else // 2 means RightButton
+ buttons = Qt::MouseButtons(buttonState);
+ break;
+ }
+
+#ifdef QT_DEBUG_ANDROID_STYLUS
+ qDebug() << action << pointerType << buttonState << '@' << x << y << "pressure" << pressure << ": buttons" << buttons;
+#endif
+
+ QWindowSystemInterface::handleTabletEvent(tlw, ulong(time),
+ localPos, globalPosF, QTabletEvent::Stylus, pointerType,
+ buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier);
+ }
+
static int mapAndroidKey(int key)
{
// 0--9 0x00000007 -- 0x00000010
@@ -633,7 +687,7 @@ namespace QtAndroidInput
return Qt::Key_AudioCycleTrack;
default:
- qWarning() << "Unhandled key code " << key << "!";
+ qWarning() << "Unhandled key code " << key << '!';
return 0;
}
}
@@ -686,14 +740,35 @@ namespace QtAndroidInput
static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean visibility)
{
m_softwareKeyboardVisible = visibility;
+ if (!visibility)
+ m_softwareKeyboardRect = QRect();
+
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
- if (inputContext && qGuiApp)
+ if (inputContext && qGuiApp) {
inputContext->emitInputPanelVisibleChanged();
+ if (!visibility)
+ inputContext->emitKeyboardRectChanged();
+ }
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
qDebug() << "@@@ KEYBOARDVISIBILITYCHANGED" << inputContext;
#endif
}
+ static void keyboardGeometryChanged(JNIEnv */*env*/, jobject /*thiz*/, jint x, jint y, jint w, jint h)
+ {
+ QRect r = QRect(x, y, w, h);
+ if (r == m_softwareKeyboardRect)
+ return;
+ m_softwareKeyboardRect = r;
+ QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
+ if (inputContext && qGuiApp)
+ inputContext->emitKeyboardRectChanged();
+
+#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
+ qDebug() << "@@@ KEYBOARDRECTCHANGED" << m_softwareKeyboardRect;
+#endif
+ }
+
static JNINativeMethod methods[] = {
{"touchBegin","(I)V",(void*)touchBegin},
{"touchAdd","(IIIZIIFF)V",(void*)touchAdd},
@@ -702,9 +777,11 @@ namespace QtAndroidInput
{"mouseUp", "(III)V", (void *)mouseUp},
{"mouseMove", "(III)V", (void *)mouseMove},
{"longPress", "(III)V", (void *)longPress},
+ {"tabletEvent", "(IIJIIIFFF)V", (void *)tabletEvent},
{"keyDown", "(IIIZ)V", (void *)keyDown},
{"keyUp", "(IIIZ)V", (void *)keyUp},
- {"keyboardVisibilityChanged", "(Z)V", (void *)keyboardVisibilityChanged}
+ {"keyboardVisibilityChanged", "(Z)V", (void *)keyboardVisibilityChanged},
+ {"keyboardGeometryChanged", "(IIII)V", (void *)keyboardGeometryChanged}
};
bool registerNatives(JNIEnv *env)
diff --git a/src/plugins/platforms/android/androidjniinput.h b/src/plugins/platforms/android/androidjniinput.h
index b5a2ef06e4..7132d1fc4e 100644
--- a/src/plugins/platforms/android/androidjniinput.h
+++ b/src/plugins/platforms/android/androidjniinput.h
@@ -35,16 +35,18 @@
#define ANDROIDJNIINPUT_H
#include <jni.h>
#include <QtCore/qglobal.h>
+#include <QtCore/QRect>
QT_BEGIN_NAMESPACE
namespace QtAndroidInput
{
// Software keyboard support
- void showSoftwareKeyboard(int top, int left, int width, int height, int inputHints);
+ void showSoftwareKeyboard(int top, int left, int width, int height, int inputHints, int enterKeyType);
void resetSoftwareKeyboard();
void hideSoftwareKeyboard();
bool isSoftwareKeyboardVisible();
+ QRect softwareKeyboardRect();
void updateSelection(int selStart, int selEnd, int candidatesStart, int candidatesEnd);
// Software keyboard support
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index a04bf1eccb..dd9154f8d2 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -34,6 +34,7 @@
#include <dlfcn.h>
#include <pthread.h>
+#include <semaphore.h>
#include <qplugin.h>
#include <qdebug.h>
@@ -55,6 +56,7 @@
#include <QtCore/private/qjnihelpers_p.h>
#include <QtCore/private/qjni_p.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <qpa/qwindowsysteminterface.h>
@@ -90,6 +92,8 @@ extern "C" typedef int (*Main)(int, char **); //use the standard main method to
static Main m_main = nullptr;
static void *m_mainLibraryHnd = nullptr;
static QList<QByteArray> m_applicationParams;
+pthread_t m_qtAppThread = 0;
+static sem_t m_exitSemaphore, m_terminateSemaphore;
struct SurfaceData
{
@@ -109,6 +113,7 @@ static QAndroidPlatformIntegration *m_androidPlatformIntegration = nullptr;
static int m_desktopWidthPixels = 0;
static int m_desktopHeightPixels = 0;
static double m_scaledDensity = 0;
+static double m_density = 1.0;
static volatile bool m_pauseApplication;
@@ -157,6 +162,11 @@ namespace QtAndroid
return m_scaledDensity;
}
+ double pixelDensity()
+ {
+ return m_density;
+ }
+
JavaVM *javaVM()
{
return m_javaVM;
@@ -292,7 +302,7 @@ namespace QtAndroid
QString manufacturer = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MANUFACTURER", "Ljava/lang/String;").toString();
QString model = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MODEL", "Ljava/lang/String;").toString();
- return manufacturer + QStringLiteral(" ") + model;
+ return manufacturer + QLatin1Char(' ') + model;
}
int createSurface(AndroidSurfaceClient *client, const QRect &geometry, bool onTop, int imageDepth)
@@ -432,7 +442,6 @@ static void *startMainMethod(void */*data*/)
params[i] = static_cast<const char *>(m_applicationParams[i].constData());
int ret = m_main(m_applicationParams.length(), const_cast<char **>(params.data()));
- Q_UNUSED(ret);
if (m_mainLibraryHnd) {
int res = dlclose(m_mainLibraryHnd);
@@ -448,6 +457,12 @@ static void *startMainMethod(void */*data*/)
if (vm != 0)
vm->DetachCurrentThread();
+ sem_post(&m_terminateSemaphore);
+ sem_wait(&m_exitSemaphore);
+ sem_destroy(&m_exitSemaphore);
+
+ // We must call exit() to ensure that all global objects will be destructed
+ exit(ret);
return 0;
}
@@ -490,13 +505,18 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para
}
if (!m_main) {
- qCritical() << "dlsym failed:" << dlerror();
- qCritical() << "Could not find main method";
+ qCritical() << "dlsym failed:" << dlerror() << endl
+ << "Could not find main method";
return false;
}
- pthread_t appThread;
- return pthread_create(&appThread, nullptr, startMainMethod, nullptr) == 0;
+ if (sem_init(&m_exitSemaphore, 0, 0) == -1)
+ return false;
+
+ if (sem_init(&m_terminateSemaphore, 0, 0) == -1)
+ return false;
+
+ return pthread_create(&m_qtAppThread, nullptr, startMainMethod, nullptr) == 0;
}
@@ -510,6 +530,8 @@ static void quitQtAndroidPlugin(JNIEnv *env, jclass /*clazz*/)
static void terminateQt(JNIEnv *env, jclass /*clazz*/)
{
+ sem_wait(&m_terminateSemaphore);
+ sem_destroy(&m_terminateSemaphore);
env->DeleteGlobalRef(m_applicationClass);
env->DeleteGlobalRef(m_classLoaderObject);
if (m_resourcesObj)
@@ -527,6 +549,8 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
m_androidPlatformIntegration = nullptr;
delete m_androidAssetsFileEngineHandler;
m_androidAssetsFileEngineHandler = nullptr;
+ sem_post(&m_exitSemaphore);
+ pthread_join(m_qtAppThread, nullptr);
}
static void setSurface(JNIEnv *env, jobject /*thiz*/, jint id, jobject jSurface, jint w, jint h)
@@ -546,7 +570,8 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jint id, jobject jSurface,
static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
jint widthPixels, jint heightPixels,
jint desktopWidthPixels, jint desktopHeightPixels,
- jdouble xdpi, jdouble ydpi, jdouble scaledDensity)
+ jdouble xdpi, jdouble ydpi,
+ jdouble scaledDensity, jdouble density)
{
// Android does not give us the correct screen size for immersive mode, but
// the surface does have the right size
@@ -557,6 +582,7 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
m_desktopWidthPixels = desktopWidthPixels;
m_desktopHeightPixels = desktopHeightPixels;
m_scaledDensity = scaledDensity;
+ m_density = density;
if (!m_androidPlatformIntegration) {
QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels,
@@ -600,6 +626,11 @@ static void updateApplicationState(JNIEnv */*env*/, jobject /*thiz*/, jint state
return;
}
+ if (state == Qt::ApplicationActive)
+ QtAndroidPrivate::handleResume();
+ else if (state == Qt::ApplicationInactive)
+ QtAndroidPrivate::handlePause();
+
if (state <= Qt::ApplicationInactive) {
// NOTE: sometimes we will receive two consecutive suspended notifications,
// In the second suspended notification, QWindowSystemInterface::flushWindowSystemEvents()
@@ -677,7 +708,7 @@ static JNINativeMethod methods[] = {
{"startQtApplication", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)startQtApplication},
{"quitQtAndroidPlugin", "()V", (void *)quitQtAndroidPlugin},
{"terminateQt", "()V", (void *)terminateQt},
- {"setDisplayMetrics", "(IIIIDDD)V", (void *)setDisplayMetrics},
+ {"setDisplayMetrics", "(IIIIDDDD)V", (void *)setDisplayMetrics},
{"setSurface", "(ILjava/lang/Object;II)V", (void *)setSurface},
{"updateWindow", "()V", (void *)updateWindow},
{"updateApplicationState", "(I)V", (void *)updateApplicationState},
diff --git a/src/plugins/platforms/android/androidjnimain.h b/src/plugins/platforms/android/androidjnimain.h
index 4d037f4b74..cdedeb38f8 100644
--- a/src/plugins/platforms/android/androidjnimain.h
+++ b/src/plugins/platforms/android/androidjnimain.h
@@ -71,6 +71,7 @@ namespace QtAndroid
int desktopWidthPixels();
int desktopHeightPixels();
double scaledDensity();
+ double pixelDensity();
JavaVM *javaVM();
AAssetManager *assetManager();
jclass applicationClass();
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
index 64be75b63f..6ad3d2dc9a 100644
--- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
+++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
@@ -122,8 +122,8 @@ public:
m_assetFile = 0;
m_assetDir = asset;
m_fileName = fileName;
- if (!m_fileName.endsWith(QChar(QLatin1Char('/'))))
- m_fileName += "/";
+ if (!m_fileName.endsWith(QLatin1Char('/')))
+ m_fileName += QLatin1Char('/');
}
~AndroidAbstractFileEngine()
@@ -231,8 +231,8 @@ public:
return;
m_fileName = file;
- if (!m_fileName.endsWith(QChar(QLatin1Char('/'))))
- m_fileName += "/";
+ if (!m_fileName.endsWith(QLatin1Char('/')))
+ m_fileName += QLatin1Char('/');
close();
}
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index d264f74d66..0eddb26959 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -342,7 +342,7 @@ QAndroidInputContext::QAndroidInputContext()
if (clazz == NULL) {
qCritical() << "Native registration unable to find class '"
<< QtNativeInputConnectionClassName
- << "'";
+ << '\'';
return;
}
@@ -350,7 +350,7 @@ QAndroidInputContext::QAndroidInputContext()
if (env->RegisterNatives(clazz, methods, sizeof(methods) / sizeof(methods[0])) < 0) {
qCritical() << "RegisterNatives failed for '"
<< QtNativeInputConnectionClassName
- << "'";
+ << '\'';
return;
}
@@ -358,7 +358,7 @@ QAndroidInputContext::QAndroidInputContext()
if (clazz == NULL) {
qCritical() << "Native registration unable to find class '"
<< QtExtractedTextClassName
- << "'";
+ << '\'';
return;
}
@@ -512,7 +512,7 @@ void QAndroidInputContext::invokeAction(QInputMethod::Action action, int cursorP
QRectF QAndroidInputContext::keyboardRect() const
{
- return QPlatformInputContext::keyboardRect();
+ return QtAndroidInput::softwareKeyboardRect();
}
bool QAndroidInputContext::isAnimating() const
@@ -545,7 +545,9 @@ void QAndroidInputContext::showInputPanel()
rect.top(),
rect.width(),
rect.height(),
- query->value(Qt::ImHints).toUInt());
+ query->value(Qt::ImHints).toUInt(),
+ query->value(Qt::ImEnterKeyType).toUInt()
+ );
}
void QAndroidInputContext::showInputPanelLater(Qt::ApplicationState state)
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
index be1a3d7bdf..5725f5793e 100644
--- a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
+++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
@@ -69,12 +69,12 @@ QStringList QAndroidPlatformFontDatabase::fallbacksForFamily(const QString &fami
{
QStringList result;
if (styleHint == QFont::Monospace || styleHint == QFont::Courier)
- result.append(QString(qgetenv("QT_ANDROID_FONTS_MONOSPACE")).split(";"));
+ result.append(QString(qgetenv("QT_ANDROID_FONTS_MONOSPACE")).split(QLatin1Char(';')));
else if (styleHint == QFont::Serif)
- result.append(QString(qgetenv("QT_ANDROID_FONTS_SERIF")).split(";"));
+ result.append(QString(qgetenv("QT_ANDROID_FONTS_SERIF")).split(QLatin1Char(';')));
else
- result.append(QString(qgetenv("QT_ANDROID_FONTS")).split(";"));
- result.append(QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script));
+ result.append(QString(qgetenv("QT_ANDROID_FONTS")).split(QLatin1Char(';')));
+ result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
return result;
}
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp
index 7a509e4d61..8152f1d53f 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.cpp
+++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp
@@ -111,9 +111,13 @@ QAndroidPlatformScreen::~QAndroidPlatformScreen()
QWindow *QAndroidPlatformScreen::topWindow() const
{
- foreach (QAndroidPlatformWindow *w, m_windowStack)
- if (w->window()->type() == Qt::Window || w->window()->type() == Qt::Dialog)
+ foreach (QAndroidPlatformWindow *w, m_windowStack) {
+ if (w->window()->type() == Qt::Window ||
+ w->window()->type() == Qt::Popup ||
+ w->window()->type() == Qt::Dialog) {
return w->window();
+ }
+ }
return 0;
}
@@ -382,6 +386,11 @@ QDpi QAndroidPlatformScreen::logicalDpi() const
return QDpi(lDpi, lDpi);
}
+qreal QAndroidPlatformScreen::pixelDensity() const
+{
+ return QtAndroid::pixelDensity();
+}
+
Qt::ScreenOrientation QAndroidPlatformScreen::orientation() const
{
return QAndroidPlatformIntegration::m_orientation;
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h
index f4f9cedb70..1b7bc91c83 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.h
+++ b/src/plugins/platforms/android/qandroidplatformscreen.h
@@ -95,6 +95,7 @@ protected:
private:
QDpi logicalDpi() const;
+ qreal pixelDensity() const;
Qt::ScreenOrientation orientation() const;
Qt::ScreenOrientation nativeOrientation() const;
void surfaceChanged(JNIEnv *env, jobject surface, int w, int h);
diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp
index 3e2ae7c939..5531910555 100644
--- a/src/plugins/platforms/android/qandroidplatformtheme.cpp
+++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp
@@ -31,6 +31,7 @@
**
****************************************************************************/
+#include "androidjnimain.h"
#include "androidjnimenu.h"
#include "qandroidplatformtheme.h"
#include "qandroidplatformmenubar.h"
@@ -45,6 +46,7 @@
#include <QVariant>
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <qandroidplatformintegration.h>
QT_BEGIN_NAMESPACE
@@ -216,6 +218,7 @@ QJsonObject AndroidStyle::loadStyleData()
static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette)
{
+ double pixelDensity = QHighDpiScaling::isActive() ? QtAndroid::pixelDensity() : 1.0;
std::shared_ptr<AndroidStyle> style(new AndroidStyle);
style->m_styleData = AndroidStyle::loadStyleData();
if (style->m_styleData.isEmpty())
@@ -245,7 +248,7 @@ static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette)
// Font size (in pixels)
attributeIterator = item.find(QLatin1String("TextAppearance_textSize"));
if (attributeIterator != item.constEnd())
- font.setPixelSize(int(attributeIterator.value().toDouble()));
+ font.setPixelSize(int(attributeIterator.value().toDouble() / pixelDensity));
// Font style
attributeIterator = item.find(QLatin1String("TextAppearance_textStyle"));
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index ad6cb3a1fc..ba0e6b001a 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -12,7 +12,6 @@ OBJECTIVE_SOURCES += main.mm \
qcocoawindow.mm \
qnsview.mm \
qnsviewaccessibility.mm \
- qcocoaautoreleasepool.mm \
qnswindowdelegate.mm \
qcocoanativeinterface.mm \
qcocoaeventdispatcher.mm \
@@ -48,7 +47,6 @@ HEADERS += qcocoaintegration.h \
qcocoabackingstore.h \
qcocoawindow.h \
qnsview.h \
- qcocoaautoreleasepool.h \
qnswindowdelegate.h \
qcocoanativeinterface.h \
qcocoaeventdispatcher.h \
diff --git a/src/plugins/platforms/cocoa/main.mm b/src/plugins/platforms/cocoa/main.mm
index b7e8fa1fca..43ff715161 100644
--- a/src/plugins/platforms/cocoa/main.mm
+++ b/src/plugins/platforms/cocoa/main.mm
@@ -50,11 +50,9 @@ public:
QPlatformIntegration * QCocoaIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
- Q_UNUSED(paramList);
-
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (system.compare(QLatin1String("cocoa"), Qt::CaseInsensitive) == 0)
- return new QCocoaIntegration;
+ return new QCocoaIntegration(paramList);
return 0;
}
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.h b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
index 061dfac156..228643ab26 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
@@ -38,6 +38,8 @@
#include <QtGui>
#include <qpa/qplatformaccessibility.h>
+#ifndef QT_NO_ACCESSIBILITY
+
QT_BEGIN_NAMESPACE
class QCocoaAccessibility : public QPlatformAccessibility
@@ -45,10 +47,10 @@ class QCocoaAccessibility : public QPlatformAccessibility
public:
QCocoaAccessibility();
~QCocoaAccessibility();
- void notifyAccessibilityUpdate(QAccessibleEvent *event);
- void setRootObject(QObject *o);
- void initialize();
- void cleanup();
+ void notifyAccessibilityUpdate(QAccessibleEvent *event) Q_DECL_OVERRIDE;
+ void setRootObject(QObject *o) Q_DECL_OVERRIDE;
+ void initialize() Q_DECL_OVERRIDE;
+ void cleanup() Q_DECL_OVERRIDE;
};
namespace QCocoaAccessible {
@@ -85,4 +87,6 @@ id getValueAttribute(QAccessibleInterface *interface);
QT_END_NAMESPACE
-#endif
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QCOCOAACCESIBILITY_H
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 03f585d19d..723c341e59 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -37,6 +37,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
QCocoaAccessibility::QCocoaAccessibility()
{
@@ -49,6 +51,8 @@ QCocoaAccessibility::~QCocoaAccessibility()
void QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
{
+ if (!isActive() || !event->accessibleInterface())
+ return;
QMacAccessibilityElement *element = [QMacAccessibilityElement elementWithId: event->uniqueId()];
if (!element) {
qWarning() << "QCocoaAccessibility::notifyAccessibilityUpdate: invalid element";
@@ -374,5 +378,7 @@ id getValueAttribute(QAccessibleInterface *interface)
} // namespace QCocoaAccessible
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
index 9f56d306f4..73aeae129b 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
@@ -37,6 +37,8 @@
#include "qt_mac_p.h"
+#ifndef QT_NO_ACCESSIBILITY
+
#import <Cocoa/Cocoa.h>
#import <AppKit/NSAccessibility.h>
@@ -56,4 +58,6 @@
QT_NAMESPACE_ALIAS_OBJC_CLASS(QMacAccessibilityElement);
-#endif
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QCOCOAACCESIBILITYELEMENT_H
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 6769f4ab0c..608a7583c0 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -42,11 +42,13 @@
QT_USE_NAMESPACE
-static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &offset, NSUInteger *start = 0, NSUInteger *end = 0)
+#ifndef QT_NO_ACCESSIBILITY
+
+static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *offset, NSUInteger *start = 0, NSUInteger *end = 0)
{
- Q_ASSERT(line == -1 || offset == -1);
- Q_ASSERT(line != -1 || offset != -1);
- Q_ASSERT(offset <= text->characterCount());
+ Q_ASSERT(*line == -1 || *offset == -1);
+ Q_ASSERT(*line != -1 || *offset != -1);
+ Q_ASSERT(*offset <= text->characterCount());
int curLine = -1;
int curStart = 0, curEnd = 0;
@@ -73,14 +75,14 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of
if (nextEnd == curEnd)
++curEnd;
}
- } while ((line == -1 || curLine < line) && (offset == -1 || (curEnd <= offset)) && curEnd <= text->characterCount());
+ } while ((*line == -1 || curLine < *line) && (*offset == -1 || (curEnd <= *offset)) && curEnd <= text->characterCount());
curEnd = qMin(curEnd, text->characterCount());
- if (line == -1)
- line = curLine;
- if (offset == -1)
- offset = curStart;
+ if (*line == -1)
+ *line = curLine;
+ if (*offset == -1)
+ *offset = curStart;
Q_ASSERT(curStart >= 0);
Q_ASSERT(curEnd >= 0);
@@ -336,7 +338,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of
if (QAccessibleTextInterface *text = iface->textInterface()) {
int line = -1;
int position = text->cursorPosition();
- convertLineOffset(text, line, position);
+ convertLineOffset(text, &line, &position);
return [NSNumber numberWithInt: line];
}
return nil;
@@ -395,7 +397,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of
if (index < 0 || index > iface->textInterface()->characterCount())
return nil;
int line = -1;
- convertLineOffset(iface->textInterface(), line, index);
+ convertLineOffset(iface->textInterface(), &line, &index);
return [NSNumber numberWithInt:line];
}
if ([attribute isEqualToString: NSAccessibilityRangeForLineParameterizedAttribute]) {
@@ -405,7 +407,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of
int lineOffset = -1;
NSUInteger startOffset = 0;
NSUInteger endOffset = 0;
- convertLineOffset(iface->textInterface(), line, lineOffset, &startOffset, &endOffset);
+ convertLineOffset(iface->textInterface(), &line, &lineOffset, &startOffset, &endOffset);
return [NSValue valueWithRange:NSMakeRange(startOffset, endOffset - startOffset)];
}
if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -588,3 +590,5 @@ static void convertLineOffset(QAccessibleTextInterface *text, int &line, int &of
}
@end
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
index 04e51d5392..abaaba91a5 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
@@ -100,6 +100,7 @@
- (void)setReflectionDelegate:(NSObject <NSApplicationDelegate> *)oldDelegate;
- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent;
- (void) removeAppleEventHandlers;
+- (bool) inLaunch;
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaApplicationDelegate);
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 6c673a4f5d..caa8884661 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -221,12 +221,8 @@ QT_END_NAMESPACE
const QWindowList topLevels = QGuiApplication::topLevelWindows();
for (int i = 0; i < topLevels.size(); ++i) {
QWindow *topLevelWindow = topLevels.at(i);
- // Widgets have alreay received a CloseEvent from the QApplication
- // QCloseEvent handler. (see canQuit above). Prevent running the
- // CloseEvent logic twice, call close() directly.
- if (topLevelWindow->inherits("QWidgetWindow"))
- topLevelWindow->close();
- else
+ // Already closed windows will not have a platform window, skip those
+ if (topLevelWindow->handle())
QWindowSystemInterface::handleCloseEvent(topLevelWindow);
}
QWindowSystemInterface::flushWindowSystemEvents();
@@ -284,6 +280,11 @@ QT_END_NAMESPACE
[eventManager removeEventHandlerForEventClass:kInternetEventClass andEventID:kAEGetURL];
}
+- (bool) inLaunch
+{
+ return inLaunch;
+}
+
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
Q_UNUSED(aNotification);
diff --git a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.h b/src/plugins/platforms/cocoa/qcocoaautoreleasepool.h
deleted file mode 100644
index 8b2a9f3788..0000000000
--- a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QCOCOAAUTORELEASEPOOL_H
-#define QCOCOAAUTORELEASEPOOL_H
-
-#undef slots
-#include <qglobal.h>
-#include <Cocoa/Cocoa.h>
-
-QT_BEGIN_NAMESPACE
-class QCocoaAutoReleasePool
-{
-public:
- QCocoaAutoReleasePool();
- ~QCocoaAutoReleasePool();
-
-private:
- NSAutoreleasePool *pool;
-};
-QT_END_NAMESPACE
-
-#endif // QCOCOAAUTORELEASEPOOL_H
diff --git a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm b/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm
deleted file mode 100644
index 8f30365186..0000000000
--- a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qcocoaautoreleasepool.h"
-
-QT_BEGIN_NAMESPACE
-
-QCocoaAutoReleasePool::QCocoaAutoReleasePool()
-{
- pool = [[NSAutoreleasePool alloc] init];
-}
-
-QCocoaAutoReleasePool::~QCocoaAutoReleasePool()
-{
- [pool release];
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index 3737584c4c..5a199de4a5 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -49,12 +49,12 @@ public:
QCocoaBackingStore(QWindow *window);
~QCocoaBackingStore();
- QPaintDevice *paintDevice();
- void flush(QWindow *widget, const QRegion &region, const QPoint &offset);
- QImage toImage() const;
- void resize (const QSize &size, const QRegion &);
- bool scroll(const QRegion &area, int dx, int dy);
- void beginPaint(const QRegion &region);
+ QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
+ void flush(QWindow *widget, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
+ QImage toImage() const Q_DECL_OVERRIDE;
+ void resize (const QSize &size, const QRegion &) Q_DECL_OVERRIDE;
+ bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE;
+ void beginPaint(const QRegion &region) Q_DECL_OVERRIDE;
qreal getBackingStoreDevicePixelRatio();
private:
diff --git a/src/plugins/platforms/cocoa/qcocoaclipboard.h b/src/plugins/platforms/cocoa/qcocoaclipboard.h
index e3df9a99b1..e53942b068 100644
--- a/src/plugins/platforms/cocoa/qcocoaclipboard.h
+++ b/src/plugins/platforms/cocoa/qcocoaclipboard.h
@@ -47,10 +47,10 @@ class QCocoaClipboard : public QObject, public QPlatformClipboard
public:
QCocoaClipboard();
- QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
- void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
- bool supportsMode(QClipboard::Mode mode) const;
- bool ownsMode(QClipboard::Mode mode) const;
+ QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
+ void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
+ bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
+ bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
private Q_SLOTS:
void handleApplicationStateChanged(Qt::ApplicationState state);
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
index 3183705330..705f97cd2a 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
@@ -43,14 +43,14 @@ class QCocoaColorDialogHelper : public QPlatformColorDialogHelper
{
public:
QCocoaColorDialogHelper();
- virtual ~QCocoaColorDialogHelper();
+ ~QCocoaColorDialogHelper();
- void exec();
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent);
- void hide();
+ void exec() Q_DECL_OVERRIDE;
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
+ void hide() Q_DECL_OVERRIDE;
- void setCurrentColor(const QColor&);
- QColor currentColor() const;
+ void setCurrentColor(const QColor&) Q_DECL_OVERRIDE;
+ QColor currentColor() const Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h
index cc6cbaf59e..d104939f0c 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.h
+++ b/src/plugins/platforms/cocoa/qcocoacursor.h
@@ -47,9 +47,9 @@ public:
QCocoaCursor();
~QCocoaCursor();
- virtual void changeCursor(QCursor *cursor, QWindow *window);
- virtual QPoint pos() const;
- virtual void setPos(const QPoint &position);
+ void changeCursor(QCursor *cursor, QWindow *window) Q_DECL_OVERRIDE;
+ QPoint pos() const Q_DECL_OVERRIDE;
+ void setPos(const QPoint &position) Q_DECL_OVERRIDE;
private:
QHash<Qt::CursorShape, NSCursor *> m_cursors;
NSCursor *convertCursor(QCursor *cursor);
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index f08386d18e..8e38181c29 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -34,7 +34,6 @@
#include "qcocoacursor.h"
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
#include <QtGui/QBitmap>
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index e087fcee26..c1eeb34679 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -47,13 +47,13 @@ class QCocoaDrag : public QPlatformDrag
{
public:
QCocoaDrag();
- virtual ~QCocoaDrag();
+ ~QCocoaDrag();
- virtual QMimeData *platformDropData();
- virtual Qt::DropAction drag(QDrag *m_drag);
+ QMimeData *platformDropData() Q_DECL_OVERRIDE;
+ Qt::DropAction drag(QDrag *m_drag) Q_DECL_OVERRIDE;
- virtual Qt::DropAction defaultAction(Qt::DropActions possibleActions,
- Qt::KeyboardModifiers modifiers) const;
+ Qt::DropAction defaultAction(Qt::DropActions possibleActions,
+ Qt::KeyboardModifiers modifiers) const Q_DECL_OVERRIDE;
/**
* to meet NSView dragImage:at guarantees, we need to record the original
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index 4466d28128..8aa7a6b583 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -127,16 +127,17 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
NSPoint event_location = [m_lastEvent locationInWindow];
- NSPoint local_point = [m_lastView convertPoint:event_location fromView:nil];
- local_point.x -= hotSpot.x();
+ NSWindow *theWindow = [m_lastEvent window];
+ Q_ASSERT(theWindow != nil);
+ event_location.x -= hotSpot.x();
CGFloat flippedY = pm.height() - hotSpot.y();
- local_point.y += flippedY;
- NSSize mouseOffset = NSMakeSize(0.0, 0.0);
+ event_location.y -= flippedY;
+ NSSize mouseOffset_unused = NSMakeSize(0.0, 0.0);
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
- [m_lastView dragImage:nsimage
- at:local_point
- offset:mouseOffset
+ [theWindow dragImage:nsimage
+ at:event_location
+ offset:mouseOffset_unused
event:m_lastEvent
pasteboard:pboard
source:m_lastView
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
index 13a8c89dbb..8a2a478a72 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
@@ -80,12 +80,11 @@
//
#include <QtCore/qabstracteventdispatcher.h>
-#include <QtCore/qhash.h>
#include <QtCore/qstack.h>
#include <QtGui/qwindowdefs.h>
#include <QtCore/private/qabstracteventdispatcher_p.h>
+#include <QtCore/private/qcfsocketnotifier_p.h>
#include <QtCore/private/qtimerinfo_unix_p.h>
-#include <QtPlatformSupport/private/qcfsocketnotifier_p.h>
#include <CoreFoundation/CoreFoundation.h>
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 52b2e23345..1865624d57 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -66,13 +66,11 @@
****************************************************************************/
#include "qcocoaeventdispatcher.h"
-#include "qcocoaautoreleasepool.h"
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
#include "qguiapplication.h"
#include "qevent.h"
-#include "qhash.h"
#include "qmutex.h"
#include "qsocketnotifier.h"
#include <qpa/qplatformwindow.h>
@@ -365,7 +363,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
if (d->interrupt)
break;
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSEvent* event = 0;
// First, send all previously excluded input events, if any:
@@ -623,7 +621,7 @@ NSModalSession QCocoaEventDispatcherPrivate::currentModalSession()
continue;
if (!info.session) {
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(info.window->handle());
NSWindow *nswindow = cocoaWindow->nativeWindow();
if (!nswindow)
@@ -671,7 +669,7 @@ void QCocoaEventDispatcherPrivate::updateChildrenWorksWhenModal()
// Make the dialog children of the window
// active. And make the dialog children of
// the previous modal dialog unactive again:
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
int size = cocoaModalSessionStack.size();
if (size > 0){
if (QWindow *prevModal = cocoaModalSessionStack[size-1].window)
@@ -692,7 +690,7 @@ void QCocoaEventDispatcherPrivate::cleanupModalSessions()
// point they were marked as stopped), is that ending a session
// when no other session runs below it on the stack will make cocoa
// drop some events on the floor.
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
int stackSize = cocoaModalSessionStack.size();
for (int i=stackSize-1; i>=0; --i) {
@@ -927,7 +925,7 @@ void QCocoaEventDispatcherPrivate::cancelWaitForMoreEvents()
{
// In case the event dispatcher is waiting for more
// events somewhere, we post a dummy event to wake it up:
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
[NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint
modifierFlags:0 timestamp:0. windowNumber:0 context:0
subtype:QtCocoaEventSubTypeWakeup data1:0 data2:0] atStart:NO];
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 4ece1b5a22..9dc013ba4d 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -53,7 +53,6 @@
#include <qvarlengtharray.h>
#include <stdlib.h>
#include <qabstracteventdispatcher.h>
-#include "qcocoaautoreleasepool.h"
#include <QDir>
#include <qpa/qplatformnativeinterface.h>
@@ -557,7 +556,7 @@ QCocoaFileDialogHelper::~QCocoaFileDialogHelper()
{
if (!mDelegate)
return;
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
[mDelegate release];
mDelegate = 0;
}
@@ -589,9 +588,6 @@ void QCocoaFileDialogHelper::QNSOpenSavePanelDelegate_filterSelected(int menuInd
emit filterSelected(menuIndex >= 0 && menuIndex < filters.size() ? filters.at(menuIndex) : QString());
}
-extern OSErr qt_mac_create_fsref(const QString &, FSRef *); // qglobal.cpp
-extern void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding encoding=0, int len=-1); // qglobal.cpp
-
void QCocoaFileDialogHelper::setDirectory(const QUrl &directory)
{
if (mDelegate)
@@ -687,7 +683,7 @@ bool QCocoaFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit
void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate()
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
const SharedPointerFileDialogOptions &opts = options();
const QList<QUrl> selectedFiles = opts->initiallySelectedFiles();
@@ -737,7 +733,7 @@ void QCocoaFileDialogHelper::exec()
// QEventLoop has been interrupted, and the second-most event loop has not
// yet been reactivated (regardless if [NSApp run] is still on the stack)),
// showing a native modal dialog will fail.
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if ([mDelegate runApplicationModalPanel])
emit accept();
else
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
index 5a241bc242..23266cfa79 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
@@ -45,13 +45,13 @@ public:
QCocoaFontDialogHelper();
~QCocoaFontDialogHelper();
- void exec();
+ void exec() Q_DECL_OVERRIDE;
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent);
- void hide();
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
+ void hide() Q_DECL_OVERRIDE;
- void setCurrentFont(const QFont &);
- QFont currentFont() const;
+ void setCurrentFont(const QFont &) Q_DECL_OVERRIDE;
+ QFont currentFont() const Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h
index 2c8a3e39f3..fa6db018a7 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h
@@ -50,22 +50,22 @@ public:
QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle);
~QCocoaGLContext();
- QSurfaceFormat format() const;
+ QSurfaceFormat format() const Q_DECL_OVERRIDE;
- void swapBuffers(QPlatformSurface *surface);
+ void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- bool makeCurrent(QPlatformSurface *surface);
- void doneCurrent();
+ bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
+ void doneCurrent() Q_DECL_OVERRIDE;
- void (*getProcAddress(const QByteArray &procName)) ();
+ void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
void update();
static NSOpenGLPixelFormat *createNSOpenGLPixelFormat(const QSurfaceFormat &format);
NSOpenGLContext *nsOpenGLContext() const;
- bool isSharing() const;
- bool isValid() const;
+ bool isSharing() const Q_DECL_OVERRIDE;
+ bool isValid() const Q_DECL_OVERRIDE;
void windowWasHidden();
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index a3c72c58b9..0f9b8b900d 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -33,7 +33,6 @@
#include "qcocoaglcontext.h"
#include "qcocoawindow.h"
-#include "qcocoaautoreleasepool.h"
#include "qcocoahelpers.h"
#include <qdebug.h>
#include <QtCore/private/qcore_mac_p.h>
@@ -145,21 +144,27 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo
if (m_format.renderableType() != QSurfaceFormat::OpenGL)
return;
- QCocoaAutoReleasePool pool; // For the SG Canvas render thread
+ 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));
m_shareContext = share ? static_cast<QCocoaGLContext *>(share)->nsOpenGLContext() : nil;
+ m_context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:m_shareContext];
- m_context = [NSOpenGLContext alloc];
- [m_context initWithFormat:pixelFormat shareContext:m_shareContext];
-
+ // retry without sharing on context creation failure.
if (!m_context && m_shareContext) {
- // try without shared context
m_shareContext = nil;
- [m_context initWithFormat:pixelFormat shareContext:nil];
+ m_context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
+ if (m_context)
+ qWarning("QCocoaGLContext: Falling back to unshared context.");
}
+ // give up if we still did not get a native context
[pixelFormat release];
+ if (!m_context) {
+ qWarning("QCocoaGLContext: Failed to create context.");
+ return;
+ }
const GLint interval = format.swapInterval() >= 0 ? format.swapInterval() : 1;
[m_context setValues:&interval forParameter:NSOpenGLCPSwapInterval];
@@ -218,7 +223,7 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
{
Q_ASSERT(surface->surface()->supportsOpenGL());
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QWindow *window = static_cast<QCocoaWindow *>(surface)->window();
setActiveWindow(window);
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 5f97e2996c..7bc8d6585b 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -33,7 +33,6 @@
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
#include <QtCore>
#include <QtGui>
@@ -270,10 +269,14 @@ bool operator<(const KeyPair &entry, const Qt::Key &key)
return entry.qtKey < key;
}
-static bool qtKey2CocoaKeySortLessThan(const KeyPair &entry1, const KeyPair &entry2)
+struct qtKey2CocoaKeySortLessThan
{
- return entry1.qtKey < entry2.qtKey;
-}
+ typedef bool result_type;
+ Q_DECL_CONSTEXPR result_type operator()(const KeyPair &entry1, const KeyPair &entry2) const Q_DECL_NOTHROW
+ {
+ return entry1.qtKey < entry2.qtKey;
+ }
+};
static const int NumEntries = 59;
static const KeyPair entries[NumEntries] = {
@@ -353,7 +356,7 @@ QChar qt_mac_qtKey2CocoaKey(Qt::Key key)
mustInit = false;
for (int i=0; i<NumEntries; ++i)
rev_entries[i] = entries[i];
- std::sort(rev_entries.begin(), rev_entries.end(), qtKey2CocoaKeySortLessThan);
+ std::sort(rev_entries.begin(), rev_entries.end(), qtKey2CocoaKeySortLessThan());
}
const QVector<KeyPair>::iterator i
= std::lower_bound(rev_entries.begin(), rev_entries.end(), key);
@@ -601,6 +604,7 @@ void qt_mac_cleanUpMacColorSpaces()
CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice)
{
#ifdef QT_NO_WIDGETS
+ Q_UNUSED(paintDevice)
return qt_mac_displayColorSpace(0);
#else
bool isWidget = (paintDevice->devType() == QInternal::Widget);
@@ -619,7 +623,7 @@ QString qt_mac_applicationName()
if (appName.isEmpty()) {
QString arg0 = QGuiApplicationPrivate::instance()->appName();
if (arg0.contains("/")) {
- QStringList parts = arg0.split("/");
+ QStringList parts = arg0.split(QLatin1Char('/'));
appName = parts.at(parts.count() - 1);
} else {
appName = arg0;
@@ -630,11 +634,15 @@ QString qt_mac_applicationName()
int qt_mac_mainScreenHeight()
{
- QCocoaAutoReleasePool pool;
- // The first screen in the screens array is documented
- // to have the (0,0) origin.
- NSRect screenFrame = [[[NSScreen screens] firstObject] frame];
- return screenFrame.size.height;
+ QMacAutoReleasePool pool;
+ NSArray *screens = [NSScreen screens];
+ if ([screens count] > 0) {
+ // The first screen in the screens array is documented
+ // to have the (0,0) origin.
+ NSRect screenFrame = [[screens objectAtIndex: 0] frame];
+ return screenFrame.size.height;
+ }
+ return 0;
}
int qt_mac_flipYCoordinate(int y)
diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.h b/src/plugins/platforms/cocoa/qcocoainputcontext.h
index abe45344a9..054c4795cb 100644
--- a/src/plugins/platforms/cocoa/qcocoainputcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoainputcontext.h
@@ -35,6 +35,7 @@
#define QCOCOAINPUTCONTEXT_H
#include <qpa/qplatforminputcontext.h>
+#include <QtCore/QLocale>
#include <QtCore/QPointer>
QT_BEGIN_NAMESPACE
@@ -46,9 +47,12 @@ public:
explicit QCocoaInputContext();
~QCocoaInputContext();
- virtual bool isValid() const { return true; }
+ bool isValid() const Q_DECL_OVERRIDE { return true; }
- virtual void reset();
+ void reset() Q_DECL_OVERRIDE;
+
+ QLocale locale() const Q_DECL_OVERRIDE { return m_locale; }
+ void updateLocale();
private Q_SLOTS:
void connectSignals();
@@ -56,6 +60,7 @@ private Q_SLOTS:
private:
QPointer<QWindow> mWindow;
+ QLocale m_locale;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.mm b/src/plugins/platforms/cocoa/qcocoainputcontext.mm
index c22fe8774b..7d01826ffe 100644
--- a/src/plugins/platforms/cocoa/qcocoainputcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoainputcontext.mm
@@ -34,9 +34,10 @@
#include "qnsview.h"
#include "qcocoainputcontext.h"
#include "qcocoanativeinterface.h"
-#include "qcocoaautoreleasepool.h"
#include "qcocoawindow.h"
+#include <Carbon/Carbon.h>
+
#include <QtCore/QRect>
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
@@ -77,6 +78,7 @@ QCocoaInputContext::QCocoaInputContext()
, mWindow(QGuiApplication::focusWindow())
{
QMetaObject::invokeMethod(this, "connectSignals", Qt::QueuedConnection);
+ updateLocale();
}
QCocoaInputContext::~QCocoaInputContext()
@@ -98,7 +100,7 @@ void QCocoaInputContext::reset()
if (!view)
return;
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) {
[ctxt discardMarkedText];
[view unmarkText];
@@ -117,4 +119,20 @@ void QCocoaInputContext::focusObjectChanged(QObject *focusObject)
mWindow = QGuiApplication::focusWindow();
}
+void QCocoaInputContext::updateLocale()
+{
+ TISInputSourceRef source = TISCopyCurrentKeyboardInputSource();
+ CFArrayRef languages = (CFArrayRef) TISGetInputSourceProperty(source, kTISPropertyInputSourceLanguages);
+ if (CFArrayGetCount(languages) > 0) {
+ CFStringRef langRef = (CFStringRef)CFArrayGetValueAtIndex(languages, 0);
+ QString name = QCFString::toQString(langRef);
+ QLocale locale(name);
+ if (m_locale != locale) {
+ m_locale = locale;
+ emitLocaleChanged();
+ }
+ CFRelease(langRef);
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h
index 8b5d78826c..e7e21c356a 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.h
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.h
@@ -36,7 +36,6 @@
#include <Cocoa/Cocoa.h>
-#include "qcocoaautoreleasepool.h"
#include "qcocoacursor.h"
#include "qcocoawindow.h"
#include "qcocoanativeinterface.h"
@@ -74,6 +73,7 @@ public:
QPlatformCursor *cursor() const Q_DECL_OVERRIDE { return m_cursor; }
QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE;
QList<QPlatformScreen *> virtualSiblings() const Q_DECL_OVERRIDE { return m_siblings; }
+ QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const Q_DECL_OVERRIDE;
// ----------------------------------------------------
// Additional methods
@@ -98,34 +98,42 @@ public:
class QCocoaIntegration : public QPlatformIntegration
{
public:
- QCocoaIntegration();
+ enum Option {
+ UseFreeTypeFontEngine = 0x1
+ };
+ Q_DECLARE_FLAGS(Options, Option)
+
+ QCocoaIntegration(const QStringList &paramList);
~QCocoaIntegration();
static QCocoaIntegration *instance();
+ Options options() const;
- bool hasCapability(QPlatformIntegration::Capability cap) const;
- QPlatformWindow *createPlatformWindow(QWindow *window) const;
+ bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
#ifndef QT_NO_OPENGL
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
#endif
- QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const;
+ QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
- QCoreTextFontDatabase *fontDatabase() const;
- QCocoaNativeInterface *nativeInterface() const;
- QCocoaInputContext *inputContext() const;
- QCocoaAccessibility *accessibility() const;
- QCocoaClipboard *clipboard() const;
- QCocoaDrag *drag() const;
+ QCoreTextFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ QCocoaNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
+ QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
+#ifndef QT_NO_ACCESSIBILITY
+ QCocoaAccessibility *accessibility() const Q_DECL_OVERRIDE;
+#endif
+ QCocoaClipboard *clipboard() const Q_DECL_OVERRIDE;
+ QCocoaDrag *drag() const Q_DECL_OVERRIDE;
- QStringList themeNames() const;
- QPlatformTheme *createPlatformTheme(const QString &name) const;
- QCocoaServices *services() const;
- QVariant styleHint(StyleHint hint) const;
+ QStringList themeNames() const Q_DECL_OVERRIDE;
+ QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
+ QCocoaServices *services() const Q_DECL_OVERRIDE;
+ QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
- Qt::KeyboardModifiers queryKeyboardModifiers() const;
- QList<int> possibleKeys(const QKeyEvent *event) const;
+ Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE;
+ QList<int> possibleKeys(const QKeyEvent *event) const Q_DECL_OVERRIDE;
void updateScreens();
QCocoaScreen *screenAtIndex(int index);
@@ -139,13 +147,14 @@ public:
QCocoaWindow *activePopupWindow() const;
QList<QCocoaWindow *> *popupWindowStack();
- void setApplicationIcon(const QIcon &icon) const;
+ void setApplicationIcon(const QIcon &icon) const Q_DECL_OVERRIDE;
private:
static QCocoaIntegration *mInstance;
+ Options mOptions;
QScopedPointer<QCoreTextFontDatabase> mFontDb;
- QScopedPointer<QCocoaInputContext> mInputContext;
+ QScopedPointer<QPlatformInputContext> mInputContext;
#ifndef QT_NO_ACCESSIBILITY
QScopedPointer<QCocoaAccessibility> mAccessibility;
#endif
@@ -161,6 +170,8 @@ private:
QList<QCocoaWindow *> m_popupWindowStack;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QCocoaIntegration::Options)
+
QT_END_NAMESPACE
#endif
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index c8f6dd05db..6bec6b191d 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -33,7 +33,6 @@
#include "qcocoaintegration.h"
-#include "qcocoaautoreleasepool.h"
#include "qcocoawindow.h"
#include "qcocoabackingstore.h"
#include "qcocoanativeinterface.h"
@@ -48,7 +47,9 @@
#include "qcocoamimetypes.h"
#include "qcocoaaccessibility.h"
+#include <qpa/qplatforminputcontextfactory_p.h>
#include <qpa/qplatformaccessibility.h>
+#include <qpa/qplatforminputcontextfactory_p.h>
#include <QtCore/qcoreapplication.h>
#include <IOKit/graphics/IOGraphicsLib.h>
@@ -137,11 +138,21 @@ void QCocoaScreen::updateGeometry()
qreal QCocoaScreen::devicePixelRatio() const
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSScreen * screen = osScreen();
return qreal(screen ? [screen backingScaleFactor] : 1.0);
}
+QPlatformScreen::SubpixelAntialiasingType QCocoaScreen::subpixelAntialiasingTypeHint() const
+{
+ QPlatformScreen::SubpixelAntialiasingType type = QPlatformScreen::subpixelAntialiasingTypeHint();
+ if (type == QPlatformScreen::Subpixel_None) {
+ // Every OSX machine has RGB pixels unless a peculiar or rotated non-Apple screen is attached
+ type = QPlatformScreen::Subpixel_RGB;
+ }
+ return type;
+}
+
QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const
{
NSPoint screenPoint = qt_mac_flipPoint(point);
@@ -244,11 +255,25 @@ QPixmap QCocoaScreen::grabWindow(WId window, int x, int y, int width, int height
return windowPixmap;
}
+static QCocoaIntegration::Options parseOptions(const QStringList &paramList)
+{
+ QCocoaIntegration::Options options;
+ foreach (const QString &param, paramList) {
+#ifndef QT_NO_FREETYPE
+ if (param == QLatin1String("fontengine=freetype"))
+ options |= QCocoaIntegration::UseFreeTypeFontEngine;
+ else
+#endif
+ qWarning() << "Unknown option" << param;
+ }
+ return options;
+}
+
QCocoaIntegration *QCocoaIntegration::mInstance = 0;
-QCocoaIntegration::QCocoaIntegration()
- : mFontDb(new QCoreTextFontDatabase())
- , mInputContext(new QCocoaInputContext)
+QCocoaIntegration::QCocoaIntegration(const QStringList &paramList)
+ : mOptions(parseOptions(paramList))
+ , mFontDb(new QCoreTextFontDatabase(mOptions.testFlag(UseFreeTypeFontEngine)))
#ifndef QT_NO_ACCESSIBILITY
, mAccessibility(new QCocoaAccessibility)
#endif
@@ -262,8 +287,12 @@ QCocoaIntegration::QCocoaIntegration()
qWarning("Creating multiple Cocoa platform integrations is not supported");
mInstance = this;
+ QString icStr = QPlatformInputContextFactory::requested();
+ icStr.isNull() ? mInputContext.reset(new QCocoaInputContext)
+ : mInputContext.reset(QPlatformInputContextFactory::create(icStr));
+
initResources();
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false);
@@ -314,7 +343,7 @@ QCocoaIntegration::~QCocoaIntegration()
qt_resetNSApplicationSendEvent();
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (!QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) {
// remove the apple event handlers installed by QCocoaApplicationDelegate
QCocoaApplicationDelegate *delegate = [QCocoaApplicationDelegate sharedDelegate];
@@ -342,6 +371,11 @@ QCocoaIntegration *QCocoaIntegration::instance()
return mInstance;
}
+QCocoaIntegration::Options QCocoaIntegration::options() const
+{
+ return mOptions;
+}
+
/*!
\brief Synchronizes the screen list, adds new screens, removes deleted ones
*/
@@ -463,19 +497,17 @@ QCocoaNativeInterface *QCocoaIntegration::nativeInterface() const
return mNativeInterface.data();
}
-QCocoaInputContext *QCocoaIntegration::inputContext() const
+QPlatformInputContext *QCocoaIntegration::inputContext() const
{
return mInputContext.data();
}
+#ifndef QT_NO_ACCESSIBILITY
QCocoaAccessibility *QCocoaIntegration::accessibility() const
{
-#ifndef QT_NO_ACCESSIBILITY
return mAccessibility.data();
-#else
- return 0;
-#endif
}
+#endif
QCocoaClipboard *QCocoaIntegration::clipboard() const
{
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index 59807deb5a..eccc5230b5 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -49,29 +49,29 @@ public:
QCocoaMenu();
~QCocoaMenu();
- inline virtual void setTag(quintptr tag)
- { m_tag = tag; }
- inline virtual quintptr tag() const
- { return m_tag; }
-
- void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before);
- void removeMenuItem(QPlatformMenuItem *menuItem);
- void syncMenuItem(QPlatformMenuItem *menuItem);
- void setEnabled(bool enabled);
- bool isEnabled() const;
- void setVisible(bool visible);
- void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item);
- void dismiss();
-
- void syncSeparatorsCollapsible(bool enable);
+ 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;
+ void setEnabled(bool enabled) Q_DECL_OVERRIDE;
+ bool isEnabled() const Q_DECL_OVERRIDE;
+ void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE;
+ void dismiss() Q_DECL_OVERRIDE;
+
+ void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE;
void syncModalState(bool modal);
- virtual void setIcon(const QIcon &icon) { Q_UNUSED(icon) }
+ void setIcon(const QIcon &icon) Q_DECL_OVERRIDE { Q_UNUSED(icon) }
- void setText(const QString &text);
- void setMinimumWidth(int width);
- void setFont(const QFont &font);
+ void setText(const QString &text) Q_DECL_OVERRIDE;
+ void setMinimumWidth(int width) Q_DECL_OVERRIDE;
+ void setFont(const QFont &font) Q_DECL_OVERRIDE;
inline NSMenu *nsMenu() const
{ return m_nativeMenu; }
@@ -80,8 +80,8 @@ public:
inline bool isVisible() const { return m_visible; }
- virtual QPlatformMenuItem *menuItemAt(int position) const;
- virtual QPlatformMenuItem *menuItemForTag(quintptr tag) const;
+ QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE;
QList<QCocoaMenuItem *> items() const;
QList<QCocoaMenuItem *> merged() const;
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index a6157bdc3a..ad491855ff 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -34,7 +34,6 @@
#include "qcocoamenu.h"
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
#include <QtCore/QtDebug>
#include <QtCore/qmetaobject.h>
@@ -235,7 +234,7 @@ QCocoaMenu::QCocoaMenu() :
m_menuBar(0),
m_containingMenuItem(0)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
m_delegate = [[QCocoaMenuDelegate alloc] initWithMenu:this];
m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
@@ -255,7 +254,7 @@ QCocoaMenu::~QCocoaMenu()
if (m_containingMenuItem)
m_containingMenuItem->clearMenu(this);
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
[m_nativeItem setSubmenu:nil];
[m_nativeMenu release];
[m_delegate release];
@@ -264,7 +263,7 @@ QCocoaMenu::~QCocoaMenu()
void QCocoaMenu::setText(const QString &text)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QString stripped = qt_mac_removeAmpersandEscapes(text);
[m_nativeMenu setTitle:QCFString::toNSString(stripped)];
[m_nativeItem setTitle:QCFString::toNSString(stripped)];
@@ -286,7 +285,7 @@ void QCocoaMenu::setFont(const QFont &font)
void QCocoaMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem);
QCocoaMenuItem *beforeItem = static_cast<QCocoaMenuItem *>(before);
@@ -295,7 +294,7 @@ void QCocoaMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *
int index = m_menuItems.indexOf(beforeItem);
// if a before item is supplied, it should be in the menu
if (index < 0) {
- qWarning() << Q_FUNC_INFO << "Before menu item not found";
+ qWarning("Before menu item not found");
return;
}
m_menuItems.insert(index, cocoaItem);
@@ -316,7 +315,7 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
return;
if ([item->nsItem() menu]) {
- qWarning() << Q_FUNC_INFO << "Menu item is already in a menu, remove it from the other menu first before inserting";
+ qWarning("Menu item is already in a menu, remove it from the other menu first before inserting");
return;
}
// if the item we're inserting before is merged, skip along until
@@ -327,7 +326,7 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
if (beforeItem) {
if (beforeItem->isMerged()) {
- qWarning() << Q_FUNC_INFO << "No non-merged before menu item found";
+ qWarning("No non-merged before menu item found");
return;
}
NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeItem->nsItem()];
@@ -340,10 +339,10 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem);
if (!m_menuItems.contains(cocoaItem)) {
- qWarning() << Q_FUNC_INFO << "Menu does not contain the item to be removed";
+ qWarning("Menu does not contain the item to be removed");
return;
}
@@ -353,7 +352,7 @@ void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem)
m_menuItems.removeOne(cocoaItem);
if (!cocoaItem->isMerged()) {
if (m_nativeMenu != [cocoaItem->nsItem() menu]) {
- qWarning() << Q_FUNC_INFO << "Item to remove does not belong to this menu";
+ qWarning("Item to remove does not belong to this menu");
return;
}
[m_nativeMenu removeItem: cocoaItem->nsItem()];
@@ -370,10 +369,10 @@ QCocoaMenuItem *QCocoaMenu::itemOrNull(int index) const
void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem);
if (!m_menuItems.contains(cocoaItem)) {
- qWarning() << Q_FUNC_INFO << "Item does not belong to this menu";
+ qWarning("Item does not belong to this menu");
return;
}
@@ -399,7 +398,7 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem)
void QCocoaMenu::syncSeparatorsCollapsible(bool enable)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (enable) {
bool previousIsSeparator = true; // setting to true kills all the separators placed at the top.
NSMenuItem *previousItem = nil;
@@ -457,7 +456,7 @@ void QCocoaMenu::setVisible(bool visible)
void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QPoint pos = QPoint(targetRect.left(), targetRect.top() + targetRect.height());
QCocoaWindow *cocoaWindow = parentWindow ? static_cast<QCocoaWindow *>(parentWindow->handle()) : 0;
@@ -583,7 +582,7 @@ QList<QCocoaMenuItem *> QCocoaMenu::merged() const
void QCocoaMenu::syncModalState(bool modal)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (!m_enabled)
modal = true;
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h
index b5ee21ca52..d5f75abf34 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.h
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.h
@@ -48,13 +48,13 @@ class QCocoaMenuBar : public QPlatformMenuBar
Q_OBJECT
public:
QCocoaMenuBar();
- virtual ~QCocoaMenuBar();
+ ~QCocoaMenuBar();
- virtual void insertMenu(QPlatformMenu *menu, QPlatformMenu* before);
- virtual void removeMenu(QPlatformMenu *menu);
- virtual void syncMenu(QPlatformMenu *menuItem);
- virtual void handleReparent(QWindow *newParentWindow);
- virtual QPlatformMenu *menuForTag(quintptr tag) const;
+ void insertMenu(QPlatformMenu *menu, QPlatformMenu* before) Q_DECL_OVERRIDE;
+ void removeMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
+ void syncMenu(QPlatformMenu *menuItem) Q_DECL_OVERRIDE;
+ void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE;
+ QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE;
inline NSMenu *nsMenu() const
{ return m_nativeMenu; }
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index 764a01370d..1a516f874b 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -37,7 +37,7 @@
#include "qcocoawindow.h"
#include "qcocoamenuloader.h"
#include "qcocoaapplication.h" // for custom application category
-#include "qcocoaautoreleasepool.h"
+#include "qcocoaapplicationdelegate.h"
#include <QtGui/QGuiApplication>
#include <QtCore/QDebug>
@@ -83,7 +83,7 @@ QCocoaMenuBar::~QCocoaMenuBar()
void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (beforeMenu) {
NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()];
@@ -108,12 +108,12 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor
#endif
if (m_menus.contains(menu)) {
- qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first";
+ qWarning("This menu already belongs to the menubar, remove it first");
return;
}
if (beforeMenu && !m_menus.contains(beforeMenu)) {
- qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar";
+ qWarning("The before menu does not belong to the menubar");
return;
}
@@ -126,7 +126,7 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor
void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (menu->menuBar() == this)
menu->setMenuBar(0);
@@ -138,7 +138,7 @@ void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu)
{
QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu);
if (!m_menus.contains(menu)) {
- qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar";
+ qWarning("Trying to remove a menu that does not belong to the menubar");
return;
}
m_menus.removeOne(menu);
@@ -147,7 +147,7 @@ void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu)
void QCocoaMenuBar::syncMenu(QPlatformMenu *menu)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaMenu *cocoaMenu = static_cast<QCocoaMenu *>(menu);
Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items())
@@ -260,13 +260,26 @@ void QCocoaMenuBar::resetKnownMenuItemsToQt()
void QCocoaMenuBar::updateMenuBarImmediately()
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaMenuBar *mb = findGlobalMenubar();
QCocoaWindow *cw = findWindowForMenubar();
QWindow *win = cw ? cw->window() : 0;
- if (win && (win->flags() & Qt::Popup) == Qt::Popup)
- return; // context menus, comboboxes, etc. don't need to update the menubar
+ if (win && (win->flags() & Qt::Popup) == Qt::Popup) {
+ // context menus, comboboxes, etc. don't need to update the menubar,
+ // but if an application has only Qt::Tool window(s) on start,
+ // we still have to update the menubar.
+ if ((win->flags() & Qt::WindowType_Mask) != Qt::Tool)
+ return;
+ typedef QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) AppDelegate;
+ NSApplication *app = [NSApplication sharedApplication];
+ if (![app.delegate isKindOfClass:[AppDelegate class]])
+ return;
+ // We apply this logic _only_ during the startup.
+ AppDelegate *appDelegate = app.delegate;
+ if (!appDelegate.inLaunch)
+ return;
+ }
if (cw && cw->menubar())
mb = cw->menubar();
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.h b/src/plugins/platforms/cocoa/qcocoamenuitem.h
index 5c85824ab8..289f38fd18 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.h
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.h
@@ -60,27 +60,27 @@ class QCocoaMenuItem : public QPlatformMenuItem
{
public:
QCocoaMenuItem();
- virtual ~QCocoaMenuItem();
+ ~QCocoaMenuItem();
- inline virtual void setTag(quintptr tag)
+ void setTag(quintptr tag) Q_DECL_OVERRIDE
{ m_tag = tag; }
- inline virtual quintptr tag() const
+ quintptr tag() const Q_DECL_OVERRIDE
{ return m_tag; }
- void setText(const QString &text);
- void setIcon(const QIcon &icon);
- void setMenu(QPlatformMenu *menu);
- void setVisible(bool isVisible);
- void setIsSeparator(bool isSeparator);
- void setFont(const QFont &font);
- void setRole(MenuRole role);
- void setShortcut(const QKeySequence& shortcut);
- void setCheckable(bool checkable) { Q_UNUSED(checkable) }
- void setChecked(bool isChecked);
- void setEnabled(bool isEnabled);
- void setIconSize(int size);
-
- void setNativeContents(WId item);
+ void setText(const QString &text) Q_DECL_OVERRIDE;
+ void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
+ void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
+ void setVisible(bool isVisible) Q_DECL_OVERRIDE;
+ void setIsSeparator(bool isSeparator) Q_DECL_OVERRIDE;
+ void setFont(const QFont &font) Q_DECL_OVERRIDE;
+ void setRole(MenuRole role) Q_DECL_OVERRIDE;
+ void setShortcut(const QKeySequence& shortcut) Q_DECL_OVERRIDE;
+ void setCheckable(bool checkable) Q_DECL_OVERRIDE { Q_UNUSED(checkable) }
+ void setChecked(bool isChecked) Q_DECL_OVERRIDE;
+ void setEnabled(bool isEnabled) Q_DECL_OVERRIDE;
+ void setIconSize(int size) Q_DECL_OVERRIDE;
+
+ void setNativeContents(WId item) Q_DECL_OVERRIDE;
inline QString text() const { return m_text; }
inline NSMenuItem * nsItem() { return m_native; }
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index f288ab85c0..0f551bcd7d 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -37,7 +37,6 @@
#include "qcocoamenubar.h"
#include "messages.h"
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
#include "qt_mac_p.h"
#include "qcocoaapplication.h" // for custom application category
#include "qcocoamenuloader.h"
@@ -104,7 +103,7 @@ QCocoaMenuItem::QCocoaMenuItem() :
QCocoaMenuItem::~QCocoaMenuItem()
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (m_menu && COCOA_MENU_ANCESTOR(m_menu) == this)
SET_COCOA_MENU_ANCESTOR(m_menu, 0);
@@ -139,7 +138,7 @@ void QCocoaMenuItem::setMenu(QPlatformMenu *menu)
m_menu->setContainingMenuItem(0);
}
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
m_menu = static_cast<QCocoaMenu *>(menu);
if (m_menu) {
SET_COCOA_MENU_ANCESTOR(m_menu, this);
@@ -198,6 +197,8 @@ void QCocoaMenuItem::setEnabled(bool enabled)
void QCocoaMenuItem::setNativeContents(WId item)
{
NSView *itemView = (NSView *)item;
+ if (m_itemView == itemView)
+ return;
[m_itemView release];
m_itemView = [itemView retain];
[m_itemView setAutoresizesSubviews:YES];
@@ -280,7 +281,7 @@ NSMenuItem *QCocoaMenuItem::sync()
}
default:
- qWarning() << Q_FUNC_INFO << "menu item" << m_text << "has unsupported role" << (int)m_role;
+ qWarning() << "menu item" << m_text << "has unsupported role" << (int)m_role;
}
if (mergeItem) {
@@ -302,8 +303,8 @@ NSMenuItem *QCocoaMenuItem::sync()
if (!m_native) {
m_native = [[NSMenuItem alloc] initWithTitle:QCFString::toNSString(m_text)
- action:nil
- keyEquivalent:@""];
+ action:nil
+ keyEquivalent:@""];
[m_native setTag:reinterpret_cast<NSInteger>(this)];
}
@@ -397,7 +398,7 @@ QKeySequence QCocoaMenuItem::mergeAccel()
void QCocoaMenuItem::syncMerged()
{
if (!m_merged) {
- qWarning() << Q_FUNC_INFO << "Trying to sync a non-merged item";
+ qWarning("Trying to sync a non-merged item");
return;
}
[m_native setTag:reinterpret_cast<NSInteger>(this)];
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
index 2250f7c084..d018c05635 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
@@ -67,6 +67,8 @@ public:
static void *nsOpenGLContextForContext(QOpenGLContext* context);
#endif
+ QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
+
public Q_SLOTS:
void onAppFocusWindowChanged(QWindow *window);
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index 205a49d25a..baee451903 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -58,6 +58,8 @@
#include <qpa/qplatformprintersupport.h>
#endif
+#include <QtPlatformHeaders/qcocoawindowfunctions.h>
+
#include <Cocoa/Cocoa.h>
QT_BEGIN_NAMESPACE
@@ -160,6 +162,7 @@ void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine
macPrintEnginePriv->initialize();
return macPrintEnginePriv->printInfo;
#else
+ Q_UNUSED(printEngine);
qFatal("Printing is not supported when Qt is configured with -no-widgets");
return 0;
#endif
@@ -217,6 +220,14 @@ void *QCocoaNativeInterface::nsOpenGLContextForContext(QOpenGLContext* context)
}
#endif
+QFunctionPointer QCocoaNativeInterface::platformFunction(const QByteArray &function) const
+{
+ if (function == QCocoaWindowFunctions::bottomLeftClippedByNSWindowOffsetIdentifier())
+ return QFunctionPointer(QCocoaWindowFunctions::BottomLeftClippedByNSWindowOffset(QCocoaWindow::bottomLeftClippedByNSWindowOffsetStatic));
+
+ return Q_NULLPTR;
+}
+
void QCocoaNativeInterface::addToMimeList(void *macPasteboardMime)
{
qt_mac_addToGlobalMimeList(reinterpret_cast<QMacInternalPasteboardMime *>(macPasteboardMime));
@@ -234,7 +245,7 @@ void QCocoaNativeInterface::registerDraggedTypes(const QStringList &types)
void QCocoaNativeInterface::setDockMenu(QPlatformMenu *platformMenu)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaMenu *cocoaPlatformMenu = static_cast<QCocoaMenu *>(platformMenu);
NSMenu *menu = cocoaPlatformMenu->nsMenu();
[NSApp QT_MANGLE_NAMESPACE(qt_setDockMenu): menu];
diff --git a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
index 4d319e149b..b0d04f6f82 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
+++ b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
@@ -100,7 +100,7 @@ QCocoaPrintDevice::~QCocoaPrintDevice()
{
if (m_ppd)
ppdClose(m_ppd);
- foreach (PMPaper paper, m_macPapers.values())
+ foreach (PMPaper paper, m_macPapers)
PMRelease(paper);
// Releasing the session appears to also release the printer
if (m_session)
@@ -154,7 +154,7 @@ QPageSize QCocoaPrintDevice::createPageSize(const PMPaper &paper) const
void QCocoaPrintDevice::loadPageSizes() const
{
m_pageSizes.clear();
- foreach (PMPaper paper, m_macPapers.values())
+ foreach (PMPaper paper, m_macPapers)
PMRelease(paper);
m_macPapers.clear();
m_printableMargins.clear();
diff --git a/src/plugins/platforms/cocoa/qcocoaservices.h b/src/plugins/platforms/cocoa/qcocoaservices.h
index 331fe810fa..1a447c6242 100644
--- a/src/plugins/platforms/cocoa/qcocoaservices.h
+++ b/src/plugins/platforms/cocoa/qcocoaservices.h
@@ -41,8 +41,8 @@ QT_BEGIN_NAMESPACE
class QCocoaServices : public QPlatformServices
{
public:
- bool openUrl(const QUrl &url);
- bool openDocument(const QUrl &url);
+ bool openUrl(const QUrl &url) Q_DECL_OVERRIDE;
+ bool openDocument(const QUrl &url) Q_DECL_OVERRIDE;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 65cc9bc38b..93f8b2ba6f 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -33,7 +33,6 @@
#include "qcocoasystemsettings.h"
-#include "qcocoaautoreleasepool.h"
#include "qcocoahelpers.h"
#include <QtCore/private/qcore_mac_p.h>
@@ -45,7 +44,7 @@ QT_BEGIN_NAMESPACE
QColor qt_mac_colorForTheme(ThemeBrush brush)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCFType<CGColorRef> cgClr = 0;
HIThemeBrushCreateCGColor(brush, &cgClr);
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
index b5f038094f..cdfd92c0aa 100755..100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
@@ -51,17 +51,17 @@ class Q_GUI_EXPORT QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon
public:
QCocoaSystemTrayIcon() : m_sys(0) {}
- virtual void init();
- virtual void cleanup();
- virtual void updateIcon(const QIcon &icon);
- virtual void updateToolTip(const QString &toolTip);
- virtual void updateMenu(QPlatformMenu *menu);
- virtual QRect geometry() const;
- virtual void showMessage(const QString &title, const QString &msg,
- const QIcon& icon, MessageIcon iconType, int secs);
+ void init() Q_DECL_OVERRIDE;
+ void cleanup() Q_DECL_OVERRIDE;
+ void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE;
+ void updateToolTip(const QString &toolTip) Q_DECL_OVERRIDE;
+ void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
+ QRect geometry() const Q_DECL_OVERRIDE;
+ void showMessage(const QString &title, const QString &msg,
+ const QIcon& icon, MessageIcon iconType, int secs) Q_DECL_OVERRIDE;
- virtual bool isSystemTrayAvailable() const;
- virtual bool supportsMessages() const;
+ bool isSystemTrayAvailable() const Q_DECL_OVERRIDE;
+ bool supportsMessages() const Q_DECL_OVERRIDE;
private:
QSystemTrayIconSys *m_sys;
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 713758cc7e..a3ffb5be66 100755..100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -252,6 +252,7 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
}
NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(fullHeightPixmap));
+ [nsimage setTemplate:icon.isMask()];
[(NSImageView*)[[m_sys->item item] view] setImage: nsimage];
[nsimage release];
}
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index 11749e14de..4b73d0af08 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -47,7 +47,6 @@
#include "qcocoamenu.h"
#include "qcocoamenubar.h"
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
#include <QtCore/qfileinfo.h>
#include <QtGui/private/qguiapplication_p.h>
@@ -253,7 +252,7 @@ QPixmap QCocoaTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &siz
QPlatformTheme::IconOptions iconOptions) const
{
Q_UNUSED(iconOptions);
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSImage *iconImage = [[NSWorkspace sharedWorkspace] iconForFile:QCFString::toNSString(fileInfo.canonicalFilePath())];
if (!iconImage)
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 455d4a8580..05e6cf3c9e 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -227,6 +227,9 @@ public:
void updateExposedGeometry();
QWindow *childWindowAt(QPoint windowPoint);
bool shouldRefuseKeyWindowAndFirstResponder();
+
+ static QPoint bottomLeftClippedByNSWindowOffsetStatic(QWindow *window);
+ QPoint bottomLeftClippedByNSWindowOffset() const;
protected:
void recreateWindow(const QPlatformWindow *parentWindow);
QCocoaNSWindow *createNSWindow();
@@ -234,7 +237,7 @@ protected:
bool shouldUseNSPanel();
- QRect windowGeometry() const;
+ QRect nativeWindowGeometry() const;
QCocoaWindow *parentCocoaWindow() const;
void syncWindowState(Qt::WindowState newState);
void reinsertChildWindow(QCocoaWindow *child);
@@ -245,6 +248,8 @@ public: // for QNSView
friend class QCocoaBackingStore;
friend class QCocoaNativeInterface;
+ void removeMonitor();
+
NSView *m_contentView;
QNSView *m_qtView;
QCocoaNSWindow *m_nsWindow;
@@ -265,10 +270,10 @@ public: // for QNSView
QPointer<QWindow> m_enterLeaveTargetWindow;
bool m_windowUnderMouse;
- bool m_ignoreWindowShouldClose;
bool m_inConstructor;
bool m_inSetVisible;
bool m_inSetGeometry;
+ bool m_inSetStyleMask;
#ifndef QT_NO_OPENGL
QCocoaGLContext *m_glContext;
#endif
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 809acdd87e..3b5909a37e 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -33,7 +33,6 @@
#include "qcocoawindow.h"
#include "qcocoaintegration.h"
#include "qnswindowdelegate.h"
-#include "qcocoaautoreleasepool.h"
#include "qcocoaeventdispatcher.h"
#ifndef QT_NO_OPENGL
#include "qcocoaglcontext.h"
@@ -346,10 +345,10 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_synchedWindowState(Qt::WindowActive)
, m_windowModality(Qt::NonModal)
, m_windowUnderMouse(false)
- , m_ignoreWindowShouldClose(false)
, m_inConstructor(true)
, m_inSetVisible(false)
, m_inSetGeometry(false)
+ , m_inSetStyleMask(false)
#ifndef QT_NO_OPENGL
, m_glContext(0)
#endif
@@ -373,7 +372,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QCocoaWindow::QCocoaWindow" << this;
#endif
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (tlw->type() == Qt::ForeignWindow) {
NSView *foreignView = (NSView *)WId(tlw->property("_q_foreignWinId").value<WId>());
@@ -409,7 +408,7 @@ QCocoaWindow::~QCocoaWindow()
qDebug() << "QCocoaWindow::~QCocoaWindow" << this;
#endif
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
[m_nsWindow setContentView:nil];
[m_nsWindow.helper detachFromPlatformWindow];
if (m_isNSWindowChild) {
@@ -419,6 +418,8 @@ QCocoaWindow::~QCocoaWindow()
[m_contentView removeFromSuperview];
}
+ removeMonitor();
+
// Make sure to disconnect observer in all case if view is valid
// to avoid notifications received when deleting when using Qt::AA_NativeWindows attribute
if (m_qtView) {
@@ -499,10 +500,14 @@ QRect QCocoaWindow::geometry() const
void QCocoaWindow::setCocoaGeometry(const QRect &rect)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (m_contentViewIsEmbedded) {
- QPlatformWindow::setGeometry(rect);
+ if (m_qtView) {
+ [m_qtView setFrame:NSMakeRect(0, 0, rect.width(), rect.height())];
+ } else {
+ QPlatformWindow::setGeometry(rect);
+ }
return;
}
@@ -604,7 +609,7 @@ void QCocoaWindow::show(bool becauseOfAncestor)
&& !m_hiddenByClipping) { // ... NOR clipped
if (m_isNSWindowChild) {
m_hiddenByAncestor = false;
- setCocoaGeometry(window()->geometry());
+ setCocoaGeometry(windowGeometry());
}
if (!m_hiddenByClipping) { // setCocoaGeometry() can change the clipping status
[m_nsWindow orderFront:nil];
@@ -623,7 +628,7 @@ void QCocoaWindow::setVisible(bool visible)
m_inSetVisible = true;
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QCocoaWindow *parentCocoaWindow = 0;
if (window()->transientParent())
parentCocoaWindow = static_cast<QCocoaWindow *>(window()->transientParent()->handle());
@@ -643,7 +648,7 @@ void QCocoaWindow::setVisible(bool visible)
if (parentCocoaWindow) {
// The parent window might have moved while this window was hidden,
// update the window geometry if there is a parent.
- setGeometry(window()->geometry());
+ setGeometry(windowGeometry());
if (window()->type() == Qt::Popup) {
// QTBUG-30266: a window should not be resizable while a transient popup is open
@@ -696,6 +701,7 @@ void QCocoaWindow::setVisible(bool visible)
&& [m_nsWindow isKindOfClass:[NSPanel class]]) {
[(NSPanel *)m_nsWindow setWorksWhenModal:YES];
if (!(parentCocoaWindow && window()->transientParent()->isActive()) && window()->type() == Qt::Popup) {
+ removeMonitor();
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
QPointF localPoint = qt_mac_flipPoint([NSEvent mouseLocation]);
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
@@ -744,10 +750,7 @@ void QCocoaWindow::setVisible(bool visible)
} else {
[m_contentView setHidden:YES];
}
- if (monitor && window()->type() == Qt::Popup) {
- [NSEvent removeMonitor:monitor];
- monitor = nil;
- }
+ removeMonitor();
if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
QCocoaIntegration::instance()->popupWindowStack()->removeAll(this);
@@ -861,8 +864,8 @@ void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags)
// 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
// in line with the platform style guidelines.
- bool fixedSizeNoZoom = (window()->minimumSize().isValid() && window()->maximumSize().isValid()
- && window()->minimumSize() == window()->maximumSize());
+ bool fixedSizeNoZoom = (windowMinimumSize().isValid() && windowMaximumSize().isValid()
+ && windowMinimumSize() == windowMaximumSize());
bool customizeNoZoom = ((flags & Qt::CustomizeWindowHint) && !(flags & Qt::WindowMaximizeButtonHint));
[[m_nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:!(fixedSizeNoZoom || customizeNoZoom)];
}
@@ -872,20 +875,27 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
if (m_nsWindow && !m_isNSWindowChild) {
NSUInteger styleMask = windowStyleMask(flags);
NSInteger level = this->windowLevel(flags);
+ // While setting style mask we can have -updateGeometry calls on a content
+ // view with null geometry, reporting an invalid coordinates as a result.
+ m_inSetStyleMask = true;
[m_nsWindow setStyleMask:styleMask];
+ m_inSetStyleMask = false;
[m_nsWindow setLevel:level];
setWindowShadow(flags);
- if (!(styleMask & NSBorderlessWindowMask)) {
+ 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];
- if (flags & Qt::WindowFullscreenButtonHint)
+ if (flags & Qt::WindowFullscreenButtonHint) {
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
- else
+ behavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary;
+ } else {
+ behavior |= NSWindowCollectionBehaviorFullScreenAuxiliary;
behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
+ }
[m_nsWindow setCollectionBehavior:behavior];
}
setWindowZoomButton(flags);
@@ -902,7 +912,7 @@ void QCocoaWindow::setWindowState(Qt::WindowState state)
void QCocoaWindow::setWindowTitle(const QString &title)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (!m_nsWindow)
return;
@@ -913,7 +923,7 @@ void QCocoaWindow::setWindowTitle(const QString &title)
void QCocoaWindow::setWindowFilePath(const QString &filePath)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (!m_nsWindow)
return;
@@ -923,7 +933,7 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath)
void QCocoaWindow::setWindowIcon(const QIcon &icon)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSButton *iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];
if (iconButton == nil) {
@@ -1041,26 +1051,26 @@ bool QCocoaWindow::isOpaque() const
void QCocoaWindow::propagateSizeHints()
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
if (!m_nsWindow)
return;
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QCocoaWindow::propagateSizeHints" << this;
- qDebug() << " min/max " << window()->minimumSize() << window()->maximumSize();
- qDebug() << "size increment" << window()->sizeIncrement();
- qDebug() << " basesize" << window()->baseSize();
- qDebug() << " geometry" << geometry();
+ qDebug() << " min/max" << windowMinimumSize() << windowMaximumSize();
+ qDebug() << "size increment" << windowSizeIncrement();
+ qDebug() << " basesize" << windowBaseSize();
+ qDebug() << " geometry" << windowGeometry();
#endif
// Set the minimum content size.
- const QSize minimumSize = window()->minimumSize();
+ const 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())];
// Set the maximum content size.
- const QSize maximumSize = window()->maximumSize();
+ const QSize maximumSize = windowMaximumSize();
[m_nsWindow setContentMaxSize : NSMakeSize(maximumSize.width(), maximumSize.height())];
// The window may end up with a fixed size; in this case the zoom button should be disabled.
@@ -1068,13 +1078,14 @@ void QCocoaWindow::propagateSizeHints()
// sizeIncrement is observed to take values of (-1, -1) and (0, 0) for windows that should be
// resizable and that have no specific size increment set. Cocoa expects (1.0, 1.0) in this case.
- if (!window()->sizeIncrement().isEmpty())
- [m_nsWindow setResizeIncrements : qt_mac_toNSSize(window()->sizeIncrement())];
+ const QSize sizeIncrement = windowSizeIncrement();
+ if (!sizeIncrement.isEmpty())
+ [m_nsWindow setResizeIncrements : qt_mac_toNSSize(sizeIncrement)];
else
[m_nsWindow setResizeIncrements : NSMakeSize(1.0, 1.0)];
QRect rect = geometry();
- QSize baseSize = window()->baseSize();
+ QSize baseSize = windowBaseSize();
if (!baseSize.isNull() && baseSize.isValid()) {
[m_nsWindow setFrame:NSMakeRect(rect.x(), rect.y(), baseSize.width(), baseSize.height()) display:YES];
}
@@ -1211,9 +1222,10 @@ void QCocoaWindow::windowDidEndLiveResize()
bool QCocoaWindow::windowShouldClose()
{
- // might have been set from qnsview.mm
- if (m_ignoreWindowShouldClose)
- return false;
+ // This callback should technically only determine if the window
+ // should (be allowed to) close, but since our QPA API to determine
+ // that also involves actually closing the window we do both at the
+ // same time, instead of doing the latter in windowWillClose.
bool accepted = false;
QWindowSystemInterface::handleCloseEvent(window(), &accepted);
QWindowSystemInterface::flushWindowSystemEvents();
@@ -1320,7 +1332,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
| NSWindowCollectionBehaviorFullScreenAuxiliary;
m_nsWindow.animationBehavior = NSWindowAnimationBehaviorNone;
m_nsWindow.collectionBehavior = collectionBehavior;
- setCocoaGeometry(window()->geometry());
+ setCocoaGeometry(windowGeometry());
QList<QCocoaWindow *> &siblings = m_parentCocoaWindow->m_childWindows;
if (siblings.contains(this)) {
@@ -1334,7 +1346,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
} else {
// Child windows have no NSWindow, link the NSViews instead.
[m_parentCocoaWindow->m_contentView addSubview : m_contentView];
- QRect rect = window()->geometry();
+ QRect rect = windowGeometry();
// Prevent setting a (0,0) window size; causes opengl context
// "Invalid Drawable" warnings.
if (rect.isNull())
@@ -1387,9 +1399,9 @@ bool QCocoaWindow::shouldUseNSPanel()
QCocoaNSWindow * QCocoaWindow::createNSWindow()
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
- QRect rect = initialGeometry(window(), window()->geometry(), defaultWindowWidth, defaultWindowHeight);
+ QRect rect = initialGeometry(window(), windowGeometry(), defaultWindowWidth, defaultWindowHeight);
NSRect frame = qt_mac_flipRect(rect);
Qt::WindowType type = window()->type();
@@ -1476,8 +1488,16 @@ void QCocoaWindow::removeChildWindow(QCocoaWindow *child)
[m_nsWindow removeChildWindow:child->m_nsWindow];
}
+void QCocoaWindow::removeMonitor()
+{
+ if (!monitor)
+ return;
+ [NSEvent removeMonitor:monitor];
+ monitor = nil;
+}
+
// Returns the current global screen geometry for the nswindow associated with this window.
-QRect QCocoaWindow::windowGeometry() const
+QRect QCocoaWindow::nativeWindowGeometry() const
{
if (!m_nsWindow || m_isNSWindowChild)
return geometry();
@@ -1507,7 +1527,7 @@ void QCocoaWindow::syncWindowState(Qt::WindowState newState)
// do nothing except set the new state
NSRect contentRect = [contentView() frame];
if (contentRect.size.width <= 0 || contentRect.size.height <= 0) {
- qWarning() << Q_FUNC_INFO << "invalid window content view size, check your window geometry";
+ qWarning("invalid window content view size, check your window geometry");
m_synchedWindowState = newState;
return;
}
@@ -1560,7 +1580,7 @@ void QCocoaWindow::syncWindowState(Qt::WindowState newState)
if (m_normalGeometry.width() < 0) {
m_oldWindowFlags = m_windowFlags;
window()->setFlags(window()->flags() | Qt::FramelessWindowHint);
- m_normalGeometry = windowGeometry();
+ m_normalGeometry = nativeWindowGeometry();
setGeometry(screen->geometry());
m_presentationOptions = [NSApp presentationOptions];
[NSApp setPresentationOptions : m_presentationOptions | NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock];
@@ -1827,6 +1847,24 @@ bool QCocoaWindow::shouldRefuseKeyWindowAndFirstResponder()
return false;
}
+QPoint QCocoaWindow::bottomLeftClippedByNSWindowOffsetStatic(QWindow *window)
+{
+ if (window->handle())
+ return static_cast<QCocoaWindow *>(window->handle())->bottomLeftClippedByNSWindowOffset();
+ return QPoint();
+}
+
+QPoint QCocoaWindow::bottomLeftClippedByNSWindowOffset() const
+{
+ if (!m_contentView)
+ return QPoint();
+ const NSPoint origin = [m_contentView isFlipped] ? NSMakePoint(0, [m_contentView frame].size.height)
+ : NSMakePoint(0, 0);
+ const NSRect visibleRect = [m_contentView visibleRect];
+
+ return QPoint(visibleRect.origin.x, -visibleRect.origin.y + (origin.y - visibleRect.size.height));
+}
+
QMargins QCocoaWindow::frameMargins() const
{
NSRect frameW = [m_nsWindow frame];
diff --git a/src/plugins/platforms/cocoa/qmacclipboard.mm b/src/plugins/platforms/cocoa/qmacclipboard.mm
index 3d88a8d5df..f4fd32ffd1 100644
--- a/src/plugins/platforms/cocoa/qmacclipboard.mm
+++ b/src/plugins/platforms/cocoa/qmacclipboard.mm
@@ -43,7 +43,6 @@
#include <stdlib.h>
#include <string.h>
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
QT_BEGIN_NAMESPACE
@@ -555,7 +554,7 @@ QMacPasteboard::sync() const
QString qt_mac_get_pasteboardString(PasteboardRef paste)
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSPasteboard *pb = nil;
CFStringRef pbname;
if (PasteboardCopyName(paste, &pbname) == noErr) {
diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm
index 6e7ebcc37c..6099add6bb 100644
--- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm
+++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm
@@ -173,7 +173,7 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch)
if (_touchCount != _currentTouches.size()) {
// Remove all instances, and basically start from scratch:
touchPoints.clear();
- foreach (QCocoaTouch *qcocoaTouch, _currentTouches.values()) {
+ foreach (QCocoaTouch *qcocoaTouch, _currentTouches) {
if (!_updateInternalStateOnly) {
qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased;
touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint);
@@ -190,7 +190,7 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch)
// touch now (and refake a begin for it later, if needed).
if (_updateInternalStateOnly && !wasUpdateInternalStateOnly && !_currentTouches.isEmpty()) {
- QCocoaTouch *qcocoaTouch = _currentTouches.values().first();
+ QCocoaTouch *qcocoaTouch = _currentTouches.cbegin().value();
qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased;
touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint);
// Since this last touch also will end up being the first
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 14a61554a3..50b456cab7 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -75,7 +75,10 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) *m_mouseMoveHelper;
bool m_resendKeyEvent;
bool m_scrolling;
+ bool m_updatingDrag;
bool m_exposedOnMoveToWindow;
+ NSEvent *m_currentlyInterpretedKeyEvent;
+ bool m_isMenuView;
}
- (id)init;
@@ -93,8 +96,10 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
- (void)notifyWindowStateChanged:(Qt::WindowState)newState;
- (void)windowNotification : (NSNotification *) windowNotification;
- (void)notifyWindowWillZoom:(BOOL)willZoom;
+- (void)textInputContextKeyboardSelectionDidChangeNotification : (NSNotification *) textInputContextKeyboardSelectionDidChangeNotification;
- (void)viewDidHide;
- (void)viewDidUnhide;
+- (void)removeFromSuperview;
- (BOOL)isFlipped;
- (BOOL)acceptsFirstResponder;
@@ -131,7 +136,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
- (void)handleKeyEvent:(NSEvent *)theEvent eventType:(int)eventType;
- (void)keyDown:(NSEvent *)theEvent;
- (void)keyUp:(NSEvent *)theEvent;
-- (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
- (void)registerDragTypes;
- (NSDragOperation)handleDrag:(id <NSDraggingInfo>)sender;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 1ec33df744..0d80333e65 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -39,9 +39,9 @@
#include "qnsview.h"
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
-#include "qcocoaautoreleasepool.h"
#include "qmultitouch_mac_p.h"
#include "qcocoadrag.h"
+#include "qcocoainputcontext.h"
#include <qpa/qplatformintegration.h>
#include <qpa/qwindowsysteminterface.h>
@@ -153,6 +153,8 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
m_resendKeyEvent = false;
m_scrolling = false;
+ m_updatingDrag = false;
+ m_currentlyInterpretedKeyEvent = 0;
if (!touchDevice) {
touchDevice = new QTouchDevice;
@@ -160,6 +162,8 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
touchDevice->setCapabilities(QTouchDevice::Position | QTouchDevice::NormalizedPosition | QTouchDevice::MouseEmulation);
QWindowSystemInterface::registerTouchDevice(touchDevice);
}
+
+ m_isMenuView = false;
}
return self;
}
@@ -213,6 +217,11 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
name:NSViewFrameDidChangeNotification
object:self];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(textInputContextKeyboardSelectionDidChangeNotification:)
+ name:NSTextInputContextKeyboardSelectionDidChangeNotification
+ object:nil];
+
return self;
}
@@ -269,11 +278,11 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
- (void)viewDidMoveToWindow
{
+ m_isMenuView = [self.window.className isEqualToString:@"NSCarbonMenuWindow"];
if (self.window) {
// This is the case of QWidgetAction's generated QWidget inserted in an NSMenu.
// 10.9 and newer get the NSWindowDidChangeOcclusionStateNotification
- if ((!_q_NSWindowDidChangeOcclusionStateNotification
- && [self.window.className isEqualToString:@"NSCarbonMenuWindow"])) {
+ if (!_q_NSWindowDidChangeOcclusionStateNotification && m_isMenuView) {
m_exposedOnMoveToWindow = true;
m_platformWindow->exposeWindow();
}
@@ -347,6 +356,12 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
if (m_platformWindow->m_nsWindow && geometry == m_platformWindow->geometry())
return;
+ // 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;
+
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QNSView::udpateGeometry" << m_platformWindow << geometry;
#endif
@@ -396,7 +411,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
NSString *notificationName = [windowNotification name];
if (notificationName == NSWindowDidBecomeKeyNotification) {
- if (!m_platformWindow->windowIsPopupType())
+ if (!m_platformWindow->windowIsPopupType() && !m_isMenuView)
QWindowSystemInterface::handleWindowActivated(m_window);
} else if (notificationName == NSWindowDidResignKeyNotification) {
// key window will be non-nil if another window became key... do not
@@ -405,7 +420,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
NSWindow *keyWindow = [NSApp keyWindow];
if (!keyWindow) {
// no new key window, go ahead and set the active window to zero
- if (!m_platformWindow->windowIsPopupType())
+ if (!m_platformWindow->windowIsPopupType() && !m_isMenuView)
QWindowSystemInterface::handleWindowActivated(0);
}
} else if (notificationName == NSWindowDidMiniaturizeNotification
@@ -425,16 +440,17 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wobjc-method-access")
enum { NSWindowOcclusionStateVisible = 1UL << 1 };
#endif
- if ((NSUInteger)[self.window occlusionState] & NSWindowOcclusionStateVisible) {
- m_platformWindow->exposeWindow();
- } else {
- // Send Obscure events on window occlusion to stop animations. Several
- // unit tests expect paint and/or expose events for windows that are
- // sometimes (unpredictably) occlouded: Don't send Obscure events when
- // running under QTestLib.
- static bool onTestLib = qt_mac_resolveOption(false, "QT_QTESTLIB_RUNNING");
- if (!onTestLib)
+ // 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)[self.window occlusionState] & NSWindowOcclusionStateVisible) {
+ m_platformWindow->exposeWindow();
+ } else {
+ // Send Obscure events on window occlusion to stop animations.
m_platformWindow->obscureWindow();
+ }
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
QT_WARNING_POP
@@ -456,6 +472,15 @@ QT_WARNING_POP
}
}
+- (void)textInputContextKeyboardSelectionDidChangeNotification : (NSNotification *) textInputContextKeyboardSelectionDidChangeNotification
+{
+ Q_UNUSED(textInputContextKeyboardSelectionDidChangeNotification)
+ if (([NSApp keyWindow] == [self window]) && [[self window] firstResponder] == self) {
+ QCocoaInputContext *ic = qobject_cast<QCocoaInputContext *>(QCocoaIntegration::instance()->inputContext());
+ ic->updateLocale();
+ }
+}
+
- (void)notifyWindowWillZoom:(BOOL)willZoom
{
Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState;
@@ -474,6 +499,12 @@ QT_WARNING_POP
m_platformWindow->exposeWindow();
}
+- (void)removeFromSuperview
+{
+ QMacAutoReleasePool pool;
+ [super removeFromSuperview];
+}
+
- (void) flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset
{
m_backingStore = backingStore;
@@ -615,13 +646,15 @@ QT_WARNING_POP
{
if (m_window && (m_window->flags() & Qt::WindowTransparentForInput) )
return NO;
- if (!m_platformWindow->windowIsPopupType())
+ if (!m_platformWindow->windowIsPopupType() && !m_isMenuView)
QWindowSystemInterface::handleWindowActivated([self topLevelWindow]);
return YES;
}
- (BOOL)acceptsFirstResponder
{
+ if (m_isMenuView)
+ return NO;
if (m_platformWindow->shouldRefuseKeyWindowAndFirstResponder())
return NO;
if (m_window && (m_window->flags() & Qt::WindowTransparentForInput) )
@@ -852,7 +885,7 @@ QT_WARNING_POP
{
[super updateTrackingAreas];
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
// NSTrackingInVisibleRect keeps care of updating once the tracking is set up, so bail out early
if (m_trackingArea && [[self trackingAreas] containsObject:m_trackingArea])
@@ -1435,41 +1468,42 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
if (!(modifiers & (Qt::ControlModifier | Qt::MetaModifier)) && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff))
text = QCFString::toQString(characters);
- QWindow *focusWindow = [self topLevelWindow];
+ QWindow *window = [self topLevelWindow];
+
+ // Popups implicitly grab key events; forward to the active popup if there is one.
+ // This allows popups to e.g. intercept shortcuts and close the popup in response.
+ if (QCocoaWindow *popup = QCocoaIntegration::instance()->activePopupWindow()) {
+ if (!popup->m_windowFlags.testFlag(Qt::ToolTip))
+ window = popup->window();
+ }
if (eventType == QEvent::KeyPress) {
if (m_composingText.isEmpty()) {
- QKeyEvent override(QEvent::ShortcutOverride, keyCode, modifiers,
- nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat], 1);
- override.setTimestamp(timestamp);
- m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutOverrideEvent(focusWindow, &override);
+ m_sendKeyEvent = !QWindowSystemInterface::handleShortcutEvent(window, timestamp, keyCode,
+ modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat], 1);
}
QObject *fo = QGuiApplication::focusObject();
if (m_sendKeyEvent && fo) {
- // if escape is pressed we don't want interpretKeyEvents to close a dialog. This will be done via QWindowSystemInterface
- if (keyCode == Qt::Key_Escape)
- m_platformWindow->m_ignoreWindowShouldClose = true;
-
QInputMethodQueryEvent queryEvent(Qt::ImEnabled | Qt::ImHints);
if (QCoreApplication::sendEvent(fo, &queryEvent)) {
bool imEnabled = queryEvent.value(Qt::ImEnabled).toBool();
Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(queryEvent.value(Qt::ImHints).toUInt());
if (imEnabled && !(hints & Qt::ImhDigitsOnly || hints & Qt::ImhFormattedNumbersOnly || hints & Qt::ImhHiddenText)) {
// pass the key event to the input method. note that m_sendKeyEvent may be set to false during this call
+ m_currentlyInterpretedKeyEvent = nsevent;
[self interpretKeyEvents:[NSArray arrayWithObject:nsevent]];
+ m_currentlyInterpretedKeyEvent = 0;
}
}
-
- m_platformWindow->m_ignoreWindowShouldClose = false;;
}
if (m_resendKeyEvent)
m_sendKeyEvent = true;
}
if (m_sendKeyEvent && m_composingText.isEmpty())
- QWindowSystemInterface::handleExtendedKeyEvent(focusWindow, timestamp, QEvent::Type(eventType), keyCode, modifiers,
+ QWindowSystemInterface::handleExtendedKeyEvent(window, timestamp, QEvent::Type(eventType), keyCode, modifiers,
nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat], 1, false);
m_sendKeyEvent = false;
@@ -1490,21 +1524,23 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyRelease)];
}
-- (BOOL)performKeyEquivalent:(NSEvent *)nsevent
+- (void)cancelOperation:(id)sender
{
- NSString *chars = [nsevent charactersIgnoringModifiers];
+ Q_UNUSED(sender);
- if ([nsevent type] == NSKeyDown && [chars length] > 0) {
- QChar ch = [chars characterAtIndex:0];
- Qt::Key qtKey = qt_mac_cocoaKey2QtKey(ch);
- // check for Command + Key_Period
- if ([nsevent modifierFlags] & NSCommandKeyMask
- && qtKey == Qt::Key_Period) {
- [self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
- return YES;
- }
- }
- return [super performKeyEquivalent:nsevent];
+ NSEvent *currentEvent = [NSApp currentEvent];
+ if (!currentEvent || currentEvent.type != NSKeyDown)
+ return;
+
+ // Handling the key event may recurse back here through interpretKeyEvents
+ // (when IM is enabled), so we need to guard against that.
+ if (currentEvent == m_currentlyInterpretedKeyEvent)
+ return;
+
+ // Send Command+Key_Period and Escape as normal keypresses so that
+ // the key sequence is delivered through Qt. That way clients can
+ // intercept the shortcut and override its effect.
+ [self handleKeyEvent:currentEvent eventType:int(QEvent::KeyPress)];
}
- (void)flagsChanged:(NSEvent *)nsevent
@@ -1793,7 +1829,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
-(void)registerDragTypes
{
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
QStringList customTypes = qt_mac_enabledDraggedTypes();
if (currentCustomDragTypes == 0 || *currentCustomDragTypes != customTypes) {
if (currentCustomDragTypes == 0)
@@ -1891,6 +1927,9 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
// Make sure the cursor is updated correctly if the mouse does not move and window is under cursor
// by creating a fake move event
+ if (m_updatingDrag)
+ return;
+
const QPoint mousePos(QCursor::pos());
CGEventRef moveEvent(CGEventCreateMouseEvent(
NULL, kCGEventMouseMoved,
@@ -1908,7 +1947,11 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
{
- return [self handleDrag : sender];
+ m_updatingDrag = true;
+ const NSDragOperation ret([self handleDrag : sender]);
+ m_updatingDrag = false;
+
+ return ret;
}
// Sends drag update to Qt, return the action
diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
index 93f0817aad..1f15da5b3b 100644
--- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
@@ -44,6 +44,8 @@
#import <AppKit/NSAccessibility.h>
+#ifndef QT_NO_ACCESSIBILITY
+
@implementation QNSView (QNSViewAccessibility)
- (id)childAccessibleElement {
@@ -80,3 +82,5 @@
}
@end
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index 9e8fe8f1c8..edd1d656f0 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -38,7 +38,6 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdebug.h>
-#include "qcocoaautoreleasepool.h"
#ifndef QT_NO_PRINTER
@@ -212,6 +211,9 @@ int QMacPrintEngine::metric(QPaintDevice::PaintDeviceMetric m) const
case QPaintDevice::PdmDevicePixelRatio:
val = 1;
break;
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ val = 1 * QPaintDevice::devicePixelRatioFScale();
+ break;
default:
val = 0;
qWarning("QPrinter::metric: Invalid metric command");
@@ -230,7 +232,7 @@ void QMacPrintEnginePrivate::initialize()
q->gccaps = paintEngine->gccaps;
- QCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
printInfo = [[NSPrintInfo alloc] initWithDictionary:[NSDictionary dictionary]];
QList<int> resolutions = m_printDevice->supportedResolutions();
diff --git a/src/plugins/platforms/cocoa/qt_mac_p.h b/src/plugins/platforms/cocoa/qt_mac_p.h
index e210f0221f..576e0f9729 100644
--- a/src/plugins/platforms/cocoa/qt_mac_p.h
+++ b/src/plugins/platforms/cocoa/qt_mac_p.h
@@ -103,17 +103,6 @@ public:
}
};
-class Q_WIDGETS_EXPORT QMacCocoaAutoReleasePool
-{
-private:
- void *pool;
-public:
- QMacCocoaAutoReleasePool();
- ~QMacCocoaAutoReleasePool();
-
- inline void *handle() const { return pool; }
-};
-
QString qt_mac_removeMnemonics(const QString &original); //implemented in qmacstyle_mac.cpp
class Q_WIDGETS_EXPORT QMacWindowChangeEvent
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
index 1c7f65a12d..08bfaa1240 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
@@ -48,8 +48,8 @@ public:
QWindowsDirect2DBackingStore(QWindow *window);
~QWindowsDirect2DBackingStore();
- void beginPaint(const QRegion &);
- void endPaint();
+ void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
+ void endPaint() Q_DECL_OVERRIDE;
QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
void flush(QWindow *targetWindow, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
index 20dde476c1..3bd6e76c52 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
@@ -39,12 +39,12 @@
#include "qwindowsdirect2dwindow.h"
#include "qwindowscontext.h"
-#include "qwindowsguieventdispatcher.h"
#include <qplatformdefs.h>
#include <QtCore/QCoreApplication>
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/qpa/qwindowsysteminterface.h>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
QT_BEGIN_NAMESPACE
@@ -219,12 +219,11 @@ QWindowsDirect2DIntegration::~QWindowsDirect2DIntegration()
return static_cast<QWindowsDirect2DIntegration *>(QWindowsIntegration::instance());
}
- QPlatformWindow *QWindowsDirect2DIntegration::createPlatformWindow(QWindow *window) const
- {
- QWindowsWindowData data = createWindowData(window);
- return data.hwnd ? new QWindowsDirect2DWindow(window, data)
- : Q_NULLPTR;
- }
+
+QWindowsWindow *QWindowsDirect2DIntegration::createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &data) const
+{
+ return new QWindowsDirect2DWindow(window, data);
+}
QPlatformNativeInterface *QWindowsDirect2DIntegration::nativeInterface() const
{
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
index 6b7b3fbea2..64042cab0a 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
@@ -52,7 +52,6 @@ public:
static QWindowsDirect2DIntegration *instance();
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const Q_DECL_OVERRIDE;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
@@ -60,6 +59,9 @@ public:
QWindowsDirect2DContext *direct2DContext() const;
+protected:
+ QWindowsWindow *createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &) const Q_DECL_OVERRIDE;
+
private:
explicit QWindowsDirect2DIntegration(const QStringList &paramList);
bool init();
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp
index fee9ad88fa..40709fc3d0 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp
@@ -113,6 +113,9 @@ int QWindowsDirect2DPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric)
case QPaintDevice::PdmDevicePixelRatio:
return 1;
break;
+ case QPaintDevice::PdmDevicePixelRatioScaled:
+ return 1 * devicePixelRatioFScale();
+ break;
case QPaintDevice::PdmWidthMM:
case QPaintDevice::PdmHeightMM:
return -1;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h
index 5720f84853..a9591a493a 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h
@@ -54,8 +54,7 @@ public:
~QWindowsDirect2DPlatformPixmap();
void resize(int width, int height) Q_DECL_OVERRIDE;
- virtual void fromImage(const QImage &image,
- Qt::ImageConversionFlags flags);
+ void fromImage(const QImage &image, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
void fill(const QColor &color) Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/directfb/qdirectfbblitter.cpp b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
index 4deac969e4..b87310ed76 100644
--- a/src/plugins/platforms/directfb/qdirectfbblitter.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
@@ -473,7 +473,7 @@ IDirectFBSurface *QDirectFbTextureGlyphCache::sourceSurface()
case QImage::Format_Mono:
desc.pixelformat = DSPF_A1;
break;
- case QImage::Format_Indexed8:
+ case QImage::Format_Alpha8:
desc.pixelformat = DSPF_A8;
break;
default:
diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
index e635d4fd22..e1d97d9628 100644
--- a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp
@@ -217,7 +217,7 @@ Qt::KeyboardModifiers QDirectFbConvenience::keyboardModifiers(DFBInputDeviceModi
modifiers |= Qt::ControlModifier;
}
if (mask & DIMM_META) {
- modifiers | Qt::MetaModifier;
+ modifiers |= Qt::MetaModifier;
}
return modifiers;
}
diff --git a/src/plugins/platforms/eglfs/cursor-atlas.png b/src/plugins/platforms/eglfs/cursor-atlas.png
index 40c5b6ef4f..40c5b6ef4f 100755..100644
--- a/src/plugins/platforms/eglfs/cursor-atlas.png
+++ b/src/plugins/platforms/eglfs/cursor-atlas.png
Binary files differ
diff --git a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
index 0adbb0d49f..266a97dff5 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
@@ -1,7 +1,9 @@
TEMPLATE = subdirs
contains(QT_CONFIG, egl_x11): SUBDIRS += eglfs_x11
-contains(QT_CONFIG, kms): SUBDIRS += eglfs_kms
+contains(QT_CONFIG, eglfs_gbm): SUBDIRS += eglfs_kms
+contains(QT_CONFIG, eglfs_egldevice): SUBDIRS += eglfs_kms_egldevice
contains(QT_CONFIG, eglfs_brcm): SUBDIRS += eglfs_brcm
contains(QT_CONFIG, eglfs_mali): SUBDIRS += eglfs_mali
contains(QT_CONFIG, eglfs_viv): SUBDIRS += eglfs_viv
+contains(QT_CONFIG, eglfs_viv_wl): SUBDIRS += eglfs_viv_wl
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro
index 98797e2106..2026b6a6c6 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro
@@ -12,6 +12,9 @@ CONFIG += egl
LIBS += -lbcm_host
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+# Avoid X11 header collision
+DEFINES += MESA_EGL_NO_X11_HEADERS
+
SOURCES += $$PWD/qeglfsbrcmmain.cpp \
$$PWD/qeglfsbrcmintegration.cpp
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
index 18a66e34f5..c29d64c06d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
@@ -191,6 +191,12 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
return Q_NULLPTR;
}
+ // Skip disconnected output
+ if (configuration == OutputConfigPreferred && connector->connection == DRM_MODE_DISCONNECTED) {
+ qCDebug(qLcEglfsKmsDebug) << "Skipping disconnected output" << connectorName;
+ return Q_NULLPTR;
+ }
+
// Get the current mode on the current crtc
drmModeModeInfo crtc_mode;
memset(&crtc_mode, 0, sizeof crtc_mode);
@@ -208,11 +214,12 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
}
QList<drmModeModeInfo> modes;
+ modes.reserve(connector->count_modes);
qCDebug(qLcEglfsKmsDebug) << connectorName << "mode count:" << connector->count_modes;
for (int i = 0; i < connector->count_modes; i++) {
const drmModeModeInfo &mode = connector->modes[i];
qCDebug(qLcEglfsKmsDebug) << "mode" << i << mode.hdisplay << "x" << mode.vdisplay
- << "@" << mode.vrefresh << "hz";
+ << '@' << mode.vrefresh << "hz";
modes << connector->modes[i];
}
@@ -271,7 +278,7 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
int height = modes[selected_mode].vdisplay;
int refresh = modes[selected_mode].vrefresh;
qCDebug(qLcEglfsKmsDebug) << "Selected mode" << selected_mode << ":" << width << "x" << height
- << "@" << refresh << "hz for output" << connectorName;
+ << '@' << refresh << "hz for output" << connectorName;
}
QEglFSKmsOutput output = {
@@ -282,7 +289,9 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
selected_mode,
false,
drmModeGetCrtc(m_dri_fd, crtc_id),
- modes
+ modes,
+ connector->subpixel,
+ connectorProperty(connector, QByteArrayLiteral("DPMS"))
};
m_crtc_allocator |= (1 << output.crtc_id);
@@ -291,6 +300,22 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
return new QEglFSKmsScreen(m_integration, this, output, pos);
}
+drmModePropertyPtr QEglFSKmsDevice::connectorProperty(drmModeConnectorPtr connector, const QByteArray &name)
+{
+ drmModePropertyPtr prop;
+
+ for (int i = 0; i < connector->count_props; i++) {
+ prop = drmModeGetProperty(m_dri_fd, connector->props[i]);
+ if (!prop)
+ continue;
+ if (strcmp(prop->name, name.constData()) == 0)
+ return prop;
+ drmModeFreeProperty(prop);
+ }
+
+ return Q_NULLPTR;
+}
+
void QEglFSKmsDevice::pageFlipHandler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data)
{
Q_UNUSED(fd);
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h
index 23fca934e5..411f9a7200 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h
@@ -78,6 +78,7 @@ private:
int crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr connector);
QEglFSKmsScreen *screenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, QPoint pos);
+ drmModePropertyPtr connectorProperty(drmModeConnectorPtr connector, const QByteArray &name);
static void pageFlipHandler(int fd,
unsigned int sequence,
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp
index 45224ccb87..d1814fb85d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp
@@ -36,8 +36,8 @@
#include "qeglfskmsdevice.h"
#include "qeglfskmsscreen.h"
#include "qeglfskmscursor.h"
+#include "qeglfscursor.h"
-#include <QtPlatformSupport/private/qeglplatformcursor_p.h>
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
#include <QtCore/QLoggingCategory>
#include <QtCore/QJsonDocument>
@@ -176,7 +176,7 @@ QPlatformCursor *QEglFSKmsIntegration::createCursor(QPlatformScreen *screen) con
if (m_hwCursor)
return Q_NULLPTR;
else
- return new QEGLPlatformCursor(screen);
+ return new QEglFSCursor(screen);
}
void QEglFSKmsIntegration::waitForVSync(QPlatformSurface *surface) const
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp
index 5e49c224a0..048f5433dc 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp
@@ -35,11 +35,11 @@
#include "qeglfskmsscreen.h"
#include "qeglfskmsdevice.h"
#include "qeglfskmscursor.h"
+#include "qeglfsintegration.h"
#include <QtCore/QLoggingCategory>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtPlatformSupport/private/qeglplatformintegration_p.h>
#include <QtPlatformSupport/private/qfbvthandler_p.h>
QT_BEGIN_NAMESPACE
@@ -50,17 +50,13 @@ class QEglFSKmsInterruptHandler : public QObject
{
public:
QEglFSKmsInterruptHandler(QEglFSKmsScreen *screen) : m_screen(screen) {
- m_vtHandler = static_cast<QEGLPlatformIntegration *>(QGuiApplicationPrivate::platformIntegration())->vtHandler();
+ m_vtHandler = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration())->vtHandler();
connect(m_vtHandler, &QFbVtHandler::interrupted, this, &QEglFSKmsInterruptHandler::restoreVideoMode);
- connect(m_vtHandler, &QFbVtHandler::suspendRequested, this, &QEglFSKmsInterruptHandler::handleSuspendRequest);
+ connect(m_vtHandler, &QFbVtHandler::aboutToSuspend, this, &QEglFSKmsInterruptHandler::restoreVideoMode);
}
public slots:
void restoreVideoMode() { m_screen->restoreMode(); }
- void handleSuspendRequest() {
- m_screen->restoreMode();
- m_vtHandler->suspend();
- }
private:
QFbVtHandler *m_vtHandler;
@@ -119,6 +115,7 @@ QEglFSKmsScreen::QEglFSKmsScreen(QEglFSKmsIntegration *integration,
, m_output(output)
, m_pos(position)
, m_cursor(Q_NULLPTR)
+ , m_powerState(PowerStateOn)
, m_interruptHandler(new QEglFSKmsInterruptHandler(this))
{
m_siblings << this;
@@ -126,6 +123,10 @@ QEglFSKmsScreen::QEglFSKmsScreen(QEglFSKmsIntegration *integration,
QEglFSKmsScreen::~QEglFSKmsScreen()
{
+ if (m_output.dpms_prop) {
+ drmModeFreeProperty(m_output.dpms_prop);
+ m_output.dpms_prop = Q_NULLPTR;
+ }
restoreMode();
if (m_output.saved_crtc) {
drmModeFreeCrtc(m_output.saved_crtc);
@@ -159,10 +160,10 @@ QSizeF QEglFSKmsScreen::physicalSize() const
QDpi QEglFSKmsScreen::logicalDpi() const
{
- QSizeF ps = physicalSize();
- QSize s = geometry().size();
+ const QSizeF ps = physicalSize();
+ const QSize s = geometry().size();
- if (ps.isValid() && s.isValid())
+ if (!ps.isEmpty() && !s.isEmpty())
return QDpi(25.4 * s.width() / ps.width(),
25.4 * s.height() / ps.height());
else
@@ -266,10 +267,12 @@ void QEglFSKmsScreen::flip()
&m_output.connector_id, 1,
&m_output.modes[m_output.mode]);
- if (ret)
+ if (ret) {
qErrnoWarning("Could not set DRM mode!");
- else
+ } else {
m_output.mode_set = true;
+ setPowerState(PowerStateOn);
+ }
}
int ret = drmModePageFlip(m_device->fd(),
@@ -314,4 +317,37 @@ qreal QEglFSKmsScreen::refreshRate() const
return refresh > 0 ? refresh : 60;
}
+QPlatformScreen::SubpixelAntialiasingType QEglFSKmsScreen::subpixelAntialiasingTypeHint() const
+{
+ switch (m_output.subpixel) {
+ default:
+ case DRM_MODE_SUBPIXEL_UNKNOWN:
+ case DRM_MODE_SUBPIXEL_NONE:
+ return Subpixel_None;
+ case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
+ return Subpixel_RGB;
+ case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
+ return Subpixel_BGR;
+ case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
+ return Subpixel_VRGB;
+ case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
+ return Subpixel_VBGR;
+ }
+}
+
+QPlatformScreen::PowerState QEglFSKmsScreen::powerState() const
+{
+ return m_powerState;
+}
+
+void QEglFSKmsScreen::setPowerState(QPlatformScreen::PowerState state)
+{
+ if (!m_output.dpms_prop)
+ return;
+
+ drmModeConnectorSetProperty(m_device->fd(), m_output.connector_id,
+ m_output.dpms_prop->prop_id, (int)state);
+ m_powerState = state;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h
index 4c1b0d02ad..7fd6ccaa31 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h
@@ -60,6 +60,8 @@ struct QEglFSKmsOutput
bool mode_set;
drmModeCrtcPtr saved_crtc;
QList<drmModeModeInfo> modes;
+ int subpixel;
+ drmModePropertyPtr dpms_prop;
};
class QEglFSKmsScreen : public QEglFSScreen
@@ -103,6 +105,11 @@ public:
QEglFSKmsOutput &output() { return m_output; }
void restoreMode();
+ SubpixelAntialiasingType subpixelAntialiasingTypeHint() const Q_DECL_OVERRIDE;
+
+ QPlatformScreen::PowerState powerState() const Q_DECL_OVERRIDE;
+ void setPowerState(QPlatformScreen::PowerState state) Q_DECL_OVERRIDE;
+
private:
QEglFSKmsIntegration *m_integration;
QEglFSKmsDevice *m_device;
@@ -117,6 +124,8 @@ private:
QList<QPlatformScreen *> m_siblings;
+ PowerState m_powerState;
+
struct FrameBuffer {
FrameBuffer() : fb(0) {}
uint32_t fb;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.json b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.json
new file mode 100644
index 0000000000..169ba1eb02
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "eglfs_kms_egldevice" ]
+}
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
new file mode 100644
index 0000000000..393ddd14a5
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
@@ -0,0 +1,23 @@
+TARGET = qeglfs-kms-egldevice-integration
+
+PLUGIN_TYPE = egldeviceintegrations
+PLUGIN_CLASS_NAME = QEglFSKmsEglDeviceIntegrationPlugin
+load(qt_plugin)
+
+QT += core-private gui-private platformsupport-private eglfs_device_lib-private
+
+INCLUDEPATH += $$PWD/../..
+
+DEFINES += MESA_EGL_NO_X11_HEADERS
+
+CONFIG += egl
+QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+
+SOURCES += $$PWD/qeglfskmsegldevicemain.cpp \
+ $$PWD/qeglfskmsegldeviceintegration.cpp
+
+HEADERS += $$PWD/qeglfskmsegldeviceintegration.h
+
+OTHER_FILES += $$PWD/eglfs_kms_egldevice.json
+
+LIBS += -ldrm
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
new file mode 100644
index 0000000000..f7450708ab
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -0,0 +1,421 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "qeglfskmsegldeviceintegration.h"
+#include <QLoggingCategory>
+#include <private/qmath_p.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qLcEglfsKmsDebug, "qt.qpa.eglfs.kms")
+
+QEglFSKmsEglDeviceIntegration::QEglFSKmsEglDeviceIntegration()
+ : m_dri_fd(-1)
+ , m_egl_device(EGL_NO_DEVICE_EXT)
+ , m_egl_display(EGL_NO_DISPLAY)
+ , m_drm_connector(Q_NULLPTR)
+ , m_drm_encoder(Q_NULLPTR)
+ , m_drm_crtc(0)
+ , m_funcs(Q_NULLPTR)
+{
+ qCDebug(qLcEglfsKmsDebug, "New DRM/KMS on EGLDevice integration created");
+}
+
+void QEglFSKmsEglDeviceIntegration::platformInit()
+{
+ if (!query_egl_device())
+ qFatal("Could not set up EGL device!");
+
+ const char *deviceName = m_funcs->query_device_string(m_egl_device, EGL_DRM_DEVICE_FILE_EXT);
+ if (!deviceName)
+ qFatal("Failed to query device name from EGLDevice");
+
+ qCDebug(qLcEglfsKmsDebug, "Opening %s", deviceName);
+
+ m_dri_fd = drmOpen(deviceName, Q_NULLPTR);
+ if (m_dri_fd < 0)
+ qFatal("Could not open DRM device");
+
+ if (!setup_kms())
+ qFatal("Could not set up KMS on device %s!", m_device.constData());
+
+ qCDebug(qLcEglfsKmsDebug, "DRM/KMS initialized");
+}
+
+void QEglFSKmsEglDeviceIntegration::platformDestroy()
+{
+ if (qt_safe_close(m_dri_fd) == -1)
+ qErrnoWarning("Could not close DRM device");
+
+ m_dri_fd = -1;
+
+ delete m_funcs;
+ m_funcs = Q_NULLPTR;
+}
+
+EGLNativeDisplayType QEglFSKmsEglDeviceIntegration::platformDisplay() const
+{
+ return static_cast<EGLNativeDisplayType>(m_egl_device);
+}
+
+EGLDisplay QEglFSKmsEglDeviceIntegration::createDisplay(EGLNativeDisplayType nativeDisplay)
+{
+ qCDebug(qLcEglfsKmsDebug, "Creating display");
+
+ EGLDisplay display;
+
+ if (m_funcs->has_egl_platform_device) {
+ display = m_funcs->get_platform_display(EGL_PLATFORM_DEVICE_EXT, nativeDisplay, Q_NULLPTR);
+ } else {
+ qWarning("EGL_EXT_platform_device not available, falling back to legacy path!");
+ display = eglGetDisplay(nativeDisplay);
+ }
+
+ if (display == EGL_NO_DISPLAY)
+ qFatal("Could not get EGL display");
+
+ EGLint major, minor;
+ if (!eglInitialize(display, &major, &minor))
+ qFatal("Could not initialize egl display");
+
+ if (!eglBindAPI(EGL_OPENGL_ES_API))
+ qFatal("Failed to bind EGL_OPENGL_ES_API\n");
+
+ return display;
+}
+
+QSizeF QEglFSKmsEglDeviceIntegration::physicalScreenSize() const
+{
+ const int defaultPhysicalDpi = 100;
+ static const int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH");
+ static const int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT");
+ QSizeF size(width, height);
+ if (size.isEmpty()) {
+ size = QSizeF(m_drm_connector->mmWidth, m_drm_connector->mmHeight);
+ if (size.isEmpty()) {
+ const float pixelsPerMm = Q_MM_PER_INCH / defaultPhysicalDpi;
+ size = QSizeF(screenSize().width() * pixelsPerMm, screenSize().height() * pixelsPerMm);
+ }
+ }
+ return size;
+}
+
+QSize QEglFSKmsEglDeviceIntegration::screenSize() const
+{
+ return QSize(m_drm_mode.hdisplay, m_drm_mode.vdisplay);
+}
+
+int QEglFSKmsEglDeviceIntegration::screenDepth() const
+{
+ return 32;
+}
+
+QSurfaceFormat QEglFSKmsEglDeviceIntegration::surfaceFormatFor(const QSurfaceFormat &inputFormat) const
+{
+ QSurfaceFormat format(inputFormat);
+ format.setRenderableType(QSurfaceFormat::OpenGLES);
+ format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+ format.setRedBufferSize(8);
+ format.setGreenBufferSize(8);
+ format.setBlueBufferSize(8);
+ return format;
+}
+
+EGLint QEglFSKmsEglDeviceIntegration::surfaceType() const
+{
+ return EGL_STREAM_BIT_KHR;
+}
+
+class QEglJetsonTK1Window : public QEglFSWindow
+{
+public:
+ QEglJetsonTK1Window(QWindow *w, const QEglFSKmsEglDeviceIntegration *integration)
+ : QEglFSWindow(w)
+ , m_integration(integration)
+ , m_egl_stream(EGL_NO_STREAM_KHR)
+ { }
+
+ void invalidateSurface() Q_DECL_OVERRIDE;
+ void resetSurface() Q_DECL_OVERRIDE;
+
+ const QEglFSKmsEglDeviceIntegration *m_integration;
+ EGLStreamKHR m_egl_stream;
+ EGLint m_latency;
+};
+
+void QEglJetsonTK1Window::invalidateSurface()
+{
+ QEglFSWindow::invalidateSurface();
+ m_integration->m_funcs->destroy_stream(screen()->display(), m_egl_stream);
+}
+
+void QEglJetsonTK1Window::resetSurface()
+{
+ qCDebug(qLcEglfsKmsDebug, "Creating stream");
+
+ EGLDisplay display = screen()->display();
+ EGLOutputLayerEXT layer = EGL_NO_OUTPUT_LAYER_EXT;
+ EGLint count;
+
+ m_egl_stream = m_integration->m_funcs->create_stream(display, Q_NULLPTR);
+ if (m_egl_stream == EGL_NO_STREAM_KHR) {
+ qWarning("resetSurface: Couldn't create EGLStream for native window");
+ return;
+ }
+
+ qCDebug(qLcEglfsKmsDebug, "Created stream %p on display %p", m_egl_stream, display);
+
+ if (!m_integration->m_funcs->get_output_layers(display, Q_NULLPTR, Q_NULLPTR, 0, &count) || count == 0) {
+ qWarning("No output layers found");
+ return;
+ }
+
+ qCDebug(qLcEglfsKmsDebug, "Output has %d layers", count);
+
+ QVector<EGLOutputLayerEXT> layers;
+ layers.resize(count);
+ EGLint actualCount;
+ if (!m_integration->m_funcs->get_output_layers(display, Q_NULLPTR, layers.data(), count, &actualCount)) {
+ qWarning("Failed to get layers");
+ return;
+ }
+
+ for (int i = 0; i < actualCount; ++i) {
+ EGLAttrib id;
+ if (m_integration->m_funcs->query_output_layer_attrib(display, layers[i], EGL_DRM_CRTC_EXT, &id)) {
+ qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - crtc %d", i, layers[i], (int) id);
+ if (id == EGLAttrib(m_integration->m_drm_crtc))
+ layer = layers[i];
+ } else if (m_integration->m_funcs->query_output_layer_attrib(display, layers[i], EGL_DRM_PLANE_EXT, &id)) {
+ // Not used yet, just for debugging.
+ qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - plane %d", i, layers[i], (int) id);
+ } else {
+ qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - unknown", i, layers[i]);
+ }
+ }
+
+ QByteArray reqLayerIndex = qgetenv("QT_QPA_EGLFS_LAYER_INDEX");
+ if (!reqLayerIndex.isEmpty()) {
+ int idx = reqLayerIndex.toInt();
+ if (idx >= 0 && idx < layers.count())
+ layer = layers[idx];
+ }
+
+ if (layer == EGL_NO_OUTPUT_LAYER_EXT) {
+ qWarning("resetSurface: Couldn't get EGLOutputLayer for native window");
+ return;
+ }
+
+ qCDebug(qLcEglfsKmsDebug, "Using layer %p", layer);
+
+ if (!m_integration->m_funcs->stream_consumer_output(display, m_egl_stream, layer))
+ qWarning("resetSurface: Unable to connect stream");
+
+ m_config = QEglFSIntegration::chooseConfig(display, m_integration->surfaceFormatFor(window()->requestedFormat()));
+ m_format = q_glFormatFromConfig(display, m_config);
+ qCDebug(qLcEglfsKmsDebug) << "Stream producer format is" << m_format;
+
+ const int w = m_integration->screenSize().width();
+ const int h = m_integration->screenSize().height();
+ qCDebug(qLcEglfsKmsDebug, "Creating stream producer surface of size %dx%d", w, h);
+
+ const EGLint stream_producer_attribs[] = {
+ EGL_WIDTH, w,
+ EGL_HEIGHT, h,
+ EGL_NONE
+ };
+
+ m_surface = m_integration->m_funcs->create_stream_producer_surface(display, m_config, m_egl_stream, stream_producer_attribs);
+ if (m_surface == EGL_NO_SURFACE)
+ return;
+
+ qCDebug(qLcEglfsKmsDebug, "Created stream producer surface %p", m_surface);
+}
+
+QEglFSWindow *QEglFSKmsEglDeviceIntegration::createWindow(QWindow *window) const
+{
+ QEglJetsonTK1Window *eglWindow = new QEglJetsonTK1Window(window, this);
+
+ m_funcs->initialize(eglWindow->screen()->display());
+ if (!(m_funcs->has_egl_output_base && m_funcs->has_egl_output_drm && m_funcs->has_egl_stream
+ && m_funcs->has_egl_stream_producer_eglsurface && m_funcs->has_egl_stream_consumer_egloutput))
+ qFatal("Required extensions missing!");
+
+ return eglWindow;
+}
+
+bool QEglFSKmsEglDeviceIntegration::hasCapability(QPlatformIntegration::Capability cap) const
+{
+ switch (cap) {
+ case QPlatformIntegration::ThreadedPixmaps:
+ case QPlatformIntegration::OpenGL:
+ case QPlatformIntegration::ThreadedOpenGL:
+ case QPlatformIntegration::BufferQueueingOpenGL:
+ return true;
+ default:
+ return false;
+ }
+}
+
+void QEglFSKmsEglDeviceIntegration::waitForVSync(QPlatformSurface *) const
+{
+ static bool mode_set = false;
+
+ if (!mode_set) {
+ mode_set = true;
+
+ drmModeCrtcPtr currentMode = drmModeGetCrtc(m_dri_fd, m_drm_crtc);
+ const bool alreadySet = currentMode
+ && currentMode->width == m_drm_mode.hdisplay
+ && currentMode->height == m_drm_mode.vdisplay;
+ if (currentMode)
+ drmModeFreeCrtc(currentMode);
+ if (alreadySet) {
+ qCDebug(qLcEglfsKmsDebug, "Mode already set");
+ return;
+ }
+
+ qCDebug(qLcEglfsKmsDebug, "Setting mode");
+ int ret = drmModeSetCrtc(m_dri_fd, m_drm_crtc,
+ -1, 0, 0,
+ &m_drm_connector->connector_id, 1,
+ const_cast<const drmModeModeInfoPtr>(&m_drm_mode));
+ if (ret)
+ qFatal("drmModeSetCrtc failed");
+ }
+}
+
+qreal QEglFSKmsEglDeviceIntegration::refreshRate() const
+{
+ quint32 refresh = m_drm_mode.vrefresh;
+ return refresh > 0 ? refresh : 60;
+}
+
+bool QEglFSKmsEglDeviceIntegration::supportsSurfacelessContexts() const
+{
+ // Returning false disables the usage of EGL_KHR_surfaceless_context even when the
+ // extension is available. This is just what we need since, at least with NVIDIA
+ // 352.00 making a null surface current with a context breaks.
+ return false;
+}
+
+bool QEglFSKmsEglDeviceIntegration::setup_kms()
+{
+ drmModeRes *resources;
+ drmModeConnector *connector;
+ drmModeEncoder *encoder;
+ quint32 crtc = 0;
+ int i;
+
+ resources = drmModeGetResources(m_dri_fd);
+ if (!resources) {
+ qWarning("drmModeGetResources failed");
+ return false;
+ }
+
+ for (i = 0; i < resources->count_connectors; i++) {
+ connector = drmModeGetConnector(m_dri_fd, resources->connectors[i]);
+ if (!connector)
+ continue;
+
+ if (connector->connection == DRM_MODE_CONNECTED && connector->count_modes > 0)
+ break;
+
+ drmModeFreeConnector(connector);
+ }
+
+ if (i == resources->count_connectors) {
+ qWarning("No currently active connector found.");
+ return false;
+ }
+
+ qCDebug(qLcEglfsKmsDebug, "Using connector with type %d", connector->connector_type);
+
+ for (i = 0; i < resources->count_encoders; i++) {
+ encoder = drmModeGetEncoder(m_dri_fd, resources->encoders[i]);
+ if (!encoder)
+ continue;
+
+ if (encoder->encoder_id == connector->encoder_id)
+ break;
+
+ drmModeFreeEncoder(encoder);
+ }
+
+ for (int j = 0; j < resources->count_crtcs; j++) {
+ if ((encoder->possible_crtcs & (1 << j))) {
+ crtc = resources->crtcs[j];
+ break;
+ }
+ }
+
+ if (crtc == 0)
+ qFatal("No suitable CRTC available");
+
+ m_drm_connector = connector;
+ m_drm_encoder = encoder;
+ m_drm_mode = connector->modes[0];
+ m_drm_crtc = crtc;
+
+ qCDebug(qLcEglfsKmsDebug).noquote() << "Using crtc" << m_drm_crtc
+ << "with mode" << m_drm_mode.hdisplay << "x" << m_drm_mode.vdisplay
+ << "@" << m_drm_mode.vrefresh;
+
+ drmModeFreeResources(resources);
+
+ return true;
+}
+
+bool QEglFSKmsEglDeviceIntegration::query_egl_device()
+{
+ m_funcs = new QEGLStreamConvenience;
+ if (!m_funcs->has_egl_device_base)
+ qFatal("EGL_EXT_device_base missing");
+
+ EGLint num_devices = 0;
+ if (m_funcs->query_devices(1, &m_egl_device, &num_devices) != EGL_TRUE) {
+ qWarning("eglQueryDevicesEXT failed: eglError: %x", eglGetError());
+ return false;
+ }
+
+ qCDebug(qLcEglfsKmsDebug, "Found %d EGL devices", num_devices);
+
+ if (num_devices < 1 || m_egl_device == EGL_NO_DEVICE_EXT) {
+ qWarning("eglQueryDevicesEXT could not find any EGL devices");
+ return false;
+ }
+
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
new file mode 100644
index 0000000000..a89a65ca55
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QEGLFSKMSEGLDEVICEINTEGRATION_H
+#define QEGLFSKMSEGLDEVICEINTEGRATION_H
+
+#include "qeglfsdeviceintegration.h"
+#include "qeglfswindow.h"
+#include "qeglfsintegration.h"
+
+#include <QtPlatformSupport/private/qdevicediscovery_p.h>
+#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtCore/private/qcore_unix_p.h>
+#include <QtCore/QScopedPointer>
+#include <QtGui/qpa/qplatformwindow.h>
+#include <QtGui/qguiapplication.h>
+#include <QDebug>
+
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+#include <QtPlatformSupport/private/qeglstreamconvenience_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QEglFSKmsEglDeviceIntegration : public QEGLDeviceIntegration
+{
+public:
+ QEglFSKmsEglDeviceIntegration();
+
+ void platformInit() Q_DECL_OVERRIDE;
+ void platformDestroy() Q_DECL_OVERRIDE;
+ EGLNativeDisplayType platformDisplay() const Q_DECL_OVERRIDE;
+ EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay) Q_DECL_OVERRIDE;
+ QSizeF physicalScreenSize() const Q_DECL_OVERRIDE;
+ QSize screenSize() const Q_DECL_OVERRIDE;
+ int screenDepth() const Q_DECL_OVERRIDE;
+ qreal refreshRate() const Q_DECL_OVERRIDE;
+ QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const Q_DECL_OVERRIDE;
+ EGLint surfaceType() const Q_DECL_OVERRIDE;
+ QEglFSWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE;
+ bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ void waitForVSync(QPlatformSurface *surface) const Q_DECL_OVERRIDE;
+ bool supportsSurfacelessContexts() const Q_DECL_OVERRIDE;
+
+ bool setup_kms();
+ bool query_egl_device();
+
+ // device bits
+ QByteArray m_device;
+ int m_dri_fd;
+ EGLDeviceEXT m_egl_device;
+ EGLDisplay m_egl_display;
+
+ // KMS bits
+ drmModeConnector *m_drm_connector;
+ drmModeEncoder *m_drm_encoder;
+ drmModeModeInfo m_drm_mode;
+ quint32 m_drm_crtc;
+
+ // EGLStream infrastructure
+ QEGLStreamConvenience *m_funcs;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicemain.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicemain.cpp
new file mode 100644
index 0000000000..f987ae38a6
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicemain.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the qmake spec 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 "qeglfskmsegldeviceintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+class QEglFSKmsEglDeviceIntegrationPlugin : public QEGLDeviceIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QEGLDeviceIntegrationFactoryInterface_iid FILE "eglfs_kms_egldevice.json")
+
+public:
+ QEGLDeviceIntegration *create() Q_DECL_OVERRIDE { return new QEglFSKmsEglDeviceIntegration; }
+};
+
+QT_END_NAMESPACE
+
+#include "qeglfskmsegldevicemain.moc"
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp
index 455d78035a..43decdf849 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp
@@ -32,7 +32,6 @@
****************************************************************************/
#include "qeglfsmaliintegration.h"
-#include <EGL/fbdev_window.h>
#include <unistd.h>
#include <fcntl.h>
@@ -43,6 +42,11 @@
QT_BEGIN_NAMESPACE
+struct fbdev_window {
+ unsigned short width;
+ unsigned short height;
+};
+
void QEglFSMaliIntegration::platformInit()
{
// Keep the non-overridden base class functions based on fb0 working.
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.json b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.json
new file mode 100644
index 0000000000..ced5245fa0
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "eglfs_viv_wl" ]
+}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro
new file mode 100644
index 0000000000..26b6a2e9ea
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro
@@ -0,0 +1,23 @@
+TARGET = qeglfs-viv-wl-integration
+
+PLUGIN_TYPE = egldeviceintegrations
+PLUGIN_CLASS_NAME = QEglFSVivWaylandIntegrationPlugin
+load(qt_plugin)
+
+QT += core-private gui-private platformsupport-private eglfs_device_lib-private
+
+INCLUDEPATH += $$PWD/../..
+CONFIG += egl
+DEFINES += LINUX=1 EGL_API_FB=1
+LIBS += -lGAL
+QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+
+SOURCES += $$PWD/qeglfsvivwlmain.cpp \
+ $$PWD/qeglfsvivwlintegration.cpp
+
+HEADERS += $$PWD/qeglfsvivwlintegration.h
+
+OTHER_FILES += $$PWD/eglfs_viv_wl.json
+
+CONFIG += link_pkgconfig
+PKGCONFIG_PRIVATE += wayland-server
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.cpp
new file mode 100644
index 0000000000..9eebcc772a
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "qeglfsvivwlintegration.h"
+#include <EGL/eglvivante.h>
+#include <QDebug>
+
+#include <wayland-server.h>
+
+QT_BEGIN_NAMESPACE
+
+void QEglFSVivWaylandIntegration::platformInit()
+{
+ QEGLDeviceIntegration::platformInit();
+
+ int width, height;
+
+ bool multiBufferNotEnabledYet = qEnvironmentVariableIsEmpty("FB_MULTI_BUFFER");
+ bool multiBuffer = qEnvironmentVariableIsEmpty("QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER");
+ if (multiBufferNotEnabledYet && multiBuffer) {
+ qWarning() << "QEglFSVivWaylandIntegration will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.\n"
+ << "If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1";
+ qputenv("FB_MULTI_BUFFER", "2");
+ }
+
+ mWaylandDisplay = wl_display_create();
+ mNativeDisplay = fbGetDisplay(mWaylandDisplay);
+ fbGetDisplayGeometry(mNativeDisplay, &width, &height);
+ mScreenSize.setHeight(height);
+ mScreenSize.setWidth(width);
+}
+
+QSize QEglFSVivWaylandIntegration::screenSize() const
+{
+ return mScreenSize;
+}
+
+EGLNativeDisplayType QEglFSVivWaylandIntegration::platformDisplay() const
+{
+ return mNativeDisplay;
+}
+
+EGLNativeWindowType QEglFSVivWaylandIntegration::createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format)
+{
+ Q_UNUSED(window)
+ Q_UNUSED(format)
+
+ EGLNativeWindowType eglWindow = fbCreateWindow(mNativeDisplay, 0, 0, size.width(), size.height());
+ return eglWindow;
+}
+
+void QEglFSVivWaylandIntegration::destroyNativeWindow(EGLNativeWindowType window)
+{
+ fbDestroyWindow(window);
+}
+
+void *QEglFSVivWaylandIntegration::wlDisplay() const
+{
+ return mWaylandDisplay;
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.h
new file mode 100644
index 0000000000..677a1b6337
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlintegration.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QEGLFSVIVINTEGRATION_H
+#define QEGLFSVIVINTEGRATION_H
+
+#include "qeglfsdeviceintegration.h"
+struct wl_display;
+
+QT_BEGIN_NAMESPACE
+
+class QEglFSVivWaylandIntegration : public QEGLDeviceIntegration
+{
+public:
+ void platformInit() Q_DECL_OVERRIDE;
+ QSize screenSize() const Q_DECL_OVERRIDE;
+ EGLNativeWindowType createNativeWindow(QPlatformWindow *window, const QSize &size, const QSurfaceFormat &format) Q_DECL_OVERRIDE;
+ void destroyNativeWindow(EGLNativeWindowType window) Q_DECL_OVERRIDE;
+ EGLNativeDisplayType platformDisplay() const Q_DECL_OVERRIDE;
+
+ void *wlDisplay() const Q_DECL_OVERRIDE;
+private:
+ QSize mScreenSize;
+ EGLNativeDisplayType mNativeDisplay;
+ wl_display *mWaylandDisplay;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlmain.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlmain.cpp
new file mode 100644
index 0000000000..a48aa08e40
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/qeglfsvivwlmain.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "qeglfsdeviceintegration.h"
+#include "qeglfsvivwlintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+class QEglFSVivWaylandIntegrationPlugin : public QEGLDeviceIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QEGLDeviceIntegrationFactoryInterface_iid FILE "eglfs_viv_wl.json")
+
+public:
+ QEGLDeviceIntegration *create() Q_DECL_OVERRIDE { return new QEglFSVivWaylandIntegration; }
+};
+
+QT_END_NAMESPACE
+
+#include "qeglfsvivwlmain.moc"
diff --git a/src/plugins/platforms/eglfs/eglfs_device_lib.pro b/src/plugins/platforms/eglfs/eglfs_device_lib.pro
index 729290706d..4fe2ce4897 100644
--- a/src/plugins/platforms/eglfs/eglfs_device_lib.pro
+++ b/src/plugins/platforms/eglfs/eglfs_device_lib.pro
@@ -6,13 +6,6 @@
TARGET = QtEglDeviceIntegration
CONFIG += no_module_headers internal_module
-MODULE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE \
- \$\$QT_MODULE_INCLUDE_BASE/QtQGui
-MODULE_PRIVATE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE/QtGui/$$QT.gui.VERSION \
- \$\$QT_MODULE_INCLUDE_BASE/QtGui/$$QT.gui.VERSION/QtGui
-
load(qt_module)
QT += core-private gui-private platformsupport-private
@@ -26,6 +19,7 @@ DEFINES += QT_BUILD_EGL_DEVICE_LIB
SOURCES += $$PWD/qeglfsintegration.cpp \
$$PWD/qeglfswindow.cpp \
$$PWD/qeglfsscreen.cpp \
+ $$PWD/qeglfscursor.cpp \
$$PWD/qeglfshooks.cpp \
$$PWD/qeglfscontext.cpp \
$$PWD/qeglfsoffscreenwindow.cpp \
@@ -34,6 +28,7 @@ SOURCES += $$PWD/qeglfsintegration.cpp \
HEADERS += $$PWD/qeglfsintegration.h \
$$PWD/qeglfswindow.h \
$$PWD/qeglfsscreen.h \
+ $$PWD/qeglfscursor.h \
$$PWD/qeglfshooks.h \
$$PWD/qeglfscontext.h \
$$PWD/qeglfsoffscreenwindow.h \
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.cpp b/src/plugins/platforms/eglfs/qeglfscontext.cpp
index 9216b7a85d..6fcdae7ad2 100644
--- a/src/plugins/platforms/eglfs/qeglfscontext.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscontext.cpp
@@ -32,21 +32,20 @@
****************************************************************************/
#include <QtGui/QSurface>
-#include <QtDebug>
-
-#include <QtPlatformSupport/private/qeglplatformcursor_p.h>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
+#include "qeglfscontext.h"
#include "qeglfswindow.h"
#include "qeglfshooks.h"
-#include "qeglfscontext.h"
+#include "qeglfscursor.h"
QT_BEGIN_NAMESPACE
QEglFSContext::QEglFSContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
EGLConfig *config, const QVariant &nativeHandle)
- : QEGLPlatformContext(format, share, display, config, nativeHandle),
+ : QEGLPlatformContext(format, share, display, config, nativeHandle,
+ qt_egl_device_integration()->supportsSurfacelessContexts() ? Flags(0) : QEGLPlatformContext::NoSurfaceless),
m_tempWindow(0)
{
}
@@ -91,7 +90,7 @@ void QEglFSContext::swapBuffers(QPlatformSurface *surface)
// draw the cursor
if (surface->surface()->surfaceClass() == QSurface::Window) {
QPlatformWindow *window = static_cast<QPlatformWindow *>(surface);
- if (QEGLPlatformCursor *cursor = qobject_cast<QEGLPlatformCursor *>(window->screen()->cursor()))
+ if (QEglFSCursor *cursor = qobject_cast<QEglFSCursor *>(window->screen()->cursor()))
cursor->paintOnScreen();
}
diff --git a/src/plugins/platforms/eglfs/qeglfscursor.cpp b/src/plugins/platforms/eglfs/qeglfscursor.cpp
new file mode 100644
index 0000000000..eea130a754
--- /dev/null
+++ b/src/plugins/platforms/eglfs/qeglfscursor.cpp
@@ -0,0 +1,502 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 "qeglfscursor.h"
+#include "qeglfsintegration.h"
+#include "qeglfsscreen.h"
+
+#include <qpa/qwindowsysteminterface.h>
+#include <QtGui/QOpenGLContext>
+#include <QtGui/QOpenGLShaderProgram>
+#include <QtCore/QJsonDocument>
+#include <QtCore/QJsonArray>
+#include <QtCore/QJsonObject>
+
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qopenglvertexarrayobject_p.h>
+
+#ifndef GL_VERTEX_ARRAY_BINDING
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#endif
+
+QT_BEGIN_NAMESPACE
+
+QEglFSCursor::QEglFSCursor(QPlatformScreen *screen)
+ : m_visible(true),
+ m_screen(static_cast<QEglFSScreen *>(screen)),
+ m_program(0),
+ m_textureEntry(0),
+ m_deviceListener(0),
+ m_updateRequested(false)
+{
+ QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR");
+ if (!hideCursorVal.isEmpty())
+ m_visible = hideCursorVal.toInt() == 0;
+ if (!m_visible)
+ return;
+
+ // Try to load the cursor atlas. If this fails, m_visible is set to false and
+ // paintOnScreen() and setCurrentCursor() become no-ops.
+ initCursorAtlas();
+
+ // initialize the cursor
+#ifndef QT_NO_CURSOR
+ QCursor cursor(Qt::ArrowCursor);
+ setCurrentCursor(&cursor);
+#endif
+
+ m_deviceListener = new QEglFSCursorDeviceListener(this);
+ connect(QGuiApplicationPrivate::inputDeviceManager(), &QInputDeviceManager::deviceListChanged,
+ m_deviceListener, &QEglFSCursorDeviceListener::onDeviceListChanged);
+ updateMouseStatus();
+}
+
+QEglFSCursor::~QEglFSCursor()
+{
+ resetResources();
+ delete m_deviceListener;
+}
+
+void QEglFSCursor::updateMouseStatus()
+{
+ m_visible = m_deviceListener->hasMouse();
+}
+
+bool QEglFSCursorDeviceListener::hasMouse() const
+{
+ return QGuiApplicationPrivate::inputDeviceManager()->deviceCount(QInputDeviceManager::DeviceTypePointer) > 0;
+}
+
+void QEglFSCursorDeviceListener::onDeviceListChanged(QInputDeviceManager::DeviceType type)
+{
+ if (type == QInputDeviceManager::DeviceTypePointer)
+ m_cursor->updateMouseStatus();
+}
+
+void QEglFSCursor::resetResources()
+{
+ if (QOpenGLContext::currentContext()) {
+ delete m_program;
+ glDeleteTextures(1, &m_cursor.customCursorTexture);
+ glDeleteTextures(1, &m_cursorAtlas.texture);
+ }
+ m_program = 0;
+ m_cursor.customCursorTexture = 0;
+ m_cursor.customCursorPending = !m_cursor.customCursorImage.isNull();
+ m_cursorAtlas.texture = 0;
+}
+
+void QEglFSCursor::createShaderPrograms()
+{
+ static const char *textureVertexProgram =
+ "attribute highp vec2 vertexCoordEntry;\n"
+ "attribute highp vec2 textureCoordEntry;\n"
+ "varying highp vec2 textureCoord;\n"
+ "void main() {\n"
+ " textureCoord = textureCoordEntry;\n"
+ " gl_Position = vec4(vertexCoordEntry, 1.0, 1.0);\n"
+ "}\n";
+
+ static const char *textureFragmentProgram =
+ "uniform sampler2D texture;\n"
+ "varying highp vec2 textureCoord;\n"
+ "void main() {\n"
+ " gl_FragColor = texture2D(texture, textureCoord).bgra;\n"
+ "}\n";
+
+ m_program = new QOpenGLShaderProgram;
+ m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
+ m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
+ m_program->bindAttributeLocation("vertexCoordEntry", 0);
+ m_program->bindAttributeLocation("textureCoordEntry", 1);
+ m_program->link();
+
+ m_textureEntry = m_program->uniformLocation("texture");
+}
+
+void QEglFSCursor::createCursorTexture(uint *texture, const QImage &image)
+{
+ if (!*texture)
+ glGenTextures(1, texture);
+ glBindTexture(GL_TEXTURE_2D, *texture);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+ glTexImage2D(GL_TEXTURE_2D, 0 /* level */, GL_RGBA, image.width(), image.height(), 0 /* border */,
+ GL_RGBA, GL_UNSIGNED_BYTE, image.constBits());
+}
+
+void QEglFSCursor::initCursorAtlas()
+{
+ static QByteArray json = qgetenv("QT_QPA_EGLFS_CURSOR");
+ if (json.isEmpty())
+ json = ":/cursor.json";
+
+ QFile file(QString::fromUtf8(json));
+ if (!file.open(QFile::ReadOnly)) {
+ m_visible = false;
+ return;
+ }
+
+ QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
+ QJsonObject object = doc.object();
+
+ QString atlas = object.value(QLatin1String("image")).toString();
+ Q_ASSERT(!atlas.isEmpty());
+
+ const int cursorsPerRow = object.value(QLatin1String("cursorsPerRow")).toDouble();
+ Q_ASSERT(cursorsPerRow);
+ m_cursorAtlas.cursorsPerRow = cursorsPerRow;
+
+ const QJsonArray hotSpots = object.value(QLatin1String("hotSpots")).toArray();
+ Q_ASSERT(hotSpots.count() == Qt::LastCursor + 1);
+ for (int i = 0; i < hotSpots.count(); i++) {
+ QPoint hotSpot(hotSpots[i].toArray()[0].toDouble(), hotSpots[i].toArray()[1].toDouble());
+ m_cursorAtlas.hotSpots << hotSpot;
+ }
+
+ QImage image = QImage(atlas).convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ m_cursorAtlas.cursorWidth = image.width() / m_cursorAtlas.cursorsPerRow;
+ m_cursorAtlas.cursorHeight = image.height() / ((Qt::LastCursor + cursorsPerRow) / cursorsPerRow);
+ m_cursorAtlas.width = image.width();
+ m_cursorAtlas.height = image.height();
+ m_cursorAtlas.image = image;
+}
+
+#ifndef QT_NO_CURSOR
+void QEglFSCursor::changeCursor(QCursor *cursor, QWindow *window)
+{
+ Q_UNUSED(window);
+ const QRect oldCursorRect = cursorRect();
+ if (setCurrentCursor(cursor))
+ update(oldCursorRect | cursorRect());
+}
+
+bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
+{
+ if (!m_visible)
+ return false;
+
+ const Qt::CursorShape newShape = cursor ? cursor->shape() : Qt::ArrowCursor;
+ if (m_cursor.shape == newShape && newShape != Qt::BitmapCursor)
+ return false;
+
+ if (m_cursor.shape == Qt::BitmapCursor) {
+ m_cursor.customCursorImage = QImage();
+ m_cursor.customCursorPending = false;
+ }
+ m_cursor.shape = newShape;
+ if (newShape != Qt::BitmapCursor) { // standard cursor
+ const float ws = (float)m_cursorAtlas.cursorWidth / m_cursorAtlas.width,
+ hs = (float)m_cursorAtlas.cursorHeight / m_cursorAtlas.height;
+ m_cursor.textureRect = QRectF(ws * (m_cursor.shape % m_cursorAtlas.cursorsPerRow),
+ hs * (m_cursor.shape / m_cursorAtlas.cursorsPerRow),
+ ws, hs);
+ m_cursor.hotSpot = m_cursorAtlas.hotSpots[m_cursor.shape];
+ m_cursor.texture = m_cursorAtlas.texture;
+ m_cursor.size = QSize(m_cursorAtlas.cursorWidth, m_cursorAtlas.cursorHeight);
+ } else {
+ QImage image = cursor->pixmap().toImage();
+ m_cursor.textureRect = QRectF(0, 0, 1, 1);
+ m_cursor.hotSpot = cursor->hotSpot();
+ m_cursor.texture = 0; // will get updated in the next render()
+ m_cursor.size = image.size();
+ m_cursor.customCursorImage = image;
+ m_cursor.customCursorPending = true;
+ }
+
+ return true;
+}
+#endif
+
+class CursorUpdateEvent : public QEvent
+{
+public:
+ CursorUpdateEvent(const QPoint &pos, const QRegion &rgn)
+ : QEvent(QEvent::Type(QEvent::User + 1)),
+ m_pos(pos),
+ m_region(rgn)
+ { }
+ QPoint pos() const { return m_pos; }
+ QRegion region() const { return m_region; }
+
+private:
+ QPoint m_pos;
+ QRegion m_region;
+};
+
+bool QEglFSCursor::event(QEvent *e)
+{
+ if (e->type() == QEvent::User + 1) {
+ CursorUpdateEvent *ev = static_cast<CursorUpdateEvent *>(e);
+ m_updateRequested = false;
+ QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(ev->pos()), ev->region());
+ QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
+ return true;
+ }
+ return QPlatformCursor::event(e);
+}
+
+void QEglFSCursor::update(const QRegion &rgn)
+{
+ if (!m_updateRequested) {
+ // Must not flush the window system events directly from here since we are likely to
+ // be a called directly from QGuiApplication's processMouseEvents. Flushing events
+ // could cause reentering by dispatching more queued mouse events.
+ m_updateRequested = true;
+ QCoreApplication::postEvent(this, new CursorUpdateEvent(m_cursor.pos, rgn));
+ }
+}
+
+QRect QEglFSCursor::cursorRect() const
+{
+ return QRect(m_cursor.pos - m_cursor.hotSpot, m_cursor.size);
+}
+
+QPoint QEglFSCursor::pos() const
+{
+ return m_cursor.pos;
+}
+
+void QEglFSCursor::setPos(const QPoint &pos)
+{
+ QGuiApplicationPrivate::inputDeviceManager()->setCursorPos(pos);
+ const QRect oldCursorRect = cursorRect();
+ m_cursor.pos = pos;
+ update(oldCursorRect | cursorRect());
+ m_screen->handleCursorMove(m_cursor.pos);
+}
+
+void QEglFSCursor::pointerEvent(const QMouseEvent &event)
+{
+ if (event.type() != QEvent::MouseMove)
+ return;
+ const QRect oldCursorRect = cursorRect();
+ m_cursor.pos = event.screenPos().toPoint();
+ update(oldCursorRect | cursorRect());
+ m_screen->handleCursorMove(m_cursor.pos);
+}
+
+void QEglFSCursor::paintOnScreen()
+{
+ if (!m_visible)
+ return;
+
+ const QRectF cr = cursorRect();
+ const QRect screenRect(m_screen->geometry());
+ const GLfloat x1 = 2 * (cr.left() / screenRect.width()) - 1;
+ const GLfloat x2 = 2 * (cr.right() / screenRect.width()) - 1;
+ const GLfloat y1 = 1 - (cr.top() / screenRect.height()) * 2;
+ const GLfloat y2 = 1 - (cr.bottom() / screenRect.height()) * 2;
+ QRectF r(QPointF(x1, y1), QPointF(x2, y2));
+
+ draw(r);
+}
+
+// In order to prevent breaking code doing custom OpenGL rendering while
+// expecting the state in the context unchanged, save and restore all the state
+// we touch. The exception is Qt Quick where the scenegraph is known to be able
+// to deal with the changes we make.
+struct StateSaver
+{
+ StateSaver() {
+ f = QOpenGLContext::currentContext()->functions();
+ vaoHelper = new QOpenGLVertexArrayObjectHelper(QOpenGLContext::currentContext());
+
+ static bool windowsChecked = false;
+ static bool shouldSave = true;
+ if (!windowsChecked) {
+ windowsChecked = true;
+ QWindowList windows = QGuiApplication::allWindows();
+ if (!windows.isEmpty() && windows[0]->inherits("QQuickWindow"))
+ shouldSave = false;
+ }
+ saved = shouldSave;
+ if (!shouldSave)
+ return;
+
+ f->glGetIntegerv(GL_CURRENT_PROGRAM, &program);
+ f->glGetIntegerv(GL_TEXTURE_BINDING_2D, &texture);
+ f->glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTexture);
+ f->glGetIntegerv(GL_FRONT_FACE, &frontFace);
+ cull = f->glIsEnabled(GL_CULL_FACE);
+ depthTest = f->glIsEnabled(GL_DEPTH_TEST);
+ blend = f->glIsEnabled(GL_BLEND);
+ f->glGetIntegerv(GL_BLEND_SRC_RGB, blendFunc);
+ f->glGetIntegerv(GL_BLEND_SRC_ALPHA, blendFunc + 1);
+ f->glGetIntegerv(GL_BLEND_DST_RGB, blendFunc + 2);
+ f->glGetIntegerv(GL_BLEND_DST_ALPHA, blendFunc + 3);
+ f->glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &arrayBuf);
+ if (vaoHelper->isValid())
+ f->glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &vao);
+ for (int i = 0; i < 2; ++i) {
+ f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &va[i].enabled);
+ f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_SIZE, &va[i].size);
+ f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_TYPE, &va[i].type);
+ f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &va[i].normalized);
+ f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &va[i].stride);
+ f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &va[i].buffer);
+ f->glGetVertexAttribPointerv(i, GL_VERTEX_ATTRIB_ARRAY_POINTER, &va[i].pointer);
+ }
+ }
+ ~StateSaver() {
+ if (saved) {
+ f->glUseProgram(program);
+ f->glBindTexture(GL_TEXTURE_2D, texture);
+ f->glActiveTexture(activeTexture);
+ f->glFrontFace(frontFace);
+ if (cull)
+ f->glEnable(GL_CULL_FACE);
+ else
+ f->glDisable(GL_CULL_FACE);
+ if (depthTest)
+ f->glEnable(GL_DEPTH_TEST);
+ else
+ f->glDisable(GL_DEPTH_TEST);
+ if (blend)
+ f->glEnable(GL_BLEND);
+ else
+ f->glDisable(GL_BLEND);
+ f->glBlendFuncSeparate(blendFunc[0], blendFunc[1], blendFunc[2], blendFunc[3]);
+ f->glBindBuffer(GL_ARRAY_BUFFER, arrayBuf);
+ if (vaoHelper->isValid())
+ vaoHelper->glBindVertexArray(vao);
+ for (int i = 0; i < 2; ++i) {
+ if (va[i].enabled)
+ f->glEnableVertexAttribArray(i);
+ else
+ f->glDisableVertexAttribArray(i);
+ f->glBindBuffer(GL_ARRAY_BUFFER, va[i].buffer);
+ f->glVertexAttribPointer(i, va[i].size, va[i].type, va[i].normalized, va[i].stride, va[i].pointer);
+ }
+ }
+ delete vaoHelper;
+ }
+ QOpenGLFunctions *f;
+ QOpenGLVertexArrayObjectHelper *vaoHelper;
+ bool saved;
+ GLint program;
+ GLint texture;
+ GLint activeTexture;
+ GLint frontFace;
+ bool cull;
+ bool depthTest;
+ bool blend;
+ GLint blendFunc[4];
+ GLint vao;
+ GLint arrayBuf;
+ struct { GLint enabled, type, size, normalized, stride, buffer; GLvoid *pointer; } va[2];
+};
+
+void QEglFSCursor::draw(const QRectF &r)
+{
+ StateSaver stateSaver;
+
+ if (!m_program) {
+ // one time initialization
+ initializeOpenGLFunctions();
+
+ createShaderPrograms();
+
+ if (!m_cursorAtlas.texture) {
+ createCursorTexture(&m_cursorAtlas.texture, m_cursorAtlas.image);
+
+ if (m_cursor.shape != Qt::BitmapCursor)
+ m_cursor.texture = m_cursorAtlas.texture;
+ }
+ }
+
+ if (m_cursor.shape == Qt::BitmapCursor && m_cursor.customCursorPending) {
+ // upload the custom cursor
+ createCursorTexture(&m_cursor.customCursorTexture, m_cursor.customCursorImage);
+ m_cursor.texture = m_cursor.customCursorTexture;
+ m_cursor.customCursorPending = false;
+ }
+
+ Q_ASSERT(m_cursor.texture);
+
+ m_program->bind();
+
+ const GLfloat x1 = r.left();
+ const GLfloat x2 = r.right();
+ const GLfloat y1 = r.top();
+ const GLfloat y2 = r.bottom();
+ const GLfloat cursorCoordinates[] = {
+ x1, y2,
+ x2, y2,
+ x1, y1,
+ x2, y1
+ };
+
+ const GLfloat s1 = m_cursor.textureRect.left();
+ const GLfloat s2 = m_cursor.textureRect.right();
+ const GLfloat t1 = m_cursor.textureRect.top();
+ const GLfloat t2 = m_cursor.textureRect.bottom();
+ const GLfloat textureCoordinates[] = {
+ s1, t2,
+ s2, t2,
+ s1, t1,
+ s2, t1
+ };
+
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, m_cursor.texture);
+
+ if (stateSaver.vaoHelper->isValid())
+ stateSaver.vaoHelper->glBindVertexArray(0);
+
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ m_program->enableAttributeArray(0);
+ m_program->enableAttributeArray(1);
+ m_program->setAttributeArray(0, cursorCoordinates, 2);
+ m_program->setAttributeArray(1, textureCoordinates, 2);
+
+ m_program->setUniformValue(m_textureEntry, 0);
+
+ glDisable(GL_CULL_FACE);
+ glFrontFace(GL_CCW);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable(GL_DEPTH_TEST); // disable depth testing to make sure cursor is always on top
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ m_program->disableAttributeArray(0);
+ m_program->disableAttributeArray(1);
+ m_program->release();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfscursor.h b/src/plugins/platforms/eglfs/qeglfscursor.h
new file mode 100644
index 0000000000..be5db41b37
--- /dev/null
+++ b/src/plugins/platforms/eglfs/qeglfscursor.h
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 QEGLFSCURSOR_H
+#define QEGLFSCURSOR_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 "qeglfsglobal.h"
+#include <qpa/qplatformcursor.h>
+#include <qpa/qplatformscreen.h>
+#include <QtGui/QOpenGLFunctions>
+#include <QtGui/private/qinputdevicemanager_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLShaderProgram;
+class QEglFSCursor;
+class QEglFSScreen;
+
+class QEglFSCursorDeviceListener : public QObject
+{
+ Q_OBJECT
+
+public:
+ QEglFSCursorDeviceListener(QEglFSCursor *cursor) : m_cursor(cursor) { }
+ bool hasMouse() const;
+
+public slots:
+ void onDeviceListChanged(QInputDeviceManager::DeviceType type);
+
+private:
+ QEglFSCursor *m_cursor;
+};
+
+class Q_EGLFS_EXPORT QEglFSCursor : public QPlatformCursor, protected QOpenGLFunctions
+{
+ Q_OBJECT
+public:
+ QEglFSCursor(QPlatformScreen *screen);
+ ~QEglFSCursor();
+
+#ifndef QT_NO_CURSOR
+ void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE;
+#endif
+ void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE;
+ QPoint pos() const Q_DECL_OVERRIDE;
+ void setPos(const QPoint &pos) Q_DECL_OVERRIDE;
+
+ QRect cursorRect() const;
+ void paintOnScreen();
+ void resetResources();
+
+ void updateMouseStatus();
+
+private:
+ bool event(QEvent *e) Q_DECL_OVERRIDE;
+#ifndef QT_NO_CURSOR
+ bool setCurrentCursor(QCursor *cursor);
+#endif
+ void draw(const QRectF &rect);
+ void update(const QRegion &region);
+ void createShaderPrograms();
+ void createCursorTexture(uint *texture, const QImage &image);
+ void initCursorAtlas();
+
+ // current cursor information
+ struct Cursor {
+ Cursor() : texture(0), shape(Qt::BlankCursor), customCursorTexture(0), customCursorPending(false) { }
+ uint texture; // a texture from 'image' or the atlas
+ Qt::CursorShape shape;
+ QRectF textureRect; // normalized rect inside texture
+ QSize size; // size of the cursor
+ QPoint hotSpot;
+ QImage customCursorImage;
+ QPoint pos; // current cursor position
+ uint customCursorTexture;
+ bool customCursorPending;
+ } m_cursor;
+
+ // cursor atlas information
+ struct CursorAtlas {
+ CursorAtlas() : cursorsPerRow(0), texture(0), cursorWidth(0), cursorHeight(0) { }
+ int cursorsPerRow;
+ uint texture;
+ int width, height; // width and height of the atlas
+ int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
+ QList<QPoint> hotSpots;
+ QImage image; // valid until it's uploaded
+ } m_cursorAtlas;
+
+ bool m_visible;
+ QEglFSScreen *m_screen;
+ QOpenGLShaderProgram *m_program;
+ int m_textureEntry;
+ QEglFSCursorDeviceListener *m_deviceListener;
+ bool m_updateRequested;
+};
+
+QT_END_NAMESPACE
+
+#endif // QEGLFSCURSOR_H
diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
index 359b90f205..1fb6020d69 100644
--- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
@@ -33,8 +33,9 @@
#include "qeglfsdeviceintegration.h"
#include "qeglfsintegration.h"
+#include "qeglfscursor.h"
+#include "qeglfswindow.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
-#include <QtPlatformSupport/private/qeglplatformcursor_p.h>
#include <QGuiApplication>
#include <private/qguiapplication_p.h>
#include <QScreen>
@@ -99,6 +100,7 @@ QStringList QEGLDeviceIntegrationFactory::keys(const QString &pluginPath)
qCDebug(qLcEglDevDebug) << "EGL device integration plugin keys:" << list;
return list;
#else
+ Q_UNUSED(pluginPath);
return QStringList();
#endif
}
@@ -117,6 +119,9 @@ QEGLDeviceIntegration *QEGLDeviceIntegrationFactory::create(const QString &key,
qCDebug(qLcEglDevDebug) << "Using EGL device integration" << key;
else
qCWarning(qLcEglDevDebug) << "Failed to load EGL device integration" << key;
+#else
+ Q_UNUSED(key);
+ Q_UNUSED(pluginPath);
#endif
return integration;
}
@@ -171,6 +176,11 @@ EGLNativeDisplayType QEGLDeviceIntegration::platformDisplay() const
return EGL_DEFAULT_DISPLAY;
}
+EGLDisplay QEGLDeviceIntegration::createDisplay(EGLNativeDisplayType nativeDisplay)
+{
+ return eglGetDisplay(nativeDisplay);
+}
+
bool QEGLDeviceIntegration::usesDefaultScreen()
{
return true;
@@ -202,11 +212,19 @@ QSize QEGLDeviceIntegration::screenSize() const
QDpi QEGLDeviceIntegration::logicalDpi() const
{
- QSizeF ps = physicalScreenSize();
- QSize s = screenSize();
+ const QSizeF ps = physicalScreenSize();
+ const QSize s = screenSize();
- return QDpi(25.4 * s.width() / ps.width(),
- 25.4 * s.height() / ps.height());
+ if (!ps.isEmpty() && !s.isEmpty())
+ return QDpi(25.4 * s.width() / ps.width(),
+ 25.4 * s.height() / ps.height());
+ else
+ return QDpi(100, 100);
+}
+
+qreal QEGLDeviceIntegration::pixelDensity() const
+{
+ return qRound(logicalDpi().first / qreal(100));
}
Qt::ScreenOrientation QEGLDeviceIntegration::nativeOrientation() const
@@ -234,6 +252,11 @@ qreal QEGLDeviceIntegration::refreshRate() const
return q_refreshRateFromFb(framebuffer);
}
+EGLint QEGLDeviceIntegration::surfaceType() const
+{
+ return EGL_WINDOW_BIT;
+}
+
QSurfaceFormat QEGLDeviceIntegration::surfaceFormatFor(const QSurfaceFormat &inputFormat) const
{
QSurfaceFormat format = inputFormat;
@@ -253,6 +276,11 @@ bool QEGLDeviceIntegration::filterConfig(EGLDisplay, EGLConfig) const
return true;
}
+QEglFSWindow *QEGLDeviceIntegration::createWindow(QWindow *window) const
+{
+ return new QEglFSWindow(window);
+}
+
EGLNativeWindowType QEGLDeviceIntegration::createNativeWindow(QPlatformWindow *platformWindow,
const QSize &size,
const QSurfaceFormat &format)
@@ -282,7 +310,7 @@ bool QEGLDeviceIntegration::hasCapability(QPlatformIntegration::Capability cap)
QPlatformCursor *QEGLDeviceIntegration::createCursor(QPlatformScreen *screen) const
{
- return new QEGLPlatformCursor(screen);
+ return new QEglFSCursor(screen);
}
void QEGLDeviceIntegration::waitForVSync(QPlatformSurface *surface) const
@@ -309,4 +337,14 @@ bool QEGLDeviceIntegration::supportsPBuffers() const
return true;
}
+bool QEGLDeviceIntegration::supportsSurfacelessContexts() const
+{
+ return true;
+}
+
+void *QEGLDeviceIntegration::wlDisplay() const
+{
+ return Q_NULLPTR;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h
index 260fc313f7..5ec98b37d1 100644
--- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h
+++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h
@@ -56,6 +56,7 @@
QT_BEGIN_NAMESPACE
class QPlatformSurface;
+class QEglFSWindow;
#define QEGLDeviceIntegrationFactoryInterface_iid "org.qt-project.qt.qpa.egl.QEGLDeviceIntegrationFactoryInterface.5.5"
@@ -67,18 +68,22 @@ public:
virtual void platformInit();
virtual void platformDestroy();
virtual EGLNativeDisplayType platformDisplay() const;
+ virtual EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay);
virtual bool usesDefaultScreen();
virtual void screenInit();
virtual void screenDestroy();
virtual QSizeF physicalScreenSize() const;
virtual QSize screenSize() const;
virtual QDpi logicalDpi() const;
+ virtual qreal pixelDensity() const;
virtual Qt::ScreenOrientation nativeOrientation() const;
virtual Qt::ScreenOrientation orientation() const;
virtual int screenDepth() const;
virtual QImage::Format screenFormat() const;
virtual qreal refreshRate() const;
virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const;
+ virtual EGLint surfaceType() const;
+ virtual QEglFSWindow *createWindow(QWindow *window) const;
virtual EGLNativeWindowType createNativeWindow(QPlatformWindow *platformWindow,
const QSize &size,
const QSurfaceFormat &format);
@@ -92,6 +97,9 @@ public:
virtual QByteArray fbDeviceName() const;
virtual int framebufferIndex() const;
virtual bool supportsPBuffers() const;
+ virtual bool supportsSurfacelessContexts() const;
+
+ virtual void *wlDisplay() const;
};
class Q_EGLFS_EXPORT QEGLDeviceIntegrationPlugin : public QObject
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 5eb8485dc7..2086ce56e2 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -39,19 +39,46 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
#include <QtGui/QOffscreenSurface>
-#include <qpa/qplatformcursor.h>
+#include <QtGui/QWindow>
+#include <QtCore/QLoggingCategory>
+#include <qpa/qwindowsysteminterface.h>
+#include <qpa/qplatforminputcontextfactory_p.h>
#include "qeglfsintegration.h"
#include "qeglfswindow.h"
#include "qeglfshooks.h"
#include "qeglfscontext.h"
#include "qeglfsoffscreenwindow.h"
+#include "qeglfscursor.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
+
+#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
+#include <QtPlatformSupport/private/qgenericunixservices_p.h>
+#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+#include <QtPlatformSupport/private/qfbvthandler_p.h>
+#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h>
+
#include <QtPlatformHeaders/QEGLNativeContext>
+#ifndef QT_NO_LIBINPUT
+#include <QtPlatformSupport/private/qlibinputhandler_p.h>
+#endif
+
+#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
+#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
+#include <QtPlatformSupport/private/qevdevtouchmanager_p.h>
+#endif
+
+#if !defined(QT_NO_TSLIB) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+#include <QtPlatformSupport/private/qtslib_p.h>
+#endif
+
+#include <QtPlatformHeaders/qeglfsfunctions.h>
+
#include <EGL/egl.h>
static void initResources()
@@ -64,21 +91,18 @@ static void initResources()
QT_BEGIN_NAMESPACE
QEglFSIntegration::QEglFSIntegration()
+ : m_display(EGL_NO_DISPLAY),
+ m_inputContext(0),
+ m_fontDb(new QGenericUnixFontDatabase),
+ m_services(new QGenericUnixServices),
+ m_kbdMgr(0),
+ m_disableInputHandlers(false)
{
- mDisableInputHandlers = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DISABLE_INPUT");
+ m_disableInputHandlers = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DISABLE_INPUT");
initResources();
}
-bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const
-{
- // We assume that devices will have more and not less capabilities
- if (qt_egl_device_integration()->hasCapability(cap))
- return true;
-
- return QEGLPlatformIntegration::hasCapability(cap);
-}
-
void QEglFSIntegration::addScreen(QPlatformScreen *screen)
{
screenAdded(screen);
@@ -93,65 +117,316 @@ void QEglFSIntegration::initialize()
{
qt_egl_device_integration()->platformInit();
- QEGLPlatformIntegration::initialize();
+ m_display = qt_egl_device_integration()->createDisplay(nativeDisplay());
+ if (m_display == EGL_NO_DISPLAY)
+ qFatal("Could not open egl display");
- if (!mDisableInputHandlers)
- createInputHandlers();
+ EGLint major, minor;
+ if (!eglInitialize(m_display, &major, &minor))
+ qFatal("Could not initialize egl display");
+
+ m_inputContext = QPlatformInputContextFactory::create();
+
+ m_vtHandler.reset(new QFbVtHandler);
if (qt_egl_device_integration()->usesDefaultScreen())
addScreen(new QEglFSScreen(display()));
else
qt_egl_device_integration()->screenInit();
+
+ // Input code may rely on the screens, so do it only after the screen init.
+ if (!m_disableInputHandlers)
+ createInputHandlers();
}
void QEglFSIntegration::destroy()
{
foreach (QWindow *w, qGuiApp->topLevelWindows())
w->destroy();
+
qt_egl_device_integration()->screenDestroy();
- if (display() != EGL_NO_DISPLAY)
- eglTerminate(display());
+
+ if (m_display != EGL_NO_DISPLAY)
+ eglTerminate(m_display);
+
qt_egl_device_integration()->platformDestroy();
}
-EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const
+QAbstractEventDispatcher *QEglFSIntegration::createEventDispatcher() const
{
- return qt_egl_device_integration()->platformDisplay();
+ return createUnixEventDispatcher();
}
-QEGLPlatformWindow *QEglFSIntegration::createWindow(QWindow *window) const
+QPlatformServices *QEglFSIntegration::services() const
{
- return new QEglFSWindow(window);
+ return m_services.data();
}
-QEGLPlatformContext *QEglFSIntegration::createContext(const QSurfaceFormat &format,
- QPlatformOpenGLContext *shareContext,
- EGLDisplay display,
- QVariant *nativeHandle) const
+QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const
{
+ return m_fontDb.data();
+}
+
+QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const
+{
+ QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window);
+ if (!window->handle())
+ window->create();
+ static_cast<QEglFSWindow *>(window->handle())->setBackingStore(bs);
+ return bs;
+}
+
+QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const
+{
+ QWindowSystemInterface::flushWindowSystemEvents();
+ QEglFSWindow *w = qt_egl_device_integration()->createWindow(window);
+ w->create();
+ if (window->type() != Qt::ToolTip)
+ w->requestActivateWindow();
+ return w;
+}
+
+QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
+{
+ // If there is a "root" window into which raster and QOpenGLWidget content is
+ // composited, all other contexts must share with its context.
+ QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context();
+ EGLDisplay dpy = context->screen() ? static_cast<QEglFSScreen *>(context->screen()->handle())->display() : display();
+ QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
+ QVariant nativeHandle = context->nativeHandle();
+
QEglFSContext *ctx;
- QSurfaceFormat adjustedFormat = qt_egl_device_integration()->surfaceFormatFor(format);
- if (!nativeHandle || nativeHandle->isNull()) {
- EGLConfig config = QEglFSIntegration::chooseConfig(display, adjustedFormat);
- ctx = new QEglFSContext(adjustedFormat, shareContext, display, &config, QVariant());
+ QSurfaceFormat adjustedFormat = qt_egl_device_integration()->surfaceFormatFor(context->format());
+ if (nativeHandle.isNull()) {
+ EGLConfig config = QEglFSIntegration::chooseConfig(dpy, adjustedFormat);
+ ctx = new QEglFSContext(adjustedFormat, share, dpy, &config, QVariant());
} else {
- ctx = new QEglFSContext(adjustedFormat, shareContext, display, 0, *nativeHandle);
+ ctx = new QEglFSContext(adjustedFormat, share, dpy, 0, nativeHandle);
}
- *nativeHandle = QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), display));
+ nativeHandle = QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), dpy));
+
+ context->setNativeHandle(nativeHandle);
return ctx;
}
-QPlatformOffscreenSurface *QEglFSIntegration::createOffscreenSurface(EGLDisplay display,
- const QSurfaceFormat &format,
- QOffscreenSurface *surface) const
+QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
+{
+ EGLDisplay dpy = surface->screen() ? static_cast<QEglFSScreen *>(surface->screen()->handle())->display() : display();
+ QSurfaceFormat fmt = qt_egl_device_integration()->surfaceFormatFor(surface->requestedFormat());
+ if (qt_egl_device_integration()->supportsPBuffers()) {
+ QEGLPlatformContext::Flags flags = 0;
+ if (!qt_egl_device_integration()->supportsSurfacelessContexts())
+ flags |= QEGLPlatformContext::NoSurfaceless;
+ return new QEGLPbuffer(dpy, fmt, surface, flags);
+ } else {
+ return new QEglFSOffscreenWindow(dpy, fmt, surface);
+ }
+ // Never return null. Multiple QWindows are not supported by this plugin.
+}
+
+bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const
+{
+ // We assume that devices will have more and not less capabilities
+ if (qt_egl_device_integration()->hasCapability(cap))
+ return true;
+
+ switch (cap) {
+ case ThreadedPixmaps: return true;
+ case OpenGL: return true;
+ case ThreadedOpenGL: return true;
+ case WindowManagement: return false;
+ case RasterGLSurface: return true;
+ default: return QPlatformIntegration::hasCapability(cap);
+ }
+}
+
+QPlatformNativeInterface *QEglFSIntegration::nativeInterface() const
+{
+ return const_cast<QEglFSIntegration *>(this);
+}
+
+enum ResourceType {
+ EglDisplay,
+ EglWindow,
+ EglContext,
+ EglConfig,
+ NativeDisplay,
+ XlibDisplay,
+ WaylandDisplay
+};
+
+static int resourceType(const QByteArray &key)
{
- QSurfaceFormat fmt = qt_egl_device_integration()->surfaceFormatFor(format);
- if (qt_egl_device_integration()->supportsPBuffers())
- return new QEGLPbuffer(display, fmt, surface);
+ static const QByteArray names[] = { // match ResourceType
+ QByteArrayLiteral("egldisplay"),
+ QByteArrayLiteral("eglwindow"),
+ QByteArrayLiteral("eglcontext"),
+ QByteArrayLiteral("eglconfig"),
+ QByteArrayLiteral("nativedisplay"),
+ QByteArrayLiteral("display"),
+ QByteArrayLiteral("server_wl_display")
+ };
+ const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
+ const QByteArray *result = std::find(names, end, key);
+ if (result == end)
+ result = std::find(names, end, key.toLower());
+ return int(result - names);
+}
+
+void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource)
+{
+ void *result = 0;
+
+ switch (resourceType(resource)) {
+ case EglDisplay:
+ result = display();
+ break;
+ case NativeDisplay:
+ result = reinterpret_cast<void*>(nativeDisplay());
+ break;
+ case WaylandDisplay:
+ result = qt_egl_device_integration()->wlDisplay();
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+
+void *QEglFSIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *)
+{
+ void *result = 0;
+
+ switch (resourceType(resource)) {
+ case XlibDisplay:
+ // Play nice when using the x11 hooks: Be compatible with xcb that allows querying
+ // the X Display pointer, which is nothing but our native display.
+ result = reinterpret_cast<void*>(nativeDisplay());
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+
+void *QEglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
+{
+ void *result = 0;
+
+ switch (resourceType(resource)) {
+ case EglDisplay:
+ if (window && window->handle())
+ result = static_cast<QEglFSScreen *>(window->handle()->screen())->display();
+ else
+ result = display();
+ break;
+ case EglWindow:
+ if (window && window->handle())
+ result = reinterpret_cast<void*>(static_cast<QEglFSWindow *>(window->handle())->eglWindow());
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+
+void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
+{
+ void *result = 0;
+
+ switch (resourceType(resource)) {
+ case EglContext:
+ if (context->handle())
+ result = static_cast<QEglFSContext *>(context->handle())->eglContext();
+ break;
+ case EglConfig:
+ if (context->handle())
+ result = static_cast<QEglFSContext *>(context->handle())->eglConfig();
+ break;
+ case EglDisplay:
+ if (context->handle())
+ result = static_cast<QEglFSContext *>(context->handle())->eglDisplay();
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+
+static void *eglContextForContext(QOpenGLContext *context)
+{
+ Q_ASSERT(context);
+
+ QEglFSContext *handle = static_cast<QEglFSContext *>(context->handle());
+ if (!handle)
+ return 0;
+
+ return handle->eglContext();
+}
+
+QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::nativeResourceFunctionForContext(const QByteArray &resource)
+{
+ QByteArray lowerCaseResource = resource.toLower();
+ if (lowerCaseResource == "get_egl_context")
+ return NativeResourceForContextFunction(eglContextForContext);
+
+ return 0;
+}
+
+QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function) const
+{
+#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+ if (function == QEglFSFunctions::loadKeymapTypeIdentifier())
+ return QFunctionPointer(loadKeymapStatic);
+#else
+ Q_UNUSED(function)
+#endif
+
+ return 0;
+}
+
+void QEglFSIntegration::loadKeymapStatic(const QString &filename)
+{
+#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+ QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ if (self->m_kbdMgr)
+ self->m_kbdMgr->loadKeymap(filename);
else
- return new QEglFSOffscreenWindow(display, fmt, surface);
+ qWarning("QEglFSIntegration: Cannot load keymap, no keyboard handler found");
+#else
+ Q_UNUSED(filename);
+#endif
+}
- // Never return null. Multiple QWindows are not supported by this plugin.
+void QEglFSIntegration::createInputHandlers()
+{
+#ifndef QT_NO_LIBINPUT
+ if (!qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT")) {
+ new QLibInputHandler(QLatin1String("libinput"), QString());
+ return;
+ }
+#endif
+
+#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+ m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
+ new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
+#ifndef QT_NO_TSLIB
+ const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB");
+ if (useTslib)
+ new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */);
+ else
+#endif // QT_NO_TSLIB
+ new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
+#endif
+}
+
+EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const
+{
+ return qt_egl_device_integration()->platformDisplay();
}
EGLConfig QEglFSIntegration::chooseConfig(EGLDisplay display, const QSurfaceFormat &format)
@@ -167,6 +442,7 @@ EGLConfig QEglFSIntegration::chooseConfig(EGLDisplay display, const QSurfaceForm
};
Chooser chooser(display);
+ chooser.setSurfaceType(qt_egl_device_integration()->surfaceType());
chooser.setSurfaceFormat(format);
return chooser.chooseConfig();
}
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h
index 11b643d540..98c7ee9f78 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.h
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.h
@@ -34,41 +34,72 @@
#ifndef QEGLFSINTEGRATION_H
#define QEGLFSINTEGRATION_H
-#include <QtPlatformSupport/private/qeglplatformintegration_p.h>
+#include <QtCore/QVariant>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformscreen.h>
#include <EGL/egl.h>
#include "qeglfsglobal.h"
QT_BEGIN_NAMESPACE
-class Q_EGLFS_EXPORT QEglFSIntegration : public QEGLPlatformIntegration
+class QEglFSWindow;
+class QEglFSContext;
+class QFbVtHandler;
+class QEvdevKeyboardManager;
+
+class Q_EGLFS_EXPORT QEglFSIntegration : public QPlatformIntegration, public QPlatformNativeInterface
{
public:
QEglFSIntegration();
- void addScreen(QPlatformScreen *screen);
- void removeScreen(QPlatformScreen *screen);
-
void initialize() Q_DECL_OVERRIDE;
void destroy() Q_DECL_OVERRIDE;
+ EGLDisplay display() const { return m_display; }
+
+ QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ QPlatformServices *services() const Q_DECL_OVERRIDE;
+ QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
+
+ QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
+ QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
+
bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
- static EGLConfig chooseConfig(EGLDisplay display, const QSurfaceFormat &format);
+ QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
-protected:
- QEGLPlatformWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QEGLPlatformContext *createContext(const QSurfaceFormat &format,
- QPlatformOpenGLContext *shareContext,
- EGLDisplay display,
- QVariant *nativeHandle) const Q_DECL_OVERRIDE;
- QPlatformOffscreenSurface *createOffscreenSurface(EGLDisplay display,
- const QSurfaceFormat &format,
- QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
- EGLNativeDisplayType nativeDisplay() const Q_DECL_OVERRIDE;
+ // QPlatformNativeInterface
+ void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
+ void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE;
+ void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE;
+ void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE;
+ NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE;
+
+ QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
+
+ QFbVtHandler *vtHandler() { return m_vtHandler.data(); }
+
+ void addScreen(QPlatformScreen *screen);
+ void removeScreen(QPlatformScreen *screen);
+
+ static EGLConfig chooseConfig(EGLDisplay display, const QSurfaceFormat &format);
private:
- bool mDisableInputHandlers;
+ EGLNativeDisplayType nativeDisplay() const;
+ void createInputHandlers();
+ static void loadKeymapStatic(const QString &filename);
+
+ EGLDisplay m_display;
+ QPlatformInputContext *m_inputContext;
+ QScopedPointer<QPlatformFontDatabase> m_fontDb;
+ QScopedPointer<QPlatformServices> m_services;
+ QScopedPointer<QFbVtHandler> m_vtHandler;
+ QEvdevKeyboardManager *m_kbdMgr;
+ bool m_disableInputHandlers;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
index 1b6e2307f8..a14e68b667 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
@@ -32,7 +32,10 @@
****************************************************************************/
#include <QtCore/qtextstream.h>
-#include <QtGui/qpa/qplatformcursor.h>
+#include <QtGui/qwindow.h>
+#include <qpa/qwindowsysteminterface.h>
+#include <qpa/qplatformcursor.h>
+#include <QtPlatformSupport/private/qopenglcompositor_p.h>
#include "qeglfsscreen.h"
#include "qeglfswindow.h"
@@ -41,7 +44,7 @@
QT_BEGIN_NAMESPACE
QEglFSScreen::QEglFSScreen(EGLDisplay dpy)
- : QEGLPlatformScreen(dpy),
+ : m_dpy(dpy),
m_surface(EGL_NO_SURFACE),
m_cursor(0)
{
@@ -51,6 +54,7 @@ QEglFSScreen::QEglFSScreen(EGLDisplay dpy)
QEglFSScreen::~QEglFSScreen()
{
delete m_cursor;
+ QOpenGLCompositor::destroy();
}
QRect QEglFSScreen::geometry() const
@@ -78,6 +82,11 @@ QDpi QEglFSScreen::logicalDpi() const
return qt_egl_device_integration()->logicalDpi();
}
+qreal QEglFSScreen::pixelDensity() const
+{
+ return qt_egl_device_integration()->pixelDensity();
+}
+
Qt::ScreenOrientation QEglFSScreen::nativeOrientation() const
{
return qt_egl_device_integration()->nativeOrientation();
@@ -103,4 +112,89 @@ void QEglFSScreen::setPrimarySurface(EGLSurface surface)
m_surface = surface;
}
+void QEglFSScreen::handleCursorMove(const QPoint &pos)
+{
+ const QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
+ const QList<QOpenGLCompositorWindow *> windows = compositor->windows();
+
+ // Generate enter and leave events like a real windowing system would do.
+ if (windows.isEmpty())
+ return;
+
+ // First window is always fullscreen.
+ if (windows.count() == 1) {
+ QWindow *window = windows[0]->sourceWindow();
+ if (m_pointerWindow != window) {
+ m_pointerWindow = window;
+ QWindowSystemInterface::handleEnterEvent(window, window->mapFromGlobal(pos), pos);
+ }
+ return;
+ }
+
+ QWindow *enter = 0, *leave = 0;
+ for (int i = windows.count() - 1; i >= 0; --i) {
+ QWindow *window = windows[i]->sourceWindow();
+ const QRect geom = window->geometry();
+ if (geom.contains(pos)) {
+ if (m_pointerWindow != window) {
+ leave = m_pointerWindow;
+ m_pointerWindow = window;
+ enter = window;
+ }
+ break;
+ }
+ }
+
+ if (enter && leave)
+ QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos);
+}
+
+QPixmap QEglFSScreen::grabWindow(WId wid, int x, int y, int width, int height) const
+{
+ QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
+ const QList<QOpenGLCompositorWindow *> windows = compositor->windows();
+ Q_ASSERT(!windows.isEmpty());
+
+ QImage img;
+
+ if (static_cast<QEglFSWindow *>(windows.first()->sourceWindow()->handle())->isRaster()) {
+ // Request the compositor to render everything into an FBO and read it back. This
+ // is of course slow, but it's safe and reliable. It will not include the mouse
+ // cursor, which is a plus.
+ img = compositor->grab();
+ } else {
+ // Just a single OpenGL window without compositing. Do not support this case for now. Doing
+ // glReadPixels is not an option since it would read from the back buffer which may have
+ // undefined content when calling right after a swapBuffers (unless preserved swap is
+ // available and enabled, but we have no support for that).
+ qWarning("grabWindow: Not supported for non-composited OpenGL content. Use QQuickWindow::grabWindow() instead.");
+ return QPixmap();
+ }
+
+ if (!wid) {
+ const QSize screenSize = geometry().size();
+ if (width < 0)
+ width = screenSize.width() - x;
+ if (height < 0)
+ height = screenSize.height() - y;
+ return QPixmap::fromImage(img).copy(x, y, width, height);
+ }
+
+ foreach (QOpenGLCompositorWindow *w, windows) {
+ const QWindow *window = w->sourceWindow();
+ if (window->winId() == wid) {
+ const QRect geom = window->geometry();
+ if (width < 0)
+ width = geom.width() - x;
+ if (height < 0)
+ height = geom.height() - y;
+ QRect rect(geom.topLeft() + QPoint(x, y), QSize(width, height));
+ rect &= window->geometry();
+ return QPixmap::fromImage(img).copy(rect);
+ }
+ }
+
+ return QPixmap();
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h
index 07b6ff63ef..8f1d87ea25 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.h
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.h
@@ -35,7 +35,7 @@
#define QEGLFSSCREEN_H
#include "qeglfsglobal.h"
-#include <QtPlatformSupport/private/qeglplatformscreen_p.h>
+#include <QtCore/QPointer>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
class QEglFSWindow;
class QOpenGLContext;
-class Q_EGLFS_EXPORT QEglFSScreen : public QEGLPlatformScreen
+class Q_EGLFS_EXPORT QEglFSScreen : public QPlatformScreen
{
public:
QEglFSScreen(EGLDisplay display);
@@ -55,6 +55,7 @@ public:
QSizeF physicalSize() const Q_DECL_OVERRIDE;
QDpi logicalDpi() const Q_DECL_OVERRIDE;
+ qreal pixelDensity() const Q_DECL_OVERRIDE;
Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
@@ -62,16 +63,23 @@ public:
qreal refreshRate() const Q_DECL_OVERRIDE;
+ QPixmap grabWindow(WId wid, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
+
EGLSurface primarySurface() const { return m_surface; }
-protected:
- void setPrimarySurface(EGLSurface surface);
+ EGLDisplay display() const { return m_dpy; }
+
+ void handleCursorMove(const QPoint &pos);
private:
- friend class QEglFSWindow;
+ void setPrimarySurface(EGLSurface surface);
+ EGLDisplay m_dpy;
+ QPointer<QWindow> m_pointerWindow;
EGLSurface m_surface;
QPlatformCursor *m_cursor;
+
+ friend class QEglFSWindow;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index c0d51c94a5..8301be8c17 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -37,21 +37,23 @@
#include <private/qguiapplication_p.h>
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/QOpenGLContext>
-#include <QtPlatformSupport/private/qeglplatformcursor_p.h>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h>
#include "qeglfswindow.h"
+#include "qeglfscursor.h"
#include "qeglfshooks.h"
-#include <QtDebug>
-
QT_BEGIN_NAMESPACE
QEglFSWindow::QEglFSWindow(QWindow *w)
- : QEGLPlatformWindow(w)
- , m_surface(0)
- , m_window(0)
- , m_flags(0)
+ : QPlatformWindow(w),
+ m_backingStore(0),
+ m_raster(false),
+ m_winId(0),
+ m_surface(EGL_NO_SURFACE),
+ m_window(0),
+ m_flags(0)
{
}
@@ -60,12 +62,34 @@ QEglFSWindow::~QEglFSWindow()
destroy();
}
+static WId newWId()
+{
+ static WId id = 0;
+
+ if (id == std::numeric_limits<WId>::max())
+ qWarning("QEGLPlatformWindow: Out of window IDs");
+
+ return ++id;
+}
+
void QEglFSWindow::create()
{
if (m_flags.testFlag(Created))
return;
- QEGLPlatformWindow::create();
+ m_winId = newWId();
+
+ // Save the original surface type before changing to OpenGLSurface.
+ m_raster = (window()->surfaceType() == QSurface::RasterSurface);
+ if (m_raster) // change to OpenGL, but not for RasterGLSurface
+ window()->setSurfaceType(QSurface::OpenGLSurface);
+
+ if (window()->type() == Qt::Desktop) {
+ QRect fullscreenRect(QPoint(), screen()->availableGeometry().size());
+ QPlatformWindow::setGeometry(fullscreenRect);
+ QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect);
+ return;
+ }
m_flags = Created;
@@ -96,13 +120,14 @@ void QEglFSWindow::create()
setGeometry(QRect()); // will become fullscreen
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
- EGLDisplay display = static_cast<QEglFSScreen *>(screen)->display();
- QSurfaceFormat platformFormat = qt_egl_device_integration()->surfaceFormatFor(window()->requestedFormat());
- m_config = QEglFSIntegration::chooseConfig(display, platformFormat);
- m_format = q_glFormatFromConfig(display, m_config, platformFormat);
-
resetSurface();
+ if (m_surface == EGL_NO_SURFACE) {
+ EGLint error = eglGetError();
+ eglTerminate(screen->display());
+ qFatal("EGL Error : Could not create the egl surface: error = 0x%x\n", error);
+ }
+
screen->setPrimarySurface(m_surface);
if (isRaster()) {
@@ -120,7 +145,7 @@ void QEglFSWindow::destroy()
{
QEglFSScreen *screen = this->screen();
if (m_flags.testFlag(HasNativeWindow)) {
- QEGLPlatformCursor *cursor = qobject_cast<QEGLPlatformCursor *>(screen->cursor());
+ QEglFSCursor *cursor = qobject_cast<QEglFSCursor *>(screen->cursor());
if (cursor)
cursor->resetResources();
@@ -134,15 +159,10 @@ void QEglFSWindow::destroy()
QOpenGLCompositor::instance()->removeWindow(this);
}
-// The virtual functions resetSurface and invalidateSurface may get overridden
-// in derived classes, for example in the Android port, to perform the native
-// window and surface creation differently.
-
void QEglFSWindow::invalidateSurface()
{
if (m_surface != EGL_NO_SURFACE) {
- EGLDisplay display = static_cast<QEglFSScreen *>(screen())->display();
- eglDestroySurface(display, m_surface);
+ eglDestroySurface(screen()->display(), m_surface);
m_surface = EGL_NO_SURFACE;
}
qt_egl_device_integration()->destroyNativeWindow(m_window);
@@ -151,15 +171,13 @@ void QEglFSWindow::invalidateSurface()
void QEglFSWindow::resetSurface()
{
- QEglFSScreen *nativeScreen = static_cast<QEglFSScreen *>(screen());
- EGLDisplay display = nativeScreen->display();
- m_window = qt_egl_device_integration()->createNativeWindow(this, nativeScreen->geometry().size(), m_format);
+ EGLDisplay display = screen()->display();
+ QSurfaceFormat platformFormat = qt_egl_device_integration()->surfaceFormatFor(window()->requestedFormat());
+
+ m_config = QEglFSIntegration::chooseConfig(display, platformFormat);
+ m_format = q_glFormatFromConfig(display, m_config, platformFormat);
+ m_window = qt_egl_device_integration()->createNativeWindow(this, screen()->geometry().size(), m_format);
m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL);
- if (m_surface == EGL_NO_SURFACE) {
- EGLint error = eglGetError();
- eglTerminate(display);
- qFatal("EGL Error : Could not create the egl surface: error = 0x%x\n", error);
- }
}
void QEglFSWindow::setVisible(bool visible)
@@ -265,4 +283,41 @@ QEglFSScreen *QEglFSWindow::screen() const
return static_cast<QEglFSScreen *>(QPlatformWindow::screen());
}
+bool QEglFSWindow::isRaster() const
+{
+ return m_raster || window()->surfaceType() == QSurface::RasterGLSurface;
+}
+
+QWindow *QEglFSWindow::sourceWindow() const
+{
+ return window();
+}
+
+const QPlatformTextureList *QEglFSWindow::textures() const
+{
+ if (m_backingStore)
+ return m_backingStore->textures();
+
+ return 0;
+}
+
+void QEglFSWindow::endCompositing()
+{
+ if (m_backingStore)
+ m_backingStore->notifyComposited();
+}
+
+WId QEglFSWindow::winId() const
+{
+ return m_winId;
+}
+
+void QEglFSWindow::setOpacity(qreal)
+{
+ if (!isRaster())
+ qWarning("QEglFSWindow: Cannot set opacity for non-raster windows");
+
+ // Nothing to do here. The opacity is stored in the QWindow.
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h
index f9d207c153..806b21de0a 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.h
+++ b/src/plugins/platforms/eglfs/qeglfswindow.h
@@ -37,17 +37,23 @@
#include "qeglfsintegration.h"
#include "qeglfsscreen.h"
#include "qeglfsglobal.h"
-#include <QtPlatformSupport/private/qeglplatformwindow_p.h>
+
+#include <qpa/qplatformwindow.h>
+#include <QtPlatformSupport/private/qopenglcompositor_p.h>
+#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
-class Q_EGLFS_EXPORT QEglFSWindow : public QEGLPlatformWindow
+class QOpenGLCompositorBackingStore;
+class QPlatformTextureList;
+
+class Q_EGLFS_EXPORT QEglFSWindow : public QPlatformWindow, public QOpenGLCompositorWindow
{
public:
QEglFSWindow(QWindow *w);
~QEglFSWindow();
- void create() Q_DECL_OVERRIDE;
+ void create();
void destroy();
void setGeometry(const QRect &) Q_DECL_OVERRIDE;
@@ -58,13 +64,15 @@ public:
void lower() Q_DECL_OVERRIDE;
void propagateSizeHints() Q_DECL_OVERRIDE { }
- void setOpacity(qreal) Q_DECL_OVERRIDE { }
void setMask(const QRegion &) Q_DECL_OVERRIDE { }
bool setKeyboardGrabEnabled(bool) Q_DECL_OVERRIDE { return false; }
bool setMouseGrabEnabled(bool) Q_DECL_OVERRIDE { return false; }
+ void setOpacity(qreal) Q_DECL_OVERRIDE;
+ WId winId() const Q_DECL_OVERRIDE;
QSurfaceFormat format() const Q_DECL_OVERRIDE;
- EGLNativeWindowType eglWindow() const Q_DECL_OVERRIDE;
+
+ EGLNativeWindowType eglWindow() const;
EGLSurface surface() const;
QEglFSScreen *screen() const;
@@ -73,11 +81,22 @@ public:
virtual void invalidateSurface() Q_DECL_OVERRIDE;
virtual void resetSurface();
+ QOpenGLCompositorBackingStore *backingStore() { return m_backingStore; }
+ void setBackingStore(QOpenGLCompositorBackingStore *backingStore) { m_backingStore = backingStore; }
+ bool isRaster() const;
+
+ QWindow *sourceWindow() const Q_DECL_OVERRIDE;
+ const QPlatformTextureList *textures() const Q_DECL_OVERRIDE;
+ void endCompositing() Q_DECL_OVERRIDE;
+
protected:
+ QOpenGLCompositorBackingStore *m_backingStore;
+ bool m_raster;
+ WId m_winId;
+
EGLSurface m_surface;
EGLNativeWindowType m_window;
-private:
EGLConfig m_config;
QSurfaceFormat m_format;
diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.cpp b/src/plugins/platforms/haiku/qhaikuclipboard.cpp
index f3aa9dc36e..a2d7e96d71 100644
--- a/src/plugins/platforms/haiku/qhaikuclipboard.cpp
+++ b/src/plugins/platforms/haiku/qhaikuclipboard.cpp
@@ -41,6 +41,8 @@
#include <Clipboard.h>
QHaikuClipboard::QHaikuClipboard()
+ : m_systemMimeData(Q_NULLPTR)
+ , m_userMimeData(Q_NULLPTR)
{
if (be_clipboard)
be_clipboard->StartWatching(BMessenger(this));
@@ -50,17 +52,26 @@ QHaikuClipboard::~QHaikuClipboard()
{
if (be_clipboard)
be_clipboard->StopWatching(BMessenger(this));
+
+ delete m_userMimeData;
+ delete m_systemMimeData;
}
QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode)
{
- QMimeData *mimeData = new QMimeData();
-
if (mode != QClipboard::Clipboard)
- return mimeData;
+ return 0;
+
+ if (m_userMimeData)
+ return m_userMimeData;
if (!be_clipboard->Lock())
- return mimeData;
+ return 0;
+
+ if (!m_systemMimeData)
+ m_systemMimeData = new QMimeData();
+ else
+ m_systemMimeData->clear();
const BMessage *clipboard = be_clipboard->Data();
if (clipboard) {
@@ -76,11 +87,11 @@ QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode)
if (dataLen && (status == B_OK)) {
const QString format = QString::fromLatin1(name);
if (format == QStringLiteral("text/plain")) {
- mimeData->setText(QString::fromLocal8Bit(reinterpret_cast<const char*>(data), dataLen));
+ m_systemMimeData->setText(QString::fromLocal8Bit(reinterpret_cast<const char*>(data), dataLen));
} else if (format == QStringLiteral("text/html")) {
- mimeData->setHtml(QString::fromLocal8Bit(reinterpret_cast<const char*>(data), dataLen));
+ m_systemMimeData->setHtml(QString::fromLocal8Bit(reinterpret_cast<const char*>(data), dataLen));
} else {
- mimeData->setData(format, QByteArray(reinterpret_cast<const char*>(data), dataLen));
+ m_systemMimeData->setData(format, QByteArray(reinterpret_cast<const char*>(data), dataLen));
}
}
}
@@ -88,7 +99,7 @@ QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode)
be_clipboard->Unlock();
- return mimeData;
+ return m_systemMimeData;
}
void QHaikuClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
@@ -96,6 +107,14 @@ void QHaikuClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
if (mode != QClipboard::Clipboard)
return;
+ if (mimeData) {
+ if (m_systemMimeData == mimeData)
+ return;
+
+ if (m_userMimeData == mimeData)
+ return;
+ }
+
if (!be_clipboard->Lock())
return;
@@ -115,6 +134,10 @@ void QHaikuClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
qWarning("Unable to store mime data on clipboard");
be_clipboard->Unlock();
+
+ m_userMimeData = mimeData;
+
+ emitChanged(QClipboard::Clipboard);
}
bool QHaikuClipboard::supportsMode(QClipboard::Mode mode) const
@@ -131,8 +154,12 @@ bool QHaikuClipboard::ownsMode(QClipboard::Mode mode) const
void QHaikuClipboard::MessageReceived(BMessage* message)
{
- if (message->what == B_CLIPBOARD_CHANGED)
+ if (message->what == B_CLIPBOARD_CHANGED) {
+ delete m_userMimeData;
+ m_userMimeData = Q_NULLPTR;
+
emitChanged(QClipboard::Clipboard);
+ }
BHandler::MessageReceived(message);
}
diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.h b/src/plugins/platforms/haiku/qhaikuclipboard.h
index 0dc2bfdd3b..3c1f92c615 100644
--- a/src/plugins/platforms/haiku/qhaikuclipboard.h
+++ b/src/plugins/platforms/haiku/qhaikuclipboard.h
@@ -55,6 +55,10 @@ public:
// override from BHandler to catch change notifications from Haiku clipboard
void MessageReceived(BMessage* message) Q_DECL_OVERRIDE;
+
+private:
+ QMimeData *m_systemMimeData;
+ QMimeData *m_userMimeData;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/haiku/qhaikuwindow.cpp b/src/plugins/platforms/haiku/qhaikuwindow.cpp
index 5768e1cb40..9622d12111 100644
--- a/src/plugins/platforms/haiku/qhaikuwindow.cpp
+++ b/src/plugins/platforms/haiku/qhaikuwindow.cpp
@@ -130,6 +130,7 @@ QHaikuWindow::QHaikuWindow(QWindow *window)
if (!m_window)
qFatal("QHaikuWindow: failed to create window");
+ setGeometry(rect);
setWindowFlags(window->flags());
}
@@ -164,13 +165,13 @@ void QHaikuWindow::setVisible(bool visible)
{
if (visible) {
m_window->Show();
+
+ window()->requestActivate();
+
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), window()->geometry().size()));
} else {
m_window->Hide();
}
-
- window()->requestActivate();
-
- QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
}
bool QHaikuWindow::isExposed() const
@@ -306,10 +307,8 @@ void QHaikuWindow::haikuWindowMoved(const QPoint &pos)
const QRect newGeometry(pos, geometry().size());
QPlatformWindow::setGeometry(newGeometry);
- QWindowSystemInterface::setSynchronousWindowsSystemEvents(true);
QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
- QWindowSystemInterface::handleExposeEvent(window(), newGeometry);
- QWindowSystemInterface::setSynchronousWindowsSystemEvents(false);
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), newGeometry.size()));
}
void QHaikuWindow::haikuWindowResized(const QSize &size, bool zoomInProgress)
@@ -317,10 +316,8 @@ void QHaikuWindow::haikuWindowResized(const QSize &size, bool zoomInProgress)
const QRect newGeometry(geometry().topLeft(), size);
QPlatformWindow::setGeometry(newGeometry);
- QWindowSystemInterface::setSynchronousWindowsSystemEvents(true);
QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
- QWindowSystemInterface::handleExposeEvent(window(), newGeometry);
- QWindowSystemInterface::setSynchronousWindowsSystemEvents(false);
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), newGeometry.size()));
if ((m_windowState == Qt::WindowMaximized) && !zoomInProgress) {
// the user has resized the window while maximized -> reset maximized flag
diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm
index 92799f80c1..7a37e213bd 100644
--- a/src/plugins/platforms/ios/qiosapplicationstate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationstate.mm
@@ -43,7 +43,7 @@
@implementation QIOSApplicationStateListener
-- (id) init
+- (id)init
{
self = [super init];
if (self) {
@@ -75,7 +75,7 @@
return self;
}
-- (void) dealloc
+- (void)dealloc
{
[[NSNotificationCenter defaultCenter]
removeObserver:self
@@ -92,12 +92,12 @@
[super dealloc];
}
-- (void) applicationDidBecomeActive
+- (void)applicationDidBecomeActive
{
[self handleApplicationStateChanged:UIApplicationStateActive];
}
-- (void) applicationWillResignActive
+- (void)applicationWillResignActive
{
// Note that UIApplication is still UIApplicationStateActive at this
// point, but since there is no separate notification for the inactive
@@ -105,12 +105,12 @@
[self handleApplicationStateChanged:UIApplicationStateInactive];
}
-- (void) applicationDidEnterBackground
+- (void)applicationDidEnterBackground
{
[self handleApplicationStateChanged:UIApplicationStateBackground];
}
-- (void) handleApplicationStateChanged:(UIApplicationState) uiApplicationState
+- (void)handleApplicationStateChanged:(UIApplicationState)uiApplicationState
{
// We may receive application state changes after QCoreApplication has
// gone down, as the block we schedule on the main queue keeps the
diff --git a/src/plugins/platforms/ios/qiosclipboard.mm b/src/plugins/platforms/ios/qiosclipboard.mm
index 192ee67689..e0c6ec5d72 100644
--- a/src/plugins/platforms/ios/qiosclipboard.mm
+++ b/src/plugins/platforms/ios/qiosclipboard.mm
@@ -62,7 +62,7 @@
@implementation QUIClipboard
--(id)initWithQIOSClipboard:(QIOSClipboard *)qiosClipboard
+- (id)initWithQIOSClipboard:(QIOSClipboard *)qiosClipboard
{
self = [super init];
if (self) {
@@ -87,7 +87,7 @@
return self;
}
--(void)dealloc
+- (void)dealloc
{
[[NSNotificationCenter defaultCenter]
removeObserver:self
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm
index fe0ca33c13..8bdb4bcdb3 100644
--- a/src/plugins/platforms/ios/qioscontext.mm
+++ b/src/plugins/platforms/ios/qioscontext.mm
@@ -45,12 +45,15 @@
QIOSContext::QIOSContext(QOpenGLContext *context)
: QPlatformOpenGLContext()
, m_sharedContext(static_cast<QIOSContext *>(context->shareHandle()))
+ , m_eaglContext(0)
, m_format(context->format())
{
m_format.setRenderableType(QSurfaceFormat::OpenGLES);
- m_eaglContext = [[EAGLContext alloc]
- initWithAPI:EAGLRenderingAPI(m_format.majorVersion())
- sharegroup:m_sharedContext ? [m_sharedContext->m_eaglContext sharegroup] : nil];
+
+ EAGLSharegroup *shareGroup = m_sharedContext ? [m_sharedContext->m_eaglContext sharegroup] : nil;
+ const int preferredVersion = m_format.majorVersion() == 1 ? kEAGLRenderingAPIOpenGLES1 : kEAGLRenderingAPIOpenGLES3;
+ for (int version = preferredVersion; !m_eaglContext && version >= m_format.majorVersion(); --version)
+ m_eaglContext = [[EAGLContext alloc] initWithAPI:EAGLRenderingAPI(version) sharegroup:shareGroup];
if (m_eaglContext != nil) {
EAGLContext *originalContext = [EAGLContext currentContext];
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.h b/src/plugins/platforms/ios/qioseventdispatcher.h
index fdaa7e68fe..98977eb670 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.h
+++ b/src/plugins/platforms/ios/qioseventdispatcher.h
@@ -34,7 +34,7 @@
#ifndef QIOSEVENTDISPATCHER_H
#define QIOSEVENTDISPATCHER_H
-#include <QtPlatformSupport/private/qeventdispatcher_cf_p.h>
+#include <QtCore/private/qeventdispatcher_cf_p.h>
QT_BEGIN_NAMESPACE
@@ -46,6 +46,7 @@ public:
explicit QIOSEventDispatcher(QObject *parent = 0);
bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
+ bool processPostedEvents() Q_DECL_OVERRIDE;
void handleRunLoopExit(CFRunLoopActivity activity);
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm
index fc12e83a81..0e9f176487 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.mm
+++ b/src/plugins/platforms/ios/qioseventdispatcher.mm
@@ -39,6 +39,8 @@
#include <QtCore/private/qcoreapplication_p.h>
#include <QtCore/private/qthread_p.h>
+#include <qpa/qwindowsysteminterface.h>
+
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#import <Foundation/NSProcessInfo.h>
@@ -198,7 +200,7 @@ namespace
bool debugStackUsage = false;
}
-extern "C" int __attribute__((weak)) main(int argc, char *argv[])
+extern "C" int qt_main_wrapper(int argc, char *argv[])
{
@autoreleasepool {
size_t defaultStackSize = 512 * kBytesPerKiloByte; // Same as secondary threads
@@ -233,18 +235,7 @@ enum SetJumpResult
kJumpedFromUserMainTrampoline,
};
-// We define qtmn so that user_main_trampoline() will not cause
-// missing symbols in the case of hybrid applications that don't
-// use our main wrapper. Since the symbol is weak, it will not
-// get used or cause a clash in the normal Qt application usecase,
-// where we rename main to qtmn before linking.
-extern "C" int __attribute__((weak)) qtmn(int argc, char *argv[])
-{
- Q_UNUSED(argc);
- Q_UNUSED(argv);
-
- Q_UNREACHABLE();
-}
+extern "C" int main(int argc, char *argv[]);
static void __attribute__((noinline, noreturn)) user_main_trampoline()
{
@@ -263,7 +254,7 @@ static void __attribute__((noinline, noreturn)) user_main_trampoline()
qFatal("Could not convert argv[%d] to C string", i);
}
- int exitCode = qtmn(argc, argv);
+ int exitCode = main(argc, argv);
delete[] argv;
qEventDispatcherDebug() << "Returned from main with exit code " << exitCode;
@@ -293,7 +284,7 @@ static bool rootLevelRunLoopIntegration()
@implementation QIOSApplicationStateTracker
-+ (void) load
++ (void)load
{
[[NSNotificationCenter defaultCenter]
addObserver:self
@@ -323,7 +314,7 @@ static bool rootLevelRunLoopIntegration()
# error "Unknown processor family"
#endif
-+ (void) applicationDidFinishLaunching
++ (void)applicationDidFinishLaunching
{
if (!isQtApplication())
return;
@@ -377,7 +368,7 @@ static bool rootLevelRunLoopIntegration()
// four bits of the exit code (exit(3) will only pass on the lower 8 bits).
static const char kApplicationWillTerminateExitCode = SIGTERM | 0x80;
-+ (void) applicationWillTerminate
++ (void)applicationWillTerminate
{
if (!isQtApplication())
return;
@@ -472,6 +463,25 @@ bool __attribute__((returns_twice)) QIOSEventDispatcher::processEvents(QEventLoo
return processedEvents;
}
+/*!
+ Override of the CoreFoundation posted events runloop source callback
+ so that we can send window system (QPA) events in addition to sending
+ normal Qt events.
+*/
+bool QIOSEventDispatcher::processPostedEvents()
+{
+ // Don't send window system events if the base CF dispatcher has determined
+ // that events should not be sent for this pass of the runloop source.
+ if (!QEventDispatcherCoreFoundation::processPostedEvents())
+ return false;
+
+ qEventDispatcherDebug() << "Sending window system events for " << m_processEvents.flags; qIndent();
+ QWindowSystemInterface::sendWindowSystemEvents(m_processEvents.flags);
+ qUnIndent();
+
+ return true;
+}
+
void QIOSEventDispatcher::handleRunLoopExit(CFRunLoopActivity activity)
{
Q_UNUSED(activity);
diff --git a/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm b/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
index 761a89c989..bb12c164d6 100644
--- a/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
+++ b/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
@@ -48,20 +48,29 @@ static QThreadStorage<QPointer<QIOSAssetData> > g_assetDataCache;
static const int kBufferSize = 10;
static ALAsset *kNoAsset = 0;
-static void ensureAuthorizationDialogNotBlocked()
+static bool ensureAuthorizationDialogNotBlocked()
{
if ([ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusNotDetermined)
- return;
+ return true;
+
if (static_cast<QCoreApplicationPrivate *>(QObjectPrivate::get(qApp))->in_exec)
- return;
-
- // Since authorization status has not been determined, the user will be asked
- // to authorize the app. But since main has not finished, the dialog will be held
- // back until the launch completes. To avoid a dead-lock below, we start an event
- // loop to complete the launch.
- QEventLoop loop;
- QTimer::singleShot(1, &loop, &QEventLoop::quit);
- loop.exec();
+ return true;
+
+ if ([NSThread isMainThread]) {
+ // The dialog is about to show, but since main has not finished, the dialog will be held
+ // back until the launch completes. This is problematic since we cannot successfully return
+ // back to the caller before the asset is ready, which also includes showing the dialog. To
+ // work around this, we create an event loop to that will complete the launch (return from the
+ // applicationDidFinishLaunching callback). But this will only work if we're on the main thread.
+ QEventLoop loop;
+ QTimer::singleShot(1, &loop, &QEventLoop::quit);
+ loop.exec();
+ } else {
+ NSLog(@"QIOSFileEngine: unable to show assets authorization dialog from non-gui thread before QApplication is executing.");
+ return false;
+ }
+
+ return true;
}
// -------------------------------------------------------------------------
@@ -80,8 +89,10 @@ public:
, m_writeIndex(0)
, m_nextAssetReady(false)
{
- ensureAuthorizationDialogNotBlocked();
- startEnumerate();
+ if (!ensureAuthorizationDialogNotBlocked())
+ writeAsset(kNoAsset);
+ else
+ startEnumerate();
}
~QIOSAssetEnumerator()
@@ -186,7 +197,8 @@ public:
, m_assetUrl(assetUrl)
, m_assetLibrary(0)
{
- ensureAuthorizationDialogNotBlocked();
+ if (!ensureAuthorizationDialogNotBlocked())
+ return;
if (QIOSAssetData *assetData = g_assetDataCache.localData()) {
// It's a common pattern that QFiles pointing to the same path are created and destroyed
diff --git a/src/plugins/platforms/ios/qiosglobal.h b/src/plugins/platforms/ios/qiosglobal.h
index 86b784618f..544f9e0a42 100644
--- a/src/plugins/platforms/ios/qiosglobal.h
+++ b/src/plugins/platforms/ios/qiosglobal.h
@@ -68,7 +68,7 @@ int infoPlistValue(NSString* key, int defaultValue);
QT_END_NAMESPACE
@interface UIResponder (QtFirstResponder)
-+(id)currentFirstResponder;
++ (id)currentFirstResponder;
@end
class FirstResponderCandidate : public QScopedValueRollback<UIResponder *>
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm
index ef24abbfd9..f5b971391d 100644
--- a/src/plugins/platforms/ios/qiosglobal.mm
+++ b/src/plugins/platforms/ios/qiosglobal.mm
@@ -133,7 +133,7 @@ int infoPlistValue(NSString* key, int defaultValue)
@end
@implementation QtFirstResponderEvent
-- (void) dealloc
+- (void)dealloc
{
self.firstResponder = 0;
[super dealloc];
@@ -158,7 +158,7 @@ int infoPlistValue(NSString* key, int defaultValue)
@implementation UIResponder (QtFirstResponder)
-+(id)currentFirstResponder
++ (id)currentFirstResponder
{
QtFirstResponderEvent *event = [[[QtFirstResponderEvent alloc] init] autorelease];
[[UIApplication sharedApplication] sendAction:@selector(qt_findFirstResponder:event:) to:nil from:nil forEvent:event];
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index 090df66e0d..d03c589b2a 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -579,7 +579,7 @@ void QIOSInputContext::focusWindowChanged(QWindow *focusWindow)
void QIOSInputContext::update(Qt::InputMethodQueries updatedProperties)
{
// Mask for properties that we are interested in and see if any of them changed
- updatedProperties &= (Qt::ImEnabled | Qt::ImHints | Qt::ImQueryInput | Qt::ImPlatformData);
+ updatedProperties &= (Qt::ImEnabled | Qt::ImHints | Qt::ImQueryInput | Qt::ImEnterKeyType | Qt::ImPlatformData);
qImDebug() << "fw =" << qApp->focusWindow() << "fo =" << qApp->focusObject();
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm
index 8395db81ff..85b5c477cc 100644
--- a/src/plugins/platforms/ios/qiosintegration.mm
+++ b/src/plugins/platforms/ios/qiosintegration.mm
@@ -89,10 +89,11 @@ QIOSIntegration::QIOSIntegration()
// Set current directory to app bundle folder
QDir::setCurrent(QString::fromUtf8([[[NSBundle mainBundle] bundlePath] UTF8String]));
+ UIScreen *mainScreen = [UIScreen mainScreen];
NSMutableArray *screens = [[[UIScreen screens] mutableCopy] autorelease];
- if (![screens containsObject:[UIScreen mainScreen]]) {
+ if (![screens containsObject:mainScreen]) {
// Fallback for iOS 7.1 (QTBUG-42345)
- [screens insertObject:[UIScreen mainScreen] atIndex:0];
+ [screens insertObject:mainScreen atIndex:0];
}
for (UIScreen *screen in screens)
@@ -103,7 +104,12 @@ QIOSIntegration::QIOSIntegration()
m_touchDevice = new QTouchDevice;
m_touchDevice->setType(QTouchDevice::TouchScreen);
- m_touchDevice->setCapabilities(QTouchDevice::Position | QTouchDevice::NormalizedPosition);
+ QTouchDevice::Capabilities touchCapabilities = QTouchDevice::Position | QTouchDevice::NormalizedPosition;
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_9_0) {
+ if (mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
+ touchCapabilities |= QTouchDevice::Pressure;
+ }
+ m_touchDevice->setCapabilities(touchCapabilities);
QWindowSystemInterface::registerTouchDevice(m_touchDevice);
QMacInternalPasteboardMime::initializeMimeTypes();
}
@@ -219,6 +225,10 @@ QPlatformServices *QIOSIntegration::services() const
QVariant QIOSIntegration::styleHint(StyleHint hint) const
{
switch (hint) {
+ case PasswordMaskDelay:
+ // this number is based on timing the native delay
+ // since there is no API to get it
+ return 2000;
case ShowIsMaximized:
return true;
case SetFocusOnTouchRelease:
diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm
index 09395805bf..612f8c43a2 100644
--- a/src/plugins/platforms/ios/qiosmenu.mm
+++ b/src/plugins/platforms/ios/qiosmenu.mm
@@ -61,11 +61,23 @@ static NSString *const kSelectorPrefix = @"_qtMenuItem_";
{
if (self = [super init]) {
[self setVisibleMenuItems:visibleMenuItems];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(menuClosed)
+ name:UIMenuControllerDidHideMenuNotification object:nil];
}
return self;
}
+-(void)dealloc
+{
+ [[NSNotificationCenter defaultCenter]
+ removeObserver:self
+ name:UIMenuControllerDidHideMenuNotification object:nil];
+ [super dealloc];
+}
+
- (void)setVisibleMenuItems:(const QIOSMenuItemList &)visibleMenuItems
{
m_visibleMenuItems = visibleMenuItems;
@@ -85,6 +97,11 @@ static NSString *const kSelectorPrefix = @"_qtMenuItem_";
[[UIMenuController sharedMenuController] setMenuVisible:YES animated:NO];
}
+-(void)menuClosed
+{
+ QIOSMenu::currentMenu()->dismiss();
+}
+
- (id)targetForAction:(SEL)action withSender:(id)sender
{
Q_UNUSED(sender);
@@ -165,7 +182,7 @@ static NSString *const kSelectorPrefix = @"_qtMenuItem_";
[self reloadAllComponents];
}
--(void)listenForKeyboardWillHideNotification:(BOOL)listen
+- (void)listenForKeyboardWillHideNotification:(BOOL)listen
{
if (listen) {
[[NSNotificationCenter defaultCenter]
@@ -179,7 +196,7 @@ static NSString *const kSelectorPrefix = @"_qtMenuItem_";
}
}
--(void)dealloc
+- (void)dealloc
{
[self listenForKeyboardWillHideNotification:NO];
self.toolbar = 0;
diff --git a/src/plugins/platforms/ios/qiosplatformaccessibility.mm b/src/plugins/platforms/ios/qiosplatformaccessibility.mm
index bfe91df7bd..d8d366a4f4 100644
--- a/src/plugins/platforms/ios/qiosplatformaccessibility.mm
+++ b/src/plugins/platforms/ios/qiosplatformaccessibility.mm
@@ -66,6 +66,8 @@ void invalidateCache(QAccessibleInterface *iface)
void QIOSPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
{
+ if (!isActive() || !event->accessibleInterface())
+ return;
switch (event->type()) {
case QAccessible::ObjectCreated:
case QAccessible::ObjectShow:
diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h
index a0aa922a31..f31be9756c 100644
--- a/src/plugins/platforms/ios/qiosscreen.h
+++ b/src/plugins/platforms/ios/qiosscreen.h
@@ -73,7 +73,7 @@ private:
QRect m_geometry;
QRect m_availableGeometry;
int m_depth;
- uint m_unscaledDpi;
+ uint m_pixelDensity;
QSizeF m_physicalSize;
QIOSOrientationListener *m_orientationListener;
};
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 324133074b..5cb06d591d 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -104,12 +104,12 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
@public
QIOSScreen *m_screen;
}
-- (id) initWithQIOSScreen:(QIOSScreen *)screen;
+- (id)initWithQIOSScreen:(QIOSScreen *)screen;
@end
@implementation QIOSOrientationListener
-- (id) initWithQIOSScreen:(QIOSScreen *)screen
+- (id)initWithQIOSScreen:(QIOSScreen *)screen
{
self = [super init];
if (self) {
@@ -123,7 +123,7 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
return self;
}
-- (void) dealloc
+- (void)dealloc
{
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter]
@@ -132,7 +132,7 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
[super dealloc];
}
-- (void) orientationChanged:(NSNotification *)notification
+- (void)orientationChanged:(NSNotification *)notification
{
Q_UNUSED(notification);
m_screen->updateProperties();
@@ -170,23 +170,28 @@ QIOSScreen::QIOSScreen(UIScreen *screen)
if (screen == [UIScreen mainScreen]) {
QString deviceIdentifier = deviceModelIdentifier();
- if (deviceIdentifier == QLatin1String("iPhone2,1") /* iPhone 3GS */
- || deviceIdentifier == QLatin1String("iPod3,1") /* iPod touch 3G */) {
+ // Based on https://en.wikipedia.org/wiki/List_of_iOS_devices#Display
+
+ // iPhone (1st gen), 3G, 3GS, and iPod Touch (1st–3rd gen) are 18-bit devices
+ if (deviceIdentifier.contains(QRegularExpression("^(iPhone1,[12]|iPhone2,1|iPod[1-3],1)$")))
m_depth = 18;
- } else {
+ else
m_depth = 24;
- }
- if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad
- && !deviceIdentifier.contains(QRegularExpression("^iPad2,[567]$")) /* excluding iPad Mini */) {
- m_unscaledDpi = 132;
+ if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2)$"))) {
+ // iPhone 6 Plus or iPhone 6S Plus
+ m_pixelDensity = 401;
+ } else if (deviceIdentifier.contains(QRegularExpression("^iPad(1,1|2,[1-4]|3,[1-6]|4,[1-3]|5,[3-4]|6,[7-8])$"))) {
+ // All iPads except the iPad Mini series
+ m_pixelDensity = 132 * devicePixelRatio();
} else {
- m_unscaledDpi = 163; // Regular iPhone DPI
+ // All non-Plus iPhones, and iPad Minis
+ m_pixelDensity = 163 * devicePixelRatio();
}
} else {
// External display, hard to say
m_depth = 24;
- m_unscaledDpi = 96;
+ m_pixelDensity = 96;
}
for (UIWindow *existingWindow in [[UIApplication sharedApplication] windows]) {
@@ -249,7 +254,7 @@ void QIOSScreen::updateProperties()
if (m_geometry != previousGeometry) {
const qreal millimetersPerInch = 25.4;
- m_physicalSize = QSizeF(m_geometry.size()) / m_unscaledDpi * millimetersPerInch;
+ m_physicalSize = QSizeF(m_geometry.size() * devicePixelRatio()) / m_pixelDensity * millimetersPerInch;
}
// At construction time, we don't yet have an associated QScreen, but we still want
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index f3ea68cdc4..320b1cac61 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -92,12 +92,12 @@
return [QUITextPosition positionWithIndex:(self.range.location + self.range.length)];
}
-- (NSRange) range
+- (NSRange)range
{
return _range;
}
--(BOOL)isEmpty
+- (BOOL)isEmpty
{
return (self.range.length == 0);
}
@@ -111,7 +111,7 @@
@implementation WrapperView
--(id)initWithView:(UIView *)view
+- (id)initWithView:(UIView *)view
{
if (self = [self init]) {
[self addSubview:view];
@@ -143,7 +143,7 @@
// retained, we ensure that all messages sent to the view during
// its lifetime in a window hierarcy will be able to traverse the
// responder chain.
--(void)willMoveToWindow:(UIWindow *)window
+- (void)willMoveToWindow:(UIWindow *)window
{
if (window)
[[self nextResponder] retain];
@@ -170,9 +170,31 @@
QVariantMap platformData = m_configuredImeState->value(Qt::ImPlatformData).toMap();
Qt::InputMethodHints hints = Qt::InputMethodHints(m_configuredImeState->value(Qt::ImHints).toUInt());
- self.returnKeyType = platformData.value(kImePlatformDataReturnKeyType).isValid() ?
- UIReturnKeyType(platformData.value(kImePlatformDataReturnKeyType).toInt()) :
- (hints & Qt::ImhMultiLine) ? UIReturnKeyDefault : UIReturnKeyDone;
+ Qt::EnterKeyType enterKeyType = Qt::EnterKeyType(m_configuredImeState->value(Qt::ImEnterKeyType).toUInt());
+
+ switch (enterKeyType) {
+ case Qt::EnterKeyReturn:
+ self.returnKeyType = UIReturnKeyDefault;
+ break;
+ case Qt::EnterKeyDone:
+ self.returnKeyType = UIReturnKeyDone;
+ break;
+ case Qt::EnterKeyGo:
+ self.returnKeyType = UIReturnKeyGo;
+ break;
+ case Qt::EnterKeySend:
+ self.returnKeyType = UIReturnKeySend;
+ break;
+ case Qt::EnterKeySearch:
+ self.returnKeyType = UIReturnKeySearch;
+ break;
+ case Qt::EnterKeyNext:
+ self.returnKeyType = UIReturnKeyNext;
+ break;
+ default:
+ self.returnKeyType = (hints & Qt::ImhMultiLine) ? UIReturnKeyDefault : UIReturnKeyDone;
+ break;
+ }
self.secureTextEntry = BOOL(hints & Qt::ImhHiddenText);
self.autocorrectionType = (hints & Qt::ImhNoPredictiveText) ?
@@ -238,7 +260,7 @@
}
// Based on what we set up in initWithInputContext above
- updatedProperties &= (Qt::ImHints | Qt::ImPlatformData);
+ updatedProperties &= (Qt::ImHints | Qt::ImEnterKeyType | Qt::ImPlatformData);
if (!updatedProperties)
return NO;
@@ -296,7 +318,11 @@
// a regular responder transfer to another window. In the former case, iOS
// will set the new first-responder to our next-responder, and in the latter
// case we'll have an active responder candidate.
- if ([UIResponder currentFirstResponder] == [self nextResponder]) {
+ if (![UIResponder currentFirstResponder]) {
+ // No first responder set anymore, sync this with Qt by clearing the
+ // focus object.
+ m_inputContext->clearCurrentFocusObject();
+ } else if ([UIResponder currentFirstResponder] == [self nextResponder]) {
// We have resigned the keyboard, and transferred first responder back to the parent view
Q_ASSERT(!FirstResponderCandidate::currentCandidate());
if ([self currentImeState:Qt::ImEnabled].toBool()) {
@@ -342,6 +368,32 @@
[self sendKeyPressRelease:key modifiers:modifiers];
}
+- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
+{
+ bool isEditAction = (action == @selector(cut:)
+ || action == @selector(copy:)
+ || action == @selector(paste:)
+ || action == @selector(delete:)
+ || action == @selector(toggleBoldface:)
+ || action == @selector(toggleItalics:)
+ || action == @selector(toggleUnderline:)
+ || action == @selector(undo)
+ || action == @selector(redo));
+
+ bool isSelectAction = (action == @selector(select:)
+ || action == @selector(selectAll:)
+ || action == @selector(paste:)
+ || action == @selector(undo)
+ || action == @selector(redo));
+
+ const bool unknownAction = !isEditAction && !isSelectAction;
+ const bool hasSelection = ![self selectedTextRange].empty;
+
+ if (unknownAction)
+ return [super canPerformAction:action withSender:sender];
+ return (hasSelection && isEditAction) || (!hasSelection && isSelectAction);
+}
+
- (void)cut:(id)sender
{
Q_UNUSED(sender);
@@ -360,6 +412,13 @@
[self sendShortcut:QKeySequence::Paste];
}
+- (void)select:(id)sender
+{
+ Q_UNUSED(sender);
+ [self sendShortcut:QKeySequence::MoveToPreviousWord];
+ [self sendShortcut:QKeySequence::SelectNextWord];
+}
+
- (void)selectAll:(id)sender
{
Q_UNUSED(sender);
@@ -546,19 +605,20 @@
return m_inputContext->imeState().currentState.value(query);
}
--(id<UITextInputTokenizer>)tokenizer
+- (id<UITextInputTokenizer>)tokenizer
{
return [[[UITextInputStringTokenizer alloc] initWithTextInput:id<UITextInput>(self)] autorelease];
}
--(UITextPosition *)beginningOfDocument
+- (UITextPosition *)beginningOfDocument
{
return [QUITextPosition positionWithIndex:0];
}
--(UITextPosition *)endOfDocument
+- (UITextPosition *)endOfDocument
{
- int endPosition = [self currentImeState:Qt::ImSurroundingText].toString().length();
+ QString surroundingText = [self currentImeState:Qt::ImSurroundingText].toString();
+ int endPosition = surroundingText.length() + m_markedText.length();
return [QUITextPosition positionWithIndex:endPosition];
}
@@ -589,9 +649,18 @@
- (NSString *)textInRange:(UITextRange *)range
{
+ QString text = [self currentImeState:Qt::ImSurroundingText].toString();
+ if (!m_markedText.isEmpty()) {
+ // [UITextInput textInRange] is sparsely documented, but it turns out that unconfirmed
+ // marked text should be seen as a part of the text document. This is different from
+ // ImSurroundingText, which excludes it.
+ int cursorPos = [self currentImeState:Qt::ImCursorPosition].toInt();
+ text = text.left(cursorPos) + m_markedText + text.mid(cursorPos);
+ }
+
int s = static_cast<QUITextPosition *>([range start]).index;
int e = static_cast<QUITextPosition *>([range end]).index;
- return [self currentImeState:Qt::ImSurroundingText].toString().mid(s, e - s).toNSString();
+ return text.mid(s, e - s).toNSString();
}
- (void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRange
@@ -841,7 +910,7 @@
return [NSDictionary dictionaryWithObject:uifont forKey:UITextInputTextFontKey];
}
--(NSDictionary *)markedTextStyle
+- (NSDictionary *)markedTextStyle
{
return [NSDictionary dictionary];
}
@@ -860,7 +929,16 @@
if ([text isEqualToString:@"\n"]) {
[self sendKeyPressRelease:Qt::Key_Return modifiers:Qt::NoModifier];
- if (self.returnKeyType == UIReturnKeyDone)
+ // An onEnter handler of a TextInput might move to the next input by calling
+ // nextInput.forceActiveFocus() which changes the focusObject.
+ // In that case we don't want to hide the VKB.
+ if (focusObject != QGuiApplication::focusObject()) {
+ qImDebug() << "focusObject already changed, not resigning first responder.";
+ return;
+ }
+
+ if (self.returnKeyType == UIReturnKeyDone || self.returnKeyType == UIReturnKeyGo
+ || self.returnKeyType == UIReturnKeySend || self.returnKeyType == UIReturnKeySearch)
[self resignFirstResponder];
return;
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm
index 62f5387979..94d894bba7 100644
--- a/src/plugins/platforms/ios/qiosviewcontroller.mm
+++ b/src/plugins/platforms/ios/qiosviewcontroller.mm
@@ -143,7 +143,7 @@
if (uiWindow.screen != [UIScreen mainScreen] && self.subviews.count == 1) {
// Removing the last view of an external screen, go back to mirror mode
- uiWindow.screen = nil;
+ uiWindow.screen = [UIScreen mainScreen];
uiWindow.hidden = YES;
}
}
@@ -296,13 +296,13 @@
// -------------------------------------------------------------------------
--(BOOL)shouldAutorotate
+- (BOOL)shouldAutorotate
{
return m_screen && m_screen->uiScreen() == [UIScreen mainScreen] && !self.lockedOrientation;
}
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_6_0)
--(NSUInteger)supportedInterfaceOrientations
+- (NSUInteger)supportedInterfaceOrientations
{
// As documented by Apple in the iOS 6.0 release notes, setStatusBarOrientation:animated:
// only works if the supportedInterfaceOrientations of the view controller is 0, making
@@ -315,7 +315,7 @@
#endif
#if QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_6_0)
--(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
Q_UNUSED(interfaceOrientation);
return [self shouldAutorotate];
diff --git a/src/plugins/platforms/ios/quiaccessibilityelement.h b/src/plugins/platforms/ios/quiaccessibilityelement.h
index a690e12c7d..c76e3a6a1e 100644
--- a/src/plugins/platforms/ios/quiaccessibilityelement.h
+++ b/src/plugins/platforms/ios/quiaccessibilityelement.h
@@ -42,8 +42,8 @@
@property (readonly) QAccessible::Id axid;
-- (id) initWithId: (QAccessible::Id) anId withAccessibilityContainer: (id) view;
-+ (QMacAccessibilityElement *) elementWithId: (QAccessible::Id) anId withAccessibilityContainer: (id) view;
+- (id)initWithId:(QAccessible::Id)anId withAccessibilityContainer:(id)view;
++ (QMacAccessibilityElement *)elementWithId:(QAccessible::Id)anId withAccessibilityContainer:(id)view;
@end
diff --git a/src/plugins/platforms/ios/quiaccessibilityelement.mm b/src/plugins/platforms/ios/quiaccessibilityelement.mm
index 2cecfc1126..3bac1ca88d 100644
--- a/src/plugins/platforms/ios/quiaccessibilityelement.mm
+++ b/src/plugins/platforms/ios/quiaccessibilityelement.mm
@@ -37,7 +37,7 @@
@implementation QMacAccessibilityElement
-- (id) initWithId: (QAccessible::Id) anId withAccessibilityContainer: (id) view
+- (id)initWithId:(QAccessible::Id)anId withAccessibilityContainer:(id)view
{
Q_ASSERT((int)anId < 0);
self = [super initWithAccessibilityContainer: view];
@@ -47,7 +47,7 @@
return self;
}
-+ (id) elementWithId: (QAccessible::Id) anId withAccessibilityContainer: (id) view
++ (id)elementWithId:(QAccessible::Id)anId withAccessibilityContainer:(id)view
{
Q_ASSERT(anId);
if (!anId)
@@ -64,17 +64,17 @@
return element;
}
-- (void) invalidate
+- (void)invalidate
{
[self release];
}
-- (BOOL) isAccessibilityElement
+- (BOOL)isAccessibilityElement
{
return YES;
}
-- (NSString*) accessibilityLabel
+- (NSString*)accessibilityLabel
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (!iface) {
@@ -85,7 +85,7 @@
return iface->text(QAccessible::Name).toNSString();
}
-- (NSString*) accessibilityHint
+- (NSString*)accessibilityHint
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (!iface) {
@@ -95,7 +95,7 @@
return iface->text(QAccessible::Description).toNSString();
}
-- (NSString*) accessibilityValue
+- (NSString*)accessibilityValue
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (!iface) {
@@ -119,7 +119,7 @@
return [super accessibilityHint];
}
-- (CGRect) accessibilityFrame
+- (CGRect)accessibilityFrame
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (!iface) {
@@ -131,7 +131,7 @@
return CGRectMake(rect.x(), rect.y(), rect.width(), rect.height());
}
-- (UIAccessibilityTraits) accessibilityTraits
+- (UIAccessibilityTraits)accessibilityTraits
{
UIAccessibilityTraits traits = UIAccessibilityTraitNone;
@@ -156,7 +156,7 @@
return traits;
}
-- (BOOL) accessibilityActivate
+- (BOOL)accessibilityActivate
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (QAccessibleActionInterface *action = iface->actionInterface()) {
@@ -171,21 +171,21 @@
return NO; // fall back to sending mouse clicks
}
-- (void) accessibilityIncrement
+- (void)accessibilityIncrement
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (QAccessibleActionInterface *action = iface->actionInterface())
action->doAction(QAccessibleActionInterface::increaseAction());
}
-- (void) accessibilityDecrement
+- (void)accessibilityDecrement
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
if (QAccessibleActionInterface *action = iface->actionInterface())
action->doAction(QAccessibleActionInterface::decreaseAction());
}
-- (BOOL) accessibilityScroll : (UIAccessibilityScrollDirection) direction
+- (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction
{
QAccessibleInterface *iface = QAccessible::accessibleInterface(self.axid);
QAccessibleActionInterface *action = iface->actionInterface();
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index 87dc3b9dcb..4dd43be465 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -50,7 +50,7 @@
return [CAEAGLLayer class];
}
--(id)initWithQIOSWindow:(QIOSWindow *)window
+- (id)initWithQIOSWindow:(QIOSWindow *)window
{
if (self = [self initWithFrame:toCGRect(window->geometry())])
m_qioswindow = window;
@@ -280,6 +280,23 @@
// -------------------------------------------------------------------------
+- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
+{
+ [super traitCollectionDidChange: previousTraitCollection];
+
+ QTouchDevice *touchDevice = QIOSIntegration::instance()->touchDevice();
+ QTouchDevice::Capabilities touchCapabilities = touchDevice->capabilities();
+
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_9_0) {
+ if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
+ touchCapabilities |= QTouchDevice::Pressure;
+ else
+ touchCapabilities &= ~QTouchDevice::Pressure;
+ }
+
+ touchDevice->setCapabilities(touchCapabilities);
+}
+
-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
if (m_qioswindow->window()->flags() & Qt::WindowTransparentForInput)
@@ -289,6 +306,8 @@
- (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state
{
+ bool supportsPressure = QIOSIntegration::instance()->touchDevice()->capabilities() & QTouchDevice::Pressure;
+
foreach (UITouch *uiTouch, m_activeTouches.keys()) {
QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch];
if (![touches containsObject:uiTouch]) {
@@ -309,14 +328,22 @@
touchPoint.normalPosition = QPointF(globalScreenPosition.x() / screenSize.width(),
globalScreenPosition.y() / screenSize.height());
- // We don't claim that our touch device supports QTouchDevice::Pressure,
- // but fill in a meaningfull value in case clients use it anyways.
- touchPoint.pressure = (state == Qt::TouchPointReleased) ? 0.0 : 1.0;
+ if (supportsPressure) {
+ // Note: iOS will deliver touchesBegan with a touch force of 0, which
+ // we will reflect/propagate as a 0 pressure, but there is no clear
+ // alternative, as we don't want to wait for a touchedMoved before
+ // sending a touch press event to Qt, just to have a valid pressure.
+ touchPoint.pressure = uiTouch.force / uiTouch.maximumPossibleForce;
+ } else {
+ // We don't claim that our touch device supports QTouchDevice::Pressure,
+ // but fill in a meaningfull value in case clients use it anyways.
+ touchPoint.pressure = (state == Qt::TouchPointReleased) ? 0.0 : 1.0;
+ }
}
}
}
-- (void) sendTouchEventWithTimestamp:(ulong)timeStamp
+- (void)sendTouchEventWithTimestamp:(ulong)timeStamp
{
// Send touch event synchronously
QIOSIntegration *iosIntegration = QIOSIntegration::instance();
diff --git a/src/plugins/platforms/kms/kms.json b/src/plugins/platforms/kms/kms.json
deleted file mode 100644
index be662226ae..0000000000
--- a/src/plugins/platforms/kms/kms.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "Keys": [ "kms" ]
-}
diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro
deleted file mode 100644
index baa8778153..0000000000
--- a/src/plugins/platforms/kms/kms.pro
+++ /dev/null
@@ -1,37 +0,0 @@
-TARGET = qkms
-
-PLUGIN_TYPE = platforms
-PLUGIN_CLASS_NAME = QKmsIntegrationPlugin
-!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
-load(qt_plugin)
-
-QT += core-private gui-private platformsupport-private
-qtHaveModule(opengl):QT += opengl-private
-
-DEFINES += MESA_EGL_NO_X11_HEADERS __GBM__
-
-CONFIG += link_pkgconfig egl qpa/genericunixfontdatabase
-
-PKGCONFIG += libdrm libudev egl gbm glesv2
-
-SOURCES = main.cpp \
- qkmsintegration.cpp \
- qkmsscreen.cpp \
- qkmscontext.cpp \
- qkmswindow.cpp \
- qkmscursor.cpp \
- qkmsdevice.cpp \
- qkmsbackingstore.cpp \
- qkmsnativeinterface.cpp
-
-HEADERS = qkmsintegration.h \
- qkmsscreen.h \
- qkmscontext.h \
- qkmswindow.h \
- qkmscursor.h \
- qkmsdevice.h \
- qkmsbackingstore.h \
- qkmsnativeinterface.h
-
-OTHER_FILES += \
- kms.json
diff --git a/src/plugins/platforms/kms/main.cpp b/src/plugins/platforms/kms/main.cpp
deleted file mode 100644
index 565ac7a7d4..0000000000
--- a/src/plugins/platforms/kms/main.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 <qpa/qplatformintegrationplugin.h>
-#include "qkmsintegration.h"
-
-QT_BEGIN_NAMESPACE
-
-class QKmsIntegrationPlugin : public QPlatformIntegrationPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "kms.json")
-public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
-};
-
-QPlatformIntegration *QKmsIntegrationPlugin::create(const QString& system, const QStringList& paramList)
-{
- Q_UNUSED(paramList);
- if (!system.compare(QLatin1String("kms"), Qt::CaseInsensitive))
- return new QKmsIntegration;
-
- return 0;
-}
-
-QT_END_NAMESPACE
-
-#include "main.moc"
diff --git a/src/plugins/platforms/kms/qkmsbackingstore.cpp b/src/plugins/platforms/kms/qkmsbackingstore.cpp
deleted file mode 100644
index 6e5a3f9192..0000000000
--- a/src/plugins/platforms/kms/qkmsbackingstore.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qkmsbackingstore.h"
-
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLShaderProgram>
-#include <QtGui/QScreen>
-
-QT_BEGIN_NAMESPACE
-
-QKmsBackingStore::QKmsBackingStore(QWindow *window)
- : QPlatformBackingStore(window)
- , m_context(new QOpenGLContext)
- , m_texture(0)
- , m_program(0)
- , m_initialized(false)
-{
- m_context->setFormat(window->requestedFormat());
- m_context->setScreen(window->screen());
- m_context->create();
-}
-
-QKmsBackingStore::~QKmsBackingStore()
-{
- delete m_program;
- if (m_texture)
- glDeleteTextures(1, &m_texture);
-
- delete m_context;
-}
-
-QPaintDevice *QKmsBackingStore::paintDevice()
-{
- return &m_image;
-}
-
-void QKmsBackingStore::beginPaint(const QRegion &rgn)
-{
- m_dirty |= rgn;
-}
-
-void QKmsBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
-{
- Q_UNUSED(region)
- Q_UNUSED(offset)
-
- m_context->makeCurrent(window);
-
- if (!m_initialized) {
- initializeOpenGLFunctions();
- m_initialized = true;
- }
-
- if (!m_program) {
- static const char *textureVertexProgram =
- "attribute highp vec2 vertexCoordEntry;\n"
- "attribute highp vec2 textureCoordEntry;\n"
- "varying highp vec2 textureCoord;\n"
- "void main() {\n"
- " textureCoord = textureCoordEntry;\n"
- " gl_Position = vec4(vertexCoordEntry, 0.0, 1.0);\n"
- "}\n";
-
- static const char *textureFragmentProgram =
- "uniform sampler2D texture;\n"
- "varying highp vec2 textureCoord;\n"
- "void main() {\n"
- " gl_FragColor = texture2D(texture, textureCoord).bgra;\n"
- "}\n";
-
- m_program = new QOpenGLShaderProgram;
-
- m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
- m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
- m_program->bindAttributeLocation("vertexCoordEntry", 0);
- m_program->bindAttributeLocation("textureCoordEntry", 1);
- m_program->link();
- }
-
- m_program->bind();
-
- QRectF r = window->geometry();
- QRectF sr = window->screen()->geometry();
-
- GLfloat x1 = (r.left() / sr.width()) * 2 - 1;
- GLfloat x2 = (r.right() / sr.width()) * 2 - 1;
- GLfloat y1 = -1 * ((r.top() / sr.height()) * 2 - 1);
- GLfloat y2 = -1 * ((r.bottom() / sr.height()) * 2 - 1);
-
- const GLfloat vertexCoordinates[] = {
- x1, y1,
- x2, y1,
- x2, y2,
- x1, y2
- };
-
- const GLfloat textureCoordinates[] = {
- 0, 0,
- 1, 0,
- 1, 1,
- 0, 1
- };
-
- glEnableVertexAttribArray(0);
- glEnableVertexAttribArray(1);
-
- glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinates);
- glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinates);
-
- glBindTexture(GL_TEXTURE_2D, m_texture);
-
- if (!m_dirty.isNull()) {
- QRect imageRect = m_image.rect();
- QRegion fixed;
- Q_FOREACH (const QRect &rect, m_dirty.rects()) {
- // intersect with image rect to be sure
- QRect r = imageRect & rect;
- // if the rect is wide enough it's cheaper to just
- // extend it instead of doing an image copy
- if (r.width() >= imageRect.width() / 2) {
- r.setX(0);
- r.setWidth(imageRect.width());
- }
- fixed |= r;
- }
-
- Q_FOREACH (const QRect &rect, fixed.rects()) {
- // if the sub-rect is full-width we can pass the image data directly to
- // OpenGL instead of copying, since there's no gap between scanlines
- if (rect.width() == imageRect.width()) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(),
- rect.width(), rect.height(),
- GL_RGBA, GL_UNSIGNED_BYTE,
- m_image.constScanLine(rect.y()));
- } else {
- glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(),
- rect.width(), rect.height(),
- GL_RGBA, GL_UNSIGNED_BYTE,
- m_image.copy(rect).constBits());
- }
- }
-
- m_dirty = QRegion();
- }
-
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- m_program->release();
- glBindTexture(GL_TEXTURE_2D, 0);
- glDisableVertexAttribArray(0);
- glDisableVertexAttribArray(1);
-
- m_context->swapBuffers(window);
-
- m_context->doneCurrent();
-}
-
-void QKmsBackingStore::resize(const QSize &size, const QRegion &staticContents)
-{
- Q_UNUSED(staticContents)
-
- m_image = QImage(size, QImage::Format_RGB32);
-
- m_context->makeCurrent(window());
-
- if (!m_initialized) {
- initializeOpenGLFunctions();
- m_initialized = true;
- }
-
- if (m_texture)
- glDeleteTextures(1, &m_texture);
-
- glGenTextures(1, &m_texture);
- glBindTexture(GL_TEXTURE_2D, m_texture);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(),
- 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmsbackingstore.h b/src/plugins/platforms/kms/qkmsbackingstore.h
deleted file mode 100644
index a34b10d3d9..0000000000
--- a/src/plugins/platforms/kms/qkmsbackingstore.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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_KMS_H
-#define QBACKINGSTORE_KMS_H
-
-#include <qpa/qplatformbackingstore.h>
-#include <QtGui/QOpenGLFunctions>
-#include <QImage>
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLContext;
-class QOpenGLShaderProgram;
-
-class QKmsBackingStore : public QPlatformBackingStore, public QOpenGLFunctions
-{
-public:
- QKmsBackingStore(QWindow *window);
- ~QKmsBackingStore();
-
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
-
- void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
-
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
-
- QImage toImage() const Q_DECL_OVERRIDE { return m_image; }
-
-private:
- QOpenGLContext *m_context;
- QImage m_image;
- uint m_texture;
- QOpenGLShaderProgram *m_program;
- QRegion m_dirty;
- bool m_initialized;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/kms/qkmscontext.cpp b/src/plugins/platforms/kms/qkmscontext.cpp
deleted file mode 100644
index e00835fbac..0000000000
--- a/src/plugins/platforms/kms/qkmscontext.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qkmsscreen.h"
-#include "qkmsdevice.h"
-#include "qkmscontext.h"
-#include "qkmswindow.h"
-#include "qkmsintegration.h"
-
-#include <QtGui/QOpenGLContext>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QKmsContext::QKmsContext(QOpenGLContext *context, QKmsDevice *device)
- : m_device(device)
-{
- EGLDisplay display = m_device->eglDisplay();
- EGLConfig config = q_configFromGLFormat(display, QKmsScreen::tweakFormat(context->format()));
- m_format = q_glFormatFromConfig(display, config);
-
- //Initialize EGLContext
- static EGLint contextAttribs[] = {
- EGL_CONTEXT_CLIENT_VERSION, context->format().majorVersion(),
- EGL_NONE
- };
-
- eglBindAPI(EGL_OPENGL_ES_API);
-
- EGLContext share = EGL_NO_CONTEXT;
- if (context->shareContext())
- share = static_cast<QKmsContext *>(context->shareContext()->handle())->eglContext();
-
- m_eglContext = eglCreateContext(display, config, share, contextAttribs);
- if (m_eglContext == EGL_NO_CONTEXT) {
- qWarning("QKmsContext::QKmsContext(): eglError: %x, this: %p",
- eglGetError(), this);
- m_eglContext = 0;
- }
-}
-
-bool QKmsContext::isValid() const
-{
- return m_eglContext != EGL_NO_CONTEXT;
-}
-
-bool QKmsContext::makeCurrent(QPlatformSurface *surface)
-{
- Q_ASSERT(surface->surface()->supportsOpenGL());
-
- EGLDisplay display = m_device->eglDisplay();
- EGLSurface eglSurface;
-
- if (surface->surface()->surfaceClass() == QSurface::Window) {
- QPlatformWindow *window = static_cast<QPlatformWindow *>(surface);
- QKmsScreen *screen = static_cast<QKmsScreen *>(QPlatformScreen::platformScreenForWindow(window->window()));
- eglSurface = screen->eglSurface();
- screen->waitForPageFlipComplete();
- } else {
- eglSurface = static_cast<QKmsOffscreenWindow *>(surface)->surface();
- }
-
- bool ok = eglMakeCurrent(display, eglSurface, eglSurface, m_eglContext);
- if (!ok)
- qWarning("QKmsContext::makeCurrent(): eglError: %x, this: %p",
- eglGetError(), this);
-
- return true;
-}
-
-void QKmsContext::doneCurrent()
-{
- bool ok = eglMakeCurrent(m_device->eglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE,
- EGL_NO_CONTEXT);
- if (!ok)
- qWarning("QKmsContext::doneCurrent(): eglError: %x, this: %p",
- eglGetError(), this);
-
-}
-
-void QKmsContext::swapBuffers(QPlatformSurface *surface)
-{
- //Cast context to a window surface and get the screen the context
- //is on and call swapBuffers on that screen.
- QPlatformWindow *window = static_cast<QPlatformWindow *>(surface);
- QKmsScreen *screen = static_cast<QKmsScreen *> (QPlatformScreen::platformScreenForWindow(window->window()));
- screen->swapBuffers();
-}
-
-void (*QKmsContext::getProcAddress(const QByteArray &procName)) ()
-{
- return eglGetProcAddress(procName.data());
-}
-
-
-EGLContext QKmsContext::eglContext() const
-{
- return m_eglContext;
-}
-
-QSurfaceFormat QKmsContext::format() const
-{
- return m_format;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmscontext.h b/src/plugins/platforms/kms/qkmscontext.h
deleted file mode 100644
index 59cf9b1e34..0000000000
--- a/src/plugins/platforms/kms/qkmscontext.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QKMSCONTEXT_H
-#define QKMSCONTEXT_H
-
-#include <qpa/qplatformopenglcontext.h>
-
-#define EGL_EGLEXT_PROTOTYPES 1
-#include <EGL/egl.h>
-
-QT_BEGIN_NAMESPACE
-
-class QKmsDevice;
-
-class QKmsContext : public QPlatformOpenGLContext
-{
-public:
- QKmsContext(QOpenGLContext *context, QKmsDevice *device);
-
- bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- void doneCurrent() Q_DECL_OVERRIDE;
- void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
-
- bool isValid() const Q_DECL_OVERRIDE;
-
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
-
- EGLContext eglContext() const;
-
-private:
- EGLContext m_eglContext;
- QSurfaceFormat m_format;
-
- QKmsDevice *m_device;
-};
-
-QT_END_NAMESPACE
-
-#endif // QKMSCONTEXT_H
diff --git a/src/plugins/platforms/kms/qkmscursor.cpp b/src/plugins/platforms/kms/qkmscursor.cpp
deleted file mode 100644
index 44212cd3c8..0000000000
--- a/src/plugins/platforms/kms/qkmscursor.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 <QDebug>
-#include "qkmscursor.h"
-#include "qkmsscreen.h"
-#include "qkmsdevice.h"
-
-QT_BEGIN_NAMESPACE
-
-#ifndef DRM_CAP_CURSOR_WIDTH
-#define DRM_CAP_CURSOR_WIDTH 0x8
-#endif
-
-#ifndef DRM_CAP_CURSOR_HEIGHT
-#define DRM_CAP_CURSOR_HEIGHT 0x9
-#endif
-
-QKmsCursor::QKmsCursor(QKmsScreen *screen)
- : m_screen(screen),
- m_graphicsBufferManager(screen->device()->gbmDevice()),
- m_cursorImage(new QPlatformCursorImage(0, 0, 0, 0, 0, 0)),
- m_moved(false),
- m_cursorSize(64, 64)
-{
- uint64_t value = 0;
- if (!drmGetCap(m_screen->device()->fd(), DRM_CAP_CURSOR_WIDTH, &value))
- m_cursorSize.setWidth(value);
- if (!drmGetCap(m_screen->device()->fd(), DRM_CAP_CURSOR_HEIGHT, &value))
- m_cursorSize.setHeight(value);
-
- m_cursorBufferObject = gbm_bo_create(m_graphicsBufferManager, m_cursorSize.width(), m_cursorSize.height(),
- GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE);
-}
-
-QKmsCursor::~QKmsCursor()
-{
- drmModeSetCursor(m_screen->device()->fd(), m_screen->crtcId(), 0, 0, 0);
- gbm_bo_destroy(m_cursorBufferObject);
-}
-
-void QKmsCursor::pointerEvent(const QMouseEvent &event)
-{
- m_moved = true;
- int status = drmModeMoveCursor(m_screen->device()->fd(),
- m_screen->crtcId(),
- event.globalX(),
- event.globalY());
- if (status) {
- qWarning("failed to move cursor: %d", status);
- }
-}
-
-void QKmsCursor::changeCursor(QCursor *windowCursor, QWindow *window)
-{
- Q_UNUSED(window)
-
- if (!m_moved)
- drmModeMoveCursor(m_screen->device()->fd(), m_screen->crtcId(), 0, 0);
-
- const Qt::CursorShape newShape = windowCursor ? windowCursor->shape() : Qt::ArrowCursor;
- if (newShape != Qt::BitmapCursor) {
- m_cursorImage->set(newShape);
- } else {
- m_cursorImage->set(windowCursor->pixmap().toImage(),
- windowCursor->hotSpot().x(),
- windowCursor->hotSpot().y());
- }
-
- if (m_cursorImage->image()->width() > m_cursorSize.width() || m_cursorImage->image()->width() > m_cursorSize.height())
- qWarning("cursor larger than %dx%d, cursor truncated", m_cursorSize.width(), m_cursorSize.height());
-
- QImage cursorImage = m_cursorImage->image()->convertToFormat(QImage::Format_ARGB32)
- .copy(0, 0, m_cursorSize.width(), m_cursorSize.height());
- gbm_bo_write(m_cursorBufferObject, cursorImage.constBits(), cursorImage.byteCount());
-
- quint32 handle = gbm_bo_get_handle(m_cursorBufferObject).u32;
- int status = drmModeSetCursor(m_screen->device()->fd(),
- m_screen->crtcId(), handle,
- m_cursorSize.width(), m_cursorSize.height());
-
- if (status) {
- qWarning("failed to set cursor: %d", status);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmscursor.h b/src/plugins/platforms/kms/qkmscursor.h
deleted file mode 100644
index 9aadf407c0..0000000000
--- a/src/plugins/platforms/kms/qkmscursor.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QKMSCURSOR_H
-#define QKMSCURSOR_H
-
-#include <qpa/qplatformcursor.h>
-
-struct gbm_device;
-struct gbm_bo;
-
-QT_BEGIN_NAMESPACE
-
-class QKmsScreen;
-
-class QKmsCursor : public QPlatformCursor
-{
-public:
- QKmsCursor(QKmsScreen *screen);
- ~QKmsCursor();
-
- void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE;
- void changeCursor(QCursor *windowCursor, QWindow *window) Q_DECL_OVERRIDE;
-
-private:
- QKmsScreen *m_screen;
- gbm_device *m_graphicsBufferManager;
- gbm_bo *m_cursorBufferObject;
- QPlatformCursorImage *m_cursorImage;
- bool m_moved;
- QSize m_cursorSize;
-};
-
-QT_END_NAMESPACE
-
-#endif // QKMSCURSOR_H
diff --git a/src/plugins/platforms/kms/qkmsdevice.cpp b/src/plugins/platforms/kms/qkmsdevice.cpp
deleted file mode 100644
index 74fa59c16a..0000000000
--- a/src/plugins/platforms/kms/qkmsdevice.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 <QDebug>
-#include "qkmsscreen.h"
-#include "qkmsdevice.h"
-
-#include "qkmsintegration.h"
-
-#include <QtCore/QSocketNotifier>
-#include <QtCore/private/qcore_unix_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QKmsDevice::QKmsDevice(const QString &path, QKmsIntegration *parent) :
- QObject(0), m_integration(parent)
-{
- m_fd = QT_OPEN(path.toLatin1().constData(), O_RDWR);
- if (m_fd < 0) {
- qWarning("Could not open %s.", path.toLatin1().constData());
- qFatal("No DRM display device");
- }
-
- m_graphicsBufferManager = gbm_create_device(m_fd);
- m_eglDisplay = eglGetDisplay(m_graphicsBufferManager);
-
- if (m_eglDisplay == EGL_NO_DISPLAY) {
- qWarning("Could not open EGL display");
- qFatal("EGL error");
- }
-
- EGLint major;
- EGLint minor;
- if (!eglInitialize(m_eglDisplay, &major, &minor)) {
- qWarning("Could not initialize EGL display");
- qFatal("EGL error");
- }
-
- createScreens();
-
-// QSocketNotifier *notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
-// connect(notifier, SIGNAL(activated(int)), this, SLOT(handlePageFlipCompleted()));
-}
-
-QKmsDevice::~QKmsDevice()
-{
-}
-
-void QKmsDevice::createScreens()
-{
- drmModeRes *resources = drmModeGetResources(m_fd);
- if (!resources)
- qFatal("drmModeGetResources failed");
-
- //Iterate connectors and create screens on each one active
- for (int i = 0; i < resources->count_connectors; i++) {
- drmModeConnector *connector = 0;
- connector = drmModeGetConnector(m_fd, resources->connectors[i]);
- if (connector && connector->connection == DRM_MODE_CONNECTED) {
- m_integration->addScreen(new QKmsScreen(this, resources, connector));
- }
- drmModeFreeConnector(connector);
- }
- drmModeFreeResources(resources);
-}
-
-void QKmsDevice::handlePageFlipCompleted()
-{
- drmEventContext eventContext;
-
- memset(&eventContext, 0, sizeof eventContext);
- eventContext.version = DRM_EVENT_CONTEXT_VERSION;
- eventContext.page_flip_handler = QKmsDevice::pageFlipHandler;
- drmHandleEvent(m_fd, &eventContext);
-
-}
-
-void QKmsDevice::pageFlipHandler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data)
-{
- Q_UNUSED(fd)
- Q_UNUSED(frame)
- Q_UNUSED(sec)
- Q_UNUSED(usec)
-
- QKmsScreen *screen = static_cast<QKmsScreen *>(data);
- screen->handlePageFlipped();
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmsdevice.h b/src/plugins/platforms/kms/qkmsdevice.h
deleted file mode 100644
index d5e33cb8c7..0000000000
--- a/src/plugins/platforms/kms/qkmsdevice.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QKMSDEVICE_H
-#define QKMSDEVICE_H
-
-#include <stddef.h>
-
-extern "C" {
-#include <gbm.h>
-}
-#include <EGL/egl.h>
-
-#include <QObject>
-
-struct gbm_device;
-
-QT_BEGIN_NAMESPACE
-
-class QKmsIntegration;
-
-class QKmsDevice : public QObject
-{
- Q_OBJECT
-public:
- explicit QKmsDevice(const QString &path, QKmsIntegration *parent);
- ~QKmsDevice();
-
- EGLDisplay eglDisplay() { return m_eglDisplay; }
- gbm_device *gbmDevice() { return m_graphicsBufferManager; }
- int fd() const { return m_fd; }
-
- static void pageFlipHandler(int fd, unsigned int frame, unsigned int sec,
- unsigned int usec, void *data);
-
-public slots:
- void handlePageFlipCompleted();
-private:
- void createScreens();
-
- QKmsIntegration *m_integration;
-
- EGLDisplay m_eglDisplay;
- EGLContext m_eglContext;
- gbm_device *m_graphicsBufferManager;
- int m_fd;
-};
-
-QT_END_NAMESPACE
-
-#endif // QKMSDEVICE_H
diff --git a/src/plugins/platforms/kms/qkmsintegration.cpp b/src/plugins/platforms/kms/qkmsintegration.cpp
deleted file mode 100644
index f48c868ae5..0000000000
--- a/src/plugins/platforms/kms/qkmsintegration.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qkmsintegration.h"
-#include "qkmsdevice.h"
-#include "qkmsscreen.h"
-#include "qkmswindow.h"
-#include "qkmsbackingstore.h"
-#include "qkmscontext.h"
-#include "qkmsnativeinterface.h"
-
-#if !defined(QT_NO_EVDEV)
-#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
-#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
-#include <QtPlatformSupport/private/qevdevtouch_p.h>
-#endif
-
-#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
-#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtPlatformSupport/private/qfbvthandler_p.h>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
-
-#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QScreen>
-#include <QtGui/QOffscreenSurface>
-#include <qpa/qplatformoffscreensurface.h>
-
-QT_BEGIN_NAMESPACE
-
-QKmsIntegration::QKmsIntegration()
- : QPlatformIntegration(),
- m_fontDatabase(new QGenericUnixFontDatabase()),
- m_nativeInterface(new QKmsNativeInterface),
- m_vtHandler(0),
- m_deviceDiscovery(0)
-{
-}
-
-QKmsIntegration::~QKmsIntegration()
-{
- delete m_deviceDiscovery;
- foreach (QKmsDevice *device, m_devices) {
- delete device;
- }
- foreach (QPlatformScreen *screen, m_screens) {
- destroyScreen(screen);
- }
- delete m_fontDatabase;
- delete m_vtHandler;
-}
-
-void QKmsIntegration::initialize()
-{
- qputenv("EGL_PLATFORM", "drm");
- m_vtHandler = new QFbVtHandler;
-
- m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_DRM | QDeviceDiscovery::Device_DRM_PrimaryGPU, 0);
- if (m_deviceDiscovery) {
- QStringList devices = m_deviceDiscovery->scanConnectedDevices();
- foreach (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)));
- }
-
-#if !defined(QT_NO_EVDEV)
- new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
- new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
- new QEvdevTouchScreenHandlerThread(QString() /* spec */, this);
-#endif
-}
-
-void QKmsIntegration::addDevice(const QString &deviceNode)
-{
- m_devices.append(new QKmsDevice(deviceNode, this));
-}
-
-void QKmsIntegration::removeDevice(const QString &deviceNode)
-{
- // TODO: support hot-plugging some day?
- Q_UNUSED(deviceNode);
-}
-
-bool QKmsIntegration::hasCapability(QPlatformIntegration::Capability cap) const
-{
- switch (cap) {
- case ThreadedPixmaps: return true;
- case OpenGL: return true;
- case ThreadedOpenGL: return false;
- case RasterGLSurface: return true;
- default: return QPlatformIntegration::hasCapability(cap);
- }
-}
-
-QPlatformOpenGLContext *QKmsIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
-{
- QKmsScreen *screen = static_cast<QKmsScreen *>(context->screen()->handle());
- return new QKmsContext(context, screen->device());
-}
-
-QPlatformWindow *QKmsIntegration::createPlatformWindow(QWindow *window) const
-{
- QKmsWindow *w = new QKmsWindow(window);
- w->requestActivateWindow();
- return w;
-}
-
-QPlatformBackingStore *QKmsIntegration::createPlatformBackingStore(QWindow *window) const
-{
- return new QKmsBackingStore(window);
-}
-
-// Neither a pbuffer nor a hidden QWindow is suitable. Just use an additional, small gbm surface.
-QKmsOffscreenWindow::QKmsOffscreenWindow(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface)
- : QPlatformOffscreenSurface(offscreenSurface)
- , m_format(format)
- , m_display(display)
- , m_surface(EGL_NO_SURFACE)
- , m_window(0)
-{
- QKmsScreen *screen = static_cast<QKmsScreen *>(offscreenSurface->screen()->handle());
- m_window = gbm_surface_create(screen->device()->gbmDevice(),
- 10, 10,
- GBM_FORMAT_XRGB8888,
- GBM_BO_USE_RENDERING);
- if (!m_window) {
- qWarning("QKmsOffscreenWindow: Failed to create native window");
- return;
- }
-
- EGLConfig config = q_configFromGLFormat(m_display, m_format);
- m_surface = eglCreateWindowSurface(m_display, config, m_window, 0);
- if (m_surface != EGL_NO_SURFACE)
- m_format = q_glFormatFromConfig(m_display, config);
-}
-
-QKmsOffscreenWindow::~QKmsOffscreenWindow()
-{
- if (m_surface != EGL_NO_SURFACE)
- eglDestroySurface(m_display, m_surface);
- if (m_window)
- gbm_surface_destroy((gbm_surface *) m_window);
-}
-
-QPlatformOffscreenSurface *QKmsIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
-{
- QKmsScreen *screen = static_cast<QKmsScreen *>(surface->screen()->handle());
- return new QKmsOffscreenWindow(screen->device()->eglDisplay(), QKmsScreen::tweakFormat(surface->format()), surface);
-}
-
-QPlatformFontDatabase *QKmsIntegration::fontDatabase() const
-{
- return m_fontDatabase;
-}
-
-void QKmsIntegration::addScreen(QKmsScreen *screen)
-{
- m_screens.append(screen);
- screenAdded(screen);
-}
-
-QAbstractEventDispatcher *QKmsIntegration::createEventDispatcher() const
-{
- return createUnixEventDispatcher();
-}
-
-QPlatformNativeInterface *QKmsIntegration::nativeInterface() const
-{
- return m_nativeInterface;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmsintegration.h b/src/plugins/platforms/kms/qkmsintegration.h
deleted file mode 100644
index bcf9ac7296..0000000000
--- a/src/plugins/platforms/kms/qkmsintegration.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QPLATFORMINTEGRATION_KMS_H
-#define QPLATFORMINTEGRATION_KMS_H
-
-#include <qpa/qplatformintegration.h>
-#include <qpa/qplatformnativeinterface.h>
-#include <qpa/qplatformoffscreensurface.h>
-#include <QtPlatformSupport/private/qdevicediscovery_p.h>
-#include <EGL/egl.h>
-
-QT_BEGIN_NAMESPACE
-
-class QKmsScreen;
-class QKmsDevice;
-class QFbVtHandler;
-
-class QKmsOffscreenWindow : public QPlatformOffscreenSurface
-{
-public:
- QKmsOffscreenWindow(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface);
- ~QKmsOffscreenWindow();
-
- QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; }
- bool isValid() const Q_DECL_OVERRIDE { return m_surface != EGL_NO_SURFACE; }
-
- EGLSurface surface() const { return m_surface; }
-
-private:
- QSurfaceFormat m_format;
- EGLDisplay m_display;
- EGLSurface m_surface;
- EGLNativeWindowType m_window;
-};
-
-class QKmsIntegration : public QObject, public QPlatformIntegration
-{
- Q_OBJECT
-
-public:
- QKmsIntegration();
- ~QKmsIntegration();
-
- void initialize() Q_DECL_OVERRIDE;
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
-
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
-
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
-
- QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
-
- void addScreen(QKmsScreen *screen);
- QObject *createDevice(const char *);
-
-private slots:
- void addDevice(const QString &deviceNode);
- void removeDevice(const QString &deviceNode);
-
-private:
- QStringList findDrmDevices();
-
- QList<QPlatformScreen *> m_screens;
- QList<QKmsDevice *> m_devices;
- QPlatformFontDatabase *m_fontDatabase;
- QPlatformNativeInterface *m_nativeInterface;
- QFbVtHandler *m_vtHandler;
- QDeviceDiscovery *m_deviceDiscovery;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.cpp b/src/plugins/platforms/kms/qkmsnativeinterface.cpp
deleted file mode 100644
index 1538a7f8c3..0000000000
--- a/src/plugins/platforms/kms/qkmsnativeinterface.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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/qguiapplication_p.h>
-#include "qkmsnativeinterface.h"
-#include "qkmsdevice.h"
-
-#include "qscreen.h"
-#include "qkmscontext.h"
-#include <QOpenGLContext>
-
-class QKmsResourceMap : public QMap<QByteArray, QKmsNativeInterface::ResourceType>
-{
-public:
- QKmsResourceMap()
- :QMap<QByteArray, QKmsNativeInterface::ResourceType>()
- {
- insert("egldisplay", QKmsNativeInterface::EglDisplay);
- insert("eglcontext", QKmsNativeInterface::EglContext);
- }
-};
-
-Q_GLOBAL_STATIC(QKmsResourceMap, qKmsResourceMap)
-
-void *QKmsNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
-{
- QByteArray lowerCaseResource = resourceString.toLower();
- ResourceType resource = qKmsResourceMap()->value(lowerCaseResource);
- void *result = 0;
- switch (resource) {
- case EglDisplay:
- result = eglDisplay();
- break;
- default:
- result = 0;
- }
- return result;
-
-}
-void *QKmsNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
-{
- QByteArray lowerCaseResource = resourceString.toLower();
- ResourceType resource = qKmsResourceMap()->value(lowerCaseResource);
- void *result = 0;
- switch (resource) {
- case EglDisplay:
- result = eglDisplayForWindow(window);
- break;
- case EglContext:
- result = eglContextForWindow(window);
- break;
- default:
- result = 0;
- }
- return result;
-}
-
-QPlatformNativeInterface::NativeResourceForContextFunction QKmsNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource)
-{
- QByteArray lowerCaseResource = resource.toLower();
- if (lowerCaseResource == "get_egl_context") {
- return eglContextForContext;
- }
- return 0;
-}
-
-void *QKmsNativeInterface::eglDisplay()
-{
- //QKmsIntegration *integration = static_cast<QKmsIntegration *>(QGuiApplicationPrivate::platformIntegration());
- QKmsScreen *screen = static_cast<QKmsScreen *>(QGuiApplication::primaryScreen()->handle());
- if (!screen || !screen->device())
- return 0;
- return screen->device()->eglDisplay();
-}
-
-void *QKmsNativeInterface::eglDisplayForWindow(QWindow *window)
-{
- QKmsScreen *screen = qPlatformScreenForWindow(window);
- if (!screen)
- return 0;
- QKmsDevice *device = screen->device();
- if (!device)
- return 0;
- return device->eglDisplay();
-}
-
-void *QKmsNativeInterface::eglContextForWindow(QWindow *)
-{
- return 0;
-}
-
-QKmsScreen *QKmsNativeInterface::qPlatformScreenForWindow(QWindow *window)
-{
- QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
- return static_cast<QKmsScreen *>(screen->handle());
-}
-
-void *QKmsNativeInterface::eglContextForContext(QOpenGLContext *context)
-{
- Q_ASSERT(context);
-
- QKmsContext *eglPlatformContext = static_cast<QKmsContext *>(context->handle());
-
- return eglPlatformContext->eglContext();
-}
diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.h b/src/plugins/platforms/kms/qkmsnativeinterface.h
deleted file mode 100644
index 56879d0a3a..0000000000
--- a/src/plugins/platforms/kms/qkmsnativeinterface.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QKMSNATIVEINTERFACE_H
-#define QKMSNATIVEINTERFACE_H
-
-#include "qkmsscreen.h"
-
-#include <qpa/qplatformnativeinterface.h>
-
-class QKmsNativeInterface : public QPlatformNativeInterface
-{
-public:
- enum ResourceType {
- EglDisplay,
- EglContext
- };
-
- void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
- void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE;
-
- NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE;
-
- void *eglDisplay();
- void *eglDisplayForWindow(QWindow *window);
- void *eglContextForWindow(QWindow *window);
- static void *eglContextForContext(QOpenGLContext *context);
-
-private:
- static QKmsScreen *qPlatformScreenForWindow(QWindow *window);
-};
-
-
-#endif // QKMSNATIVEINTERFACE_H
diff --git a/src/plugins/platforms/kms/qkmsscreen.cpp b/src/plugins/platforms/kms/qkmsscreen.cpp
deleted file mode 100644
index 6392b99cd5..0000000000
--- a/src/plugins/platforms/kms/qkmsscreen.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qkmsscreen.h"
-#include "qkmscursor.h"
-#include "qkmsdevice.h"
-#include "qkmscontext.h"
-
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
-
-#include <QCoreApplication>
-#include <QtDebug>
-
-QT_BEGIN_NAMESPACE
-
-Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.kms.screen")
-
-//Fallback mode (taken from Wayland DRM demo compositor)
-static drmModeModeInfo builtin_1024x768 = {
- 63500, //clock
- 1024, 1072, 1176, 1328, 0,
- 768, 771, 775, 798, 0,
- 59920,
- DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC,
- 0,
- "1024x768"
-};
-
-QKmsScreen::QKmsScreen(QKmsDevice *device, const drmModeRes *resources, const drmModeConnector *connector)
- : m_device(device),
- m_current_bo(0),
- m_next_bo(0),
- m_connectorId(connector->connector_id),
- m_depth(32),
- m_format(QImage::Format_Invalid),
- m_eglWindowSurface(EGL_NO_SURFACE),
- m_modeSet(false)
-{
- m_cursor = new QKmsCursor(this);
- initializeScreenMode(resources, connector);
-}
-
-QKmsScreen::~QKmsScreen()
-{
- delete m_cursor;
- drmModeSetCrtc(m_device->fd(), m_oldCrtc->crtc_id, m_oldCrtc->buffer_id,
- m_oldCrtc->x, m_oldCrtc->y,
- &m_connectorId, 1, &m_oldCrtc->mode);
- drmModeFreeCrtc(m_oldCrtc);
- if (m_eglWindowSurface != EGL_NO_SURFACE)
- eglDestroySurface(m_device->eglDisplay(), m_eglWindowSurface);
- gbm_surface_destroy(m_gbmSurface);
-}
-
-QRect QKmsScreen::geometry() const
-{
- return m_geometry;
-}
-
-int QKmsScreen::depth() const
-{
- return m_depth;
-}
-
-QImage::Format QKmsScreen::format() const
-{
- return m_format;
-}
-
-QSizeF QKmsScreen::physicalSize() const
-{
- return m_physicalSize;
-}
-
-QPlatformCursor *QKmsScreen::cursor() const
-{
- return m_cursor;
-}
-
-void QKmsScreen::initializeScreenMode(const drmModeRes *resources, const drmModeConnector *connector)
-{
- //Determine optimal mode for screen
- drmModeModeInfo *mode = 0;
- for (int i = 0; i < connector->count_modes; ++i) {
- if (connector->modes[i].type & DRM_MODE_TYPE_PREFERRED) {
- mode = &connector->modes[i];
- break;
- }
- }
- if (!mode) {
- if (connector->count_modes > 0)
- mode = &connector->modes[0];
- else
- mode = &builtin_1024x768;
- }
-
- drmModeEncoder *encoder = drmModeGetEncoder(m_device->fd(), connector->encoders[0]);
- if (encoder == 0)
- qFatal("No encoder for connector.");
-
- int i;
- for (i = 0; i < resources->count_crtcs; i++) {
- if (encoder->possible_crtcs & (1 << i))
- break;
- }
- if (i == resources->count_crtcs)
- qFatal("No usable crtc for encoder.");
-
- m_oldCrtc = drmModeGetCrtc(m_device->fd(), encoder->crtc_id);
-
- m_crtcId = resources->crtcs[i];
- m_mode = *mode;
- m_geometry = QRect(0, 0, m_mode.hdisplay, m_mode.vdisplay);
- qCDebug(lcQpaScreen) << "kms initialized with geometry" << m_geometry;
- m_depth = 32;
- m_format = QImage::Format_RGB32;
- m_physicalSize = QSizeF(connector->mmWidth, connector->mmHeight);
-
- m_gbmSurface = gbm_surface_create(m_device->gbmDevice(),
- m_mode.hdisplay, m_mode.vdisplay,
- GBM_BO_FORMAT_XRGB8888,
- GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
-
- qCDebug(lcQpaScreen) << "created gbm surface" << m_gbmSurface << m_mode.hdisplay << m_mode.vdisplay;
- //Cleanup
- drmModeFreeEncoder(encoder);
-}
-
-QSurfaceFormat QKmsScreen::tweakFormat(const QSurfaceFormat &format)
-{
- QSurfaceFormat fmt = format;
- fmt.setRedBufferSize(8);
- fmt.setGreenBufferSize(8);
- fmt.setBlueBufferSize(8);
- if (fmt.alphaBufferSize() != -1)
- fmt.setAlphaBufferSize(8);
- return fmt;
-}
-
-void QKmsScreen::initializeWithFormat(const QSurfaceFormat &format)
-{
- EGLDisplay display = m_device->eglDisplay();
- EGLConfig config = q_configFromGLFormat(display, tweakFormat(format));
-
- m_eglWindowSurface = eglCreateWindowSurface(display, config, (EGLNativeWindowType)m_gbmSurface, NULL);
- qCDebug(lcQpaScreen) << "created window surface";
- m_surfaceFormat = q_glFormatFromConfig(display, config);
-}
-
-void QKmsScreen::swapBuffers()
-{
- eglSwapBuffers(m_device->eglDisplay(), m_eglWindowSurface);
-
- m_next_bo = gbm_surface_lock_front_buffer(m_gbmSurface);
- if (!m_next_bo)
- qFatal("kms: Failed to lock front buffer");
-
- performPageFlip();
-}
-
-void QKmsScreen::performPageFlip()
-{
- if (!m_next_bo)
- return;
-
- uint32_t width = gbm_bo_get_width(m_next_bo);
- uint32_t height = gbm_bo_get_height(m_next_bo);
- uint32_t stride = gbm_bo_get_stride(m_next_bo);
- uint32_t handle = gbm_bo_get_handle(m_next_bo).u32;
-
- uint32_t fb_id;
- int ret = drmModeAddFB(m_device->fd(), width, height, 24, 32,
- stride, handle, &fb_id);
- if (ret) {
- qFatal("kms: Failed to create fb: fd %d, w %d, h %d, stride %d, handle %d, ret %d",
- m_device->fd(), width, height, stride, handle, ret);
- }
-
- if (!m_modeSet) {
- //Set the Mode of the screen.
- int ret = drmModeSetCrtc(m_device->fd(), m_crtcId, fb_id,
- 0, 0, &m_connectorId, 1, &m_mode);
- if (ret)
- qFatal("failed to set mode");
- m_modeSet = true;
-
- // Initialize cursor
-
- static int hideCursor = qEnvironmentVariableIntValue("QT_QPA_KMS_HIDECURSOR");
- if (!hideCursor) {
- QCursor cursor(Qt::ArrowCursor);
- m_cursor->changeCursor(&cursor, 0);
- }
- }
-
- int pageFlipStatus = drmModePageFlip(m_device->fd(), m_crtcId,
- fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, this);
- if (pageFlipStatus)
- {
- qWarning("Pageflip status: %d", pageFlipStatus);
- gbm_surface_release_buffer(m_gbmSurface, m_next_bo);
- m_next_bo = 0;
- }
-}
-
-void QKmsScreen::handlePageFlipped()
-{
- if (m_current_bo)
- gbm_surface_release_buffer(m_gbmSurface, m_current_bo);
-
- m_current_bo = m_next_bo;
- m_next_bo = 0;
-}
-
-QKmsDevice * QKmsScreen::device() const
-{
- return m_device;
-}
-
-void QKmsScreen::waitForPageFlipComplete()
-{
- while (m_next_bo) {
-#if 0
- //Check manually if there is something to be read on the device
- //as there are senarios where the signal is not received (starvation)
- fd_set fdSet;
- timeval timeValue;
- int returnValue;
-
- FD_ZERO(&fdSet);
- FD_SET(m_device->fd(), &fdSet);
- timeValue.tv_sec = 0;
- timeValue.tv_usec = 1000;
-
- returnValue = select(1, &fdSet, 0, 0, &timeValue);
- printf("select returns %d\n", returnValue);
-#endif
-
- m_device->handlePageFlipCompleted();
- }
-}
-
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmsscreen.h b/src/plugins/platforms/kms/qkmsscreen.h
deleted file mode 100644
index c52d0211b3..0000000000
--- a/src/plugins/platforms/kms/qkmsscreen.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QKMSSCREEN_H
-#define QKMSSCREEN_H
-
-#include <stddef.h>
-
-#define EGL_EGLEXT_PROTOTYPES 1
-#define GL_GLEXT_PROTOTYPES 1
-
-extern "C" {
-#include <gbm.h>
-#include <xf86drmMode.h>
-#include <xf86drm.h>
-}
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <QtGui/qopengl.h>
-#include <QtGui/qsurfaceformat.h>
-#include <QtCore/qloggingcategory.h>
-
-#include <qpa/qplatformscreen.h>
-
-QT_BEGIN_NAMESPACE
-
-Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen)
-
-class QKmsCursor;
-class QKmsDevice;
-class QKmsContext;
-
-class QKmsScreen : public QPlatformScreen
-{
-public:
- QKmsScreen(QKmsDevice *device, const drmModeRes *resources, const drmModeConnector *connector);
- ~QKmsScreen();
-
- QRect geometry() const Q_DECL_OVERRIDE;
- int depth() const Q_DECL_OVERRIDE;
- QImage::Format format() const Q_DECL_OVERRIDE;
- QSizeF physicalSize() const Q_DECL_OVERRIDE;
- QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
-
- quint32 crtcId() const { return m_crtcId; }
- QKmsDevice *device() const;
-
- void initializeWithFormat(const QSurfaceFormat &format);
-
- //Called by context for each screen
- void swapBuffers();
- void handlePageFlipped();
-
- EGLSurface eglSurface() const { return m_eglWindowSurface; }
-
- void waitForPageFlipComplete();
-
- static QSurfaceFormat tweakFormat(const QSurfaceFormat &format);
-
- QSurfaceFormat surfaceFormat() const { return m_surfaceFormat; }
-
-private:
- void performPageFlip();
- void initializeScreenMode(const drmModeRes *resources, const drmModeConnector *connector);
-
- QKmsDevice *m_device;
- gbm_bo *m_current_bo;
- gbm_bo *m_next_bo;
- quint32 m_connectorId;
-
- quint32 m_crtcId;
- drmModeModeInfo m_mode;
- QRect m_geometry;
- QSizeF m_physicalSize;
- int m_depth;
- QImage::Format m_format;
-
- drmModeCrtcPtr m_oldCrtc;
-
- QKmsCursor *m_cursor;
-
- gbm_surface *m_gbmSurface;
- EGLSurface m_eglWindowSurface;
-
- bool m_modeSet;
- QSurfaceFormat m_surfaceFormat;
-};
-
-QT_END_NAMESPACE
-
-#endif // QKMSSCREEN_H
diff --git a/src/plugins/platforms/kms/qkmswindow.cpp b/src/plugins/platforms/kms/qkmswindow.cpp
deleted file mode 100644
index 3b01dfedca..0000000000
--- a/src/plugins/platforms/kms/qkmswindow.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qkmswindow.h"
-#include "qkmsscreen.h"
-
-#include <qpa/qwindowsysteminterface.h>
-#include <qpa/qplatformwindow_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QKmsWindow::QKmsWindow(QWindow *window)
- : QPlatformWindow(window)
-{
- Q_D(QPlatformWindow);
- m_screen = QPlatformScreen::platformScreenForWindow(window);
- static_cast<QKmsScreen *>(m_screen)->initializeWithFormat(window->requestedFormat());
- setGeometry(d->rect); // rect is set to window->geometry() in base ctor
-}
-
-void QKmsWindow::setGeometry(const QRect &rect)
-{
- // All windows must be fullscreen
- QRect fullscreenRect = m_screen->availableGeometry();
- if (rect != fullscreenRect)
- QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect);
-
- QPlatformWindow::setGeometry(fullscreenRect);
-}
-
-QSurfaceFormat QKmsWindow::format() const
-{
- return static_cast<QKmsScreen *>(m_screen)->surfaceFormat();
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmswindow.h b/src/plugins/platforms/kms/qkmswindow.h
deleted file mode 100644
index aec6d55b5d..0000000000
--- a/src/plugins/platforms/kms/qkmswindow.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QKMSWINDOW_H
-#define QKMSWINDOW_H
-
-#include <qpa/qplatformwindow.h>
-
-QT_BEGIN_NAMESPACE
-
-class QKmsWindow : public QPlatformWindow
-{
- Q_DECLARE_PRIVATE(QPlatformWindow)
-
-public:
- QKmsWindow(QWindow *window);
-
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
-
-private:
- QPlatformScreen *m_screen;
-};
-
-QT_END_NAMESPACE
-
-#endif // QKMSWINDOW_H
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
index ccf86dafb2..8c8c8a15ea 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
@@ -46,6 +46,10 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
+#ifndef QT_NO_LIBINPUT
+#include <QtPlatformSupport/private/qlibinputhandler_p.h>
+#endif
+
#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
@@ -130,6 +134,13 @@ QPlatformServices *QLinuxFbIntegration::services() const
void QLinuxFbIntegration::createInputHandlers()
{
+#ifndef QT_NO_LIBINPUT
+ if (!qEnvironmentVariableIntValue("QT_QPA_FB_NO_LIBINPUT")) {
+ new QLibInputHandler(QLatin1String("libinput"), QString());
+ return;
+ }
+#endif
+
#if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this);
new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this);
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index ef96985f1a..1bcb22618e 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -37,7 +37,15 @@
#include "qminimaleglbackingstore.h"
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+
+#if defined(Q_OS_UNIX)
+# include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+#elif defined(Q_OS_WINRT)
+# include <QtCore/private/qeventdispatcher_winrt_p.h>
+# include <QtGui/qpa/qwindowsysteminterface.h>
+#elif defined(Q_OS_WIN)
+# include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+#endif
#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
@@ -48,6 +56,29 @@
QT_BEGIN_NAMESPACE
+#ifdef Q_OS_WINRT
+namespace {
+class QWinRTEventDispatcher : public QEventDispatcherWinRT {
+public:
+ QWinRTEventDispatcher() {}
+
+protected:
+ bool hasPendingEvents() Q_DECL_OVERRIDE
+ {
+ return QEventDispatcherWinRT::hasPendingEvents() || QWindowSystemInterface::windowSystemEventsQueued();
+ }
+
+ bool sendPostedEvents(QEventLoop::ProcessEventsFlags flags)
+ {
+ bool didProcess = QEventDispatcherWinRT::sendPostedEvents(flags);
+ if (!(flags & QEventLoop::ExcludeUserInputEvents))
+ didProcess |= QWindowSystemInterface::sendWindowSystemEvents(flags);
+ return didProcess;
+ }
+};
+} // anonymous namespace
+#endif // Q_OS_WINRT
+
QMinimalEglIntegration::QMinimalEglIntegration()
: mFontDb(new QGenericUnixFontDatabase()), mScreen(new QMinimalEglScreen(EGL_DEFAULT_DISPLAY))
{
@@ -104,7 +135,15 @@ QPlatformFontDatabase *QMinimalEglIntegration::fontDatabase() const
QAbstractEventDispatcher *QMinimalEglIntegration::createEventDispatcher() const
{
+#if defined(Q_OS_UNIX)
return createUnixEventDispatcher();
+#elif defined(Q_OS_WINRT)
+ return new QWinRTEventDispatcher;
+#elif defined(Q_OS_WIN)
+ return new QWindowsGuiEventDispatcher;
+#else
+ return Q_NULLPTR;
+#endif
}
QVariant QMinimalEglIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
diff --git a/src/plugins/platforms/mirclient/mirclient.json b/src/plugins/platforms/mirclient/mirclient.json
new file mode 100644
index 0000000000..c31558a2f1
--- /dev/null
+++ b/src/plugins/platforms/mirclient/mirclient.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "mirclient" ]
+}
diff --git a/src/plugins/platforms/mirclient/mirclient.pro b/src/plugins/platforms/mirclient/mirclient.pro
new file mode 100644
index 0000000000..0851e8d719
--- /dev/null
+++ b/src/plugins/platforms/mirclient/mirclient.pro
@@ -0,0 +1,49 @@
+TARGET = mirclient
+TEMPLATE = lib
+
+PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = MirServerIntegrationPlugin
+!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
+load(qt_plugin)
+
+QT += core-private gui-private platformsupport-private dbus
+
+CONFIG += qpa/genericunixfontdatabase
+
+DEFINES += MESA_EGL_NO_X11_HEADERS
+# CONFIG += c++11 # only enables C++0x
+QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Werror -Wall
+QMAKE_LFLAGS += -std=c++11 -Wl,-no-undefined
+
+CONFIG += link_pkgconfig
+PKGCONFIG += egl mirclient ubuntu-platform-api
+
+SOURCES = \
+ qmirclientbackingstore.cpp \
+ qmirclientclipboard.cpp \
+ qmirclientcursor.cpp \
+ qmirclientglcontext.cpp \
+ qmirclientinput.cpp \
+ qmirclientintegration.cpp \
+ qmirclientnativeinterface.cpp \
+ qmirclientplatformservices.cpp \
+ qmirclientplugin.cpp \
+ qmirclientscreen.cpp \
+ qmirclienttheme.cpp \
+ qmirclientwindow.cpp
+
+HEADERS = \
+ qmirclientbackingstore.h \
+ qmirclientclipboard.h \
+ qmirclientcursor.h \
+ qmirclientglcontext.h \
+ qmirclientinput.h \
+ qmirclientintegration.h \
+ qmirclientlogging.h \
+ qmirclientnativeinterface.h \
+ qmirclientorientationchangeevent_p.h \
+ qmirclientplatformservices.h \
+ qmirclientplugin.h \
+ qmirclientscreen.h \
+ qmirclienttheme.h \
+ qmirclientwindow.h
diff --git a/src/plugins/platforms/mirclient/qmirclientbackingstore.cpp b/src/plugins/platforms/mirclient/qmirclientbackingstore.cpp
new file mode 100644
index 0000000000..daa0b229ec
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientbackingstore.cpp
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclientbackingstore.h"
+#include "qmirclientlogging.h"
+#include <QtGui/QOpenGLContext>
+#include <QtGui/QOpenGLTexture>
+#include <QtGui/QMatrix4x4>
+#include <QtGui/private/qopengltextureblitter_p.h>
+#include <QtGui/qopenglfunctions.h>
+
+QMirClientBackingStore::QMirClientBackingStore(QWindow* window)
+ : QPlatformBackingStore(window)
+ , mContext(new QOpenGLContext)
+ , mTexture(new QOpenGLTexture(QOpenGLTexture::Target2D))
+ , mBlitter(new QOpenGLTextureBlitter)
+{
+ mContext->setFormat(window->requestedFormat());
+ mContext->setScreen(window->screen());
+ mContext->create();
+
+ window->setSurfaceType(QSurface::OpenGLSurface);
+}
+
+QMirClientBackingStore::~QMirClientBackingStore()
+{
+}
+
+void QMirClientBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)
+{
+ Q_UNUSED(region);
+ Q_UNUSED(offset);
+ mContext->makeCurrent(window);
+ glViewport(0, 0, window->width(), window->height());
+
+ updateTexture();
+
+ if (!mBlitter->isCreated())
+ mBlitter->create();
+
+ mBlitter->bind();
+ mBlitter->setSwizzleRB(true);
+ mBlitter->blit(mTexture->textureId(), QMatrix4x4(), QOpenGLTextureBlitter::OriginTopLeft);
+ mBlitter->release();
+
+ mContext->swapBuffers(window);
+}
+
+void QMirClientBackingStore::updateTexture()
+{
+ if (mDirty.isNull())
+ return;
+
+ if (!mTexture->isCreated()) {
+ mTexture->setMinificationFilter(QOpenGLTexture::Nearest);
+ mTexture->setMagnificationFilter(QOpenGLTexture::Nearest);
+ mTexture->setWrapMode(QOpenGLTexture::ClampToEdge);
+ mTexture->setData(mImage, QOpenGLTexture::DontGenerateMipMaps);
+ mTexture->create();
+ }
+ mTexture->bind();
+
+ QRegion fixed;
+ QRect imageRect = mImage.rect();
+
+ Q_FOREACH (const QRect &rect, mDirty.rects()) {
+ // intersect with image rect to be sure
+ QRect r = imageRect & rect;
+
+ // if the rect is wide enough it is cheaper to just extend it instead of doing an image copy
+ if (r.width() >= imageRect.width() / 2) {
+ r.setX(0);
+ r.setWidth(imageRect.width());
+ }
+
+ fixed |= r;
+ }
+
+ Q_FOREACH (const QRect &rect, fixed.rects()) {
+ // if the sub-rect is full-width we can pass the image data directly to
+ // OpenGL instead of copying, since there is no gap between scanlines
+ if (rect.width() == imageRect.width()) {
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ mImage.constScanLine(rect.y()));
+ } else {
+ glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ mImage.copy(rect).constBits());
+ }
+ }
+ /* End of code taken from QEGLPlatformBackingStore */
+
+ mDirty = QRegion();
+}
+
+
+void QMirClientBackingStore::beginPaint(const QRegion& region)
+{
+ mDirty |= region;
+}
+
+void QMirClientBackingStore::resize(const QSize& size, const QRegion& /*staticContents*/)
+{
+ mImage = QImage(size, QImage::Format_RGB32);
+
+ if (mTexture->isCreated())
+ mTexture->destroy();
+}
+
+QPaintDevice* QMirClientBackingStore::paintDevice()
+{
+ return &mImage;
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientbackingstore.h b/src/plugins/platforms/mirclient/qmirclientbackingstore.h
new file mode 100644
index 0000000000..22b8bf9bc5
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientbackingstore.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTBACKINGSTORE_H
+#define QMIRCLIENTBACKINGSTORE_H
+
+#include <qpa/qplatformbackingstore.h>
+
+class QOpenGLContext;
+class QOpenGLTexture;
+class QOpenGLTextureBlitter;
+
+class QMirClientBackingStore : public QPlatformBackingStore
+{
+public:
+ QMirClientBackingStore(QWindow* window);
+ virtual ~QMirClientBackingStore();
+
+ // QPlatformBackingStore methods.
+ void beginPaint(const QRegion&) override;
+ void flush(QWindow* window, const QRegion& region, const QPoint& offset) override;
+ void resize(const QSize& size, const QRegion& staticContents) override;
+ QPaintDevice* paintDevice() override;
+
+protected:
+ void updateTexture();
+
+private:
+ QScopedPointer<QOpenGLContext> mContext;
+ QScopedPointer<QOpenGLTexture> mTexture;
+ QScopedPointer<QOpenGLTextureBlitter> mBlitter;
+ QImage mImage;
+ QRegion mDirty;
+};
+
+#endif // QMIRCLIENTBACKINGSTORE_H
diff --git a/src/plugins/platforms/mirclient/qmirclientclipboard.cpp b/src/plugins/platforms/mirclient/qmirclientclipboard.cpp
new file mode 100644
index 0000000000..53246f66c0
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientclipboard.cpp
@@ -0,0 +1,314 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclientclipboard.h"
+
+#include <QtCore/QMimeData>
+#include <QtCore/QStringList>
+#include <QDBusInterface>
+#include <QDBusPendingCallWatcher>
+#include <QDBusPendingReply>
+
+// FIXME(loicm) The clipboard data format is not defined by Ubuntu Platform API
+// which makes it impossible to have non-Qt applications communicate with Qt
+// applications through the clipboard API. The solution would be to have
+// Ubuntu Platform define the data format or propose an API that supports
+// embedding different mime types in the clipboard.
+
+// Data format:
+// number of mime types (sizeof(int))
+// data layout ((4 * sizeof(int)) * number of mime types)
+// mime type string offset (sizeof(int))
+// mime type string size (sizeof(int))
+// data offset (sizeof(int))
+// data size (sizeof(int))
+// data (n bytes)
+
+namespace {
+
+const int maxFormatsCount = 16;
+const int maxBufferSize = 4 * 1024 * 1024; // 4 Mb
+
+}
+
+QMirClientClipboard::QMirClientClipboard()
+ : mMimeData(new QMimeData)
+ , mIsOutdated(true)
+ , mUpdatesDisabled(false)
+ , mDBusSetupDone(false)
+{
+}
+
+QMirClientClipboard::~QMirClientClipboard()
+{
+ delete mMimeData;
+}
+
+void QMirClientClipboard::requestDBusClipboardContents()
+{
+ if (!mDBusSetupDone) {
+ setupDBus();
+ }
+
+ if (!mPendingGetContentsCall.isNull())
+ return;
+
+ QDBusPendingCall pendingCall = mDBusClipboard->asyncCall(QStringLiteral("GetContents"));
+
+ mPendingGetContentsCall = new QDBusPendingCallWatcher(pendingCall, this);
+
+ QObject::connect(mPendingGetContentsCall.data(), &QDBusPendingCallWatcher::finished,
+ this, &QMirClientClipboard::onDBusClipboardGetContentsFinished);
+}
+
+void QMirClientClipboard::onDBusClipboardGetContentsFinished(QDBusPendingCallWatcher* call)
+{
+ Q_ASSERT(call == mPendingGetContentsCall.data());
+
+ QDBusPendingReply<QByteArray> reply = *call;
+ if (reply.isError()) {
+ qCritical("QMirClientClipboard - Failed to get system clipboard contents via D-Bus. %s, %s",
+ qPrintable(reply.error().name()), qPrintable(reply.error().message()));
+ // TODO: Might try again later a number of times...
+ } else {
+ QByteArray serializedMimeData = reply.argumentAt<0>();
+ updateMimeData(serializedMimeData);
+ }
+ call->deleteLater();
+}
+
+void QMirClientClipboard::onDBusClipboardSetContentsFinished(QDBusPendingCallWatcher *call)
+{
+ QDBusPendingReply<void> reply = *call;
+ if (reply.isError()) {
+ qCritical("QMirClientClipboard - Failed to set the system clipboard contents via D-Bus. %s, %s",
+ qPrintable(reply.error().name()), qPrintable(reply.error().message()));
+ // TODO: Might try again later a number of times...
+ }
+ call->deleteLater();
+}
+
+void QMirClientClipboard::updateMimeData(const QByteArray &serializedMimeData)
+{
+ if (mUpdatesDisabled)
+ return;
+
+ QMimeData *newMimeData = deserializeMimeData(serializedMimeData);
+ if (newMimeData) {
+ delete mMimeData;
+ mMimeData = newMimeData;
+ mIsOutdated = false;
+ emitChanged(QClipboard::Clipboard);
+ } else {
+ qWarning("QMirClientClipboard - Got invalid serialized mime data. Ignoring it.");
+ }
+}
+
+void QMirClientClipboard::setupDBus()
+{
+ QDBusConnection dbusConnection = QDBusConnection::sessionBus();
+
+ bool ok = dbusConnection.connect(
+ QStringLiteral("com.canonical.QtMir"),
+ QStringLiteral("/com/canonical/QtMir/Clipboard"),
+ QStringLiteral("com.canonical.QtMir.Clipboard"),
+ QStringLiteral("ContentsChanged"),
+ this, SLOT(updateMimeData(QByteArray)));
+ if (!ok) {
+ qCritical("QMirClientClipboard - Failed to connect to ContentsChanged signal form the D-Bus system clipboard.");
+ }
+
+ mDBusClipboard = new QDBusInterface(QStringLiteral("com.canonical.QtMir"),
+ QStringLiteral("/com/canonical/QtMir/Clipboard"),
+ QStringLiteral("com.canonical.QtMir.Clipboard"),
+ dbusConnection);
+
+ mDBusSetupDone = true;
+}
+
+QByteArray QMirClientClipboard::serializeMimeData(QMimeData *mimeData) const
+{
+ Q_ASSERT(mimeData != nullptr);
+
+ const QStringList formats = mimeData->formats();
+ const int formatCount = qMin(formats.size(), maxFormatsCount);
+ const int headerSize = sizeof(int) + (formatCount * 4 * sizeof(int));
+ int bufferSize = headerSize;
+
+ for (int i = 0; i < formatCount; i++)
+ bufferSize += formats[i].size() + mimeData->data(formats[i]).size();
+
+ QByteArray serializedMimeData;
+ if (bufferSize <= maxBufferSize) {
+ // Serialize data.
+ serializedMimeData.resize(bufferSize);
+ {
+ char *buffer = serializedMimeData.data();
+ int* header = reinterpret_cast<int*>(serializedMimeData.data());
+ int offset = headerSize;
+ header[0] = formatCount;
+ for (int i = 0; i < formatCount; i++) {
+ const QByteArray data = mimeData->data(formats[i]);
+ const int formatOffset = offset;
+ const int formatSize = formats[i].size();
+ const int dataOffset = offset + formatSize;
+ const int dataSize = data.size();
+ memcpy(&buffer[formatOffset], formats[i].toLatin1().data(), formatSize);
+ memcpy(&buffer[dataOffset], data.data(), dataSize);
+ header[i*4+1] = formatOffset;
+ header[i*4+2] = formatSize;
+ header[i*4+3] = dataOffset;
+ header[i*4+4] = dataSize;
+ offset += formatSize + dataSize;
+ }
+ }
+ } else {
+ qWarning("QMirClientClipboard: Not sending contents (%d bytes) to the global clipboard as it's"
+ " bigger than the maximum allowed size of %d bytes", bufferSize, maxBufferSize);
+ }
+
+ return serializedMimeData;
+}
+
+QMimeData *QMirClientClipboard::deserializeMimeData(const QByteArray &serializedMimeData) const
+{
+ if (static_cast<std::size_t>(serializedMimeData.size()) < sizeof(int)) {
+ // Data is invalid
+ return nullptr;
+ }
+
+ QMimeData *mimeData = new QMimeData;
+
+ const char* const buffer = serializedMimeData.constData();
+ const int* const header = reinterpret_cast<const int*>(serializedMimeData.constData());
+
+ const int count = qMin(header[0], maxFormatsCount);
+
+ for (int i = 0; i < count; i++) {
+ const int formatOffset = header[i*4+1];
+ const int formatSize = header[i*4+2];
+ const int dataOffset = header[i*4+3];
+ const int dataSize = header[i*4+4];
+
+ if (formatOffset + formatSize <= serializedMimeData.size()
+ && dataOffset + dataSize <= serializedMimeData.size()) {
+
+ QString mimeType = QString::fromLatin1(&buffer[formatOffset], formatSize);
+ QByteArray mimeDataBytes(&buffer[dataOffset], dataSize);
+
+ mimeData->setData(mimeType, mimeDataBytes);
+ }
+ }
+
+ return mimeData;
+}
+
+QMimeData* QMirClientClipboard::mimeData(QClipboard::Mode mode)
+{
+ if (mode != QClipboard::Clipboard)
+ return nullptr;
+
+ if (mIsOutdated && mPendingGetContentsCall.isNull()) {
+ requestDBusClipboardContents();
+ }
+
+ // Return whatever we have at the moment instead of blocking until we have something.
+ //
+ // This might be called during app startup just for the sake of checking if some
+ // "Paste" UI control should be enabled or not.
+ // We will emit QClipboard::changed() once we finally have something.
+ return mMimeData;
+}
+
+void QMirClientClipboard::setMimeData(QMimeData* mimeData, QClipboard::Mode mode)
+{
+ if (mode != QClipboard::Clipboard)
+ return;
+
+ if (!mPendingGetContentsCall.isNull()) {
+ // Ignore whatever comes from the system clipboard as we are going to change it anyway
+ QObject::disconnect(mPendingGetContentsCall.data(), 0, this, 0);
+ mUpdatesDisabled = true;
+ mPendingGetContentsCall->waitForFinished();
+ mUpdatesDisabled = false;
+ delete mPendingGetContentsCall.data();
+ }
+
+ if (mimeData != nullptr) {
+ QByteArray serializedMimeData = serializeMimeData(mimeData);
+ if (!serializedMimeData.isEmpty()) {
+ setDBusClipboardContents(serializedMimeData);
+ }
+
+ mMimeData = mimeData;
+ emitChanged(QClipboard::Clipboard);
+ }
+}
+
+bool QMirClientClipboard::supportsMode(QClipboard::Mode mode) const
+{
+ return mode == QClipboard::Clipboard;
+}
+
+bool QMirClientClipboard::ownsMode(QClipboard::Mode mode) const
+{
+ Q_UNUSED(mode);
+ return false;
+}
+
+void QMirClientClipboard::setDBusClipboardContents(const QByteArray &clipboardContents)
+{
+ if (!mDBusSetupDone) {
+ setupDBus();
+ }
+
+ if (!mPendingSetContentsCall.isNull()) {
+ // Ignore any previous set call as we are going to overwrite it anyway
+ QObject::disconnect(mPendingSetContentsCall.data(), 0, this, 0);
+ mUpdatesDisabled = true;
+ mPendingSetContentsCall->waitForFinished();
+ mUpdatesDisabled = false;
+ delete mPendingSetContentsCall.data();
+ }
+
+ QDBusPendingCall pendingCall = mDBusClipboard->asyncCall(QStringLiteral("SetContents"), clipboardContents);
+
+ mPendingSetContentsCall = new QDBusPendingCallWatcher(pendingCall, this);
+
+ QObject::connect(mPendingSetContentsCall.data(), &QDBusPendingCallWatcher::finished,
+ this, &QMirClientClipboard::onDBusClipboardSetContentsFinished);
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientclipboard.h b/src/plugins/platforms/mirclient/qmirclientclipboard.h
new file mode 100644
index 0000000000..d3d3d400d2
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientclipboard.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTCLIPBOARD_H
+#define QMIRCLIENTCLIPBOARD_H
+
+#include <qpa/qplatformclipboard.h>
+
+#include <QMimeData>
+#include <QPointer>
+class QDBusInterface;
+class QDBusPendingCallWatcher;
+
+class QMirClientClipboard : public QObject, public QPlatformClipboard
+{
+ Q_OBJECT
+public:
+ QMirClientClipboard();
+ virtual ~QMirClientClipboard();
+
+ // QPlatformClipboard methods.
+ QMimeData* mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
+ void setMimeData(QMimeData* data, QClipboard::Mode mode = QClipboard::Clipboard) override;
+ bool supportsMode(QClipboard::Mode mode) const override;
+ bool ownsMode(QClipboard::Mode mode) const override;
+
+ void requestDBusClipboardContents();
+
+private Q_SLOTS:
+ void onDBusClipboardGetContentsFinished(QDBusPendingCallWatcher*);
+ void onDBusClipboardSetContentsFinished(QDBusPendingCallWatcher*);
+ void updateMimeData(const QByteArray &serializedMimeData);
+
+private:
+ void setupDBus();
+
+ QByteArray serializeMimeData(QMimeData *mimeData) const;
+ QMimeData *deserializeMimeData(const QByteArray &serializedMimeData) const;
+
+ void setDBusClipboardContents(const QByteArray &clipboardContents);
+
+ QMimeData *mMimeData;
+ bool mIsOutdated;
+
+ QPointer<QDBusInterface> mDBusClipboard;
+
+ QPointer<QDBusPendingCallWatcher> mPendingGetContentsCall;
+ QPointer<QDBusPendingCallWatcher> mPendingSetContentsCall;
+
+ bool mUpdatesDisabled;
+ bool mDBusSetupDone;
+};
+
+#endif // QMIRCLIENTCLIPBOARD_H
diff --git a/src/plugins/platforms/mirclient/qmirclientcursor.cpp b/src/plugins/platforms/mirclient/qmirclientcursor.cpp
new file mode 100644
index 0000000000..1d6ec8391e
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientcursor.cpp
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclientcursor.h"
+
+#include "qmirclientlogging.h"
+#include "qmirclientwindow.h"
+
+#include <mir_toolkit/mir_client_library.h>
+
+QMirClientCursor::QMirClientCursor(MirConnection *connection)
+ : mConnection(connection)
+{
+ mShapeToCursorName[Qt::ArrowCursor] = "left_ptr";
+ mShapeToCursorName[Qt::UpArrowCursor] = "up_arrow";
+ mShapeToCursorName[Qt::CrossCursor] = "cross";
+ mShapeToCursorName[Qt::WaitCursor] = "watch";
+ mShapeToCursorName[Qt::IBeamCursor] = "xterm";
+ mShapeToCursorName[Qt::SizeVerCursor] = "size_ver";
+ mShapeToCursorName[Qt::SizeHorCursor] = "size_hor";
+ mShapeToCursorName[Qt::SizeBDiagCursor] = "size_bdiag";
+ mShapeToCursorName[Qt::SizeFDiagCursor] = "size_fdiag";
+ mShapeToCursorName[Qt::SizeAllCursor] = "size_all";
+ mShapeToCursorName[Qt::BlankCursor] = "blank";
+ mShapeToCursorName[Qt::SplitVCursor] = "split_v";
+ mShapeToCursorName[Qt::SplitHCursor] = "split_h";
+ mShapeToCursorName[Qt::PointingHandCursor] = "hand";
+ mShapeToCursorName[Qt::ForbiddenCursor] = "forbidden";
+ mShapeToCursorName[Qt::WhatsThisCursor] = "whats_this";
+ mShapeToCursorName[Qt::BusyCursor] = "left_ptr_watch";
+ mShapeToCursorName[Qt::OpenHandCursor] = "openhand";
+ mShapeToCursorName[Qt::ClosedHandCursor] = "closedhand";
+ mShapeToCursorName[Qt::DragCopyCursor] = "dnd-copy";
+ mShapeToCursorName[Qt::DragMoveCursor] = "dnd-move";
+ mShapeToCursorName[Qt::DragLinkCursor] = "dnd-link";
+}
+
+namespace {
+#if !defined(QT_NO_DEBUG)
+const char *qtCursorShapeToStr(Qt::CursorShape shape)
+{
+ switch (shape) {
+ case Qt::ArrowCursor:
+ return "Arrow";
+ case Qt::UpArrowCursor:
+ return "UpArrow";
+ case Qt::CrossCursor:
+ return "Cross";
+ case Qt::WaitCursor:
+ return "Wait";
+ case Qt::IBeamCursor:
+ return "IBeam";
+ case Qt::SizeVerCursor:
+ return "SizeVer";
+ case Qt::SizeHorCursor:
+ return "SizeHor";
+ case Qt::SizeBDiagCursor:
+ return "SizeBDiag";
+ case Qt::SizeFDiagCursor:
+ return "SizeFDiag";
+ case Qt::SizeAllCursor:
+ return "SizeAll";
+ case Qt::BlankCursor:
+ return "Blank";
+ case Qt::SplitVCursor:
+ return "SplitV";
+ case Qt::SplitHCursor:
+ return "SplitH";
+ case Qt::PointingHandCursor:
+ return "PointingHand";
+ case Qt::ForbiddenCursor:
+ return "Forbidden";
+ case Qt::WhatsThisCursor:
+ return "WhatsThis";
+ case Qt::BusyCursor:
+ return "Busy";
+ case Qt::OpenHandCursor:
+ return "OpenHand";
+ case Qt::ClosedHandCursor:
+ return "ClosedHand";
+ case Qt::DragCopyCursor:
+ return "DragCopy";
+ case Qt::DragMoveCursor:
+ return "DragMove";
+ case Qt::DragLinkCursor:
+ return "DragLink";
+ case Qt::BitmapCursor:
+ return "Bitmap";
+ default:
+ return "???";
+ }
+}
+#endif // !defined(QT_NO_DEBUG)
+} // anonymous namespace
+
+void QMirClientCursor::changeCursor(QCursor *windowCursor, QWindow *window)
+{
+ if (!window) {
+ return;
+ }
+
+ MirSurface *surface = static_cast<QMirClientWindow*>(window->handle())->mirSurface();
+
+ if (!surface) {
+ return;
+ }
+
+
+ if (windowCursor) {
+ DLOG("[ubuntumirclient QPA] changeCursor shape=%s, window=%p\n", qtCursorShapeToStr(windowCursor->shape()), window);
+ if (!windowCursor->pixmap().isNull()) {
+ configureMirCursorWithPixmapQCursor(surface, *windowCursor);
+ } else if (windowCursor->shape() == Qt::BitmapCursor) {
+ // TODO: Implement bitmap cursor support
+ applyDefaultCursorConfiguration(surface);
+ } else {
+ const auto &cursorName = mShapeToCursorName.value(windowCursor->shape(), QByteArray("left_ptr"));
+ auto cursorConfiguration = mir_cursor_configuration_from_name(cursorName.data());
+ mir_surface_configure_cursor(surface, cursorConfiguration);
+ mir_cursor_configuration_destroy(cursorConfiguration);
+ }
+ } else {
+ applyDefaultCursorConfiguration(surface);
+ }
+
+}
+
+void QMirClientCursor::configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor)
+{
+ QImage image = cursor.pixmap().toImage();
+
+ if (image.format() != QImage::Format_ARGB32) {
+ image.convertToFormat(QImage::Format_ARGB32);
+ }
+
+ MirBufferStream *bufferStream = mir_connection_create_buffer_stream_sync(mConnection,
+ image.width(), image.height(), mir_pixel_format_argb_8888, mir_buffer_usage_software);
+
+ {
+ MirGraphicsRegion region;
+ mir_buffer_stream_get_graphics_region(bufferStream, &region);
+
+ char *regionLine = region.vaddr;
+ Q_ASSERT(image.bytesPerLine() <= region.stride);
+ for (int i = 0; i < image.height(); ++i) {
+ memcpy(regionLine, image.scanLine(i), image.bytesPerLine());
+ regionLine += region.stride;
+ }
+ }
+
+ mir_buffer_stream_swap_buffers_sync(bufferStream);
+
+ {
+ auto configuration = mir_cursor_configuration_from_buffer_stream(bufferStream, cursor.hotSpot().x(), cursor.hotSpot().y());
+ mir_surface_configure_cursor(surface, configuration);
+ mir_cursor_configuration_destroy(configuration);
+ }
+
+ mir_buffer_stream_release_sync(bufferStream);
+}
+
+void QMirClientCursor::applyDefaultCursorConfiguration(MirSurface *surface)
+{
+ auto cursorConfiguration = mir_cursor_configuration_from_name("left_ptr");
+ mir_surface_configure_cursor(surface, cursorConfiguration);
+ mir_cursor_configuration_destroy(cursorConfiguration);
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientcursor.h b/src/plugins/platforms/mirclient/qmirclientcursor.h
new file mode 100644
index 0000000000..8bb151ddda
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientcursor.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTCURSOR_H
+#define QMIRCLIENTCURSOR_H
+
+#include <qpa/qplatformcursor.h>
+
+#include <QMap>
+#include <QByteArray>
+
+struct MirConnection;
+struct MirSurface;
+
+class QMirClientCursor : public QPlatformCursor
+{
+public:
+ QMirClientCursor(MirConnection *connection);
+ void changeCursor(QCursor *windowCursor, QWindow *window) override;
+private:
+ void configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor);
+ void applyDefaultCursorConfiguration(MirSurface *surface);
+ QMap<int, QByteArray> mShapeToCursorName;
+ MirConnection *mConnection;
+};
+
+#endif // QMIRCLIENTCURSOR_H
diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
new file mode 100644
index 0000000000..01db3b8d61
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclientglcontext.h"
+#include "qmirclientwindow.h"
+#include "qmirclientlogging.h"
+#include <QtPlatformSupport/private/qeglconvenience_p.h>
+
+#if !defined(QT_NO_DEBUG)
+static void printOpenGLESConfig() {
+ static bool once = true;
+ if (once) {
+ const char* string = (const char*) glGetString(GL_VENDOR);
+ LOG("OpenGL ES vendor: %s", string);
+ string = (const char*) glGetString(GL_RENDERER);
+ LOG("OpenGL ES renderer: %s", string);
+ string = (const char*) glGetString(GL_VERSION);
+ LOG("OpenGL ES version: %s", string);
+ string = (const char*) glGetString(GL_SHADING_LANGUAGE_VERSION);
+ LOG("OpenGL ES Shading Language version: %s", string);
+ string = (const char*) glGetString(GL_EXTENSIONS);
+ LOG("OpenGL ES extensions: %s", string);
+ once = false;
+ }
+}
+#endif
+
+static EGLenum api_in_use()
+{
+#ifdef QTUBUNTU_USE_OPENGL
+ return EGL_OPENGL_API;
+#else
+ return EGL_OPENGL_ES_API;
+#endif
+}
+
+QMirClientOpenGLContext::QMirClientOpenGLContext(QMirClientScreen* screen, QMirClientOpenGLContext* share)
+{
+ ASSERT(screen != NULL);
+ mEglDisplay = screen->eglDisplay();
+ mScreen = screen;
+
+ // Create an OpenGL ES 2 context.
+ QVector<EGLint> attribs;
+ attribs.append(EGL_CONTEXT_CLIENT_VERSION);
+ attribs.append(2);
+ attribs.append(EGL_NONE);
+ ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE);
+
+ mEglContext = eglCreateContext(mEglDisplay, screen->eglConfig(), share ? share->eglContext() : EGL_NO_CONTEXT,
+ attribs.constData());
+ DASSERT(mEglContext != EGL_NO_CONTEXT);
+}
+
+QMirClientOpenGLContext::~QMirClientOpenGLContext()
+{
+ ASSERT(eglDestroyContext(mEglDisplay, mEglContext) == EGL_TRUE);
+}
+
+bool QMirClientOpenGLContext::makeCurrent(QPlatformSurface* surface)
+{
+ DASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
+ EGLSurface eglSurface = static_cast<QMirClientWindow*>(surface)->eglSurface();
+#if defined(QT_NO_DEBUG)
+ eglBindAPI(api_in_use());
+ eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, mEglContext);
+#else
+ ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE);
+ ASSERT(eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, mEglContext) == EGL_TRUE);
+ printOpenGLESConfig();
+#endif
+ return true;
+}
+
+void QMirClientOpenGLContext::doneCurrent()
+{
+#if defined(QT_NO_DEBUG)
+ eglBindAPI(api_in_use());
+ eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+#else
+ ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE);
+ ASSERT(eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) == EGL_TRUE);
+#endif
+}
+
+void QMirClientOpenGLContext::swapBuffers(QPlatformSurface* surface)
+{
+ QMirClientWindow *ubuntuWindow = static_cast<QMirClientWindow*>(surface);
+
+ EGLSurface eglSurface = ubuntuWindow->eglSurface();
+#if defined(QT_NO_DEBUG)
+ eglBindAPI(api_in_use());
+ eglSwapBuffers(mEglDisplay, eglSurface);
+#else
+ ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE);
+ ASSERT(eglSwapBuffers(mEglDisplay, eglSurface) == EGL_TRUE);
+#endif
+
+ ubuntuWindow->onSwapBuffersDone();
+}
+
+void (*QMirClientOpenGLContext::getProcAddress(const QByteArray& procName)) ()
+{
+#if defined(QT_NO_DEBUG)
+ eglBindAPI(api_in_use());
+#else
+ ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE);
+#endif
+ return eglGetProcAddress(procName.constData());
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.h b/src/plugins/platforms/mirclient/qmirclientglcontext.h
new file mode 100644
index 0000000000..29c196ce5c
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientglcontext.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTGLCONTEXT_H
+#define QMIRCLIENTGLCONTEXT_H
+
+#include <qpa/qplatformopenglcontext.h>
+#include "qmirclientscreen.h"
+
+class QMirClientOpenGLContext : public QPlatformOpenGLContext
+{
+public:
+ QMirClientOpenGLContext(QMirClientScreen* screen, QMirClientOpenGLContext* share);
+ virtual ~QMirClientOpenGLContext();
+
+ // QPlatformOpenGLContext methods.
+ QSurfaceFormat format() const override { return mScreen->surfaceFormat(); }
+ void swapBuffers(QPlatformSurface* surface) override;
+ bool makeCurrent(QPlatformSurface* surface) override;
+ void doneCurrent() override;
+ bool isValid() const override { return mEglContext != EGL_NO_CONTEXT; }
+ void (*getProcAddress(const QByteArray& procName)) () override;
+
+ EGLContext eglContext() const { return mEglContext; }
+
+private:
+ QMirClientScreen* mScreen;
+ EGLContext mEglContext;
+ EGLDisplay mEglDisplay;
+};
+
+#endif // QMIRCLIENTGLCONTEXT_H
diff --git a/src/plugins/platforms/mirclient/qmirclientinput.cpp b/src/plugins/platforms/mirclient/qmirclientinput.cpp
new file mode 100644
index 0000000000..addeda634c
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientinput.cpp
@@ -0,0 +1,579 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+// Local
+#include "qmirclientinput.h"
+#include "qmirclientintegration.h"
+#include "qmirclientnativeinterface.h"
+#include "qmirclientscreen.h"
+#include "qmirclientwindow.h"
+#include "qmirclientlogging.h"
+#include "qmirclientorientationchangeevent_p.h"
+
+// Qt
+#if !defined(QT_NO_DEBUG)
+#include <QtCore/QThread>
+#endif
+#include <QtCore/qglobal.h>
+#include <QtCore/QCoreApplication>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatforminputcontext.h>
+#include <qpa/qwindowsysteminterface.h>
+
+#include <xkbcommon/xkbcommon.h>
+#include <xkbcommon/xkbcommon-keysyms.h>
+
+#include <mir_toolkit/mir_client_library.h>
+
+#define LOG_EVENTS 0
+
+// XKB Keysyms which do not map directly to Qt types (i.e. Unicode points)
+static const uint32_t KeyTable[] = {
+ XKB_KEY_Escape, Qt::Key_Escape,
+ XKB_KEY_Tab, Qt::Key_Tab,
+ XKB_KEY_ISO_Left_Tab, Qt::Key_Backtab,
+ XKB_KEY_BackSpace, Qt::Key_Backspace,
+ XKB_KEY_Return, Qt::Key_Return,
+ XKB_KEY_Insert, Qt::Key_Insert,
+ XKB_KEY_Delete, Qt::Key_Delete,
+ XKB_KEY_Clear, Qt::Key_Delete,
+ XKB_KEY_Pause, Qt::Key_Pause,
+ XKB_KEY_Print, Qt::Key_Print,
+
+ XKB_KEY_Home, Qt::Key_Home,
+ XKB_KEY_End, Qt::Key_End,
+ XKB_KEY_Left, Qt::Key_Left,
+ XKB_KEY_Up, Qt::Key_Up,
+ XKB_KEY_Right, Qt::Key_Right,
+ XKB_KEY_Down, Qt::Key_Down,
+ XKB_KEY_Prior, Qt::Key_PageUp,
+ XKB_KEY_Next, Qt::Key_PageDown,
+
+ XKB_KEY_Shift_L, Qt::Key_Shift,
+ XKB_KEY_Shift_R, Qt::Key_Shift,
+ XKB_KEY_Shift_Lock, Qt::Key_Shift,
+ XKB_KEY_Control_L, Qt::Key_Control,
+ XKB_KEY_Control_R, Qt::Key_Control,
+ XKB_KEY_Meta_L, Qt::Key_Meta,
+ XKB_KEY_Meta_R, Qt::Key_Meta,
+ XKB_KEY_Alt_L, Qt::Key_Alt,
+ XKB_KEY_Alt_R, Qt::Key_Alt,
+ XKB_KEY_Caps_Lock, Qt::Key_CapsLock,
+ XKB_KEY_Num_Lock, Qt::Key_NumLock,
+ XKB_KEY_Scroll_Lock, Qt::Key_ScrollLock,
+ XKB_KEY_Super_L, Qt::Key_Super_L,
+ XKB_KEY_Super_R, Qt::Key_Super_R,
+ XKB_KEY_Menu, Qt::Key_Menu,
+ XKB_KEY_Hyper_L, Qt::Key_Hyper_L,
+ XKB_KEY_Hyper_R, Qt::Key_Hyper_R,
+ XKB_KEY_Help, Qt::Key_Help,
+
+ XKB_KEY_KP_Space, Qt::Key_Space,
+ XKB_KEY_KP_Tab, Qt::Key_Tab,
+ XKB_KEY_KP_Enter, Qt::Key_Enter,
+ XKB_KEY_KP_Home, Qt::Key_Home,
+ XKB_KEY_KP_Left, Qt::Key_Left,
+ XKB_KEY_KP_Up, Qt::Key_Up,
+ XKB_KEY_KP_Right, Qt::Key_Right,
+ XKB_KEY_KP_Down, Qt::Key_Down,
+ XKB_KEY_KP_Prior, Qt::Key_PageUp,
+ XKB_KEY_KP_Next, Qt::Key_PageDown,
+ XKB_KEY_KP_End, Qt::Key_End,
+ XKB_KEY_KP_Begin, Qt::Key_Clear,
+ XKB_KEY_KP_Insert, Qt::Key_Insert,
+ XKB_KEY_KP_Delete, Qt::Key_Delete,
+ XKB_KEY_KP_Equal, Qt::Key_Equal,
+ XKB_KEY_KP_Multiply, Qt::Key_Asterisk,
+ XKB_KEY_KP_Add, Qt::Key_Plus,
+ XKB_KEY_KP_Separator, Qt::Key_Comma,
+ XKB_KEY_KP_Subtract, Qt::Key_Minus,
+ XKB_KEY_KP_Decimal, Qt::Key_Period,
+ XKB_KEY_KP_Divide, Qt::Key_Slash,
+
+ XKB_KEY_ISO_Level3_Shift, Qt::Key_AltGr,
+ XKB_KEY_Multi_key, Qt::Key_Multi_key,
+ XKB_KEY_Codeinput, Qt::Key_Codeinput,
+ XKB_KEY_SingleCandidate, Qt::Key_SingleCandidate,
+ XKB_KEY_MultipleCandidate, Qt::Key_MultipleCandidate,
+ XKB_KEY_PreviousCandidate, Qt::Key_PreviousCandidate,
+
+ XKB_KEY_Mode_switch, Qt::Key_Mode_switch,
+ XKB_KEY_script_switch, Qt::Key_Mode_switch,
+ XKB_KEY_XF86AudioRaiseVolume, Qt::Key_VolumeUp,
+ XKB_KEY_XF86AudioLowerVolume, Qt::Key_VolumeDown,
+ XKB_KEY_XF86PowerOff, Qt::Key_PowerOff,
+ XKB_KEY_XF86PowerDown, Qt::Key_PowerDown,
+
+ 0, 0
+};
+
+class QMirClientEvent : public QEvent
+{
+public:
+ QMirClientEvent(QMirClientWindow* window, const MirEvent *event, QEvent::Type type)
+ : QEvent(type), window(window) {
+ nativeEvent = mir_event_ref(event);
+ }
+ ~QMirClientEvent()
+ {
+ mir_event_unref(nativeEvent);
+ }
+
+ QPointer<QMirClientWindow> window;
+ const MirEvent *nativeEvent;
+};
+
+QMirClientInput::QMirClientInput(QMirClientClientIntegration* integration)
+ : QObject(nullptr)
+ , mIntegration(integration)
+ , mEventFilterType(static_cast<QMirClientNativeInterface*>(
+ integration->nativeInterface())->genericEventFilterType())
+ , mEventType(static_cast<QEvent::Type>(QEvent::registerEventType()))
+ , mLastFocusedWindow(nullptr)
+{
+ // Initialize touch device.
+ mTouchDevice = new QTouchDevice;
+ mTouchDevice->setType(QTouchDevice::TouchScreen);
+ mTouchDevice->setCapabilities(
+ QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::Pressure |
+ QTouchDevice::NormalizedPosition);
+ QWindowSystemInterface::registerTouchDevice(mTouchDevice);
+}
+
+QMirClientInput::~QMirClientInput()
+{
+ // Qt will take care of deleting mTouchDevice.
+}
+
+#if (LOG_EVENTS != 0)
+static const char* nativeEventTypeToStr(MirEventType t)
+{
+ switch (t)
+ {
+ case mir_event_type_key:
+ return "mir_event_type_key";
+ case mir_event_type_motion:
+ return "mir_event_type_motion";
+ case mir_event_type_surface:
+ return "mir_event_type_surface";
+ case mir_event_type_resize:
+ return "mir_event_type_resize";
+ case mir_event_type_prompt_session_state_change:
+ return "mir_event_type_prompt_session_state_change";
+ case mir_event_type_orientation:
+ return "mir_event_type_orientation";
+ case mir_event_type_close_surface:
+ return "mir_event_type_close_surface";
+ case mir_event_type_input:
+ return "mir_event_type_input";
+ default:
+ DLOG("Invalid event type %d", t);
+ return "invalid";
+ }
+}
+#endif // LOG_EVENTS != 0
+
+void QMirClientInput::customEvent(QEvent* event)
+{
+ DASSERT(QThread::currentThread() == thread());
+ QMirClientEvent* ubuntuEvent = static_cast<QMirClientEvent*>(event);
+ const MirEvent *nativeEvent = ubuntuEvent->nativeEvent;
+
+ if ((ubuntuEvent->window == nullptr) || (ubuntuEvent->window->window() == nullptr)) {
+ qWarning() << "Attempted to deliver an event to a non-existent window, ignoring.";
+ return;
+ }
+
+ // Event filtering.
+ long result;
+ if (QWindowSystemInterface::handleNativeEvent(
+ ubuntuEvent->window->window(), mEventFilterType,
+ const_cast<void *>(static_cast<const void *>(nativeEvent)), &result) == true) {
+ DLOG("event filtered out by native interface");
+ return;
+ }
+
+ #if (LOG_EVENTS != 0)
+ LOG("QMirClientInput::customEvent(type=%s)", nativeEventTypeToStr(mir_event_get_type(nativeEvent)));
+ #endif
+
+ // Event dispatching.
+ switch (mir_event_get_type(nativeEvent))
+ {
+ case mir_event_type_input:
+ dispatchInputEvent(ubuntuEvent->window, mir_event_get_input_event(nativeEvent));
+ break;
+ case mir_event_type_resize:
+ {
+ Q_ASSERT(ubuntuEvent->window->screen() == mIntegration->screen());
+
+ auto resizeEvent = mir_event_get_resize_event(nativeEvent);
+
+ mIntegration->screen()->handleWindowSurfaceResize(
+ mir_resize_event_get_width(resizeEvent),
+ mir_resize_event_get_height(resizeEvent));
+
+ ubuntuEvent->window->handleSurfaceResized(mir_resize_event_get_width(resizeEvent),
+ mir_resize_event_get_height(resizeEvent));
+ break;
+ }
+ case mir_event_type_surface:
+ {
+ auto surfaceEvent = mir_event_get_surface_event(nativeEvent);
+ if (mir_surface_event_get_attribute(surfaceEvent) == mir_surface_attrib_focus) {
+ const bool focused = mir_surface_event_get_attribute_value(surfaceEvent) == mir_surface_focused;
+ // Mir may have sent a pair of focus lost/gained events, so we need to "peek" into the queue
+ // so that we don't deactivate windows prematurely.
+ if (focused) {
+ mPendingFocusGainedEvents--;
+ ubuntuEvent->window->handleSurfaceFocused();
+ QWindowSystemInterface::handleWindowActivated(ubuntuEvent->window->window(), Qt::ActiveWindowFocusReason);
+
+ // NB: Since processing of system events is queued, never check qGuiApp->applicationState()
+ // as it might be outdated. Always call handleApplicationStateChanged() with the latest
+ // state regardless.
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
+
+ } else if (!mPendingFocusGainedEvents) {
+ DLOG("[ubuntumirclient QPA] No windows have focus");
+ QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
+ }
+ }
+ break;
+ }
+ case mir_event_type_orientation:
+ dispatchOrientationEvent(ubuntuEvent->window->window(), mir_event_get_orientation_event(nativeEvent));
+ break;
+ case mir_event_type_close_surface:
+ QWindowSystemInterface::handleCloseEvent(ubuntuEvent->window->window());
+ break;
+ default:
+ DLOG("unhandled event type: %d", static_cast<int>(mir_event_get_type(nativeEvent)));
+ }
+}
+
+void QMirClientInput::postEvent(QMirClientWindow *platformWindow, const MirEvent *event)
+{
+ QWindow *window = platformWindow->window();
+
+ const auto eventType = mir_event_get_type(event);
+ if (mir_event_type_surface == eventType) {
+ auto surfaceEvent = mir_event_get_surface_event(event);
+ if (mir_surface_attrib_focus == mir_surface_event_get_attribute(surfaceEvent)) {
+ const bool focused = mir_surface_event_get_attribute_value(surfaceEvent) == mir_surface_focused;
+ if (focused) {
+ mPendingFocusGainedEvents++;
+ }
+ }
+ }
+
+ QCoreApplication::postEvent(this, new QMirClientEvent(
+ platformWindow, event, mEventType));
+
+ if ((window->flags().testFlag(Qt::WindowTransparentForInput)) && window->parent()) {
+ QCoreApplication::postEvent(this, new QMirClientEvent(
+ static_cast<QMirClientWindow*>(platformWindow->QPlatformWindow::parent()),
+ event, mEventType));
+ }
+}
+
+void QMirClientInput::dispatchInputEvent(QMirClientWindow *window, const MirInputEvent *ev)
+{
+ switch (mir_input_event_get_type(ev))
+ {
+ case mir_input_event_type_key:
+ dispatchKeyEvent(window, ev);
+ break;
+ case mir_input_event_type_touch:
+ dispatchTouchEvent(window, ev);
+ break;
+ case mir_input_event_type_pointer:
+ dispatchPointerEvent(window, ev);
+ break;
+ default:
+ break;
+ }
+}
+
+void QMirClientInput::dispatchTouchEvent(QMirClientWindow *window, const MirInputEvent *ev)
+{
+ const MirTouchEvent *tev = mir_input_event_get_touch_event(ev);
+
+ // FIXME(loicm) Max pressure is device specific. That one is for the Samsung Galaxy Nexus. That
+ // needs to be fixed as soon as the compat input lib adds query support.
+ const float kMaxPressure = 1.28;
+ const QRect kWindowGeometry = window->geometry();
+ QList<QWindowSystemInterface::TouchPoint> touchPoints;
+
+
+ // TODO: Is it worth setting the Qt::TouchPointStationary ones? Currently they are left
+ // as Qt::TouchPointMoved
+ const unsigned int kPointerCount = mir_touch_event_point_count(tev);
+ for (unsigned int i = 0; i < kPointerCount; ++i) {
+ QWindowSystemInterface::TouchPoint touchPoint;
+
+ const float kX = mir_touch_event_axis_value(tev, i, mir_touch_axis_x) + kWindowGeometry.x();
+ const float kY = mir_touch_event_axis_value(tev, i, mir_touch_axis_y) + kWindowGeometry.y(); // see bug lp:1346633 workaround comments elsewhere
+ const float kW = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_major);
+ const float kH = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_minor);
+ const float kP = mir_touch_event_axis_value(tev, i, mir_touch_axis_pressure);
+ touchPoint.id = mir_touch_event_id(tev, i);
+ touchPoint.normalPosition = QPointF(kX / kWindowGeometry.width(), kY / kWindowGeometry.height());
+ touchPoint.area = QRectF(kX - (kW / 2.0), kY - (kH / 2.0), kW, kH);
+ touchPoint.pressure = kP / kMaxPressure;
+
+ MirTouchAction touch_action = mir_touch_event_action(tev, i);
+ switch (touch_action)
+ {
+ case mir_touch_action_down:
+ mLastFocusedWindow = window;
+ touchPoint.state = Qt::TouchPointPressed;
+ break;
+ case mir_touch_action_up:
+ touchPoint.state = Qt::TouchPointReleased;
+ break;
+ case mir_touch_action_change:
+ default:
+ touchPoint.state = Qt::TouchPointMoved;
+ }
+
+ touchPoints.append(touchPoint);
+ }
+
+ ulong timestamp = mir_input_event_get_event_time(ev) / 1000000;
+ QWindowSystemInterface::handleTouchEvent(window->window(), timestamp,
+ mTouchDevice, touchPoints);
+}
+
+static uint32_t translateKeysym(uint32_t sym, char *string, size_t size)
+{
+ Q_UNUSED(size);
+ string[0] = '\0';
+
+ if (sym >= XKB_KEY_F1 && sym <= XKB_KEY_F35)
+ return Qt::Key_F1 + (int(sym) - XKB_KEY_F1);
+
+ for (int i = 0; KeyTable[i]; i += 2) {
+ if (sym == KeyTable[i])
+ return KeyTable[i + 1];
+ }
+
+ string[0] = sym;
+ string[1] = '\0';
+ return toupper(sym);
+}
+
+namespace
+{
+Qt::KeyboardModifiers qt_modifiers_from_mir(MirInputEventModifiers modifiers)
+{
+ Qt::KeyboardModifiers q_modifiers = Qt::NoModifier;
+ if (modifiers & mir_input_event_modifier_shift) {
+ q_modifiers |= Qt::ShiftModifier;
+ }
+ if (modifiers & mir_input_event_modifier_ctrl) {
+ q_modifiers |= Qt::ControlModifier;
+ }
+ if (modifiers & mir_input_event_modifier_alt) {
+ q_modifiers |= Qt::AltModifier;
+ }
+ if (modifiers & mir_input_event_modifier_meta) {
+ q_modifiers |= Qt::MetaModifier;
+ }
+ return q_modifiers;
+}
+}
+
+void QMirClientInput::dispatchKeyEvent(QMirClientWindow *window, const MirInputEvent *event)
+{
+ const MirKeyboardEvent *key_event = mir_input_event_get_keyboard_event(event);
+
+ ulong timestamp = mir_input_event_get_event_time(event) / 1000000;
+ xkb_keysym_t xk_sym = mir_keyboard_event_key_code(key_event);
+
+ // Key modifier and unicode index mapping.
+ auto modifiers = qt_modifiers_from_mir(mir_keyboard_event_modifiers(key_event));
+
+ MirKeyboardAction action = mir_keyboard_event_action(key_event);
+ QEvent::Type keyType = action == mir_keyboard_action_up
+ ? QEvent::KeyRelease : QEvent::KeyPress;
+
+ if (action == mir_keyboard_action_down)
+ mLastFocusedWindow = window;
+
+ char s[2];
+ int sym = translateKeysym(xk_sym, s, sizeof(s));
+ QString text = QString::fromLatin1(s);
+
+ bool is_auto_rep = action == mir_keyboard_action_repeat;
+
+ QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
+ if (context) {
+ QKeyEvent qKeyEvent(keyType, sym, modifiers, text, is_auto_rep);
+ qKeyEvent.setTimestamp(timestamp);
+ if (context->filterEvent(&qKeyEvent)) {
+ DLOG("key event filtered out by input context");
+ return;
+ }
+ }
+
+ QWindowSystemInterface::handleKeyEvent(window->window(), timestamp, keyType, sym, modifiers, text, is_auto_rep);
+}
+
+namespace
+{
+Qt::MouseButtons extract_buttons(const MirPointerEvent *pev)
+{
+ Qt::MouseButtons buttons = Qt::NoButton;
+ if (mir_pointer_event_button_state(pev, mir_pointer_button_primary))
+ buttons |= Qt::LeftButton;
+ if (mir_pointer_event_button_state(pev, mir_pointer_button_secondary))
+ buttons |= Qt::RightButton;
+ if (mir_pointer_event_button_state(pev, mir_pointer_button_tertiary))
+ buttons |= Qt::MiddleButton;
+ if (mir_pointer_event_button_state(pev, mir_pointer_button_back))
+ buttons |= Qt::BackButton;
+ if (mir_pointer_event_button_state(pev, mir_pointer_button_forward))
+ buttons |= Qt::ForwardButton;
+
+ return buttons;
+}
+}
+
+void QMirClientInput::dispatchPointerEvent(QMirClientWindow *platformWindow, const MirInputEvent *ev)
+{
+ auto window = platformWindow->window();
+ auto timestamp = mir_input_event_get_event_time(ev) / 1000000;
+
+ auto pev = mir_input_event_get_pointer_event(ev);
+ auto action = mir_pointer_event_action(pev);
+ auto localPoint = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_x),
+ mir_pointer_event_axis_value(pev, mir_pointer_axis_y));
+ auto modifiers = qt_modifiers_from_mir(mir_pointer_event_modifiers(pev));
+
+ switch (action) {
+ case mir_pointer_action_button_up:
+ case mir_pointer_action_button_down:
+ case mir_pointer_action_motion:
+ {
+ const float hDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_hscroll);
+ const float vDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_vscroll);
+
+ if (hDelta != 0 || vDelta != 0) {
+ const QPoint angleDelta = QPoint(hDelta * 15, vDelta * 15);
+ QWindowSystemInterface::handleWheelEvent(window, timestamp, localPoint, window->position() + localPoint,
+ QPoint(), angleDelta, modifiers, Qt::ScrollUpdate);
+ }
+ auto buttons = extract_buttons(pev);
+ QWindowSystemInterface::handleMouseEvent(window, timestamp, localPoint, window->position() + localPoint /* Should we omit global point instead? */,
+ buttons, modifiers);
+ break;
+ }
+ case mir_pointer_action_enter:
+ QWindowSystemInterface::handleEnterEvent(window, localPoint, window->position() + localPoint);
+ break;
+ case mir_pointer_action_leave:
+ QWindowSystemInterface::handleLeaveEvent(window);
+ break;
+ default:
+ DLOG("Unrecognized pointer event");
+ }
+}
+
+#if (LOG_EVENTS != 0)
+static const char* nativeOrientationDirectionToStr(MirOrientation orientation)
+{
+ switch (orientation) {
+ case mir_orientation_normal:
+ return "Normal";
+ break;
+ case mir_orientation_left:
+ return "Left";
+ break;
+ case mir_orientation_inverted:
+ return "Inverted";
+ break;
+ case mir_orientation_right:
+ return "Right";
+ break;
+ default:
+ return "INVALID!";
+ }
+}
+#endif
+
+void QMirClientInput::dispatchOrientationEvent(QWindow *window, const MirOrientationEvent *event)
+{
+ MirOrientation mir_orientation = mir_orientation_event_get_direction(event);
+ #if (LOG_EVENTS != 0)
+ // Orientation event logging.
+ LOG("ORIENTATION direction: %s", nativeOrientationDirectionToStr(mir_orientation));
+ #endif
+
+ if (!window->screen()) {
+ DLOG("Window has no associated screen, dropping orientation event");
+ return;
+ }
+
+ OrientationChangeEvent::Orientation orientation;
+ switch (mir_orientation) {
+ case mir_orientation_normal:
+ orientation = OrientationChangeEvent::TopUp;
+ break;
+ case mir_orientation_left:
+ orientation = OrientationChangeEvent::LeftUp;
+ break;
+ case mir_orientation_inverted:
+ orientation = OrientationChangeEvent::TopDown;
+ break;
+ case mir_orientation_right:
+ orientation = OrientationChangeEvent::RightUp;
+ break;
+ default:
+ DLOG("No such orientation %d", mir_orientation);
+ return;
+ }
+
+ // Dispatch orientation event to [Platform]Screen, as that is where Qt reads it. Screen will handle
+ // notifying Qt of the actual orientation change - done to prevent multiple Windows each creating
+ // an identical orientation change event and passing it directly to Qt.
+ // [Platform]Screen can also factor in the native orientation.
+ QCoreApplication::postEvent(static_cast<QMirClientScreen*>(window->screen()->handle()),
+ new OrientationChangeEvent(OrientationChangeEvent::mType, orientation));
+}
+
diff --git a/src/plugins/platforms/mirclient/qmirclientinput.h b/src/plugins/platforms/mirclient/qmirclientinput.h
new file mode 100644
index 0000000000..3ed887419e
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientinput.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTINPUT_H
+#define QMIRCLIENTINPUT_H
+
+// Qt
+#include <qpa/qwindowsysteminterface.h>
+#include <QAtomicInt>
+
+#include <mir_toolkit/mir_client_library.h>
+
+class QMirClientClientIntegration;
+class QMirClientWindow;
+
+class QMirClientInput : public QObject
+{
+ Q_OBJECT
+
+public:
+ QMirClientInput(QMirClientClientIntegration* integration);
+ virtual ~QMirClientInput();
+
+ // QObject methods.
+ void customEvent(QEvent* event) override;
+
+ void postEvent(QMirClientWindow* window, const MirEvent *event);
+ QMirClientClientIntegration* integration() const { return mIntegration; }
+ QMirClientWindow *lastFocusedWindow() const {return mLastFocusedWindow; }
+
+protected:
+ void dispatchKeyEvent(QMirClientWindow *window, const MirInputEvent *event);
+ void dispatchPointerEvent(QMirClientWindow *window, const MirInputEvent *event);
+ void dispatchTouchEvent(QMirClientWindow *window, const MirInputEvent *event);
+ void dispatchInputEvent(QMirClientWindow *window, const MirInputEvent *event);
+
+ void dispatchOrientationEvent(QWindow* window, const MirOrientationEvent *event);
+
+private:
+ QMirClientClientIntegration* mIntegration;
+ QTouchDevice* mTouchDevice;
+ const QByteArray mEventFilterType;
+ const QEvent::Type mEventType;
+
+ QMirClientWindow *mLastFocusedWindow;
+ QAtomicInt mPendingFocusGainedEvents;
+};
+
+#endif // QMIRCLIENTINPUT_H
diff --git a/src/plugins/platforms/mirclient/qmirclientintegration.cpp b/src/plugins/platforms/mirclient/qmirclientintegration.cpp
new file mode 100644
index 0000000000..4b2572ce0d
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientintegration.cpp
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+// Local
+#include "qmirclientintegration.h"
+#include "qmirclientbackingstore.h"
+#include "qmirclientclipboard.h"
+#include "qmirclientglcontext.h"
+#include "qmirclientinput.h"
+#include "qmirclientlogging.h"
+#include "qmirclientnativeinterface.h"
+#include "qmirclientscreen.h"
+#include "qmirclienttheme.h"
+#include "qmirclientwindow.h"
+
+// Qt
+#include <QGuiApplication>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qplatforminputcontext.h>
+#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
+#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+#include <QOpenGLContext>
+
+// platform-api
+#include <ubuntu/application/lifecycle_delegate.h>
+#include <ubuntu/application/id.h>
+#include <ubuntu/application/options.h>
+
+static void resumedCallback(const UApplicationOptions *options, void* context)
+{
+ Q_UNUSED(options)
+ Q_UNUSED(context)
+ DASSERT(context != NULL);
+ if (qGuiApp->focusWindow()) {
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
+ } else {
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
+ }
+}
+
+static void aboutToStopCallback(UApplicationArchive *archive, void* context)
+{
+ Q_UNUSED(archive)
+ DASSERT(context != NULL);
+ QMirClientClientIntegration* integration = static_cast<QMirClientClientIntegration*>(context);
+ QPlatformInputContext *inputContext = integration->inputContext();
+ if (inputContext) {
+ inputContext->hideInputPanel();
+ } else {
+ qWarning("QMirClientClientIntegration aboutToStopCallback(): no input context");
+ }
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
+}
+
+QMirClientClientIntegration::QMirClientClientIntegration()
+ : QPlatformIntegration()
+ , mNativeInterface(new QMirClientNativeInterface)
+ , mFontDb(new QGenericUnixFontDatabase)
+ , mServices(new QMirClientPlatformServices)
+ , mClipboard(new QMirClientClipboard)
+ , mScaleFactor(1.0)
+{
+ setupOptions();
+ setupDescription();
+
+ // Create new application instance
+ mInstance = u_application_instance_new_from_description_with_options(mDesc, mOptions);
+
+ if (mInstance == nullptr)
+ qFatal("QMirClientClientIntegration: connection to Mir server failed. Check that a Mir server is\n"
+ "running, and the correct socket is being used and is accessible. The shell may have\n"
+ "rejected the incoming connection, so check its log file");
+
+ mNativeInterface->setMirConnection(u_application_instance_get_mir_connection(mInstance));
+
+ // Create default screen.
+ mScreen = new QMirClientScreen(u_application_instance_get_mir_connection(mInstance));
+ screenAdded(mScreen);
+
+ // Initialize input.
+ if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_INPUT")) {
+ mInput = new QMirClientInput(this);
+ mInputContext = QPlatformInputContextFactory::create();
+ } else {
+ mInput = nullptr;
+ mInputContext = nullptr;
+ }
+
+ // compute the scale factor
+ const int defaultGridUnit = 8;
+ int gridUnit = defaultGridUnit;
+ QByteArray gridUnitString = qgetenv("GRID_UNIT_PX");
+ if (!gridUnitString.isEmpty()) {
+ bool ok;
+ gridUnit = gridUnitString.toInt(&ok);
+ if (!ok) {
+ gridUnit = defaultGridUnit;
+ }
+ }
+ mScaleFactor = static_cast<qreal>(gridUnit) / defaultGridUnit;
+}
+
+QMirClientClientIntegration::~QMirClientClientIntegration()
+{
+ delete mInput;
+ delete mInputContext;
+ delete mScreen;
+ delete mServices;
+}
+
+QPlatformServices *QMirClientClientIntegration::services() const
+{
+ return mServices;
+}
+
+void QMirClientClientIntegration::setupOptions()
+{
+ QStringList args = QCoreApplication::arguments();
+ int argc = args.size() + 1;
+ char **argv = new char*[argc];
+ for (int i = 0; i < argc - 1; i++)
+ argv[i] = qstrdup(args.at(i).toLocal8Bit());
+ argv[argc - 1] = nullptr;
+
+ mOptions = u_application_options_new_from_cmd_line(argc - 1, argv);
+
+ for (int i = 0; i < argc; i++)
+ delete [] argv[i];
+ delete [] argv;
+}
+
+void QMirClientClientIntegration::setupDescription()
+{
+ mDesc = u_application_description_new();
+ UApplicationId* id = u_application_id_new_from_stringn("QtUbuntu", 8);
+ u_application_description_set_application_id(mDesc, id);
+
+ UApplicationLifecycleDelegate* delegate = u_application_lifecycle_delegate_new();
+ u_application_lifecycle_delegate_set_application_resumed_cb(delegate, &resumedCallback);
+ u_application_lifecycle_delegate_set_application_about_to_stop_cb(delegate, &aboutToStopCallback);
+ u_application_lifecycle_delegate_set_context(delegate, this);
+ u_application_description_set_application_lifecycle_delegate(mDesc, delegate);
+}
+
+QPlatformWindow* QMirClientClientIntegration::createPlatformWindow(QWindow* window) const
+{
+ return const_cast<QMirClientClientIntegration*>(this)->createPlatformWindow(window);
+}
+
+QPlatformWindow* QMirClientClientIntegration::createPlatformWindow(QWindow* window)
+{
+ return new QMirClientWindow(window, mClipboard, static_cast<QMirClientScreen*>(mScreen),
+ mInput, u_application_instance_get_mir_connection(mInstance));
+}
+
+bool QMirClientClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
+{
+ switch (cap) {
+ case ThreadedPixmaps:
+ return true;
+
+ case OpenGL:
+ return true;
+
+ case ApplicationState:
+ return true;
+
+ case ThreadedOpenGL:
+ if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
+ return true;
+ } else {
+ DLOG("ubuntumirclient: disabled threaded OpenGL");
+ return false;
+ }
+ case MultipleWindows:
+ case NonFullScreenWindows:
+ return true;
+ default:
+ return QPlatformIntegration::hasCapability(cap);
+ }
+}
+
+QAbstractEventDispatcher *QMirClientClientIntegration::createEventDispatcher() const
+{
+ return createUnixEventDispatcher();
+}
+
+QPlatformBackingStore* QMirClientClientIntegration::createPlatformBackingStore(QWindow* window) const
+{
+ return new QMirClientBackingStore(window);
+}
+
+QPlatformOpenGLContext* QMirClientClientIntegration::createPlatformOpenGLContext(
+ QOpenGLContext* context) const
+{
+ return const_cast<QMirClientClientIntegration*>(this)->createPlatformOpenGLContext(context);
+}
+
+QPlatformOpenGLContext* QMirClientClientIntegration::createPlatformOpenGLContext(
+ QOpenGLContext* context)
+{
+ return new QMirClientOpenGLContext(static_cast<QMirClientScreen*>(context->screen()->handle()),
+ static_cast<QMirClientOpenGLContext*>(context->shareHandle()));
+}
+
+QStringList QMirClientClientIntegration::themeNames() const
+{
+ return QStringList(QMirClientTheme::name);
+}
+
+QPlatformTheme* QMirClientClientIntegration::createPlatformTheme(const QString& name) const
+{
+ Q_UNUSED(name);
+ return new QMirClientTheme;
+}
+
+QVariant QMirClientClientIntegration::styleHint(StyleHint hint) const
+{
+ switch (hint) {
+ case QPlatformIntegration::StartDragDistance: {
+ // default is 10 pixels (see QPlatformTheme::defaultThemeHint)
+ return 10.0 * mScaleFactor;
+ }
+ case QPlatformIntegration::PasswordMaskDelay: {
+ // return time in milliseconds - 1 second
+ return QVariant(1000);
+ }
+ default:
+ break;
+ }
+ return QPlatformIntegration::styleHint(hint);
+}
+
+QPlatformClipboard* QMirClientClientIntegration::clipboard() const
+{
+ return mClipboard.data();
+}
+
+QPlatformNativeInterface* QMirClientClientIntegration::nativeInterface() const
+{
+ return mNativeInterface;
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientintegration.h b/src/plugins/platforms/mirclient/qmirclientintegration.h
new file mode 100644
index 0000000000..e41cbe2cee
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientintegration.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTINTEGRATION_H
+#define QMIRCLIENTINTEGRATION_H
+
+#include <qpa/qplatformintegration.h>
+#include <QSharedPointer>
+
+#include "qmirclientplatformservices.h"
+
+// platform-api
+#include <ubuntu/application/description.h>
+#include <ubuntu/application/instance.h>
+
+class QMirClientClipboard;
+class QMirClientInput;
+class QMirClientNativeInterface;
+class QMirClientScreen;
+
+class QMirClientClientIntegration : public QPlatformIntegration {
+public:
+ QMirClientClientIntegration();
+ virtual ~QMirClientClientIntegration();
+
+ // QPlatformIntegration methods.
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
+ QPlatformNativeInterface* nativeInterface() const override;
+ QPlatformBackingStore* createPlatformBackingStore(QWindow* window) const override;
+ QPlatformOpenGLContext* createPlatformOpenGLContext(QOpenGLContext* context) const override;
+ QPlatformFontDatabase* fontDatabase() const override { return mFontDb; }
+ QStringList themeNames() const override;
+ QPlatformTheme* createPlatformTheme(const QString& name) const override;
+ QVariant styleHint(StyleHint hint) const override;
+ QPlatformServices *services() const override;
+ QPlatformWindow* createPlatformWindow(QWindow* window) const override;
+ QPlatformInputContext* inputContext() const override { return mInputContext; }
+ QPlatformClipboard* clipboard() const override;
+
+ QPlatformOpenGLContext* createPlatformOpenGLContext(QOpenGLContext* context);
+ QPlatformWindow* createPlatformWindow(QWindow* window);
+ QMirClientScreen* screen() const { return mScreen; }
+
+private:
+ void setupOptions();
+ void setupDescription();
+
+ QMirClientNativeInterface* mNativeInterface;
+ QPlatformFontDatabase* mFontDb;
+
+ QMirClientPlatformServices* mServices;
+
+ QMirClientScreen* mScreen;
+ QMirClientInput* mInput;
+ QPlatformInputContext* mInputContext;
+ QSharedPointer<QMirClientClipboard> mClipboard;
+ qreal mScaleFactor;
+
+ // Platform API stuff
+ UApplicationOptions* mOptions;
+ UApplicationDescription* mDesc;
+ UApplicationInstance* mInstance;
+};
+
+#endif // QMIRCLIENTINTEGRATION_H
diff --git a/src/plugins/platforms/mirclient/qmirclientlogging.h b/src/plugins/platforms/mirclient/qmirclientlogging.h
new file mode 100644
index 0000000000..80914d28b9
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientlogging.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTLOGGING_H
+#define QMIRCLIENTLOGGING_H
+
+// Logging and assertion macros.
+#define LOG(...) qDebug(__VA_ARGS__)
+#define LOG_IF(cond,...) do { if (cond) qDebug(__VA_ARGS__); } while (0)
+#define ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
+#define NOT_REACHED() qt_assert("Not reached!",__FILE__,__LINE__)
+
+// Logging and assertion macros are compiled out for release builds.
+#if !defined(QT_NO_DEBUG)
+#define DLOG(...) LOG(__VA_ARGS__)
+#define DLOG_IF(cond,...) LOG_IF((cond), __VA_ARGS__)
+#define DASSERT(cond) ASSERT((cond))
+#define DNOT_REACHED() NOT_REACHED()
+#else
+#define DLOG(...) qt_noop()
+#define DLOG_IF(cond,...) qt_noop()
+#define DASSERT(cond) qt_noop()
+#define DNOT_REACHED() qt_noop()
+#endif
+
+#endif // QMIRCLIENTLOGGING_H
diff --git a/src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp b/src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp
new file mode 100644
index 0000000000..1b4c20153b
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+// Local
+#include "qmirclientnativeinterface.h"
+#include "qmirclientscreen.h"
+#include "qmirclientglcontext.h"
+
+// Qt
+#include <private/qguiapplication_p.h>
+#include <QtGui/qopenglcontext.h>
+#include <QtGui/qscreen.h>
+#include <QtCore/QMap>
+
+class QMirClientResourceMap : public QMap<QByteArray, QMirClientNativeInterface::ResourceType>
+{
+public:
+ QMirClientResourceMap()
+ : QMap<QByteArray, QMirClientNativeInterface::ResourceType>() {
+ insert("egldisplay", QMirClientNativeInterface::EglDisplay);
+ insert("eglcontext", QMirClientNativeInterface::EglContext);
+ insert("nativeorientation", QMirClientNativeInterface::NativeOrientation);
+ insert("display", QMirClientNativeInterface::Display);
+ insert("mirconnection", QMirClientNativeInterface::MirConnection);
+ }
+};
+
+Q_GLOBAL_STATIC(QMirClientResourceMap, ubuntuResourceMap)
+
+QMirClientNativeInterface::QMirClientNativeInterface()
+ : mGenericEventFilterType(QByteArrayLiteral("Event"))
+ , mNativeOrientation(nullptr)
+ , mMirConnection(nullptr)
+{
+}
+
+QMirClientNativeInterface::~QMirClientNativeInterface()
+{
+ delete mNativeOrientation;
+ mNativeOrientation = nullptr;
+}
+
+void* QMirClientNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
+{
+ const QByteArray lowerCaseResource = resourceString.toLower();
+
+ if (!ubuntuResourceMap()->contains(lowerCaseResource)) {
+ return nullptr;
+ }
+
+ const ResourceType resourceType = ubuntuResourceMap()->value(lowerCaseResource);
+
+ if (resourceType == QMirClientNativeInterface::MirConnection) {
+ return mMirConnection;
+ } else {
+ return nullptr;
+ }
+}
+
+void* QMirClientNativeInterface::nativeResourceForContext(
+ const QByteArray& resourceString, QOpenGLContext* context)
+{
+ if (!context)
+ return nullptr;
+
+ const QByteArray kLowerCaseResource = resourceString.toLower();
+
+ if (!ubuntuResourceMap()->contains(kLowerCaseResource))
+ return nullptr;
+
+ const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
+
+ if (kResourceType == QMirClientNativeInterface::EglContext)
+ return static_cast<QMirClientOpenGLContext*>(context->handle())->eglContext();
+ else
+ return nullptr;
+}
+
+void* QMirClientNativeInterface::nativeResourceForWindow(const QByteArray& resourceString, QWindow* window)
+{
+ const QByteArray kLowerCaseResource = resourceString.toLower();
+ if (!ubuntuResourceMap()->contains(kLowerCaseResource))
+ return NULL;
+ const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
+ if (kResourceType == QMirClientNativeInterface::EglDisplay) {
+ if (window) {
+ return static_cast<QMirClientScreen*>(window->screen()->handle())->eglDisplay();
+ } else {
+ return static_cast<QMirClientScreen*>(
+ QGuiApplication::primaryScreen()->handle())->eglDisplay();
+ }
+ } else if (kResourceType == QMirClientNativeInterface::NativeOrientation) {
+ // Return the device's native screen orientation.
+ if (window) {
+ QMirClientScreen *ubuntuScreen = static_cast<QMirClientScreen*>(window->screen()->handle());
+ mNativeOrientation = new Qt::ScreenOrientation(ubuntuScreen->nativeOrientation());
+ } else {
+ QPlatformScreen *platformScreen = QGuiApplication::primaryScreen()->handle();
+ mNativeOrientation = new Qt::ScreenOrientation(platformScreen->nativeOrientation());
+ }
+ return mNativeOrientation;
+ } else {
+ return NULL;
+ }
+}
+
+void* QMirClientNativeInterface::nativeResourceForScreen(const QByteArray& resourceString, QScreen* screen)
+{
+ const QByteArray kLowerCaseResource = resourceString.toLower();
+ if (!ubuntuResourceMap()->contains(kLowerCaseResource))
+ return NULL;
+ const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
+ if (kResourceType == QMirClientNativeInterface::Display) {
+ if (!screen)
+ screen = QGuiApplication::primaryScreen();
+ return static_cast<QMirClientScreen*>(screen->handle())->eglNativeDisplay();
+ } else
+ return NULL;
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientnativeinterface.h b/src/plugins/platforms/mirclient/qmirclientnativeinterface.h
new file mode 100644
index 0000000000..7df646e73a
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientnativeinterface.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTNATIVEINTERFACE_H
+#define QMIRCLIENTNATIVEINTERFACE_H
+
+#include <qpa/qplatformnativeinterface.h>
+
+class QMirClientNativeInterface : public QPlatformNativeInterface {
+public:
+ enum ResourceType { EglDisplay, EglContext, NativeOrientation, Display, MirConnection };
+
+ QMirClientNativeInterface();
+ ~QMirClientNativeInterface();
+
+ // QPlatformNativeInterface methods.
+ void* nativeResourceForIntegration(const QByteArray &resource) override;
+ void* nativeResourceForContext(const QByteArray& resourceString,
+ QOpenGLContext* context) override;
+ void* nativeResourceForWindow(const QByteArray& resourceString,
+ QWindow* window) override;
+ void* nativeResourceForScreen(const QByteArray& resourceString,
+ QScreen* screen) override;
+
+ // New methods.
+ const QByteArray& genericEventFilterType() const { return mGenericEventFilterType; }
+ void setMirConnection(void *mirConnection) { mMirConnection = mirConnection; }
+
+private:
+ const QByteArray mGenericEventFilterType;
+ Qt::ScreenOrientation* mNativeOrientation;
+ void *mMirConnection;
+};
+
+#endif // QMIRCLIENTNATIVEINTERFACE_H
diff --git a/src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h b/src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h
new file mode 100644
index 0000000000..2a1ed9c09f
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
+#define QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
+
+#include <QEvent>
+#include "qmirclientlogging.h"
+
+class OrientationChangeEvent : public QEvent {
+public:
+ enum Orientation { TopUp, LeftUp, TopDown, RightUp };
+
+ OrientationChangeEvent(QEvent::Type type, Orientation orientation)
+ : QEvent(type)
+ , mOrientation(orientation)
+ {
+ }
+
+ static const QEvent::Type mType;
+ Orientation mOrientation;
+};
+
+#endif // QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
diff --git a/src/plugins/platforms/mirclient/qmirclientplatformservices.cpp b/src/plugins/platforms/mirclient/qmirclientplatformservices.cpp
new file mode 100644
index 0000000000..d0260c79d3
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientplatformservices.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclientplatformservices.h"
+
+#include <QUrl>
+
+#include <ubuntu/application/url_dispatcher/service.h>
+#include <ubuntu/application/url_dispatcher/session.h>
+
+bool QMirClientPlatformServices::openUrl(const QUrl &url)
+{
+ return callDispatcher(url);
+}
+
+bool QMirClientPlatformServices::openDocument(const QUrl &url)
+{
+ return callDispatcher(url);
+}
+
+bool QMirClientPlatformServices::callDispatcher(const QUrl &url)
+{
+ UAUrlDispatcherSession* session = ua_url_dispatcher_session();
+ if (!session)
+ return false;
+
+ ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL);
+
+ free(session);
+
+ // We are returning true here because the other option
+ // is spawning a nested event loop and wait for the
+ // callback. But there is no guarantee on how fast
+ // the callback is going to be so we prefer to avoid the
+ // nested event loop. Long term plan is improve Qt API
+ // to support an async openUrl
+ return true;
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientplatformservices.h b/src/plugins/platforms/mirclient/qmirclientplatformservices.h
new file mode 100644
index 0000000000..64a0432d06
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientplatformservices.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTPLATFORMSERVICES_H
+#define QMIRCLIENTPLATFORMSERVICES_H
+
+#include <qpa/qplatformservices.h>
+#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
+#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+
+class QMirClientPlatformServices : public QPlatformServices {
+public:
+ bool openUrl(const QUrl &url) override;
+ bool openDocument(const QUrl &url) override;
+
+private:
+ bool callDispatcher(const QUrl &url);
+};
+
+#endif // QMIRCLIENTPLATFORMSERVICES_H
diff --git a/src/plugins/platforms/mirclient/qmirclientplugin.cpp b/src/plugins/platforms/mirclient/qmirclientplugin.cpp
new file mode 100644
index 0000000000..75561f7fd3
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientplugin.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclientplugin.h"
+#include "qmirclientintegration.h"
+
+QStringList QMirClientIntegrationPlugin::keys() const
+{
+ QStringList list;
+ list << QStringLiteral("mirclient");
+ return list;
+}
+
+QPlatformIntegration* QMirClientIntegrationPlugin::create(const QString &system,
+ const QStringList &)
+{
+ if (system.toLower() == QLatin1String("mirclient")) {
+ return new QMirClientClientIntegration;
+ } else {
+ return 0;
+ }
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientplugin.h b/src/plugins/platforms/mirclient/qmirclientplugin.h
new file mode 100644
index 0000000000..a6f1a1081a
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientplugin.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTPLUGIN_H
+#define QMIRCLIENTPLUGIN_H
+
+#include <qpa/qplatformintegrationplugin.h>
+
+class QMirClientIntegrationPlugin : public QPlatformIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "mirclient.json")
+
+public:
+ QStringList keys() const;
+ QPlatformIntegration* create(const QString&, const QStringList&);
+};
+
+#endif // QMIRCLIENTPLUGIN_H
diff --git a/src/plugins/platforms/mirclient/qmirclientscreen.cpp b/src/plugins/platforms/mirclient/qmirclientscreen.cpp
new file mode 100644
index 0000000000..3eb01f816a
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientscreen.cpp
@@ -0,0 +1,303 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+// local
+#include "qmirclientscreen.h"
+#include "qmirclientlogging.h"
+#include "qmirclientorientationchangeevent_p.h"
+
+#include <mir_toolkit/mir_client_library.h>
+
+// Qt
+#include <QCoreApplication>
+#include <QtCore/qmath.h>
+#include <QScreen>
+#include <QThread>
+#include <qpa/qwindowsysteminterface.h>
+#include <QtPlatformSupport/private/qeglconvenience_p.h>
+
+#include <memory>
+
+static const int kSwapInterval = 1;
+
+#if !defined(QT_NO_DEBUG)
+
+static const char *orientationToStr(Qt::ScreenOrientation orientation) {
+ switch (orientation) {
+ case Qt::PrimaryOrientation:
+ return "primary";
+ case Qt::PortraitOrientation:
+ return "portrait";
+ case Qt::LandscapeOrientation:
+ return "landscape";
+ case Qt::InvertedPortraitOrientation:
+ return "inverted portrait";
+ case Qt::InvertedLandscapeOrientation:
+ return "inverted landscape";
+ default:
+ return "INVALID!";
+ }
+}
+
+static void printEglConfig(EGLDisplay display, EGLConfig config) {
+ DASSERT(display != EGL_NO_DISPLAY);
+ DASSERT(config != nullptr);
+ static const struct { const EGLint attrib; const char* name; } kAttribs[] = {
+ { EGL_BUFFER_SIZE, "EGL_BUFFER_SIZE" },
+ { EGL_ALPHA_SIZE, "EGL_ALPHA_SIZE" },
+ { EGL_BLUE_SIZE, "EGL_BLUE_SIZE" },
+ { EGL_GREEN_SIZE, "EGL_GREEN_SIZE" },
+ { EGL_RED_SIZE, "EGL_RED_SIZE" },
+ { EGL_DEPTH_SIZE, "EGL_DEPTH_SIZE" },
+ { EGL_STENCIL_SIZE, "EGL_STENCIL_SIZE" },
+ { EGL_CONFIG_CAVEAT, "EGL_CONFIG_CAVEAT" },
+ { EGL_CONFIG_ID, "EGL_CONFIG_ID" },
+ { EGL_LEVEL, "EGL_LEVEL" },
+ { EGL_MAX_PBUFFER_HEIGHT, "EGL_MAX_PBUFFER_HEIGHT" },
+ { EGL_MAX_PBUFFER_PIXELS, "EGL_MAX_PBUFFER_PIXELS" },
+ { EGL_MAX_PBUFFER_WIDTH, "EGL_MAX_PBUFFER_WIDTH" },
+ { EGL_NATIVE_RENDERABLE, "EGL_NATIVE_RENDERABLE" },
+ { EGL_NATIVE_VISUAL_ID, "EGL_NATIVE_VISUAL_ID" },
+ { EGL_NATIVE_VISUAL_TYPE, "EGL_NATIVE_VISUAL_TYPE" },
+ { EGL_SAMPLES, "EGL_SAMPLES" },
+ { EGL_SAMPLE_BUFFERS, "EGL_SAMPLE_BUFFERS" },
+ { EGL_SURFACE_TYPE, "EGL_SURFACE_TYPE" },
+ { EGL_TRANSPARENT_TYPE, "EGL_TRANSPARENT_TYPE" },
+ { EGL_TRANSPARENT_BLUE_VALUE, "EGL_TRANSPARENT_BLUE_VALUE" },
+ { EGL_TRANSPARENT_GREEN_VALUE, "EGL_TRANSPARENT_GREEN_VALUE" },
+ { EGL_TRANSPARENT_RED_VALUE, "EGL_TRANSPARENT_RED_VALUE" },
+ { EGL_BIND_TO_TEXTURE_RGB, "EGL_BIND_TO_TEXTURE_RGB" },
+ { EGL_BIND_TO_TEXTURE_RGBA, "EGL_BIND_TO_TEXTURE_RGBA" },
+ { EGL_MIN_SWAP_INTERVAL, "EGL_MIN_SWAP_INTERVAL" },
+ { EGL_MAX_SWAP_INTERVAL, "EGL_MAX_SWAP_INTERVAL" },
+ { -1, NULL }
+ };
+ const char* string = eglQueryString(display, EGL_VENDOR);
+ LOG("EGL vendor: %s", string);
+ string = eglQueryString(display, EGL_VERSION);
+ LOG("EGL version: %s", string);
+ string = eglQueryString(display, EGL_EXTENSIONS);
+ LOG("EGL extensions: %s", string);
+ LOG("EGL configuration attibutes:");
+ for (int index = 0; kAttribs[index].attrib != -1; index++) {
+ EGLint value;
+ if (eglGetConfigAttrib(display, config, kAttribs[index].attrib, &value))
+ LOG(" %s: %d", kAttribs[index].name, static_cast<int>(value));
+ }
+}
+#endif
+
+
+const QEvent::Type OrientationChangeEvent::mType =
+ static_cast<QEvent::Type>(QEvent::registerEventType());
+
+static const MirDisplayOutput *find_active_output(
+ const MirDisplayConfiguration *conf)
+{
+ const MirDisplayOutput *output = NULL;
+ for (uint32_t d = 0; d < conf->num_outputs; d++)
+ {
+ const MirDisplayOutput *out = conf->outputs + d;
+
+ if (out->used &&
+ out->connected &&
+ out->num_modes &&
+ out->current_mode < out->num_modes)
+ {
+ output = out;
+ break;
+ }
+ }
+
+ return output;
+}
+
+QMirClientScreen::QMirClientScreen(MirConnection *connection)
+ : mFormat(QImage::Format_RGB32)
+ , mDepth(32)
+ , mOutputId(0)
+ , mSurfaceFormat()
+ , mEglDisplay(EGL_NO_DISPLAY)
+ , mEglConfig(nullptr)
+ , mCursor(connection)
+{
+ // Initialize EGL.
+ ASSERT(eglBindAPI(EGL_OPENGL_ES_API) == EGL_TRUE);
+
+ mEglNativeDisplay = mir_connection_get_egl_native_display(connection);
+ ASSERT((mEglDisplay = eglGetDisplay(mEglNativeDisplay)) != EGL_NO_DISPLAY);
+ ASSERT(eglInitialize(mEglDisplay, nullptr, nullptr) == EGL_TRUE);
+
+ // Configure EGL buffers format.
+ mSurfaceFormat.setRedBufferSize(8);
+ mSurfaceFormat.setGreenBufferSize(8);
+ mSurfaceFormat.setBlueBufferSize(8);
+ mSurfaceFormat.setAlphaBufferSize(8);
+ mSurfaceFormat.setDepthBufferSize(24);
+ mSurfaceFormat.setStencilBufferSize(8);
+ if (!qEnvironmentVariableIsEmpty("QTUBUNTU_MULTISAMPLE")) {
+ mSurfaceFormat.setSamples(4);
+ DLOG("ubuntumirclient: setting MSAA to 4 samples");
+ }
+#ifdef QTUBUNTU_USE_OPENGL
+ mSurfaceFormat.setRenderableType(QSurfaceFormat::OpenGL);
+#else
+ mSurfaceFormat.setRenderableType(QSurfaceFormat::OpenGLES);
+#endif
+ mEglConfig = q_configFromGLFormat(mEglDisplay, mSurfaceFormat, true);
+
+ #if !defined(QT_NO_DEBUG)
+ printEglConfig(mEglDisplay, mEglConfig);
+ #endif
+
+ // Set vblank swap interval.
+ int swapInterval = kSwapInterval;
+ QByteArray swapIntervalString = qgetenv("QTUBUNTU_SWAPINTERVAL");
+ if (!swapIntervalString.isEmpty()) {
+ bool ok;
+ swapInterval = swapIntervalString.toInt(&ok);
+ if (!ok)
+ swapInterval = kSwapInterval;
+ }
+ DLOG("ubuntumirclient: setting swap interval to %d", swapInterval);
+ eglSwapInterval(mEglDisplay, swapInterval);
+
+ // Get screen resolution.
+ auto configDeleter = [](MirDisplayConfiguration *config) { mir_display_config_destroy(config); };
+ using configUp = std::unique_ptr<MirDisplayConfiguration, decltype(configDeleter)>;
+ configUp displayConfig(mir_connection_create_display_config(connection), configDeleter);
+ ASSERT(displayConfig != nullptr);
+
+ auto const displayOutput = find_active_output(displayConfig.get());
+ ASSERT(displayOutput != nullptr);
+
+ mOutputId = displayOutput->output_id;
+
+ mPhysicalSize = QSizeF(displayOutput->physical_width_mm, displayOutput->physical_height_mm);
+ DLOG("ubuntumirclient: screen physical size: %.2fx%.2f", mPhysicalSize.width(), mPhysicalSize.height());
+
+ const MirDisplayMode *mode = &displayOutput->modes[displayOutput->current_mode];
+ const int kScreenWidth = mode->horizontal_resolution;
+ const int kScreenHeight = mode->vertical_resolution;
+ DASSERT(kScreenWidth > 0 && kScreenHeight > 0);
+
+ DLOG("ubuntumirclient: screen resolution: %dx%d", kScreenWidth, kScreenHeight);
+
+ mGeometry = QRect(0, 0, kScreenWidth, kScreenHeight);
+
+ DLOG("QQMirClientScreen::QQMirClientScreen (this=%p)", this);
+
+ // Set the default orientation based on the initial screen dimmensions.
+ mNativeOrientation = (mGeometry.width() >= mGeometry.height()) ? Qt::LandscapeOrientation : Qt::PortraitOrientation;
+
+ // If it's a landscape device (i.e. some tablets), start in landscape, otherwise portrait
+ mCurrentOrientation = (mNativeOrientation == Qt::LandscapeOrientation) ? Qt::LandscapeOrientation : Qt::PortraitOrientation;
+}
+
+QMirClientScreen::~QMirClientScreen()
+{
+ eglTerminate(mEglDisplay);
+}
+
+void QMirClientScreen::customEvent(QEvent* event) {
+ DASSERT(QThread::currentThread() == thread());
+
+ OrientationChangeEvent* oReadingEvent = static_cast<OrientationChangeEvent*>(event);
+ switch (oReadingEvent->mOrientation) {
+ case OrientationChangeEvent::LeftUp: {
+ mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
+ Qt::InvertedPortraitOrientation : Qt::LandscapeOrientation;
+ break;
+ }
+ case OrientationChangeEvent::TopUp: {
+ mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
+ Qt::LandscapeOrientation : Qt::PortraitOrientation;
+ break;
+ }
+ case OrientationChangeEvent::RightUp: {
+ mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
+ Qt::PortraitOrientation : Qt::InvertedLandscapeOrientation;
+ break;
+ }
+ case OrientationChangeEvent::TopDown: {
+ mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
+ Qt::InvertedLandscapeOrientation : Qt::InvertedPortraitOrientation;
+ break;
+ }
+ default: {
+ DLOG("QMirClientScreen::customEvent - Unknown orientation.");
+ return;
+ }
+ }
+
+ // Raise the event signal so that client apps know the orientation changed
+ DLOG("QMirClientScreen::customEvent - handling orientation change to %s", orientationToStr(mCurrentOrientation));
+ QWindowSystemInterface::handleScreenOrientationChange(screen(), mCurrentOrientation);
+}
+
+void QMirClientScreen::handleWindowSurfaceResize(int windowWidth, int windowHeight)
+{
+ if ((windowWidth > windowHeight && mGeometry.width() < mGeometry.height())
+ || (windowWidth < windowHeight && mGeometry.width() > mGeometry.height())) {
+
+ // The window aspect ratio differ's from the screen one. This means that
+ // unity8 has rotated the window in its scene.
+ // As there's no way to express window rotation in Qt's API, we have
+ // Flip QScreen's dimensions so that orientation properties match
+ // (primaryOrientation particularly).
+ // FIXME: This assumes a phone scenario. Won't work, or make sense,
+ // on the desktop
+
+ QRect currGeometry = mGeometry;
+ mGeometry.setWidth(currGeometry.height());
+ mGeometry.setHeight(currGeometry.width());
+
+ DLOG("QMirClientScreen::handleWindowSurfaceResize - new screen geometry (w=%d, h=%d)",
+ mGeometry.width(), mGeometry.height());
+ QWindowSystemInterface::handleScreenGeometryChange(screen(),
+ mGeometry /* newGeometry */,
+ mGeometry /* newAvailableGeometry */);
+
+ if (mGeometry.width() < mGeometry.height()) {
+ mCurrentOrientation = Qt::PortraitOrientation;
+ } else {
+ mCurrentOrientation = Qt::LandscapeOrientation;
+ }
+ DLOG("QMirClientScreen::handleWindowSurfaceResize - new orientation %s",orientationToStr(mCurrentOrientation));
+ QWindowSystemInterface::handleScreenOrientationChange(screen(), mCurrentOrientation);
+ }
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientscreen.h b/src/plugins/platforms/mirclient/qmirclientscreen.h
new file mode 100644
index 0000000000..a6b4f442da
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientscreen.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTSCREEN_H
+#define QMIRCLIENTSCREEN_H
+
+#include <qpa/qplatformscreen.h>
+#include <QSurfaceFormat>
+#include <EGL/egl.h>
+
+#include "qmirclientcursor.h"
+
+struct MirConnection;
+
+class QMirClientScreen : public QObject, public QPlatformScreen
+{
+ Q_OBJECT
+public:
+ QMirClientScreen(MirConnection *connection);
+ virtual ~QMirClientScreen();
+
+ // QPlatformScreen methods.
+ QImage::Format format() const override { return mFormat; }
+ int depth() const override { return mDepth; }
+ QRect geometry() const override { return mGeometry; }
+ QRect availableGeometry() const override { return mGeometry; }
+ QSizeF physicalSize() const override { return mPhysicalSize; }
+ Qt::ScreenOrientation nativeOrientation() const override { return mNativeOrientation; }
+ Qt::ScreenOrientation orientation() const override { return mNativeOrientation; }
+ QPlatformCursor *cursor() const override { return const_cast<QMirClientCursor*>(&mCursor); }
+
+ // New methods.
+ QSurfaceFormat surfaceFormat() const { return mSurfaceFormat; }
+ EGLDisplay eglDisplay() const { return mEglDisplay; }
+ EGLConfig eglConfig() const { return mEglConfig; }
+ EGLNativeDisplayType eglNativeDisplay() const { return mEglNativeDisplay; }
+ void handleWindowSurfaceResize(int width, int height);
+ uint32_t mirOutputId() const { return mOutputId; }
+
+ // QObject methods.
+ void customEvent(QEvent* event) override;
+
+private:
+ QRect mGeometry;
+ QSizeF mPhysicalSize;
+ Qt::ScreenOrientation mNativeOrientation;
+ Qt::ScreenOrientation mCurrentOrientation;
+ QImage::Format mFormat;
+ int mDepth;
+ uint32_t mOutputId;
+ QSurfaceFormat mSurfaceFormat;
+ EGLDisplay mEglDisplay;
+ EGLConfig mEglConfig;
+ EGLNativeDisplayType mEglNativeDisplay;
+ QMirClientCursor mCursor;
+};
+
+#endif // QMIRCLIENTSCREEN_H
diff --git a/src/plugins/platforms/mirclient/qmirclienttheme.cpp b/src/plugins/platforms/mirclient/qmirclienttheme.cpp
new file mode 100644
index 0000000000..c15da23945
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclienttheme.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qmirclienttheme.h"
+
+#include <QtCore/QVariant>
+
+const char *QMirClientTheme::name = "ubuntu";
+
+QMirClientTheme::QMirClientTheme()
+{
+}
+
+QMirClientTheme::~QMirClientTheme()
+{
+}
+
+QVariant QMirClientTheme::themeHint(ThemeHint hint) const
+{
+ if (hint == QPlatformTheme::SystemIconThemeName) {
+ QByteArray iconTheme = qgetenv("QTUBUNTU_ICON_THEME");
+ if (iconTheme.isEmpty()) {
+ return QVariant(QStringLiteral("ubuntu-mobile"));
+ } else {
+ return QVariant(QString(iconTheme));
+ }
+ } else {
+ return QGenericUnixTheme::themeHint(hint);
+ }
+}
diff --git a/src/plugins/platforms/mirclient/qmirclienttheme.h b/src/plugins/platforms/mirclient/qmirclienttheme.h
new file mode 100644
index 0000000000..8f330395a0
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclienttheme.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTTHEME_H
+#define QMIRCLIENTTHEME_H
+
+#include <QtPlatformSupport/private/qgenericunixthemes_p.h>
+
+class QMirClientTheme : public QGenericUnixTheme
+{
+public:
+ static const char* name;
+ QMirClientTheme();
+ virtual ~QMirClientTheme();
+
+ // From QPlatformTheme
+ QVariant themeHint(ThemeHint hint) const override;
+};
+
+#endif // QMIRCLIENTTHEME_H
diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.cpp b/src/plugins/platforms/mirclient/qmirclientwindow.cpp
new file mode 100644
index 0000000000..9a72c2f9dc
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientwindow.cpp
@@ -0,0 +1,662 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+// Local
+#include "qmirclientwindow.h"
+#include "qmirclientclipboard.h"
+#include "qmirclientinput.h"
+#include "qmirclientscreen.h"
+#include "qmirclientlogging.h"
+
+#include <mir_toolkit/mir_client_library.h>
+
+// Qt
+#include <qpa/qwindowsysteminterface.h>
+#include <QMutexLocker>
+#include <QSize>
+#include <QtMath>
+
+// Platform API
+#include <ubuntu/application/instance.h>
+
+#include <EGL/egl.h>
+
+namespace
+{
+
+// FIXME: this used to be defined by platform-api, but it's been removed in v3. Change ubuntu-keyboard to use
+// a different enum for window roles.
+enum UAUiWindowRole {
+ U_MAIN_ROLE = 1,
+ U_DASH_ROLE,
+ U_INDICATOR_ROLE,
+ U_NOTIFICATIONS_ROLE,
+ U_GREETER_ROLE,
+ U_LAUNCHER_ROLE,
+ U_ON_SCREEN_KEYBOARD_ROLE,
+ U_SHUTDOWN_DIALOG_ROLE,
+};
+
+struct MirSpecDeleter
+{
+ void operator()(MirSurfaceSpec *spec) { mir_surface_spec_release(spec); }
+};
+
+using Spec = std::unique_ptr<MirSurfaceSpec, MirSpecDeleter>;
+
+EGLNativeWindowType nativeWindowFor(MirSurface *surf)
+{
+ auto stream = mir_surface_get_buffer_stream(surf);
+ return reinterpret_cast<EGLNativeWindowType>(mir_buffer_stream_get_egl_native_window(stream));
+}
+
+MirSurfaceState qtWindowStateToMirSurfaceState(Qt::WindowState state)
+{
+ switch (state) {
+ case Qt::WindowNoState:
+ return mir_surface_state_restored;
+ case Qt::WindowFullScreen:
+ return mir_surface_state_fullscreen;
+ case Qt::WindowMaximized:
+ return mir_surface_state_maximized;
+ case Qt::WindowMinimized:
+ return mir_surface_state_minimized;
+ default:
+ LOG("Unexpected Qt::WindowState: %d", state);
+ return mir_surface_state_restored;
+ }
+}
+
+#if !defined(QT_NO_DEBUG)
+const char *qtWindowStateToStr(Qt::WindowState state)
+{
+ switch (state) {
+ case Qt::WindowNoState:
+ return "NoState";
+ case Qt::WindowFullScreen:
+ return "FullScreen";
+ case Qt::WindowMaximized:
+ return "Maximized";
+ case Qt::WindowMinimized:
+ return "Minimized";
+ default:
+ return "!?";
+ }
+}
+#endif
+
+WId makeId()
+{
+ static int id = 1;
+ return id++;
+}
+
+MirPixelFormat defaultPixelFormatFor(MirConnection *connection)
+{
+ MirPixelFormat format;
+ unsigned int nformats;
+ mir_connection_get_available_surface_formats(connection, &format, 1, &nformats);
+ return format;
+}
+
+UAUiWindowRole roleFor(QWindow *window)
+{
+ QVariant roleVariant = window->property("role");
+ if (!roleVariant.isValid())
+ return U_MAIN_ROLE;
+
+ uint role = roleVariant.toUInt();
+ if (role < U_MAIN_ROLE || role > U_SHUTDOWN_DIALOG_ROLE)
+ return U_MAIN_ROLE;
+
+ return static_cast<UAUiWindowRole>(role);
+}
+
+QMirClientWindow *transientParentFor(QWindow *window)
+{
+ QWindow *parent = window->transientParent();
+ return parent ? static_cast<QMirClientWindow *>(parent->handle()) : nullptr;
+}
+
+Spec makeSurfaceSpec(QWindow *window, QMirClientInput *input, MirConnection *connection)
+{
+ const auto geom = window->geometry();
+ const int width = geom.width() > 0 ? geom.width() : 1;
+ const int height = geom.height() > 0 ? geom.height() : 1;
+ const auto pixelFormat = defaultPixelFormatFor(connection);
+
+ if (U_ON_SCREEN_KEYBOARD_ROLE == roleFor(window)) {
+ DLOG("[ubuntumirclient QPA] makeSurfaceSpec(window=%p) - creating input method surface (width=%d, height=%d", window, width, height);
+ return Spec{mir_connection_create_spec_for_input_method(connection, width, height, pixelFormat)};
+ }
+
+ const Qt::WindowType type = window->type();
+ if (type == Qt::Popup) {
+ auto parent = transientParentFor(window);
+ if (parent == nullptr) {
+ //NOTE: We cannot have a parentless popup -
+ //try using the last surface to receive input as that will most likely be
+ //the one that caused this popup to be created
+ parent = input->lastFocusedWindow();
+ }
+ if (parent) {
+ auto pos = geom.topLeft();
+ pos -= parent->geometry().topLeft();
+ MirRectangle location{pos.x(), pos.y(), 0, 0};
+ DLOG("[ubuntumirclient QPA] makeSurfaceSpec(window=%p) - creating menu surface(width:%d, height:%d)", window, width, height);
+ return Spec{mir_connection_create_spec_for_menu(
+ connection, width, height, pixelFormat, parent->mirSurface(),
+ &location, mir_edge_attachment_any)};
+ } else {
+ DLOG("[ubuntumirclient QPA] makeSurfaceSpec(window=%p) - cannot create a menu without a parent!", window);
+ }
+ } else if (type == Qt::Dialog) {
+ auto parent = transientParentFor(window);
+ if (parent) {
+ // Modal dialog
+ DLOG("[ubuntumirclient QPA] makeSurfaceSpec(window=%p) - creating modal dialog (width=%d, height=%d", window, width, height);
+ return Spec{mir_connection_create_spec_for_modal_dialog(connection, width, height, pixelFormat, parent->mirSurface())};
+ } else {
+ // TODO: do Qt parentless dialogs have the same semantics as mir?
+ DLOG("[ubuntumirclient QPA] makeSurfaceSpec(window=%p) - creating parentless dialog (width=%d, height=%d)", window, width, height);
+ return Spec{mir_connection_create_spec_for_dialog(connection, width, height, pixelFormat)};
+ }
+ }
+ DLOG("[ubuntumirclient QPA] makeSurfaceSpec(window=%p) - creating normal surface(type=0x%x, width=%d, height=%d)", window, type, width, height);
+ return Spec{mir_connection_create_spec_for_normal_surface(connection, width, height, pixelFormat)};
+}
+
+void setSizingConstraints(MirSurfaceSpec *spec, const QSize& minSize, const QSize& maxSize, const QSize& increment)
+{
+ mir_surface_spec_set_min_width(spec, minSize.width());
+ mir_surface_spec_set_min_height(spec, minSize.height());
+ if (maxSize.width() >= minSize.width()) {
+ mir_surface_spec_set_max_width(spec, maxSize.width());
+ }
+ if (maxSize.height() >= minSize.height()) {
+ mir_surface_spec_set_max_height(spec, maxSize.height());
+ }
+ if (increment.width() > 0) {
+ mir_surface_spec_set_width_increment(spec, increment.width());
+ }
+ if (increment.height() > 0) {
+ mir_surface_spec_set_height_increment(spec, increment.height());
+ }
+}
+
+MirSurface *createMirSurface(QWindow *window, QMirClientScreen *screen, QMirClientInput *input, MirConnection *connection)
+{
+ auto spec = makeSurfaceSpec(window, input, connection);
+ const auto title = window->title().toUtf8();
+ mir_surface_spec_set_name(spec.get(), title.constData());
+
+ setSizingConstraints(spec.get(), window->minimumSize(), window->maximumSize(), window->sizeIncrement());
+
+ if (window->windowState() == Qt::WindowFullScreen) {
+ mir_surface_spec_set_fullscreen_on_output(spec.get(), screen->mirOutputId());
+ }
+
+ auto surface = mir_surface_create_sync(spec.get());
+ Q_ASSERT(mir_surface_is_valid(surface));
+ return surface;
+}
+
+// FIXME - in order to work around https://bugs.launchpad.net/mir/+bug/1346633
+// we need to guess the panel height (3GU)
+int panelHeight()
+{
+ if (qEnvironmentVariableIsSet("QT_MIRCLIENT_IGNORE_PANEL"))
+ return 0;
+ const int defaultGridUnit = 8;
+ int gridUnit = defaultGridUnit;
+ QByteArray gridUnitString = qgetenv("GRID_UNIT_PX");
+ if (!gridUnitString.isEmpty()) {
+ bool ok;
+ gridUnit = gridUnitString.toInt(&ok);
+ if (!ok) {
+ gridUnit = defaultGridUnit;
+ }
+ }
+ return gridUnit * 3;
+}
+
+} //namespace
+
+class QMirClientSurface
+{
+public:
+ QMirClientSurface(QMirClientWindow *platformWindow, QMirClientScreen *screen, QMirClientInput *input, MirConnection *connection)
+ : mWindow(platformWindow->window())
+ , mPlatformWindow(platformWindow)
+ , mInput(input)
+ , mConnection(connection)
+ , mMirSurface(createMirSurface(mWindow, screen, input, connection))
+ , mEglDisplay(screen->eglDisplay())
+ , mEglSurface(eglCreateWindowSurface(mEglDisplay, screen->eglConfig(), nativeWindowFor(mMirSurface), nullptr))
+ , mVisible(false)
+ , mNeedsRepaint(false)
+ , mParented(mWindow->transientParent() || mWindow->parent())
+ , mWindowState(mWindow->windowState())
+
+ {
+ mir_surface_set_event_handler(mMirSurface, surfaceEventCallback, this);
+
+ // Window manager can give us a final size different from what we asked for
+ // so let's check what we ended up getting
+ MirSurfaceParameters parameters;
+ mir_surface_get_parameters(mMirSurface, &parameters);
+
+ auto geom = mWindow->geometry();
+ geom.setWidth(parameters.width);
+ geom.setHeight(parameters.height);
+ if (mWindowState == Qt::WindowFullScreen) {
+ geom.setY(0);
+ } else {
+ geom.setY(panelHeight());
+ }
+
+ // Assume that the buffer size matches the surface size at creation time
+ mBufferSize = geom.size();
+ platformWindow->QPlatformWindow::setGeometry(geom);
+ QWindowSystemInterface::handleGeometryChange(mWindow, geom);
+
+ DLOG("[ubuntumirclient QPA] created surface at (%d, %d) with size (%d, %d), title '%s', role: '%d'\n",
+ geom.x(), geom.y(), geom.width(), geom.height(), mWindow->title().toUtf8().constData(), roleFor(mWindow));
+ }
+
+ ~QMirClientSurface()
+ {
+ if (mEglSurface != EGL_NO_SURFACE)
+ eglDestroySurface(mEglDisplay, mEglSurface);
+ if (mMirSurface)
+ mir_surface_release_sync(mMirSurface);
+ }
+
+ QMirClientSurface(QMirClientSurface const&) = delete;
+ QMirClientSurface& operator=(QMirClientSurface const&) = delete;
+
+ void resize(const QSize& newSize);
+ void setState(Qt::WindowState newState);
+ void setVisible(bool state);
+ void updateTitle(const QString& title);
+ void setSizingConstraints(const QSize& minSize, const QSize& maxSize, const QSize& increment);
+
+ void onSwapBuffersDone();
+ void handleSurfaceResized(int width, int height);
+ int needsRepaint() const;
+
+ EGLSurface eglSurface() const { return mEglSurface; }
+ MirSurface *mirSurface() const { return mMirSurface; }
+
+private:
+ static void surfaceEventCallback(MirSurface* surface, const MirEvent *event, void* context);
+ void postEvent(const MirEvent *event);
+ void updateSurface();
+
+ QWindow * const mWindow;
+ QMirClientWindow * const mPlatformWindow;
+ QMirClientInput * const mInput;
+ MirConnection * const mConnection;
+
+ MirSurface * const mMirSurface;
+ const EGLDisplay mEglDisplay;
+ const EGLSurface mEglSurface;
+
+ bool mVisible;
+ bool mNeedsRepaint;
+ bool mParented;
+ Qt::WindowState mWindowState;
+ QSize mBufferSize;
+
+ QMutex mTargetSizeMutex;
+ QSize mTargetSize;
+};
+
+void QMirClientSurface::resize(const QSize& size)
+{
+ DLOG("[ubuntumirclient QPA] resize(window=%p, width=%d, height=%d)", mWindow, size.width(), size.height());
+
+ if (mWindowState == Qt::WindowFullScreen || mWindowState == Qt::WindowMaximized) {
+ DLOG("[ubuntumirclient QPA] resize(window=%p) - not resizing, window is maximized or fullscreen", mWindow);
+ return;
+ }
+
+ if (size.isEmpty()) {
+ DLOG("[ubuntumirclient QPA] resize(window=%p) - not resizing, size is empty", mWindow);
+ return;
+ }
+
+ Spec spec{mir_connection_create_spec_for_changes(mConnection)};
+ mir_surface_spec_set_width(spec.get(), size.width());
+ mir_surface_spec_set_height(spec.get(), size.height());
+ mir_surface_apply_spec(mMirSurface, spec.get());
+}
+
+void QMirClientSurface::setState(Qt::WindowState newState)
+{
+ mir_wait_for(mir_surface_set_state(mMirSurface, qtWindowStateToMirSurfaceState(newState)));
+ mWindowState = newState;
+}
+
+void QMirClientSurface::setVisible(bool visible)
+{
+ if (mVisible == visible)
+ return;
+
+ mVisible = visible;
+
+ if (mVisible)
+ updateSurface();
+
+ // TODO: Use the new mir_surface_state_hidden state instead of mir_surface_state_minimized.
+ // Will have to change qtmir and unity8 for that.
+ const auto newState = visible ? qtWindowStateToMirSurfaceState(mWindowState) : mir_surface_state_minimized;
+ mir_wait_for(mir_surface_set_state(mMirSurface, newState));
+}
+
+void QMirClientSurface::updateTitle(const QString& newTitle)
+{
+ const auto title = newTitle.toUtf8();
+ Spec spec{mir_connection_create_spec_for_changes(mConnection)};
+ mir_surface_spec_set_name(spec.get(), title.constData());
+ mir_surface_apply_spec(mMirSurface, spec.get());
+}
+
+void QMirClientSurface::setSizingConstraints(const QSize& minSize, const QSize& maxSize, const QSize& increment)
+{
+ Spec spec{mir_connection_create_spec_for_changes(mConnection)};
+ ::setSizingConstraints(spec.get(), minSize, maxSize, increment);
+ mir_surface_apply_spec(mMirSurface, spec.get());
+}
+
+void QMirClientSurface::handleSurfaceResized(int width, int height)
+{
+ QMutexLocker lock(&mTargetSizeMutex);
+
+ // mir's resize event is mainly a signal that we need to redraw our content. We use the
+ // width/height as identifiers to figure out if this is the latest surface resize event
+ // that has posted, discarding any old ones. This avoids issuing too many redraw events.
+ // see TODO in postEvent as the ideal way we should handle this.
+ // The actual buffer size may or may have not changed at this point, so let the rendering
+ // thread drive the window geometry updates.
+ mNeedsRepaint = mTargetSize.width() == width && mTargetSize.height() == height;
+}
+
+int QMirClientSurface::needsRepaint() const
+{
+ if (mNeedsRepaint) {
+ if (mTargetSize != mBufferSize) {
+ //If the buffer hasn't changed yet, we need at least two redraws,
+ //once to get the new buffer size and propagate the geometry changes
+ //and the second to redraw the content at the new size
+ return 2;
+ } else {
+ // The buffer size has already been updated so we only need one redraw
+ // to render at the new size
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void QMirClientSurface::onSwapBuffersDone()
+{
+#if !defined(QT_NO_DEBUG)
+ static int sFrameNumber = 0;
+ ++sFrameNumber;
+#endif
+
+ EGLint eglSurfaceWidth = -1;
+ EGLint eglSurfaceHeight = -1;
+ eglQuerySurface(mEglDisplay, mEglSurface, EGL_WIDTH, &eglSurfaceWidth);
+ eglQuerySurface(mEglDisplay, mEglSurface, EGL_HEIGHT, &eglSurfaceHeight);
+
+ const bool validSize = eglSurfaceWidth > 0 && eglSurfaceHeight > 0;
+
+ if (validSize && (mBufferSize.width() != eglSurfaceWidth || mBufferSize.height() != eglSurfaceHeight)) {
+
+ DLOG("[ubuntumirclient QPA] onSwapBuffersDone(window=%p) [%d] - size changed (%d, %d) => (%d, %d)",
+ mWindow, sFrameNumber, mBufferSize.width(), mBufferSize.height(), eglSurfaceWidth, eglSurfaceHeight);
+
+ mBufferSize.rwidth() = eglSurfaceWidth;
+ mBufferSize.rheight() = eglSurfaceHeight;
+
+ QRect newGeometry = mPlatformWindow->geometry();
+ newGeometry.setSize(mBufferSize);
+
+ mPlatformWindow->QPlatformWindow::setGeometry(newGeometry);
+ QWindowSystemInterface::handleGeometryChange(mWindow, newGeometry);
+ } else {
+#if 0
+ DLOG("[ubuntumirclient QPA] onSwapBuffersDone(window=%p) [%d] - buffer size (%d,%d)",
+ mWindow, sFrameNumber, mBufferSize.width(), mBufferSize.height());
+#endif
+ }
+}
+
+void QMirClientSurface::surfaceEventCallback(MirSurface *surface, const MirEvent *event, void* context)
+{
+ Q_UNUSED(surface);
+ Q_ASSERT(context != nullptr);
+
+ auto s = static_cast<QMirClientSurface *>(context);
+ s->postEvent(event);
+}
+
+void QMirClientSurface::postEvent(const MirEvent *event)
+{
+ if (mir_event_type_resize == mir_event_get_type(event)) {
+ // TODO: The current event queue just accumulates all resize events;
+ // It would be nicer if we could update just one event if that event has not been dispatched.
+ // As a workaround, we use the width/height as an identifier of this latest event
+ // so the event handler (handleSurfaceResized) can discard/ignore old ones.
+ const auto resizeEvent = mir_event_get_resize_event(event);
+ const auto width = mir_resize_event_get_width(resizeEvent);
+ const auto height = mir_resize_event_get_height(resizeEvent);
+ DLOG("[ubuntumirclient QPA] resizeEvent(window=%p, width=%d, height=%d)", mWindow, width, height);
+
+ QMutexLocker lock(&mTargetSizeMutex);
+ mTargetSize.rwidth() = width;
+ mTargetSize.rheight() = height;
+ }
+
+ mInput->postEvent(mPlatformWindow, event);
+}
+
+void QMirClientSurface::updateSurface()
+{
+ DLOG("[ubuntumirclient QPA] updateSurface(window=%p)", mWindow);
+
+ if (!mParented && mWindow->type() == Qt::Dialog) {
+ // The dialog may have been parented after creation time
+ // so morph it into a modal dialog
+ auto parent = transientParentFor(mWindow);
+ if (parent) {
+ DLOG("[ubuntumirclient QPA] updateSurface(window=%p) dialog now parented", mWindow);
+ mParented = true;
+ Spec spec{mir_connection_create_spec_for_changes(mConnection)};
+ mir_surface_spec_set_parent(spec.get(), parent->mirSurface());
+ mir_surface_apply_spec(mMirSurface, spec.get());
+ }
+ }
+}
+
+QMirClientWindow::QMirClientWindow(QWindow *w, const QSharedPointer<QMirClientClipboard> &clipboard, QMirClientScreen *screen,
+ QMirClientInput *input, MirConnection *connection)
+ : QObject(nullptr)
+ , QPlatformWindow(w)
+ , mId(makeId())
+ , mClipboard(clipboard)
+ , mSurface(new QMirClientSurface{this, screen, input, connection})
+{
+ DLOG("[ubuntumirclient QPA] QMirClientWindow(window=%p, screen=%p, input=%p, surf=%p)", w, screen, input, mSurface.get());
+}
+
+QMirClientWindow::~QMirClientWindow()
+{
+ DLOG("[ubuntumirclient QPA] ~QMirClientWindow(window=%p)", this);
+}
+
+void QMirClientWindow::handleSurfaceResized(int width, int height)
+{
+ QMutexLocker lock(&mMutex);
+ DLOG("[ubuntumirclient QPA] handleSurfaceResize(window=%p, width=%d, height=%d)", window(), width, height);
+
+ mSurface->handleSurfaceResized(width, height);
+
+ // This resize event could have occurred just after the last buffer swap for this window.
+ // This means the client may still be holding a buffer with the older size. The first redraw call
+ // will then render at the old size. After swapping the client now will get a new buffer with the
+ // updated size but it still needs re-rendering so another redraw may be needed.
+ // A mir API to drop the currently held buffer would help here, so that we wouldn't have to redraw twice
+ auto const numRepaints = mSurface->needsRepaint();
+ DLOG("[ubuntumirclient QPA] handleSurfaceResize(window=%p) redraw %d times", window(), numRepaints);
+ for (int i = 0; i < numRepaints; i++) {
+ DLOG("[ubuntumirclient QPA] handleSurfaceResize(window=%p) repainting width=%d, height=%d", window(), geometry().size().width(), geometry().size().height());
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+ }
+}
+
+void QMirClientWindow::handleSurfaceFocused()
+{
+ DLOG("[ubuntumirclient QPA] handleSurfaceFocused(window=%p)", window());
+
+ // System clipboard contents might have changed while this window was unfocused and without
+ // this process getting notified about it because it might have been suspended (due to
+ // application lifecycle policies), thus unable to listen to any changes notified through
+ // D-Bus.
+ // Therefore let's ensure we are up to date with the system clipboard now that we are getting
+ // focused again.
+ mClipboard->requestDBusClipboardContents();
+}
+
+void QMirClientWindow::setWindowState(Qt::WindowState state)
+{
+ QMutexLocker lock(&mMutex);
+ DLOG("[ubuntumirclient QPA] setWindowState(window=%p, %s)", this, qtWindowStateToStr(state));
+ mSurface->setState(state);
+
+ updatePanelHeightHack(state);
+}
+
+/*
+ FIXME: Mir does not let clients know the position of their windows in the virtual
+ desktop space. So we have this ugly hack that assumes a phone situation where the
+ window is always on the top-left corner, right below the indicators panel if not
+ in fullscreen.
+ */
+void QMirClientWindow::updatePanelHeightHack(Qt::WindowState state)
+{
+ if (state == Qt::WindowFullScreen && geometry().y() != 0) {
+ QRect newGeometry = geometry();
+ newGeometry.setY(0);
+ QPlatformWindow::setGeometry(newGeometry);
+ QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
+ } else if (geometry().y() == 0) {
+ QRect newGeometry = geometry();
+ newGeometry.setY(panelHeight());
+ QPlatformWindow::setGeometry(newGeometry);
+ QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
+ }
+}
+
+void QMirClientWindow::setGeometry(const QRect& rect)
+{
+ QMutexLocker lock(&mMutex);
+ DLOG("[ubuntumirclient QPA] setGeometry (window=%p, x=%d, y=%d, width=%d, height=%d)",
+ window(), rect.x(), rect.y(), rect.width(), rect.height());
+
+ //NOTE: mir surfaces cannot be moved by the client so ignore the topLeft coordinates
+ const auto newSize = rect.size();
+ auto newGeometry = geometry();
+ newGeometry.setSize(newSize);
+ QPlatformWindow::setGeometry(newGeometry);
+
+ mSurface->resize(newSize);
+}
+
+void QMirClientWindow::setVisible(bool visible)
+{
+ QMutexLocker lock(&mMutex);
+ DLOG("[ubuntumirclient QPA] setVisible (window=%p, visible=%s)", window(), visible ? "true" : "false");
+
+ mSurface->setVisible(visible);
+ const QRect& exposeRect = visible ? QRect(QPoint(), geometry().size()) : QRect();
+
+ lock.unlock();
+ QWindowSystemInterface::handleExposeEvent(window(), exposeRect);
+ QWindowSystemInterface::flushWindowSystemEvents();
+}
+
+void QMirClientWindow::setWindowTitle(const QString& title)
+{
+ QMutexLocker lock(&mMutex);
+ DLOG("[ubuntumirclient QPA] setWindowTitle(window=%p) title=%s)", window(), title.toUtf8().constData());
+ mSurface->updateTitle(title);
+}
+
+void QMirClientWindow::propagateSizeHints()
+{
+ QMutexLocker lock(&mMutex);
+ const auto win = window();
+ DLOG("[ubuntumirclient QPA] propagateSizeHints(window=%p) min(%d,%d), max(%d,%d) increment(%d, %d)",
+ win, win->minimumSize().width(), win->minimumSize().height(),
+ win->maximumSize().width(), win->maximumSize().height(),
+ win->sizeIncrement().width(), win->sizeIncrement().height());
+ mSurface->setSizingConstraints(win->minimumSize(), win->maximumSize(), win->sizeIncrement());
+}
+
+void* QMirClientWindow::eglSurface() const
+{
+ return mSurface->eglSurface();
+}
+
+MirSurface *QMirClientWindow::mirSurface() const
+{
+ return mSurface->mirSurface();
+}
+
+WId QMirClientWindow::winId() const
+{
+ return mId;
+}
+
+void QMirClientWindow::onSwapBuffersDone()
+{
+ QMutexLocker lock(&mMutex);
+ mSurface->onSwapBuffersDone();
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.h b/src/plugins/platforms/mirclient/qmirclientwindow.h
new file mode 100644
index 0000000000..4ec7879949
--- /dev/null
+++ b/src/plugins/platforms/mirclient/qmirclientwindow.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 Canonical, Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QMIRCLIENTWINDOW_H
+#define QMIRCLIENTWINDOW_H
+
+#include <qpa/qplatformwindow.h>
+#include <QSharedPointer>
+#include <QMutex>
+
+#include <memory>
+
+class QMirClientClipboard;
+class QMirClientInput;
+class QMirClientScreen;
+class QMirClientSurface;
+struct MirConnection;
+struct MirSurface;
+
+class QMirClientWindow : public QObject, public QPlatformWindow
+{
+ Q_OBJECT
+public:
+ QMirClientWindow(QWindow *w, const QSharedPointer<QMirClientClipboard> &clipboard, QMirClientScreen *screen,
+ QMirClientInput *input, MirConnection *mirConnection);
+ virtual ~QMirClientWindow();
+
+ // QPlatformWindow methods.
+ WId winId() const override;
+ void setGeometry(const QRect&) override;
+ void setWindowState(Qt::WindowState state) override;
+ void setVisible(bool visible) override;
+ void setWindowTitle(const QString &title) override;
+ void propagateSizeHints() override;
+
+ // New methods.
+ void *eglSurface() const;
+ MirSurface *mirSurface() const;
+ void handleSurfaceResized(int width, int height);
+ void handleSurfaceFocused();
+ void onSwapBuffersDone();
+
+private:
+ void updatePanelHeightHack(Qt::WindowState);
+ mutable QMutex mMutex;
+ const WId mId;
+ const QSharedPointer<QMirClientClipboard> mClipboard;
+ std::unique_ptr<QMirClientSurface> mSurface;
+};
+
+#endif // QMIRCLIENTWINDOW_H
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index 22d443733e..43bb04e318 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -40,3 +40,5 @@ contains(QT_CONFIG, linuxfb): SUBDIRS += linuxfb
haiku {
SUBDIRS += haiku
}
+
+contains(QT_CONFIG, mirclient): SUBDIRS += mirclient
diff --git a/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp b/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp
index 985cc14b1d..7bec1fb603 100644
--- a/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp
+++ b/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp
@@ -62,7 +62,7 @@ bool QQnxAbstractNavigator::invokeUrl(const QUrl &url)
// which is not recognized by the navigator anymore
const bool result = requestInvokeUrl(url.toString().toUtf8());
- qNavigatorDebug() << Q_FUNC_INFO << "url=" << url << "result=" << result;
+ qNavigatorDebug() << "url=" << url << "result=" << result;
return result;
}
diff --git a/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.cpp b/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.cpp
index e5c853dad8..04e264860e 100644
--- a/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.cpp
+++ b/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.cpp
@@ -124,4 +124,25 @@ void QQnxAbstractVirtualKeyboard::setLocale(const QLocale &locale)
emit localeChanged(locale);
}
+QQnxAbstractVirtualKeyboard::EnterKeyType
+ QQnxAbstractVirtualKeyboard::qtEnterKeyTypeToQnx(Qt::EnterKeyType type)
+{
+ switch (type) {
+ case Qt::EnterKeyDone:
+ return Done;
+ case Qt::EnterKeyGo:
+ return Go;
+ case Qt::EnterKeyNext:
+ return Next;
+ case Qt::EnterKeySearch:
+ return Search;
+ case Qt::EnterKeySend:
+ return Send;
+ case Qt::EnterKeyDefault:
+ case Qt::EnterKeyReturn:
+ case Qt::EnterKeyPrevious: // unsupported
+ return DefaultReturn;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.h b/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.h
index 8bf8313000..2fa2ed7291 100644
--- a/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.h
+++ b/src/plugins/platforms/qnx/qqnxabstractvirtualkeyboard.h
@@ -74,6 +74,8 @@ public:
KeyboardMode keyboardMode() const { return m_keyboardMode; }
EnterKeyType enterKeyType() const { return m_enterKeyType; }
+ static EnterKeyType qtEnterKeyTypeToQnx(Qt::EnterKeyType type);
+
Q_SIGNALS:
void heightChanged(int height);
void visibilityChanged(bool visible);
diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
index 3950681c5e..66843283b6 100644
--- a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
+++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
@@ -78,7 +78,7 @@ QQnxBpsEventFilter::~QQnxBpsEventFilter()
void QQnxBpsEventFilter::installOnEventDispatcher(QAbstractEventDispatcher *dispatcher)
{
- qBpsEventFilterDebug() << Q_FUNC_INFO << "dispatcher=" << dispatcher;
+ qBpsEventFilterDebug() << "dispatcher=" << dispatcher;
if (navigator_request_events(NAVIGATOR_EXTENDED_DATA) != BPS_SUCCESS)
qWarning("QQNX: failed to register for navigator events");
@@ -125,7 +125,7 @@ bool QQnxBpsEventFilter::nativeEventFilter(const QByteArray &eventType, void *me
Q_UNUSED(result);
bps_event_t *event = static_cast<bps_event_t *>(message);
const int eventDomain = bps_event_get_domain(event);
- qBpsEventFilterDebug() << Q_FUNC_INFO << "event=" << event << "domain=" << eventDomain;
+ qBpsEventFilterDebug() << "event=" << event << "domain=" << eventDomain;
if (eventDomain == screen_get_domain()) {
if (!m_screenEventHandler) {
@@ -151,10 +151,10 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event)
switch (bps_event_get_code(event)) {
case NAVIGATOR_ORIENTATION_CHECK: {
const int angle = navigator_event_get_orientation_angle(event);
- qBpsEventFilterDebug() << Q_FUNC_INFO << "ORIENTATION CHECK event. angle=" << angle;
+ qBpsEventFilterDebug() << "ORIENTATION CHECK event. angle=" << angle;
const bool result = m_navigatorEventHandler->handleOrientationCheck(angle);
- qBpsEventFilterDebug() << Q_FUNC_INFO << "ORIENTATION CHECK event. result=" << result;
+ qBpsEventFilterDebug() << "ORIENTATION CHECK event. result=" << result;
// reply to navigator whether orientation is acceptable
navigator_orientation_check_response(event, result);
@@ -163,7 +163,7 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event)
case NAVIGATOR_ORIENTATION: {
const int angle = navigator_event_get_orientation_angle(event);
- qBpsEventFilterDebug() << Q_FUNC_INFO << "ORIENTATION event. angle=" << angle;
+ qBpsEventFilterDebug() << "ORIENTATION event. angle=" << angle;
m_navigatorEventHandler->handleOrientationChange(angle);
navigator_done_orientation(event);
@@ -171,17 +171,17 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event)
}
case NAVIGATOR_SWIPE_DOWN:
- qBpsEventFilterDebug() << Q_FUNC_INFO << "SWIPE DOWN event";
+ qBpsEventFilterDebug("SWIPE DOWN event");
m_navigatorEventHandler->handleSwipeDown();
break;
case NAVIGATOR_EXIT:
- qBpsEventFilterDebug() << Q_FUNC_INFO << "EXIT event";
+ qBpsEventFilterDebug("EXIT event");
m_navigatorEventHandler->handleExit();
break;
case NAVIGATOR_WINDOW_STATE: {
- qBpsEventFilterDebug() << Q_FUNC_INFO << "WINDOW STATE event";
+ qBpsEventFilterDebug("WINDOW STATE event");
const navigator_window_state_t state = navigator_event_get_window_state(event);
const QByteArray id(navigator_event_get_groupid(event));
@@ -200,14 +200,14 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event)
}
case NAVIGATOR_WINDOW_ACTIVE: {
- qBpsEventFilterDebug() << Q_FUNC_INFO << "WINDOW ACTIVE event";
+ qBpsEventFilterDebug("WINDOW ACTIVE event");
const QByteArray id(navigator_event_get_groupid(event));
m_navigatorEventHandler->handleWindowGroupActivated(id);
break;
}
case NAVIGATOR_WINDOW_INACTIVE: {
- qBpsEventFilterDebug() << Q_FUNC_INFO << "WINDOW INACTIVE event";
+ qBpsEventFilterDebug("WINDOW INACTIVE event");
const QByteArray id(navigator_event_get_groupid(event));
m_navigatorEventHandler->handleWindowGroupDeactivated(id);
break;
@@ -219,7 +219,7 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event)
return false;
default:
- qBpsEventFilterDebug() << Q_FUNC_INFO << "Unhandled navigator event. code=" << bps_event_get_code(event);
+ qBpsEventFilterDebug() << "Unhandled navigator event. code=" << bps_event_get_code(event);
return false;
}
diff --git a/src/plugins/platforms/qnx/qqnxbuffer.cpp b/src/plugins/platforms/qnx/qqnxbuffer.cpp
index 2c3a42ac7c..7ee6664676 100644
--- a/src/plugins/platforms/qnx/qqnxbuffer.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuffer.cpp
@@ -51,13 +51,13 @@ QT_BEGIN_NAMESPACE
QQnxBuffer::QQnxBuffer()
: m_buffer(0)
{
- qBufferDebug() << Q_FUNC_INFO << "empty";
+ qBufferDebug("empty");
}
QQnxBuffer::QQnxBuffer(screen_buffer_t buffer)
: m_buffer(buffer)
{
- qBufferDebug() << Q_FUNC_INFO << "normal";
+ qBufferDebug("normal");
// Get size of buffer
int size[2];
@@ -118,17 +118,17 @@ QQnxBuffer::QQnxBuffer(const QQnxBuffer &other)
: m_buffer(other.m_buffer),
m_image(other.m_image)
{
- qBufferDebug() << Q_FUNC_INFO << "copy";
+ qBufferDebug("copy");
}
QQnxBuffer::~QQnxBuffer()
{
- qBufferDebug() << Q_FUNC_INFO;
+ qBufferDebug();
}
void QQnxBuffer::invalidateInCache()
{
- qBufferDebug() << Q_FUNC_INFO;
+ qBufferDebug();
// Verify native buffer exists
if (m_buffer == 0)
diff --git a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
index ae3153336f..614bfc381f 100644
--- a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
@@ -74,7 +74,7 @@ QQnxButtonEventNotifier::~QQnxButtonEventNotifier()
void QQnxButtonEventNotifier::start()
{
- qButtonDebug() << Q_FUNC_INFO << "starting hardware button event processing";
+ qButtonDebug("starting hardware button event processing");
if (m_fd != -1)
return;
@@ -91,7 +91,7 @@ void QQnxButtonEventNotifier::start()
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(updateButtonStates()));
- qButtonDebug() << Q_FUNC_INFO << "successfully connected to Navigator. fd =" << m_fd;
+ qButtonDebug() << "successfully connected to Navigator. fd =" << m_fd;
}
void QQnxButtonEventNotifier::updateButtonStates()
@@ -115,7 +115,7 @@ void QQnxButtonEventNotifier::updateButtonStates()
// Ensure data is null terminated
buffer[bytes] = '\0';
- qButtonDebug() << Q_FUNC_INFO << "received PPS message:\n" << buffer;
+ qButtonDebug() << "received PPS message:\n" << buffer;
// Process received message
QByteArray ppsData = QByteArray::fromRawData(buffer, bytes);
@@ -197,7 +197,7 @@ bool QQnxButtonEventNotifier::parsePPS(const QByteArray &ppsData, QHash<QByteArr
// tokenize current attribute
const QByteArray &attr = lines.at(i);
- qButtonDebug() << Q_FUNC_INFO << "attr=" << attr;
+ qButtonDebug() << "attr=" << attr;
int doubleColon = attr.indexOf(QByteArrayLiteral("::"));
if (doubleColon == -1) {
diff --git a/src/plugins/platforms/qnx/qqnxclipboard.cpp b/src/plugins/platforms/qnx/qqnxclipboard.cpp
index 95ab00bb7e..30af5a04a5 100644
--- a/src/plugins/platforms/qnx/qqnxclipboard.cpp
+++ b/src/plugins/platforms/qnx/qqnxclipboard.cpp
@@ -94,13 +94,13 @@ public:
void addFormatToCheck(const QString &format) {
m_formatsToCheck << format;
- qClipboardDebug() << Q_FUNC_INFO << "formats=" << m_formatsToCheck;
+ qClipboardDebug() << "formats=" << m_formatsToCheck;
}
bool hasFormat(const QString &mimetype) const
{
const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0;
- qClipboardDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "result=" << result;
+ qClipboardDebug() << "mimetype=" << mimetype << "result=" << result;
return result;
}
@@ -113,7 +113,7 @@ public:
result << format;
}
- qClipboardDebug() << Q_FUNC_INFO << "result=" << result;
+ qClipboardDebug() << "result=" << result;
return result;
}
@@ -137,7 +137,7 @@ public:
protected:
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const
{
- qClipboardDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "preferredType=" << preferredType;
+ qClipboardDebug() << "mimetype=" << mimetype << "preferredType=" << preferredType;
if (is_clipboard_format_present(mimetype.toUtf8().constData()) != 0)
return QMimeData::retrieveData(mimetype, preferredType);
@@ -149,7 +149,7 @@ private Q_SLOTS:
void releaseOwnership()
{
if (m_userMimeData) {
- qClipboardDebug() << Q_FUNC_INFO << "user data formats=" << m_userMimeData->formats() << "system formats=" << formats();
+ qClipboardDebug() << "user data formats=" << m_userMimeData->formats() << "system formats=" << formats();
delete m_userMimeData;
m_userMimeData = 0;
m_clipboard->emitChanged(QClipboard::Clipboard);
@@ -195,7 +195,7 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
}
const QStringList formats = data->formats();
- qClipboardDebug() << Q_FUNC_INFO << "formats=" << formats;
+ qClipboardDebug() << "formats=" << formats;
Q_FOREACH (const QString &format, formats) {
const QByteArray buf = data->data(format);
@@ -204,7 +204,7 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
continue;
int ret = set_clipboard_data(format.toUtf8().data(), buf.size(), buf.data());
- qClipboardDebug() << Q_FUNC_INFO << "set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
+ qClipboardDebug() << "set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
if (ret)
m_mimeData->addFormatToCheck(format);
}
diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
index 77630018e9..00eaf2bf03 100644
--- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
@@ -115,7 +115,7 @@ void QQnxEglWindow::destroyEGLSurface()
void QQnxEglWindow::swapEGLBuffers()
{
- qEglWindowDebug() << Q_FUNC_INFO;
+ qEglWindowDebug();
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE)
diff --git a/src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp b/src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp
index bad29d5f1d..3bc84686e0 100644
--- a/src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp
+++ b/src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp
@@ -69,7 +69,7 @@ QQnxFileDialogHelper::~QQnxFileDialogHelper()
void QQnxFileDialogHelper::exec()
{
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
// Clear any previous results
m_dialog->setDirectories(QStringList());
@@ -85,7 +85,7 @@ bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modali
Q_UNUSED(parent);
Q_UNUSED(modality);
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
// Create dialog
const QSharedPointer<QFileDialogOptions> &opts = options();
@@ -125,13 +125,13 @@ bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modali
void QQnxFileDialogHelper::hide()
{
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
m_dialog->close();
}
bool QQnxFileDialogHelper::defaultNameFilterDisables() const
{
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
return false;
}
@@ -142,7 +142,7 @@ void QQnxFileDialogHelper::setDirectory(const QUrl &directory)
QUrl QQnxFileDialogHelper::directory() const
{
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
if (!m_dialog->directories().isEmpty())
return QUrl::fromLocalFile(m_dialog->directories().first());
@@ -156,7 +156,7 @@ void QQnxFileDialogHelper::selectFile(const QUrl &fileName)
QList<QUrl> QQnxFileDialogHelper::selectedFiles() const
{
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
QList<QUrl> urls;
QStringList files = m_dialog->selectedFiles();
Q_FOREACH (const QString &file, files)
@@ -167,12 +167,12 @@ QList<QUrl> QQnxFileDialogHelper::selectedFiles() const
void QQnxFileDialogHelper::setFilter()
{
// No native api to support setting a filter from QDir::Filters
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
}
void QQnxFileDialogHelper::selectNameFilter(const QString &filter)
{
- qFileDialogHelperDebug() << Q_FUNC_INFO << "filter =" << filter;
+ qFileDialogHelperDebug() << "filter =" << filter;
setNameFilter(filter);
}
@@ -180,7 +180,7 @@ QString QQnxFileDialogHelper::selectedNameFilter() const
{
// For now there is no way for the user to change the selected filter
// so this just reflects what the developer has set programmatically.
- qFileDialogHelperDebug() << Q_FUNC_INFO;
+ qFileDialogHelperDebug();
return m_selectedFilter;
}
@@ -194,14 +194,14 @@ void QQnxFileDialogHelper::emitSignals()
void QQnxFileDialogHelper::setNameFilter(const QString &filter)
{
- qFileDialogHelperDebug() << Q_FUNC_INFO << "filter =" << filter;
+ qFileDialogHelperDebug() << "filter =" << filter;
setNameFilters(QPlatformFileDialogHelper::cleanFilterList(filter));
}
void QQnxFileDialogHelper::setNameFilters(const QStringList &filters)
{
- qFileDialogHelperDebug() << Q_FUNC_INFO << "filters =" << filters;
+ qFileDialogHelperDebug() << "filters =" << filters;
Q_ASSERT(!filters.isEmpty());
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp
index deac419a36..5ef8d72926 100644
--- a/src/plugins/platforms/qnx/qqnxglcontext.cpp
+++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp
@@ -56,7 +56,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
m_glContext(glContext),
m_currentEglSurface(EGL_NO_SURFACE)
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
QSurfaceFormat format = m_glContext->format();
// Set current rendering API
@@ -132,7 +132,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
QQnxGLContext::~QQnxGLContext()
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
// Cleanup EGL context if it exists
if (m_eglContext != EGL_NO_CONTEXT)
@@ -166,7 +166,7 @@ EGLenum QQnxGLContext::checkEGLError(const char *msg)
void QQnxGLContext::initializeContext()
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
// Initialize connection to EGL
ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
@@ -184,7 +184,7 @@ void QQnxGLContext::initializeContext()
void QQnxGLContext::shutdownContext()
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
// Close connection to EGL
eglTerminate(ms_eglDisplay);
@@ -192,7 +192,7 @@ void QQnxGLContext::shutdownContext()
bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
@@ -223,7 +223,7 @@ bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
void QQnxGLContext::doneCurrent()
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
// set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
@@ -238,7 +238,7 @@ void QQnxGLContext::doneCurrent()
void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
QQnxEglWindow *platformWindow = dynamic_cast<QQnxEglWindow*>(surface);
if (!platformWindow)
return;
@@ -248,7 +248,7 @@ void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName)
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
@@ -270,7 +270,7 @@ EGLDisplay QQnxGLContext::getEglDisplay() {
EGLint *QQnxGLContext::contextAttrs(const QSurfaceFormat &format)
{
- qGLContextDebug() << Q_FUNC_INFO;
+ qGLContextDebug();
// Choose EGL settings based on OpenGL version
#if defined(QT_OPENGL_ES_2)
diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
index 3506de4bc0..3af481b991 100644
--- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
@@ -191,7 +191,7 @@ static int32_t ic_begin_batch_edit(input_session_t *ic)
// See comment at beginning of namespace declaration for general information
static int32_t ic_commit_text(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfCommitText);
event.ct.text = text;
@@ -206,7 +206,7 @@ static int32_t ic_commit_text(input_session_t *ic, spannable_string_t *text, int
// See comment at beginning of namespace declaration for general information
static int32_t ic_delete_surrounding_text(input_session_t *ic, int32_t left_length, int32_t right_length)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfDeleteSurroundingText);
event.dst.left_length = left_length;
@@ -230,7 +230,7 @@ static int32_t ic_end_batch_edit(input_session_t *ic)
// See comment at beginning of namespace declaration for general information
static int32_t ic_finish_composing_text(input_session_t *ic)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfFinishComposingText);
event.fct.result = -1;
@@ -243,7 +243,7 @@ static int32_t ic_finish_composing_text(input_session_t *ic)
// See comment at beginning of namespace declaration for general information
static int32_t ic_get_cursor_position(input_session_t *ic)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfGetCursorPosition);
event.gcp.result = -1;
@@ -256,7 +256,7 @@ static int32_t ic_get_cursor_position(input_session_t *ic)
// See comment at beginning of namespace declaration for general information
static spannable_string_t *ic_get_text_after_cursor(input_session_t *ic, int32_t n, int32_t flags)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfGetTextAfterCursor);
event.gtac.n = n;
@@ -271,7 +271,7 @@ static spannable_string_t *ic_get_text_after_cursor(input_session_t *ic, int32_t
// See comment at beginning of namespace declaration for general information
static spannable_string_t *ic_get_text_before_cursor(input_session_t *ic, int32_t n, int32_t flags)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfGetTextBeforeCursor);
event.gtac.n = n;
@@ -286,7 +286,7 @@ static spannable_string_t *ic_get_text_before_cursor(input_session_t *ic, int32_
// See comment at beginning of namespace declaration for general information
static int32_t ic_send_event(input_session_t *ic, event_t *event)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest imfEvent(ic, ImfSendEvent);
imfEvent.sae.event = event;
@@ -300,7 +300,7 @@ static int32_t ic_send_event(input_session_t *ic, event_t *event)
// See comment at beginning of namespace declaration for general information
static int32_t ic_send_async_event(input_session_t *ic, event_t *event)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
// There's no difference from our point of view between ic_send_event & ic_send_async_event
QQnxImfRequest imfEvent(ic, ImfSendEvent);
@@ -315,7 +315,7 @@ static int32_t ic_send_async_event(input_session_t *ic, event_t *event)
// See comment at beginning of namespace declaration for general information
static int32_t ic_set_composing_region(input_session_t *ic, int32_t start, int32_t end)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfSetComposingRegion);
event.scr.start = start;
@@ -331,7 +331,7 @@ static int32_t ic_set_composing_region(input_session_t *ic, int32_t start, int32
// See comment at beginning of namespace declaration for general information
static int32_t ic_set_composing_text(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfSetComposingText);
event.sct.text = text;
@@ -346,7 +346,7 @@ static int32_t ic_set_composing_text(input_session_t *ic, spannable_string_t *te
// See comment at beginning of namespace declaration for general information
static int32_t ic_is_text_selected(input_session_t* ic, int32_t* pIsSelected)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfIsTextSelected);
event.its.pIsSelected = pIsSelected;
@@ -360,7 +360,7 @@ static int32_t ic_is_text_selected(input_session_t* ic, int32_t* pIsSelected)
// See comment at beginning of namespace declaration for general information
static int32_t ic_is_all_text_selected(input_session_t* ic, int32_t* pIsSelected)
{
- qInputContextIMFRequestDebug() << Q_FUNC_INFO;
+ qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfIsAllTextSelected);
event.its.pIsSelected = pIsSelected;
@@ -496,7 +496,7 @@ initEvent(event_t *pEvent, const input_session_t *pSession, EventType eventType,
static spannable_string_t *toSpannableString(const QString &text)
{
- qInputContextDebug() << Q_FUNC_INFO << text;
+ qInputContextDebug() << text;
spannable_string_t *pString = static_cast<spannable_string_t *>(malloc(sizeof(spannable_string_t)));
pString->str = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * text.length() + 1));
@@ -539,7 +539,7 @@ static bool imfAvailable()
p_vkb_init_selection_service = (int32_t (*)())dlsym(handle, "vkb_init_selection_service");
p_ictrl_get_num_active_sessions = (int32_t (*)())dlsym(handle, "ictrl_get_num_active_sessions");
} else {
- qCritical() << Q_FUNC_INFO << "libinput_client.so.1 is not present - IMF services are disabled.";
+ qCritical("libinput_client.so.1 is not present - IMF services are disabled.");
s_imfDisabled = true;
return false;
}
@@ -550,7 +550,7 @@ static bool imfAvailable()
p_ictrl_open_session = 0;
p_ictrl_dispatch_event = 0;
s_imfDisabled = true;
- qCritical() << Q_FUNC_INFO << "libinput_client.so.1 did not contain the correct symbols, library mismatch? IMF services are disabled.";
+ qCritical("libinput_client.so.1 did not contain the correct symbols, library mismatch? IMF services are disabled.");
return false;
}
}
@@ -571,7 +571,7 @@ QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVir
m_integration(integration),
m_virtualKeyboard(keyboard)
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
if (!imfAvailable())
return;
@@ -594,7 +594,7 @@ QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVir
QQnxInputContext::~QQnxInputContext()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
Q_ASSERT(sInputContextInstance == this);
sInputContextInstance = 0;
@@ -669,7 +669,7 @@ void QQnxInputContext::processImfEvent(QQnxImfRequest *imfEvent)
bool QQnxInputContext::filterEvent( const QEvent *event )
{
- qInputContextDebug() << Q_FUNC_INFO << event;
+ qInputContextDebug() << event;
switch (event->type()) {
case QEvent::CloseSoftwareInputPanel:
@@ -692,19 +692,19 @@ QRectF QQnxInputContext::keyboardRect() const
void QQnxInputContext::reset()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
endComposition();
}
void QQnxInputContext::commit()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
endComposition();
}
void QQnxInputContext::update(Qt::InputMethodQueries queries)
{
- qInputContextDebug() << Q_FUNC_INFO << queries;
+ qInputContextDebug() << queries;
if (queries & Qt::ImCursorPosition) {
int lastCaret = m_caretPosition;
@@ -716,7 +716,7 @@ void QQnxInputContext::update(Qt::InputMethodQueries queries)
initEvent(&caretEvent.event, sInputSession, EVENT_CARET, CARET_POS_CHANGED, sizeof(caretEvent));
caretEvent.old_pos = lastCaret;
caretEvent.new_pos = m_caretPosition;
- qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event caret changed" << lastCaret << m_caretPosition;
+ qInputContextDebug() << "ictrl_dispatch_event caret changed" << lastCaret << m_caretPosition;
p_ictrl_dispatch_event(&caretEvent.event);
}
}
@@ -724,7 +724,7 @@ void QQnxInputContext::update(Qt::InputMethodQueries queries)
void QQnxInputContext::closeSession()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
if (!imfAvailable())
return;
@@ -746,7 +746,7 @@ bool QQnxInputContext::openSession()
closeSession();
sInputSession = p_ictrl_open_session(&ic_funcs);
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
return sInputSession != 0;
}
@@ -770,7 +770,7 @@ bool QQnxInputContext::hasSelectedText()
bool QQnxInputContext::dispatchRequestSoftwareInputPanel()
{
- qInputContextDebug() << Q_FUNC_INFO << "requesting keyboard" << m_inputPanelVisible;
+ qInputContextDebug() << "requesting keyboard" << m_inputPanelVisible;
m_virtualKeyboard.showKeyboard();
return true;
@@ -778,7 +778,7 @@ bool QQnxInputContext::dispatchRequestSoftwareInputPanel()
bool QQnxInputContext::dispatchCloseSoftwareInputPanel()
{
- qInputContextDebug() << Q_FUNC_INFO << "hiding keyboard" << m_inputPanelVisible;
+ qInputContextDebug() << "hiding keyboard" << m_inputPanelVisible;
m_virtualKeyboard.hideKeyboard();
return true;
@@ -824,7 +824,7 @@ bool QQnxInputContext::dispatchFocusGainEvent(int inputHints)
focusEvent.style |= IMF_EMAIL_TYPE;
}
- qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event focus gain style:" << focusEvent.style;
+ qInputContextDebug() << "ictrl_dispatch_event focus gain style:" << focusEvent.style;
p_ictrl_dispatch_event((event_t *)&focusEvent);
@@ -834,7 +834,7 @@ bool QQnxInputContext::dispatchFocusGainEvent(int inputHints)
void QQnxInputContext::dispatchFocusLossEvent()
{
if (hasSession()) {
- qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event focus lost";
+ qInputContextDebug("ictrl_dispatch_event focus lost");
focus_event_t focusEvent;
initEvent(&focusEvent.event, sInputSession, EVENT_FOCUS, FOCUS_LOST, sizeof(focusEvent));
@@ -909,7 +909,7 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan
navigation_event_t navEvent;
initEvent(&navEvent.event, sInputSession, EVENT_NAVIGATION, key, sizeof(navEvent));
navEvent.magnitude = 1;
- qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even navigation" << key;
+ qInputContextDebug() << "ictrl_dispatch_even navigation" << key;
p_ictrl_dispatch_event(&navEvent.event);
}
} else {
@@ -922,7 +922,7 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan
keyEvent.sequence_id = sequenceId;
p_ictrl_dispatch_event(&keyEvent.event);
- qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even key" << key;
+ qInputContextDebug() << "ictrl_dispatch_even key" << key;
}
return true;
@@ -938,7 +938,7 @@ void QQnxInputContext::updateCursorPosition()
QCoreApplication::sendEvent(input, &query);
m_caretPosition = query.value(Qt::ImCursorPosition).toInt();
- qInputContextDebug() << Q_FUNC_INFO << m_caretPosition;
+ qInputContextDebug() << m_caretPosition;
}
void QQnxInputContext::endComposition()
@@ -951,7 +951,7 @@ void QQnxInputContext::endComposition()
if (hasSession()) {
action_event_t actionEvent;
initEvent(&actionEvent.event, sInputSession, EVENT_ACTION, ACTION_END_COMPOSITION, sizeof(actionEvent));
- qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even end composition";
+ qInputContextDebug("ictrl_dispatch_even end composition");
p_ictrl_dispatch_event(&actionEvent.event);
}
}
@@ -968,7 +968,7 @@ void QQnxInputContext::updateComposition(spannable_string_t *text, int32_t new_c
m_composingText = QString::fromWCharArray(text->str, text->length);
m_isComposing = true;
- qInputContextDebug() << Q_FUNC_INFO << m_composingText << new_cursor_position;
+ qInputContextDebug() << m_composingText << new_cursor_position;
QList<QInputMethodEvent::Attribute> attributes;
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor,
@@ -1017,7 +1017,7 @@ void QQnxInputContext::finishComposingText()
QObject *input = qGuiApp->focusObject();
if (input) {
- qInputContextDebug() << Q_FUNC_INFO << m_composingText;
+ qInputContextDebug() << m_composingText;
QInputMethodEvent event;
event.setCommitString(m_composingText);
@@ -1082,13 +1082,13 @@ int32_t QQnxInputContext::processEvent(event_t *event)
int32_t result = -1;
switch (event->event_type) {
case EVENT_SPELL_CHECK: {
- qInputContextDebug() << Q_FUNC_INFO << "EVENT_SPELL_CHECK";
+ qInputContextDebug("EVENT_SPELL_CHECK");
result = handleSpellCheck(reinterpret_cast<spell_check_event_t *>(event));
break;
}
case EVENT_NAVIGATION: {
- qInputContextDebug() << Q_FUNC_INFO << "EVENT_NAVIGATION";
+ qInputContextDebug("EVENT_NAVIGATION");
int key = event->event_id == NAVIGATE_UP ? KEYCODE_UP :
event->event_id == NAVIGATE_DOWN ? KEYCODE_DOWN :
@@ -1111,7 +1111,7 @@ int32_t QQnxInputContext::processEvent(event_t *event)
int flags = KEY_SYM_VALID | KEY_CAP_VALID;
if (event->event_id == IMF_KEY_DOWN)
flags |= KEY_DOWN;
- qInputContextDebug() << Q_FUNC_INFO << "EVENT_KEY" << flags << keySym;
+ qInputContextDebug() << "EVENT_KEY" << flags << keySym;
QQnxScreenEventHandler::injectKeyboardEvent(flags, keySym, modifiers, 0, keyCap);
result = 0;
break;
@@ -1127,10 +1127,10 @@ int32_t QQnxInputContext::processEvent(event_t *event)
case EVENT_USER_ACTION:
case EVENT_STROKE:
case EVENT_INVOKE_LATER:
- qCritical() << Q_FUNC_INFO << "Unsupported event type: " << event->event_type;
+ qCritical() << "Unsupported event type: " << event->event_type;
break;
default:
- qCritical() << Q_FUNC_INFO << "Unknown event type: " << event->event_type;
+ qCritical() << "Unknown event type: " << event->event_type;
}
return result;
}
@@ -1151,7 +1151,7 @@ int32_t QQnxInputContext::onCommitText(spannable_string_t *text, int32_t new_cur
int32_t QQnxInputContext::onDeleteSurroundingText(int32_t left_length, int32_t right_length)
{
- qInputContextDebug() << Q_FUNC_INFO << "L:" << left_length << " R:" << right_length;
+ qInputContextDebug() << "L:" << left_length << " R:" << right_length;
QObject *input = qGuiApp->focusObject();
if (!input)
@@ -1182,7 +1182,7 @@ int32_t QQnxInputContext::onFinishComposingText()
int32_t QQnxInputContext::onGetCursorPosition()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
QObject *input = qGuiApp->focusObject();
if (!input)
@@ -1196,7 +1196,7 @@ int32_t QQnxInputContext::onGetCursorPosition()
spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t flags)
{
Q_UNUSED(flags);
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
QObject *input = qGuiApp->focusObject();
if (!input)
@@ -1213,7 +1213,7 @@ spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t fl
spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t flags)
{
Q_UNUSED(flags);
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
QObject *input = qGuiApp->focusObject();
if (!input)
@@ -1232,7 +1232,7 @@ spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t f
int32_t QQnxInputContext::onSendEvent(event_t *event)
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
return processEvent(event);
}
@@ -1248,7 +1248,7 @@ int32_t QQnxInputContext::onSetComposingRegion(int32_t start, int32_t end)
QString text = query.value(Qt::ImSurroundingText).toString();
m_caretPosition = query.value(Qt::ImCursorPosition).toInt();
- qInputContextDebug() << Q_FUNC_INFO << text;
+ qInputContextDebug() << text;
m_isUpdatingText = true;
@@ -1291,7 +1291,7 @@ int32_t QQnxInputContext::onIsTextSelected(int32_t* pIsSelected)
{
*pIsSelected = hasSelectedText();
- qInputContextDebug() << Q_FUNC_INFO << *pIsSelected;
+ qInputContextDebug() << *pIsSelected;
return 0;
}
@@ -1307,20 +1307,20 @@ int32_t QQnxInputContext::onIsAllTextSelected(int32_t* pIsSelected)
*pIsSelected = query.value(Qt::ImSurroundingText).toString().length() == query.value(Qt::ImCurrentSelection).toString().length();
- qInputContextDebug() << Q_FUNC_INFO << *pIsSelected;
+ qInputContextDebug() << *pIsSelected;
return 0;
}
void QQnxInputContext::showInputPanel()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
dispatchRequestSoftwareInputPanel();
}
void QQnxInputContext::hideInputPanel()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
dispatchCloseSoftwareInputPanel();
}
@@ -1336,7 +1336,7 @@ QLocale QQnxInputContext::locale() const
void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{
- qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible;
+ qInputContextDebug() << "visible=" << visible;
if (m_inputPanelVisible != visible) {
m_inputPanelVisible = visible;
emitInputPanelVisibleChanged();
@@ -1345,7 +1345,7 @@ void QQnxInputContext::keyboardVisibilityChanged(bool visible)
void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{
- qInputContextDebug() << Q_FUNC_INFO << "locale=" << locale;
+ qInputContextDebug() << "locale=" << locale;
if (m_inputPanelLocale != locale) {
m_inputPanelLocale = locale;
emitLocaleChanged();
@@ -1354,7 +1354,7 @@ void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
void QQnxInputContext::setHighlightColor(int index, const QColor &color)
{
- qInputContextDebug() << Q_FUNC_INFO << "setHighlightColor" << index << color << qGuiApp->focusObject();
+ qInputContextDebug() << "setHighlightColor" << index << color << qGuiApp->focusObject();
if (!sInputContextInstance)
return;
@@ -1373,7 +1373,7 @@ void QQnxInputContext::setHighlightColor(int index, const QColor &color)
void QQnxInputContext::setFocusObject(QObject *object)
{
- qInputContextDebug() << Q_FUNC_INFO << "input item=" << object;
+ qInputContextDebug() << "input item=" << object;
// Ensure the colors are reset if we've a change in focus object
setHighlightColor(-1, QColor());
@@ -1384,13 +1384,17 @@ void QQnxInputContext::setFocusObject(QObject *object)
if (hasSession())
dispatchFocusLossEvent();
} else {
- QInputMethodQueryEvent query(Qt::ImHints);
+ QInputMethodQueryEvent query(Qt::ImHints | Qt::ImEnterKeyType);
QCoreApplication::sendEvent(object, &query);
int inputHints = query.value(Qt::ImHints).toInt();
+ Qt::EnterKeyType qtEnterKeyType = Qt::EnterKeyType(query.value(Qt::ImEnterKeyType).toInt());
dispatchFocusGainEvent(inputHints);
m_virtualKeyboard.setInputHints(inputHints);
+ m_virtualKeyboard.setEnterKeyType(
+ QQnxAbstractVirtualKeyboard::qtEnterKeyTypeToQnx(qtEnterKeyType)
+ );
if (!m_inputPanelVisible)
showInputPanel();
@@ -1399,7 +1403,7 @@ void QQnxInputContext::setFocusObject(QObject *object)
bool QQnxInputContext::checkSpelling(const QString &text, void *context, void (*spellCheckDone)(void *context, const QString &text, const QList<int> &indices))
{
- qInputContextDebug() << Q_FUNC_INFO << "text" << text;
+ qInputContextDebug() << "text" << text;
if (!imfAvailable())
return false;
diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
index 91ecffa2aa..af280f5c6f 100644
--- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
@@ -88,13 +88,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event )
if (event->type() == QEvent::CloseSoftwareInputPanel) {
m_virtualKeyboard.hideKeyboard();
- qInputContextDebug() << Q_FUNC_INFO << "hiding virtual keyboard";
+ qInputContextDebug("hiding virtual keyboard");
return false;
}
if (event->type() == QEvent::RequestSoftwareInputPanel) {
m_virtualKeyboard.showKeyboard();
- qInputContextDebug() << Q_FUNC_INFO << "requesting virtual keyboard";
+ qInputContextDebug("requesting virtual keyboard");
return false;
}
@@ -121,13 +121,13 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan
void QQnxInputContext::showInputPanel()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
m_virtualKeyboard.showKeyboard();
}
void QQnxInputContext::hideInputPanel()
{
- qInputContextDebug() << Q_FUNC_INFO;
+ qInputContextDebug();
m_virtualKeyboard.hideKeyboard();
}
@@ -148,7 +148,7 @@ void QQnxInputContext::keyboardHeightChanged()
void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{
- qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible;
+ qInputContextDebug() << "visible=" << visible;
if (m_inputPanelVisible != visible) {
m_inputPanelVisible = visible;
emitInputPanelVisibleChanged();
@@ -157,7 +157,7 @@ void QQnxInputContext::keyboardVisibilityChanged(bool visible)
void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{
- qInputContextDebug() << Q_FUNC_INFO << "locale=" << locale;
+ qInputContextDebug() << "locale=" << locale;
if (m_inputPanelLocale != locale) {
m_inputPanelLocale = locale;
emitLocaleChanged();
@@ -166,17 +166,21 @@ void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
void QQnxInputContext::setFocusObject(QObject *object)
{
- qInputContextDebug() << Q_FUNC_INFO << "input item=" << object;
+ qInputContextDebug() << "input item=" << object;
if (!inputMethodAccepted()) {
if (m_inputPanelVisible)
hideInputPanel();
} else {
- QInputMethodQueryEvent query(Qt::ImHints);
+ QInputMethodQueryEvent query(Qt::ImHints | Qt::ImEnterKeyType);
QCoreApplication::sendEvent(object, &query);
int inputHints = query.value(Qt::ImHints).toInt();
+ Qt::EnterKeyType qtEnterKeyType = Qt::EnterKeyType(query.value(Qt::ImEnterKeyType).toInt());
m_virtualKeyboard.setInputHints(inputHints);
+ m_virtualKeyboard.setEnterKeyType(
+ QQnxAbstractVirtualKeyboard::qtEnterKeyTypeToQnx(qtEnterKeyType)
+ );
if (!m_inputPanelVisible)
showInputPanel();
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 071bab7920..6548c82310 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -95,7 +95,6 @@
#include <private/qsimpledrag_p.h>
#include <QtCore/QDebug>
-#include <QtCore/QHash>
#include <errno.h>
@@ -165,7 +164,7 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
#endif
{
ms_options = parseOptions(paramList);
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
// Open connection to QNX composition manager
Q_SCREEN_CRITICALERROR(screen_create_context(&ms_screenContext, SCREEN_APPLICATION_CONTEXT),
"Failed to create screen context");
@@ -262,7 +261,7 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
QQnxIntegration::~QQnxIntegration()
{
- qIntegrationDebug() << Q_FUNC_INFO << "platform plugin shutdown begin";
+ qIntegrationDebug("platform plugin shutdown begin");
delete m_nativeInterface;
#if !defined(QT_NO_DRAGANDDROP)
@@ -326,12 +325,12 @@ QQnxIntegration::~QQnxIntegration()
// Destroy navigator interface
delete m_navigator;
- qIntegrationDebug() << Q_FUNC_INFO << "platform plugin shutdown end";
+ qIntegrationDebug("platform plugin shutdown end");
}
bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
switch (cap) {
case MultipleWindows:
case ThreadedPixmaps:
@@ -349,7 +348,7 @@ bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
QSurface::SurfaceType surfaceType = window->surfaceType();
const bool needRootWindow = options() & RootWindow;
switch (surfaceType) {
@@ -367,14 +366,14 @@ QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
return new QQnxRasterBackingStore(window);
}
#if !defined(QT_NO_OPENGL)
QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
return new QQnxGLContext(context);
}
#endif
@@ -382,14 +381,14 @@ QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLCont
#if defined(QQNX_PPS)
QPlatformInputContext *QQnxIntegration::inputContext() const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
return m_inputContext;
}
#endif
void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{
- qIntegrationDebug() << Q_FUNC_INFO << "w =" << window << ", s =" << screen;
+ qIntegrationDebug() << "w =" << window << ", s =" << screen;
// get platform window used by widget
QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());
@@ -403,7 +402,7 @@ void QQnxIntegration::moveToScreen(QWindow *window, int screen)
QAbstractEventDispatcher *QQnxIntegration::createEventDispatcher() const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
// We transfer ownersip of the event-dispatcher to QtCoreApplication
QAbstractEventDispatcher *eventDispatcher = m_eventDispatcher;
@@ -420,7 +419,7 @@ QPlatformNativeInterface *QQnxIntegration::nativeInterface() const
#if !defined(QT_NO_CLIPBOARD)
QPlatformClipboard *QQnxIntegration::clipboard() const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
#if defined(QQNX_PPS)
if (!m_clipboard)
@@ -439,7 +438,7 @@ QPlatformDrag *QQnxIntegration::drag() const
QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
if ((hint == ShowIsFullScreen) && (ms_options & FullScreenApplication))
return true;
@@ -459,7 +458,7 @@ QStringList QQnxIntegration::themeNames() const
QPlatformTheme *QQnxIntegration::createPlatformTheme(const QString &name) const
{
- qIntegrationDebug() << Q_FUNC_INFO << "name =" << name;
+ qIntegrationDebug() << "name =" << name;
if (name == QBlackberryTheme::name())
return new QBlackberryTheme(this);
return 0;
@@ -468,7 +467,7 @@ QPlatformTheme *QQnxIntegration::createPlatformTheme(const QString &name) const
QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
QMutexLocker locker(&ms_windowMapperMutex);
Q_UNUSED(locker);
return ms_windowMapper.value(qnxWindow, 0);
@@ -476,7 +475,7 @@ QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
QMutexLocker locker(&ms_windowMapperMutex);
Q_UNUSED(locker);
ms_windowMapper.insert(qnxWindow, window);
@@ -484,7 +483,7 @@ void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
QMutexLocker locker(&ms_windowMapperMutex);
Q_UNUSED(locker);
ms_windowMapper.remove(qnxWindow);
@@ -492,7 +491,7 @@ void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
void QQnxIntegration::createDisplays()
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
// Query number of displays
int displayCount = 0;
int result = screen_get_context_property_iv(ms_screenContext, SCREEN_PROPERTY_DISPLAY_COUNT,
@@ -521,11 +520,11 @@ void QQnxIntegration::createDisplays()
Q_SCREEN_CHECKERROR(result, "Failed to query display attachment");
if (!isAttached) {
- qIntegrationDebug() << Q_FUNC_INFO << "Skipping non-attached display" << i;
+ qIntegrationDebug() << "Skipping non-attached display" << i;
continue;
}
- qIntegrationDebug() << Q_FUNC_INFO << "Creating screen for display" << i;
+ qIntegrationDebug() << "Creating screen for display" << i;
createDisplay(displays[i], /*isPrimary=*/false);
} // of displays iteration
}
@@ -559,7 +558,7 @@ void QQnxIntegration::removeDisplay(QQnxScreen *screen)
void QQnxIntegration::destroyDisplays()
{
- qIntegrationDebug() << Q_FUNC_INFO;
+ qIntegrationDebug();
Q_FOREACH (QQnxScreen *screen, m_screens) {
QPlatformIntegration::destroyScreen(screen);
}
diff --git a/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp b/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp
index 67f936a8dd..0d730d6f57 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp
@@ -56,7 +56,7 @@ bool QQnxNavigatorBps::requestInvokeUrl(const QByteArray &encodedUrl)
int ret = navigator_invoke(encodedUrl, &error);
if (error) {
- qWarning() << Q_FUNC_INFO << "error=" << error;
+ qWarning() << "error=" << error;
bps_free(error);
}
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
index f179719c6b..647c53e32c 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
@@ -57,20 +57,20 @@ bool QQnxNavigatorEventHandler::handleOrientationCheck(int angle)
{
// reply to navigator that (any) orientation is acceptable
// TODO: check if top window flags prohibit orientation change
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO << "angle=" << angle;
+ qNavigatorEventHandlerDebug() << "angle=" << angle;
return true;
}
void QQnxNavigatorEventHandler::handleOrientationChange(int angle)
{
// update screen geometry and reply to navigator that we're ready
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO << "angle=" << angle;
+ qNavigatorEventHandlerDebug() << "angle=" << angle;
emit rotationChanged(angle);
}
void QQnxNavigatorEventHandler::handleSwipeDown()
{
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO;
+ qNavigatorEventHandlerDebug();
Q_EMIT swipeDown();
}
@@ -78,25 +78,25 @@ void QQnxNavigatorEventHandler::handleSwipeDown()
void QQnxNavigatorEventHandler::handleExit()
{
// shutdown everything
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO;
+ qNavigatorEventHandlerDebug();
QCoreApplication::quit();
}
void QQnxNavigatorEventHandler::handleWindowGroupActivated(const QByteArray &id)
{
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id;
+ qNavigatorEventHandlerDebug() << id;
Q_EMIT windowGroupActivated(id);
}
void QQnxNavigatorEventHandler::handleWindowGroupDeactivated(const QByteArray &id)
{
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id;
+ qNavigatorEventHandlerDebug() << id;
Q_EMIT windowGroupDeactivated(id);
}
void QQnxNavigatorEventHandler::handleWindowGroupStateChanged(const QByteArray &id, Qt::WindowState state)
{
- qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id;
+ qNavigatorEventHandlerDebug() << id;
Q_EMIT windowGroupStateChanged(id, state);
}
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
index aa47b5409b..6199eb8e11 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
@@ -74,18 +74,18 @@ QQnxNavigatorEventNotifier::~QQnxNavigatorEventNotifier()
if (m_fd != -1)
close(m_fd);
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "navigator event notifier stopped";
+ qNavigatorEventNotifierDebug("navigator event notifier stopped");
}
void QQnxNavigatorEventNotifier::start()
{
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "navigator event notifier started";
+ qNavigatorEventNotifierDebug("navigator event notifier started");
// open connection to navigator
errno = 0;
m_fd = open(navigatorControlPath, O_RDWR);
if (m_fd == -1) {
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << ": failed to open navigator pps:"
+ qNavigatorEventNotifierDebug() << "failed to open navigator pps:"
<< strerror(errno);
return;
}
@@ -96,7 +96,7 @@ void QQnxNavigatorEventNotifier::start()
void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
{
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "data=" << ppsData;
+ qNavigatorEventNotifierDebug() << "data=" << ppsData;
// tokenize pps data into lines
QList<QByteArray> lines = ppsData.split('\n');
@@ -110,7 +110,7 @@ void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray
// tokenize current attribute
const QByteArray &attr = lines.at(i);
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "attr=" << attr;
+ qNavigatorEventNotifierDebug() << "attr=" << attr;
int firstColon = attr.indexOf(':');
if (firstColon == -1) {
@@ -127,8 +127,8 @@ void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray
QByteArray key = attr.left(firstColon);
QByteArray value = attr.mid(secondColon + 1);
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "key=" << key;
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "val=" << value;
+ qNavigatorEventNotifierDebug() << "key=" << key;
+ qNavigatorEventNotifierDebug() << "val=" << value;
// save attribute value
if (key == "msg")
@@ -155,7 +155,7 @@ void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArra
}
ppsData += "\n";
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "reply=" << ppsData;
+ qNavigatorEventNotifierDebug() << "reply=" << ppsData;
// send pps message to navigator
errno = 0;
@@ -166,7 +166,7 @@ void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArra
void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id)
{
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "msg=" << msg << ", dat=" << dat << ", id=" << id;
+ qNavigatorEventNotifierDebug() << "msg=" << msg << ", dat=" << dat << ", id=" << id;
// check message type
if (msg == "orientationCheck") {
@@ -190,7 +190,7 @@ void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByt
void QQnxNavigatorEventNotifier::readData()
{
- qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "reading navigator data";
+ qNavigatorEventNotifierDebug("reading navigator data");
// allocate buffer for pps data
char buffer[ppsBufferSize];
diff --git a/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp b/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp
index c3b088ae5f..b139471669 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp
@@ -73,7 +73,7 @@ bool QQnxNavigatorPps::openPpsConnection()
return false;
}
- qNavigatorDebug() << Q_FUNC_INFO << "successfully connected to Navigator. fd=" << m_fd;
+ qNavigatorDebug() << "successfully connected to Navigator. fd=" << m_fd;
return true;
}
@@ -95,7 +95,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra
ppsMessage += "\n";
- qNavigatorDebug() << Q_FUNC_INFO << "sending PPS message:\n" << ppsMessage;
+ qNavigatorDebug() << "sending PPS message:\n" << ppsMessage;
// send pps message to navigator
errno = 0;
@@ -117,7 +117,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra
// ensure data is null terminated
buffer[bytes] = '\0';
- qNavigatorDebug() << Q_FUNC_INFO << "received PPS message:\n" << buffer;
+ qNavigatorDebug() << "received PPS message:\n" << buffer;
// process received message
QByteArray ppsData(buffer);
@@ -136,7 +136,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra
void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QByteArray> &messageFields)
{
- qNavigatorDebug() << Q_FUNC_INFO << "data=" << ppsData;
+ qNavigatorDebug() << "data=" << ppsData;
// tokenize pps data into lines
QList<QByteArray> lines = ppsData.split('\n');
@@ -151,7 +151,7 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QBy
// tokenize current attribute
const QByteArray &attr = lines.at(i);
- qNavigatorDebug() << Q_FUNC_INFO << "attr=" << attr;
+ qNavigatorDebug() << "attr=" << attr;
int firstColon = attr.indexOf(':');
if (firstColon == -1) {
@@ -168,8 +168,8 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QBy
QByteArray key = attr.left(firstColon);
QByteArray value = attr.mid(secondColon + 1);
- qNavigatorDebug() << Q_FUNC_INFO << "key=" << key;
- qNavigatorDebug() << Q_FUNC_INFO << "val=" << value;
+ qNavigatorDebug() << "key=" << key;
+ qNavigatorDebug() << "val=" << value;
messageFields[key] = value;
}
}
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index a3f86be88b..8cf4961dff 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -53,14 +53,14 @@ QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
m_needsPosting(false),
m_scrolled(false)
{
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window;
+ qRasterBackingStoreDebug() << "w =" << window;
m_window = window;
}
QQnxRasterBackingStore::~QQnxRasterBackingStore()
{
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
+ qRasterBackingStoreDebug() << "w =" << window();
}
QPaintDevice *QQnxRasterBackingStore::paintDevice()
@@ -75,7 +75,7 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
{
Q_UNUSED(offset)
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window();
+ qRasterBackingStoreDebug() << "w =" << this->window();
// Sometimes this method is called even though there is nothing to be
// flushed (posted in "screen" parlance), for instance, after an expose
@@ -103,7 +103,7 @@ void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticCont
{
Q_UNUSED(size);
Q_UNUSED(staticContents);
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window() << ", s =" << size;
+ qRasterBackingStoreDebug() << "w =" << window() << ", s =" << size;
// NOTE: defer resizing window buffers until next paint as
// resize() can be called multiple times before a paint occurs
@@ -111,7 +111,7 @@ void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticCont
bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
+ qRasterBackingStoreDebug() << "w =" << window();
m_needsPosting = true;
@@ -127,7 +127,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
+ qRasterBackingStoreDebug() << "w =" << window();
m_needsPosting = true;
platformWindow()->adjustBufferSize();
@@ -154,7 +154,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
void QQnxRasterBackingStore::endPaint()
{
- qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
+ qRasterBackingStoreDebug() << "w =" << window();
}
QQnxRasterWindow *QQnxRasterBackingStore::platformWindow() const
diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
index 6a346e2bb4..933fce0e33 100644
--- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
@@ -91,7 +91,7 @@ void QQnxRasterWindow::post(const QRegion &dirty)
// Check if render buffer exists and something was rendered
if (m_currentBufferIndex != -1 && !dirty.isEmpty()) {
- qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qRasterWindowDebug() << "window =" << window();
QQnxBuffer &currentBuffer = m_buffers[m_currentBufferIndex];
// Copy unmodified region from old render buffer to new render buffer;
@@ -124,14 +124,14 @@ void QQnxRasterWindow::post(const QRegion &dirty)
void QQnxRasterWindow::scroll(const QRegion &region, int dx, int dy, bool flush)
{
- qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qRasterWindowDebug() << "window =" << window();
blitPreviousToCurrent(region, dx, dy, flush);
m_scrolled += region;
}
QQnxBuffer &QQnxRasterWindow::renderBuffer()
{
- qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qRasterWindowDebug() << "window =" << window();
// Check if render buffer is invalid
if (m_currentBufferIndex == -1) {
@@ -192,7 +192,7 @@ void QQnxRasterWindow::resetBuffers()
void QQnxRasterWindow::blitPreviousToCurrent(const QRegion &region, int dx, int dy, bool flush)
{
- qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qRasterWindowDebug() << "window =" << window();
// Abort if previous buffer is invalid or if nothing to copy
if (m_previousBufferIndex == -1 || region.isEmpty())
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 85c7a91dec..c4125ef177 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -154,7 +154,7 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
m_coverWindow(0),
m_cursor(new QQnxCursor())
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
// Cache initial orientation of this display
int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION,
&m_initialRotation);
@@ -191,7 +191,7 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
QQnxScreen::~QQnxScreen()
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
Q_FOREACH (QQnxWindow *childWindow, m_childWindows)
childWindow->setScreen(0);
@@ -300,7 +300,7 @@ QPixmap QQnxScreen::grabWindow(WId window, int x, int y, int width, int height)
static int defaultDepth()
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
static int defaultDepth = 0;
if (defaultDepth == 0) {
// check if display depth was specified in environment variable;
@@ -314,7 +314,7 @@ static int defaultDepth()
QRect QQnxScreen::availableGeometry() const
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
// available geometry = total geometry - keyboard
return QRect(m_currentGeometry.x(), m_currentGeometry.y(),
m_currentGeometry.width(), m_currentGeometry.height() - m_keyboardHeight);
@@ -334,7 +334,7 @@ qreal QQnxScreen::refreshRate() const
qWarning("QQnxScreen: Failed to query screen mode. Using default value of 60Hz");
return 60.0;
}
- qScreenDebug() << Q_FUNC_INFO << "screen mode:" << endl
+ qScreenDebug() << "screen mode:" << endl
<< " width =" << displayMode.width << endl
<< " height =" << displayMode.height << endl
<< " refresh =" << displayMode.refresh << endl
@@ -372,7 +372,7 @@ Qt::ScreenOrientation QQnxScreen::orientation() const
else
orient = Qt::InvertedLandscapeOrientation;
}
- qScreenDebug() << Q_FUNC_INFO << "orientation =" << orient;
+ qScreenDebug() << "orientation =" << orient;
return orient;
}
@@ -398,7 +398,7 @@ static bool isOrthogonal(int angle1, int angle2)
void QQnxScreen::setRotation(int rotation)
{
- qScreenDebug() << Q_FUNC_INFO << "orientation =" << rotation;
+ qScreenDebug() << "orientation =" << rotation;
// Check if rotation changed
// We only want to rotate if we are the primary screen
if (m_currentRotation != rotation && isPrimaryScreen()) {
@@ -419,7 +419,7 @@ void QQnxScreen::setRotation(int rotation)
// Resize root window if we've rotated 90 or 270 from previous orientation
if (isOrthogonal(m_currentRotation, rotation)) {
- qScreenDebug() << Q_FUNC_INFO << "resize, size =" << m_currentGeometry.size();
+ qScreenDebug() << "resize, size =" << m_currentGeometry.size();
if (rootWindow())
rootWindow()->setGeometry(QRect(QPoint(0,0), m_currentGeometry.size()));
@@ -566,7 +566,7 @@ QQnxWindow *QQnxScreen::findWindow(screen_window_t windowHandle) const
void QQnxScreen::addWindow(QQnxWindow *window)
{
- qScreenDebug() << Q_FUNC_INFO << "window =" << window;
+ qScreenDebug() << "window =" << window;
if (m_childWindows.contains(window))
return;
@@ -593,7 +593,7 @@ void QQnxScreen::addWindow(QQnxWindow *window)
void QQnxScreen::removeWindow(QQnxWindow *window)
{
- qScreenDebug() << Q_FUNC_INFO << "window =" << window;
+ qScreenDebug() << "window =" << window;
if (window != m_coverWindow) {
const int numWindowsRemoved = m_childWindows.removeAll(window);
@@ -608,7 +608,7 @@ void QQnxScreen::removeWindow(QQnxWindow *window)
void QQnxScreen::raiseWindow(QQnxWindow *window)
{
- qScreenDebug() << Q_FUNC_INFO << "window =" << window;
+ qScreenDebug() << "window =" << window;
if (window != m_coverWindow) {
removeWindow(window);
@@ -618,7 +618,7 @@ void QQnxScreen::raiseWindow(QQnxWindow *window)
void QQnxScreen::lowerWindow(QQnxWindow *window)
{
- qScreenDebug() << Q_FUNC_INFO << "window =" << window;
+ qScreenDebug() << "window =" << window;
if (window != m_coverWindow) {
removeWindow(window);
@@ -628,7 +628,7 @@ void QQnxScreen::lowerWindow(QQnxWindow *window)
void QQnxScreen::updateHierarchy()
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
QList<QQnxWindow*>::const_iterator it;
int result;
@@ -804,7 +804,7 @@ void QQnxScreen::windowClosed(void *window)
void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState state)
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
if (!rootWindow() || id != rootWindow()->groupName())
return;
@@ -819,7 +819,7 @@ void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState s
void QQnxScreen::activateWindowGroup(const QByteArray &id)
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
if (!rootWindow() || id != rootWindow()->groupName())
return;
@@ -838,7 +838,7 @@ void QQnxScreen::activateWindowGroup(const QByteArray &id)
void QQnxScreen::deactivateWindowGroup(const QByteArray &id)
{
- qScreenDebug() << Q_FUNC_INFO;
+ qScreenDebug();
if (!rootWindow() || id != rootWindow()->groupName())
return;
diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
index 9fa397cb6a..6c9532c428 100644
--- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
@@ -141,7 +141,7 @@ bool QQnxScreenEventHandler::handleEvent(screen_event_t event, int qnxType)
default:
// event ignored
- qScreenEventDebug() << Q_FUNC_INFO << "unknown event" << qnxType;
+ qScreenEventDebug() << "unknown event" << qnxType;
return false;
}
@@ -188,7 +188,7 @@ void QQnxScreenEventHandler::injectKeyboardEvent(int flags, int sym, int modifie
QWindowSystemInterface::handleExtendedKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod,
scan, sym, modifiers, keyStr);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
+ qScreenEventDebug() << "Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
}
}
@@ -315,12 +315,12 @@ void QQnxScreenEventHandler::handlePointerEvent(screen_event_t event)
if (wOld) {
QWindowSystemInterface::handleLeaveEvent(wOld);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt leave, w=" << wOld;
+ qScreenEventDebug() << "Qt leave, w=" << wOld;
}
if (w) {
QWindowSystemInterface::handleEnterEvent(w);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt enter, w=" << w;
+ qScreenEventDebug() << "Qt enter, w=" << w;
}
}
@@ -363,14 +363,14 @@ void QQnxScreenEventHandler::handlePointerEvent(screen_event_t event)
m_lastLocalMousePoint != localPoint ||
m_lastButtonState != buttons) {
QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << static_cast<int>(buttons);
+ qScreenEventDebug() << "Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << static_cast<int>(buttons);
}
if (wheelDelta) {
// Screen only supports a single wheel, so we will assume Vertical orientation for
// now since that is pretty much standard.
QWindowSystemInterface::handleWheelEvent(w, localPoint, globalPoint, wheelDelta, Qt::Vertical);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt wheel, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), d=" << static_cast<int>(wheelDelta);
+ qScreenEventDebug() << "Qt wheel, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), d=" << static_cast<int>(wheelDelta);
}
}
@@ -427,12 +427,12 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType)
if (wOld) {
QWindowSystemInterface::handleLeaveEvent(wOld);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt leave, w=" << wOld;
+ qScreenEventDebug() << "Qt leave, w=" << wOld;
}
if (w) {
QWindowSystemInterface::handleEnterEvent(w);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt enter, w=" << w;
+ qScreenEventDebug() << "Qt enter, w=" << w;
}
}
m_lastMouseWindow = qnxWindow;
@@ -496,7 +496,7 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType)
// inject event into Qt
QWindowSystemInterface::handleTouchEvent(w, m_touchDevice, pointList);
- qScreenEventDebug() << Q_FUNC_INFO << "Qt touch, w =" << w
+ qScreenEventDebug() << "Qt touch, w =" << w
<< ", p=" << m_touchPoints[touchId].area.topLeft()
<< ", t=" << type;
}
@@ -542,7 +542,7 @@ void QQnxScreenEventHandler::handleDisplayEvent(screen_event_t event)
return;
}
- qScreenEventDebug() << Q_FUNC_INFO << "display attachment is now:" << isAttached;
+ qScreenEventDebug() << "display attachment is now:" << isAttached;
QQnxScreen *screen = m_qnxIntegration->screenForNative(nativeDisplay);
if (!screen) {
@@ -598,7 +598,7 @@ void QQnxScreenEventHandler::handlePropertyEvent(screen_event_t event)
break;
default:
// event ignored
- qScreenEventDebug() << Q_FUNC_INFO << "Ignore property event for property: " << property;
+ qScreenEventDebug() << "Ignore property event for property: " << property;
}
}
diff --git a/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp b/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp
index e0801a2d60..a7d5c4d4bc 100644
--- a/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp
@@ -84,7 +84,7 @@ void QQnxScreenEventThread::unlock()
void QQnxScreenEventThread::run()
{
- qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread started";
+ qScreenEventThreadDebug("screen event thread started");
int errorCounter = 0;
// loop indefinitely
@@ -117,7 +117,7 @@ void QQnxScreenEventThread::run()
if (qnxType == SCREEN_EVENT_USER) {
// treat all user events as shutdown requests
- qScreenEventThreadDebug() << Q_FUNC_INFO << "QNX user screen event";
+ qScreenEventThreadDebug("QNX user screen event");
m_quit = true;
} else {
m_mutex.lock();
@@ -127,7 +127,7 @@ void QQnxScreenEventThread::run()
}
}
- qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread stopped";
+ qScreenEventThreadDebug("screen event thread stopped");
// cleanup
m_mutex.lock();
@@ -160,10 +160,10 @@ void QQnxScreenEventThread::shutdown()
// cleanup
screen_destroy_event(event);
- qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread shutdown begin";
+ qScreenEventThreadDebug("screen event thread shutdown begin");
// block until thread terminates
wait();
- qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread shutdown end";
+ qScreenEventThreadDebug("screen event thread shutdown end");
}
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
index 3d749b486d..b55ae842ed 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
@@ -80,7 +80,7 @@ bool QQnxVirtualKeyboardBps::handleEvent(bps_event_t *event)
bool QQnxVirtualKeyboardBps::showKeyboard()
{
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible();
+ qVirtualKeyboardDebug() << "current visibility=" << isVisible();
// They keyboard's mode is global between applications, we have to set it each time
if ( !isVisible() )
@@ -92,7 +92,7 @@ bool QQnxVirtualKeyboardBps::showKeyboard()
bool QQnxVirtualKeyboardBps::hideKeyboard()
{
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible();
+ qVirtualKeyboardDebug() << "current visibility=" << isVisible();
virtualkeyboard_hide();
return true;
}
@@ -102,7 +102,7 @@ void QQnxVirtualKeyboardBps::applyKeyboardOptions()
virtualkeyboard_layout_t layout = keyboardLayout();
virtualkeyboard_enter_t enter = enterKey();
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "mode=" << keyboardMode() << "enterKey=" << enterKeyType();
+ qVirtualKeyboardDebug() << "mode=" << keyboardMode() << "enterKey=" << enterKeyType();
virtualkeyboard_change_options(layout, enter);
}
@@ -176,12 +176,12 @@ bool QQnxVirtualKeyboardBps::handleLocaleEvent(bps_event_t *event)
const QString country = QString::fromLatin1(locale_event_get_country(event));
const QLocale newLocale(language + QLatin1Char('_') + country);
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "current locale" << locale() << "new locale=" << newLocale;
+ qVirtualKeyboardDebug() << "current locale" << locale() << "new locale=" << newLocale;
setLocale(newLocale);
return true;
}
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled locale event. code=" << bps_event_get_code(event);
+ qVirtualKeyboardDebug() << "Unhandled locale event. code=" << bps_event_get_code(event);
return false;
}
@@ -190,24 +190,24 @@ bool QQnxVirtualKeyboardBps::handleVirtualKeyboardEvent(bps_event_t *event)
{
switch (bps_event_get_code(event)) {
case VIRTUALKEYBOARD_EVENT_VISIBLE:
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT VISIBLE: current visibility=" << isVisible();
+ qVirtualKeyboardDebug() << "EVENT VISIBLE: current visibility=" << isVisible();
setVisible(true);
break;
case VIRTUALKEYBOARD_EVENT_HIDDEN:
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT HIDDEN: current visibility=" << isVisible();
+ qVirtualKeyboardDebug() << "EVENT HIDDEN: current visibility=" << isVisible();
setVisible(false);
break;
case VIRTUALKEYBOARD_EVENT_INFO: {
const int newHeight = virtualkeyboard_event_get_height(event);
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT INFO: current height=" << height() << "new height=" << newHeight;
+ qVirtualKeyboardDebug() << "EVENT INFO: current height=" << height() << "new height=" << newHeight;
setHeight(newHeight);
break;
}
default:
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled virtual keyboard event. code=" << bps_event_get_code(event);
+ qVirtualKeyboardDebug() << "Unhandled virtual keyboard event. code=" << bps_event_get_code(event);
return false;
}
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
index 392d45c5b4..d5a9a49ac6 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
@@ -75,7 +75,7 @@ QQnxVirtualKeyboardPps::~QQnxVirtualKeyboardPps()
void QQnxVirtualKeyboardPps::start()
{
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "starting keyboard event processing";
+ qVirtualKeyboardDebug("starting keyboard event processing");
if (!connect())
return;
}
@@ -120,8 +120,8 @@ bool QQnxVirtualKeyboardPps::connect()
m_fd = ::open(ms_PPSPath, O_RDWR);
if (m_fd == -1)
{
- qVirtualKeyboardDebug() << Q_FUNC_INFO << ": Unable to open" << ms_PPSPath
- << ":" << strerror(errno);
+ qVirtualKeyboardDebug() << "Unable to open" << ms_PPSPath
+ << ':' << strerror(errno);
close();
return false;
}
@@ -158,7 +158,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
{
ssize_t nread = qt_safe_read(m_fd, m_buffer, ms_bufferSize - 1);
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "keyboardMessage size: " << nread;
+ qVirtualKeyboardDebug() << "keyboardMessage size: " << nread;
if (nread < 0){
connect(); // reconnect
return;
@@ -197,7 +197,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
else if (strcmp(value, "info") == 0)
handleKeyboardInfoMessage();
else if (strcmp(value, "connect") == 0)
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled command 'connect'";
+ qVirtualKeyboardDebug("Unhandled command 'connect'");
else
qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]");
} else if (pps_decoder_get_string(m_decoder, "res", &value) == PPS_DECODER_OK) {
@@ -224,12 +224,12 @@ void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
}
setHeight(newHeight);
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight;
+ qVirtualKeyboardDebug() << "size=" << newHeight;
}
bool QQnxVirtualKeyboardPps::showKeyboard()
{
- qVirtualKeyboardDebug() << Q_FUNC_INFO;
+ qVirtualKeyboardDebug();
if (!prepareToSend())
return false;
@@ -251,7 +251,7 @@ bool QQnxVirtualKeyboardPps::showKeyboard()
bool QQnxVirtualKeyboardPps::hideKeyboard()
{
- qVirtualKeyboardDebug() << Q_FUNC_INFO;
+ qVirtualKeyboardDebug();
if (!prepareToSend())
return false;
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 3f92bcbc01..4dc1248bd1 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -156,7 +156,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
m_windowState(Qt::WindowNoState),
m_mmRendererWindow(0)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window << ", size =" << window->size();
+ qWindowDebug() << "window =" << window << ", size =" << window->size();
QQnxScreen *platformScreen = static_cast<QQnxScreen *>(window->screen()->handle());
@@ -215,7 +215,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
QQnxWindow::~QQnxWindow()
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qWindowDebug() << "window =" << window();
// Qt should have already deleted the children before deleting the parent.
Q_ASSERT(m_childWindows.size() == 0);
@@ -247,7 +247,7 @@ void QQnxWindow::setGeometry(const QRect &rect)
void QQnxWindow::setGeometryHelper(const QRect &rect)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window()
+ qWindowDebug() << "window =" << window()
<< ", (" << rect.x() << "," << rect.y()
<< "," << rect.width() << "," << rect.height() << ")";
@@ -277,7 +277,7 @@ void QQnxWindow::setGeometryHelper(const QRect &rect)
void QQnxWindow::setVisible(bool visible)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible;
+ qWindowDebug() << "window =" << window() << "visible =" << visible;
if (m_visible == visible || window()->type() == Qt::Desktop)
return;
@@ -308,7 +308,7 @@ void QQnxWindow::setVisible(bool visible)
void QQnxWindow::updateVisibility(bool parentVisible)
{
- qWindowDebug() << Q_FUNC_INFO << "parentVisible =" << parentVisible << "window =" << window();
+ qWindowDebug() << "parentVisible =" << parentVisible << "window =" << window();
// Set window visibility
int val = (m_visible && parentVisible) ? 1 : 0;
Q_SCREEN_CHECKERROR(screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &val),
@@ -320,7 +320,7 @@ void QQnxWindow::updateVisibility(bool parentVisible)
void QQnxWindow::setOpacity(qreal level)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "opacity =" << level;
+ qWindowDebug() << "window =" << window() << "opacity =" << level;
// Set window global alpha
int val = (int)(level * 255);
Q_SCREEN_CHECKERROR(screen_set_window_property_iv(m_window, SCREEN_PROPERTY_GLOBAL_ALPHA, &val),
@@ -331,7 +331,7 @@ void QQnxWindow::setOpacity(qreal level)
void QQnxWindow::setExposed(bool exposed)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "expose =" << exposed;
+ qWindowDebug() << "window =" << window() << "expose =" << exposed;
if (m_exposed != exposed) {
m_exposed = exposed;
@@ -346,7 +346,7 @@ bool QQnxWindow::isExposed() const
void QQnxWindow::setBufferSize(const QSize &size)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "size =" << size;
+ qWindowDebug() << "window =" << window() << "size =" << size;
// libscreen fails when creating empty buffers
const QSize nonEmptySize = size.isEmpty() ? QSize(1, 1) : size;
@@ -408,7 +408,7 @@ void QQnxWindow::setBufferSize(const QSize &size)
void QQnxWindow::setScreen(QQnxScreen *platformScreen)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "platformScreen =" << platformScreen;
+ qWindowDebug() << "window =" << window() << "platformScreen =" << platformScreen;
if (platformScreen == 0) { // The screen has been destroyed
m_screen = 0;
@@ -422,7 +422,7 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
return;
if (m_screen) {
- qWindowDebug() << Q_FUNC_INFO << "Moving window to different screen";
+ qWindowDebug("Moving window to different screen");
m_screen->removeWindow(this);
if ((QQnxIntegration::options() & QQnxIntegration::RootWindow)) {
@@ -453,7 +453,7 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
void QQnxWindow::removeFromParent()
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qWindowDebug() << "window =" << window();
// Remove from old Hierarchy position
if (m_parentWindow) {
if (m_parentWindow->m_childWindows.removeAll(this))
@@ -467,7 +467,7 @@ void QQnxWindow::removeFromParent()
void QQnxWindow::setParent(const QPlatformWindow *window)
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << this->window() << "platformWindow =" << window;
+ qWindowDebug() << "window =" << this->window() << "platformWindow =" << window;
// Cast away the const, we need to modify the hierarchy.
QQnxWindow* const newParent = static_cast<QQnxWindow*>(const_cast<QPlatformWindow*>(window));
@@ -499,7 +499,7 @@ void QQnxWindow::setParent(const QPlatformWindow *window)
void QQnxWindow::raise()
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qWindowDebug() << "window =" << window();
if (m_parentWindow) {
m_parentWindow->m_childWindows.removeAll(this);
@@ -513,7 +513,7 @@ void QQnxWindow::raise()
void QQnxWindow::lower()
{
- qWindowDebug() << Q_FUNC_INFO << "window =" << window();
+ qWindowDebug() << "window =" << window();
if (m_parentWindow) {
m_parentWindow->m_childWindows.removeAll(this);
@@ -583,7 +583,7 @@ void QQnxWindow::setFocus(screen_window_t newFocusWindow)
void QQnxWindow::setWindowState(Qt::WindowState state)
{
- qWindowDebug() << Q_FUNC_INFO << "state =" << state;
+ qWindowDebug() << "state =" << state;
// Prevent two calls with Qt::WindowFullScreen from changing m_unmaximizedGeometry
if (m_windowState == state)
@@ -598,7 +598,7 @@ void QQnxWindow::setWindowState(Qt::WindowState state)
void QQnxWindow::propagateSizeHints()
{
// nothing to do; silence base class warning
- qWindowDebug() << Q_FUNC_INFO << ": ignored";
+ qWindowDebug("ignored");
}
void QQnxWindow::setMMRendererWindowName(const QString &name)
@@ -634,7 +634,7 @@ QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle)
void QQnxWindow::minimize()
{
#if defined(Q_OS_BLACKBERRY)
- qWindowDebug() << Q_FUNC_INFO;
+ qWindowDebug();
pps_encoder_t encoder;
@@ -643,7 +643,7 @@ void QQnxWindow::minimize()
if (navigator_raw_write(pps_encoder_buffer(&encoder),
pps_encoder_length(&encoder)) != BPS_SUCCESS) {
- qWindowDebug() << Q_FUNC_INFO << "navigator_raw_write failed:" << strerror(errno);
+ qWindowDebug() << "navigator_raw_write failed:" << strerror(errno);
}
pps_encoder_cleanup(&encoder);
@@ -654,7 +654,7 @@ void QQnxWindow::minimize()
void QQnxWindow::setRotation(int rotation)
{
- qWindowDebug() << Q_FUNC_INFO << "angle =" << rotation;
+ qWindowDebug() << "angle =" << rotation;
Q_SCREEN_CHECKERROR(
screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ROTATION, &rotation),
"Failed to set window rotation");
@@ -726,7 +726,7 @@ void QQnxWindow::joinWindowGroup(const QByteArray &groupName)
{
bool changed = false;
- qWindowDebug() << Q_FUNC_INFO << "group:" << groupName;
+ qWindowDebug() << "group:" << groupName;
if (!groupName.isEmpty()) {
if (groupName != m_parentGroupName) {
diff --git a/src/plugins/platforms/windows/accessible/accessible.pri b/src/plugins/platforms/windows/accessible/accessible.pri
index e26c6614e2..0774d907f2 100644
--- a/src/plugins/platforms/windows/accessible/accessible.pri
+++ b/src/plugins/platforms/windows/accessible/accessible.pri
@@ -1,17 +1,20 @@
SOURCES += \
- $$PWD/qwindowsmsaaaccessible.cpp \
$$PWD/qwindowsaccessibility.cpp \
$$PWD/comutils.cpp
HEADERS += \
- $$PWD/qwindowsmsaaaccessible.h \
$$PWD/qwindowsaccessibility.h \
$$PWD/comutils.h
-!mingw: {
- SOURCES += $$PWD/iaccessible2.cpp
- HEADERS += $$PWD/iaccessible2.h
- include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
+!wince: {
+ SOURCES += $$PWD/qwindowsmsaaaccessible.cpp
+ HEADERS += $$PWD/qwindowsmsaaaccessible.h
+
+ !mingw: {
+ SOURCES += $$PWD/iaccessible2.cpp
+ HEADERS += $$PWD/iaccessible2.h
+ include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
+ }
}
-mingw: LIBS *= -luuid \ No newline at end of file
+mingw: LIBS *= -luuid
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
index 0bf3c27350..0437290dcb 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
@@ -50,10 +50,12 @@
#include <QtGui/qguiapplication.h>
#include "qwindowsaccessibility.h"
-#ifdef Q_CC_MINGW
-# include "qwindowsmsaaaccessible.h"
-#else
-# include "iaccessible2.h"
+#if !defined(Q_OS_WINCE)
+# ifdef Q_CC_MINGW
+# include "qwindowsmsaaaccessible.h"
+# else
+# include "iaccessible2.h"
+# endif
#endif
#include "comutils.h"
@@ -68,8 +70,9 @@
#if !defined(WINABLEAPI)
# if defined(Q_OS_WINCE)
# include <bldver.h>
+# else
+# include <winable.h>
# endif
-# include <winable.h>
#endif
#include <servprov.h>
@@ -151,7 +154,7 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
// An event has to be associated with a window,
// so find the first parent that is a widget and that has a WId
QAccessibleInterface *iface = event->accessibleInterface();
- if (!iface || !iface->isValid())
+ if (!isActive() || !iface || !iface->isValid())
return;
QWindow *window = QWindowsAccessibility::windowHelper(iface);
@@ -193,6 +196,11 @@ QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface)
*/
IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
{
+#if defined(Q_OS_WINCE)
+ Q_UNUSED(acc);
+
+ return 0;
+#else
if (!acc)
return 0;
@@ -200,14 +208,15 @@ IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
if (!QAccessible::uniqueId(acc))
QAccessible::registerAccessibleInterface(acc);
-#ifdef Q_CC_MINGW
+# ifdef Q_CC_MINGW
QWindowsMsaaAccessible *wacc = new QWindowsMsaaAccessible(acc);
-#else
+# else
QWindowsIA2Accessible *wacc = new QWindowsIA2Accessible(acc);
-#endif
+# endif
IAccessible *iacc = 0;
wacc->QueryInterface(IID_IAccessible, (void**)&iacc);
return iacc;
+#endif // defined(Q_OS_WINCE)
}
/*
@@ -230,6 +239,7 @@ void QWindowsAccessibility::cleanup()
bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
{
+#if !defined(Q_OS_WINCE)
if (static_cast<long>(lParam) == static_cast<long>(UiaRootObjectId)) {
/* For UI Automation */
} else if ((DWORD)lParam == DWORD(OBJID_CLIENT)) {
@@ -248,9 +258,7 @@ bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, W
if (!oleaccChecked) {
oleaccChecked = true;
-#if !defined(Q_OS_WINCE)
ptrLresultFromObject = (PtrLresultFromObject)QSystemLibrary::resolve(QLatin1String("oleacc"), "LresultFromObject");
-#endif
}
if (ptrLresultFromObject) {
@@ -269,6 +277,12 @@ bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, W
}
}
}
+#else
+ Q_UNUSED(hwnd);
+ Q_UNUSED(wParam);
+ Q_UNUSED(lParam);
+ Q_UNUSED(lResult);
+#endif // !defined(Q_OS_WINCE)
return false;
}
diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json
index 23607523bd..767eac161c 100644
--- a/src/plugins/platforms/windows/openglblacklists/default.json
+++ b/src/plugins/platforms/windows/openglblacklists/default.json
@@ -1,10 +1,10 @@
{
"name": "Qt built-in GPU driver blacklist",
- "version": "5.5",
+ "version": "5.6",
"entries": [
{
"id": 1,
- "description": "Desktop OpenGL is unreliable on some Intel HD laptops (QTBUG-43263, QTBUG-42240)",
+ "description": "Desktop OpenGL is unreliable on some Intel HD laptops (QTBUG-43263)",
"vendor_id": "0x8086",
"device_id": [ "0x0A16" ],
"os": {
@@ -17,6 +17,67 @@
"features": [
"disable_desktopgl"
]
+ },
+ {
+ "id": 2,
+ "description": "Intel Q965/Q963 - GMA 3000 has insufficient support of opengl and directx",
+ "vendor_id": "0x8086",
+ "device_id": [ "0x2992" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_desktopgl",
+ "disable_angle"
+ ]
+ },
+ {
+ "id": 3,
+ "description": "No OpenGL on Intel G33/G31 (QTBUG-47522)",
+ "vendor_id": "0x8086",
+ "device_id": [ "0x29C2" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_desktopgl"
+ ]
+ },
+ {
+ "id": 4,
+ "description": "Intel HD Graphics 3000 crashes when initializing the OpenGL driver (QTBUG-42240)",
+ "vendor_id": "0x8086",
+ "device_id": [ "0x0102", "0x0106", "0x010A", "0x0112", "0x0116", "0x0122", "0x0126" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_desktopgl"
+ ]
+ },
+ {
+ "id": 5,
+ "description": "Intel GMA 3150 (QTBUG-43243), Mobile Intel 945GM (QTBUG-47435) crash",
+ "vendor_id": "0x8086",
+ "device_id": [ "0xA001", "0xA011", "0x27A0" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_desktopgl", "disable_angle"
+ ]
+ },
+ {
+ "id": 6,
+ "description": "Intel(R) HD Graphics 4000 / 5500 cause crashes on orientation changes in fullscreen mode (QTBUG-49541)",
+ "vendor_id": "0x8086",
+ "device_id": [ "0x0166", "0x1616" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_rotation"
+ ]
}
]
}
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 16c278d9df..a6b1d0af26 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -35,10 +35,11 @@
#include "qwindowswindow.h"
#include "qwindowsnativeimage.h"
#include "qwindowscontext.h"
-#include "qwindowsscaling.h"
#include <QtGui/QWindow>
#include <QtGui/QPainter>
+#include <private/qhighdpiscaling_p.h>
+#include <private/qimage_p.h>
#include <QtCore/QDebug>
@@ -52,7 +53,8 @@ QT_BEGIN_NAMESPACE
*/
QWindowsBackingStore::QWindowsBackingStore(QWindow *window) :
- QPlatformBackingStore(window)
+ QPlatformBackingStore(window),
+ m_alphaNeedsFill(false)
{
qCDebug(lcQpaBackingStore) << __FUNCTION__ << this << window;
}
@@ -68,10 +70,12 @@ QPaintDevice *QWindowsBackingStore::paintDevice()
return &m_image->image();
}
-void QWindowsBackingStore::flushDp(QWindow *window, const QRect &br, const QPoint &offset)
+void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
+ const QPoint &offset)
{
Q_ASSERT(window);
+ const QRect br = region.boundingRect();
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaBackingStore) << __FUNCTION__ << this << window << offset << br;
QWindowsWindow *rw = QWindowsWindow::baseWindowOf(window);
@@ -81,9 +85,9 @@ void QWindowsBackingStore::flushDp(QWindow *window, const QRect &br, const QPoin
const Qt::WindowFlags flags = window->flags();
if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) {
// Windows with alpha: Use blend function to update.
- const QMargins marginsDP = rw->frameMarginsDp();
- const QRect r = rw->geometryDp() + marginsDP;
- const QPoint frameOffset(marginsDP.left(), marginsDP.top());
+ QRect r = QHighDpi::toNativePixels(window->frameGeometry(), window);
+ QPoint frameOffset(QHighDpi::toNativePixels(QPoint(window->frameMargins().left(), window->frameMargins().top()),
+ static_cast<const QWindow *>(Q_NULLPTR)));
QRect dirtyRect = br.translated(offset + frameOffset);
SIZE size = {r.width(), r.height()};
@@ -94,7 +98,12 @@ void QWindowsBackingStore::flushDp(QWindow *window, const QRect &br, const QPoin
RECT dirty = {dirtyRect.x(), dirtyRect.y(),
dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()};
UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA, &dirty};
- QWindowsContext::user32dll.updateLayeredWindowIndirect(rw->handle(), &info);
+ const BOOL result = QWindowsContext::user32dll.updateLayeredWindowIndirect(rw->handle(), &info);
+ if (!result)
+ qErrnoWarning("UpdateLayeredWindowIndirect failed for ptDst=(%d, %d),"
+ " size=(%dx%d), dirty=(%dx%d %d, %d)", r.x(), r.y(),
+ r.width(), r.height(), dirtyRect.width(), dirtyRect.height(),
+ dirtyRect.x(), dirtyRect.y());
} else {
QWindowsContext::user32dll.updateLayeredWindow(rw->handle(), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA);
}
@@ -127,27 +136,34 @@ void QWindowsBackingStore::flushDp(QWindow *window, const QRect &br, const QPoin
}
}
-void QWindowsBackingStore::resize(const QSize &sizeDip, const QRegion &regionDip)
+void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
{
- const QSize size = sizeDip * QWindowsScaling::factor();
if (m_image.isNull() || m_image->image().size() != size) {
#ifndef QT_NO_DEBUG_OUTPUT
if (QWindowsContext::verbose && lcQpaBackingStore().isDebugEnabled()) {
qCDebug(lcQpaBackingStore)
- << __FUNCTION__ << ' ' << window() << ' ' << size << ' ' << sizeDip << ' '
- << regionDip << " from: " << (m_image.isNull() ? QSize() : m_image->image().size());
+ << __FUNCTION__ << ' ' << window() << ' ' << size << ' ' << region
+ << " from: " << (m_image.isNull() ? QSize() : m_image->image().size());
}
#endif
- const QImage::Format format = window()->format().hasAlpha() ?
- QImage::Format_ARGB32_Premultiplied : QWindowsNativeImage::systemFormat();
+ QImage::Format format = window()->format().hasAlpha() ?
+ QImage::Format_ARGB32_Premultiplied : QWindowsNativeImage::systemFormat();
+
+ // The backingstore composition (enabling render-to-texture widgets)
+ // punches holes in the backingstores using the alpha channel. Hence
+ // the need for a true alpha format.
+ if (QImage::toPixelFormat(format).alphaUsage() == QPixelFormat::UsesAlpha)
+ m_alphaNeedsFill = true;
+ else // upgrade but here we know app painting does not rely on alpha hence no need to fill
+ format = qt_alphaVersionForPainting(format);
QWindowsNativeImage *oldwni = m_image.data();
QWindowsNativeImage *newwni = new QWindowsNativeImage(size.width(), size.height(), format);
- if (oldwni && !regionDip.isEmpty()) {
+ if (oldwni && !region.isEmpty()) {
const QImage &oldimg(oldwni->image());
QImage &newimg(newwni->image());
- QRegion staticRegion = QWindowsScaling::mapToNative(regionDip);
+ QRegion staticRegion(region);
staticRegion &= QRect(0, 0, oldimg.width(), oldimg.height());
staticRegion &= QRect(0, 0, newimg.width(), newimg.height());
QPainter painter(&newimg);
@@ -156,38 +172,36 @@ void QWindowsBackingStore::resize(const QSize &sizeDip, const QRegion &regionDip
painter.drawImage(rect, oldimg, rect);
}
- if (QWindowsScaling::isActive())
- newwni->setDevicePixelRatio(QWindowsScaling::factor());
m_image.reset(newwni);
}
}
Q_GUI_EXPORT void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
-bool QWindowsBackingStore::scroll(const QRegion &areaDip, int dxDip, int dyDip)
+bool QWindowsBackingStore::scroll(const QRegion &area, int dx, int dy)
{
if (m_image.isNull() || m_image->image().isNull())
return false;
- const QPoint dp = QPoint(dxDip, dyDip) * QWindowsScaling::factor();
- const QVector<QRect> rects = areaDip.rects();
+ const QVector<QRect> rects = area.rects();
+ const QPoint offset(dx, dy);
for (int i = 0; i < rects.size(); ++i)
- qt_scrollRectInImage(m_image->image(), QWindowsScaling::mapToNative(rects.at(i)), dp);
+ qt_scrollRectInImage(m_image->image(), rects.at(i), offset);
return true;
}
-void QWindowsBackingStore::beginPaint(const QRegion &regionDip)
+void QWindowsBackingStore::beginPaint(const QRegion &region)
{
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaBackingStore) <<__FUNCTION__ << regionDip;
+ qCDebug(lcQpaBackingStore) <<__FUNCTION__ << region;
- if (m_image->image().hasAlphaChannel()) {
+ if (m_alphaNeedsFill) {
QPainter p(&m_image->image());
p.setCompositionMode(QPainter::CompositionMode_Source);
const QColor blank = Qt::transparent;
- foreach (const QRect &r, regionDip.rects())
- p.fillRect(QWindowsScaling::mapToNative(r), blank);
+ foreach (const QRect &r, region.rects())
+ p.fillRect(r, blank);
}
}
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.h b/src/plugins/platforms/windows/qwindowsbackingstore.h
index 41ad29babc..1d644923bb 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.h
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.h
@@ -35,7 +35,6 @@
#define QWINDOWSBACKINGSTORE_H
#include "qtwindows_additional.h"
-#include "qwindowsscaling.h"
#include <qpa/qplatformbackingstore.h>
#include <QtCore/QScopedPointer>
@@ -53,12 +52,7 @@ public:
~QWindowsBackingStore();
QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE
- {
- flushDp(window, QWindowsScaling::mapToNative(region.boundingRect()),
- offset * QWindowsScaling::factor());
- }
- void flushDp(QWindow *window, const QRect &boundingRect, const QPoint &offset);
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
void resize(const QSize &size, const QRegion &r) Q_DECL_OVERRIDE;
bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE;
void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
@@ -71,6 +65,7 @@ public:
private:
QScopedPointer<QWindowsNativeImage> m_image;
+ bool m_alphaNeedsFill;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp
index 925427ac30..1071a2e038 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.cpp
+++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp
@@ -35,7 +35,6 @@
#include "qwindowscontext.h"
#include "qwindowsole.h"
#include "qwindowsmime.h"
-#include "qwindowsguieventdispatcher.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
@@ -48,6 +47,8 @@
#include <QtCore/QVariant>
#include <QtCore/QUrl>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+
QT_BEGIN_NAMESPACE
static const char formatTextPlainC[] = "text/plain";
@@ -69,6 +70,7 @@ static const char formatTextHtmlC[] = "text/html";
\ingroup qt-lighthouse-win
*/
+#ifndef QT_NO_DEBUG_STREAM
static QDebug operator<<(QDebug d, const QMimeData *mimeData)
{
QDebugStateSaver saver(d);
@@ -93,6 +95,7 @@ static QDebug operator<<(QDebug d, const QMimeData *mimeData)
d << ')';
return d;
}
+#endif // !QT_NO_DEBUG_STREAM
/*!
\class QWindowsClipboardRetrievalMimeData
@@ -109,8 +112,11 @@ static QDebug operator<<(QDebug d, const QMimeData *mimeData)
IDataObject *QWindowsClipboardRetrievalMimeData::retrieveDataObject() const
{
IDataObject * pDataObj = 0;
- if (OleGetClipboard(&pDataObj) == S_OK)
+ if (OleGetClipboard(&pDataObj) == S_OK) {
+ if (QWindowsContext::verbose > 1)
+ qCDebug(lcQpaMime) << __FUNCTION__ << pDataObj;
return pDataObj;
+ }
return 0;
}
@@ -230,7 +236,7 @@ void QWindowsClipboard::propagateClipboardMessage(UINT message, WPARAM wParam, L
// suspended by a shell prompt 'Select' or debugger).
if (QWindowsContext::user32dll.isHungAppWindow
&& QWindowsContext::user32dll.isHungAppWindow(m_nextClipboardViewer)) {
- qWarning("%s: Cowardly refusing to send clipboard message to hung application...", Q_FUNC_INFO);
+ qWarning("Cowardly refusing to send clipboard message to hung application...");
return;
}
// Do not block if the process is being debugged, specifically, if it is
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 00049bd0d6..4934b6c6e4 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -36,7 +36,6 @@
#include "qwindowsintegration.h"
#include "qwindowswindow.h"
#include "qwindowskeymapper.h"
-#include "qwindowsguieventdispatcher.h"
#include "qwindowsmousehandler.h"
#include "qtwindowsglobal.h"
#include "qwindowsmime.h"
@@ -52,7 +51,6 @@
#endif
#include "qwindowsscreen.h"
#include "qwindowstheme.h"
-#include "qwindowsscaling.h"
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
@@ -67,6 +65,8 @@
#include <QtCore/QScopedArrayPointer>
#include <QtCore/private/qsystemlibrary_p.h>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+
#include <stdlib.h>
#include <stdio.h>
#include <windowsx.h>
@@ -177,7 +177,8 @@ QWindowsUser32DLL::QWindowsUser32DLL() :
isHungAppWindow(0), isTouchWindow(0),
registerTouchWindow(0), unregisterTouchWindow(0),
getTouchInputInfo(0), closeTouchInputHandle(0), setProcessDPIAware(0),
- addClipboardFormatListener(0), removeClipboardFormatListener(0)
+ addClipboardFormatListener(0), removeClipboardFormatListener(0),
+ getDisplayAutoRotationPreferences(0), setDisplayAutoRotationPreferences(0)
{
}
@@ -198,6 +199,8 @@ void QWindowsUser32DLL::init()
addClipboardFormatListener = (AddClipboardFormatListener)library.resolve("AddClipboardFormatListener");
removeClipboardFormatListener = (RemoveClipboardFormatListener)library.resolve("RemoveClipboardFormatListener");
}
+ getDisplayAutoRotationPreferences = (GetDisplayAutoRotationPreferences)library.resolve("GetDisplayAutoRotationPreferences");
+ setDisplayAutoRotationPreferences = (SetDisplayAutoRotationPreferences)library.resolve("SetDisplayAutoRotationPreferences");
}
bool QWindowsUser32DLL::initTouch()
@@ -402,14 +405,29 @@ void QWindowsContext::setTabletAbsoluteRange(int a)
#endif
}
+int QWindowsContext::processDpiAwareness()
+{
+#ifndef Q_OS_WINCE
+ int result;
+ if (QWindowsContext::shcoredll.getProcessDpiAwareness
+ && SUCCEEDED(QWindowsContext::shcoredll.getProcessDpiAwareness(NULL, &result))) {
+ return result;
+ }
+#endif // !Q_OS_WINCE
+ return -1;
+}
+
void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness)
{
#ifndef Q_OS_WINCE
qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness;
if (QWindowsContext::shcoredll.isValid()) {
const HRESULT hr = QWindowsContext::shcoredll.setProcessDpiAwareness(dpiAwareness);
- if (FAILED(hr))
- qWarning() << "SetProcessDpiAwareness failed:" << QWindowsContext::comErrorString(hr);
+ if (FAILED(hr)) {
+ qWarning().noquote().nospace() << "SetProcessDpiAwareness("
+ << dpiAwareness << ") failed: " << QWindowsContext::comErrorString(hr)
+ << ", using " << QWindowsContext::processDpiAwareness();
+ }
} else {
if (dpiAwareness != QtWindows::ProcessDpiUnaware && QWindowsContext::user32dll.setProcessDPIAware) {
if (!QWindowsContext::user32dll.setProcessDPIAware())
@@ -893,6 +911,11 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr)
return result;
}
+static inline QWindowsInputContext *windowsInputContext()
+{
+ return qobject_cast<QWindowsInputContext *>(QWindowsIntegration::instance()->inputContext());
+}
+
/*!
\brief Main windows procedure registered for windows.
@@ -941,16 +964,29 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return true;
}
}
+ if (et & QtWindows::InputMethodEventFlag) {
+ QWindowsInputContext *windowsInputContext = ::windowsInputContext();
+ // Disable IME assuming this is a special implementation hooking into keyboard input.
+ // "Real" IME implementations should use a native event filter intercepting IME events.
+ if (!windowsInputContext) {
+ QWindowsInputContext::setWindowsImeEnabled(platformWindow, false);
+ return false;
+ }
+ switch (et) {
+ case QtWindows::InputMethodStartCompositionEvent:
+ return windowsInputContext->startComposition(hwnd);
+ case QtWindows::InputMethodCompositionEvent:
+ return windowsInputContext->composition(hwnd, lParam);
+ case QtWindows::InputMethodEndCompositionEvent:
+ return windowsInputContext->endComposition(hwnd);
+ case QtWindows::InputMethodRequest:
+ return windowsInputContext->handleIME_Request(wParam, lParam, result);
+ default:
+ break;
+ }
+ } // InputMethodEventFlag
switch (et) {
- case QtWindows::InputMethodStartCompositionEvent:
- return QWindowsInputContext::instance()->startComposition(hwnd);
- case QtWindows::InputMethodCompositionEvent:
- return QWindowsInputContext::instance()->composition(hwnd, lParam);
- case QtWindows::InputMethodEndCompositionEvent:
- return QWindowsInputContext::instance()->endComposition(hwnd);
- case QtWindows::InputMethodRequest:
- return QWindowsInputContext::instance()->handleIME_Request(wParam, lParam, result);
case QtWindows::GestureEvent:
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
@@ -1025,11 +1061,13 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
}
switch (et) {
+ case QtWindows::KeyboardLayoutChangeEvent:
+ if (QWindowsInputContext *wic = windowsInputContext())
+ wic->handleInputLanguageChanged(wParam, lParam); // fallthrough intended.
case QtWindows::KeyDownEvent:
case QtWindows::KeyEvent:
case QtWindows::InputMethodKeyEvent:
case QtWindows::InputMethodKeyDownEvent:
- case QtWindows::KeyboardLayoutChangeEvent:
case QtWindows::AppCommandEvent:
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
return platformSessionManager()->isInteractionBlocked() ? true : d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
@@ -1265,9 +1303,7 @@ bool QWindowsContext::handleContextMenuEvent(QWindow *window, const MSG &msg)
}
}
- QWindowSystemInterface::handleContextMenuEvent(window, mouseTriggered,
- pos / QWindowsScaling::factor(),
- globalPos / QWindowsScaling::factor(),
+ QWindowSystemInterface::handleContextMenuEvent(window, mouseTriggered, pos, globalPos,
QWindowsKeyMapper::queryKeyboardModifiers());
return true;
}
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 641e3ed41f..14baec96d8 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -94,6 +94,8 @@ struct QWindowsUser32DLL
typedef BOOL (WINAPI *SetProcessDPIAware)();
typedef BOOL (WINAPI *AddClipboardFormatListener)(HWND);
typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND);
+ typedef BOOL (WINAPI *GetDisplayAutoRotationPreferences)(DWORD *);
+ typedef BOOL (WINAPI *SetDisplayAutoRotationPreferences)(DWORD);
// Functions missing in Q_CC_GNU stub libraries.
SetLayeredWindowAttributes setLayeredWindowAttributes;
@@ -116,6 +118,10 @@ struct QWindowsUser32DLL
// Clipboard listeners, Windows Vista onwards
AddClipboardFormatListener addClipboardFormatListener;
RemoveClipboardFormatListener removeClipboardFormatListener;
+
+ // Rotation API
+ GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences;
+ SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences;
};
struct QWindowsShell32DLL
@@ -142,7 +148,7 @@ struct QWindowsShcoreDLL {
void init();
inline bool isValid() const { return getProcessDpiAwareness && setProcessDpiAwareness && getDpiForMonitor; }
- typedef HRESULT (WINAPI *GetProcessDpiAwareness)(HANDLE,int);
+ typedef HRESULT (WINAPI *GetProcessDpiAwareness)(HANDLE,int *);
typedef HRESULT (WINAPI *SetProcessDpiAwareness)(int);
typedef HRESULT (WINAPI *GetDpiForMonitor)(HMONITOR,int,UINT *,UINT *);
@@ -213,6 +219,7 @@ public:
void setTabletAbsoluteRange(int a);
void setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness);
+ static int processDpiAwareness();
// Returns a combination of SystemInfoFlags
unsigned systemInfo() const;
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index 5f443f2675..c769eb04a4 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -36,7 +36,6 @@
#include "qwindowscontext.h"
#include "qwindowswindow.h"
#include "qwindowsscreen.h"
-#include "qwindowsscaling.h"
#include <QtGui/QBitmap>
#include <QtGui/QImage>
@@ -44,15 +43,17 @@
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
#include <QtGui/private/qguiapplication_p.h> // getPixmapCursor()
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtCore/QDebug>
#include <QtCore/QScopedArrayPointer>
-static void initResources()
+static bool initResources()
{
#if !defined (Q_OS_WINCE) && !defined (QT_NO_IMAGEFORMAT_PNG)
Q_INIT_RESOURCE(cursors);
#endif
+ return true;
}
QT_BEGIN_NAMESPACE
@@ -68,19 +69,14 @@ Q_GUI_EXPORT HBITMAP qt_createIconMask(const QBitmap &bitmap);
\ingroup qt-lighthouse-win
*/
-QWindowsCursorCacheKey::QWindowsCursorCacheKey(const QCursor &c)
- : shape(c.shape()), bitmapCacheKey(0), maskCacheKey(0)
+QWindowsPixmapCursorCacheKey::QWindowsPixmapCursorCacheKey(const QCursor &c)
+ : bitmapCacheKey(c.pixmap().cacheKey()), maskCacheKey(0)
{
- if (shape == Qt::BitmapCursor) {
- const qint64 pixmapCacheKey = c.pixmap().cacheKey();
- if (pixmapCacheKey) {
- bitmapCacheKey = pixmapCacheKey;
- } else {
- Q_ASSERT(c.bitmap());
- Q_ASSERT(c.mask());
- bitmapCacheKey = c.bitmap()->cacheKey();
- maskCacheKey = c.mask()->cacheKey();
- }
+ if (!bitmapCacheKey) {
+ Q_ASSERT(c.bitmap());
+ Q_ASSERT(c.mask());
+ bitmapCacheKey = c.bitmap()->cacheKey();
+ maskCacheKey = c.mask()->cacheKey();
}
}
@@ -98,9 +94,14 @@ QWindowsCursorCacheKey::QWindowsCursorCacheKey(const QCursor &c)
\sa QWindowsWindowCursor
*/
-HCURSOR QWindowsCursor::createPixmapCursor(const QPixmap &pixmap, const QPoint &hotSpot)
+HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor)
{
HCURSOR cur = 0;
+ scaleFactor /= pixmap.devicePixelRatioF();
+ if (!qFuzzyCompare(scaleFactor, 1)) {
+ pixmap = pixmap.scaled((scaleFactor * QSizeF(pixmap.size())).toSize(),
+ Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ }
QBitmap mask = pixmap.mask();
if (mask.isNull()) {
mask = QBitmap(pixmap.size());
@@ -207,7 +208,44 @@ static HCURSOR createBitmapCursor(const QImage &bbits, const QImage &mbits,
#endif
}
-static inline QSize systemCursorSize() { return QSize(GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR)); }
+// Create a cursor from image and mask of the format QImage::Format_Mono.
+static HCURSOR createBitmapCursor(const QCursor &cursor, qreal scaleFactor = 1)
+{
+ Q_ASSERT(cursor.shape() == Qt::BitmapCursor && cursor.bitmap());
+ QImage bbits = cursor.bitmap()->toImage();
+ QImage mbits = cursor.mask()->toImage();
+ scaleFactor /= bbits.devicePixelRatioF();
+ if (!qFuzzyCompare(scaleFactor, 1)) {
+ const QSize scaledSize = (QSizeF(bbits.size()) * scaleFactor).toSize();
+ bbits = bbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ mbits = mbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ }
+ bbits = bbits.convertToFormat(QImage::Format_Mono);
+ mbits = mbits.convertToFormat(QImage::Format_Mono);
+ const bool invb = bbits.colorCount() > 1 && qGray(bbits.color(0)) < qGray(bbits.color(1));
+ const bool invm = mbits.colorCount() > 1 && qGray(mbits.color(0)) < qGray(mbits.color(1));
+ return createBitmapCursor(bbits, mbits, cursor.hotSpot(), invb, invm);
+}
+
+static QSize systemCursorSize(const QPlatformScreen *screen = Q_NULLPTR)
+{
+ const QSize primaryScreenCursorSize(GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR));
+ if (screen) {
+ // Correct the size if the DPI value of the screen differs from
+ // that of the primary screen.
+ if (const QScreen *primaryQScreen = QGuiApplication::primaryScreen()) {
+ const QPlatformScreen *primaryScreen = primaryQScreen->handle();
+ if (screen != primaryScreen) {
+ const qreal logicalDpi = screen->logicalDpi().first;
+ const qreal primaryScreenLogicalDpi = primaryScreen->logicalDpi().first;
+ if (!qFuzzyCompare(logicalDpi, primaryScreenLogicalDpi))
+ return (QSizeF(primaryScreenCursorSize) * logicalDpi / primaryScreenLogicalDpi).toSize();
+ }
+ }
+ }
+ return primaryScreenCursorSize;
+}
+
static inline QSize standardCursorSize() { return QSize(32, 32); }
#if defined (Q_OS_WINCE) || defined (QT_NO_IMAGEFORMAT_PNG)
@@ -216,7 +254,7 @@ static inline QSize standardCursorSize() { return QSize(32, 32); }
// createBitmapCursor() only work for standard sizes (32,48,64...), which does
// not work when scaling the 16x16 openhand cursor bitmaps to 150% (resulting
// in a non-standard 24x24 size).
-static QCursor createPixmapCursorFromData(const QSize &systemCursorSize,
+static QWindowsCursor::PixmapCursor createPixmapCursorFromData(const QSize &systemCursorSize,
// The cursor size the bitmap is targeted for
const QSize &bitmapTargetCursorSize,
// The actual size of the bitmap data
@@ -234,10 +272,11 @@ static QCursor createPixmapCursorFromData(const QSize &systemCursorSize,
rawImage = rawImage.transformed(transform, Qt::SmoothTransformation);
}
const QPoint hotSpot(rawImage.width() / 2, rawImage.height() / 2);
- return QCursor(rawImage, hotSpot.x(), hotSpot.y());
+ return QWindowsCursor::PixmapCursor(rawImage, hotSpot);
}
-QCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape)
+QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape,
+ const QPlatformScreen *screen)
{
// Non-standard Windows cursors are created from bitmaps
static const uchar vsplit_bits[] = {
@@ -405,22 +444,22 @@ QCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape)
switch (cursorShape) {
case Qt::SplitVCursor:
- return createPixmapCursorFromData(systemCursorSize(), standardCursorSize(), 32, vsplit_bits, vsplitm_bits);
+ return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 32, vsplit_bits, vsplitm_bits);
case Qt::SplitHCursor:
- return createPixmapCursorFromData(systemCursorSize(), standardCursorSize(), 32, hsplit_bits, hsplitm_bits);
+ return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 32, hsplit_bits, hsplitm_bits);
case Qt::OpenHandCursor:
- return createPixmapCursorFromData(systemCursorSize(), standardCursorSize(), 16, openhand_bits, openhandm_bits);
+ return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 16, openhand_bits, openhandm_bits);
case Qt::ClosedHandCursor:
- return createPixmapCursorFromData(systemCursorSize(), standardCursorSize(), 16, closedhand_bits, closedhandm_bits);
+ return createPixmapCursorFromData(systemCursorSize(screen), standardCursorSize(), 16, closedhand_bits, closedhandm_bits);
case Qt::DragCopyCursor:
- return QCursor(QPixmap(copyDragCursorXpmC), 0, 0);
+ return QWindowsCursor::PixmapCursor(QPixmap(copyDragCursorXpmC), QPoint(0, 0));
case Qt::DragMoveCursor:
- return QCursor(QPixmap(moveDragCursorXpmC), 0, 0);
+ return QWindowsCursor::PixmapCursor(QPixmap(moveDragCursorXpmC), QPoint(0, 0));
case Qt::DragLinkCursor:
- return QCursor(QPixmap(linkDragCursorXpmC), 0, 0);
+ return QWindowsCursor::PixmapCursor(QPixmap(linkDragCursorXpmC), QPoint(0, 0));
}
- return QCursor();
+ return QWindowsCursor::PixmapCursor();
}
#else // Q_OS_WINCE || QT_NO_IMAGEFORMAT_PNG
struct QWindowsCustomPngCursor {
@@ -431,7 +470,7 @@ struct QWindowsCustomPngCursor {
int hotSpotY;
};
-QCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape)
+QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen)
{
static const QWindowsCustomPngCursor pngCursors[] = {
{ Qt::SplitVCursor, 32, "splitvcursor_32.png", 11, 11 },
@@ -457,14 +496,14 @@ QCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape)
{ Qt::DragLinkCursor, 64, "draglinkcursor_64.png", 0, 0 }
};
- const int cursorSize = GetSystemMetrics(SM_CXCURSOR);
+ const QSize cursorSize = systemCursorSize(screen);
const QWindowsCustomPngCursor *sEnd = pngCursors + sizeof(pngCursors) / sizeof(pngCursors[0]);
const QWindowsCustomPngCursor *bestFit = 0;
int sizeDelta = INT_MAX;
for (const QWindowsCustomPngCursor *s = pngCursors; s < sEnd; ++s) {
if (s->shape != cursorShape)
continue;
- const int currentSizeDelta = qMax(s->size, cursorSize) - qMin(s->size, cursorSize);
+ const int currentSizeDelta = qMax(s->size, cursorSize.width()) - qMin(s->size, cursorSize.width());
if (currentSizeDelta < sizeDelta) {
bestFit = s;
if (currentSizeDelta == 0)
@@ -474,11 +513,11 @@ QCursor QWindowsCursor::customCursor(Qt::CursorShape cursorShape)
}
if (!bestFit)
- return QCursor();
+ return PixmapCursor();
const QPixmap rawImage(QStringLiteral(":/qt-project.org/windows/cursors/images/") +
QString::fromLatin1(bestFit->fileName));
- return QCursor(rawImage, bestFit->hotSpotX, bestFit->hotSpotY);
+ return PixmapCursor(rawImage, QPoint(bestFit->hotSpotX, bestFit->hotSpotY));
}
#endif // Q_OS_WINCE || QT_NO_IMAGEFORMAT_PNG
@@ -487,8 +526,10 @@ struct QWindowsStandardCursorMapping {
LPCWSTR resource;
};
-HCURSOR QWindowsCursor::createSystemCursor(const QCursor &c)
+HCURSOR QWindowsCursor::createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen)
{
+ Q_ASSERT(cursorShape != Qt::BitmapCursor);
+
static const QWindowsStandardCursorMapping standardCursors[] = {
{ Qt::ArrowCursor, IDC_ARROW},
{ Qt::UpArrowCursor, IDC_UPARROW },
@@ -506,20 +547,9 @@ HCURSOR QWindowsCursor::createSystemCursor(const QCursor &c)
{ Qt::PointingHandCursor, IDC_HAND }
};
- const Qt::CursorShape cursorShape = c.shape();
switch (cursorShape) {
- case Qt::BitmapCursor: {
- const QPixmap pixmap = c.pixmap();
- if (!pixmap.isNull())
- return QWindowsCursor::createPixmapCursor(pixmap, c.hotSpot());
- const QImage bbits = c.bitmap()->toImage().convertToFormat(QImage::Format_Mono);
- const QImage mbits = c.mask()->toImage().convertToFormat(QImage::Format_Mono);
- const bool invb = bbits.colorCount() > 1 && qGray(bbits.color(0)) < qGray(bbits.color(1));
- const bool invm = mbits.colorCount() > 1 && qGray(mbits.color(0)) < qGray(mbits.color(1));
- return createBitmapCursor(bbits, mbits, c.hotSpot(), invb, invm);
- }
case Qt::BlankCursor: {
- QImage blank = QImage(systemCursorSize(), QImage::Format_Mono);
+ QImage blank = QImage(systemCursorSize(screen), QImage::Format_Mono);
blank.fill(0); // ignore color table
return createBitmapCursor(blank, blank);
}
@@ -530,7 +560,7 @@ HCURSOR QWindowsCursor::createSystemCursor(const QCursor &c)
case Qt::DragCopyCursor:
case Qt::DragMoveCursor:
case Qt::DragLinkCursor:
- return createSystemCursor(customCursor(cursorShape));
+ return QWindowsCursor::createPixmapCursor(customCursor(cursorShape, screen));
default:
break;
}
@@ -555,44 +585,52 @@ HCURSOR QWindowsCursor::createSystemCursor(const QCursor &c)
\brief Return cached standard cursor resources or create new ones.
*/
-QWindowsWindowCursor QWindowsCursor::standardWindowCursor(Qt::CursorShape shape)
+CursorHandlePtr QWindowsCursor::standardWindowCursor(Qt::CursorShape shape)
{
- const QWindowsCursorCacheKey key(shape);
- CursorCache::iterator it = m_cursorCache.find(key);
- if (it == m_cursorCache.end())
- it = m_cursorCache.insert(key, QWindowsWindowCursor(QCursor(shape)));
- return it.value();
+ StandardCursorCache::Iterator it = m_standardCursorCache.find(shape);
+ if (it == m_standardCursorCache.end()) {
+ if (const HCURSOR hc = QWindowsCursor::createCursorFromShape(shape, m_screen))
+ it = m_standardCursorCache.insert(shape, CursorHandlePtr(new CursorHandle(hc)));
+ }
+ return it != m_standardCursorCache.end() ? it.value() : CursorHandlePtr(new CursorHandle);
}
/*!
\brief Return cached pixmap cursor or create new one.
*/
-QWindowsWindowCursor QWindowsCursor::pixmapWindowCursor(const QCursor &c)
+CursorHandlePtr QWindowsCursor::pixmapWindowCursor(const QCursor &c)
{
- const QWindowsCursorCacheKey cacheKey(c);
- CursorCache::iterator it = m_cursorCache.find(cacheKey);
- if (it == m_cursorCache.end()) {
- if (m_cursorCache.size() > 50) {
+ const QWindowsPixmapCursorCacheKey cacheKey(c);
+ PixmapCursorCache::iterator it = m_pixmapCursorCache.find(cacheKey);
+ if (it == m_pixmapCursorCache.end()) {
+ if (m_pixmapCursorCache.size() > 50) {
// Prevent the cursor cache from growing indefinitely hitting GDI resource
// limits if new pixmap cursors are created repetitively by purging out
// all-noncurrent pixmap cursors (QTBUG-43515)
const HCURSOR currentCursor = GetCursor();
- for (it = m_cursorCache.begin(); it != m_cursorCache.end() ; ) {
- if (it.key().bitmapCacheKey && it.value().handle() != currentCursor)
- it = m_cursorCache.erase(it);
+ for (it = m_pixmapCursorCache.begin(); it != m_pixmapCursorCache.end() ; ) {
+ if (it.value()->handle() != currentCursor)
+ it = m_pixmapCursorCache.erase(it);
else
++it;
}
}
- it = m_cursorCache.insert(cacheKey, QWindowsWindowCursor(c));
+ const qreal scaleFactor = QHighDpiScaling::factor(m_screen);
+ const QPixmap pixmap = c.pixmap();
+ const HCURSOR hc = pixmap.isNull()
+ ? createBitmapCursor(c, scaleFactor)
+ : QWindowsCursor::createPixmapCursor(pixmap, c.hotSpot(), scaleFactor);
+ it = m_pixmapCursorCache.insert(cacheKey, CursorHandlePtr(new CursorHandle(hc)));
}
return it.value();
}
-QWindowsCursor::QWindowsCursor()
+QWindowsCursor::QWindowsCursor(const QPlatformScreen *screen)
+ : m_screen(screen)
{
- initResources();
+ static const bool dummy = initResources();
+ Q_UNUSED(dummy)
}
/*!
@@ -607,13 +645,13 @@ void QWindowsCursor::changeCursor(QCursor *cursorIn, QWindow *window)
if (!window)
return;
if (!cursorIn) {
- QWindowsWindow::baseWindowOf(window)->setCursor(QWindowsWindowCursor());
+ QWindowsWindow::baseWindowOf(window)->setCursor(CursorHandlePtr(new CursorHandle));
return;
}
- const QWindowsWindowCursor wcursor =
+ const CursorHandlePtr wcursor =
cursorIn->shape() == Qt::BitmapCursor ?
pixmapWindowCursor(*cursorIn) : standardWindowCursor(cursorIn->shape());
- if (wcursor.handle()) {
+ if (wcursor->handle()) {
QWindowsWindow::baseWindowOf(window)->setCursor(wcursor);
} else {
qWarning("%s: Unable to obtain system cursor for %d",
@@ -646,13 +684,100 @@ QWindowsCursor::CursorState QWindowsCursor::cursorState()
QPoint QWindowsCursor::pos() const
{
- return mousePosition() / QWindowsScaling::factor();
+ return mousePosition();
}
void QWindowsCursor::setPos(const QPoint &pos)
{
- const QPoint posDp = pos * QWindowsScaling::factor();
- SetCursorPos(posDp.x() , posDp.y());
+ SetCursorPos(pos.x() , pos.y());
+}
+
+QPixmap QWindowsCursor::dragDefaultCursor(Qt::DropAction action) const
+{
+ switch (action) {
+ case Qt::CopyAction:
+ if (m_copyDragCursor.isNull())
+ m_copyDragCursor = QWindowsCursor::customCursor(Qt::DragCopyCursor, m_screen).pixmap;
+ return m_copyDragCursor;
+ case Qt::TargetMoveAction:
+ case Qt::MoveAction:
+ if (m_moveDragCursor.isNull())
+ m_moveDragCursor = QWindowsCursor::customCursor(Qt::DragMoveCursor, m_screen).pixmap;
+ return m_moveDragCursor;
+ case Qt::LinkAction:
+ if (m_linkDragCursor.isNull())
+ m_linkDragCursor = QWindowsCursor::customCursor(Qt::DragLinkCursor, m_screen).pixmap;
+ return m_linkDragCursor;
+ default:
+ break;
+ }
+
+ static const char * const ignoreDragCursorXpmC[] = {
+ "24 30 3 1",
+ ". c None",
+ "a c #000000",
+ "X c #FFFFFF",
+ "aa......................",
+ "aXa.....................",
+ "aXXa....................",
+ "aXXXa...................",
+ "aXXXXa..................",
+ "aXXXXXa.................",
+ "aXXXXXXa................",
+ "aXXXXXXXa...............",
+ "aXXXXXXXXa..............",
+ "aXXXXXXXXXa.............",
+ "aXXXXXXaaaa.............",
+ "aXXXaXXa................",
+ "aXXaaXXa................",
+ "aXa..aXXa...............",
+ "aa...aXXa...............",
+ "a.....aXXa..............",
+ "......aXXa.....XXXX.....",
+ ".......aXXa..XXaaaaXX...",
+ ".......aXXa.XaaaaaaaaX..",
+ "........aa.XaaaXXXXaaaX.",
+ "...........XaaaaX..XaaX.",
+ "..........XaaXaaaX..XaaX",
+ "..........XaaXXaaaX.XaaX",
+ "..........XaaX.XaaaXXaaX",
+ "..........XaaX..XaaaXaaX",
+ "...........XaaX..XaaaaX.",
+ "...........XaaaXXXXaaaX.",
+ "............XaaaaaaaaX..",
+ ".............XXaaaaXX...",
+ "...............XXXX....."};
+
+ if (m_ignoreDragCursor.isNull()) {
+#if !defined (Q_OS_WINCE)
+ HCURSOR cursor = LoadCursor(NULL, IDC_NO);
+ ICONINFO iconInfo = {0, 0, 0, 0, 0};
+ GetIconInfo(cursor, &iconInfo);
+ BITMAP bmColor = {0, 0, 0, 0, 0, 0, 0};
+
+ if (iconInfo.hbmColor
+ && GetObject(iconInfo.hbmColor, sizeof(BITMAP), &bmColor)
+ && bmColor.bmWidth == bmColor.bmWidthBytes / 4) {
+ const int colorBitsLength = bmColor.bmHeight * bmColor.bmWidthBytes;
+ uchar *colorBits = new uchar[colorBitsLength];
+ GetBitmapBits(iconInfo.hbmColor, colorBitsLength, colorBits);
+ const QImage colorImage(colorBits, bmColor.bmWidth, bmColor.bmHeight,
+ bmColor.bmWidthBytes, QImage::Format_ARGB32);
+
+ m_ignoreDragCursor = QPixmap::fromImage(colorImage);
+ delete [] colorBits;
+ } else {
+ m_ignoreDragCursor = QPixmap(ignoreDragCursorXpmC);
+ }
+
+ DeleteObject(iconInfo.hbmMask);
+ DeleteObject(iconInfo.hbmColor);
+ DestroyCursor(cursor);
+#else // !Q_OS_WINCE
+ m_ignoreDragCursor = QPixmap(ignoreDragCursorXpmC);
+#endif // !Q_OS_WINCE
+ }
+ return m_ignoreDragCursor;
}
/*!
@@ -660,78 +785,11 @@ void QWindowsCursor::setPos(const QPoint &pos)
\brief Per-Window cursor. Contains a QCursor and manages its associated system
cursor handle resource.
- Based on QSharedDataPointer, so that it can be passed around and
- used as a property of QWindowsBaseWindow.
-
\internal
\ingroup qt-lighthouse-win
\sa QWindowsCursor
*/
-class QWindowsWindowCursorData : public QSharedData
-{
-public:
- QWindowsWindowCursorData() : m_cursor(Qt::ArrowCursor), m_handle(0) {}
- explicit QWindowsWindowCursorData(const QCursor &c);
- ~QWindowsWindowCursorData();
-
- const QCursor m_cursor;
- const HCURSOR m_handle;
-};
-
-QWindowsWindowCursorData::QWindowsWindowCursorData(const QCursor &c) :
- m_cursor(c),
- m_handle(QWindowsCursor::createSystemCursor(c))
-{
-}
-
-QWindowsWindowCursorData::~QWindowsWindowCursorData()
-{
- if (m_handle)
- DestroyCursor(m_handle);
-}
-
-QWindowsWindowCursor::QWindowsWindowCursor() :
- m_data(new QWindowsWindowCursorData)
-{
-}
-
-QWindowsWindowCursor::QWindowsWindowCursor(const QCursor &c) :
- m_data(new QWindowsWindowCursorData(c))
-{
-}
-
-QWindowsWindowCursor::~QWindowsWindowCursor()
-{
-}
-
-QWindowsWindowCursor::QWindowsWindowCursor(const QWindowsWindowCursor &rhs) :
- m_data(rhs.m_data)
-{
-}
-
-QWindowsWindowCursor & QWindowsWindowCursor::operator =(const QWindowsWindowCursor &rhs)
-{
- if (this != &rhs)
- m_data.operator =(rhs.m_data);
- return *this;
-}
-
-bool QWindowsWindowCursor::isNull() const
-{
- return m_data->m_handle == 0;
-}
-
-QCursor QWindowsWindowCursor::cursor() const
-{
- return m_data->m_cursor;
-}
-
-HCURSOR QWindowsWindowCursor::handle() const
-{
- return m_data->m_handle;
-}
-
QT_END_NAMESPACE
#endif // !QT_NO_CURSOR
diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h
index f1763ddd7d..e93f779f94 100644
--- a/src/plugins/platforms/windows/qwindowscursor.h
+++ b/src/plugins/platforms/windows/qwindowscursor.h
@@ -37,51 +37,49 @@
#include "qtwindows_additional.h"
#include <qpa/qplatformcursor.h>
-#include <QtCore/QSharedDataPointer>
+#include <QtCore/QSharedPointer>
#include <QtCore/QHash>
QT_BEGIN_NAMESPACE
-class QWindowsWindowCursorData;
-
-struct QWindowsCursorCacheKey
+struct QWindowsPixmapCursorCacheKey
{
- explicit QWindowsCursorCacheKey(const QCursor &c);
- explicit QWindowsCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {}
- QWindowsCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {}
+ explicit QWindowsPixmapCursorCacheKey(const QCursor &c);
- Qt::CursorShape shape;
qint64 bitmapCacheKey;
qint64 maskCacheKey;
};
-inline bool operator==(const QWindowsCursorCacheKey &k1, const QWindowsCursorCacheKey &k2)
+inline bool operator==(const QWindowsPixmapCursorCacheKey &k1, const QWindowsPixmapCursorCacheKey &k2)
{
- return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey;
+ return k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey;
}
-inline uint qHash(const QWindowsCursorCacheKey &k, uint seed) Q_DECL_NOTHROW
+inline uint qHash(const QWindowsPixmapCursorCacheKey &k, uint seed) Q_DECL_NOTHROW
{
- return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed;
+ return (uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed;
}
-class QWindowsWindowCursor
+class CursorHandle
{
+ Q_DISABLE_COPY(CursorHandle)
public:
- QWindowsWindowCursor();
- explicit QWindowsWindowCursor(const QCursor &c);
- ~QWindowsWindowCursor();
- QWindowsWindowCursor(const QWindowsWindowCursor &c);
- QWindowsWindowCursor &operator=(const QWindowsWindowCursor &c);
+ explicit CursorHandle(HCURSOR hcursor = Q_NULLPTR) : m_hcursor(hcursor) {}
+ ~CursorHandle()
+ {
+ if (m_hcursor)
+ DestroyCursor(m_hcursor);
+ }
- bool isNull() const;
- QCursor cursor() const;
- HCURSOR handle() const;
+ bool isNull() const { return !m_hcursor; }
+ HCURSOR handle() const { return m_hcursor; }
private:
- QSharedDataPointer<QWindowsWindowCursorData> m_data;
+ const HCURSOR m_hcursor;
};
+typedef QSharedPointer<CursorHandle> CursorHandlePtr;
+
class QWindowsCursor : public QPlatformCursor
{
public:
@@ -91,25 +89,44 @@ public:
CursorSuppressed // Cursor suppressed by touch interaction (Windows 8).
};
- QWindowsCursor();
+ struct PixmapCursor {
+ explicit PixmapCursor(const QPixmap &pix = QPixmap(), const QPoint &h = QPoint()) : pixmap(pix), hotSpot(h) {}
+
+ QPixmap pixmap;
+ QPoint hotSpot;
+ };
+
+ explicit QWindowsCursor(const QPlatformScreen *screen);
void changeCursor(QCursor * widgetCursor, QWindow * widget) Q_DECL_OVERRIDE;
QPoint pos() const Q_DECL_OVERRIDE;
void setPos(const QPoint &pos) Q_DECL_OVERRIDE;
- static HCURSOR createPixmapCursor(const QPixmap &pixmap, const QPoint &hotSpot);
- static HCURSOR createSystemCursor(const QCursor &c);
- static QCursor customCursor(Qt::CursorShape cursorShape);
+ static HCURSOR createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor = 1);
+ static HCURSOR createPixmapCursor(const PixmapCursor &pc, qreal scaleFactor = 1) { return createPixmapCursor(pc.pixmap, pc.hotSpot, scaleFactor); }
+ static PixmapCursor customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen = Q_NULLPTR);
+
+ static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = Q_NULLPTR);
static QPoint mousePosition();
static CursorState cursorState();
- QWindowsWindowCursor standardWindowCursor(Qt::CursorShape s = Qt::ArrowCursor);
- QWindowsWindowCursor pixmapWindowCursor(const QCursor &c);
+ CursorHandlePtr standardWindowCursor(Qt::CursorShape s = Qt::ArrowCursor);
+ CursorHandlePtr pixmapWindowCursor(const QCursor &c);
+
+ QPixmap dragDefaultCursor(Qt::DropAction action) const;
private:
- typedef QHash<QWindowsCursorCacheKey, QWindowsWindowCursor> CursorCache;
+ typedef QHash<Qt::CursorShape, CursorHandlePtr> StandardCursorCache;
+ typedef QHash<QWindowsPixmapCursorCacheKey, CursorHandlePtr> PixmapCursorCache;
+
+ const QPlatformScreen *const m_screen;
+ StandardCursorCache m_standardCursorCache;
+ PixmapCursorCache m_pixmapCursorCache;
- CursorCache m_cursorCache;
+ mutable QPixmap m_copyDragCursor;
+ mutable QPixmap m_moveDragCursor;
+ mutable QPixmap m_linkDragCursor;
+ mutable QPixmap m_ignoreDragCursor;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index da0ba27e3a..9211fd1320 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -360,6 +360,7 @@ public:
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DEBUG_STREAM
/* Output UID (IID, CLSID) as C++ constants.
* The constants are contained in the Windows SDK libs, but not for MinGW. */
static inline QString guidToString(const GUID &g)
@@ -385,6 +386,7 @@ inline QDebug operator<<(QDebug d, const GUID &g)
d << guidToString(g);
return d;
}
+#endif // !QT_NO_DEBUG_STREAM
// Return an allocated wchar_t array from a QString, reserve more memory if desired.
static wchar_t *qStringToWCharArray(const QString &s, size_t reserveSize = 0)
@@ -874,12 +876,12 @@ public:
inline static QWindowsNativeFileDialogBase *create(QFileDialogOptions::AcceptMode am, const QWindowsFileDialogSharedData &data);
- virtual void setWindowTitle(const QString &title);
+ void setWindowTitle(const QString &title) Q_DECL_OVERRIDE;
inline void setMode(QFileDialogOptions::FileMode mode, QFileDialogOptions::AcceptMode acceptMode, QFileDialogOptions::FileDialogOptions options);
inline void setDirectory(const QUrl &directory);
inline void updateDirectory() { setDirectory(m_data.directory()); }
inline QString directory() const;
- virtual void doExec(HWND owner = 0);
+ void doExec(HWND owner = 0) Q_DECL_OVERRIDE;
virtual void setNameFilters(const QStringList &f);
inline void selectNameFilter(const QString &filter);
inline void updateSelectedNameFilter() { selectNameFilter(m_data.selectedNameFilter()); }
@@ -908,7 +910,7 @@ signals:
void filterSelected(const QString & filter);
public slots:
- virtual void close();
+ void close() Q_DECL_OVERRIDE;
protected:
explicit QWindowsNativeFileDialogBase(const QWindowsFileDialogSharedData &data);
@@ -1458,9 +1460,9 @@ class QWindowsNativeSaveFileDialog : public QWindowsNativeFileDialogBase
public:
explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data)
: QWindowsNativeFileDialogBase(data) {}
- virtual void setNameFilters(const QStringList &f);
- virtual QList<QUrl> selectedFiles() const;
- virtual QList<QUrl> dialogResult() const;
+ void setNameFilters(const QStringList &f) Q_DECL_OVERRIDE;
+ QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
+ QList<QUrl> dialogResult() const Q_DECL_OVERRIDE;
};
// Return the first suffix from the name filter "Foo files (*.foo;*.bar)" -> "foo".
@@ -1529,8 +1531,8 @@ class QWindowsNativeOpenFileDialog : public QWindowsNativeFileDialogBase
public:
explicit QWindowsNativeOpenFileDialog(const QWindowsFileDialogSharedData &data) :
QWindowsNativeFileDialogBase(data) {}
- virtual QList<QUrl> selectedFiles() const;
- virtual QList<QUrl> dialogResult() const;
+ QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
+ QList<QUrl> dialogResult() const Q_DECL_OVERRIDE;
private:
inline IFileOpenDialog *openFileDialog() const
@@ -1614,7 +1616,7 @@ public:
virtual QString selectedNameFilter() const Q_DECL_OVERRIDE;
private:
- virtual QWindowsNativeDialogBase *createNativeDialog();
+ QWindowsNativeDialogBase *createNativeDialog() Q_DECL_OVERRIDE;
inline QWindowsNativeFileDialogBase *nativeFileDialog() const
{ return static_cast<QWindowsNativeFileDialogBase *>(nativeDialog()); }
@@ -1742,14 +1744,13 @@ public:
static QWindowsXpNativeFileDialog *create(const OptionsPtr &options, const QWindowsFileDialogSharedData &data);
- virtual void setWindowTitle(const QString &t) { m_title = t; }
- virtual void doExec(HWND owner = 0);
- virtual QPlatformDialogHelper::DialogCode result() const { return m_result; }
+ void setWindowTitle(const QString &t) Q_DECL_OVERRIDE { m_title = t; }
+ void doExec(HWND owner = 0) Q_DECL_OVERRIDE;
int existingDirCallback(HWND hwnd, UINT uMsg, LPARAM lParam);
public slots:
- virtual void close() {}
+ void close() Q_DECL_OVERRIDE {}
private:
typedef BOOL (APIENTRY *PtrGetOpenFileNameW)(LPOPENFILENAMEW);
@@ -1985,19 +1986,19 @@ class QWindowsXpFileDialogHelper : public QWindowsDialogHelperBase<QPlatformFile
{
public:
QWindowsXpFileDialogHelper() {}
- virtual bool supportsNonModalDialog(const QWindow * /* parent */ = 0) const { return false; }
- virtual bool defaultNameFilterDisables() const
+ bool supportsNonModalDialog(const QWindow * /* parent */ = 0) const Q_DECL_OVERRIDE { return false; }
+ bool defaultNameFilterDisables() const Q_DECL_OVERRIDE
{ return true; }
- virtual void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE;
- virtual QUrl directory() const Q_DECL_OVERRIDE;
- virtual void selectFile(const QUrl &url) Q_DECL_OVERRIDE;
- virtual QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
- virtual void setFilter() Q_DECL_OVERRIDE {}
- virtual void selectNameFilter(const QString &) Q_DECL_OVERRIDE;
- virtual QString selectedNameFilter() const Q_DECL_OVERRIDE;
+ void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE;
+ QUrl directory() const Q_DECL_OVERRIDE;
+ void selectFile(const QUrl &url) Q_DECL_OVERRIDE;
+ QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
+ void setFilter() Q_DECL_OVERRIDE {}
+ void selectNameFilter(const QString &) Q_DECL_OVERRIDE;
+ QString selectedNameFilter() const Q_DECL_OVERRIDE;
private:
- virtual QWindowsNativeDialogBase *createNativeDialog();
+ QWindowsNativeDialogBase *createNativeDialog() Q_DECL_OVERRIDE;
inline QWindowsXpNativeFileDialog *nativeFileDialog() const
{ return static_cast<QWindowsXpNativeFileDialog *>(nativeDialog()); }
@@ -2071,14 +2072,13 @@ public:
explicit QWindowsNativeColorDialog(const SharedPointerColor &color);
- virtual void setWindowTitle(const QString &) {}
- virtual QPlatformDialogHelper::DialogCode result() const { return m_code; }
+ void setWindowTitle(const QString &) Q_DECL_OVERRIDE {}
public slots:
- virtual void close() {}
+ void close() Q_DECL_OVERRIDE {}
private:
- virtual void doExec(HWND owner = 0);
+ void doExec(HWND owner = 0) Q_DECL_OVERRIDE;
COLORREF m_customColors[CustomColorCount];
QPlatformDialogHelper::DialogCode m_code;
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index 03438e3ee2..16079576a2 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -33,7 +33,7 @@
#include "qwindowsdrag.h"
#include "qwindowscontext.h"
-#include "qwindowsscaling.h"
+#include "qwindowsscreen.h"
#ifndef QT_NO_CLIPBOARD
# include "qwindowsclipboard.h"
#endif
@@ -43,7 +43,6 @@
#include "qwindowswindow.h"
#include "qwindowsmousehandler.h"
#include "qwindowscursor.h"
-#include "qwindowsscaling.h"
#include <QtGui/QMouseEvent>
#include <QtGui/QPixmap>
@@ -52,6 +51,7 @@
#include <QtGui/QGuiApplication>
#include <qpa/qwindowsysteminterface_p.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtCore/QDebug>
#include <QtCore/QBuffer>
@@ -78,7 +78,7 @@ public:
void setPixmap(const QPixmap &p);
protected:
- void paintEvent(QPaintEvent *)
+ void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
{
QPainter painter(this);
painter.drawPixmap(0, 0, m_pixmap);
@@ -218,23 +218,14 @@ public:
STDMETHOD(GiveFeedback)(DWORD dwEffect);
private:
- class DragCursorHandle {
- Q_DISABLE_COPY(DragCursorHandle)
- public:
- DragCursorHandle(HCURSOR c) : cursor(c) {}
- ~DragCursorHandle() { DestroyCursor(cursor); }
- const HCURSOR cursor;
- };
- typedef QSharedPointer<DragCursorHandle> DragCursorHandlePtr;
-
struct CursorEntry {
CursorEntry() : cacheKey(0) {}
- CursorEntry(const QPixmap &p, qint64 cK, const DragCursorHandlePtr &c, const QPoint &h) :
+ CursorEntry(const QPixmap &p, qint64 cK, const CursorHandlePtr &c, const QPoint &h) :
pixmap(p), cacheKey(cK), cursor(c), hotSpot(h) {}
QPixmap pixmap;
qint64 cacheKey; // Cache key of cursor
- DragCursorHandlePtr cursor;
+ CursorHandlePtr cursor;
QPoint hotSpot;
};
@@ -249,7 +240,7 @@ private:
QWindowsDragCursorWindow *m_touchDragWindow;
ULONG m_refs;
-#ifndef QT_NO_DEBUG_OUTPUT
+#ifndef QT_NO_DEBUG_STREAM
friend QDebug operator<<(QDebug, const QWindowsOleDropSource::CursorEntry &);
#endif
};
@@ -271,14 +262,14 @@ QWindowsOleDropSource::~QWindowsOleDropSource()
qCDebug(lcQpaMime) << __FUNCTION__;
}
-#ifndef QT_NO_DEBUG_OUTPUT
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QWindowsOleDropSource::CursorEntry &e)
{
d << "CursorEntry:" << e.pixmap.size() << '#' << e.cacheKey
- << "HCURSOR" << e.cursor->cursor << "hotspot:" << e.hotSpot;
+ << "HCURSOR" << e.cursor->handle() << "hotspot:" << e.hotSpot;
return d;
}
-#endif // !QT_NO_DEBUG_OUTPUT
+#endif // !QT_NO_DEBUG_STREAM
/*!
\brief Blend custom pixmap with cursors.
@@ -289,24 +280,37 @@ void QWindowsOleDropSource::createCursors()
const QDrag *drag = m_drag->currentDrag();
const QPixmap pixmap = drag->pixmap();
const bool hasPixmap = !pixmap.isNull();
- const int scaleFactor = QWindowsScaling::factor();
- const QSize pixmapSizeDp = pixmap.size() * scaleFactor;
+
+ // Find screen for drag. Could be obtained from QDrag::source(), but that might be a QWidget.
+
+ qreal scaleFactor = 1;
+ QPlatformCursor *platformCursor = Q_NULLPTR;
+ if (const QPlatformScreen *platformScreen = QWindowsContext::instance()->screenManager().screenAtDp(QWindowsCursor::mousePosition())) {
+ scaleFactor = QHighDpiScaling::factor(platformScreen);
+ platformCursor = platformScreen->cursor();
+ }
+ if (!platformCursor && QGuiApplication::primaryScreen())
+ platformCursor = QGuiApplication::primaryScreen()->handle()->cursor();
+
const bool scalePixmap = hasPixmap
&& m_mode != TouchDrag // Touch drag: pixmap is shown in a separate QWindow, which will be scaled.
&& (scaleFactor != 1 && scaleFactor != qRound(pixmap.devicePixelRatio()));
- const QPixmap drawPixmap = scalePixmap
- ? pixmap.scaled(pixmapSizeDp, Qt::KeepAspectRatio, Qt::SmoothTransformation) : pixmap;
-
+ const QPixmap scaledPixmap = scalePixmap
+ ? pixmap.scaled((QSizeF(pixmap.size()) * scaleFactor).toSize(),
+ Qt::KeepAspectRatio, Qt::SmoothTransformation)
+ : pixmap;
Qt::DropAction actions[] = { Qt::MoveAction, Qt::CopyAction, Qt::LinkAction, Qt::IgnoreAction };
int actionCount = int(sizeof(actions) / sizeof(actions[0]));
if (!hasPixmap)
--actionCount; // No Qt::IgnoreAction unless pixmap
- const QPoint hotSpot = drag->hotSpot() * scaleFactor;
+ const QPoint hotSpot = scalePixmap
+ ? (QPointF(drag->hotSpot()) * scaleFactor).toPoint()
+ : drag->hotSpot();
for (int cnum = 0; cnum < actionCount; ++cnum) {
const Qt::DropAction action = actions[cnum];
QPixmap cursorPixmap = drag->dragCursor(action);
- if (cursorPixmap.isNull())
- cursorPixmap = m_drag->defaultCursor(action);
+ if (cursorPixmap.isNull() && platformCursor)
+ cursorPixmap = static_cast<QWindowsCursor *>(platformCursor)->dragDefaultCursor(action);
const qint64 cacheKey = cursorPixmap.cacheKey();
const ActionCursorMapIt it = m_cursors.find(action);
if (it != m_cursors.end() && it.value().cacheKey == cacheKey)
@@ -321,21 +325,21 @@ void QWindowsOleDropSource::createCursors()
if (hasPixmap) {
const int x1 = qMin(-hotSpot.x(), 0);
- const int x2 = qMax(pixmapSizeDp.width() - hotSpot.x(), cursorPixmap.width());
+ const int x2 = qMax(scaledPixmap.width() - hotSpot.x(), cursorPixmap.width());
const int y1 = qMin(-hotSpot.y(), 0);
- const int y2 = qMax(pixmapSizeDp.height() - hotSpot.y(), cursorPixmap.height());
+ const int y2 = qMax(scaledPixmap.height() - hotSpot.y(), cursorPixmap.height());
QPixmap newCursor(x2 - x1 + 1, y2 - y1 + 1);
newCursor.fill(Qt::transparent);
QPainter p(&newCursor);
const QPoint pmDest = QPoint(qMax(0, -hotSpot.x()), qMax(0, -hotSpot.y()));
- p.drawPixmap(pmDest, drawPixmap);
+ p.drawPixmap(pmDest, scaledPixmap);
p.drawPixmap(qMax(0, hotSpot.x()),qMax(0, hotSpot.y()), cursorPixmap);
newPixmap = newCursor;
newHotSpot = QPoint(qMax(0, hotSpot.x()), qMax(0, hotSpot.y()));
}
if (const HCURSOR sysCursor = QWindowsCursor::createPixmapCursor(newPixmap, newHotSpot)) {
- const CursorEntry entry(newPixmap, cacheKey, DragCursorHandlePtr(new DragCursorHandle(sysCursor)), newHotSpot);
+ const CursorEntry entry(newPixmap, cacheKey, CursorHandlePtr(new CursorHandle(sysCursor)), newHotSpot);
if (it == m_cursors.end())
m_cursors.insert(action, entry);
else
@@ -448,13 +452,13 @@ QWindowsOleDropSource::GiveFeedback(DWORD dwEffect)
const CursorEntry &e = it.value();
switch (m_mode) {
case MouseDrag:
- SetCursor(e.cursor->cursor);
+ SetCursor(e.cursor->handle());
break;
case TouchDrag:
if (!m_touchDragWindow)
m_touchDragWindow = new QWindowsDragCursorWindow;
m_touchDragWindow->setPixmap(e.pixmap);
- m_touchDragWindow->setFramePosition((QWindowsCursor::mousePosition() - e.hotSpot) / QWindowsScaling::factor());
+ m_touchDragWindow->setFramePosition(QWindowsCursor::mousePosition() - e.hotSpot);
if (!m_touchDragWindow->isVisible())
m_touchDragWindow->show();
break;
@@ -530,9 +534,7 @@ void QWindowsOleDropTarget::handleDrag(QWindow *window, DWORD grfKeyState,
QGuiApplicationPrivate::mouse_buttons = QWindowsMouseHandler::keyStateToMouseButtons(grfKeyState);
const QPlatformDragQtResponse response =
- QWindowSystemInterface::handleDrag(window, windowsDrag->dropData(),
- m_lastPoint / QWindowsScaling::factor(),
- actions);
+ QWindowSystemInterface::handleDrag(window, windowsDrag->dropData(), m_lastPoint, actions);
m_answerRect = response.answerRect();
const Qt::DropAction action = response.acceptedAction();
@@ -625,9 +627,8 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState,
const QPlatformDropQtResponse response =
QWindowSystemInterface::handleDrop(m_window, windowsDrag->dropData(),
- m_lastPoint / QWindowsScaling::factor(),
+ m_lastPoint,
translateToQDragDropActions(*pdwEffect));
-
if (response.isAccepted()) {
const Qt::DropAction action = response.acceptedAction();
if (action == Qt::MoveAction || action == Qt::TargetMoveAction) {
@@ -706,94 +707,6 @@ IDropTargetHelper* QWindowsDrag::dropHelper() {
return m_cachedDropTargetHelper;
}
-QPixmap QWindowsDrag::defaultCursor(Qt::DropAction action) const
-{
- switch (action) {
- case Qt::CopyAction:
- if (m_copyDragCursor.isNull())
- m_copyDragCursor = QWindowsCursor::customCursor(Qt::DragCopyCursor).pixmap();
- return m_copyDragCursor;
- case Qt::TargetMoveAction:
- case Qt::MoveAction:
- if (m_moveDragCursor.isNull())
- m_moveDragCursor = QWindowsCursor::customCursor(Qt::DragMoveCursor).pixmap();
- return m_moveDragCursor;
- case Qt::LinkAction:
- if (m_linkDragCursor.isNull())
- m_linkDragCursor = QWindowsCursor::customCursor(Qt::DragLinkCursor).pixmap();
- return m_linkDragCursor;
- default:
- break;
- }
-
- static const char * const ignoreDragCursorXpmC[] = {
- "24 30 3 1",
- ". c None",
- "a c #000000",
- "X c #FFFFFF",
- "aa......................",
- "aXa.....................",
- "aXXa....................",
- "aXXXa...................",
- "aXXXXa..................",
- "aXXXXXa.................",
- "aXXXXXXa................",
- "aXXXXXXXa...............",
- "aXXXXXXXXa..............",
- "aXXXXXXXXXa.............",
- "aXXXXXXaaaa.............",
- "aXXXaXXa................",
- "aXXaaXXa................",
- "aXa..aXXa...............",
- "aa...aXXa...............",
- "a.....aXXa..............",
- "......aXXa.....XXXX.....",
- ".......aXXa..XXaaaaXX...",
- ".......aXXa.XaaaaaaaaX..",
- "........aa.XaaaXXXXaaaX.",
- "...........XaaaaX..XaaX.",
- "..........XaaXaaaX..XaaX",
- "..........XaaXXaaaX.XaaX",
- "..........XaaX.XaaaXXaaX",
- "..........XaaX..XaaaXaaX",
- "...........XaaX..XaaaaX.",
- "...........XaaaXXXXaaaX.",
- "............XaaaaaaaaX..",
- ".............XXaaaaXX...",
- "...............XXXX....."};
-
- if (m_ignoreDragCursor.isNull()) {
-#if !defined (Q_OS_WINCE)
- HCURSOR cursor = LoadCursor(NULL, IDC_NO);
- ICONINFO iconInfo = {0, 0, 0, 0, 0};
- GetIconInfo(cursor, &iconInfo);
- BITMAP bmColor = {0, 0, 0, 0, 0, 0, 0};
-
- if (iconInfo.hbmColor
- && GetObject(iconInfo.hbmColor, sizeof(BITMAP), &bmColor)
- && bmColor.bmWidth == bmColor.bmWidthBytes / 4) {
- const int colorBitsLength = bmColor.bmHeight * bmColor.bmWidthBytes;
- uchar *colorBits = new uchar[colorBitsLength];
- GetBitmapBits(iconInfo.hbmColor, colorBitsLength, colorBits);
- const QImage colorImage(colorBits, bmColor.bmWidth, bmColor.bmHeight,
- bmColor.bmWidthBytes, QImage::Format_ARGB32);
-
- m_ignoreDragCursor = QPixmap::fromImage(colorImage);
- delete [] colorBits;
- } else {
- m_ignoreDragCursor = QPixmap(ignoreDragCursorXpmC);
- }
-
- DeleteObject(iconInfo.hbmMask);
- DeleteObject(iconInfo.hbmColor);
- DestroyCursor(cursor);
-#else // !Q_OS_WINCE
- m_ignoreDragCursor = QPixmap(ignoreDragCursorXpmC);
-#endif // !Q_OS_WINCE
- }
- return m_ignoreDragCursor;
-}
-
Qt::DropAction QWindowsDrag::drag(QDrag *drag)
{
// TODO: Accessibility handling?
diff --git a/src/plugins/platforms/windows/qwindowsdrag.h b/src/plugins/platforms/windows/qwindowsdrag.h
index 9a5e0b17f2..890ad6c142 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.h
+++ b/src/plugins/platforms/windows/qwindowsdrag.h
@@ -42,6 +42,9 @@
struct IDropTargetHelper;
QT_BEGIN_NAMESPACE
+
+class QPlatformScreen;
+
class QWindowsDropMimeData : public QWindowsInternalMimeData {
public:
QWindowsDropMimeData() {}
@@ -95,18 +98,11 @@ public:
IDropTargetHelper* dropHelper();
- QPixmap defaultCursor(Qt::DropAction action) const;
-
private:
QWindowsDropMimeData m_dropData;
IDataObject *m_dropDataObject;
IDropTargetHelper* m_cachedDropTargetHelper;
-
- mutable QPixmap m_copyDragCursor;
- mutable QPixmap m_moveDragCursor;
- mutable QPixmap m_linkDragCursor;
- mutable QPixmap m_ignoreDragCursor;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp
index f2547d5cdd..65a9763be6 100644
--- a/src/plugins/platforms/windows/qwindowseglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp
@@ -39,7 +39,7 @@
#include <QtGui/QOpenGLContext>
#if defined(QT_OPENGL_ES_2_ANGLE) || defined(QT_OPENGL_DYNAMIC)
-# include <QtANGLE/EGL/eglext.h>
+# include <EGL/eglext.h>
#endif
QT_BEGIN_NAMESPACE
@@ -118,11 +118,11 @@ void *QWindowsLibEGL::resolve(const char *name)
bool QWindowsLibEGL::init()
{
-#ifdef QT_DEBUG
- const char dllName[] = "libEGLd.dll";
-#else
- const char dllName[] = "libEGL.dll";
+ const char dllName[] = QT_STRINGIFY(LIBEGL_NAME)
+#if defined(QT_DEBUG) && !defined(Q_OS_WINCE)
+ "d"
#endif
+ "";
qCDebug(lcQpaGl) << "Qt: Using EGL from" << dllName;
@@ -178,11 +178,12 @@ void *QWindowsLibGLESv2::resolve(const char *name)
bool QWindowsLibGLESv2::init()
{
-#ifdef QT_DEBUG
- const char dllName[] = "libGLESv2d.dll";
-#else
- const char dllName[] = "libGLESv2.dll";
+
+ const char dllName[] = QT_STRINGIFY(LIBGLESV2_NAME)
+#if defined(QT_DEBUG) && !defined(Q_OS_WINCE)
+ "d"
#endif
+ "";
qCDebug(lcQpaGl) << "Qt: Using OpenGL ES 2.0 from" << dllName;
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
@@ -350,16 +351,16 @@ QWindowsEGLStaticContext *QWindowsEGLStaticContext::create(QWindowsOpenGLTester:
{
const HDC dc = QWindowsContext::instance()->displayContext();
if (!dc){
- qWarning("%s: No Display", Q_FUNC_INFO);
+ qWarning("%s: No Display", __FUNCTION__);
return 0;
}
if (!libEGL.init()) {
- qWarning("%s: Failed to load and resolve libEGL functions", Q_FUNC_INFO);
+ qWarning("%s: Failed to load and resolve libEGL functions", __FUNCTION__);
return 0;
}
if (!libGLESv2.init()) {
- qWarning("%s: Failed to load and resolve libGLESv2 functions", Q_FUNC_INFO);
+ qWarning("%s: Failed to load and resolve libGLESv2 functions", __FUNCTION__);
return 0;
}
@@ -396,15 +397,15 @@ QWindowsEGLStaticContext *QWindowsEGLStaticContext::create(QWindowsOpenGLTester:
if (display == EGL_NO_DISPLAY)
display = libEGL.eglGetDisplay((EGLNativeDisplayType)dc);
if (!display) {
- qWarning("%s: Could not obtain EGL display", Q_FUNC_INFO);
+ qWarning("%s: Could not obtain EGL display", __FUNCTION__);
return 0;
}
if (!major && !libEGL.eglInitialize(display, &major, &minor)) {
int err = libEGL.eglGetError();
- qWarning("%s: Could not initialize EGL display: error 0x%x\n", Q_FUNC_INFO, err);
+ qWarning("%s: Could not initialize EGL display: error 0x%x", __FUNCTION__, err);
if (err == 0x3001)
- qWarning("%s: When using ANGLE, check if d3dcompiler_4x.dll is available", Q_FUNC_INFO);
+ qWarning("%s: When using ANGLE, check if d3dcompiler_4x.dll is available", __FUNCTION__);
return 0;
}
@@ -430,7 +431,7 @@ void *QWindowsEGLStaticContext::createWindowSurface(void *nativeWindow, void *na
(EGLNativeWindowType) nativeWindow, 0);
if (surface == EGL_NO_SURFACE) {
*err = libEGL.eglGetError();
- qWarning("%s: Could not create the EGL window surface: 0x%x\n", Q_FUNC_INFO, *err);
+ qWarning("%s: Could not create the EGL window surface: 0x%x", __FUNCTION__, *err);
}
return surface;
@@ -533,7 +534,12 @@ QWindowsEGLContext::QWindowsEGLContext(QWindowsEGLStaticContext *staticContext,
}
if (m_eglContext == EGL_NO_CONTEXT) {
- qWarning("QWindowsEGLContext: eglError: %x, this: %p \n", QWindowsEGLStaticContext::libEGL.eglGetError(), this);
+ int err = QWindowsEGLStaticContext::libEGL.eglGetError();
+ qWarning("QWindowsEGLContext: Failed to create context, eglError: %x, this: %p", err, this);
+ // ANGLE gives bad alloc when it fails to reset a previously lost D3D device.
+ // A common cause for this is disabling the graphics adapter used by the app.
+ if (err == EGL_BAD_ALLOC)
+ qWarning("QWindowsEGLContext: Graphics device lost. (Did the adapter get disabled?)");
return;
}
@@ -594,6 +600,12 @@ bool QWindowsEGLContext::makeCurrent(QPlatformSurface *surface)
if (err == EGL_CONTEXT_LOST) {
m_eglContext = EGL_NO_CONTEXT;
qCDebug(lcQpaGl) << "Got EGL context lost in createWindowSurface() for context" << this;
+ } else if (err == EGL_BAD_ACCESS) {
+ // With ANGLE this means no (D3D) device and can happen when disabling/changing graphics adapters.
+ qCDebug(lcQpaGl) << "Bad access (missing device?) in createWindowSurface() for context" << this;
+ // Simulate context loss as the context is useless.
+ QWindowsEGLStaticContext::libEGL.eglDestroyContext(m_eglDisplay, m_eglContext);
+ m_eglContext = EGL_NO_CONTEXT;
}
return false;
}
@@ -623,7 +635,7 @@ bool QWindowsEGLContext::makeCurrent(QPlatformSurface *surface)
// Drop the surface. Will recreate on the next makeCurrent.
window->invalidateSurface();
} else {
- qWarning("QWindowsEGLContext::makeCurrent: eglError: %x, this: %p \n", err, this);
+ qWarning("%s: Failed to make surface current. eglError: %x, this: %p", __FUNCTION__, err, this);
}
}
@@ -635,7 +647,8 @@ void QWindowsEGLContext::doneCurrent()
QWindowsEGLStaticContext::libEGL.eglBindAPI(m_api);
bool ok = QWindowsEGLStaticContext::libEGL.eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!ok)
- qWarning("QWindowsEGLContext::doneCurrent: eglError: %d, this: %p \n", QWindowsEGLStaticContext::libEGL.eglGetError(), this);
+ qWarning("%s: Failed to make no context/surface current. eglError: %d, this: %p", __FUNCTION__,
+ QWindowsEGLStaticContext::libEGL.eglGetError(), this);
}
void QWindowsEGLContext::swapBuffers(QPlatformSurface *surface)
@@ -653,8 +666,15 @@ void QWindowsEGLContext::swapBuffers(QPlatformSurface *surface)
}
bool ok = QWindowsEGLStaticContext::libEGL.eglSwapBuffers(m_eglDisplay, eglSurface);
- if (!ok)
- qWarning("QWindowsEGLContext::swapBuffers: eglError: %d, this: %p \n", QWindowsEGLStaticContext::libEGL.eglGetError(), this);
+ if (!ok) {
+ err = QWindowsEGLStaticContext::libEGL.eglGetError();
+ if (err == EGL_CONTEXT_LOST) {
+ m_eglContext = EGL_NO_CONTEXT;
+ qCDebug(lcQpaGl) << "Got EGL context lost in eglSwapBuffers()";
+ } else {
+ qWarning("%s: Failed to swap buffers. eglError: %d, this: %p", __FUNCTION__, err, this);
+ }
+ }
}
QFunctionPointer QWindowsEGLContext::getProcAddress(const QByteArray &procName)
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 3b27964b0e..8a2fbe1f6d 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -40,11 +40,13 @@
#include <QtGui/QFont>
#include <QtGui/QGuiApplication>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtCore/qmath.h>
#include <QtCore/QDebug>
#include <QtCore/QtEndian>
#include <QtCore/QThreadStorage>
+#include <QtCore/private/qsystemlibrary_p.h>
#include <wchar.h>
@@ -59,6 +61,38 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DIRECTWRITE
+// ### fixme: Consider direct linking of dwrite.dll once Windows Vista pre SP2 is dropped (QTBUG-49711)
+
+typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID &, IUnknown **);
+
+static inline DWriteCreateFactoryType resolveDWriteCreateFactory()
+{
+ if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA)
+ return Q_NULLPTR;
+ QSystemLibrary library(QStringLiteral("dwrite"));
+ QFunctionPointer result = library.resolve("DWriteCreateFactory");
+ if (Q_UNLIKELY(!result)) {
+ qWarning("Unable to load dwrite.dll");
+ return Q_NULLPTR;
+ }
+ return reinterpret_cast<DWriteCreateFactoryType>(result);
+}
+
+static IDWriteFactory *createDirectWriteFactory()
+{
+ static const DWriteCreateFactoryType dWriteCreateFactory = resolveDWriteCreateFactory();
+ if (!dWriteCreateFactory)
+ return Q_NULLPTR;
+ IUnknown *result = Q_NULLPTR;
+ if (FAILED(dWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), &result))) {
+ qErrnoWarning("DWriteCreateFactory failed");
+ return Q_NULLPTR;
+ }
+ return reinterpret_cast<IDWriteFactory *>(result);
+}
+#endif // !QT_NO_DIRECTWRITE
+
// Helper classes for creating font engines directly from font data
namespace {
@@ -465,14 +499,9 @@ namespace {
class CustomFontFileLoader
{
public:
- CustomFontFileLoader() : m_directWriteFactory(0), m_directWriteFontFileLoader(0)
+ CustomFontFileLoader() : m_directWriteFactory(createDirectWriteFactory()), m_directWriteFontFileLoader(0)
{
- HRESULT hres = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
- reinterpret_cast<IUnknown **>(&m_directWriteFactory));
- if (FAILED(hres)) {
- qErrnoWarning(hres, "%s: DWriteCreateFactory failed.", __FUNCTION__);
- } else {
+ if (m_directWriteFactory) {
m_directWriteFontFileLoader = new DirectWriteFontFileLoader();
m_directWriteFactory->RegisterFontFileLoader(m_directWriteFontFileLoader);
}
@@ -570,15 +599,9 @@ qreal QWindowsFontDatabase::fontSmoothingGamma()
static inline bool initDirectWrite(QWindowsFontEngineData *d)
{
if (!d->directWriteFactory) {
- const HRESULT hr = DWriteCreateFactory(
- DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
- reinterpret_cast<IUnknown **>(&d->directWriteFactory)
- );
- if (FAILED(hr)) {
- qErrnoWarning("%s: DWriteCreateFactory failed", __FUNCTION__);
+ d->directWriteFactory = createDirectWriteFactory();
+ if (!d->directWriteFactory)
return false;
- }
}
if (!d->directWriteGdiInterop) {
const HRESULT hr = d->directWriteFactory->GetGdiInterop(&d->directWriteGdiInterop);
@@ -606,6 +629,7 @@ static inline bool initDirectWrite(QWindowsFontEngineData *d)
\ingroup qt-lighthouse-win
*/
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QFontDef &def)
{
QDebugStateSaver saver(d);
@@ -617,6 +641,7 @@ QDebug operator<<(QDebug d, const QFontDef &def)
<< def.hintingPreference;
return d;
}
+#endif // !QT_NO_DEBUG_STREAM
static inline QFontDatabase::WritingSystem writingSystemFromCharSet(uchar charSet)
{
@@ -1098,8 +1123,11 @@ QFontEngine *QWindowsFontDatabase::fontEngine(const QByteArray &fontData, qreal
QFontEngine *fontEngine = 0;
#if !defined(QT_NO_DIRECTWRITE)
- if (hintingPreference == QFont::PreferDefaultHinting
- || hintingPreference == QFont::PreferFullHinting)
+ bool useDirectWrite = (hintingPreference == QFont::PreferNoHinting)
+ || (hintingPreference == QFont::PreferVerticalHinting)
+ || (QHighDpiScaling::isActive() && hintingPreference == QFont::PreferDefaultHinting);
+
+ if (!useDirectWrite)
#endif
{
GUID guid;
@@ -1211,11 +1239,13 @@ QT_WARNING_POP
fontFile->Release();
- fontEngine = new QWindowsFontEngineDirectWrite(directWriteFontFace, pixelSize,
+ fontEngine = new QWindowsFontEngineDirectWrite(directWriteFontFace,
+ pixelSize,
fontEngineData);
// Get font family from font data
fontEngine->fontDef.family = font.familyName();
+ fontEngine->fontDef.hintingPreference = hintingPreference;
directWriteFontFace->Release();
}
@@ -1702,7 +1732,8 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
#if !defined(QT_NO_DIRECTWRITE)
bool useDirectWrite = (request.hintingPreference == QFont::PreferNoHinting)
- || (request.hintingPreference == QFont::PreferVerticalHinting);
+ || (request.hintingPreference == QFont::PreferVerticalHinting)
+ || (QHighDpiScaling::isActive() && request.hintingPreference == QFont::PreferDefaultHinting);
if (useDirectWrite && initDirectWrite(data.data())) {
const QString fam = QString::fromWCharArray(lf.lfFaceName);
const QString nameSubstitute = QWindowsFontEngineDirectWrite::fontNameSubstitute(fam);
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h
index efb5421996..10b6315aab 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h
@@ -118,6 +118,10 @@ private:
QMap<QString, UniqueFontData> m_uniqueFontData;
};
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug, const QFontDef &def);
+#endif
+
QT_END_NAMESPACE
#endif // QWINDOWSFONTDATABASE_H
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
index 795554698c..684c44acf2 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
@@ -194,7 +194,14 @@ typedef struct {
quint16 stringOffset;
} NAME_RECORD;
-static QString fontNameFromTTFile(const QString &filename)
+typedef struct {
+ quint32 tag;
+ quint16 majorVersion;
+ quint16 minorVersion;
+ quint32 numFonts;
+} TTC_TABLE_HEADER;
+
+static QString fontNameFromTTFile(const QString &filename, int startPos = 0)
{
QFile f(filename);
QString retVal;
@@ -202,6 +209,7 @@ static QString fontNameFromTTFile(const QString &filename)
qint64 bytesToRead;
if (f.open(QIODevice::ReadOnly)) {
+ f.seek(startPos);
OFFSET_TABLE ttOffsetTable;
bytesToRead = sizeof(OFFSET_TABLE);
bytesRead = f.read((char*)&ttOffsetTable, bytesToRead);
@@ -282,6 +290,37 @@ static QString fontNameFromTTFile(const QString &filename)
return retVal;
}
+static QStringList fontNamesFromTTCFile(const QString &filename)
+{
+ QFile f(filename);
+ QStringList retVal;
+ qint64 bytesRead;
+ qint64 bytesToRead;
+
+ if (f.open(QIODevice::ReadOnly)) {
+ TTC_TABLE_HEADER ttcTableHeader;
+ bytesToRead = sizeof(TTC_TABLE_HEADER);
+ bytesRead = f.read((char*)&ttcTableHeader, bytesToRead);
+ if (bytesToRead != bytesRead)
+ return retVal;
+ ttcTableHeader.majorVersion = qFromBigEndian(ttcTableHeader.majorVersion);
+ ttcTableHeader.minorVersion = qFromBigEndian(ttcTableHeader.minorVersion);
+ ttcTableHeader.numFonts = qFromBigEndian(ttcTableHeader.numFonts);
+
+ if (ttcTableHeader.majorVersion < 1 || ttcTableHeader.majorVersion > 2)
+ return retVal;
+ QVarLengthArray<quint32> offsetTable(ttcTableHeader.numFonts);
+ bytesToRead = sizeof(quint32) * ttcTableHeader.numFonts;
+ bytesRead = f.read((char*)offsetTable.data(), bytesToRead);
+ if (bytesToRead != bytesRead)
+ return retVal;
+ f.close();
+ for (int i = 0; i < (int)ttcTableHeader.numFonts; ++i)
+ retVal << fontNameFromTTFile(filename, qFromBigEndian(offsetTable[i]));
+ }
+ return retVal;
+}
+
static inline QString fontSettingsOrganization() { return QStringLiteral("Qt-Project"); }
static inline QString fontSettingsApplication() { return QStringLiteral("Qtbase"); }
static inline QString fontSettingsGroup() { return QStringLiteral("CEFontCache"); }
@@ -308,20 +347,28 @@ static QString findFontFile(const QString &faceName)
//empty the cache first, as it seems that it is dirty
settings.remove(QString());
- QDirIterator it(QStringLiteral("/Windows"), QStringList(QStringLiteral("*.ttf")), QDir::Files | QDir::Hidden | QDir::System);
-
+ QDirIterator it(QStringLiteral("/Windows"), QStringList() << QStringLiteral("*.ttf") << QStringLiteral("*.ttc"), QDir::Files | QDir::Hidden | QDir::System);
+ const QLatin1Char lowerF('f');
+ const QLatin1Char upperF('F');
while (it.hasNext()) {
const QString fontFile = it.next();
- const QString fontName = fontNameFromTTFile(fontFile);
- if (fontName.isEmpty())
- continue;
- fontCache.insert(fontName, fontFile);
- settings.setValue(fontName, fontFile);
-
- if (localizedName(fontName)) {
- QString englishFontName = getEnglishName(fontName);
- fontCache.insert(englishFontName, fontFile);
- settings.setValue(englishFontName, fontFile);
+ QStringList fontNames;
+ const QChar c = fontFile[fontFile.size() - 1];
+ if (c == lowerF || c == upperF)
+ fontNames << fontNameFromTTFile(fontFile);
+ else
+ fontNames << fontNamesFromTTCFile(fontFile);
+ foreach (const QString fontName, fontNames) {
+ if (fontName.isEmpty())
+ continue;
+ fontCache.insert(fontName, fontFile);
+ settings.setValue(fontName, fontFile);
+
+ if (localizedName(fontName)) {
+ QString englishFontName = getEnglishName(fontName);
+ fontCache.insert(englishFontName, fontFile);
+ settings.setValue(englishFontName, fontFile);
+ }
}
}
settings.endGroup();
@@ -355,7 +402,7 @@ static bool addFontToDatabase(const QString &faceName,
const QFont::Weight weight = QPlatformFontDatabase::weightFromInteger(tm->tmWeight);
const QFont::Stretch stretch = QFont::Unstretched;
-#ifndef QT_NO_DEBUG_OUTPUT
+#ifndef QT_NO_DEBUG_STREAM
if (QWindowsContext::verbose > 2) {
QString message;
QTextStream str(&message);
@@ -677,7 +724,7 @@ QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString &family, QF
result.append(QWindowsFontDatabase::extraTryFontsForFamily(family));
- result.append(QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script));
+ result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
qCDebug(lcQpaFonts) << __FUNCTION__ << family << style << styleHint
<< script << result;
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h
index ad5c005ffa..f65dc38801 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h
@@ -43,12 +43,15 @@ QT_BEGIN_NAMESPACE
class QWindowsFontDatabaseFT : public QBasicFontDatabase
{
public:
- void populateFontDatabase();
+ void populateFontDatabase() Q_DECL_OVERRIDE;
void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle);
- QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference);
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize,
+ QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style,
+ QFont::StyleHint styleHint,
+ QChar::Script script) const Q_DECL_OVERRIDE;
QString fontDir() const Q_DECL_OVERRIDE;
QFont defaultFont() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index 3685197430..30417f7cee 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -1357,6 +1357,12 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at)
QWindowsFontEngineDirectWrite *fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace,
fontEngine->fontDef.pixelSize,
data);
+ if (fontEngine->fontDef.weight > QFont::Normal)
+ fedw->fontDef.weight = fontEngine->fontDef.weight;
+ if (fontEngine->fontDef.style > QFont::StyleNormal)
+ fedw->fontDef.style = fontEngine->fontDef.style;
+ fedw->fontDef.family = fam;
+ fedw->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference;
return fedw;
} else {
qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__);
@@ -1368,7 +1374,14 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at)
// Get here if original font is not DirectWrite or DirectWrite creation failed for some
// reason
- return new QWindowsFontEngine(fam, lf, data);
+ QFontEngine *fe = new QWindowsFontEngine(fam, lf, data);
+ if (fontEngine->fontDef.weight > QFont::Normal)
+ fe->fontDef.weight = fontEngine->fontDef.weight;
+ if (fontEngine->fontDef.style > QFont::StyleNormal)
+ fe->fontDef.style = fontEngine->fontDef.style;
+ fe->fontDef.family = fam;
+ fe->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference;
+ return fe;
}
bool QWindowsFontEngine::supportsTransformation(const QTransform &transform) const
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.h b/src/plugins/platforms/windows/qwindowsfontengine.h
index 409b44264e..5317368455 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.h
+++ b/src/plugins/platforms/windows/qwindowsfontengine.h
@@ -84,7 +84,7 @@ public:
void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
- QPainterPath *path, QTextItem::RenderFlags flags);
+ QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
HGDIOBJ selectDesignFont() const;
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index 75449e22ed..a50ee60975 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -50,6 +50,7 @@
#include <QtCore/QtEndian>
#include <QtCore/QVarLengthArray>
#include <private/qstringiterator_p.h>
+#include <QtCore/private/qsystemlibrary_p.h>
#include <dwrite.h>
#include <d2d1.h>
@@ -196,8 +197,8 @@ namespace {
*/
QWindowsFontEngineDirectWrite::QWindowsFontEngineDirectWrite(IDWriteFontFace *directWriteFontFace,
- qreal pixelSize,
- const QSharedPointer<QWindowsFontEngineData> &d)
+ qreal pixelSize,
+ const QSharedPointer<QWindowsFontEngineData> &d)
: QFontEngine(DirectWrite)
, m_fontEngineData(d)
, m_directWriteFontFace(directWriteFontFace)
@@ -485,9 +486,9 @@ qreal QWindowsFontEngineDirectWrite::maxCharWidth() const
return 0;
}
-QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition)
+QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t)
{
- QImage im = imageForGlyph(glyph, subPixelPosition, 0, QTransform());
+ QImage im = alphaRGBMapForGlyph(glyph, subPixelPosition, t);
QImage alphaMap(im.width(), im.height(), QImage::Format_Alpha8);
@@ -504,6 +505,11 @@ QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed sub
return alphaMap;
}
+QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition)
+{
+ return alphaMapForGlyph(glyph, subPixelPosition, QTransform());
+}
+
bool QWindowsFontEngineDirectWrite::supportsSubPixelPositions() const
{
return true;
@@ -547,12 +553,17 @@ QImage QWindowsFontEngineDirectWrite::imageForGlyph(glyph_t t,
transform.m21 = xform.m21();
transform.m22 = xform.m22();
+ DWRITE_RENDERING_MODE renderMode =
+ fontDef.hintingPreference == QFont::PreferNoHinting
+ ? DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC
+ : DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL;
+
IDWriteGlyphRunAnalysis *glyphAnalysis = NULL;
HRESULT hr = m_fontEngineData->directWriteFactory->CreateGlyphRunAnalysis(
&glyphRun,
1.0f,
&transform,
- DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
+ renderMode,
DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0,
&glyphAnalysis
@@ -626,7 +637,8 @@ QImage QWindowsFontEngineDirectWrite::alphaRGBMapForGlyph(glyph_t t,
QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const
{
QFontEngine *fontEngine = new QWindowsFontEngineDirectWrite(m_directWriteFontFace,
- pixelSize, m_fontEngineData);
+ pixelSize,
+ m_fontEngineData);
fontEngine->fontDef = fontDef;
fontEngine->fontDef.pixelSize = pixelSize;
@@ -634,6 +646,16 @@ QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const
return fontEngine;
}
+// Dynamically resolve GetUserDefaultLocaleName, which is available from Windows
+// Vista onwards. ### fixme 5.7: Consider reverting to direct linking.
+typedef int (WINAPI *GetUserDefaultLocaleNamePtr)(LPWSTR, int);
+
+static inline GetUserDefaultLocaleNamePtr resolveGetUserDefaultLocaleName()
+{
+ QSystemLibrary library(QStringLiteral("kernel32"));
+ return (GetUserDefaultLocaleNamePtr)library.resolve("GetUserDefaultLocaleName");
+}
+
void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
int dpi, IDWriteFont *font)
{
@@ -652,7 +674,9 @@ void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
BOOL exists = false;
wchar_t localeName[LOCALE_NAME_MAX_LENGTH];
- int defaultLocaleSuccess = GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH);
+ static const GetUserDefaultLocaleNamePtr getUserDefaultLocaleName = resolveGetUserDefaultLocaleName();
+ const int defaultLocaleSuccess = getUserDefaultLocaleName
+ ? getUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH) : 0;
if (defaultLocaleSuccess)
hr = familyNames->FindLocaleName(localeName, &index, &exists);
@@ -703,9 +727,9 @@ QString QWindowsFontEngineDirectWrite::fontNameSubstitute(const QString &familyN
glyph_metrics_t QWindowsFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph, QFixed pos, const QTransform &matrix, GlyphFormat format)
{
Q_UNUSED(pos);
- int margin = 0;
- if (format == QFontEngine::Format_A32 || format == QFontEngine::Format_ARGB)
- margin = glyphMargin(QFontEngine::Format_A32);
+ Q_UNUSED(format);
+
+ int margin = glyphMargin(QFontEngine::Format_A32);
glyph_metrics_t gm = QFontEngine::boundingBox(glyph, matrix);
gm.width += margin * 2;
gm.height += margin * 2;
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
index da772469e9..07e040ed33 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
@@ -61,34 +61,37 @@ public:
void initFontInfo(const QFontDef &request, int dpi, IDWriteFont *font);
- QFixed lineThickness() const;
- QFixed underlinePosition() const;
- bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
- QFixed emSquareSize() const;
+ QFixed lineThickness() const Q_DECL_OVERRIDE;
+ QFixed underlinePosition() const Q_DECL_OVERRIDE;
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE;
+ QFixed emSquareSize() const Q_DECL_OVERRIDE;
glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const;
- void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const;
+ bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
+ ShaperFlags flags) const Q_DECL_OVERRIDE;
+ void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const Q_DECL_OVERRIDE;
void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
- QPainterPath *path, QTextItem::RenderFlags flags);
+ QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
- glyph_metrics_t boundingBox(glyph_t g);
- glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat);
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
+ glyph_metrics_t boundingBox(glyph_t g) Q_DECL_OVERRIDE;
+ glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed,
+ const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE;
- QFixed ascent() const;
- QFixed descent() const;
- QFixed leading() const;
- QFixed xHeight() const;
- qreal maxCharWidth() const;
+ QFixed ascent() const Q_DECL_OVERRIDE;
+ QFixed descent() const Q_DECL_OVERRIDE;
+ QFixed leading() const Q_DECL_OVERRIDE;
+ QFixed xHeight() const Q_DECL_OVERRIDE;
+ qreal maxCharWidth() const Q_DECL_OVERRIDE;
- bool supportsSubPixelPositions() const;
+ bool supportsSubPixelPositions() const Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition);
- QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform);
+ QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
+ QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
+ QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) Q_DECL_OVERRIDE;
- QFontEngine *cloneWithSize(qreal pixelSize) const;
+ QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
const QSharedPointer<QWindowsFontEngineData> &fontEngineData() const { return m_fontEngineData; }
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index a7c14ed2ac..8d33e2f0db 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -284,6 +284,7 @@ static inline void initPixelFormatDescriptor(PIXELFORMATDESCRIPTOR *d)
d->nVersion = 1;
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &pd)
{
QDebugStateSaver saver(d);
@@ -326,6 +327,32 @@ QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &pd)
return d;
}
+QDebug operator<<(QDebug d, const QOpenGLStaticContext &s)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "OpenGL: " << s.vendor << ',' << s.renderer << " default "
+ << s.defaultFormat;
+ if (s.extensions & QOpenGLStaticContext::SampleBuffers)
+ d << ",SampleBuffers";
+ if (s.hasExtensions())
+ d << ", Extension-API present";
+ d << "\nExtensions: " << (s.extensionNames.count(' ') + 1);
+ if (QWindowsContext::verbose > 1)
+ d << s.extensionNames;
+ return d;
+}
+
+QDebug operator<<(QDebug d, const QWindowsOpenGLContextFormat &f)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "ContextFormat: v" << (f.version >> 8) << '.' << (f.version & 0xFF)
+ << " profile: " << f.profile << " options: " << f.options;
+ return d;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
// Check whether an obtained PIXELFORMATDESCRIPTOR matches the request.
static inline bool
isAcceptableFormat(const QWindowsOpenGLAdditionalFormat &additional,
@@ -436,7 +463,7 @@ static int choosePixelFormat(HDC hdc, const QSurfaceFormat &format,
PIXELFORMATDESCRIPTOR *obtainedPfd)
{
if (QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()) {
- qWarning("%s: Attempted to use GDI functions with a non-opengl32.dll library", Q_FUNC_INFO);
+ qWarning("Attempted to use GDI functions with a non-opengl32.dll library");
return 0;
}
@@ -856,16 +883,11 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current()
{
QWindowsOpenGLContextFormat result;
const QByteArray version = QOpenGLStaticContext::getGlString(GL_VERSION);
- const int majorDot = version.indexOf('.');
- if (majorDot != -1) {
- int minorDot = version.indexOf('.', majorDot + 1);
- if (minorDot == -1)
- minorDot = version.size();
- result.version = (version.mid(0, majorDot).toInt() << 8)
- + version.mid(majorDot + 1, minorDot - majorDot - 1).toInt();
- } else {
+ int major, minor;
+ if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor))
+ result.version = (major << 8) + minor;
+ else
result.version = 0x0200;
- }
result.profile = QSurfaceFormat::NoProfile;
if (result.version < 0x0300) {
result.options |= QSurfaceFormat::DeprecatedFunctions;
@@ -905,15 +927,6 @@ void QWindowsOpenGLContextFormat::apply(QSurfaceFormat *format) const
format->setOption(QSurfaceFormat::DeprecatedFunctions);
}
-QDebug operator<<(QDebug d, const QWindowsOpenGLContextFormat &f)
-{
- QDebugStateSaver saver(d);
- d.nospace();
- d << "ContextFormat: v" << (f.version >> 8) << '.' << (f.version & 0xFF)
- << " profile: " << f.profile << " options: " << f.options;
- return d;
-}
-
/*!
\class QOpenGLTemporaryContext
\brief A temporary context that can be instantiated on the stack.
@@ -1005,7 +1018,7 @@ QByteArray QOpenGLStaticContext::getGlString(unsigned int which)
QOpenGLStaticContext *QOpenGLStaticContext::create(bool softwareRendering)
{
if (!opengl32.init(softwareRendering)) {
- qWarning("%s: Failed to load and resolve WGL/OpenGL functions", Q_FUNC_INFO);
+ qWarning("Failed to load and resolve WGL/OpenGL functions");
return 0;
}
@@ -1018,22 +1031,6 @@ QOpenGLStaticContext *QOpenGLStaticContext::create(bool softwareRendering)
return result;
}
-QDebug operator<<(QDebug d, const QOpenGLStaticContext &s)
-{
- QDebugStateSaver saver(d);
- d.nospace();
- d << "OpenGL: " << s.vendor << ',' << s.renderer << " default "
- << s.defaultFormat;
- if (s.extensions & QOpenGLStaticContext::SampleBuffers)
- d << ",SampleBuffers";
- if (s.hasExtensions())
- d << ", Extension-API present";
- d << "\nExtensions: " << (s.extensionNames.count(' ') + 1);
- if (QWindowsContext::verbose > 1)
- d << s.extensionNames;
- return d;
-}
-
/*!
\class QWindowsGLContext
\brief Open GL context.
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index 516fa0707e..ba617f13ce 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -85,7 +85,11 @@ struct QWindowsOpenGLContextFormat
QSurfaceFormat::FormatOptions options;
};
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &);
QDebug operator<<(QDebug d, const QWindowsOpenGLContextFormat &);
+QDebug operator<<(QDebug d, const QOpenGLStaticContext &s);
+#endif
struct QWindowsOpengl32DLL
{
@@ -224,8 +228,6 @@ public:
static QWindowsOpengl32DLL opengl32;
};
-QDebug operator<<(QDebug d, const QOpenGLStaticContext &);
-
class QWindowsGLContext : public QWindowsOpenGLContext
{
public:
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
deleted file mode 100644
index 0bfa0239aa..0000000000
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
-** Copyright (C) 2015 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 "qwindowsguieventdispatcher.h"
-#include "qwindowscontext.h"
-
-#include <qpa/qwindowsysteminterface.h>
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QStack>
-#include <QtCore/QDebug>
-
-#include <windowsx.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QWindowsGuiEventDispatcher
- \brief Event dispatcher for Windows
-
- Maintains a global stack storing the current event dispatcher and
- its processing flags for access from the Windows procedure
- qWindowsWndProc. Handling the Lighthouse gui events should be done
- from within the qWindowsWndProc to ensure correct processing of messages.
-
- \internal
- \ingroup qt-lighthouse-win
-*/
-
-QWindowsGuiEventDispatcher::QWindowsGuiEventDispatcher(QObject *parent) :
- QEventDispatcherWin32(parent), m_flags(0)
-{
- setObjectName(QStringLiteral("QWindowsGuiEventDispatcher"));
- createInternalHwnd(); // QTBUG-40881: Do not delay registering timers, etc. for QtMfc.
-}
-
-bool QWindowsGuiEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
-{
- const QEventLoop::ProcessEventsFlags oldFlags = m_flags;
- m_flags = flags;
- if (QWindowsContext::verbose > 2 && lcQpaEvents().isDebugEnabled())
- qCDebug(lcQpaEvents) << '>' << __FUNCTION__ << objectName() << flags;
- const bool rc = QEventDispatcherWin32::processEvents(flags);
- if (QWindowsContext::verbose > 2 && lcQpaEvents().isDebugEnabled())
- qCDebug(lcQpaEvents) << '<' << __FUNCTION__ << "returns" << rc;
- m_flags = oldFlags;
- return rc;
-}
-
-void QWindowsGuiEventDispatcher::sendPostedEvents()
-{
- QEventDispatcherWin32::sendPostedEvents();
- QWindowSystemInterface::sendWindowSystemEvents(m_flags);
-}
-
-// Helpers for printing debug output for WM_* messages.
-struct MessageDebugEntry
-{
- UINT message;
- const char *description;
- bool interesting;
-};
-
-static const MessageDebugEntry
-messageDebugEntries[] = {
- {WM_CREATE, "WM_CREATE", true},
- {WM_PAINT, "WM_PAINT", true},
- {WM_CLOSE, "WM_CLOSE", true},
- {WM_DESTROY, "WM_DESTROY", true},
- {WM_MOVE, "WM_MOVE", true},
- {WM_SIZE, "WM_SIZE", true},
- {WM_MOUSEACTIVATE,"WM_MOUSEACTIVATE", true},
- {WM_CHILDACTIVATE, "WM_CHILDACTIVATE", true},
- {WM_PARENTNOTIFY, "WM_PARENTNOTIFY", true},
- {WM_ENTERIDLE, "WM_ENTERIDLE", false},
- {WM_GETICON, "WM_GETICON", false},
- {WM_KEYDOWN, "WM_KEYDOWN", true},
- {WM_SYSKEYDOWN, "WM_SYSKEYDOWN", true},
- {WM_SYSCOMMAND, "WM_SYSCOMMAND", true},
- {WM_KEYUP, "WM_KEYUP", true},
- {WM_SYSKEYUP, "WM_SYSKEYUP", true},
-#if defined(WM_APPCOMMAND)
- {WM_APPCOMMAND, "WM_APPCOMMAND", true},
-#endif
- {WM_IME_CHAR, "WM_IMECHAR", true},
- {WM_IME_KEYDOWN, "WM_IMECHAR", true},
- {WM_CANCELMODE, "WM_CANCELMODE", true},
- {WM_CHAR, "WM_CHAR", true},
- {WM_DEADCHAR, "WM_DEADCHAR", true},
- {WM_ACTIVATE, "WM_ACTIVATE", true},
- {WM_GETMINMAXINFO, "WM_GETMINMAXINFO", true},
- {WM_SETFOCUS, "WM_SETFOCUS", true},
- {WM_KILLFOCUS, "WM_KILLFOCUS", true},
- {WM_ENABLE, "WM_ENABLE", true},
- {WM_SHOWWINDOW, "WM_SHOWWINDOW", true},
- {WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
- {WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED", true},
- {WM_SETCURSOR, "WM_SETCURSOR", false},
- {WM_GETFONT, "WM_GETFONT", true},
- {WM_NCMOUSEMOVE, "WM_NCMOUSEMOVE", true},
- {WM_LBUTTONDOWN, "WM_LBUTTONDOWN", true},
- {WM_LBUTTONUP, "WM_LBUTTONUP", true},
- {WM_LBUTTONDBLCLK, "WM_LBUTTONDBLCLK", true},
- {WM_RBUTTONDOWN, "WM_RBUTTONDOWN", true},
- {WM_RBUTTONUP, "WM_RBUTTONUP", true},
- {WM_RBUTTONDBLCLK, "WM_RBUTTONDBLCLK", true},
- {WM_MBUTTONDOWN, "WM_MBUTTONDOWN", true},
- {WM_MBUTTONUP, "WM_MBUTTONUP", true},
- {WM_MBUTTONDBLCLK, "WM_MBUTTONDBLCLK", true},
- {WM_MOUSEWHEEL, "WM_MOUSEWHEEL", true},
- {WM_XBUTTONDOWN, "WM_XBUTTONDOWN", true},
- {WM_XBUTTONUP, "WM_XBUTTONUP", true},
- {WM_XBUTTONDBLCLK, "WM_XBUTTONDBLCLK", true},
- {WM_MOUSEHWHEEL, "WM_MOUSEHWHEEL", true},
- {WM_NCCREATE, "WM_NCCREATE", true},
- {WM_NCCALCSIZE, "WM_NCCALCSIZE", true},
- {WM_NCACTIVATE, "WM_NCACTIVATE", true},
- {WM_NCMOUSELEAVE, "WM_NCMOUSELEAVE", true},
- {WM_NCLBUTTONDOWN, "WM_NCLBUTTONDOWN", true},
- {WM_NCLBUTTONUP, "WM_NCLBUTTONUP", true},
- {WM_ACTIVATEAPP, "WM_ACTIVATEAPP", true},
- {WM_NCPAINT, "WM_NCPAINT", true},
- {WM_ERASEBKGND, "WM_ERASEBKGND", true},
- {WM_MOUSEMOVE, "WM_MOUSEMOVE", true},
- {WM_MOUSELEAVE, "WM_MOUSELEAVE", true},
- {WM_NCHITTEST, "WM_NCHITTEST", false},
- {WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
- {WM_INPUTLANGCHANGE, "WM_INPUTLANGCHANGE", true},
- {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
-#if defined(WM_DWMNCRENDERINGCHANGED)
- {WM_DWMNCRENDERINGCHANGED, "WM_DWMNCRENDERINGCHANGED", true},
-#endif
- {WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
- {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
- {WM_TOUCH, "WM_TOUCH", true},
- {WM_CHANGECBCHAIN, "WM_CHANGECBCHAIN", true},
- {WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD", true},
- {WM_RENDERFORMAT, "WM_RENDERFORMAT", true},
- {WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS", true},
- {WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD", true},
- {WM_CAPTURECHANGED, "WM_CAPTURECHANGED", true},
- {WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION", true},
- {WM_IME_COMPOSITION, "WM_IME_COMPOSITION", true},
- {WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION", true},
- {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
- {WM_IME_REQUEST, "WM_IME_REQUEST", true},
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
- {WM_QUERYENDSESSION, "WM_QUERYENDSESSION", true},
- {WM_ENDSESSION, "WM_ENDSESSION", true},
-#endif
- {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
- {WM_THEMECHANGED, "WM_THEMECHANGED", true}
-};
-
-static inline const MessageDebugEntry *messageDebugEntry(UINT msg)
-{
- for (size_t i = 0; i < sizeof(messageDebugEntries)/sizeof(MessageDebugEntry); i++)
- if (messageDebugEntries[i].message == msg)
- return messageDebugEntries + i;
- return 0;
-}
-
-const char *QWindowsGuiEventDispatcher::windowsMessageName(UINT msg)
-{
- if (const MessageDebugEntry *e = messageDebugEntry(msg))
- return e->description;
- return "Unknown";
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.h b/src/plugins/platforms/windows/qwindowsguieventdispatcher.h
deleted file mode 100644
index 3389139461..0000000000
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QWINDOWSGUIEVENTDISPATCHER_H
-#define QWINDOWSGUIEVENTDISPATCHER_H
-
-#include "qtwindows_additional.h"
-
-#include <QtCore/private/qeventdispatcher_win_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWindowsGuiEventDispatcher : public QEventDispatcherWin32
-{
- Q_OBJECT
-public:
- explicit QWindowsGuiEventDispatcher(QObject *parent = 0);
-
- static const char *windowsMessageName(UINT msg);
-
- bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
- void sendPostedEvents() Q_DECL_OVERRIDE;
-
-private:
- QEventLoop::ProcessEventsFlags m_flags;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWINDOWSGUIEVENTDISPATCHER_H
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index 68e38dc4a6..56b5561756 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -36,7 +36,6 @@
#include "qwindowswindow.h"
#include "qwindowsintegration.h"
#include "qwindowsmousehandler.h"
-#include "qwindowsscaling.h"
#include <QtCore/QDebug>
#include <QtCore/QObject>
@@ -85,6 +84,18 @@ static inline void imeNotifyCancelComposition(HWND hwnd)
ImmReleaseContext(hwnd, himc);
}
+static inline LCID languageIdFromLocaleId(LCID localeId)
+{
+ return localeId & 0xFFFF;
+}
+
+static inline LCID currentInputLanguageId()
+{
+ return languageIdFromLocaleId(reinterpret_cast<quintptr>(GetKeyboardLayout(0)));
+}
+
+Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id); // from qlocale_win.cpp
+
/*!
\class QWindowsInputContext
\brief Windows Input context implementation
@@ -154,7 +165,9 @@ QWindowsInputContext::CompositionContext::CompositionContext() :
QWindowsInputContext::QWindowsInputContext() :
m_WM_MSIME_MOUSE(RegisterWindowMessage(L"MSIMEMouseOperation")),
- m_endCompositionRecursionGuard(false)
+ m_endCompositionRecursionGuard(false),
+ m_languageId(currentInputLanguageId()),
+ m_locale(qt_localeFromLCID(m_languageId))
{
connect(QGuiApplication::inputMethod(), &QInputMethod::cursorRectangleChanged,
this, &QWindowsInputContext::cursorRectChanged);
@@ -220,21 +233,24 @@ void QWindowsInputContext::updateEnabled()
const bool accepted = inputMethodAccepted();
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaInputMethods) << __FUNCTION__ << window << "accepted=" << accepted;
- if (accepted) {
- // Re-enable IME by associating default context saved on first disabling.
- if (platformWindow->testFlag(QWindowsWindow::InputMethodDisabled)) {
- ImmAssociateContext(platformWindow->handle(), QWindowsInputContext::m_defaultContext);
- platformWindow->clearFlag(QWindowsWindow::InputMethodDisabled);
- }
- } else {
- // Disable IME by associating 0 context. Store context first time.
- if (!platformWindow->testFlag(QWindowsWindow::InputMethodDisabled)) {
- const HIMC oldImC = ImmAssociateContext(platformWindow->handle(), 0);
- platformWindow->setFlag(QWindowsWindow::InputMethodDisabled);
- if (!QWindowsInputContext::m_defaultContext && oldImC)
- QWindowsInputContext::m_defaultContext = oldImC;
- }
- }
+ QWindowsInputContext::setWindowsImeEnabled(platformWindow, accepted);
+ }
+}
+
+void QWindowsInputContext::setWindowsImeEnabled(QWindowsWindow *platformWindow, bool enabled)
+{
+ if (!platformWindow || platformWindow->testFlag(QWindowsWindow::InputMethodDisabled) == !enabled)
+ return;
+ if (enabled) {
+ // Re-enable Windows IME by associating default context saved on first disabling.
+ ImmAssociateContext(platformWindow->handle(), QWindowsInputContext::m_defaultContext);
+ platformWindow->clearFlag(QWindowsWindow::InputMethodDisabled);
+ } else {
+ // Disable Windows IME by associating 0 context. Store context first time.
+ const HIMC oldImC = ImmAssociateContext(platformWindow->handle(), 0);
+ platformWindow->setFlag(QWindowsWindow::InputMethodDisabled);
+ if (!QWindowsInputContext::m_defaultContext && oldImC)
+ QWindowsInputContext::m_defaultContext = oldImC;
}
}
@@ -254,10 +270,9 @@ void QWindowsInputContext::cursorRectChanged()
if (!m_compositionContext.hwnd)
return;
const QInputMethod *inputMethod = QGuiApplication::inputMethod();
- const QRect cursorRectangleDip = inputMethod->cursorRectangle().toRect();
- if (!cursorRectangleDip.isValid())
+ const QRect cursorRectangle = inputMethod->cursorRectangle().toRect();
+ if (!cursorRectangle.isValid())
return;
- const QRect cursorRectangle = QWindowsScaling::mapToNative(cursorRectangleDip);
qCDebug(lcQpaInputMethods) << __FUNCTION__<< cursorRectangle;
@@ -308,11 +323,6 @@ void QWindowsInputContext::invokeAction(QInputMethod::Action action, int cursorP
ImmReleaseContext(m_compositionContext.hwnd, himc);
}
-QWindowsInputContext *QWindowsInputContext::instance()
-{
- return static_cast<QWindowsInputContext *>(QWindowsIntegration::instance()->inputContext());
-}
-
static inline QString getCompositionString(HIMC himc, DWORD dwIndex)
{
enum { bufferSize = 256 };
@@ -375,7 +385,7 @@ bool QWindowsInputContext::startComposition(HWND hwnd)
QWindow *window = QGuiApplication::focusWindow();
if (!window)
return false;
- qCDebug(lcQpaInputMethods) << __FUNCTION__ << fo << window;
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << fo << window << "language=" << m_languageId;
if (!fo || QWindowsWindow::handleOf(window) != hwnd)
return false;
initContext(hwnd, fo);
@@ -474,7 +484,8 @@ bool QWindowsInputContext::composition(HWND hwnd, LPARAM lParamIn)
if (lParam & GCS_RESULTSTR) {
// A fixed result, return the converted string
event->setCommitString(getCompositionString(himc, GCS_RESULTSTR));
- endContextComposition();
+ if (!(lParam & GCS_DELTASTART))
+ endContextComposition();
}
const bool result = QCoreApplication::sendEvent(m_compositionContext.focusObject, event.data());
qCDebug(lcQpaInputMethods) << '<' << __FUNCTION__ << "sending markup="
@@ -559,6 +570,21 @@ bool QWindowsInputContext::handleIME_Request(WPARAM wParam,
return false;
}
+void QWindowsInputContext::handleInputLanguageChanged(WPARAM wparam, LPARAM lparam)
+{
+ const LCID newLanguageId = languageIdFromLocaleId(lparam);
+ if (newLanguageId == m_languageId)
+ return;
+ const LCID oldLanguageId = m_languageId;
+ m_languageId = newLanguageId;
+ m_locale = qt_localeFromLCID(m_languageId);
+ emitLocaleChanged();
+
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << hex << showbase
+ << oldLanguageId << "->" << newLanguageId << "Character set:"
+ << DWORD(wparam) << dec << noshowbase << m_locale;
+}
+
/*!
\brief Determines the string for reconversion with selection.
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h
index 110986c20c..636d481e70 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.h
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.h
@@ -36,12 +36,14 @@
#include "qtwindows_additional.h"
+#include <QtCore/QLocale>
#include <QtCore/QPointer>
#include <qpa/qplatforminputcontext.h>
QT_BEGIN_NAMESPACE
class QInputMethodEvent;
+class QWindowsWindow;
class QWindowsInputContext : public QPlatformInputContext
{
@@ -62,14 +64,16 @@ public:
explicit QWindowsInputContext();
~QWindowsInputContext();
+ static void setWindowsImeEnabled(QWindowsWindow *platformWindow, bool enabled);
+
bool hasCapability(Capability capability) const Q_DECL_OVERRIDE;
+ QLocale locale() const Q_DECL_OVERRIDE { return m_locale; }
+
void reset() Q_DECL_OVERRIDE;
void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
void invokeAction(QInputMethod::Action, int cursorPosition) Q_DECL_OVERRIDE;
void setFocusObject(QObject *object) Q_DECL_OVERRIDE;
- static QWindowsInputContext *instance();
-
bool startComposition(HWND hwnd);
bool composition(HWND hwnd, LPARAM lParam);
bool endComposition(HWND hwnd);
@@ -78,6 +82,7 @@ public:
int reconvertString(RECONVERTSTRING *reconv);
bool handleIME_Request(WPARAM wparam, LPARAM lparam, LRESULT *result);
+ void handleInputLanguageChanged(WPARAM wparam, LPARAM lparam);
private slots:
void cursorRectChanged();
@@ -93,6 +98,8 @@ private:
static HIMC m_defaultContext;
CompositionContext m_compositionContext;
bool m_endCompositionRecursionGuard;
+ LCID m_languageId;
+ QLocale m_locale;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 089c3cd0fe..bd2014b8f2 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -33,7 +33,6 @@
****************************************************************************/
#include "qwindowsintegration.h"
-#include "qwindowsscaling.h"
#include "qwindowswindow.h"
#include "qwindowscontext.h"
#include "qwindowsopenglcontext.h"
@@ -45,7 +44,6 @@
# include "qwindowsfontdatabase_ft.h"
#endif
#include "qwindowsfontdatabase.h"
-#include "qwindowsguieventdispatcher.h"
#ifndef QT_NO_CLIPBOARD
# include "qwindowsclipboard.h"
# ifndef QT_NO_DRAGANDDROP
@@ -64,9 +62,11 @@
# include "qwindowssessionmanager.h"
#endif
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qpa/qplatforminputcontextfactory_p.h>
-#include <QtCore/private/qeventdispatcher_win_p.h>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+
#include <QtCore/QDebug>
#include <QtCore/QVariant>
@@ -223,12 +223,9 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList &paramL
m_context.setProcessDpiAwareness(dpiAwareness);
dpiAwarenessSet = true;
}
- // Determine suitable scale factor, don't mix Windows and Qt scaling
- if (dpiAwareness != QtWindows::ProcessDpiUnaware)
- QWindowsScaling::setFactor(QWindowsScaling::determineUiScaleFactor());
qCDebug(lcQpaWindows)
- << __FUNCTION__ << "DpiAwareness=" << dpiAwareness <<",Scaling="
- << QWindowsScaling::factor();
+ << __FUNCTION__ << "DpiAwareness=" << dpiAwareness
+ << "effective process DPI awareness=" << QWindowsContext::processDpiAwareness();
m_context.initTouch(m_options);
}
@@ -258,10 +255,9 @@ QWindowsIntegration::~QWindowsIntegration()
void QWindowsIntegration::initialize()
{
- if (QPlatformInputContext *pluginContext = QPlatformInputContextFactory::create())
- d->m_inputContext.reset(pluginContext);
- else
- d->m_inputContext.reset(new QWindowsInputContext);
+ QString icStr = QPlatformInputContextFactory::requested();
+ icStr.isNull() ? d->m_inputContext.reset(new QWindowsInputContext)
+ : d->m_inputContext.reset(QPlatformInputContextFactory::create(icStr));
}
bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) const
@@ -287,17 +283,19 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co
return true;
case AllGLFunctionsQueryable:
return true;
+ case SwitchableWidgetComposition:
+ return true;
default:
return QPlatformIntegration::hasCapability(cap);
}
return false;
}
-QWindowsWindowData QWindowsIntegration::createWindowData(QWindow *window) const
+QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) const
{
QWindowsWindowData requested;
requested.flags = window->flags();
- requested.geometry = QWindowsScaling::mapToNative(window->geometry());
+ requested.geometry = QHighDpi::toNativePixels(window->geometry(), window);
// Apply custom margins (see QWindowsWindow::setCustomMargins())).
const QVariant customMarginsV = window->property("_q_windowsCustomMargins");
if (customMarginsV.isValid())
@@ -312,22 +310,30 @@ QWindowsWindowData QWindowsIntegration::createWindowData(QWindow *window) const
<< "\n Obtained : " << obtained.geometry << " margins=" << obtained.frame
<< " handle=" << obtained.hwnd << ' ' << obtained.flags << '\n';
- if (obtained.hwnd) {
- if (requested.flags != obtained.flags)
- window->setFlags(obtained.flags);
- // Trigger geometry change signals of QWindow.
- if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry)
- QWindowSystemInterface::handleGeometryChange(window, QWindowsScaling::mapFromNative(obtained.geometry));
+ if (Q_UNLIKELY(!obtained.hwnd))
+ return Q_NULLPTR;
+
+ QWindowsWindow *result = createPlatformWindowHelper(window, obtained);
+ Q_ASSERT(result);
+
+ if (requested.flags != obtained.flags)
+ window->setFlags(obtained.flags);
+ // Trigger geometry/screen change signals of QWindow.
+ if ((obtained.flags & Qt::Desktop) != Qt::Desktop) {
+ if (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());
}
- return obtained;
+ return result;
}
-QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) const
+// Overridden to return a QWindowsDirect2DWindow in Direct2D plugin.
+QWindowsWindow *QWindowsIntegration::createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &data) const
{
- QWindowsWindowData data = createWindowData(window);
- return data.hwnd ? new QWindowsWindow(window, data)
- : Q_NULLPTR;
+ return new QWindowsWindow(window, data);
}
#ifndef QT_NO_OPENGL
@@ -335,11 +341,18 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate()
{
#if defined(QT_OPENGL_DYNAMIC)
+ const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers();
+
QWindowsOpenGLTester::Renderer requestedRenderer = QWindowsOpenGLTester::requestedRenderer();
switch (requestedRenderer) {
case QWindowsOpenGLTester::DesktopGl:
- if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create())
+ if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) {
+ if ((supportedRenderers & QWindowsOpenGLTester::DisableRotationFlag)
+ && !QWindowsScreen::setOrientationPreference(Qt::LandscapeOrientation)) {
+ qCWarning(lcQpaGl, "Unable to disable rotation.");
+ }
return glCtx;
+ }
qCWarning(lcQpaGl, "System OpenGL failed. Falling back to Software OpenGL.");
return QOpenGLStaticContext::create(true);
// If ANGLE is requested, use it, don't try anything else.
@@ -360,10 +373,14 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate()
break;
}
- const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers();
if (supportedRenderers & QWindowsOpenGLTester::DesktopGl) {
- if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create())
+ if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) {
+ if ((supportedRenderers & QWindowsOpenGLTester::DisableRotationFlag)
+ && !QWindowsScreen::setOrientationPreference(Qt::LandscapeOrientation)) {
+ qCWarning(lcQpaGl, "Unable to disable rotation.");
+ }
return glCtx;
+ }
}
if (QWindowsOpenGLTester::Renderers glesRenderers = supportedRenderers & QWindowsOpenGLTester::GlesMask) {
if (QWindowsEGLStaticContext *eglCtx = QWindowsEGLStaticContext::create(glesRenderers))
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index fa5192ba03..da20d9261a 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -60,13 +60,12 @@ public:
explicit QWindowsIntegration(const QStringList &paramList);
virtual ~QWindowsIntegration();
- bool hasCapability(QPlatformIntegration::Capability cap) const;
+ bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
- QWindowsWindowData createWindowData(QWindow *window) const;
- QPlatformWindow *createPlatformWindow(QWindow *window) const;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
#ifndef QT_NO_OPENGL
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
- QOpenGLContext::OpenGLModuleType openGLModuleType();
+ QOpenGLContext::OpenGLModuleType openGLModuleType() Q_DECL_OVERRIDE;
static QWindowsStaticOpenGLContext *staticOpenGLContext();
#endif
QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
@@ -84,7 +83,7 @@ public:
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
QStringList themeNames() const Q_DECL_OVERRIDE;
QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
- QPlatformServices *services() const;
+ QPlatformServices *services() const Q_DECL_OVERRIDE;
QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE;
@@ -101,6 +100,9 @@ public:
QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE;
#endif
+protected:
+ virtual QWindowsWindow *createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &) const;
+
private:
QScopedPointer<QWindowsIntegrationPrivate> d;
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index d47c7df9e0..c5dff60114 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -33,15 +33,16 @@
#include "qwindowskeymapper.h"
#include "qwindowscontext.h"
+#include "qwindowsintegration.h"
#include "qwindowswindow.h"
-#include "qwindowsguieventdispatcher.h"
-#include "qwindowsscaling.h"
#include "qwindowsinputcontext.h"
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtGui/QKeyEvent>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
#if defined(WM_APPCOMMAND)
# ifndef FAPPCOMMAND_MOUSE
@@ -85,10 +86,15 @@ QT_BEGIN_NAMESPACE
The code originates from \c qkeymapper_win.cpp.
*/
+static void clearKeyRecorderOnApplicationInActive(Qt::ApplicationState state);
+
QWindowsKeyMapper::QWindowsKeyMapper()
: m_useRTLExtensions(false), m_keyGrabber(0)
{
memset(keyLayout, 0, sizeof(keyLayout));
+ QGuiApplication *app = static_cast<QGuiApplication *>(QGuiApplication::instance());
+ QObject::connect(app, &QGuiApplication::applicationStateChanged,
+ app, clearKeyRecorderOnApplicationInActive);
}
QWindowsKeyMapper::~QWindowsKeyMapper()
@@ -143,6 +149,12 @@ struct KeyRecorder
};
static KeyRecorder key_recorder;
+static void clearKeyRecorderOnApplicationInActive(Qt::ApplicationState state)
+{
+ if (state == Qt::ApplicationInactive)
+ key_recorder.clearKeys();
+}
+
KeyRecord *KeyRecorder::findKey(int code, bool remove)
{
KeyRecord *result = 0;
@@ -792,10 +804,12 @@ static void showSystemMenu(QWindow* w)
#undef enabled
#undef disabled
#endif // !Q_OS_WINCE
- const QPoint topLeft = topLevel->geometry().topLeft() * QWindowsScaling::factor();
+ const QPoint pos = QHighDpi::toNativePixels(topLevel->geometry().topLeft(), topLevel);
const int ret = TrackPopupMenuEx(menu,
TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD,
- topLeft.x(), topLeft.y(), topLevelHwnd, 0);
+ pos.x(), pos.y(),
+ topLevelHwnd,
+ 0);
if (ret)
qWindowsWndProc(topLevelHwnd, WM_SYSCOMMAND, ret, 0);
}
@@ -1072,7 +1086,9 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
// results, if we map this virtual key-code directly (for eg '?' US layouts). So try
// to find the correct key using the current message parameters & keyboard state.
if (uch.isNull() && msgType == WM_IME_KEYDOWN) {
- if (!QWindowsInputContext::instance()->isComposing())
+ const QWindowsInputContext *windowsInputContext =
+ qobject_cast<const QWindowsInputContext *>(QWindowsIntegration::instance()->inputContext());
+ if (!(windowsInputContext && windowsInputContext->isComposing()))
vk_key = ImmGetVirtualKey((HWND)window->winId());
BYTE keyState[256];
wchar_t newKey[3] = {0};
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index 622352e987..171ace5c20 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -299,8 +299,6 @@ static bool qt_read_dibv5(QDataStream &s, QImage &image)
return true;
}
-//#define QMIME_DEBUG
-
// helpers for using global memory
static int getCf(const FORMATETC &formatetc)
@@ -380,6 +378,73 @@ static bool canGetData(int cf, IDataObject * pDataObj)
return true;
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const FORMATETC &tc)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "FORMATETC(cfFormat=" << tc.cfFormat << ' ';
+ switch (tc.cfFormat) {
+ case CF_TEXT:
+ d << "CF_TEXT";
+ break;
+ case CF_BITMAP:
+ d << "CF_BITMAP";
+ break;
+ case CF_TIFF:
+ d << "CF_TIFF";
+ break;
+ case CF_OEMTEXT:
+ d << "CF_OEMTEXT";
+ break;
+ case CF_DIB:
+ d << "CF_DIB";
+ break;
+ case CF_DIBV5:
+ d << "CF_DIBV5";
+ break;
+ case CF_UNICODETEXT:
+ d << "CF_UNICODETEXT";
+ break;
+#ifndef Q_OS_WINCE
+ case CF_ENHMETAFILE:
+ d << "CF_ENHMETAFILE";
+ break;
+#endif // !Q_OS_WINCE
+ default:
+ d << QWindowsMimeConverter::clipboardFormatName(tc.cfFormat);
+ break;
+ }
+ d << ", dwAspect=" << tc.dwAspect << ", lindex=" << tc.lindex
+ << ", tymed=" << tc.tymed << ", ptd=" << tc.ptd << ')';
+ return d;
+}
+
+QDebug operator<<(QDebug d, IDataObject *dataObj)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d.noquote();
+ d << "IDataObject(";
+ if (dataObj) { // Output formats contained in IDataObject.
+ IEnumFORMATETC *enumFormatEtc;
+ if (SUCCEEDED(dataObj->EnumFormatEtc(DATADIR_GET, &enumFormatEtc)) && enumFormatEtc) {
+ FORMATETC formatEtc[1];
+ ULONG fetched;
+ if (SUCCEEDED(enumFormatEtc->Reset())) {
+ while (SUCCEEDED(enumFormatEtc->Next(1, formatEtc, &fetched)) && fetched)
+ d << formatEtc[0] << ',';
+ enumFormatEtc->Release();
+ }
+ }
+ } else {
+ d << '0';
+ }
+ d << ')';
+ return d;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
/*!
\class QWindowsMime
\brief The QWindowsMime class maps open-standard MIME to Window Clipboard formats.
@@ -832,14 +897,14 @@ public:
QWindowsMimeHtml();
// for converting from Qt
- bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const;
- bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const;
- QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const;
+ bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
+ bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const Q_DECL_OVERRIDE;
+ QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
// for converting to Qt
- bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const;
- QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const;
- QString mimeForFormat(const FORMATETC &formatetc) const;
+ bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const Q_DECL_OVERRIDE;
+ QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const Q_DECL_OVERRIDE;
+ QString mimeForFormat(const FORMATETC &formatetc) const Q_DECL_OVERRIDE;
private:
int CF_HTML;
@@ -894,11 +959,7 @@ QVariant QWindowsMimeHtml::convertToMime(const QString &mime, IDataObject *pData
QVariant result;
if (canConvertToMime(mime, pDataObj)) {
QByteArray html = getData(CF_HTML, pDataObj);
-#ifdef QMIME_DEBUG
- qDebug("QWindowsMimeHtml::convertToMime");
- qDebug("raw :");
- qDebug(html);
-#endif
+ qCDebug(lcQpaMime) << __FUNCTION__ << "raw:" << html;
int start = html.indexOf("StartHTML:");
int end = html.indexOf("EndHTML:");
@@ -968,14 +1029,14 @@ class QWindowsMimeImage : public QWindowsMime
public:
QWindowsMimeImage();
// for converting from Qt
- bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const;
- bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const;
- QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const;
+ bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
+ bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const Q_DECL_OVERRIDE;
+ QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
// for converting to Qt
- bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const;
- QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const;
- QString mimeForFormat(const FORMATETC &formatetc) const;
+ bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const Q_DECL_OVERRIDE;
+ QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const Q_DECL_OVERRIDE;
+ QString mimeForFormat(const FORMATETC &formatetc) const Q_DECL_OVERRIDE;
private:
bool hasOriginalDIBV5(IDataObject *pDataObj) const;
UINT CF_PNG;
@@ -996,6 +1057,8 @@ QVector<FORMATETC> QWindowsMimeImage::formatsForMime(const QString &mimeType, co
formatetcs += setCf(CF_DIBV5);
formatetcs += setCf(CF_DIB);
}
+ if (!formatetcs.isEmpty())
+ qCDebug(lcQpaMime) << __FUNCTION__ << mimeType << formatetcs;
return formatetcs;
}
@@ -1120,14 +1183,14 @@ public:
QBuiltInMimes();
// for converting from Qt
- bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const;
- bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const;
- QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const;
+ bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
+ bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const Q_DECL_OVERRIDE;
+ QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
// for converting to Qt
- bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const;
- QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const;
- QString mimeForFormat(const FORMATETC &formatetc) const;
+ bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const Q_DECL_OVERRIDE;
+ QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const Q_DECL_OVERRIDE;
+ QString mimeForFormat(const FORMATETC &formatetc) const Q_DECL_OVERRIDE;
private:
QMap<int, QString> outFormats;
@@ -1216,9 +1279,7 @@ QVariant QBuiltInMimes::convertToMime(const QString &mimeType, IDataObject *pDat
if (canConvertToMime(mimeType, pDataObj)) {
QByteArray data = getData(inFormats.key(mimeType), pDataObj);
if (!data.isEmpty()) {
-#ifdef QMIME_DEBUG
- qDebug("QBuiltInMimes::convertToMime()");
-#endif
+ qCDebug(lcQpaMime) << __FUNCTION__;
if (mimeType == QLatin1String("text/html") && preferredType == QVariant::String) {
// text/html is in wide chars on windows (compatible with Mozilla)
val = QString::fromWCharArray((const wchar_t *)data.data());
@@ -1242,14 +1303,14 @@ public:
QLastResortMimes();
// for converting from Qt
- bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const;
- bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const;
- QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const;
+ bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
+ bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const Q_DECL_OVERRIDE;
+ QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const Q_DECL_OVERRIDE;
// for converting to Qt
- bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const;
- QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const;
- QString mimeForFormat(const FORMATETC &formatetc) const;
+ bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const Q_DECL_OVERRIDE;
+ QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QVariant::Type preferredType) const Q_DECL_OVERRIDE;
+ QString mimeForFormat(const FORMATETC &formatetc) const Q_DECL_OVERRIDE;
private:
QMap<int, QString> formats;
@@ -1326,6 +1387,8 @@ QVector<FORMATETC> QLastResortMimes::formatsForMime(const QString &mimeType, con
that->formats.insert(cf, mimeType);
formatetcs += setCf(cf);
}
+ if (!formatetcs.isEmpty())
+ qCDebug(lcQpaMime) << __FUNCTION__ << mimeType << formatetcs;
return formatetcs;
}
static const char x_qt_windows_mime[] = "application/x-qt-windows-mime;value=\"";
@@ -1400,11 +1463,8 @@ QString QLastResortMimes::mimeForFormat(const FORMATETC &formatetc) const
if (!format.isEmpty())
return format;
- wchar_t buffer[256];
- int len = GetClipboardFormatName(getCf(formatetc), buffer, 256);
-
- if (len) {
- QString clipFormat = QString::fromWCharArray(buffer, len);
+ const QString clipFormat = QWindowsMimeConverter::clipboardFormatName(getCf(formatetc));
+ if (!clipFormat.isEmpty()) {
#ifndef QT_NO_DRAGANDDROP
if (QInternalMimeData::canReadData(clipFormat))
format = clipFormat;
@@ -1470,15 +1530,12 @@ QStringList QWindowsMimeConverter::allMimesForFormats(IDataObject *pDataObj) con
if (hr == NOERROR) {
FORMATETC fmtetc;
while (S_OK == fmtenum->Next(1, &fmtetc, 0)) {
-#if defined(QMIME_DEBUG)
- wchar_t buf[256] = {0};
- GetClipboardFormatName(fmtetc.cfFormat, buf, 255);
- qDebug("CF = %d : %s", fmtetc.cfFormat, qPrintable(QString::fromWCharArray(buf)));
-#endif
for (int i= m_mimes.size() - 1; i >= 0; --i) {
QString format = m_mimes.at(i)->mimeForFormat(fmtetc);
if (!format.isEmpty() && !formats.contains(format)) {
formats += format;
+ if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled())
+ qCDebug(lcQpaMime) << __FUNCTION__ << fmtetc << format;
}
}
// as documented in MSDN to avoid possible memleak
@@ -1494,6 +1551,7 @@ QStringList QWindowsMimeConverter::allMimesForFormats(IDataObject *pDataObj) con
QWindowsMime * QWindowsMimeConverter::converterFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const
{
ensureInitialized();
+ qCDebug(lcQpaMime) << __FUNCTION__ << formatetc;
for (int i = m_mimes.size()-1; i >= 0; --i) {
if (m_mimes.at(i)->canConvertFromMime(formatetc, mimeData))
return m_mimes.at(i);
@@ -1521,13 +1579,24 @@ QVector<FORMATETC> QWindowsMimeConverter::allFormatsForMime(const QMimeData *mim
void QWindowsMimeConverter::ensureInitialized() const
{
if (m_mimes.isEmpty()) {
- m_mimes << new QWindowsMimeImage << new QLastResortMimes
+ m_mimes
+#ifndef QT_NO_IMAGEFORMAT_BMP
+ << new QWindowsMimeImage
+#endif //QT_NO_IMAGEFORMAT_BMP
+ << new QLastResortMimes
<< new QWindowsMimeText << new QWindowsMimeURI
<< new QWindowsMimeHtml << new QBuiltInMimes;
m_internalMimeCount = m_mimes.size();
}
}
+QString QWindowsMimeConverter::clipboardFormatName(int cf)
+{
+ wchar_t buf[256] = {0};
+ return GetClipboardFormatName(cf, buf, 255)
+ ? QString::fromWCharArray(buf) : QString();
+}
+
QVariant QWindowsMimeConverter::convertToMime(const QStringList &mimeTypes,
IDataObject *pDataObj,
QVariant::Type preferredType,
diff --git a/src/plugins/platforms/windows/qwindowsmime.h b/src/plugins/platforms/windows/qwindowsmime.h
index 952410e14b..1ec0dccdf8 100644
--- a/src/plugins/platforms/windows/qwindowsmime.h
+++ b/src/plugins/platforms/windows/qwindowsmime.h
@@ -42,6 +42,7 @@
QT_BEGIN_NAMESPACE
+class QDebug;
class QMimeData;
class QWindowsMime
@@ -83,6 +84,8 @@ public:
void registerMime(QWindowsMime *mime);
void unregisterMime(QWindowsMime *mime) { m_mimes.removeOne(mime); }
+ static QString clipboardFormatName(int cf);
+
private:
void ensureInitialized() const;
@@ -90,6 +93,11 @@ private:
mutable int m_internalMimeCount;
};
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug, const FORMATETC &);
+QDebug operator<<(QDebug d, IDataObject *);
+#endif
+
QT_END_NAMESPACE
#endif // QWINDOWSMIME_H
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index e83354157b..e26010b5c4 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -218,10 +218,8 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
const QPoint globalPosition = winEventPosition;
const QPoint clientPosition = QWindowsGeometryHint::mapFromGlobal(hwnd, globalPosition);
const Qt::MouseButtons buttons = QWindowsMouseHandler::queryMouseButtons();
- QWindowSystemInterface::handleFrameStrutMouseEvent(window,
- clientPosition / QWindowsScaling::factor(),
- globalPosition / QWindowsScaling::factor(),
- buttons,
+ QWindowSystemInterface::handleFrameStrutMouseEvent(window, clientPosition,
+ globalPosition, buttons,
QWindowsKeyMapper::queryKeyboardModifiers(),
source);
return false; // Allow further event processing (dragging of windows).
@@ -286,7 +284,7 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
// ChildWindowFromPointEx() may not find the Qt window (failing with ERROR_ACCESS_DENIED)
if (!currentWindowUnderMouse) {
const QRect clientRect(QPoint(0, 0), window->size());
- if (clientRect.contains(winEventPosition / QWindowsScaling::factor()))
+ if (clientRect.contains(winEventPosition))
currentWindowUnderMouse = window;
}
@@ -373,14 +371,14 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
m_windowUnderMouse = currentWindowUnderMouse;
}
- QWindowSystemInterface::handleMouseEvent(window,
- winEventPosition / QWindowsScaling::factor(),
- globalPosition / QWindowsScaling::factor(),
- buttons,
+ QWindowSystemInterface::handleMouseEvent(window, winEventPosition, globalPosition, buttons,
QWindowsKeyMapper::queryKeyboardModifiers(),
source);
m_previousCaptureWindow = hasCapture ? window : 0;
- return true;
+ // QTBUG-48117, force synchronous handling for the extra buttons so that WM_APPCOMMAND
+ // is sent for unhandled WM_XBUTTONDOWN.
+ return (msg.message != WM_XBUTTONUP && msg.message != WM_XBUTTONDOWN && msg.message != WM_XBUTTONDBLCLK)
+ || QWindowSystemInterface::flushWindowSystemEvents();
}
static bool isValidWheelReceiver(QWindow *candidate)
@@ -411,11 +409,9 @@ static void redirectWheelEvent(QWindow *window, const QPoint &globalPos, int del
}
if (handleEvent) {
- const QPoint posDip = QWindowsGeometryHint::mapFromGlobal(receiver, globalPos) / QWindowsScaling::factor();
QWindowSystemInterface::handleWheelEvent(receiver,
- posDip, globalPos / QWindowsScaling::factor(),
- delta / QWindowsScaling::factor(),
- orientation, mods);
+ QWindowsGeometryHint::mapFromGlobal(receiver, globalPos),
+ globalPos, delta, orientation, mods);
}
}
@@ -492,7 +488,12 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
return true;
}
- const QRect screenGeometry = window->screen()->geometry();
+ const QScreen *screen = window->screen();
+ if (!screen)
+ screen = QGuiApplication::primaryScreen();
+ if (!screen)
+ return true;
+ const QRect screenGeometry = screen->geometry();
const int winTouchPointCount = msg.wParam;
QScopedArrayPointer<TOUCHINPUT> winTouchInputs(new TOUCHINPUT[winTouchPointCount]);
@@ -503,7 +504,6 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
Qt::TouchPointStates allStates = 0;
QWindowsContext::user32dll.getTouchInputInfo((HANDLE) msg.lParam, msg.wParam, winTouchInputs.data(), sizeof(TOUCHINPUT));
- const qreal screenPosFactor = 0.01 / qreal(QWindowsScaling::factor());
for (int i = 0; i < winTouchPointCount; ++i) {
const TOUCHINPUT &winTouchInput = winTouchInputs[i];
int id = m_touchInputIDToTouchPointID.value(winTouchInput.dwID, -1);
@@ -517,9 +517,9 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
if (m_lastTouchPositions.contains(id))
touchPoint.normalPosition = m_lastTouchPositions.value(id);
- const QPointF screenPos = QPointF(winTouchInput.x, winTouchInput.y) * screenPosFactor;
+ const QPointF screenPos = QPointF(winTouchInput.x, winTouchInput.y) / qreal(100.);
if (winTouchInput.dwMask & TOUCHINPUTMASKF_CONTACTAREA)
- touchPoint.area.setSize(QSizeF(winTouchInput.cxContact, winTouchInput.cyContact) * screenPosFactor);
+ touchPoint.area.setSize(QSizeF(winTouchInput.cxContact, winTouchInput.cyContact) / qreal(100.));
touchPoint.area.moveCenter(screenPos);
QPointF normalPosition = QPointF(screenPos.x() / screenGeometry.width(),
screenPos.y() / screenGeometry.height());
@@ -583,7 +583,12 @@ bool QWindowsMouseHandler::translateGestureEvent(QWindow *window, HWND hwnd,
if (gi.dwID != GID_DIRECTMANIPULATION)
return true;
static QPoint lastTouchPos;
- const QRect screenGeometry = window->screen()->geometry();
+ const QScreen *screen = window->screen();
+ if (!screen)
+ screen = QGuiApplication::primaryScreen();
+ if (!screen)
+ return true;
+ const QRect screenGeometry = screen->geometry();
QWindowSystemInterface::TouchPoint touchPoint;
static QWindowSystemInterface::TouchPoint touchPoint2;
touchPoint.id = 0;//gi.dwInstanceID;
diff --git a/src/plugins/platforms/windows/qwindowsnativeimage.h b/src/plugins/platforms/windows/qwindowsnativeimage.h
index 6f9ce93ef0..80a1de1ea5 100644
--- a/src/plugins/platforms/windows/qwindowsnativeimage.h
+++ b/src/plugins/platforms/windows/qwindowsnativeimage.h
@@ -57,8 +57,6 @@ public:
HDC hdc() const { return m_hdc; }
- void setDevicePixelRatio(qreal scaleFactor) { m_image.setDevicePixelRatio(scaleFactor); }
-
static QImage::Format systemFormat();
private:
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
index db8b2ec094..659ef79c18 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
@@ -234,6 +234,8 @@ QFunctionPointer QWindowsNativeInterface::platformFunction(const QByteArray &fun
{
if (function == QWindowsWindowFunctions::setTouchWindowTouchTypeIdentifier())
return QFunctionPointer(QWindowsWindow::setTouchWindowTouchTypeStatic);
+ else if (function == QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier())
+ return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenStatic);
return Q_NULLPTR;
}
diff --git a/src/plugins/platforms/windows/qwindowsole.cpp b/src/plugins/platforms/windows/qwindowsole.cpp
index 6f5a521af8..e480c1ebcf 100644
--- a/src/plugins/platforms/windows/qwindowsole.cpp
+++ b/src/plugins/platforms/windows/qwindowsole.cpp
@@ -132,12 +132,6 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)
{
HRESULT hr = ResultFromScode(DATA_E_FORMATETC);
- if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled()) {
- wchar_t buf[256] = {0};
- GetClipboardFormatName(pformatetc->cfFormat, buf, 255);
- qCDebug(lcQpaMime) <<__FUNCTION__ << "CF = " << pformatetc->cfFormat << QString::fromWCharArray(buf);
- }
-
if (data) {
const QWindowsMimeConverter &mc = QWindowsContext::instance()->mimeConverter();
if (QWindowsMime *converter = mc.converterFromMime(*pformatetc, data))
@@ -145,11 +139,8 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)
hr = ResultFromScode(S_OK);
}
- if (QWindowsContext::verbose > 1) {
- wchar_t buf[256] = {0};
- GetClipboardFormatName(pformatetc->cfFormat, buf, 255);
- qCDebug(lcQpaMime) <<__FUNCTION__ << "CF = " << pformatetc->cfFormat << " returns 0x" << int(hr) << dec;
- }
+ if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled())
+ qCDebug(lcQpaMime) <<__FUNCTION__ << *pformatetc << "returns" << hex << showbase << quint64(hr);
return hr;
}
@@ -211,7 +202,7 @@ STDMETHODIMP
QWindowsOleDataObject::EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC FAR* ppenumFormatEtc)
{
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaMime) << __FUNCTION__;
+ qCDebug(lcQpaMime) << __FUNCTION__ << "dwDirection=" << dwDirection;
if (!data)
return ResultFromScode(DATA_E_FORMATETC);
@@ -274,7 +265,7 @@ QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs)
m_dwRefs(1), m_nIndex(0), m_isNull(false)
{
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaMime) << __FUNCTION__;
+ qCDebug(lcQpaMime) << __FUNCTION__ << fmtetcs;
m_lpfmtetcs.reserve(fmtetcs.count());
for (int idx = 0; idx < fmtetcs.count(); ++idx) {
LPFORMATETC destetc = new FORMATETC();
diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp
index 9ebd946ce4..fcbe488f93 100644
--- a/src/plugins/platforms/windows/qwindowsopengltester.cpp
+++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp
@@ -98,6 +98,7 @@ GpuDescription GpuDescription::detect()
#endif
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const GpuDescription &gd)
{
QDebugStateSaver s(d);
@@ -109,6 +110,7 @@ QDebug operator<<(QDebug d, const GpuDescription &gd)
<< ", version=" << gd.driverVersion << ", " << gd.description << ')';
return d;
}
+#endif // !QT_NO_DEBUG_STREAM
// Return printable string formatted like the output of the dxdiag tool.
QString GpuDescription::toString() const
@@ -224,7 +226,7 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c
#elif defined(Q_OS_WINCE)
return QWindowsOpenGLTester::Gles;
#else
- QOpenGLConfig::Gpu qgpu = QOpenGLConfig::Gpu::fromDevice(gpu.vendorId, gpu.deviceId, gpu.driverVersion);
+ QOpenGLConfig::Gpu qgpu = QOpenGLConfig::Gpu::fromDevice(gpu.vendorId, gpu.deviceId, gpu.driverVersion, gpu.description);
SupportedRenderersCache *srCache = supportedRenderersCache();
SupportedRenderersCache::const_iterator it = srCache->find(qgpu);
if (it != srCache->cend())
@@ -250,23 +252,26 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c
qCDebug(lcQpaGl) << "GPU features:" << features;
if (features.contains(QStringLiteral("disable_desktopgl"))) { // Qt-specific
- qCWarning(lcQpaGl) << "Disabling Desktop GL: " << gpu;
+ qCDebug(lcQpaGl) << "Disabling Desktop GL: " << gpu;
result &= ~QWindowsOpenGLTester::DesktopGl;
}
if (features.contains(QStringLiteral("disable_angle"))) { // Qt-specific keyword
- qCWarning(lcQpaGl) << "Disabling ANGLE: " << gpu;
+ qCDebug(lcQpaGl) << "Disabling ANGLE: " << gpu;
result &= ~QWindowsOpenGLTester::GlesMask;
} else {
if (features.contains(QStringLiteral("disable_d3d11"))) { // standard keyword
- qCWarning(lcQpaGl) << "Disabling D3D11: " << gpu;
+ qCDebug(lcQpaGl) << "Disabling D3D11: " << gpu;
result &= ~QWindowsOpenGLTester::AngleRendererD3d11;
}
if (features.contains(QStringLiteral("disable_d3d9"))) { // Qt-specific
- qCWarning(lcQpaGl) << "Disabling D3D9: " << gpu;
+ qCDebug(lcQpaGl) << "Disabling D3D9: " << gpu;
result &= ~QWindowsOpenGLTester::AngleRendererD3d9;
}
}
-
+ if (features.contains(QStringLiteral("disable_rotation"))) {
+ qCDebug(lcQpaGl) << "Disabling rotation: " << gpu;
+ result |= DisableRotationFlag;
+ }
srCache->insert(qgpu, result);
return result;
#endif // !Q_OS_WINCE && !QT_NO_OPENGL
diff --git a/src/plugins/platforms/windows/qwindowsopengltester.h b/src/plugins/platforms/windows/qwindowsopengltester.h
index 748885542d..0fad3d960e 100644
--- a/src/plugins/platforms/windows/qwindowsopengltester.h
+++ b/src/plugins/platforms/windows/qwindowsopengltester.h
@@ -36,7 +36,7 @@
#include <QtCore/QByteArray>
#include <QtCore/QFlags>
-#include <private/qversionnumber_p.h>
+#include <QtCore/qversionnumber.h>
QT_BEGIN_NAMESPACE
@@ -60,7 +60,9 @@ struct GpuDescription
QByteArray description;
};
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const GpuDescription &gd);
+#endif
class QWindowsOpenGLTester
{
@@ -74,7 +76,9 @@ public:
AngleBackendMask = AngleRendererD3d11 | AngleRendererD3d9 | AngleRendererD3d11Warp,
Gles = 0x0010, // ANGLE/unspecified or Generic GLES for Windows CE.
GlesMask = Gles | AngleBackendMask,
- SoftwareRasterizer = 0x0020
+ SoftwareRasterizer = 0x0020,
+ RendererMask = 0x00FF,
+ DisableRotationFlag = 0x0100
};
Q_DECLARE_FLAGS(Renderers, Renderer)
diff --git a/src/plugins/platforms/windows/qwindowsscaling.cpp b/src/plugins/platforms/windows/qwindowsscaling.cpp
deleted file mode 100644
index 6ab7f254fd..0000000000
--- a/src/plugins/platforms/windows/qwindowsscaling.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 "qwindowsscaling.h"
-#include "qwindowsscreen.h"
-
-#include <QtCore/QDebug>
-#include <QtCore/QCoreApplication>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QWindowsScaling
- \brief Windows scaling utilities
-
- \internal
- \ingroup qt-lighthouse-win
-*/
-
-int QWindowsScaling::m_factor = 1;
-
-static const char devicePixelRatioEnvVar[] = "QT_DEVICE_PIXEL_RATIO";
-
-// Suggest a scale factor by checking monitor sizes.
-int QWindowsScaling::determineUiScaleFactor()
-{
- if (!qEnvironmentVariableIsSet(devicePixelRatioEnvVar))
- return 1;
- const QByteArray envDevicePixelRatioEnv = qgetenv(devicePixelRatioEnvVar);
- // Auto: Suggest a scale factor by checking monitor resolution.
- if (envDevicePixelRatioEnv == "auto") {
- const int maxResolution = QWindowsScreen::maxMonitorHorizResolution();
- return maxResolution > 180 ? maxResolution / 96 : 1;
- }
- // Get factor from environment
- bool ok = false;
- const int envFactor = envDevicePixelRatioEnv.toInt(&ok);
- return ok && envFactor > 0 ? envFactor : 1;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsscaling.h b/src/plugins/platforms/windows/qwindowsscaling.h
deleted file mode 100644
index 39e554bbe2..0000000000
--- a/src/plugins/platforms/windows/qwindowsscaling.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 QWINDOWSSCALING_H
-#define QWINDOWSSCALING_H
-
-#include <QtGui/QRegion>
-#include <QtCore/QVector>
-#include <QtCore/QRect>
-
-QT_BEGIN_NAMESPACE
-
-enum
-#if defined(Q_COMPILER_CLASS_ENUM) || defined(Q_CC_MSVC)
- : int
-#endif
-{ QWINDOWSIZE_MAX = 16777215 };
-
-class QWindowsScaling {
-public:
- static bool isActive() { return m_factor > 1; }
- static int factor() { return m_factor; }
- static void setFactor(int factor) { m_factor = factor; }
- static int determineUiScaleFactor();
-
- // Scaling helpers for size constraints.
- static int mapToNativeConstrained(int qt)
- { return m_factor != 1 && qt > 0 && qt < QWINDOWSIZE_MAX ? qt * m_factor : qt; }
-
- static int mapFromNativeConstrained(int dp)
- { return m_factor != 1 && dp > 0 && dp < QWINDOWSIZE_MAX ? dp / m_factor : dp; }
-
- static QSize mapToNativeConstrained(const QSize &qt)
- { return QSize(mapToNativeConstrained(qt.width()), mapToNativeConstrained(qt.height())); }
-
- static QRect mapToNative(const QRect &qRect)
- {
- return QRect(qRect.x() * m_factor, qRect.y() * m_factor, qRect.width() * m_factor, qRect.height() * m_factor);
- }
-
- static QRect mapFromNative(const QRect &dp)
- {
- return isActive() ?
- QRect(dp.x() / m_factor, dp.y() / m_factor, (dp.width() + 1) / m_factor, (dp.height() + 1) / m_factor) :
- dp;
- }
-
- static QRegion mapToNative(const QRegion &regionQt)
- {
- if (!QWindowsScaling::isActive() || regionQt.isEmpty())
- return regionQt;
-
- QRegion result;
- foreach (const QRect &rectQt, regionQt.rects())
- result += QWindowsScaling::mapToNative(rectQt);
- return result;
- }
-
- static QRegion mapFromNative(const QRegion &regionDp)
- {
- if (!QWindowsScaling::isActive() || regionDp.isEmpty())
- return regionDp;
-
- QRegion result;
- foreach (const QRect &rectDp, regionDp.rects())
- result += QWindowsScaling::mapFromNative(rectDp);
- return result;
- }
-
-private:
- static int m_factor;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWINDOWSSCALING_H
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 7756c77001..02696c87cd 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -43,6 +43,7 @@
#include <QtGui/QPixmap>
#include <QtGui/QGuiApplication>
#include <qpa/qwindowsysteminterface.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtGui/QScreen>
#include <QtCore/QDebug>
@@ -171,6 +172,7 @@ static inline WindowsScreenDataList monitorData()
return result;
}
+#ifndef QT_NO_DEBUG_STREAM
static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d)
{
QDebugStateSaver saver(dbg);
@@ -191,16 +193,7 @@ static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d)
dbg << " lock screen";
return dbg;
}
-
-// Return the cursor to be shared by all screens (virtual desktop).
-static inline QSharedPointer<QPlatformCursor> sharedCursor()
-{
-#ifndef QT_NO_CURSOR
- if (const QScreen *primaryScreen = QGuiApplication::primaryScreen())
- return static_cast<const QWindowsScreen *>(primaryScreen->handle())->cursorPtr();
-#endif
- return QSharedPointer<QPlatformCursor>(new QWindowsCursor);
-}
+#endif // !QT_NO_DEBUG_STREAM
/*!
\class QWindowsScreen
@@ -213,41 +206,19 @@ static inline QSharedPointer<QPlatformCursor> sharedCursor()
QWindowsScreen::QWindowsScreen(const QWindowsScreenData &data) :
m_data(data)
#ifndef QT_NO_CURSOR
- ,m_cursor(sharedCursor())
+ , m_cursor(new QWindowsCursor(this))
#endif
{
}
-BOOL QT_WIN_CALLBACK monitorResolutionEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM p)
-{
- QWindowsScreenData data;
- if (monitorData(hMonitor, &data)) {
- int *maxHorizResolution = reinterpret_cast<int *>(p);
- const int horizResolution = qRound(data.dpi.first);
- if (horizResolution > *maxHorizResolution)
- *maxHorizResolution = horizResolution;
- }
- return TRUE;
-}
-
-int QWindowsScreen::maxMonitorHorizResolution()
-{
- int result = 0;
- EnumDisplayMonitors(0, 0, monitorResolutionEnumCallback, (LPARAM)&result);
- return result;
-}
-
Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
-QPixmap QWindowsScreen::grabWindow(WId window, int qX, int qY, int qWidth, int qHeight) const
+QPixmap QWindowsScreen::grabWindow(WId window, int x, int y, int width, int height) const
{
RECT r;
HWND hwnd = window ? (HWND)window : GetDesktopWindow();
GetClientRect(hwnd, &r);
- const int x = qX * QWindowsScaling::factor();
- const int y = qY * QWindowsScaling::factor();
- int width = qWidth * QWindowsScaling::factor();
- int height = qHeight * QWindowsScaling::factor();
+
if (width < 0) width = r.right - r.left;
if (height < 0) height = r.bottom - r.top;
@@ -271,10 +242,6 @@ QPixmap QWindowsScreen::grabWindow(WId window, int qX, int qY, int qWidth, int q
DeleteObject(bitmap);
ReleaseDC(0, display_dc);
- if (QWindowsScaling::isActive()) {
- const qreal factor = 1.0 / qreal(QWindowsScaling::factor());
- return pixmap.transformed(QTransform::fromScale(factor, factor));
- }
return pixmap;
}
@@ -285,7 +252,7 @@ QPixmap QWindowsScreen::grabWindow(WId window, int qX, int qY, int qWidth, int q
QWindow *QWindowsScreen::topLevelAt(const QPoint &point) const
{
QWindow *result = 0;
- if (QWindow *child = QWindowsScreen::windowAt(point * QWindowsScaling::factor(), CWP_SKIPINVISIBLE))
+ if (QWindow *child = QWindowsScreen::windowAt(point, CWP_SKIPINVISIBLE))
result = QWindowsWindow::topLevelOf(child);
qCDebug(lcQpaWindows) <<__FUNCTION__ << point << result;
return result;
@@ -301,16 +268,13 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags)
return result;
}
-QWindowsScreen *QWindowsScreen::screenOf(const QWindow *w)
+qreal QWindowsScreen::pixelDensity() const
{
- if (w)
- if (const QScreen *s = w->screen())
- if (QPlatformScreen *pscr = s->handle())
- return static_cast<QWindowsScreen *>(pscr);
- if (const QScreen *ps = QGuiApplication::primaryScreen())
- if (QPlatformScreen *ppscr = ps->handle())
- return static_cast<QWindowsScreen *>(ppscr);
- return 0;
+ // QTBUG-49195: Use logical DPI instead of physical DPI to calculate
+ // the pixel density since it is reflects the Windows UI scaling.
+ // High DPI auto scaling should be disabled when the user chooses
+ // small fonts on a High DPI monitor, resulting in lower logical DPI.
+ return qRound(logicalDpi().first / 96);
}
/*!
@@ -361,6 +325,74 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)
}
}
+enum OrientationPreference // matching Win32 API ORIENTATION_PREFERENCE
+#if defined(Q_COMPILER_CLASS_ENUM) || defined(Q_CC_MSVC)
+ : DWORD
+#endif
+{
+ orientationPreferenceNone = 0,
+ orientationPreferenceLandscape = 0x1,
+ orientationPreferencePortrait = 0x2,
+ orientationPreferenceLandscapeFlipped = 0x4,
+ orientationPreferencePortraitFlipped = 0x8
+};
+
+bool QWindowsScreen::setOrientationPreference(Qt::ScreenOrientation o)
+{
+ bool result = false;
+#ifndef Q_OS_WINCE
+ if (QWindowsContext::user32dll.setDisplayAutoRotationPreferences) {
+ DWORD orientationPreference = 0;
+ switch (o) {
+ case Qt::PrimaryOrientation:
+ orientationPreference = orientationPreferenceNone;
+ break;
+ case Qt::PortraitOrientation:
+ orientationPreference = orientationPreferencePortrait;
+ break;
+ case Qt::LandscapeOrientation:
+ orientationPreference = orientationPreferenceLandscape;
+ break;
+ case Qt::InvertedPortraitOrientation:
+ orientationPreference = orientationPreferencePortraitFlipped;
+ break;
+ case Qt::InvertedLandscapeOrientation:
+ orientationPreference = orientationPreferenceLandscapeFlipped;
+ break;
+ }
+ result = QWindowsContext::user32dll.setDisplayAutoRotationPreferences(orientationPreference);
+ }
+#endif // !Q_OS_WINCE
+ return result;
+}
+
+Qt::ScreenOrientation QWindowsScreen::orientationPreference()
+{
+ Qt::ScreenOrientation result = Qt::PrimaryOrientation;
+#ifndef Q_OS_WINCE
+ if (QWindowsContext::user32dll.getDisplayAutoRotationPreferences) {
+ DWORD orientationPreference = 0;
+ if (QWindowsContext::user32dll.getDisplayAutoRotationPreferences(&orientationPreference)) {
+ switch (orientationPreference) {
+ case orientationPreferenceLandscape:
+ result = Qt::LandscapeOrientation;
+ break;
+ case orientationPreferencePortrait:
+ result = Qt::PortraitOrientation;
+ break;
+ case orientationPreferenceLandscapeFlipped:
+ result = Qt::InvertedLandscapeOrientation;
+ break;
+ case orientationPreferencePortraitFlipped:
+ result = Qt::InvertedPortraitOrientation;
+ break;
+ }
+ }
+ }
+#endif // !Q_OS_WINCE
+ return result;
+}
+
/*!
\brief Queries ClearType settings to check the pixel layout
*/
@@ -542,7 +574,7 @@ void QWindowsScreenManager::clearScreens()
const QWindowsScreen *QWindowsScreenManager::screenAtDp(const QPoint &p) const
{
foreach (QWindowsScreen *scr, m_screens) {
- if (scr->geometryDp().contains(p))
+ if (scr->geometry().contains(p))
return scr;
}
return Q_NULLPTR;
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h
index 7352c45777..b46bd88ec6 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.h
+++ b/src/plugins/platforms/windows/qwindowsscreen.h
@@ -34,7 +34,6 @@
#ifndef QWINDOWSSCREEN_H
#define QWINDOWSSCREEN_H
-#include "qwindowsscaling.h"
#include "qtwindowsglobal.h"
#ifdef Q_OS_WINCE
# include "qplatformfunctions_wince.h"
@@ -43,7 +42,7 @@
#include <QtCore/QList>
#include <QtCore/QVector>
#include <QtCore/QPair>
-#include <QtCore/QSharedPointer>
+#include <QtCore/QScopedPointer>
#include <qpa/qplatformscreen.h>
QT_BEGIN_NAMESPACE
@@ -75,23 +74,19 @@ class QWindowsScreen : public QPlatformScreen
{
public:
#ifndef QT_NO_CURSOR
- typedef QSharedPointer<QPlatformCursor> CursorPtr;
+ typedef QScopedPointer<QPlatformCursor> CursorPtr;
#endif
explicit QWindowsScreen(const QWindowsScreenData &data);
- static QWindowsScreen *screenOf(const QWindow *w = 0);
-
- QRect geometryDp() const { return m_data.geometry; }
- QRect geometry() const Q_DECL_OVERRIDE { return QWindowsScaling::mapFromNative(geometryDp()); }
- QRect availableGeometryDp() const { return m_data.availableGeometry; }
- QRect availableGeometry() const Q_DECL_OVERRIDE { return QWindowsScaling::mapFromNative(availableGeometryDp()); }
+ QRect geometry() const Q_DECL_OVERRIDE { return m_data.geometry; }
+ QRect availableGeometry() const Q_DECL_OVERRIDE { return m_data.availableGeometry; }
int depth() const Q_DECL_OVERRIDE { return m_data.depth; }
QImage::Format format() const Q_DECL_OVERRIDE { return m_data.format; }
QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_data.physicalSizeMM; }
- QDpi logicalDpi() const Q_DECL_OVERRIDE
- { return QDpi(m_data.dpi.first / QWindowsScaling::factor(), m_data.dpi.second / QWindowsScaling::factor()); }
- qreal devicePixelRatio() const Q_DECL_OVERRIDE { return QWindowsScaling::factor(); }
+ QDpi logicalDpi() const Q_DECL_OVERRIDE { return m_data.dpi; }
+ qreal pixelDensity() const Q_DECL_OVERRIDE;
+ qreal devicePixelRatio() const Q_DECL_OVERRIDE { return 1.0; }
qreal refreshRate() const Q_DECL_OVERRIDE { return m_data.refreshRateHz; }
QString name() const Q_DECL_OVERRIDE { return m_data.name; }
Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_data.orientation; }
@@ -102,6 +97,9 @@ public:
QPixmap grabWindow(WId window, int qX, int qY, int qWidth, int qHeight) const Q_DECL_OVERRIDE;
QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const Q_DECL_OVERRIDE;
+ static Qt::ScreenOrientation orientationPreference();
+ static bool setOrientationPreference(Qt::ScreenOrientation o);
+
inline void handleChanges(const QWindowsScreenData &newData);
#ifndef QT_NO_CURSOR
@@ -112,7 +110,6 @@ public:
#endif // !QT_NO_CURSOR
const QWindowsScreenData &data() const { return m_data; }
- static int maxMonitorHorizResolution();
private:
QWindowsScreenData m_data;
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 7b871be015..b27811df9e 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -32,7 +32,6 @@
****************************************************************************/
#include "qwindowstabletsupport.h"
-#include "qwindowsscaling.h"
#ifndef QT_NO_TABLETEVENT
@@ -55,7 +54,7 @@
#include <QtCore/private/qsystemlibrary_p.h>
// Note: The definition of the PACKET structure in pktdef.h depends on this define.
-#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION | PK_CURSOR | PK_Z)
+#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION | PK_CURSOR | PK_Z | PK_TIME)
#include <pktdef.h>
QT_BEGIN_NAMESPACE
@@ -303,8 +302,11 @@ static inline QTabletEvent::PointerType pointerType(unsigned currentCursor)
return QTabletEvent::UnknownPointer;
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t)
{
+ QDebugStateSaver saver(d);
+ d.nospace();
d << "TabletDevice id:" << t.uniqueId << " pressure: " << t.minPressure
<< ".." << t.maxPressure << " tan pressure: " << t.minTanPressure << ".."
<< t.maxTanPressure << " area:" << t.minX << t.minY <<t.minZ
@@ -312,6 +314,7 @@ QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t)
<< " pointer " << t.currentPointerType;
return d;
}
+#endif // !QT_NO_DEBUG_STREAM
QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(const quint64 uniqueId, const UINT cursorType) const
{
@@ -343,17 +346,18 @@ QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(const quint64 uniqueI
bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, LPARAM lParam)
{
+ PACKET proximityBuffer[1]; // we are only interested in the first packet in this case
+ const int totalPacks = QWindowsTabletSupport::m_winTab32DLL.wTPacketsGet(m_context, 1, proximityBuffer);
+ if (!totalPacks)
+ return false;
if (!LOWORD(lParam)) {
qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice;
- QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice,
+ QWindowSystemInterface::handleTabletLeaveProximityEvent(proximityBuffer[0].pkTime,
+ m_devices.at(m_currentDevice).currentDevice,
m_devices.at(m_currentDevice).currentPointerType,
m_devices.at(m_currentDevice).uniqueId);
return true;
}
- PACKET proximityBuffer[1]; // we are only interested in the first packet in this case
- const int totalPacks = QWindowsTabletSupport::m_winTab32DLL.wTPacketsGet(m_context, 1, proximityBuffer);
- if (!totalPacks)
- return false;
const UINT currentCursor = proximityBuffer[0].pkCursor;
UINT physicalCursorId;
QWindowsTabletSupport::m_winTab32DLL.wTInfo(WTI_CURSORS + currentCursor, CSR_PHYSID, &physicalCursorId);
@@ -371,7 +375,8 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor);
qCDebug(lcQpaTablet) << "enter proximity for device #"
<< m_currentDevice << m_devices.at(m_currentDevice);
- QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice,
+ QWindowSystemInterface::handleTabletEnterProximityEvent(proximityBuffer[0].pkTime,
+ m_devices.at(m_currentDevice).currentDevice,
m_devices.at(m_currentDevice).currentPointerType,
m_devices.at(m_currentDevice).uniqueId);
return true;
@@ -399,8 +404,7 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
// in which case we snap the position to the mouse position.
// It seems there is no way to find out the mode programmatically, the LOGCONTEXT orgX/Y/Ext
// area is always the virtual desktop.
- const QRect virtualDesktopArea
- = QWindowsScaling::mapToNative(QGuiApplication::primaryScreen()->virtualGeometry());
+ const QRect virtualDesktopArea = QGuiApplication::primaryScreen()->virtualGeometry();
qCDebug(lcQpaTablet) << __FUNCTION__ << "processing " << packetCount
<< "target:" << QGuiApplicationPrivate::tabletPressTarget;
@@ -420,7 +424,7 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
QPoint globalPos = globalPosF.toPoint();
// Get Mouse Position and compare to tablet info
- QPoint mouseLocation = QWindowsCursor::mousePosition();
+ const QPoint mouseLocation = QWindowsCursor::mousePosition();
// Positions should be almost the same if we are in absolute
// mode. If they are not, use the mouse location.
@@ -475,9 +479,7 @@ bool QWindowsTabletSupport::translateTabletPacketEvent()
<< tiltY << "tanP:" << tangentialPressure << "rotation:" << rotation;
}
- const QPointF localPosDip = QPointF(localPos / QWindowsScaling::factor());
- const QPointF globalPosDip = globalPosF / qreal(QWindowsScaling::factor());
- QWindowSystemInterface::handleTabletEvent(target, localPosDip, globalPosDip,
+ QWindowSystemInterface::handleTabletEvent(target, packet.pkTime, QPointF(localPos), globalPosF,
currentDevice, currentPointer,
static_cast<Qt::MouseButtons>(packet.pkButtons),
pressureNew, tiltX, tiltY,
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.h b/src/plugins/platforms/windows/qwindowstabletsupport.h
index 718ae98572..a6d2771206 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.h
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.h
@@ -97,7 +97,9 @@ struct QWindowsTabletDeviceData
int currentPointerType;
};
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t);
+#endif
class QWindowsTabletSupport
{
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index d3f67e9eaa..cc367ff801 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -43,7 +43,6 @@
#include "qwindowsintegration.h"
#include "qt_windows.h"
#include "qwindowsfontdatabase.h"
-#include "qwindowsscaling.h"
#ifdef Q_OS_WINCE
# include "qplatformfunctions_wince.h"
# include "winuser.h"
@@ -68,6 +67,7 @@
#include <QtGui/QPainter>
#include <QtGui/QPixmapCache>
#include <qpa/qwindowsysteminterface.h>
+#include <private/qhighdpiscaling_p.h>
#include <private/qsystemlibrary_p.h>
#include <algorithm>
@@ -131,7 +131,7 @@ static inline bool booleanSystemParametersInfo(UINT what, bool defaultValue)
return defaultValue;
}
-static inline bool dWordSystemParametersInfo(UINT what, DWORD defaultValue)
+static inline DWORD dWordSystemParametersInfo(UINT what, DWORD defaultValue)
{
DWORD result;
if (SystemParametersInfo(what, 0, &result, 0))
@@ -393,6 +393,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false));
case ContextMenuOnMouseRelease:
return QVariant(true);
+ case WheelScrollLines:
+ return QVariant(int(dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, 3)));
default:
break;
}
@@ -495,7 +497,8 @@ static QPixmap loadIconFromShell32(int resourceId, QSizeF size)
QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const
{
- const int scaleFactor = QWindowsScaling::factor();
+ const QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ const int scaleFactor = primaryScreen ? qRound(QHighDpiScaling::factor(primaryScreen)) : 1;
const QSizeF pixmapSize = size * scaleFactor;
int resourceId = -1;
LPCTSTR iconName = 0;
@@ -632,7 +635,7 @@ public:
static FakePointer *create(T thing)
{
- return reinterpret_cast<FakePointer *>(thing);
+ return reinterpret_cast<FakePointer *>(qintptr(thing));
}
T operator * () const
@@ -720,6 +723,7 @@ QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &s
iconSize|SHGFI_SYSICONINDEX;
#endif // Q_OS_WINCE
unsigned long val = 0;
+#if !defined(QT_NO_WINCE_SHELLSDK)
if (cacheableDirIcon && useDefaultFolderIcon) {
flags |= SHGFI_USEFILEATTRIBUTES;
val = SHGetFileInfo(L"dummy",
@@ -729,6 +733,7 @@ QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &s
val = SHGetFileInfo(reinterpret_cast<const wchar_t *>(filePath.utf16()), 0,
&info, sizeof(SHFILEINFO), flags);
}
+#endif // !QT_NO_WINCE_SHELLSDK
// Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
if (val && info.hIcon) {
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h
index b2f8e13b64..fc004b68c8 100644
--- a/src/plugins/platforms/windows/qwindowstheme.h
+++ b/src/plugins/platforms/windows/qwindowstheme.h
@@ -51,9 +51,9 @@ public:
bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE;
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE;
QVariant themeHint(ThemeHint) const Q_DECL_OVERRIDE;
- virtual const QPalette *palette(Palette type = SystemPalette) const
+ const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE
{ return m_palettes[type]; }
- virtual const QFont *font(Font type = SystemFont) const
+ const QFont *font(Font type = SystemFont) const Q_DECL_OVERRIDE
{ return m_fonts[type]; }
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 288f73cb8f..cac8ec5ecc 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -36,7 +36,6 @@
#include "qwindowscontext.h"
#include "qwindowsdrag.h"
#include "qwindowsscreen.h"
-#include "qwindowsscaling.h"
#include "qwindowsintegration.h"
#include "qwindowsopenglcontext.h"
#ifdef QT_NO_CURSOR
@@ -49,8 +48,9 @@
#include <QtGui/QRegion>
#include <QtGui/QOpenGLContext>
#include <private/qsystemlibrary_p.h>
-#include <private/qwindow_p.h>
+#include <private/qwindow_p.h> // QWINDOWSIZE_MAX
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/QDebug>
@@ -106,20 +106,6 @@ static QByteArray debugWinExStyle(DWORD exStyle)
return rc;
}
-#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
-QDebug operator<<(QDebug d, const MINMAXINFO &i)
-{
- QDebugStateSaver saver(d);
- d.nospace();
- d << "MINMAXINFO maxSize=" << i.ptMaxSize.x << ','
- << i.ptMaxSize.y << " maxpos=" << i.ptMaxPosition.x
- << ',' << i.ptMaxPosition.y << " mintrack="
- << i.ptMinTrackSize.x << ',' << i.ptMinTrackSize.y
- << " maxtrack=" << i.ptMaxTrackSize.x << ',' << i.ptMaxTrackSize.y;
- return d;
-}
-#endif // !Q_OS_WINCE
-
static inline QSize qSizeOfRect(const RECT &rect)
{
return QSize(rect.right -rect.left, rect.bottom - rect.top);
@@ -138,6 +124,7 @@ static inline RECT RECTfromQRect(const QRect &rect)
return result;
}
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const RECT &r)
{
QDebugStateSaver saver(d);
@@ -147,7 +134,13 @@ QDebug operator<<(QDebug d, const RECT &r)
return d;
}
-#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_NCCALCSIZE
+QDebug operator<<(QDebug d, const POINT &p)
+{
+ d << p.x << ',' << p.y;
+ return d;
+}
+
+# ifndef Q_OS_WINCE
QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p)
{
QDebugStateSaver saver(d);
@@ -156,7 +149,30 @@ QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p)
<< ' ' << qrectFromRECT(p.rgrc[1]) << ' ' << qrectFromRECT(p.rgrc[2]);
return d;
}
-#endif // !Q_OS_WINCE
+
+QDebug operator<<(QDebug d, const MINMAXINFO &i)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "MINMAXINFO maxSize=" << i.ptMaxSize.x << ','
+ << i.ptMaxSize.y << " maxpos=" << i.ptMaxPosition.x
+ << ',' << i.ptMaxPosition.y << " mintrack="
+ << i.ptMinTrackSize.x << ',' << i.ptMinTrackSize.y
+ << " maxtrack=" << i.ptMaxTrackSize.x << ',' << i.ptMaxTrackSize.y;
+ return d;
+}
+
+QDebug operator<<(QDebug d, const WINDOWPLACEMENT &wp)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "WINDOWPLACEMENT(flags=0x" << hex << wp.flags << dec << ", showCmd="
+ << wp.showCmd << ", ptMinPosition=" << wp.ptMinPosition << ", ptMaxPosition=" << wp.ptMaxPosition
+ << ", rcNormalPosition=" << wp.rcNormalPosition;
+ return d;
+}
+# endif // !Q_OS_WINCE
+#endif // !QT_NO_DEBUG_STREAM
// QTBUG-43872, for windows that do not have WS_EX_TOOLWINDOW set, WINDOWPLACEMENT
// is in workspace/available area coordinates.
@@ -169,7 +185,7 @@ static QPoint windowPlacementOffset(HWND hwnd, const QPoint &point)
const QWindowsScreen *screen = screenManager.screens().size() == 1
? screenManager.screens().first() : screenManager.screenAtDp(point);
if (screen)
- return screen->availableGeometryDp().topLeft() - screen->geometryDp().topLeft();
+ return screen->availableGeometry().topLeft() - screen->geometry().topLeft();
#else
Q_UNUSED(hwnd)
Q_UNUSED(point)
@@ -608,9 +624,7 @@ QWindowsWindowData
const QString windowClassName = QWindowsContext::instance()->registerWindowClass(w);
- const QRect geometryDip = QWindowsScaling::mapFromNative(data.geometry);
- QRect fixedGeometryDip = QPlatformWindow::initialGeometry(w, geometryDip, defaultWindowWidth, defaultWindowHeight);
- const QRect rect = fixedGeometryDip != geometryDip ? QWindowsScaling::mapToNative(fixedGeometryDip) : data.geometry;
+ const QRect rect = QPlatformWindow::initialGeometry(w, data.geometry, defaultWindowWidth, defaultWindowHeight);
if (title.isEmpty() && (result.flags & Qt::WindowTitleHint))
title = topLevel ? qAppName() : w->objectName();
@@ -706,6 +720,20 @@ void WindowCreationData::initialize(const QWindow *w, HWND hwnd, bool frameChang
}
}
+
+// Scaling helpers for size constraints.
+static QSize toNativeSizeConstrained(QSize dip, const QWindow *w)
+{
+ if (QHighDpiScaling::isActive()) {
+ const qreal factor = QHighDpiScaling::factor(w);
+ if (dip.width() > 0 && dip.width() < QWINDOWSIZE_MAX)
+ dip.rwidth() *= factor;
+ if (dip.height() > 0 && dip.height() < QWINDOWSIZE_MAX)
+ dip.rheight() *= factor;
+ }
+ return dip;
+}
+
/*!
\class QWindowsGeometryHint
\brief Stores geometry constraints and provides utility functions.
@@ -718,8 +746,8 @@ void WindowCreationData::initialize(const QWindow *w, HWND hwnd, bool frameChang
*/
QWindowsGeometryHint::QWindowsGeometryHint(const QWindow *w, const QMargins &cm) :
- minimumSize(QWindowsScaling::mapToNativeConstrained(w->minimumSize())),
- maximumSize(QWindowsScaling::mapToNativeConstrained(w->maximumSize())),
+ minimumSize(toNativeSizeConstrained(w->minimumSize(), w)),
+ maximumSize(toNativeSizeConstrained(w->maximumSize(), w)),
customMargins(cm)
{
}
@@ -900,6 +928,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
m_hdc(0),
m_windowState(Qt::WindowNoState),
m_opacity(1.0),
+ m_cursor(new CursorHandle),
m_dropTarget(0),
m_savedStyle(0),
m_format(aWindow->requestedFormat()),
@@ -953,8 +982,7 @@ void QWindowsWindow::fireExpose(const QRegion &region, bool force)
clearFlag(Exposed);
else
setFlag(Exposed);
- QWindowSystemInterface::handleExposeEvent(window(),
- QWindowsScaling::mapFromNative(region));
+ QWindowSystemInterface::handleExposeEvent(window(), region);
}
static inline QWindow *findTransientChild(const QWindow *parent)
@@ -1005,7 +1033,17 @@ void QWindowsWindow::destroyWindow()
void QWindowsWindow::updateDropSite(bool topLevel)
{
bool enabled = false;
- if (topLevel) {
+ bool parentIsEmbedded = false;
+
+ if (!topLevel) {
+ // if the parent window is a foreign window wrapped via QWindow::fromWinId, we need to enable the drop site
+ // on the first child window
+ const QWindow *parent = window()->parent();
+ if (parent && (parent->type() == Qt::ForeignWindow))
+ parentIsEmbedded = true;
+ }
+
+ if (topLevel || parentIsEmbedded) {
switch (window()->type()) {
case Qt::Window:
case Qt::Dialog:
@@ -1051,7 +1089,7 @@ QWindow *QWindowsWindow::topLevelOf(QWindow *w)
if (const QPlatformWindow *handle = w->handle()) {
const QWindowsWindow *ww = static_cast<const QWindowsWindow *>(handle);
- if (ww->isEmbedded(0)) {
+ if (ww->isEmbedded()) {
HWND parentHWND = GetAncestor(ww->handle(), GA_PARENT);
const HWND desktopHwnd = GetDesktopWindow();
const QWindowsContext *ctx = QWindowsContext::instance();
@@ -1129,12 +1167,12 @@ bool QWindowsWindow::isEmbedded(const QPlatformWindow *parentWindow) const
}
if (!m_data.embedded && parent())
- return parent()->isEmbedded(0);
+ return parent()->isEmbedded();
return m_data.embedded;
}
-QPoint QWindowsWindow::mapToGlobalDp(const QPoint &pos) const
+QPoint QWindowsWindow::mapToGlobal(const QPoint &pos) const
{
if (m_data.hwnd)
return QWindowsGeometryHint::mapToGlobal(m_data.hwnd, pos);
@@ -1142,7 +1180,7 @@ QPoint QWindowsWindow::mapToGlobalDp(const QPoint &pos) const
return pos;
}
-QPoint QWindowsWindow::mapFromGlobalDp(const QPoint &pos) const
+QPoint QWindowsWindow::mapFromGlobal(const QPoint &pos) const
{
if (m_data.hwnd)
return QWindowsGeometryHint::mapFromGlobal(m_data.hwnd, pos);
@@ -1323,22 +1361,22 @@ static QRect normalFrameGeometry(HWND hwnd)
return QRect();
}
-QRect QWindowsWindow::normalGeometryDp() const
+QRect QWindowsWindow::normalGeometry() const
{
// Check for fake 'fullscreen' mode.
const bool fakeFullScreen = m_savedFrameGeometry.isValid() && window()->windowState() == Qt::WindowFullScreen;
const QRect frame = fakeFullScreen ? m_savedFrameGeometry : normalFrameGeometry(m_data.hwnd);
- const QMargins margins = fakeFullScreen ? QWindowsGeometryHint::frame(m_savedStyle, 0) : frameMarginsDp();
+ const QMargins margins = fakeFullScreen ? QWindowsGeometryHint::frame(m_savedStyle, 0) : frameMargins();
return frame.isValid() ? frame.marginsRemoved(margins) : frame;
}
-void QWindowsWindow::setGeometryDp(const QRect &rectIn)
+void QWindowsWindow::setGeometry(const QRect &rectIn)
{
QRect rect = rectIn;
// This means it is a call from QWindow::setFramePosition() and
// the coordinates include the frame (size is still the contents rectangle).
if (QWindowsGeometryHint::positionIncludesFrame(window())) {
- const QMargins margins = frameMarginsDp();
+ const QMargins margins = frameMargins();
rect.moveTopLeft(rect.topLeft() + QPoint(margins.left(), margins.top()));
}
if (m_windowState == Qt::WindowMinimized)
@@ -1407,9 +1445,8 @@ void QWindowsWindow::handleGeometryChange()
return;
const QRect previousGeometry = m_data.geometry;
m_data.geometry = geometry_sys();
- const QRect geometryDip = QWindowsScaling::mapFromNative(m_data.geometry);
- QPlatformWindow::setGeometry(geometryDip);
- QWindowSystemInterface::handleGeometryChange(window(), geometryDip);
+ 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.
if (!testFlag(OpenGL_ES2) && isExposed()
@@ -1417,7 +1454,7 @@ void QWindowsWindow::handleGeometryChange()
fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true);
}
if (previousGeometry.topLeft() != m_data.geometry.topLeft()) {
- QPlatformScreen *newScreen = screenForGeometry(geometryDip);
+ QPlatformScreen *newScreen = screenForGeometry(m_data.geometry);
if (newScreen != screen())
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
}
@@ -1429,7 +1466,7 @@ void QWindowsWindow::handleGeometryChange()
void QWindowsWindow::setGeometry_sys(const QRect &rect) const
{
- const QMargins margins = frameMarginsDp();
+ const QMargins margins = frameMargins();
const QRect frameGeometry = rect + margins;
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << window()
@@ -1468,7 +1505,7 @@ QRect QWindowsWindow::frameGeometry_sys() const
QRect QWindowsWindow::geometry_sys() const
{
- return frameGeometry_sys().marginsRemoved(frameMarginsDp());
+ return frameGeometry_sys().marginsRemoved(frameMargins());
}
/*!
@@ -1540,7 +1577,7 @@ void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
{
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window() << "\n from: "
<< m_data.flags << "\n to: " << flags;
- const QRect oldGeometry = geometryDp();
+ const QRect oldGeometry = geometry();
if (m_data.flags != flags) {
m_data.flags = flags;
if (m_data.hwnd) {
@@ -1626,8 +1663,13 @@ void QWindowsWindow::setWindowState(Qt::WindowState state)
bool QWindowsWindow::isFullScreen_sys() const
{
- return window()->isTopLevel()
- && geometry_sys() == QWindowsScaling::mapToNative(window()->screen()->geometry());
+ const QWindow *w = window();
+ if (!w->isTopLevel())
+ return false;
+ const QScreen *screen = w->screen();
+ if (!screen)
+ screen = QGuiApplication::primaryScreen();
+ return screen && geometry_sys() == QHighDpi::toNativePixels(screen->geometry(), w);
}
/*!
@@ -1678,7 +1720,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
if (!m_savedStyle) {
m_savedStyle = style();
#ifndef Q_OS_WINCE
- if (oldState == Qt::WindowMinimized) {
+ if (oldState == Qt::WindowMinimized || oldState == Qt::WindowMaximized) {
const QRect nf = normalFrameGeometry(m_data.hwnd);
if (nf.isValid())
m_savedFrameGeometry = nf;
@@ -1693,19 +1735,22 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
newStyle |= WS_SYSMENU;
if (visible)
newStyle |= WS_VISIBLE;
+ if (testFlag(HasBorderInFullScreen))
+ newStyle |= WS_BORDER;
setStyle(newStyle);
// Use geometry of QWindow::screen() within creation or the virtual screen the
// window is in (QTBUG-31166, QTBUG-30724).
const QScreen *screen = window()->screen();
- const QRect rDip = screen->geometry();
- const QRect r = QWindowsScaling::mapToNative(rDip);
+ 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(), rDip);
+ QWindowSystemInterface::handleGeometryChange(window(), r);
QWindowSystemInterface::flushWindowSystemEvents();
} else if (newState != Qt::WindowMinimized) {
// Restore saved state.
@@ -1726,7 +1771,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
// preserve maximized state
if (visible) {
setFlag(WithinMaximize);
- ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
+ ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNA);
clearFlag(WithinMaximize);
}
m_savedStyle = 0;
@@ -1746,7 +1791,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
if ((oldState == Qt::WindowMinimized) != (newState == Qt::WindowMinimized)) {
if (visible)
ShowWindow(m_data.hwnd, (newState == Qt::WindowMinimized) ? SW_MINIMIZE :
- (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
+ (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNORMAL);
}
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << this << window() << newState;
}
@@ -1804,7 +1849,7 @@ void QWindowsWindow::propagateSizeHints()
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
}
-bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp)
+bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &margins)
{
#ifndef Q_OS_WINCE
if (!qWindow->isTopLevel()) // Implement hasHeightForWidth().
@@ -1812,26 +1857,19 @@ bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *
WINDOWPOS *windowPos = reinterpret_cast<WINDOWPOS *>(message->lParam);
if ((windowPos->flags & (SWP_NOCOPYBITS | SWP_NOSIZE)))
return false;
- const QRect suggestedFrameGeometryDp(windowPos->x, windowPos->y,
- windowPos->cx, windowPos->cy);
- const qreal factor = QWindowsScaling::factor();
- const QRect suggestedGeometryDp = suggestedFrameGeometryDp - marginsDp;
- const QRectF suggestedGeometry = QRectF(QPointF(suggestedGeometryDp.topLeft()) / factor,
- QSizeF(suggestedGeometryDp.size()) / factor);
- const QRectF correctedGeometryF =
- qt_window_private(const_cast<QWindow *>(qWindow))->closestAcceptableGeometry(suggestedGeometry);
+ const QRect suggestedFrameGeometry(windowPos->x, windowPos->y,
+ windowPos->cx, windowPos->cy);
+ const QRect suggestedGeometry = suggestedFrameGeometry - margins;
+ const QRectF correctedGeometryF = QPlatformWindow::closestAcceptableGeometry(qWindow, suggestedGeometry);
if (!correctedGeometryF.isValid())
return false;
- const QRect correctedFrameGeometryDp
- = QRectF(correctedGeometryF.topLeft() * factor,
- correctedGeometryF.size() * factor).toRect()
- + marginsDp;
- if (correctedFrameGeometryDp == suggestedFrameGeometryDp)
+ const QRect correctedFrameGeometry = correctedGeometryF.toRect() + margins;
+ if (correctedFrameGeometry == suggestedFrameGeometry)
return false;
- windowPos->x = correctedFrameGeometryDp.left();
- windowPos->y = correctedFrameGeometryDp.top();
- windowPos->cx = correctedFrameGeometryDp.width();
- windowPos->cy = correctedFrameGeometryDp.height();
+ windowPos->x = correctedFrameGeometry.left();
+ windowPos->y = correctedFrameGeometry.top();
+ windowPos->cx = correctedFrameGeometry.width();
+ windowPos->cy = correctedFrameGeometry.height();
return true;
#else // !Q_OS_WINCE
Q_UNUSED(message)
@@ -1841,11 +1879,11 @@ bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *
bool QWindowsWindow::handleGeometryChanging(MSG *message) const
{
- const QMargins marginsDp = window()->isTopLevel() ? frameMarginsDp() : QMargins();
- return QWindowsWindow::handleGeometryChangingMessage(message, window(), marginsDp);
+ const QMargins margins = window()->isTopLevel() ? frameMargins() : QMargins();
+ return QWindowsWindow::handleGeometryChangingMessage(message, window(), margins);
}
-QMargins QWindowsWindow::frameMarginsDp() const
+QMargins QWindowsWindow::frameMargins() const
{
// Frames are invalidated by style changes (window state, flags).
// As they are also required for geometry calculations in resize
@@ -1892,17 +1930,17 @@ static inline void addRectToWinRegion(const QRect &rect, HRGN *winRegion)
}
}
-static HRGN qRegionToWinRegion(const QRegion &regionDip)
+static HRGN qRegionToWinRegion(const QRegion &region)
{
- const QVector<QRect> rects = regionDip.rects();
+ const QVector<QRect> rects = region.rects();
if (rects.isEmpty())
return NULL;
const int rectCount = rects.size();
if (rectCount == 1)
- return createRectRegion(QWindowsScaling::mapToNative(regionDip.boundingRect()));
- HRGN hRegion = createRectRegion(QWindowsScaling::mapToNative(rects.front()));
+ return createRectRegion(region.boundingRect());
+ HRGN hRegion = createRectRegion(rects.front());
for (int i = 1; i < rectCount; ++i)
- addRectToWinRegion(QWindowsScaling::mapToNative(rects.at(i)), &hRegion);
+ addRectToWinRegion(rects.at(i), &hRegion);
return hRegion;
}
@@ -1916,7 +1954,7 @@ void QWindowsWindow::setMask(const QRegion &region)
// Mask is in client area coordinates, so offset it in case we have a frame
if (window()->isTopLevel()) {
- const QMargins margins = frameMarginsDp();
+ const QMargins margins = frameMargins();
OffsetRgn(winRegion, margins.left(), margins.top());
}
@@ -2053,23 +2091,23 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
|| (m_data.flags & Qt::FramelessWindowHint)) {
return false;
}
- const QSize minimumSize = QWindowsScaling::mapToNativeConstrained(w->minimumSize());
+ const QSize minimumSize = w->minimumSize();
if (minimumSize.isEmpty())
return false;
- const QSize maximumSize = QWindowsScaling::mapToNativeConstrained(w->maximumSize());
+ const QSize maximumSize = w->maximumSize();
const bool fixedWidth = minimumSize.width() == maximumSize.width();
const bool fixedHeight = minimumSize.height() == maximumSize.height();
if (!fixedWidth && !fixedHeight)
return false;
- const QPoint localPos = mapFromGlobalDp(globalPos);
- const QSize size = w->size() * QWindowsScaling::factor();
+ const QPoint localPos = w->mapFromGlobal(QHighDpi::fromNativePixels(globalPos, w));
+ const QSize size = w->size();
if (fixedHeight) {
if (localPos.y() >= size.height()) {
*result = HTBORDER; // Unspecified border, no resize cursor.
return true;
}
if (localPos.y() < 0) {
- const QMargins margins = frameMarginsDp();
+ const QMargins margins = frameMargins();
const int topResizeBarPos = margins.left() - margins.top();
if (localPos.y() < topResizeBarPos) {
*result = HTCAPTION; // Extend caption over top resize bar, let's user move the window.
@@ -2088,13 +2126,13 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
#ifndef QT_NO_CURSOR
// Return the default cursor (Arrow) from QWindowsCursor's cache.
-static inline QWindowsWindowCursor defaultCursor(const QWindow *w)
+static inline CursorHandlePtr defaultCursor(const QWindow *w)
{
if (QScreen *screen = w->screen())
if (const QPlatformScreen *platformScreen = screen->handle())
if (QPlatformCursor *cursor = platformScreen->cursor())
return static_cast<QWindowsCursor *>(cursor)->standardWindowCursor(Qt::ArrowCursor);
- return QWindowsWindowCursor(Qt::ArrowCursor);
+ return CursorHandlePtr(new CursorHandle(QWindowsCursor::createCursorFromShape(Qt::ArrowCursor)));
}
// Check whether to apply a new cursor. Either the window in question is
@@ -2108,7 +2146,7 @@ static inline bool applyNewCursor(const QWindow *w)
for (const QWindow *p = underMouse; p ; p = p->parent()) {
if (p == w)
return true;
- if (!QWindowsWindow::baseWindowOf(p)->cursor().isNull())
+ if (!QWindowsWindow::baseWindowOf(p)->cursor()->isNull())
return false;
}
return false;
@@ -2124,25 +2162,25 @@ static inline bool applyNewCursor(const QWindow *w)
void QWindowsWindow::applyCursor()
{
#ifndef QT_NO_CURSOR
- if (m_cursor.isNull()) { // Recurse up to parent with non-null cursor. Set default for toplevel.
+ if (m_cursor->isNull()) { // Recurse up to parent with non-null cursor. Set default for toplevel.
if (const QWindow *p = window()->parent()) {
QWindowsWindow::baseWindowOf(p)->applyCursor();
} else {
- SetCursor(defaultCursor(window()).handle());
+ SetCursor(defaultCursor(window())->handle());
}
} else {
- SetCursor(m_cursor.handle());
+ SetCursor(m_cursor->handle());
}
#endif
}
-void QWindowsWindow::setCursor(const QWindowsWindowCursor &c)
+void QWindowsWindow::setCursor(const CursorHandlePtr &c)
{
#ifndef QT_NO_CURSOR
- if (c.handle() != m_cursor.handle()) {
+ if (c->handle() != m_cursor->handle()) {
const bool apply = applyNewCursor(window());
qCDebug(lcQpaWindows) << window() << __FUNCTION__
- << c.cursor().shape() << " doApply=" << apply;
+ << c->handle() << " doApply=" << apply;
m_cursor = c;
if (apply)
applyCursor();
@@ -2245,10 +2283,6 @@ void QWindowsWindow::setWindowIcon(const QIcon &icon)
The property can be set using QPlatformNativeInterface::setWindowProperty() or,
before platform window creation, by setting a dynamic property
on the QWindow (see QWindowsIntegration::createPlatformWindow()).
-
- Note: The function uses (unscaled) device pixels since the QWizard also
- uses AdjustWindowRect() and using device independent pixels would introduce
- rounding errors.
*/
void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
@@ -2339,4 +2373,19 @@ void QWindowsWindow::aboutToMakeCurrent()
#endif
}
+void QWindowsWindow::setHasBorderInFullScreenStatic(QWindow *window, bool border)
+{
+ if (!window->handle())
+ return;
+ static_cast<QWindowsWindow *>(window->handle())->setHasBorderInFullScreen(border);
+}
+
+void QWindowsWindow::setHasBorderInFullScreen(bool border)
+{
+ if (border)
+ setFlag(HasBorderInFullScreen);
+ else
+ clearFlag(HasBorderInFullScreen);
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index fff90b4b11..6fffa1e6e9 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -38,7 +38,6 @@
#ifdef Q_OS_WINCE
# include "qplatformfunctions_wince.h"
#endif
-#include "qwindowsscaling.h"
#include "qwindowscursor.h"
#include <qpa/qplatformwindow.h>
@@ -138,35 +137,28 @@ public:
WithinMaximize = 0x40000,
MaximizeToFullScreen = 0x80000,
InputMethodDisabled = 0x100000,
- Compositing = 0x200000
+ Compositing = 0x200000,
+ HasBorderInFullScreen = 0x400000
};
QWindowsWindow(QWindow *window, const QWindowsWindowData &data);
~QWindowsWindow();
+ using QPlatformWindow::screenForGeometry;
+
QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; }
- void setGeometryDp(const QRect &rectIn);
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE
- { setGeometryDp(QWindowsScaling::mapToNative(rect)); }
- QRect geometryDp() const { return m_data.geometry; }
- QRect geometry() const Q_DECL_OVERRIDE
- { return QWindowsScaling::mapFromNative(geometryDp()); }
- QRect normalGeometryDp() const;
- QRect normalGeometry() const Q_DECL_OVERRIDE
- { return QWindowsScaling::mapFromNative(normalGeometryDp()); }
- qreal devicePixelRatio() const Q_DECL_OVERRIDE
- { return qreal(QWindowsScaling::factor()); }
+ void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
+ QRect geometry() const Q_DECL_OVERRIDE { return m_data.geometry; }
+ QRect normalGeometry() const Q_DECL_OVERRIDE;
+
void setVisible(bool visible) Q_DECL_OVERRIDE;
bool isVisible() const;
bool isExposed() const Q_DECL_OVERRIDE { return testFlag(Exposed); }
bool isActive() const Q_DECL_OVERRIDE;
- bool isEmbedded(const QPlatformWindow *parentWindow) const Q_DECL_OVERRIDE;
- QPoint mapToGlobalDp(const QPoint &pos) const;
- QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE
- { return mapToGlobalDp(pos * QWindowsScaling::factor()) / QWindowsScaling::factor(); }
- QPoint mapFromGlobalDp(const QPoint &pos) const;
- QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE
- { return mapFromGlobalDp(pos * QWindowsScaling::factor()) / QWindowsScaling::factor(); }
+ bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE;
+ QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE;
+ QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE;
+
void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
@@ -179,13 +171,12 @@ public:
void raise() Q_DECL_OVERRIDE;
void lower() Q_DECL_OVERRIDE;
- void windowEvent(QEvent *event);
+ void windowEvent(QEvent *event) Q_DECL_OVERRIDE;
void propagateSizeHints() Q_DECL_OVERRIDE;
static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp);
bool handleGeometryChanging(MSG *message) const;
- QMargins frameMarginsDp() const;
- QMargins frameMargins() const Q_DECL_OVERRIDE { return frameMarginsDp() / QWindowsScaling::factor(); }
+ QMargins frameMargins() const Q_DECL_OVERRIDE;
void setOpacity(qreal level) Q_DECL_OVERRIDE;
void setMask(const QRegion &region) Q_DECL_OVERRIDE;
@@ -196,10 +187,10 @@ public:
bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE;
inline bool hasMouseCapture() const { return GetCapture() == m_data.hwnd; }
- bool startSystemResize(const QPoint &, Qt::Corner corner) Q_DECL_OVERRIDE;
+ bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE;
- void setFrameStrutEventsEnabled(bool enabled);
- bool frameStrutEventsEnabled() const { return testFlag(FrameStrutEventsEnabled); }
+ void setFrameStrutEventsEnabled(bool enabled) Q_DECL_OVERRIDE;
+ bool frameStrutEventsEnabled() const Q_DECL_OVERRIDE { return testFlag(FrameStrutEventsEnabled); }
QMargins customMargins() const { return m_data.customMargins; }
void setCustomMargins(const QMargins &m);
@@ -235,9 +226,9 @@ public:
#endif // !Q_OS_WINCE
#ifndef QT_NO_CURSOR
- QWindowsWindowCursor cursor() const { return m_cursor; }
+ CursorHandlePtr cursor() const { return m_cursor; }
#endif
- void setCursor(const QWindowsWindowCursor &c);
+ void setCursor(const CursorHandlePtr &c);
void applyCursor();
inline bool testFlag(unsigned f) const { return (m_flags & f) != 0; }
@@ -246,22 +237,23 @@ public:
void setEnabled(bool enabled);
bool isEnabled() const;
- void setWindowIcon(const QIcon &icon);
+ void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE;
void *surface(void *nativeConfig, int *err);
void invalidateSurface() Q_DECL_OVERRIDE;
void aboutToMakeCurrent();
#ifndef Q_OS_WINCE
- void setAlertState(bool enabled);
- bool isAlertState() const { return testFlag(AlertState); }
+ void setAlertState(bool enabled) Q_DECL_OVERRIDE;
+ bool isAlertState() const Q_DECL_OVERRIDE { return testFlag(AlertState); }
void alertWindow(int durationMs = 0);
void stopAlertWindow();
#endif
static void setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes);
void registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes = QWindowsWindowFunctions::NormalTouch);
-
+ static void setHasBorderInFullScreenStatic(QWindow *window, bool border);
+ void setHasBorderInFullScreen(bool border);
private:
inline void show_sys() const;
inline void hide_sys() const;
@@ -288,7 +280,7 @@ private:
Qt::WindowState m_windowState;
qreal m_opacity;
#ifndef QT_NO_CURSOR
- QWindowsWindowCursor m_cursor;
+ CursorHandlePtr m_cursor;
#endif
QWindowsOleDropTarget *m_dropTarget;
unsigned m_savedStyle;
@@ -302,12 +294,15 @@ private:
void *m_surface;
};
-// Debug
+#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const RECT &r);
-#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO/WM_NCCALCSIZE
+QDebug operator<<(QDebug d, const POINT &);
+# ifndef Q_OS_WINCE
QDebug operator<<(QDebug d, const MINMAXINFO &i);
QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p);
-#endif
+QDebug operator<<(QDebug d, const WINDOWPLACEMENT &);
+# endif // !Q_OS_WINCE
+#endif // !QT_NO_DEBUG_STREAM
// ---------- QWindowsGeometryHint inline functions.
QPoint QWindowsGeometryHint::mapToGlobal(HWND hwnd, const QPoint &qp)
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index de901aaeb1..67af5c03ef 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -13,7 +13,6 @@ wince: DEFINES *= QT_LIBINFIX=L"\"\\\"$${QT_LIBINFIX}\\\"\""
DEFINES *= QT_NO_CAST_FROM_ASCII
contains(QT_CONFIG, directwrite) {
- LIBS *= -ldwrite
SOURCES += $$PWD/qwindowsfontenginedirectwrite.cpp
HEADERS += $$PWD/qwindowsfontenginedirectwrite.h
} else {
@@ -29,7 +28,6 @@ SOURCES += \
$$PWD/qwindowsfontengine.cpp \
$$PWD/qwindowsfontdatabase.cpp \
$$PWD/qwindowsmousehandler.cpp \
- $$PWD/qwindowsguieventdispatcher.cpp \
$$PWD/qwindowsole.cpp \
$$PWD/qwindowsmime.cpp \
$$PWD/qwindowsinternalmimedata.cpp \
@@ -40,7 +38,6 @@ SOURCES += \
$$PWD/qwindowsservices.cpp \
$$PWD/qwindowsnativeimage.cpp \
$$PWD/qwindowsnativeinterface.cpp \
- $$PWD/qwindowsscaling.cpp \
$$PWD/qwindowsopengltester.cpp
HEADERS += \
@@ -52,7 +49,6 @@ HEADERS += \
$$PWD/qwindowsfontengine.h \
$$PWD/qwindowsfontdatabase.h \
$$PWD/qwindowsmousehandler.h \
- $$PWD/qwindowsguieventdispatcher.h \
$$PWD/qtwindowsglobal.h \
$$PWD/qtwindows_additional.h \
$$PWD/qwindowsole.h \
@@ -67,7 +63,6 @@ HEADERS += \
$$PWD/qplatformfunctions_wince.h \
$$PWD/qwindowsnativeimage.h \
$$PWD/qwindowsnativeinterface.h \
- $$PWD/qwindowsscaling.h \
$$PWD/qwindowsopengltester.h
INCLUDEPATH += $$PWD
@@ -136,3 +131,6 @@ contains(QT_CONFIG, freetype) {
}
contains(QT_CONFIG, accessibility):include($$PWD/accessible/accessible.pri)
+
+DEFINES *= LIBEGL_NAME=$${LIBEGL_NAME}
+DEFINES *= LIBGLESV2_NAME=$${LIBGLESV2_NAME}
diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
index dcf8239538..4517200a2d 100644
--- a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
+++ b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
@@ -42,8 +42,8 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
-#include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
QT_BEGIN_NAMESPACE
@@ -66,7 +66,8 @@ QWinRTBackingStore::QWinRTBackingStore(QWindow *window)
d->initialized = false;
d->screen = static_cast<QWinRTScreen*>(window->screen()->handle());
- window->setSurfaceType(QSurface::OpenGLSurface); // Required for flipping, but could be done in the swap
+ if (window->surfaceType() == QSurface::RasterSurface)
+ window->setSurfaceType(QSurface::OpenGLSurface);
}
bool QWinRTBackingStore::initialize()
@@ -78,7 +79,6 @@ bool QWinRTBackingStore::initialize()
d->context.reset(new QOpenGLContext);
QSurfaceFormat format = window()->requestedFormat();
- format.setVersion(3, 0); // Required for ES3 framebuffer blit
d->context->setFormat(format);
d->context->setScreen(window()->screen());
if (!d->context->create())
@@ -121,13 +121,13 @@ void QWinRTBackingStore::flush(QWindow *window, const QRegion &region, const QPo
GL_RGBA, GL_UNSIGNED_BYTE, d->paintDevice.constScanLine(bounds.y()));
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_READ_FRAMEBUFFER, d->fbo->handle());
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, d->fbo->handle());
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, 0);
const int y1 = bounds.y();
const int y2 = y1 + bounds.height();
const int x1 = bounds.x();
const int x2 = x1 + bounds.width();
- glBlitFramebuffer(x1, y1, x2, y2,
+ glBlitFramebufferANGLE(x1, y1, x2, y2,
x1, d->size.height() - y1, x2, d->size.height() - y2,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
diff --git a/src/plugins/platforms/winrt/qwinrtcursor.cpp b/src/plugins/platforms/winrt/qwinrtcursor.cpp
index 94ce23bd2c..1a511f103f 100644
--- a/src/plugins/platforms/winrt/qwinrtcursor.cpp
+++ b/src/plugins/platforms/winrt/qwinrtcursor.cpp
@@ -36,11 +36,13 @@
#include "qwinrtcursor.h"
#include "qwinrtscreen.h"
+#include <private/qeventdispatcher_winrt_p.h>
#include <QtCore/qfunctions_winrt.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
+#include <functional>
#include <wrl.h>
#include <windows.ui.core.h>
#include <windows.foundation.h>
@@ -77,12 +79,17 @@ void QWinRTCursor::changeCursor(QCursor *windowCursor, QWindow *window)
{
Q_D(QWinRTCursor);
+ HRESULT hr;
ICoreWindow *coreWindow = static_cast<QWinRTScreen *>(window->screen()->handle())->coreWindow();
CoreCursorType type;
switch (windowCursor ? windowCursor->shape() : Qt::ArrowCursor) {
case Qt::BlankCursor:
- coreWindow->put_PointerCursor(Q_NULLPTR);
+ hr = QEventDispatcherWinRT::runOnXamlThread([coreWindow]() {
+ coreWindow->put_PointerCursor(Q_NULLPTR);
+ return S_OK;
+ });
+ RETURN_VOID_IF_FAILED("Failed to set blank native cursor");
return;
default:
case Qt::OpenHandCursor:
@@ -142,21 +149,31 @@ void QWinRTCursor::changeCursor(QCursor *windowCursor, QWindow *window)
}
ComPtr<ICoreCursor> cursor;
- HRESULT hr = d->cursorFactory->CreateCursor(type, 0, &cursor);
+ hr = d->cursorFactory->CreateCursor(type, 0, &cursor);
RETURN_VOID_IF_FAILED("Failed to create native cursor.");
- hr = coreWindow->put_PointerCursor(cursor.Get());
- RETURN_VOID_IF_FAILED("Failed to set native cursor.");
+ hr = QEventDispatcherWinRT::runOnXamlThread([coreWindow, &cursor]() {
+ return coreWindow->put_PointerCursor(cursor.Get());
+ });
+ RETURN_VOID_IF_FAILED("Failed to set native cursor");
}
#endif // QT_NO_CURSOR
QPoint QWinRTCursor::pos() const
{
- ICoreWindow *coreWindow =
- static_cast<QWinRTScreen *>(QGuiApplication::primaryScreen()->handle())->coreWindow();
+ const QWinRTScreen *screen = static_cast<QWinRTScreen *>(QGuiApplication::primaryScreen()->handle());
+ Q_ASSERT(screen);
+ ICoreWindow *coreWindow = screen->coreWindow();
+ Q_ASSERT(coreWindow);
Point point;
- coreWindow->get_PointerPosition(&point);
- return QPoint(point.X, point.Y);
+ HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([coreWindow, &point]() {
+ return coreWindow->get_PointerPosition(&point);
+ });
+ Q_ASSERT_SUCCEEDED(hr);
+ const QPoint position = QPoint(point.X, point.Y) * screen->scaleFactor();
+ // If no cursor get_PointerPosition returns SHRT_MIN for x and y
+ return position.x() == SHRT_MIN && position.y() == SHRT_MIN || FAILED(hr) ? QPointF(Q_INFINITY, Q_INFINITY).toPoint()
+ : position;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index 42ffe8f716..bc77df566e 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -35,40 +35,162 @@
****************************************************************************/
#include "qwinrteglcontext.h"
+#include "qwinrtwindow.h"
+#include <private/qeventdispatcher_winrt_p.h>
+#include <functional>
+
+#include <d3d11.h>
+
+#include <EGL/egl.h>
#define EGL_EGLEXT_PROTOTYPES
-#include "EGL/eglext.h"
+#include <EGL/eglext.h>
+
+#include <QOffscreenSurface>
+#include <QOpenGLContext>
+#include <QtPlatformSupport/private/qeglconvenience_p.h>
QT_BEGIN_NAMESPACE
-QWinRTEGLContext::QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLSurface surface, EGLConfig config)
- : QEGLPlatformContext(format, share, display, &config), m_eglSurface(surface)
+struct WinRTEGLDisplay
+{
+ WinRTEGLDisplay() {
+ }
+ ~WinRTEGLDisplay() {
+ eglTerminate(eglDisplay);
+ }
+
+ EGLDisplay eglDisplay;
+};
+
+Q_GLOBAL_STATIC(WinRTEGLDisplay, g)
+
+class QWinRTEGLContextPrivate
{
+public:
+ QWinRTEGLContextPrivate() : eglContext(EGL_NO_CONTEXT), eglShareContext(EGL_NO_CONTEXT) { }
+ QSurfaceFormat format;
+ EGLConfig eglConfig;
+ EGLContext eglContext;
+ EGLContext eglShareContext;
+};
+
+QWinRTEGLContext::QWinRTEGLContext(QOpenGLContext *context)
+ : d_ptr(new QWinRTEGLContextPrivate)
+{
+ Q_D(QWinRTEGLContext);
+ d->format = context->format();
+ d->format.setRenderableType(QSurfaceFormat::OpenGLES);
+ if (QPlatformOpenGLContext *shareHandle = context->shareHandle())
+ d->eglShareContext = static_cast<QWinRTEGLContext *>(shareHandle)->d_ptr->eglContext;
}
-void QWinRTEGLContext::swapBuffers(QPlatformSurface *surface)
+QWinRTEGLContext::~QWinRTEGLContext()
{
-#ifdef Q_OS_WINPHONE
- const QSize size = surface->surface()->size();
- eglPostSubBufferNV(eglDisplay(), eglSurfaceForPlatformSurface(surface),
- 0, 0, size.width(), size.height());
-#else
- eglSwapBuffers(eglDisplay(), eglSurfaceForPlatformSurface(surface));
-#endif
+ Q_D(QWinRTEGLContext);
+ if (d->eglContext != EGL_NO_CONTEXT)
+ eglDestroyContext(g->eglDisplay, d->eglContext);
}
-EGLSurface QWinRTEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
+void QWinRTEGLContext::initialize()
{
- if (surface->surface()->surfaceClass() == QSurface::Window) {
- // All windows use the same surface
- return m_eglSurface;
- } else {
- // TODO: return EGL surfaces for offscreen surfaces
- qWarning("This plugin does not support offscreen surfaces.");
- return EGL_NO_SURFACE;
+ Q_D(QWinRTEGLContext);
+
+ // Test if the hardware supports at least level 9_3
+ D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_9_3 }; // minimum feature level
+ HRESULT hr = D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, featureLevels, 1,
+ D3D11_SDK_VERSION, nullptr, nullptr, nullptr);
+ EGLint deviceType = SUCCEEDED(hr) ? EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE
+ : EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE;
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+
+ const EGLint displayAttributes[] = {
+ EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
+ EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, deviceType,
+ EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, true,
+ EGL_NONE,
+ };
+ g->eglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes);
+ if (g->eglDisplay == EGL_NO_DISPLAY)
+ qCritical("Failed to initialize EGL display: 0x%x", eglGetError());
+
+ // eglInitialize checks for EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE
+ // which adds a suspending handler. This needs to be added from the Xaml
+ // thread itself, otherwise it will not be invoked. add_Suspending does
+ // not return an error unfortunately, so it silently fails and causes
+ // applications to not quit when the system wants to terminate the app
+ // after suspend.
+ hr = QEventDispatcherWinRT::runOnXamlThread([]() {
+ if (!eglInitialize(g->eglDisplay, nullptr, nullptr))
+ qCritical("Failed to initialize EGL: 0x%x", eglGetError());
+ return S_OK;
+ });
+ d->eglConfig = q_configFromGLFormat(g->eglDisplay, d->format);
+
+ const EGLint flags = d->format.testOption(QSurfaceFormat::DebugContext)
+ ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0;
+ const EGLint attributes[] = {
+ EGL_CONTEXT_CLIENT_VERSION, d->format.majorVersion(),
+ EGL_CONTEXT_MINOR_VERSION_KHR, d->format.minorVersion(),
+ EGL_CONTEXT_FLAGS_KHR, flags,
+ EGL_NONE
+ };
+ d->eglContext = eglCreateContext(g->eglDisplay, d->eglConfig, d->eglShareContext, attributes);
+ if (d->eglContext == EGL_NO_CONTEXT) {
+ qWarning("QEGLPlatformContext: Failed to create context: %x", eglGetError());
+ return;
}
}
+bool QWinRTEGLContext::makeCurrent(QPlatformSurface *windowSurface)
+{
+ Q_D(QWinRTEGLContext);
+ Q_ASSERT(windowSurface->surface()->supportsOpenGL());
+
+ if (windowSurface->surface()->surfaceClass() == QSurface::Offscreen)
+ return false;
+
+ QWinRTWindow *window = static_cast<QWinRTWindow *>(windowSurface);
+ if (window->eglSurface() == EGL_NO_SURFACE)
+ window->createEglSurface(g->eglDisplay, d->eglConfig);
+
+ EGLSurface surface = window->eglSurface();
+ if (surface == EGL_NO_SURFACE)
+ return false;
+
+ const bool ok = eglMakeCurrent(g->eglDisplay, surface, surface, d->eglContext);
+ if (!ok) {
+ qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
+ return false;
+ }
+
+ eglSwapInterval(g->eglDisplay, d->format.swapInterval());
+ return true;
+}
+
+void QWinRTEGLContext::doneCurrent()
+{
+ const bool ok = eglMakeCurrent(g->eglDisplay, EGL_NO_SURFACE,
+ EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ if (!ok)
+ qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
+}
+
+void QWinRTEGLContext::swapBuffers(QPlatformSurface *windowSurface)
+{
+ Q_ASSERT(windowSurface->surface()->supportsOpenGL());
+
+ const QWinRTWindow *window = static_cast<QWinRTWindow *>(windowSurface);
+ eglSwapBuffers(g->eglDisplay, window->eglSurface());
+}
+
+QSurfaceFormat QWinRTEGLContext::format() const
+{
+ Q_D(const QWinRTEGLContext);
+ return d->format;
+}
+
QFunctionPointer QWinRTEGLContext::getProcAddress(const QByteArray &procName)
{
static QHash<QByteArray, QFunctionPointer> standardFuncs;
@@ -221,7 +343,7 @@ QFunctionPointer QWinRTEGLContext::getProcAddress(const QByteArray &procName)
if (i != standardFuncs.end())
return i.value();
- return QEGLPlatformContext::getProcAddress(procName);
+ return eglGetProcAddress(procName.constData());
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h
index 958d623c4c..31a2124b03 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.h
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.h
@@ -37,23 +37,29 @@
#ifndef QWINDOWSEGLCONTEXT_H
#define QWINDOWSEGLCONTEXT_H
-#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
+#include <qpa/qplatformopenglcontext.h>
QT_BEGIN_NAMESPACE
-class QWinRTEGLContext : public QEGLPlatformContext
+class QWinRTEGLContextPrivate;
+class QWinRTEGLContext : public QPlatformOpenGLContext
{
public:
- explicit QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLSurface surface, EGLConfig config);
+ explicit QWinRTEGLContext(QOpenGLContext *context);
+ ~QWinRTEGLContext();
- void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
+ void initialize() Q_DECL_OVERRIDE;
+
+ bool makeCurrent(QPlatformSurface *windowSurface) Q_DECL_OVERRIDE;
+ void doneCurrent() Q_DECL_OVERRIDE;
+ void swapBuffers(QPlatformSurface *windowSurface) Q_DECL_OVERRIDE;
-protected:
- EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface);
+ QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
private:
- EGLSurface m_eglSurface;
+ QScopedPointer<QWinRTEGLContextPrivate> d_ptr;
+ Q_DECLARE_PRIVATE(QWinRTEGLContext)
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
index e1b2a07d5f..68e0227ef5 100644
--- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
@@ -37,25 +37,32 @@
#include "qwinrtfiledialoghelper.h"
#include "qwinrtfileengine.h"
+#include <QtCore/qcoreapplication.h>
#include <QtCore/QEventLoop>
#include <QtCore/QMap>
#include <QtCore/QVector>
#include <QtCore/qfunctions_winrt.h>
+#include <private/qeventdispatcher_winrt_p.h>
+#include <functional>
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.storage.pickers.h>
+#include <Windows.ApplicationModel.activation.h>
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
+using namespace ABI::Windows::ApplicationModel::Activation;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Foundation::Collections;
using namespace ABI::Windows::Storage;
using namespace ABI::Windows::Storage::Pickers;
+#ifndef Q_OS_WINPHONE
typedef IAsyncOperationCompletedHandler<StorageFile *> SingleFileHandler;
typedef IAsyncOperationCompletedHandler<IVectorView<StorageFile *> *> MultipleFileHandler;
typedef IAsyncOperationCompletedHandler<StorageFolder *> SingleFolderHandler;
+#endif
QT_BEGIN_NAMESPACE
@@ -142,6 +149,16 @@ private:
QVector<HSTRING> impl;
};
+#ifdef Q_OS_WINPHONE
+class QActivationEvent : public QEvent
+{
+public:
+ IInspectable *args() const {
+ return reinterpret_cast<IInspectable *>(d);
+ }
+};
+#endif
+
template<typename T>
static bool initializePicker(HSTRING runtimeId, T **picker, const QSharedPointer<QFileDialogOptions> &options)
{
@@ -200,6 +217,111 @@ static bool initializeOpenPickerOptions(T *picker, const QSharedPointer<QFileDia
return true;
}
+static bool pickFiles(IFileOpenPicker *picker, QWinRTFileDialogHelper *helper, bool singleFile)
+{
+ Q_ASSERT(picker);
+ Q_ASSERT(helper);
+ HRESULT hr;
+#ifdef Q_OS_WINPHONE
+ hr = QEventDispatcherWinRT::runOnXamlThread([picker, singleFile]() {
+ HRESULT hr;
+ ComPtr<IFileOpenPicker2> picker2;
+ hr = picker->QueryInterface(IID_PPV_ARGS(picker2.GetAddressOf()));
+ RETURN_HR_IF_FAILED("Failed to cast file picker");
+ if (singleFile)
+ return picker2->PickSingleFileAndContinue();
+ else
+ return picker2->PickMultipleFilesAndContinue();
+ });
+ RETURN_FALSE_IF_FAILED("Failed to open file picker");
+ QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
+ Q_ASSERT(eventDispatcher);
+ eventDispatcher->installEventFilter(helper);
+ return true;
+#else
+ hr = QEventDispatcherWinRT::runOnXamlThread([picker, helper, singleFile]() {
+ HRESULT hr;
+ if (singleFile) {
+ ComPtr<IAsyncOperation<StorageFile *>> op;
+ hr = picker->PickSingleFileAsync(&op);
+ RETURN_HR_IF_FAILED("Failed to open single file picker");
+ hr = op->put_Completed(Callback<SingleFileHandler>(helper, &QWinRTFileDialogHelper::onSingleFilePicked).Get());
+ RETURN_HR_IF_FAILED("Failed to attach file picker callback");
+ } else {
+ ComPtr<IAsyncOperation<IVectorView<StorageFile *> *>> op;
+ hr = picker->PickMultipleFilesAsync(&op);
+ RETURN_HR_IF_FAILED("Failed to open multi file picker");
+ hr = op->put_Completed(Callback<MultipleFileHandler>(helper, &QWinRTFileDialogHelper::onMultipleFilesPicked).Get());
+ RETURN_HR_IF_FAILED("Failed to attach multi file callback");
+ }
+ return S_OK;
+ });
+ return SUCCEEDED(hr);
+#endif
+}
+
+static bool pickFolder(IFolderPicker *picker, QWinRTFileDialogHelper *helper)
+{
+ Q_ASSERT(picker);
+ Q_ASSERT(helper);
+ HRESULT hr;
+#ifdef Q_OS_WINPHONE
+ hr = QEventDispatcherWinRT::runOnXamlThread([picker]() {
+ HRESULT hr;
+ ComPtr<IFolderPicker2> picker2;
+ hr = picker->QueryInterface(IID_PPV_ARGS(picker2.GetAddressOf()));
+ RETURN_HR_IF_FAILED("Failed to cast folder picker");
+ return picker2->PickFolderAndContinue();
+ });
+ RETURN_FALSE_IF_FAILED("Failed to open folder picker");
+ QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
+ Q_ASSERT(eventDispatcher);
+ eventDispatcher->installEventFilter(helper);
+#else
+ hr = QEventDispatcherWinRT::runOnXamlThread([picker, helper]() {
+ HRESULT hr;
+ ComPtr<IAsyncOperation<StorageFolder *>> op;
+ hr = picker->PickSingleFolderAsync(&op);
+ RETURN_HR_IF_FAILED("Failed to open folder picker");
+ hr = op->put_Completed(Callback<SingleFolderHandler>(helper, &QWinRTFileDialogHelper::onSingleFolderPicked).Get());
+ RETURN_HR_IF_FAILED("Failed to attach folder picker callback");
+ return S_OK;
+ });
+#endif
+ return SUCCEEDED(hr);
+}
+
+static bool pickSaveFile(IFileSavePicker *picker, QWinRTFileDialogHelper *helper)
+{
+ Q_ASSERT(picker);
+ Q_ASSERT(helper);
+ HRESULT hr;
+#ifdef Q_OS_WINPHONE
+ hr = QEventDispatcherWinRT::runOnXamlThread([picker]() {
+ HRESULT hr;
+ ComPtr<IFileSavePicker2> picker2;
+ hr = picker->QueryInterface(IID_PPV_ARGS(picker2.GetAddressOf()));
+ RETURN_HR_IF_FAILED("Failed to cast save file picker");
+ return picker2->PickSaveFileAndContinue();
+ });
+ RETURN_FALSE_IF_FAILED("Failed to open single file picker");
+ QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
+ Q_ASSERT(eventDispatcher);
+ eventDispatcher->installEventFilter(helper);
+#else
+ hr = QEventDispatcherWinRT::runOnXamlThread([picker, helper]() {
+ HRESULT hr;
+ ComPtr<IAsyncOperation<StorageFile *>> op;
+ hr = picker->PickSaveFileAsync(&op);
+ RETURN_HR_IF_FAILED("Failed to open save file picker");
+ hr = op->put_Completed(Callback<SingleFileHandler>(helper, &QWinRTFileDialogHelper::onSingleFilePicked).Get());
+ RETURN_HR_IF_FAILED("Failed to attach save file picker callback");
+ return S_OK;
+ });
+#endif
+ return SUCCEEDED(hr);
+}
+
class QWinRTFileDialogHelperPrivate
{
public:
@@ -260,18 +382,9 @@ bool QWinRTFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit
if (!initializeOpenPickerOptions(picker.Get(), dialogOptions))
return false;
- if (dialogOptions->fileMode() == QFileDialogOptions::ExistingFiles) {
- ComPtr<IAsyncOperation<IVectorView<StorageFile *> *>> op;
- hr = picker->PickMultipleFilesAsync(&op);
- RETURN_FALSE_IF_FAILED("Failed to open multi file picker");
- hr = op->put_Completed(Callback<MultipleFileHandler>(this, &QWinRTFileDialogHelper::onMultipleFilesPicked).Get());
- } else {
- ComPtr<IAsyncOperation<StorageFile *>> op;
- hr = picker->PickSingleFileAsync(&op);
- RETURN_FALSE_IF_FAILED("Failed to open single file picker");
- hr = op->put_Completed(Callback<SingleFileHandler>(this, &QWinRTFileDialogHelper::onSingleFilePicked).Get());
- }
- RETURN_FALSE_IF_FAILED("Failed to attach file picker callback");
+ if (!pickFiles(picker.Get(), this, dialogOptions->fileMode() == QFileDialogOptions::ExistingFile))
+ return false;
+
break;
}
case QFileDialogOptions::Directory:
@@ -284,11 +397,9 @@ bool QWinRTFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit
if (!initializeOpenPickerOptions(picker.Get(), dialogOptions))
return false;
- ComPtr<IAsyncOperation<StorageFolder *>> op;
- hr = picker->PickSingleFolderAsync(&op);
- RETURN_FALSE_IF_FAILED("Failed to open folder picker");
- hr = op->put_Completed(Callback<SingleFolderHandler>(this, &QWinRTFileDialogHelper::onSingleFolderPicked).Get());
- RETURN_FALSE_IF_FAILED("Failed to attach folder picker callback");
+ if (!pickFolder(picker.Get(), this))
+ return false;
+
break;
}
}
@@ -324,16 +435,23 @@ bool QWinRTFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit
filterTitle.length());
boolean replaced;
hr = choices->Insert(namedFilterRef.Get(), entry.Get(), &replaced);
- RETURN_FALSE_IF_FAILED("Failed to insert file extension choice entry");
+ // Only print a warning as * or *.* is not a valid choice on Windows 10
+ // but used on a regular basis on all other platforms
+ if (FAILED(hr)) {
+ qWarning("Failed to insert file extension choice entry: %s: %s",
+ qPrintable(filterTitle), qPrintable(qt_error_string(hr)));
+ }
}
}
- const QString suffix = dialogOptions->defaultSuffix();
+ QString suffix = dialogOptions->defaultSuffix();
if (!suffix.isEmpty()) {
+ if (!suffix.startsWith(QLatin1Char('.')))
+ suffix.prepend(QLatin1Char('.'));
HStringReference nativeSuffix(reinterpret_cast<const wchar_t *>(suffix.utf16()),
suffix.length());
hr = picker->put_DefaultFileExtension(nativeSuffix.Get());
- RETURN_FALSE_IF_FAILED("Failed to set default file extension");
+ RETURN_FALSE_IF_FAILED_WITH_ARGS("Failed to set default file extension \"%s\"", qPrintable(suffix));
}
const QString suggestedName = QFileInfo(d->saveFileName.toLocalFile()).fileName();
@@ -344,11 +462,9 @@ bool QWinRTFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit
RETURN_FALSE_IF_FAILED("Failed to set suggested file name");
}
- ComPtr<IAsyncOperation<StorageFile *>> op;
- hr = picker->PickSaveFileAsync(&op);
- RETURN_FALSE_IF_FAILED("Failed to open save file picker");
- hr = op->put_Completed(Callback<SingleFileHandler>(this, &QWinRTFileDialogHelper::onSingleFilePicked).Get());
- RETURN_FALSE_IF_FAILED("Failed to attach file picker callback");
+ if (!pickSaveFile(picker.Get(), this))
+ return false;
+
break;
}
}
@@ -367,6 +483,68 @@ void QWinRTFileDialogHelper::hide()
d->shown = false;
}
+#ifdef Q_OS_WINPHONE
+bool QWinRTFileDialogHelper::eventFilter(QObject *, QEvent *e)
+{
+ if (e->type() != QEvent::WinEventAct)
+ return false;
+
+ HRESULT hr;
+ QActivationEvent *event = static_cast<QActivationEvent *>(e);
+ ComPtr<IInspectable> inspectable = event->args();
+ ComPtr<IActivatedEventArgs> arguments;
+ hr = inspectable.As(&arguments);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ ActivationKind activationKind;
+ hr = arguments->get_Kind(&activationKind);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ // Handle only File, Folder and Save file pick continuation here.
+ if (activationKind != ActivationKind_PickFileContinuation
+ && activationKind != ActivationKind_PickFolderContinuation
+ && activationKind != ActivationKind_PickSaveFileContinuation) {
+ return false;
+ }
+
+ QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
+ Q_ASSERT(eventDispatcher);
+ eventDispatcher->removeEventFilter(this);
+ e->accept();
+
+ if (activationKind == ActivationKind_PickFileContinuation) {
+ ComPtr<IFileOpenPickerContinuationEventArgs> fileContinuationArgs;
+ hr = arguments.As(&fileContinuationArgs);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IVectorView<StorageFile *>> files;
+ hr = fileContinuationArgs->get_Files(&files);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = onFilesPicked(files.Get());
+ Q_ASSERT_SUCCEEDED(hr);
+ } else if (activationKind == ActivationKind_PickFolderContinuation) {
+ ComPtr<IFolderPickerContinuationEventArgs> folderContinuationArgs;
+ hr = arguments.As(&folderContinuationArgs);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IStorageFolder> folder;
+ hr = folderContinuationArgs->get_Folder(&folder);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = onFolderPicked(folder.Get());
+ Q_ASSERT_SUCCEEDED(hr);
+ } else {
+ ComPtr<IFileSavePickerContinuationEventArgs> saveFileContinuationArgs;
+ hr = arguments.As(&saveFileContinuationArgs);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IStorageFile> file;
+ hr = saveFileContinuationArgs->get_File(&file);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = onFilePicked(file.Get());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+
+ return true;
+}
+#endif
+
void QWinRTFileDialogHelper::setDirectory(const QUrl &directory)
{
Q_D(QWinRTFileDialogHelper);
@@ -403,6 +581,7 @@ QString QWinRTFileDialogHelper::selectedNameFilter() const
return d->selectedNameFilter;
}
+#ifndef Q_OS_WINPHONE
HRESULT QWinRTFileDialogHelper::onSingleFilePicked(IAsyncOperation<StorageFile *> *args, AsyncStatus status)
{
Q_D(QWinRTFileDialogHelper);
@@ -419,14 +598,7 @@ HRESULT QWinRTFileDialogHelper::onSingleFilePicked(IAsyncOperation<StorageFile *
ComPtr<IStorageFile> file;
hr = args->GetResults(&file);
Q_ASSERT_SUCCEEDED(hr);
- if (!file) {
- emit reject();
- return S_OK;
- }
-
- appendFile(file.Get());
- emit accept();
- return S_OK;
+ return onFilePicked(file.Get());
}
HRESULT QWinRTFileDialogHelper::onMultipleFilesPicked(IAsyncOperation<IVectorView<StorageFile *> *> *args, AsyncStatus status)
@@ -445,17 +617,50 @@ HRESULT QWinRTFileDialogHelper::onMultipleFilesPicked(IAsyncOperation<IVectorVie
ComPtr<IVectorView<StorageFile *>> fileList;
hr = args->GetResults(&fileList);
RETURN_HR_IF_FAILED("Failed to get file list");
+ return onFilesPicked(fileList.Get());
+}
+HRESULT QWinRTFileDialogHelper::onSingleFolderPicked(IAsyncOperation<StorageFolder *> *args, AsyncStatus status)
+{
+ Q_D(QWinRTFileDialogHelper);
+
+ QEventLoopLocker locker(&d->loop);
+ d->shown = false;
+ d->selectedFiles.clear();
+ if (status == Canceled || status == Error) {
+ emit reject();
+ return S_OK;
+ }
+
+ HRESULT hr;
+ ComPtr<IStorageFolder> folder;
+ hr = args->GetResults(&folder);
+ Q_ASSERT_SUCCEEDED(hr);
+ return onFolderPicked(folder.Get());
+}
+#endif //Q_OS_WINPHONE
+
+HRESULT QWinRTFileDialogHelper::onFilesPicked(IVectorView<StorageFile *> *files)
+{
+#ifdef Q_OS_WINPHONE
+ Q_D(QWinRTFileDialogHelper);
+ QEventLoopLocker locker(&d->loop);
+ d->shown = false;
+ d->selectedFiles.clear();
+#endif
+
+ HRESULT hr;
quint32 size;
- hr = fileList->get_Size(&size);
+ hr = files->get_Size(&size);
Q_ASSERT_SUCCEEDED(hr);
if (!size) {
emit reject();
return S_OK;
}
+
for (quint32 i = 0; i < size; ++i) {
ComPtr<IStorageFile> file;
- hr = fileList->GetAt(i, &file);
+ hr = files->GetAt(i, &file);
Q_ASSERT_SUCCEEDED(hr);
appendFile(file.Get());
}
@@ -464,28 +669,40 @@ HRESULT QWinRTFileDialogHelper::onMultipleFilesPicked(IAsyncOperation<IVectorVie
return S_OK;
}
-HRESULT QWinRTFileDialogHelper::onSingleFolderPicked(IAsyncOperation<StorageFolder *> *args, AsyncStatus status)
+HRESULT QWinRTFileDialogHelper::onFolderPicked(IStorageFolder *folder)
{
+#ifdef Q_OS_WINPHONE
Q_D(QWinRTFileDialogHelper);
-
QEventLoopLocker locker(&d->loop);
d->shown = false;
d->selectedFiles.clear();
- if (status == Canceled || status == Error) {
+#endif
+
+ if (!folder) {
emit reject();
return S_OK;
}
- HRESULT hr;
- ComPtr<IStorageFolder> folder;
- hr = args->GetResults(&folder);
- Q_ASSERT_SUCCEEDED(hr);
- if (!folder) {
+ appendFile(folder);
+ emit accept();
+ return S_OK;
+}
+
+HRESULT QWinRTFileDialogHelper::onFilePicked(IStorageFile *file)
+{
+#ifdef Q_OS_WINPHONE
+ Q_D(QWinRTFileDialogHelper);
+ QEventLoopLocker locker(&d->loop);
+ d->shown = false;
+ d->selectedFiles.clear();
+#endif
+
+ if (!file) {
emit reject();
return S_OK;
}
- appendFile(folder.Get());
+ appendFile(file);
emit accept();
return S_OK;
}
diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h
index 51b79c84ef..d6bacd2db9 100644
--- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h
+++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h
@@ -47,6 +47,7 @@ namespace ABI {
class StorageFile;
class StorageFolder;
struct IStorageFile;
+ struct IStorageFolder;
}
namespace Foundation {
enum class AsyncStatus;
@@ -71,6 +72,9 @@ public:
void exec() Q_DECL_OVERRIDE;
bool show(Qt::WindowFlags, Qt::WindowModality, QWindow *) Q_DECL_OVERRIDE;
void hide() Q_DECL_OVERRIDE;
+#ifdef Q_OS_WINPHONE
+ bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
+#endif
bool defaultNameFilterDisables() const Q_DECL_OVERRIDE { return false; }
void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE;
@@ -81,13 +85,19 @@ public:
void selectNameFilter(const QString &selectedNameFilter) Q_DECL_OVERRIDE;
QString selectedNameFilter() const;
-private:
+#ifndef Q_OS_WINPHONE
HRESULT onSingleFilePicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Storage::StorageFile *> *,
ABI::Windows::Foundation::AsyncStatus);
HRESULT onMultipleFilesPicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Foundation::Collections::IVectorView<ABI::Windows::Storage::StorageFile *> *> *,
ABI::Windows::Foundation::AsyncStatus);
HRESULT onSingleFolderPicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Storage::StorageFolder *> *,
ABI::Windows::Foundation::AsyncStatus);
+#endif
+
+private:
+ HRESULT onFilesPicked(ABI::Windows::Foundation::Collections::IVectorView<ABI::Windows::Storage::StorageFile *> *files);
+ HRESULT onFolderPicked(ABI::Windows::Storage::IStorageFolder *folder);
+ HRESULT onFilePicked(ABI::Windows::Storage::IStorageFile *file);
void appendFile(IInspectable *);
QScopedPointer<QWinRTFileDialogHelperPrivate> d_ptr;
diff --git a/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp b/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp
index 09edea52e7..793256a83f 100644
--- a/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp
@@ -39,13 +39,11 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
-#ifdef QT_WINRT_USE_DWRITE
#include <QtCore/QUuid>
#include <QtGui/private/qfontengine_ft_p.h>
#include <dwrite_1.h>
#include <wrl.h>
using namespace Microsoft::WRL;
-#endif // QT_WINRT_USE_DWRITE
QT_BEGIN_NAMESPACE
@@ -122,9 +120,7 @@ QString QWinRTFontDatabase::fontDir() const
const QString applicationDirPath = QCoreApplication::applicationDirPath();
fontDirectory = applicationDirPath + QLatin1String("/fonts");
if (!QFile::exists(fontDirectory)) {
-#ifdef QT_WINRT_USE_DWRITE
if (m_fontFamilies.isEmpty())
-#endif
qWarning("No fonts directory found in application package.");
fontDirectory = applicationDirPath;
}
@@ -132,8 +128,6 @@ QString QWinRTFontDatabase::fontDir() const
return fontDirectory;
}
-#ifdef QT_WINRT_USE_DWRITE
-
QWinRTFontDatabase::~QWinRTFontDatabase()
{
foreach (IDWriteFontFile *fontFile, m_fonts.keys())
@@ -434,6 +428,21 @@ QFontEngine *QWinRTFontDatabase::fontEngine(const QFontDef &fontDef, void *handl
return engine;
}
+QStringList QWinRTFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style,
+ QFont::StyleHint styleHint,
+ QChar::Script script) const
+{
+ Q_UNUSED(style)
+ Q_UNUSED(styleHint)
+ Q_UNUSED(script)
+
+ QStringList result;
+ if (family == QLatin1String("Helvetica"))
+ result.append(QStringLiteral("Arial"));
+ result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
+ return result;
+}
+
void QWinRTFontDatabase::releaseHandle(void *handle)
{
if (!handle)
@@ -449,13 +458,4 @@ void QWinRTFontDatabase::releaseHandle(void *handle)
QBasicFontDatabase::releaseHandle(handle);
}
-#else // QT_WINRT_USE_DWRITE
-
-QFont QWinRTFontDatabase::defaultFont() const
-{
- return QFont(QFontDatabase().families().value(0));
-}
-
-#endif // !QT_WINRT_USE_DWRITE
-
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtfontdatabase.h b/src/plugins/platforms/winrt/qwinrtfontdatabase.h
index 7b3f402c13..41619f5bd8 100644
--- a/src/plugins/platforms/winrt/qwinrtfontdatabase.h
+++ b/src/plugins/platforms/winrt/qwinrtfontdatabase.h
@@ -39,37 +39,33 @@
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
-#ifdef QT_WINRT_USE_DWRITE
struct IDWriteFontFile;
struct IDWriteFontFamily;
-#endif
QT_BEGIN_NAMESPACE
-#ifdef QT_WINRT_USE_DWRITE
struct FontDescription
{
quint32 index;
QByteArray uuid;
};
-#endif
class QWinRTFontDatabase : public QBasicFontDatabase
{
public:
QString fontDir() const;
-#ifdef QT_WINRT_USE_DWRITE
~QWinRTFontDatabase();
QFont defaultFont() const Q_DECL_OVERRIDE;
bool fontsAlwaysScalable() const Q_DECL_OVERRIDE;
void populateFontDatabase() Q_DECL_OVERRIDE;
void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style,
+ QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
void releaseHandle(void *handle) Q_DECL_OVERRIDE;
private:
QHash<IDWriteFontFile *, FontDescription> m_fonts;
QHash<QString, IDWriteFontFamily *> m_fontFamilies;
-#endif // QT_WINRT_USE_DWRITE
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
index c94b53ef1c..a0474b6710 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
@@ -37,7 +37,9 @@
#include "qwinrtinputcontext.h"
#include "qwinrtscreen.h"
#include <QtGui/QWindow>
+#include <private/qeventdispatcher_winrt_p.h>
+#include <functional>
#include <wrl.h>
#include <roapi.h>
#include <windows.ui.viewmanagement.h>
@@ -52,6 +54,14 @@ typedef ITypedEventHandler<InputPane*, InputPaneVisibilityEventArgs*> InputPaneV
QT_BEGIN_NAMESPACE
+inline QRectF getInputPaneRect(IInputPane *pane, qreal scaleFactor)
+{
+ Rect rect;
+ pane->get_OccludedRect(&rect);
+ return QRectF(qRound(rect.X * scaleFactor), qRound(rect.Y * scaleFactor),
+ qRound(rect.Width * scaleFactor), qRound(rect.Height * scaleFactor));
+}
+
/*!
\class QWinRTInputContext
\brief Manages Input Method visibility
@@ -71,7 +81,7 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen)
IInputPaneStatics *statics;
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_InputPane).Get(),
&statics))) {
- qWarning(Q_FUNC_INFO ": failed to retrieve input pane statics.");
+ qWarning("failed to retrieve input pane statics.");
return;
}
@@ -85,10 +95,10 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen)
inputPane->add_Hiding(Callback<InputPaneVisibilityHandler>(
this, &QWinRTInputContext::onHiding).Get(), &hideToken);
- handleVisibilityChange(inputPane);
+ m_keyboardRect = getInputPaneRect(inputPane, m_screen->scaleFactor());
m_isInputPanelVisible = !m_keyboardRect.isEmpty();
} else {
- qWarning(Q_FUNC_INFO ": failed to retrieve InputPane.");
+ qWarning("failed to retrieve InputPane.");
}
}
@@ -118,10 +128,7 @@ HRESULT QWinRTInputContext::onHiding(IInputPane *pane, IInputPaneVisibilityEvent
HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane)
{
- Rect rect;
- pane->get_OccludedRect(&rect);
- const QRectF keyboardRect = QRectF(qRound(rect.X * m_screen->scaleFactor()), qRound(rect.Y * m_screen->scaleFactor()),
- qRound(rect.Width * m_screen->scaleFactor()), qRound(rect.Height * m_screen->scaleFactor()));
+ const QRectF keyboardRect = getInputPaneRect(pane, m_screen->scaleFactor());
if (m_keyboardRect != keyboardRect) {
m_keyboardRect = keyboardRect;
emitKeyboardRectChanged();
@@ -129,7 +136,7 @@ HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane)
return S_OK;
}
-#ifdef Q_OS_WINPHONE
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
static HRESULT getInputPane(ComPtr<IInputPane2> *inputPane2)
{
@@ -158,159 +165,34 @@ static HRESULT getInputPane(ComPtr<IInputPane2> *inputPane2)
void QWinRTInputContext::showInputPanel()
{
- ComPtr<IInputPane2> inputPane;
- HRESULT hr = getInputPane(&inputPane);
- if (FAILED(hr))
- return;
-
- boolean success;
- hr = inputPane->TryShow(&success);
- if (FAILED(hr))
- qErrnoWarning(hr, "Failed to show input panel.");
+ QEventDispatcherWinRT::runOnXamlThread([&]() {
+ ComPtr<IInputPane2> inputPane;
+ HRESULT hr = getInputPane(&inputPane);
+ if (FAILED(hr))
+ return hr;
+ boolean success;
+ hr = inputPane->TryShow(&success);
+ if (FAILED(hr) || !success)
+ qErrnoWarning(hr, "Failed to show input panel.");
+ return hr;
+ });
}
void QWinRTInputContext::hideInputPanel()
{
- ComPtr<IInputPane2> inputPane;
- HRESULT hr = getInputPane(&inputPane);
- if (FAILED(hr))
- return;
-
- boolean success;
- hr = inputPane->TryHide(&success);
- if (FAILED(hr))
- qErrnoWarning(hr, "Failed to hide input panel.");
-}
-
-#else // Q_OS_WINPHONE
-
-// IRawElementProviderSimple
-HRESULT QWinRTInputContext::get_ProviderOptions(ProviderOptions *retVal)
-{
- *retVal = ProviderOptions_ServerSideProvider|ProviderOptions_UseComThreading;
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::GetPatternProvider(PATTERNID id, IUnknown **retVal)
-{
- switch (id) {
- case 10002: //UIA_ValuePatternId
- return QueryInterface(__uuidof(IValueProvider), (void**)retVal);
- break;
- case 10014: //UIA_TextPatternId:
- return QueryInterface(__uuidof(ITextProvider), (void**)retVal);
- case 10029: //UIA_TextChildPatternId:
- *retVal = nullptr;
- break;
- default:
- qWarning("Unhandled pattern ID: %d", id);
- break;
- }
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::GetPropertyValue(PROPERTYID idProp, VARIANT *retVal)
-{
- switch (idProp) {
- case 30003: //UIA_ControlTypePropertyId
- retVal->vt = VT_I4;
- retVal->lVal = 50025; //UIA_CustomControlTypeId
- break;
- case 30008: //UIA_IsKeyboardFocusablePropertyId
- case 30009: //UIA_HasKeyboardFocusPropertyId
- // These are probably never actually called
- case 30016: //UIA_IsControlElementPropertyId
- case 30017: //UIA_IsContentElementPropertyId
- retVal->vt = VT_BOOL;
- retVal->boolVal = VARIANT_TRUE;
- break;
- case 30019: //UIA_IsPasswordPropertyId
- retVal->vt = VT_BOOL;
- retVal->boolVal = VARIANT_FALSE;
- break;
- case 30020: //UIA_NativeWindowHandlePropertyId
- retVal->vt = VT_PTR;
- retVal->punkVal = m_screen->coreWindow();
- break;
- }
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::get_HostRawElementProvider(IRawElementProviderSimple **retVal)
-{
- // Return the window's element provider
- IInspectable *hostProvider;
- HRESULT hr = m_screen->coreWindow()->get_AutomationHostProvider(&hostProvider);
- if (SUCCEEDED(hr)) {
- hr = hostProvider->QueryInterface(IID_PPV_ARGS(retVal));
- hostProvider->Release();
- }
- return hr;
-}
-
-// ITextProvider
-HRESULT QWinRTInputContext::GetSelection(SAFEARRAY **)
-{
- // To be useful, requires listening to the focus object for a selection change and raising an event
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::GetVisibleRanges(SAFEARRAY **)
-{
- // To be useful, requires listening to the focus object for a selection change and raising an event
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::RangeFromChild(IRawElementProviderSimple *,ITextRangeProvider **)
-{
- // To be useful, requires listening to the focus object for a selection change and raising an event
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::RangeFromPoint(UiaPoint, ITextRangeProvider **)
-{
- // To be useful, requires listening to the focus object for a selection change and raising an event
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::get_DocumentRange(ITextRangeProvider **)
-{
- // To be useful, requires listening to the focus object for a selection change and raising an event
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::get_SupportedTextSelection(SupportedTextSelection *)
-{
- // To be useful, requires listening to the focus object for a selection change and raising an event
- return S_OK;
-}
-
-// IValueProvider
-HRESULT QWinRTInputContext::SetValue(LPCWSTR)
-{
- // To be useful, requires listening to the focus object for a value change and raising an event
- // May be useful for inputPanel autocomplete, etc.
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::get_Value(BSTR *)
-{
- // To be useful, requires listening to the focus object for a value change and raising an event
- // May be useful for inputPanel autocomplete, etc.
- return S_OK;
-}
-
-HRESULT QWinRTInputContext::get_IsReadOnly(BOOL *isReadOnly)
-{
- // isReadOnly dictates keyboard opening behavior when view is tapped.
- // We need to decide if the user tapped within a control which is about to receive focus...
- // Since this isn't possible (this function gets called before we receive the touch event),
- // the most platform-aligned option is to show the keyboard if an editable item has focus,
- // and close the keyboard if it is already open.
- *isReadOnly = m_isInputPanelVisible || !inputMethodAccepted();
- return S_OK;
+ QEventDispatcherWinRT::runOnXamlThread([&]() {
+ ComPtr<IInputPane2> inputPane;
+ HRESULT hr = getInputPane(&inputPane);
+ if (FAILED(hr))
+ return hr;
+ boolean success;
+ hr = inputPane->TryHide(&success);
+ if (FAILED(hr) || !success)
+ qErrnoWarning(hr, "Failed to hide input panel.");
+ return hr;
+ });
}
-#endif // !Q_OS_WINPHONE
+#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.h b/src/plugins/platforms/winrt/qwinrtinputcontext.h
index ce7fbabf49..6f88ff46e6 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.h
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.h
@@ -41,9 +41,6 @@
#include <QtCore/QRectF>
#include <wrl.h>
-#ifndef Q_OS_WINPHONE
-# include <UIAutomationCore.h>
-#endif
namespace ABI {
namespace Windows {
@@ -63,11 +60,6 @@ QT_BEGIN_NAMESPACE
class QWinRTScreen;
class QWinRTInputContext : public QPlatformInputContext
-#ifndef Q_OS_WINPHONE
- , public Microsoft::WRL::RuntimeClass<
- Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix>,
- IRawElementProviderSimple, ITextProvider, IValueProvider>
-#endif // !Q_OS_WINPHONE
{
public:
explicit QWinRTInputContext(QWinRTScreen *);
@@ -76,29 +68,10 @@ public:
bool isInputPanelVisible() const;
-#ifdef Q_OS_WINPHONE
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
void showInputPanel();
void hideInputPanel();
-#else // Q_OS_WINPHONE
- // IRawElementProviderSimple
- HRESULT __stdcall get_ProviderOptions(ProviderOptions *retVal);
- HRESULT __stdcall GetPatternProvider(PATTERNID, IUnknown **);
- HRESULT __stdcall GetPropertyValue(PROPERTYID idProp, VARIANT *retVal);
- HRESULT __stdcall get_HostRawElementProvider(IRawElementProviderSimple **retVal);
-
- // ITextProvider
- HRESULT __stdcall GetSelection(SAFEARRAY **);
- HRESULT __stdcall GetVisibleRanges(SAFEARRAY **);
- HRESULT __stdcall RangeFromChild(IRawElementProviderSimple *,ITextRangeProvider **);
- HRESULT __stdcall RangeFromPoint(UiaPoint, ITextRangeProvider **);
- HRESULT __stdcall get_DocumentRange(ITextRangeProvider **);
- HRESULT __stdcall get_SupportedTextSelection(SupportedTextSelection *);
-
- // IValueProvider
- HRESULT __stdcall SetValue(LPCWSTR);
- HRESULT __stdcall get_Value(BSTR *);
- HRESULT __stdcall get_IsReadOnly(BOOL *);
-#endif // !Q_OS_WINPHONE
+#endif
private:
HRESULT onShowing(ABI::Windows::UI::ViewManagement::IInputPane *,
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp
index 70ee6dbe6a..2281bf56cc 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.cpp
+++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp
@@ -45,51 +45,213 @@
#include "qwinrtfontdatabase.h"
#include "qwinrttheme.h"
+#include <QtGui/QSurface>
#include <QtGui/QOpenGLContext>
+#include <qfunctions_winrt.h>
+#include <qpa/qplatformoffscreensurface.h>
+
+#include <functional>
#include <wrl.h>
+#include <windows.ui.xaml.h>
+#include <windows.applicationmodel.h>
+#include <windows.applicationmodel.core.h>
#include <windows.ui.core.h>
#include <windows.ui.viewmanagement.h>
-#include <Windows.ApplicationModel.core.h>
+#include <windows.graphics.display.h>
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+# include <windows.phone.ui.input.h>
+# if _MSC_VER >= 1900
+# include <windows.foundation.metadata.h>
+ using namespace ABI::Windows::Foundation::Metadata;
+# endif
+#endif
+
using namespace Microsoft::WRL;
+using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
+using namespace ABI::Windows::ApplicationModel;
+using namespace ABI::Windows::ApplicationModel::Core;
+using namespace ABI::Windows::UI;
using namespace ABI::Windows::UI::Core;
using namespace ABI::Windows::UI::ViewManagement;
+using namespace ABI::Windows::Graphics::Display;
using namespace ABI::Windows::ApplicationModel::Core;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+using namespace ABI::Windows::Phone::UI::Input;
+#endif
+
+typedef IEventHandler<IInspectable *> ResumeHandler;
+typedef IEventHandler<SuspendingEventArgs *> SuspendHandler;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+typedef IEventHandler<BackPressedEventArgs*> BackPressedHandler;
+typedef IEventHandler<CameraEventArgs*> CameraButtonHandler;
+#endif
QT_BEGIN_NAMESPACE
-QWinRTIntegration::QWinRTIntegration()
- : m_success(false)
- , m_fontDatabase(new QWinRTFontDatabase)
- , m_services(new QWinRTServices)
+typedef HRESULT (__stdcall ICoreApplication::*CoreApplicationCallbackRemover)(EventRegistrationToken);
+uint qHash(CoreApplicationCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+typedef HRESULT (__stdcall IHardwareButtonsStatics::*HardwareButtonsCallbackRemover)(EventRegistrationToken);
+uint qHash(HardwareButtonsCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
+typedef HRESULT (__stdcall IHardwareButtonsStatics2::*HardwareButtons2CallbackRemover)(EventRegistrationToken);
+uint qHash(HardwareButtons2CallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
+#endif
+
+class QWinRTIntegrationPrivate
+{
+public:
+ QPlatformFontDatabase *fontDatabase;
+ QPlatformServices *platformServices;
+ QWinRTScreen *mainScreen;
+ QScopedPointer<QWinRTInputContext> inputContext;
+
+ ComPtr<ICoreApplication> application;
+ QHash<CoreApplicationCallbackRemover, EventRegistrationToken> applicationTokens;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ ComPtr<IHardwareButtonsStatics> hardwareButtons;
+ QHash<HardwareButtonsCallbackRemover, EventRegistrationToken> buttonsTokens;
+ ComPtr<IHardwareButtonsStatics2> cameraButtons;
+ QHash<HardwareButtons2CallbackRemover, EventRegistrationToken> cameraTokens;
+ boolean hasHardwareButtons;
+ bool cameraHalfPressed : 1;
+ bool cameraPressed : 1;
+#endif
+};
+
+QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
{
- m_screen = new QWinRTScreen;
- screenAdded(m_screen);
+ Q_D(QWinRTIntegration);
+
+ d->fontDatabase = new QWinRTFontDatabase;
+
+ HRESULT hr;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
+ IID_PPV_ARGS(&d->application));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->application->add_Suspending(Callback<SuspendHandler>(this, &QWinRTIntegration::onSuspended).Get(),
+ &d->applicationTokens[&ICoreApplication::remove_Suspending]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->application->add_Resuming(Callback<ResumeHandler>(this, &QWinRTIntegration::onResume).Get(),
+ &d->applicationTokens[&ICoreApplication::remove_Resuming]);
+ Q_ASSERT_SUCCEEDED(hr);
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+#if _MSC_VER >= 1900
+ d->hasHardwareButtons = false;
+ ComPtr<IApiInformationStatics> apiInformationStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(),
+ IID_PPV_ARGS(&apiInformationStatics));
+
+ if (SUCCEEDED(hr)) {
+ const HStringReference valueRef(L"Windows.Phone.UI.Input.HardwareButtons");
+ hr = apiInformationStatics->IsTypePresent(valueRef.Get(), &d->hasHardwareButtons);
+ }
+#else
+ d->hasHardwareButtons = true;
+#endif // _MSC_VER >= 1900
- m_success = true;
+ if (d->hasHardwareButtons) {
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(),
+ IID_PPV_ARGS(&d->hardwareButtons));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->hardwareButtons->add_BackPressed(Callback<BackPressedHandler>(this, &QWinRTIntegration::onBackButtonPressed).Get(),
+ &d->buttonsTokens[&IHardwareButtonsStatics::remove_BackPressed]);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(),
+ IID_PPV_ARGS(&d->cameraButtons));
+ Q_ASSERT_SUCCEEDED(hr);
+ if (qEnvironmentVariableIntValue("QT_QPA_ENABLE_CAMERA_KEYS")) {
+ hr = d->cameraButtons->add_CameraPressed(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraPressed).Get(),
+ &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraPressed]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->cameraButtons->add_CameraHalfPressed(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraHalfPressed).Get(),
+ &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraHalfPressed]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->cameraButtons->add_CameraReleased(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraReleased).Get(),
+ &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraReleased]);
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ d->cameraPressed = false;
+ d->cameraHalfPressed = false;
+ }
+#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+
+
+ QEventDispatcherWinRT::runOnXamlThread([d]() {
+ d->mainScreen = new QWinRTScreen;
+ d->inputContext.reset(new QWinRTInputContext(d->mainScreen));
+ return S_OK;
+ });
+
+ screenAdded(d->mainScreen);
+ d->platformServices = new QWinRTServices;
}
QWinRTIntegration::~QWinRTIntegration()
{
+ Q_D(QWinRTIntegration);
+ HRESULT hr;
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ if (d->hasHardwareButtons) {
+ for (QHash<HardwareButtonsCallbackRemover, EventRegistrationToken>::const_iterator i = d->buttonsTokens.begin(); i != d->buttonsTokens.end(); ++i) {
+ hr = (d->hardwareButtons.Get()->*i.key())(i.value());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ for (QHash<HardwareButtons2CallbackRemover, EventRegistrationToken>::const_iterator i = d->cameraTokens.begin(); i != d->cameraTokens.end(); ++i) {
+ hr = (d->cameraButtons.Get()->*i.key())(i.value());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ }
+#endif
+ // Do not execute this on Windows Phone as the application is already
+ // shutting down and trying to unregister suspending/resume handler will
+ // cause exceptions and assert in debug mode
+#ifndef Q_OS_WINPHONE
+ for (QHash<CoreApplicationCallbackRemover, EventRegistrationToken>::const_iterator i = d->applicationTokens.begin(); i != d->applicationTokens.end(); ++i) {
+ hr = (d->application.Get()->*i.key())(i.value());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+#endif
+ destroyScreen(d->mainScreen);
Windows::Foundation::Uninitialize();
}
+bool QWinRTIntegration::succeeded() const
+{
+ Q_D(const QWinRTIntegration);
+ return d->mainScreen;
+}
+
QAbstractEventDispatcher *QWinRTIntegration::createEventDispatcher() const
{
return new QWinRTEventDispatcher;
}
+void QWinRTIntegration::initialize()
+{
+ Q_D(const QWinRTIntegration);
+ QEventDispatcherWinRT::runOnXamlThread([d]() {
+ d->mainScreen->initialize();
+ return S_OK;
+ });
+}
+
bool QWinRTIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
switch (cap) {
case ThreadedPixmaps:
case OpenGL:
case ApplicationState:
- return true;
case NonFullScreenWindows:
- return false;
+ case MultipleWindows:
+ case RasterGLSurface:
+ return true;
default:
return QPlatformIntegration::hasCapability(cap);
}
@@ -112,28 +274,31 @@ QPlatformBackingStore *QWinRTIntegration::createPlatformBackingStore(QWindow *wi
QPlatformOpenGLContext *QWinRTIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- QWinRTScreen *screen = static_cast<QWinRTScreen *>(context->screen()->handle());
- return new QWinRTEGLContext(context->format(), context->handle(), screen->eglDisplay(), screen->eglSurface(), screen->eglConfig());
+ return new QWinRTEGLContext(context);
}
QPlatformFontDatabase *QWinRTIntegration::fontDatabase() const
{
- return m_fontDatabase;
+ Q_D(const QWinRTIntegration);
+ return d->fontDatabase;
}
QPlatformInputContext *QWinRTIntegration::inputContext() const
{
- return m_screen->inputContext();
+ Q_D(const QWinRTIntegration);
+ return d->inputContext.data();
}
QPlatformServices *QWinRTIntegration::services() const
{
- return m_services;
+ Q_D(const QWinRTIntegration);
+ return d->platformServices;
}
Qt::KeyboardModifiers QWinRTIntegration::queryKeyboardModifiers() const
{
- return m_screen->keyboardModifiers();
+ Q_D(const QWinRTIntegration);
+ return d->mainScreen->keyboardModifiers();
}
QStringList QWinRTIntegration::themeNames() const
@@ -141,12 +306,91 @@ QStringList QWinRTIntegration::themeNames() const
return QStringList(QLatin1String("winrt"));
}
-QPlatformTheme *QWinRTIntegration::createPlatformTheme(const QString &
-name) const
+QPlatformTheme *QWinRTIntegration::createPlatformTheme(const QString &name) const
{
if (name == QLatin1String("winrt"))
return new QWinRTTheme();
return 0;
}
+
+// System-level integration points
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+HRESULT QWinRTIntegration::onBackButtonPressed(IInspectable *, IBackPressedEventArgs *args)
+{
+ Q_D(QWinRTIntegration);
+ QWindow *window = d->mainScreen->topWindow();
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
+ const bool pressed = QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Back, Qt::NoModifier,
+ 0, 0, 0, QString(), false, 1, false);
+ const bool released = QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Back, Qt::NoModifier,
+ 0, 0, 0, QString(), false, 1, false);
+ QWindowSystemInterface::setSynchronousWindowSystemEvents(false);
+ args->put_Handled(pressed || released);
+ return S_OK;
+}
+
+HRESULT QWinRTIntegration::onCameraPressed(IInspectable *, ICameraEventArgs *)
+{
+ Q_D(QWinRTIntegration);
+ QWindow *window = d->mainScreen->topWindow();
+ QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Camera, Qt::NoModifier,
+ 0, 0, 0, QString(), false, 1, false);
+ d->cameraPressed = true;
+ return S_OK;
+}
+
+HRESULT QWinRTIntegration::onCameraHalfPressed(IInspectable *, ICameraEventArgs *)
+{
+ Q_D(QWinRTIntegration);
+ QWindow *window = d->mainScreen->topWindow();
+ QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_CameraFocus, Qt::NoModifier,
+ 0, 0, 0, QString(), false, 1, false);
+ d->cameraHalfPressed = true;
+ return S_OK;
+}
+
+HRESULT QWinRTIntegration::onCameraReleased(IInspectable *, ICameraEventArgs *)
+{
+ Q_D(QWinRTIntegration);
+ QWindow *window = d->mainScreen->topWindow();
+ if (d->cameraHalfPressed)
+ QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_CameraFocus, Qt::NoModifier,
+ 0, 0, 0, QString(), false, 1, false);
+
+ if (d->cameraPressed)
+ QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Camera, Qt::NoModifier,
+ 0, 0, 0, QString(), false, 1, false);
+ d->cameraHalfPressed = false;
+ d->cameraPressed = false;
+ return S_OK;
+}
+#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+
+HRESULT QWinRTIntegration::onSuspended(IInspectable *, ISuspendingEventArgs *)
+{
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
+ QWindowSystemInterface::flushWindowSystemEvents();
+ return S_OK;
+}
+
+HRESULT QWinRTIntegration::onResume(IInspectable *, IInspectable *)
+{
+ // First the system invokes onResume and then changes
+ // the visibility of the screen to be active.
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationHidden);
+ return S_OK;
+}
+
+QPlatformOffscreenSurface *QWinRTIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
+{
+ // This is only used for shutdown of applications.
+ // In case we do not return an empty surface the scenegraph will try
+ // to create a new native window during application exit causing crashes
+ // or assertions.
+ return new QPlatformOffscreenSurface(surface);
+}
+
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.h b/src/plugins/platforms/winrt/qwinrtintegration.h
index bbd6c1e41b..9bf5d27973 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.h
+++ b/src/plugins/platforms/winrt/qwinrtintegration.h
@@ -39,11 +39,34 @@
#include <qpa/qplatformintegration.h>
+namespace ABI {
+ namespace Windows {
+ namespace ApplicationModel {
+ struct ISuspendingEventArgs;
+ }
+ namespace Foundation {
+ struct IAsyncAction;
+ }
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ namespace Phone {
+ namespace UI {
+ namespace Input {
+ struct IBackPressedEventArgs;
+ struct ICameraEventArgs;
+ }
+ }
+ }
+#endif
+ }
+}
+struct IAsyncInfo;
+struct IInspectable;
+
QT_BEGIN_NAMESPACE
class QAbstractEventDispatcher;
-class QWinRTScreen;
+class QWinRTIntegrationPrivate;
class QWinRTIntegration : public QPlatformIntegration
{
private:
@@ -53,29 +76,41 @@ public:
static QWinRTIntegration *create()
{
- QWinRTIntegration *integration = new QWinRTIntegration;
- return integration->m_success ? integration : 0;
+ QScopedPointer<QWinRTIntegration> integration(new QWinRTIntegration);
+ return integration->succeeded() ? integration.take() : nullptr;
}
- bool hasCapability(QPlatformIntegration::Capability cap) const;
- QVariant styleHint(StyleHint hint) const;
+ bool succeeded() const;
+
+ bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
- QPlatformWindow *createPlatformWindow(QWindow *window) const;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
- QAbstractEventDispatcher *createEventDispatcher() const;
- QPlatformFontDatabase *fontDatabase() const;
- QPlatformInputContext *inputContext() const;
- QPlatformServices *services() const;
- Qt::KeyboardModifiers queryKeyboardModifiers() const;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
+ QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ void initialize() Q_DECL_OVERRIDE;
+ QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
+ QPlatformServices *services() const Q_DECL_OVERRIDE;
+ Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE;
- QStringList themeNames() const;
- QPlatformTheme *createPlatformTheme(const QString &name) const;
+ QStringList themeNames() const Q_DECL_OVERRIDE;
+ QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
+
+ QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
private:
- bool m_success;
- QWinRTScreen *m_screen;
- QPlatformFontDatabase *m_fontDatabase;
- QPlatformServices *m_services;
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args);
+ HRESULT onCameraPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
+ HRESULT onCameraHalfPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
+ HRESULT onCameraReleased(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
+#endif
+ HRESULT onSuspended(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *);
+ HRESULT onResume(IInspectable *, IInspectable *);
+
+ QScopedPointer<QWinRTIntegrationPrivate> d_ptr;
+ Q_DECLARE_PRIVATE(QWinRTIntegration)
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp
index 4fc1fea626..bad15126d4 100644
--- a/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp
+++ b/src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp
@@ -37,8 +37,11 @@
#include "qwinrtmessagedialoghelper.h"
#include "qwinrttheme.h"
+#include <QtGui/QTextDocument>
#include <QtCore/qfunctions_winrt.h>
+#include <private/qeventdispatcher_winrt_p.h>
+#include <functional>
#include <windows.ui.popups.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
@@ -108,6 +111,10 @@ bool QWinRTMessageDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModa
const QString informativeText = options->informativeText();
const QString title = options->windowTitle();
const QString text = informativeText.isEmpty() ? options->text() : (options->text() + QLatin1Char('\n') + informativeText);
+ if (Qt::mightBeRichText(text)) {
+ qWarning("Rich text detected, defaulting to QtWidgets-based dialog.");
+ return false;
+ }
HRESULT hr;
ComPtr<IMessageDialogFactory> dialogFactory;
@@ -131,53 +138,58 @@ bool QWinRTMessageDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModa
RETURN_FALSE_IF_FAILED("Failed to create dialog");
}
- // Add Buttons
- ComPtr<IVector<IUICommand *>> dialogCommands;
- hr = dialog->get_Commands(&dialogCommands);
- RETURN_FALSE_IF_FAILED("Failed to get dialog commands");
-
- // If no button is specified we need to create one to get close notification
- int buttons = options->standardButtons();
- if (buttons == 0)
- buttons = Ok;
-
- for (int i = FirstButton; i < LastButton; i<<=1) {
- if (!(buttons & i))
- continue;
- // Add native command
- const QString label = d->theme->standardButtonText(i);
- HStringReference nativeLabel(reinterpret_cast<LPCWSTR>(label.utf16()), label.size());
- ComPtr<IUICommand> command;
- hr = commandFactory->Create(nativeLabel.Get(), &command);
- RETURN_FALSE_IF_FAILED("Failed to create message box command");
- ComPtr<IInspectable> id = Make<CommandId>(static_cast<StandardButton>(i));
- hr = command->put_Id(id.Get());
- RETURN_FALSE_IF_FAILED("Failed to set command ID");
- hr = dialogCommands->Append(command.Get());
- if (hr == E_BOUNDS) {
- qErrnoWarning(hr, "The WinRT message dialog supports a maximum of three buttons");
- continue;
- }
- RETURN_FALSE_IF_FAILED("Failed to append message box command");
- if (i == Abort || i == Cancel || i == Close) {
- quint32 size;
- hr = dialogCommands->get_Size(&size);
- RETURN_FALSE_IF_FAILED("Failed to get command list size");
- hr = dialog->put_CancelCommandIndex(size - 1);
- RETURN_FALSE_IF_FAILED("Failed to set cancel index");
+ hr = QEventDispatcherWinRT::runOnXamlThread([this, d, options, commandFactory, dialog]() {
+ HRESULT hr;
+
+ // Add Buttons
+ ComPtr<IVector<IUICommand *>> dialogCommands;
+ hr = dialog->get_Commands(&dialogCommands);
+ RETURN_HR_IF_FAILED("Failed to get dialog commands");
+
+ // If no button is specified we need to create one to get close notification
+ int buttons = options->standardButtons();
+ if (buttons == 0)
+ buttons = Ok;
+
+ for (int i = FirstButton; i < LastButton; i<<=1) {
+ if (!(buttons & i))
+ continue;
+ // Add native command
+ const QString label = d->theme->standardButtonText(i);
+ HStringReference nativeLabel(reinterpret_cast<LPCWSTR>(label.utf16()), label.size());
+ ComPtr<IUICommand> command;
+ hr = commandFactory->Create(nativeLabel.Get(), &command);
+ RETURN_HR_IF_FAILED("Failed to create message box command");
+ ComPtr<IInspectable> id = Make<CommandId>(static_cast<StandardButton>(i));
+ hr = command->put_Id(id.Get());
+ RETURN_HR_IF_FAILED("Failed to set command ID");
+ hr = dialogCommands->Append(command.Get());
+ if (hr == E_BOUNDS) {
+ qErrnoWarning(hr, "The WinRT message dialog supports a maximum of three buttons");
+ continue;
+ }
+ RETURN_HR_IF_FAILED("Failed to append message box command");
+ if (i == Abort || i == Cancel || i == Close) {
+ quint32 size;
+ hr = dialogCommands->get_Size(&size);
+ RETURN_HR_IF_FAILED("Failed to get command list size");
+ hr = dialog->put_CancelCommandIndex(size - 1);
+ RETURN_HR_IF_FAILED("Failed to set cancel index");
+ }
}
- }
-
- ComPtr<IAsyncOperation<IUICommand *>> op;
- hr = dialog->ShowAsync(&op);
- RETURN_FALSE_IF_FAILED("Failed to show dialog");
- hr = op->put_Completed(Callback<DialogCompletedHandler>(this, &QWinRTMessageDialogHelper::onCompleted).Get());
- RETURN_FALSE_IF_FAILED("Failed to set dialog callback");
-
- d->shown = true;
- hr = op.As(&d->info);
- RETURN_FALSE_IF_FAILED("Failed to acquire AsyncInfo for MessageDialog");
+ ComPtr<IAsyncOperation<IUICommand *>> op;
+ hr = dialog->ShowAsync(&op);
+ RETURN_HR_IF_FAILED("Failed to show dialog");
+ hr = op->put_Completed(Callback<DialogCompletedHandler>(this, &QWinRTMessageDialogHelper::onCompleted).Get());
+ RETURN_HR_IF_FAILED("Failed to set dialog callback");
+ d->shown = true;
+ hr = op.As(&d->info);
+ RETURN_HR_IF_FAILED("Failed to acquire AsyncInfo for MessageDialog");
+ return hr;
+ });
+
+ RETURN_FALSE_IF_FAILED("Failed to show dialog")
return true;
}
@@ -200,8 +212,7 @@ HRESULT QWinRTMessageDialogHelper::onCompleted(IAsyncOperation<IUICommand *> *as
Q_UNUSED(status);
Q_D(QWinRTMessageDialogHelper);
- if (d->loop.isRunning())
- d->loop.exit();
+ QEventLoopLocker locker(&d->loop);
d->shown = false;
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 8962332208..997aa0d86c 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -36,26 +36,18 @@
#include "qwinrtscreen.h"
-#define EGL_EGLEXT_PROTOTYPES
-#include <EGL/eglext.h>
-#include <d3d11.h>
-#include <dxgi1_2.h>
-#ifndef Q_OS_WINPHONE
-#include <dxgi1_3.h>
-#endif
-
#include "qwinrtbackingstore.h"
#include "qwinrtinputcontext.h"
#include "qwinrtcursor.h"
-#include "qwinrteglcontext.h"
+#include <private/qeventdispatcher_winrt_p.h>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QGuiApplication>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/qt_windows.h>
#include <QtCore/qfunctions_winrt.h>
+#include <functional>
#include <wrl.h>
#include <windows.system.h>
#include <Windows.Applicationmodel.h>
@@ -64,12 +56,10 @@
#include <windows.ui.h>
#include <windows.ui.core.h>
#include <windows.ui.input.h>
+#include <windows.ui.xaml.h>
#include <windows.ui.viewmanagement.h>
#include <windows.graphics.display.h>
#include <windows.foundation.h>
-#ifdef Q_OS_WINPHONE
-#include <windows.phone.ui.input.h>
-#endif
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
@@ -77,17 +67,13 @@ using namespace ABI::Windows::ApplicationModel;
using namespace ABI::Windows::ApplicationModel::Core;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::System;
+using namespace ABI::Windows::UI;
using namespace ABI::Windows::UI::Core;
using namespace ABI::Windows::UI::Input;
using namespace ABI::Windows::UI::ViewManagement;
using namespace ABI::Windows::Devices::Input;
using namespace ABI::Windows::Graphics::Display;
-#ifdef Q_OS_WINPHONE
-using namespace ABI::Windows::Phone::UI::Input;
-#endif
-typedef IEventHandler<IInspectable*> ResumeHandler;
-typedef IEventHandler<SuspendingEventArgs*> SuspendHandler;
typedef ITypedEventHandler<CoreWindow*, WindowActivatedEventArgs*> ActivatedHandler;
typedef ITypedEventHandler<CoreWindow*, CoreWindowEventArgs*> ClosedHandler;
typedef ITypedEventHandler<CoreWindow*, CharacterReceivedEventArgs*> CharacterReceivedHandler;
@@ -96,14 +82,34 @@ typedef ITypedEventHandler<CoreWindow*, KeyEventArgs*> KeyHandler;
typedef ITypedEventHandler<CoreWindow*, PointerEventArgs*> PointerHandler;
typedef ITypedEventHandler<CoreWindow*, WindowSizeChangedEventArgs*> SizeChangedHandler;
typedef ITypedEventHandler<CoreWindow*, VisibilityChangedEventArgs*> VisibilityChangedHandler;
-typedef ITypedEventHandler<CoreWindow*, AutomationProviderRequestedEventArgs*> AutomationProviderRequestedHandler;
typedef ITypedEventHandler<DisplayInformation*, IInspectable*> DisplayInformationHandler;
#ifdef Q_OS_WINPHONE
-typedef IEventHandler<BackPressedEventArgs*> BackPressedHandler;
+typedef ITypedEventHandler<StatusBar*, IInspectable*> StatusBarHandler;
#endif
QT_BEGIN_NAMESPACE
+struct KeyInfo {
+ KeyInfo()
+ : virtualKey(0)
+ {
+ }
+
+ KeyInfo(const QString &text, quint32 virtualKey)
+ : text(text)
+ , virtualKey(virtualKey)
+ {
+ }
+
+ KeyInfo(quint32 virtualKey)
+ : virtualKey(virtualKey)
+ {
+ }
+
+ QString text;
+ quint32 virtualKey;
+};
+
static inline Qt::ScreenOrientations qtOrientationsFromNative(DisplayOrientations native)
{
Qt::ScreenOrientations orientations = Qt::PrimaryOrientation;
@@ -419,34 +425,29 @@ static inline Qt::Key qKeyFromCode(quint32 code, int mods)
return static_cast<Qt::Key>(code & 0xff);
}
-typedef HRESULT (__stdcall ICoreApplication::*CoreApplicationCallbackRemover)(EventRegistrationToken);
-uint qHash(CoreApplicationCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
typedef HRESULT (__stdcall ICoreWindow::*CoreWindowCallbackRemover)(EventRegistrationToken);
uint qHash(CoreWindowCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
typedef HRESULT (__stdcall IDisplayInformation::*DisplayCallbackRemover)(EventRegistrationToken);
uint qHash(DisplayCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
#ifdef Q_OS_WINPHONE
-typedef HRESULT (__stdcall IHardwareButtonsStatics::*HardwareButtonsCallbackRemover)(EventRegistrationToken);
-uint qHash(HardwareButtonsCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
+typedef HRESULT (__stdcall IStatusBar::*StatusBarCallbackRemover)(EventRegistrationToken);
+uint qHash(StatusBarCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
#endif
class QWinRTScreenPrivate
{
public:
- ComPtr<ICoreApplication> application;
+ QTouchDevice *touchDevice;
ComPtr<ICoreWindow> coreWindow;
+ ComPtr<Xaml::IDependencyObject> canvas;
+ ComPtr<IApplicationView> view;
ComPtr<IDisplayInformation> displayInformation;
#ifdef Q_OS_WINPHONE
- ComPtr<IHardwareButtonsStatics> hardwareButtons;
+ ComPtr<IStatusBar> statusBar;
#endif
QScopedPointer<QWinRTCursor> cursor;
-#ifdef Q_OS_WINPHONE
- QScopedPointer<QWinRTInputContext> inputContext;
-#else
- ComPtr<QWinRTInputContext> inputContext;
-#endif
-
+ QHash<quint32, QWindowSystemInterface::TouchPoint> touchPoints;
QSizeF logicalSize;
QSurfaceFormat surfaceFormat;
qreal logicalDpi;
@@ -455,108 +456,43 @@ public:
Qt::ScreenOrientation nativeOrientation;
Qt::ScreenOrientation orientation;
QList<QWindow *> visibleWindows;
-#ifndef Q_OS_WINPHONE
- QHash<quint32, QPair<Qt::Key, QString>> activeKeys;
-#endif
- QTouchDevice *touchDevice;
- QHash<quint32, QWindowSystemInterface::TouchPoint> touchPoints;
-
- EGLDisplay eglDisplay;
- EGLSurface eglSurface;
- EGLConfig eglConfig;
-
- QHash<CoreApplicationCallbackRemover, EventRegistrationToken> applicationTokens;
+ QHash<Qt::Key, KeyInfo> activeKeys;
QHash<CoreWindowCallbackRemover, EventRegistrationToken> windowTokens;
QHash<DisplayCallbackRemover, EventRegistrationToken> displayTokens;
#ifdef Q_OS_WINPHONE
- QHash<HardwareButtonsCallbackRemover, EventRegistrationToken> buttonsTokens;
+ QHash<StatusBarCallbackRemover, EventRegistrationToken> statusBarTokens;
#endif
};
+// To be called from the XAML thread
QWinRTScreen::QWinRTScreen()
: d_ptr(new QWinRTScreenPrivate)
{
Q_D(QWinRTScreen);
d->orientation = Qt::PrimaryOrientation;
d->touchDevice = Q_NULLPTR;
- d->eglDisplay = EGL_NO_DISPLAY;
- // Obtain the WinRT Application, view, and window
HRESULT hr;
- hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
- IID_PPV_ARGS(&d->application));
+ ComPtr<Xaml::IWindowStatics> windowStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_Xaml_Window).Get(),
+ IID_PPV_ARGS(&windowStatics));
Q_ASSERT_SUCCEEDED(hr);
- hr = d->application->add_Suspending(Callback<SuspendHandler>(this, &QWinRTScreen::onSuspended).Get(), &d->applicationTokens[&ICoreApplication::remove_Resuming]);
+ ComPtr<Xaml::IWindow> window;
+ hr = windowStatics->get_Current(&window);
Q_ASSERT_SUCCEEDED(hr);
- hr = d->application->add_Resuming(Callback<ResumeHandler>(this, &QWinRTScreen::onResume).Get(), &d->applicationTokens[&ICoreApplication::remove_Resuming]);
+ hr = window->Activate();
Q_ASSERT_SUCCEEDED(hr);
- ComPtr<ICoreApplicationView> view;
- hr = d->application->GetCurrentView(&view);
- Q_ASSERT_SUCCEEDED(hr);
- hr = view->get_CoreWindow(&d->coreWindow);
+ hr = window->get_CoreWindow(&d->coreWindow);
Q_ASSERT_SUCCEEDED(hr);
hr = d->coreWindow->Activate();
Q_ASSERT_SUCCEEDED(hr);
-#ifdef Q_OS_WINPHONE
- d->inputContext.reset(new QWinRTInputContext(this));
-#else
- d->inputContext = Make<QWinRTInputContext>(this);
-#endif
-
Rect rect;
hr = d->coreWindow->get_Bounds(&rect);
Q_ASSERT_SUCCEEDED(hr);
d->logicalSize = QSizeF(rect.Width, rect.Height);
- d->surfaceFormat.setAlphaBufferSize(0);
- d->surfaceFormat.setRedBufferSize(8);
- d->surfaceFormat.setGreenBufferSize(8);
- d->surfaceFormat.setBlueBufferSize(8);
- d->surfaceFormat.setDepthBufferSize(24);
- d->surfaceFormat.setStencilBufferSize(8);
- d->surfaceFormat.setRenderableType(QSurfaceFormat::OpenGLES);
- d->surfaceFormat.setSamples(1);
- d->surfaceFormat.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
-
- hr = d->coreWindow->add_KeyDown(Callback<KeyHandler>(this, &QWinRTScreen::onKeyDown).Get(), &d->windowTokens[&ICoreWindow::remove_KeyDown]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_KeyUp(Callback<KeyHandler>(this, &QWinRTScreen::onKeyUp).Get(), &d->windowTokens[&ICoreWindow::remove_KeyUp]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_CharacterReceived(Callback<CharacterReceivedHandler>(this, &QWinRTScreen::onCharacterReceived).Get(), &d->windowTokens[&ICoreWindow::remove_CharacterReceived]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_PointerEntered(Callback<PointerHandler>(this, &QWinRTScreen::onPointerEntered).Get(), &d->windowTokens[&ICoreWindow::remove_PointerEntered]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_PointerExited(Callback<PointerHandler>(this, &QWinRTScreen::onPointerExited).Get(), &d->windowTokens[&ICoreWindow::remove_PointerExited]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_PointerMoved(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerMoved]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_PointerPressed(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerPressed]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_PointerReleased(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerReleased]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_PointerWheelChanged(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerWheelChanged]);
- Q_ASSERT_SUCCEEDED(hr);
-#ifndef Q_OS_WINPHONE
- hr = d->coreWindow->add_SizeChanged(Callback<SizeChangedHandler>(this, &QWinRTScreen::onSizeChanged).Get(), &d->windowTokens[&ICoreWindow::remove_SizeChanged]);
- Q_ASSERT_SUCCEEDED(hr);
-#endif
- hr = d->coreWindow->add_Activated(Callback<ActivatedHandler>(this, &QWinRTScreen::onActivated).Get(), &d->windowTokens[&ICoreWindow::remove_Activated]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_Closed(Callback<ClosedHandler>(this, &QWinRTScreen::onClosed).Get(), &d->windowTokens[&ICoreWindow::remove_Closed]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_VisibilityChanged(Callback<VisibilityChangedHandler>(this, &QWinRTScreen::onVisibilityChanged).Get(), &d->windowTokens[&ICoreWindow::remove_VisibilityChanged]);
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->coreWindow->add_AutomationProviderRequested(Callback<AutomationProviderRequestedHandler>(this, &QWinRTScreen::onAutomationProviderRequested).Get(), &d->windowTokens[&ICoreWindow::remove_AutomationProviderRequested]);
- Q_ASSERT_SUCCEEDED(hr);
-#ifdef Q_OS_WINPHONE
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(), IID_PPV_ARGS(&d->hardwareButtons));
- Q_ASSERT_SUCCEEDED(hr);
- hr = d->hardwareButtons->add_BackPressed(Callback<BackPressedHandler>(this, &QWinRTScreen::onBackButtonPressed).Get(), &d->buttonsTokens[&IHardwareButtonsStatics::remove_BackPressed]);
- Q_ASSERT_SUCCEEDED(hr);
-#endif // Q_OS_WINPHONE
-
// Orientation handling
ComPtr<IDisplayInformationStatics> displayInformationStatics;
hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Graphics_Display_DisplayInformation).Get(),
@@ -571,57 +507,47 @@ QWinRTScreen::QWinRTScreen()
hr = d->displayInformation->get_NativeOrientation(&displayOrientation);
Q_ASSERT_SUCCEEDED(hr);
d->nativeOrientation = static_cast<Qt::ScreenOrientation>(static_cast<int>(qtOrientationsFromNative(displayOrientation)));
+ // Set initial pixel density
+ onDpiChanged(Q_NULLPTR, Q_NULLPTR);
+ d->orientation = d->nativeOrientation;
- hr = d->displayInformation->add_OrientationChanged(Callback<DisplayInformationHandler>(this, &QWinRTScreen::onOrientationChanged).Get(), &d->displayTokens[&IDisplayInformation::remove_OrientationChanged]);
- Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IApplicationViewStatics2> applicationViewStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_ApplicationView).Get(),
+ IID_PPV_ARGS(&applicationViewStatics));
+ RETURN_VOID_IF_FAILED("Could not get ApplicationViewStatics");
- hr = d->displayInformation->add_DpiChanged(Callback<DisplayInformationHandler>(this, &QWinRTScreen::onDpiChanged).Get(), &d->displayTokens[&IDisplayInformation::remove_DpiChanged]);
- Q_ASSERT_SUCCEEDED(hr);
+ hr = applicationViewStatics->GetForCurrentView(&d->view);
+ RETURN_VOID_IF_FAILED("Could not access currentView");
- // Set initial orientation & pixel density
- onDpiChanged(Q_NULLPTR, Q_NULLPTR);
- d->orientation = d->nativeOrientation;
- onOrientationChanged(Q_NULLPTR, Q_NULLPTR);
+ // Create a canvas and set it as the window content. Eventually, this should have its own method so multiple "screens" can be added
+ ComPtr<Xaml::Controls::ICanvas> canvas;
+ hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_UI_Xaml_Controls_Canvas).Get(), &canvas);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<Xaml::IFrameworkElement> frameworkElement;
+ hr = canvas.As(&frameworkElement);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = frameworkElement->put_Width(d->logicalSize.width());
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = frameworkElement->put_Height(d->logicalSize.height());
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<Xaml::IUIElement> uiElement;
+ hr = canvas.As(&uiElement);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = window->put_Content(uiElement.Get());
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = canvas.As(&d->canvas);
+ Q_ASSERT_SUCCEEDED(hr);
- d->eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (d->eglDisplay == EGL_NO_DISPLAY)
- qCritical("Failed to initialize EGL display: 0x%x", eglGetError());
-
- if (!eglInitialize(d->eglDisplay, NULL, NULL))
- qCritical("Failed to initialize EGL: 0x%x", eglGetError());
-
- // Check that the device properly supports depth/stencil rendering, and disable them if not
- ComPtr<ID3D11Device> d3dDevice;
- const EGLBoolean ok = eglQuerySurfacePointerANGLE(d->eglDisplay, EGL_NO_SURFACE, EGL_DEVICE_EXT, (void **)d3dDevice.GetAddressOf());
- if (ok && d3dDevice) {
- ComPtr<IDXGIDevice> dxgiDevice;
- hr = d3dDevice.As(&dxgiDevice);
- if (SUCCEEDED(hr)) {
- ComPtr<IDXGIAdapter> dxgiAdapter;
- hr = dxgiDevice->GetAdapter(&dxgiAdapter);
- if (SUCCEEDED(hr)) {
- ComPtr<IDXGIAdapter2> dxgiAdapter2;
- hr = dxgiAdapter.As(&dxgiAdapter2);
- if (SUCCEEDED(hr)) {
- DXGI_ADAPTER_DESC2 desc;
- hr = dxgiAdapter2->GetDesc2(&desc);
- if (SUCCEEDED(hr)) {
- // The following GPUs do not render properly with depth/stencil
- if ((desc.VendorId == 0x4d4f4351 && desc.DeviceId == 0x32303032)) { // Qualcomm Adreno 225
- d->surfaceFormat.setDepthBufferSize(-1);
- d->surfaceFormat.setStencilBufferSize(-1);
- }
- }
- }
- }
- }
- }
+ d->cursor.reset(new QWinRTCursor);
- d->eglConfig = q_configFromGLFormat(d->eglDisplay, d->surfaceFormat);
- d->surfaceFormat = q_glFormatFromConfig(d->eglDisplay, d->eglConfig, d->surfaceFormat);
- d->eglSurface = eglCreateWindowSurface(d->eglDisplay, d->eglConfig, d->coreWindow.Get(), NULL);
- if (d->eglSurface == EGL_NO_SURFACE)
- qCritical("Failed to create EGL window surface: 0x%x", eglGetError());
+#ifdef Q_OS_WINPHONE
+ ComPtr<IStatusBarStatics> statusBarStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_StatusBar).Get(),
+ IID_PPV_ARGS(&statusBarStatics));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = statusBarStatics->GetForCurrentView(&d->statusBar);
+ Q_ASSERT_SUCCEEDED(hr);
+#endif // Q_OS_WINPHONE
}
QWinRTScreen::~QWinRTScreen()
@@ -629,16 +555,26 @@ QWinRTScreen::~QWinRTScreen()
Q_D(QWinRTScreen);
// Unregister callbacks
- for (QHash<CoreApplicationCallbackRemover, EventRegistrationToken>::const_iterator i = d->applicationTokens.begin(); i != d->applicationTokens.end(); ++i)
- (d->application.Get()->*i.key())(i.value());
- for (QHash<CoreWindowCallbackRemover, EventRegistrationToken>::const_iterator i = d->windowTokens.begin(); i != d->windowTokens.end(); ++i)
- (d->coreWindow.Get()->*i.key())(i.value());
- for (QHash<DisplayCallbackRemover, EventRegistrationToken>::const_iterator i = d->displayTokens.begin(); i != d->displayTokens.end(); ++i)
- (d->displayInformation.Get()->*i.key())(i.value());
+ HRESULT hr;
+ hr = QEventDispatcherWinRT::runOnXamlThread([this, d]() {
+ HRESULT hr;
+ for (QHash<CoreWindowCallbackRemover, EventRegistrationToken>::const_iterator i = d->windowTokens.begin(); i != d->windowTokens.end(); ++i) {
+ hr = (d->coreWindow.Get()->*i.key())(i.value());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ for (QHash<DisplayCallbackRemover, EventRegistrationToken>::const_iterator i = d->displayTokens.begin(); i != d->displayTokens.end(); ++i) {
+ hr = (d->displayInformation.Get()->*i.key())(i.value());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
#ifdef Q_OS_WINPHONE
- for (QHash<HardwareButtonsCallbackRemover, EventRegistrationToken>::const_iterator i = d->buttonsTokens.begin(); i != d->buttonsTokens.end(); ++i)
- (d->hardwareButtons.Get()->*i.key())(i.value());
-#endif
+ for (QHash<StatusBarCallbackRemover, EventRegistrationToken>::const_iterator i = d->statusBarTokens.begin(); i != d->statusBarTokens.end(); ++i) {
+ hr = (d->statusBar.Get()->*i.key())(i.value());
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+#endif //Q_OS_WINPHONE
+ return hr;
+ });
+ RETURN_VOID_IF_FAILED("Failed to unregister screen event callbacks");
}
QRect QWinRTScreen::geometry() const
@@ -647,6 +583,31 @@ QRect QWinRTScreen::geometry() const
return QRect(QPoint(), (d->logicalSize * d->scaleFactor).toSize());
}
+#ifdef Q_OS_WINPHONE
+QRect QWinRTScreen::availableGeometry() const
+{
+ Q_D(const QWinRTScreen);
+ QRect statusBar;
+ QEventDispatcherWinRT::runOnXamlThread([d, &statusBar]() {
+ HRESULT hr;
+ Rect rect;
+ hr = d->statusBar->get_OccludedRect(&rect);
+ Q_ASSERT_SUCCEEDED(hr);
+ statusBar.setRect(qRound(rect.X * d->scaleFactor),
+ qRound(rect.Y * d->scaleFactor),
+ qRound(rect.Width * d->scaleFactor),
+ qRound(rect.Height * d->scaleFactor));
+ return S_OK;
+ });
+
+ return geometry().adjusted(
+ d->orientation == Qt::LandscapeOrientation ? statusBar.width() : 0,
+ d->orientation == Qt::PortraitOrientation ? statusBar.height() : 0,
+ d->orientation == Qt::InvertedLandscapeOrientation ? -statusBar.width() : 0,
+ 0);
+}
+#endif //Q_OS_WINPHONE
+
int QWinRTScreen::depth() const
{
return 32;
@@ -657,12 +618,6 @@ QImage::Format QWinRTScreen::format() const
return QImage::Format_ARGB32_Premultiplied;
}
-QSurfaceFormat QWinRTScreen::surfaceFormat() const
-{
- Q_D(const QWinRTScreen);
- return d->surfaceFormat;
-}
-
QSizeF QWinRTScreen::physicalSize() const
{
Q_D(const QWinRTScreen);
@@ -682,21 +637,9 @@ qreal QWinRTScreen::scaleFactor() const
return d->scaleFactor;
}
-QWinRTInputContext *QWinRTScreen::inputContext() const
-{
- Q_D(const QWinRTScreen);
-#ifdef Q_OS_WINPHONE
- return d->inputContext.data();
-#else
- return d->inputContext.Get();
-#endif
-}
-
QPlatformCursor *QWinRTScreen::cursor() const
{
Q_D(const QWinRTScreen);
- if (!d->cursor)
- const_cast<QWinRTScreenPrivate *>(d)->cursor.reset(new QWinRTCursor);
return d->cursor.data();
}
@@ -744,22 +687,76 @@ ICoreWindow *QWinRTScreen::coreWindow() const
return d->coreWindow.Get();
}
-EGLDisplay QWinRTScreen::eglDisplay() const
+Xaml::IDependencyObject *QWinRTScreen::canvas() const
{
Q_D(const QWinRTScreen);
- return d->eglDisplay;
+ return d->canvas.Get();
}
-EGLSurface QWinRTScreen::eglSurface() const
+#ifdef Q_OS_WINPHONE
+void QWinRTScreen::setStatusBarVisibility(bool visible, QWindow *window)
{
- Q_D(const QWinRTScreen);
- return d->eglSurface;
+ Q_D(QWinRTScreen);
+ const Qt::WindowFlags windowType = window->flags() & Qt::WindowType_Mask;
+ if (!window || (windowType != Qt::Window && windowType != Qt::Dialog))
+ return;
+
+ QEventDispatcherWinRT::runOnXamlThread([d, visible]() {
+ HRESULT hr;
+ ComPtr<IAsyncAction> op;
+ if (visible)
+ hr = d->statusBar->ShowAsync(&op);
+ else
+ hr = d->statusBar->HideAsync(&op);
+ Q_ASSERT_SUCCEEDED(hr);
+ return S_OK;
+ });
}
+#endif //Q_OS_WINPHONE
-EGLConfig QWinRTScreen::eglConfig() const
+void QWinRTScreen::initialize()
{
- Q_D(const QWinRTScreen);
- return d->eglConfig;
+ Q_D(QWinRTScreen);
+ HRESULT hr;
+ hr = d->coreWindow->add_KeyDown(Callback<KeyHandler>(this, &QWinRTScreen::onKeyDown).Get(), &d->windowTokens[&ICoreWindow::remove_KeyDown]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_KeyUp(Callback<KeyHandler>(this, &QWinRTScreen::onKeyUp).Get(), &d->windowTokens[&ICoreWindow::remove_KeyUp]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_CharacterReceived(Callback<CharacterReceivedHandler>(this, &QWinRTScreen::onCharacterReceived).Get(), &d->windowTokens[&ICoreWindow::remove_CharacterReceived]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_PointerEntered(Callback<PointerHandler>(this, &QWinRTScreen::onPointerEntered).Get(), &d->windowTokens[&ICoreWindow::remove_PointerEntered]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_PointerExited(Callback<PointerHandler>(this, &QWinRTScreen::onPointerExited).Get(), &d->windowTokens[&ICoreWindow::remove_PointerExited]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_PointerMoved(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerMoved]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_PointerPressed(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerPressed]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_PointerReleased(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerReleased]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_PointerWheelChanged(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerWheelChanged]);
+ Q_ASSERT_SUCCEEDED(hr);
+#ifndef Q_OS_WINPHONE
+ hr = d->coreWindow->add_SizeChanged(Callback<SizeChangedHandler>(this, &QWinRTScreen::onSizeChanged).Get(), &d->windowTokens[&ICoreWindow::remove_SizeChanged]);
+ Q_ASSERT_SUCCEEDED(hr);
+#else
+ hr = d->statusBar->add_Showing(Callback<StatusBarHandler>(this, &QWinRTScreen::onStatusBarShowing).Get(), &d->statusBarTokens[&IStatusBar::remove_Showing]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->statusBar->add_Hiding(Callback<StatusBarHandler>(this, &QWinRTScreen::onStatusBarHiding).Get(), &d->statusBarTokens[&IStatusBar::remove_Hiding]);
+ Q_ASSERT_SUCCEEDED(hr);
+#endif
+ hr = d->coreWindow->add_Activated(Callback<ActivatedHandler>(this, &QWinRTScreen::onActivated).Get(), &d->windowTokens[&ICoreWindow::remove_Activated]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_Closed(Callback<ClosedHandler>(this, &QWinRTScreen::onClosed).Get(), &d->windowTokens[&ICoreWindow::remove_Closed]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->coreWindow->add_VisibilityChanged(Callback<VisibilityChangedHandler>(this, &QWinRTScreen::onVisibilityChanged).Get(), &d->windowTokens[&ICoreWindow::remove_VisibilityChanged]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->displayInformation->add_OrientationChanged(Callback<DisplayInformationHandler>(this, &QWinRTScreen::onOrientationChanged).Get(), &d->displayTokens[&IDisplayInformation::remove_OrientationChanged]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->displayInformation->add_DpiChanged(Callback<DisplayInformationHandler>(this, &QWinRTScreen::onDpiChanged).Get(), &d->displayTokens[&IDisplayInformation::remove_DpiChanged]);
+ Q_ASSERT_SUCCEEDED(hr);
+ onOrientationChanged(Q_NULLPTR, Q_NULLPTR);
+ onVisibilityChanged(nullptr, nullptr);
}
QWindow *QWinRTScreen::topWindow() const
@@ -773,20 +770,34 @@ void QWinRTScreen::addWindow(QWindow *window)
Q_D(QWinRTScreen);
if (window == topWindow())
return;
+
+#ifdef Q_OS_WINPHONE
+ if (window->visibility() != QWindow::Maximized && window->visibility() != QWindow::Windowed)
+ setStatusBarVisibility(false, window);
+#endif
+
d->visibleWindows.prepend(window);
QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason);
handleExpose();
+ QWindowSystemInterface::flushWindowSystemEvents();
}
void QWinRTScreen::removeWindow(QWindow *window)
{
Q_D(QWinRTScreen);
+
+#ifdef Q_OS_WINPHONE
+ if (window->visibility() == QWindow::Minimized)
+ setStatusBarVisibility(false, window);
+#endif
+
const bool wasTopWindow = window == topWindow();
if (!d->visibleWindows.removeAll(window))
return;
if (wasTopWindow)
QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason);
handleExpose();
+ QWindowSystemInterface::flushWindowSystemEvents();
}
void QWinRTScreen::raise(QWindow *window)
@@ -809,6 +820,20 @@ void QWinRTScreen::lower(QWindow *window)
handleExpose();
}
+void QWinRTScreen::updateWindowTitle()
+{
+ Q_D(QWinRTScreen);
+
+ QWindow *window = topWindow();
+ if (!window)
+ return;
+
+ const QString title = window->title();
+ HStringReference titleRef(reinterpret_cast<LPCWSTR>(title.utf16()), title.length());
+ HRESULT hr = d->view->put_Title(titleRef.Get());
+ RETURN_VOID_IF_FAILED("Unable to set window title");
+}
+
void QWinRTScreen::handleExpose()
{
Q_D(QWinRTScreen);
@@ -822,57 +847,94 @@ void QWinRTScreen::handleExpose()
HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IKeyEventArgs *args)
{
+ Q_D(QWinRTScreen);
VirtualKey virtualKey;
- args->get_VirtualKey(&virtualKey);
+ HRESULT hr = args->get_VirtualKey(&virtualKey);
+ Q_ASSERT_SUCCEEDED(hr);
+ CorePhysicalKeyStatus status;
+ hr = args->get_KeyStatus(&status);
+ Q_ASSERT_SUCCEEDED(hr);
+
Qt::Key key = qKeyFromVirtual(virtualKey);
// Defer character key presses to onCharacterReceived
- if (key == Qt::Key_unknown || (key >= Qt::Key_Space && key <= Qt::Key_ydiaeresis))
+ if (key == Qt::Key_unknown || (key >= Qt::Key_Space && key <= Qt::Key_ydiaeresis)) {
+ d->activeKeys.insert(key, KeyInfo(virtualKey));
return S_OK;
- QWindowSystemInterface::handleKeyEvent(topWindow(), QEvent::KeyPress, key, keyboardModifiers());
+ }
+
+ QWindowSystemInterface::handleExtendedKeyEvent(
+ topWindow(),
+ QEvent::KeyPress,
+ key,
+ keyboardModifiers(),
+ !status.ScanCode ? -1 : status.ScanCode,
+ virtualKey,
+ 0,
+ QString(),
+ status.RepeatCount > 1,
+ !status.RepeatCount ? 1 : status.RepeatCount,
+ false);
return S_OK;
}
HRESULT QWinRTScreen::onKeyUp(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IKeyEventArgs *args)
{
- Qt::KeyboardModifiers mods = keyboardModifiers();
-#ifndef Q_OS_WINPHONE
Q_D(QWinRTScreen);
- CorePhysicalKeyStatus status; // Look for a pressed character key
- if (SUCCEEDED(args->get_KeyStatus(&status)) && d->activeKeys.contains(status.ScanCode)) {
- QPair<Qt::Key, QString> keyStatus = d->activeKeys.take(status.ScanCode);
- QWindowSystemInterface::handleKeyEvent(topWindow(), QEvent::KeyRelease,
- keyStatus.first, mods, keyStatus.second);
- return S_OK;
- }
-#endif // !Q_OS_WINPHONE
VirtualKey virtualKey;
- args->get_VirtualKey(&virtualKey);
- QWindowSystemInterface::handleKeyEvent(topWindow(), QEvent::KeyRelease,
- qKeyFromVirtual(virtualKey), mods);
+ HRESULT hr = args->get_VirtualKey(&virtualKey);
+ Q_ASSERT_SUCCEEDED(hr);
+ CorePhysicalKeyStatus status;
+ hr = args->get_KeyStatus(&status);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ Qt::Key key = qKeyFromVirtual(virtualKey);
+ const KeyInfo info = d->activeKeys.take(key);
+ QWindowSystemInterface::handleExtendedKeyEvent(
+ topWindow(),
+ QEvent::KeyRelease,
+ key,
+ keyboardModifiers(),
+ !status.ScanCode ? -1 : status.ScanCode,
+ virtualKey,
+ 0,
+ info.text,
+ status.RepeatCount > 1,
+ !status.RepeatCount ? 1 : status.RepeatCount,
+ false);
return S_OK;
}
HRESULT QWinRTScreen::onCharacterReceived(ICoreWindow *, ICharacterReceivedEventArgs *args)
{
+ Q_D(QWinRTScreen);
quint32 keyCode;
- args->get_KeyCode(&keyCode);
+ HRESULT hr = args->get_KeyCode(&keyCode);
+ Q_ASSERT_SUCCEEDED(hr);
+ CorePhysicalKeyStatus status;
+ hr = args->get_KeyStatus(&status);
+ Q_ASSERT_SUCCEEDED(hr);
+
// Don't generate character events for non-printables; the meta key stage is enough
if (qIsNonPrintable(keyCode))
return S_OK;
- Qt::KeyboardModifiers mods = keyboardModifiers();
- Qt::Key key = qKeyFromCode(keyCode, mods);
- QString text = QChar(keyCode);
- QWindowSystemInterface::handleKeyEvent(topWindow(), QEvent::KeyPress, key, mods, text);
-#ifndef Q_OS_WINPHONE
- Q_D(QWinRTScreen);
- CorePhysicalKeyStatus status; // Defer release to onKeyUp for physical keys
- if (SUCCEEDED(args->get_KeyStatus(&status)) && !status.IsKeyReleased) {
- d->activeKeys.insert(status.ScanCode, qMakePair(key, text));
- return S_OK;
- }
-#endif // !Q_OS_WINPHONE
- QWindowSystemInterface::handleKeyEvent(topWindow(), QEvent::KeyRelease, key, mods, text);
+ const Qt::KeyboardModifiers modifiers = keyboardModifiers();
+ const Qt::Key key = qKeyFromCode(keyCode, modifiers);
+ const QString text = QChar(keyCode);
+ const quint32 virtualKey = d->activeKeys.value(key).virtualKey;
+ QWindowSystemInterface::handleExtendedKeyEvent(
+ topWindow(),
+ QEvent::KeyPress,
+ key,
+ modifiers,
+ !status.ScanCode ? -1 : status.ScanCode,
+ virtualKey,
+ 0,
+ text,
+ status.RepeatCount > 1,
+ !status.RepeatCount ? 1 : status.RepeatCount,
+ false);
+ d->activeKeys.insert(key, KeyInfo(text, virtualKey));
return S_OK;
}
@@ -909,6 +971,11 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
Point point;
pointerPoint->get_Position(&point);
QPointF pos(point.X * d->scaleFactor, point.Y * d->scaleFactor);
+ QPointF localPos = pos;
+ if (topWindow()) {
+ const QPointF globalPosDelta = pos - pos.toPoint();
+ localPos = topWindow()->mapFromGlobal(pos.toPoint()) + globalPosDelta;
+ }
VirtualKeyModifiers modifiers;
args->get_KeyModifiers(&modifiers);
@@ -942,7 +1009,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
boolean isHorizontal;
properties->get_IsHorizontalMouseWheel(&isHorizontal);
QPoint angleDelta(isHorizontal ? delta : 0, isHorizontal ? 0 : delta);
- QWindowSystemInterface::handleWheelEvent(topWindow(), pos, pos, QPoint(), angleDelta, mods);
+ QWindowSystemInterface::handleWheelEvent(topWindow(), localPos, pos, QPoint(), angleDelta, mods);
break;
}
@@ -968,7 +1035,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
if (isPressed)
buttons |= Qt::XButton2;
- QWindowSystemInterface::handleMouseEvent(topWindow(), pos, pos, buttons, mods);
+ QWindowSystemInterface::handleMouseEvent(topWindow(), localPos, pos, buttons, mods);
break;
}
@@ -1055,17 +1122,6 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
return S_OK;
}
-HRESULT QWinRTScreen::onAutomationProviderRequested(ICoreWindow *, IAutomationProviderRequestedEventArgs *args)
-{
-#ifndef Q_OS_WINPHONE
- Q_D(const QWinRTScreen);
- args->put_AutomationProvider(d->inputContext.Get());
-#else
- Q_UNUSED(args)
-#endif
- return S_OK;
-}
-
HRESULT QWinRTScreen::onSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs *)
{
Q_D(QWinRTScreen);
@@ -1074,19 +1130,10 @@ HRESULT QWinRTScreen::onSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs *
HRESULT hr;
hr = d->coreWindow->get_Bounds(&size);
RETURN_OK_IF_FAILED("Failed to get window bounds");
- QSizeF logicalSize = QSizeF(size.Width, size.Height);
-#ifndef Q_OS_WINPHONE // This handler is called from orientation changed, in which case we should always update the size
- if (d->logicalSize == logicalSize)
- return S_OK;
-#endif
-
- d->logicalSize = logicalSize;
- if (d->eglDisplay) {
- const QRect newGeometry = geometry();
- QWindowSystemInterface::handleScreenGeometryChange(screen(), newGeometry, newGeometry);
- QPlatformScreen::resizeMaximizedWindows();
- handleExpose();
- }
+ d->logicalSize = QSizeF(size.Width, size.Height);
+ QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry());
+ QPlatformScreen::resizeMaximizedWindows();
+ handleExpose();
return S_OK;
}
@@ -1110,31 +1157,6 @@ HRESULT QWinRTScreen::onActivated(ICoreWindow *, IWindowActivatedEventArgs *args
return S_OK;
}
-HRESULT QWinRTScreen::onSuspended(IInspectable *, ISuspendingEventArgs *)
-{
-#ifndef Q_OS_WINPHONE
- Q_D(QWinRTScreen);
- ComPtr<ID3D11Device> d3dDevice;
- const EGLBoolean ok = eglQuerySurfacePointerANGLE(d->eglDisplay, d->eglSurface, EGL_DEVICE_EXT, (void **)d3dDevice.GetAddressOf());
- if (ok && d3dDevice) {
- ComPtr<IDXGIDevice3> dxgiDevice;
- if (SUCCEEDED(d3dDevice.As(&dxgiDevice)))
- dxgiDevice->Trim();
- }
-#endif
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
- QWindowSystemInterface::flushWindowSystemEvents();
- return S_OK;
-}
-
-HRESULT QWinRTScreen::onResume(IInspectable *, IInspectable *)
-{
- // First the system invokes onResume and then changes
- // the visibility of the screen to be active.
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationHidden);
- return S_OK;
-}
-
HRESULT QWinRTScreen::onClosed(ICoreWindow *, ICoreWindowEventArgs *)
{
foreach (QWindow *w, QGuiApplication::topLevelWindows())
@@ -1144,8 +1166,10 @@ HRESULT QWinRTScreen::onClosed(ICoreWindow *, ICoreWindowEventArgs *)
HRESULT QWinRTScreen::onVisibilityChanged(ICoreWindow *, IVisibilityChangedEventArgs *args)
{
+ Q_D(QWinRTScreen);
boolean visible;
- args->get_Visible(&visible);
+ HRESULT hr = args ? args->get_Visible(&visible) : d->coreWindow->get_Visible(&visible);
+ RETURN_OK_IF_FAILED("Failed to get visbile.");
QWindowSystemInterface::handleApplicationStateChanged(visible ? Qt::ApplicationActive : Qt::ApplicationHidden);
if (visible)
handleExpose();
@@ -1163,12 +1187,12 @@ HRESULT QWinRTScreen::onOrientationChanged(IDisplayInformation *, IInspectable *
Qt::ScreenOrientation newOrientation = static_cast<Qt::ScreenOrientation>(static_cast<int>(qtOrientationsFromNative(displayOrientation)));
if (d->orientation != newOrientation) {
d->orientation = newOrientation;
+#ifdef Q_OS_WINPHONE
+ onSizeChanged(nullptr, nullptr);
+#endif
QWindowSystemInterface::handleScreenOrientationChange(screen(), d->orientation);
+ handleExpose(); // Clean broken frames caused by race between Qt and ANGLE
}
-
-#ifdef Q_OS_WINPHONE // The size changed handler is ignored in favor of this callback
- onSizeChanged(Q_NULLPTR, Q_NULLPTR);
-#endif
return S_OK;
}
@@ -1206,26 +1230,17 @@ HRESULT QWinRTScreen::onDpiChanged(IDisplayInformation *, IInspectable *)
}
#ifdef Q_OS_WINPHONE
-HRESULT QWinRTScreen::onBackButtonPressed(IInspectable *, IBackPressedEventArgs *args)
+HRESULT QWinRTScreen::onStatusBarShowing(IStatusBar *, IInspectable *)
{
- Q_D(QWinRTScreen);
-
- QKeyEvent backPress(QEvent::KeyPress, Qt::Key_Back, Qt::NoModifier);
- QKeyEvent backRelease(QEvent::KeyRelease, Qt::Key_Back, Qt::NoModifier);
- backPress.setAccepted(false);
- backRelease.setAccepted(false);
-
- QObject *receiver = d->visibleWindows.isEmpty()
- ? static_cast<QObject *>(QGuiApplication::instance())
- : static_cast<QObject *>(d->visibleWindows.first());
-
- // If the event is ignored, the app will suspend
- QGuiApplication::sendEvent(receiver, &backPress);
- QGuiApplication::sendEvent(receiver, &backRelease);
- args->put_Handled(backPress.isAccepted() || backRelease.isAccepted());
+ onSizeChanged(nullptr, nullptr);
+ return S_OK;
+}
+HRESULT QWinRTScreen::onStatusBarHiding(IStatusBar *, IInspectable *)
+{
+ onSizeChanged(nullptr, nullptr);
return S_OK;
}
-#endif // Q_OS_WINPHONE
+#endif //Q_OS_WINPHONE
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h
index d34ce75748..0043b2cfa3 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.h
+++ b/src/plugins/platforms/winrt/qwinrtscreen.h
@@ -40,8 +40,6 @@
#include <qpa/qplatformscreen.h>
#include <qpa/qwindowsysteminterface.h>
-#include <EGL/egl.h>
-
namespace ABI {
namespace Windows {
namespace ApplicationModel {
@@ -59,21 +57,19 @@ namespace ABI {
struct IWindowActivatedEventArgs;
struct IWindowSizeChangedEventArgs;
}
+ namespace Xaml {
+ struct IDependencyObject;
+ struct IWindow;
+ }
+ namespace ViewManagement {
+ struct IStatusBar;
+ }
}
namespace Graphics {
namespace Display {
struct IDisplayInformation;
}
}
-#ifdef Q_OS_WINPHONE
- namespace Phone {
- namespace UI {
- namespace Input {
- struct IBackPressedEventArgs;
- }
- }
- }
-#endif
}
}
struct IInspectable;
@@ -81,7 +77,6 @@ struct IInspectable;
QT_BEGIN_NAMESPACE
class QTouchDevice;
-class QWinRTEGLContext;
class QWinRTCursor;
class QWinRTInputContext;
class QWinRTScreenPrivate;
@@ -90,19 +85,20 @@ class QWinRTScreen : public QPlatformScreen
public:
explicit QWinRTScreen();
~QWinRTScreen();
- QRect geometry() const;
- int depth() const;
- QImage::Format format() const;
- QSurfaceFormat surfaceFormat() const;
+ QRect geometry() const Q_DECL_OVERRIDE;
+#ifdef Q_OS_WINPHONE
+ QRect availableGeometry() const Q_DECL_OVERRIDE;
+#endif
+ int depth() const Q_DECL_OVERRIDE;
+ QImage::Format format() const Q_DECL_OVERRIDE;
QSizeF physicalSize() const Q_DECL_OVERRIDE;
QDpi logicalDpi() const Q_DECL_OVERRIDE;
qreal scaleFactor() const;
- QWinRTInputContext *inputContext() const;
- QPlatformCursor *cursor() const;
+ QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
Qt::KeyboardModifiers keyboardModifiers() const;
- Qt::ScreenOrientation nativeOrientation() const;
- Qt::ScreenOrientation orientation() const;
+ Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
+ Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
QWindow *topWindow() const;
void addWindow(QWindow *window);
@@ -110,10 +106,16 @@ public:
void raise(QWindow *window);
void lower(QWindow *window);
+ void updateWindowTitle();
+
ABI::Windows::UI::Core::ICoreWindow *coreWindow() const;
- EGLDisplay eglDisplay() const; // To opengl context
- EGLSurface eglSurface() const; // To window
- EGLConfig eglConfig() const;
+ ABI::Windows::UI::Xaml::IDependencyObject *canvas() const;
+
+#ifdef Q_OS_WINPHONE
+ void setStatusBarVisibility(bool visible, QWindow *window);
+#endif
+
+ void initialize();
private:
void handleExpose();
@@ -127,18 +129,16 @@ private:
HRESULT onSizeChanged(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IWindowSizeChangedEventArgs *);
HRESULT onActivated(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IWindowActivatedEventArgs *);
- HRESULT onSuspended(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *);
- HRESULT onResume(IInspectable *, IInspectable *);
HRESULT onClosed(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::ICoreWindowEventArgs *);
HRESULT onVisibilityChanged(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IVisibilityChangedEventArgs *);
- HRESULT onAutomationProviderRequested(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IAutomationProviderRequestedEventArgs *);
HRESULT onOrientationChanged(ABI::Windows::Graphics::Display::IDisplayInformation *, IInspectable *);
HRESULT onDpiChanged(ABI::Windows::Graphics::Display::IDisplayInformation *, IInspectable *);
#ifdef Q_OS_WINPHONE
- HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args);
+ HRESULT onStatusBarShowing(ABI::Windows::UI::ViewManagement::IStatusBar *, IInspectable *);
+ HRESULT onStatusBarHiding(ABI::Windows::UI::ViewManagement::IStatusBar *, IInspectable *);
#endif
QScopedPointer<QWinRTScreenPrivate> d_ptr;
diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp
index a0fa2798a8..7d09551f5b 100644
--- a/src/plugins/platforms/winrt/qwinrttheme.cpp
+++ b/src/plugins/platforms/winrt/qwinrttheme.cpp
@@ -44,7 +44,13 @@
#include <wrl.h>
#include <windows.ui.h>
#include <windows.ui.viewmanagement.h>
+#if _MSC_VER >= 1900
+#include <windows.foundation.metadata.h>
+using namespace ABI::Windows::Foundation::Metadata;
+#endif
+
using namespace Microsoft::WRL;
+using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::UI;
using namespace ABI::Windows::UI::ViewManagement;
@@ -73,102 +79,215 @@ static inline QColor fromColor(const Color &color)
return QColor(color.R, color.G, color.B, color.A);
}
-QWinRTTheme::QWinRTTheme()
- : d_ptr(new QWinRTThemePrivate)
+#if _MSC_VER >= 1900
+static bool uiColorSettings(const wchar_t *value, UIElementType type, Color *color)
{
- Q_D(QWinRTTheme);
+ static ComPtr<IApiInformationStatics> apiInformationStatics;
+ HRESULT hr;
+ if (!apiInformationStatics) {
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(),
+ IID_PPV_ARGS(&apiInformationStatics));
+ RETURN_FALSE_IF_FAILED("Could not get ApiInformationStatics");
+ }
+
+ static const HStringReference enumRef(L"Windows.UI.ViewManagement.UIElementType");
+ HStringReference valueRef(value);
+
+ boolean exists;
+ hr = apiInformationStatics->IsEnumNamedValuePresent(enumRef.Get(), valueRef.Get(), &exists);
+
+ if (hr != S_OK || !exists)
+ return false;
+
+ return SUCCEEDED(uiSettings()->UIElementColor(type, color));
+}
+
+static void nativeColorSettings(QPalette &p)
+{
+ Color color;
+
+ if (uiColorSettings(L"ActiveCaption", UIElementType_ActiveCaption, &color))
+ p.setColor(QPalette::ToolTipBase, fromColor(color));
+
+ if (uiColorSettings(L"Background", UIElementType_Background, &color))
+ p.setColor(QPalette::AlternateBase, fromColor(color));
+
+ if (uiColorSettings(L"ButtonFace", UIElementType_ButtonFace, &color)) {
+ p.setColor(QPalette::Button, fromColor(color));
+ p.setColor(QPalette::Midlight, fromColor(color).lighter(110));
+ p.setColor(QPalette::Light, fromColor(color).lighter(150));
+ p.setColor(QPalette::Mid, fromColor(color).dark(130));
+ p.setColor(QPalette::Dark, fromColor(color).dark(150));
+ }
+
+ if (uiColorSettings(L"ButtonText", UIElementType_ButtonText, &color)) {
+ p.setColor(QPalette::ButtonText, fromColor(color));
+ p.setColor(QPalette::Text, fromColor(color));
+ }
+
+ if (uiColorSettings(L"CaptionText", UIElementType_CaptionText, &color))
+ p.setColor(QPalette::ToolTipText, fromColor(color));
+
+ if (uiColorSettings(L"Highlight", UIElementType_Highlight, &color))
+ p.setColor(QPalette::Highlight, fromColor(color));
+
+ if (uiColorSettings(L"HighlightText", UIElementType_HighlightText, &color))
+ p.setColor(QPalette::HighlightedText, fromColor(color));
+
+ if (uiColorSettings(L"Window", UIElementType_Window, &color)) {
+ p.setColor(QPalette::Window, fromColor(color));
+ p.setColor(QPalette::Base, fromColor(color));
+ }
+
+ if (uiColorSettings(L"Hotlight", UIElementType_Hotlight, &color))
+ p.setColor(QPalette::BrightText, fromColor(color));
+ //Phone related
+ if (uiColorSettings(L"PopupBackground", UIElementType_PopupBackground, &color)) {
+ p.setColor(QPalette::ToolTipBase, fromColor(color));
+ p.setColor(QPalette::AlternateBase, fromColor(color));
+ }
+
+ if (uiColorSettings(L"NonTextMedium", UIElementType_NonTextMedium, &color))
+ p.setColor(QPalette::Button, fromColor(color));
+
+ if (uiColorSettings(L"NonTextMediumHigh", UIElementType_NonTextMediumHigh, &color))
+ p.setColor(QPalette::Midlight, fromColor(color));
+
+ if (uiColorSettings(L"NonTextHigh", UIElementType_NonTextHigh, &color))
+ p.setColor(QPalette::Light, fromColor(color));
+
+ if (uiColorSettings(L"NonTextMediumLow", UIElementType_NonTextMediumLow, &color))
+ p.setColor(QPalette::Mid, fromColor(color));
+
+ if (uiColorSettings(L"NonTextLow", UIElementType_NonTextLow, &color))
+ p.setColor(QPalette::Dark, fromColor(color));
+
+ if (uiColorSettings(L"TextHigh", UIElementType_TextHigh, &color)) {
+ p.setColor(QPalette::ButtonText, fromColor(color));
+ p.setColor(QPalette::Text, fromColor(color));
+ p.setColor(QPalette::WindowText, fromColor(color));
+ }
+
+ if (uiColorSettings(L"TextMedium", UIElementType_TextMedium, &color))
+ p.setColor(QPalette::ToolTipText, fromColor(color));
+
+ if (uiColorSettings(L"AccentColor", UIElementType_AccentColor, &color))
+ p.setColor(QPalette::Highlight, fromColor(color));
+
+ if (uiColorSettings(L"PageBackground", UIElementType_PageBackground, &color)) {
+ p.setColor(QPalette::Window, fromColor(color));
+ p.setColor(QPalette::Base, fromColor(color));
+ }
+
+ if (uiColorSettings(L"TextContrastWithHigh", UIElementType_TextContrastWithHigh, &color))
+ p.setColor(QPalette::BrightText, fromColor(color));
+}
+
+#else // _MSC_VER >= 1900
+
+static void nativeColorSettings(QPalette &p)
+{
HRESULT hr;
Color color;
#ifdef Q_OS_WINPHONE
hr = uiSettings()->UIElementColor(UIElementType_PopupBackground, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::ToolTipBase, fromColor(color));
- d->palette.setColor(QPalette::AlternateBase, fromColor(color));
+ p.setColor(QPalette::ToolTipBase, fromColor(color));
+ p.setColor(QPalette::AlternateBase, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_NonTextMedium, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Button, fromColor(color));
+ p.setColor(QPalette::Button, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_NonTextMediumHigh, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Midlight, fromColor(color));
+ p.setColor(QPalette::Midlight, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_NonTextHigh, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Light, fromColor(color));
+ p.setColor(QPalette::Light, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_NonTextMediumLow, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Mid, fromColor(color));
+ p.setColor(QPalette::Mid, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_NonTextLow, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Dark, fromColor(color));
+ p.setColor(QPalette::Dark, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_TextHigh, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::ButtonText, fromColor(color));
- d->palette.setColor(QPalette::Text, fromColor(color));
- d->palette.setColor(QPalette::WindowText, fromColor(color));
+ p.setColor(QPalette::ButtonText, fromColor(color));
+ p.setColor(QPalette::Text, fromColor(color));
+ p.setColor(QPalette::WindowText, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_TextMedium, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::ToolTipText, fromColor(color));
+ p.setColor(QPalette::ToolTipText, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_AccentColor, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Highlight, fromColor(color));
+ p.setColor(QPalette::Highlight, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_PageBackground, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Window, fromColor(color));
- d->palette.setColor(QPalette::Base, fromColor(color));
+ p.setColor(QPalette::Window, fromColor(color));
+ p.setColor(QPalette::Base, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_TextContrastWithHigh, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::BrightText, fromColor(color));
+ p.setColor(QPalette::BrightText, fromColor(color));
#else
hr = uiSettings()->UIElementColor(UIElementType_ActiveCaption, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::ToolTipBase, fromColor(color));
+ p.setColor(QPalette::ToolTipBase, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_Background, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::AlternateBase, fromColor(color));
+ p.setColor(QPalette::AlternateBase, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_ButtonFace, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Button, fromColor(color));
- d->palette.setColor(QPalette::Midlight, fromColor(color).lighter(110));
- d->palette.setColor(QPalette::Light, fromColor(color).lighter(150));
- d->palette.setColor(QPalette::Mid, fromColor(color).dark(130));
- d->palette.setColor(QPalette::Dark, fromColor(color).dark(150));
+ p.setColor(QPalette::Button, fromColor(color));
+ p.setColor(QPalette::Midlight, fromColor(color).lighter(110));
+ p.setColor(QPalette::Light, fromColor(color).lighter(150));
+ p.setColor(QPalette::Mid, fromColor(color).dark(130));
+ p.setColor(QPalette::Dark, fromColor(color).dark(150));
hr = uiSettings()->UIElementColor(UIElementType_ButtonText, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::ButtonText, fromColor(color));
- d->palette.setColor(QPalette::Text, fromColor(color));
+ p.setColor(QPalette::ButtonText, fromColor(color));
+ p.setColor(QPalette::Text, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_CaptionText, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::ToolTipText, fromColor(color));
+ p.setColor(QPalette::ToolTipText, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_Highlight, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Highlight, fromColor(color));
+ p.setColor(QPalette::Highlight, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_HighlightText, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::HighlightedText, fromColor(color));
+ p.setColor(QPalette::HighlightedText, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_Window, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::Window, fromColor(color));
- d->palette.setColor(QPalette::Base, fromColor(color));
+ p.setColor(QPalette::Window, fromColor(color));
+ p.setColor(QPalette::Base, fromColor(color));
hr = uiSettings()->UIElementColor(UIElementType_Hotlight, &color);
Q_ASSERT_SUCCEEDED(hr);
- d->palette.setColor(QPalette::BrightText, fromColor(color));
+ p.setColor(QPalette::BrightText, fromColor(color));
#endif
}
+#endif // _MSC_VER < 1900
+
+QWinRTTheme::QWinRTTheme()
+ : d_ptr(new QWinRTThemePrivate)
+{
+ Q_D(QWinRTTheme);
+
+ nativeColorSettings(d->palette);
+}
bool QWinRTTheme::usePlatformNativeDialog(DialogType type) const
{
@@ -218,7 +337,7 @@ QVariant QWinRTTheme::styleHint(QPlatformIntegration::StyleHint hint)
case QPlatformIntegration::KeyboardAutoRepeatRate:
return defaultThemeHint(KeyboardAutoRepeatRate);
case QPlatformIntegration::ShowIsFullScreen:
- return true;
+ return false;
case QPlatformIntegration::PasswordMaskDelay:
return defaultThemeHint(PasswordMaskDelay);
case QPlatformIntegration::FontSmoothingGamma:
@@ -232,7 +351,7 @@ QVariant QWinRTTheme::styleHint(QPlatformIntegration::StyleHint hint)
case QPlatformIntegration::SetFocusOnTouchRelease:
return false;
case QPlatformIntegration::ShowIsMaximized:
- return false;
+ return true;
case QPlatformIntegration::MousePressAndHoldInterval:
return defaultThemeHint(MousePressAndHoldInterval);
default:
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index adc5dfb776..bec94c1e51 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -36,47 +36,164 @@
#include "qwinrtwindow.h"
#include "qwinrtscreen.h"
+#include <private/qeventdispatcher_winrt_p.h>
-#include <qpa/qwindowsysteminterface.h>
+#include <EGL/egl.h>
+#define EGL_EGLEXT_PROTOTYPES
+#include <EGL/eglext.h>
+
+#include <qfunctions_winrt.h>
#include <qpa/qplatformscreen.h>
+#include <qpa/qwindowsysteminterface.h>
#include <QtGui/QGuiApplication>
-#include <QtGui/QWindow>
#include <QtGui/QOpenGLContext>
+#include <QtGui/QWindow>
+#include <QtPlatformSupport/private/qeglconvenience_p.h>
-#include <qfunctions_winrt.h>
-#include <windows.ui.viewmanagement.h>
+#include <functional>
#include <wrl.h>
+#include <windows.foundation.h>
+#include <windows.foundation.collections.h>
+#include <windows.ui.xaml.h>
+#include <windows.ui.xaml.controls.h>
+#include <windows.ui.viewmanagement.h>
using namespace ABI::Windows::UI::ViewManagement;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
+using namespace ABI::Windows::Foundation;
+using namespace ABI::Windows::Foundation::Collections;
+using namespace ABI::Windows::UI;
+using namespace ABI::Windows::UI::Xaml;
+using namespace ABI::Windows::UI::Xaml::Controls;
QT_BEGIN_NAMESPACE
+static void setUIElementVisibility(IUIElement *uiElement, bool visibility)
+{
+ Q_ASSERT(uiElement);
+ QEventDispatcherWinRT::runOnXamlThread([uiElement, visibility]() {
+ HRESULT hr;
+ hr = uiElement->put_Visibility(visibility ? Visibility_Visible : Visibility_Collapsed);
+ Q_ASSERT_SUCCEEDED(hr);
+ return S_OK;
+ });
+}
+
+class QWinRTWindowPrivate
+{
+public:
+ QWinRTScreen *screen;
+
+ QSurfaceFormat surfaceFormat;
+ QString windowTitle;
+ Qt::WindowState state;
+ EGLDisplay display;
+ EGLSurface surface;
+
+ ComPtr<ISwapChainPanel> swapChainPanel;
+ ComPtr<ICanvasStatics> canvas;
+ ComPtr<IUIElement> uiElement;
+};
+
QWinRTWindow::QWinRTWindow(QWindow *window)
: QPlatformWindow(window)
- , m_screen(static_cast<QWinRTScreen*>(screen()))
+ , d_ptr(new QWinRTWindowPrivate)
{
+ Q_D(QWinRTWindow);
+
+ d->surface = EGL_NO_SURFACE;
+ d->display = EGL_NO_DISPLAY;
+ d->screen = static_cast<QWinRTScreen *>(screen());
setWindowFlags(window->flags());
setWindowState(window->windowState());
setWindowTitle(window->title());
handleContentOrientationChange(window->contentOrientation());
+
+ d->surfaceFormat.setAlphaBufferSize(0);
+ d->surfaceFormat.setRedBufferSize(8);
+ d->surfaceFormat.setGreenBufferSize(8);
+ d->surfaceFormat.setBlueBufferSize(8);
+ d->surfaceFormat.setDepthBufferSize(24);
+ d->surfaceFormat.setStencilBufferSize(8);
+ d->surfaceFormat.setRenderableType(QSurfaceFormat::OpenGLES);
+ d->surfaceFormat.setSamples(1);
+ d->surfaceFormat.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+
+ HRESULT hr;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_Xaml_Controls_Canvas).Get(),
+ IID_PPV_ARGS(&d->canvas));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = QEventDispatcherWinRT::runOnXamlThread([this, d]() {
+ // Create a new swapchain and place it inside the canvas
+ HRESULT hr;
+ hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_UI_Xaml_Controls_SwapChainPanel).Get(),
+ &d->swapChainPanel);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->swapChainPanel.As(&d->uiElement);
+ Q_ASSERT_SUCCEEDED(hr);
+
+ ComPtr<IDependencyObject> canvas = d->screen->canvas();
+ ComPtr<IPanel> panel;
+ hr = canvas.As(&panel);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IVector<UIElement *>> children;
+ hr = panel->get_Children(&children);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = children->Append(d->uiElement.Get());
+ Q_ASSERT_SUCCEEDED(hr);
+ return S_OK;
+ });
+ Q_ASSERT_SUCCEEDED(hr);
+
setGeometry(window->geometry());
}
QWinRTWindow::~QWinRTWindow()
{
- m_screen->removeWindow(window());
+ Q_D(QWinRTWindow);
+
+ HRESULT hr;
+ hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
+ HRESULT hr;
+ ComPtr<IDependencyObject> canvas = d->screen->canvas();
+ ComPtr<IPanel> panel;
+ hr = canvas.As(&panel);
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<IVector<UIElement *>> children;
+ hr = panel->get_Children(&children);
+ Q_ASSERT_SUCCEEDED(hr);
+ quint32 index;
+ boolean found;
+ hr = children->IndexOf(d->uiElement.Get(), &index, &found);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (found) {
+ hr = children->RemoveAt(index);
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ return S_OK;
+ });
+ RETURN_VOID_IF_FAILED("Failed to completely destroy window resources, likely because the application is shutting down");
+
+ if (!d->surface)
+ return;
+
+ EGLBoolean value = eglDestroySurface(d->display, d->surface);
+ d->surface = EGL_NO_SURFACE;
+ if (value == EGL_FALSE)
+ qCritical("Failed to destroy EGL window surface: 0x%x", eglGetError());
}
QSurfaceFormat QWinRTWindow::format() const
{
- return m_screen->surfaceFormat();
+ Q_D(const QWinRTWindow);
+ return d->surfaceFormat;
}
bool QWinRTWindow::isActive() const
{
- return m_screen->topWindow() == window();
+ Q_D(const QWinRTWindow);
+ return d->screen->topWindow() == window();
}
bool QWinRTWindow::isExposed() const
@@ -87,55 +204,82 @@ bool QWinRTWindow::isExposed() const
void QWinRTWindow::setGeometry(const QRect &rect)
{
- if (window()->isTopLevel()) {
- QPlatformWindow::setGeometry(m_screen->geometry());
+ Q_D(QWinRTWindow);
+
+ const Qt::WindowFlags windowFlags = window()->flags();
+ const Qt::WindowFlags windowType = windowFlags & Qt::WindowType_Mask;
+ if (window()->isTopLevel() && (windowType == Qt::Window || windowType == Qt::Dialog)) {
+ QPlatformWindow::setGeometry(windowFlags & Qt::MaximizeUsingFullscreenGeometryHint
+ ? d->screen->geometry() : d->screen->availableGeometry());
QWindowSystemInterface::handleGeometryChange(window(), geometry());
} else {
QPlatformWindow::setGeometry(rect);
QWindowSystemInterface::handleGeometryChange(window(), rect);
}
+
+ HRESULT hr;
+ hr = QEventDispatcherWinRT::runOnXamlThread([this, d]() {
+ HRESULT hr;
+ const QRect windowGeometry = geometry();
+ const QPointF topLeft= QPointF(windowGeometry.topLeft()) / d->screen->scaleFactor();
+ hr = d->canvas->SetTop(d->uiElement.Get(), topLeft.y());
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = d->canvas->SetLeft(d->uiElement.Get(), topLeft.x());
+ Q_ASSERT_SUCCEEDED(hr);
+ ComPtr<Xaml::IFrameworkElement> frameworkElement;
+ hr = d->swapChainPanel.As(&frameworkElement);
+ Q_ASSERT_SUCCEEDED(hr);
+ const QSizeF size = QSizeF(windowGeometry.size()) / d->screen->scaleFactor();
+ hr = frameworkElement->put_Width(size.width());
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = frameworkElement->put_Height(size.height());
+ Q_ASSERT_SUCCEEDED(hr);
+ return S_OK;
+ });
+ Q_ASSERT_SUCCEEDED(hr);
}
void QWinRTWindow::setVisible(bool visible)
{
+ Q_D(QWinRTWindow);
if (!window()->isTopLevel())
return;
- if (visible)
- m_screen->addWindow(window());
- else
- m_screen->removeWindow(window());
+ if (visible) {
+ d->screen->addWindow(window());
+ setUIElementVisibility(d->uiElement.Get(), d->state != Qt::WindowMinimized);
+ } else {
+ d->screen->removeWindow(window());
+ setUIElementVisibility(d->uiElement.Get(), false);
+ }
}
void QWinRTWindow::setWindowTitle(const QString &title)
{
- ComPtr<IApplicationViewStatics2> statics;
- HRESULT hr;
-
- hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_ApplicationView).Get(),
- IID_PPV_ARGS(&statics));
- RETURN_VOID_IF_FAILED("Could not get ApplicationViewStatics");
-
- ComPtr<IApplicationView> view;
- hr = statics->GetForCurrentView(&view);
- RETURN_VOID_IF_FAILED("Could not access currentView");
-
- HStringReference str(reinterpret_cast<LPCWSTR>(title.utf16()), title.length());
- hr = view->put_Title(str.Get());
- RETURN_VOID_IF_FAILED("Unable to set window title");
+ Q_D(QWinRTWindow);
+ d->windowTitle = title;
+ d->screen->updateWindowTitle();
}
void QWinRTWindow::raise()
{
+ Q_D(QWinRTWindow);
if (!window()->isTopLevel())
return;
- m_screen->raise(window());
+ d->screen->raise(window());
}
void QWinRTWindow::lower()
{
+ Q_D(QWinRTWindow);
if (!window()->isTopLevel())
return;
- m_screen->lower(window());
+ d->screen->lower(window());
+}
+
+WId QWinRTWindow::winId() const
+{
+ Q_D(const QWinRTWindow);
+ return WId(d->swapChainPanel.Get());
}
qreal QWinRTWindow::devicePixelRatio() const
@@ -143,4 +287,45 @@ qreal QWinRTWindow::devicePixelRatio() const
return screen()->devicePixelRatio();
}
+void QWinRTWindow::setWindowState(Qt::WindowState state)
+{
+ Q_D(QWinRTWindow);
+ if (d->state == state)
+ return;
+
+#ifdef Q_OS_WINPHONE
+ d->screen->setStatusBarVisibility(state == Qt::WindowMaximized || state == Qt::WindowNoState, window());
+#endif
+
+ if (state == Qt::WindowMinimized)
+ setUIElementVisibility(d->uiElement.Get(), false);
+
+ if (d->state == Qt::WindowMinimized)
+ setUIElementVisibility(d->uiElement.Get(), true);
+
+ d->state = state;
+}
+
+EGLSurface QWinRTWindow::eglSurface() const
+{
+ Q_D(const QWinRTWindow);
+ return d->surface;
+}
+
+void QWinRTWindow::createEglSurface(EGLDisplay display, EGLConfig config)
+{
+ Q_D(QWinRTWindow);
+ if (d->surface == EGL_NO_SURFACE) {
+ d->display = display;
+ QEventDispatcherWinRT::runOnXamlThread([this, d, display, config]() {
+ d->surface = eglCreateWindowSurface(display, config,
+ reinterpret_cast<EGLNativeWindowType>(winId()),
+ nullptr);
+ if (d->surface == EGL_NO_SURFACE)
+ qCritical("Failed to create EGL window surface: 0x%x", eglGetError());
+ return S_OK;
+ });
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.h b/src/plugins/platforms/winrt/qwinrtwindow.h
index 3cfe346ab2..9ac7adbf4d 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.h
+++ b/src/plugins/platforms/winrt/qwinrtwindow.h
@@ -39,11 +39,11 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
+#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
-class QWinRTScreen;
-
+class QWinRTWindowPrivate;
class QWinRTWindow : public QPlatformWindow
{
public:
@@ -59,10 +59,17 @@ public:
void raise();
void lower();
+ WId winId() const Q_DECL_OVERRIDE;
+
qreal devicePixelRatio() const Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+
+ EGLSurface eglSurface() const;
+ void createEglSurface(EGLDisplay display, EGLConfig config);
private:
- QWinRTScreen *m_screen;
+ QScopedPointer<QWinRTWindowPrivate> d_ptr;
+ Q_DECLARE_PRIVATE(QWinRTWindow)
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro
index 80429daeed..be6aad02d1 100644
--- a/src/plugins/platforms/winrt/winrt.pro
+++ b/src/plugins/platforms/winrt/winrt.pro
@@ -1,14 +1,6 @@
TARGET = qwinrt
CONFIG -= precompile_header
-# For Windows Phone 8 we have to deploy fonts together with the application as DirectWrite
-# is not supported here.
-winphone:equals(WINSDK_VER, 8.0): {
- fonts.path = $$[QT_INSTALL_LIBS]/fonts
- fonts.files = $$QT_SOURCE_TREE/lib/fonts/DejaVu*.ttf
- INSTALLS += fonts
-}
-
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QWinRTIntegrationPlugin
!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
@@ -18,13 +10,8 @@ QT += core-private gui-private platformsupport-private
DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__ GL_GLEXT_PROTOTYPES
-LIBS += $$QMAKE_LIBS_CORE
-
-!if(winphone:equals(WINSDK_VER, 8.0)) {
- LIBS += -ldwrite
- INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/freetype/include
- DEFINES += QT_WINRT_USE_DWRITE
-}
+LIBS += $$QMAKE_LIBS_CORE -ldwrite -ld3d11
+INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/freetype/include
SOURCES = \
main.cpp \
@@ -60,9 +47,4 @@ HEADERS = \
qwinrttheme.h \
qwinrtwindow.h
-winphone:equals(WINSDK_VER, 8.0): {
- SOURCES -= qwinrtplatformmessagedialoghelper.cpp
- HEADERS -= qwinrtplatformmessagedialoghelper.h
-}
-
OTHER_FILES += winrt.json
diff --git a/src/plugins/platforms/xcb/README b/src/plugins/platforms/xcb/README
index 2f666bebfd..15cf4cf241 100644
--- a/src/plugins/platforms/xcb/README
+++ b/src/plugins/platforms/xcb/README
@@ -3,14 +3,14 @@ Requires libxcb >= 1.5.
PACKAGE DEPENDENCIES
Required packages:
-libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev
+libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxcb-xinerama0-dev
On Ubuntu 11.10 icccm1 is replaced by icccm4 and xcb-render-util is not available:
-libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev
+libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxcb-xinerama0-dev
The packages for xcb-render-util can be installed manually from http://packages.ubuntu.com/natty/libxcb-render-util0 and http://packages.ubuntu.com/natty/libxcb-render-util0-dev
On Ubuntu 12.04 icccm1 is replaced by icccm4 and xcb-render-util can be installed automatically:
-libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev
+libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev libxcb-xinerama0-dev
On Fedora, the following packages are required:
diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp
index 10411e72e2..508f5e82e6 100644
--- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp
@@ -78,6 +78,7 @@ QStringList QXcbGlIntegrationFactory::keys(const QString &pluginPath)
list.append(loader()->keyMap().values());
return list;
#else
+ Q_UNUSED(pluginPath);
return QStringList();
#endif
}
@@ -93,6 +94,9 @@ QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, con
}
if (QXcbGlIntegration *ret = loadIntegration(loader(), platform))
return ret;
+#else
+ Q_UNUSED(platform);
+ Q_UNUSED(pluginPath);
#endif
return Q_NULLPTR;
}
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 22e68e3db7..9bdedcc830 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -175,7 +175,11 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
{
if (m_format.renderableType() == QSurfaceFormat::DefaultRenderableType)
+#if defined(QT_OPENGL_ES_2)
+ m_format.setRenderableType(QSurfaceFormat::OpenGLES);
+#else
m_format.setRenderableType(QSurfaceFormat::OpenGL);
+#endif
if (m_format.renderableType() != QSurfaceFormat::OpenGL && m_format.renderableType() != QSurfaceFormat::OpenGLES)
return;
@@ -188,16 +192,18 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
Window window = 0; // Temporary window used to query OpenGL context
if (config) {
+ const QByteArrayList glxExt = QByteArray(glXQueryExtensionsString(m_display, screen->screenNumber())).split(' ');
+
// Resolve entry point for glXCreateContextAttribsARB
glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
- glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
+ if (glxExt.contains("GLX_ARB_create_context"))
+ glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
- QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(m_display, screen->screenNumber())).split(' ');
- bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile");
+ const bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile");
// Use glXCreateContextAttribsARB if available
// Also, GL ES context creation requires GLX_EXT_create_context_es2_profile
- if (glxExt.contains("GLX_ARB_create_context") && glXCreateContextAttribsARB != 0
+ if (glXCreateContextAttribsARB != 0
&& (m_format.renderableType() != QSurfaceFormat::OpenGLES || (supportsProfiles && glxExt.contains("GLX_EXT_create_context_es2_profile")))) {
// Try to create an OpenGL context for each known OpenGL version in descending
// order from the requested version.
@@ -561,10 +567,12 @@ void (*QGLXContext::getProcAddress(const QByteArray &procName)) ()
if (!glXGetProcAddressARB)
#endif
{
+#ifndef QT_NO_LIBRARY
extern const QString qt_gl_library_name();
// QLibrary lib(qt_gl_library_name());
QLibrary lib(QLatin1String("GL"));
glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
+#endif
}
}
resolved = true;
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
index 57cd81ec3b..1c577e5dc9 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
@@ -17,6 +17,8 @@ contains(QT_CONFIG, xcb-glx) {
LIBS += -lxcb-glx
}
+LIBS += $$QMAKE_LIBS_DYNLOAD
+
HEADERS += \
qxcbglxintegration.h \
qxcbglxwindow.h \
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index c0f5477f82..c34bea0242 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -49,7 +49,9 @@
#include <qdebug.h>
#include <qpainter.h>
#include <qscreen.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <qpa/qplatformgraphicsbuffer.h>
+#include <private/qimage_p.h>
#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -65,6 +67,8 @@ public:
QSize size() const { return m_qimage.size(); }
+ bool hasAlpha() const { return m_hasAlpha; }
+
void put(xcb_window_t window, const QPoint &dst, const QRect &source);
void preparePaint(const QRegion &region);
@@ -82,6 +86,8 @@ private:
xcb_window_t m_gc_window;
QRegion m_dirty;
+
+ bool m_hasAlpha;
};
class QXcbShmGraphicsBuffer : public QPlatformGraphicsBuffer
@@ -145,8 +151,8 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600);
if (id == -1)
- qWarning("QXcbShmImage: shmget() failed (%d) for size %d (%dx%d)",
- errno, segmentSize, size.width(), size.height());
+ qWarning("QXcbShmImage: shmget() failed (%d: %s) for size %d (%dx%d)",
+ errno, strerror(errno), segmentSize, size.width(), size.height());
else
m_shm_info.shmid = id;
m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0);
@@ -171,6 +177,10 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
qWarning() << "QXcbBackingStore: Error while marking the shared memory segment to be destroyed";
}
+ m_hasAlpha = QImage::toPixelFormat(format).alphaUsage() == QPixelFormat::UsesAlpha;
+ if (!m_hasAlpha)
+ format = qt_alphaVersionForPainting(format);
+
m_qimage = QImage( (uchar*) m_xcb_image->data, m_xcb_image->width, m_xcb_image->height, m_xcb_image->stride, format);
m_graphics_buffer = new QXcbShmGraphicsBuffer(&m_qimage);
}
@@ -310,20 +320,16 @@ QPaintDevice *QXcbBackingStore::paintDevice()
void QXcbBackingStore::beginPaint(const QRegion &region)
{
+ if (!m_image && !m_size.isEmpty())
+ resize(m_size, QRegion());
+
if (!m_image)
return;
-
- int dpr = int(m_image->image()->devicePixelRatio());
- const int windowDpr = int(window()->devicePixelRatio());
- if (windowDpr != dpr) {
- resize(window()->size(), QRegion());
- dpr = int(m_image->image()->devicePixelRatio());
- }
-
- m_paintRegion = dpr == 1 ? region : QTransform::fromScale(dpr,dpr).map(region);
+ m_size = QSize();
+ m_paintRegion = region;
m_image->preparePaint(m_paintRegion);
- if (m_image->image()->hasAlphaChannel()) {
+ if (m_image->hasAlpha()) {
QPainter p(paintDevice());
p.setCompositionMode(QPainter::CompositionMode_Source);
const QVector<QRect> rects = m_paintRegion.rects();
@@ -369,18 +375,10 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
if (!m_image || m_image->size().isEmpty())
return;
- const int dpr = int(window->devicePixelRatio());
-
-#ifndef QT_NO_DEBUG
- const int imageDpr = int(m_image->image()->devicePixelRatio());
- if (dpr != imageDpr)
- qWarning() << "QXcbBackingStore::flush() wrong devicePixelRatio for backingstore image" << dpr << imageDpr;
-#endif
-
- QSize imageSize = m_image->size() / dpr; //because we multiply with the DPR later
+ QSize imageSize = m_image->size();
QRegion clipped = region;
- clipped &= QRect(0, 0, window->width(), window->height());
+ clipped &= QRect(QPoint(), QHighDpi::toNativePixels(window->size(), window));
clipped &= QRect(0, 0, imageSize.width(), imageSize.height()).translated(-offset);
QRect bounds = clipped.boundingRect();
@@ -398,8 +396,8 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
QVector<QRect> rects = clipped.rects();
for (int i = 0; i < rects.size(); ++i) {
- QRect rect = QRect(rects.at(i).topLeft() * dpr, rects.at(i).size() * dpr);
- m_image->put(platformWindow->xcb_window(), rect.topLeft(), rect.translated(offset * dpr));
+ QRect rect = QRect(rects.at(i).topLeft(), rects.at(i).size());
+ m_image->put(platformWindow->xcb_window(), rect.topLeft(), rect.translated(offset));
}
Q_XCB_NOOP(connection());
@@ -430,13 +428,12 @@ void QXcbBackingStore::composeAndFlush(QWindow *window, const QRegion &region, c
void QXcbBackingStore::resize(const QSize &size, const QRegion &)
{
- const int dpr = int(window()->devicePixelRatio());
- const QSize xSize = size * dpr;
- if (m_image && xSize == m_image->size() && dpr == m_image->image()->devicePixelRatio())
+ if (m_image && size == m_image->size())
return;
Q_XCB_NOOP(connection());
- QXcbScreen *screen = static_cast<QXcbScreen *>(window()->screen()->handle());
+
+ QXcbScreen *screen = window()->screen() ? static_cast<QXcbScreen *>(window()->screen()->handle()) : 0;
QPlatformWindow *pw = window()->handle();
if (!pw) {
window()->create();
@@ -445,13 +442,16 @@ void QXcbBackingStore::resize(const QSize &size, const QRegion &)
QXcbWindow* win = static_cast<QXcbWindow *>(pw);
delete m_image;
- m_image = new QXcbShmImage(screen, xSize, win->depth(), win->imageFormat());
- m_image->image()->setDevicePixelRatio(dpr);
+ if (!screen) {
+ m_image = 0;
+ m_size = size;
+ return;
+ }
+ m_image = new QXcbShmImage(screen, size, win->depth(), win->imageFormat());
// Slow path for bgr888 VNC: Create an additional image, paint into that and
// swap R and B while copying to m_image after each paint.
if (win->imageNeedsRgbSwap()) {
- m_rgbImage = QImage(xSize, win->imageFormat());
- m_rgbImage.setDevicePixelRatio(dpr);
+ m_rgbImage = QImage(size, win->imageFormat());
}
Q_XCB_NOOP(connection());
}
@@ -463,14 +463,12 @@ bool QXcbBackingStore::scroll(const QRegion &area, int dx, int dy)
if (!m_image || m_image->image()->isNull())
return false;
- const int dpr = int(m_image->image()->devicePixelRatio());
- QRegion xArea = dpr == 1 ? area : QTransform::fromScale(dpr,dpr).map(area);
m_image->preparePaint(area);
- QPoint delta(dx * dpr, dy * dpr);
- const QVector<QRect> xRects = xArea.rects();
- for (int i = 0; i < xRects.size(); ++i)
- qt_scrollRectInImage(*m_image->image(), xRects.at(i), delta);
+ QPoint delta(dx, dy);
+ const QVector<QRect> rects = area.rects();
+ for (int i = 0; i < rects.size(); ++i)
+ qt_scrollRectInImage(*m_image->image(), rects.at(i), delta);
return true;
}
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.h b/src/plugins/platforms/xcb/qxcbbackingstore.h
index b58a32d313..1bea36d423 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.h
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.h
@@ -71,6 +71,7 @@ private:
QXcbShmImage *m_image;
QRegion m_paintRegion;
QImage m_rgbImage;
+ QSize m_size;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp
index 248d1b4bbb..8b75c130fb 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
@@ -275,22 +275,8 @@ QXcbClipboard::QXcbClipboard(QXcbConnection *c)
m_clientClipboard[QClipboard::Selection] = 0;
m_timestamp[QClipboard::Clipboard] = XCB_CURRENT_TIME;
m_timestamp[QClipboard::Selection] = XCB_CURRENT_TIME;
+ m_owner = connection()->getQtSelectionOwner();
- QXcbScreen *platformScreen = screen();
-
- int x = 0, y = 0, w = 3, h = 3;
-
- m_owner = xcb_generate_id(xcb_connection());
- Q_XCB_CALL(xcb_create_window(xcb_connection(),
- XCB_COPY_FROM_PARENT, // depth -- same as root
- m_owner, // 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 window");
Q_XCB_CALL(xcb_change_property(xcb_connection(),
@@ -353,13 +339,7 @@ void QXcbClipboard::incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepte
xcb_window_t QXcbClipboard::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 connection()->getSelectionOwner(atom);
}
xcb_atom_t QXcbClipboard::atomForMode(QClipboard::Mode mode) const
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index d2e08aecee..abb48034cd 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -60,6 +60,7 @@
#include <xcb/shm.h>
#include <xcb/sync.h>
#include <xcb/xfixes.h>
+#include <xcb/xinerama.h>
#ifdef XCB_USE_XLIB
#include <X11/Xlib.h>
@@ -107,6 +108,24 @@ Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen")
#define XCB_GE_GENERIC 35
#endif
+// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
+// - "pad0" became "extension"
+// - "pad1" and "pad" became "pad0"
+// New and old version of this struct share the following fields:
+typedef struct qt_xcb_ge_event_t {
+ uint8_t response_type;
+ uint8_t extension;
+ uint16_t sequence;
+ uint32_t length;
+ uint16_t event_type;
+} qt_xcb_ge_event_t;
+
+static inline bool isXIEvent(xcb_generic_event_t *event, int opCode)
+{
+ qt_xcb_ge_event_t *e = (qt_xcb_ge_event_t *)event;
+ return e->extension == opCode;
+}
+
#ifdef XCB_USE_XLIB
static const char * const xcbConnectionErrors[] = {
"No error", /* Error 0 */
@@ -161,42 +180,6 @@ QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_ran
return 0;
}
-QXcbScreen* QXcbConnection::createScreen(QXcbVirtualDesktop* virtualDesktop,
- xcb_randr_output_t outputId,
- xcb_randr_get_output_info_reply_t *output)
-{
- QString name;
- if (output)
- name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output),
- xcb_randr_get_output_info_name_length(output));
- else {
- QByteArray displayName = m_displayName;
- int dotPos = displayName.lastIndexOf('.');
- if (dotPos != -1)
- displayName.truncate(dotPos);
- name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') + QString::number(virtualDesktop->number());
- }
-
- return new QXcbScreen(this, virtualDesktop, outputId, output, name);
-}
-
-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) {
- qWarning("failed to get the primary output of the screen");
- free(error);
- error = NULL;
- }
- const bool isPrimary = primary ? (primary->output == output) : false;
-
- return isPrimary;
-}
-
QXcbVirtualDesktop* QXcbConnection::virtualDesktopForRootWindow(xcb_window_t rootWindow)
{
foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) {
@@ -219,8 +202,9 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
// Not for us
return;
- qCDebug(lcQpaScreen) << "QXcbConnection: XCB_RANDR_NOTIFY_CRTC_CHANGE:" << crtc.crtc;
QXcbScreen *screen = findScreenForCrtc(crtc.window, crtc.crtc);
+ qCDebug(lcQpaScreen) << "QXcbConnection: XCB_RANDR_NOTIFY_CRTC_CHANGE:" << crtc.crtc
+ << "mode" << crtc.mode << "relevant screen" << screen;
// Only update geometry when there's a valid mode on the CRTC
// CRTC with node mode could mean that output has been disabled, and we'll
// get RRNotifyOutputChange notification for that.
@@ -242,17 +226,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
if (screen && output.connection == XCB_RANDR_CONNECTION_DISCONNECTED) {
qCDebug(lcQpaScreen) << "screen" << screen->name() << "has been disconnected";
-
- // Known screen removed -> delete it
- m_screens.removeOne(screen);
- foreach (QXcbScreen *otherScreen, m_screens)
- otherScreen->removeVirtualSibling((QPlatformScreen *) screen);
-
- QXcbIntegration::instance()->destroyScreen(screen);
-
- // QTBUG-40174, QTBUG-42985: If all screens are removed, wait
- // and start rendering again later if a screen becomes available.
-
+ destroyScreen(screen);
} 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) {
@@ -261,65 +235,142 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> outputInfo(
xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL));
- screen = createScreen(virtualDesktop, output.output, outputInfo.data());
- qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled";
-
- screen->setPrimary(checkOutputIsPrimary(output.window, output.output));
- foreach (QXcbScreen *otherScreen, m_screens)
- if (otherScreen->root() == output.window)
- otherScreen->addVirtualSibling(screen);
- m_screens << screen;
- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary());
-
- // Windows which had null screens have already had expose events by now.
- // They need to be told the screen is back, it's OK to render.
- foreach (QWindow *window, QGuiApplication::topLevelWindows()) {
- QXcbWindow *xcbWin = static_cast<QXcbWindow*>(window->handle());
- if (xcbWin)
- xcbWin->maybeSetScreen(screen);
+ // Find a fake screen
+ foreach (QPlatformScreen *scr, virtualDesktop->screens()) {
+ QXcbScreen *xcbScreen = (QXcbScreen *)scr;
+ if (xcbScreen->output() == XCB_NONE) {
+ screen = xcbScreen;
+ break;
+ }
+ }
+
+ if (screen) {
+ QString nameWas = screen->name();
+ // Transform the fake screen into a physical screen
+ screen->setOutput(output.output, outputInfo.data());
+ updateScreen(screen, output);
+ qCDebug(lcQpaScreen) << "output" << screen->name()
+ << "is connected and enabled; was fake:" << nameWas;
+ } else {
+ screen = createScreen(virtualDesktop, output, outputInfo.data());
+ qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled";
}
}
- // else ignore disabled screens
} else if (screen) {
- // Screen has been disabled -> remove
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));
if (outputInfo->crtc == XCB_NONE) {
qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled";
- m_screens.removeOne(screen);
- foreach (QXcbScreen *otherScreen, m_screens)
- otherScreen->removeVirtualSibling((QPlatformScreen *) screen);
- QXcbIntegration::instance()->destroyScreen(screen);
+ destroyScreen(screen);
} else {
qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch";
+ // Reset crtc to skip RRCrtcChangeNotify events,
+ // because they may be invalid in the middle of the mode switch
+ screen->setCrtc(XCB_NONE);
}
} else {
- // Just update existing screen
- screen->updateGeometry(output.config_timestamp);
- const bool wasPrimary = screen->isPrimary();
- screen->setPrimary(checkOutputIsPrimary(output.window, output.output));
- if (screen->mode() != output.mode)
- screen->updateRefreshRate(output.mode);
-
- // If the screen became primary, reshuffle the order in QGuiApplicationPrivate
- // TODO: add a proper mechanism for updating primary screen
- if (!wasPrimary && screen->isPrimary()) {
- QScreen *realScreen = static_cast<QPlatformScreen*>(screen)->screen();
- QGuiApplicationPrivate::screen_list.removeOne(realScreen);
- QGuiApplicationPrivate::screen_list.prepend(realScreen);
- m_screens.removeOne(screen);
- m_screens.prepend(screen);
- }
+ updateScreen(screen, output);
qCDebug(lcQpaScreen) << "output has changed" << screen;
}
}
+
+ qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name();
+ }
+}
+
+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) {
+ qWarning("failed to get the primary output of the screen");
+ free(error);
+ error = NULL;
+ }
+ const bool isPrimary = primary ? (primary->output == output) : false;
+
+ return isPrimary;
+}
+
+void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange)
+{
+ screen->setCrtc(outputChange.crtc); // Set the new crtc, because it can be invalid
+ screen->updateGeometry(outputChange.config_timestamp);
+ if (screen->mode() != outputChange.mode)
+ screen->updateRefreshRate(outputChange.mode);
+ // Only screen which belongs to the primary virtual desktop can be a primary screen
+ if (screen->screenNumber() == m_primaryScreenNumber) {
+ if (!screen->isPrimary() && checkOutputIsPrimary(outputChange.window, outputChange.output)) {
+ screen->setPrimary(true);
+
+ // If the screen became primary, reshuffle the order in QGuiApplicationPrivate
+ const int idx = m_screens.indexOf(screen);
+ if (idx > 0) {
+ m_screens.first()->setPrimary(false);
+ m_screens.swap(0, idx);
+ }
+ screen->virtualDesktop()->setPrimaryScreen(screen);
+ QXcbIntegration::instance()->setPrimaryScreen(screen);
+ }
+ }
+}
+
+QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop,
+ const xcb_randr_output_change_t &outputChange,
+ xcb_randr_get_output_info_reply_t *outputInfo)
+{
+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputChange.output, outputInfo);
+ // Only screen which belongs to the primary virtual desktop can be a primary screen
+ if (screen->screenNumber() == m_primaryScreenNumber)
+ screen->setPrimary(checkOutputIsPrimary(outputChange.window, outputChange.output));
+
+ if (screen->isPrimary()) {
if (!m_screens.isEmpty())
- qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name();
- else
- qCDebug(lcQpaScreen) << "no outputs";
+ m_screens.first()->setPrimary(false);
+
+ m_screens.prepend(screen);
+ } else {
+ m_screens.append(screen);
+ }
+ virtualDesktop->addScreen(screen);
+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary());
+
+ return screen;
+}
+
+void QXcbConnection::destroyScreen(QXcbScreen *screen)
+{
+ QXcbVirtualDesktop *virtualDesktop = screen->virtualDesktop();
+ if (virtualDesktop->screens().count() == 1) {
+ // If there are no other screens on the same virtual desktop,
+ // then transform the physical screen into a fake screen.
+ const QString nameWas = screen->name();
+ screen->setOutput(XCB_NONE, Q_NULLPTR);
+ qCDebug(lcQpaScreen) << "transformed" << nameWas << "to fake" << screen;
+ } else {
+ // There is more than one screen on the same virtual desktop, remove the screen
+ m_screens.removeOne(screen);
+ virtualDesktop->removeScreen(screen);
+
+ // When primary screen is removed, set the new primary screen
+ // which belongs to the primary virtual desktop.
+ if (screen->isPrimary()) {
+ QXcbScreen *newPrimary = (QXcbScreen *)virtualDesktop->screens().at(0);
+ newPrimary->setPrimary(true);
+ const int idx = m_screens.indexOf(newPrimary);
+ if (idx > 0)
+ m_screens.swap(0, idx);
+ QXcbIntegration::instance()->setPrimaryScreen(newPrimary);
+ }
+
+ QXcbIntegration::instance()->destroyScreen(screen);
}
}
@@ -327,8 +378,7 @@ void QXcbConnection::initializeScreens()
{
xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup);
int xcbScreenNumber = 0; // screen number in the xcb sense
- QXcbScreen* primaryScreen = Q_NULLPTR;
- bool hasOutputs = false;
+ QXcbScreen *primaryScreen = Q_NULLPTR;
while (it.rem) {
// Each "screen" in xcb terminology is a virtual desktop,
// potentially a collection of separate juxtaposed monitors.
@@ -338,7 +388,6 @@ void QXcbConnection::initializeScreens()
QXcbVirtualDesktop *virtualDesktop = new QXcbVirtualDesktop(this, xcbScreen, xcbScreenNumber);
m_virtualDesktops.append(virtualDesktop);
QList<QPlatformScreen *> siblings;
- int outputCount = 0;
if (has_randr_extension) {
xcb_generic_error_t *error = NULL;
// RRGetScreenResourcesCurrent is fast but it may return nothing if the
@@ -355,7 +404,7 @@ void QXcbConnection::initializeScreens()
} else {
xcb_timestamp_t timestamp;
xcb_randr_output_t *outputs = Q_NULLPTR;
- outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data());
+ int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data());
if (outputCount) {
timestamp = resources_current->config_timestamp;
outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.data());
@@ -405,9 +454,8 @@ void QXcbConnection::initializeScreens()
continue;
}
- QXcbScreen *screen = createScreen(virtualDesktop, outputs[i], output.data());
+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.data());
siblings << screen;
- hasOutputs = true;
m_screens << screen;
// There can be multiple outputs per screen, use either
@@ -427,46 +475,65 @@ 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);
+ if (screens) {
+ xcb_xinerama_screen_info_iterator_t it = xcb_xinerama_query_screens_screen_info_iterator(screens);
+ while (it.rem) {
+ xcb_xinerama_screen_info_t *screen_info = it.data;
+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop,
+ XCB_NONE, Q_NULLPTR,
+ screen_info, it.index);
+ siblings << screen;
+ m_screens << screen;
+ xcb_xinerama_screen_info_next(&it);
+ }
+ free(screens);
+ }
}
- foreach (QPlatformScreen* s, siblings)
- ((QXcbScreen*)s)->setVirtualSiblings(siblings);
+ if (siblings.isEmpty()) {
+ // If there are no XRandR outputs or XRandR extension is missing,
+ // then create a fake/legacy screen.
+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR);
+ qCDebug(lcQpaScreen) << "created fake screen" << screen;
+ m_screens << screen;
+ if (m_primaryScreenNumber == xcbScreenNumber) {
+ primaryScreen = screen;
+ primaryScreen->setPrimary(true);
+ }
+ siblings << screen;
+ }
+ virtualDesktop->setScreens(siblings);
xcb_screen_next(&it);
++xcbScreenNumber;
} // for each xcb screen
- // If there's no randr extension, or there was some error above, or we found a
- // screen which doesn't have outputs for some other reason (e.g. on VNC or ssh -X),
- // but the dimensions are known anyway, and we don't already have any lingering
- // (possibly disconnected) screens, then showing windows should be possible,
- // so create one screen. (QTBUG-31389)
- QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0);
- if (virtualDesktop && !hasOutputs && !virtualDesktop->size().isEmpty() && m_screens.isEmpty()) {
- QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR);
- screen->setVirtualSiblings(QList<QPlatformScreen *>() << screen);
- m_screens << screen;
- primaryScreen = screen;
- primaryScreen->setPrimary(true);
- qCDebug(lcQpaScreen) << "found a screen with zero outputs" << screen;
- }
+ foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops)
+ virtualDesktop->subscribeToXFixesSelectionNotify();
- // Ensure the primary screen is first in the list
- if (primaryScreen) {
- Q_ASSERT(!m_screens.isEmpty());
- if (m_screens.first() != primaryScreen) {
- m_screens.removeOne(primaryScreen);
- m_screens.prepend(primaryScreen);
+ if (m_virtualDesktops.isEmpty()) {
+ qFatal("QXcbConnection: no screens available");
+ } else {
+ // Ensure the primary screen is first on the list
+ if (primaryScreen) {
+ if (m_screens.first() != primaryScreen) {
+ m_screens.removeOne(primaryScreen);
+ m_screens.prepend(primaryScreen);
+ }
}
- }
- // Push the screens to QApplication
- QXcbIntegration *integration = QXcbIntegration::instance();
- foreach (QXcbScreen* screen, m_screens) {
- qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")";
- integration->screenAdded(screen, screen->isPrimary());
- }
+ // Push the screens to QGuiApplication
+ foreach (QXcbScreen *screen, m_screens) {
+ qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")";
+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary());
+ }
- if (!m_screens.isEmpty())
qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name();
+ }
}
QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName)
@@ -482,16 +549,19 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
, xfixes_first_event(0)
, xrandr_first_event(0)
, xkb_first_event(0)
+ , has_xinerama_extension(false)
, has_shape_extension(false)
, has_randr_extension(false)
, has_input_shape(false)
, has_xkb(false)
, m_buttons(0)
, m_focusWindow(0)
+ , m_mouseGrabber(0)
, m_clientLeader(0)
, m_systemTrayTracker(0)
, m_glIntegration(Q_NULLPTR)
, m_xiGrab(false)
+ , m_qtSelectionOwner(0)
{
#ifdef XCB_USE_XLIB
Display *dpy = XOpenDisplay(m_displayName.constData());
@@ -535,13 +605,13 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
m_time = XCB_CURRENT_TIME;
m_netWmUserTime = XCB_CURRENT_TIME;
- initializeXRandr();
+ if (!qEnvironmentVariableIsSet("QT_XCB_NO_XRANDR"))
+ initializeXRandr();
+ if (!has_randr_extension)
+ initializeXinerama();
+ initializeXFixes();
initializeScreens();
- if (m_screens.isEmpty())
- qFatal("QXcbConnection: no screens available");
-
- initializeXFixes();
initializeXRender();
m_xi2Enabled = false;
#if defined(XCB_USE_XINPUT2)
@@ -590,9 +660,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
qCDebug(QT_XCB_GLINTEGRATION) << "Failed to create xcb gl-integration";
sync();
-
- if (qEnvironmentVariableIsEmpty("QT_IM_MODULE"))
- qputenv("QT_IM_MODULE", QByteArray("compose"));
}
QXcbConnection::~QXcbConnection()
@@ -1075,8 +1142,12 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_FOCUS_OUT:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_focus_out_event_t, event, handleFocusOutEvent);
case XCB_KEY_PRESS:
- m_keyboard->updateXKBStateFromCore(((xcb_key_press_event_t *)event)->state);
+ {
+ xcb_key_press_event_t *kp = (xcb_key_press_event_t *)event;
+ m_keyboard->updateXKBStateFromCore(kp->state);
+ setTime(kp->time);
HANDLE_KEYBOARD_EVENT(xcb_key_press_event_t, handleKeyPressEvent);
+ }
case XCB_KEY_RELEASE:
m_keyboard->updateXKBStateFromCore(((xcb_key_release_event_t *)event)->state);
HANDLE_KEYBOARD_EVENT(xcb_key_release_event_t, handleKeyReleaseEvent);
@@ -1110,12 +1181,21 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
handled = false;
break;
case XCB_PROPERTY_NOTIFY:
- HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent);
+ {
+ xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event;
+ if (pn->atom == atom(QXcbAtom::_NET_WORKAREA)) {
+ QXcbVirtualDesktop *virtualDesktop = virtualDesktopForRootWindow(pn->window);
+ if (virtualDesktop)
+ virtualDesktop->updateWorkArea();
+ } else {
+ HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent);
+ }
break;
+ }
#if defined(XCB_USE_XINPUT2)
case XCB_GE_GENERIC:
// Here the windowEventListener is invoked from xi2HandleEvent()
- if (m_xi2Enabled)
+ if (m_xi2Enabled && isXIEvent(event, m_xiOpCode))
xi2HandleEvent(reinterpret_cast<xcb_ge_event_t *>(event));
break;
#endif
@@ -1127,10 +1207,14 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
if (!handled) {
if (response_type == xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY) {
- setTime(((xcb_xfixes_selection_notify_event_t *)event)->timestamp);
+ xcb_xfixes_selection_notify_event_t *notify_event = (xcb_xfixes_selection_notify_event_t *)event;
+ setTime(notify_event->timestamp);
#ifndef QT_NO_CLIPBOARD
- m_clipboard->handleXFixesSelectionRequest((xcb_xfixes_selection_notify_event_t *)event);
+ m_clipboard->handleXFixesSelectionRequest(notify_event);
#endif
+ foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops)
+ virtualDesktop->handleXFixesSelectionNotify(notify_event);
+
handled = true;
} else if (has_randr_extension && response_type == xrandr_first_event + XCB_RANDR_NOTIFY) {
updateScreens((xcb_randr_notify_event_t *)event);
@@ -1269,6 +1353,10 @@ void QXcbConnection::setFocusWindow(QXcbWindow *w)
{
m_focusWindow = w;
}
+void QXcbConnection::setMouseGrabber(QXcbWindow *w)
+{
+ m_mouseGrabber = w;
+}
void QXcbConnection::grabServer()
{
@@ -1288,10 +1376,12 @@ void QXcbConnection::sendConnectionEvent(QXcbAtom::Atom a, uint id)
memset(&event, 0, sizeof(event));
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, m_screens.at(0)->root(),
+ eventListener, screen->root,
0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
- m_screens.at(0)->screen()->root_visual, 0, 0));
+ screen->root_visual, 0, 0));
event.response_type = XCB_CLIENT_MESSAGE;
event.format = 32;
@@ -1357,6 +1447,37 @@ xcb_timestamp_t QXcbConnection::getTimestamp()
return timestamp;
}
+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;
+}
+
+xcb_window_t QXcbConnection::getQtSelectionOwner()
+{
+ if (!m_qtSelectionOwner) {
+ xcb_screen_t *xcbScreen = primaryVirtualDesktop()->screen();
+ int x = 0, y = 0, 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
+ }
+ return m_qtSelectionOwner;
+}
+
xcb_window_t QXcbConnection::rootWindow()
{
QXcbScreen *s = primaryScreen();
@@ -1437,6 +1558,105 @@ void *QXcbConnection::createVisualInfoForDefaultVisualId() const
#endif
+#if defined(XCB_USE_XINPUT2)
+// it is safe to cast XI_* events here as long as we are only touching the first 32 bytes,
+// after that position event needs memmove, see xi2PrepareXIGenericDeviceEvent
+static inline bool isXIType(xcb_generic_event_t *event, int opCode, uint16_t type)
+{
+ if (!isXIEvent(event, opCode))
+ return false;
+
+ xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
+ return xiEvent->evtype == type;
+}
+#endif
+static inline bool isValid(xcb_generic_event_t *event)
+{
+ return event && (event->response_type & ~0x80);
+}
+
+/*! \internal
+
+ Compresses events of the same type to avoid swamping the event queue.
+ If event compression is not desired there are several options what developers can do:
+
+ 1) Write responsive applications. We drop events that have been buffered in the event
+ queue while waiting on unresponsive GUI thread.
+ 2) Use QAbstractNativeEventFilter to get all events from X connection. This is not optimal
+ because it requires working with native event types.
+ 3) Or add public API to Qt for disabling event compression QTBUG-44964
+
+*/
+bool QXcbConnection::compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const
+{
+ uint responseType = event->response_type & ~0x80;
+ int nextIndex = currentIndex + 1;
+
+ if (responseType == XCB_MOTION_NOTIFY) {
+ // compress XCB_MOTION_NOTIFY notify events
+ for (int j = nextIndex; j < eventqueue->size(); ++j) {
+ xcb_generic_event_t *next = eventqueue->at(j);
+ if (!isValid(next))
+ continue;
+ if (next->response_type == XCB_MOTION_NOTIFY)
+ return true;
+ }
+ return false;
+ }
+#if defined(XCB_USE_XINPUT2)
+ // compress XI_* events
+ if (responseType == XCB_GE_GENERIC) {
+ if (!m_xi2Enabled)
+ return false;
+
+ // compress XI_Motion
+ if (isXIType(event, m_xiOpCode, XI_Motion)) {
+ for (int j = nextIndex; j < eventqueue->size(); ++j) {
+ xcb_generic_event_t *next = eventqueue->at(j);
+ if (!isValid(next))
+ continue;
+ if (isXIType(next, m_xiOpCode, XI_Motion))
+ return true;
+ }
+ return false;
+ }
+#ifdef XCB_USE_XINPUT22
+ // compress XI_TouchUpdate for the same touch point id
+ if (isXIType(event, m_xiOpCode, XI_TouchUpdate)) {
+ xXIDeviceEvent *xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
+ uint32_t id = xiDeviceEvent->detail % INT_MAX;
+ for (int j = nextIndex; j < eventqueue->size(); ++j) {
+ xcb_generic_event_t *next = eventqueue->at(j);
+ if (!isValid(next))
+ continue;
+ if (isXIType(next, m_xiOpCode, XI_TouchUpdate)) {
+ xXIDeviceEvent *xiDeviceNextEvent = reinterpret_cast<xXIDeviceEvent *>(next);
+ if (id == xiDeviceNextEvent->detail % INT_MAX)
+ return true;
+ }
+ }
+ return false;
+ }
+#endif
+ return false;
+ }
+#endif
+ if (responseType == XCB_CONFIGURE_NOTIFY) {
+ // compress multiple configure notify events for the same window
+ for (int j = nextIndex; j < eventqueue->size(); ++j) {
+ xcb_generic_event_t *next = eventqueue->at(j);
+ if (isValid(next) && next->response_type == XCB_CONFIGURE_NOTIFY
+ && ((xcb_configure_notify_event_t *)next)->event == ((xcb_configure_notify_event_t*)event)->event)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ return false;
+}
+
void QXcbConnection::processXcbEvents()
{
int connection_error = xcb_connection_has_error(xcb_connection());
@@ -1447,61 +1667,39 @@ void QXcbConnection::processXcbEvents()
QXcbEventArray *eventqueue = m_reader->lock();
- for(int i = 0; i < eventqueue->size(); ++i) {
+ for (int i = 0; i < eventqueue->size(); ++i) {
xcb_generic_event_t *event = eventqueue->at(i);
if (!event)
continue;
QScopedPointer<xcb_generic_event_t, QScopedPointerPodDeleter> eventGuard(event);
(*eventqueue)[i] = 0;
- uint response_type = event->response_type & ~0x80;
-
- if (!response_type) {
+ if (!(event->response_type & ~0x80)) {
handleXcbError((xcb_generic_error_t *)event);
- } else {
- if (response_type == XCB_MOTION_NOTIFY) {
- // compress multiple motion notify events in a row
- // to avoid swamping the event queue
- xcb_generic_event_t *next = eventqueue->value(i+1, 0);
- if (next && (next->response_type & ~0x80) == XCB_MOTION_NOTIFY)
- continue;
- }
+ continue;
+ }
- if (response_type == XCB_CONFIGURE_NOTIFY) {
- // compress multiple configure notify events for the same window
- bool found = false;
- for (int j = i; j < eventqueue->size(); ++j) {
- xcb_generic_event_t *other = eventqueue->at(j);
- if (other && (other->response_type & ~0x80) == XCB_CONFIGURE_NOTIFY
- && ((xcb_configure_notify_event_t *)other)->event == ((xcb_configure_notify_event_t *)event)->event)
- {
- found = true;
- break;
- }
- }
- if (found)
- continue;
- }
+ if (compressEvent(event, i, eventqueue))
+ continue;
- bool accepted = false;
- if (clipboard()->processIncr())
- clipboard()->incrTransactionPeeker(event, accepted);
- if (accepted)
- continue;
+ bool accepted = false;
+ if (clipboard()->processIncr())
+ clipboard()->incrTransactionPeeker(event, accepted);
+ if (accepted)
+ continue;
- QVector<PeekFunc>::iterator it = m_peekFuncs.begin();
- while (it != m_peekFuncs.end()) {
- // These callbacks return true if the event is what they were
- // waiting for, remove them from the list in that case.
- if ((*it)(this, event))
- it = m_peekFuncs.erase(it);
- else
- ++it;
- }
- m_reader->unlock();
- handleXcbEvent(event);
- m_reader->lock();
+ QVector<PeekFunc>::iterator it = m_peekFuncs.begin();
+ while (it != m_peekFuncs.end()) {
+ // These callbacks return true if the event is what they were
+ // waiting for, remove them from the list in that case.
+ if ((*it)(this, event))
+ it = m_peekFuncs.erase(it);
+ else
+ ++it;
}
+ m_reader->unlock();
+ handleXcbEvent(event);
+ m_reader->lock();
}
eventqueue->clear();
@@ -1746,7 +1944,8 @@ static const char * xcb_atomnames = {
"_XSETTINGS_SETTINGS\0"
"_COMPIZ_DECOR_PENDING\0"
"_COMPIZ_DECOR_REQUEST\0"
- "_COMPIZ_DECOR_DELETE_PIXMAP\0" // \0\0 terminates loop.
+ "_COMPIZ_DECOR_DELETE_PIXMAP\0"
+ "_COMPIZ_TOOLKIT_ACTION\0" // \0\0 terminates loop.
};
QXcbAtom::Atom QXcbConnection::qatom(xcb_atom_t xatom) const
@@ -1917,6 +2116,22 @@ void QXcbConnection::initializeXRandr()
}
}
+void QXcbConnection::initializeXinerama()
+{
+ const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xinerama_id);
+ 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);
+}
+
void QXcbConnection::initializeXShape()
{
const xcb_query_extension_reply_t *xshape_reply = xcb_get_extension_data(m_connection, &xcb_shape_id);
@@ -2004,7 +2219,9 @@ void QXcbConnection::initializeXKB()
bool QXcbConnection::xi2MouseEvents() const
{
static bool mouseViaXI2 = !qEnvironmentVariableIsSet("QT_XCB_NO_XI2_MOUSE");
- return mouseViaXI2;
+ // Don't use XInput2 when Xinerama extension is enabled,
+ // because it causes problems with multi-monitor setup.
+ return mouseViaXI2 && !has_xinerama_extension;
}
#if defined(XCB_USE_XINPUT2)
@@ -2043,41 +2260,21 @@ bool QXcbConnection::xi2GetValuatorValueIfSet(void *event, int valuatorNum, doub
return true;
}
-// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
-// - "pad0" became "extension"
-// - "pad1" and "pad" became "pad0"
-// New and old version of this struct share the following fields:
-// NOTE: API might change again in the next release of xcb in which case this comment will
-// need to be updated to reflect the reality.
-typedef struct qt_xcb_ge_event_t {
- uint8_t response_type;
- uint8_t extension;
- uint16_t sequence;
- uint32_t length;
- uint16_t event_type;
-} qt_xcb_ge_event_t;
-
-bool QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *ev, int opCode)
-{
- qt_xcb_ge_event_t *event = (qt_xcb_ge_event_t *)ev;
- // xGenericEvent has "extension" on the second byte, the same is true for xcb_ge_event_t starting from
- // the xcb version 1.9.3, prior to that it was called "pad0".
- if (event->extension == opCode) {
- // 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);
- return true;
- }
- return false;
+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 // defined(XCB_USE_XINPUT2)
-QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker()
+QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker() const
{
if (!m_systemTrayTracker) {
- if ( (m_systemTrayTracker = QXcbSystemTrayTracker::create(this)) ) {
+ QXcbConnection *self = const_cast<QXcbConnection *>(this);
+ if ((self->m_systemTrayTracker = QXcbSystemTrayTracker::create(self))) {
connect(m_systemTrayTracker, SIGNAL(systemTrayWindowChanged(QScreen*)),
QGuiApplication::platformNativeInterface(), SIGNAL(systemTrayWindowChanged(QScreen*)));
}
@@ -2085,6 +2282,22 @@ QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker()
return m_systemTrayTracker;
}
+bool QXcbConnection::xEmbedSystemTrayAvailable()
+{
+ if (!QGuiApplicationPrivate::platformIntegration())
+ return false;
+ QXcbConnection *connection = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration())->defaultConnection();
+ return connection->systemTrayTracker();
+}
+
+bool QXcbConnection::xEmbedSystemTrayVisualHasAlphaChannel()
+{
+ if (!QGuiApplicationPrivate::platformIntegration())
+ return false;
+ QXcbConnection *connection = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration())->defaultConnection();
+ return connection->systemTrayTracker() && connection->systemTrayTracker()->visualHasAlphaChannel();
+}
+
bool QXcbConnection::event(QEvent *e)
{
if (e->type() == QEvent::User + 1) {
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index a183a72353..a6a7b9e7ca 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -286,6 +286,7 @@ namespace QXcbAtom {
_COMPIZ_DECOR_PENDING,
_COMPIZ_DECOR_REQUEST,
_COMPIZ_DECOR_DELETE_PIXMAP,
+ _COMPIZ_TOOLKIT_ACTION,
NPredefinedAtoms,
@@ -375,8 +376,10 @@ public:
QXcbConnection *connection() const { return const_cast<QXcbConnection *>(this); }
+ const QList<QXcbVirtualDesktop *> &virtualDesktops() const { return m_virtualDesktops; }
const QList<QXcbScreen *> &screens() const { return m_screens; }
int primaryScreenNumber() const { return m_primaryScreenNumber; }
+ QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); }
QXcbScreen *primaryScreen() const;
inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; }
@@ -457,6 +460,8 @@ public:
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) { if (down) m_buttons |= button; else m_buttons &= ~button; }
Qt::MouseButtons buttons() const { return m_buttons; }
@@ -464,6 +469,8 @@ public:
QXcbWindow *focusWindow() const { return m_focusWindow; }
void setFocusWindow(QXcbWindow *);
+ QXcbWindow *mouseGrabber() const { return m_mouseGrabber; }
+ void setMouseGrabber(QXcbWindow *);
QByteArray startupId() const { return m_startupId; }
void setStartupId(const QByteArray &nextId) { m_startupId = nextId; }
@@ -474,7 +481,9 @@ public:
QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; }
- QXcbSystemTrayTracker *systemTrayTracker();
+ QXcbSystemTrayTracker *systemTrayTracker() const;
+ static bool xEmbedSystemTrayAvailable();
+ static bool xEmbedSystemTrayVisualHasAlphaChannel();
#ifdef XCB_USE_XINPUT2
void handleEnterEvent(const xcb_enter_notify_event_t *);
@@ -508,18 +517,22 @@ private:
void initializeXFixes();
void initializeXRender();
void initializeXRandr();
+ void initializeXinerama();
void initializeXShape();
void initializeXKB();
void handleClientMessageEvent(const xcb_client_message_event_t *event);
- QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop,
- xcb_randr_output_t outputId = XCB_NONE,
- xcb_randr_get_output_info_reply_t *output = 0);
QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc);
QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output);
QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow);
+ void updateScreens(const xcb_randr_notify_event_t *event);
bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output);
+ void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange);
+ QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop,
+ const xcb_randr_output_change_t &outputChange,
+ xcb_randr_get_output_info_reply_t *outputInfo);
+ void destroyScreen(QXcbScreen *screen);
void initializeScreens();
- void updateScreens(const xcb_randr_notify_event_t *event);
+ bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const;
bool m_xi2Enabled;
int m_xi2Minor;
@@ -572,7 +585,7 @@ private:
QHash<int, ScrollingDevice> m_scrollingDevices;
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
- static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
+ static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event);
#endif
xcb_connection_t *m_connection;
@@ -629,6 +642,7 @@ private:
uint32_t xrandr_first_event;
uint32_t xkb_first_event;
+ bool has_xinerama_extension;
bool has_shape_extension;
bool has_randr_extension;
bool has_input_shape;
@@ -637,6 +651,7 @@ private:
Qt::MouseButtons m_buttons;
QXcbWindow *m_focusWindow;
+ QXcbWindow *m_mouseGrabber;
xcb_window_t m_clientLeader;
QByteArray m_startupId;
@@ -644,6 +659,8 @@ private:
QXcbGlIntegration *m_glIntegration;
bool m_xiGrab;
+ xcb_window_t m_qtSelectionOwner;
+
friend class QXcbEventReader;
};
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 5aa1933859..e055ad1424 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -216,6 +216,12 @@ void QXcbConnection::xi2SetupDevices()
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 {
isTablet = false;
}
@@ -268,7 +274,7 @@ void QXcbConnection::finalizeXInput2()
void QXcbConnection::xi2Select(xcb_window_t window)
{
- if (!m_xi2Enabled)
+ if (!m_xi2Enabled || window == rootWindow())
return;
Display *xDisplay = static_cast<Display *>(m_xlib_display);
@@ -400,6 +406,9 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
#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))
@@ -408,14 +417,16 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
caps |= QTouchDevice::Pressure;
else if (vci->label == atom(QXcbAtom::RelX)) {
hasRelativeCoords = true;
- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution);
+ 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 / vci->resolution);
+ dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution);
} else if (vci->label == atom(QXcbAtom::AbsX)) {
- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vci->resolution);
+ caps |= QTouchDevice::Position;
+ dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution);
} else if (vci->label == atom(QXcbAtom::AbsY)) {
- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution);
+ caps |= QTouchDevice::Position;
+ dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution);
}
break;
}
@@ -459,82 +470,81 @@ static inline qreal fixed1616ToReal(FP1616 val)
void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
{
- if (xi2PrepareXIGenericDeviceEvent(event, m_xiOpCode)) {
- xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
- int sourceDeviceId = xiEvent->deviceid; // may be the master id
- xXIDeviceEvent *xiDeviceEvent = 0;
- QXcbWindowEventListener *eventListener = 0;
+ xi2PrepareXIGenericDeviceEvent(event);
+ xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
+ int sourceDeviceId = xiEvent->deviceid; // may be the master id
+ xXIDeviceEvent *xiDeviceEvent = 0;
+ QXcbWindowEventListener *eventListener = 0;
- switch (xiEvent->evtype) {
- case XI_ButtonPress:
- case XI_ButtonRelease:
- case XI_Motion:
+ switch (xiEvent->evtype) {
+ case XI_ButtonPress:
+ case XI_ButtonRelease:
+ case XI_Motion:
#ifdef XCB_USE_XINPUT22
- case XI_TouchBegin:
- case XI_TouchUpdate:
- case XI_TouchEnd:
+ case XI_TouchBegin:
+ case XI_TouchUpdate:
+ case XI_TouchEnd:
#endif
- {
- xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
- eventListener = windowEventListenerFromId(xiDeviceEvent->event);
- if (eventListener) {
- long result = 0;
- if (eventListener->handleGenericEvent(reinterpret_cast<xcb_generic_event_t *>(event), &result))
- return;
- }
- sourceDeviceId = xiDeviceEvent->sourceid; // use the actual device id instead of the master
- break;
- }
- case XI_HierarchyChanged:
- xi2HandleHierachyEvent(xiEvent);
- return;
- case XI_DeviceChanged:
- xi2HandleDeviceChangedEvent(xiEvent);
- return;
- default:
- break;
+ {
+ xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
+ eventListener = windowEventListenerFromId(xiDeviceEvent->event);
+ if (eventListener) {
+ long result = 0;
+ if (eventListener->handleGenericEvent(reinterpret_cast<xcb_generic_event_t *>(event), &result))
+ return;
}
+ sourceDeviceId = xiDeviceEvent->sourceid; // use the actual device id instead of the master
+ break;
+ }
+ case XI_HierarchyChanged:
+ xi2HandleHierachyEvent(xiEvent);
+ return;
+ case XI_DeviceChanged:
+ xi2HandleDeviceChangedEvent(xiEvent);
+ return;
+ default:
+ break;
+ }
#ifndef QT_NO_TABLETEVENT
- for (int i = 0; i < m_tabletData.count(); ++i) {
- if (m_tabletData.at(i).deviceId == sourceDeviceId) {
- if (xi2HandleTabletEvent(xiEvent, &m_tabletData[i], eventListener))
- return;
- }
+ for (int i = 0; i < m_tabletData.count(); ++i) {
+ if (m_tabletData.at(i).deviceId == sourceDeviceId) {
+ if (xi2HandleTabletEvent(xiEvent, &m_tabletData[i], eventListener))
+ return;
}
+ }
#endif // QT_NO_TABLETEVENT
#ifdef XCB_USE_XINPUT21
- QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(sourceDeviceId);
- if (device != m_scrollingDevices.end())
- xi2HandleScrollEvent(xiEvent, device.value());
+ QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(sourceDeviceId);
+ if (device != m_scrollingDevices.end())
+ xi2HandleScrollEvent(xiEvent, device.value());
#endif // XCB_USE_XINPUT21
#ifdef XCB_USE_XINPUT22
- if (xiDeviceEvent) {
- switch (xiDeviceEvent->evtype) {
- case XI_ButtonPress:
- case XI_ButtonRelease:
- case XI_Motion:
- if (xi2MouseEvents() && eventListener && !(xiDeviceEvent->flags & XIPointerEmulated))
- eventListener->handleXIMouseEvent(event);
- break;
+ if (xiDeviceEvent) {
+ switch (xiDeviceEvent->evtype) {
+ case XI_ButtonPress:
+ case XI_ButtonRelease:
+ case XI_Motion:
+ if (xi2MouseEvents() && eventListener && !(xiDeviceEvent->flags & XIPointerEmulated))
+ eventListener->handleXIMouseEvent(event);
+ break;
- case XI_TouchBegin:
- case XI_TouchUpdate:
- case XI_TouchEnd:
- if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled()))
- qCDebug(lcQpaXInput, "XI2 touch event type %d seq %d detail %d pos %6.1f, %6.1f root pos %6.1f, %6.1f on window %x",
- event->event_type, xiDeviceEvent->sequenceNumber, xiDeviceEvent->detail,
- fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y),
- fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y),xiDeviceEvent->event);
- if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event))
- xi2ProcessTouch(xiDeviceEvent, platformWindow);
- break;
- }
+ case XI_TouchBegin:
+ case XI_TouchUpdate:
+ case XI_TouchEnd:
+ if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled()))
+ qCDebug(lcQpaXInput, "XI2 touch event type %d seq %d detail %d pos %6.1f, %6.1f root pos %6.1f, %6.1f on window %x",
+ event->event_type, xiDeviceEvent->sequenceNumber, xiDeviceEvent->detail,
+ fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y),
+ fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y),xiDeviceEvent->event);
+ if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event))
+ xi2ProcessTouch(xiDeviceEvent, platformWindow);
+ break;
}
-#endif // XCB_USE_XINPUT22
}
+#endif // XCB_USE_XINPUT22
}
#ifdef XCB_USE_XINPUT22
@@ -562,10 +572,8 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo
}
QWindowSystemInterface::TouchPoint &touchPoint = dev->touchPoints[xiDeviceEvent->detail];
QXcbScreen* screen = platformWindow->xcbScreen();
- QPointF pos = screen->mapFromNative(QPointF(fixed1616ToReal(xiDeviceEvent->root_x),
- fixed1616ToReal(xiDeviceEvent->root_y)));
- qreal x = pos.x();
- qreal y = pos.y();
+ qreal x = fixed1616ToReal(xiDeviceEvent->root_x);
+ qreal y = fixed1616ToReal(xiDeviceEvent->root_y);
qreal nx = -1.0, ny = -1.0, d = 0.0;
for (int i = 0; i < dev->xiDeviceInfo->num_classes; ++i) {
XIAnyClassInfo *classinfo = dev->xiDeviceInfo->classes[i];
@@ -876,9 +884,8 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
}
}
if (!angleDelta.isNull()) {
- const int dpr = int(platformWindow->devicePixelRatio());
- QPoint local(fixed1616ToReal(xiDeviceEvent->event_x)/dpr, fixed1616ToReal(xiDeviceEvent->event_y)/dpr);
- QPoint global(fixed1616ToReal(xiDeviceEvent->root_x)/dpr, fixed1616ToReal(xiDeviceEvent->root_y)/dpr);
+ QPoint local(fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y));
+ QPoint global(fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y));
Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective_mods);
if (modifiers & Qt::AltModifier) {
std::swap(angleDelta.rx(), angleDelta.ry());
@@ -904,9 +911,8 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
angleDelta.setX(-120);
}
if (!angleDelta.isNull()) {
- const int dpr = int(platformWindow->devicePixelRatio());
- QPoint local(fixed1616ToReal(xiDeviceEvent->event_x)/dpr, fixed1616ToReal(xiDeviceEvent->event_y)/dpr);
- QPoint global(fixed1616ToReal(xiDeviceEvent->root_x)/dpr, fixed1616ToReal(xiDeviceEvent->root_y)/dpr);
+ QPoint local(fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y));
+ QPoint global(fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y));
Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective_mods);
if (modifiers & Qt::AltModifier)
std::swap(angleDelta.rx(), angleDelta.ry());
@@ -1028,9 +1034,8 @@ bool QXcbConnection::xi2HandleTabletEvent(void *event, TabletData *tabletData, Q
tabletData->inProximity = true;
tabletData->tool = toolIdToTabletDevice(tool);
tabletData->serialId = qint64(ptr[_WACSER_USB_ID]) << 32 | qint64(ptr[_WACSER_TOOL_SERIAL]);
- QWindowSystemInterface::handleTabletEnterProximityEvent(tabletData->tool,
- tabletData->pointerType,
- tabletData->serialId);
+ QWindowSystemInterface::handleTabletEnterProximityEvent(ev->time,
+ tabletData->tool, tabletData->pointerType, tabletData->serialId);
} else {
tabletData->inProximity = false;
tabletData->tool = toolIdToTabletDevice(ptr[_WACSER_LAST_TOOL_ID]);
@@ -1039,9 +1044,8 @@ bool QXcbConnection::xi2HandleTabletEvent(void *event, TabletData *tabletData, Q
if (!tabletData->tool)
tabletData->tool = toolIdToTabletDevice(ptr[_WACSER_LAST_TOOL_SERIAL]);
tabletData->serialId = qint64(ptr[_WACSER_USB_ID]) << 32 | qint64(ptr[_WACSER_LAST_TOOL_SERIAL]);
- QWindowSystemInterface::handleTabletLeaveProximityEvent(tabletData->tool,
- tabletData->pointerType,
- tabletData->serialId);
+ QWindowSystemInterface::handleTabletLeaveProximityEvent(ev->time,
+ tabletData->tool, tabletData->pointerType, tabletData->serialId);
}
// TODO maybe have a hash of tabletData->deviceId to device data so we can
// look up the tablet name here, and distinguish multiple tablets
@@ -1119,13 +1123,14 @@ void QXcbConnection::xi2ReportTabletEvent(TabletData &tabletData, void *event)
}
if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled()))
- qCDebug(lcQpaXInput, "XI2 event on tablet %d with tool %d type %d seq %d detail %d pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf",
- tabletData.deviceId, tabletData.tool, ev->evtype, ev->sequenceNumber, ev->detail,
+ qCDebug(lcQpaXInput, "XI2 event on tablet %d with tool %d type %d seq %d detail %d time %d "
+ "pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf",
+ tabletData.deviceId, tabletData.tool, ev->evtype, ev->sequenceNumber, ev->detail, ev->time,
fixed1616ToReal(ev->event_x), fixed1616ToReal(ev->event_y),
fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y),
(int)tabletData.buttons, pressure, xTilt, yTilt, rotation);
- QWindowSystemInterface::handleTabletEvent(window, local, global,
+ QWindowSystemInterface::handleTabletEvent(window, ev->time, local, global,
tabletData.tool, tabletData.pointerType,
tabletData.buttons, pressure,
xTilt, yTilt, tangentialPressure,
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index bd880698e6..b321ed95dc 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -52,7 +52,7 @@ typedef char *(*PtrXcursorLibraryGetTheme)(void *);
typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *);
typedef int (*PtrXcursorLibraryGetDefaultSize)(void *);
-#ifdef XCB_USE_XLIB
+#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
#include <X11/Xlib.h>
enum {
XCursorShape = CursorShape
@@ -300,7 +300,7 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
const char *cursorStr = "cursor";
xcb_open_font(xcb_connection(), cursorFont, strlen(cursorStr), cursorStr);
-#ifdef XCB_USE_XLIB
+#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
static bool function_ptrs_not_initialized = true;
if (function_ptrs_not_initialized) {
QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
@@ -491,7 +491,7 @@ xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
return cursor;
}
-#ifdef XCB_USE_XLIB
+#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
bool updateCursorTheme(void *dpy, const QByteArray &theme) {
if (!ptrXcursorLibraryGetTheme
|| !ptrXcursorLibrarySetTheme)
@@ -535,7 +535,7 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
}
return cursor;
}
-#endif //XCB_USE_XLIB
+#endif //XCB_USE_XLIB / QT_NO_LIBRARY
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{
@@ -544,7 +544,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
xcb_cursor_t cursor = XCB_NONE;
// Try Xcursor first
-#ifdef XCB_USE_XLIB
+#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
if (cshape >= 0 && cshape <= Qt::LastCursor) {
void *dpy = connection()->xlib_display();
// special case for non-standard dnd-* cursors
@@ -607,45 +607,47 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
}
#endif
-void QXcbCursor::queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask)
+void QXcbCursor::queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask)
{
if (pos)
*pos = QPoint();
- xcb_screen_iterator_t it = xcb_setup_roots_iterator(c->setup());
- while (it.rem) {
- xcb_window_t root = it.data->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) {
- if (pos)
- *pos = QPoint(reply->root_x, reply->root_y);
- if (rootWin)
- *rootWin = root;
- if (keybMask)
- *keybMask = reply->mask;
- free(reply);
- return;
+
+ 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) {
+ if (virtualDesktop) {
+ foreach (QXcbVirtualDesktop *vd, c->virtualDesktops()) {
+ if (vd->root() == reply->root) {
+ *virtualDesktop = vd;
+ break;
+ }
+ }
}
- free(err);
+ if (pos)
+ *pos = QPoint(reply->root_x, reply->root_y);
+ if (keybMask)
+ *keybMask = reply->mask;
free(reply);
- xcb_screen_next(&it);
+ return;
}
+ free(err);
+ free(reply);
}
QPoint QXcbCursor::pos() const
{
QPoint p;
queryPointer(connection(), 0, &p);
- return m_screen->mapFromNative(p);
+ return p;
}
void QXcbCursor::setPos(const QPoint &pos)
{
- const QPoint xPos = m_screen->mapToNative(pos);
- xcb_window_t root = 0;
- queryPointer(connection(), &root, 0);
- xcb_warp_pointer(xcb_connection(), XCB_NONE, root, 0, 0, 0, 0, xPos.x(), xPos.y());
+ QXcbVirtualDesktop *virtualDesktop = Q_NULLPTR;
+ queryPointer(connection(), &virtualDesktop, 0);
+ xcb_warp_pointer(xcb_connection(), XCB_NONE, virtualDesktop->root(), 0, 0, 0, 0, pos.x(), pos.y());
xcb_flush(xcb_connection());
}
diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h
index 7e5cdc6870..3c6dece1f2 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.h
+++ b/src/plugins/platforms/xcb/qxcbcursor.h
@@ -75,7 +75,7 @@ public:
QPoint pos() const Q_DECL_OVERRIDE;
void setPos(const QPoint &pos) Q_DECL_OVERRIDE;
- static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0);
+ static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0);
private:
#ifndef QT_NO_CURSOR
@@ -90,7 +90,7 @@ private:
#ifndef QT_NO_CURSOR
CursorHash m_cursorHash;
#endif
-#ifdef XCB_USE_XLIB
+#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen,
const QByteArray &name,
const QVariant &property,
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index 1d13adf851..9296a6d141 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -39,6 +39,7 @@
#include "qxcbwindow.h"
#include "qxcbscreen.h"
#include "qwindow.h"
+#include "qxcbcursor.h"
#include <private/qdnd_p.h>
#include <qdebug.h>
#include <qevent.h>
@@ -51,6 +52,7 @@
#include <private/qshapedpixmapdndwindow_p.h>
#include <private/qsimpledrag_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -71,12 +73,16 @@ QT_BEGIN_NAMESPACE
const int xdnd_version = 5;
+static inline xcb_window_t xcb_window(QPlatformWindow *w)
+{
+ return static_cast<QXcbWindow *>(w)->xcb_window();
+}
+
static inline xcb_window_t xcb_window(QWindow *w)
{
return static_cast<QXcbWindow *>(w->handle())->xcb_window();
}
-
static xcb_window_t xdndProxy(QXcbConnection *c, xcb_window_t w)
{
xcb_window_t proxy = XCB_NONE;
@@ -155,7 +161,7 @@ void QXcbDrag::init()
source_time = XCB_CURRENT_TIME;
target_time = XCB_CURRENT_TIME;
- current_screen = 0;
+ QXcbCursor::queryPointer(connection(), &current_virtual_desktop, 0);
drag_types.clear();
}
@@ -185,7 +191,11 @@ void QXcbDrag::startDrag()
xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, connection()->clipboard()->owner(),
atom(QXcbAtom::XdndTypelist),
XCB_ATOM_ATOM, 32, drag_types.size(), (const void *)drag_types.constData());
+
+ setUseCompositing(current_virtual_desktop->compositingActive());
QBasicDrag::startDrag();
+ if (connection()->mouseGrabber() == Q_NULLPTR)
+ shapedPixmapWindow()->setMouseGrabEnabled(true);
}
void QXcbDrag::endDrag()
@@ -297,50 +307,29 @@ xcb_window_t QXcbDrag::findRealWindow(const QPoint & pos, xcb_window_t w, int md
return 0;
}
-void QXcbDrag::move(const QMouseEvent *me)
+void QXcbDrag::move(const QPoint &globalPos)
{
- // The mouse event is in the coordinate system of the window that started the drag.
- // We do not know which window that was at this point, so we just use the device pixel ratio
- // of the QGuiApplication. This will break once we support screens with different DPR. Fixing
- // this properly requires some redesign of the drag and drop architecture.
- static const int dpr = int(qApp->devicePixelRatio());
- QBasicDrag::move(me);
- QPoint globalPos = me->globalPos();
if (source_sameanswer.contains(globalPos) && source_sameanswer.isValid())
return;
- const QList<QXcbScreen *> &screens = connection()->screens();
- QXcbScreen *screen = connection()->primaryScreen();
- for (int i = 0; i < screens.size(); ++i) {
- if (screens.at(i)->geometry().contains(globalPos)) {
- screen = screens.at(i);
- break;
- }
- }
- if (screen != current_screen) {
- // ### need to recreate the shaped pixmap window?
-// int screen = QCursor::x11Screen();
-// if ((qt_xdnd_current_screen == -1 && screen != X11->defaultScreen) || (screen != qt_xdnd_current_screen)) {
-// // recreate the pixmap on the new screen...
-// delete xdnd_data.deco;
-// QWidget* parent = object->source()->window()->x11Info().screen() == screen
-// ? object->source()->window() : QApplication::desktop()->screen(screen);
-// xdnd_data.deco = new QShapedPixmapWidget(parent);
-// if (!QWidget::mouseGrabber()) {
-// updatePixmap();
-// xdnd_data.deco->grabMouse();
-// }
-// }
-// xdnd_data.deco->move(QCursor::pos() - xdnd_data.deco->pm_hot);
- current_screen = screen;
- }
+ QXcbVirtualDesktop *virtualDesktop = Q_NULLPTR;
+ QPoint cursorPos;
+ QXcbCursor::queryPointer(connection(), &virtualDesktop, &cursorPos);
+ QXcbScreen *screen = virtualDesktop->screenAt(cursorPos);
+ QPoint deviceIndependentPos = QHighDpiScaling::mapPositionFromNative(globalPos, screen);
+ if (virtualDesktop != current_virtual_desktop) {
+ setUseCompositing(virtualDesktop->compositingActive());
+ recreateShapedPixmapWindow(static_cast<QPlatformScreen*>(screen)->screen(), deviceIndependentPos);
+ current_virtual_desktop = virtualDesktop;
+ } else {
+ QBasicDrag::moveShapedPixmapWindow(deviceIndependentPos);
+ }
-// qt_xdnd_current_screen = screen;
- xcb_window_t rootwin = current_screen->root();
+ xcb_window_t rootwin = current_virtual_desktop->root();
xcb_translate_coordinates_reply_t *translate =
- ::translateCoordinates(connection(), rootwin, rootwin, globalPos.x() * dpr, globalPos.y() * dpr);
+ ::translateCoordinates(connection(), rootwin, rootwin, globalPos.x(), globalPos.y());
if (!translate)
return;
@@ -443,7 +432,7 @@ void QXcbDrag::move(const QMouseEvent *me)
DEBUG() << "sending Xdnd enter source=" << enter.data.data32[0];
if (w)
- handleEnter(w->window(), &enter);
+ handleEnter(w, &enter, current_proxy_target);
else if (target)
xcb_send_event(xcb_connection(), false, proxy_target, XCB_EVENT_MASK_NO_EVENT, (const char *)&enter);
waiting_for_status = false;
@@ -463,7 +452,7 @@ void QXcbDrag::move(const QMouseEvent *me)
move.type = atom(QXcbAtom::XdndPosition);
move.data.data32[0] = connection()->clipboard()->owner();
move.data.data32[1] = 0; // flags
- move.data.data32[2] = (globalPos.x() * dpr << 16) + globalPos.y() * dpr;
+ move.data.data32[2] = (globalPos.x() << 16) + globalPos.y();
move.data.data32[3] = connection()->time();
move.data.data32[4] = toXdndAction(defaultAction(currentDrag()->supportedActions(), QGuiApplication::keyboardModifiers()));
DEBUG() << "sending Xdnd position source=" << move.data.data32[0] << "target=" << move.window;
@@ -471,15 +460,15 @@ void QXcbDrag::move(const QMouseEvent *me)
source_time = connection()->time();
if (w)
- handle_xdnd_position(w->window(), &move);
+ handle_xdnd_position(w, &move);
else
xcb_send_event(xcb_connection(), false, proxy_target, XCB_EVENT_MASK_NO_EVENT, (const char *)&move);
}
}
-void QXcbDrag::drop(const QMouseEvent *event)
+void QXcbDrag::drop(const QPoint &globalPos)
{
- QBasicDrag::drop(event);
+ QBasicDrag::drop(globalPos);
if (!current_target)
return;
@@ -505,7 +494,7 @@ void QXcbDrag::drop(const QMouseEvent *event)
connection()->time(),
current_target,
current_proxy_target,
- (w ? w->window() : 0),
+ w,
// current_embeddig_widget,
currentDrag(),
QTime::currentTime()
@@ -518,7 +507,7 @@ void QXcbDrag::drop(const QMouseEvent *event)
}
if (w) {
- handleDrop(w->window(), &drop);
+ handleDrop(w, &drop);
} else {
xcb_send_event(xcb_connection(), false, current_proxy_target, XCB_EVENT_MASK_NO_EVENT, (const char *)&drop);
}
@@ -664,7 +653,7 @@ static bool checkEmbedded(QWidget* w, const XEvent* xe)
#endif
-void QXcbDrag::handleEnter(QWindow *window, const xcb_client_message_event_t *event)
+void QXcbDrag::handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy)
{
Q_UNUSED(window);
DEBUG() << "handleEnter" << window;
@@ -676,6 +665,9 @@ void QXcbDrag::handleEnter(QWindow *window, const xcb_client_message_event_t *ev
return;
xdnd_dragsource = event->data.data32[0];
+ if (!proxy)
+ proxy = xdndProxy(connection(), xdnd_dragsource);
+ current_proxy_target = proxy ? proxy : xdnd_dragsource;
if (event->data.data32[1] & 1) {
// get the types from XdndTypeList
@@ -689,6 +681,7 @@ void QXcbDrag::handleEnter(QWindow *window, const xcb_client_message_event_t *ev
length = xdnd_max_type;
xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply);
+ xdnd_types.reserve(length);
for (int i = 0; i < length; ++i)
xdnd_types.append(atoms[i]);
}
@@ -704,17 +697,14 @@ void QXcbDrag::handleEnter(QWindow *window, const xcb_client_message_event_t *ev
DEBUG() << " " << connection()->atomName(xdnd_types.at(i));
}
-void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *e)
+void QXcbDrag::handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *e)
{
QPoint p((e->data.data32[2] & 0xffff0000) >> 16, e->data.data32[2] & 0x0000ffff);
Q_ASSERT(w);
QRect geometry = w->geometry();
- const int dpr = int(w->handle()->devicePixelRatio());
-
- p /= dpr;
p -= geometry.topLeft();
- if (!w || (w->type() == Qt::Desktop))
+ if (!w || !w->window() || (w->window()->type() == Qt::Desktop))
return;
if (e->data.data32[0] != xdnd_dragsource) {
@@ -723,7 +713,7 @@ void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t
}
currentPosition = p;
- currentWindow = w;
+ currentWindow = w->window();
// timestamp from the source
if (e->data.data32[3] != XCB_NONE) {
@@ -740,7 +730,7 @@ void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t
supported_actions = Qt::DropActions(toDropAction(e->data.data32[4]));
}
- QPlatformDragQtResponse qt_response = QWindowSystemInterface::handleDrag(w,dropData,p,supported_actions);
+ QPlatformDragQtResponse qt_response = QWindowSystemInterface::handleDrag(w->window(),dropData,p,supported_actions);
QRect answerRect(p + geometry.topLeft(), QSize(1,1));
answerRect = qt_response.answerRect().translated(geometry.topLeft()).intersected(geometry);
@@ -776,7 +766,7 @@ void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t
if (xdnd_dragsource == connection()->clipboard()->owner())
handle_xdnd_status(&response);
else
- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xdnd_dragsource,
+ Q_XCB_CALL(xcb_send_event(xcb_connection(), false, current_proxy_target,
XCB_EVENT_MASK_NO_EVENT, (const char *)&response));
}
@@ -796,7 +786,7 @@ namespace
};
}
-void QXcbDrag::handlePosition(QWindow * w, const xcb_client_message_event_t *event)
+void QXcbDrag::handlePosition(QPlatformWindow * w, const xcb_client_message_event_t *event)
{
xcb_client_message_event_t *lastEvent = const_cast<xcb_client_message_event_t *>(event);
xcb_generic_event_t *nextEvent;
@@ -830,12 +820,10 @@ void QXcbDrag::handle_xdnd_status(const xcb_client_message_event_t *event)
updateCursor(Qt::IgnoreAction);
}
- static const int dpr = int(qApp->devicePixelRatio());
-
if ((event->data.data32[1] & 2) == 0) {
QPoint p((event->data.data32[2] & 0xffff0000) >> 16, event->data.data32[2] & 0x0000ffff);
QSize s((event->data.data32[3] & 0xffff0000) >> 16, event->data.data32[3] & 0x0000ffff);
- source_sameanswer = QRect(p / dpr, s / dpr);
+ source_sameanswer = QRect(p, s);
} else {
source_sameanswer = QRect();
}
@@ -861,10 +849,10 @@ void QXcbDrag::handleStatus(const xcb_client_message_event_t *event)
DEBUG("xdndHandleStatus end");
}
-void QXcbDrag::handleLeave(QWindow *w, const xcb_client_message_event_t *event)
+void QXcbDrag::handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event)
{
DEBUG("xdnd leave");
- if (!currentWindow || w != currentWindow.data())
+ if (!currentWindow || w != currentWindow.data()->handle())
return; // sanity
// ###
@@ -879,7 +867,7 @@ void QXcbDrag::handleLeave(QWindow *w, const xcb_client_message_event_t *event)
DEBUG("xdnd drag leave from unexpected source (%x not %x", event->data.data32[0], xdnd_dragsource);
}
- QWindowSystemInterface::handleDrag(w,0,QPoint(),Qt::IgnoreAction);
+ QWindowSystemInterface::handleDrag(w->window(),0,QPoint(),Qt::IgnoreAction);
xdnd_dragsource = 0;
xdnd_types.clear();
@@ -909,7 +897,7 @@ void QXcbDrag::send_leave()
w = 0;
if (w)
- handleLeave(w->window(), (const xcb_client_message_event_t *)&leave);
+ handleLeave(w, (const xcb_client_message_event_t *)&leave);
else
xcb_send_event(xcb_connection(), false,current_proxy_target,
XCB_EVENT_MASK_NO_EVENT, (const char *)&leave);
@@ -920,7 +908,7 @@ void QXcbDrag::send_leave()
waiting_for_status = false;
}
-void QXcbDrag::handleDrop(QWindow *, const xcb_client_message_event_t *event)
+void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event)
{
DEBUG("xdndHandleDrop");
if (!currentWindow) {
@@ -970,7 +958,7 @@ void QXcbDrag::handleDrop(QWindow *, const xcb_client_message_event_t *event)
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, xdnd_dragsource,
+ Q_XCB_CALL(xcb_send_event(xcb_connection(), false, current_proxy_target,
XCB_EVENT_MASK_NO_EVENT, (char *)&finished));
xdnd_dragsource = 0;
@@ -1135,7 +1123,11 @@ void QXcbDrag::handleSelectionRequest(const xcb_selection_request_event_t *event
}
}
- xcb_send_event(xcb_connection(), false, event->requestor, XCB_EVENT_MASK_NO_EVENT, (const char *)&notify);
+ xcb_window_t proxy_target = xdndProxy(connection(), event->requestor);
+ if (!proxy_target)
+ proxy_target = event->requestor;
+
+ xcb_send_event(xcb_connection(), false, proxy_target, XCB_EVENT_MASK_NO_EVENT, (const char *)&notify);
}
diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h
index 95da76b732..c9d257906f 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.h
+++ b/src/plugins/platforms/xcb/qxcbdrag.h
@@ -53,8 +53,8 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
-class QMouseEvent;
class QWindow;
+class QPlatformWindow;
class QXcbConnection;
class QXcbWindow;
class QXcbDropData;
@@ -72,14 +72,14 @@ public:
void startDrag() Q_DECL_OVERRIDE;
void cancel() Q_DECL_OVERRIDE;
- void move(const QMouseEvent *me) Q_DECL_OVERRIDE;
- void drop(const QMouseEvent *me) Q_DECL_OVERRIDE;
+ void move(const QPoint &globalPos) Q_DECL_OVERRIDE;
+ void drop(const QPoint &globalPos) Q_DECL_OVERRIDE;
void endDrag() Q_DECL_OVERRIDE;
- void handleEnter(QWindow *window, const xcb_client_message_event_t *event);
- void handlePosition(QWindow *w, const xcb_client_message_event_t *event);
- void handleLeave(QWindow *w, const xcb_client_message_event_t *event);
- void handleDrop(QWindow *, const xcb_client_message_event_t *event);
+ void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0);
+ void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event);
+ void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event);
+ void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event);
void handleStatus(const xcb_client_message_event_t *event);
void handleSelectionRequest(const xcb_selection_request_event_t *event);
@@ -99,7 +99,7 @@ private:
void init();
- void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event);
+ void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event);
void handle_xdnd_status(const xcb_client_message_event_t *event);
void send_leave();
@@ -133,7 +133,7 @@ private:
// window to send events to (always valid if current_target)
xcb_window_t current_proxy_target;
- QXcbScreen *current_screen;
+ QXcbVirtualDesktop *current_virtual_desktop;
// 10 minute timer used to discard old XdndDrop transactions
enum { XdndDropTransactionTimeout = 600000 };
@@ -146,7 +146,7 @@ private:
xcb_timestamp_t timestamp;
xcb_window_t target;
xcb_window_t proxy_target;
- QWindow *targetWindow;
+ QPlatformWindow *targetWindow;
// QWidget *embedding_widget;
QPointer<QDrag> drag;
QTime time;
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index fc06f1a7b0..19e8b1de7d 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -252,6 +252,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
case ForeignWindows: return true;
case SyncState: return true;
case RasterGLSurface: return true;
+ case SwitchableWidgetComposition: return true;
default: return QPlatformIntegration::hasCapability(cap);
}
}
@@ -268,7 +269,10 @@ void QXcbIntegration::initialize()
{
// Perform everything that may potentially need the event dispatcher (timers, socket
// notifiers) here instead of the constructor.
- m_inputContext.reset(QPlatformInputContextFactory::create());
+ QString icStr = QPlatformInputContextFactory::requested();
+ if (icStr.isNull())
+ icStr = QLatin1String("compose");
+ m_inputContext.reset(QPlatformInputContextFactory::create(icStr));
}
void QXcbIntegration::moveToScreen(QWindow *window, int screen)
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index ea541e4556..2e088d3ca5 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -1545,11 +1545,13 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
QString QXcbKeyboard::lookupString(struct xkb_state *state, xcb_keycode_t code) const
{
- QByteArray chars;
- chars.resize(1 + xkb_state_key_get_utf8(state, code, 0, 0));
- // equivalent of XLookupString
- xkb_state_key_get_utf8(state, code, chars.data(), chars.size());
- return QString::fromUtf8(chars);
+ QVarLengthArray<char, 32> chars(32);
+ const int size = xkb_state_key_get_utf8(state, code, chars.data(), chars.size());
+ if (Q_UNLIKELY(size + 1 > chars.size())) { // +1 for NUL
+ chars.resize(size + 1);
+ xkb_state_key_get_utf8(state, code, chars.data(), chars.size());
+ }
+ return QString::fromUtf8(chars.constData(), size);
}
void QXcbKeyboard::handleKeyPressEvent(const xcb_key_press_event_t *event)
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 8bf9003af7..dfb0a125e2 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -47,6 +47,7 @@
#include <QtGui/qscreen.h>
#include <QtPlatformHeaders/qxcbwindowfunctions.h>
+#include <QtPlatformHeaders/qxcbintegrationfunctions.h>
#ifndef QT_NO_DBUS
#include "QtPlatformSupport/private/qdbusmenuconnection_p.h"
@@ -76,7 +77,8 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen"),
QByteArrayLiteral("rootwindow"),
QByteArrayLiteral("subpixeltype"), QByteArrayLiteral("antialiasingEnabled"),
- QByteArrayLiteral("nofonthinting")
+ QByteArrayLiteral("nofonthinting"),
+ QByteArrayLiteral("atspibus")
};
const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
const QByteArray *result = std::find(names, end, key);
@@ -85,8 +87,7 @@ static int resourceType(const QByteArray &key)
QXcbNativeInterface::QXcbNativeInterface() :
m_genericEventFilterType(QByteArrayLiteral("xcb_generic_event_t")),
- m_sysTraySelectionAtom(XCB_ATOM_NONE),
- m_systrayVisualId(XCB_NONE)
+ m_sysTraySelectionAtom(XCB_ATOM_NONE)
{
}
@@ -117,22 +118,12 @@ bool QXcbNativeInterface::systemTrayAvailable(const QScreen *screen) const
bool QXcbNativeInterface::requestSystemTrayWindowDock(const QWindow *window)
{
- const QPlatformWindow *platformWindow = window->handle();
- if (!platformWindow)
- return false;
- QXcbSystemTrayTracker *trayTracker = systemTrayTracker(window->screen());
- if (!trayTracker)
- return false;
- trayTracker->requestSystemTrayWindowDock(static_cast<const QXcbWindow *>(platformWindow)->xcb_window());
- return true;
+ return QXcbWindow::requestSystemTrayWindowDockStatic(window);
}
QRect QXcbNativeInterface::systemTrayWindowGlobalGeometry(const QWindow *window)
{
- if (const QPlatformWindow *platformWindow = window->handle())
- if (const QXcbSystemTrayTracker *trayTracker = systemTrayTracker(window->screen()))
- return trayTracker->systemTrayWindowGlobalGeometry(static_cast<const QXcbWindow *>(platformWindow)->xcb_window());
- return QRect();
+ return QXcbWindow::systemTrayWindowGlobalGeometryStatic(window);
}
xcb_window_t QXcbNativeInterface::locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen)
@@ -163,54 +154,14 @@ xcb_window_t QXcbNativeInterface::locateSystemTray(xcb_connection_t *conn, const
return selection_window;
}
-bool QXcbNativeInterface::systrayVisualHasAlphaChannel() {
- const QXcbScreen *screen = static_cast<QXcbScreen *>(QGuiApplication::primaryScreen()->handle());
-
- if (m_systrayVisualId == XCB_NONE) {
- xcb_connection_t *xcb_conn = screen->xcb_connection();
- xcb_atom_t tray_atom = screen->atom(QXcbAtom::_NET_SYSTEM_TRAY_VISUAL);
-
- xcb_window_t systray_window = locateSystemTray(xcb_conn, screen);
- if (systray_window == XCB_WINDOW_NONE)
- return false;
-
- // 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(xcb_conn, false, systray_window,
- tray_atom, XCB_ATOM_VISUALID, 0, 1);
- systray_atom_reply = xcb_get_property_reply(xcb_conn, systray_atom_cookie, 0);
-
- if (!systray_atom_reply)
- return false;
-
- 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);
- m_systrayVisualId = vids[0];
- }
-
- free(systray_atom_reply);
- }
-
- if (m_systrayVisualId != XCB_NONE) {
- quint8 depth = screen->depthOfVisual(m_systrayVisualId);
- return depth == 32;
- } else {
- return false;
- }
+bool QXcbNativeInterface::systrayVisualHasAlphaChannel()
+{
+ return QXcbConnection::xEmbedSystemTrayVisualHasAlphaChannel();
}
-void QXcbNativeInterface::setParentRelativeBackPixmap(const QWindow *qwindow)
+void QXcbNativeInterface::setParentRelativeBackPixmap(QWindow *window)
{
- if (const QPlatformWindow *platformWindow = qwindow->handle()) {
- const QXcbWindow *qxwindow = static_cast<const QXcbWindow *>(platformWindow);
- xcb_connection_t *xcb_conn = qxwindow->xcb_connection();
-
- const quint32 mask = XCB_CW_BACK_PIXMAP;
- const quint32 values[] = { XCB_BACK_PIXMAP_PARENT_RELATIVE };
- Q_XCB_CALL(xcb_change_window_attributes(xcb_conn, qxwindow->xcb_window(), mask, values));
- }
+ QXcbWindow::setParentRelativeBackPixmapStatic(window);
}
void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
@@ -233,6 +184,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour
case Display:
result = display();
break;
+ case AtspiBus:
+ result = atspiBus();
+ break;
case Connection:
result = connection();
break;
@@ -294,6 +248,9 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr
case NoFontHinting:
result = xcbScreen->noFontHinting() ? this : 0; //qboolptr...
break;
+ case RootWindow:
+ result = reinterpret_cast<void *>(xcbScreen->root());
+ break;
default:
break;
}
@@ -389,9 +346,24 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio
return func;
//case sensitive
- if (function == QXcbWindowFunctions::setWmWindowTypeIdentifier()) {
- return QFunctionPointer(QXcbWindow::setWmWindowTypeStatic);
- }
+ if (function == QXcbWindowFunctions::setWmWindowTypeIdentifier())
+ return QFunctionPointer(QXcbWindowFunctions::SetWmWindowType(QXcbWindow::setWmWindowTypeStatic));
+
+ if (function == QXcbWindowFunctions::setWmWindowIconTextIdentifier())
+ return QFunctionPointer(QXcbWindowFunctions::SetWmWindowIconText(QXcbWindow::setWindowIconTextStatic));
+
+ if (function == QXcbWindowFunctions::setParentRelativeBackPixmapIdentifier())
+ return QFunctionPointer(QXcbWindowFunctions::SetParentRelativeBackPixmap(QXcbWindow::setParentRelativeBackPixmapStatic));
+
+ if (function == QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier())
+ return QFunctionPointer(QXcbWindowFunctions::RequestSystemTrayWindowDock(QXcbWindow::requestSystemTrayWindowDockStatic));
+
+ if (function == QXcbWindowFunctions::systemTrayWindowGlobalGeometryIdentifier())
+ return QFunctionPointer(QXcbWindowFunctions::SystemTrayWindowGlobalGeometry(QXcbWindow::systemTrayWindowGlobalGeometryStatic));
+
+ if (function == QXcbIntegrationFunctions::xEmbedSystemTrayVisualHasAlphaChannelIdentifier())
+ return QFunctionPointer(QXcbIntegrationFunctions::XEmbedSystemTrayVisualHasAlphaChannel(QXcbConnection::xEmbedSystemTrayVisualHasAlphaChannel));
+
if (function == QXcbWindowFunctions::visualIdIdentifier()) {
return QFunctionPointer(QXcbWindowFunctions::VisualId(QXcbWindow::visualIdStatic));
}
@@ -466,6 +438,27 @@ void *QXcbNativeInterface::connection()
return integration->defaultConnection()->xcb_connection();
}
+void *QXcbNativeInterface::atspiBus()
+{
+ QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ QXcbConnection *defaultConnection = integration->defaultConnection();
+ if (defaultConnection) {
+ xcb_atom_t atspiBusAtom = defaultConnection->internAtom("AT_SPI_BUS");
+ xcb_get_property_cookie_t cookie = Q_XCB_CALL(xcb_get_property(defaultConnection->xcb_connection(), false,
+ defaultConnection->rootWindow(),
+ atspiBusAtom,
+ XCB_ATOM_STRING, 0, 128));
+ xcb_get_property_reply_t *reply = Q_XCB_CALL(xcb_get_property_reply(defaultConnection->xcb_connection(), cookie, 0));
+ 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;
+ }
+ return 0;
+}
+
void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)
{
if (screen) {
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 721c6f4b1d..f88b710864 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -67,7 +67,8 @@ public:
RootWindow,
ScreenSubpixelType,
ScreenAntialiasingEnabled,
- NoFontHinting
+ NoFontHinting,
+ AtspiBus
};
QXcbNativeInterface();
@@ -98,6 +99,7 @@ public:
void *x11Screen();
void *rootWindow();
void *display();
+ void *atspiBus();
void *connection();
static void setStartupId(const char *);
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
@@ -105,7 +107,7 @@ public:
Q_INVOKABLE void beep();
Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const;
- Q_INVOKABLE void setParentRelativeBackPixmap(const QWindow *window);
+ Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window);
Q_INVOKABLE bool systrayVisualHasAlphaChannel();
Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window);
Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window);
@@ -121,7 +123,6 @@ private:
const QByteArray m_genericEventFilterType;
xcb_atom_t m_sysTraySelectionAtom;
- xcb_visualid_t m_systrayVisualId;
static QXcbScreen *qPlatformScreenForWindow(QWindow *window);
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 3dcd6a713a..f3d381b99e 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -44,6 +44,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <private/qmath_p.h>
+#include <QtGui/private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -53,6 +54,12 @@ QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t
, m_number(number)
, m_xSettings(Q_NULLPTR)
{
+ QByteArray cmAtomName("_NET_WM_CM_S");
+ cmAtomName += QByteArray::number(m_number);
+ m_net_wm_cm_atom = connection->internAtom(cmAtomName.constData());
+ m_compositingActive = connection->getSelectionOwner(m_net_wm_cm_atom);
+
+ m_workArea = getWorkArea();
}
QXcbVirtualDesktop::~QXcbVirtualDesktop()
@@ -60,6 +67,27 @@ QXcbVirtualDesktop::~QXcbVirtualDesktop()
delete m_xSettings;
}
+QXcbScreen *QXcbVirtualDesktop::screenAt(const QPoint &pos) const
+{
+ foreach (QXcbScreen *screen, connection()->screens()) {
+ if (screen->virtualDesktop() == this && screen->geometry().contains(pos))
+ return screen;
+ }
+ return Q_NULLPTR;
+}
+
+void QXcbVirtualDesktop::addScreen(QPlatformScreen *s)
+{
+ ((QXcbScreen *) s)->isPrimary() ? m_screens.prepend(s) : m_screens.append(s);
+}
+
+void QXcbVirtualDesktop::setPrimaryScreen(QPlatformScreen *s)
+{
+ const int idx = m_screens.indexOf(s);
+ Q_ASSERT(idx > -1);
+ m_screens.swap(0, idx);
+}
+
QXcbXSettings *QXcbVirtualDesktop::xSettings() const
{
if (!m_xSettings) {
@@ -69,24 +97,88 @@ QXcbXSettings *QXcbVirtualDesktop::xSettings() const
return m_xSettings;
}
+bool QXcbVirtualDesktop::compositingActive() const
+{
+ if (connection()->hasXFixes())
+ return m_compositingActive;
+ else
+ return connection()->getSelectionOwner(m_net_wm_cm_atom);
+}
+
+void QXcbVirtualDesktop::handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event)
+{
+ if (notify_event->selection == m_net_wm_cm_atom)
+ m_compositingActive = notify_event->owner;
+}
+
+void QXcbVirtualDesktop::subscribeToXFixesSelectionNotify()
+{
+ 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(), connection()->getQtSelectionOwner(), m_net_wm_cm_atom, mask));
+ }
+}
+
+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);
+ 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).
+ // But QScreen doesn't know about that concept. In reality there could be a
+ // "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);
+ r = QRect(geom[0], geom[1], geom[2], geom[3]);
+ } else {
+ r = QRect(QPoint(), size());
+ }
+ free(workArea);
+ return r;
+}
+
+void QXcbVirtualDesktop::updateWorkArea()
+{
+ QRect workArea = getWorkArea();
+ if (m_workArea != workArea) {
+ m_workArea = workArea;
+ foreach (QPlatformScreen *screen, m_screens)
+ ((QXcbScreen *)screen)->updateAvailableGeometry();
+ }
+}
+
+static inline QSizeF sizeInMillimeters(const QSize &size, const QDpi &dpi)
+{
+ return QSizeF(Q_MM_PER_INCH * size.width() / dpi.first,
+ Q_MM_PER_INCH * size.height() / dpi.second);
+}
+
QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output,
- QString outputName)
+ const xcb_xinerama_screen_info_t *xineramaScreenInfo, int xineramaScreenIdx)
: QXcbObject(connection)
, m_virtualDesktop(virtualDesktop)
, m_output(outputId)
- , m_crtc(output ? output->crtc : 0)
+ , m_crtc(output ? output->crtc : XCB_NONE)
, m_mode(XCB_NONE)
, m_primary(false)
, m_rotation(XCB_RANDR_ROTATION_ROTATE_0)
- , m_outputName(outputName)
+ , m_outputName(getOutputName(output))
, m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize())
, m_virtualSize(virtualDesktop->size())
, m_virtualSizeMillimeters(virtualDesktop->physicalSize())
, m_orientation(Qt::PrimaryOrientation)
, m_refreshRate(60)
, m_forcedDpi(-1)
- , m_devicePixelRatio(1)
+ , m_pixelDensity(1)
, m_hintStyle(QFontEngine::HintStyle(-1))
, m_noFontHinting(false)
, m_subpixelType(QFontEngine::SubpixelAntialiasingType(-1))
@@ -103,26 +195,23 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
updateRefreshRate(crtc->mode);
free(crtc);
}
- } else {
- updateGeometry(output ? output->timestamp : 0);
+ } else if (xineramaScreenInfo) {
+ m_geometry = QRect(xineramaScreenInfo->x_org, xineramaScreenInfo->y_org,
+ xineramaScreenInfo->width, xineramaScreenInfo->height);
+ m_availableGeometry = m_geometry & m_virtualDesktop->workArea();
+ m_sizeMillimeters = sizeInMillimeters(m_geometry.size(), virtualDpi());
+ if (xineramaScreenIdx > -1)
+ m_outputName += QLatin1Char('-') + QString::number(xineramaScreenIdx);
}
- const int dpr = int(devicePixelRatio());
- if (m_geometry.isEmpty()) {
- m_geometry = QRect(QPoint(), m_virtualSize/dpr);
- m_nativeGeometry = QRect(QPoint(), m_virtualSize);
- }
+ if (m_geometry.isEmpty())
+ m_geometry = QRect(QPoint(), m_virtualSize);
+
if (m_availableGeometry.isEmpty())
m_availableGeometry = m_geometry;
readXResources();
- // disable font hinting when we do UI scaling
- static bool dpr_scaling_enabled = (qgetenv("QT_DEVICE_PIXEL_RATIO").toInt() > 1
- || qgetenv("QT_DEVICE_PIXEL_RATIO").toLower() == "auto");
- if (dpr_scaling_enabled)
- m_noFontHinting = true;
-
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));
@@ -196,14 +285,29 @@ QXcbScreen::~QXcbScreen()
delete m_cursor;
}
+QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo)
+{
+ QString name;
+ if (outputInfo) {
+ name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(outputInfo),
+ xcb_randr_get_output_info_name_length(outputInfo));
+ } else {
+ QByteArray displayName = connection()->displayName();
+ int dotPos = displayName.lastIndexOf('.');
+ if (dotPos != -1)
+ displayName.truncate(dotPos);
+ name = QString::fromLocal8Bit(displayName) + QLatin1Char('.')
+ + QString::number(m_virtualDesktop->number());
+ }
+ return name;
+}
QWindow *QXcbScreen::topLevelAt(const QPoint &p) const
{
xcb_window_t root = screen()->root;
- int dpr = int(devicePixelRatio());
- int x = p.x() / dpr;
- int y = p.y() / dpr;
+ int x = p.x();
+ int y = p.y();
xcb_window_t parent = root;
xcb_window_t child = root;
@@ -237,43 +341,6 @@ QWindow *QXcbScreen::topLevelAt(const QPoint &p) const
return 0;
}
-
-QPoint QXcbScreen::mapToNative(const QPoint &pos) const
-{
- const int dpr = int(devicePixelRatio());
- return (pos - m_geometry.topLeft()) * dpr + m_nativeGeometry.topLeft();
-}
-
-QPoint QXcbScreen::mapFromNative(const QPoint &pos) const
-{
- const int dpr = int(devicePixelRatio());
- return (pos - m_nativeGeometry.topLeft()) / dpr + m_geometry.topLeft();
-}
-
-QPointF QXcbScreen::mapToNative(const QPointF &pos) const
-{
- const int dpr = int(devicePixelRatio());
- return (pos - m_geometry.topLeft()) * dpr + m_nativeGeometry.topLeft();
-}
-
-QPointF QXcbScreen::mapFromNative(const QPointF &pos) const
-{
- const int dpr = int(devicePixelRatio());
- return (pos - m_nativeGeometry.topLeft()) / dpr + m_geometry.topLeft();
-}
-
-QRect QXcbScreen::mapToNative(const QRect &rect) const
-{
- const int dpr = int(devicePixelRatio());
- return QRect(mapToNative(rect.topLeft()), rect.size() * dpr);
-}
-
-QRect QXcbScreen::mapFromNative(const QRect &rect) const
-{
- const int dpr = int(devicePixelRatio());
- return QRect(mapFromNative(rect.topLeft()), rect.size() / dpr);
-}
-
void QXcbScreen::windowShown(QXcbWindow *window)
{
// Freedesktop.org Startup Notification
@@ -335,29 +402,22 @@ QDpi QXcbScreen::virtualDpi() const
Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height());
}
+
QDpi QXcbScreen::logicalDpi() const
{
static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI");
if (overrideDpi)
return QDpi(overrideDpi, overrideDpi);
- int primaryDpr = int(connection()->screens().at(0)->devicePixelRatio());
- if (m_forcedDpi > 0)
- return QDpi(m_forcedDpi/primaryDpr, m_forcedDpi/primaryDpr);
- QDpi vDpi = virtualDpi();
- return QDpi(vDpi.first/primaryDpr, vDpi.second/primaryDpr);
+ if (m_forcedDpi > 0) {
+ return QDpi(m_forcedDpi, m_forcedDpi);
+ }
+ return virtualDpi();
}
-
-qreal QXcbScreen::devicePixelRatio() const
+qreal QXcbScreen::pixelDensity() const
{
- static int override_dpr = qEnvironmentVariableIntValue("QT_DEVICE_PIXEL_RATIO");
- static bool auto_dpr = qgetenv("QT_DEVICE_PIXEL_RATIO").toLower() == "auto";
- if (override_dpr > 0)
- return override_dpr;
- if (auto_dpr)
- return m_devicePixelRatio;
- return 1.0;
+ return m_pixelDensity;
}
QPlatformCursor *QXcbScreen::cursor() const
@@ -365,6 +425,16 @@ QPlatformCursor *QXcbScreen::cursor() const
return m_cursor;
}
+void QXcbScreen::setOutput(xcb_randr_output_t outputId,
+ xcb_randr_get_output_info_reply_t *outputInfo)
+{
+ m_output = outputId;
+ m_crtc = outputInfo ? outputInfo->crtc : XCB_NONE;
+ m_mode = XCB_NONE;
+ m_outputName = getOutputName(outputInfo);
+ // TODO: Send an event to the QScreen instance that the screen changed its name
+}
+
/*!
\brief handle the XCB screen change event and update properties
@@ -433,19 +503,10 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan
updateGeometry(change_event->timestamp);
- QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry(), availableGeometry());
QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation);
QDpi ldpi = logicalDpi();
QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second);
-
- // Windows which had null screens have already had expose events by now.
- // They need to be told the screen is back, it's OK to render.
- foreach (QWindow *window, QGuiApplication::topLevelWindows()) {
- QXcbWindow *xcbWin = static_cast<QXcbWindow*>(window->handle());
- if (xcbWin)
- xcbWin->maybeSetScreen(this);
- }
}
void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp)
@@ -466,7 +527,6 @@ void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp)
void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
{
QRect xGeometry = geom;
- QRect xAvailableGeometry = xGeometry;
switch (rotation) {
case XCB_RANDR_ROTATION_ROTATE_0: // xrandr --rotate normal
m_orientation = Qt::LandscapeOrientation;
@@ -489,41 +549,25 @@ void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
// It can be that physical size is unknown while virtual size
// is known (probably back-calculated from DPI and resolution),
// e.g. on VNC or with some hardware.
- if (m_sizeMillimeters.isEmpty()) {
- QDpi dpi = virtualDpi();
- m_sizeMillimeters = QSizeF(Q_MM_PER_INCH * xGeometry.width() / dpi.first,
- Q_MM_PER_INCH * xGeometry.width() / dpi.second);
- }
-
- 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);
-
- 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 virtual desktops.
- // But QScreen doesn't know about that concept. In reality there could be a
- // "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);
- QRect virtualAvailableGeometry(geom[0], geom[1], geom[2], geom[3]);
- // Take the intersection of the desktop's available geometry with this screen's geometry
- // to get the part of the available geometry which belongs to this screen.
- xAvailableGeometry = xGeometry & virtualAvailableGeometry;
- }
- free(workArea);
+ if (m_sizeMillimeters.isEmpty())
+ m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
- m_devicePixelRatio = qRound(dpi/96);
- const int dpr = int(devicePixelRatio()); // we may override m_devicePixelRatio
- m_geometry = QRect(xGeometry.topLeft(), xGeometry.size()/dpr);
- m_nativeGeometry = QRect(xGeometry.topLeft(), xGeometry.size());
- m_availableGeometry = QRect(mapFromNative(xAvailableGeometry.topLeft()), xAvailableGeometry.size()/dpr);
+ m_pixelDensity = qRound(dpi/96);
+ m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
+ m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
}
+void QXcbScreen::updateAvailableGeometry()
+{
+ QRect availableGeometry = m_geometry & m_virtualDesktop->workArea();
+ if (m_availableGeometry != availableGeometry) {
+ m_availableGeometry = availableGeometry;
+ QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
+ }
+}
+
void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode)
{
if (!connection()->hasXRandr())
@@ -544,7 +588,8 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode)
for (; modesIter.rem; xcb_randr_mode_info_next(&modesIter)) {
xcb_randr_mode_info_t *modeInfo = modesIter.data;
if (modeInfo->id == mode) {
- m_refreshRate = modeInfo->dot_clock / (modeInfo->htotal * modeInfo->vtotal);
+ const uint32_t dotCount = modeInfo->htotal * modeInfo->vtotal;
+ m_refreshRate = (dotCount != 0) ? modeInfo->dot_clock / dotCount : 0;
m_mode = mode;
break;
}
@@ -778,11 +823,9 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen)
formatSizeF(debug, screen->physicalSize());
// TODO 5.6 if (debug.verbosity() > 2) {
debug << ", screenNumber=" << screen->screenNumber();
- debug << ", virtualSize=" << screen->virtualSize().width() << "x" << screen->virtualSize().height() << " (";
+ debug << ", virtualSize=" << screen->virtualSize().width() << 'x' << screen->virtualSize().height() << " (";
formatSizeF(debug, screen->virtualSize());
- debug << "), nativeGeometry=";
- formatRect(debug, screen->nativeGeometry());
- debug << ", orientation=" << screen->orientation();
+ debug << "), orientation=" << screen->orientation();
debug << ", depth=" << screen->depth();
debug << ", refreshRate=" << screen->refreshRate();
debug << ", root=" << hex << screen->root();
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index ccc30c0b84..f4de2b9dfd 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -39,6 +39,8 @@
#include <xcb/xcb.h>
#include <xcb/randr.h>
+#include <xcb/xfixes.h>
+#include <xcb/xinerama.h>
#include "qxcbobject.h"
#include "qxcbscreen.h"
@@ -64,30 +66,54 @@ public:
int number() const { return m_number; }
QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); }
QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); }
+ xcb_window_t root() const { return m_screen->root; }
+ QXcbScreen *screenAt(const QPoint &pos) const;
+
+ QList<QPlatformScreen *> screens() const { return m_screens; }
+ void setScreens(QList<QPlatformScreen *> sl) { m_screens = sl; }
+ void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); }
+ void addScreen(QPlatformScreen *s);
+ void setPrimaryScreen(QPlatformScreen *s);
QXcbXSettings *xSettings() const;
+ bool compositingActive() const;
+
+ QRect workArea() const { return m_workArea; }
+ void updateWorkArea();
+
+ void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event);
+ void subscribeToXFixesSelectionNotify();
+
private:
+ QRect getWorkArea() const;
+
xcb_screen_t *m_screen;
int m_number;
+ QList<QPlatformScreen *> m_screens;
QXcbXSettings *m_xSettings;
+ xcb_atom_t m_net_wm_cm_atom;
+ bool m_compositingActive;
+
+ QRect m_workArea;
};
class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen
{
public:
QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output,
- QString outputName);
+ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo,
+ const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1);
~QXcbScreen();
+ QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo);
+
QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE;
QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; }
- QRect nativeGeometry() const { return m_nativeGeometry; }
QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;}
int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; }
QImage::Format format() const Q_DECL_OVERRIDE;
@@ -96,14 +122,12 @@ public:
QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; }
QDpi virtualDpi() const;
QDpi logicalDpi() const Q_DECL_OVERRIDE;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
+ qreal pixelDensity() const Q_DECL_OVERRIDE;
QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; }
Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; }
- QList<QPlatformScreen *> virtualSiblings() const Q_DECL_OVERRIDE { return m_siblings; }
- void setVirtualSiblings(QList<QPlatformScreen *> sl) { m_siblings = sl; }
- void removeVirtualSibling(QPlatformScreen *s) { m_siblings.removeOne(s); }
- void addVirtualSibling(QPlatformScreen *s) { ((QXcbScreen *) s)->isPrimary() ? m_siblings.prepend(s) : m_siblings.append(s); }
+ QList<QPlatformScreen *> virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); }
+ QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; }
void setPrimary(bool primary) { m_primary = primary; }
bool isPrimary() const { return m_primary; }
@@ -116,6 +140,10 @@ public:
xcb_randr_crtc_t crtc() const { return m_crtc; }
xcb_randr_mode_t mode() const { return m_mode; }
+ void setOutput(xcb_randr_output_t outputId,
+ xcb_randr_get_output_info_reply_t *outputInfo);
+ 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; }
@@ -128,6 +156,7 @@ public:
void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event);
void updateGeometry(const QRect &geom, uint8_t rotation);
void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME);
+ void updateAvailableGeometry();
void updateRefreshRate(xcb_randr_mode_t mode);
void readXResources();
@@ -139,13 +168,6 @@ public:
QXcbXSettings *xSettings() const;
- QPoint mapToNative(const QPoint &pos) const;
- QPoint mapFromNative(const QPoint &pos) const;
- QPointF mapToNative(const QPointF &pos) const;
- QPointF mapFromNative(const QPointF &pos) const;
- QRect mapToNative(const QRect &rect) const;
- QRect mapFromNative(const QRect &rect) const;
-
private:
static bool xResource(const QByteArray &identifier,
const QByteArray &expectedIdentifier,
@@ -163,11 +185,9 @@ private:
QSizeF m_outputSizeMillimeters;
QSizeF m_sizeMillimeters;
QRect m_geometry;
- QRect m_nativeGeometry;
QRect m_availableGeometry;
QSize m_virtualSize;
QSizeF m_virtualSizeMillimeters;
- QList<QPlatformScreen *> m_siblings;
Qt::ScreenOrientation m_orientation;
QString m_windowManagerName;
bool m_syncRequestSupported;
@@ -176,7 +196,7 @@ private:
QXcbCursor *m_cursor;
int m_refreshRate;
int m_forcedDpi;
- int m_devicePixelRatio;
+ int m_pixelDensity;
QFontEngine::HintStyle m_hintStyle;
bool m_noFontHinting;
QFontEngine::SubpixelAntialiasingType m_subpixelType;
diff --git a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp
index 328b72234a..c2101a71c1 100644
--- a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp
+++ b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp
@@ -134,6 +134,7 @@ static void sm_setProperty(const QString &name, const QStringList &value)
SmPropValue *prop = new SmPropValue[value.count()];
int count = 0;
QList<QByteArray> vl;
+ vl.reserve(value.size());
for (QStringList::ConstIterator it = value.begin(); it != value.end(); ++it) {
prop[count].length = (*it).length();
vl.append((*it).toUtf8());
diff --git a/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp b/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp
index a4fdd70b79..1f217e8de7 100644
--- a/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp
+++ b/src/plugins/platforms/xcb/qxcbsystemtraytracker.cpp
@@ -63,14 +63,14 @@ QXcbSystemTrayTracker *QXcbSystemTrayTracker::create(QXcbConnection *connection)
const xcb_atom_t selection = connection->internAtom(netSysTray.constData());
if (!selection)
return 0;
- return new QXcbSystemTrayTracker(connection, trayAtom, selection, connection);
+
+ return new QXcbSystemTrayTracker(connection, trayAtom, selection);
}
QXcbSystemTrayTracker::QXcbSystemTrayTracker(QXcbConnection *connection,
xcb_atom_t trayAtom,
- xcb_atom_t selection,
- QObject *parent)
- : QObject(parent)
+ xcb_atom_t selection)
+ : QObject(connection)
, m_selection(selection)
, m_trayAtom(trayAtom)
, m_connection(connection)
@@ -125,6 +125,7 @@ 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);
@@ -161,9 +162,43 @@ void QXcbSystemTrayTracker::handleDestroyNotifyEvent(const xcb_destroy_notify_ev
{
if (event->window == m_trayWindow) {
m_connection->removeWindowEventListener(m_trayWindow);
- m_trayWindow = 0;
+ m_trayWindow = XCB_WINDOW_NONE;
emitSystemTrayWindowChanged();
}
}
+bool QXcbSystemTrayTracker::visualHasAlphaChannel()
+{
+ if (m_trayWindow == XCB_WINDOW_NONE)
+ return false;
+
+ 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,
+ 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);
+ systrayVisualId = vids[0];
+ }
+
+ free(systray_atom_reply);
+
+ if (systrayVisualId != XCB_NONE) {
+ quint8 depth = m_connection->primaryScreen()->depthOfVisual(systrayVisualId);
+ return depth == 32;
+ }
+
+ return false;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbsystemtraytracker.h b/src/plugins/platforms/xcb/qxcbsystemtraytracker.h
index 9c20f1729a..b619afb9c4 100644
--- a/src/plugins/platforms/xcb/qxcbsystemtraytracker.h
+++ b/src/plugins/platforms/xcb/qxcbsystemtraytracker.h
@@ -57,14 +57,14 @@ public:
void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE;
+ bool visualHasAlphaChannel();
signals:
void systemTrayWindowChanged(QScreen *screen);
private:
explicit QXcbSystemTrayTracker(QXcbConnection *connection,
xcb_atom_t trayAtom,
- xcb_atom_t selection,
- QObject *parent = 0);
+ xcb_atom_t selection);
static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection);
void emitSystemTrayWindowChanged();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 4fdebe1ebb..c6eb5aa66b 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -37,6 +37,7 @@
#include <QScreen>
#include <QtGui/QIcon>
#include <QtGui/QRegion>
+#include <QtGui/private/qhighdpiscaling_p.h>
#include "qxcbintegration.h"
#include "qxcbconnection.h"
@@ -46,6 +47,7 @@
#include "qxcbwmsupport.h"
#include "qxcbimage.h"
#include "qxcbnativeinterface.h"
+#include "qxcbsystemtraytracker.h"
#include <qpa/qplatformintegration.h>
@@ -139,71 +141,9 @@ enum QX11EmbedMessageType {
const quint32 XEMBED_VERSION = 0;
-static inline QRect mapLocalGeometryToNative(const QRect &qtRect, int dpr)
-{
- return QRect(qtRect.x() * dpr, qtRect.y() * dpr, qtRect.width() * dpr, qtRect.height() * dpr);
-}
-
-// When mapping expose events to Qt rects: round top/left towards the origin and
-// bottom/right away from the origin, making sure that we cover the whole widget
-
-static inline QPoint dpr_floor(const QPoint &p, int dpr)
-{
- return QPoint(p.x()/dpr, p.y()/dpr);
-}
-
-static inline QPoint dpr_ceil(const QPoint &p, int dpr)
-{
- return QPoint((p.x() + dpr - 1) / dpr, (p.y() + dpr - 1) / dpr);
-}
-
-static inline QSize dpr_ceil(const QSize &s, int dpr)
-{
- return QSize((s.width() + dpr - 1) / dpr, (s.height() + dpr - 1) / dpr);
-}
-
-static inline QRect mapExposeFromNative(const QRect &xRect, int dpr)
-{
- return QRect(dpr_floor(xRect.topLeft(), dpr), dpr_ceil(xRect.bottomRight(), dpr));
-}
-
-static inline QRect mapLocalGeometryFromNative(const QRect &xRect, int dpr)
-{
- return QRect(xRect.topLeft() / dpr, dpr_ceil(xRect.size(), dpr));
-}
-
QXcbScreen *QXcbWindow::parentScreen()
{
- return parent() ? static_cast<QXcbWindow*>(parent())->parentScreen() : m_xcbScreen;
-}
-
-QPoint QXcbWindow::mapToNative(const QPoint &pos, const QXcbScreen *screen) const
-{
- if (parent())
- return pos * int(screen->devicePixelRatio());
- else
- return screen->mapToNative(pos);
-}
-QPoint QXcbWindow::mapFromNative(const QPoint &pos, const QXcbScreen *screen) const
-{
- if (parent())
- return pos / int(screen->devicePixelRatio());
- else
- return screen->mapFromNative(pos);
-}
-QRect QXcbWindow::mapToNative(const QRect &rect, const QXcbScreen *screen) const
-{
- if (parent())
- return mapLocalGeometryToNative(rect, int(screen->devicePixelRatio()));
- else
- return screen->mapToNative(rect);
-}
-QRect QXcbWindow::mapFromNative(const QRect &rect, const QXcbScreen *screen) const
-{
- if (parent())
- return mapLocalGeometryFromNative(rect, int(screen->devicePixelRatio()));
- else
- return screen->mapFromNative(rect);
+ return parent() ? static_cast<QXcbWindow*>(parent())->parentScreen() : xcbScreen();
}
// Returns \c true if we should set WM_TRANSIENT_FOR on \a w
@@ -326,7 +266,6 @@ static const char *wm_window_type_property_id = "_q_xcb_wm_window_type";
QXcbWindow::QXcbWindow(QWindow *window)
: QPlatformWindow(window)
, m_window(0)
- , m_xcbScreen(0)
, m_syncCounter(0)
, m_gravity(XCB_GRAVITY_STATIC)
, m_mapped(false)
@@ -374,17 +313,14 @@ void QXcbWindow::create()
destroy();
- m_deferredExpose = false;
- m_configureNotifyPending = true;
m_windowState = Qt::WindowNoState;
Qt::WindowType type = window()->type();
QXcbScreen *currentScreen = xcbScreen();
- QRect rect = window()->geometry();
+ QRect rect = windowGeometry();
QXcbScreen *platformScreen = parent() ? parentScreen() : static_cast<QXcbScreen*>(screenForGeometry(rect));
- m_xcbScreen = platformScreen;
if (type == Qt::Desktop) {
m_window = platformScreen->root();
m_depth = platformScreen->screen()->root_depth;
@@ -424,17 +360,15 @@ void QXcbWindow::create()
if (platformScreen != currentScreen)
QWindowSystemInterface::handleWindowScreenChanged(window(), platformScreen->QPlatformScreen::screen());
- const int dpr = int(devicePixelRatio());
-
- QSize minimumSize = window()->minimumSize();
+ const QSize minimumSize = windowMinimumSize();
if (rect.width() > 0 || rect.height() > 0) {
- rect.setWidth(qBound(1, rect.width(), XCOORD_MAX/dpr));
- rect.setHeight(qBound(1, rect.height(), XCOORD_MAX/dpr));
+ rect.setWidth(qBound(1, rect.width(), XCOORD_MAX));
+ rect.setHeight(qBound(1, rect.height(), XCOORD_MAX));
} else if (minimumSize.width() > 0 || minimumSize.height() > 0) {
rect.setSize(minimumSize);
} else {
- rect.setWidth(defaultWindowWidth);
- rect.setHeight(defaultWindowHeight);
+ rect.setWidth(QHighDpi::toNativePixels(int(defaultWindowWidth), platformScreen->QPlatformScreen::screen()));
+ rect.setHeight(QHighDpi::toNativePixels(int(defaultWindowHeight), platformScreen->QPlatformScreen::screen()));
}
xcb_window_t xcb_parent_id = platformScreen->root();
@@ -451,7 +385,8 @@ void QXcbWindow::create()
resolveFormat();
#ifdef XCB_USE_XLIB
- if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) {
+ if (window()->surfaceType() != QSurface::RasterSurface
+ && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) {
XVisualInfo *visualInfo = Q_NULLPTR;
if (connection()->hasDefaultVisualId())
visualInfo = CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(this);
@@ -478,9 +413,7 @@ void QXcbWindow::create()
m_visualId = visualInfo->visualid;
- const QRect xRect = mapToNative(rect, platformScreen);
-
- m_window = XCreateWindow(DISPLAY_FROM_XCB(this), xcb_parent_id, xRect.x(), xRect.y(), xRect.width(), xRect.height(),
+ m_window = XCreateWindow(DISPLAY_FROM_XCB(this), xcb_parent_id, rect.x(), rect.y(), rect.width(), rect.height(),
0, visualInfo->depth, InputOutput, visualInfo->visual,
CWBackPixel|CWBorderPixel|CWColormap, &a);
@@ -536,16 +469,14 @@ void QXcbWindow::create()
}
m_imageFormat = imageFormatForVisual(m_depth, visual->red_mask, visual->blue_mask, &m_imageRgbSwap);
- const QRect xRect = mapToNative(rect, platformScreen);
-
Q_XCB_CALL(xcb_create_window(xcb_connection(),
m_depth,
m_window, // window id
xcb_parent_id, // parent window id
- xRect.x(),
- xRect.y(),
- xRect.width(),
- xRect.height(),
+ rect.x(),
+ rect.y(),
+ rect.width(),
+ rect.height(),
0, // border width
XCB_WINDOW_CLASS_INPUT_OUTPUT, // window class
m_visualId, // visual
@@ -565,10 +496,7 @@ void QXcbWindow::create()
properties[propertyCount++] = atom(QXcbAtom::WM_TAKE_FOCUS);
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING);
- if (platformScreen->syncRequestSupported())
- m_usingSyncProtocol = supportsSyncProtocol();
- else
- m_usingSyncProtocol = false;
+ m_usingSyncProtocol = platformScreen->syncRequestSupported();
if (m_usingSyncProtocol)
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_SYNC_REQUEST);
@@ -666,12 +594,16 @@ QXcbWindow::~QXcbWindow()
{
if (window()->type() != Qt::ForeignWindow)
destroy();
+ else if (connection()->mouseGrabber() == this)
+ connection()->setMouseGrabber(Q_NULLPTR);
}
void QXcbWindow::destroy()
{
if (connection()->focusWindow() == this)
doFocusOut();
+ if (connection()->mouseGrabber() == this)
+ connection()->setMouseGrabber(Q_NULLPTR);
if (m_syncCounter && m_usingSyncProtocol)
Q_XCB_CALL(xcb_sync_destroy_counter(xcb_connection(), m_syncCounter));
@@ -694,14 +626,6 @@ void QXcbWindow::destroy()
m_pendingSyncRequest->invalidate();
}
-void QXcbWindow::maybeSetScreen(QXcbScreen *screen)
-{
- if (!window()->screen() && screen->geometry().contains(geometry().topLeft())) {
- QWindowSystemInterface::handleWindowScreenChanged(window(), static_cast<QPlatformScreen *>(screen)->screen());
- QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size())));
- }
-}
-
void QXcbWindow::setGeometry(const QRect &rect)
{
QPlatformWindow::setGeometry(rect);
@@ -712,13 +636,11 @@ void QXcbWindow::setGeometry(const QRect &rect)
QXcbScreen *newScreen = parent() ? parentScreen() : static_cast<QXcbScreen*>(screenForGeometry(rect));
if (!newScreen)
- newScreen = currentScreen;
+ newScreen = xcbScreen();
- m_xcbScreen = newScreen;
- const QRect xRect = mapToNative(rect, newScreen);
- const QRect wmGeometry = windowToWmGeometry(xRect);
+ const QRect wmGeometry = windowToWmGeometry(rect);
- if (newScreen != currentScreen)
+ if (newScreen && newScreen != currentScreen)
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen());
if (qt_window_private(window())->positionAutomatic) {
@@ -842,6 +764,13 @@ void QXcbWindow::setVisible(bool visible)
hide();
}
+static inline bool testShowWithoutActivating(const QWindow *window)
+{
+ // QWidget-attribute Qt::WA_ShowWithoutActivating.
+ const QVariant showWithoutActivating = window->property("_q_showWithoutActivating");
+ return showWithoutActivating.isValid() && showWithoutActivating.toBool();
+}
+
void QXcbWindow::show()
{
if (window()->isTopLevel()) {
@@ -889,7 +818,9 @@ void QXcbWindow::show()
updateNetWmStateBeforeMap();
}
- if (connection()->time() != XCB_TIME_CURRENT_TIME)
+ if (testShowWithoutActivating(window()))
+ updateNetWmUserTime(0);
+ else if (connection()->time() != XCB_TIME_CURRENT_TIME)
updateNetWmUserTime(connection()->time());
if (window()->objectName() == QLatin1String("QSystemTrayIconSysWindow"))
@@ -910,18 +841,19 @@ void QXcbWindow::hide()
Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window));
// send synthetic UnmapNotify event according to icccm 4.1.4
- if (xcbScreen()) {
- xcb_unmap_notify_event_t event;
- event.response_type = XCB_UNMAP_NOTIFY;
- 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_unmap_notify_event_t event;
+ event.response_type = XCB_UNMAP_NOTIFY;
+ 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_flush(xcb_connection());
+ if (connection()->mouseGrabber() == this)
+ connection()->setMouseGrabber(Q_NULLPTR);
+
m_mapped = false;
}
@@ -1179,6 +1111,9 @@ void QXcbWindow::setMotifWindowFlags(Qt::WindowFlags flags)
mwmhints.flags |= MWM_HINTS_DECORATIONS;
bool customize = flags & Qt::CustomizeWindowHint;
+ if (type == Qt::Window && !customize)
+ flags |= Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
+
if (!(flags & Qt::FramelessWindowHint) && !(customize && !(flags & Qt::WindowTitleHint))) {
mwmhints.decorations |= MWM_DECOR_BORDER;
mwmhints.decorations |= MWM_DECOR_RESIZEH;
@@ -1243,8 +1178,6 @@ void QXcbWindow::changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two)
event.data.data32[3] = 0;
event.data.data32[4] = 0;
- if (!xcbScreen())
- return;
Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event));
}
@@ -1328,7 +1261,7 @@ void QXcbWindow::updateMotifWmHintsBeforeMap()
mwmhints.flags &= ~MWM_HINTS_INPUT_MODE;
}
- if (window()->minimumSize() == window()->maximumSize()) {
+ if (windowMinimumSize() == windowMaximumSize()) {
// fixed size, remove the resize handle (since mwm/dtwm
// isn't smart enough to do it itself)
mwmhints.flags |= MWM_HINTS_FUNCTIONS;
@@ -1393,7 +1326,11 @@ void QXcbWindow::updateNetWmStateBeforeMap()
void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp)
{
xcb_window_t wid = m_window;
- connection()->setNetWmUserTime(timestamp);
+ // If timestamp == 0, then it means that the window should not be
+ // initially activated. Don't update global user time for this
+ // special case.
+ if (timestamp != 0)
+ connection()->setNetWmUserTime(timestamp);
const bool isSupportedByWM = connection()->wmSupport()->isSupportedByWM(atom(QXcbAtom::_NET_WM_USER_TIME_WINDOW));
if (m_netWmUserTimeWindow || isSupportedByWM) {
@@ -1493,8 +1430,6 @@ void QXcbWindow::setParent(const QPlatformWindow *parent)
xcb_parent_id = qXcbParent->xcb_window();
m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow;
} else {
- if (!xcbScreen())
- return;
xcb_parent_id = xcbScreen()->root();
m_embedded = false;
}
@@ -1522,10 +1457,22 @@ void QXcbWindow::setWindowTitle(const QString &title)
xcb_flush(xcb_connection());
}
+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()));
+}
+
void QXcbWindow::setWindowIcon(const QIcon &icon)
{
QVector<quint32> icon_data;
-
if (!icon.isNull()) {
QList<QSize> availableSizes = icon.availableSizes();
if (availableSizes.isEmpty()) {
@@ -1602,8 +1549,7 @@ void QXcbWindow::propagateSizeHints()
xcb_size_hints_t hints;
memset(&hints, 0, sizeof(hints));
- const int dpr = int(devicePixelRatio());
- const QRect xRect = windowToWmGeometry(mapToNative(geometry(), xcbScreen()));
+ const QRect xRect = windowToWmGeometry(geometry());
QWindow *win = window();
@@ -1613,10 +1559,10 @@ void QXcbWindow::propagateSizeHints()
xcb_size_hints_set_size(&hints, true, xRect.width(), xRect.height());
xcb_size_hints_set_win_gravity(&hints, m_gravity);
- QSize minimumSize = win->minimumSize() * dpr;
- QSize maximumSize = win->maximumSize() * dpr;
- QSize baseSize = win->baseSize() * dpr;
- QSize sizeIncrement = win->sizeIncrement() * dpr;
+ QSize minimumSize = windowMinimumSize();
+ QSize maximumSize = windowMaximumSize();
+ QSize baseSize = windowBaseSize();
+ QSize sizeIncrement = windowSizeIncrement();
if (minimumSize.width() > 0 || minimumSize.height() > 0)
xcb_size_hints_set_min_size(&hints,
@@ -1645,7 +1591,7 @@ void QXcbWindow::requestActivateWindow()
return;
}
- if (!m_mapped) {
+ if (!m_mapped || !xcbScreen()) {
m_deferredActivation = true;
return;
}
@@ -1690,6 +1636,12 @@ void QXcbWindow::setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmW
static_cast<QXcbWindow *>(window->handle())->setWmWindowType(windowTypes, window->flags());
}
+void QXcbWindow::setWindowIconTextStatic(QWindow *window, const QString &text)
+{
+ if (window->handle())
+ static_cast<QXcbWindow *>(window->handle())->setWindowIconText(text);
+}
+
uint QXcbWindow::visualIdStatic(QWindow *window)
{
if (window && window->handle())
@@ -1855,13 +1807,54 @@ void QXcbWindow::setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::W
xcb_flush(xcb_connection());
}
+void QXcbWindow::setParentRelativeBackPixmapStatic(QWindow *window)
+{
+ if (window->handle())
+ static_cast<QXcbWindow *>(window->handle())->setParentRelativeBackPixmap();
+}
+
+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));
+}
+
+bool QXcbWindow::requestSystemTrayWindowDockStatic(const QWindow *window)
+{
+ if (window->handle())
+ return static_cast<QXcbWindow *>(window->handle())->requestSystemTrayWindowDock();
+ return false;
+}
+
+bool QXcbWindow::requestSystemTrayWindowDock() const
+{
+ if (!connection()->systemTrayTracker())
+ return false;
+ connection()->systemTrayTracker()->requestSystemTrayWindowDock(m_window);
+ return true;
+}
+
+QRect QXcbWindow::systemTrayWindowGlobalGeometryStatic(const QWindow *window)
+{
+ if (window->handle())
+ return static_cast<QXcbWindow *>(window->handle())->systemTrayWindowGlobalGeometry();
+ return QRect();
+}
+
+QRect QXcbWindow::systemTrayWindowGlobalGeometry() const
+{
+ if (!connection()->systemTrayTracker())
+ return QRect();
+ return connection()->systemTrayTracker()->systemTrayWindowGlobalGeometry(m_window);
+}
+
class ExposeCompressor
{
public:
- ExposeCompressor(xcb_window_t window, QRegion *region, int devicePixelRatio)
+ ExposeCompressor(xcb_window_t window, QRegion *region)
: m_window(window)
, m_region(region)
- , m_dpr(devicePixelRatio)
, m_pending(true)
{
}
@@ -1877,7 +1870,7 @@ public:
return false;
if (expose->count == 0)
m_pending = false;
- *m_region |= mapExposeFromNative(QRect(expose->x, expose->y, expose->width, expose->height), m_dpr);
+ *m_region |= QRect(expose->x, expose->y, expose->width, expose->height);
return true;
}
@@ -1889,10 +1882,20 @@ public:
private:
xcb_window_t m_window;
QRegion *m_region;
- int m_dpr;
bool m_pending;
};
+bool QXcbWindow::compressExposeEvent(QRegion &exposeRegion)
+{
+ ExposeCompressor compressor(m_window, &exposeRegion);
+ xcb_generic_event_t *filter = 0;
+ do {
+ filter = connection()->checkEvent(compressor);
+ free(filter);
+ } while (filter);
+ return compressor.pending();
+}
+
bool QXcbWindow::handleGenericEvent(xcb_generic_event_t *event, long *result)
{
return QWindowSystemInterface::handleNativeEvent(window(),
@@ -1903,24 +1906,17 @@ bool QXcbWindow::handleGenericEvent(xcb_generic_event_t *event, long *result)
void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event)
{
- const int dpr = int(devicePixelRatio());
- QRect x_rect(event->x, event->y, event->width, event->height);
- QRect rect = mapExposeFromNative(x_rect, dpr);
+ QRect rect(event->x, event->y, event->width, event->height);
if (m_exposeRegion.isEmpty())
m_exposeRegion = rect;
else
m_exposeRegion |= rect;
- ExposeCompressor compressor(m_window, &m_exposeRegion, dpr);
- xcb_generic_event_t *filter = 0;
- do {
- filter = connection()->checkEvent(compressor);
- free(filter);
- } while (filter);
+ bool pending = compressExposeEvent(m_exposeRegion);
// if count is non-zero there are more expose events pending
- if (event->count == 0 || !compressor.pending()) {
+ if (event->count == 0 || !pending) {
QWindowSystemInterface::handleExposeEvent(window(), m_exposeRegion);
m_exposeRegion = QRegion();
}
@@ -1964,13 +1960,13 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
}
#ifndef QT_NO_DRAGANDDROP
} else if (event->type == atom(QXcbAtom::XdndEnter)) {
- connection()->drag()->handleEnter(window(), event);
+ connection()->drag()->handleEnter(this, event);
} else if (event->type == atom(QXcbAtom::XdndPosition)) {
- connection()->drag()->handlePosition(window(), event);
+ connection()->drag()->handlePosition(this, event);
} else if (event->type == atom(QXcbAtom::XdndLeave)) {
- connection()->drag()->handleLeave(window(), event);
+ connection()->drag()->handleLeave(this, event);
} else if (event->type == atom(QXcbAtom::XdndDrop)) {
- connection()->drag()->handleDrop(window(), event);
+ connection()->drag()->handleDrop(this, event);
#endif
} else if (event->type == atom(QXcbAtom::_XEMBED)) {
handleXEmbedMessage(event);
@@ -1983,38 +1979,19 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
// and other messages.
} else if (event->type == atom(QXcbAtom::_COMPIZ_DECOR_PENDING)
|| event->type == atom(QXcbAtom::_COMPIZ_DECOR_REQUEST)
- || event->type == atom(QXcbAtom::_COMPIZ_DECOR_DELETE_PIXMAP)) {
+ || event->type == atom(QXcbAtom::_COMPIZ_DECOR_DELETE_PIXMAP)
+ || event->type == atom(QXcbAtom::_COMPIZ_TOOLKIT_ACTION)) {
//silence the _COMPIZ messages for now
} else {
qWarning() << "QXcbWindow: Unhandled client message:" << connection()->atomName(event->type);
}
}
-// Temporary workaround for bug in QPlatformScreen::screenForGeometry
-// we need the native geometries to detect our screen, but that's not
-// available in cross-platform code. Will be fixed properly when highDPI
-// support is refactored to expose the native coordinate system.
-
-QXcbScreen *QXcbWindow::screenForNativeGeometry(const QRect &newGeometry) const
-{
- QXcbScreen *currentScreen = xcbScreen();
- if (!currentScreen && QGuiApplication::primaryScreen())
- currentScreen = static_cast<QXcbScreen*>(QGuiApplication::primaryScreen()->handle());
- if (currentScreen && !parent() && !currentScreen->nativeGeometry().intersects(newGeometry)) {
- Q_FOREACH (QPlatformScreen* screen, currentScreen->virtualSiblings()) {
- QXcbScreen *xcbScreen = static_cast<QXcbScreen*>(screen);
- if (xcbScreen->nativeGeometry().intersects(newGeometry))
- return xcbScreen;
- }
- }
- return currentScreen;
-}
-
void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event)
{
bool fromSendEvent = (event->response_type & 0x80);
QPoint pos(event->x, event->y);
- if (!parent() && !fromSendEvent && xcbScreen()) {
+ 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);
@@ -2026,26 +2003,25 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
}
}
- const QRect nativeRect = QRect(pos, QSize(event->width, event->height));
- QXcbScreen *newScreen = parent() ? parentScreen() : screenForNativeGeometry(nativeRect);
-
- QXcbScreen *currentScreen = m_xcbScreen;
- m_xcbScreen = newScreen;
+ const QRect actualGeometry = QRect(pos, QSize(event->width, event->height));
+ QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(actualGeometry);
if (!newScreen)
return;
- const QRect rect = mapFromNative(nativeRect, newScreen);
- QPlatformWindow::setGeometry(rect);
- QWindowSystemInterface::handleGeometryChange(window(), rect);
- if (newScreen != currentScreen)
- QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen());
+ // Persist the actual geometry so that QWindow::geometry() can
+ // be queried in the resize event.
+ QPlatformWindow::setGeometry(actualGeometry);
- m_configureNotifyPending = false;
+ // 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);
- if (m_deferredExpose) {
- m_deferredExpose = false;
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
- }
+ // QPlatformScreen::screen() is updated asynchronously, so we can't compare it
+ // with the newScreen. Just send the WindowScreenChanged event and QGuiApplication
+ // will make the comparison later.
+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
if (m_usingSyncProtocol && m_syncState == SyncReceived)
m_syncState = SyncAndConfigureReceived;
@@ -2071,11 +2047,10 @@ QPoint QXcbWindow::mapToGlobal(const QPoint &pos) const
if (!m_embedded)
return pos;
- const int dpr = int(devicePixelRatio());
QPoint ret;
xcb_translate_coordinates_cookie_t cookie =
xcb_translate_coordinates(xcb_connection(), xcb_window(), xcbScreen()->root(),
- pos.x() * dpr, pos.y() * dpr);
+ pos.x(), pos.y());
xcb_translate_coordinates_reply_t *reply =
xcb_translate_coordinates_reply(xcb_connection(), cookie, NULL);
if (reply) {
@@ -2084,7 +2059,7 @@ QPoint QXcbWindow::mapToGlobal(const QPoint &pos) const
free(reply);
}
- return mapFromNative(ret, xcbScreen());
+ return ret;
}
QPoint QXcbWindow::mapFromGlobal(const QPoint &pos) const
@@ -2092,17 +2067,15 @@ QPoint QXcbWindow::mapFromGlobal(const QPoint &pos) const
if (!m_embedded)
return pos;
- const int dpr = int(devicePixelRatio());
QPoint ret;
- QPoint xPos = mapToNative(pos, xcbScreen());
xcb_translate_coordinates_cookie_t cookie =
xcb_translate_coordinates(xcb_connection(), xcbScreen()->root(), xcb_window(),
- xPos.x(), xPos.y());
+ pos.x(), pos.y());
xcb_translate_coordinates_reply_t *reply =
xcb_translate_coordinates_reply(xcb_connection(), cookie, NULL);
if (reply) {
- ret.setX(reply->dst_x / dpr);
- ret.setY(reply->dst_y / dpr);
+ ret.setX(reply->dst_x);
+ ret.setY(reply->dst_y);
free(reply);
}
@@ -2115,10 +2088,10 @@ void QXcbWindow::handleMapNotifyEvent(const xcb_map_notify_event_t *event)
m_mapped = true;
if (m_deferredActivation)
requestActivateWindow();
- if (m_configureNotifyPending)
- m_deferredExpose = true;
- else
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size() * int(devicePixelRatio())));
+
+ QRegion exposeRegion = QRect(QPoint(), geometry().size());
+ compressExposeEvent(exposeRegion);
+ QWindowSystemInterface::handleExposeEvent(window(), exposeRegion);
}
}
@@ -2150,9 +2123,8 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
sendXEmbedMessage(container->xcb_window(), XEMBED_REQUEST_FOCUS);
}
}
- const int dpr = int(devicePixelRatio());
- QPoint local(event_x / dpr, event_y / dpr);
- QPoint global = xcbScreen()->mapFromNative(QPoint(root_x, root_y));
+ QPoint local(event_x, event_y);
+ QPoint global(root_x, root_y);
if (isWheel) {
if (!connection()->isAtLeastXI21()) {
@@ -2174,9 +2146,8 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
void QXcbWindow::handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y,
int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp)
{
- const int dpr = int(devicePixelRatio());
- QPoint local(event_x / dpr, event_y / dpr);
- QPoint global = xcbScreen()->mapFromNative(QPoint(root_x, root_y));
+ QPoint local(event_x, event_y);
+ QPoint global(root_x, root_y);
if (detail >= 4 && detail <= 7) {
// mouse wheel, handled in handleButtonPressEvent()
@@ -2189,11 +2160,8 @@ void QXcbWindow::handleButtonReleaseEvent(int event_x, int event_y, int root_x,
void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y,
Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp)
{
- if (!xcbScreen())
- return;
- const int dpr = int(devicePixelRatio());
- QPoint local(event_x / dpr, event_y / dpr);
- QPoint global = xcbScreen()->mapFromNative(QPoint(root_x, root_y));
+ QPoint local(event_x, event_y);
+ QPoint global(root_x, root_y);
handleMouseEvent(timestamp, local, global, modifiers);
}
@@ -2321,11 +2289,8 @@ void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event)
if (ignoreEnterEvent(event))
return;
- const int dpr = int(devicePixelRatio());
- const QPoint local(event->event_x/dpr, event->event_y/dpr);
- if (!xcbScreen())
- return;
- QPoint global = xcbScreen()->mapFromNative(QPoint(event->root_x, event->root_y));
+ const QPoint local(event->event_x, event->event_y);
+ QPoint global = QPoint(event->root_x, event->root_y);
QWindowSystemInterface::handleEnterEvent(window(), local, global);
}
@@ -2341,11 +2306,8 @@ void QXcbWindow::handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event)
QXcbWindow *enterWindow = enter ? connection()->platformWindowFromId(enter->event) : 0;
if (enterWindow) {
- const int dpr = int(devicePixelRatio());
- QPoint local(enter->event_x/dpr, enter->event_y/dpr);
- if (!xcbScreen())
- return;
- QPoint global = xcbScreen()->mapFromNative(QPoint(event->root_x, event->root_y));
+ QPoint local(enter->event_x, enter->event_y);
+ QPoint global = QPoint(event->root_x, event->root_y);
QWindowSystemInterface::handleEnterLeaveEvent(enterWindow->window(), window(), local, global);
} else {
@@ -2360,8 +2322,6 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev
connection()->setTime(event->time);
const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE;
- if (!xcbScreen())
- return;
if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) {
if (propertyDeleted)
@@ -2399,12 +2359,12 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev
QWindowSystemInterface::handleWindowStateChanged(window(), newState);
m_lastWindowStateEvent = newState;
m_windowState = newState;
+ if (m_windowState == Qt::WindowMinimized && connection()->mouseGrabber() == this)
+ connection()->setMouseGrabber(Q_NULLPTR);
}
return;
} else if (event->atom == atom(QXcbAtom::_NET_FRAME_EXTENTS)) {
m_dirtyFrameMargins = true;
- } else if (event->atom == atom(QXcbAtom::_NET_WORKAREA) && xcbScreen() && event->window == xcbScreen()->root()) {
- xcbScreen()->updateGeometry(event->time);
}
}
@@ -2455,9 +2415,15 @@ bool QXcbWindow::setKeyboardGrabEnabled(bool grab)
bool QXcbWindow::setMouseGrabEnabled(bool grab)
{
+ if (!grab && connection()->mouseGrabber() == this)
+ connection()->setMouseGrabber(Q_NULLPTR);
#ifdef XCB_USE_XINPUT22
- if (connection()->xi2MouseEvents())
- return connection()->xi2SetMouseGrabEnabled(m_window, grab);
+ if (connection()->xi2MouseEvents()) {
+ bool result = connection()->xi2SetMouseGrabEnabled(m_window, grab);
+ if (grab && result)
+ connection()->setMouseGrabber(this);
+ return result;
+ }
#endif
if (grab && !connection()->canGrab())
return false;
@@ -2476,6 +2442,8 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab)
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);
+ if (result)
+ connection()->setMouseGrabber(this);
return result;
}
@@ -2524,7 +2492,7 @@ bool QXcbWindow::startSystemResize(const QPoint &pos, Qt::Corner corner)
xev.type = moveResize;
xev.window = xcb_window();
xev.format = 32;
- const QPoint globalPos = mapToNative(window()->mapToGlobal(pos), xcbScreen());
+ const QPoint globalPos = window()->mapToGlobal(pos);
xev.data.data32[0] = globalPos.x();
xev.data.data32[1] = globalPos.y();
const bool bottom = corner == Qt::BottomRightCorner || corner == Qt::BottomLeftCorner;
@@ -2650,10 +2618,11 @@ void QXcbWindow::setMask(const QRegion &region)
xcb_shape_mask(connection()->xcb_connection(), XCB_SHAPE_SO_SET,
XCB_SHAPE_SK_BOUNDING, xcb_window(), 0, 0, XCB_NONE);
} else {
- const int dpr = devicePixelRatio();
QVector<xcb_rectangle_t> rects;
- foreach (const QRect &r, region.rects())
- rects.push_back(qRectToXCBRectangle(mapLocalGeometryToNative(r, dpr)));
+ const QVector<QRect> regionRects = region.rects();
+ rects.reserve(regionRects.count());
+ foreach (const QRect &r, regionRects)
+ rects.push_back(qRectToXCBRectangle(r));
xcb_shape_rectangles(connection()->xcb_connection(), XCB_SHAPE_SO_SET,
XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_UNSORTED,
xcb_window(), 0, 0, rects.size(), &rects[0]);
@@ -2682,8 +2651,6 @@ bool QXcbWindow::needsSync() const
void QXcbWindow::postSyncWindowRequest()
{
- if (!xcbScreen())
- return;
if (!m_pendingSyncRequest) {
QXcbSyncWindowRequest *e = new QXcbSyncWindowRequest(this);
m_pendingSyncRequest = e;
@@ -2691,11 +2658,6 @@ void QXcbWindow::postSyncWindowRequest()
}
}
-qreal QXcbWindow::devicePixelRatio() const
-{
- return xcbScreen() ? xcbScreen()->devicePixelRatio() : 1.0;
-}
-
QXcbScreen *QXcbWindow::xcbScreen() const
{
return static_cast<QXcbScreen *>(screen());
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index a379a6f9db..d2c02fe3df 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -81,11 +81,12 @@ public:
void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE;
bool isExposed() const Q_DECL_OVERRIDE;
- bool isEmbedded(const QPlatformWindow *parentWindow) const Q_DECL_OVERRIDE;
+ bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE;
QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE;
QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE;
void setWindowTitle(const QString &title) Q_DECL_OVERRIDE;
+ void setWindowIconText(const QString &title);
void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE;
void raise() Q_DECL_OVERRIDE;
void lower() Q_DECL_OVERRIDE;
@@ -145,6 +146,16 @@ public:
QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const;
void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags);
+ static void setWindowIconTextStatic(QWindow *window, const QString &text);
+
+ static void setParentRelativeBackPixmapStatic(QWindow *window);
+ void setParentRelativeBackPixmap();
+
+ static bool requestSystemTrayWindowDockStatic(const QWindow *window);
+ bool requestSystemTrayWindowDock() const;
+
+ static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window);
+ QRect systemTrayWindowGlobalGeometry() const;
uint visualId() const;
bool needsSync() const;
@@ -152,14 +163,10 @@ public:
void postSyncWindowRequest();
void clearSyncWindowRequest() { m_pendingSyncRequest = 0; }
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
-
QXcbScreen *xcbScreen() const;
virtual void create();
virtual void destroy();
- void maybeSetScreen(QXcbScreen *screen);
- QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const;
public Q_SLOTS:
void updateSyncRequestCounter();
@@ -167,12 +174,7 @@ public Q_SLOTS:
protected:
virtual void resolveFormat() { m_format = window()->requestedFormat(); }
virtual void *createVisual() { return Q_NULLPTR; }
- virtual bool supportsSyncProtocol() { return !window()->supportsOpenGL(); }
- QPoint mapToNative(const QPoint &pos, const QXcbScreen *screen) const;
- QPoint mapFromNative(const QPoint &pos, const QXcbScreen *screen) const;
- QRect mapToNative(const QRect &rect, const QXcbScreen *screen) const;
- QRect mapFromNative(const QRect &rect, const QXcbScreen *screen) const;
QXcbScreen *parentScreen();
void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0);
@@ -199,6 +201,8 @@ protected:
void doFocusIn();
void doFocusOut();
+ bool compressExposeEvent(QRegion &exposeRegion);
+
void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y,
int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp);
@@ -210,8 +214,6 @@ protected:
xcb_window_t m_window;
- QXcbScreen *m_xcbScreen;
-
uint m_depth;
QImage::Format m_imageFormat;
bool m_imageRgbSwap;
@@ -227,8 +229,6 @@ protected:
bool m_transparent;
bool m_usingSyncProtocol;
bool m_deferredActivation;
- bool m_deferredExpose;
- bool m_configureNotifyPending;
bool m_embedded;
bool m_alertState;
xcb_window_t m_netWmUserTimeWindow;
diff --git a/src/plugins/platforms/xcb/qxcbwmsupport.cpp b/src/plugins/platforms/xcb/qxcbwmsupport.cpp
index 7d31ac7118..82c1c1de77 100644
--- a/src/plugins/platforms/xcb/qxcbwmsupport.cpp
+++ b/src/plugins/platforms/xcb/qxcbwmsupport.cpp
@@ -94,14 +94,14 @@ 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_ATOM, offset, 1024);
+ 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);
if (!reply)
break;
remaining = 0;
- if (reply->type == XCB_ATOM_ATOM && reply->format == 32) {
+ 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 s = net_virtual_roots.size();
diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp
index 46cee5d6d0..effdbf7334 100644
--- a/src/plugins/platforms/xcb/qxcbxsettings.cpp
+++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp
@@ -147,7 +147,7 @@ public:
return;
char byteOrder = xSettings.at(0);
if (byteOrder != LSBFirst && byteOrder != MSBFirst) {
- qWarning("%s ByteOrder byte %d not 0 or 1", Q_FUNC_INFO , byteOrder);
+ qWarning("ByteOrder byte %d not 0 or 1", byteOrder);
return;
}
@@ -157,7 +157,7 @@ public:
qFromBigEndian<t>((const uchar *)(x)))
#define VALIDATE_LENGTH(x) \
if ((size_t)xSettings.length() < (offset + local_offset + 12 + x)) { \
- qWarning("%s Length %d runs past end of data", Q_FUNC_INFO , x); \
+ qWarning("Length %d runs past end of data", x); \
return; \
}
diff --git a/src/plugins/platforms/xcb/qxlibconvenience.cpp b/src/plugins/platforms/xcb/qxlibconvenience.cpp
deleted file mode 100644
index f3c7d2b24e..0000000000
--- a/src/plugins/platforms/xcb/qxlibconvenience.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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$
-**
-****************************************************************************/
-
-#ifdef XCB_USE_XLIB
-
-#include "qxlibconvenience.h"
-
-// Some Xlib headers are heavy macro namespace polluters and conflict with Qt types.
-// This unit makes it easier to deal with them by encapsulating these includes in this .cpp.
-#include <X11/Xutil.h>
-
-QT_BEGIN_NAMESPACE
-
-xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars)
-{
- KeySym sym = 0;
- chars->resize(512);
- XKeyEvent event;
- memset(&event, 0, sizeof(event));
- event.type = type;
- event.display = static_cast<Display*>(display);
- event.window = window;
- event.root = root;
- event.state = state;
- event.keycode = code;
- int count = XLookupString(&event, chars->data(), chars->size(), &sym, 0);
- chars->resize(count);
- return sym;
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/xcb/qxlibconvenience.h b/src/plugins/platforms/xcb/qxlibconvenience.h
deleted file mode 100644
index 0e6e1c37ec..0000000000
--- a/src/plugins/platforms/xcb/qxlibconvenience.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 XLIBUTILS_H
-#define XLIBUTILS_H
-
-#ifdef XCB_USE_XLIB
-
-#include <xcb/xcb_keysyms.h>
-#include <QByteArray>
-
-QT_BEGIN_NAMESPACE
-
-xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars);
-
-QT_END_NAMESPACE
-
-#endif // XCB_USE_XLIB
-#endif
diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
index d0fe282b14..20481e4834 100644
--- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
+++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
@@ -1,7 +1,8 @@
#
# Statically compile in code for
# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image,
-# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb
+# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb,
+# libxcb-xinerama
#
CONFIG += static
load(qt_helper_lib)
@@ -28,7 +29,8 @@ SOURCES += \
$$LIBXCB_DIR/sync.c \
$$LIBXCB_DIR/render.c \
$$LIBXCB_DIR/shape.c \
- $$LIBXCB_DIR/xkb.c
+ $$LIBXCB_DIR/xkb.c \
+ $$LIBXCB_DIR/xinerama.c
#
# xcb-util
diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
index 12987567ff..302d87e007 100644
--- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro
+++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
@@ -1,13 +1,6 @@
TARGET = QtXcbQpa
CONFIG += no_module_headers internal_module
-MODULE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE \
- \$\$QT_MODULE_INCLUDE_BASE/QtQGui
-MODULE_PRIVATE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE/QtGui/$$QT.gui.VERSION \
- \$\$QT_MODULE_INCLUDE_BASE/QtGui/$$QT.gui.VERSION/QtGui
-
load(qt_module)
QT += core-private gui-private platformsupport-private
@@ -47,8 +40,6 @@ HEADERS = \
qxcbxsettings.h \
qxcbsystemtraytracker.h
-LIBS += $$QMAKE_LIBS_DYNLOAD
-
DEFINES += QT_BUILD_XCB_PLUGIN
# needed by Xcursor ...
contains(QT_CONFIG, xcb-xlib) {
@@ -101,7 +92,7 @@ contains(QT_CONFIG, xcb-qt) {
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static
} else {
- LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms
+ LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms -lxcb-xinerama
!contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
}
diff --git a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
index 2f0bceafe6..857f373759 100644
--- a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
+++ b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
@@ -71,6 +71,9 @@ Q_SIGNALS:
protected:
static void onResponse(QGtk2Dialog *dialog, int response);
+private slots:
+ void onParentWindowDestroyed();
+
private:
GtkWidget *gtkWidget;
};
@@ -108,6 +111,8 @@ void QGtk2Dialog::exec()
bool QGtk2Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
{
+ connect(parent, &QWindow::destroyed, this, &QGtk2Dialog::onParentWindowDestroyed,
+ Qt::UniqueConnection);
setParent(parent);
setFlags(flags);
setModality(modality);
@@ -144,6 +149,12 @@ void QGtk2Dialog::onResponse(QGtk2Dialog *dialog, int response)
emit dialog->reject();
}
+void QGtk2Dialog::onParentWindowDestroyed()
+{
+ // The QGtk2*DialogHelper classes own this object. Make sure the parent doesn't delete it.
+ setParent(0);
+}
+
QGtk2ColorDialogHelper::QGtk2ColorDialogHelper()
{
d.reset(new QGtk2Dialog(gtk_color_selection_dialog_new("")));
diff --git a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h
index 2ac31bf715..141056637e 100644
--- a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h
+++ b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h
@@ -34,7 +34,11 @@
#ifndef QGTK2DIALOGHELPERS_P_H
#define QGTK2DIALOGHELPERS_P_H
+#include <QtCore/qhash.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qurl.h>
#include <QtCore/qscopedpointer.h>
+#include <QtCore/qstring.h>
#include <qpa/qplatformdialoghelper.h>
typedef struct _GtkDialog GtkDialog;
@@ -43,6 +47,7 @@ typedef struct _GtkFileFilter GtkFileFilter;
QT_BEGIN_NAMESPACE
class QGtk2Dialog;
+class QColor;
class QGtk2ColorDialogHelper : public QPlatformColorDialogHelper
{
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index af4f6fc8fe..03b7dc266b 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,8 +1,15 @@
TEMPLATE = subdirs
+load(qfeatures)
SUBDIRS *= sqldrivers
-!winrt:qtHaveModule(network): SUBDIRS += bearer
-qtHaveModule(gui): SUBDIRS *= imageformats platforms platforminputcontexts platformthemes generic
+qtHaveModule(network):!contains(QT_DISABLED_FEATURES, bearermanagement): SUBDIRS += bearer
+qtHaveModule(gui) {
+ SUBDIRS *= platforms platforminputcontexts platformthemes
+ !contains(QT_DISABLED_FEATURES, imageformatplugin): SUBDIRS *= imageformats
+ !contains(QT_DISABLED_FEATURES, library): SUBDIRS *= generic
+}
qtHaveModule(widgets): SUBDIRS *= styles
-!winrt:!wince:qtHaveModule(widgets): SUBDIRS += printsupport
+!winrt:!wince*:qtHaveModule(widgets):!contains(QT_DISABLED_FEATURES, printer) {
+ SUBDIRS += printsupport
+}
diff --git a/src/plugins/printsupport/cocoa/main.cpp b/src/plugins/printsupport/cocoa/main.cpp
index 2037724719..3db7b49ba4 100644
--- a/src/plugins/printsupport/cocoa/main.cpp
+++ b/src/plugins/printsupport/cocoa/main.cpp
@@ -38,8 +38,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTER
-
class QCocoaPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
{
Q_OBJECT
@@ -67,8 +65,6 @@ QPlatformPrinterSupport *QCocoaPrinterSupportPlugin::create(const QString &key)
return platformPrinterSupport;
}
-#endif
-
QT_END_NAMESPACE
#include "main.moc"
diff --git a/src/plugins/printsupport/cups/main.cpp b/src/plugins/printsupport/cups/main.cpp
index 82485114ab..abd24d411a 100644
--- a/src/plugins/printsupport/cups/main.cpp
+++ b/src/plugins/printsupport/cups/main.cpp
@@ -37,8 +37,6 @@
#include <qpa/qplatformprintplugin.h>
#include <QtCore/QStringList>
-#ifndef QT_NO_PRINTER
-
QT_BEGIN_NAMESPACE
class QCupsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
@@ -65,6 +63,4 @@ QPlatformPrinterSupport *QCupsPrinterSupportPlugin::create(const QString &key)
QT_END_NAMESPACE
-#endif // QT_NO_PRINTER
-
#include "main.moc"
diff --git a/src/plugins/printsupport/cups/qcupsprintengine.cpp b/src/plugins/printsupport/cups/qcupsprintengine.cpp
index c00d7f302c..7ca81986b4 100644
--- a/src/plugins/printsupport/cups/qcupsprintengine.cpp
+++ b/src/plugins/printsupport/cups/qcupsprintengine.cpp
@@ -33,8 +33,6 @@
#include "qcupsprintengine_p.h"
-#ifndef QT_NO_PRINTER
-
#include <qpa/qplatformprintplugin.h>
#include <qpa/qplatformprintersupport.h>
@@ -226,7 +224,9 @@ void QCupsPrintEnginePrivate::closePrintDevice()
it += 2;
}
- for (int c = 0; c < options.size(); ++c) {
+ const int numOptions = options.size();
+ cupsOptStruct.reserve(numOptions);
+ for (int c = 0; c < numOptions; ++c) {
cups_option_t opt;
opt.name = options[c].first.data();
opt.value = options[c].second.data();
@@ -315,5 +315,3 @@ void QCupsPrintEnginePrivate::setPageSize(const QPageSize &pageSize)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_PRINTER
diff --git a/src/plugins/printsupport/cups/qcupsprintengine_p.h b/src/plugins/printsupport/cups/qcupsprintengine_p.h
index b589d40b6c..a611740e09 100644
--- a/src/plugins/printsupport/cups/qcupsprintengine_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintengine_p.h
@@ -47,8 +47,6 @@
#include "QtPrintSupport/qprintengine.h"
-#ifndef QT_NO_PRINTER
-
#include <QtCore/qstring.h>
#include <QtGui/qpaintengine.h>
@@ -100,6 +98,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTER
-
#endif // QCUPSPRINTENGINE_P_H
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport.cpp b/src/plugins/printsupport/cups/qcupsprintersupport.cpp
index ea7c116e3c..b257918acf 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport.cpp
+++ b/src/plugins/printsupport/cups/qcupsprintersupport.cpp
@@ -34,8 +34,6 @@
#include "qcupsprintersupport_p.h"
-#ifndef QT_NO_PRINTER
-
#include "qcupsprintengine_p.h"
#include "qppdprintdevice.h"
#include <private/qprinterinfo_p.h>
@@ -80,6 +78,7 @@ QStringList QCupsPrinterSupport::availablePrintDeviceIds() const
QStringList list;
cups_dest_t *dests;
int count = cupsGetDests(&dests);
+ list.reserve(count);
for (int i = 0; i < count; ++i) {
QString printerId = QString::fromLocal8Bit(dests[i].name);
if (dests[i].instance)
@@ -109,5 +108,3 @@ QString QCupsPrinterSupport::defaultPrintDeviceId() const
}
QT_END_NAMESPACE
-
-#endif // QT_NO_PRINTER
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
index ea913deeaa..6dcaa4e893 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
@@ -48,8 +48,6 @@
#include <qpa/qplatformprintersupport.h>
-#ifndef QT_NO_PRINTER
-
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
@@ -73,5 +71,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTER
#endif // QCUPSPRINTERSUPPORT_H
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp
index 808424b1ed..1b9ff98fca 100644
--- a/src/plugins/printsupport/cups/qppdprintdevice.cpp
+++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp
@@ -42,8 +42,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTER
-
QPpdPrintDevice::QPpdPrintDevice()
: QPlatformPrintDevice(),
m_cupsDest(0),
@@ -269,6 +267,7 @@ void QPpdPrintDevice::loadInputSlots() const
if (m_ppd) {
ppd_option_t *inputSlots = ppdFindOption(m_ppd, "InputSlot");
if (inputSlots) {
+ m_inputSlots.reserve(inputSlots->num_choices);
for (int i = 0; i < inputSlots->num_choices; ++i)
m_inputSlots.append(QPrintUtils::ppdChoiceToInputSlot(inputSlots->choices[i]));
}
@@ -309,6 +308,7 @@ void QPpdPrintDevice::loadOutputBins() const
if (m_ppd) {
ppd_option_t *outputBins = ppdFindOption(m_ppd, "OutputBin");
if (outputBins) {
+ m_outputBins.reserve(outputBins->num_choices);
for (int i = 0; i < outputBins->num_choices; ++i)
m_outputBins.append(QPrintUtils::ppdChoiceToOutputBin(outputBins->choices[i]));
}
@@ -350,6 +350,7 @@ void QPpdPrintDevice::loadDuplexModes() const
if (m_ppd) {
ppd_option_t *duplexModes = ppdFindOption(m_ppd, "Duplex");
if (duplexModes) {
+ m_duplexModes.reserve(duplexModes->num_choices);
for (int i = 0; i < duplexModes->num_choices; ++i)
m_duplexModes.append(QPrintUtils::ppdChoiceToDuplexMode(duplexModes->choices[i].choice));
}
@@ -472,6 +473,4 @@ cups_ptype_e QPpdPrintDevice::printerTypeFlags() const
return static_cast<cups_ptype_e>(printerOption("printer-type").toUInt());
}
-#endif // QT_NO_PRINTER
-
QT_END_NAMESPACE
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.h b/src/plugins/printsupport/cups/qppdprintdevice.h
index 5ebcf39566..a28348eb60 100644
--- a/src/plugins/printsupport/cups/qppdprintdevice.h
+++ b/src/plugins/printsupport/cups/qppdprintdevice.h
@@ -47,7 +47,9 @@
#include <qpa/qplatformprintdevice.h>
-#ifndef QT_NO_PRINTER
+#include <QtCore/qbytearray.h>
+#include <QtCore/qhash.h>
+#include <QtCore/qmargins.h>
#include <cups/cups.h>
#include <cups/ppd.h>
@@ -107,5 +109,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTER
#endif // QPPDPRINTDEVICE_H
diff --git a/src/plugins/printsupport/printsupport.pro b/src/plugins/printsupport/printsupport.pro
index ed201f0744..bd6681f53c 100644
--- a/src/plugins/printsupport/printsupport.pro
+++ b/src/plugins/printsupport/printsupport.pro
@@ -2,4 +2,7 @@ TEMPLATE = subdirs
osx: SUBDIRS += cocoa
win32: SUBDIRS += windows
-unix:!mac:contains(QT_CONFIG, cups): SUBDIRS += cups
+unix:!mac:contains(QT_CONFIG, cups) {
+ load(qfeatures)
+ !contains(QT_DISABLED_FEATURES, cups): SUBDIRS += cups
+}
diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
index 505f3138ca..d378ff3130 100644
--- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
+++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
@@ -41,8 +41,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTER
-
QT_WARNING_DISABLE_GCC("-Wsign-compare")
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
@@ -471,6 +469,4 @@ QString QWindowsPrintDevice::defaultPrintDeviceId()
return QString::fromWCharArray(name.data());
}
-#endif // QT_NO_PRINTER
-
QT_END_NAMESPACE
diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.h b/src/plugins/printsupport/windows/qwindowsprintdevice.h
index 8ab487a59c..2c232d22c5 100644
--- a/src/plugins/printsupport/windows/qwindowsprintdevice.h
+++ b/src/plugins/printsupport/windows/qwindowsprintdevice.h
@@ -47,8 +47,6 @@
#include <qpa/qplatformprintdevice.h>
-#ifndef QT_NO_PRINTER
-
#include <QtCore/qt_windows.h>
QT_BEGIN_NAMESPACE
@@ -95,5 +93,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTER
#endif // QWINDOWSPRINTDEVICE_H
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_inactive.png b/src/plugins/styles/bb10style/bright/button/core_button_inactive.png
index 7769f15e44..7769f15e44 100755..100644
--- a/src/plugins/styles/bb10style/bright/button/core_button_inactive.png
+++ b/src/plugins/styles/bb10style/bright/button/core_button_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/button/core_button_pressed.png b/src/plugins/styles/bb10style/bright/button/core_button_pressed.png
index 59b5bfa7c2..59b5bfa7c2 100755..100644
--- a/src/plugins/styles/bb10style/bright/button/core_button_pressed.png
+++ b/src/plugins/styles/bb10style/bright/button/core_button_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png
index f1c2ee3bed..f1c2ee3bed 100755..100644
--- a/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png
+++ b/src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png
index 07b8ea21bf..07b8ea21bf 100755..100644
--- a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png
+++ b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png
index 55f8aee066..55f8aee066 100755..100644
--- a/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png
+++ b/src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png b/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png
index 34daccc27e..34daccc27e 100755..100644
--- a/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png
+++ b/src/plugins/styles/bb10style/bright/listitem/core_listitem_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png b/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png
index 7a1e22321d..7a1e22321d 100755..100644
--- a/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png
+++ b/src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png
index 3ff930dea7..3ff930dea7 100755..100644
--- a/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png
+++ b/src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png
index cb4c6a8136..cb4c6a8136 100755..100644
--- a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png
index 88fd1344d2..88fd1344d2 100755..100644
--- a/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png
+++ b/src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png b/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png
index 79154e0568..79154e0568 100755..100644
--- a/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png
+++ b/src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png b/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png
index 8cb79118b9..8cb79118b9 100755..100644
--- a/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png
+++ b/src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_inactive.png b/src/plugins/styles/bb10style/dark/button/core_button_inactive.png
index 97842e1ac4..97842e1ac4 100755..100644
--- a/src/plugins/styles/bb10style/dark/button/core_button_inactive.png
+++ b/src/plugins/styles/bb10style/dark/button/core_button_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/button/core_button_pressed.png b/src/plugins/styles/bb10style/dark/button/core_button_pressed.png
index c149b64a26..c149b64a26 100755..100644
--- a/src/plugins/styles/bb10style/dark/button/core_button_pressed.png
+++ b/src/plugins/styles/bb10style/dark/button/core_button_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png
index 507a77b3ea..507a77b3ea 100755..100644
--- a/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png
+++ b/src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png
index 07b8ea21bf..07b8ea21bf 100755..100644
--- a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png
+++ b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png
index 9b115897e8..9b115897e8 100755..100644
--- a/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png
+++ b/src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png b/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png
index 52aa4e4aa2..52aa4e4aa2 100755..100644
--- a/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png
+++ b/src/plugins/styles/bb10style/dark/listitem/core_listitem_active.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png b/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png
index 39e3a8a4f5..39e3a8a4f5 100755..100644
--- a/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png
+++ b/src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png
index 95fcafb437..95fcafb437 100755..100644
--- a/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png
+++ b/src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png
index fd61937d65..fd61937d65 100755..100644
--- a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png
index 58a1a57b4c..58a1a57b4c 100755..100644
--- a/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png
+++ b/src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png b/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png
index 384f60758a..384f60758a 100755..100644
--- a/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png
+++ b/src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png b/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png
index 803c374015..803c374015 100755..100644
--- a/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png
+++ b/src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.png
Binary files differ
diff --git a/src/plugins/styles/bb10style/qpixmapstyle.cpp b/src/plugins/styles/bb10style/qpixmapstyle.cpp
index 759f57eb1c..3090c42959 100644
--- a/src/plugins/styles/bb10style/qpixmapstyle.cpp
+++ b/src/plugins/styles/bb10style/qpixmapstyle.cpp
@@ -616,9 +616,9 @@ void QPixmapStyle::drawProgressBarBackground(const QStyleOption *option,
QPainter *painter, const QWidget *) const
{
bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 =
- qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
- vertical = (pb2->orientation == Qt::Vertical);
+ if (const QStyleOptionProgressBar *pb =
+ qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
+ vertical = pb->orientation == Qt::Vertical;
}
drawCachedPixmap(vertical ? PB_VBackground : PB_HBackground, option->rect, painter);
}
@@ -628,11 +628,7 @@ void QPixmapStyle::drawProgressBarLabel(const QStyleOption *option,
{
if (const QStyleOptionProgressBar *pb =
qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
- bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 =
- qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
- vertical = (pb2->orientation == Qt::Vertical);
- }
+ const bool vertical = pb->orientation == Qt::Vertical;
if (!vertical) {
QPalette::ColorRole textRole = QPalette::ButtonText;
proxy()->drawItemText(painter, pb->rect,
@@ -647,13 +643,8 @@ void QPixmapStyle::drawProgressBarFill(const QStyleOption *option,
{
const QStyleOptionProgressBar *pbar =
qstyleoption_cast<const QStyleOptionProgressBar*>(option);
- bool vertical = false;
- bool flip = pbar->direction == Qt::RightToLeft;
- if (const QStyleOptionProgressBarV2 *pb2 =
- qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
- vertical = (pb2->orientation == Qt::Vertical);
- flip = flip ^ pb2->invertedAppearance;
- }
+ const bool vertical = pbar->orientation == Qt::Vertical;
+ const bool flip = (pbar->direction == Qt::RightToLeft) ^ pbar->invertedAppearance;
if (pbar->progress == pbar->maximum) {
drawCachedPixmap(vertical ? PB_VComplete : PB_HComplete, option->rect, painter);
@@ -801,9 +792,9 @@ QSize QPixmapStyle::progressBarSizeFromContents(const QStyleOption *option,
const QWidget *widget) const
{
bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 =
- qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
- vertical = (pb2->orientation == Qt::Vertical);
+ if (const QStyleOptionProgressBar *pb =
+ qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
+ vertical = pb->orientation == Qt::Vertical;
}
QSize result = QCommonStyle::sizeFromContents(CT_Slider, option, contentsSize, widget);
if (vertical) {
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index cf55cfade8..6148502096 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -74,7 +74,7 @@ public:
Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
#ifndef QT_NO_PRINTDIALOG
- explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = 0);
+ explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
~QAbstractPrintDialog();
virtual int exec() = 0;
@@ -101,7 +101,7 @@ public:
QPrinter *printer() const;
protected:
- QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = 0);
+ QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = Q_NULLPTR);
private:
Q_DISABLE_COPY(QAbstractPrintDialog)
diff --git a/src/printsupport/dialogs/qpagesetupdialog.h b/src/printsupport/dialogs/qpagesetupdialog.h
index 43b642b8f1..824d63f2d7 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.h
+++ b/src/printsupport/dialogs/qpagesetupdialog.h
@@ -51,8 +51,8 @@ class Q_PRINTSUPPORT_EXPORT QPageSetupDialog : public QDialog
Q_DECLARE_PRIVATE(QPageSetupDialog)
public:
- explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = 0);
- explicit QPageSetupDialog(QWidget *parent = 0);
+ explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
+ explicit QPageSetupDialog(QWidget *parent = Q_NULLPTR);
~QPageSetupDialog();
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
index 886cbc0152..b86de31883 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
+++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
@@ -201,10 +201,9 @@ int QPageSetupDialog::exec()
QDialog::setVisible(true);
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
static_cast <QMacPageSetupDialogPrivate*>(d)->openCocoaPageLayout(Qt::ApplicationModal);
static_cast <QMacPageSetupDialogPrivate*>(d)->closeCocoaPageLayout();
- [pool release];
QDialog::setVisible(false);
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index 1332fcc1fd..cf0115cc28 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -53,8 +53,8 @@ class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
Q_PROPERTY(PrintDialogOptions options READ options WRITE setOptions)
public:
- explicit QPrintDialog(QPrinter *printer, QWidget *parent = 0);
- explicit QPrintDialog(QWidget *parent = 0);
+ explicit QPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
+ explicit QPrintDialog(QWidget *parent = Q_NULLPTR);
~QPrintDialog();
int exec() Q_DECL_OVERRIDE;
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index aec1e3babb..030526954d 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -36,7 +36,6 @@
#include "qprintdialog.h"
#include "qabstractprintdialog_p.h"
-#include <QtCore/qhash.h>
#include <QtCore/private/qcore_mac_p.h>
#include <QtWidgets/private/qapplication_p.h>
#include <QtPrintSupport/qprinter.h>
@@ -302,10 +301,9 @@ int QPrintDialog::exec()
QDialog::setVisible(true);
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
d->openCocoaPrintPanel(Qt::ApplicationModal);
d->closeCocoaPrintPanel();
- [pool release];
QDialog::setVisible(false);
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 880b233aef..b96d8dfd22 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -118,9 +118,6 @@ public:
void applyPrinterProperties(QPrinter *p);
void setupPrinter() const;
-protected:
- void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
-
private:
friend class QUnixPrintWidgetPrivate;
Ui::QPrintPropertiesWidget widget;
@@ -231,6 +228,7 @@ public:
QPrintPropertiesDialog::QPrintPropertiesDialog(QAbstractPrintDialog *parent)
: QDialog(parent)
{
+ setWindowTitle(tr("Printer Properties"));
QVBoxLayout *lay = new QVBoxLayout(this);
this->setLayout(lay);
QWidget *content = new QWidget(this);
@@ -273,11 +271,6 @@ void QPrintPropertiesDialog::selectPrinter(QPrinter::OutputFormat outputFormat,
widget.pageSetup->selectPrinter(outputFormat, printerName);
}
-void QPrintPropertiesDialog::showEvent(QShowEvent* event)
-{
- event->accept();
-}
-
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.h b/src/printsupport/dialogs/qprintpreviewdialog.h
index 15e0271ba0..228cd24f48 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.h
+++ b/src/printsupport/dialogs/qprintpreviewdialog.h
@@ -52,8 +52,9 @@ class Q_PRINTSUPPORT_EXPORT QPrintPreviewDialog : public QDialog
Q_DECLARE_PRIVATE(QPrintPreviewDialog)
public:
- explicit QPrintPreviewDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
- explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QPrintPreviewDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR,
+ Qt::WindowFlags flags = Qt::WindowFlags());
~QPrintPreviewDialog();
using QDialog::open;
diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf
index 2ec33f6600..d8fbc23c0a 100644
--- a/src/printsupport/doc/qtprintsupport.qdocconf
+++ b/src/printsupport/doc/qtprintsupport.qdocconf
@@ -4,7 +4,7 @@ project = QtPrintSupport
description = Qt Print Support Reference Documentation
version = $QT_VERSION
-examplesinstallpath = printsupport
+examplesinstallpath = qtbase/printsupport
qhp.projects = QtPrintSupport
@@ -26,7 +26,7 @@ qhp.QtPrintSupport.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtprintsupport/qtprintsupport.tags
-depends += qtcore qtgui qtwidgets qtdoc
+depends += qtcore qtgui qtwidgets qtdoc qmake
headerdirs += ..
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index 8c67b416a9..2f0f1205ca 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -59,6 +59,16 @@ void QCUPSSupport::setCupsOption(QStringList &cupsOptions, const QString &option
}
}
+void QCUPSSupport::clearCupsOption(QStringList &cupsOptions, const QString &option)
+{
+ // ### use const_iterator once QList::erase takes them
+ const QStringList::iterator it = std::find(cupsOptions.begin(), cupsOptions.end(), option);
+ if (it != cupsOptions.end()) {
+ Q_ASSERT(it + 1 < cupsOptions.end());
+ cupsOptions.erase(it, it+1);
+ }
+}
+
static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold, const QTime holdUntilTime)
{
switch (jobHold) {
@@ -94,14 +104,16 @@ static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold,
void QCUPSSupport::setJobHold(QPrinter *printer, const JobHoldUntil jobHold, const QTime &holdUntilTime)
{
+ QStringList cupsOptions = cupsOptionsList(printer);
const QString jobHoldUntilArgument = jobHoldToString(jobHold, holdUntilTime);
if (!jobHoldUntilArgument.isEmpty()) {
- QStringList cupsOptions = cupsOptionsList(printer);
setCupsOption(cupsOptions,
QStringLiteral("job-hold-until"),
jobHoldUntilArgument);
- setCupsOptions(printer, cupsOptions);
+ } else {
+ clearCupsOption(cupsOptions, QStringLiteral("job-hold-until"));
}
+ setCupsOptions(printer, cupsOptions);
}
void QCUPSSupport::setJobBilling(QPrinter *printer, const QString &jobBilling)
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
index afcb2c6f3b..f6ba983e9f 100644
--- a/src/printsupport/kernel/qcups_p.h
+++ b/src/printsupport/kernel/qcups_p.h
@@ -117,6 +117,7 @@ public:
static QStringList cupsOptionsList(QPrinter *printer);
static void setCupsOptions(QPrinter *printer, const QStringList &cupsOptions);
static void setCupsOption(QStringList &cupsOptions, const QString &option, const QString &value);
+ static void clearCupsOption(QStringList &cupsOptions, const QString &option);
static void setJobHold(QPrinter *printer, const JobHoldUntil jobHold = NoHold, const QTime &holdUntilTime = QTime());
static void setJobBilling(QPrinter *printer, const QString &jobBilling = QString());
@@ -127,6 +128,11 @@ public:
const PagesPerSheetLayout pagesPerSheetLayout);
static void setPageRange(QPrinter *printer, int pageFrom, int pageTo);
};
+Q_DECLARE_TYPEINFO(QCUPSSupport::JobHoldUntil, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QCUPSSupport::BannerPage, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QCUPSSupport::PageSet, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QCUPSSupport::PagesPerSheetLayout, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QCUPSSupport::PagesPerSheet, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp
index a81f3eae43..79026e5762 100644
--- a/src/printsupport/kernel/qpaintengine_alpha.cpp
+++ b/src/printsupport/kernel/qpaintengine_alpha.cpp
@@ -186,7 +186,8 @@ void QAlphaPaintEngine::drawPolygon(const QPointF *points, int pointCount, Polyg
Q_D(QAlphaPaintEngine);
QPolygonF poly;
- for (int i=0; i<pointCount; ++i)
+ poly.reserve(pointCount);
+ for (int i = 0; i < pointCount; ++i)
poly.append(points[i]);
QPainterPath path;
@@ -383,6 +384,7 @@ QAlphaPaintEnginePrivate::QAlphaPaintEnginePrivate()
m_pic(0),
m_picengine(0),
m_picpainter(0),
+ m_numberOfCachedRects(0),
m_hasalpha(false),
m_alphaPen(false),
m_alphaBrush(false),
@@ -433,7 +435,14 @@ void QAlphaPaintEnginePrivate::addAlphaRect(const QRectF &rect)
bool QAlphaPaintEnginePrivate::canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const
{
- return somethingInRectHasAlpha && m_dirtyrgn.intersects(rect.toAlignedRect());
+ if (somethingInRectHasAlpha) {
+ if (m_dirtyRects.count() != m_numberOfCachedRects) {
+ m_cachedDirtyRgn.setRects(m_dirtyRects.constData(), m_dirtyRects.count());
+ m_numberOfCachedRects = m_dirtyRects.count();
+ }
+ return m_cachedDirtyRgn.intersects(rect.toAlignedRect());
+ }
+ return false;
}
void QAlphaPaintEnginePrivate::drawAlphaImage(const QRectF &rect)
diff --git a/src/printsupport/kernel/qpaintengine_alpha_p.h b/src/printsupport/kernel/qpaintengine_alpha_p.h
index 2becad7379..49a9938e56 100644
--- a/src/printsupport/kernel/qpaintengine_alpha_p.h
+++ b/src/printsupport/kernel/qpaintengine_alpha_p.h
@@ -99,7 +99,9 @@ public:
QRegion m_alphargn;
QRegion m_cliprgn;
- QRegion m_dirtyrgn;
+ mutable QRegion m_cachedDirtyRgn;
+ mutable int m_numberOfCachedRects;
+ QVector<QRect> m_dirtyRects;
bool m_hasalpha;
bool m_alphaPen;
@@ -115,7 +117,7 @@ public:
QPen m_pen;
void addAlphaRect(const QRectF &rect);
- void addDirtyRect(const QRectF &rect) { m_dirtyrgn |= rect.toAlignedRect(); }
+ void addDirtyRect(const QRectF &rect) { m_dirtyRects.append(rect.toAlignedRect()); }
bool canSeeTroughBackground(bool somethingInRectHasAlpha, const QRectF &rect) const;
QRectF addPenWidth(const QPainterPath &path);
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp
index 091cc6f008..9adf39ffcd 100644
--- a/src/printsupport/kernel/qplatformprintplugin.cpp
+++ b/src/printsupport/kernel/qplatformprintplugin.cpp
@@ -55,6 +55,7 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin()
static QPlatformPrinterSupport *printerSupport = 0;
+#ifndef QT_NO_LIBRARY
static void cleanupPrinterSupport()
{
#ifndef QT_NO_PRINTER
@@ -62,6 +63,7 @@ static void cleanupPrinterSupport()
#endif
printerSupport = 0;
}
+#endif // !QT_NO_LIBRARY
/*!
\internal
@@ -73,6 +75,7 @@ static void cleanupPrinterSupport()
*/
QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
{
+#ifndef QT_NO_LIBRARY
if (!printerSupport) {
const QMultiMap<int, QString> keyMap = loader()->keyMap();
if (!keyMap.isEmpty())
@@ -80,6 +83,7 @@ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
if (printerSupport)
qAddPostRoutine(cleanupPrinterSupport);
}
+#endif // !QT_NO_LIBRARY
return printerSupport;
}
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
index a097d26a9e..6a05cc1589 100644
--- a/src/printsupport/kernel/qprint_p.h
+++ b/src/printsupport/kernel/qprint_p.h
@@ -245,7 +245,7 @@ public:
// but where would it live? Not in base module as don't want to link to CUPS.
// May have to have two copies in plugins to keep in sync.
- static QPrint::InputSlot ppdChoiceToInputSlot(ppd_choice_t choice)
+ static QPrint::InputSlot ppdChoiceToInputSlot(const ppd_choice_t &choice)
{
QPrint::InputSlot input;
input.key = choice.choice;
@@ -255,7 +255,7 @@ public:
return input;
}
- static QPrint::OutputBin ppdChoiceToOutputBin(ppd_choice_t choice)
+ static QPrint::OutputBin ppdChoiceToOutputBin(const ppd_choice_t &choice)
{
QPrint::OutputBin output;
output.key = choice.choice;
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
index 707847ba3f..00a8ca7c98 100644
--- a/src/printsupport/kernel/qprintengine_win.cpp
+++ b/src/printsupport/kernel/qprintengine_win.cpp
@@ -1150,7 +1150,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->updateMetrics();
d->doReinit();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_Orientation," << orientation << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_Orientation," << orientation << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
break;
@@ -1173,7 +1173,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->setPageSize(pageSize);
d->doReinit();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_PageSize," << value.toInt() << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_PageSize," << value.toInt() << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
}
@@ -1189,7 +1189,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->setPageSize(pageSize);
d->doReinit();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_PaperName," << value.toString() << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_PaperName," << value.toString() << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
}
@@ -1228,7 +1228,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->stretch_y = d->dpi_y / double(d->resolution);
d->updateMetrics();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_Resolution," << value.toInt() << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_Resolution," << value.toInt() << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
break;
@@ -1242,7 +1242,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->setPageSize(pageSize);
d->doReinit();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_WindowsPageSize," << value.toInt() << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_WindowsPageSize," << value.toInt() << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
break;
@@ -1258,7 +1258,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->setPageSize(pageSize);
d->doReinit();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_CustomPaperSize," << value.toSizeF() << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_CustomPaperSize," << value.toSizeF() << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
}
@@ -1273,7 +1273,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
margins.at(2).toReal(), margins.at(3).toReal()));
d->updateMetrics();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_PageMargins," << margins << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_PageMargins," << margins << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
break;
@@ -1288,7 +1288,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->setPageSize(pageSize);
d->doReinit();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageSize," << pageSize << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageSize," << pageSize << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
}
@@ -1301,7 +1301,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->m_pageLayout.setMargins(pair.first);
d->updateMetrics();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageMargins," << pair.first << pair.second << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageMargins," << pair.first << pair.second << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
break;
@@ -1317,7 +1317,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
d->m_pageLayout.setMargins(pageLayout.margins());
d->updateMetrics();
#ifdef QT_DEBUG_METRICS
- qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageLayout," << pageLayout << ")";
+ qDebug() << "QWin32PrintEngine::setProperty(PPK_QPageLayout," << pageLayout << ')';
d->debugMetrics();
#endif // QT_DEBUG_METRICS
}
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index e9009aa2f7..2cecf61573 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -160,7 +160,7 @@ void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinte
initEngines(format, printer);
if (oldPrintEngine) {
- foreach (QPrintEngine::PrintEnginePropertyKey key, m_properties.values()) {
+ foreach (QPrintEngine::PrintEnginePropertyKey key, m_properties) {
QVariant prop;
// PPK_NumberOfCopies need special treatmeant since it in most cases
// will return 1, disregarding the actual value that was set
@@ -1942,7 +1942,9 @@ QList<int> QPrinter::supportedResolutions() const
QList<QVariant> varlist
= d->printEngine->property(QPrintEngine::PPK_SupportedResolutions).toList();
QList<int> intlist;
- for (int i=0; i<varlist.size(); ++i)
+ const int numSupportedResolutions = varlist.size();
+ intlist.reserve(numSupportedResolutions);
+ for (int i = 0; i < numSupportedResolutions; ++i)
intlist << varlist.at(i).toInt();
return intlist;
}
diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp
index ad488a10ed..1be574891b 100644
--- a/src/printsupport/kernel/qprinterinfo.cpp
+++ b/src/printsupport/kernel/qprinterinfo.cpp
@@ -316,7 +316,9 @@ QList<QPrinter::PaperSize> QPrinterInfo::supportedPaperSizes() const
{
Q_D(const QPrinterInfo);
QList<QPrinter::PaperSize> list;
- foreach (const QPageSize &pageSize, d->m_printDevice.supportedPageSizes())
+ const QList<QPageSize> supportedPageSizes = d->m_printDevice.supportedPageSizes();
+ list.reserve(supportedPageSizes.size());
+ foreach (const QPageSize &pageSize, supportedPageSizes)
list.append(QPrinter::PaperSize(pageSize.id()));
return list;
}
@@ -336,7 +338,9 @@ QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const
{
Q_D(const QPrinterInfo);
QList<QPair<QString, QSizeF> > list;
- foreach (const QPageSize &pageSize, d->m_printDevice.supportedPageSizes())
+ const QList<QPageSize> supportedPageSizes = d->m_printDevice.supportedPageSizes();
+ list.reserve(supportedPageSizes.size());
+ foreach (const QPageSize &pageSize, supportedPageSizes)
list.append(qMakePair(pageSize.name(), pageSize.size(QPageSize::Millimeter)));
return list;
}
@@ -376,7 +380,9 @@ QList<QPrinter::DuplexMode> QPrinterInfo::supportedDuplexModes() const
{
Q_D(const QPrinterInfo);
QList<QPrinter::DuplexMode> list;
- foreach (QPrint::DuplexMode mode, d->m_printDevice.supportedDuplexModes())
+ const QList<QPrint::DuplexMode> supportedDuplexModes = d->m_printDevice.supportedDuplexModes();
+ list.reserve(supportedDuplexModes.size());
+ foreach (QPrint::DuplexMode mode, supportedDuplexModes)
list << QPrinter::DuplexMode(mode);
return list;
}
@@ -416,7 +422,9 @@ QList<QPrinterInfo> QPrinterInfo::availablePrinters()
QList<QPrinterInfo> list;
QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
if (ps) {
- foreach (const QString &id, ps->availablePrintDeviceIds())
+ const QStringList availablePrintDeviceIds = ps->availablePrintDeviceIds();
+ list.reserve(availablePrintDeviceIds.size());
+ foreach (const QString &id, availablePrintDeviceIds)
list.append(QPrinterInfo(id));
}
return list;
diff --git a/src/printsupport/widgets/qcupsjobwidget.cpp b/src/printsupport/widgets/qcupsjobwidget.cpp
index ce8b0d1ed3..43ec37e119 100644
--- a/src/printsupport/widgets/qcupsjobwidget.cpp
+++ b/src/printsupport/widgets/qcupsjobwidget.cpp
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
/*!
\internal
@@ -206,6 +206,6 @@ QCUPSSupport::BannerPage QCupsJobWidget::endBannerPage() const
return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();
}
-#endif // QT_NO_PRINTER
+#endif // QT_NO_PRINTER / QT_NO_CUPS
QT_END_NAMESPACE
diff --git a/src/printsupport/widgets/qcupsjobwidget_p.h b/src/printsupport/widgets/qcupsjobwidget_p.h
index dfd2016130..65fea24d2a 100644
--- a/src/printsupport/widgets/qcupsjobwidget_p.h
+++ b/src/printsupport/widgets/qcupsjobwidget_p.h
@@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
class QString;
class QTime;
@@ -100,7 +100,7 @@ private:
Q_DISABLE_COPY(QCupsJobWidget)
};
-#endif // QT_NO_PRINTER
+#endif // QT_NO_PRINTER / QT_NO_CUPS
QT_END_NAMESPACE
diff --git a/src/printsupport/widgets/qprintpreviewwidget.h b/src/printsupport/widgets/qprintpreviewwidget.h
index e88b421ca9..16b388d936 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.h
+++ b/src/printsupport/widgets/qprintpreviewwidget.h
@@ -62,8 +62,9 @@ public:
FitInView
};
- explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = 0, Qt::WindowFlags flags = 0);
- explicit QPrintPreviewWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = Q_NULLPTR,
+ Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QPrintPreviewWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QPrintPreviewWidget();
qreal zoomFactor() const;
diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf
index 5a224adeb9..ceaa75f455 100644
--- a/src/sql/doc/qtsql.qdocconf
+++ b/src/sql/doc/qtsql.qdocconf
@@ -4,7 +4,7 @@ project = QtSql
description = Qt SQL Reference Documentation
version = $QT_VERSION
-examplesinstallpath = sql
+examplesinstallpath = qtbase/sql
qhp.projects = QtSql
diff --git a/src/sql/doc/snippets/code/src_sql_kernel_qsqldatabase.cpp b/src/sql/doc/snippets/code/src_sql_kernel_qsqldatabase.cpp
index c3b3b8e817..95422c9e7b 100644
--- a/src/sql/doc/snippets/code/src_sql_kernel_qsqldatabase.cpp
+++ b/src/sql/doc/snippets/code/src_sql_kernel_qsqldatabase.cpp
@@ -80,7 +80,7 @@ if (db.open()) {
//! [4]
...
// MySQL connection
-db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1"); // use an SSL connection to the server
+db.setConnectOptions("SSL_KEY=client-key.pem;SSL_CERT=client-cert.pem;SSL_CA=ca-cert.pem;CLIENT_IGNORE_SPACE=1"); // use an SSL connection to the server
if (!db.open()) {
db.setConnectOptions(); // clears the connect option string
...
diff --git a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp
index 0938fa775d..068a2c04f1 100644
--- a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp
+++ b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp
@@ -239,8 +239,9 @@ void QSqlQueryModel_snippets()
}
//! [21]
- QSqlQueryModel model;
- model.setQuery("SELECT * FROM employee");
+ QSqlTableModel model;
+ model.setTable("employee");
+ model.select();
int salary = model.record(4).value("salary").toInt();
//! [21]
Q_UNUSED(salary);
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index 8ac7f765e2..96bdcc42fa 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -45,6 +45,7 @@
#include <qstringlist.h>
#include <qtextcodec.h>
#include <qvector.h>
+#include <qfile.h>
#include <qdebug.h>
@@ -236,7 +237,11 @@ static QVariant::Type qDecodeMYSQLType(int mysqltype, uint flags)
QVariant::Type type;
switch (mysqltype) {
case FIELD_TYPE_TINY :
+ type = static_cast<QVariant::Type>((flags & UNSIGNED_FLAG) ? QMetaType::UChar : QMetaType::Char);
+ break;
case FIELD_TYPE_SHORT :
+ type = static_cast<QVariant::Type>((flags & UNSIGNED_FLAG) ? QMetaType::UShort : QMetaType::Short);
+ break;
case FIELD_TYPE_LONG :
case FIELD_TYPE_INT24 :
type = (flags & UNSIGNED_FLAG) ? QVariant::UInt : QVariant::Int;
@@ -315,14 +320,12 @@ static bool qIsBlob(int t)
static bool qIsInteger(int t)
{
- return t == MYSQL_TYPE_TINY
- || t == MYSQL_TYPE_SHORT
- || t == MYSQL_TYPE_LONG
- || t == MYSQL_TYPE_LONGLONG
- || t == MYSQL_TYPE_INT24;
+ return t == QMetaType::Char || t == QMetaType::UChar
+ || t == QMetaType::Short || t == QMetaType::UShort
+ || t == QMetaType::Int || t == QMetaType::UInt
+ || t == QMetaType::LongLong || t == QMetaType::ULongLong;
}
-
void QMYSQLResultPrivate::bindBlobs()
{
int i;
@@ -370,14 +373,9 @@ bool QMYSQLResultPrivate::bindInValues()
// after mysql_stmt_exec() in QMYSQLResult::exec()
fieldInfo->length = 0;
hasBlobs = true;
+ } else if (qIsInteger(f.type)) {
+ fieldInfo->length = 8;
} else {
- // fieldInfo->length specifies the display width, which may be too
- // small to hold valid integer values (see
- // http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html ), so
- // always use the MAX_BIGINT_WIDTH for integer types
- if (qIsInteger(fieldInfo->type)) {
- fieldInfo->length = MAX_BIGINT_WIDTH;
- }
fieldInfo->type = MYSQL_TYPE_STRING;
}
bind = &inBinds[i];
@@ -597,6 +595,9 @@ QVariant QMYSQLResult::data(int field)
if (f.nullIndicator)
return QVariant(f.type);
+ if (qIsInteger(f.type))
+ return QVariant(f.type, f.outField);
+
if (f.type != QVariant::ByteArray)
val = toUnicode(d->driver->d_func()->tc, f.outField, f.bufLength);
} else {
@@ -604,18 +605,24 @@ QVariant QMYSQLResult::data(int field)
// NULL value
return QVariant(f.type);
}
+
fieldLength = mysql_fetch_lengths(d->result)[field];
+
if (f.type != QVariant::ByteArray)
val = toUnicode(d->driver->d_func()->tc, d->row[field], fieldLength);
}
- switch(f.type) {
+ switch (static_cast<int>(f.type)) {
case QVariant::LongLong:
return QVariant(val.toLongLong());
case QVariant::ULongLong:
return QVariant(val.toULongLong());
+ case QMetaType::Char:
+ case QMetaType::Short:
case QVariant::Int:
return QVariant(val.toInt());
+ case QMetaType::UChar:
+ case QMetaType::UShort:
case QVariant::UInt:
return QVariant(val.toUInt());
case QVariant::Double: {
@@ -1211,7 +1218,7 @@ static void setOptionFlag(uint &optionFlags, const QString &opt)
else if (opt == QLatin1String("CLIENT_ODBC"))
optionFlags |= CLIENT_ODBC;
else if (opt == QLatin1String("CLIENT_SSL"))
- optionFlags |= CLIENT_SSL;
+ qWarning("QMYSQLDriver: SSL_KEY, SSL_CERT and SSL_CA should be used instead of CLIENT_SSL.");
else
qWarning("QMYSQLDriver::open: Unknown connect option '%s'", opt.toLocal8Bit().constData());
}
@@ -1235,6 +1242,11 @@ bool QMYSQLDriver::open(const QString& db,
unsigned int optionFlags = Q_CLIENT_MULTI_STATEMENTS;
const QStringList opts(connOpts.split(QLatin1Char(';'), QString::SkipEmptyParts));
QString unixSocket;
+ QString sslCert;
+ QString sslCA;
+ QString sslKey;
+ QString sslCAPath;
+ QString sslCipher;
#if MYSQL_VERSION_ID >= 50000
my_bool reconnect=false;
uint connectTimeout = 0;
@@ -1263,6 +1275,16 @@ bool QMYSQLDriver::open(const QString& db,
writeTimeout = val.toInt();
}
#endif
+ else if (opt == QLatin1String("SSL_KEY"))
+ sslKey = val;
+ else if (opt == QLatin1String("SSL_CERT"))
+ sslCert = val;
+ else if (opt == QLatin1String("SSL_CA"))
+ sslCA = val;
+ else if (opt == QLatin1String("SSL_CAPATH"))
+ sslCAPath = val;
+ else if (opt == QLatin1String("SSL_CIPHER"))
+ sslCipher = val;
else if (val == QLatin1String("TRUE") || val == QLatin1String("1"))
setOptionFlag(optionFlags, tmp.left(idx).simplified());
else
@@ -1273,51 +1295,66 @@ bool QMYSQLDriver::open(const QString& db,
}
}
- if ((d->mysql = mysql_init((MYSQL*) 0))) {
-#if MYSQL_VERSION_ID >= 50000
- if (connectTimeout != 0)
- mysql_options(d->mysql, MYSQL_OPT_CONNECT_TIMEOUT, &connectTimeout);
- if (readTimeout != 0)
- mysql_options(d->mysql, MYSQL_OPT_READ_TIMEOUT, &readTimeout);
- if (writeTimeout != 0)
- mysql_options(d->mysql, MYSQL_OPT_WRITE_TIMEOUT, &writeTimeout);
-#endif
- MYSQL *mysql = mysql_real_connect(d->mysql,
- host.isNull() ? static_cast<const char *>(0)
- : host.toLocal8Bit().constData(),
- user.isNull() ? static_cast<const char *>(0)
- : user.toLocal8Bit().constData(),
- password.isNull() ? static_cast<const char *>(0)
- : password.toLocal8Bit().constData(),
- db.isNull() ? static_cast<const char *>(0)
- : db.toLocal8Bit().constData(),
- (port > -1) ? port : 0,
- unixSocket.isNull() ? static_cast<const char *>(0)
- : unixSocket.toLocal8Bit().constData(),
- optionFlags);
-
- if (mysql == d->mysql) {
- if (!db.isEmpty() && mysql_select_db(d->mysql, db.toLocal8Bit().constData())) {
- setLastError(qMakeError(tr("Unable to open database '%1'").arg(db), QSqlError::ConnectionError, d));
- mysql_close(d->mysql);
- setOpenError(true);
- return false;
- }
+ if (!(d->mysql = mysql_init((MYSQL*) 0))) {
+ setLastError(qMakeError(tr("Unable to allocate a MYSQL object"),
+ QSqlError::ConnectionError, d));
+ setOpenError(true);
+ return false;
+ }
+
+ if (!sslKey.isNull() || !sslCert.isNull() || !sslCA.isNull() ||
+ !sslCAPath.isNull() || !sslCipher.isNull()) {
+ mysql_ssl_set(d->mysql,
+ sslKey.isNull() ? static_cast<const char *>(0)
+ : QFile::encodeName(sslKey).constData(),
+ sslCert.isNull() ? static_cast<const char *>(0)
+ : QFile::encodeName(sslCert).constData(),
+ sslCA.isNull() ? static_cast<const char *>(0)
+ : QFile::encodeName(sslCA).constData(),
+ sslCAPath.isNull() ? static_cast<const char *>(0)
+ : QFile::encodeName(sslCAPath).constData(),
+ sslCipher.isNull() ? static_cast<const char *>(0)
+ : sslCipher.toLocal8Bit().constData());
+ }
+
#if MYSQL_VERSION_ID >= 50000
- if (reconnect)
- mysql_options(d->mysql, MYSQL_OPT_RECONNECT, &reconnect);
+ if (connectTimeout != 0)
+ mysql_options(d->mysql, MYSQL_OPT_CONNECT_TIMEOUT, &connectTimeout);
+ if (readTimeout != 0)
+ mysql_options(d->mysql, MYSQL_OPT_READ_TIMEOUT, &readTimeout);
+ if (writeTimeout != 0)
+ mysql_options(d->mysql, MYSQL_OPT_WRITE_TIMEOUT, &writeTimeout);
#endif
- } else {
- setLastError(qMakeError(tr("Unable to connect"),
- QSqlError::ConnectionError, d));
+ MYSQL *mysql = mysql_real_connect(d->mysql,
+ host.isNull() ? static_cast<const char *>(0)
+ : host.toLocal8Bit().constData(),
+ user.isNull() ? static_cast<const char *>(0)
+ : user.toLocal8Bit().constData(),
+ password.isNull() ? static_cast<const char *>(0)
+ : password.toLocal8Bit().constData(),
+ db.isNull() ? static_cast<const char *>(0)
+ : db.toLocal8Bit().constData(),
+ (port > -1) ? port : 0,
+ unixSocket.isNull() ? static_cast<const char *>(0)
+ : unixSocket.toLocal8Bit().constData(),
+ optionFlags);
+
+ if (mysql == d->mysql) {
+ if (!db.isEmpty() && mysql_select_db(d->mysql, db.toLocal8Bit().constData())) {
+ setLastError(qMakeError(tr("Unable to open database '%1'").arg(db), QSqlError::ConnectionError, d));
mysql_close(d->mysql);
- d->mysql = NULL;
setOpenError(true);
return false;
}
+#if MYSQL_VERSION_ID >= 50000
+ if (reconnect)
+ mysql_options(d->mysql, MYSQL_OPT_RECONNECT, &reconnect);
+#endif
} else {
- setLastError(qMakeError(tr("Failed to allocated data"),
- QSqlError::UnknownError, d));
+ setLastError(qMakeError(tr("Unable to connect"),
+ QSqlError::ConnectionError, d));
+ mysql_close(d->mysql);
+ d->mysql = NULL;
setOpenError(true);
return false;
}
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index 33e3b96276..f0c0b224bd 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -2452,7 +2452,7 @@ QStringList QOCIDriver::tables(QSql::TableType type) const
t.exec(query + whereList.join(QLatin1String(" or ")));
while (t.next()) {
if (t.value(0).toString() != d->user)
- tl.append(t.value(0).toString() + QLatin1String(".") + t.value(1).toString());
+ tl.append(t.value(0).toString() + QLatin1Char('.') + t.value(1).toString());
else
tl.append(t.value(1).toString());
}
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 4795738b66..de1f1638fd 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -449,7 +449,7 @@ QVariant QPSQLResult::data(int i)
case QVariant::ByteArray: {
size_t len;
unsigned char *data = PQunescapeBytea((const unsigned char*)val, &len);
- QByteArray ba((const char*)data, len);
+ QByteArray ba(reinterpret_cast<const char *>(data), int(len));
qPQfreemem(data);
return QVariant(ba);
}
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 06e849ccd5..4286f5b338 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -744,7 +744,7 @@ static QSqlIndex qGetTableInfo(QSqlQuery &q, const QString &tableName, bool only
schema = tableName.left(indexOfSeparator).append(QLatin1Char('.'));
table = tableName.mid(indexOfSeparator + 1);
}
- q.exec(QLatin1String("PRAGMA ") + schema + QLatin1String("table_info (") + _q_escapeIdentifier(table) + QLatin1String(")"));
+ q.exec(QLatin1String("PRAGMA ") + schema + QLatin1String("table_info (") + _q_escapeIdentifier(table) + QLatin1Char(')'));
QSqlIndex ind;
while (q.next()) {
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 240e19bf20..90c64d7331 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -1218,7 +1218,6 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\li CLIENT_COMPRESS
\li CLIENT_FOUND_ROWS
\li CLIENT_IGNORE_SPACE
- \li CLIENT_SSL
\li CLIENT_ODBC
\li CLIENT_NO_SCHEMA
\li CLIENT_INTERACTIVE
@@ -1227,6 +1226,11 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\li MYSQL_OPT_CONNECT_TIMEOUT
\li MYSQL_OPT_READ_TIMEOUT
\li MYSQL_OPT_WRITE_TIMEOUT
+ \li SSL_KEY
+ \li SSL_CERT
+ \li SSL_CA
+ \li SSL_CAPATH
+ \li SSL_CIPHER
\endlist
\li
diff --git a/src/sql/kernel/qsqldriver.h b/src/sql/kernel/qsqldriver.h
index e8375765aa..c53e1b81ee 100644
--- a/src/sql/kernel/qsqldriver.h
+++ b/src/sql/kernel/qsqldriver.h
@@ -83,7 +83,7 @@ public:
DB2
};
- explicit QSqlDriver(QObject *parent=0);
+ explicit QSqlDriver(QObject *parent = Q_NULLPTR);
~QSqlDriver();
virtual bool isOpen() const;
bool isOpenError() const;
@@ -133,7 +133,7 @@ Q_SIGNALS:
void notification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload);
protected:
- QSqlDriver(QSqlDriverPrivate &dd, QObject *parent = 0);
+ QSqlDriver(QSqlDriverPrivate &dd, QObject *parent = Q_NULLPTR);
virtual void setOpen(bool o);
virtual void setOpenError(bool e);
virtual void setLastError(const QSqlError& e);
diff --git a/src/sql/kernel/qsqldriverplugin.h b/src/sql/kernel/qsqldriverplugin.h
index 55b8c81878..fd1a6203cb 100644
--- a/src/sql/kernel/qsqldriverplugin.h
+++ b/src/sql/kernel/qsqldriverplugin.h
@@ -49,7 +49,7 @@ class Q_SQL_EXPORT QSqlDriverPlugin : public QObject
{
Q_OBJECT
public:
- explicit QSqlDriverPlugin(QObject *parent = 0);
+ explicit QSqlDriverPlugin(QObject *parent = Q_NULLPTR);
~QSqlDriverPlugin();
virtual QSqlDriver *create(const QString &key) = 0;
diff --git a/src/sql/kernel/qsqlindex.cpp b/src/sql/kernel/qsqlindex.cpp
index 53e13c85e6..bb80cf3e03 100644
--- a/src/sql/kernel/qsqlindex.cpp
+++ b/src/sql/kernel/qsqlindex.cpp
@@ -38,6 +38,9 @@
QT_BEGIN_NAMESPACE
+// ### Qt 6: remove the static assertion, the 'sorts' field was changed from QList to QVector in Qt 5.6
+Q_STATIC_ASSERT((sizeof(QList<bool>) == sizeof(QVector<bool>)));
+
/*!
\class QSqlIndex
\brief The QSqlIndex class provides functions to manipulate and
diff --git a/src/sql/kernel/qsqlindex.h b/src/sql/kernel/qsqlindex.h
index d3d4a7c9aa..4a81d48161 100644
--- a/src/sql/kernel/qsqlindex.h
+++ b/src/sql/kernel/qsqlindex.h
@@ -36,7 +36,10 @@
#include <QtSql/qsqlrecord.h>
#include <QtCore/qstring.h>
+#include <QtCore/qvector.h>
+#if QT_DEPRECATED_SINCE(5,6)
#include <QtCore/qlist.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -63,7 +66,7 @@ private:
QString createField(int i, const QString& prefix, bool verbose) const;
QString cursor;
QString nm;
- QList<bool> sorts;
+ QVector<bool> sorts;
};
QT_END_NAMESPACE
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp
index 3faea11c70..5a1958708a 100644
--- a/src/sql/models/qsqlquerymodel.cpp
+++ b/src/sql/models/qsqlquerymodel.cpp
@@ -471,6 +471,7 @@ void QSqlQueryModel::setQuery(const QString &query, const QSqlDatabase &db)
void QSqlQueryModel::clear()
{
Q_D(QSqlQueryModel);
+ beginResetModel();
d->error = QSqlError();
d->atEnd = true;
d->query.clear();
@@ -478,6 +479,7 @@ void QSqlQueryModel::clear()
d->colOffsets.clear();
d->bottom = QModelIndex();
d->headers.clear();
+ endResetModel();
}
/*!
diff --git a/src/sql/models/qsqlquerymodel.h b/src/sql/models/qsqlquerymodel.h
index 2d37b9a482..5c7c22af10 100644
--- a/src/sql/models/qsqlquerymodel.h
+++ b/src/sql/models/qsqlquerymodel.h
@@ -51,7 +51,7 @@ class Q_SQL_EXPORT QSqlQueryModel: public QAbstractTableModel
Q_DECLARE_PRIVATE(QSqlQueryModel)
public:
- explicit QSqlQueryModel(QObject *parent = 0);
+ explicit QSqlQueryModel(QObject *parent = Q_NULLPTR);
virtual ~QSqlQueryModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@@ -98,7 +98,7 @@ protected:
virtual QModelIndex indexInQuery(const QModelIndex &item) const;
void setLastError(const QSqlError &error);
- QSqlQueryModel(QSqlQueryModelPrivate &dd, QObject *parent = 0);
+ QSqlQueryModel(QSqlQueryModelPrivate &dd, QObject *parent = Q_NULLPTR);
};
QT_END_NAMESPACE
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index 42acf6a73b..ac2d270fc8 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -652,9 +652,11 @@ void QSqlRelationalTableModel::revertRow(int row)
void QSqlRelationalTableModel::clear()
{
Q_D(QSqlRelationalTableModel);
+ beginResetModel();
d->clearChanges();
d->relations.clear();
QSqlTableModel::clear();
+ endResetModel();
}
diff --git a/src/sql/models/qsqlrelationaltablemodel.h b/src/sql/models/qsqlrelationaltablemodel.h
index f7470142d6..f2a546dc1a 100644
--- a/src/sql/models/qsqlrelationaltablemodel.h
+++ b/src/sql/models/qsqlrelationaltablemodel.h
@@ -70,7 +70,7 @@ public:
LeftJoin
};
- explicit QSqlRelationalTableModel(QObject *parent = 0,
+ explicit QSqlRelationalTableModel(QObject *parent = Q_NULLPTR,
QSqlDatabase db = QSqlDatabase());
virtual ~QSqlRelationalTableModel();
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index b0d3e6df9d..740c1b9b5d 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -1262,8 +1262,10 @@ void QSqlTableModel::setFilter(const QString &filter)
void QSqlTableModel::clear()
{
Q_D(QSqlTableModel);
+ beginResetModel();
d->clear();
QSqlQueryModel::clear();
+ endResetModel();
}
/*! \reimp
diff --git a/src/sql/models/qsqltablemodel.h b/src/sql/models/qsqltablemodel.h
index a06abefb1c..5481a777a1 100644
--- a/src/sql/models/qsqltablemodel.h
+++ b/src/sql/models/qsqltablemodel.h
@@ -53,7 +53,7 @@ class Q_SQL_EXPORT QSqlTableModel: public QSqlQueryModel
public:
enum EditStrategy {OnFieldChange, OnRowChange, OnManualSubmit};
- explicit QSqlTableModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase());
+ explicit QSqlTableModel(QObject *parent = Q_NULLPTR, QSqlDatabase db = QSqlDatabase());
virtual ~QSqlTableModel();
virtual void setTable(const QString &tableName);
@@ -115,7 +115,7 @@ Q_SIGNALS:
void beforeDelete(int row);
protected:
- QSqlTableModel(QSqlTableModelPrivate &dd, QObject *parent = 0, QSqlDatabase db = QSqlDatabase());
+ QSqlTableModel(QSqlTableModelPrivate &dd, QObject *parent = Q_NULLPTR, QSqlDatabase db = QSqlDatabase());
virtual bool updateRowInTable(int row, const QSqlRecord &values);
virtual bool insertRowIntoTable(const QSqlRecord &values);
diff --git a/src/src.pro b/src/src.pro
index 61e5ce2d8d..167133859b 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -2,6 +2,9 @@ TEMPLATE = subdirs
load(qfeatures)
+src_qtzlib.file = $$PWD/corelib/qtzlib.pro
+src_qtzlib.target = sub-zlib
+
src_tools_bootstrap.subdir = tools/bootstrap
src_tools_bootstrap.target = sub-bootstrap
src_tools_bootstrap.CONFIG = host_build
@@ -28,12 +31,6 @@ src_tools_uic.CONFIG = host_build
force_bootstrap: src_tools_uic.depends = src_tools_bootstrap
else: src_tools_uic.depends = src_corelib
-src_tools_qdoc.subdir = tools/qdoc
-src_tools_qdoc.target = sub-qdoc
-src_tools_qdoc.CONFIG = host_build
-force_bootstrap: src_tools_qdoc.depends = src_tools_bootstrap
-else: src_tools_qdoc.depends = src_corelib src_xml
-
src_tools_bootstrap_dbus.subdir = tools/bootstrap-dbus
src_tools_bootstrap_dbus.target = sub-bootstrap_dbus
src_tools_bootstrap_dbus.depends = src_tools_bootstrap
@@ -66,6 +63,7 @@ src_xml.depends = src_corelib
src_dbus.subdir = $$PWD/dbus
src_dbus.target = sub-dbus
src_dbus.depends = src_corelib
+force_bootstrap: src_dbus.depends += src_tools_bootstrap_dbus # avoid syncqt race
src_concurrent.subdir = $$PWD/concurrent
src_concurrent.target = sub-concurrent
@@ -110,7 +108,7 @@ src_platformsupport.depends = src_corelib src_gui src_platformheaders
src_widgets.subdir = $$PWD/widgets
src_widgets.target = sub-widgets
-src_widgets.depends = src_corelib src_gui src_tools_uic
+src_widgets.depends = src_corelib src_gui src_tools_uic src_platformheaders
src_opengl.subdir = $$PWD/opengl
src_opengl.target = sub-opengl
@@ -131,6 +129,7 @@ src_plugins.depends = src_sql src_xml src_network
src_android.subdir = $$PWD/android
# this order is important
+contains(QT_CONFIG, zlib)|cross_compile: SUBDIRS += src_qtzlib
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
!contains(QT_DISABLED_FEATURES, regularexpression):pcre {
SUBDIRS += src_3rdparty_pcre
@@ -141,9 +140,8 @@ TOOLS = src_tools_moc src_tools_rcc src_tools_qlalr
win32:SUBDIRS += src_winmain
SUBDIRS += src_network src_sql src_xml src_testlib
contains(QT_CONFIG, dbus) {
- SUBDIRS += src_dbus
force_bootstrap: SUBDIRS += src_tools_bootstrap_dbus
- SUBDIRS += src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
+ SUBDIRS += src_dbus src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
TOOLS += src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
contains(QT_CONFIG, accessibility-atspi-bridge): \
src_platformsupport.depends += src_dbus src_tools_qdbusxml2cpp
@@ -182,7 +180,7 @@ contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent
}
}
}
-SUBDIRS += src_plugins src_tools_qdoc
+SUBDIRS += src_plugins
nacl: SUBDIRS -= src_network src_testlib
diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf
index 0fafc733b1..72db51b925 100644
--- a/src/testlib/doc/qttestlib.qdocconf
+++ b/src/testlib/doc/qttestlib.qdocconf
@@ -4,7 +4,7 @@ project = QtTestLib
description = Qt Test Reference Documentation
version = $QT_VERSION
-examplesinstallpath = testlib
+examplesinstallpath = qtbase/testlib
qhp.projects = QtTestLib
diff --git a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
index 29cbefdc04..8c32787b42 100644
--- a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
@@ -147,7 +147,7 @@ namespace QTest {
{
QByteArray ba = "MyPoint(";
ba += QByteArray::number(point.x()) + ", " + QByteArray::number(point.y());
- ba += ")";
+ ba += ')';
return qstrdup(ba.data());
}
}
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index d785f3d4b7..6312a34cb8 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -91,6 +91,7 @@ struct QBenchmarkContext
QBenchmarkContext() : checkpointIndex(-1) {}
};
+Q_DECLARE_TYPEINFO(QBenchmarkContext, Q_MOVABLE_TYPE);
class QBenchmarkResult
{
@@ -126,6 +127,7 @@ public:
return (value / iterations) < (other.value / other.iterations);
}
};
+Q_DECLARE_TYPEINFO(QBenchmarkResult, Q_MOVABLE_TYPE);
/*
The QBenchmarkGlobalData class stores global benchmark-related data.
diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp
index ee212a49d0..f6d2c20a4a 100644
--- a/src/testlib/qbenchmarkmetric.cpp
+++ b/src/testlib/qbenchmarkmetric.cpp
@@ -79,7 +79,6 @@
*/
/*!
- \relates QTest
\since 4.7
Returns the enum value \a metric as a character string.
*/
@@ -152,7 +151,6 @@ const char * QTest::benchmarkMetricName(QBenchmarkMetric metric)
};
/*!
- \relates QTest
\since 4.7
Retuns the units of measure for the specified \a metric.
*/
diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h
index cfde89aec8..e9744d0b07 100644
--- a/src/testlib/qsignalspy.h
+++ b/src/testlib/qsignalspy.h
@@ -82,7 +82,7 @@ public:
}
if (!QMetaObject::connect(obj, sigIndex, this, memberOffset,
- Qt::DirectConnection, 0)) {
+ Qt::DirectConnection, Q_NULLPTR)) {
qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
return;
}
@@ -175,8 +175,11 @@ private:
tp = QMetaType::UnknownType;
}
if (tp == QMetaType::UnknownType) {
- qWarning("Don't know how to handle '%s', use qRegisterMetaType to register it.",
- member.parameterNames().at(i).constData());
+ qWarning("QSignalSpy: Unable to handle parameter '%s' of type '%s' of method '%s',"
+ " use qRegisterMetaType to register it.",
+ member.parameterNames().at(i).constData(),
+ member.parameterTypes().at(i).constData(),
+ member.name().constData());
}
args << tp;
}
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 994179958b..8da16af91e 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -51,6 +51,9 @@
#include <QtCore/qsize.h>
#include <QtCore/qrect.h>
+#ifdef QT_NETWORK_LIB
+# include <QtNetwork/qhostaddress.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -162,6 +165,23 @@ template<> inline char *toString(const QVariant &v)
return qstrdup(vstring.constData());
}
+#ifdef QT_NETWORK_LIB
+template<> inline char *toString(const QHostAddress &addr)
+{
+ switch (addr.protocol()) {
+ case QAbstractSocket::UnknownNetworkLayerProtocol:
+ return qstrdup("<unknown address (parse error)>");
+ case QAbstractSocket::AnyIPProtocol:
+ return qstrdup("QHostAddress::Any");
+ case QAbstractSocket::IPv4Protocol:
+ case QAbstractSocket::IPv6Protocol:
+ break;
+ }
+
+ return qstrdup(addr.toString().toLatin1().constData());
+}
+#endif
+
template<>
inline bool qCompare(QString const &t1, QLatin1String const &t2, const char *actual,
const char *expected, const char *file, int line)
@@ -205,7 +225,7 @@ inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual,
delete [] val2;
}
}
- return compare_helper(isOk, msg, 0, 0, actual, expected, file, line);
+ return compare_helper(isOk, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
}
template <>
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index a474758de6..beae9ec065 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -86,24 +86,24 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
qsnprintf(msg, 1024, "Compared QImages differ.\n"
" Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, 0, 0, actual, expected, file, line);
+ return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, 0, 0, 0, actual, expected, file, line);
+ return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QImages differ in size.\n"
" Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, 0, 0, actual, expected, file, line);
+ return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
}
if (t1.format() != t2.format()) {
qsnprintf(msg, 1024, "Compared QImages differ in format.\n"
" Actual (%s): %d\n"
" Expected (%s): %d",
actual, t1.format(), expected, t2.format());
- return compare_helper(false, msg, 0, 0, actual, expected, file, line);
+ return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
}
return compare_helper(t1 == t2, "Compared values are not the same",
toString(t1), toString(t2), actual, expected, file, line);
@@ -120,17 +120,17 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c
qsnprintf(msg, 1024, "Compared QPixmaps differ.\n"
" Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, 0, 0, actual, expected, file, line);
+ return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, 0, 0, 0, actual, expected, file, line);
+ return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n"
" Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, 0, 0, actual, expected, file, line);
+ return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
}
return qCompare(t1.toImage(), t2.toImage(), actual, expected, file, line);
}
diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h
index f1ac625dbd..a397a09908 100644
--- a/src/testlib/qtestaccessible.h
+++ b/src/testlib/qtestaccessible.h
@@ -126,7 +126,7 @@ public:
static void cleanup()
{
delete instance();
- instance() = 0;
+ instance() = Q_NULLPTR;
}
static void clearEvents() { eventList().clear(); }
static EventList events() { return eventList(); }
@@ -135,13 +135,12 @@ public:
for (int i = 0; eventList().isEmpty() && i < 5; ++i)
QTest::qWait(50);
if (eventList().isEmpty()) {
- qWarning("%s: Timeout waiting for accessibility event.", Q_FUNC_INFO);
+ qWarning("Timeout waiting for accessibility event.");
return false;
}
const bool res = *eventList().first() == *ev;
if (!res)
- qWarning("%s: %s", Q_FUNC_INFO,
- qPrintable(msgAccessibilityEventListMismatch(eventList(), ev)));
+ qWarning("%s", qPrintable(msgAccessibilityEventListMismatch(eventList(), ev)));
delete eventList().takeFirst();
return res;
}
@@ -162,8 +161,8 @@ private:
~QTestAccessibility()
{
- QAccessible::installUpdateHandler(0);
- QAccessible::installRootObjectHandler(0);
+ QAccessible::installUpdateHandler(Q_NULLPTR);
+ QAccessible::installRootObjectHandler(Q_NULLPTR);
}
static void rootObjectHandler(QObject *object)
@@ -172,9 +171,9 @@ private:
if (object) {
QGuiApplication* app = qobject_cast<QGuiApplication*>(object);
if ( !app )
- qWarning("%s: root Object is not a QGuiApplication!", Q_FUNC_INFO);
+ qWarning("root Object is not a QGuiApplication!");
} else {
- qWarning("%s: root Object called with 0 pointer", Q_FUNC_INFO);
+ qWarning("root Object called with 0 pointer");
}
}
@@ -268,7 +267,7 @@ private:
static QTestAccessibility *&instance()
{
- static QTestAccessibility *ta = 0;
+ static QTestAccessibility *ta = Q_NULLPTR;
return ta;
}
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp
index 28a2878b32..c2643a2304 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -37,6 +37,9 @@
#include <QtTest/qtest.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qfile.h>
+#include <QtCore/qset.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qvariant.h>
#include <QtCore/QSysInfo>
#include <set>
@@ -61,83 +64,89 @@ QT_BEGIN_NAMESPACE
The known keys are listed below:
*/
-// this table can be extended with new keywords as required
-const char *matchedConditions[] =
+static QSet<QByteArray> keywords()
{
- "*",
+ // this list can be extended with new keywords as required
+ QSet<QByteArray> set = QSet<QByteArray>()
+ << "*"
#ifdef Q_OS_LINUX
- "linux",
+ << "linux"
#endif
#ifdef Q_OS_OSX
- "osx",
+ << "osx"
#endif
#ifdef Q_OS_WIN
- "windows",
+ << "windows"
#endif
#ifdef Q_OS_IOS
- "ios",
+ << "ios"
#endif
#ifdef Q_OS_ANDROID
- "android",
+ << "android"
#endif
#ifdef Q_OS_QNX
- "qnx",
+ << "qnx"
#endif
#ifdef Q_OS_WINRT
- "winrt",
+ << "winrt"
#endif
#ifdef Q_OS_WINCE
- "wince",
+ << "wince"
#endif
#if QT_POINTER_SIZE == 8
- "64bit",
+ << "64bit"
#else
- "32bit",
+ << "32bit"
#endif
#ifdef Q_CC_GNU
- "gcc",
+ << "gcc"
#endif
#ifdef Q_CC_CLANG
- "clang",
+ << "clang"
#endif
#ifdef Q_CC_MSVC
- "msvc",
+ << "msvc"
#ifdef _MSC_VER
- #if _MSC_VER == 1800
- "msvc-2013",
+ #if _MSC_VER == 1900
+ << "msvc-2015"
+ #elif _MSC_VER == 1800
+ << "msvc-2013"
#elif _MSC_VER == 1700
- "msvc-2012",
+ << "msvc-2012"
#elif _MSC_VER == 1600
- "msvc-2010",
+ << "msvc-2010"
#endif
#endif
#endif
#ifdef Q_AUTOTEST_EXPORT
- "developer-build",
+ << "developer-build"
#endif
- 0
-};
+ ;
+ QCoreApplication *app = QCoreApplication::instance();
+ if (app) {
+ const QVariant platformName = app->property("platformName");
+ if (platformName.isValid())
+ set << platformName.toByteArray();
+ }
+
+ return set;
+}
static bool checkCondition(const QByteArray &condition)
{
+ static QSet<QByteArray> matchedConditions = keywords();
QList<QByteArray> conds = condition.split(' ');
- std::set<QByteArray> matches;
- const char **m = matchedConditions;
- while (*m) {
- matches.insert(*m);
- ++m;
- }
QByteArray distributionName = QSysInfo::productType().toLower().toUtf8();
QByteArray distributionRelease = QSysInfo::productVersion().toLower().toUtf8();
if (!distributionName.isEmpty()) {
- if (matches.find(distributionName) == matches.end())
- matches.insert(distributionName);
- matches.insert(distributionName + "-" + distributionRelease);
+ if (matchedConditions.find(distributionName) == matchedConditions.end())
+ matchedConditions.insert(distributionName);
+ matchedConditions.insert(distributionName + "-" + distributionRelease);
}
for (int i = 0; i < conds.size(); ++i) {
@@ -146,7 +155,7 @@ static bool checkCondition(const QByteArray &condition)
if (result)
c = c.mid(1);
- result ^= (matches.find(c) != matches.end());
+ result ^= matchedConditions.contains(c);
if (!result)
return false;
}
@@ -159,6 +168,19 @@ static std::set<QByteArray> *gpuFeatures = 0;
Q_TESTLIB_EXPORT std::set<QByteArray> *(*qgpu_features_ptr)(const QString &) = 0;
+static bool isGPUTestBlacklisted(const char *slot, const char *data = 0)
+{
+ const QByteArray disableKey = QByteArrayLiteral("disable_") + QByteArray(slot);
+ if (gpuFeatures->find(disableKey) != gpuFeatures->end()) {
+ QByteArray msg = QByteArrayLiteral("Skipped due to GPU blacklist: ") + disableKey;
+ if (data)
+ msg += ':' + QByteArray(data);
+ QTest::qSkip(msg.constData(), __FILE__, __LINE__);
+ return true;
+ }
+ return false;
+}
+
namespace QTestPrivate {
void parseBlackList()
@@ -223,10 +245,12 @@ void checkBlackLists(const char *slot, const char *data)
// Tests blacklisted in GPU_BLACKLIST are to be skipped. Just ignoring the result is
// not sufficient since these are expected to crash or behave in undefined ways.
if (!ignore && gpuFeatures) {
- const QByteArray disableKey = QByteArrayLiteral("disable_") + QByteArray(slot);
- if (gpuFeatures->find(disableKey) != gpuFeatures->end()) {
- const QByteArray msg = QByteArrayLiteral("Skipped due to GPU blacklist: ") + disableKey;
- QTest::qSkip(msg.constData(), __FILE__, __LINE__);
+ QByteArray s_gpu = slot;
+ ignore = isGPUTestBlacklisted(s_gpu, data);
+ if (!ignore && data) {
+ s_gpu += ':';
+ s_gpu += data;
+ isGPUTestBlacklisted(s_gpu);
}
}
}
diff --git a/src/testlib/qtestblacklist_p.h b/src/testlib/qtestblacklist_p.h
index 0107e5d282..87f4dfdb5e 100644
--- a/src/testlib/qtestblacklist_p.h
+++ b/src/testlib/qtestblacklist_p.h
@@ -50,9 +50,10 @@
QT_BEGIN_NAMESPACE
namespace QTestPrivate {
- void parseBlackList();
- void parseGpuBlackList();
- void checkBlackLists(const char *slot, const char *data);
+ // Export functions so they can also be used by QQuickTest
+ Q_TESTLIB_EXPORT void parseBlackList();
+ Q_TESTLIB_EXPORT void parseGpuBlackList();
+ Q_TESTLIB_EXPORT void checkBlackLists(const char *slot, const char *data);
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index efc18180db..286da52be2 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -50,6 +50,9 @@
#include <QtCore/private/qtools_p.h>
#include <QtCore/qdiriterator.h>
#include <QtCore/qtemporarydir.h>
+#include <QtCore/qthread.h>
+#include <QtCore/qwaitcondition.h>
+#include <QtCore/qmutex.h>
#include <QtTest/private/qtestlog_p.h>
#include <QtTest/private/qtesttable_p.h>
@@ -70,6 +73,12 @@
#include <stdio.h>
#include <stdlib.h>
+#if defined(Q_OS_LINUX)
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#endif
+
#ifdef Q_OS_WIN
#ifndef Q_OS_WINCE
# if !defined(Q_CC_MINGW) || (defined(Q_CC_MINGW) && defined(__MINGW64_VERSION_MAJOR))
@@ -93,6 +102,40 @@ QT_BEGIN_NAMESPACE
using QtMiscUtils::toHexUpper;
using QtMiscUtils::fromHex;
+
+static void stackTrace()
+{
+ bool ok = false;
+ const int disableStackDump = qEnvironmentVariableIntValue("QTEST_DISABLE_STACK_DUMP", &ok);
+ if (ok && disableStackDump == 1)
+ return;
+#ifdef Q_OS_LINUX
+ fprintf(stderr, "\n========= Received signal, dumping stack ==============\n");
+ char cmd[512];
+ qsnprintf(cmd, 512, "gdb --pid %d 2>/dev/null <<EOF\n"
+ "set prompt\n"
+ "thread apply all where full\n"
+ "detach\n"
+ "quit\n"
+ "EOF\n",
+ (int)getpid());
+ if (system(cmd) == -1)
+ fprintf(stderr, "calling gdb failed\n");
+ fprintf(stderr, "========= End of stack trace ==============\n");
+#elif defined(Q_OS_OSX)
+ fprintf(stderr, "\n========= Received signal, dumping stack ==============\n");
+ char cmd[512];
+ qsnprintf(cmd, 512, "lldb -p %d 2>/dev/null <<EOF\n"
+ "bt all\n"
+ "quit\n"
+ "EOF\n",
+ (int)getpid());
+ if (system(cmd) == -1)
+ fprintf(stderr, "calling lldb failed\n");
+ fprintf(stderr, "========= End of stack trace ==============\n");
+#endif
+}
+
/*!
\namespace QTest
\inmodule QtTest
@@ -205,7 +248,7 @@ using QtMiscUtils::fromHex;
\note This macro can only be used in a test function that is invoked
by the test framework.
- \sa QTRY_VERIFY(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
+ \sa QTRY_VERIFY(), QTRY_VERIFY2_WITH_TIMEOUT(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
*/
@@ -219,7 +262,47 @@ using QtMiscUtils::fromHex;
\note This macro can only be used in a test function that is invoked
by the test framework.
- \sa QTRY_VERIFY_WITH_TIMEOUT(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
+ \sa QTRY_VERIFY_WITH_TIMEOUT(), QTRY_VERIFY2(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
+*/
+
+/*! \macro QTRY_VERIFY2_WITH_TIMEOUT(condition, message, timeout)
+ \since 5.6
+
+ \relates QTest
+
+ The QTRY_VERIFY2_WITH_TIMEOUT macro is similar to QTRY_VERIFY_WITH_TIMEOUT()
+ except that it outputs a verbose \a message when \a condition is still false
+ after the specified \a timeout. The \a message is a plain C string.
+
+ Example:
+ \code
+ QTRY_VERIFY2_WITH_TIMEOUT(list.size() > 2, QByteArray::number(list.size()).constData(), 10000);
+ \endcode
+
+ \note This macro can only be used in a test function that is invoked
+ by the test framework.
+
+ \sa QTRY_VERIFY(), QTRY_VERIFY_WITH_TIMEOUT(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
+*/
+
+/*! \macro QTRY_VERIFY2(condition, message)
+ \since 5.6
+
+ \relates QTest
+
+ Checks the \a condition by invoking QTRY_VERIFY2_WITH_TIMEOUT() with a timeout
+ of five seconds. If \a condition is then still false, \a message is output.
+ The \a message is a plain C string.
+
+ Example:
+ \code
+ QTRY_VERIFY2_WITH_TIMEOUT(list.size() > 2, QByteArray::number(list.size()).constData());
+ \endcode
+
+ \note This macro can only be used in a test function that is invoked
+ by the test framework.
+
+ \sa QTRY_VERIFY2_WITH_TIMEOUT(), QTRY_VERIFY2(), QVERIFY(), QCOMPARE(), QTRY_COMPARE()
*/
/*! \macro QTRY_COMPARE_WITH_TIMEOUT(actual, expected, timeout)
@@ -1276,7 +1359,7 @@ using QtMiscUtils::fromHex;
*/
/*!
- \fn QTouchEventSequence QTest::touchEvent(QWindow *window, QTouchDevice *device, bool autoCommit = true)
+ \fn QTouchEventSequence QTest::touchEvent(QWindow *window, QTouchDevice *device, bool autoCommit)
\since 5.0
Creates and returns a QTouchEventSequence for the \a device to
@@ -1293,7 +1376,7 @@ using QtMiscUtils::fromHex;
*/
/*!
- \fn QTouchEventSequence QTest::touchEvent(QWidget *widget, QTouchDevice *device, bool autoCommit = true)
+ \fn QTouchEventSequence QTest::touchEvent(QWidget *widget, QTouchDevice *device, bool autoCommit)
Creates and returns a QTouchEventSequence for the \a device to
simulate events for \a widget.
@@ -1883,7 +1966,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
QTestLog::addLogger(logFormat, logFilename);
}
-QBenchmarkResult qMedian(const QList<QBenchmarkResult> &container)
+QBenchmarkResult qMedian(const QVector<QBenchmarkResult> &container)
{
const int count = container.count();
if (count == 0)
@@ -1892,7 +1975,7 @@ QBenchmarkResult qMedian(const QList<QBenchmarkResult> &container)
if (count == 1)
return container.front();
- QList<QBenchmarkResult> containerCopy = container;
+ QVector<QBenchmarkResult> containerCopy = container;
std::sort(containerCopy.begin(), containerCopy.end());
const int middle = count / 2;
@@ -1929,7 +2012,7 @@ static void qInvokeTestMethodDataEntry(char *slot)
bool isBenchmark = false;
int i = (QBenchmarkGlobalData::current->measurer->needsWarmupIteration()) ? -1 : 0;
- QList<QBenchmarkResult> results;
+ QVector<QBenchmarkResult> results;
bool minimumTotalReached = false;
do {
QBenchmarkTestMethodData::current->beginDataRun();
@@ -2011,6 +2094,58 @@ static void qInvokeTestMethodDataEntry(char *slot)
}
}
+class WatchDog : public QThread
+{
+public:
+ WatchDog()
+ {
+ QMutexLocker locker(&mutex);
+ timeout.store(-1);
+ start();
+ waitCondition.wait(&mutex);
+ }
+ ~WatchDog() {
+ {
+ QMutexLocker locker(&mutex);
+ timeout.store(0);
+ waitCondition.wakeAll();
+ }
+ wait();
+ }
+
+ void beginTest() {
+ QMutexLocker locker(&mutex);
+ timeout.store(5*60*1000);
+ waitCondition.wakeAll();
+ }
+
+ void testFinished() {
+ QMutexLocker locker(&mutex);
+ timeout.store(-1);
+ waitCondition.wakeAll();
+ }
+
+ void run() {
+ QMutexLocker locker(&mutex);
+ waitCondition.wakeAll();
+ while (1) {
+ int t = timeout.load();
+ if (!t)
+ break;
+ if (!waitCondition.wait(&mutex, t)) {
+ stackTrace();
+ qFatal("Test function timed out");
+ }
+ }
+ }
+
+private:
+ QBasicAtomicInt timeout;
+ QMutex mutex;
+ QWaitCondition waitCondition;
+};
+
+
/*!
\internal
@@ -2020,7 +2155,7 @@ static void qInvokeTestMethodDataEntry(char *slot)
If the function was successfully called, true is returned, otherwise
false.
*/
-static bool qInvokeTestMethod(const char *slotName, const char *data=0)
+static bool qInvokeTestMethod(const char *slotName, const char *data, WatchDog *watchDog)
{
QTEST_ASSERT(slotName);
@@ -2079,7 +2214,11 @@ static bool qInvokeTestMethod(const char *slotName, const char *data=0)
QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0)
: table.testData(curDataIndex));
+ if (watchDog)
+ watchDog->beginTest();
qInvokeTestMethodDataEntry(slot);
+ if (watchDog)
+ watchDog->testFinished();
if (data)
break;
@@ -2351,6 +2490,37 @@ char *toPrettyUnicode(const ushort *p, int length)
return buffer.take();
}
+static bool debuggerPresent()
+{
+#if defined(Q_OS_LINUX)
+ int fd = open("/proc/self/status", O_RDONLY);
+ if (fd == -1)
+ return false;
+ char buffer[2048];
+ ssize_t size = read(fd, buffer, sizeof(buffer));
+ if (size == -1) {
+ close(fd);
+ return false;
+ }
+ buffer[size] = 0;
+ const char tracerPidToken[] = "\nTracerPid:";
+ char *tracerPid = strstr(buffer, tracerPidToken);
+ if (!tracerPid) {
+ close(fd);
+ return false;
+ }
+ tracerPid += sizeof(tracerPidToken);
+ long int pid = strtol(tracerPid, &tracerPid, 10);
+ close(fd);
+ return pid != 0;
+#elif defined(Q_OS_WIN)
+ return IsDebuggerPresent();
+#else
+ // TODO
+ return false;
+#endif
+}
+
static void qInvokeTestMethods(QObject *testObject)
{
const QMetaObject *metaObject = testObject->metaObject();
@@ -2360,6 +2530,10 @@ static void qInvokeTestMethods(QObject *testObject)
QTestTable::globalTestTable();
invokeMethod(testObject, "initTestCase_data()");
+ QScopedPointer<WatchDog> watchDog;
+ if (!debuggerPresent())
+ watchDog.reset(new WatchDog);
+
if (!QTestResult::skipCurrentTest() && !QTest::currentTestFailed()) {
invokeMethod(testObject, "initTestCase()");
@@ -2374,7 +2548,7 @@ static void qInvokeTestMethods(QObject *testObject)
if (QTest::testFuncs) {
for (int i = 0; i != QTest::testFuncCount; i++) {
if (!qInvokeTestMethod(metaObject->method(QTest::testFuncs[i].function()).methodSignature().constData(),
- QTest::testFuncs[i].data())) {
+ QTest::testFuncs[i].data(), watchDog.data())) {
break;
}
}
@@ -2387,7 +2561,7 @@ static void qInvokeTestMethods(QObject *testObject)
for (int i = 0; i != methodCount; i++) {
if (!isValidSlot(testMethods[i]))
continue;
- if (!qInvokeTestMethod(testMethods[i].methodSignature().constData()))
+ if (!qInvokeTestMethod(testMethods[i].methodSignature().constData(), 0, watchDog.data()))
break;
}
delete[] testMethods;
@@ -2423,7 +2597,13 @@ private:
void FatalSignalHandler::signal(int signum)
{
- qFatal("Received signal %d", signum);
+ const int msecsFunctionTime = qRound(QTestLog::msecsFunctionTime());
+ const int msecsTotalTime = qRound(QTestLog::msecsTotalTime());
+ if (signum != SIGINT)
+ stackTrace();
+ qFatal("Received signal %d\n"
+ " Function time: %dms Total time: %dms",
+ signum, msecsFunctionTime, msecsTotalTime);
#if defined(Q_OS_INTEGRITY)
{
struct sigaction act;
@@ -2517,13 +2697,141 @@ FatalSignalHandler::~FatalSignalHandler()
} // namespace
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+
+// Helper class for resolving symbol names by dynamically loading "dbghelp.dll".
+class DebugSymbolResolver
+{
+ Q_DISABLE_COPY(DebugSymbolResolver)
+public:
+ struct Symbol {
+ Symbol() : name(Q_NULLPTR), address(0) {}
+
+ const char *name; // Must be freed by caller.
+ DWORD64 address;
+ };
+
+ explicit DebugSymbolResolver(HANDLE process);
+ ~DebugSymbolResolver() { cleanup(); }
+
+ bool isValid() const { return m_symFromAddr; }
+
+ Symbol resolveSymbol(DWORD64 address) const;
+
+private:
+ // typedefs from DbgHelp.h/.dll
+ struct DBGHELP_SYMBOL_INFO { // SYMBOL_INFO
+ ULONG SizeOfStruct;
+ ULONG TypeIndex; // Type Index of symbol
+ ULONG64 Reserved[2];
+ ULONG Index;
+ ULONG Size;
+ ULONG64 ModBase; // Base Address of module comtaining this symbol
+ ULONG Flags;
+ ULONG64 Value; // Value of symbol, ValuePresent should be 1
+ ULONG64 Address; // Address of symbol including base address of module
+ ULONG Register; // register holding value or pointer to value
+ ULONG Scope; // scope of the symbol
+ ULONG Tag; // pdb classification
+ ULONG NameLen; // Actual length of name
+ ULONG MaxNameLen;
+ CHAR Name[1]; // Name of symbol
+ };
+
+ typedef BOOL (__stdcall *SymInitializeType)(HANDLE, PCSTR, BOOL);
+ typedef BOOL (__stdcall *SymFromAddrType)(HANDLE, DWORD64, PDWORD64, DBGHELP_SYMBOL_INFO *);
+
+ void cleanup();
+
+ const HANDLE m_process;
+ HMODULE m_dbgHelpLib;
+ SymFromAddrType m_symFromAddr;
+};
+
+void DebugSymbolResolver::cleanup()
+{
+ if (m_dbgHelpLib)
+ FreeLibrary(m_dbgHelpLib);
+ m_dbgHelpLib = 0;
+ m_symFromAddr = Q_NULLPTR;
+}
+
+DebugSymbolResolver::DebugSymbolResolver(HANDLE process)
+ : m_process(process), m_dbgHelpLib(0), m_symFromAddr(Q_NULLPTR)
+{
+ bool success = false;
+ m_dbgHelpLib = LoadLibraryW(L"dbghelp.dll");
+ if (m_dbgHelpLib) {
+ SymInitializeType symInitialize = (SymInitializeType)(GetProcAddress(m_dbgHelpLib, "SymInitialize"));
+ m_symFromAddr = (SymFromAddrType)(GetProcAddress(m_dbgHelpLib, "SymFromAddr"));
+ success = symInitialize && m_symFromAddr && symInitialize(process, NULL, TRUE);
+ }
+ if (!success)
+ cleanup();
+}
+
+DebugSymbolResolver::Symbol DebugSymbolResolver::resolveSymbol(DWORD64 address) const
+{
+ // reserve additional buffer where SymFromAddr() will store the name
+ struct NamedSymbolInfo : public DBGHELP_SYMBOL_INFO {
+ enum { symbolNameLength = 255 };
+
+ char name[symbolNameLength + 1];
+ };
+
+ Symbol result;
+ if (!isValid())
+ return result;
+ NamedSymbolInfo symbolBuffer;
+ memset(&symbolBuffer, 0, sizeof(NamedSymbolInfo));
+ symbolBuffer.MaxNameLen = NamedSymbolInfo::symbolNameLength;
+ symbolBuffer.SizeOfStruct = sizeof(DBGHELP_SYMBOL_INFO);
+ if (!m_symFromAddr(m_process, address, 0, &symbolBuffer))
+ return result;
+ result.name = qstrdup(symbolBuffer.Name);
+ result.address = symbolBuffer.Address;
+ return result;
+}
+
static LONG WINAPI windowsFaultHandler(struct _EXCEPTION_POINTERS *exInfo)
{
+ enum { maxStackFrames = 100 };
char appName[MAX_PATH];
if (!GetModuleFileNameA(NULL, appName, MAX_PATH))
appName[0] = 0;
- fprintf(stderr, "A crash occurred in %s (exception code 0x%lx).",
- appName, exInfo->ExceptionRecord->ExceptionCode);
+ const int msecsFunctionTime = qRound(QTestLog::msecsFunctionTime());
+ const int msecsTotalTime = qRound(QTestLog::msecsTotalTime());
+ const void *exceptionAddress = exInfo->ExceptionRecord->ExceptionAddress;
+ printf("A crash occurred in %s.\n"
+ "Function time: %dms Total time: %dms\n\n"
+ "Exception address: 0x%p\n"
+ "Exception code : 0x%lx\n",
+ appName, msecsFunctionTime, msecsTotalTime,
+ exceptionAddress, exInfo->ExceptionRecord->ExceptionCode);
+
+ DebugSymbolResolver resolver(GetCurrentProcess());
+ if (resolver.isValid()) {
+ DebugSymbolResolver::Symbol exceptionSymbol = resolver.resolveSymbol(DWORD64(exceptionAddress));
+ if (exceptionSymbol.name) {
+ printf("Nearby symbol : %s\n", exceptionSymbol.name);
+ delete [] exceptionSymbol.name;
+ }
+ void *stack[maxStackFrames];
+ fputs("\nStack:\n", stdout);
+ const unsigned frameCount = CaptureStackBackTrace(0, DWORD(maxStackFrames), stack, NULL);
+ for (unsigned f = 0; f < frameCount; ++f) {
+ DebugSymbolResolver::Symbol symbol = resolver.resolveSymbol(DWORD64(stack[f]));
+ if (symbol.name) {
+ printf("#%3u: %s() - 0x%p\n", f + 1, symbol.name, (const void *)symbol.address);
+ delete [] symbol.name;
+ } else {
+ printf("#%3u: Unable to obtain symbol\n", f + 1);
+ }
+ }
+ }
+
+ fputc('\n', stdout);
+ fflush(stdout);
+
return EXCEPTION_EXECUTE_HANDLER;
}
#endif // Q_OS_WIN) && !Q_OS_WINCE && !Q_OS_WINRT
@@ -3237,6 +3545,8 @@ TO_STRING_IMPL(quint64, %llu)
#endif
TO_STRING_IMPL(bool, %d)
TO_STRING_IMPL(char, %c)
+TO_STRING_IMPL(signed char, %hhd)
+TO_STRING_IMPL(unsigned char, %hhu)
TO_STRING_IMPL(float, %g)
TO_STRING_IMPL(double, %lg)
@@ -3372,10 +3682,6 @@ bool QTest::compare_string_helper(const char *t1, const char *t2, const char *ac
\internal
*/
-/*! \fn bool QTest::qCompare(bool const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line)
- \internal
- */
-
/*! \fn bool QTest::qTest(const T& actual, const char *elementName, const char *actualStr, const char *expected, const char *file, int line)
\internal
*/
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index f24283b65e..9d79439e04 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -39,6 +39,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qnamespace.h>
#include <QtCore/qmetatype.h>
+#include <QtCore/qmetaobject.h>
#include <QtCore/qtypetraits.h>
#include <QtCore/qsharedpointer.h>
#include <QtCore/qtemporarydir.h>
@@ -157,6 +158,15 @@ do { \
#define QTRY_VERIFY(__expr) QTRY_VERIFY_WITH_TIMEOUT((__expr), 5000)
+// Will try to wait for the expression to become true while allowing event processing
+#define QTRY_VERIFY2_WITH_TIMEOUT(__expr, __messageExpression, __timeout) \
+do { \
+ QTRY_IMPL((__expr), __timeout);\
+ QVERIFY2(__expr, __messageExpression); \
+} while (0)
+
+#define QTRY_VERIFY2(__expr, __messageExpression) QTRY_VERIFY2_WITH_TIMEOUT((__expr), (__messageExpression), 5000)
+
// Will try to wait for the comparison to become successful while allowing event processing
#define QTRY_COMPARE_WITH_TIMEOUT(__expr, __expected, __timeout) \
do { \
@@ -222,12 +232,28 @@ class QTestData;
namespace QTest
{
- template <typename T>
- inline char *toString(const T &)
+ namespace Internal {
+
+ template<typename T> // Output registered enums
+ inline typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value, char*>::Type toString(T e)
+ {
+ QMetaEnum me = QMetaEnum::fromType<T>();
+ return qstrdup(me.key(int(e))); // int cast is necessary to support enum classes
+ }
+
+ template <typename T> // Fallback
+ inline typename QtPrivate::QEnableIf<!QtPrivate::IsQEnumHelper<T>::Value, char*>::Type toString(const T &)
{
- return 0;
+ return Q_NULLPTR;
}
+ } // namespace Internal
+
+ template<typename T>
+ inline char *toString(const T &t)
+ {
+ return Internal::toString(t);
+ }
Q_TESTLIB_EXPORT char *toHexRepresentation(const char *ba, int length);
Q_TESTLIB_EXPORT char *toPrettyCString(const char *unicode, int length);
@@ -235,10 +261,10 @@ namespace QTest
Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const void *);
- Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = 0);
+ Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
Q_TESTLIB_EXPORT int qExec(QObject *testObject, const QStringList &arguments);
- Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir = 0);
+ Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir = Q_NULLPTR);
Q_TESTLIB_EXPORT bool qVerify(bool statement, const char *statementStr, const char *description,
const char *file, int line);
@@ -246,15 +272,15 @@ namespace QTest
Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line);
Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode,
const char *file, int line);
- Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = 0, int line = 0);
+ Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = Q_NULLPTR, int line = 0);
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message);
#ifndef QT_NO_REGULAREXPRESSION
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
#endif
Q_TESTLIB_EXPORT QSharedPointer<QTemporaryDir> qExtractTestData(const QString &dirName);
- Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = 0, int line = 0, const char* builddir = 0);
- Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = 0, int line = 0, const char* builddir = 0);
+ Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
+ Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
Q_TESTLIB_EXPORT void *qData(const char *tagName, int typeId);
Q_TESTLIB_EXPORT void *qGlobalData(const char *tagName, int typeId);
@@ -323,6 +349,8 @@ namespace QTest
QTEST_COMPARE_DECL(float)
QTEST_COMPARE_DECL(double)
QTEST_COMPARE_DECL(char)
+ QTEST_COMPARE_DECL(signed char)
+ QTEST_COMPARE_DECL(unsigned char)
QTEST_COMPARE_DECL(bool)
#endif
@@ -392,14 +420,6 @@ namespace QTest
return compare_string_helper(t1, t2, actual, expected, file, line);
}
- // NokiaX86 and RVCT do not like implicitly comparing bool with int
- inline bool qCompare(bool const &t1, int const &t2,
- const char *actual, const char *expected, const char *file, int line)
- {
- return qCompare(int(t1), t2, actual, expected, file, line);
- }
-
-
template <class T>
inline bool qTest(const T& actual, const char *elementName, const char *actualStr,
const char *expected, const char *file, int line)
diff --git a/src/testlib/qtestevent.h b/src/testlib/qtestevent.h
index a3e5f02ec1..9794b15f4a 100644
--- a/src/testlib/qtestevent.h
+++ b/src/testlib/qtestevent.h
@@ -185,20 +185,20 @@ public:
inline void addKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
{ append(new QTestKeyEvent(action, ascii, modifiers, msecs)); }
- inline void addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ append(new QTestMouseEvent(QTest::MousePress, button, stateKey, pos, delay)); }
- inline void addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ append(new QTestMouseEvent(QTest::MouseRelease, button, stateKey, pos, delay)); }
- inline void addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ append(new QTestMouseEvent(QTest::MouseClick, button, stateKey, pos, delay)); }
- inline void addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ append(new QTestMouseEvent(QTest::MouseDClick, button, stateKey, pos, delay)); }
inline void addMouseMove(QPoint pos = QPoint(), int delay=-1)
- { append(new QTestMouseEvent(QTest::MouseMove, Qt::NoButton, 0, pos, delay)); }
+ { append(new QTestMouseEvent(QTest::MouseMove, Qt::NoButton, Qt::KeyboardModifiers(), pos, delay)); }
#endif //QT_GUI_LIB
inline void addDelay(int msecs)
diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h
index a9f611f306..a8ce619d4e 100644
--- a/src/testlib/qtesteventloop.h
+++ b/src/testlib/qtesteventloop.h
@@ -50,8 +50,8 @@ class Q_TESTLIB_EXPORT QTestEventLoop : public QObject
Q_OBJECT
public:
- inline QTestEventLoop(QObject *aParent = 0)
- : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(0) {}
+ inline QTestEventLoop(QObject *aParent = Q_NULLPTR)
+ : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(Q_NULLPTR) {}
inline void enterLoopMSecs(int ms);
inline void enterLoop(int secs) { enterLoopMSecs(secs * 1000); }
@@ -97,7 +97,7 @@ inline void QTestEventLoop::enterLoopMSecs(int ms)
loop = &l;
l.exec();
- loop = 0;
+ loop = Q_NULLPTR;
}
inline void QTestEventLoop::exitLoop()
diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h
index 39520d621f..d2b3ef240b 100644
--- a/src/testlib/qtestkeyboard.h
+++ b/src/testlib/qtestkeyboard.h
@@ -57,11 +57,11 @@
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT void qt_handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
-Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString &text = QString(), bool autorep = false, ushort count = 1);
+Q_GUI_EXPORT bool qt_handleShortcutEvent(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString &text = QString(), bool autorep = false, ushort count = 1);
namespace QTest
{
- enum KeyAction { Press, Release, Click };
+ enum KeyAction { Press, Release, Click, Shortcut };
static void simulateEvent(QWindow *window, bool press, int code,
Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1)
@@ -95,9 +95,15 @@ namespace QTest
bool repeat = false;
+ if (action == Shortcut) {
+ int timestamp = 0;
+ qt_handleShortcutEvent(window, timestamp, code, modifier, text, repeat);
+ return;
+ }
+
if (action == Press) {
if (modifier & Qt::ShiftModifier)
- simulateEvent(window, true, Qt::Key_Shift, 0, QString(), false, delay);
+ simulateEvent(window, true, Qt::Key_Shift, Qt::KeyboardModifiers(), QString(), false, delay);
if (modifier & Qt::ControlModifier)
simulateEvent(window, true, Qt::Key_Control, modifier & Qt::ShiftModifier, QString(), false, delay);
@@ -172,7 +178,7 @@ namespace QTest
QKeyEvent a(press ? QEvent::KeyPress : QEvent::KeyRelease, code, modifier, text, repeat);
QSpontaneKeyEvent::setSpontaneous(&a);
- if (press && qt_sendShortcutOverrideEvent(widget, a.timestamp(), code, modifier, text, repeat))
+ if (press && qt_handleShortcutEvent(widget, a.timestamp(), code, modifier, text, repeat))
return;
if (!qApp->notify(widget, &a))
QTest::qWarn("Keyboard event not accepted by receiving widget");
@@ -220,7 +226,7 @@ namespace QTest
if (action == Press) {
if (modifier & Qt::ShiftModifier)
- simulateEvent(widget, true, Qt::Key_Shift, 0, QString(), false, delay);
+ simulateEvent(widget, true, Qt::Key_Shift, Qt::KeyboardModifiers(), QString(), false, delay);
if (modifier & Qt::ControlModifier)
simulateEvent(widget, true, Qt::Key_Control, modifier & Qt::ShiftModifier, QString(), false, delay);
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 59aeb27ffe..3513e10eec 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -46,6 +46,7 @@
#include <QtCore/qatomic.h>
#include <QtCore/qbytearray.h>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QVariant>
#include <QtCore/QRegularExpression>
@@ -75,6 +76,9 @@ static void saveCoverageTool(const char * appname, bool testfailed, bool install
#endif
}
+static QElapsedTimer elapsedFunctionTime;
+static QElapsedTimer elapsedTotalTime;
+
namespace QTest {
int fails = 0;
@@ -325,6 +329,7 @@ namespace QTest {
void QTestLog::enterTestFunction(const char* function)
{
+ elapsedFunctionTime.restart();
if (printAvailableTags)
return;
@@ -450,6 +455,8 @@ void QTestLog::addBenchmarkResult(const QBenchmarkResult &result)
void QTestLog::startLogging()
{
+ elapsedTotalTime.start();
+ elapsedFunctionTime.start();
QTest::TestLoggers::startLogging();
QTest::oldMessageHandler = qInstallMessageHandler(QTest::messageHandler);
}
@@ -597,4 +604,14 @@ bool QTestLog::installedTestCoverage()
return QTest::installedTestCoverage;
}
+qint64 QTestLog::nsecsTotalTime()
+{
+ return elapsedTotalTime.nsecsElapsed();
+}
+
+qint64 QTestLog::nsecsFunctionTime()
+{
+ return elapsedFunctionTime.nsecsElapsed();
+}
+
QT_END_NAMESPACE
diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h
index b4786b4904..b7e9d16ec3 100644
--- a/src/testlib/qtestlog_p.h
+++ b/src/testlib/qtestlog_p.h
@@ -110,6 +110,11 @@ public:
static void setInstalledTestCoverage(bool installed);
static bool installedTestCoverage();
+ static qint64 nsecsTotalTime();
+ static qreal msecsTotalTime() { return QTestLog::nsecsTotalTime() / 1000000.; }
+ static qint64 nsecsFunctionTime();
+ static qreal msecsFunctionTime() { return QTestLog::nsecsFunctionTime() / 1000000.; }
+
private:
QTestLog();
~QTestLog();
diff --git a/src/testlib/qtestmouse.cpp b/src/testlib/qtestmouse.cpp
new file mode 100644
index 0000000000..99a75744fa
--- /dev/null
+++ b/src/testlib/qtestmouse.cpp
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtTest module 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 <QtCore/QtGlobal>
+#include <QtCore/qnamespace.h>
+#include <QtTest/qtest_global.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QTest {
+
+Q_TESTLIB_EXPORT Qt::MouseButton lastMouseButton = Qt::NoButton;
+Q_TESTLIB_EXPORT int lastMouseTimestamp = 0;
+
+} // namespace QTest
+
+QT_END_NAMESPACE
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index ad6671af02..c5969a1603 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -45,6 +45,7 @@
#include <QtTest/qtestspontaneevent.h>
#include <QtCore/qpoint.h>
#include <QtCore/qstring.h>
+#include <QtCore/qpointer.h>
#include <QtGui/qevent.h>
#include <QtGui/qwindow.h>
@@ -57,12 +58,15 @@
QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier);
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods, int timestamp);
namespace QTest
{
enum MouseAction { MousePress, MouseRelease, MouseClick, MouseDClick, MouseMove };
+ extern Q_TESTLIB_EXPORT Qt::MouseButton lastMouseButton;
+ extern Q_TESTLIB_EXPORT int lastMouseTimestamp;
+
static void waitForEvents()
{
#ifdef Q_OS_MAC
@@ -83,76 +87,85 @@ namespace QTest
QTest::qWarn("Mouse event occurs outside of target window.");
}
- static Qt::MouseButton lastButton = Qt::NoButton;
-
if (delay == -1 || delay < defaultMouseDelay())
delay = defaultMouseDelay();
- if (delay > 0)
+ if (delay > 0) {
QTest::qWait(delay);
+ lastMouseTimestamp += delay;
+ }
if (pos.isNull())
- pos = window->geometry().center();
+ pos = QPoint(window->width() / 2, window->height() / 2);
- if (action == MouseClick) {
- mouseEvent(MousePress, window, button, stateKey, pos);
- mouseEvent(MouseRelease, window, button, stateKey, pos);
- return;
- }
QTEST_ASSERT(uint(stateKey) == 0 || stateKey & Qt::KeyboardModifierMask);
stateKey &= static_cast<unsigned int>(Qt::KeyboardModifierMask);
+ QPointF global = window->mapToGlobal(pos);
+ QPointer<QWindow> w(window);
switch (action)
{
- case MousePress:
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
- lastButton = button;
- break;
- case MouseRelease:
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
- lastButton = Qt::NoButton;
- break;
- case MouseDClick:
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
- qWait(10);
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
- qWait(20);
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
- qWait(10);
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
- break;
- case MouseMove:
- qt_handleMouseEvent(window,pos,window->mapToGlobal(pos),lastButton,stateKey);
- // No QCursor::setPos() call here. That could potentially result in mouse events sent by the windowing system
- // which is highly undesired here. Tests must avoid relying on QCursor.
+ case MouseDClick:
+ qt_handleMouseEvent(w, pos, global, button, stateKey, ++lastMouseTimestamp);
+ qt_handleMouseEvent(w, pos, global, Qt::NoButton, stateKey, ++lastMouseTimestamp);
+ // fall through
+ case MousePress:
+ case MouseClick:
+ qt_handleMouseEvent(w, pos, global, button, stateKey, ++lastMouseTimestamp);
+ lastMouseButton = button;
+ if (action == MousePress)
break;
- default:
- QTEST_ASSERT(false);
+ // fall through
+ case MouseRelease:
+ qt_handleMouseEvent(w, pos, global, Qt::NoButton, stateKey, ++lastMouseTimestamp);
+ lastMouseTimestamp += 500; // avoid double clicks being generated
+ lastMouseButton = Qt::NoButton;
+ break;
+ case MouseMove:
+ qt_handleMouseEvent(w, pos, global, lastMouseButton, stateKey, ++lastMouseTimestamp);
+ // No QCursor::setPos() call here. That could potentially result in mouse events sent by the windowing system
+ // which is highly undesired here. Tests must avoid relying on QCursor.
+ break;
+ default:
+ QTEST_ASSERT(false);
}
waitForEvents();
}
- inline void mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mousePress(QWindow *window, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MousePress, window, button, stateKey, pos, delay); }
- inline void mouseRelease(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mouseRelease(QWindow *window, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MouseRelease, window, button, stateKey, pos, delay); }
- inline void mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mouseClick(QWindow *window, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MouseClick, window, button, stateKey, pos, delay); }
- inline void mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mouseDClick(QWindow *window, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MouseDClick, window, button, stateKey, pos, delay); }
inline void mouseMove(QWindow *window, QPoint pos = QPoint(), int delay=-1)
- { mouseEvent(MouseMove, window, Qt::NoButton, 0, pos, delay); }
+ { mouseEvent(MouseMove, window, Qt::NoButton, Qt::KeyboardModifiers(), pos, delay); }
#ifdef QT_WIDGETS_LIB
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button,
Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
{
QTEST_ASSERT(widget);
+
+ if (pos.isNull())
+ pos = widget->rect().center();
+
+#ifdef QTEST_QPA_MOUSE_HANDLING
+ QWindow *w = widget->window()->windowHandle();
+ QTEST_ASSERT(w);
+ mouseEvent(action, w, button, stateKey, w->mapFromGlobal(widget->mapToGlobal(pos)), delay);
+#else
extern int Q_TESTLIB_EXPORT defaultMouseDelay();
if (delay == -1 || delay < defaultMouseDelay())
@@ -160,9 +173,6 @@ namespace QTest
if (delay > 0)
QTest::qWait(delay);
- if (pos.isNull())
- pos = widget->rect().center();
-
if (action == MouseClick) {
mouseEvent(MousePress, widget, button, stateKey, pos);
mouseEvent(MouseRelease, widget, button, stateKey, pos);
@@ -180,7 +190,7 @@ namespace QTest
me = QMouseEvent(QEvent::MouseButtonPress, pos, widget->mapToGlobal(pos), button, button, stateKey);
break;
case MouseRelease:
- me = QMouseEvent(QEvent::MouseButtonRelease, pos, widget->mapToGlobal(pos), button, 0, stateKey);
+ me = QMouseEvent(QEvent::MouseButtonRelease, pos, widget->mapToGlobal(pos), button, Qt::MouseButton(), stateKey);
break;
case MouseDClick:
me = QMouseEvent(QEvent::MouseButtonDblClick, pos, widget->mapToGlobal(pos), button, button, stateKey);
@@ -203,23 +213,27 @@ namespace QTest
QString warning = QString::fromLatin1("Mouse event \"%1\" not accepted by receiving widget");
QTest::qWarn(warning.arg(QString::fromLatin1(mouseActionNames[static_cast<int>(action)])).toLatin1().data());
}
-
+#endif
}
- inline void mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mousePress(QWidget *widget, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MousePress, widget, button, stateKey, pos, delay); }
- inline void mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mouseRelease(QWidget *widget, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MouseRelease, widget, button, stateKey, pos, delay); }
- inline void mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mouseClick(QWidget *widget, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MouseClick, widget, button, stateKey, pos, delay); }
- inline void mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
+ inline void mouseDClick(QWidget *widget, Qt::MouseButton button,
+ Qt::KeyboardModifiers stateKey = Qt::KeyboardModifiers(),
QPoint pos = QPoint(), int delay=-1)
{ mouseEvent(MouseDClick, widget, button, stateKey, pos, delay); }
inline void mouseMove(QWidget *widget, QPoint pos = QPoint(), int delay=-1)
- { mouseEvent(MouseMove, widget, Qt::NoButton, 0, pos, delay); }
+ { mouseEvent(MouseMove, widget, Qt::NoButton, Qt::KeyboardModifiers(), pos, delay); }
#endif // QT_WIDGETS_LIB
}
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index c65927ba7c..24689c6e87 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -235,17 +235,17 @@ bool QTestResult::verify(bool statement, const char *statementStr,
{
QTEST_ASSERT(statementStr);
- char msg[1024];
+ char msg[1024] = {'\0'};
if (QTestLog::verboseLevel() >= 2) {
qsnprintf(msg, 1024, "QVERIFY(%s)", statementStr);
QTestLog::info(msg, file, line);
}
- const char * format = QTest::expectFailMode
- ? "'%s' returned TRUE unexpectedly. (%s)"
- : "'%s' returned FALSE. (%s)";
- qsnprintf(msg, 1024, format, statementStr, description ? description : "");
+ if (!statement && !QTest::expectFailMode)
+ qsnprintf(msg, 1024, "'%s' returned FALSE. (%s)", statementStr, description ? description : "");
+ else if (statement && QTest::expectFailMode)
+ qsnprintf(msg, 1024, "'%s' returned TRUE unexpectedly. (%s)", statementStr, description ? description : "");
return checkStatement(statement, msg, file, line);
}
@@ -259,7 +259,7 @@ bool QTestResult::compare(bool success, const char *failureMsg,
QTEST_ASSERT(actual);
const size_t maxMsgLen = 1024;
- char msg[maxMsgLen];
+ char msg[maxMsgLen] = {'\0'};
if (QTestLog::verboseLevel() >= 2) {
qsnprintf(msg, maxMsgLen, "QCOMPARE(%s, %s)", actual, expected);
@@ -269,9 +269,11 @@ bool QTestResult::compare(bool success, const char *failureMsg,
if (!failureMsg)
failureMsg = "Compared values are not the same";
- if (success && QTest::expectFailMode) {
- qsnprintf(msg, maxMsgLen,
- "QCOMPARE(%s, %s) returned TRUE unexpectedly.", actual, expected);
+ if (success) {
+ if (QTest::expectFailMode) {
+ qsnprintf(msg, maxMsgLen,
+ "QCOMPARE(%s, %s) returned TRUE unexpectedly.", actual, expected);
+ }
} else if (val1 || val2) {
size_t len1 = mbstowcs(NULL, actual, maxMsgLen); // Last parameter is not ignored on QNX
size_t len2 = mbstowcs(NULL, expected, maxMsgLen); // (result is never larger than this).
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h
index 50acc6136d..f81ede519c 100644
--- a/src/testlib/qtestsystem.h
+++ b/src/testlib/qtestsystem.h
@@ -56,7 +56,7 @@ namespace QTest
timer.start();
do {
QCoreApplication::processEvents(QEventLoop::AllEvents, ms);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
QTest::qSleep(10);
} while (timer.elapsed() < ms);
}
@@ -71,7 +71,7 @@ namespace QTest
if (remaining <= 0)
break;
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
QTest::qSleep(10);
}
// Try ensuring the platform window receives the real position.
@@ -100,7 +100,7 @@ namespace QTest
if (remaining <= 0)
break;
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
QTest::qSleep(10);
}
return window->isExposed();
diff --git a/src/testlib/qtesttable.cpp b/src/testlib/qtesttable.cpp
index 497b2649c5..05cce37a47 100644
--- a/src/testlib/qtesttable.cpp
+++ b/src/testlib/qtesttable.cpp
@@ -38,37 +38,35 @@
#include <QtCore/qmetaobject.h>
#include <string.h>
+#include <vector>
+#include <algorithm>
QT_BEGIN_NAMESPACE
class QTestTablePrivate
{
public:
- struct ElementList
+ ~QTestTablePrivate()
{
- ElementList(): elementName(0), elementType(0), next(0) {}
- const char *elementName;
- int elementType;
- ElementList *next;
- };
+ qDeleteAll(dataList.begin(), dataList.end());
+ }
- struct DataList
- {
- DataList(): data(0), next(0) {}
- QTestData *data;
- DataList *next;
+ struct Element {
+ Element() : name(Q_NULLPTR), type(0) {}
+ Element(const char *n, int t) : name(n), type(t) {}
+
+ const char *name;
+ int type;
};
- QTestTablePrivate(): list(0), dataList(0) {}
- ~QTestTablePrivate();
+ typedef std::vector<Element> ElementList;
+ ElementList elementList;
- ElementList *list;
- DataList *dataList;
+ typedef std::vector<QTestData *> DataList;
+ DataList dataList;
- void addColumn(int elemType, const char *elemName);
- void addRow(QTestData *data);
- ElementList *elementAt(int index);
- QTestData *dataAt(int index);
+ void addColumn(int elemType, const char *elemName) { elementList.push_back(Element(elemName, elemType)); }
+ void addRow(QTestData *data) { dataList.push_back(data); }
static QTestTable *currentTestTable;
static QTestTable *gTable;
@@ -77,74 +75,6 @@ public:
QTestTable *QTestTablePrivate::currentTestTable = 0;
QTestTable *QTestTablePrivate::gTable = 0;
-QTestTablePrivate::ElementList *QTestTablePrivate::elementAt(int index)
-{
- ElementList *iter = list;
- for (int i = 0; i < index; ++i) {
- if (!iter)
- return 0;
- iter = iter->next;
- }
- return iter;
-}
-
-QTestData *QTestTablePrivate::dataAt(int index)
-{
- DataList *iter = dataList;
- for (int i = 0; i < index; ++i) {
- if (!iter)
- return 0;
- iter = iter->next;
- }
- return iter ? iter->data : 0;
-}
-
-QTestTablePrivate::~QTestTablePrivate()
-{
- DataList *dit = dataList;
- while (dit) {
- DataList *next = dit->next;
- delete dit->data;
- delete dit;
- dit = next;
- }
- ElementList *iter = list;
- while (iter) {
- ElementList *next = iter->next;
- delete iter;
- iter = next;
- }
-}
-
-void QTestTablePrivate::addColumn(int elemType, const char *elemName)
-{
- ElementList *item = new ElementList;
- item->elementName = elemName;
- item->elementType = elemType;
- if (!list) {
- list = item;
- return;
- }
- ElementList *last = list;
- while (last->next != 0)
- last = last->next;
- last->next = item;
-}
-
-void QTestTablePrivate::addRow(QTestData *data)
-{
- DataList *item = new DataList;
- item->data = data;
- if (!dataList) {
- dataList = item;
- return;
- }
- DataList *last = dataList;
- while (last->next != 0)
- last = last->next;
- last->next = item;
-}
-
void QTestTable::addColumn(int type, const char *name)
{
QTEST_ASSERT(type);
@@ -155,30 +85,17 @@ void QTestTable::addColumn(int type, const char *name)
int QTestTable::elementCount() const
{
- QTestTablePrivate::ElementList *item = d->list;
- int count = 0;
- while (item) {
- ++count;
- item = item->next;
- }
- return count;
+ return int(d->elementList.size());
}
-
int QTestTable::dataCount() const
{
- QTestTablePrivate::DataList *item = d->dataList;
- int count = 0;
- while (item) {
- ++count;
- item = item->next;
- }
- return count;
+ return int(d->dataList.size());
}
bool QTestTable::isEmpty() const
{
- return !d->list;
+ return d->elementList.empty();
}
QTestData *QTestTable::newData(const char *tag)
@@ -202,38 +119,43 @@ QTestTable::~QTestTable()
int QTestTable::elementTypeId(int index) const
{
- QTestTablePrivate::ElementList *item = d->elementAt(index);
- if (!item)
- return -1;
- return item->elementType;
+ return size_t(index) < d->elementList.size() ? d->elementList[index].type : -1;
}
const char *QTestTable::dataTag(int index) const
{
- QTestTablePrivate::ElementList *item = d->elementAt(index);
- if (!item)
- return 0;
- return item->elementName;
+ return size_t(index) < d->elementList.size() ? d->elementList[index].name : Q_NULLPTR;
}
QTestData *QTestTable::testData(int index) const
{
- return d->dataAt(index);
+ return size_t(index) < d->dataList.size() ? d->dataList[index] : Q_NULLPTR;
}
+class NamePredicate : public std::unary_function<QTestTablePrivate::Element, bool>
+{
+public:
+ explicit NamePredicate(const char *needle) : m_needle(needle) {}
+
+ bool operator()(const QTestTablePrivate::Element &e) const
+ { return !strcmp(e.name, m_needle); }
+
+private:
+ const char *m_needle;
+};
+
int QTestTable::indexOf(const char *elementName) const
{
+ typedef QTestTablePrivate::ElementList::const_iterator It;
+
QTEST_ASSERT(elementName);
- QTestTablePrivate::ElementList *item = d->list;
- int i = 0;
- while (item) {
- if (strcmp(elementName, item->elementName) == 0)
- return i;
- item = item->next;
- ++i;
- }
- return -1;
+ const QTestTablePrivate::ElementList &elementList = d->elementList;
+
+ const It it = std::find_if(elementList.begin(), elementList.end(),
+ NamePredicate(elementName));
+ return it != elementList.end() ?
+ int(it - elementList.begin()) : -1;
}
QTestTable *QTestTable::globalTestTable()
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index 5dcdca808b..8e782d17d7 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -68,21 +68,21 @@ namespace QTest
if (commitWhenDestroyed)
commit();
}
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = 0)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = 0)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = 0)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
@@ -97,21 +97,21 @@ namespace QTest
}
#ifdef QT_WIDGETS_LIB
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = 0)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = 0)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = 0)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
@@ -143,14 +143,14 @@ namespace QTest
private:
#ifdef QT_WIDGETS_LIB
QTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit)
- : targetWidget(widget), targetWindow(0), device(aDevice), commitWhenDestroyed(autoCommit)
+ : targetWidget(widget), targetWindow(Q_NULLPTR), device(aDevice), commitWhenDestroyed(autoCommit)
{
}
#endif
QTouchEventSequence(QWindow *window, QTouchDevice *aDevice, bool autoCommit)
:
#ifdef QT_WIDGETS_LIB
- targetWidget(0),
+ targetWidget(Q_NULLPTR),
#endif
targetWindow(window), device(aDevice), commitWhenDestroyed(autoCommit)
{
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index bf607b4702..f96b5647e4 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -36,6 +36,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qlibraryinfo.h>
+#include <QtTest/private/qtestlog_p.h>
#include <QtTest/private/qxmltestlogger_p.h>
#include <QtTest/private/qtestresult_p.h>
#include <QtTest/private/qbenchmark_p.h>
@@ -124,15 +125,13 @@ void QXmlTestLogger::startLogging()
" <QTestVersion>" QTEST_VERSION_STR "</QTestVersion>\n"
"</Environment>\n", qVersion(), quotedBuild.constData());
outputString(buf.constData());
- m_totalTime.start();
}
void QXmlTestLogger::stopLogging()
{
QTestCharBuffer buf;
QTest::qt_asprintf(&buf,
- "<Duration msecs=\"%f\"/>\n",
- m_totalTime.nsecsElapsed() / 1000000.);
+ "<Duration msecs=\"%f\"/>\n", QTestLog::msecsTotalTime());
outputString(buf.constData());
if (xmlmode == QXmlTestLogger::Complete) {
outputString("</TestCase>\n");
@@ -148,8 +147,6 @@ void QXmlTestLogger::enterTestFunction(const char *function)
xmlQuote(&quotedFunction, function);
QTest::qt_asprintf(&buf, "<TestFunction name=\"%s\">\n", quotedFunction.constData());
outputString(buf.constData());
-
- m_functionTime.start();
}
void QXmlTestLogger::leaveTestFunction()
@@ -158,7 +155,7 @@ void QXmlTestLogger::leaveTestFunction()
QTest::qt_asprintf(&buf,
" <Duration msecs=\"%f\"/>\n"
"</TestFunction>\n",
- m_functionTime.nsecsElapsed() / 1000000.);
+ QTestLog::msecsFunctionTime());
outputString(buf.constData());
}
diff --git a/src/testlib/qxmltestlogger_p.h b/src/testlib/qxmltestlogger_p.h
index 5cf8b4596c..49a21d9ca1 100644
--- a/src/testlib/qxmltestlogger_p.h
+++ b/src/testlib/qxmltestlogger_p.h
@@ -47,7 +47,6 @@
#include <QtTest/private/qabstracttestlogger_p.h>
-#include <QtCore/qelapsedtimer.h>
QT_BEGIN_NAMESPACE
@@ -79,8 +78,6 @@ public:
private:
XmlMode xmlmode;
- QElapsedTimer m_functionTime;
- QElapsedTimer m_totalTime;
};
QT_END_NAMESPACE
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index 79fd342cca..ff4379f85d 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -56,6 +56,7 @@ SOURCES = qtestcase.cpp \
qcsvbenchmarklogger.cpp \
qtestelement.cpp \
qtestelementattribute.cpp \
+ qtestmouse.cpp \
qtestxunitstreamer.cpp \
qxunittestlogger.cpp \
qtestblacklist.cpp
@@ -91,7 +92,7 @@ mac {
# don't know yet if the target that links to testlib will build under Xcode or not.
# The corresponding flags for the target lives in xctest.prf, where we do know.
QMAKE_LFLAGS += -F$${platform_dev_frameworks_path} -weak_framework XCTest
- QMAKE_OBJECTIVE_CFLAGS += -F$${platform_dev_frameworks_path}
+ QMAKE_CXXFLAGS += -F$${platform_dev_frameworks_path}
MODULE_CONFIG += xctest
}
}
diff --git a/src/tools/bootstrap-dbus/bootstrap-dbus.pro b/src/tools/bootstrap-dbus/bootstrap-dbus.pro
index fb06b4d8a2..4c466ba0e9 100644
--- a/src/tools/bootstrap-dbus/bootstrap-dbus.pro
+++ b/src/tools/bootstrap-dbus/bootstrap-dbus.pro
@@ -2,16 +2,12 @@ option(host_build)
MODULE = bootstrap_dbus
TARGET = QtBootstrapDBus
-CONFIG += no_module_headers internal_module force_bootstrap
+CONFIG += minimal_syncqt internal_module force_bootstrap
DEFINES += \
QT_NO_CAST_FROM_ASCII
-MODULE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE/QtDBus
-MODULE_PRIVATE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION \
- \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION/QtDBus
+MODULE_INCNAME = QtDBus
load(qt_module)
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index a92e5b8f3d..4f2456cf79 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -2,11 +2,9 @@ option(host_build)
TARGET = QtBootstrap
QT =
-CONFIG += internal_module force_bootstrap
-
-# otherwise mingw headers do not declare common functions like putenv
-mingw:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
+CONFIG += minimal_syncqt internal_module force_bootstrap
+MODULE_INCNAME = QtCore QtXml
MODULE_DEFINES = \
QT_BOOTSTRAPPED \
QT_LITE_UNICODE \
@@ -29,26 +27,11 @@ DEFINES += \
DEFINES -= QT_EVAL
-MODULE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE \
- \$\$QT_MODULE_INCLUDE_BASE/QtCore \
- \$\$QT_MODULE_INCLUDE_BASE/QtXml
-MODULE_PRIVATE_INCLUDES = \
- \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION \
- \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION/QtCore \
- \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION \
- \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION/QtXml
-
-# We need the forwarding headers before their respective modules are built,
-# so do a minimal syncqt run.
-CONFIG += minimal_syncqt
-QMAKE_SYNCQT_OPTIONS = -module QtCore -module QtDBus -module QtXml
-contains(QT_CONFIG, zlib): \
- QMAKE_SYNCQT_OPTIONS += -module QtZlib
-QMAKE_SYNCQT_OPTIONS += -version $$QT_VERSION
-
load(qt_module)
+# otherwise mingw headers do not declare common functions like putenv
+mingw: CONFIG -= strict_c++
+
SOURCES += \
../../corelib/codecs/qlatincodec.cpp \
../../corelib/codecs/qtextcodec.cpp \
@@ -97,11 +80,13 @@ SOURCES += \
../../corelib/tools/qlocale_tools.cpp \
../../corelib/tools/qmap.cpp \
../../corelib/tools/qregexp.cpp \
+ ../../corelib/tools/qringbuffer.cpp \
../../corelib/tools/qpoint.cpp \
../../corelib/tools/qrect.cpp \
../../corelib/tools/qsize.cpp \
../../corelib/tools/qline.cpp \
../../corelib/tools/qstring.cpp \
+ ../../corelib/tools/qstringbuilder.cpp \
../../corelib/tools/qstring_compat.cpp \
../../corelib/tools/qstringlist.cpp \
../../corelib/tools/qvector.cpp \
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 7300429fe0..726d1972f1 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1060,6 +1060,7 @@ void Moc::createPropertyDef(PropertyDef &propDef)
QByteArray v, v2;
if (test(LPAREN)) {
v = lexemUntil(RPAREN);
+ v = v.mid(1, v.length() - 2); // removes the '(' and ')'
} else if (test(INTEGER_LITERAL)) {
v = lexem();
if (l != "REVISION")
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index f253c49995..a2a1a958cf 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -529,7 +529,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
return symbols;
}
-Symbols Preprocessor::macroExpand(Preprocessor *that, Symbols &toExpand, int &index,
+void Preprocessor::macroExpand(Symbols *into, Preprocessor *that, const Symbols &toExpand, int &index,
int lineNum, bool one, const QSet<QByteArray> &excludeSymbols)
{
SymbolStack symbols;
@@ -539,16 +539,18 @@ Symbols Preprocessor::macroExpand(Preprocessor *that, Symbols &toExpand, int &in
sf.excludedSymbols = excludeSymbols;
symbols.push(sf);
- Symbols result;
if (toExpand.isEmpty())
- return result;
+ return;
for (;;) {
QByteArray macro;
Symbols newSyms = macroExpandIdentifier(that, symbols, lineNum, &macro);
if (macro.isEmpty()) {
- result += newSyms;
+ // not a macro
+ Symbol s = symbols.symbol();
+ s.lineNum = lineNum;
+ *into += s;
} else {
SafeSymbols sf;
sf.symbols = newSyms;
@@ -565,8 +567,6 @@ Symbols Preprocessor::macroExpand(Preprocessor *that, Symbols &toExpand, int &in
index = symbols.top().index;
else
index = toExpand.size();
-
- return result;
}
@@ -576,10 +576,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym
// not a macro
if (s.token != PP_IDENTIFIER || !that->macros.contains(s) || symbols.dontReplaceSymbol(s.lexem())) {
- Symbols syms;
- syms += s;
- syms.last().lineNum = lineNum;
- return syms;
+ return Symbols();
}
const Macro &macro = that->macros.value(s);
@@ -600,7 +597,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym
syms.last().lineNum = lineNum;
return syms;
}
- QList<Symbols> arguments;
+ QVarLengthArray<Symbols, 5> arguments;
while (symbols.hasNext()) {
Symbols argument;
// strip leading space
@@ -653,7 +650,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym
if (i == macro.symbols.size() - 1 || macro.symbols.at(i + 1).token != PP_HASHHASH) {
Symbols arg = arguments.at(index);
int idx = 1;
- expansion += macroExpand(that, arg, idx, lineNum, false, symbols.excludeSymbols());
+ macroExpand(&expansion, that, arg, idx, lineNum, false, symbols.excludeSymbols());
} else {
expansion += arguments.at(index);
}
@@ -661,9 +658,12 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym
expansion += s;
}
} else if (mode == Hash) {
- if (index < 0 || index >= arguments.size()) {
+ if (index < 0) {
that->error("'#' is not followed by a macro parameter");
continue;
+ } else if (index >= arguments.size()) {
+ that->error("Macro invoked with too few parameters for a use of '#'");
+ continue;
}
const Symbols &arg = arguments.at(index);
@@ -726,7 +726,7 @@ void Preprocessor::substituteUntilNewline(Symbols &substituted)
while (hasNext()) {
Token token = next();
if (token == PP_IDENTIFIER) {
- substituted += macroExpand(this, symbols, index, symbol().lineNum, true);
+ macroExpand(&substituted, this, symbols, index, symbol().lineNum, true);
} else if (token == PP_DEFINED) {
bool braces = test(PP_LPAREN);
next(PP_IDENTIFIER);
@@ -1148,7 +1148,7 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
}
case PP_IDENTIFIER: {
// substitute macros
- preprocessed += macroExpand(this, symbols, index, symbol().lineNum, true);
+ macroExpand(&preprocessed, this, symbols, index, symbol().lineNum, true);
continue;
}
case PP_HASH:
diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h
index 28691d316b..9c81f86f9c 100644
--- a/src/tools/moc/preprocessor.h
+++ b/src/tools/moc/preprocessor.h
@@ -76,7 +76,7 @@ public:
void substituteUntilNewline(Symbols &substituted);
static Symbols macroExpandIdentifier(Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName);
- static Symbols macroExpand(Preprocessor *that, Symbols &toExpand, int &index, int lineNum, bool one,
+ static void macroExpand(Symbols *into, Preprocessor *that, const Symbols &toExpand, int &index, int lineNum, bool one,
const QSet<QByteArray> &excludeSymbols = QSet<QByteArray>());
int evaluateCondition();
diff --git a/src/tools/moc/symbols.h b/src/tools/moc/symbols.h
index 13f9ada606..5f442e75ed 100644
--- a/src/tools/moc/symbols.h
+++ b/src/tools/moc/symbols.h
@@ -113,8 +113,11 @@ struct Symbol
Token token;
inline QByteArray lexem() const { return lex.mid(from, len); }
inline QByteArray unquotedLexem() const { return lex.mid(from+1, len-2); }
- inline operator QByteArray() const { return lex.mid(from, len); }
inline operator SubArray() const { return SubArray(lex, from, len); }
+ bool operator==(const Symbol& o) const
+ {
+ return SubArray(lex, from, len) == SubArray(o.lex, o.from, o.len);
+ }
QByteArray lex;
int from, len;
@@ -130,6 +133,7 @@ struct SafeSymbols {
QSet<QByteArray> excludedSymbols;
int index;
};
+Q_DECLARE_TYPEINFO(SafeSymbols, Q_MOVABLE_TYPE);
class SymbolStack : public QStack<SafeSymbols>
{
diff --git a/src/tools/qdoc/TODO.txt b/src/tools/qdoc/TODO.txt
deleted file mode 100644
index 9bf4a2864f..0000000000
--- a/src/tools/qdoc/TODO.txt
+++ /dev/null
@@ -1,87 +0,0 @@
- * fix QWSPointerCalibrationData::devPoints and qwsServer
- * Fix QMenu::addAction(QAction *) overload, "using" etc.
- * fix space between two tables using <p></p>
- * qpixmap-qt3.html; remove 8 public functions inherited from QPaintDevice
- * \variable array
- * Added support for parameterless macros (e.g. \macro Q_OBJECT).
- * Made qdoc stricter regarding the data types (e.g. can't use \enum to document a typedef).
- * Parse QT_MODULE() macro and generate proper warnings for the various editions.
- * Fix parsing of \image following \value (e.g. qt.html).
- * Don't turn X11 and similar names into links.
- * Added automatic links from getters to setters and vice versa.
- * Support \module and show which module each class is from.
- * Fix occasional crash caused by misuse of const_cast().
- * Provide clearer error messages when resolves fail.
-
-
-
-
-CHECK:
-
- * Identify editions
- * Automatic \sa getter setter
- * \macro Q_OBJECT
-
-MUST HAVES:
-
- * resolve [gs]etters for \sa using base class
-
- * fix \overload when one is a signal and the other a normal function
- * use "project" for .dcf files
- * functions.html: include the types from QtGlobal as well as the functions (whatever that means)
-
- * nice template function/class syntax
- * spellchecker: built-in vs. builtin
-
- * verbose mode for functions that don't exist
- * No links to Porting Guide sections (e.g. QStringList)
- * link toggled(bool)
- * autolink foo(1)
- * handle using correctly
- * QObject "reentrant" list: duplicates
- * operator<< \overload
- * \compat \overload
- * qWarning() link
- * operator<<() autolink
-
- * get rid of spurious 'global' functions
- * Make automatic links in code work
-
- * Fix encoding bug (see Important email from Simon Hausmann)
- * Make links to QFoo::bar().baz() work
- * Fix automatic links in \sectionX (e.g. qt4-getting-started.html)
- * Provide a "List of all properties" page.
-
- * expand QObjectList -> QList<QObject *>
- * warning for unnamed parameters in property access functions
- * \center...\endcenter
-
-LINKS:
-
- * explanation following nonstandard wording warning
-
- * omit \overload in operator<< and operator>>
- * make operator-() unary and binary independent functions (no \overload)
- * fix \overload
- * fix \legalese
- * remove warning for undocumented enum item like QLocale::LastLanguage
- * improve the \a warnings for overloads; if one overload documents a para, fine
-
- * implement \sidebar
-
- * implement \legalesefile
-
- * show in which module each class is
- * list namespaces, list header files
-
-
-NICE FEATURES:
- * implement inheritance tree for each class (as a PNG)
- * avoid <p>...</p> in table/item cells without relying on horrible kludge
- * prevent macros from having same name as commands
- * be smart about enum types Foo::Bar vs. Bar when comparing functions
- * be smart about const & non-const when comparing functions
-
-OTHER:
- * make qdoc run faster
- * make sure \headerfile works even if specified after \relates
diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp
deleted file mode 100644
index 745da21b30..0000000000
--- a/src/tools/qdoc/atom.cpp
+++ /dev/null
@@ -1,464 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qregexp.h>
-#include "atom.h"
-#include "location.h"
-#include "qdocdatabase.h"
-#include <stdio.h>
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*! \class Atom
- \brief The Atom class is the fundamental unit for representing
- documents internally.
-
- Atoms have a \i type and are completed by a \i string whose
- meaning depends on the \i type. For example, the string
- \quotation
- \i italic text looks nicer than \bold bold text
- \endquotation
- is represented by the following atoms:
- \quotation
- (FormattingLeft, ATOM_FORMATTING_ITALIC)
- (String, "italic")
- (FormattingRight, ATOM_FORMATTING_ITALIC)
- (String, " text is more attractive than ")
- (FormattingLeft, ATOM_FORMATTING_BOLD)
- (String, "bold")
- (FormattingRight, ATOM_FORMATTING_BOLD)
- (String, " text")
- \endquotation
-
- \also Text
-*/
-
-/*! \enum Atom::Type
-
- \value AbstractLeft
- \value AbstractRight
- \value AnnotatedList
- \value AutoLink
- \value BaseName
- \value BriefLeft
- \value BriefRight
- \value C
- \value CaptionLeft
- \value CaptionRight
- \value Code
- \value CodeBad
- \value CodeNew
- \value CodeOld
- \value CodeQuoteArgument
- \value CodeQuoteCommand
- \value DivLeft
- \value DivRight
- \value EndQmlText
- \value FormatElse
- \value FormatEndif
- \value FormatIf
- \value FootnoteLeft
- \value FootnoteRight
- \value FormattingLeft
- \value FormattingRight
- \value GeneratedList
- \value Image
- \value ImageText
- \value ImportantNote
- \value InlineImage
- \value JavaScript
- \value EndJavaScript
- \value Keyword
- \value LineBreak
- \value Link
- \value LinkNode
- \value ListLeft
- \value ListItemNumber
- \value ListTagLeft
- \value ListTagRight
- \value ListItemLeft
- \value ListItemRight
- \value ListRight
- \value NavAutoLink
- \value NavLink
- \value Nop
- \value Note
- \value ParaLeft
- \value ParaRight
- \value Qml
- \value QmlText
- \value QuotationLeft
- \value QuotationRight
- \value RawString
- \value SectionLeft
- \value SectionRight
- \value SectionHeadingLeft
- \value SectionHeadingRight
- \value SidebarLeft
- \value SidebarRight
- \value SinceList
- \value String
- \value TableLeft
- \value TableRight
- \value TableHeaderLeft
- \value TableHeaderRight
- \value TableRowLeft
- \value TableRowRight
- \value TableItemLeft
- \value TableItemRight
- \value TableOfContents
- \value Target
- \value UnhandledFormat
- \value UnknownCommand
-*/
-
-QString Atom::noError_ = QString();
-
-static const struct {
- const char *english;
- int no;
-} atms[] = {
- { "AbstractLeft", Atom::AbstractLeft },
- { "AbstractRight", Atom::AbstractRight },
- { "AnnotatedList", Atom::AnnotatedList },
- { "AutoLink", Atom::AutoLink },
- { "BaseName", Atom::BaseName },
- { "br", Atom::BR},
- { "BriefLeft", Atom::BriefLeft },
- { "BriefRight", Atom::BriefRight },
- { "C", Atom::C },
- { "CaptionLeft", Atom::CaptionLeft },
- { "CaptionRight", Atom::CaptionRight },
- { "Code", Atom::Code },
- { "CodeBad", Atom::CodeBad },
- { "CodeNew", Atom::CodeNew },
- { "CodeOld", Atom::CodeOld },
- { "CodeQuoteArgument", Atom::CodeQuoteArgument },
- { "CodeQuoteCommand", Atom::CodeQuoteCommand },
- { "DivLeft", Atom::DivLeft },
- { "DivRight", Atom::DivRight },
- { "EndQmlText", Atom::EndQmlText },
- { "FootnoteLeft", Atom::FootnoteLeft },
- { "FootnoteRight", Atom::FootnoteRight },
- { "FormatElse", Atom::FormatElse },
- { "FormatEndif", Atom::FormatEndif },
- { "FormatIf", Atom::FormatIf },
- { "FormattingLeft", Atom::FormattingLeft },
- { "FormattingRight", Atom::FormattingRight },
- { "GeneratedList", Atom::GeneratedList },
- { "GuidLink", Atom::GuidLink},
- { "hr", Atom::HR},
- { "Image", Atom::Image },
- { "ImageText", Atom::ImageText },
- { "ImportantLeft", Atom::ImportantLeft },
- { "ImportantRight", Atom::ImportantRight },
- { "InlineImage", Atom::InlineImage },
- { "JavaScript", Atom::JavaScript },
- { "EndJavaScript", Atom::EndJavaScript },
- { "Keyword", Atom::Keyword },
- { "LegaleseLeft", Atom::LegaleseLeft },
- { "LegaleseRight", Atom::LegaleseRight },
- { "LineBreak", Atom::LineBreak },
- { "Link", Atom::Link },
- { "LinkNode", Atom::LinkNode },
- { "ListLeft", Atom::ListLeft },
- { "ListItemNumber", Atom::ListItemNumber },
- { "ListTagLeft", Atom::ListTagLeft },
- { "ListTagRight", Atom::ListTagRight },
- { "ListItemLeft", Atom::ListItemLeft },
- { "ListItemRight", Atom::ListItemRight },
- { "ListRight", Atom::ListRight },
- { "NavAutoLink", Atom::NavAutoLink },
- { "NavLink", Atom::NavLink },
- { "Nop", Atom::Nop },
- { "NoteLeft", Atom::NoteLeft },
- { "NoteRight", Atom::NoteRight },
- { "ParaLeft", Atom::ParaLeft },
- { "ParaRight", Atom::ParaRight },
- { "Qml", Atom::Qml},
- { "QmlText", Atom::QmlText },
- { "QuotationLeft", Atom::QuotationLeft },
- { "QuotationRight", Atom::QuotationRight },
- { "RawString", Atom::RawString },
- { "SectionLeft", Atom::SectionLeft },
- { "SectionRight", Atom::SectionRight },
- { "SectionHeadingLeft", Atom::SectionHeadingLeft },
- { "SectionHeadingRight", Atom::SectionHeadingRight },
- { "SidebarLeft", Atom::SidebarLeft },
- { "SidebarRight", Atom::SidebarRight },
- { "SinceList", Atom::SinceList },
- { "SnippetCommand", Atom::SnippetCommand },
- { "SnippetIdentifier", Atom::SnippetIdentifier },
- { "SnippetLocation", Atom::SnippetLocation },
- { "String", Atom::String },
- { "TableLeft", Atom::TableLeft },
- { "TableRight", Atom::TableRight },
- { "TableHeaderLeft", Atom::TableHeaderLeft },
- { "TableHeaderRight", Atom::TableHeaderRight },
- { "TableRowLeft", Atom::TableRowLeft },
- { "TableRowRight", Atom::TableRowRight },
- { "TableItemLeft", Atom::TableItemLeft },
- { "TableItemRight", Atom::TableItemRight },
- { "TableOfContents", Atom::TableOfContents },
- { "Target", Atom::Target },
- { "UnhandledFormat", Atom::UnhandledFormat },
- { "UnknownCommand", Atom::UnknownCommand },
- { 0, 0 }
-};
-
-/*! \fn Atom::Atom(Type type, const QString& string)
-
- Constructs an atom of the specified \a type with the single
- parameter \a string and does not put the new atom in a list.
-*/
-
-/*! \fn Atom::Atom(Type type, const QString& p1, const QString& p2)
-
- Constructs an atom of the specified \a type with the two
- parameters \a p1 and \a p2 and does not put the new atom
- in a list.
-*/
-
-/*! \fn Atom(Atom *previous, Type type, const QString& string)
-
- Constructs an atom of the specified \a type with the single
- parameter \a string and inserts the new atom into the list
- after the \a previous atom.
-*/
-
-/*! \fn Atom::Atom(Atom* previous, Type type, const QString& p1, const QString& p2)
-
- Constructs an atom of the specified \a type with the two
- parameters \a p1 and \a p2 and inserts the new atom into
- the list after the \a previous atom.
-*/
-
-/*! \fn void Atom::appendChar(QChar ch)
-
- Appends \a ch to the string parameter of this atom.
-
- \also string()
-*/
-
-/*! \fn void Atom::appendString(const QString& string)
-
- Appends \a string to the string parameter of this atom.
-
- \also string()
-*/
-
-/*! \fn void Atom::chopString()
-
- \also string()
-*/
-
-/*! \fn Atom *Atom::next()
- Return the next atom in the atom list.
- \also type(), string()
-*/
-
-/*!
- Return the next Atom in the list if it is of Type \a t.
- Otherwise return 0.
- */
-const Atom* Atom::next(Type t) const
-{
- return (next_ && (next_->type() == t)) ? next_ : 0;
-}
-
-/*!
- Return the next Atom in the list if it is of Type \a t
- and its string part is \a s. Otherwise return 0.
- */
-const Atom* Atom::next(Type t, const QString& s) const
-{
- return (next_ && (next_->type() == t) && (next_->string() == s)) ? next_ : 0;
-}
-
-/*! \fn const Atom *Atom::next() const
- Return the next atom in the atom list.
- \also type(), string()
-*/
-
-/*! \fn Type Atom::type() const
- Return the type of this atom.
- \also string(), next()
-*/
-
-/*!
- Return the type of this atom as a string. Return "Invalid" if
- type() returns an impossible value.
-
- This is only useful for debugging.
-
- \also type()
-*/
-QString Atom::typeString() const
-{
- static bool deja = false;
-
- if (!deja) {
- int i = 0;
- while (atms[i].english != 0) {
- if (atms[i].no != i)
- Location::internalError(QCoreApplication::translate("QDoc::Atom", "atom %1 missing").arg(i));
- i++;
- }
- deja = true;
- }
-
- int i = (int) type();
- if (i < 0 || i > (int) Last)
- return QLatin1String("Invalid");
- return QLatin1String(atms[i].english);
-}
-
-/*! \fn const QString& Atom::string() const
-
- Returns the string parameter that together with the type
- characterizes this atom.
-
- \also type(), next()
-*/
-
-/*!
- Dumps this Atom to stderr in printer friendly form.
- */
-void Atom::dump() const
-{
- QString str = string();
- str.replace(QLatin1String("\\"), QLatin1String("\\\\"));
- str.replace(QLatin1String("\""), QLatin1String("\\\""));
- str.replace(QLatin1String("\n"), QLatin1String("\\n"));
- str.replace(QRegExp(QLatin1String("[^\x20-\x7e]")), QLatin1String("?"));
- if (!str.isEmpty())
- str = QLatin1String(" \"") + str + QLatin1Char('"');
- fprintf(stderr,
- " %-15s%s\n",
- typeString().toLatin1().data(),
- str.toLatin1().data());
-}
-
-/*!
- The only constructor for LinkAtom. It creates an Atom of
- type Atom::Link. \a p1 being the link target. \a p2 is the
- parameters in square brackets. Normally there is just one
- word in the square brackets, but there can be up to three
- words separated by spaces. The constructor splits \a p2 on
- the space character.
- */
-LinkAtom::LinkAtom(const QString& p1, const QString& p2)
- : Atom(p1),
- resolved_(false),
- genus_(Node::DontCare),
- goal_(Node::NoType),
- domain_(0),
- squareBracketParams_(p2)
-{
- // nada.
-}
-
-/*!
- This function resolves the parameters that were enclosed in
- square brackets. If the parameters have already been resolved,
- it does nothing and returns immediately.
- */
-void LinkAtom::resolveSquareBracketParams()
-{
- if (resolved_)
- return;
- QStringList params = squareBracketParams_.toLower().split(QLatin1Char(' '));
- foreach (const QString& p, params) {
- if (!domain_) {
- domain_ = QDocDatabase::qdocDB()->findTree(p);
- if (domain_) {
- continue;
- }
- }
- if (goal_ == Node::NoType) {
- goal_ = Node::goal(p);
- if (goal_ != Node::NoType)
- continue;
- }
- if (p == "qml") {
- genus_ = Node::QML;
- continue;
- }
- if (p == "cpp") {
- genus_ = Node::CPP;
- continue;
- }
- if (p == "doc") {
- genus_ = Node::DOC;
- continue;
- }
- error_ = squareBracketParams_;
- break;
- }
- resolved_ = true;
-}
-
-/*!
- Standard copy constructor of LinkAtom \a t.
- */
-LinkAtom::LinkAtom(const LinkAtom& t)
- : Atom(Link, t.string()),
- resolved_(t.resolved_),
- genus_(t.genus_),
- goal_(t.goal_),
- domain_(t.domain_),
- error_(t.error_),
- squareBracketParams_(t.squareBracketParams_)
-{
- // nothing
-}
-
-/*!
- Special copy constructor of LinkAtom \a t, where
- where the new LinkAtom will not be the first one
- in the list.
- */
-LinkAtom::LinkAtom(Atom* previous, const LinkAtom& t)
- : Atom(previous, Link, t.string()),
- resolved_(t.resolved_),
- genus_(t.genus_),
- goal_(t.goal_),
- domain_(t.domain_),
- error_(t.error_),
- squareBracketParams_(t.squareBracketParams_)
-{
- previous->next_ = this;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/atom.h b/src/tools/qdoc/atom.h
deleted file mode 100644
index ebbba8917e..0000000000
--- a/src/tools/qdoc/atom.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 ATOM_H
-#define ATOM_H
-
-#include <qstringlist.h>
-#include "node.h"
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-class Tree;
-class LinkAtom;
-
-class Atom
-{
-public:
- enum Type {
- AbstractLeft,
- AbstractRight,
- AnnotatedList,
- AutoLink,
- BaseName,
- BR,
- BriefLeft,
- BriefRight,
- C,
- CaptionLeft,
- CaptionRight,
- Code,
- CodeBad,
- CodeNew,
- CodeOld,
- CodeQuoteArgument,
- CodeQuoteCommand,
- DivLeft,
- DivRight,
- EndQmlText,
- FootnoteLeft,
- FootnoteRight,
- FormatElse,
- FormatEndif,
- FormatIf,
- FormattingLeft,
- FormattingRight,
- GeneratedList,
- GuidLink,
- HR,
- Image,
- ImageText,
- ImportantLeft,
- ImportantRight,
- InlineImage,
- JavaScript,
- EndJavaScript,
- Keyword,
- LegaleseLeft,
- LegaleseRight,
- LineBreak,
- Link,
- LinkNode,
- ListLeft,
- ListItemNumber,
- ListTagLeft,
- ListTagRight,
- ListItemLeft,
- ListItemRight,
- ListRight,
- NavAutoLink,
- NavLink,
- Nop,
- NoteLeft,
- NoteRight,
- ParaLeft,
- ParaRight,
- Qml,
- QmlText,
- QuotationLeft,
- QuotationRight,
- RawString,
- SectionLeft,
- SectionRight,
- SectionHeadingLeft,
- SectionHeadingRight,
- SidebarLeft,
- SidebarRight,
- SinceList,
- SnippetCommand,
- SnippetIdentifier,
- SnippetLocation,
- String,
- TableLeft,
- TableRight,
- TableHeaderLeft,
- TableHeaderRight,
- TableRowLeft,
- TableRowRight,
- TableItemLeft,
- TableItemRight,
- TableOfContents,
- Target,
- UnhandledFormat,
- UnknownCommand,
- Last = UnknownCommand
- };
-
- friend class LinkAtom;
-
- Atom(const QString& string)
- : next_(0), type_(Link)
- {
- strs << string;
- }
-
- Atom(Type type, const QString& string = "")
- : next_(0), type_(type)
- {
- strs << string;
- }
-
- Atom(Type type, const QString& p1, const QString& p2)
- : next_(0), type_(type)
- {
- strs << p1;
- if (!p2.isEmpty())
- strs << p2;
- }
-
- Atom(Atom* previous, Type type, const QString& string = "")
- : next_(previous->next_), type_(type)
- {
- strs << string;
- previous->next_ = this;
- }
-
- Atom(Atom* previous, Type type, const QString& p1, const QString& p2)
- : next_(previous->next_), type_(type)
- {
- strs << p1;
- if (!p2.isEmpty())
- strs << p2;
- previous->next_ = this;
- }
-
- virtual ~Atom() { }
-
- void appendChar(QChar ch) { strs[0] += ch; }
- void appendString(const QString& string) { strs[0] += string; }
- void chopString() { strs[0].chop(1); }
- void setString(const QString& string) { strs[0] = string; }
- Atom* next() { return next_; }
- void setNext(Atom* newNext) { next_ = newNext; }
-
- const Atom* next() const { return next_; }
- const Atom* next(Type t) const;
- const Atom* next(Type t, const QString& s) const;
- Type type() const { return type_; }
- QString typeString() const;
- const QString& string() const { return strs[0]; }
- const QString& string(int i) const { return strs[i]; }
- int count() const { return strs.size(); }
- void dump() const;
- const QStringList& strings() const { return strs; }
-
- virtual bool isLinkAtom() const { return false; }
- virtual Node::Genus genus() { return Node::DontCare; }
- virtual bool specifiesDomain() { return false; }
- virtual Tree* domain() { return 0; }
- virtual Node::Type goal() { return Node::NoType; }
- virtual const QString& error() { return noError_; }
- virtual void resolveSquareBracketParams() { }
-
- protected:
- static QString noError_;
- Atom* next_;
- Type type_;
- QStringList strs;
-};
-
-class LinkAtom : public Atom
-{
- public:
- LinkAtom(const QString& p1, const QString& p2);
- LinkAtom(const LinkAtom& t);
- LinkAtom(Atom* previous, const LinkAtom& t);
- virtual ~LinkAtom() { }
-
- virtual bool isLinkAtom() const Q_DECL_OVERRIDE { return true; }
- virtual Node::Genus genus() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return genus_; }
- virtual bool specifiesDomain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return (domain_ != 0); }
- virtual Tree* domain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return domain_; }
- virtual Node::Type goal() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return goal_; }
- virtual const QString& error() Q_DECL_OVERRIDE { return error_; }
- virtual void resolveSquareBracketParams() Q_DECL_OVERRIDE;
-
- protected:
- bool resolved_;
- Node::Genus genus_;
- Node::Type goal_;
- Tree* domain_;
- QString error_;
- QString squareBracketParams_;
-};
-
-#define ATOM_FORMATTING_BOLD "bold"
-#define ATOM_FORMATTING_INDEX "index"
-#define ATOM_FORMATTING_ITALIC "italic"
-#define ATOM_FORMATTING_LINK "link"
-#define ATOM_FORMATTING_PARAMETER "parameter"
-#define ATOM_FORMATTING_SPAN "span "
-#define ATOM_FORMATTING_SUBSCRIPT "subscript"
-#define ATOM_FORMATTING_SUPERSCRIPT "superscript"
-#define ATOM_FORMATTING_TELETYPE "teletype"
-#define ATOM_FORMATTING_UICONTROL "uicontrol"
-#define ATOM_FORMATTING_UNDERLINE "underline"
-
-#define ATOM_LIST_BULLET "bullet"
-#define ATOM_LIST_TAG "tag"
-#define ATOM_LIST_VALUE "value"
-#define ATOM_LIST_LOWERALPHA "loweralpha"
-#define ATOM_LIST_LOWERROMAN "lowerroman"
-#define ATOM_LIST_NUMERIC "numeric"
-#define ATOM_LIST_UPPERALPHA "upperalpha"
-#define ATOM_LIST_UPPERROMAN "upperroman"
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/codechunk.cpp b/src/tools/qdoc/codechunk.cpp
deleted file mode 100644
index 5799e0bac0..0000000000
--- a/src/tools/qdoc/codechunk.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- codechunk.cpp
-*/
-
-#include <qregexp.h>
-#include <qstringlist.h>
-
-#include "codechunk.h"
-
-QT_BEGIN_NAMESPACE
-
-enum { Other, Alnum, Gizmo, Comma, LParen, RParen, RAngle, Colon };
-
-// entries 128 and above are Other
-static const int charCategory[256] = {
- Other, Other, Other, Other, Other, Other, Other, Other,
- Other, Other, Other, Other, Other, Other, Other, Other,
- Other, Other, Other, Other, Other, Other, Other, Other,
- Other, Other, Other, Other, Other, Other, Other, Other,
- // ! " # $ % & '
- Other, Other, Other, Other, Other, Gizmo, Gizmo, Other,
- // ( ) * + , - . /
- LParen, RParen, Gizmo, Gizmo, Comma, Other, Other, Gizmo,
- // 0 1 2 3 4 5 6 7
- Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // 8 9 : ; < = > ?
- Alnum, Alnum, Colon, Other, Other, Gizmo, RAngle, Gizmo,
- // @ A B C D E F G
- Other, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // H I J K L M N O
- Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // P Q R S T U V W
- Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // X Y Z [ \ ] ^ _
- Alnum, Alnum, Alnum, Other, Other, Other, Gizmo, Alnum,
- // ` a b c d e f g
- Other, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // h i j k l m n o
- Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // p q r s t u v w
- Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum, Alnum,
- // x y z { | } ~
- Alnum, Alnum, Alnum, LParen, Gizmo, RParen, Other, Other
-};
-
-static const bool needSpace[8][8] = {
- /* [ a + , ( ) > : */
- /* [ */ { false, false, false, false, false, true, false, false },
- /* a */ { false, true, true, false, false, true, false, false },
- /* + */ { false, true, false, false, false, true, false, true },
- /* , */ { true, true, true, true, true, true, true, true },
- /* ( */ { true, true, true, false, true, false, true, true },
- /* ) */ { true, true, true, false, true, true, true, true },
- /* > */ { true, true, true, false, true, true, true, false },
- /* : */ { false, false, true, true, true, true, true, false }
-};
-
-static int category( QChar ch )
-{
- return charCategory[(int)ch.toLatin1()];
-}
-
-CodeChunk::CodeChunk()
- : hotspot( -1 )
-{
-}
-
-CodeChunk::CodeChunk( const QString& str )
- : s( str ), hotspot( -1 )
-{
-}
-
-void CodeChunk::append( const QString& lexeme )
-{
- if ( !s.isEmpty() && !lexeme.isEmpty() ) {
- /*
- Should there be a space or not between the code chunk so far and the
- new lexeme?
- */
- int cat1 = category(s.at(s.size() - 1));
- int cat2 = category(lexeme[0]);
- if ( needSpace[cat1][cat2] )
- s += QLatin1Char( ' ' );
- }
- s += lexeme;
-}
-
-void CodeChunk::appendHotspot()
-{
- /*
- The first hotspot is the right one.
- */
- if ( hotspot == -1 )
- hotspot = s.length();
-}
-
-QString CodeChunk::toString() const
-{
- return s;
-}
-
-QStringList CodeChunk::toPath() const
-{
- QString t = s;
- t.remove(QRegExp(QLatin1String("<([^<>]|<([^<>]|<[^<>]*>)*>)*>")));
- return t.split(QLatin1String("::"));
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/codechunk.h b/src/tools/qdoc/codechunk.h
deleted file mode 100644
index 259012df90..0000000000
--- a/src/tools/qdoc/codechunk.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- codechunk.h
-*/
-
-#ifndef CODECHUNK_H
-#define CODECHUNK_H
-
-#include <qstring.h>
-
-QT_BEGIN_NAMESPACE
-
-// ### get rid of that class
-
-/*
- The CodeChunk class represents a tiny piece of C++ code.
-
- The class provides conversion between a list of lexemes and a string. It adds
- spaces at the right place for consistent style. The tiny pieces of code it
- represents are data types, enum values, and default parameter values.
-
- Apart from the piece of code itself, there are two bits of metainformation
- stored in CodeChunk: the base and the hotspot. The base is the part of the
- piece that may be a hypertext link. The base of
-
- QMap<QString, QString>
-
- is QMap.
-
- The hotspot is the place the variable name should be inserted in the case of a
- variable (or parameter) declaration. The base of
-
- char * []
-
- is between '*' and '[]'.
-*/
-class CodeChunk
-{
-public:
- CodeChunk();
- CodeChunk( const QString& str );
-
- void append( const QString& lexeme );
- void appendHotspot();
-
- bool isEmpty() const { return s.isEmpty(); }
- void clear() { s.clear(); }
- QString toString() const;
- QStringList toPath() const;
- QString left() const { return s.left(hotspot == -1 ? s.length() : hotspot); }
- QString right() const { return s.mid(hotspot == -1 ? s.length() : hotspot); }
-
-private:
- QString s;
- int hotspot;
-};
-
-inline bool operator==( const CodeChunk& c, const CodeChunk& d ) {
- return c.toString() == d.toString();
-}
-
-inline bool operator!=( const CodeChunk& c, const CodeChunk& d ) {
- return !( c == d );
-}
-
-inline bool operator<( const CodeChunk& c, const CodeChunk& d ) {
- return c.toString() < d.toString();
-}
-
-inline bool operator>( const CodeChunk& c, const CodeChunk& d ) {
- return d < c;
-}
-
-inline bool operator<=( const CodeChunk& c, const CodeChunk& d ) {
- return !( c > d );
-}
-
-inline bool operator>=( const CodeChunk& c, const CodeChunk& d ) {
- return !( c < d );
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
deleted file mode 100644
index 2253aca183..0000000000
--- a/src/tools/qdoc/codemarker.cpp
+++ /dev/null
@@ -1,648 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qobjectdefs.h>
-#include "codemarker.h"
-#include "config.h"
-#include "node.h"
-#include <qdebug.h>
-#include <stdio.h>
-
-QT_BEGIN_NAMESPACE
-
-QString CodeMarker::defaultLang;
-QList<CodeMarker *> CodeMarker::markers;
-
-/*!
- When a code marker constructs itself, it puts itself into
- the static list of code markers. All the code markers in
- the static list get initialized in initialize(), which is
- not called until after the qdoc configuration file has
- been read.
- */
-CodeMarker::CodeMarker()
-{
- markers.prepend(this);
-}
-
-/*!
- When a code marker destroys itself, it removes itself from
- the static list of code markers.
- */
-CodeMarker::~CodeMarker()
-{
- markers.removeAll(this);
-}
-
-/*!
- A code market performs no initialization by default. Marker-specific
- initialization is performed in subclasses.
- */
-void CodeMarker::initializeMarker(const Config& ) // config
-{
-}
-
-/*!
- Terminating a code marker is trivial.
- */
-void CodeMarker::terminateMarker()
-{
- // nothing.
-}
-
-/*!
- All the code markers in the static list are initialized
- here, after the qdoc configuration file has been loaded.
- */
-void CodeMarker::initialize(const Config& config)
-{
- defaultLang = config.getString(CONFIG_LANGUAGE);
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- (*m)->initializeMarker(config);
- ++m;
- }
-}
-
-/*!
- All the code markers in the static list are terminated here.
- */
-void CodeMarker::terminate()
-{
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- (*m)->terminateMarker();
- ++m;
- }
-}
-
-CodeMarker *CodeMarker::markerForCode(const QString& code)
-{
- CodeMarker *defaultMarker = markerForLanguage(defaultLang);
- if (defaultMarker != 0 && defaultMarker->recognizeCode(code))
- return defaultMarker;
-
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- if ((*m)->recognizeCode(code))
- return *m;
- ++m;
- }
- return defaultMarker;
-}
-
-CodeMarker *CodeMarker::markerForFileName(const QString& fileName)
-{
- CodeMarker *defaultMarker = markerForLanguage(defaultLang);
- int dot = -1;
- while ((dot = fileName.lastIndexOf(QLatin1Char('.'), dot)) != -1) {
- QString ext = fileName.mid(dot + 1);
- if (defaultMarker != 0 && defaultMarker->recognizeExtension(ext))
- return defaultMarker;
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- if ((*m)->recognizeExtension(ext))
- return *m;
- ++m;
- }
- --dot;
- }
- return defaultMarker;
-}
-
-CodeMarker *CodeMarker::markerForLanguage(const QString& lang)
-{
- QList<CodeMarker *>::ConstIterator m = markers.constBegin();
- while (m != markers.constEnd()) {
- if ((*m)->recognizeLanguage(lang))
- return *m;
- ++m;
- }
- return 0;
-}
-
-const Node *CodeMarker::nodeForString(const QString& string)
-{
- if (sizeof(const Node *) == sizeof(uint)) {
- return reinterpret_cast<const Node *>(string.toUInt());
- }
- else {
- return reinterpret_cast<const Node *>(string.toULongLong());
- }
-}
-
-QString CodeMarker::stringForNode(const Node *node)
-{
- if (sizeof(const Node *) == sizeof(ulong)) {
- return QString::number(reinterpret_cast<quintptr>(node));
- }
- else {
- return QString::number(reinterpret_cast<qulonglong>(node));
- }
-}
-
-static const QString samp = QLatin1String("&amp;");
-static const QString slt = QLatin1String("&lt;");
-static const QString sgt = QLatin1String("&gt;");
-static const QString squot = QLatin1String("&quot;");
-
-QString CodeMarker::protect(const QString& str)
-{
- int n = str.length();
- QString marked;
- marked.reserve(n * 2 + 30);
- const QChar *data = str.constData();
- for (int i = 0; i != n; ++i) {
- switch (data[i].unicode()) {
- case '&': marked += samp; break;
- case '<': marked += slt; break;
- case '>': marked += sgt; break;
- case '"': marked += squot; break;
- default : marked += data[i];
- }
- }
- return marked;
-}
-
-QString CodeMarker::typified(const QString &string)
-{
- QString result;
- QString pendingWord;
-
- for (int i = 0; i <= string.size(); ++i) {
- QChar ch;
- if (i != string.size())
- ch = string.at(i);
-
- QChar lower = ch.toLower();
- if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z'))
- || ch.digitValue() >= 0 || ch == QLatin1Char('_')
- || ch == QLatin1Char(':')) {
- pendingWord += ch;
- }
- else {
- if (!pendingWord.isEmpty()) {
- bool isProbablyType = (pendingWord != QLatin1String("const"));
- if (isProbablyType)
- result += QLatin1String("<@type>");
- result += pendingWord;
- if (isProbablyType)
- result += QLatin1String("</@type>");
- }
- pendingWord.clear();
-
- switch (ch.unicode()) {
- case '\0':
- break;
- case '&':
- result += QLatin1String("&amp;");
- break;
- case '<':
- result += QLatin1String("&lt;");
- break;
- case '>':
- result += QLatin1String("&gt;");
- break;
- default:
- result += ch;
- }
- }
- }
- return result;
-}
-
-QString CodeMarker::taggedNode(const Node* node)
-{
- QString tag;
- QString name = node->name();
-
- switch (node->type()) {
- case Node::Namespace:
- tag = QLatin1String("@namespace");
- break;
- case Node::Class:
- tag = QLatin1String("@class");
- break;
- case Node::Enum:
- tag = QLatin1String("@enum");
- break;
- case Node::Typedef:
- tag = QLatin1String("@typedef");
- break;
- case Node::Function:
- tag = QLatin1String("@function");
- break;
- case Node::Property:
- tag = QLatin1String("@property");
- break;
- case Node::QmlType:
- /*
- Remove the "QML:" prefix, if present.
- There shouldn't be any of these "QML:"
- prefixes in the documentation sources
- after the switch to using QML module
- qualifiers, but this code is kept to
- be backward compatible.
- */
- if (node->name().startsWith(QLatin1String("QML:")))
- name = name.mid(4);
- tag = QLatin1String("@property");
- break;
- case Node::Document:
- tag = QLatin1String("@property");
- break;
- case Node::QmlMethod:
- case Node::QmlSignal:
- case Node::QmlSignalHandler:
- tag = QLatin1String("@function");
- break;
- default:
- tag = QLatin1String("@unknown");
- break;
- }
- return (QLatin1Char('<') + tag + QLatin1Char('>') + protect(name)
- + QLatin1String("</") + tag + QLatin1Char('>'));
-}
-
-QString CodeMarker::taggedQmlNode(const Node* node)
-{
- QString tag;
- switch (node->type()) {
- case Node::QmlProperty:
- tag = QLatin1String("@property");
- break;
- case Node::QmlSignal:
- tag = QLatin1String("@signal");
- break;
- case Node::QmlSignalHandler:
- tag = QLatin1String("@signalhandler");
- break;
- case Node::QmlMethod:
- tag = QLatin1String("@method");
- break;
- default:
- tag = QLatin1String("@unknown");
- break;
- }
- return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
- + QLatin1String("</") + tag + QLatin1Char('>');
-}
-
-QString CodeMarker::linkTag(const Node *node, const QString& body)
-{
- return QLatin1String("<@link node=\"") + stringForNode(node)
- + QLatin1String("\">") + body + QLatin1String("</@link>");
-}
-
-QString CodeMarker::sortName(const Node *node, const QString* name)
-{
- QString nodeName;
- if (name != 0)
- nodeName = *name;
- else
- nodeName = node->name();
- int numDigits = 0;
- for (int i = nodeName.size() - 1; i > 0; --i) {
- if (nodeName.at(i).digitValue() == -1)
- break;
- ++numDigits;
- }
-
- // we want 'qint8' to appear before 'qint16'
- if (numDigits > 0) {
- for (int i = 0; i < 4 - numDigits; ++i)
- nodeName.insert(nodeName.size()-numDigits-1, QLatin1Char('0'));
- }
-
- if (node->type() == Node::Function) {
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
- QString sortNo;
- if (func->metaness() == FunctionNode::Ctor) {
- sortNo = QLatin1String("C");
- }
- else if (func->metaness() == FunctionNode::Dtor) {
- sortNo = QLatin1String("D");
- }
- else {
- if (nodeName.startsWith(QLatin1String("operator"))
- && nodeName.length() > 8
- && !nodeName[8].isLetterOrNumber())
- sortNo = QLatin1String("F");
- else
- sortNo = QLatin1String("E");
- }
- return sortNo + nodeName + QLatin1Char(' ')
- + QString::number(func->overloadNumber(), 36);
- }
-
- if (node->type() == Node::Class)
- return QLatin1Char('A') + nodeName;
-
- if (node->type() == Node::Property || node->type() == Node::Variable)
- return QLatin1Char('E') + nodeName;
-
- if ((node->type() == Node::QmlMethod) ||
- (node->type() == Node::QmlSignal) ||
- (node->type() == Node::QmlSignalHandler)) {
- //const FunctionNode* func = static_cast<const FunctionNode *>(node);
- //return QLatin1Char('E') + func->name();
- return QLatin1Char('E') + nodeName;
- }
-
- return QLatin1Char('B') + nodeName;
-}
-
-void CodeMarker::insert(FastSection &fastSection,
- Node *node,
- SynopsisStyle style,
- Status status)
-{
- bool irrelevant = false;
- bool inheritedMember = false;
- if (!node->relates()) {
- InnerNode* p = node->parent();
- if (p->isQmlPropertyGroup())
- p = p->parent();
- if (p != fastSection.parent_) {
- if ((!p->isQmlType() && !p->isJsType()) || !p->isAbstract())
- inheritedMember = true;
- }
- }
-
- if (node->access() == Node::Private) {
- irrelevant = true;
- }
- else if (node->type() == Node::Function) {
- FunctionNode *func = (FunctionNode *) node;
- irrelevant = (inheritedMember
- && (func->metaness() == FunctionNode::Ctor ||
- func->metaness() == FunctionNode::Dtor));
- }
- else if (node->type() == Node::Class || node->type() == Node::Enum
- || node->type() == Node::Typedef) {
- irrelevant = (inheritedMember && style != Subpage);
- if (!irrelevant && style == Detailed && node->type() == Node::Typedef) {
- const TypedefNode* typedeffe = static_cast<const TypedefNode*>(node);
- if (typedeffe->associatedEnum())
- irrelevant = true;
- }
- }
-
- if (!irrelevant) {
- if (status == Compat) {
- irrelevant = (node->status() != Node::Compat);
- }
- else if (status == Obsolete) {
- irrelevant = (node->status() != Node::Obsolete);
- }
- else {
- irrelevant = (node->status() == Node::Compat ||
- node->status() == Node::Obsolete);
- }
- }
-
- if (!irrelevant) {
- if (!inheritedMember || style == Subpage) {
- QString key = sortName(node);
- fastSection.memberMap.insertMulti(key, node);
- }
- else {
- if (node->parent()->isClass() || node->parent()->isNamespace()) {
- if (fastSection.inherited.isEmpty()
- || fastSection.inherited.last().first != node->parent()) {
- QPair<InnerNode *, int> p(node->parent(), 0);
- fastSection.inherited.append(p);
- }
- fastSection.inherited.last().second++;
- }
- }
- }
-}
-
-/*!
- Returns \c true if \a node represents a reimplemented member
- function in the class of the FastSection \a fs. If it is
- a reimplemented function, then it is inserted into the
- reimplemented member map in \a fs. The test is performed
- only if \a status is \e OK. True is returned if \a node
- is inserted into the map. Otherwise, false is returned.
- */
-bool CodeMarker::insertReimpFunc(FastSection& fs, Node* node, Status status)
-{
- if ((node->access() != Node::Private) && (node->relates() == 0)) {
- const FunctionNode* fn = static_cast<const FunctionNode*>(node);
- if ((fn->reimplementedFrom() != 0) && (status == Okay)) {
- if (fn->parent() == fs.parent_) {
- QString key = sortName(fn);
- if (!fs.reimpMemberMap.contains(key)) {
- fs.reimpMemberMap.insert(key,node);
- return true;
- }
- }
- }
- }
- return false;
-}
-
-/*!
- If \a fs is not empty, convert it to a Section and append
- the new Section to \a sectionList.
- */
-void CodeMarker::append(QList<Section>& sectionList, const FastSection& fs, bool includeKeys)
-{
- if (!fs.isEmpty()) {
- if (fs.classMapList_.isEmpty()) {
- Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember);
- if (includeKeys) {
- section.keys = fs.memberMap.keys();
- }
- section.members = fs.memberMap.values();
- section.reimpMembers = fs.reimpMemberMap.values();
- section.inherited = fs.inherited;
- sectionList.append(section);
- }
- else {
- Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember);
- sectionList.append(section);
- Section* s = &sectionList[sectionList.size()-1];
- for (int i=0; i<fs.classMapList_.size(); i++) {
- ClassMap* classMap = fs.classMapList_[i];
- ClassKeysNodes* ckn = new ClassKeysNodes;
- ckn->first = classMap->first;
- ckn->second.second = classMap->second.values();
- ckn->second.first = classMap->second.keys();
- s->classKeysNodesList_.append(ckn);
- }
- }
- }
-}
-
-/*!
- The destructor must delete each member of the
- list of QML class lists, if it is not empty;
- */
-Section::~Section()
-{
- if (!classKeysNodesList_.isEmpty()) {
- for (int i=0; i<classKeysNodesList_.size(); i++) {
- ClassKeysNodes* classKeysNodes = classKeysNodesList_[i];
- classKeysNodesList_[i] = 0;
- delete classKeysNodes;
- }
- }
-}
-
-/*!
- The destructor must delete the QML class maps in the class
- map list, if the class map list is not empty.
- */
-FastSection::~FastSection()
-{
- if (!classMapList_.isEmpty()) {
- for (int i=0; i<classMapList_.size(); i++) {
- ClassMap* classMap = classMapList_[i];
- classMapList_[i] = 0;
- delete classMap;
- }
- }
-}
-
-static QString encode(const QString &string)
-{
- return string;
-}
-
-QStringList CodeMarker::macRefsForNode(Node *node)
-{
- QString result = QLatin1String("cpp/");
- switch (node->type()) {
- case Node::Class:
- {
- const ClassNode *classe = static_cast<const ClassNode *>(node);
- {
- result += QLatin1String("cl/");
- }
- result += macName(classe); // ### Maybe plainName?
- }
- break;
- case Node::Enum:
- {
- QStringList stringList;
- stringList << encode(result + QLatin1String("tag/") +
- macName(node));
- foreach (const QString &enumName, node->doc().enumItemNames()) {
- // ### Write a plainEnumValue() and use it here
- stringList << encode(result + QLatin1String("econst/") +
- macName(node->parent(), enumName));
- }
- return stringList;
- }
- case Node::Typedef:
- result += QLatin1String("tdef/") + macName(node);
- break;
- case Node::Function:
- {
- bool isMacro = false;
- Q_UNUSED(isMacro)
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
-
- // overloads are too clever for the Xcode documentation browser
- if (func->isOverload())
- return QStringList();
-
- if (func->metaness() == FunctionNode::MacroWithParams
- || func->metaness() == FunctionNode::MacroWithoutParams) {
- result += QLatin1String("macro/");
- }
- else if (func->isStatic()) {
- result += QLatin1String("clm/");
- }
- else if (!func->parent()->name().isEmpty()) {
- result += QLatin1String("instm/");
- }
- else {
- result += QLatin1String("func/");
- }
-
- result += macName(func);
- if (result.endsWith(QLatin1String("()")))
- result.chop(2);
- }
- break;
- case Node::Variable:
- result += QLatin1String("data/") + macName(node);
- break;
- case Node::Property:
- {
- NodeList list = static_cast<const PropertyNode*>(node)->functions();
- QStringList stringList;
- foreach (Node* node, list) {
- stringList += macRefsForNode(node);
- }
- return stringList;
- }
- case Node::Namespace:
- case Node::Document:
- case Node::QmlType:
- default:
- return QStringList();
- }
-
- return QStringList(encode(result));
-}
-
-QString CodeMarker::macName(const Node *node, const QString &name)
-{
- QString myName = name;
- if (myName.isEmpty()) {
- myName = node->name();
- node = node->parent();
- }
-
- if (node->name().isEmpty()) {
- return QLatin1Char('/') + protect(myName);
- }
- else {
- return node->plainFullName() + QLatin1Char('/') + protect(myName);
- }
-}
-
-/*!
- Returns an empty list of documentation sections.
- */
-QList<Section> CodeMarker::qmlSections(QmlTypeNode* , SynopsisStyle , Status )
-{
- return QList<Section>();
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h
deleted file mode 100644
index 7983aa532c..0000000000
--- a/src/tools/qdoc/codemarker.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- codemarker.h
-*/
-
-#ifndef CODEMARKER_H
-#define CODEMARKER_H
-
-#include <qpair.h>
-
-#include "atom.h"
-#include "node.h"
-
-QT_BEGIN_NAMESPACE
-
-class Config;
-
-typedef QMultiMap<QString, Node*> MemberMap; // the string is the member signature
-typedef QPair<const QmlTypeNode*, MemberMap> ClassMap; // the node is the QML type
-typedef QList<ClassMap*> ClassMapList;
-
-typedef QPair<QStringList, NodeList> KeysAndNodes;
-typedef QPair<const QmlTypeNode*, KeysAndNodes> ClassKeysNodes;
-typedef QList<ClassKeysNodes*> ClassKeysNodesList;
-
-struct Section
-{
- QString name;
- QString divClass;
- QString singularMember;
- QString pluralMember;
- QStringList keys;
- NodeList members;
- NodeList reimpMembers;
- QList<QPair<InnerNode *, int> > inherited;
- ClassKeysNodesList classKeysNodesList_;
-
- Section() { }
- Section(const QString& name0,
- const QString& divClass0,
- const QString& singularMember0,
- const QString& pluralMember0)
- : name(name0),
- divClass(divClass0),
- singularMember(singularMember0),
- pluralMember(pluralMember0) { }
- ~Section();
- void appendMember(Node* node) { members.append(node); }
- void appendReimpMember(Node* node) { reimpMembers.append(node); }
-};
-
-struct FastSection
-{
- const InnerNode *parent_;
- QString name;
- QString divClass;
- QString singularMember;
- QString pluralMember;
- QMultiMap<QString, Node *> memberMap;
- QMultiMap<QString, Node *> reimpMemberMap;
- ClassMapList classMapList_;
- QList<QPair<InnerNode *, int> > inherited;
-
- FastSection(const InnerNode *parent,
- const QString& name0,
- const QString& divClass0,
- const QString& singularMember0,
- const QString& pluralMember0)
- : parent_(parent),
- name(name0),
- divClass(divClass0),
- singularMember(singularMember0),
- pluralMember(pluralMember0) { }
- ~FastSection();
- bool isEmpty() const {
- return (memberMap.isEmpty() &&
- inherited.isEmpty() &&
- reimpMemberMap.isEmpty() &&
- classMapList_.isEmpty());
- }
-
-};
-
-class CodeMarker
-{
-public:
- enum SynopsisStyle { Summary, Detailed, Subpage, Accessors };
- enum Status { Compat, Obsolete, Okay };
-
- CodeMarker();
- virtual ~CodeMarker();
-
- virtual void initializeMarker(const Config& config);
- virtual void terminateMarker();
- virtual bool recognizeCode(const QString& code) = 0;
- virtual bool recognizeExtension(const QString& ext) = 0;
- virtual bool recognizeLanguage(const QString& lang) = 0;
- virtual Atom::Type atomType() const = 0;
- virtual QString markedUpCode(const QString& code,
- const Node *relative,
- const Location &location) = 0;
- virtual QString markedUpSynopsis(const Node *node,
- const Node *relative,
- SynopsisStyle style) = 0;
- virtual QString markedUpQmlItem(const Node* , bool) { return QString(); }
- virtual QString markedUpName(const Node *node) = 0;
- virtual QString markedUpFullName(const Node *node,
- const Node *relative = 0) = 0;
- virtual QString markedUpEnumValue(const QString &enumValue,
- const Node *relative) = 0;
- virtual QString markedUpIncludes(const QStringList& includes) = 0;
- virtual QString functionBeginRegExp(const QString& funcName) = 0;
- virtual QString functionEndRegExp(const QString& funcName) = 0;
- virtual QList<Section> sections(const InnerNode *inner,
- SynopsisStyle style,
- Status status) = 0;
- virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
- SynopsisStyle style,
- Status status = Okay);
- virtual QStringList macRefsForNode(Node* node);
-
- static void initialize(const Config& config);
- static void terminate();
- static CodeMarker *markerForCode(const QString& code);
- static CodeMarker *markerForFileName(const QString& fileName);
- static CodeMarker *markerForLanguage(const QString& lang);
- static const Node *nodeForString(const QString& string);
- static QString stringForNode(const Node *node);
-
- QString typified(const QString &string);
-
-protected:
- virtual QString sortName(const Node *node, const QString* name = 0);
- QString protect(const QString &string);
- QString taggedNode(const Node* node);
- QString taggedQmlNode(const Node* node);
- QString linkTag(const Node *node, const QString& body);
- void insert(FastSection &fastSection,
- Node *node,
- SynopsisStyle style,
- Status status);
- bool insertReimpFunc(FastSection& fs, Node* node, Status status);
- void append(QList<Section>& sectionList, const FastSection& fastSection, bool includeKeys = false);
-
-private:
- QString macName(const Node *parent, const QString &name = QString());
-
- static QString defaultLang;
- static QList<CodeMarker *> markers;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
deleted file mode 100644
index a99a446cc2..0000000000
--- a/src/tools/qdoc/codeparser.cpp
+++ /dev/null
@@ -1,459 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- codeparser.cpp
-*/
-
-#include "codeparser.h"
-#include "node.h"
-#include "tree.h"
-#include "config.h"
-#include "generator.h"
-#include "qdocdatabase.h"
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-#define COMMAND_COMPAT Doc::alias(QLatin1String("compat"))
-#define COMMAND_DEPRECATED Doc::alias(QLatin1String("deprecated")) // ### don't document
-#define COMMAND_INGROUP Doc::alias(QLatin1String("ingroup"))
-#define COMMAND_INMODULE Doc::alias(QLatin1String("inmodule")) // ### don't document
-#define COMMAND_INQMLMODULE Doc::alias(QLatin1String("inqmlmodule"))
-#define COMMAND_INJSMODULE Doc::alias(QLatin1String("injsmodule"))
-#define COMMAND_INTERNAL Doc::alias(QLatin1String("internal"))
-#define COMMAND_MAINCLASS Doc::alias(QLatin1String("mainclass"))
-#define COMMAND_NONREENTRANT Doc::alias(QLatin1String("nonreentrant"))
-#define COMMAND_OBSOLETE Doc::alias(QLatin1String("obsolete"))
-#define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords"))
-#define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary"))
-#define COMMAND_INPUBLICGROUP Doc::alias(QLatin1String("inpublicgroup"))
-#define COMMAND_QTVARIABLE Doc::alias(QLatin1String("qtvariable"))
-#define COMMAND_REENTRANT Doc::alias(QLatin1String("reentrant"))
-#define COMMAND_SINCE Doc::alias(QLatin1String("since"))
-#define COMMAND_SUBTITLE Doc::alias(QLatin1String("subtitle"))
-#define COMMAND_THREADSAFE Doc::alias(QLatin1String("threadsafe"))
-#define COMMAND_TITLE Doc::alias(QLatin1String("title"))
-#define COMMAND_WRAPPER Doc::alias(QLatin1String("wrapper"))
-
-QList<CodeParser *> CodeParser::parsers;
-bool CodeParser::showInternal_ = false;
-bool CodeParser::singleExec_ = false;
-
-/*!
- The constructor adds this code parser to the static
- list of code parsers.
- */
-CodeParser::CodeParser()
-{
- qdb_ = QDocDatabase::qdocDB();
- parsers.prepend(this);
-}
-
-/*!
- The destructor removes this code parser from the static
- list of code parsers.
- */
-CodeParser::~CodeParser()
-{
- parsers.removeAll(this);
-}
-
-/*!
- Initialize the code parser base class.
- */
-void CodeParser::initializeParser(const Config& config)
-{
- showInternal_ = config.getBool(CONFIG_SHOWINTERNAL);
- singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
-}
-
-/*!
- Terminating a code parser is trivial.
- */
-void CodeParser::terminateParser()
-{
- // nothing.
-}
-
-QStringList CodeParser::headerFileNameFilter()
-{
- return sourceFileNameFilter();
-}
-
-void CodeParser::parseHeaderFile(const Location& location, const QString& filePath)
-{
- parseSourceFile(location, filePath);
-}
-
-void CodeParser::doneParsingHeaderFiles()
-{
- doneParsingSourceFiles();
-}
-
-/*!
- All the code parsers in the static list are initialized here,
- after the qdoc configuration variables have been set.
- */
-void CodeParser::initialize(const Config& config)
-{
- QList<CodeParser *>::ConstIterator p = parsers.constBegin();
- while (p != parsers.constEnd()) {
- (*p)->initializeParser(config);
- ++p;
- }
-}
-
-/*!
- All the code parsers in the static list are terminated here.
- */
-void CodeParser::terminate()
-{
- QList<CodeParser *>::ConstIterator p = parsers.constBegin();
- while (p != parsers.constEnd()) {
- (*p)->terminateParser();
- ++p;
- }
-}
-
-CodeParser *CodeParser::parserForLanguage(const QString& language)
-{
- QList<CodeParser *>::ConstIterator p = parsers.constBegin();
- while (p != parsers.constEnd()) {
- if ((*p)->language() == language)
- return *p;
- ++p;
- }
- return 0;
-}
-
-CodeParser *CodeParser::parserForHeaderFile(const QString &filePath)
-{
- QString fileName = QFileInfo(filePath).fileName();
-
- QList<CodeParser *>::ConstIterator p = parsers.constBegin();
- while (p != parsers.constEnd()) {
-
- QStringList headerPatterns = (*p)->headerFileNameFilter();
- foreach (const QString &pattern, headerPatterns) {
- QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
- if (re.exactMatch(fileName))
- return *p;
- }
- ++p;
- }
- return 0;
-}
-
-CodeParser *CodeParser::parserForSourceFile(const QString &filePath)
-{
- QString fileName = QFileInfo(filePath).fileName();
-
- QList<CodeParser *>::ConstIterator p = parsers.constBegin();
- while (p != parsers.constEnd()) {
-
- QStringList sourcePatterns = (*p)->sourceFileNameFilter();
- foreach (const QString &pattern, sourcePatterns) {
- QRegExp re(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
- if (re.exactMatch(fileName))
- return *p;
- }
- ++p;
- }
- return 0;
-}
-
-static QSet<QString> commonMetaCommands_;
-/*!
- Returns the set of strings representing the common metacommands.
- */
-const QSet<QString>& CodeParser::commonMetaCommands()
-{
- if (commonMetaCommands_.isEmpty()) {
- commonMetaCommands_ << COMMAND_COMPAT
- << COMMAND_DEPRECATED
- << COMMAND_INGROUP
- << COMMAND_INMODULE
- << COMMAND_INQMLMODULE
- << COMMAND_INTERNAL
- << COMMAND_MAINCLASS
- << COMMAND_NONREENTRANT
- << COMMAND_OBSOLETE
- << COMMAND_PAGEKEYWORDS
- << COMMAND_PRELIMINARY
- << COMMAND_INPUBLICGROUP
- << COMMAND_QTVARIABLE
- << COMMAND_REENTRANT
- << COMMAND_SINCE
- << COMMAND_SUBTITLE
- << COMMAND_THREADSAFE
- << COMMAND_TITLE
- << COMMAND_WRAPPER
- << COMMAND_INJSMODULE;
- }
- return commonMetaCommands_;
-}
-
-/*!
- The topic command has been processed. Now process the other
- metacommands that were found. These are not the text markup
- commands.
- */
-void CodeParser::processCommonMetaCommand(const Location& location,
- const QString& command,
- const ArgLocPair& arg,
- Node* node)
-{
- if (command == COMMAND_COMPAT) {
- location.warning(tr("\\compat command used, but Qt3 compatibility is no longer supported"));
- node->setStatus(Node::Compat);
- }
- else if (command == COMMAND_DEPRECATED) {
- node->setStatus(Node::Obsolete);
- }
- else if ((command == COMMAND_INGROUP) || (command == COMMAND_INPUBLICGROUP)) {
- // Note: \ingroup and \inpublicgroup are now the same.
- // Not that they were ever different.
- qdb_->addToGroup(arg.first, node);
- }
- else if (command == COMMAND_INMODULE) {
- qdb_->addToModule(arg.first,node);
- }
- else if (command == COMMAND_INQMLMODULE) {
- qdb_->addToQmlModule(arg.first,node);
- }
- else if (command == COMMAND_INJSMODULE) {
- qdb_->addToJsModule(arg.first, node);
- }
- else if (command == COMMAND_MAINCLASS) {
- node->doc().location().warning(tr("'\\mainclass' is deprecated. Consider '\\ingroup mainclasses'"));
- }
- else if (command == COMMAND_OBSOLETE) {
- node->setStatus(Node::Obsolete);
- }
- else if (command == COMMAND_NONREENTRANT) {
- node->setThreadSafeness(Node::NonReentrant);
- }
- else if (command == COMMAND_PRELIMINARY) {
- node->setStatus(Node::Preliminary);
- }
- else if (command == COMMAND_INTERNAL) {
- if (!showInternal_) {
- node->setAccess(Node::Private);
- node->setStatus(Node::Internal);
- if (node->type() == Node::QmlPropertyGroup) {
- const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(node);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- (*p)->setAccess(Node::Private);
- (*p)->setStatus(Node::Internal);
- }
- ++p;
- }
- }
- }
- }
- else if (command == COMMAND_REENTRANT) {
- node->setThreadSafeness(Node::Reentrant);
- }
- else if (command == COMMAND_SINCE) {
- node->setSince(arg.first);
- }
- else if (command == COMMAND_WRAPPER) {
- node->setWrapper();
- }
- else if (command == COMMAND_PAGEKEYWORDS) {
- node->addPageKeywords(arg.first);
- }
- else if (command == COMMAND_THREADSAFE) {
- node->setThreadSafeness(Node::ThreadSafe);
- }
- else if (command == COMMAND_TITLE) {
- node->setTitle(arg.first);
- if (!node->isDocumentNode() && !node->isCollectionNode())
- location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
- else if (node->isExample())
- qdb_->addExampleNode(static_cast<ExampleNode*>(node));
- }
- else if (command == COMMAND_SUBTITLE) {
- node->setSubTitle(arg.first);
- if (!node->isDocumentNode() && !node->isCollectionNode())
- location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
- }
- else if (command == COMMAND_QTVARIABLE) {
- node->setQtVariable(arg.first);
- if (!node->isModule() && !node->isQmlModule())
- location.warning(tr("Command '\\%1' is only meanigfule in '\\module' and '\\qmlmodule'.")
- .arg(COMMAND_QTVARIABLE));
- }
-}
-
-/*!
- \internal
- */
-void CodeParser::extractPageLinkAndDesc(const QString& arg,
- QString* link,
- QString* desc)
-{
- QRegExp bracedRegExp(QLatin1String("\\{([^{}]*)\\}(?:\\{([^{}]*)\\})?"));
-
- if (bracedRegExp.exactMatch(arg)) {
- *link = bracedRegExp.cap(1);
- *desc = bracedRegExp.cap(2);
- if (desc->isEmpty())
- *desc = *link;
- }
- else {
- int spaceAt = arg.indexOf(QLatin1Char(' '));
- if (arg.contains(QLatin1String(".html")) && spaceAt != -1) {
- *link = arg.leftRef(spaceAt).trimmed().toString();
- *desc = arg.midRef(spaceAt).trimmed().toString();
- }
- else {
- *link = arg;
- *desc = arg;
- }
- }
-}
-
-/*!
- \internal
- */
-void CodeParser::setLink(Node* node, Node::LinkType linkType, const QString& arg)
-{
- QString link;
- QString desc;
- extractPageLinkAndDesc(arg, &link, &desc);
- node->setLink(linkType, link, desc);
-}
-
-/*!
- Returns \c true if the file being parsed is a .h file.
- */
-bool CodeParser::isParsingH() const
-{
- return currentFile_.endsWith(".h");
-}
-
-/*!
- Returns \c true if the file being parsed is a .cpp file.
- */
-bool CodeParser::isParsingCpp() const
-{
- return currentFile_.endsWith(".cpp");
-}
-
-/*!
- Returns \c true if the file being parsed is a .qdoc file.
- */
-bool CodeParser::isParsingQdoc() const
-{
- return currentFile_.endsWith(".qdoc");
-}
-
-/*!
- For each node that will produce a documentation page, this function
- ensures that the node belongs to a module. Normally, the qdoc comment
- for an entity that will produce a documentation page will contain an
- \inmodule command to tell qdoc which module the entity belongs to.
-
- But now we normally run qdoc on each module in two passes. The first
- produces an index file; the second pass generates the docs after
- reading all the index files it needs.
-
- This means that all the pages generated during each pass 2 run of
- qdoc almost certainly belong to a single module, and the name of
- that module is, as a rule, used as the project name in the qdocconf
- file used when running qdoc on the module.
-
- So this function first asks if the node \a n has a non-empty module
- name. If it it does not have a non-empty module name, it sets the
- module name to be the project name.
-
- In some cases it prints a qdoc warning that it has done this. Namely,
- for C++ classes and namespaces.
- */
-void CodeParser::checkModuleInclusion(Node* n)
-{
- if (n->physicalModuleName().isEmpty()) {
- n->setPhysicalModuleName(Generator::defaultModuleName());
- switch (n->type()) {
- case Node::Class:
- if (n->access() != Node::Private && !n->doc().isEmpty()) {
- n->doc().location().warning(tr("Class %1 has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->name()).arg(Generator::defaultModuleName()));
- }
- break;
- case Node::Namespace:
- if (n->access() != Node::Private && !n->name().isEmpty() && !n->doc().isEmpty()) {
- n->doc().location().warning(tr("Namespace %1 has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->name()).arg(Generator::defaultModuleName()));
- }
- break;
-#if 0
- case Node::Document:
- if (n->access() != Node::Private && !n->doc().isEmpty()) {
- if (n->subType() == Node::HeaderFile) {
-#if 0
- n->doc().location().warning(tr("Header file with title \"%1\" has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->title()).arg(Generator::defaultModuleName()));
-#endif
- }
- else if (n->subType() == Node::Page) {
-#if 0
- n->doc().location().warning(tr("Page with title \"%1\" has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->title()).arg(Generator::defaultModuleName()));
-#endif
- }
- else if (n->subType() == Node::Example) {
-#if 0
- n->doc().location().warning(tr("Example with title \"%1\" has no \\inmodule command; "
- "using project name by default: %2")
- .arg(n->title()).arg(Generator::defaultModuleName()));
-#endif
- }
- }
- break;
-#endif
- default:
- break;
- }
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/codeparser.h b/src/tools/qdoc/codeparser.h
deleted file mode 100644
index 379deb7e23..0000000000
--- a/src/tools/qdoc/codeparser.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 CODEPARSER_H
-#define CODEPARSER_H
-
-#include <qset.h>
-#include "node.h"
-
-QT_BEGIN_NAMESPACE
-
-class Config;
-class Node;
-class QString;
-class QDocDatabase;
-
-class CodeParser
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::CodeParser)
-
-public:
- CodeParser();
- virtual ~CodeParser();
-
- virtual void initializeParser(const Config& config);
- virtual void terminateParser();
- virtual QString language() = 0;
- virtual QStringList headerFileNameFilter();
- virtual QStringList sourceFileNameFilter() = 0;
- virtual void parseHeaderFile(const Location& location, const QString& filePath);
- virtual void parseSourceFile(const Location& location, const QString& filePath) = 0;
- virtual void doneParsingHeaderFiles();
- virtual void doneParsingSourceFiles() = 0;
-
- bool isParsingH() const;
- bool isParsingCpp() const;
- bool isParsingQdoc() const;
- const QString& currentFile() const { return currentFile_; }
- void checkModuleInclusion(Node* n);
-
- static void initialize(const Config& config);
- static void terminate();
- static CodeParser *parserForLanguage(const QString& language);
- static CodeParser *parserForHeaderFile(const QString &filePath);
- static CodeParser *parserForSourceFile(const QString &filePath);
- static void setLink(Node* node, Node::LinkType linkType, const QString& arg);
-
-protected:
- const QSet<QString>& commonMetaCommands();
- void processCommonMetaCommand(const Location& location,
- const QString& command,
- const ArgLocPair& arg,
- Node *node);
- static void extractPageLinkAndDesc(const QString& arg,
- QString* link,
- QString* desc);
- QString currentFile_;
- QDocDatabase* qdb_;
-
-private:
- static QList<CodeParser *> parsers;
- static bool showInternal_;
- static bool singleExec_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp
deleted file mode 100644
index 606bb1c619..0000000000
--- a/src/tools/qdoc/config.cpp
+++ /dev/null
@@ -1,1215 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- config.cpp
-*/
-
-#include <qdir.h>
-#include <qvariant.h>
-#include <qfile.h>
-#include <qtemporaryfile.h>
-#include <qtextstream.h>
-#include <qdebug.h>
-#include "config.h"
-#include "generator.h"
-#include <stdlib.h>
-
-QT_BEGIN_NAMESPACE
-
-QString ConfigStrings::ALIAS = QStringLiteral("alias");
-QString ConfigStrings::AUTOLINKERRORS = QStringLiteral("autolinkerrors");
-QString ConfigStrings::BASE = QStringLiteral("base");
-QString ConfigStrings::BASEDIR = QStringLiteral("basedir");
-QString ConfigStrings::BUILDVERSION = QStringLiteral("buildversion");
-QString ConfigStrings::CODEINDENT = QStringLiteral("codeindent");
-QString ConfigStrings::CPPCLASSESPAGE = QStringLiteral("cppclassespage");
-QString ConfigStrings::DEFINES = QStringLiteral("defines");
-QString ConfigStrings::DEPENDS = QStringLiteral("depends");
-QString ConfigStrings::DESCRIPTION = QStringLiteral("description");
-QString ConfigStrings::EDITION = QStringLiteral("edition");
-QString ConfigStrings::ENDHEADER = QStringLiteral("endheader");
-QString ConfigStrings::EXAMPLEDIRS = QStringLiteral("exampledirs");
-QString ConfigStrings::EXAMPLES = QStringLiteral("examples");
-QString ConfigStrings::EXAMPLESINSTALLPATH = QStringLiteral("examplesinstallpath");
-QString ConfigStrings::EXCLUDEDIRS = QStringLiteral("excludedirs");
-QString ConfigStrings::EXCLUDEFILES = QStringLiteral("excludefiles");
-QString ConfigStrings::EXTRAIMAGES = QStringLiteral("extraimages");
-QString ConfigStrings::FALSEHOODS = QStringLiteral("falsehoods");
-QString ConfigStrings::FORMATTING = QStringLiteral("formatting");
-QString ConfigStrings::GENERATEINDEX = QStringLiteral("generateindex");
-QString ConfigStrings::HEADERDIRS = QStringLiteral("headerdirs");
-QString ConfigStrings::HEADERS = QStringLiteral("headers");
-QString ConfigStrings::HEADERSCRIPTS = QStringLiteral("headerscripts");
-QString ConfigStrings::HEADERSTYLES = QStringLiteral("headerstyles");
-QString ConfigStrings::HOMEPAGE = QStringLiteral("homepage");
-QString ConfigStrings::IGNOREDIRECTIVES = QStringLiteral("ignoredirectives");
-QString ConfigStrings::IGNORETOKENS = QStringLiteral("ignoretokens");
-QString ConfigStrings::IMAGEDIRS = QStringLiteral("imagedirs");
-QString ConfigStrings::IMAGES = QStringLiteral("images");
-QString ConfigStrings::INDEXES = QStringLiteral("indexes");
-QString ConfigStrings::LANDINGPAGE = QStringLiteral("landingpage");
-QString ConfigStrings::LANGUAGE = QStringLiteral("language");
-QString ConfigStrings::MACRO = QStringLiteral("macro");
-QString ConfigStrings::MANIFESTMETA = QStringLiteral("manifestmeta");
-QString ConfigStrings::NATURALLANGUAGE = QStringLiteral("naturallanguage");
-QString ConfigStrings::NAVIGATION = QStringLiteral("navigation");
-QString ConfigStrings::NOLINKERRORS = QStringLiteral("nolinkerrors");
-QString ConfigStrings::OBSOLETELINKS = QStringLiteral("obsoletelinks");
-QString ConfigStrings::OUTPUTDIR = QStringLiteral("outputdir");
-QString ConfigStrings::OUTPUTENCODING = QStringLiteral("outputencoding");
-QString ConfigStrings::OUTPUTLANGUAGE = QStringLiteral("outputlanguage");
-QString ConfigStrings::OUTPUTFORMATS = QStringLiteral("outputformats");
-QString ConfigStrings::OUTPUTPREFIXES = QStringLiteral("outputprefixes");
-QString ConfigStrings::PROJECT = QStringLiteral("project");
-QString ConfigStrings::REDIRECTDOCUMENTATIONTODEVNULL = QStringLiteral("redirectdocumentationtodevnull");
-QString ConfigStrings::QHP = QStringLiteral("qhp");
-QString ConfigStrings::QUOTINGINFORMATION = QStringLiteral("quotinginformation");
-QString ConfigStrings::SCRIPTDIRS = QStringLiteral("scriptdirs");
-QString ConfigStrings::SCRIPTS = QStringLiteral("scripts");
-QString ConfigStrings::SHOWINTERNAL = QStringLiteral("showinternal");
-QString ConfigStrings::SINGLEEXEC = QStringLiteral("singleexec");
-QString ConfigStrings::SOURCEDIRS = QStringLiteral("sourcedirs");
-QString ConfigStrings::SOURCEENCODING = QStringLiteral("sourceencoding");
-QString ConfigStrings::SOURCES = QStringLiteral("sources");
-QString ConfigStrings::SPURIOUS = QStringLiteral("spurious");
-QString ConfigStrings::STYLEDIRS = QStringLiteral("styledirs");
-QString ConfigStrings::STYLE = QStringLiteral("style");
-QString ConfigStrings::STYLES = QStringLiteral("styles");
-QString ConfigStrings::STYLESHEETS = QStringLiteral("stylesheets");
-QString ConfigStrings::SYNTAXHIGHLIGHTING = QStringLiteral("syntaxhighlighting");
-QString ConfigStrings::TEMPLATEDIR = QStringLiteral("templatedir");
-QString ConfigStrings::TABSIZE = QStringLiteral("tabsize");
-QString ConfigStrings::TAGFILE = QStringLiteral("tagfile");
-QString ConfigStrings::TRANSLATORS = QStringLiteral("translators");
-QString ConfigStrings::URL = QStringLiteral("url");
-QString ConfigStrings::VERSION = QStringLiteral("version");
-QString ConfigStrings::VERSIONSYM = QStringLiteral("versionsym");
-QString ConfigStrings::FILEEXTENSIONS = QStringLiteral("fileextensions");
-QString ConfigStrings::IMAGEEXTENSIONS = QStringLiteral("imageextensions");
-QString ConfigStrings::QMLONLY = QStringLiteral("qmlonly");
-QString ConfigStrings::QMLTYPESPAGE = QStringLiteral("qmltypespage");
-QString ConfigStrings::WRITEQAPAGES = QStringLiteral("writeqapages");
-
-/*!
- An entry in a stack, where each entry is a list
- of string values.
- */
-class MetaStackEntry
-{
-public:
- void open();
- void close();
-
- QStringList accum;
- QStringList next;
-};
-
-/*!
- Start accumulating values in a list by appending an empty
- string to the list.
- */
-void MetaStackEntry::open()
-{
- next.append(QString());
-}
-
-/*!
- Stop accumulating values and append the list of accumulated
- values to the complete list of accumulated values.
-
- */
-void MetaStackEntry::close()
-{
- accum += next;
- next.clear();
-}
-
-/*!
- \class MetaStack
-
- This class maintains a stack of values of config file variables.
-*/
-class MetaStack : private QStack<MetaStackEntry>
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::MetaStack)
-
-public:
- MetaStack();
-
- void process(QChar ch, const Location& location);
- QStringList getExpanded(const Location& location);
-};
-
-/*!
- The default constructor pushes a new stack entry and
- opens it.
- */
-MetaStack::MetaStack()
-{
- push(MetaStackEntry());
- top().open();
-}
-
-/*!
- Processes the character \a ch using the \a location.
- It really just builds up a name by appending \a ch to
- it.
- */
-void MetaStack::process(QChar ch, const Location& location)
-{
- if (ch == QLatin1Char('{')) {
- push(MetaStackEntry());
- top().open();
- } else if (ch == QLatin1Char('}')) {
- if (count() == 1)
- location.fatal(tr("Unexpected '}'"));
-
- top().close();
- QStringList suffixes = pop().accum;
- QStringList prefixes = top().next;
-
- top().next.clear();
- QStringList::ConstIterator pre = prefixes.constBegin();
- while (pre != prefixes.constEnd()) {
- QStringList::ConstIterator suf = suffixes.constBegin();
- while (suf != suffixes.constEnd()) {
- top().next << (*pre + *suf);
- ++suf;
- }
- ++pre;
- }
- } else if (ch == QLatin1Char(',') && count() > 1) {
- top().close();
- top().open();
- } else {
- /*
- This is where all the processing is done.
- */
- QStringList::Iterator pre = top().next.begin();
- while (pre != top().next.end()) {
- *pre += ch;
- ++pre;
- }
- }
-}
-
-/*!
- Returns the accumulated string values.
- */
-QStringList MetaStack::getExpanded(const Location& location)
-{
- if (count() > 1)
- location.fatal(tr("Missing '}'"));
-
- top().close();
- return top().accum;
-}
-
-const QString Config::dot = QLatin1String(".");
-bool Config::debug_ = false;
-bool Config::generateExamples = true;
-QString Config::overrideOutputDir;
-QString Config::installDir;
-QSet<QString> Config::overrideOutputFormats;
-QMap<QString, QString> Config::extractedDirs;
-int Config::numInstances;
-QStack<QString> Config::workingDirs_;
-QMap<QString, QStringList> Config::includeFilesMap_;
-
-/*!
- \class Config
- \brief The Config class contains the configuration variables
- for controlling how qdoc produces documentation.
-
- Its load() function, reads, parses, and processes a qdocconf file.
- */
-
-/*!
- The constructor sets the \a programName and initializes all
- internal state variables to empty values.
- */
-Config::Config(const QString& programName)
- : prog(programName)
-{
- loc = Location::null;
- lastLocation_ = Location::null;
- configVars_.clear();
- numInstances++;
- includeFilesMap_.clear();
-}
-
-/*!
- The destructor has nothing special to do.
- */
-Config::~Config()
-{
- includeFilesMap_.clear();
-}
-
-/*!
- Loads and parses the qdoc configuration file \a fileName.
- This function calls the other load() function, which does
- the loading, parsing, and processing of the configuration
- file.
-
- Intializes the location variables returned by location()
- and lastLocation().
- */
-void Config::load(const QString& fileName)
-{
- load(Location::null, fileName);
- if (loc.isEmpty())
- loc = Location(fileName);
- else
- loc.setEtc(true);
- lastLocation_ = Location::null;
-}
-
-/*!
- Joins all the strings in \a values into a single string with the
- individual \a values separated by ' '. Then it inserts the result
- into the string list map with \a var as the key.
-
- It also inserts the \a values string list into a separate map,
- also with \a var as the key.
- */
-void Config::setStringList(const QString& var, const QStringList& values)
-{
- configVars_.insert(var,ConfigVar(var, values, QDir::currentPath()));
-}
-
-/*!
- Looks up the configuarion variable \a var in the string
- map and returns the boolean value.
- */
-bool Config::getBool(const QString& var) const
-{
- return QVariant(getString(var)).toBool();
-}
-
-/*!
- Looks up the configuration variable \a var in the string list
- map. Iterates through the string list found, interpreting each
- string in the list as an integer and adding it to a total sum.
- Returns the sum or \c -1 if \a var is not set.
- */
-int Config::getInt(const QString& var) const
-{
- QStringList strs = getStringList(var);
- if (strs.isEmpty())
- return -1;
-
- QStringList::ConstIterator s = strs.constBegin();
- int sum = 0;
-
- while (s != strs.constEnd()) {
- sum += (*s).toInt();
- ++s;
- }
- return sum;
-}
-
-/*!
- Function to return the correct outputdir.
- outputdir can be set using the qdocconf or the command-line
- variable -outputdir.
- */
-QString Config::getOutputDir() const
-{
- QString t;
- if (overrideOutputDir.isNull())
- t = getString(CONFIG_OUTPUTDIR);
- else
- t = overrideOutputDir;
- if (Generator::singleExec()) {
- QString project = getString(CONFIG_PROJECT);
- t += QLatin1Char('/') + project.toLower();
- }
- if (!Generator::useOutputSubdirs()) {
- t = t.left(t.lastIndexOf('/'));
- QString singleOutputSubdir = getString("HTML.outputsubdir");
- if (singleOutputSubdir.isEmpty())
- singleOutputSubdir = "html";
- t += QLatin1Char('/') + singleOutputSubdir;
- }
- return t;
-}
-
-/*!
- Function to return the correct outputformats.
- outputformats can be set using the qdocconf or the command-line
- variable -outputformat.
- */
-QSet<QString> Config::getOutputFormats() const
-{
- if (overrideOutputFormats.isEmpty())
- return getStringSet(CONFIG_OUTPUTFORMATS);
- else
- return overrideOutputFormats;
-}
-
-/*!
- First, this function looks up the configuration variable \a var
- in the location map and, if found, sets the internal variable
- \c{lastLocation_} to the Location that \a var maps to.
-
- Then it looks up the configuration variable \a var in the string
- map and returns the string that \a var maps to.
- */
-QString Config::getString(const QString& var) const
-{
- QList<ConfigVar> configVars = configVars_.values(var);
- QString value;
- if (!configVars.empty()) {
- int i = configVars.size() - 1;
- while (i >= 0) {
- const ConfigVar& cv = configVars[i];
- if (!cv.location_.isEmpty())
- const_cast<Config *>(this)->lastLocation_ = cv.location_;
- if (!cv.values_.isEmpty()) {
- if (!cv.plus_)
- value.clear();
- for (int j=0; j<cv.values_.size(); ++j) {
- if (!value.isEmpty() && !value.endsWith(QChar('\n')))
- value.append(QChar(' '));
- value.append(cv.values_[j]);
- }
- }
- --i;
- }
- }
- return value;
-}
-
-/*!
- Looks up the configuration variable \a var in the string
- list map, converts the string list it maps to into a set
- of strings, and returns the set.
- */
-QSet<QString> Config::getStringSet(const QString& var) const
-{
- return QSet<QString>::fromList(getStringList(var));
-}
-
-/*!
- First, this function looks up the configuration variable \a var
- in the location map. If found, it sets the internal variable
- \c{lastLocation_} to the Location that \a var maps to.
-
- Then it looks up the configuration variable \a var in the map of
- configuration variable records. If found, it gets a list of all
- the records for \a var. Then it appends all the values for \a var
- to a list and returns the list. As it appends the values from each
- record, if the \a var used '=' instead of '+=' the list is cleared
- before the values are appended. \note '+=' should always be used.
- The final list is returned.
- */
-QStringList Config::getStringList(const QString& var) const
-{
- QList<ConfigVar> configVars = configVars_.values(var);
- QStringList values;
- if (!configVars.empty()) {
- int i = configVars.size() - 1;
- while (i >= 0) {
- if (!configVars[i].location_.isEmpty())
- const_cast<Config *>(this)->lastLocation_ = configVars[i].location_;
- if (configVars[i].plus_)
- values.append(configVars[i].values_);
- else
- values = configVars[i].values_;
- --i;
- }
- }
- return values;
-}
-
-/*!
- Returns the a path list where all paths from the config variable \a var
- are canonicalized. If \a validate is true, a warning for invalid paths is
- generated.
-
- First, this function looks up the configuration variable \a var
- in the location map and, if found, sets the internal variable
- \c{lastLocation_} the Location that \a var maps to.
-
- Then it looks up the configuration variable \a var in the string
- list map, which maps to one or more records that each contains a
- list of file paths.
-
- \sa Location::canonicalRelativePath()
- */
-QStringList Config::getCanonicalPathList(const QString& var, bool validate) const
-{
- QStringList t;
- QList<ConfigVar> configVars = configVars_.values(var);
- if (!configVars.empty()) {
- int i = configVars.size() - 1;
- while (i >= 0) {
- const ConfigVar& cv = configVars[i];
- if (!cv.location_.isEmpty())
- const_cast<Config *>(this)->lastLocation_ = cv.location_;
- if (!cv.plus_)
- t.clear();
- const QString d = cv.currentPath_;
- const QStringList& sl = cv.values_;
- if (!sl.isEmpty()) {
- t.reserve(t.size() + sl.size());
- for (int i=0; i<sl.size(); ++i) {
- QDir dir(sl[i].simplified());
- QString path = dir.path();
- if (dir.isRelative())
- dir.setPath(d + "/" + path);
- if (validate && !QFileInfo::exists(dir.path()))
- lastLocation_.warning(tr("Cannot find file or directory: %1").arg(path));
- else
- t.append(dir.canonicalPath());
- }
- }
- --i;
- }
- }
- return t;
-}
-
-/*!
- Calls getRegExpList() with the control variable \a var and
- iterates through the resulting list of regular expressions,
- concatening them with some extras characters to form a single
- QRegExp, which is returned/
-
- \sa getRegExpList()
- */
-QRegExp Config::getRegExp(const QString& var) const
-{
- QString pattern;
- QList<QRegExp> subRegExps = getRegExpList(var);
- QList<QRegExp>::ConstIterator s = subRegExps.constBegin();
-
- while (s != subRegExps.constEnd()) {
- if (!(*s).isValid())
- return *s;
- if (!pattern.isEmpty())
- pattern += QLatin1Char('|');
- pattern += QLatin1String("(?:") + (*s).pattern() + QLatin1Char(')');
- ++s;
- }
- if (pattern.isEmpty())
- pattern = QLatin1String("$x"); // cannot match
- return QRegExp(pattern);
-}
-
-/*!
- Looks up the configuration variable \a var in the string list
- map, converts the string list to a list of regular expressions,
- and returns it.
- */
-QList<QRegExp> Config::getRegExpList(const QString& var) const
-{
- QStringList strs = getStringList(var);
- QStringList::ConstIterator s = strs.constBegin();
- QList<QRegExp> regExps;
-
- while (s != strs.constEnd()) {
- regExps += QRegExp(*s);
- ++s;
- }
- return regExps;
-}
-
-/*!
- This function is slower than it could be. What it does is
- find all the keys that begin with \a var + dot and return
- the matching keys in a set, stripped of the matching prefix
- and dot.
- */
-QSet<QString> Config::subVars(const QString& var) const
-{
- QSet<QString> result;
- QString varDot = var + QLatin1Char('.');
- ConfigVarMultimap::ConstIterator i = configVars_.constBegin();
- while (i != configVars_.constEnd()) {
- if (i.key().startsWith(varDot)) {
- QString subVar = i.key().mid(varDot.length());
- int dot = subVar.indexOf(QLatin1Char('.'));
- if (dot != -1)
- subVar.truncate(dot);
- if (!result.contains(subVar))
- result.insert(subVar);
- }
- ++i;
- }
- return result;
-}
-
-/*!
- Same as subVars(), but in this case we return a config var
- multimap with the matching keys (stripped of the prefix \a var
- and mapped to their values. The pairs are inserted into \a t
- */
-void Config::subVarsAndValues(const QString& var, ConfigVarMultimap& t) const
-{
- QString varDot = var + QLatin1Char('.');
- ConfigVarMultimap::ConstIterator v = configVars_.constBegin();
- while (v != configVars_.constEnd()) {
- if (v.key().startsWith(varDot)) {
- QString subVar = v.key().mid(varDot.length());
- int dot = subVar.indexOf(QLatin1Char('.'));
- if (dot != -1)
- subVar.truncate(dot);
- t.insert(subVar,v.value());
- }
- ++v;
- }
-}
-
-/*!
- Get all .qdocinc files.
- */
-QString Config::getIncludeFilePath(const QString& fileName) const
-{
- QString ext = fileName.mid(fileName.lastIndexOf('.'));
- ext.prepend('*');
-
- if (!includeFilesMap_.contains(ext)) {
- QSet<QString> t;
- QStringList result;
- QStringList dirs = getCanonicalPathList(CONFIG_SOURCEDIRS);
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, ext, location(), t, t);
- ++d;
- }
- includeFilesMap_.insert(ext, result);
- }
- const QStringList& paths = (*includeFilesMap_.find(ext));
- for (int i=0; i<paths.size(); ++i) {
- if (paths[i].endsWith(fileName))
- return paths[i];
- }
- return QString();
-}
-
-/*!
- Builds and returns a list of file pathnames for the file
- type specified by \a filesVar (e.g. "headers" or "sources").
- The files are found in the directories specified by
- \a dirsVar, and they are filtered by \a defaultNameFilter
- if a better filter can't be constructed from \a filesVar.
- The directories in \a excludedDirs are avoided. The files
- in \a excludedFiles are not included in the return list.
- */
-QStringList Config::getAllFiles(const QString &filesVar,
- const QString &dirsVar,
- const QSet<QString> &excludedDirs,
- const QSet<QString> &excludedFiles)
-{
- QStringList result = getCanonicalPathList(filesVar);
- QStringList dirs = getCanonicalPathList(dirsVar);
-
- QString nameFilter = getString(filesVar + dot + CONFIG_FILEEXTENSIONS);
-
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, nameFilter, location(), excludedDirs, excludedFiles);
- ++d;
- }
- return result;
-}
-
-QStringList Config::getExampleQdocFiles(const QSet<QString> &excludedDirs,
- const QSet<QString> &excludedFiles)
-{
- QStringList result;
- QStringList dirs = getCanonicalPathList("exampledirs");
- QString nameFilter = " *.qdoc";
-
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, nameFilter, location(), excludedDirs, excludedFiles);
- ++d;
- }
- return result;
-}
-
-QStringList Config::getExampleImageFiles(const QSet<QString> &excludedDirs,
- const QSet<QString> &excludedFiles)
-{
- QStringList result;
- QStringList dirs = getCanonicalPathList("exampledirs");
- QString nameFilter = getString(CONFIG_EXAMPLES + dot + CONFIG_IMAGEEXTENSIONS);
-
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- result += getFilesHere(*d, nameFilter, location(), excludedDirs, excludedFiles);
- ++d;
- }
- return result;
-}
-
-/*!
- \a fileName is the path of the file to find.
-
- \a files and \a dirs are the lists where we must find the
- components of \a fileName.
-
- \a location is used for obtaining the file and line numbers
- for report qdoc errors.
- */
-QString Config::findFile(const Location& location,
- const QStringList& files,
- const QStringList& dirs,
- const QString& fileName,
- QString& userFriendlyFilePath)
-{
- if (fileName.isEmpty() || fileName.startsWith(QLatin1Char('/'))) {
- userFriendlyFilePath = fileName;
- return fileName;
- }
-
- QFileInfo fileInfo;
- QStringList components = fileName.split(QLatin1Char('?'));
- QString firstComponent = components.first();
-
- QStringList::ConstIterator f = files.constBegin();
- while (f != files.constEnd()) {
- if (*f == firstComponent ||
- (*f).endsWith(QLatin1Char('/') + firstComponent)) {
- fileInfo.setFile(*f);
- if (!fileInfo.exists())
- location.fatal(tr("File '%1' does not exist").arg(*f));
- break;
- }
- ++f;
- }
-
- if (fileInfo.fileName().isEmpty()) {
- QStringList::ConstIterator d = dirs.constBegin();
- while (d != dirs.constEnd()) {
- fileInfo.setFile(QDir(*d), firstComponent);
- if (fileInfo.exists())
- break;
- ++d;
- }
- }
-
- userFriendlyFilePath = QString();
- if (!fileInfo.exists())
- return QString();
-
- QStringList::ConstIterator c = components.constBegin();
- for (;;) {
- bool isArchive = (c != components.constEnd() - 1);
- QString userFriendly = *c;
-
- userFriendlyFilePath += userFriendly;
-
- if (isArchive) {
- QString extracted = extractedDirs[fileInfo.filePath()];
- ++c;
- fileInfo.setFile(QDir(extracted), *c);
- } else {
- break;
- }
-
- userFriendlyFilePath += QLatin1Char('?');
- }
- return fileInfo.filePath();
-}
-
-/*!
- */
-QString Config::findFile(const Location& location,
- const QStringList& files,
- const QStringList& dirs,
- const QString& fileBase,
- const QStringList& fileExtensions,
- QString& userFriendlyFilePath)
-{
- QStringList::ConstIterator e = fileExtensions.constBegin();
- while (e != fileExtensions.constEnd()) {
- QString filePath = findFile(location,
- files,
- dirs,
- fileBase + QLatin1Char('.') + *e,
- userFriendlyFilePath);
- if (!filePath.isEmpty())
- return filePath;
- ++e;
- }
- return findFile(location, files, dirs, fileBase, userFriendlyFilePath);
-}
-
-/*!
- Copies the \a sourceFilePath to the file name constructed by
- concatenating \a targetDirPath and the file name from the
- \a userFriendlySourceFilePath. \a location is for identifying
- the file and line number where a qdoc error occurred. The
- constructed output file name is returned.
- */
-QString Config::copyFile(const Location& location,
- const QString& sourceFilePath,
- const QString& userFriendlySourceFilePath,
- const QString& targetDirPath)
-{
- QFile inFile(sourceFilePath);
- if (!inFile.open(QFile::ReadOnly)) {
- location.warning(tr("Cannot open input file for copy: '%1': %2")
- .arg(sourceFilePath).arg(inFile.errorString()));
- return QString();
- }
-
- QString outFileName = userFriendlySourceFilePath;
- int slash = outFileName.lastIndexOf(QLatin1Char('/'));
- if (slash != -1)
- outFileName = outFileName.mid(slash);
- if ((outFileName.size()) > 0 && (outFileName[0] != '/'))
- outFileName = targetDirPath + QLatin1Char('/') + outFileName;
- else
- outFileName = targetDirPath + outFileName;
- QFile outFile(outFileName);
- if (!outFile.open(QFile::WriteOnly)) {
- location.warning(tr("Cannot open output file for copy: '%1': %2")
- .arg(outFileName).arg(outFile.errorString()));
- return QString();
- }
-
- char buffer[1024];
- int len;
- while ((len = inFile.read(buffer, sizeof(buffer))) > 0)
- outFile.write(buffer, len);
- return outFileName;
-}
-
-/*!
- Finds the largest unicode digit in \a value in the range
- 1..7 and returns it.
- */
-int Config::numParams(const QString& value)
-{
- int max = 0;
- for (int i = 0; i != value.length(); i++) {
- uint c = value[i].unicode();
- if (c > 0 && c < 8)
- max = qMax(max, (int)c);
- }
- return max;
-}
-
-/*!
- Removes everything from \a dir. This function is recursive.
- It doesn't remove \a dir itself, but if it was called
- recursively, then the caller will remove \a dir.
- */
-bool Config::removeDirContents(const QString& dir)
-{
- QDir dirInfo(dir);
- QFileInfoList entries = dirInfo.entryInfoList();
-
- bool ok = true;
-
- QFileInfoList::Iterator it = entries.begin();
- while (it != entries.end()) {
- if ((*it).isFile()) {
- if (!dirInfo.remove((*it).fileName()))
- ok = false;
- }
- else if ((*it).isDir()) {
- if ((*it).fileName() != QLatin1String(".") && (*it).fileName() != QLatin1String("..")) {
- if (removeDirContents((*it).absoluteFilePath())) {
- if (!dirInfo.rmdir((*it).fileName()))
- ok = false;
- }
- else {
- ok = false;
- }
- }
- }
- ++it;
- }
- return ok;
-}
-
-/*!
- Returns \c true if \a ch is a letter, number, '_', '.',
- '{', '}', or ','.
- */
-bool Config::isMetaKeyChar(QChar ch)
-{
- return ch.isLetterOrNumber()
- || ch == QLatin1Char('_')
- || ch == QLatin1Char('.')
- || ch == QLatin1Char('{')
- || ch == QLatin1Char('}')
- || ch == QLatin1Char(',');
-}
-
-/*!
- \a fileName is a master qdocconf file. It contains a list of
- qdocconf files and nothing else. Read the list and return it.
- */
-QStringList Config::loadMaster(const QString& fileName)
-{
- Location location = Location::null;
- QFile fin(fileName);
- if (!fin.open(QFile::ReadOnly | QFile::Text)) {
- if (!Config::installDir.isEmpty()) {
- int prefix = location.filePath().length() - location.fileName().length();
- fin.setFileName(Config::installDir + "/" + fileName.right(fileName.length() - prefix));
- }
- if (!fin.open(QFile::ReadOnly | QFile::Text))
- location.fatal(tr("Cannot open master qdocconf file '%1': %2").arg(fileName).arg(fin.errorString()));
- }
- QTextStream stream(&fin);
-#ifndef QT_NO_TEXTCODEC
- stream.setCodec("UTF-8");
-#endif
- QStringList qdocFiles;
- QString line = stream.readLine();
- while (!line.isNull()) {
- qdocFiles.append(line);
- line = stream.readLine();
- }
- fin.close();
- return qdocFiles;
-}
-
-/*!
- Load, parse, and process a qdoc configuration file. This
- function is only called by the other load() function, but
- this one is recursive, i.e., it calls itself when it sees
- an \c{include} statement in the qdoc configuration file.
- */
-void Config::load(Location location, const QString& fileName)
-{
- pushWorkingDir(QFileInfo(fileName).path());
- QDir::setCurrent(QFileInfo(fileName).path());
- QRegExp keySyntax(QLatin1String("\\w+(?:\\.\\w+)*"));
-
-#define SKIP_CHAR() \
- do { \
- location.advance(c); \
- ++i; \
- c = text.at(i); \
- cc = c.unicode(); \
-} while (0)
-
-#define SKIP_SPACES() \
- while (c.isSpace() && cc != '\n') \
- SKIP_CHAR()
-
-#define PUT_CHAR() \
- word += c; \
- SKIP_CHAR();
-
- if (location.depth() > 16)
- location.fatal(tr("Too many nested includes"));
-
- QFile fin(fileName);
- if (!fin.open(QFile::ReadOnly | QFile::Text)) {
- if (!Config::installDir.isEmpty()) {
- int prefix = location.filePath().length() - location.fileName().length();
- fin.setFileName(Config::installDir + "/" + fileName.right(fileName.length() - prefix));
- }
- if (!fin.open(QFile::ReadOnly | QFile::Text))
- location.fatal(tr("Cannot open file '%1': %2").arg(fileName).arg(fin.errorString()));
- }
-
- QTextStream stream(&fin);
-#ifndef QT_NO_TEXTCODEC
- stream.setCodec("UTF-8");
-#endif
- QString text = stream.readAll();
- text += QLatin1String("\n\n");
- text += QLatin1Char('\0');
- fin.close();
-
- location.push(fileName);
- location.start();
-
- int i = 0;
- QChar c = text.at(0);
- uint cc = c.unicode();
- while (i < (int) text.length()) {
- if (cc == 0) {
- ++i;
- } else if (c.isSpace()) {
- SKIP_CHAR();
- } else if (cc == '#') {
- do {
- SKIP_CHAR();
- } while (cc != '\n');
- } else if (isMetaKeyChar(c)) {
- Location keyLoc = location;
- bool plus = false;
- QString stringValue;
- QStringList rhsValues;
- QString word;
- bool inQuote = false;
- bool prevWordQuoted = true;
- bool metWord = false;
-
- MetaStack stack;
- do {
- stack.process(c, location);
- SKIP_CHAR();
- } while (isMetaKeyChar(c));
-
- QStringList keys = stack.getExpanded(location);
- SKIP_SPACES();
-
- if (keys.count() == 1 && keys.first() == QLatin1String("include")) {
- QString includeFile;
-
- if (cc != '(')
- location.fatal(tr("Bad include syntax"));
- SKIP_CHAR();
- SKIP_SPACES();
-
- while (!c.isSpace() && cc != '#' && cc != ')') {
-
- if (cc == '$') {
- QString var;
- SKIP_CHAR();
- while (c.isLetterOrNumber() || cc == '_') {
- var += c;
- SKIP_CHAR();
- }
- if (!var.isEmpty()) {
- const QByteArray val = qgetenv(var.toLatin1().data());
- if (val.isNull()) {
- location.fatal(tr("Environment variable '%1' undefined").arg(var));
- }
- else {
- includeFile += QString::fromLatin1(val);
- }
- }
- } else {
- includeFile += c;
- SKIP_CHAR();
- }
- }
- SKIP_SPACES();
- if (cc != ')')
- location.fatal(tr("Bad include syntax"));
- SKIP_CHAR();
- SKIP_SPACES();
- if (cc != '#' && cc != '\n')
- location.fatal(tr("Trailing garbage"));
-
- /*
- Here is the recursive call.
- */
- load(location, QFileInfo(QFileInfo(fileName).dir(), includeFile).filePath());
- }
- else {
- /*
- It wasn't an include statement, so it's something else.
- We must see either '=' or '+=' next. If not, fatal error.
- */
- if (cc == '+') {
- plus = true;
- SKIP_CHAR();
- }
- if (cc != '=')
- location.fatal(tr("Expected '=' or '+=' after key"));
- SKIP_CHAR();
- SKIP_SPACES();
-
- for (;;) {
- if (cc == '\\') {
- int metaCharPos;
-
- SKIP_CHAR();
- if (cc == '\n') {
- SKIP_CHAR();
- }
- else if (cc > '0' && cc < '8') {
- word += QChar(c.digitValue());
- SKIP_CHAR();
- }
- else if ((metaCharPos = QString::fromLatin1("abfnrtv").indexOf(c)) != -1) {
- word += QLatin1Char("\a\b\f\n\r\t\v"[metaCharPos]);
- SKIP_CHAR();
- }
- else {
- PUT_CHAR();
- }
- }
- else if (c.isSpace() || cc == '#') {
- if (inQuote) {
- if (cc == '\n')
- location.fatal(tr("Unterminated string"));
- PUT_CHAR();
- }
- else {
- if (!word.isEmpty()) {
- if (metWord)
- stringValue += QLatin1Char(' ');
- stringValue += word;
-#if 0
- if (metWord)
- rhsValues << QString(" " + word);
- else
-#endif
- rhsValues << word;
- metWord = true;
- word.clear();
- prevWordQuoted = false;
- }
- if (cc == '\n' || cc == '#')
- break;
- SKIP_SPACES();
- }
- }
- else if (cc == '"') {
- if (inQuote) {
- if (!prevWordQuoted)
- stringValue += QLatin1Char(' ');
- stringValue += word;
- if (!word.isEmpty())
- rhsValues << word;
- metWord = true;
- word.clear();
- prevWordQuoted = true;
- }
- inQuote = !inQuote;
- SKIP_CHAR();
- }
- else if (cc == '$') {
- QString var;
- SKIP_CHAR();
- while (c.isLetterOrNumber() || cc == '_') {
- var += c;
- SKIP_CHAR();
- }
- if (!var.isEmpty()) {
- const QByteArray val = qgetenv(var.toLatin1().constData());
- if (val.isNull()) {
- location.fatal(tr("Environment variable '%1' undefined").arg(var));
- }
- else {
- word += QString::fromLatin1(val);
- }
- }
- }
- else {
- if (!inQuote && cc == '=')
- location.fatal(tr("Unexpected '='"));
- PUT_CHAR();
- }
- }
-
- QStringList::ConstIterator key = keys.constBegin();
- while (key != keys.constEnd()) {
- if (!keySyntax.exactMatch(*key))
- keyLoc.fatal(tr("Invalid key '%1'").arg(*key));
-
- ConfigVarMultimap::Iterator i;
- i = configVars_.insert(*key, ConfigVar(*key, rhsValues, QDir::currentPath(), keyLoc));
- i.value().plus_ = plus;
- ++key;
- }
- }
- } else {
- location.fatal(tr("Unexpected character '%1' at beginning of line").arg(c));
- }
- }
- popWorkingDir();
- if (!workingDirs_.isEmpty())
- QDir::setCurrent(workingDirs_.top());
-}
-
-QStringList Config::getFilesHere(const QString& uncleanDir,
- const QString& nameFilter,
- const Location &location,
- const QSet<QString> &excludedDirs,
- const QSet<QString> &excludedFiles)
-{
- QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : QDir(uncleanDir).canonicalPath();
- QStringList result;
- if (excludedDirs.contains(dir))
- return result;
-
- QDir dirInfo(dir);
- QStringList fileNames;
- QStringList::const_iterator fn;
-
- dirInfo.setNameFilters(nameFilter.split(QLatin1Char(' ')));
- dirInfo.setSorting(QDir::Name);
- dirInfo.setFilter(QDir::Files);
- fileNames = dirInfo.entryList();
- fn = fileNames.constBegin();
- while (fn != fileNames.constEnd()) {
- if (!fn->startsWith(QLatin1Char('~'))) {
- QString s = dirInfo.filePath(*fn);
- QString c = QDir::cleanPath(s);
- if (!excludedFiles.contains(c))
- result.append(c);
- }
- ++fn;
- }
-
- dirInfo.setNameFilters(QStringList(QLatin1String("*")));
- dirInfo.setFilter(QDir::Dirs|QDir::NoDotAndDotDot);
- fileNames = dirInfo.entryList();
- fn = fileNames.constBegin();
- while (fn != fileNames.constEnd()) {
- result += getFilesHere(dirInfo.filePath(*fn), nameFilter, location, excludedDirs, excludedFiles);
- ++fn;
- }
- return result;
-}
-
-/*!
- Push \a dir onto the stack of working directories.
- */
-void Config::pushWorkingDir(const QString& dir)
-{
- workingDirs_.push(dir);
-}
-
-/*!
- If the stack of working directories is not empty, pop the
- top entry and return it. Otherwise return an empty string.
- */
-QString Config::popWorkingDir()
-{
- if (!workingDirs_.isEmpty())
- return workingDirs_.pop();
-
- qDebug() << "RETURNED EMPTY WORKING DIR";
- return QString();
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/config.h b/src/tools/qdoc/config.h
deleted file mode 100644
index 802bcf929d..0000000000
--- a/src/tools/qdoc/config.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- config.h
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <qmap.h>
-#include <qset.h>
-#include <qstringlist.h>
-#include <qstack.h>
-#include <qpair.h>
-#include "location.h"
-
-QT_BEGIN_NAMESPACE
-
-/*
- This struct contains all the information for
- one config variable found in a qdocconf file.
- */
-struct ConfigVar {
- bool plus_;
- QString name_;
- QStringList values_;
- QString currentPath_;
- Location location_;
-
- ConfigVar() : plus_(false) { }
-
- ConfigVar(const QString& name, const QStringList& values, const QString& dir)
- : plus_(true), name_(name), values_(values), currentPath_(dir) { }
-
- ConfigVar(const QString& name, const QStringList& values, const QString& dir, const Location& loc)
- : plus_(false), name_(name), values_(values), currentPath_(dir), location_(loc) { }
-};
-
-/*
- In this multimap, the key is a config variable name.
- */
-typedef QMultiMap<QString, ConfigVar> ConfigVarMultimap;
-
-class Config
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Config)
-
-public:
- Config(const QString& programName);
- ~Config();
-
- static bool debug_;
-
- void load(const QString& fileName);
- void setStringList(const QString& var, const QStringList& values);
-
- const QString& programName() const { return prog; }
- const Location& location() const { return loc; }
- const Location& lastLocation() const { return lastLocation_; }
- bool getBool(const QString& var) const;
- int getInt(const QString& var) const;
- QString getOutputDir() const;
- QSet<QString> getOutputFormats() const;
- QString getString(const QString& var) const;
- QSet<QString> getStringSet(const QString& var) const;
- QStringList getStringList(const QString& var) const;
- QStringList getCanonicalPathList(const QString& var, bool validate = false) const;
- QRegExp getRegExp(const QString& var) const;
- QList<QRegExp> getRegExpList(const QString& var) const;
- QSet<QString> subVars(const QString& var) const;
- void subVarsAndValues(const QString& var, ConfigVarMultimap& t) const;
- QStringList getAllFiles(const QString& filesVar,
- const QString& dirsVar,
- const QSet<QString> &excludedDirs = QSet<QString>(),
- const QSet<QString> &excludedFiles = QSet<QString>());
- QString getIncludeFilePath(const QString& fileName) const;
- QStringList getExampleQdocFiles(const QSet<QString> &excludedDirs, const QSet<QString> &excludedFiles);
- QStringList getExampleImageFiles(const QSet<QString> &excludedDirs, const QSet<QString> &excludedFiles);
-
- static QStringList loadMaster(const QString& fileName);
- static QStringList getFilesHere(const QString& dir,
- const QString& nameFilter,
- const Location &location = Location(),
- const QSet<QString> &excludedDirs = QSet<QString>(),
- const QSet<QString> &excludedFiles = QSet<QString>());
- static QString findFile(const Location& location,
- const QStringList &files,
- const QStringList& dirs,
- const QString& fileName,
- QString& userFriendlyFilePath);
- static QString findFile(const Location &location,
- const QStringList &files,
- const QStringList &dirs,
- const QString &fileBase,
- const QStringList &fileExtensions,
- QString &userFriendlyFilePath);
- static QString copyFile(const Location& location,
- const QString& sourceFilePath,
- const QString& userFriendlySourceFilePath,
- const QString& targetDirPath);
- static int numParams(const QString& value);
- static bool removeDirContents(const QString& dir);
- static void pushWorkingDir(const QString& dir);
- static QString popWorkingDir();
-
- static const QString dot;
-
- static bool generateExamples;
- static QString installDir;
- static QString overrideOutputDir;
- static QSet<QString> overrideOutputFormats;
-
-private:
- static bool isMetaKeyChar(QChar ch);
- void load(Location location, const QString& fileName);
-
- QString prog;
- Location loc;
- Location lastLocation_;
- ConfigVarMultimap configVars_;
-
- static QMap<QString, QString> uncompressedFiles;
- static QMap<QString, QString> extractedDirs;
- static int numInstances;
- static QStack<QString> workingDirs_;
- static QMap<QString, QStringList> includeFilesMap_;
-};
-
-struct ConfigStrings
-{
- static QString ALIAS;
- static QString AUTOLINKERRORS;
- static QString BASE;
- static QString BASEDIR;
- static QString BUILDVERSION;
- static QString CODEINDENT;
- static QString CPPCLASSESPAGE;
- static QString DEFINES;
- static QString DEPENDS;
- static QString DESCRIPTION;
- static QString EDITION;
- static QString ENDHEADER;
- static QString EXAMPLEDIRS;
- static QString EXAMPLES;
- static QString EXAMPLESINSTALLPATH;
- static QString EXCLUDEDIRS;
- static QString EXCLUDEFILES;
- static QString EXTRAIMAGES;
- static QString FALSEHOODS;
- static QString FORMATTING;
- static QString GENERATEINDEX;
- static QString HEADERDIRS;
- static QString HEADERS;
- static QString HEADERSCRIPTS;
- static QString HEADERSTYLES;
- static QString HOMEPAGE;
- static QString IGNOREDIRECTIVES;
- static QString IGNORETOKENS;
- static QString IMAGEDIRS;
- static QString IMAGES;
- static QString INDEXES;
- static QString LANDINGPAGE;
- static QString LANGUAGE;
- static QString MACRO;
- static QString MANIFESTMETA;
- static QString NATURALLANGUAGE;
- static QString NAVIGATION;
- static QString NOLINKERRORS;
- static QString OBSOLETELINKS;
- static QString OUTPUTDIR;
- static QString OUTPUTENCODING;
- static QString OUTPUTLANGUAGE;
- static QString OUTPUTFORMATS;
- static QString OUTPUTPREFIXES;
- static QString PROJECT;
- static QString REDIRECTDOCUMENTATIONTODEVNULL;
- static QString QHP;
- static QString QUOTINGINFORMATION;
- static QString SCRIPTDIRS;
- static QString SCRIPTS;
- static QString SHOWINTERNAL;
- static QString SINGLEEXEC;
- static QString SOURCEDIRS;
- static QString SOURCEENCODING;
- static QString SOURCES;
- static QString SPURIOUS;
- static QString STYLEDIRS;
- static QString STYLE;
- static QString STYLES;
- static QString STYLESHEETS;
- static QString SYNTAXHIGHLIGHTING;
- static QString TEMPLATEDIR;
- static QString TABSIZE;
- static QString TAGFILE;
- static QString TRANSLATORS;
- static QString URL;
- static QString VERSION;
- static QString VERSIONSYM;
- static QString FILEEXTENSIONS;
- static QString IMAGEEXTENSIONS;
- static QString QMLONLY;
- static QString QMLTYPESPAGE;
- static QString WRITEQAPAGES;
-};
-
-#define CONFIG_ALIAS ConfigStrings::ALIAS
-#define CONFIG_AUTOLINKERRORS ConfigStrings::AUTOLINKERRORS
-#define CONFIG_BASE ConfigStrings::BASE
-#define CONFIG_BASEDIR ConfigStrings::BASEDIR
-#define CONFIG_BUILDVERSION ConfigStrings::BUILDVERSION
-#define CONFIG_CODEINDENT ConfigStrings::CODEINDENT
-#define CONFIG_CPPCLASSESPAGE ConfigStrings::CPPCLASSESPAGE
-#define CONFIG_DEFINES ConfigStrings::DEFINES
-#define CONFIG_DEPENDS ConfigStrings::DEPENDS
-#define CONFIG_DESCRIPTION ConfigStrings::DESCRIPTION
-#define CONFIG_EDITION ConfigStrings::EDITION
-#define CONFIG_ENDHEADER ConfigStrings::ENDHEADER
-#define CONFIG_EXAMPLEDIRS ConfigStrings::EXAMPLEDIRS
-#define CONFIG_EXAMPLES ConfigStrings::EXAMPLES
-#define CONFIG_EXAMPLESINSTALLPATH ConfigStrings::EXAMPLESINSTALLPATH
-#define CONFIG_EXCLUDEDIRS ConfigStrings::EXCLUDEDIRS
-#define CONFIG_EXCLUDEFILES ConfigStrings::EXCLUDEFILES
-#define CONFIG_EXTRAIMAGES ConfigStrings::EXTRAIMAGES
-#define CONFIG_FALSEHOODS ConfigStrings::FALSEHOODS
-#define CONFIG_FORMATTING ConfigStrings::FORMATTING
-#define CONFIG_GENERATEINDEX ConfigStrings::GENERATEINDEX
-#define CONFIG_HEADERDIRS ConfigStrings::HEADERDIRS
-#define CONFIG_HEADERS ConfigStrings::HEADERS
-#define CONFIG_HEADERSCRIPTS ConfigStrings::HEADERSCRIPTS
-#define CONFIG_HEADERSTYLES ConfigStrings::HEADERSTYLES
-#define CONFIG_HOMEPAGE ConfigStrings::HOMEPAGE
-#define CONFIG_IGNOREDIRECTIVES ConfigStrings::IGNOREDIRECTIVES
-#define CONFIG_IGNORETOKENS ConfigStrings::IGNORETOKENS
-#define CONFIG_IMAGEDIRS ConfigStrings::IMAGEDIRS
-#define CONFIG_IMAGES ConfigStrings::IMAGES
-#define CONFIG_INDEXES ConfigStrings::INDEXES
-#define CONFIG_LANDINGPAGE ConfigStrings::LANDINGPAGE
-#define CONFIG_LANGUAGE ConfigStrings::LANGUAGE
-#define CONFIG_MACRO ConfigStrings::MACRO
-#define CONFIG_MANIFESTMETA ConfigStrings::MANIFESTMETA
-#define CONFIG_NATURALLANGUAGE ConfigStrings::NATURALLANGUAGE
-#define CONFIG_NAVIGATION ConfigStrings::NAVIGATION
-#define CONFIG_NOLINKERRORS ConfigStrings::NOLINKERRORS
-#define CONFIG_OBSOLETELINKS ConfigStrings::OBSOLETELINKS
-#define CONFIG_OUTPUTDIR ConfigStrings::OUTPUTDIR
-#define CONFIG_OUTPUTENCODING ConfigStrings::OUTPUTENCODING
-#define CONFIG_OUTPUTLANGUAGE ConfigStrings::OUTPUTLANGUAGE
-#define CONFIG_OUTPUTFORMATS ConfigStrings::OUTPUTFORMATS
-#define CONFIG_OUTPUTPREFIXES ConfigStrings::OUTPUTPREFIXES
-#define CONFIG_PROJECT ConfigStrings::PROJECT
-#define CONFIG_REDIRECTDOCUMENTATIONTODEVNULL ConfigStrings::REDIRECTDOCUMENTATIONTODEVNULL
-#define CONFIG_QHP ConfigStrings::QHP
-#define CONFIG_QUOTINGINFORMATION ConfigStrings::QUOTINGINFORMATION
-#define CONFIG_SCRIPTDIRS ConfigStrings::SCRIPTDIRS
-#define CONFIG_SCRIPTS ConfigStrings::SCRIPTS
-#define CONFIG_SHOWINTERNAL ConfigStrings::SHOWINTERNAL
-#define CONFIG_SINGLEEXEC ConfigStrings::SINGLEEXEC
-#define CONFIG_SOURCEDIRS ConfigStrings::SOURCEDIRS
-#define CONFIG_SOURCEENCODING ConfigStrings::SOURCEENCODING
-#define CONFIG_SOURCES ConfigStrings::SOURCES
-#define CONFIG_SPURIOUS ConfigStrings::SPURIOUS
-#define CONFIG_STYLEDIRS ConfigStrings::STYLEDIRS
-#define CONFIG_STYLE ConfigStrings::STYLE
-#define CONFIG_STYLES ConfigStrings::STYLES
-#define CONFIG_STYLESHEETS ConfigStrings::STYLESHEETS
-#define CONFIG_SYNTAXHIGHLIGHTING ConfigStrings::SYNTAXHIGHLIGHTING
-#define CONFIG_TEMPLATEDIR ConfigStrings::TEMPLATEDIR
-#define CONFIG_TABSIZE ConfigStrings::TABSIZE
-#define CONFIG_TAGFILE ConfigStrings::TAGFILE
-#define CONFIG_TRANSLATORS ConfigStrings::TRANSLATORS
-#define CONFIG_URL ConfigStrings::URL
-#define CONFIG_VERSION ConfigStrings::VERSION
-#define CONFIG_VERSIONSYM ConfigStrings::VERSIONSYM
-#define CONFIG_FILEEXTENSIONS ConfigStrings::FILEEXTENSIONS
-#define CONFIG_IMAGEEXTENSIONS ConfigStrings::IMAGEEXTENSIONS
-#define CONFIG_QMLONLY ConfigStrings::QMLONLY
-#define CONFIG_QMLTYPESPAGE ConfigStrings::QMLTYPESPAGE
-#define CONFIG_WRITEQAPAGES ConfigStrings::WRITEQAPAGES
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
deleted file mode 100644
index 4c1e84fe3c..0000000000
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ /dev/null
@@ -1,1326 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- cppcodemarker.cpp
-*/
-
-#include "atom.h"
-#include "cppcodemarker.h"
-#include "node.h"
-#include "text.h"
-#include "tree.h"
-#include <qdebug.h>
-#include <ctype.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- The constructor does nothing.
- */
-CppCodeMarker::CppCodeMarker()
-{
- // nothing.
-}
-
-/*!
- The destructor does nothing.
- */
-CppCodeMarker::~CppCodeMarker()
-{
- // nothing.
-}
-
-/*!
- Returns \c true.
- */
-bool CppCodeMarker::recognizeCode(const QString & /* code */)
-{
- return true;
-}
-
-/*!
- Returns \c true if \a ext is any of a list of file extensions
- for the C++ language.
- */
-bool CppCodeMarker::recognizeExtension(const QString& extension)
-{
- QByteArray ext = extension.toLatin1();
- return ext == "c" ||
- ext == "c++" ||
- ext == "qdoc" ||
- ext == "qtt" ||
- ext == "qtx" ||
- ext == "cc" ||
- ext == "cpp" ||
- ext == "cxx" ||
- ext == "ch" ||
- ext == "h" ||
- ext == "h++" ||
- ext == "hh" ||
- ext == "hpp" ||
- ext == "hxx";
-}
-
-/*!
- Returns \c true if \a lang is either "C" or "Cpp".
- */
-bool CppCodeMarker::recognizeLanguage(const QString &lang)
-{
- return lang == QLatin1String("C") || lang == QLatin1String("Cpp");
-}
-
-/*!
- Returns the type of atom used to represent C++ code in the documentation.
-*/
-Atom::Type CppCodeMarker::atomType() const
-{
- return Atom::Code;
-}
-
-QString CppCodeMarker::markedUpCode(const QString &code,
- const Node *relative,
- const Location &location)
-{
- return addMarkUp(code, relative, location);
-}
-
-QString CppCodeMarker::markedUpSynopsis(const Node *node,
- const Node * /* relative */,
- SynopsisStyle style)
-{
- const int MaxEnumValues = 6;
- const FunctionNode *func;
- const PropertyNode *property;
- const VariableNode *variable;
- const EnumNode *enume;
- const TypedefNode *typedeff;
- QString synopsis;
- QString extra;
- QString name;
-
- name = taggedNode(node);
- if (style != Detailed)
- name = linkTag(node, name);
- name = "<@name>" + name + "</@name>";
-
- if ((style == Detailed) && !node->parent()->name().isEmpty() &&
- (node->type() != Node::Property) && !node->isQmlNode() && !node->isJsNode())
- name.prepend(taggedNode(node->parent()) + "::");
-
- switch (node->type()) {
- case Node::Namespace:
- synopsis = "namespace " + name;
- break;
- case Node::Class:
- synopsis = "class " + name;
- break;
- case Node::Function:
- case Node::QmlSignal:
- case Node::QmlSignalHandler:
- case Node::QmlMethod:
- func = (const FunctionNode *) node;
- if (style != Subpage && !func->returnType().isEmpty())
- synopsis = typified(func->returnType()) + QLatin1Char(' ');
- synopsis += name;
- if (func->metaness() != FunctionNode::MacroWithoutParams) {
- synopsis += "(";
- if (!func->parameters().isEmpty()) {
- //synopsis += QLatin1Char(' ');
- QList<Parameter>::ConstIterator p = func->parameters().constBegin();
- while (p != func->parameters().constEnd()) {
- if (p != func->parameters().constBegin())
- synopsis += ", ";
- synopsis += typified((*p).leftType());
- if (style != Subpage && !(*p).name().isEmpty())
- synopsis +=
- "<@param>" + protect((*p).name()) + "</@param>";
- synopsis += protect((*p).rightType());
- if (style != Subpage && !(*p).defaultValue().isEmpty())
- synopsis += " = " + protect((*p).defaultValue());
- ++p;
- }
- //synopsis += QLatin1Char(' ');
- }
- synopsis += QLatin1Char(')');
- }
- if (func->isConst())
- synopsis += " const";
-
- if (style == Summary || style == Accessors) {
- if (func->virtualness() != FunctionNode::NonVirtual)
- synopsis.prepend("virtual ");
- if (func->virtualness() == FunctionNode::PureVirtual)
- synopsis.append(" = 0");
- }
- else if (style == Subpage) {
- if (!func->returnType().isEmpty() && func->returnType() != "void")
- synopsis += " : " + typified(func->returnType());
- }
- else {
- QStringList bracketed;
- if (func->isStatic()) {
- bracketed += "static";
- }
- else if (func->virtualness() != FunctionNode::NonVirtual) {
- if (func->virtualness() == FunctionNode::PureVirtual)
- bracketed += "pure";
- bracketed += "virtual";
- }
-
- if (func->access() == Node::Protected) {
- bracketed += "protected";
- }
- else if (func->access() == Node::Private) {
- bracketed += "private";
- }
-
- if (func->metaness() == FunctionNode::Signal) {
- bracketed += "signal";
- }
- else if (func->metaness() == FunctionNode::Slot) {
- bracketed += "slot";
- }
- if (!bracketed.isEmpty())
- extra += QLatin1Char('[') + bracketed.join(' ') + QStringLiteral("] ");
- }
- break;
- case Node::Enum:
- enume = static_cast<const EnumNode *>(node);
- synopsis = "enum " + name;
- if (style == Summary) {
- synopsis += " { ";
-
- QStringList documentedItems = enume->doc().enumItemNames();
- if (documentedItems.isEmpty()) {
- foreach (const EnumItem &item, enume->items())
- documentedItems << item.name();
- }
- QStringList omitItems = enume->doc().omitEnumItemNames();
- foreach (const QString &item, omitItems)
- documentedItems.removeAll(item);
-
- if (documentedItems.size() <= MaxEnumValues) {
- for (int i = 0; i < documentedItems.size(); ++i) {
- if (i != 0)
- synopsis += ", ";
- synopsis += documentedItems.at(i);
- }
- }
- else {
- for (int i = 0; i < documentedItems.size(); ++i) {
- if (i < MaxEnumValues-2 || i == documentedItems.size()-1) {
- if (i != 0)
- synopsis += ", ";
- synopsis += documentedItems.at(i);
- }
- else if (i == MaxEnumValues - 1) {
- synopsis += ", ...";
- }
- }
- }
- if (!documentedItems.isEmpty())
- synopsis += QLatin1Char(' ');
- synopsis += QLatin1Char('}');
- }
- break;
- case Node::Typedef:
- typedeff = static_cast<const TypedefNode *>(node);
- if (typedeff->associatedEnum()) {
- synopsis = "flags " + name;
- }
- else {
- synopsis = "typedef " + name;
- }
- break;
- case Node::Property:
- property = static_cast<const PropertyNode *>(node);
- synopsis = name + " : " + typified(property->qualifiedDataType());
- break;
- case Node::Variable:
- variable = static_cast<const VariableNode *>(node);
- if (style == Subpage) {
- synopsis = name + " : " + typified(variable->dataType());
- }
- else {
- synopsis = typified(variable->leftType()) + QLatin1Char(' ') +
- name + protect(variable->rightType());
- }
- break;
- default:
- synopsis = name;
- }
-
- if (style == Summary) {
- if (node->status() == Node::Preliminary) {
- extra += "(preliminary) ";
- }
- else if (node->status() == Node::Deprecated) {
- extra += "(deprecated) ";
- }
- else if (node->status() == Node::Obsolete) {
- extra += "(obsolete) ";
- }
- }
-
- if (!extra.isEmpty()) {
- extra.prepend("<@extra>");
- extra.append("</@extra>");
- }
- return extra + synopsis;
-}
-
-/*!
- */
-QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary)
-{
- QString name = taggedQmlNode(node);
- if (summary)
- name = linkTag(node,name);
- else if (node->isQmlProperty() || node->isJsProperty()) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
- if (pn->isAttached())
- name.prepend(pn->element() + QLatin1Char('.'));
- }
- name = "<@name>" + name + "</@name>";
- QString synopsis;
- if (node->isQmlProperty() || node->isJsProperty()) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node);
- synopsis = name + " : " + typified(pn->dataType());
- }
- else if ((node->type() == Node::QmlMethod) ||
- (node->type() == Node::QmlSignal) ||
- (node->type() == Node::QmlSignalHandler)) {
- const FunctionNode* func = static_cast<const FunctionNode*>(node);
- if (!func->returnType().isEmpty())
- synopsis = typified(func->returnType()) + QLatin1Char(' ') + name;
- else
- synopsis = name;
- synopsis += QLatin1Char('(');
- if (!func->parameters().isEmpty()) {
- QList<Parameter>::ConstIterator p = func->parameters().constBegin();
- while (p != func->parameters().constEnd()) {
- if (p != func->parameters().constBegin())
- synopsis += ", ";
- synopsis += typified((*p).leftType());
- if (!(*p).name().isEmpty()) {
- if (!synopsis.endsWith(QLatin1Char('(')))
- synopsis += QLatin1Char(' ');
- synopsis += "<@param>" + protect((*p).name()) + "</@param>";
- }
- synopsis += protect((*p).rightType());
- ++p;
- }
- }
- synopsis += QLatin1Char(')');
- }
- else
- synopsis = name;
-
- QString extra;
- if (summary) {
- if (node->status() == Node::Preliminary) {
- extra += " (preliminary)";
- }
- else if (node->status() == Node::Deprecated) {
- extra += " (deprecated)";
- }
- else if (node->status() == Node::Obsolete) {
- extra += " (obsolete)";
- }
- }
-
- if (!extra.isEmpty()) {
- extra.prepend("<@extra>");
- extra.append("</@extra>");
- }
- return synopsis + extra;
-}
-
-QString CppCodeMarker::markedUpName(const Node *node)
-{
- QString name = linkTag(node, taggedNode(node));
- if (node->type() == Node::Function)
- name += "()";
- return name;
-}
-
-QString CppCodeMarker::markedUpFullName(const Node *node, const Node *relative)
-{
- if (node->name().isEmpty()) {
- return "global";
- }
- else {
- QString fullName;
- for (;;) {
- fullName.prepend(markedUpName(node));
- if (node->parent() == relative || node->parent()->name().isEmpty())
- break;
- fullName.prepend("<@op>::</@op>");
- node = node->parent();
- }
- return fullName;
- }
-}
-
-QString CppCodeMarker::markedUpEnumValue(const QString &enumValue, const Node *relative)
-{
- if (relative->type() != Node::Enum)
- return enumValue;
-
- const Node *node = relative->parent();
- QString fullName;
- while (node->parent()) {
- fullName.prepend(markedUpName(node));
- if (node->parent() == relative || node->parent()->name().isEmpty())
- break;
- fullName.prepend("<@op>::</@op>");
- node = node->parent();
- }
- if (!fullName.isEmpty())
- fullName.append("<@op>::</@op>");
- fullName.append(enumValue);
- return fullName;
-}
-
-QString CppCodeMarker::markedUpIncludes(const QStringList& includes)
-{
- QString code;
-
- QStringList::ConstIterator inc = includes.constBegin();
- while (inc != includes.constEnd()) {
- code += "<@preprocessor>#include &lt;<@headerfile>" + *inc + "</@headerfile>&gt;</@preprocessor>\n";
- ++inc;
- }
- return code;
-}
-
-QString CppCodeMarker::functionBeginRegExp(const QString& funcName)
-{
- return QLatin1Char('^') + QRegExp::escape(funcName) + QLatin1Char('$');
-
-}
-
-QString CppCodeMarker::functionEndRegExp(const QString& /* funcName */)
-{
- return "^\\}$";
-}
-
-QList<Section> CppCodeMarker::sections(const InnerNode *inner,
- SynopsisStyle style,
- Status status)
-{
- QList<Section> sections;
-
- if (inner->isClass()) {
- if (style == Summary) {
- FastSection privateFunctions(inner,
- "Private Functions",
- QString(),
- "private function",
- "private functions");
- FastSection privateSlots(inner, "Private Slots", QString(), "private slot", "private slots");
- FastSection privateTypes(inner, "Private Types", QString(), "private type", "private types");
- FastSection protectedFunctions(inner,
- "Protected Functions",
- QString(),
- "protected function",
- "protected functions");
- FastSection protectedSlots(inner,
- "Protected Slots",
- QString(),
- "protected slot",
- "protected slots");
- FastSection protectedTypes(inner,
- "Protected Types",
- QString(),
- "protected type",
- "protected types");
- FastSection protectedVariables(inner,
- "Protected Variables",
- QString(),
- "protected type",
- "protected variables");
- FastSection publicFunctions(inner,
- "Public Functions",
- QString(),
- "public function",
- "public functions");
- FastSection publicSignals(inner, "Signals", QString(), "signal", "signals");
- FastSection publicSlots(inner, "Public Slots", QString(), "public slot", "public slots");
- FastSection publicTypes(inner, "Public Types", QString(), "public type", "public types");
- FastSection publicVariables(inner,
- "Public Variables",
- QString(),
- "public variable",
- "public variables");
- FastSection properties(inner, "Properties", QString(), "property", "properties");
- FastSection relatedNonMembers(inner,
- "Related Non-Members",
- QString(),
- "related non-member",
- "related non-members");
- FastSection staticPrivateMembers(inner,
- "Static Private Members",
- QString(),
- "static private member",
- "static private members");
- FastSection staticProtectedMembers(inner,
- "Static Protected Members",
- QString(),
- "static protected member",
- "static protected members");
- FastSection staticPublicMembers(inner,
- "Static Public Members",
- QString(),
- "static public member",
- "static public members");
- FastSection macros(inner, "Macros", QString(), "macro", "macros");
-
- NodeList::ConstIterator r = inner->relatedNodes().constBegin();
- while (r != inner->relatedNodes().constEnd()) {
- if ((*r)->type() == Node::Function) {
- FunctionNode *func = static_cast<FunctionNode *>(*r);
- if (func->isMacro())
- insert(macros, *r, style, status);
- else
- insert(relatedNonMembers, *r, style, status);
- }
- else {
- insert(relatedNonMembers, *r, style, status);
- }
- ++r;
- }
-
- QStack<const InnerNode *> stack;
- stack.push(inner);
- while (!stack.isEmpty()) {
- const InnerNode* ancestor = stack.pop();
-
- NodeList::ConstIterator c = ancestor->childNodes().constBegin();
- while (c != ancestor->childNodes().constEnd()) {
- bool isSlot = false;
- bool isSignal = false;
- bool isStatic = false;
- if ((*c)->type() == Node::Function) {
- const FunctionNode *func = (const FunctionNode *) *c;
- isSlot = (func->metaness() == FunctionNode::Slot);
- isSignal = (func->metaness() == FunctionNode::Signal);
- isStatic = func->isStatic();
- if (func->associatedProperty()) {
- if (func->associatedProperty()->status() == Node::Obsolete) {
- ++c;
- continue;
- }
- }
- }
- else if ((*c)->type() == Node::Variable) {
- const VariableNode *var = static_cast<const VariableNode *>(*c);
- isStatic = var->isStatic();
- }
-
- switch ((*c)->access()) {
- case Node::Public:
- if (isSlot) {
- insert(publicSlots, *c, style, status);
- }
- else if (isSignal) {
- insert(publicSignals, *c, style, status);
- }
- else if (isStatic) {
- if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
- insert(staticPublicMembers,*c,style,status);
- }
- else if ((*c)->type() == Node::Property) {
- insert(properties, *c, style, status);
- }
- else if ((*c)->type() == Node::Variable) {
- if (!(*c)->doc().isEmpty())
- insert(publicVariables, *c, style, status);
- }
- else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(publicFunctions,*c,status)) {
- insert(publicFunctions, *c, style, status);
- }
- }
- else {
- insert(publicTypes, *c, style, status);
- }
- break;
- case Node::Protected:
- if (isSlot) {
- insert(protectedSlots, *c, style, status);
- }
- else if (isStatic) {
- if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
- insert(staticProtectedMembers,*c,style,status);
- }
- else if ((*c)->type() == Node::Variable) {
- if (!(*c)->doc().isEmpty())
- insert(protectedVariables,*c,style,status);
- }
- else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(protectedFunctions,*c,status)) {
- insert(protectedFunctions, *c, style, status);
- }
- }
- else {
- insert(protectedTypes, *c, style, status);
- }
- break;
- case Node::Private:
- if (isSlot) {
- insert(privateSlots, *c, style, status);
- }
- else if (isStatic) {
- if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
- insert(staticPrivateMembers,*c,style,status);
- }
- else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(privateFunctions,*c,status)) {
- insert(privateFunctions, *c, style, status);
- }
- }
- else {
- insert(privateTypes,*c,style,status);
- }
- }
- ++c;
- }
-
- if (ancestor->isClass()) {
- const ClassNode* cn = static_cast<const ClassNode*>(ancestor);
- QList<RelatedClass>::ConstIterator r = cn->baseClasses().constBegin();
- while (r != cn->baseClasses().constEnd()) {
- if ((*r).node_)
- stack.prepend((*r).node_);
- ++r;
- }
- }
- }
- append(sections, publicTypes);
- append(sections, properties);
- append(sections, publicFunctions);
- append(sections, publicSlots);
- append(sections, publicSignals);
- append(sections, publicVariables);
- append(sections, staticPublicMembers);
- append(sections, protectedTypes);
- append(sections, protectedFunctions);
- append(sections, protectedSlots);
- append(sections, protectedVariables);
- append(sections, staticProtectedMembers);
- append(sections, privateTypes);
- append(sections, privateFunctions);
- append(sections, privateSlots);
- append(sections, staticPrivateMembers);
- append(sections, relatedNonMembers);
- append(sections, macros);
- }
- else if (style == Detailed) {
- FastSection memberFunctions(inner,"Member Function Documentation","func","member","members");
- FastSection memberTypes(inner,"Member Type Documentation","types","member","members");
- FastSection memberVariables(inner,"Member Variable Documentation","vars","member","members");
- FastSection properties(inner,"Property Documentation","prop","member","members");
- FastSection relatedNonMembers(inner,"Related Non-Members","relnonmem","member","members");
- FastSection macros(inner,"Macro Documentation","macros","member","members");
-
- NodeList::ConstIterator r = inner->relatedNodes().constBegin();
- while (r != inner->relatedNodes().constEnd()) {
- if ((*r)->type() == Node::Function) {
- FunctionNode *func = static_cast<FunctionNode *>(*r);
- if (func->isMacro())
- insert(macros, *r, style, status);
- else
- insert(relatedNonMembers, *r, style, status);
- }
- else {
- insert(relatedNonMembers, *r, style, status);
- }
- ++r;
- }
-
- NodeList::ConstIterator c = inner->childNodes().constBegin();
- while (c != inner->childNodes().constEnd()) {
- if ((*c)->type() == Node::Enum ||
- (*c)->type() == Node::Typedef) {
- insert(memberTypes, *c, style, status);
- }
- else if ((*c)->type() == Node::Property) {
- insert(properties, *c, style, status);
- }
- else if ((*c)->type() == Node::Variable) {
- if (!(*c)->doc().isEmpty())
- insert(memberVariables, *c, style, status);
- }
- else if ((*c)->type() == Node::Function) {
- FunctionNode *function = static_cast<FunctionNode *>(*c);
- if (!function->associatedProperty())
- insert(memberFunctions, function, style, status);
- }
- ++c;
- }
-
- append(sections, memberTypes);
- append(sections, properties);
- append(sections, memberFunctions);
- append(sections, memberVariables);
- append(sections, relatedNonMembers);
- append(sections, macros);
- }
- else {
- FastSection all(inner,QString(),QString(),"member","members");
-
- QStack<const InnerNode*> stack;
- stack.push(inner);
-
- while (!stack.isEmpty()) {
- const InnerNode* ancestor = stack.pop();
- NodeList::ConstIterator c = ancestor->childNodes().constBegin();
- while (c != ancestor->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private && (*c)->type() != Node::Property)
- insert(all, *c, style, status);
- ++c;
- }
-
- if (ancestor->isClass()) {
- const ClassNode* cn = static_cast<const ClassNode*>(ancestor);
- QList<RelatedClass>::ConstIterator r = cn->baseClasses().constBegin();
- while (r != cn->baseClasses().constEnd()) {
- if ((*r).node_)
- stack.prepend((*r).node_);
- ++r;
- }
- }
- }
- append(sections, all);
- }
- }
- else {
- if (style == Summary || style == Detailed) {
- FastSection namespaces(inner,
- "Namespaces",
- style == Detailed ? "nmspace" : QString(),
- "namespace",
- "namespaces");
- FastSection classes(inner,
- "Classes",
- style == Detailed ? "classes" : QString(),
- "class",
- "classes");
- FastSection types(inner,
- style == Summary ? "Types" : "Type Documentation",
- style == Detailed ? "types" : QString(),
- "type",
- "types");
- FastSection variables(inner,
- style == Summary ? "Variables" : "Variable Documentation",
- style == Detailed ? "vars" : QString(),
- "variable",
- "variables");
- FastSection staticVariables(inner,
- "Static Variables",
- QString(),
- "static variable",
- "static variables");
- FastSection functions(inner,
- style == Summary ?
- "Functions" : "Function Documentation",
- style == Detailed ? "func" : QString(),
- "function",
- "functions");
- FastSection macros(inner,
- style == Summary ?
- "Macros" : "Macro Documentation",
- style == Detailed ? "macros" : QString(),
- "macro",
- "macros");
-
- NodeList nodeList = inner->childNodes();
- nodeList += inner->relatedNodes();
-
- NodeList::ConstIterator n = nodeList.constBegin();
- while (n != nodeList.constEnd()) {
- switch ((*n)->type()) {
- case Node::Namespace:
- insert(namespaces, *n, style, status);
- break;
- case Node::Class:
- insert(classes, *n, style, status);
- break;
- case Node::Enum:
- case Node::Typedef:
- insert(types, *n, style, status);
- break;
- case Node::Function:
- {
- FunctionNode *func = static_cast<FunctionNode *>(*n);
- if (func->isMacro())
- insert(macros, *n, style, status);
- else
- insert(functions, *n, style, status);
- }
- break;
- case Node::Variable:
- {
- const VariableNode* var = static_cast<const VariableNode*>(*n);
- if (!var->doc().isEmpty()) {
- if (var->isStatic())
- insert(staticVariables,*n,style,status);
- else
- insert(variables, *n, style, status);
- }
- }
- break;
- default:
- break;
- }
- ++n;
- }
- if (inner->isNamespace()) {
- const NamespaceNode* ns = static_cast<const NamespaceNode*>(inner);
- if (!ns->orphans().isEmpty()) {
- foreach (Node* n, ns->orphans()) {
- // Use inner as a temporary parent when inserting orphans
- InnerNode* p = n->parent();
- n->setParent(const_cast<InnerNode*>(inner));
- if (n->isClass())
- insert(classes, n, style, status);
- else if (n->isNamespace())
- insert(namespaces, n, style, status);
- n->setParent(p);
- }
- }
- }
- append(sections, namespaces);
- append(sections, classes);
- append(sections, types);
- append(sections, variables);
- append(sections, staticVariables);
- append(sections, functions);
- append(sections, macros);
- }
- }
-
- return sections;
-}
-
-/*
- @char
- @class
- @comment
- @function
- @keyword
- @number
- @op
- @preprocessor
- @string
- @type
-*/
-
-QString CppCodeMarker::addMarkUp(const QString &in,
- const Node * /* relative */,
- const Location & /* location */)
-{
- static QSet<QString> types;
- static QSet<QString> keywords;
-
- if (types.isEmpty()) {
- // initialize statics
- Q_ASSERT(keywords.isEmpty());
- static const QString typeTable[] = {
- QLatin1String("bool"), QLatin1String("char"), QLatin1String("double"), QLatin1String("float"), QLatin1String("int"), QLatin1String("long"), QLatin1String("short"),
- QLatin1String("signed"), QLatin1String("unsigned"), QLatin1String("uint"), QLatin1String("ulong"), QLatin1String("ushort"), QLatin1String("uchar"), QLatin1String("void"),
- QLatin1String("qlonglong"), QLatin1String("qulonglong"),
- QLatin1String("qint"), QLatin1String("qint8"), QLatin1String("qint16"), QLatin1String("qint32"), QLatin1String("qint64"),
- QLatin1String("quint"), QLatin1String("quint8"), QLatin1String("quint16"), QLatin1String("quint32"), QLatin1String("quint64"),
- QLatin1String("qreal"), QLatin1String("cond")
- };
-
- static const QString keywordTable[] = {
- QLatin1String("and"), QLatin1String("and_eq"), QLatin1String("asm"), QLatin1String("auto"), QLatin1String("bitand"), QLatin1String("bitor"), QLatin1String("break"),
- QLatin1String("case"), QLatin1String("catch"), QLatin1String("class"), QLatin1String("compl"), QLatin1String("const"), QLatin1String("const_cast"),
- QLatin1String("continue"), QLatin1String("default"), QLatin1String("delete"), QLatin1String("do"), QLatin1String("dynamic_cast"), QLatin1String("else"),
- QLatin1String("enum"), QLatin1String("explicit"), QLatin1String("export"), QLatin1String("extern"), QLatin1String("false"), QLatin1String("for"), QLatin1String("friend"),
- QLatin1String("goto"), QLatin1String("if"), QLatin1String("include"), QLatin1String("inline"), QLatin1String("monitor"), QLatin1String("mutable"), QLatin1String("namespace"),
- QLatin1String("new"), QLatin1String("not"), QLatin1String("not_eq"), QLatin1String("operator"), QLatin1String("or"), QLatin1String("or_eq"), QLatin1String("private"), QLatin1String("protected"),
- QLatin1String("public"), QLatin1String("register"), QLatin1String("reinterpret_cast"), QLatin1String("return"), QLatin1String("sizeof"),
- QLatin1String("static"), QLatin1String("static_cast"), QLatin1String("struct"), QLatin1String("switch"), QLatin1String("template"), QLatin1String("this"),
- QLatin1String("throw"), QLatin1String("true"), QLatin1String("try"), QLatin1String("typedef"), QLatin1String("typeid"), QLatin1String("typename"), QLatin1String("union"),
- QLatin1String("using"), QLatin1String("virtual"), QLatin1String("volatile"), QLatin1String("wchar_t"), QLatin1String("while"), QLatin1String("xor"),
- QLatin1String("xor_eq"), QLatin1String("synchronized"),
- // Qt specific
- QLatin1String("signals"), QLatin1String("slots"), QLatin1String("emit")
- };
-
- types.reserve(sizeof(typeTable) / sizeof(QString));
- for (int j = sizeof(typeTable) / sizeof(QString) - 1; j; --j)
- types.insert(typeTable[j]);
-
- keywords.reserve(sizeof(keywordTable) / sizeof(QString));
- for (int j = sizeof(keywordTable) / sizeof(QString) - 1; j; --j)
- keywords.insert(keywordTable[j]);
- }
-#define readChar() \
- ch = (i < (int)code.length()) ? code[i++].cell() : EOF
-
- QString code = in;
- QStringList out;
- QString text;
- int braceDepth = 0;
- int parenDepth = 0;
- int i = 0;
- int start = 0;
- int finish = 0;
- QChar ch;
- QRegExp classRegExp("Qt?(?:[A-Z3]+[a-z][A-Za-z]*|t)");
- QRegExp functionRegExp("q([A-Z][a-z]+)+");
- QRegExp findFunctionRegExp(QStringLiteral("^\\s*\\("));
-
- readChar();
-
- while (ch != EOF) {
- QString tag;
- bool target = false;
-
- if (ch.isLetter() || ch == '_') {
- QString ident;
- do {
- ident += ch;
- finish = i;
- readChar();
- } while (ch.isLetterOrNumber() || ch == '_');
-
- if (classRegExp.exactMatch(ident)) {
- tag = QStringLiteral("type");
- } else if (functionRegExp.exactMatch(ident)) {
- tag = QStringLiteral("func");
- target = true;
- } else if (types.contains(ident)) {
- tag = QStringLiteral("type");
- } else if (keywords.contains(ident)) {
- tag = QStringLiteral("keyword");
- } else if (braceDepth == 0 && parenDepth == 0) {
- if (QString(code.unicode() + i - 1, code.length() - (i - 1))
- .indexOf(findFunctionRegExp) == 0)
- tag = QStringLiteral("func");
- target = true;
- }
- } else if (ch.isDigit()) {
- do {
- finish = i;
- readChar();
- } while (ch.isLetterOrNumber() || ch == '.');
- tag = QStringLiteral("number");
- } else {
- switch (ch.unicode()) {
- case '+':
- case '-':
- case '!':
- case '%':
- case '^':
- case '&':
- case '*':
- case ',':
- case '.':
- case '<':
- case '=':
- case '>':
- case '?':
- case '[':
- case ']':
- case '|':
- case '~':
- finish = i;
- readChar();
- tag = QStringLiteral("op");
- break;
- case '"':
- finish = i;
- readChar();
-
- while (ch != EOF && ch != '"') {
- if (ch == '\\')
- readChar();
- readChar();
- }
- finish = i;
- readChar();
- tag = QStringLiteral("string");
- break;
- case '#':
- finish = i;
- readChar();
- while (ch != EOF && ch != '\n') {
- if (ch == '\\')
- readChar();
- finish = i;
- readChar();
- }
- tag = QStringLiteral("preprocessor");
- break;
- case '\'':
- finish = i;
- readChar();
-
- while (ch != EOF && ch != '\'') {
- if (ch == '\\')
- readChar();
- readChar();
- }
- finish = i;
- readChar();
- tag = QStringLiteral("char");
- break;
- case '(':
- finish = i;
- readChar();
- parenDepth++;
- break;
- case ')':
- finish = i;
- readChar();
- parenDepth--;
- break;
- case ':':
- finish = i;
- readChar();
- if (ch == ':') {
- finish = i;
- readChar();
- tag = QStringLiteral("op");
- }
- break;
- case '/':
- finish = i;
- readChar();
- if (ch == '/') {
- do {
- finish = i;
- readChar();
- } while (ch != EOF && ch != '\n');
- tag = QStringLiteral("comment");
- } else if (ch == '*') {
- bool metAster = false;
- bool metAsterSlash = false;
-
- finish = i;
- readChar();
-
- while (!metAsterSlash) {
- if (ch == EOF)
- break;
-
- if (ch == '*')
- metAster = true;
- else if (metAster && ch == '/')
- metAsterSlash = true;
- else
- metAster = false;
- finish = i;
- readChar();
- }
- tag = QStringLiteral("comment");
- } else {
- tag = QStringLiteral("op");
- }
- break;
- case '{':
- finish = i;
- readChar();
- braceDepth++;
- break;
- case '}':
- finish = i;
- readChar();
- braceDepth--;
- break;
- default:
- finish = i;
- readChar();
- }
- }
-
- text = code.mid(start, finish - start);
- start = finish;
-
- if (!tag.isEmpty()) {
- out << QStringLiteral("<@") << tag;
- if (target)
- out << QStringLiteral(" target=\"") << text << QStringLiteral("()\"");
- out << QStringLiteral(">");
- }
-
- out << protect(text);
-
- if (!tag.isEmpty())
- out << QStringLiteral("</@") << tag << QStringLiteral(">");
- }
-
- if (start < code.length()) {
- out << protect(code.mid(start));
- }
-
- return out.join(QString());
-}
-
-/*!
- This function is for documenting QML properties. It returns
- the list of documentation sections for the children of the
- \a qmlTypeNode.
- */
-QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status)
-{
- QList<Section> sections;
- if (qmlTypeNode) {
- if (style == Summary) {
- FastSection qmlproperties(qmlTypeNode,
- "Properties",
- QString(),
- "property",
- "properties");
- FastSection qmlattachedproperties(qmlTypeNode,
- "Attached Properties",
- QString(),
- "property",
- "properties");
- FastSection qmlsignals(qmlTypeNode,
- "Signals",
- QString(),
- "signal",
- "signals");
- FastSection qmlsignalhandlers(qmlTypeNode,
- "Signal Handlers",
- QString(),
- "signal handler",
- "signal handlers");
- FastSection qmlattachedsignals(qmlTypeNode,
- "Attached Signals",
- QString(),
- "signal",
- "signals");
- FastSection qmlmethods(qmlTypeNode,
- "Methods",
- QString(),
- "method",
- "methods");
- FastSection qmlattachedmethods(qmlTypeNode,
- "Attached Methods",
- QString(),
- "method",
- "methods");
-
- QmlTypeNode* qcn = qmlTypeNode;
- while (qcn != 0) {
- NodeList::ConstIterator c = qcn->childNodes().constBegin();
- while (c != qcn->childNodes().constEnd()) {
- if ((*c)->status() == Node::Internal) {
- ++c;
- continue;
- }
- if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
- insert(qmlproperties, *c, style, status);
- }
- else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
- if (pn->isAttached())
- insert(qmlattachedproperties,*c,style, status);
- else {
- insert(qmlproperties,*c,style, status);
- }
- }
- else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
- const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
- if (sn->isAttached())
- insert(qmlattachedsignals,*c,style, status);
- else
- insert(qmlsignals,*c,style, status);
- }
- else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
- insert(qmlsignalhandlers,*c,style, status);
- }
- else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
- const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
- if (mn->isAttached())
- insert(qmlattachedmethods,*c,style, status);
- else
- insert(qmlmethods,*c,style, status);
- }
- ++c;
- }
- if (qcn->qmlBaseNode() != 0) {
- qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
- if (!qcn->isAbstract())
- qcn = 0;
- }
- else
- qcn = 0;
- }
- append(sections,qmlproperties);
- append(sections,qmlattachedproperties);
- append(sections,qmlsignals);
- append(sections,qmlsignalhandlers);
- append(sections,qmlattachedsignals);
- append(sections,qmlmethods);
- append(sections,qmlattachedmethods);
- }
- else if (style == Detailed) {
- FastSection qmlproperties(qmlTypeNode, "Property Documentation","qmlprop","member","members");
- FastSection qmlattachedproperties(qmlTypeNode,"Attached Property Documentation","qmlattprop",
- "member","members");
- FastSection qmlsignals(qmlTypeNode,"Signal Documentation","qmlsig","signal","signals");
- FastSection qmlsignalhandlers(qmlTypeNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers");
- FastSection qmlattachedsignals(qmlTypeNode,"Attached Signal Documentation","qmlattsig",
- "signal","signals");
- FastSection qmlmethods(qmlTypeNode,"Method Documentation","qmlmeth","member","members");
- FastSection qmlattachedmethods(qmlTypeNode,"Attached Method Documentation","qmlattmeth",
- "member","members");
- QmlTypeNode* qcn = qmlTypeNode;
- while (qcn != 0) {
- NodeList::ConstIterator c = qcn->childNodes().constBegin();
- while (c != qcn->childNodes().constEnd()) {
- if ((*c)->status() == Node::Internal) {
- ++c;
- continue;
- }
- if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
- insert(qmlproperties,*c,style, status);
- }
- else if ((*c)->isQmlProperty() || (*c)->isJsProperty()) {
- const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*c);
- if (pn->isAttached())
- insert(qmlattachedproperties,*c,style, status);
- else
- insert(qmlproperties,*c,style, status);
- }
- else if ((*c)->isQmlSignal() || (*c)->isJsSignal()) {
- const FunctionNode* sn = static_cast<const FunctionNode*>(*c);
- if (sn->isAttached())
- insert(qmlattachedsignals,*c,style, status);
- else
- insert(qmlsignals,*c,style, status);
- }
- else if ((*c)->isQmlSignalHandler() || (*c)->isJsSignalHandler()) {
- insert(qmlsignalhandlers,*c,style, status);
- }
- else if ((*c)->isQmlMethod() || (*c)->isJsMethod()) {
- const FunctionNode* mn = static_cast<const FunctionNode*>(*c);
- if (mn->isAttached())
- insert(qmlattachedmethods,*c,style, status);
- else
- insert(qmlmethods,*c,style, status);
- }
- ++c;
- }
- if (qcn->qmlBaseNode() != 0) {
- qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
- if (!qcn->isAbstract())
- qcn = 0;
- }
- else
- qcn = 0;
- }
- append(sections,qmlproperties);
- append(sections,qmlattachedproperties);
- append(sections,qmlsignals);
- append(sections,qmlsignalhandlers);
- append(sections,qmlattachedsignals);
- append(sections,qmlmethods);
- append(sections,qmlattachedmethods);
- }
- else {
- /*
- This is where the list of all members including inherited
- members is prepared.
- */
- ClassMap* classMap = 0;
- FastSection all(qmlTypeNode,QString(),QString(),"member","members");
- QmlTypeNode* current = qmlTypeNode;
- while (current != 0) {
- /*
- If the QML type is abstract, do not create
- a new entry in the list for it. Instead,
- add its members to the current entry.
-
- However, if the first class is abstract,
- there is no current entry. In that case,
- create a new entry in the list anyway.
- I'm not sure that is correct, but it at
- least can prevent a crash.
- */
- if (!current->isAbstract() || !classMap) {
- classMap = new ClassMap;
- classMap->first = current;
- all.classMapList_.append(classMap);
- }
- NodeList::ConstIterator c = current->childNodes().constBegin();
- while (c != current->childNodes().constEnd()) {
- if ((*c)->isQmlPropertyGroup() || (*c)->isJsPropertyGroup()) {
- const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*c);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->isQmlProperty() || (*c)->isJsProperty()) {
- QString key = (*p)->name();
- key = sortName(*p, &key);
- all.memberMap.insert(key,*p);
- classMap->second.insert(key,*p);
- }
- ++p;
- }
- }
- else {
- QString key = (*c)->name();
- key = sortName(*c, &key);
- all.memberMap.insert(key,*c);
- classMap->second.insert(key,*c);
- }
- ++c;
- }
- current = current->qmlBaseNode();
- while (current) {
- if (current->isAbstract())
- break;
- if (current->isInternal())
- current = current->qmlBaseNode();
- else
- break;
- }
- }
- append(sections, all, true);
- }
- }
-
- return sections;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/cppcodemarker.h b/src/tools/qdoc/cppcodemarker.h
deleted file mode 100644
index 509d130a27..0000000000
--- a/src/tools/qdoc/cppcodemarker.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- cppcodemarker.h
-*/
-
-#ifndef CPPCODEMARKER_H
-#define CPPCODEMARKER_H
-
-#include "codemarker.h"
-
-QT_BEGIN_NAMESPACE
-
-class CppCodeMarker : public CodeMarker
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeMarker)
-
-public:
- CppCodeMarker();
- ~CppCodeMarker();
-
- virtual bool recognizeCode(const QString& code) Q_DECL_OVERRIDE;
- virtual bool recognizeExtension(const QString& ext) Q_DECL_OVERRIDE;
- virtual bool recognizeLanguage(const QString& lang) Q_DECL_OVERRIDE;
- virtual Atom::Type atomType() const Q_DECL_OVERRIDE;
- virtual QString markedUpCode(const QString& code,
- const Node *relative,
- const Location &location) Q_DECL_OVERRIDE;
- virtual QString markedUpSynopsis(const Node *node,
- const Node *relative,
- SynopsisStyle style) Q_DECL_OVERRIDE;
- virtual QString markedUpQmlItem(const Node *node, bool summary) Q_DECL_OVERRIDE;
- virtual QString markedUpName(const Node *node) Q_DECL_OVERRIDE;
- virtual QString markedUpFullName(const Node *node, const Node *relative) Q_DECL_OVERRIDE;
- virtual QString markedUpEnumValue(const QString &enumValue, const Node *relative) Q_DECL_OVERRIDE;
- virtual QString markedUpIncludes(const QStringList& includes) Q_DECL_OVERRIDE;
- virtual QString functionBeginRegExp(const QString& funcName) Q_DECL_OVERRIDE;
- virtual QString functionEndRegExp(const QString& funcName) Q_DECL_OVERRIDE;
- virtual QList<Section> sections(const InnerNode *innerNode,
- SynopsisStyle style,
- Status status) Q_DECL_OVERRIDE;
- virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
- SynopsisStyle style,
- Status status = Okay) Q_DECL_OVERRIDE;
-
-private:
- QString addMarkUp(const QString& protectedCode,
- const Node *relative,
- const Location &location);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
deleted file mode 100644
index f12fb70227..0000000000
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ /dev/null
@@ -1,2487 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- cppcodeparser.cpp
-*/
-
-#include <qfile.h>
-#include <stdio.h>
-#include <errno.h>
-#include "codechunk.h"
-#include "config.h"
-#include "cppcodeparser.h"
-#include "tokenizer.h"
-#include "qdocdatabase.h"
-#include <qdebug.h>
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-/* qmake ignore Q_OBJECT */
-
-static bool inMacroCommand_ = false;
-QStringList CppCodeParser::exampleFiles;
-QStringList CppCodeParser::exampleDirs;
-
-/*!
- The constructor initializes some regular expressions
- and calls reset().
- */
-CppCodeParser::CppCodeParser()
- : varComment("/\\*\\s*([a-zA-Z_0-9]+)\\s*\\*/"), sep("(?:<[^>]+>)?::")
-{
- reset();
-}
-
-/*!
- The destructor is trivial.
- */
-CppCodeParser::~CppCodeParser()
-{
- // nothing.
-}
-
-/*!
- The constructor initializes a map of special node types
- for identifying important nodes. And it initializes
- some filters for identifying certain kinds of files.
- */
-void CppCodeParser::initializeParser(const Config &config)
-{
- CodeParser::initializeParser(config);
-
- /*
- All these can appear in a C++ namespace. Don't add
- anything that can't be in a C++ namespace.
- */
- nodeTypeMap.insert(COMMAND_NAMESPACE, Node::Namespace);
- nodeTypeMap.insert(COMMAND_CLASS, Node::Class);
- nodeTypeMap.insert(COMMAND_ENUM, Node::Enum);
- nodeTypeMap.insert(COMMAND_TYPEDEF, Node::Typedef);
- nodeTypeMap.insert(COMMAND_PROPERTY, Node::Property);
- nodeTypeMap.insert(COMMAND_VARIABLE, Node::Variable);
-
- exampleFiles = config.getCanonicalPathList(CONFIG_EXAMPLES);
- exampleDirs = config.getCanonicalPathList(CONFIG_EXAMPLEDIRS);
- QStringList exampleFilePatterns = config.getStringList(
- CONFIG_EXAMPLES + Config::dot + CONFIG_FILEEXTENSIONS);
-
- if (!exampleFilePatterns.isEmpty())
- exampleNameFilter = exampleFilePatterns.join(' ');
- else
- exampleNameFilter = "*.cpp *.h *.js *.xq *.svg *.xml *.dita *.ui";
-
- QStringList exampleImagePatterns = config.getStringList(
- CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS);
-
- if (!exampleImagePatterns.isEmpty())
- exampleImageFilter = exampleImagePatterns.join(' ');
- else
- exampleImageFilter = "*.png";
-}
-
-/*!
- Clear the map of common node types and call
- the same function in the base class.
- */
-void CppCodeParser::terminateParser()
-{
- nodeTypeMap.clear();
- CodeParser::terminateParser();
-}
-
-/*!
- Returns "Cpp".
- */
-QString CppCodeParser::language()
-{
- return "Cpp";
-}
-
-/*!
- Returns a list of extensions for header files.
- */
-QStringList CppCodeParser::headerFileNameFilter()
-{
- return QStringList() << "*.ch" << "*.h" << "*.h++" << "*.hh" << "*.hpp" << "*.hxx";
-}
-
-/*!
- Returns a list of extensions for source files, i.e. not
- header files.
- */
-QStringList CppCodeParser::sourceFileNameFilter()
-{
- return QStringList() << "*.c++" << "*.cc" << "*.cpp" << "*.cxx" << "*.mm";
-}
-
-/*!
- Parse the C++ header file identified by \a filePath and add
- the parsed contents to the database. The \a location is used
- for reporting errors.
- */
-void CppCodeParser::parseHeaderFile(const Location& location, const QString& filePath)
-{
- QFile in(filePath);
- currentFile_ = filePath;
- if (!in.open(QIODevice::ReadOnly)) {
- location.error(tr("Cannot open C++ header file '%1'").arg(filePath));
- currentFile_.clear();
- return;
- }
-
- reset();
- Location fileLocation(filePath);
- Tokenizer fileTokenizer(fileLocation, in);
- tokenizer = &fileTokenizer;
- readToken();
- matchDeclList(qdb_->primaryTreeRoot());
- if (!fileTokenizer.version().isEmpty())
- qdb_->setVersion(fileTokenizer.version());
- in.close();
-
- if (fileLocation.fileName() == "qiterator.h")
- parseQiteratorDotH(location, filePath);
- currentFile_.clear();
-}
-
-/*!
- Get ready to parse the C++ cpp file identified by \a filePath
- and add its parsed contents to the database. \a location is
- used for reporting errors.
-
- Call matchDocsAndStuff() to do all the parsing and tree building.
- */
-void CppCodeParser::parseSourceFile(const Location& location, const QString& filePath)
-{
- QFile in(filePath);
- currentFile_ = filePath;
- if (!in.open(QIODevice::ReadOnly)) {
- location.error(tr("Cannot open C++ source file '%1' (%2)").arg(filePath).arg(strerror(errno)));
- currentFile_.clear();
- return;
- }
-
- reset();
- Location fileLocation(filePath);
- Tokenizer fileTokenizer(fileLocation, in);
- tokenizer = &fileTokenizer;
- readToken();
-
- /*
- The set of open namespaces is cleared before parsing
- each source file. The word "source" here means cpp file.
- */
- qdb_->clearOpenNamespaces();
-
- matchDocsAndStuff();
- in.close();
- currentFile_.clear();
-}
-
-/*!
- This is called after all the C++ header files have been
- parsed. The most important thing it does is resolve C++
- class inheritance links in the tree. It also initializes
- a bunch of other collections.
- */
-void CppCodeParser::doneParsingHeaderFiles()
-{
- QMapIterator<QString, QString> i(sequentialIteratorClasses);
- while (i.hasNext()) {
- i.next();
- instantiateIteratorMacro(i.key(), i.value(), sequentialIteratorDefinition);
- }
- i = mutableSequentialIteratorClasses;
- while (i.hasNext()) {
- i.next();
- instantiateIteratorMacro(i.key(), i.value(), mutableSequentialIteratorDefinition);
- }
- i = associativeIteratorClasses;
- while (i.hasNext()) {
- i.next();
- instantiateIteratorMacro(i.key(), i.value(), associativeIteratorDefinition);
- }
- i = mutableAssociativeIteratorClasses;
- while (i.hasNext()) {
- i.next();
- instantiateIteratorMacro(i.key(), i.value(), mutableAssociativeIteratorDefinition);
- }
- sequentialIteratorDefinition.clear();
- mutableSequentialIteratorDefinition.clear();
- associativeIteratorDefinition.clear();
- mutableAssociativeIteratorDefinition.clear();
- sequentialIteratorClasses.clear();
- mutableSequentialIteratorClasses.clear();
- associativeIteratorClasses.clear();
- mutableAssociativeIteratorClasses.clear();
-}
-
-/*!
- This is called after all the source files (i.e., not the
- header files) have been parsed. It traverses the tree to
- resolve property links, normalize overload signatures, and
- do other housekeeping of the database.
- */
-void CppCodeParser::doneParsingSourceFiles()
-{
- qdb_->primaryTreeRoot()->normalizeOverloads();
- qdb_->fixInheritance();
- qdb_->resolveProperties();
- qdb_->primaryTreeRoot()->makeUndocumentedChildrenInternal();
-}
-
-static QSet<QString> topicCommands_;
-/*!
- Returns the set of strings reopresenting the topic commands.
- */
-const QSet<QString>& CppCodeParser::topicCommands()
-{
- if (topicCommands_.isEmpty()) {
- topicCommands_ << COMMAND_CLASS
- << COMMAND_DITAMAP
- << COMMAND_ENUM
- << COMMAND_EXAMPLE
- << COMMAND_EXTERNALPAGE
- << COMMAND_FILE
- << COMMAND_FN
- << COMMAND_GROUP
- << COMMAND_HEADERFILE
- << COMMAND_MACRO
- << COMMAND_MODULE
- << COMMAND_NAMESPACE
- << COMMAND_PAGE
- << COMMAND_PROPERTY
- << COMMAND_TYPEDEF
- << COMMAND_VARIABLE
- << COMMAND_QMLTYPE
- << COMMAND_QMLPROPERTY
- << COMMAND_QMLPROPERTYGROUP
- << COMMAND_QMLATTACHEDPROPERTY
- << COMMAND_QMLSIGNAL
- << COMMAND_QMLATTACHEDSIGNAL
- << COMMAND_QMLMETHOD
- << COMMAND_QMLATTACHEDMETHOD
- << COMMAND_QMLBASICTYPE
- << COMMAND_QMLMODULE
- << COMMAND_JSTYPE
- << COMMAND_JSPROPERTY
- << COMMAND_JSPROPERTYGROUP
- << COMMAND_JSATTACHEDPROPERTY
- << COMMAND_JSSIGNAL
- << COMMAND_JSATTACHEDSIGNAL
- << COMMAND_JSMETHOD
- << COMMAND_JSATTACHEDMETHOD
- << COMMAND_JSBASICTYPE
- << COMMAND_JSMODULE;
- }
- return topicCommands_;
-}
-
-/*!
- Process the topic \a command found in the \a doc with argument \a arg.
- */
-Node* CppCodeParser::processTopicCommand(const Doc& doc,
- const QString& command,
- const ArgLocPair& arg)
-{
- ExtraFuncData extra;
- if (command == COMMAND_FN) {
- QStringList parentPath;
- FunctionNode *func = 0;
- FunctionNode *clone = 0;
-
- if (!makeFunctionNode(arg.first, &parentPath, &clone, extra) &&
- !makeFunctionNode("void " + arg.first, &parentPath, &clone, extra)) {
- doc.startLocation().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN));
- }
- else {
- func = qdb_->findFunctionNode(parentPath, clone);
- if (func == 0) {
- if (parentPath.isEmpty() && !lastPath_.isEmpty())
- func = qdb_->findFunctionNode(lastPath_, clone);
- }
-
- /*
- If the node was not found, then search for it in the
- open C++ namespaces. We don't expect this search to
- be necessary often. Nor do we expect it to succeed
- very often.
- */
- if (func == 0)
- func = qdb_->findNodeInOpenNamespace(parentPath, clone);
-
- if (func == 0) {
- doc.location().warning(tr("Cannot find '%1' in '\\%2' %3")
- .arg(clone->name() + "(...)")
- .arg(COMMAND_FN)
- .arg(arg.first),
- tr("I cannot find any function of that name with the "
- "specified signature. Make sure that the signature "
- "is identical to the declaration, including 'const' "
- "qualifiers."));
- }
- else
- lastPath_ = parentPath;
- if (func) {
- func->borrowParameterNames(clone);
- func->setParentPath(clone->parentPath());
- }
- delete clone;
- }
- return func;
- }
- else if (command == COMMAND_MACRO) {
- QStringList parentPath;
- FunctionNode *func = 0;
-
- extra.root = qdb_->primaryTreeRoot();
- extra.isMacro = true;
- if (makeFunctionNode(arg.first, &parentPath, &func, extra)) {
- if (!parentPath.isEmpty()) {
- doc.startLocation().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO));
- delete func;
- func = 0;
- }
- else {
- func->setMetaness(FunctionNode::MacroWithParams);
- QList<Parameter> params = func->parameters();
- for (int i = 0; i < params.size(); ++i) {
- Parameter &param = params[i];
- if (param.name().isEmpty() && !param.leftType().isEmpty()
- && param.leftType() != "...")
- param = Parameter("", "", param.leftType());
- }
- func->setParameters(params);
- }
- return func;
- }
- else if (QRegExp("[A-Za-z_][A-Za-z0-9_]+").exactMatch(arg.first)) {
- func = new FunctionNode(qdb_->primaryTreeRoot(), arg.first);
- func->setAccess(Node::Public);
- func->setLocation(doc.startLocation());
- func->setMetaness(FunctionNode::MacroWithoutParams);
- }
- else {
- doc.location().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO));
-
- }
- return func;
- }
- else if (nodeTypeMap.contains(command)) {
- /*
- We should only get in here if the command refers to
- something that can appear in a C++ namespace,
- i.e. a class, another namespace, an enum, a typedef,
- a property or a variable. I think these are handled
- this way to allow the writer to refer to the entity
- without including the namespace qualifier.
- */
- Node::Type type = nodeTypeMap[command];
- QStringList paths = arg.first.split(QLatin1Char(' '));
- QStringList path = paths[0].split("::");
- Node *node = 0;
-
- node = qdb_->findNodeInOpenNamespace(path, type);
- if (node == 0)
- node = qdb_->findNodeByNameAndType(path, type);
- if (node == 0) {
- doc.location().warning(tr("Cannot find '%1' specified with '\\%2' in any header file")
- .arg(arg.first).arg(command));
- lastPath_ = path;
-
- }
- else if (node->isInnerNode()) {
- if (type == Node::Namespace) {
- NamespaceNode* ns = static_cast<NamespaceNode*>(node);
- ns->markSeen();
- }
- /*
- This treats a class as a namespace.
- */
- if ((type == Node::Class) || (type == Node::Namespace)) {
- if (path.size() > 1) {
- path.pop_back();
- QString ns = path.join("::");
- qdb_->insertOpenNamespace(ns);
- }
- }
- }
- return node;
- }
- else if (command == COMMAND_EXAMPLE) {
- if (Config::generateExamples) {
- ExampleNode* en = new ExampleNode(qdb_->primaryTreeRoot(), arg.first);
- en->setLocation(doc.startLocation());
- createExampleFileNodes(en);
- return en;
- }
- }
- else if (command == COMMAND_EXTERNALPAGE) {
- DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(),
- arg.first,
- Node::ExternalPage,
- Node::ArticlePage);
- dn->setLocation(doc.startLocation());
- return dn;
- }
- else if (command == COMMAND_FILE) {
- DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(),
- arg.first,
- Node::File,
- Node::NoPageType);
- dn->setLocation(doc.startLocation());
- return dn;
- }
- else if (command == COMMAND_HEADERFILE) {
- DocumentNode* dn = new DocumentNode(qdb_->primaryTreeRoot(),
- arg.first,
- Node::HeaderFile,
- Node::ApiPage);
- dn->setLocation(doc.startLocation());
- return dn;
- }
- else if (command == COMMAND_GROUP) {
- CollectionNode* cn = qdb_->addGroup(arg.first);
- cn->setLocation(doc.startLocation());
- cn->markSeen();
- return cn;
- }
- else if (command == COMMAND_MODULE) {
- CollectionNode* cn = qdb_->addModule(arg.first);
- cn->setLocation(doc.startLocation());
- cn->markSeen();
- return cn;
- }
- else if (command == COMMAND_QMLMODULE) {
- QStringList blankSplit = arg.first.split(QLatin1Char(' '));
- CollectionNode* cn = qdb_->addQmlModule(blankSplit[0]);
- cn->setLogicalModuleInfo(blankSplit);
- cn->setLocation(doc.startLocation());
- cn->markSeen();
- return cn;
- }
- else if (command == COMMAND_JSMODULE) {
- QStringList blankSplit = arg.first.split(QLatin1Char(' '));
- CollectionNode* cn = qdb_->addJsModule(blankSplit[0]);
- cn->setLogicalModuleInfo(blankSplit);
- cn->setLocation(doc.startLocation());
- cn->markSeen();
- return cn;
- }
- else if (command == COMMAND_PAGE) {
- Node::PageType ptype = Node::ArticlePage;
- QStringList args = arg.first.split(QLatin1Char(' '));
- if (args.size() > 1) {
- QString t = args[1].toLower();
- if (t == "howto")
- ptype = Node::HowToPage;
- else if (t == "api")
- ptype = Node::ApiPage;
- else if (t == "example")
- ptype = Node::ExamplePage;
- else if (t == "overview")
- ptype = Node::OverviewPage;
- else if (t == "tutorial")
- ptype = Node::TutorialPage;
- else if (t == "faq")
- ptype = Node::FAQPage;
- else if (t == "ditamap")
- ptype = Node::DitaMapPage;
- }
-
-#if 0
- const Node* n = qdb_->checkForCollision(args[0]);
- if (n) {
- QString other = n->doc().location().fileName();
- doc.location().warning(tr("Name/title collision detected: '%1' in '\\%2'")
- .arg(args[0]).arg(command),
- tr("Also used here: %1").arg(other));
- }
-#endif
- DocumentNode* dn = 0;
- if (ptype == Node::DitaMapPage)
- dn = new DitaMapNode(qdb_->primaryTreeRoot(), args[0]);
- else
- dn = new DocumentNode(qdb_->primaryTreeRoot(), args[0], Node::Page, ptype);
- dn->setLocation(doc.startLocation());
- return dn;
- }
- else if (command == COMMAND_DITAMAP) {
- DocumentNode* dn = new DitaMapNode(qdb_->primaryTreeRoot(), arg.first);
- dn->setLocation(doc.startLocation());
- return dn;
- }
- else if ((command == COMMAND_QMLTYPE) || (command == COMMAND_JSTYPE)) {
- QmlTypeNode* qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), arg.first);
- if (command == COMMAND_JSTYPE)
- qcn->setGenus(Node::JS);
- qcn->setLocation(doc.startLocation());
- return qcn;
- }
- else if ((command == COMMAND_QMLBASICTYPE) || (command == COMMAND_JSBASICTYPE)) {
- QmlBasicTypeNode* n = new QmlBasicTypeNode(qdb_->primaryTreeRoot(), arg.first);
- if (command == COMMAND_JSBASICTYPE)
- n->setGenus(Node::JS);
- n->setLocation(doc.startLocation());
- return n;
- }
- else if ((command == COMMAND_QMLSIGNAL) ||
- (command == COMMAND_QMLMETHOD) ||
- (command == COMMAND_QMLATTACHEDSIGNAL) ||
- (command == COMMAND_QMLATTACHEDMETHOD) ||
- (command == COMMAND_JSSIGNAL) ||
- (command == COMMAND_JSMETHOD) ||
- (command == COMMAND_JSATTACHEDSIGNAL) ||
- (command == COMMAND_JSATTACHEDMETHOD)) {
- QString module;
- QString qmlTypeName;
- QString type;
- if (splitQmlMethodArg(arg.first, type, module, qmlTypeName)) {
- QmlTypeNode* qmlType = qdb_->findQmlType(module, qmlTypeName);
- if (qmlType) {
- bool attached = false;
- Node::Type nodeType = Node::QmlMethod;
- if ((command == COMMAND_QMLSIGNAL) ||
- (command == COMMAND_JSSIGNAL))
- nodeType = Node::QmlSignal;
- else if ((command == COMMAND_QMLATTACHEDSIGNAL) ||
- (command == COMMAND_JSATTACHEDSIGNAL)) {
- nodeType = Node::QmlSignal;
- attached = true;
- }
- else if ((command == COMMAND_QMLMETHOD) ||
- (command == COMMAND_JSMETHOD)) {
- // do nothing
- }
- else if ((command == COMMAND_QMLATTACHEDMETHOD) ||
- (command == COMMAND_JSATTACHEDMETHOD))
- attached = true;
- else
- return 0; // never get here.
- FunctionNode* fn = makeFunctionNode(doc,
- arg.first,
- qmlType,
- nodeType,
- attached,
- command);
- if (fn) {
- fn->setLocation(doc.startLocation());
- if ((command == COMMAND_JSSIGNAL) ||
- (command == COMMAND_JSMETHOD) ||
- (command == COMMAND_JSATTACHEDSIGNAL) ||
- (command == COMMAND_JSATTACHEDMETHOD))
- fn->setGenus(Node::JS);
- }
- return fn;
- }
- }
- }
- return 0;
-}
-
-/*!
- A QML property group argument has the form...
-
- <QML-module>::<QML-type>::<name>
-
- This function splits the argument into those parts.
- A <QML-module> is the QML equivalent of a C++ namespace.
- So this function splits \a arg on "::" and stores the
- parts in \a module, \a qmlTypeName, and \a name, and returns
- true. If any part is not found, a qdoc warning is emitted
- and false is returned.
- */
-bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg,
- QString& module,
- QString& qmlTypeName,
- QString& name)
-{
- QStringList colonSplit = arg.split("::");
- if (colonSplit.size() == 3) {
- module = colonSplit[0];
- qmlTypeName = colonSplit[1];
- name = colonSplit[2];
- return true;
- }
- QString msg = "Unrecognizable QML module/component qualifier for " + arg;
- location().warning(tr(msg.toLatin1().data()));
- return false;
-}
-
-/*!
- A QML property argument has the form...
-
- <type> <QML-type>::<name>
- <type> <QML-module>::<QML-type>::<name>
-
- This function splits the argument into one of those
- two forms. The three part form is the old form, which
- was used before the creation of Qt Quick 2 and Qt
- Components. A <QML-module> is the QML equivalent of a
- C++ namespace. So this function splits \a arg on "::"
- and stores the parts in \a type, \a module, \a qmlTypeName,
- and \a name, and returns \c true. If any part other than
- \a module is not found, a qdoc warning is emitted and
- false is returned.
-
- \note The two QML types \e{Component} and \e{QtObject}
- never have a module qualifier.
- */
-bool CppCodeParser::splitQmlPropertyArg(const QString& arg,
- QString& type,
- QString& module,
- QString& qmlTypeName,
- QString& name)
-{
- QStringList blankSplit = arg.split(QLatin1Char(' '));
- if (blankSplit.size() > 1) {
- type = blankSplit[0];
- QStringList colonSplit(blankSplit[1].split("::"));
- if (colonSplit.size() == 3) {
- module = colonSplit[0];
- qmlTypeName = colonSplit[1];
- name = colonSplit[2];
- return true;
- }
- if (colonSplit.size() == 2) {
- module.clear();
- qmlTypeName = colonSplit[0];
- name = colonSplit[1];
- return true;
- }
- QString msg = "Unrecognizable QML module/component qualifier for " + arg;
- location().warning(tr(msg.toLatin1().data()));
- }
- else {
- QString msg = "Missing property type for " + arg;
- location().warning(tr(msg.toLatin1().data()));
- }
- return false;
-}
-
-/*!
- A QML signal or method argument has the form...
-
- <type> <QML-type>::<name>(<param>, <param>, ...)
- <type> <QML-module>::<QML-type>::<name>(<param>, <param>, ...)
-
- This function splits the argument into one of those two
- forms, sets \a module, \a qmlTypeName, and \a name, and returns
- true. If the argument doesn't match either form, an error
- message is emitted and false is returned.
-
- \note The two QML types \e{Component} and \e{QtObject} never
- have a module qualifier.
- */
-bool CppCodeParser::splitQmlMethodArg(const QString& arg,
- QString& type,
- QString& module,
- QString& qmlTypeName)
-{
- QStringList colonSplit(arg.split("::"));
- if (colonSplit.size() > 1) {
- QStringList blankSplit = colonSplit[0].split(QLatin1Char(' '));
- if (blankSplit.size() > 1) {
- type = blankSplit[0];
- if (colonSplit.size() > 2) {
- module = blankSplit[1];
- qmlTypeName = colonSplit[1];
- }
- else {
- module.clear();
- qmlTypeName = blankSplit[1];
- }
- }
- else {
- type.clear();
- if (colonSplit.size() > 2) {
- module = colonSplit[0];
- qmlTypeName = colonSplit[1];
- }
- else {
- module.clear();
- qmlTypeName = colonSplit[0];
- }
- }
- return true;
- }
- QString msg = "Unrecognizable QML module/component qualifier for " + arg;
- location().warning(tr(msg.toLatin1().data()));
- return false;
-}
-
-/*!
- Process the topic \a command group found in the \a doc with arguments \a args.
-
- Currently, this function is called only for \e{qmlproperty}
- and \e{qmlattachedproperty}.
- */
-void CppCodeParser::processQmlProperties(const Doc& doc,
- NodeList& nodes,
- DocList& docs,
- bool jsProps)
-{
- QString arg;
- QString type;
- QString topic;
- QString module;
- QString qmlTypeName;
- QString property;
- QmlPropertyNode* qpn = 0;
- QmlTypeNode* qmlType = 0;
- QmlPropertyGroupNode* qpgn = 0;
-
- Topic qmlPropertyGroupTopic;
- const TopicList& topics = doc.topicsUsed();
- for (int i=0; i<topics.size(); ++i) {
- if ((topics.at(i).topic == COMMAND_QMLPROPERTYGROUP) ||
- (topics.at(i).topic == COMMAND_JSPROPERTYGROUP)) {
- qmlPropertyGroupTopic = topics.at(i);
- break;
- }
- }
- if (qmlPropertyGroupTopic.isEmpty() && topics.size() > 1) {
- qmlPropertyGroupTopic = topics.at(0);
- if (jsProps)
- qmlPropertyGroupTopic.topic = COMMAND_JSPROPERTYGROUP;
- else
- qmlPropertyGroupTopic.topic = COMMAND_QMLPROPERTYGROUP;
- arg = qmlPropertyGroupTopic.args;
- if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) {
- int i = property.indexOf('.');
- if (i != -1) {
- property = property.left(i);
- qmlPropertyGroupTopic.args = module + "::" + qmlTypeName + "::" + property;
- doc.location().warning(tr("No QML property group command found; using \\%1 %2")
- .arg(COMMAND_QMLPROPERTYGROUP).arg(qmlPropertyGroupTopic.args));
- }
- else {
- /*
- Assumption: No '.' in the property name
- means there is no property group.
- */
- qmlPropertyGroupTopic.clear();
- }
- }
- }
-
- if (!qmlPropertyGroupTopic.isEmpty()) {
- arg = qmlPropertyGroupTopic.args;
- if (splitQmlPropertyGroupArg(arg, module, qmlTypeName, property)) {
- qmlType = qdb_->findQmlType(module, qmlTypeName);
- if (qmlType) {
- qpgn = new QmlPropertyGroupNode(qmlType, property);
- qpgn->setLocation(doc.startLocation());
- if (jsProps)
- qpgn->setGenus(Node::JS);
- nodes.append(qpgn);
- docs.append(doc);
- }
- }
- }
- for (int i=0; i<topics.size(); ++i) {
- if (topics.at(i).topic == COMMAND_QMLPROPERTYGROUP) {
- continue;
- }
- topic = topics.at(i).topic;
- arg = topics.at(i).args;
- if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY) ||
- (topic == COMMAND_JSPROPERTY) || (topic == COMMAND_JSATTACHEDPROPERTY)) {
- bool attached = ((topic == COMMAND_QMLATTACHEDPROPERTY) ||
- (topic == COMMAND_JSATTACHEDPROPERTY));
- if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) {
- qmlType = qdb_->findQmlType(module, qmlTypeName);
- if (qmlType) {
- if (qmlType->hasQmlProperty(property, attached) != 0) {
- QString msg = tr("QML property documented multiple times: '%1'").arg(arg);
- doc.startLocation().warning(msg);
- }
- else if (qpgn) {
- qpn = new QmlPropertyNode(qpgn, property, type, attached);
- qpn->setLocation(doc.startLocation());
- if (jsProps)
- qpn->setGenus(Node::JS);
- }
- else {
- qpn = new QmlPropertyNode(qmlType, property, type, attached);
- qpn->setLocation(doc.startLocation());
- if (jsProps)
- qpn->setGenus(Node::JS);
- nodes.append(qpn);
- docs.append(doc);
- }
- }
- }
- }
- }
-}
-
-static QSet<QString> otherMetaCommands_;
-/*!
- Returns the set of strings representing the common metacommands
- plus some other metacommands.
- */
-const QSet<QString>& CppCodeParser::otherMetaCommands()
-{
- if (otherMetaCommands_.isEmpty()) {
- otherMetaCommands_ = commonMetaCommands();
- otherMetaCommands_ << COMMAND_INHEADERFILE
- << COMMAND_OVERLOAD
- << COMMAND_REIMP
- << COMMAND_RELATES
- << COMMAND_CONTENTSPAGE
- << COMMAND_NEXTPAGE
- << COMMAND_PREVIOUSPAGE
- << COMMAND_INDEXPAGE
- << COMMAND_STARTPAGE
- << COMMAND_QMLINHERITS
- << COMMAND_QMLINSTANTIATES
- << COMMAND_QMLDEFAULT
- << COMMAND_QMLREADONLY
- << COMMAND_QMLABSTRACT;
- }
- return otherMetaCommands_;
-}
-
-/*!
- Process the metacommand \a command in the context of the
- \a node associated with the topic command and the \a doc.
- \a arg is the argument to the metacommand.
- */
-void CppCodeParser::processOtherMetaCommand(const Doc& doc,
- const QString& command,
- const ArgLocPair& argLocPair,
- Node *node)
-{
- QString arg = argLocPair.first;
- if (command == COMMAND_INHEADERFILE) {
- if (node != 0 && node->isInnerNode()) {
- ((InnerNode *) node)->addInclude(arg);
- }
- else {
- doc.location().warning(tr("Ignored '\\%1'")
- .arg(COMMAND_INHEADERFILE));
- }
- }
- else if (command == COMMAND_OVERLOAD) {
- if (node != 0 && node->type() == Node::Function) {
- ((FunctionNode *) node)->setOverload(true);
- }
- else {
- doc.location().warning(tr("Ignored '\\%1'")
- .arg(COMMAND_OVERLOAD));
- }
- }
- else if (command == COMMAND_REIMP) {
- if (node != 0 && node->parent() && !node->parent()->isInternal()) {
- if (node->type() == Node::Function) {
- FunctionNode *func = (FunctionNode *) node;
- const FunctionNode *from = func->reimplementedFrom();
- if (from == 0) {
- doc.location().warning(tr("Cannot find base function for '\\%1' in %2()")
- .arg(COMMAND_REIMP).arg(node->name()),
- tr("The function either doesn't exist in any "
- "base class with the same signature or it "
- "exists but isn't virtual."));
- }
- /*
- Ideally, we would enable this check to warn whenever
- \reimp is used incorrectly, and only make the node
- internal if the function is a reimplementation of
- another function in a base class.
- */
- else if (from->access() == Node::Private
- || from->parent()->access() == Node::Private) {
- doc.location().warning(tr("'\\%1' in %2() should be '\\internal' "
- "because its base function is private "
- "or internal").arg(COMMAND_REIMP).arg(node->name()));
- }
- func->setReimp(true);
- }
- else {
- doc.location().warning(tr("Ignored '\\%1' in %2")
- .arg(COMMAND_REIMP)
- .arg(node->name()));
- }
- }
- }
- else if (command == COMMAND_RELATES) {
- QStringList path = arg.split("::");
- Node* n = qdb_->findRelatesNode(path);
- if (!n)
- doc.location().warning(tr("Cannot find '%1' in '\\%2'").arg(arg).arg(COMMAND_RELATES));
- else
- node->setRelates(static_cast<InnerNode*>(n));
- }
- else if (command == COMMAND_CONTENTSPAGE) {
- setLink(node, Node::ContentsLink, arg);
- }
- else if (command == COMMAND_NEXTPAGE) {
- setLink(node, Node::NextLink, arg);
- }
- else if (command == COMMAND_PREVIOUSPAGE) {
- setLink(node, Node::PreviousLink, arg);
- }
- else if (command == COMMAND_INDEXPAGE) {
- setLink(node, Node::IndexLink, arg);
- }
- else if (command == COMMAND_STARTPAGE) {
- setLink(node, Node::StartLink, arg);
- }
- else if (command == COMMAND_QMLINHERITS) {
- if (node->name() == arg)
- doc.location().warning(tr("%1 tries to inherit itself").arg(arg));
- else if (node->isQmlType() || node->isJsType()) {
- QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(node);
- qmlType->setQmlBaseName(arg);
- QmlTypeNode::addInheritedBy(arg,node);
- }
- }
- else if (command == COMMAND_QMLINSTANTIATES) {
- if (node->isQmlType() || node->isJsType()) {
- ClassNode* classNode = qdb_->findClassNode(arg.split("::"));
- if (classNode)
- node->setClassNode(classNode);
- else
- doc.location().warning(tr("C++ class %1 not found: \\instantiates %1").arg(arg));
- }
- else
- doc.location().warning(tr("\\instantiates is only allowed in \\qmltype"));
- }
- else if (command == COMMAND_QMLDEFAULT) {
- if (node->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- qpn->setDefault();
- }
- else if (node->type() == Node::QmlPropertyGroup) {
- QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(node);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(*p);
- qpn->setDefault();
- }
- ++p;
- }
- }
- }
- else if (command == COMMAND_QMLREADONLY) {
- if (node->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- qpn->setReadOnly(1);
- }
- else if (node->type() == Node::QmlPropertyGroup) {
- QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(node);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(*p);
- qpn->setReadOnly(1);
- }
- ++p;
- }
- }
- }
- else if (command == COMMAND_QMLABSTRACT) {
- if (node->isQmlType() || node->isJsType())
- node->setAbstract(true);
- }
- else {
- processCommonMetaCommand(doc.location(),command,argLocPair,node);
- }
-}
-
-/*!
- The topic command has been processed resulting in the \a doc
- and \a node passed in here. Process the other meta commands,
- which are found in \a doc, in the context of the topic \a node.
- */
-void CppCodeParser::processOtherMetaCommands(const Doc& doc, Node *node)
-{
- const QSet<QString> metaCommands = doc.metaCommandsUsed();
- QSet<QString>::ConstIterator cmd = metaCommands.constBegin();
- while (cmd != metaCommands.constEnd()) {
- ArgList args = doc.metaCommandArgs(*cmd);
- ArgList::ConstIterator arg = args.constBegin();
- while (arg != args.constEnd()) {
- processOtherMetaCommand(doc, *cmd, *arg, node);
- ++arg;
- }
- ++cmd;
- }
-}
-
-/*!
- Resets the C++ code parser to its default initialized state.
- */
-void CppCodeParser::reset()
-{
- tokenizer = 0;
- tok = 0;
- access = Node::Public;
- metaness = FunctionNode::Plain;
- lastPath_.clear();
- physicalModuleName.clear();
-}
-
-/*!
- Get the next token from the file being parsed and store it
- in the token variable.
- */
-void CppCodeParser::readToken()
-{
- tok = tokenizer->getToken();
-}
-
-/*!
- Return the current location in the file being parsed,
- i.e. the file name, line number, and column number.
- */
-const Location& CppCodeParser::location()
-{
- return tokenizer->location();
-}
-
-/*!
- Return the previous string read from the file being parsed.
- */
-QString CppCodeParser::previousLexeme()
-{
- return tokenizer->previousLexeme();
-}
-
-/*!
- Return the current string string from the file being parsed.
- */
-QString CppCodeParser::lexeme()
-{
- return tokenizer->lexeme();
-}
-
-bool CppCodeParser::match(int target)
-{
- if (tok == target) {
- readToken();
- return true;
- }
- else
- return false;
-}
-
-/*!
- Skip to \a target. If \a target is found before the end
- of input, return true. Otherwise return false.
- */
-bool CppCodeParser::skipTo(int target)
-{
- while ((tok != Tok_Eoi) && (tok != target))
- readToken();
- return tok == target;
-}
-
-/*!
- If the current token is one of the keyword thingees that
- are used in Qt, skip over it to the next token and return
- true. Otherwise just return false without reading the
- next token.
- */
-bool CppCodeParser::matchCompat()
-{
- switch (tok) {
- case Tok_QT_COMPAT:
- case Tok_QT_COMPAT_CONSTRUCTOR:
- case Tok_QT_DEPRECATED:
- case Tok_QT_MOC_COMPAT:
- case Tok_QT3_SUPPORT:
- case Tok_QT3_SUPPORT_CONSTRUCTOR:
- case Tok_QT3_MOC_SUPPORT:
- readToken();
- return true;
- default:
- return false;
- }
-}
-
-bool CppCodeParser::matchModuleQualifier(QString& name)
-{
- bool matches = (lexeme() == QString('.'));
- if (matches) {
- do {
- name += lexeme();
- readToken();
- } while ((tok == Tok_Ident) || (lexeme() == QString('.')));
- }
- return matches;
-}
-
-bool CppCodeParser::matchTemplateAngles(CodeChunk *dataType)
-{
- bool matches = (tok == Tok_LeftAngle);
- if (matches) {
- int leftAngleDepth = 0;
- int parenAndBraceDepth = 0;
- do {
- if (tok == Tok_LeftAngle) {
- leftAngleDepth++;
- }
- else if (tok == Tok_RightAngle) {
- leftAngleDepth--;
- }
- else if (tok == Tok_LeftParen || tok == Tok_LeftBrace) {
- ++parenAndBraceDepth;
- }
- else if (tok == Tok_RightParen || tok == Tok_RightBrace) {
- if (--parenAndBraceDepth < 0)
- return false;
- }
- if (dataType != 0)
- dataType->append(lexeme());
- readToken();
- } while (leftAngleDepth > 0 && tok != Tok_Eoi);
- }
- return matches;
-}
-
-/*
- This function is no longer used.
- */
-bool CppCodeParser::matchTemplateHeader()
-{
- readToken();
- return matchTemplateAngles();
-}
-
-bool CppCodeParser::matchDataType(CodeChunk *dataType, QString *var)
-{
- /*
- This code is really hard to follow... sorry. The loop is there to match
- Alpha::Beta::Gamma::...::Omega.
- */
- for (;;) {
- bool virgin = true;
-
- if (tok != Tok_Ident) {
- /*
- There is special processing for 'Foo::operator int()'
- and such elsewhere. This is the only case where we
- return something with a trailing gulbrandsen ('Foo::').
- */
- if (tok == Tok_operator)
- return true;
-
- /*
- People may write 'const unsigned short' or
- 'short unsigned const' or any other permutation.
- */
- while (match(Tok_const) || match(Tok_volatile))
- dataType->append(previousLexeme());
- while (match(Tok_signed) || match(Tok_unsigned) ||
- match(Tok_short) || match(Tok_long) || match(Tok_int64)) {
- dataType->append(previousLexeme());
- virgin = false;
- }
- while (match(Tok_const) || match(Tok_volatile))
- dataType->append(previousLexeme());
-
- if (match(Tok_Tilde))
- dataType->append(previousLexeme());
- }
-
- if (virgin) {
- if (match(Tok_Ident)) {
- /*
- This is a hack until we replace this "parser"
- with the real one used in Qt Creator.
- */
- if (!inMacroCommand_ && lexeme() == "(" &&
- ((previousLexeme() == "QT_PREPEND_NAMESPACE") || (previousLexeme() == "NS"))) {
- readToken();
- readToken();
- dataType->append(previousLexeme());
- readToken();
- }
- else
- dataType->append(previousLexeme());
- }
- else if (match(Tok_void) || match(Tok_int) || match(Tok_char) ||
- match(Tok_double) || match(Tok_Ellipsis))
- dataType->append(previousLexeme());
- else {
- return false;
- }
- }
- else if (match(Tok_int) || match(Tok_char) || match(Tok_double)) {
- dataType->append(previousLexeme());
- }
-
- matchTemplateAngles(dataType);
-
- while (match(Tok_const) || match(Tok_volatile))
- dataType->append(previousLexeme());
-
- if (match(Tok_Gulbrandsen))
- dataType->append(previousLexeme());
- else
- break;
- }
-
- while (match(Tok_Ampersand) || match(Tok_Aster) || match(Tok_const) ||
- match(Tok_Caret))
- dataType->append(previousLexeme());
-
- if (match(Tok_LeftParenAster)) {
- /*
- A function pointer. This would be rather hard to handle without a
- tokenizer hack, because a type can be followed with a left parenthesis
- in some cases (e.g., 'operator int()'). The tokenizer recognizes '(*'
- as a single token.
- */
- dataType->append(previousLexeme());
- dataType->appendHotspot();
- if (var != 0 && match(Tok_Ident))
- *var = previousLexeme();
- if (!match(Tok_RightParen) || tok != Tok_LeftParen) {
- return false;
- }
- dataType->append(previousLexeme());
-
- int parenDepth0 = tokenizer->parenDepth();
- while (tokenizer->parenDepth() >= parenDepth0 && tok != Tok_Eoi) {
- dataType->append(lexeme());
- readToken();
- }
- if (match(Tok_RightParen))
- dataType->append(previousLexeme());
- }
- else {
- /*
- The common case: Look for an optional identifier, then for
- some array brackets.
- */
- dataType->appendHotspot();
-
- if (var != 0) {
- if (match(Tok_Ident)) {
- *var = previousLexeme();
- }
- else if (match(Tok_Comment)) {
- /*
- A neat hack: Commented-out parameter names are
- recognized by qdoc. It's impossible to illustrate
- here inside a C-style comment, because it requires
- an asterslash. It's also impossible to illustrate
- inside a C++-style comment, because the explanation
- does not fit on one line.
- */
- if (varComment.exactMatch(previousLexeme()))
- *var = varComment.cap(1);
- }
- }
-
- if (tok == Tok_LeftBracket) {
- int bracketDepth0 = tokenizer->bracketDepth();
- while ((tokenizer->bracketDepth() >= bracketDepth0 &&
- tok != Tok_Eoi) ||
- tok == Tok_RightBracket) {
- dataType->append(lexeme());
- readToken();
- }
- }
- }
- return true;
-}
-
-bool CppCodeParser::matchParameter(FunctionNode *func)
-{
- CodeChunk dataType;
- QString name;
- CodeChunk defaultValue;
-
- if (match(Tok_QPrivateSignal)) {
- func->setPrivateSignal();
- return true;
- }
-
- if (!matchDataType(&dataType, &name)) {
- return false;
- }
- match(Tok_Comment);
- if (match(Tok_Equal)) {
- int parenDepth0 = tokenizer->parenDepth();
-
- while (tokenizer->parenDepth() >= parenDepth0 &&
- (tok != Tok_Comma ||
- tokenizer->parenDepth() > parenDepth0) &&
- tok != Tok_Eoi) {
- defaultValue.append(lexeme());
- readToken();
- }
- }
- func->addParameter(Parameter(dataType.toString(), "", name, defaultValue.toString())); // ###
- return true;
-}
-
-bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
- QStringList *parentPathPtr,
- FunctionNode **funcPtr,
- const QString &templateStuff,
- ExtraFuncData& extra)
-{
- CodeChunk returnType;
- QStringList parentPath;
- QString name;
- bool compat = false;
-
- if (match(Tok_friend)) {
- return false;
- }
- match(Tok_explicit);
- if (matchCompat())
- compat = true;
- bool sta = false;
- if (match(Tok_static)) {
- sta = true;
- if (matchCompat())
- compat = true;
- }
- FunctionNode::Virtualness vir = FunctionNode::NonVirtual;
- if (match(Tok_virtual)) {
- vir = FunctionNode::ImpureVirtual;
- if (matchCompat())
- compat = true;
- }
-
- if (!matchDataType(&returnType)) {
- if (tokenizer->parsingFnOrMacro()
- && (match(Tok_Q_DECLARE_FLAGS) ||
- match(Tok_Q_PROPERTY) ||
- match(Tok_Q_PRIVATE_PROPERTY)))
- returnType = CodeChunk(previousLexeme());
- else {
- return false;
- }
- }
-
- if (returnType.toString() == "QBool")
- returnType = CodeChunk("bool");
-
- if (matchCompat())
- compat = true;
-
- if (tok == Tok_operator &&
- (returnType.toString().isEmpty() ||
- returnType.toString().endsWith("::"))) {
- // 'QString::operator const char *()'
- parentPath = returnType.toString().split(sep);
- parentPath.removeAll(QString());
- returnType = CodeChunk();
- readToken();
-
- CodeChunk restOfName;
- if (tok != Tok_Tilde && matchDataType(&restOfName)) {
- name = "operator " + restOfName.toString();
- }
- else {
- name = previousLexeme() + lexeme();
- readToken();
- while (tok != Tok_LeftParen && tok != Tok_Eoi) {
- name += lexeme();
- readToken();
- }
- }
- if (tok != Tok_LeftParen) {
- return false;
- }
- }
- else if (tok == Tok_LeftParen) {
- // constructor or destructor
- parentPath = returnType.toString().split(sep);
- if (!parentPath.isEmpty()) {
- name = parentPath.last();
- parentPath.erase(parentPath.end() - 1);
- }
- returnType = CodeChunk();
- }
- else {
- while (match(Tok_Ident)) {
- name = previousLexeme();
-
- /*
- This is a hack to let QML module identifiers through.
- */
- matchModuleQualifier(name);
-
- matchTemplateAngles();
-
- if (match(Tok_Gulbrandsen))
- parentPath.append(name);
- else
- break;
- }
-
- if (tok == Tok_operator) {
- name = lexeme();
- readToken();
- while (tok != Tok_Eoi) {
- name += lexeme();
- readToken();
- if (tok == Tok_LeftParen)
- break;
- }
- }
- if (parent && (tok == Tok_Semicolon ||
- tok == Tok_LeftBracket ||
- tok == Tok_Colon)
- && access != Node::Private) {
- if (tok == Tok_LeftBracket) {
- returnType.appendHotspot();
-
- int bracketDepth0 = tokenizer->bracketDepth();
- while ((tokenizer->bracketDepth() >= bracketDepth0 &&
- tok != Tok_Eoi) ||
- tok == Tok_RightBracket) {
- returnType.append(lexeme());
- readToken();
- }
- if (tok != Tok_Semicolon) {
- return false;
- }
- }
- else if (tok == Tok_Colon) {
- returnType.appendHotspot();
-
- while (tok != Tok_Semicolon && tok != Tok_Eoi) {
- returnType.append(lexeme());
- readToken();
- }
- if (tok != Tok_Semicolon) {
- return false;
- }
- }
-
- VariableNode *var = new VariableNode(parent, name);
- var->setAccess(access);
- var->setLocation(location());
- var->setLeftType(returnType.left());
- var->setRightType(returnType.right());
- if (compat)
- var->setStatus(Node::Compat);
- var->setStatic(sta);
- return false;
- }
- if (tok != Tok_LeftParen) {
- return false;
- }
- }
- readToken();
-
- FunctionNode *func = new FunctionNode(extra.type, parent, name, extra.isAttached);
- func->setAccess(access);
- func->setLocation(location());
- func->setReturnType(returnType.toString());
- func->setParentPath(parentPath);
- func->setTemplateStuff(templateStuff);
- if (compat)
- func->setStatus(Node::Compat);
-
- func->setMetaness(metaness);
- if (parent) {
- if (name == parent->name()) {
- func->setMetaness(FunctionNode::Ctor);
- } else if (name.startsWith(QLatin1Char('~'))) {
- func->setMetaness(FunctionNode::Dtor);
- }
- }
- func->setStatic(sta);
-
- if (tok != Tok_RightParen) {
- do {
- if (!matchParameter(func)) {
- return false;
- }
- } while (match(Tok_Comma));
- }
- if (!match(Tok_RightParen)) {
- return false;
- }
-
- func->setConst(match(Tok_const));
-
- if (match(Tok_Equal) && match(Tok_Number))
- vir = FunctionNode::PureVirtual;
- func->setVirtualness(vir);
-
- if (match(Tok_Colon)) {
- while (tok != Tok_LeftBrace && tok != Tok_Eoi)
- readToken();
- }
-
- if (!match(Tok_Semicolon) && tok != Tok_Eoi) {
- int braceDepth0 = tokenizer->braceDepth();
-
- if (!match(Tok_LeftBrace)) {
- return false;
- }
- while (tokenizer->braceDepth() >= braceDepth0 && tok != Tok_Eoi)
- readToken();
- match(Tok_RightBrace);
- }
- if (parentPathPtr != 0)
- *parentPathPtr = parentPath;
- if (funcPtr != 0)
- *funcPtr = func;
- return true;
-}
-
-bool CppCodeParser::matchBaseSpecifier(ClassNode *classe, bool isClass)
-{
- Node::Access access;
-
- switch (tok) {
- case Tok_public:
- access = Node::Public;
- readToken();
- break;
- case Tok_protected:
- access = Node::Protected;
- readToken();
- break;
- case Tok_private:
- access = Node::Private;
- readToken();
- break;
- default:
- access = isClass ? Node::Private : Node::Public;
- }
-
- if (tok == Tok_virtual)
- readToken();
-
- CodeChunk baseClass;
- if (!matchDataType(&baseClass))
- return false;
-
- classe->addUnresolvedBaseClass(access, baseClass.toPath(), baseClass.toString());
- return true;
-}
-
-bool CppCodeParser::matchBaseList(ClassNode *classe, bool isClass)
-{
- for (;;) {
- if (!matchBaseSpecifier(classe, isClass))
- return false;
- if (tok == Tok_LeftBrace)
- return true;
- if (!match(Tok_Comma))
- return false;
- }
-}
-
-/*!
- Parse a C++ class, union, or struct declaration.
-
- This function only handles one level of class nesting, but that is
- sufficient for Qt because there are no cases of class nesting more
- than one level deep.
- */
-bool CppCodeParser::matchClassDecl(InnerNode *parent,
- const QString &templateStuff)
-{
- bool isClass = (tok == Tok_class);
- readToken();
-
- bool compat = matchCompat();
-
- if (tok != Tok_Ident)
- return false;
- while (tok == Tok_Ident)
- readToken();
- if (tok == Tok_Gulbrandsen) {
- Node* n = parent->findChildNode(previousLexeme(),Node::Class);
- if (n) {
- parent = static_cast<InnerNode*>(n);
- if (parent) {
- readToken();
- if (tok != Tok_Ident)
- return false;
- readToken();
- }
- }
- }
- if (tok != Tok_Colon && tok != Tok_LeftBrace)
- return false;
-
- /*
- So far, so good. We have 'class Foo {' or 'class Foo :'.
- This is enough to recognize a class definition.
- */
- ClassNode *classe = new ClassNode(parent, previousLexeme());
- classe->setAccess(access);
- classe->setLocation(location());
- if (compat)
- classe->setStatus(Node::Compat);
- if (!physicalModuleName.isEmpty())
- classe->setPhysicalModuleName(physicalModuleName);
- classe->setTemplateStuff(templateStuff);
-
- if (match(Tok_Colon) && !matchBaseList(classe, isClass))
- return false;
- if (!match(Tok_LeftBrace))
- return false;
-
- Node::Access outerAccess = access;
- access = isClass ? Node::Private : Node::Public;
- FunctionNode::Metaness outerMetaness = metaness;
- metaness = FunctionNode::Plain;
-
- bool matches = (matchDeclList(classe) && match(Tok_RightBrace) &&
- match(Tok_Semicolon));
- access = outerAccess;
- metaness = outerMetaness;
- return matches;
-}
-
-bool CppCodeParser::matchNamespaceDecl(InnerNode *parent)
-{
- readToken(); // skip 'namespace'
- if (tok != Tok_Ident)
- return false;
- while (tok == Tok_Ident)
- readToken();
- if (tok != Tok_LeftBrace)
- return false;
-
- /*
- So far, so good. We have 'namespace Foo {'.
- */
- QString namespaceName = previousLexeme();
- NamespaceNode* ns = 0;
- if (parent)
- ns = static_cast<NamespaceNode*>(parent->findChildNode(namespaceName, Node::Namespace));
- if (!ns) {
- ns = new NamespaceNode(parent, namespaceName);
- ns->setAccess(access);
- ns->setLocation(location());
- }
-
- readToken(); // skip '{'
- bool matched = matchDeclList(ns);
- return matched && match(Tok_RightBrace);
-}
-
-/*!
- Match a C++ \c using clause. Return \c true if the match
- is successful. Otherwise false.
-
- If the \c using clause is for a namespace, an open namespace
- <is inserted for qdoc to look in to find things.
-
- If the \c using clause is a base class member function, the
- member function is added to \a parent as an unresolved
- \c using clause.
- */
-bool CppCodeParser::matchUsingDecl(InnerNode* parent)
-{
- bool usingNamespace = false;
- readToken(); // skip 'using'
-
- if (tok == Tok_namespace) {
- usingNamespace = true;
- readToken();
- }
-
- int openLeftAngles = 0;
- int openLeftParens = 0;
- bool usingOperator = false;
- QString name;
- while (tok != Tok_Semicolon) {
- if ((tok != Tok_Ident) && (tok != Tok_Gulbrandsen)) {
- if (tok == Tok_LeftAngle) {
- ++openLeftAngles;
- }
- else if (tok == Tok_RightAngle) {
- if (openLeftAngles <= 0)
- return false;
- --openLeftAngles;
- }
- else if (tok == Tok_Comma) {
- if (openLeftAngles <= 0)
- return false;
- }
- else if (tok == Tok_operator) {
- usingOperator = true;
- }
- else if (tok == Tok_SomeOperator) {
- if (!usingOperator)
- return false;
- }
- else if (tok == Tok_LeftParen) {
- ++openLeftParens;
- }
- else if (tok == Tok_RightParen) {
- if (openLeftParens <= 0)
- return false;
- --openLeftParens;
- }
- else {
- return false;
- }
- }
- name += lexeme();
- readToken();
- }
-
- if (usingNamespace) {
- // 'using namespace Foo;'.
- qdb_->insertOpenNamespace(name);
- }
- else if (parent && parent->isClass()) {
- ClassNode* cn = static_cast<ClassNode*>(parent);
- cn->addUnresolvedUsingClause(name);
- }
- return true;
-}
-
-bool CppCodeParser::matchEnumItem(InnerNode *parent, EnumNode *enume)
-{
- if (!match(Tok_Ident))
- return false;
-
- QString name = previousLexeme();
- CodeChunk val;
-
- if (match(Tok_Equal)) {
- while (tok != Tok_Comma && tok != Tok_RightBrace &&
- tok != Tok_Eoi) {
- val.append(lexeme());
- readToken();
- }
- }
-
- if (enume) {
- QString strVal = val.toString();
- if (strVal.isEmpty()) {
- if (enume->items().isEmpty()) {
- strVal = "0";
- }
- else {
- QString last = enume->items().last().value();
- bool ok;
- int n = last.toInt(&ok);
- if (ok) {
- if (last.startsWith(QLatin1Char('0')) && last.size() > 1) {
- if (last.startsWith("0x") || last.startsWith("0X"))
- strVal = last.left(2) + QString::number(n + 1, 16);
- else
- strVal = QLatin1Char('0') + QString::number(n + 1, 8);
- }
- else
- strVal = QString::number(n + 1);
- }
- }
- }
-
- enume->addItem(EnumItem(name, strVal));
- }
- else {
- VariableNode *var = new VariableNode(parent, name);
- var->setAccess(access);
- var->setLocation(location());
- var->setLeftType("const int");
- var->setStatic(true);
- }
- return true;
-}
-
-bool CppCodeParser::matchEnumDecl(InnerNode *parent)
-{
- QString name;
-
- if (!match(Tok_enum))
- return false;
- if (match(Tok_Ident))
- name = previousLexeme();
- if (tok != Tok_LeftBrace)
- return false;
-
- EnumNode *enume = 0;
-
- if (!name.isEmpty()) {
- enume = new EnumNode(parent, name);
- enume->setAccess(access);
- enume->setLocation(location());
- }
-
- readToken();
-
- if (!matchEnumItem(parent, enume))
- return false;
-
- while (match(Tok_Comma)) {
- if (!matchEnumItem(parent, enume))
- return false;
- }
- return match(Tok_RightBrace) && match(Tok_Semicolon);
-}
-
-bool CppCodeParser::matchTypedefDecl(InnerNode *parent)
-{
- CodeChunk dataType;
- QString name;
-
- if (!match(Tok_typedef))
- return false;
- if (!matchDataType(&dataType, &name))
- return false;
- if (!match(Tok_Semicolon))
- return false;
-
- if (parent && !parent->findChildNode(name, Node::Typedef)) {
- TypedefNode* td = new TypedefNode(parent, name);
- td->setAccess(access);
- td->setLocation(location());
- }
- return true;
-}
-
-bool CppCodeParser::matchProperty(InnerNode *parent)
-{
- int expected_tok = Tok_LeftParen;
- if (match(Tok_Q_PRIVATE_PROPERTY)) {
- expected_tok = Tok_Comma;
- if (!skipTo(Tok_Comma))
- return false;
- }
- else if (!match(Tok_Q_PROPERTY) &&
- !match(Tok_Q_OVERRIDE) &&
- !match(Tok_QDOC_PROPERTY)) {
- return false;
- }
-
- if (!match(expected_tok))
- return false;
-
- QString name;
- CodeChunk dataType;
- if (!matchDataType(&dataType, &name))
- return false;
-
- PropertyNode *property = new PropertyNode(parent, name);
- property->setAccess(Node::Public);
- property->setLocation(location());
- property->setDataType(dataType.toString());
-
- while (tok != Tok_RightParen && tok != Tok_Eoi) {
- if (!match(Tok_Ident))
- return false;
- QString key = previousLexeme();
- QString value;
-
- // Keywords with no associated values
- if (key == "CONSTANT") {
- property->setConstant();
- continue;
- }
- else if (key == "FINAL") {
- property->setFinal();
- continue;
- }
-
- if (match(Tok_Ident) || match(Tok_Number)) {
- value = previousLexeme();
- }
- else if (match(Tok_LeftParen)) {
- int depth = 1;
- while (tok != Tok_Eoi) {
- if (tok == Tok_LeftParen) {
- readToken();
- ++depth;
- } else if (tok == Tok_RightParen) {
- readToken();
- if (--depth == 0)
- break;
- } else {
- readToken();
- }
- }
- value = "?";
- }
-
- if (key == "READ")
- qdb_->addPropertyFunction(property, value, PropertyNode::Getter);
- else if (key == "WRITE") {
- qdb_->addPropertyFunction(property, value, PropertyNode::Setter);
- property->setWritable(true);
- }
- else if (key == "STORED")
- property->setStored(value.toLower() == "true");
- else if (key == "DESIGNABLE") {
- QString v = value.toLower();
- if (v == "true")
- property->setDesignable(true);
- else if (v == "false")
- property->setDesignable(false);
- else {
- property->setDesignable(false);
- property->setRuntimeDesFunc(value);
- }
- }
- else if (key == "RESET")
- qdb_->addPropertyFunction(property, value, PropertyNode::Resetter);
- else if (key == "NOTIFY") {
- qdb_->addPropertyFunction(property, value, PropertyNode::Notifier);
- } else if (key == "REVISION") {
- int revision;
- bool ok;
- revision = value.toInt(&ok);
- if (ok)
- property->setRevision(revision);
- else
- location().warning(tr("Invalid revision number: %1").arg(value));
- } else if (key == "SCRIPTABLE") {
- QString v = value.toLower();
- if (v == "true")
- property->setScriptable(true);
- else if (v == "false")
- property->setScriptable(false);
- else {
- property->setScriptable(false);
- property->setRuntimeScrFunc(value);
- }
- }
- }
- match(Tok_RightParen);
- return true;
-}
-
-/*!
- Parse a C++ declaration.
- */
-bool CppCodeParser::matchDeclList(InnerNode *parent)
-{
- ExtraFuncData extra;
- QString templateStuff;
- int braceDepth0 = tokenizer->braceDepth();
- if (tok == Tok_RightBrace) // prevents failure on empty body
- braceDepth0++;
-
- while (tokenizer->braceDepth() >= braceDepth0 && tok != Tok_Eoi) {
- switch (tok) {
- case Tok_Colon:
- readToken();
- break;
- case Tok_class:
- case Tok_struct:
- case Tok_union:
- matchClassDecl(parent, templateStuff);
- break;
- case Tok_namespace:
- matchNamespaceDecl(parent);
- break;
- case Tok_using:
- matchUsingDecl(parent);
- break;
- case Tok_template:
- {
- CodeChunk dataType;
- readToken();
- matchTemplateAngles(&dataType);
- templateStuff = dataType.toString();
- }
- continue;
- case Tok_enum:
- matchEnumDecl(parent);
- break;
- case Tok_typedef:
- matchTypedefDecl(parent);
- break;
- case Tok_private:
- readToken();
- access = Node::Private;
- metaness = FunctionNode::Plain;
- break;
- case Tok_protected:
- readToken();
- access = Node::Protected;
- metaness = FunctionNode::Plain;
- break;
- case Tok_public:
- readToken();
- access = Node::Public;
- metaness = FunctionNode::Plain;
- break;
- case Tok_signals:
- case Tok_Q_SIGNALS:
- readToken();
- access = Node::Public;
- metaness = FunctionNode::Signal;
- break;
- case Tok_slots:
- case Tok_Q_SLOTS:
- readToken();
- metaness = FunctionNode::Slot;
- break;
- case Tok_Q_OBJECT:
- readToken();
- break;
- case Tok_Q_OVERRIDE:
- case Tok_Q_PROPERTY:
- case Tok_Q_PRIVATE_PROPERTY:
- case Tok_QDOC_PROPERTY:
- if (!matchProperty(parent)) {
- location().warning(tr("Failed to parse token %1 in property declaration").arg(lexeme()));
- skipTo(Tok_RightParen);
- match(Tok_RightParen);
- }
- break;
- case Tok_Q_DECLARE_SEQUENTIAL_ITERATOR:
- readToken();
- if (match(Tok_LeftParen) && match(Tok_Ident))
- sequentialIteratorClasses.insert(previousLexeme(),
- location().fileName());
- match(Tok_RightParen);
- break;
- case Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR:
- readToken();
- if (match(Tok_LeftParen) && match(Tok_Ident))
- mutableSequentialIteratorClasses.insert(previousLexeme(),
- location().fileName());
- match(Tok_RightParen);
- break;
- case Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR:
- readToken();
- if (match(Tok_LeftParen) && match(Tok_Ident))
- associativeIteratorClasses.insert(previousLexeme(),
- location().fileName());
- match(Tok_RightParen);
- break;
- case Tok_Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR:
- readToken();
- if (match(Tok_LeftParen) && match(Tok_Ident))
- mutableAssociativeIteratorClasses.insert(previousLexeme(),
- location().fileName());
- match(Tok_RightParen);
- break;
- case Tok_Q_DECLARE_FLAGS:
- readToken();
- if (match(Tok_LeftParen) && match(Tok_Ident)) {
- QString flagsType = previousLexeme();
- if (match(Tok_Comma) && match(Tok_Ident)) {
- QString name = previousLexeme();
- TypedefNode *flagsNode = new TypedefNode(parent, flagsType);
- flagsNode->setAccess(access);
- flagsNode->setLocation(location());
- EnumNode* en = static_cast<EnumNode*>(parent->findChildNode(name, Node::Enum));
- if (en)
- en->setFlagsType(flagsNode);
- }
- }
- match(Tok_RightParen);
- break;
- case Tok_QT_MODULE:
- readToken();
- if (match(Tok_LeftParen) && match(Tok_Ident))
- physicalModuleName = previousLexeme();
- if (!physicalModuleName.startsWith("Qt"))
- physicalModuleName.prepend("Qt");
- match(Tok_RightParen);
- break;
- default:
- if (!matchFunctionDecl(parent, 0, 0, templateStuff, extra)) {
- while (tok != Tok_Eoi &&
- (tokenizer->braceDepth() > braceDepth0 ||
- (!match(Tok_Semicolon) &&
- tok != Tok_public && tok != Tok_protected &&
- tok != Tok_private))) {
- readToken();
- }
- }
- }
- templateStuff.clear();
- }
- return true;
-}
-
-/*!
- This is called by parseSourceFile() to do the actual parsing
- and tree building.
- */
-bool CppCodeParser::matchDocsAndStuff()
-{
- ExtraFuncData extra;
- const QSet<QString>& topicCommandsAllowed = topicCommands();
- const QSet<QString>& otherMetacommandsAllowed = otherMetaCommands();
- const QSet<QString>& metacommandsAllowed = topicCommandsAllowed + otherMetacommandsAllowed;
-
- while (tok != Tok_Eoi) {
- if (tok == Tok_Doc) {
- /*
- lexeme() returns an entire qdoc comment.
- */
- QString comment = lexeme();
- Location start_loc(location());
- readToken();
-
- Doc::trimCStyleComment(start_loc,comment);
- Location end_loc(location());
-
- /*
- Doc parses the comment.
- */
- Doc doc(start_loc,end_loc,comment,metacommandsAllowed, topicCommandsAllowed);
- QString topic;
- bool isQmlPropertyTopic = false;
- bool isJsPropertyTopic = false;
-
- const TopicList& topics = doc.topicsUsed();
- if (!topics.isEmpty()) {
- topic = topics[0].topic;
- if ((topic == COMMAND_QMLPROPERTY) ||
- (topic == COMMAND_QMLPROPERTYGROUP) ||
- (topic == COMMAND_QMLATTACHEDPROPERTY)) {
- isQmlPropertyTopic = true;
- }
- else if ((topic == COMMAND_JSPROPERTY) ||
- (topic == COMMAND_JSPROPERTYGROUP) ||
- (topic == COMMAND_JSATTACHEDPROPERTY)) {
- isJsPropertyTopic = true;
- }
- }
- NodeList nodes;
- DocList docs;
-
- if (topic.isEmpty()) {
- QStringList parentPath;
- FunctionNode *clone;
- FunctionNode *func = 0;
-
- if (matchFunctionDecl(0, &parentPath, &clone, QString(), extra)) {
- func = qdb_->findFunctionNode(parentPath, clone);
- /*
- If the node was not found, then search for it in the
- open C++ namespaces. We don't expect this search to
- be necessary often. Nor do we expect it to succeed
- very often.
- */
- if (func == 0)
- func = qdb_->findNodeInOpenNamespace(parentPath, clone);
-
- if (func) {
- func->borrowParameterNames(clone);
- nodes.append(func);
- docs.append(doc);
- }
- delete clone;
- }
- else {
- doc.location().warning(tr("Cannot tie this documentation to anything"),
- tr("I found a /*! ... */ comment, but there was no "
- "topic command (e.g., '\\%1', '\\%2') in the "
- "comment and no function definition following "
- "the comment.")
- .arg(COMMAND_FN).arg(COMMAND_PAGE));
- }
- }
- else if (isQmlPropertyTopic || isJsPropertyTopic) {
- Doc nodeDoc = doc;
- processQmlProperties(nodeDoc, nodes, docs, isJsPropertyTopic);
- }
- else {
- ArgList args;
- const QSet<QString>& topicCommandsUsed = topicCommandsAllowed & doc.metaCommandsUsed();
- if (topicCommandsUsed.count() > 0) {
- topic = *topicCommandsUsed.constBegin();
- args = doc.metaCommandArgs(topic);
- }
- if (topicCommandsUsed.count() > 1) {
- QString topics;
- QSet<QString>::ConstIterator t = topicCommandsUsed.constBegin();
- while (t != topicCommandsUsed.constEnd()) {
- topics += " \\" + *t + ",";
- ++t;
- }
- topics[topics.lastIndexOf(',')] = '.';
- int i = topics.lastIndexOf(',');
- topics[i] = ' ';
- topics.insert(i+1,"and");
- doc.location().warning(tr("Multiple topic commands found in comment: %1").arg(topics));
- }
- ArgList::ConstIterator a = args.constBegin();
- while (a != args.constEnd()) {
- Doc nodeDoc = doc;
- Node *node = processTopicCommand(nodeDoc,topic,*a);
- if (node != 0) {
- nodes.append(node);
- docs.append(nodeDoc);
- }
- ++a;
- }
- }
-
- NodeList::Iterator n = nodes.begin();
- QList<Doc>::Iterator d = docs.begin();
- while (n != nodes.end()) {
- processOtherMetaCommands(*d, *n);
- (*n)->setDoc(*d);
- checkModuleInclusion(*n);
- if ((*n)->isInnerNode() && ((InnerNode *)*n)->includes().isEmpty()) {
- InnerNode *m = static_cast<InnerNode *>(*n);
- while (m->parent() && m->physicalModuleName().isEmpty()) {
- m = m->parent();
- }
- if (m == *n)
- ((InnerNode *)*n)->addInclude((*n)->name());
- else
- ((InnerNode *)*n)->setIncludes(m->includes());
- }
- ++d;
- ++n;
- }
- }
- else if (tok == Tok_using) {
- matchUsingDecl(0);
- }
- else {
- QStringList parentPath;
- FunctionNode *clone;
- FunctionNode *node = 0;
-
- if (matchFunctionDecl(0, &parentPath, &clone, QString(), extra)) {
- /*
- The location of the definition is more interesting
- than that of the declaration. People equipped with
- a sophisticated text editor can respond to warnings
- concerning undocumented functions very quickly.
-
- Signals are implemented in uninteresting files
- generated by moc.
- */
- node = qdb_->findFunctionNode(parentPath, clone);
- if (node != 0 && node->metaness() != FunctionNode::Signal)
- node->setLocation(clone->location());
- delete clone;
- }
- else {
- if (tok != Tok_Doc)
- readToken();
- }
- }
- }
- return true;
-}
-
-/*!
- This function uses a Tokenizer to parse the function \a signature
- in an attempt to match it to the signature of a child node of \a root.
- If a match is found, \a funcPtr is set to point to the matching node
- and true is returned.
- */
-bool CppCodeParser::makeFunctionNode(const QString& signature,
- QStringList* parentPathPtr,
- FunctionNode** funcPtr,
- ExtraFuncData& extra)
-{
- Tokenizer* outerTokenizer = tokenizer;
- int outerTok = tok;
-
- QByteArray latin1 = signature.toLatin1();
- Tokenizer stringTokenizer(location(), latin1);
- stringTokenizer.setParsingFnOrMacro(true);
- tokenizer = &stringTokenizer;
- readToken();
-
- inMacroCommand_ = extra.isMacro;
- bool ok = matchFunctionDecl(extra.root, parentPathPtr, funcPtr, QString(), extra);
- inMacroCommand_ = false;
- // potential memory leak with funcPtr
-
- tokenizer = outerTokenizer;
- tok = outerTok;
- return ok;
-}
-
-/*!
- Create a new FunctionNode for a QML method or signal, as
- specified by \a type, as a child of \a parent. \a sig is
- the complete signature, and if \a attached is true, the
- method or signal is "attached". \a qdoctag is the text of
- the \a type.
-
- \a parent is the QML class node. The QML module and QML
- type names have already been consumed to find \a parent.
- What remains in \a sig is the method signature. The method
- must be a child of \a parent.
- */
-FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc,
- const QString& sig,
- InnerNode* parent,
- Node::Type type,
- bool attached,
- QString qdoctag)
-{
- QStringList pp;
- FunctionNode* fn = 0;
- ExtraFuncData extra(parent, type, attached);
- if (!makeFunctionNode(sig, &pp, &fn, extra) && !makeFunctionNode("void " + sig, &pp, &fn, extra)) {
- doc.location().warning(tr("Invalid syntax in '\\%1'").arg(qdoctag));
- }
- return fn;
-}
-
-void CppCodeParser::parseQiteratorDotH(const Location &location, const QString &filePath)
-{
- QFile file(filePath);
- if (!file.open(QFile::ReadOnly))
- return;
-
- QString text = file.readAll();
- text.remove("\r");
- text.remove("\\\n");
- QStringList lines = text.split(QLatin1Char('\n'));
- lines = lines.filter("Q_DECLARE");
- lines.replaceInStrings(QRegExp("#define Q[A-Z_]*\\(C\\)"), QString());
-
- if (lines.size() == 4) {
- sequentialIteratorDefinition = lines[0];
- mutableSequentialIteratorDefinition = lines[1];
- associativeIteratorDefinition = lines[2];
- mutableAssociativeIteratorDefinition = lines[3];
- }
- else {
- location.warning(tr("The qiterator.h hack failed"));
- }
-}
-
-void CppCodeParser::instantiateIteratorMacro(const QString &container,
- const QString &includeFile,
- const QString &macroDef)
-{
- QString resultingCode = macroDef;
- resultingCode.replace(QRegExp("\\bC\\b"), container);
- resultingCode.remove(QRegExp("\\s*##\\s*"));
-
- Location loc(includeFile); // hack to get the include file for free
- QByteArray latin1 = resultingCode.toLatin1();
- Tokenizer stringTokenizer(loc, latin1);
- tokenizer = &stringTokenizer;
- readToken();
- matchDeclList(QDocDatabase::qdocDB()->primaryTreeRoot());
-}
-
-void CppCodeParser::createExampleFileNodes(DocumentNode *dn)
-{
- QString examplePath = dn->name();
- QString proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".pro";
- QString userFriendlyFilePath;
-
- QString fullPath = Config::findFile(dn->doc().location(),
- exampleFiles,
- exampleDirs,
- proFileName,
- userFriendlyFilePath);
-
- if (fullPath.isEmpty()) {
- QString tmp = proFileName;
- proFileName = examplePath + QLatin1Char('/') + "qbuild.pro";
- userFriendlyFilePath.clear();
- fullPath = Config::findFile(dn->doc().location(),
- exampleFiles,
- exampleDirs,
- proFileName,
- userFriendlyFilePath);
- if (fullPath.isEmpty()) {
- proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".qmlproject";
- userFriendlyFilePath.clear();
- fullPath = Config::findFile(dn->doc().location(),
- exampleFiles,
- exampleDirs,
- proFileName,
- userFriendlyFilePath);
- if (fullPath.isEmpty()) {
- QString details = QLatin1String("Example directories: ") + exampleDirs.join(QLatin1Char(' '));
- if (!exampleFiles.isEmpty())
- details += QLatin1String(", example files: ") + exampleFiles.join(QLatin1Char(' '));
- dn->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName), details);
- dn->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath), details);
- return;
- }
- }
- }
-
- int sizeOfBoringPartOfName = fullPath.size() - proFileName.size();
- if (fullPath.startsWith("./"))
- sizeOfBoringPartOfName = sizeOfBoringPartOfName - 2;
- fullPath.truncate(fullPath.lastIndexOf('/'));
-
- QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter);
- QString imagesPath = fullPath + "/images";
- QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter);
- if (!exampleFiles.isEmpty()) {
- // move main.cpp and to the end, if it exists
- QString mainCpp;
- QMutableStringListIterator i(exampleFiles);
- i.toBack();
- while (i.hasPrevious()) {
- QString fileName = i.previous();
- if (fileName.endsWith("/main.cpp")) {
- mainCpp = fileName;
- i.remove();
- }
- else if (fileName.contains("/qrc_") || fileName.contains("/moc_")
- || fileName.contains("/ui_"))
- i.remove();
- }
- if (!mainCpp.isEmpty())
- exampleFiles.append(mainCpp);
-
- // add any qmake Qt resource files and qmake project files
- exampleFiles += Config::getFilesHere(fullPath, "*.qrc *.pro *.qmlproject qmldir");
- }
-
- foreach (const QString &exampleFile, exampleFiles) {
- new DocumentNode(dn,
- exampleFile.mid(sizeOfBoringPartOfName),
- Node::File,
- Node::NoPageType);
- }
- foreach (const QString &imageFile, imageFiles) {
- new DocumentNode(dn,
- imageFile.mid(sizeOfBoringPartOfName),
- Node::Image,
- Node::NoPageType);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h
deleted file mode 100644
index f9ddcab88c..0000000000
--- a/src/tools/qdoc/cppcodeparser.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 CPPCODEPARSER_H
-#define CPPCODEPARSER_H
-
-#include <qregexp.h>
-
-#include "codeparser.h"
-
-QT_BEGIN_NAMESPACE
-
-class ClassNode;
-class CodeChunk;
-class CppCodeParserPrivate;
-class FunctionNode;
-class InnerNode;
-class Tokenizer;
-
-class CppCodeParser : public CodeParser
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeParser)
-
- struct ExtraFuncData {
- InnerNode* root; // Used as the parent.
- Node::Type type; // The node type: Function, etc.
- bool isAttached; // If true, the method is attached.
- bool isMacro; // If true, we are parsing a macro signature.
- ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { }
- ExtraFuncData(InnerNode* r, Node::Type t, bool a)
- : root(r), type(t), isAttached(a), isMacro(false) { }
- };
-
-public:
- CppCodeParser();
- ~CppCodeParser();
-
- virtual void initializeParser(const Config& config) Q_DECL_OVERRIDE;
- virtual void terminateParser() Q_DECL_OVERRIDE;
- virtual QString language() Q_DECL_OVERRIDE;
- virtual QStringList headerFileNameFilter() Q_DECL_OVERRIDE;
- virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
- virtual void parseHeaderFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
- virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
- virtual void doneParsingHeaderFiles() Q_DECL_OVERRIDE;
- virtual void doneParsingSourceFiles() Q_DECL_OVERRIDE;
-
-protected:
- const QSet<QString>& topicCommands();
- const QSet<QString>& otherMetaCommands();
- virtual Node* processTopicCommand(const Doc& doc,
- const QString& command,
- const ArgLocPair& arg);
- void processQmlProperties(const Doc& doc, NodeList& nodes, DocList& docs, bool jsProps);
- bool splitQmlPropertyGroupArg(const QString& arg,
- QString& module,
- QString& element,
- QString& name);
- bool splitQmlPropertyArg(const QString& arg,
- QString& type,
- QString& module,
- QString& element,
- QString& name);
- bool splitQmlMethodArg(const QString& arg,
- QString& type,
- QString& module,
- QString& element);
- virtual void processOtherMetaCommand(const Doc& doc,
- const QString& command,
- const ArgLocPair& argLocPair,
- Node *node);
- void processOtherMetaCommands(const Doc& doc, Node *node);
-
- protected:
- void reset();
- void readToken();
- const Location& location();
- QString previousLexeme();
- QString lexeme();
-
- private:
- bool match(int target);
- bool skipTo(int target);
- bool matchCompat();
- bool matchModuleQualifier(QString& name);
- bool matchTemplateAngles(CodeChunk *type = 0);
- bool matchTemplateHeader();
- bool matchDataType(CodeChunk *type, QString *var = 0);
- bool matchParameter(FunctionNode *func);
- bool matchFunctionDecl(InnerNode *parent,
- QStringList *parentPathPtr,
- FunctionNode **funcPtr,
- const QString &templateStuff,
- ExtraFuncData& extra);
- bool matchBaseSpecifier(ClassNode *classe, bool isClass);
- bool matchBaseList(ClassNode *classe, bool isClass);
- bool matchClassDecl(InnerNode *parent,
- const QString &templateStuff = QString());
- bool matchNamespaceDecl(InnerNode *parent);
- bool matchUsingDecl(InnerNode* parent);
- bool matchEnumItem(InnerNode *parent, EnumNode *enume);
- bool matchEnumDecl(InnerNode *parent);
- bool matchTypedefDecl(InnerNode *parent);
- bool matchProperty(InnerNode *parent);
- bool matchDeclList(InnerNode *parent);
- bool matchDocsAndStuff();
- bool makeFunctionNode(const QString &synopsis,
- QStringList *parentPathPtr,
- FunctionNode **funcPtr,
- ExtraFuncData& params);
- FunctionNode* makeFunctionNode(const Doc& doc,
- const QString& sig,
- InnerNode* parent,
- Node::Type type,
- bool attached,
- QString qdoctag);
- void parseQiteratorDotH(const Location &location, const QString &filePath);
- void instantiateIteratorMacro(const QString &container,
- const QString &includeFile,
- const QString &macroDef);
- void createExampleFileNodes(DocumentNode *dn);
-
- protected:
- QMap<QString, Node::Type> nodeTypeMap;
- Tokenizer *tokenizer;
- int tok;
- Node::Access access;
- FunctionNode::Metaness metaness;
- QString physicalModuleName;
- QStringList lastPath_;
- QRegExp varComment;
- QRegExp sep;
-
- private:
- QString sequentialIteratorDefinition;
- QString mutableSequentialIteratorDefinition;
- QString associativeIteratorDefinition;
- QString mutableAssociativeIteratorDefinition;
- QMap<QString, QString> sequentialIteratorClasses;
- QMap<QString, QString> mutableSequentialIteratorClasses;
- QMap<QString, QString> associativeIteratorClasses;
- QMap<QString, QString> mutableAssociativeIteratorClasses;
-
- static QStringList exampleFiles;
- static QStringList exampleDirs;
- QString exampleNameFilter;
- QString exampleImageFilter;
-};
-
-#define COMMAND_CLASS Doc::alias("class")
-#define COMMAND_CONTENTSPAGE Doc::alias("contentspage")
-#define COMMAND_DITAMAP Doc::alias("ditamap")
-#define COMMAND_ENUM Doc::alias("enum")
-#define COMMAND_EXAMPLE Doc::alias("example")
-#define COMMAND_EXTERNALPAGE Doc::alias("externalpage")
-#define COMMAND_FILE Doc::alias("file")
-#define COMMAND_FN Doc::alias("fn")
-#define COMMAND_GROUP Doc::alias("group")
-#define COMMAND_HEADERFILE Doc::alias("headerfile")
-#define COMMAND_INDEXPAGE Doc::alias("indexpage")
-#define COMMAND_INHEADERFILE Doc::alias("inheaderfile")
-#define COMMAND_MACRO Doc::alias("macro")
-#define COMMAND_MODULE Doc::alias("module")
-#define COMMAND_NAMESPACE Doc::alias("namespace")
-#define COMMAND_OVERLOAD Doc::alias("overload")
-#define COMMAND_NEXTPAGE Doc::alias("nextpage")
-#define COMMAND_PAGE Doc::alias("page")
-#define COMMAND_PREVIOUSPAGE Doc::alias("previouspage")
-#define COMMAND_PROPERTY Doc::alias("property")
-#define COMMAND_REIMP Doc::alias("reimp")
-#define COMMAND_RELATES Doc::alias("relates")
-#define COMMAND_STARTPAGE Doc::alias("startpage")
-#define COMMAND_TYPEDEF Doc::alias("typedef")
-#define COMMAND_VARIABLE Doc::alias("variable")
-#define COMMAND_QMLABSTRACT Doc::alias("qmlabstract")
-#define COMMAND_QMLTYPE Doc::alias("qmltype")
-#define COMMAND_QMLPROPERTY Doc::alias("qmlproperty")
-#define COMMAND_QMLPROPERTYGROUP Doc::alias("qmlpropertygroup")
-#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty")
-#define COMMAND_QMLINHERITS Doc::alias("inherits")
-#define COMMAND_QMLINSTANTIATES Doc::alias("instantiates")
-#define COMMAND_QMLSIGNAL Doc::alias("qmlsignal")
-#define COMMAND_QMLATTACHEDSIGNAL Doc::alias("qmlattachedsignal")
-#define COMMAND_QMLMETHOD Doc::alias("qmlmethod")
-#define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod")
-#define COMMAND_QMLDEFAULT Doc::alias("default")
-#define COMMAND_QMLREADONLY Doc::alias("readonly")
-#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype")
-#define COMMAND_QMLMODULE Doc::alias("qmlmodule")
-#define COMMAND_AUDIENCE Doc::alias("audience")
-#define COMMAND_CATEGORY Doc::alias("category")
-#define COMMAND_PRODNAME Doc::alias("prodname")
-#define COMMAND_COMPONENT Doc::alias("component")
-#define COMMAND_AUTHOR Doc::alias("author")
-#define COMMAND_PUBLISHER Doc::alias("publisher")
-#define COMMAND_COPYRYEAR Doc::alias("copyryear")
-#define COMMAND_COPYRHOLDER Doc::alias("copyrholder")
-#define COMMAND_PERMISSIONS Doc::alias("permissions")
-#define COMMAND_LIFECYCLEVERSION Doc::alias("lifecycleversion")
-#define COMMAND_LIFECYCLEWSTATUS Doc::alias("lifecyclestatus")
-#define COMMAND_LICENSEYEAR Doc::alias("licenseyear")
-#define COMMAND_LICENSENAME Doc::alias("licensename")
-#define COMMAND_LICENSEDESCRIPTION Doc::alias("licensedescription")
-#define COMMAND_RELEASEDATE Doc::alias("releasedate")
-#define COMMAND_QTVARIABLE Doc::alias("qtvariable")
-// Some of these are not used currenmtly, but they are included now for completeness.
-#define COMMAND_JSTYPE Doc::alias("jstype")
-#define COMMAND_JSPROPERTY Doc::alias("jsproperty")
-#define COMMAND_JSPROPERTYGROUP Doc::alias("jspropertygroup")
-#define COMMAND_JSATTACHEDPROPERTY Doc::alias("jsattachedproperty")
-#define COMMAND_JSSIGNAL Doc::alias("jssignal")
-#define COMMAND_JSATTACHEDSIGNAL Doc::alias("jsattachedsignal")
-#define COMMAND_JSMETHOD Doc::alias("jsmethod")
-#define COMMAND_JSATTACHEDMETHOD Doc::alias("jsattachedmethod")
-#define COMMAND_JSBASICTYPE Doc::alias("jsbasictype")
-#define COMMAND_JSMODULE Doc::alias("jsmodule")
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
deleted file mode 100644
index 92c6d405de..0000000000
--- a/src/tools/qdoc/doc.cpp
+++ /dev/null
@@ -1,3403 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "config.h"
-#include "doc.h"
-#include "codemarker.h"
-#include "editdistance.h"
-#include "openedlist.h"
-#include "quoter.h"
-#include "text.h"
-#include "atom.h"
-#include "tokenizer.h"
-#include <qdatetime.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qhash.h>
-#include <qtextstream.h>
-#include <qregexp.h>
-#include <ctype.h>
-#include <limits.h>
-#include <qdebug.h>
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-Q_GLOBAL_STATIC(QSet<QString>, null_Set_QString)
-Q_GLOBAL_STATIC(TopicList, nullTopicList)
-Q_GLOBAL_STATIC(QStringList, null_QStringList)
-Q_GLOBAL_STATIC(QList<Text>, null_QList_Text)
-Q_GLOBAL_STATIC(QStringMultiMap, null_QStringMultiMap)
-
-struct Macro
-{
- QString defaultDef;
- Location defaultDefLocation;
- QStringMap otherDefs;
- int numParams;
-};
-
-enum {
- CMD_A,
- CMD_ABSTRACT,
- CMD_ANNOTATEDLIST,
- CMD_B,
- CMD_BADCODE,
- CMD_BOLD,
- CMD_BR,
- CMD_BRIEF,
- CMD_C,
- CMD_CAPTION,
- CMD_CHAPTER,
- CMD_CODE,
- CMD_CODELINE,
- CMD_DIV,
- CMD_DOTS,
- CMD_E,
- CMD_ELSE,
- CMD_ENDABSTRACT,
- CMD_ENDCHAPTER,
- CMD_ENDCODE,
- CMD_ENDDIV,
- CMD_ENDFOOTNOTE,
- CMD_ENDIF,
- CMD_ENDLEGALESE,
- CMD_ENDLINK,
- CMD_ENDLIST,
- CMD_ENDMAPREF,
- CMD_ENDOMIT,
- CMD_ENDPART,
- CMD_ENDQUOTATION,
- CMD_ENDRAW,
- CMD_ENDSECTION1,
- CMD_ENDSECTION2,
- CMD_ENDSECTION3,
- CMD_ENDSECTION4,
- CMD_ENDSIDEBAR,
- CMD_ENDTABLE,
- CMD_ENDTOPICREF,
- CMD_FOOTNOTE,
- CMD_GENERATELIST,
- CMD_GRANULARITY,
- CMD_HEADER,
- CMD_HR,
- CMD_I,
- CMD_IF,
- CMD_IMAGE,
- CMD_IMPORTANT,
- CMD_INCLUDE,
- CMD_INLINEIMAGE,
- CMD_INDEX,
- CMD_INPUT,
- CMD_KEYWORD,
- CMD_L,
- CMD_LEGALESE,
- CMD_LI,
- CMD_LINK,
- CMD_LIST,
- CMD_MAPREF,
- CMD_META,
- CMD_NEWCODE,
- CMD_NOTE,
- CMD_O,
- CMD_OLDCODE,
- CMD_OMIT,
- CMD_OMITVALUE,
- CMD_OVERLOAD,
- CMD_PART,
- CMD_PRINTLINE,
- CMD_PRINTTO,
- CMD_PRINTUNTIL,
- CMD_QUOTATION,
- CMD_QUOTEFILE,
- CMD_QUOTEFROMFILE,
- CMD_QUOTEFUNCTION,
- CMD_RAW,
- CMD_ROW,
- CMD_SA,
- CMD_SECTION1,
- CMD_SECTION2,
- CMD_SECTION3,
- CMD_SECTION4,
- CMD_SIDEBAR,
- CMD_SINCELIST,
- CMD_SKIPLINE,
- CMD_SKIPTO,
- CMD_SKIPUNTIL,
- CMD_SNIPPET,
- CMD_SPAN,
- CMD_SUB,
- CMD_SUP,
- CMD_TABLE,
- CMD_TABLEOFCONTENTS,
- CMD_TARGET,
- CMD_TOPICREF,
- CMD_TT,
- CMD_UICONTROL,
- CMD_UNDERLINE,
- CMD_UNICODE,
- CMD_VALUE,
- CMD_WARNING,
- CMD_QML,
- CMD_ENDQML,
- CMD_CPP,
- CMD_ENDCPP,
- CMD_QMLTEXT,
- CMD_ENDQMLTEXT,
- CMD_CPPTEXT,
- CMD_ENDCPPTEXT,
- CMD_JS,
- CMD_ENDJS,
- NOT_A_CMD
-};
-
-static struct {
- const char *english;
- int no;
- QString *alias;
-} cmds[] = {
- { "a", CMD_A, 0 },
- { "abstract", CMD_ABSTRACT, 0 },
- { "annotatedlist", CMD_ANNOTATEDLIST, 0 },
- { "b", CMD_B, 0 },
- { "badcode", CMD_BADCODE, 0 },
- { "bold", CMD_BOLD, 0 },
- { "br", CMD_BR, 0 },
- { "brief", CMD_BRIEF, 0 },
- { "c", CMD_C, 0 },
- { "caption", CMD_CAPTION, 0 },
- { "chapter", CMD_CHAPTER, 0 },
- { "code", CMD_CODE, 0 },
- { "codeline", CMD_CODELINE, 0},
- { "div", CMD_DIV, 0 },
- { "dots", CMD_DOTS, 0 },
- { "e", CMD_E, 0 },
- { "else", CMD_ELSE, 0 },
- { "endabstract", CMD_ENDABSTRACT, 0 },
- { "endchapter", CMD_ENDCHAPTER, 0 },
- { "endcode", CMD_ENDCODE, 0 },
- { "enddiv", CMD_ENDDIV, 0 },
- { "endfootnote", CMD_ENDFOOTNOTE, 0 },
- { "endif", CMD_ENDIF, 0 },
- { "endlegalese", CMD_ENDLEGALESE, 0 },
- { "endlink", CMD_ENDLINK, 0 },
- { "endlist", CMD_ENDLIST, 0 },
- { "endmapref", CMD_ENDMAPREF, 0 },
- { "endomit", CMD_ENDOMIT, 0 },
- { "endpart", CMD_ENDPART, 0 },
- { "endquotation", CMD_ENDQUOTATION, 0 },
- { "endraw", CMD_ENDRAW, 0 },
- { "endsection1", CMD_ENDSECTION1, 0 }, // ### don't document for now
- { "endsection2", CMD_ENDSECTION2, 0 }, // ### don't document for now
- { "endsection3", CMD_ENDSECTION3, 0 }, // ### don't document for now
- { "endsection4", CMD_ENDSECTION4, 0 }, // ### don't document for now
- { "endsidebar", CMD_ENDSIDEBAR, 0 },
- { "endtable", CMD_ENDTABLE, 0 },
- { "endtopicref", CMD_ENDTOPICREF, 0 },
- { "footnote", CMD_FOOTNOTE, 0 },
- { "generatelist", CMD_GENERATELIST, 0 },
- { "granularity", CMD_GRANULARITY, 0 }, // ### don't document for now
- { "header", CMD_HEADER, 0 },
- { "hr", CMD_HR, 0 },
- { "i", CMD_I, 0 },
- { "if", CMD_IF, 0 },
- { "image", CMD_IMAGE, 0 },
- { "important", CMD_IMPORTANT, 0 },
- { "include", CMD_INCLUDE, 0 },
- { "inlineimage", CMD_INLINEIMAGE, 0 },
- { "index", CMD_INDEX, 0 }, // ### don't document for now
- { "input", CMD_INPUT, 0 },
- { "keyword", CMD_KEYWORD, 0 },
- { "l", CMD_L, 0 },
- { "legalese", CMD_LEGALESE, 0 },
- { "li", CMD_LI, 0 },
- { "link", CMD_LINK, 0 },
- { "list", CMD_LIST, 0 },
- { "mapref", CMD_MAPREF, 0 },
- { "meta", CMD_META, 0 },
- { "newcode", CMD_NEWCODE, 0 },
- { "note", CMD_NOTE, 0 },
- { "o", CMD_O, 0 },
- { "oldcode", CMD_OLDCODE, 0 },
- { "omit", CMD_OMIT, 0 },
- { "omitvalue", CMD_OMITVALUE, 0 },
- { "overload", CMD_OVERLOAD, 0 },
- { "part", CMD_PART, 0 },
- { "printline", CMD_PRINTLINE, 0 },
- { "printto", CMD_PRINTTO, 0 },
- { "printuntil", CMD_PRINTUNTIL, 0 },
- { "quotation", CMD_QUOTATION, 0 },
- { "quotefile", CMD_QUOTEFILE, 0 },
- { "quotefromfile", CMD_QUOTEFROMFILE, 0 },
- { "quotefunction", CMD_QUOTEFUNCTION, 0 },
- { "raw", CMD_RAW, 0 },
- { "row", CMD_ROW, 0 },
- { "sa", CMD_SA, 0 },
- { "section1", CMD_SECTION1, 0 },
- { "section2", CMD_SECTION2, 0 },
- { "section3", CMD_SECTION3, 0 },
- { "section4", CMD_SECTION4, 0 },
- { "sidebar", CMD_SIDEBAR, 0 },
- { "sincelist", CMD_SINCELIST, 0 },
- { "skipline", CMD_SKIPLINE, 0 },
- { "skipto", CMD_SKIPTO, 0 },
- { "skipuntil", CMD_SKIPUNTIL, 0 },
- { "snippet", CMD_SNIPPET, 0 },
- { "span", CMD_SPAN, 0 },
- { "sub", CMD_SUB, 0 },
- { "sup", CMD_SUP, 0 },
- { "table", CMD_TABLE, 0 },
- { "tableofcontents", CMD_TABLEOFCONTENTS, 0 },
- { "target", CMD_TARGET, 0 },
- { "topicref", CMD_TOPICREF, 0 },
- { "tt", CMD_TT, 0 },
- { "uicontrol", CMD_UICONTROL, 0 },
- { "underline", CMD_UNDERLINE, 0 },
- { "unicode", CMD_UNICODE, 0 },
- { "value", CMD_VALUE, 0 },
- { "warning", CMD_WARNING, 0 },
- { "qml", CMD_QML, 0 },
- { "endqml", CMD_ENDQML, 0 },
- { "cpp", CMD_CPP, 0 },
- { "endcpp", CMD_ENDCPP, 0 },
- { "qmltext", CMD_QMLTEXT, 0 },
- { "endqmltext", CMD_ENDQMLTEXT, 0 },
- { "cpptext", CMD_CPPTEXT, 0 },
- { "endcpptext", CMD_ENDCPPTEXT, 0 },
- { "js", CMD_JS, 0 },
- { "endjs", CMD_ENDJS, 0 },
- { 0, 0, 0 }
-};
-
-typedef QHash<QString, int> QHash_QString_int;
-typedef QHash<QString, Macro> QHash_QString_Macro;
-
-Q_GLOBAL_STATIC(QStringMap, aliasMap)
-Q_GLOBAL_STATIC(QHash_QString_int, cmdHash)
-Q_GLOBAL_STATIC(QHash_QString_Macro, macroHash)
-
-class DocPrivateExtra
-{
-public:
- Doc::Sections granularity_;
- Doc::Sections section_; // ###
- QList<Atom*> tableOfContents_;
- QList<int> tableOfContentsLevels_;
- QList<Atom*> keywords_;
- QList<Atom*> targets_;
- QStringMultiMap metaMap_;
-
- DocPrivateExtra()
- : granularity_(Doc::Part)
- , section_(Doc::NoSection)
- { }
-};
-
-struct Shared // ### get rid of
-{
- Shared()
- : count(1) { }
- void ref() { ++count; }
- bool deref() { return (--count == 0); }
-
- int count;
-};
-
-static QString cleanLink(const QString &link)
-{
- int colonPos = link.indexOf(':');
- if ((colonPos == -1) ||
- (!link.startsWith("file:") && !link.startsWith("mailto:")))
- return link;
- return link.mid(colonPos + 1).simplified();
-}
-
-typedef QMap<QString, ArgList> CommandMap;
-
-class DocPrivate : public Shared
-{
-public:
- DocPrivate(const Location& start = Location::null,
- const Location& end = Location::null,
- const QString& source = QString());
- ~DocPrivate();
-
- void addAlso(const Text& also);
- void constructExtra();
- bool isEnumDocSimplifiable() const;
-
- // ### move some of this in DocPrivateExtra
- Location start_loc;
- Location end_loc;
- QString src;
- Text text;
- QSet<QString> params;
- QList<Text> alsoList;
- QStringList enumItemList;
- QStringList omitEnumItemList;
- QSet<QString> metacommandsUsed;
- CommandMap metaCommandMap;
- bool hasLegalese : 1;
- bool hasSectioningUnits : 1;
- DocPrivateExtra *extra;
- TopicList topics_;
- DitaRefList ditamap_;
-};
-
-DocPrivate::DocPrivate(const Location& start,
- const Location& end,
- const QString& source)
- : start_loc(start),
- end_loc(end),
- src(source),
- hasLegalese(false),
- hasSectioningUnits(false),
- extra(0)
-{
- // nothing.
-}
-
-/*!
- If the doc is a ditamap, the destructor deletes each element
- in the ditamap structure. These were allocated as needed.
- */
-DocPrivate::~DocPrivate()
-{
- delete extra;
- foreach (DitaRef* t, ditamap_) {
- delete t;
- }
-}
-
-void DocPrivate::addAlso(const Text& also)
-{
- alsoList.append(also);
-}
-
-void DocPrivate::constructExtra()
-{
- if (extra == 0)
- extra = new DocPrivateExtra;
-}
-
-bool DocPrivate::isEnumDocSimplifiable() const
-{
- bool justMetColon = false;
- int numValueTables = 0;
-
- const Atom *atom = text.firstAtom();
- while (atom) {
- if (atom->type() == Atom::AutoLink || atom->type() == Atom::String) {
- justMetColon = atom->string().endsWith(QLatin1Char(':'));
- }
- else if ((atom->type() == Atom::ListLeft) &&
- (atom->string() == ATOM_LIST_VALUE)) {
- if (justMetColon || numValueTables > 0)
- return false;
- ++numValueTables;
- }
- atom = atom->next();
- }
- return true;
-}
-
-class DocParser
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::DocParser)
-
-public:
- void parse(const QString &source,
- DocPrivate *docPrivate,
- const QSet<QString> &metaCommandSet,
- const QSet<QString>& possibleTopics);
-
- static int endCmdFor(int cmd);
- static QString cmdName(int cmd);
- static QString endCmdName(int cmd);
- static QString untabifyEtc(const QString& str);
- static int indentLevel(const QString& str);
- static QString unindent(int level, const QString& str);
- static QString slashed(const QString& str);
-
- static int tabSize;
- static QStringList exampleFiles;
- static QStringList exampleDirs;
- static QStringList sourceFiles;
- static QStringList sourceDirs;
- static bool quoting;
-
-private:
- Location& location();
- QString detailsUnknownCommand(const QSet<QString>& metaCommandSet,
- const QString& str);
- void insertTarget(const QString& target, bool keyword);
- void include(const QString& fileName, const QString& identifier);
- void startFormat(const QString& format, int cmd);
- bool openCommand(int cmd);
- bool closeCommand(int endCmd);
- void startSection(Doc::Sections unit, int cmd);
- void endSection(int unit, int endCmd);
- void parseAlso();
- void append(const QString &string);
- void append(Atom::Type type, const QString& string = QString());
- void append(Atom::Type type, const QString& p1, const QString& p2);
- void append(const QString& p1, const QString& p2);
- void appendChar(QChar ch);
- void appendWord(const QString &word);
- void appendToCode(const QString &code);
- void appendToCode(const QString &code, Atom::Type defaultType);
- void startNewPara();
- void enterPara(Atom::Type leftType = Atom::ParaLeft,
- Atom::Type rightType = Atom::ParaRight,
- const QString& string = QString());
- void leavePara();
- void leaveValue();
- void leaveValueList();
- void leaveTableRow();
- CodeMarker *quoteFromFile();
- void expandMacro(const QString& name, const QString& def, int numParams);
- QString expandMacroToString(const QString &name, const QString &def, int numParams);
- Doc::Sections getSectioningUnit();
- QString getArgument(bool verbatim = false);
- QString getBracedArgument(bool verbatim);
- QString getBracketedArgument();
- QString getOptionalArgument();
- QString getRestOfLine();
- QString getMetaCommandArgument(const QString &cmdStr);
- QString getUntilEnd(int cmd);
- QString getCode(int cmd, CodeMarker *marker);
- QString getUnmarkedCode(int cmd);
-
- bool isBlankLine();
- bool isLeftBraceAhead();
- bool isLeftBracketAhead();
- void skipSpacesOnLine();
- void skipSpacesOrOneEndl();
- void skipAllSpaces();
- void skipToNextPreprocessorCommand();
-
- QStack<int> openedInputs;
-
- QString in;
- int pos;
- int len;
- Location cachedLoc;
- int cachedPos;
-
- DocPrivate* priv;
- enum ParagraphState {
- OutsideParagraph,
- InSingleLineParagraph,
- InMultiLineParagraph
- };
- ParagraphState paraState;
- bool inTableHeader;
- bool inTableRow;
- bool inTableItem;
- bool indexStartedPara; // ### rename
- Atom::Type pendingParaLeftType;
- Atom::Type pendingParaRightType;
- QString pendingParaString;
-
- int braceDepth;
- int minIndent;
- Doc::Sections currentSection;
- QMap<QString, Location> targetMap_;
- QMap<int, QString> pendingFormats;
- QStack<int> openedCommands;
- QStack<OpenedList> openedLists;
- Quoter quoter;
- QStack<DitaRef*> ditarefs_;
-};
-
-int DocParser::tabSize;
-QStringList DocParser::exampleFiles;
-QStringList DocParser::exampleDirs;
-QStringList DocParser::sourceFiles;
-QStringList DocParser::sourceDirs;
-bool DocParser::quoting;
-
-/*!
- Parse the \a source string to build a Text data structure
- in \a docPrivate. The Text data structure is a linked list
- of Atoms.
-
- \a metaCommandSet is the set of metacommands that may be
- found in \a source. These metacommands are not markup text
- commands. They are topic commands and related metacommands.
- */
-void DocParser::parse(const QString& source,
- DocPrivate *docPrivate,
- const QSet<QString>& metaCommandSet,
- const QSet<QString>& possibleTopics)
-{
- in = source;
- pos = 0;
- len = in.length();
- cachedLoc = docPrivate->start_loc;
- cachedPos = 0;
- priv = docPrivate;
- priv->text << Atom::Nop;
- priv->topics_.clear();
-
- paraState = OutsideParagraph;
- inTableHeader = false;
- inTableRow = false;
- inTableItem = false;
- indexStartedPara = false;
- pendingParaLeftType = Atom::Nop;
- pendingParaRightType = Atom::Nop;
-
- braceDepth = 0;
- minIndent = INT_MAX;
- currentSection = Doc::NoSection;
- openedCommands.push(CMD_OMIT);
- quoter.reset();
-
- CodeMarker *marker = 0;
- Atom *currentLinkAtom = 0;
- QString p1, p2;
- QStack<bool> preprocessorSkipping;
- int numPreprocessorSkipping = 0;
-
- while (pos < len) {
- QChar ch = in.at(pos);
-
- switch (ch.unicode()) {
- case '\\':
- {
- QString cmdStr;
- pos++;
- while (pos < len) {
- ch = in.at(pos);
- if (ch.isLetterOrNumber()) {
- cmdStr += ch;
- pos++;
- }
- else {
- break;
- }
- }
- if (cmdStr.isEmpty()) {
- if (pos < len) {
- enterPara();
- if (in.at(pos).isSpace()) {
- skipAllSpaces();
- appendChar(QLatin1Char(' '));
- }
- else {
- appendChar(in.at(pos++));
- }
- }
- }
- else {
- int cmd = cmdHash()->value(cmdStr,NOT_A_CMD);
- switch (cmd) {
- case CMD_A:
- enterPara();
- p1 = getArgument();
- append(Atom::FormattingLeft,ATOM_FORMATTING_PARAMETER);
- append(Atom::String, p1);
- append(Atom::FormattingRight,ATOM_FORMATTING_PARAMETER);
- priv->params.insert(p1);
- break;
- case CMD_ABSTRACT:
- if (openCommand(cmd)) {
- leavePara();
- append(Atom::AbstractLeft);
- }
- break;
- case CMD_BADCODE:
- leavePara();
- append(Atom::CodeBad,getCode(CMD_BADCODE, marker));
- break;
- case CMD_BR:
- enterPara();
- append(Atom::BR);
- break;
- case CMD_BOLD:
- location().warning(tr("'\\bold' is deprecated. Use '\\b'"));
- case CMD_B:
- startFormat(ATOM_FORMATTING_BOLD, cmd);
- break;
- case CMD_BRIEF:
- leavePara();
- enterPara(Atom::BriefLeft, Atom::BriefRight);
- break;
- case CMD_C:
- enterPara();
- p1 = untabifyEtc(getArgument(true));
- marker = CodeMarker::markerForCode(p1);
- append(Atom::C, marker->markedUpCode(p1, 0, location()));
- break;
- case CMD_CAPTION:
- leavePara();
- enterPara(Atom::CaptionLeft, Atom::CaptionRight);
- break;
- case CMD_CHAPTER:
- startSection(Doc::Chapter, cmd);
- break;
- case CMD_CODE:
- leavePara();
- append(Atom::Code, getCode(CMD_CODE, 0));
- break;
- case CMD_QML:
- leavePara();
- append(Atom::Qml, getCode(CMD_QML, CodeMarker::markerForLanguage(QLatin1String("QML"))));
- break;
- case CMD_QMLTEXT:
- append(Atom::QmlText);
- break;
- case CMD_JS:
- leavePara();
- append(Atom::JavaScript, getCode(CMD_JS, CodeMarker::markerForLanguage(QLatin1String("JavaScript"))));
- break;
- case CMD_DIV:
- leavePara();
- p1 = getArgument(true);
- append(Atom::DivLeft, p1);
- openedCommands.push(cmd);
- break;
- case CMD_ENDDIV:
- leavePara();
- append(Atom::DivRight);
- closeCommand(cmd);
- break;
- case CMD_CODELINE:
- {
- if (!quoting) {
- if (priv->text.lastAtom()->type() == Atom::Code
- && priv->text.lastAtom()->string().endsWith("\n\n"))
- priv->text.lastAtom()->chopString();
- appendToCode("\n");
- }
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, " ");
- }
- }
- break;
- case CMD_DOTS:
- {
- if (!quoting) {
- if (priv->text.lastAtom()->type() == Atom::Code
- && priv->text.lastAtom()->string().endsWith("\n\n"))
- priv->text.lastAtom()->chopString();
-
- QString arg = getOptionalArgument();
- int indent = 4;
- if (!arg.isEmpty())
- indent = arg.toInt();
- for (int i = 0; i < indent; ++i)
- appendToCode(" ");
- appendToCode("...\n");
- }
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- QString arg = getOptionalArgument();
- if (arg.isEmpty())
- arg = "4";
- append(Atom::CodeQuoteArgument, arg);
- }
- }
- break;
- case CMD_ELSE:
- if (preprocessorSkipping.size() > 0) {
- if (preprocessorSkipping.top()) {
- --numPreprocessorSkipping;
- }
- else {
- ++numPreprocessorSkipping;
- }
- preprocessorSkipping.top() = !preprocessorSkipping.top();
- (void)getRestOfLine(); // ### should ensure that it's empty
- if (numPreprocessorSkipping)
- skipToNextPreprocessorCommand();
- }
- else {
- location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_ELSE)));
- }
- break;
- case CMD_ENDABSTRACT:
- if (closeCommand(cmd)) {
- leavePara();
- append(Atom::AbstractRight);
- }
- break;
- case CMD_ENDCHAPTER:
- endSection(Doc::Chapter, cmd);
- break;
- case CMD_ENDCODE:
- closeCommand(cmd);
- break;
- case CMD_ENDQML:
- closeCommand(cmd);
- break;
- case CMD_ENDQMLTEXT:
- append(Atom::EndQmlText);
- break;
- case CMD_ENDJS:
- closeCommand(cmd);
- break;
- case CMD_ENDFOOTNOTE:
- if (closeCommand(cmd)) {
- leavePara();
- append(Atom::FootnoteRight);
- paraState = InMultiLineParagraph; // ###
- }
- break;
- case CMD_ENDIF:
- if (preprocessorSkipping.count() > 0) {
- if (preprocessorSkipping.pop())
- --numPreprocessorSkipping;
- (void)getRestOfLine(); // ### should ensure that it's empty
- if (numPreprocessorSkipping)
- skipToNextPreprocessorCommand();
- }
- else {
- location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_ENDIF)));
- }
- break;
- case CMD_ENDLEGALESE:
- if (closeCommand(cmd)) {
- leavePara();
- append(Atom::LegaleseRight);
- }
- break;
- case CMD_ENDLINK:
- if (closeCommand(cmd)) {
- if (priv->text.lastAtom()->type() == Atom::String
- && priv->text.lastAtom()->string().endsWith(QLatin1Char(' ')))
- priv->text.lastAtom()->chopString();
- append(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- }
- break;
- case CMD_ENDLIST:
- if (closeCommand(cmd)) {
- leavePara();
- if (openedLists.top().isStarted()) {
- append(Atom::ListItemRight,
- openedLists.top().styleString());
- append(Atom::ListRight,
- openedLists.top().styleString());
- }
- openedLists.pop();
- }
- break;
- case CMD_ENDMAPREF:
- case CMD_ENDTOPICREF:
- if (closeCommand(cmd)) {
- ditarefs_.pop(); // zzz
- }
- break;
- case CMD_ENDOMIT:
- closeCommand(cmd);
- break;
- case CMD_ENDPART:
- endSection(Doc::Part, cmd);
- break;
- case CMD_ENDQUOTATION:
- if (closeCommand(cmd)) {
- leavePara();
- append(Atom::QuotationRight);
- }
- break;
- case CMD_ENDRAW:
- location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_ENDRAW)));
- break;
- case CMD_ENDSECTION1:
- endSection(Doc::Section1, cmd);
- break;
- case CMD_ENDSECTION2:
- endSection(Doc::Section2, cmd);
- break;
- case CMD_ENDSECTION3:
- endSection(Doc::Section3, cmd);
- break;
- case CMD_ENDSECTION4:
- endSection(Doc::Section4, cmd);
- break;
- case CMD_ENDSIDEBAR:
- if (closeCommand(cmd)) {
- leavePara();
- append(Atom::SidebarRight);
- }
- break;
- case CMD_ENDTABLE:
- if (closeCommand(cmd)) {
- leaveTableRow();
- append(Atom::TableRight);
- }
- break;
- case CMD_FOOTNOTE:
- if (openCommand(cmd)) {
- enterPara();
- append(Atom::FootnoteLeft);
- paraState = OutsideParagraph; // ###
- }
- break;
- case CMD_ANNOTATEDLIST:
- append(Atom::AnnotatedList, getArgument());
- break;
- case CMD_SINCELIST:
- append(Atom::SinceList, getRestOfLine().simplified());
- break;
- case CMD_GENERATELIST:
- {
- QString arg1 = getArgument();
- QString arg2 = getOptionalArgument();
- if (!arg2.isEmpty())
- arg1 += " " + arg2;
- append(Atom::GeneratedList, arg1);
- }
- break;
- case CMD_GRANULARITY:
- priv->constructExtra();
- priv->extra->granularity_ = getSectioningUnit();
- break;
- case CMD_HEADER:
- if (openedCommands.top() == CMD_TABLE) {
- leaveTableRow();
- append(Atom::TableHeaderLeft);
- inTableHeader = true;
- }
- else {
- if (openedCommands.contains(CMD_TABLE)) {
- location().warning(tr("Cannot use '\\%1' within '\\%2'")
- .arg(cmdName(CMD_HEADER))
- .arg(cmdName(openedCommands.top())));
- }
- else {
- location().warning(tr("Cannot use '\\%1' outside of '\\%2'")
- .arg(cmdName(CMD_HEADER))
- .arg(cmdName(CMD_TABLE)));
- }
- }
- break;
- case CMD_I:
- location().warning(tr("'\\i' is deprecated. Use '\\e' for italic or '\\li' for list item"));
- case CMD_E:
- startFormat(ATOM_FORMATTING_ITALIC, cmd);
- break;
- case CMD_HR:
- leavePara();
- append(Atom::HR);
- break;
- case CMD_IF:
- preprocessorSkipping.push(!Tokenizer::isTrue(getRestOfLine()));
- if (preprocessorSkipping.top())
- ++numPreprocessorSkipping;
- if (numPreprocessorSkipping)
- skipToNextPreprocessorCommand();
- break;
- case CMD_IMAGE:
- leaveValueList();
- append(Atom::Image, getArgument());
- append(Atom::ImageText, getRestOfLine());
- break;
- case CMD_IMPORTANT:
- leavePara();
- enterPara(Atom::ImportantLeft, Atom::ImportantRight);
- break;
- case CMD_INCLUDE:
- case CMD_INPUT:
- {
- QString fileName = getArgument();
- QString identifier = getRestOfLine();
- include(fileName, identifier);
- }
- break;
- case CMD_INLINEIMAGE:
- enterPara();
- append(Atom::InlineImage, getArgument());
- append(Atom::ImageText, getRestOfLine());
- append(Atom::String, " ");
- break;
- case CMD_INDEX:
- if (paraState == OutsideParagraph) {
- enterPara();
- indexStartedPara = true;
- }
- else {
- const Atom *last = priv->text.lastAtom();
- if (indexStartedPara &&
- (last->type() != Atom::FormattingRight ||
- last->string() != ATOM_FORMATTING_INDEX))
- indexStartedPara = false;
- }
- startFormat(ATOM_FORMATTING_INDEX, cmd);
- break;
- case CMD_KEYWORD:
- insertTarget(getRestOfLine(),true);
- break;
- case CMD_L:
- enterPara();
- if (isLeftBracketAhead()) {
- p2 = getBracketedArgument();
- }
- if (isLeftBraceAhead()) {
- p1 = getArgument();
- append(p1, p2);
- if (!p2.isEmpty() && !(priv->text.lastAtom()->error().isEmpty())) {
- location().warning(tr("Check parameter in '[ ]' of '\\l' command: '%1', "
- "possible misspelling, or unrecognized module name")
- .arg(priv->text.lastAtom()->error()));
- }
- if (isLeftBraceAhead()) {
- currentLinkAtom = priv->text.lastAtom();
- startFormat(ATOM_FORMATTING_LINK, cmd);
- }
- else {
- append(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- append(Atom::String, cleanLink(p1));
- append(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- }
- }
- else {
- p1 = getArgument();
- append(p1, p2);
- if (!p2.isEmpty() && !(priv->text.lastAtom()->error().isEmpty())) {
- location().warning(tr("Check parameter in '[ ]' of '\\l' command: '%1', "
- "possible misspelling, or unrecognized module name")
- .arg(priv->text.lastAtom()->error()));
- }
- append(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- append(Atom::String, cleanLink(p1));
- append(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- }
- p2.clear();
- break;
- case CMD_LEGALESE:
- leavePara();
- if (openCommand(cmd))
- append(Atom::LegaleseLeft);
- docPrivate->hasLegalese = true;
- break;
- case CMD_LINK:
- if (openCommand(cmd)) {
- enterPara();
- p1 = getArgument();
- append(p1);
- append(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- skipSpacesOrOneEndl();
- }
- break;
- case CMD_LIST:
- if (openCommand(cmd)) {
- leavePara();
- openedLists.push(OpenedList(location(),
- getOptionalArgument()));
- }
- break;
- case CMD_TOPICREF:
- case CMD_MAPREF:
- if (openCommand(cmd)) {
- DitaRef* t = 0;
- if (cmd == CMD_MAPREF)
- t = new MapRef();
- else
- t = new TopicRef();
- t->setNavtitle(getArgument(true));
- if (cmd == CMD_MAPREF)
- t->setHref(getArgument());
- else
- t->setHref(getOptionalArgument());
- if (ditarefs_.isEmpty())
- priv->ditamap_.append(t);
- else
- ditarefs_.top()->appendSubref(t);
- ditarefs_.push(t);
- }
- break;
- case CMD_META:
- priv->constructExtra();
- p1 = getArgument();
- priv->extra->metaMap_.insert(p1, getArgument());
- break;
- case CMD_NEWCODE:
- location().warning(tr("Unexpected '\\%1'").arg(cmdName(CMD_NEWCODE)));
- break;
- case CMD_NOTE:
- leavePara();
- enterPara(Atom::NoteLeft, Atom::NoteRight);
- break;
- case CMD_O:
- location().warning(tr("'\\o' is deprecated. Use '\\li'"));
- case CMD_LI:
- leavePara();
- if (openedCommands.top() == CMD_LIST) {
- if (openedLists.top().isStarted()) {
- append(Atom::ListItemRight,
- openedLists.top().styleString());
- }
- else {
- append(Atom::ListLeft,
- openedLists.top().styleString());
- }
- openedLists.top().next();
- append(Atom::ListItemNumber,
- openedLists.top().numberString());
- append(Atom::ListItemLeft,
- openedLists.top().styleString());
- enterPara();
- }
- else if (openedCommands.top() == CMD_TABLE) {
- p1 = "1,1";
- p2.clear();
- if (isLeftBraceAhead()) {
- p1 = getArgument();
- if (isLeftBraceAhead()) {
- p2 = getArgument();
- }
- }
-
- if (!inTableHeader && !inTableRow) {
- location().warning(tr("Missing '\\%1' or '\\%2' before '\\%3'")
- .arg(cmdName(CMD_HEADER))
- .arg(cmdName(CMD_ROW))
- .arg(cmdName(CMD_LI)));
- append(Atom::TableRowLeft);
- inTableRow = true;
- }
- else if (inTableItem) {
- append(Atom::TableItemRight);
- inTableItem = false;
- }
-
- append(Atom::TableItemLeft, p1, p2);
- inTableItem = true;
- }
- else {
- location().warning(tr("Command '\\%1' outside of '\\%2' and '\\%3'")
- .arg(cmdName(cmd))
- .arg(cmdName(CMD_LIST))
- .arg(cmdName(CMD_TABLE)));
- }
- break;
- case CMD_OLDCODE:
- leavePara();
- append(Atom::CodeOld, getCode(CMD_OLDCODE, marker));
- append(Atom::CodeNew, getCode(CMD_NEWCODE, marker));
- break;
- case CMD_OMIT:
- getUntilEnd(cmd);
- break;
- case CMD_OMITVALUE:
- p1 = getArgument();
- if (!priv->enumItemList.contains(p1))
- priv->enumItemList.append(p1);
- if (!priv->omitEnumItemList.contains(p1))
- priv->omitEnumItemList.append(p1);
- break;
- case CMD_PART:
- startSection(Doc::Part, cmd);
- break;
- case CMD_PRINTLINE:
- leavePara();
- if (!quoting)
- appendToCode(quoter.quoteLine(location(), cmdStr,
- getRestOfLine()));
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getRestOfLine());
- }
- break;
- case CMD_PRINTTO:
- leavePara();
- if (!quoting)
- appendToCode(quoter.quoteTo(location(), cmdStr,
- getRestOfLine()));
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getRestOfLine());
- }
- break;
- case CMD_PRINTUNTIL:
- leavePara();
- if (!quoting)
- appendToCode(quoter.quoteUntil(location(), cmdStr,
- getRestOfLine()));
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getRestOfLine());
- }
- break;
- case CMD_QUOTATION:
- if (openCommand(cmd)) {
- leavePara();
- append(Atom::QuotationLeft);
- }
- break;
- case CMD_QUOTEFILE:
- {
- leavePara();
- QString fileName = getArgument();
- Doc::quoteFromFile(location(), quoter, fileName);
- if (!quoting) {
- append(Atom::Code,
- quoter.quoteTo(location(), cmdStr, QString()));
- quoter.reset();
- }
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, fileName);
- }
- break;
- }
- case CMD_QUOTEFROMFILE:
- leavePara();
- if (!quoting)
- quoteFromFile();
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getArgument());
- }
- break;
- case CMD_QUOTEFUNCTION:
- leavePara();
- marker = quoteFromFile();
- p1 = getRestOfLine();
- if (!quoting) {
- quoter.quoteTo(location(), cmdStr,
- slashed(marker->functionBeginRegExp(p1)));
- append(Atom::Code,
- quoter.quoteUntil(location(), cmdStr,
- slashed(marker->functionEndRegExp(p1))));
- quoter.reset();
- }
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, slashed(marker->functionEndRegExp(p1)));
- }
- break;
- case CMD_RAW:
- leavePara();
- p1 = getRestOfLine();
- if (p1.isEmpty())
- location().warning(tr("Missing format name after '\\%1'")
- .arg(cmdName(CMD_RAW)));
- append(Atom::FormatIf, p1);
- append(Atom::RawString, untabifyEtc(getUntilEnd(cmd)));
- append(Atom::FormatElse);
- append(Atom::FormatEndif);
- break;
- case CMD_ROW:
- if (openedCommands.top() == CMD_TABLE) {
- p1.clear();
- if (isLeftBraceAhead())
- p1 = getArgument(true);
- leaveTableRow();
- append(Atom::TableRowLeft,p1);
- inTableRow = true;
- }
- else {
- if (openedCommands.contains(CMD_TABLE)) {
- location().warning(tr("Cannot use '\\%1' within '\\%2'")
- .arg(cmdName(CMD_ROW))
- .arg(cmdName(openedCommands.top())));
- }
- else {
- location().warning(tr("Cannot use '\\%1' outside of '\\%2'")
- .arg(cmdName(CMD_ROW))
- .arg(cmdName(CMD_TABLE)));
- }
- }
- break;
- case CMD_SA:
- parseAlso();
- break;
- case CMD_SECTION1:
- startSection(Doc::Section1, cmd);
- break;
- case CMD_SECTION2:
- startSection(Doc::Section2, cmd);
- break;
- case CMD_SECTION3:
- startSection(Doc::Section3, cmd);
- break;
- case CMD_SECTION4:
- startSection(Doc::Section4, cmd);
- break;
- case CMD_SIDEBAR:
- if (openCommand(cmd)) {
- leavePara();
- append(Atom::SidebarLeft);
- }
- break;
- case CMD_SKIPLINE:
- leavePara();
- if (!quoting)
- quoter.quoteLine(location(),
- cmdStr,
- getRestOfLine());
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getRestOfLine());
- }
- break;
- case CMD_SKIPTO:
- leavePara();
- if (!quoting)
- quoter.quoteTo(location(),
- cmdStr,
- getRestOfLine());
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getRestOfLine());
- }
- break;
- case CMD_SKIPUNTIL:
- leavePara();
- if (!quoting)
- quoter.quoteUntil(location(),
- cmdStr,
- getRestOfLine());
- else {
- append(Atom::CodeQuoteCommand, cmdStr);
- append(Atom::CodeQuoteArgument, getRestOfLine());
- }
- break;
- case CMD_SPAN:
- p1 = ATOM_FORMATTING_SPAN + getArgument(true);
- startFormat(p1, cmd);
- break;
- case CMD_SNIPPET:
- leavePara();
- {
- QString snippet = getArgument();
- QString identifier = getRestOfLine();
- if (quoting) {
- append(Atom::SnippetCommand, cmdStr);
- append(Atom::SnippetLocation, snippet);
- append(Atom::SnippetIdentifier, identifier);
- }
- else {
- marker = Doc::quoteFromFile(location(),quoter,snippet);
- appendToCode(quoter.quoteSnippet(location(), identifier), marker->atomType());
- }
- }
- break;
- case CMD_SUB:
- startFormat(ATOM_FORMATTING_SUBSCRIPT, cmd);
- break;
- case CMD_SUP:
- startFormat(ATOM_FORMATTING_SUPERSCRIPT, cmd);
- break;
- case CMD_TABLE:
- //p1 = getRestOfLine();
- p1 = getOptionalArgument();
- p2 = getOptionalArgument();
- if (openCommand(cmd)) {
- leavePara();
- append(Atom::TableLeft, p1, p2);
- inTableHeader = false;
- inTableRow = false;
- inTableItem = false;
- }
- break;
- case CMD_TABLEOFCONTENTS:
- p1 = "1";
- if (isLeftBraceAhead())
- p1 = getArgument();
- p1 += QLatin1Char(',');
- p1 += QString::number((int)getSectioningUnit());
- append(Atom::TableOfContents, p1);
- break;
- case CMD_TARGET:
- insertTarget(getRestOfLine(),false);
- break;
- case CMD_TT:
- startFormat(ATOM_FORMATTING_TELETYPE, cmd);
- break;
- case CMD_UICONTROL:
- startFormat(ATOM_FORMATTING_UICONTROL, cmd);
- break;
- case CMD_UNDERLINE:
- startFormat(ATOM_FORMATTING_UNDERLINE, cmd);
- break;
- case CMD_UNICODE:
- enterPara();
- p1 = getArgument();
- {
- bool ok;
- uint unicodeChar = p1.toUInt(&ok, 0);
- if (!ok ||
- (unicodeChar == 0x0000) ||
- (unicodeChar > 0xFFFE)) {
- location().warning(tr("Invalid Unicode character '%1' specified "
- "with '%2'")
- .arg(p1, cmdName(CMD_UNICODE)));
- }
- else {
- append(Atom::String, QChar(unicodeChar));
- }
- }
- break;
- case CMD_VALUE:
- leaveValue();
- if (openedLists.top().style() == OpenedList::Value) {
- p1 = getArgument();
- if (!priv->enumItemList.contains(p1))
- priv->enumItemList.append(p1);
-
- openedLists.top().next();
- append(Atom::ListTagLeft, ATOM_LIST_VALUE);
- append(Atom::String, p1);
- append(Atom::ListTagRight, ATOM_LIST_VALUE);
- append(Atom::ListItemLeft, ATOM_LIST_VALUE);
-
- skipSpacesOrOneEndl();
- if (isBlankLine())
- append(Atom::Nop);
- }
- else {
- // ### problems
- }
- break;
- case CMD_WARNING:
- leavePara();
- enterPara();
- append(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
- append(Atom::String, "Warning:");
- append(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
- append(Atom::String, " ");
- break;
- case CMD_OVERLOAD:
- priv->metacommandsUsed.insert(cmdStr);
- p1.clear();
- if (!isBlankLine())
- p1 = getRestOfLine();
- if (!p1.isEmpty()) {
- append(Atom::ParaLeft);
- append(Atom::String, "This function overloads ");
- append(Atom::AutoLink,p1);
- append(Atom::String, ".");
- append(Atom::ParaRight);
- }
- else {
- append(Atom::ParaLeft);
- append(Atom::String,"This is an overloaded function.");
- append(Atom::ParaRight);
- p1 = getMetaCommandArgument(cmdStr);
- }
- priv->metaCommandMap[cmdStr].append(ArgLocPair(p1,location()));
- break;
- case NOT_A_CMD:
- if (metaCommandSet.contains(cmdStr)) {
- priv->metacommandsUsed.insert(cmdStr);
- QString arg = getMetaCommandArgument(cmdStr);
- priv->metaCommandMap[cmdStr].append(ArgLocPair(arg,location()));
- if (possibleTopics.contains(cmdStr)) {
- priv->topics_.append(Topic(cmdStr,arg));
- }
- }
- else if (macroHash()->contains(cmdStr)) {
- const Macro &macro = macroHash()->value(cmdStr);
- int numPendingFi = 0;
- QStringMap::ConstIterator d;
- d = macro.otherDefs.constBegin();
- while (d != macro.otherDefs.constEnd()) {
- append(Atom::FormatIf, d.key());
- expandMacro(cmdStr, *d, macro.numParams);
- ++d;
-
- if (d == macro.otherDefs.constEnd()) {
- append(Atom::FormatEndif);
- }
- else {
- append(Atom::FormatElse);
- numPendingFi++;
- }
- }
- while (numPendingFi-- > 0)
- append(Atom::FormatEndif);
-
- if (!macro.defaultDef.isEmpty()) {
- if (!macro.otherDefs.isEmpty()) {
- macro.defaultDefLocation.warning(
- tr("Macro cannot have both "
- "format-specific and qdoc- "
- "syntax definitions"));
- }
- else {
- location().push(macro.defaultDefLocation.filePath());
- in.insert(pos, expandMacroToString(cmdStr, macro.defaultDef, macro.numParams));
- len = in.length();
- openedInputs.push(pos + macro.defaultDef.length());
- }
- }
- }
- else {
- location().warning(
- tr("Unknown command '\\%1'").arg(cmdStr),
- detailsUnknownCommand(metaCommandSet,cmdStr));
- enterPara();
- append(Atom::UnknownCommand, cmdStr);
- }
- }
- }
- }
- break;
- case '{':
- enterPara();
- appendChar('{');
- braceDepth++;
- pos++;
- break;
- case '}':
- {
- braceDepth--;
- pos++;
-
- QMap<int, QString>::Iterator f = pendingFormats.find(braceDepth);
- if (f == pendingFormats.end()) {
- enterPara();
- appendChar('}');
- }
- else {
- append(Atom::FormattingRight, *f);
- if (*f == ATOM_FORMATTING_INDEX) {
- if (indexStartedPara)
- skipAllSpaces();
- }
- else if (*f == ATOM_FORMATTING_LINK) {
- // hack for C++ to support links like
- // \l{QString::}{count()}
- if (currentLinkAtom &&
- currentLinkAtom->string().endsWith("::")) {
- QString suffix = Text::subText(currentLinkAtom,
- priv->text.lastAtom()).toString();
- currentLinkAtom->appendString(suffix);
- }
- currentLinkAtom = 0;
- }
- pendingFormats.erase(f);
- }
- }
- break;
- default:
- {
- bool newWord;
- switch (priv->text.lastAtom()->type()) {
- case Atom::ParaLeft:
- newWord = true;
- break;
- default:
- newWord = false;
- }
-
- if (paraState == OutsideParagraph) {
- if (ch.isSpace()) {
- ++pos;
- newWord = false;
- }
- else {
- enterPara();
- newWord = true;
- }
- }
- else {
- if (ch.isSpace()) {
- ++pos;
- if ((ch == '\n') &&
- (paraState == InSingleLineParagraph ||
- isBlankLine())) {
- leavePara();
- newWord = false;
- }
- else {
- appendChar(' ');
- newWord = true;
- }
- }
- else {
- newWord = true;
- }
- }
-
- if (newWord) {
- int startPos = pos;
- int numInternalUppercase = 0;
- int numLowercase = 0;
- int numStrangeSymbols = 0;
-
- while (pos < len) {
- unsigned char latin1Ch = in.at(pos).toLatin1();
- if (islower(latin1Ch)) {
- ++numLowercase;
- ++pos;
- }
- else if (isupper(latin1Ch)) {
- if (pos > startPos)
- ++numInternalUppercase;
- ++pos;
- }
- else if (isdigit(latin1Ch)) {
- if (pos > startPos) {
- ++pos;
- }
- else {
- break;
- }
- }
- else if (latin1Ch == '_' || latin1Ch == '@') {
- ++numStrangeSymbols;
- ++pos;
- }
- else if (latin1Ch == ':' && pos < len - 1
- && in.at(pos + 1) == QLatin1Char(':')) {
- ++numStrangeSymbols;
- pos += 2;
- }
- else if (latin1Ch == '(') {
- if (pos > startPos) {
- if (pos < len - 1 &&
- in.at(pos + 1) == QLatin1Char(')')) {
- ++numStrangeSymbols;
- pos += 2;
- break;
- }
- else {
- // ### handle functions with signatures
- // and function calls
- break;
- }
- }
- else {
- break;
- }
- }
- else {
- break;
- }
- }
-
- if (pos == startPos) {
- if (!ch.isSpace()) {
- appendChar(ch);
- ++pos;
- }
- }
- else {
- QString word = in.mid(startPos, pos - startPos);
- // is word a C++ symbol or an English word?
- if ((numInternalUppercase >= 1 && numLowercase >= 2)
- || numStrangeSymbols > 0) {
- if (word.startsWith(QString("__")))
- appendWord(word);
- else
- append(Atom::AutoLink, word);
- }
- else
- appendWord(word);
- }
- }
- }
- }
- }
- leaveValueList();
-
- // for compatibility
- if (openedCommands.top() == CMD_LEGALESE) {
- append(Atom::LegaleseRight);
- openedCommands.pop();
- }
-
- if (openedCommands.top() != CMD_OMIT) {
- location().warning(tr("Missing '\\%1'").arg(endCmdName(openedCommands.top())));
- }
- else if (preprocessorSkipping.count() > 0) {
- location().warning(tr("Missing '\\%1'").arg(cmdName(CMD_ENDIF)));
- }
-
- if (currentSection > Doc::NoSection) {
- append(Atom::SectionRight, QString::number(currentSection));
- currentSection = Doc::NoSection;
- }
-
- if (priv->extra && priv->extra->granularity_ < priv->extra->section_)
- priv->extra->granularity_ = priv->extra->section_;
- priv->text.stripFirstAtom();
-}
-
-/*!
- Returns the current location.
- */
-Location &DocParser::location()
-{
- while (!openedInputs.isEmpty() && openedInputs.top() <= pos) {
- cachedLoc.pop();
- cachedPos = openedInputs.pop();
- }
- while (cachedPos < pos)
- cachedLoc.advance(in.at(cachedPos++));
- return cachedLoc;
-}
-
-QString DocParser::detailsUnknownCommand(const QSet<QString> &metaCommandSet,
- const QString &str)
-{
- QSet<QString> commandSet = metaCommandSet;
- int i = 0;
- while (cmds[i].english != 0) {
- commandSet.insert(*cmds[i].alias);
- i++;
- }
-
- if (aliasMap()->contains(str))
- return tr("The command '\\%1' was renamed '\\%2' by the configuration"
- " file. Use the new name.")
- .arg(str).arg((*aliasMap())[str]);
-
- QString best = nearestName(str, commandSet);
- if (best.isEmpty())
- return QString();
- return tr("Maybe you meant '\\%1'?").arg(best);
-}
-
-void DocParser::insertTarget(const QString &target, bool keyword)
-{
- if (targetMap_.contains(target)) {
- location().warning(tr("Duplicate target name '%1'").arg(target));
- targetMap_[target].warning(tr("(The previous occurrence is here)"));
- }
- else {
- targetMap_.insert(target, location());
- priv->constructExtra();
- if (keyword) {
- append(Atom::Keyword, target);
- priv->extra->keywords_.append(priv->text.lastAtom());
- }
- else {
- append(Atom::Target, target);
- priv->extra->targets_.append(priv->text.lastAtom());
- }
- }
-}
-
-void DocParser::include(const QString& fileName, const QString& identifier)
-{
- if (location().depth() > 16)
- location().fatal(tr("Too many nested '\\%1's").arg(cmdName(CMD_INCLUDE)));
-
- QString userFriendlyFilePath;
- QString filePath = Doc::config()->getIncludeFilePath(fileName);
-#if 0
- QString filePath = Config::findFile(location(),
- sourceFiles,
- sourceDirs,
- fileName,
- userFriendlyFilePath);
-#endif
- if (filePath.isEmpty()) {
- location().warning(tr("Cannot find qdoc include file '%1'").arg(fileName));
- }
- else {
- QFile inFile(filePath);
- if (!inFile.open(QFile::ReadOnly)) {
- location().warning(tr("Cannot open qdoc include file '%1'")
- .arg(userFriendlyFilePath));
- }
- else {
- location().push(userFriendlyFilePath);
-
- QTextStream inStream(&inFile);
- QString includedStuff = inStream.readAll();
- inFile.close();
-
- if (identifier.isEmpty()) {
- in.insert(pos, includedStuff);
- len = in.length();
- openedInputs.push(pos + includedStuff.length());
- }
- else {
- QStringList lineBuffer = includedStuff.split(QLatin1Char('\n'));
- int i = 0;
- int startLine = -1;
- while (i < lineBuffer.size()) {
- if (lineBuffer[i].startsWith("//!")) {
- if (lineBuffer[i].contains(identifier)) {
- startLine = i+1;
- break;
- }
- }
- ++i;
- }
- if (startLine < 0) {
- location().warning(tr("Cannot find '%1' in '%2'")
- .arg(identifier)
- .arg(userFriendlyFilePath));
- return;
-
- }
- QString result;
- i = startLine;
- do {
- if (lineBuffer[i].startsWith("//!")) {
- if (i<lineBuffer.size()) {
- if (lineBuffer[i].contains(identifier)) {
- break;
- }
- }
- }
- else
- result += lineBuffer[i] + QLatin1Char('\n');
- ++i;
- } while (i < lineBuffer.size());
- if (result.isEmpty()) {
- location().warning(tr("Empty qdoc snippet '%1' in '%2'")
- .arg(identifier)
- .arg(userFriendlyFilePath));
- }
- else {
- in.insert(pos, result);
- len = in.length();
- openedInputs.push(pos + result.length());
- }
- }
- }
- }
-}
-
-void DocParser::startFormat(const QString& format, int cmd)
-{
- enterPara();
-
- QMap<int, QString>::ConstIterator f = pendingFormats.constBegin();
- while (f != pendingFormats.constEnd()) {
- if (*f == format) {
- location().warning(tr("Cannot nest '\\%1' commands")
- .arg(cmdName(cmd)));
- return;
- }
- ++f;
- }
-
- append(Atom::FormattingLeft, format);
-
- if (isLeftBraceAhead()) {
- skipSpacesOrOneEndl();
- pendingFormats.insert(braceDepth, format);
- ++braceDepth;
- ++pos;
- }
- else {
- append(Atom::String, getArgument());
- append(Atom::FormattingRight, format);
- if (format == ATOM_FORMATTING_INDEX && indexStartedPara) {
- skipAllSpaces();
- indexStartedPara = false;
- }
- }
-}
-
-bool DocParser::openCommand(int cmd)
-{
- int outer = openedCommands.top();
- bool ok = true;
-
- if (cmd != CMD_LINK) {
- if (outer == CMD_LIST) {
- ok = (cmd == CMD_FOOTNOTE || cmd == CMD_LIST);
- }
- else if (outer == CMD_ABSTRACT) {
- ok = (cmd == CMD_LIST ||
- cmd == CMD_QUOTATION ||
- cmd == CMD_TABLE);
- }
- else if (outer == CMD_SIDEBAR) {
- ok = (cmd == CMD_LIST ||
- cmd == CMD_QUOTATION ||
- cmd == CMD_SIDEBAR);
- }
- else if (outer == CMD_QUOTATION) {
- ok = (cmd == CMD_LIST);
- }
- else if (outer == CMD_TABLE) {
- ok = (cmd == CMD_LIST ||
- cmd == CMD_FOOTNOTE ||
- cmd == CMD_QUOTATION);
- }
- else if (outer == CMD_FOOTNOTE || outer == CMD_LINK) {
- ok = false;
- }
- else if (outer == CMD_TOPICREF)
- ok = (cmd == CMD_TOPICREF || cmd == CMD_MAPREF);
- else if (outer == CMD_MAPREF)
- ok = false;
- }
-
- if (ok) {
- openedCommands.push(cmd);
- }
- else {
- location().warning(tr("Can't use '\\%1' in '\\%2'").arg(cmdName(cmd)).arg(cmdName(outer)));
- }
- return ok;
-}
-
-bool DocParser::closeCommand(int endCmd)
-{
- if (endCmdFor(openedCommands.top()) == endCmd && openedCommands.size() > 1) {
- openedCommands.pop();
- return true;
- }
- else {
- bool contains = false;
- QStack<int> opened2 = openedCommands;
- while (opened2.size() > 1) {
- if (endCmdFor(opened2.top()) == endCmd) {
- contains = true;
- break;
- }
- opened2.pop();
- }
-
- if (contains) {
- while (endCmdFor(openedCommands.top()) != endCmd && openedCommands.size() > 1) {
- location().warning(tr("Missing '\\%1' before '\\%2'")
- .arg(endCmdName(openedCommands.top()))
- .arg(cmdName(endCmd)));
- openedCommands.pop();
- }
- }
- else {
- location().warning(tr("Unexpected '\\%1'").arg(cmdName(endCmd)));
- }
- return false;
- }
-}
-
-void DocParser::startSection(Doc::Sections unit, int cmd)
-{
- leaveValueList();
-
- if (currentSection == Doc::NoSection) {
- currentSection = (Doc::Sections) (unit);
- priv->constructExtra();
- priv->extra->section_ = currentSection;
- }
- else
- endSection(unit,cmd);
-
- append(Atom::SectionLeft, QString::number(unit));
- priv->constructExtra();
- priv->extra->tableOfContents_.append(priv->text.lastAtom());
- priv->extra->tableOfContentsLevels_.append(unit);
- enterPara(Atom::SectionHeadingLeft,
- Atom::SectionHeadingRight,
- QString::number(unit));
- currentSection = unit;
-
-}
-
-void DocParser::endSection(int , int) // (int unit, int endCmd)
-{
- leavePara();
- append(Atom::SectionRight, QString::number(currentSection));
- currentSection = (Doc::NoSection);
-}
-
-void DocParser::parseAlso()
-{
- leavePara();
- skipSpacesOnLine();
- while (pos < len && in[pos] != '\n') {
- QString target;
- QString str;
-
- if (in[pos] == '{') {
- target = getArgument();
- skipSpacesOnLine();
- if (in[pos] == '{') {
- str = getArgument();
-
- // hack for C++ to support links like \l{QString::}{count()}
- if (target.endsWith("::"))
- target += str;
- }
- else {
- str = target;
- }
-#ifdef QDOC2_COMPAT
- }
- else if (in[pos] == '\\' && in.mid(pos, 5) == "\\link") {
- pos += 6;
- target = getArgument();
- int endPos = in.indexOf("\\endlink", pos);
- if (endPos != -1) {
- str = in.mid(pos, endPos - pos).trimmed();
- pos = endPos + 8;
- }
-#endif
- }
- else {
- target = getArgument();
- str = cleanLink(target);
- }
-
- Text also;
- also << Atom(Atom::Link, target)
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << str
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- priv->addAlso(also);
-
- skipSpacesOnLine();
- if (pos < len && in[pos] == ',') {
- pos++;
- skipSpacesOrOneEndl();
- }
- else if (in[pos] != '\n') {
- location().warning(tr("Missing comma in '\\%1'").arg(cmdName(CMD_SA)));
- }
- }
-}
-
-void DocParser::append(Atom::Type type, const QString &string)
-{
- Atom::Type lastType = priv->text.lastAtom()->type();
- if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
- priv->text.lastAtom()->chopString();
- priv->text << Atom(type, string);
-}
-
-void DocParser::append(const QString &string)
-{
- Atom::Type lastType = priv->text.lastAtom()->type();
- if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
- priv->text.lastAtom()->chopString();
- priv->text << Atom(string); // The Atom type is Link.
-}
-
-void DocParser::append(Atom::Type type, const QString& p1, const QString& p2)
-{
- Atom::Type lastType = priv->text.lastAtom()->type();
- if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
- priv->text.lastAtom()->chopString();
- priv->text << Atom(type, p1, p2);
-}
-
-void DocParser::append(const QString& p1, const QString& p2)
-{
- Atom::Type lastType = priv->text.lastAtom()->type();
- if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
- priv->text.lastAtom()->chopString();
- if (p2.isEmpty())
- priv->text << Atom(p1); // The Atom type is Link.
- else
- priv->text << LinkAtom(p1, p2);
-}
-
-void DocParser::appendChar(QChar ch)
-{
- if (priv->text.lastAtom()->type() != Atom::String)
- append(Atom::String);
- Atom *atom = priv->text.lastAtom();
- if (ch == QLatin1Char(' ')) {
- if (!atom->string().endsWith(QLatin1Char(' ')))
- atom->appendChar(QLatin1Char(' '));
- }
- else
- atom->appendChar(ch);
-}
-
-void DocParser::appendWord(const QString &word)
-{
- if (priv->text.lastAtom()->type() != Atom::String) {
- append(Atom::String, word);
- }
- else
- priv->text.lastAtom()->appendString(word);
-}
-
-void DocParser::appendToCode(const QString& markedCode)
-{
- Atom::Type lastType = priv->text.lastAtom()->type();
- if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript)
- append(Atom::Qml);
- priv->text.lastAtom()->appendString(markedCode);
-}
-
-void DocParser::appendToCode(const QString &markedCode, Atom::Type defaultType)
-{
- Atom::Type lastType = priv->text.lastAtom()->type();
- if (lastType != Atom::Qml && lastType != Atom::Code && lastType != Atom::JavaScript)
- append(defaultType, markedCode);
- else
- priv->text.lastAtom()->appendString(markedCode);
-}
-
-void DocParser::startNewPara()
-{
- leavePara();
- enterPara();
-}
-
-void DocParser::enterPara(Atom::Type leftType,
- Atom::Type rightType,
- const QString& string)
-{
- if (paraState == OutsideParagraph) {
-
- if ((priv->text.lastAtom()->type() != Atom::ListItemLeft) &&
- (priv->text.lastAtom()->type() != Atom::DivLeft)) {
- leaveValueList();
- }
-
- append(leftType, string);
- indexStartedPara = false;
- pendingParaLeftType = leftType;
- pendingParaRightType = rightType;
- pendingParaString = string;
- if (leftType == Atom::SectionHeadingLeft) {
- paraState = InSingleLineParagraph;
- }
- else {
- paraState = InMultiLineParagraph;
- }
- skipSpacesOrOneEndl();
- }
-}
-
-void DocParser::leavePara()
-{
- if (paraState != OutsideParagraph) {
- if (!pendingFormats.isEmpty()) {
- location().warning(tr("Missing '}'"));
- pendingFormats.clear();
- }
-
- if (priv->text.lastAtom()->type() == pendingParaLeftType) {
- priv->text.stripLastAtom();
- }
- else {
- if (priv->text.lastAtom()->type() == Atom::String &&
- priv->text.lastAtom()->string().endsWith(QLatin1Char(' '))) {
- priv->text.lastAtom()->chopString();
- }
- append(pendingParaRightType, pendingParaString);
- }
- paraState = OutsideParagraph;
- indexStartedPara = false;
- pendingParaRightType = Atom::Nop;
- pendingParaString.clear();
- }
-}
-
-void DocParser::leaveValue()
-{
- leavePara();
- if (openedLists.isEmpty()) {
- openedLists.push(OpenedList(OpenedList::Value));
- append(Atom::ListLeft, ATOM_LIST_VALUE);
- }
- else {
- if (priv->text.lastAtom()->type() == Atom::Nop)
- priv->text.stripLastAtom();
- append(Atom::ListItemRight, ATOM_LIST_VALUE);
- }
-}
-
-void DocParser::leaveValueList()
-{
- leavePara();
- if (!openedLists.isEmpty() &&
- (openedLists.top().style() == OpenedList::Value)) {
- if (priv->text.lastAtom()->type() == Atom::Nop)
- priv->text.stripLastAtom();
- append(Atom::ListItemRight, ATOM_LIST_VALUE);
- append(Atom::ListRight, ATOM_LIST_VALUE);
- openedLists.pop();
- }
-}
-
-void DocParser::leaveTableRow()
-{
- if (inTableItem) {
- leavePara();
- append(Atom::TableItemRight);
- inTableItem = false;
- }
- if (inTableHeader) {
- append(Atom::TableHeaderRight);
- inTableHeader = false;
- }
- if (inTableRow) {
- append(Atom::TableRowRight);
- inTableRow = false;
- }
-}
-
-CodeMarker *DocParser::quoteFromFile()
-{
- return Doc::quoteFromFile(location(), quoter, getArgument());
-}
-
-void DocParser::expandMacro(const QString &name,
- const QString &def,
- int numParams)
-{
- if (numParams == 0) {
- append(Atom::RawString, def);
- }
- else {
- QStringList args;
- QString rawString;
-
- for (int i = 0; i < numParams; i++) {
- if (numParams == 1 || isLeftBraceAhead()) {
- args << getArgument(true);
- }
- else {
- location().warning(tr("Macro '\\%1' invoked with too few"
- " arguments (expected %2, got %3)")
- .arg(name).arg(numParams).arg(i));
- break;
- }
- }
-
- int j = 0;
- while (j < def.size()) {
- int paramNo;
- if (((paramNo = def[j].unicode()) >= 1) &&
- (paramNo <= numParams)) {
- if (!rawString.isEmpty()) {
- append(Atom::RawString, rawString);
- rawString.clear();
- }
- append(Atom::String, args[paramNo - 1]);
- j += 1;
- }
- else {
- rawString += def[j++];
- }
- }
- if (!rawString.isEmpty())
- append(Atom::RawString, rawString);
- }
-}
-
-QString DocParser::expandMacroToString(const QString &name, const QString &def, int numParams)
-{
- if (numParams == 0) {
- return def;
- }
- else {
- QStringList args;
- QString rawString;
-
- for (int i = 0; i < numParams; i++) {
- if (numParams == 1 || isLeftBraceAhead()) {
- args << getArgument(true);
- }
- else {
- location().warning(tr("Macro '\\%1' invoked with too few"
- " arguments (expected %2, got %3)")
- .arg(name).arg(numParams).arg(i));
- break;
- }
- }
-
- int j = 0;
- while (j < def.size()) {
- int paramNo;
- if (((paramNo = def[j].unicode()) >= 1) &&
- (paramNo <= numParams)) {
- rawString += args[paramNo - 1];
- j += 1;
- }
- else {
- rawString += def[j++];
- }
- }
- return rawString;
- }
-}
-
-Doc::Sections DocParser::getSectioningUnit()
-{
- QString name = getOptionalArgument();
-
- if (name == "part") {
- return Doc::Part;
- }
- else if (name == "chapter") {
- return Doc::Chapter;
- }
- else if (name == "section1") {
- return Doc::Section1;
- }
- else if (name == "section2") {
- return Doc::Section2;
- }
- else if (name == "section3") {
- return Doc::Section3;
- }
- else if (name == "section4") {
- return Doc::Section4;
- }
- else if (name.isEmpty()) {
- return Doc::NoSection;
- }
- else {
- location().warning(tr("Invalid section '%1'").arg(name));
- return Doc::NoSection;
- }
-}
-
-/*!
- Gets an argument that is enclosed in braces and returns it
- without the enclosing braces. On entry, the current character
- is the left brace. On exit, the current character is the one
- that comes after the right brace.
-
- If \a verbatim is true, extra whitespace is retained in the
- returned string. Otherwise, extra whitespace is removed.
- */
-QString DocParser::getBracedArgument(bool verbatim)
-{
- QString arg;
- int delimDepth = 0;
- if (pos < (int) in.length() && in[pos] == '{') {
- pos++;
- while (pos < (int) in.length() && delimDepth >= 0) {
- switch (in[pos].unicode()) {
- case '{':
- delimDepth++;
- arg += QLatin1Char('{');
- pos++;
- break;
- case '}':
- delimDepth--;
- if (delimDepth >= 0)
- arg += QLatin1Char('}');
- pos++;
- break;
- case '\\':
- if (verbatim) {
- arg += in[pos];
- pos++;
- }
- else {
- pos++;
- if (pos < (int) in.length()) {
- if (in[pos].isLetterOrNumber())
- break;
- arg += in[pos];
- if (in[pos].isSpace()) {
- skipAllSpaces();
- }
- else {
- pos++;
- }
- }
- }
- break;
- default:
- if (in[pos].isSpace() && !verbatim)
- arg += QChar(' ');
- else
- arg += in[pos];
- pos++;
- }
- }
- if (delimDepth > 0)
- location().warning(tr("Missing '}'"));
- }
- return arg;
-}
-
-/*!
- Typically, an argument ends at the next white-space. However,
- braces can be used to group words:
-
- {a few words}
-
- Also, opening and closing parentheses have to match. Thus,
-
- printf("%d\n", x)
-
- is an argument too, although it contains spaces. Finally,
- trailing punctuation is not included in an argument, nor is 's.
-*/
-QString DocParser::getArgument(bool verbatim)
-{
- skipSpacesOrOneEndl();
-
- int delimDepth = 0;
- int startPos = pos;
- QString arg = getBracedArgument(verbatim);
- if (arg.isEmpty()) {
- while ((pos < in.length()) &&
- ((delimDepth > 0) || ((delimDepth == 0) && !in[pos].isSpace()))) {
- switch (in[pos].unicode()) {
- case '(':
- case '[':
- case '{':
- delimDepth++;
- arg += in[pos];
- pos++;
- break;
- case ')':
- case ']':
- case '}':
- delimDepth--;
- if (pos == startPos || delimDepth >= 0) {
- arg += in[pos];
- pos++;
- }
- break;
- case '\\':
- if (verbatim) {
- arg += in[pos];
- pos++;
- }
- else {
- pos++;
- if (pos < (int) in.length()) {
- if (in[pos].isLetterOrNumber())
- break;
- arg += in[pos];
- if (in[pos].isSpace()) {
- skipAllSpaces();
- }
- else {
- pos++;
- }
- }
- }
- break;
- default:
- arg += in[pos];
- pos++;
- }
- }
- if ((arg.length() > 1) &&
- (QString(".,:;!?").indexOf(in[pos - 1]) != -1) &&
- !arg.endsWith("...")) {
- arg.truncate(arg.length() - 1);
- pos--;
- }
- if (arg.length() > 2 && in.mid(pos - 2, 2) == "'s") {
- arg.truncate(arg.length() - 2);
- pos -= 2;
- }
- }
- return arg.simplified();
-}
-
-/*!
- Gets an argument that is enclosed in brackets and returns it
- without the enclosing brackets. On entry, the current character
- is the left bracket. On exit, the current character is the one
- that comes after the right bracket.
- */
-QString DocParser::getBracketedArgument()
-{
- QString arg;
- int delimDepth = 0;
- skipSpacesOrOneEndl();
- if (pos < in.length() && in[pos] == '[') {
- pos++;
- while (pos < in.length() && delimDepth >= 0) {
- switch (in[pos].unicode()) {
- case '[':
- delimDepth++;
- arg += QLatin1Char('[');
- pos++;
- break;
- case ']':
- delimDepth--;
- if (delimDepth >= 0)
- arg += QLatin1Char(']');
- pos++;
- break;
- case '\\':
- arg += in[pos];
- pos++;
- break;
- default:
- arg += in[pos];
- pos++;
- }
- }
- if (delimDepth > 0)
- location().warning(tr("Missing ']'"));
- }
- return arg;
-}
-
-QString DocParser::getOptionalArgument()
-{
- skipSpacesOrOneEndl();
- if (pos + 1 < (int) in.length() && in[pos] == '\\' &&
- in[pos + 1].isLetterOrNumber()) {
- return QString();
- }
- else {
- return getArgument();
- }
-}
-
-QString DocParser::getRestOfLine()
-{
- QString t;
-
- skipSpacesOnLine();
-
- bool trailingSlash = false;
-
- do {
- int begin = pos;
-
- while (pos < in.size() && in[pos] != '\n') {
- if (in[pos] == '\\' && !trailingSlash) {
- trailingSlash = true;
- ++pos;
- while ((pos < in.size()) &&
- in[pos].isSpace() &&
- (in[pos] != '\n'))
- ++pos;
- }
- else {
- trailingSlash = false;
- ++pos;
- }
- }
-
- if (!t.isEmpty())
- t += QLatin1Char(' ');
- t += in.mid(begin, pos - begin).simplified();
-
- if (trailingSlash) {
- t.chop(1);
- t = t.simplified();
- }
- if (pos < in.size())
- ++pos;
- } while (pos < in.size() && trailingSlash);
-
- return t;
-}
-
-/*!
- The metacommand argument is normally the remaining text to
- the right of the metacommand itself. The extra blanks are
- stripped and the argument string is returned.
- */
-QString DocParser::getMetaCommandArgument(const QString &cmdStr)
-{
- skipSpacesOnLine();
-
- int begin = pos;
- int parenDepth = 0;
-
- while (pos < in.size() && (in[pos] != '\n' || parenDepth > 0)) {
- if (in.at(pos) == '(')
- ++parenDepth;
- else if (in.at(pos) == ')')
- --parenDepth;
-
- ++pos;
- }
- if (pos == in.size() && parenDepth > 0) {
- pos = begin;
- location().warning(tr("Unbalanced parentheses in '%1'").arg(cmdStr));
- }
-
- QString t = in.mid(begin, pos - begin).simplified();
- skipSpacesOnLine();
- return t;
-}
-
-QString DocParser::getUntilEnd(int cmd)
-{
- int endCmd = endCmdFor(cmd);
- QRegExp rx("\\\\" + cmdName(endCmd) + "\\b");
- QString t;
- int end = rx.indexIn(in, pos);
-
- if (end == -1) {
- location().warning(tr("Missing '\\%1'").arg(cmdName(endCmd)));
- pos = in.length();
- }
- else {
- t = in.mid(pos, end - pos);
- pos = end + rx.matchedLength();
- }
- return t;
-}
-
-QString DocParser::getCode(int cmd, CodeMarker *marker)
-{
- QString code = untabifyEtc(getUntilEnd(cmd));
- int indent = indentLevel(code);
- if (indent < minIndent)
- minIndent = indent;
- code = unindent(minIndent, code);
- if (!marker)
- marker = CodeMarker::markerForCode(code);
- return marker->markedUpCode(code, 0, location());
-}
-
-/*!
- Was used only for generating doxygen output.
- */
-QString DocParser::getUnmarkedCode(int cmd)
-{
- QString code = getUntilEnd(cmd);
- return code;
-}
-
-bool DocParser::isBlankLine()
-{
- int i = pos;
-
- while (i < len && in[i].isSpace()) {
- if (in[i] == '\n')
- return true;
- i++;
- }
- return false;
-}
-
-bool DocParser::isLeftBraceAhead()
-{
- int numEndl = 0;
- int i = pos;
-
- while (i < len && in[i].isSpace() && numEndl < 2) {
- // ### bug with '\\'
- if (in[i] == '\n')
- numEndl++;
- i++;
- }
- return numEndl < 2 && i < len && in[i] == '{';
-}
-
-bool DocParser::isLeftBracketAhead()
-{
- int numEndl = 0;
- int i = pos;
-
- while (i < len && in[i].isSpace() && numEndl < 2) {
- // ### bug with '\\'
- if (in[i] == '\n')
- numEndl++;
- i++;
- }
- return numEndl < 2 && i < len && in[i] == '[';
-}
-
-/*!
- Skips to the next non-space character or EOL.
- */
-void DocParser::skipSpacesOnLine()
-{
- while ((pos < in.length()) &&
- in[pos].isSpace() &&
- (in[pos].unicode() != '\n'))
- ++pos;
-}
-
-/*!
- Skips spaces and on EOL.
- */
-void DocParser::skipSpacesOrOneEndl()
-{
- int firstEndl = -1;
- while (pos < (int) in.length() && in[pos].isSpace()) {
- QChar ch = in[pos];
- if (ch == '\n') {
- if (firstEndl == -1) {
- firstEndl = pos;
- }
- else {
- pos = firstEndl;
- break;
- }
- }
- pos++;
- }
-}
-
-void DocParser::skipAllSpaces()
-{
- while (pos < len && in[pos].isSpace())
- pos++;
-}
-
-void DocParser::skipToNextPreprocessorCommand()
-{
- QRegExp rx("\\\\(?:" + cmdName(CMD_IF) + QLatin1Char('|') +
- cmdName(CMD_ELSE) + QLatin1Char('|') +
- cmdName(CMD_ENDIF) + ")\\b");
- int end = rx.indexIn(in, pos + 1); // ### + 1 necessary?
-
- if (end == -1)
- pos = in.length();
- else
- pos = end;
-}
-
-int DocParser::endCmdFor(int cmd)
-{
- switch (cmd) {
- case CMD_ABSTRACT:
- return CMD_ENDABSTRACT;
- case CMD_BADCODE:
- return CMD_ENDCODE;
- case CMD_CHAPTER:
- return CMD_ENDCHAPTER;
- case CMD_CODE:
- return CMD_ENDCODE;
- case CMD_DIV:
- return CMD_ENDDIV;
- case CMD_QML:
- return CMD_ENDQML;
- case CMD_QMLTEXT:
- return CMD_ENDQMLTEXT;
- case CMD_JS:
- return CMD_ENDJS;
- case CMD_FOOTNOTE:
- return CMD_ENDFOOTNOTE;
- case CMD_LEGALESE:
- return CMD_ENDLEGALESE;
- case CMD_LINK:
- return CMD_ENDLINK;
- case CMD_LIST:
- return CMD_ENDLIST;
- case CMD_NEWCODE:
- return CMD_ENDCODE;
- case CMD_OLDCODE:
- return CMD_NEWCODE;
- case CMD_OMIT:
- return CMD_ENDOMIT;
- case CMD_PART:
- return CMD_ENDPART;
- case CMD_QUOTATION:
- return CMD_ENDQUOTATION;
- case CMD_RAW:
- return CMD_ENDRAW;
- case CMD_SECTION1:
- return CMD_ENDSECTION1;
- case CMD_SECTION2:
- return CMD_ENDSECTION2;
- case CMD_SECTION3:
- return CMD_ENDSECTION3;
- case CMD_SECTION4:
- return CMD_ENDSECTION4;
- case CMD_SIDEBAR:
- return CMD_ENDSIDEBAR;
- case CMD_TABLE:
- return CMD_ENDTABLE;
- case CMD_TOPICREF:
- return CMD_ENDTOPICREF;
- case CMD_MAPREF:
- return CMD_ENDMAPREF;
- default:
- return cmd;
- }
-}
-
-QString DocParser::cmdName(int cmd)
-{
- return *cmds[cmd].alias;
-}
-
-QString DocParser::endCmdName(int cmd)
-{
- return cmdName(endCmdFor(cmd));
-}
-
-QString DocParser::untabifyEtc(const QString& str)
-{
- QString result;
- result.reserve(str.length());
- int column = 0;
-
- for (int i = 0; i < str.length(); i++) {
- const QChar c = str.at(i);
- if (c == QLatin1Char('\r'))
- continue;
- if (c == QLatin1Char('\t')) {
- result += &" "[column % tabSize];
- column = ((column / tabSize) + 1) * tabSize;
- continue;
- }
- if (c == QLatin1Char('\n')) {
- while (result.endsWith(QLatin1Char(' ')))
- result.chop(1);
- result += c;
- column = 0;
- continue;
- }
- result += c;
- column++;
- }
-
- while (result.endsWith("\n\n"))
- result.truncate(result.length() - 1);
- while (result.startsWith(QLatin1Char('\n')))
- result = result.mid(1);
-
- return result;
-}
-
-int DocParser::indentLevel(const QString& str)
-{
- int minIndent = INT_MAX;
- int column = 0;
-
- for (int i = 0; i < (int) str.length(); i++) {
- if (str[i] == '\n') {
- column = 0;
- }
- else {
- if (str[i] != ' ' && column < minIndent)
- minIndent = column;
- column++;
- }
- }
- return minIndent;
-}
-
-QString DocParser::unindent(int level, const QString& str)
-{
- if (level == 0)
- return str;
-
- QString t;
- int column = 0;
-
- for (int i = 0; i < (int) str.length(); i++) {
- if (str[i] == QLatin1Char('\n')) {
- t += '\n';
- column = 0;
- }
- else {
- if (column >= level)
- t += str[i];
- column++;
- }
- }
- return t;
-}
-
-QString DocParser::slashed(const QString& str)
-{
- QString result = str;
- result.replace(QLatin1Char('/'), "\\/");
- return QLatin1Char('/') + result + QLatin1Char('/');
-}
-
-/*!
- Parse the qdoc comment \a source. Build up a list of all the topic
- commands found including their arguments. This constructor is used
- when there can be more than one topic command in theqdoc comment.
- Normally, there is only one topic command in a qdoc comment, but in
- QML documentation, there is the case where the qdoc \e{qmlproperty}
- command can appear multiple times in a qdoc comment.
- */
-Doc::Doc(const Location& start_loc,
- const Location& end_loc,
- const QString& source,
- const QSet<QString>& metaCommandSet,
- const QSet<QString>& topics)
-{
- priv = new DocPrivate(start_loc,end_loc,source);
- DocParser parser;
- parser.parse(source,priv,metaCommandSet,topics);
-}
-
-Doc::Doc(const Doc& doc)
- : priv(0)
-{
- operator=(doc);
-}
-
-Doc::~Doc()
-{
- if (priv && priv->deref())
- delete priv;
-}
-
-Doc &Doc::operator=(const Doc& doc)
-{
- if (doc.priv)
- doc.priv->ref();
- if (priv && priv->deref())
- delete priv;
- priv = doc.priv;
- return *this;
-}
-
-void Doc::renameParameters(const QStringList &oldNames,
- const QStringList &newNames)
-{
- if (priv && oldNames != newNames) {
- detach();
-
- priv->params = newNames.toSet();
-
- Atom *atom = priv->text.firstAtom();
- while (atom) {
- if (atom->type() == Atom::FormattingLeft
- && atom->string() == ATOM_FORMATTING_PARAMETER) {
- atom = atom->next();
- if (!atom)
- return;
- int index = oldNames.indexOf(atom->string());
- if (index != -1 && index < newNames.count())
- atom->setString(newNames.at(index));
- }
- atom = atom->next();
- }
- }
-}
-
-void Doc::simplifyEnumDoc()
-{
- if (priv) {
- if (priv->isEnumDocSimplifiable()) {
- detach();
-
- Text newText;
-
- Atom *atom = priv->text.firstAtom();
- while (atom) {
- if ((atom->type() == Atom::ListLeft) &&
- (atom->string() == ATOM_LIST_VALUE)) {
- while (atom && ((atom->type() != Atom::ListRight) ||
- (atom->string() != ATOM_LIST_VALUE)))
- atom = atom->next();
- if (atom)
- atom = atom->next();
- }
- else {
- newText << *atom;
- atom = atom->next();
- }
- }
- priv->text = newText;
- }
- }
-}
-
-void Doc::setBody(const Text &text)
-{
- detach();
- priv->text = text;
-}
-
-/*!
- Returns the starting location of a qdoc comment.
- */
-const Location &Doc::location() const
-{
- static const Location dummy;
- return priv == 0 ? dummy : priv->start_loc;
-}
-
-/*!
- Returns the starting location of a qdoc comment.
- */
-const Location& Doc::startLocation() const
-{
- return location();
-}
-
-/*!
- Returns the ending location of a qdoc comment.
- */
-const Location& Doc::endLocation() const
-{
- static const Location dummy;
- return priv == 0 ? dummy : priv->end_loc;
-}
-
-const QString &Doc::source() const
-{
- static QString null;
- return priv == 0 ? null : priv->src;
-}
-
-bool Doc::isEmpty() const
-{
- return priv == 0 || priv->src.isEmpty();
-}
-
-const Text& Doc::body() const
-{
- static const Text dummy;
- return priv == 0 ? dummy : priv->text;
-}
-
-Text Doc::briefText(bool inclusive) const
-{
- return body().subText(Atom::BriefLeft, Atom::BriefRight, 0, inclusive);
-}
-
-Text Doc::trimmedBriefText(const QString &className) const
-{
- QString classNameOnly = className;
- if (className.contains("::"))
- classNameOnly = className.split("::").last();
-
- Text originalText = briefText();
- Text resultText;
- const Atom *atom = originalText.firstAtom();
- if (atom) {
- QString briefStr;
- QString whats;
- /*
- This code is really ugly. The entire \brief business
- should be rethought.
- */
- while (atom) {
- if (atom->type() == Atom::AutoLink || atom->type() == Atom::String) {
- briefStr += atom->string();
- }
- atom = atom->next();
- }
-
- QStringList w = briefStr.split(QLatin1Char(' '));
- if (!w.isEmpty() && w.first() == "Returns") {
- }
- else {
- if (!w.isEmpty() && w.first() == "The")
- w.removeFirst();
-
- if (!w.isEmpty() && (w.first() == className || w.first() == classNameOnly))
- w.removeFirst();
-
- if (!w.isEmpty() && ((w.first() == "class") ||
- (w.first() == "function") ||
- (w.first() == "macro") ||
- (w.first() == "widget") ||
- (w.first() == "namespace") ||
- (w.first() == "header")))
- w.removeFirst();
-
- if (!w.isEmpty() && (w.first() == "is" || w.first() == "provides"))
- w.removeFirst();
-
- if (!w.isEmpty() && (w.first() == "a" || w.first() == "an"))
- w.removeFirst();
- }
-
- whats = w.join(' ');
-
- if (whats.endsWith(QLatin1Char('.')))
- whats.truncate(whats.length() - 1);
-
- if (!whats.isEmpty())
- whats[0] = whats[0].toUpper();
-
- // ### move this once \brief is abolished for properties
- resultText << whats;
- }
- return resultText;
-}
-
-Text Doc::legaleseText() const
-{
- if (priv == 0 || !priv->hasLegalese)
- return Text();
- else
- return body().subText(Atom::LegaleseLeft, Atom::LegaleseRight);
-}
-
-Doc::Sections Doc::granularity() const
-{
- if (priv == 0 || priv->extra == 0) {
- return DocPrivateExtra().granularity_;
- }
- else {
- return priv->extra->granularity_;
- }
-}
-
-const QSet<QString> &Doc::parameterNames() const
-{
- return priv == 0 ? *null_Set_QString() : priv->params;
-}
-
-const QStringList &Doc::enumItemNames() const
-{
- return priv == 0 ? *null_QStringList() : priv->enumItemList;
-}
-
-const QStringList &Doc::omitEnumItemNames() const
-{
- return priv == 0 ? *null_QStringList() : priv->omitEnumItemList;
-}
-
-const QSet<QString> &Doc::metaCommandsUsed() const
-{
- return priv == 0 ? *null_Set_QString() : priv->metacommandsUsed;
-}
-
-/*!
- Returns a reference to the list of topic commands used in the
- current qdoc comment. Normally there is only one, but there
- can be multiple \e{qmlproperty} commands, for example.
- */
-const TopicList& Doc::topicsUsed() const
-{
- return priv == 0 ? *nullTopicList() : priv->topics_;
-}
-
-ArgList Doc::metaCommandArgs(const QString& metacommand) const
-{
- return priv == 0 ? ArgList() : priv->metaCommandMap.value(metacommand);
-}
-
-const QList<Text> &Doc::alsoList() const
-{
- return priv == 0 ? *null_QList_Text() : priv->alsoList;
-}
-
-bool Doc::hasTableOfContents() const
-{
- return priv && priv->extra && !priv->extra->tableOfContents_.isEmpty();
-}
-
-bool Doc::hasKeywords() const
-{
- return priv && priv->extra && !priv->extra->keywords_.isEmpty();
-}
-
-bool Doc::hasTargets() const
-{
- return priv && priv->extra && !priv->extra->targets_.isEmpty();
-}
-
-const QList<Atom *> &Doc::tableOfContents() const
-{
- priv->constructExtra();
- return priv->extra->tableOfContents_;
-}
-
-const QList<int> &Doc::tableOfContentsLevels() const
-{
- priv->constructExtra();
- return priv->extra->tableOfContentsLevels_;
-}
-
-const QList<Atom *> &Doc::keywords() const
-{
- priv->constructExtra();
- return priv->extra->keywords_;
-}
-
-const QList<Atom *> &Doc::targets() const
-{
- priv->constructExtra();
- return priv->extra->targets_;
-}
-
-const QStringMultiMap &Doc::metaTagMap() const
-{
- return priv && priv->extra ? priv->extra->metaMap_ : *null_QStringMultiMap();
-}
-
-const Config* Doc::config_ = 0;
-
-void Doc::initialize(const Config& config)
-{
- DocParser::tabSize = config.getInt(CONFIG_TABSIZE);
- DocParser::exampleFiles = config.getCanonicalPathList(CONFIG_EXAMPLES);
- DocParser::exampleDirs = config.getCanonicalPathList(CONFIG_EXAMPLEDIRS);
- DocParser::sourceFiles = config.getCanonicalPathList(CONFIG_SOURCES);
- DocParser::sourceDirs = config.getCanonicalPathList(CONFIG_SOURCEDIRS);
- DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION);
-
- QmlTypeNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
- QStringMap reverseAliasMap;
- config_ = &config;
-
- QSet<QString> commands = config.subVars(CONFIG_ALIAS);
- QSet<QString>::ConstIterator c = commands.constBegin();
- while (c != commands.constEnd()) {
- QString alias = config.getString(CONFIG_ALIAS + Config::dot + *c);
- if (reverseAliasMap.contains(alias)) {
- config.lastLocation().warning(tr("Command name '\\%1' cannot stand"
- " for both '\\%2' and '\\%3'")
- .arg(alias)
- .arg(reverseAliasMap[alias])
- .arg(*c));
- }
- else {
- reverseAliasMap.insert(alias, *c);
- }
- aliasMap()->insert(*c, alias);
- ++c;
- }
-
- int i = 0;
- while (cmds[i].english) {
- cmds[i].alias = new QString(alias(cmds[i].english));
- cmdHash()->insert(*cmds[i].alias, cmds[i].no);
-
- if (cmds[i].no != i)
- Location::internalError(tr("command %1 missing").arg(i));
- i++;
- }
-
- QSet<QString> macroNames = config.subVars(CONFIG_MACRO);
- QSet<QString>::ConstIterator n = macroNames.constBegin();
- while (n != macroNames.constEnd()) {
- QString macroDotName = CONFIG_MACRO + Config::dot + *n;
- Macro macro;
- macro.numParams = -1;
- macro.defaultDef = config.getString(macroDotName);
- if (!macro.defaultDef.isEmpty()) {
- macro.defaultDefLocation = config.lastLocation();
- macro.numParams = Config::numParams(macro.defaultDef);
- }
- bool silent = false;
-
- QSet<QString> formats = config.subVars(macroDotName);
- QSet<QString>::ConstIterator f = formats.constBegin();
- while (f != formats.constEnd()) {
- QString def = config.getString(macroDotName + Config::dot + *f);
- if (!def.isEmpty()) {
- macro.otherDefs.insert(*f, def);
- int m = Config::numParams(def);
- if (macro.numParams == -1) {
- macro.numParams = m;
- }
- else if (macro.numParams != m) {
- if (!silent) {
- QString other = tr("default");
- if (macro.defaultDef.isEmpty())
- other = macro.otherDefs.constBegin().key();
- config.lastLocation().warning(tr("Macro '\\%1' takes"
- " inconsistent number"
- " of arguments (%2"
- " %3, %4 %5)")
- .arg(*n)
- .arg(*f)
- .arg(m)
- .arg(other)
- .arg(macro.numParams));
- silent = true;
- }
- if (macro.numParams < m)
- macro.numParams = m;
- }
- }
- ++f;
- }
-
- if (macro.numParams != -1)
- macroHash()->insert(*n, macro);
- ++n;
- }
-}
-
-/*!
- All the heap allocated variables are deleted.
- */
-void Doc::terminate()
-{
- DocParser::exampleFiles.clear();
- DocParser::exampleDirs.clear();
- DocParser::sourceFiles.clear();
- DocParser::sourceDirs.clear();
- aliasMap()->clear();
- cmdHash()->clear();
- macroHash()->clear();
-
- int i = 0;
- while (cmds[i].english) {
- delete cmds[i].alias;
- cmds[i].alias = 0;
- ++i;
- }
-}
-
-QString Doc::alias(const QString &english)
-{
- return aliasMap()->value(english, english);
-}
-
-/*!
- Trims the deadwood out of \a str. i.e., this function
- cleans up \a str.
- */
-void Doc::trimCStyleComment(Location& location, QString& str)
-{
- QString cleaned;
- Location m = location;
- bool metAsterColumn = true;
- int asterColumn = location.columnNo() + 1;
- int i;
-
- for (i = 0; i < (int) str.length(); i++) {
- if (m.columnNo() == asterColumn) {
- if (str[i] != '*')
- break;
- cleaned += ' ';
- metAsterColumn = true;
- }
- else {
- if (str[i] == '\n') {
- if (!metAsterColumn)
- break;
- metAsterColumn = false;
- }
- cleaned += str[i];
- }
- m.advance(str[i]);
- }
- if (cleaned.length() == str.length())
- str = cleaned;
-
- for (int i = 0; i < 3; i++)
- location.advance(str[i]);
- str = str.mid(3, str.length() - 5);
-}
-
-CodeMarker *Doc::quoteFromFile(const Location &location,
- Quoter &quoter,
- const QString &fileName)
-{
- quoter.reset();
-
- QString code;
-
- QString userFriendlyFilePath;
- QString filePath = Config::findFile(location,
- DocParser::exampleFiles,
- DocParser::exampleDirs,
- fileName, userFriendlyFilePath);
- if (filePath.isEmpty()) {
- QString details = QLatin1String("Example directories: ") + DocParser::exampleDirs.join(QLatin1Char(' '));
- if (!DocParser::exampleFiles.isEmpty())
- details += QLatin1String(", example files: ") + DocParser::exampleFiles.join(QLatin1Char(' '));
- location.warning(tr("Cannot find file to quote from: '%1'").arg(fileName), details);
- }
- else {
- QFile inFile(filePath);
- if (!inFile.open(QFile::ReadOnly)) {
- location.warning(tr("Cannot open file to quote from: '%1'").arg(userFriendlyFilePath));
- }
- else {
- QTextStream inStream(&inFile);
- code = DocParser::untabifyEtc(inStream.readAll());
- }
- }
-
- QString dirPath = QFileInfo(filePath).path();
- CodeMarker *marker = CodeMarker::markerForFileName(fileName);
- quoter.quoteFromFile(userFriendlyFilePath, code, marker->markedUpCode(code, 0, location));
- return marker;
-}
-
-QString Doc::canonicalTitle(const QString &title)
-{
- // The code below is equivalent to the following chunk, but _much_
- // faster (accounts for ~10% of total running time)
- //
- // QRegExp attributeExpr("[^A-Za-z0-9]+");
- // QString result = title.toLower();
- // result.replace(attributeExpr, " ");
- // result = result.simplified();
- // result.replace(QLatin1Char(' '), QLatin1Char('-'));
-
- QString result;
- result.reserve(title.size());
-
- bool dashAppended = false;
- bool begun = false;
- int lastAlnum = 0;
- for (int i = 0; i != title.size(); ++i) {
- uint c = title.at(i).unicode();
- if (c >= 'A' && c <= 'Z')
- c += 'a' - 'A';
- bool alnum = (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9');
- if (alnum) {
- result += QLatin1Char(c);
- begun = true;
- dashAppended = false;
- lastAlnum = result.size();
- }
- else if (!dashAppended) {
- if (begun)
- result += QLatin1Char('-');
- dashAppended = true;
- }
- }
- result.truncate(lastAlnum);
- return result;
-}
-
-void Doc::detach()
-{
- if (!priv) {
- priv = new DocPrivate;
- return;
- }
- if (priv->count == 1)
- return;
-
- --priv->count;
-
- DocPrivate *newPriv = new DocPrivate(*priv);
- newPriv->count = 1;
- if (priv->extra)
- newPriv->extra = new DocPrivateExtra(*priv->extra);
-
- priv = newPriv;
-}
-
-/*!
- The destructor deletes all the sub-TopicRefs.
- */
-TopicRef::~TopicRef()
-{
- foreach (DitaRef* t, subrefs_) {
- delete t;
- }
-}
-
-/*!
- Returns a reference to the structure that will be used
- for generating a DITA mao.
- */
-const DitaRefList& Doc::ditamap() const { return priv->ditamap_; }
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/doc.h b/src/tools/qdoc/doc.h
deleted file mode 100644
index 80d47287bb..0000000000
--- a/src/tools/qdoc/doc.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- doc.h
-*/
-
-#ifndef DOC_H
-#define DOC_H
-
-#include <qset.h>
-#include <qstring.h>
-#include <qmap.h>
-
-#include "location.h"
-
-QT_BEGIN_NAMESPACE
-
-class Atom;
-class CodeMarker;
-class Config;
-class DocPrivate;
-class Quoter;
-class Text;
-class DitaRef;
-
-typedef QPair<QString, Location> ArgLocPair;
-typedef QList<ArgLocPair> ArgList;
-typedef QMap<QString, QString> QStringMap;
-typedef QMultiMap<QString, QString> QStringMultiMap;
-
-struct Topic
-{
- QString topic;
- QString args;
- Topic() { }
- Topic(QString& t, const QString &a) : topic(t), args(a) { }
- bool isEmpty() const { return topic.isEmpty(); }
- void clear() { topic.clear(); args.clear(); }
-};
-typedef QList<Topic> TopicList;
-
-typedef QList<DitaRef*> DitaRefList;
-
-class DitaRef
-{
-public:
- DitaRef() { }
- virtual ~DitaRef() { }
-
- const QString& navtitle() const { return navtitle_; }
- const QString& href() const { return href_; }
- void setNavtitle(const QString& t) { navtitle_ = t; }
- void setHref(const QString& t) { href_ = t; }
- virtual bool isMapRef() const = 0;
- virtual const DitaRefList* subrefs() const { return 0; }
- virtual void appendSubref(DitaRef* ) { }
-
-private:
- QString navtitle_;
- QString href_;
-};
-
-class TopicRef : public DitaRef
-{
-public:
- TopicRef() { }
- ~TopicRef();
-
- virtual bool isMapRef() const Q_DECL_OVERRIDE { return false; }
- virtual const DitaRefList* subrefs() const Q_DECL_OVERRIDE { return &subrefs_; }
- virtual void appendSubref(DitaRef* t) Q_DECL_OVERRIDE { subrefs_.append(t); }
-
-private:
- DitaRefList subrefs_;
-};
-
-class MapRef : public DitaRef
-{
-public:
- MapRef() { }
- ~MapRef() { }
-
- virtual bool isMapRef() const Q_DECL_OVERRIDE { return true; }
-};
-
-class Doc
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Doc)
-
-public:
- // the order is important
- enum Sections {
- NoSection = -2,
- Part = -1,
- Chapter = 1,
- Section1 = 1,
- Section2 = 2,
- Section3 = 3,
- Section4 = 4
- };
-
- Doc() : priv(0) {}
- Doc(const Location& start_loc,
- const Location& end_loc,
- const QString& source,
- const QSet<QString>& metaCommandSet,
- const QSet<QString>& topics);
- Doc(const Doc &doc);
- ~Doc();
-
- Doc& operator=( const Doc& doc );
-
- void renameParameters(const QStringList &oldNames,
- const QStringList &newNames);
- void simplifyEnumDoc();
- void setBody(const Text &body);
- const DitaRefList& ditamap() const;
-
- const Location &location() const;
- const Location& startLocation() const;
- const Location& endLocation() const;
- bool isEmpty() const;
- const QString& source() const;
- const Text& body() const;
- Text briefText(bool inclusive = false) const;
- Text trimmedBriefText(const QString &className) const;
- Text legaleseText() const;
- Sections granularity() const;
- const QSet<QString> &parameterNames() const;
- const QStringList &enumItemNames() const;
- const QStringList &omitEnumItemNames() const;
- const QSet<QString> &metaCommandsUsed() const;
- const TopicList& topicsUsed() const;
- ArgList metaCommandArgs(const QString& metaCommand) const;
- const QList<Text> &alsoList() const;
- bool hasTableOfContents() const;
- bool hasKeywords() const;
- bool hasTargets() const;
- const QList<Atom *> &tableOfContents() const;
- const QList<int> &tableOfContentsLevels() const;
- const QList<Atom *> &keywords() const;
- const QList<Atom *> &targets() const;
- const QStringMultiMap &metaTagMap() const;
-
- static void initialize( const Config &config );
- static void terminate();
- static QString alias( const QString &english );
- static void trimCStyleComment( Location& location, QString& str );
- static CodeMarker *quoteFromFile(const Location &location,
- Quoter &quoter,
- const QString &fileName);
- static QString canonicalTitle(const QString &title);
- static const Config* config() { return config_; }
-
-private:
- void detach();
- DocPrivate *priv;
- static const Config* config_;
-};
-typedef QList<Doc> DocList;
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/doc/config/qdoc.qdocconf b/src/tools/qdoc/doc/config/qdoc.qdocconf
deleted file mode 100644
index 9d841e9b64..0000000000
--- a/src/tools/qdoc/doc/config/qdoc.qdocconf
+++ /dev/null
@@ -1,72 +0,0 @@
-include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-
-project = QDoc
-description = QDoc Manual
-version = $QT_VERSION
-
-sourcedirs = ..
-
-exampledirs = .. \
- ../examples
-
-imagedirs = ../images \
- ../../../../widgets/doc/images
-# ../../../doc/src/templates/images
-
-tagfile = ../html/qdoc.tags
-
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css *.qdoc *.qdocinc *.sample"
-
-qhp.projects = QDoc
-
-qhp.QDoc.file = qdoc.qhp
-qhp.QDoc.namespace = org.qt-project.qdoc.$QT_VERSION_TAG
-qhp.QDoc.virtualFolder = qdoc
-qhp.QDoc.indexTitle = QDoc Manual
-qhp.QDoc.indexRoot =
-
-qhp.QDoc.filterAttributes = qdoc qtrefdoc
-qhp.QDoc.customFilters.QDoc.name = QDoc
-qhp.QDoc.customFilters.QDoc.filterAttributes = qdoc
-qhp.QDoc.subprojects = overviews
-qhp.QDoc.subprojects.overviews.title = Overviews
-qhp.QDoc.subprojects.overviews.indexTitle = QDoc Manual
-qhp.QDoc.subprojects.overviews.selectors = fake:page,group,module
-
-depends += \
- activeqt \
- qtassistant \
- qtbluetooth \
- qtconcurrent \
- qtcontacts \
- qtcore \
- qtdbus \
- qtdesigner \
- qtdoc \
- qthelp \
- qtimageformats \
- qtgui \
- qtlocation \
- qtlinguist \
- qtmultimedia \
- qtnetwork \
- qtopengl \
- qtorganizer \
- qtprintsupport \
- qtqml \
- qtquick \
- qtscript \
- qtscripttools \
- qtsensors \
- qtsql \
- qtsvg \
- qttestlib \
- qtuitools \
- qtversit \
- qtwidgets \
- qtwebkit \
- qtwebkitexamples \
- qtxml \
- qtxmlpatterns
-
-navigation.landingpage = "QDoc Manual"
diff --git a/src/tools/qdoc/doc/corefeatures.qdoc b/src/tools/qdoc/doc/corefeatures.qdoc
deleted file mode 100644
index bbee7410fe..0000000000
--- a/src/tools/qdoc/doc/corefeatures.qdoc
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page corefeatures.html
- \title Core Features
-
- \input examples/signalandslots.qdocinc
- \input examples/objectmodel.qdocinc
- \input examples/layoutmanagement.qdocinc
-*/
diff --git a/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml b/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml
deleted file mode 100644
index c4e8c103e9..0000000000
--- a/src/tools/qdoc/doc/examples/componentset/ProgressBar.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-/*!
- \qmltype ProgressBar
- \inqmlmodule UIComponents
- \brief A component that shows the progress of an event
-
- A ProgressBar shows the linear progress of an event as its \l value.
- The range is specified using the \l {minimum} and the \l{maximum} values.
-
- The ProgressBar component is part of the \l {UI Components} module.
-
- This documentation is part of the \l{componentset}{UIComponents} example.
-*/
-Item {
- id: progressbar
-
- /*!
- The minimum value of the ProgressBar range.
- The \l value must not be less than this value.
- */
- property int minimum: 0
-
- /*!
- The maximum value of the ProgressBar range.
- The \l value must not be more than this value.
- */
- property int maximum: 100
-
- /*!
- The value of the progress.
- */
- property int value: 0
-
- /*!
- \qmlproperty color ProgressBar::color
- The color of the ProgressBar's gradient. Must bind to a color type.
-
- \omit
- The "\qmlproperty <type> <property name>" is needed because
- property alias need to have their types manually entered.
-
- QDoc will not publish the documentation within omit and endomit.
- \endomit
-
- \sa secondColor
- */
- property alias color: gradient1.color
-
- /*!
- \qmlproperty color ProgressBar::secondColor
- The second color of the ProgressBar's gradient.
- Must bind to a color type.
-
- \omit
- The "\qmlproperty <type> <property name>" is needed because
- property alias need to have their types manually entered.
-
- QDoc will not publish the documentation within omit and endomit.
- \endomit
-
- \sa color
- */
- property alias secondColor: gradient2.color
-
- width: 250; height: 23
- clip: true
-
- Rectangle {
- id: highlight
-
- /*!
- An internal documentation comment. The widthDest property is not
- a public API and therefore will not be exposed.
- */
- property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)
-
- width: highlight.widthDest
- Behavior on width { SmoothedAnimation { velocity: 1200 } }
-
- anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
- radius: 1
- gradient: Gradient {
- GradientStop { id: gradient1; position: 0.0 }
- GradientStop { id: gradient2; position: 1.0 }
- }
-
- }
- Text {
- anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter }
- color: "white"
- font.bold: true
- text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%'
- }
-}
diff --git a/src/tools/qdoc/doc/examples/componentset/Switch.qml b/src/tools/qdoc/doc/examples/componentset/Switch.qml
deleted file mode 100644
index 7b7e7af31f..0000000000
--- a/src/tools/qdoc/doc/examples/componentset/Switch.qml
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-/*!
- \qmltype ToggleSwitch
- \inqmlmodule UIComponents
- \brief A component that can be turned on or off
-
- A toggle switch has two states: an \c on and an \c off state. The \c off
- state is when the \l on property is set to \c false.
-
- The ToggleSwitch component is part of the \l {UI Components} module.
-
- This documentation is part of the \l{componentset}{UIComponents} example.
-
-*/
-Item {
- id: toggleswitch
- width: background.width; height: background.height
-
- /*!
- Indicates the state of the switch. If \c false, then the switch is in
- the \c off state.
-
- \omit
- The \qmlproperty <type> <propertyname> is not necessary as QDoc
- will associate this property to the ToggleSwitch
-
- QDoc will not publish the documentation within omit and endomit.
- \endomit
- */
- property bool on: false
-
-
- /*!
- A method to toggle the switch. If the switch is \c on, the toggling it
- will turn it \c off. Toggling a switch in the \c off position will
- turn it \c on.
- */
- function toggle() {
- if (toggleswitch.state == "on")
- toggleswitch.state = "off";
- else
- toggleswitch.state = "on";
- }
-
-
- /*!
- \internal
-
- An internal function to synchronize the switch's internals. This
- function is not for public access. The \internal command will
- prevent QDoc from publishing this comment in the public API.
- */
- function releaseSwitch() {
- if (knob.x == 1) {
- if (toggleswitch.state == "off") return;
- }
- if (knob.x == 78) {
- if (toggleswitch.state == "on") return;
- }
- toggle();
- }
-
- Rectangle {
- id: background
- width: 130; height: 48
- radius: 48
- color: "lightsteelblue"
- MouseArea { anchors.fill: parent; onClicked: toggle() }
- }
-
- Rectangle {
- id: knob
- width: 48; height: 48
- radius: width
- color: "lightblue"
-
- MouseArea {
- anchors.fill: parent
- drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78
- onClicked: toggle()
- onReleased: releaseSwitch()
- }
- }
-
- states: [
- State {
- name: "on"
- PropertyChanges { target: knob; x: 78 }
- PropertyChanges { target: toggleswitch; on: true }
- },
- State {
- name: "off"
- PropertyChanges { target: knob; x: 1 }
- PropertyChanges { target: toggleswitch; on: false }
- }
- ]
-
- transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 }
- }
-}
diff --git a/src/tools/qdoc/doc/examples/componentset/TabWidget.qml b/src/tools/qdoc/doc/examples/componentset/TabWidget.qml
deleted file mode 100644
index 008c5e14e7..0000000000
--- a/src/tools/qdoc/doc/examples/componentset/TabWidget.qml
+++ /dev/null
@@ -1,183 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of 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$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-/*!
- \qmltype TabWidget
- \inqmlmodule UIComponents
- \brief A widget that places its children as tabs
-
- A TabWidget places its children as tabs in a view. Selecting
- a tab involves selecting the tab at the top.
-
- The TabWidget component is part of the \l {UI Components} module.
-
- This documentation is part of the \l{componentset}{UIComponents} example.
-
- \section1 Adding Tabs
-
- To add a tab, declare the tab as a child of the TabWidget.
-
- \code
- TabWidget {
- id: tabwidget
-
- Rectangle {
- id: tab1
- color: "red"
- //... omitted
- }
- Rectangle {
- id: tab2
- color: "blue"
- //... omitted
- }
-
- }
- \endcode
-
-*/
-Item {
- id: tabWidget
-
- /*!
- \internal
-
- Setting the default property to stack.children means any child items
- of the TabWidget are actually added to the 'stack' item's children.
-
- See the \l{"Property Binding in QML"}
- documentation for details on default properties.
-
- This is an implementation detail, not meant for public knowledge. Putting
- the \internal command at the beginning will cause QDoc to not publish this
- documentation in the public API page.
-
- Normally, a property alias needs to have a
- "\qmlproperty <type> <propertyname>" to assign the alias a type.
-
- */
- default property alias content: stack.children
-
-
- /*!
- The currently active tab in the TabWidget.
- */
- property int current: 0
-
- /*!
- A sample \c{read-only} property.
- A contrived property to demonstrate QDoc's ability to detect
- read-only properties.
-
- The signature is:
- \code
- readonly property int sampleReadOnlyProperty: 0
- \endcode
-
- Note that the property must be initialized to a value.
-
- */
- readonly property int sampleReadOnlyProperty: 0
-
- /*!
- \internal
-
- This handler is an implementation
- detail. The \c{\internal} command will prevent QDoc from publishing this
- documentation on the public API.
- */
- onCurrentChanged: setOpacities()
- Component.onCompleted: setOpacities()
-
- /*!
- \internal
-
- An internal function to set the opacity.
- The \internal command will prevent QDoc from publishing this
- documentation on the public API.
- */
- function setOpacities() {
- for (var i = 0; i < stack.children.length; ++i) {
- stack.children[i].opacity = (i == current ? 1 : 0)
- }
- }
-
- Row {
- id: header
-
- Repeater {
- model: stack.children.length
- delegate: Rectangle {
- width: tabWidget.width / stack.children.length; height: 36
-
- Rectangle {
- width: parent.width; height: 1
- anchors { bottom: parent.bottom; bottomMargin: 1 }
- color: "#acb2c2"
- }
- BorderImage {
- anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
- border { left: 7; right: 7 }
- source: "tab.png"
- visible: tabWidget.current == index
- }
- Text {
- horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
- anchors.fill: parent
- text: stack.children[index].title
- elide: Text.ElideRight
- font.bold: tabWidget.current == index
- }
- MouseArea {
- anchors.fill: parent
- onClicked: tabWidget.current = index
- }
- }
- }
- }
-
- Item {
- id: stack
- width: tabWidget.width
- anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
- }
-}
diff --git a/src/tools/qdoc/doc/examples/componentset/componentset.pro b/src/tools/qdoc/doc/examples/componentset/componentset.pro
deleted file mode 100644
index 5b44737c2d..0000000000
--- a/src/tools/qdoc/doc/examples/componentset/componentset.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-SOURCES = componentset.pro \
- ProgressBar.qml \
- Switch.qml \
- TabWidget.qml \
- uicomponents.qdoc
diff --git a/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample b/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample
deleted file mode 100644
index 7a14f88f45..0000000000
--- a/src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc.sample
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \qmlmodule UIComponents 1.0
- \title UI Components
- \brief Basic set of UI components
-
- This is a listing of a list of UI components implemented by QML types. These
- files are available for general import and they are based off the \l{Qt
- Quick Code Samples}.
-
- This module is part of the \l{componentset}{UIComponents} example.
-*/
diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc.sample b/src/tools/qdoc/doc/examples/cpp.qdoc.sample
deleted file mode 100644
index 38a131783b..0000000000
--- a/src/tools/qdoc/doc/examples/cpp.qdoc.sample
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![class]
-/*!
- \class QCache
- \brief The QCache class is a template class that provides a cache.
-
- \ingroup tools
- \ingroup shared
-
- \reentrant
-
- QCache\<Key, T\> defines a cache that stores objects of type T
- associated with keys of type Key. For example, here's the
- definition of a cache that stores objects of type Employee
- associated with an integer key:
-
- \snippet code/doc_src_qcache.cpp 0
-
- Here's how to insert an object in the cache:
-
- \snippet code/doc_src_qcache.cpp 1
-
- ... detailed description ommitted
-
- \sa QPixmapCache, QHash, QMap
-*/
-//![class]
-
-//![function]
-/*!
- \fn QString &QString::remove(int position, int n)
-
- Removes \a n characters from the string, starting at the given \a
- position index, and returns a reference to the string.
-
- If the specified \a position index is within the string, but \a
- position + \a n is beyond the end of the string, the string is
- truncated at the specified \a position.
-
- \snippet qstring/main.cpp 37
-
- \sa insert(), replace()
-*/
-QString &QString::remove(int pos, int len)
-//! [function]
-
-//! [return]
-/*!
- Returns \c true if a QScroller object was already created for \a target; \c false otherwise.
-
- \sa scroller()
-*/
-bool QScroller::hasScroller(QObject *target)
-//! [return]
-
-//! [property]
-/*!
- \property QVariantAnimation::duration
- \brief the duration of the animation
-
- This property describes the duration in milliseconds of the
- animation. The default duration is 250 milliseconds.
-
- \sa QAbstractAnimation::duration()
- */
-int QVariantAnimation::duration() const
-//! [property]
-
-//! [signals]
-/*!
- \fn QAbstractTransition::triggered()
-
- This signal is emitted when the transition has been triggered (after
- onTransition() has been called).
-*/
-//! [signals]
-
-//! [enums]
-/*!
- \enum QSql::TableType
-
- This enum type describes types of SQL tables.
-
- \value Tables All the tables visible to the user.
- \value SystemTables Internal tables used by the database.
- \value Views All the views visible to the user.
- \value AllTables All of the above.
-*/
-//! [enums]
-
-//! [overloaded notifier]
-/*!
-\property QSpinBox::value
-\brief the value of the spin box
-
-setValue() will emit valueChanged() if the new value is different
-from the old one. The \l{QSpinBox::}{value} property has a second notifier
-signal which includes the spin box's prefix and suffix.
-*/
-//! [overloaded notifier]
diff --git a/src/tools/qdoc/doc/examples/examples.qdoc b/src/tools/qdoc/doc/examples/examples.qdoc
deleted file mode 100644
index 28810e30da..0000000000
--- a/src/tools/qdoc/doc/examples/examples.qdoc
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example componentset
- \title QML Documentation Example
-
- This example demonstrates one of the ways to document QML types.
-
- In particular, there are sample types that are documented with QDoc
- commands comments. There are documentation comments for the QML types
- and their public interfaces. The types are grouped into a module, the
- \l{UI Components} module.
-
- The \l{componentset/uicomponents.qdoc.sample}{uicomponents.qdoc} file generates
- the overview page for the \l{UI Components} module page.
-
- The generated documentation is available in the \l{UI Components} module.
-
- \section1 QML Class
-
- The QML types use the \l{qmltype-command}{\\qmltype} to document the
- type. In addition, they have the \l{inmodule-command}{\\inmodule}
- command in order for QDoc to associate them to the \c UIComponents module.
-
- QDoc uses the \l{brief-command}{\\brief} command to place a basic
- description when listing the types.
-
- \section1 Properties, Signals, Handlers, and Methods
-
- The types have their properties, signals, handlers, and methods
- defined in their respective QML files. QDoc associates the properties and
- methods to the types, therefore, you only need to place the
- documentation above the property, method, or signal.
-
- To document the type of a \e {property alias}, you must use the
- \l{qmlproperty-command}{\\qmlproperty} command to specify the data type.
-
- \code
- \qmlproperty int anAliasedProperty
- An aliased property of type int.
- \endcode
-
- \section2 Internal Documentation
-
- You may declare that a documentation is for internal use by placing the
- \l{internal-command}{\\internal} command after the beginning QDoc comment
- \begincomment. QDoc will prevent the internal documentation from appearing
- in the public API.
-
- If you wish to omit certain parts of the documentation, you may use the
- \l{omit-command}{\\omit} and \l{omit-command}{\\endomit} command.
-
- \section1 QML Types with C++ Implementation
-
- This example only demonstrates the documentation for types in QML
- files, but the regular \l{qml-documentation}{QML commands} may be placed
- inside C++ classes to define the public API of the QML type.
-
-*/
-
-
-/*!
- \qmlmodule UIComponents 1.0
- \title UI Components
- \brief Basic set of UI components
-
- This is a listing of a list of UI components implemented by QML types. These
- files are available for general import and they are based on the
- \l{Qt Quick Examples and Tutorials}{Qt Quick Code Samples}.
-
- This module is part of the \l{componentset}{UIComponents} example.
-*/
diff --git a/src/tools/qdoc/doc/examples/layoutmanagement.qdocinc b/src/tools/qdoc/doc/examples/layoutmanagement.qdocinc
deleted file mode 100644
index 780b03c8ff..0000000000
--- a/src/tools/qdoc/doc/examples/layoutmanagement.qdocinc
+++ /dev/null
@@ -1,13 +0,0 @@
-\section1 Layout Classes
-
-The Qt layout system provides a simple and powerful way of specifying
-the layout of child widgets.
-
-By specifying the logical layout once, you get the following benefits:
-
-\list
- \li Positioning of child widgets.
- \li Sensible default sizes for windows.
- \li Sensible minimum sizes for windows.
- \li ...
-\endlist
diff --git a/src/tools/qdoc/doc/examples/main.cpp b/src/tools/qdoc/doc/examples/main.cpp
deleted file mode 100644
index 849405e0ae..0000000000
--- a/src/tools/qdoc/doc/examples/main.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <QApplication>
-#include <QPushButton>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QPushButton hello("Hello world!");
- hello.resize(100, 30);
-
- hello.show();
- return app.exec();
-}
diff --git a/src/tools/qdoc/doc/examples/mainwindow.cpp b/src/tools/qdoc/doc/examples/mainwindow.cpp
deleted file mode 100644
index 68b878c07e..0000000000
--- a/src/tools/qdoc/doc/examples/mainwindow.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <QtWidgets>
-
-#include "mainwindow.h"
-#include "scribblearea.h"
-
-//! [0]
-MainWindow::MainWindow()
-{
- scribbleArea = new ScribbleArea;
- setCentralWidget(scribbleArea);
-
- createActions();
- createMenus();
-
- setWindowTitle(tr("Scribble"));
- resize(500, 500);
-}
-//! [0]
-
-//! [1]
-void MainWindow::closeEvent(QCloseEvent *event)
-//! [1] //! [2]
-{
- if (maybeSave()) {
- event->accept();
- } else {
- event->ignore();
- }
-}
-//! [2]
-
-//! [3]
-void MainWindow::open()
-//! [3] //! [4]
-{
- if (maybeSave()) {
- QString fileName = QFileDialog::getOpenFileName(this,
- tr("Open File"), QDir::currentPath());
- if (!fileName.isEmpty())
- scribbleArea->openImage(fileName);
- }
-}
-//! [4]
-
-//! [5]
-void MainWindow::save()
-//! [5] //! [6]
-{
- QAction *action = qobject_cast<QAction *>(sender());
- QByteArray fileFormat = action->data().toByteArray();
- saveFile(fileFormat);
-}
-//! [6]
-
-//! [7]
-void MainWindow::penColor()
-//! [7] //! [8]
-{
- QColor newColor = QColorDialog::getColor(scribbleArea->penColor());
- if (newColor.isValid())
- scribbleArea->setPenColor(newColor);
-}
-//! [8]
-
-//! [9]
-void MainWindow::penWidth()
-//! [9] //! [10]
-{
- bool ok;
- int newWidth = QInputDialog::getInteger(this, tr("Scribble"),
- tr("Select pen width:"),
- scribbleArea->penWidth(),
- 1, 50, 1, &ok);
- if (ok)
- scribbleArea->setPenWidth(newWidth);
-}
-//! [10]
-
-//! [11]
-void MainWindow::about()
-//! [11] //! [12]
-{
- QMessageBox::about(this, tr("About Scribble"),
- tr("<p>The <b>Scribble</b> example shows how to use QMainWindow as the "
- "base widget for an application, and how to reimplement some of "
- "QWidget's event handlers to receive the events generated for "
- "the application's widgets:</p><p> We reimplement the mouse event "
- "handlers to facilitate drawing, the paint event handler to "
- "update the application and the resize event handler to optimize "
- "the application's appearance. In addition we reimplement the "
- "close event handler to intercept the close events before "
- "terminating the application.</p><p> The example also demonstrates "
- "how to use QPainter to draw an image in real time, as well as "
- "to repaint widgets.</p>"));
-}
-//! [12]
-
-//! [13]
-void MainWindow::createActions()
-//! [13] //! [14]
-{
- openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcuts(QKeySequence::Open);
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
- foreach (const QByteArray &format, QImageWriter::supportedImageFormats()) {
- QString text = tr("%1...").arg(QString(format).toUpper());
-
- QAction *action = new QAction(text, this);
- action->setData(format);
- connect(action, SIGNAL(triggered()), this, SLOT(save()));
- saveAsActs.append(action);
- }
-
- printAct = new QAction(tr("&Print..."), this);
- connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print()));
-
- exitAct = new QAction(tr("E&xit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
-
- penColorAct = new QAction(tr("&Pen Color..."), this);
- connect(penColorAct, SIGNAL(triggered()), this, SLOT(penColor()));
-
- penWidthAct = new QAction(tr("Pen &Width..."), this);
- connect(penWidthAct, SIGNAL(triggered()), this, SLOT(penWidth()));
-
- clearScreenAct = new QAction(tr("&Clear Screen"), this);
- clearScreenAct->setShortcut(tr("Ctrl+L"));
- connect(clearScreenAct, SIGNAL(triggered()),
- scribbleArea, SLOT(clearImage()));
-
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-//! [14]
-
-//! [15]
-void MainWindow::createMenus()
-//! [15] //! [16]
-{
- saveAsMenu = new QMenu(tr("&Save As"), this);
- foreach (QAction *action, saveAsActs)
- saveAsMenu->addAction(action);
-
- fileMenu = new QMenu(tr("&File"), this);
- fileMenu->addAction(openAct);
- fileMenu->addMenu(saveAsMenu);
- fileMenu->addAction(printAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- optionMenu = new QMenu(tr("&Options"), this);
- optionMenu->addAction(penColorAct);
- optionMenu->addAction(penWidthAct);
- optionMenu->addSeparator();
- optionMenu->addAction(clearScreenAct);
-
- helpMenu = new QMenu(tr("&Help"), this);
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-
- menuBar()->addMenu(fileMenu);
- menuBar()->addMenu(optionMenu);
- menuBar()->addMenu(helpMenu);
-}
-//! [16]
-
-//! [17]
-bool MainWindow::maybeSave()
-//! [17] //! [18]
-{
- if (scribbleArea->isModified()) {
- QMessageBox::StandardButton ret;
- ret = QMessageBox::warning(this, tr("Scribble"),
- tr("The image has been modified.\n"
- "Do you want to save your changes?"),
- QMessageBox::Save | QMessageBox::Discard
- | QMessageBox::Cancel);
- if (ret == QMessageBox::Save) {
- return saveFile("png");
- } else if (ret == QMessageBox::Cancel) {
- return false;
- }
- }
- return true;
-}
-//! [18]
-
-//! [19]
-bool MainWindow::saveFile(const QByteArray &fileFormat)
-//! [19] //! [20]
-{
- QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
-
- QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
- initialPath,
- tr("%1 Files (*.%2);;All Files (*)")
- .arg(QString(fileFormat.toUpper()))
- .arg(QString(fileFormat)));
- if (fileName.isEmpty()) {
- return false;
- } else {
- return scribbleArea->saveImage(fileName, fileFormat);
- }
-}
-//! [20]
diff --git a/src/tools/qdoc/doc/examples/minimum.qdocconf b/src/tools/qdoc/doc/examples/minimum.qdocconf
deleted file mode 100644
index e360685f1d..0000000000
--- a/src/tools/qdoc/doc/examples/minimum.qdocconf
+++ /dev/null
@@ -1,38 +0,0 @@
-# QDoc is a tool that constantly evolves to suit our needs,
-# and there are some compatibility issues between old and new
-# practices. For that reason, any QDoc configuration file needs to
-# include compat.qdocconf.
-
-#include(compat.qdocconf)
-
-
-# The outputdir variable specifies the directory
-# where QDoc will put the generated documentation.
-
-outputdir = html
-
-
-# The headerdirs variable specifies the directories
-# containing the header files associated
-# with the .cpp source files used in the documentation.
-
-headerdirs = .
-
-
-# The sourcedirs variable specifies the
-# directories containing the .cpp or .qdoc
-# files used in the documentation.
-
-#sourcedirs = .
-
-
-# The exampledirs variable specifies the directories containing
-# the source code of the example files.
-
-exampledirs = .
-
-
-# The imagedirs variable specifies the
-# directories containing the images used in the documentation.
-
-imagedirs = ./images
diff --git a/src/tools/qdoc/doc/examples/objectmodel.qdocinc b/src/tools/qdoc/doc/examples/objectmodel.qdocinc
deleted file mode 100644
index 02b5991c4d..0000000000
--- a/src/tools/qdoc/doc/examples/objectmodel.qdocinc
+++ /dev/null
@@ -1,11 +0,0 @@
-\section1 Qt Object Model
-
-The standard C++ object model provides very efficient runtime support
-for the object paradigm. But its static nature is inflexibile in
-certain problem domains. Graphical user interface programming is a
-domain that requires both runtime efficiency and a high level of
-flexibility. Qt provides this, by combining the speed of C++ with the
-flexibility of the Qt Object Model.
-
-...
-
diff --git a/src/tools/qdoc/doc/examples/qml.qdoc.sample b/src/tools/qdoc/doc/examples/qml.qdoc.sample
deleted file mode 100644
index cacd912242..0000000000
--- a/src/tools/qdoc/doc/examples/qml.qdoc.sample
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![qmltype]
- \qmltype TextEdit
- \instantiates QQuickTextEdit
- \inqmlmodule QtQuick
- \ingroup qtquick-visual
- \ingroup qtquick-input
- \inherits Item
- \brief Displays multiple lines of editable formatted text
-
- The TextEdit item displays a block of editable, formatted text.
-
- It can display both plain and rich text. For example:
-
- \qml
- TextEdit {
- width: 240
- text: "<b>Hello</b> <i>World!</i>"
- font.family: "Helvetica"
- font.pointSize: 20
- color: "blue"
- focus: true
- }
- \endqml
-
- \image declarative-textedit.gif
-
- ... omitted detailed description
-
- \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example}
-//![qmltype]
-
-//![function]
-/*
- \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1)
-
- Deletes the content at \a index from the model.
-
- \sa clear()
-*/
-void QQuickListModel::remove(QQmlV8Function *args)
-//! [function]
-
-//! [return]
-/*
- Returns \c true if a QScroller object was already created for \a target; \c false otherwise.
-
- \sa scroller()
-*/
-bool QScroller::hasScroller(QObject *target)
-//! [return]
-
-//! [property]
-/*
- \property QVariantAnimation::duration
- \brief the duration of the animation
-
- This property describes the duration in milliseconds of the
- animation. The default duration is 250 milliseconds.
-
- \sa QAbstractAnimation::duration()
- */
-int QVariantAnimation::duration() const
-//! [property]
-
-//! [signals]
-/*
- This signal is emitted when the user clicks the button. A click is defined
- as a press followed by a release. The corresponding handler is
- \c onClicked.
-*/
-signal clicked()
-//! [signals]
-
-//! [enums]
-/*!
-\qmlproperty enumeration QtQuick2::Text::font.weight
-
-Sets the font's weight.
-
-The weight can be one of:
-\list
-\li Font.Light
-\li Font.Normal - the default
-\li Font.DemiBold
-\li Font.Bold
-\li Font.Black
-\endlist
-*/
-//! [enums]
diff --git a/src/tools/qdoc/doc/examples/samples.qdocinc b/src/tools/qdoc/doc/examples/samples.qdocinc
deleted file mode 100644
index d5679fdcd8..0000000000
--- a/src/tools/qdoc/doc/examples/samples.qdocinc
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [qvector3d-class]
-/*!
- \class QVector3D
- \brief The QVector3D class represents a vector or vertex in 3D space.
- \since 4.6
- \ingroup painting-3D
-
- Vectors are one of the main building blocks of 3D representation and
- drawing. They consist of three coordinates, traditionally called
- x, y, and z.
-
- The QVector3D class can also be used to represent vertices in 3D space.
- We therefore do not need to provide a separate vertex class.
-
- \b{Note:} By design values in the QVector3D instance are stored as \c float.
- This means that on platforms where the \c qreal arguments to QVector3D
- functions are represented by \c double values, it is possible to
- lose precision.
-
- \sa QVector2D, QVector4D, QQuaternion
-*/
-//! [qvector3d-class]
-
-//! [qvector3d-function]
-/*!
- \fn QVector3D::QVector3D(const QPoint& point)
-
- Constructs a vector with x and y coordinates from a 2D \a point, and a
- z coordinate of 0.
-*/
-//! [qvector3d-function]
-
-//! [sample-page]
-/*!
- \page generic-guide.html
- \title Generic QDoc Guide
- \nextpage Creating QDoc Configuration Files
- There are three essential materials for generating documentation with qdoc:
-
- \list
- \li \c qdoc binary
- \li \c qdocconf configuration files
- \li \c Documentation in \c C++, \c QML, and \c .qdoc files
- \endlist
-*/
-//! [sample-page]
-
-//! [sample-faq]
-/*!
- \page altruism-faq.html faq
- \title Altruism Frequently Asked Questions
-
- \brief All the questions about altruism, answered.
-
- ...
-*/
-//! [sample-faq]
-
-//! [sample-example]
-/*!
- \title UI Components: Tab Widget Example
- \example declarative/ui-components/tabwidget
-
- This example shows how to create a tab widget. It also demonstrates how
- \l {Property aliases}{property aliases} and
- \l {Introduction to the QML Language#Default Properties}{default properties} can be used to collect and
- assemble the child items declared within an \l Item.
-
- \image qml-tabwidget-example.png
-*/
-//! [sample-example]
-
-//! [sample-overview]
-/*!
- \page overview-qt-technology.html overview
- \title Overview of a Qt Technology
-
- \brief provides a technology never seen before.
-
-*/
-//! [sample-overview]
-
diff --git a/src/tools/qdoc/doc/examples/signalandslots.qdocinc b/src/tools/qdoc/doc/examples/signalandslots.qdocinc
deleted file mode 100644
index e14ede1441..0000000000
--- a/src/tools/qdoc/doc/examples/signalandslots.qdocinc
+++ /dev/null
@@ -1,9 +0,0 @@
-\section1 Signals and Slots
-
-Signals and slots are used for communication between objects. The signals and
-slots mechanism is a central feature of Qt and probably the part that differs
-most from the features provided by other frameworks.
-
-\section2 Introduction
-
-In GUI programming, when we ...
diff --git a/src/tools/qdoc/doc/files/basicqt.qdoc.sample b/src/tools/qdoc/doc/files/basicqt.qdoc.sample
deleted file mode 100644
index ce8df096fa..0000000000
--- a/src/tools/qdoc/doc/files/basicqt.qdoc.sample
+++ /dev/null
@@ -1,67 +0,0 @@
- /*!
- \page basicqt.html
- \contentspage {Basic Qt} {Contents}
- \nextpage Getting Started
-
- \indexpage Index
- \startpage Basic Qt
-
- \title Basic Qt
-
- The Qt toolkit is a C++ class library and a set of tools for
- building multiplatform GUI programs using a "write once,
- compile anywhere approach".
-
- Table of contents:
-
- \list
- \li \l {Getting Started}
- \li \l {Creating Dialogs}
- \li \l {Creating Main Windows}
- \endlist
- */
-
- /*!
- \page gettingstarted.html
- \previouspage Basic Qt
- \contentspage {Basic Qt} {Contents}
- \nextpage Creating Dialogs
-
- \indexpage Index
- \startpage Basic Qt
-
- \title Getting Started
-
- This chapter shows how to combine basic C++ with the
- functionality provided by Qt to create a few small graphical
- interface (GUI) applications.
-*/
-
-/ *!
- \page creatingdialogs.html
- \previouspage Getting Started
- \contentspage {Basic Qt} {Contents}
-
- \indexpage Index
- \startpage Basic Qt
-
- \title Creating Dialogs
-
- This chapter will teach you how to create dialog boxes using Qt.
-*/
-
-/*!
- \page index.html
-
- \indexpage Index
- \startpage Basic Qt
-
- \title Index
-
- \list
- \li \l {Basic Qt}
- \li \l {Creating Dialogs}
- \li \l {Getting Started}
- \endlist
-*/
-
diff --git a/src/tools/qdoc/doc/files/compat.qdocconf b/src/tools/qdoc/doc/files/compat.qdocconf
deleted file mode 100644
index 3e7ea6c891..0000000000
--- a/src/tools/qdoc/doc/files/compat.qdocconf
+++ /dev/null
@@ -1,12 +0,0 @@
-alias.include = input
-
-macro.0 = "\\\\0"
-macro.b = "\\\\b"
-macro.n = "\\\\n"
-macro.r = "\\\\r"
-macro.img = "\\image"
-macro.endquote = "\\endquotation"
-macro.relatesto = "\\relates"
-
-spurious = "Missing comma in .*" \
- "Missing pattern .*"
diff --git a/src/tools/qdoc/doc/files/qtgui.qdocconf b/src/tools/qdoc/doc/files/qtgui.qdocconf
deleted file mode 100644
index 855ed538c2..0000000000
--- a/src/tools/qdoc/doc/files/qtgui.qdocconf
+++ /dev/null
@@ -1,49 +0,0 @@
-include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-
-project = QtGui
-description = Qt GUI Reference Documentation
-version = $QT_VERSION
-
-examplesinstallpath = gui
-
-qhp.projects = QtGui
-
-qhp.QtGui.file = qtgui.qhp
-qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG
-qhp.QtGui.virtualFolder = qtgui
-qhp.QtGui.indexTitle = Qt GUI
-qhp.QtGui.indexRoot =
-
-qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc
-qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION
-qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION
-
-qhp.QtGui.subprojects = classes
-qhp.QtGui.subprojects.classes.title = C++ Classes
-qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
-qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
-qhp.QtGui.subprojects.classes.sortPages = true
-
-tagfile = ../../../doc/qtgui/qtgui.tags
-
-depends += \
- qtcore \
- qtnetwork \
- qtopengl \
- qtsvg \
- qtqml \
- qtquick \
- qtwidgets \
- qtdoc
-
-headerdirs += ..
-
-sourcedirs += .. \
- ../../../examples/gui/doc/src
-
-exampledirs += ../../../examples/gui \
- snippets
-
-imagedirs += images \
- ../../../examples/gui/doc/images \
- ../../../doc/src/images \
diff --git a/src/tools/qdoc/doc/images/happy.gif b/src/tools/qdoc/doc/images/happy.gif
deleted file mode 100644
index a4597f6fa8..0000000000
--- a/src/tools/qdoc/doc/images/happy.gif
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/happyguy.jpg b/src/tools/qdoc/doc/images/happyguy.jpg
deleted file mode 100644
index e8604793c2..0000000000
--- a/src/tools/qdoc/doc/images/happyguy.jpg
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/link-to-qquickitem.png b/src/tools/qdoc/doc/images/link-to-qquickitem.png
deleted file mode 100644
index 00e03c3717..0000000000
--- a/src/tools/qdoc/doc/images/link-to-qquickitem.png
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/links-to-broken-links.png b/src/tools/qdoc/doc/images/links-to-broken-links.png
deleted file mode 100644
index 775143bd4a..0000000000
--- a/src/tools/qdoc/doc/images/links-to-broken-links.png
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/links-to-links.png b/src/tools/qdoc/doc/images/links-to-links.png
deleted file mode 100644
index 9d2cc2fae5..0000000000
--- a/src/tools/qdoc/doc/images/links-to-links.png
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/qa-table.png b/src/tools/qdoc/doc/images/qa-table.png
deleted file mode 100644
index 5818739fac..0000000000
--- a/src/tools/qdoc/doc/images/qa-table.png
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/qt-logo.png b/src/tools/qdoc/doc/images/qt-logo.png
deleted file mode 100644
index 6b72d5fb72..0000000000
--- a/src/tools/qdoc/doc/images/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/images/training.jpg b/src/tools/qdoc/doc/images/training.jpg
deleted file mode 100644
index c2ce5c3b21..0000000000
--- a/src/tools/qdoc/doc/images/training.jpg
+++ /dev/null
Binary files differ
diff --git a/src/tools/qdoc/doc/qa-pages.qdoc b/src/tools/qdoc/doc/qa-pages.qdoc
deleted file mode 100644
index a96673901a..0000000000
--- a/src/tools/qdoc/doc/qa-pages.qdoc
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 28-qdoc-qa-pages.html
- \previouspage Generating DITA XML Output
- \contentspage QDoc Manual
- \nextpage QDoc Manual
-
- \title QA Pages
-
- qdoc can generate some extra HTML pages that can be useful for
- debugging qdoc documentation. These \e QA pages make it easier for
- those who write documentation to find links that either go to the
- wrong targets or don't go anywhere at all.
-
- \section2 Generating the QA Pages
-
- Add \c {-write-qa-pages} to the command line to tell qdoc to
- generate the QA pages. If this option is not provided, the QA
- pages will not be generated, and previolusly generated QA pages
- will be deleted.
-
- \section2 Finding the Module's Main QA Page
-
- The main QA page for a module is not linked into the module's
- generated documentation, but it is located in the same output
- directory. To find the top-level QA page for module \e {xxx}, set
- your browser to the qdoc output directory for module \e {xxx}.
- Several files whose names begin with \e {aaa} appear at the top of
- the list. These are the QA pages for module \e{xxx}. The file
- names begin with \e {aaa} to ensure that they are easy to find at
- the top of the directory.
-
- For module \e{xxx}, find the file \e{aaa-xxx-qa-page.html}. This
- is the top-level QA page for module \e{xxx}. Load that file into
- the browser. The top-level QA page shows a table that contains
- links to several QA sub-pages.
-
- For example, the main QA page for QtCore is \c{aaa-qtcore-qa-page.html}.
- This was the table for QtCore at one point:
-
- \image qa-table.png
-
- Each table entry shows the number of links from QtCore to some
- other module, except for the last entry, which shows the number of
- broken links in QtCore. Click the \b qtquick entry to load the QA
- subpage showing the links from QtCore to QtQuick.
-
- \section2 Links To Links Page
-
- Clicking the \b qtquick table entry on the main QA page for QtCore
- loads the QA subpage showing a table containing all the links from
- QtCore to QtQuick. The table contains all the links constructed
- with the \l {l-command} {\\l command}, as well as the autolinks.
-
- \image links-to-links.png
-
- At the time this table was generated, there were six links from
- QtCore to QtQuick. The first column of each table entry contains
- a link to some link in QtCore. The link text as it appears in
- QtCore is shown. The second and third columns contain the source
- file name and line number for where qdoc saw the link in a qdoc
- comment.
-
- \note The line number will normally refer to the first line of the
- comment where qdoc saw the link.
-
- Clicking on a link in the table takes you to that link in the
- documentation. There the link will be marked with three red
- asterisks. For example, clicking on the link in the fifth table
- entry takes you here:
-
- \image link-to-qquickitem.png
-
- The link is marked with three red asterisks. Now you can click on
- the actual link to check that it goes to the correct place. In
- this case, the link should go to the reference page for the
- QQuickItem class. You can check each link in the table this
- way. If you find a link that goes to the wrong place, use the
- source file name and line number to find the link, and fix the
- problem using the square bracket notation for the \l {l-command}
- {\\l command}.
-
- */
diff --git a/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc b/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
deleted file mode 100644
index a8c9c73b5c..0000000000
--- a/src/tools/qdoc/doc/qdoc-guide/qdoc-guide.qdoc
+++ /dev/null
@@ -1,633 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
- \page qdoc-guide.html
- \title Getting Started with QDoc
- \nextpage Creating QDoc Configuration Files
-
- Qt uses QDoc to generate its documentation set into HTML and DITA XML
- formats. QDoc uses a set of configuration files to generate documentation
- from QDoc comments. The comments have types called
- \l{writing-topic-commands}{topics} that determine whether a comment is a
- class documentation or a property documentation. A comment may also have
- \l{writing-markup}{mark up} to enhance the layout and formatting of the
- final output.
-
- There are three essential materials for generating documentation with qdoc:
- \list
- \li \c QDoc binary
- \li \c qdocconf configuration files
- \li \c Documentation in \c C++, \c QML, and \c .qdoc files
- \endlist
-
- This section intends to cover the basic necessities for creating a
- documentation set. Additionally, the guide presents special considerations
- and options to documenting non-C++ API documentation as well as QML
- documentation. Finally, the guide will provide a sample project
- documentation and an example of a QML type documentation.
-
- For specific QDoc information, consult the
- \l{QDoc Manual}.
- \section1 Chapters
-
- \list 1
- \li \l{Creating QDoc Configuration Files}
- \li \l{Writing Documentation}
- \li \l{Categories of Documentation}
- \list
- \li \l{C++ Documentation Style}
- \li \l{QML Documentation Style}
- \endlist
- \li \l{QML Documentation Example}
- \endlist
-
-*/
-
-/*!
- \page qdoc-guide-conf.html
- \title Creating QDoc Configuration Files
- \previouspage Getting Started with QDoc
- \nextpage Writing Documentation
- To generate documentation, QDoc uses configuration files, with the
- \c qdocconf extension, to store configuration settings.
-
- The \l{The QDoc Configuration File} article covers the various configuration
- variables in greater detail.
-
- \section1 QDoc Configuration Files
- QDoc's configuration settings can reside in a single \e qdocconf file, but
- can also be in other qdocconf files. The \c {include(<filepath>)} command
- allows configuration files to include other configuration files.
-
- QDoc has two outputs, HTML documentation and documentation in DITA XML
- format. The main distinction between the two outputs is that HTML
- documentation needs to have its HTML styling information in the
- configuration files. DITA XML documentation does not, and a separate process
- can style the documentation in DITA at a later time. DITA XML is therefore
- more flexible in allowing different styles to apply to the same information.
-
- To run qdoc, the project configuration file is supplied as an argument.
- \code
- qdoc project.qdocconf
- \endcode
-
- The project configuration contains information that qdoc uses to create the
- documentation.
-
- \section2 Project Information
-
- QDoc uses the \c project information to generate the documentation.
- \code
- project = QDoc Project
- description = Sample QDoc project
- \endcode
-
- \target qdoc-input-output-dir
- \section2 Input and Output Directories
-
- Specifying the path to the source directories allow QDoc to find sources and
- generate documentation.
-
- \code
- sourcedirs = <path to source code>
- exampledirs = <path to examples directory>
- imagedirs = <path to image directory>
-
- sources.fileextensions = "*.cpp *.qdoc *.mm *.qml"
- headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx"
- examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
- examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng"
- \endcode
-
- QDoc will process headers and sources from the ones specified in the
- \c fileextensions variable.
-
- Likewise, QDoc needs the path to the output directory. The \c outputformats
- variable determines the type of documentation. These variables should be
- in separate configuration files to modularize the documentation build.
- \code
- outputdir = $SAMPLE_PROJECT/doc/html
- outputformats = HTML
- \endcode
-
- QDoc can resolve the paths relative to the qdocconf file as well as
- environment variables.
-
- \note During each QDoc run, the output directory is deleted.
- \section2 Extra Files
-
- QDoc will output generated documentation into the directory specified in
- the \l{Input and Output Directories}{output} directory. It is also possible
- to specify extra files that QDoc should export.
-
- \code
- extraimages.HTML = extraImage.png \
- extraImage2.png
- \endcode
-
- The \c extraImage.png and the \c extraImage2.png files will be copied to the
- HTML output directory.
-
- \section2 Qt Help Framework Configuration
-
- QDoc will also export a \e {Qt Help Project} file, in a \c qhp file.
- The qhp file is then used by the \c qhelpgenerator to package the
- documentation into a \c qch file. Qt Creator and Qt Assistant reads the qch
- file to display the documentation.
-
- The \l {Creating Help Project Files} article covers the configuration
- options.
-
- \section2 HTML Configuration
-
- QDoc has an HTML generator that will export a set of documentation into
- HTML files using various configuration settings. QDoc will place the
- generated documentation into the directory specified by the \c outputdir
- variable.
-
- \code
- outputformats = HTML
- outputdir = <path to output directory>
- \endcode
-
- QDoc needs to know where the styles and templates for generating HTML
- are located. Typically, the templates directory contains a \c scripts,
- \c images, and a \c style directory, containing scripts and CSS files.
-
- \code
- HTML.templatedir = <path to templates>
- \endcode
-
- The main configuration variables are:
- \code
- HTML.postheader
- HTML.postpostheader
- HTML.postheader
- HTML.footer
-
- HTML.headerstyles
- HTML.stylesheets = style.css \
- style1.css
-
- HTML.scripts = script.js
- \endcode
-
- The \c{HTML.headerstyles} variable inserts the style information into the
- HTML file and the \c{HTML.stylesheets} specifies which files QDoc should
- copy into the output directory. As well, QDoc will embed the string
- in the \c postheader, \c footer, and related variables into each HTML file.
-
- The \l {HTML Specific Configuration Variables} article outlines the usage
- of each variable.
-
- \section2 DITA XML Configuration
-
- DITA XML output is enabled using the \c outputformats variable. Unlike HTML
- documentation, QDoc does not need HTML style templates for generating
- documentation in DITA XML format.
-
- \code
- outputformats = DITAXML
- outputdir
- \endcode
-
- \section2 Qt Index Reference
- Documentation projects can link to Qt APIs and other articles by specifying
- the path to the \c qt.index file. When qdoc generates the Qt Reference
- Documentation, it will also generate an index file, containing the URLs to
- the articles. Other projects can use the links in the index file so that
- they can link to other articles and API documentation within Qt.
-
- \code
- indexes = $QT_INSTALL_DOCS/html/qt.index $OTHER_PROJECT/html/qt.index
- \endcode
- It is possible to specify multiple index files from several projects.
-
- \section1 Macros and Other Configurations
-
- Macros for substituting HTML characters exist and are helpful for generating
- specific HTML-valid characters.
-
- \code
- macro.pi.HTML = "&Pi;"
- \endcode
- The snippet code will replace any instances of \c{\\pi} with \c &Pi; in the
- HTML file, which will appear as the Greek \pi symbol when viewed in
- browsers.
-
- \section2 QML Additions
-
- QDoc is able to parse QML files for QDoc comments. QDoc will parse files
- with the QML extension, \c{.qml}, if the extension type is included in the
- \l{Input and Output Directories}{fileextensions} variable.
-
- Also, the generated HTML files can have a prefix, specified in the QDoc
- configuration file.
- \code
- outputprefixes = QML
- outputprefixes.QML = uicomponents-
- \endcode
- The outputprefixes will, for example, prefix QML type HTML filenames.
- \code
- files:
- uicomponents-button.html
- uicomponents-scrollbar.html
- \endcode
-
-*/
-
-/*!
- \page qdoc-guide-writing.html
- \title Writing Documentation
- \previouspage Creating QDoc Configuration Files
- \nextpage Categories of Documentation
-
- \section1 QDoc Comments
-
- Documentation is contained within qdoc \e comments, delimited by
- \beginqdoc and \endqdoc comments. Note that these are valid comments
- in C++, QML, and JavaScript.
-
- QDoc will parse C++ and QML files to look for qdoc comments. To explicitly
- omit a certain file type, omit it from the
- \l{Input and Output Directories}{configuration} file.
-
- \section1 QDoc Commands
-
- QDoc uses \e commands to retrieve information about the documentation. \c
- Topic commands determine the type of documentation element, the \c context
- commands provide hints and information about a topic, and \c markup commands
- provide information on how QDoc should format a piece of documentation.
-
- \target writing-topic-commands
- \section2 QDoc Topics
- Each qdoc comment must have a \e topic type. A topic distinguishes it from
- other topics. To specify a topic type, use one of the several
- \l{Topic Commands}{topic commands}.
-
- QDoc will collect similar topics and create a page for each one. For
- example, all the enumerations, properties, functions, and class description
- of a particular C++ class will reside in one page. A generic page is
- specified using the \l{page-command}{\\page} command and the filename is the
- argument.
-
- Example of topic commands:
- \list
- \li \l{enum-command}{\\enum} - for enumeration documentation
- \li \l{class-command}{\\class} - for C++ class documentation
- \li \l{qmltype-command}{\\qmltype} - for QML type documentation
- \li \l{page-command}{\\page} - for creating a page.
- \endlist
-
- The \l{page-command}{\\page} command is for creating articles that are not
- part of source documentation. The command can also accept two arguments: the
- file name of the article and the documentation type. The possible types are:
- \list
- \li \c howto
- \li \c overview
- \li \c tutorial
- \li \c faq
- \li \c article - \e default when there is no type
- \endlist
-
- \snippet examples/samples.qdocinc sample-faq
-
- The \l{Topic Commands} page has information on all of the available topic
- commands.
-
- \target writing-context
- \section2 Topic Contexts
-
- Context commands give QDoc a hint about the \e context of the topic. For
- example, if a C++ function is obsolete, then it should be marked obsolete
- with the \l{obsolete-command}{\\obsolete} command. Likewise,
- \l{nextpage-command}{page navigation} and \l{title-command}{page title} 
- give extra page information to QDoc.
-
- QDoc will create additional links or pages for these contexts. For example,
- a group is created using the \l{group-command}{\\group} command and the
- members have the \l{ingroup-command}{\\ingroup} command. The group name is
- supplied as an argument.
-
- The \l{Context Commands} page has a listing of all the available context
- commands.
-
- \target writing-markup
- \section2 Documentation Markup
-
- QDoc can do \e markup of text similar to other markup or
- documentation tools. QDoc can mark a section of text in \b{bold},
- when the text is marked up with the \l{b-command}{\\b} command.
-
- \code
- \b{This} text will be in \b{bold}.
- \endcode
-
- The \l{Markup Commands} page has a full listing of the available markup
- commands.
-
- \section1 Anatomy of Documentation
-
- Essentially, for QDoc to create a page, there must be some essential
- ingredients present.
-
- \list
- \li Assign a topic to a QDoc comment - A comment could be a page, a
- property documentation, a class documentation, or any of the available
- \l{Topic Commands}{topic commands}.
-
- \li Give the topic a context - QDoc can associate certain topics to other
- pages such as associating obsolete functions when the documentation is
- marked with \l{obsolete-command}{\\obsolete}.
-
- \li Mark sections of the document with
- \l{Markup Commands}{markup commands} - QDoc can create layouts and
- format the documentation for the documentation.
- \endlist
-
- In Qt, the \l{QVector3D} class was documented with the following QDoc
- comment:
- \snippet examples/samples.qdocinc qvector3d-class
-
- It has a constructor, \l{QVector3D::QVector3D()}, which was documented with
- the following QDoc comment:
- \snippet examples/samples.qdocinc qvector3d-function
-
- The different comments may reside in different files and QDoc will collect
- them depending on their topic and their context. The resulting documentation
- from the snippets are generated into the \l{QVector3D} class documentation.
-
- Note that if the documentation immediately precedes the function or class
- in the source code, then it does not need to have a topic. QDoc will assume
- that the documentation above the code is the documentation for that code.
-
- An article is created using \l{page-command}{\\page} command. The first
- argument is the HTML file that QDoc will create. The topic is supplemented
- with context commands, the \l{title-command}{\\title} and
- \l{nextpage-command}{\\nextpage} commands. There are several other
- QDoc commands such as the \l{list-command}{\\list} command.
- \snippet examples/samples.qdocinc sample-page
-
- The section on \l{QDoc Topics}{topic commands} gives an overview on several
- other topic types.
-
-
-*/
-
-/*!
- \page qdoc-categories.html
- \title Categories of Documentation
- \previouspage Writing Documentation
- \nextpage QML Documentation Example
- \brief Describes the different types such as How-To's, Tutorials, Overviews,
- Examples, and Class Documentation.
-
- There are several types of predefined documentation \e categories or
- \e types:
- \list
- \li How-To's
- \li Tutorial
- \li Overview
- \li Article
- \li FAQ (Frequently Asked Questions)
- \li C++ API Documentation
- \li QML Type Documentation
- \li Code Example
- \endlist
-
- QDoc has the ability to format a page depending on the type. Further,
- stylesheets can provide additional control on the display of each category.
-
- \section1 API Documentation
- QDoc excels in the creation of API documentation given a set of source code
- and documentation in QDoc comments. Specifically, QDoc is aware of Qt's
- architecture and can validate the existence of Qt C++ class, function, or
- property documentation. QDoc gives warnings and errors if it cannot
- associate a documentation with a code entity or if a code entity does not
- have documentation.
-
- In general, every Qt code entity such as properties, classes, methods,
- signals, and enumerations have a corresponding
- \l{qdoc-topics}{topic command}. QDoc will associate the documentation to the
- source using C++ naming rules.
-
- QDoc will parse the header files (typically \c .h files) to build a tree of
- the class structures. Then QDoc will parse the source files and
- documentation files to attach documentation to the class structure.
- Afterwards, QDoc will generate a page for the class.
-
- \note QDoc uses the header files to inform itself about the class and will
- not properly process QDoc comments in header files.
-
- \section2 Language Styles
-
- To produce quality API documentation, the Qt API references follow a
- particular language guidelines. While the contents of this page demonstrates
- how to create API documentation, the style guidelines demonstrate how
- the reference materials follow a consistent use of language.
-
- \list
- \li \l{C++ Documentation Style}
- \li \l{QML Documentation Style}
- \endlist
-
- \keyword qml-documentation
- \section2 Documenting QML Types
-
- In the world of \l{Qt Quick}{QML}, there are additional entities we need to
- document such as QML signals, attached properties, and QML methods.
- Internally, they use Qt technologies, however, QML API documentation
- requires different layout and naming conventions from the Qt C++ API
- documentation.
-
- A list of QML related QDoc commands:
- \list
- \li \l{qmlattachedproperty-command}{\\qmlattachedproperty}
- \li \l{qmlattachedsignal-command}{\\qmlattachedsignal}
- \li \l{qmlbasictype-command}{\\qmlbasictype}
- \li \l{qmltype-command}{\\qmltype} - creates a QML type documentation
- \li \l{qmlmethod-command}{\\qmlmethod}
- \li \l{qmlproperty-command}{\\qmlproperty}
- \li \l{qmlsignal-command}{\\qmlsignal}
- \li \l{inherits-command}{\\inherits}
- \li \l{qmlmodule-command}{\\qmlmodule}
- \li \l{inqmlmodule-command}{\\inqmlmodule}
- \li \l{instantiates-command}{\\instantiates}
-
- \endlist
-
- \note Remember to enable QML parsing by including the \c{*.qml} filetype in
- the \l{qdoc-input-output-dir}{fileextension} variable.
-
- To document a QML type, start by creating a QDoc comment that uses the
- \l{qmltype-command} {\\qmltype} command as its topic command.
-
- \section3 QML Parser
-
- If your QML type is defined in a \e qml file, document it there.
- If your QML type is represented by a C++ class, document it in the
- \e cpp file for that C++ class and include an
- \l{instantiates-command}{\\instantiates} command to specify the
- name of the C++ class. Don't document a QML type in a \e{cpp} file
- if the QML type is defined in a \e{qml} file.
-
- When documenting a QML type in a \e{qml} file, place each QDoc
- comment directly above the entity to which the comment applies.
- For example, place the QDoc comment containing the \e{\\qmltype}
- command (the topic comment) directly above the outer QML type in
- the \e{qml} file. Place the comment for documenting a QML property
- directly above the property declaration, and so on for QML signal
- handlers and QML methods. Note that when documenting QML
- properties in a \e{qml} file, you don't normally include the
- \e{\\qmlproperty} command as a topic command (which you must do
- when documenting QML types in \e{cpp} files), because the QML
- parser automatically associates each QDoc comment with the next
- QML declaration it parses. The same is true for QML signal handler
- and QML method comments. But it is sometimes useful to include one
- or more \e{\\qmlproperty} commands in the comment, e.g. when the
- property type is another QML type and you want the user to only
- use certain properties within that other QML type, but not all of
- them. But when documenting a property that has an alias, place the
- QDoc comment for it directly above the alias declaration. In these
- cases, the QDoc comment \e must contain a \e{\\qmlproperty}
- command, because that is the only way QDoc can know the type of
- the aliased property.
-
- When documenting a QML type in the \e cpp file of its
- corresponding C++ class (if it has one), you normally place each
- QDoc comment directly above the entity it documents. However, QDoc
- does not use the QML parser to parse these files (the C++ parser
- is used), so these QML QDoc comments can appear anywhere in the
- \e{cpp} file. Note that QML QDoc comments in \e cpp files \e must
- use the QML topic commands. i.e., the \l{qmltype-command}
- {\\qmltype} command \e must appear in the QDoc comment for the
- QML type, and a \l{qmlproperty-command} {\\qmlproperty} command \e
- must appear in each QML property QDoc comment.
-
- \section3 QML Modules
-
- A QML type belongs to a \e module. The module
- may include all the related types for a platform or contain a certain
- version of \l{Qt Quick}. For example, the Qt Quick 2 QML types belong
- to the Qt Quick 2 module while there is also a Qt Quick 1 module for the older
- types introduced in Qt 4.
-
- QML modules allow grouping QML types. The \l{qmltype-command}
- {\\qmltype} topic command must have an \l{inqmlmodule-command}
- {\\inqmlmodule} context command to relate the type to a QML
- module. Similarly, a \l{qmlmodule-command}{\\qmlmodule} topic
- command must exist in a separate \c{.qdoc} file to create the
- overview page for the module. The overview page will list the
- QML types of the QML module.
-
- The links to the QML types must therefore also contain the module name.
- For example, if a type called \c TabWidget is in the \c UIComponents
- module, it must be linked as \c {UIComponents::TabWidget}.
-
- The \l{componentset}{UIComponents} example demonstrates proper usage of
- QDoc commands to document QML types and QML modules.
-
- \section3 Read-only and Internal QML Properties
-
- QDoc detects QML properties that are marked as \c readonly. Note that the
- property must be initialized with a value.
-
- \code
- readonly property int sampleReadOnlyProperty: 0
- \endcode
- For example, the example \l{TabWidget} type has a fictitious read-only
- property \c sampleReadOnlyProperty. Its declaration has the \c readonly
- identifier and it has an initial value.
-
- Properties and signals that are not meant for the public interface may
- be marked with the \l{internal-command}{\\internal} command. QDoc will not
- publish the documentation in the generated outputs.
-
- \section1 Articles & Overviews
- Articles and overviews are a style of writing best used for providing
- summary detail on a topic or concept. It may introduce a technology or
- discuss how a concept may be applied, but without discussing exact steps
- in too much detail. However, this type of content could provide the entry
- point for readers to find instructional and reference materials that do,
- such as tutorials, examples and class documentation. An example of an
- overview might be a product page, such as a top level discussion of
- Qt Quick, individual modules, design principles, or tools.
-
- To signify that a document is an article, you append the article keyword
- to the \\page command:
-
- \snippet examples/samples.qdocinc sample-overview
-
- The \l{writing-topic-commands}{writing topic commands} section has a listing
- of the available \\page command arguments.
-
- \section1 Tutorials, How-To's, FAQ's
-
- Tutorials, How-To's, and FAQ's are all instructional material, in that they
- instruct or prescribe to the reader. Tutorials are content designed to guide
- the reader along a progressive learning path for a concept or technology.
- How-To's and FAQ's (\e{Frequently Asked Questions}) provide guidance by
- presenting material in the form of answers to commonly asked topics.
- How-To's and FAQ's are designed for easy reference and are not necessarily
- presented in a linear progression.
-
- To create these types, mark the pages by providing a \c type argument to the
- \l{page-command}{\\page} command. The \c type argument is the second
- argument, with the file name being the first.
- \snippet examples/samples.qdocinc sample-faq
-
- The \l{writing-topic-commands}{writing topic commands} section has a listing
- of the available \\page command arguments.
-
- \section1 Code Examples
- Examples are an effective way to demonstrate practical usage of a given
- technology or concept. When it comes to middleware this is usually in the
- form of an application using simple code and clear explanations of what the
- code is doing. Any module, API, project, pattern etc. should have at least
- one good example.
-
- An example may have an accompanying tutorial. The tutorial instructs and
- describes the code, while the code example is the code content that users
- may study. Code examples may have accompanying text that are not in the
- tutorial.
-
- QDoc will create a page containing the example code with a description
- using the \l{example-command}{\\example} command.
-
- \snippet examples/samples.qdocinc sample-example
-
- QDoc will use the directory specified in the input
- \l{Input and Output Directories}{exampledirs} variable to find the Qt
- Project (\c .pro) file to generate the example files. The generated HTML
- will have the filename, \c {declarative-ui-components-tabwidget.html}. QDoc
- will also list all of the example code.
-
- \note The example's project file must be the same as the
- directory name.
-*/
-
-
diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc
deleted file mode 100644
index 8cbf74cd67..0000000000
--- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc
+++ /dev/null
@@ -1,187 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtwritingstyle-cpp.html
-\title C++ Documentation Style
-\brief Style guidelines for C++ documentation
-
-To generate the documentation, QDoc goes through the source code and generates
-documentation for C++ types such as classes. QDoc then associates member
-functions, properties, and other types to the appropriate class.
-
-Note that the documentation must be in the implementation files such as \c .cpp.
-
-\section1 Class Documentation
-
-Class documentation is generated using the \l{class-command}{\\class} command and
-the name of the class as the first argument.
-
-\snippet examples/cpp.qdoc.sample class
-
-\l{Context commands} add information about the class, such as its module or
-which version the class was added.
-
-Some common context commands are:
-\list
-\li \l{brief-command}{\\brief} - the class' brief description \b (mandatory)
-\li \l{since-command}{\\since} - the version to which the class was added \b (mandatory)
-\li \l{internal-command}{\\internal} - marks the class as internal. Internal
-classes do not appear in the public API documentation.
-\endlist
-
-
-\section2 The Brief and Detailed Description
-
-The \e{brief description} is marked with the \l{brief-command}{\\brief} command
-and it is for summarizing the purpose or functionality of the class. For C++
-classes, QDoc will take the class and create annotated information for the
-class. The annotated information appears in lists and tables which display the
-class.
-
-The C++ brief should start with:
-\code
-"The <C++ class name> class"
-\endcode
-
-The \e{detailed description} section starts after the brief description. It
-provides more information about the class. The detailed description may contain
-images, snippet code, or links to other relevant documents. There
-must be an empty line which separates the brief and detailed description.
-
-\section1 Member Functions
-
-Typically, function documentation immediately precedes the implementation of the
-function in the \c .cpp file. For function documentation that is not immediately
-above the implementation, the \l{fn-command}{\\fn} is needed.
-
-\snippet examples/cpp.qdoc.sample function
-
-The function documentation starts with a verb, indicating the operation the
-function performs. This also applies to constructors and destructors.
-
-Some common verbs for function documentation:
-\list
-\li "Constructs..." - for constructors
-\li "Destroys..." - for destructors
-\li "Returns..." - for accessor functions
-\endlist
-
-The function documentation must document:
-\list
-\li the return type
-\li the parameters
-\li the actions of the functions
-\endlist
-
-The \l{a-command}{\\a} command marks the parameter in the documentation.
-The return type documentation should link to the type documentation or be
-marked with the \l{c-command}{\\c} command in the case of boolean values.
-
-\snippet examples/cpp.qdoc.sample return
-
-\section1 Properties
-
-The property documentation resides immediately above the read function's
-implementation. The \l{writing-topic-commands}{topic command} for properties is
-\l{property-command}{\\property}.
-
-\snippet examples/cpp.qdoc.sample property
-
-Property documentation usually starts with "This property...", but these are
-alternate expressions:
-\list
-\li "This property holds..."
-\li "This property describes..."
-\li "This property represents..."
-\li "Returns \c true when... and \c false when..." - for properties that
-are read.
-\li "Sets the..." - for properties that configure a type.
-\endlist
-
-Property documentation must include:
-\list
-\li description and behavior of the property
-\li accepted values for the property
-\li the default value of the property
-\endlist
-Similar to \l{Member Functions}{functions}, the default type may be linked
-or marked with the \c{\c} command.
-
-An example of a value range style is:
-\quotation
-The values range from 0.0 (no blur) to maximumRadius (maximum blur). By default, the property is set to 0.0 (no blur).
-\endquotation
-
-\section1 Signals, Notifiers, and Slots
-The \l{writing-topic-commands}{topic command} for signals, notifiers, and slots
-is \l{fn-command}{\\fn}. Signal documentation state when they are triggered
-or emitted.
-
-\snippet examples/cpp.qdoc.sample signals
-
-Signal documentation typically begin with "This signal is triggered when...".
-Here are alternate styles:
-\list
-\li "This signal is triggered when..."
-\li "Triggered when..."
-\li "Emitted when..."
-\endlist
-
-For slots or notifiers, the condition when they are executed or triggered by
-a signal should be documented.
-\list
-\li "Executed when..."
-\li "This slot is executed when..."
-\endlist
-
-For properties that have overloaded signals, QDoc groups the overloaded
-notifiers together. To refer to a specific version of a notifier or signal,
-simply refer to the property and mention that there are different versions of
-the notifier.
-
-\snippet examples/cpp.qdoc.sample overloaded notifier
-
-\section1 Enums, Namespaces, and Other Types
-
-Enums, namespaces, and macros have a \l{writing-topic-commands}{topic command} for their documentation:
-\list
-\li \l{enum-command}{\\enum}
-\li \l{typedef-command}{\\typedef}
-\li \l{macro-command}{\\macro}
-\endlist
-
-The language style for these types mention that they are an enum or a macro and
-continues with the type description.
-
-For enumerations, the \l{value-command}{\\value} command is for listing the
-values. QDoc creates a table of values for the enum.
-
-\snippet examples/cpp.qdoc.sample enums
-
-*/
-
diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc
deleted file mode 100644
index 6955a042c2..0000000000
--- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtwritingstyle-qml.html
-\title QML Documentation Style
-\brief Style guidelines for QML documentation
-
-QDoc can process QML types defined as C++ classes and QML types defined in
-\c .qml files. For C++ classes documented as QML types, the QDoc comments are
-in the \c .cpp file while QML types defined in QML are in the \c .qml
-file. The C++ classes must also be documented
-documented with the QML \l{topic-commands}{topic commands}:
-
-\list
-\li \l{qmlattachedproperty-command}{\\qmlattachedproperty}
-\li \l{qmlattachedsignal-command}{\\qmlattachedsignal}
-\li \l{qmlbasictype-command}{\\qmlbasictype}
-\li \l{qmltype-command}{\\qmltype}
-\li \l{qmlmethod-command}{\\qmlmethod}
-\li \l{qmlproperty-command}{\\qmlproperty}
-\li \l{qmlsignal-command}{\\qmlsignal}
-\li \l{qmlmodule-command}{\\qmlmodule}
-\li \l{inqmlmodule-command}{\\inqmlmodule}
-\li \l{instantiates-command}{\\instantiates}
-\endlist
-
-For QML types defined in \c .qml files, QDoc will parse the QML and determine
-the properties, signals, and the type within the QML definition. The QDoc
-block then needs to be immediately above the declaration. For QML types
-implemented in C++, QDoc will output warnings if the C++ class documentation
-does not exist. The class documentation may be marked as
-\l{internal-command}{internal} if it is not a public API.
-
-\section1 QML Types
-
-The \l{qmltype-command}{\\qmltype} command is for QML type documentation.
-
-\snippet examples/qml.qdoc.sample qmltype
-
-The \l{instantiates-command}{\\instantiates} accepts the C++ class which
-implements the QML type as the argument. For types implemented in QML, this
-is not needed.
-
-The \e{brief description} provides a summary for the QML type. The brief does
-not need to be a complete sentence and may start with a verb. QDoc will append
-the brief description onto the QML type in tables and generated lists.
-
-\code
-\qmltype ColorAnimation
-\brief Animates changes in color values
-\endcode
-
-Here are some alternate verbs for the brief statement:
-\list
-\li "Provides..."
-\li "Specifies..."
-\li "Describes..."
-\endlist
-
-The \e{detailed description} follows the brief and may contain images, snippet,
-and link to other documentation.
-
-\section1 Properties
-
-The property description focuses on what the property \e does and may use the
-following style:
-
-Property documentation usually starts with "This property..." but for certain
-properties, these are the common expressions:
-\list
-\li "This property holds..."
-\li "This property describes..."
-\li "This property represents..."
-\li "Returns \c true when... and \c false when..." - for properties that
-are marked \c{read-only}.
-\li "Sets the..." - for properties that configure a type.
-\endlist
-
-\section1 Signals and Handlers Documentation
-
-QML signals are documented either in the QML file or in the C++ implementation
-with the \l{qmlsignal-command}{\\qmlsignal} command. Signal documentation
-must include the condition for emitting the signal, mention the corresponding
-signal handler, and document whether the signal accepts a parameter.
-
-\snippet examples/qml.qdoc.sample signals
-
-These are the possible documentation styles for signals:
-\list
-\li "This signal is triggered when..."
-\li "Triggered when..."
-\li "Emitted when..."
-\endlist
-
-\section1 Methods and JavaScript Functions
-
-Typically, function documentation immediately precedes the implementation of the
-function in the \c .cpp file. The \l{topic-commands}{topic command} for
-functions is \l{fn-command}{\\fn}. For functions in QML or JavaScript, the
-documentation must reside immediately above the function declaration.
-
-The function documentation starts with a verb, indicating the operation the
-function performs.
-
-\snippet examples/qml.qdoc.sample function
-
-Some common verbs for function documentation:
-\list
-\li "Copies..." - for constructors
-\li "Destroys..." - for destructors
-\li "Returns..." - for accessor functions
-\endlist
-
-The function documentation must document:
-\list
-\li the return type
-\li the parameters
-\li the actions of the functions
-\endlist
-
-The \l{a-command}{\\a} command marks the parameter in the documentation.
-The return type documentation should link to the type documentation or be
-marked with the \l{c-command}{\\c} command in the case of boolean values.
-
-\section1 Enumerations
-
-QML enumerations are documented as QML properties with the
-\l{qmlproperty-command}{\\qmlproperty} command. The type of the property
-is \c enumeration.
-
-\snippet examples/qml.qdoc.sample enums
-
-The QDoc comment lists the values of the enumeration. If the enumeration is
-implemented in C++, the documentation may link to the corresponding C++
-enumeration. However, the QDoc comment should advise that the enumeration
-is a C++ enumeration.
-
-*/
-
diff --git a/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc b/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc
deleted file mode 100644
index 72882c8eb1..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-DITA.qdoc
+++ /dev/null
@@ -1,164 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 21-0-qdoc-creating-dita-maps.html
- \previouspage Miscellaneous
- \contentspage QDoc Manual
- \nextpage The QDoc Configuration File
-
- \title Creating DITA Maps
-
- You can create DITA map files using three new qdoc commands, the \l{ditamap-command}
- {ditamap} command, the \l{topicref-command} {topicref} command, and the \l{mapref-command}
- {mapref} command. How these DITA maps will be used automatically or manually by the
- documentation build process is still under consideration. This section will be updated
- as the decisions are made.
-
- \section1 What is a DITA Map?
-
- A complete description of DITA can be found at the
- \l{http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dita}
- {OASIS Darwin Information Typing Architecture} site.
-
- An explanation of the DITA map is found at that site
- \l{http://docs.oasis-open.org/dita/v1.2/os/spec/langref/map.html}{here}.
-
- \target ditamap-command
- \section1 \\ditamap
-
- The \\ditamap command is for creating a DITA map using qdoc commands.
- The \\ditamap command is a kind of \\page command that produces a
- \e{.ditamap} instead of a \e{.html} or \e{.xml} file. The file that
- is created actually contains XML text, but the \e{.ditamap} suffix is
- used to identify the file as containing a DITA MAP.
-
- The argument is the name of the file to be created. In the following
- example, the file \e{creator.ditamap} is output:
- \code
- \ditamap creator.ditamap
- \endcode
-
- \target topicref-command
- \section1 \\topicref \\endtopicref
-
- The \\topicref \\endtopicref commands are for creating a topicref
- in the ditamap. The \\endtopicref command is required because
- \\topicref commands can be nested.
-
- \\topicref has two arguments. The first argument becomes the value
- of the \e navtitle attribute. Normally, you use the title of the
- topic being referenced. This title is often what will appear in a
- table of contents constructed from the ditamap.
-
- The second argument is the name of the page being referenced. The
- second argument is actually optional, for example if you are using
- a topicref as a container for other topicrefs and maprefs. It is
- also optional if you want qdoc to find the page name for you by
- looking up the title in its internal data structure. It is recommended
- that you provide the second parameter if you know the page name.
-
- \code
- \topicref {QML Module QtQuick 2} {qtquick-2.xml}
- \mapref {Creator Manual} {creator-manual.ditamap} \endmapref
- \topicref {QML Mouse Events} {qtquick2-mouseevents.xml} \endtopicref
- \topicref {Property Binding} {qtquick2-propertybinding.xml} \endtopicref
- \endtopicref
- \endcode
-
- \target mapref-command
- \section1 \\mapref
-
- The \\mapref command is for creating a mapref in the ditamap. A
- mapref refers to another ditamap, which you want to include in
- your ditamap. Like the \\topicref command, the \\mapref command
- has two arguments, but for the \\mapref command, both arguments
- are required. The arguments are essentially the same as described
- for \\topicref, but for \\mapref, the second command must be the
- name of another ditamap, i.e. it must have the \e{.ditamap}
- suffix. You must provide the file name. qdoc can't look up the
- file name for you.
-
- \code
- \mapref {Creator Manual} {creator-manual.ditamap} \endmapref
- \endcode
-
- \section1 An Example Ditamap Page
-
- The following example uses the three qdoc ditamap commands described above.
-
- \code
- \ditamap creator.ditamap
- \title The DITA Map for Creator
-
- \topicref {QML Module QtQuick 1}
- \topicref {QML Mouse Events} \endtopicref
- \topicref {Property Binding} \endtopicref
- \endtopicref
-
- \topicref {QML Module QtQuick 2} {qtquick-2.xml}
- \mapref {Creator Manual} {creator-manual.ditamap} \endmapref
- \topicref {QML Mouse Events} {qtquick2-mouseevents.xml} \endtopicref
- \topicref {Property Binding} {qtquick2-propertybinding.xml} \endtopicref
- \endtopicref
-
- \topicref {QML Module QtQuick.Particles 2} {qtquick-particles-2.xml}
- \topicref {Age} {qml-qtquick-particles2-age.xml} \endtopicref
- \endtopicref
- \endcode
-
- \section1 The Resulting Ditamap File
-
- This is the \e{.ditamap} file you get when you input the qdoc
- ditamap page shown above. Note that you can write ditamap files
- directly in XML just as easily as you can write them using the
- qdoc commands. The choice is yours.
-
- \code
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
- <map>
- <topicmeta>
- <shortdesc>The DITA Map for Creator</shortdesc>
- </topicmeta>
- <topicref navtitle="QML Module QtQuick 1" href="qtquick-1.xml">
- <topicref navtitle="QML Mouse Events" href="qtquick2-mouseevents.xml"/>
- <topicref navtitle="Property Binding" href="qtquick2-propertybinding.xml"/>
- </topicref>
- <topicref navtitle="QML Module QtQuick 2" href="qtquick-2.xml">
- <mapref navtitle="Creator Manual" href="creator-manual.ditamap"/>
- <topicref navtitle="QML Mouse Events" href="qtquick2-mouseevents.xml"/>
- <topicref navtitle="Property Binding" href="qtquick2-propertybinding.xml"/>
- </topicref>
- <topicref navtitle="QML Module QtQuick.Particles 2" href="qtquick-particles-2.xml">
- <topicref navtitle="Age" href="qml-qtquick-particles2-age.xml"/>
- </topicref>
- </map>
- \endcode
-
-*/
-
diff --git a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
deleted file mode 100644
index 87416fcd14..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc
+++ /dev/null
@@ -1,154 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 27-qdoc-commands-alphabetical.html
- \previouspage Introduction to QDoc
- \contentspage QDoc Manual
- \nextpage Topic Commands
-
- \title Command Index
-
- This is a complete, alphabetized list of the QDoc commands.
-
- \list
-
- \li \l {a-command} {\\a}
- \li \l {abstract-command} {\\abstract}
- \li \l {annotatedlist-command} {\\annotatedlist}
- \li \l {b-command} {\\b}
- \li \l {b-command} {\\bold} \span {class="newStuff"} {(deprecated, use \\b)}
- \li \l {brief-command} {\\brief}
- \li \l {c-command} {\\c}
- \li \l {caption-command} {\\caption}
- \li \l {chapter-command} {\\chapter}
- \li \l {class-command} {\\class}
- \li \l {code-command} {\\code}
- \li \l {codeline-command} {\\codeline},
- \li \l {compat-command} {\\compat}
- \li \l {contentspage-command} {\\contentspage}
- \li \l {default-command} {\\default}
- \li \l {div-command} {\\div}
- \li \l {dots-command} {\\dots}
- \li \l {e-command} {\\e}
- \li \l {else-command} {\\else}
- \li \l {endif-command} {\\endif}
- \li \l {enum-command} {\\enum}
- \li \l {example-command} {\\example}
- \li \l {externalpage-command} {\\externalpage}
- \li \l {fn-command} {\\fn}
- \li \l {footnote-command} {\\footnote}
- \li \l {generatelist-command} {\\generatelist}
- \li \l {group-command} {\\group}
- \li \l {header-command} {\\header}
- \li \l {headerfile-command} {\\headerfile}
- \li \l {e-command} {\\i} \span {class="newStuff"} {(deprecated, use \\e)}
- \li \l {if-command} {\\if}
- \li \l {image-command} {\\image}
- \li \l {include-command} {\\include}
- \li \l {indexpage-command} {\\indexpage}
- \li \l {ingroup-command} {\\ingroup}
- \li \l {inherits-command}{\\inherits}
- \li \l {inlineimage-command} {\\inlineimage}
- \li \l {inmodule-command} {\\inmodule}
- \li \l {inqmlmodule-command} {\\inqmlmodule}
- \li \l {instantiates-command} {\\instantiates}
- \li \l {internal-command} {\\internal}
- \li \l {keyword-command} {\\keyword}
- \li \l {l-command} {\\l}
- \li \l {legalese-command} {\\legalese}
- \li \l {li-command} {\\li}
- \li \l {list-command} {\\list}
- \li \l {macro-command} {\\macro}
- \li \l {meta-command} {\\meta}
- \li \l {module-command} {\\module}
- \li \l {namespace-command} {\\namespace}
- \li \l {nextpage-command} {\\nextpage}
- \li \l {newcode-command} {\\newcode}
- \li \l {nonreentrant-command} {\\nonreentrant}
- \li \l {note-command} {\\note}
- \li \l {li-command} {\\o} \span {class="newStuff"} {(deprecated, use \\li)}
-
- \li \l {obsolete-command} {\\obsolete}
- \li \l {oldcode-command} {\\oldcode}
- \li \l {omit-command} {\\omit}
- \li \l {omitvalue-command} {\\omitvalue}
- \li \l {overload-command} {\\overload}
- \li \l {page-command} {\\page}
- \li \l {part-command} {\\part}
- \li \l {preliminary-command} {\\preliminary}
- \li \l {previouspage-command} {\\previouspage}
- \li \l {printline-command} {\\printline}
- \li \l {printto-command} {\\printto}
- \li \l {printuntil-command} {\\printuntil}
- \li \l {property-command} {\\property}
- \li \l {qmlattachedproperty-command} {\\qmlattachedproperty}
- \li \l {qmlattachedsignal-command} {\\qmlattachedsignal}
- \li \l {qmlbasictype-command} {\\qmlbasictype}
- \li \l {qmlclass-command} {\\qmlclass} \span {class="newStuff"} {(deprecated, use \\qmltype)}
- \li \l {qmltype-command} {\\qmltype}
- \li \l {qmlmethod-command} {\\qmlmethod}
- \li \l {qmlproperty-command} {\\qmlproperty}
- \li \l {qmlsignal-command} {\\qmlsignal}
- \li \l {qmlmodule-command} {\\qmlmodule}
- \li \l {quotation-command} {\\quotation}
- \li \l {quotefile-command} {\\quotefile}
- \li \l {quotefromfile-command} {\\quotefromfile}
- \li \l {raw-command} {\\raw}
- \li \l {reentrant-command} {\\reentrant}
- \li \l {reimp-command} {\\reimp}
- \li \l {relates-command} {\\relates}
- \li \l {row-command} {\\row}
- \li \l {sa-command} {\\sa}
- \li \l {sectionOne-command} {\\section1}
- \li \l {sectionTwo-command} {\\section2}
- \li \l {sectionThree-command} {\\section3}
- \li \l {sectionFour-command} {\\section4}
- \li \l {since-command} {\\since}
- \li \l {skipline-command} {\\skipline}
- \li \l {skipto-command} {\\skipto}
- \li \l {skipuntil-command} {\\skipuntil}
- \li \l {snippet-command} {\\snippet},
- \li \l {span-command} {\\span}
- \li \l {startpage-command} {\\startpage}
- \li \l {sub-command} {\\sub}
- \li \l {subtitle-command} {\\subtitle}
- \li \l {sup-command} {\\sup}
- \li \l {table-command} {\\table}
- \li \l {tableofcontents-command} {\\tableofcontents}
- \li \l {target-command} {\\target}
- \li \l {threadsafe-command} {\\threadsafe}
- \li \l {title-command} {\\title}
- \li \l {tt-command} {\\tt}
- \li \l {typedef-command} {\\typedef}
- \li \l {uicontrol-command} {\\uicontrol}
- \li \l {underline-command} {\\underline}
- \li \l {variable-command} {\\variable}
- \li \l {value-command} {\\value}
- \li \l {warning-command} {\\warning}
- \endlist
-*/
diff --git a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
deleted file mode 100644
index 77987d6d95..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
+++ /dev/null
@@ -1,1041 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 14-qdoc-commands-contextcommands.html
- \previouspage Topic Commands
- \contentspage QDoc Manual
- \nextpage Document Navigation
-
- \title Context Commands
-
- The context commands provide information about the element being
- documented that QDoc can't deduce on its own. For example:
- \list
- \li Is this class thread-safe?
- \li Is this function reentrant?
- \li Of which module is this class a member ?
- \endlist
-
- Context commands can appear anywhere in a QDoc comment,
- but they are normally placed near the top of the comment, just
- below the \l {Topic Commands} {topic} command.
-
- \list
- \li \l {compat-command}{\\compat},
- \li \l {contentspage-command}{\\contentspage},
- \li \l {indexpage-command}{\\indexpage},
- \li \l {ingroup-command}{\\ingroup},
- \li \l {inherits-command}{\\inherits},
- \li \l {inmodule-command}{\\inmodule},
- \li \l {internal-command}{\\internal},
- \li \l {nextpage-command}{\\nextpage},
- \li \l {nonreentrant-command}{\\nonreentrant},
- \li \l {obsolete-command}{\\obsolete},
- \li \l {overload-command}{\\overload},
- \li \l {preliminary-command}{\\preliminary},
- \li \l {previouspage-command}{\\previouspage},
- \li \l {reentrant-command}{\\reentrant},
- \li \l {reimp-command}{\\reimp},
- \li \l {relates-command}{\\relates},
- \li \l {since-command}{\\since},
- \li \l {startpage-command}{\\startpage},
- \li \l {subtitle-command}{\\subtitle}
- \li \l {threadsafe-command}{\\threadsafe},
- \li \l {title-command}{\\title}
- \endlist
-
-*/
-
-/*!
- \page 15-qdoc-commands-navigation.html
- \previouspage Context Commands
- \contentspage QDoc Manual
- \nextpage Reporting Status
-
- \title Document Navigation
-
- The navigation commands are for linking the pages of a document in
- a meaningful sequence. Below is a sequence of QDoc comments that
- shows a typical use of the navigation commands.
-
- \section1 Example
- \quotefile files/basicqt.qdoc.sample
-
- QDoc renders the "Getting Started" page in \c{creatingdialogs.html}:
-
- \quotation
- \raw HTML
- <table border="0" cellpadding="0" cellspacing="5" width="100%">
-
- <tr>
- <p>
- [Previous: <a href="15-qdoc-commands-navigation.html#deadlink">
- Basic Qt</a>]
- [<a href="15-qdoc-commands-navigation.html#deadlink">Contents</a>]
- [Next: <a href="15-qdoc-commands-navigation.html#deadlink">
- Creating Dialogs</a>]
- </p>
-
- <h1 align="center">Getting Started<br /></h1>
-
- <p>
- This chapter shows how to combine basic C++ with the
- functionality provided by Qt to create a few small graphical
- interface (GUI) applications.
- </p>
-
- <p>
- [Previous: <a href="15-qdoc-commands-navigation.html#deadlink">
- Basic Qt</a>]
- [<a href="15-qdoc-commands-navigation.html#deadlink">Contents</a>]
- [Next: <a href="15-qdoc-commands-navigation.html#deadlink">
- Creating Dialogs</a>]
- </p>
-
- </table>
- \endraw
- \endquotation
-
- The \l {indexpage-command} {\\indexpage} and \l
- {startpage-command} {\\startpage} commands create links to the
- page's index page and start page. These links can be used by
- browsers and search engines.
-
- The index page is typically an alphabetical list of the document's
- titles and topics, while the start page is the page considered by
- the author to be the starting point of a multipage document.
-
- The links are included in the generated HTML source code, but have
- no visual effect on the documentation:
-
- \code
- <head>
- ...
- <link rel="index" href="index.html" />
- <link rel="start" href="basicqt.html" />
- ...
- </head>
- \endcode
-
- \section1 Commands
-
- \target previouspage-command
- \section2 \\previouspage
-
- The \\previouspage command links the current page to the previous
- page in a sequence.a The command has two arguments, each enclosed
- by curly braces: the first is the link target (the title of
- the previous page), the second is the link text. If the page's
- title is equivalent to the link text, the second argument can be
- omitted.
-
- The command must stand alone on its own line.
-
- \target nextpage-command
- \section2 \\nextpage
-
- The \\nextpage command links the current page to the next page in
- a sequence. The command follows the same syntax and argument
- convention as the \l {previouspage-command} {\\previouspage}
- command.
-
- \target startpage-command
- \section2 \\startpage
-
- The \\startpage command specifies the first page of a sequence of
- pages. The command must stand alone on its own line, and its
- unique argument is the title of the first document.
-
- QDoc will generate a link to the start page and include it in the
- generated HTML file, but this has no visual effect on the
- documentation. The generated link type tells browsers and search
- engines which document is considered by the author to be the
- starting point of the collection.
-
- \target contentspage-command
- \section2 \\contentspage
-
- The \\contentspage command links the current page to a table of
- contents page. The command follows the same syntax and argument
- convention as the \l {previouspage-command} {\\previouspage}
- command.
-
- \target indexpage-command
- \section2 \\indexpage
-
- The \\indexpage command specifies an index page for the current
- document. The command must stand alone on its own line, and its
- unique argument is the title of the index document.
-
- QDoc will generate a link to the index page and include it in the
- generated HTML file, but this has no visual effect on the
- documentation. The generated link type tells browsers and search
- engines which document is considered by the author to be the
- index page of the collection.
-*/
-
-
-/*!
- \page 16-qdoc-commands-status.html
- \previouspage Document Navigation
- \contentspage QDoc Manual
- \nextpage Thread Support
-
- \title Reporting Status
-
- These commands are for indicating that a documented element is
- still under development, is becoming obsolete, is provided for
- compatibility reasons, or is simply not to be included in the
- public interface. The \l {since-command}{\\since} command is for
- including information about the version when a function or class
- first appeared.
-
- \target compat-command
- \section1 \\compat
-
- The \\compat command is for indicating that a class or function is
- part of the support library provided to keep old source code
- working.
-
- The command must stand on its own line.
-
- Usually an equivalent function or class is provided as an
- alternative.
-
- If the command is used in the documentation of a class, the
- command expands to a warning that the referenced class is part of
- the support library. The warning is located at the top of the
- documentation page.
-
- \code
- \beginqdoc
- \class MyQt3SupportClass
- \compat
- \endqdoc
- \endcode
-
- QDoc renders this at the top of the MyQt3SupportClass class
- reference page.
-
- \quotation
- \b {This class is part of the Qt 3 support
- library.} It is provided to keep old source code
- working. We strongly advise against using it in new
- code. See the \l
- {http://doc.qt.digia.com/4.0/porting4.html} {Porting
- Guide} for more information.
- \endquotation
-
- If the command is used when documenting a function, QDoc will
- create and link to a separate page documenting Qt 3 support
- members when generating the reference documentation for the
- associated class.
-
- \code
- \beginqdoc
- \fn MyClass::MyQt3SupportMemberFunction
- \compat
-
- Use MyNewFunction() instead.
- \endqdoc
- \endcode
-
- QDoc renders this in \c{myclass-qt3.html} as:
-
- \quotation
- \raw HTML
- <h1>Qt 3 Support Members for MyClass</h1>
- \endraw
-
- \b {The following class members are part of the Qt 3
- support layer.} They are provided to help you port old code to
- Qt 4. We advise against using them in new code.
-
- ...
-
- \list
- \li void MyQt3SupportMemberFunction()
- \li ...
- \endlist
-
- \raw HTML
- <hr />
- <h2>Member Function Documentation</h2>
- <h3>void MyQt3SupportMemberFunction ()</h3>
- <p>Use MyNewFunction() instead.</p>
- \endraw
- ...
- \endquotation
-
- \target default-command
- \section1 \\default
-
- The \\default command is for marking a QML property as the
- \l {default-properties}
- {default property}. The word \span {class="newStuff"} {default} is shown in red in
- the documentation of the property.
-
- \code
- / *!
- \qmlproperty list<Change> State::changes
- This property holds the changes to apply for this state.
- \default
-
- By default these changes are applied against the default state. If the state
- extends another state, then the changes are applied against the state being
- extended.
- * /
- \endcode
-
- See how QDoc renders this property on the reference page for the
- \l {State::changes}{State} type.
-
- \target obsolete-command
- \section1 \\obsolete
-
- The \\obsolete command is for indicating that a function is being
- deprecated, and it should no longer be used in new code. There is
- no guarantee for how long it will remain in the library.
-
- The command must stand on its own line.
-
- When generating the reference documentation for a class, QDoc will
- create and link to a separate page documenting its obsolete
- functions. Usually an equivalent function is provided as an
- alternative.
-
- \code
- / *!
- \fn MyClass::MyObsoleteFunction
- \obsolete
-
- Use MyNewFunction() instead.
- * /
- \endcode
-
- QDoc renders this in \c{myclass-obsolete.html} as:
-
- \quotation
- \raw HTML
- <h1>Obsolete Members for MyClass</h1>
- \endraw
-
- \b {The following class members are obsolete.} They are
- provided to keep old source code working. We strongly advise
- against using them in new code.
-
- ...
-
- \list
- \li void MyObsoleteFunction() \c (obsolete)
- \li ...
- \endlist
-
- \raw HTML
- <hr />
- <h2>Member Function Documentation</h2>
- <h3>void MyObsoleteFunction ()</h3>
- <p>Use MyNewFunction() instead.</p>
- \endraw
- ...
- \endquotation
-
- \target internal-command
- \section1 \\internal
-
- The \\internal command indicates that the referenced
- function is not part of the public interface.
-
- The command must stand on its own line.
-
- QDoc ignores the documentation as well as the documented item,
- when generating the associated class reference documentation.
-
- \code
- / *!
- \internal
-
- Tries to find the decimal separator. If it can't find
- it and the thousand delimiter is != '.' it will try to
- find a '.';
- * /
- int QDoubleSpinBoxPrivate::findDelimiter
- (const QString &str, int index) const
- {
- int dotindex = str.indexOf(delimiter, index);
- if (dotindex == -1 && thousand != dot && delimiter != dot)
- dotindex = str.indexOf(dot, index);
- return dotindex;
- }
- \endcode
-
- This function will not be included in the documentation.
-
- \target preliminary-command
- \section1 \\preliminary
-
- The \\preliminary command is for indicating that a referenced
- function is still under development.
-
- The command must stand on its own line.
-
- The \\preliminary command expands to a notification in the
- function documentation, and marks the function as preliminary when
- it appears in lists.
-
- \code
- / *!
- \preliminary
-
- Returns information about the joining properties of the
- character (needed for certain languages such as
- Arabic).
- * /
- QChar::Joining QChar::joining() const
- {
- return ::joining(*this);
- }
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h3>
- <a href="http://doc.qt.io/qt-5/qchar.html#JoiningType-enum">Joining</a>
- QChar::joining () const</h3>
- \endraw
-
- \b {This function is under development and
- subject to change.}
-
- Returns information about the joining properties of the
- character (needed for certain languages such as
- Arabic).
- \endquotation
-
- And the function's entry in QChar's list of functions will be
- rendered as:
-
- \quotation
- \list
- \li ...
- \li Joining
- \l {Joining-enum}
- {joining}()
- const \c (preliminary)
- \li ...
- \endlist
- \endquotation
-
- \target since-command
- \section1 \\since
-
- The \\since command tells in which minor release
- the associated functionality was added.
-
- \code
- / *!
- \since 4.1
-
- Returns an icon for \a standardIcon.
-
- ...
-
- \sa standardPixmap()
- * /
- QIcon QStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
- {
- }
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h3>QIcon QStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const</h3>
- \endraw
-
- This function was introduced in Qt version 4.1
-
- Returns an icon for \a standardIcon.
-
- ...
-
- See also \l {QStyle::standardPixmap()} {standardPixmap()}.
- \endquotation
-
- QDoc generates the "Qt" reference from the \l
- {25-qdoc-configuration-derivedprojects.html#project} {\c project}
- configuration variable. For that reason this reference will change
- according to the current documentation project.
-
- See also \l {project}
- {\c project}.
-*/
-
-
-/*!
- \page 17-qdoc-commands-thread.html
- \previouspage Reporting Status
- \contentspage QDoc Manual
- \nextpage Relating Things
-
- \title Thread Support
-
- The thread support commands are for specifying the level of
- support for multithreaded programming in a class or function.
- There are three levels of support: \c threadsafe, \c reentrant and
- \c nonreentrant.
-
- The default is \c nonreentrant which means that the associated
- class or function cannot be called by multiple threads. \c
- Reentrant and \c threadsafe are levels primarily used for classes.
-
- \c Reentrant means that all the functions in the referenced class
- can be called simultaneously by multiple threads, provided that
- each invocation of the functions reference unique data. While \c
- threadsafe means that all the functions in the referenced class
- can be called simultaneously by multiple threads even when each
- invocation references shared data.
-
- When a class is marked \l {reentrant-command} {\\reentrant} or \l
- {threadsafe-command} {\\threadsafe}, functions in that class can
- be marked \c nonreentrant using the \l {nonreentrant-command}
- {\\nonreentrant} command.
-
- \section1 Example
-
- \target reentrant-example
- \code
- \beginqdoc
- \class QLocale
- \brief The QLocale class converts between numbers and their
- string representations in various languages.
-
- \reentrant
- \ingroup i18n
- \ingroup text
-
- QLocale is initialized with a language/country pair in its
- constructor and offers number-to-string and string-to-number
- conversion functions similar to those in QString.
-
- ...
-
- \nonreentrant
-
- Sets the global default locale to \a locale. These values are
- used when a QLocale object is constructed with no
- arguments. If this function is not called, the system's locale
- is used.
-
- \warning In a multithreaded application, the default locale
- should be set at application startup, before any non-GUI
- threads are created.
-
- \sa system(), c()
- \endqdoc
- void QLocale::setDefault(const QLocale &locale)
- {
- default_d = locale.d;
- }
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h1><center>QLocale Class Reference</center></h1>
- \endraw
-
- The QLocale class converts between numbers and their string
- representations in various languages. More...
-
- \code
- #include <QLocale>
- \endcode
-
- \b {Note:} All the functions in this class are \l
- {17-qdoc-commands-thread.html#reentrant} {reentrant}, except \l
- {QLocale::setDefault()} {setDefault()}.
-
- ...
-
- \raw HTML
- <hr />
- <h2>Member Type Documentation</h2>
- \endraw
-
- ...
-
- \raw HTML
- <h3>void QLocale::setDefault ( const QLocale & locale ) </h3>
- \endraw
-
- Sets the global default locale to locale. These values are
- used when a QLocale object is constructed with no
- arguments. If this function is not called, the system's locale
- is used.
-
- \warning In a multithreaded application, the default locale
- should be set at application startup, before any non-GUI
- threads are created.
-
- \warning This function is not reentrant.
-
- See also \l {QLocale::system()} {system()} and \l
- {QLocale::c()} {c()}.
-
- ...
- \endquotation
-
- As shown above, QDoc generates a notification when a class is
- declared reentrant, and lists the exceptions (the declared
- nonreentrant functions). A link to the general documentation on \l
- {17-qdoc-commands-thread.html#reentrant} {reentrancy and thread-safety} is
- included. In addition a warning, "\b Warning: This function is
- not reentrant.", is generated in the nonreentrant functions'
- documentation.
-
- QDoc will generate the same notification and warnings when a class
- is declared threadsafe.
-
- For more information see the general documentation on \l
- {17-qdoc-commands-thread.html#reentrant} {reentrancy and thread-safety}.
-
- \section1 Commands
-
- \target threadsafe-command
- \section2 \\threadsafe
-
- The \\threadsafe command includes a line in the documentation to
- indicate that the associated class or function is \e threadsafe
- and can be called simultaneously by multiple threads, even when
- separate invocations reference shared data.
-
- The command must stand on its own line.
-
- The documentation generated from this command will be similar to
- the what is generated for the \l {reentrant-command} {\\reentrant}
- command. See the example above in the \l {reentrant-example}
- {introduction}.
-
- See also \l{reentrant-command} {\\reentrant} and
- \l{nonreentrant-command} {\\nonreentrant}.
-
- \target reentrant-command
- \section2 \\reentrant
-
- The \\reentrant command indicates that the associated class or
- function can be called simultaneously by multiple threads,
- provided that each invocation references its own data. See the \l
- {reentrant-example} {example} above.
-
- The command must stand on its own line.
-
- See also \l{nonreentrant-command} {\\nonreentrant} and
- \l{threadsafe-command} {\\threadsafe}.
-
- \target nonreentrant-command
- \section2 \\nonreentrant
-
- The \\nonreentrant command indicates that the associated class or
- function cannot be called by multiple threads. Nonreentrant is the
- default case.
-
- The command must stand on its own line.
-
- When a class is marked \l {reentrant-command} {\\reentrant} or \l
- {threadsafe-command} {\\threadsafe}, functions in that class can
- be marked \c nonreentrant using this command in the \l{fn-command}
- {\\fn} comment of the functions to be excluded.
-
- See also \l{reentrant-command} {\\reentrant} and
- \l{threadsafe-command} {\\threadsafe}.
-*/
-
- / *!
-
-/*!
- \page 18-qdoc-commands-relating.html
- \previouspage Thread Support
- \contentspage QDoc Manual
- \nextpage Grouping Things
-
- \title Relating Things
-
- The relating commands are for specifying how one documented
- element relates to another documented element. Some examples:
- \list
- \li This function is an overload of another function.
- \li This function is a reimplementation of another function.
- \li This typedef is \e related to some class or header file.
- \endlist
-
- There is also a command for documenting that a QML type inherits
- some other QML type.
-
- \section1 Commands
-
- \target inherits-command
- \section2 \\inherits
-
- The \\inherits command is for documenting that one QML type
- inherits some other QML type. It must be included in the
- inheriting element's \l{qmltype-command}{\\qmltype} comment.
- The argument is the name of the inherited QML type.
-
- \code
- / *!
- \qmltype PauseAnimation
- \instantiates QDeclarativePauseAnimation
- \ingroup qml-animation-transition
- \since 4.7
- \inherits Animation
- \brief The PauseAnimation element provides a pause for an animation.
-
- When used in a SequentialAnimation, PauseAnimation is a step
- when nothing happens, for a specified duration.
-
- A 500ms animation sequence, with a 100ms pause between two animations:
-
- SequentialAnimation {
- NumberAnimation { ... duration: 200 }
- PauseAnimation { duration: 100 }
- NumberAnimation { ... duration: 200 }
- }
-
- \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
- * /
- \endcode
-
- QDoc includes this line on the reference page for the
- \l{http://qt-project.org/doc/qt-4.7/qml-pauseanimation.html} {PauseAnimation}
- element:
-
- \quotation
- Inherits \l{http://qt-project.org/doc/qt-4.7/qml-animation.html} {Animation}
- \endquotation
-
- \target overload-command
- \section2 \\overload
-
- The \\overload command is for indicating that a function is a
- secondary overload of its name.
-
- The command must stand on its own line.
-
- For a function name that is overloaded (except constructors), QDoc
- expects one primary version of the function, and all the others
- marked with the \b {\\overload command}. The primary version
- should be fully documented. Each overload can have whatever extra
- documentation you want to add for just that overloaded version.
-
- From Qt 4.5, you can include the function name plus '()' as a
- parameter to the \b{\\overload} command, which will include a
- standard \e{This function overloads...} line of text with a link
- to the documentation for the primary version of the function.
-
- \code
- / *!
- \overload addAction()
-
- This convenience function creates a new action with an
- \a icon and some \a text. The function adds the newly
- created action to the menu's list of actions, and
- returns it.
-
- \sa QWidget::addAction()
- * /
- QAction *QMenu::addAction(const QIcon &icon, const QString &text)
- {
- QAction *ret = new QAction(icon, text, this);
- addAction(ret);
- return ret;
- }
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h3><a href="http://doc.qt.io/qt-5/qaction.html">QAction</a>
- * QMenu::addAction ( const QIcon & <i>icon</i>,
- const QString & <i>text</i> )
- </h3>
- \endraw
-
- This function overloads \l {addAction} {addAction()}
-
- This convenience function creates a new action with an
- \e icon and some \e text. The function adds the newly
- created action to the menu's list of actions, and
- returns it.
-
- See also
- \l {addAction}
- {QWidget::addAction}().
- \endquotation
-
- If you don't include the function name with the \b{\\overload}
- command, then instead of the "This function overloads..." line
- with the link to the documentation for the primary version, you
- get the old standard line:
-
- \quotation
- This is an overloaded member function, provided for
- convenience.
- \endquotation.
-
- \target reimp-command
- \section2 \\reimp
-
- The \\reimp command is for indicating that a function is a
- reimplementation of a virtual function.
-
- The command must stand on its own line.
-
- QDoc will omit the reimplemented function from the class
- reference.
-
- \code
- / *!
- \reimp
- * /
- void QToolButton::nextCheckState()
- {
- Q_D(QToolButton);
- if (!d->defaultAction)
- QAbstractButton::nextCheckState();
- else
- d->defaultAction->trigger();
- }
- \endcode
-
- This function will not be included in the documentation. Instead,
- a link to the base function QAbstractButton::nextCheckState() will
- appear in the documentation.
-
- \target relates-command
- \section2 \\relates
-
- The \\relates command is for including the documentation of a
- global element to some class or header file. The argument is a
- class name or header file.
-
- \code
- / *!
- \relates QChar
-
- Reads a char from the stream \a in into char \a chr.
-
- \sa {Format of the QDataStream operators}
- * /
- QDataStream &operator>>(QDataStream &in, QChar &chr)
- {
- quint16 u;
- in >> u;
- chr.unicode() = ushort(u);
- return in;
- }
- \endcode
-
- The documentation for this function will be included on the reference page
- for class QChar.
-*/
-
-/*!
- \page 19-qdoc-commands-grouping.html
- \previouspage Relating Things
- \contentspage QDoc Manual
- \nextpage Naming Things
-
- \title Grouping Things
-
- The grouping commands relate classes to defined groups and
- modules. The groups are used when generating lists of related
- classes in the documentation, while the modules are elements of
- Qt's structure.
-
- \section1 Commands
-
- \target ingroup-command
- \section2 \\ingroup
-
- The \\ingroup command indicates that the given
- overview or documented class belongs to a certain group of
- related docmentation.
-
- A class or overview may belong to many groups.
-
- The \\ingroup command's argument is a group name, but note
- that the command considers the rest of the line as part of
- its argument. Make sure that the group name is followed by
- a linebreak.
-
- \code
- / *!
- \class QDir
- \brief The QDir class provides access to directory
- structures and their contents.
-
- \ingroup io
- ...
- * /
- \endcode
-
- This will include the QDir class in the \c io group, which means,
- for example, that QDir will appear on the list created by calling
- the \l {group-command} {\\group} command with the \c io argument.
-
- To list overviews that are related to a certain group, you must
- generate the list explicitly using the \l {generatelist-command}
- {\\generatelist} command with the \c related argument.
-
- See also \l {group-command} {\\group}.
-
- \target inmodule-command
- \section2 \\inmodule
-
- The \\inmodule command relates a class to the module specified by
- the command's argument.
-
- For the basic classes in Qt, a class's module is determined by its
- location, namely its directory. However, for extensions like
- ActiveQt and Qt Designer, a class must be related to a module
- explicitly.
-
- The command's argument is a module name, but note that the command
- considers the rest of the line as part of its argument. Make sure
- that the module name is followed by a linebreak.
-
- \code
- /*!
- \class QDesignerTaskMenuExtension
- \inmodule QtDesigner
- * /
- \endcode
-
- This ensures that the QDesignerTaskMenuExtension class is included
- in the Qt Designer module, which means, for example, that the
- class will appear on the list created by calling the \l
- {generatelist-command} {\\generatelist} command with the \c
- {{classesbymodule QtDesigner}} argument.
-
- See also \l {module-command} {\\module} and \l
- {generatelist-command} {\\generatelist}.
-*/
-
-/*!
- \page 20-qdoc-commands-namingthings.html
- \previouspage Grouping Things
- \contentspage QDoc Manual
- \nextpage Markup Commands
-
- \title Naming Things
-
- In general, a title command considers everything that follows it
- until the first line break as its argument. If the title is so
- long it must span multiple lines, end each line (except the last
- one) with a backslash.
-
- \section1 Commands
-
- \target title-command
- \section2 \\title
-
- The \\title command sets the title for a documentation page, or
- allows you to override it.
-
- \code
- / *!
- \page signalandslots.html
-
- \title Signals & Slots
-
- Signals and slots are used for communication between
- objects. The signals and slots mechanism is a central
- feature of Qt, and probably the part that differs most
- from the features provided by other frameworks.
-
- ...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h1><center>Signal and Slots</center></h1>
- \endraw
-
- Signals and slots are used for communication between
- objects. The signals and slots mechanism is a central
- feature of Qt and probably the part that differs most
- from the features provided by other frameworks.
- ...
- \endquotation
- See also \l {subtitle-command} {\\subtitle}.
-
- \target subtitle-command
- \section2 \\subtitle
-
- The \\subtitle command sets a subtitle for a documentation page.
-
- \code
- \beginqdoc
- \page qtopiacore-overview.html
-
- \title Qtopia Core
- \subtitle Qt for Embedded Linux
-
- Qt/Embedded, the embedded Linux port of Qt, is a
- complete and self-contained C++ GUI and platform
- development tool for Linux-based embedded development.
- ...
- \endqdoc
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h1><center>Qtopia Core</center></h1>
- <h2><center>Qt for Embedded Linux</center></h2>
- \endraw
-
- Qt/Embedded, the embedded Linux port of Qt, is a
- complete and self-contained C++ GUI and platform
- development tool for Linux-based embedded development.
- ...
- \endquotation
-
- See also \l {title-command} {\\title}.
-
-*/
diff --git a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
deleted file mode 100644
index 84f9416843..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
+++ /dev/null
@@ -1,325 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 01-qdoc-manual.html
- \contentspage QDoc Manual
- \previouspage QDoc Manual
- \nextpage Command Index
-
- \title Introduction to QDoc
-
- QDoc is a tool used by Qt Developers to generate documentation for
- software projects. It works by extracting \e {QDoc comments} from
- project source files and then formatting these comments as HTML
- pages or DITA XML documents. QDoc finds QDoc comments in \c
- {.cpp} files and in \c {.qdoc} files. QDoc does not look for QDoc
- comments in \c {.h} files. A QDoc comment always begins with an
- exclamation mark (\b{!})). For example:
-
- \code
- / *!
- \class QObject
- \brief The QObject class is the base class of all Qt objects.
-
- \ingroup objectmodel
-
- \reentrant
-
- QObject is the heart of the Qt \l{Object Model}. The
- central feature in this model is a very powerful mechanism
- for seamless object communication called \l{signals and
- slots}. You can connect a signal to a slot with connect()
- and destroy the connection with disconnect(). To avoid
- never ending notification loops you can temporarily block
- signals with blockSignals(). The protected functions
- connectNotify() and disconnectNotify() make it possible to
- track connections.
-
- QObjects organize themselves in \l {Object Trees &
- Ownership} {object trees}. When you create a QObject with
- another object as parent, the object will automatically
- add itself to the parent's \c children() list. The parent
- takes ownership of the object. It will automatically
- delete its children in its destructor. You can look for an
- object by name and optionally type using findChild() or
- findChildren().
-
- Every object has an objectName() and its class name can be
- found via the corresponding metaObject() (see
- QMetaObject::className()). You can determine whether the
- object's class inherits another class in the QObject
- inheritance hierarchy by using the \c inherits() function.
-
- ....
- * /
- \endcode
-
- From the QDoc comment above, QDoc generates the HTML \l {QObject}
- {QObject class reference} page.
-
- This manual explains how to use the QDoc commands in QDoc comments
- to embed good documentation in your source files. It also explains
- how to make a \l {The QDoc Configuration File} {QDoc configuration
- file}, which you will pass to QDoc on the command line.
-
- \section1 Running QDoc
-
- The name of the QDoc program is \c {qdoc}. To run qdoc from the
- command line, give it the name of a configuration file:
-
- \quotation
- \c {$ ../../bin/qdoc ./config.qdocconf}
- \endquotation
-
- QDoc recognizes the \c {.qdocconf} suffix as a \l{The QDoc
- Configuration File} {QDoc configuration file}. The configuration
- file is where you tell QDoc where to find the project source
- files, header files, and \c {.qdoc} files. It is also where you
- tell QDoc what kind of output to generate (HTML, DITA XML,...),
- and where to put the generated documentation. The configuration
- file also contains other information for QDoc.
-
- See \l{The QDoc Configuration File} for instructions on how to
- set up a QDoc configuration file.
-
- \section2 Running QDoc in Single Execution Mode
-
- Beginning with Qt 5.5, a new way to run QDoc is available that
- reduces the time it takes to generate the Qt5 documentation by as
- much as 90%. The new way to run QDoc is \e{single execution} mode.
- Single execution mode is not currently available in the Qt5 build
- system, which still uses the \e {standard} mode. Single execution
- mode is only available when you run QDoc yourself, which you will
- want to do often as you document your module and integrate your
- documentation with the other Qt modules.
-
- To run QDoc in single execution mode, add \c {-single-exec} to the
- command line and pass QDoc a master \c qdocconf file that is
- simply a list of file paths for qdocconf files of all the Qt5
- modules. For example:
-
- \code
- /Users/me/qt5/qtbase/bin/qdoc -outputdir /Users/me/qt5/qtbase/doc -installdir /Users/me/qt5/qtbase/doc /Users/me/qt5/master.qdocconf -single-exec
- \endcode
-
- The qdocconf file, \c {master.qdocconf}, just lists the qdocconf files for all the Qt5 modules to be processed:
-
- \badcode
- /Users/me/qt5/qtbase/src/corelib/doc/qtcore.qdocconf
- /Users/me/qt5/qtbase/src/network/doc/qtnetwork.qdocconf
- /Users/me/qt5/qtbase/src/sql/doc/qtsql.qdocconf
- /Users/me/qt5/qtbase/src/xml/doc/qtxml.qdocconf
- /Users/me/qt5/qtbase/src/testlib/doc/qttestlib.qdocconf
- /Users/me/qt5/qtbase/src/concurrent/doc/qtconcurrent.qdocconf
- /Users/me/qt5/qtbase/src/gui/doc/qtgui.qdocconf
- /Users/me/qt5/qtbase/src/platformheaders/doc/qtplatformheaders.qdocconf
- /Users/me/qt5/qtbase/src/widgets/doc/qtwidgets.qdocconf
- /Users/me/qt5/qtbase/src/opengl/doc/qtopengl.qdocconf
- /Users/me/qt5/qtbase/src/printsupport/doc/qtprintsupport.qdocconf
- /Users/me/qt5/qtbase/src/tools/qdoc/doc/config/qdoc.qdocconf
- /Users/me/qt5/qtbase/qmake/doc/qmake.qdocconf
- /Users/me/qt5/qtsvg/src/svg/doc/qtsvg.qdocconf
- /Users/me/qt5/qtxmlpatterns/src/xmlpatterns/doc/qtxmlpatterns.qdocconf
- /Users/me/qt5/qtdeclarative/src/qml/doc/qtqml.qdocconf
- /Users/me/qt5/qtdeclarative/src/quick/doc/qtquick.qdocconf
- /Users/me/qt5/qtquickcontrols/src/controls/doc/qtquickcontrols.qdocconf
- /Users/me/qt5/qtquickcontrols/src/layouts/doc/qtquicklayouts.qdocconf
- /Users/me/qt5/qtquickcontrols/src/dialogs/doc/qtquickdialogs.qdocconf
- /Users/me/qt5/qtmultimedia/src/multimedia/doc/qtmultimedia.qdocconf
- /Users/me/qt5/qtmultimedia/src/multimediawidgets/doc/qtmultimediawidgets.qdocconf
- /Users/me/qt5/qtactiveqt/src/activeqt/doc/activeqt.qdocconf
- /Users/me/qt5/qtsensors/src/sensors/doc/qtsensors.qdocconf
- /Users/me/qt5/qtwebkit/Source/qtwebkit.qdocconf
- /Users/me/qt5/qttools/src/assistant/help/doc/qthelp.qdocconf
- /Users/me/qt5/qttools/src/assistant/assistant/doc/qtassistant.qdocconf
- /Users/me/qt5/qttools/src/designer/src/uitools/doc/qtuitools.qdocconf
- /Users/me/qt5/qttools/src/designer/src/designer/doc/qtdesigner.qdocconf
- /Users/me/qt5/qttools/src/linguist/linguist/doc/qtlinguist.qdocconf
- /Users/me/qt5/qtwebkit-examples/doc/qtwebkitexamples.qdocconf
- /Users/me/qt5/qtimageformats/src/imageformats/doc/qtimageformats.qdocconf
- /Users/me/qt5/qtgraphicaleffects/src/effects/doc/qtgraphicaleffects.qdocconf
- /Users/me/qt5/qtscript/src/script/doc/qtscript.qdocconf
- /Users/me/qt5/qtscript/src/scripttools/doc/qtscripttools.qdocconf
- /Users/me/qt5/qtserialport/src/serialport/doc/qtserialport.qdocconf
- /Users/me/qt5/qtdoc/doc/config/qtdoc.qdocconf
- \endcode
-
- \section3 Why Standard Mode Is Slow
-
- Currently, the Qt5 build system does not use QDoc's \e {single
- execution} mode for generating the Qt5 documentation. It runs QDoc
- in the \e {standard} mode. The standard mode was came about
- because it was the easiest way to get convert the Qt4 QDoc to
- handle the modularization of Qt in Qt5. In Qt4, QDoc ran once over
- all the Qt4 sources to generate the HTML documentation for Qt.
- While generating the Qt documentation, Qt4 QDoc also generated an
- \e {index file} for Qt. That index file was meant to be used as
- input to subsequent QDoc runs for generating HTML documentation
- for other software libraries/products that were based on Qt. The
- Qt index file allowed QDoc to link documentation written for those
- other libraries/products to the Qt4 documentation.
-
- When Qt5 came along, Qt was divided into modules. Since then,
- many new modules have been added to Qt. As of version 5.5, there
- are over 40 separate modules in Qt5, each with its own
- documentation that links to (depends on) the documentation of
- other Qt modules.
-
- In \e {standard mode}, QDoc runs twice for each module. The first
- QDoc run for a particular Qt module, parses all the module's
- source files and then uses the information to generate the
- module's index file. It is called the \e{prepare phase} because
- it \e prepares the module's index file. The second QDoc run for
- the module also parses all the module's source files and then
- generates the module's documentation pages. This is called the \e
- {generate phase} because it generates the module's documentation.
-
- The module's documentation will likely contain HTML links to the
- documentation of one or more of the other Qt modules. For example,
- most Qt5 modules contain links to documentation in QtCore. When a
- Qt module contains links into the documentation of other Qt
- module's, that module is said to depend on those other Qt modules.
- Hence when QDoc runs the \e {generate phase} for that module, it
- must also load the index files for those modules so it can create
- those thinks.
-
- Hence, when the Qt build system generates the Qt documentation, it
- first runs QDoc once for each module to perform the \e {prepare
- phase} to generate all the index files. Then it runs QDoc once for
- each module to perform the \e {generate phase}, where it uses the
- dependent index files to generate the module's documentation,
- including any cross-module links it finds. Each execution of
- QDoc, both \e {prepare phase} and \e {generate phase}, parses
- all the source files that are included in the module, and in the
- \e {generate phase} also parses the index files for the dependent
- modules. Nothing is retained or retainable between QDoc runs.
-
- \section3 Why Single Execution Mode Is Much Faster
-
- As the name implies, single execution mode uses a single QDoc
- process to generate all the Qt5 documentation. The single QDoc
- process still performs a \e{prepare phase} for each module and
- then a \e{generate phase} for each module, but there are a few
- differences. It begins by reading the master qdocconf file. Then
- it reads each qdocconf file in the master list and performs the
- \e{prepare phase} for each module. During the \e{prepare phase},
- all the source files for the module are parsed to build a syntax
- tree for the module. The module's index file is then generated,
- although QDoc will not re-read the index files in the \e{generate
- phase}. The important difference here is that the module's syntax
- tree is retained after the index file is generated, so that after
- the \e{prepare phase} has been run for all the modules, QDoc still
- has all the syntax trees it built.
-
- QDoc then processes each module again for the \e{generate phase}.
- But now QDoc doesn't need to re-parse each module's source files,
- because the module's syntax tree is still in memory. Nor does QDoc
- need to re-read the index files for the dependent modules, again
- because it still has the syntax trees for those modules in memry.
- It remains only to traverse each module's syntax tree to generate
- the documentation pages.
-
- Hence, QDoc parses each source file once and only once and doesn't
- need to read index files. This is what makes single execution mode
- much faster than the standard mode. It is anticipated that the Qt
- build system will eventually run QDoc in single execution mode.
- However, changes to the master qdocconf file might be required, so
- the method described above for running QDoc in single execution
- mode might have to change, watch this space for updates.
-
- \section1 How QDoc Works
-
- QDoc begins by reading the configuration file you specified on the
- command line. It stores all the variables from the configuration
- file for later use. One of the first variables it uses is \c
- {outputformats}. This variable tells QDoc which output generators
- it will run. The default value is \e {HTML}, so if you don't set
- \c {outputformats} in your configuration file, QDoc will generate
- HTML output. That's usually what you will want anyway, but you can
- also specify \e {DITAXML} to get DITA XML output instead.
-
- Next, QDoc uses the values of the
- \l {headerdirs-variable}
- {headerdirs} variable and/or the \l
- {22-qdoc-configuration-generalvariables.html#headers-variable}
- {headers} variable to find and parse all the header files for your
- project. QDoc does \e not scan header files for QDoc comments. It
- parses the header files to build a master tree of all the items
- that should be documented, in other words, the items that QDoc should find
- QDoc comments for.
-
- After parsing all the header files and building the master tree of
- items to be documented, QDoc uses the value of the \l
- {22-qdoc-configuration-generalvariables.html#sourcedirs-variable}
- {sourcedirs} variable and/or the value of the \l
- {22-qdoc-configuration-generalvariables.html#sources-variable}
- {sources} variable to find and parse all the \c {.cpp} and \c
- {.qdoc} files for your project. These are the files QDoc scans for
- \e {QDoc comments}. Remember that a QDoc comment begins with
- an exclamation mark: \b {/*!} .
-
- For each QDoc comment it finds, it searches the master tree for
- the item where the documentation belongs. Then it interprets the
- qdoc commands in the comment and stores the interpreted commands
- and the comment text in the tree node for the item.
-
- Finally, QDoc traverses the master tree. For each node, if the
- node has stored documentation, QDoc calls the output generator
- specified by the \c {outputformats} variable to format and write
- the documentation in the directory specified in the configuration
- file in the \l
- {22-qdoc-configuration-generalvariables.html#outputdir-variable}
- {outputdir} variable.
-
- \section1 Command Types
-
- QDoc interprets three types of commands:
-
- \list
- \li \l {Topic Commands}
- \li \l {Context Commands}
- \li \l {Markup Commands}
- \endlist
-
- Topic commands identify the element you are documenting, for example
- a C++ class, function, type, or an extra page of text
- that doesn't map to an underlying C++ element.
-
- Context commands tell QDoc how the element being documented
- relates to other documented elements, for example, next and previous page
- links, inclusion in page groups, or library modules. Context
- commands can also provide information about the documented element
- that QDoc can't get from the source files, for example, whether the
- element is thread-safe, whether it is an overloaded or reimplemented function,
- or whether it has been deprecated.
-
- Markup commands tell QDoc how text and image elements in the
- document should be rendered, or about the document's outline
- structure.
-*/
-
diff --git a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
deleted file mode 100644
index d764cde89d..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc
+++ /dev/null
@@ -1,4050 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 03-qdoc-commands-markup.html
- \contentspage QDoc Manual
- \previouspage Naming Things
- \nextpage Text Markup
-
- \title Markup Commands
-
- The markup commands indicate the generated documentation's visual
- appearance and logical structure.
-
- \list
- \li \l {a-command} {\\a}
- \li \l {abstract-command} {\\abstract}
- \li \l {annotatedlist-command} {\\annotatedlist}
- \li \l {b-command} {\\b} \span {class="newStuff"}
- \li \l {b-command} {\\bold} {(deprecated, use \\b)}
- \li \l {brief-command} {\\brief}
- \li \l {c-command} {\\c}
- \li \l {caption-command} {\\caption}
- \li \l {chapter-command} {\\chapter}
- \li \l {code-command} {\\code}
- \li \l {codeline-command} {\\codeline}
- \li \l {div-command} {\\div}
- \li \l {dots-command} {\\dots}
- \li \l {e-command} {\\e} \span {class="newStuff"}
- \li \l {else-command} {\\else}
- \li \l {endif-command} {\\endif}
- \li \l {footnote-command} {\\footnote}
- \li \l {generatelist-command} {\\generatelist}
- \li \l {header-command} {\\header}
- \li \l {e-command} {\\i} \span {class="newStuff"} {(deprecated, use \\e)}
- \li \l {if-command} {\\if}
- \li \l {image-command} {\\image}
- \li \l {include-command} {\\include}
- \li \l {include-command} {\\input}
- \li \l {inlineimage-command} {\\inlineimage}
- \li \l {keyword-command} {\\keyword}
- \li \l {l-command} {\\l}
- \li \l {legalese-command} {\\legalese}
- \li \l {li-command} {\\li} \span {class="newStuff"}
- \li \l {list-command} {\\list}
- \li \l {meta-command} {\\meta}
- \li \l {newcode-command} {\\newcode}
- \li \l {li-command} {\\o} \span {class="newStuff"} {(deprecated, use \\li)}
- \li \l {note-command} {\\note}
- \li \l {oldcode-command} {\\oldcode}
- \li \l {omit-command} {\\omit}
- \li \l {part-command} {\\part}
- \li \l {printline-command} {\\printline}
- \li \l {printto-command} {\\printto}
- \li \l {printuntil-command} {\\printuntil}
- \li \l {quotation-command} {\\quotation}
- \li \l {quotefile-command} {\\quotefile}
- \li \l {quotefromfile-command} {\\quotefromfile}
- \li \l {raw-command} {\\raw}
- \li \l {row-command} {\\row}
- \li \l {sa-command} {\\sa}
- \li \l {sectionOne-command} {\\section1}
- \li \l {sectionTwo-command} {\\section2}
- \li \l {sectionThree-command} {\\section3}
- \li \l {sectionFour-command} {\\section4}
- \li \l {skipline-command} {\\skipline}
- \li \l {skipto-command} {\\skipto}
- \li \l {skipuntil-command} {\\skipuntil}
- \li \l {snippet-command} {\\snippet}
- \li \l {span-command} {\\span}
- \li \l {sub-command} {\\sub}
- \li \l {sup-command} {\\sup}
- \li \l {table-command} {\\table}
- \li \l {tableofcontents-command} {\\tableofcontents}
- \li \l {target-command} {\\target}
- \li \l {tt-command} {\\tt}
- \li \l {uicontrol-command} {\\uicontrol} {(new 25/3/2012)}
- \li \l {underline-command} {\\underline}
- \li \l {raw-command} {\\unicode}
- \li \l {warning-command} {\\warning}
- \li \l {backslash-command} {\\\\}
- \endlist
-*/
-
-
-/*!
- \page 04-qdoc-commands-textmarkup.html
- \contentspage QDoc Manual
- \previouspage Markup Commands
- \nextpage Document Structure
-
- \title Text Markup
-
- The text formatting commands indicate how text is to be rendered.
-
- \target a-command
- \section1 \\a (parameter marker)
-
- The \\a command tells QDoc the next word is a formal parameter name.
-
- A warning is emitted when a formal parameter is not documented or
- is misspelled, so when you document a function you should mention
- each formal parameter by name in the function description,
- preceded by the \\a command. The parameter name is then rendered
- in italics.
-
- \code
- / *!
- Constructs a line edit containing the text
- \a contents. The \a parent parameter is sent
- to the QWidget constructor.
- * /
-
- QLineEdit::QLineEdit(const QString &contents, QWidget *parent) :QWidget(parent)
- {
- ...
- }
-
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \b {QLineEdit::QLineEdit ( const QString &
- contents, QWidget *parent )}
-
- Constructs a line edit containing the text \a contents.
- The \a parent parameter is sent to the QWidget constructor.
- \endquotation
-
- The formal parameter name may be enclosed between curly brackets,
- but that isn't required.
-
- \target c-command
- \section1 \\c (code font)
-
- The \\c command is used for rendering variable names, user-defined
- class names, and C++ keywords (for example, \c int and \c for) in the code
- font.
-
- The command renders its argument using a monospace font. For
- example:
-
- \code
- / *!
- The \c AnalogClock class provides a clock widget with hour
- and minute hands that is automatically updated every
- few seconds.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The \c AnalogClock class provides a clock widget with hour
- and minute hands, which are automatically updated every
- few seconds.
- \endquotation
-
- If the text to be rendered in the code font contains spaces, enclose the
- entire text in curly brackets.
-
- \code
- \c {QLineEdit::QLineEdit(const QString &contents, QWidget *parent) :QWidget(parent)}
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \c {QLineEdit::QLineEdit(const QString &contents, QWidget *parent) :QWidget(parent)}
- \endquotation
-
- The \\c command accepts the special character \c \ within its
- argument, which renders it as a normal character. So if you want
- to use nested commands, you must use the \l {tt-command} {teletype
- (\\tt)} command instead.
-
- See also \l {tt-command} {\\tt} and \l {code-command} {\\code}.
-
- \target div-command
- \section1 \\div
-
- The \\div and \\enddiv commands delimit a large or small block of
- text (which may include other QDoc commands) to which special
- formatting attributes should be applied.
-
- An argument must be provided in curly braces, as in the qdoc
- comment shown below. The argument is not interpreted but is used
- as attribute(s) of the tag that is output by qdoc.
-
- For example, we might want to render an inline image so that it
- floats to the right of the current block of text:
-
- \code
- / *!
- \div {class="float-right"}
- \inlineimage qml-column.png
- \enddiv
-
- * /
- \endcode
-
- If qdoc is generating HTML, it will translate these commands to:
-
- \code
- <div class="float-right"><p><img src="images/qml-column.png" /></p></div>
- \endcode
-
- For HTML, the attribute value \e {float-right} then will refer to
- a clause in the style.css file, which in this case could be:
-
- \code
- div.float-right
- {
- float: right; margin-left: 2em
- }
- \endcode
-
- If qdoc is generating DITA XML, it will translate the commands to:
-
- \code
- <sectiondiv outputclass="float-right">
- <p>
- <fig>
- <image href="images/qml-column.png" placement="inline"/>
- </fig>
- </p>
- </sectiondiv>
- \endcode
-
- Your DITA XML publishing program must then recognize the \e
- {outputclass} attribute value.
-
- \note Note that the \b {\\div} command can be nested.
-
- Below you can find an example taken from the index.qdoc file used to
- generate index.html for Qt 4.7:
-
- \code
- \div {class="indexbox guide"}
- \div {class="heading"}
- Qt Developer Guide
- \enddiv
- \div {class="indexboxcont indexboxbar"}
- \div {class="section indexIcon"} \emptyspan
- \enddiv
- \div {class="section"}
- Qt is a cross-platform application and UI
- framework. Using Qt, you can write web-enabled
- applications once and deploy them across desktop,
- mobile and embedded operating systems without
- rewriting the source code.
- \enddiv
- \div {class="section sectionlist"}
- \list
- \li \l{Getting Started}
- \li \l{Installation} {Installation}
- \li \l{how-to-learn-qt.html} {How to learn Qt}
- \li \l{tutorials.html} {Tutorials}
- \li \l{Qt Examples} {Examples}
- \li \l{qt4-7-intro.html} {What's new in Qt 4.7}
- \endlist
- \enddiv
- \enddiv
- \enddiv
- \endcode
-
- When all the class attribute values are defined as they are in the
- style.css file that is used for rendering the Qt documentation,
- the above example is rendered as:
-
- \div {class="indexbox guide"}
- \div {class="heading"}
- Qt Developer Guide
- \enddiv
- \div {class="indexboxcont indexboxbar"}
- \div {class="section indexIcon"} \emptyspan
- \enddiv
- \div {class="section"}
- Qt is a cross-platform application and UI
- framework. Using Qt, you can write web-enabled
- applications once and deploy them across desktop,
- mobile and embedded operating systems without
- rewriting the source code.
- \enddiv
- \div {class="section sectionlist"}
- \list
- \li Getting Started
- \li Installation
- \li How to learn Qt
- \li Tutorials
- \li Examples
- \li What's new in Qt 4.7
- \endlist
- \enddiv
- \enddiv
- \enddiv
-
- When generating DITA XML, qdoc outputs the nested \e {div} commands as:
-
- \code
- <sectiondiv outputclass="indexbox guide">
- <sectiondiv outputclass="heading">
- <p>Qt Developer Guide</p>
- </sectiondiv>
- <sectiondiv outputclass="indexboxcont indexboxbar">
- <sectiondiv outputclass="section indexIcon"/>
- <sectiondiv outputclass="section">
- <p>Qt is a cross-platform application and UI
- framework. Using Qt, you can write
- web-enabled applications once and deploy
- them across desktop, mobile and embedded
- operating systems without rewriting the
- source code.
- </p>
- </sectiondiv>
- <sectiondiv outputclass="section sectionlist">
- <ul>
- <li>
- <xref href="gettingstarted.xml#id-606ee7a8-219b-47b7-8f94-91bc8c76e54c">Getting started</xref>
- </li>
- <li>
- <xref href="installation.xml#id-075c20e2-aa1e-4f88-a316-a46517e50443">Installation</xref>
- </li>
- <li>
- <xref href="how-to-learn-qt.xml#id-49f509b5-52f9-4cd9-9921-74217b9a5182">How to learn Qt</xref>
- </li>
- <li>
- <xref href="tutorials.xml#id-a737f955-a904-455f-b4aa-0dc69ed5a64f">Tutorials</xref>
- </li>
- <li>
- <xref href="all-examples.xml#id-98d95159-d65b-4706-b08f-13d80080448d">Examples</xref>
- </li>
- <li>
- <xref href="qt4-7-intro.xml#id-519ae0e3-4242-4c2a-b2be-e05d1e95f177">What's new in Qt 4.7</xref>
- </li>
- </ul>
- </sectiondiv>
- </sectiondiv>
- </sectiondiv>
- \endcode
-
- Your DITA XML publishing program must recognize the values of the
- \e {outputclass} attribute.
-
- See also \l {span-command} {\\span}.
-
- \target span-command
- \section1 \\span
-
- The \\span command applies special formatting to a small block of text.
-
- Two arguments must be provided, each argument in curly braces, as
- shown in the QDoc comment below. The first argument is not
- interpreted, but specifies the formatting attribute(s) of the tag
- output by QDoc. The second argument is the text to be rendered with
- the special formatting attributes.
-
- For example, we might want to render the first word of each
- element in a numeric list in blue.
-
- \code
- / *!
- Global variables with complex types:
- \list 1
- \li \span {class="variableName"} {mutableComplex1} in globals.cpp at line 14
- \li \span {class="variableName"} {mutableComplex2} in globals.cpp at line 15
- \li \span {class="variableName"} {constComplex1} in globals.cpp at line 16
- \li \span {class="variableName"} {constComplex2} in globals.cpp at line 17
- \endlist
- * /
- \endcode
-
- Class \e {variableName} refers to a clause in your style.css.
-
- \code
- .variableName
- {
- font-family: courier;
- color: blue
- }
- \endcode
-
- Using the \e {variableName} clause shown above, the example is rendered as:
-
- Global variables with complex types:
- \list 1
- \li \span {class="variableName"} {mutableComplex1} in globals.cpp at line 14
- \li \span {class="variableName"} {mutableComplex2} in globals.cpp at line 15
- \li \span {class="variableName"} {constComplex1} in globals.cpp at line 16
- \li \span {class="variableName"} {constComplex2} in globals.cpp at line 17
- \endlist
-
- \note The \b span command does not cause a new paragraph to be
- started.
-
- See also \l {div-command} {\\div}.
-
- \target tt-command
- \section1 \\tt (teletype font)
-
- The \\tt command renders its argument in a monospace font. This
- command behaves just like the \l {c-command} {\\c} command, except
- that \\tt allows you to nest QDoc commands within the argument
- (e.g. \l {e-command} {\\e}, \l {b-command} {\\b} and \l
- {underline-command} {\\underline}).
-
- \code
- / *!
- After having populated the main container with
- child widgets, \c setupUi() scans the main container's list of
- slots for names with the form
- \tt{on_\e{objectName}_\e{signalName}().}
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- After having populated the main container with
- child widgets, \c setupUi() scans the main container's list of
- slots for names with the form
- \tt{on_\e{objectName}_\e{signalName}().}
- \endquotation
-
- If the text to be rendered in the code font contains spaces, enclose the
- entire text in curly brackets.
-
- \code
- \tt {QLineEdit::QLineEdit(const QString &contents, QWidget *parent) :QWidget(parent)}
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \tt {QLineEdit::QLineEdit(const QString &contents, QWidget *parent) :QWidget(parent)}
- \endquotation
-
- See also \l {c-command} {\\c}.
-
- \target b-command
- \section1 \\b
-
- The \\b command renders its argument in bold font. This command used
- to be called \\bold.
-
- \code
- / *!
- This is regular text; \b {this text is
- rendered using the \\b command}.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- This is regular text; \b {this text is rendered using
- the \\b command}.
- \endquotation
-
- \target e-command
- \section1 \\e (emphasis, italics) \span {class="newStuff"} {(new 5/3/2012)}
-
- The \\e command renders its argument in a special font, normally italics. This
- command used to be called \\i, which is now deprecated. Use \e for italics.
-
- If the argument contains spaces or other punctuation, enclose the
- argument in curly brackets.
-
- \code
- / *!
- Here, we render \e {a few words} in italics.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- Here, we render \e {a few words} in italics.
- \endquotation
-
- If you want to use other QDoc commands within an argument that
- contains spaces, you always need to enclose the argument in
- braces. But QDoc is smart enough to count parentheses [3], so you
- don't need braces in cases like this:
-
- \code
- / *!
- An argument can sometimes contain whitespaces,
- for example: \e QPushButton(tr("A Brand New Button"))
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- An argument can sometimes contain whitespaces,
- for example: \e QPushButton(tr("A Brand New Button"))
- \endquotation
-
- Finally, trailing punctuation is not included in an argument [4],
- nor is "'s" [5]
-
- \raw HTML
- <table align="center" cellpadding="2"
- cellspacing="1" border="0">
- <tr valign="top" bgcolor="#a2c511">
- <th></th>
- <th>QDoc Syntax</th>
- <th>Generated Documentation</th>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>1</td>
- <td>A variation of a command button is a \e menu
- button.</td>
- <td>A variation of a command button is a <i>menu</i>
- button.</td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>2</td>
- <td>The QPushButton widget provides a
- \e {command button}.</td>
- <td>The QPushButton widget provides a
- <i>command button</i>.</td>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>3</td>
- <td>Another class of buttons are option buttons
- \e (see QRadioButton).</td>
- <td>Another class of buttons are option buttons
- <i> (see QRadioButton)</i>.</td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>4</td>
- <td>A push button emits the signal \e clicked().</td>
- <td>A push button emits the signal <i>clicked</i>().</td>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>5</td>
- <td>The \e QPushButton's checked property is
- false by default.</td>
- <td>The <i>QPushButton</i>'s checked property is
- false by default.</td>
- </tr>
-
- </table>
- \endraw
-
- \target sub-command
- \section1 \\sub
-
- The \\sub command renders its argument lower than the baseline of
- the regular text, using a smaller font.
-
- \code
- / *!
- Definition (Range): Consider the sequence
- {x\sub n}\sub {n > 1} . The set
-
- {x\sub 2, x\sub 3, x\sub 4, ...} = {x\sub n ; n = 2, 3, 4, ...}
-
- is called the range of the sequence.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- Definition (Range): Consider the sequence
- {x\sub n}\sub {n > 1} . The set
-
- {x\sub 2, x\sub 3, x\sub 4, ...} = {x\sub n ; n = 2, 3, 4, ...}
-
- is called the range of the sequence.
- \endquotation
-
- If the argument contains spaces or other punctuation, enclose the
- argument in curly brackets.
-
- \target sup-command
- \section1 \\sup
-
- The \\sup command renders its argument higher than
- the baseline of the regular text, using a smaller font.
-
- \code
- / *!
- The series
-
- 1 + a + a\sup 2 + a\sup 3 + a\sup 4 + ...
-
- is called the \i {geometric series}.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The series
-
- 1 + a + a\sup 2 + a\sup 3 + a\sup 4 + ...
-
- is called the \e {geometric series}.
- \endquotation
-
- If the argument contains spaces or other punctuation, enclose the
- argument in curly brackets.
-
- \target uicontrol-command
- \section1 \\uicontrol
-
- The \\uicontrol command is used to mark content as being used for UI
- control elements. When using HTML, the output is rendered in bold.
- When using DITA XML the content is enclosed in a \c{uicontrol} tag.
-
- \sa \\b
-
- \target underline-command
- \section1 \\underline
-
- The \\underline command renders its argument underlined.
-
- \code
- / *!
- The \underline {F}ile menu gives the users the possibility
- to edit an existing file, or save a new or modified
- file, and exit the application.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The \underline {F}ile menu gives the users the possibility
- to edit an existing file, or save a new or modified
- file, and exit the application.
- \endquotation
-
- If the argument contains spaces or other punctuation, enclose the
- argument in curly brackets.
-
- \target backslash-command
- \section1 \\\\ (double backslash)
-
- The \\\\ command expands to a double backslash.
-
- QDoc commands always start with a single backslash. To display a
- single backslash in the text you need to type two backslashes. If
- you want to display two backslashes, you need to type four.
-
- \code
- / *!
- The \\\\ command is useful if you want a
- backslash to appear verbatim, for example,
- writing C:\\windows\\home\\.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The \\\\ command is useful if you want a
- backslash to appear verbatim, for example,
- writing C:\\windows\\home\\.
- \endquotation
-
- However, if you want your text to appear in a monospace font as
- well, you can use the \l {c-command} {\\c} command instead, which
- accepts and renders the backslash as any other character. For
- example:
-
- \code
- / *!
- The \\c command is useful if you want a
- backslash to appear verbatim, and the word
- that contains it written in a monospace font,
- like this: \c {C:\windows\home\}.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The \\c command is useful if you want a
- backslash to appear verbatim, and the word
- that contains it written in a monospace font,
- like this: \c {C:\windows\home\}.
- \endquotation
-
-*/
-
-
-/*!
- \page 05-qdoc-commands-documentstructure.html
- \previouspage Text Markup
- \contentspage QDoc Manual
- \nextpage Including Code Inline
-
- \title Document Structure
-
- The document structuring commands are for dividing your document
- into sections. QDoc supports six kinds of sections: \c \part, \c
- \chapter, \c \section1, \c \section2, \c \section3, and \c
- \section4. The \c \section1..4 commands are the most useful. They
- correspond to the traditional section, subsection, etc used in
- outlining.
-
- \target part-command
- \section1 \\part
-
- The \\part command is intended for use in a large document, like a
- book.
-
- In general a document structuring command considers everything
- that follows it until the first line break as its argument. The
- argument is rendered as the unit's title. If the title needs to be
- spanned over several lines, make sure that each line (except the
- last one) is ended with a backslash.
-
- In total, there are six levels of sections in QDoc: \c \part, \c
- \chapter, \c \section1, \c \section2, \c \section3 and \c
- \section4. \c \section1 to \c \section4 correspond to the
- traditional section, subsection, subsubsection and
- subsubsubsection.
-
- There is a strict ordering of the section units:
-
- \code
- part
- |
- chapter
- |
- section1
- |
- section2
- |
- section3
- |
- section4
- \endcode
-
- For example, a \c section1 unit can only appear as the top level
- section or inside a \c chapter unit. Skipping a section unit, for
- example from \c part to \c section1, is not allowed.
-
- You can \e begin with either of the three: \c part, \c chapter or
- \c section1.
-
-
- \code
- / *!
- \part Basic Qt
-
- This is the first part.
-
-
- \chapter Getting Started
-
- This is the first part's first chapter.
-
-
- \section1 Hello Qt
-
- This is the first chapter's first section.
-
-
- \section1 Making Connections
-
- This is the first chapter's second section.
-
-
- \section1 Using the Reference Documentation
-
- This is the first chapter's third section.
-
-
- \chapter Creating Dialogs
-
- This is the first part's second chapter.
-
-
- \section1 Subclassing QDialog
-
- This is the second chapter's first section.
-
- ...
-
-
- \part Intermediate Qt
-
- This is the second part.
-
-
- \chapter Layout Management
-
- This is the second part's first chapter.
-
-
- \section1 Basic Layouts
-
- This is the first chapter's first section.
-
- ...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <a name="Basic Qt">
- <h1>Basic Qt</h1>
- </a>
- <p>This is the first part.</p>
-
- <a name="Getting started">
- <h2>Getting Started</h2>
- </a>
- This is the first part's first chapter.</p>
-
- <a name="Hello Qt">
- <h3>Hello Qt</h3>
- </a>
- <p>This is the first chapter's first section.</p>
-
- <a name="Making Connections">
- <h3>Making Connections</h3>
- </a>
- <p>This is the first chapter's second section.</p>
-
- <a name="Using the Reference Documentation">
- <h3>Using the Reference Documentation</h3>
- </a>
- <p>This is the first chapter's third section.</p>
-
- <a name="Creating Dialogs">
- <h2>Creating Dialogs</h2>
- </a>
- <p>This is the first part's second chapter.</p>
-
- <a name="Subclassing QDialog">
- <h3>Subclassing QDialog</h3>
- </a>
- <p>This is the second chapter's first section.</p>
-
- ...
-
- <a name="Intermediate Qt">
- <h1>Intermediate Qt</h1>
- </a>
- <p>This is the second part.</p>
-
- <a name="Layout Management">
- <h2>Layout Management</h2>
- </a>
- <p>This is the second part's first chapter.</p>
-
- <a name="Basic Layouts">
- <h3>Basic Layouts</h3>
- </a>
- <p>This is the first chapter's first section.</p>
-
- ...
-
- \endraw
- \endquotation
-
- Each section is a logical unit in the document. The section
- heading appears in the automatically generated table of contents
- that normally appears in the upper right-hand corner of the page.
-
- \target chapter-command
- \section1 \\chapter
-
- The \\chapter command is intended for use in
- larger documents, and divides the document into chapters.
-
- See \l{part} {\\part} for an explanation of the various
- section units, command argument, and rendering.
-
- \target sectionOne-command
- \section1 \\section1
-
- The \\section1 command starts a new section.
-
- See \l{part} {\\part} for an explanation of the various
- section units, command argument, and rendering.
-
- \target sectionTwo-command
- \section1 \\section2
-
- The \\section2 command starts a new section.
-
- See \l{part} {\\part} for an explanation of the various
- section units, command argument, and rendering.
-
- \target sectionThree-command
- \section1 \\section3
-
- The \\section3 command starts a new section.
-
- See \l{part} {\\part} for an explanation of the various
- section units, command argument, and rendering.
-
- \target sectionFour-command
- \section1 \\section4
-
- The \\section4 command starts a new section.
-
- See \l{part} {\\part} for an explanation of the various
- section units, command argument, and rendering.
-
-*/
-
-
-/*!
- \page 06-qdoc-commands-includecodeinline.html
- \previouspage Document Structure
- \contentspage QDoc Manual
- \nextpage Including External Code
-
- \title Including Code Inline
-
- The following commands are used to render source code without
- formatting. The source code begins on a new line, rendered in the
- code.
-
- \b{Note:} Although all these commands are for rendering C++
- code, the
- \l{07-0-qdoc-commands-includingexternalcode.html#snippet-command}
- {\\snippet} and
- \l{07-0-qdoc-commands-includingexternalcode.html#codeline-command}
- {\\codeline} commands are preferred over the others. These
- commands allow equivalent code snippets for other Qt language
- bindings to be substituted for the C++ snippets in the
- documentation.
-
- \target code-command
- \section1 \\code
-
- The \\code and \\endcode commands enclose a snippet of source code.
-
- \note The \l {c-command} {\\c} command can be used for short code
- fragments within a sentence. The \\code command is for longer code
- snippets. It renders the code verbatim in a separate paragraph in
- the code font.
-
- When processing any of the \\code, \l {newcode-command} {\\newcode} or \l
- {oldcode-command} {\\oldcode} commands, QDoc removes all
- indentation that is common for the verbatim code blocks within a
- \c{/}\c{*!} ... \c{*}\c{/} comment before it adds the standard
- indentation. For that reason the recommended style is to use 8
- spaces for the verbatim code contained within these commands
-
- \note This doesn't apply to externally quoted code using the \l
- {quotefromfile-command} {\\quotefromfile} or \l
- {quotefile-command} {\\quotefile} command.
-
- \code
- / *!
- \code
- #include <QApplication>
- #include <QPushButton>
-
- int main(int argc, char *argv[])
- {
- ...
- }
- \ endcode
- * /
- \endcode
-
- QDoc renders this as:
-
- \code
- #include <QApplication>
- #include <QPushButton>
-
- int main(int argc, char *argv[])
- {
- ...
- }
- \endcode
-
- Other QDoc commands are disabled within \\code... \\endcode, and
- the special character '\\' is accepted and rendered like the rest
- of the code.
-
- To include code snippets from an external file, use the
- \l{07-0-qdoc-commands-includingexternalcode.html#snippet-command}
- {\\snippet} and
- \l{07-0-qdoc-commands-includingexternalcode.html#codeline-command}
- {\\codeline} commands.
-
- See also \l {c-command} {\\c}, \l
- {07-0-qdoc-commands-includingexternalcode.html#quotefromfile-command}
- {\\quotefromfile}, \l{newcode-command} {\\newcode}, and \l {oldcode-command}
- {\\oldcode}.
-
- \target newcode-command
- \section1 \\newcode
-
- The \\newcode, \\oldcode, and \\endcode commands enable you to
- show how to port a snippet of code to a new version of an API.
-
- The \\newcode command and its companion the \\oldcode command are
- a convenience combination of the \l {code-command} {\\code} commands:
- this combination provides a text relating the two code snippets to each
- other.
-
- The \\newcode command requires a preceding \\oldcode statement.
-
- Like the \l{code-command}{\\code} command, the \\newcode command renders its
- code on a new line in the documentation using a monospace font and the
- standard indentation.
-
- \code
- / *!
- \oldcode
- if (printer->setup(parent))
- ...
- \newcode
- QPrintDialog dialog(printer, parent);
- if (dialog.exec())
- ...
- \ endcode
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \oldcode
- if (printer->setup(parent))
- ...
- \newcode
- QPrintDialog dialog(printer, parent);
- if (dialog.exec())
- ...
- \endcode
- \endquotation
-
- Other QDoc commands are disabled within \\oldcode ... \\endcode,
- and the '\\' character doesn't need to be escaped.
-
- \target oldcode-command
- \section1 \\oldcode
-
- The \\oldcode command requires a corresponding
- \\newcode statement; otherwise QDoc fails to parse the command
- and emits a warning.
-
- See also \l {newcode-command} {\\newcode}.
-
- \target qml-command
- \section1 \\qml
-
- The \\qml and \\endqml commands enclose a snippet of QML source
- code. Currently, QDoc handles \\qml and \\endqml in exactly the same
- way as \\code and \\endcode.
-
- \code
- / *!
- \qml
- import QtQuick 1.0
-
- Row {
- Rectangle {
- width: 100; height: 100
- color: "blue"
- transform: Translate { y: 20 }
- }
- Rectangle {
- width: 100; height: 100
- color: "red"
- transform: Translate { y: -20 }
- }
- }
- \endqml
- * /
- \endcode
-
- QDoc renders this as:
-
- \qml
- import QtQuick 1.0
-
- Row {
- Rectangle {
- width: 100; height: 100
- color: "blue"
- transform: Translate { y: 20 }
- }
- Rectangle {
- width: 100; height: 100
- color: "red"
- transform: Translate { y: -20 }
- }
- }
- \endqml
-*/
-
-
-/*!
- \page 07-0-qdoc-commands-includingexternalcode.html
- \previouspage Including Code Inline
- \contentspage QDoc Manual
- \nextpage Creating Links
-
- \title Including External Code
-
- The following commands enable you to include code snippets from
- external files. You can make QDoc include the complete contents of
- a file, or you can quote specific parts of the file and skip
- others. The typical use of the latter is to quote a file chunk by
- chunk.
-
- \b{Note:} Although all these commands are for rendering C++
- code, the
- \l{07-0-qdoc-commands-includingexternalcode.html#snippet-command}
- {\\snippet} and
- \l{07-0-qdoc-commands-includingexternalcode.html#codeline-command}
- {\\codeline} commands are preferred over the others. These
- commands allow equivalent code snippets for other Qt language
- bindings to be substituted for the C++ snippets in the
- documentation.
-
- \target quotefile-command
- \section1 \\quotefile
-
- The \\quotefile command expands to the complete contents of the
- file given as argument.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the file name with a line break.
-
- The file's contents is rendered in a separate paragraph, using a
- monospace font and the standard indentation. The code is shown
- verbatim.
-
- \code
- / *!
- This is a simple "Hello world" example:
-
- \quotefile examples/main.cpp
-
- It contains only the bare minimum you need
- to get a Qt application up and running.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- This is a simple "Hello world" example:
-
- \quotefile examples/main.cpp
-
- It contains only the bare minimum you need to get a Qt
- application up and running.
- \endquotation
-
- See also \l {quotefromfile-command} {\\quotefromfile} and
- \l {code-command} {\\code}.
-
-
- \target quotefromfile-command
- \section1 \\quotefromfile
-
- The \\quotefromfile command opens the file given as argument for
- quoting.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the file name with a line break.
-
- The command is intended for use when quoting parts from file with
- the walkthrough commands: \l {printline-command} {\\printline}, \l
- {printto-command} {\\printto}, \l {printuntil-command}
- {\\printuntil}, \l {skipline-command} {\\skipline}, \l
- {skipto-command} {\\skipto}, \l {skipuntil-command}
- {\\skipuntil}. This enables you to quote specific portions of a
- file.
-
- \code
- / *!
- The whole application is contained within
- the \c main() function:
-
- \quotefromfile examples/main.cpp
-
- \skipto main
- \printuntil app(argc, argv)
-
- First we create a QApplication object using
- the \c argc and \c argv parameters.
-
- \skipto QPushButton
- \printuntil resize
-
- Then we create a QPushButton, and give it a reasonable
- size using the QWidget::resize() function.
-
- ...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The whole application is contained within
- the \c main() function:
-
- \quotefromfile examples/main.cpp
-
- \skipto main
- \printuntil app(argc, argv)
-
- First we create a QApplication object using the \c argc
- and \c argv parameters.
-
- \skipto QPushButton
- \printuntil resize
-
- Then we create a QPushButton, and give it a reasonable
- size using the QWidget::resize() function.
-
- ...
- \endquotation
-
- QDoc remembers which file it is quoting from, and the current
- position in that file (see \l {file} {\\printline} for more
- information). There is no need to "close" the file.
-
- See also \l {quotefile-command} {\\quotefile}, \l {code-command}
- {\\code} and \l {dots} {\\dots}.
-
- \target printline-command
- \section1 \\printline
-
- The \\printline command expands to the line from the current
- position to the next non-blank line of the current source file.
-
- To ensure that the documentation remains synchronized with the
- source file, a substring of the line must be specified as an
- argument to the command. Note that the command considers the rest
- of the line as part of its argument, make sure to follow the
- substring with a line break.
-
- The line from the source file is rendered as a separate paragraph,
- using a monospace font and the standard indentation. The code is
- shown verbatim.
-
- \code
- / *!
- There has to be exactly one QApplication object
- in every GUI application that uses Qt.
-
- \quotefromfile examples/main.cpp
-
- \printline QApplication
-
- This line includes the QApplication class
- definition. QApplication manages various
- application-wide resources, such as the
- default font and cursor.
-
- \printline QPushButton
-
- This line includes the QPushButton class
- definition. The QPushButton widget provides a command
- button.
-
- \printline main
-
- The main function...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- There has to be exactly one QApplication object
- in every GUI application that uses Qt.
-
- \quotefromfile examples/main.cpp
-
- \skipto QApplication
- \printline QApplication
-
- This line includes the QApplication class
- definition. QApplication manages various
- application-wide resources, such as the
- default font and cursor.
-
- \printline QPushButton
-
- This line includes the QPushButton class
- definition. The QPushButton widget provides a command
- button.
-
- \printline main
-
- The main function...
- \endquotation
-
- \target file
-
- QDoc reads the file sequentially. To move the current position
- forward you can use either of the \l {skipline-command}
- {\\skip...} commands. To move the current position backward, you
- can use the \l {quotefromfile-command} {\\quotefromfile} command
- again.
-
- \target substring
-
- If the substring argument is surrounded by slashes it is
- interpreted as a \l {QRegExp}{regular expression}.
-
- \code
- / *!
- \quotefromfile examples/mainwindow.cpp
-
- \skipto closeEvent
- \printuntil /^\}/
-
- Close events are sent to widgets that the users want to
- close, usually by clicking \c File|Exit or by clicking
- the \c X title bar button. By reimplementing the event
- handler, we can intercept attempts to close the
- application.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \quotefromfile examples/mainwindow.cpp
-
- \skipto closeEvent
- \printuntil /^\}/
-
- Close events are sent to widgets that the users want to
- close, usually by clicking \c File|Exit or by clicking
- the \c X title bar button. By reimplementing the event
- handler, we can intercept attempts to close the
- application.
- \endquotation
-
- (\l {widgets/scribble} {The complete example file...})
-
- The regular expression \c /^\}/ makes QDoc print until the first
- '}' character occurring at the beginning of the line without
- indentation. /.../ encloses the regular expression, and '^' means
- the beginning of the line. The '}' character must be escaped since
- it is a special character in regular expressions.
-
- QDoc will emit a warning if the specified substring or regular
- expression cannot be located, i.e. if the source code has changed.
-
- See also \l {printto-command} {\\printto} and \l
- {printuntil-command} {\\printuntil}.
-
- \target printto-command
- \section1 \\printto
-
- The \\printto command expands to all the lines from the current
- position up to and \e excluding the next line containing a given
- substring.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the substring with a line break. The
- command also follows the same conventions for \l {file}
- {positioning} and \l {substring} {argument} as the \l
- {printline-command} {\\printline} command.
-
- The lines from the source file are rendered in a separate
- paragraph, using a monospace font and the standard
- indentation. The code is shown verbatim.
-
- \code
- / *!
- The whole application is contained within the
- \c main() function:
-
- \quotefromfile examples/main.cpp
- \printto hello
-
- First we create a QApplication object using the \c argc and
- \c argv parameters...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The whole application is contained within the
- \c main() function:
-
- \quotefromfile examples/main.cpp
- \skipto main
- \printto hello
-
- First we create a QApplication object using the \c argc
- and \c argv parameters...
- \endquotation
-
- See also \l {printline-command} {\\printline} and \l
- {printuntil-command} {\\printuntil}.
-
- \target printuntil-command
- \section1 \\printuntil
-
- The \\printuntil command expands to all the lines from the current
- position up to and \e including the next line containing a given
- substring.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the substring with a line break. The
- command also follows the same conventions for \l {file}
- {positioning} and \l {substring} {argument} as the \l
- {printline-command} {\\printline} command.
-
- The lines from the source file are rendered in a separate
- paragraph, using a monospace font and the standard
- indentation. The code is shown verbatim.
-
- \code
- / *!
- The whole application is contained within the
- \c main() function:
-
- \quotefromfile examples/main.cpp
- \skipto main
- \printuntil hello
-
- First we create a QApplication object using the
- \c argc and \c argv parameters, then we create
- a QPushButton.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The whole application is contained within the
- \c main() function:
-
- \quotefromfile examples/main.cpp
- \skipto main
- \printuntil hello
-
- First we create a \l
- {http://doc.qt.io/qt-5/qapplication.html} {QApplication}
- object using the \c argc and \c argv parameters, then we
- create a \l
- {http://doc.qt.io/qt-5/qpushbutton.html} {QPushButton}.
- \endquotation
-
- See also \l {printline-command} {\\printline} and \l
- {printto-command} {\\printto}.
-
- \target skipline-command
- \section1 \\skipline
-
- The \\skipline command ignores the next non-blank line in the
- current source file.
-
- Doc reads the file sequentially, and the \\skipline command is
- used to move the current position (omitting a line of the source
- file). See the remark about \l {file} {file positioning} above.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the substring with a line break. The
- command also follows the same conventions for \l {substring}
- {argument} as the \l {printline-command} {\\printline} command,
- and it is used in conjunction with the \l {quotefromfile-command}
- {\\quotefromfile} command.
-
- \code
- / *!
- QPushButton is a GUI push button that the user
- can press and release.
-
- \quotefromfile examples/main.cpp
- \skipline QApplication
- \printline QPushButton
-
- This line includes the QPushButton class
- definition. For each class that is part of the
- public Qt API, there exists a header file of
- the same name that contains its definition.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \l
- QPushButton is a GUI push button that the user
- can press and release.
-
- \quotefromfile examples/main.cpp
- \skipto QApplication
- \skipline QApplication
- \printline QPushButton
-
- This line includes the QPushButton class
- definition. For each class that is part of the public
- Qt API, there exists a header file of the same name
- that contains its definition.
- \endquotation
-
- See also \l {skipto-command} {\\skipto}, \l {skipuntil-command}
- {\\skipuntil} and \l {dots} {\\dots}.
-
- \target skipto-command
- \section1 \\skipto
-
- The \\skipto command ignores all the lines from the current
- position up to and \e excluding the next line containing a given
- substring.
-
- QDoc reads the file sequentially, and the \\skipto command is used
- to move the current position (omitting one or several lines of the
- source file). See the remark about \l {file} {file positioning}
- above.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the substring with a line break.
-
- The command also follows the same conventions for \l {substring}
- {argument} as the \l {printline-command} {\\printline} command,
- and it is used in conjunction with the \l {quotefromfile-command}
- {\\quotefromfile} command.
-
- \code
- / *!
- The whole application is contained within
- the \c main() function:
-
- \quotefromfile examples/main.cpp
- \skipto main
- \printuntil }
-
- First we create a QApplication object. There
- has to be exactly one such object in
- every GUI application that uses Qt. Then
- we create a QPushButton, resize it to a reasonable
- size...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The whole application is contained within
- the \c main() function:
-
- \quotefromfile examples/main.cpp
- \skipto main
- \printuntil }
-
- First we create a QApplication object. There has to be
- exactly one such object in every GUI application that
- uses Qt. Then we create a QPushButton, resize it to a
- reasonable size ...
- \endquotation
-
- See also \l {skipline-command} {\\skipline}, \l
- {skipuntil-command} {\\skipuntil} and \l {dots} {\\dots}.
-
- \target skipuntil-command
- \section1 \\skipuntil
-
- The \\skipuntil command ignores all the lines from the current
- position up to and \e including the next line containing a given
- substring.
-
- QDoc reads the file sequentially, and the \\skipuntil command is
- used to move the current position (omitting one or several lines
- of the source file). See the remark about \l {file} {file
- positioning} above.
-
- The command considers the rest of the line as part of its
- argument, make sure to follow the substring with a line break.
-
- The command also follows the same conventions for \l {substring}
- {argument} as the \l {printline-command} {\\printline} command,
- and it is used in conjunction with the \l {quotefromfile-command}
- {\\quotefromfile} command.
-
- \code
- / *!
- The first thing we did in the \c main() function
- was to create a QApplication object \c app.
-
- \quotefromfile examples/main.cpp
- \skipuntil show
- \dots
- \printuntil }
-
- In the end we must remember to make \c main() pass the
- control to Qt. QCoreApplication::exec() will return when
- the application exits...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- The first thing we did in the \c main() function was to
- create a QApplication object \c app.
-
- \quotefromfile examples/main.cpp
- \skipuntil show
- \dots
- \printuntil }
-
- In the end we must remember to make \c main() pass the
- control to Qt. QCoreApplication::exec()
- will return when the application exits...
- \endquotation
-
- See also \l {skipline-command} {\\skipline}, \l {skipto-command}
- {\\skipto} and \l {dots} {\\dots}.
-
- \target dots-command
- \section1 \\dots
-
- The \\dots command indicates that parts of the source file have
- been omitted when quoting a file.
-
- The command is used in conjunction with the \l
- {quotefromfile-command} {\\quotefromfile} command, and should be
- stated on its own line. The dots are rendered on a new line, using
- a monospace font.
-
- \code
- / *!
- \quotefromfile examples/main.cpp
- \skipto main
- \printuntil {
- \dots
- \skipuntil exec
- \printline }
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotefromfile examples/main.cpp
- \skipto main
- \printuntil {
- \dots
- \skipuntil exec
- \printline }
-
- The default indentation is 4 spaces, but this can be adjusted
- using the command's optional argument.
-
- \code
- / *!
- \dots 0
- \dots
- \dots 8
- \dots 12
- \dots 16
- * /
- \endcode
-
- QDoc renders this as:
-
- \dots 0
- \dots
- \dots 8
- \dots 12
- \dots 16
-
- See also \l {skipline-command} {\\skipline}, \l {skipto-command}
- {\\skipto} and \l {skipuntil-command} {\\skipuntil}.
-
- \target snippet-command
- \section1 \\snippet
-
- The \\snippet command causes a code snippet to be included
- verbatim as preformatted text, which may be syntax highlighted.
-
- Each code snippet is referenced by the file that holds it and by
- a unique identifier for that file. Snippet files are typically
- stored in a \c{snippets} directory inside the documentation
- directory (for example, \c{$QTDIR/doc/src/snippets}).
-
- For example, the following documentation references a snippet in a
- file residing in a subdirectory of the documentation directory:
-
- \code
- \snippet snippets/textdocument-resources/main.cpp Adding a resource
- \endcode
-
- The text following the file name is the unique identifier for the
- snippet. This is used to delimit the quoted code in the relevant
- snippet file, as shown in the following example that corresponds to
- the above \c{\\snippet} command:
-
- \dots
- \code
- QImage image(64, 64, QImage::Format_RGB32);
- image.fill(qRgb(255, 160, 128));
-
- //! [Adding a resource]
- document->addResource(QTextDocument::ImageResource,
- QUrl("mydata://image.png"), QVariant(image));
- //! [Adding a resource]
- \endcode
- \dots
-
- \target codeline-command
- \section1 \\codeline
-
- The \\codeline command inserts a blank line of preformatted
- text. It is used to insert gaps between snippets without closing
- the current preformatted text area and opening a new one.
-
-*/
-
-
-/*!
- \page 08-qdoc-commands-creatinglinks.html
- \previouspage Including External Code
- \contentspage QDoc Manual
- \nextpage Including Images
-
- \title Creating Links
-
- These commands are for creating hyperlinks to classes, functions,
- examples, and other targets.
-
- \target l-command
- \section1 \\l (link)
-
- The \\l link command is used to create a hyperlink to many
- different kinds of targets. The command's general syntax is:
-
- \code
- \l [ link criteria ] { link target } { link text }
- \endcode
-
- ...where the \c {link criteria} in square brackets are optional
- but may be required when the \c {link target} is ambiguous. See
- \l {Fixing Ambiguous Links} below.
-
- Here is an example using the \\l command to link to an external page:
-
- \code
- / *!
- Read the \l {http://doc.qt.io/qt-5/}
- {Qt 5.0 Documentation} carefully.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- Read the \l {http://doc.qt.io/qt-5/}
- {Qt 5.0 Documentation} carefully.
- \endquotation
-
- If the link target is equivalent to the link text, the second
- argument can be omitted.
-
- For example, if you have documentation like:
-
- \code
- / *!
- \target assertions
-
- Assertions make some statement about the text at the
- point where they occur in the regexp, but they do not
- match any characters.
-
- ...
-
- Regexps are built up from expressions, quantifiers, and
- \l {assertions} {assertions}.
- * /
- \endcode
-
- You can simplify this as follows:
-
- \code
- / *!
- \target assertions
-
- Assertions make some statement about the text at the
- point where they occur in the regexp, but they do not
- match any characters.
-
- ...
-
- Regexps are built up from expressions, quantifiers, and
- \l assertions.
- * /
- \endcode
-
- For the one-parameter version, the braces can often be omitted.
- The \\l command supports several ways of linking:
-
- \list
-
- \li \c {\l QWidget} - The name of a class documented with the \l
- {class-command} {\\class} command.
-
- \li \c {\l QWidget::sizeHint()} - The name of a member function,
- documented with or without an \l {fn-command} {\\fn} command.
-
- \li \c {\l <QtGlobal>} - The subject of a \l {headerfile-command}
- {\\headerfile} command.
-
- \li \c {\l widgets/wiggly} - The relative path used in an \l
- {example-command} {\\example} command.
-
- \li \c {\l {QWidget Class Reference}} - The title used in a
- \l {title-command} {\\title} command.
-
- \li \c {\l {Introduction to QDoc}}- The text from one of the
- \l{part-command} {\\part}, \l{chapter} {\\chapter}, or \l
- {sectionOne-command} {\\section} commands.
-
- \li \c {\l fontmatching} - The argument of a \l {target-command}
- {\\target} command.
-
- \li \c {\l {Shared Classes}} - A keyword named in a \l
- {keyword-command} {\\keyword} command.
-
- \li \c {\l http://qt-project.org/} - A URL.
-
- \endlist
-
- QDoc also tries to make a link out of any word that doesn't
- resemble a normal English word, for example, Qt class names or
- functions, like QWidget or QWidget::sizeHint(). In these cases,
- the \\l command can actually be omitted, but by using the command,
- you ensure that QDoc will emit a warning if it cannot find the
- link target. In addition, if you only want the function name to
- appear in the link, you can use the following syntax:
-
- \list
- \li \c {\l {QWidget::} {sizeHint()}}
- \endlist
-
- QDoc renders this as:
-
- \quotation
- \l {QWidget::} {sizeHint()}
- \endquotation
-
- \section2 Fixing Ambiguous Links
-
- Because of the modularization of Qt beginning with Qt 5.0, The
- possibility that qdoc will have to deal with ambiguous links has
- increased. An ambiguous link is one that has a matching target in
- more than one Qt module, e.g. the same section title can appear in
- more than one Qt module, or the name of a C++ class in one module
- can also be the name of a QML type in another module. A real
- example in Qt5 is the name Qt itself. Qt is the name of both a C++
- namespace in QtCore and a QML type in QtQml.
-
- Suppose we want to link to the \l {Qt} {Qt C++ namespace}. At the
- time qdoc generated this HTML page, that link was correct. Does
- it still go to the C++ namespace? Qdoc generated that link from
- this link command:
-
- \list
- \li \c {\l {Qt} {Qt C++ namespace}}
- \endlist
-
- Now suppose we want to link to the \l [QML] {Qt} {Qt QML type}.
- At the time qdoc generated this HTML page, that link was also
- correct, but we had to use this link command:
-
- \list
- \li \c {\l [QML] {Qt} {Qt QML type}}
- \endlist
-
- The \e {QML} in \e {square brackets} tells qdoc to accept a
- matching target only if the traget is on a QML page. Qdoc actually
- finds the C++ namespace target first, but since that target is on
- a C++ page, qdoc ignores it and keeps looking until it finds the
- same target on a QML page.
-
- Without the guidance in the \e{\\l command} in the optional \e
- {square bracket} argument, qdoc links to the first matching target
- it finds. qdoc can't warn that the link was ambiguous in such
- cases because it doesn't know that another matching target exists.
-
- \section2 What arguments can appear in square brackets?
-
- A link command with square bracket argument has the following syntax:
- \list
- \c {\l [QML|CPP|DOC|QtModuleName] {link target} {link text}}
- \endlist
-
- The \e {square bracket} argument is only allowed in the \c {\\l
- (link)} command. The example above shows how \c QML is used as the
- \e {square brackets} argument to force qdoc to match a QML target.
- Most often, this will be a QML type, but it can also be a QML
- member function of property.
-
- In the example, qdoc didn't need a \e {square bracket} argument to
- find the Qt C++ namespace page, because that one was the first
- matching target qdoc found anyway. However, to force qdoc to find
- a C++ target when a matching QML target gets in the way, \c CPP
- can be used as the \e {square bracket} argument. For example:
-
- \list
- \li \c {\l [CPP] {Qt} {Qt C++ namespace}}
- \endlist
-
- ...will force qdoc to ignore the Qt QML type and continue
- searching until it matches the Qt C++ namespace.
-
- If the link target is neither a C++ nor a QML entity, \c {DOC} can
- be used as the \e {square bracket} argument to prevent qdoc from
- matching either of those. At this writing, there were no cases of
- ambiguous links where using \c {DOC} was required.
-
- Often, the documentor knows which Qt module the link target is
- in. When the module name is known, use the module name as the \e
- {square bracket} argument. In the example above, if we know that
- the QML type named Qt is located in the QtQml module, we can write
- the link command like this:
-
- \list
- \li \c {\l [QtQml] {Qt} {Qt QML type}}
- \endlist
-
- When a module name is used as the \e {square bracket} argument,
- qdoc will search for link the target in that module only. This
- makes searching for link targets more efficient.
-
- Finally, the module name and entity type arguments can be
- combined, separated by a blank, so something like this is also
- allowed:
-
- \list
- \li \c {\l [CPP QtQml] {Window} {C++ class Window}}
- \endlist
-
- As of this writing, there were no cases where combining the two
- was required.
-
- See also \l {sa-command} {\\sa}, \l {target-command} {\\target},
- and \l {keyword-command} {\\keyword}.
-
-
- \target sa-command
- \section1 \\sa (see also)
-
- The \\sa command defines a list of links that will be rendered in
- a separate "See also" section at the bottom of the documentation
- unit.
-
- The command takes a comma-separated list of links as its
- argument. If the line ends with a comma, you can continue
- the list on the next line. The general syntax is:
-
- \code
- \sa {the first link}, {the second link},
- {the third link}, ...
- \endcode
-
- QDoc will automatically try to generate "See also" links
- interconnecting a property's various functions. For example, a
- setVisible() function will automatically get a link to visible()
- and vice versa.
-
- In general, QDoc will generate "See also" links that interconnect
- the functions that access the same property. It recognizes four
- different syntax versions:
-
- \list
- \li \c property()
- \li \c setProperty()
- \li \c isProperty()
- \li \c hasProperty()
- \endlist
-
- The \\sa command supports the same kind of links as the \l
- {l-command} {\\l} command.
-
- \code
- / *!
- Appends the actions \a actions to this widget's
- list of actions.
-
- \sa removeAction(), QMenu, addAction()
- * /
- void QWidget::addActions(QList<QAction *> actions)
- {
- ...
- }
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \b {void QWidget::addActions ( QList<QAction*>
- \e actions )}
-
- Appends the actions \e actions to this widget's list of
- actions.
-
- See also \l {QWidget::removeAction()} {removeAction()},
- \l QMenu, and \l {QWidget::addAction()} {addAction()}.
- \endquotation
-
- See also \l {l-command} {\\l}, \l {target-command} {\\target} and
- \l {keyword-command} {\\keyword}.
-
-
- \target target-command
- \section1 \\target
-
- The \\target command names a place in the documentation that you
- can link to using the \l {l-command} {\\l (link)} and \l
- {sa-command} {\\sa (see also)} commands.
-
- The text up to the line break becomes the target name. Be sure to
- follow the target name with a line break. Curly brackets are not
- required around the target name, but they may be required when the
- target name is used in a link command. See below.
-
- \code
- / *!
- \target capturing parentheses
- \section1 Capturing Text
-
- Parentheses allow us to group elements together so that
- we can quantify and capture them.
-
- ...
- * /
- \endcode
-
- The target name \e{capturing parentheses} can be linked from
- within the same document containing the target in the following way:
-
- \list
- \li \c {\l {capturing parentheses}} (from within the same QDoc comment)
- \endlist
-
- \note The brackets in the link example are required because the
- target name contains spaces.
-
- See also \l {l-command} {\\l}, \l {sa-command} {\\sa} and \l
- {keyword-command} {\\keyword}.
-
- \target keyword-command
- \section1 \\keyword
-
- The \\keyword command names a place in the documentation that you
- can link to using the \l {l-command} {\\l (link)} and \l
- {sa-command} {\\sa (see also)} commands.
-
- The \\keyword command is like the \l {target-command} {\\target}
- command, but stronger. A keyword can be linked from anywhere using
- a simple syntax.
-
- Keywords must be unique over all the documents processed during
- the QDoc run. The command uses the rest of the line as its
- argument. Be sure to follow the keyword with a line break.
-
-
- \code
- / *!
- \class QRegExp
- \reentrant
- \brief The QRegExp class provides pattern
- matching using regular expressions.
- \ingroup tools
- \ingroup misc
- \ingroup shared
-
- \keyword regular expression
-
- Regular expressions, or "regexps", provide a way to
- find patterns within text.
-
- ...
- * /
- \endcode
-
- The location marked with the keyword can be linked to with:
-
- \code
- / *!
- When a string is surrounded by slashes, it is
- interpreted as a \l {QRegExp}{regular expression}.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- When a string is surrounded by slashes, it is
- interpreted as a \l {regular expression}.
- \endquotation
-
- If the keyword text contains spaces, the brackets are required.
-
- See also \l {l-command} {\\l (link)}, \l {sa-command} {\\sa (see
- also)} and \l {target-command} {\\target}.
-
-*/
-
-
-/*!
- \page 09-qdoc-commands-includingimages.html
- \previouspage Creating Links
- \contentspage QDoc Manual
- \nextpage Tables and Lists
-
- \title Including Images
-
- The graphic commands makes it possible to include images in the
- documentation. The images can be rendered as separate paragraphs,
- or within running text.
-
- \target image-command
- \section1 \\image
-
- The \\image command expands to the image specified by its first
- argument, and renders it centered as a separate paragraph.
-
- The command takes two arguments. The first argument is the name of
- the image file. The second argument is optional and is a simple
- description of the image, equivalent to the HTML alt="" in an image
- tag. The description is used for tooltips and for browsers that don't
- support images, like the Lynx text browser.
-
- The remaining text \e{after} the file name is the optional,
- description argument. Be sure to follow the file name or the
- description with a line break. Curly brackets are required if the
- description argument spans multiple lines.
-
- \code
- / *!
- Qt is a C++ toolkit for cross-platform GUI application development.
-
- \image happyguy.jpg "Happy guy"
-
- Qt provides single-source portability across Microsoft
- Windows, OS X, Linux, and all major commercial Unix
- variants. It is also available for embedded devices.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- Qt is a C++ toolkit for cross-platform GUI application development.
-
- \image happyguy.jpg image "Happy guy"
-
- Qt provides single-source portability across Microsoft
- Windows, OS X, Linux, and all major commercial Unix
- variants. It is also available for embedded devices.
- \endquotation
-
- See also \l {inlineimage-command} {\\inlineimage} and \l
- {caption-command} {\\caption}.
-
- \target inlineimage-command
- \section1 \\inlineimage
-
- The \\inlineimage command expands to the image specified by its
- argument. The image is rendered inline with the rest of the text.
-
- The command takes two arguments. The first argument is the name of
- the image file. The second argument is optional and is a simple
- description of the image, equivalent to the HTML alt="" in an image
- tag. The description is used for tooltips, and for when a browser
- doesn't support images, like the Lynx text browser.
-
- The most common use of the \\inlineimage command is in lists and
- tables. Here is an example of including inline images in a list:
-
- \code
- / *!
- \list 1
- \li \inlineimage happy.gif Oh so happy!
- \li \inlineimage happy.gif Oh so happy!
- \li \inlineimage happy.gif Oh so happy!
- \endlist
- * /
- \endcode
-
- QDoc renders this as:
-
- \list 1
- \li \inlineimage happy.gif Oh so happy!
- \li \inlineimage happy.gif Oh so happy!
- \li \inlineimage happy.gif Oh so happy!
- \endlist
-
- Here is an example of including inline images in a table:
-
- \code
- / *!
- \table
- \header
- \li Qt
- \li Qt Creator
- \row
- \li \inlineimage happy.gif Oh so happy!
- \li \inlineimage happy.gif Oh so happy!
- \row
- \li \inlineimage happy.gif Oh so happy!
- \li \inlineimage happy.gif Oh so happy!
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2"
- cellspacing="1" border="0">
- <tr valign="top" bgcolor="#a2c511">
- <th>Qt</th>
- <th>Qt Creator</th>
- </tr>
- <tr valign="top" bgcolor="#f0f0f0">
- <td><img src="images/happy.gif" alt="Oh so happy!" />
- </td>
- <td><img src="images/happy.gif" alt="Oh so happy!" />
- </td>
- </tr>
- <tr valign="top" bgcolor="#f0f0f0">
- <td><img src="images/happy.gif" alt="Oh so happy!"/>
- </td>
- <td><img src="images/happy.gif" alt="Oh so happy!" />
- </td>
- </tr>
- </table>
- \endraw
-
- The command can also be used to insert an image inline with the
- text.
-
- \code
- / *!
- \inlineimage training.jpg Qt Training
- The Qt Programming course is offered as a
- five day Open Enrollment Course. The classes
- are open to the public. Although the course is open
- to anyone who wants to learn, attendees should
- have significant experience in C++ development
- to derive maximum benefit from the course.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \inlineimage training.jpg Qt Training
- The Qt Programming course is offered as a
- five day Open Enrollment Course. The classes
- are open to the public. Although the course is open
- to anyone who wants to learn, attendees should
- have significant experience in C++ development
- to derive maximum benefit from the course.
- \endquotation
-
- See also \l {image-command} {\\image} and \l {caption-command} {\\caption}.
-
- \target caption-command
- \section1 \\caption
-
- The \\caption command provides a caption for an image.
-
- The command takes all the text up to the end of the paragraph to
- be the caption. Experiment until you get the effect you want.
-
- \code
- / *!
- \table 100%
- \row
- \li \image windowsvista-pushbutton.png
- \caption The QPushButton widget provides a command button.
- \li \image windowsvista-toolbutton.png
- \caption The QToolButton class provides a quick-access button to commands
- or options, usually used inside a QToolBar.
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \table 100%
- \row
- \li \image windowsvista-pushbutton.png
- \caption The QPushButton widget provides a command button.
- \li \image windowsvista-toolbutton.png
- \caption The QToolButton class provides a quick-access button to commands
- or options, usually used inside a QToolBar.
- \endtable
-
- See also \l {image-command} {\\image} and \l {inlineimage-command}
- {\\inlineimage}
-*/
-
-
-/*!
- \page 10-qdoc-commands-tablesandlists.html
- \previouspage Including Images
- \contentspage QDoc Manual
- \nextpage Special Content
-
- \title Tables and Lists
-
- These commands enable creating lists and tables. A list is
- rendered left aligned as a separate paragraph. A table is rendered
- centered as a separate paragraph. The table width depends on the
- width of its contents.
-
- \target table-command
- \section1 \\table
-
- The \\table and \\endtable commands delimit the contents of a
- table.
-
- The command accepts a single argument specifying the table's width
- as a percentage of the page width:
-
- \code
- / *!
- \table 100 %
-
- ...
-
- \endtable
- * /
- \endcode
-
- The code above ensures that the table will fill all available
- space. If the table's width is smaller than 100 %, the table will
- be centered in the generated documentation.
-
- A table can contain headers, rows and columns. A row starts with a
- \l {row-command} {\\row} command and consists of cells, each of which
- starts with an \l {li-command} {\\li} command. There is also a \l
- {header-command} {\\header} command which is a special kind of row
- that has a special format.
-
- \code
- / *!
- \table
- \header
- \li Qt Core Feature
- \li Brief Description
- \row
- \li \l {Signal and Slots}
- \li Signals and slots are used for communication
- between objects.
- \row
- \li \l {Layout Management}
- \li The Qt layout system provides a simple
- and powerful way of specifying the layout
- of child widgets.
- \row
- \li \l {Drag and Drop}
- \li Drag and drop provides a simple visual
- mechanism which users can use to transfer
- information between and within applications.
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2"
- cellspacing="1" border="0">
- <tr valign="top" bgcolor="#a2c511">
- <th>Qt Core Feature</th>
- <th>Brief Description</th>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>
- <a href="http://doc.qt.io/qt-5/signalsandslots.html">
- Signals and Slots</a>
- </td>
- <td>Signals and slots are used for communication
- between objects.</td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>
- <a href="http://doc.qt.io/qt-5/layout.html">
- Layout Management</a></td>
- <td>The Qt layout system provides a simple
- and powerful way of specifying the layout
- of child widgets.</td>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>
- <a href="http://doc.qt.io/qt-5/dnd.html">
- Drag and Drop</a></td>
- <td>Drag and drop provides a simple visual
- mechanism which users can use to transfer
- information between and within applications.</td>
- </tr>
-
- </table>
- \endraw
-
- You can also make cells span several rows and columns. For
- example:
-
- \code
- / *!
- \table
- \header
- \li {3,1} This header cell spans three columns,
- but only one row.
- \row
- \li {2, 1} This table cell spans two columns,
- but only one row
- \li {1, 2} This table cell spans only one column,
- but two rows.
- \row
- \li A regular table cell
- \li A regular table cell
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2" cellspacing="1"
- border="0">
-
- <tr valign="top" bgcolor="#a2c511">
- <th colspan="3" rowspan=" 1">
- This header cell spans three columns, but only one row.
- </th>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td colspan="2" rowspan=" 1">
- This table cell spans two columns, but only one row.
- </td>
- <td rowspan=" 2">
- This table cell spans only one column, but two rows.
- </td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>A regular table cell</td>
- <td>A regular table cell</td>
- </tr>
-
- </table>
- \endraw
-
- See also \l {header-command} {\\header}, \l {row-command} {\\row} and \l {li-command} {\\li}.
-
- \target header-command
- \section1 \\header
-
- The \\header command indicates that the following table cells are
- the current table's column headers.
-
- The command can only be used within the \l{table-command}
- {\\table...\\endtable} commands. A header can contain several
- cells. A cell is created with the \l {li-command} {\\li} command.
-
- A header cell's text is centered within the table cell and
- rendered using a bold font.
-
- \code
- / *!
- \table
- \header
- \li Qt Core Feature
- \li Brief Description
- \row
- \li \l {Signal and Slots}
- \li Signals and slots are used for communication
- between objects.
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2"
- cellspacing="1" border="0">
- <tr valign="top" bgcolor="#a2c511">
- <th>Qt Core Feature</th>
- <th>Brief Description</th>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>
- <a href="http://doc.qt.io/qt-5/signalsandslots.html">
- Signals and Slots</a>
- </td>
- <td>Signals and slots are used for communication
- between objects.</td>
- </tr>
- </table>
- \endraw
-
- See also \l {table-command} {\\table}, \l {row-command} {\\row} and \l {li-command} {\\li}.
-
- \target row-command
- \section1 \\row
-
- The \\row command begins a new row in a table. The \l {li-command}
- {\\li items} that belong in the new row will immediately follow the
- \\row.
-
- The command can only be used within the \l{table-command}
- {\\table...\\endtable} commands. A row can contain several
- cells. A cell is created with the \l {li-command} {\\li} command.
-
- The background cell color of each row alternates between two
- shades of grey, making it easier to distinguish the rows from each
- other. The cells' contents is left aligned.
-
- \code
- / *!
- \table
- \header
- \li Qt Core Feature
- \li Brief Description
- \row
- \li \l {Signal and Slots}
- \li Signals and slots are used for communication
- between objects.
- \row
- \li \l {Layout Management}
- \li The Qt layout system provides a simple
- and powerful way of specifying the layout
- of child widgets.
- \row
- \li \l {Drag and Drop}
- \li Drag and drop provides a simple visual
- mechanism which users can use to transfer
- information between and within applications.
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2"
- cellspacing="1" border="0">
- <tr valign="top" bgcolor="#a2c511">
- <th>Qt Core Feature</th>
- <th>Brief Description</th>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>
- <a href="http://doc.qt.io/qt-5/signalsandslots.html">
- Signals and Slots</a>
- </td>
- <td>Signals and slots are used for communication
- between objects.</td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>
- <a href="http://doc.qt.io/qt-5/layout.html">
- Layout Management</a></td>
- <td>The Qt layout system provides a simple
- and powerful way of specifying the layout
- of child widgets.</td>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>
- <a href="http://doc.qt.io/qt-5/dnd.html">
- Drag and Drop</a></td>
- <td>Drag and drop provides a simple visual
- mechanism which users can use to transfer
- information between and within applications.</td>
- </tr>
-
- </table>
- \endraw
-
- See also \l {table-command} {\\table}, \l {header-command}
- {\\header}, and \l {li-command} {\\li}.
-
- \target value-command
- \section1 \\value
-
- The \\value command starts the documentation of a C++ enum item.
-
- The command's first argument is the enum item. Then follows its
- associated description. The description argument ends at the next
- blank line or \\value. The arguments are rendered within a table.
-
- The documentation will be located in the associated class, header
- file or namespace documentation. See the \l {enum-command}
- {\\enum} documentation for an example.
-
- \note Since Qt 5.4, \\value command can also be used outside the
- \l {enum-command} {\\enum} topic. In this case, QDoc renders a
- two-column table listing the constant name (taken as-is from the
- first argument) and its description. This can be used, for
- example, in \l {qmlproperty-command}{\\qmlproperty} topic for
- documenting acceptable values for a QML enumeration property.
-
- See also \l {enum-command} {\\enum} and \l {omitvalue-command} {\\omitvalue}.
-
- \target omitvalue-command
- \section1 \\omitvalue
-
- The \\omitvalue command excludes a C++ enum item from the
- documentation.
-
- The command's only argument is the name of the enum item that will
- be omitted. See the \l {enum-command} {\\enum} documentation for
- an example.
-
- See also \l {enum-command} {\\enum} and \l {value-command}
- {\\value}.
-
- \target list-command
- \section1 \\list
-
- The \\list and \\endlist commands delimit a list of items.
-
- Create each list item with the \l {li-command} {\\li} command. A
- list always contains one or more items. Lists can be nested. For
- example:
-
- \code
- / *!
- \list
- \li Qt Reference Documentation: Getting Started
- \list
- \li How to Learn Qt
- \li Installation
- \list
- \li Qt/X11
- \li Qt/Windows
- \li Qt/Mac
- \li Qt/Embedded
- \endlist
- \li Tutorial and Examples
- \endlist
- \endlist
- * /
- \endcode
-
- QDoc renders this as:
-
- \list
- \li Qt Reference Documentation: Getting Started
- \list
- \li How to Learn Qt
- \li Installation
- \list
- \li Qt/X11
- \li Qt/Windows
- \li Qt/Mac
- \li Qt/Embedded
- \endlist
- \li Tutorial and Examples
- \endlist
- \endlist
-
- The \\list command takes an optional argument providing
- alternative appearances for the list items.
-
- \code
- / *!
- \list
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
- * /
- \endcode
-
- QDoc renders the list items with bullets (the default):
-
- \list
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
-
- \warning There appears to be a bug in qdoc here. If you include
- any of the argument types, you get a numeric list. We're looking
- into it.
-
- If you provide 'A' as an argument to the \\list command, the
- bullets are replaced with characters in alphabetical order:
-
- \list A
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
-
- If you replace 'A' with '1', the list items are numbered in
- ascending order:
-
- \list 1
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
-
- \endlist
-
- If you provide 'i' as the argument, the bullets are replaced with
- roman numerals:
-
- \list i
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
-
- Finally, you can make the list items appear with roman numbers
- following in ascending order if you provide 'I' as the optional
- argument:
-
- \list I
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
-
- You can also make the listing start at any character or number by
- simply provide the number or character you want to start at. For
- example:
-
- \code
- / *!
- \list G
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
- * /
- \endcode
-
- \note This doesn't work in DITA XML, so don't use it because it
- produces a DITA XML file that doesn't validate. There probably is
- a way to do this in DITA, so if we figure it out, we will put it
- in. But this capability is not used anywhere other than right
- here, so it probably isn't important. For now, if you use this
- option, qdoc will ignore it and produce a list without it.
-
- QDoc renders this as:
-
- \list G
- \li How to Learn Qt
- \li Installation
- \li Tutorial and Examples
- \endlist
-
- See also \l {li-command} {\\li}.
-
- \target li-command
- \section1 \\li (table cell, list item)
-
- The \\li command marks a table cell or a list item. This command
- is only used in \l{table-command} {tables} and \l{list-command}
- {lists}.
-
- It considers everything as its argument until the next \\li command, until the
- next \l {table-command} {\\endtable}, or \l {list-command} {\\endlist}
- command. See \l {table-command} {\\table} and \l {list-command} {\\list}
- for examples.
-
- If the command is used within a table, you can also specify
- how many rows or columns the item should span.
-
- \code
- / *!
- \table
- \header
- \li {3,1} This header cell spans three columns
- but only one row.
- \row
- \li {2, 1} This table item spans two columns
- but only one row
- \li {1, 2} This table item spans only one column,
- but two rows.
- \row
- \li A regular table item
- \li A regular table item
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2" cellspacing="1"
- border="0">
-
- <tr valign="top" bgcolor="#a2c511">
- <th colspan="3" rowspan=" 1">
- This header cell spans three columns, but only one row.
- </th>
- </tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td colspan="2" rowspan=" 1">
- This table item spans two columns, but only one row.
- </td>
- <td rowspan=" 2">
- This table item spans only one column, but two rows.
- </td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>A regular table item</td>
- <td>A regular table item</td>
- </tr>
-
- </table>
- \endraw
-
- If not specified, the item will span one column and one row.
-
- See also \l {table-command} {\\table}, \l {header-command}
- {\\header}, and \l {list-command} {\\list}.
-
-*/
-
-
-/*!
- \page 11-qdoc-commands-specialcontent.html
- \previouspage Tables and Lists
- \contentspage QDoc Manual
- \nextpage Miscellaneous
-
- \title Special Content
-
- The document contents commands identify parts of the documentation,
- parts with a special rendering, conceptual meaning or
- function.
-
- \target abstract-command
- \section1 \\abstract
-
- The \\abstract and \\endabstract commands delimit a
- document's abstract section.
-
- The abstract section is rendered as an indented italicized
- paragraph.
-
- \warning The \b{\\abstract} and \b{\\endabstract} commands
- have not been implemented. The abstract section is rendered as a
- regular HTML paragraph.
-
- \target quotation-command
- \section1 \\quotation
-
- The \\quotation and \\endquotation commands delimit a long quotation.
-
- The text in the delimited block is surrounded by
- \b{<blockquote>} and \b{</blockquote>} in the html output,
- e.g.:
-
- \code
- / *!
- Although the prospect of a significantly broader market is
- good news for Firstlogic, the notion also posed some
- challenges. Dave Dobson, director of technology for the La
- Crosse, Wisconsin-based company, said:
-
- \quotation
- As our solutions were being adopted into new
- environments, we saw an escalating need for easier
- integration with a wider range of enterprise
- applications.
- \endquotation
- * /
- \endcode
-
- The text in the \b{\\quotation} block will appear in the generated HTML as:
-
- \code
- <blockquote>
- <p>As our solutions were being adopted into new environments,
- we saw an escalating need for easier integration with a wider
- range of enterprise applications.</p>
- </blockquote>
- \endcode
-
- The built-in style sheet for most browsers will render the
- contents of the <blockquote> tag with left and right
- indentations. The example above would be rendered as:
-
- \quotation
- As our solutions were being adopted into new
- environments, we saw an escalating need for easier
- integration with a wider range of enterprise
- applications.
- \endquotation
-
- But you can redefine the \b{<blockquote>} tag in your style.css file.
-
- \target footnote-command
- \section1 \\footnote
-
- The \\footnote and \\endfootnote commands delimit a footnote.
-
- The footnote is rendered at the bottom of the page.
-
- \warning The \b{\\footnote} and \b{\\endfootnote} commands
- have not been implemented. The footnote is rendered as a regular
- HTML paragraph.
-
- \target note-command
- \section1 \\note
-
- The \\note command defines a new paragraph preceded by "Note:"
- in bold.
-
- \target tableofcontents-command
- \section1 \\tableofcontents
-
- The \\tableofcontents command has been disabled because QDoc
- now generates a table of contents automatically.
-
- The automatically generated table of contents appears in the upper
- righthand corner of the page.
-
- \target brief-command
- \section1 \\brief
-
- The \\brief command introduces a one-sentence description of a
- class, namespace, header file, property, or variable.
-
- The brief text is used to introduce the documentation of the
- associated object, and in lists generated using the \l
- {generatelist-command} {\\generatelist} command and the \l
- {annotatedlist-command} {\\annotatedlist} command.
-
- The \\brief command can be used in two significant different ways:
- \l {brief class} {One for classes, namespaces and header files},
- and \l {brief-property} {one for properties and variables}.
-
- \target brief-property
-
- When the \\brief command is used to describe a property or a
- variable, the brief text must be a sentence fragment starting with
- "whether" (for a boolean property or variable) or starting with
- "the" (for any other property or variable).
-
- For example the boolean QWidget::isWindow property:
-
- \code
- / *!
- \property QWidget::isActiveWindow
- \brief Whether this widget's window is the active window
-
- The active window is the window that contains the widget that
- has keyboard focus.
-
- When popup windows are visible, this property is \c true
- for both the active window \e and the popup.
-
- \sa activateWindow(), QApplication::activeWindow()
- * /
- \endcode
-
- and the QWidget::geometry property
-
- \code
- / *!
- \property QWidget::geometry
- \brief The geometry of the widget relative to its parent and
- excluding the window frame
-
- When changing the geometry, the widget, if visible,
- receives a move event (moveEvent()) and/or a resize
- event (resizeEvent()) immediately.
-
- ...
-
- \sa frameGeometry(), rect(), ...
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h3>geometry :
- <a href="http://doc.qt.io/qt-5/qrect.html">QRect</a>
- </h3>
- \endraw
-
- This property holds the geometry of the widget relative
- to its parent and excluding the window frame.
-
- ...
-
- Access functions:
- \list
- \li \b {const QRect & geometry () const}
- \li \b {void setGeometry ( int x, int y, int w, int h )}
- \li \b {void setGeometry ( const QRect & )}
- \endlist
-
- See also \l
- {QWidget::frameGeometry()} {frameGeometry()}, \l
- {QWidget::rect()} {rect()}, ...
- \endquotation
-
- \target brief class
-
- When the \\brief command is used to describe a class, we recommend
- using a complete sentence like this:
-
- \code
- The <classname> class is|provides|contains|specifies...
- \endcode
-
- \warning Do not repeat your detailed description with the same sentence as
- the brief statement will be the first paragraph of the detailed
- description.
-
- \code
- / *!
- \class PreviewWindow
- \brief The PreviewWindow class is a custom widget
- displaying the names of its currently set
- window flags in a read-only text editor.
-
- The PreviewWindow class inherits QWidget. The widget
- displays the names of its window flags set with the
- setWindowFlags() function. It is also provided with a
- QPushButton that closes the window.
-
- ...
-
- \sa QWidget
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h1>PreviewWindow Class Reference</h1>
- \endraw
-
- The PreviewWindow class is a custom widget displaying
- the names of its currently set window flags in a
- read-only text editor. \l {preview window} {More...}
-
- \raw HTML
- <h3>Properties</h3>
- \endraw
-
- \list
- \li 52 properties inherited from QWidget
- \li 1 property inherited from QObject
- \endlist
-
- \raw HTML
- <h3>Public Functions</h3>
- \endraw
-
- \list
- \li \l {constructor} {PreviewWindow}(QWidget *parent = 0)
- \li void \l {function} {setWindowFlags}(Qt::WindowFlags flags)
- \endlist
-
- \list
- \li 183 public functions inherited from QWidget
- \li 28 public functions inherited from QObject
- \endlist
-
- \raw HTML
- <h3>Public Slots</h3>
- \endraw
-
- \list
- \li 17 public slots inherited from QWidget
- \li 1 public slot inherited from QObject
- \endlist
-
- \raw HTML
- <h3>Additional Inherited Members</h3>
- \endraw
-
- \list
- \li 1 signal inherited from QWidget
- \li 1 signal inherited from QObject
- \li 4 static public members inherited from QWidget
- \li 4 static public members inherited from QObject
- \li 39 protected functions inherited from QWidget
- \li 7 protected functions inherited from QObject
- \endlist
-
- \target preview window
-
- \raw HTML
- <hr />
- <h2>Detailed Description</h2>
- \endraw
-
- The PreviewWindow class is a custom widget displaying
- the names of its currently set window flags in a
- read-only text editor.
-
- The PreviewWindow class inherits QWidget. The widget
- displays the names of its window flags set with the \l
- {function} {setWindowFlags()} function. It is also
- provided with a QPushButton that closes the window.
-
- ...
-
- See also QWidget.
-
- \raw HTML
- <hr />
- <h2>Member Function Documentation</h2>
- \endraw
-
- \target constructor
- \raw HTML
- <h3>PreviewWindow(QWidget *parent = 0)</h3>
- \endraw
-
- Constructs a preview window widget with \e parent.
-
- \target function
- \raw HTML
- <h3>setWindowFlags(Qt::WindowFlags flags)</h3>
- \endraw
-
- Sets the widgets flags using the
- QWidget::setWindowFlags() function.
-
- Then runs through the available window flags,
- creating a text that contains the names of the flags
- that matches the flags parameter, displaying
- the text in the widgets text editor.
- \endquotation
-
- Using \\brief in a \l{namespace-command}{\\namespace}:
-
- \code
- / *!
- \namespace Qt
-
- \brief The Qt namespace contains miscellaneous identifiers
- used throughout the Qt library.
- * /
- \endcode
-
- Using \\brief in a \l{headerfile-command}{\\headerfile}:
-
- \code
- / *!
- \headerfile <QtGlobal>
- \title Global Qt Declarations
-
- \brief The <QtGlobal> header file provides basic
- declarations and is included by all other Qt headers.
-
- \sa <QtAlgorithms>
- * /
- \endcode
-
- See also \l{property-command} {\\property}, \l{class-command}
- {\\class}, \l{namespace-command} {\\namespace} and
- \l{headerfile-command} {\\headerfile}.
-
- \target legalese-command
- \section1 \\legalese
-
- The \\legalese and \\endlegalese commands delimit a license agreement.
-
- In the generated HTML, the delimited text is surrounded by a \b
- {<div class="LegaleseLeft">} and \b {</div>} tags.
-
- An example of a license agreement enclosed in \\legalese
- and \\endlegalese:
-
- \code
- / *!
- \legalese
- Copyright 1996 Daniel Dardailler.
-
- Permission to use, copy, modify, distribute, and sell this
- software for any purpose is hereby granted without fee,
- provided that the above copyright notice appear in all
- copies and that both that copyright notice and this
- permission notice appear in supporting documentation, and
- that the name of Daniel Dardailler not be used in
- advertising or publicity pertaining to distribution of the
- software without specific, written prior permission. Daniel
- Dardailler makes no representations about the suitability of
- this software for any purpose. It is provided "as is"
- without express or implied warranty.
-
- Modifications Copyright 1999 Matt Koss, under the same
- license as above.
- \endlegalese
- * /
- \endcode
-
- It will appear in the generated HTML as:
-
- \code
- <div class="LegaleseLeft">
- <p>Copyright 1996 Daniel Dardailler.</p>
- <p>Permission to use, copy, modify, distribute, and sell
- this software for any purpose is hereby granted without fee,
- provided that the above copyright notice appear in all
- copies and that both that copyright notice and this
- permission notice appear in supporting documentation, and
- that the name of Daniel Dardailler not be used in
- advertising or publicity pertaining to distribution of the
- software without specific, written prior permission. Daniel
- Dardailler makes no representations about the suitability of
- this software for any purpose. It is provided "as is"
- without express or implied warranty.</p>
-
- <p>Modifications Copyright 1999 Matt Koss, under the same
- license as above.</p>
- </div>
- \endcode
-
- If the \\endlegalese command is omitted, QDoc will process the
- \\legalese command but considers the rest of the documentation
- page as the license agreement.
-
- Ideally, the license text is located with the licensed code.
-
- Elsewhere, the documentation identified as \e{\\legalese} command
- can be accumulated using \l {generatelist-command} {\\generatelist}
- with \c {legalese-command} as the argument. This is useful for
- generating an overview of the license agreements associated with
- the source code.
-
- \target warning-command
- \section1 \\warning
-
- The \\warning command prepends "Warning:" to the command's
- argument, in bold font.
-
- \code
- / *!
- Qt::HANDLE is a platform-specific handle type
- for system objects. This is equivalent to
- \c{void *} on Windows and OS X, and to
- \c{unsigned long} on X11.
-
- \warning Using this type is not portable.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- Qt::HANDLE is a platform-specific handle type
- for system objects. This is equivalent to
- \c{void *} on Windows and OS X, and to
- \c{unsigned long} on X11.
-
- \warning Using this type is not portable.
- \endquotation
-
-*/
-
-
-/*!
- \page 12-0-qdoc-commands-miscellaneous.html
- \previouspage Special Content
- \contentspage QDoc Manual
- \nextpage Creating DITA Maps
-
- \title Miscellaneous
-
- These commands provide miscellaneous functions connected to the
- visual appearance of the documentation, and to the process of
- generating the documentation.
-
- \target annotatedlist-command
- \section1 \\annotatedlist
-
- The \\annotatedlist command expands to a list of the members of a
- group, each member listed with its \e {brief} text. Below is an
- example from the Qt Reference Documentation:
-
- \code
- / *!
- ...
- \section1 Drag and Drop Classes
-
- These classes deal with drag and drop and the necessary mime type
- encoding and decoding.
-
- \annotatedlist draganddrop
-
- * /
- \endcode
-
- This generates a list of all the C++ classes and/or QML types in
- the \e{draganddrop} group. A C++ class or QML type in the
- \e{draganddrop} group will have \e{\\ingroup draganddrop} in its
- \e{\\class} or \e{\\qmltype} comment.
-
-
- \target generatelist-command
- \section1 \\generatelist
-
- The \\generatelist command expands to a list of links to the
- documentation entities in a group. Below is an example from the Qt
- Reference Documentation:
-
- \code
- / *!
- \page classes.html
- \title All Classes
-
- For a shorter list that only includes the most
- frequently used classes, see \l{Qt's Main Classes}.
-
- \generatelist classes Q
- * /
- \endcode
-
- This generates the \e {All Classes} page. The command accepts the
- following arguments:
-
- \target table example
- \section2 \c annotatedclasses
-
- The \c annotatedclasses argument provides a table containing the
- names of all the classes, and a description of each class. Each
- class name is a link to the class's reference documentation. For
- example:
-
- \table
- \row
- \li QDial
- \li Rounded range control (like a speedometer or potentiometer)
- \row
- \li QDialog
- \li The base class of dialog windows
- \row
- \li QDir
- \li Access to directory structures and their contents
- \endtable
-
- A C++ class is documented with the \l {class-command} {\\class}
- command. The annotation for the class is taken from the argument
- of the class comment's \l {brief-command} {\\brief} command.
-
- \target list example
- \section2 \c {classes <prefix>}
-
- The \c classes argument provides a complete alphabetical list of
- the classes. The second argument, \c{<prefix>}, is the common
- prefix for the class names. The class names will be sorted on the
- character that follows the common prefix. e.g. The common prefix
- for the Qt classes is \c Q. The common prefix argument is
- optional. If no common prefix is provided, the class names will
- be sorted on their first character.
-
- Each class name becomes a link to the class's reference
- documentation. This command is used to generate the
- \e {All Classes} page this way:
-
- \code
- / *!
- \page classes.html
- \title All Classes
- \ingroup classlists
-
- \brief Alphabetical list of classes.
-
- This is a list of all Qt classes. For a list of the classes
- provided for compatibility with Qt3, see \l{Qt3 Support
- Classes}. For classes that have been deprecated, see the
- \l{Obsolete Classes} list.
-
- \generatelist classes Q
- * /
- \endcode
-
- A C++ class is documented with the \l {class-command} {\\class}
- command.
-
- \section2 \c classesbymodule
-
- When this argument is used, a second argument is required, which
- specifies the module whose classes are to be listed. QDoc
- generates a table containing those classes. Each class is listed
- with the text of its \l{brief-command} {\\brief} command.
-
- For example, this command can be used on a module page as follows:
-
- \code
- / *!
- \page phonon-module.html
- \module Phonon
- \title Phonon Module
- \ingroup modules
-
- \brief Contains namespaces and classes for multimedia functionality.
-
- \generatelist{classesbymodule Phonon}
-
- ...
-
- * /
- \endcode
-
- Each class that is a member of the specified module must be marked
- with the \l {inmodule-command} {\\inmodule} command in its \\class
- comment.
-
- \section2 \c compatclasses
-
- The \c compatclasses argument generates a list in alphabetical
- order of the support classes. It is normally used only to
- generate the Qt3 Support Classes page this way:
-
- \code
- / *!
- \page compatclasses.html
- \title Qt3 Support Classes
- \ingroup classlists
-
- \brief Enable porting of code from Qt 3 to Qt 4.
-
- These are the classes that Qt provides for compatibility with Qt
- 3. Most of these are provided by the Qt3Support module.
-
- \generatelist compatclasses
- * /
- \endcode
-
- A support class is identified in the \\class comment with the \l
- {compat-command} {\\compat} command.
-
- \section2 \c functionindex
-
- The \c functionindex argument provides a complete alphabetical
- list of all the documented member functions. It is normally used
- only to generate the \e {Qt function index} page
- this way:
-
- \code
- / *!
- \page functions.html
- \title All Functions
- \ingroup funclists
-
- \brief All documented Qt functions listed alphabetically with a
- link to where each one is declared.
-
- This is the list of all documented member functions and global
- functions in the Qt API. Each function has a link to the
- class or header file where it is declared and documented.
-
- \generatelist functionindex
- * /
- \endcode
-
- \section2 \c legalese
-
- The \c legalese argument tells QDoc to generate a complete list of
- licenses in the documentation. Each license is identified using
- the \l {legalese-command} {\\legalese} command. This command is
- used to generate the \e {Qt license information}
- page this way:
-
- \code
- / *!
- \page licenses.html
- \title Other Licenses Used in Qt
- \ingroup licensing
- \brief Information about other licenses used for Qt components and third-party code.
-
- Qt contains some code that is not provided under the
- \l{GNU General Public License (GPL)},
- \l{GNU Lesser General Public License (LGPL)} or the
- \l{Qt Commercial Edition}{Qt Commercial License Agreement}, but rather under
- specific licenses from the original authors. Some pieces of code were developed
- by The Qt Company and others originated from third parties.
- This page lists the licenses used, names the authors, and links
- to the places where it is used.
-
- The Qt Company gratefully acknowledges these and other contributions
- to Qt. We recommend that programs that use Qt also acknowledge
- these contributions, and quote these license statements in an
- appendix to the documentation.
-
- See also: \l{Licenses for Fonts Used in Qt for Embedded Linux}
-
- \generatelist legalese
- * /
- \endcode
-
- \section2 \c overviews
-
- The \c overviews argument is used to tell QDoc to generate a list
- by concatenating the contents of all the \l {group-command}
- {\\group} pages. Qt uses it to generate the \e {overviews} page
- this way:
-
- \code
- / *!
- \page overviews.html
-
- \title All Overviews and HOWTOs
-
- \generatelist overviews
- * /
- \endcode
-
- \section2 \c related
-
- The \c related argument is used in combination with the \l
- {group-command} {\\group} and \l {ingroup-command} {\\ingroup}
- commands to list all the overviews related to a specified
- group. For example, the page for the \e {Programming with Qt}
- page is generated this way:
-
- \code
- / *!
- \group qt-basic-concepts
- \title Programming with Qt
-
- \brief The basic architecture of the Qt cross-platform application and UI framework.
-
- Qt is a cross-platform application and UI framework for
- writing web-enabled applications for desktop, mobile, and
- embedded operating systems. This page contains links to
- articles and overviews explaining key components and
- techniuqes used in Qt development.
-
- \generatelist {related}
- * /
- \endcode
-
- Each page listed on this group page contains the command:
-
- \code
- \ingroup qt-basic-concepts
- \endcode
-
- \target if-command
- \section1 \\if
-
- The \\if command and the corresponding \\endif command
- enclose parts of a QDoc comment that only will be included if
- the condition specified by the command's argument is true.
-
- The command reads the rest of the line and parses it as an C++ #if
- statement.
-
- \code
- / *!
- \if defined(opensourceedition)
-
- \b{Note:} This edition is for the development of
- \l{Qt Open Source Edition} {Free and Open Source}
- software only; see \l{Qt Commercial Editions}.
-
- \endif
- * /
- \endcode
-
- This QDoc comment will only be rendered if the \c
- opensourceedition preprocessor symbol is defined, and specified in
- the \l {defines-variable} {defines} variable in the configuration
- file to make QDoc process the code within #ifdef and #endif:
-
- \code
- defines = opensourceedition
- \endcode
-
- You can also define the preprocessor symbol manually on the
- command line. For more information see the documentation of the \l
- {defines-variable} {defines} variable.
-
- See also \l{endif-command} {\\endif}, \l{else-command} {\\else},
- \l {defines-variable} {defines} and \l {falsehoods-variable}
- {falsehoods}.
-
- \target endif-command
- \section1 \\endif
-
- The \\endif command and the corresponding \\if command
- enclose parts of a QDoc comment that will be included if
- the condition specified by the \l {if-command} {\\if} command's
- argument is true.
-
- For more information, see the documentation of the \l {if-command}
- {\\if} command.
-
- See also \l{if-command} {\\if}, \l{else-command} {\\else}, \l
- {defines-variable} {defines} and \l {falsehoods-variable}
- {falsehoods}.
-
- \target else-command
- \section1 \\else
-
- The \\else command specifies an alternative if the
- condition in the \l {if-command} {\\if} command is false.
-
- The \\else command can only be used within \l {if-command}
- {\\if...\\endif} commands, but is useful when there is only two
- alternatives.
-
- \code
- / *!
- The Qt 3 support library is provided to keep old
- source code working.
-
- In addition to the \c Qt3Support classes, Qt 4 provides
- compatibility functions when it's possible for an old
- API to cohabit with the new one.
-
- \if !defined(QT3_SUPPORT)
- \if defined(QT3_SUPPORTWARNINGS)
- The compiler emits a warning when a
- compatibility function is called. (This works
- only with GCC 3.2+ and MSVC 7.)
- \else
- To use the Qt 3 support library, you need to
- have the line QT += qt3support in your .pro
- file (qmake automatically define the
- QT3_SUPPORT symbol, turning on compatibility
- function support).
-
- You can also define the symbol manually (for example,
- if you don't want to link against the \c
- Qt3Support library), or you can define \c
- QT3_SUPPORT_WARNINGS instead, telling the
- compiler to emit a warning when a compatibility
- function is called. (This works only with GCC
- 3.2+ and MSVC 7.)
- \endif
- \endif
- * /
- \endcode
-
- If the \c QT3_SUPPORT is defined, the comment will be rendered
- like this:
-
- \quotation
- The Qt 3 support library is provided to keep old source
- code working.
-
- In addition to the Qt3Support classes, Qt 4 provides
- compatibility functions when it's possible for an old
- API to cohabit with the new one.
- \endquotation
-
- If \c QT3_SUPPORT is not defined but \c QT3_SUPPORT_WARNINGS is
- defined, the comment will be rendered like this:
-
- \quotation
- The Qt 3 support library is provided to keep old source
- code working.
-
- In addition to the Qt3Support classes, Qt 4 provides
- compatibility functions when it's possible for an old
- API to cohabit with the new one.
-
- The compiler emits a warning when a compatibility
- function is called. (This works only with GCC 3.2+ and
- MSVC 7.)
- \endquotation
-
- If none of the symbols are defined, the comment will be
- rendered as
-
- \quotation
- The Qt 3 support library is provided to keep old
- source code working.
-
- In addition to the \c Qt3Support classes, Qt 4 provides
- compatibility functions when it's possible for an old
- API to cohabit with the new one.
-
- To use the Qt 3 support library, you need to have the
- line QT += qt3support in your .pro file (qmake
- automatically define the QT3_SUPPORT symbol, turning on
- compatibility function support).
-
- You can also define the symbol manually (e.g., if you
- don't want to link against the \c Qt3Support library),
- or you can define \c QT3_SUPPORT_WARNINGS instead,
- telling the compiler to emit a warning when a
- compatibility function is called. (This works only with
- GCC 3.2+ and MSVC 7.)
- \endquotation
-
- See also \l{if-command} {\\if}, \l{endif-command} {\\endif}, \l
- {defines-variable} {defines} and \l {falsehoods-variable}
- {falsehoods}.
-
- \target include-command
- \section1 \\include
-
- The \\include command sends all or part of the file specified by
- its first argument to the QDoc input stream to be processed as a
- QDoc comment snippet. This command is often assigned the alias,
- \e {input}, in the QDoc configuration file, for example \e {alias.include
- = input}.
-
- The command is useful when some snippet of commands and text is to
- be used in multiple places in the documentation. In that case,
- move the snippet into a separate file and use the \\include
- command wherever you want to insert the snippet into the
- documentation. To prevent QDoc from reading the file as a
- stand-alone page of documentation, we recommend that you use the
- \c .qdocinc extension for these \e {include} files.
-
- The command can have either one or two arguments. The first
- argument is always a file name. The contents of the file must be
- QDoc input, in other words, a sequence of QDoc commands and text, but
- without the enclosing QDoc comment \c{/}\c{*!} ... \c{*}\c{/} delimiters.
- If you want to include the entire named file, don't use the second
- argument. If you want to include only part of the file, see the
- \l{2-argument-form}{two argument form} below. Here is an example
- of the one argument form:
-
- \code
- / *!
- \page corefeatures.html
- \title Core Features
-
- \include examples/signalandslots.qdocinc
- \include examples/objectmodel.qdocinc
- \include examples/layoutmanagement.qdocinc
- * /
- \endcode
-
- QDoc renders this page \l{corefeatures.html} {as shown here}.
-
- \target 2-argument-form}
- \section2 \\include filename snippet-identifier
-
- It is a waste of time to make a separate \c .qdocinc file for every
- QDoc include snippet you want to use in multiple places in the
- documentation, especially given that you probably have to put the
- copyright/license notice in every one of these files. So if you
- have a large number of snippets to be included, you can put them all in a
- single file if you want, and surround each one with:
- \code
- //! [snippet-id1]
-
- QDoc commands and text...
-
- //! [snippet-id1]
-
- //! [snippet-id2]
-
- More QDoc commands and text...
-
- //! [snippet-id2]
- \endcode
-
- Then you can use the two-argument form of the command:
-
- \code
- \input examples/signalandslots.qdocinc snippet-id2
- \input examples/objectmodel.qdocinc another-snippet-id
- \endcode
-
- It works as expected. The sequence of QDoc commands and text found
- between the two tags with the same name as the second argument is
- sent to the QDoc input stream. You can even nest these snippets,
- although it's not clear why you would want to do that.
-
- \target meta-command
- \section1 \\meta
-
- The \\meta command is mainly used for including metadata in DITA
- XML files. It is also used when generating HTML output for specifying
- the \e maintainer(s) of a C++ class.
-
- The command has two arguments: the first argument is the name of the
- metadata attribute, and the second argument is the
- value for the attribute. Each argument should be enclosed in curly
- brackets, as shown in this example:
-
- \code
- / *!
- \class QWidget
- \brief The QWidget class is the base class of all user interface objects.
-
- \ingroup basicwidgets
-
- \meta {technology} {User Interface}
- \meta {platform} {OS X 10.6}
- \meta {platform} {Symbian}
- \meta {platform} {MeeGo}
- \meta {audience} {user}
- \meta {audience} {programmer}
- \meta {audience} {designer}
- * /
- \endcode
-
- When running QDoc to generate HTML, the example above will have no
- effect on the generated output, but if you run QDoc to generate
- DITA XML, the example will generate the following:
-
- \code
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE cxxClass PUBLIC "-//NOKIA//DTD DITA C++ API Class Reference Type v0.6.0//EN" "dtd/cxxClass.dtd">
- <!--qwidget.cpp-->
- <cxxClass id="id-9a14268e-6b09-4eee-b940-21a00a0961df">
- <apiName>QWidget</apiName>
- <shortdesc>the QWidget class is the base class of all user interface objects.</shortdesc>
- <prolog>
- <author>Qt Development Frameworks</author>
- <publisher>Qt Project</publisher>
- <copyright>
- <copyryear year="2015"/>
- <copyrholder>Qt Project</copyrholder>
- </copyright>
- <permissions view="all"/>
- <metadata>
- <audience type="designer"/>
- <audience type="programmer"/>
- <audience type="user"/>
- <category>Class reference</category>
- <prodinfo>
- <prodname>Qt Reference Documentation</prodname>
- <vrmlist>
- <vrm version="4" release="7" modification="3"/>
- </vrmlist>
- <component>QtGui</component>
- </prodinfo>
- <othermeta name="platform" content="MeeGo"/>
- <othermeta name="platform" content="Symbian"/>
- <othermeta name="platform" content="OS X 10.6"/>
- <othermeta name="technology" content="User Interface"/>
- </metadata>
- </prolog>
- \endcode
-
- In the example output, several values have been set using default
- values obtained from the QDoc configuration file. See \l
- {Generating DITA XML Output} for details.
-
- \target omit-command
- \section1 \\omit
-
- The \\omit command and the corresponding \\endomit command
- delimit parts of the documentation that you want QDoc to skip. For
- example:
-
- \code
- / *!
- \table
- \row
- \li Basic Widgets
- \li Basic GUI widgets such as buttons, comboboxes
- and scrollbars.
-
- \omit
- \row
- \li Component Model
- \li Interfaces and helper classes for the Qt
- Component Model.
- \endomit
-
- \row
- \li Database Classes
- \li Database related classes, e.g. for SQL databases.
- \endtable
- * /
- \endcode
-
- QDoc renders this as:
-
- \raw HTML
- <table align="center" cellpadding="2"
- cellspacing="1" border="0">
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>Basic Widgets</td>
- <td>Basic GUI widgets such as buttons, comboboxes
- and scrollbars.</td>
- </tr>
-
- <tr valign="top" bgcolor="#c0c0c0">
- <td>Database Classes</td>
- <td>Database related classes, e.g. for SQL databases.</td>
- </tr>
- </table>
- \endraw
-
- \target raw-command
- \section1 \\raw \span {class="newStuff"} {(avoid)}
-
- The \\raw command and the corresponding
- \\endraw command delimit a block of raw mark-up language code.
-
- \note Avoid using this command if possible, because it generates
- DITA XML code that causes problems. If you are trying to generate
- special table or list behavior, try to get the behavior you want
- using the \l {span-command} {\\span} and \l {div-command} {\\div}
- commands in your \l {table-command} {\\table} or \l {list-command}
- {\\list}.
-
- The command takes an argument specifying the code's format.
- Currently, the only supported format is HTML.
-
- The \\raw command is useful if you want some special HTML effects
- in your documentation.
-
- \code
- / *!
- Qt has some predefined QColor objects.
-
- \raw HTML
- <style type="text/css" id="colorstyles">
- #color-blue { background-color: #0000ff; color: #ffffff }
- #color-darkBlue { background-color: #000080; color: #ffffff }
- #color-cyan { background-color: #00ffff; color: #000000 }
- </style>
-
- <p>
- <tt id="color-blue">Blue(#0000ff)</tt>,
- <tt id="color-darkBlue">dark blue(#000080)</tt> and
- <tt id="color-cyan">cyan(#00ffff)</tt>.
- </p>
- \endraw
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- Qt has some predefined QColor objects.
-
- \raw HTML
- <style type="text/css" id="colorstyles">
- #color-blue { background-color: #0000ff; color: #ffffff }
- #color-darkBlue { background-color: #000080; color: #ffffff }
- #color-cyan { background-color: #00ffff; color: #000000 }
- </style>
-
- <p>
- <tt id="color-blue">Blue(#0000ff)</tt>,
- <tt id="color-darkBlue">dark blue(#000080)</tt> and
- <tt id="color-cyan">cyan(#00ffff)</tt>.
- </p>
- \endraw
- \endquotation
-
- \note But you can achieve the exact same thing using qdoc
- commands. In this case, all you have to do is include the color
- styles in your style.css file. Then you can write:
-
- \code
- \tt {\span {id="color-blue"} {Blue(#0000ff)}},
- \tt {\span {id="color-darkBlue"} {dark blue(#000080)}} and
- \tt {\span {id="color-cyan"} {cyan(#00ffff)}}.
- \endcode
-
- ...which is rendered as:
-
- \tt {\span {id="color-blue"} {Blue(#0000ff)}},
- \tt {\span {id="color-darkBlue"} {dark blue(#000080)}} and
- \tt {\span {id="color-cyan"} {cyan(#00ffff)}}.
-
- \target unicode-command
- \section1 \\unicode
-
- The \\unicode command allows you to insert an arbitrary Unicode
- character in the document.
-
- The command takes an argument specifying the character as an
- integer. By default, base 10 is assumed, unless a '0x' or '0'
- prefix is specified (for base 16 and 8, respectively). For
- example:
-
- \code
- O G\unicode{0xEA}nio e as Rosas
-
- \unicode 0xC0 table en famille avec 15 \unicode 0x20AC par jour
-
- \unicode 0x3A3 \e{a}\sub{\e{i}}
- \endcode
-
- QDoc renders this as:
-
- \quotation
- O G\unicode{0xEA}nio e as Rosas
-
- \unicode 0xC0 table en famille avec 15 \unicode 0x20AC par jour
-
- \unicode 0x3A3 \e{a}\sub{\e{i}}
- \endquotation
-*/
-
diff --git a/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc
deleted file mode 100644
index 226c107e3a..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc
+++ /dev/null
@@ -1,1609 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 21-0-qdoc-configuration.html
- \previouspage Creating DITA Maps
- \contentspage QDoc Manual
- \nextpage Generic Configuration Variables
-
- \title The QDoc Configuration File
-
- Before running QDoc, you must create a QDoc configuration file to
- tell QDoc where to find the source files that contain the QDoc
- comments. The pathname to your configuration file is passed to
- QDoc on the command line:
-
- \quotation
- \c {/current/dir$ ../../bin/qdoc ./config.qdocconf}
- \endquotation
-
- \section1 General Description
-
- The configuration file is a list of entries of the form \e
- {"variable = value"}. Using the configuration variables, you can
- define where QDoc should find the various source files, images and
- examples, where to put generated documentation etc. The
- configuration file can also contain directives like \c
- include. For an example, see \l {minimal-qdocconf}{a minimal qdocconf file}.
-
- You can also use configuration variables to get QDoc to support
- \l{Supporting Derived Projects} {derived projects}, i.e QDoc can
- generate links in your project's documentation to elements in the
- Qt online documentation. See the \l {Supporting Derived projects}
- section.
-
- The value of a configuration variable can be set using either '='
- or '+='. The difference is that '=' overrides the previous value,
- while '+=' adds a new value to the current one.
-
- Some configuration variables accept a list of strings as their
- value, for example:
- \l {sourcedirs-variable}
- {\c{sourcedirs}}, while others accept only a single string. Double
- quotes around a value string are optional, but including them allows
- you to use special characters like '=' and ' \" ' within the value
- string, for example:
-
- \code
- HTML.postheader = "<a href=\"index.html\">Home</a>"
- \endcode
-
- If an entry spans many lines, use a backslash at the end of every
- line but the last:
-
- \code
- sourcedirs = kernel \
- tools \
- widgets
- \endcode
-
- \section1 Configuration Variables
-
- \section1 Variable List
-
- \list
- \li \l {alias-variable} {alias}
- \li \l {Cpp.ignoredirectives-variable} {Cpp.ignoredirectives}
- \li \l {Cpp.ignoretokens-variable} {Cpp.ignoretokens}
- \li \l {defines-variable} {defines}
- \li \l {edition-variable} {edition}
- \li \l {exampledirs-variable} {exampledirs}
- \li \l {examples-variable} {examples}
- \li \l {examples.fileextensions-variable} {examples.fileextensions}
- \li \l {excludedirs-variable} {excludedirs}
- \li \l {excludefiles-variable} {excludefiles}
- \li \l {extraimages-variable} {extraimages}
- \li \l {falsehoods-variable} {falsehoods}
- \li \l {headerdirs-variable} {headerdirs}
- \li \l {headers-variable} {headers}
- \li \l {headers.fileextensions-variable} {headers.fileextensions}
- \li \l {HTML.footer-variable} {HTML.footer}
- \li \l {HTML.postheader-variable} {HTML.postheader}
- \li \l {HTML.style-variable} {HTML.style}
- \li \l {imagedirs-variable} {imagedirs}
- \li \l {images-variable} {images}
- \li \l {images.fileextensions-variable} {images.fileextensions}
- \li \l {language-variable} {language}
- \li \l {macro-variable} {macro}
- \li \l {manifestmeta-variable} {manifestmeta}
- \li \l {outputdir-variable} {outputdir}
- \li \l {outputformats-variable} {outputformats}
- \li \l {sourcedirs-variable} {sourcedirs}
- \li \l {sources-variable} {sources}
- \li \l {sources.fileextensions-variable} {sources.fileextensions}
- \li \l {spurious-variable} {spurious}
- \li \l {tabsize-variable} {tabsize}
- \li \l {version-variable} {version}
- \li \l {versionsym-variable} {versionsym}
- \endlist
-
- \section1 Categories
-
- \list
- \li \l {Generic Configuration Variables}
- \li \l {C++ Specific Configuration Variables}
- \li \l {HTML Specific Configuration Variables}
- \endlist
-
- \section1 Configuration File Examples
-
- \list
- \li A minimum configuration file: \l minimum.qdocconf
- \li The Qt configuration file: \l qtgui.qdocconf
- \endlist
-*/
-
-
-/*!
- \page 22-qdoc-configuration-generalvariables.html
- \previouspage The QDoc Configuration File
- \contentspage QDoc Manual
- \nextpage Creating Help Project Files
-
- \title Generic Configuration Variables
-
- With the general QDoc configuration variables, you can define
- where QDoc will find the various source files it needs to generate
- the documentation, as well as the directory to put the generated
- documentation. You can also do some minor manipulation of QDoc
- itself, controlling its output and processing behavior.
-
- \target alias-variable
- \section1 alias
-
- The \c alias variable renames a QDoc command.
-
- The general syntax is \tt {alias.\e{original-command-name} = \e
- temporary-command-name}.
-
- \code
- alias.e = i
- \endcode
-
- This renames the built-in command \\e (italics) to be \\i. The \c
- alias variable is often used for compatibility reasons.
-
- See also \l {macro-variable} {macro}.
-
- \target codeindent-variable
- \section1 codeindent
-
- The \c codeindent variable specifies the level of indentation that
- QDoc uses when writing code snippets.
-
- QDoc originally used a hard-coded value of four spaces for code
- indentation to ensure that code snippets could be easily
- distinguished from surrounding text. Since we can use \l{HTML
- Specific Configuration Variables#HTML.stylesheets} {stylesheets}
- to adjust the appearance of certain types of HTML elements, this
- level of indentation is not always required.
-
- \target defines-variable
- \section1 defines
-
- The \c defines variable specifies the C++ preprocessor symbols
- that QDoc will recognize and respond to.
-
- When a preprocessor symbol is specified using the \c defines
- variable, you can also use the \l {if-command} {\\if} command to
- enclose documentation that only will be included if the
- preprocessor symbol is defined.
-
- The values of the variable are regular expressions (see QRegExp
- for details). By default, no symbol is defined, meaning that code
- protected with #ifdef...#endif will be ignored.
-
- \code
- defines = Q_QDOC \
- QT_.*_SUPPORT \
- QT_.*_LIB \
- QT_COMPAT \
- QT3_SUPPORT \
- Q_OS_.* \
- Q_BYTE_ORDER \
- __cplusplus
- \endcode
-
- This ensures that QDoc will process the code that requires these
- symbols to be defined. For example:
-
- \code
- #ifdef Q_OS_WIN
- HDC getDC() const;
- void releaseDC(HDC) const;
- #endif
- \endcode
-
- Since the Q_OS_.* regular expression (specified using the \c
- defines variable) matches Q_OS_WIN, QDoc will process the code
- within #ifdef and #endif in our example.
-
- You can also define preprocessor symbols manually on the command
- line using the -D option. For example:
-
- \code
- currentdirectory$ qdoc -Dconsoleedition qtgui.qdocconf
- \endcode
-
- In this case the -D option ensures that the \c consoleedition
- preprocessor symbol is defined when QDoc processes the source
- files defined in the qtgui.qdocconf file.
-
- See also \l {falsehoods-variable} {falsehoods} and \l {if-command} {\\if}.
-
- \target edition-variable
- \section1 edition
-
- The \c edition variable specifies which modules are included in
- each edition of a package, and provides QDoc with information to
- provide class lists for each edition.
-
- This feature is mostly used when providing documentation for Qt
- packages.
-
- The \c edition variable is always used with a particular edition
- name to define the modules for that edition:
-
- \code
- edition.Console = QtCore QtNetwork QtSql QtXml
- edition.Desktop = QtCore QtGui QtNetwork QtOpenGL QtSql QtXml \
- QtDesigner QtAssistant Qt3Support QAxContainer \
- QAxServer
- edition.DesktopLight = QtCore QtGui Qt3SupportLight
- \endcode
-
- In the above examples, the \c Console edition only includes the
- contents of four modules. Only the classes from these modules will
- be used when the \l{Miscellaneous#generatelist-command}
- {generatelist} command is used to generate a list of classes for
- this edition:
-
- \code
- \generatelist{classesbyedition Console}
- \endcode
-
- \target exampledirs-variable
- \section1 exampledirs
-
- The \c exampledirs variable specifies the directories containing
- the source code of the example files.
-
- The \l {examples-variable} {examples} and \l
- {exampledirs-variable} {exampledirs} variables are used by the \l
- {quotefromfile-command} {\\quotefromfile}, \l {quotefile-command}
- {\\quotefile} and \l {example-command} {\\example} commands. If
- both the \l {examples-variable} {examples} and \l
- {exampledirs-variable} {exampledirs} variables are defined, QDoc
- will search in both, first in \l {examples-variable} {examples}
- then in \l {exampledirs-variable} {exampledirs}.
-
- QDoc will search through the directories in the specified order,
- and accept the first matching file it finds. It will only search
- in the specified directories, \e not in subdirectories.
-
- \code
- exampledirs = $QTDIR/doc/src \
- $QTDIR/examples \
- $QTDIR \
- $QTDIR/qmake/examples
-
- examples = $QTDIR/examples/widgets/analogclock/analogclock.cpp
- \endcode
-
- When processing
-
- \code
- \quotefromfile widgets/calculator/calculator.cpp
- \endcode
-
- QDoc will see if there is a file called \c calculator.cpp
- listed as a value in the \l {examples-variable} {\c examples} variable. If
- there isn't, it will search in the \c exampledirs variable, and
- first see if there exists a file called
-
- \code
- $QTDIR/doc/src/widgets/calculator/calculator.cpp
- \endcode
-
- If it doesn't, QDoc will continue looking for a file called
-
- \code
- $QTDIR/examples/widgets/calculator/calculator.cpp
- \endcode
-
- and so forth.
-
- See also \l {examples-variable}{examples}.
-
- \target examples-variable
- \section1 examples
-
- The \c examples variable allows you to specify individual example
- files in addition to those located in the directories specified by
- the \l {exampledirs-variable} {\c exampledirs} variable.
-
- The \c examples and \l {exampledirs-variable} {\c exampledirs}
- variables are used by the \l {quotefromfile-command}
- {\\quotefromfile}, \l {quotefile-command} {\\quotefile} and \l
- {example-command} {\\example} commands. If both the \c examples and \l
- {exampledirs-variable} {\c exampledirs} variables are defined,
- QDoc will search in both, first in \c examples then in \l
- {exampledirs-variable} {\c exampledirs}.
-
- QDoc will search through the values listed for the \c examples
- variable, in the specified order, and accept the first one it
- finds.
-
- For an extensive example, see the \l {exampledirs-variable} {\c
- exampledirs} command. But note that if you know the file is listed
- in the \c examples variable, you don't need to specify its path:
-
- \code
- \quotefromfile calculator.cpp
- \endcode
-
- See also \l {exampledirs-variable} {exampledirs}.
-
- \target examples.fileextensions-variable
- \section1 examples.fileextensions
-
- The \c examples.fileextensions variable specifies the file
- extensions that qdoc will look for when collecting example files
- for display in the documentation.
-
- The default extensions are *.cpp, *.h, *.js, *.xq, *.svg, *.xml
- and *.ui.
-
- The extensions are given as standard wildcard expressions. You
- can add a file extension to the filter using '+='. For example:
-
- \code
- examples.fileextensions += *.qrc
- \endcode
-
- See also \l{headers.fileextensions}.
-
- \target excludedirs-variable
- \section1 excludedirs
-
- The \c excludedirs variable is for listing directories that should \e{not}
- be processed by qdoc, even if the same directories are included by the
- \l {sourcedirs-variable} {sourcedirs} or \l {headerdirs-variable} {headerdirs}
- variables.
-
- For example:
-
- \code
- sourcedirs = src/corelib
- excludedirs = src/corelib/tmp
- \endcode
-
- When executed, QDoc will exclude the listed directories from
- further consideration. Files in these directories will not be
- read by qdoc.
-
- See also \l {excludefiles-variable} {excludefiles}.
-
- \target excludefiles-variable
- \section1 excludefiles
-
- The \c excludefiles variable allows you to specify individual files
- that should \e{not} be processed by qdoc.
-
- \code
- excludefiles += $QT_CORE_SOURCES/../../src/widgets/kernel/qwidget.h \
- $QT_CORE_SOURCES/../../src/widgets/kernel/qwidget.cpp
- \endcode
-
- If you include the above in your qdocconf file for qtbase, there
- will be no qwidget.html generated for html and no qwidget.xml
- generated for DITA XML.
-
- See also \l {excludedirs-variable} {excludedirs}.
-
- \target extraimages-variable
- \section1 extraimages
-
- The \c extraimages variable tells QDoc to incorporate specific
- images in the generated documentation.
-
- QDoc will not recognize images used within HTML (or any other
- markup language). If we want the images to be copied from the
- directories specified by \l {imagedirs} {\c imagedirs} (the images
- in question must be located in these directories) to the output
- directory, we must specify the images using the \c extraimages
- variable.
-
- The general syntax is \tt {extraimages.\e{format} = \e image}. The
- file extension is optional.
-
- For example, in \l qtgui.qdocconf we use a couple of images within
- the HTML.postheader variable which value is pure HTML. For that
- reason, these images are specified using the \c extraimages
- variable:
-
- \code
- extraimages.HTML = qt-logo
- \endcode
-
- See also \l images and \l imagedirs.
-
- \target falsehoods-variable
- \section1 falsehoods
-
- The \c falsehoods variable defines the truth value of specified
- preprocessor symbols as false.
-
- If this variable is not set for a preprocessor symbol, QDoc
- assumes its truth value is true. The exception is '0', which value
- always is false.
-
- QDoc will recognize, and is able to evaluate, the following
- preprocessor syntax:
-
- \code
- #ifdef NOTYET
- ...
- #endif
-
- #if defined (NOTYET)
- ...
- #end if
- \endcode
-
- However, faced with unknown syntax like
-
- \code
- #if NOTYET
- ...
- #endif
- \endcode
-
- QDoc will evaluate it as true by default, \e unless the
- preprocessor symbol is specified within the \c falsehoods variable
- entry:
-
- \code
- falsehoods = NOTYET
- \endcode
-
- See also \l defines.
-
- \target generateindex-variable
- \section1 generateindex
-
- The \c generateindex variable contains a boolean value that
- specifies whether to generate an index file when HTML
- documentation is generated.
-
- By default, an index file is always generated with HTML
- documentation, so this variable is typically only used when
- disabling this feature (by setting the value to \c false) or when
- enabling index generation for the WebXML output (by setting the
- value to \c true).
-
- \target headerdirs-variable
- \section1 headerdirs
-
- The \c headerdirs variable specifies the directories containing
- the header files associated with the \c .cpp source files used in
- the documentation.
-
- \code
- headerdirs = $QTDIR/src \
- $QTDIR/extensions/activeqt \
- $QTDIR/extensions/motif \
- $QTDIR/tools/designer/src/lib/extension \
- $QTDIR/tools/designer/src/lib/sdk \
- $QTDIR/tools/designer/src/lib/uilib
- \endcode
-
- When executed, the first thing QDoc will do is to read through the
- headers specified in the \l {headers} {\c headers} variable, and
- the ones located in the directories specified in the \c headerdir
- variable (including all subdirectories), building an internal
- structure of the classes and their functions.
-
- Then it will read through the sources specified in the \l
- {sources-variable} {\c sources}, and the ones located in the
- directories specified in the \l {sourcedirs-variable} {\c
- sourcedirs} varible (including all subdirectories), merging the
- documentation with the structure it retrieved from the header
- files.
-
- If both the \c headers and \c headerdirs variables are defined,
- QDoc will read through both, first \l {headers} {\c headers} then
- \c headerdirs.
-
- In the specified directories, QDoc will only read the files with
- the \c fileextensions specified in the \l {headers.fileextensions}
- {\c headers.fileextensions} variable. The default extensions are
- *.ch, *.h, *.h++, *.hh, *.hpp, and *.hxx". The files specified by
- \l {headers} {\c headers} will be read without taking into account
- their fileextensions.
-
- See also \l headers and \l headers.fileextensions.
-
- \target headers-variable
- \section1 headers
-
- The \c headers variable allows you to specify individual header
- files in addition to those located in the directories specified by
- the \l {headerdirs} {\c headerdirs} variable.
-
- \code
- headers = $QTDIR/src/gui/widgets/qlineedit.h \
- $QTDIR/src/gui/widgets/qpushbutton.h
- \endcode
-
- When processing the \c headers variable, QDoc behaves in the same
- way as it does when processing the \l {headerdirs} {\c headerdirs}
- variable. For more information, see the \l {headerdirs} {\c
- headerdirs} variable.
-
- See also \l headerdirs.
-
- \target headers.fileextensions-variable
- \section1 headers.fileextensions
-
- The \c headers.fileextensions variable specify the extension used
- by the headers.
-
- When processing the header files specified in the \l {headerdirs}
- {\c headerdirs} variable, QDoc will only read the files with the
- fileextensions specified in the \c headers.fileextensions
- variable. In this way QDoc avoids spending time reading irrelevant
- files.
-
- The default extensions are *.ch, *.h, *.h++, *.hh, *.hpp, and
- *.hxx.
-
- The extensions are given as standard wildcard expressions. You
- can add a file extension to the filter using '+='. For example:
-
- \code
- header.fileextensions += *.H
- \endcode
-
- \warning The above assignment may not work as described.
-
- See also \l headerdirs.
-
- \target imagedirs-variable
- \section1 imagedirs
-
- The \c imagedirs variable specifies the directories containing the
- images used in the documentation.
-
- The \l {images} {\c images} and \c imagedirs variables are used by
- the \l {image-command} {\\image} and \l {inlineimage-command}
- {\\inlineimage} commands. If both the \l {images} {\c images} and
- \c imagedirs variables are defined, QDoc will search in both. First
- in \l {images} {\c images}, then in \c imagedirs.
-
- QDoc will search through the directories in the specified order,
- and accept the first matching file it finds. It will only search
- in the specified directories, \e not in subdirectories.
-
- \code
- imagedirs = $QTDIR/doc/src/images \
- $QTDIR/examples
-
- images = $QTDIR/doc/src/images/calculator-example.png
- \endcode
-
- When processing
-
- \code
- \image calculator-example.png
- \endcode
-
- QDoc will then see if there is a file called
- calculator-example.png listed as a value in the \c images
- variable. If there isn't, it will search in the \c imagedirs
- variable for:
-
- \code
- $QTDIR/doc/src/images/calculator-example.png
- \endcode
-
- If the file doesn't exist, QDoc will look for a file called
-
- \code
- $QTDIR/examples/calculator-example.png
- \endcode
-
- You can filter the images in an image directory using the \l
- {images.fileextensions} {\c images.fileextensions} variable. The
- general idea behind the \l {images.fileextensions} {\c images.fileextensions}
- variable is to enable different image format for different output format.
-
- \warning The \l {images.fileextensions} {\c images.fileextensions}
- variable's functionality is preliminary since QDoc at this point
- only supports HTML.
-
- See also \l images and \l images.fileextensions.
-
- \target images-variable
- \section1 images
-
- The \c images variable allows you to specify individual image
- files in addition to those located in the directories specified by
- the \l {imagedirs} {\c imagedirs} variable.
-
- \code
- images = $QTDIR/doc/src/images/calculator-example.png
- \endcode
-
- When processing the \c images variable, QDoc behaves in the same
- way as it does when processing the \l {imagedirs} {\c imagedirs}
- variable. For more information, see the \l {imagedirs} {\c
- imagedirs} variable.
-
- See also \l imagedirs and \l images.fileextensions.
-
- \target images.fileextensions-variable
- \section1 images.fileextensions
-
- The images.fileextensions variable filters the files within an
- image directory.
-
- The variable's values (the extensions) are given as standard
- wildcard expressions. The general syntax is: \tt
- {images.fileextensions.\e{format} = *.\e{extension}}.
-
- The idea is to enable different image format for different output
- format.
-
- \code
- images.fileextensions.HTML = *.png
- images.fileextensions.LOUT = *.eps
- \endcode
-
- Then, when processing the \l {image-command} {\\image} and \l
- {inlineimage-command} {\\inlineimage} commands, QDoc will only
- search for files with extensions specified in the variable
- containing the list of output formats.
-
- \warning This is only a preliminary functionality since QDoc at this
- point only supports HTML.
-
- The default extensions for HTML are *.png, *.jpg, *.jpeg, and
- *.gif.
-
- You can add a file extension to the filter using '+='. For
- example:
-
- \code
- images.fileextensions.HTML += *.eps
- \endcode
-
- See also \l imagedirs and \l images.
-
- \target language-variable
- \section1 language
-
- The \c language variable specifies the language of the source code
- that is used in the documentation.
-
- Currently, C++ is the only language that QDoc understands. It is
- also the default language, and doesn't really need to be
- specified. However, a possible example of a language variable
- statement:
-
- \code
- language = Cpp
- \endcode
-
- This identifies C++ as the language of the Qt source code.
-
- \target macro-variable
- \section1 macro
-
- The \c macro variable is used to create your own simple QDoc
- commands. The syntax is \tt {macro.\e{command} = \e{definition}},
- where the definition is written using QDoc syntax.
-
- A macro variable can be restricted for use in one type of output
- generation. By appending \c {.HTML} to the macro name, for
- example, the macro is only used when generating HTML output. By
- appending \c {.DITAXML} to the macro name, the macro is only used
- when generating DITA XML.
-
- \code
- macro.gui = "\\b"
- macro.raisedaster.HTML = "<sup>*</sup>"
- \endcode
-
- The first macro defines the \\gui command to render its argument
- using a bold font. The second macro defines the \\raisedaster
- command to render a superscript asterisk, but only when generating
- HTML.
-
- See also \l {alias-variable} {alias}.
-
- \target manifestmeta-variable
- \section1 manifestmeta
-
- The \c manifestmeta variable specifies additional meta-content
- for the example manifest files generated by QDoc.
-
- See the \l{Manifest Meta Content} section for more information.
-
- \target naturallanguage-variable
- \section1 naturallanguage
-
- The \c naturallanguage variable specifies the natural language
- used for the documentation generated by qdoc.
-
- \code
- naturallanguage = zh-Hans
- \endcode
-
- By default, the natural language is \c en for compatibility with
- legacy documentation.
-
- qdoc will add the natural language information to the HTML it
- generates, using the \c lang and \c xml:lang attributes.
-
- See also \l {sourceencoding-variable} {sourceencoding},
- \l {outputencoding-variable} {outputencoding},
- \l{http://www.w3.org/TR/xhtml1/#C_7}
- {C.7. The lang and xml:lang Attributes} and
- \l{http://www.w3.org/TR/i18n-html-tech-lang/#ri20040429.113217290}
- {Best Practice 13: Using Hans and Hant codes}.
-
- \target outputdir-variable
- \section1 outputdir
-
- The \c outputdir variable specifies the directory where QDoc will
- put the generated documentation.
-
- \code
- outputdir = $QTDIR/doc/html
- \endcode
-
- locates the generated Qt reference documentation in
- $QTDIR/doc/html. For example, the documentation of the QWidget
- class is located in
-
- \code
- $QTDIR/doc/html/qwidget.html
- \endcode
-
- The associated images will be put in an \c images subdirectory.
-
- \warning When running QDoc multiple times using the same output
- directory, all files from the previous run will be lost.
-
- \target outputencoding-variable
- \section1 outputencoding
-
- The \c outputencoding variable specifies the encoding used for the
- documentation generated by qdoc.
-
- \code
- outputencoding = UTF-8
- \endcode
-
- By default, the output encoding is \c ISO-8859-1 (Latin1) for
- compatibility with legacy documentation. When generating
- documentation for some languages, particularly non-European
- languages, this is not sufficient and an encoding such as UTF-8 is
- required.
-
- qdoc will encode HTML using this encoding and generate the correct
- declarations to indicate to browsers which encoding is being
- used. The \l naturallanguage configuration variable should also be
- specified to provide browsers with a complete set of character
- encoding and language information.
-
- See also \l outputencoding and \l naturallanguage.
-
- \target outputformats-variable
- \section1 outputformats
-
- The \c outputformats variable specifies the format of
- the generated documentation.
-
- Currently, QDoc only supports the HTML format. It is also
- the default format, and doesn't need to be specified.
-
- \target outputprefixes
- \section1 outputprefixes
-
- The \c outputprefixes variable specifies a mapping between types of files
- and the prefixes to prepend to the HTML file names in the generated
- documentation.
-
- \code
- outputprefixes = QML
- outputprefixes.QML = uicomponents-
- \endcode
-
- By default, files containing the API documentation for QML types
- are prefixed with "qml-". In the above example, the
- prefix \c "uicomponents" is used instead.
-
- \target qhp-variable
- \section1 qhp
-
- The \c qhp variable is used to define the information to be
- written out to Qt Help Project (\c{qhp}) files.
-
- See the \l{Creating Help Project Files} chapter for information
- about this process.
-
- \target sourcedirs-variable
- \section1 sourcedirs
-
- The \c sourcedirs variable specifies the directories containing
- the \c .cpp or \c .qdoc files used in the documentation.
-
- \code
- sourcedirs += .. \
- ../../../examples/gui/doc/src
- \endcode
-
- When executed, the first thing QDoc will do is to read through the
- headers specified in the \l {header-command} {\c header} variable,
- and the ones located in the directories specified in the \c
- headerdir variable (including all subdirectories), building an
- internal structure of the classes and their functions.
-
- Then it will read through the sources specified in the \l
- {sources} {\c sources}, and the ones located in the directories
- specified in the \l {sourcedirs} {\c sourcedirs} variable
- (including all subdirectories), merging the documentation with the
- structure it retrieved from the header files.
-
- If both the \c sources and \c sourcedirs variables are defined,
- QDoc will read through both, first \l {sources} {\c sources} then
- \c sourcedirs.
-
- In the specified directories, QDoc will only read the files with
- the \c fileextensions specified in the \l {sources.fileextensions}
- {\c sources.fileextensions} variable. The default extensions are
- *.c++, *.cc, *.cpp and *.cxx. The files specified by \l {sources}
- {\c sources} will be read independent of their fileextensions.
-
- See also \l {sources-variable} {sources} and
- \l {sources.fileextensions-variable} {sources.fileextensions}.
-
- \target sourceencoding-variable
- \section1 sourceencoding
-
- The \c sourceencoding variable specifies the encoding used for the
- source code and documentation.
-
- \code
- sourceencoding = UTF-8
- \endcode
-
- By default, the source encoding is \c ISO-8859-1 (Latin1) for
- compatibility with legacy documentation. For some languages,
- particularly non-European languages, this is not sufficient and an
- encoding such as UTF-8 is required.
-
- Although qdoc will use the encoding to read source and
- documentation files, limitations of C++ compilers may prevent you
- from using non-ASCII characters in source code comments. In cases
- like these, it is possible to write API documentation completely
- in documentation files.
-
- See also \l {naturallanguage-variable} {naturallanguage} and
- \l {outputencoding-variable} {outputencoding}.
-
- \target sources-variable
- \section1 sources
-
- The \c sources variable allows you to specify individual source
- files in addition to those located in the directories specified by
- the \l {sourcedirs-variable} {sourcedirs} variable.
-
- \code
- sources = $QTDIR/src/gui/widgets/qlineedit.cpp \
- $QTDIR/src/gui/widgets/qpushbutton.cpp
- \endcode
-
- When processing the \c sources variable, QDoc behaves in the same
- way as it does when processing the \l {sourcedirs-variable}
- {sourcedirs} variable. For more information, see the \l
- {sourcedirs-variable} {sourcedirs} variable.
-
- See also \l {sourcedirs-variable} {sourcedirs}.
-
- \target sources.fileextensions-variable
- \section1 sources.fileextensions
-
- The \c sources.fileextensions variable filters the files within a
- source directory.
-
- When processing the source files specified in the \l {sourcedirs}
- {\c sourcedirs} variable, QDoc will only read the files with the
- fileextensions specified in the \c sources.fileextensions
- variable. In this way QDoc avoid spending time reading irrelevant
- files.
-
- The default extensions are *.c++, *.cc, *.cpp and *.cxx.
-
- The extensions are given as standard wildcard expressions. You
- can add a file extension to the filter using '+='. For example:
-
- \code
- sources.fileextensions += *.CC
- \endcode
-
- \warning The above assignment may not work as described.
-
- See also \l {sourcedirs-variable} {sourcedirs} and \l
- (sources-variable} {sources}.
-
-
- \target spurious-variable
- \section1 spurious
-
- The \c spurious variable excludes specified QDoc warnings from the
- output. The warnings are specified using standard wildcard
- expressions.
-
- \code
- spurious = "Cannot find .*" \
- "Missing .*"
- \endcode
-
- makes sure that warnings matching either of these expressions,
- will not be part of the output when running QDoc. For example
- would the following warning be omitted from the output:
-
- \code
- qt-4.0/src/opengl/qgl_mac.cpp:156: Missing parameter name
- \endcode
-
- \target syntaxhighlighting
- \section1 syntaxhighlighting
-
- The \c syntaxhighlighting variable specifies whether QDoc should
- perform syntax highlighting on source code quoted in the
- documentation it generates.
-
- \code
- syntaxhighlighting = true
- \endcode
-
- will enable syntax highlighting for all supported programming
- languages.
-
- \target tabsize-variable
- \section1 tabsize
-
- The \c tabsize variable defines the size of a tab character.
-
- \code
- tabsize = 4
- \endcode
-
- will give the tab character the size of 4 spaces. The default
- value of the variable is 8, and doesn't need to be specified.
-
- \target tagfile-variable
- \section1 tagfile
-
- The \c tagfile variable specifies the Doxygen tag file to be
- written when HTML is generated.
-
- \target version-variable
- \section1 version
-
- The \c version variable specifies the version number of the
- documented software.
-
- \code
- version = 4.0.1
- \endcode
-
- When a version number is specified (using the \tt{\l version} or
- \tt {\l versionsym} variables in a \c .qdocconf file), it is
- accessible through the corresponding \\version command for use in
- the documentation.
-
- \warning The \\version command's functionality is not fully
- implemented; currently it only works within raw HTML code.
-
- See also \l versionsym.
-
- \target versionsym-variable
- \section1 versionsym
-
- The \c versionsym variable specifies a C++ preprocessor symbol
- that defines the version number of the documented software.
-
- \code
- versionsym = QT_VERSION_STR
- \endcode
-
- QT_VERSION_STR is defined in qglobal.h as follows
-
- \code
- #define QT_VERSION_STR "4.0.1"
- \endcode
-
- When a version number is specified (using the \tt{\l version} or
- \tt {\l versionsym} variables in a \c .qdocconf file), it is
- accessible through the corresponding \\version command for use in
- the documentation.
-
- \warning The \\version command's functionality is not fully
- implemented. Currently, it only works within raw HTML code.
-
- See also \l {version} {\\version}.
-*/
-
-/*!
- \page 22-creating-help-project-files.html
- \previouspage Generic Configuration Variables
- \contentspage QDoc Manual
- \nextpage C++ Specific Configuration Variables
-
- \title Creating Help Project Files
-
- \section1 Overview
-
- Starting with Qt 4.4, Qt Assistant uses a different system for managing
- Qt documentation that requires QDoc to generate inventories of files in a
- format that is similar to the old style DCF format, but with additional
- features.
-
- Instead of hard-coding information about the documentation sets for Qt,
- QDoc allows configuration variables to be used to specify which pages are
- to be used in each documentation set it generates. These are specified as
- subvariables of the \c qch variable with each set declared using a unique
- identifier as a subvariable.
-
- For example, the configuration file for the Qt documentation defines a
- \c Qt documentation set by specifying information about the set as
- subvariables with the \c{qhp.Qt} prefix:
-
- \code
- qhp.Qt.file = qt.qhp
- qhp.Qt.namespace = org.qt-project.qtcore.$QT_VERSION_TAG
- qhp.Qt.virtualFolder = qdoc
- qhp.Qt.indexTitle = Qt Reference Documentation
- qhp.Qt.indexRoot =
- qhp.Qt.extraFiles = classic.css images/qt-logo.png
- qhp.Qt.filterAttributes = qt 4.4.0 qtrefdoc
- qhp.Qt.customFilters.Qt.name = Qt 4.4.0
- qhp.Qt.customFilters.Qt.filterAttributes = qt 4.4.0
- qhp.Qt.subprojects = classes overviews examples
- qhp.Qt.subprojects.classes.title = Classes
- qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
- qhp.Qt.subprojects.classes.selectors = class
- qhp.Qt.subprojects.overviews.title = Overviews
- qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs
- qhp.Qt.subprojects.overviews.selectors = fake:page,group,module
- qhp.Qt.subprojects.examples.title = Tutorials and Examples
- qhp.Qt.subprojects.examples.indexTitle = Qt Examples
- qhp.Qt.subprojects.examples.selectors = fake:example
- \endcode
-
- To create a table of contents for a manual, create a subproject with
- a \c{type} property and set it to \c{manual}. The page in the documentation
- referred to by the \c{indexTitle} property must contain a list of links
- that acts as a table of contents for the whole manual. QDoc will take the
- information in this list and create a table of contents for the subproject.
-
- For example, the configuration file for Qt Creator defines only one
- subproject for its documentation, including all the documentation in a
- single manual:
-
- \code
- qhp.QtCreator.subprojects = manual
- qhp.QtCreator.subprojects.manual.title = Qt Creator Manual
- qhp.QtCreator.subprojects.manual.indexTitle = Qt Creator Manual
- qhp.QtCreator.subprojects.manual.type = manual
- \endcode
-
- In this example, the page entitled "Qt Creator Manual" contains a nested
- list of links to pages in the documentation which is duplicated in
- Qt Assistant's Contents tab.
-*/
-
-/*!
- \page 23-qdoc-configuration-cppvariables.html
- \previouspage Creating Help Project Files
- \contentspage QDoc Manual
- \nextpage HTML Specific Configuration Variables
-
- \title C++ Specific Configuration Variables
-
- The C++ specific configuration variables are provided to avoid
- erroneous documentation due to non-standard C++ constructs.
-
- \target Cpp.ignoredirectives-variable
- \section1 Cpp.ignoredirectives
- The \c Cpp.ignoredirectives variable makes QDoc ignore the
- specified non-standard constructs, within C++ source code.
-
- If not specified by the \tt {\l Cpp.ignoretokens} or \tt {\l
- Cpp.ignoredirectives} variables, non-standard constructs
- (typically macros) can result in erroneous documentation.
-
- \code
- Cpp.ignoredirectives = Q_DECLARE_INTERFACE \
- Q_DECLARE_OPERATORS_FOR_FLAGS \
- Q_DECLARE_PRIVATE \
- Q_DECLARE_PUBLIC \
- Q_DISABLE_COPY \
- Q_DUMMY_COMPARISON_OPERATOR \
- Q_ENUMS \
- Q_FLAGS \
- Q_INTERFACES \
- __attribute__
- \endcode
-
- makes sure that when processing the code below, for example, QDoc
- will simply ignore the 'Q_ENUMS' and 'Q_FLAGS' expressions:
-
- \code
- class Q_CORE_EXPORT Qt {
- Q_OBJECT
- Q_ENUMS(Orientation TextFormat BackgroundMode
- DateFormat ScrollBarPolicy FocusPolicy
- ContextMenuPolicy CaseSensitivity
- LayoutDirection ArrowType)
- Q_ENUMS(ToolButtonStyle)
- Q_FLAGS(Alignment)
- Q_FLAGS(Orientations)
- Q_FLAGS(DockWidgetAreas)
-
- public:
- ...
- };
- \endcode
-
- The Q_OBJECT macro, however, is an exception: QDoc recognizes this
- particular non-standard construct, so there is no need specifying
- it using the \tt {\l Cpp.ignoredirectives} variable.
-
- Regarding the Q_CORE_EXPORT macro; see the documentation of the
- \tt {\l Cpp.ignoretokens} variable.
-
- See also \l Cpp.ignoretokens.
-
- \target Cpp.ignoretokens-variable
- \section1 Cpp.ignoretokens
-
- The \c Cpp.ignoretokens variable makes QDoc ignore the specified
- non-standard constructs, within C++ source code.
-
- If not specified by the \tt {\l Cpp.ignoretokens} or \tt {\l
- Cpp.ignoredirectives} variables, non-standard constructs
- (typically macros) can result in erroneous documentation.
-
- In \l qtgui.qdocconf:
-
- \code
- Cpp.ignoretokens = QAXFACTORY_EXPORT \
- QM_EXPORT_CANVAS \
- ...
- Q_COMPAT_EXPORT \
- Q_CORE_EXPORT \
- Q_EXPLICIT \
- Q_EXPORT \
- ...
- Q_XML_EXPORT
- \endcode
-
- makes sure that when processing the code below, for example, QDoc
- will simply ignore the 'Q_CORE_EXPORT' expression:
-
- \code
- class Q_CORE_EXPORT Qt {
- Q_OBJECT
- Q_ENUMS(Orientation TextFormat BackgroundMode
- DateFormat ScrollBarPolicy FocusPolicy
- ContextMenuPolicy CaseSensitivity
- LayoutDirection ArrowType)
- Q_ENUMS(ToolButtonStyle)
- Q_FLAGS(Alignment)
- Q_FLAGS(Orientations)
- Q_FLAGS(DockWidgetAreas)
- public:
- ...
- };
- \endcode
-
- Regarding the Q_OBJECT, Q_ENUMS and Q_FLAGS macros; see the
- documentation of the \tt {\l Cpp.ignoredirectives} variable.
-
- See also \l Cpp.ignoredirectives.
-*/
-
-/*!
- \page 24-qdoc-configuration-htmlvariables.html
- \previouspage C++ Specific Configuration Variables
- \contentspage QDoc Manual
- \nextpage Supporting Derived Projects
-
- \title HTML Specific Configuration Variables
-
- The HTML specific configuration variables define the generated
- documentation's style, or define the contents of the
- documentation's footer or postheader. The format of the variable
- values are raw HTML.
-
- \target HTML.footer-variable
- \section1 HTML.footer
-
- The \c HTML.footer variable defines the content of the generated
- HTML documentation's footer.
-
- The footer is rendered at the bottom of the generated
- documentation page.
-
- The variable's value is given as raw HTML code enclosed by
- quotation marks. Note that if the value spans several lines, each
- line needs to be enclosed by quotation marks.
-
- \code
- HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
- ...
- "</tr></table></div></address>"
- \endcode
-
- The complete variable entry provides the standard footer of the
- \l {http://doc.qt.digia.com/4.0/index.html} {Qt Reference Documentation}.
-
- \target HTML.postheader-variable
- \section1 HTML.postheader
-
- The \c HTML.postheader variable defines the content of the
- generated HTML documentation's postheader.
-
- The header is rendered at the top of the generated documentation
- page.
-
- The variable's value is given as raw HTML enclosed by quotation
- marks. Note that if the value spans several lines, each line needs
- to be enclosed by quotation marks.
-
- \code
- HTML.postheader = "<table border=\"0\"..." \
- ...
- "<img src=\"images/qt-logo.png\" \
- "align=\"right\" width=\"203\" height=\"32\""\
- "border=\"0\" />" \
- "</td></tr>" \
- "</table>"
- \endcode
-
- The complete variable entry in \l qtgui.qdocconf provides the
- standard header of the \l {http://doc.qt.digia.com/}
- {Qt Reference Documentation}.
-
- \target HTML.style-variable
- \section1 HTML.style
-
- The HTML.style variable defines the style for
- the generated HTML documentation.
-
- The variable's value is given as raw HTML enclosed by quotation
- marks. Note that if the value spans several lines, each line needs
- to be enclosed by quotation marks.
-
- \code
- HTML.style = "h3.fn,span.fn" \
- "{ margin-left: 1cm; text-indent: -1cm; }\n" \
- "a:link { color: #004faf; text-decoration: none }\n" \
- "a:visited" \
- "{ color: #672967; text-decoration: none }\n" \
- "td.postheader { font-family: sans-serif }\n" \
- "tr.address { font-family: sans-serif }\n" \
- "body { background: #ffffff; color: black; }"
- \endcode
-
- provides the HTML style for the \l
- {http://doc.qt.digia.com/4.0/index.html} {Qt Reference
- Documentation}.
-
- \target HTML.stylesheets-variable
- \section1 HTML.stylesheets
-
- The HTML.stylesheets variable defines a list of stylesheets
- to use for the generated HTML documentation.
-
- Using separate stylesheets for the documentation makes it easier
- to customize and experiment with the style used once the contents
- has been generated. Typically, it is only necessary to define a
- single stylesheet for any set of documentation; for example:
-
- \code
- HTML.stylesheets = classic.css
- \endcode
-
- QDoc expects to find stylesheets in the directory containing the
- \l qtgui.qdocconf file, and it will copy those specified to the output
- directory alongside the HTML pages.
-
- \target HTML.tocdepth
- \section1 HTML.tocdepth
-
- The HTML.tocdepth variable defines how many document sections are printed in
- the table of contents. Setting tocdepth to \c 0 disables the table of
- contents while not setting the variable prints all document sections.
-
-*/
-
-/*!
- \page 25-qdoc-configuration-derivedprojects.html
- \previouspage HTML Specific Configuration Variables
- \contentspage QDoc Manual
- \nextpage Example Manifest Files
-
- \title Supporting Derived Projects
-
- Some configuration variables allow you to use QDoc to support
- Qt-based projects. They allow your project to contain links to the
- online Qt documentation, which means that QDoc will be able to
- create links to the class reference documentation, without any
- explicit linking command.
-
- \target description-variable
- \section1 description
-
- The description variable holds a short description of the
- associated project.
-
- See also \l project.
-
- \target indexes-variable
- \section1 indexes
-
- The \c indexes variable lists the index files that will be used to
- generate references.
-
- For example. to make a derived Qt project contain links to the Qt
- Reference documentation, you need to specify the associated index
- file:
-
- \code
- indexes = $QTDIR/doc/html/qt.index
- \endcode
-
- See also \l project and \l url.
-
- \target project-variable
- \section1 project
-
- The \c project variable provides a name for the project associated
- with the \c .qdocconf file.
-
- The project's name is used to form a file name for the associated
- project's \e index file.
-
- \code
- project = QtCreator
- \endcode
-
- This will cause an index file called \c qtcreator.index to be
- created.
-
- See also \l description and \l indexes.
-
- \target url-variable
- \section1 url
-
- The \c url variable holds the base URL for the reference
- documentation associated with the current project.
-
- The URL is stored in the generated index file for the
- project. When we use the index on its own, QDoc will use this as
- the base URL when constructing links to classes, functions, and
- other things listed in the index.
-
- \code
- project = Qt
- description = Qt Reference Documentation
- url = http://doc.qt.io/qt-4.8/
-
- ...
- \endcode
-
- This makes sure that whenever \c qt.index is used to generate
- references to for example Qt classes, the base URL is \c
- http://doc.qt.digia.com/4.7.
-
- See also \l indexes.
-
- \target howto
- \section1 How to Support Derived Projects
-
- This feature makes use of the comprehensive indexes generated by
- QDoc when it creates the Qt reference documentation.
-
- For example, \l qtgui.qdocconf (the configuration file for Qt)
- contains the following variable definitions:
-
- \code
- project = Qt
- description = Qt Reference Documentation
- url = http://doc.qt.io/qt-4.8/
-
- ...
- \endcode
-
- The \l project variable name is used to form a file name for the
- index file; in this case the \c qt.index file is created. The \l
- url is stored in the index file. Afterwards, QDoc will use this
- as the base URL when constructing links to classes, functions,
- and other things listed in the index.
-
-*/
-
-/*!
- \page 26-qdoc-configuration-example-manifest-files.html
- \previouspage Supporting Derived Projects
- \contentspage QDoc Manual
-
- \title Example Manifest Files
-
- QDoc generates XML files that contain information about all documented
- examples and demos. These files, named \c {examples-manifest.xml} and
- \c {demos-manifest.xml}, are used by Qt Creator to present a list of
- examples in its welcome screen and to link to their documentation.
-
- \section1 Manifest XML Structure
-
- A manifest file has the following structure:
-
- \code
- <?xml version="1.0" encoding="UTF-8"?>
- <instructionals module="QtGui">
- <examples>
- <example
- name="Analog Clock Window Example"
- docUrl="qthelp://org.qt-project.qtgui.502/qtgui/analogclock.html"
- projectPath="gui/analogclock/analogclock.pro"
- imageUrl="qthelp://org.qt-project.qtgui.502/qtgui/images/analogclock-window-example.png">
- <description><![CDATA[The Analog Clock Window example shows how
- to draw the contents of a custom window.]]></description>
- <tags>analog,clock,window</tags>
- <fileToOpen>gui/analogclock/main.cpp</fileToOpen>
- </example>
- ...
- </examples>
- </instructionals>
- \endcode
-
- Each \c {<example>} element contains information about a name,
- description, the location of the project file and documentation,
- as well as a list of tags associated with the example.
-
- \target metacontent
- \section1 Manifest Meta Content
-
- It is possible to augment the manifest files with additional
- meta-content - that is, extra attributes and tags for selected
- examples, using the \c manifestmeta configuration command.
-
- One use case for meta-content is highlighting a number of prominent
- examples. Another is improving search functionality by adding
- relevant keywords as tags for a certain category of examples.
-
- The examples for which meta-content is applied to is specified using
- one or more filters. Matching examples to filters is done based on
- names, with each example name prefixed with a module name and a
- slash. Simple wildcard matching is supported; by using \c {*} at the
- end it's possible to match multiple examples with a single string.
-
- Example:
-
- \code
- manifestmeta.filters = highlighted sql webkit global
-
- manifestmeta.highlighted.names = "QtGui/Analog Clock Window Example" \
- "QtWidgets/Analog Clock Example"
- manifestmeta.highlighted.attributes = isHighlighted:true
-
- manifestmeta.sql.names = "QtSql/*"
- manifestmeta.sql.tags = database,sql
-
- manifestmeta.webkit.names = "QtWebKitExamples/*"
- manifestmeta.webkit.tags = webkit
-
- manifestmeta.global.names = *
- manifestmeta.global.tags = qt5
- \endcode
-
- Above, an \c isHighlighted attribute is added to two examples. If
- the attribute value is omitted, QDoc uses the string \c {true} by
- default. Extra tags are added for Qt WebKit and Qt SQL examples, and
- another tag is applied to all examples by using just \c {*} as the
- match string.
-*/
-/*!
- \page 21-3-qt-dita-xml-output.html
- \previouspage minimum.qdocconf
- \contentspage QDoc Manual
- \nextpage QA Pages
-
- \title Generating DITA XML Output
-
- QDoc can generate \l {http://dita.xml.org} {DITA XML output}.
-
- In your configuration file, set your \c {outputformats} variable
- to \c {DITAXML}, and send the output to an appropriate directory:
-
- \code
- outputdir = $QTDIR/doc/ditaxml
- outputformats = DITAXML
- \endcode
-
- And include these macros in your configuration file to prevent
- QDoc from doing some escaping that doesn't validate in XML:
-
- \code
- macro.aacute.DITAXML = "&aacute;"
- macro.Aring.DITAXML = "&Aring;"
- macro.aring.DITAXML = "&aring;"
- macro.Auml.DITAXML = "&Auml;"
- macro.br.DITAXML = " "
- macro.BR.DITAXML = " "
- macro.copyright.DITAXML = "&copy;"
- macro.eacute.DITAXML = "&eacute;"
- macro.hr.DITAXML = " "
- macro.iacute.DITAXML = "&iacute;"
- macro.oslash.DITAXML = "&oslash;"
- macro.ouml.DITAXML = "&ouml;"
- macro.raisedaster.DITAXML = "<sup>*</sup>"
- macro.rarrow.DITAXML = "&rarr;"
- macro.reg.DITAXML = "<sup>&reg;</sup>"
- macro.uuml.DITAXML = "&uuml;"
- macro.mdash.DITAXML = "&mdash;"
- macro.emptyspan.DITAXML = " "
- \endcode
-
- You can also set default values for some of the tags in the DITA
- \c {<prolog>} and \c {<metadata>} elements:
-
- \code
- dita.metadata.default.author = Qt Development Frameworks
- dita.metadata.default.permissions = all
- dita.metadata.default.publisher = Qt Project
- dita.metadata.default.copyryear = 2015
- dita.metadata.default.copyrholder = Qt Project
- dita.metadata.default.audience = programmer
- \endcode
-
- See the \l {meta-command}
- {\\meta} command for more details on DITA metadata.
-
-*/
-
-
-/*!
- \page 21-1-minimum-qdocconf.html
- \previouspage qtgui.qdocconf
- \contentspage QDoc Manual
- \nextpage Generating DITA XML Output
-
- \title minimum.qdocconf
-
- \quotefile examples/minimum.qdocconf
-*/
-
-/*!
- \page 21-2-qtgui-qdocconf.html
- \previouspage Supporting Derived Projects
- \contentspage QDoc Manual
- \nextpage minimum.qdocconf
-
- \title qtgui.qdocconf
-
- \quotefile files/qtgui.qdocconf
-*/
diff --git a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
deleted file mode 100644
index f5351b851c..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual-topiccmds.qdoc
+++ /dev/null
@@ -1,1588 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page 13-qdoc-commands-topics.html
- \previouspage Command Index
- \contentspage QDoc Manual
- \nextpage Context Commands
-
- \title Topic Commands
-
- A topic command tells QDoc which source code element is being
- documented. Some topic commands allow you to create documentation
- pages that aren't tied to any underlying source code element.
-
- When QDoc processes a QDoc comment, it tries to connect the
- comment to an element in the source code by first looking for a
- topic command that names the source code element. If there is no
- topic command, QDoc tries to connect the comment to the source
- code element that immediately follows the comment. If it can't do
- either of these and if there is no topic command that indicates
- the comment does not have an underlying source code element (e.g.
- \l{page-command} {\\page}), then the comment is discarded.
-
- \target topic argument
-
- The name of the entity being documented is usually the only
- argument for a topic command. Use the complete name. Sometimes
- there can be a second parameter in the argument. See e.g. \l
- {page-command} {\\page}.
-
- \code
- \enum QComboBox::InsertPolicy
- \endcode
-
- The \l {fn-command} {\\fn} command is a special case. For the \l
- {fn-command} {\\fn} command, use the function's signature
- including the class qualifier.
-
- \code
- \fn void QGraphicsWidget::setWindowFlags(Qt::WindowFlags wFlags)
- \endcode
-
- A topic command can appear anywhere in a comment but must stand
- alone on its own line. It is good practice is to let the topic command
- be the first line of the comment. If the argument spans several
- lines, make sure that each line (except the last one) is ended
- with a backslash. Moreover, QDoc counts parentheses, which means
- that if it encounters a '(' it considers everything until the
- closing ')' as its argument.
-
- If a topic command is repeated with different arguments, the
- same documentation will appear for both the units.
-
- \code
- / *!
- \fn void PreviewWindow::setWindowFlags()
- \fn void ControllerWindow::setWindowFlags()
-
- Sets the widgets flags using the QWidget::setWindowFlags()
- function.
-
- Then runs through the available window flags, creating a text
- that contains the names of the flags that matches the flags
- parameter, displaying the text in the widgets text editor.
- * /
- \endcode
-
- The \c PreviewWindow::setWindowFlags() and \c
- ControllerWindow::setWindowFlags() functions will get the same
- documentation.
-
- \target class-command
- \section1 \\class
-
- The \\class command is for documenting a C++ class. The argument
- is the complete name of the class. The command tells QDoc that a
- class is part of the public API, and lets you enter a detailed
- description.
-
- \code
- / *!
- \class QMap::iterator
-
- \brief The QMap::iterator class provides an STL-style
- non-const iterator for QMap and QMultiMap.
-
- QMap features both \l{STL-style iterators} and
- \l{Java-style iterators}. The STL-style iterators ...
- * /
- \endcode
-
- The HTML documentation for the named class is written to a
- \c{.html} file named from the class name, in lower case, and with
- the double colon qualifier(s) replaced with '-'. For example, the
- documentation for the \c QMap::Iterator class is written to \c
- qmap-iterator.html.
-
- \target framework
-
- The file contains the class description from the \\class comment,
- plus the documentation generated from QDoc comments for all the
- class members: a list of the class's types, properties,
- functions, signals, and slots.
-
- In addition to the detailed description of the class, the \\class
- comment typically contains a \l {brief-command} {\\brief} command
- and one or more \l{Markup Commands}. See the \\class command for
- any of the Qt class for examples. Here is a very simple example:
-
- \code
- / *!
- \class PreviewWindow
- \brief The PreviewWindow class is a custom widget.
- displaying the names of its currently set
- window flags in a read-only text editor.
-
- \ingroup miscellaneous
-
- The PreviewWindow class inherits QWidget. The widget
- displays the names of its window flags set with the \l
- {function} {setWindowFlags()} function. It is also
- provided with a QPushButton that closes the window.
-
- ...
-
- \sa QWidget
- * /
- \endcode
-
- The way QDoc renders this \\class will depend a lot on your \c
- {style.css} file, but the general outline of the class reference
- page will look like this:
-
- \quotation
- \raw HTML
- <h1>PreviewWindow Class Reference</h1>
- \endraw
-
- The PreviewWindow class is a custom widget displaying
- the names of its currently set window flags in a
- read-only text editor. \l {preview window} {More...}
-
- \raw HTML
- <h3>Properties</h3>
- \endraw
-
- \list
- \li 52 properties inherited from QWidget
- \li 1 property inherited from QObject
- \endlist
-
- \raw HTML
- <h3>Public Functions</h3>
- \endraw
-
- \list
- \li \l {constructor} {PreviewWindow}(QWidget *parent = 0)
- \li void \l {function} {setWindowFlags}(Qt::WindowFlags flags)
- \endlist
-
- \list
- \li 183 public functions inherited from QWidget
- \li 28 public functions inherited from QObject
- \endlist
-
- \raw HTML
- <h3>Public Slots</h3>
- \endraw
-
- \list
- \li 17 public slots inherited from QWidget
- \li 1 public slot inherited from QObject
- \endlist
-
- \raw HTML
- <h3>Additional Inherited Members</h3>
- \endraw
-
- \list
- \li 1 signal inherited from QWidget
- \li 1 signal inherited from QObject
- \li 4 static public members inherited from QWidget
- \li 4 static public members inherited from QObject
- \li 39 protected functions inherited from QWidget
- \li 7 protected functions inherited from QObject
- \endlist
-
- \target preview window
-
- \raw HTML
- <hr />
- <h2>Detailed Description</h2>
- \endraw
-
- The PreviewWindow class is a custom widget displaying
- the names of its currently set window flags in a
- read-only text editor.
-
- The PreviewWindow class inherits QWidget. The widget
- displays the names of its window flags set with the \l
- {function} {setWindowFlags()} function. It is also
- provided with a QPushButton that closes the window.
-
- ...
-
- See also QWidget.
-
- \raw HTML
- <hr />
- <h2>Member Function Documentation</h2>
- \endraw
-
- \target constructor
- \raw HTML
- <h3>PreviewWindow(QWidget *parent = 0)</h3>
- \endraw
-
- Constructs a preview window widget with \e parent.
-
- \target function
- \raw HTML
- <h3>setWindowFlags(Qt::WindowFlags flags)</h3>
- \endraw
-
- Sets the widgets flags using the
- QWidget::setWindowFlags() function.
-
- Then runs through the available window flags,
- creating a text that contains the names of the flags
- that matches the flags parameter, displaying
- the text in the widgets text editor.
- \endquotation
-
- \target enum-command
- \section1 \\enum
-
- The \\enum command is for documenting a C++ enum type. The
- argument is the full name of the enum type.
-
- The enum values are documented in the \\enum comment using the \l
- {value-command} {\\value} command. If an enum value is not
- documented with \\value, QDoc emits a warning. These warnings can
- be avoided using the \l {omitvalue-command} {\\omitvalue} command
- to tell QDoc that an enum value should not be documented. The enum
- documentation will be included on the class reference page, header
- file page, or namespace page where the enum type is defined. For
- example, consider the enum type \c {Corner} in the Qt namespace:
-
- \code
- enum Corner {
- TopLeftCorner = 0x00000,
- TopRightCorner = 0x00001,
- BottomLeftCorner = 0x00002,
- BottomRightCorner = 0x00003
- #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
- ,TopLeft = TopLeftCorner,
- TopRight = TopRightCorner,
- BottomLeft = BottomLeftCorner,
- BottomRight = BottomRightCorner
- #endif
- };
- \endcode
-
- This enum can be cocumented this way:
-
- \code
- / *!
- \enum Qt::Corner
-
- This enum type specifies a corner in a rectangle:
-
- \value TopLeftCorner
- The top-left corner of the rectangle.
- \value TopRightCorner
- The top-right corner of the rectangle.
- \value BottomLeftCorner
- The bottom-left corner of the rectangle.
- \value BottomRightCorner
- The bottom-right corner of the rectangle.
-
- \omitvalue TopLeft
- \omitvalue TopRight
- \omitvalue BottomLeft
- \omitvalue BottomRight
- * /
- \endcode
-
- Note the inclusion of the namespace qualifier. QDoc will render
- this enum type in \c {qt.html} like this:
-
- \quotation
- \raw HTML
- <h3 class="fn"><a name="Corner-enum"></a>enum Qt::Corner</h3>
-
- <p>This enum type specifies a corner in a rectangle:</p>
-
- <table border="1" cellpadding="2" cellspacing="1" width="100%">
- <tr>
- <th width="25%">Constant</th>
- <th width="15%">Value</th>
- <th width="60%">Description</th>
- </tr>
-
- <tr>
- <td valign="top"><tt>Qt::TopLeftCorner</tt></td>
- <td align="center" valign="top"><tt>0x00000</tt></td>
- <td valign="top">The top-left corner of the rectangle.</td>
- </tr>
-
- <tr>
- <td valign="top"><tt>Qt::TopRightCorner</tt></td>
- <td align="center" valign="top"><tt>0x00001</tt></td>
- <td valign="top">The top-right corner of the rectangle.</td>
- </tr>
-
- <tr>
- <td valign="top"><tt>Qt::BottomLeftCorner</tt></td>
- <td align="center" valign="top"><tt>0x00002</tt></td>
- <td valign="top">The bottom-left corner of the rectangle.</td>
- </tr>
-
- <tr>
- <td valign="top"><tt>Qt::BottomRightCorner</tt></td>
- <td align="center" valign="top"><tt>0x00003</tt></td>
- <td valign="top">The bottom-right corner of the rectangle.</td>
- </tr>
-
- </table>
- \endraw
- \endquotation
-
- See also \l {value-command} {\\value} and \l {omitvalue-command} {\\omitvalue}.
-
- \target example-command
- \section1 \\example
-
- The \\example command is for documenting an example. The argument
- is the example's path relative to omne of the paths listed in the
- \l {exampledirs-variable} {exampledirs} variable in the QDoc
- configuration file.
-
- The documentation page will be output to \c {path-to-example}.html.
- QDoc will add a list of all the example's source files at the top
- of the page.
-
- For example, if \l {exampledirs-variable} {exampledirs} contains
- \c $QTDIR/examples/widgets/imageviewer, then
-
- \code
- / *!
- \example widgets/imageviewer
- \title ImageViewer Example
- \subtitle
-
- The example shows how to combine QLabel and QScrollArea
- to display an image.
-
- ...
- * /
- \endcode
-
- QDoc renders this example in widgets-imageviewer.html:
-
- \quotation
- \raw HTML
- <center><h1>Image Viewer Example</h1></center>
- \endraw
-
- Files:
- \list
- \li \l{http://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-imageviewer-cpp.html}
- {widgets/imageviewer/imageviewer.cpp}
- \li \l{http://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-imageviewer-h.html}
- {widgets/imageviewer/imageviewer.h}
- \li \l{http://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-main-cpp.html}
- {widgets/imageviewer/main.cpp}
- \endlist
-
- The example shows how to combine QLabel and QScrollArea
- to display an image.
-
- ...
- \endquotation
-
- \target externalpage-command
- \section1 \\externalpage
-
- The \\externalpage command assigns a title to an external URL.
-
- \code
- / *!
- \externalpage http://doc.qt.io/
- \title Qt Documentation Site
- * /
- \endcode
-
- This allows you to include a link to the external page in your
- documentation this way:
-
- \code
- / *!
- At the \l {Qt Documentation Site} you can find the latest
- documentation for Qt, Qt Creator, the Qt SDK and much more.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- At the \l {http://doc.qt.io/}{Qt Documentation Site}
- you can find the latest documentation for Qt, Qt Creator, the Qt SDK
- and much more.
- \endquotation
-
- To achieve the same result without using the \\externalpage
- command, you would have to hard-code the address into your
- documentation:
-
- \code
- / *!
- At the \l {http://doc.qt.io/}{Qt Documentation Site}
- you can find the latest documentation for Qt, Qt Creator, the Qt SDK
- and much more.
- * /
- \endcode
-
- The \\externalpage command makes it easier to maintain the
- documentation. If the address changes, you only need to change the
- argument of the \\externalpage command.
-
- \target fn-command
- \section1 \\fn (function)
-
- The \\fn command is for documenting a function. The argument is
- the function's signature, including its return type, const-ness,
- and list of formal arguments with types. If the named function
- doesn't exist, QDoc emits a warning.
-
- \note The \\fn command is QDoc's default command: when no
- topic command can be found in a QDoc comment, QDoc tries to tie
- the documentation to the following code as if it is the
- documentation for a function. Hence, it is normally not necessary
- to include this command when documenting a function, if the
- function's QDoc comment is written immediately above the function
- implementation in the \c .cpp file. But it must be present when
- documenting an inline function in the \c .cpp file that is
- implemented in the \c .h file.
-
- \code
- / *!
- \fn bool QToolBar::isAreaAllowed(Qt::ToolBarArea area) const
-
- Returns \c true if this toolbar is dockable in the given
- \a area; otherwise returns \c false.
- * /
- \endcode
-
- QDoc renders this as:
-
- \quotation
- \raw HTML
- <h3>bool QToolBar::isAreaAllowed(Qt::ToolBarArea area) const
- </h3>
- \endraw
-
- Returns \c true if this toolbar is dockable in the given
- \a area; otherwise returns \c false.
- \endquotation
-
- See also \l {overload-command} {\\overload}.
-
- \target group-command
- \section1 \\group
-
- The \\group command creates a separate page that lists the classes
- belonging to the group. The argument is the group name.
-
- A class is included in a group by using the \l {ingroup-command}
- {\\ingroup} command. Overview pages can also be related to a group
- using the same command, but the list of overview pages must be
- requested explicitly using the \l {generatelist-command}
- {\\generatelist} command (see example below).
-
- The \\group command is typically followed by a \l {title-command}
- {\\title} command and a short introduction to the group. The
- HTML page for the group is written to a \c {.html} file put in
- <lower-case>\e{group}.html.
-
- Each class name is listed as a link to the class reference page
- followed by the text from the class's \l {brief-command} {\\brief}
- texts.
-
- \code
- / *!
- \group io
-
- \title Input/Output and Networking
-
- These classes are used to handle input and output to
- and from external devices, processes, files etc., as
- well as manipulating files and directories.
- * /
- \endcode
-
- QDoc generates a group page in \c{io.html} that will look
- like this:
-
- \quotation
- \raw HTML
-
- <h1>Input/Output and Networking</h1>
-
- <p>These classes are used to handle input and output
- to and from external devices, processes, files etc., as
- well as manipulating files and directories.</p>
-
- <p>
- <table width="100%">
- <tr valign="top" bgcolor="#e0e0e0">
- <td><b>
- <a href="http://doc.qt.io/qt-5/qabstractsocket.html">QAbstractSocket</a>
- </b></td>
- <td>
- The base functionality common to all socket types
- </td></tr>
-
- <tr valign="top" bgcolor="#e0e0e0">
- <td><b>
- <a href="http://doc.qt.io/qt-5/qbuffer.html">QBuffer</a>
- </b></td>
- <td>
- QIODevice interface for a QByteArray
- </td></tr>
-
- <tr valign="top" bgcolor="#e0e0e0">
- <td><b>
- <a href="http://doc.qt.io/qt-5/qclipboard.html">QClipboard</a>
- </b></td>
- <td>
- Access to the window system clipboard
- </td></tr>
- </table>
- \endraw
- \endquotation
-
- Note that overview pages related to the group, must be listed
- explicitly using the \l {generatelist-command} {\\generatelist}
- command with the \c related argument.
-
- \code
- / *!
- \group architecture
-
- \title Architecture
-
- These documents describe aspects of Qt's architecture
- and design, including overviews of core Qt features and
- technologies.
-
- \generatelist{related}
- * /
- \endcode
-
- See also \l {ingroup-command} {\\ingroup} and \l
- {generatelist-command} {\\generatelist}.
-
- \target headerfile-command
- \section1 \\headerfile
-
- The \\headerfile command is for documenting the global functions,
- types and macros that are declared in a header file, but not in a
- namespace. The argument is the name of the header file. The HTML
- page is written to a \c {.html} file constructed from the header
- file argument.
-
- The documentation for a function, type, or macro that is declared
- in the header file being documented, is included in the header file
- page using the \l {relates-command} {\\relates} command.
-
- If the argument doesn't exist as a header file, the \\headerfile
- command creates a documentation page for the header file anyway.
-
- \code
- / *!
- \headerfile <QtAlgorithms>
-
- \title Generic Algorithms
-
- \brief The <QtAlgorithms> header file provides
- generic template-based algorithms.
-
- Qt provides a number of global template functions in \c
- <QtAlgorithms> that work on containers and perform
- well-know algorithms.
- * /
- \endcode
-
- QDoc generates a header file page \c{qtalgorithms.html} that looks
- like this:
-
- \quotation
- \raw HTML
- <center><h1>&lt;QtAlgorithms&gt; -
- Generic Algorithms</h1></center>
- <p>The <QtAlgorithms> header file provides generic
- template-based algorithms.
- <a href="13-qdoc-commands-topics.html#header-command">More...</a>
- </p>
-
- <h3>Functions</h3>
- <ul>
- <li>RandomAccessIterator
- <a href="http://doc.qt.io/qt-5/qtalgorithms-obsolete.html#qBinaryFind">qBinaryFind</a></b>
- (RandomAccessIterator begin, RandomAccessIterator end,
- const T & value)</li>
- <li>...</li></ul>
- <hr />
- \endraw
-
- \target header
-
- \raw HTML
- <h2>Detailed Description</h2>
- <p>The <QtAlgorithms> header file provides generic
- template-based algorithms. </p>
- \endraw
-
- Qt provides a number of global template functions in \c
- <QtAlgorithms> that work on containers and perform
- well-know algorithms.
-
- ...
- \endquotation
-
- \target macro-command
- \section1 \\macro
-
- The \\macro command is for documenting a C++ macro. The argument
- is the macro in one of three styles: function-like macros like
- Q_ASSERT(), declaration-style macros like Q_PROPERTY(), and macros
- without parentheses like Q_OBJECT.
-
- The \\macro comment must contain a \l {relates-command}
- {\\relates} command that attaches the macro comment to a class,
- header file, or namespace. Otherwise, the documentation will be
- lost. Here are three example macro comments followed by what they
- might look like in \c {qtglobal.html} or \c {qobject.html}:
-
- \code
- / *!
- \macro void Q_ASSERT(bool test)
- \relates <QtGlobal>
-
- Prints a warning message containing the source code
- file name and line number if \a test is false.
-
- ...
-
- \sa Q_ASSERT_X(), qFatal(), {Debugging Techniques}
- * /
- \endcode
-
- \quotation
- \raw HTML
- <h3>void Q_ASSERT ( bool <i>test</i> )</h3>
- \endraw
-
- Prints a warning message containing the source code
- file name and line number if \a test is false.
-
- ...
-
- See also Q_ASSERT_X(), qFatal() and \l {Debugging Techniques}.
-
- \endquotation
-
- \code
- / *!
- \macro Q_PROPERTY(...)
- \relates QObject
-
- This macro declares a QObject property. The syntax is:
-
- ...
-
- \sa {Qt's Property System}
- * /
- \endcode
-
- \quotation
- \raw HTML
- <h3>Q_PROPERTY ( ... )</h3>
- \endraw
-
- This macro declares a QObject property. The syntax is:
-
- ...
-
- See also \l {Qt's Property System}.
- \endquotation
-
- \code
- / *!
- \macro Q_OBJECT
- \relates QObject
-
- The Q_OBJECT macro must appear in the private section
- of a class definition that declares its own signals and
- slots, or that uses other services provided by Qt's
- meta-object system.
-
- ...
-
- \sa {Meta-Object System}, {Signals and Slots}, {Qt's
- Property System}
- * /
- \endcode
-
- \quotation
- \raw HTML
- <h3>Q_OBJECT</h3>
- \endraw
-
- The Q_OBJECT macro must appear in the private section
- of a class definition that declares its own signals and
- slots or that uses other services provided by Qt's
- meta-object system.
-
- ...
-
- See also \l {Meta-Object System}, \l {Signals &
- Slots} and \l {Qt's Property System}.
- \endquotation
-
- \target module-command
- \section1 \\module
-
- The \\module creates a page that lists the classes belonging to
- the module specified by the command's argument. A class included
- in the module by including the \l {inmodule-command} {\\inmodule}
- command in the \\class comment.
-
- The \\module command is typically followed by a \l {title-command}
- {\\title} and a \l {brief-command} {\\brief} command. Each class
- is listed as a link to the class reference page followed by the
- text from the class's \l {brief-command} {\\brief} command. For
- example:
-
- \code
- / *!
- \module QtNetwork
-
- \title Qt Network Module
-
- \brief Contains classes for writing TCP/IP clients and servers.
-
- The network module provides classes to make network
- programming easier and portable. It offers both
- high-level classes such as QNetworkAccessManager that
- implements application-level protocols, and
- lower-level classes such as QTcpSocket, QTcpServer, and
- QUdpSocket.
- * /
- \endcode
-
- QDoc renders this in \c {qtnetwork.html} like this:
-
- \quotation
- \raw HTML
- <h1><center>Qt Network Module</center></h1>
- \endraw
-
- The Qt Network module offers classes that allow you to
- write TCP/IP clients and servers.\l {module
- details} {More...}
-
- \raw HTML
- <p>
- <table width="100%">
- <tr valign="top" bgcolor="#d0d0d0">
- <td><b>
- <a href="http://doc.qt.io/qt-5/qabstractsocket.html">QAbstractSocket</a>
- </b></td>
- <td>
- The base functionality common to all socket types
- </td></tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td><b>
- <a href="http://doc.qt.digia.com/4.0/qftp.html">QFtp</a>
- </b></td>
- <td>
- Implementation of the FTP protocol
- </td></tr>
-
- <tr valign="top" bgcolor="#d0d0d0">
- <td>...</td>
- <td>...</td>
- </tr>
- </table>
-
- <p><hr /></p>
- \endraw
-
- \target module details
-
- \raw HTML
- <h2>Detailed Description</h2>
-
- <p>
- The Qt Network module offers classes that allow you to
- write TCP/IP clients and servers.
- </p>
-
- <p>
- The network module provides classes to make network
- programming easier and portable. It offers both
- high-level classes such as QNetworkAccessManager that
- implements application-level protocols, and
- lower-level classes such as QTcpSocket, QTcpServer, and
- QUdpSocket.
- </p>
- \endraw
-
- ...
-
- \endquotation
-
- See also \l {inmodule-command} {\\inmodule}
-
- \target namespace-command
- \section1 \\namespace
-
- The \\namespace command is for documenting the contents of the C++
- namespace named as its argument. The documentation outline QDoc
- generates for a namespace is similar to the outline it generates
- for a C++ class.
-
- \code
- / *!
- \namespace Qt
-
- \brief Contains miscellaneous identifiers used throughout the Qt library.
- * /
- \endcode
-
- QDoc renders this in \c{qt.html} like this:
-
- \quotation
- \raw HTML
- <center><h1>Qt Namespace Reference</h1></center>
- <p>The Qt namespace contains miscellaneous
- identifiers used throughout the Qt library.
- <a href="13-qdoc-commands-topics.html#name">More...</a>
- </p>
-
- <pre>#include &lt;Qt&gt;</pre>
- <ul>
- <li>
- <a href="http://doc.qt.digia.com/4.0/qt-qt3.html">
- Qt 3 support members</a></li>
- </ul>
-
-
- <h3>Types</h3>
- <ul>
- <li>flags
- <a href="http://doc.qt.digia.com/4.0/qt.html#AlignmentFlag-enum">Alignment</a></b></li>
- <li>...</li></ul>
- <hr />
- \endraw
-
- \target name
-
- \raw HTML
- <h2>Detailed Description</h2>
- <p>Contains miscellaneous identifiers
- used throughout the Qt library.</p>
- \endraw
-
- ...
- \endquotation
-
- \target page-command
- \section1 \\page
-
- The \\page command is for creating a stand-alone documentation
- page. The argument can consist of two parts separated by a
- space. The first part is the name of the file where QDoc should
- store the page. The second part, if present, is a word that
- specifies the page type. Currently, the second part can be one of
- the following list of words:
-
- \list
-
- \li faq - A frequently asked question.
-
- \li howto - A user guide on how to use some components of the
- software.
-
- \li example - A page that describes a working example.
-
- \li overview - For text pages that provide an overview of some
- important subject.
-
- \li tutorial - For text pages that are part of a tutorial.
-
- \li api - This is the type of page used for C++ class references and
- QML type references. You should never use this one for the pages
- you write, because this one is reserved for qdoc.
-
- \endlist
-
- The page title is set using the \l {title-command} {\\title}
- command.
-
- \code
- / *!
- \page aboutqt.html
-
- \title About Qt
-
- Qt is a C++ toolkit for cross-platform GUI
- application development. Qt provides single-source
- portability across Microsoft Windows, OS X, Linux,
- and all major commercial Unix variants.
-
- Qt provides application developers with all the
- functionality needed to build applications with
- state-of-the-art graphical user interfaces. Qt is fully
- object-oriented, easily extensible, and allows true
- component programming.
-
- ...
- * /
- \endcode
-
- QDoc renders this page in \c {aboutqt.html}.
-
- \target property-command
- \section1 \\property
-
- The \\property command is for documenting a Qt property. The
- argument is the full property name.
-
- A property is defined using the Q_PROPERTY() macro. The macro
- takes as arguments the property's name and its set, reset and get
- functions.
-
- \code
- Q_PROPERTY(QString state READ state WRITE setState)
- \endcode
-
- The set, reset and get functions don't need to be documented,
- documenting the property is sufficient. QDoc will generate a list
- of the access function that will appear in the property
- documentation which in turn will be located in the documentation
- of the class that defines the property.
-
- The \\property command comment typically includes a \l
- {brief-command} {\\brief} command. For properties the \l
- {brief-command} {\\brief} command's argument is a sentence
- fragment that will be included in a one line description of the
- property. The command follows the same rules for the \l
- {brief-property} {description} as the \l {variable-command}
- {\\variable} command.
-
- \code
- / *!
- \property QPushButton::flat
- \brief Whether the border is disabled.
-
- This property's default is false.
- * /
- \endcode
-
- QDoc includes this in \c {qpushbutton.html} like this:
-
- \quotation
- \raw HTML
- <h3>flat : bool</h3>
- \endraw
-
- This property holds whether the border is disabled.
-
- This property's default is false.
-
- Access functions:
-
- \list
- \li \b { bool isFlat () const}
- \li \b { void setFlat ( bool )}
- \endlist
-
- \endquotation
-
- \code
- / *!
- \property QWidget::width
- \brief The width of the widget excluding any window frame.
-
- See the \l {Window Geometry} documentation for an
- overview of window geometry.
-
- \sa geometry, height, size
- * /
- \endcode
-
- QDoc includes this in \c {qwidget.html} like this:
-
- \quotation
- \raw HTML
- <h3>width : const int</h3>
- \endraw
-
- This property holds the width of the widget excluding
- any window frame.
-
- See the \l {Window Geometry} documentation for an
- overview of window geometry.
-
- Access functions:
-
- \list
- \li \b { int width () const}
- \endlist
-
- See also \l{QWidget::geometry} {geometry},
- \l{QWidget::height} {height}, and \l{QWidget::size} {size}.
- \endquotation
-
- \target qmlattachedproperty-command
- \section1 \\qmlattachedproperty
-
- The \\qmlattachedproperty command is for documenting a QML
- property that will be attached to some QML type. See
- \l{http://qt-project.org/doc/qt-4.7/qdeclarativeintroduction.html#attached-properties}
- {Attached Properties}. The argument is the rest of the line. The
- argument text should be the property type, followed by the QML
- element name where the property is being declared, the \c{::}
- qualifier, and finally the property name. If we have a QML
- attached property named \c isCurrentItem in QML \c ListView,
- and the property has type \c {bool}, the \\qmlattachedproperty for
- it would look like this:
-
- \code
- / *!
- \qmlattachedproperty bool ListView::isCurrentItem
- This attached property is \c true if this delegate is the current
- item; otherwise false.
-
- It is attached to each instance of the delegate.
-
- This property may be used to adjust the appearance of the current
- item, for example:
-
- \snippet doc/src/snippets/declarative/listview/listview.qml isCurrentItem
- * /
- \endcode
-
- QDoc includes this attached property on the QML reference page for the
- \l{http://qt-project.org/doc/qt-4.7/qml-listview.html#isCurrentItem-prop}
- {ListView} element.
-
- \target qmlattachedsignal-command
- \section1 \\qmlattachedsignal
-
- The \\qmlattachedsignal command is for documenting an attachable
- \l{Signal and Handler Event System}{signal}. The \\qmlattachedsignal
- command is used just like the \l{qmlsignal-command} {\\qmlsignal} command.
-
- The argument is the rest of the line. It should be the name of the
- QML type where the signal is declared, the \c{::}
- qualifier, and finally the signal name. For example, a QML
- attached signal named \c add() in the \c GridView
- element is documented like this:
-
- \code
- / *!
- \qmlattachedsignal GridView::add()
- This attached signal is emitted immediately after an item is added to the view.
- * /
- \endcode
-
- QDoc includes this documentation on the QML reference page for the
- \l GridView element.
-
- \target qmlbasictype-command
- \section1 \\qmlbasictype
-
- The \\qmlbasictype command is for documenting a basic type for QML.
- The argument is the type name. The type must be included in the
- QML basic types group using the \l{ingroup-command}{\\ingroup}
- command as shown below. This will cause QDoc to include the
- documentation for the type on the
- \l{http://qt-project.org/doc/qt-4.7/qdeclarativebasictypes.html}
- {QML Basic Types} page. The \l{brief-command} {\\brief} command
- is also required, because it appears on the
- \l{http://qt-project.org/doc/qt-4.7/qdeclarativebasictypes.html}
- {QML Basic Types} page as well.
-
- \code
- / *!
- \qmlbasictype int
- \ingroup qmlbasictypes
-
- \brief An integer is a whole number, for example 0, 10, or -20.
-
- An integer is a whole number, e.g. 0, 10, or -20. The possible
- \c int values range from around -2000000000 to around
- 2000000000, although most elements will only accept a reduced
- range (which they mention in their documentation).
-
- Example:
- \qml
- Item { width: 100; height: 200 }
- \endqml
-
- \sa {QML Basic Types}
- * /
- \endcode
-
- QDoc outputs this as \l{http://qt-project.org/doc/qt-4.7/qml-int.html}
- {qml-int.html}.
-
- \target qmlclass-command
- \section1 \\qmlclass
-
- This command is deprecated. Use \l{qmltype-command} {\\qmltype}
- instead.
-
- The \\qmlclass command is for documenting a QML type that is
- instantiated by a C++ class. The command has two arguments. The
- first argument is the name of the QML type. The second argument
- is the name of the C++ class that instantiates the QML type.
-
- \code
- / *!
- \qmlclass Transform QGraphicsTransform
- \ingroup qml-transform-elements
- \since 4.7
- \brief Provides a way of building advanced transformations on Items.
-
- The Transform element is a base type which cannot be
- instantiated directly. The following concrete Transform types
- are available:
-
- \list
- \li \l Rotation
- \li \l Scale
- \li \l Translate
- \endlist
-
- The Transform elements let you create and control advanced
- transformations that can be configured independently using
- specialized properties.
-
- You can assign any number of Transform elements to an \l
- Item. Each Transform is applied in order, one at a time.
-
- * /
- \endcode
-
- This example generates the
- \l {http://qt-project.org/doc/qt-4.7/qml-transform.html} {QML Transform}
- page. The \\qmlclass comment should include the \l
- {since-command} {\\since} command, because all QML types are
- new. It should also include the \l{brief-command} {\\brief}
- command. If a type is a member of a group of QML
- types, it should also include one or more \l{ingroup-command}
- {\\ingroup} commands.
-
- \target qmlmethod-command
- \section1 \\qmlmethod
-
- The \\qmlmethod command is for documenting a QML method. The
- argument is the complete method signature, including return
- type and parameter names and types.
-
- \code
- / *!
- \qmlmethod void TextInput::select(int start, int end)
-
- Causes the text from \a start to \a end to be selected.
-
- If either start or end is out of range, the selection is not changed.
-
- After having called this, selectionStart will become the lesser, and
- selectionEnd the greater (regardless of the order passed to this method).
-
- \sa selectionStart, selectionEnd
- * /
- \endcode
-
- QDoc includes this documentation on the element reference page for the
- \l{http://qt-project.org/doc/qt-4.7/qml-textinput.html#select-method}
- {TextInput} element.
-
- \target qmltype-command
- \section1 \\qmltype
-
- The \\qmltype command is for documenting a QML type. The command
- has one argument, which is the name of the QML type.
-
- If the QML type is instantiated by a C++ class, that class must be
- specified using the \l{instantiates-command} {\\instantiates}
- context command.
-
- \code
- / *!
- \qmltype Transform
- \instantiates QGraphicsTransform
- \ingroup qml-transform-elements
- \since 4.7
- \brief The Transform elements provide a way to build
- advanced transformations on Items.
-
- The Transform element is a base type which cannot be
- instantiated directly. The concrete Transform types are:
-
- \list
- \li \l Rotation
- \li \l Scale
- \li \l Translate
- \endlist
-
- The Transform elements let you create and control advanced
- transformations that can be configured independently using
- specialized properties.
-
- You can assign any number of Transform elements to an \l
- Item. Each Transform is applied in order, one at a time.
-
- * /
- \endcode
-
- The example generates the \l
- {http://qt-project.org/doc/qt-4.7/qml-transform.html} {QML Transform}
- page. The \e{\\qmltype} comment includes \l{instantiates-command}
- {\\instantiates} to specify that a Transform is instantiated by
- the C++ class QGraphicsTransform. A \\qmltype comment should
- always include a \l {since-command} {\\since} command, because all
- QML types are new. It should also include a \l{brief-command}
- {\\brief} description. If a QML type is a member of a QML type group,
- the \\qmltype comment should include one or more \l{ingroup-command}
- {\\ingroup} commands.
-
-
- \target qmlproperty-command
- \section1 \\qmlproperty
-
- The \\qmlproperty command is for documenting a QML property. The
- argument is the rest of the line. The argument text should be the
- property type, followed by the QML type name, the \c{::}
- qualifier, and finally the property name. If we have a QML
- property named \c x in QML type \c Translate, and the property
- has type \c {real}, the \\qmlproperty for it would look like this:
-
- \code
- / *!
- \qmlproperty real Translate::x
-
- The translation along the X axis.
- * /
- \endcode
-
- QDoc includes this QML property on the QML reference page for the
- \l {http://qt-project.org/doc/qt-4.7/qml-translate.html} {Translate}
- element.
-
- If the QML property is of enumeration type, or it holds a bit-wise
- combination of flags, the \l{value-command}{\\value} command can
- be used to document the acceptable values.
-
- \target qmlsignal-command
- \section1 \\qmlsignal
-
- The \\qmlsignal command is for documenting a QML signal.
- The argument is the rest of the line. The arguments should be: the QML type
- where the signal is declared, the \c{::} qualifier, and finally the signal
- name. If we have a QML signal named \c clicked(), the documentation for it
- would look like this:
-
- \code
- / *!
- \qmlsignal UIComponents::Button::clicked()
- This signal is emitted when the user clicks the button. A click is defined
- as a press followed by a release. The corresponding handler is
- \c onClicked.
- * /
- \endcode
-
- QDoc includes this documentation on the QML reference page for the
- \l{http://qt-project.org/doc/qt-4.7/qml-mousearea.html#onEntered-signal}
- {MouseArea} element.
-
- \target qmlmodule-command
- \section1 \\qmlmodule
-
- Insert the \c{\\qmlmodule} command to create a \c QML module page. A QML
- module is a collection of QML types or any related material. This
- command is similar to the \l{group-command}.
-
- A QML class may belong to a module by inserting the
- \l{inqmlmodule-command}{\\inqmlmodule} command as a topic command.
- Every member of a group must be linked to using the module name and two
- colons (\c{::}).
-
- \code
- \beginqdoc
- A link to the TabWidget of the UI Component is \l {UIComponent::TabWidget}.
- \endqdoc
- \endcode
-
- QDoc will generate a page for the module with a listing of the members
- of the module.
-
- \code
- \qmlmodule ClickableComponents
-
- This is a list of the Clickable Components set. A Clickable component
- responds to a \c clicked() event.
- \endcode
-
- The \l{componentset}{UIComponents} example demonstrates proper usage of
- QDoc commands to document QML types and QML modules.
-
- \target inqmlmodule-command
- \section1 \\inqmlmodule
-
- A QML class may belong to a \l{qmlmodule-command}{QML module} by inserting
- the \l{inqmlmodule-command}{\\inqmlmodule} command as a topic command, with
- the module name (without a version number) as the only argument. Every
- member of a group must be linked to using the module name and two colons
- (\c{::}).
-
- \code
- \qmltype ClickableButton
- \inqmlmodule ClickableComponents
-
- A clickable button that responds to the \c click() event.
- \endcode
-
- To link to the \c ClickableButton, use the
- \c{\l ClickableComponents::ClickableButton} format.
-
- The \l{componentset}{UIComponents} example demonstrates proper usage of
- QDoc commands to document QML types and QML modules.
-
- \target instantiates-command
- \section1 \\instantiates
-
- The \\instantiates command is used in the \l{qmltype-command} {QML
- type} comment of an elemental QML type to specify the name of the
- C++ class that instantiates the QML type.
-
- If the QML type is not instantiated by a C++ class, this command
- is not used.
-
- \code
- / *!
- \qmltype Transform
- \instantiates QGraphicsTransform
- \ingroup qml-transform-elements
- \since 4.7
- \brief Provides elements provide a way to build
- advanced transformations on Items.
-
- The Transform element is a base type which cannot be
- instantiated directly.
- * /
- \endcode
-
- The example generates the \l
- {http://qt-project.org/doc/qt-4.7/qml-transform.html} {QML Transform}
- page. The \e{\\qmltype} comment includes \l{instantiates-command}
- {\\instantiates} to specify that a Transform is instantiated by
- the C++ class QGraphicsTransform. A \\qmltype comment should
-
- \target typedef-command
- \section1 \\typedef
-
- The \\typedef command is for documenting a C++ typedef. The
- argument is the name of the typedef. The documentation for
- the typedef will be included in the reference documentation
- for the class, namespace, or header file in which the typedef
- is declared. To relate the \\typedef to a class, namespace, or
- header file, the \\typedef comment must contain a
- \l {relates-command} {\\relates} command.
-
- \code
- / *!
- \typedef QObjectList
- \relates QObject
-
- Synonym for QList<QObject>.
- * /
- \endcode
-
- QDoc includes this in \c {qobject.html} as:
-
- \quotation
- \raw HTML
- <h3>typedef QObjectList</h3>
- \endraw
-
- Synonym for QList<QObject>.
- \endquotation
-
- Another, although more rare, example:
-
- \code
- / *!
- \typedef QMsgHandler
- \relates QtGlobal
-
- This is a typedef for a pointer to a function with the
- following signature:
-
- \code
- void myMsgHandler(QtMsgType, const char *);
- \ endcode
-
- \sa QtMsgType, qInstallMsgHandler()
- * /
- \endcode
-
- QDoc includes this in \c {qtglobal.html} as:
-
- \quotation
- \raw HTML
- <h3>typedef QtMsgHandler</h3>
- \endraw
-
- This is a typedef for a pointer to a function with the
- following signature:
-
- \raw HTML
- <tt>
- <pre> void myMsgHandler(QtMsgType, const char *);</pre>
- </tt>
- \endraw
-
- See also QtMsgType and qInstallMsgHandler().
- \endquotation
-
- Other typedefs are located on the reference page for the class
- that defines them.
-
- \code
- / *!
- \typedef QLinkedList::Iterator
-
- Qt-style synonym for QList::iterator.
- * /
- \endcode
-
- QDoc includes this one on the reference page for class QLinkedList as:
-
- \quotation
- \raw HTML
- <h3>typedef QLinkedList::Iterator</h3>
- \endraw
-
- Qt-style synonym for QList::iterator.
- \endquotation
-
- \target variable-command
- \section1 \\variable
-
- The \\variable command is for documenting a class member variable
- or a constant. The argument is the variable or constant name. The
- \\variable command comment includes a \l {brief-command} {\\brief}
- command. QDoc generates the documentation based on the text from
- \\brief command.
-
- The documentation will be located in the in the associated class,
- header file, or namespace documentation.
-
- In case of a member variable:
-
- \code
- / *!
- \variable QStyleOption::palette
- \brief The palette that should be used when painting
- the control
- * /
- \endcode
-
- QDoc includes this in qstyleoption.html as:
-
- \quotation
- \raw HTML
- <h3>
- <a href="http://doc.qt.io/qt-5/qpalette.html">
- QPalette
- </a>
- QStyleOption::palette
- </h3>
- \endraw
-
- This variable holds the palette that should be used
- when painting the control.
- \endquotation
-
- You can also document constants with the \\variable command. For
- example, suppose you have the \c Type and \c UserType constants in
- the QTreeWidgetItem class:
-
- \code
- enum { Type = 0, UserType = 1000 };
- \endcode
-
- For these, the \\variable command can be used this way:
-
- \code
- / *!
- \variable QTreeWidgetItem::Type
-
- The default type for tree widget items.
-
- \sa UserType, type()
- * /
- \endcode
- \code
- / *!
- \variable QTreeWidgetItem::UserType
-
- The minimum value for custom types. Values below
- UserType are reserved by Qt.
-
- \sa Type, type()
- * /
- \endcode
-
- QDoc includes these in qtreewidget.html as:
-
- \quotation
- \raw HTML
- <h3>
- const int QTreeWidgetItem::Type
- </h3>
- \endraw
-
- The default type for tree widget items.
-
- See also \l {QTreeWidgetItem::UserType} {UserType} and \l
- {QTreeWidgetItem::type()} {type()}.
-
- \raw HTML
- <h3>
- const int QTreeWidgetItem::UserType
- </h3>
- \endraw
-
- The minimum value for custom types. Values below
- UserType are reserved by Qt.
-
- See also \l {QTreeWidgetItem::Type} {Type} and
- \l{QTreeWidgetItem::type()} {type()}.
-
- \endquotation
-*/
diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc
deleted file mode 100644
index c0a1afaa52..0000000000
--- a/src/tools/qdoc/doc/qdoc-manual.qdoc
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qdoc-index.html
- \nextpage Introduction to QDoc
-
- \title QDoc Manual
-
- \list
- \li \l {Introduction to QDoc}
- \li \l {Getting Started with QDoc}
- \li \l {Command Index}
- \li \l {Topic Commands}
- \li \l {Context Commands}
- \list
- \li \l {Document Navigation}
- \li \l {Reporting Status}
- \li \l {Thread Support}
- \li \l {Relating Things}
- \li \l {Grouping Things}
- \li \l {Naming Things}
- \endlist
- \li \l{Markup Commands}
- \list
- \li \l {Text Markup}
- \li \l {Document Structure}
- \li \l {Including Code Inline}
- \li \l {Including External Code}
- \li \l {Creating Links}
- \li \l {Including Images}
- \li \l {Tables and Lists}
- \li \l {Special Content}
- \li \l {Miscellaneous}
- \endlist
- \li \l{Creating DITA Maps}
- \li \l {The QDoc Configuration File}
- \list
- \li \l {Generic Configuration Variables}
- \li \l {Creating Help Project Files}
- \li \l {C++ Specific Configuration Variables}
- \li \l {HTML Specific Configuration Variables}
- \li \l {Supporting Derived Projects}
- \li \l {Example Manifest Files}
- \li \l {qtgui.qdocconf}
- \li \l {minimum.qdocconf}
- \li \l {Generating DITA XML Output}
- \endlist
- \li \l {QA Pages}
- \endlist
-
-*/
-
-
diff --git a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
deleted file mode 100644
index 77d252b24c..0000000000
--- a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qdoc-minimum-qdocconf.html
-\target minimal-qdocconf
-\title A minimal qdocconf file
-
-\brief Describes a minimal .qdocconf file
-
-Below you will find the full contents of qtgui.qdocconf. The subsequent section
-will discuss every statement in the qdocconf file.
-
-Each line from the qdocconf file is first quoted. Below each statement you will
-find the meaning.
-
-\code
- #include(compat.qdocconf)
- outputdir = html
- headerdirs = .
- sourcedirs = .
- exampledirs = .
- imagedirs = ./images
-\endcode
-
-\title Notes
-
-\code
- #include(compat.qdocconf)
-\endcode
-
-For compatibility with older versions of Qt, it is recommended
-to include compat.qdocconf.
-
-\code
- outputdir = html
-\endcode
-
-QDoc will put the documentation generated in the html directory.
-
-\code
- headerdirs = .
-\endcode
-
-The header file associated with the \e .cpp source files can be found in the
-current directory.
-
-\code
- sourcedirs = .
-\endcode
-
-The current directory is the directory containing the source files: the \e .cpp
-and \e .qdoc files used in the documentation.
-
-\code
- exampledirs = .
-\endcode
-
-The source code of the example files can be found in the current directory.
-
-\code
- imagedirs = ./images
-\endcode
-
-The image files can be found in the underlying directory "images".
-
-\note Please take care with this minimal qdocconf file. Using it in the wrong directory
-could cause qdoc to include a large number of files.
-*/
diff --git a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc b/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
deleted file mode 100644
index 3dcd2482d6..0000000000
--- a/src/tools/qdoc/doc/qtgui-qdocconf.qdoc
+++ /dev/null
@@ -1,310 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software 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 Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-
-\page qtgui-qdocconf.html
-\title qtgui.qdocconf with Comments
-
-\brief A walkthrough of a typical qdocconf file
-
-This document goes through a typical Qt 5 qdocconf file. The contents is taken from
-Qt GUI's \e qtgui.qdocconf file.
-
-Below you will find the full contents of qtgui.qdocconf. The subsequent section will discuss
-every statement in the qdocconf file.
-
-\code
- include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-
- project = QtGui
- description = Qt GUI Reference Documentation
- url = http://doc.qt.io/qt-$QT_VER/qtgui-index.html
- version = $QT_VERSION
-
- examplesinstallpath = gui
-
- qhp.projects = QtGui
-
- qhp.QtGui.file = qtgui.qhp
- qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG
- qhp.QtGui.virtualFolder = qtgui
- qhp.QtGui.indexTitle = Qt GUI
- qhp.QtGui.indexRoot =
-
- qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc
- qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION
- qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION
-
- qhp.QtGui.subprojects = classes
- qhp.QtGui.subprojects.classes.title = C++ Classes
- qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
- qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
- qhp.QtGui.subprojects.classes.sortPages = true
-
- tagfile = ../../../doc/qtgui/qtgui.tags
-
- depends += \
- qtcore \
- qtnetwork \
- qtopengl \
- qtsvg \
- qtqml \
- qtquick \
- qtwidgets \
- qtdoc
-
- headerdirs += ..
-
- sourcedirs += .. \
- ../../../examples/gui/doc/src
-
- excludedirs = ../../../examples/gui/doc/src/tmp
-
- exampledirs += ../../../examples/gui \
- snippets
-
- imagedirs += images \
- ../../../examples/gui/doc/images \
- ../../../doc/src/images \
-\endcode
-
-\title Qtgui.qdocconf with notes
-
-\code
- include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-\endcode
-
-QDoc inherits the default templates, macros, and settings from the directory
-specified from the \c $QT_INSTALL_DOCS variable. \c qmake prints the value of
-the variable.
-\code
- qmake -query
-\endcode
-
-\sa include
-
-\code
- project = QtGui
-\endcode
-
-The \c project variable sets the name of the QDoc build. This name is also
-used to form the index file, which, in this case, will be \e qtgui.index. The
-name of the index file doesn't adopt the uppercase letters of the project name.
-
-\sa project
-
-\code
- description = Qt GUI Reference Documentation
-\endcode
-
-A short description of the project concerned.
-
-\code
- url = http://doc.qt.io/qt-$QT_VER/qtgui-index.html
-\endcode
-
-The \c url variable holds the base url of the project.
-
-The URL is stored in the generated index file for the project.
-QDoc will use this as the base URL when constructing links
-to content listed in the index.
-
-\note QDoc omits this value when the -installdir argument
-is specified when running QDoc.
-
-\keyword examplesinstallpath
-
-\code
- examplesinstallpath = gui
-\endcode
-
-This \e examplesinstallpath variable indicates that the examples will be installed
-in the \e gui directory under the parent examples directory (for Qt, this is
-$QT_INSTALL_EXAMPLES).
-
-\note The examplepath variable has to match the example directory specified in exampledirs.
-\sa exampledirs
-
-\code
- qhp.projects = QtGui
- qhp.QtGui.file = qtgui.qhp
-\endcode
-
-The following parameters are for creating a QHP file (\e .qhp). The qhelpgenerator
-program can convert the QHP file into a QCH file (\e .qch), which can be opened in
-Qt Assistant or Qt Creator.
-
-\code
- qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG
-\endcode
-
-A unique identifier which enables QHelpEngine to retrieve the helpfile
-from a given link. This namespace is also used as a base url for links
-to the helpfile.
-
-\code
- qhp.QtGui.virtualFolder = qtgui
-\endcode
-
-Virtual folders group documentation together into a single location. A
-virtual folder will become the root directory of all files referenced in a
-compressed help file.
-
-When two manuals are located in the same virtual folder, it is possible to refer
- to sections of the other manual using relative paths.
-The virtual folder tag is mandatory and the folder must not contain any '/'.
-
-\code
- qhp.QtGui.indexTitle = Qt GUI the title of the page that has the contents
-\endcode
-
-This is the title of the page that has the contents.
-
-\code
- qhp.QtGui.indexRoot = to be checked
-\endcode
-
-Specifies the title of the root (namespace) page to generate the documentation for.
-Typically defined as an empty string.
-
-\code
- qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc
- qhp.QtGui.customFilters.Qt.name = QtGui $QT_VERSION
- qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION
-\endcode
-
-The documentation set (one per QDoc project) can have any number of filter
-attributes assigned to it. A filter attribute is an ordinary string which
-can be freely chosen. Additionally, custom filters that reference above
-attributes can be defined. Qt Assistant will display the name of the custom
-filter in its \gui{Filtered by} drop-down list. Only the documentation sets
-that have their filter attributes match the attributes of the selected
-custom filter will be shown.
-
-\code
- qhp.QtGui.subprojects = classes
- qhp.QtGui.subprojects.classes.title = C++ Classes
- qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
-\endcode
-The subprojects specify the sections that are displayed in the table of contents
-for this project. In this example, the subproject, which is displayed in
-the Assistant's sidebar, is named "C++ Classes" and its index is the page
-titled "QT GUI C++ Classes".
-
-\code
- qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
-\endcode
-
-Lists all headerfiles.
-
-A ‘fake’ type specifies a generic documentation node, and is followed by
-a c\ : and a \e subtype specifier.
-
-Possible values:
-\code
- example
- headerfile
- file
- group
- module
- page
- externalpage
- qmlclass
- qmlpropertygroup
- qmlbasictype
-\endcode
-
-tagfile = ../../../doc/qtgui/qtgui.tags
-This specifies the Doxygen tag file that needs to be written when the html is generated
-by QDoc.
-
-\code
-depends += \
- qtcore \
- qtnetwork \
- qtopengl \
- qtsvg \
- qtqml \
- qtquick \
- qtwidgets \
- qtdoc
-\endcode
-
-Specifies the modules QDoc needs to load for generating output for Qt GUI.
-QDoc loads the index files for all modules listed in the depends statement in
-order to enable linking to pages in these modules.
-
-\code
- headerdirs += ..
-\endcode
-
-Add the parent directory to the list of directories containing the header files
-associated with the \e .cpp source files.
-
-\code
- sourcedirs += .. \
- ../../../examples/gui/doc/src
-\endcode
-
-Add the specified directories to the list of directories containing the \e .cpp and
-\e .qdoc files used in the documentation.
-
-\code
- excludedirs = ../../../examples/gui/doc/src/tmp
-\endcode
-
-The \c excludedirs variable is for listing directories that should not be processed
-by qdoc, even if the same directories are included by the \c sourcedirs or \c headerdirs
-variables.
-
-When executed, QDoc will ignore the directories listed.
-\sa excludefiles
-
-\code
- exampledirs += ../../../examples/gui \
- snippets
-\endcode
-\sa {examples-variable}{examples}
-\sa examplesinstallpath
-
-Add the two directories specified to the list of directories containing the source
-code of the example files.
-
-If QDoc encounters both \c exampledirs and \c examples, it will look first in the
-\c examples directory. QDoc will accept the first matching file it finds. QDoc will
-search in the directories specified, not in their subdirectories.
-
-\code
- imagedirs += images \
- ../../../examples/gui/doc/images \
- ../../../doc/src/images \
-\endcode
-
-Add the directories specified above to the list of directories where the images
-can be found.
-*/
diff --git a/src/tools/qdoc/editdistance.cpp b/src/tools/qdoc/editdistance.cpp
deleted file mode 100644
index c3336d2ab5..0000000000
--- a/src/tools/qdoc/editdistance.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- editdistance.cpp
-*/
-
-#include "editdistance.h"
-
-QT_BEGIN_NAMESPACE
-
-int editDistance( const QString& s, const QString& t )
-{
-#define D( i, j ) d[(i) * n + (j)]
- int i;
- int j;
- int m = s.length() + 1;
- int n = t.length() + 1;
- int *d = new int[m * n];
- int result;
-
- for ( i = 0; i < m; i++ )
- D( i, 0 ) = i;
- for ( j = 0; j < n; j++ )
- D( 0, j ) = j;
- for ( i = 1; i < m; i++ ) {
- for ( j = 1; j < n; j++ ) {
- if ( s[i - 1] == t[j - 1] ) {
- D( i, j ) = D( i - 1, j - 1 );
- } else {
- int x = D( i - 1, j );
- int y = D( i - 1, j - 1 );
- int z = D( i, j - 1 );
- D( i, j ) = 1 + qMin( qMin(x, y), z );
- }
- }
- }
- result = D( m - 1, n - 1 );
- delete[] d;
- return result;
-#undef D
-}
-
-QString nearestName( const QString& actual, const QSet<QString>& candidates )
-{
- if (actual.isEmpty())
- return QString();
-
- int deltaBest = 10000;
- int numBest = 0;
- QString best;
-
- QSet<QString>::ConstIterator c = candidates.constBegin();
- while ( c != candidates.constEnd() ) {
- if ( (*c)[0] == actual[0] ) {
- int delta = editDistance( actual, *c );
- if ( delta < deltaBest ) {
- deltaBest = delta;
- numBest = 1;
- best = *c;
- } else if ( delta == deltaBest ) {
- numBest++;
- }
- }
- ++c;
- }
-
- if ( numBest == 1 && deltaBest <= 2 &&
- actual.length() + best.length() >= 5 ) {
- return best;
- } else {
- return QString();
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/editdistance.h b/src/tools/qdoc/editdistance.h
deleted file mode 100644
index 2a9b1710fa..0000000000
--- a/src/tools/qdoc/editdistance.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- editdistance.h
-*/
-
-#ifndef EDITDISTANCE_H
-#define EDITDISTANCE_H
-
-#include <qset.h>
-#include <qstring.h>
-
-QT_BEGIN_NAMESPACE
-
-int editDistance( const QString& s, const QString& t );
-QString nearestName( const QString& actual, const QSet<QString>& candidates );
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
deleted file mode 100644
index 7f0d4b48b9..0000000000
--- a/src/tools/qdoc/generator.cpp
+++ /dev/null
@@ -1,2072 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- generator.cpp
-*/
-#include <qdir.h>
-#include <qdebug.h>
-#include "codemarker.h"
-#include "config.h"
-#include "doc.h"
-#include "editdistance.h"
-#include "generator.h"
-#include "openedlist.h"
-#include "quoter.h"
-#include "separator.h"
-#include "tokenizer.h"
-#include "qdocdatabase.h"
-
-QT_BEGIN_NAMESPACE
-
-Generator* Generator::currentGenerator_;
-QStringList Generator::exampleDirs;
-QStringList Generator::exampleImgExts;
-QMap<QString, QMap<QString, QString> > Generator::fmtLeftMaps;
-QMap<QString, QMap<QString, QString> > Generator::fmtRightMaps;
-QList<Generator *> Generator::generators;
-QStringList Generator::imageDirs;
-QStringList Generator::imageFiles;
-QMap<QString, QStringList> Generator::imgFileExts;
-QString Generator::outDir_;
-QString Generator::outSubdir_;
-QStringList Generator::outFileNames_;
-QSet<QString> Generator::outputFormats;
-QHash<QString, QString> Generator::outputPrefixes;
-QString Generator::project_;
-QStringList Generator::scriptDirs;
-QStringList Generator::scriptFiles;
-QString Generator::sinceTitles[] =
-{
- " New Namespaces",
- " New Classes",
- " New Member Functions",
- " New Functions in Namespaces",
- " New Global Functions",
- " New Macros",
- " New Enum Types",
- " New Typedefs",
- " New Properties",
- " New Variables",
- " New QML Types",
- " New QML Properties",
- " New QML Signals",
- " New QML Signal Handlers",
- " New QML Methods",
- ""
-};
-QStringList Generator::styleDirs;
-QStringList Generator::styleFiles;
-bool Generator::debugging_ = false;
-bool Generator::noLinkErrors_ = false;
-bool Generator::autolinkErrors_ = false;
-bool Generator::redirectDocumentationToDevNull_ = false;
-Generator::QDocPass Generator::qdocPass_ = Generator::Neither;
-bool Generator::qdocSingleExec_ = false;
-bool Generator::qdocWriteQaPages_ = false;
-bool Generator::useOutputSubdirs_ = true;
-QmlTypeNode* Generator::qmlTypeContext_ = 0;
-
-void Generator::startDebugging(const QString& message)
-{
- debugging_ = true;
- qDebug() << "START DEBUGGING:" << message;
-}
-
-void Generator::stopDebugging(const QString& message)
-{
- debugging_ = false;
- qDebug() << "STOP DEBUGGING:" << message;
-}
-
-/*!
- Prints \a message as an aid to debugging the release version.
- */
-void Generator::debug(const QString& message)
-{
- if (debugging())
- qDebug() << " DEBUG:" << message;
-}
-
-/*!
- Constructs the generator base class. Prepends the newly
- constructed generator to the list of output generators.
- Sets a pointer to the QDoc database singleton, which is
- available to the generator subclasses.
- */
-Generator::Generator()
- : amp("&amp;"),
- gt("&gt;"),
- lt("&lt;"),
- quot("&quot;"),
- tag("</?@[^>]*>"),
- inLink_(false),
- inContents_(false),
- inSectionHeading_(false),
- inTableHeader_(false),
- threeColumnEnumValueTable_(true),
- showInternal_(false),
- singleExec_(false),
- numTableRows_(0)
-{
- qdb_ = QDocDatabase::qdocDB();
- generators.prepend(this);
-}
-
-/*!
- Destroys the generator after removing it from the list of
- output generators.
- */
-Generator::~Generator()
-{
- generators.removeAll(this);
-}
-
-void Generator::appendFullName(Text& text,
- const Node *apparentNode,
- const Node *relative,
- const Node *actualNode)
-{
- if (actualNode == 0)
- actualNode = apparentNode;
- text << Atom(Atom::LinkNode, CodeMarker::stringForNode(actualNode))
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, apparentNode->plainFullName(relative))
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-}
-
-void Generator::appendFullName(Text& text,
- const Node *apparentNode,
- const QString& fullName,
- const Node *actualNode)
-{
- if (actualNode == 0)
- actualNode = apparentNode;
- text << Atom(Atom::LinkNode, CodeMarker::stringForNode(actualNode))
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, fullName)
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-}
-
-void Generator::appendFullNames(Text& text, const NodeList& nodes, const Node* relative)
-{
- NodeList::ConstIterator n = nodes.constBegin();
- int index = 0;
- while (n != nodes.constEnd()) {
- appendFullName(text,*n,relative);
- text << comma(index++,nodes.count());
- ++n;
- }
-}
-
-void Generator::appendSortedNames(Text& text, const ClassNode* cn, const QList<RelatedClass>& rc)
-{
- QList<RelatedClass>::ConstIterator r;
- QMap<QString,Text> classMap;
- int index = 0;
-
- r = rc.constBegin();
- while (r != rc.constEnd()) {
- ClassNode* rcn = (*r).node_;
- if (rcn && rcn->access() == Node::Public &&
- rcn->status() != Node::Internal &&
- !rcn->doc().isEmpty()) {
- Text className;
- appendFullName(className, rcn, cn);
- classMap[className.toString().toLower()] = className;
- }
- ++r;
- }
-
- QStringList classNames = classMap.keys();
- classNames.sort();
-
- foreach (const QString &className, classNames) {
- text << classMap[className];
- text << comma(index++, classNames.count());
- }
-}
-
-void Generator::appendSortedQmlNames(Text& text, const Node* base, const NodeList& subs)
-{
- QMap<QString,Text> classMap;
- int index = 0;
-
- for (int i = 0; i < subs.size(); ++i) {
- Text t;
- if (!base->isQtQuickNode() || !subs[i]->isQtQuickNode() ||
- (base->logicalModuleName() == subs[i]->logicalModuleName())) {
- appendFullName(t, subs[i], base);
- classMap[t.toString().toLower()] = t;
- }
- }
-
- QStringList names = classMap.keys();
- names.sort();
-
- foreach (const QString &name, names) {
- text << classMap[name];
- text << comma(index++, names.count());
- }
-}
-
-/*!
- For debugging qdoc.
- */
-void Generator::writeOutFileNames()
-{
- QFile files("outputlist.txt");
- if (!files.open(QFile::WriteOnly))
- return;
- QTextStream filesout(&files);
- foreach (const QString &file, outFileNames_) {
- filesout << file << "\n";
- }
-}
-
-/*!
- Creates the file named \a fileName in the output directory.
- Attaches a QTextStream to the created file, which is written
- to all over the place using out().
- */
-void Generator::beginSubPage(const InnerNode* node, const QString& fileName)
-{
- QString path = outputDir() + QLatin1Char('/');
- if (Generator::useOutputSubdirs() && !node->outputSubdirectory().isEmpty() &&
- !outputDir().endsWith(node->outputSubdirectory()))
- path += node->outputSubdirectory() + QLatin1Char('/');
- path += fileName;
-
- QFile* outFile = new QFile(redirectDocumentationToDevNull_ ? QStringLiteral("/dev/null") : path);
- if (!redirectDocumentationToDevNull_ && outFile->exists())
- node->location().error(tr("HTML file already exists; overwriting %1").arg(outFile->fileName()));
- if (!outFile->open(QFile::WriteOnly))
- node->location().fatal(tr("Cannot open output file '%1'").arg(outFile->fileName()));
- Generator::debug("Writing: " + path);
- outFileNames_ << fileName;
- QTextStream* out = new QTextStream(outFile);
-
-#ifndef QT_NO_TEXTCODEC
- if (outputCodec)
- out->setCodec(outputCodec);
-#endif
- outStreamStack.push(out);
- const_cast<InnerNode*>(node)->setOutputFileName(fileName);
-}
-
-/*!
- Flush the text stream associated with the subpage, and
- then pop it off the text stream stack and delete it.
- This terminates output of the subpage.
- */
-void Generator::endSubPage()
-{
- outStreamStack.top()->flush();
- delete outStreamStack.top()->device();
- delete outStreamStack.pop();
-}
-
-QString Generator::fileBase(const Node *node) const
-{
- if (node->relates())
- node = node->relates();
- else if (!node->isInnerNode())
- node = node->parent();
- if (node->type() == Node::QmlPropertyGroup) {
- node = node->parent();
- }
-
- if (node->hasFileNameBase())
- return node->fileNameBase();
-
- QString base;
- if (node->isDocumentNode()) {
- base = node->name();
- if (base.endsWith(".html") && !node->isExampleFile())
- base.truncate(base.length() - 5);
-
- if (node->isExample() || node->isExampleFile()) {
- QString modPrefix(node->physicalModuleName());
- if (modPrefix.isEmpty()) {
- modPrefix = project_;
- }
- base.prepend(modPrefix.toLower() + QLatin1Char('-'));
- }
- if (node->isExample()) {
- base.append(QLatin1String("-example"));
- }
- }
- else if (node->isQmlType() || node->isQmlBasicType() ||
- node->isJsType() || node->isJsBasicType()) {
- base = node->name();
- if (!node->logicalModuleName().isEmpty()) {
- base.prepend(node->logicalModuleName() + QLatin1Char('-'));
- }
- /*
- To avoid file name conflicts in the html directory,
- we prepend a prefix (by default, "qml-") to the file name of QML
- element doc files.
- */
- if (node->isQmlType() || node->isQmlBasicType())
- base.prepend(outputPrefix(QLatin1String("QML")));
- else
- base.prepend(outputPrefix(QLatin1String("JS")));
- }
- else if (node->isCollectionNode()) {
- base = node->name();
- if (base.endsWith(".html"))
- base.truncate(base.length() - 5);
-
- if (node->isQmlModule()) {
- base.append("-qmlmodule");
- }
- else if (node->isJsModule()) {
- base.append("-jsmodule");
- }
- else if (node->isModule()) {
- base.append("-module");
- }
- // Why not add "-group" for gropup pages?
- }
- else {
- const Node *p = node;
- forever {
- const Node *pp = p->parent();
- base.prepend(p->name());
- if (!pp || pp->name().isEmpty() || pp->isDocumentNode())
- break;
- base.prepend(QLatin1Char('-'));
- p = pp;
- }
- }
-
- // the code below is effectively equivalent to:
- // base.replace(QRegExp("[^A-Za-z0-9]+"), " ");
- // base = base.trimmed();
- // base.replace(QLatin1Char(' '), QLatin1Char('-'));
- // base = base.toLower();
- // as this function accounted for ~8% of total running time
- // we optimize a bit...
-
- QString res;
- // +5 prevents realloc in fileName() below
- res.reserve(base.size() + 5);
- bool begun = false;
- for (int i = 0; i != base.size(); ++i) {
- QChar c = base.at(i);
- uint u = c.unicode();
- if (u >= 'A' && u <= 'Z')
- u += 'a' - 'A';
- if ((u >= 'a' && u <= 'z') || (u >= '0' && u <= '9')) {
- res += QLatin1Char(u);
- begun = true;
- }
- else if (begun) {
- res += QLatin1Char('-');
- begun = false;
- }
- }
- while (res.endsWith(QLatin1Char('-')))
- res.chop(1);
- Node* n = const_cast<Node*>(node);
- n->setFileNameBase(res);
- return res;
-}
-
-/*!
- If the \a node has a URL, return the URL as the file name.
- Otherwise, construct the file name from the fileBase() and
- the fileExtension(), and return the constructed name.
- */
-QString Generator::fileName(const Node* node) const
-{
- if (!node->url().isEmpty())
- return node->url();
-
- QString name = fileBase(node);
- name += QLatin1Char('.');
- name += fileExtension();
- return name;
-}
-
-QString Generator::cleanRef(const QString& ref)
-{
- QString clean;
-
- if (ref.isEmpty())
- return clean;
-
- clean.reserve(ref.size() + 20);
- const QChar c = ref[0];
- const uint u = c.unicode();
-
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9')) {
- clean += c;
- } else if (u == '~') {
- clean += "dtor.";
- } else if (u == '_') {
- clean += "underscore.";
- } else {
- clean += QLatin1Char('A');
- }
-
- for (int i = 1; i < (int) ref.length(); i++) {
- const QChar c = ref[i];
- const uint u = c.unicode();
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9') || u == '-' ||
- u == '_' || u == ':' || u == '.') {
- clean += c;
- } else if (c.isSpace()) {
- clean += QLatin1Char('-');
- } else if (u == '!') {
- clean += "-not";
- } else if (u == '&') {
- clean += "-and";
- } else if (u == '<') {
- clean += "-lt";
- } else if (u == '=') {
- clean += "-eq";
- } else if (u == '>') {
- clean += "-gt";
- } else if (u == '#') {
- clean += QLatin1Char('#');
- } else {
- clean += QLatin1Char('-');
- clean += QString::number((int)u, 16);
- }
- }
- return clean;
-}
-
-QMap<QString, QString>& Generator::formattingLeftMap()
-{
- return fmtLeftMaps[format()];
-}
-
-QMap<QString, QString>& Generator::formattingRightMap()
-{
- return fmtRightMaps[format()];
-}
-
-/*!
- Returns the full document location.
- */
-QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
-{
- if (!node)
- return QString();
- if (!node->url().isEmpty())
- return node->url();
-
- QString parentName;
- QString anchorRef;
- QString fdl;
-
- /*
- If the useSubdir parameter is set, then the output is
- being sent to subdirectories of the output directory.
- Prepend the subdirectory name + '/' to the result.
- */
- if (useSubdir) {
- fdl = node->outputSubdirectory();
- if (!fdl.isEmpty())
- fdl.append(QLatin1Char('/'));
- }
- if (node->isNamespace()) {
-
- // The root namespace has no name - check for this before creating
- // an attribute containing the location of any documentation.
-
- if (!fileBase(node).isEmpty())
- parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension();
- else
- return QString();
- }
- else if (node->isQmlType() || node->isQmlBasicType() ||
- node->isJsType() || node->isJsBasicType()) {
- QString fb = fileBase(node);
- if (fb.startsWith(Generator::outputPrefix(QLatin1String("QML"))))
- return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
- else if (fb.startsWith(Generator::outputPrefix(QLatin1String("JS"))))
- return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
- else {
- QString mq;
- if (!node->logicalModuleName().isEmpty()) {
- mq = node->logicalModuleName().replace(QChar('.'),QChar('-'));
- mq = mq.toLower() + QLatin1Char('-');
- }
- QLatin1String prefix = QLatin1String("QML");
- if (node->isJsType() || node->isJsBasicType())
- prefix = QLatin1String("JS");
- return fdl+ Generator::outputPrefix(prefix) + mq + fileBase(node) +
- QLatin1Char('.') + currentGenerator()->fileExtension();
- }
- }
- else if (node->isDocumentNode() || node->isCollectionNode()) {
- parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension();
- }
- else if (fileBase(node).isEmpty())
- return QString();
-
- Node *parentNode = 0;
-
- if ((parentNode = node->relates())) {
- parentName = fullDocumentLocation(node->relates());
- }
- else if ((parentNode = node->parent())) {
- if (parentNode->isQmlPropertyGroup() || parentNode->isJsPropertyGroup()) {
- parentNode = parentNode->parent();
- parentName = fullDocumentLocation(parentNode);
- }
- else {
- parentName = fullDocumentLocation(node->parent());
- }
- }
-
- switch (node->type()) {
- case Node::Class:
- case Node::Namespace:
- parentName = fileBase(node) + QLatin1Char('.') + currentGenerator()->fileExtension();
- break;
- case Node::Function:
- {
- const FunctionNode *functionNode =
- static_cast<const FunctionNode *>(node);
-
- if (functionNode->metaness() == FunctionNode::Dtor)
- anchorRef = "#dtor." + functionNode->name().mid(1);
-
- else if (functionNode->associatedProperty())
- return fullDocumentLocation(functionNode->associatedProperty());
-
- else if (functionNode->overloadNumber() > 1)
- anchorRef = QLatin1Char('#') + cleanRef(functionNode->name())
- + QLatin1Char('-') + QString::number(functionNode->overloadNumber());
- else
- anchorRef = QLatin1Char('#') + cleanRef(functionNode->name());
- break;
- }
- /*
- Use node->name() instead of fileBase(node) as
- the latter returns the name in lower-case. For
- HTML anchors, we need to preserve the case.
- */
- case Node::Enum:
- anchorRef = QLatin1Char('#') + node->name() + "-enum";
- break;
- case Node::Typedef:
- {
- const TypedefNode *tdef = static_cast<const TypedefNode *>(node);
- if (tdef->associatedEnum()) {
- return fullDocumentLocation(tdef->associatedEnum());
- }
- anchorRef = QLatin1Char('#') + node->name() + "-typedef";
- break;
- }
- case Node::Property:
- anchorRef = QLatin1Char('#') + node->name() + "-prop";
- break;
- case Node::QmlProperty:
- if (node->isAttached())
- anchorRef = QLatin1Char('#') + node->name() + "-attached-prop";
- else
- anchorRef = QLatin1Char('#') + node->name() + "-prop";
- break;
- case Node::QmlSignal:
- anchorRef = QLatin1Char('#') + node->name() + "-signal";
- break;
- case Node::QmlSignalHandler:
- anchorRef = QLatin1Char('#') + node->name() + "-signal-handler";
- break;
- case Node::QmlMethod:
- anchorRef = QLatin1Char('#') + node->name() + "-method";
- break;
- case Node::Variable:
- anchorRef = QLatin1Char('#') + node->name() + "-var";
- break;
- case Node::QmlType:
- case Node::Document:
- case Node::Group:
- case Node::Module:
- case Node::QmlModule:
- {
- parentName = fileBase(node);
- parentName.replace(QLatin1Char('/'), QLatin1Char('-')).replace(QLatin1Char('.'), QLatin1Char('-'));
- parentName += QLatin1Char('.') + currentGenerator()->fileExtension();
- }
- break;
- default:
- break;
- }
-
- // Various objects can be compat (deprecated) or obsolete.
- // Is this even correct?
- if (!node->isClass() && !node->isNamespace()) {
- switch (node->status()) {
- case Node::Compat:
- parentName.replace(QLatin1Char('.') + currentGenerator()->fileExtension(),
- "-compat." + currentGenerator()->fileExtension());
- break;
- case Node::Obsolete:
- parentName.replace(QLatin1Char('.') + currentGenerator()->fileExtension(),
- "-obsolete." + currentGenerator()->fileExtension());
- break;
- default:
- ;
- }
- }
-
- return fdl + parentName.toLower() + anchorRef;
-}
-
-void Generator::generateAlsoList(const Node *node, CodeMarker *marker)
-{
- QList<Text> alsoList = node->doc().alsoList();
- supplementAlsoList(node, alsoList);
-
- if (!alsoList.isEmpty()) {
- Text text;
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
- << "See also "
- << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD);
-
- for (int i = 0; i < alsoList.size(); ++i)
- text << alsoList.at(i) << separator(i, alsoList.size());
-
- text << Atom::ParaRight;
- generateText(text, node, marker);
- }
-}
-
-int Generator::generateAtom(const Atom * /* atom */,
- const Node * /* relative */,
- CodeMarker * /* marker */)
-{
- return 0;
-}
-
-const Atom *Generator::generateAtomList(const Atom *atom,
- const Node *relative,
- CodeMarker *marker,
- bool generate,
- int &numAtoms)
-{
- while (atom) {
- if (atom->type() == Atom::FormatIf) {
- int numAtoms0 = numAtoms;
- bool rightFormat = canHandleFormat(atom->string());
- atom = generateAtomList(atom->next(),
- relative,
- marker,
- generate && rightFormat,
- numAtoms);
- if (!atom)
- return 0;
-
- if (atom->type() == Atom::FormatElse) {
- ++numAtoms;
- atom = generateAtomList(atom->next(),
- relative,
- marker,
- generate && !rightFormat,
- numAtoms);
- if (!atom)
- return 0;
- }
-
- if (atom->type() == Atom::FormatEndif) {
- if (generate && numAtoms0 == numAtoms) {
- relative->location().warning(tr("Output format %1 not handled %2")
- .arg(format()).arg(outFileName()));
- Atom unhandledFormatAtom(Atom::UnhandledFormat, format());
- generateAtomList(&unhandledFormatAtom,
- relative,
- marker,
- generate,
- numAtoms);
- }
- atom = atom->next();
- }
- }
- else if (atom->type() == Atom::FormatElse ||
- atom->type() == Atom::FormatEndif) {
- return atom;
- }
- else {
- int n = 1;
- if (generate) {
- n += generateAtom(atom, relative, marker);
- numAtoms += n;
- }
- while (n-- > 0)
- atom = atom->next();
- }
- }
- return 0;
-}
-
-/*!
- Generate the body of the documentation from the qdoc comment
- found with the entity represented by the \a node.
- */
-void Generator::generateBody(const Node *node, CodeMarker *marker)
-{
- bool quiet = false;
-
- if (node->type() == Node::Document) {
- const DocumentNode *dn = static_cast<const DocumentNode *>(node);
- if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) {
- quiet = true;
- }
- }
- if (node->doc().isEmpty()) {
- if (!node->isWrapper() && !quiet && !node->isReimp()) { // ### might be unnecessary
- node->location().warning(tr("No documentation for '%1'").arg(node->plainFullName()));
- }
- }
- else {
- if (node->type() == Node::Function) {
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (func->reimplementedFrom() != 0)
- generateReimplementedFrom(func, marker);
- }
-
- if (!generateText(node->doc().body(), node, marker)) {
- if (node->isReimp())
- return;
- }
-
- if (node->type() == Node::Enum) {
- const EnumNode *enume = (const EnumNode *) node;
-
- QSet<QString> definedItems;
- QList<EnumItem>::ConstIterator it = enume->items().constBegin();
- while (it != enume->items().constEnd()) {
- definedItems.insert((*it).name());
- ++it;
- }
-
- QSet<QString> documentedItems = enume->doc().enumItemNames().toSet();
- QSet<QString> allItems = definedItems + documentedItems;
- if (allItems.count() > definedItems.count() ||
- allItems.count() > documentedItems.count()) {
- QSet<QString>::ConstIterator a = allItems.constBegin();
- while (a != allItems.constEnd()) {
- if (!definedItems.contains(*a)) {
- QString details;
- QString best = nearestName(*a, definedItems);
- if (!best.isEmpty() && !documentedItems.contains(best))
- details = tr("Maybe you meant '%1'?").arg(best);
-
- node->doc().location().warning(tr("No such enum item '%1' in %2")
- .arg(*a).arg(node->plainFullName()), details);
- if (*a == "Void")
- qDebug() << "VOID:" << node->name() << definedItems;
- }
- else if (!documentedItems.contains(*a)) {
- node->doc().location().warning(tr("Undocumented enum item '%1' in %2")
- .arg(*a).arg(node->plainFullName()));
- }
- ++a;
- }
- }
- }
- else if (node->type() == Node::Function) {
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
- QSet<QString> definedParams;
- QList<Parameter>::ConstIterator p = func->parameters().constBegin();
- while (p != func->parameters().constEnd()) {
- if ((*p).name().isEmpty() && (*p).leftType() != QLatin1String("...")
- && func->name() != QLatin1String("operator++")
- && func->name() != QLatin1String("operator--")) {
- node->doc().location().warning(tr("Missing parameter name"));
- }
- else {
- definedParams.insert((*p).name());
- }
- ++p;
- }
-
- QSet<QString> documentedParams = func->doc().parameterNames();
- QSet<QString> allParams = definedParams + documentedParams;
- if (allParams.count() > definedParams.count()
- || allParams.count() > documentedParams.count()) {
- QSet<QString>::ConstIterator a = allParams.constBegin();
- while (a != allParams.constEnd()) {
- if (!definedParams.contains(*a)) {
- QString details;
- QString best = nearestName(*a, definedParams);
- if (!best.isEmpty())
- details = tr("Maybe you meant '%1'?").arg(best);
-
- node->doc().location().warning(
- tr("No such parameter '%1' in %2").arg(*a).arg(node->plainFullName()),
- details);
- }
- else if (!(*a).isEmpty() && !documentedParams.contains(*a)) {
- bool needWarning = (func->status() > Node::Obsolete);
- if (func->overloadNumber() > 1) {
- FunctionNode *primaryFunc =
- func->parent()->findFunctionNode(func->name());
- if (primaryFunc) {
- foreach (const Parameter &param,
- primaryFunc->parameters()) {
- if (param.name() == *a) {
- needWarning = false;
- break;
- }
- }
- }
- }
- if (needWarning && !func->isReimp())
- node->doc().location().warning(
- tr("Undocumented parameter '%1' in %2")
- .arg(*a).arg(node->plainFullName()));
- }
- ++a;
- }
- }
- /*
- Something like this return value check should
- be implemented at some point.
- */
- if (func->status() > Node::Obsolete && func->returnType() == "bool"
- && func->reimplementedFrom() == 0 && !func->isOverload()) {
- QString body = func->doc().body().toString();
- if (!body.contains("return", Qt::CaseInsensitive))
- node->doc().location().warning(tr("Undocumented return value"));
- }
- }
- }
-
- if (node->isDocumentNode()) {
- const DocumentNode *dn = static_cast<const DocumentNode *>(node);
- if (dn->isExample()) {
- generateExampleFiles(dn, marker);
- }
- else if (dn->subType() == Node::File) {
- Text text;
- Quoter quoter;
- Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
- QString code = quoter.quoteTo(dn->location(), QString(), QString());
- CodeMarker *codeMarker = CodeMarker::markerForFileName(dn->name());
- text << Atom(codeMarker->atomType(), code);
- generateText(text, dn, codeMarker);
- }
- }
-}
-
-void Generator::generateClassLikeNode(InnerNode* /* classe */, CodeMarker* /* marker */)
-{
-}
-
-void Generator::generateExampleFiles(const DocumentNode *dn, CodeMarker *marker)
-{
- if (dn->childNodes().isEmpty())
- return;
- generateFileList(dn, marker, Node::File, QString("Files:"));
- generateFileList(dn, marker, Node::Image, QString("Images:"));
-}
-
-void Generator::generateDocumentNode(DocumentNode* /* dn */, CodeMarker* /* marker */)
-{
-}
-
-void Generator::generateCollectionNode(CollectionNode* , CodeMarker* )
-{
-}
-
-/*!
- This function is called when the documentation for an
- example is being formatted. It outputs the list of source
- files comprising the example, and the list of images used
- by the example. The images are copied into a subtree of
- \c{...doc/html/images/used-in-examples/...}
- */
-void Generator::generateFileList(const DocumentNode* dn,
- CodeMarker* marker,
- Node::SubType subtype,
- const QString& tag)
-{
- int count = 0;
- Text text;
- OpenedList openedList(OpenedList::Bullet);
-
- text << Atom::ParaLeft << tag << Atom::ParaRight
- << Atom(Atom::ListLeft, openedList.styleString());
-
- foreach (const Node* child, dn->childNodes()) {
- if (child->subType() == subtype) {
- ++count;
- QString file = child->name();
- if (subtype == Node::Image) {
- if (!file.isEmpty()) {
- QDir dirInfo;
- QString userFriendlyFilePath;
- const QString prefix("/images/used-in-examples/");
- QString srcPath = Config::findFile(dn->location(),
- QStringList(),
- exampleDirs,
- file,
- exampleImgExts,
- userFriendlyFilePath);
- outFileNames_ << prefix.mid(1) + userFriendlyFilePath;
- userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/'));
-
- QString imgOutDir = outDir_ + prefix + userFriendlyFilePath;
- if (!dirInfo.mkpath(imgOutDir))
- dn->location().fatal(tr("Cannot create output directory '%1'")
- .arg(imgOutDir));
-
- QString imgOutName = Config::copyFile(dn->location(),
- srcPath,
- file,
- imgOutDir);
- }
-
- }
-
- openedList.next();
- text << Atom(Atom::ListItemNumber, openedList.numberString())
- << Atom(Atom::ListItemLeft, openedList.styleString())
- << Atom::ParaLeft
- << Atom(Atom::Link, file)
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << file
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
- << Atom::ParaRight
- << Atom(Atom::ListItemRight, openedList.styleString());
- }
- }
- text << Atom(Atom::ListRight, openedList.styleString());
- if (count > 0)
- generateText(text, dn, marker);
-}
-
-void Generator::generateInheritedBy(const ClassNode *classe, CodeMarker *marker)
-{
- if (!classe->derivedClasses().isEmpty()) {
- Text text;
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
- << "Inherited by: "
- << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD);
-
- appendSortedNames(text, classe, classe->derivedClasses());
- text << Atom::ParaRight;
- generateText(text, classe, marker);
- }
-}
-
-void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
-{
- QList<RelatedClass>::ConstIterator r;
- int index;
-
- if (!classe->baseClasses().isEmpty()) {
- Text text;
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
- << "Inherits: "
- << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD);
-
- r = classe->baseClasses().constBegin();
- index = 0;
- while (r != classe->baseClasses().constEnd()) {
- if ((*r).node_) {
- text << Atom(Atom::LinkNode, CodeMarker::stringForNode((*r).node_))
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, (*r).signature_)
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-
- if ((*r).access_ == Node::Protected) {
- text << " (protected)";
- }
- else if ((*r).access_ == Node::Private) {
- text << " (private)";
- }
- text << separator(index++, classe->baseClasses().count());
- }
- ++r;
- }
- text << Atom::ParaRight;
- generateText(text, classe, marker);
- }
-}
-
-/*!
- Recursive writing of HTML files from the root \a node.
- */
-void Generator::generateInnerNode(InnerNode* node)
-{
- if (!node->url().isNull())
- return;
- if (node->isIndexNode())
- return;
- if (node->isInternal() && !showInternal_)
- return;
-
- if (node->isDocumentNode()) {
- DocumentNode* docNode = static_cast<DocumentNode*>(node);
- if (docNode->subType() == Node::ExternalPage)
- return;
- if (docNode->subType() == Node::Image)
- return;
- if (docNode->subType() == Node::Page) {
- if (node->count() > 0)
- qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
- }
- }
- else if (node->isQmlPropertyGroup() || node->isJsPropertyGroup())
- return;
-
- /*
- Obtain a code marker for the source file.
- */
- CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath());
-
- if (node->parent() != 0) {
- if ((node->isNamespace() && node->status() != Node::Intermediate)
- || node->isClass()) {
- beginSubPage(node, fileName(node));
- generateClassLikeNode(node, marker);
- endSubPage();
- }
- if (node->isQmlType() || node->isJsType()) {
- beginSubPage(node, fileName(node));
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(node);
- generateQmlTypePage(qcn, marker);
- endSubPage();
- }
- else if (node->isDocumentNode()) {
- beginSubPage(node, fileName(node));
- generateDocumentNode(static_cast<DocumentNode*>(node), marker);
- endSubPage();
- }
- else if (node->isQmlBasicType() || node->isJsBasicType()) {
- beginSubPage(node, fileName(node));
- QmlBasicTypeNode* qbtn = static_cast<QmlBasicTypeNode*>(node);
- generateQmlBasicTypePage(qbtn, marker);
- endSubPage();
- }
- else if (node->isCollectionNode()) {
- /*
- A collection node collects: groups, C++ modules,
- QML modules or JavaScript modules.
-
- Don't output an HTML page for the collection
- node unless the \group, \module, \qmlmodule or
- \jsmodule command was actually seen by qdoc in
- the qdoc comment for the node.
-
- A key prerequisite in this case is the call to
- mergeCollections(cn). We must determine whether
- this group, module, QML module, or JavaScript
- module has members in other modules. We know at
- this point that cn's members list contains only
- members in the current module. Therefore, before
- outputting the page for cn, we must search for
- members of cn in the other modules and add them
- to the members list.
- */
- CollectionNode* cn = static_cast<CollectionNode*>(node);
- if (cn->wasSeen()) {
- qdb_->mergeCollections(cn);
- beginSubPage(node, fileName(node));
- generateCollectionNode(cn, marker);
- endSubPage();
- }
- }
- }
-
- int i = 0;
- while (i < node->childNodes().count()) {
- Node *c = node->childNodes().at(i);
- if (c->isInnerNode() && c->access() != Node::Private) {
- generateInnerNode((InnerNode*)c);
- }
- ++i;
- }
-}
-
-/*!
- Generate a list of maintainers in the output
- */
-void Generator::generateMaintainerList(const InnerNode* node, CodeMarker* marker)
-{
- QStringList sl = getMetadataElements(node,"maintainer");
-
- if (!sl.isEmpty()) {
- Text text;
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
- << "Maintained by: "
- << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD);
-
- for (int i = 0; i < sl.size(); ++i)
- text << sl.at(i) << separator(i, sl.size());
-
- text << Atom::ParaRight;
- generateText(text, node, marker);
- }
-}
-
-/*!
- Output the "Inherit by" list for the QML element,
- if it is inherited by any other elements.
- */
-void Generator::generateQmlInheritedBy(const QmlTypeNode* qcn,
- CodeMarker* marker)
-{
- if (qcn) {
- NodeList subs;
- QmlTypeNode::subclasses(qcn->name(),subs);
- if (!subs.isEmpty()) {
- Text text;
- text << Atom::ParaLeft << "Inherited by ";
- appendSortedQmlNames(text,qcn,subs);
- text << Atom::ParaRight;
- generateText(text, qcn, marker);
- }
- }
-}
-
-/*!
- */
-void Generator::generateQmlInherits(QmlTypeNode* , CodeMarker* )
-{
- // stub.
-}
-
-/*!
- Extract sections of markup text surrounded by \e qmltext
- and \e endqmltext and output them.
- */
-bool Generator::generateQmlText(const Text& text,
- const Node *relative,
- CodeMarker *marker,
- const QString& /* qmlName */ )
-{
- const Atom* atom = text.firstAtom();
- bool result = false;
-
- if (atom != 0) {
- initializeTextOutput();
- while (atom) {
- if (atom->type() != Atom::QmlText)
- atom = atom->next();
- else {
- atom = atom->next();
- while (atom && (atom->type() != Atom::EndQmlText)) {
- int n = 1 + generateAtom(atom, relative, marker);
- while (n-- > 0)
- atom = atom->next();
- }
- }
- }
- result = true;
- }
- return result;
-}
-
-void Generator::generateReimplementedFrom(const FunctionNode *func,
- CodeMarker *marker)
-{
- if (func->reimplementedFrom() != 0) {
- const FunctionNode *from = func->reimplementedFrom();
- if (from->access() != Node::Private &&
- from->parent()->access() != Node::Private) {
- Text text;
- text << Atom::ParaLeft << "Reimplemented from ";
- QString fullName = from->parent()->name() + "::" + from->name() + "()";
- appendFullName(text, from->parent(), fullName, from);
- text << "." << Atom::ParaRight;
- generateText(text, func, marker);
- }
- }
-}
-
-void Generator::generateSince(const Node *node, CodeMarker *marker)
-{
- if (!node->since().isEmpty()) {
- Text text;
- text << Atom::ParaLeft
- << "This "
- << typeString(node);
- if (node->type() == Node::Enum)
- text << " was introduced or modified in ";
- else
- text << " was introduced in ";
-
- QStringList since = node->since().split(QLatin1Char(' '));
- if (since.count() == 1) {
- // If there is only one argument, assume it is the Qt version number.
- text << " Qt " << since[0];
- } else {
- // Otherwise, reconstruct the <project> <version> string.
- text << " " << since.join(' ');
- }
-
- text << "." << Atom::ParaRight;
- generateText(text, node, marker);
- }
-}
-
-void Generator::generateStatus(const Node *node, CodeMarker *marker)
-{
- Text text;
-
- switch (node->status()) {
- case Node::Commendable:
- break;
- case Node::Preliminary:
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
- << "This "
- << typeString(node)
- << " is under development and is subject to change."
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
- << Atom::ParaRight;
- break;
- case Node::Deprecated:
- text << Atom::ParaLeft;
- if (node->isInnerNode())
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
- text << "This " << typeString(node) << " is deprecated.";
- if (node->isInnerNode())
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
- text << Atom::ParaRight;
- break;
- case Node::Obsolete:
- text << Atom::ParaLeft;
- if (node->isInnerNode())
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
- text << "This " << typeString(node) << " is obsolete.";
- if (node->isInnerNode())
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
- text << " It is provided to keep old source code working. "
- << "We strongly advise against "
- << "using it in new code." << Atom::ParaRight;
- break;
- case Node::Compat:
- // reimplemented in HtmlGenerator subclass
- if (node->isInnerNode()) {
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
- << "This "
- << typeString(node)
- << " is part of the Qt compatibility layer."
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
- << " It is provided to keep old source code working. "
- << "We strongly advise against using it in new code."
- << Atom::ParaRight;
- }
- break;
- case Node::Internal:
- default:
- break;
- }
- generateText(text, node, marker);
-}
-
-/*!
- Generates a bold line that says:
- "The signal is private, not emitted by the user.
- The function is public so the user can pass it to connect()."
- */
-void Generator::generatePrivateSignalNote(const Node* node, CodeMarker* marker)
-{
- Text text;
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
- << "Note: "
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
- << "This is a private signal. It can be used in signal connections but cannot be emitted by the user."
- << Atom::ParaRight;
- generateText(text, node, marker);
-}
-
-/*!
- Generate the documentation for \a relative. i.e. \a relative
- is the node that reporesentas the entity where a qdoc comment
- was found, and \a text represents the qdoc comment.
- */
-bool Generator::generateText(const Text& text,
- const Node *relative,
- CodeMarker *marker)
-{
- bool result = false;
- if (text.firstAtom() != 0) {
- int numAtoms = 0;
- initializeTextOutput();
- generateAtomList(text.firstAtom(),
- relative,
- marker,
- true,
- numAtoms);
- result = true;
- }
- return result;
-}
-
-void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
-{
- Text text;
- Node::ThreadSafeness threadSafeness = node->threadSafeness();
-
- Text rlink;
- rlink << Atom(Atom::Link,"reentrant")
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << "reentrant"
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-
- Text tlink;
- tlink << Atom(Atom::Link,"thread-safe")
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << "thread-safe"
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-
- switch (threadSafeness) {
- case Node::UnspecifiedSafeness:
- break;
- case Node::NonReentrant:
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
- << "Warning:"
- << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD)
- << " This "
- << typeString(node)
- << " is not "
- << rlink
- << "."
- << Atom::ParaRight;
- break;
- case Node::Reentrant:
- case Node::ThreadSafe:
- text << Atom::ParaLeft
- << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
- << "Note:"
- << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD)
- << " ";
-
- if (node->isInnerNode()) {
- const InnerNode* innerNode = static_cast<const InnerNode*>(node);
- text << "All functions in this "
- << typeString(node)
- << " are ";
- if (threadSafeness == Node::ThreadSafe)
- text << tlink;
- else
- text << rlink;
-
- bool exceptions = false;
- NodeList reentrant;
- NodeList threadsafe;
- NodeList nonreentrant;
- NodeList::ConstIterator c = innerNode->childNodes().constBegin();
- while (c != innerNode->childNodes().constEnd()) {
-
- if ((*c)->status() != Node::Obsolete){
- switch ((*c)->threadSafeness()) {
- case Node::Reentrant:
- reentrant.append(*c);
- if (threadSafeness == Node::ThreadSafe)
- exceptions = true;
- break;
- case Node::ThreadSafe:
- threadsafe.append(*c);
- if (threadSafeness == Node::Reentrant)
- exceptions = true;
- break;
- case Node::NonReentrant:
- nonreentrant.append(*c);
- exceptions = true;
- break;
- default:
- break;
- }
- }
- ++c;
- }
- if (!exceptions)
- text << ".";
- else if (threadSafeness == Node::Reentrant) {
- if (nonreentrant.isEmpty()) {
- if (!threadsafe.isEmpty()) {
- text << ", but ";
- appendFullNames(text,threadsafe,innerNode);
- singularPlural(text,threadsafe);
- text << " also " << tlink << ".";
- }
- else
- text << ".";
- }
- else {
- text << ", except for ";
- appendFullNames(text,nonreentrant,innerNode);
- text << ", which";
- singularPlural(text,nonreentrant);
- text << " nonreentrant.";
- if (!threadsafe.isEmpty()) {
- text << " ";
- appendFullNames(text,threadsafe,innerNode);
- singularPlural(text,threadsafe);
- text << " " << tlink << ".";
- }
- }
- }
- else { // thread-safe
- if (!nonreentrant.isEmpty() || !reentrant.isEmpty()) {
- text << ", except for ";
- if (!reentrant.isEmpty()) {
- appendFullNames(text,reentrant,innerNode);
- text << ", which";
- singularPlural(text,reentrant);
- text << " only " << rlink;
- if (!nonreentrant.isEmpty())
- text << ", and ";
- }
- if (!nonreentrant.isEmpty()) {
- appendFullNames(text,nonreentrant,innerNode);
- text << ", which";
- singularPlural(text,nonreentrant);
- text << " nonreentrant.";
- }
- text << ".";
- }
- }
- }
- else {
- text << "This " << typeString(node) << " is ";
- if (threadSafeness == Node::ThreadSafe)
- text << tlink;
- else
- text << rlink;
- text << ".";
- }
- text << Atom::ParaRight;
- }
- generateText(text,node,marker);
-}
-
-/*!
- Traverses the current tree to generate all the documentation.
- */
-void Generator::generateDocs()
-{
- generateInnerNode(qdb_->primaryTreeRoot());
-}
-
-Generator *Generator::generatorForFormat(const QString& format)
-{
- QList<Generator *>::ConstIterator g = generators.constBegin();
- while (g != generators.constEnd()) {
- if ((*g)->format() == format)
- return *g;
- ++g;
- }
- return 0;
-}
-
-/*!
- Looks up the tag \a t in the map of metadata values for the
- current topic in \a inner. If a value for the tag is found,
- the value is returned.
-
- \note If \a t is found in the metadata map, it is erased.
- i.e. Once you call this function for a particular \a t,
- you consume \a t.
- */
-QString Generator::getMetadataElement(const InnerNode* inner, const QString& t)
-{
- QString s;
- QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
- QStringMultiMap::iterator i = metaTagMap.find(t);
- if (i != metaTagMap.end()) {
- s = i.value();
- metaTagMap.erase(i);
- }
- return s;
-}
-
-/*!
- Looks up the tag \a t in the map of metadata values for the
- current topic in \a inner. If values for the tag are found,
- they are returned in a string list.
-
- \note If \a t is found in the metadata map, all the pairs
- having the key \a t are erased. i.e. Once you call this
- function for a particular \a t, you consume \a t.
- */
-QStringList Generator::getMetadataElements(const InnerNode* inner, const QString& t)
-{
- QStringList s;
- QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
- s = metaTagMap.values(t);
- if (!s.isEmpty())
- metaTagMap.remove(t);
- return s;
-}
-
-/*!
- Returns a relative path name for an image.
- */
-QString Generator::imageFileName(const Node *relative, const QString& fileBase)
-{
- QString userFriendlyFilePath;
- QString filePath = Config::findFile(relative->doc().location(),
- imageFiles,
- imageDirs,
- fileBase,
- imgFileExts[format()],
- userFriendlyFilePath);
-
- if (filePath.isEmpty())
- return QString();
-
- QString path = Config::copyFile(relative->doc().location(),
- filePath,
- userFriendlyFilePath,
- outputDir() + QLatin1String("/images"));
- int images_slash = path.lastIndexOf("images/");
- QString relImagePath;
- if (images_slash != -1)
- relImagePath = path.mid(images_slash);
- return relImagePath;
-}
-
-QString Generator::indent(int level, const QString& markedCode)
-{
- if (level == 0)
- return markedCode;
-
- QString t;
- int column = 0;
-
- int i = 0;
- while (i < (int) markedCode.length()) {
- if (markedCode.at(i) == QLatin1Char('\n')) {
- column = 0;
- }
- else {
- if (column == 0) {
- for (int j = 0; j < level; j++)
- t += QLatin1Char(' ');
- }
- column++;
- }
- t += markedCode.at(i++);
- }
- return t;
-}
-
-void Generator::initialize(const Config &config)
-{
-
- if (config.getBool(QString("HTML.nosubdirs")))
- resetUseOutputSubdirs();
-
- outFileNames_.clear();
- outputFormats = config.getOutputFormats();
- redirectDocumentationToDevNull_ = config.getBool(CONFIG_REDIRECTDOCUMENTATIONTODEVNULL);
- if (!outputFormats.isEmpty()) {
- outDir_ = config.getOutputDir();
- if (outDir_.isEmpty()) {
- config.lastLocation().fatal(tr("No output directory specified in "
- "configuration file or on the command line"));
- }
- else {
- outSubdir_ = outDir_.mid(outDir_.lastIndexOf('/') + 1);
- }
-
- QDir dirInfo;
- if (dirInfo.exists(outDir_)) {
- if (!generating() && Generator::useOutputSubdirs()) {
- if (!Config::removeDirContents(outDir_))
- config.lastLocation().error(tr("Cannot empty output directory '%1'").arg(outDir_));
- }
- }
- else {
- if (!dirInfo.mkpath(outDir_))
- config.lastLocation().fatal(tr("Cannot create output directory '%1'").arg(outDir_));
- }
-
- if (!dirInfo.exists(outDir_ + "/images") && !dirInfo.mkdir(outDir_ + "/images"))
- config.lastLocation().fatal(tr("Cannot create images directory '%1'").arg(outDir_ + "/images"));
- if (!dirInfo.exists(outDir_ + "/images/used-in-examples") && !dirInfo.mkdir(outDir_ + "/images/used-in-examples"))
- config.lastLocation().fatal(tr("Cannot create images used in examples directory '%1'").arg(outDir_ + "/images/used-in-examples"));
- if (!dirInfo.exists(outDir_ + "/scripts") && !dirInfo.mkdir(outDir_ + "/scripts"))
- config.lastLocation().fatal(tr("Cannot create scripts directory '%1'").arg(outDir_ + "/scripts"));
- if (!dirInfo.exists(outDir_ + "/style") && !dirInfo.mkdir(outDir_ + "/style"))
- config.lastLocation().fatal(tr("Cannot create style directory '%1'").arg(outDir_ + "/style"));
- }
-
- imageFiles = config.getCanonicalPathList(CONFIG_IMAGES);
- imageDirs = config.getCanonicalPathList(CONFIG_IMAGEDIRS);
- scriptFiles = config.getCanonicalPathList(CONFIG_SCRIPTS);
- scriptDirs = config.getCanonicalPathList(CONFIG_SCRIPTDIRS);
- styleFiles = config.getCanonicalPathList(CONFIG_STYLES);
- styleDirs = config.getCanonicalPathList(CONFIG_STYLEDIRS);
- exampleDirs = config.getCanonicalPathList(CONFIG_EXAMPLEDIRS);
- exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS);
-
- QString imagesDotFileExtensions = CONFIG_IMAGES + Config::dot + CONFIG_FILEEXTENSIONS;
- QSet<QString> formats = config.subVars(imagesDotFileExtensions);
- QSet<QString>::ConstIterator f = formats.constBegin();
- while (f != formats.constEnd()) {
- imgFileExts[*f] = config.getStringList(imagesDotFileExtensions + Config::dot + *f);
- ++f;
- }
-
- QList<Generator *>::ConstIterator g = generators.constBegin();
- while (g != generators.constEnd()) {
- if (outputFormats.contains((*g)->format())) {
- currentGenerator_ = (*g);
- (*g)->initializeGenerator(config);
- QStringList extraImages = config.getCanonicalPathList((*g)->format() +
- Config::dot +
- CONFIG_EXTRAIMAGES, true);
- QStringList::ConstIterator e = extraImages.constBegin();
- while (e != extraImages.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/images");
- ++e;
- }
-
- // Documentation template handling
- QStringList scripts = config.getCanonicalPathList((*g)->format()+Config::dot+CONFIG_SCRIPTS, true);
- e = scripts.constBegin();
- while (e != scripts.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/scripts");
- ++e;
- }
-
- QStringList styles = config.getCanonicalPathList((*g)->format()+Config::dot+CONFIG_STYLESHEETS, true);
- e = styles.constBegin();
- while (e != styles.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/style");
- ++e;
- }
- }
- ++g;
- }
-
- QRegExp secondParamAndAbove("[\2-\7]");
- QSet<QString> formattingNames = config.subVars(CONFIG_FORMATTING);
- QSet<QString>::ConstIterator n = formattingNames.constBegin();
- while (n != formattingNames.constEnd()) {
- QString formattingDotName = CONFIG_FORMATTING + Config::dot + *n;
- QSet<QString> formats = config.subVars(formattingDotName);
- QSet<QString>::ConstIterator f = formats.constBegin();
- while (f != formats.constEnd()) {
- QString def = config.getString(formattingDotName + Config::dot + *f);
- if (!def.isEmpty()) {
- int numParams = Config::numParams(def);
- int numOccs = def.count("\1");
- if (numParams != 1) {
- config.lastLocation().warning(tr("Formatting '%1' must "
- "have exactly one "
- "parameter (found %2)")
- .arg(*n).arg(numParams));
- }
- else if (numOccs > 1) {
- config.lastLocation().fatal(tr("Formatting '%1' must "
- "contain exactly one "
- "occurrence of '\\1' "
- "(found %2)")
- .arg(*n).arg(numOccs));
- }
- else {
- int paramPos = def.indexOf("\1");
- fmtLeftMaps[*f].insert(*n, def.left(paramPos));
- fmtRightMaps[*f].insert(*n, def.mid(paramPos + 1));
- }
- }
- ++f;
- }
- ++n;
- }
-
- project_ = config.getString(CONFIG_PROJECT);
-
- QStringList prefixes = config.getStringList(CONFIG_OUTPUTPREFIXES);
- if (!prefixes.isEmpty()) {
- foreach (const QString &prefix, prefixes)
- outputPrefixes[prefix] = config.getString(CONFIG_OUTPUTPREFIXES + Config::dot + prefix);
- }
- else {
- outputPrefixes[QLatin1String("QML")] = QLatin1String("qml-");
- outputPrefixes[QLatin1String("JS")] = QLatin1String("js-");
- }
- noLinkErrors_ = config.getBool(CONFIG_NOLINKERRORS);
- autolinkErrors_ = config.getBool(CONFIG_AUTOLINKERRORS);
-}
-
-/*!
- Appends each directory path in \a moreImageDirs to the
- list of image directories.
- */
-void Generator::augmentImageDirs(QSet<QString>& moreImageDirs)
-{
- if (moreImageDirs.isEmpty())
- return;
- QSet<QString>::const_iterator i = moreImageDirs.begin();
- while (i != moreImageDirs.end()) {
- imageDirs.append(*i);
- ++i;
- }
-}
-
-/*!
- Sets the generator's pointer to the Config instance.
- */
-void Generator::initializeGenerator(const Config& config)
-{
- config_ = &config;
- showInternal_ = config.getBool(CONFIG_SHOWINTERNAL);
- singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
-}
-
-bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType)
-{
- return atom->next() != 0 && atom->next()->type() == expectedAtomType;
-}
-
-/*!
- Used for writing to the current output stream. Returns a
- reference to the current output stream, which is then used
- with the \c {<<} operator for writing.
- */
-QTextStream &Generator::out()
-{
- return *outStreamStack.top();
-}
-
-QString Generator::outFileName()
-{
- return QFileInfo(static_cast<QFile*>(out().device())->fileName()).fileName();
-}
-
-QString Generator::outputPrefix(const QString &nodeType)
-{
- return outputPrefixes[nodeType];
-}
-
-bool Generator::parseArg(const QString& src,
- const QString& tag,
- int* pos,
- int n,
- QStringRef* contents,
- QStringRef* par1,
- bool debug)
-{
-#define SKIP_CHAR(c) \
- if (debug) \
- qDebug() << "looking for " << c << " at " << QString(src.data() + i, n - i); \
- if (i >= n || src[i] != c) { \
- if (debug) \
- qDebug() << " char '" << c << "' not found"; \
- return false; \
-} \
- ++i;
-
-
-#define SKIP_SPACE \
- while (i < n && src[i] == ' ') \
- ++i;
-
- int i = *pos;
- int j = i;
-
- // assume "<@" has been parsed outside
- //SKIP_CHAR('<');
- //SKIP_CHAR('@');
-
- if (tag != QStringRef(&src, i, tag.length())) {
- if (0 && debug)
- qDebug() << "tag " << tag << " not found at " << i;
- return false;
- }
-
- if (debug)
- qDebug() << "haystack:" << src << "needle:" << tag << "i:" <<i;
-
- // skip tag
- i += tag.length();
-
- // parse stuff like: linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)");
- if (par1) {
- SKIP_SPACE;
- // read parameter name
- j = i;
- while (i < n && src[i].isLetter())
- ++i;
- if (src[i] == '=') {
- if (debug)
- qDebug() << "read parameter" << QString(src.data() + j, i - j);
- SKIP_CHAR('=');
- SKIP_CHAR('"');
- // skip parameter name
- j = i;
- while (i < n && src[i] != '"')
- ++i;
- *par1 = QStringRef(&src, j, i - j);
- SKIP_CHAR('"');
- SKIP_SPACE;
- } else {
- if (debug)
- qDebug() << "no optional parameter found";
- }
- }
- SKIP_SPACE;
- SKIP_CHAR('>');
-
- // find contents up to closing "</@tag>
- j = i;
- for (; true; ++i) {
- if (i + 4 + tag.length() > n)
- return false;
- if (src[i] != '<')
- continue;
- if (src[i + 1] != '/')
- continue;
- if (src[i + 2] != '@')
- continue;
- if (tag != QStringRef(&src, i + 3, tag.length()))
- continue;
- if (src[i + 3 + tag.length()] != '>')
- continue;
- break;
- }
-
- *contents = QStringRef(&src, j, i - j);
-
- i += tag.length() + 4;
-
- *pos = i;
- if (debug)
- qDebug() << " tag " << tag << " found: pos now: " << i;
- return true;
-#undef SKIP_CHAR
-}
-
-QString Generator::plainCode(const QString& markedCode)
-{
- QString t = markedCode;
- t.replace(tag, QString());
- t.replace(quot, QLatin1String("\""));
- t.replace(gt, QLatin1String(">"));
- t.replace(lt, QLatin1String("<"));
- t.replace(amp, QLatin1String("&"));
- return t;
-}
-
-void Generator::setImageFileExtensions(const QStringList& extensions)
-{
- imgFileExts[format()] = extensions;
-}
-
-void Generator::singularPlural(Text& text, const NodeList& nodes)
-{
- if (nodes.count() == 1)
- text << " is";
- else
- text << " are";
-}
-
-int Generator::skipAtoms(const Atom *atom, Atom::Type type) const
-{
- int skipAhead = 0;
- atom = atom->next();
- while (atom != 0 && atom->type() != type) {
- skipAhead++;
- atom = atom->next();
- }
- return skipAhead;
-}
-
-/*!
- Resets the variables used during text output.
- */
-void Generator::initializeTextOutput()
-{
- inLink_ = false;
- inContents_ = false;
- inSectionHeading_ = false;
- inTableHeader_ = false;
- numTableRows_ = 0;
- threeColumnEnumValueTable_ = true;
- link_.clear();
- sectionNumber_.clear();
-}
-
-void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
-{
- if (node->type() == Node::Function) {
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (func->overloadNumber() == 1) {
- QString alternateName;
- const FunctionNode *alternateFunc = 0;
-
- if (func->name().startsWith("set") && func->name().size() >= 4) {
- alternateName = func->name()[3].toLower();
- alternateName += func->name().mid(4);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
-
- if (!alternateFunc) {
- alternateName = "is" + func->name().mid(3);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
- if (!alternateFunc) {
- alternateName = "has" + func->name().mid(3);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
- }
- }
- }
- else if (!func->name().isEmpty()) {
- alternateName = "set";
- alternateName += func->name()[0].toUpper();
- alternateName += func->name().mid(1);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
- }
-
- if (alternateFunc && alternateFunc->access() != Node::Private) {
- int i;
- for (i = 0; i < alsoList.size(); ++i) {
- if (alsoList.at(i).toString().contains(alternateName))
- break;
- }
-
- if (i == alsoList.size()) {
- alternateName += "()";
-
- Text also;
- also << Atom(Atom::Link, alternateName)
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << alternateName
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- alsoList.prepend(also);
- }
- }
- }
- }
-}
-
-void Generator::terminate()
-{
- QList<Generator *>::ConstIterator g = generators.constBegin();
- while (g != generators.constEnd()) {
- if (outputFormats.contains((*g)->format()))
- (*g)->terminateGenerator();
- ++g;
- }
-
- fmtLeftMaps.clear();
- fmtRightMaps.clear();
- imgFileExts.clear();
- imageFiles.clear();
- imageDirs.clear();
- outDir_.clear();
-}
-
-void Generator::terminateGenerator()
-{
-}
-
-/*!
- Trims trailing whitespace off the \a string and returns
- the trimmed string.
- */
-QString Generator::trimmedTrailing(const QString& string)
-{
- QString trimmed = string;
- while (trimmed.length() > 0 && trimmed[trimmed.length() - 1].isSpace())
- trimmed.truncate(trimmed.length() - 1);
- return trimmed;
-}
-
-QString Generator::typeString(const Node *node)
-{
- switch (node->type()) {
- case Node::Namespace:
- return "namespace";
- case Node::Class:
- return "class";
- case Node::QmlType:
- return "type";
- case Node::QmlBasicType:
- return "type";
- case Node::Document:
- return "documentation";
- case Node::Enum:
- return "enum";
- case Node::Typedef:
- return "typedef";
- case Node::Function:
- return "function";
- case Node::Property:
- return "property";
- case Node::QmlPropertyGroup:
- return "property group";
- case Node::QmlProperty:
- return "QML property";
- case Node::QmlSignal:
- return "QML signal";
- case Node::QmlSignalHandler:
- return "QML signal handler";
- case Node::QmlMethod:
- return "QML method";
- default:
- return "documentation";
- }
-}
-
-void Generator::unknownAtom(const Atom *atom)
-{
- Location::internalError(tr("unknown atom type '%1' in %2 generator")
- .arg(atom->typeString()).arg(format()));
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h
deleted file mode 100644
index 9a1672dac4..0000000000
--- a/src/tools/qdoc/generator.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 GENERATOR_H
-#define GENERATOR_H
-
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qlist.h>
-#include <qmap.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
-#include "config.h"
-#include "node.h"
-#include "text.h"
-
-QT_BEGIN_NAMESPACE
-
-typedef QMultiMap<QString, Node*> NodeMultiMap;
-typedef QMap<Node*, NodeMultiMap> ParentMaps;
-
-class Config;
-class CodeMarker;
-class Location;
-class QDocDatabase;
-
-class Generator
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Generator)
-
-public:
- enum QDocPass { Neither, Prepare, Generate };
- enum ListType { Generic, Obsolete };
-
- Generator();
- virtual ~Generator();
-
- virtual bool canHandleFormat(const QString &format) { return format == this->format(); }
- virtual QString format() = 0;
- virtual void generateDocs();
- virtual void initializeGenerator(const Config &config);
- virtual void terminateGenerator();
-
- QString fullDocumentLocation(const Node *node, bool useSubdir = false);
- const Config* config() { return config_; }
-
- static Generator *currentGenerator() { return currentGenerator_; }
- static Generator *generatorForFormat(const QString& format);
- static void initialize(const Config& config);
- static const QString& outputDir() { return outDir_; }
- static const QString& outputSubdir() { return outSubdir_; }
- static void terminate();
- static const QStringList& outputFileNames() { return outFileNames_; }
- static void writeOutFileNames();
- static void augmentImageDirs(QSet<QString>& moreImageDirs);
- static void debug(const QString& message);
- static void startDebugging(const QString& message);
- static void stopDebugging(const QString& message);
- static bool debugging() { return debugging_; }
- static bool noLinkErrors() { return noLinkErrors_; }
- static bool autolinkErrors() { return autolinkErrors_; }
- static void setQDocPass(QDocPass t) { qdocPass_ = t; }
- static bool preparing() { return (qdocPass_ == Prepare); }
- static bool generating() { return (qdocPass_ == Generate); }
- static bool singleExec() { return qdocSingleExec_; }
- static bool writeQaPages() { return qdocWriteQaPages_; }
- static void setSingleExec() { qdocSingleExec_ = true; }
- static void setWriteQaPages() { qdocWriteQaPages_ = true; }
- static QString defaultModuleName() { return project_; }
- static void resetUseOutputSubdirs() { useOutputSubdirs_ = false; }
- static bool useOutputSubdirs() { return useOutputSubdirs_; }
- static void setQmlTypeContext(QmlTypeNode* t) { qmlTypeContext_ = t; }
- static QmlTypeNode* qmlTypeContext() { return qmlTypeContext_; }
- static QString cleanRef(const QString& ref);
-
-protected:
- virtual void beginSubPage(const InnerNode* node, const QString& fileName);
- virtual void endSubPage();
- virtual QString fileBase(const Node* node) const;
- virtual QString fileExtension() const = 0;
- virtual void generateQAPage() { }
- virtual void generateAlsoList(const Node *node, CodeMarker *marker);
- virtual int generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker);
- virtual void generateBody(const Node *node, CodeMarker *marker);
- virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateQmlTypePage(QmlTypeNode* , CodeMarker* ) { }
- virtual void generateQmlBasicTypePage(QmlBasicTypeNode* , CodeMarker* ) { }
- virtual void generateDocumentNode(DocumentNode* dn, CodeMarker* marker);
- virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker);
- virtual void generateInheritedBy(const ClassNode *classe, CodeMarker *marker);
- virtual void generateInherits(const ClassNode *classe, CodeMarker *marker);
- virtual void generateInnerNode(InnerNode* node);
- virtual void generateMaintainerList(const InnerNode* node, CodeMarker* marker);
- virtual void generateQmlInheritedBy(const QmlTypeNode* qcn, CodeMarker* marker);
- virtual void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker);
- virtual bool generateQmlText(const Text& text,
- const Node *relative,
- CodeMarker *marker,
- const QString& qmlName);
- virtual bool generateText(const Text& text, const Node *relative, CodeMarker *marker);
- virtual QString imageFileName(const Node *relative, const QString& fileBase);
- virtual int skipAtoms(const Atom *atom, Atom::Type type) const;
- virtual QString typeString(const Node *node);
-
- static bool matchAhead(const Atom *atom, Atom::Type expectedAtomType);
- static QString outputPrefix(const QString &nodeType);
- static void singularPlural(Text& text, const NodeList& nodes);
- static void supplementAlsoList(const Node *node, QList<Text> &alsoList);
- static QString trimmedTrailing(const QString &string);
- static QString sinceTitles[];
-
- void initializeTextOutput();
- QString fileName(const Node* node) const;
- QMap<QString, QString> &formattingLeftMap();
- QMap<QString, QString> &formattingRightMap();
- const Atom* generateAtomList(const Atom *atom,
- const Node *relative,
- CodeMarker *marker,
- bool generate,
- int& numGeneratedAtoms);
- void generateExampleFiles(const DocumentNode *dn, CodeMarker *marker);
- void generateFileList(const DocumentNode* dn,
- CodeMarker* marker,
- Node::SubType subtype,
- const QString& tag);
- void generateSince(const Node *node, CodeMarker *marker);
- void generateStatus(const Node *node, CodeMarker *marker);
- void generatePrivateSignalNote(const Node* node, CodeMarker* marker);
- void generateThreadSafeness(const Node *node, CodeMarker *marker);
- QString getMetadataElement(const InnerNode* inner, const QString& t);
- QStringList getMetadataElements(const InnerNode* inner, const QString& t);
- QString indent(int level, const QString& markedCode);
- QTextStream& out();
- QString outFileName();
- bool parseArg(const QString& src,
- const QString& tag,
- int* pos,
- int n,
- QStringRef* contents,
- QStringRef* par1 = 0,
- bool debug = false);
- QString plainCode(const QString& markedCode);
- void setImageFileExtensions(const QStringList& extensions);
- void unknownAtom(const Atom *atom);
- void appendSortedQmlNames(Text& text, const Node* base, const NodeList& subs);
-
- QMap<QString, QStringList> editionGroupMap;
- QMap<QString, QStringList> editionModuleMap;
- QString naturalLanguage;
-#ifndef QT_NO_TEXTCODEC
- QTextCodec* outputCodec;
- QString outputEncoding;
-#endif
- QString tagFile_;
- QStack<QTextStream*> outStreamStack;
-
- void appendFullName(Text& text,
- const Node *apparentNode,
- const Node *relative,
- const Node *actualNode = 0);
- void appendFullName(Text& text,
- const Node *apparentNode,
- const QString& fullName,
- const Node *actualNode);
- void appendFullNames(Text& text, const NodeList& nodes, const Node* relative);
- void appendSortedNames(Text& text, const ClassNode *classe, const QList<RelatedClass> &classes);
-
-private:
- static Generator* currentGenerator_;
- static QStringList exampleDirs;
- static QStringList exampleImgExts;
- static QMap<QString, QMap<QString, QString> > fmtLeftMaps;
- static QMap<QString, QMap<QString, QString> > fmtRightMaps;
- static QList<Generator *> generators;
- static QStringList imageDirs;
- static QStringList imageFiles;
- static QMap<QString, QStringList> imgFileExts;
- static QString project_;
- static QString outDir_;
- static QString outSubdir_;
- static QStringList outFileNames_;
- static QSet<QString> outputFormats;
- static QHash<QString, QString> outputPrefixes;
- static QStringList scriptDirs;
- static QStringList scriptFiles;
- static QStringList styleDirs;
- static QStringList styleFiles;
- static bool debugging_;
- static bool noLinkErrors_;
- static bool autolinkErrors_;
- static bool redirectDocumentationToDevNull_;
- static QDocPass qdocPass_;
- static bool qdocSingleExec_;
- static bool qdocWriteQaPages_;
- static bool useOutputSubdirs_;
- static QmlTypeNode* qmlTypeContext_;
-
- void generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker);
-
- QString amp;
- QString gt;
- QString lt;
- QString quot;
- QRegExp tag;
-
- protected:
- const Config* config_;
- QDocDatabase* qdb_;
- bool inLink_;
- bool inContents_;
- bool inSectionHeading_;
- bool inTableHeader_;
- bool threeColumnEnumValueTable_;
- bool showInternal_;
- bool singleExec_;
- int numTableRows_;
- QString link_;
- QString sectionNumber_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
deleted file mode 100644
index d00f75e32d..0000000000
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ /dev/null
@@ -1,853 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qcryptographichash.h>
-#include <qdebug.h>
-#include <qhash.h>
-#include <qmap.h>
-
-#include "atom.h"
-#include "helpprojectwriter.h"
-#include "htmlgenerator.h"
-#include "config.h"
-#include "node.h"
-#include "qdocdatabase.h"
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-HelpProjectWriter::HelpProjectWriter(const Config &config,
- const QString &defaultFileName,
- Generator* g)
-{
- reset(config, defaultFileName, g);
-}
-
-void HelpProjectWriter::reset(const Config &config,
- const QString &defaultFileName,
- Generator* g)
-{
- projects.clear();
- gen_ = g;
- /*
- Get the pointer to the singleton for the qdoc database and
- store it locally. This replaces all the local accesses to
- the node tree, which are now private.
- */
- qdb_ = QDocDatabase::qdocDB();
-
- // The output directory should already have been checked by the calling
- // generator.
- outputDir = config.getOutputDir();
-
- QStringList names = config.getStringList(CONFIG_QHP + Config::dot + "projects");
-
- foreach (const QString &projectName, names) {
- HelpProject project;
- project.name = projectName;
-
- QString prefix = CONFIG_QHP + Config::dot + projectName + Config::dot;
- project.helpNamespace = config.getString(prefix + "namespace");
- project.virtualFolder = config.getString(prefix + "virtualFolder");
- project.fileName = config.getString(prefix + "file");
- if (project.fileName.isEmpty())
- project.fileName = defaultFileName;
- project.extraFiles = config.getStringSet(prefix + "extraFiles");
- project.extraFiles += config.getStringSet(CONFIG_QHP + Config::dot + "extraFiles");
- project.indexTitle = config.getString(prefix + "indexTitle");
- project.indexRoot = config.getString(prefix + "indexRoot");
- project.filterAttributes = config.getStringList(prefix + "filterAttributes").toSet();
- project.includeIndexNodes = config.getBool(prefix + "includeIndexNodes");
- QSet<QString> customFilterNames = config.subVars(prefix + "customFilters");
- foreach (const QString &filterName, customFilterNames) {
- QString name = config.getString(prefix + "customFilters" + Config::dot + filterName + Config::dot + "name");
- QSet<QString> filters = config.getStringList(prefix + "customFilters" + Config::dot + filterName + Config::dot + "filterAttributes").toSet();
- project.customFilters[name] = filters;
- }
- //customFilters = config.defs.
-
- foreach (QString name, config.getStringSet(prefix + "excluded"))
- project.excluded.insert(name.replace(QLatin1Char('\\'), QLatin1Char('/')));
-
- foreach (const QString &name, config.getStringList(prefix + "subprojects")) {
- SubProject subproject;
- QString subprefix = prefix + "subprojects" + Config::dot + name + Config::dot;
- subproject.title = config.getString(subprefix + "title");
- subproject.indexTitle = config.getString(subprefix + "indexTitle");
- subproject.sortPages = config.getBool(subprefix + "sortPages");
- subproject.type = config.getString(subprefix + "type");
- readSelectors(subproject, config.getStringList(subprefix + "selectors"));
- project.subprojects[name] = subproject;
- }
-
- if (project.subprojects.isEmpty()) {
- SubProject subproject;
- readSelectors(subproject, config.getStringList(prefix + "selectors"));
- project.subprojects.insert(QString(), subproject);
- }
-
- projects.append(project);
- }
-}
-
-void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList &selectors)
-{
- QHash<QString, Node::Type> typeHash;
- typeHash["namespace"] = Node::Namespace;
- typeHash["class"] = Node::Class;
- typeHash["fake"] = Node::Document;
- typeHash["enum"] = Node::Enum;
- typeHash["typedef"] = Node::Typedef;
- typeHash["function"] = Node::Function;
- typeHash["property"] = Node::Property;
- typeHash["variable"] = Node::Variable;
- typeHash["group"] = Node::Group;
- typeHash["module"] = Node::Module;
- typeHash["qmlmodule"] = Node::QmlModule;
- typeHash["qmlproperty"] = Node::QmlProperty;
- typeHash["qmlsignal"] = Node::QmlSignal;
- typeHash["qmlsignalhandler"] = Node::QmlSignalHandler;
- typeHash["qmlmethod"] = Node::QmlMethod;
- typeHash["qmlpropertygroup"] = Node::QmlPropertyGroup;
- typeHash["qmlclass"] = Node::QmlType;
- typeHash["qmlbasictype"] = Node::QmlBasicType;
-
- QHash<QString, Node::SubType> subTypeHash;
- subTypeHash["example"] = Node::Example;
- subTypeHash["headerfile"] = Node::HeaderFile;
- subTypeHash["file"] = Node::File;
- subTypeHash["page"] = Node::Page;
- subTypeHash["externalpage"] = Node::ExternalPage;
-
- QSet<Node::SubType> allSubTypes = QSet<Node::SubType>::fromList(subTypeHash.values());
-
- foreach (const QString &selector, selectors) {
- QStringList pieces = selector.split(QLatin1Char(':'));
- if (pieces.size() == 1) {
- QString lower = selector.toLower();
- if (typeHash.contains(lower))
- subproject.selectors[typeHash[lower]] = allSubTypes;
- } else if (pieces.size() >= 2) {
- QString lower = pieces[0].toLower();
- pieces = pieces[1].split(QLatin1Char(','));
- if (typeHash.contains(lower)) {
- QSet<Node::SubType> subTypes;
- for (int i = 0; i < pieces.size(); ++i) {
- QString lower = pieces[i].toLower();
- if (subTypeHash.contains(lower))
- subTypes.insert(subTypeHash[lower]);
- }
- subproject.selectors[typeHash[lower]] = subTypes;
- }
- }
- }
-}
-
-void HelpProjectWriter::addExtraFile(const QString &file)
-{
- for (int i = 0; i < projects.size(); ++i)
- projects[i].extraFiles.insert(file);
-}
-
-void HelpProjectWriter::addExtraFiles(const QSet<QString> &files)
-{
- for (int i = 0; i < projects.size(); ++i)
- projects[i].extraFiles.unite(files);
-}
-
-/*
- Returns a list of strings describing the keyword details for a given node.
-
- The first string is the human-readable name to be shown in Assistant.
- The second string is a unique identifier.
- The third string is the location of the documentation for the keyword.
-*/
-QStringList HelpProjectWriter::keywordDetails(const Node *node) const
-{
- QStringList details;
-
- if (node->parent() && !node->parent()->name().isEmpty()) {
- // "name"
- if (node->type() == Node::Enum || node->type() == Node::Typedef)
- details << node->parent()->name()+"::"+node->name();
- else
- details << node->name();
- // "id"
- details << node->parent()->name()+"::"+node->name();
- }
- else if (node->isQmlType() || node->isQmlBasicType()) {
- details << node->name();
- details << "QML." + node->name();
- }
- else if (node->isJsType() || node->isJsBasicType()) {
- details << node->name();
- details << "JS." + node->name();
- }
- else if (node->isDocumentNode()) {
- const DocumentNode *fake = static_cast<const DocumentNode *>(node);
- details << fake->fullTitle();
- details << fake->fullTitle();
- }
- else {
- details << node->name();
- details << node->name();
- }
- details << gen_->fullDocumentLocation(node, false);
- return details;
-}
-
-bool HelpProjectWriter::generateSection(HelpProject &project,
- QXmlStreamWriter & /* writer */,
- const Node *node)
-{
- if (!node->url().isEmpty() && !(project.includeIndexNodes && !node->url().startsWith("http")))
- return false;
-
- if (node->access() == Node::Private || node->status() == Node::Internal)
- return false;
-
- if (node->name().isEmpty())
- return true;
-
- QString docPath = node->doc().location().filePath();
- if (!docPath.isEmpty() && project.excluded.contains(docPath))
- return false;
-
- QString objName;
- if (node->isDocumentNode()) {
- const DocumentNode *fake = static_cast<const DocumentNode *>(node);
- objName = fake->fullTitle();
- }
- else
- objName = node->fullDocumentName();
-
- // Only add nodes to the set for each subproject if they match a selector.
- // Those that match will be listed in the table of contents.
-
- foreach (const QString &name, project.subprojects.keys()) {
- SubProject subproject = project.subprojects[name];
- // No selectors: accept all nodes.
- if (subproject.selectors.isEmpty()) {
- project.subprojects[name].nodes[objName] = node;
- }
- else if (subproject.selectors.contains(node->type())) {
- // Accept only the node types in the selectors hash.
- if (node->type() != Node::Document)
- project.subprojects[name].nodes[objName] = node;
- else {
- // Accept only fake nodes with subtypes contained in the selector's
- // mask.
- const DocumentNode *docNode = static_cast<const DocumentNode *>(node);
- if (subproject.selectors[node->type()].contains(docNode->subType()) &&
- docNode->subType() != Node::ExternalPage &&
- !docNode->fullTitle().isEmpty()) {
-
- project.subprojects[name].nodes[objName] = node;
- }
- }
- }
- }
-
- switch (node->type()) {
-
- case Node::Class:
- project.keywords.append(keywordDetails(node));
- break;
- case Node::QmlType:
- case Node::QmlBasicType:
- if (node->doc().hasKeywords()) {
- foreach (const Atom* keyword, node->doc().keywords()) {
- if (!keyword->string().isEmpty()) {
- QStringList details;
- details << keyword->string()
- << keyword->string()
- << gen_->fullDocumentLocation(node, false) +
- QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
- project.keywords.append(details);
- }
- else
- node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false)));
- }
- }
- project.keywords.append(keywordDetails(node));
- break;
-
- case Node::Namespace:
- project.keywords.append(keywordDetails(node));
- break;
-
- case Node::Enum:
- project.keywords.append(keywordDetails(node));
- {
- const EnumNode *enumNode = static_cast<const EnumNode*>(node);
- foreach (const EnumItem &item, enumNode->items()) {
- QStringList details;
-
- if (enumNode->itemAccess(item.name()) == Node::Private)
- continue;
-
- if (!node->parent()->name().isEmpty()) {
- details << node->parent()->name()+"::"+item.name(); // "name"
- details << node->parent()->name()+"::"+item.name(); // "id"
- } else {
- details << item.name(); // "name"
- details << item.name(); // "id"
- }
- details << gen_->fullDocumentLocation(node, false);
- project.keywords.append(details);
- }
- }
- break;
-
- case Node::Group:
- case Node::Module:
- case Node::QmlModule:
- {
- const CollectionNode* cn = static_cast<const CollectionNode*>(node);
- if (!cn->fullTitle().isEmpty()) {
- if (cn->doc().hasKeywords()) {
- foreach (const Atom* keyword, cn->doc().keywords()) {
- if (!keyword->string().isEmpty()) {
- QStringList details;
- details << keyword->string()
- << keyword->string()
- << gen_->fullDocumentLocation(node, false) +
- QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
- project.keywords.append(details);
- }
- else
- cn->doc().location().warning(
- tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false))
- );
- }
- }
- project.keywords.append(keywordDetails(node));
- }
- }
- break;
-
- case Node::Property:
- case Node::QmlProperty:
- case Node::QmlSignal:
- case Node::QmlSignalHandler:
- case Node::QmlMethod:
- project.keywords.append(keywordDetails(node));
- break;
-
- case Node::Function:
- {
- const FunctionNode *funcNode = static_cast<const FunctionNode *>(node);
-
- // Only insert keywords for non-constructors. Constructors are covered
- // by the classes themselves.
-
- if (funcNode->metaness() != FunctionNode::Ctor)
- project.keywords.append(keywordDetails(node));
-
- // Insert member status flags into the entries for the parent
- // node of the function, or the node it is related to.
- // Since parent nodes should have already been inserted into
- // the set of files, we only need to ensure that related nodes
- // are inserted.
-
- if (node->relates()) {
- project.memberStatus[node->relates()].insert(node->status());
- } else if (node->parent())
- project.memberStatus[node->parent()].insert(node->status());
- }
- break;
-
- case Node::Typedef:
- {
- const TypedefNode *typedefNode = static_cast<const TypedefNode *>(node);
- QStringList typedefDetails = keywordDetails(node);
- const EnumNode *enumNode = typedefNode->associatedEnum();
- // Use the location of any associated enum node in preference
- // to that of the typedef.
- if (enumNode)
- typedefDetails[2] = gen_->fullDocumentLocation(enumNode, false);
-
- project.keywords.append(typedefDetails);
- }
- break;
-
- case Node::Variable:
- {
- project.keywords.append(keywordDetails(node));
- }
- break;
-
- // Document nodes (such as manual pages) contain subtypes, titles and other
- // attributes.
- case Node::Document: {
- const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
- if (docNode->subType() != Node::ExternalPage &&
- docNode->subType() != Node::Image &&
- !docNode->fullTitle().isEmpty()) {
-
- if (docNode->subType() != Node::File) {
- if (docNode->doc().hasKeywords()) {
- foreach (const Atom *keyword, docNode->doc().keywords()) {
- if (!keyword->string().isEmpty()) {
- QStringList details;
- details << keyword->string()
- << keyword->string()
- << gen_->fullDocumentLocation(node, false) +
- QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
- project.keywords.append(details);
- } else
- docNode->doc().location().warning(
- tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false))
- );
- }
- }
- project.keywords.append(keywordDetails(node));
- }
- }
- break;
- }
- default:
- ;
- }
-
- // Add all images referenced in the page to the set of files to include.
- const Atom *atom = node->doc().body().firstAtom();
- while (atom) {
- if (atom->type() == Atom::Image || atom->type() == Atom::InlineImage) {
- // Images are all placed within a single directory regardless of
- // whether the source images are in a nested directory structure.
- QStringList pieces = atom->string().split(QLatin1Char('/'));
- project.files.insert("images/" + pieces.last());
- }
- atom = atom->next();
- }
-
- return true;
-}
-
-void HelpProjectWriter::generateSections(HelpProject &project,
- QXmlStreamWriter &writer, const Node *node)
-{
- /*
- Don't include index nodes in the help file. Or DITA map nodes.
- */
- if (node->isIndexNode() || node->subType() == Node::DitaMap)
- return;
- if (!generateSection(project, writer, node))
- return;
-
- if (node->isInnerNode()) {
- const InnerNode *inner = static_cast<const InnerNode *>(node);
-
- // Ensure that we don't visit nodes more than once.
- QMap<QString, const Node*> childMap;
- foreach (const Node *childNode, inner->childNodes()) {
- if (childNode->isIndexNode())
- continue;
-
- if (childNode->access() == Node::Private)
- continue;
-
- if (childNode->type() == Node::Document) {
- childMap[static_cast<const DocumentNode *>(childNode)->fullTitle()] = childNode;
- }
- else if (childNode->isQmlPropertyGroup() || childNode->isJsPropertyGroup()) {
- /*
- Don't visit QML/JS property group nodes,
- but visit their children, which are all
- QML/JS property nodes.
-
- This is probably not correct anymore,
- because The Qml/Js Property Group is
- an actual documented thing.
- */
- const InnerNode* inner = static_cast<const InnerNode*>(childNode);
- foreach (const Node* n, inner->childNodes()) {
- if (n->access() == Node::Private)
- continue;
- childMap[n->fullDocumentName()] = n;
- }
- }
- else {
- // Store member status of children
- project.memberStatus[node].insert(childNode->status());
- if (childNode->relates()) {
- project.memberStatus[childNode->relates()].insert(childNode->status());
- }
-
- if (childNode->type() == Node::Function) {
- const FunctionNode *funcNode = static_cast<const FunctionNode *>(childNode);
- if (funcNode->isOverload())
- continue;
- }
- childMap[childNode->fullDocumentName()] = childNode;
- }
- }
- foreach (const Node *child, childMap)
- generateSections(project, writer, child);
- }
-}
-
-void HelpProjectWriter::generate()
-{
- for (int i = 0; i < projects.size(); ++i)
- generateProject(projects[i]);
-}
-
-void HelpProjectWriter::writeHashFile(QFile &file)
-{
- QCryptographicHash hash(QCryptographicHash::Sha1);
- hash.addData(&file);
-
- QFile hashFile(file.fileName() + ".sha1");
- if (!hashFile.open(QFile::WriteOnly | QFile::Text))
- return;
-
- hashFile.write(hash.result().toHex());
- hashFile.close();
-}
-
-void HelpProjectWriter::writeSection(QXmlStreamWriter &writer, const QString &path,
- const QString &value)
-{
- writer.writeStartElement(QStringLiteral("section"));
- writer.writeAttribute(QStringLiteral("ref"), path);
- writer.writeAttribute(QStringLiteral("title"), value);
- writer.writeEndElement(); // section
-}
-
-/*
- Write subsections for all members, compatibility members and obsolete members.
-*/
-void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &writer,
- const Node *node)
-{
- QString href = gen_->fullDocumentLocation(node, false);
- href = href.left(href.size()-5);
- if (href.isEmpty())
- return;
-
- bool derivedClass = false;
- if (node->type() == Node::Class)
- derivedClass = !(static_cast<const ClassNode *>(node)->baseClasses().isEmpty());
-
- // Do not generate a 'List of all members' for namespaces or header files,
- // but always generate it for derived classes and QML classes
- if (!node->isNamespace() && !node->isHeaderFile() &&
- (derivedClass || node->isQmlType() || node->isJsType() ||
- !project.memberStatus[node].isEmpty())) {
- QString membersPath = href + QStringLiteral("-members.html");
- writeSection(writer, membersPath, tr("List of all members"));
- }
- if (project.memberStatus[node].contains(Node::Compat)) {
- QString compatPath = href + QStringLiteral("-compat.html");
- writeSection(writer, compatPath, tr("Compatibility members"));
- }
- if (project.memberStatus[node].contains(Node::Obsolete)) {
- QString obsoletePath = href + QStringLiteral("-obsolete.html");
- writeSection(writer, obsoletePath, tr("Obsolete members"));
- }
-}
-
-void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer,
- const Node *node)
-{
- QString href = gen_->fullDocumentLocation(node, false);
- QString objName = node->name();
-
- switch (node->type()) {
-
- case Node::Class:
- writer.writeStartElement("section");
- writer.writeAttribute("ref", href);
- if (node->parent() && !node->parent()->name().isEmpty())
- writer.writeAttribute("title", tr("%1::%2 Class Reference").arg(node->parent()->name()).arg(objName));
- else
- writer.writeAttribute("title", tr("%1 Class Reference").arg(objName));
-
- addMembers(project, writer, node);
- writer.writeEndElement(); // section
- break;
-
- case Node::Namespace:
- writeSection(writer, href, objName);
- break;
-
- case Node::QmlType:
- writer.writeStartElement("section");
- writer.writeAttribute("ref", href);
- writer.writeAttribute("title", tr("%1 Type Reference").arg(node->fullTitle()));
- addMembers(project, writer, node);
- writer.writeEndElement(); // section
- break;
-
- case Node::Document: {
- // Document nodes (such as manual pages) contain subtypes, titles and other
- // attributes.
- const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
-
- writer.writeStartElement("section");
- writer.writeAttribute("ref", href);
- writer.writeAttribute("title", docNode->fullTitle());
-
- if (docNode->subType() == Node::HeaderFile)
- addMembers(project, writer, node);
-
- writer.writeEndElement(); // section
- }
- break;
- case Node::Group:
- case Node::Module:
- case Node::QmlModule:
- {
- const CollectionNode* cn = static_cast<const CollectionNode*>(node);
- writer.writeStartElement("section");
- writer.writeAttribute("ref", href);
- writer.writeAttribute("title", cn->fullTitle());
- writer.writeEndElement(); // section
- }
- break;
- default:
- ;
- }
-}
-
-void HelpProjectWriter::generateProject(HelpProject &project)
-{
- const Node *rootNode;
-
- // Restrict searching only to the local (primary) tree
- QVector<Tree*> searchOrder = qdb_->searchOrder();
- qdb_->setLocalSearch();
-
- if (!project.indexRoot.isEmpty())
- rootNode = qdb_->findDocumentNodeByTitle(project.indexRoot);
- else
- rootNode = qdb_->primaryTreeRoot();
-
- if (!rootNode)
- return;
-
- project.files.clear();
- project.keywords.clear();
-
- QFile file(outputDir + QDir::separator() + project.fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text))
- return;
-
- QXmlStreamWriter writer(&file);
- writer.setAutoFormatting(true);
- writer.writeStartDocument();
- writer.writeStartElement("QtHelpProject");
- writer.writeAttribute("version", "1.0");
-
- // Write metaData, virtualFolder and namespace elements.
- writer.writeTextElement("namespace", project.helpNamespace);
- writer.writeTextElement("virtualFolder", project.virtualFolder);
-
- // Write customFilter elements.
- QHash<QString, QSet<QString> >::ConstIterator it;
- for (it = project.customFilters.constBegin(); it != project.customFilters.constEnd(); ++it) {
- writer.writeStartElement("customFilter");
- writer.writeAttribute("name", it.key());
- foreach (const QString &filter, it.value())
- writer.writeTextElement("filterAttribute", filter);
- writer.writeEndElement(); // customFilter
- }
-
- // Start the filterSection.
- writer.writeStartElement("filterSection");
-
- // Write filterAttribute elements.
- foreach (const QString &filterName, project.filterAttributes)
- writer.writeTextElement("filterAttribute", filterName);
-
- writer.writeStartElement("toc");
- writer.writeStartElement("section");
- const Node* node = qdb_->findDocumentNodeByTitle(project.indexTitle);
- if (node == 0)
- node = qdb_->findNodeByNameAndType(QStringList("index.html"), Node::Document);
- QString indexPath;
- if (node)
- indexPath = gen_->fullDocumentLocation(node, false);
- else
- indexPath = "index.html";
- writer.writeAttribute("ref", indexPath);
- writer.writeAttribute("title", project.indexTitle);
-
- generateSections(project, writer, rootNode);
-
- foreach (const QString &name, project.subprojects.keys()) {
- SubProject subproject = project.subprojects[name];
-
- if (subproject.type == QLatin1String("manual")) {
-
- const Node *indexPage = qdb_->findNodeForTarget(subproject.indexTitle, 0);
- if (indexPage) {
- Text indexBody = indexPage->doc().body();
- const Atom *atom = indexBody.firstAtom();
- QStack<int> sectionStack;
- bool inItem = false;
-
- while (atom) {
- switch (atom->type()) {
- case Atom::ListLeft:
- sectionStack.push(0);
- break;
- case Atom::ListRight:
- if (sectionStack.pop() > 0)
- writer.writeEndElement(); // section
- break;
- case Atom::ListItemLeft:
- inItem = true;
- break;
- case Atom::ListItemRight:
- inItem = false;
- break;
- case Atom::Link:
- if (inItem) {
- if (sectionStack.top() > 0)
- writer.writeEndElement(); // section
-
- const Node *page = qdb_->findNodeForTarget(atom->string(), 0);
- writer.writeStartElement("section");
- QString indexPath = gen_->fullDocumentLocation(page, false);
- writer.writeAttribute("ref", indexPath);
- writer.writeAttribute("title", atom->string());
-
- sectionStack.top() += 1;
- }
- break;
- default:
- ;
- }
-
- if (atom == indexBody.lastAtom())
- break;
- atom = atom->next();
- }
- } else
- rootNode->doc().location().warning(
- tr("Failed to find index: %1").arg(subproject.indexTitle)
- );
-
- } else {
-
- if (!name.isEmpty()) {
- writer.writeStartElement("section");
- QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0),
- false);
- writer.writeAttribute("ref", indexPath);
- writer.writeAttribute("title", subproject.title);
- }
- if (subproject.sortPages) {
- QStringList titles = subproject.nodes.keys();
- titles.sort();
- foreach (const QString &title, titles) {
- writeNode(project, writer, subproject.nodes[title]);
- }
- } else {
- // Find a contents node and navigate from there, using the NextLink values.
- QSet<QString> visited;
- bool contentsFound = false;
- foreach (const Node *node, subproject.nodes) {
- QString nextTitle = node->links().value(Node::NextLink).first;
- if (!nextTitle.isEmpty() &&
- node->links().value(Node::ContentsLink).first.isEmpty()) {
-
- const Node *nextPage = qdb_->findNodeForTarget(nextTitle, 0);
-
- // Write the contents node.
- writeNode(project, writer, node);
- contentsFound = true;
-
- while (nextPage) {
- writeNode(project, writer, nextPage);
- nextTitle = nextPage->links().value(Node::NextLink).first;
- if (nextTitle.isEmpty() || visited.contains(nextTitle))
- break;
- nextPage = qdb_->findNodeForTarget(nextTitle, 0);
- visited.insert(nextTitle);
- }
- break;
- }
- }
- // No contents/nextpage links found, write all nodes unsorted
- if (!contentsFound) {
- foreach (const Node *node, subproject.nodes)
- writeNode(project, writer, node);
- }
- }
-
- if (!name.isEmpty())
- writer.writeEndElement(); // section
- }
- }
-
- // Restore original search order
- qdb_->setSearchOrder(searchOrder);
-
- writer.writeEndElement(); // section
- writer.writeEndElement(); // toc
-
- writer.writeStartElement("keywords");
- foreach (const QStringList &details, project.keywords) {
- writer.writeStartElement("keyword");
- writer.writeAttribute("name", details[0]);
- writer.writeAttribute("id", details[1]);
- writer.writeAttribute("ref", details[2]);
- writer.writeEndElement(); //keyword
- }
- writer.writeEndElement(); // keywords
-
- writer.writeStartElement("files");
-
- // The list of files to write is the union of generated files and
- // other files (images and extras) included in the project
- QSet<QString> files = QSet<QString>::fromList(gen_->outputFileNames());
- files.unite(project.files);
- files.unite(project.extraFiles);
- foreach (const QString &usedFile, files) {
- if (!usedFile.isEmpty())
- writer.writeTextElement("file", usedFile);
- }
- writer.writeEndElement(); // files
-
- writer.writeEndElement(); // filterSection
- writer.writeEndElement(); // QtHelpProject
- writer.writeEndDocument();
- writeHashFile(file);
- file.close();
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h
deleted file mode 100644
index efc2596296..0000000000
--- a/src/tools/qdoc/helpprojectwriter.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 HELPPROJECTWRITER_H
-#define HELPPROJECTWRITER_H
-
-#include <qstring.h>
-#include <qxmlstream.h>
-
-#include "config.h"
-#include "node.h"
-
-QT_BEGIN_NAMESPACE
-
-class QDocDatabase;
-class Generator;
-typedef QPair<QString, const Node*> QStringNodePair;
-
-struct SubProject
-{
- QString title;
- QString indexTitle;
- QHash<Node::Type, QSet<DocumentNode::SubType> > selectors;
- bool sortPages;
- QString type;
- QHash<QString, const Node *> nodes;
-};
-
-struct HelpProject
-{
- QString name;
- QString helpNamespace;
- QString virtualFolder;
- QString fileName;
- QString indexRoot;
- QString indexTitle;
- QList<QStringList> keywords;
- QSet<QString> files;
- QSet<QString> extraFiles;
- QSet<QString> filterAttributes;
- QHash<QString, QSet<QString> > customFilters;
- QSet<QString> excluded;
- QMap<QString, SubProject> subprojects;
- QHash<const Node *, QSet<Node::Status> > memberStatus;
- bool includeIndexNodes;
-};
-
-class HelpProjectWriter
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::HelpProjectWriter)
-
-public:
- HelpProjectWriter(const Config &config,
- const QString &defaultFileName,
- Generator* g);
- void reset(const Config &config,
- const QString &defaultFileName,
- Generator* g);
- void addExtraFile(const QString &file);
- void addExtraFiles(const QSet<QString> &files);
- void generate();
-
-private:
- void generateProject(HelpProject &project);
- void generateSections(HelpProject &project, QXmlStreamWriter &writer,
- const Node *node);
- bool generateSection(HelpProject &project, QXmlStreamWriter &writer,
- const Node *node);
- QStringList keywordDetails(const Node *node) const;
- void writeHashFile(QFile &file);
- void writeNode(HelpProject &project, QXmlStreamWriter &writer, const Node *node);
- void readSelectors(SubProject &subproject, const QStringList &selectors);
- void addMembers(HelpProject &project, QXmlStreamWriter &writer,
- const Node *node);
- void writeSection(QXmlStreamWriter &writer, const QString &path,
- const QString &value);
-
- QDocDatabase* qdb_;
- Generator* gen_;
-
- QString outputDir;
- QList<HelpProject> projects;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
deleted file mode 100644
index 4aed6085cd..0000000000
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ /dev/null
@@ -1,4894 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- htmlgenerator.cpp
-*/
-
-#include "codemarker.h"
-#include "codeparser.h"
-#include "helpprojectwriter.h"
-#include "htmlgenerator.h"
-#include "node.h"
-#include "qdocdatabase.h"
-#include "separator.h"
-#include "tree.h"
-#include <ctype.h>
-#include <qdebug.h>
-#include <qlist.h>
-#include <qiterator.h>
-#include <qtextcodec.h>
-#include <quuid.h>
-
-QT_BEGIN_NAMESPACE
-
-#define COMMAND_VERSION Doc::alias("version")
-int HtmlGenerator::id = 0;
-bool HtmlGenerator::debugging_on = false;
-
-QString HtmlGenerator::divNavTop;
-
-static bool showBrokenLinks = false;
-
-static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)");
-static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)(</@func>)");
-static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)(</@\\2>)");
-static QRegExp spanTag("</@(?:comment|preprocessor|string|char|number|op|type|name|keyword)>");
-static QRegExp unknownTag("</?@[^>]*>");
-
-static void addLink(const QString &linkTarget,
- const QStringRef &nestedStuff,
- QString *res)
-{
- if (!linkTarget.isEmpty()) {
- *res += "<a href=\"";
- *res += linkTarget;
- *res += "\">";
- *res += nestedStuff;
- *res += "</a>";
- }
- else {
- *res += nestedStuff;
- }
-}
-
-/*!
- Constructs the HTML output generator.
- */
-HtmlGenerator::HtmlGenerator()
- : codeIndent(0),
- helpProjectWriter(0),
- inObsoleteLink(false),
- funcLeftParen("\\S(\\()"),
- obsoleteLinks(false)
-{
-}
-
-/*!
- Destroys the HTML output generator. Deletes the singleton
- instance of HelpProjectWriter.
- */
-HtmlGenerator::~HtmlGenerator()
-{
- if (helpProjectWriter) {
- delete helpProjectWriter;
- helpProjectWriter = 0;
- }
-}
-
-/*!
- Initializes the HTML output generator's data structures
- from the configuration class \a config.
- */
-void HtmlGenerator::initializeGenerator(const Config &config)
-{
- static const struct {
- const char *key;
- const char *left;
- const char *right;
- } defaults[] = {
- { ATOM_FORMATTING_BOLD, "<b>", "</b>" },
- { ATOM_FORMATTING_INDEX, "<!--", "-->" },
- { ATOM_FORMATTING_ITALIC, "<i>", "</i>" },
- { ATOM_FORMATTING_PARAMETER, "<i>", "</i>" },
- { ATOM_FORMATTING_SUBSCRIPT, "<sub>", "</sub>" },
- { ATOM_FORMATTING_SUPERSCRIPT, "<sup>", "</sup>" },
- { ATOM_FORMATTING_TELETYPE, "<code>", "</code>" }, // <tt> tag is not supported in HTML5
- { ATOM_FORMATTING_UICONTROL, "<b>", "</b>" },
- { ATOM_FORMATTING_UNDERLINE, "<u>", "</u>" },
- { 0, 0, 0 }
- };
-
- Generator::initializeGenerator(config);
- obsoleteLinks = config.getBool(CONFIG_OBSOLETELINKS);
- setImageFileExtensions(QStringList() << "png" << "jpg" << "jpeg" << "gif");
-
- /*
- The formatting maps are owned by Generator. They are cleared in
- Generator::terminate().
- */
- int i = 0;
- while (defaults[i].key) {
- formattingLeftMap().insert(defaults[i].key, defaults[i].left);
- formattingRightMap().insert(defaults[i].key, defaults[i].right);
- i++;
- }
-
- style = config.getString(HtmlGenerator::format() +
- Config::dot +
- CONFIG_STYLE);
- endHeader = config.getString(HtmlGenerator::format() +
- Config::dot +
- CONFIG_ENDHEADER);
- postHeader = config.getString(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_POSTHEADER);
- postPostHeader = config.getString(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_POSTPOSTHEADER);
- prologue = config.getString(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_PROLOGUE);
-
- footer = config.getString(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_FOOTER);
- address = config.getString(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_ADDRESS);
- pleaseGenerateMacRef = config.getBool(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_GENERATEMACREFS);
- noNavigationBar = config.getBool(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_NONAVIGATIONBAR);
- tocDepth = config.getInt(HtmlGenerator::format() +
- Config::dot +
- HTMLGENERATOR_TOCDEPTH);
-
- project = config.getString(CONFIG_PROJECT);
-
- projectDescription = config.getString(CONFIG_DESCRIPTION);
- if (projectDescription.isEmpty() && !project.isEmpty())
- projectDescription = project + " Reference Documentation";
-
- projectUrl = config.getString(CONFIG_URL);
- tagFile_ = config.getString(CONFIG_TAGFILE);
-
-#ifndef QT_NO_TEXTCODEC
- outputEncoding = config.getString(CONFIG_OUTPUTENCODING);
- if (outputEncoding.isEmpty())
- outputEncoding = QLatin1String("UTF-8");
- outputCodec = QTextCodec::codecForName(outputEncoding.toLocal8Bit());
-#endif
-
- naturalLanguage = config.getString(CONFIG_NATURALLANGUAGE);
- if (naturalLanguage.isEmpty())
- naturalLanguage = QLatin1String("en");
-
- QSet<QString> editionNames = config.subVars(CONFIG_EDITION);
- QSet<QString>::ConstIterator edition = editionNames.constBegin();
- while (edition != editionNames.constEnd()) {
- QString editionName = *edition;
- QStringList editionModules = config.getStringList(CONFIG_EDITION +
- Config::dot +
- editionName +
- Config::dot +
- "modules");
- QStringList editionGroups = config.getStringList(CONFIG_EDITION +
- Config::dot +
- editionName +
- Config::dot +
- "groups");
-
- if (!editionModules.isEmpty())
- editionModuleMap[editionName] = editionModules;
- if (!editionGroups.isEmpty())
- editionGroupMap[editionName] = editionGroups;
-
- ++edition;
- }
-
- // The following line was changed to fix QTBUG-27798
- //codeIndent = config.getInt(CONFIG_CODEINDENT);
-
- /*
- The help file write should be allocated once and only once
- per qdoc execution.
- */
- if (helpProjectWriter)
- helpProjectWriter->reset(config, project.toLower() + ".qhp", this);
- else
- helpProjectWriter = new HelpProjectWriter(config, project.toLower() + ".qhp", this);
-
- // Documentation template handling
- headerScripts = config.getString(HtmlGenerator::format() + Config::dot + CONFIG_HEADERSCRIPTS);
- headerStyles = config.getString(HtmlGenerator::format() + Config::dot + CONFIG_HEADERSTYLES);
-
- QString prefix = CONFIG_QHP + Config::dot + project + Config::dot;
- manifestDir = "qthelp://" + config.getString(prefix + "namespace");
- manifestDir += QLatin1Char('/') + config.getString(prefix + "virtualFolder") + QLatin1Char('/');
- readManifestMetaContent(config);
- examplesPath = config.getString(CONFIG_EXAMPLESINSTALLPATH);
- if (!examplesPath.isEmpty())
- examplesPath += QLatin1Char('/');
-
- //retrieve the config for the navigation bar
- homepage = config.getString(CONFIG_NAVIGATION
- + Config::dot
- + CONFIG_HOMEPAGE);
-
- landingpage = config.getString(CONFIG_NAVIGATION
- + Config::dot
- + CONFIG_LANDINGPAGE);
-
- cppclassespage = config.getString(CONFIG_NAVIGATION
- + Config::dot
- + CONFIG_CPPCLASSESPAGE);
-
- qmltypespage = config.getString(CONFIG_NAVIGATION
- + Config::dot
- + CONFIG_QMLTYPESPAGE);
-
- buildversion = config.getString(CONFIG_BUILDVERSION);
-}
-
-/*!
- Gracefully terminates the HTML output generator.
- */
-void HtmlGenerator::terminateGenerator()
-{
- Generator::terminateGenerator();
-}
-
-QString HtmlGenerator::format()
-{
- return "HTML";
-}
-
-/*!
- Generate targets for any \keyword commands that were seen
- in the qdoc comment for the \a node.
- */
-void HtmlGenerator::generateKeywordAnchors(const Node* node)
-{
- if (!node->doc().isEmpty()) {
- const QList<Atom*>& keywords = node->doc().keywords();
- foreach (Atom* a, keywords) {
- out() << "<a name=\"" << Doc::canonicalTitle(a->string()) << "\"></a>";
- }
- }
-}
-
-/*!
- If qdoc is in the \c {-prepare} phase, traverse the primary
- tree to generate the index file for the current module.
-
- If qdoc is in the \c {-generate} phase, traverse the primary
- tree to generate all the HTML documentation for the current
- module. Then generate the help file and the tag file.
- */
-void HtmlGenerator::generateDocs()
-{
- Node* qflags = qdb_->findClassNode(QStringList("QFlags"));
- if (qflags)
- qflagsHref_ = linkForNode(qflags,0);
- if (!preparing())
- Generator::generateDocs();
- if (Generator::generating() && Generator::writeQaPages())
- generateQAPage();
-
- if (!generating()) {
- QString fileBase = project.toLower().simplified().replace(QLatin1Char(' '), QLatin1Char('-'));
- qdb_->generateIndex(outputDir() + QLatin1Char('/') + fileBase + ".index",
- projectUrl,
- projectDescription,
- this,
- true);
- }
-
- if (!preparing()) {
- helpProjectWriter->generate();
- generateManifestFiles();
- /*
- Generate the XML tag file, if it was requested.
- */
- qdb_->generateTagFile(tagFile_, this);
- }
-}
-
-/*!
- Output the module's Quality Assurance page.
- */
-void HtmlGenerator::generateQAPage()
-{
- NamespaceNode* node = qdb_->primaryTreeRoot();
- beginSubPage(node, "aaa-" + defaultModuleName().toLower() + "-qa-page.html");
- CodeMarker* marker = CodeMarker::markerForFileName(node->location().filePath());
- QString title = "Quality Assurance Page for " + defaultModuleName();
- QString t = "Quality assurance information for checking the " + defaultModuleName() + " documentation.";
- generateHeader(title, node, marker);
- generateTitle(title, Text() << t, LargeSubTitle, node, marker);
-
- QStringList strings;
- QVector<int> counts;
- QString depends = qdb_->getLinkCounts(strings, counts);
- if (!strings.isEmpty()) {
- t = "Intermodule Link Counts";
- QString ref = registerRef(t);
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(t) << "</h2>\n";
- out() << "<table class=\"valuelist\"><tr valign=\"top\" "
- << "class=\"even\"><th class=\"tblConst\">Destination Module</th>"
- << "<th class=\"tblval\">Link Count</th></tr>\n";
- QString fileName;
- for (int i = 0; i< strings.size(); ++i) {
- fileName = generateLinksToLinksPage(strings.at(i), marker);
- out() << "<tr><td class=\"topAlign\"><tt>"
- << "<a href=\"" << fileName << "\">"
- << strings.at(i) << "</a>"
- << "</tt></td><td class=\"topAlign\"><tt>" << counts.at(i)
- << "</tt></td></tr>\n";
- }
- int count = 0;
- fileName = generateLinksToBrokenLinksPage(marker, count);
- if (count != 0) {
- out() << "<tr><td class=\"topAlign\"><tt>"
- << "<a href=\"" << fileName << "\">"
- << "Broken Links" << "</a>"
- << "</tt></td><td class=\"topAlign\"><tt>" << count
- << "</tt></td></tr>\n";
-
- }
-
- out() << "</table>\n";
- t = "The Optimal \"depends\" Variable";
- out() << "<h2>" << protectEnc(t) << "</h2>\n";
- t = "Consider replacing the depends variable in " + defaultModuleName().toLower() +
- ".qdocconf with this one, if the two are not identical:";
- out() << "<p>" << protectEnc(t) << "</p>\n";
- out() << "<p>" << protectEnc(depends) << "</p>\n";
- }
- generateFooter();
- endSubPage();
-}
-
-/*!
- This function writes an html file containing a list of
- links to links that originate in the current module and
- go to targets in the specified \a module. The \a marker
- is used for the same thing the marker is always used for.
- */
-QString HtmlGenerator::generateLinksToLinksPage(const QString& module, CodeMarker* marker)
-{
- NamespaceNode* node = qdb_->primaryTreeRoot();
- QString fileName = "aaa-links-to-" + module + ".html";
- beginSubPage(node, fileName);
- QString title = "Links from " + defaultModuleName() + " to " + module;
- generateHeader(title, node, marker);
- generateTitle(title, Text(), SmallSubTitle, node, marker);
- out() << "<p>This is a list of links from " << defaultModuleName()
- << " to " << module << ". ";
- out() << "Click on a link to go to the location of the link. The link is marked ";
- out() << "with red asterisks. ";
- out() << "Click on the marked link to see if it goes to the right place.</p>\n";
- TargetList* tlist = qdb_->getTargetList(module);
- if (tlist) {
- out() << "<table class=\"valuelist\"><tr valign=\"top\" class=\"odd\"><th class=\"tblConst\">Link to link...</th><th class=\"tblval\">In file...</th><th class=\"tbldscr\">Somewhere after line number...</th></tr>\n";
- foreach (TargetLoc* t, *tlist) {
- // e.g.: <a name="link-8421"></a><a href="layout.html">Layout Management</a>
- out() << "<tr><td class=\"topAlign\">";
- out() << "<a href=\"" << t->fileName_ << "#" << t->target_ << "\">";
- out() << t->text_ << "</a></td>";
- out() << "<td class=\"topAlign\">";
- QString f = t->loc_->doc().location().filePath();
- out() << f << "</td>";
- out() << "<td class=\"topAlign\">";
- out() << t->loc_->doc().location().lineNo() << "</td></tr>\n";
- }
- out() << "</table>\n";
- }
- generateFooter();
- endSubPage();
- return fileName;
-}
-
-/*!
- This function writes an html file containing a list of
- links to broken links that originate in the current
- module and go nowwhere. It returns the name of the file
- it generates, and it sets \a count to the number of
- broken links that were found. The \a marker is used for
- the same thing the marker is always used for.
- */
-QString HtmlGenerator::generateLinksToBrokenLinksPage(CodeMarker* marker, int& count)
-{
- QString fileName;
- NamespaceNode* node = qdb_->primaryTreeRoot();
- TargetList* tlist = qdb_->getTargetList("broken");
- if (tlist && !tlist->isEmpty()) {
- count = tlist->size();
- fileName = "aaa-links-to-broken-links.html";
- beginSubPage(node, fileName);
- QString title = "Broken links in " + defaultModuleName();
- generateHeader(title, node, marker);
- generateTitle(title, Text(), SmallSubTitle, node, marker);
- out() << "<p>This is a list of broken links in " << defaultModuleName() << ". ";
- out() << "Click on a link to go to the broken link. ";
- out() << "The link's target could not be found.</p>\n";
- out() << "<table class=\"valuelist\"><tr valign=\"top\" class=\"odd\"><th class=\"tblConst\">Link to broken link...</th><th class=\"tblval\">In file...</th><th class=\"tbldscr\">Somewhere after line number...</th></tr>\n";
- foreach (TargetLoc* t, *tlist) {
- // e.g.: <a name="link-8421"></a><a href="layout.html">Layout Management</a>
- out() << "<tr><td class=\"topAlign\">";
- out() << "<a href=\"" << t->fileName_ << "#" << t->target_ << "\">";
- out() << t->text_ << "</a></td>";
- out() << "<td class=\"topAlign\">";
- QString f = t->loc_->doc().location().filePath();
- out() << f << "</td>";
- out() << "<td class=\"topAlign\">";
- out() << t->loc_->doc().location().lineNo() << "</td></tr>\n";
- }
- out() << "</table>\n";
- generateFooter();
- endSubPage();
- }
- return fileName;
-}
-
-/*!
- Generate html from an instance of Atom.
- */
-int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker)
-{
- int skipAhead = 0;
- static bool in_para = false;
-
- switch (atom->type()) {
- case Atom::AbstractLeft:
- if (relative)
- relative->doc().location().warning(tr("\abstract is not implemented."));
- else
- Location::information(tr("\abstract is not implemented."));
- break;
- case Atom::AbstractRight:
- break;
- case Atom::AutoLink:
- case Atom::NavAutoLink:
- if (!inLink_ && !inContents_ && !inSectionHeading_) {
- const Node *node = 0;
- QString link = getAutoLink(atom, relative, &node);
- if (link.isEmpty()) {
- if (autolinkErrors())
- relative->doc().location().warning(tr("Can't autolink to '%1'").arg(atom->string()));
- }
- else if (node && node->status() == Node::Obsolete) {
- if ((relative->parent() != node) && !relative->isObsolete())
- link.clear();
- }
- if (link.isEmpty()) {
- out() << protectEnc(atom->string());
- }
- else {
- if (Generator::writeQaPages() && node && (atom->type() != Atom::NavAutoLink)) {
- QString text = atom->string();
- QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text);
- out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
- }
- beginLink(link, node, relative);
- generateLink(atom, marker);
- endLink();
- }
- }
- else {
- out() << protectEnc(atom->string());
- }
- break;
- case Atom::BaseName:
- break;
- case Atom::BriefLeft:
- // Do not output the brief for QML nodes, doc nodes or collections
- // (groups, modules, qml module nodes)
- if (relative->isQmlType() ||
- relative->isDocumentNode() ||
- relative->isCollectionNode() ||
- relative->isJsType()) {
- skipAhead = skipAtoms(atom, Atom::BriefRight);
- break;
- }
-
- out() << "<p>";
- if (relative->type() == Node::Property ||
- relative->type() == Node::Variable) {
- QString str;
- atom = atom->next();
- while (atom != 0 && atom->type() != Atom::BriefRight) {
- if (atom->type() == Atom::String ||
- atom->type() == Atom::AutoLink)
- str += atom->string();
- skipAhead++;
- atom = atom->next();
- }
- str[0] = str[0].toLower();
- if (str.endsWith(QLatin1Char('.')))
- str.truncate(str.length() - 1);
- out() << "This ";
- if (relative->type() == Node::Property)
- out() << "property";
- else
- out() << "variable";
- QStringList words = str.split(QLatin1Char(' '));
- if (!(words.first() == "contains" || words.first() == "specifies"
- || words.first() == "describes" || words.first() == "defines"
- || words.first() == "holds" || words.first() == "determines"))
- out() << " holds ";
- else
- out() << ' ';
- out() << str << '.';
- }
- break;
- case Atom::BriefRight:
- if (!relative->isDocumentNode())
- out() << "</p>\n";
- break;
- case Atom::C:
- // This may at one time have been used to mark up C++ code but it is
- // now widely used to write teletype text. As a result, text marked
- // with the \c command is not passed to a code marker.
- out() << formattingLeftMap()[ATOM_FORMATTING_TELETYPE];
- if (inLink_) {
- out() << protectEnc(plainCode(atom->string()));
- }
- else {
- out() << protectEnc(plainCode(atom->string()));
- }
- out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE];
- break;
- case Atom::CaptionLeft:
- out() << "<p class=\"figCaption\">";
- in_para = true;
- break;
- case Atom::CaptionRight:
- endLink();
- if (in_para) {
- out() << "</p>\n";
- in_para = false;
- }
- break;
- case Atom::Code:
- out() << "<pre class=\"cpp\">"
- << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),relative))
- << "</pre>\n";
- break;
- case Atom::Qml:
- out() << "<pre class=\"qml\">"
- << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),relative))
- << "</pre>\n";
- break;
- case Atom::JavaScript:
- out() << "<pre class=\"js\">"
- << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),relative))
- << "</pre>\n";
- break;
- case Atom::CodeNew:
- out() << "<p>you can rewrite it as</p>\n"
- << "<pre class=\"cpp\">"
- << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),relative))
- << "</pre>\n";
- break;
- case Atom::CodeOld:
- out() << "<p>For example, if you have code like</p>\n";
- // fallthrough
- case Atom::CodeBad:
- out() << "<pre class=\"cpp\">"
- << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))
- << "</pre>\n";
- break;
- case Atom::DivLeft:
- out() << "<div";
- if (!atom->string().isEmpty())
- out() << ' ' << atom->string();
- out() << '>';
- break;
- case Atom::DivRight:
- out() << "</div>";
- break;
- case Atom::FootnoteLeft:
- // ### For now
- if (in_para) {
- out() << "</p>\n";
- in_para = false;
- }
- out() << "<!-- ";
- break;
- case Atom::FootnoteRight:
- // ### For now
- out() << "-->";
- break;
- case Atom::FormatElse:
- case Atom::FormatEndif:
- case Atom::FormatIf:
- break;
- case Atom::FormattingLeft:
- if (atom->string().startsWith("span ")) {
- out() << '<' + atom->string() << '>';
- }
- else
- out() << formattingLeftMap()[atom->string()];
- if (atom->string() == ATOM_FORMATTING_PARAMETER) {
- if (atom->next() != 0 && atom->next()->type() == Atom::String) {
- QRegExp subscriptRegExp("([a-z]+)_([0-9n])");
- if (subscriptRegExp.exactMatch(atom->next()->string())) {
- out() << subscriptRegExp.cap(1) << "<sub>"
- << subscriptRegExp.cap(2) << "</sub>";
- skipAhead = 1;
- }
- }
- }
- break;
- case Atom::FormattingRight:
- if (atom->string() == ATOM_FORMATTING_LINK) {
- endLink();
- }
- else if (atom->string().startsWith("span ")) {
- out() << "</span>";
- }
- else {
- out() << formattingRightMap()[atom->string()];
- }
- break;
- case Atom::AnnotatedList:
- {
- CollectionNode* cn = qdb_->getCollection(atom->string(), Node::DOC);
- if (cn)
- generateList(cn, marker, atom->string());
- }
- break;
- case Atom::GeneratedList:
- if (atom->string() == "annotatedclasses") {
- generateAnnotatedList(relative, marker, qdb_->getCppClasses());
- }
- else if (atom->string() == "classes") {
- generateCompactList(Generic, relative, qdb_->getCppClasses(), true, QStringLiteral(""));
- }
- else if (atom->string().contains("classes ")) {
- QString rootName = atom->string().mid(atom->string().indexOf("classes") + 7).trimmed();
- generateCompactList(Generic, relative, qdb_->getCppClasses(), true, rootName);
- }
- else if (atom->string() == "qmlbasictypes") {
- generateCompactList(Generic, relative, qdb_->getQmlBasicTypes(), true, QStringLiteral(""));
- }
- else if (atom->string() == "qmltypes") {
- generateCompactList(Generic, relative, qdb_->getQmlTypes(), true, QStringLiteral(""));
- }
- else if (atom->string().contains("classesbymodule")) {
- QString physicalModuleName = atom->string().mid(atom->string().indexOf("classesbymodule") + 15).trimmed();
- QDocDatabase* qdb = QDocDatabase::qdocDB();
- CollectionNode* cn = qdb->findModule(physicalModuleName);
- if (cn) {
- NodeMap m;
- cn->getMemberClasses(m);
- if (!m.isEmpty()) {
- generateAnnotatedList(relative, marker, m);
- }
- }
- }
- else if (atom->string() == "classhierarchy") {
- generateClassHierarchy(relative, qdb_->getCppClasses());
- }
- else if (atom->string() == "obsoleteclasses") {
- generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false, QStringLiteral("Q"));
- }
- else if (atom->string() == "obsoleteqmltypes") {
- generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false, QStringLiteral(""));
- }
- else if (atom->string() == "obsoletecppmembers") {
- generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false, QStringLiteral("Q"));
- }
- else if (atom->string() == "obsoleteqmlmembers") {
- generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false, QStringLiteral(""));
- }
- else if (atom->string() == "functionindex") {
- generateFunctionIndex(relative);
- }
- else if (atom->string() == "legalese") {
- generateLegaleseList(relative, marker);
- }
- else if (atom->string() == "overviews") {
- generateList(relative, marker, "overviews");
- }
- else if (atom->string() == "cpp-modules") {
- generateList(relative, marker, "cpp-modules");
- }
- else if (atom->string() == "qml-modules") {
- generateList(relative, marker, "qml-modules");
- }
- else if (atom->string() == "namespaces") {
- generateAnnotatedList(relative, marker, qdb_->getNamespaces());
- }
- else if (atom->string() == "related") {
- generateList(relative, marker, "related");
- }
-#if 0
- /*
- This is not used in Qt5, as of 10/02/2014
- Remove permanently if it is not missed.
- */
- else if (atom->string() == "relatedinline") {
- const DocumentNode *dn = static_cast<const DocumentNode *>(relative);
- if (dn && !dn->members().isEmpty()) {
- // Reverse the list into the original scan order.
- // Should be sorted. But on what? It may not be a
- // regular class or page definition.
- QList<const Node *> list;
- foreach (const Node *node, dn->members())
- list.prepend(node);
- foreach (const Node *node, list)
- generateBody(node, marker);
- }
- }
-#endif
- break;
- case Atom::SinceList:
- {
- const NodeMultiMap& nsmap = qdb_->getSinceMap(atom->string());
- const NodeMap& ncmap = qdb_->getClassMap(atom->string());
- const NodeMap& nqcmap = qdb_->getQmlTypeMap(atom->string());
-
- if (!nsmap.isEmpty()) {
- QList<Section> sections;
- QList<Section>::ConstIterator s;
-
- for (int i=0; i<LastSinceType; ++i)
- sections.append(Section(sinceTitle(i),QString(),QString(),QString()));
-
- NodeMultiMap::const_iterator n = nsmap.constBegin();
- while (n != nsmap.constEnd()) {
- Node* node = n.value();
- switch (node->type()) {
- case Node::QmlType:
- sections[QmlClass].appendMember(node);
- break;
- case Node::Namespace:
- sections[Namespace].appendMember(node);
- break;
- case Node::Class:
- sections[Class].appendMember(node);
- break;
- case Node::Enum:
- sections[Enum].appendMember(node);
- break;
- case Node::Typedef:
- sections[Typedef].appendMember(node);
- break;
- case Node::Function: {
- const FunctionNode* fn = static_cast<const FunctionNode*>(node);
- if (fn->isMacro())
- sections[Macro].appendMember(node);
- else {
- Node* p = fn->parent();
- if (p) {
- if (p->type() == Node::Class)
- sections[MemberFunction].appendMember(node);
- else if (p->type() == Node::Namespace) {
- if (p->name().isEmpty())
- sections[GlobalFunction].appendMember(node);
- else
- sections[NamespaceFunction].appendMember(node);
- }
- else
- sections[GlobalFunction].appendMember(node);
- }
- else
- sections[GlobalFunction].appendMember(node);
- }
- break;
- }
- case Node::Property:
- sections[Property].appendMember(node);
- break;
- case Node::Variable:
- sections[Variable].appendMember(node);
- break;
- case Node::QmlProperty:
- sections[QmlProperty].appendMember(node);
- break;
- case Node::QmlSignal:
- sections[QmlSignal].appendMember(node);
- break;
- case Node::QmlSignalHandler:
- sections[QmlSignalHandler].appendMember(node);
- break;
- case Node::QmlMethod:
- sections[QmlMethod].appendMember(node);
- break;
- default:
- break;
- }
- ++n;
- }
-
- out() << "<ul>\n";
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- if (!(*s).members.isEmpty()) {
-
- out() << "<li>"
- << "<a href=\"#"
- << Doc::canonicalTitle((*s).name)
- << "\">"
- << (*s).name
- << "</a></li>\n";
- }
- ++s;
- }
- out() << "</ul>\n";
-
- int idx = 0;
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- if (!(*s).members.isEmpty()) {
- out() << "<a name=\""
- << Doc::canonicalTitle((*s).name)
- << "\"></a>\n";
- out() << "<h3>" << protectEnc((*s).name) << "</h3>\n";
- if (idx == Class)
- generateCompactList(Generic, 0, ncmap, false, QStringLiteral("Q"));
- else if (idx == QmlClass)
- generateCompactList(Generic, 0, nqcmap, false, QStringLiteral(""));
- else if (idx == MemberFunction) {
- ParentMaps parentmaps;
- ParentMaps::iterator pmap;
- NodeList::const_iterator i = s->members.constBegin();
- while (i != s->members.constEnd()) {
- Node* p = (*i)->parent();
- pmap = parentmaps.find(p);
- if (pmap == parentmaps.end())
- pmap = parentmaps.insert(p,NodeMultiMap());
- pmap->insert((*i)->name(),(*i));
- ++i;
- }
- pmap = parentmaps.begin();
- while (pmap != parentmaps.end()) {
- NodeList nlist = pmap->values();
- out() << "<p>Class ";
-
- out() << "<a href=\""
- << linkForNode(pmap.key(), 0)
- << "\">";
- QStringList pieces = pmap.key()->fullName().split("::");
- out() << protectEnc(pieces.last());
- out() << "</a>" << ":</p>\n";
-
- generateSection(nlist, 0, marker, CodeMarker::Summary);
- out() << "<br/>";
- ++pmap;
- }
- }
- else
- generateSection(s->members, 0, marker, CodeMarker::Summary);
- }
- ++idx;
- ++s;
- }
- }
- }
- break;
- case Atom::BR:
- out() << "<br />\n";
- break;
- case Atom::HR:
- out() << "<hr />\n";
- break;
- case Atom::Image:
- case Atom::InlineImage:
- {
- QString fileName = imageFileName(relative, atom->string());
- QString text;
- if (atom->next() != 0)
- text = atom->next()->string();
- if (atom->type() == Atom::Image)
- out() << "<p class=\"centerAlign\">";
- if (fileName.isEmpty()) {
- relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string())));
- out() << "<font color=\"red\">[Missing image "
- << protectEnc(atom->string()) << "]</font>";
- }
- else {
- QString prefix;
- out() << "<img src=\"" << protectEnc(prefix + fileName) << '"';
- if (!text.isEmpty())
- out() << " alt=\"" << protectEnc(text) << '"';
- else
- out() << " alt=\"\"";
- out() << " />";
- helpProjectWriter->addExtraFile(fileName);
- if (relative->isExample()) {
- const ExampleNode* cen = static_cast<const ExampleNode*>(relative);
- if (cen->imageFileName().isEmpty()) {
- ExampleNode* en = const_cast<ExampleNode*>(cen);
- en->setImageFileName(fileName);
- }
- }
- }
- if (atom->type() == Atom::Image)
- out() << "</p>";
- }
- break;
- case Atom::ImageText:
- break;
- case Atom::ImportantLeft:
- out() << "<p>";
- out() << formattingLeftMap()[ATOM_FORMATTING_BOLD];
- out() << "Important: ";
- out() << formattingRightMap()[ATOM_FORMATTING_BOLD];
- break;
- case Atom::ImportantRight:
- out() << "</p>";
- break;
- case Atom::NoteLeft:
- out() << "<p>";
- out() << formattingLeftMap()[ATOM_FORMATTING_BOLD];
- out() << "Note: ";
- out() << formattingRightMap()[ATOM_FORMATTING_BOLD];
- break;
- case Atom::NoteRight:
- out() << "</p>";
- break;
- case Atom::LegaleseLeft:
- out() << "<div class=\"LegaleseLeft\">";
- break;
- case Atom::LegaleseRight:
- out() << "</div>";
- break;
- case Atom::LineBreak:
- out() << "<br/>";
- break;
- case Atom::Link:
- case Atom::NavLink:
- {
- inObsoleteLink = false;
- const Node *node = 0;
- QString link = getLink(atom, relative, &node);
- if (link.isEmpty() && (node != relative) && !noLinkErrors()) {
- relative->doc().location().warning(tr("Can't link to '%1'").arg(atom->string()));
- if (Generator::writeQaPages() && (atom->type() != Atom::NavAutoLink)) {
- QString text = atom->next()->next()->string();
- QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text, true);
- out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
- }
- }
- else {
- if (Generator::writeQaPages() && node && (atom->type() != Atom::NavLink)) {
- QString text = atom->next()->next()->string();
- QString target = qdb_->getNewLinkTarget(relative, node, outFileName(), text);
- out() << "<a id=\"" << Doc::canonicalTitle(target) << "\" class=\"qa-mark\"></a>";
- }
- /*
- mws saw this on 17/10/2014.
- Is this correct? Setting node to 0 means the
- following test always fails. Did we decide to
- no longer warn about linking to obsolete things?
- */
- node = 0;
- if (node && node->status() == Node::Obsolete) {
- if ((relative->parent() != node) && !relative->isObsolete()) {
- inObsoleteLink = true;
- if (obsoleteLinks) {
- relative->doc().location().warning(tr("Link to obsolete item '%1' in %2")
- .arg(atom->string())
- .arg(relative->plainFullName()));
- }
- }
- }
- }
- beginLink(link, node, relative);
- skipAhead = 1;
- }
- break;
- case Atom::LinkNode:
- {
- const Node *node = CodeMarker::nodeForString(atom->string());
- beginLink(linkForNode(node, relative), node, relative);
- skipAhead = 1;
- }
- break;
- case Atom::ListLeft:
- if (in_para) {
- out() << "</p>\n";
- in_para = false;
- }
- if (atom->string() == ATOM_LIST_BULLET) {
- out() << "<ul>\n";
- }
- else if (atom->string() == ATOM_LIST_TAG) {
- out() << "<dl>\n";
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- out() << "<div class=\"table\"><table class=\"valuelist\">";
- threeColumnEnumValueTable_ = isThreeColumnEnumValueTable(atom);
- if (threeColumnEnumValueTable_) {
- if (++numTableRows_ % 2 == 1)
- out() << "<tr valign=\"top\" class=\"odd\">";
- else
- out() << "<tr valign=\"top\" class=\"even\">";
-
- out() << "<th class=\"tblConst\">Constant</th>";
-
- // If not in \enum topic, skip the value column
- if (relative->type() == Node::Enum)
- out() << "<th class=\"tblval\">Value</th>";
-
- out() << "<th class=\"tbldscr\">Description</th></tr>\n";
- }
- else {
- out() << "<tr><th class=\"tblConst\">Constant</th><th class=\"tblVal\">Value</th></tr>\n";
- }
- }
- else {
- out() << "<ol class=";
- if (atom->string() == ATOM_LIST_UPPERALPHA) {
- out() << "\"A\"";
- } /* why type? changed to */
- else if (atom->string() == ATOM_LIST_LOWERALPHA) {
- out() << "\"a\"";
- }
- else if (atom->string() == ATOM_LIST_UPPERROMAN) {
- out() << "\"I\"";
- }
- else if (atom->string() == ATOM_LIST_LOWERROMAN) {
- out() << "\"i\"";
- }
- else { // (atom->string() == ATOM_LIST_NUMERIC)
- out() << "\"1\"";
- }
- if (atom->next() != 0 && atom->next()->string().toInt() != 1)
- out() << " start=\"" << atom->next()->string() << '"';
- out() << ">\n";
- }
- break;
- case Atom::ListItemNumber:
- break;
- case Atom::ListTagLeft:
- if (atom->string() == ATOM_LIST_TAG) {
- out() << "<dt>";
- }
- else { // (atom->string() == ATOM_LIST_VALUE)
- // ### Trenton
-
- QString t= protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),relative)));
- out() << "<tr><td class=\"topAlign\"><code>" << t << "</code>";
-
- if (relative->type() == Node::Enum) {
- out() << "</td><td class=\"topAlign\">";
- const EnumNode *enume = static_cast<const EnumNode *>(relative);
- QString itemValue = enume->itemValue(atom->next()->string());
-
- if (itemValue.isEmpty())
- out() << '?';
- else
- out() << "<code>" << protectEnc(itemValue) << "</code>";
- }
- skipAhead = 1;
- }
- break;
- case Atom::ListTagRight:
- if (atom->string() == ATOM_LIST_TAG)
- out() << "</dt>\n";
- break;
- case Atom::ListItemLeft:
- if (atom->string() == ATOM_LIST_TAG) {
- out() << "<dd>";
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- if (threeColumnEnumValueTable_) {
- out() << "</td><td class=\"topAlign\">";
- if (matchAhead(atom, Atom::ListItemRight))
- out() << "&nbsp;";
- }
- }
- else {
- out() << "<li>";
- }
- if (matchAhead(atom, Atom::ParaLeft))
- skipAhead = 1;
- break;
- case Atom::ListItemRight:
- if (atom->string() == ATOM_LIST_TAG) {
- out() << "</dd>\n";
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- out() << "</td></tr>\n";
- }
- else {
- out() << "</li>\n";
- }
- break;
- case Atom::ListRight:
- if (atom->string() == ATOM_LIST_BULLET) {
- out() << "</ul>\n";
- }
- else if (atom->string() == ATOM_LIST_TAG) {
- out() << "</dl>\n";
- }
- else if (atom->string() == ATOM_LIST_VALUE) {
- out() << "</table></div>\n";
- }
- else {
- out() << "</ol>\n";
- }
- break;
- case Atom::Nop:
- break;
- case Atom::ParaLeft:
- out() << "<p>";
- in_para = true;
- break;
- case Atom::ParaRight:
- endLink();
- if (in_para) {
- out() << "</p>\n";
- in_para = false;
- }
- //if (!matchAhead(atom, Atom::ListItemRight) && !matchAhead(atom, Atom::TableItemRight))
- // out() << "</p>\n";
- break;
- case Atom::QuotationLeft:
- out() << "<blockquote>";
- break;
- case Atom::QuotationRight:
- out() << "</blockquote>\n";
- break;
- case Atom::RawString:
- out() << atom->string();
- break;
- case Atom::SectionLeft:
- out() << "<a name=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString())
- << "\"></a>" << divNavTop << '\n';
- break;
- case Atom::SectionRight:
- break;
- case Atom::SectionHeadingLeft: {
- int unit = atom->string().toInt() + hOffset(relative);
- out() << "<h" + QString::number(unit) + QLatin1Char(' ');
- if (unit < 3) {
- out() << "id=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString()) << "\"";
- }
- out() << ">";
- inSectionHeading_ = true;
- break;
- }
- case Atom::SectionHeadingRight:
- out() << "</h" + QString::number(atom->string().toInt() + hOffset(relative)) + ">\n";
- inSectionHeading_ = false;
- break;
- case Atom::SidebarLeft:
- break;
- case Atom::SidebarRight:
- break;
- case Atom::String:
- if (inLink_ && !inContents_ && !inSectionHeading_) {
- generateLink(atom, marker);
- }
- else {
- out() << protectEnc(atom->string());
- }
- break;
- case Atom::TableLeft:
- {
- QString p1, p2;
- QString attr = "generic";
- QString width;
- if (in_para) {
- out() << "</p>\n";
- in_para = false;
- }
- if (atom->count() > 0) {
- p1 = atom->string(0);
- if (atom->count() > 1)
- p2 = atom->string(1);
- }
- if (!p1.isEmpty()) {
- if (p1 == "borderless")
- attr = p1;
- else if (p1.contains("%"))
- width = p1;
- }
- if (!p2.isEmpty()) {
- if (p2 == "borderless")
- attr = p2;
- else if (p2.contains("%"))
- width = p2;
- }
- out() << "<div class=\"table\"><table class=\"" << attr << "\"";
- if (!width.isEmpty())
- out() << " width=\"" << width << "\"";
- out() << ">\n ";
- numTableRows_ = 0;
- }
- break;
- case Atom::TableRight:
- out() << "</table></div>\n";
- break;
- case Atom::TableHeaderLeft:
- out() << "<thead><tr class=\"qt-style\">";
- inTableHeader_ = true;
- break;
- case Atom::TableHeaderRight:
- out() << "</tr>";
- if (matchAhead(atom, Atom::TableHeaderLeft)) {
- skipAhead = 1;
- out() << "\n<tr class=\"qt-style\">";
- }
- else {
- out() << "</thead>\n";
- inTableHeader_ = false;
- }
- break;
- case Atom::TableRowLeft:
- if (!atom->string().isEmpty())
- out() << "<tr " << atom->string() << '>';
- else if (++numTableRows_ % 2 == 1)
- out() << "<tr valign=\"top\" class=\"odd\">";
- else
- out() << "<tr valign=\"top\" class=\"even\">";
- break;
- case Atom::TableRowRight:
- out() << "</tr>\n";
- break;
- case Atom::TableItemLeft:
- {
- if (inTableHeader_)
- out() << "<th ";
- else
- out() << "<td ";
-
- for (int i=0; i<atom->count(); ++i) {
- if (i > 0)
- out() << ' ';
- QString p = atom->string(i);
- if (p.contains('=')) {
- out() << p;
- }
- else {
- QStringList spans = p.split(",");
- if (spans.size() == 2) {
- if (spans.at(0) != "1")
- out() << " colspan=\"" << spans.at(0) << '"';
- if (spans.at(1) != "1")
- out() << " rowspan=\"" << spans.at(1) << '"';
- }
- }
- }
- if (inTableHeader_)
- out() << '>';
- else {
- out() << '>';
- //out() << "><p>";
- }
- if (matchAhead(atom, Atom::ParaLeft))
- skipAhead = 1;
- }
- break;
- case Atom::TableItemRight:
- if (inTableHeader_)
- out() << "</th>";
- else {
- out() << "</td>";
- //out() << "</p></td>";
- }
- if (matchAhead(atom, Atom::ParaLeft))
- skipAhead = 1;
- break;
- case Atom::TableOfContents:
- break;
- case Atom::Keyword:
- break;
- case Atom::Target:
- out() << "<a name=\"" << Doc::canonicalTitle(atom->string()) << "\"></a>";
- break;
- case Atom::UnhandledFormat:
- out() << "<b class=\"redFont\">&lt;Missing HTML&gt;</b>";
- break;
- case Atom::UnknownCommand:
- out() << "<b class=\"redFont\"><code>\\" << protectEnc(atom->string())
- << "</code></b>";
- break;
- case Atom::QmlText:
- case Atom::EndQmlText:
- // don't do anything with these. They are just tags.
- break;
- default:
- unknownAtom(atom);
- }
- return skipAhead;
-}
-
-/*!
- Generate a reference page for a C++ class or a C++ namespace.
- */
-void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
-{
- QList<Section> sections;
- QList<Section>::ConstIterator s;
-
- QString title;
- QString rawTitle;
- QString fullTitle;
- if (inner->type() == Node::Namespace) {
- rawTitle = inner->plainName();
- fullTitle = inner->plainFullName();
- title = rawTitle + " Namespace";
- }
- else if (inner->type() == Node::Class) {
- rawTitle = inner->plainName();
- fullTitle = inner->plainFullName();
- title = rawTitle + " Class";
- }
-
- Text subtitleText;
- if (rawTitle != fullTitle)
- subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")" << Atom(Atom::LineBreak);
-
- generateHeader(title, inner, marker);
-
- sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
- generateTableOfContents(inner,marker,&sections);
- generateKeywordAnchors(inner);
- generateTitle(title, subtitleText, SmallSubTitle, inner, marker);
- generateBrief(inner, marker);
- generateRequisites(inner, marker);
- generateStatus(inner, marker);
- generateThreadSafeness(inner, marker);
-
- out() << "<ul>\n";
-
- QString membersLink = generateListOfAllMemberFile(inner, marker);
- if (!membersLink.isEmpty())
- out() << "<li><a href=\"" << membersLink << "\">"
- << "List of all members, including inherited members</a></li>\n";
-
- QString obsoleteLink = generateLowStatusMemberFile(inner,
- marker,
- CodeMarker::Obsolete);
- if (!obsoleteLink.isEmpty()) {
- out() << "<li><a href=\"" << obsoleteLink << "\">"
- << "Obsolete members</a></li>\n";
- }
-
- QString compatLink = generateLowStatusMemberFile(inner,
- marker,
- CodeMarker::Compat);
- if (!compatLink.isEmpty())
- out() << "<li><a href=\"" << compatLink << "\">"
- << "Compatibility members</a></li>\n";
-
- out() << "</ul>\n";
-
- bool needOtherSection = false;
-
- /*
- sections is built above for the call to generateTableOfContents().
- */
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- if (s->members.isEmpty() && s->reimpMembers.isEmpty()) {
- if (!s->inherited.isEmpty())
- needOtherSection = true;
- }
- else {
- if (!s->members.isEmpty()) {
- // out() << "<hr />\n";
- QString ref = registerRef((*s).name.toLower());
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << "\n";
- out() << "<h2 id=\"" << ref << "\">" << protectEnc((*s).name) << "</h2>\n";
- generateSection(s->members, inner, marker, CodeMarker::Summary);
- }
- if (!s->reimpMembers.isEmpty()) {
- QString name = QString("Reimplemented ") + (*s).name;
- QString ref = registerRef(name.toLower());
- // out() << "<hr />\n";
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << "\n";
- out() << "<h2 id=\"" << ref << "\">" << protectEnc(name) << "</h2>\n";
- generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
- }
-
- if (!s->inherited.isEmpty()) {
- out() << "<ul>\n";
- generateSectionInheritedList(*s, inner);
- out() << "</ul>\n";
- }
- }
- ++s;
- }
-
- if (needOtherSection) {
- out() << "<h3>Additional Inherited Members</h3>\n"
- "<ul>\n";
-
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- if (s->members.isEmpty() && !s->inherited.isEmpty())
- generateSectionInheritedList(*s, inner);
- ++s;
- }
- out() << "</ul>\n";
- }
-
- QString detailsRef = registerRef("details");
- out() << "<a name=\"" << detailsRef << "\"></a>" << divNavTop << '\n';
-
- if (!inner->doc().isEmpty()) {
- generateExtractionMark(inner, DetailedDescriptionMark);
- //out() << "<hr />\n"
- out() << "<div class=\"descr\">\n" // QTBUG-9504
- << "<h2 id=\"" << detailsRef << "\">" << "Detailed Description" << "</h2>\n";
- generateBody(inner, marker);
- out() << "</div>\n"; // QTBUG-9504
- generateAlsoList(inner, marker);
- generateMaintainerList(inner, marker);
- generateExtractionMark(inner, EndMark);
- }
-
- sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- //out() << "<hr />\n";
- if (!(*s).divClass.isEmpty())
- out() << "<div class=\"" << (*s).divClass << "\">\n"; // QTBUG-9504
- out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
-
- NodeList::ConstIterator m = (*s).members.constBegin();
- while (m != (*s).members.constEnd()) {
- if ((*m)->access() != Node::Private) { // ### check necessary?
- if ((*m)->type() != Node::Class)
- generateDetailedMember(*m, inner, marker);
- else {
- out() << "<h3> class ";
- generateFullName(*m, inner);
- out() << "</h3>";
- generateBrief(*m, marker, inner);
- }
-
- QStringList names;
- names << (*m)->name();
- if ((*m)->type() == Node::Function) {
- const FunctionNode *func = reinterpret_cast<const FunctionNode *>(*m);
- if (func->metaness() == FunctionNode::Ctor ||
- func->metaness() == FunctionNode::Dtor ||
- func->overloadNumber() != 1)
- names.clear();
- }
- else if ((*m)->type() == Node::Property) {
- const PropertyNode *prop = reinterpret_cast<const PropertyNode *>(*m);
- if (!prop->getters().isEmpty() &&
- !names.contains(prop->getters().first()->name()))
- names << prop->getters().first()->name();
- if (!prop->setters().isEmpty())
- names << prop->setters().first()->name();
- if (!prop->resetters().isEmpty())
- names << prop->resetters().first()->name();
- if (!prop->notifiers().isEmpty())
- names << prop->notifiers().first()->name();
- }
- else if ((*m)->type() == Node::Enum) {
- const EnumNode *enume = reinterpret_cast<const EnumNode*>(*m);
- if (enume->flagsType())
- names << enume->flagsType()->name();
-
- foreach (const QString &enumName,
- enume->doc().enumItemNames().toSet() -
- enume->doc().omitEnumItemNames().toSet())
- names << plainCode(marker->markedUpEnumValue(enumName,
- enume));
- }
- }
- ++m;
- }
- if (!(*s).divClass.isEmpty())
- out() << "</div>\n"; // QTBUG-9504
- ++s;
- }
- generateFooter(inner);
-}
-
-/*!
- Generate the HTML page for a QML type. \qcn is the QML type.
- \marker is the code markeup object.
- */
-void HtmlGenerator::generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker)
-{
- Generator::setQmlTypeContext(qcn);
- SubTitleSize subTitleSize = LargeSubTitle;
- QList<Section>::const_iterator s;
- QString htmlTitle = qcn->fullTitle();
- if (qcn->isJsType())
- htmlTitle += " JavaScript Type";
- else
- htmlTitle += " QML Type";
-
- generateHeader(htmlTitle, qcn, marker);
- QList<Section> sections = marker->qmlSections(qcn, CodeMarker::Summary);
- generateTableOfContents(qcn, marker, &sections);
- marker = CodeMarker::markerForLanguage(QLatin1String("QML"));
- generateKeywordAnchors(qcn);
- generateTitle(htmlTitle, Text() << qcn->subTitle(), subTitleSize, qcn, marker);
- generateBrief(qcn, marker);
- generateQmlRequisites(qcn, marker);
-
- QString allQmlMembersLink = generateAllQmlMembersFile(qcn, marker);
- QString obsoleteLink = generateQmlMemberFile(qcn, marker, CodeMarker::Obsolete);
- if (!allQmlMembersLink.isEmpty() || !obsoleteLink.isEmpty()) {
- out() << "<ul>\n";
- if (!allQmlMembersLink.isEmpty()) {
- out() << "<li><a href=\"" << allQmlMembersLink << "\">"
- << "List of all members, including inherited members</a></li>\n";
- }
- if (!obsoleteLink.isEmpty()) {
- out() << "<li><a href=\"" << obsoleteLink << "\">"
- << "Obsolete members</a></li>\n";
- }
- out() << "</ul>\n";
- }
-
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- QString ref = registerRef((*s).name.toLower());
- out() << "<a name=\"" << ref
- << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc((*s).name) << "</h2>\n";
- generateQmlSummary(*s, qcn, marker);
- ++s;
- }
-
- generateExtractionMark(qcn, DetailedDescriptionMark);
- QString detailsRef = registerRef("details");
- out() << "<a name=\"" << detailsRef << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << detailsRef << "\">" << "Detailed Description" << "</h2>\n";
- generateBody(qcn, marker);
- ClassNode* cn = qcn->classNode();
- if (cn)
- generateQmlText(cn->doc().body(), cn, marker, qcn->name());
- generateAlsoList(qcn, marker);
- generateExtractionMark(qcn, EndMark);
- //out() << "<hr />\n";
-
- sections = marker->qmlSections(qcn,CodeMarker::Detailed);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
- NodeList::ConstIterator m = (*s).members.constBegin();
- while (m != (*s).members.constEnd()) {
- generateDetailedQmlMember(*m, qcn, marker);
- out() << "<br/>\n";
- ++m;
- }
- ++s;
- }
- generateFooter(qcn);
- Generator::setQmlTypeContext(0);
-}
-
-/*!
- Generate the HTML page for the QML basic type represented
- by the QML basic type node \a qbtn.
- */
-void HtmlGenerator::generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker)
-{
- SubTitleSize subTitleSize = LargeSubTitle;
- QList<Section>::const_iterator s;
- QString htmlTitle = qbtn->fullTitle();
- if (qbtn->isJsType())
- htmlTitle += " JavaScript Basic Type";
- else
- htmlTitle += " QML Basic Type";
-
- marker = CodeMarker::markerForLanguage(QLatin1String("QML"));
-
- generateHeader(htmlTitle, qbtn, marker);
- QList<Section> sections = marker->sections(qbtn, CodeMarker::Summary, CodeMarker::Okay);
- generateTableOfContents(qbtn,marker,&sections);
- generateKeywordAnchors(qbtn);
- generateTitle(htmlTitle,
- Text() << qbtn->subTitle(),
- subTitleSize,
- qbtn,
- marker);
- generateExtractionMark(qbtn, DetailedDescriptionMark);
- out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504
-
- generateBody(qbtn, marker);
- out() << "</div>\n"; // QTBUG-9504
- generateAlsoList(qbtn, marker);
- generateExtractionMark(qbtn, EndMark);
- generateFooter(qbtn);
-}
-
-/*!
- Generate the HTML page for an entity that doesn't map
- to any underlying parsable C++ class or QML component.
- */
-void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
-{
- /*
- If the document node is a page node, and if the page type
- is DITA map page, write the node's contents as a dita
- map and return without doing anything else.
- */
- if (dn->subType() == Node::Page && dn->pageType() == Node::DitaMapPage) {
- const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn);
- writeDitaMap(dmn);
- return;
- }
-
- SubTitleSize subTitleSize = LargeSubTitle;
- QList<Section> sections;
- QList<Section>::const_iterator s;
- QString fullTitle = dn->fullTitle();
-
- generateHeader(fullTitle, dn, marker);
- /*
- Generate the TOC for the new doc format.
- Don't generate a TOC for the home page.
- */
- if ((dn->name() != QStringLiteral("index.html")))
- generateTableOfContents(dn,marker,0);
-
- generateKeywordAnchors(dn);
- generateTitle(fullTitle,
- Text() << dn->subTitle(),
- subTitleSize,
- dn,
- marker);
-
- if (dn->subType() == Node::HeaderFile) {
- // Generate brief text and status for modules.
- generateBrief(dn, marker);
- generateStatus(dn, marker);
- generateSince(dn, marker);
-
- out() << "<ul>\n";
-
- QString membersLink = generateListOfAllMemberFile(dn, marker);
- if (!membersLink.isEmpty())
- out() << "<li><a href=\"" << membersLink << "\">"
- << "List of all members, including inherited members</a></li>\n";
-
- QString obsoleteLink = generateLowStatusMemberFile(dn,
- marker,
- CodeMarker::Obsolete);
- if (!obsoleteLink.isEmpty()) {
- out() << "<li><a href=\"" << obsoleteLink << "\">"
- << "Obsolete members</a></li>\n";
- }
-
- QString compatLink = generateLowStatusMemberFile(dn,
- marker,
- CodeMarker::Compat);
- if (!compatLink.isEmpty())
- out() << "<li><a href=\"" << compatLink << "\">"
- << "Compatibility members</a></li>\n";
-
- out() << "</ul>\n";
- }
-
- sections = marker->sections(dn, CodeMarker::Summary, CodeMarker::Okay);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- QString ref = registerRef((*s).name);
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc((*s).name) << "</h2>\n";
- generateSectionList(*s, dn, marker, CodeMarker::Summary);
- ++s;
- }
-
- generateExtractionMark(dn, DetailedDescriptionMark);
- out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504
-
- generateBody(dn, marker);
- out() << "</div>\n"; // QTBUG-9504
- generateAlsoList(dn, marker);
- generateExtractionMark(dn, EndMark);
-
- sections = marker->sections(dn, CodeMarker::Detailed, CodeMarker::Okay);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- //out() << "<hr />\n";
- out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
-
- NodeList::ConstIterator m = (*s).members.constBegin();
- while (m != (*s).members.constEnd()) {
- generateDetailedMember(*m, dn, marker);
- ++m;
- }
- ++s;
- }
- generateFooter(dn);
-}
-
-/*!
- Generate the HTML page for a group, module, or QML module.
- */
-void HtmlGenerator::generateCollectionNode(CollectionNode* cn, CodeMarker* marker)
-{
- SubTitleSize subTitleSize = LargeSubTitle;
- QList<Section> sections;
- QList<Section>::const_iterator s;
- QString fullTitle = cn->fullTitle();
- QString ref;
-
- generateHeader(fullTitle, cn, marker);
- generateTableOfContents(cn,marker,0);
- generateKeywordAnchors(cn);
- generateTitle(fullTitle, Text() << cn->subTitle(), subTitleSize, cn, marker);
-
- if (cn->isModule()) {
- // Generate brief text and status for modules.
- generateBrief(cn, marker);
- generateStatus(cn, marker);
- generateSince(cn, marker);
-
- NodeMultiMap nmm;
- cn->getMemberNamespaces(nmm);
- if (!nmm.isEmpty()) {
- ref = registerRef("namespaces");
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">Namespaces</h2>\n";
- generateAnnotatedList(cn, marker, nmm);
- }
- nmm.clear();
- cn->getMemberClasses(nmm);
- if (!nmm.isEmpty()) {
- ref = registerRef("classes");
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">Classes</h2>\n";
- generateAnnotatedList(cn, marker, nmm);
- }
- nmm.clear();
- }
-
- sections = marker->sections(cn, CodeMarker::Summary, CodeMarker::Okay);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- ref = registerRef((*s).name);
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc((*s).name) << "</h2>\n";
- generateSectionList(*s, cn, marker, CodeMarker::Summary);
- ++s;
- }
-
- Text brief = cn->doc().briefText();
- if (cn->isModule() && !brief.isEmpty()) {
- generateExtractionMark(cn, DetailedDescriptionMark);
- ref = registerRef("details");
- out() << "<a name=\"" << ref << "\"></a>" << divNavTop << '\n';
- out() << "<div class=\"descr\">\n"; // QTBUG-9504
- out() << "<h2 id=\"" << ref << "\">" << "Detailed Description" << "</h2>\n";
- }
- else {
- generateExtractionMark(cn, DetailedDescriptionMark);
- out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504
- }
-
- generateBody(cn, marker);
- out() << "</div>\n"; // QTBUG-9504
- generateAlsoList(cn, marker);
- generateExtractionMark(cn, EndMark);
-
- if (cn->isGroup())
- generateAnnotatedList(cn, marker, cn->members());
- else if (cn->isQmlModule() || cn->isJsModule())
- generateAnnotatedList(cn, marker, cn->members());
-
- sections = marker->sections(cn, CodeMarker::Detailed, CodeMarker::Okay);
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- //out() << "<hr />\n";
- out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
-
- NodeList::ConstIterator m = (*s).members.constBegin();
- while (m != (*s).members.constEnd()) {
- generateDetailedMember(*m, cn, marker);
- ++m;
- }
- ++s;
- }
- generateFooter(cn);
-}
-
-/*!
- Returns "html" for this subclass of Generator.
- */
-QString HtmlGenerator::fileExtension() const
-{
- return "html";
-}
-
-/*!
- Output navigation list in the html file.
- */
-void HtmlGenerator::generateNavigationBar(const QString &title,
- const Node *node,
- CodeMarker *marker)
-{
- if (noNavigationBar)
- return;
-
- Text navigationbar;
-
- if (homepage == title)
- return;
- if (!homepage.isEmpty())
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::NavAutoLink, homepage)
- << Atom(Atom::ListItemRight);
- if (!landingpage.isEmpty() && landingpage != title)
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::NavAutoLink, landingpage)
- << Atom(Atom::ListItemRight);
-
- if (node->isClass()) {
- const ClassNode *cn = static_cast<const ClassNode *>(node);
- QString name = node->physicalModuleName();
-
- if (!cppclassespage.isEmpty())
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::NavLink, cppclassespage)
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, QLatin1String("C++ Classes"))
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
- << Atom(Atom::ListItemRight);
-
- if (!cn->name().isEmpty())
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::String, cn->name())
- << Atom(Atom::ListItemRight);
- }
- else if (node->isQmlType() || node->isQmlBasicType() ||
- node->isJsType() || node->isJsBasicType()) {
- if (!qmltypespage.isEmpty())
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::NavLink, qmltypespage)
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, QLatin1String("QML Types"))
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
- << Atom(Atom::ListItemRight)
- << Atom(Atom::ListItemLeft)
- << Atom(Atom::String, title)
- << Atom(Atom::ListItemRight);
- }
- else {
- if (node->isExampleFile()) {
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::NavLink, node->parent()->name())
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, node->parent()->title())
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
- << Atom(Atom::ListItemRight);
-
- }
- navigationbar << Atom(Atom::ListItemLeft)
- << Atom(Atom::String, title)
- << Atom(Atom::ListItemRight);
- }
-
- generateText(navigationbar, node, marker);
-}
-
-void HtmlGenerator::generateHeader(const QString& title,
- const Node *node,
- CodeMarker *marker)
-{
-#ifndef QT_NO_TEXTCODEC
- out() << QString("<?xml version=\"1.0\" encoding=\"%1\"?>\n").arg(outputEncoding);
-#else
- out() << QString("<?xml version=\"1.0\"?>\n");
-#endif
- out() << "<!DOCTYPE html>\n";
- out() << QString("<html lang=\"%1\">\n").arg(naturalLanguage);
- out() << "<head>\n";
- out() << " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
- if (node && !node->doc().location().isEmpty())
- out() << "<!-- " << node->doc().location().fileName() << " -->\n";
-
- QString shortVersion = qdb_->version();
- if (shortVersion.count(QChar('.')) == 2)
- shortVersion.truncate(shortVersion.lastIndexOf(QChar('.')));
-
- //determine the rest of the <title> element content: "title | titleSuffix version"
- QString titleSuffix;
- if (!landingpage.isEmpty()) {
- //for normal pages: "title | landingpage version"
- titleSuffix = landingpage;
- }
- else if (!homepage.isEmpty()) {
- //for pages that set the homepage but not landing page: "title | homepage version"
- if (title != homepage)
- titleSuffix = homepage;
- }
- else if (!project.isEmpty()) {
- //for projects outside of Qt or Qt 5: "title | project version"
- if (title != project)
- titleSuffix = project;
- }
- else
- //default: "title | Qt version"
- titleSuffix = QLatin1String("Qt ");
-
- //for pages that duplicate the title and suffix (landing pages, home pages,
- // and module landing pages, clear the duplicate
- if (title == titleSuffix)
- titleSuffix.clear();
-
- //for pages that duplicate the version, clear the duplicate
- if (title.contains(shortVersion) || titleSuffix.contains(shortVersion))
- shortVersion.clear();
-
- QString divider;
- if (!titleSuffix.isEmpty() && !title.isEmpty())
- divider = QLatin1String(" | ");
-
- // Generating page title
- out() << " <title>"
- << protectEnc(title)
- << divider
- << titleSuffix
- << QLatin1Char(' ')
- << shortVersion
- << "</title>\n";
-
- // Include style sheet and script links.
- out() << headerStyles;
- out() << headerScripts;
- if (endHeader.isEmpty())
- out() << "</head>\n<body>\n";
- else
- out() << endHeader;
-
-#ifdef GENERATE_MAC_REFS
- if (mainPage)
- generateMacRef(node, marker);
-#endif
-
- out() << QString(postHeader).replace("\\" + COMMAND_VERSION, qdb_->version());
- generateNavigationBar(title,node,marker);
- if (!buildversion.isEmpty())
- out() << "<li id=\"buildversion\">" << buildversion << "</li>\n";
- out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, qdb_->version());
-
- navigationLinks.clear();
- refMap.clear();
-
- if (node && !node->links().empty()) {
- QPair<QString,QString> linkPair;
- QPair<QString,QString> anchorPair;
- const Node *linkNode;
-
- if (node->links().contains(Node::PreviousLink)) {
- linkPair = node->links()[Node::PreviousLink];
- linkNode = qdb_->findNodeForTarget(linkPair.first, node);
- if (!linkNode)
- node->doc().location().warning(tr("Cannot link to '%1'").arg(linkPair.first));
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
-
- out() << " <link rel=\"prev\" href=\""
- << anchorPair.first << "\" />\n";
-
- navigationLinks += "<a class=\"prevPage\" href=\"" + anchorPair.first + "\">";
- if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
- navigationLinks += protect(anchorPair.second);
- else
- navigationLinks += protect(linkPair.second);
- navigationLinks += "</a>\n";
- }
- if (node->links().contains(Node::NextLink)) {
- linkPair = node->links()[Node::NextLink];
- linkNode = qdb_->findNodeForTarget(linkPair.first, node);
- if (!linkNode)
- node->doc().location().warning(tr("Cannot link to '%1'").arg(linkPair.first));
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
-
- out() << " <link rel=\"next\" href=\""
- << anchorPair.first << "\" />\n";
-
- navigationLinks += "<a class=\"nextPage\" href=\"" + anchorPair.first + "\">";
- if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
- navigationLinks += protect(anchorPair.second);
- else
- navigationLinks += protect(linkPair.second);
- navigationLinks += "</a>\n";
- }
- if (node->links().contains(Node::StartLink)) {
- linkPair = node->links()[Node::StartLink];
- linkNode = qdb_->findNodeForTarget(linkPair.first, node);
- if (!linkNode)
- node->doc().location().warning(tr("Cannot link to '%1'").arg(linkPair.first));
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
- out() << " <link rel=\"start\" href=\""
- << anchorPair.first << "\" />\n";
- }
- }
-
- if (node && !node->links().empty())
- out() << "<p class=\"naviNextPrevious headerNavi\">\n" << navigationLinks << "</p><p/>\n";
-}
-
-void HtmlGenerator::generateTitle(const QString& title,
- const Text &subTitle,
- SubTitleSize subTitleSize,
- const Node *relative,
- CodeMarker *marker)
-{
- out() << QString(prologue).replace("\\" + COMMAND_VERSION, qdb_->version());
- if (!title.isEmpty())
- out() << "<h1 class=\"title\">" << protectEnc(title) << "</h1>\n";
- if (!subTitle.isEmpty()) {
- out() << "<span";
- if (subTitleSize == SmallSubTitle)
- out() << " class=\"small-subtitle\">";
- else
- out() << " class=\"subtitle\">";
- generateText(subTitle, relative, marker);
- out() << "</span>\n";
- }
-}
-
-void HtmlGenerator::generateFooter(const Node *node)
-{
- if (node && !node->links().empty())
- out() << "<p class=\"naviNextPrevious footerNavi\">\n" << navigationLinks << "</p>\n";
-
- out() << QString(footer).replace("\\" + COMMAND_VERSION, qdb_->version())
- << QString(address).replace("\\" + COMMAND_VERSION, qdb_->version());
-
- out() << "</body>\n";
- out() << "</html>\n";
-}
-
-/*!
-Lists the required imports and includes in a table.
-The number of rows is known, so this path is simpler than the generateSection() path.
-*/
-void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
-{
- QMap<QString, Text> requisites;
- Text text;
-
- const QString headerText = "Header";
- const QString sinceText = "Since";
- const QString inheritedBytext = "Inherited By";
- const QString inheritsText = "Inherits";
- const QString instantiatedByText = "Instantiated By";
- const QString qtVariableText = "qmake";
-
- //add the includes to the map
- if (!inner->includes().isEmpty()) {
- text.clear();
- text << highlightedCode(indent(codeIndent,
- marker->markedUpIncludes(inner->includes())),
- inner);
- requisites.insert(headerText, text);
- }
-
- //The order of the requisites matter
- QStringList requisiteorder;
- requisiteorder << headerText
- << qtVariableText
- << sinceText
- << instantiatedByText
- << inheritsText
- << inheritedBytext;
-
- //add the since and project into the map
- if (!inner->since().isEmpty()) {
- text.clear();
- QStringList since = inner->since().split(QLatin1Char(' '));
- if (since.count() == 1) {
- // If there is only one argument, assume it is the Qt version number.
- text << " Qt " << since[0];
- }
- else {
- //Otherwise, reconstruct the <project> <version> string.
- text << " " << since.join(' ');
- }
- text << Atom::ParaRight;
- requisites.insert(sinceText, text);
- }
-
- if (inner->type() == Node::Class || inner->type() == Node::Namespace) {
- //add the QT variable to the map
- if (!inner->physicalModuleName().isEmpty()) {
- CollectionNode* cn = qdb_->findModule(inner->physicalModuleName());
- if (cn && !cn->qtVariable().isEmpty()) {
- text.clear();
- text << "QT += " + cn->qtVariable();
- requisites.insert(qtVariableText, text);
- }
- }
- }
-
- if (inner->type() == Node::Class) {
- ClassNode* classe = static_cast<ClassNode*>(inner);
- if (classe->qmlElement() != 0 && classe->status() != Node::Internal) {
- text.clear();
- text << Atom(Atom::LinkNode, CodeMarker::stringForNode(classe->qmlElement()))
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, classe->qmlElement()->name())
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- requisites.insert(instantiatedByText, text);
-
- }
-
- //add the inherits to the map
- QList<RelatedClass>::ConstIterator r;
- int index;
- if (!classe->baseClasses().isEmpty()) {
- text.clear();
- r = classe->baseClasses().constBegin();
- index = 0;
- while (r != classe->baseClasses().constEnd()) {
- if ((*r).node_) {
- text << Atom(Atom::LinkNode, CodeMarker::stringForNode((*r).node_))
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, (*r).signature_)
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-
- if ((*r).access_ == Node::Protected) {
- text << " (protected)";
- }
- else if ((*r).access_ == Node::Private) {
- text << " (private)";
- }
- text << comma(index++, classe->baseClasses().count());
- }
- ++r;
- }
- text << Atom::ParaRight;
- requisites.insert(inheritsText, text);
- }
-
- //add the inherited-by to the map
- if (!classe->derivedClasses().isEmpty()) {
- text.clear();
- text << Atom::ParaLeft;
- appendSortedNames(text, classe, classe->derivedClasses());
- text << Atom::ParaRight;
- requisites.insert(inheritedBytext, text);
- }
- }
-
- if (!requisites.isEmpty()) {
- //generate the table
- out() << "<div class=\"table\"><table class=\"alignedsummary\">\n";
-
- QStringList::ConstIterator i;
- for (i = requisiteorder.constBegin(); i != requisiteorder.constEnd(); ++i) {
-
- if (requisites.contains(*i)) {
- out() << "<tr>"
- << "<td class=\"memItemLeft rightAlign topAlign\"> "
- << *i << ":"
- << "</td><td class=\"memItemRight bottomAlign\"> ";
-
- if (*i == headerText)
- out() << requisites.value(*i).toString();
- else
- generateText(requisites.value(*i), inner, marker);
- out() << "</td></tr>";
- }
- }
- out() << "</table></div>";
- }
-}
-
-/*!
-Lists the required imports and includes in a table.
-The number of rows is known, so this path is simpler than the generateSection() path.
-*/
-void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker)
-{
- if (!qcn)
- return;
- QMap<QString, Text> requisites;
- Text text;
-
- const QString importText = "Import Statement:";
- const QString sinceText = "Since:";
- const QString inheritedBytext = "Inherited By:";
- const QString inheritsText = "Inherits:";
- const QString instantiatesText = "Instantiates:";
-
- //The order of the requisites matter
- QStringList requisiteorder;
- requisiteorder << importText
- << sinceText
- << instantiatesText
- << inheritsText
- << inheritedBytext;
-
- //add the module name and version to the map
- QString logicalModuleVersion;
- CollectionNode* collection = 0;
- if (qcn->isJsNode())
- collection = qdb_->findJsModule(qcn->logicalModuleName());
- else
- collection = qdb_->findQmlModule(qcn->logicalModuleName());
- if (collection)
- logicalModuleVersion = collection->logicalModuleVersion();
- else
- logicalModuleVersion = qcn->logicalModuleVersion();
- text.clear();
- text << "import " + qcn->logicalModuleName() + " " + logicalModuleVersion;
- requisites.insert(importText, text);
-
- //add the since and project into the map
- if (!qcn->since().isEmpty()) {
- text.clear();
- QStringList since = qcn->since().split(QLatin1Char(' '));
- if (since.count() == 1) {
- // If there is only one argument, assume it is the Qt version number.
- text << " Qt " << since[0];
- }
- else {
- //Otherwise, reconstruct the <project> <version> string.
- text << " " << since.join(' ');
- }
- text << Atom::ParaRight;
- requisites.insert(sinceText, text);
- }
-
- //add the instantiates to the map
- ClassNode* cn = qcn->classNode();
- if (cn && (cn->status() != Node::Internal)) {
- text.clear();
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, cn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- requisites.insert(instantiatesText, text);
- }
-
- //add the inherits to the map
- QmlTypeNode* base = qcn->qmlBaseNode();
- while (base && base->isInternal()) {
- base = base->qmlBaseNode();
- }
- if (base) {
- text.clear();
- text << Atom::ParaLeft
- << Atom(Atom::LinkNode,CodeMarker::stringForNode(base))
- << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
- << Atom(Atom::String, base->name())
- << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK)
- << Atom::ParaRight;
- requisites.insert(inheritsText, text);
- }
-
- //add the inherited-by to the map
- NodeList subs;
- QmlTypeNode::subclasses(qcn->name(), subs);
- if (!subs.isEmpty()) {
- text.clear();
- text << Atom::ParaLeft;
- appendSortedQmlNames(text, qcn, subs);
- text << Atom::ParaRight;
- requisites.insert(inheritedBytext, text);
- }
-
- if (!requisites.isEmpty()) {
- //generate the table
- out() << "<div class=\"table\"><table class=\"alignedsummary\">\n";
-
- QStringList::ConstIterator i;
- for (i = requisiteorder.constBegin(); i != requisiteorder.constEnd(); ++i) {
-
- if (requisites.contains(*i)) {
- out() << "<tr>"
- << "<td class=\"memItemLeft rightAlign topAlign\"> "
- << *i
- << "</td><td class=\"memItemRight bottomAlign\"> ";
-
- if (*i == importText)
- out()<<requisites.value(*i).toString();
- else
- generateText(requisites.value(*i), qcn, marker);
- out() << "</td></tr>";
- }
- }
- out() << "</table></div>";
- }
-}
-
-void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
- const Node *relative)
-{
- Text brief = node->doc().briefText();
- if (!brief.isEmpty()) {
- generateExtractionMark(node, BriefMark);
- out() << "<p>";
- generateText(brief, node, marker);
-
- if (!relative || node == relative)
- out() << " <a href=\"#";
- else
- out() << " <a href=\"" << linkForNode(node, relative) << '#';
- out() << registerRef("details") << "\">More...</a></p>\n";
-
-
- generateExtractionMark(node, EndMark);
- }
-}
-
-void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker)
-{
- if (!inner->includes().isEmpty()) {
- out() << "<pre class=\"cpp\">"
- << trimmedTrailing(highlightedCode(indent(codeIndent,
- marker->markedUpIncludes(inner->includes())),
- inner))
- << "</pre>";
- }
-}
-
-/*!
- Revised for the new doc format.
- Generates a table of contents beginning at \a node.
- */
-void HtmlGenerator::generateTableOfContents(const Node *node,
- CodeMarker *marker,
- QList<Section>* sections)
-{
- QList<Atom*> toc;
- if (node->doc().hasTableOfContents())
- toc = node->doc().tableOfContents();
- if (tocDepth == 0 || (toc.isEmpty() && !sections && !node->isModule())) {
- generateSidebar();
- return;
- }
-
- QStringList sectionNumber;
- int detailsBase = 0;
-
- // disable nested links in table of contents
- inContents_ = true;
- inLink_ = true;
-
- out() << "<div class=\"sidebar\">\n";
- out() << "<div class=\"toc\">\n";
- out() << "<h3><a name=\"toc\">Contents</a></h3>\n";
- sectionNumber.append("1");
- out() << "<ul>\n";
-
- if (node->isModule()) {
- if (node->hasNamespaces()) {
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\"><a href=\"#"
- << registerRef("namespaces")
- << "\">Namespaces</a></li>\n";
- }
- if (node->hasClasses()) {
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\"><a href=\"#"
- << registerRef("classes")
- << "\">Classes</a></li>\n";
- }
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\"><a href=\"#"
- << registerRef("details")
- << "\">Detailed Description</a></li>\n";
- for (int i = 0; i < toc.size(); ++i) {
- if (toc.at(i)->string().toInt() == 1) {
- detailsBase = 1;
- break;
- }
- }
- }
- else if (sections && (node->isClass() ||
- node->isNamespace() ||
- node->isQmlType() ||
- node->isJsType())) {
- QList<Section>::ConstIterator s = sections->constBegin();
- while (s != sections->constEnd()) {
- if (!s->members.isEmpty()) {
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\"><a href=\"#"
- << registerRef((*s).pluralMember)
- << "\">" << (*s).name
- << "</a></li>\n";
- }
- if (!s->reimpMembers.isEmpty()) {
- QString ref = QString("Reimplemented ") + (*s).pluralMember;
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\"><a href=\"#"
- << registerRef(ref.toLower())
- << "\">" << QString("Reimplemented ") + (*s).name
- << "</a></li>\n";
- }
- ++s;
- }
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\"><a href=\"#"
- << registerRef("details")
- << "\">Detailed Description</a></li>\n";
- for (int i = 0; i < toc.size(); ++i) {
- if (toc.at(i)->string().toInt() == 1) {
- detailsBase = 1;
- break;
- }
- }
- }
-
- for (int i = 0; i < toc.size(); ++i) {
- Atom *atom = toc.at(i);
- int nextLevel = atom->string().toInt() + detailsBase;
- if (nextLevel >= 0) {
- if (sectionNumber.size() < nextLevel) {
- do {
- sectionNumber.append("1");
- } while (sectionNumber.size() < nextLevel);
- }
- else {
- while (sectionNumber.size() > nextLevel) {
- sectionNumber.removeLast();
- }
- sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1);
- }
- }
-
- //restrict the ToC depth to the one set by the HTML.tocdepth variable or
- //print all levels if tocDepth is not set.
- if (sectionNumber.size() <= tocDepth || tocDepth < 0) {
- int numAtoms;
- Text headingText = Text::sectionHeading(atom);
- QString s = headingText.toString();
- out() << "<li class=\"level"
- << sectionNumber.size()
- << "\">";
- out() << "<a href=\""
- << '#'
- << Doc::canonicalTitle(s)
- << "\">";
- generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms);
- out() << "</a></li>\n";
- }
- }
- while (!sectionNumber.isEmpty()) {
- sectionNumber.removeLast();
- }
- out() << "</ul>\n";
- out() << "</div>\n";
- out() << "<div class=\"sidebar-content\" id=\"sidebar-content\"></div>";
- out() << "</div>\n";
- inContents_ = false;
- inLink_ = false;
-}
-
-/*!
- Outputs a placeholder div where the style can add customized sidebar content.
- */
-void HtmlGenerator::generateSidebar() {
- out() << "<div class=\"sidebar\">";
- out() << "<div class=\"sidebar-content\" id=\"sidebar-content\"></div>";
- out() << "</div>\n";
-}
-
-QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
- CodeMarker *marker)
-{
- QList<Section> sections;
- QList<Section>::ConstIterator s;
-
- sections = marker->sections(inner,
- CodeMarker::Subpage,
- CodeMarker::Okay);
- if (sections.isEmpty())
- return QString();
-
- QString fileName = fileBase(inner) + "-members." + fileExtension();
- beginSubPage(inner, fileName);
- QString title = "List of All Members for " + inner->name();
- generateHeader(title, inner, marker);
- generateSidebar();
- generateTitle(title, Text(), SmallSubTitle, inner, marker);
- out() << "<p>This is the complete list of members for ";
- generateFullName(inner, 0);
- out() << ", including inherited members.</p>\n";
-
- Section section = sections.first();
- generateSectionList(section, inner, marker, CodeMarker::Subpage);
-
- generateFooter();
- endSubPage();
- return fileName;
-}
-
-/*!
- This function creates an html page on which are listed all
- the members of QML class \a qml_cn, including the inherited
- members. The \a marker is used for formatting stuff.
- */
-QString HtmlGenerator::generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker)
-{
- QList<Section> sections;
- QList<Section>::ConstIterator s;
-
- sections = marker->qmlSections(qml_cn,CodeMarker::Subpage);
- if (sections.isEmpty())
- return QString();
-
- QString fileName = fileBase(qml_cn) + "-members." + fileExtension();
- beginSubPage(qml_cn, fileName);
- QString title = "List of All Members for " + qml_cn->name();
- generateHeader(title, qml_cn, marker);
- generateSidebar();
- generateTitle(title, Text(), SmallSubTitle, qml_cn, marker);
- out() << "<p>This is the complete list of members for ";
- generateFullName(qml_cn, 0);
- out() << ", including inherited members.</p>\n";
-
- ClassKeysNodesList& cknl = sections.first().classKeysNodesList_;
- if (!cknl.isEmpty()) {
- for (int i=0; i<cknl.size(); i++) {
- ClassKeysNodes* ckn = cknl[i];
- const QmlTypeNode* qcn = ckn->first;
- KeysAndNodes& kn = ckn->second;
- QStringList& keys = kn.first;
- NodeList& nodes = kn.second;
- if (nodes.isEmpty())
- continue;
- if (i != 0) {
- out() << "<p>The following members are inherited from ";
- generateFullName(qcn,0);
- out() << ".</p>\n";
- }
- out() << "<ul>\n";
- for (int j=0; j<keys.size(); j++) {
- if (nodes[j]->access() == Node::Private || nodes[j]->status() == Node::Internal) {
- continue;
- }
- out() << "<li class=\"fn\">";
- QString prefix;
- if (!keys.isEmpty()) {
- prefix = keys.at(j).mid(1);
- prefix = prefix.left(keys.at(j).indexOf("::")+1);
- }
- generateQmlItem(nodes[j], qml_cn, marker, true);
- if (nodes[j]->isAttached())
- out() << " [attached]";
- //generateSynopsis(nodes[j], qcn, marker, CodeMarker::Subpage, false, &prefix);
- out() << "</li>\n";
- }
- out() << "</ul>\n";
- }
- }
-
- generateFooter();
- endSubPage();
- return fileName;
-}
-
-QString HtmlGenerator::generateLowStatusMemberFile(InnerNode *inner,
- CodeMarker *marker,
- CodeMarker::Status status)
-{
- QList<Section> sections = marker->sections(inner,
- CodeMarker::Summary,
- status);
- QMutableListIterator<Section> j(sections);
- while (j.hasNext()) {
- if (j.next().members.size() == 0)
- j.remove();
- }
- if (sections.isEmpty())
- return QString();
-
- int i;
-
- QString title;
- QString fileName;
-
- if (status == CodeMarker::Compat) {
- title = "Compatibility Members for " + inner->name();
- fileName = fileBase(inner) + "-compat." + fileExtension();
- }
- else {
- title = "Obsolete Members for " + inner->name();
- fileName = fileBase(inner) + "-obsolete." + fileExtension();
- }
- if (status == CodeMarker::Obsolete) {
- QString link;
- if (useOutputSubdirs() && !Generator::outputSubdir().isEmpty())
- link = QString("../" + Generator::outputSubdir() + QLatin1Char('/'));
- link += fileName;
- inner->setObsoleteLink(link);
- }
-
- beginSubPage(inner, fileName);
- generateHeader(title, inner, marker);
- generateSidebar();
- generateTitle(title, Text(), SmallSubTitle, inner, marker);
-
- if (status == CodeMarker::Compat) {
- out() << "<p><b>The following members of class "
- << "<a href=\"" << linkForNode(inner, 0) << "\">"
- << protectEnc(inner->name()) << "</a>"
- << " are part of the "
- "Qt compatibility layer.</b> We advise against "
- "using them in new code.</p>\n";
- }
- else {
- out() << "<p><b>The following members of class "
- << "<a href=\"" << linkForNode(inner, 0) << "\">"
- << protectEnc(inner->name()) << "</a>"
- << " are obsolete.</b> "
- << "They are provided to keep old source code working. "
- << "We strongly advise against using them in new code.</p>\n";
- }
-
- for (i = 0; i < sections.size(); ++i) {
- out() << "<h2>" << protectEnc(sections.at(i).name) << "</h2>\n";
- generateSectionList(sections.at(i), inner, marker, CodeMarker::Summary);
- }
-
- sections = marker->sections(inner, CodeMarker::Detailed, status);
- for (i = 0; i < sections.size(); ++i) {
- //out() << "<hr />\n";
- out() << "<h2>" << protectEnc(sections.at(i).name) << "</h2>\n";
-
- NodeList::ConstIterator m = sections.at(i).members.constBegin();
- while (m != sections.at(i).members.constEnd()) {
- if ((*m)->access() != Node::Private)
- generateDetailedMember(*m, inner, marker);
- ++m;
- }
- }
-
- generateFooter();
- endSubPage();
- return fileName;
-}
-
-/*!
- Generates a separate file where certain members of the QML
- type \a qcn are listed. The \a marker is used to generate
- the section lists, which are then traversed and output here.
-
- Note that this function currently only handles correctly the
- case where \a status is \c {CodeMarker::Obsolete}.
- */
-QString HtmlGenerator::generateQmlMemberFile(QmlTypeNode* qcn,
- CodeMarker *marker,
- CodeMarker::Status status)
-{
- QList<Section> sections = marker->qmlSections(qcn, CodeMarker::Summary, status);
- QMutableListIterator<Section> j(sections);
- while (j.hasNext()) {
- if (j.next().members.size() == 0)
- j.remove();
- }
- if (sections.isEmpty())
- return QString();
-
- QString title = "Obsolete Members for " + qcn->name();
- QString fileName = fileBase(qcn) + "-obsolete." + fileExtension();
-
- if (status == CodeMarker::Obsolete) {
- QString link;
- if (useOutputSubdirs() && !Generator::outputSubdir().isEmpty())
- link = QString("../" + Generator::outputSubdir() + QLatin1Char('/'));
- link += fileName;
- qcn->setObsoleteLink(link);
- }
-
- beginSubPage(qcn, fileName);
- generateHeader(title, qcn, marker);
- generateSidebar();
- generateTitle(title, Text(), SmallSubTitle, qcn, marker);
-
- out() << "<p><b>The following members of QML type "
- << "<a href=\"" << linkForNode(qcn, 0) << "\">"
- << protectEnc(qcn->name()) << "</a>"
- << " are obsolete.</b> "
- << "They are provided to keep old source code working. "
- << "We strongly advise against using them in new code.</p>\n";
-
- QList<Section>::const_iterator s = sections.constBegin();
- while (s != sections.constEnd()) {
- QString ref = registerRef((*s).name.toLower());
- out() << "<a name=\"" << ref
- << "\"></a>" << divNavTop << '\n';
- out() << "<h2 id=\"" << ref << "\">" << protectEnc((*s).name) << "</h2>\n";
- generateQmlSummary(*s, qcn, marker);
- ++s;
- }
-
- sections = marker->qmlSections(qcn, CodeMarker::Detailed, status);
- QMutableListIterator<Section> k(sections);
- while (k.hasNext()) {
- if (k.next().members.size() == 0)
- k.remove();
- }
- if (sections.isEmpty())
- return QString();
-
- s = sections.constBegin();
- while (s != sections.constEnd()) {
- out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
- NodeList::ConstIterator m = (*s).members.constBegin();
- while (m != (*s).members.constEnd()) {
- generateDetailedQmlMember(*m, qcn, marker);
- out() << "<br/>\n";
- ++m;
- }
- ++s;
- }
-
- generateFooter();
- endSubPage();
- return fileName;
-}
-
-void HtmlGenerator::generateClassHierarchy(const Node *relative, NodeMap& classMap)
-{
- if (classMap.isEmpty())
- return;
-
- NodeMap topLevel;
- NodeMap::Iterator c = classMap.begin();
- while (c != classMap.end()) {
- ClassNode *classe = static_cast<ClassNode *>(*c);
- if (classe->baseClasses().isEmpty())
- topLevel.insert(classe->name(), classe);
- ++c;
- }
-
- QStack<NodeMap > stack;
- stack.push(topLevel);
-
- out() << "<ul>\n";
- while (!stack.isEmpty()) {
- if (stack.top().isEmpty()) {
- stack.pop();
- out() << "</ul>\n";
- }
- else {
- ClassNode* child = static_cast<ClassNode*>(*stack.top().begin());
- out() << "<li>";
- generateFullName(child, relative);
- out() << "</li>\n";
- stack.top().erase(stack.top().begin());
-
- NodeMap newTop;
- foreach (const RelatedClass &d, child->derivedClasses()) {
- if (d.node_ && !d.isPrivate() && !d.node_->isInternal() && d.node_->hasDoc())
- newTop.insert(d.node_->name(), d.node_);
- }
- if (!newTop.isEmpty()) {
- stack.push(newTop);
- out() << "<ul>\n";
- }
- }
- }
-}
-
-/*!
- Output an annotated list of the nodes in \a nodeMap.
- A two-column table is output.
- */
-void HtmlGenerator::generateAnnotatedList(const Node* relative,
- CodeMarker* marker,
- const NodeMultiMap& nmm)
-{
- if (nmm.isEmpty())
- return;
- generateAnnotatedList(relative, marker, nmm.values());
-}
-
-/*!
- */
-void HtmlGenerator::generateAnnotatedList(const Node *relative,
- CodeMarker *marker,
- const NodeList& unsortedNodes)
-{
- NodeMultiMap nmm;
- bool allInternal = true;
- foreach (Node* node, unsortedNodes) {
- if (!node->isInternal() && !node->isObsolete()) {
- allInternal = false;
- nmm.insert(node->fullName(relative), node);
- }
- }
- if (allInternal)
- return;
- out() << "<div class=\"table\"><table class=\"annotated\">\n";
- int row = 0;
- NodeList nodes = nmm.values();
- foreach (const Node* node, nodes) {
- if (++row % 2 == 1)
- out() << "<tr class=\"odd topAlign\">";
- else
- out() << "<tr class=\"even topAlign\">";
- out() << "<td class=\"tblName\"><p>";
- generateFullName(node, relative);
- out() << "</p></td>";
-
- if (!node->isDocumentNode()) {
- Text brief = node->doc().trimmedBriefText(node->name());
- if (!brief.isEmpty()) {
- out() << "<td class=\"tblDescr\"><p>";
- generateText(brief, node, marker);
- out() << "</p></td>";
- }
- else if (!node->reconstitutedBrief().isEmpty()) {
- out() << "<td class=\"tblDescr\"><p>";
- out() << node->reconstitutedBrief();
- out() << "</p></td>";
- }
- }
- else {
- out() << "<td class=\"tblDescr\"><p>";
- if (!node->reconstitutedBrief().isEmpty()) {
- out() << node->reconstitutedBrief();
- }
- else
- out() << protectEnc(node->doc().briefText().toString());
- out() << "</p></td>";
- }
- out() << "</tr>\n";
- }
- out() << "</table></div>\n";
-}
-
-/*!
- This function finds the common prefix of the names of all
- the classes in the class map \a nmm and then generates a
- compact list of the class names alphabetized on the part
- of the name not including the common prefix. You can tell
- the function to use \a comonPrefix as the common prefix,
- but normally you let it figure it out itself by looking at
- the name of the first and last classes in the class map
- \a nmm.
- */
-void HtmlGenerator::generateCompactList(ListType listType,
- const Node *relative,
- const NodeMultiMap &nmm,
- bool includeAlphabet,
- QString commonPrefix)
-{
- if (nmm.isEmpty())
- return;
-
- const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_'
- int commonPrefixLen = commonPrefix.length();
-
- /*
- Divide the data into 37 paragraphs: 0, ..., 9, A, ..., Z,
- underscore (_). QAccel will fall in paragraph 10 (A) and
- QXtWidget in paragraph 33 (X). This is the only place where we
- assume that NumParagraphs is 37. Each paragraph is a NodeMultiMap.
- */
- NodeMultiMap paragraph[NumParagraphs+1];
- QString paragraphName[NumParagraphs+1];
- QSet<char> usedParagraphNames;
-
- NodeMultiMap::ConstIterator c = nmm.constBegin();
- while (c != nmm.constEnd()) {
- QStringList pieces = c.key().split("::");
- QString key;
- int idx = commonPrefixLen;
- if (idx > 0 && !pieces.last().startsWith(commonPrefix))
- idx = 0;
- if (pieces.size() == 1)
- key = pieces.last().mid(idx).toLower();
- else
- key = pieces.last().toLower();
-
- int paragraphNr = NumParagraphs - 1;
-
- if (key[0].digitValue() != -1) {
- paragraphNr = key[0].digitValue();
- }
- else if (key[0] >= QLatin1Char('a') && key[0] <= QLatin1Char('z')) {
- paragraphNr = 10 + key[0].unicode() - 'a';
- }
-
- paragraphName[paragraphNr] = key[0].toUpper();
- usedParagraphNames.insert(key[0].toLower().cell());
- paragraph[paragraphNr].insert(c.key(), c.value());
- ++c;
- }
-
- /*
- Each paragraph j has a size: paragraph[j].count(). In the
- discussion, we will assume paragraphs 0 to 5 will have sizes
- 3, 1, 4, 1, 5, 9.
-
- We now want to compute the paragraph offset. Paragraphs 0 to 6
- start at offsets 0, 3, 4, 8, 9, 14, 23.
- */
- int paragraphOffset[NumParagraphs + 1]; // 37 + 1
- paragraphOffset[0] = 0;
- for (int i=0; i<NumParagraphs; i++) // i = 0..36
- paragraphOffset[i+1] = paragraphOffset[i] + paragraph[i].count();
-
- /*
- Output the alphabet as a row of links.
- */
- if (includeAlphabet) {
- out() << "<p class=\"centerAlign functionIndex\"><b>";
- for (int i = 0; i < 26; i++) {
- QChar ch('a' + i);
- if (usedParagraphNames.contains(char('a' + i)))
- out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
- }
- out() << "</b></p>\n";
- }
-
- /*
- Output a <div> element to contain all the <dl> elements.
- */
- out() << "<div class=\"flowListDiv\">\n";
- numTableRows_ = 0;
-
- int curParNr = 0;
- int curParOffset = 0;
- QString previousName;
- bool multipleOccurrences = false;
-
- for (int i=0; i<nmm.count(); i++) {
- while ((curParNr < NumParagraphs) &&
- (curParOffset == paragraph[curParNr].count())) {
- ++curParNr;
- curParOffset = 0;
- }
-
- /*
- Starting a new paragraph means starting a new <dl>.
- */
- if (curParOffset == 0) {
- if (i > 0)
- out() << "</dl>\n";
- if (++numTableRows_ % 2 == 1)
- out() << "<dl class=\"flowList odd\">";
- else
- out() << "<dl class=\"flowList even\">";
- out() << "<dt class=\"alphaChar\">";
- if (includeAlphabet) {
- QChar c = paragraphName[curParNr][0].toLower();
- out() << QString("<a name=\"%1\"></a>").arg(c);
- }
- out() << "<b>"
- << paragraphName[curParNr]
- << "</b>";
- out() << "</dt>\n";
- }
-
- /*
- Output a <dd> for the current offset in the current paragraph.
- */
- out() << "<dd>";
- if ((curParNr < NumParagraphs) &&
- !paragraphName[curParNr].isEmpty()) {
- NodeMultiMap::Iterator it;
- NodeMultiMap::Iterator next;
- it = paragraph[curParNr].begin();
- for (int i=0; i<curParOffset; i++)
- ++it;
-
- if (listType == Generic) {
- /*
- Previously, we used generateFullName() for this, but we
- require some special formatting.
- */
- out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">";
- }
- else if (listType == Obsolete) {
- QString fileName = fileBase(it.value()) + "-obsolete." + fileExtension();
- QString link;
- if (useOutputSubdirs()) {
- link = QString("../" + it.value()->outputSubdirectory() + QLatin1Char('/'));
- }
- link += fileName;
- out() << "<a href=\"" << link << "\">";
- }
-
- QStringList pieces;
- if (it.value()->isQmlType() || it.value()->isJsType()) {
- QString name = it.value()->name();
- next = it;
- ++next;
- if (name != previousName)
- multipleOccurrences = false;
- if ((next != paragraph[curParNr].end()) && (name == next.value()->name())) {
- multipleOccurrences = true;
- previousName = name;
- }
- if (multipleOccurrences)
- name += ": " + it.value()->tree()->camelCaseModuleName();
- pieces << name;
- }
- else
- pieces = it.value()->fullName(relative).split("::");
- out() << protectEnc(pieces.last());
- out() << "</a>";
- if (pieces.size() > 1) {
- out() << " (";
- generateFullName(it.value()->parent(), relative);
- out() << ')';
- }
- }
- out() << "</dd>\n";
- curParOffset++;
- }
- if (nmm.count() > 0)
- out() << "</dl>\n";
-
- out() << "</div>\n";
-}
-
-void HtmlGenerator::generateFunctionIndex(const Node *relative)
-{
- out() << "<p class=\"centerAlign functionIndex\"><b>";
- for (int i = 0; i < 26; i++) {
- QChar ch('a' + i);
- out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
- }
- out() << "</b></p>\n";
-
- char nextLetter = 'a';
- char currentLetter;
-
- out() << "<ul>\n";
- NodeMapMap& funcIndex = qdb_->getFunctionIndex();
- QMap<QString, NodeMap >::ConstIterator f = funcIndex.constBegin();
- while (f != funcIndex.constEnd()) {
- out() << "<li>";
- out() << protectEnc(f.key()) << ':';
-
- currentLetter = f.key()[0].unicode();
- while (islower(currentLetter) && currentLetter >= nextLetter) {
- out() << QString("<a name=\"%1\"></a>").arg(nextLetter);
- nextLetter++;
- }
-
- NodeMap::ConstIterator s = (*f).constBegin();
- while (s != (*f).constEnd()) {
- out() << ' ';
- generateFullName((*s)->parent(), relative, *s);
- ++s;
- }
- out() << "</li>";
- out() << '\n';
- ++f;
- }
- out() << "</ul>\n";
-}
-
-void HtmlGenerator::generateLegaleseList(const Node *relative, CodeMarker *marker)
-{
- TextToNodeMap& legaleseTexts = qdb_->getLegaleseTexts();
- QMap<Text, const Node *>::ConstIterator it = legaleseTexts.constBegin();
- while (it != legaleseTexts.constEnd()) {
- Text text = it.key();
- //out() << "<hr />\n";
- generateText(text, relative, marker);
- out() << "<ul>\n";
- do {
- out() << "<li>";
- generateFullName(it.value(), relative);
- out() << "</li>\n";
- ++it;
- } while (it != legaleseTexts.constEnd() && it.key() == text);
- out() << "</ul>\n";
- }
-}
-
-void HtmlGenerator::generateQmlItem(const Node *node,
- const Node *relative,
- CodeMarker *marker,
- bool summary)
-{
- QString marked = marker->markedUpQmlItem(node,summary);
- QRegExp templateTag("(<[^@>]*>)");
- if (marked.indexOf(templateTag) != -1) {
- QString contents = protectEnc(marked.mid(templateTag.pos(1),
- templateTag.cap(1).length()));
- marked.replace(templateTag.pos(1), templateTag.cap(1).length(),
- contents);
- }
- marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
- "<i>\\1<sub>\\2</sub></i>");
- marked.replace("<@param>", "<i> ");
- marked.replace("</@param>", "</i>");
-
- if (summary)
- marked.replace("@name>", "b>");
-
- marked.replace("<@extra>", "<code>");
- marked.replace("</@extra>", "</code>");
-
- if (summary) {
- marked.remove("<@type>");
- marked.remove("</@type>");
- }
- out() << highlightedCode(marked, relative, false);
-}
-
-void HtmlGenerator::generateList(const Node* relative, CodeMarker* marker, const QString& selector)
-{
- CNMap cnm;
- Node::Genus genus = Node::DontCare;
- if (selector == "overviews")
- genus = Node::DOC;
- else if (selector == "cpp-modules")
- genus = Node::CPP;
- else if (selector == "qml-modules")
- genus = Node::QML;
- else if (selector == "js-modules")
- genus = Node::JS;
- if (genus != Node::DontCare) {
- NodeList nl;
- qdb_->mergeCollections(genus, cnm, relative);
- CollectionList cl = cnm.values();
- foreach (CollectionNode* cn, cl)
- nl.append(cn);
- generateAnnotatedList(relative, marker, nl);
- }
- else {
- /*
- \generatelist {selector} is only allowed in a
- comment where the topic is \group, \module,
- \qmlmodule, or \jsmodule
- */
- if (!relative || !relative->isCollectionNode()) {
- relative->doc().location().warning(tr("\\generatelist {%1} is only allowed in \\group, "
- "\\module, \\qmlmodule, and \\jsmodule comments.").arg(selector));
- return;
- }
- Node* n = const_cast<Node*>(relative);
- CollectionNode* cn = static_cast<CollectionNode*>(n);
- qdb_->mergeCollections(cn);
- generateAnnotatedList(cn, marker, cn->members());
- }
-}
-
-void HtmlGenerator::generateSection(const NodeList& nl,
- const Node *relative,
- CodeMarker *marker,
- CodeMarker::SynopsisStyle style)
-{
- bool alignNames = true;
- if (!nl.isEmpty()) {
- bool twoColumn = false;
- if (style == CodeMarker::Subpage) {
- alignNames = false;
- twoColumn = (nl.count() >= 16);
- }
- else if (nl.first()->type() == Node::Property) {
- twoColumn = (nl.count() >= 5);
- alignNames = false;
- }
- if (alignNames) {
- out() << "<div class=\"table\"><table class=\"alignedsummary\">\n";
- }
- else {
- if (twoColumn)
- out() << "<div class=\"table\"><table class=\"propsummary\">\n"
- << "<tr><td class=\"topAlign\">";
- out() << "<ul>\n";
- }
-
- int i = 0;
- NodeList::ConstIterator m = nl.constBegin();
- while (m != nl.constEnd()) {
- if ((*m)->access() == Node::Private) {
- ++m;
- continue;
- }
-
- if (alignNames) {
- out() << "<tr><td class=\"memItemLeft rightAlign topAlign\"> ";
- }
- else {
- if (twoColumn && i == (int) (nl.count() + 1) / 2)
- out() << "</ul></td><td class=\"topAlign\"><ul>\n";
- out() << "<li class=\"fn\">";
- }
-
- generateSynopsis(*m, relative, marker, style, alignNames);
- if (alignNames)
- out() << "</td></tr>\n";
- else
- out() << "</li>\n";
- i++;
- ++m;
- }
- if (alignNames)
- out() << "</table></div>\n";
- else {
- out() << "</ul>\n";
- if (twoColumn)
- out() << "</td></tr>\n</table></div>\n";
- }
- }
-}
-
-void HtmlGenerator::generateSectionList(const Section& section,
- const Node *relative,
- CodeMarker *marker,
- CodeMarker::SynopsisStyle style)
-{
- bool alignNames = true;
- if (!section.members.isEmpty()) {
- bool hasPrivateSignals = false;
- bool twoColumn = false;
- if (style == CodeMarker::Subpage) {
- alignNames = false;
- twoColumn = (section.members.count() >= 16);
- }
- else if (section.members.first()->type() == Node::Property) {
- twoColumn = (section.members.count() >= 5);
- alignNames = false;
- }
- if (alignNames) {
- out() << "<div class=\"table\"><table class=\"alignedsummary\">\n";
- }
- else {
- if (twoColumn)
- out() << "<div class=\"table\"><table class=\"propsummary\">\n"
- << "<tr><td class=\"topAlign\">";
- out() << "<ul>\n";
- }
-
- int i = 0;
- NodeList::ConstIterator m = section.members.constBegin();
- while (m != section.members.constEnd()) {
- if ((*m)->access() == Node::Private) {
- ++m;
- continue;
- }
-
- if (alignNames) {
- out() << "<tr><td class=\"memItemLeft topAlign rightAlign\"> ";
- }
- else {
- if (twoColumn && i == (int) (section.members.count() + 1) / 2)
- out() << "</ul></td><td class=\"topAlign\"><ul>\n";
- out() << "<li class=\"fn\">";
- }
-
- QString prefix;
- if (!section.keys.isEmpty()) {
- prefix = section.keys.at(i).mid(1);
- prefix = prefix.left(section.keys.at(i).indexOf("::")+1);
- }
- generateSynopsis(*m, relative, marker, style, alignNames, &prefix);
- if ((*m)->isFunction()) {
- const FunctionNode* fn = static_cast<const FunctionNode*>(*m);
- if (fn->isPrivateSignal()) {
- hasPrivateSignals = true;
- if (alignNames)
- out() << "</td><td class=\"memItemRight bottomAlign\">[see note below]";
- }
- }
- if (alignNames)
- out() << "</td></tr>\n";
- else
- out() << "</li>\n";
- i++;
- ++m;
- }
- if (alignNames)
- out() << "</table></div>\n";
- else {
- out() << "</ul>\n";
- if (twoColumn)
- out() << "</td></tr>\n</table></div>\n";
- }
- if (hasPrivateSignals && alignNames) {
- generatePrivateSignalNote(relative, marker);
- }
- }
-
- if (style == CodeMarker::Summary && !section.inherited.isEmpty()) {
- out() << "<ul>\n";
- generateSectionInheritedList(section, relative);
- out() << "</ul>\n";
- }
-}
-
-void HtmlGenerator::generateSectionInheritedList(const Section& section, const Node *relative)
-{
- QList<QPair<InnerNode *, int> >::ConstIterator p = section.inherited.constBegin();
- while (p != section.inherited.constEnd()) {
- out() << "<li class=\"fn\">";
- out() << (*p).second << ' ';
- if ((*p).second == 1) {
- out() << section.singularMember;
- }
- else {
- out() << section.pluralMember;
- }
- out() << " inherited from <a href=\"" << fileName((*p).first)
- << '#' << Generator::cleanRef(section.name.toLower()) << "\">"
- << protectEnc((*p).first->plainFullName(relative))
- << "</a></li>\n";
- ++p;
- }
-}
-
-// generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false);
-void HtmlGenerator::generateSynopsis(const Node *node,
- const Node *relative,
- CodeMarker *marker,
- CodeMarker::SynopsisStyle style,
- bool alignNames,
- const QString* prefix)
-{
- QString marked = marker->markedUpSynopsis(node, relative, style);
-
- if (prefix)
- marked.prepend(*prefix);
- QRegExp templateTag("(<[^@>]*>)");
- if (marked.indexOf(templateTag) != -1) {
- QString contents = protectEnc(marked.mid(templateTag.pos(1),
- templateTag.cap(1).length()));
- marked.replace(templateTag.pos(1), templateTag.cap(1).length(),
- contents);
- }
- marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
- "<i>\\1<sub>\\2</sub></i>");
- marked.replace("<@param>", "<i> ");
- marked.replace("</@param>", "</i>");
-
- if (style == CodeMarker::Summary) {
- marked.remove("<@name>"); // was "<b>"
- marked.remove("</@name>"); // was "</b>"
- }
-
- if (style == CodeMarker::Subpage) {
- QRegExp extraRegExp("<@extra>.*</@extra>");
- extraRegExp.setMinimal(true);
- marked.remove(extraRegExp);
- } else {
- marked.replace("<@extra>", "<code>");
- marked.replace("</@extra>", "</code>");
- }
-
- if (style != CodeMarker::Detailed) {
- marked.remove("<@type>");
- marked.remove("</@type>");
- }
-
- out() << highlightedCode(marked, relative, alignNames);
-}
-
-QString HtmlGenerator::highlightedCode(const QString& markedCode,
- const Node* relative,
- bool alignNames)
-{
- QString src = markedCode;
- QString html;
- QStringRef arg;
- QStringRef par1;
-
- const QChar charLangle = '<';
- const QChar charAt = '@';
-
- static const QString typeTag("type");
- static const QString headerTag("headerfile");
- static const QString funcTag("func");
- static const QString linkTag("link");
-
- // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
- bool done = false;
- for (int i = 0, srcSize = src.size(); i < srcSize;) {
- if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
- if (alignNames && !done) {
- html += "</td><td class=\"memItemRight bottomAlign\">";
- done = true;
- }
- i += 2;
- if (parseArg(src, linkTag, &i, srcSize, &arg, &par1)) {
- html += "<b>";
- const Node* n = CodeMarker::nodeForString(par1.toString());
- QString link = linkForNode(n, relative);
- addLink(link, arg, &html);
- html += "</b>";
- }
- else {
- html += charLangle;
- html += charAt;
- }
- }
- else {
- html += src.at(i++);
- }
- }
-
- // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)(</@func>)"
- src = html;
- html = QString();
- for (int i = 0, srcSize = src.size(); i < srcSize;) {
- if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
- i += 2;
- if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
- const Node* n = qdb_->findFunctionNode(par1.toString(), relative, Node::DontCare);
- QString link = linkForNode(n, relative);
- addLink(link, arg, &html);
- par1 = QStringRef();
- }
- else {
- html += charLangle;
- html += charAt;
- }
- }
- else {
- html += src.at(i++);
- }
- }
-
- // replace all "(<@(type|headerfile)(?: +[^>]*)?>)(.*)(</@\\2>)" tags
- src = html;
- html = QString();
-
- for (int i=0, srcSize=src.size(); i<srcSize;) {
- if (src.at(i) == charLangle && src.at(i+1) == charAt) {
- i += 2;
- bool handled = false;
- if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) {
- par1 = QStringRef();
- const Node* n = qdb_->findTypeNode(arg.toString(), relative);
- html += QLatin1String("<span class=\"type\">");
- if (n && (n->isQmlBasicType() || n->isJsBasicType())) {
- if (relative && (relative->isQmlType() || relative->isJsType()))
- addLink(linkForNode(n,relative), arg, &html);
- else
- html += arg;
- }
- else
- addLink(linkForNode(n,relative), arg, &html);
- html += QLatin1String("</span>");
- handled = true;
- }
- else if (parseArg(src, headerTag, &i, srcSize, &arg, &par1)) {
- par1 = QStringRef();
- if (arg.at(0) == QChar('&'))
- html += arg;
- else {
- const Node* n = qdb_->findNodeForInclude(QStringList(arg.toString()));
- if (n && n != relative)
- addLink(linkForNode(n,relative), arg, &html);
- else
- html += arg;
- }
- handled = true;
- }
- if (!handled) {
- html += charLangle;
- html += charAt;
- }
- }
- else {
- html += src.at(i++);
- }
- }
-
- // replace all
- // "<@comment>" -> "<span class=\"comment\">";
- // "<@preprocessor>" -> "<span class=\"preprocessor\">";
- // "<@string>" -> "<span class=\"string\">";
- // "<@char>" -> "<span class=\"char\">";
- // "<@number>" -> "<span class=\"number\">";
- // "<@op>" -> "<span class=\"operator\">";
- // "<@type>" -> "<span class=\"type\">";
- // "<@name>" -> "<span class=\"name\">";
- // "<@keyword>" -> "<span class=\"keyword\">";
- // "</@(?:comment|preprocessor|string|char|number|op|type|name|keyword)>" -> "</span>"
- src = html;
- html = QString();
- static const QString spanTags[] = {
- "<@comment>", "<span class=\"comment\">",
- "<@preprocessor>", "<span class=\"preprocessor\">",
- "<@string>", "<span class=\"string\">",
- "<@char>", "<span class=\"char\">",
- "<@number>", "<span class=\"number\">",
- "<@op>", "<span class=\"operator\">",
- "<@type>", "<span class=\"type\">",
- "<@name>", "<span class=\"name\">",
- "<@keyword>", "<span class=\"keyword\">",
- "</@comment>", "</span>",
- "</@preprocessor>", "</span>",
- "</@string>", "</span>",
- "</@char>", "</span>",
- "</@number>", "</span>",
- "</@op>", "</span>",
- "</@type>", "</span>",
- "</@name>", "</span>",
- "</@keyword>", "</span>",
- };
- // Update the upper bound of k in the following code to match the length
- // of the above array.
- for (int i = 0, n = src.size(); i < n;) {
- if (src.at(i) == charLangle) {
- bool handled = false;
- for (int k = 0; k != 18; ++k) {
- const QString & tag = spanTags[2 * k];
- if (tag == QStringRef(&src, i, tag.length())) {
- html += spanTags[2 * k + 1];
- i += tag.length();
- handled = true;
- break;
- }
- }
- if (!handled) {
- ++i;
- if (src.at(i) == charAt ||
- (src.at(i) == QLatin1Char('/') && src.at(i + 1) == charAt)) {
- // drop 'our' unknown tags (the ones still containing '@')
- while (i < n && src.at(i) != QLatin1Char('>'))
- ++i;
- ++i;
- }
- else {
- // retain all others
- html += charLangle;
- }
- }
- }
- else {
- html += src.at(i);
- ++i;
- }
- }
- return html;
-}
-
-void HtmlGenerator::generateLink(const Atom* atom, CodeMarker* marker)
-{
- static QRegExp camelCase("[A-Z][A-Z][a-z]|[a-z][A-Z0-9]|_");
-
- if (funcLeftParen.indexIn(atom->string()) != -1 && marker->recognizeLanguage("Cpp")) {
- // hack for C++: move () outside of link
- int k = funcLeftParen.pos(1);
- out() << protectEnc(atom->string().left(k));
- if (link_.isEmpty()) {
- if (showBrokenLinks)
- out() << "</i>";
- } else {
- out() << "</a>";
- }
- inLink_ = false;
- out() << protectEnc(atom->string().mid(k));
- } else {
- out() << protectEnc(atom->string());
- }
-}
-
-QString HtmlGenerator::registerRef(const QString& ref)
-{
- QString clean = Generator::cleanRef(ref);
-
- for (;;) {
- QString& prevRef = refMap[clean.toLower()];
- if (prevRef.isEmpty()) {
- prevRef = ref;
- break;
- } else if (prevRef == ref) {
- break;
- }
- clean += QLatin1Char('x');
- }
- return clean;
-}
-
-QString HtmlGenerator::protectEnc(const QString &string)
-{
-#ifndef QT_NO_TEXTCODEC
- return protect(string, outputEncoding);
-#else
- return protect(string);
-#endif
-}
-
-QString HtmlGenerator::protect(const QString &string, const QString &outputEncoding)
-{
-#define APPEND(x) \
- if (html.isEmpty()) { \
- html = string; \
- html.truncate(i); \
-} \
- html += (x);
-
- QString html;
- int n = string.length();
-
- for (int i = 0; i < n; ++i) {
- QChar ch = string.at(i);
-
- if (ch == QLatin1Char('&')) {
- APPEND("&amp;");
- } else if (ch == QLatin1Char('<')) {
- APPEND("&lt;");
- } else if (ch == QLatin1Char('>')) {
- APPEND("&gt;");
- } else if (ch == QLatin1Char('"')) {
- APPEND("&quot;");
- } else if ((outputEncoding == "ISO-8859-1" && ch.unicode() > 0x007F)
- || (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/'))
- || (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) {
- // we escape '*/' and the last dot in 'e.g.' and 'i.e.' for the Javadoc generator
- APPEND("&#x");
- html += QString::number(ch.unicode(), 16);
- html += QLatin1Char(';');
- } else {
- if (!html.isEmpty())
- html += ch;
- }
- }
-
- if (!html.isEmpty())
- return html;
- return string;
-
-#undef APPEND
-}
-
-QString HtmlGenerator::fileBase(const Node *node) const
-{
- QString result;
-
- result = Generator::fileBase(node);
-
- if (!node->isInnerNode()) {
- switch (node->status()) {
- case Node::Compat:
- result += "-compat";
- break;
- case Node::Obsolete:
- result += "-obsolete";
- break;
- default:
- ;
- }
- }
- return result;
-}
-
-QString HtmlGenerator::fileName(const Node *node)
-{
- if (node->type() == Node::Document) {
- if (static_cast<const DocumentNode *>(node)->subType() == Node::ExternalPage)
- return node->name();
- if (static_cast<const DocumentNode *>(node)->subType() == Node::Image)
- return node->name();
- }
- return Generator::fileName(node);
-}
-
-QString HtmlGenerator::refForNode(const Node *node)
-{
- const FunctionNode *func;
- const TypedefNode *typedeffe;
- QString ref;
-
- switch (node->type()) {
- case Node::Namespace:
- case Node::Class:
- default:
- break;
- case Node::Enum:
- ref = node->name() + "-enum";
- break;
- case Node::Typedef:
- typedeffe = static_cast<const TypedefNode *>(node);
- if (typedeffe->associatedEnum()) {
- return refForNode(typedeffe->associatedEnum());
- }
- else {
- ref = node->name() + "-typedef";
- }
- break;
- case Node::Function:
- func = static_cast<const FunctionNode *>(node);
- if (func->associatedProperty()) {
- return refForNode(func->associatedProperty());
- }
- else {
- ref = func->name();
- if (func->overloadNumber() != 1)
- ref += QLatin1Char('-') + QString::number(func->overloadNumber());
- }
- break;
- case Node::Document:
- break;
- case Node::QmlProperty:
- if (node->isAttached())
- ref = node->name() + "-attached-prop";
- else
- ref = node->name() + "-prop";
- break;
- case Node::QmlPropertyGroup:
- case Node::Property:
- ref = node->name() + "-prop";
- break;
- case Node::QmlSignal:
- ref = node->name() + "-signal";
- break;
- case Node::QmlSignalHandler:
- ref = node->name() + "-signal-handler";
- break;
- case Node::QmlMethod:
- func = static_cast<const FunctionNode *>(node);
- ref = func->name() + "-method";
- if (func->overloadNumber() != 1)
- ref += QLatin1Char('-') + QString::number(func->overloadNumber());
- break;
- case Node::Variable:
- ref = node->name() + "-var";
- break;
- }
- return registerRef(ref);
-}
-
-/*!
- This function is called for links, i.e. for words that
- are marked with the qdoc link command. For autolinks
- that are not marked with the qdoc link command, the
- getAutoLink() function is called
-
- It returns the string for a link found by using the data
- in the \a atom to search the database. It also sets \a node
- to point to the target node for that link. \a relative points
- to the node holding the qdoc comment where the link command
- was found.
- */
-QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Node** node)
-{
- const QString& t = atom->string();
- if (t.at(0) == QChar('h')) {
- if (t.startsWith("http:") || t.startsWith("https:"))
- return t;
- }
- else if (t.at(0) == QChar('f')) {
- if (t.startsWith("file:") || t.startsWith("ftp:"))
- return t;
- }
- else if (t.at(0) == QChar('m')) {
- if (t.startsWith("mailto:"))
- return t;
- }
- return getAutoLink(atom, relative, node);
-}
-
-/*!
- This function is called for autolinks, i.e. for words that
- are not marked with the qdoc link command that qdoc has
- reason to believe should be links. For links marked with
- the qdoc link command, the getLink() function is called.
-
- It returns the string for a link found by using the data
- in the \a atom to search the database. It also sets \a node
- to point to the target node for that link. \a relative points
- to the node holding the qdoc comment where the link command
- was found.
- */
-QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const Node** node)
-{
- QString ref;
-
- *node = qdb_->findNodeForAtom(atom, relative, ref);
- if (!(*node)) {
- return QString();
- }
-
- QString link = (*node)->url();
- if (link.isEmpty()) {
- link = linkForNode(*node, relative);
- if ((*node)->subType() == Node::Image)
- link = "images/used-in-examples/" + link;
- if (!ref.isEmpty())
- link += QLatin1Char('#') + ref;
- }
- else if (!ref.isEmpty()) {
- int hashtag = link.lastIndexOf(QChar('#'));
- if (hashtag != -1)
- link.truncate(hashtag);
- link += "#" + ref;
- }
- return link;
-}
-
-/*!
- Construct the link string for the \a node and return it.
- The \a relative node is use to decide the link we are
- generating is in the same file as the target. Note the
- relative node can be 0, which pretty much guarantees
- that the link and the target aren't in the same file.
- */
-QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
-{
- if (node == 0)
- return QString();
- if (!node->url().isEmpty())
- return node->url();
- if (fileBase(node).isEmpty())
- return QString();
- if (node->access() == Node::Private)
- return QString();
-
- QString fn = fileName(node);
- if (node && node->parent() &&
- (node->parent()->isQmlType() || node->parent()->isJsType())
- && node->parent()->isAbstract()) {
- if (Generator::qmlTypeContext())
- fn = fileName(Generator::qmlTypeContext());
- }
- QString link = fn;
-
- if (!node->isInnerNode() || node->isQmlPropertyGroup() || node->isJsPropertyGroup()) {
- QString ref = refForNode(node);
- if (relative && fn == fileName(relative) && ref == refForNode(relative))
- return QString();
-
- link += QLatin1Char('#');
- link += ref;
- }
- /*
- If the output is going to subdirectories, then if the
- two nodes will be output to different directories, then
- the link must go up to the parent directory and then
- back down into the other subdirectory.
- */
- if (node && relative && (node != relative)) {
- if (useOutputSubdirs() && !node->isExternalPage() &&
- node->outputSubdirectory() != relative->outputSubdirectory()) {
- if (link.startsWith(QString(node->outputSubdirectory() + QLatin1Char('/')))) {
- link.prepend(QString("../"));
- }
- else {
- link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/')));
- }
- }
- }
- return link;
-}
-
-void HtmlGenerator::generateFullName(const Node *apparentNode, const Node *relative, const Node *actualNode)
-{
- if (actualNode == 0)
- actualNode = apparentNode;
- out() << "<a href=\"" << linkForNode(actualNode, relative);
- if (true || relative == 0 || relative->status() != actualNode->status()) {
- switch (actualNode->status()) {
- case Node::Obsolete:
- out() << "\" class=\"obsolete";
- break;
- case Node::Compat:
- out() << "\" class=\"compat";
- break;
- default:
- ;
- }
- }
- out() << "\">";
- out() << protectEnc(apparentNode->fullName(relative));
- out() << "</a>";
-}
-
-void HtmlGenerator::generateDetailedMember(const Node *node,
- const InnerNode *relative,
- CodeMarker *marker)
-{
- const EnumNode *enume;
-
-#ifdef GENERATE_MAC_REFS
- generateMacRef(node, marker);
-#endif
- generateExtractionMark(node, MemberMark);
- generateKeywordAnchors(node);
- QString nodeRef = refForNode(node);
- if (node->type() == Node::Enum
- && (enume = static_cast<const EnumNode *>(node))->flagsType()) {
-#ifdef GENERATE_MAC_REFS
- generateMacRef(enume->flagsType(), marker);
-#endif
- out() << "<h3 class=\"flags\" id=\"" << nodeRef << "\">";
- out() << "<a name=\"" + nodeRef + "\"></a>";
- generateSynopsis(enume, relative, marker, CodeMarker::Detailed);
- out() << "<br/>";
- generateSynopsis(enume->flagsType(),
- relative,
- marker,
- CodeMarker::Detailed);
- out() << "</h3>\n";
- }
- else {
- out() << "<h3 class=\"fn\" id=\"" << nodeRef << "\">";
- out() << "<a name=\"" + nodeRef + "\"></a>";
- generateSynopsis(node, relative, marker, CodeMarker::Detailed);
- out() << "</h3>" << divNavTop << '\n';
- }
-
- generateStatus(node, marker);
- generateBody(node, marker);
- generateThreadSafeness(node, marker);
- generateSince(node, marker);
-
- if (node->type() == Node::Property) {
- const PropertyNode *property = static_cast<const PropertyNode *>(node);
- Section section;
-
- section.members += property->getters();
- section.members += property->setters();
- section.members += property->resetters();
-
- if (!section.members.isEmpty()) {
- out() << "<p><b>Access functions:</b></p>\n";
- generateSectionList(section, node, marker, CodeMarker::Accessors);
- }
-
- Section notifiers;
- notifiers.members += property->notifiers();
-
- if (!notifiers.members.isEmpty()) {
- out() << "<p><b>Notifier signal:</b></p>\n";
- //out() << "<p>This signal is emitted when the property value is changed.</p>\n";
- generateSectionList(notifiers, node, marker, CodeMarker::Accessors);
- }
- }
- else if (node->isFunction()) {
- const FunctionNode* fn = static_cast<const FunctionNode*>(node);
- if (fn->isPrivateSignal())
- generatePrivateSignalNote(node, marker);
- }
- else if (node->type() == Node::Enum) {
- const EnumNode *enume = static_cast<const EnumNode *>(node);
- if (enume->flagsType()) {
- out() << "<p>The " << protectEnc(enume->flagsType()->name())
- << " type is a typedef for "
- << "<a href=\"" << qflagsHref_ << "\">QFlags</a>&lt;"
- << protectEnc(enume->name())
- << "&gt;. It stores an OR combination of "
- << protectEnc(enume->name())
- << " values.</p>\n";
- }
- }
- generateAlsoList(node, marker);
- generateExtractionMark(node, EndMark);
-}
-
-int HtmlGenerator::hOffset(const Node *node)
-{
- switch (node->type()) {
- case Node::Namespace:
- case Node::Class:
- return 2;
- case Node::QmlBasicType:
- case Node::QmlType:
- case Node::Document:
- return 1;
- case Node::Enum:
- case Node::Typedef:
- case Node::Function:
- case Node::Property:
- default:
- return 3;
- }
-}
-
-bool HtmlGenerator::isThreeColumnEnumValueTable(const Atom *atom)
-{
- while (atom != 0 && !(atom->type() == Atom::ListRight && atom->string() == ATOM_LIST_VALUE)) {
- if (atom->type() == Atom::ListItemLeft && !matchAhead(atom, Atom::ListItemRight))
- return true;
- atom = atom->next();
- }
- return false;
-}
-
-
-const QPair<QString,QString> HtmlGenerator::anchorForNode(const Node *node)
-{
- QPair<QString,QString> anchorPair;
-
- anchorPair.first = Generator::fileName(node);
- if (node->type() == Node::Document) {
- const DocumentNode *docNode = static_cast<const DocumentNode*>(node);
- anchorPair.second = docNode->title();
- }
-
- return anchorPair;
-}
-
-void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker)
-{
- Text text;
-
- switch (node->status()) {
- case Node::Obsolete:
- if (node->isInnerNode())
- Generator::generateStatus(node, marker);
- break;
- case Node::Compat:
- // Porting to Qt 4 no longer supported
- break;
- default:
- Generator::generateStatus(node, marker);
- }
-}
-
-#ifdef GENERATE_MAC_REFS
-/*
- No longer valid.
- */
-void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker)
-{
- if (!pleaseGenerateMacRef || marker == 0)
- return;
-
- QStringList macRefs = marker->macRefsForNode(node);
- foreach (const QString &macRef, macRefs)
- out() << "<a name=\"" << "//apple_ref/" << macRef << "\"></a>\n";
-}
-#endif
-
-void HtmlGenerator::beginLink(const QString &link, const Node *node, const Node *relative)
-{
- link_ = link;
- if (link_.isEmpty()) {
- if (showBrokenLinks)
- out() << "<i>";
- }
- else if (node == 0 ||
- (relative != 0 && node->status() == relative->status())) {
- out() << "<a href=\"" << link_ << "\">";
- }
- else {
- switch (node->status()) {
- case Node::Obsolete:
- out() << "<a href=\"" << link_ << "\" class=\"obsolete\">";
- break;
- case Node::Compat:
- out() << "<a href=\"" << link_ << "\" class=\"compat\">";
- break;
- default:
- out() << "<a href=\"" << link_ << "\">";
- }
- }
- inLink_ = true;
-}
-
-void HtmlGenerator::endLink()
-{
- if (inLink_) {
- if (link_.isEmpty()) {
- if (showBrokenLinks)
- out() << "</i>";
- }
- else {
- if (inObsoleteLink) {
- out() << "<sup>(obsolete)</sup>";
- }
- out() << "</a>";
- }
- }
- inLink_ = false;
- inObsoleteLink = false;
-}
-
-/*!
- Generates the summary for the \a section. Only used for
- sections of QML element documentation.
- */
-void HtmlGenerator::generateQmlSummary(const Section& section,
- const Node *relative,
- CodeMarker *marker)
-{
- if (!section.members.isEmpty()) {
- out() << "<ul>\n";
- NodeList::ConstIterator m;
- m = section.members.constBegin();
- while (m != section.members.constEnd()) {
- out() << "<li class=\"fn\">";
- generateQmlItem(*m,relative,marker,true);
- if ((*m)->type() == Node::QmlPropertyGroup) {
- const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(*m);
- if (!qpgn->childNodes().isEmpty()) {
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- out() << "<ul>\n";
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- out() << "<li class=\"fn\">";
- generateQmlItem(*p, relative, marker, true);
- out() << "</li>\n";
- }
- ++p;
- }
- out() << "</ul>\n";
- }
- }
- out() << "</li>\n";
- ++m;
- }
- out() << "</ul>\n";
- }
-}
-
-/*!
- Outputs the html detailed documentation for a section
- on a QML element reference page.
- */
-void HtmlGenerator::generateDetailedQmlMember(Node *node,
- const InnerNode *relative,
- CodeMarker *marker)
-{
- QmlPropertyNode* qpn = 0;
-#ifdef GENERATE_MAC_REFS
- generateMacRef(node, marker);
-#endif
- generateExtractionMark(node, MemberMark);
- generateKeywordAnchors(node);
- out() << "<div class=\"qmlitem\">";
- QString nodeRef = refForNode(node);
- if (node->type() == Node::QmlPropertyGroup) {
- const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(node);
- NodeList::ConstIterator p = qpgn->childNodes().constBegin();
- out() << "<div class=\"qmlproto\">";
- out() << "<div class=\"table\"><table class=\"qmlname\">";
-
- QString heading = qpgn->name() + " group";
- out() << "<tr valign=\"top\" class=\"even\" id=\"" << nodeRef << "\">";
- out() << "<th class=\"centerAlign\"><p>";
- out() << "<a name=\"" + nodeRef + "\"></a>";
- out() << "<b>" << heading << "</b>";
- out() << "</p></th></tr>";
- while (p != qpgn->childNodes().constEnd()) {
- if ((*p)->type() == Node::QmlProperty) {
- qpn = static_cast<QmlPropertyNode*>(*p);
- nodeRef = refForNode(qpn);
- out() << "<tr valign=\"top\" class=\"odd\" id=\"" << nodeRef << "\">";
- out() << "<td class=\"tblQmlPropNode\"><p>";
- out() << "<a name=\"" + nodeRef + "\"></a>";
-
- if (!qpn->isWritable())
- out() << "<span class=\"qmlreadonly\">read-only</span>";
- if (qpn->isDefault())
- out() << "<span class=\"qmldefault\">default</span>";
- generateQmlItem(qpn, relative, marker, false);
- out() << "</p></td></tr>";
- }
- ++p;
- }
- out() << "</table></div>";
- out() << "</div>";
- }
- else if (node->type() == Node::QmlProperty) {
- qpn = static_cast<QmlPropertyNode*>(node);
- out() << "<div class=\"qmlproto\">";
- out() << "<div class=\"table\"><table class=\"qmlname\">";
- out() << "<tr valign=\"top\" class=\"odd\" id=\"" << nodeRef << "\">";
- out() << "<td class=\"tblQmlPropNode\"><p>";
- out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
- if (!qpn->isReadOnlySet()) {
- if (qpn->declarativeCppNode())
- qpn->setReadOnly(!qpn->isWritable());
- }
- if (qpn->isReadOnly())
- out() << "<span class=\"qmlreadonly\">read-only</span>";
- if (qpn->isDefault())
- out() << "<span class=\"qmldefault\">default</span>";
- generateQmlItem(qpn, relative, marker, false);
- out() << "</p></td></tr>";
- out() << "</table></div>";
- out() << "</div>";
- }
- else if (node->type() == Node::QmlSignal) {
- const FunctionNode* qsn = static_cast<const FunctionNode*>(node);
- out() << "<div class=\"qmlproto\">";
- out() << "<div class=\"table\"><table class=\"qmlname\">";
- out() << "<tr valign=\"top\" class=\"odd\" id=\"" << nodeRef << "\">";
- out() << "<td class=\"tblQmlFuncNode\"><p>";
- out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
- generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
- out() << "</p></td></tr>";
- out() << "</table></div>";
- out() << "</div>";
- }
- else if (node->type() == Node::QmlSignalHandler) {
- const FunctionNode* qshn = static_cast<const FunctionNode*>(node);
- out() << "<div class=\"qmlproto\">";
- out() << "<div class=\"table\"><table class=\"qmlname\">";
- out() << "<tr valign=\"top\" class=\"odd\" id=\"" << nodeRef << "\">";
- out() << "<td class=\"tblQmlFuncNode\"><p>";
- out() << "<a name=\"" + refForNode(qshn) + "\"></a>";
- generateSynopsis(qshn,relative,marker,CodeMarker::Detailed,false);
- out() << "</p></td></tr>";
- out() << "</table></div>";
- out() << "</div>";
- }
- else if (node->type() == Node::QmlMethod) {
- const FunctionNode* qmn = static_cast<const FunctionNode*>(node);
- out() << "<div class=\"qmlproto\">";
- out() << "<div class=\"table\"><table class=\"qmlname\">";
- out() << "<tr valign=\"top\" class=\"odd\" id=\"" << nodeRef << "\">";
- out() << "<td class=\"tblQmlFuncNode\"><p>";
- out() << "<a name=\"" + refForNode(qmn) + "\"></a>";
- generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false);
- out() << "</p></td></tr>";
- out() << "</table></div>";
- out() << "</div>";
- }
- out() << "<div class=\"qmldoc\">";
- generateStatus(node, marker);
- generateBody(node, marker);
- generateThreadSafeness(node, marker);
- generateSince(node, marker);
- generateAlsoList(node, marker);
- out() << "</div>";
- out() << "</div>";
- generateExtractionMark(node, EndMark);
-}
-
-/*!
- Output the "Inherits" line for the QML element,
- if there should be one.
- */
-void HtmlGenerator::generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker)
-{
- if (!qcn)
- return;
- QmlTypeNode* base = qcn->qmlBaseNode();
- while (base && base->isInternal()) {
- base = base->qmlBaseNode();
- }
- if (base) {
- Text text;
- text << Atom::ParaLeft << "Inherits ";
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(base));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, base->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << Atom::ParaRight;
- generateText(text, qcn, marker);
- }
-}
-
-/*!
- Output the "[Xxx instantiates the C++ class QmlGraphicsXxx]"
- line for the QML element, if there should be one.
-
- If there is no class node, or if the class node status
- is set to Node::Internal, do nothing.
- */
-void HtmlGenerator::generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker)
-{
- ClassNode* cn = qcn->classNode();
- if (cn && (cn->status() != Node::Internal)) {
- Text text;
- text << Atom::ParaLeft;
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- QString name = qcn->name();
- /*
- Remove the "QML:" prefix, if present.
- It shouldn't be present anymore.
- */
- if (name.startsWith(QLatin1String("QML:")))
- name = name.mid(4); // remove the "QML:" prefix
- text << Atom(Atom::String, name);
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << " instantiates the C++ class ";
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, cn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << Atom::ParaRight;
- generateText(text, qcn, marker);
- }
-}
-
-/*!
- Output the "[QmlGraphicsXxx is instantiated by QML Type Xxx]"
- line for the class, if there should be one.
-
- If there is no QML element, or if the class node status
- is set to Node::Internal, do nothing.
- */
-void HtmlGenerator::generateInstantiatedBy(ClassNode* cn, CodeMarker* marker)
-{
- if (cn && cn->status() != Node::Internal && cn->qmlElement() != 0) {
- const QmlTypeNode* qcn = cn->qmlElement();
- Text text;
- text << Atom::ParaLeft;
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, cn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- if (qcn->isQmlType())
- text << " is instantiated by QML Type ";
- else
- text << " is instantiated by Javascript Type ";
- text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
- text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, qcn->name());
- text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
- text << Atom::ParaRight;
- generateText(text, cn, marker);
- }
-}
-
-void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType markType)
-{
- if (markType != EndMark) {
- out() << "<!-- $$$" + node->name();
- if (markType == MemberMark) {
- if (node->type() == Node::Function) {
- const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (!func->associatedProperty()) {
- if (func->overloadNumber() == 1)
- out() << "[overload1]";
- out() << "$$$" + func->name() + func->rawParameters().remove(' ');
- }
- } else if (node->type() == Node::Property) {
- out() << "-prop";
- const PropertyNode *prop = static_cast<const PropertyNode *>(node);
- const NodeList &list = prop->functions();
- foreach (const Node *propFuncNode, list) {
- if (propFuncNode->type() == Node::Function) {
- const FunctionNode *func = static_cast<const FunctionNode *>(propFuncNode);
- out() << "$$$" + func->name() + func->rawParameters().remove(' ');
- }
- }
- } else if (node->type() == Node::Enum) {
- const EnumNode *enumNode = static_cast<const EnumNode *>(node);
- foreach (const EnumItem &item, enumNode->items())
- out() << "$$$" + item.name();
- }
- } else if (markType == BriefMark) {
- out() << "-brief";
- } else if (markType == DetailedDescriptionMark) {
- out() << "-description";
- }
- out() << " -->\n";
- } else {
- out() << "<!-- @@@" + node->name() + " -->\n";
- }
-}
-
-
-/*!
- This function outputs one or more manifest files in XML.
- They are used by Creator.
- */
-void HtmlGenerator::generateManifestFiles()
-{
- generateManifestFile("examples", "example");
- generateManifestFile("demos", "demo");
- qdb_->exampleNodeMap().clear();
- manifestMetaContent.clear();
-}
-
-/*!
- This function is called by generateManifestFiles(), once
- for each manifest file to be generated. \a manifest is the
- type of manifest file.
- */
-void HtmlGenerator::generateManifestFile(const QString &manifest, const QString &element)
-{
- ExampleNodeMap& exampleNodeMap = qdb_->exampleNodeMap();
- if (exampleNodeMap.isEmpty())
- return;
- QString fileName = manifest +"-manifest.xml";
- QFile file(outputDir() + QLatin1Char('/') + fileName);
- bool demos = false;
- if (manifest == "demos")
- demos = true;
-
- bool proceed = false;
- ExampleNodeMap::Iterator i = exampleNodeMap.begin();
- while (i != exampleNodeMap.end()) {
- const ExampleNode* en = i.value();
- if (demos) {
- if (en->name().startsWith("demos")) {
- proceed = true;
- break;
- }
- }
- else if (!en->name().startsWith("demos")) {
- proceed = true;
- break;
- }
- ++i;
- }
- if (!proceed || !file.open(QFile::WriteOnly | QFile::Text))
- return;
-
- QXmlStreamWriter writer(&file);
- writer.setAutoFormatting(true);
- writer.writeStartDocument();
- writer.writeStartElement("instructionals");
- writer.writeAttribute("module", project);
- writer.writeStartElement(manifest);
-
- QStringList usedAttributes;
- i = exampleNodeMap.begin();
- while (i != exampleNodeMap.end()) {
- const ExampleNode* en = i.value();
- if (demos) {
- if (!en->name().startsWith("demos")) {
- ++i;
- continue;
- }
- }
- else if (en->name().startsWith("demos")) {
- ++i;
- continue;
- }
- // attributes that are always written for the element
- usedAttributes.clear();
- usedAttributes << "name" << "docUrl" << "projectPath";
-
- writer.writeStartElement(element);
- writer.writeAttribute("name", en->title());
- QString docUrl = manifestDir + fileBase(en) + ".html";
- writer.writeAttribute("docUrl", docUrl);
- QStringList proFiles;
- foreach (const Node* child, en->childNodes()) {
- if (child->subType() == Node::File) {
- QString file = child->name();
- if (file.endsWith(".pro") || file.endsWith(".qmlproject")) {
- proFiles << file;
- }
- }
- }
- if (!proFiles.isEmpty()) {
- if (proFiles.size() == 1) {
- writer.writeAttribute("projectPath", examplesPath + proFiles[0]);
- }
- else {
- QString exampleName = en->name().split('/').last();
- bool proWithExampleNameFound = false;
- for (int j = 0; j < proFiles.size(); j++)
- {
- if (proFiles[j].endsWith(QStringLiteral("%1/%1.pro").arg(exampleName))
- || proFiles[j].endsWith(QStringLiteral("%1/%1.qmlproject").arg(exampleName))) {
- writer.writeAttribute("projectPath", examplesPath + proFiles[j]);
- proWithExampleNameFound = true;
- break;
- }
- }
- if (!proWithExampleNameFound)
- writer.writeAttribute("projectPath", examplesPath + proFiles[0]);
- }
- }
- if (!en->imageFileName().isEmpty()) {
- writer.writeAttribute("imageUrl", manifestDir + en->imageFileName());
- usedAttributes << "imageUrl";
- }
-
- QString fullName = project + QLatin1Char('/') + en->title();
- QSet<QString> tags;
- for (int idx=0; idx < manifestMetaContent.size(); ++idx) {
- foreach (const QString &name, manifestMetaContent[idx].names) {
- bool match = false;
- int wildcard = name.indexOf(QChar('*'));
- switch (wildcard) {
- case -1: // no wildcard, exact match
- match = (fullName == name);
- break;
- case 0: // '*' matches all
- match = true;
- break;
- default: // match with wildcard at the end
- match = fullName.startsWith(name.left(wildcard));
- }
- if (match) {
- tags += manifestMetaContent[idx].tags;
- foreach (const QString &attr, manifestMetaContent[idx].attributes) {
- QLatin1Char div(':');
- QStringList attrList = attr.split(div);
- if (attrList.count() == 1)
- attrList.append(QStringLiteral("true"));
- QString attrName = attrList.takeFirst();
- if (!usedAttributes.contains(attrName)) {
- writer.writeAttribute(attrName, attrList.join(div));
- usedAttributes << attrName;
- }
- }
- }
- }
- }
-
- writer.writeStartElement("description");
- Text brief = en->doc().briefText();
- if (!brief.isEmpty())
- writer.writeCDATA(brief.toString());
- else
- writer.writeCDATA(QString("No description available"));
- writer.writeEndElement(); // description
-
- // Add words from module name as tags
- // QtQuickControls -> qt,quick,controls
- // QtOpenGL -> qt,opengl
- QRegExp re("([A-Z]+[a-z0-9]*(3D|GL)?)");
- int pos = 0;
- while ((pos = re.indexIn(project, pos)) != -1) {
- tags << re.cap(1).toLower();
- pos += re.matchedLength();
- }
- tags += QSet<QString>::fromList(en->title().toLower().split(QLatin1Char(' ')));
-
- // Clean up tags, exclude invalid and common words
- QSet<QString>::iterator tag_it = tags.begin();
- QSet<QString> modified;
- while (tag_it != tags.end()) {
- QString s = *tag_it;
- if (s.at(0) == '(')
- s.remove(0, 1).chop(1);
- if (s.endsWith(QLatin1Char(':')))
- s.chop(1);
-
- if (s.length() < 2
- || s.at(0).isDigit()
- || s.at(0) == '-'
- || s == QStringLiteral("qt")
- || s == QStringLiteral("the")
- || s == QStringLiteral("and")
- || s.startsWith(QStringLiteral("example"))
- || s.startsWith(QStringLiteral("chapter")))
- tag_it = tags.erase(tag_it);
- else if (s != *tag_it) {
- modified << s;
- tag_it = tags.erase(tag_it);
- }
- else
- ++tag_it;
- }
- tags += modified;
-
- if (!tags.isEmpty()) {
- writer.writeStartElement("tags");
- bool wrote_one = false;
- foreach (QString tag, tags) {
- if (wrote_one)
- writer.writeCharacters(",");
- writer.writeCharacters(tag);
- wrote_one = true;
- }
- writer.writeEndElement(); // tags
- }
-
- QString ename = en->name().mid(en->name().lastIndexOf('/')+1);
- QMap<int, const Node*> filesToOpen;
- foreach (const Node* child, en->childNodes()) {
- if (child->subType() == Node::File) {
- QFileInfo fileInfo(child->name());
- QString fileName = fileInfo.fileName().toLower();
- // open .qml, .cpp and .h files with a
- // basename matching the example (project) name
- // QMap key indicates the priority -
- // the lowest value will be the top-most file
- if ((fileInfo.baseName().compare(ename, Qt::CaseInsensitive) == 0)) {
- if (fileName.endsWith(".qml"))
- filesToOpen.insert(0, child);
- else if (fileName.endsWith(".cpp"))
- filesToOpen.insert(1, child);
- else if (fileName.endsWith(".h"))
- filesToOpen.insert(2, child);
- }
- // main.qml takes precedence over main.cpp
- else if (fileName.endsWith("main.qml")) {
- filesToOpen.insert(3, child);
- }
- else if (fileName.endsWith("main.cpp")) {
- filesToOpen.insert(4, child);
- }
- }
- }
-
- QMap<int, const Node*>::const_iterator it = filesToOpen.constEnd();
- while (it != filesToOpen.constBegin()) {
- writer.writeStartElement("fileToOpen");
- if (--it == filesToOpen.constBegin()) {
- writer.writeAttribute(QStringLiteral("mainFile"), QStringLiteral("true"));
- }
- writer.writeCharacters(examplesPath + it.value()->name());
- writer.writeEndElement();
- }
-
- writer.writeEndElement(); // example
- ++i;
- }
-
- writer.writeEndElement(); // examples
- writer.writeEndElement(); // instructionals
- writer.writeEndDocument();
- file.close();
-}
-
-/*!
- Reads metacontent - additional attributes and tags to apply
- when generating manifest files, read from config. Takes the
- configuration class \a config as a parameter.
-
- The manifest metacontent map is cleared immediately after
- the manifest files have been generated.
- */
-void HtmlGenerator::readManifestMetaContent(const Config &config)
-{
- QStringList names = config.getStringList(CONFIG_MANIFESTMETA + Config::dot + QStringLiteral("filters"));
-
- foreach (const QString &manifest, names) {
- ManifestMetaFilter filter;
- QString prefix = CONFIG_MANIFESTMETA + Config::dot + manifest + Config::dot;
- filter.names = config.getStringSet(prefix + QStringLiteral("names"));
- filter.attributes = config.getStringSet(prefix + QStringLiteral("attributes"));
- filter.tags = config.getStringSet(prefix + QStringLiteral("tags"));
- manifestMetaContent.append(filter);
- }
-}
-
-/*!
- Find global entities that have documentation but no
- \e{relates} comand. Report these as errors if they
- are not also marked \e {internal}.
-
- type: Class
- type: Namespace
-
- subtype: Example
- subtype: External page
- subtype: Group
- subtype: Header file
- subtype: Module
- subtype: Page
- subtype: QML basic type
- subtype: QML class
- subtype: QML module
- */
-void HtmlGenerator::reportOrphans(const InnerNode* parent)
-{
- const NodeList& children = parent->childNodes();
- if (children.size() == 0)
- return;
-
- bool related;
- QString message;
- for (int i=0; i<children.size(); ++i) {
- Node* child = children[i];
- if (!child || child->isInternal() || child->doc().isEmpty())
- continue;
- if (child->relates()) {
- related = true;
- message = child->relates()->name();
- }
- else {
- related = false;
- message = "has documentation but no \\relates command";
- }
- switch (child->type()) {
- case Node::Namespace:
- break;
- case Node::Class:
- break;
- case Node::QmlType:
- break;
- case Node::QmlBasicType:
- break;
- case Node::Group:
- break;
- case Node::Module:
- break;
- case Node::QmlModule:
- break;
- case Node::Document:
- switch (child->subType()) {
- case Node::Example:
- break;
- case Node::HeaderFile:
- break;
- case Node::File:
- break;
- case Node::Image:
- break;
- case Node::Page:
- break;
- case Node::ExternalPage:
- break;
- default:
- break;
- }
- break;
- case Node::Enum:
- if (!related)
- child->location().warning(tr("Global enum, %1, %2").arg(child->name()).arg(message));
- break;
- case Node::Typedef:
- if (!related)
- child->location().warning(tr("Global typedef, %1, %2").arg(child->name()).arg(message));
- break;
- case Node::Function:
- if (!related) {
- const FunctionNode* fn = static_cast<const FunctionNode*>(child);
- if (fn->isMacro())
- child->location().warning(tr("Global macro, %1, %2").arg(child->name()).arg(message));
- else
- child->location().warning(tr("Global function, %1(), %2").arg(child->name()).arg(message));
- }
- break;
- case Node::Property:
- break;
- case Node::Variable:
- if (!related)
- child->location().warning(tr("Global variable, %1, %2").arg(child->name()).arg(message));
- break;
- case Node::QmlPropertyGroup:
- break;
- case Node::QmlProperty:
- if (!related)
- child->location().warning(tr("Global QML property, %1, %2").arg(child->name()).arg(message));
- break;
- case Node::QmlSignal:
- if (!related)
- child->location().warning(tr("Global QML, signal, %1 %2").arg(child->name()).arg(message));
- break;
- case Node::QmlSignalHandler:
- if (!related)
- child->location().warning(tr("Global QML signal handler, %1, %2").arg(child->name()).arg(message));
- break;
- case Node::QmlMethod:
- if (!related)
- child->location().warning(tr("Global QML method, %1, %2").arg(child->name()).arg(message));
- break;
- default:
- break;
- }
- }
-}
-
-/*!
- Returns a reference to the XML stream writer currently in use.
- There is one XML stream writer open for each XML file being
- written, and they are kept on a stack. The one on top of the
- stack is the one being written to at the moment. In the HTML
- output generator, it is perhaps impossible for there to ever
- be more than one writer open.
- */
-QXmlStreamWriter& HtmlGenerator::xmlWriter()
-{
- return *xmlWriterStack.top();
-}
-
-/*!
- This function is only called for writing ditamaps.
-
- Calls beginSubPage() in the base class to open the file.
- Then creates a new XML stream writer using the IO device
- from opened file and pushes the XML writer onto a stackj.
- Creates the file named \a fileName in the output directory.
- Attaches a QTextStream to the created file, which is written
- to all over the place using out(). Finally, it sets some
- parameters in the XML writer and calls writeStartDocument().
-
- It also ensures that a GUID map is created for the output file.
- */
-void HtmlGenerator::beginDitamapPage(const InnerNode* node, const QString& fileName)
-{
- Generator::beginSubPage(node,fileName);
- QXmlStreamWriter* writer = new QXmlStreamWriter(out().device());
- xmlWriterStack.push(writer);
- writer->setAutoFormatting(true);
- writer->setAutoFormattingIndent(4);
- writer->writeStartDocument();
-}
-
-/*!
- This function is only called for writing ditamaps.
-
- Calls writeEndDocument() and then pops the XML stream writer
- off the stack and deletes it. Then it calls endSubPage() in
- the base class to close the device.
- */
-void HtmlGenerator::endDitamapPage()
-{
- xmlWriter().writeEndDocument();
- delete xmlWriterStack.pop();
- Generator::endSubPage();
-}
-
-/*!
- This function is only called for writing ditamaps.
-
- Creates the DITA map from the topicrefs in \a node,
- which is a DitaMapNode.
- */
-void HtmlGenerator::writeDitaMap(const DitaMapNode* node)
-{
- beginDitamapPage(node,node->name());
-
- QString doctype = "<!DOCTYPE map PUBLIC \"-//OASIS//DTD DITA Map//EN\" \"map.dtd\">";
-
- xmlWriter().writeDTD(doctype);
- xmlWriter().writeStartElement("map");
- xmlWriter().writeStartElement("topicmeta");
- xmlWriter().writeStartElement("shortdesc");
- xmlWriter().writeCharacters(node->title());
- xmlWriter().writeEndElement(); // </shortdesc>
- xmlWriter().writeEndElement(); // </topicmeta>
- DitaRefList map = node->map();
- writeDitaRefs(map);
- endDitamapPage();
-}
-
-/*!
- Write the \a ditarefs to the current output file.
- */
-void HtmlGenerator::writeDitaRefs(const DitaRefList& ditarefs)
-{
- foreach (DitaRef* t, ditarefs) {
- if (t->isMapRef())
- xmlWriter().writeStartElement("mapref");
- else
- xmlWriter().writeStartElement("topicref");
- xmlWriter().writeAttribute("navtitle",t->navtitle());
- if (t->href().isEmpty()) {
- const DocumentNode* dn = qdb_->findDocumentNodeByTitle(t->navtitle());
- if (dn)
- xmlWriter().writeAttribute("href",fileName(dn));
- }
- else
- xmlWriter().writeAttribute("href",t->href());
- if (t->subrefs() && !t->subrefs()->isEmpty())
- writeDitaRefs(*(t->subrefs()));
- xmlWriter().writeEndElement(); // </topicref> or </mapref>
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
deleted file mode 100644
index 4a2e158252..0000000000
--- a/src/tools/qdoc/htmlgenerator.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- htmlgenerator.h
-*/
-
-#ifndef HTMLGENERATOR_H
-#define HTMLGENERATOR_H
-
-#include <qmap.h>
-#include <qregexp.h>
-#include <qxmlstream.h>
-#include "codemarker.h"
-#include "config.h"
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-class HelpProjectWriter;
-
-class HtmlGenerator : public Generator
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::HtmlGenerator)
-
-public:
- enum SinceType {
- Namespace,
- Class,
- MemberFunction,
- NamespaceFunction,
- GlobalFunction,
- Macro,
- Enum,
- Typedef,
- Property,
- Variable,
- QmlClass,
- QmlProperty,
- QmlSignal,
- QmlSignalHandler,
- QmlMethod,
- LastSinceType
- };
-
-public:
- HtmlGenerator();
- ~HtmlGenerator();
-
- virtual void initializeGenerator(const Config& config) Q_DECL_OVERRIDE;
- virtual void terminateGenerator() Q_DECL_OVERRIDE;
- virtual QString format() Q_DECL_OVERRIDE;
- virtual void generateDocs() Q_DECL_OVERRIDE;
- void generateManifestFiles();
-
- QString protectEnc(const QString &string);
- static QString protect(const QString &string, const QString &encoding = "ISO-8859-1");
- static QString sinceTitle(int i) { return sinceTitles[i]; }
-
-protected:
- virtual void generateQAPage() Q_DECL_OVERRIDE;
- QString generateLinksToLinksPage(const QString& module, CodeMarker* marker);
- QString generateLinksToBrokenLinksPage(CodeMarker* marker, int& count);
- virtual int generateAtom(const Atom *atom,
- const Node *relative,
- CodeMarker *marker) Q_DECL_OVERRIDE;
- virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker) Q_DECL_OVERRIDE;
- virtual void generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
- virtual void generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker) Q_DECL_OVERRIDE;
- virtual void generateDocumentNode(DocumentNode* dn, CodeMarker* marker) Q_DECL_OVERRIDE;
- virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker) Q_DECL_OVERRIDE;
- virtual QString fileExtension() const Q_DECL_OVERRIDE;
- virtual QString refForNode(const Node *node);
- virtual QString linkForNode(const Node *node, const Node *relative);
-
- void generateManifestFile(const QString &manifest, const QString &element);
- void readManifestMetaContent(const Config &config);
- void generateKeywordAnchors(const Node* node);
-
-private:
- enum SubTitleSize { SmallSubTitle, LargeSubTitle };
- enum ExtractionMarkType {
- BriefMark,
- DetailedDescriptionMark,
- MemberMark,
- EndMark
- };
-
- struct ManifestMetaFilter
- {
- QSet<QString> names;
- QSet<QString> attributes;
- QSet<QString> tags;
- };
-
- const QPair<QString,QString> anchorForNode(const Node *node);
- void generateNavigationBar(const QString& title,
- const Node *node,
- CodeMarker *marker);
- void generateHeader(const QString& title,
- const Node *node = 0,
- CodeMarker *marker = 0);
- void generateTitle(const QString& title,
- const Text &subTitle,
- SubTitleSize subTitleSize,
- const Node *relative,
- CodeMarker *marker);
- void generateFooter(const Node *node = 0);
- void generateRequisites(InnerNode *inner,
- CodeMarker *marker);
- void generateQmlRequisites(QmlTypeNode *qcn,
- CodeMarker *marker);
- void generateBrief(const Node *node,
- CodeMarker *marker,
- const Node *relative = 0);
- void generateIncludes(const InnerNode *inner, CodeMarker *marker);
- void generateTableOfContents(const Node *node,
- CodeMarker *marker,
- QList<Section>* sections = 0);
- void generateSidebar();
- QString generateListOfAllMemberFile(const InnerNode *inner,
- CodeMarker *marker);
- QString generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker);
- QString generateLowStatusMemberFile(InnerNode *inner,
- CodeMarker *marker,
- CodeMarker::Status status);
- QString generateQmlMemberFile(QmlTypeNode* qcn,
- CodeMarker *marker,
- CodeMarker::Status status);
- void generateClassHierarchy(const Node *relative, NodeMap &classMap);
- void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMultiMap& nodeMap);
- void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeList& nodes);
- void generateCompactList(ListType listType,
- const Node *relative,
- const NodeMultiMap &classMap,
- bool includeAlphabet,
- QString commonPrefix);
- void generateFunctionIndex(const Node *relative);
- void generateLegaleseList(const Node *relative, CodeMarker *marker);
- void generateList(const Node* relative, CodeMarker* marker, const QString& selector);
- void generateSectionList(const Section& section,
- const Node *relative,
- CodeMarker *marker,
- CodeMarker::SynopsisStyle style);
- void generateQmlSummary(const Section& section,
- const Node *relative,
- CodeMarker *marker);
- void generateQmlItem(const Node *node,
- const Node *relative,
- CodeMarker *marker,
- bool summary);
- void generateDetailedQmlMember(Node *node,
- const InnerNode *relative,
- CodeMarker *marker);
- void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
- void generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker);
- void generateInstantiatedBy(ClassNode* cn, CodeMarker* marker);
-
- void generateRequisitesTable(const QStringList& requisitesOrder, QMap<QString, Text>& requisites);
- void generateSection(const NodeList& nl,
- const Node *relative,
- CodeMarker *marker,
- CodeMarker::SynopsisStyle style);
- void generateSynopsis(const Node *node,
- const Node *relative,
- CodeMarker *marker,
- CodeMarker::SynopsisStyle style,
- bool alignNames = false,
- const QString* prefix = 0);
- void generateSectionInheritedList(const Section& section, const Node *relative);
- QString highlightedCode(const QString& markedCode,
- const Node* relative,
- bool alignNames = false);
-
- void generateFullName(const Node *apparentNode, const Node *relative, const Node *actualNode = 0);
- void generateDetailedMember(const Node *node,
- const InnerNode *relative,
- CodeMarker *marker);
- void generateLink(const Atom *atom, CodeMarker *marker);
- void generateStatus(const Node *node, CodeMarker *marker);
-
- QString getLink(const Atom *atom, const Node *relative, const Node** node);
- QString getAutoLink(const Atom *atom, const Node *relative, const Node** node);
-
- QString registerRef(const QString& ref);
- virtual QString fileBase(const Node *node) const Q_DECL_OVERRIDE;
- QString fileName(const Node *node);
- static int hOffset(const Node *node);
- static bool isThreeColumnEnumValueTable(const Atom *atom);
-#ifdef GENERATE_MAC_REFS
- void generateMacRef(const Node *node, CodeMarker *marker);
-#endif
- void beginLink(const QString &link, const Node *node, const Node *relative);
- void endLink();
- void generateExtractionMark(const Node *node, ExtractionMarkType markType);
- void reportOrphans(const InnerNode* parent);
-
- void beginDitamapPage(const InnerNode* node, const QString& fileName);
- void endDitamapPage();
- void writeDitaMap(const DitaMapNode* node);
- void writeDitaRefs(const DitaRefList& ditarefs);
- QXmlStreamWriter& xmlWriter();
-
- QMap<QString, QString> refMap;
- int codeIndent;
- HelpProjectWriter *helpProjectWriter;
- bool inObsoleteLink;
- QRegExp funcLeftParen;
- QString style;
- QString headerScripts;
- QString headerStyles;
- QString endHeader;
- QString postHeader;
- QString postPostHeader;
- QString prologue;
- QString footer;
- QString address;
- bool pleaseGenerateMacRef;
- bool noNavigationBar;
- QString project;
- QString projectDescription;
- QString projectUrl;
- QString navigationLinks;
- QString manifestDir;
- QString examplesPath;
- QStringList stylesheets;
- QStringList customHeadElements;
- bool obsoleteLinks;
- QStack<QXmlStreamWriter*> xmlWriterStack;
- static int id;
- QList<ManifestMetaFilter> manifestMetaContent;
- QString homepage;
- QString landingpage;
- QString cppclassespage;
- QString qmltypespage;
- QString buildversion;
- QString qflagsHref_;
- int tocDepth;
-
-public:
- static bool debugging_on;
- static QString divNavTop;
-};
-
-#define HTMLGENERATOR_ADDRESS "address"
-#define HTMLGENERATOR_FOOTER "footer"
-#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me
-#define HTMLGENERATOR_POSTHEADER "postheader"
-#define HTMLGENERATOR_POSTPOSTHEADER "postpostheader"
-#define HTMLGENERATOR_PROLOGUE "prologue"
-#define HTMLGENERATOR_NONAVIGATIONBAR "nonavigationbar"
-#define HTMLGENERATOR_NOSUBDIRS "nosubdirs"
-#define HTMLGENERATOR_TOCDEPTH "tocdepth"
-
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/jscodemarker.cpp b/src/tools/qdoc/jscodemarker.cpp
deleted file mode 100644
index 2538b46433..0000000000
--- a/src/tools/qdoc/jscodemarker.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- jscodemarker.cpp
-*/
-
-#include "qqmljsast_p.h"
-#include "qqmljsengine_p.h"
-#include "qqmljslexer_p.h"
-#include "qqmljsparser_p.h"
-
-#include "atom.h"
-#include "node.h"
-#include "jscodemarker.h"
-#include "qmlmarkupvisitor.h"
-#include "text.h"
-#include "tree.h"
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-JsCodeMarker::JsCodeMarker()
-{
-}
-
-JsCodeMarker::~JsCodeMarker()
-{
-}
-
-/*!
- Returns \c true if the \a code is recognized by the parser.
- */
-bool JsCodeMarker::recognizeCode(const QString &code)
-{
- QQmlJS::Engine engine;
- QQmlJS::Lexer lexer(&engine);
- QQmlJS::Parser parser(&engine);
-
- QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
- lexer.setCode(newCode, 1);
-
- return parser.parseProgram();
-}
-
-/*!
- Returns \c true if \a ext is any of a list of file extensions
- for the QML language.
- */
-bool JsCodeMarker::recognizeExtension(const QString &ext)
-{
- return ext == "js" || ext == "json";
-}
-
-/*!
- Returns \c true if the \a language is recognized. We recognize JavaScript,
- ECMAScript and JSON.
- */
-bool JsCodeMarker::recognizeLanguage(const QString &language)
-{
- return language == "JavaScript" || language == "ECMAScript" || language == "JSON";
-}
-
-/*!
- Returns the type of atom used to represent JavaScript code in the documentation.
-*/
-Atom::Type JsCodeMarker::atomType() const
-{
- return Atom::JavaScript;
-}
-
-QString JsCodeMarker::markedUpCode(const QString &code,
- const Node *relative,
- const Location &location)
-{
- return addMarkUp(code, relative, location);
-}
-
-QString JsCodeMarker::addMarkUp(const QString &code,
- const Node * /* relative */,
- const Location &location)
-{
- QQmlJS::Engine engine;
- QQmlJS::Lexer lexer(&engine);
-
- QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
- lexer.setCode(newCode, 1);
-
- QQmlJS::Parser parser(&engine);
- QString output;
-
- if (parser.parseProgram()) {
- QQmlJS::AST::Node *ast = parser.rootNode();
- // Pass the unmodified code to the visitor so that pragmas and other
- // unhandled source text can be output.
- QmlMarkupVisitor visitor(code, pragmas, &engine);
- QQmlJS::AST::Node::accept(ast, &visitor);
- output = visitor.markedUpCode();
- } else {
- location.warning(location.fileName() +
- tr("Unable to parse JavaScript: \"%1\" at line %2, column %3").arg(
- parser.errorMessage()).arg(parser.errorLineNumber()).arg(
- parser.errorColumnNumber()));
- output = protect(code);
- }
- return output;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/jscodemarker.h b/src/tools/qdoc/jscodemarker.h
deleted file mode 100644
index d9f6eb5a10..0000000000
--- a/src/tools/qdoc/jscodemarker.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- jscodemarker.h
-*/
-
-#ifndef JSCODEMARKER_H
-#define JSCODEMARKER_H
-
-#include "qmlcodemarker.h"
-
-QT_BEGIN_NAMESPACE
-
-class JsCodeMarker : public QmlCodeMarker
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::JsCodeMarker)
-
-public:
- JsCodeMarker();
- ~JsCodeMarker();
-
- virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE;
- virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE;
- virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE;
- virtual Atom::Type atomType() const Q_DECL_OVERRIDE;
-
- virtual QString markedUpCode(const QString &code,
- const Node *relative,
- const Location &location) Q_DECL_OVERRIDE;
-
-private:
- QString addMarkUp(const QString &code, const Node *relative,
- const Location &location);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/location.cpp b/src/tools/qdoc/location.cpp
deleted file mode 100644
index 5eba2a69ef..0000000000
--- a/src/tools/qdoc/location.cpp
+++ /dev/null
@@ -1,439 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qdebug.h>
-#include "config.h"
-#include "location.h"
-#include "generator.h"
-#include <qdir.h>
-#include <qregexp.h>
-#include <stdlib.h>
-#include <limits.h>
-
-#include <stdio.h>
-
-QT_BEGIN_NAMESPACE
-
-const Location Location::null;
-
-int Location::tabSize;
-QString Location::programName;
-QRegExp *Location::spuriousRegExp = 0;
-bool Location::logProgress_ = false;
-
-/*!
- \class Location
-
- \brief The Location class provides a way to mark a location in a file.
-
- It maintains a stack of file positions. A file position
- consists of the file path, line number, and column number.
- The location is used for printing error messages that are
- tied to a location in a file.
- */
-
-/*!
- Constructs an empty location.
- */
-Location::Location()
- : stk(0), stkTop(&stkBottom), stkDepth(0), etcetera(false)
-{
- // nothing.
-}
-
-/*!
- Constructs a location with (fileName, 1, 1) on its file
- position stack.
- */
-Location::Location(const QString& fileName)
- : stk(0), stkTop(&stkBottom), stkDepth(0), etcetera(false)
-{
- push(fileName);
-}
-
-/*!
- The copy constructor copies the contents of \a other into
- this Location using the assignment operator.
- */
-Location::Location(const Location& other)
- : stk(0), stkTop(&stkBottom), stkDepth(0), etcetera(false)
-{
- *this = other;
-}
-
-/*!
- The assignment operator does a deep copy of the entire
- state of \a other into this Location.
- */
-Location& Location::operator=(const Location& other)
-{
- QStack<StackEntry> *oldStk = stk;
-
- stkBottom = other.stkBottom;
- if (other.stk == 0) {
- stk = 0;
- stkTop = &stkBottom;
- }
- else {
- stk = new QStack<StackEntry>(*other.stk);
- stkTop = &stk->top();
- }
- stkDepth = other.stkDepth;
- etcetera = other.etcetera;
- delete oldStk;
- return *this;
-}
-
-/*!
- If the file position on top of the stack has a line number
- less than 1, set its line number to 1 and its column number
- to 1. Otherwise, do nothing.
- */
-void Location::start()
-{
- if (stkTop->lineNo < 1) {
- stkTop->lineNo = 1;
- stkTop->columnNo = 1;
- }
-}
-
-/*!
- Advance the current file position, using \a ch to decide how to do
- that. If \a ch is a \c{'\\n'}, increment the current line number and
- set the column number to 1. If \ch is a \c{'\\t'}, increment to the
- next tab column. Otherwise, increment the column number by 1.
-
- The current file position is the one on top of the position stack.
- */
-void Location::advance(QChar ch)
-{
- if (ch == QLatin1Char('\n')) {
- stkTop->lineNo++;
- stkTop->columnNo = 1;
- }
- else if (ch == QLatin1Char('\t')) {
- stkTop->columnNo =
- 1 + tabSize * (stkTop->columnNo + tabSize-1) / tabSize;
- }
- else {
- stkTop->columnNo++;
- }
-}
-
-/*!
- Pushes \a filePath onto the file position stack. The current
- file position becomes (\a filePath, 1, 1).
-
- \sa pop()
-*/
-void Location::push(const QString& filePath)
-{
- if (stkDepth++ >= 1) {
- if (stk == 0)
- stk = new QStack<StackEntry>;
- stk->push(StackEntry());
- stkTop = &stk->top();
- }
-
- stkTop->filePath = filePath;
- stkTop->lineNo = INT_MIN;
- stkTop->columnNo = 1;
-}
-
-/*!
- Pops the top of the internal stack. The current file position
- becomes the next one in the new top of stack.
-
- \sa push()
-*/
-void Location::pop()
-{
- if (--stkDepth == 0) {
- stkBottom = StackEntry();
- }
- else {
- stk->pop();
- if (stk->isEmpty()) {
- delete stk;
- stk = 0;
- stkTop = &stkBottom;
- }
- else {
- stkTop = &stk->top();
- }
- }
-}
-
-/*! \fn bool Location::isEmpty() const
-
- Returns \c true if there is no file name set yet; returns \c false
- otherwise. The functions filePath(), lineNo() and columnNo()
- must not be called on an empty Location object.
- */
-
-/*! \fn const QString& Location::filePath() const
- Returns the current path and file name.
- Must not be called on an empty Location object.
-
- \sa lineNo(), columnNo()
- */
-
-/*!
- Returns the file name part of the file path, ie the
- current file. Must not be called on an empty Location
- object.
- */
-QString Location::fileName() const
-{
- QString fp = filePath();
- return fp.mid(fp.lastIndexOf('/') + 1);
-}
-
-
-/*!
- \brief Returns \a path which is canonicalized and relative to the config file.
-
- QDir::relativeFilePath does not canonicalize the paths, so
- if the config file is located at qtbase\src\widgets\doc\qtwidgets.qdocconf
- and it has a reference to any ancestor folder (e.g. ".." or even "../doc")
- */
-QString Location::canonicalRelativePath(const QString &path)
-{
- QDir configFileDir(QDir::current());
- QDir dir(path);
- const QString canon = dir.canonicalPath();
- return configFileDir.relativeFilePath(canon);
-}
-
-/*! \fn int Location::lineNo() const
- Returns the current line number.
- Must not be called on an empty Location object.
-
- \sa filePath(), columnNo()
-*/
-
-/*! \fn int Location::columnNo() const
- Returns the current column number.
- Must not be called on an empty Location object.
-
- \sa filePath(), lineNo()
-*/
-
-/*!
- Writes \a message and \a detals to stderr as a formatted
- warning message. Does not write the message if qdoc is in
- the Prepare phase.
- */
-void Location::warning(const QString& message, const QString& details) const
-{
- if (!Generator::preparing() || Generator::singleExec())
- emitMessage(Warning, message, details);
-}
-
-/*!
- Writes \a message and \a detals to stderr as a formatted
- error message. Does not write the message if qdoc is in
- the Prepare phase.
- */
-void Location::error(const QString& message, const QString& details) const
-{
- if (!Generator::preparing() || Generator::singleExec())
- emitMessage(Error, message, details);
-}
-
-/*!
- Writes \a message and \a detals to stderr as a formatted
- error message and then exits the program. qdoc prints fatal
- errors in either phase (Prepare or Generate).
- */
-void Location::fatal(const QString& message, const QString& details) const
-{
- emitMessage(Error, message, details);
- information(message);
- information(details);
- information("Aborting");
- exit(EXIT_FAILURE);
-}
-
-/*!
- Writes \a message and \a detals to stderr as a formatted
- report message.
- */
-void Location::report(const QString& message, const QString& details) const
-{
- emitMessage(Report, message, details);
-}
-
-/*!
- Gets several parameters from the \a config, including
- tab size, program name, and a regular expression that
- appears to be used for matching certain error messages
- so that emitMessage() can avoid printing them.
- */
-void Location::initialize(const Config& config)
-{
- tabSize = config.getInt(CONFIG_TABSIZE);
- programName = config.programName();
-
- QRegExp regExp = config.getRegExp(CONFIG_SPURIOUS);
- if (regExp.isValid()) {
- spuriousRegExp = new QRegExp(regExp);
- }
- else {
- config.lastLocation().warning(tr("Invalid regular expression '%1'")
- .arg(regExp.pattern()));
- }
-}
-
-/*!
- Apparently, all this does is delete the regular expression
- used for intercepting certain error messages that should
- not be emitted by emitMessage().
- */
-void Location::terminate()
-{
- delete spuriousRegExp;
- spuriousRegExp = 0;
-}
-
-/*!
- Prints \a message to \c stdout followed by a \c{'\n'}.
- */
-void Location::information(const QString& message)
-{
- printf("%s\n", message.toLatin1().data());
- fflush(stdout);
-}
-
-/*!
- Prints \a message to \c stderr followed by a \c{'\n'},
- but only if the -log-progress option is set.
- */
-void Location::logToStdErr(const QString& message)
-{
- if (logProgress_) {
- fprintf(stderr, "LOG: %s\n", message.toLatin1().data());
- fflush(stderr);
- }
-}
-
-/*!
- Report a program bug, including the \a hint.
- */
-void Location::internalError(const QString& hint)
-{
- Location::null.fatal(tr("Internal error (%1)").arg(hint),
- tr("There is a bug in %1. Seek advice from your local"
- " %2 guru.")
- .arg(programName).arg(programName));
-}
-
-/*!
- Formats \a message and \a details into a single string
- and outputs that string to \c stderr. \a type specifies
- whether the \a message is an error or a warning.
- */
-void Location::emitMessage(MessageType type,
- const QString& message,
- const QString& details) const
-{
- if (type == Warning &&
- spuriousRegExp != 0 &&
- spuriousRegExp->exactMatch(message))
- return;
-
- QString result = message;
- if (!details.isEmpty())
- result += "\n[" + details + QLatin1Char(']');
- result.replace("\n", "\n ");
- if (type == Error)
- result.prepend(tr(": error: "));
- else if (type == Warning)
- result.prepend(tr(": warning: "));
- if (type != Report)
- result.prepend(toString());
- fprintf(stderr, "%s\n", result.toLatin1().data());
- fflush(stderr);
-}
-
-/*!
- Converts the location to a string to be prepended to error
- messages.
- */
-QString Location::toString() const
-{
- QString str;
-
- if (isEmpty()) {
- str = programName;
- } else {
- Location loc2 = *this;
- loc2.setEtc(false);
- loc2.pop();
- if (!loc2.isEmpty()) {
- QString blah = tr("In file included from ");
- for (;;) {
- str += blah;
- str += loc2.top();
- loc2.pop();
- if (loc2.isEmpty())
- break;
- str += tr(",");
- str += QLatin1Char('\n');
- blah.fill(' ');
- }
- str += tr(":");
- str += QLatin1Char('\n');
- }
- str += top();
- }
- return str;
-}
-
-QString Location::top() const
-{
- QString str = filePath();
- if (!QDir::isAbsolutePath(str)) {
- QDir path(str);
- str = path.absolutePath();
- }
- if (lineNo() >= 1) {
- str += QLatin1Char(':');
- str += QString::number(lineNo());
- }
- if (etc())
- str += QLatin1String(" (etc.)");
- return str;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/location.h b/src/tools/qdoc/location.h
deleted file mode 100644
index 5250e27a47..0000000000
--- a/src/tools/qdoc/location.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- location.h
-*/
-
-#ifndef LOCATION_H
-#define LOCATION_H
-
-#include <qstack.h>
-#include <qcoreapplication.h>
-
-QT_BEGIN_NAMESPACE
-
-class Config;
-class QRegExp;
-
-class Location
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Location)
-
-public:
- Location();
- Location(const QString& filePath);
- Location(const Location& other);
- ~Location() { delete stk; }
-
- Location& operator=(const Location& other);
-
- void start();
- void advance(QChar ch);
- void advanceLines(int n) { stkTop->lineNo += n; stkTop->columnNo = 1; }
-
- void push(const QString& filePath);
- void pop();
- void setEtc(bool etc) { etcetera = etc; }
- void setLineNo(int no) { stkTop->lineNo = no; }
- void setColumnNo(int no) { stkTop->columnNo = no; }
-
- bool isEmpty() const { return stkDepth == 0; }
- int depth() const { return stkDepth; }
- const QString& filePath() const { return stkTop->filePath; }
- QString fileName() const;
- int lineNo() const { return stkTop->lineNo; }
- int columnNo() const { return stkTop->columnNo; }
- bool etc() const { return etcetera; }
- void warning(const QString& message,
- const QString& details = QString()) const;
- void error(const QString& message,
- const QString& details = QString()) const;
- void fatal(const QString& message,
- const QString& details = QString()) const;
- void report(const QString& message,
- const QString& details = QString()) const;
-
- static const Location null;
-
- static void initialize(const Config& config);
- static void terminate();
- static void information(const QString& message);
- static void internalError(const QString& hint);
- static void logToStdErr(const QString& message);
- static void startLoggingProgress() { logProgress_ = true; }
- static void stopLoggingProgress() { logProgress_ = false; }
- static QString canonicalRelativePath(const QString &path);
-
-private:
- enum MessageType { Warning, Error, Report };
-
- struct StackEntry
- {
- QString filePath;
- int lineNo;
- int columnNo;
- };
-
- void emitMessage(MessageType type,
- const QString& message,
- const QString& details) const;
- QString toString() const;
- QString top() const;
-
-private:
- StackEntry stkBottom;
- QStack<StackEntry> *stk;
- StackEntry *stkTop;
- int stkDepth;
- bool etcetera;
-
- static int tabSize;
- static QString programName;
- static QRegExp *spuriousRegExp;
- static bool logProgress_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
deleted file mode 100644
index 0b156c6bb9..0000000000
--- a/src/tools/qdoc/main.cpp
+++ /dev/null
@@ -1,789 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qglobal.h>
-#include <stdlib.h>
-#include "codemarker.h"
-#include "codeparser.h"
-#include "config.h"
-#include "cppcodemarker.h"
-#include "cppcodeparser.h"
-#include "doc.h"
-#include "htmlgenerator.h"
-#include "location.h"
-#include "plaincodemarker.h"
-#include "puredocparser.h"
-#include "tokenizer.h"
-#include "tree.h"
-#include "qdocdatabase.h"
-#include "jscodemarker.h"
-#include "qmlcodemarker.h"
-#include "qmlcodeparser.h"
-#include <qdatetime.h>
-#include <qdebug.h>
-#include "qtranslator.h"
-#ifndef QT_BOOTSTRAPPED
-# include "qcoreapplication.h"
-#endif
-#include "qcommandlineoption.h"
-#include "qcommandlineparser.h"
-
-#include <algorithm>
-
-QT_BEGIN_NAMESPACE
-
-bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
-{
- return fi1.lastModified() < fi2.lastModified();
-}
-
-static bool highlighting = false;
-static bool showInternal = false;
-static bool singleExec = false;
-static bool writeQaPages = false;
-static bool redirectDocumentationToDevNull = false;
-static bool noLinkErrors = false;
-static bool autolinkErrors = false;
-static bool obsoleteLinks = false;
-static QStringList defines;
-static QStringList dependModules;
-static QStringList indexDirs;
-static QString currentDir;
-static QString prevCurrentDir;
-static QHash<QString,QString> defaults;
-#ifndef QT_NO_TRANSLATION
-typedef QPair<QString, QTranslator*> Translator;
-static QList<Translator> translators;
-#endif
-
-/*!
- Read some XML indexes containing definitions from other
- documentation sets. \a config contains a variable that
- lists directories where index files can bge found. It also
- contains the \c depends variable, which lists the modules
- that the current module depends on.
-*/
-static void loadIndexFiles(Config& config)
-{
- QDocDatabase* qdb = QDocDatabase::qdocDB();
- QStringList indexFiles;
- QStringList configIndexes = config.getStringList(CONFIG_INDEXES);
- foreach (const QString &index, configIndexes) {
- QFileInfo fi(index);
- if (fi.exists() && fi.isFile())
- indexFiles << index;
- else
- Location::null.warning(QString("Index file not found: %1").arg(index));
- }
-
- dependModules += config.getStringList(CONFIG_DEPENDS);
- dependModules.removeDuplicates();
-
- bool noOutputSubdirs = false;
- QString singleOutputSubdir;
- if (config.getBool(QString("HTML.nosubdirs"))) {
- noOutputSubdirs = true;
- singleOutputSubdir = config.getString("HTML.outputsubdir");
- if (singleOutputSubdir.isEmpty())
- singleOutputSubdir = "html";
- }
-
- if (dependModules.size() > 0) {
- if (indexDirs.size() > 0) {
- for (int i = 0; i < indexDirs.size(); i++) {
- if (indexDirs[i].startsWith("..")) {
- const QString prefix(QDir(currentDir).relativeFilePath(prevCurrentDir));
- if (!prefix.isEmpty())
- indexDirs[i].prepend(prefix + QLatin1Char('/'));
- }
- }
- /*
- Add all subdirectories of the indexdirs as dependModules,
- when an asterisk is used in the 'depends' list.
- */
- if (dependModules.contains("*")) {
- dependModules.removeOne("*");
- for (int i = 0; i < indexDirs.size(); i++) {
- QDir scanDir = QDir(indexDirs[i]);
- scanDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
- QFileInfoList dirList = scanDir.entryInfoList();
- for (int j = 0; j < dirList.size(); j++) {
- if (dirList[j].fileName().toLower() != config.getString(CONFIG_PROJECT).toLower())
- dependModules.append(dirList[j].fileName());
- }
- }
- }
- for (int i = 0; i < dependModules.size(); i++) {
- QString indexToAdd;
- QList<QFileInfo> foundIndices;
- for (int j = 0; j < indexDirs.size(); j++) {
- QString fileToLookFor = indexDirs[j] + QLatin1Char('/');
- if (noOutputSubdirs)
- fileToLookFor += singleOutputSubdir + QLatin1Char('/');
- else
- fileToLookFor += dependModules[i] + QLatin1Char('/');
- fileToLookFor += dependModules[i] + QLatin1String(".index");
- if (QFile::exists(fileToLookFor)) {
- QFileInfo tempFileInfo(fileToLookFor);
- if (!foundIndices.contains(tempFileInfo))
- foundIndices.append(tempFileInfo);
- }
- }
- std::sort(foundIndices.begin(), foundIndices.end(), creationTimeBefore);
- if (foundIndices.size() > 1) {
- /*
- QDoc should always use the last entry in the multimap when there are
- multiple index files for a module, since the last modified file has the
- highest UNIX timestamp.
- */
- QStringList indexPaths;
- for (int k = 0; k < foundIndices.size(); k++)
- indexPaths << foundIndices[k].absoluteFilePath();
- Location::null.warning(QString("Multiple index files found for dependency \"%1\":\n%2").arg(
- dependModules[i], indexPaths.join('\n')));
- Location::null.warning(QString("Using %1 as index file for dependency \"%2\"").arg(
- foundIndices[foundIndices.size() - 1].absoluteFilePath(),
- dependModules[i]));
- indexToAdd = foundIndices[foundIndices.size() - 1].absoluteFilePath();
- }
- else if (foundIndices.size() == 1) {
- indexToAdd = foundIndices[0].absoluteFilePath();
- }
- if (!indexToAdd.isEmpty()) {
- if (!indexFiles.contains(indexToAdd))
- indexFiles << indexToAdd;
- }
- else {
- Location::null.warning(QString("\"%1\" Cannot locate index file for dependency \"%2\"").arg(
- config.getString(CONFIG_PROJECT), dependModules[i]));
- }
- }
- }
- else {
- Location::null.warning(QLatin1String("Dependent modules specified, but no index directories were set. There will probably be errors for missing links."));
- }
- }
- qdb->readIndexes(indexFiles);
-}
-
-/*!
- Processes the qdoc config file \a fileName. This is the
- controller for all of qdoc.
- */
-static void processQdocconfFile(const QString &fileName)
-{
- /*
- The Config instance represents the configuration data for qdoc.
- All the other classes are initialized with the config. Below, we
- initialize the configuration with some default values.
-
- I don't think the call to translate() does anything here. For one
- thing, the translators haven't been installed at this point. And
- I doubt any translator would translate QDoc anyway. But I left it
- here because it does no harm.
- */
- Config config(QCoreApplication::translate("QDoc", "qdoc"));
-
- QHash<QString,QString>::iterator iter;
- for (iter = defaults.begin(); iter != defaults.end(); ++iter)
- config.setStringList(iter.key(), QStringList() << iter.value());
-
- config.setStringList(CONFIG_SYNTAXHIGHLIGHTING, QStringList(highlighting ? "true" : "false"));
- config.setStringList(CONFIG_SHOWINTERNAL, QStringList(showInternal ? "true" : "false"));
- config.setStringList(CONFIG_SINGLEEXEC, QStringList(singleExec ? "true" : "false"));
- config.setStringList(CONFIG_WRITEQAPAGES, QStringList(writeQaPages ? "true" : "false"));
- config.setStringList(CONFIG_REDIRECTDOCUMENTATIONTODEVNULL, QStringList(redirectDocumentationToDevNull ? "true" : "false"));
- config.setStringList(CONFIG_NOLINKERRORS, QStringList(noLinkErrors ? "true" : "false"));
- config.setStringList(CONFIG_AUTOLINKERRORS, QStringList(autolinkErrors ? "true" : "false"));
- config.setStringList(CONFIG_OBSOLETELINKS, QStringList(obsoleteLinks ? "true" : "false"));
-
- /*
- With the default configuration values in place, load
- the qdoc configuration file. Note that the configuration
- file may include other configuration files.
-
- The Location class keeps track of the current location
- in the file being processed, mainly for error reporting
- purposes.
- */
- currentDir = QFileInfo(fileName).path();
- Location::initialize(config);
- config.load(fileName);
- QString project = config.getString(CONFIG_PROJECT);
- //qDebug() << "Start project:" << project;
- /*
- Add the defines to the configuration variables.
- */
- QStringList defs = defines + config.getStringList(CONFIG_DEFINES);
- config.setStringList(CONFIG_DEFINES,defs);
- Location::terminate();
-
- prevCurrentDir = QDir::currentPath();
- currentDir = QFileInfo(fileName).path();
- if (!currentDir.isEmpty())
- QDir::setCurrent(currentDir);
-
- QString phase = " in -";
- if (Generator::singleExec())
- phase += "single exec mode, ";
- else
- phase += "separate exec mode, ";
- if (Generator::preparing())
- phase += "prepare phase ";
- else if (Generator::generating())
- phase += "generate phase ";
- QString msg = "Running qdoc for " + config.getString(CONFIG_PROJECT) + phase;
- Location::logToStdErr(msg);
-
- /*
- Initialize all the classes and data structures with the
- qdoc configuration. This is safe to do for each qdocconf
- file processed, because all the data structures created
- are either cleared after they have been used, or they
- are cleared in the terminate() functions below.
- */
- Location::initialize(config);
- Tokenizer::initialize(config);
- Doc::initialize(config);
- CodeMarker::initialize(config);
- CodeParser::initialize(config);
- Generator::initialize(config);
-
-#ifndef QT_NO_TRANSLATION
- /*
- Load the language translators, if the configuration specifies any,
- but only if they haven't already been loaded. This works in both
- -prepare/-generate mode and -singleexec mode.
- */
- QStringList fileNames = config.getStringList(CONFIG_TRANSLATORS);
- QStringList::ConstIterator fn = fileNames.constBegin();
- while (fn != fileNames.constEnd()) {
- bool found = false;
- if (!translators.isEmpty()) {
- for (int i=0; i<translators.size(); ++i) {
- if (translators.at(i).first == *fn) {
- found = true;
- break;
- }
- }
- }
- if (!found) {
- QTranslator *translator = new QTranslator(0);
- if (!translator->load(*fn)) {
- config.lastLocation().error(QCoreApplication::translate("QDoc", "Cannot load translator '%1'").arg(*fn));
- }
- else {
- QCoreApplication::instance()->installTranslator(translator);
- translators.append(Translator(*fn, translator));
- }
- }
- ++fn;
- }
-#endif
-
- //QSet<QString> outputLanguages = config.getStringSet(CONFIG_OUTPUTLANGUAGES);
-
- /*
- Get the source language (Cpp) from the configuration
- and the location in the configuration file where the
- source language was set.
- */
- QString lang = config.getString(CONFIG_LANGUAGE);
- Location langLocation = config.lastLocation();
-
- /*
- Initialize the qdoc database, where all the parsed source files
- will be stored. The database includes a tree of nodes, which gets
- built as the source files are parsed. The documentation output is
- generated by traversing that tree.
-
- Note: qdocDB() allocates a new instance only if no instance exists.
- So it is safe to call qdocDB() any time.
- */
- QDocDatabase* qdb = QDocDatabase::qdocDB();
- qdb->setVersion(config.getString(CONFIG_VERSION));
- qdb->setShowInternal(config.getBool(CONFIG_SHOWINTERNAL));
- qdb->setSingleExec(config.getBool(CONFIG_SINGLEEXEC));
- /*
- By default, the only output format is HTML.
- */
- QSet<QString> outputFormats = config.getOutputFormats();
- Location outputFormatsLocation = config.lastLocation();
-
- qdb->clearSearchOrder();
- if (!Generator::singleExec()) {
- Generator::debug(" loading index files");
- loadIndexFiles(config);
- Generator::debug(" done loading index files");
- qdb->newPrimaryTree(project);
- }
- else if (Generator::preparing())
- qdb->newPrimaryTree(project);
- else
- qdb->setPrimaryTree(project);
-
- dependModules = config.getStringList(CONFIG_DEPENDS);
- dependModules.removeDuplicates();
- qdb->setSearchOrder(dependModules);
-
- QSet<QString> excludedDirs;
- QSet<QString> excludedFiles;
- QStringList excludedDirsList;
- QStringList excludedFilesList;
-
- if (!Generator::singleExec() || !Generator::generating()) {
- QStringList headerList;
- QStringList sourceList;
-
- Generator::debug("Reading excludedirs");
- excludedDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS);
- foreach (const QString &excludeDir, excludedDirsList) {
- QString p = QDir::fromNativeSeparators(excludeDir);
- QDir tmp(p);
- if (tmp.exists())
- excludedDirs.insert(p);
- }
-
- Generator::debug("Reading excludefiles");
- excludedFilesList = config.getCanonicalPathList(CONFIG_EXCLUDEFILES);
- foreach (const QString& excludeFile, excludedFilesList) {
- QString p = QDir::fromNativeSeparators(excludeFile);
- excludedFiles.insert(p);
- }
-
- Generator::debug("Reading headerdirs");
- headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS,excludedDirs,excludedFiles);
- QMap<QString,QString> headers;
- QMultiMap<QString,QString> headerFileNames;
- for (int i=0; i<headerList.size(); ++i) {
- if (headerList[i].contains(QString("doc/snippets")))
- continue;
- if (headers.contains(headerList[i]))
- continue;
- headers.insert(headerList[i],headerList[i]);
- QString t = headerList[i].mid(headerList[i].lastIndexOf('/')+1);
- headerFileNames.insert(t,t);
- }
-
- Generator::debug("Reading sourcedirs");
- sourceList = config.getAllFiles(CONFIG_SOURCES,CONFIG_SOURCEDIRS,excludedDirs,excludedFiles);
- QMap<QString,QString> sources;
- QMultiMap<QString,QString> sourceFileNames;
- for (int i=0; i<sourceList.size(); ++i) {
- if (sourceList[i].contains(QString("doc/snippets")))
- continue;
- if (sources.contains(sourceList[i]))
- continue;
- sources.insert(sourceList[i],sourceList[i]);
- QString t = sourceList[i].mid(sourceList[i].lastIndexOf('/')+1);
- sourceFileNames.insert(t,t);
- }
- /*
- Find all the qdoc files in the example dirs, and add
- them to the source files to be parsed.
- */
- Generator::debug("Reading exampledirs");
- QStringList exampleQdocList = config.getExampleQdocFiles(excludedDirs, excludedFiles);
- for (int i=0; i<exampleQdocList.size(); ++i) {
- if (!sources.contains(exampleQdocList[i])) {
- sources.insert(exampleQdocList[i],exampleQdocList[i]);
- QString t = exampleQdocList[i].mid(exampleQdocList[i].lastIndexOf('/')+1);
- sourceFileNames.insert(t,t);
- }
- }
-
- Generator::debug("Adding doc/image dirs found in exampledirs to imagedirs");
- QSet<QString> exampleImageDirs;
- QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
- for (int i=0; i<exampleImageList.size(); ++i) {
- if (exampleImageList[i].contains("doc/images")) {
- QString t = exampleImageList[i].left(exampleImageList[i].lastIndexOf("doc/images")+10);
- if (!exampleImageDirs.contains(t)) {
- exampleImageDirs.insert(t);
- }
- }
- }
- Generator::augmentImageDirs(exampleImageDirs);
-
- /*
- Parse each header file in the set using the appropriate parser and add it
- to the big tree.
- */
- QSet<CodeParser *> usedParsers;
-
- Generator::debug("Parsing header files");
- int parsed = 0;
- QMap<QString,QString>::ConstIterator h = headers.constBegin();
- while (h != headers.constEnd()) {
- CodeParser *codeParser = CodeParser::parserForHeaderFile(h.key());
- if (codeParser) {
- ++parsed;
- Generator::debug(QString("Parsing " + h.key()));
- codeParser->parseHeaderFile(config.location(), h.key());
- usedParsers.insert(codeParser);
- }
- ++h;
- }
-
- foreach (CodeParser *codeParser, usedParsers)
- codeParser->doneParsingHeaderFiles();
-
- usedParsers.clear();
- qdb->resolveInheritance();
-
- /*
- Parse each source text file in the set using the appropriate parser and
- add it to the big tree.
- */
- parsed = 0;
- Generator::debug("Parsing source files");
- QMap<QString,QString>::ConstIterator s = sources.constBegin();
- while (s != sources.constEnd()) {
- CodeParser *codeParser = CodeParser::parserForSourceFile(s.key());
- if (codeParser) {
- ++parsed;
- Generator::debug(QString("Parsing " + s.key()));
- codeParser->parseSourceFile(config.location(), s.key());
- usedParsers.insert(codeParser);
- }
- ++s;
- }
- Generator::debug(QString("Parsing done."));
-
- foreach (CodeParser *codeParser, usedParsers)
- codeParser->doneParsingSourceFiles();
-
- /*
- Now the primary tree has been built from all the header and
- source files. Resolve all the class names, function names,
- targets, URLs, links, and other stuff that needs resolving.
- */
- Generator::debug("Resolving stuff prior to generating docs");
- qdb->resolveIssues();
- }
- else {
- Generator::debug("Reading excludedirs");
- excludedDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS);
- foreach (const QString &excludeDir, excludedDirsList) {
- QString p = QDir::fromNativeSeparators(excludeDir);
- QDir tmp(p);
- if (tmp.exists())
- excludedDirs.insert(p);
- }
-
- Generator::debug("Reading excludefiles");
- excludedFilesList = config.getCanonicalPathList(CONFIG_EXCLUDEFILES);
- foreach (const QString& excludeFile, excludedFilesList) {
- QString p = QDir::fromNativeSeparators(excludeFile);
- excludedFiles.insert(p);
- }
-
- Generator::debug("Adding doc/image dirs found in exampledirs to imagedirs");
- QSet<QString> exampleImageDirs;
- QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
- for (int i=0; i<exampleImageList.size(); ++i) {
- if (exampleImageList[i].contains("doc/images")) {
- QString t = exampleImageList[i].left(exampleImageList[i].lastIndexOf("doc/images")+10);
- if (!exampleImageDirs.contains(t)) {
- exampleImageDirs.insert(t);
- }
- }
- }
- Generator::augmentImageDirs(exampleImageDirs);
- qdb->resolveStuff();
- }
-
- /*
- The primary tree is built and all the stuff that needed
- resolving has been resolved. Now traverse the tree and
- generate the documentation output. More than one output
- format can be requested. The tree is traversed for each
- one.
- */
- Generator::debug("Generating docs");
- QSet<QString>::ConstIterator of = outputFormats.constBegin();
- while (of != outputFormats.constEnd()) {
- Generator* generator = Generator::generatorForFormat(*of);
- if (generator == 0)
- outputFormatsLocation.fatal(QCoreApplication::translate("QDoc",
- "Unknown output format '%1'").arg(*of));
- generator->generateDocs();
- ++of;
- }
-#if 0
- if (Generator::generating() && Generator::writeQaPages())
- qdb->printLinkCounts(project);
-#endif
- qdb->clearLinkCounts();
-
- Generator::debug("Terminating qdoc classes");
- if (Generator::debugging())
- Generator::stopDebugging(project);
-
- QDocDatabase::qdocDB()->setVersion(QString());
- Generator::terminate();
- CodeParser::terminate();
- CodeMarker::terminate();
- Doc::terminate();
- Tokenizer::terminate();
- Location::terminate();
- QDir::setCurrent(prevCurrentDir);
-
- Generator::debug("qdoc classes terminated");
-}
-
-extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
-QT_END_NAMESPACE
-
-int main(int argc, char **argv)
-{
- QT_USE_NAMESPACE
-
-#ifndef QT_BOOTSTRAPPED
- qt_qhash_seed.testAndSetRelaxed(-1, 0); // set the hash seed to 0 if it wasn't set yet
-#endif
- QCoreApplication app(argc, argv);
- app.setApplicationVersion(QStringLiteral(QT_VERSION_STR));
-
- /*
- Create code parsers for the languages to be parsed,
- and create a tree for C++.
- */
- CppCodeParser cppParser;
- QmlCodeParser qmlParser;
- PureDocParser docParser;
-
- /*
- Create code markers for plain text, C++,
- javascript, and QML.
- */
- PlainCodeMarker plainMarker;
- CppCodeMarker cppMarker;
- JsCodeMarker jsMarker;
- QmlCodeMarker qmlMarker;
-
- HtmlGenerator htmlGenerator;
-
- QCommandLineParser parser;
- parser.setApplicationDescription(QCoreApplication::translate("qdoc", "Qt documentation generator"));
- parser.addHelpOption();
- parser.addVersionOption();
-
- parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
-
- parser.addPositionalArgument("file1.qdocconf ...", QCoreApplication::translate("qdoc", "Input files"));
-
- QCommandLineOption defineOption(QStringList() << QStringLiteral("D"));
- defineOption.setDescription(QCoreApplication::translate("qdoc", "Define the argument as a macro while parsing sources"));
- defineOption.setValueName(QStringLiteral("macro[=def]"));
- parser.addOption(defineOption);
-
- QCommandLineOption dependsOption(QStringList() << QStringLiteral("depends"));
- dependsOption.setDescription(QCoreApplication::translate("qdoc", "Specify dependent modules"));
- dependsOption.setValueName(QStringLiteral("module"));
- parser.addOption(dependsOption);
-
- QCommandLineOption highlightingOption(QStringList() << QStringLiteral("highlighting"));
- highlightingOption.setDescription(QCoreApplication::translate("qdoc", "Turn on syntax highlighting (makes qdoc run slower)"));
- parser.addOption(highlightingOption);
-
- QCommandLineOption showInternalOption(QStringList() << QStringLiteral("showinternal"));
- showInternalOption.setDescription(QCoreApplication::translate("qdoc", "Include content marked internal"));
- parser.addOption(showInternalOption);
-
- QCommandLineOption redirectDocumentationToDevNullOption(QStringList() << QStringLiteral("redirect-documentation-to-dev-null"));
- redirectDocumentationToDevNullOption.setDescription(QCoreApplication::translate("qdoc", "Save all documentation content to /dev/null. Useful if someone is interested in qdoc errors only."));
- parser.addOption(redirectDocumentationToDevNullOption);
-
- QCommandLineOption noExamplesOption(QStringList() << QStringLiteral("no-examples"));
- noExamplesOption.setDescription(QCoreApplication::translate("qdoc", "Do not generate documentation for examples"));
- parser.addOption(noExamplesOption);
-
- QCommandLineOption indexDirOption(QStringList() << QStringLiteral("indexdir"));
- indexDirOption.setDescription(QCoreApplication::translate("qdoc", "Specify a directory where QDoc should search for index files to load"));
- indexDirOption.setValueName(QStringLiteral("dir"));
- parser.addOption(indexDirOption);
-
- QCommandLineOption installDirOption(QStringList() << QStringLiteral("installdir"));
- installDirOption.setDescription(QCoreApplication::translate("qdoc", "Specify the directory where the output will be after running \"make install\""));
- installDirOption.setValueName(QStringLiteral("dir"));
- parser.addOption(installDirOption);
-
- QCommandLineOption obsoleteLinksOption(QStringList() << QStringLiteral("obsoletelinks"));
- obsoleteLinksOption.setDescription(QCoreApplication::translate("qdoc", "Report links from obsolete items to non-obsolete items"));
- parser.addOption(obsoleteLinksOption);
-
- QCommandLineOption outputDirOption(QStringList() << QStringLiteral("outputdir"));
- outputDirOption.setDescription(QCoreApplication::translate("qdoc", "Specify output directory, overrides setting in qdocconf file"));
- outputDirOption.setValueName(QStringLiteral("dir"));
- parser.addOption(outputDirOption);
-
- QCommandLineOption outputFormatOption(QStringList() << QStringLiteral("outputformat"));
- outputFormatOption.setDescription(QCoreApplication::translate("qdoc", "Specify output format, overrides setting in qdocconf file"));
- outputFormatOption.setValueName(QStringLiteral("format"));
- parser.addOption(outputFormatOption);
-
- QCommandLineOption noLinkErrorsOption(QStringList() << QStringLiteral("no-link-errors"));
- noLinkErrorsOption.setDescription(QCoreApplication::translate("qdoc", "Do not print link errors (i.e. missing targets)"));
- parser.addOption(noLinkErrorsOption);
-
- QCommandLineOption autoLinkErrorsOption(QStringList() << QStringLiteral("autolink-errors"));
- autoLinkErrorsOption.setDescription(QCoreApplication::translate("qdoc", "Show errors when automatic linking fails"));
- parser.addOption(autoLinkErrorsOption);
-
- QCommandLineOption debugOption(QStringList() << QStringLiteral("debug"));
- debugOption.setDescription(QCoreApplication::translate("qdoc", "Enable debug output"));
- parser.addOption(debugOption);
-
- QCommandLineOption prepareOption(QStringList() << QStringLiteral("prepare"));
- prepareOption.setDescription(QCoreApplication::translate("qdoc", "Run qdoc only to generate an index file, not the docs"));
- parser.addOption(prepareOption);
-
- QCommandLineOption generateOption(QStringList() << QStringLiteral("generate"));
- generateOption.setDescription(QCoreApplication::translate("qdoc", "Run qdoc to read the index files and generate the docs"));
- parser.addOption(generateOption);
-
- QCommandLineOption logProgressOption(QStringList() << QStringLiteral("log-progress"));
- logProgressOption.setDescription(QCoreApplication::translate("qdoc", "Log progress on stderr."));
- parser.addOption(logProgressOption);
-
- QCommandLineOption singleExecOption(QStringList() << QStringLiteral("single-exec"));
- singleExecOption.setDescription(QCoreApplication::translate("qdoc", "Run qdoc once over all the qdoc conf files."));
- parser.addOption(singleExecOption);
-
- QCommandLineOption writeQaPagesOption(QStringList() << QStringLiteral("write-qa-pages"));
- writeQaPagesOption.setDescription(QCoreApplication::translate("qdoc", "Write QA pages."));
- parser.addOption(writeQaPagesOption);
-
- parser.process(app);
-
- defines += parser.values(defineOption);
- dependModules += parser.values(dependsOption);
- highlighting = parser.isSet(highlightingOption);
- showInternal = parser.isSet(showInternalOption);
- singleExec = parser.isSet(singleExecOption);
- writeQaPages = parser.isSet(writeQaPagesOption);
- redirectDocumentationToDevNull = parser.isSet(redirectDocumentationToDevNullOption);
- Config::generateExamples = !parser.isSet(noExamplesOption);
- foreach (const QString &indexDir, parser.values(indexDirOption)) {
- if (QFile::exists(indexDir))
- indexDirs += indexDir;
- else
- qDebug() << "Cannot find index directory" << indexDir;
- }
- if (parser.isSet(installDirOption))
- Config::installDir = parser.value(installDirOption);
- obsoleteLinks = parser.isSet(obsoleteLinksOption);
- if (parser.isSet(outputDirOption))
- Config::overrideOutputDir = parser.value(outputDirOption);
- foreach (const QString &format, parser.values(outputFormatOption))
- Config::overrideOutputFormats.insert(format);
- noLinkErrors = parser.isSet(noLinkErrorsOption);
- autolinkErrors = parser.isSet(autoLinkErrorsOption);
- if (parser.isSet(debugOption))
- Generator::startDebugging(QString("command line"));
- if (parser.isSet(prepareOption))
- Generator::setQDocPass(Generator::Prepare);
- if (parser.isSet(generateOption))
- Generator::setQDocPass(Generator::Generate);
- if (parser.isSet(singleExecOption))
- Generator::setSingleExec();
- if (parser.isSet(writeQaPagesOption))
- Generator::setWriteQaPages();
- if (parser.isSet(logProgressOption))
- Location::startLoggingProgress();
-
- /*
- The default indent for code is 4.
- The default value for false is 0.
- The default supported file extensions are cpp, h, qdoc and qml.
- The default language is c++.
- The default output format is html.
- The default tab size is 8.
- And those are all the default values for configuration variables.
- */
- if (defaults.isEmpty()) {
- defaults.insert(CONFIG_CODEINDENT, QLatin1String("4"));
- defaults.insert(CONFIG_FALSEHOODS, QLatin1String("0"));
- defaults.insert(CONFIG_FILEEXTENSIONS, QLatin1String("*.cpp *.h *.qdoc *.qml"));
- defaults.insert(CONFIG_LANGUAGE, QLatin1String("Cpp"));
- defaults.insert(CONFIG_OUTPUTFORMATS, QLatin1String("HTML"));
- defaults.insert(CONFIG_TABSIZE, QLatin1String("8"));
- }
-
- QStringList qdocFiles = parser.positionalArguments();
- if (qdocFiles.isEmpty())
- parser.showHelp();
-
- if (singleExec)
- qdocFiles = Config::loadMaster(qdocFiles.at(0));
-
- /*
- Main loop is now modified to handle single exec mode.
- */
- if (Generator::singleExec())
- Generator::setQDocPass(Generator::Prepare);
- foreach (const QString &qf, qdocFiles) {
- dependModules.clear();
- processQdocconfFile(qf);
- }
- if (Generator::singleExec()) {
- Generator::setQDocPass(Generator::Generate);
- QDocDatabase* qdb = QDocDatabase::qdocDB();
- qdb->processForest();
- foreach (const QString &qf, qdocFiles) {
- dependModules.clear();
- processQdocconfFile(qf);
- }
- }
-
-#ifndef QT_NO_TRANSLATION
- if (!translators.isEmpty()) {
- for (int i=0; i<translators.size(); ++i) {
- delete translators.at(i).second;
- }
- }
- translators.clear();
-#endif
- QmlTypeNode::terminate();
-
-#ifdef DEBUG_SHUTDOWN_CRASH
- qDebug() << "main(): Delete qdoc database";
-#endif
- QDocDatabase::destroyQdocDB();
-#ifdef DEBUG_SHUTDOWN_CRASH
- qDebug() << "main(): qdoc database deleted";
-#endif
-
- return EXIT_SUCCESS;
-}
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
deleted file mode 100644
index 37bc0c5fef..0000000000
--- a/src/tools/qdoc/node.cpp
+++ /dev/null
@@ -1,2874 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "node.h"
-#include "tree.h"
-#include "codemarker.h"
-#include "codeparser.h"
-#include <quuid.h>
-#include "qdocdatabase.h"
-#include <qdebug.h>
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-int Node::propertyGroupCount_ = 0;
-QStringMap Node::operators_;
-QMap<QString,Node::Type> Node::goals_;
-
-/*!
- Initialize the map of search goals. This is called once
- by QDocDatabase::initializeDB(). The map key is a string
- representing a value in the enum Node::Type. The map value
- is the enum value.
-
- There should be an entry in the map for each value in the
- Type enum.
- */
-void Node::initialize()
-{
- goals_.insert("class", Node::Class);
- goals_.insert("qmltype", Node::QmlType);
- goals_.insert("page", Node::Document);
- goals_.insert("function", Node::Function);
- goals_.insert("property", Node::Property);
- goals_.insert("variable", Node::Variable);
- goals_.insert("group", Node::Group);
- goals_.insert("module", Node::Module);
- goals_.insert("qmlmodule", Node::QmlModule);
- goals_.insert("qmppropertygroup", Node::QmlPropertyGroup);
- goals_.insert("qmlproperty", Node::QmlProperty);
- goals_.insert("qmlsignal", Node::QmlSignal);
- goals_.insert("qmlsignalhandler", Node::QmlSignalHandler);
- goals_.insert("qmlmethod", Node::QmlMethod);
- goals_.insert("qmlbasictype", Node::QmlBasicType);
- goals_.insert("enum", Node::Enum);
- goals_.insert("typedef", Node::Typedef);
- goals_.insert("namespace", Node::Namespace);
-}
-
-/*!
- Increment the number of property groups seen in the current
- file, and return the new value.
- */
-int Node::incPropertyGroupCount() { return ++propertyGroupCount_; }
-
-/*!
- Reset the number of property groups seen in the current file
- to 0, because we are starting a new file.
- */
-void Node::clearPropertyGroupCount() { propertyGroupCount_ = 0; }
-
-/*!
- \class Node
- \brief The Node class is a node in the Tree.
-
- A Node represents a class or function or something else
- from the source code..
- */
-
-/*!
- When this Node is destroyed, if it has a parent Node, it
- removes itself from the parent node's child list.
- */
-Node::~Node()
-{
- if (parent_)
- parent_->removeChild(this);
- if (relatesTo_)
- relatesTo_->removeRelated(this);
-}
-
-/*!
- Returns this node's name member. Appends "()" to the returned
- name, if this node is a function node.
- */
-QString Node::plainName() const
-{
- if (type() == Node::Function)
- return name_ + QLatin1String("()");
- return name_;
-}
-
-/*!
- Constructs and returns the node's fully qualified name by
- recursively ascending the parent links and prepending each
- parent name + "::". Breaks out when the parent pointer is
- \a relative. Almost all calls to this function pass 0 for
- \a relative.
- */
-QString Node::plainFullName(const Node* relative) const
-{
- if (name_.isEmpty())
- return QLatin1String("global");
-
- QString fullName;
- const Node* node = this;
- while (node) {
- fullName.prepend(node->plainName());
- if (node->parent() == relative || node->parent()->name().isEmpty())
- break;
- fullName.prepend(QLatin1String("::"));
- node = node->parent();
- }
- return fullName;
-}
-
-/*!
- Constructs and returns this node's full name.
- */
-QString Node::fullName(const Node* relative) const
-{
- if ((isDocumentNode() || isGroup()) && !title().isEmpty())
- return title();
- return plainFullName(relative);
-}
-
-/*!
- Try to match this node's type and subtype with one of the
- pairs in \a types. If a match is found, return true. If no
- match is found, return false.
-
- \a types is a list of type/subtype pairs, where the first
- value in the pair is a Node::Type, and the second value is
- a Node::SubType. The second value is used in the match if
- this node's type is Node::Document.
- */
-bool Node::match(const NodeTypeList& types) const
-{
- for (int i=0; i<types.size(); ++i) {
- if (type() == types.at(i).first) {
- if (type() == Node::Document) {
- if (subType() == types.at(i).second)
- return true;
- }
- else
- return true;
- }
- }
- return false;
-}
-
-/*!
- Sets this Node's Doc to \a doc. If \a replace is false and
- this Node already has a Doc, a warning is reported that the
- Doc is being overridden, and it reports where the previous
- Doc was found. If \a replace is true, the Doc is replaced
- silently.
- */
-void Node::setDoc(const Doc& doc, bool replace)
-{
- if (!doc_.isEmpty() && !replace) {
- doc.location().warning(tr("Overrides a previous doc"));
- doc_.location().warning(tr("(The previous doc is here)"));
- }
- doc_ = doc;
-}
-
-/*!
- Construct a node with the given \a type and having the
- given \a parent and \a name. The new node is added to the
- parent's child list.
- */
-Node::Node(Type type, InnerNode *parent, const QString& name)
- : nodeType_((unsigned char) type),
- access_((unsigned char) Public),
- safeness_((unsigned char) UnspecifiedSafeness),
- pageType_((unsigned char) NoPageType),
- status_((unsigned char) Commendable),
- indexNodeFlag_(false),
- parent_(parent),
- relatesTo_(0),
- name_(name)
-{
- if (parent_)
- parent_->addChild(this);
- outSubDir_ = Generator::outputSubdir();
- if (operators_.isEmpty()) {
- operators_.insert("++","inc");
- operators_.insert("--","dec");
- operators_.insert("==","eq");
- operators_.insert("!=","ne");
- operators_.insert("<<","lt-lt");
- operators_.insert(">>","gt-gt");
- operators_.insert("+=","plus-assign");
- operators_.insert("-=","minus-assign");
- operators_.insert("*=","mult-assign");
- operators_.insert("/=","div-assign");
- operators_.insert("%=","mod-assign");
- operators_.insert("&=","bitwise-and-assign");
- operators_.insert("|=","bitwise-or-assign");
- operators_.insert("^=","bitwise-xor-assign");
- operators_.insert("<<=","bitwise-left-shift-assign");
- operators_.insert(">>=","bitwise-right-shift-assign");
- operators_.insert("||","logical-or");
- operators_.insert("&&","logical-and");
- operators_.insert("()","call");
- operators_.insert("[]","subscript");
- operators_.insert("->","pointer");
- operators_.insert("->*","pointer-star");
- operators_.insert("+","plus");
- operators_.insert("-","minus");
- operators_.insert("*","mult");
- operators_.insert("/","div");
- operators_.insert("%","mod");
- operators_.insert("|","bitwise-or");
- operators_.insert("&","bitwise-and");
- operators_.insert("^","bitwise-xor");
- operators_.insert("!","not");
- operators_.insert("~","bitwise-not");
- operators_.insert("<=","lt-eq");
- operators_.insert(">=","gt-eq");
- operators_.insert("<","lt");
- operators_.insert(">","gt");
- operators_.insert("=","assign");
- operators_.insert(",","comma");
- operators_.insert("delete[]","delete-array");
- operators_.insert("delete","delete");
- operators_.insert("new[]","new-array");
- operators_.insert("new","new");
- }
-}
-
-/*! \fn QString Node::url() const
- Returns the node's URL.
- */
-
-/*! \fn void Node::setUrl(const QString &url)
- Sets the node's URL to \a url
- */
-
-/*!
- Returns this node's page type as a string, for use as an
- attribute value in XML or HTML.
- */
-QString Node::pageTypeString() const
-{
- return pageTypeString((PageType) pageType_);
-}
-
-/*!
- Returns the page type \a t as a string, for use as an
- attribute value in XML or HTML.
- */
-QString Node::pageTypeString(unsigned char t)
-{
- switch ((PageType)t) {
- case Node::ApiPage:
- return "api";
- case Node::ArticlePage:
- return "article";
- case Node::ExamplePage:
- return "example";
- case Node::HowToPage:
- return "howto";
- case Node::OverviewPage:
- return "overview";
- case Node::TutorialPage:
- return "tutorial";
- case Node::FAQPage:
- return "faq";
- case Node::DitaMapPage:
- return "ditamap";
- default:
- return "article";
- }
-}
-
-/*!
- Returns this node's type as a string for use as an
- attribute value in XML or HTML.
- */
-QString Node::nodeTypeString() const
-{
- return nodeTypeString(type());
-}
-
-/*!
- Returns the node type \a t as a string for use as an
- attribute value in XML or HTML.
- */
-QString Node::nodeTypeString(unsigned char t)
-{
- switch ((Type)t) {
- case Namespace:
- return "namespace";
- case Class:
- return "class";
- case Document:
- return "document";
- case Enum:
- return "enum";
- case Typedef:
- return "typedef";
- case Function:
- return "function";
- case Property:
- return "property";
- case Variable:
- return "variable";
- case Group:
- return "group";
- case Module:
- return "module";
- case QmlType:
- return "QML type";
- case QmlBasicType:
- return "QML basic type";
- case QmlModule:
- return "QML module";
- case QmlProperty:
- return "QML property";
- case QmlPropertyGroup:
- return "QML property group";
- case QmlSignal:
- return "QML signal";
- case QmlSignalHandler:
- return "QML signal handler";
- case QmlMethod:
- return "QML method";
- default:
- break;
- }
- return QString();
-}
-
-/*!
- Returns this node's subtype as a string for use as an
- attribute value in XML or HTML. This is only useful
- in the case where the node type is Document.
- */
-QString Node::nodeSubtypeString() const
-{
- return nodeSubtypeString(subType());
-}
-
-/*!
- Returns the node subtype \a t as a string for use as an
- attribute value in XML or HTML. This is only useful
- in the case where the node type is Document.
- */
-QString Node::nodeSubtypeString(unsigned char t)
-{
- switch ((SubType)t) {
- case Example:
- return "example";
- case HeaderFile:
- return "header file";
- case File:
- return "file";
- case Image:
- return "image";
- case Page:
- return "page";
- case ExternalPage:
- return "external page";
- case DitaMap:
- return "ditamap";
- case NoSubType:
- default:
- break;
- }
- return QString();
-}
-
-/*!
- Set the page type according to the string \a t.
- */
-void Node::setPageType(const QString& t)
-{
- if ((t == "API") || (t == "api"))
- pageType_ = (unsigned char) ApiPage;
- else if (t == "howto")
- pageType_ = (unsigned char) HowToPage;
- else if (t == "overview")
- pageType_ = (unsigned char) OverviewPage;
- else if (t == "tutorial")
- pageType_ = (unsigned char) TutorialPage;
- else if (t == "faq")
- pageType_ = (unsigned char) FAQPage;
- else if (t == "article")
- pageType_ = (unsigned char) ArticlePage;
- else if (t == "example")
- pageType_ = (unsigned char) ExamplePage;
- else if (t == "ditamap")
- pageType_ = (unsigned char) DitaMapPage;
-}
-
-/*! Converts the boolean value \a b to an enum representation
- of the boolean type, which includes an enum value for the
- \e {default value} of the item, i.e. true, false, or default.
- */
-Node::FlagValue Node::toFlagValue(bool b)
-{
- return b ? FlagValueTrue : FlagValueFalse;
-}
-
-/*!
- Converts the enum \a fv back to a boolean value.
- If \a fv is neither the true enum value nor the
- false enum value, the boolean value returned is
- \a defaultValue.
-
- Note that runtimeDesignabilityFunction() should be called
- first. If that function returns the name of a function, it
- means the function must be called at runtime to determine
- whether the property is Designable.
- */
-bool Node::fromFlagValue(FlagValue fv, bool defaultValue)
-{
- switch (fv) {
- case FlagValueTrue:
- return true;
- case FlagValueFalse:
- return false;
- default:
- return defaultValue;
- }
-}
-
-/*!
- Sets the pointer to the node that this node relates to.
- */
-void Node::setRelates(InnerNode *pseudoParent)
-{
- if (relatesTo_) {
- relatesTo_->removeRelated(this);
- }
- relatesTo_ = pseudoParent;
- pseudoParent->related_.append(this);
-}
-
-/*!
- This function creates a pair that describes a link.
- The pair is composed from \a link and \a desc. The
- \a linkType is the map index the pair is filed under.
- */
-void Node::setLink(LinkType linkType, const QString &link, const QString &desc)
-{
- QPair<QString,QString> linkPair;
- linkPair.first = link;
- linkPair.second = desc;
- linkMap_[linkType] = linkPair;
-}
-
-/*!
- Sets the information about the project and version a node was introduced
- in. The string is simplified, removing excess whitespace before being
- stored.
-*/
-void Node::setSince(const QString &since)
-{
- since_ = since.simplified();
-}
-
-/*!
- Returns a string representing the access specifier.
- */
-QString Node::accessString() const
-{
- switch ((Access) access_) {
- case Protected:
- return "protected";
- case Private:
- return "private";
- case Public:
- default:
- break;
- }
- return "public";
-}
-
-/*!
- Extract a class name from the type \a string and return it.
- */
-QString Node::extractClassName(const QString &string) const
-{
- QString result;
- for (int i=0; i<=string.size(); ++i) {
- QChar ch;
- if (i != string.size())
- ch = string.at(i);
-
- QChar lower = ch.toLower();
- if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) ||
- ch.digitValue() >= 0 ||
- ch == QLatin1Char('_') ||
- ch == QLatin1Char(':')) {
- result += ch;
- }
- else if (!result.isEmpty()) {
- if (result != QLatin1String("const"))
- return result;
- result.clear();
- }
- }
- return result;
-}
-
-/*!
- Returns a string representing the access specifier.
- */
-QString RelatedClass::accessString() const
-{
- switch (access_) {
- case Node::Protected:
- return "protected";
- case Node::Private:
- return "private";
- case Node::Public:
- default:
- break;
- }
- return "public";
-}
-
-/*!
- Returns the inheritance status.
- */
-Node::Status Node::inheritedStatus() const
-{
- Status parentStatus = Commendable;
- if (parent_)
- parentStatus = parent_->inheritedStatus();
- return (Status)qMin((int)status_, (int)parentStatus);
-}
-
-/*!
- Returns the thread safeness value for whatever this node
- represents. But if this node has a parent and the thread
- safeness value of the parent is the same as the thread
- safeness value of this node, what is returned is the
- value \c{UnspecifiedSafeness}. Why?
- */
-Node::ThreadSafeness Node::threadSafeness() const
-{
- if (parent_ && (ThreadSafeness) safeness_ == parent_->inheritedThreadSafeness())
- return UnspecifiedSafeness;
- return (ThreadSafeness) safeness_;
-}
-
-/*!
- If this node has a parent, the parent's thread safeness
- value is returned. Otherwise, this node's thread safeness
- value is returned. Why?
- */
-Node::ThreadSafeness Node::inheritedThreadSafeness() const
-{
- if (parent_ && (ThreadSafeness) safeness_ == UnspecifiedSafeness)
- return parent_->inheritedThreadSafeness();
- return (ThreadSafeness) safeness_;
-}
-
-#if 0
-/*!
- Returns the sanitized file name without the path.
- If the file is an html file, the html suffix
- is removed. Why?
- */
-QString Node::fileBase() const
-{
- QString base = name();
- if (base.endsWith(".html"))
- base.chop(5);
- base.replace(QRegExp("[^A-Za-z0-9]+"), " ");
- base = base.trimmed();
- base.replace(QLatin1Char(' '), QLatin1Char('-'));
- return base.toLower();
-}
-#endif
-/*!
- Returns this node's Universally Unique IDentifier as a
- QString. Creates the UUID first, if it has not been created.
- */
-QString Node::guid() const
-{
- if (uuid_.isEmpty())
- uuid_ = idForNode();
- return uuid_;
-}
-
-/*!
- If this node is a QML or JS type node, return a pointer to
- it. If it is a child of a QML or JS type node, return the
- pointer to its parent QMLor JS type node. Otherwise return
- 0;
- */
-QmlTypeNode* Node::qmlTypeNode()
-{
- if (isQmlNode() || isJsNode()) {
- Node* n = this;
- while (n && !(n->isQmlType() || n->isJsType()))
- n = n->parent();
- if (n && (n->isQmlType() || n->isJsType()))
- return static_cast<QmlTypeNode*>(n);
- }
- return 0;
-}
-
-/*!
- If this node is a QML node, find its QML class node,
- and return a pointer to the C++ class node from the
- QML class node. That pointer will be null if the QML
- class node is a component. It will be non-null if
- the QML class node is a QML element.
- */
-ClassNode* Node::declarativeCppNode()
-{
- QmlTypeNode* qcn = qmlTypeNode();
- if (qcn)
- return qcn->classNode();
- return 0;
-}
-
-/*!
- Returns \c true if the node's status is Internal, or if its
- parent is a class with internal status.
- */
-bool Node::isInternal() const
-{
- if (status() == Internal)
- return true;
- if (parent() && parent()->status() == Internal)
- return true;
- if (relates() && relates()->status() == Internal)
- return true;
- return false;
-}
-
-/*!
- Returns a pointer to the Tree this node is in.
- */
-Tree* Node::tree() const
-{
- return (parent() ? parent()->tree() : 0);
-}
-
-/*!
- Returns a pointer to the root of the Tree this node is in.
- */
-const Node* Node::root() const
-{
- return (parent() ? parent()->root() : this);
-}
-
-/*!
- \class InnerNode
- */
-
-/*!
- The inner node destructor deletes the children and removes
- this node from its related nodes.
- */
-InnerNode::~InnerNode()
-{
- deleteChildren();
- removeFromRelated();
-}
-
-/*!
- If \a genus is \c{Node::DontCare}, find the first node in
- this node's child list that has the given \a name. If this
- node is a QML type, be sure to also look in the children
- of its property group nodes. Return the matching node or 0.
-
- If \a genus is either \c{Node::CPP} or \c {Node::QML}, then
- find all this node's children that have the given \a name,
- and return the one that satisfies the \a genus requirement.
- */
-Node *InnerNode::findChildNode(const QString& name, Node::Genus genus) const
-{
- if (genus == Node::DontCare) {
- Node *node = childMap.value(name);
- if (node && !node->isQmlPropertyGroup()) // mws asks: Why not property group?
- return node;
- if (isQmlType() || isJsType()) {
- for (int i=0; i<children_.size(); ++i) {
- Node* n = children_.at(i);
- if (n->isQmlPropertyGroup() || isJsPropertyGroup()) {
- node = static_cast<InnerNode*>(n)->findChildNode(name, genus);
- if (node)
- return node;
- }
- }
- }
- }
- else {
- NodeList nodes = childMap.values(name);
- if (!nodes.isEmpty()) {
- for (int i=0; i<nodes.size(); ++i) {
- Node* node = nodes.at(i);
- if (genus == node->genus())
- return node;
- }
- }
- }
- return primaryFunctionMap.value(name);
-}
-
-/*!
- Find all the child nodes of this node that are named
- \a name and return them in \a nodes.
- */
-void InnerNode::findChildren(const QString& name, NodeList& nodes) const
-{
- nodes = childMap.values(name);
- Node* n = primaryFunctionMap.value(name);
- if (n) {
- nodes.append(n);
- NodeList t = secondaryFunctionMap.value(name);
- if (!t.isEmpty())
- nodes.append(t);
- }
- if (!nodes.isEmpty() || !(isQmlNode() || isJsNode()))
- return;
- int i = name.indexOf(QChar('.'));
- if (i < 0)
- return;
- QString qmlPropGroup = name.left(i);
- NodeList t = childMap.values(qmlPropGroup);
- if (t.isEmpty())
- return;
- foreach (Node* n, t) {
- if (n->isQmlPropertyGroup() || n->isJsPropertyGroup()) {
- n->findChildren(name, nodes);
- if (!nodes.isEmpty())
- break;
- }
- }
-}
-
-/*!
- This function is like findChildNode(), but if a node
- with the specified \a name is found but it is not of the
- specified \a type, 0 is returned.
- */
-Node* InnerNode::findChildNode(const QString& name, Type type)
-{
- if (type == Function)
- return primaryFunctionMap.value(name);
- else {
- NodeList nodes = childMap.values(name);
- for (int i=0; i<nodes.size(); ++i) {
- Node* node = nodes.at(i);
- if (node->type() == type)
- return node;
- }
- }
- return 0;
-}
-
-/*!
- Find a function node that is a child of this nose, such
- that the function node has the specified \a name.
- */
-FunctionNode *InnerNode::findFunctionNode(const QString& name) const
-{
- return static_cast<FunctionNode *>(primaryFunctionMap.value(name));
-}
-
-/*!
- Find the function node that is a child of this node, such
- that the function has the same name and signature as the
- \a clone node.
- */
-FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const
-{
- QMap<QString,Node*>::ConstIterator c = primaryFunctionMap.constFind(clone->name());
- if (c != primaryFunctionMap.constEnd()) {
- if (isSameSignature(clone, (FunctionNode *) *c)) {
- return (FunctionNode *) *c;
- }
- else if (secondaryFunctionMap.contains(clone->name())) {
- const NodeList& secs = secondaryFunctionMap[clone->name()];
- NodeList::ConstIterator s = secs.constBegin();
- while (s != secs.constEnd()) {
- if (isSameSignature(clone, (FunctionNode *) *s))
- return (FunctionNode *) *s;
- ++s;
- }
- }
- }
- return 0;
-}
-
-/*!
- Returns the list of keys from the primary function map.
- */
-QStringList InnerNode::primaryKeys()
-{
- QStringList t;
- QMap<QString, Node*>::iterator i = primaryFunctionMap.begin();
- while (i != primaryFunctionMap.end()) {
- t.append(i.key());
- ++i;
- }
- return t;
-}
-
-/*!
- Returns the list of keys from the secondary function map.
- */
-QStringList InnerNode::secondaryKeys()
-{
- QStringList t;
- QMap<QString, NodeList>::iterator i = secondaryFunctionMap.begin();
- while (i != secondaryFunctionMap.end()) {
- t.append(i.key());
- ++i;
- }
- return t;
-}
-
-/*!
- */
-void InnerNode::setOverload(FunctionNode *func, bool overlode)
-{
- Node *node = (Node *) func;
- Node *&primary = primaryFunctionMap[func->name()];
-
- if (secondaryFunctionMap.contains(func->name())) {
- NodeList& secs = secondaryFunctionMap[func->name()];
- if (overlode) {
- if (primary == node) {
- primary = secs.first();
- secs.erase(secs.begin());
- secs.append(node);
- }
- else {
- secs.removeAll(node);
- secs.append(node);
- }
- }
- else {
- if (primary != node) {
- secs.removeAll(node);
- secs.prepend(primary);
- primary = node;
- }
- }
- }
-}
-
-/*!
- Mark all child nodes that have no documentation as having
- private access and internal status. qdoc will then ignore
- them for documentation purposes. Some nodes have an
- Intermediate status, meaning that they should be ignored,
- but not their children.
- */
-void InnerNode::makeUndocumentedChildrenInternal()
-{
- foreach (Node *child, childNodes()) {
- if (child->doc().isEmpty() && child->status() != Node::Intermediate) {
- child->setAccess(Node::Private);
- child->setStatus(Node::Internal);
- }
- }
-}
-
-/*!
- */
-void InnerNode::normalizeOverloads()
-{
- QMap<QString, Node *>::Iterator p1 = primaryFunctionMap.begin();
- while (p1 != primaryFunctionMap.end()) {
- FunctionNode *primaryFunc = (FunctionNode *) *p1;
- if (secondaryFunctionMap.contains(primaryFunc->name()) &&
- (primaryFunc->status() != Commendable ||
- primaryFunc->access() == Private)) {
-
- NodeList& secs = secondaryFunctionMap[primaryFunc->name()];
- NodeList::ConstIterator s = secs.constBegin();
- while (s != secs.constEnd()) {
- FunctionNode *secondaryFunc = (FunctionNode *) *s;
-
- // Any non-obsolete, non-compatibility, non-private functions
- // (i.e, visible functions) are preferable to the primary
- // function.
-
- if (secondaryFunc->status() == Commendable &&
- secondaryFunc->access() != Private) {
-
- *p1 = secondaryFunc;
- int index = secondaryFunctionMap[primaryFunc->name()].indexOf(secondaryFunc);
- secondaryFunctionMap[primaryFunc->name()].replace(index, primaryFunc);
- break;
- }
- ++s;
- }
- }
- ++p1;
- }
-
- QMap<QString, Node *>::ConstIterator p = primaryFunctionMap.constBegin();
- while (p != primaryFunctionMap.constEnd()) {
- FunctionNode *primaryFunc = (FunctionNode *) *p;
- if (primaryFunc->isOverload())
- primaryFunc->ove = false;
- if (secondaryFunctionMap.contains(primaryFunc->name())) {
- NodeList& secs = secondaryFunctionMap[primaryFunc->name()];
- NodeList::ConstIterator s = secs.constBegin();
- while (s != secs.constEnd()) {
- FunctionNode *secondaryFunc = (FunctionNode *) *s;
- if (!secondaryFunc->isOverload())
- secondaryFunc->ove = true;
- ++s;
- }
- }
- ++p;
- }
-
- NodeList::ConstIterator c = childNodes().constBegin();
- while (c != childNodes().constEnd()) {
- if ((*c)->isInnerNode())
- ((InnerNode *) *c)->normalizeOverloads();
- ++c;
- }
-}
-
-/*!
- */
-void InnerNode::removeFromRelated()
-{
- while (!related_.isEmpty()) {
- Node *p = static_cast<Node *>(related_.takeFirst());
-
- if (p != 0 && p->relates() == this) p->clearRelated();
- }
-}
-
-/*!
- Deletes all this node's children.
- */
-void InnerNode::deleteChildren()
-{
- NodeList childrenCopy = children_; // `children_` will be changed in ~Node()
- qDeleteAll(childrenCopy);
-}
-
-/*! \fn bool InnerNode::isInnerNode() const
- Returns \c true because this is an inner node.
- */
-
-/*!
- Returns \c true if the node is a class node or a QML type node
- that is marked as being a wrapper class or QML type, or if
- it is a member of a wrapper class or type.
- */
-bool Node::isWrapper() const
-{
- return (parent_ ? parent_->isWrapper() : false);
-}
-
-/*!
- Finds the enum type node that has \a enumValue as one of
- its enum values and returns a pointer to it. Returns 0 if
- no enum type node is found that has \a enumValue as one
- of its values.
- */
-const EnumNode *InnerNode::findEnumNodeForValue(const QString &enumValue) const
-{
- foreach (const Node *node, enumChildren_) {
- const EnumNode *en = static_cast<const EnumNode *>(node);
- if (en->hasItem(enumValue))
- return en;
- }
- return 0;
-}
-
-/*!
- Returnds the sequence number of the function node \a func
- in the list of overloaded functions for a class, such that
- all the functions have the same name as the \a func.
- */
-int InnerNode::overloadNumber(const FunctionNode *func) const
-{
- Node *node = const_cast<FunctionNode *>(func);
- if (primaryFunctionMap[func->name()] == node) {
- return 1;
- }
- else {
- return secondaryFunctionMap[func->name()].indexOf(node) + 2;
- }
-}
-
-/*!
- Returns a node list containing all the member functions of
- some class such that the functions overload the name \a funcName.
- */
-NodeList InnerNode::overloads(const QString &funcName) const
-{
- NodeList result;
- Node *primary = primaryFunctionMap.value(funcName);
- if (primary) {
- result << primary;
- result += secondaryFunctionMap[funcName];
- }
- return result;
-}
-
-/*!
- Construct an inner node (i.e., not a leaf node) of the
- given \a type and having the given \a parent and \a name.
- */
-InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name)
- : Node(type, parent, name)
-{
- switch (type) {
- case Class:
- case QmlType:
- case Namespace:
- setPageType(ApiPage);
- break;
- default:
- break;
- }
-}
-
-/*!
- Appends an \a include file to the list of include files.
- */
-void InnerNode::addInclude(const QString& include)
-{
- includes_.append(include);
-}
-
-/*!
- Sets the list of include files to \a includes.
- */
-void InnerNode::setIncludes(const QStringList& includes)
-{
- includes_ = includes;
-}
-
-/*!
- f1 is always the clone
- */
-bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2)
-{
- if (f1->parameters().count() != f2->parameters().count())
- return false;
- if (f1->isConst() != f2->isConst())
- return false;
-
- QList<Parameter>::ConstIterator p1 = f1->parameters().constBegin();
- QList<Parameter>::ConstIterator p2 = f2->parameters().constBegin();
- while (p2 != f2->parameters().constEnd()) {
- if ((*p1).hasType() && (*p2).hasType()) {
- if ((*p1).rightType() != (*p2).rightType())
- return false;
-
- QString t1 = p1->leftType();
- QString t2 = p2->leftType();
-
- if (t1.length() < t2.length())
- qSwap(t1, t2);
-
- /*
- ### hack for C++ to handle superfluous
- "Foo::" prefixes gracefully
- */
- if (t1 != t2 && t1 != (f2->parent()->name() + "::" + t2))
- return false;
- }
- ++p1;
- ++p2;
- }
- return true;
-}
-
-/*!
- Adds the \a child to this node's child list. It might also
- be necessary to update this node's internal collections and
- the child's parent pointer and output subdirectory.
- */
-void InnerNode::addChild(Node *child)
-{
- children_.append(child);
- if ((child->type() == Function) || (child->type() == QmlMethod)) {
- FunctionNode *func = (FunctionNode *) child;
- if (!primaryFunctionMap.contains(func->name())) {
- primaryFunctionMap.insert(func->name(), func);
- }
- else {
- NodeList &secs = secondaryFunctionMap[func->name()];
- secs.append(func);
- }
- }
- else {
- if (child->type() == Enum)
- enumChildren_.append(child);
- childMap.insertMulti(child->name(), child);
- }
- if (child->parent() == 0) {
- child->setParent(this);
- child->setOutputSubdirectory(this->outputSubdirectory());
- }
-}
-
-/*!
- Adds the \a child to this node's child map using \a title
- as the key. The \a child is not added to the child list
- again, because it is presumed to already be there. We just
- want to be able to find the child by its \a title.
- */
-void InnerNode::addChild(Node* child, const QString& title)
-{
- childMap.insertMulti(title, child);
-}
-
-/*!
- The \a child is removed from this node's child list and
- from this node's internal collections. The child's parent
- pointer is set to 0, but its output subdirectory is not
- changed.
- */
-void InnerNode::removeChild(Node *child)
-{
- children_.removeAll(child);
- enumChildren_.removeAll(child);
- if (child->type() == Function) {
- QMap<QString, Node *>::Iterator prim =
- primaryFunctionMap.find(child->name());
- NodeList& secs = secondaryFunctionMap[child->name()];
- if (prim != primaryFunctionMap.end() && *prim == child) {
- if (secs.isEmpty()) {
- primaryFunctionMap.remove(child->name());
- }
- else {
- primaryFunctionMap.insert(child->name(), secs.takeFirst());
- }
- }
- else {
- secs.removeAll(child);
- }
- }
- QMap<QString, Node *>::Iterator ent = childMap.find(child->name());
- while (ent != childMap.end() && ent.key() == child->name()) {
- if (*ent == child) {
- childMap.erase(ent);
- break;
- }
- ++ent;
- }
- if (child->title().isEmpty())
- return;
- ent = childMap.find(child->title());
- while (ent != childMap.end() && ent.key() == child->title()) {
- if (*ent == child) {
- childMap.erase(ent);
- break;
- }
- ++ent;
- }
- child->setParent(0);
-}
-
-/*!
- Recursively sets the output subdirectory for children
- */
-void InnerNode::setOutputSubdirectory(const QString &t)
-{
- Node::setOutputSubdirectory(t);
- for (int i = 0; i < childNodes().size(); ++i)
- childNodes().at(i)->setOutputSubdirectory(t);
-}
-
-/*!
- Find the module (Qt Core, Qt GUI, etc.) to which the class belongs.
- We do this by obtaining the full path to the header file's location
- and examine everything between "src/" and the filename. This is
- semi-dirty because we are assuming a particular directory structure.
-
- This function is only really useful if the class's module has not
- been defined in the header file with a QT_MODULE macro or with an
- \inmodule command in the documentation.
-*/
-QString Node::physicalModuleName() const
-{
- if (!physicalModuleName_.isEmpty())
- return physicalModuleName_;
-
- QString path = location().filePath();
- QString pattern = QString("src") + QDir::separator();
- int start = path.lastIndexOf(pattern);
-
- if (start == -1)
- return QString();
-
- QString moduleDir = path.mid(start + pattern.size());
- int finish = moduleDir.indexOf(QDir::separator());
-
- if (finish == -1)
- return QString();
-
- QString physicalModuleName = moduleDir.left(finish);
-
- if (physicalModuleName == "corelib")
- return "QtCore";
- else if (physicalModuleName == "uitools")
- return "QtUiTools";
- else if (physicalModuleName == "gui")
- return "QtGui";
- else if (physicalModuleName == "network")
- return "QtNetwork";
- else if (physicalModuleName == "opengl")
- return "QtOpenGL";
- else if (physicalModuleName == "svg")
- return "QtSvg";
- else if (physicalModuleName == "sql")
- return "QtSql";
- else if (physicalModuleName == "qtestlib")
- return "QtTest";
- else if (moduleDir.contains("webkit"))
- return "QtWebKit";
- else if (physicalModuleName == "xml")
- return "QtXml";
- else
- return QString();
-}
-
-/*!
- */
-void InnerNode::removeRelated(Node *pseudoChild)
-{
- related_.removeAll(pseudoChild);
-}
-
-/*!
- If this node has a child that is a QML property named \a n,
- return the pointer to that child.
- */
-QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n) const
-{
- foreach (Node* child, childNodes()) {
- if (child->type() == Node::QmlProperty) {
- if (child->name() == n)
- return static_cast<QmlPropertyNode*>(child);
- }
- else if (child->isQmlPropertyGroup()) {
- QmlPropertyNode* t = child->hasQmlProperty(n);
- if (t)
- return t;
- }
- }
- return 0;
-}
-
-/*!
- If this node has a child that is a QML property named \a n
- whose type (attached or normal property) matches \a attached,
- return the pointer to that child.
- */
-QmlPropertyNode* InnerNode::hasQmlProperty(const QString& n, bool attached) const
-{
- foreach (Node* child, childNodes()) {
- if (child->type() == Node::QmlProperty) {
- if (child->name() == n && child->isAttached() == attached)
- return static_cast<QmlPropertyNode*>(child);
- }
- else if (child->isQmlPropertyGroup()) {
- QmlPropertyNode* t = child->hasQmlProperty(n, attached);
- if (t)
- return t;
- }
- }
- return 0;
-}
-
-/*!
- \class LeafNode
- */
-
-/*! \fn bool LeafNode::isInnerNode() const
- Returns \c false because this is a LeafNode.
- */
-
-/*!
- Constructs a leaf node named \a name of the specified
- \a type. The new leaf node becomes a child of \a parent.
- */
-LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name)
- : Node(type, parent, name)
-{
- switch (type) {
- case Enum:
- case Function:
- case Typedef:
- case Variable:
- case QmlProperty:
- case QmlSignal:
- case QmlSignalHandler:
- case QmlMethod:
- case QmlBasicType:
- setPageType(ApiPage);
- break;
- default:
- break;
- }
-}
-
-/*!
- This constructor should only be used when this node's parent
- is meant to be \a parent, but this node is not to be listed
- as a child of \a parent. It is currently only used for the
- documentation case where a \e{qmlproperty} command is used
- to override the QML definition of a QML property.
- */
-LeafNode::LeafNode(InnerNode* parent, Type type, const QString& name)
- : Node(type, 0, name)
-{
- setParent(parent);
- switch (type) {
- case Enum:
- case Function:
- case Typedef:
- case Variable:
- case QmlProperty:
- case QmlSignal:
- case QmlSignalHandler:
- case QmlMethod:
- setPageType(ApiPage);
- break;
- default:
- break;
- }
-}
-
-
-/*!
- \class NamespaceNode
- */
-
-/*!
- Constructs a namespace node.
- */
-NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
- : InnerNode(Namespace, parent, name), seen_(false), tree_(0)
-{
- setGenus(Node::CPP);
- setPageType(ApiPage);
-}
-
-/*!
- \class ClassNode
- \brief This class represents a C++ class.
- */
-
-/*!
- Constructs a class node. A class node will generate an API page.
- */
-ClassNode::ClassNode(InnerNode *parent, const QString& name)
- : InnerNode(Class, parent, name)
-{
- abstract_ = false;
- wrapper_ = false;
- qmlelement = 0;
- setGenus(Node::CPP);
- setPageType(ApiPage);
-}
-
-/*!
- Adds the base class \a node to this class's list of base
- classes. The base class has the specified \a access. This
- is a resolved base class.
- */
-void ClassNode::addResolvedBaseClass(Access access, ClassNode* node)
-{
- bases_.append(RelatedClass(access, node));
- node->derived_.append(RelatedClass(access, this));
-}
-
-/*!
- Adds the derived class \a node to this class's list of derived
- classes. The derived class inherits this class with \a access.
- */
-void ClassNode::addDerivedClass(Access access, ClassNode* node)
-{
- derived_.append(RelatedClass(access, node));
-}
-
-/*!
- Add an unresolved base class to this class node's list of
- base classes. The unresolved base class will be resolved
- before the generate phase of qdoc. In an unresolved base
- class, the pointer to the base class node is 0.
- */
-void ClassNode::addUnresolvedBaseClass(Access access,
- const QStringList& path,
- const QString& signature)
-{
- bases_.append(RelatedClass(access, path, signature));
-}
-
-/*!
- Add an unresolved \c using clause to this class node's list
- of \c using clauses. The unresolved \c using clause will be
- resolved before the generate phase of qdoc. In an unresolved
- \c using clause, the pointer to the function node is 0.
- */
-void ClassNode::addUnresolvedUsingClause(const QString& signature)
-{
- usingClauses_.append(UsingClause(signature));
-}
-
-/*!
- */
-void ClassNode::fixBaseClasses()
-{
- int i;
- i = 0;
- QSet<ClassNode *> found;
-
- // Remove private and duplicate base classes.
- while (i < bases_.size()) {
- ClassNode* bc = bases_.at(i).node_;
- if (bc && (bc->access() == Node::Private || found.contains(bc))) {
- RelatedClass rc = bases_.at(i);
- bases_.removeAt(i);
- ignoredBases_.append(rc);
- const QList<RelatedClass> &bb = bc->baseClasses();
- for (int j = bb.size() - 1; j >= 0; --j)
- bases_.insert(i, bb.at(j));
- }
- else {
- ++i;
- }
- found.insert(bc);
- }
-
- i = 0;
- while (i < derived_.size()) {
- ClassNode* dc = derived_.at(i).node_;
- if (dc && dc->access() == Node::Private) {
- derived_.removeAt(i);
- const QList<RelatedClass> &dd = dc->derivedClasses();
- for (int j = dd.size() - 1; j >= 0; --j)
- derived_.insert(i, dd.at(j));
- }
- else {
- ++i;
- }
- }
-}
-
-/*!
- Not sure why this is needed.
- */
-void ClassNode::fixPropertyUsingBaseClasses(PropertyNode* pn)
-{
- QList<RelatedClass>::const_iterator bc = baseClasses().constBegin();
- while (bc != baseClasses().constEnd()) {
- ClassNode* cn = bc->node_;
- if (cn) {
- Node* n = cn->findChildNode(pn->name(), Node::Property);
- if (n) {
- PropertyNode* baseProperty = static_cast<PropertyNode*>(n);
- cn->fixPropertyUsingBaseClasses(baseProperty);
- pn->setOverriddenFrom(baseProperty);
- }
- else
- cn->fixPropertyUsingBaseClasses(pn);
- }
- ++bc;
- }
-}
-
-/*!
- Search the child list to find the property node with the
- specified \a name.
- */
-PropertyNode* ClassNode::findPropertyNode(const QString& name)
-{
- Node* n = findChildNode(name, Node::Property);
-
- if (n)
- return static_cast<PropertyNode*>(n);
-
- PropertyNode* pn = 0;
-
- const QList<RelatedClass> &bases = baseClasses();
- if (!bases.isEmpty()) {
- for (int i = 0; i < bases.size(); ++i) {
- ClassNode* cn = bases[i].node_;
- if (cn) {
- pn = cn->findPropertyNode(name);
- if (pn)
- break;
- }
- }
- }
- const QList<RelatedClass>& ignoredBases = ignoredBaseClasses();
- if (!ignoredBases.isEmpty()) {
- for (int i = 0; i < ignoredBases.size(); ++i) {
- ClassNode* cn = ignoredBases[i].node_;
- if (cn) {
- pn = cn->findPropertyNode(name);
- if (pn)
- break;
- }
- }
- }
-
- return pn;
-}
-
-/*!
- This function does a recursive search of this class node's
- base classes looking for one that has a QML element. If it
- finds one, it returns the pointer to that QML element. If
- it doesn't find one, it returns null.
- */
-QmlTypeNode* ClassNode::findQmlBaseNode()
-{
- QmlTypeNode* result = 0;
- const QList<RelatedClass>& bases = baseClasses();
-
- if (!bases.isEmpty()) {
- for (int i = 0; i < bases.size(); ++i) {
- ClassNode* cn = bases[i].node_;
- if (cn && cn->qmlElement()) {
- return cn->qmlElement();
- }
- }
- for (int i = 0; i < bases.size(); ++i) {
- ClassNode* cn = bases[i].node_;
- if (cn) {
- result = cn->findQmlBaseNode();
- if (result != 0) {
- return result;
- }
- }
- }
- }
- return result;
-}
-
-/*!
- \class DocumentNode
- */
-
-/*!
- The type of a DocumentNode is Document, and it has a \a subtype,
- which specifies the type of DocumentNode. The page type for
- the page index is set here.
- */
-DocumentNode::DocumentNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype)
- : InnerNode(Document, parent, name), nodeSubtype_(subtype)
-{
- setGenus(Node::DOC);
- switch (subtype) {
- case Page:
- setPageType(ptype);
- break;
- case DitaMap:
- setPageType(ptype);
- break;
- case Example:
- setPageType(ExamplePage);
- break;
- default:
- break;
- }
-}
-
-/*! \fn QString DocumentNode::title() const
- Returns the document node's title. This is used for the page title.
-*/
-
-/*!
- Sets the document node's \a title. This is used for the page title.
- */
-void DocumentNode::setTitle(const QString &title)
-{
- title_ = title;
- parent()->addChild(this, title);
-}
-
-/*!
- Returns the document node's full title, which is usually
- just title(), but for some SubType values is different
- from title()
- */
-QString DocumentNode::fullTitle() const
-{
- if (nodeSubtype_ == File) {
- if (title().isEmpty())
- return name().mid(name().lastIndexOf('/') + 1) + " Example File";
- else
- return title();
- }
- else if (nodeSubtype_ == Image) {
- if (title().isEmpty())
- return name().mid(name().lastIndexOf('/') + 1) + " Image File";
- else
- return title();
- }
- else if (nodeSubtype_ == HeaderFile) {
- if (title().isEmpty())
- return name();
- else
- return name() + " - " + title();
- }
- else {
- return title();
- }
-}
-
-/*!
- Returns the subtitle.
- */
-QString DocumentNode::subTitle() const
-{
- if (!subtitle_.isEmpty())
- return subtitle_;
-
- if ((nodeSubtype_ == File) || (nodeSubtype_ == Image)) {
- if (title().isEmpty() && name().contains(QLatin1Char('/')))
- return name();
- }
- return QString();
-}
-
-/*!
- \class EnumNode
- */
-
-/*!
- The constructor for the node representing an enum type
- has a \a parent class and an enum type \a name.
- */
-EnumNode::EnumNode(InnerNode *parent, const QString& name)
- : LeafNode(Enum, parent, name), ft(0)
-{
- setGenus(Node::CPP);
-}
-
-/*!
- Add \a item to the enum type's item list.
- */
-void EnumNode::addItem(const EnumItem& item)
-{
- itms.append(item);
- names.insert(item.name());
-}
-
-/*!
- Returns the access level of the enumeration item named \a name.
- Apparently it is private if it has been omitted by qdoc's
- omitvalue command. Otherwise it is public.
- */
-Node::Access EnumNode::itemAccess(const QString &name) const
-{
- if (doc().omitEnumItemNames().contains(name))
- return Private;
- return Public;
-}
-
-/*!
- Returns the enum value associated with the enum \a name.
- */
-QString EnumNode::itemValue(const QString &name) const
-{
- foreach (const EnumItem &item, itms) {
- if (item.name() == name)
- return item.value();
- }
- return QString();
-}
-
-/*!
- \class TypedefNode
- */
-
-/*!
- */
-TypedefNode::TypedefNode(InnerNode *parent, const QString& name)
- : LeafNode(Typedef, parent, name), ae(0)
-{
- setGenus(Node::CPP);
-}
-
-/*!
- */
-void TypedefNode::setAssociatedEnum(const EnumNode *enume)
-{
- ae = enume;
-}
-
-/*!
- \class Parameter
- \brief The class Parameter contains one parameter.
-
- A parameter can be a function parameter or a macro
- parameter.
- */
-
-/*!
- Constructs this parameter from the left and right types
- \a leftType and rightType, the parameter \a name, and the
- \a defaultValue. In practice, \a rightType is not used,
- and I don't know what is was meant for.
- */
-Parameter::Parameter(const QString& leftType,
- const QString& rightType,
- const QString& name,
- const QString& defaultValue)
- : lef(leftType), rig(rightType), nam(name), def(defaultValue)
-{
-}
-
-/*!
- The standard copy constructor copies the strings from \a p.
- */
-Parameter::Parameter(const Parameter& p)
- : lef(p.lef), rig(p.rig), nam(p.nam), def(p.def)
-{
-}
-
-/*!
- Assigning Parameter \a p to this Parameter copies the
- strings across.
- */
-Parameter& Parameter::operator=(const Parameter& p)
-{
- lef = p.lef;
- rig = p.rig;
- nam = p.nam;
- def = p.def;
- return *this;
-}
-
-/*!
- Reconstructs the text describing the parameter and
- returns it. If \a value is true, the default value
- will be included, if there is one.
- */
-QString Parameter::reconstruct(bool value) const
-{
- QString p = lef + rig;
- if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' ')))
- p += QLatin1Char(' ');
- p += nam;
- if (value && !def.isEmpty())
- p += " = " + def;
- return p;
-}
-
-
-/*!
- \class FunctionNode
- */
-
-/*!
- Construct a function node for a C++ function. It's parent
- is \a parent, and it's name is \a name.
- */
-FunctionNode::FunctionNode(InnerNode *parent, const QString& name)
- : LeafNode(Function, parent, name),
- met(Plain),
- vir(NonVirtual),
- con(false),
- sta(false),
- ove(false),
- reimp(false),
- attached_(false),
- privateSignal_(false),
- rf(0),
- ap(0)
-{
- setGenus(Node::CPP);
-}
-
-/*!
- Construct a function node for a QML method or signal, specified
- by \a type. It's parent is \a parent, and it's name is \a name.
- If \a attached is true, it is an attached method or signal.
- */
-FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached)
- : LeafNode(type, parent, name),
- met(Plain),
- vir(NonVirtual),
- con(false),
- sta(false),
- ove(false),
- reimp(false),
- attached_(attached),
- privateSignal_(false),
- rf(0),
- ap(0)
-{
- setGenus(Node::QML);
- if (type == QmlMethod || type == QmlSignal) {
- if (name.startsWith("__"))
- setStatus(Internal);
- }
- else if (type == Function)
- setGenus(Node::CPP);
-}
-
-/*!
- Sets the \a virtualness of this function. If the \a virtualness
- is PureVirtual, and if the parent() is a ClassNode, set the parent's
- \e abstract flag to true.
- */
-void FunctionNode::setVirtualness(Virtualness virtualness)
-{
- vir = virtualness;
- if ((virtualness == PureVirtual) && parent() &&
- (parent()->type() == Node::Class))
- parent()->setAbstract(true);
-}
-
-/*!
- */
-void FunctionNode::setOverload(bool overlode)
-{
- parent()->setOverload(this, overlode);
- ove = overlode;
-}
-
-/*!
- Sets the function node's reimplementation flag to \a r.
- When \a r is true, it is supposed to mean that this function
- is a reimplementation of a virtual function in a base class,
- but it really just means the \e reimp command was seen in the
- qdoc comment.
- */
-void FunctionNode::setReimp(bool r)
-{
- reimp = r;
-}
-
-/*!
- Append \a parameter to the parameter list.
- */
-void FunctionNode::addParameter(const Parameter& parameter)
-{
- params.append(parameter);
-}
-
-/*!
- */
-void FunctionNode::borrowParameterNames(const FunctionNode *source)
-{
- QList<Parameter>::Iterator t = params.begin();
- QList<Parameter>::ConstIterator s = source->params.constBegin();
- while (s != source->params.constEnd() && t != params.end()) {
- if (!(*s).name().isEmpty())
- (*t).setName((*s).name());
- ++s;
- ++t;
- }
-}
-
-/*!
- If this function is a reimplementation, \a from points
- to the FunctionNode of the function being reimplemented.
- */
-void FunctionNode::setReimplementedFrom(FunctionNode *from)
-{
- rf = from;
- from->rb.append(this);
-}
-
-/*!
- Sets the "associated" property to \a property. The function
- might be the setter or getter for a property, for example.
- */
-void FunctionNode::setAssociatedProperty(PropertyNode *property)
-{
- ap = property;
-}
-
-/*!
- Returns the overload number for this function obtained
- from the parent.
- */
-int FunctionNode::overloadNumber() const
-{
- return parent()->overloadNumber(this);
-}
-
-/*!
- Returns the list of parameter names.
- */
-QStringList FunctionNode::parameterNames() const
-{
- QStringList names;
- QList<Parameter>::ConstIterator p = parameters().constBegin();
- while (p != parameters().constEnd()) {
- names << (*p).name();
- ++p;
- }
- return names;
-}
-
-/*!
- Returns a raw list of parameters. If \a names is true, the
- names are included. If \a values is true, the default values
- are included, if any are present.
- */
-QString FunctionNode::rawParameters(bool names, bool values) const
-{
- QString raw;
- foreach (const Parameter &parameter, parameters()) {
- raw += parameter.leftType() + parameter.rightType();
- if (names)
- raw += parameter.name();
- if (values)
- raw += parameter.defaultValue();
- }
- return raw;
-}
-
-/*!
- Returns the list of reconstructed parameters. If \a values
- is true, the default values are included, if any are present.
- */
-QStringList FunctionNode::reconstructParams(bool values) const
-{
- QStringList params;
- QList<Parameter>::ConstIterator p = parameters().constBegin();
- while (p != parameters().constEnd()) {
- params << (*p).reconstruct(values);
- ++p;
- }
- return params;
-}
-
-/*!
- Reconstructs and returns the function's signature. If \a values
- is true, the default values of the parameters are included, if
- present.
- */
-QString FunctionNode::signature(bool values) const
-{
- QString s;
- if (!returnType().isEmpty())
- s = returnType() + QLatin1Char(' ');
- s += name() + QLatin1Char('(');
- QStringList params = reconstructParams(values);
- int p = params.size();
- if (p > 0) {
- for (int i=0; i<p; i++) {
- s += params[i];
- if (i < (p-1))
- s += ", ";
- }
- }
- s += QLatin1Char(')');
- return s;
-}
-
-/*!
- Print some debugging stuff.
- */
-void FunctionNode::debug() const
-{
- qDebug("QML METHOD %s rt %s pp %s",
- qPrintable(name()), qPrintable(rt), qPrintable(pp.join(' ')));
-}
-
-/*!
- \class PropertyNode
-
- This class describes one instance of using the Q_PROPERTY macro.
- */
-
-/*!
- The constructor sets the \a parent and the \a name, but
- everything else is set to default values.
- */
-PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
- : LeafNode(Property, parent, name),
- stored_(FlagValueDefault),
- designable_(FlagValueDefault),
- scriptable_(FlagValueDefault),
- writable_(FlagValueDefault),
- user_(FlagValueDefault),
- cst(false),
- fnl(false),
- rev(-1),
- overrides(0)
-{
- setGenus(Node::CPP);
-}
-
-/*!
- Sets this property's \e {overridden from} property to
- \a baseProperty, which indicates that this property
- overrides \a baseProperty. To begin with, all the values
- in this property are set to the corresponding values in
- \a baseProperty.
-
- We probably should ensure that the constant and final
- attributes are not being overridden improperly.
- */
-void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
-{
- for (int i = 0; i < NumFunctionRoles; ++i) {
- if (funcs[i].isEmpty())
- funcs[i] = baseProperty->funcs[i];
- }
- if (stored_ == FlagValueDefault)
- stored_ = baseProperty->stored_;
- if (designable_ == FlagValueDefault)
- designable_ = baseProperty->designable_;
- if (scriptable_ == FlagValueDefault)
- scriptable_ = baseProperty->scriptable_;
- if (writable_ == FlagValueDefault)
- writable_ = baseProperty->writable_;
- if (user_ == FlagValueDefault)
- user_ = baseProperty->user_;
- overrides = baseProperty;
-}
-
-/*!
- */
-QString PropertyNode::qualifiedDataType() const
-{
- if (setters().isEmpty() && resetters().isEmpty()) {
- if (type_.contains(QLatin1Char('*')) || type_.contains(QLatin1Char('&'))) {
- // 'QWidget *' becomes 'QWidget *' const
- return type_ + " const";
- }
- else {
- /*
- 'int' becomes 'const int' ('int const' is
- correct C++, but looks wrong)
- */
- return "const " + type_;
- }
- }
- else {
- return type_;
- }
-}
-
-bool QmlTypeNode::qmlOnly = false;
-QMultiMap<QString,Node*> QmlTypeNode::inheritedBy;
-
-/*!
- Constructs a Qml class node. The new node has the given
- \a parent and \a name.
- */
-QmlTypeNode::QmlTypeNode(InnerNode *parent, const QString& name)
- : InnerNode(QmlType, parent, name),
- abstract_(false),
- cnodeRequired_(false),
- wrapper_(false),
- cnode_(0),
- logicalModule_(0),
- qmlBaseNode_(0)
-{
- int i = 0;
- if (name.startsWith("QML:")) {
- qDebug() << "BOGUS QML qualifier:" << name;
- i = 4;
- }
- setTitle(name.mid(i));
- setPageType(Node::ApiPage);
- setGenus(Node::QML);
-}
-
-/*!
- Needed for printing a debug messages.
- */
-QmlTypeNode::~QmlTypeNode()
-{
- // nothing.
-}
-
-/*!
- Clear the static maps so that subsequent runs don't try to use
- contents from a previous run.
- */
-void QmlTypeNode::terminate()
-{
- inheritedBy.clear();
-}
-
-/*!
- Record the fact that QML class \a base is inherited by
- QML class \a sub.
- */
-void QmlTypeNode::addInheritedBy(const QString& base, Node* sub)
-{
- if (sub->isInternal())
- return;
- if (inheritedBy.constFind(base,sub) == inheritedBy.constEnd())
- inheritedBy.insert(base,sub);
-}
-
-/*!
- Loads the list \a subs with the nodes of all the subclasses of \a base.
- */
-void QmlTypeNode::subclasses(const QString& base, NodeList& subs)
-{
- subs.clear();
- if (inheritedBy.count(base) > 0) {
- subs = inheritedBy.values(base);
- }
-}
-
-QmlTypeNode* QmlTypeNode::qmlBaseNode()
-{
- if (!qmlBaseNode_ && !qmlBaseName_.isEmpty()) {
- qmlBaseNode_ = QDocDatabase::qdocDB()->findQmlType(qmlBaseName_);
- }
- return qmlBaseNode_;
-}
-
-/*!
- If this QML type node has a base type node,
- return the fully qualified name of that QML
- type, i.e. <QML-module-name>::<QML-type-name>.
- */
-QString QmlTypeNode::qmlFullBaseName() const
-{
- QString result;
- if (qmlBaseNode_) {
- result = qmlBaseNode_->logicalModuleName() + "::" + qmlBaseNode_->name();
- }
- return result;
-}
-
-/*!
- If the QML type's QML module pointer is set, return the QML
- module name from the QML module node. Otherwise, return the
- empty string.
- */
-QString QmlTypeNode::logicalModuleName() const
-{
- return (logicalModule_ ? logicalModule_->logicalModuleName() : QString());
-}
-
-/*!
- If the QML type's QML module pointer is set, return the QML
- module version from the QML module node. Otherwise, return
- the empty string.
- */
-QString QmlTypeNode::logicalModuleVersion() const
-{
- return (logicalModule_ ? logicalModule_->logicalModuleVersion() : QString());
-}
-
-/*!
- If the QML type's QML module pointer is set, return the QML
- module identifier from the QML module node. Otherwise, return
- the empty string.
- */
-QString QmlTypeNode::logicalModuleIdentifier() const
-{
- return (logicalModule_ ? logicalModule_->logicalModuleIdentifier() : QString());
-}
-
-/*!
- Constructs a Qml basic type node. The new node has the given
- \a parent and \a name.
- */
-QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
- const QString& name)
- : InnerNode(QmlBasicType, parent, name)
-{
- setTitle(name);
- setGenus(Node::QML);
-}
-
-/*!
- Constructor for the Qml property group node. \a parent is
- always a QmlTypeNode.
- */
-QmlPropertyGroupNode::QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name)
- : InnerNode(QmlPropertyGroup, parent, name)
-{
- idNumber_ = -1;
- setGenus(Node::QML);
-}
-
-/*!
- Return the property group node's id number for use in
- constructing an id attribute for the property group.
- If the id number is currently -1, increment the global
- property group count and set the id number to the new
- value.
- */
-QString QmlPropertyGroupNode::idNumber()
-{
- if (idNumber_ == -1)
- idNumber_ = incPropertyGroupCount();
- return QString().setNum(idNumber_);
-}
-
-/*!
- Constructor for the QML property node.
- */
-QmlPropertyNode::QmlPropertyNode(InnerNode* parent,
- const QString& name,
- const QString& type,
- bool attached)
- : LeafNode(QmlProperty, parent, name),
- type_(type),
- stored_(FlagValueDefault),
- designable_(FlagValueDefault),
- isAlias_(false),
- isdefault_(false),
- attached_(attached),
- readOnly_(FlagValueDefault)
-{
- setPageType(ApiPage);
- if (type_ == QString("alias"))
- isAlias_ = true;
- if (name.startsWith("__"))
- setStatus(Internal);
- setGenus(Node::QML);
-}
-
-/*!
- Returns \c true if a QML property or attached property is
- not read-only. The algorithm for figuring this out is long
- amd tedious and almost certainly will break. It currently
- doesn't work for the qmlproperty:
-
- \code
- bool PropertyChanges::explicit,
- \endcode
-
- ...because the tokenizer gets confused on \e{explicit}.
- */
-bool QmlPropertyNode::isWritable()
-{
- if (readOnly_ != FlagValueDefault)
- return !fromFlagValue(readOnly_, false);
-
- QmlTypeNode* qcn = qmlTypeNode();
- if (qcn) {
- if (qcn->cppClassRequired()) {
- if (qcn->classNode()) {
- PropertyNode* pn = findCorrespondingCppProperty();
- if (pn)
- return pn->isWritable();
- else
- location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
- "in C++ class documented as QML type: "
- "(property not found in the C++ class or its base classes)")
- .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
- }
- else
- location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 "
- "in C++ class documented as QML type: "
- "(C++ class not specified or not found).")
- .arg(logicalModuleName()).arg(qmlTypeName()).arg(name()));
- }
- }
- return true;
-}
-
-/*!
- Returns a pointer this QML property's corresponding C++
- property, if it has one.
- */
-PropertyNode* QmlPropertyNode::findCorrespondingCppProperty()
-{
- PropertyNode* pn;
- Node* n = parent();
- while (n && !(n->isQmlType() || n->isJsType()))
- n = n->parent();
- if (n) {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(n);
- ClassNode* cn = qcn->classNode();
- if (cn) {
- /*
- If there is a dot in the property name, first
- find the C++ property corresponding to the QML
- property group.
- */
- QStringList dotSplit = name().split(QChar('.'));
- pn = cn->findPropertyNode(dotSplit[0]);
- if (pn) {
- /*
- Now find the C++ property corresponding to
- the QML property in the QML property group,
- <group>.<property>.
- */
- if (dotSplit.size() > 1) {
- QStringList path(extractClassName(pn->qualifiedDataType()));
- Node* nn = QDocDatabase::qdocDB()->findClassNode(path);
- if (nn) {
- ClassNode* cn = static_cast<ClassNode*>(nn);
- PropertyNode *pn2 = cn->findPropertyNode(dotSplit[1]);
- /*
- If found, return the C++ property
- corresponding to the QML property.
- Otherwise, return the C++ property
- corresponding to the QML property
- group.
- */
- return (pn2 ? pn2 : pn);
- }
- }
- else
- return pn;
- }
- }
- }
- return 0;
-}
-
-/*!
- This returns the name of the owning QML type.
- */
-QString QmlPropertyNode::element() const
-{
- if (parent()->isQmlPropertyGroup())
- return parent()->element();
- return parent()->name();
-}
-
-/*!
- Construct the full document name for this node and return it.
- */
-QString Node::fullDocumentName() const
-{
- QStringList pieces;
- const Node* n = this;
-
- do {
- if (!n->name().isEmpty() && !n->isQmlPropertyGroup())
- pieces.insert(0, n->name());
-
- if ((n->isQmlType() || n->isJsType()) && !n->logicalModuleName().isEmpty()) {
- pieces.insert(0, n->logicalModuleName());
- break;
- }
-
- if (n->isDocumentNode())
- break;
-
- // Examine the parent node if one exists.
- if (n->parent())
- n = n->parent();
- else
- break;
- } while (true);
-
- // Create a name based on the type of the ancestor node.
- QString concatenator = "::";
- if (n->isQmlType() || n->isJsType())
- concatenator = QLatin1Char('.');
-
- if (n->isDocumentNode())
- concatenator = QLatin1Char('#');
-
- return pieces.join(concatenator);
-}
-
-/*!
- Returns the \a str as an NCName, which means the name can
- be used as the value of an \e id attribute. Search for NCName
- on the internet for details of what can be an NCName.
- */
-QString Node::cleanId(const QString &str)
-{
- QString clean;
- QString name = str.simplified();
-
- if (name.isEmpty())
- return clean;
-
- name = name.replace("::","-");
- name = name.replace(QLatin1Char(' '), QLatin1Char('-'));
- name = name.replace("()","-call");
-
- clean.reserve(name.size() + 20);
- if (!str.startsWith("id-"))
- clean = "id-";
- const QChar c = name[0];
- const uint u = c.unicode();
-
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9')) {
- clean += c;
- }
- else if (u == '~') {
- clean += "dtor.";
- }
- else if (u == '_') {
- clean += "underscore.";
- }
- else {
- clean += QLatin1Char('a');
- }
-
- for (int i = 1; i < (int) name.length(); i++) {
- const QChar c = name[i];
- const uint u = c.unicode();
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9') || u == '-' ||
- u == '_' || u == '.') {
- clean += c;
- }
- else if (c.isSpace() || u == ':' ) {
- clean += QLatin1Char('-');
- }
- else if (u == '!') {
- clean += "-not";
- }
- else if (u == '&') {
- clean += "-and";
- }
- else if (u == '<') {
- clean += "-lt";
- }
- else if (u == '=') {
- clean += "-eq";
- }
- else if (u == '>') {
- clean += "-gt";
- }
- else if (u == '#') {
- clean += "-hash";
- }
- else if (u == '(') {
- clean += QLatin1Char('-');
- }
- else if (u == ')') {
- clean += QLatin1Char('-');
- }
- else {
- clean += QLatin1Char('-');
- clean += QString::number((int)u, 16);
- }
- }
- return clean;
-}
-
-/*!
- Creates a string that can be used as a UUID for the node,
- depending on the type and subtype of the node. Uniquenss
- is not guaranteed, but it is expected that strings created
- here will be unique within an XML document. Hence, the
- returned string can be used as the value of an \e id
- attribute.
- */
-QString Node::idForNode() const
-{
- const FunctionNode* func;
- const TypedefNode* tdn;
- QString str;
-
- switch (type()) {
- case Node::Namespace:
- str = "namespace-" + fullDocumentName();
- break;
- case Node::Class:
- str = "class-" + fullDocumentName();
- break;
- case Node::Enum:
- str = "enum-" + name();
- break;
- case Node::Typedef:
- tdn = static_cast<const TypedefNode*>(this);
- if (tdn->associatedEnum()) {
- return tdn->associatedEnum()->idForNode();
- }
- else {
- str = "typedef-" + name();
- }
- break;
- case Node::Function:
- func = static_cast<const FunctionNode*>(this);
- if (func->associatedProperty()) {
- return func->associatedProperty()->idForNode();
- }
- else {
- if (func->name().startsWith("operator")) {
- str.clear();
- /*
- The test below should probably apply to all
- functions, but for now, overloaded operators
- are the only ones that produce duplicate id
- attributes in the DITA XML files.
- */
- if (relatesTo_)
- str = "nonmember-";
- QString op = func->name().mid(8);
- if (!op.isEmpty()) {
- int i = 0;
- while (i<op.size() && op.at(i) == ' ')
- ++i;
- if (i>0 && i<op.size()) {
- op = op.mid(i);
- }
- if (!op.isEmpty()) {
- i = 0;
- while (i < op.size()) {
- const QChar c = op.at(i);
- const uint u = c.unicode();
- if ((u >= 'a' && u <= 'z') ||
- (u >= 'A' && u <= 'Z') ||
- (u >= '0' && u <= '9'))
- break;
- ++i;
- }
- str += "operator-";
- if (i>0) {
- QString tail = op.mid(i);
- op = op.left(i);
- if (operators_.contains(op)) {
- str += operators_.value(op);
- if (!tail.isEmpty())
- str += QLatin1Char('-') + tail;
- }
- else
- qDebug() << "qdoc internal error: Operator missing from operators_ map:" << op;
- }
- else {
- str += op;
- }
- }
- }
- }
- else if (parent_) {
- if (parent_->isClass())
- str = "class-member-" + func->name();
- else if (parent_->isNamespace())
- str = "namespace-member-" + func->name();
- else if (parent_->isQmlType())
- str = "qml-method-" + parent_->name().toLower() + "-" + func->name();
- else if (parent_->isJsType())
- str = "js-method-" + parent_->name().toLower() + "-" + func->name();
- else if (parent_->type() == Document) {
- qDebug() << "qdoc internal error: Node subtype not handled:"
- << parent_->subType() << func->name();
- }
- else
- qDebug() << "qdoc internal error: Node type not handled:"
- << parent_->type() << func->name();
-
- }
- if (func->overloadNumber() != 1)
- str += QLatin1Char('-') + QString::number(func->overloadNumber());
- }
- break;
- case Node::QmlType:
- if (genus() == QML)
- str = "qml-class-" + name();
- else
- str = "js-type-" + name();
- break;
- case Node::QmlBasicType:
- if (genus() == QML)
- str = "qml-basic-type-" + name();
- else
- str = "js-basic-type-" + name();
- break;
- case Node::Document:
- {
- switch (subType()) {
- case Node::Page:
- case Node::HeaderFile:
- str = title();
- if (str.isEmpty()) {
- str = name();
- if (str.endsWith(".html"))
- str.remove(str.size()-5,5);
- }
- str.replace(QLatin1Char('/'), QLatin1Char('-'));
- break;
- case Node::File:
- str = name();
- str.replace(QLatin1Char('/'), QLatin1Char('-'));
- break;
- case Node::Example:
- str = name();
- str.replace(QLatin1Char('/'), QLatin1Char('-'));
- break;
- default:
- qDebug() << "ERROR: A case was not handled in Node::idForNode():"
- << "subType():" << subType() << "type():" << type();
- break;
- }
- }
- break;
- case Node::Group:
- case Node::Module:
- str = title();
- if (str.isEmpty()) {
- str = name();
- if (str.endsWith(".html"))
- str.remove(str.size()-5,5);
- }
- str.replace(QLatin1Char('/'), QLatin1Char('-'));
- break;
- case Node::QmlModule:
- if (genus() == QML)
- str = "qml-module-" + name();
- else
- str = "js-module-" + name();
- break;
- case Node::QmlProperty:
- if (genus() == QML)
- str = "qml-";
- else
- str = "js-";
- if (isAttached())
- str += "attached-property-" + name();
- else
- str += "property-" + name();
- break;
- case Node::QmlPropertyGroup:
- {
- Node* n = const_cast<Node*>(this);
- if (genus() == QML)
- str = "qml-propertygroup-" + n->name();
- else
- str = "js-propertygroup-" + n->name();
- }
- break;
- case Node::Property:
- str = "property-" + name();
- break;
- case Node::QmlSignal:
- if (genus() == QML)
- str = "qml-signal-" + name();
- else
- str = "js-signal-" + name();
- break;
- case Node::QmlSignalHandler:
- if (genus() == QML)
- str = "qml-signal-handler-" + name();
- else
- str = "js-signal-handler-" + name();
- break;
- case Node::QmlMethod:
- func = static_cast<const FunctionNode*>(this);
- if (genus() == QML)
- str = "qml-method-";
- else
- str = "js-method-";
- str += parent_->name().toLower() + "-" + func->name();
- if (func->overloadNumber() != 1)
- str += QLatin1Char('-') + QString::number(func->overloadNumber());
- break;
- case Node::Variable:
- str = "var-" + name();
- break;
- default:
- qDebug() << "ERROR: A case was not handled in Node::idForNode():"
- << "type():" << type() << "subType():" << subType();
- break;
- }
- if (str.isEmpty()) {
- qDebug() << "ERROR: A link text was empty in Node::idForNode():"
- << "type():" << type() << "subType():" << subType()
- << "name():" << name()
- << "title():" << title();
- }
- else {
- str = cleanId(str);
- }
- return str;
-}
-
-/*!
- Prints the inner node's list of children.
- For debugging only.
- */
-void InnerNode::printChildren(const QString& title)
-{
- qDebug() << title << name() << children_.size();
- if (children_.size() > 0) {
- for (int i=0; i<children_.size(); ++i) {
- Node* n = children_.at(i);
- qDebug() << " CHILD:" << n->name() << n->nodeTypeString() << n->nodeSubtypeString();
- }
- }
-}
-
-/*!
- Returns \c true if the collection node's member list is
- not empty.
- */
-bool CollectionNode::hasMembers() const
-{
- return !members_.isEmpty();
-}
-
-/*!
- Appends \a node to the collection node's member list, if
- and only if it isn't already in the member list.
- */
-void CollectionNode::addMember(Node* node)
-{
- if (!members_.contains(node))
- members_.append(node);
-}
-
-/*!
- Returns \c true if this collection node contains at least
- one namespace node.
- */
-bool CollectionNode::hasNamespaces() const
-{
- if (!members_.isEmpty()) {
- NodeList::const_iterator i = members_.begin();
- while (i != members_.end()) {
- if ((*i)->isNamespace())
- return true;
- ++i;
- }
- }
- return false;
-}
-
-/*!
- Returns \c true if this collection node contains at least
- one class node.
- */
-bool CollectionNode::hasClasses() const
-{
- if (!members_.isEmpty()) {
- NodeList::const_iterator i = members_.cbegin();
- while (i != members_.cend()) {
- if ((*i)->isClass())
- return true;
- ++i;
- }
- }
- return false;
-}
-
-/*!
- Loads \a out with all this collection node's members that
- are namespace nodes.
- */
-void CollectionNode::getMemberNamespaces(NodeMap& out)
-{
- out.clear();
- NodeList::const_iterator i = members_.cbegin();
- while (i != members_.cend()) {
- if ((*i)->isNamespace())
- out.insert((*i)->name(),(*i));
- ++i;
- }
-}
-
-/*!
- Loads \a out with all this collection node's members that
- are class nodes.
- */
-void CollectionNode::getMemberClasses(NodeMap& out)
-{
- out.clear();
- NodeList::const_iterator i = members_.cbegin();
- while (i != members_.cend()) {
- if ((*i)->isClass())
- out.insert((*i)->name(),(*i));
- ++i;
- }
-}
-
-/*!
- Prints the collection node's list of members.
- For debugging only.
- */
-void CollectionNode::printMembers(const QString& title)
-{
- qDebug() << title << name() << members_.size();
- if (members_.size() > 0) {
- for (int i=0; i<members_.size(); ++i) {
- Node* n = members_.at(i);
- qDebug() << " MEMBER:" << n->name() << n->nodeTypeString() << n->nodeSubtypeString();
- }
- }
-}
-
-/*!
- Sets the document node's \a title. This is used for the page title.
- */
-void CollectionNode::setTitle(const QString& title)
-{
- title_ = title;
- parent()->addChild(this, title);
-}
-
-/*!
- This function splits \a arg on the blank character to get a
- logical module name and version number. If the version number
- is present, it spilts the version number on the '.' character
- to get a major version number and a minor vrsion number. If
- the version number is present, both the major and minor version
- numbers should be there, but the minor version number is not
- absolutely necessary.
- */
-void CollectionNode::setLogicalModuleInfo(const QString& arg)
-{
- QStringList blankSplit = arg.split(QLatin1Char(' '));
- logicalModuleName_ = blankSplit[0];
- if (blankSplit.size() > 1) {
- QStringList dotSplit = blankSplit[1].split(QLatin1Char('.'));
- logicalModuleVersionMajor_ = dotSplit[0];
- if (dotSplit.size() > 1)
- logicalModuleVersionMinor_ = dotSplit[1];
- else
- logicalModuleVersionMinor_ = "0";
- }
-}
-
-/*!
- This function accepts the logical module \a info as a string
- list. If the logical module info contains the version number,
- it spilts the version number on the '.' character to get the
- major and minor vrsion numbers. Both major and minor version
- numbers should be provided, but the minor version number is
- not strictly necessary.
- */
-void CollectionNode::setLogicalModuleInfo(const QStringList& info)
-{
- logicalModuleName_ = info[0];
- if (info.size() > 1) {
- QStringList dotSplit = info[1].split(QLatin1Char('.'));
- logicalModuleVersionMajor_ = dotSplit[0];
- if (dotSplit.size() > 1)
- logicalModuleVersionMinor_ = dotSplit[1];
- else
- logicalModuleVersionMinor_ = "0";
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
deleted file mode 100644
index 2ccd97dbd1..0000000000
--- a/src/tools/qdoc/node.h
+++ /dev/null
@@ -1,1149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 NODE_H
-#define NODE_H
-
-#include <qdir.h>
-#include <qmap.h>
-#include <qpair.h>
-#include <qstringlist.h>
-
-#include "codechunk.h"
-#include "doc.h"
-
-QT_BEGIN_NAMESPACE
-
-class Node;
-class Tree;
-class EnumNode;
-class ClassNode;
-class InnerNode;
-class ExampleNode;
-class TypedefNode;
-class QmlTypeNode;
-class QDocDatabase;
-class FunctionNode;
-class PropertyNode;
-class CollectionNode;
-class QmlPropertyNode;
-
-typedef QList<Node*> NodeList;
-typedef QMap<QString, Node*> NodeMap;
-typedef QMultiMap<QString, Node*> NodeMultiMap;
-typedef QPair<int, int> NodeTypePair;
-typedef QList<NodeTypePair> NodeTypeList;
-typedef QMap<QString, CollectionNode*> CNMap;
-typedef QMultiMap<QString, CollectionNode*> CNMultiMap;
-
-class Node
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Node)
-
-public:
- enum Type {
- NoType,
- Namespace,
- Class,
- Document,
- Enum,
- Typedef,
- Function,
- Property,
- Variable,
- Group,
- Module,
- QmlType,
- QmlModule,
- QmlPropertyGroup,
- QmlProperty,
- QmlSignal,
- QmlSignalHandler,
- QmlMethod,
- QmlBasicType,
- LastType
- };
-
- enum SubType {
- NoSubType,
- Example,
- HeaderFile,
- File,
- Image,
- Page,
- ExternalPage,
- DitaMap,
- LastSubtype
- };
-
- enum Genus { DontCare, CPP, JS, QML, DOC };
-
- enum Access { Public, Protected, Private };
-
- enum Status {
- Compat,
- Obsolete,
- Deprecated,
- Preliminary,
- Commendable,
- Internal,
- Intermediate
- }; // don't reorder this enum
-
- enum ThreadSafeness {
- UnspecifiedSafeness,
- NonReentrant,
- Reentrant,
- ThreadSafe
- };
-
- enum LinkType {
- StartLink,
- NextLink,
- PreviousLink,
- ContentsLink,
- IndexLink /*,
- GlossaryLink,
- CopyrightLink,
- ChapterLink,
- SectionLink,
- SubsectionLink,
- AppendixLink */
- };
-
- enum PageType {
- NoPageType,
- ApiPage,
- ArticlePage,
- ExamplePage,
- HowToPage,
- OverviewPage,
- TutorialPage,
- FAQPage,
- DitaMapPage,
- OnBeyondZebra
- };
-
- enum FlagValue {
- FlagValueDefault = -1,
- FlagValueFalse = 0,
- FlagValueTrue = 1
- };
-
- virtual ~Node();
-
- QString plainName() const;
- QString plainFullName(const Node* relative = 0) const;
- QString fullName(const Node* relative=0) const;
-
- const QString& fileNameBase() const { return fileNameBase_; }
- bool hasFileNameBase() const { return !fileNameBase_.isEmpty(); }
- void setFileNameBase(const QString& t) { fileNameBase_ = t; }
- Node::Genus genus() const { return (Genus) genus_; }
- void setGenus(Genus t) { genus_ = (unsigned char) t; }
-
- void setAccess(Access access) { access_ = (unsigned char) access; }
- void setLocation(const Location& location) { loc_ = location; }
- void setDoc(const Doc& doc, bool replace = false);
- void setStatus(Status status) {
- if (status_ == (unsigned char) Obsolete && status == Deprecated)
- return;
- status_ = (unsigned char) status;
- }
- void setThreadSafeness(ThreadSafeness safeness) { safeness_ = (unsigned char) safeness; }
- void setSince(const QString &since);
- void setRelates(InnerNode* pseudoParent);
- void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; }
- void setUrl(const QString& url) { url_ = url; }
- void setTemplateStuff(const QString &templateStuff) { templateStuff_ = templateStuff; }
- void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; }
- void setPageType(PageType t) { pageType_ = (unsigned char) t; }
- void setPageType(const QString& t);
- void setParent(InnerNode* n) { parent_ = n; }
- void setIndexNodeFlag() { indexNodeFlag_ = true; }
- virtual void setOutputFileName(const QString& ) { }
-
- bool isQmlNode() const { return genus() == QML; }
- bool isJsNode() const { return genus() == JS; }
- bool isCppNode() const { return genus() == CPP; }
-
- virtual bool isInnerNode() const = 0;
- virtual bool isCollectionNode() const { return false; }
- virtual bool isDocumentNode() const { return false; }
- virtual bool isGroup() const { return false; }
- virtual bool isModule() const { return false; }
- virtual bool isQmlModule() const { return false; }
- virtual bool isJsModule() const { return false; }
- virtual bool isQmlType() const { return false; }
- virtual bool isJsType() const { return false; }
- virtual bool isQmlBasicType() const { return false; }
- virtual bool isJsBasicType() const { return false; }
- virtual bool isExample() const { return false; }
- virtual bool isExampleFile() const { return false; }
- virtual bool isHeaderFile() const { return false; }
- virtual bool isLeaf() const { return false; }
- virtual bool isReimp() const { return false; }
- virtual bool isFunction() const { return false; }
- virtual bool isNamespace() const { return false; }
- virtual bool isClass() const { return false; }
- virtual bool isQtQuickNode() const { return false; }
- virtual bool isAbstract() const { return false; }
- virtual bool isProperty() const { return false; }
- virtual bool isQmlProperty() const { return false; }
- virtual bool isJsProperty() const { return false; }
- virtual bool isQmlPropertyGroup() const { return false; }
- virtual bool isJsPropertyGroup() const { return false; }
- virtual bool isQmlSignal() const { return false; }
- virtual bool isJsSignal() const { return false; }
- virtual bool isQmlSignalHandler() const { return false; }
- virtual bool isJsSignalHandler() const { return false; }
- virtual bool isQmlMethod() const { return false; }
- virtual bool isJsMethod() const { return false; }
- virtual bool isAttached() const { return false; }
- virtual bool isAlias() const { return false; }
- virtual bool isWrapper() const;
- virtual bool isReadOnly() const { return false; }
- virtual bool isDefault() const { return false; }
- virtual bool isExternalPage() const { return false; }
- virtual void addMember(Node* ) { }
- virtual bool hasMembers() const { return false; }
- virtual bool hasNamespaces() const { return false; }
- virtual bool hasClasses() const { return false; }
- virtual void setAbstract(bool ) { }
- virtual void setWrapper() { }
- virtual QString title() const { return name(); }
- virtual QString fullTitle() const { return name(); }
- virtual QString subTitle() const { return QString(); }
- virtual void setTitle(const QString& ) { }
- virtual void setSubTitle(const QString& ) { }
- virtual QmlPropertyNode* hasQmlProperty(const QString& ) const { return 0; }
- virtual QmlPropertyNode* hasQmlProperty(const QString&, bool ) const { return 0; }
- virtual void getMemberNamespaces(NodeMap& ) { }
- virtual void getMemberClasses(NodeMap& ) { }
- virtual bool isInternal() const;
- virtual void setDataType(const QString& ) { }
- virtual void setReadOnly(bool ) { }
- virtual Node* disambiguate(Type , SubType ) { return this; }
- virtual bool wasSeen() const { return false; }
- virtual void appendGroupName(const QString& ) { }
- virtual QString element() const { return QString(); }
- virtual Tree* tree() const;
- virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); }
- bool isIndexNode() const { return indexNodeFlag_; }
- Type type() const { return (Type) nodeType_; }
- virtual SubType subType() const { return NoSubType; }
- bool match(const NodeTypeList& types) const;
- InnerNode* parent() const { return parent_; }
- const Node* root() const;
- InnerNode* relates() const { return relatesTo_; }
- const QString& name() const { return name_; }
- QString physicalModuleName() const;
- QString url() const { return url_; }
- virtual QString nameForLists() const { return name_; }
- virtual QString outputFileName() const { return QString(); }
- virtual QString obsoleteLink() const { return QString(); }
- virtual void setObsoleteLink(const QString& ) { };
- virtual void setQtVariable(const QString& ) { }
- virtual QString qtVariable() const { return QString(); }
-
- const QMap<LinkType, QPair<QString,QString> >& links() const { return linkMap_; }
- void setLink(LinkType linkType, const QString &link, const QString &desc);
-
- Access access() const { return (Access) access_; }
- bool isPrivate() const { return (Access) access_ == Private; }
- QString accessString() const;
- const Location& location() const { return loc_; }
- const Doc& doc() const { return doc_; }
- bool hasDoc() const { return !doc_.isEmpty(); }
- Status status() const { return (Status) status_; }
- Status inheritedStatus() const;
- bool isObsolete() const { return (status_ == (unsigned char) Obsolete); }
- ThreadSafeness threadSafeness() const;
- ThreadSafeness inheritedThreadSafeness() const;
- QString since() const { return since_; }
- QString templateStuff() const { return templateStuff_; }
- const QString& reconstitutedBrief() const { return reconstitutedBrief_; }
- PageType pageType() const { return (PageType) pageType_; }
- QString pageTypeString() const;
- QString nodeTypeString() const;
- QString nodeSubtypeString() const;
- virtual void addPageKeywords(const QString& ) { }
-
- void clearRelated() { relatesTo_ = 0; }
-
- QString guid() const;
- QString extractClassName(const QString &string) const;
- virtual QString qmlTypeName() const { return name_; }
- virtual QString qmlFullBaseName() const { return QString(); }
- virtual QString logicalModuleName() const { return QString(); }
- virtual QString logicalModuleVersion() const { return QString(); }
- virtual QString logicalModuleIdentifier() const { return QString(); }
- virtual void setLogicalModuleInfo(const QString& ) { }
- virtual void setLogicalModuleInfo(const QStringList& ) { }
- virtual CollectionNode* logicalModule() const { return 0; }
- virtual void setQmlModule(CollectionNode* ) { }
- virtual ClassNode* classNode() { return 0; }
- virtual void setClassNode(ClassNode* ) { }
- virtual const Node* applyModuleName(const Node* ) const { return 0; }
- virtual QString idNumber() { return "0"; }
- QmlTypeNode* qmlTypeNode();
- ClassNode* declarativeCppNode();
- const QString& outputSubdirectory() const { return outSubDir_; }
- virtual void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
- QString fullDocumentName() const;
- static QString cleanId(const QString &str);
- QString idForNode() const;
-
- static FlagValue toFlagValue(bool b);
- static bool fromFlagValue(FlagValue fv, bool defaultValue);
-
- static QString pageTypeString(unsigned char t);
- static QString nodeTypeString(unsigned char t);
- static QString nodeSubtypeString(unsigned char t);
- static int incPropertyGroupCount();
- static void clearPropertyGroupCount();
- static void initialize();
- static Type goal(const QString& t) { return goals_.value(t); }
-
-protected:
- Node(Type type, InnerNode* parent, const QString& name);
-
-private:
-
- unsigned char nodeType_;
- unsigned char genus_;
- unsigned char access_;
- unsigned char safeness_;
- unsigned char pageType_;
- unsigned char status_;
- bool indexNodeFlag_;
-
- InnerNode* parent_;
- InnerNode* relatesTo_;
- QString name_;
- Location loc_;
- Doc doc_;
- QMap<LinkType, QPair<QString, QString> > linkMap_;
- QString fileNameBase_;
- QString physicalModuleName_;
- QString url_;
- QString since_;
- QString templateStuff_;
- QString reconstitutedBrief_;
- mutable QString uuid_;
- QString outSubDir_;
- static QStringMap operators_;
- static int propertyGroupCount_;
- static QMap<QString,Node::Type> goals_;
-};
-
-class InnerNode : public Node
-{
-public:
- virtual ~InnerNode();
-
- Node* findChildNode(const QString& name, Node::Genus genus) const;
- Node* findChildNode(const QString& name, Type type);
- virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE;
- FunctionNode* findFunctionNode(const QString& name) const;
- FunctionNode* findFunctionNode(const FunctionNode* clone) const;
- void addInclude(const QString &include);
- void setIncludes(const QStringList &includes);
- void setOverload(FunctionNode* func, bool overlode);
- void normalizeOverloads();
- void makeUndocumentedChildrenInternal();
- void deleteChildren();
- void removeFromRelated();
-
- virtual bool isInnerNode() const Q_DECL_OVERRIDE { return true; }
- virtual bool isLeaf() const Q_DECL_OVERRIDE { return false; }
- const EnumNode* findEnumNodeForValue(const QString &enumValue) const;
- const NodeList & childNodes() const { return children_; }
- const NodeList & relatedNodes() const { return related_; }
-
- int count() const { return children_.size(); }
- int overloadNumber(const FunctionNode* func) const;
- NodeList overloads(const QString &funcName) const;
- const QStringList& includes() const { return includes_; }
-
- QStringList primaryKeys();
- QStringList secondaryKeys();
- const QStringList& pageKeywords() const { return pageKeywds; }
- virtual void addPageKeywords(const QString& t) Q_DECL_OVERRIDE { pageKeywds << t; }
- virtual void setOutputFileName(const QString& f) Q_DECL_OVERRIDE { outputFileName_ = f; }
- virtual QString outputFileName() const Q_DECL_OVERRIDE { return outputFileName_; }
- virtual QmlPropertyNode* hasQmlProperty(const QString& ) const Q_DECL_OVERRIDE;
- virtual QmlPropertyNode* hasQmlProperty(const QString&, bool attached) const Q_DECL_OVERRIDE;
- void addChild(Node* child, const QString& title);
- const QStringList& groupNames() const { return groupNames_; }
- virtual void appendGroupName(const QString& t) Q_DECL_OVERRIDE { groupNames_.append(t); }
- void printChildren(const QString& title);
- void addChild(Node* child);
- void removeChild(Node* child);
- void setOutputSubdirectory(const QString& t) Q_DECL_OVERRIDE;
-
-protected:
- InnerNode(Type type, InnerNode* parent, const QString& name);
-
-private:
- friend class Node;
-
- static bool isSameSignature(const FunctionNode* f1, const FunctionNode* f2);
- void removeRelated(Node* pseudoChild);
-
- QString outputFileName_;
- QStringList pageKeywds;
- QStringList includes_;
- QStringList groupNames_;
- NodeList children_;
- NodeList enumChildren_;
- NodeList related_;
- QMap<QString, Node*> childMap;
- QMap<QString, Node*> primaryFunctionMap;
- QMap<QString, NodeList> secondaryFunctionMap;
-};
-
-class LeafNode : public Node
-{
-public:
- LeafNode();
- virtual ~LeafNode() { }
-
- virtual bool isInnerNode() const Q_DECL_OVERRIDE { return false; }
- virtual bool isLeaf() const Q_DECL_OVERRIDE { return true; }
-
-protected:
- LeafNode(Type type, InnerNode* parent, const QString& name);
- LeafNode(InnerNode* parent, Type type, const QString& name);
-};
-
-class NamespaceNode : public InnerNode
-{
-public:
- NamespaceNode(InnerNode* parent, const QString& name);
- virtual ~NamespaceNode() { }
- virtual bool isNamespace() const Q_DECL_OVERRIDE { return true; }
- virtual Tree* tree() const Q_DECL_OVERRIDE { return (parent() ? parent()->tree() : tree_); }
- virtual bool wasSeen() const Q_DECL_OVERRIDE { return seen_; }
-
- void markSeen() { seen_ = true; }
- void markNotSeen() { seen_ = false; }
- void setTree(Tree* t) { tree_ = t; }
- const NodeList& orphans() const { return orphans_; }
- void addOrphan(Node* child) { orphans_.append(child); }
-
- private:
- bool seen_;
- Tree* tree_;
- NodeList orphans_;
-};
-
-struct RelatedClass
-{
- RelatedClass() { }
- // constructor for resolved base class
- RelatedClass(Node::Access access, ClassNode* node)
- : access_(access), node_(node) { }
- // constructor for unresolved base class
- RelatedClass(Node::Access access, const QStringList& path, const QString& signature)
- : access_(access), node_(0), path_(path), signature_(signature) { }
- QString accessString() const;
- bool isPrivate() const { return (access_ == Node::Private); }
-
- Node::Access access_;
- ClassNode* node_;
- QStringList path_;
- QString signature_;
-};
-
-struct UsingClause
-{
- UsingClause() { }
- UsingClause(const QString& signature) : node_(0), signature_(signature) { }
- const QString& signature() const { return signature_; }
- const Node* node() { return node_; }
- void setNode(const Node* n) { node_ = n; }
-
- const Node* node_;
- QString signature_;
-};
-
-class ClassNode : public InnerNode
-{
-public:
- ClassNode(InnerNode* parent, const QString& name);
- virtual ~ClassNode() { }
- virtual bool isClass() const Q_DECL_OVERRIDE { return true; }
- virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; }
- virtual QString obsoleteLink() const Q_DECL_OVERRIDE { return obsoleteLink_; }
- virtual void setObsoleteLink(const QString& t) Q_DECL_OVERRIDE { obsoleteLink_ = t; }
- virtual void setWrapper() Q_DECL_OVERRIDE { wrapper_ = true; }
-
- void addResolvedBaseClass(Access access, ClassNode* node);
- void addDerivedClass(Access access, ClassNode* node);
- void addUnresolvedBaseClass(Access access, const QStringList& path, const QString& signature);
- void addUnresolvedUsingClause(const QString& signature);
- void fixBaseClasses();
- void fixPropertyUsingBaseClasses(PropertyNode* pn);
-
- QList<RelatedClass>& baseClasses() { return bases_; }
- QList<RelatedClass>& derivedClasses() { return derived_; }
- QList<RelatedClass>& ignoredBaseClasses() { return ignoredBases_; }
- QList<UsingClause>& usingClauses() { return usingClauses_; }
-
- const QList<RelatedClass> &baseClasses() const { return bases_; }
- const QList<RelatedClass> &derivedClasses() const { return derived_; }
- const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases_; }
- const QList<UsingClause>& usingClauses() const { return usingClauses_; }
-
- QmlTypeNode* qmlElement() { return qmlelement; }
- void setQmlElement(QmlTypeNode* qcn) { qmlelement = qcn; }
- virtual bool isAbstract() const Q_DECL_OVERRIDE { return abstract_; }
- virtual void setAbstract(bool b) Q_DECL_OVERRIDE { abstract_ = b; }
- PropertyNode* findPropertyNode(const QString& name);
- QmlTypeNode* findQmlBaseNode();
-
-private:
- QList<RelatedClass> bases_;
- QList<RelatedClass> derived_;
- QList<RelatedClass> ignoredBases_;
- QList<UsingClause> usingClauses_;
- bool abstract_;
- bool wrapper_;
- QString obsoleteLink_;
- QmlTypeNode* qmlelement;
-};
-
-class DocumentNode : public InnerNode
-{
-public:
-
- DocumentNode(InnerNode* parent,
- const QString& name,
- SubType subType,
- PageType ptype);
- virtual ~DocumentNode() { }
-
- virtual bool isDocumentNode() const Q_DECL_OVERRIDE { return true; }
- virtual void setTitle(const QString &title) Q_DECL_OVERRIDE;
- virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; }
-
- SubType subType() const Q_DECL_OVERRIDE { return nodeSubtype_; }
- virtual QString title() const Q_DECL_OVERRIDE { return title_; }
- virtual QString fullTitle() const Q_DECL_OVERRIDE;
- virtual QString subTitle() const Q_DECL_OVERRIDE;
- virtual QString imageFileName() const { return QString(); }
- virtual QString nameForLists() const Q_DECL_OVERRIDE { return title(); }
- virtual void setImageFileName(const QString& ) { }
-
- virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (subType() == Node::HeaderFile); }
- virtual bool isExample() const Q_DECL_OVERRIDE { return (subType() == Node::Example); }
- virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); }
- virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; }
-
-protected:
- SubType nodeSubtype_;
- QString title_;
- QString subtitle_;
-};
-
-class ExampleNode : public DocumentNode
-{
-public:
- ExampleNode(InnerNode* parent, const QString& name)
- : DocumentNode(parent, name, Node::Example, Node::ExamplePage) { }
- virtual ~ExampleNode() { }
- virtual QString imageFileName() const Q_DECL_OVERRIDE { return imageFileName_; }
- virtual void setImageFileName(const QString& ifn) Q_DECL_OVERRIDE { imageFileName_ = ifn; }
-
-private:
- QString imageFileName_;
-};
-
-struct ImportRec {
- QString name_; // module name
- QString version_; // <major> . <minor>
- QString importId_; // "as" name
- QString importUri_; // subdirectory of module directory
-
- ImportRec(const QString& name,
- const QString& version,
- const QString& importId,
- const QString& importUri)
- : name_(name), version_(version), importId_(importId), importUri_(importUri) { }
- QString& name() { return name_; }
- QString& version() { return version_; }
- QString& importId() { return importId_; }
- QString& importUri() { return importUri_; }
- bool isEmpty() const { return name_.isEmpty(); }
-};
-
-typedef QList<ImportRec> ImportList;
-
-class QmlTypeNode : public InnerNode
-{
-public:
- QmlTypeNode(InnerNode* parent, const QString& name);
- virtual ~QmlTypeNode();
- virtual bool isQmlType() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
- virtual bool isJsType() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
- virtual bool isQtQuickNode() const Q_DECL_OVERRIDE {
- return (logicalModuleName() == QLatin1String("QtQuick"));
- }
- virtual ClassNode* classNode() Q_DECL_OVERRIDE { return cnode_; }
- virtual void setClassNode(ClassNode* cn) Q_DECL_OVERRIDE { cnode_ = cn; }
- virtual bool isAbstract() const Q_DECL_OVERRIDE { return abstract_; }
- virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; }
- virtual void setAbstract(bool b) Q_DECL_OVERRIDE { abstract_ = b; }
- virtual void setWrapper() Q_DECL_OVERRIDE { wrapper_ = true; }
- virtual bool isInternal() const Q_DECL_OVERRIDE { return (status() == Internal); }
- virtual QString qmlFullBaseName() const Q_DECL_OVERRIDE;
- virtual QString obsoleteLink() const Q_DECL_OVERRIDE { return obsoleteLink_; }
- virtual void setObsoleteLink(const QString& t) Q_DECL_OVERRIDE { obsoleteLink_ = t; };
- virtual QString logicalModuleName() const Q_DECL_OVERRIDE;
- virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE;
- virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE;
- virtual CollectionNode* logicalModule() const Q_DECL_OVERRIDE { return logicalModule_; }
- virtual void setQmlModule(CollectionNode* t) Q_DECL_OVERRIDE { logicalModule_ = t; }
-
- const ImportList& importList() const { return importList_; }
- void setImportList(const ImportList& il) { importList_ = il; }
- const QString& qmlBaseName() const { return qmlBaseName_; }
- void setQmlBaseName(const QString& name) { qmlBaseName_ = name; }
- bool qmlBaseNodeNotSet() const { return (qmlBaseNode_ == 0); }
- QmlTypeNode* qmlBaseNode();
- void setQmlBaseNode(QmlTypeNode* b) { qmlBaseNode_ = b; }
- void requireCppClass() { cnodeRequired_ = true; }
- bool cppClassRequired() const { return cnodeRequired_; }
- static void addInheritedBy(const QString& base, Node* sub);
- static void subclasses(const QString& base, NodeList& subs);
- static void terminate();
-
-public:
- static bool qmlOnly;
- static QMultiMap<QString,Node*> inheritedBy;
-
-private:
- bool abstract_;
- bool cnodeRequired_;
- bool wrapper_;
- ClassNode* cnode_;
- QString qmlBaseName_;
- QString obsoleteLink_;
- CollectionNode* logicalModule_;
- QmlTypeNode* qmlBaseNode_;
- ImportList importList_;
-};
-
-class QmlBasicTypeNode : public InnerNode
-{
-public:
- QmlBasicTypeNode(InnerNode* parent,
- const QString& name);
- virtual ~QmlBasicTypeNode() { }
- virtual bool isQmlBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::QML); }
- virtual bool isJsBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::JS); }
-};
-
-class QmlPropertyGroupNode : public InnerNode
-{
-public:
- QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name);
- virtual ~QmlPropertyGroupNode() { }
- virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
- virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); }
- virtual QString logicalModuleName() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleName();
- }
- virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleVersion();
- }
- virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleIdentifier();
- }
- virtual QString idNumber() Q_DECL_OVERRIDE;
- virtual bool isQmlPropertyGroup() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
- virtual bool isJsPropertyGroup() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
- virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); }
-
- private:
- int idNumber_;
-};
-
-class QmlPropertyNode : public LeafNode
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::QmlPropertyNode)
-
-public:
- QmlPropertyNode(InnerNode *parent,
- const QString& name,
- const QString& type,
- bool attached);
- virtual ~QmlPropertyNode() { }
-
- virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; }
- void setStored(bool stored) { stored_ = toFlagValue(stored); }
- void setDesignable(bool designable) { designable_ = toFlagValue(designable); }
- virtual void setReadOnly(bool ro) Q_DECL_OVERRIDE { readOnly_ = toFlagValue(ro); }
- void setDefault() { isdefault_ = true; }
-
- const QString &dataType() const { return type_; }
- QString qualifiedDataType() const { return type_; }
- bool isReadOnlySet() const { return (readOnly_ != FlagValueDefault); }
- bool isStored() const { return fromFlagValue(stored_,true); }
- bool isDesignable() const { return fromFlagValue(designable_,false); }
- bool isWritable();
- virtual bool isQmlProperty() const Q_DECL_OVERRIDE { return genus() == QML; }
- virtual bool isJsProperty() const Q_DECL_OVERRIDE { return genus() == JS; }
- virtual bool isDefault() const Q_DECL_OVERRIDE { return isdefault_; }
- virtual bool isReadOnly() const Q_DECL_OVERRIDE { return fromFlagValue(readOnly_,false); }
- virtual bool isAlias() const Q_DECL_OVERRIDE { return isAlias_; }
- virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; }
- virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
- virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); }
- virtual QString logicalModuleName() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleName();
- }
- virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleVersion();
- }
- virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleIdentifier();
- }
- virtual QString element() const Q_DECL_OVERRIDE;
-
- private:
- PropertyNode* findCorrespondingCppProperty();
-
-private:
- QString type_;
- FlagValue stored_;
- FlagValue designable_;
- bool isAlias_;
- bool isdefault_;
- bool attached_;
- FlagValue readOnly_;
-};
-
-class EnumItem
-{
-public:
- EnumItem() { }
- EnumItem(const QString& name, const QString& value)
- : nam(name), val(value) { }
-
- const QString& name() const { return nam; }
- const QString& value() const { return val; }
-
-private:
- QString nam;
- QString val;
-};
-
-class EnumNode : public LeafNode
-{
-public:
- EnumNode(InnerNode* parent, const QString& name);
- virtual ~EnumNode() { }
-
- void addItem(const EnumItem& item);
- void setFlagsType(TypedefNode* typedeff);
- bool hasItem(const QString &name) const { return names.contains(name); }
-
- const QList<EnumItem>& items() const { return itms; }
- Access itemAccess(const QString& name) const;
- const TypedefNode* flagsType() const { return ft; }
- QString itemValue(const QString &name) const;
-
-private:
- QList<EnumItem> itms;
- QSet<QString> names;
- const TypedefNode* ft;
-};
-
-class TypedefNode : public LeafNode
-{
-public:
- TypedefNode(InnerNode* parent, const QString& name);
- virtual ~TypedefNode() { }
-
- const EnumNode* associatedEnum() const { return ae; }
-
-private:
- void setAssociatedEnum(const EnumNode* enume);
-
- friend class EnumNode;
-
- const EnumNode* ae;
-};
-
-inline void EnumNode::setFlagsType(TypedefNode* typedeff)
-{
- ft = typedeff;
- typedeff->setAssociatedEnum(this);
-}
-
-
-class Parameter
-{
-public:
- Parameter() {}
- Parameter(const QString& leftType,
- const QString& rightType = QString(),
- const QString& name = QString(),
- const QString& defaultValue = QString());
- Parameter(const Parameter& p);
-
- Parameter& operator=(const Parameter& p);
-
- void setName(const QString& name) { nam = name; }
-
- bool hasType() const { return lef.length() + rig.length() > 0; }
- const QString& leftType() const { return lef; }
- const QString& rightType() const { return rig; }
- const QString& name() const { return nam; }
- const QString& defaultValue() const { return def; }
-
- QString reconstruct(bool value = false) const;
-
-private:
- QString lef;
- QString rig;
- QString nam;
- QString def;
-};
-
-class FunctionNode : public LeafNode
-{
-public:
- enum Metaness {
- Plain,
- Signal,
- Slot,
- Ctor,
- Dtor,
- MacroWithParams,
- MacroWithoutParams,
- Native };
- enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
-
- FunctionNode(InnerNode* parent, const QString &name);
- FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
- virtual ~FunctionNode() { }
-
- void setReturnType(const QString& returnType) { rt = returnType; }
- void setParentPath(const QStringList& parentPath) { pp = parentPath; }
- void setMetaness(Metaness metaness) { met = metaness; }
- void setVirtualness(Virtualness virtualness);
- void setConst(bool conste) { con = conste; }
- void setStatic(bool statique) { sta = statique; }
- void setOverload(bool overlode);
- void setReimp(bool r);
- void addParameter(const Parameter& parameter);
- inline void setParameters(const QList<Parameter>& parameters);
- void borrowParameterNames(const FunctionNode* source);
- void setReimplementedFrom(FunctionNode* from);
-
- const QString& returnType() const { return rt; }
- Metaness metaness() const { return met; }
- bool isMacro() const {
- return met == MacroWithParams || met == MacroWithoutParams;
- }
- Virtualness virtualness() const { return vir; }
- bool isConst() const { return con; }
- bool isStatic() const { return sta; }
- bool isOverload() const { return ove; }
- bool isReimp() const Q_DECL_OVERRIDE { return reimp; }
- bool isFunction() const Q_DECL_OVERRIDE { return true; }
- virtual bool isQmlSignal() const Q_DECL_OVERRIDE {
- return (type() == Node::QmlSignal) && (genus() == Node::QML);
- }
- virtual bool isJsSignal() const Q_DECL_OVERRIDE {
- return (type() == Node::QmlSignal) && (genus() == Node::JS);
- }
- virtual bool isQmlSignalHandler() const Q_DECL_OVERRIDE {
- return (type() == Node::QmlSignalHandler) && (genus() == Node::QML);
- }
- virtual bool isJsSignalHandler() const Q_DECL_OVERRIDE {
- return (type() == Node::QmlSignalHandler) && (genus() == Node::JS);
- }
- virtual bool isQmlMethod() const Q_DECL_OVERRIDE {
- return (type() == Node::QmlMethod) && (genus() == Node::QML);
- }
- virtual bool isJsMethod() const Q_DECL_OVERRIDE {
- return (type() == Node::QmlMethod) && (genus() == Node::JS);
- }
- int overloadNumber() const;
- const QList<Parameter>& parameters() const { return params; }
- void clearParams() { params.clear(); }
- QStringList parameterNames() const;
- QString rawParameters(bool names = false, bool values = false) const;
- const FunctionNode* reimplementedFrom() const { return rf; }
- const QList<FunctionNode*> &reimplementedBy() const { return rb; }
- const PropertyNode* associatedProperty() const { return ap; }
- const QStringList& parentPath() const { return pp; }
-
- QStringList reconstructParams(bool values = false) const;
- QString signature(bool values = false) const;
- virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); }
- virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; }
- virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
- virtual QString qmlTypeName() const Q_DECL_OVERRIDE { return parent()->qmlTypeName(); }
- virtual QString logicalModuleName() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleName();
- }
- virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleVersion();
- }
- virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
- return parent()->logicalModuleIdentifier();
- }
- bool isPrivateSignal() const { return privateSignal_; }
- void setPrivateSignal() { privateSignal_ = true; }
-
- void debug() const;
-
-private:
- void setAssociatedProperty(PropertyNode* property);
-
- friend class InnerNode;
- friend class PropertyNode;
-
- QString rt;
- QStringList pp;
- Metaness met;
- Virtualness vir;
- bool con : 1;
- bool sta : 1;
- bool ove : 1;
- bool reimp: 1;
- bool attached_: 1;
- bool privateSignal_: 1;
- QList<Parameter> params;
- const FunctionNode* rf;
- const PropertyNode* ap;
- QList<FunctionNode*> rb;
-};
-
-class PropertyNode : public LeafNode
-{
-public:
- enum FunctionRole { Getter, Setter, Resetter, Notifier };
- enum { NumFunctionRoles = Notifier + 1 };
-
- PropertyNode(InnerNode* parent, const QString& name);
- virtual ~PropertyNode() { }
-
- virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; }
- virtual bool isProperty() const Q_DECL_OVERRIDE { return true; }
- void addFunction(FunctionNode* function, FunctionRole role);
- void addSignal(FunctionNode* function, FunctionRole role);
- void setStored(bool stored) { stored_ = toFlagValue(stored); }
- void setDesignable(bool designable) { designable_ = toFlagValue(designable); }
- void setScriptable(bool scriptable) { scriptable_ = toFlagValue(scriptable); }
- void setWritable(bool writable) { writable_ = toFlagValue(writable); }
- void setUser(bool user) { user_ = toFlagValue(user); }
- void setOverriddenFrom(const PropertyNode* baseProperty);
- void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; }
- void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; }
- void setConstant() { cst = true; }
- void setFinal() { fnl = true; }
- void setRevision(int revision) { rev = revision; }
-
- const QString &dataType() const { return type_; }
- QString qualifiedDataType() const;
- NodeList functions() const;
- NodeList functions(FunctionRole role) const { return funcs[(int)role]; }
- NodeList getters() const { return functions(Getter); }
- NodeList setters() const { return functions(Setter); }
- NodeList resetters() const { return functions(Resetter); }
- NodeList notifiers() const { return functions(Notifier); }
- bool isStored() const { return fromFlagValue(stored_, storedDefault()); }
- bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); }
- bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); }
- const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; }
- const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; }
- bool isWritable() const { return fromFlagValue(writable_, writableDefault()); }
- bool isUser() const { return fromFlagValue(user_, userDefault()); }
- bool isConstant() const { return cst; }
- bool isFinal() const { return fnl; }
- const PropertyNode* overriddenFrom() const { return overrides; }
-
- bool storedDefault() const { return true; }
- bool userDefault() const { return false; }
- bool designableDefault() const { return !setters().isEmpty(); }
- bool scriptableDefault() const { return true; }
- bool writableDefault() const { return !setters().isEmpty(); }
-
-private:
- QString type_;
- QString runtimeDesFunc;
- QString runtimeScrFunc;
- NodeList funcs[NumFunctionRoles];
- FlagValue stored_;
- FlagValue designable_;
- FlagValue scriptable_;
- FlagValue writable_;
- FlagValue user_;
- bool cst;
- bool fnl;
- int rev;
- const PropertyNode* overrides;
-};
-
-inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
-{
- params = parameters;
-}
-
-inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
-{
- funcs[(int)role].append(function);
- function->setAssociatedProperty(this);
-}
-
-inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
-{
- funcs[(int)role].append(function);
- function->setAssociatedProperty(this);
-}
-
-inline NodeList PropertyNode::functions() const
-{
- NodeList list;
- for (int i = 0; i < NumFunctionRoles; ++i)
- list += funcs[i];
- return list;
-}
-
-class VariableNode : public LeafNode
-{
-public:
- VariableNode(InnerNode* parent, const QString &name);
- virtual ~VariableNode() { }
-
- void setLeftType(const QString &leftType) { lt = leftType; }
- void setRightType(const QString &rightType) { rt = rightType; }
- void setStatic(bool statique) { sta = statique; }
-
- const QString &leftType() const { return lt; }
- const QString &rightType() const { return rt; }
- QString dataType() const { return lt + rt; }
- bool isStatic() const { return sta; }
-
-private:
- QString lt;
- QString rt;
- bool sta;
-};
-
-inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
- : LeafNode(Variable, parent, name), sta(false)
-{
- setGenus(Node::CPP);
-}
-
-class DitaMapNode : public DocumentNode
-{
-public:
- DitaMapNode(InnerNode* parent, const QString& name)
- : DocumentNode(parent, name, Node::Page, Node::DitaMapPage) { }
- virtual ~DitaMapNode() { }
-
- const DitaRefList& map() const { return doc().ditamap(); }
-};
-
-class CollectionNode : public InnerNode
-{
- public:
- CollectionNode(Type type,
- InnerNode* parent,
- const QString& name,
- Genus genus) : InnerNode(type, parent, name), seen_(false)
- {
- setPageType(Node::OverviewPage);
- setGenus(genus);
- }
- virtual ~CollectionNode() { }
-
- virtual bool isCollectionNode() const Q_DECL_OVERRIDE { return true; }
- virtual bool isGroup() const Q_DECL_OVERRIDE { return genus() == Node::DOC; }
- virtual bool isModule() const Q_DECL_OVERRIDE { return genus() == Node::CPP; }
- virtual bool isQmlModule() const Q_DECL_OVERRIDE { return genus() == Node::QML; }
- virtual bool isJsModule() const Q_DECL_OVERRIDE { return genus() == Node::JS; }
- virtual QString qtVariable() const Q_DECL_OVERRIDE { return qtVariable_; }
- virtual void setQtVariable(const QString& v) Q_DECL_OVERRIDE { qtVariable_ = v; }
- virtual void addMember(Node* node) Q_DECL_OVERRIDE;
- virtual bool hasMembers() const Q_DECL_OVERRIDE;
- virtual bool hasNamespaces() const Q_DECL_OVERRIDE;
- virtual bool hasClasses() const Q_DECL_OVERRIDE;
- virtual void getMemberNamespaces(NodeMap& out) Q_DECL_OVERRIDE;
- virtual void getMemberClasses(NodeMap& out) Q_DECL_OVERRIDE;
- virtual bool wasSeen() const Q_DECL_OVERRIDE { return seen_; }
- virtual QString title() const Q_DECL_OVERRIDE { return title_; }
- virtual QString subTitle() const Q_DECL_OVERRIDE { return subtitle_; }
- virtual QString fullTitle() const Q_DECL_OVERRIDE { return title_; }
- virtual QString nameForLists() const Q_DECL_OVERRIDE { return title_; }
- virtual void setTitle(const QString &title) Q_DECL_OVERRIDE;
- virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; }
-
- virtual QString logicalModuleName() const Q_DECL_OVERRIDE { return logicalModuleName_; }
- virtual QString logicalModuleVersion() const Q_DECL_OVERRIDE {
- return logicalModuleVersionMajor_ + "." + logicalModuleVersionMinor_;
- }
- virtual QString logicalModuleIdentifier() const Q_DECL_OVERRIDE {
- return logicalModuleName_ + logicalModuleVersionMajor_;
- }
- virtual void setLogicalModuleInfo(const QString& arg) Q_DECL_OVERRIDE;
- virtual void setLogicalModuleInfo(const QStringList& info) Q_DECL_OVERRIDE;
-
- const NodeList& members() const { return members_; }
- void printMembers(const QString& title);
-
- void markSeen() { seen_ = true; }
- void markNotSeen() { seen_ = false; }
-
- private:
- bool seen_;
- QString title_;
- QString subtitle_;
- NodeList members_;
- QString logicalModuleName_;
- QString logicalModuleVersionMajor_;
- QString logicalModuleVersionMinor_;
- QString qtVariable_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/openedlist.cpp b/src/tools/qdoc/openedlist.cpp
deleted file mode 100644
index 6bb4a270e7..0000000000
--- a/src/tools/qdoc/openedlist.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- openedlist.cpp
-*/
-
-#include <qregexp.h>
-
-#include "atom.h"
-#include "openedlist.h"
-
-QT_BEGIN_NAMESPACE
-
-static const char roman[] = "m\2d\5c\2l\5x\2v\5i";
-
-OpenedList::OpenedList( Style style )
- : sty( style ), ini( 1 ), nex( 0 )
-{
-}
-
-OpenedList::OpenedList( const Location& location, const QString& hint )
- : sty( Bullet ), ini( 1 )
-{
- QRegExp hintSyntax( "(\\W*)([0-9]+|[A-Z]+|[a-z]+)(\\W*)" );
-
- if ( hintSyntax.exactMatch(hint) ) {
- bool ok;
- int asNumeric = hint.toInt( &ok );
- int asRoman = fromRoman( hintSyntax.cap(2) );
- int asAlpha = fromAlpha( hintSyntax.cap(2) );
-
- if ( ok ) {
- sty = Numeric;
- ini = asNumeric;
- } else if ( asRoman > 0 && asRoman != 100 && asRoman != 500 ) {
- sty = ( hint == hint.toLower() ) ? LowerRoman : UpperRoman;
- ini = asRoman;
- } else {
- sty = ( hint == hint.toLower() ) ? LowerAlpha : UpperAlpha;
- ini = asAlpha;
- }
- pref = hintSyntax.cap( 1 );
- suff = hintSyntax.cap( 3 );
- } else if ( !hint.isEmpty() ) {
- location.warning( tr("Unrecognized list style '%1'").arg(hint) );
- }
- nex = ini - 1;
-}
-
-QString OpenedList::styleString() const
-{
- switch ( style() ) {
- case Bullet:
- default:
- return ATOM_LIST_BULLET;
- case Tag:
- return ATOM_LIST_TAG;
- case Value:
- return ATOM_LIST_VALUE;
- case Numeric:
- return ATOM_LIST_NUMERIC;
- case UpperAlpha:
- return ATOM_LIST_UPPERALPHA;
- case LowerAlpha:
- return ATOM_LIST_LOWERALPHA;
- case UpperRoman:
- return ATOM_LIST_UPPERROMAN;
- case LowerRoman:
- return ATOM_LIST_LOWERROMAN;
- }
-}
-
-QString OpenedList::numberString() const
-{
- return QString::number( number() );
- /*
- switch ( style() ) {
- case Numeric:
- return QString::number( number() );
- case UpperAlpha:
- return toAlpha( number() ).toUpper();
- case LowerAlpha:
- return toAlpha( number() );
- case UpperRoman:
- return toRoman( number() ).toUpper();
- case LowerRoman:
- return toRoman( number() );
- case Bullet:
- default:
- return "*";
- }*/
-}
-
-QString OpenedList::toAlpha( int n )
-{
- QString str;
-
- while ( n > 0 ) {
- n--;
- str.prepend( (n % 26) + 'a' );
- n /= 26;
- }
- return str;
-}
-
-int OpenedList::fromAlpha( const QString& str )
-{
- int n = 0;
- int u;
-
- for ( int i = 0; i < (int) str.length(); i++ ) {
- u = str[i].toLower().unicode();
- if ( u >= 'a' && u <= 'z' ) {
- n *= 26;
- n += u - 'a' + 1;
- } else {
- return 0;
- }
- }
- return n;
-}
-
-QString OpenedList::toRoman( int n )
-{
- /*
- See p. 30 of Donald E. Knuth's "TeX: The Program".
- */
- QString str;
- int j = 0;
- int k;
- int u;
- int v = 1000;
-
- for ( ;; ) {
- while ( n >= v ) {
- str += roman[j];
- n -= v;
- }
-
- if ( n <= 0 )
- break;
-
- k = j + 2;
- u = v / roman[k - 1];
- if ( roman[k - 1] == 2 ) {
- k += 2;
- u /= 5;
- }
- if ( n + u >= v ) {
- str += roman[k];
- n += u;
- } else {
- j += 2;
- v /= roman[j - 1];
- }
- }
- return str;
-}
-
-int OpenedList::fromRoman( const QString& str )
-{
- int n = 0;
- int j;
- int u;
- int v = 0;
-
- for ( int i = str.length() - 1; i >= 0; i-- ) {
- j = 0;
- u = 1000;
- while ( roman[j] != 'i' && roman[j] != str[i].toLower() ) {
- j += 2;
- u /= roman[j - 1];
- }
- if ( u < v ) {
- n -= u;
- } else {
- n += u;
- }
- v = u;
- }
-
- if ( str.toLower() == toRoman(n) ) {
- return n;
- } else {
- return 0;
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/openedlist.h b/src/tools/qdoc/openedlist.h
deleted file mode 100644
index ee45714cfd..0000000000
--- a/src/tools/qdoc/openedlist.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- openedlist.h
-*/
-
-#ifndef OPENEDLIST_H
-#define OPENEDLIST_H
-
-#include <qstring.h>
-
-#include "location.h"
-
-QT_BEGIN_NAMESPACE
-
-class OpenedList
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::OpenedList)
-
-public:
- enum Style { Bullet, Tag, Value, Numeric, UpperAlpha, LowerAlpha,
- UpperRoman, LowerRoman };
-
- OpenedList()
- : sty( Bullet ), ini( 1 ), nex( 0 ) { }
- OpenedList( Style style );
- OpenedList( const Location& location, const QString& hint );
-
- void next() { nex++; }
-
- bool isStarted() const { return nex >= ini; }
- Style style() const { return sty; }
- QString styleString() const;
- int number() const { return nex; }
- QString numberString() const;
- QString prefix() const { return pref; }
- QString suffix() const { return suff; }
-
-private:
- static QString toAlpha( int n );
- static int fromAlpha( const QString& str );
- static QString toRoman( int n );
- static int fromRoman( const QString& str );
-
- Style sty;
- int ini;
- int nex;
- QString pref;
- QString suff;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/plaincodemarker.cpp b/src/tools/qdoc/plaincodemarker.cpp
deleted file mode 100644
index 94561c3f48..0000000000
--- a/src/tools/qdoc/plaincodemarker.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "plaincodemarker.h"
-
-QT_BEGIN_NAMESPACE
-
-PlainCodeMarker::PlainCodeMarker()
-{
-}
-
-PlainCodeMarker::~PlainCodeMarker()
-{
-}
-
-bool PlainCodeMarker::recognizeCode( const QString& /* code */ )
-{
- return true;
-}
-
-bool PlainCodeMarker::recognizeExtension( const QString& /* ext */ )
-{
- return true;
-}
-
-bool PlainCodeMarker::recognizeLanguage( const QString& /* lang */ )
-{
- return false;
-}
-
-Atom::Type PlainCodeMarker::atomType() const
-{
- return Atom::Code;
-}
-
-QString PlainCodeMarker::markedUpCode( const QString& code,
- const Node * /* relative */,
- const Location & /* location */ )
-{
- return protect( code );
-}
-
-QString PlainCodeMarker::markedUpSynopsis( const Node * /* node */,
- const Node * /* relative */,
- SynopsisStyle /* style */ )
-{
- return "foo";
-}
-
-QString PlainCodeMarker::markedUpName( const Node * /* node */ )
-{
- return QString();
-}
-
-QString PlainCodeMarker::markedUpFullName( const Node * /* node */,
- const Node * /* relative */ )
-{
- return QString();
-}
-
-QString PlainCodeMarker::markedUpEnumValue(const QString & /* enumValue */,
- const Node * /* relative */)
-{
- return QString();
-}
-
-QString PlainCodeMarker::markedUpIncludes( const QStringList& /* includes */ )
-{
- return QString();
-}
-
-QString PlainCodeMarker::functionBeginRegExp( const QString& /* funcName */ )
-{
- return QString();
-}
-
-QString PlainCodeMarker::functionEndRegExp( const QString& /* funcName */ )
-{
- return QString();
-}
-
-QList<Section> PlainCodeMarker::sections(const InnerNode * /* innerNode */,
- SynopsisStyle /* style */,
- Status /* status */)
-{
- return QList<Section>();
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/plaincodemarker.h b/src/tools/qdoc/plaincodemarker.h
deleted file mode 100644
index 6d41b3dd81..0000000000
--- a/src/tools/qdoc/plaincodemarker.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- plaincodemarker.h
-*/
-
-#ifndef PLAINCODEMARKER_H
-#define PLAINCODEMARKER_H
-
-#include "codemarker.h"
-
-QT_BEGIN_NAMESPACE
-
-class PlainCodeMarker : public CodeMarker
-{
-public:
- PlainCodeMarker();
- ~PlainCodeMarker();
-
- bool recognizeCode( const QString& code ) Q_DECL_OVERRIDE;
- bool recognizeExtension( const QString& ext ) Q_DECL_OVERRIDE;
- bool recognizeLanguage( const QString& lang ) Q_DECL_OVERRIDE;
- Atom::Type atomType() const Q_DECL_OVERRIDE;
- QString markedUpCode( const QString& code, const Node *relative, const Location &location ) Q_DECL_OVERRIDE;
- QString markedUpSynopsis( const Node *node, const Node *relative,
- SynopsisStyle style ) Q_DECL_OVERRIDE;
- QString markedUpName( const Node *node ) Q_DECL_OVERRIDE;
- QString markedUpFullName( const Node *node, const Node *relative ) Q_DECL_OVERRIDE;
- QString markedUpEnumValue(const QString &enumValue, const Node *relative) Q_DECL_OVERRIDE;
- QString markedUpIncludes( const QStringList& includes ) Q_DECL_OVERRIDE;
- QString functionBeginRegExp( const QString& funcName ) Q_DECL_OVERRIDE;
- QString functionEndRegExp( const QString& funcName ) Q_DECL_OVERRIDE;
- QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status) Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp
deleted file mode 100644
index e47460efb2..0000000000
--- a/src/tools/qdoc/puredocparser.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- puredocparser.cpp
-*/
-
-#include <qfile.h>
-#include <stdio.h>
-#include <errno.h>
-#include "codechunk.h"
-#include "config.h"
-#include "tokenizer.h"
-#include <qdebug.h>
-#include "qdocdatabase.h"
-#include "puredocparser.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- Constructs the pure doc parser.
-*/
-PureDocParser::PureDocParser()
-{
-}
-
-/*!
- Destroys the pure doc parser.
- */
-PureDocParser::~PureDocParser()
-{
-}
-
-/*!
- Returns a list of the kinds of files that the pure doc
- parser is meant to parse. The elements of the list are
- file suffixes.
- */
-QStringList PureDocParser::sourceFileNameFilter()
-{
- return QStringList() << "*.qdoc" << "*.qtx" << "*.qtt" << "*.js";
-}
-
-/*!
- Parses the source file identified by \a filePath and adds its
- parsed contents to the database. The \a location is used for
- reporting errors.
- */
-void PureDocParser::parseSourceFile(const Location& location, const QString& filePath)
-{
- QFile in(filePath);
- currentFile_ = filePath;
- if (!in.open(QIODevice::ReadOnly)) {
- location.error(tr("Can't open source file '%1' (%2)").arg(filePath).arg(strerror(errno)));
- currentFile_.clear();
- return;
- }
-
- reset();
- Location fileLocation(filePath);
- Tokenizer fileTokenizer(fileLocation, in);
- tokenizer = &fileTokenizer;
- readToken();
-
- /*
- The set of open namespaces is cleared before parsing
- each source file. The word "source" here means cpp file.
- */
- qdb_->clearOpenNamespaces();
-
- processQdocComments();
- in.close();
- currentFile_.clear();
-}
-
-/*!
- This is called by parseSourceFile() to do the actual parsing
- and tree building. It only processes qdoc comments. It skips
- everything else.
- */
-bool PureDocParser::processQdocComments()
-{
- const QSet<QString>& topicCommandsAllowed = topicCommands();
- const QSet<QString>& otherMetacommandsAllowed = otherMetaCommands();
- const QSet<QString>& metacommandsAllowed = topicCommandsAllowed + otherMetacommandsAllowed;
-
- while (tok != Tok_Eoi) {
- if (tok == Tok_Doc) {
- /*
- lexeme() returns an entire qdoc comment.
- */
- QString comment = lexeme();
- Location start_loc(location());
- readToken();
-
- Doc::trimCStyleComment(start_loc,comment);
- Location end_loc(location());
-
- /*
- Doc parses the comment.
- */
- Doc doc(start_loc, end_loc, comment, metacommandsAllowed, topicCommandsAllowed);
-
- QString topic;
- bool isQmlPropertyTopic = false;
- bool isJsPropertyTopic = false;
-
- const TopicList& topics = doc.topicsUsed();
- if (!topics.isEmpty()) {
- topic = topics[0].topic;
- if ((topic == COMMAND_QMLPROPERTY) ||
- (topic == COMMAND_QMLPROPERTYGROUP) ||
- (topic == COMMAND_QMLATTACHEDPROPERTY)) {
- isQmlPropertyTopic = true;
- }
- else if ((topic == COMMAND_JSPROPERTY) ||
- (topic == COMMAND_JSPROPERTYGROUP) ||
- (topic == COMMAND_JSATTACHEDPROPERTY)) {
- isJsPropertyTopic = true;
- }
- }
- if ((isQmlPropertyTopic || isJsPropertyTopic) && topics.size() > 1) {
- qDebug() << "MULTIPLE TOPICS:" << doc.location().fileName() << doc.location().lineNo();
- for (int i=0; i<topics.size(); ++i) {
- qDebug() << " " << topics[i].topic << topics[i].args;
- }
- }
-
- NodeList nodes;
- DocList docs;
-
- if (topic.isEmpty()) {
- doc.location().warning(tr("This qdoc comment contains no topic command "
- "(e.g., '\\%1', '\\%2').")
- .arg(COMMAND_MODULE).arg(COMMAND_PAGE));
- }
- else if (isQmlPropertyTopic || isJsPropertyTopic) {
- Doc nodeDoc = doc;
- processQmlProperties(nodeDoc, nodes, docs, isJsPropertyTopic);
- }
- else {
- ArgList args;
- QSet<QString> topicCommandsUsed = topicCommandsAllowed & doc.metaCommandsUsed();
- if (topicCommandsUsed.count() > 0) {
- topic = *topicCommandsUsed.begin();
- args = doc.metaCommandArgs(topic);
- }
- if (topicCommandsUsed.count() > 1) {
- QString topics;
- QSet<QString>::ConstIterator t = topicCommandsUsed.constBegin();
- while (t != topicCommandsUsed.constEnd()) {
- topics += " \\" + *t + ",";
- ++t;
- }
- topics[topics.lastIndexOf(',')] = '.';
- int i = topics.lastIndexOf(',');
- topics[i] = ' ';
- topics.insert(i+1,"and");
- doc.location().warning(tr("Multiple topic commands found in comment: %1").arg(topics));
- }
- ArgList::ConstIterator a = args.cbegin();
- while (a != args.cend()) {
- Doc nodeDoc = doc;
- Node* node = processTopicCommand(nodeDoc,topic,*a);
- if (node != 0) {
- nodes.append(node);
- docs.append(nodeDoc);
- }
- ++a;
- }
- }
-
- Node* treeRoot = QDocDatabase::qdocDB()->primaryTreeRoot();
- NodeList::Iterator n = nodes.begin();
- QList<Doc>::Iterator d = docs.begin();
- while (n != nodes.end()) {
- processOtherMetaCommands(*d, *n);
- (*n)->setDoc(*d);
- checkModuleInclusion(*n);
- if ((*n)->isInnerNode() && ((InnerNode *)*n)->includes().isEmpty()) {
- InnerNode *m = static_cast<InnerNode *>(*n);
- while (m->parent() && m->parent() != treeRoot)
- m = m->parent();
- if (m == *n)
- ((InnerNode *)*n)->addInclude((*n)->name());
- else
- ((InnerNode *)*n)->setIncludes(m->includes());
- }
- ++d;
- ++n;
- }
- }
- else {
- readToken();
- }
- }
- return true;
-}
-
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/puredocparser.h b/src/tools/qdoc/puredocparser.h
deleted file mode 100644
index 20748c882d..0000000000
--- a/src/tools/qdoc/puredocparser.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- puredocparser.h
-*/
-
-#ifndef PUREDOCPARSER_H
-#define PUREDOCPARSER_H
-
-#include <qset.h>
-
-#include "cppcodeparser.h"
-#include "location.h"
-
-QT_BEGIN_NAMESPACE
-
-class Config;
-class Node;
-class QString;
-
-class PureDocParser : public CppCodeParser
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::PureDocParser)
-
-public:
- PureDocParser();
- virtual ~PureDocParser();
-
- virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
- virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
-
- private:
- bool processQdocComments();
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro
deleted file mode 100644
index f0df113af8..0000000000
--- a/src/tools/qdoc/qdoc.pro
+++ /dev/null
@@ -1,100 +0,0 @@
-!force_bootstrap {
- load(qfeatures)
- requires(!contains(QT_DISABLED_FEATURES, xmlstreamwriter))
- requires(!contains(QT_DISABLED_FEATURES, dom))
-}
-
-option(host_build)
-QT = core xml
-
-DEFINES += \
- QT_QMLDEVTOOLS_LIB \ # force static exports even if not bootstrapping
- QDOC2_COMPAT
-
-INCLUDEPATH += $$QT_SOURCE_TREE/src/tools/qdoc \
- $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser
-
-# Increase the stack size on MSVC to 4M to avoid a stack overflow
-win32-msvc*:{
- QMAKE_LFLAGS += /STACK:4194304
-}
-
-HEADERS += atom.h \
- codechunk.h \
- codemarker.h \
- codeparser.h \
- config.h \
- cppcodemarker.h \
- cppcodeparser.h \
- doc.h \
- editdistance.h \
- generator.h \
- helpprojectwriter.h \
- htmlgenerator.h \
- location.h \
- node.h \
- openedlist.h \
- plaincodemarker.h \
- puredocparser.h \
- qdocdatabase.h \
- qdoctagfiles.h \
- qdocindexfiles.h \
- quoter.h \
- separator.h \
- text.h \
- tokenizer.h \
- tree.h
-SOURCES += atom.cpp \
- codechunk.cpp \
- codemarker.cpp \
- codeparser.cpp \
- config.cpp \
- cppcodemarker.cpp \
- cppcodeparser.cpp \
- doc.cpp \
- editdistance.cpp \
- generator.cpp \
- helpprojectwriter.cpp \
- htmlgenerator.cpp \
- location.cpp \
- main.cpp \
- node.cpp \
- openedlist.cpp \
- plaincodemarker.cpp \
- puredocparser.cpp \
- qdocdatabase.cpp \
- qdoctagfiles.cpp \
- qdocindexfiles.cpp \
- quoter.cpp \
- separator.cpp \
- text.cpp \
- tokenizer.cpp \
- tree.cpp \
- yyindent.cpp
-
-### QML/JS Parser ###
-
-include(qmlparser/parser.pri)
-
-HEADERS += jscodemarker.h \
- qmlcodemarker.h \
- qmlcodeparser.h \
- qmlmarkupvisitor.h \
- qmlvisitor.h
-
-SOURCES += jscodemarker.cpp \
- qmlcodemarker.cpp \
- qmlcodeparser.cpp \
- qmlmarkupvisitor.cpp \
- qmlvisitor.cpp
-
-### Documentation for qdoc ###
-
-qtPrepareTool(QDOC, qdoc)
-qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
-
-QMAKE_DOCS = $$PWD/doc/config/qdoc.qdocconf
-
-load(qt_tool)
-
-TR_EXCLUDE += $$PWD/*
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
deleted file mode 100644
index bf84fa8335..0000000000
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ /dev/null
@@ -1,1688 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "generator.h"
-#include "atom.h"
-#include "tree.h"
-#include "qdocdatabase.h"
-#include "qdoctagfiles.h"
-#include "qdocindexfiles.h"
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-static NodeMap emptyNodeMap_;
-static NodeMultiMap emptyNodeMultiMap_;
-bool QDocDatabase::debug = false;
-
-/*! \class QDocForest
- This class manages a collection of trees. Each tree is an
- instance of class Tree, which is a private class.
-
- The forest is populated as each index file is loaded.
- Each index file adds a tree to the forest. Each tree
- is named with the name of the module it represents.
-
- The search order is created by searchOrder(), if it has
- not already been created. The search order and module
- names arrays have parallel structure, i.e. modulNames_[i]
- is the module name of the Tree at searchOrder_[i].
- */
-
-/*!
- Destroys the qdoc forest. This requires deleting
- each Tree in the forest. Note that the forest has
- been transferred into the search order array, so
- what is really being used to destroy the forest
- is the search order array.
- */
-QDocForest::~QDocForest()
-{
- for (int i=0; i<searchOrder_.size(); ++i)
- delete searchOrder_.at(i);
- forest_.clear();
- searchOrder_.clear();
- indexSearchOrder_.clear();
- moduleNames_.clear();
- primaryTree_ = 0;
-}
-
-/*!
- Initializes the forest prior to a traversal and
- returns a pointer to the root node of the primary
- tree. If the forest is empty, it return 0
- */
-NamespaceNode* QDocForest::firstRoot()
-{
- currentIndex_ = 0;
- return (!searchOrder().isEmpty() ? searchOrder()[0]->root() : 0);
-}
-
-/*!
- Increments the forest's current tree index. If the current
- tree index is still within the forest, the function returns
- the root node of the current tree. Otherwise it returns 0.
- */
-NamespaceNode* QDocForest::nextRoot()
-{
- ++currentIndex_;
- return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_]->root() : 0);
-}
-
-/*!
- Initializes the forest prior to a traversal and
- returns a pointer to the primary tree. If the
- forest is empty, it returns 0.
- */
-Tree* QDocForest::firstTree()
-{
- currentIndex_ = 0;
- return (!searchOrder().isEmpty() ? searchOrder()[0] : 0);
-}
-
-/*!
- Increments the forest's current tree index. If the current
- tree index is still within the forest, the function returns
- the pointer to the current tree. Otherwise it returns 0.
- */
-Tree* QDocForest::nextTree()
-{
- ++currentIndex_;
- return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_] : 0);
-}
-
-/*!
- \fn Tree* QDocForest::primaryTree()
-
- Returns the pointer to the primary tree.
- */
-
-/*!
- Finds the tree for module \a t in the forest and
- sets the primary tree to be that tree. After the
- primary tree is set, that tree is removed from the
- forest.
-
- \node It gets re-inserted into the forest after the
- search order is built.
- */
-void QDocForest::setPrimaryTree(const QString& t)
-{
- QString T = t.toLower();
- primaryTree_ = findTree(T);
- forest_.remove(T);
- if (!primaryTree_)
- qDebug() << "ERROR: Could not set primary tree to:" << t;
-}
-
-/*!
- If the search order array is empty, create the search order.
- If the search order array is not empty, do nothing.
- */
-void QDocForest::setSearchOrder(QStringList& t)
-{
- if (!searchOrder_.isEmpty())
- return;
-
- /* Allocate space for the search order. */
- searchOrder_.reserve(forest_.size()+1);
- searchOrder_.clear();
- moduleNames_.reserve(forest_.size()+1);
- moduleNames_.clear();
-
- /* The primary tree is always first in the search order. */
- QString primaryName = primaryTree()->physicalModuleName();
- searchOrder_.append(primaryTree_);
- moduleNames_.append(primaryName);
- forest_.remove(primaryName);
-
- QMap<QString, Tree*>::iterator i;
- foreach (QString m, t) {
- if (primaryName != m) {
- i = forest_.find(m);
- if (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append(m);
- forest_.remove(m);
- }
- }
- }
- /*
- If any trees remain in the forest, just add them
- to the search order sequentially, because we don't
- know any better at this point.
- */
- if (!forest_.isEmpty()) {
- i = forest_.begin();
- while (i != forest_.end()) {
- searchOrder_.append(i.value());
- moduleNames_.append(i.key());
- ++i;
- }
- forest_.clear();
- }
-
- /*
- Rebuild the forest after constructing the search order.
- It was destroyed during construction of the search order,
- but it is needed for module-specific searches.
-
- Note that this loop also inserts the primary tree into the
- forrest. That is a requirement.
- */
- for (int i=0; i<searchOrder_.size(); ++i) {
- if (!forest_.contains(moduleNames_.at(i))) {
- forest_.insert(moduleNames_.at(i), searchOrder_.at(i));
- }
- }
-#if 0
- qDebug() << " SEARCH ORDER:";
- for (int i=0; i<moduleNames_.size(); ++i)
- qDebug() << " " << i+1 << "." << moduleNames_.at(i);
- qDebug() << " FOREST:" << forest_.keys();
- qDebug() << "SEARCH ORDER:" << moduleNames_;
-#endif
-}
-
-/*!
- Returns an ordered array of Tree pointers that represents
- the order in which the trees should be searched. The first
- Tree in the array is the tree for the current module, i.e.
- the module for which qdoc is generating documentation.
-
- The other Tree pointers in the array represent the index
- files that were loaded in preparation for generating this
- module's documentation. Each Tree pointer represents one
- index file. The index file Tree points have been ordered
- heuristically to, hopefully, minimize searching. Thr order
- will probably be changed.
-
- If the search order array is empty, this function calls
- indexSearchOrder(). The search order array is empty while
- the index files are being loaded, but some searches must
- be performed during this time, notably searches for base
- class nodes. These searches require a temporary search
- order. The temporary order changes throughout the loading
- of the index files, but it is always the tree for the
- current index file first, followed by the trees for the
- index files that have already been loaded. The only
- ordering required in this temporary search order is that
- the current tree must be searched first.
- */
-const QVector<Tree*>& QDocForest::searchOrder()
-{
- if (searchOrder_.isEmpty())
- return indexSearchOrder();
- return searchOrder_;
-}
-
-/*!
- There are two search orders used by qdoc when searching for
- things. The normal search order is returned by searchOrder(),
- but this normal search order is not known until all the index
- files have been read. At that point, setSearchOrder() is
- called.
-
- During the reading of the index files, the vector holding
- the normal search order remains empty. Whenever the search
- order is requested, if that vector is empty, this function
- is called to return a temporary search order, which includes
- all the index files that have been read so far, plus the
- one being read now. That one is prepended to the front of
- the vector.
- */
-const QVector<Tree*>& QDocForest::indexSearchOrder()
-{
- if (forest_.size() > indexSearchOrder_.size())
- indexSearchOrder_.prepend(primaryTree_);
- return indexSearchOrder_;
-}
-
-/*!
- Create a new Tree for the index file for the specified
- \a module and add it to the forest. Return the pointer
- to its root.
- */
-NamespaceNode* QDocForest::newIndexTree(const QString& module)
-{
- primaryTree_ = new Tree(module, qdb_);
- forest_.insert(module, primaryTree_);
- return primaryTree_->root();
-}
-
-/*!
- Create a new Tree for use as the primary tree. This tree
- will represent the primary module. \a module is camel case.
- */
-void QDocForest::newPrimaryTree(const QString& module)
-{
- primaryTree_ = new Tree(module, qdb_);
-}
-
-/*!
- Searches through the forest for a node named \a targetPath
- and returns a pointer to it if found. The \a relative node
- is the starting point. It only makes sense for the primary
- tree, which is searched first. After the primary tree has
- been searched, \a relative is set to 0 for searching the
- other trees, which are all index trees. With relative set
- to 0, the starting point for each index tree is the root
- of the index tree.
- */
-const Node* QDocForest::findNodeForTarget(QStringList& targetPath,
- const Node* relative,
- Node::Genus genus,
- QString& ref)
-{
- int flags = SearchBaseClasses | SearchEnumValues;
-
- QString entity = targetPath.at(0);
- targetPath.removeFirst();
- QStringList entityPath = entity.split("::");
-
- QString target;
- if (!targetPath.isEmpty()) {
- target = targetPath.at(0);
- targetPath.removeFirst();
- }
-
- foreach (Tree* t, searchOrder()) {
- const Node* n = t->findNodeForTarget(entityPath, target, relative, flags, genus, ref);
- if (n)
- return n;
- relative = 0;
- }
- return 0;
-}
-
-/*!
- Print the list of module names ordered according
- to how many successful searches each tree had.
- */
-void QDocForest::printLinkCounts(const QString& project)
-{
- Location::null.report(QString("%1: Link Counts").arg(project));
- QMultiMap<int, QString> m;
- foreach (Tree* t, searchOrder()) {
- if (t->linkCount() < 0)
- m.insert(t->linkCount(), t->physicalModuleName());
- }
- QString depends = "depends +=";
- QString module = project.toLower();
- QMultiMap<int, QString>::iterator i = m.begin();
- while (i != m.end()) {
- QString line = " " + i.value();
- if (i.value() != module)
- depends += " " + i.value();
- int pad = 30 - line.length();
- for (int k=0; k<pad; ++k)
- line += " ";
- line += "%1";
- Location::null.report(line.arg(-(i.key())));
- ++i;
- }
- Location::null.report("Optimal depends variable:");
- Location::null.report(depends);
-}
-
-/*!
- Print the list of module names ordered according
- to how many successful searches each tree had.
- */
-QString QDocForest::getLinkCounts(QStringList& strings, QVector<int>& counts)
-{
- QMultiMap<int, QString> m;
- foreach (Tree* t, searchOrder()) {
- if (t->linkCount() < 0)
- m.insert(t->linkCount(), t->physicalModuleName());
- }
- QString depends = "depends +=";
- QString module = Generator::defaultModuleName().toLower();
- QMultiMap<int, QString>::iterator i = m.begin();
- while (i != m.end()) {
- if (i.value() != module) {
- counts.append(-(i.key()));
- strings.append(i.value());
- depends += " " + i.value();
- }
- ++i;
- }
- return depends;
-}
-
-/*! \class QDocDatabase
- This class provides exclusive access to the qdoc database,
- which consists of a forrest of trees and a lot of maps and
- other useful data structures.
- */
-
-QDocDatabase* QDocDatabase::qdocDB_ = NULL;
-NodeMap QDocDatabase::typeNodeMap_;
-
-/*!
- Constructs the singleton qdoc database object. The singleton
- constructs the \a forest_ object, which is also a singleton.
- \a showInternal_ is normally false. If it is true, qdoc will
- write documentation for nodes marked \c internal.
-
- \a singleExec_ is false when qdoc is being used in the standard
- way of running qdoc twices for each module, first with -prepare
- and then with -generate. First the -prepare phase is run for
- each module, then the -generate phase is run for each module.
-
- When \a singleExec_ is true, qdoc is run only once. During the
- single execution, qdoc processes the qdocconf files for all the
- modules sequentially in a loop. Each source file for each module
- is read exactly once.
- */
-QDocDatabase::QDocDatabase()
- : showInternal_(false), singleExec_(false), forest_(this)
-{
- // nothing
-}
-
-/*!
- Destroys the qdoc database object. This requires destroying
- the forest object, which contains an array of tree pointers.
- Each tree is deleted.
- */
-QDocDatabase::~QDocDatabase()
-{
- // nothing.
-}
-
-/*!
- Creates the singleton. Allows only one instance of the class
- to be created. Returns a pointer to the singleton.
-*/
-QDocDatabase* QDocDatabase::qdocDB()
-{
- if (!qdocDB_) {
- qdocDB_ = new QDocDatabase;
- initializeDB();
- }
- return qdocDB_;
-}
-
-/*!
- Destroys the singleton.
- */
-void QDocDatabase::destroyQdocDB()
-{
- if (qdocDB_) {
- delete qdocDB_;
- qdocDB_ = 0;
- }
-}
-
-/*!
- Initialize data structures in the singleton qdoc database.
-
- In particular, the type node map is initialized with a lot
- type names that don't refer to documented types. For example,
- the C++ standard types are included. These might be documented
- here at some point, but for now they are not. Other examples
- include \c array and \c data, which are just generic names
- used as place holders in function signatures that appear in
- the documentation.
-
- Also calls Node::initialize() to initialize the search goal map.
- */
-void QDocDatabase::initializeDB()
-{
- Node::initialize();
- typeNodeMap_.insert( "accepted", 0);
- typeNodeMap_.insert( "actionPerformed", 0);
- typeNodeMap_.insert( "activated", 0);
- typeNodeMap_.insert( "alias", 0);
- typeNodeMap_.insert( "anchors", 0);
- typeNodeMap_.insert( "any", 0);
- typeNodeMap_.insert( "array", 0);
- typeNodeMap_.insert( "autoSearch", 0);
- typeNodeMap_.insert( "axis", 0);
- typeNodeMap_.insert( "backClicked", 0);
- typeNodeMap_.insert( "bool", 0);
- typeNodeMap_.insert( "boomTime", 0);
- typeNodeMap_.insert( "border", 0);
- typeNodeMap_.insert( "buttonClicked", 0);
- typeNodeMap_.insert( "callback", 0);
- typeNodeMap_.insert( "char", 0);
- typeNodeMap_.insert( "clicked", 0);
- typeNodeMap_.insert( "close", 0);
- typeNodeMap_.insert( "closed", 0);
- typeNodeMap_.insert( "color", 0);
- typeNodeMap_.insert( "cond", 0);
- typeNodeMap_.insert( "data", 0);
- typeNodeMap_.insert( "dataReady", 0);
- typeNodeMap_.insert( "dateString", 0);
- typeNodeMap_.insert( "dateTimeString", 0);
- typeNodeMap_.insert( "datetime", 0);
- typeNodeMap_.insert( "day", 0);
- typeNodeMap_.insert( "deactivated", 0);
- typeNodeMap_.insert( "double", 0);
- typeNodeMap_.insert( "drag", 0);
- typeNodeMap_.insert( "easing", 0);
- typeNodeMap_.insert( "enumeration", 0);
- typeNodeMap_.insert( "error", 0);
- typeNodeMap_.insert( "exposure", 0);
- typeNodeMap_.insert( "fatalError", 0);
- typeNodeMap_.insert( "fileSelected", 0);
- typeNodeMap_.insert( "flags", 0);
- typeNodeMap_.insert( "float", 0);
- typeNodeMap_.insert( "focus", 0);
- typeNodeMap_.insert( "focusZone", 0);
- typeNodeMap_.insert( "format", 0);
- typeNodeMap_.insert( "framePainted", 0);
- typeNodeMap_.insert( "from", 0);
- typeNodeMap_.insert( "frontClicked", 0);
- typeNodeMap_.insert( "function", 0);
- typeNodeMap_.insert( "hasOpened", 0);
- typeNodeMap_.insert( "hovered", 0);
- typeNodeMap_.insert( "hoveredTitle", 0);
- typeNodeMap_.insert( "hoveredUrl", 0);
- typeNodeMap_.insert( "imageCapture", 0);
- typeNodeMap_.insert( "imageProcessing", 0);
- typeNodeMap_.insert( "index", 0);
- typeNodeMap_.insert( "initialized", 0);
- typeNodeMap_.insert( "int", 0);
- typeNodeMap_.insert( "isLoaded", 0);
- typeNodeMap_.insert( "item", 0);
- typeNodeMap_.insert( "jsdict", 0);
- typeNodeMap_.insert( "jsobject", 0);
- typeNodeMap_.insert( "key", 0);
- typeNodeMap_.insert( "keysequence", 0);
- typeNodeMap_.insert( "list", 0);
- typeNodeMap_.insert( "listViewClicked", 0);
- typeNodeMap_.insert( "loadRequest", 0);
- typeNodeMap_.insert( "locale", 0);
- typeNodeMap_.insert( "location", 0);
- typeNodeMap_.insert( "long", 0);
- typeNodeMap_.insert( "message", 0);
- typeNodeMap_.insert( "messageReceived", 0);
- typeNodeMap_.insert( "mode", 0);
- typeNodeMap_.insert( "month", 0);
- typeNodeMap_.insert( "name", 0);
- typeNodeMap_.insert( "number", 0);
- typeNodeMap_.insert( "object", 0);
- typeNodeMap_.insert( "offset", 0);
- typeNodeMap_.insert( "ok", 0);
- typeNodeMap_.insert( "openCamera", 0);
- typeNodeMap_.insert( "openImage", 0);
- typeNodeMap_.insert( "openVideo", 0);
- typeNodeMap_.insert( "padding", 0);
- typeNodeMap_.insert( "parent", 0);
- typeNodeMap_.insert( "path", 0);
- typeNodeMap_.insert( "photoModeSelected", 0);
- typeNodeMap_.insert( "position", 0);
- typeNodeMap_.insert( "precision", 0);
- typeNodeMap_.insert( "presetClicked", 0);
- typeNodeMap_.insert( "preview", 0);
- typeNodeMap_.insert( "previewSelected", 0);
- typeNodeMap_.insert( "progress", 0);
- typeNodeMap_.insert( "puzzleLost", 0);
- typeNodeMap_.insert( "qmlSignal", 0);
- typeNodeMap_.insert( "real", 0);
- typeNodeMap_.insert( "rectangle", 0);
- typeNodeMap_.insert( "request", 0);
- typeNodeMap_.insert( "requestId", 0);
- typeNodeMap_.insert( "section", 0);
- typeNodeMap_.insert( "selected", 0);
- typeNodeMap_.insert( "send", 0);
- typeNodeMap_.insert( "settingsClicked", 0);
- typeNodeMap_.insert( "shoe", 0);
- typeNodeMap_.insert( "short", 0);
- typeNodeMap_.insert( "signed", 0);
- typeNodeMap_.insert( "sizeChanged", 0);
- typeNodeMap_.insert( "size_t", 0);
- typeNodeMap_.insert( "sockaddr", 0);
- typeNodeMap_.insert( "someOtherSignal", 0);
- typeNodeMap_.insert( "sourceSize", 0);
- typeNodeMap_.insert( "startButtonClicked", 0);
- typeNodeMap_.insert( "state", 0);
- typeNodeMap_.insert( "std::initializer_list", 0);
- typeNodeMap_.insert( "std::list", 0);
- typeNodeMap_.insert( "std::map", 0);
- typeNodeMap_.insert( "std::pair", 0);
- typeNodeMap_.insert( "std::string", 0);
- typeNodeMap_.insert( "std::vector", 0);
- typeNodeMap_.insert( "string", 0);
- typeNodeMap_.insert( "stringlist", 0);
- typeNodeMap_.insert( "swapPlayers", 0);
- typeNodeMap_.insert( "symbol", 0);
- typeNodeMap_.insert( "t", 0);
- typeNodeMap_.insert( "T", 0);
- typeNodeMap_.insert( "tagChanged", 0);
- typeNodeMap_.insert( "timeString", 0);
- typeNodeMap_.insert( "timeout", 0);
- typeNodeMap_.insert( "to", 0);
- typeNodeMap_.insert( "toggled", 0);
- typeNodeMap_.insert( "type", 0);
- typeNodeMap_.insert( "unsigned", 0);
- typeNodeMap_.insert( "urllist", 0);
- typeNodeMap_.insert( "va_list", 0);
- typeNodeMap_.insert( "value", 0);
- typeNodeMap_.insert( "valueEmitted", 0);
- typeNodeMap_.insert( "videoFramePainted", 0);
- typeNodeMap_.insert( "videoModeSelected", 0);
- typeNodeMap_.insert( "videoRecorder", 0);
- typeNodeMap_.insert( "void", 0);
- typeNodeMap_.insert( "volatile", 0);
- typeNodeMap_.insert( "wchar_t", 0);
- typeNodeMap_.insert( "x", 0);
- typeNodeMap_.insert( "y", 0);
- typeNodeMap_.insert( "zoom", 0);
- typeNodeMap_.insert( "zoomTo", 0);
-}
-
-/*! \fn NamespaceNode* QDocDatabase::primaryTreeRoot()
- Returns a pointer to the root node of the primary tree.
- */
-
-/*!
- \fn const CNMap& QDocDatabase::groups()
- Returns a const reference to the collection of all
- group nodes in the primary tree.
-*/
-
-/*!
- \fn const CNMap& QDocDatabase::modules()
- Returns a const reference to the collection of all
- module nodes in the primary tree.
-*/
-
-/*!
- \fn const CNMap& QDocDatabase::qmlModules()
- Returns a const reference to the collection of all
- QML module nodes in the primary tree.
-*/
-
-/*!
- \fn const CNMap& QDocDatabase::jsModules()
- Returns a const reference to the collection of all
- JovaScript module nodes in the primary tree.
-*/
-
-/*! \fn CollectionNode* QDocDatabase::findGroup(const QString& name)
- Find the group node named \a name and return a pointer
- to it. If a matching node is not found, add a new group
- node named \a name and return a pointer to that one.
-
- If a new group node is added, its parent is the tree root,
- and the new group node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* QDocDatabase::findModule(const QString& name)
- Find the module node named \a name and return a pointer
- to it. If a matching node is not found, add a new module
- node named \a name and return a pointer to that one.
-
- If a new module node is added, its parent is the tree root,
- and the new module node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* QDocDatabase::findQmlModule(const QString& name, bool javaScript)
- Find the QML module node named \a name and return a pointer
- to it. If a matching node is not found, add a new QML module
- node named \a name and return a pointer to that one.
-
- If \a javaScript is set, the return collection must be a
- JavaScript module.
-
- If a new QML or JavaScript module node is added, its parent
- is the tree root, and the new node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* QDocDatabase::addGroup(const QString& name)
- Looks up the group named \a name in the primary tree. If
- a match is found, a pointer to the node is returned.
- Otherwise, a new group node named \a name is created and
- inserted into the collection, and the pointer to that node
- is returned.
- */
-
-/*! \fn CollectionNode* QDocDatabase::addModule(const QString& name)
- Looks up the module named \a name in the primary tree. If
- a match is found, a pointer to the node is returned.
- Otherwise, a new module node named \a name is created and
- inserted into the collection, and the pointer to that node
- is returned.
- */
-
-/*! \fn CollectionNode* QDocDatabase::addQmlModule(const QString& name)
- Looks up the QML module named \a name in the primary tree.
- If a match is found, a pointer to the node is returned.
- Otherwise, a new QML module node named \a name is created
- and inserted into the collection, and the pointer to that
- node is returned.
- */
-
-/*! \fn CollectionNode* QDocDatabase::addJsModule(const QString& name)
- Looks up the JavaScript module named \a name in the primary
- tree. If a match is found, a pointer to the node is returned.
- Otherwise, a new JavaScript module node named \a name is
- created and inserted into the collection, and the pointer to
- that node is returned.
- */
-
-/*! \fn CollectionNode* QDocDatabase::addToGroup(const QString& name, Node* node)
- Looks up the group node named \a name in the collection
- of all group nodes. If a match is not found, a new group
- node named \a name is created and inserted into the collection.
- Then append \a node to the group's members list, and append the
- group node to the member list of the \a node. The parent of the
- \a node is not changed by this function. Returns a pointer to
- the group node.
- */
-
-/*! \fn CollectionNode* QDocDatabase::addToModule(const QString& name, Node* node)
- Looks up the module node named \a name in the collection
- of all module nodes. If a match is not found, a new module
- node named \a name is created and inserted into the collection.
- Then append \a node to the module's members list. The parent of
- \a node is not changed by this function. Returns the module node.
- */
-
-/*! \fn Collection* QDocDatabase::addToQmlModule(const QString& name, Node* node)
- Looks up the QML module named \a name. If it isn't there,
- create it. Then append \a node to the QML module's member
- list. The parent of \a node is not changed by this function.
- */
-
-/*! \fn Collection* QDocDatabase::addToJsModule(const QString& name, Node* node)
- Looks up the JavaScript module named \a name. If it isn't there,
- create it. Then append \a node to the JavaScript module's member
- list. The parent of \a node is not changed by this function.
- */
-
-/*!
- Looks up the QML type node identified by the qualified Qml
- type \a name and returns a pointer to the QML type node.
- */
-QmlTypeNode* QDocDatabase::findQmlType(const QString& name)
-{
- QmlTypeNode* qcn = forest_.lookupQmlType(name);
- if (qcn)
- return qcn;
- return 0;
-}
-
-/*!
- Looks up the QML type node identified by the Qml module id
- \a qmid and QML type \a name and returns a pointer to the
- QML type node. The key is \a qmid + "::" + \a name.
-
- If the QML module id is empty, it looks up the QML type by
- \a name only.
- */
-QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
-{
- if (!qmid.isEmpty()) {
- QString t = qmid + "::" + name;
- QmlTypeNode* qcn = forest_.lookupQmlType(t);
- if (qcn)
- return qcn;
- }
-
- QStringList path(name);
- Node* n = forest_.findNodeByNameAndType(path, Node::QmlType);
- if (n && (n->isQmlType() || n->isJsType()))
- return static_cast<QmlTypeNode*>(n);
- return 0;
-}
-
-/*!
- Looks up the QML type node identified by the Qml module id
- constructed from the strings in the \a import record and the
- QML type \a name and returns a pointer to the QML type node.
- If a QML type node is not found, 0 is returned.
- */
-QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& name)
-{
- if (!import.isEmpty()) {
- QStringList dotSplit;
- dotSplit = name.split(QLatin1Char('.'));
- QString qmName;
- if (import.importUri_.isEmpty())
- qmName = import.name_;
- else
- qmName = import.importUri_;
- for (int i=0; i<dotSplit.size(); ++i) {
- QString qualifiedName = qmName + "::" + dotSplit[i];
- QmlTypeNode* qcn = forest_.lookupQmlType(qualifiedName);
- if (qcn)
- return qcn;
- }
- }
- return 0;
-}
-
-/*!
- This function calls a set of functions for each tree in the
- forest that has not already been analyzed. In this way, when
- running qdoc in \e singleExec mode, each tree is analyzed in
- turn, and its classes and types are added to the appropriate
- node maps.
- */
-void QDocDatabase::processForest()
-{
- Tree* t = forest_.firstTree();
- while (t) {
- findAllClasses(t->root());
- findAllFunctions(t->root());
- findAllObsoleteThings(t->root());
- findAllLegaleseTexts(t->root());
- findAllSince(t->root());
- t->setTreeHasBeenAnalyzed();
- t = forest_.nextTree();
- }
- resolveNamespaces();
-}
-
-/*!
- This function calls \a func for each tree in the forest,
- but only if Tree::treeHasBeenAnalyzed() returns false for
- the tree. In this way, when running qdoc in \e singleExec
- mode, each tree is analyzed in turn, and its classes and
- types are added to the appropriate node maps.
- */
-void QDocDatabase::processForest(void (QDocDatabase::*func) (InnerNode*))
-{
- Tree* t = forest_.firstTree();
- while (t) {
- if (!t->treeHasBeenAnalyzed()) {
- (this->*(func))(t->root());
- }
- t = forest_.nextTree();
- }
-}
-
-/*!
- Constructs the collection of legalese texts, if it has not
- already been constructed and returns a reference to it.
- */
-TextToNodeMap& QDocDatabase::getLegaleseTexts()
-{
- if (legaleseTexts_.isEmpty())
- processForest(&QDocDatabase::findAllLegaleseTexts);
- return legaleseTexts_;
-}
-
-/*!
- Construct the data structures for obsolete things, if they
- have not already been constructed. Returns a reference to
- the map of C++ classes with obsolete members.
- */
-NodeMultiMap& QDocDatabase::getClassesWithObsoleteMembers()
-{
- if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllObsoleteThings);
- return classesWithObsoleteMembers_;
-}
-
-/*!
- Construct the data structures for obsolete things, if they
- have not already been constructed. Returns a reference to
- the map of obsolete QML types.
- */
-NodeMultiMap& QDocDatabase::getObsoleteQmlTypes()
-{
- if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllObsoleteThings);
- return obsoleteQmlTypes_;
-}
-
-/*!
- Construct the data structures for obsolete things, if they
- have not already been constructed. Returns a reference to
- the map of QML types with obsolete members.
- */
-NodeMultiMap& QDocDatabase::getQmlTypesWithObsoleteMembers()
-{
- if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllObsoleteThings);
- return qmlTypesWithObsoleteMembers_;
-}
-
-/*! \fn NodeMultiMap& QDocDatabase::getNamespaces()
- Returns a reference to the map of all namespace nodes.
- This function must not be called in the -prepare phase.
- */
-
-/*!
- Construct the data structures for QML basic types, if they
- have not already been constructed. Returns a reference to
- the map of QML basic types.
- */
-NodeMultiMap& QDocDatabase::getQmlBasicTypes()
-{
- if (cppClasses_.isEmpty() && qmlBasicTypes_.isEmpty())
- processForest(&QDocDatabase::findAllClasses);
- return qmlBasicTypes_;
-}
-
-/*!
- Construct the data structures for obsolete things, if they
- have not already been constructed. Returns a reference to
- the multimap of QML types.
- */
-NodeMultiMap& QDocDatabase::getQmlTypes()
-{
- if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllClasses);
- return qmlTypes_;
-}
-
-/*!
- Construct the data structures for obsolete things, if they
- have not already been constructed. Returns a reference to
- the map of obsolete C++ clases.
- */
-NodeMultiMap& QDocDatabase::getObsoleteClasses()
-{
- if (obsoleteClasses_.isEmpty() && obsoleteQmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllObsoleteThings);
- return obsoleteClasses_;
-}
-
-/*!
- Construct the C++ class data structures, if they have not
- already been constructed. Returns a reference to the map
- of all C++ classes.
- */
-NodeMultiMap& QDocDatabase::getCppClasses()
-{
- if (cppClasses_.isEmpty() && qmlTypes_.isEmpty())
- processForest(&QDocDatabase::findAllClasses);
- return cppClasses_;
-}
-
-/*!
- Finds all the C++ class nodes and QML type nodes and
- sorts them into maps.
- */
-void QDocDatabase::findAllClasses(InnerNode* node)
-{
- NodeList::const_iterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private && (!(*c)->isInternal() || showInternal_) &&
- (*c)->tree()->camelCaseModuleName() != QString("QDoc")) {
- if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) {
- QString className = (*c)->name();
- if ((*c)->parent() &&
- (*c)->parent()->type() == Node::Namespace &&
- !(*c)->parent()->name().isEmpty())
- className = (*c)->parent()->name()+"::"+className;
-
- cppClasses_.insert(className, *c);
- }
- else if (((*c)->isQmlType() || (*c)->isQmlBasicType() ||
- (*c)->isJsType() || (*c)->isJsBasicType()) && !(*c)->doc().isEmpty()) {
- QString qmlTypeName = (*c)->name();
- if (qmlTypeName.startsWith(QLatin1String("QML:")))
- qmlTypes_.insert(qmlTypeName.mid(4),*c);
- else
- qmlTypes_.insert(qmlTypeName,*c);
-
- //also add to the QML basic type map
- if ((*c)->isQmlBasicType() || (*c)->isJsType())
- qmlBasicTypes_.insert(qmlTypeName,*c);
- }
- else if ((*c)->isInnerNode()) {
- findAllClasses(static_cast<InnerNode*>(*c));
- }
- }
- ++c;
- }
-}
-
-/*!
- Construct the function index data structure and return it.
- This data structure is used to output the function index page.
- */
-NodeMapMap& QDocDatabase::getFunctionIndex()
-{
- processForest(&QDocDatabase::findAllFunctions);
- return funcIndex_;
-}
-
-/*!
- Finds all the function nodes
- */
-void QDocDatabase::findAllFunctions(InnerNode* node)
-{
- NodeList::ConstIterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private) {
- if ((*c)->isInnerNode()) {
- findAllFunctions(static_cast<InnerNode*>(*c));
- }
- else if ((*c)->type() == Node::Function) {
- const FunctionNode* func = static_cast<const FunctionNode*>(*c);
- if ((func->status() > Node::Obsolete) &&
- !func->isInternal() &&
- (func->metaness() != FunctionNode::Ctor) &&
- (func->metaness() != FunctionNode::Dtor)) {
- funcIndex_[(*c)->name()].insert((*c)->parent()->fullDocumentName(), *c);
- }
- }
- }
- ++c;
- }
-}
-
-/*!
- Finds all the nodes containing legalese text and puts them
- in a map.
- */
-void QDocDatabase::findAllLegaleseTexts(InnerNode* node)
-{
- NodeList::ConstIterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private) {
- if (!(*c)->doc().legaleseText().isEmpty())
- legaleseTexts_.insertMulti((*c)->doc().legaleseText(), *c);
- if ((*c)->isInnerNode())
- findAllLegaleseTexts(static_cast<InnerNode *>(*c));
- }
- ++c;
- }
-}
-
-/*!
- Finds all the namespace nodes and puts them in an index.
- */
-void QDocDatabase::findAllNamespaces(InnerNode* node)
-{
- NodeList::ConstIterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private || (*c)->isNamespace()) {
- if ((*c)->isInnerNode()) {
- findAllNamespaces(static_cast<InnerNode *>(*c));
- if ((*c)->isNamespace()) {
- // Ensure that the namespace's name is not empty (the root
- // namespace has no name).
- if (!(*c)->name().isEmpty()) {
- nmm_.insert((*c)->name(), *c);
- }
- }
- }
- }
- ++c;
- }
-}
-
-/*!
- Finds all nodes with status = Obsolete and sorts them into
- maps. They can be C++ classes, QML types, or they can be
- functions, enum types, typedefs, methods, etc.
- */
-void QDocDatabase::findAllObsoleteThings(InnerNode* node)
-{
- NodeList::const_iterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->access() != Node::Private) {
- QString name = (*c)->name();
- if ((*c)->status() == Node::Obsolete) {
- if ((*c)->type() == Node::Class) {
- if ((*c)->parent() && (*c)->parent()->type() == Node::Namespace &&
- !(*c)->parent()->name().isEmpty())
- name = (*c)->parent()->name() + "::" + name;
- obsoleteClasses_.insert(name, *c);
- }
- else if ((*c)->isQmlType() || (*c)->isJsType()) {
- if (name.startsWith(QLatin1String("QML:")))
- name = name.mid(4);
- name = (*c)->logicalModuleName() + "::" + name;
- obsoleteQmlTypes_.insert(name,*c);
- }
- }
- else if ((*c)->type() == Node::Class) {
- InnerNode* n = static_cast<InnerNode*>(*c);
- bool inserted = false;
- NodeList::const_iterator p = n->childNodes().constBegin();
- while (p != n->childNodes().constEnd()) {
- if ((*p)->access() != Node::Private) {
- switch ((*p)->type()) {
- case Node::Enum:
- case Node::Typedef:
- case Node::Function:
- case Node::Property:
- case Node::Variable:
- if ((*p)->status() == Node::Obsolete) {
- if ((*c)->parent() && (*c)->parent()->type() == Node::Namespace &&
- !(*c)->parent()->name().isEmpty())
- name = (*c)->parent()->name() + "::" + name;
- classesWithObsoleteMembers_.insert(name, *c);
- inserted = true;
- }
- break;
- default:
- break;
- }
- }
- if (inserted)
- break;
- ++p;
- }
- }
- else if ((*c)->isQmlType() || (*c)->isJsType()) {
- InnerNode* n = static_cast<InnerNode*>(*c);
- bool inserted = false;
- NodeList::const_iterator p = n->childNodes().constBegin();
- while (p != n->childNodes().constEnd()) {
- if ((*p)->access() != Node::Private) {
- switch ((*c)->type()) {
- case Node::QmlProperty:
- case Node::QmlSignal:
- case Node::QmlSignalHandler:
- case Node::QmlMethod:
- if ((*c)->parent()) {
- Node* parent = (*c)->parent();
- if ((parent->isQmlPropertyGroup() ||
- parent->isJsPropertyGroup()) && parent->parent())
- parent = parent->parent();
- if (parent && (parent->isQmlType() || parent->isJsType()) &&
- !parent->name().isEmpty())
- name = parent->name() + "::" + name;
- }
- qmlTypesWithObsoleteMembers_.insert(name,*c);
- inserted = true;
- break;
- default:
- break;
- }
- }
- if (inserted)
- break;
- ++p;
- }
- }
- else if ((*c)->isInnerNode()) {
- findAllObsoleteThings(static_cast<InnerNode*>(*c));
- }
- }
- ++c;
- }
-}
-
-/*!
- Finds all the nodes where a \e{since} command appeared in the
- qdoc comment and sorts them into maps according to the kind of
- node.
-
- This function is used for generating the "New Classes... in x.y"
- section on the \e{What's New in Qt x.y} page.
- */
-void QDocDatabase::findAllSince(InnerNode* node)
-{
- NodeList::const_iterator child = node->childNodes().constBegin();
- while (child != node->childNodes().constEnd()) {
- QString sinceString = (*child)->since();
- // Insert a new entry into each map for each new since string found.
- if (((*child)->access() != Node::Private) && !sinceString.isEmpty()) {
- NodeMultiMapMap::iterator nsmap = newSinceMaps_.find(sinceString);
- if (nsmap == newSinceMaps_.end())
- nsmap = newSinceMaps_.insert(sinceString,NodeMultiMap());
-
- NodeMapMap::iterator ncmap = newClassMaps_.find(sinceString);
- if (ncmap == newClassMaps_.end())
- ncmap = newClassMaps_.insert(sinceString,NodeMap());
-
- NodeMapMap::iterator nqcmap = newQmlTypeMaps_.find(sinceString);
- if (nqcmap == newQmlTypeMaps_.end())
- nqcmap = newQmlTypeMaps_.insert(sinceString,NodeMap());
-
- if ((*child)->type() == Node::Function) {
- // Insert functions into the general since map.
- FunctionNode *func = static_cast<FunctionNode *>(*child);
- if ((func->status() > Node::Obsolete) &&
- (func->metaness() != FunctionNode::Ctor) &&
- (func->metaness() != FunctionNode::Dtor)) {
- nsmap.value().insert(func->name(),(*child));
- }
- }
- else {
- if ((*child)->type() == Node::Class) {
- // Insert classes into the since and class maps.
- QString className = (*child)->name();
- if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
- className = (*child)->parent()->name()+"::"+className;
- }
- nsmap.value().insert(className,(*child));
- ncmap.value().insert(className,(*child));
- }
- else if ((*child)->isQmlType() || (*child)->isJsType()) {
- // Insert QML elements into the since and element maps.
- QString className = (*child)->name();
- if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
- className = (*child)->parent()->name()+"::"+className;
- }
- nsmap.value().insert(className,(*child));
- nqcmap.value().insert(className,(*child));
- }
- else if ((*child)->isQmlProperty() || (*child)->isJsProperty()) {
- // Insert QML properties into the since map.
- QString propertyName = (*child)->name();
- nsmap.value().insert(propertyName,(*child));
- }
- else {
- // Insert external documents into the general since map.
- QString name = (*child)->name();
- if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
- name = (*child)->parent()->name()+"::"+name;
- }
- nsmap.value().insert(name,(*child));
- }
- }
- }
- // Recursively find child nodes with since commands.
- if ((*child)->isInnerNode())
- findAllSince(static_cast<InnerNode *>(*child));
-
- ++child;
- }
-}
-
-/*!
- Find the \a key in the map of new class maps, and return a
- reference to the value, which is a NodeMap. If \a key is not
- found, return a reference to an empty NodeMap.
- */
-const NodeMap& QDocDatabase::getClassMap(const QString& key)
-{
- if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
- processForest(&QDocDatabase::findAllSince);
- NodeMapMap::const_iterator i = newClassMaps_.constFind(key);
- if (i != newClassMaps_.constEnd())
- return i.value();
- return emptyNodeMap_;
-}
-
-/*!
- Find the \a key in the map of new QML type maps, and return a
- reference to the value, which is a NodeMap. If the \a key is not
- found, return a reference to an empty NodeMap.
- */
-const NodeMap& QDocDatabase::getQmlTypeMap(const QString& key)
-{
- if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
- processForest(&QDocDatabase::findAllSince);
- NodeMapMap::const_iterator i = newQmlTypeMaps_.constFind(key);
- if (i != newQmlTypeMaps_.constEnd())
- return i.value();
- return emptyNodeMap_;
-}
-
-/*!
- Find the \a key in the map of new \e {since} maps, and return
- a reference to the value, which is a NodeMultiMap. If \a key
- is not found, return a reference to an empty NodeMultiMap.
- */
-const NodeMap& QDocDatabase::getSinceMap(const QString& key)
-{
- if (newSinceMaps_.isEmpty() && newClassMaps_.isEmpty() && newQmlTypeMaps_.isEmpty())
- processForest(&QDocDatabase::findAllSince);
- NodeMultiMapMap::const_iterator i = newSinceMaps_.constFind(key);
- if (i != newSinceMaps_.constEnd())
- return i.value();
- return emptyNodeMultiMap_;
-}
-
-/*!
- Performs several housekeeping algorithms that create
- certain data structures and resolve lots of links, prior
- to generating documentation.
- */
-void QDocDatabase::resolveIssues() {
- resolveQmlInheritance(primaryTreeRoot());
- primaryTree()->resolveTargets(primaryTreeRoot());
- primaryTree()->resolveCppToQmlLinks();
-}
-
-void QDocDatabase::resolveStuff()
-{
- primaryTree()->resolveInheritance();
- resolveQmlInheritance(primaryTreeRoot());
- //primaryTree()->resolveTargets(primaryTreeRoot());
- primaryTree()->resolveCppToQmlLinks();
- primaryTree()->resolveUsingClauses();
- resolveNamespaces();
-}
-
-/*!
- */
-void QDocDatabase::resolveNamespaces()
-{
- if (!namespaceIndex_.isEmpty())
- return;
- Tree* t = forest_.firstTree();
- while (t) {
- findAllNamespaces(t->root());
- t = forest_.nextTree();
- }
- QList<QString> keys = nmm_.uniqueKeys();
- foreach (QString s, keys) {
- NamespaceNode* ns = 0;
- QList<Node*> nodes = nmm_.values(s);
- int count = nmm_.remove(s);
- if (count > 1) {
- foreach (Node* n, nodes) {
- if (n->isNamespace() && n->wasSeen()) {
- ns = static_cast<NamespaceNode*>(n);
- break;
- }
- }
- }
- else if (count == 1)
- ns = static_cast<NamespaceNode*>(nodes.at(0));
- if (ns && ns->wasSeen()) {
- if (count >1) {
- foreach (Node* n, nodes) {
- if (n->isNamespace()) {
- NamespaceNode* NS = static_cast<NamespaceNode*>(n);
- if ((NS != ns) && !NS->childNodes().isEmpty()) {
- const NodeList& children = NS->childNodes();
- int i = children.size() - 1;
- while (i >= 0) {
- Node* child = children.at(i--);
- if (!child)
- continue;
- if (!child->isClass()
- && !child->isQmlType()
- && !child->isNamespace()) {
- NS->removeChild(child);
- ns->addChild(child);
- }
- else {
- NS->setStatus(Node::Intermediate);
- NS->setAccess(Node::Public);
- ns->addOrphan(child);
- }
- }
- }
- }
- }
- }
- namespaceIndex_.insert(ns->name(), ns);
- }
- }
-}
-
-
-/*!
- This function is called for autolinking to a \a type,
- which could be a function return type or a parameter
- type. The tree node that represents the \a type is
- returned. All the trees are searched until a match is
- found. When searching the primary tree, the search
- begins at \a relative and proceeds up the parent chain.
- When searching the index trees, the search begins at the
- root.
- */
-const Node* QDocDatabase::findTypeNode(const QString& type, const Node* relative)
-{
- QStringList path = type.split("::");
- if ((path.size() == 1) && (path.at(0)[0].isLower() || path.at(0) == QString("T"))) {
- NodeMap::iterator i = typeNodeMap_.find(path.at(0));
- if (i != typeNodeMap_.end())
- return i.value();
- }
- return forest_.findTypeNode(path, relative);
-}
-
-/*!
- Finds the node that will generate the documentation that
- contains the \a target and returns a pointer to it.
-
- Can this be improved by using the target map in Tree?
- */
-const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* relative)
-{
- const Node* node = 0;
- if (target.isEmpty())
- node = relative;
- else if (target.endsWith(".html"))
- node = findNodeByNameAndType(QStringList(target), Node::Document);
- else {
- QStringList path = target.split("::");
- int flags = SearchBaseClasses | SearchEnumValues; // | NonFunction;
- foreach (Tree* t, searchOrder()) {
- const Node* n = t->findNode(path, relative, flags, Node::DontCare);
- if (n)
- return n;
- relative = 0;
- }
- node = findDocumentNodeByTitle(target);
- }
- return node;
-}
-
-/*!
- For each QML Type node in the tree beginning at \a root,
- if it has a QML base type name but its QML base type node
- pointer is 0, use the QML base type name to look up the
- base type node. If the node is found in the tree, set the
- node's QML base type node pointer.
- */
-void QDocDatabase::resolveQmlInheritance(InnerNode* root)
-{
- NodeMap previousSearches;
- // Do we need recursion?
- foreach (Node* child, root->childNodes()) {
- if (child->isQmlType() || child->isJsType()) {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
- if (qcn->qmlBaseNodeNotSet() && !qcn->qmlBaseName().isEmpty()) {
- QmlTypeNode* bqcn = static_cast<QmlTypeNode*>(previousSearches.value(qcn->qmlBaseName()));
- if (bqcn)
- qcn->setQmlBaseNode(bqcn);
- else {
- if (!qcn->importList().isEmpty()) {
- const ImportList& imports = qcn->importList();
- for (int i=0; i<imports.size(); ++i) {
- bqcn = findQmlType(imports[i], qcn->qmlBaseName());
- if (bqcn)
- break;
- }
- }
- if (bqcn == 0) {
- bqcn = findQmlType(QString(), qcn->qmlBaseName());
- }
- if (bqcn) {
- qcn->setQmlBaseNode(bqcn);
- previousSearches.insert(qcn->qmlBaseName(), bqcn);
- }
-#if 0
- else {
- qDebug() << "Temporary error message (ignore): UNABLE to resolve QML base type:"
- << qcn->qmlBaseName() << "for QML type:" << qcn->name();
- }
-#endif
- }
- }
- }
- }
-}
-
-/*!
- Generates a tag file and writes it to \a name.
- */
-void QDocDatabase::generateTagFile(const QString& name, Generator* g)
-{
- if (!name.isEmpty()) {
- QDocTagFiles::qdocTagFiles()->generateTagFile(name, g);
- QDocTagFiles::destroyQDocTagFiles();
- }
-}
-
-/*!
- Reads and parses the qdoc index files listed in \a t.
- */
-void QDocDatabase::readIndexes(const QStringList& t)
-{
- QStringList indexFiles;
- foreach (const QString& f, t) {
- QString fn = f.mid(f.lastIndexOf(QChar('/'))+1);
- if (!isLoaded(fn))
- indexFiles << f;
- else
- qDebug() << "This index file is already in memory:" << f;
- }
- QDocIndexFiles::qdocIndexFiles()->readIndexes(indexFiles);
- QDocIndexFiles::destroyQDocIndexFiles();
-}
-
-/*!
- Generates a qdoc index file and write it to \a fileName. The
- index file is generated with the parameters \a url, \a title,
- \a g, and \a generateInternalNodes.
- */
-void QDocDatabase::generateIndex(const QString& fileName,
- const QString& url,
- const QString& title,
- Generator* g,
- bool generateInternalNodes)
-{
- QString t = fileName.mid(fileName.lastIndexOf(QChar('/'))+1);
- primaryTree()->setIndexFileName(t);
- QDocIndexFiles::qdocIndexFiles()->generateIndex(fileName, url, title, g, generateInternalNodes);
- QDocIndexFiles::destroyQDocIndexFiles();
-}
-
-/*!
- If there are open namespaces, search for the function node
- having the same function name as the \a clone node in each
- open namespace. The \a parentPath is a portion of the path
- name provided with the function name at the point of
- reference. \a parentPath is usually a class name. Return
- the pointer to the function node if one is found in an
- open namespace. Otherwise return 0.
-
- This open namespace concept is of dubious value and might
- be removed.
- */
-FunctionNode* QDocDatabase::findNodeInOpenNamespace(const QStringList& parentPath,
- const FunctionNode* clone)
-{
- FunctionNode* fn = 0;
- if (!openNamespaces_.isEmpty()) {
- foreach (const QString& t, openNamespaces_) {
- QStringList path = t.split("::") + parentPath;
- fn = findFunctionNode(path, clone);
- if (fn)
- break;
- }
- }
- return fn;
-}
-
-/*!
- Find a node of the specified \a type that is reached with
- the specified \a path qualified with the name of one of the
- open namespaces (might not be any open ones). If the node
- is found in an open namespace, prefix \a path with the name
- of the open namespace and "::" and return a pointer to the
- node. Othewrwise return 0.
-
- This function only searches in the current primary tree.
- */
-Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, Node::Type type)
-{
- if (path.isEmpty())
- return 0;
- Node* n = 0;
- if (!openNamespaces_.isEmpty()) {
- foreach (const QString& t, openNamespaces_) {
- QStringList p;
- if (t != path[0])
- p = t.split("::") + path;
- else
- p = path;
- n = primaryTree()->findNodeByNameAndType(p, type);
- if (n) {
- path = p;
- break;
- }
- }
- }
- return n;
-}
-
-/*!
- Finds all the collection nodes of the specified \a genus
- into the collection node map \a cnm. Nodes that match the
- \a relative node are not included.
- */
-void QDocDatabase::mergeCollections(Node::Genus genus, CNMap& cnm, const Node* relative)
-{
- cnm.clear();
- CNMultiMap cnmm;
- foreach (Tree* t, searchOrder()) {
- CNMap* m = t->getCollectionMap(genus);
- if (m && !m->isEmpty()) {
- CNMap::const_iterator i = m->cbegin();
- while (i != m->cend()) {
- if (!i.value()->isInternal())
- cnmm.insert(i.key(), i.value());
- ++i;
- }
- }
- }
- if (cnmm.isEmpty())
- return;
- QRegExp singleDigit("\\b([0-9])\\b");
- QStringList keys = cnmm.uniqueKeys();
- foreach (const QString &key, keys) {
- QList<CollectionNode*> values = cnmm.values(key);
- CollectionNode* n = 0;
- foreach (CollectionNode* v, values) {
- if (v && v->wasSeen() && (v != relative)) {
- n = v;
- break;
- }
- }
- if (n) {
- if (values.size() > 1) {
- foreach (CollectionNode* v, values) {
- if (v != n) {
- foreach (Node* t, v->members())
- n->addMember(t);
- }
- }
- }
- if (!n->members().isEmpty()) {
- QString sortKey = n->fullTitle().toLower();
- if (sortKey.startsWith("the "))
- sortKey.remove(0, 4);
- sortKey.replace(singleDigit, "0\\1");
- cnm.insert(sortKey, n);
- }
- }
- }
-}
-
-/*!
- Finds all the collection nodes with the same name
- and genus as \a c and merges their members into the
- members list of \a c.
- */
-void QDocDatabase::mergeCollections(CollectionNode* c)
-{
- foreach (Tree* t, searchOrder()) {
- CollectionNode* cn = t->getCollection(c->name(), c->genus());
- if (cn && cn != c) {
- foreach (Node* n, cn->members())
- c->addMember(n);
- }
- }
-}
-
-/*!
- Searches for the node that matches the path in \a atom. The
- \a relative node is used if the first leg of the path is
- empty, i.e. if the path begins with a hashtag. The function
- also sets \a ref if there remains an unused leg in the path
- after the node is found. The node is returned as well as the
- \a ref. If the returned node pointer is null, \a ref is not
- valid.
- */
-const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, QString& ref)
-{
- const Node* node = 0;
-
- Atom* atom = const_cast<Atom*>(a);
- QStringList targetPath = atom->string().split("#");
- QString first = targetPath.first().trimmed();
-
- Tree* domain = 0;
- Node::Genus genus = Node::DontCare;
- // Reserved for future use
- //Node::Type goal = Node::NoType;
-
- if (atom->isLinkAtom()) {
- domain = atom->domain();
- genus = atom->genus();
- // Reserved for future use
- //goal = atom->goal();
- }
-
- if (first.isEmpty())
- node = relative; // search for a target on the current page.
- else if (domain) {
- if (first.endsWith(".html"))
- node = domain->findNodeByNameAndType(QStringList(first), Node::Document);
- else if (first.endsWith("()"))
- node = domain->findFunctionNode(first, 0, genus);
- else {
- int flags = SearchBaseClasses | SearchEnumValues;
- QStringList nodePath = first.split("::");
- QString target;
- targetPath.removeFirst();
- if (!targetPath.isEmpty()) {
- target = targetPath.at(0);
- targetPath.removeFirst();
- }
- if (relative && relative->tree()->physicalModuleName() != domain->physicalModuleName())
- relative = 0;
- node = domain->findNodeForTarget(nodePath, target, relative, flags, genus, ref);
- return node;
- }
- }
- else {
- if (first.endsWith(".html")) {
- node = findNodeByNameAndType(QStringList(first), Node::Document);
- // the path may also refer to an example file with .html extension
- if (!node && first.contains("/"))
- return findNodeForTarget(targetPath, relative, genus, ref);
- }
- else if (first.endsWith("()"))
- node = findFunctionNode(first, relative, genus);
- else {
- node = findNodeForTarget(targetPath, relative, genus, ref);
- return node;
- }
- }
-
- if (node && ref.isEmpty()) {
- if (!node->url().isEmpty())
- return node;
- targetPath.removeFirst();
- if (!targetPath.isEmpty()) {
- ref = node->root()->tree()->getRef(targetPath.first(), node);
- if (ref.isEmpty())
- node = 0;
- }
- }
- return node;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
deleted file mode 100644
index b8ca8bc32d..0000000000
--- a/src/tools/qdoc/qdocdatabase.h
+++ /dev/null
@@ -1,457 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 QDOCDATABASE_H
-#define QDOCDATABASE_H
-
-#include <qstring.h>
-#include <qmap.h>
-#include "tree.h"
-#include "config.h"
-#include "text.h"
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-typedef QMap<QString, NodeMap> NodeMapMap;
-typedef QMap<QString, NodeMultiMap> NodeMultiMapMap;
-typedef QMultiMap<QString, Node*> QDocMultiMap;
-typedef QMap<Text, const Node*> TextToNodeMap;
-typedef QList<CollectionNode*> CollectionList;
-
-class Atom;
-class Generator;
-class QDocDatabase;
-
-enum FindFlag {
- SearchBaseClasses = 0x1,
- SearchEnumValues = 0x2,
- NonFunction = 0x4
-};
-
-class QDocForest
-{
- public:
- friend class QDocDatabase;
- QDocForest(QDocDatabase* qdb)
- : qdb_(qdb), primaryTree_(0), currentIndex_(0) { }
- ~QDocForest();
-
- NamespaceNode* firstRoot();
- NamespaceNode* nextRoot();
- Tree* firstTree();
- Tree* nextTree();
- Tree* primaryTree() { return primaryTree_; }
- Tree* findTree(const QString& t) { return forest_.value(t); }
- QStringList keys() {
- return forest_.keys();
- }
- NamespaceNode* primaryTreeRoot() { return (primaryTree_ ? primaryTree_->root() : 0); }
- bool isEmpty() { return searchOrder().isEmpty(); }
- bool done() { return (currentIndex_ >= searchOrder().size()); }
- const QVector<Tree*>& searchOrder();
- const QVector<Tree*>& indexSearchOrder();
- void setSearchOrder(QStringList& t);
- bool isLoaded(const QString& fn) {
- foreach (Tree* t, searchOrder()) {
- if (fn == t->indexFileName())
- return true;
- }
- return false;
- }
-
- const Node* findNode(const QStringList& path,
- const Node* relative,
- int findFlags,
- Node::Genus genus) {
- foreach (Tree* t, searchOrder()) {
- const Node* n = t->findNode(path, relative, findFlags, genus);
- if (n)
- return n;
- relative = 0;
- }
- return 0;
- }
-
- Node* findNodeByNameAndType(const QStringList& path, Node::Type type) {
- foreach (Tree* t, searchOrder()) {
- Node* n = t->findNodeByNameAndType(path, type);
- if (n)
- return n;
- }
- return 0;
- }
-
- ClassNode* findClassNode(const QStringList& path) {
- foreach (Tree* t, searchOrder()) {
- ClassNode* n = t->findClassNode(path);
- if (n)
- return n;
- }
- return 0;
- }
-
- Node* findNodeForInclude(const QStringList& path) {
- foreach (Tree* t, searchOrder()) {
- Node* n = t->findNodeForInclude(path);
- if (n)
- return n;
- }
- return 0;
- }
-
- InnerNode* findRelatesNode(const QStringList& path) {
- foreach (Tree* t, searchOrder()) {
- InnerNode* n = t->findRelatesNode(path);
- if (n)
- return n;
- }
- return 0;
- }
-
- const Node* findFunctionNode(const QString& target,
- const Node* relative,
- Node::Genus genus) {
- foreach (Tree* t, searchOrder()) {
- const Node* n = t->findFunctionNode(target, relative, genus);
- if (n)
- return n;
- relative = 0;
- }
- return 0;
- }
- const Node* findNodeForTarget(QStringList& targetPath,
- const Node* relative,
- Node::Genus genus,
- QString& ref);
-
- const Node* findTypeNode(const QStringList& path, const Node* relative)
- {
- foreach (Tree* t, searchOrder()) {
- int flags = SearchBaseClasses | SearchEnumValues | NonFunction;
- const Node* n = t->findNode(path, relative, flags, Node::DontCare);
- if (n)
- return n;
- relative = 0;
- }
- return 0;
- }
-
- const DocumentNode* findDocumentNodeByTitle(const QString& title)
- {
- foreach (Tree* t, searchOrder()) {
- const DocumentNode* n = t->findDocumentNodeByTitle(title);
- if (n)
- return n;
- }
- return 0;
- }
-
- QmlTypeNode* lookupQmlType(const QString& name)
- {
- foreach (Tree* t, searchOrder()) {
- QmlTypeNode* qcn = t->lookupQmlType(name);
- if (qcn)
- return qcn;
- }
- return 0;
- }
- void clearSearchOrder() { searchOrder_.clear(); }
- void clearLinkCounts()
- {
- foreach (Tree* t, searchOrder())
- t->clearLinkCount();
- }
- void printLinkCounts(const QString& project);
- QString getLinkCounts(QStringList& strings, QVector<int>& counts);
-
- private:
- void newPrimaryTree(const QString& module);
- void setPrimaryTree(const QString& t);
- NamespaceNode* newIndexTree(const QString& module);
-
- private:
- QDocDatabase* qdb_;
- Tree* primaryTree_;
- int currentIndex_;
- QMap<QString, Tree*> forest_;
- QVector<Tree*> searchOrder_;
- QVector<Tree*> indexSearchOrder_;
- QVector<QString> moduleNames_;
-};
-
-class QDocDatabase
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::QDocDatabase)
-
- public:
- static QDocDatabase* qdocDB();
- static void destroyQdocDB();
- ~QDocDatabase();
-
- Tree* findTree(const QString& t) { return forest_.findTree(t); }
-
- CollectionNode* getCollection(const QString& name, Node::Genus genus) {
- return primaryTree()->getCollection(name, genus);
- }
- const CNMap& groups() { return primaryTree()->groups(); }
- const CNMap& modules() { return primaryTree()->modules(); }
- const CNMap& qmlModules() { return primaryTree()->qmlModules(); }
- const CNMap& jsModules() { return primaryTree()->jsModules(); }
-
- CollectionNode* findGroup(const QString& name) { return primaryTree()->findGroup(name); }
- CollectionNode* findModule(const QString& name) { return primaryTree()->findModule(name); }
- CollectionNode* findQmlModule(const QString& name) { return primaryTree()->findQmlModule(name); }
- CollectionNode* findJsModule(const QString& name) { return primaryTree()->findJsModule(name); }
-
- CollectionNode* addGroup(const QString& name) { return primaryTree()->addGroup(name); }
- CollectionNode* addModule(const QString& name) { return primaryTree()->addModule(name); }
- CollectionNode* addQmlModule(const QString& name) { return primaryTree()->addQmlModule(name); }
- CollectionNode* addJsModule(const QString& name) { return primaryTree()->addJsModule(name); }
-
- CollectionNode* addToGroup(const QString& name, Node* node) {
- return primaryTree()->addToGroup(name, node);
- }
- CollectionNode* addToModule(const QString& name, Node* node) {
- return primaryTree()->addToModule(name, node);
- }
- CollectionNode* addToQmlModule(const QString& name, Node* node) {
- return primaryTree()->addToQmlModule(name, node);
- }
- CollectionNode* addToJsModule(const QString& name, Node* node) {
- return primaryTree()->addToJsModule(name, node);
- }
-
- void addExampleNode(ExampleNode* n) { primaryTree()->addExampleNode(n); }
- ExampleNodeMap& exampleNodeMap() { return primaryTree()->exampleNodeMap(); }
-
- QmlTypeNode* findQmlType(const QString& name);
- QmlTypeNode* findQmlType(const QString& qmid, const QString& name);
- QmlTypeNode* findQmlType(const ImportRec& import, const QString& name);
-
- private:
- void findAllClasses(InnerNode *node);
- void findAllFunctions(InnerNode *node);
- void findAllLegaleseTexts(InnerNode *node);
- void findAllNamespaces(InnerNode *node);
- void findAllObsoleteThings(InnerNode* node);
- void findAllSince(InnerNode *node);
-
- public:
- /*******************************************************************
- special collection access functions
- ********************************************************************/
- NodeMultiMap& getCppClasses();
- NodeMultiMap& getObsoleteClasses();
- NodeMultiMap& getClassesWithObsoleteMembers();
- NodeMultiMap& getObsoleteQmlTypes();
- NodeMultiMap& getQmlTypesWithObsoleteMembers();
- NodeMultiMap& getNamespaces() { resolveNamespaces(); return namespaceIndex_; }
- NodeMultiMap& getQmlBasicTypes();
- NodeMultiMap& getQmlTypes();
- NodeMapMap& getFunctionIndex();
- TextToNodeMap& getLegaleseTexts();
- const NodeMap& getClassMap(const QString& key);
- const NodeMap& getQmlTypeMap(const QString& key);
- const NodeMap& getSinceMap(const QString& key);
-
- /*******************************************************************
- Many of these will be either eliminated or replaced.
- ********************************************************************/
- void resolveInheritance() { primaryTree()->resolveInheritance(); }
- void resolveQmlInheritance(InnerNode* root);
- void resolveIssues();
- void resolveStuff();
- void fixInheritance() { primaryTree()->fixInheritance(); }
- void resolveProperties() { primaryTree()->resolveProperties(); }
-
- void insertTarget(const QString& name,
- const QString& title,
- TargetRec::Type type,
- Node* node,
- int priority) {
- primaryTree()->insertTarget(name, title, type, node, priority);
- }
-
- /*******************************************************************
- The functions declared below are called for the current tree only.
- ********************************************************************/
- FunctionNode* findFunctionNode(const QStringList& parentPath, const FunctionNode* clone) {
- return primaryTree()->findFunctionNode(parentPath, clone);
- }
- FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone);
- Node* findNodeInOpenNamespace(QStringList& path, Node::Type type);
- const Node* checkForCollision(const QString& name) {
- return primaryTree()->checkForCollision(name);
- }
- /*******************************************************************/
-
- /*******************************************************************
- The functions declared below handle the parameters in '[' ']'.
- ********************************************************************/
- const Node* findNodeForAtom(const Atom* atom, const Node* relative, QString& ref);
- /*******************************************************************/
-
- /*******************************************************************
- The functions declared below are called for all trees.
- ********************************************************************/
- ClassNode* findClassNode(const QStringList& path) { return forest_.findClassNode(path); }
- Node* findNodeForInclude(const QStringList& path) { return forest_.findNodeForInclude(path); }
- InnerNode* findRelatesNode(const QStringList& path) { return forest_.findRelatesNode(path); }
- const Node* findFunctionNode(const QString& target, const Node* relative, Node::Genus genus) {
- return forest_.findFunctionNode(target, relative, genus);
- }
- const Node* findTypeNode(const QString& type, const Node* relative);
- const Node* findNodeForTarget(const QString& target, const Node* relative);
- const DocumentNode* findDocumentNodeByTitle(const QString& title) {
- return forest_.findDocumentNodeByTitle(title);
- }
- Node* findNodeByNameAndType(const QStringList& path, Node::Type type) {
- return forest_.findNodeByNameAndType(path, type);
- }
-
- private:
- const Node* findNodeForTarget(QStringList& targetPath,
- const Node* relative,
- Node::Genus genus,
- QString& ref) {
- return forest_.findNodeForTarget(targetPath, relative, genus, ref);
- }
-
- /*******************************************************************/
- public:
- void addPropertyFunction(PropertyNode* property,
- const QString& funcName,
- PropertyNode::FunctionRole funcRole) {
- primaryTree()->addPropertyFunction(property, funcName, funcRole);
- }
-
- void setVersion(const QString& v) { version_ = v; }
- QString version() const { return version_; }
-
- void generateTagFile(const QString& name, Generator* g);
- void readIndexes(const QStringList& indexFiles);
- void generateIndex(const QString& fileName,
- const QString& url,
- const QString& title,
- Generator* g,
- bool generateInternalNodes = false);
-
- void clearOpenNamespaces() { openNamespaces_.clear(); }
- void insertOpenNamespace(const QString& path) { openNamespaces_.insert(path); }
- void setShowInternal(bool value) { showInternal_ = value; }
- void setSingleExec(bool value) { singleExec_ = value; }
- void processForest();
-
- // Try to make this function private.
- QDocForest& forest() { return forest_; }
- NamespaceNode* primaryTreeRoot() { return forest_.primaryTreeRoot(); }
- void newPrimaryTree(const QString& module) { forest_.newPrimaryTree(module); }
- void setPrimaryTree(const QString& t) { forest_.setPrimaryTree(t); }
- NamespaceNode* newIndexTree(const QString& module) { return forest_.newIndexTree(module); }
- const QVector<Tree*>& searchOrder() { return forest_.searchOrder(); }
- void setLocalSearch() { forest_.searchOrder_ = QVector<Tree*>(1, primaryTree()); }
- void setSearchOrder(const QVector<Tree*>& searchOrder) { forest_.searchOrder_ = searchOrder; }
- void setSearchOrder(QStringList& t) { forest_.setSearchOrder(t); }
- void mergeCollections(Node::Genus genus, CNMap& cnm, const Node* relative);
- void mergeCollections(CollectionNode* c);
- void clearSearchOrder() { forest_.clearSearchOrder(); }
- void incrementLinkCount(const Node* t) { t->tree()->incrementLinkCount(); }
- void clearLinkCounts() { forest_.clearLinkCounts(); }
- void printLinkCounts(const QString& t) { forest_.printLinkCounts(t); }
- QString getLinkCounts(QStringList& strings, QVector<int>& counts) {
- return forest_.getLinkCounts(strings, counts);
- }
- QString getNewLinkTarget(const Node* locNode,
- const Node* t,
- const QString& fileName,
- QString& text,
- bool broken = false) {
- return primaryTree()->getNewLinkTarget(locNode, t, fileName, text, broken);
- }
- TargetList* getTargetList(const QString& t) { return primaryTree()->getTargetList(t); }
- QStringList getTargetListKeys() { return primaryTree()->getTargetListKeys(); }
- QStringList keys() { return forest_.keys(); }
- void resolveNamespaces();
-
- private:
- friend class QDocIndexFiles;
- friend class QDocTagFiles;
-
- const Node* findNode(const QStringList& path,
- const Node* relative,
- int findFlags,
- Node::Genus genus) {
- return forest_.findNode(path, relative, findFlags, genus);
- }
- void processForest(void (QDocDatabase::*) (InnerNode*));
- bool isLoaded(const QString& t) { return forest_.isLoaded(t); }
- static void initializeDB();
-
- private:
- QDocDatabase();
- QDocDatabase(QDocDatabase const& ) : showInternal_(false), forest_(this) { }
- QDocDatabase& operator=(QDocDatabase const& );
- Tree* primaryTree() { return forest_.primaryTree(); }
-
- public:
- static bool debug;
-
- private:
- static QDocDatabase* qdocDB_;
- static NodeMap typeNodeMap_;
- bool showInternal_;
- bool singleExec_;
- QString version_;
- QDocForest forest_;
-
- NodeMultiMap cppClasses_;
- NodeMultiMap obsoleteClasses_;
- NodeMultiMap classesWithObsoleteMembers_;
- NodeMultiMap obsoleteQmlTypes_;
- NodeMultiMap qmlTypesWithObsoleteMembers_;
- NodeMultiMap namespaceIndex_;
- NodeMultiMap nmm_;
- NodeMultiMap qmlBasicTypes_;
- NodeMultiMap qmlTypes_;
- NodeMapMap newClassMaps_;
- NodeMapMap newQmlTypeMaps_;
- NodeMultiMapMap newSinceMaps_;
- NodeMapMap funcIndex_;
- TextToNodeMap legaleseTexts_;
- QSet<QString> openNamespaces_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
deleted file mode 100644
index 226280132f..0000000000
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ /dev/null
@@ -1,1561 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "qdom.h"
-#include "qxmlstream.h"
-#include "qdocindexfiles.h"
-#include "qdoctagfiles.h"
-#include "config.h"
-#include "qdocdatabase.h"
-#include "location.h"
-#include "atom.h"
-#include "generator.h"
-#include <qdebug.h>
-
-#include <algorithm>
-
-QT_BEGIN_NAMESPACE
-
-static Node* top = 0;
-
-/*!
- \class QDocIndexFiles
-
- This class handles qdoc index files.
- */
-
-QDocIndexFiles* QDocIndexFiles::qdocIndexFiles_ = NULL;
-
-/*!
- Constructs the singleton QDocIndexFiles.
- */
-QDocIndexFiles::QDocIndexFiles()
- : gen_( 0 )
-{
- qdb_ = QDocDatabase::qdocDB();
-}
-
-/*!
- Destroys the singleton QDocIndexFiles.
- */
-QDocIndexFiles::~QDocIndexFiles()
-{
- qdb_ = 0;
- gen_ = 0;
-}
-
-/*!
- Creates the singleton. Allows only one instance of the class
- to be created. Returns a pointer to the singleton.
- */
-QDocIndexFiles* QDocIndexFiles::qdocIndexFiles()
-{
- if (!qdocIndexFiles_)
- qdocIndexFiles_ = new QDocIndexFiles;
- return qdocIndexFiles_;
-}
-
-/*!
- Destroys the singleton.
- */
-void QDocIndexFiles::destroyQDocIndexFiles()
-{
- if (qdocIndexFiles_) {
- delete qdocIndexFiles_;
- qdocIndexFiles_ = 0;
- }
-}
-
-/*!
- Reads and parses the list of index files in \a indexFiles.
- */
-void QDocIndexFiles::readIndexes(const QStringList& indexFiles)
-{
- foreach (const QString& indexFile, indexFiles) {
- QString msg = "Loading index file: " + indexFile;
- Location::logToStdErr(msg);
- //qDebug() << msg;
- readIndexFile(indexFile);
- }
-}
-
-static bool readingRoot = true;
-
-/*!
- Reads and parses the index file at \a path.
- */
-void QDocIndexFiles::readIndexFile(const QString& path)
-{
- QFile file(path);
- if (file.open(QFile::ReadOnly)) {
- QDomDocument document;
- document.setContent(&file);
- file.close();
-
- QDomElement indexElement = document.documentElement();
-
- // Generate a relative URL between the install dir and the index file
- // when the -installdir command line option is set.
- QString indexUrl;
- if (Config::installDir.isEmpty()) {
- indexUrl = indexElement.attribute("url", QString());
- }
- else {
- // Use a fake directory, since we will copy the output to a sub directory of
- // installDir when using "make install". This is just for a proper relative path.
- //QDir installDir(path.section('/', 0, -3) + "/outputdir");
- QDir installDir(path.section('/', 0, -3) + '/' + Generator::outputSubdir());
- indexUrl = installDir.relativeFilePath(path).section('/', 0, -2);
- }
- project_ = indexElement.attribute("project", QString());
-
- basesList_.clear();
- relatedList_.clear();
-
- readingRoot = true;
- NamespaceNode* root = qdb_->newIndexTree(project_);
-
- // Scan all elements in the XML file, constructing a map that contains
- // base classes for each class found.
- QDomElement child = indexElement.firstChildElement();
- while (!child.isNull()) {
- readIndexSection(child, root, indexUrl);
- child = child.nextSiblingElement();
- readingRoot = true;
- }
-
- // Now that all the base classes have been found for this index,
- // arrange them into an inheritance hierarchy.
- resolveIndex();
- }
-}
-
-/*!
- Read a <section> element from the index file and create the
- appropriate node(s).
- */
-void QDocIndexFiles::readIndexSection(const QDomElement& element,
- Node* current,
- const QString& indexUrl)
-{
- QString name = element.attribute("name");
- QString href = element.attribute("href");
- Node* node;
- Location location;
- InnerNode* parent = 0;
- if (current->isInnerNode())
- parent = static_cast<InnerNode*>(current);
-
- QString filePath;
- int lineNo = 0;
- if (element.hasAttribute("filepath")) {
- filePath = element.attribute("filepath", QString());
- lineNo = element.attribute("lineno", QString()).toInt();
- }
- if (element.nodeName() == "namespace") {
- node = new NamespaceNode(parent, name);
-
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name.toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(name.toLower() + ".html");
-
- }
- else if (element.nodeName() == "class") {
- node = new ClassNode(parent, name);
- if (element.hasAttribute("bases")) {
- QString bases = element.attribute("bases");
- if (!bases.isEmpty())
- basesList_.append(QPair<ClassNode*,QString>(static_cast<ClassNode*>(node), bases));
- }
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name.toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(name.toLower() + ".html");
- bool abstract = false;
- if (element.attribute("abstract") == "true")
- abstract = true;
- node->setAbstract(abstract);
- }
- else if (element.nodeName() == "qmlclass") {
- QmlTypeNode* qcn = new QmlTypeNode(parent, name);
- qcn->setTitle(element.attribute("title"));
- QString logicalModuleName = element.attribute("qml-module-name");
- if (!logicalModuleName.isEmpty())
- qdb_->addToQmlModule(logicalModuleName, qcn);
- bool abstract = false;
- if (element.attribute("abstract") == "true")
- abstract = true;
- qcn->setAbstract(abstract);
- QString qmlFullBaseName = element.attribute("qml-base-type");
- if (!qmlFullBaseName.isEmpty()) {
- qcn->setQmlBaseName(qmlFullBaseName);
- }
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
- node = qcn;
- }
- else if (element.nodeName() == "jstype") {
- QmlTypeNode* qcn = new QmlTypeNode(parent, name);
- qcn->setGenus(Node::JS);
- qcn->setTitle(element.attribute("title"));
- QString logicalModuleName = element.attribute("js-module-name");
- if (!logicalModuleName.isEmpty())
- qdb_->addToQmlModule(logicalModuleName, qcn);
- bool abstract = false;
- if (element.attribute("abstract") == "true")
- abstract = true;
- qcn->setAbstract(abstract);
- QString qmlFullBaseName = element.attribute("js-base-type");
- if (!qmlFullBaseName.isEmpty()) {
- qcn->setQmlBaseName(qmlFullBaseName);
- }
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
- node = qcn;
- }
- else if (element.nodeName() == "qmlbasictype") {
- QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name);
- qbtn->setTitle(element.attribute("title"));
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
- node = qbtn;
- }
- else if (element.nodeName() == "jsbasictype") {
- QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name);
- qbtn->setGenus(Node::JS);
- qbtn->setTitle(element.attribute("title"));
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
- node = qbtn;
- }
- else if (element.nodeName() == "qmlpropertygroup") {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
- QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name);
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
- node = qpgn;
- }
- else if (element.nodeName() == "jspropertygroup") {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
- QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name);
- qpgn->setGenus(Node::JS);
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
- node = qpgn;
- }
- else if (element.nodeName() == "qmlproperty") {
- QString type = element.attribute("type");
- bool attached = false;
- if (element.attribute("attached") == "true")
- attached = true;
- bool readonly = false;
- if (element.attribute("writable") == "false")
- readonly = true;
- QmlPropertyNode* qpn = 0;
- if (parent->isQmlType()) {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
- qpn = new QmlPropertyNode(qcn, name, type, attached);
- }
- else if (parent->isQmlPropertyGroup()) {
- QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(parent);
- qpn = new QmlPropertyNode(qpgn, name, type, attached);
- }
- qpn->setReadOnly(readonly);
- node = qpn;
- }
- else if (element.nodeName() == "jsproperty") {
- QString type = element.attribute("type");
- bool attached = false;
- if (element.attribute("attached") == "true")
- attached = true;
- bool readonly = false;
- if (element.attribute("writable") == "false")
- readonly = true;
- QmlPropertyNode* qpn = 0;
- if (parent->isJsType()) {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
- qpn = new QmlPropertyNode(qcn, name, type, attached);
- }
- else if (parent->isJsPropertyGroup()) {
- QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(parent);
- qpn = new QmlPropertyNode(qpgn, name, type, attached);
- }
- qpn->setGenus(Node::JS);
- qpn->setReadOnly(readonly);
- node = qpn;
- }
- else if ((element.nodeName() == "qmlmethod") ||
- (element.nodeName() == "qmlsignal") ||
- (element.nodeName() == "qmlsignalhandler")) {
- Node::Type t = Node::QmlMethod;
- if (element.nodeName() == "qmlsignal")
- t = Node::QmlSignal;
- else if (element.nodeName() == "qmlsignalhandler")
- t = Node::QmlSignalHandler;
- bool attached = false;
- FunctionNode* fn = new FunctionNode(t, parent, name, attached);
- node = fn;
- }
- else if ((element.nodeName() == "jsmethod") ||
- (element.nodeName() == "jssignal") ||
- (element.nodeName() == "jssignalhandler")) {
- Node::Type t = Node::QmlMethod;
- if (element.nodeName() == "jssignal")
- t = Node::QmlSignal;
- else if (element.nodeName() == "jssignalhandler")
- t = Node::QmlSignalHandler;
- bool attached = false;
- FunctionNode* fn = new FunctionNode(t, parent, name, attached);
- fn->setGenus(Node::JS);
- node = fn;
- }
- else if (element.nodeName() == "group") {
- CollectionNode* cn = qdb_->addGroup(name);
- cn->setTitle(element.attribute("title"));
- cn->setSubTitle(element.attribute("subtitle"));
- if (element.attribute("seen") == "true")
- cn->markSeen();
- node = cn;
- }
- else if (element.nodeName() == "module") {
- CollectionNode* cn = qdb_->addModule(name);
- cn->setTitle(element.attribute("title"));
- cn->setSubTitle(element.attribute("subtitle"));
- if (element.attribute("seen") == "true")
- cn->markSeen();
- node = cn;
- }
- else if (element.nodeName() == "qmlmodule") {
- QString t = element.attribute("qml-module-name");
- CollectionNode* cn = qdb_->addQmlModule(t);
- QStringList info;
- info << t << element.attribute("qml-module-version");
- cn->setLogicalModuleInfo(info);
- cn->setTitle(element.attribute("title"));
- cn->setSubTitle(element.attribute("subtitle"));
- if (element.attribute("seen") == "true")
- cn->markSeen();
- node = cn;
- }
- else if (element.nodeName() == "jsmodule") {
- QString t = element.attribute("js-module-name");
- CollectionNode* cn = qdb_->addJsModule(t);
- QStringList info;
- info << t << element.attribute("js-module-version");
- cn->setLogicalModuleInfo(info);
- cn->setTitle(element.attribute("title"));
- cn->setSubTitle(element.attribute("subtitle"));
- if (element.attribute("seen") == "true")
- cn->markSeen();
- node = cn;
- }
- else if (element.nodeName() == "page") {
- Node::SubType subtype;
- Node::PageType ptype = Node::NoPageType;
- QString attr = element.attribute("subtype");
- if (attr == "example") {
- subtype = Node::Example;
- ptype = Node::ExamplePage;
- }
- else if (attr == "header") {
- subtype = Node::HeaderFile;
- ptype = Node::ApiPage;
- }
- else if (attr == "file") {
- subtype = Node::File;
- ptype = Node::NoPageType;
- }
- else if (attr == "page") {
- subtype = Node::Page;
- ptype = Node::ArticlePage;
- }
- else if (attr == "externalpage") {
- subtype = Node::ExternalPage;
- ptype = Node::ArticlePage;
- }
- else
- return;
-
- DocumentNode* docNode = new DocumentNode(parent, name, subtype, ptype);
- docNode->setTitle(element.attribute("title"));
-
- if (element.hasAttribute("location"))
- name = element.attribute("location", QString());
-
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + name);
- else if (!indexUrl.isNull())
- location = Location(name);
-
- node = docNode;
-
- }
- else if (element.nodeName() == "enum") {
- EnumNode* enumNode = new EnumNode(parent, name);
-
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + parent->name().toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(parent->name().toLower() + ".html");
-
- QDomElement child = element.firstChildElement("value");
- while (!child.isNull()) {
- EnumItem item(child.attribute("name"), child.attribute("value"));
- enumNode->addItem(item);
- child = child.nextSiblingElement("value");
- }
-
- node = enumNode;
-
- }
- else if (element.nodeName() == "typedef") {
- node = new TypedefNode(parent, name);
-
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + parent->name().toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(parent->name().toLower() + ".html");
-
- }
- else if (element.nodeName() == "property") {
- node = new PropertyNode(parent, name);
-
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + parent->name().toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(parent->name().toLower() + ".html");
-
- }
- else if (element.nodeName() == "function") {
- FunctionNode::Virtualness virt;
- QString t = element.attribute("virtual");
- if (t == "non")
- virt = FunctionNode::NonVirtual;
- else if (t == "impure")
- virt = FunctionNode::ImpureVirtual;
- else if (t == "pure")
- virt = FunctionNode::PureVirtual;
- else
- return;
-
- t = element.attribute("meta");
- FunctionNode::Metaness meta;
- if (t == "plain")
- meta = FunctionNode::Plain;
- else if (t == "signal")
- meta = FunctionNode::Signal;
- else if (t == "slot")
- meta = FunctionNode::Slot;
- else if (t == "constructor")
- meta = FunctionNode::Ctor;
- else if (t == "destructor")
- meta = FunctionNode::Dtor;
- else if (t == "macro")
- meta = FunctionNode::MacroWithParams;
- else if (t == "macrowithparams")
- meta = FunctionNode::MacroWithParams;
- else if (t == "macrowithoutparams")
- meta = FunctionNode::MacroWithoutParams;
- else
- return;
-
- FunctionNode* functionNode = new FunctionNode(parent, name);
- functionNode->setReturnType(element.attribute("return"));
- functionNode->setVirtualness(virt);
- functionNode->setMetaness(meta);
- functionNode->setConst(element.attribute("const") == "true");
- functionNode->setStatic(element.attribute("static") == "true");
- functionNode->setOverload(element.attribute("overload") == "true");
-
- if (element.hasAttribute("relates")
- && element.attribute("relates") != parent->name()) {
- relatedList_.append(
- QPair<FunctionNode*,QString>(functionNode,
- element.attribute("relates")));
- }
- /*
- Note: The "signature" attribute was written to the
- index file, but it is not read back in. Is that ok?
- */
-
- QDomElement child = element.firstChildElement("parameter");
- while (!child.isNull()) {
- // Do not use the default value for the parameter; it is not
- // required, and has been known to cause problems.
- Parameter parameter(child.attribute("left"),
- child.attribute("right"),
- child.attribute("name"),
- QString()); // child.attribute("default")
- functionNode->addParameter(parameter);
- child = child.nextSiblingElement("parameter");
- }
-
- node = functionNode;
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + parent->name().toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(parent->name().toLower() + ".html");
- }
- else if (element.nodeName() == "variable") {
- node = new VariableNode(parent, name);
- if (!indexUrl.isEmpty())
- location = Location(indexUrl + QLatin1Char('/') + parent->name().toLower() + ".html");
- else if (!indexUrl.isNull())
- location = Location(parent->name().toLower() + ".html");
- }
- else if (element.nodeName() == "keyword") {
- QString title = element.attribute("title");
- qdb_->insertTarget(name, title, TargetRec::Keyword, current, 1);
- return;
- }
- else if (element.nodeName() == "target") {
- QString title = element.attribute("title");
- qdb_->insertTarget(name, title, TargetRec::Target, current, 2);
- return;
- }
- else if (element.nodeName() == "contents") {
- QString title = element.attribute("title");
- qdb_->insertTarget(name, title, TargetRec::Contents, current, 3);
- return;
- }
- else
- return;
-
- QString access = element.attribute("access");
- if (access == "public")
- node->setAccess(Node::Public);
- else if (access == "protected")
- node->setAccess(Node::Protected);
- else if ((access == "private") || (access == "internal"))
- node->setAccess(Node::Private);
- else
- node->setAccess(Node::Public);
-
- if ((element.nodeName() != "page") &&
- (element.nodeName() != "qmlclass") &&
- (element.nodeName() != "qmlbasictype") &&
- (element.nodeName() != "jstype") &&
- (element.nodeName() != "jsbasictype")) {
- QString threadSafety = element.attribute("threadsafety");
- if (threadSafety == "non-reentrant")
- node->setThreadSafeness(Node::NonReentrant);
- else if (threadSafety == "reentrant")
- node->setThreadSafeness(Node::Reentrant);
- else if (threadSafety == "thread safe")
- node->setThreadSafeness(Node::ThreadSafe);
- else
- node->setThreadSafeness(Node::UnspecifiedSafeness);
- }
- else
- node->setThreadSafeness(Node::UnspecifiedSafeness);
-
- QString status = element.attribute("status");
- if (status == "compat")
- node->setStatus(Node::Compat);
- else if (status == "obsolete")
- node->setStatus(Node::Obsolete);
- else if (status == "deprecated")
- node->setStatus(Node::Obsolete);
- else if (status == "preliminary")
- node->setStatus(Node::Preliminary);
- else if (status == "commendable")
- node->setStatus(Node::Commendable);
- else if (status == "internal")
- node->setStatus(Node::Internal);
- else
- node->setStatus(Node::Commendable);
-
- QString physicalModuleName = element.attribute("module");
- if (!physicalModuleName.isEmpty())
- qdb_->addToModule(physicalModuleName, node);
- if (!href.isEmpty()) {
- if (node->isExternalPage())
- node->setUrl(href);
- else if (!indexUrl.isEmpty())
- node->setUrl(indexUrl + QLatin1Char('/') + href);
- }
-
- QString since = element.attribute("since");
- if (!since.isEmpty()) {
- node->setSince(since);
- }
-
- QString groupsAttr = element.attribute("groups");
- if (!groupsAttr.isEmpty()) {
- QStringList groupNames = groupsAttr.split(",");
- foreach (const QString &name, groupNames) {
- qdb_->addToGroup(name, node);
- }
- }
-
- // Create some content for the node.
- QSet<QString> emptySet;
- Location t(filePath);
- if (!filePath.isEmpty()) {
- t.setLineNo(lineNo);
- node->setLocation(t);
- location = t;
- }
- Doc doc(location, location, " ", emptySet, emptySet); // placeholder
- node->setDoc(doc);
- node->setIndexNodeFlag();
- node->setOutputSubdirectory(project_.toLower());
- QString briefAttr = element.attribute("brief");
- if (!briefAttr.isEmpty()) {
- node->setReconstitutedBrief(briefAttr);
- }
-
- bool useParent = (element.nodeName() == "namespace" && name.isEmpty());
- if (element.hasChildNodes()) {
- QDomElement child = element.firstChildElement();
- while (!child.isNull()) {
- if (useParent)
- readIndexSection(child, parent, indexUrl);
- else
- readIndexSection(child, node, indexUrl);
- child = child.nextSiblingElement();
- }
- }
-}
-
-/*!
- This function tries to resolve class inheritance immediately
- after the index file is read. It is not always possible to
- resolve a class inheritance at this point, because the base
- class might be in an index file that hasn't been read yet, or
- it might be in one of the header files that will be read for
- the current module. These cases will be resolved after all
- the index files and header and source files have been read,
- just prior to beginning the generate phase for the current
- module.
-
- I don't think this is completely correct because it always
- sets the access to public.
- */
-void QDocIndexFiles::resolveIndex()
-{
- QPair<ClassNode*,QString> pair;
- foreach (pair, basesList_) {
- foreach (const QString& base, pair.second.split(QLatin1Char(','))) {
- QStringList basePath = base.split(QString("::"));
- Node* n = qdb_->findClassNode(basePath);
- if (n)
- pair.first->addResolvedBaseClass(Node::Public, static_cast<ClassNode*>(n));
- else
- pair.first->addUnresolvedBaseClass(Node::Public, basePath, QString());
- }
- }
-
- QPair<FunctionNode*,QString> relatedPair;
- foreach (relatedPair, relatedList_) {
- QStringList path = relatedPair.second.split("::");
- Node* n = qdb_->findRelatesNode(path);
- if (n)
- relatedPair.first->setRelates(static_cast<ClassNode*>(n));
- }
-
- // No longer needed.
- basesList_.clear();
- relatedList_.clear();
-}
-
-/*!
- Generate the index section with the given \a writer for the \a node
- specified, returning true if an element was written; otherwise returns
- false.
- */
-bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
- Node* node,
- bool generateInternalNodes)
-{
- /*
- Don't include index nodes in a new index file. Or DITA map nodes.
- */
- if (node->isIndexNode() || node->subType() == Node::DitaMap)
- return false;
-
- QString nodeName;
- QString logicalModuleName;
- QString logicalModuleVersion;
- QString qmlFullBaseName;
- switch (node->type()) {
- case Node::Namespace:
- nodeName = "namespace";
- break;
- case Node::Class:
- nodeName = "class";
- break;
- case Node::QmlType:
- {
- if (node->isQmlNode())
- nodeName = "qmlclass";
- else
- nodeName = "jstype";
- CollectionNode* cn = node->logicalModule();
- if (cn)
- logicalModuleName = cn->logicalModuleName();
- qmlFullBaseName = node->qmlFullBaseName();
- }
- break;
- case Node::QmlBasicType:
- if (node->isQmlNode())
- nodeName = "qmlbasictype";
- else
- nodeName = "jsbasictype";
- break;
- case Node::Document:
- nodeName = "page";
- break;
- case Node::Group:
- nodeName = "group";
- break;
- case Node::Module:
- nodeName = "module";
- break;
- case Node::QmlModule:
- if (node->isQmlNode())
- nodeName = "qmlmodule";
- else
- nodeName = "jsmodule";
- break;
- case Node::Enum:
- nodeName = "enum";
- break;
- case Node::Typedef:
- nodeName = "typedef";
- break;
- case Node::Property:
- nodeName = "property";
- break;
- case Node::Function:
- nodeName = "function";
- break;
- case Node::Variable:
- nodeName = "variable";
- break;
- case Node::QmlProperty:
- if (node->isQmlNode())
- nodeName = "qmlproperty";
- else
- nodeName = "jsProperty";
- break;
- case Node::QmlPropertyGroup:
- if (node->isQmlNode())
- nodeName = "qmlpropertygroup";
- else
- nodeName = "jspropertygroup";
- break;
- case Node::QmlSignal:
- if (node->isQmlNode())
- nodeName = "qmlsignal";
- else
- nodeName = "jssignal";
- break;
- case Node::QmlSignalHandler:
- if (node->isQmlNode())
- nodeName = "qmlsignalhandler";
- else
- nodeName = "jssignalhandler";
- break;
- case Node::QmlMethod:
- if (node->isQmlNode())
- nodeName = "qmlmethod";
- else
- nodeName = "jsmethod";
- break;
- default:
- return false;
- }
-
- QString access;
- switch (node->access()) {
- case Node::Public:
- access = "public";
- break;
- case Node::Protected:
- access = "protected";
- break;
- case Node::Private:
- {
- access = "private";
- bool b = generateInternalNodes;
- if (b)
- b = false;
- }
- break;
- default:
- return false;
- }
-
- QString objName = node->name();
- // Special case: only the root node should have an empty name.
- if (objName.isEmpty() && node != qdb_->primaryTreeRoot())
- return false;
-
- writer.writeStartElement(nodeName);
-
- QXmlStreamAttributes attributes;
-
- if (!node->isDocumentNode() && !node->isCollectionNode()) {
- QString threadSafety;
- switch (node->threadSafeness()) {
- case Node::NonReentrant:
- threadSafety = "non-reentrant";
- break;
- case Node::Reentrant:
- threadSafety = "reentrant";
- break;
- case Node::ThreadSafe:
- threadSafety = "thread safe";
- break;
- case Node::UnspecifiedSafeness:
- default:
- threadSafety = "unspecified";
- break;
- }
- writer.writeAttribute("threadsafety", threadSafety);
- }
-
- QString status;
- switch (node->status()) {
- case Node::Compat:
- status = "compat";
- break;
- case Node::Obsolete:
- status = "obsolete";
- break;
- case Node::Deprecated:
- status = "obsolete";
- break;
- case Node::Preliminary:
- status = "preliminary";
- break;
- case Node::Commendable:
- status = "commendable";
- break;
- case Node::Internal:
- status = "internal";
- break;
- default:
- status = "main";
- break;
- }
-
- writer.writeAttribute("name", objName);
- if (node->isQmlModule()) {
- logicalModuleName = node->logicalModuleName();
- logicalModuleVersion = node->logicalModuleVersion();
- if (logicalModuleName.isEmpty()) {
- logicalModuleName = node->name();
- }
- if (!logicalModuleName.isEmpty()) {
- writer.writeAttribute("qml-module-name", logicalModuleName);
- if (node->isQmlModule())
- writer.writeAttribute("qml-module-version", logicalModuleVersion);
- if (!qmlFullBaseName.isEmpty())
- writer.writeAttribute("qml-base-type", qmlFullBaseName);
- }
- }
- else if (node->isJsModule()) {
- logicalModuleName = node->logicalModuleName();
- logicalModuleVersion = node->logicalModuleVersion();
- if (!logicalModuleName.isEmpty()) {
- writer.writeAttribute("js-module-name", logicalModuleName);
- if (node->isQmlModule())
- writer.writeAttribute("js-module-version", logicalModuleVersion);
- if (!qmlFullBaseName.isEmpty())
- writer.writeAttribute("js-base-type", qmlFullBaseName);
- }
- }
-
- QString href;
- if (!node->isExternalPage()) {
- QString fullName = node->fullDocumentName();
- if (fullName != objName)
- writer.writeAttribute("fullname", fullName);
-#if 0
- if (Generator::useOutputSubdirs())
- href = node->outputSubdirectory();
- if (!href.isEmpty())
- href.append(QLatin1Char('/'));
- href.append(gen_->fullDocumentLocation(node));
-#endif
- href = gen_->fullDocumentLocation(node);
- }
- else
- href = node->name();
- if (node->isQmlNode() || node->isJsNode()) {
- InnerNode* p = node->parent();
- if (p) {
- if (p->isQmlPropertyGroup() || p->isJsPropertyGroup())
- p = p->parent();
- if (p && (p->isQmlType() || p->isJsType()) && p->isAbstract())
- href.clear();
- }
- }
- if (!href.isEmpty())
- writer.writeAttribute("href", href);
-
- writer.writeAttribute("status", status);
- if (!node->isDocumentNode() && !node->isCollectionNode()) {
- writer.writeAttribute("access", access);
- if (node->isAbstract())
- writer.writeAttribute("abstract", "true");
- }
- if (!node->location().fileName().isEmpty())
- writer.writeAttribute("location", node->location().fileName());
- if (!node->location().filePath().isEmpty()) {
- writer.writeAttribute("filepath", node->location().filePath());
- writer.writeAttribute("lineno", QString("%1").arg(node->location().lineNo()));
- }
-
- if (!node->since().isEmpty()) {
- writer.writeAttribute("since", node->since());
- }
-
- QString brief = node->doc().trimmedBriefText(node->name()).toString();
- switch (node->type()) {
- case Node::Class:
- {
- // Classes contain information about their base classes.
- const ClassNode* classNode = static_cast<const ClassNode*>(node);
- QList<RelatedClass> bases = classNode->baseClasses();
- QSet<QString> baseStrings;
- foreach (const RelatedClass& related, bases) {
- ClassNode* n = related.node_;
- if (n)
- baseStrings.insert(n->fullName());
- }
- if (!baseStrings.isEmpty())
- writer.writeAttribute("bases", QStringList(baseStrings.toList()).join(","));
- if (!node->physicalModuleName().isEmpty())
- writer.writeAttribute("module", node->physicalModuleName());
- if (!classNode->groupNames().isEmpty())
- writer.writeAttribute("groups", classNode->groupNames().join(","));
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Namespace:
- {
- const NamespaceNode* namespaceNode = static_cast<const NamespaceNode*>(node);
- if (!namespaceNode->physicalModuleName().isEmpty())
- writer.writeAttribute("module", namespaceNode->physicalModuleName());
- if (!namespaceNode->groupNames().isEmpty())
- writer.writeAttribute("groups", namespaceNode->groupNames().join(","));
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::QmlType:
- {
- const QmlTypeNode* qcn = static_cast<const QmlTypeNode*>(node);
- writer.writeAttribute("title", qcn->title());
- writer.writeAttribute("fulltitle", qcn->fullTitle());
- writer.writeAttribute("subtitle", qcn->subTitle());
- if (!qcn->groupNames().isEmpty())
- writer.writeAttribute("groups", qcn->groupNames().join(","));
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Document:
- {
- /*
- Document nodes (such as manual pages) have a subtype,
- a title, and other attributes.
- */
- bool writeModuleName = false;
- const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
- switch (docNode->subType()) {
- case Node::Example:
- writer.writeAttribute("subtype", "example");
- writeModuleName = true;
- break;
- case Node::HeaderFile:
- writer.writeAttribute("subtype", "header");
- writeModuleName = true;
- break;
- case Node::File:
- writer.writeAttribute("subtype", "file");
- break;
- case Node::Page:
- writer.writeAttribute("subtype", "page");
- writeModuleName = true;
- break;
- case Node::ExternalPage:
- writer.writeAttribute("subtype", "externalpage");
- break;
- default:
- break;
- }
- writer.writeAttribute("title", docNode->title());
- writer.writeAttribute("fulltitle", docNode->fullTitle());
- writer.writeAttribute("subtitle", docNode->subTitle());
- if (!node->physicalModuleName().isEmpty() && writeModuleName) {
- writer.writeAttribute("module", node->physicalModuleName());
- }
- if (!docNode->groupNames().isEmpty())
- writer.writeAttribute("groups", docNode->groupNames().join(","));
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Group:
- {
- const CollectionNode* cn = static_cast<const CollectionNode*>(node);
- writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false");
- writer.writeAttribute("title", cn->title());
- if (!cn->subTitle().isEmpty())
- writer.writeAttribute("subtitle", cn->subTitle());
- if (!cn->physicalModuleName().isEmpty())
- writer.writeAttribute("module", cn->physicalModuleName());
- if (!cn->groupNames().isEmpty())
- writer.writeAttribute("groups", cn->groupNames().join(","));
- /*
- This is not read back in, so it probably
- shouldn't be written out in the first place.
- */
- if (!cn->members().isEmpty()) {
- QStringList names;
- foreach (const Node* member, cn->members())
- names.append(member->name());
- writer.writeAttribute("members", names.join(","));
- }
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Module:
- {
- const CollectionNode* cn = static_cast<const CollectionNode*>(node);
- writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false");
- writer.writeAttribute("title", cn->title());
- if (!cn->subTitle().isEmpty())
- writer.writeAttribute("subtitle", cn->subTitle());
- if (!cn->physicalModuleName().isEmpty())
- writer.writeAttribute("module", cn->physicalModuleName());
- if (!cn->groupNames().isEmpty())
- writer.writeAttribute("groups", cn->groupNames().join(","));
- /*
- This is not read back in, so it probably
- shouldn't be written out in the first place.
- */
- if (!cn->members().isEmpty()) {
- QStringList names;
- foreach (const Node* member, cn->members())
- names.append(member->name());
- writer.writeAttribute("members", names.join(","));
- }
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::QmlModule:
- {
- const CollectionNode* cn = static_cast<const CollectionNode*>(node);
- writer.writeAttribute("seen", cn->wasSeen() ? "true" : "false");
- writer.writeAttribute("title", cn->title());
- if (!cn->subTitle().isEmpty())
- writer.writeAttribute("subtitle", cn->subTitle());
- if (!cn->physicalModuleName().isEmpty())
- writer.writeAttribute("module", cn->physicalModuleName());
- if (!cn->groupNames().isEmpty())
- writer.writeAttribute("groups", cn->groupNames().join(","));
- /*
- This is not read back in, so it probably
- shouldn't be written out in the first place.
- */
- if (!cn->members().isEmpty()) {
- QStringList names;
- foreach (const Node* member, cn->members())
- names.append(member->name());
- writer.writeAttribute("members", names.join(","));
- }
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Function:
- {
- /*
- Function nodes contain information about the type of
- function being described.
- */
- const FunctionNode* functionNode = static_cast<const FunctionNode*>(node);
- switch (functionNode->virtualness()) {
- case FunctionNode::NonVirtual:
- writer.writeAttribute("virtual", "non");
- break;
- case FunctionNode::ImpureVirtual:
- writer.writeAttribute("virtual", "impure");
- break;
- case FunctionNode::PureVirtual:
- writer.writeAttribute("virtual", "pure");
- break;
- default:
- break;
- }
-
- switch (functionNode->metaness()) {
- case FunctionNode::Plain:
- writer.writeAttribute("meta", "plain");
- break;
- case FunctionNode::Signal:
- writer.writeAttribute("meta", "signal");
- break;
- case FunctionNode::Slot:
- writer.writeAttribute("meta", "slot");
- break;
- case FunctionNode::Ctor:
- writer.writeAttribute("meta", "constructor");
- break;
- case FunctionNode::Dtor:
- writer.writeAttribute("meta", "destructor");
- break;
- case FunctionNode::MacroWithParams:
- writer.writeAttribute("meta", "macrowithparams");
- break;
- case FunctionNode::MacroWithoutParams:
- writer.writeAttribute("meta", "macrowithoutparams");
- break;
- default:
- break;
- }
- writer.writeAttribute("const", functionNode->isConst()?"true":"false");
- writer.writeAttribute("static", functionNode->isStatic()?"true":"false");
- writer.writeAttribute("overload", functionNode->isOverload()?"true":"false");
- if (functionNode->isOverload())
- writer.writeAttribute("overload-number", QString::number(functionNode->overloadNumber()));
- if (functionNode->relates()) {
- writer.writeAttribute("relates", functionNode->relates()->name());
- }
- const PropertyNode* propertyNode = functionNode->associatedProperty();
- if (propertyNode)
- writer.writeAttribute("associated-property", propertyNode->name());
- writer.writeAttribute("type", functionNode->returnType());
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
-
- /*
- Note: The "signature" attribute is written to the
- index file, but it is not read back in. Is that ok?
- */
- QString signature = functionNode->signature();
- if (functionNode->isConst())
- signature += " const";
- writer.writeAttribute("signature", signature);
-
- for (int i = 0; i < functionNode->parameters().size(); ++i) {
- Parameter parameter = functionNode->parameters()[i];
- writer.writeStartElement("parameter");
- writer.writeAttribute("left", parameter.leftType());
- writer.writeAttribute("right", parameter.rightType());
- writer.writeAttribute("name", parameter.name());
- writer.writeAttribute("default", parameter.defaultValue());
- writer.writeEndElement(); // parameter
- }
- }
- break;
- case Node::QmlProperty:
- {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- writer.writeAttribute("type", qpn->dataType());
- writer.writeAttribute("attached", qpn->isAttached() ? "true" : "false");
- writer.writeAttribute("writable", qpn->isWritable() ? "true" : "false");
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::QmlPropertyGroup:
- {
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Property:
- {
- const PropertyNode* propertyNode = static_cast<const PropertyNode*>(node);
- writer.writeAttribute("type", propertyNode->dataType());
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- foreach (const Node* fnNode, propertyNode->getters()) {
- if (fnNode) {
- const FunctionNode* functionNode = static_cast<const FunctionNode*>(fnNode);
- writer.writeStartElement("getter");
- writer.writeAttribute("name", functionNode->name());
- writer.writeEndElement(); // getter
- }
- }
- foreach (const Node* fnNode, propertyNode->setters()) {
- if (fnNode) {
- const FunctionNode* functionNode = static_cast<const FunctionNode*>(fnNode);
- writer.writeStartElement("setter");
- writer.writeAttribute("name", functionNode->name());
- writer.writeEndElement(); // setter
- }
- }
- foreach (const Node* fnNode, propertyNode->resetters()) {
- if (fnNode) {
- const FunctionNode* functionNode = static_cast<const FunctionNode*>(fnNode);
- writer.writeStartElement("resetter");
- writer.writeAttribute("name", functionNode->name());
- writer.writeEndElement(); // resetter
- }
- }
- foreach (const Node* fnNode, propertyNode->notifiers()) {
- if (fnNode) {
- const FunctionNode* functionNode = static_cast<const FunctionNode*>(fnNode);
- writer.writeStartElement("notifier");
- writer.writeAttribute("name", functionNode->name());
- writer.writeEndElement(); // notifier
- }
- }
- }
- break;
- case Node::Variable:
- {
- const VariableNode* variableNode = static_cast<const VariableNode*>(node);
- writer.writeAttribute("type", variableNode->dataType());
- writer.writeAttribute("static", variableNode->isStatic() ? "true" : "false");
- if (!brief.isEmpty())
- writer.writeAttribute("brief", brief);
- }
- break;
- case Node::Enum:
- {
- const EnumNode* enumNode = static_cast<const EnumNode*>(node);
- if (enumNode->flagsType()) {
- writer.writeAttribute("typedef",enumNode->flagsType()->fullDocumentName());
- }
- foreach (const EnumItem& item, enumNode->items()) {
- writer.writeStartElement("value");
- writer.writeAttribute("name", item.name());
- writer.writeAttribute("value", item.value());
- writer.writeEndElement(); // value
- }
- }
- break;
- case Node::Typedef:
- {
- const TypedefNode* typedefNode = static_cast<const TypedefNode*>(node);
- if (typedefNode->associatedEnum()) {
- writer.writeAttribute("enum",typedefNode->associatedEnum()->fullDocumentName());
- }
- }
- break;
- default:
- break;
- }
-
- /*
- For our pages, we canonicalize the target, keyword and content
- item names so that they can be used by qdoc for other sets of
- documentation.
-
- The reason we do this here is that we don't want to ruin
- externally composed indexes, containing non-qdoc-style target names
- when reading in indexes.
-
- targets and keywords are now allowed in any node, not just inner nodes.
- */
-
- if (node->doc().hasTargets()) {
- bool external = false;
- if (node->type() == Node::Document) {
- const DocumentNode* docNode = static_cast<const DocumentNode*>(node);
- if (docNode->subType() == Node::ExternalPage)
- external = true;
- }
- foreach (const Atom* target, node->doc().targets()) {
- QString title = target->string();
- QString name = Doc::canonicalTitle(title);
- writer.writeStartElement("target");
- if (!external)
- writer.writeAttribute("name", name);
- else
- writer.writeAttribute("name", title);
- if (name != title)
- writer.writeAttribute("title", title);
- writer.writeEndElement(); // target
- }
- }
- if (node->doc().hasKeywords()) {
- foreach (const Atom* keyword, node->doc().keywords()) {
- QString title = keyword->string();
- QString name = Doc::canonicalTitle(title);
- writer.writeStartElement("keyword");
- writer.writeAttribute("name", name);
- if (name != title)
- writer.writeAttribute("title", title);
- writer.writeEndElement(); // keyword
- }
- }
-
- // Inner nodes and function nodes contain child nodes of some sort, either
- // actual child nodes or function parameters. For these, we close the
- // opening tag, create child elements, then add a closing tag for the
- // element. Elements for all other nodes are closed in the opening tag.
-
- if (node->isInnerNode()) {
- const InnerNode* inner = static_cast<const InnerNode*>(node);
-
- if (inner->doc().hasTableOfContents()) {
- for (int i = 0; i < inner->doc().tableOfContents().size(); ++i) {
- Atom* item = inner->doc().tableOfContents()[i];
- int level = inner->doc().tableOfContentsLevels()[i];
- QString title = Text::sectionHeading(item).toString();
- writer.writeStartElement("contents");
- writer.writeAttribute("name", Doc::canonicalTitle(title));
- writer.writeAttribute("title", title);
- writer.writeAttribute("level", QString::number(level));
- writer.writeEndElement(); // contents
- }
- }
- }
- return true;
-}
-
-/*!
- Returns \c true if the node \a n1 is less than node \a n2. The
- comparison is performed by comparing properties of the nodes
- in order of increasing complexity.
-*/
-bool compareNodes(const Node* n1, const Node* n2)
-{
- // Private nodes can occur in any order since they won't normally be
- // written to the index.
- if (n1->access() == Node::Private && n2->access() == Node::Private)
- return false;
-
- if (n1->location().filePath() < n2->location().filePath())
- return true;
- else if (n1->location().filePath() > n2->location().filePath())
- return false;
-
- if (n1->type() < n2->type())
- return true;
- else if (n1->type() > n2->type())
- return false;
-
- if (n1->name() < n2->name())
- return true;
- else if (n1->name() > n2->name())
- return false;
-
- if (n1->access() < n2->access())
- return true;
- else if (n1->access() > n2->access())
- return false;
-
- if (n1->type() == Node::Function && n2->type() == Node::Function) {
- const FunctionNode* f1 = static_cast<const FunctionNode*>(n1);
- const FunctionNode* f2 = static_cast<const FunctionNode*>(n2);
-
- if (f1->isConst() < f2->isConst())
- return true;
- else if (f1->isConst() > f2->isConst())
- return false;
-
- if (f1->signature() < f2->signature())
- return true;
- else if (f1->signature() > f2->signature())
- return false;
- }
-
- if (n1->isDocumentNode() && n2->isDocumentNode()) {
- const DocumentNode* f1 = static_cast<const DocumentNode*>(n1);
- const DocumentNode* f2 = static_cast<const DocumentNode*>(n2);
- if (f1->fullTitle() < f2->fullTitle())
- return true;
- else if (f1->fullTitle() > f2->fullTitle())
- return false;
- }
- else if (n1->isCollectionNode() && n2->isCollectionNode()) {
- const CollectionNode* f1 = static_cast<const CollectionNode*>(n1);
- const CollectionNode* f2 = static_cast<const CollectionNode*>(n2);
- if (f1->fullTitle() < f2->fullTitle())
- return true;
- else if (f1->fullTitle() > f2->fullTitle())
- return false;
- }
-
- return false;
-}
-
-/*!
- Generate index sections for the child nodes of the given \a node
- using the \a writer specified. If \a generateInternalNodes is true,
- nodes marked as internal will be included in the index; otherwise,
- they will be omitted.
-*/
-void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer,
- Node* node,
- bool generateInternalNodes)
-{
- /*
- Note that groups, modules, and QML modules are written
- after all the other nodes.
- */
- if (node->isGroup() || node->isModule() || node->isQmlModule() || node->isJsModule())
- return;
-
- if (generateIndexSection(writer, node, generateInternalNodes)) {
- if (node->isInnerNode()) {
- const InnerNode* inner = static_cast<const InnerNode*>(node);
-
- NodeList cnodes = inner->childNodes();
- std::sort(cnodes.begin(), cnodes.end(), compareNodes);
-
- foreach (Node* child, cnodes) {
- generateIndexSections(writer, child, generateInternalNodes);
- }
- }
-
- if (node == top) {
- /*
- We wait until the end of the index file to output the group, module,
- and QML module elements. By outputting them at the end, when we read
- the index file back in, all the group, module, and QML module member
- elements will have already been created. It is then only necessary to
- create the group, module, or QML module element and add each member to
- its member list.
- */
- const CNMap& groups = qdb_->groups();
- if (!groups.isEmpty()) {
- CNMap::ConstIterator g = groups.constBegin();
- while (g != groups.constEnd()) {
- if (generateIndexSection(writer, g.value(), generateInternalNodes))
- writer.writeEndElement();
- ++g;
- }
- }
-
- const CNMap& modules = qdb_->modules();
- if (!modules.isEmpty()) {
- CNMap::ConstIterator g = modules.constBegin();
- while (g != modules.constEnd()) {
- if (generateIndexSection(writer, g.value(), generateInternalNodes))
- writer.writeEndElement();
- ++g;
- }
- }
-
- const CNMap& qmlModules = qdb_->qmlModules();
- if (!qmlModules.isEmpty()) {
- CNMap::ConstIterator g = qmlModules.constBegin();
- while (g != qmlModules.constEnd()) {
- if (generateIndexSection(writer, g.value(), generateInternalNodes))
- writer.writeEndElement();
- ++g;
- }
- }
-
- const CNMap& jsModules = qdb_->jsModules();
- if (!jsModules.isEmpty()) {
- CNMap::ConstIterator g = jsModules.constBegin();
- while (g != jsModules.constEnd()) {
- if (generateIndexSection(writer, g.value(), generateInternalNodes))
- writer.writeEndElement();
- ++g;
- }
- }
- }
-
- writer.writeEndElement();
- }
-}
-
-/*!
- Outputs an index file.
- */
-void QDocIndexFiles::generateIndex(const QString& fileName,
- const QString& url,
- const QString& title,
- Generator* g,
- bool generateInternalNodes)
-{
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text))
- return;
-
- QString msg = "Writing index file: " + fileName;
- Location::logToStdErr(msg);
-
- gen_ = g;
- QXmlStreamWriter writer(&file);
- writer.setAutoFormatting(true);
- writer.writeStartDocument();
- writer.writeDTD("<!DOCTYPE QDOCINDEX>");
-
- writer.writeStartElement("INDEX");
- writer.writeAttribute("url", url);
- writer.writeAttribute("title", title);
- writer.writeAttribute("version", qdb_->version());
- writer.writeAttribute("project", g->config()->getString(CONFIG_PROJECT));
-
- top = qdb_->primaryTreeRoot();
- generateIndexSections(writer, top, generateInternalNodes);
-
- writer.writeEndElement(); // INDEX
- writer.writeEndElement(); // QDOCINDEX
- writer.writeEndDocument();
- file.close();
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qdocindexfiles.h b/src/tools/qdoc/qdocindexfiles.h
deleted file mode 100644
index 9a18639251..0000000000
--- a/src/tools/qdoc/qdocindexfiles.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 QDOCINDEXFILES_H
-#define QDOCINDEXFILES_H
-
-#include "node.h"
-
-QT_BEGIN_NAMESPACE
-
-class Atom;
-class Generator;
-class QStringList;
-class QDocDatabase;
-class QDomElement;
-class QXmlStreamWriter;
-
-class QDocIndexFiles
-{
- friend class QDocDatabase;
-
- private:
- static QDocIndexFiles* qdocIndexFiles();
- static void destroyQDocIndexFiles();
-
- QDocIndexFiles();
- ~QDocIndexFiles();
-
- void readIndexes(const QStringList& indexFiles);
- void generateIndex(const QString& fileName,
- const QString& url,
- const QString& title,
- Generator* g,
- bool generateInternalNodes = false);
-
- void readIndexFile(const QString& path);
- void readIndexSection(const QDomElement& element, Node* current, const QString& indexUrl);
- void resolveIndex();
- bool generateIndexSection(QXmlStreamWriter& writer, Node* node, bool generateInternalNodes = false);
- void generateIndexSections(QXmlStreamWriter& writer, Node* node, bool generateInternalNodes = false);
-
- private:
- static QDocIndexFiles* qdocIndexFiles_;
- QDocDatabase* qdb_;
- Generator* gen_;
- QString project_;
- QList<QPair<ClassNode*,QString> > basesList_;
- QList<QPair<FunctionNode*,QString> > relatedList_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qdoctagfiles.cpp b/src/tools/qdoc/qdoctagfiles.cpp
deleted file mode 100644
index 778df33048..0000000000
--- a/src/tools/qdoc/qdoctagfiles.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "node.h"
-#include "qdoctagfiles.h"
-#include "qdocdatabase.h"
-
-#include "qdom.h"
-#include "atom.h"
-#include "doc.h"
-#include "htmlgenerator.h"
-#include "location.h"
-#include "node.h"
-#include "text.h"
-#include <limits.h>
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QDocTagFiles
-
- This class handles the generation of the qdoc tag file.
- */
-
-QDocTagFiles* QDocTagFiles::qdocTagFiles_ = NULL;
-
-/*!
- Constructs the singleton. \a qdb is the pointer to the
- qdoc database that is used when reading and writing the
- index files.
- */
-QDocTagFiles::QDocTagFiles()
-{
- qdb_ = QDocDatabase::qdocDB();
-}
-
-/*!
- Destroys the singleton QDocTagFiles.
- */
-QDocTagFiles::~QDocTagFiles()
-{
- qdb_ = 0;
-}
-
-/*!
- Creates the singleton. Allows only one instance of the class
- to be created. Returns a pointer to the singleton.
- */
-QDocTagFiles* QDocTagFiles::qdocTagFiles()
-{
- if (!qdocTagFiles_)
- qdocTagFiles_ = new QDocTagFiles;
- return qdocTagFiles_;
-}
-
-/*!
- Destroys the singleton.
- */
-void QDocTagFiles::destroyQDocTagFiles()
-{
- if (qdocTagFiles_) {
- delete qdocTagFiles_;
- qdocTagFiles_ = 0;
- }
-}
-
-/*!
- Generate the tag file section with the given \a writer for the \a node
- specified, returning true if an element was written; otherwise returns
- false.
- */
-void QDocTagFiles::generateTagFileCompounds(QXmlStreamWriter& writer, const InnerNode* inner)
-{
- foreach (const Node* node, inner->childNodes()) {
- if (!node->url().isEmpty())
- continue;
-
- QString kind;
- switch (node->type()) {
- case Node::Namespace:
- kind = "namespace";
- break;
- case Node::Class:
- case Node::QmlType:
- kind = "class";
- break;
- case Node::Enum:
- case Node::Typedef:
- case Node::Property:
- case Node::Function:
- case Node::Variable:
- default:
- continue;
- }
-
- QString access;
- switch (node->access()) {
- case Node::Public:
- access = "public";
- break;
- case Node::Protected:
- access = "protected";
- break;
- case Node::Private:
- default:
- continue;
- }
-
- QString objName = node->name();
-
- // Special case: only the root node should have an empty name.
- if (objName.isEmpty() && node != qdb_->primaryTreeRoot())
- continue;
-
- // *** Write the starting tag for the element here. ***
- writer.writeStartElement("compound");
- writer.writeAttribute("kind", kind);
-
- if (node->type() == Node::Class) {
- writer.writeTextElement("name", node->fullDocumentName());
- writer.writeTextElement("filename", gen_->fullDocumentLocation(node, false));
-
- // Classes contain information about their base classes.
- const ClassNode* classNode = static_cast<const ClassNode*>(node);
- QList<RelatedClass> bases = classNode->baseClasses();
- foreach (const RelatedClass& related, bases) {
- ClassNode* n = related.node_;
- if (n)
- writer.writeTextElement("base", n->name());
- }
-
- // Recurse to write all members.
- generateTagFileMembers(writer, static_cast<const InnerNode*>(node));
- writer.writeEndElement();
-
- // Recurse to write all compounds.
- generateTagFileCompounds(writer, static_cast<const InnerNode*>(node));
- }
- else {
- writer.writeTextElement("name", node->fullDocumentName());
- writer.writeTextElement("filename", gen_->fullDocumentLocation(node, false));
-
- // Recurse to write all members.
- generateTagFileMembers(writer, static_cast<const InnerNode*>(node));
- writer.writeEndElement();
-
- // Recurse to write all compounds.
- generateTagFileCompounds(writer, static_cast<const InnerNode*>(node));
- }
- }
-}
-
-/*!
- Writes all the members of the \a inner node with the \a writer.
- The node represents a C++ class, namespace, etc.
- */
-void QDocTagFiles::generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inner)
-{
- foreach (const Node* node, inner->childNodes()) {
- if (!node->url().isEmpty())
- continue;
-
- QString nodeName;
- QString kind;
- switch (node->type()) {
- case Node::Enum:
- nodeName = "member";
- kind = "enum";
- break;
- case Node::Typedef:
- nodeName = "member";
- kind = "typedef";
- break;
- case Node::Property:
- nodeName = "member";
- kind = "property";
- break;
- case Node::Function:
- nodeName = "member";
- kind = "function";
- break;
- case Node::Namespace:
- nodeName = "namespace";
- break;
- case Node::Class:
- nodeName = "class";
- break;
- case Node::Variable:
- default:
- continue;
- }
-
- QString access;
- switch (node->access()) {
- case Node::Public:
- access = "public";
- break;
- case Node::Protected:
- access = "protected";
- break;
- case Node::Private:
- default:
- continue;
- }
-
- QString objName = node->name();
-
- // Special case: only the root node should have an empty name.
- if (objName.isEmpty() && node != qdb_->primaryTreeRoot())
- continue;
-
- // *** Write the starting tag for the element here. ***
- writer.writeStartElement(nodeName);
- if (!kind.isEmpty())
- writer.writeAttribute("kind", kind);
-
- switch (node->type()) {
- case Node::Class:
- writer.writeCharacters(node->fullDocumentName());
- writer.writeEndElement();
- break;
- case Node::Namespace:
- writer.writeCharacters(node->fullDocumentName());
- writer.writeEndElement();
- break;
- case Node::Function:
- {
- /*
- Function nodes contain information about
- the type of function being described.
- */
-
- const FunctionNode* functionNode = static_cast<const FunctionNode*>(node);
- writer.writeAttribute("protection", access);
-
- switch (functionNode->virtualness()) {
- case FunctionNode::NonVirtual:
- writer.writeAttribute("virtualness", "non");
- break;
- case FunctionNode::ImpureVirtual:
- writer.writeAttribute("virtualness", "virtual");
- break;
- case FunctionNode::PureVirtual:
- writer.writeAttribute("virtual", "pure");
- break;
- default:
- break;
- }
- writer.writeAttribute("static", functionNode->isStatic() ? "yes" : "no");
-
- if (functionNode->virtualness() == FunctionNode::NonVirtual)
- writer.writeTextElement("type", functionNode->returnType());
- else
- writer.writeTextElement("type", "virtual " + functionNode->returnType());
-
- writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
- writer.writeTextElement("anchorfile", pieces[0]);
- writer.writeTextElement("anchor", pieces[1]);
- QString signature = functionNode->signature();
- signature = signature.mid(signature.indexOf(QChar('('))).trimmed();
- if (functionNode->isConst())
- signature += " const";
- if (functionNode->virtualness() == FunctionNode::PureVirtual)
- signature += " = 0";
- writer.writeTextElement("arglist", signature);
- }
- writer.writeEndElement(); // member
- break;
- case Node::Property:
- {
- const PropertyNode* propertyNode = static_cast<const PropertyNode*>(node);
- writer.writeAttribute("type", propertyNode->dataType());
- writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
- writer.writeTextElement("anchorfile", pieces[0]);
- writer.writeTextElement("anchor", pieces[1]);
- writer.writeTextElement("arglist", QString());
- }
- writer.writeEndElement(); // member
- break;
- case Node::Enum:
- {
- const EnumNode* enumNode = static_cast<const EnumNode*>(node);
- writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
- writer.writeTextElement("anchor", pieces[1]);
- writer.writeTextElement("arglist", QString());
- writer.writeEndElement(); // member
-
- for (int i = 0; i < enumNode->items().size(); ++i) {
- EnumItem item = enumNode->items().value(i);
- writer.writeStartElement("member");
- writer.writeAttribute("name", item.name());
- writer.writeTextElement("anchor", pieces[1]);
- writer.writeTextElement("arglist", QString());
- writer.writeEndElement(); // member
- }
- }
- break;
- case Node::Typedef:
- {
- const TypedefNode* typedefNode = static_cast<const TypedefNode*>(node);
- if (typedefNode->associatedEnum())
- writer.writeAttribute("type", typedefNode->associatedEnum()->fullDocumentName());
- else
- writer.writeAttribute("type", QString());
- writer.writeTextElement("name", objName);
- QStringList pieces = gen_->fullDocumentLocation(node, false).split(QLatin1Char('#'));
- writer.writeTextElement("anchorfile", pieces[0]);
- writer.writeTextElement("anchor", pieces[1]);
- writer.writeTextElement("arglist", QString());
- }
- writer.writeEndElement(); // member
- break;
-
- case Node::Variable:
- default:
- break;
- }
- }
-}
-
-/*!
- Writes a tag file named \a fileName.
- */
-void QDocTagFiles::generateTagFile(const QString& fileName, Generator* g)
-{
- QFile file(fileName);
- QFileInfo fileInfo(fileName);
-
- // If no path was specified or it doesn't exist,
- // default to the output directory
- if (fileInfo.fileName() == fileName || !fileInfo.dir().exists())
- file.setFileName(gen_->outputDir() + QLatin1Char('/') +
- fileInfo.fileName());
-
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- Location::null.warning(
- QString("Failed to open %1 for writing.").arg(file.fileName()));
- return;
- }
-
- gen_ = g;
- QXmlStreamWriter writer(&file);
- writer.setAutoFormatting(true);
- writer.writeStartDocument();
- writer.writeStartElement("tagfile");
- generateTagFileCompounds(writer, qdb_->primaryTreeRoot());
- writer.writeEndElement(); // tagfile
- writer.writeEndDocument();
- file.close();
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qdoctagfiles.h b/src/tools/qdoc/qdoctagfiles.h
deleted file mode 100644
index 94d3450478..0000000000
--- a/src/tools/qdoc/qdoctagfiles.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 QDOCTAGFILES_H
-#define QDOCTAGFILES_H
-
-#include "qxmlstream.h"
-
-QT_BEGIN_NAMESPACE
-
-class InnerNode;
-class QDocDatabase;
-class Generator;
-
-class QDocTagFiles
-{
- friend class QDocDatabase;
-
- private:
- static QDocTagFiles* qdocTagFiles();
- static void destroyQDocTagFiles();
-
- QDocTagFiles();
- ~QDocTagFiles();
-
- void generateTagFileCompounds(QXmlStreamWriter& writer, const InnerNode* inner);
- void generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inner);
- void generateTagFile(const QString& fileName, Generator* g);
-
- private:
- static QDocTagFiles* qdocTagFiles_;
- QDocDatabase* qdb_;
- Generator* gen_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlcodemarker.cpp b/src/tools/qdoc/qmlcodemarker.cpp
deleted file mode 100644
index 86fc79be66..0000000000
--- a/src/tools/qdoc/qmlcodemarker.cpp
+++ /dev/null
@@ -1,273 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- qmlcodemarker.cpp
-*/
-
-#include "qqmljsast_p.h"
-#include "qqmljsastfwd_p.h"
-#include "qqmljsengine_p.h"
-#include "qqmljslexer_p.h"
-#include "qqmljsparser_p.h"
-
-#include "atom.h"
-#include "node.h"
-#include "qmlcodemarker.h"
-#include "qmlmarkupvisitor.h"
-#include "text.h"
-#include "tree.h"
-#include "generator.h"
-
-QT_BEGIN_NAMESPACE
-
-QmlCodeMarker::QmlCodeMarker()
-{
-}
-
-QmlCodeMarker::~QmlCodeMarker()
-{
-}
-
-/*!
- Returns \c true if the \a code is recognized by the parser.
- */
-bool QmlCodeMarker::recognizeCode(const QString &code)
-{
- QQmlJS::Engine engine;
- QQmlJS::Lexer lexer(&engine);
- QQmlJS::Parser parser(&engine);
-
- QString newCode = code;
- extractPragmas(newCode);
- lexer.setCode(newCode, 1);
-
- return parser.parse();
-}
-
-/*!
- Returns \c true if \a ext is any of a list of file extensions
- for the QML language.
- */
-bool QmlCodeMarker::recognizeExtension(const QString &ext)
-{
- return ext == "qml";
-}
-
-/*!
- Returns \c true if the \a language is recognized. Only "QML" is
- recognized by this marker.
- */
-bool QmlCodeMarker::recognizeLanguage(const QString &language)
-{
- return language == "QML";
-}
-
-/*!
- Returns the type of atom used to represent QML code in the documentation.
-*/
-Atom::Type QmlCodeMarker::atomType() const
-{
- return Atom::Qml;
-}
-
-QString QmlCodeMarker::markedUpCode(const QString &code,
- const Node *relative,
- const Location &location)
-{
- return addMarkUp(code, relative, location);
-}
-
-QString QmlCodeMarker::markedUpName(const Node *node)
-{
- QString name = linkTag(node, taggedNode(node));
- if (node->type() == Node::QmlMethod)
- name += "()";
- return name;
-}
-
-QString QmlCodeMarker::markedUpFullName(const Node *node, const Node *relative)
-{
- if (node->name().isEmpty()) {
- return "global";
- }
- else {
- QString fullName;
- for (;;) {
- fullName.prepend(markedUpName(node));
- if (node->parent() == relative || node->parent()->name().isEmpty())
- break;
- fullName.prepend("<@op>::</@op>");
- node = node->parent();
- }
- return fullName;
- }
-}
-
-QString QmlCodeMarker::markedUpIncludes(const QStringList& includes)
-{
- QString code;
-
- QStringList::ConstIterator inc = includes.constBegin();
- while (inc != includes.constEnd()) {
- code += "import " + *inc + QLatin1Char('\n');
- ++inc;
- }
- Location location;
- return addMarkUp(code, 0, location);
-}
-
-QString QmlCodeMarker::functionBeginRegExp(const QString& funcName)
-{
- return QLatin1Char('^') + QRegExp::escape("function " + funcName) + QLatin1Char('$');
-
-}
-
-QString QmlCodeMarker::functionEndRegExp(const QString& /* funcName */)
-{
- return "^\\}$";
-}
-
-QString QmlCodeMarker::addMarkUp(const QString &code,
- const Node * /* relative */,
- const Location &location)
-{
- QQmlJS::Engine engine;
- QQmlJS::Lexer lexer(&engine);
-
- QString newCode = code;
- QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode);
- lexer.setCode(newCode, 1);
-
- QQmlJS::Parser parser(&engine);
- QString output;
-
- if (parser.parse()) {
- QQmlJS::AST::UiProgram *ast = parser.ast();
- // Pass the unmodified code to the visitor so that pragmas and other
- // unhandled source text can be output.
- QmlMarkupVisitor visitor(code, pragmas, &engine);
- QQmlJS::AST::Node::accept(ast, &visitor);
- output = visitor.markedUpCode();
- } else {
- location.warning(tr("Unable to parse QML snippet: \"%1\" at line %2, column %3").arg(
- parser.errorMessage()).arg(parser.errorLineNumber()).arg(
- parser.errorColumnNumber()));
- output = protect(code);
- }
-
- return output;
-}
-
-/*
- Copied and pasted from
- src/declarative/qml/qqmlscriptparser.cpp.
-*/
-static void replaceWithSpace(QString &str, int idx, int n)
-{
- QChar *data = str.data() + idx;
- const QChar space(QLatin1Char(' '));
- for (int ii = 0; ii < n; ++ii)
- *data++ = space;
-}
-
-/*
- Copied and pasted from
- src/declarative/qml/qqmlscriptparser.cpp then modified to
- return a list of removed pragmas.
-
- Searches for ".pragma <value>" or ".import <stuff>" declarations
- in \a script. Currently supported pragmas are: library
-*/
-QList<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script)
-{
- const QString pragma(QLatin1String("pragma"));
- const QString library(QLatin1String("library"));
- QList<QQmlJS::AST::SourceLocation> removed;
-
- QQmlJS::Lexer l(0);
- l.setCode(script, 0);
-
- int token = l.lex();
-
- while (true) {
- if (token != QQmlJSGrammar::T_DOT)
- return removed;
-
- int startOffset = l.tokenOffset();
- int startLine = l.tokenStartLine();
- int startColumn = l.tokenStartColumn();
-
- token = l.lex();
-
- if (token != QQmlJSGrammar::T_PRAGMA && token != QQmlJSGrammar::T_IMPORT)
- return removed;
- int endOffset = 0;
- while (startLine == l.tokenStartLine()) {
- endOffset = l.tokenLength() + l.tokenOffset();
- token = l.lex();
- }
- replaceWithSpace(script, startOffset, endOffset - startOffset);
- removed.append(QQmlJS::AST::SourceLocation(startOffset,
- endOffset - startOffset,
- startLine,
- startColumn));
-#if 0
- token = l.lex();
- if (Generator::debugging())
- qDebug() << " third token";
- if (token != QQmlJSGrammar::T_IDENTIFIER ||
- l.tokenStartLine() != startLine)
- return removed;
-
- QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength());
- int endOffset = l.tokenLength() + l.tokenOffset();
-
- token = l.lex();
- if (l.tokenStartLine() == startLine)
- return removed;
-
- if (pragmaValue == QLatin1String("library")) {
- replaceWithSpace(script, startOffset, endOffset - startOffset);
- removed.append(
- QQmlJS::AST::SourceLocation(
- startOffset, endOffset - startOffset,
- startLine, startColumn));
- } else
- return removed;
-#endif
- }
- return removed;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlcodemarker.h b/src/tools/qdoc/qmlcodemarker.h
deleted file mode 100644
index 805229e366..0000000000
--- a/src/tools/qdoc/qmlcodemarker.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- qmlcodemarker.h
-*/
-
-#ifndef QMLCODEMARKER_H
-#define QMLCODEMARKER_H
-
-#include "qqmljsastfwd_p.h"
-#include "cppcodemarker.h"
-
-QT_BEGIN_NAMESPACE
-
-class QmlCodeMarker : public CppCodeMarker
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::QmlCodeMarker)
-
-public:
- QmlCodeMarker();
- ~QmlCodeMarker();
-
- virtual bool recognizeCode(const QString &code) Q_DECL_OVERRIDE;
- virtual bool recognizeExtension(const QString &ext) Q_DECL_OVERRIDE;
- virtual bool recognizeLanguage(const QString &language) Q_DECL_OVERRIDE;
- virtual Atom::Type atomType() const Q_DECL_OVERRIDE;
- virtual QString markedUpCode(const QString &code,
- const Node *relative,
- const Location &location) Q_DECL_OVERRIDE;
-
- virtual QString markedUpName(const Node *node) Q_DECL_OVERRIDE;
- virtual QString markedUpFullName(const Node *node, const Node *relative) Q_DECL_OVERRIDE;
- virtual QString markedUpIncludes(const QStringList &includes) Q_DECL_OVERRIDE;
- virtual QString functionBeginRegExp(const QString &funcName) Q_DECL_OVERRIDE;
- virtual QString functionEndRegExp(const QString &funcName) Q_DECL_OVERRIDE;
-
- /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
- QList<QQmlJS::AST::SourceLocation> extractPragmas(QString &script);
-
-private:
- QString addMarkUp(const QString &code, const Node *relative,
- const Location &location);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp
deleted file mode 100644
index 4f5720a94d..0000000000
--- a/src/tools/qdoc/qmlcodeparser.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- qmlcodeparser.cpp
-*/
-
-#include "qqmljsast_p.h"
-#include "qqmljsastvisitor_p.h"
-#include "qmlcodeparser.h"
-#include "node.h"
-#include "config.h"
-#include "qmlvisitor.h"
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-#define COMMAND_STARTPAGE Doc::alias("startpage")
-#define COMMAND_VARIABLE Doc::alias("variable")
-
-#define COMMAND_DEPRECATED Doc::alias("deprecated")
-#define COMMAND_INGROUP Doc::alias("ingroup")
-#define COMMAND_INTERNAL Doc::alias("internal")
-#define COMMAND_OBSOLETE Doc::alias("obsolete")
-#define COMMAND_PAGEKEYWORDS Doc::alias("pagekeywords")
-#define COMMAND_PRELIMINARY Doc::alias("preliminary")
-#define COMMAND_SINCE Doc::alias("since")
-#define COMMAND_WRAPPER Doc::alias("wrapper")
-
-#define COMMAND_QMLABSTRACT Doc::alias("qmlabstract")
-#define COMMAND_QMLCLASS Doc::alias("qmlclass")
-#define COMMAND_QMLTYPE Doc::alias("qmltype")
-#define COMMAND_QMLMODULE Doc::alias("qmlmodule")
-#define COMMAND_QMLPROPERTY Doc::alias("qmlproperty")
-#define COMMAND_QMLPROPERTYGROUP Doc::alias("qmlpropertygroup")
-#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty")
-#define COMMAND_QMLINHERITS Doc::alias("inherits")
-#define COMMAND_QMLINSTANTIATES Doc::alias("instantiates")
-#define COMMAND_INQMLMODULE Doc::alias("inqmlmodule")
-#define COMMAND_QMLSIGNAL Doc::alias("qmlsignal")
-#define COMMAND_QMLATTACHEDSIGNAL Doc::alias("qmlattachedsignal")
-#define COMMAND_QMLMETHOD Doc::alias("qmlmethod")
-#define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod")
-#define COMMAND_QMLDEFAULT Doc::alias("default")
-#define COMMAND_QMLREADONLY Doc::alias("readonly")
-#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype")
-#define COMMAND_QMLMODULE Doc::alias("qmlmodule")
-
-#define COMMAND_JSTYPE Doc::alias("jstype")
-#define COMMAND_JSMODULE Doc::alias("jsmodule")
-#define COMMAND_JSPROPERTY Doc::alias("jsproperty")
-#define COMMAND_JSPROPERTYGROUP Doc::alias("jspropertygroup")
-#define COMMAND_JSATTACHEDPROPERTY Doc::alias("jsattachedproperty")
-#define COMMAND_INJSMODULE Doc::alias("injsmodule")
-#define COMMAND_JSSIGNAL Doc::alias("jssignal")
-#define COMMAND_JSATTACHEDSIGNAL Doc::alias("jsattachedsignal")
-#define COMMAND_JSMETHOD Doc::alias("jsmethod")
-#define COMMAND_JSATTACHEDMETHOD Doc::alias("jsattachedmethod")
-#define COMMAND_JSBASICTYPE Doc::alias("jsbasictype")
-#define COMMAND_JSMODULE Doc::alias("jsmodule")
-
-/*!
- Constructs the QML code parser.
- */
-QmlCodeParser::QmlCodeParser()
- : lexer( 0 ),
- parser( 0 )
-{
-}
-
-/*!
- Destroys the QML code parser.
- */
-QmlCodeParser::~QmlCodeParser()
-{
-}
-
-/*!
- Initializes the code parser base class. The \a config argument
- is passed to the initialization functions in the base class.
-
- Also creates a lexer and parser from QQmlJS.
- */
-void QmlCodeParser::initializeParser(const Config &config)
-{
- CodeParser::initializeParser(config);
-
- lexer = new QQmlJS::Lexer(&engine);
- parser = new QQmlJS::Parser(&engine);
-}
-
-/*!
- Terminates the QML code parser. Deletes the lexer and parser
- created by the constructor.
- */
-void QmlCodeParser::terminateParser()
-{
- delete lexer;
- delete parser;
-}
-
-/*!
- Returns "QML".
- */
-QString QmlCodeParser::language()
-{
- return "QML";
-}
-
-/*!
- Returns a string list containing "*.qml". This is the only
- file type parsed by the QMLN parser.
- */
-QStringList QmlCodeParser::sourceFileNameFilter()
-{
- return QStringList() << "*.qml";
-}
-
-/*!
- Parses the source file at \a filePath and inserts the contents
- into the database. The \a location is used for error reporting.
-
- If it can't open the file at \a filePath, it reports an error
- and returns without doing anything.
- */
-void QmlCodeParser::parseSourceFile(const Location& location, const QString& filePath)
-{
- QFile in(filePath);
- currentFile_ = filePath;
- if (!in.open(QIODevice::ReadOnly)) {
- location.error(tr("Cannot open QML file '%1'").arg(filePath));
- currentFile_.clear();
- return;
- }
-
- QString document = in.readAll();
- in.close();
-
- Location fileLocation(filePath);
-
- QString newCode = document;
- extractPragmas(newCode);
- lexer->setCode(newCode, 1);
-
- const QSet<QString>& topicCommandsAllowed = topicCommands();
- const QSet<QString>& otherMetacommandsAllowed = otherMetaCommands();
- const QSet<QString>& metacommandsAllowed = topicCommandsAllowed + otherMetacommandsAllowed;
-
- if (parser->parse()) {
- QQmlJS::AST::UiProgram *ast = parser->ast();
- QmlDocVisitor visitor(filePath,
- newCode,
- &engine,
- metacommandsAllowed,
- topicCommandsAllowed);
- QQmlJS::AST::Node::accept(ast, &visitor);
- }
- foreach (const QQmlJS::DiagnosticMessage &msg, parser->diagnosticMessages()) {
- qDebug().nospace() << qPrintable(filePath) << ':' << msg.loc.startLine
- << ": QML syntax error at col " << msg.loc.startColumn
- << ": " << qPrintable(msg.message);
- }
- currentFile_.clear();
-}
-
-/*!
- Performs cleanup after qdoc is done parsing all the QML files.
- Currently, no cleanup is required.
- */
-void QmlCodeParser::doneParsingSourceFiles()
-{
-}
-
-static QSet<QString> topicCommands_;
-/*!
- Returns the set of strings representing the topic commands.
- */
-const QSet<QString>& QmlCodeParser::topicCommands()
-{
- if (topicCommands_.isEmpty()) {
- topicCommands_ << COMMAND_VARIABLE
- << COMMAND_QMLCLASS
- << COMMAND_QMLTYPE
- << COMMAND_QMLPROPERTY
- << COMMAND_QMLPROPERTYGROUP
- << COMMAND_QMLATTACHEDPROPERTY
- << COMMAND_QMLSIGNAL
- << COMMAND_QMLATTACHEDSIGNAL
- << COMMAND_QMLMETHOD
- << COMMAND_QMLATTACHEDMETHOD
- << COMMAND_QMLBASICTYPE
- << COMMAND_JSTYPE
- << COMMAND_JSPROPERTY
- << COMMAND_JSPROPERTYGROUP
- << COMMAND_JSATTACHEDPROPERTY
- << COMMAND_JSSIGNAL
- << COMMAND_JSATTACHEDSIGNAL
- << COMMAND_JSMETHOD
- << COMMAND_JSATTACHEDMETHOD
- << COMMAND_JSBASICTYPE;
- }
- return topicCommands_;
-}
-
-static QSet<QString> otherMetaCommands_;
-/*!
- Returns the set of strings representing the common metacommands
- plus some other metacommands.
- */
-const QSet<QString>& QmlCodeParser::otherMetaCommands()
-{
- if (otherMetaCommands_.isEmpty()) {
- otherMetaCommands_ = commonMetaCommands();
- otherMetaCommands_ << COMMAND_STARTPAGE
- << COMMAND_QMLINHERITS
- << COMMAND_QMLDEFAULT
- << COMMAND_QMLREADONLY
- << COMMAND_DEPRECATED
- << COMMAND_INGROUP
- << COMMAND_INTERNAL
- << COMMAND_OBSOLETE
- << COMMAND_PRELIMINARY
- << COMMAND_SINCE
- << COMMAND_QMLABSTRACT
- << COMMAND_INQMLMODULE
- << COMMAND_INJSMODULE
- << COMMAND_WRAPPER;
- }
- return otherMetaCommands_;
-}
-
-/*!
- Copy and paste from src/declarative/qml/qdeclarativescriptparser.cpp.
- This function blanks out the section of the \a str beginning at \a idx
- and running for \a n characters.
-*/
-static void replaceWithSpace(QString &str, int idx, int n)
-{
- QChar *data = str.data() + idx;
- const QChar space(QLatin1Char(' '));
- for (int ii = 0; ii < n; ++ii)
- *data++ = space;
-}
-
-/*!
- Copy & paste from src/declarative/qml/qdeclarativescriptparser.cpp,
- then modified to return no values.
-
- Searches for ".pragma <value>" declarations within \a script.
- Currently supported pragmas are: library
-*/
-void QmlCodeParser::extractPragmas(QString &script)
-{
- const QString pragma(QLatin1String("pragma"));
- const QString library(QLatin1String("library"));
-
- QQmlJS::Lexer l(0);
- l.setCode(script, 0);
-
- int token = l.lex();
-
- while (true) {
- if (token != QQmlJSGrammar::T_DOT)
- return;
-
- int startOffset = l.tokenOffset();
- int startLine = l.tokenStartLine();
-
- token = l.lex();
-
- if (token != QQmlJSGrammar::T_IDENTIFIER ||
- l.tokenStartLine() != startLine ||
- script.mid(l.tokenOffset(), l.tokenLength()) != pragma)
- return;
-
- token = l.lex();
-
- if (token != QQmlJSGrammar::T_IDENTIFIER ||
- l.tokenStartLine() != startLine)
- return;
-
- QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength());
- int endOffset = l.tokenLength() + l.tokenOffset();
-
- token = l.lex();
- if (l.tokenStartLine() == startLine)
- return;
-
- if (pragmaValue == QLatin1String("library"))
- replaceWithSpace(script, startOffset, endOffset - startOffset);
- else
- return;
- }
- return;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlcodeparser.h b/src/tools/qdoc/qmlcodeparser.h
deleted file mode 100644
index da5d70568d..0000000000
--- a/src/tools/qdoc/qmlcodeparser.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- qmlcodeparser.h
-*/
-
-#ifndef QMLCODEPARSER_H
-#define QMLCODEPARSER_H
-
-#include <qset.h>
-#include "qqmljsengine_p.h"
-#include "qqmljslexer_p.h"
-#include "qqmljsparser_p.h"
-
-#include "codeparser.h"
-
-QT_BEGIN_NAMESPACE
-
-class Config;
-class Node;
-class QString;
-
-class QmlCodeParser : public CodeParser
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::QmlCodeParser)
-
-public:
- QmlCodeParser();
- virtual ~QmlCodeParser();
-
- virtual void initializeParser(const Config& config) Q_DECL_OVERRIDE;
- virtual void terminateParser() Q_DECL_OVERRIDE;
- virtual QString language() Q_DECL_OVERRIDE;
- virtual QStringList sourceFileNameFilter() Q_DECL_OVERRIDE;
- virtual void parseSourceFile(const Location& location, const QString& filePath) Q_DECL_OVERRIDE;
- virtual void doneParsingSourceFiles() Q_DECL_OVERRIDE;
-
- /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
- void extractPragmas(QString &script);
-
-protected:
- const QSet<QString>& topicCommands();
- const QSet<QString>& otherMetaCommands();
-
-private:
- QQmlJS::Engine engine;
- QQmlJS::Lexer *lexer;
- QQmlJS::Parser *parser;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlmarkupvisitor.cpp b/src/tools/qdoc/qmlmarkupvisitor.cpp
deleted file mode 100644
index ee86b6de32..0000000000
--- a/src/tools/qdoc/qmlmarkupvisitor.cpp
+++ /dev/null
@@ -1,843 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qstringlist.h>
-#include <qglobal.h>
-#include "qqmljsast_p.h"
-#include "qqmljsastfwd_p.h"
-#include "qqmljsengine_p.h"
-
-#include "qmlmarkupvisitor.h"
-
-QT_BEGIN_NAMESPACE
-
-QmlMarkupVisitor::QmlMarkupVisitor(const QString &source,
- const QList<QQmlJS::AST::SourceLocation> &pragmas,
- QQmlJS::Engine *engine)
-{
- this->source = source;
- this->engine = engine;
-
- cursor = 0;
- extraIndex = 0;
-
- // Merge the lists of locations of pragmas and comments in the source code.
- int i = 0;
- int j = 0;
- while (i < engine->comments().length() && j < pragmas.length()) {
- if (engine->comments()[i].offset < pragmas[j].offset) {
- extraTypes.append(Comment);
- extraLocations.append(engine->comments()[i]);
- ++i;
- } else {
- extraTypes.append(Pragma);
- extraLocations.append(engine->comments()[j]);
- ++j;
- }
- }
-
- while (i < engine->comments().length()) {
- extraTypes.append(Comment);
- extraLocations.append(engine->comments()[i]);
- ++i;
- }
-
- while (j < pragmas.length()) {
- extraTypes.append(Pragma);
- extraLocations.append(pragmas[j]);
- ++j;
- }
-}
-
-QmlMarkupVisitor::~QmlMarkupVisitor()
-{
-}
-
-// The protect() function is a copy of the one from CppCodeMarker.
-
-static const QString samp = QLatin1String("&amp;");
-static const QString slt = QLatin1String("&lt;");
-static const QString sgt = QLatin1String("&gt;");
-static const QString squot = QLatin1String("&quot;");
-
-QString QmlMarkupVisitor::protect(const QString& str)
-{
- int n = str.length();
- QString marked;
- marked.reserve(n * 2 + 30);
- const QChar *data = str.constData();
- for (int i = 0; i != n; ++i) {
- switch (data[i].unicode()) {
- case '&': marked += samp; break;
- case '<': marked += slt; break;
- case '>': marked += sgt; break;
- case '"': marked += squot; break;
- default : marked += data[i];
- }
- }
- return marked;
-}
-
-QString QmlMarkupVisitor::markedUpCode()
-{
- if (int(cursor) < source.length())
- addExtra(cursor, source.length());
-
- return output;
-}
-
-void QmlMarkupVisitor::addExtra(quint32 start, quint32 finish)
-{
- if (extraIndex >= extraLocations.length()) {
- QString extra = source.mid(start, finish - start);
- if (extra.trimmed().isEmpty())
- output += extra;
- else
- output += protect(extra); // text that should probably have been caught by the parser
-
- cursor = finish;
- return;
- }
-
- while (extraIndex < extraLocations.length()) {
- if (extraTypes[extraIndex] == Comment) {
- if (extraLocations[extraIndex].offset - 2 >= start)
- break;
- } else {
- if (extraLocations[extraIndex].offset >= start)
- break;
- }
- extraIndex++;
- }
-
- quint32 i = start;
- while (i < finish && extraIndex < extraLocations.length()) {
- quint32 j = extraLocations[extraIndex].offset - 2;
- if (i <= j && j < finish) {
- if (i < j)
- output += protect(source.mid(i, j - i));
-
- quint32 l = extraLocations[extraIndex].length;
- if (extraTypes[extraIndex] == Comment) {
- if (source.mid(j, 2) == QLatin1String("/*"))
- l += 4;
- else
- l += 2;
- output += QLatin1String("<@comment>");
- output += protect(source.mid(j, l));
- output += QLatin1String("</@comment>");
- } else
- output += protect(source.mid(j, l));
-
- extraIndex++;
- i = j + l;
- } else
- break;
- }
-
- QString extra = source.mid(i, finish - i);
- if (extra.trimmed().isEmpty())
- output += extra;
- else
- output += protect(extra); // text that should probably have been caught by the parser
-
- cursor = finish;
-}
-
-void QmlMarkupVisitor::addMarkedUpToken(
- QQmlJS::AST::SourceLocation &location, const QString &tagName,
- const QHash<QString, QString> &attributes)
-{
- if (!location.isValid())
- return;
-
- if (cursor < location.offset)
- addExtra(cursor, location.offset);
- else if (cursor > location.offset)
- return;
-
- output += QString(QLatin1String("<@%1")).arg(tagName);
- foreach (const QString &key, attributes)
- output += QString(QLatin1String(" %1=\"%2\"")).arg(key).arg(attributes[key]);
- output += QString(QLatin1String(">%2</@%3>")).arg(protect(sourceText(location)), tagName);
- cursor += location.length;
-}
-
-QString QmlMarkupVisitor::sourceText(QQmlJS::AST::SourceLocation &location)
-{
- return source.mid(location.offset, location.length);
-}
-
-void QmlMarkupVisitor::addVerbatim(QQmlJS::AST::SourceLocation first,
- QQmlJS::AST::SourceLocation last)
-{
- if (!first.isValid())
- return;
-
- quint32 start = first.begin();
- quint32 finish;
- if (last.isValid())
- finish = last.end();
- else
- finish = first.end();
-
- if (cursor < start)
- addExtra(cursor, start);
- else if (cursor > start)
- return;
-
- QString text = source.mid(start, finish - start);
- output += protect(text);
- cursor = finish;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiImport *uiimport)
-{
- addVerbatim(uiimport->importToken);
- if (!uiimport->importUri)
- addMarkedUpToken(uiimport->fileNameToken, QLatin1String("headerfile"));
- return false;
-}
-
-void QmlMarkupVisitor::endVisit(QQmlJS::AST::UiImport *uiimport)
-{
- addVerbatim(uiimport->versionToken);
- addVerbatim(uiimport->asToken);
- addMarkedUpToken(uiimport->importIdToken, QLatin1String("headerfile"));
- addVerbatim(uiimport->semicolonToken);
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiPublicMember *member)
-{
- if (member->type == QQmlJS::AST::UiPublicMember::Property) {
- addVerbatim(member->defaultToken);
- addVerbatim(member->readonlyToken);
- addVerbatim(member->propertyToken);
- addVerbatim(member->typeModifierToken);
- addMarkedUpToken(member->typeToken, QLatin1String("type"));
- addMarkedUpToken(member->identifierToken, QLatin1String("name"));
- addVerbatim(member->colonToken);
- if (member->binding)
- QQmlJS::AST::Node::accept(member->binding, this);
- else if (member->statement)
- QQmlJS::AST::Node::accept(member->statement, this);
- } else {
- addVerbatim(member->propertyToken);
- addVerbatim(member->typeModifierToken);
- addMarkedUpToken(member->typeToken, QLatin1String("type"));
- //addVerbatim(member->identifierToken);
- QQmlJS::AST::Node::accept(member->parameters, this);
- }
- addVerbatim(member->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiObjectInitializer *initializer)
-{
- addVerbatim(initializer->lbraceToken, initializer->lbraceToken);
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QQmlJS::AST::UiObjectInitializer *initializer)
-{
- addVerbatim(initializer->rbraceToken, initializer->rbraceToken);
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiObjectBinding *binding)
-{
- QQmlJS::AST::Node::accept(binding->qualifiedId, this);
- addVerbatim(binding->colonToken);
- QQmlJS::AST::Node::accept(binding->qualifiedTypeNameId, this);
- QQmlJS::AST::Node::accept(binding->initializer, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiScriptBinding *binding)
-{
- QQmlJS::AST::Node::accept(binding->qualifiedId, this);
- addVerbatim(binding->colonToken);
- QQmlJS::AST::Node::accept(binding->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiArrayBinding *binding)
-{
- QQmlJS::AST::Node::accept(binding->qualifiedId, this);
- addVerbatim(binding->colonToken);
- addVerbatim(binding->lbracketToken);
- QQmlJS::AST::Node::accept(binding->members, this);
- addVerbatim(binding->rbracketToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiArrayMemberList *list)
-{
- for (QQmlJS::AST::UiArrayMemberList *it = list; it; it = it->next) {
- QQmlJS::AST::Node::accept(it->member, this);
- //addVerbatim(it->commaToken);
- }
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiQualifiedId *id)
-{
- addMarkedUpToken(id->identifierToken, QLatin1String("name"));
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ThisExpression *expression)
-{
- addVerbatim(expression->thisToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::IdentifierExpression *identifier)
-{
- addMarkedUpToken(identifier->identifierToken, QLatin1String("name"));
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::NullExpression *null)
-{
- addMarkedUpToken(null->nullToken, QLatin1String("number"));
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::TrueLiteral *literal)
-{
- addMarkedUpToken(literal->trueToken, QLatin1String("number"));
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::FalseLiteral *literal)
-{
- addMarkedUpToken(literal->falseToken, QLatin1String("number"));
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::NumericLiteral *literal)
-{
- addMarkedUpToken(literal->literalToken, QLatin1String("number"));
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::StringLiteral *literal)
-{
- addMarkedUpToken(literal->literalToken, QLatin1String("string"));
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::RegExpLiteral *literal)
-{
- addVerbatim(literal->literalToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ArrayLiteral *literal)
-{
- addVerbatim(literal->lbracketToken);
- QQmlJS::AST::Node::accept(literal->elements, this);
- addVerbatim(literal->rbracketToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ObjectLiteral *literal)
-{
- addVerbatim(literal->lbraceToken);
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QQmlJS::AST::ObjectLiteral *literal)
-{
- addVerbatim(literal->rbraceToken);
-}
-
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ElementList *list)
-{
- for (QQmlJS::AST::ElementList *it = list; it; it = it->next) {
- QQmlJS::AST::Node::accept(it->expression, this);
- //addVerbatim(it->commaToken);
- }
- QQmlJS::AST::Node::accept(list->elision, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::Elision *elision)
-{
- addVerbatim(elision->commaToken, elision->commaToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::PropertyNameAndValue *list)
-{
- QQmlJS::AST::Node::accept(list->name, this);
- addVerbatim(list->colonToken, list->colonToken);
- QQmlJS::AST::Node::accept(list->value, this);
- addVerbatim(list->commaToken, list->commaToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ArrayMemberExpression *expression)
-{
- QQmlJS::AST::Node::accept(expression->base, this);
- addVerbatim(expression->lbracketToken);
- QQmlJS::AST::Node::accept(expression->expression, this);
- addVerbatim(expression->rbracketToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::FieldMemberExpression *expression)
-{
- QQmlJS::AST::Node::accept(expression->base, this);
- addVerbatim(expression->dotToken);
- addMarkedUpToken(expression->identifierToken, QLatin1String("name"));
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::NewMemberExpression *expression)
-{
- addVerbatim(expression->newToken);
- QQmlJS::AST::Node::accept(expression->base, this);
- addVerbatim(expression->lparenToken);
- QQmlJS::AST::Node::accept(expression->arguments, this);
- addVerbatim(expression->rparenToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::NewExpression *expression)
-{
- addVerbatim(expression->newToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ArgumentList *list)
-{
- addVerbatim(list->commaToken, list->commaToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::PostIncrementExpression *expression)
-{
- addVerbatim(expression->incrementToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::PostDecrementExpression *expression)
-{
- addVerbatim(expression->decrementToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::DeleteExpression *expression)
-{
- addVerbatim(expression->deleteToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::VoidExpression *expression)
-{
- addVerbatim(expression->voidToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::TypeOfExpression *expression)
-{
- addVerbatim(expression->typeofToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::PreIncrementExpression *expression)
-{
- addVerbatim(expression->incrementToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::PreDecrementExpression *expression)
-{
- addVerbatim(expression->decrementToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UnaryPlusExpression *expression)
-{
- addVerbatim(expression->plusToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UnaryMinusExpression *expression)
-{
- addVerbatim(expression->minusToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::TildeExpression *expression)
-{
- addVerbatim(expression->tildeToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::NotExpression *expression)
-{
- addVerbatim(expression->notToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::BinaryExpression *expression)
-{
- QQmlJS::AST::Node::accept(expression->left, this);
- addMarkedUpToken(expression->operatorToken, QLatin1String("op"));
- QQmlJS::AST::Node::accept(expression->right, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ConditionalExpression *expression)
-{
- QQmlJS::AST::Node::accept(expression->expression, this);
- addVerbatim(expression->questionToken);
- QQmlJS::AST::Node::accept(expression->ok, this);
- addVerbatim(expression->colonToken);
- QQmlJS::AST::Node::accept(expression->ko, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::Expression *expression)
-{
- QQmlJS::AST::Node::accept(expression->left, this);
- addVerbatim(expression->commaToken);
- QQmlJS::AST::Node::accept(expression->right, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::Block *block)
-{
- addVerbatim(block->lbraceToken);
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QQmlJS::AST::Block *block)
-{
- addVerbatim(block->rbraceToken);
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::VariableStatement *statement)
-{
- addVerbatim(statement->declarationKindToken);
- QQmlJS::AST::Node::accept(statement->declarations, this);
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::VariableDeclarationList *list)
-{
- for (QQmlJS::AST::VariableDeclarationList *it = list; it; it = it->next) {
- QQmlJS::AST::Node::accept(it->declaration, this);
- addVerbatim(it->commaToken);
- }
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::VariableDeclaration *declaration)
-{
- addMarkedUpToken(declaration->identifierToken, QLatin1String("name"));
- QQmlJS::AST::Node::accept(declaration->expression, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::EmptyStatement *statement)
-{
- addVerbatim(statement->semicolonToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ExpressionStatement *statement)
-{
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::IfStatement *statement)
-{
- addMarkedUpToken(statement->ifToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->ok, this);
- if (statement->ko) {
- addMarkedUpToken(statement->elseToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->ko, this);
- }
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::DoWhileStatement *statement)
-{
- addMarkedUpToken(statement->doToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->statement, this);
- addMarkedUpToken(statement->whileToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::WhileStatement *statement)
-{
- addMarkedUpToken(statement->whileToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ForStatement *statement)
-{
- addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->initialiser, this);
- addVerbatim(statement->firstSemicolonToken);
- QQmlJS::AST::Node::accept(statement->condition, this);
- addVerbatim(statement->secondSemicolonToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::LocalForStatement *statement)
-{
- addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- addMarkedUpToken(statement->varToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->declarations, this);
- addVerbatim(statement->firstSemicolonToken);
- QQmlJS::AST::Node::accept(statement->condition, this);
- addVerbatim(statement->secondSemicolonToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ForEachStatement *statement)
-{
- addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->initialiser, this);
- addVerbatim(statement->inToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::LocalForEachStatement *statement)
-{
- addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- addMarkedUpToken(statement->varToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->declaration, this);
- addVerbatim(statement->inToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ContinueStatement *statement)
-{
- addMarkedUpToken(statement->continueToken, QLatin1String("keyword"));
- addMarkedUpToken(statement->identifierToken, QLatin1String("name"));
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::BreakStatement *statement)
-{
- addMarkedUpToken(statement->breakToken, QLatin1String("keyword"));
- addMarkedUpToken(statement->identifierToken, QLatin1String("name"));
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ReturnStatement *statement)
-{
- addMarkedUpToken(statement->returnToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::WithStatement *statement)
-{
- addMarkedUpToken(statement->withToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::CaseBlock *block)
-{
- addVerbatim(block->lbraceToken);
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QQmlJS::AST::CaseBlock *block)
-{
- addVerbatim(block->rbraceToken, block->rbraceToken);
-}
-
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::SwitchStatement *statement)
-{
- addMarkedUpToken(statement->switchToken, QLatin1String("keyword"));
- addVerbatim(statement->lparenToken);
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->rparenToken);
- QQmlJS::AST::Node::accept(statement->block, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::CaseClause *clause)
-{
- addMarkedUpToken(clause->caseToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(clause->expression, this);
- addVerbatim(clause->colonToken);
- QQmlJS::AST::Node::accept(clause->statements, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::DefaultClause *clause)
-{
- addMarkedUpToken(clause->defaultToken, QLatin1String("keyword"));
- addVerbatim(clause->colonToken, clause->colonToken);
- return true;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::LabelledStatement *statement)
-{
- addMarkedUpToken(statement->identifierToken, QLatin1String("name"));
- addVerbatim(statement->colonToken);
- QQmlJS::AST::Node::accept(statement->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::ThrowStatement *statement)
-{
- addMarkedUpToken(statement->throwToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->expression, this);
- addVerbatim(statement->semicolonToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::Catch *c)
-{
- addMarkedUpToken(c->catchToken, QLatin1String("keyword"));
- addVerbatim(c->lparenToken);
- addMarkedUpToken(c->identifierToken, QLatin1String("name"));
- addVerbatim(c->rparenToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::Finally *f)
-{
- addMarkedUpToken(f->finallyToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(f->statement, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::TryStatement *statement)
-{
- addMarkedUpToken(statement->tryToken, QLatin1String("keyword"));
- QQmlJS::AST::Node::accept(statement->statement, this);
- QQmlJS::AST::Node::accept(statement->catchExpression, this);
- QQmlJS::AST::Node::accept(statement->finallyExpression, this);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::FunctionExpression *expression)
-{
- addMarkedUpToken(expression->functionToken, QLatin1String("keyword"));
- addMarkedUpToken(expression->identifierToken, QLatin1String("name"));
- addVerbatim(expression->lparenToken);
- QQmlJS::AST::Node::accept(expression->formals, this);
- addVerbatim(expression->rparenToken);
- addVerbatim(expression->lbraceToken);
- QQmlJS::AST::Node::accept(expression->body, this);
- addVerbatim(expression->rbraceToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::FunctionDeclaration *declaration)
-{
- addMarkedUpToken(declaration->functionToken, QLatin1String("keyword"));
- addMarkedUpToken(declaration->identifierToken, QLatin1String("name"));
- addVerbatim(declaration->lparenToken);
- QQmlJS::AST::Node::accept(declaration->formals, this);
- addVerbatim(declaration->rparenToken);
- addVerbatim(declaration->lbraceToken);
- QQmlJS::AST::Node::accept(declaration->body, this);
- addVerbatim(declaration->rbraceToken);
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::FormalParameterList *list)
-{
- addVerbatim(list->commaToken);
- addMarkedUpToken(list->identifierToken, QLatin1String("name"));
- return false;
-}
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::DebuggerStatement *statement)
-{
- addVerbatim(statement->debuggerToken);
- addVerbatim(statement->semicolonToken);
- return true;
-}
-
-// Elements and items are represented by UiObjectDefinition nodes.
-
-bool QmlMarkupVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
-{
- QHash<QString, QString> attributes;
- addMarkedUpToken(definition->qualifiedTypeNameId->identifierToken, QLatin1String("type"));
- QQmlJS::AST::Node::accept(definition->initializer, this);
- return false;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlmarkupvisitor.h b/src/tools/qdoc/qmlmarkupvisitor.h
deleted file mode 100644
index 04d6a57564..0000000000
--- a/src/tools/qdoc/qmlmarkupvisitor.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 QMLMARKUPVISITOR_H
-#define QMLMARKUPVISITOR_H
-
-#include <qstring.h>
-#include "qqmljsastvisitor_p.h"
-#include "node.h"
-#include "tree.h"
-
-QT_BEGIN_NAMESPACE
-
-class QmlMarkupVisitor : public QQmlJS::AST::Visitor
-{
-public:
- enum ExtraType{
- Comment,
- Pragma
- };
-
- QmlMarkupVisitor(const QString &code,
- const QList<QQmlJS::AST::SourceLocation> &pragmas,
- QQmlJS::Engine *engine);
- virtual ~QmlMarkupVisitor();
-
- QString markedUpCode();
-
- virtual bool visit(QQmlJS::AST::UiImport *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::UiImport *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::UiPublicMember *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiObjectDefinition *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::UiObjectInitializer *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::UiObjectInitializer *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::UiObjectBinding *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiScriptBinding *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiArrayBinding *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiArrayMemberList *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiQualifiedId *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::ThisExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::IdentifierExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::NullExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::TrueLiteral *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::FalseLiteral *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::NumericLiteral *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::StringLiteral *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::RegExpLiteral *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ArrayLiteral *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::ObjectLiteral *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::ObjectLiteral *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::ElementList *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::Elision *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::PropertyNameAndValue *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ArrayMemberExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::FieldMemberExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::NewMemberExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::NewExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ArgumentList *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::PostIncrementExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::PostDecrementExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::DeleteExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::VoidExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::TypeOfExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::PreIncrementExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::PreDecrementExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UnaryPlusExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UnaryMinusExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::TildeExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::NotExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::BinaryExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ConditionalExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::Expression *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::Block *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::Block *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::VariableStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::VariableDeclarationList *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::VariableDeclaration *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::EmptyStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ExpressionStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::IfStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::DoWhileStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::WhileStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ForStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::LocalForStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ForEachStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::LocalForEachStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ContinueStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::BreakStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ReturnStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::WithStatement *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::CaseBlock *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::CaseBlock *) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::SwitchStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::CaseClause *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::DefaultClause *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::LabelledStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::ThrowStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::TryStatement *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::Catch *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::Finally *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::FunctionDeclaration *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::FunctionExpression *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::FormalParameterList *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::DebuggerStatement *) Q_DECL_OVERRIDE;
-
-protected:
- QString protect(const QString &string);
-
-private:
- typedef QHash<QString, QString> StringHash;
- void addExtra(quint32 start, quint32 finish);
- void addMarkedUpToken(QQmlJS::AST::SourceLocation &location,
- const QString &text,
- const StringHash &attributes = StringHash());
- void addVerbatim(QQmlJS::AST::SourceLocation first,
- QQmlJS::AST::SourceLocation last = QQmlJS::AST::SourceLocation());
- QString sourceText(QQmlJS::AST::SourceLocation &location);
-
- QQmlJS::Engine *engine;
- QList<ExtraType> extraTypes;
- QList<QQmlJS::AST::SourceLocation> extraLocations;
- QString source;
- QString output;
- quint32 cursor;
- int extraIndex;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlparser/parser.pri b/src/tools/qdoc/qmlparser/parser.pri
deleted file mode 100644
index e5b8ae2749..0000000000
--- a/src/tools/qdoc/qmlparser/parser.pri
+++ /dev/null
@@ -1,22 +0,0 @@
-HEADERS += \
- $$PWD/qqmljsast_p.h \
- $$PWD/qqmljsastfwd_p.h \
- $$PWD/qqmljsastvisitor_p.h \
- $$PWD/qqmljsengine_p.h \
- $$PWD/qqmljsgrammar_p.h \
- $$PWD/qqmljslexer_p.h \
- $$PWD/qqmljsmemorypool_p.h \
- $$PWD/qqmljsparser_p.h \
- $$PWD/qqmljsglobal_p.h \
- $$PWD/qqmljskeywords_p.h \
-
-SOURCES += \
- $$PWD/qqmljsast.cpp \
- $$PWD/qqmljsastvisitor.cpp \
- $$PWD/qqmljsengine_p.cpp \
- $$PWD/qqmljsgrammar.cpp \
- $$PWD/qqmljslexer.cpp \
- $$PWD/qqmljsparser.cpp \
-
-OTHER_FILES += \
- $$PWD/qqmljs.g
diff --git a/src/tools/qdoc/qmlparser/qqmljs.g b/src/tools/qdoc/qmlparser/qqmljs.g
deleted file mode 100644
index ae430e942d..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljs.g
+++ /dev/null
@@ -1,3142 +0,0 @@
-----------------------------------------------------------------------------
---
--- Copyright (C) 2015 The Qt Company Ltd.
--- Contact: http://www.qt.io/licensing/
---
--- This file is part of the QtQml module 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$
---
-----------------------------------------------------------------------------
-
-%parser QQmlJSGrammar
-%decl qqmljsparser_p.h
-%impl qqmljsparser.cpp
-%expect 5
-%expect-rr 2
-
-%token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
-%token T_BREAK "break" T_CASE "case" T_CATCH "catch"
-%token T_COLON ":" T_COMMA "," T_CONTINUE "continue"
-%token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/"
-%token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "."
-%token T_ELSE "else" T_EQ "=" T_EQ_EQ "=="
-%token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for"
-%token T_FUNCTION "function" T_GE ">=" T_GT ">"
-%token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>"
-%token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if"
-%token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{"
-%token T_LBRACKET "[" T_LE "<=" T_LPAREN "("
-%token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<="
-%token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--"
-%token T_NEW "new" T_NOT "!" T_NOT_EQ "!="
-%token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|"
-%token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+"
-%token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?"
-%token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%"
-%token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")"
-%token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*"
-%token T_STAR_EQ "*=" T_STRING_LITERAL "string literal"
-%token T_PROPERTY "property" T_SIGNAL "signal" T_READONLY "readonly"
-%token T_SWITCH "switch" T_THIS "this" T_THROW "throw"
-%token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof"
-%token T_VAR "var" T_VOID "void" T_WHILE "while"
-%token T_WITH "with" T_XOR "^" T_XOR_EQ "^="
-%token T_NULL "null" T_TRUE "true" T_FALSE "false"
-%token T_CONST "const"
-%token T_DEBUGGER "debugger"
-%token T_RESERVED_WORD "reserved word"
-%token T_MULTILINE_STRING_LITERAL "multiline string literal"
-%token T_COMMENT "comment"
-%token T_COMPATIBILITY_SEMICOLON
-
---- context keywords.
-%token T_PUBLIC "public"
-%token T_IMPORT "import"
-%token T_PRAGMA "pragma"
-%token T_AS "as"
-%token T_ON "on"
-%token T_GET "get"
-%token T_SET "set"
-
-%token T_ERROR
-
---- feed tokens
-%token T_FEED_UI_PROGRAM
-%token T_FEED_UI_OBJECT_MEMBER
-%token T_FEED_JS_STATEMENT
-%token T_FEED_JS_EXPRESSION
-%token T_FEED_JS_SOURCE_ELEMENT
-%token T_FEED_JS_PROGRAM
-
-%nonassoc SHIFT_THERE
-%nonassoc T_IDENTIFIER T_COLON T_SIGNAL T_PROPERTY T_READONLY T_ON T_SET T_GET
-%nonassoc REDUCE_HERE
-
-%start TopLevel
-
-/./****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 "qqmljsengine_p.h"
-#include "qqmljslexer_p.h"
-#include "qqmljsast_p.h"
-#include "qqmljsmemorypool_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qcoreapplication.h>
-
-#include <string.h>
-
-./
-
-/:/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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$
-**
-****************************************************************************/
-
-
-//
-// 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.
-//
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is automatically generated from qqmljs.g.
-// Changes should be made to that file, not here. Any change to this file will
-// be lost!
-//
-// To regenerate this file, run:
-// qlalr --no-debug --no-lines --qt qqmljs.g
-//
-
-#ifndef QQMLJSPARSER_P_H
-#define QQMLJSPARSER_P_H
-
-#include "qqmljsglobal_p.h"
-#include "qqmljsgrammar_p.h"
-#include "qqmljsast_p.h"
-#include "qqmljsengine_p.h"
-
-#include <QtCore/qlist.h>
-#include <QtCore/qstring.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-class Engine;
-
-class QML_PARSER_EXPORT Parser: protected $table
-{
-public:
- union Value {
- int ival;
- double dval;
- AST::ArgumentList *ArgumentList;
- AST::CaseBlock *CaseBlock;
- AST::CaseClause *CaseClause;
- AST::CaseClauses *CaseClauses;
- AST::Catch *Catch;
- AST::DefaultClause *DefaultClause;
- AST::ElementList *ElementList;
- AST::Elision *Elision;
- AST::ExpressionNode *Expression;
- AST::Finally *Finally;
- AST::FormalParameterList *FormalParameterList;
- AST::FunctionBody *FunctionBody;
- AST::FunctionDeclaration *FunctionDeclaration;
- AST::Node *Node;
- AST::PropertyName *PropertyName;
- AST::PropertyAssignment *PropertyAssignment;
- AST::PropertyAssignmentList *PropertyAssignmentList;
- AST::SourceElement *SourceElement;
- AST::SourceElements *SourceElements;
- AST::Statement *Statement;
- AST::StatementList *StatementList;
- AST::Block *Block;
- AST::VariableDeclaration *VariableDeclaration;
- AST::VariableDeclarationList *VariableDeclarationList;
-
- AST::UiProgram *UiProgram;
- AST::UiHeaderItemList *UiHeaderItemList;
- AST::UiPragma *UiPragma;
- AST::UiImport *UiImport;
- AST::UiParameterList *UiParameterList;
- AST::UiPublicMember *UiPublicMember;
- AST::UiObjectDefinition *UiObjectDefinition;
- AST::UiObjectInitializer *UiObjectInitializer;
- AST::UiObjectBinding *UiObjectBinding;
- AST::UiScriptBinding *UiScriptBinding;
- AST::UiArrayBinding *UiArrayBinding;
- AST::UiObjectMember *UiObjectMember;
- AST::UiObjectMemberList *UiObjectMemberList;
- AST::UiArrayMemberList *UiArrayMemberList;
- AST::UiQualifiedId *UiQualifiedId;
- AST::UiQualifiedPragmaId *UiQualifiedPragmaId;
- };
-
-public:
- Parser(Engine *engine);
- ~Parser();
-
- // parse a UI program
- bool parse() { return parse(T_FEED_UI_PROGRAM); }
- bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
- bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
- bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
- bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
- bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
-
- AST::UiProgram *ast() const
- { return AST::cast<AST::UiProgram *>(program); }
-
- AST::Statement *statement() const
- {
- if (! program)
- return 0;
-
- return program->statementCast();
- }
-
- AST::ExpressionNode *expression() const
- {
- if (! program)
- return 0;
-
- return program->expressionCast();
- }
-
- AST::UiObjectMember *uiObjectMember() const
- {
- if (! program)
- return 0;
-
- return program->uiObjectMemberCast();
- }
-
- AST::Node *rootNode() const
- { return program; }
-
- QList<DiagnosticMessage> diagnosticMessages() const
- { return diagnostic_messages; }
-
- inline DiagnosticMessage diagnosticMessage() const
- {
- foreach (const DiagnosticMessage &d, diagnostic_messages) {
- if (d.kind != DiagnosticMessage::Warning)
- return d;
- }
-
- return DiagnosticMessage();
- }
-
- inline QString errorMessage() const
- { return diagnosticMessage().message; }
-
- inline int errorLineNumber() const
- { return diagnosticMessage().loc.startLine; }
-
- inline int errorColumnNumber() const
- { return diagnosticMessage().loc.startColumn; }
-
-protected:
- bool parse(int startToken);
-
- void reallocateStack();
-
- inline Value &sym(int index)
- { return sym_stack [tos + index - 1]; }
-
- inline QStringRef &stringRef(int index)
- { return string_stack [tos + index - 1]; }
-
- inline AST::SourceLocation &loc(int index)
- { return location_stack [tos + index - 1]; }
-
- AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
- AST::UiQualifiedPragmaId *reparseAsQualifiedPragmaId(AST::ExpressionNode *expr);
-
-protected:
- Engine *driver;
- MemoryPool *pool;
- int tos;
- int stack_size;
- Value *sym_stack;
- int *state_stack;
- AST::SourceLocation *location_stack;
- QStringRef *string_stack;
-
- AST::Node *program;
-
- // error recovery
- enum { TOKEN_BUFFER_SIZE = 3 };
-
- struct SavedToken {
- int token;
- double dval;
- AST::SourceLocation loc;
- QStringRef spell;
- };
-
- double yylval;
- QStringRef yytokenspell;
- AST::SourceLocation yylloc;
- AST::SourceLocation yyprevlloc;
-
- SavedToken token_buffer[TOKEN_BUFFER_SIZE];
- SavedToken *first_token;
- SavedToken *last_token;
-
- QList<DiagnosticMessage> diagnostic_messages;
-};
-
-} // end of namespace QQmlJS
-
-
-:/
-
-
-/.
-
-#include "qqmljsparser_p.h"
-
-#include <QtCore/qvarlengtharray.h>
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is automatically generated from qqmljs.g.
-// Changes should be made to that file, not here. Any change to this file will
-// be lost!
-//
-// To regenerate this file, run:
-// qlalr --no-debug --no-lines --qt qqmljs.g
-//
-
-using namespace QQmlJS;
-
-QT_QML_BEGIN_NAMESPACE
-
-void Parser::reallocateStack()
-{
- if (! stack_size)
- stack_size = 128;
- else
- stack_size <<= 1;
-
- sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
- state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
- location_stack = reinterpret_cast<AST::SourceLocation*> (realloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
- string_stack = reinterpret_cast<QStringRef*> (realloc(string_stack, stack_size * sizeof(QStringRef)));
-}
-
-Parser::Parser(Engine *engine):
- driver(engine),
- pool(engine->pool()),
- tos(0),
- stack_size(0),
- sym_stack(0),
- state_stack(0),
- location_stack(0),
- string_stack(0),
- program(0),
- first_token(0),
- last_token(0)
-{
-}
-
-Parser::~Parser()
-{
- if (stack_size) {
- free(sym_stack);
- free(state_stack);
- free(location_stack);
- free(string_stack);
- }
-}
-
-static inline AST::SourceLocation location(Lexer *lexer)
-{
- AST::SourceLocation loc;
- loc.offset = lexer->tokenOffset();
- loc.length = lexer->tokenLength();
- loc.startLine = lexer->tokenStartLine();
- loc.startColumn = lexer->tokenStartColumn();
- return loc;
-}
-
-AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
-{
- QVarLengthArray<QStringRef, 4> nameIds;
- QVarLengthArray<AST::SourceLocation, 4> locations;
-
- AST::ExpressionNode *it = expr;
- while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
- nameIds.append(m->name);
- locations.append(m->identifierToken);
- it = m->base;
- }
-
- if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
- AST::UiQualifiedId *q = new (pool) AST::UiQualifiedId(idExpr->name);
- q->identifierToken = idExpr->identifierToken;
-
- AST::UiQualifiedId *currentId = q;
- for (int i = nameIds.size() - 1; i != -1; --i) {
- currentId = new (pool) AST::UiQualifiedId(currentId, nameIds[i]);
- currentId->identifierToken = locations[i];
- }
-
- return currentId->finish();
- }
-
- return 0;
-}
-
-AST::UiQualifiedPragmaId *Parser::reparseAsQualifiedPragmaId(AST::ExpressionNode *expr)
-{
- if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(expr)) {
- AST::UiQualifiedPragmaId *q = new (pool) AST::UiQualifiedPragmaId(idExpr->name);
- q->identifierToken = idExpr->identifierToken;
-
- return q->finish();
- }
-
- return 0;
-}
-
-
-bool Parser::parse(int startToken)
-{
- Lexer *lexer = driver->lexer();
- bool hadErrors = false;
- int yytoken = -1;
- int action = 0;
-
- token_buffer[0].token = startToken;
- first_token = &token_buffer[0];
- last_token = &token_buffer[1];
-
- tos = -1;
- program = 0;
-
- do {
- if (++tos == stack_size)
- reallocateStack();
-
- state_stack[tos] = action;
-
- _Lcheck_token:
- if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) {
- yyprevlloc = yylloc;
-
- if (first_token == last_token) {
- yytoken = lexer->lex();
- yylval = lexer->tokenValue();
- yytokenspell = lexer->tokenSpell();
- yylloc = location(lexer);
- } else {
- yytoken = first_token->token;
- yylval = first_token->dval;
- yytokenspell = first_token->spell;
- yylloc = first_token->loc;
- ++first_token;
- }
- }
-
- action = t_action(action, yytoken);
- if (action > 0) {
- if (action != ACCEPT_STATE) {
- yytoken = -1;
- sym(1).dval = yylval;
- stringRef(1) = yytokenspell;
- loc(1) = yylloc;
- } else {
- --tos;
- return ! hadErrors;
- }
- } else if (action < 0) {
- const int r = -action - 1;
- tos -= rhs[r];
-
- switch (r) {
-./
-
---------------------------------------------------------------------------------------------------------
--- Declarative UI
---------------------------------------------------------------------------------------------------------
-
-TopLevel: T_FEED_UI_PROGRAM UiProgram ;
-/.
-case $rule_number: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-./
-
-TopLevel: T_FEED_JS_STATEMENT Statement ;
-/.
-case $rule_number: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-./
-
-TopLevel: T_FEED_JS_EXPRESSION Expression ;
-/.
-case $rule_number: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-./
-
-TopLevel: T_FEED_JS_SOURCE_ELEMENT SourceElement ;
-/.
-case $rule_number: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-./
-
-TopLevel: T_FEED_UI_OBJECT_MEMBER UiObjectMember ;
-/.
-case $rule_number: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-./
-
-TopLevel: T_FEED_JS_PROGRAM Program ;
-/.
-case $rule_number: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-./
-
-UiProgram: UiHeaderItemListOpt UiRootMember;
-/.
-case $rule_number: {
- sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiHeaderItemList,
- sym(2).UiObjectMemberList->finish());
-} break;
-./
-
-UiHeaderItemListOpt: Empty ;
-UiHeaderItemListOpt: UiHeaderItemList ;
-/.
-case $rule_number: {
- sym(1).Node = sym(1).UiHeaderItemList->finish();
-} break;
-./
-
-UiHeaderItemList: UiPragma ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiPragma);
-} break;
-./
-
-UiHeaderItemList: UiImport ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiImport);
-} break;
-./
-
-UiHeaderItemList: UiHeaderItemList UiPragma ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiPragma);
-} break;
-./
-
-UiHeaderItemList: UiHeaderItemList UiImport ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiImport);
-} break;
-./
-
-PragmaId: MemberExpression ;
-
-ImportId: MemberExpression ;
-
-UiPragma: UiPragmaHead T_AUTOMATIC_SEMICOLON ;
-UiPragma: UiPragmaHead T_SEMICOLON ;
-/.
-case $rule_number: {
- sym(1).UiPragma->semicolonToken = loc(2);
-} break;
-./
-
-UiImport: UiImportHead T_AUTOMATIC_SEMICOLON ;
-UiImport: UiImportHead T_SEMICOLON ;
-/.
-case $rule_number: {
- sym(1).UiImport->semicolonToken = loc(2);
-} break;
-./
-
-UiImport: UiImportHead T_NUMERIC_LITERAL T_AUTOMATIC_SEMICOLON ;
-UiImport: UiImportHead T_NUMERIC_LITERAL T_SEMICOLON ;
-/.
-case $rule_number: {
- sym(1).UiImport->versionToken = loc(2);
- sym(1).UiImport->semicolonToken = loc(3);
-} break;
-./
-
-UiImport: UiImportHead T_NUMERIC_LITERAL T_AS JsIdentifier T_AUTOMATIC_SEMICOLON ;
-UiImport: UiImportHead T_NUMERIC_LITERAL T_AS JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- sym(1).UiImport->versionToken = loc(2);
- sym(1).UiImport->asToken = loc(3);
- sym(1).UiImport->importIdToken = loc(4);
- sym(1).UiImport->importId = stringRef(4);
- sym(1).UiImport->semicolonToken = loc(5);
-} break;
-./
-
-UiImport: UiImportHead T_AS JsIdentifier T_AUTOMATIC_SEMICOLON ;
-UiImport: UiImportHead T_AS JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- sym(1).UiImport->asToken = loc(2);
- sym(1).UiImport->importIdToken = loc(3);
- sym(1).UiImport->importId = stringRef(3);
- sym(1).UiImport->semicolonToken = loc(4);
-} break;
-./
-
-UiPragmaHead: T_PRAGMA PragmaId ;
-/.
-case $rule_number: {
- AST::UiPragma *node = 0;
-
- if (AST::UiQualifiedPragmaId *qualifiedId = reparseAsQualifiedPragmaId(sym(2).Expression)) {
- node = new (pool) AST::UiPragma(qualifiedId);
- }
-
- sym(1).Node = node;
-
- if (node) {
- node->pragmaToken = loc(1);
- } else {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
- QLatin1String("Expected a qualified name id")));
-
- return false; // ### remove me
- }
-} break;
-./
-
-
-UiImportHead: T_IMPORT ImportId ;
-/.
-case $rule_number: {
- AST::UiImport *node = 0;
-
- if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
- node = new (pool) AST::UiImport(importIdLiteral->value);
- node->fileNameToken = loc(2);
- } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
- node = new (pool) AST::UiImport(qualifiedId);
- node->fileNameToken = loc(2);
- }
-
- sym(1).Node = node;
-
- if (node) {
- node->importToken = loc(1);
- } else {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
- QLatin1String("Expected a qualified name id or a string literal")));
-
- return false; // ### remove me
- }
-} break;
-./
-
-Empty: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-UiRootMember: UiObjectDefinition ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember);
-} break;
-./
-
-UiObjectMemberList: UiObjectMember ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember);
-} break;
-./
-
-UiObjectMemberList: UiObjectMemberList UiObjectMember ;
-/.
-case $rule_number: {
- AST::UiObjectMemberList *node = new (pool) AST:: UiObjectMemberList(
- sym(1).UiObjectMemberList, sym(2).UiObjectMember);
- sym(1).Node = node;
-} break;
-./
-
-UiArrayMemberList: UiObjectDefinition ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiArrayMemberList(sym(1).UiObjectMember);
-} break;
-./
-
-UiArrayMemberList: UiArrayMemberList T_COMMA UiObjectDefinition ;
-/.
-case $rule_number: {
- AST::UiArrayMemberList *node = new (pool) AST::UiArrayMemberList(
- sym(1).UiArrayMemberList, sym(3).UiObjectMember);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectInitializer: T_LBRACE T_RBRACE ;
-/.
-case $rule_number: {
- AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer((AST::UiObjectMemberList*)0);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectInitializer: T_LBRACE UiObjectMemberList T_RBRACE ;
-/.
-case $rule_number: {
- AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer(sym(2).UiObjectMemberList->finish());
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectDefinition: UiQualifiedId UiObjectInitializer ;
-/.
-case $rule_number: {
- AST::UiObjectDefinition *node = new (pool) AST::UiObjectDefinition(sym(1).UiQualifiedId,
- sym(2).UiObjectInitializer);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: UiObjectDefinition ;
-
-UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
-/.
-case $rule_number: {
- AST::UiArrayBinding *node = new (pool) AST::UiArrayBinding(
- sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish());
- node->colonToken = loc(2);
- node->lbracketToken = loc(3);
- node->rbracketToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: UiQualifiedId T_COLON UiQualifiedId UiObjectInitializer ;
-/.
-case $rule_number: {
- AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding(
- sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: UiQualifiedId T_ON UiQualifiedId UiObjectInitializer ;
-/.
-case $rule_number: {
- AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding(
- sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
- node->colonToken = loc(2);
- node->hasOnToken = true;
- sym(1).Node = node;
-} break;
-./
-
-UiScriptStatement: Block ;
-UiScriptStatement: EmptyStatement ;
-UiScriptStatement: ExpressionStatement ;
-UiScriptStatement: IfStatement ;
-UiScriptStatement: WithStatement ;
-UiScriptStatement: SwitchStatement ;
-UiScriptStatement: TryStatement ;
-
-UiObjectMember: UiQualifiedId T_COLON UiScriptStatement ;
-/.
-case $rule_number:
-{
- AST::UiScriptBinding *node = new (pool) AST::UiScriptBinding(
- sym(1).UiQualifiedId, sym(3).Statement);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-UiPropertyType: T_VAR ;
-UiPropertyType: T_RESERVED_WORD ;
-UiPropertyType: T_IDENTIFIER ;
-
-UiParameterListOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-UiParameterListOpt: UiParameterList ;
-/.
-case $rule_number: {
- sym(1).Node = sym(1).UiParameterList->finish ();
-} break;
-./
-
-UiParameterList: UiPropertyType JsIdentifier ;
-/.
-case $rule_number: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2));
- node->propertyTypeToken = loc(1);
- node->identifierToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-UiParameterList: UiParameterList T_COMMA UiPropertyType JsIdentifier ;
-/.
-case $rule_number: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, stringRef(3), stringRef(4));
- node->propertyTypeToken = loc(3);
- node->commaToken = loc(2);
- node->identifierToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_AUTOMATIC_SEMICOLON ;
-UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
- node->type = AST::UiPublicMember::Signal;
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(2);
- node->parameters = sym(4).UiParameterList;
- node->semicolonToken = loc(6);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_SIGNAL T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
-UiObjectMember: T_SIGNAL T_IDENTIFIER T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
- node->type = AST::UiPublicMember::Signal;
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(2);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_AUTOMATIC_SEMICOLON ;
-UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
- node->typeModifier = stringRef(2);
- node->propertyToken = loc(1);
- node->typeModifierToken = loc(2);
- node->typeToken = loc(4);
- node->identifierToken = loc(6);
- node->semicolonToken = loc(7);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
-UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(3);
- node->semicolonToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
-UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
- node->isDefaultMember = true;
- node->defaultToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->semicolonToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiScriptStatement ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3),
- sym(5).Statement);
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(3);
- node->colonToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON UiScriptStatement ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
- sym(6).Statement);
- node->isReadonlyMember = true;
- node->readonlyToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->colonToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON UiScriptStatement ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
- sym(6).Statement);
- node->isDefaultMember = true;
- node->defaultToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->colonToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
- node->typeModifier = stringRef(2);
- node->propertyToken = loc(1);
- node->typeModifierToken = loc(2);
- node->typeToken = loc(4);
- node->identifierToken = loc(6);
- node->semicolonToken = loc(7); // insert a fake ';' before ':'
-
- AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(6));
- propertyName->identifierToken = loc(6);
- propertyName->next = 0;
-
- AST::UiArrayBinding *binding = new (pool) AST::UiArrayBinding(
- propertyName, sym(9).UiArrayMemberList->finish());
- binding->colonToken = loc(7);
- binding->lbracketToken = loc(8);
- binding->rbracketToken = loc(10);
-
- node->binding = binding;
-
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(3);
- node->semicolonToken = loc(4); // insert a fake ';' before ':'
-
- AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(3));
- propertyName->identifierToken = loc(3);
- propertyName->next = 0;
-
- AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
- propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
- binding->colonToken = loc(4);
-
- node->binding = binding;
-
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
-/.
-case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
- node->isReadonlyMember = true;
- node->readonlyToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->semicolonToken = loc(5); // insert a fake ';' before ':'
-
- AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(4));
- propertyName->identifierToken = loc(4);
- propertyName->next = 0;
-
- AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
- propertyName, sym(6).UiQualifiedId, sym(7).UiObjectInitializer);
- binding->colonToken = loc(5);
-
- node->binding = binding;
-
- sym(1).Node = node;
-} break;
-./
-
-UiObjectMember: FunctionDeclaration ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
-} break;
-./
-
-UiObjectMember: VariableStatement ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
-} break;
-./
-
-JsIdentifier: T_IDENTIFIER;
-
-JsIdentifier: T_PROPERTY ;
-JsIdentifier: T_SIGNAL ;
-JsIdentifier: T_READONLY ;
-JsIdentifier: T_ON ;
-JsIdentifier: T_GET ;
-JsIdentifier: T_SET ;
-
---------------------------------------------------------------------------------------------------------
--- Expressions
---------------------------------------------------------------------------------------------------------
-
-PrimaryExpression: T_THIS ;
-/.
-case $rule_number: {
- AST::ThisExpression *node = new (pool) AST::ThisExpression();
- node->thisToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: JsIdentifier ;
-/.
-case $rule_number: {
- AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_NULL ;
-/.
-case $rule_number: {
- AST::NullExpression *node = new (pool) AST::NullExpression();
- node->nullToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_TRUE ;
-/.
-case $rule_number: {
- AST::TrueLiteral *node = new (pool) AST::TrueLiteral();
- node->trueToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_FALSE ;
-/.
-case $rule_number: {
- AST::FalseLiteral *node = new (pool) AST::FalseLiteral();
- node->falseToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_NUMERIC_LITERAL ;
-/.
-case $rule_number: {
- AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval);
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_MULTILINE_STRING_LITERAL ;
-/.case $rule_number:./
-
-PrimaryExpression: T_STRING_LITERAL ;
-/.
-case $rule_number: {
- AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1));
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_DIVIDE_ ;
-/:
-#define J_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
-:/
-/.
-case $rule_number: {
- bool rx = lexer->scanRegExp(Lexer::NoPrefix);
- if (!rx) {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
- return false; // ### remove me
- }
-
- loc(1).length = lexer->tokenLength();
- yylloc = loc(1); // adjust the location of the current token
-
- AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral(
- driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags());
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_DIVIDE_EQ ;
-/:
-#define J_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
-:/
-/.
-case $rule_number: {
- bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
- if (!rx) {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
- return false;
- }
-
- loc(1).length = lexer->tokenLength();
- yylloc = loc(1); // adjust the location of the current token
-
- AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral(
- driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags());
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LBRACKET T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0);
- node->lbracketToken = loc(1);
- node->rbracketToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LBRACKET Elision T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).Elision->finish());
- node->lbracketToken = loc(1);
- node->rbracketToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish ());
- node->lbracketToken = loc(1);
- node->rbracketToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LBRACKET ElementList T_COMMA T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
- (AST::Elision *) 0);
- node->lbracketToken = loc(1);
- node->commaToken = loc(3);
- node->rbracketToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LBRACKET ElementList T_COMMA Elision T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
- sym(4).Elision->finish());
- node->lbracketToken = loc(1);
- node->commaToken = loc(3);
- node->rbracketToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
--- PrimaryExpression: T_LBRACE T_RBRACE ;
--- /.
--- case $rule_number: {
--- sym(1).Node = new (pool) AST::ObjectLiteral();
--- } break;
--- ./
-
-PrimaryExpression: T_LBRACE PropertyAssignmentListOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::ObjectLiteral *node = 0;
- if (sym(2).Node)
- node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyAssignmentList->finish ());
- else
- node = new (pool) AST::ObjectLiteral();
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LBRACE PropertyAssignmentList T_COMMA T_RBRACE ;
-/.
-case $rule_number: {
- AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyAssignmentList->finish ());
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-PrimaryExpression: T_LPAREN Expression T_RPAREN ;
-/.
-case $rule_number: {
- AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression);
- node->lparenToken = loc(1);
- node->rparenToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-
-UiQualifiedId: MemberExpression ;
-/.
-case $rule_number: {
- if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
- QLatin1String("Ignored annotation")));
-
- sym(1).Expression = mem->base;
- }
-
- if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
- sym(1).UiQualifiedId = qualifiedId;
- } else {
- sym(1).UiQualifiedId = 0;
-
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
- QLatin1String("Expected a qualified name id")));
-
- return false; // ### recover
- }
-} break;
-./
-
-ElementList: AssignmentExpression ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression);
-} break;
-./
-
-ElementList: Elision AssignmentExpression ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::ElementList(sym(1).Elision->finish(), sym(2).Expression);
-} break;
-./
-
-ElementList: ElementList T_COMMA AssignmentExpression ;
-/.
-case $rule_number: {
- AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList,
- (AST::Elision *) 0, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ElementList: ElementList T_COMMA Elision AssignmentExpression ;
-/.
-case $rule_number: {
- AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, sym(3).Elision->finish(),
- sym(4).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-Elision: T_COMMA ;
-/.
-case $rule_number: {
- AST::Elision *node = new (pool) AST::Elision();
- node->commaToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-Elision: Elision T_COMMA ;
-/.
-case $rule_number: {
- AST::Elision *node = new (pool) AST::Elision(sym(1).Elision);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-PropertyAssignment: PropertyName T_COLON AssignmentExpression ;
-/.
-case $rule_number: {
- AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue(
- sym(1).PropertyName, sym(3).Expression);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-PropertyAssignment: T_GET PropertyName T_LPAREN T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
- sym(2).PropertyName, sym(6).FunctionBody);
- node->getSetToken = loc(1);
- node->lparenToken = loc(3);
- node->rparenToken = loc(4);
- node->lbraceToken = loc(5);
- node->rbraceToken = loc(7);
- sym(1).Node = node;
-} break;
-./
-
-PropertyAssignment: T_SET PropertyName T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
- sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody);
- node->getSetToken = loc(1);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- node->lbraceToken = loc(6);
- node->rbraceToken = loc(8);
- sym(1).Node = node;
-} break;
-./
-
-PropertyAssignmentList: PropertyAssignment ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment);
-} break;
-./
-
-PropertyAssignmentList: PropertyAssignmentList T_COMMA PropertyAssignment ;
-/.
-case $rule_number: {
- AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList(
- sym(1).PropertyAssignmentList, sym(3).PropertyAssignment);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-PropertyName: JsIdentifier %prec SHIFT_THERE ;
-/.
-case $rule_number: {
- AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PropertyName: T_STRING_LITERAL ;
-/.
-case $rule_number: {
- AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PropertyName: T_NUMERIC_LITERAL ;
-/.
-case $rule_number: {
- AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval);
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-PropertyName: ReservedIdentifier ;
-/.
-case $rule_number: {
- AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-ReservedIdentifier: T_BREAK ;
-ReservedIdentifier: T_CASE ;
-ReservedIdentifier: T_CATCH ;
-ReservedIdentifier: T_CONTINUE ;
-ReservedIdentifier: T_DEFAULT ;
-ReservedIdentifier: T_DELETE ;
-ReservedIdentifier: T_DO ;
-ReservedIdentifier: T_ELSE ;
-ReservedIdentifier: T_FALSE ;
-ReservedIdentifier: T_FINALLY ;
-ReservedIdentifier: T_FOR ;
-ReservedIdentifier: T_FUNCTION ;
-ReservedIdentifier: T_IF ;
-ReservedIdentifier: T_IN ;
-ReservedIdentifier: T_INSTANCEOF ;
-ReservedIdentifier: T_NEW ;
-ReservedIdentifier: T_NULL ;
-ReservedIdentifier: T_RETURN ;
-ReservedIdentifier: T_SWITCH ;
-ReservedIdentifier: T_THIS ;
-ReservedIdentifier: T_THROW ;
-ReservedIdentifier: T_TRUE ;
-ReservedIdentifier: T_TRY ;
-ReservedIdentifier: T_TYPEOF ;
-ReservedIdentifier: T_VAR ;
-ReservedIdentifier: T_VOID ;
-ReservedIdentifier: T_WHILE ;
-ReservedIdentifier: T_CONST ;
-ReservedIdentifier: T_DEBUGGER ;
-ReservedIdentifier: T_RESERVED_WORD ;
-ReservedIdentifier: T_WITH ;
-
-PropertyIdentifier: JsIdentifier ;
-PropertyIdentifier: ReservedIdentifier ;
-
-MemberExpression: PrimaryExpression ;
-MemberExpression: FunctionExpression ;
-
-MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
- node->lbracketToken = loc(2);
- node->rbracketToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
-/.
-case $rule_number: {
- AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
- node->dotToken = loc(2);
- node->identifierToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-MemberExpression: T_NEW MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ;
-/.
-case $rule_number: {
- AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList);
- node->newToken = loc(1);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
-NewExpression: MemberExpression ;
-
-NewExpression: T_NEW NewExpression ;
-/.
-case $rule_number: {
- AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression);
- node->newToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-CallExpression: MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ;
-/.
-case $rule_number: {
- AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-CallExpression: CallExpression T_LPAREN ArgumentListOpt T_RPAREN ;
-/.
-case $rule_number: {
- AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
-/.
-case $rule_number: {
- AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
- node->lbracketToken = loc(2);
- node->rbracketToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-CallExpression: CallExpression T_DOT PropertyIdentifier ;
-/.
-case $rule_number: {
- AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
- node->dotToken = loc(2);
- node->identifierToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-ArgumentListOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-ArgumentListOpt: ArgumentList ;
-/.
-case $rule_number: {
- sym(1).Node = sym(1).ArgumentList->finish();
-} break;
-./
-
-ArgumentList: AssignmentExpression ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression);
-} break;
-./
-
-ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
-/.
-case $rule_number: {
- AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LeftHandSideExpression: NewExpression ;
-LeftHandSideExpression: CallExpression ;
-PostfixExpression: LeftHandSideExpression ;
-
-PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
-/.
-case $rule_number: {
- AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression);
- node->incrementToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
-/.
-case $rule_number: {
- AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression);
- node->decrementToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: PostfixExpression ;
-
-UnaryExpression: T_DELETE UnaryExpression ;
-/.
-case $rule_number: {
- AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression);
- node->deleteToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_VOID UnaryExpression ;
-/.
-case $rule_number: {
- AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression);
- node->voidToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_TYPEOF UnaryExpression ;
-/.
-case $rule_number: {
- AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression);
- node->typeofToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_PLUS_PLUS UnaryExpression ;
-/.
-case $rule_number: {
- AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression);
- node->incrementToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_MINUS_MINUS UnaryExpression ;
-/.
-case $rule_number: {
- AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression);
- node->decrementToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_PLUS UnaryExpression ;
-/.
-case $rule_number: {
- AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression);
- node->plusToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_MINUS UnaryExpression ;
-/.
-case $rule_number: {
- AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression);
- node->minusToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_TILDE UnaryExpression ;
-/.
-case $rule_number: {
- AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression);
- node->tildeToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-UnaryExpression: T_NOT UnaryExpression ;
-/.
-case $rule_number: {
- AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression);
- node->notToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-MultiplicativeExpression: UnaryExpression ;
-
-MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Mul, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Div, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Mod, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-AdditiveExpression: MultiplicativeExpression ;
-
-AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Add, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Sub, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ShiftExpression: AdditiveExpression ;
-
-ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::LShift, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::RShift, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::URShift, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpression: ShiftExpression ;
-
-RelationalExpression: RelationalExpression T_LT ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Lt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpression: RelationalExpression T_GT ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Gt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpression: RelationalExpression T_LE ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Le, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpression: RelationalExpression T_GE ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Ge, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::InstanceOf, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpression: RelationalExpression T_IN ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::In, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpressionNotIn: ShiftExpression ;
-
-RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Lt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Gt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Le, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Ge, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::InstanceOf, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpression: RelationalExpression ;
-
-EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Equal, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::NotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictNotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpressionNotIn: RelationalExpressionNotIn ;
-
-EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Equal, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::NotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictNotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BitwiseANDExpression: EqualityExpression ;
-
-BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitAnd, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BitwiseANDExpressionNotIn: EqualityExpressionNotIn ;
-
-BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitAnd, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BitwiseXORExpression: BitwiseANDExpression ;
-
-BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitXor, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ;
-
-BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitXor, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BitwiseORExpression: BitwiseXORExpression ;
-
-BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitOr, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ;
-
-BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitOr, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LogicalANDExpression: BitwiseORExpression ;
-
-LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::And, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ;
-
-LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::And, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LogicalORExpression: LogicalANDExpression ;
-
-LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Or, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LogicalORExpressionNotIn: LogicalANDExpressionNotIn ;
-
-LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Or, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ConditionalExpression: LogicalORExpression ;
-
-ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ;
-/.
-case $rule_number: {
- AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
- sym(3).Expression, sym(5).Expression);
- node->questionToken = loc(2);
- node->colonToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-ConditionalExpressionNotIn: LogicalORExpressionNotIn ;
-
-ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ;
-/.
-case $rule_number: {
- AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
- sym(3).Expression, sym(5).Expression);
- node->questionToken = loc(2);
- node->colonToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-AssignmentExpression: ConditionalExpression ;
-
-AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- sym(2).ival, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-AssignmentExpressionNotIn: ConditionalExpressionNotIn ;
-
-AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ;
-/.
-case $rule_number: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- sym(2).ival, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-AssignmentOperator: T_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::Assign;
-} break;
-./
-
-AssignmentOperator: T_STAR_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceMul;
-} break;
-./
-
-AssignmentOperator: T_DIVIDE_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceDiv;
-} break;
-./
-
-AssignmentOperator: T_REMAINDER_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceMod;
-} break;
-./
-
-AssignmentOperator: T_PLUS_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceAdd;
-} break;
-./
-
-AssignmentOperator: T_MINUS_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceSub;
-} break;
-./
-
-AssignmentOperator: T_LT_LT_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceLeftShift;
-} break;
-./
-
-AssignmentOperator: T_GT_GT_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceRightShift;
-} break;
-./
-
-AssignmentOperator: T_GT_GT_GT_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceURightShift;
-} break;
-./
-
-AssignmentOperator: T_AND_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceAnd;
-} break;
-./
-
-AssignmentOperator: T_XOR_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceXor;
-} break;
-./
-
-AssignmentOperator: T_OR_EQ ;
-/.
-case $rule_number: {
- sym(1).ival = QSOperator::InplaceOr;
-} break;
-./
-
-Expression: AssignmentExpression ;
-
-Expression: Expression T_COMMA AssignmentExpression ;
-/.
-case $rule_number: {
- AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ExpressionOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-ExpressionOpt: Expression ;
-
-ExpressionNotIn: AssignmentExpressionNotIn ;
-
-ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ;
-/.
-case $rule_number: {
- AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ExpressionNotInOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-ExpressionNotInOpt: ExpressionNotIn ;
-
-Statement: Block ;
-Statement: VariableStatement ;
-Statement: EmptyStatement ;
-Statement: ExpressionStatement ;
-Statement: IfStatement ;
-Statement: IterationStatement ;
-Statement: ContinueStatement ;
-Statement: BreakStatement ;
-Statement: ReturnStatement ;
-Statement: WithStatement ;
-Statement: LabelledStatement ;
-Statement: SwitchStatement ;
-Statement: ThrowStatement ;
-Statement: TryStatement ;
-Statement: DebuggerStatement ;
-
-
-Block: T_LBRACE StatementListOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::Block *node = new (pool) AST::Block(sym(2).StatementList);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-StatementList: Statement ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::StatementList(sym(1).Statement);
-} break;
-./
-
-StatementList: StatementList Statement ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::StatementList(sym(1).StatementList, sym(2).Statement);
-} break;
-./
-
-StatementListOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-StatementListOpt: StatementList ;
-/.
-case $rule_number: {
- sym(1).Node = sym(1).StatementList->finish ();
-} break;
-./
-
-VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::VariableStatement *node = new (pool) AST::VariableStatement(
- sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
- node->declarationKindToken = loc(1);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-VariableDeclarationKind: T_CONST ;
-/.
-case $rule_number: {
- sym(1).ival = T_CONST;
-} break;
-./
-
-VariableDeclarationKind: T_VAR ;
-/.
-case $rule_number: {
- sym(1).ival = T_VAR;
-} break;
-./
-
-VariableDeclarationList: VariableDeclaration ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
-} break;
-./
-
-VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ;
-/.
-case $rule_number: {
- AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList(
- sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-VariableDeclarationListNotIn: VariableDeclarationNotIn ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
-} break;
-./
-
-VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
-} break;
-./
-
-VariableDeclaration: JsIdentifier InitialiserOpt ;
-/.
-case $rule_number: {
- AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-VariableDeclarationNotIn: JsIdentifier InitialiserNotInOpt ;
-/.
-case $rule_number: {
- AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-Initialiser: T_EQ AssignmentExpression ;
-/.
-case $rule_number: {
- // ### TODO: AST for initializer
- sym(1) = sym(2);
-} break;
-./
-
-InitialiserOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-InitialiserOpt: Initialiser ;
-
-InitialiserNotIn: T_EQ AssignmentExpressionNotIn ;
-/.
-case $rule_number: {
- // ### TODO: AST for initializer
- sym(1) = sym(2);
-} break;
-./
-
-InitialiserNotInOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-InitialiserNotInOpt: InitialiserNotIn ;
-
-EmptyStatement: T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::EmptyStatement *node = new (pool) AST::EmptyStatement();
- node->semicolonToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-ExpressionStatement: Expression T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ;
-/.
-case $rule_number: {
- AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement);
- node->ifToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- node->elseToken = loc(6);
- sym(1).Node = node;
-} break;
-./
-
-IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement);
- node->ifToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-
-IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_COMPATIBILITY_SEMICOLON ; -- for JSC/V8 compatibility
-IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(sym(2).Statement, sym(5).Expression);
- node->doToken = loc(1);
- node->whileToken = loc(3);
- node->lparenToken = loc(4);
- node->rparenToken = loc(6);
- node->semicolonToken = loc(7);
- sym(1).Node = node;
-} break;
-./
-
-IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement);
- node->whileToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST::ForStatement *node = new (pool) AST::ForStatement(sym(3).Expression,
- sym(5).Expression, sym(7).Expression, sym(9).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->firstSemicolonToken = loc(4);
- node->secondSemicolonToken = loc(6);
- node->rparenToken = loc(8);
- sym(1).Node = node;
-} break;
-./
-
-IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST::LocalForStatement *node = new (pool) AST::LocalForStatement(
- sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
- sym(8).Expression, sym(10).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->varToken = loc(3);
- node->firstSemicolonToken = loc(5);
- node->secondSemicolonToken = loc(7);
- node->rparenToken = loc(9);
- sym(1).Node = node;
-} break;
-./
-
-IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST:: ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression,
- sym(5).Expression, sym(7).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->inToken = loc(4);
- node->rparenToken = loc(6);
- sym(1).Node = node;
-} break;
-./
-
-IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST::LocalForEachStatement *node = new (pool) AST::LocalForEachStatement(
- sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->varToken = loc(3);
- node->inToken = loc(5);
- node->rparenToken = loc(7);
- sym(1).Node = node;
-} break;
-./
-
-ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-ContinueStatement: T_CONTINUE T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::ContinueStatement *node = new (pool) AST::ContinueStatement();
- node->continueToken = loc(1);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ContinueStatement: T_CONTINUE JsIdentifier T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-ContinueStatement: T_CONTINUE JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2));
- node->continueToken = loc(1);
- node->identifierToken = loc(2);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-BreakStatement: T_BREAK T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef());
- node->breakToken = loc(1);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-BreakStatement: T_BREAK JsIdentifier T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-BreakStatement: T_BREAK JsIdentifier T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2));
- node->breakToken = loc(1);
- node->identifierToken = loc(2);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression);
- node->returnToken = loc(1);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ;
-/.
-case $rule_number: {
- AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement);
- node->withToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ;
-/.
-case $rule_number: {
- AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock);
- node->switchToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(5);
- sym(1).Node = node;
-} break;
-./
-
-CaseClauses: CaseClause ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause);
-} break;
-./
-
-CaseClauses: CaseClauses CaseClause ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause);
-} break;
-./
-
-CaseClausesOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-CaseClausesOpt: CaseClauses ;
-/.
-case $rule_number: {
- sym(1).Node = sym(1).CaseClauses->finish ();
-} break;
-./
-
-CaseClause: T_CASE Expression T_COLON StatementListOpt ;
-/.
-case $rule_number: {
- AST::CaseClause *node = new (pool) AST::CaseClause(sym(2).Expression, sym(4).StatementList);
- node->caseToken = loc(1);
- node->colonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-DefaultClause: T_DEFAULT T_COLON StatementListOpt ;
-/.
-case $rule_number: {
- AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList);
- node->defaultToken = loc(1);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-LabelledStatement: JsIdentifier T_COLON Statement ;
-/.
-case $rule_number: {
- AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
- node->identifierToken = loc(1);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
-ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-ThrowStatement: T_THROW Expression T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression);
- node->throwToken = loc(1);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-TryStatement: T_TRY Block Catch ;
-/.
-case $rule_number: {
- AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch);
- node->tryToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-TryStatement: T_TRY Block Finally ;
-/.
-case $rule_number: {
- AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally);
- node->tryToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-TryStatement: T_TRY Block Catch Finally ;
-/.
-case $rule_number: {
- AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch, sym(4).Finally);
- node->tryToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-Catch: T_CATCH T_LPAREN JsIdentifier T_RPAREN Block ;
-/.
-case $rule_number: {
- AST::Catch *node = new (pool) AST::Catch(stringRef(3), sym(5).Block);
- node->catchToken = loc(1);
- node->lparenToken = loc(2);
- node->identifierToken = loc(3);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-./
-
-Finally: T_FINALLY Block ;
-/.
-case $rule_number: {
- AST::Finally *node = new (pool) AST::Finally(sym(2).Block);
- node->finallyToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
-DebuggerStatement: T_DEBUGGER T_SEMICOLON ;
-/.
-case $rule_number: {
- AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement();
- node->debuggerToken = loc(1);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-./
-
--- tell the parser to prefer function declarations to function expressions.
--- That is, the `Function' symbol is used to mark the start of a function
--- declaration.
-Function: T_FUNCTION %prec REDUCE_HERE ;
-
-FunctionDeclaration: Function JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
- node->functionToken = loc(1);
- node->identifierToken = loc(2);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- node->lbraceToken = loc(6);
- node->rbraceToken = loc(8);
- sym(1).Node = node;
-} break;
-./
-
-FunctionExpression: T_FUNCTION JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
- node->functionToken = loc(1);
- if (! stringRef(2).isNull())
- node->identifierToken = loc(2);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- node->lbraceToken = loc(6);
- node->rbraceToken = loc(8);
- sym(1).Node = node;
-} break;
-./
-
-FunctionExpression: T_FUNCTION T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
-/.
-case $rule_number: {
- AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody);
- node->functionToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- node->lbraceToken = loc(5);
- node->rbraceToken = loc(7);
- sym(1).Node = node;
-} break;
-./
-
-FormalParameterList: JsIdentifier ;
-/.
-case $rule_number: {
- AST::FormalParameterList *node = new (pool) AST::FormalParameterList(stringRef(1));
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-./
-
-FormalParameterList: FormalParameterList T_COMMA JsIdentifier ;
-/.
-case $rule_number: {
- AST::FormalParameterList *node = new (pool) AST::FormalParameterList(sym(1).FormalParameterList, stringRef(3));
- node->commaToken = loc(2);
- node->identifierToken = loc(3);
- sym(1).Node = node;
-} break;
-./
-
-FormalParameterListOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-FormalParameterListOpt: FormalParameterList ;
-/.
-case $rule_number: {
- sym(1).Node = sym(1).FormalParameterList->finish ();
-} break;
-./
-
-FunctionBodyOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-FunctionBodyOpt: FunctionBody ;
-
-FunctionBody: SourceElements ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ());
-} break;
-./
-
-Program: Empty ;
-
-Program: SourceElements ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ());
-} break;
-./
-
-SourceElements: SourceElement ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement);
-} break;
-./
-
-SourceElements: SourceElements SourceElement ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement);
-} break;
-./
-
-SourceElement: Statement ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement);
-} break;
-./
-
-SourceElement: FunctionDeclaration ;
-/.
-case $rule_number: {
- sym(1).Node = new (pool) AST::FunctionSourceElement(sym(1).FunctionDeclaration);
-} break;
-./
-
-PropertyAssignmentListOpt: ;
-/.
-case $rule_number: {
- sym(1).Node = 0;
-} break;
-./
-
-PropertyAssignmentListOpt: PropertyAssignmentList ;
-
-/.
- } // switch
- action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
- } // if
- } while (action != 0);
-
- if (first_token == last_token) {
- const int errorState = state_stack[tos];
-
- // automatic insertion of `;'
- if (yytoken != -1 && ((t_action(errorState, T_AUTOMATIC_SEMICOLON) && lexer->canInsertAutomaticSemicolon(yytoken))
- || t_action(errorState, T_COMPATIBILITY_SEMICOLON))) {
- SavedToken &tk = token_buffer[0];
- tk.token = yytoken;
- tk.dval = yylval;
- tk.spell = yytokenspell;
- tk.loc = yylloc;
-
- yylloc = yyprevlloc;
- yylloc.offset += yylloc.length;
- yylloc.startColumn += yylloc.length;
- yylloc.length = 0;
-
- //const QString msg = qApp->translate("QQmlParser", "Missing `;'");
- //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
-
- first_token = &token_buffer[0];
- last_token = &token_buffer[1];
-
- yytoken = T_SEMICOLON;
- yylval = 0;
-
- action = errorState;
-
- goto _Lcheck_token;
- }
-
- hadErrors = true;
-
- token_buffer[0].token = yytoken;
- token_buffer[0].dval = yylval;
- token_buffer[0].spell = yytokenspell;
- token_buffer[0].loc = yylloc;
-
- token_buffer[1].token = yytoken = lexer->lex();
- token_buffer[1].dval = yylval = lexer->tokenValue();
- token_buffer[1].spell = yytokenspell = lexer->tokenSpell();
- token_buffer[1].loc = yylloc = location(lexer);
-
- if (t_action(errorState, yytoken)) {
- QString msg;
- int token = token_buffer[0].token;
- if (token < 0 || token >= TERMINAL_COUNT)
- msg = qApp->translate("QQmlParser", "Syntax error");
- else
- msg = qApp->translate("QQmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
-
- action = errorState;
- goto _Lcheck_token;
- }
-
- static int tokens[] = {
- T_PLUS,
- T_EQ,
-
- T_COMMA,
- T_COLON,
- T_SEMICOLON,
-
- T_RPAREN, T_RBRACKET, T_RBRACE,
-
- T_NUMERIC_LITERAL,
- T_IDENTIFIER,
-
- T_LPAREN, T_LBRACKET, T_LBRACE,
-
- EOF_SYMBOL
- };
-
- for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
- int a = t_action(errorState, *tk);
- if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
-
- yytoken = *tk;
- yylval = 0;
- yylloc = token_buffer[0].loc;
- yylloc.length = 0;
-
- first_token = &token_buffer[0];
- last_token = &token_buffer[2];
-
- action = errorState;
- goto _Lcheck_token;
- }
- }
-
- for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
- if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM ||
- tk == T_FEED_JS_STATEMENT || tk == T_FEED_JS_EXPRESSION ||
- tk == T_FEED_JS_SOURCE_ELEMENT)
- continue;
-
- int a = t_action(errorState, tk);
- if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
-
- yytoken = tk;
- yylval = 0;
- yylloc = token_buffer[0].loc;
- yylloc.length = 0;
-
- action = errorState;
- goto _Lcheck_token;
- }
- }
-
- const QString msg = qApp->translate("QQmlParser", "Syntax error");
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
- }
-
- return false;
-}
-
-QT_QML_END_NAMESPACE
-
-
-./
-/:
-QT_QML_END_NAMESPACE
-
-
-
-#endif // QQMLJSPARSER_P_H
-:/
diff --git a/src/tools/qdoc/qmlparser/qqmljsast.cpp b/src/tools/qdoc/qmlparser/qqmljsast.cpp
deleted file mode 100644
index a834399ae5..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsast.cpp
+++ /dev/null
@@ -1,968 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 "qqmljsast_p.h"
-
-#include "qqmljsastvisitor_p.h"
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS { namespace AST {
-
-void Node::accept(Visitor *visitor)
-{
- if (visitor->preVisit(this)) {
- accept0(visitor);
- }
- visitor->postVisit(this);
-}
-
-void Node::accept(Node *node, Visitor *visitor)
-{
- if (node)
- node->accept(visitor);
-}
-
-ExpressionNode *Node::expressionCast()
-{
- return 0;
-}
-
-BinaryExpression *Node::binaryExpressionCast()
-{
- return 0;
-}
-
-Statement *Node::statementCast()
-{
- return 0;
-}
-
-UiObjectMember *Node::uiObjectMemberCast()
-{
- return 0;
-}
-
-ExpressionNode *ExpressionNode::expressionCast()
-{
- return this;
-}
-
-BinaryExpression *BinaryExpression::binaryExpressionCast()
-{
- return this;
-}
-
-Statement *Statement::statementCast()
-{
- return this;
-}
-
-UiObjectMember *UiObjectMember::uiObjectMemberCast()
-{
- return this;
-}
-
-void NestedExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
- visitor->endVisit(this);
-}
-
-void ThisExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void IdentifierExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void NullExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void TrueLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void FalseLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void StringLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void NumericLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void RegExpLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void ArrayLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(elements, visitor);
- accept(elision, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ObjectLiteral::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(properties, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ElementList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (ElementList *it = this; it; it = it->next) {
- accept(it->elision, visitor);
- accept(it->expression, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void Elision::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- // ###
- }
-
- visitor->endVisit(this);
-}
-
-void PropertyNameAndValue::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(name, visitor);
- accept(value, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void PropertyGetterSetter::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(name, visitor);
- accept(formals, visitor);
- accept(functionBody, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void PropertyAssignmentList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (PropertyAssignmentList *it = this; it; it = it->next) {
- accept(it->assignment, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void IdentifierPropertyName::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void StringLiteralPropertyName::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void NumericLiteralPropertyName::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void ArrayMemberExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(base, visitor);
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void FieldMemberExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(base, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void NewMemberExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(base, visitor);
- accept(arguments, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void NewExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void CallExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(base, visitor);
- accept(arguments, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ArgumentList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (ArgumentList *it = this; it; it = it->next) {
- accept(it->expression, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void PostIncrementExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(base, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void PostDecrementExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(base, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void DeleteExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void VoidExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void TypeOfExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void PreIncrementExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void PreDecrementExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UnaryPlusExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UnaryMinusExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void TildeExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void NotExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void BinaryExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(left, visitor);
- accept(right, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ConditionalExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- accept(ok, visitor);
- accept(ko, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void Expression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(left, visitor);
- accept(right, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void Block::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statements, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void StatementList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (StatementList *it = this; it; it = it->next) {
- accept(it->statement, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void VariableStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(declarations, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void VariableDeclarationList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (VariableDeclarationList *it = this; it; it = it->next) {
- accept(it->declaration, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void VariableDeclaration::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void EmptyStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void ExpressionStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void IfStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- accept(ok, visitor);
- accept(ko, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void DoWhileStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void WhileStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ForStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(initialiser, visitor);
- accept(condition, visitor);
- accept(expression, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void LocalForStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(declarations, visitor);
- accept(condition, visitor);
- accept(expression, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ForEachStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(initialiser, visitor);
- accept(expression, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void LocalForEachStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(declaration, visitor);
- accept(expression, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ContinueStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void BreakStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void ReturnStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void WithStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void SwitchStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- accept(block, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void CaseBlock::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(clauses, visitor);
- accept(defaultClause, visitor);
- accept(moreClauses, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void CaseClauses::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (CaseClauses *it = this; it; it = it->next) {
- accept(it->clause, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void CaseClause::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- accept(statements, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void DefaultClause::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statements, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void LabelledStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void ThrowStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(expression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void TryStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- accept(catchExpression, visitor);
- accept(finallyExpression, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void Catch::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void Finally::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void FunctionDeclaration::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(formals, visitor);
- accept(body, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void FunctionExpression::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(formals, visitor);
- accept(body, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void FormalParameterList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- // ###
- }
-
- visitor->endVisit(this);
-}
-
-void FunctionBody::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(elements, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void Program::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(elements, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void SourceElements::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (SourceElements *it = this; it; it = it->next) {
- accept(it->element, visitor);
- }
- }
-
- visitor->endVisit(this);
-}
-
-void FunctionSourceElement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(declaration, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void StatementSourceElement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void DebuggerStatement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void UiProgram::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(headers, visitor);
- accept(members, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiPublicMember::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(statement, visitor);
- accept(binding, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiObjectDefinition::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(qualifiedTypeNameId, visitor);
- accept(initializer, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiObjectInitializer::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(members, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiParameterList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
- visitor->endVisit(this);
-}
-
-void UiObjectBinding::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(qualifiedId, visitor);
- accept(qualifiedTypeNameId, visitor);
- accept(initializer, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiScriptBinding::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(qualifiedId, visitor);
- accept(statement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiArrayBinding::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(qualifiedId, visitor);
- accept(members, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiObjectMemberList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (UiObjectMemberList *it = this; it; it = it->next)
- accept(it->member, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiArrayMemberList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- for (UiArrayMemberList *it = this; it; it = it->next)
- accept(it->member, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiQualifiedId::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void UiImport::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(importUri, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiQualifiedPragmaId::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- }
-
- visitor->endVisit(this);
-}
-
-void UiPragma::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(pragmaType, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void UiHeaderItemList::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(headerItem, visitor);
- accept(next, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-
-void UiSourceElement::accept0(Visitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(sourceElement, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-} } // namespace QQmlJS::AST
-
-QT_QML_END_NAMESPACE
-
-
diff --git a/src/tools/qdoc/qmlparser/qqmljsast_p.h b/src/tools/qdoc/qmlparser/qqmljsast_p.h
deleted file mode 100644
index fa6b5d2488..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsast_p.h
+++ /dev/null
@@ -1,2781 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSAST_P_H
-#define QQMLJSAST_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 "qqmljsastvisitor_p.h"
-#include "qqmljsglobal_p.h"
-#include "qqmljsmemorypool_p.h"
-
-#include <QtCore/qstring.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-#define QQMLJS_DECLARE_AST_NODE(name) \
- enum { K = Kind_##name };
-
-namespace QSOperator // ### rename
-{
-
-enum Op {
- Add,
- And,
- InplaceAnd,
- Assign,
- BitAnd,
- BitOr,
- BitXor,
- InplaceSub,
- Div,
- InplaceDiv,
- Equal,
- Ge,
- Gt,
- In,
- InplaceAdd,
- InstanceOf,
- Le,
- LShift,
- InplaceLeftShift,
- Lt,
- Mod,
- InplaceMod,
- Mul,
- InplaceMul,
- NotEqual,
- Or,
- InplaceOr,
- RShift,
- InplaceRightShift,
- StrictEqual,
- StrictNotEqual,
- Sub,
- URShift,
- InplaceURightShift,
- InplaceXor
-};
-
-} // namespace QSOperator
-
-namespace QQmlJS {
-
-namespace AST {
-
-template <typename _T1, typename _T2>
-_T1 cast(_T2 *ast)
-{
- if (ast && ast->kind == static_cast<_T1>(0)->K)
- return static_cast<_T1>(ast);
-
- return 0;
-}
-
-class QML_PARSER_EXPORT Node: public Managed
-{
-public:
- enum Kind {
- Kind_Undefined,
-
- Kind_ArgumentList,
- Kind_ArrayLiteral,
- Kind_ArrayMemberExpression,
- Kind_BinaryExpression,
- Kind_Block,
- Kind_BreakStatement,
- Kind_CallExpression,
- Kind_CaseBlock,
- Kind_CaseClause,
- Kind_CaseClauses,
- Kind_Catch,
- Kind_ConditionalExpression,
- Kind_ContinueStatement,
- Kind_DebuggerStatement,
- Kind_DefaultClause,
- Kind_DeleteExpression,
- Kind_DoWhileStatement,
- Kind_ElementList,
- Kind_Elision,
- Kind_EmptyStatement,
- Kind_Expression,
- Kind_ExpressionStatement,
- Kind_FalseLiteral,
- Kind_FieldMemberExpression,
- Kind_Finally,
- Kind_ForEachStatement,
- Kind_ForStatement,
- Kind_FormalParameterList,
- Kind_FunctionBody,
- Kind_FunctionDeclaration,
- Kind_FunctionExpression,
- Kind_FunctionSourceElement,
- Kind_IdentifierExpression,
- Kind_IdentifierPropertyName,
- Kind_IfStatement,
- Kind_LabelledStatement,
- Kind_LocalForEachStatement,
- Kind_LocalForStatement,
- Kind_NewExpression,
- Kind_NewMemberExpression,
- Kind_NotExpression,
- Kind_NullExpression,
- Kind_NumericLiteral,
- Kind_NumericLiteralPropertyName,
- Kind_ObjectLiteral,
- Kind_PostDecrementExpression,
- Kind_PostIncrementExpression,
- Kind_PreDecrementExpression,
- Kind_PreIncrementExpression,
- Kind_Program,
- Kind_PropertyAssignmentList,
- Kind_PropertyGetterSetter,
- Kind_PropertyName,
- Kind_PropertyNameAndValue,
- Kind_RegExpLiteral,
- Kind_ReturnStatement,
- Kind_SourceElement,
- Kind_SourceElements,
- Kind_StatementList,
- Kind_StatementSourceElement,
- Kind_StringLiteral,
- Kind_StringLiteralPropertyName,
- Kind_SwitchStatement,
- Kind_ThisExpression,
- Kind_ThrowStatement,
- Kind_TildeExpression,
- Kind_TrueLiteral,
- Kind_TryStatement,
- Kind_TypeOfExpression,
- Kind_UnaryMinusExpression,
- Kind_UnaryPlusExpression,
- Kind_VariableDeclaration,
- Kind_VariableDeclarationList,
- Kind_VariableStatement,
- Kind_VoidExpression,
- Kind_WhileStatement,
- Kind_WithStatement,
- Kind_NestedExpression,
-
- Kind_UiArrayBinding,
- Kind_UiImport,
- Kind_UiObjectBinding,
- Kind_UiObjectDefinition,
- Kind_UiObjectInitializer,
- Kind_UiObjectMemberList,
- Kind_UiArrayMemberList,
- Kind_UiPragma,
- Kind_UiProgram,
- Kind_UiParameterList,
- Kind_UiPublicMember,
- Kind_UiQualifiedId,
- Kind_UiQualifiedPragmaId,
- Kind_UiScriptBinding,
- Kind_UiSourceElement,
- Kind_UiHeaderItemList
- };
-
- inline Node()
- : kind(Kind_Undefined) {}
-
- // NOTE: node destructors are never called,
- // instead we block free the memory
- // (see the NodePool class)
- virtual ~Node() {}
-
- virtual ExpressionNode *expressionCast();
- virtual BinaryExpression *binaryExpressionCast();
- virtual Statement *statementCast();
- virtual UiObjectMember *uiObjectMemberCast();
-
- void accept(Visitor *visitor);
- static void accept(Node *node, Visitor *visitor);
-
- inline static void acceptChild(Node *node, Visitor *visitor)
- { return accept(node, visitor); } // ### remove
-
- virtual void accept0(Visitor *visitor) = 0;
- virtual SourceLocation firstSourceLocation() const = 0;
- virtual SourceLocation lastSourceLocation() const = 0;
-
-// attributes
- int kind;
-};
-
-class QML_PARSER_EXPORT ExpressionNode: public Node
-{
-public:
- ExpressionNode() {}
-
- virtual ExpressionNode *expressionCast();
-};
-
-class QML_PARSER_EXPORT Statement: public Node
-{
-public:
- Statement() {}
-
- virtual Statement *statementCast();
-};
-
-class QML_PARSER_EXPORT NestedExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NestedExpression)
-
- NestedExpression(ExpressionNode *expression)
- : expression(expression)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return lparenToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rparenToken; }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT ThisExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ThisExpression)
-
- ThisExpression() { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return thisToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return thisToken; }
-
-// attributes
- SourceLocation thisToken;
-};
-
-class QML_PARSER_EXPORT IdentifierExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(IdentifierExpression)
-
- IdentifierExpression(const QStringRef &n):
- name (n) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return identifierToken; }
-
-// attributes
- QStringRef name;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT NullExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NullExpression)
-
- NullExpression() { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return nullToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return nullToken; }
-
-// attributes
- SourceLocation nullToken;
-};
-
-class QML_PARSER_EXPORT TrueLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(TrueLiteral)
-
- TrueLiteral() { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return trueToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return trueToken; }
-
-// attributes
- SourceLocation trueToken;
-};
-
-class QML_PARSER_EXPORT FalseLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FalseLiteral)
-
- FalseLiteral() { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return falseToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return falseToken; }
-
-// attributes
- SourceLocation falseToken;
-};
-
-class QML_PARSER_EXPORT NumericLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NumericLiteral)
-
- NumericLiteral(double v):
- value(v) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return literalToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return literalToken; }
-
-// attributes:
- double value;
- SourceLocation literalToken;
-};
-
-class QML_PARSER_EXPORT StringLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(StringLiteral)
-
- StringLiteral(const QStringRef &v):
- value (v) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return literalToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return literalToken; }
-
-// attributes:
- QStringRef value;
- SourceLocation literalToken;
-};
-
-class QML_PARSER_EXPORT RegExpLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(RegExpLiteral)
-
- RegExpLiteral(const QStringRef &p, int f):
- pattern (p), flags (f) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return literalToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return literalToken; }
-
-// attributes:
- QStringRef pattern;
- int flags;
- SourceLocation literalToken;
-};
-
-class QML_PARSER_EXPORT ArrayLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ArrayLiteral)
-
- ArrayLiteral(Elision *e):
- elements (0), elision (e)
- { kind = K; }
-
- ArrayLiteral(ElementList *elts):
- elements (elts), elision (0)
- { kind = K; }
-
- ArrayLiteral(ElementList *elts, Elision *e):
- elements (elts), elision (e)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return lbracketToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbracketToken; }
-
-// attributes
- ElementList *elements;
- Elision *elision;
- SourceLocation lbracketToken;
- SourceLocation commaToken;
- SourceLocation rbracketToken;
-};
-
-class QML_PARSER_EXPORT ObjectLiteral: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ObjectLiteral)
-
- ObjectLiteral():
- properties (0) { kind = K; }
-
- ObjectLiteral(PropertyAssignmentList *plist):
- properties (plist) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return lbraceToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbraceToken; }
-
-// attributes
- PropertyAssignmentList *properties;
- SourceLocation lbraceToken;
- SourceLocation rbraceToken;
-};
-
-class QML_PARSER_EXPORT Elision: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(Elision)
-
- Elision():
- next (this) { kind = K; }
-
- Elision(Elision *previous)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return commaToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : commaToken; }
-
- inline Elision *finish ()
- {
- Elision *front = next;
- next = 0;
- return front;
- }
-
-// attributes
- Elision *next;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT ElementList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ElementList)
-
- ElementList(Elision *e, ExpressionNode *expr):
- elision (e), expression (expr), next (this)
- { kind = K; }
-
- ElementList(ElementList *previous, Elision *e, ExpressionNode *expr):
- elision (e), expression (expr)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- inline ElementList *finish ()
- {
- ElementList *front = next;
- next = 0;
- return front;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- {
- if (elision)
- return elision->firstSourceLocation();
- return expression->firstSourceLocation();
- }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (next)
- return next->lastSourceLocation();
- return expression->lastSourceLocation();
- }
-
-// attributes
- Elision *elision;
- ExpressionNode *expression;
- ElementList *next;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT PropertyName: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PropertyName)
-
- PropertyName() { kind = K; }
-
- virtual SourceLocation firstSourceLocation() const
- { return propertyNameToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return propertyNameToken; }
-
- virtual QString asString() const = 0;
-
-// attributes
- SourceLocation propertyNameToken;
-};
-
-class QML_PARSER_EXPORT PropertyAssignment: public Node
-{
-public:
- PropertyAssignment(PropertyName *n)
- : name(n)
- {}
-// attributes
- PropertyName *name;
-};
-
-class QML_PARSER_EXPORT PropertyAssignmentList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PropertyAssignmentList)
-
- PropertyAssignmentList(PropertyAssignment *assignment)
- : assignment(assignment)
- , next(this)
- { kind = K; }
-
- PropertyAssignmentList(PropertyAssignmentList *previous, PropertyAssignment *assignment)
- : assignment(assignment)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- inline PropertyAssignmentList *finish ()
- {
- PropertyAssignmentList *front = next;
- next = 0;
- return front;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return assignment->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : assignment->lastSourceLocation(); }
-
-// attributes
- PropertyAssignment *assignment;
- PropertyAssignmentList *next;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT PropertyNameAndValue: public PropertyAssignment
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PropertyNameAndValue)
-
- PropertyNameAndValue(PropertyName *n, ExpressionNode *v)
- : PropertyAssignment(n), value(v)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return name->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return value->lastSourceLocation(); }
-
-// attributes
- SourceLocation colonToken;
- ExpressionNode *value;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT PropertyGetterSetter: public PropertyAssignment
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PropertyGetterSetter)
-
- enum Type {
- Getter,
- Setter
- };
-
- PropertyGetterSetter(PropertyName *n, FunctionBody *b)
- : PropertyAssignment(n), type(Getter), formals(0), functionBody (b)
- { kind = K; }
-
- PropertyGetterSetter(PropertyName *n, FormalParameterList *f, FunctionBody *b)
- : PropertyAssignment(n), type(Setter), formals(f), functionBody (b)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return getSetToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbraceToken; }
-
-// attributes
- Type type;
- SourceLocation getSetToken;
- SourceLocation lparenToken;
- FormalParameterList *formals;
- SourceLocation rparenToken;
- SourceLocation lbraceToken;
- FunctionBody *functionBody;
- SourceLocation rbraceToken;
-};
-
-class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
-{
-public:
- QQMLJS_DECLARE_AST_NODE(IdentifierPropertyName)
-
- IdentifierPropertyName(const QStringRef &n):
- id (n) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual QString asString() const { return id.toString(); }
-
-// attributes
- QStringRef id;
-};
-
-class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName
-{
-public:
- QQMLJS_DECLARE_AST_NODE(StringLiteralPropertyName)
-
- StringLiteralPropertyName(const QStringRef &n):
- id (n) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual QString asString() const { return id.toString(); }
-
-// attributes
- QStringRef id;
-};
-
-class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NumericLiteralPropertyName)
-
- NumericLiteralPropertyName(double n):
- id (n) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual QString asString() const { return QString::number(id, 'g', 16); }
-
-// attributes
- double id;
-};
-
-class QML_PARSER_EXPORT ArrayMemberExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ArrayMemberExpression)
-
- ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e):
- base (b), expression (e)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return base->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbracketToken; }
-
-// attributes
- ExpressionNode *base;
- ExpressionNode *expression;
- SourceLocation lbracketToken;
- SourceLocation rbracketToken;
-};
-
-class QML_PARSER_EXPORT FieldMemberExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FieldMemberExpression)
-
- FieldMemberExpression(ExpressionNode *b, const QStringRef &n):
- base (b), name (n)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return base->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return identifierToken; }
-
- // attributes
- ExpressionNode *base;
- QStringRef name;
- SourceLocation dotToken;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT NewMemberExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NewMemberExpression)
-
- NewMemberExpression(ExpressionNode *b, ArgumentList *a):
- base (b), arguments (a)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return newToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rparenToken; }
-
- // attributes
- ExpressionNode *base;
- ArgumentList *arguments;
- SourceLocation newToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT NewExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NewExpression)
-
- NewExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return newToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation newToken;
-};
-
-class QML_PARSER_EXPORT CallExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(CallExpression)
-
- CallExpression(ExpressionNode *b, ArgumentList *a):
- base (b), arguments (a)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return base->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return rparenToken; }
-
-// attributes
- ExpressionNode *base;
- ArgumentList *arguments;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT ArgumentList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ArgumentList)
-
- ArgumentList(ExpressionNode *e):
- expression (e), next (this)
- { kind = K; }
-
- ArgumentList(ArgumentList *previous, ExpressionNode *e):
- expression (e)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return expression->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (next)
- return next->lastSourceLocation();
- return expression->lastSourceLocation();
- }
-
- inline ArgumentList *finish ()
- {
- ArgumentList *front = next;
- next = 0;
- return front;
- }
-
-// attributes
- ExpressionNode *expression;
- ArgumentList *next;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT PostIncrementExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PostIncrementExpression)
-
- PostIncrementExpression(ExpressionNode *b):
- base (b) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return base->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return incrementToken; }
-
-// attributes
- ExpressionNode *base;
- SourceLocation incrementToken;
-};
-
-class QML_PARSER_EXPORT PostDecrementExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PostDecrementExpression)
-
- PostDecrementExpression(ExpressionNode *b):
- base (b) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return base->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return decrementToken; }
-
-// attributes
- ExpressionNode *base;
- SourceLocation decrementToken;
-};
-
-class QML_PARSER_EXPORT DeleteExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(DeleteExpression)
-
- DeleteExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return deleteToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation deleteToken;
-};
-
-class QML_PARSER_EXPORT VoidExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(VoidExpression)
-
- VoidExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return voidToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation voidToken;
-};
-
-class QML_PARSER_EXPORT TypeOfExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(TypeOfExpression)
-
- TypeOfExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return typeofToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation typeofToken;
-};
-
-class QML_PARSER_EXPORT PreIncrementExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PreIncrementExpression)
-
- PreIncrementExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return incrementToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation incrementToken;
-};
-
-class QML_PARSER_EXPORT PreDecrementExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(PreDecrementExpression)
-
- PreDecrementExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return decrementToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation decrementToken;
-};
-
-class QML_PARSER_EXPORT UnaryPlusExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UnaryPlusExpression)
-
- UnaryPlusExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return plusToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation plusToken;
-};
-
-class QML_PARSER_EXPORT UnaryMinusExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UnaryMinusExpression)
-
- UnaryMinusExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return minusToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation minusToken;
-};
-
-class QML_PARSER_EXPORT TildeExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(TildeExpression)
-
- TildeExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return tildeToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation tildeToken;
-};
-
-class QML_PARSER_EXPORT NotExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(NotExpression)
-
- NotExpression(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return notToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation notToken;
-};
-
-class QML_PARSER_EXPORT BinaryExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(BinaryExpression)
-
- BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r):
- left (l), op (o), right (r)
- { kind = K; }
-
- virtual BinaryExpression *binaryExpressionCast();
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return left->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return right->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *left;
- int op;
- ExpressionNode *right;
- SourceLocation operatorToken;
-};
-
-class QML_PARSER_EXPORT ConditionalExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ConditionalExpression)
-
- ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f):
- expression (e), ok (t), ko (f)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return expression->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return ko->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- ExpressionNode *ok;
- ExpressionNode *ko;
- SourceLocation questionToken;
- SourceLocation colonToken;
-};
-
-class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename
-{
-public:
- QQMLJS_DECLARE_AST_NODE(Expression)
-
- Expression(ExpressionNode *l, ExpressionNode *r):
- left (l), right (r) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return left->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return right->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *left;
- ExpressionNode *right;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT Block: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(Block)
-
- Block(StatementList *slist):
- statements (slist) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return lbraceToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbraceToken; }
-
- // attributes
- StatementList *statements;
- SourceLocation lbraceToken;
- SourceLocation rbraceToken;
-};
-
-class QML_PARSER_EXPORT StatementList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(StatementList)
-
- StatementList(Statement *stmt):
- statement (stmt), next (this)
- { kind = K; }
-
- StatementList(StatementList *previous, Statement *stmt):
- statement (stmt)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return statement->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : statement->lastSourceLocation(); }
-
- inline StatementList *finish ()
- {
- StatementList *front = next;
- next = 0;
- return front;
- }
-
-// attributes
- Statement *statement;
- StatementList *next;
-};
-
-class QML_PARSER_EXPORT VariableStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(VariableStatement)
-
- VariableStatement(VariableDeclarationList *vlist):
- declarations (vlist)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return declarationKindToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- VariableDeclarationList *declarations;
- SourceLocation declarationKindToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT VariableDeclaration: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(VariableDeclaration)
-
- VariableDeclaration(const QStringRef &n, ExpressionNode *e):
- name (n), expression (e), readOnly(false)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return expression ? expression->lastSourceLocation() : identifierToken; }
-
-// attributes
- QStringRef name;
- ExpressionNode *expression;
- bool readOnly;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT VariableDeclarationList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(VariableDeclarationList)
-
- VariableDeclarationList(VariableDeclaration *decl):
- declaration (decl), next (this)
- { kind = K; }
-
- VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl):
- declaration (decl)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return declaration->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (next)
- return next->lastSourceLocation();
- return declaration->lastSourceLocation();
- }
-
- inline VariableDeclarationList *finish (bool readOnly)
- {
- VariableDeclarationList *front = next;
- next = 0;
- if (readOnly) {
- VariableDeclarationList *vdl;
- for (vdl = front; vdl != 0; vdl = vdl->next)
- vdl->declaration->readOnly = true;
- }
- return front;
- }
-
-// attributes
- VariableDeclaration *declaration;
- VariableDeclarationList *next;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT EmptyStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(EmptyStatement)
-
- EmptyStatement() { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return semicolonToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT ExpressionStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ExpressionStatement)
-
- ExpressionStatement(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return expression->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT IfStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(IfStatement)
-
- IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0):
- expression (e), ok (t), ko (f)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return ifToken; }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (ko)
- return ko->lastSourceLocation();
-
- return ok->lastSourceLocation();
- }
-
-// attributes
- ExpressionNode *expression;
- Statement *ok;
- Statement *ko;
- SourceLocation ifToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
- SourceLocation elseToken;
-};
-
-class QML_PARSER_EXPORT DoWhileStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(DoWhileStatement)
-
- DoWhileStatement(Statement *stmt, ExpressionNode *e):
- statement (stmt), expression (e)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return doToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- Statement *statement;
- ExpressionNode *expression;
- SourceLocation doToken;
- SourceLocation whileToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT WhileStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(WhileStatement)
-
- WhileStatement(ExpressionNode *e, Statement *stmt):
- expression (e), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return whileToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation whileToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT ForStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ForStatement)
-
- ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
- initialiser (i), condition (c), expression (e), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return forToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *initialiser;
- ExpressionNode *condition;
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation forToken;
- SourceLocation lparenToken;
- SourceLocation firstSemicolonToken;
- SourceLocation secondSemicolonToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT LocalForStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(LocalForStatement)
-
- LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
- declarations (vlist), condition (c), expression (e), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return forToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- VariableDeclarationList *declarations;
- ExpressionNode *condition;
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation forToken;
- SourceLocation lparenToken;
- SourceLocation varToken;
- SourceLocation firstSemicolonToken;
- SourceLocation secondSemicolonToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT ForEachStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ForEachStatement)
-
- ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt):
- initialiser (i), expression (e), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return forToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *initialiser;
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation forToken;
- SourceLocation lparenToken;
- SourceLocation inToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT LocalForEachStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(LocalForEachStatement)
-
- LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt):
- declaration (v), expression (e), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return forToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- VariableDeclaration *declaration;
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation forToken;
- SourceLocation lparenToken;
- SourceLocation varToken;
- SourceLocation inToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT ContinueStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ContinueStatement)
-
- ContinueStatement(const QStringRef &l = QStringRef()):
- label (l) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return continueToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- QStringRef label;
- SourceLocation continueToken;
- SourceLocation identifierToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT BreakStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(BreakStatement)
-
- BreakStatement(const QStringRef &l):
- label (l) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return breakToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
- // attributes
- QStringRef label;
- SourceLocation breakToken;
- SourceLocation identifierToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT ReturnStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ReturnStatement)
-
- ReturnStatement(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return returnToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- ExpressionNode *expression;
- SourceLocation returnToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT WithStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(WithStatement)
-
- WithStatement(ExpressionNode *e, Statement *stmt):
- expression (e), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return withToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation withToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT CaseBlock: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(CaseBlock)
-
- CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
- clauses (c), defaultClause (d), moreClauses (r)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return lbraceToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbraceToken; }
-
-// attributes
- CaseClauses *clauses;
- DefaultClause *defaultClause;
- CaseClauses *moreClauses;
- SourceLocation lbraceToken;
- SourceLocation rbraceToken;
-};
-
-class QML_PARSER_EXPORT SwitchStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(SwitchStatement)
-
- SwitchStatement(ExpressionNode *e, CaseBlock *b):
- expression (e), block (b)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return switchToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return block->rbraceToken; }
-
-// attributes
- ExpressionNode *expression;
- CaseBlock *block;
- SourceLocation switchToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT CaseClause: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(CaseClause)
-
- CaseClause(ExpressionNode *e, StatementList *slist):
- expression (e), statements (slist)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return caseToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statements ? statements->lastSourceLocation() : colonToken; }
-
-// attributes
- ExpressionNode *expression;
- StatementList *statements;
- SourceLocation caseToken;
- SourceLocation colonToken;
-};
-
-class QML_PARSER_EXPORT CaseClauses: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(CaseClauses)
-
- CaseClauses(CaseClause *c):
- clause (c), next (this)
- { kind = K; }
-
- CaseClauses(CaseClauses *previous, CaseClause *c):
- clause (c)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return clause->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : clause->lastSourceLocation(); }
-
- inline CaseClauses *finish ()
- {
- CaseClauses *front = next;
- next = 0;
- return front;
- }
-
-//attributes
- CaseClause *clause;
- CaseClauses *next;
-};
-
-class QML_PARSER_EXPORT DefaultClause: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(DefaultClause)
-
- DefaultClause(StatementList *slist):
- statements (slist)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return defaultToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statements ? statements->lastSourceLocation() : colonToken; }
-
-// attributes
- StatementList *statements;
- SourceLocation defaultToken;
- SourceLocation colonToken;
-};
-
-class QML_PARSER_EXPORT LabelledStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(LabelledStatement)
-
- LabelledStatement(const QStringRef &l, Statement *stmt):
- label (l), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- QStringRef label;
- Statement *statement;
- SourceLocation identifierToken;
- SourceLocation colonToken;
-};
-
-class QML_PARSER_EXPORT ThrowStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(ThrowStatement)
-
- ThrowStatement(ExpressionNode *e):
- expression (e) { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return throwToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
- // attributes
- ExpressionNode *expression;
- SourceLocation throwToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT Catch: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(Catch)
-
- Catch(const QStringRef &n, Block *stmt):
- name (n), statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return catchToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- QStringRef name;
- Block *statement;
- SourceLocation catchToken;
- SourceLocation lparenToken;
- SourceLocation identifierToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT Finally: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(Finally)
-
- Finally(Block *stmt):
- statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return finallyToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement ? statement->lastSourceLocation() : finallyToken; }
-
-// attributes
- Block *statement;
- SourceLocation finallyToken;
-};
-
-class QML_PARSER_EXPORT TryStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(TryStatement)
-
- TryStatement(Statement *stmt, Catch *c, Finally *f):
- statement (stmt), catchExpression (c), finallyExpression (f)
- { kind = K; }
-
- TryStatement(Statement *stmt, Finally *f):
- statement (stmt), catchExpression (0), finallyExpression (f)
- { kind = K; }
-
- TryStatement(Statement *stmt, Catch *c):
- statement (stmt), catchExpression (c), finallyExpression (0)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return tryToken; }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (finallyExpression)
- return finallyExpression->statement->rbraceToken;
- else if (catchExpression)
- return catchExpression->statement->rbraceToken;
-
- return statement->lastSourceLocation();
- }
-
-// attributes
- Statement *statement;
- Catch *catchExpression;
- Finally *finallyExpression;
- SourceLocation tryToken;
-};
-
-class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FunctionExpression)
-
- FunctionExpression(const QStringRef &n, FormalParameterList *f, FunctionBody *b):
- name (n), formals (f), body (b)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return functionToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbraceToken; }
-
-// attributes
- QStringRef name;
- FormalParameterList *formals;
- FunctionBody *body;
- SourceLocation functionToken;
- SourceLocation identifierToken;
- SourceLocation lparenToken;
- SourceLocation rparenToken;
- SourceLocation lbraceToken;
- SourceLocation rbraceToken;
-};
-
-class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FunctionDeclaration)
-
- FunctionDeclaration(const QStringRef &n, FormalParameterList *f, FunctionBody *b):
- FunctionExpression(n, f, b)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-};
-
-class QML_PARSER_EXPORT FormalParameterList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FormalParameterList)
-
- FormalParameterList(const QStringRef &n):
- name (n), next (this)
- { kind = K; }
-
- FormalParameterList(FormalParameterList *previous, const QStringRef &n):
- name (n)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : identifierToken; }
-
- inline FormalParameterList *finish ()
- {
- FormalParameterList *front = next;
- next = 0;
- return front;
- }
-
-// attributes
- QStringRef name;
- FormalParameterList *next;
- SourceLocation commaToken;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT SourceElement: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(SourceElement)
-
- inline SourceElement()
- { kind = K; }
-};
-
-class QML_PARSER_EXPORT SourceElements: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(SourceElements)
-
- SourceElements(SourceElement *elt):
- element (elt), next (this)
- { kind = K; }
-
- SourceElements(SourceElements *previous, SourceElement *elt):
- element (elt)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return element->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : element->lastSourceLocation(); }
-
- inline SourceElements *finish ()
- {
- SourceElements *front = next;
- next = 0;
- return front;
- }
-
-// attributes
- SourceElement *element;
- SourceElements *next;
-};
-
-class QML_PARSER_EXPORT FunctionBody: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FunctionBody)
-
- FunctionBody(SourceElements *elts):
- elements (elts)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return elements ? elements->firstSourceLocation() : SourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return elements ? elements->lastSourceLocation() : SourceLocation(); }
-
-// attributes
- SourceElements *elements;
-};
-
-class QML_PARSER_EXPORT Program: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(Program)
-
- Program(SourceElements *elts):
- elements (elts)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return elements ? elements->firstSourceLocation() : SourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return elements ? elements->lastSourceLocation() : SourceLocation(); }
-
-// attributes
- SourceElements *elements;
-};
-
-class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(FunctionSourceElement)
-
- FunctionSourceElement(FunctionDeclaration *f):
- declaration (f)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return declaration->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return declaration->lastSourceLocation(); }
-
-// attributes
- FunctionDeclaration *declaration;
-};
-
-class QML_PARSER_EXPORT StatementSourceElement: public SourceElement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(StatementSourceElement)
-
- StatementSourceElement(Statement *stmt):
- statement (stmt)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return statement->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
-// attributes
- Statement *statement;
-};
-
-class QML_PARSER_EXPORT DebuggerStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(DebuggerStatement)
-
- DebuggerStatement()
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return debuggerToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- SourceLocation debuggerToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT UiQualifiedId: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiQualifiedId)
-
- UiQualifiedId(const QStringRef &name)
- : next(this), name(name)
- { kind = K; }
-
- UiQualifiedId(UiQualifiedId *previous, const QStringRef &name)
- : name(name)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- UiQualifiedId *finish()
- {
- UiQualifiedId *head = next;
- next = 0;
- return head;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : identifierToken; }
-
-// attributes
- UiQualifiedId *next;
- QStringRef name;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT UiImport: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiImport)
-
- UiImport(const QStringRef &fileName)
- : fileName(fileName), importUri(0)
- { kind = K; }
-
- UiImport(UiQualifiedId *uri)
- : importUri(uri)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return importToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- QStringRef fileName;
- UiQualifiedId *importUri;
- QStringRef importId;
- SourceLocation importToken;
- SourceLocation fileNameToken;
- SourceLocation versionToken;
- SourceLocation asToken;
- SourceLocation importIdToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT UiObjectMember: public Node
-{
-public:
- virtual SourceLocation firstSourceLocation() const = 0;
- virtual SourceLocation lastSourceLocation() const = 0;
-
- virtual UiObjectMember *uiObjectMemberCast();
-};
-
-class QML_PARSER_EXPORT UiObjectMemberList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiObjectMemberList)
-
- UiObjectMemberList(UiObjectMember *member)
- : next(this), member(member)
- { kind = K; }
-
- UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member)
- : member(member)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return member->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : member->lastSourceLocation(); }
-
- UiObjectMemberList *finish()
- {
- UiObjectMemberList *head = next;
- next = 0;
- return head;
- }
-
-// attributes
- UiObjectMemberList *next;
- UiObjectMember *member;
-};
-
-class QML_PARSER_EXPORT UiQualifiedPragmaId: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiQualifiedPragmaId)
-
- UiQualifiedPragmaId(const QStringRef &name)
- : next(this), name(name)
- { kind = K; }
-
- UiQualifiedPragmaId(UiQualifiedPragmaId *previous, const QStringRef &name)
- : name(name)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- UiQualifiedPragmaId *finish()
- {
- UiQualifiedPragmaId *head = next;
- next = 0;
- return head;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : identifierToken; }
-
-// attributes
- UiQualifiedPragmaId *next;
- QStringRef name;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT UiPragma: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiPragma)
-
- UiPragma(UiQualifiedPragmaId *type)
- : pragmaType(type)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return pragmaToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return semicolonToken; }
-
-// attributes
- UiQualifiedPragmaId *pragmaType;
- SourceLocation pragmaToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT UiHeaderItemList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiHeaderItemList)
-
- UiHeaderItemList(UiImport *import)
- : headerItem(import), next(this)
- { kind = K; }
-
- UiHeaderItemList(UiPragma *pragma)
- : headerItem(pragma), next(this)
- { kind = K; }
-
- UiHeaderItemList(UiHeaderItemList *previous, UiImport *import)
- : headerItem(import)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- UiHeaderItemList(UiHeaderItemList *previous, UiPragma *pragma)
- : headerItem(pragma)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- UiHeaderItemList *finish()
- {
- UiHeaderItemList *head = next;
- next = 0;
- return head;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return headerItem->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : headerItem->lastSourceLocation(); }
-
-// attributes
- Node *headerItem;
- UiHeaderItemList *next;
-};
-
-class QML_PARSER_EXPORT UiProgram: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiProgram)
-
- UiProgram(UiHeaderItemList *headers, UiObjectMemberList *members)
- : headers(headers), members(members)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- {
- if (headers)
- return headers->firstSourceLocation();
- else if (members)
- return members->firstSourceLocation();
- return SourceLocation();
- }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (members)
- return members->lastSourceLocation();
- else if (headers)
- return headers->lastSourceLocation();
- return SourceLocation();
- }
-
-// attributes
- UiHeaderItemList *headers;
- UiObjectMemberList *members;
-};
-
-class QML_PARSER_EXPORT UiArrayMemberList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiArrayMemberList)
-
- UiArrayMemberList(UiObjectMember *member)
- : next(this), member(member)
- { kind = K; }
-
- UiArrayMemberList(UiArrayMemberList *previous, UiObjectMember *member)
- : member(member)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return member->firstSourceLocation(); }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : member->lastSourceLocation(); }
-
- UiArrayMemberList *finish()
- {
- UiArrayMemberList *head = next;
- next = 0;
- return head;
- }
-
-// attributes
- UiArrayMemberList *next;
- UiObjectMember *member;
- SourceLocation commaToken;
-};
-
-class QML_PARSER_EXPORT UiObjectInitializer: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiObjectInitializer)
-
- UiObjectInitializer(UiObjectMemberList *members)
- : members(members)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return lbraceToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbraceToken; }
-
-// attributes
- SourceLocation lbraceToken;
- UiObjectMemberList *members;
- SourceLocation rbraceToken;
-};
-
-class QML_PARSER_EXPORT UiParameterList: public Node
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiParameterList)
-
- UiParameterList(const QStringRef &t, const QStringRef &n):
- type (t), name (n), next (this)
- { kind = K; }
-
- UiParameterList(UiParameterList *previous, const QStringRef &t, const QStringRef &n):
- type (t), name (n)
- {
- kind = K;
- next = previous->next;
- previous->next = this;
- }
-
- virtual void accept0(Visitor *);
-
- virtual SourceLocation firstSourceLocation() const
- { return propertyTypeToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return next ? next->lastSourceLocation() : identifierToken; }
-
- inline UiParameterList *finish ()
- {
- UiParameterList *front = next;
- next = 0;
- return front;
- }
-
-// attributes
- QStringRef type;
- QStringRef name;
- UiParameterList *next;
- SourceLocation commaToken;
- SourceLocation propertyTypeToken;
- SourceLocation identifierToken;
-};
-
-class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiPublicMember)
-
- UiPublicMember(const QStringRef &memberType,
- const QStringRef &name)
- : type(Property), memberType(memberType), name(name), statement(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
- { kind = K; }
-
- UiPublicMember(const QStringRef &memberType,
- const QStringRef &name,
- Statement *statement)
- : type(Property), memberType(memberType), name(name), statement(statement), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- {
- if (defaultToken.isValid())
- return defaultToken;
- else if (readonlyToken.isValid())
- return readonlyToken;
-
- return propertyToken;
- }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (binding)
- return binding->lastSourceLocation();
- if (statement)
- return statement->lastSourceLocation();
-
- return semicolonToken;
- }
-
-// attributes
- enum { Signal, Property } type;
- QStringRef typeModifier;
- QStringRef memberType;
- QStringRef name;
- Statement *statement; // initialized with a JS expression
- UiObjectMember *binding; // initialized with a QML object or array.
- bool isDefaultMember;
- bool isReadonlyMember;
- UiParameterList *parameters;
- SourceLocation defaultToken;
- SourceLocation readonlyToken;
- SourceLocation propertyToken;
- SourceLocation typeModifierToken;
- SourceLocation typeToken;
- SourceLocation identifierToken;
- SourceLocation colonToken;
- SourceLocation semicolonToken;
-};
-
-class QML_PARSER_EXPORT UiObjectDefinition: public UiObjectMember
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiObjectDefinition)
-
- UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId,
- UiObjectInitializer *initializer)
- : qualifiedTypeNameId(qualifiedTypeNameId), initializer(initializer)
- { kind = K; }
-
- virtual void accept0(Visitor *visitor);
-
- virtual SourceLocation firstSourceLocation() const
- { return qualifiedTypeNameId->identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return initializer->rbraceToken; }
-
-// attributes
- UiQualifiedId *qualifiedTypeNameId;
- UiObjectInitializer *initializer;
-};
-
-class QML_PARSER_EXPORT UiSourceElement: public UiObjectMember
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiSourceElement)
-
- UiSourceElement(Node *sourceElement)
- : sourceElement(sourceElement)
- { kind = K; }
-
- virtual SourceLocation firstSourceLocation() const
- {
- if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
- return funDecl->firstSourceLocation();
- else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
- return varStmt->firstSourceLocation();
-
- return SourceLocation();
- }
-
- virtual SourceLocation lastSourceLocation() const
- {
- if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
- return funDecl->lastSourceLocation();
- else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
- return varStmt->lastSourceLocation();
-
- return SourceLocation();
- }
-
- virtual void accept0(Visitor *visitor);
-
-
-// attributes
- Node *sourceElement;
-};
-
-class QML_PARSER_EXPORT UiObjectBinding: public UiObjectMember
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiObjectBinding)
-
- UiObjectBinding(UiQualifiedId *qualifiedId,
- UiQualifiedId *qualifiedTypeNameId,
- UiObjectInitializer *initializer)
- : qualifiedId(qualifiedId),
- qualifiedTypeNameId(qualifiedTypeNameId),
- initializer(initializer),
- hasOnToken(false)
- { kind = K; }
-
- virtual SourceLocation firstSourceLocation() const
- {
- if (hasOnToken && qualifiedTypeNameId)
- return qualifiedTypeNameId->identifierToken;
-
- return qualifiedId->identifierToken;
- }
-
- virtual SourceLocation lastSourceLocation() const
- { return initializer->rbraceToken; }
-
- virtual void accept0(Visitor *visitor);
-
-
-// attributes
- UiQualifiedId *qualifiedId;
- UiQualifiedId *qualifiedTypeNameId;
- UiObjectInitializer *initializer;
- SourceLocation colonToken;
- bool hasOnToken;
-};
-
-class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiScriptBinding)
-
- UiScriptBinding(UiQualifiedId *qualifiedId,
- Statement *statement)
- : qualifiedId(qualifiedId),
- statement(statement)
- { kind = K; }
-
- virtual SourceLocation firstSourceLocation() const
- { return qualifiedId->identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return statement->lastSourceLocation(); }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- UiQualifiedId *qualifiedId;
- Statement *statement;
- SourceLocation colonToken;
-};
-
-class QML_PARSER_EXPORT UiArrayBinding: public UiObjectMember
-{
-public:
- QQMLJS_DECLARE_AST_NODE(UiArrayBinding)
-
- UiArrayBinding(UiQualifiedId *qualifiedId,
- UiArrayMemberList *members)
- : qualifiedId(qualifiedId),
- members(members)
- { kind = K; }
-
- virtual SourceLocation firstSourceLocation() const
- { return qualifiedId->identifierToken; }
-
- virtual SourceLocation lastSourceLocation() const
- { return rbracketToken; }
-
- virtual void accept0(Visitor *visitor);
-
-// attributes
- UiQualifiedId *qualifiedId;
- UiArrayMemberList *members;
- SourceLocation colonToken;
- SourceLocation lbracketToken;
- SourceLocation rbracketToken;
-};
-
-} } // namespace AST
-
-
-
-QT_QML_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
deleted file mode 100644
index eae4125ab2..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSAST_FWD_P_H
-#define QQMLJSAST_FWD_P_H
-
-#include "qqmljsglobal_p.h"
-
-#include <QtCore/qglobal.h>
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS { namespace AST {
-
-class SourceLocation
-{
-public:
- explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
- : offset(offset), length(length),
- startLine(line), startColumn(column)
- { }
-
- bool isValid() const { return length != 0; }
-
- quint32 begin() const { return offset; }
- quint32 end() const { return offset + length; }
-
-// attributes
- // ### encode
- quint32 offset;
- quint32 length;
- quint32 startLine;
- quint32 startColumn;
-};
-
-class Visitor;
-class Node;
-class ExpressionNode;
-class Statement;
-class ThisExpression;
-class IdentifierExpression;
-class NullExpression;
-class TrueLiteral;
-class FalseLiteral;
-class NumericLiteral;
-class StringLiteral;
-class RegExpLiteral;
-class ArrayLiteral;
-class ObjectLiteral;
-class ElementList;
-class Elision;
-class PropertyAssignmentList;
-class PropertyGetterSetter;
-class PropertyNameAndValue;
-class PropertyName;
-class IdentifierPropertyName;
-class StringLiteralPropertyName;
-class NumericLiteralPropertyName;
-class ArrayMemberExpression;
-class FieldMemberExpression;
-class NewMemberExpression;
-class NewExpression;
-class CallExpression;
-class ArgumentList;
-class PostIncrementExpression;
-class PostDecrementExpression;
-class DeleteExpression;
-class VoidExpression;
-class TypeOfExpression;
-class PreIncrementExpression;
-class PreDecrementExpression;
-class UnaryPlusExpression;
-class UnaryMinusExpression;
-class TildeExpression;
-class NotExpression;
-class BinaryExpression;
-class ConditionalExpression;
-class Expression; // ### rename
-class Block;
-class StatementList;
-class VariableStatement;
-class VariableDeclarationList;
-class VariableDeclaration;
-class EmptyStatement;
-class ExpressionStatement;
-class IfStatement;
-class DoWhileStatement;
-class WhileStatement;
-class ForStatement;
-class LocalForStatement;
-class ForEachStatement;
-class LocalForEachStatement;
-class ContinueStatement;
-class BreakStatement;
-class ReturnStatement;
-class WithStatement;
-class SwitchStatement;
-class CaseBlock;
-class CaseClauses;
-class CaseClause;
-class DefaultClause;
-class LabelledStatement;
-class ThrowStatement;
-class TryStatement;
-class Catch;
-class Finally;
-class FunctionDeclaration;
-class FunctionExpression;
-class FormalParameterList;
-class FunctionBody;
-class Program;
-class SourceElements;
-class SourceElement;
-class FunctionSourceElement;
-class StatementSourceElement;
-class DebuggerStatement;
-class NestedExpression;
-
-// ui elements
-class UiProgram;
-class UiPragma;
-class UiImport;
-class UiPublicMember;
-class UiParameterList;
-class UiObjectDefinition;
-class UiObjectInitializer;
-class UiObjectBinding;
-class UiScriptBinding;
-class UiSourceElement;
-class UiArrayBinding;
-class UiObjectMember;
-class UiObjectMemberList;
-class UiArrayMemberList;
-class UiQualifiedId;
-class UiQualifiedPragmaId;
-class UiHeaderItemList;
-
-} } // namespace AST
-
-QT_QML_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp b/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp
deleted file mode 100644
index 4ba8b24940..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 "qqmljsastvisitor_p.h"
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS { namespace AST {
-
-Visitor::Visitor()
-{
-}
-
-Visitor::~Visitor()
-{
-}
-
-} } // namespace QQmlJS::AST
-
-QT_QML_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h b/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h
deleted file mode 100644
index 4e15b453f3..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h
+++ /dev/null
@@ -1,333 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSASTVISITOR_P_H
-#define QQMLJSASTVISITOR_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 "qqmljsastfwd_p.h"
-#include "qqmljsglobal_p.h"
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS { namespace AST {
-
-class QML_PARSER_EXPORT Visitor
-{
-public:
- Visitor();
- virtual ~Visitor();
-
- virtual bool preVisit(Node *) { return true; }
- virtual void postVisit(Node *) {}
-
- // Ui
- virtual bool visit(UiProgram *) { return true; }
- virtual bool visit(UiHeaderItemList *) { return true; }
- virtual bool visit(UiPragma *) { return true; }
- virtual bool visit(UiImport *) { return true; }
- virtual bool visit(UiPublicMember *) { return true; }
- virtual bool visit(UiSourceElement *) { return true; }
- virtual bool visit(UiObjectDefinition *) { return true; }
- virtual bool visit(UiObjectInitializer *) { return true; }
- virtual bool visit(UiObjectBinding *) { return true; }
- virtual bool visit(UiScriptBinding *) { return true; }
- virtual bool visit(UiArrayBinding *) { return true; }
- virtual bool visit(UiParameterList *) { return true; }
- virtual bool visit(UiObjectMemberList *) { return true; }
- virtual bool visit(UiArrayMemberList *) { return true; }
- virtual bool visit(UiQualifiedId *) { return true; }
- virtual bool visit(UiQualifiedPragmaId *) { return true; }
-
- virtual void endVisit(UiProgram *) {}
- virtual void endVisit(UiImport *) {}
- virtual void endVisit(UiHeaderItemList *) {}
- virtual void endVisit(UiPragma *) {}
- virtual void endVisit(UiPublicMember *) {}
- virtual void endVisit(UiSourceElement *) {}
- virtual void endVisit(UiObjectDefinition *) {}
- virtual void endVisit(UiObjectInitializer *) {}
- virtual void endVisit(UiObjectBinding *) {}
- virtual void endVisit(UiScriptBinding *) {}
- virtual void endVisit(UiArrayBinding *) {}
- virtual void endVisit(UiParameterList *) {}
- virtual void endVisit(UiObjectMemberList *) {}
- virtual void endVisit(UiArrayMemberList *) {}
- virtual void endVisit(UiQualifiedId *) {}
- virtual void endVisit(UiQualifiedPragmaId *) {}
-
- // QQmlJS
- virtual bool visit(ThisExpression *) { return true; }
- virtual void endVisit(ThisExpression *) {}
-
- virtual bool visit(IdentifierExpression *) { return true; }
- virtual void endVisit(IdentifierExpression *) {}
-
- virtual bool visit(NullExpression *) { return true; }
- virtual void endVisit(NullExpression *) {}
-
- virtual bool visit(TrueLiteral *) { return true; }
- virtual void endVisit(TrueLiteral *) {}
-
- virtual bool visit(FalseLiteral *) { return true; }
- virtual void endVisit(FalseLiteral *) {}
-
- virtual bool visit(StringLiteral *) { return true; }
- virtual void endVisit(StringLiteral *) {}
-
- virtual bool visit(NumericLiteral *) { return true; }
- virtual void endVisit(NumericLiteral *) {}
-
- virtual bool visit(RegExpLiteral *) { return true; }
- virtual void endVisit(RegExpLiteral *) {}
-
- virtual bool visit(ArrayLiteral *) { return true; }
- virtual void endVisit(ArrayLiteral *) {}
-
- virtual bool visit(ObjectLiteral *) { return true; }
- virtual void endVisit(ObjectLiteral *) {}
-
- virtual bool visit(ElementList *) { return true; }
- virtual void endVisit(ElementList *) {}
-
- virtual bool visit(Elision *) { return true; }
- virtual void endVisit(Elision *) {}
-
- virtual bool visit(PropertyAssignmentList *) { return true; }
- virtual void endVisit(PropertyAssignmentList *) {}
-
- virtual bool visit(PropertyNameAndValue *) { return true; }
- virtual void endVisit(PropertyNameAndValue *) {}
-
- virtual bool visit(PropertyGetterSetter *) { return true; }
- virtual void endVisit(PropertyGetterSetter *) {}
-
- virtual bool visit(NestedExpression *) { return true; }
- virtual void endVisit(NestedExpression *) {}
-
- virtual bool visit(IdentifierPropertyName *) { return true; }
- virtual void endVisit(IdentifierPropertyName *) {}
-
- virtual bool visit(StringLiteralPropertyName *) { return true; }
- virtual void endVisit(StringLiteralPropertyName *) {}
-
- virtual bool visit(NumericLiteralPropertyName *) { return true; }
- virtual void endVisit(NumericLiteralPropertyName *) {}
-
- virtual bool visit(ArrayMemberExpression *) { return true; }
- virtual void endVisit(ArrayMemberExpression *) {}
-
- virtual bool visit(FieldMemberExpression *) { return true; }
- virtual void endVisit(FieldMemberExpression *) {}
-
- virtual bool visit(NewMemberExpression *) { return true; }
- virtual void endVisit(NewMemberExpression *) {}
-
- virtual bool visit(NewExpression *) { return true; }
- virtual void endVisit(NewExpression *) {}
-
- virtual bool visit(CallExpression *) { return true; }
- virtual void endVisit(CallExpression *) {}
-
- virtual bool visit(ArgumentList *) { return true; }
- virtual void endVisit(ArgumentList *) {}
-
- virtual bool visit(PostIncrementExpression *) { return true; }
- virtual void endVisit(PostIncrementExpression *) {}
-
- virtual bool visit(PostDecrementExpression *) { return true; }
- virtual void endVisit(PostDecrementExpression *) {}
-
- virtual bool visit(DeleteExpression *) { return true; }
- virtual void endVisit(DeleteExpression *) {}
-
- virtual bool visit(VoidExpression *) { return true; }
- virtual void endVisit(VoidExpression *) {}
-
- virtual bool visit(TypeOfExpression *) { return true; }
- virtual void endVisit(TypeOfExpression *) {}
-
- virtual bool visit(PreIncrementExpression *) { return true; }
- virtual void endVisit(PreIncrementExpression *) {}
-
- virtual bool visit(PreDecrementExpression *) { return true; }
- virtual void endVisit(PreDecrementExpression *) {}
-
- virtual bool visit(UnaryPlusExpression *) { return true; }
- virtual void endVisit(UnaryPlusExpression *) {}
-
- virtual bool visit(UnaryMinusExpression *) { return true; }
- virtual void endVisit(UnaryMinusExpression *) {}
-
- virtual bool visit(TildeExpression *) { return true; }
- virtual void endVisit(TildeExpression *) {}
-
- virtual bool visit(NotExpression *) { return true; }
- virtual void endVisit(NotExpression *) {}
-
- virtual bool visit(BinaryExpression *) { return true; }
- virtual void endVisit(BinaryExpression *) {}
-
- virtual bool visit(ConditionalExpression *) { return true; }
- virtual void endVisit(ConditionalExpression *) {}
-
- virtual bool visit(Expression *) { return true; }
- virtual void endVisit(Expression *) {}
-
- virtual bool visit(Block *) { return true; }
- virtual void endVisit(Block *) {}
-
- virtual bool visit(StatementList *) { return true; }
- virtual void endVisit(StatementList *) {}
-
- virtual bool visit(VariableStatement *) { return true; }
- virtual void endVisit(VariableStatement *) {}
-
- virtual bool visit(VariableDeclarationList *) { return true; }
- virtual void endVisit(VariableDeclarationList *) {}
-
- virtual bool visit(VariableDeclaration *) { return true; }
- virtual void endVisit(VariableDeclaration *) {}
-
- virtual bool visit(EmptyStatement *) { return true; }
- virtual void endVisit(EmptyStatement *) {}
-
- virtual bool visit(ExpressionStatement *) { return true; }
- virtual void endVisit(ExpressionStatement *) {}
-
- virtual bool visit(IfStatement *) { return true; }
- virtual void endVisit(IfStatement *) {}
-
- virtual bool visit(DoWhileStatement *) { return true; }
- virtual void endVisit(DoWhileStatement *) {}
-
- virtual bool visit(WhileStatement *) { return true; }
- virtual void endVisit(WhileStatement *) {}
-
- virtual bool visit(ForStatement *) { return true; }
- virtual void endVisit(ForStatement *) {}
-
- virtual bool visit(LocalForStatement *) { return true; }
- virtual void endVisit(LocalForStatement *) {}
-
- virtual bool visit(ForEachStatement *) { return true; }
- virtual void endVisit(ForEachStatement *) {}
-
- virtual bool visit(LocalForEachStatement *) { return true; }
- virtual void endVisit(LocalForEachStatement *) {}
-
- virtual bool visit(ContinueStatement *) { return true; }
- virtual void endVisit(ContinueStatement *) {}
-
- virtual bool visit(BreakStatement *) { return true; }
- virtual void endVisit(BreakStatement *) {}
-
- virtual bool visit(ReturnStatement *) { return true; }
- virtual void endVisit(ReturnStatement *) {}
-
- virtual bool visit(WithStatement *) { return true; }
- virtual void endVisit(WithStatement *) {}
-
- virtual bool visit(SwitchStatement *) { return true; }
- virtual void endVisit(SwitchStatement *) {}
-
- virtual bool visit(CaseBlock *) { return true; }
- virtual void endVisit(CaseBlock *) {}
-
- virtual bool visit(CaseClauses *) { return true; }
- virtual void endVisit(CaseClauses *) {}
-
- virtual bool visit(CaseClause *) { return true; }
- virtual void endVisit(CaseClause *) {}
-
- virtual bool visit(DefaultClause *) { return true; }
- virtual void endVisit(DefaultClause *) {}
-
- virtual bool visit(LabelledStatement *) { return true; }
- virtual void endVisit(LabelledStatement *) {}
-
- virtual bool visit(ThrowStatement *) { return true; }
- virtual void endVisit(ThrowStatement *) {}
-
- virtual bool visit(TryStatement *) { return true; }
- virtual void endVisit(TryStatement *) {}
-
- virtual bool visit(Catch *) { return true; }
- virtual void endVisit(Catch *) {}
-
- virtual bool visit(Finally *) { return true; }
- virtual void endVisit(Finally *) {}
-
- virtual bool visit(FunctionDeclaration *) { return true; }
- virtual void endVisit(FunctionDeclaration *) {}
-
- virtual bool visit(FunctionExpression *) { return true; }
- virtual void endVisit(FunctionExpression *) {}
-
- virtual bool visit(FormalParameterList *) { return true; }
- virtual void endVisit(FormalParameterList *) {}
-
- virtual bool visit(FunctionBody *) { return true; }
- virtual void endVisit(FunctionBody *) {}
-
- virtual bool visit(Program *) { return true; }
- virtual void endVisit(Program *) {}
-
- virtual bool visit(SourceElements *) { return true; }
- virtual void endVisit(SourceElements *) {}
-
- virtual bool visit(FunctionSourceElement *) { return true; }
- virtual void endVisit(FunctionSourceElement *) {}
-
- virtual bool visit(StatementSourceElement *) { return true; }
- virtual void endVisit(StatementSourceElement *) {}
-
- virtual bool visit(DebuggerStatement *) { return true; }
- virtual void endVisit(DebuggerStatement *) {}
-};
-
-} } // namespace AST
-
-QT_QML_END_NAMESPACE
-
-#endif // QQMLJSASTVISITOR_P_H
diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
deleted file mode 100644
index 1c0a70a372..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 "qqmljsengine_p.h"
-#include "qqmljsglobal_p.h"
-
-#include <QtCore/qnumeric.h>
-#include <QtCore/qhash.h>
-#include <QtCore/qdebug.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-static inline int toDigit(char c)
-{
- if ((c >= '0') && (c <= '9'))
- return c - '0';
- else if ((c >= 'a') && (c <= 'z'))
- return 10 + c - 'a';
- else if ((c >= 'A') && (c <= 'Z'))
- return 10 + c - 'A';
- return -1;
-}
-
-double integerFromString(const char *buf, int size, int radix)
-{
- if (size == 0)
- return qSNaN();
-
- double sign = 1.0;
- int i = 0;
- if (buf[0] == '+') {
- ++i;
- } else if (buf[0] == '-') {
- sign = -1.0;
- ++i;
- }
-
- if (((size-i) >= 2) && (buf[i] == '0')) {
- if (((buf[i+1] == 'x') || (buf[i+1] == 'X'))
- && (radix < 34)) {
- if ((radix != 0) && (radix != 16))
- return 0;
- radix = 16;
- i += 2;
- } else {
- if (radix == 0) {
- radix = 8;
- ++i;
- }
- }
- } else if (radix == 0) {
- radix = 10;
- }
-
- int j = i;
- for ( ; i < size; ++i) {
- int d = toDigit(buf[i]);
- if ((d == -1) || (d >= radix))
- break;
- }
- double result;
- if (j == i) {
- if (!qstrcmp(buf, "Infinity"))
- result = qInf();
- else
- result = qSNaN();
- } else {
- result = 0;
- double multiplier = 1;
- for (--i ; i >= j; --i, multiplier *= radix)
- result += toDigit(buf[i]) * multiplier;
- }
- result *= sign;
- return result;
-}
-
-double integerFromString(const QString &str, int radix)
-{
- QByteArray ba = str.trimmed().toLatin1();
- return integerFromString(ba.constData(), ba.size(), radix);
-}
-
-
-Engine::Engine()
- : _lexer(0), _directives(0)
-{ }
-
-Engine::~Engine()
-{ }
-
-void Engine::setCode(const QString &code)
-{ _code = code; }
-
-void Engine::addComment(int pos, int len, int line, int col)
-{ if (len > 0) _comments.append(QQmlJS::AST::SourceLocation(pos, len, line, col)); }
-
-QList<QQmlJS::AST::SourceLocation> Engine::comments() const
-{ return _comments; }
-
-Lexer *Engine::lexer() const
-{ return _lexer; }
-
-void Engine::setLexer(Lexer *lexer)
-{ _lexer = lexer; }
-
-Directives *Engine::directives() const
-{ return _directives; }
-
-void Engine::setDirectives(Directives *directives)
-{ _directives = directives; }
-
-MemoryPool *Engine::pool()
-{ return &_pool; }
-
-QStringRef Engine::newStringRef(const QString &text)
-{
- const int pos = _extraCode.length();
- _extraCode += text;
- return _extraCode.midRef(pos, text.length());
-}
-
-QStringRef Engine::newStringRef(const QChar *chars, int size)
-{ return newStringRef(QString(chars, size)); }
-
-} // end of namespace QQmlJS
-
-QT_QML_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.h b/src/tools/qdoc/qmlparser/qqmljsengine_p.h
deleted file mode 100644
index fb65d7f028..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsengine_p.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSENGINE_P_H
-#define QQMLJSENGINE_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 "qqmljsglobal_p.h"
-#include "qqmljsastfwd_p.h"
-#include "qqmljsmemorypool_p.h"
-
-#include <QtCore/qstring.h>
-#include <QtCore/qset.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-class Lexer;
-class Directives;
-class MemoryPool;
-
-class QML_PARSER_EXPORT DiagnosticMessage
-{
-public:
- enum Kind { Warning, Error };
-
- DiagnosticMessage()
- : kind(Error) {}
-
- DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message)
- : kind(kind), loc(loc), message(message) {}
-
- bool isWarning() const
- { return kind == Warning; }
-
- bool isError() const
- { return kind == Error; }
-
- Kind kind;
- AST::SourceLocation loc;
- QString message;
-};
-
-class QML_PARSER_EXPORT Engine
-{
- Lexer *_lexer;
- Directives *_directives;
- MemoryPool _pool;
- QList<AST::SourceLocation> _comments;
- QString _extraCode;
- QString _code;
-
-public:
- Engine();
- ~Engine();
-
- void setCode(const QString &code);
- const QString &code() const { return _code; }
-
- void addComment(int pos, int len, int line, int col);
- QList<AST::SourceLocation> comments() const;
-
- Lexer *lexer() const;
- void setLexer(Lexer *lexer);
-
- Directives *directives() const;
- void setDirectives(Directives *directives);
-
- MemoryPool *pool();
-
- inline QStringRef midRef(int position, int size) { return _code.midRef(position, size); }
-
- QStringRef newStringRef(const QString &s);
- QStringRef newStringRef(const QChar *chars, int size);
-};
-
-double integerFromString(const char *buf, int size, int radix);
-
-} // end of namespace QQmlJS
-
-QT_QML_END_NAMESPACE
-
-#endif // QQMLJSENGINE_P_H
diff --git a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
deleted file mode 100644
index fe2cbe7d1d..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSGLOBAL_P_H
-#define QQMLJSGLOBAL_P_H
-
-#include <QtCore/qglobal.h>
-
-#ifdef QT_CREATOR
-# define QT_QML_BEGIN_NAMESPACE
-# define QT_QML_END_NAMESPACE
-
-# ifdef QDECLARATIVEJS_BUILD_DIR
-# define QML_PARSER_EXPORT Q_DECL_EXPORT
-# elif QML_BUILD_STATIC_LIB
-# define QML_PARSER_EXPORT
-# else
-# define QML_PARSER_EXPORT Q_DECL_IMPORT
-# endif // QQMLJS_BUILD_DIR
-
-#else // !QT_CREATOR
-# define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
-# define QT_QML_END_NAMESPACE QT_END_NAMESPACE
-# if defined(QT_BUILD_QMLDEVTOOLS_LIB) || defined(QT_QMLDEVTOOLS_LIB)
- // QmlDevTools is a static library
-# define QML_PARSER_EXPORT
-# elif defined(QT_BUILD_QML_LIB)
-# define QML_PARSER_EXPORT Q_DECL_EXPORT
-# else
-# define QML_PARSER_EXPORT Q_DECL_IMPORT
-# endif
-#endif // QT_CREATOR
-
-#endif // QQMLJSGLOBAL_P_H
diff --git a/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp b/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
deleted file mode 100644
index 609c490d06..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
+++ /dev/null
@@ -1,1078 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part 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$
-**
-****************************************************************************/
-
-// This file was generated by qlalr - DO NOT EDIT!
-#include "qqmljsgrammar_p.h"
-
-QT_BEGIN_NAMESPACE
-
-const char *const QQmlJSGrammar::spell [] = {
- "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ",", "continue",
- "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===",
- "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier",
- "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=",
- "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=",
- "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return",
- ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
- "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^",
- "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", 0,
- "public", "import", "pragma", "as", "on", "get", "set", 0, 0, 0,
- 0, 0, 0, 0, 0, 0};
-
-const short QQmlJSGrammar::lhs [] = {
- 106, 106, 106, 106, 106, 106, 107, 113, 113, 116,
- 116, 116, 116, 119, 121, 117, 117, 118, 118, 118,
- 118, 118, 118, 118, 118, 122, 123, 115, 114, 126,
- 126, 127, 127, 128, 128, 125, 111, 111, 111, 111,
- 130, 130, 130, 130, 130, 130, 130, 111, 138, 138,
- 138, 139, 139, 140, 140, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 124, 124, 124, 124, 124, 124, 124,
- 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 143, 143, 143, 143, 143, 143, 143, 143, 129, 145,
- 145, 145, 145, 144, 144, 149, 149, 149, 147, 147,
- 150, 150, 150, 150, 153, 153, 153, 153, 153, 153,
- 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
- 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
- 153, 153, 153, 153, 153, 154, 154, 120, 120, 120,
- 120, 120, 157, 157, 158, 158, 158, 158, 156, 156,
- 159, 159, 160, 160, 161, 161, 161, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 163, 163, 163,
- 163, 164, 164, 164, 165, 165, 165, 165, 166, 166,
- 166, 166, 166, 166, 166, 167, 167, 167, 167, 167,
- 167, 168, 168, 168, 168, 168, 169, 169, 169, 169,
- 169, 170, 170, 171, 171, 172, 172, 173, 173, 174,
- 174, 175, 175, 176, 176, 177, 177, 178, 178, 179,
- 179, 180, 180, 181, 181, 148, 148, 182, 182, 183,
- 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
- 183, 109, 109, 184, 184, 185, 185, 186, 186, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 131, 195, 195, 194, 194, 142,
- 142, 196, 196, 197, 197, 199, 199, 198, 200, 203,
- 201, 201, 204, 202, 202, 132, 133, 133, 134, 134,
- 187, 187, 187, 187, 187, 187, 187, 187, 188, 188,
- 188, 188, 189, 189, 189, 189, 190, 190, 135, 136,
- 205, 205, 208, 208, 206, 206, 209, 207, 191, 192,
- 192, 137, 137, 137, 210, 211, 193, 193, 212, 141,
- 155, 155, 213, 213, 152, 152, 151, 151, 214, 112,
- 112, 215, 215, 110, 110, 146, 146, 216};
-
-const short QQmlJSGrammar::rhs [] = {
- 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
- 1, 2, 2, 1, 1, 2, 2, 2, 2, 3,
- 3, 5, 5, 4, 4, 2, 2, 0, 1, 1,
- 2, 1, 3, 2, 3, 2, 1, 5, 4, 4,
- 1, 1, 1, 1, 1, 1, 1, 3, 1, 1,
- 1, 0, 1, 2, 4, 6, 6, 3, 3, 7,
- 7, 4, 4, 5, 5, 5, 6, 6, 10, 6,
- 7, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 3, 3, 4, 5, 3, 4, 3, 1, 1,
- 2, 3, 4, 1, 2, 3, 7, 8, 1, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
- 3, 5, 1, 2, 4, 4, 4, 3, 0, 1,
- 1, 3, 1, 1, 1, 2, 2, 1, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 1, 3, 3,
- 3, 1, 3, 3, 1, 3, 3, 3, 1, 3,
- 3, 3, 3, 3, 3, 1, 3, 3, 3, 3,
- 3, 1, 3, 3, 3, 3, 1, 3, 3, 3,
- 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 3, 1, 5, 1, 5, 1, 3, 1, 3, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 0, 1, 1, 3, 0, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 3, 1, 2, 0, 1, 3,
- 3, 1, 1, 1, 3, 1, 3, 2, 2, 2,
- 0, 1, 2, 0, 1, 1, 2, 2, 7, 5,
- 7, 7, 7, 5, 9, 10, 7, 8, 2, 2,
- 3, 3, 2, 2, 3, 3, 3, 3, 5, 5,
- 3, 5, 1, 2, 0, 1, 4, 3, 3, 3,
- 3, 3, 3, 4, 5, 2, 2, 2, 1, 8,
- 8, 7, 1, 3, 0, 1, 0, 1, 1, 1,
- 1, 1, 2, 1, 1, 0, 1, 2};
-
-const short QQmlJSGrammar::action_default [] = {
- 0, 0, 28, 0, 0, 0, 28, 0, 185, 252,
- 216, 224, 220, 164, 236, 212, 3, 149, 82, 165,
- 228, 232, 153, 182, 163, 168, 148, 202, 189, 0,
- 89, 90, 85, 0, 79, 74, 356, 0, 0, 0,
- 0, 87, 0, 0, 83, 86, 78, 0, 0, 75,
- 77, 80, 76, 88, 81, 0, 84, 0, 0, 178,
- 0, 0, 165, 184, 167, 166, 0, 0, 0, 180,
- 181, 179, 183, 0, 213, 0, 0, 0, 0, 203,
- 0, 0, 0, 0, 0, 0, 193, 0, 0, 0,
- 187, 188, 186, 191, 195, 194, 192, 190, 205, 204,
- 206, 0, 221, 0, 217, 0, 0, 159, 146, 158,
- 147, 115, 116, 117, 142, 118, 143, 119, 120, 121,
- 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
- 144, 132, 133, 134, 135, 136, 137, 138, 139, 140,
- 141, 145, 0, 0, 157, 253, 160, 0, 161, 0,
- 162, 156, 0, 249, 242, 240, 247, 248, 246, 245,
- 251, 244, 243, 241, 250, 237, 0, 225, 0, 0,
- 229, 0, 0, 233, 0, 0, 159, 151, 0, 150,
- 0, 155, 169, 0, 345, 345, 346, 0, 343, 0,
- 344, 0, 347, 260, 267, 266, 274, 262, 0, 263,
- 0, 348, 0, 355, 264, 265, 82, 270, 268, 352,
- 349, 354, 271, 0, 282, 0, 0, 0, 0, 339,
- 0, 356, 254, 296, 0, 0, 0, 283, 0, 0,
- 272, 273, 0, 261, 269, 297, 298, 0, 345, 0,
- 0, 347, 0, 340, 341, 0, 329, 353, 0, 313,
- 314, 315, 316, 0, 309, 310, 311, 312, 337, 338,
- 0, 0, 0, 0, 0, 301, 302, 303, 258, 256,
- 218, 226, 222, 238, 214, 259, 0, 165, 230, 234,
- 207, 196, 0, 0, 215, 0, 0, 0, 0, 208,
- 0, 0, 0, 0, 0, 200, 198, 201, 199, 197,
- 210, 209, 211, 0, 223, 0, 219, 0, 257, 165,
- 0, 239, 254, 255, 0, 254, 0, 0, 305, 0,
- 0, 0, 307, 0, 227, 0, 0, 231, 0, 0,
- 235, 294, 0, 286, 295, 289, 0, 293, 0, 254,
- 287, 0, 254, 0, 0, 306, 0, 0, 0, 308,
- 0, 0, 0, 300, 0, 299, 82, 109, 357, 0,
- 0, 114, 276, 279, 0, 115, 282, 118, 143, 120,
- 121, 85, 125, 126, 79, 127, 130, 83, 86, 254,
- 80, 88, 133, 81, 135, 84, 137, 138, 283, 140,
- 141, 145, 0, 111, 110, 113, 97, 112, 96, 0,
- 106, 277, 275, 0, 0, 0, 347, 0, 107, 153,
- 154, 159, 0, 152, 0, 317, 318, 0, 345, 0,
- 0, 347, 0, 108, 0, 0, 0, 320, 325, 323,
- 326, 0, 0, 324, 325, 0, 321, 0, 322, 278,
- 328, 0, 278, 327, 0, 330, 331, 0, 278, 332,
- 333, 0, 0, 334, 0, 0, 0, 335, 336, 171,
- 170, 0, 0, 0, 304, 0, 0, 0, 319, 291,
- 284, 0, 292, 288, 0, 290, 280, 0, 281, 285,
- 0, 0, 347, 0, 342, 100, 0, 0, 104, 91,
- 0, 93, 102, 0, 94, 103, 105, 95, 101, 92,
- 0, 98, 175, 173, 177, 174, 172, 176, 350, 6,
- 351, 4, 2, 72, 99, 0, 0, 75, 77, 76,
- 37, 5, 0, 73, 0, 51, 50, 49, 0, 0,
- 64, 0, 65, 41, 42, 43, 44, 46, 47, 68,
- 45, 0, 51, 0, 0, 0, 0, 0, 60, 0,
- 61, 0, 0, 32, 0, 0, 69, 33, 0, 36,
- 34, 30, 0, 35, 31, 0, 62, 0, 63, 153,
- 0, 66, 70, 0, 0, 0, 0, 153, 278, 0,
- 67, 82, 115, 282, 118, 143, 120, 121, 85, 125,
- 126, 127, 130, 83, 86, 254, 88, 133, 81, 135,
- 84, 137, 138, 283, 140, 141, 145, 71, 0, 58,
- 52, 59, 53, 0, 0, 0, 0, 55, 0, 56,
- 57, 54, 0, 0, 0, 0, 48, 0, 38, 39,
- 0, 40, 8, 0, 0, 9, 0, 11, 0, 10,
- 0, 1, 27, 15, 14, 26, 13, 12, 29, 7,
- 0, 18, 0, 19, 0, 24, 25, 0, 20, 21,
- 0, 22, 23, 16, 17, 358};
-
-const short QQmlJSGrammar::goto_default [] = {
- 7, 641, 211, 198, 209, 521, 509, 636, 649, 508,
- 635, 639, 637, 645, 22, 642, 640, 638, 18, 520,
- 562, 552, 559, 554, 539, 193, 197, 199, 204, 234,
- 212, 231, 543, 613, 612, 203, 233, 26, 487, 486,
- 359, 358, 9, 357, 360, 202, 480, 361, 109, 17,
- 147, 24, 13, 146, 19, 25, 59, 23, 8, 28,
- 27, 280, 15, 274, 10, 270, 12, 272, 11, 271,
- 20, 278, 21, 279, 14, 273, 269, 310, 414, 275,
- 276, 205, 195, 194, 208, 207, 230, 196, 364, 363,
- 232, 471, 470, 332, 333, 473, 335, 472, 334, 427,
- 431, 434, 430, 429, 449, 450, 200, 186, 201, 210,
- 0};
-
-const short QQmlJSGrammar::action_index [] = {
- 264, 1225, 2708, 2708, 2606, 938, 94, 104, 119, -106,
- 92, 79, 81, 262, -106, 263, 78, -106, -106, 654,
- 89, 125, 259, 229, -106, -106, -106, 322, 314, 1225,
- -106, -106, -106, 412, -106, -106, 2300, 1713, 1225, 1225,
- 1225, -106, 842, 1225, -106, -106, -106, 1225, 1225, -106,
- -106, -106, -106, -106, -106, 1225, -106, 1225, 1225, -106,
- 1225, 1225, 141, 216, -106, -106, 1225, 1225, 1225, -106,
- -106, -106, 209, 1225, 281, 1225, 1225, 1225, 1225, 367,
- 1225, 1225, 1225, 1225, 1225, 1225, 219, 1225, 1225, 1225,
- 101, 102, 115, 314, 314, 314, 314, 314, 357, 347,
- 337, 1225, 71, 1225, 70, 2198, 1225, 1225, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, 98, 1225, -106, -106, 66, 65, -106, 1225,
- -106, -106, 1225, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, 1225, 44, 1225, 1225,
- 64, 57, 1225, -106, 2198, 1225, 1225, -106, 137, -106,
- 49, -106, -106, 93, 344, 474, 95, 86, -106, 390,
- -106, 85, 2708, -106, -106, -106, -106, -106, 189, -106,
- 474, -106, 80, -106, -106, -106, 83, -106, -106, -106,
- 2708, -106, -106, 490, -106, 551, 130, 2606, 46, 51,
- 52, 2912, 1225, -106, 63, 1225, 56, -106, 58, 60,
- -106, -106, 474, -106, -106, -106, -106, 61, 474, 62,
- 67, 2708, 68, -106, -106, 2606, -106, -106, 87, -106,
- -106, -106, -106, 110, -106, -106, -106, -106, -106, -106,
- -24, 69, 1225, 122, 143, -106, -106, -106, 1419, -106,
- 74, 76, 77, -106, 269, 73, 72, 611, 75, 114,
- 397, 314, 474, 1225, 287, 1225, 1225, 1225, 1225, 397,
- 1225, 1225, 1225, 1225, 1225, 218, 215, 198, 192, 182,
- 397, 397, 312, 1225, 55, 1225, 59, 1225, -106, 654,
- 1225, -106, 1225, 54, 53, 1225, 50, 2606, -106, 1225,
- 124, 2606, -106, 1225, 90, 1225, 1225, 105, 88, 1225,
- -106, 84, 157, -27, -106, -106, 1225, -106, 474, 1225,
- -106, 82, 1225, 91, 2606, -106, 1225, 120, 2606, -106,
- 1225, 103, 2606, -9, 2606, -106, -2, -106, 11, -30,
- 17, -106, -106, 2606, -37, 469, 15, 551, 138, 1225,
- 2606, 14, -16, 433, 2402, -20, 842, 6, 5, 1324,
- 2402, 4, -36, 2, 1225, 7, -18, 1225, 10, 1225,
- -26, -13, 2504, -106, -106, -106, -106, -106, -106, 1225,
- -106, -106, -106, -33, -59, -25, 2708, 23, -106, 197,
- -106, 1225, -12, -106, 140, -106, -106, 22, 474, -4,
- 26, 2708, 12, -106, 1225, 113, 30, -106, 142, -106,
- 142, 121, 1225, -106, -3, 45, -106, -5, -106, 2606,
- -106, 108, 2606, -106, 207, -106, -106, 106, 2606, 37,
- -106, 25, 36, -106, 474, 38, 40, -106, -106, -106,
- -106, 1225, 136, 2606, -106, 1225, 166, 2606, -106, 13,
- -106, 200, -106, -106, 1225, -106, -106, 474, -106, -106,
- -17, 16, 2708, -11, -106, -106, 131, 1811, -106, -106,
- 1615, -106, -106, 1517, -106, -106, -106, -106, -106, -106,
- 109, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- 2708, -106, -106, -106, 233, -19, 748, 152, -60, 41,
- -106, -106, 191, -106, 177, -106, -106, -106, 387, 203,
- -106, 1906, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, 180, 43, 376, 174, 48, 474, 240, -106, 8,
- -106, 748, 111, -106, -1, 748, -106, -106, 1130, -106,
- -106, -106, 1034, -106, -106, 228, -106, 1906, -106, 295,
- 21, -106, -106, 184, 379, 39, 2001, 288, 2810, 18,
- -106, 34, 482, 33, 551, 138, 1225, 2606, 31, 9,
- 399, 3, 643, 19, 29, 1324, 28, 1, 27, 1225,
- 24, 0, 1225, 20, 1225, -7, -8, -106, 193, -106,
- 205, -106, 47, 42, 329, 208, 319, -106, 128, -106,
- -106, -106, 2096, 748, 1713, 35, -106, 132, -106, -106,
- 32, -106, -106, 748, 748, 94, 748, -106, 250, -106,
- 116, -106, -106, 233, 233, -106, -106, -106, -106, -106,
- 393, -106, 214, -106, 100, -106, -106, 474, -106, -106,
- 96, -106, -106, -106, -106, -106,
-
- -111, 15, 71, 87, 80, 305, -6, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -42,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, 95,
- -111, -111, -111, 3, -111, -111, -5, -11, 9, 109,
- 91, -111, 62, 45, -111, -111, -111, 50, 63, -111,
- -111, -111, -111, -111, -111, 32, -111, 203, 197, -111,
- 189, 178, -111, -111, -111, -111, 182, 185, 188, -111,
- -111, -111, -111, 193, -111, 198, 168, 113, 114, -111,
- 133, 116, 123, 129, 130, 132, -111, 136, 139, 142,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, 148, -111, 151, -111, 186, 6, -37, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, 42, -111, -111, -111, -111, -111, 22,
- -111, -111, 2, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, 96, -111, 66, 21,
- -111, -111, 0, -111, 274, 35, 88, -111, -111, -111,
- -111, -111, -111, -111, 41, 75, -111, -111, -111, 49,
- -111, -111, 48, -111, -111, -111, -111, -111, -111, -111,
- 57, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- 77, -111, -111, 54, -111, 27, -111, 243, -111, 25,
- -111, 160, 36, -111, -111, 169, 40, -111, -111, -111,
- -111, -111, 56, -111, -111, -111, -111, -111, 180, -111,
- -111, 163, -111, -111, -111, 246, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, 8, -111, -111, -111, -111, -111, 69, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, 61, 211, -111, 272, 257, 256, 236, -111,
- 81, 83, 85, 68, 94, -111, -111, -111, -111, -111,
- -111, -111, -111, 235, -111, 218, -111, 209, -111, -111,
- 244, -111, 227, -111, -111, 228, -111, 238, -111, 33,
- -111, 167, -111, 245, -111, 253, 254, -111, -111, 225,
- -111, -111, -111, -111, -111, -111, 217, -111, 194, 213,
- -111, -111, 208, -111, 207, -111, 52, -111, 205, -111,
- 55, -111, 201, -111, 199, -111, -111, -111, -111, -111,
- -111, -111, -111, 278, -111, 39, -111, 34, -111, 173,
- 219, -111, -111, 53, 231, -111, 73, -111, -111, 44,
- 59, -111, -111, -111, 47, -111, 24, 102, -111, 101,
- -111, -111, 111, -111, -111, -111, -111, -111, -111, 26,
- -111, -111, -111, -111, -111, -111, 65, -111, -111, -111,
- -111, 76, -111, -111, -111, -111, -111, -111, 79, -111,
- -111, 89, -111, -111, 51, -111, -111, -111, -111, -111,
- -62, -111, 37, -111, -63, -111, -111, -111, -111, 387,
- -111, -111, 264, -111, -111, -111, -111, -111, 158, -54,
- -111, -111, 28, -111, 38, -111, 23, -111, -111, -111,
- -111, 43, -111, 78, -111, 58, -111, 67, -111, -111,
- -111, -111, -111, -111, 18, -111, -111, 195, -111, -111,
- -111, -111, 161, -111, -111, -111, -111, 20, -111, -111,
- 157, -111, -111, 31, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- 206, -111, -111, -111, -111, -111, -7, -111, -111, -111,
- -111, -111, -111, -111, -24, -111, -111, -111, -12, -111,
- -111, 342, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -16, -32, -111, 5, -111, -111, -111,
- -111, 152, -111, -111, -111, 248, -111, -111, 330, -111,
- -111, -111, 324, -111, -111, -111, -111, 385, -111, -111,
- -21, -111, -111, 1, 14, -111, 367, -111, 232, 12,
- -111, -111, 11, -111, 10, -111, 164, 141, -111, -111,
- 7, -111, 64, -111, -111, 19, -111, -111, -111, 17,
- -111, -1, 60, -111, 46, -111, -111, -111, -111, -111,
- -15, -111, -111, -111, -2, -17, -4, -111, -111, -111,
- -111, -111, 484, 138, 313, -3, -111, -111, -111, -111,
- 4, -111, -111, 13, 16, 97, 127, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -14, -111, -111, -111, -111, -111, -111, -8, -111, -111,
- -111, -111, -111, -111, -111, -111};
-
-const short QQmlJSGrammar::action_info [] = {
- 424, 405, 432, 404, 346, 245, 573, 354, 406, -134,
- 461, -112, -113, -131, -136, 448, 350, -139, 402, 392,
- 268, -123, -142, 465, 399, 398, -131, -139, 465, 461,
- 474, -136, 558, 448, -134, -112, -113, 424, -123, 350,
- -142, 245, 551, 481, 484, 268, 576, 524, 413, 482,
- 438, 558, 439, 261, 558, 615, 420, 452, 418, 421,
- 283, 454, 143, 428, 172, 558, 166, 423, 558, 448,
- 608, 73, 546, 448, 149, 283, 0, 323, 408, 0,
- 544, 307, 268, 0, 0, 0, 143, 184, 350, 448,
- 245, 166, 101, 73, 461, 329, 465, 238, 456, 424,
- 241, 336, 618, 189, 665, 262, 143, 323, 0, 181,
- 317, 143, 451, 0, 315, 442, 143, 143, 192, 555,
- 0, 143, 240, 243, 303, 151, 452, 101, 143, 185,
- 143, 435, 143, 312, 305, 244, 0, 0, 303, 490,
- 555, 60, 60, 342, 143, 143, 191, 432, 252, 251,
- 103, 344, 61, 61, 144, 60, 305, 662, 661, 60,
- 103, 656, 655, 352, 325, 338, 61, 556, 326, 501,
- 61, 257, 256, 426, 143, 168, 436, 664, 663, 169,
- 348, 542, 264, 64, 321, 633, 634, 491, 628, 620,
- 619, 259, 258, 179, 65, 174, 463, 143, 622, 259,
- 258, 416, 415, 525, 267, 265, 525, 87, 477, 88,
- 531, 0, 174, 525, 175, 143, 411, 87, 339, 88,
- 89, 66, 0, 87, 558, 88, 467, 527, 66, 610,
- 89, 175, 266, 411, 525, 567, 89, 525, 526, 0,
- 87, 66, 88, 87, 87, 88, 88, 549, 174, 527,
- 236, 235, 527, 89, 611, 609, 89, 89, 0, 527,
- 526, 478, 476, 526, 532, 530, 67, 175, 446, 445,
- 526, 0, 68, 67, 174, 659, 658, 105, 0, 68,
- 527, 75, 76, 527, 0, 623, 67, 285, 286, 568,
- 566, 526, 68, 175, 526, 176, 106, 652, 107, 75,
- 76, 550, 548, 174, 0, 285, 286, 657, 77, 78,
- 174, 653, 651, 0, 287, 288, 0, 0, 0, 0,
- 0, -99, 175, 0, 176, 0, 77, 78, -99, 175,
- 0, 176, 287, 288, 0, 290, 291, 0, 0, 87,
- 0, 88, 0, 650, 292, 80, 81, 293, 35, 294,
- 0, 0, 89, 82, 83, 0, 0, 84, 35, 85,
- 80, 81, 6, 5, 4, 1, 3, 2, 82, 83,
- 80, 81, 84, 35, 85, 0, 0, 0, 82, 83,
- 80, 81, 84, 0, 85, 49, 52, 50, 82, 83,
- 80, 81, 84, 0, 85, 49, 52, 50, 82, 83,
- 0, 0, 84, 0, 85, 35, 0, 0, 35, 0,
- 49, 52, 50, 46, 34, 51, 35, 0, 0, 35,
- 290, 291, 35, 46, 34, 51, 0, 0, 35, 292,
- 0, 0, 293, 0, 294, 184, 0, 0, 46, 34,
- 51, 35, 49, 52, 50, 49, 52, 50, 184, 0,
- 0, 0, 0, 49, 52, 50, 49, 52, 50, 49,
- 52, 50, 35, 0, 0, 49, 52, 50, 0, 184,
- 46, 34, 51, 46, 34, 51, 0, 0, 49, 52,
- 50, 46, 34, 51, 46, 34, 51, 46, 34, 51,
- 0, 0, 0, 46, 34, 51, 0, 0, 35, 49,
- 52, 50, 0, 35, 0, 0, 46, 34, 51, 0,
- 0, 35, 0, 0, 0, 0, 0, 0, 0, 35,
- 0, 0, 0, 0, 0, 0, 0, 46, 34, 51,
- 250, 249, 0, 0, 0, 49, 52, 50, 0, 0,
- 49, 52, 50, 250, 249, 0, 0, 0, 49, 52,
- 50, 250, 249, 0, 0, 0, 49, 52, 50, 0,
- 0, 0, 0, 46, 34, 51, 0, 0, 46, 34,
- 51, 0, 0, 0, 0, 0, 46, 34, 51, 0,
- 35, 0, 0, 0, 46, 34, 51, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 255, 254, 153, 0, 0, 49, 52, 50,
- 0, 0, 0, 0, 154, 0, 0, 0, 155, 0,
- 0, 0, 0, 0, 0, 0, 0, 156, 0, 157,
- 0, 0, 319, 0, 0, 46, 34, 51, 0, 0,
- 158, 0, 159, 64, 0, 30, 31, 153, 0, 0,
- 160, 0, 0, 161, 65, 33, 0, 154, 0, 162,
- 0, 155, 35, 0, 0, 163, 36, 37, 0, 38,
- 156, 0, 157, 0, 0, 0, 42, 0, 0, 0,
- 45, 164, 0, 158, 0, 159, 64, 0, 0, 0,
- 0, 0, 0, 160, 0, 0, 161, 65, 53, 49,
- 52, 50, 162, 54, 0, 0, 0, 0, 163, 0,
- 0, 0, 0, 0, 44, 56, 32, 0, 0, 0,
- 41, 0, 0, 0, 164, 0, 0, 46, 34, 51,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
- 33, 0, 0, 0, 0, 0, 0, 35, 0, 0,
- 0, 36, 37, 0, 38, 0, 0, 0, 0, 0,
- 0, 516, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 53, 49, 52, 50, 0, 54, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 44,
- 56, 32, 0, 0, 0, 41, 0, 0, 0, 0,
- 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 30, 31, 0, 0, 0, 0,
- 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
- 0, 35, 0, 0, 0, 36, 37, 0, 38, 0,
- 0, 0, 0, 0, 0, 42, 0, 0, 0, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 53, 49, 52,
- 50, 0, 54, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 44, 56, 32, 0, 0, 0, 41,
- 0, 0, 0, 0, 0, 0, 46, 34, 51, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 515, 0,
- 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
- 219, 0, 0, 0, 0, 0, 0, 35, 0, 0,
- 0, 36, 37, 0, 38, 0, 0, 0, 0, 0,
- 0, 516, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 53, 517, 519, 518, 0, 54, 0,
- 0, 0, 0, 227, 0, 0, 0, 0, 0, 44,
- 56, 32, 214, 0, 0, 41, 0, 0, 0, 0,
- 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 515, 0, 30, 31, 0, 0,
- 0, 0, 0, 0, 0, 0, 219, 0, 0, 0,
- 0, 0, 0, 35, 0, 0, 0, 36, 37, 0,
- 38, 0, 0, 0, 0, 0, 0, 516, 0, 0,
- 0, 45, 0, 0, 0, 0, 0, 0, 0, 563,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 53,
- 517, 519, 518, 0, 54, 0, 0, 0, 0, 227,
- 0, 0, 0, 0, 0, 44, 56, 32, 214, 0,
- 0, 41, 0, 0, 0, 0, 0, 0, 46, 34,
- 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 515, 0, 30, 31, 0, 0, 0, 0, 0, 0,
- 0, 0, 219, 0, 0, 0, 0, 0, 0, 35,
- 0, 0, 0, 36, 37, 0, 38, 0, 0, 0,
- 0, 0, 0, 516, 0, 0, 0, 45, 0, 0,
- 0, 0, 0, 0, 0, 560, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 53, 517, 519, 518, 0,
- 54, 0, 0, 0, 0, 227, 0, 0, 0, 0,
- 0, 44, 56, 32, 214, 0, 0, 41, 0, 0,
- 0, 0, 0, 0, 46, 34, 51, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 29, 30, 31, 0,
- 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
- 0, 0, 0, 0, 35, 0, 0, 0, 36, 37,
- 0, 38, 0, 0, 0, 39, 0, 40, 42, 43,
- 0, 0, 45, 0, 0, 0, 47, 0, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 53, 49, 52, 50, 0, 54, 0, 55, 0, 57,
- 0, 58, 0, 0, 0, 0, 44, 56, 32, 0,
- 0, 0, 41, 0, 0, 0, 0, 0, 0, 46,
- 34, 51, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, -132, 0, 0, 0, 29, 30, 31, 0, 0,
- 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
- 0, 0, 0, 35, 0, 0, 0, 36, 37, 0,
- 38, 0, 0, 0, 39, 0, 40, 42, 43, 0,
- 0, 45, 0, 0, 0, 47, 0, 48, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 53,
- 49, 52, 50, 0, 54, 0, 55, 0, 57, 0,
- 58, 0, 0, 0, 0, 44, 56, 32, 0, 0,
- 0, 41, 0, 0, 0, 0, 0, 0, 46, 34,
- 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 0, 0, 0, 0, 35, 0,
- 0, 0, 36, 37, 0, 38, 0, 0, 0, 39,
- 0, 40, 42, 43, 0, 0, 45, 0, 0, 0,
- 47, 0, 48, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 53, 49, 52, 50, 0, 54,
- 0, 55, 0, 57, 282, 58, 0, 0, 0, 0,
- 44, 56, 32, 0, 0, 0, 41, 0, 0, 0,
- 0, 0, 0, 46, 34, 51, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 496, 0, 0, 29, 30,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
- 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
- 36, 37, 0, 38, 0, 0, 0, 39, 0, 40,
- 42, 43, 0, 0, 45, 0, 0, 0, 47, 0,
- 48, 0, 0, 497, 0, 0, 0, 0, 0, 0,
- 0, 0, 53, 49, 52, 50, 0, 54, 0, 55,
- 0, 57, 0, 58, 0, 0, 0, 0, 44, 56,
- 32, 0, 0, 0, 41, 0, 0, 0, 0, 0,
- 0, 46, 34, 51, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 488, 0, 0, 29, 30, 31, 0,
- 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
- 0, 0, 0, 0, 35, 0, 0, 0, 36, 37,
- 0, 38, 0, 0, 0, 39, 0, 40, 42, 43,
- 0, 0, 45, 0, 0, 0, 47, 0, 48, 0,
- 0, 494, 0, 0, 0, 0, 0, 0, 0, 0,
- 53, 49, 52, 50, 0, 54, 0, 55, 0, 57,
- 0, 58, 0, 0, 0, 0, 44, 56, 32, 0,
- 0, 0, 41, 0, 0, 0, 0, 0, 0, 46,
- 34, 51, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 488, 0, 0, 29, 30, 31, 0, 0, 0,
- 0, 0, 0, 0, 0, 33, 0, 0, 0, 0,
- 0, 0, 35, 0, 0, 0, 36, 37, 0, 38,
- 0, 0, 0, 39, 0, 40, 42, 43, 0, 0,
- 45, 0, 0, 0, 47, 0, 48, 0, 0, 489,
- 0, 0, 0, 0, 0, 0, 0, 0, 53, 49,
- 52, 50, 0, 54, 0, 55, 0, 57, 0, 58,
- 0, 0, 0, 0, 44, 56, 32, 0, 0, 0,
- 41, 0, 0, 0, 0, 0, 0, 46, 34, 51,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 496,
- 0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
- 0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
- 35, 0, 0, 0, 36, 37, 0, 38, 0, 0,
- 0, 39, 0, 40, 42, 43, 0, 0, 45, 0,
- 0, 0, 47, 0, 48, 0, 0, 499, 0, 0,
- 0, 0, 0, 0, 0, 0, 53, 49, 52, 50,
- 0, 54, 0, 55, 0, 57, 0, 58, 0, 0,
- 0, 0, 44, 56, 32, 0, 0, 0, 41, 0,
- 0, 0, 0, 0, 0, 46, 34, 51, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 29, 30, 31,
- 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 0, 0, 35, 220, 0, 0, 221,
- 37, 0, 38, 0, 0, 0, 39, 0, 40, 42,
- 43, 0, 0, 45, 0, 0, 0, 47, 0, 48,
- 0, 0, 0, 0, 0, 0, 0, 223, 0, 0,
- 0, 53, 49, 52, 50, 224, 54, 0, 55, 226,
- 57, 0, 58, 0, 229, 0, 0, 44, 56, 32,
- 0, 0, 0, 41, 0, 0, 0, 0, 0, 0,
- 46, 34, 51, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
- 0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
- 35, 220, 0, 0, 578, 37, 0, 38, 0, 0,
- 0, 39, 0, 40, 42, 43, 0, 0, 45, 0,
- 0, 0, 47, 0, 48, 0, 0, 0, 0, 0,
- 0, 0, 223, 0, 0, 0, 53, 49, 52, 50,
- 224, 54, 0, 55, 226, 57, 0, 58, 0, 229,
- 0, 0, 44, 56, 32, 0, 0, 0, 41, 0,
- 0, 0, 0, 0, 0, 46, 34, 51, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 29, 30, 31,
- 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 0, 0, 35, 220, 0, 0, 578,
- 624, 0, 38, 0, 0, 0, 39, 0, 40, 42,
- 43, 0, 0, 45, 0, 0, 0, 47, 0, 48,
- 0, 0, 0, 0, 0, 0, 0, 223, 0, 0,
- 0, 53, 49, 52, 50, 224, 54, 0, 55, 226,
- 57, 0, 58, 0, 229, 0, 0, 44, 56, 32,
- 0, 0, 0, 41, 0, 0, 0, 0, 0, 0,
- 46, 34, 51, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 111, 112, 113, 0, 0, 115, 117, 118,
- 0, 0, 119, 0, 120, 0, 0, 0, 122, 123,
- 124, 0, 0, 0, 0, 0, 0, 35, 125, 126,
- 127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 128, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 131, 0, 0,
- 0, 0, 0, 0, 49, 52, 50, 132, 133, 134,
- 0, 136, 137, 138, 139, 140, 141, 0, 0, 129,
- 135, 121, 114, 116, 130, 0, 0, 0, 0, 0,
- 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 111, 112, 113, 0, 0, 115,
- 117, 118, 0, 0, 119, 0, 120, 0, 0, 0,
- 122, 123, 124, 0, 0, 0, 0, 0, 0, 35,
- 125, 126, 127, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 128, 0, 0, 0, 395, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 131,
- 0, 0, 0, 0, 0, 397, 49, 52, 50, 132,
- 133, 134, 0, 136, 137, 138, 139, 140, 141, 0,
- 0, 129, 135, 121, 114, 116, 130, 0, 0, 0,
- 0, 0, 0, 0, 46, 374, 380, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 111, 112, 113, 0,
- 0, 115, 117, 118, 0, 0, 119, 0, 120, 0,
- 0, 0, 122, 123, 124, 0, 0, 0, 0, 0,
- 0, 35, 125, 126, 127, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 128, 0, 0, 0, 395,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 131, 0, 0, 0, 0, 0, 397, 49, 52,
- 50, 132, 133, 134, 0, 136, 137, 138, 139, 140,
- 141, 0, 0, 129, 135, 121, 114, 116, 130, 0,
- 0, 0, 0, 0, 0, 0, 46, 34, 51, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 111, 112,
- 113, 0, 0, 115, 117, 118, 0, 0, 119, 0,
- 120, 0, 0, 0, 122, 123, 124, 0, 0, 0,
- 0, 0, 0, 35, 125, 126, 127, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 128, 0, 0,
- 0, 395, 0, 0, 0, 0, 0, 0, 0, 396,
- 0, 0, 0, 131, 0, 0, 0, 0, 0, 397,
- 49, 52, 50, 132, 133, 134, 0, 136, 137, 138,
- 139, 140, 141, 0, 0, 129, 135, 121, 114, 116,
- 130, 0, 0, 0, 0, 0, 0, 0, 46, 374,
- 380, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 213, 0, 0, 0, 0, 215, 0, 29, 30, 31,
- 217, 0, 0, 0, 0, 0, 0, 218, 33, 0,
- 0, 0, 0, 0, 0, 35, 220, 0, 0, 221,
- 37, 0, 38, 0, 0, 0, 39, 0, 40, 42,
- 43, 0, 0, 45, 0, 0, 0, 47, 0, 48,
- 0, 0, 0, 0, 0, 222, 0, 223, 0, 0,
- 0, 53, 49, 52, 50, 224, 54, 225, 55, 226,
- 57, 227, 58, 228, 229, 0, 0, 44, 56, 32,
- 214, 216, 0, 41, 0, 0, 0, 0, 0, 0,
- 46, 34, 51, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 213, 0, 0, 0, 0, 215, 0, 29,
- 30, 31, 217, 0, 0, 0, 0, 0, 0, 218,
- 219, 0, 0, 0, 0, 0, 0, 35, 220, 0,
- 0, 221, 37, 0, 38, 0, 0, 0, 39, 0,
- 40, 42, 43, 0, 0, 45, 0, 0, 0, 47,
- 0, 48, 0, 0, 0, 0, 0, 222, 0, 223,
- 0, 0, 0, 53, 49, 52, 50, 224, 54, 225,
- 55, 226, 57, 227, 58, 228, 229, 0, 0, 44,
- 56, 32, 214, 216, 0, 41, 0, 0, 0, 0,
- 0, 0, 46, 34, 51, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 582, 112, 113, 0, 0, 584,
- 117, 586, 30, 31, 587, 0, 120, 0, 0, 0,
- 122, 589, 590, 0, 0, 0, 0, 0, 0, 35,
- 591, 126, 127, 221, 37, 0, 38, 0, 0, 0,
- 39, 0, 40, 592, 43, 0, 0, 594, 0, 0,
- 0, 47, 0, 48, 0, 0, 0, 0, 0, 595,
- 0, 223, 0, 0, 0, 596, 49, 52, 50, 597,
- 598, 599, 55, 601, 602, 603, 604, 605, 606, 0,
- 0, 593, 600, 588, 583, 585, 130, 41, 0, 0,
- 0, 0, 0, 0, 46, 374, 380, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 365, 112, 113, 0,
- 0, 367, 117, 369, 30, 31, 370, 0, 120, 0,
- 0, 0, 122, 372, 373, 0, 0, 0, 0, 0,
- 0, 35, 375, 126, 127, 221, 37, 0, 38, 0,
- 0, 0, 39, 0, 40, 376, 43, 0, 0, 378,
- 0, 0, 0, 47, 0, 48, 0, -278, 0, 0,
- 0, 379, 0, 223, 0, 0, 0, 381, 49, 52,
- 50, 382, 383, 384, 55, 386, 387, 388, 389, 390,
- 391, 0, 0, 377, 385, 371, 366, 368, 130, 41,
- 0, 0, 0, 0, 0, 0, 46, 374, 380, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 545, 572, 565, 632, 654, 148, 529, 541, 528, 142,
- 660, 263, 500, 393, 617, 616, 621, 614, 16, 629,
- 444, 183, 313, 547, 447, 183, 631, 643, 253, 248,
- 644, 485, 575, 574, 607, 152, 320, 437, 178, 313,
- 441, 433, 173, 183, 165, 253, 462, 313, 457, 447,
- 444, 453, 253, 458, 425, 347, 455, 248, 351, 188,
- 475, 466, 498, 171, 150, 447, 206, 190, 400, 468,
- 0, 183, 248, 495, 469, 237, 409, 393, 409, 331,
- 464, 247, 512, 206, 145, 206, 62, 409, 507, 206,
- 0, 511, 0, 188, 0, 206, 206, 188, 206, 62,
- 62, 504, 460, 417, 62, 206, 505, 206, 647, 646,
- 407, 0, 0, 410, 62, 410, 459, 62, 148, 506,
- 62, 187, 62, 277, 410, 419, 412, 298, 281, 393,
- 148, 0, 0, 0, 422, 62, 170, 62, 180, 62,
- 295, 514, 296, 260, 297, 62, 648, 503, 62, 62,
- 62, 182, 514, 299, 394, 62, 62, 460, 459, 206,
- 362, 630, 362, 62, 167, 502, 514, 62, 62, 322,
- 62, 553, 444, 99, 100, 93, 206, 62, 356, 206,
- 510, 206, 94, 62, 62, 206, 62, 62, 95, 96,
- 62, 97, 86, 62, 90, 493, 62, 91, 188, 492,
- 92, 355, 62, 353, 108, 62, 483, 349, 242, 345,
- 247, 313, 331, 469, 102, 104, 313, 206, 62, 206,
- 182, 260, 62, 206, 206, 206, 239, 62, 98, 182,
- 313, 313, 62, 110, 362, 72, 62, 206, 69, 62,
- 318, 70, 62, 62, 71, 260, 63, 62, 246, 393,
- 581, 62, 62, 460, 0, 74, 206, 62, 79, 459,
- 0, 206, 514, 309, 206, 62, 362, 557, 281, 0,
- 281, 309, 62, 0, 284, 403, 281, 281, 0, 309,
- 401, 0, 206, 306, 281, 308, 343, 479, 340, 62,
- 62, 341, 108, 337, 281, 281, 206, 302, 309, 62,
- 0, 330, 304, 281, 281, 314, 316, 62, 309, 0,
- 62, 62, 281, 281, 324, 281, 281, 301, 300, 514,
- 311, 110, 177, 0, 327, 0, 62, 569, 522, 564,
- 328, 281, 553, 289, 627, 561, 0, 0, 514, 0,
- 513, 523, 0, 0, 514, 0, 0, 522, 0, 0,
- 0, 0, 443, 522, 0, 485, 0, 0, 0, 513,
- 523, 0, 0, 0, 0, 513, 523, 533, 534, 535,
- 536, 540, 537, 538, 0, 0, 0, 0, 0, 0,
- 0, 577, 0, 0, 0, 0, 0, 0, 0, 362,
- 579, 580, 533, 534, 535, 536, 540, 537, 538, 569,
- 0, 0, 0, 0, 0, 206, 0, 0, 570, 571,
- 533, 534, 535, 536, 540, 537, 538, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 440, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 577, 0,
- 0, 0, 0, 0, 0, 0, 0, 625, 626, 533,
- 534, 535, 536, 540, 537, 538, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0};
-
-const short QQmlJSGrammar::action_check [] = {
- 36, 60, 5, 36, 31, 7, 66, 16, 33, 7,
- 36, 7, 7, 7, 7, 33, 36, 7, 55, 8,
- 36, 7, 7, 36, 7, 55, 7, 7, 36, 36,
- 17, 7, 33, 33, 7, 7, 7, 36, 7, 36,
- 7, 7, 34, 60, 55, 36, 7, 66, 60, 33,
- 55, 33, 7, 77, 33, 8, 60, 20, 36, 33,
- 1, 36, 8, 33, 7, 33, 2, 55, 33, 33,
- 29, 1, 24, 33, 8, 1, -1, 2, 55, -1,
- 37, 8, 36, -1, -1, -1, 8, 36, 36, 33,
- 7, 2, 48, 1, 36, 7, 36, 36, 60, 36,
- 33, 17, 60, 8, 0, 36, 8, 2, -1, 60,
- 60, 8, 6, -1, 61, 7, 8, 8, 33, 8,
- -1, 8, 60, 55, 48, 60, 20, 48, 8, 36,
- 8, 10, 8, 61, 79, 55, -1, -1, 48, 8,
- 8, 40, 40, 61, 8, 8, 60, 5, 61, 62,
- 79, 60, 51, 51, 56, 40, 79, 61, 62, 40,
- 79, 61, 62, 60, 50, 8, 51, 56, 54, 60,
- 51, 61, 62, 60, 8, 50, 55, 61, 62, 54,
- 60, 29, 60, 42, 60, 91, 92, 56, 56, 61,
- 62, 61, 62, 56, 53, 15, 60, 8, 7, 61,
- 62, 61, 62, 29, 61, 62, 29, 25, 8, 27,
- 7, -1, 15, 29, 34, 8, 36, 25, 61, 27,
- 38, 12, -1, 25, 33, 27, 60, 75, 12, 36,
- 38, 34, 89, 36, 29, 7, 38, 29, 86, -1,
- 25, 12, 27, 25, 25, 27, 27, 7, 15, 75,
- 61, 62, 75, 38, 61, 62, 38, 38, -1, 75,
- 86, 61, 62, 86, 61, 62, 57, 34, 61, 62,
- 86, -1, 63, 57, 15, 61, 62, 15, -1, 63,
- 75, 18, 19, 75, -1, 94, 57, 18, 19, 61,
- 62, 86, 63, 34, 86, 36, 34, 47, 36, 18,
- 19, 61, 62, 15, -1, 18, 19, 93, 45, 46,
- 15, 61, 62, -1, 45, 46, -1, -1, -1, -1,
- -1, 33, 34, -1, 36, -1, 45, 46, 33, 34,
- -1, 36, 45, 46, -1, 23, 24, -1, -1, 25,
- -1, 27, -1, 93, 32, 23, 24, 35, 29, 37,
- -1, -1, 38, 31, 32, -1, -1, 35, 29, 37,
- 23, 24, 98, 99, 100, 101, 102, 103, 31, 32,
- 23, 24, 35, 29, 37, -1, -1, -1, 31, 32,
- 23, 24, 35, -1, 37, 66, 67, 68, 31, 32,
- 23, 24, 35, -1, 37, 66, 67, 68, 31, 32,
- -1, -1, 35, -1, 37, 29, -1, -1, 29, -1,
- 66, 67, 68, 94, 95, 96, 29, -1, -1, 29,
- 23, 24, 29, 94, 95, 96, -1, -1, 29, 32,
- -1, -1, 35, -1, 37, 36, -1, -1, 94, 95,
- 96, 29, 66, 67, 68, 66, 67, 68, 36, -1,
- -1, -1, -1, 66, 67, 68, 66, 67, 68, 66,
- 67, 68, 29, -1, -1, 66, 67, 68, -1, 36,
- 94, 95, 96, 94, 95, 96, -1, -1, 66, 67,
- 68, 94, 95, 96, 94, 95, 96, 94, 95, 96,
- -1, -1, -1, 94, 95, 96, -1, -1, 29, 66,
- 67, 68, -1, 29, -1, -1, 94, 95, 96, -1,
- -1, 29, -1, -1, -1, -1, -1, -1, -1, 29,
- -1, -1, -1, -1, -1, -1, -1, 94, 95, 96,
- 61, 62, -1, -1, -1, 66, 67, 68, -1, -1,
- 66, 67, 68, 61, 62, -1, -1, -1, 66, 67,
- 68, 61, 62, -1, -1, -1, 66, 67, 68, -1,
- -1, -1, -1, 94, 95, 96, -1, -1, 94, 95,
- 96, -1, -1, -1, -1, -1, 94, 95, 96, -1,
- 29, -1, -1, -1, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 61, 62, 3, -1, -1, 66, 67, 68,
- -1, -1, -1, -1, 13, -1, -1, -1, 17, -1,
- -1, -1, -1, -1, -1, -1, -1, 26, -1, 28,
- -1, -1, 31, -1, -1, 94, 95, 96, -1, -1,
- 39, -1, 41, 42, -1, 12, 13, 3, -1, -1,
- 49, -1, -1, 52, 53, 22, -1, 13, -1, 58,
- -1, 17, 29, -1, -1, 64, 33, 34, -1, 36,
- 26, -1, 28, -1, -1, -1, 43, -1, -1, -1,
- 47, 80, -1, 39, -1, 41, 42, -1, -1, -1,
- -1, -1, -1, 49, -1, -1, 52, 53, 65, 66,
- 67, 68, 58, 70, -1, -1, -1, -1, 64, -1,
- -1, -1, -1, -1, 81, 82, 83, -1, -1, -1,
- 87, -1, -1, -1, 80, -1, -1, 94, 95, 96,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
- 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
- -1, 33, 34, -1, 36, -1, -1, -1, -1, -1,
- -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
- 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
- -1, -1, 94, 95, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 12, 13, -1, -1, -1, -1,
- -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
- -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
- -1, -1, -1, -1, -1, 43, -1, -1, -1, 47,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
- 68, -1, 70, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
- -1, -1, -1, -1, -1, -1, 94, 95, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 10, -1,
- 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
- 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
- -1, 33, 34, -1, 36, -1, -1, -1, -1, -1,
- -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
- -1, -1, -1, 75, -1, -1, -1, -1, -1, 81,
- 82, 83, 84, -1, -1, 87, -1, -1, -1, -1,
- -1, -1, 94, 95, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 10, -1, 12, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
- -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
- 36, -1, -1, -1, -1, -1, -1, 43, -1, -1,
- -1, 47, -1, -1, -1, -1, -1, -1, -1, 55,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 65,
- 66, 67, 68, -1, 70, -1, -1, -1, -1, 75,
- -1, -1, -1, -1, -1, 81, 82, 83, 84, -1,
- -1, 87, -1, -1, -1, -1, -1, -1, 94, 95,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 10, -1, 12, 13, -1, -1, -1, -1, -1, -1,
- -1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
- -1, -1, -1, 33, 34, -1, 36, -1, -1, -1,
- -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
- -1, -1, -1, -1, -1, 55, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
- 70, -1, -1, -1, -1, 75, -1, -1, -1, -1,
- -1, 81, 82, 83, 84, -1, -1, 87, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 11, 12, 13, -1,
- -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
- -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
- -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
- -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 65, 66, 67, 68, -1, 70, -1, 72, -1, 74,
- -1, 76, -1, -1, -1, -1, 81, 82, 83, -1,
- -1, -1, 87, -1, -1, -1, -1, -1, -1, 94,
- 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 7, -1, -1, -1, 11, 12, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
- -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
- 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
- -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 65,
- 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
- 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
- -1, 87, -1, -1, -1, -1, -1, -1, 94, 95,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
- -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
- -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
- -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
- 51, -1, 53, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
- -1, 72, -1, 74, 75, 76, -1, -1, -1, -1,
- 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
- -1, -1, -1, 94, 95, 96, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 8, -1, -1, 11, 12,
- 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
- -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
- 33, 34, -1, 36, -1, -1, -1, 40, -1, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, 51, -1,
- 53, -1, -1, 56, -1, -1, -1, -1, -1, -1,
- -1, -1, 65, 66, 67, 68, -1, 70, -1, 72,
- -1, 74, -1, 76, -1, -1, -1, -1, 81, 82,
- 83, -1, -1, -1, 87, -1, -1, -1, -1, -1,
- -1, 94, 95, 96, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 8, -1, -1, 11, 12, 13, -1,
- -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
- -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
- -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
- -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
- -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
- 65, 66, 67, 68, -1, 70, -1, 72, -1, 74,
- -1, 76, -1, -1, -1, -1, 81, 82, 83, -1,
- -1, -1, 87, -1, -1, -1, -1, -1, -1, 94,
- 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 8, -1, -1, 11, 12, 13, -1, -1, -1,
- -1, -1, -1, -1, -1, 22, -1, -1, -1, -1,
- -1, -1, 29, -1, -1, -1, 33, 34, -1, 36,
- -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
- 47, -1, -1, -1, 51, -1, 53, -1, -1, 56,
- -1, -1, -1, -1, -1, -1, -1, -1, 65, 66,
- 67, 68, -1, 70, -1, 72, -1, 74, -1, 76,
- -1, -1, -1, -1, 81, 82, 83, -1, -1, -1,
- 87, -1, -1, -1, -1, -1, -1, 94, 95, 96,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 8,
- -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
- -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
- 29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
- -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
- -1, -1, 51, -1, 53, -1, -1, 56, -1, -1,
- -1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
- -1, 70, -1, 72, -1, 74, -1, 76, -1, -1,
- -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
- -1, -1, -1, -1, -1, 94, 95, 96, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 11, 12, 13,
- -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
- -1, -1, -1, -1, -1, 29, 30, -1, -1, 33,
- 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
- -1, -1, -1, -1, -1, -1, -1, 61, -1, -1,
- -1, 65, 66, 67, 68, 69, 70, -1, 72, 73,
- 74, -1, 76, -1, 78, -1, -1, 81, 82, 83,
- -1, -1, -1, 87, -1, -1, -1, -1, -1, -1,
- 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
- -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
- 29, 30, -1, -1, 33, 34, -1, 36, -1, -1,
- -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
- -1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
- -1, -1, 61, -1, -1, -1, 65, 66, 67, 68,
- 69, 70, -1, 72, 73, 74, -1, 76, -1, 78,
- -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
- -1, -1, -1, -1, -1, 94, 95, 96, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 11, 12, 13,
- -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
- -1, -1, -1, -1, -1, 29, 30, -1, -1, 33,
- 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
- -1, -1, -1, -1, -1, -1, -1, 61, -1, -1,
- -1, 65, 66, 67, 68, 69, 70, -1, 72, 73,
- 74, -1, 76, -1, 78, -1, -1, 81, 82, 83,
- -1, -1, -1, 87, -1, -1, -1, -1, -1, -1,
- 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 4, 5, 6, -1, -1, 9, 10, 11,
- -1, -1, 14, -1, 16, -1, -1, -1, 20, 21,
- 22, -1, -1, -1, -1, -1, -1, 29, 30, 31,
- 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 43, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
- -1, -1, -1, -1, 66, 67, 68, 69, 70, 71,
- -1, 73, 74, 75, 76, 77, 78, -1, -1, 81,
- 82, 83, 84, 85, 86, -1, -1, -1, -1, -1,
- -1, -1, 94, 95, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
- 10, 11, -1, -1, 14, -1, 16, -1, -1, -1,
- 20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, 32, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
- -1, -1, -1, -1, -1, 65, 66, 67, 68, 69,
- 70, 71, -1, 73, 74, 75, 76, 77, 78, -1,
- -1, 81, 82, 83, 84, 85, 86, -1, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 4, 5, 6, -1,
- -1, 9, 10, 11, -1, -1, 14, -1, 16, -1,
- -1, -1, 20, 21, 22, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, 32, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 43, -1, -1, -1, 47,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 59, -1, -1, -1, -1, -1, 65, 66, 67,
- 68, 69, 70, 71, -1, 73, 74, 75, 76, 77,
- 78, -1, -1, 81, 82, 83, 84, 85, 86, -1,
- -1, -1, -1, -1, -1, -1, 94, 95, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 4, 5,
- 6, -1, -1, 9, 10, 11, -1, -1, 14, -1,
- 16, -1, -1, -1, 20, 21, 22, -1, -1, -1,
- -1, -1, -1, 29, 30, 31, 32, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 43, -1, -1,
- -1, 47, -1, -1, -1, -1, -1, -1, -1, 55,
- -1, -1, -1, 59, -1, -1, -1, -1, -1, 65,
- 66, 67, 68, 69, 70, 71, -1, 73, 74, 75,
- 76, 77, 78, -1, -1, 81, 82, 83, 84, 85,
- 86, -1, -1, -1, -1, -1, -1, -1, 94, 95,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 4, -1, -1, -1, -1, 9, -1, 11, 12, 13,
- 14, -1, -1, -1, -1, -1, -1, 21, 22, -1,
- -1, -1, -1, -1, -1, 29, 30, -1, -1, 33,
- 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
- -1, -1, -1, -1, -1, 59, -1, 61, -1, -1,
- -1, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
- 84, 85, -1, 87, -1, -1, -1, -1, -1, -1,
- 94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 4, -1, -1, -1, -1, 9, -1, 11,
- 12, 13, 14, -1, -1, -1, -1, -1, -1, 21,
- 22, -1, -1, -1, -1, -1, -1, 29, 30, -1,
- -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
- 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
- -1, 53, -1, -1, -1, -1, -1, 59, -1, 61,
- -1, -1, -1, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, -1, -1, 81,
- 82, 83, 84, 85, -1, 87, -1, -1, -1, -1,
- -1, -1, 94, 95, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
- 10, 11, 12, 13, 14, -1, 16, -1, -1, -1,
- 20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, 32, 33, 34, -1, 36, -1, -1, -1,
- 40, -1, 42, 43, 44, -1, -1, 47, -1, -1,
- -1, 51, -1, 53, -1, -1, -1, -1, -1, 59,
- -1, 61, -1, -1, -1, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, -1,
- -1, 81, 82, 83, 84, 85, 86, 87, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 4, 5, 6, -1,
- -1, 9, 10, 11, 12, 13, 14, -1, 16, -1,
- -1, -1, 20, 21, 22, -1, -1, -1, -1, -1,
- -1, 29, 30, 31, 32, 33, 34, -1, 36, -1,
- -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
- -1, -1, -1, 51, -1, 53, -1, 55, -1, -1,
- -1, 59, -1, 61, -1, -1, -1, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, -1, -1, 81, 82, 83, 84, 85, 86, 87,
- -1, -1, -1, -1, -1, -1, 94, 95, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-
- 32, 22, 18, 9, 18, 42, 18, 14, 32, 3,
- 18, 3, 3, 18, 18, 32, 18, 32, 3, 22,
- 3, 18, 3, 18, 25, 18, 22, 14, 18, 18,
- 14, 42, 18, 32, 22, 77, 3, 100, 3, 3,
- 3, 103, 42, 18, 42, 18, 3, 3, 25, 25,
- 3, 105, 18, 25, 3, 3, 18, 18, 3, 18,
- 42, 3, 42, 42, 42, 25, 18, 18, 42, 2,
- -1, 18, 18, 42, 18, 18, 14, 18, 14, 18,
- 2, 4, 2, 18, 42, 18, 54, 14, 56, 18,
- -1, 4, -1, 18, -1, 18, 18, 18, 18, 54,
- 54, 56, 56, 44, 54, 18, 56, 18, 11, 12,
- 45, -1, -1, 51, 54, 51, 56, 54, 42, 56,
- 54, 46, 54, 54, 51, 46, 50, 59, 59, 18,
- 42, -1, -1, -1, 45, 54, 70, 54, 50, 54,
- 59, 14, 59, 2, 59, 54, 19, 56, 54, 54,
- 54, 56, 14, 59, 43, 54, 54, 56, 56, 18,
- 2, 23, 2, 54, 68, 56, 14, 54, 54, 2,
- 54, 19, 3, 60, 60, 59, 18, 54, 18, 18,
- 109, 18, 59, 54, 54, 18, 54, 54, 59, 59,
- 54, 59, 59, 54, 58, 38, 54, 58, 18, 42,
- 58, 2, 54, 2, 18, 54, 45, 2, 45, 2,
- 4, 3, 18, 18, 66, 64, 3, 18, 54, 18,
- 56, 2, 54, 18, 18, 18, 46, 54, 60, 56,
- 3, 3, 54, 47, 2, 57, 54, 18, 56, 54,
- 2, 56, 54, 54, 56, 2, 57, 54, 2, 18,
- 18, 54, 54, 56, -1, 62, 18, 54, 60, 56,
- -1, 18, 14, 54, 18, 54, 2, 19, 59, -1,
- 59, 54, 54, -1, 63, 44, 59, 59, -1, 54,
- 2, -1, 18, 65, 59, 76, 78, 92, 94, 54,
- 54, 78, 18, 76, 59, 59, 18, 61, 54, 54,
- -1, 76, 67, 59, 59, 78, 78, 54, 54, -1,
- 54, 54, 59, 59, 69, 59, 59, 61, 61, 14,
- 76, 47, 48, -1, 71, -1, 54, 14, 23, 5,
- 76, 59, 19, 61, 21, 5, -1, -1, 14, -1,
- 35, 36, -1, -1, 14, -1, -1, 23, -1, -1,
- -1, -1, 88, 23, -1, 42, -1, -1, -1, 35,
- 36, -1, -1, -1, -1, 35, 36, 25, 26, 27,
- 28, 29, 30, 31, -1, -1, -1, -1, -1, -1,
- -1, 14, -1, -1, -1, -1, -1, -1, -1, 2,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 14,
- -1, -1, -1, -1, -1, 18, -1, -1, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 88, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 14, -1,
- -1, -1, -1, -1, -1, -1, -1, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1};
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h b/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h
deleted file mode 100644
index 667cae07e9..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part 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$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-// This file was generated by qlalr - DO NOT EDIT!
-#ifndef QQMLJSGRAMMAR_P_H
-#define QQMLJSGRAMMAR_P_H
-
-#include <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQmlJSGrammar
-{
-public:
- enum VariousConstants {
- EOF_SYMBOL = 0,
- REDUCE_HERE = 105,
- SHIFT_THERE = 104,
- T_AND = 1,
- T_AND_AND = 2,
- T_AND_EQ = 3,
- T_AS = 93,
- T_AUTOMATIC_SEMICOLON = 62,
- T_BREAK = 4,
- T_CASE = 5,
- T_CATCH = 6,
- T_COLON = 7,
- T_COMMA = 8,
- T_COMMENT = 88,
- T_COMPATIBILITY_SEMICOLON = 89,
- T_CONST = 84,
- T_CONTINUE = 9,
- T_DEBUGGER = 85,
- T_DEFAULT = 10,
- T_DELETE = 11,
- T_DIVIDE_ = 12,
- T_DIVIDE_EQ = 13,
- T_DO = 14,
- T_DOT = 15,
- T_ELSE = 16,
- T_EQ = 17,
- T_EQ_EQ = 18,
- T_EQ_EQ_EQ = 19,
- T_ERROR = 97,
- T_FALSE = 83,
- T_FEED_JS_EXPRESSION = 101,
- T_FEED_JS_PROGRAM = 103,
- T_FEED_JS_SOURCE_ELEMENT = 102,
- T_FEED_JS_STATEMENT = 100,
- T_FEED_UI_OBJECT_MEMBER = 99,
- T_FEED_UI_PROGRAM = 98,
- T_FINALLY = 20,
- T_FOR = 21,
- T_FUNCTION = 22,
- T_GE = 23,
- T_GET = 95,
- T_GT = 24,
- T_GT_GT = 25,
- T_GT_GT_EQ = 26,
- T_GT_GT_GT = 27,
- T_GT_GT_GT_EQ = 28,
- T_IDENTIFIER = 29,
- T_IF = 30,
- T_IMPORT = 91,
- T_IN = 31,
- T_INSTANCEOF = 32,
- T_LBRACE = 33,
- T_LBRACKET = 34,
- T_LE = 35,
- T_LPAREN = 36,
- T_LT = 37,
- T_LT_LT = 38,
- T_LT_LT_EQ = 39,
- T_MINUS = 40,
- T_MINUS_EQ = 41,
- T_MINUS_MINUS = 42,
- T_MULTILINE_STRING_LITERAL = 87,
- T_NEW = 43,
- T_NOT = 44,
- T_NOT_EQ = 45,
- T_NOT_EQ_EQ = 46,
- T_NULL = 81,
- T_NUMERIC_LITERAL = 47,
- T_ON = 94,
- T_OR = 48,
- T_OR_EQ = 49,
- T_OR_OR = 50,
- T_PLUS = 51,
- T_PLUS_EQ = 52,
- T_PLUS_PLUS = 53,
- T_PRAGMA = 92,
- T_PROPERTY = 66,
- T_PUBLIC = 90,
- T_QUESTION = 54,
- T_RBRACE = 55,
- T_RBRACKET = 56,
- T_READONLY = 68,
- T_REMAINDER = 57,
- T_REMAINDER_EQ = 58,
- T_RESERVED_WORD = 86,
- T_RETURN = 59,
- T_RPAREN = 60,
- T_SEMICOLON = 61,
- T_SET = 96,
- T_SIGNAL = 67,
- T_STAR = 63,
- T_STAR_EQ = 64,
- T_STRING_LITERAL = 65,
- T_SWITCH = 69,
- T_THIS = 70,
- T_THROW = 71,
- T_TILDE = 72,
- T_TRUE = 82,
- T_TRY = 73,
- T_TYPEOF = 74,
- T_VAR = 75,
- T_VOID = 76,
- T_WHILE = 77,
- T_WITH = 78,
- T_XOR = 79,
- T_XOR_EQ = 80,
-
- ACCEPT_STATE = 665,
- RULE_COUNT = 358,
- STATE_COUNT = 666,
- TERMINAL_COUNT = 106,
- NON_TERMINAL_COUNT = 111,
-
- GOTO_INDEX_OFFSET = 666,
- GOTO_INFO_OFFSET = 3018,
- GOTO_CHECK_OFFSET = 3018
- };
-
- static const char *const spell [];
- static const short lhs [];
- static const short rhs [];
- static const short goto_default [];
- static const short action_default [];
- static const short action_index [];
- static const short action_info [];
- static const short action_check [];
-
- static inline int nt_action (int state, int nt)
- {
- const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;
- if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)
- return goto_default [nt];
-
- return action_info [GOTO_INFO_OFFSET + yyn];
- }
-
- static inline int t_action (int state, int token)
- {
- const int yyn = action_index [state] + token;
-
- if (yyn < 0 || action_check [yyn] != token)
- return - action_default [state];
-
- return action_info [yyn];
- }
-};
-
-
-QT_END_NAMESPACE
-#endif // QQMLJSGRAMMAR_P_H
-
diff --git a/src/tools/qdoc/qmlparser/qqmljskeywords_p.h b/src/tools/qdoc/qmlparser/qqmljskeywords_p.h
deleted file mode 100644
index f7368b94d6..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljskeywords_p.h
+++ /dev/null
@@ -1,887 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSKEYWORDS_P_H
-#define QQMLJSKEYWORDS_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 "qqmljslexer_p.h"
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-static inline int classify2(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'a') {
- if (s[1].unicode() == 's') {
- return qmlMode ? Lexer::T_AS : Lexer::T_IDENTIFIER;
- }
- }
- else if (s[0].unicode() == 'd') {
- if (s[1].unicode() == 'o') {
- return Lexer::T_DO;
- }
- }
- else if (s[0].unicode() == 'i') {
- if (s[1].unicode() == 'f') {
- return Lexer::T_IF;
- }
- else if (s[1].unicode() == 'n') {
- return Lexer::T_IN;
- }
- }
- else if (qmlMode && s[0].unicode() == 'o') {
- if (s[1].unicode() == 'n') {
- return qmlMode ? Lexer::T_ON : Lexer::T_IDENTIFIER;
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify3(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'f') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'r') {
- return Lexer::T_FOR;
- }
- }
- }
- else if (s[0].unicode() == 'g') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 't') {
- return Lexer::T_GET;
- }
- }
- }
- else if (s[0].unicode() == 'i') {
- if (s[1].unicode() == 'n') {
- if (s[2].unicode() == 't') {
- return qmlMode ? int(Lexer::T_INT) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- else if (s[0].unicode() == 'n') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 'w') {
- return Lexer::T_NEW;
- }
- }
- }
- else if (s[0].unicode() == 's') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 't') {
- return Lexer::T_SET;
- }
- }
- }
- else if (s[0].unicode() == 't') {
- if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'y') {
- return Lexer::T_TRY;
- }
- }
- }
- else if (s[0].unicode() == 'v') {
- if (s[1].unicode() == 'a') {
- if (s[2].unicode() == 'r') {
- return Lexer::T_VAR;
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify4(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'b') {
- if (s[1].unicode() == 'y') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_BYTE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- else if (s[0].unicode() == 'c') {
- if (s[1].unicode() == 'a') {
- if (s[2].unicode() == 's') {
- if (s[3].unicode() == 'e') {
- return Lexer::T_CASE;
- }
- }
- }
- else if (s[1].unicode() == 'h') {
- if (s[2].unicode() == 'a') {
- if (s[3].unicode() == 'r') {
- return qmlMode ? int(Lexer::T_CHAR) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- else if (s[0].unicode() == 'e') {
- if (s[1].unicode() == 'l') {
- if (s[2].unicode() == 's') {
- if (s[3].unicode() == 'e') {
- return Lexer::T_ELSE;
- }
- }
- }
- else if (s[1].unicode() == 'n') {
- if (s[2].unicode() == 'u') {
- if (s[3].unicode() == 'm') {
- return Lexer::T_ENUM;
- }
- }
- }
- }
- else if (s[0].unicode() == 'g') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'o') {
- return qmlMode ? int(Lexer::T_GOTO) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- else if (s[0].unicode() == 'l') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 'g') {
- return qmlMode ? int(Lexer::T_LONG) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- else if (s[0].unicode() == 'n') {
- if (s[1].unicode() == 'u') {
- if (s[2].unicode() == 'l') {
- if (s[3].unicode() == 'l') {
- return Lexer::T_NULL;
- }
- }
- }
- }
- else if (s[0].unicode() == 't') {
- if (s[1].unicode() == 'h') {
- if (s[2].unicode() == 'i') {
- if (s[3].unicode() == 's') {
- return Lexer::T_THIS;
- }
- }
- }
- else if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'u') {
- if (s[3].unicode() == 'e') {
- return Lexer::T_TRUE;
- }
- }
- }
- }
- else if (s[0].unicode() == 'v') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'i') {
- if (s[3].unicode() == 'd') {
- return Lexer::T_VOID;
- }
- }
- }
- }
- else if (s[0].unicode() == 'w') {
- if (s[1].unicode() == 'i') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'h') {
- return Lexer::T_WITH;
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify5(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'b') {
- if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'e') {
- if (s[3].unicode() == 'a') {
- if (s[4].unicode() == 'k') {
- return Lexer::T_BREAK;
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'c') {
- if (s[1].unicode() == 'a') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'c') {
- if (s[4].unicode() == 'h') {
- return Lexer::T_CATCH;
- }
- }
- }
- }
- else if (s[1].unicode() == 'l') {
- if (s[2].unicode() == 'a') {
- if (s[3].unicode() == 's') {
- if (s[4].unicode() == 's') {
- return Lexer::T_CLASS;
- }
- }
- }
- }
- else if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 's') {
- if (s[4].unicode() == 't') {
- return qmlMode ? int(Lexer::T_CONST) : int(Lexer::T_RESERVED_WORD);
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'f') {
- if (s[1].unicode() == 'a') {
- if (s[2].unicode() == 'l') {
- if (s[3].unicode() == 's') {
- if (s[4].unicode() == 'e') {
- return Lexer::T_FALSE;
- }
- }
- }
- }
- else if (s[1].unicode() == 'i') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 'a') {
- if (s[4].unicode() == 'l') {
- return qmlMode ? int(Lexer::T_FINAL) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- else if (s[1].unicode() == 'l') {
- if (s[2].unicode() == 'o') {
- if (s[3].unicode() == 'a') {
- if (s[4].unicode() == 't') {
- return qmlMode ? int(Lexer::T_FLOAT) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 's') {
- if (s[1].unicode() == 'h') {
- if (s[2].unicode() == 'o') {
- if (s[3].unicode() == 'r') {
- if (s[4].unicode() == 't') {
- return qmlMode ? int(Lexer::T_SHORT) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- else if (s[1].unicode() == 'u') {
- if (s[2].unicode() == 'p') {
- if (s[3].unicode() == 'e') {
- if (s[4].unicode() == 'r') {
- return qmlMode ? int(Lexer::T_SUPER) : int(Lexer::T_RESERVED_WORD);
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 't') {
- if (s[1].unicode() == 'h') {
- if (s[2].unicode() == 'r') {
- if (s[3].unicode() == 'o') {
- if (s[4].unicode() == 'w') {
- return Lexer::T_THROW;
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'w') {
- if (s[1].unicode() == 'h') {
- if (s[2].unicode() == 'i') {
- if (s[3].unicode() == 'l') {
- if (s[4].unicode() == 'e') {
- return Lexer::T_WHILE;
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify6(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'd') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 'l') {
- if (s[3].unicode() == 'e') {
- if (s[4].unicode() == 't') {
- if (s[5].unicode() == 'e') {
- return Lexer::T_DELETE;
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'u') {
- if (s[3].unicode() == 'b') {
- if (s[4].unicode() == 'l') {
- if (s[5].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_DOUBLE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'e') {
- if (s[1].unicode() == 'x') {
- if (s[2].unicode() == 'p') {
- if (s[3].unicode() == 'o') {
- if (s[4].unicode() == 'r') {
- if (s[5].unicode() == 't') {
- return Lexer::T_EXPORT;
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'i') {
- if (s[1].unicode() == 'm') {
- if (s[2].unicode() == 'p') {
- if (s[3].unicode() == 'o') {
- if (s[4].unicode() == 'r') {
- if (s[5].unicode() == 't') {
- return qmlMode ? int(Lexer::T_IMPORT) : int(Lexer::T_RESERVED_WORD);
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'n') {
- if (s[1].unicode() == 'a') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'i') {
- if (s[4].unicode() == 'v') {
- if (s[5].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_NATIVE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'p') {
- if (s[1].unicode() == 'u') {
- if (s[2].unicode() == 'b') {
- if (s[3].unicode() == 'l') {
- if (s[4].unicode() == 'i') {
- if (s[5].unicode() == 'c') {
- return qmlMode ? Lexer::T_PUBLIC : Lexer::T_IDENTIFIER;
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'a') {
- if (s[3].unicode() == 'g') {
- if (s[4].unicode() == 'm') {
- if (s[5].unicode() == 'a') {
- return qmlMode ? Lexer::T_PRAGMA : Lexer::T_IDENTIFIER;
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'r') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'u') {
- if (s[4].unicode() == 'r') {
- if (s[5].unicode() == 'n') {
- return Lexer::T_RETURN;
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 's') {
- if (qmlMode && s[1].unicode() == 'i') {
- if (s[2].unicode() == 'g') {
- if (s[3].unicode() == 'n') {
- if (s[4].unicode() == 'a') {
- if (s[5].unicode() == 'l') {
- return Lexer::T_SIGNAL;
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 't') {
- if (s[2].unicode() == 'a') {
- if (s[3].unicode() == 't') {
- if (s[4].unicode() == 'i') {
- if (s[5].unicode() == 'c') {
- return qmlMode ? int(Lexer::T_STATIC) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 'w') {
- if (s[2].unicode() == 'i') {
- if (s[3].unicode() == 't') {
- if (s[4].unicode() == 'c') {
- if (s[5].unicode() == 'h') {
- return Lexer::T_SWITCH;
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 't') {
- if (s[1].unicode() == 'h') {
- if (s[2].unicode() == 'r') {
- if (s[3].unicode() == 'o') {
- if (s[4].unicode() == 'w') {
- if (s[5].unicode() == 's') {
- return qmlMode ? int(Lexer::T_THROWS) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 'y') {
- if (s[2].unicode() == 'p') {
- if (s[3].unicode() == 'e') {
- if (s[4].unicode() == 'o') {
- if (s[5].unicode() == 'f') {
- return Lexer::T_TYPEOF;
- }
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify7(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'b') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'o') {
- if (s[3].unicode() == 'l') {
- if (s[4].unicode() == 'e') {
- if (s[5].unicode() == 'a') {
- if (s[6].unicode() == 'n') {
- return qmlMode ? int(Lexer::T_BOOLEAN) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'd') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 'f') {
- if (s[3].unicode() == 'a') {
- if (s[4].unicode() == 'u') {
- if (s[5].unicode() == 'l') {
- if (s[6].unicode() == 't') {
- return Lexer::T_DEFAULT;
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'e') {
- if (s[1].unicode() == 'x') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'e') {
- if (s[4].unicode() == 'n') {
- if (s[5].unicode() == 'd') {
- if (s[6].unicode() == 's') {
- return Lexer::T_EXTENDS;
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'f') {
- if (s[1].unicode() == 'i') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 'a') {
- if (s[4].unicode() == 'l') {
- if (s[5].unicode() == 'l') {
- if (s[6].unicode() == 'y') {
- return Lexer::T_FINALLY;
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'p') {
- if (s[1].unicode() == 'a') {
- if (s[2].unicode() == 'c') {
- if (s[3].unicode() == 'k') {
- if (s[4].unicode() == 'a') {
- if (s[5].unicode() == 'g') {
- if (s[6].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_PACKAGE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'i') {
- if (s[3].unicode() == 'v') {
- if (s[4].unicode() == 'a') {
- if (s[5].unicode() == 't') {
- if (s[6].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_PRIVATE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify8(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'a') {
- if (s[1].unicode() == 'b') {
- if (s[2].unicode() == 's') {
- if (s[3].unicode() == 't') {
- if (s[4].unicode() == 'r') {
- if (s[5].unicode() == 'a') {
- if (s[6].unicode() == 'c') {
- if (s[7].unicode() == 't') {
- return qmlMode ? int(Lexer::T_ABSTRACT) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'c') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 't') {
- if (s[4].unicode() == 'i') {
- if (s[5].unicode() == 'n') {
- if (s[6].unicode() == 'u') {
- if (s[7].unicode() == 'e') {
- return Lexer::T_CONTINUE;
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'd') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 'b') {
- if (s[3].unicode() == 'u') {
- if (s[4].unicode() == 'g') {
- if (s[5].unicode() == 'g') {
- if (s[6].unicode() == 'e') {
- if (s[7].unicode() == 'r') {
- return Lexer::T_DEBUGGER;
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'f') {
- if (s[1].unicode() == 'u') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 'c') {
- if (s[4].unicode() == 't') {
- if (s[5].unicode() == 'i') {
- if (s[6].unicode() == 'o') {
- if (s[7].unicode() == 'n') {
- return Lexer::T_FUNCTION;
- }
- }
- }
- }
- }
- }
- }
- }
- else if (qmlMode && s[0].unicode() == 'p') {
- if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'o') {
- if (s[3].unicode() == 'p') {
- if (s[4].unicode() == 'e') {
- if (s[5].unicode() == 'r') {
- if (s[6].unicode() == 't') {
- if (s[7].unicode() == 'y') {
- return qmlMode ? Lexer::T_PROPERTY : Lexer::T_IDENTIFIER;
- }
- }
- }
- }
- }
- }
- }
- }
- else if (qmlMode && s[0].unicode() == 'r') {
- if (s[1].unicode() == 'e') {
- if (s[2].unicode() == 'a') {
- if (s[3].unicode() == 'd') {
- if (s[4].unicode() == 'o') {
- if (s[5].unicode() == 'n') {
- if (s[6].unicode() == 'l') {
- if (s[7].unicode() == 'y') {
- return Lexer::T_READONLY;
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'v') {
- if (s[1].unicode() == 'o') {
- if (s[2].unicode() == 'l') {
- if (s[3].unicode() == 'a') {
- if (s[4].unicode() == 't') {
- if (s[5].unicode() == 'i') {
- if (s[6].unicode() == 'l') {
- if (s[7].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_VOLATILE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify9(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'i') {
- if (s[1].unicode() == 'n') {
- if (s[2].unicode() == 't') {
- if (s[3].unicode() == 'e') {
- if (s[4].unicode() == 'r') {
- if (s[5].unicode() == 'f') {
- if (s[6].unicode() == 'a') {
- if (s[7].unicode() == 'c') {
- if (s[8].unicode() == 'e') {
- return qmlMode ? int(Lexer::T_INTERFACE) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 'p') {
- if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'o') {
- if (s[3].unicode() == 't') {
- if (s[4].unicode() == 'e') {
- if (s[5].unicode() == 'c') {
- if (s[6].unicode() == 't') {
- if (s[7].unicode() == 'e') {
- if (s[8].unicode() == 'd') {
- return qmlMode ? int(Lexer::T_PROTECTED) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[0].unicode() == 't') {
- if (s[1].unicode() == 'r') {
- if (s[2].unicode() == 'a') {
- if (s[3].unicode() == 'n') {
- if (s[4].unicode() == 's') {
- if (s[5].unicode() == 'i') {
- if (s[6].unicode() == 'e') {
- if (s[7].unicode() == 'n') {
- if (s[8].unicode() == 't') {
- return qmlMode ? int(Lexer::T_TRANSIENT) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify10(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 'i') {
- if (s[1].unicode() == 'm') {
- if (s[2].unicode() == 'p') {
- if (s[3].unicode() == 'l') {
- if (s[4].unicode() == 'e') {
- if (s[5].unicode() == 'm') {
- if (s[6].unicode() == 'e') {
- if (s[7].unicode() == 'n') {
- if (s[8].unicode() == 't') {
- if (s[9].unicode() == 's') {
- return qmlMode ? int(Lexer::T_IMPLEMENTS) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- else if (s[1].unicode() == 'n') {
- if (s[2].unicode() == 's') {
- if (s[3].unicode() == 't') {
- if (s[4].unicode() == 'a') {
- if (s[5].unicode() == 'n') {
- if (s[6].unicode() == 'c') {
- if (s[7].unicode() == 'e') {
- if (s[8].unicode() == 'o') {
- if (s[9].unicode() == 'f') {
- return Lexer::T_INSTANCEOF;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-static inline int classify12(const QChar *s, bool qmlMode) {
- if (s[0].unicode() == 's') {
- if (s[1].unicode() == 'y') {
- if (s[2].unicode() == 'n') {
- if (s[3].unicode() == 'c') {
- if (s[4].unicode() == 'h') {
- if (s[5].unicode() == 'r') {
- if (s[6].unicode() == 'o') {
- if (s[7].unicode() == 'n') {
- if (s[8].unicode() == 'i') {
- if (s[9].unicode() == 'z') {
- if (s[10].unicode() == 'e') {
- if (s[11].unicode() == 'd') {
- return qmlMode ? int(Lexer::T_SYNCHRONIZED) : int(Lexer::T_IDENTIFIER);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return Lexer::T_IDENTIFIER;
-}
-
-int Lexer::classify(const QChar *s, int n, bool qmlMode) {
- switch (n) {
- case 2: return classify2(s, qmlMode);
- case 3: return classify3(s, qmlMode);
- case 4: return classify4(s, qmlMode);
- case 5: return classify5(s, qmlMode);
- case 6: return classify6(s, qmlMode);
- case 7: return classify7(s, qmlMode);
- case 8: return classify8(s, qmlMode);
- case 9: return classify9(s, qmlMode);
- case 10: return classify10(s, qmlMode);
- case 12: return classify12(s, qmlMode);
- default: return Lexer::T_IDENTIFIER;
- } // switch
-}
-
-} // namespace QQmlJS
-
-QT_QML_END_NAMESPACE
-
-#endif // QQMLJSKEYWORDS_P_H
diff --git a/src/tools/qdoc/qmlparser/qqmljslexer.cpp b/src/tools/qdoc/qmlparser/qqmljslexer.cpp
deleted file mode 100644
index 62748ef10d..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljslexer.cpp
+++ /dev/null
@@ -1,1438 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 "qqmljslexer_p.h"
-#include "qqmljsengine_p.h"
-#include "qqmljsmemorypool_p.h"
-#include "qqmljskeywords_p.h"
-
-#include <QtCore/qcoreapplication.h>
-#include <QtCore/qvarlengtharray.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
-QT_END_NAMESPACE
-
-using namespace QQmlJS;
-
-static inline int regExpFlagFromChar(const QChar &ch)
-{
- switch (ch.unicode()) {
- case 'g': return Lexer::RegExp_Global;
- case 'i': return Lexer::RegExp_IgnoreCase;
- case 'm': return Lexer::RegExp_Multiline;
- }
- return 0;
-}
-
-static inline unsigned char convertHex(ushort c)
-{
- if (c >= '0' && c <= '9')
- return (c - '0');
- else if (c >= 'a' && c <= 'f')
- return (c - 'a' + 10);
- else
- return (c - 'A' + 10);
-}
-
-static inline QChar convertHex(QChar c1, QChar c2)
-{
- return QChar((convertHex(c1.unicode()) << 4) + convertHex(c2.unicode()));
-}
-
-static inline QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4)
-{
- return QChar((convertHex(c3.unicode()) << 4) + convertHex(c4.unicode()),
- (convertHex(c1.unicode()) << 4) + convertHex(c2.unicode()));
-}
-
-Lexer::Lexer(Engine *engine)
- : _engine(engine)
- , _codePtr(0)
- , _lastLinePtr(0)
- , _tokenLinePtr(0)
- , _tokenStartPtr(0)
- , _char(QLatin1Char('\n'))
- , _errorCode(NoError)
- , _currentLineNumber(0)
- , _tokenValue(0)
- , _parenthesesState(IgnoreParentheses)
- , _parenthesesCount(0)
- , _stackToken(-1)
- , _patternFlags(0)
- , _tokenKind(0)
- , _tokenLength(0)
- , _tokenLine(0)
- , _validTokenText(false)
- , _prohibitAutomaticSemicolon(false)
- , _restrictedKeyword(false)
- , _terminator(false)
- , _followsClosingBrace(false)
- , _delimited(true)
- , _qmlMode(true)
-{
- if (engine)
- engine->setLexer(this);
-}
-
-bool Lexer::qmlMode() const
-{
- return _qmlMode;
-}
-
-QString Lexer::code() const
-{
- return _code;
-}
-
-void Lexer::setCode(const QString &code, int lineno, bool qmlMode)
-{
- if (_engine)
- _engine->setCode(code);
-
- _qmlMode = qmlMode;
- _code = code;
- _tokenText.clear();
- _tokenText.reserve(1024);
- _errorMessage.clear();
- _tokenSpell = QStringRef();
-
- _codePtr = code.unicode();
- _endPtr = _codePtr + code.length();
- _lastLinePtr = _codePtr;
- _tokenLinePtr = _codePtr;
- _tokenStartPtr = _codePtr;
-
- _char = QLatin1Char('\n');
- _errorCode = NoError;
-
- _currentLineNumber = lineno;
- _tokenValue = 0;
-
- // parentheses state
- _parenthesesState = IgnoreParentheses;
- _parenthesesCount = 0;
-
- _stackToken = -1;
-
- _patternFlags = 0;
- _tokenLength = 0;
- _tokenLine = lineno;
-
- _validTokenText = false;
- _prohibitAutomaticSemicolon = false;
- _restrictedKeyword = false;
- _terminator = false;
- _followsClosingBrace = false;
- _delimited = true;
-}
-
-void Lexer::scanChar()
-{
- unsigned sequenceLength = isLineTerminatorSequence();
- _char = *_codePtr++;
- if (sequenceLength == 2)
- _char = *_codePtr++;
-
- if (unsigned sequenceLength = isLineTerminatorSequence()) {
- _lastLinePtr = _codePtr + sequenceLength - 1; // points to the first character after the newline
- ++_currentLineNumber;
- }
-}
-
-namespace {
-inline bool isBinop(int tok)
-{
- switch (tok) {
- case Lexer::T_AND:
- case Lexer::T_AND_AND:
- case Lexer::T_AND_EQ:
- case Lexer::T_DIVIDE_:
- case Lexer::T_DIVIDE_EQ:
- case Lexer::T_EQ:
- case Lexer::T_EQ_EQ:
- case Lexer::T_EQ_EQ_EQ:
- case Lexer::T_GE:
- case Lexer::T_GT:
- case Lexer::T_GT_GT:
- case Lexer::T_GT_GT_EQ:
- case Lexer::T_GT_GT_GT:
- case Lexer::T_GT_GT_GT_EQ:
- case Lexer::T_LE:
- case Lexer::T_LT:
- case Lexer::T_LT_LT:
- case Lexer::T_LT_LT_EQ:
- case Lexer::T_MINUS:
- case Lexer::T_MINUS_EQ:
- case Lexer::T_NOT_EQ:
- case Lexer::T_NOT_EQ_EQ:
- case Lexer::T_OR:
- case Lexer::T_OR_EQ:
- case Lexer::T_OR_OR:
- case Lexer::T_PLUS:
- case Lexer::T_PLUS_EQ:
- case Lexer::T_REMAINDER:
- case Lexer::T_REMAINDER_EQ:
- case Lexer::T_RETURN:
- case Lexer::T_STAR:
- case Lexer::T_STAR_EQ:
- case Lexer::T_XOR:
- case Lexer::T_XOR_EQ:
- return true;
-
- default:
- return false;
- }
-}
-} // anonymous namespace
-
-int Lexer::lex()
-{
- const int previousTokenKind = _tokenKind;
-
- _tokenSpell = QStringRef();
- _tokenKind = scanToken();
- _tokenLength = _codePtr - _tokenStartPtr - 1;
-
- _delimited = false;
- _restrictedKeyword = false;
- _followsClosingBrace = (previousTokenKind == T_RBRACE);
-
- // update the flags
- switch (_tokenKind) {
- case T_LBRACE:
- case T_SEMICOLON:
- case T_QUESTION:
- case T_COLON:
- case T_TILDE:
- _delimited = true;
- break;
- default:
- if (isBinop(_tokenKind))
- _delimited = true;
- break;
-
- case T_IF:
- case T_FOR:
- case T_WHILE:
- case T_WITH:
- _parenthesesState = CountParentheses;
- _parenthesesCount = 0;
- break;
-
- case T_ELSE:
- case T_DO:
- _parenthesesState = BalancedParentheses;
- break;
-
- case T_CONTINUE:
- case T_BREAK:
- case T_RETURN:
- case T_THROW:
- _restrictedKeyword = true;
- break;
- } // switch
-
- // update the parentheses state
- switch (_parenthesesState) {
- case IgnoreParentheses:
- break;
-
- case CountParentheses:
- if (_tokenKind == T_RPAREN) {
- --_parenthesesCount;
- if (_parenthesesCount == 0)
- _parenthesesState = BalancedParentheses;
- } else if (_tokenKind == T_LPAREN) {
- ++_parenthesesCount;
- }
- break;
-
- case BalancedParentheses:
- if (_tokenKind != T_DO && _tokenKind != T_ELSE)
- _parenthesesState = IgnoreParentheses;
- break;
- } // switch
-
- return _tokenKind;
-}
-
-bool Lexer::isUnicodeEscapeSequence(const QChar *chars)
-{
- if (isHexDigit(chars[0]) && isHexDigit(chars[1]) && isHexDigit(chars[2]) && isHexDigit(chars[3]))
- return true;
-
- return false;
-}
-
-QChar Lexer::decodeUnicodeEscapeCharacter(bool *ok)
-{
- if (_char == QLatin1Char('u') && isUnicodeEscapeSequence(&_codePtr[0])) {
- scanChar(); // skip u
-
- const QChar c1 = _char;
- scanChar();
-
- const QChar c2 = _char;
- scanChar();
-
- const QChar c3 = _char;
- scanChar();
-
- const QChar c4 = _char;
- scanChar();
-
- if (ok)
- *ok = true;
-
- return convertUnicode(c1, c2, c3, c4);
- }
-
- *ok = false;
- return QChar();
-}
-
-QChar Lexer::decodeHexEscapeCharacter(bool *ok)
-{
- if (isHexDigit(_codePtr[0]) && isHexDigit(_codePtr[1])) {
- scanChar();
-
- const QChar c1 = _char;
- scanChar();
-
- const QChar c2 = _char;
- scanChar();
-
- if (ok)
- *ok = true;
-
- return convertHex(c1, c2);
- }
-
- *ok = false;
- return QChar();
-}
-
-static inline bool isIdentifierStart(QChar ch)
-{
- // fast path for ascii
- if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') ||
- (ch.unicode() >= 'A' && ch.unicode() <= 'Z') ||
- ch == '$' || ch == '_')
- return true;
-
- switch (ch.category()) {
- case QChar::Number_Letter:
- case QChar::Letter_Uppercase:
- case QChar::Letter_Lowercase:
- case QChar::Letter_Titlecase:
- case QChar::Letter_Modifier:
- case QChar::Letter_Other:
- return true;
- default:
- break;
- }
- return false;
-}
-
-static bool isIdentifierPart(QChar ch)
-{
- // fast path for ascii
- if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') ||
- (ch.unicode() >= 'A' && ch.unicode() <= 'Z') ||
- (ch.unicode() >= '0' && ch.unicode() <= '9') ||
- ch == '$' || ch == '_' ||
- ch.unicode() == 0x200c /* ZWNJ */ || ch.unicode() == 0x200d /* ZWJ */)
- return true;
-
- switch (ch.category()) {
- case QChar::Mark_NonSpacing:
- case QChar::Mark_SpacingCombining:
-
- case QChar::Number_DecimalDigit:
- case QChar::Number_Letter:
-
- case QChar::Letter_Uppercase:
- case QChar::Letter_Lowercase:
- case QChar::Letter_Titlecase:
- case QChar::Letter_Modifier:
- case QChar::Letter_Other:
-
- case QChar::Punctuation_Connector:
- return true;
- default:
- break;
- }
- return false;
-}
-
-int Lexer::scanToken()
-{
- if (_stackToken != -1) {
- int tk = _stackToken;
- _stackToken = -1;
- return tk;
- }
-
- _terminator = false;
-
-again:
- _validTokenText = false;
- _tokenLinePtr = _lastLinePtr;
-
- while (_char.isSpace()) {
- if (unsigned sequenceLength = isLineTerminatorSequence()) {
- _tokenLinePtr = _codePtr + sequenceLength - 1;
-
- if (_restrictedKeyword) {
- // automatic semicolon insertion
- _tokenLine = _currentLineNumber;
- _tokenStartPtr = _codePtr - 1;
- return T_SEMICOLON;
- } else {
- _terminator = true;
- syncProhibitAutomaticSemicolon();
- }
- }
-
- scanChar();
- }
-
- _tokenStartPtr = _codePtr - 1;
- _tokenLine = _currentLineNumber;
-
- if (_codePtr > _endPtr)
- return EOF_SYMBOL;
-
- const QChar ch = _char;
- scanChar();
-
- switch (ch.unicode()) {
- case '~': return T_TILDE;
- case '}': return T_RBRACE;
-
- case '|':
- if (_char == QLatin1Char('|')) {
- scanChar();
- return T_OR_OR;
- } else if (_char == QLatin1Char('=')) {
- scanChar();
- return T_OR_EQ;
- }
- return T_OR;
-
- case '{': return T_LBRACE;
-
- case '^':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_XOR_EQ;
- }
- return T_XOR;
-
- case ']': return T_RBRACKET;
- case '[': return T_LBRACKET;
- case '?': return T_QUESTION;
-
- case '>':
- if (_char == QLatin1Char('>')) {
- scanChar();
- if (_char == QLatin1Char('>')) {
- scanChar();
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_GT_GT_GT_EQ;
- }
- return T_GT_GT_GT;
- } else if (_char == QLatin1Char('=')) {
- scanChar();
- return T_GT_GT_EQ;
- }
- return T_GT_GT;
- } else if (_char == QLatin1Char('=')) {
- scanChar();
- return T_GE;
- }
- return T_GT;
-
- case '=':
- if (_char == QLatin1Char('=')) {
- scanChar();
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_EQ_EQ_EQ;
- }
- return T_EQ_EQ;
- }
- return T_EQ;
-
- case '<':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_LE;
- } else if (_char == QLatin1Char('<')) {
- scanChar();
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_LT_LT_EQ;
- }
- return T_LT_LT;
- }
- return T_LT;
-
- case ';': return T_SEMICOLON;
- case ':': return T_COLON;
-
- case '/':
- if (_char == QLatin1Char('*')) {
- scanChar();
- while (_codePtr <= _endPtr) {
- if (_char == QLatin1Char('*')) {
- scanChar();
- if (_char == QLatin1Char('/')) {
- scanChar();
-
- if (_engine) {
- _engine->addComment(tokenOffset() + 2, _codePtr - _tokenStartPtr - 1 - 4,
- tokenStartLine(), tokenStartColumn() + 2);
- }
-
- goto again;
- }
- } else {
- scanChar();
- }
- }
- } else if (_char == QLatin1Char('/')) {
- while (_codePtr <= _endPtr && !isLineTerminator()) {
- scanChar();
- }
- if (_engine) {
- _engine->addComment(tokenOffset() + 2, _codePtr - _tokenStartPtr - 1 - 2,
- tokenStartLine(), tokenStartColumn() + 2);
- }
- goto again;
- } if (_char == QLatin1Char('=')) {
- scanChar();
- return T_DIVIDE_EQ;
- }
- return T_DIVIDE_;
-
- case '.':
- if (_char.isDigit()) {
- QVarLengthArray<char,32> chars;
-
- chars.append(ch.unicode()); // append the `.'
-
- while (_char.isDigit()) {
- chars.append(_char.unicode());
- scanChar();
- }
-
- if (_char == QLatin1Char('e') || _char == QLatin1Char('E')) {
- if (_codePtr[0].isDigit() || ((_codePtr[0] == QLatin1Char('+') || _codePtr[0] == QLatin1Char('-')) &&
- _codePtr[1].isDigit())) {
-
- chars.append(_char.unicode());
- scanChar(); // consume `e'
-
- if (_char == QLatin1Char('+') || _char == QLatin1Char('-')) {
- chars.append(_char.unicode());
- scanChar(); // consume the sign
- }
-
- while (_char.isDigit()) {
- chars.append(_char.unicode());
- scanChar();
- }
- }
- }
-
- chars.append('\0');
-
- const char *begin = chars.constData();
- const char *end = 0;
- bool ok = false;
-
- _tokenValue = qstrtod(begin, &end, &ok);
-
- if (end - begin != chars.size() - 1) {
- _errorCode = IllegalExponentIndicator;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal syntax for exponential number");
- return T_ERROR;
- }
-
- return T_NUMERIC_LITERAL;
- }
- return T_DOT;
-
- case '-':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_MINUS_EQ;
- } else if (_char == QLatin1Char('-')) {
- scanChar();
-
- if (_terminator && !_delimited && !_prohibitAutomaticSemicolon) {
- _stackToken = T_MINUS_MINUS;
- return T_SEMICOLON;
- }
-
- return T_MINUS_MINUS;
- }
- return T_MINUS;
-
- case ',': return T_COMMA;
-
- case '+':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_PLUS_EQ;
- } else if (_char == QLatin1Char('+')) {
- scanChar();
-
- if (_terminator && !_delimited && !_prohibitAutomaticSemicolon) {
- _stackToken = T_PLUS_PLUS;
- return T_SEMICOLON;
- }
-
- return T_PLUS_PLUS;
- }
- return T_PLUS;
-
- case '*':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_STAR_EQ;
- }
- return T_STAR;
-
- case ')': return T_RPAREN;
- case '(': return T_LPAREN;
-
- case '&':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_AND_EQ;
- } else if (_char == QLatin1Char('&')) {
- scanChar();
- return T_AND_AND;
- }
- return T_AND;
-
- case '%':
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_REMAINDER_EQ;
- }
- return T_REMAINDER;
-
- case '!':
- if (_char == QLatin1Char('=')) {
- scanChar();
- if (_char == QLatin1Char('=')) {
- scanChar();
- return T_NOT_EQ_EQ;
- }
- return T_NOT_EQ;
- }
- return T_NOT;
-
- case '\'':
- case '"': {
- const QChar quote = ch;
- bool multilineStringLiteral = false;
-
- const QChar *startCode = _codePtr;
-
- if (_engine) {
- while (_codePtr <= _endPtr) {
- if (isLineTerminator()) {
- if (qmlMode())
- break;
- _errorCode = IllegalCharacter;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Stray newline in string literal");
- return T_ERROR;
- } else if (_char == QLatin1Char('\\')) {
- break;
- } else if (_char == quote) {
- _tokenSpell = _engine->midRef(startCode - _code.unicode() - 1, _codePtr - startCode);
- scanChar();
-
- return T_STRING_LITERAL;
- }
- scanChar();
- }
- }
-
- _validTokenText = true;
- _tokenText.resize(0);
- startCode--;
- while (startCode != _codePtr - 1)
- _tokenText += *startCode++;
-
- while (_codePtr <= _endPtr) {
- if (unsigned sequenceLength = isLineTerminatorSequence()) {
- multilineStringLiteral = true;
- _tokenText += _char;
- if (sequenceLength == 2)
- _tokenText += *_codePtr;
- scanChar();
- } else if (_char == quote) {
- scanChar();
-
- if (_engine)
- _tokenSpell = _engine->newStringRef(_tokenText);
-
- return multilineStringLiteral ? T_MULTILINE_STRING_LITERAL : T_STRING_LITERAL;
- } else if (_char == QLatin1Char('\\')) {
- scanChar();
-
- QChar u;
-
- switch (_char.unicode()) {
- // unicode escape sequence
- case 'u': {
- bool ok = false;
- u = decodeUnicodeEscapeCharacter(&ok);
- if (! ok) {
- _errorCode = IllegalUnicodeEscapeSequence;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
- return T_ERROR;
- }
- } break;
-
- // hex escape sequence
- case 'x': {
- bool ok = false;
- u = decodeHexEscapeCharacter(&ok);
- if (!ok) {
- _errorCode = IllegalHexadecimalEscapeSequence;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal hexadecimal escape sequence");
- return T_ERROR;
- }
- } break;
-
- // single character escape sequence
- case '\\': u = QLatin1Char('\\'); scanChar(); break;
- case '\'': u = QLatin1Char('\''); scanChar(); break;
- case '\"': u = QLatin1Char('\"'); scanChar(); break;
- case 'b': u = QLatin1Char('\b'); scanChar(); break;
- case 'f': u = QLatin1Char('\f'); scanChar(); break;
- case 'n': u = QLatin1Char('\n'); scanChar(); break;
- case 'r': u = QLatin1Char('\r'); scanChar(); break;
- case 't': u = QLatin1Char('\t'); scanChar(); break;
- case 'v': u = QLatin1Char('\v'); scanChar(); break;
-
- case '0':
- if (! _codePtr->isDigit()) {
- scanChar();
- u = QLatin1Char('\0');
- break;
- }
- // fall through
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- _errorCode = IllegalEscapeSequence;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Octal escape sequences are not allowed");
- return T_ERROR;
-
- case '\r':
- case '\n':
- case 0x2028u:
- case 0x2029u:
- scanChar();
- continue;
-
- default:
- // non escape character
- u = _char;
- scanChar();
- }
-
- _tokenText += u;
- } else {
- _tokenText += _char;
- scanChar();
- }
- }
-
- _errorCode = UnclosedStringLiteral;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Unclosed string at end of line");
- return T_ERROR;
- }
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- return scanNumber(ch);
-
- default: {
- QChar c = ch;
- bool identifierWithEscapeChars = false;
- if (c == QLatin1Char('\\') && _char == QLatin1Char('u')) {
- identifierWithEscapeChars = true;
- bool ok = false;
- c = decodeUnicodeEscapeCharacter(&ok);
- if (! ok) {
- _errorCode = IllegalUnicodeEscapeSequence;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
- return T_ERROR;
- }
- }
- if (isIdentifierStart(c)) {
- if (identifierWithEscapeChars) {
- _tokenText.resize(0);
- _tokenText += c;
- _validTokenText = true;
- }
- while (true) {
- c = _char;
- if (_char == QLatin1Char('\\') && _codePtr[0] == QLatin1Char('u')) {
- if (! identifierWithEscapeChars) {
- identifierWithEscapeChars = true;
- _tokenText.resize(0);
- _tokenText.insert(0, _tokenStartPtr, _codePtr - _tokenStartPtr - 1);
- _validTokenText = true;
- }
-
- scanChar(); // skip '\\'
- bool ok = false;
- c = decodeUnicodeEscapeCharacter(&ok);
- if (! ok) {
- _errorCode = IllegalUnicodeEscapeSequence;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence");
- return T_ERROR;
- }
- if (isIdentifierPart(c))
- _tokenText += c;
- continue;
- } else if (isIdentifierPart(c)) {
- if (identifierWithEscapeChars)
- _tokenText += c;
-
- scanChar();
- continue;
- }
-
- _tokenLength = _codePtr - _tokenStartPtr - 1;
-
- int kind = T_IDENTIFIER;
-
- if (! identifierWithEscapeChars)
- kind = classify(_tokenStartPtr, _tokenLength, _qmlMode);
-
- if (_engine) {
- if (kind == T_IDENTIFIER && identifierWithEscapeChars)
- _tokenSpell = _engine->newStringRef(_tokenText);
- else
- _tokenSpell = _engine->midRef(_tokenStartPtr - _code.unicode(), _tokenLength);
- }
-
- return kind;
- }
- }
- }
-
- break;
- }
-
- return T_ERROR;
-}
-
-int Lexer::scanNumber(QChar ch)
-{
- if (ch != QLatin1Char('0')) {
- QVarLengthArray<char, 64> buf;
- buf += ch.toLatin1();
-
- QChar n = _char;
- const QChar *code = _codePtr;
- while (n.isDigit()) {
- buf += n.toLatin1();
- n = *code++;
- }
-
- if (n != QLatin1Char('.') && n != QLatin1Char('e') && n != QLatin1Char('E')) {
- if (code != _codePtr) {
- _codePtr = code - 1;
- scanChar();
- }
- buf.append('\0');
- _tokenValue = strtod(buf.constData(), 0);
- return T_NUMERIC_LITERAL;
- }
- } else if (_char.isDigit() && !qmlMode()) {
- _errorCode = IllegalCharacter;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Decimal numbers can't start with '0'");
- return T_ERROR;
- }
-
- QVarLengthArray<char,32> chars;
- chars.append(ch.unicode());
-
- if (ch == QLatin1Char('0') && (_char == QLatin1Char('x') || _char == QLatin1Char('X'))) {
- ch = _char; // remember the x or X to use it in the error message below.
-
- // parse hex integer literal
- chars.append(_char.unicode());
- scanChar(); // consume `x'
-
- while (isHexDigit(_char)) {
- chars.append(_char.unicode());
- scanChar();
- }
-
- if (chars.size() < 3) {
- _errorCode = IllegalHexNumber;
- _errorMessage = QCoreApplication::translate("QQmlParser", "At least one hexadecimal digit is required after '0%1'").arg(ch);
- return T_ERROR;
- }
-
- _tokenValue = integerFromString(chars.constData(), chars.size(), 16);
- return T_NUMERIC_LITERAL;
- }
-
- // decimal integer literal
- while (_char.isDigit()) {
- chars.append(_char.unicode());
- scanChar(); // consume the digit
- }
-
- if (_char == QLatin1Char('.')) {
- chars.append(_char.unicode());
- scanChar(); // consume `.'
-
- while (_char.isDigit()) {
- chars.append(_char.unicode());
- scanChar();
- }
-
- if (_char == QLatin1Char('e') || _char == QLatin1Char('E')) {
- if (_codePtr[0].isDigit() || ((_codePtr[0] == QLatin1Char('+') || _codePtr[0] == QLatin1Char('-')) &&
- _codePtr[1].isDigit())) {
-
- chars.append(_char.unicode());
- scanChar(); // consume `e'
-
- if (_char == QLatin1Char('+') || _char == QLatin1Char('-')) {
- chars.append(_char.unicode());
- scanChar(); // consume the sign
- }
-
- while (_char.isDigit()) {
- chars.append(_char.unicode());
- scanChar();
- }
- }
- }
- } else if (_char == QLatin1Char('e') || _char == QLatin1Char('E')) {
- if (_codePtr[0].isDigit() || ((_codePtr[0] == QLatin1Char('+') || _codePtr[0] == QLatin1Char('-')) &&
- _codePtr[1].isDigit())) {
-
- chars.append(_char.unicode());
- scanChar(); // consume `e'
-
- if (_char == QLatin1Char('+') || _char == QLatin1Char('-')) {
- chars.append(_char.unicode());
- scanChar(); // consume the sign
- }
-
- while (_char.isDigit()) {
- chars.append(_char.unicode());
- scanChar();
- }
- }
- }
-
- if (chars.length() == 1) {
- // if we ended up with a single digit, then it was a '0'
- _tokenValue = 0;
- return T_NUMERIC_LITERAL;
- }
-
- chars.append('\0');
-
- const char *begin = chars.constData();
- const char *end = 0;
- bool ok = false;
-
- _tokenValue = qstrtod(begin, &end, &ok);
-
- if (end - begin != chars.size() - 1) {
- _errorCode = IllegalExponentIndicator;
- _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal syntax for exponential number");
- return T_ERROR;
- }
-
- return T_NUMERIC_LITERAL;
-}
-
-bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
-{
- _tokenText.resize(0);
- _validTokenText = true;
- _patternFlags = 0;
-
- if (prefix == EqualPrefix)
- _tokenText += QLatin1Char('=');
-
- while (true) {
- switch (_char.unicode()) {
- case '/':
- scanChar();
-
- // scan the flags
- _patternFlags = 0;
- while (isIdentLetter(_char)) {
- int flag = regExpFlagFromChar(_char);
- if (flag == 0 || _patternFlags & flag) {
- _errorMessage = QCoreApplication::translate("QQmlParser", "Invalid regular expression flag '%0'")
- .arg(QChar(_char));
- return false;
- }
- _patternFlags |= flag;
- scanChar();
- }
-
- _tokenLength = _codePtr - _tokenStartPtr - 1;
- return true;
-
- case '\\':
- // regular expression backslash sequence
- _tokenText += _char;
- scanChar();
-
- if (_codePtr > _endPtr || isLineTerminator()) {
- _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression backslash sequence");
- return false;
- }
-
- _tokenText += _char;
- scanChar();
- break;
-
- case '[':
- // regular expression class
- _tokenText += _char;
- scanChar();
-
- while (_codePtr <= _endPtr && ! isLineTerminator()) {
- if (_char == QLatin1Char(']'))
- break;
- else if (_char == QLatin1Char('\\')) {
- // regular expression backslash sequence
- _tokenText += _char;
- scanChar();
-
- if (_codePtr > _endPtr || isLineTerminator()) {
- _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression backslash sequence");
- return false;
- }
-
- _tokenText += _char;
- scanChar();
- } else {
- _tokenText += _char;
- scanChar();
- }
- }
-
- if (_char != QLatin1Char(']')) {
- _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression class");
- return false;
- }
-
- _tokenText += _char;
- scanChar(); // skip ]
- break;
-
- default:
- if (_codePtr > _endPtr || isLineTerminator()) {
- _errorMessage = QCoreApplication::translate("QQmlParser", "Unterminated regular expression literal");
- return false;
- } else {
- _tokenText += _char;
- scanChar();
- }
- } // switch
- } // while
-
- return false;
-}
-
-bool Lexer::isLineTerminator() const
-{
- const ushort unicode = _char.unicode();
- return unicode == 0x000Au
- || unicode == 0x000Du
- || unicode == 0x2028u
- || unicode == 0x2029u;
-}
-
-unsigned Lexer::isLineTerminatorSequence() const
-{
- switch (_char.unicode()) {
- case 0x000Au:
- case 0x2028u:
- case 0x2029u:
- return 1;
- case 0x000Du:
- if (_codePtr->unicode() == 0x000Au)
- return 2;
- else
- return 1;
- default:
- return 0;
- }
-}
-
-bool Lexer::isIdentLetter(QChar ch)
-{
- // ASCII-biased, since all reserved words are ASCII, aand hence the
- // bulk of content to be parsed.
- if ((ch >= QLatin1Char('a') && ch <= QLatin1Char('z'))
- || (ch >= QLatin1Char('A') && ch <= QLatin1Char('Z'))
- || ch == QLatin1Char('$')
- || ch == QLatin1Char('_'))
- return true;
- if (ch.unicode() < 128)
- return false;
- return ch.isLetterOrNumber();
-}
-
-bool Lexer::isDecimalDigit(ushort c)
-{
- return (c >= '0' && c <= '9');
-}
-
-bool Lexer::isHexDigit(QChar c)
-{
- return ((c >= QLatin1Char('0') && c <= QLatin1Char('9'))
- || (c >= QLatin1Char('a') && c <= QLatin1Char('f'))
- || (c >= QLatin1Char('A') && c <= QLatin1Char('F')));
-}
-
-bool Lexer::isOctalDigit(ushort c)
-{
- return (c >= '0' && c <= '7');
-}
-
-int Lexer::tokenEndLine() const
-{
- return _currentLineNumber;
-}
-
-int Lexer::tokenEndColumn() const
-{
- return _codePtr - _lastLinePtr;
-}
-
-QString Lexer::tokenText() const
-{
- if (_validTokenText)
- return _tokenText;
-
- if (_tokenKind == T_STRING_LITERAL)
- return QString(_tokenStartPtr + 1, _tokenLength - 2);
-
- return QString(_tokenStartPtr, _tokenLength);
-}
-
-Lexer::Error Lexer::errorCode() const
-{
- return _errorCode;
-}
-
-QString Lexer::errorMessage() const
-{
- return _errorMessage;
-}
-
-void Lexer::syncProhibitAutomaticSemicolon()
-{
- if (_parenthesesState == BalancedParentheses) {
- // we have seen something like "if (foo)", which means we should
- // never insert an automatic semicolon at this point, since it would
- // then be expanded into an empty statement (ECMA-262 7.9.1)
- _prohibitAutomaticSemicolon = true;
- _parenthesesState = IgnoreParentheses;
- } else {
- _prohibitAutomaticSemicolon = false;
- }
-}
-
-bool Lexer::prevTerminator() const
-{
- return _terminator;
-}
-
-bool Lexer::followsClosingBrace() const
-{
- return _followsClosingBrace;
-}
-
-bool Lexer::canInsertAutomaticSemicolon(int token) const
-{
- return token == T_RBRACE
- || token == EOF_SYMBOL
- || _terminator
- || _followsClosingBrace;
-}
-
-static const int uriTokens[] = {
- QQmlJSGrammar::T_IDENTIFIER,
- QQmlJSGrammar::T_PROPERTY,
- QQmlJSGrammar::T_SIGNAL,
- QQmlJSGrammar::T_READONLY,
- QQmlJSGrammar::T_ON,
- QQmlJSGrammar::T_BREAK,
- QQmlJSGrammar::T_CASE,
- QQmlJSGrammar::T_CATCH,
- QQmlJSGrammar::T_CONTINUE,
- QQmlJSGrammar::T_DEFAULT,
- QQmlJSGrammar::T_DELETE,
- QQmlJSGrammar::T_DO,
- QQmlJSGrammar::T_ELSE,
- QQmlJSGrammar::T_FALSE,
- QQmlJSGrammar::T_FINALLY,
- QQmlJSGrammar::T_FOR,
- QQmlJSGrammar::T_FUNCTION,
- QQmlJSGrammar::T_IF,
- QQmlJSGrammar::T_IN,
- QQmlJSGrammar::T_INSTANCEOF,
- QQmlJSGrammar::T_NEW,
- QQmlJSGrammar::T_NULL,
- QQmlJSGrammar::T_RETURN,
- QQmlJSGrammar::T_SWITCH,
- QQmlJSGrammar::T_THIS,
- QQmlJSGrammar::T_THROW,
- QQmlJSGrammar::T_TRUE,
- QQmlJSGrammar::T_TRY,
- QQmlJSGrammar::T_TYPEOF,
- QQmlJSGrammar::T_VAR,
- QQmlJSGrammar::T_VOID,
- QQmlJSGrammar::T_WHILE,
- QQmlJSGrammar::T_CONST,
- QQmlJSGrammar::T_DEBUGGER,
- QQmlJSGrammar::T_RESERVED_WORD,
- QQmlJSGrammar::T_WITH,
-
- QQmlJSGrammar::EOF_SYMBOL
-};
-static inline bool isUriToken(int token)
-{
- const int *current = uriTokens;
- while (*current != QQmlJSGrammar::EOF_SYMBOL) {
- if (*current == token)
- return true;
- ++current;
- }
- return false;
-}
-
-bool Lexer::scanDirectives(Directives *directives, DiagnosticMessage *error)
-{
- Q_ASSERT(!_qmlMode);
-
- lex(); // fetch the first token
-
- if (_tokenKind != T_DOT)
- return true;
-
- do {
- const int lineNumber = tokenStartLine();
- const int column = tokenStartColumn();
-
- lex(); // skip T_DOT
-
- if (! (_tokenKind == T_IDENTIFIER || _tokenKind == T_RESERVED_WORD))
- return true; // expected a valid QML/JS directive
-
- const QString directiveName = tokenText();
-
- if (! (directiveName == QLatin1String("pragma") ||
- directiveName == QLatin1String("import"))) {
- error->message = QCoreApplication::translate("QQmlParser", "Syntax error");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false; // not a valid directive name
- }
-
- // it must be a pragma or an import directive.
- if (directiveName == QLatin1String("pragma")) {
- // .pragma library
- if (! (lex() == T_IDENTIFIER && tokenText() == QLatin1String("library"))) {
- error->message = QCoreApplication::translate("QQmlParser", "Syntax error");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false; // expected `library
- }
-
- // we found a .pragma library directive
- directives->pragmaLibrary();
-
- } else {
- Q_ASSERT(directiveName == QLatin1String("import"));
- lex(); // skip .import
-
- QString pathOrUri;
- QString version;
- bool fileImport = false; // file or uri import
-
- if (_tokenKind == T_STRING_LITERAL) {
- // .import T_STRING_LITERAL as T_IDENTIFIER
-
- fileImport = true;
- pathOrUri = tokenText();
-
- if (!pathOrUri.endsWith(QLatin1String("js"))) {
- error->message = QCoreApplication::translate("QQmlParser","Imported file must be a script");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false;
- }
-
- } else if (_tokenKind == T_IDENTIFIER) {
- // .import T_IDENTIFIER (. T_IDENTIFIER)* T_NUMERIC_LITERAL as T_IDENTIFIER
-
- while (true) {
- if (!isUriToken(_tokenKind)) {
- error->message = QCoreApplication::translate("QQmlParser","Invalid module URI");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false;
- }
-
- pathOrUri.append(tokenText());
-
- lex();
- if (tokenStartLine() != lineNumber) {
- error->message = QCoreApplication::translate("QQmlParser","Invalid module URI");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false;
- }
- if (_tokenKind != QQmlJSGrammar::T_DOT)
- break;
-
- pathOrUri.append(QLatin1Char('.'));
-
- lex();
- if (tokenStartLine() != lineNumber) {
- error->message = QCoreApplication::translate("QQmlParser","Invalid module URI");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false;
- }
- }
-
- if (_tokenKind != T_NUMERIC_LITERAL) {
- error->message = QCoreApplication::translate("QQmlParser","Module import requires a version");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false; // expected the module version number
- }
-
- version = tokenText();
- }
-
- //
- // recognize the mandatory `as' followed by the module name
- //
- if (! (lex() == T_IDENTIFIER && tokenText() == QLatin1String("as") && tokenStartLine() == lineNumber)) {
- if (fileImport)
- error->message = QCoreApplication::translate("QQmlParser", "File import requires a qualifier");
- else
- error->message = QCoreApplication::translate("QQmlParser", "Module import requires a qualifier");
- if (tokenStartLine() != lineNumber) {
- error->loc.startLine = lineNumber;
- error->loc.startColumn = column;
- } else {
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- }
- return false; // expected `as'
- }
-
- if (lex() != T_IDENTIFIER || tokenStartLine() != lineNumber) {
- if (fileImport)
- error->message = QCoreApplication::translate("QQmlParser", "File import requires a qualifier");
- else
- error->message = QCoreApplication::translate("QQmlParser", "Module import requires a qualifier");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false; // expected module name
- }
-
- const QString module = tokenText();
- if (!module.at(0).isUpper()) {
- error->message = QCoreApplication::translate("QQmlParser","Invalid import qualifier");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false;
- }
-
- if (fileImport)
- directives->importFile(pathOrUri, module, lineNumber, column);
- else
- directives->importModule(pathOrUri, version, module, lineNumber, column);
- }
-
- if (tokenStartLine() != lineNumber) {
- error->message = QCoreApplication::translate("QQmlParser", "Syntax error");
- error->loc.startLine = tokenStartLine();
- error->loc.startColumn = tokenStartColumn();
- return false; // the directives cannot span over multiple lines
- }
-
- // fetch the first token after the .pragma/.import directive
- lex();
- } while (_tokenKind == T_DOT);
-
- return true;
-}
diff --git a/src/tools/qdoc/qmlparser/qqmljslexer_p.h b/src/tools/qdoc/qmlparser/qqmljslexer_p.h
deleted file mode 100644
index 427affe4b9..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljslexer_p.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSLEXER_P_H
-#define QQMLJSLEXER_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 "qqmljsglobal_p.h"
-#include "qqmljsgrammar_p.h"
-
-#include <QtCore/qstring.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-class Engine;
-class DiagnosticMessage;
-
-class QML_PARSER_EXPORT Directives {
-public:
- virtual ~Directives() {}
-
- virtual void pragmaLibrary()
- {
- }
-
- virtual void importFile(const QString &jsfile, const QString &module, int line, int column)
- {
- Q_UNUSED(jsfile);
- Q_UNUSED(module);
- Q_UNUSED(line);
- Q_UNUSED(column);
- }
-
- virtual void importModule(const QString &uri, const QString &version, const QString &module, int line, int column)
- {
- Q_UNUSED(uri);
- Q_UNUSED(version);
- Q_UNUSED(module);
- Q_UNUSED(line);
- Q_UNUSED(column);
- }
-};
-
-class QML_PARSER_EXPORT Lexer: public QQmlJSGrammar
-{
-public:
- enum {
- T_ABSTRACT = T_RESERVED_WORD,
- T_BOOLEAN = T_RESERVED_WORD,
- T_BYTE = T_RESERVED_WORD,
- T_CHAR = T_RESERVED_WORD,
- T_CLASS = T_RESERVED_WORD,
- T_DOUBLE = T_RESERVED_WORD,
- T_ENUM = T_RESERVED_WORD,
- T_EXPORT = T_RESERVED_WORD,
- T_EXTENDS = T_RESERVED_WORD,
- T_FINAL = T_RESERVED_WORD,
- T_FLOAT = T_RESERVED_WORD,
- T_GOTO = T_RESERVED_WORD,
- T_IMPLEMENTS = T_RESERVED_WORD,
- T_INT = T_RESERVED_WORD,
- T_INTERFACE = T_RESERVED_WORD,
- T_LONG = T_RESERVED_WORD,
- T_NATIVE = T_RESERVED_WORD,
- T_PACKAGE = T_RESERVED_WORD,
- T_PRIVATE = T_RESERVED_WORD,
- T_PROTECTED = T_RESERVED_WORD,
- T_SHORT = T_RESERVED_WORD,
- T_STATIC = T_RESERVED_WORD,
- T_SUPER = T_RESERVED_WORD,
- T_SYNCHRONIZED = T_RESERVED_WORD,
- T_THROWS = T_RESERVED_WORD,
- T_TRANSIENT = T_RESERVED_WORD,
- T_VOLATILE = T_RESERVED_WORD
- };
-
- enum Error {
- NoError,
- IllegalCharacter,
- IllegalHexNumber,
- UnclosedStringLiteral,
- IllegalEscapeSequence,
- IllegalUnicodeEscapeSequence,
- UnclosedComment,
- IllegalExponentIndicator,
- IllegalIdentifier,
- IllegalHexadecimalEscapeSequence
- };
-
- enum RegExpBodyPrefix {
- NoPrefix,
- EqualPrefix
- };
-
- enum RegExpFlag {
- RegExp_Global = 0x01,
- RegExp_IgnoreCase = 0x02,
- RegExp_Multiline = 0x04
- };
-
-public:
- Lexer(Engine *engine);
-
- bool qmlMode() const;
-
- QString code() const;
- void setCode(const QString &code, int lineno, bool qmlMode = true);
-
- int lex();
-
- bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix);
- bool scanDirectives(Directives *directives, DiagnosticMessage *error);
-
- int regExpFlags() const { return _patternFlags; }
- QString regExpPattern() const { return _tokenText; }
-
- int tokenKind() const { return _tokenKind; }
- int tokenOffset() const { return _tokenStartPtr - _code.unicode(); }
- int tokenLength() const { return _tokenLength; }
-
- int tokenStartLine() const { return _tokenLine; }
- int tokenStartColumn() const { return _tokenStartPtr - _tokenLinePtr + 1; }
-
- int tokenEndLine() const;
- int tokenEndColumn() const;
-
- inline QStringRef tokenSpell() const { return _tokenSpell; }
- double tokenValue() const { return _tokenValue; }
- QString tokenText() const;
-
- Error errorCode() const;
- QString errorMessage() const;
-
- bool prevTerminator() const;
- bool followsClosingBrace() const;
- bool canInsertAutomaticSemicolon(int token) const;
-
- enum ParenthesesState {
- IgnoreParentheses,
- CountParentheses,
- BalancedParentheses
- };
-
-protected:
- int classify(const QChar *s, int n, bool qmlMode);
-
-private:
- inline void scanChar();
- int scanToken();
- int scanNumber(QChar ch);
-
- bool isLineTerminator() const;
- unsigned isLineTerminatorSequence() const;
- static bool isIdentLetter(QChar c);
- static bool isDecimalDigit(ushort c);
- static bool isHexDigit(QChar c);
- static bool isOctalDigit(ushort c);
- static bool isUnicodeEscapeSequence(const QChar *chars);
-
- void syncProhibitAutomaticSemicolon();
- QChar decodeUnicodeEscapeCharacter(bool *ok);
- QChar decodeHexEscapeCharacter(bool *ok);
-
-private:
- Engine *_engine;
-
- QString _code;
- QString _tokenText;
- QString _errorMessage;
- QStringRef _tokenSpell;
-
- const QChar *_codePtr;
- const QChar *_endPtr;
- const QChar *_lastLinePtr;
- const QChar *_tokenLinePtr;
- const QChar *_tokenStartPtr;
-
- QChar _char;
- Error _errorCode;
-
- int _currentLineNumber;
- double _tokenValue;
-
- // parentheses state
- ParenthesesState _parenthesesState;
- int _parenthesesCount;
-
- int _stackToken;
-
- int _patternFlags;
- int _tokenKind;
- int _tokenLength;
- int _tokenLine;
-
- bool _validTokenText;
- bool _prohibitAutomaticSemicolon;
- bool _restrictedKeyword;
- bool _terminator;
- bool _followsClosingBrace;
- bool _delimited;
- bool _qmlMode;
-};
-
-} // end of namespace QQmlJS
-
-QT_QML_END_NAMESPACE
-
-#endif // LEXER_H
diff --git a/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h b/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h
deleted file mode 100644
index 16927251c7..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 QQMLJSMEMORYPOOL_P_H
-#define QQMLJSMEMORYPOOL_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 "qqmljsglobal_p.h"
-
-#include <QtCore/qglobal.h>
-#include <QtCore/qshareddata.h>
-#include <QtCore/qdebug.h>
-
-#include <cstring>
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-class Managed;
-
-class QML_PARSER_EXPORT MemoryPool : public QSharedData
-{
- MemoryPool(const MemoryPool &other);
- void operator =(const MemoryPool &other);
-
-public:
- MemoryPool()
- : _blocks(0),
- _allocatedBlocks(0),
- _blockCount(-1),
- _ptr(0),
- _end(0)
- { }
-
- ~MemoryPool()
- {
- if (_blocks) {
- for (int i = 0; i < _allocatedBlocks; ++i) {
- if (char *b = _blocks[i])
- free(b);
- }
-
- free(_blocks);
- }
- }
-
- inline void *allocate(size_t size)
- {
- size = (size + 7) & ~7;
- if (_ptr && (_ptr + size < _end)) {
- void *addr = _ptr;
- _ptr += size;
- return addr;
- }
- return allocate_helper(size);
- }
-
- void reset()
- {
- _blockCount = -1;
- _ptr = _end = 0;
- }
-
- template <typename _Tp> _Tp *New() { return new (this->allocate(sizeof(_Tp))) _Tp(); }
-
- template <typename PoolContentType, typename Visitor>
- void visitManagedPool(Visitor &visitor)
- {
- for (int i = 0; i <= _blockCount; ++i) {
- char *p = _blocks[i];
- char *end = p + BLOCK_SIZE;
- if (i == _blockCount) {
- Q_ASSERT(_ptr <= end);
- end = _ptr;
- }
-
- Q_ASSERT(p <= end);
-
- const qptrdiff increment = (sizeof(PoolContentType) + 7) & ~7;
-
- while (p + increment <= end) {
- visitor(reinterpret_cast<PoolContentType*>(p));
- p += increment;
- }
- }
- }
-
-private:
- void *allocate_helper(size_t size)
- {
- Q_ASSERT(size < BLOCK_SIZE);
-
- if (++_blockCount == _allocatedBlocks) {
- if (! _allocatedBlocks)
- _allocatedBlocks = DEFAULT_BLOCK_COUNT;
- else
- _allocatedBlocks *= 2;
-
- _blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
-
- for (int index = _blockCount; index < _allocatedBlocks; ++index)
- _blocks[index] = 0;
- }
-
- char *&block = _blocks[_blockCount];
-
- if (! block)
- block = (char *) malloc(BLOCK_SIZE);
-
- _ptr = block;
- _end = _ptr + BLOCK_SIZE;
-
- void *addr = _ptr;
- _ptr += size;
- return addr;
- }
-
-private:
- char **_blocks;
- int _allocatedBlocks;
- int _blockCount;
- char *_ptr;
- char *_end;
-
- enum
- {
- BLOCK_SIZE = 8 * 1024,
- DEFAULT_BLOCK_COUNT = 8
- };
-};
-
-class QML_PARSER_EXPORT Managed
-{
- Managed(const Managed &other);
- void operator = (const Managed &other);
-
-public:
- Managed() {}
- ~Managed() {}
-
- void *operator new(size_t size, MemoryPool *pool) { return pool->allocate(size); }
- void operator delete(void *) {}
- void operator delete(void *, MemoryPool *) {}
-};
-
-} // namespace QQmlJS
-
-QT_QML_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/qmlparser/qqmljsparser.cpp b/src/tools/qdoc/qmlparser/qqmljsparser.cpp
deleted file mode 100644
index 520c377034..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsparser.cpp
+++ /dev/null
@@ -1,1916 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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 "qqmljsengine_p.h"
-#include "qqmljslexer_p.h"
-#include "qqmljsast_p.h"
-#include "qqmljsmemorypool_p.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qcoreapplication.h>
-
-#include <string.h>
-
-
-
-#include "qqmljsparser_p.h"
-
-#include <QtCore/qvarlengtharray.h>
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is automatically generated from qqmljs.g.
-// Changes should be made to that file, not here. Any change to this file will
-// be lost!
-//
-// To regenerate this file, run:
-// qlalr --no-debug --no-lines --qt qqmljs.g
-//
-
-using namespace QQmlJS;
-
-QT_QML_BEGIN_NAMESPACE
-
-void Parser::reallocateStack()
-{
- if (! stack_size)
- stack_size = 128;
- else
- stack_size <<= 1;
-
- sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
- state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
- location_stack = reinterpret_cast<AST::SourceLocation*> (realloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
- string_stack = reinterpret_cast<QStringRef*> (realloc(string_stack, stack_size * sizeof(QStringRef)));
-}
-
-Parser::Parser(Engine *engine):
- driver(engine),
- pool(engine->pool()),
- tos(0),
- stack_size(0),
- sym_stack(0),
- state_stack(0),
- location_stack(0),
- string_stack(0),
- program(0),
- first_token(0),
- last_token(0)
-{
-}
-
-Parser::~Parser()
-{
- if (stack_size) {
- free(sym_stack);
- free(state_stack);
- free(location_stack);
- free(string_stack);
- }
-}
-
-static inline AST::SourceLocation location(Lexer *lexer)
-{
- AST::SourceLocation loc;
- loc.offset = lexer->tokenOffset();
- loc.length = lexer->tokenLength();
- loc.startLine = lexer->tokenStartLine();
- loc.startColumn = lexer->tokenStartColumn();
- return loc;
-}
-
-AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
-{
- QVarLengthArray<QStringRef, 4> nameIds;
- QVarLengthArray<AST::SourceLocation, 4> locations;
-
- AST::ExpressionNode *it = expr;
- while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
- nameIds.append(m->name);
- locations.append(m->identifierToken);
- it = m->base;
- }
-
- if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
- AST::UiQualifiedId *q = new (pool) AST::UiQualifiedId(idExpr->name);
- q->identifierToken = idExpr->identifierToken;
-
- AST::UiQualifiedId *currentId = q;
- for (int i = nameIds.size() - 1; i != -1; --i) {
- currentId = new (pool) AST::UiQualifiedId(currentId, nameIds[i]);
- currentId->identifierToken = locations[i];
- }
-
- return currentId->finish();
- }
-
- return 0;
-}
-
-AST::UiQualifiedPragmaId *Parser::reparseAsQualifiedPragmaId(AST::ExpressionNode *expr)
-{
- if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(expr)) {
- AST::UiQualifiedPragmaId *q = new (pool) AST::UiQualifiedPragmaId(idExpr->name);
- q->identifierToken = idExpr->identifierToken;
-
- return q->finish();
- }
-
- return 0;
-}
-
-
-bool Parser::parse(int startToken)
-{
- Lexer *lexer = driver->lexer();
- bool hadErrors = false;
- int yytoken = -1;
- int action = 0;
-
- token_buffer[0].token = startToken;
- first_token = &token_buffer[0];
- if (startToken == T_FEED_JS_PROGRAM && !lexer->qmlMode()) {
- Directives ignoreDirectives;
- Directives *directives = driver->directives();
- if (!directives)
- directives = &ignoreDirectives;
- DiagnosticMessage error;
- if (!lexer->scanDirectives(directives, &error)) {
- diagnostic_messages.append(error);
- return false;
- }
- token_buffer[1].token = lexer->tokenKind();
- token_buffer[1].dval = lexer->tokenValue();
- token_buffer[1].loc = location(lexer);
- token_buffer[1].spell = lexer->tokenSpell();
- last_token = &token_buffer[2];
- } else {
- last_token = &token_buffer[1];
- }
-
- tos = -1;
- program = 0;
-
- do {
- if (++tos == stack_size)
- reallocateStack();
-
- state_stack[tos] = action;
-
- _Lcheck_token:
- if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) {
- yyprevlloc = yylloc;
-
- if (first_token == last_token) {
- yytoken = lexer->lex();
- yylval = lexer->tokenValue();
- yytokenspell = lexer->tokenSpell();
- yylloc = location(lexer);
- } else {
- yytoken = first_token->token;
- yylval = first_token->dval;
- yytokenspell = first_token->spell;
- yylloc = first_token->loc;
- ++first_token;
- }
- }
-
- action = t_action(action, yytoken);
- if (action > 0) {
- if (action != ACCEPT_STATE) {
- yytoken = -1;
- sym(1).dval = yylval;
- stringRef(1) = yytokenspell;
- loc(1) = yylloc;
- } else {
- --tos;
- return ! hadErrors;
- }
- } else if (action < 0) {
- const int r = -action - 1;
- tos -= rhs[r];
-
- switch (r) {
-
-case 0: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-
-case 1: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-
-case 2: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-
-case 3: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-
-case 4: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-
-case 5: {
- sym(1).Node = sym(2).Node;
- program = sym(1).Node;
-} break;
-
-case 6: {
- sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiHeaderItemList,
- sym(2).UiObjectMemberList->finish());
-} break;
-
-case 8: {
- sym(1).Node = sym(1).UiHeaderItemList->finish();
-} break;
-
-case 9: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiPragma);
-} break;
-
-case 10: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiImport);
-} break;
-
-case 11: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiPragma);
-} break;
-
-case 12: {
- sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiImport);
-} break;
-
-case 16: {
- sym(1).UiPragma->semicolonToken = loc(2);
-} break;
-
-case 18: {
- sym(1).UiImport->semicolonToken = loc(2);
-} break;
-
-case 20: {
- sym(1).UiImport->versionToken = loc(2);
- sym(1).UiImport->semicolonToken = loc(3);
-} break;
-
-case 22: {
- sym(1).UiImport->versionToken = loc(2);
- sym(1).UiImport->asToken = loc(3);
- sym(1).UiImport->importIdToken = loc(4);
- sym(1).UiImport->importId = stringRef(4);
- sym(1).UiImport->semicolonToken = loc(5);
-} break;
-
-case 24: {
- sym(1).UiImport->asToken = loc(2);
- sym(1).UiImport->importIdToken = loc(3);
- sym(1).UiImport->importId = stringRef(3);
- sym(1).UiImport->semicolonToken = loc(4);
-} break;
-
-case 25: {
- AST::UiPragma *node = 0;
-
- if (AST::UiQualifiedPragmaId *qualifiedId = reparseAsQualifiedPragmaId(sym(2).Expression)) {
- node = new (pool) AST::UiPragma(qualifiedId);
- }
-
- sym(1).Node = node;
-
- if (node) {
- node->pragmaToken = loc(1);
- } else {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
- QLatin1String("Expected a qualified name id")));
-
- return false; // ### remove me
- }
-} break;
-
-case 26: {
- AST::UiImport *node = 0;
-
- if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
- node = new (pool) AST::UiImport(importIdLiteral->value);
- node->fileNameToken = loc(2);
- } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
- node = new (pool) AST::UiImport(qualifiedId);
- node->fileNameToken = loc(2);
- }
-
- sym(1).Node = node;
-
- if (node) {
- node->importToken = loc(1);
- } else {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
- QLatin1String("Expected a qualified name id or a string literal")));
-
- return false; // ### remove me
- }
-} break;
-
-case 27: {
- sym(1).Node = 0;
-} break;
-
-case 28: {
- sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember);
-} break;
-
-case 29: {
- sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember);
-} break;
-
-case 30: {
- AST::UiObjectMemberList *node = new (pool) AST:: UiObjectMemberList(
- sym(1).UiObjectMemberList, sym(2).UiObjectMember);
- sym(1).Node = node;
-} break;
-
-case 31: {
- sym(1).Node = new (pool) AST::UiArrayMemberList(sym(1).UiObjectMember);
-} break;
-
-case 32: {
- AST::UiArrayMemberList *node = new (pool) AST::UiArrayMemberList(
- sym(1).UiArrayMemberList, sym(3).UiObjectMember);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 33: {
- AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer((AST::UiObjectMemberList*)0);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 34: {
- AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer(sym(2).UiObjectMemberList->finish());
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 35: {
- AST::UiObjectDefinition *node = new (pool) AST::UiObjectDefinition(sym(1).UiQualifiedId,
- sym(2).UiObjectInitializer);
- sym(1).Node = node;
-} break;
-
-case 37: {
- AST::UiArrayBinding *node = new (pool) AST::UiArrayBinding(
- sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish());
- node->colonToken = loc(2);
- node->lbracketToken = loc(3);
- node->rbracketToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 38: {
- AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding(
- sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 39: {
- AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding(
- sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
- node->colonToken = loc(2);
- node->hasOnToken = true;
- sym(1).Node = node;
-} break;
-
-case 47:
-{
- AST::UiScriptBinding *node = new (pool) AST::UiScriptBinding(
- sym(1).UiQualifiedId, sym(3).Statement);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 51: {
- sym(1).Node = 0;
-} break;
-
-case 52: {
- sym(1).Node = sym(1).UiParameterList->finish ();
-} break;
-
-case 53: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2));
- node->propertyTypeToken = loc(1);
- node->identifierToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 54: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, stringRef(3), stringRef(4));
- node->propertyTypeToken = loc(3);
- node->commaToken = loc(2);
- node->identifierToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 56: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
- node->type = AST::UiPublicMember::Signal;
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(2);
- node->parameters = sym(4).UiParameterList;
- node->semicolonToken = loc(6);
- sym(1).Node = node;
-} break;
-
-case 58: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
- node->type = AST::UiPublicMember::Signal;
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(2);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 60: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
- node->typeModifier = stringRef(2);
- node->propertyToken = loc(1);
- node->typeModifierToken = loc(2);
- node->typeToken = loc(4);
- node->identifierToken = loc(6);
- node->semicolonToken = loc(7);
- sym(1).Node = node;
-} break;
-
-case 62: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(3);
- node->semicolonToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 64: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
- node->isDefaultMember = true;
- node->defaultToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->semicolonToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 65: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3),
- sym(5).Statement);
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(3);
- node->colonToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 66: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
- sym(6).Statement);
- node->isReadonlyMember = true;
- node->readonlyToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->colonToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 67: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
- sym(6).Statement);
- node->isDefaultMember = true;
- node->defaultToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->colonToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 68: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
- node->typeModifier = stringRef(2);
- node->propertyToken = loc(1);
- node->typeModifierToken = loc(2);
- node->typeToken = loc(4);
- node->identifierToken = loc(6);
- node->semicolonToken = loc(7); // insert a fake ';' before ':'
-
- AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(6));
- propertyName->identifierToken = loc(6);
- propertyName->next = 0;
-
- AST::UiArrayBinding *binding = new (pool) AST::UiArrayBinding(
- propertyName, sym(9).UiArrayMemberList->finish());
- binding->colonToken = loc(7);
- binding->lbracketToken = loc(8);
- binding->rbracketToken = loc(10);
-
- node->binding = binding;
-
- sym(1).Node = node;
-} break;
-
-case 69: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
- node->propertyToken = loc(1);
- node->typeToken = loc(2);
- node->identifierToken = loc(3);
- node->semicolonToken = loc(4); // insert a fake ';' before ':'
-
- AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(3));
- propertyName->identifierToken = loc(3);
- propertyName->next = 0;
-
- AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
- propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
- binding->colonToken = loc(4);
-
- node->binding = binding;
-
- sym(1).Node = node;
-} break;
-
-case 70: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
- node->isReadonlyMember = true;
- node->readonlyToken = loc(1);
- node->propertyToken = loc(2);
- node->typeToken = loc(3);
- node->identifierToken = loc(4);
- node->semicolonToken = loc(5); // insert a fake ';' before ':'
-
- AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(4));
- propertyName->identifierToken = loc(4);
- propertyName->next = 0;
-
- AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
- propertyName, sym(6).UiQualifiedId, sym(7).UiObjectInitializer);
- binding->colonToken = loc(5);
-
- node->binding = binding;
-
- sym(1).Node = node;
-} break;
-
-case 71: {
- sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
-} break;
-
-case 72: {
- sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
-} break;
-
-case 80: {
- AST::ThisExpression *node = new (pool) AST::ThisExpression();
- node->thisToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 81: {
- AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 82: {
- AST::NullExpression *node = new (pool) AST::NullExpression();
- node->nullToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 83: {
- AST::TrueLiteral *node = new (pool) AST::TrueLiteral();
- node->trueToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 84: {
- AST::FalseLiteral *node = new (pool) AST::FalseLiteral();
- node->falseToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 85: {
- AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval);
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-case 86:
-case 87: {
- AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1));
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 88: {
- bool rx = lexer->scanRegExp(Lexer::NoPrefix);
- if (!rx) {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
- return false; // ### remove me
- }
-
- loc(1).length = lexer->tokenLength();
- yylloc = loc(1); // adjust the location of the current token
-
- AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral(
- driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags());
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 89: {
- bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
- if (!rx) {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
- return false;
- }
-
- loc(1).length = lexer->tokenLength();
- yylloc = loc(1); // adjust the location of the current token
-
- AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral(
- driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags());
- node->literalToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 90: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0);
- node->lbracketToken = loc(1);
- node->rbracketToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 91: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).Elision->finish());
- node->lbracketToken = loc(1);
- node->rbracketToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 92: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish ());
- node->lbracketToken = loc(1);
- node->rbracketToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 93: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
- (AST::Elision *) 0);
- node->lbracketToken = loc(1);
- node->commaToken = loc(3);
- node->rbracketToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 94: {
- AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
- sym(4).Elision->finish());
- node->lbracketToken = loc(1);
- node->commaToken = loc(3);
- node->rbracketToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 95: {
- AST::ObjectLiteral *node = 0;
- if (sym(2).Node)
- node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyAssignmentList->finish ());
- else
- node = new (pool) AST::ObjectLiteral();
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 96: {
- AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral(
- sym(2).PropertyAssignmentList->finish ());
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 97: {
- AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression);
- node->lparenToken = loc(1);
- node->rparenToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 98: {
- if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
- QLatin1String("Ignored annotation")));
-
- sym(1).Expression = mem->base;
- }
-
- if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
- sym(1).UiQualifiedId = qualifiedId;
- } else {
- sym(1).UiQualifiedId = 0;
-
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
- QLatin1String("Expected a qualified name id")));
-
- return false; // ### recover
- }
-} break;
-
-case 99: {
- sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression);
-} break;
-
-case 100: {
- sym(1).Node = new (pool) AST::ElementList(sym(1).Elision->finish(), sym(2).Expression);
-} break;
-
-case 101: {
- AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList,
- (AST::Elision *) 0, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 102: {
- AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, sym(3).Elision->finish(),
- sym(4).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 103: {
- AST::Elision *node = new (pool) AST::Elision();
- node->commaToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 104: {
- AST::Elision *node = new (pool) AST::Elision(sym(1).Elision);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 105: {
- AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue(
- sym(1).PropertyName, sym(3).Expression);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 106: {
- AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
- sym(2).PropertyName, sym(6).FunctionBody);
- node->getSetToken = loc(1);
- node->lparenToken = loc(3);
- node->rparenToken = loc(4);
- node->lbraceToken = loc(5);
- node->rbraceToken = loc(7);
- sym(1).Node = node;
-} break;
-
-case 107: {
- AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
- sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody);
- node->getSetToken = loc(1);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- node->lbraceToken = loc(6);
- node->rbraceToken = loc(8);
- sym(1).Node = node;
-} break;
-
-case 108: {
- sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment);
-} break;
-
-case 109: {
- AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList(
- sym(1).PropertyAssignmentList, sym(3).PropertyAssignment);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 110: {
- AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 111: {
- AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 112: {
- AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval);
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 113: {
- AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
- node->propertyNameToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 149: {
- AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
- node->lbracketToken = loc(2);
- node->rbracketToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 150: {
- AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
- node->dotToken = loc(2);
- node->identifierToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 151: {
- AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList);
- node->newToken = loc(1);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 153: {
- AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression);
- node->newToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 154: {
- AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 155: {
- AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 156: {
- AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression);
- node->lbracketToken = loc(2);
- node->rbracketToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 157: {
- AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3));
- node->dotToken = loc(2);
- node->identifierToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 158: {
- sym(1).Node = 0;
-} break;
-
-case 159: {
- sym(1).Node = sym(1).ArgumentList->finish();
-} break;
-
-case 160: {
- sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression);
-} break;
-
-case 161: {
- AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 165: {
- AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression);
- node->incrementToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 166: {
- AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression);
- node->decrementToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 168: {
- AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression);
- node->deleteToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 169: {
- AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression);
- node->voidToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 170: {
- AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression);
- node->typeofToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 171: {
- AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression);
- node->incrementToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 172: {
- AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression);
- node->decrementToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 173: {
- AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression);
- node->plusToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 174: {
- AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression);
- node->minusToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 175: {
- AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression);
- node->tildeToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 176: {
- AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression);
- node->notToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 178: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Mul, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 179: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Div, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 180: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Mod, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 182: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Add, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 183: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Sub, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 185: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::LShift, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 186: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::RShift, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 187: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::URShift, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 189: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Lt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 190: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Gt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 191: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Le, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 192: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Ge, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 193: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::InstanceOf, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 194: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::In, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 196: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Lt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 197: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Gt, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 198: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Le, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 199: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Ge, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 200: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::InstanceOf, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 202: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Equal, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 203: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::NotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 204: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 205: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictNotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 207: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Equal, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 208: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::NotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 209: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 210: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::StrictNotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 212: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitAnd, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 214: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitAnd, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 216: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitXor, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 218: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitXor, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 220: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitOr, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 222: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::BitOr, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 224: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::And, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 226: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::And, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 228: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Or, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 230: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- QSOperator::Or, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 232: {
- AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
- sym(3).Expression, sym(5).Expression);
- node->questionToken = loc(2);
- node->colonToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 234: {
- AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
- sym(3).Expression, sym(5).Expression);
- node->questionToken = loc(2);
- node->colonToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 236: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- sym(2).ival, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 238: {
- AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression,
- sym(2).ival, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 239: {
- sym(1).ival = QSOperator::Assign;
-} break;
-
-case 240: {
- sym(1).ival = QSOperator::InplaceMul;
-} break;
-
-case 241: {
- sym(1).ival = QSOperator::InplaceDiv;
-} break;
-
-case 242: {
- sym(1).ival = QSOperator::InplaceMod;
-} break;
-
-case 243: {
- sym(1).ival = QSOperator::InplaceAdd;
-} break;
-
-case 244: {
- sym(1).ival = QSOperator::InplaceSub;
-} break;
-
-case 245: {
- sym(1).ival = QSOperator::InplaceLeftShift;
-} break;
-
-case 246: {
- sym(1).ival = QSOperator::InplaceRightShift;
-} break;
-
-case 247: {
- sym(1).ival = QSOperator::InplaceURightShift;
-} break;
-
-case 248: {
- sym(1).ival = QSOperator::InplaceAnd;
-} break;
-
-case 249: {
- sym(1).ival = QSOperator::InplaceXor;
-} break;
-
-case 250: {
- sym(1).ival = QSOperator::InplaceOr;
-} break;
-
-case 252: {
- AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 253: {
- sym(1).Node = 0;
-} break;
-
-case 256: {
- AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 257: {
- sym(1).Node = 0;
-} break;
-
-case 274: {
- AST::Block *node = new (pool) AST::Block(sym(2).StatementList);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 275: {
- sym(1).Node = new (pool) AST::StatementList(sym(1).Statement);
-} break;
-
-case 276: {
- sym(1).Node = new (pool) AST::StatementList(sym(1).StatementList, sym(2).Statement);
-} break;
-
-case 277: {
- sym(1).Node = 0;
-} break;
-
-case 278: {
- sym(1).Node = sym(1).StatementList->finish ();
-} break;
-
-case 280: {
- AST::VariableStatement *node = new (pool) AST::VariableStatement(
- sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
- node->declarationKindToken = loc(1);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 281: {
- sym(1).ival = T_CONST;
-} break;
-
-case 282: {
- sym(1).ival = T_VAR;
-} break;
-
-case 283: {
- sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
-} break;
-
-case 284: {
- AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList(
- sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
- node->commaToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 285: {
- sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
-} break;
-
-case 286: {
- sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
-} break;
-
-case 287: {
- AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 288: {
- AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 289: {
- // ### TODO: AST for initializer
- sym(1) = sym(2);
-} break;
-
-case 290: {
- sym(1).Node = 0;
-} break;
-
-case 292: {
- // ### TODO: AST for initializer
- sym(1) = sym(2);
-} break;
-
-case 293: {
- sym(1).Node = 0;
-} break;
-
-case 295: {
- AST::EmptyStatement *node = new (pool) AST::EmptyStatement();
- node->semicolonToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 297: {
- AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 298: {
- AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement);
- node->ifToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- node->elseToken = loc(6);
- sym(1).Node = node;
-} break;
-
-case 299: {
- AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement);
- node->ifToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 302: {
- AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(sym(2).Statement, sym(5).Expression);
- node->doToken = loc(1);
- node->whileToken = loc(3);
- node->lparenToken = loc(4);
- node->rparenToken = loc(6);
- node->semicolonToken = loc(7);
- sym(1).Node = node;
-} break;
-
-case 303: {
- AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement);
- node->whileToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 304: {
- AST::ForStatement *node = new (pool) AST::ForStatement(sym(3).Expression,
- sym(5).Expression, sym(7).Expression, sym(9).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->firstSemicolonToken = loc(4);
- node->secondSemicolonToken = loc(6);
- node->rparenToken = loc(8);
- sym(1).Node = node;
-} break;
-
-case 305: {
- AST::LocalForStatement *node = new (pool) AST::LocalForStatement(
- sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
- sym(8).Expression, sym(10).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->varToken = loc(3);
- node->firstSemicolonToken = loc(5);
- node->secondSemicolonToken = loc(7);
- node->rparenToken = loc(9);
- sym(1).Node = node;
-} break;
-
-case 306: {
- AST:: ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression,
- sym(5).Expression, sym(7).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->inToken = loc(4);
- node->rparenToken = loc(6);
- sym(1).Node = node;
-} break;
-
-case 307: {
- AST::LocalForEachStatement *node = new (pool) AST::LocalForEachStatement(
- sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
- node->forToken = loc(1);
- node->lparenToken = loc(2);
- node->varToken = loc(3);
- node->inToken = loc(5);
- node->rparenToken = loc(7);
- sym(1).Node = node;
-} break;
-
-case 309: {
- AST::ContinueStatement *node = new (pool) AST::ContinueStatement();
- node->continueToken = loc(1);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 311: {
- AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2));
- node->continueToken = loc(1);
- node->identifierToken = loc(2);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 313: {
- AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef());
- node->breakToken = loc(1);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 315: {
- AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2));
- node->breakToken = loc(1);
- node->identifierToken = loc(2);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 317: {
- AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression);
- node->returnToken = loc(1);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 318: {
- AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement);
- node->withToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 319: {
- AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock);
- node->switchToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 320: {
- AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 321: {
- AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
- node->lbraceToken = loc(1);
- node->rbraceToken = loc(5);
- sym(1).Node = node;
-} break;
-
-case 322: {
- sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause);
-} break;
-
-case 323: {
- sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause);
-} break;
-
-case 324: {
- sym(1).Node = 0;
-} break;
-
-case 325: {
- sym(1).Node = sym(1).CaseClauses->finish ();
-} break;
-
-case 326: {
- AST::CaseClause *node = new (pool) AST::CaseClause(sym(2).Expression, sym(4).StatementList);
- node->caseToken = loc(1);
- node->colonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 327: {
- AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList);
- node->defaultToken = loc(1);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 328: {
- AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement);
- node->identifierToken = loc(1);
- node->colonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 330: {
- AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression);
- node->throwToken = loc(1);
- node->semicolonToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 331: {
- AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch);
- node->tryToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 332: {
- AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally);
- node->tryToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 333: {
- AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch, sym(4).Finally);
- node->tryToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 334: {
- AST::Catch *node = new (pool) AST::Catch(stringRef(3), sym(5).Block);
- node->catchToken = loc(1);
- node->lparenToken = loc(2);
- node->identifierToken = loc(3);
- node->rparenToken = loc(4);
- sym(1).Node = node;
-} break;
-
-case 335: {
- AST::Finally *node = new (pool) AST::Finally(sym(2).Block);
- node->finallyToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 337: {
- AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement();
- node->debuggerToken = loc(1);
- node->semicolonToken = loc(2);
- sym(1).Node = node;
-} break;
-
-case 339: {
- AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
- node->functionToken = loc(1);
- node->identifierToken = loc(2);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- node->lbraceToken = loc(6);
- node->rbraceToken = loc(8);
- sym(1).Node = node;
-} break;
-
-case 340: {
- AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
- node->functionToken = loc(1);
- if (! stringRef(2).isNull())
- node->identifierToken = loc(2);
- node->lparenToken = loc(3);
- node->rparenToken = loc(5);
- node->lbraceToken = loc(6);
- node->rbraceToken = loc(8);
- sym(1).Node = node;
-} break;
-
-case 341: {
- AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody);
- node->functionToken = loc(1);
- node->lparenToken = loc(2);
- node->rparenToken = loc(4);
- node->lbraceToken = loc(5);
- node->rbraceToken = loc(7);
- sym(1).Node = node;
-} break;
-
-case 342: {
- AST::FormalParameterList *node = new (pool) AST::FormalParameterList(stringRef(1));
- node->identifierToken = loc(1);
- sym(1).Node = node;
-} break;
-
-case 343: {
- AST::FormalParameterList *node = new (pool) AST::FormalParameterList(sym(1).FormalParameterList, stringRef(3));
- node->commaToken = loc(2);
- node->identifierToken = loc(3);
- sym(1).Node = node;
-} break;
-
-case 344: {
- sym(1).Node = 0;
-} break;
-
-case 345: {
- sym(1).Node = sym(1).FormalParameterList->finish ();
-} break;
-
-case 346: {
- sym(1).Node = 0;
-} break;
-
-case 348: {
- sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ());
-} break;
-
-case 350: {
- sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ());
-} break;
-
-case 351: {
- sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement);
-} break;
-
-case 352: {
- sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement);
-} break;
-
-case 353: {
- sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement);
-} break;
-
-case 354: {
- sym(1).Node = new (pool) AST::FunctionSourceElement(sym(1).FunctionDeclaration);
-} break;
-
-case 355: {
- sym(1).Node = 0;
-} break;
-
- } // switch
- action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
- } // if
- } while (action != 0);
-
- if (first_token == last_token) {
- const int errorState = state_stack[tos];
-
- // automatic insertion of `;'
- if (yytoken != -1 && ((t_action(errorState, T_AUTOMATIC_SEMICOLON) && lexer->canInsertAutomaticSemicolon(yytoken))
- || t_action(errorState, T_COMPATIBILITY_SEMICOLON))) {
- SavedToken &tk = token_buffer[0];
- tk.token = yytoken;
- tk.dval = yylval;
- tk.spell = yytokenspell;
- tk.loc = yylloc;
-
- yylloc = yyprevlloc;
- yylloc.offset += yylloc.length;
- yylloc.startColumn += yylloc.length;
- yylloc.length = 0;
-
- //const QString msg = qApp->translate("QQmlParser", "Missing `;'");
- //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
-
- first_token = &token_buffer[0];
- last_token = &token_buffer[1];
-
- yytoken = T_SEMICOLON;
- yylval = 0;
-
- action = errorState;
-
- goto _Lcheck_token;
- }
-
- hadErrors = true;
-
- token_buffer[0].token = yytoken;
- token_buffer[0].dval = yylval;
- token_buffer[0].spell = yytokenspell;
- token_buffer[0].loc = yylloc;
-
- token_buffer[1].token = yytoken = lexer->lex();
- token_buffer[1].dval = yylval = lexer->tokenValue();
- token_buffer[1].spell = yytokenspell = lexer->tokenSpell();
- token_buffer[1].loc = yylloc = location(lexer);
-
- if (t_action(errorState, yytoken)) {
- QString msg;
- int token = token_buffer[0].token;
- if (token < 0 || token >= TERMINAL_COUNT)
- msg = qApp->translate("QQmlParser", "Syntax error");
- else
- msg = qApp->translate("QQmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
-
- action = errorState;
- goto _Lcheck_token;
- }
-
- static int tokens[] = {
- T_PLUS,
- T_EQ,
-
- T_COMMA,
- T_COLON,
- T_SEMICOLON,
-
- T_RPAREN, T_RBRACKET, T_RBRACE,
-
- T_NUMERIC_LITERAL,
- T_IDENTIFIER,
-
- T_LPAREN, T_LBRACKET, T_LBRACE,
-
- EOF_SYMBOL
- };
-
- for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
- int a = t_action(errorState, *tk);
- if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
-
- yytoken = *tk;
- yylval = 0;
- yylloc = token_buffer[0].loc;
- yylloc.length = 0;
-
- first_token = &token_buffer[0];
- last_token = &token_buffer[2];
-
- action = errorState;
- goto _Lcheck_token;
- }
- }
-
- for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
- if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM ||
- tk == T_FEED_JS_STATEMENT || tk == T_FEED_JS_EXPRESSION ||
- tk == T_FEED_JS_SOURCE_ELEMENT)
- continue;
-
- int a = t_action(errorState, tk);
- if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QQmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
-
- yytoken = tk;
- yylval = 0;
- yylloc = token_buffer[0].loc;
- yylloc.length = 0;
-
- action = errorState;
- goto _Lcheck_token;
- }
- }
-
- const QString msg = qApp->translate("QQmlParser", "Syntax error");
- diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
- }
-
- return false;
-}
-
-QT_QML_END_NAMESPACE
-
-
diff --git a/src/tools/qdoc/qmlparser/qqmljsparser_p.h b/src/tools/qdoc/qmlparser/qqmljsparser_p.h
deleted file mode 100644
index 5042e47112..0000000000
--- a/src/tools/qdoc/qmlparser/qqmljsparser_p.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module 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$
-**
-****************************************************************************/
-
-
-//
-// 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.
-//
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is automatically generated from qqmljs.g.
-// Changes should be made to that file, not here. Any change to this file will
-// be lost!
-//
-// To regenerate this file, run:
-// qlalr --no-debug --no-lines --qt qqmljs.g
-//
-
-#ifndef QQMLJSPARSER_P_H
-#define QQMLJSPARSER_P_H
-
-#include "qqmljsglobal_p.h"
-#include "qqmljsgrammar_p.h"
-#include "qqmljsast_p.h"
-#include "qqmljsengine_p.h"
-
-#include <QtCore/qlist.h>
-#include <QtCore/qstring.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-namespace QQmlJS {
-
-class Engine;
-
-class QML_PARSER_EXPORT Parser: protected QQmlJSGrammar
-{
-public:
- union Value {
- int ival;
- double dval;
- AST::ArgumentList *ArgumentList;
- AST::CaseBlock *CaseBlock;
- AST::CaseClause *CaseClause;
- AST::CaseClauses *CaseClauses;
- AST::Catch *Catch;
- AST::DefaultClause *DefaultClause;
- AST::ElementList *ElementList;
- AST::Elision *Elision;
- AST::ExpressionNode *Expression;
- AST::Finally *Finally;
- AST::FormalParameterList *FormalParameterList;
- AST::FunctionBody *FunctionBody;
- AST::FunctionDeclaration *FunctionDeclaration;
- AST::Node *Node;
- AST::PropertyName *PropertyName;
- AST::PropertyAssignment *PropertyAssignment;
- AST::PropertyAssignmentList *PropertyAssignmentList;
- AST::SourceElement *SourceElement;
- AST::SourceElements *SourceElements;
- AST::Statement *Statement;
- AST::StatementList *StatementList;
- AST::Block *Block;
- AST::VariableDeclaration *VariableDeclaration;
- AST::VariableDeclarationList *VariableDeclarationList;
-
- AST::UiProgram *UiProgram;
- AST::UiHeaderItemList *UiHeaderItemList;
- AST::UiPragma *UiPragma;
- AST::UiImport *UiImport;
- AST::UiParameterList *UiParameterList;
- AST::UiPublicMember *UiPublicMember;
- AST::UiObjectDefinition *UiObjectDefinition;
- AST::UiObjectInitializer *UiObjectInitializer;
- AST::UiObjectBinding *UiObjectBinding;
- AST::UiScriptBinding *UiScriptBinding;
- AST::UiArrayBinding *UiArrayBinding;
- AST::UiObjectMember *UiObjectMember;
- AST::UiObjectMemberList *UiObjectMemberList;
- AST::UiArrayMemberList *UiArrayMemberList;
- AST::UiQualifiedId *UiQualifiedId;
- AST::UiQualifiedPragmaId *UiQualifiedPragmaId;
- };
-
-public:
- Parser(Engine *engine);
- ~Parser();
-
- // parse a UI program
- bool parse() { return parse(T_FEED_UI_PROGRAM); }
- bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
- bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
- bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
- bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
- bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
-
- AST::UiProgram *ast() const
- { return AST::cast<AST::UiProgram *>(program); }
-
- AST::Statement *statement() const
- {
- if (! program)
- return 0;
-
- return program->statementCast();
- }
-
- AST::ExpressionNode *expression() const
- {
- if (! program)
- return 0;
-
- return program->expressionCast();
- }
-
- AST::UiObjectMember *uiObjectMember() const
- {
- if (! program)
- return 0;
-
- return program->uiObjectMemberCast();
- }
-
- AST::Node *rootNode() const
- { return program; }
-
- QList<DiagnosticMessage> diagnosticMessages() const
- { return diagnostic_messages; }
-
- inline DiagnosticMessage diagnosticMessage() const
- {
- foreach (const DiagnosticMessage &d, diagnostic_messages) {
- if (d.kind != DiagnosticMessage::Warning)
- return d;
- }
-
- return DiagnosticMessage();
- }
-
- inline QString errorMessage() const
- { return diagnosticMessage().message; }
-
- inline int errorLineNumber() const
- { return diagnosticMessage().loc.startLine; }
-
- inline int errorColumnNumber() const
- { return diagnosticMessage().loc.startColumn; }
-
-protected:
- bool parse(int startToken);
-
- void reallocateStack();
-
- inline Value &sym(int index)
- { return sym_stack [tos + index - 1]; }
-
- inline QStringRef &stringRef(int index)
- { return string_stack [tos + index - 1]; }
-
- inline AST::SourceLocation &loc(int index)
- { return location_stack [tos + index - 1]; }
-
- AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
- AST::UiQualifiedPragmaId *reparseAsQualifiedPragmaId(AST::ExpressionNode *expr);
-
-protected:
- Engine *driver;
- MemoryPool *pool;
- int tos;
- int stack_size;
- Value *sym_stack;
- int *state_stack;
- AST::SourceLocation *location_stack;
- QStringRef *string_stack;
-
- AST::Node *program;
-
- // error recovery
- enum { TOKEN_BUFFER_SIZE = 3 };
-
- struct SavedToken {
- int token;
- double dval;
- AST::SourceLocation loc;
- QStringRef spell;
- };
-
- double yylval;
- QStringRef yytokenspell;
- AST::SourceLocation yylloc;
- AST::SourceLocation yyprevlloc;
-
- SavedToken token_buffer[TOKEN_BUFFER_SIZE];
- SavedToken *first_token;
- SavedToken *last_token;
-
- QList<DiagnosticMessage> diagnostic_messages;
-};
-
-} // end of namespace QQmlJS
-
-
-
-#define J_SCRIPT_REGEXPLITERAL_RULE1 88
-
-#define J_SCRIPT_REGEXPLITERAL_RULE2 89
-
-QT_QML_END_NAMESPACE
-
-
-
-#endif // QQMLJSPARSER_P_H
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
deleted file mode 100644
index 190c9f0444..0000000000
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ /dev/null
@@ -1,830 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qfileinfo.h>
-#include <qstringlist.h>
-#include <qglobal.h>
-#include "qqmljsast_p.h"
-#include "qqmljsastfwd_p.h"
-#include "qqmljsengine_p.h"
-#include <qdebug.h>
-#include "node.h"
-#include "codeparser.h"
-#include "qmlvisitor.h"
-#include "qdocdatabase.h"
-#include "tokenizer.h"
-
-QT_BEGIN_NAMESPACE
-
-#define COMMAND_DEPRECATED Doc::alias(QLatin1String("deprecated"))
-#define COMMAND_INGROUP Doc::alias(QLatin1String("ingroup"))
-#define COMMAND_INTERNAL Doc::alias(QLatin1String("internal"))
-#define COMMAND_OBSOLETE Doc::alias(QLatin1String("obsolete"))
-#define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords"))
-#define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary"))
-#define COMMAND_SINCE Doc::alias(QLatin1String("since"))
-#define COMMAND_WRAPPER Doc::alias(QLatin1String("wrapper"))
-
-#define COMMAND_QMLABSTRACT Doc::alias(QLatin1String("qmlabstract"))
-#define COMMAND_QMLCLASS Doc::alias(QLatin1String("qmlclass"))
-#define COMMAND_QMLTYPE Doc::alias(QLatin1String("qmltype"))
-#define COMMAND_QMLMODULE Doc::alias(QLatin1String("qmlmodule"))
-#define COMMAND_QMLPROPERTY Doc::alias(QLatin1String("qmlproperty"))
-#define COMMAND_QMLPROPERTYGROUP Doc::alias(QLatin1String("qmlpropertygroup"))
-#define COMMAND_QMLATTACHEDPROPERTY Doc::alias(QLatin1String("qmlattachedproperty"))
-#define COMMAND_QMLINHERITS Doc::alias(QLatin1String("inherits"))
-#define COMMAND_QMLINSTANTIATES Doc::alias(QLatin1String("instantiates"))
-#define COMMAND_INQMLMODULE Doc::alias(QLatin1String("inqmlmodule"))
-#define COMMAND_QMLSIGNAL Doc::alias(QLatin1String("qmlsignal"))
-#define COMMAND_QMLATTACHEDSIGNAL Doc::alias(QLatin1String("qmlattachedsignal"))
-#define COMMAND_QMLMETHOD Doc::alias(QLatin1String("qmlmethod"))
-#define COMMAND_QMLATTACHEDMETHOD Doc::alias(QLatin1String("qmlattachedmethod"))
-#define COMMAND_QMLDEFAULT Doc::alias(QLatin1String("default"))
-#define COMMAND_QMLREADONLY Doc::alias(QLatin1String("readonly"))
-#define COMMAND_QMLBASICTYPE Doc::alias(QLatin1String("qmlbasictype"))
-
-#define COMMAND_JSTYPE Doc::alias(QLatin1String("jstype"))
-#define COMMAND_JSMODULE Doc::alias(QLatin1String("jsmodule"))
-#define COMMAND_JSPROPERTY Doc::alias(QLatin1String("jsproperty"))
-#define COMMAND_JSPROPERTYGROUP Doc::alias(QLatin1String("jspropertygroup"))
-#define COMMAND_JSATTACHEDPROPERTY Doc::alias(QLatin1String("jsattachedproperty"))
-#define COMMAND_INJSMODULE Doc::alias(QLatin1String("injsmodule"))
-#define COMMAND_JSSIGNAL Doc::alias(QLatin1String("jssignal"))
-#define COMMAND_JSATTACHEDSIGNAL Doc::alias(QLatin1String("jsattachedsignal"))
-#define COMMAND_JSMETHOD Doc::alias(QLatin1String("jsmethod"))
-#define COMMAND_JSATTACHEDMETHOD Doc::alias(QLatin1String("jsattachedmethod"))
-#define COMMAND_JSBASICTYPE Doc::alias(QLatin1String("jsbasictype"))
-
-/*!
- The constructor stores all the parameters in local data members.
- */
-QmlDocVisitor::QmlDocVisitor(const QString &filePath,
- const QString &code,
- QQmlJS::Engine *engine,
- const QSet<QString> &commands,
- const QSet<QString> &topics)
- : nestingLevel(0)
-{
- lastEndOffset = 0;
- this->filePath_ = filePath;
- this->name = QFileInfo(filePath).baseName();
- document = code;
- this->engine = engine;
- this->commands_ = commands;
- this->topics_ = topics;
- current = QDocDatabase::qdocDB()->primaryTreeRoot();
-}
-
-/*!
- The destructor does nothing.
- */
-QmlDocVisitor::~QmlDocVisitor()
-{
- // nothing.
-}
-
-/*!
- Returns the location of the nearest comment above the \a offset.
- */
-QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const
-{
- QListIterator<QQmlJS::AST::SourceLocation> it(engine->comments());
- it.toBack();
-
- while (it.hasPrevious()) {
-
- QQmlJS::AST::SourceLocation loc = it.previous();
-
- if (loc.begin() <= lastEndOffset) {
- // Return if we reach the end of the preceding structure.
- break;
- }
- else if (usedComments.contains(loc.begin())) {
- // Return if we encounter a previously used comment.
- break;
- }
- else if (loc.begin() > lastEndOffset && loc.end() < offset) {
- // Only examine multiline comments in order to avoid snippet markers.
- if (document.at(loc.offset - 1) == QLatin1Char('*')) {
- QString comment = document.mid(loc.offset, loc.length);
- if (comment.startsWith(QLatin1Char('!')) || comment.startsWith(QLatin1Char('*'))) {
- return loc;
- }
- }
- }
- }
-
- return QQmlJS::AST::SourceLocation();
-}
-
-class QmlSignatureParser
-{
- public:
- QmlSignatureParser(FunctionNode* func, const QString& signature, const Location& loc);
- void readToken() { tok_ = tokenizer_->getToken(); }
- QString lexeme() { return tokenizer_->lexeme(); }
- QString previousLexeme() { return tokenizer_->previousLexeme(); }
-
- bool match(int target);
- bool matchDataType(CodeChunk* dataType, QString* var);
- bool matchParameter();
- bool matchFunctionDecl();
-
- private:
- QString signature_;
- QStringList names_;
- QString funcName_;
- Tokenizer* tokenizer_;
- int tok_;
- FunctionNode* func_;
- const Location& location_;
-};
-
-/*!
- Finds the nearest unused qdoc comment above the QML entity
- represented by the \a node and processes the qdoc commands
- in that comment. The processed documentation is stored in
- the \a node.
-
- If a qdoc comment is found for \a location, true is returned.
- If a comment is not found there, false is returned.
- */
-bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Node* node)
-{
- QQmlJS::AST::SourceLocation loc = precedingComment(location.begin());
-
- if (loc.isValid()) {
- QString source = document.mid(loc.offset, loc.length);
- Location start(filePath_);
- start.setLineNo(loc.startLine);
- start.setColumnNo(loc.startColumn);
- Location finish(filePath_);
- finish.setLineNo(loc.startLine);
- finish.setColumnNo(loc.startColumn);
-
- Doc doc(start, finish, source.mid(1), commands_, topics_);
- const TopicList& topicsUsed = doc.topicsUsed();
- NodeList nodes;
- Node* nodePassedIn = node;
- InnerNode* parent = nodePassedIn->parent();
- node->setDoc(doc);
- nodes.append(node);
- if (topicsUsed.size() > 0) {
- for (int i=0; i<topicsUsed.size(); ++i) {
- if ((topicsUsed.at(i).topic == COMMAND_QMLPROPERTYGROUP) ||
- (topicsUsed.at(i).topic == COMMAND_JSPROPERTYGROUP)) {
- qDebug() << "PROPERTY GROUP COMMAND SEEN:" << topicsUsed.at(i).args << filePath_;
- break;
- }
- }
- for (int i=0; i<topicsUsed.size(); ++i) {
- QString topic = topicsUsed.at(i).topic;
- QString args = topicsUsed.at(i).args;
- if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY) ||
- (topic == COMMAND_JSPROPERTY) || (topic == COMMAND_JSATTACHEDPROPERTY)) {
- QmlPropArgs qpa;
- if (splitQmlPropertyArg(doc, args, qpa)) {
- if (qpa.name_ == nodePassedIn->name()) {
- if (nodePassedIn->isAlias())
- nodePassedIn->setDataType(qpa.type_);
- }
- else {
- bool isAttached = (topic == COMMAND_QMLATTACHEDPROPERTY) ||
- (topic == COMMAND_JSATTACHEDPROPERTY);
- QmlPropertyNode* n = parent->hasQmlProperty(qpa.name_, isAttached);
- if (n == 0)
- n = new QmlPropertyNode(parent, qpa.name_, qpa.type_, isAttached);
- n->setLocation(doc.location());
- n->setDoc(doc);
- n->setReadOnly(nodePassedIn->isReadOnly());
- if (nodePassedIn->isDefault())
- n->setDefault();
- if (isAttached)
- n->setReadOnly(0);
- if ((topic == COMMAND_JSPROPERTY) ||
- (topic == COMMAND_JSATTACHEDPROPERTY))
- n->setGenus(Node::JS);
- nodes.append(n);
- }
- }
- else
- qDebug() << " FAILED TO PARSE QML OR JS PROPERTY:" << topic << args;
- }
- else if ((topic == COMMAND_QMLMETHOD) || (topic == COMMAND_QMLATTACHEDMETHOD) ||
- (topic == COMMAND_JSMETHOD) || (topic == COMMAND_JSATTACHEDMETHOD)) {
- if (node->isFunction()) {
- FunctionNode* fn = static_cast<FunctionNode*>(node);
- QmlSignatureParser qsp(fn, args, doc.location());
- }
- }
- }
- }
- for (int i=0; i<nodes.size(); ++i)
- applyMetacommands(loc, nodes.at(i), doc);
- usedComments.insert(loc.offset);
- if (doc.isEmpty()) {
- return false;
- }
- return true;
- }
- Location codeLoc(filePath_);
- codeLoc.setLineNo(location.startLine);
- node->setLocation(codeLoc);
- return false;
-}
-
-QmlSignatureParser::QmlSignatureParser(FunctionNode* func, const QString& signature, const Location& loc)
- : signature_(signature), func_(func), location_(loc)
-{
- QByteArray latin1 = signature.toLatin1();
- Tokenizer stringTokenizer(location_, latin1);
- stringTokenizer.setParsingFnOrMacro(true);
- tokenizer_ = &stringTokenizer;
- readToken();
- matchFunctionDecl();
-}
-
-/*!
- If the current token matches \a target, read the next
- token and return true. Otherwise, don't read the next
- token, and return false.
- */
-bool QmlSignatureParser::match(int target)
-{
- if (tok_ == target) {
- readToken();
- return true;
- }
- return false;
-}
-
-/*!
- Parse a QML data type into \a dataType and an optional
- variable name into \a var.
- */
-bool QmlSignatureParser::matchDataType(CodeChunk* dataType, QString* var)
-{
- /*
- This code is really hard to follow... sorry. The loop is there to match
- Alpha::Beta::Gamma::...::Omega.
- */
- for (;;) {
- bool virgin = true;
-
- if (tok_ != Tok_Ident) {
- while (match(Tok_signed) ||
- match(Tok_unsigned) ||
- match(Tok_short) ||
- match(Tok_long) ||
- match(Tok_int64)) {
- dataType->append(previousLexeme());
- virgin = false;
- }
- }
-
- if (virgin) {
- if (match(Tok_Ident)) {
- dataType->append(previousLexeme());
- }
- else if (match(Tok_void) ||
- match(Tok_int) ||
- match(Tok_char) ||
- match(Tok_double) ||
- match(Tok_Ellipsis))
- dataType->append(previousLexeme());
- else
- return false;
- }
- else if (match(Tok_int) ||
- match(Tok_char) ||
- match(Tok_double)) {
- dataType->append(previousLexeme());
- }
-
- if (match(Tok_Gulbrandsen))
- dataType->append(previousLexeme());
- else
- break;
- }
-
- while (match(Tok_Ampersand) ||
- match(Tok_Aster) ||
- match(Tok_const) ||
- match(Tok_Caret))
- dataType->append(previousLexeme());
-
- /*
- The usual case: Look for an optional identifier, then for
- some array brackets.
- */
- dataType->appendHotspot();
-
- if ((var != 0) && match(Tok_Ident))
- *var = previousLexeme();
-
- if (tok_ == Tok_LeftBracket) {
- int bracketDepth0 = tokenizer_->bracketDepth();
- while ((tokenizer_->bracketDepth() >= bracketDepth0 && tok_ != Tok_Eoi) ||
- tok_ == Tok_RightBracket) {
- dataType->append(lexeme());
- readToken();
- }
- }
- return true;
-}
-
-bool QmlSignatureParser::matchParameter()
-{
- QString name;
- CodeChunk dataType;
- CodeChunk defaultValue;
-
- bool result = matchDataType(&dataType, &name);
- if (name.isEmpty()) {
- name = dataType.toString();
- dataType.clear();
- }
-
- if (!result)
- return false;
- if (match(Tok_Equal)) {
- int parenDepth0 = tokenizer_->parenDepth();
- while (tokenizer_->parenDepth() >= parenDepth0 &&
- (tok_ != Tok_Comma ||
- tokenizer_->parenDepth() > parenDepth0) &&
- tok_ != Tok_Eoi) {
- defaultValue.append(lexeme());
- readToken();
- }
- }
- func_->addParameter(Parameter(dataType.toString(), "", name, defaultValue.toString()));
- return true;
-}
-
-bool QmlSignatureParser::matchFunctionDecl()
-{
- CodeChunk returnType;
-
- int firstBlank = signature_.indexOf(QChar(' '));
- int leftParen = signature_.indexOf(QChar('('));
- if ((firstBlank > 0) && (leftParen - firstBlank) > 1) {
- if (!matchDataType(&returnType, 0))
- return false;
- }
-
- while (match(Tok_Ident)) {
- names_.append(previousLexeme());
- if (!match(Tok_Gulbrandsen)) {
- funcName_ = previousLexeme();
- names_.pop_back();
- break;
- }
- }
-
- if (tok_ != Tok_LeftParen)
- return false;
-
- readToken();
-
- func_->setLocation(location_);
- func_->setReturnType(returnType.toString());
-
- if (tok_ != Tok_RightParen) {
- func_->clearParams();
- do {
- if (!matchParameter())
- return false;
- } while (match(Tok_Comma));
- }
- if (!match(Tok_RightParen))
- return false;
- return true;
-}
-
-/*!
- A QML property argument has the form...
-
- <type> <component>::<name>
- <type> <QML-module>::<component>::<name>
-
- This function splits the argument into one of those
- two forms. The three part form is the old form, which
- was used before the creation of QtQuick 2 and Qt
- Components. A <QML-module> is the QML equivalent of a
- C++ namespace. So this function splits \a arg on "::"
- and stores the parts in the \e {type}, \e {module},
- \e {component}, and \a {name}, fields of \a qpa. If it
- is successful, it returns \c true. If not enough parts
- are found, a qdoc warning is emitted and false is
- returned.
- */
-bool QmlDocVisitor::splitQmlPropertyArg(const Doc& doc,
- const QString& arg,
- QmlPropArgs& qpa)
-{
- qpa.clear();
- QStringList blankSplit = arg.split(QLatin1Char(' '));
- if (blankSplit.size() > 1) {
- qpa.type_ = blankSplit[0];
- QStringList colonSplit(blankSplit[1].split("::"));
- if (colonSplit.size() == 3) {
- qpa.module_ = colonSplit[0];
- qpa.component_ = colonSplit[1];
- qpa.name_ = colonSplit[2];
- return true;
- }
- else if (colonSplit.size() == 2) {
- qpa.component_ = colonSplit[0];
- qpa.name_ = colonSplit[1];
- return true;
- }
- else if (colonSplit.size() == 1) {
- qpa.name_ = colonSplit[0];
- return true;
- }
- QString msg = "Unrecognizable QML module/component qualifier for " + arg;
- doc.location().warning(tr(msg.toLatin1().data()));
- }
- else {
- QString msg = "Missing property type for " + arg;
- doc.location().warning(tr(msg.toLatin1().data()));
- }
- return false;
-}
-
-/*!
- Applies the metacommands found in the comment.
- */
-void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
- Node* node,
- Doc& doc)
-{
- QDocDatabase* qdb = QDocDatabase::qdocDB();
- QSet<QString> metacommands = doc.metaCommandsUsed();
- if (metacommands.count() > 0) {
- metacommands.subtract(topics_);
- QSet<QString>::iterator i = metacommands.begin();
- while (i != metacommands.end()) {
- QString command = *i;
- ArgList args = doc.metaCommandArgs(command);
- if (command == COMMAND_QMLABSTRACT) {
- if (node->isQmlType() || node->isJsType()) {
- node->setAbstract(true);
- }
- }
- else if (command == COMMAND_DEPRECATED) {
- node->setStatus(Node::Obsolete);
- }
- else if ((command == COMMAND_INQMLMODULE) || (command == COMMAND_INJSMODULE)) {
- qdb->addToQmlModule(args[0].first,node);
- }
- else if (command == COMMAND_QMLINHERITS) {
- if (node->name() == args[0].first)
- doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first));
- else if (node->isQmlType() || node->isJsType()) {
- QmlTypeNode *qmlType = static_cast<QmlTypeNode*>(node);
- qmlType->setQmlBaseName(args[0].first);
- QmlTypeNode::addInheritedBy(args[0].first,node);
- }
- }
- else if (command == COMMAND_QMLDEFAULT) {
- if (node->isQmlProperty() || node->isJsProperty()) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- qpn->setDefault();
- }
- }
- else if (command == COMMAND_QMLREADONLY) {
- if (node->isQmlProperty() || node->isJsProperty()) {
- QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
- qpn->setReadOnly(1);
- }
- }
- else if ((command == COMMAND_INGROUP) && !args.isEmpty()) {
- ArgList::ConstIterator argsIter = args.constBegin();
- while (argsIter != args.constEnd()) {
- QDocDatabase::qdocDB()->addToGroup(argsIter->first, node);
- ++argsIter;
- }
- }
- else if (command == COMMAND_INTERNAL) {
- node->setStatus(Node::Internal);
- }
- else if (command == COMMAND_OBSOLETE) {
- node->setStatus(Node::Obsolete);
- }
- else if (command == COMMAND_PAGEKEYWORDS) {
- // Not done yet. Do we need this?
- }
- else if (command == COMMAND_PRELIMINARY) {
- node->setStatus(Node::Preliminary);
- }
- else if (command == COMMAND_SINCE) {
- QString arg = args[0].first; //.join(' ');
- node->setSince(arg);
- }
- else if (command == COMMAND_WRAPPER) {
- node->setWrapper();
- }
- else {
- doc.location().warning(tr("The \\%1 command is ignored in QML files").arg(command));
- }
- ++i;
- }
- }
-}
-
-/*!
- Reconstruct the qualified \a id using dot notation
- and return the fully qualified string.
- */
-QString QmlDocVisitor::getFullyQualifiedId(QQmlJS::AST::UiQualifiedId *id)
-{
- QString result;
- if (id) {
- result = id->name.toString();
- id = id->next;
- while (id != 0) {
- result += QChar('.') + id->name.toString();
- id = id->next;
- }
- }
- return result;
-}
-
-/*!
- Begin the visit of the object \a definition, recording it in the
- qdoc database. Increment the object nesting level, which is used
- to test whether we are at the public API level. The public level
- is level 1.
-*/
-bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
-{
- QString type = getFullyQualifiedId(definition->qualifiedTypeNameId);
- nestingLevel++;
-
- if (current->type() == Node::Namespace) {
- QmlTypeNode *component = new QmlTypeNode(current, name);
- component->setTitle(name);
- component->setImportList(importList);
- importList.clear();
- if (applyDocumentation(definition->firstSourceLocation(), component)) {
- QmlTypeNode::addInheritedBy(type, component);
- component->setQmlBaseName(type);
- }
- current = component;
- }
-
- return true;
-}
-
-/*!
- End the visit of the object \a definition. In particular,
- decrement the object nesting level, which is used to test
- whether we are at the public API level. The public API
- level is level 1. It won't decrement below 0.
- */
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectDefinition *definition)
-{
- if (nestingLevel > 0) {
- --nestingLevel;
- }
- lastEndOffset = definition->lastSourceLocation().end();
-}
-
-bool QmlDocVisitor::visit(QQmlJS::AST::UiImport *import)
-{
- QString name = document.mid(import->fileNameToken.offset, import->fileNameToken.length);
- if (name[0] == '\"')
- name = name.mid(1, name.length()-2);
- QString version = document.mid(import->versionToken.offset, import->versionToken.length);
- QString importId = document.mid(import->importIdToken.offset, import->importIdToken.length);
- QString importUri = getFullyQualifiedId(import->importUri);
- QString reconstructed = importUri + QString(" ") + version;
- importList.append(ImportRec(name, version, importId, importUri));
-
- return true;
-}
-
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiImport *definition)
-{
- lastEndOffset = definition->lastSourceLocation().end();
-}
-
-bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectBinding *)
-{
- ++nestingLevel;
- return true;
-}
-
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectBinding *)
-{
- --nestingLevel;
-}
-
-bool QmlDocVisitor::visit(QQmlJS::AST::UiArrayBinding *)
-{
- return true;
-}
-
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiArrayBinding *)
-{
-}
-
-/*!
- Visits the public \a member declaration, which can be a
- signal or a property. It is a custom signal or property.
- Only visit the \a member if the nestingLevel is 1.
-*/
-bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
-{
- if (nestingLevel > 1) {
- return true;
- }
- switch (member->type) {
- case QQmlJS::AST::UiPublicMember::Signal:
- {
- if (current->isQmlType() || current->isJsType()) {
- QmlTypeNode *qmlType = static_cast<QmlTypeNode *>(current);
- if (qmlType) {
-
- QString name = member->name.toString();
- FunctionNode *qmlSignal = new FunctionNode(Node::QmlSignal, current, name, false);
-
- QList<Parameter> parameters;
- for (QQmlJS::AST::UiParameterList *it = member->parameters; it; it = it->next) {
- if (!it->type.isEmpty() && !it->name.isEmpty())
- parameters.append(Parameter(it->type.toString(), QString(), it->name.toString()));
- }
-
- qmlSignal->setParameters(parameters);
- applyDocumentation(member->firstSourceLocation(), qmlSignal);
- }
- }
- break;
- }
- case QQmlJS::AST::UiPublicMember::Property:
- {
- QString type = member->memberType.toString();
- QString name = member->name.toString();
- if (current->isQmlType() || current->isJsType()) {
- QmlTypeNode *qmlType = static_cast<QmlTypeNode *>(current);
- if (qmlType) {
- QString name = member->name.toString();
- QmlPropertyNode* qmlPropNode = qmlType->hasQmlProperty(name);
- if (qmlPropNode == 0) {
- qmlPropNode = new QmlPropertyNode(qmlType, name, type, false);
- if (current->isJsType())
- qmlPropNode->setGenus(Node::JS);
- }
- qmlPropNode->setReadOnly(member->isReadonlyMember);
- if (member->isDefaultMember)
- qmlPropNode->setDefault();
- applyDocumentation(member->firstSourceLocation(), qmlPropNode);
- }
- }
- break;
- }
- default:
- return false;
- }
-
- return true;
-}
-
-/*!
- End the visit of the \a member.
- */
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiPublicMember* member)
-{
- lastEndOffset = member->lastSourceLocation().end();
-}
-
-bool QmlDocVisitor::visit(QQmlJS::AST::IdentifierPropertyName *)
-{
- return true;
-}
-
-/*!
- Begin the visit of the function declaration \a fd, but only
- if the nesting level is 1.
- */
-bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd)
-{
- if (nestingLevel > 1) {
- return true;
- }
- if (current->isQmlType() || current->isJsType()) {
- QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(current);
- if (qmlType) {
- QString name = fd->name.toString();
- FunctionNode* qmlMethod = new FunctionNode(Node::QmlMethod, current, name, false);
- if (current->isJsType())
- qmlMethod->setGenus(Node::JS);
- int overloads = 0;
- NodeList::ConstIterator overloadIterator = current->childNodes().constBegin();
- while (overloadIterator != current->childNodes().constEnd()) {
- if ((*overloadIterator)->name() == name)
- overloads++;
- overloadIterator++;
- }
- if (overloads > 1)
- qmlMethod->setOverload(true);
- QList<Parameter> parameters;
- QQmlJS::AST::FormalParameterList* formals = fd->formals;
- if (formals) {
- QQmlJS::AST::FormalParameterList* fpl = formals;
- do {
- parameters.append(Parameter(QString(), QString(), fpl->name.toString()));
- fpl = fpl->next;
- } while (fpl && fpl != formals);
- qmlMethod->setParameters(parameters);
- }
- applyDocumentation(fd->firstSourceLocation(), qmlMethod);
- }
- }
- return true;
-}
-
-/*!
- End the visit of the function declaration, \a fd.
- */
-void QmlDocVisitor::endVisit(QQmlJS::AST::FunctionDeclaration* fd)
-{
- lastEndOffset = fd->lastSourceLocation().end();
-}
-
-/*!
- Begin the visit of the signal handler declaration \a sb, but only
- if the nesting level is 1.
-
- This visit is now deprecated. It has been decided to document
- public signals. If a signal handler must be discussed in the
- documentation, that discussion must take place in the comment
- for the signal.
- */
-bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* )
-{
-#if 0
- if (nestingLevel > 1) {
- return true;
- }
- if (current->isQmlType() || current->isJsType()) {
- QString handler = sb->qualifiedId->name.toString();
- if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) {
- QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(current);
- if (qmlType) {
- FunctionNode* qmlSH = new FunctionNode(Node::QmlSignalHandler,current,handler,false);
- applyDocumentation(sb->firstSourceLocation(), qmlSH);
- }
- }
- }
-#endif
- return true;
-}
-
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiScriptBinding* sb)
-{
- lastEndOffset = sb->lastSourceLocation().end();
-}
-
-bool QmlDocVisitor::visit(QQmlJS::AST::UiQualifiedId* )
-{
- return true;
-}
-
-void QmlDocVisitor::endVisit(QQmlJS::AST::UiQualifiedId* )
-{
- // nothing.
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h
deleted file mode 100644
index cfb167c985..0000000000
--- a/src/tools/qdoc/qmlvisitor.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 QMLVISITOR_H
-#define QMLVISITOR_H
-
-#include <qstring.h>
-#include "qqmljsastvisitor_p.h"
-#include "node.h"
-
-QT_BEGIN_NAMESPACE
-
-struct QmlPropArgs
-{
- QString type_;
- QString module_;
- QString component_;
- QString name_;
-
- void clear() {
- type_.clear();
- module_.clear();
- component_.clear();
- name_.clear();
- }
-};
-
-class QmlDocVisitor : public QQmlJS::AST::Visitor
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::QmlDocVisitor)
-
-public:
- QmlDocVisitor(const QString &filePath,
- const QString &code,
- QQmlJS::Engine *engine,
- const QSet<QString> &commands,
- const QSet<QString> &topics);
- virtual ~QmlDocVisitor();
-
- bool visit(QQmlJS::AST::UiImport *import) Q_DECL_OVERRIDE;
- void endVisit(QQmlJS::AST::UiImport *definition) Q_DECL_OVERRIDE;
-
- bool visit(QQmlJS::AST::UiObjectDefinition *definition) Q_DECL_OVERRIDE;
- void endVisit(QQmlJS::AST::UiObjectDefinition *definition) Q_DECL_OVERRIDE;
-
- bool visit(QQmlJS::AST::UiPublicMember *member) Q_DECL_OVERRIDE;
- void endVisit(QQmlJS::AST::UiPublicMember *definition) Q_DECL_OVERRIDE;
-
- virtual bool visit(QQmlJS::AST::UiObjectBinding *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::UiObjectBinding *) Q_DECL_OVERRIDE;
- virtual void endVisit(QQmlJS::AST::UiArrayBinding *) Q_DECL_OVERRIDE;
- virtual bool visit(QQmlJS::AST::UiArrayBinding *) Q_DECL_OVERRIDE;
-
- bool visit(QQmlJS::AST::IdentifierPropertyName *idproperty) Q_DECL_OVERRIDE;
-
- bool visit(QQmlJS::AST::FunctionDeclaration *) Q_DECL_OVERRIDE;
- void endVisit(QQmlJS::AST::FunctionDeclaration *) Q_DECL_OVERRIDE;
-
- bool visit(QQmlJS::AST::UiScriptBinding *) Q_DECL_OVERRIDE;
- void endVisit(QQmlJS::AST::UiScriptBinding *) Q_DECL_OVERRIDE;
-
- bool visit(QQmlJS::AST::UiQualifiedId *) Q_DECL_OVERRIDE;
- void endVisit(QQmlJS::AST::UiQualifiedId *) Q_DECL_OVERRIDE;
-
-private:
- QString getFullyQualifiedId(QQmlJS::AST::UiQualifiedId *id);
- QQmlJS::AST::SourceLocation precedingComment(quint32 offset) const;
- bool applyDocumentation(QQmlJS::AST::SourceLocation location, Node *node);
- void applyMetacommands(QQmlJS::AST::SourceLocation location, Node* node, Doc& doc);
- bool splitQmlPropertyArg(const Doc& doc,
- const QString& arg,
- QmlPropArgs& qpa);
-
- QQmlJS::Engine *engine;
- quint32 lastEndOffset;
- quint32 nestingLevel;
- QString filePath_;
- QString name;
- QString document;
- ImportList importList;
- QSet<QString> commands_;
- QSet<QString> topics_;
- QSet<quint32> usedComments;
- InnerNode *current;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/quoter.cpp b/src/tools/qdoc/quoter.cpp
deleted file mode 100644
index d8a4df33f3..0000000000
--- a/src/tools/qdoc/quoter.cpp
+++ /dev/null
@@ -1,370 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 <qfileinfo.h>
-#include <qregexp.h>
-#include <qdebug.h>
-
-#include "quoter.h"
-
-QT_BEGIN_NAMESPACE
-
-static void replaceMultipleNewlines(QString &s)
-{
- const int n = s.size();
- bool slurping = false;
- int j = -1;
- const QChar newLine = QLatin1Char('\n');
- QChar *d = s.data();
- for (int i = 0; i != n; ++i) {
- const QChar c = d[i];
- bool hit = (c == newLine);
- if (slurping && hit)
- continue;
- d[++j] = c;
- slurping = hit;
- }
- s.resize(++j);
-}
-
-// This is equivalent to line.split( QRegExp("\n(?!\n|$)") ) but much faster
-QStringList Quoter::splitLines(const QString &line)
-{
- QStringList result;
- int i = line.size();
- while (true) {
- int j = i - 1;
- while (j >= 0 && line.at(j) == QLatin1Char('\n'))
- --j;
- while (j >= 0 && line.at(j) != QLatin1Char('\n'))
- --j;
- result.prepend(line.mid(j + 1, i - j - 1));
- if (j < 0)
- break;
- i = j;
- }
- return result;
-}
-
-/*
- Transforms 'int x = 3 + 4' into 'int x=3+4'. A white space is kept
- between 'int' and 'x' because it is meaningful in C++.
-*/
-static void trimWhiteSpace( QString& str )
-{
- enum { Normal, MetAlnum, MetSpace } state = Normal;
- const int n = str.length();
-
- int j = -1;
- QChar *d = str.data();
- for ( int i = 0; i != n; ++i ) {
- const QChar c = d[i];
- if ( c.isLetterOrNumber() ) {
- if ( state == Normal ) {
- state = MetAlnum;
- } else {
- if ( state == MetSpace )
- str[++j] = c;
- state = Normal;
- }
- str[++j] = c;
- } else if ( c.isSpace() ) {
- if ( state == MetAlnum )
- state = MetSpace;
- } else {
- state = Normal;
- str[++j] = c;
- }
- }
- str.resize(++j);
-}
-
-Quoter::Quoter()
- : silent( false )
-{
- /* We're going to hard code these delimiters:
- * C++, Qt, Qt Script, Java:
- //! [<id>]
- * .pro, .py files:
- #! [<id>]
- * .html, .qrc, .ui, .xq, .xml .dita files:
- <!-- [<id>] -->
- */
- commentHash["pro"] = "#!";
- commentHash["py"] = "#!";
- commentHash["html"] = "<!--";
- commentHash["qrc"] = "<!--";
- commentHash["ui"] = "<!--";
- commentHash["xml"] = "<!--";
- commentHash["dita"] = "<!--";
- commentHash["xq"] = "<!--";
-}
-
-void Quoter::reset()
-{
- silent = false;
- plainLines.clear();
- markedLines.clear();
- codeLocation = Location::null;
-}
-
-void Quoter::quoteFromFile( const QString& userFriendlyFilePath,
- const QString& plainCode,
- const QString& markedCode )
-{
- silent = false;
-
- /*
- Split the source code into logical lines. Empty lines are
- treated specially. Before:
-
- p->alpha();
- p->beta();
-
- p->gamma();
-
-
- p->delta();
-
- After:
-
- p->alpha();
- p->beta();\n
- p->gamma();\n\n
- p->delta();
-
- Newlines are preserved because they affect codeLocation.
- */
- codeLocation = Location( userFriendlyFilePath );
-
- plainLines = splitLines(plainCode);
- markedLines = splitLines(markedCode);
- if (markedLines.count() != plainLines.count()) {
- codeLocation.warning(tr("Something is wrong with qdoc's handling of marked code"));
- markedLines = plainLines;
- }
-
- /*
- Squeeze blanks (cat -s).
- */
- QStringList::Iterator m = markedLines.begin();
- while ( m != markedLines.end() ) {
- replaceMultipleNewlines( *m );
- ++m;
- }
- codeLocation.start();
-}
-
-QString Quoter::quoteLine( const Location& docLocation, const QString& command,
- const QString& pattern )
-{
- if ( plainLines.isEmpty() ) {
- failedAtEnd( docLocation, command );
- return QString();
- }
-
- if ( pattern.isEmpty() ) {
- docLocation.warning( tr("Missing pattern after '\\%1'").arg(command) );
- return QString();
- }
-
- if ( match(docLocation, pattern, plainLines.first()) )
- return getLine();
-
- if ( !silent ) {
- docLocation.warning( tr("Command '\\%1' failed").arg(command) );
- codeLocation.warning( tr("Pattern '%1' didn't match here")
- .arg(pattern) );
- silent = true;
- }
- return QString();
-}
-
-QString Quoter::quoteSnippet(const Location &docLocation, const QString &identifier)
-{
- QString comment = commentForCode();
- QString delimiter = comment + QString(" [%1]").arg(identifier);
- QString t;
- int indent = 0;
-
- while (!plainLines.isEmpty()) {
- if (match(docLocation, delimiter, plainLines.first())) {
- QString startLine = getLine();
- while (indent < startLine.length() && startLine[indent] == QLatin1Char(' '))
- indent++;
- break;
- }
- getLine();
- }
- while (!plainLines.isEmpty()) {
- QString line = plainLines.first();
- if (match(docLocation, delimiter, line)) {
- QString lastLine = getLine(indent);
- int dIndex = lastLine.indexOf(delimiter);
- if (dIndex > 0) {
- // The delimiter might be preceded on the line by other
- // delimeters, so look for the first comment on the line.
- QString leading = lastLine.left(dIndex);
- dIndex = leading.indexOf(comment);
- if (dIndex != -1)
- leading = leading.left(dIndex);
- if (leading.endsWith(QLatin1String("<@comment>")))
- leading.chop(10);
- if (!leading.trimmed().isEmpty())
- t += leading;
- }
- return t;
- }
-
- t += removeSpecialLines(line, comment, indent);
- }
- failedAtEnd(docLocation, QString("snippet (%1)").arg(delimiter));
- return t;
-}
-
-QString Quoter::quoteTo( const Location& docLocation, const QString& command,
- const QString& pattern )
-{
- QString t;
- QString comment = commentForCode();
-
- if ( pattern.isEmpty() ) {
- while ( !plainLines.isEmpty() ) {
- QString line = plainLines.first();
- t += removeSpecialLines(line, comment);
- }
- } else {
- while ( !plainLines.isEmpty() ) {
- if ( match(docLocation, pattern, plainLines.first()) ) {
- return t;
- }
- t += getLine();
- }
- failedAtEnd( docLocation, command );
- }
- return t;
-}
-
-QString Quoter::quoteUntil( const Location& docLocation, const QString& command,
- const QString& pattern )
-{
- QString t = quoteTo( docLocation, command, pattern );
- t += getLine();
- return t;
-}
-
-QString Quoter::getLine(int unindent)
-{
- if ( plainLines.isEmpty() )
- return QString();
-
- plainLines.removeFirst();
-
- QString t = markedLines.takeFirst();
- int i = 0;
- while (i < unindent && i < t.length() && t[i] == QLatin1Char(' '))
- i++;
-
- t = t.mid(i);
- t += QLatin1Char('\n');
- codeLocation.advanceLines( t.count( QLatin1Char('\n') ) );
- return t;
-}
-
-bool Quoter::match( const Location& docLocation, const QString& pattern0,
- const QString& line )
-{
- QString str = line;
- while ( str.endsWith(QLatin1Char('\n')) )
- str.truncate( str.length() - 1 );
-
- QString pattern = pattern0;
- if ( pattern.startsWith(QLatin1Char('/'))
- && pattern.endsWith(QLatin1Char('/'))
- && pattern.length() > 2 ) {
- QRegExp rx( pattern.mid(1, pattern.length() - 2) );
- if ( !silent && !rx.isValid() ) {
- docLocation.warning( tr("Invalid regular expression '%1'")
- .arg(rx.pattern()) );
- silent = true;
- }
- return str.indexOf( rx ) != -1;
- }
- trimWhiteSpace(str);
- trimWhiteSpace(pattern);
- return str.indexOf(pattern) != -1;
-}
-
-void Quoter::failedAtEnd( const Location& docLocation, const QString& command )
-{
- if (!silent && !command.isEmpty()) {
- if ( codeLocation.filePath().isEmpty() ) {
- docLocation.warning( tr("Unexpected '\\%1'").arg(command) );
- } else {
- docLocation.warning( tr("Command '\\%1' failed at end of file '%2'")
- .arg(command).arg(codeLocation.filePath()) );
- }
- silent = true;
- }
-}
-
-QString Quoter::commentForCode() const
-{
- QString suffix = QFileInfo(codeLocation.fileName()).suffix();
- return commentHash.value(suffix, "//!");
-}
-
-QString Quoter::removeSpecialLines(const QString &line, const QString &comment, int unindent)
-{
- QString t;
-
- // Remove special macros to support Qt namespacing.
- QString trimmed = line.trimmed();
- if (trimmed.startsWith("QT_BEGIN_NAMESPACE")) {
- getLine();
- } else if (trimmed.startsWith("QT_END_NAMESPACE")) {
- getLine();
- t += QLatin1Char('\n');
- } else if (!trimmed.startsWith(comment)) {
- // Ordinary code
- t += getLine(unindent);
- } else {
- // Comments
- if (line.contains(QLatin1Char('\n')))
- t += QLatin1Char('\n');
- getLine();
- }
- return t;
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/quoter.h b/src/tools/qdoc/quoter.h
deleted file mode 100644
index 2c3fa3980d..0000000000
--- a/src/tools/qdoc/quoter.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- quoter.h
-*/
-
-#ifndef QUOTER_H
-#define QUOTER_H
-
-#include <qhash.h>
-#include <qstringlist.h>
-
-#include "location.h"
-
-QT_BEGIN_NAMESPACE
-
-class Quoter
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Quoter)
-
-public:
- Quoter();
-
- void reset();
- void quoteFromFile( const QString& userFriendlyFileName,
- const QString& plainCode, const QString& markedCode );
- QString quoteLine( const Location& docLocation, const QString& command,
- const QString& pattern );
- QString quoteTo( const Location& docLocation, const QString& command,
- const QString& pattern );
- QString quoteUntil( const Location& docLocation, const QString& command,
- const QString& pattern );
- QString quoteSnippet(const Location &docLocation, const QString &identifier);
-
- static QStringList splitLines(const QString &line);
-
-private:
- QString getLine(int unindent = 0);
- void failedAtEnd( const Location& docLocation, const QString& command );
- bool match( const Location& docLocation, const QString& pattern,
- const QString& line );
- QString commentForCode() const;
- QString removeSpecialLines(const QString &line, const QString &comment,
- int unindent = 0);
-
- bool silent;
- QStringList plainLines;
- QStringList markedLines;
- Location codeLocation;
- QHash<QString,QString> commentHash;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/separator.cpp b/src/tools/qdoc/separator.cpp
deleted file mode 100644
index 3cbcb6930b..0000000000
--- a/src/tools/qdoc/separator.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- separator.cpp
-*/
-
-#include "separator.h"
-#include <qcoreapplication.h>
-
-QT_BEGIN_NAMESPACE
-
-QString separator(int index, int count)
-{
- if (index == count - 1)
- return QCoreApplication::translate("QDoc", ".", "terminator");
- if (count == 2)
- return QCoreApplication::translate("QDoc", " and ", "separator when N = 2");
- if (index == 0)
- return QCoreApplication::translate("QDoc", ", ", "first separator when N > 2");
- if (index < count - 2)
- return QCoreApplication::translate("QDoc", ", ", "general separator when N > 2");
- return QCoreApplication::translate("QDoc", ", and ", "last separator when N > 2");
-}
-
-QString comma(int index, int count)
-{
- if (index == count - 1)
- return QString();
- if (count == 2)
- return QCoreApplication::translate("QDoc", " and ", "separator when N = 2");
- if (index == 0)
- return QCoreApplication::translate("QDoc", ", ", "first separator when N > 2");
- if (index < count - 2)
- return QCoreApplication::translate("QDoc", ", ", "general separator when N > 2");
- return QCoreApplication::translate("QDoc", ", and ", "last separator when N > 2");
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/separator.h b/src/tools/qdoc/separator.h
deleted file mode 100644
index 281d95994e..0000000000
--- a/src/tools/qdoc/separator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- separator.h
-*/
-
-#ifndef SEPARATOR_H
-#define SEPARATOR_H
-
-#include <qstring.h>
-
-QT_BEGIN_NAMESPACE
-
-QString separator( int index, int count );
-QString comma( int index, int count );
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/text.cpp b/src/tools/qdoc/text.cpp
deleted file mode 100644
index b4eebe4c75..0000000000
--- a/src/tools/qdoc/text.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- text.cpp
-*/
-
-#include <qregexp.h>
-#include "text.h"
-#include <stdio.h>
-
-QT_BEGIN_NAMESPACE
-
-Text::Text()
- : first(0), last(0)
-{
-}
-
-Text::Text(const QString &str)
- : first(0), last(0)
-{
- operator<<(str);
-}
-
-Text::Text(const Text& text)
- : first(0), last(0)
-{
- operator=(text);
-}
-
-Text::~Text()
-{
- clear();
-}
-
-Text& Text::operator=(const Text& text)
-{
- if (this != &text) {
- clear();
- operator<<(text);
- }
- return *this;
-}
-
-Text& Text::operator<<(Atom::Type atomType)
-{
- return operator<<(Atom(atomType));
-}
-
-Text& Text::operator<<(const QString& string)
-{
- return operator<<(Atom(Atom::String, string));
-}
-
-Text& Text::operator<<(const Atom& atom)
-{
- if (atom.count() < 2) {
- if (first == 0) {
- first = new Atom(atom.type(), atom.string());
- last = first;
- }
- else
- last = new Atom(last, atom.type(), atom.string());
- }
- else {
- if (first == 0) {
- first = new Atom(atom.type(), atom.string(), atom.string(1));
- last = first;
- }
- else
- last = new Atom(last, atom.type(), atom.string(), atom.string(1));
- }
- return *this;
-}
-
-/*!
- Special output operator for LinkAtom. It makes a copy of
- the LinkAtom \a atom and connects the cop;y to the list
- in this Text.
- */
-Text& Text::operator<<(const LinkAtom& atom)
-{
- if (first == 0) {
- first = new LinkAtom(atom);
- last = first;
- }
- else
- last = new LinkAtom(last, atom);
- return *this;
-}
-
-Text& Text::operator<<(const Text& text)
-{
- const Atom* atom = text.firstAtom();
- while (atom != 0) {
- operator<<(*atom);
- atom = atom->next();
- }
- return *this;
-}
-
-void Text::stripFirstAtom()
-{
- if (first != 0) {
- if (first == last)
- last = 0;
- Atom* oldFirst = first;
- first = first->next();
- delete oldFirst;
- }
-}
-
-void Text::stripLastAtom()
-{
- if (last != 0) {
- Atom* oldLast = last;
- if (first == last) {
- first = 0;
- last = 0;
- } else {
- last = first;
- while (last->next() != oldLast)
- last = last->next();
- last->setNext(0);
- }
- delete oldLast;
- }
-}
-
-/*!
- This function traverses the atom list of the Text object,
- extracting all the string parts. It concatenates them to
- a result string and returns it.
- */
-QString Text::toString() const
-{
- QString str;
- const Atom* atom = firstAtom();
- while (atom != 0) {
- if (atom->type() == Atom::String ||
- atom->type() == Atom::AutoLink ||
- atom->type() == Atom::C ||
- atom->type() == Atom::GuidLink)
- str += atom->string();
- atom = atom->next();
- }
- return str;
-}
-
-Text Text::subText(Atom::Type left, Atom::Type right, const Atom* from, bool inclusive) const
-{
- const Atom* begin = from ? from : firstAtom();
- const Atom* end;
-
- while (begin != 0 && begin->type() != left)
- begin = begin->next();
- if (begin != 0) {
- if (!inclusive)
- begin = begin->next();
- }
-
- end = begin;
- while (end != 0 && end->type() != right)
- end = end->next();
- if (end == 0)
- begin = 0;
- else if (inclusive)
- end = end->next();
- return subText(begin, end);
-}
-
-Text Text::sectionHeading(const Atom* sectionLeft)
-{
- if (sectionLeft != 0) {
- const Atom* begin = sectionLeft;
- while (begin != 0 && begin->type() != Atom::SectionHeadingLeft)
- begin = begin->next();
- if (begin != 0)
- begin = begin->next();
-
- const Atom* end = begin;
- while (end != 0 && end->type() != Atom::SectionHeadingRight)
- end = end->next();
-
- if (end != 0)
- return subText(begin, end);
- }
- return Text();
-}
-
-const Atom* Text::sectionHeadingAtom(const Atom* sectionLeft)
-{
- if (sectionLeft != 0) {
- const Atom* begin = sectionLeft;
- while (begin != 0 && begin->type() != Atom::SectionHeadingLeft)
- begin = begin->next();
- if (begin != 0)
- begin = begin->next();
-
- return begin;
- }
- return 0;
-}
-
-void Text::dump() const
-{
- const Atom* atom = firstAtom();
- while (atom != 0) {
- QString str = atom->string();
- str.replace("\\", "\\\\");
- str.replace("\"", "\\\"");
- str.replace("\n", "\\n");
- str.replace(QRegExp("[^\x20-\x7e]"), "?");
- if (!str.isEmpty())
- str = " \"" + str + QLatin1Char('"');
- fprintf(stderr, " %-15s%s\n", atom->typeString().toLatin1().data(), str.toLatin1().data());
- atom = atom->next();
- }
-}
-
-Text Text::subText(const Atom* begin, const Atom* end)
-{
- Text text;
- if (begin != 0) {
- while (begin != end) {
- text << *begin;
- begin = begin->next();
- }
- }
- return text;
-}
-
-void Text::clear()
-{
- while (first != 0) {
- Atom* atom = first;
- first = first->next();
- delete atom;
- }
- first = 0;
- last = 0;
-}
-
-int Text::compare(const Text &text1, const Text &text2)
-{
- if (text1.isEmpty())
- return text2.isEmpty() ? 0 : -1;
- if (text2.isEmpty())
- return 1;
-
- const Atom* atom1 = text1.firstAtom();
- const Atom* atom2 = text2.firstAtom();
-
- for (;;) {
- if (atom1->type() != atom2->type())
- return (int)atom1->type() - (int)atom2->type();
- int cmp = QString::compare(atom1->string(), atom2->string());
- if (cmp != 0)
- return cmp;
-
- if (atom1 == text1.lastAtom())
- return atom2 == text2.lastAtom() ? 0 : -1;
- if (atom2 == text2.lastAtom())
- return 1;
- atom1 = atom1->next();
- atom2 = atom2->next();
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/text.h b/src/tools/qdoc/text.h
deleted file mode 100644
index 7f4eeb3ec2..0000000000
--- a/src/tools/qdoc/text.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- text.h
-*/
-
-#ifndef TEXT_H
-#define TEXT_H
-
-#include "atom.h"
-
-QT_BEGIN_NAMESPACE
-
-class Text
-{
-public:
- Text();
- explicit Text(const QString &str);
- Text(const Text& text);
- ~Text();
-
- Text& operator=(const Text& text);
-
- Atom *firstAtom() { return first; }
- Atom *lastAtom() { return last; }
- Text& operator<<(Atom::Type atomType);
- Text& operator<<(const QString& string);
- Text& operator<<(const Atom& atom);
- Text& operator<<(const LinkAtom& atom);
- Text& operator<<(const Text& text);
- void stripFirstAtom();
- void stripLastAtom();
-
- bool isEmpty() const { return first == 0; }
- QString toString() const;
- const Atom *firstAtom() const { return first; }
- const Atom *lastAtom() const { return last; }
- Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0, bool inclusive = false) const;
- void dump() const;
- void clear();
-
- static Text subText(const Atom *begin, const Atom *end = 0);
- static Text sectionHeading(const Atom *sectionBegin);
- static const Atom *sectionHeadingAtom(const Atom *sectionLeft);
- static int compare(const Text &text1, const Text &text2);
-
-private:
-
- Atom *first;
- Atom *last;
-};
-
-inline bool operator==(const Text &text1, const Text &text2)
-{ return Text::compare(text1, text2) == 0; }
-inline bool operator!=(const Text &text1, const Text &text2)
-{ return Text::compare(text1, text2) != 0; }
-inline bool operator<(const Text &text1, const Text &text2)
-{ return Text::compare(text1, text2) < 0; }
-inline bool operator<=(const Text &text1, const Text &text2)
-{ return Text::compare(text1, text2) <= 0; }
-inline bool operator>(const Text &text1, const Text &text2)
-{ return Text::compare(text1, text2) > 0; }
-inline bool operator>=(const Text &text1, const Text &text2)
-{ return Text::compare(text1, text2) >= 0; }
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/tokenizer.cpp b/src/tools/qdoc/tokenizer.cpp
deleted file mode 100644
index 68c6fb7831..0000000000
--- a/src/tools/qdoc/tokenizer.cpp
+++ /dev/null
@@ -1,798 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "config.h"
-#include "tokenizer.h"
-
-#include <qfile.h>
-#include <qhash.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qtextcodec.h>
-
-#include <ctype.h>
-#include <string.h>
-
-QT_BEGIN_NAMESPACE
-
-#define LANGUAGE_CPP "Cpp"
-
-/* qmake ignore Q_OBJECT */
-
-/*
- Keep in sync with tokenizer.h.
-*/
-static const char *kwords[] = {
- "char", "class", "const", "double", "enum", "explicit",
- "friend", "inline", "int", "long", "namespace", "operator",
- "private", "protected", "public", "short", "signals", "signed",
- "slots", "static", "struct", "template", "typedef", "typename",
- "union", "unsigned", "using", "virtual", "void", "volatile",
- "__int64",
- "Q_OBJECT",
- "Q_OVERRIDE",
- "Q_PROPERTY",
- "Q_PRIVATE_PROPERTY",
- "Q_DECLARE_SEQUENTIAL_ITERATOR",
- "Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR",
- "Q_DECLARE_ASSOCIATIVE_ITERATOR",
- "Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR",
- "Q_DECLARE_FLAGS",
- "Q_SIGNALS",
- "Q_SLOTS",
- "QT_COMPAT",
- "QT_COMPAT_CONSTRUCTOR",
- "QT_DEPRECATED",
- "QT_MOC_COMPAT",
- "QT_MODULE",
- "QT3_SUPPORT",
- "QT3_SUPPORT_CONSTRUCTOR",
- "QT3_MOC_SUPPORT",
- "QDOC_PROPERTY",
- "QPrivateSignal"
-};
-
-static const int KwordHashTableSize = 4096;
-static int kwordHashTable[KwordHashTableSize];
-
-static QHash<QByteArray, bool> *ignoredTokensAndDirectives = 0;
-
-static QRegExp *comment = 0;
-static QRegExp *versionX = 0;
-static QRegExp *definedX = 0;
-
-static QRegExp *defines = 0;
-static QRegExp *falsehoods = 0;
-
-#ifndef QT_NO_TEXTCODEC
-static QTextCodec *sourceCodec = 0;
-#endif
-
-/*
- This function is a perfect hash function for the 37 keywords of C99
- (with a hash table size of 512). It should perform well on our
- Qt-enhanced C++ subset.
-*/
-static int hashKword(const char *s, int len)
-{
- return (((uchar) s[0]) + (((uchar) s[2]) << 5) +
- (((uchar) s[len - 1]) << 3)) % KwordHashTableSize;
-}
-
-static void insertKwordIntoHash(const char *s, int number)
-{
- int k = hashKword(s, int(strlen(s)));
- while (kwordHashTable[k]) {
- if (++k == KwordHashTableSize)
- k = 0;
- }
- kwordHashTable[k] = number;
-}
-
-Tokenizer::Tokenizer(const Location& loc, QFile &in)
-{
- init();
- yyIn = in.readAll();
- yyPos = 0;
- start(loc);
-}
-
-Tokenizer::Tokenizer(const Location& loc, const QByteArray &in)
- : yyIn(in)
-{
- init();
- yyPos = 0;
- start(loc);
-}
-
-Tokenizer::~Tokenizer()
-{
- delete[] yyLexBuf1;
- delete[] yyLexBuf2;
-}
-
-int Tokenizer::getToken()
-{
- char *t = yyPrevLex;
- yyPrevLex = yyLex;
- yyLex = t;
-
- while (yyCh != EOF) {
- yyTokLoc = yyCurLoc;
- yyLexLen = 0;
-
- if (isspace(yyCh)) {
- do {
- yyCh = getChar();
- } while (isspace(yyCh));
- }
- else if (isalpha(yyCh) || yyCh == '_') {
- do {
- yyCh = getChar();
- } while (isalnum(yyCh) || yyCh == '_');
-
- int k = hashKword(yyLex, int(yyLexLen));
- for (;;) {
- int i = kwordHashTable[k];
- if (i == 0) {
- return Tok_Ident;
- }
- else if (i == -1) {
- if (!parsingMacro && ignoredTokensAndDirectives->contains(yyLex)) {
- if (ignoredTokensAndDirectives->value(yyLex)) { // it's a directive
- int parenDepth = 0;
- while (yyCh != EOF && (yyCh != ')' || parenDepth > 1)) {
- if (yyCh == '(')
- ++parenDepth;
- else if (yyCh == ')')
- --parenDepth;
- yyCh = getChar();
- }
- if (yyCh == ')')
- yyCh = getChar();
- }
- break;
- }
- }
- else if (strcmp(yyLex, kwords[i - 1]) == 0) {
- int ret = (int) Tok_FirstKeyword + i - 1;
- if (ret != Tok_explicit && ret != Tok_inline && ret != Tok_typename)
- return ret;
- break;
- }
-
- if (++k == KwordHashTableSize)
- k = 0;
- }
- }
- else if (isdigit(yyCh)) {
- do {
- yyCh = getChar();
- } while (isalnum(yyCh) || yyCh == '.' || yyCh == '+' ||
- yyCh == '-');
- return Tok_Number;
- }
- else {
- switch (yyCh) {
- case '!':
- case '%':
- yyCh = getChar();
- if (yyCh == '=')
- yyCh = getChar();
- return Tok_SomeOperator;
- case '"':
- yyCh = getChar();
-
- while (yyCh != EOF && yyCh != '"') {
- if (yyCh == '\\')
- yyCh = getChar();
- yyCh = getChar();
- }
- yyCh = getChar();
-
- if (yyCh == EOF)
- yyTokLoc.warning(tr("Unterminated C++ string literal"),
- tr("Maybe you forgot '/*!' at the beginning of the file?"));
- else
- return Tok_String;
- break;
- case '#':
- return getTokenAfterPreprocessor();
- case '&':
- yyCh = getChar();
- /*
- Removed check for '&&', only interpret '&=' as an operator.
- '&&' is also used for an rvalue reference. QTBUG-32675
- */
- if (yyCh == '=') {
- yyCh = getChar();
- return Tok_SomeOperator;
- }
- else {
- return Tok_Ampersand;
- }
- case '\'':
- yyCh = getChar();
- /*
- Allow empty character literal. QTBUG-25775
- */
- if (yyCh == '\'') {
- yyCh = getChar();
- break;
- }
- if (yyCh == '\\')
- yyCh = getChar();
- do {
- yyCh = getChar();
- } while (yyCh != EOF && yyCh != '\'');
-
- if (yyCh == EOF) {
- yyTokLoc.warning(tr("Unterminated C++ character literal"));
- }
- else {
- yyCh = getChar();
- return Tok_Number;
- }
- break;
- case '(':
- yyCh = getChar();
- if (yyNumPreprocessorSkipping == 0)
- yyParenDepth++;
- if (isspace(yyCh)) {
- do {
- yyCh = getChar();
- } while (isspace(yyCh));
- yyLexLen = 1;
- yyLex[1] = '\0';
- }
- if (yyCh == '*') {
- yyCh = getChar();
- return Tok_LeftParenAster;
- }
- return Tok_LeftParen;
- case ')':
- yyCh = getChar();
- if (yyNumPreprocessorSkipping == 0)
- yyParenDepth--;
- return Tok_RightParen;
- case '*':
- yyCh = getChar();
- if (yyCh == '=') {
- yyCh = getChar();
- return Tok_SomeOperator;
- } else {
- return Tok_Aster;
- }
- case '^':
- yyCh = getChar();
- if (yyCh == '=') {
- yyCh = getChar();
- return Tok_SomeOperator;
- } else {
- return Tok_Caret;
- }
- case '+':
- yyCh = getChar();
- if (yyCh == '+' || yyCh == '=')
- yyCh = getChar();
- return Tok_SomeOperator;
- case ',':
- yyCh = getChar();
- return Tok_Comma;
- case '-':
- yyCh = getChar();
- if (yyCh == '-' || yyCh == '=') {
- yyCh = getChar();
- } else if (yyCh == '>') {
- yyCh = getChar();
- if (yyCh == '*')
- yyCh = getChar();
- }
- return Tok_SomeOperator;
- case '.':
- yyCh = getChar();
- if (yyCh == '*') {
- yyCh = getChar();
- } else if (yyCh == '.') {
- do {
- yyCh = getChar();
- } while (yyCh == '.');
- return Tok_Ellipsis;
- } else if (isdigit(yyCh)) {
- do {
- yyCh = getChar();
- } while (isalnum(yyCh) || yyCh == '.' || yyCh == '+' ||
- yyCh == '-');
- return Tok_Number;
- }
- return Tok_SomeOperator;
- case '/':
- yyCh = getChar();
- if (yyCh == '/') {
- do {
- yyCh = getChar();
- } while (yyCh != EOF && yyCh != '\n');
- } else if (yyCh == '*') {
- bool metDoc = false; // empty doc is no doc
- bool metSlashAsterBang = false;
- bool metAster = false;
- bool metAsterSlash = false;
-
- yyCh = getChar();
- if (yyCh == '!')
- metSlashAsterBang = true;
-
- while (!metAsterSlash) {
- if (yyCh == EOF) {
- yyTokLoc.warning(tr("Unterminated C++ comment"));
- break;
- } else {
- if (yyCh == '*') {
- metAster = true;
- } else if (metAster && yyCh == '/') {
- metAsterSlash = true;
- } else {
- metAster = false;
- if (isgraph(yyCh))
- metDoc = true;
- }
- }
- yyCh = getChar();
- }
- if (metSlashAsterBang && metDoc)
- return Tok_Doc;
- else if (yyParenDepth > 0)
- return Tok_Comment;
- } else {
- if (yyCh == '=')
- yyCh = getChar();
- return Tok_SomeOperator;
- }
- break;
- case ':':
- yyCh = getChar();
- if (yyCh == ':') {
- yyCh = getChar();
- return Tok_Gulbrandsen;
- } else {
- return Tok_Colon;
- }
- case ';':
- yyCh = getChar();
- return Tok_Semicolon;
- case '<':
- yyCh = getChar();
- if (yyCh == '<') {
- yyCh = getChar();
- if (yyCh == '=')
- yyCh = getChar();
- return Tok_SomeOperator;
- } else if (yyCh == '=') {
- yyCh = getChar();
- return Tok_SomeOperator;
- } else {
- return Tok_LeftAngle;
- }
- case '=':
- yyCh = getChar();
- if (yyCh == '=') {
- yyCh = getChar();
- return Tok_SomeOperator;
- } else {
- return Tok_Equal;
- }
- case '>':
- yyCh = getChar();
- if (yyCh == '>') {
- yyCh = getChar();
- if (yyCh == '=')
- yyCh = getChar();
- return Tok_SomeOperator;
- } else if (yyCh == '=') {
- yyCh = getChar();
- return Tok_SomeOperator;
- } else {
- return Tok_RightAngle;
- }
- case '?':
- yyCh = getChar();
- return Tok_SomeOperator;
- case '[':
- yyCh = getChar();
- if (yyNumPreprocessorSkipping == 0)
- yyBracketDepth++;
- return Tok_LeftBracket;
- case '\\':
- yyCh = getChar();
- yyCh = getChar(); // skip one character
- break;
- case ']':
- yyCh = getChar();
- if (yyNumPreprocessorSkipping == 0)
- yyBracketDepth--;
- return Tok_RightBracket;
- case '{':
- yyCh = getChar();
- if (yyNumPreprocessorSkipping == 0)
- yyBraceDepth++;
- return Tok_LeftBrace;
- case '}':
- yyCh = getChar();
- if (yyNumPreprocessorSkipping == 0)
- yyBraceDepth--;
- return Tok_RightBrace;
- case '|':
- yyCh = getChar();
- if (yyCh == '|' || yyCh == '=')
- yyCh = getChar();
- return Tok_SomeOperator;
- case '~':
- yyCh = getChar();
- return Tok_Tilde;
- case '@':
- yyCh = getChar();
- return Tok_At;
- default:
- // ### We should really prevent qdoc from looking at snippet files rather than
- // ### suppress warnings when reading them.
- if (yyNumPreprocessorSkipping == 0 && !(yyTokLoc.fileName().endsWith(".qdoc") ||
- yyTokLoc.fileName().endsWith(".js"))) {
- yyTokLoc.warning(tr("Hostile character 0x%1 in C++ source")
- .arg((uchar)yyCh, 1, 16));
- }
- yyCh = getChar();
- }
- }
- }
-
- if (yyPreprocessorSkipping.count() > 1) {
- yyTokLoc.warning(tr("Expected #endif before end of file"));
- // clear it out or we get an infinite loop!
- while (!yyPreprocessorSkipping.isEmpty()) {
- popSkipping();
- }
- }
-
- strcpy(yyLex, "end-of-input");
- yyLexLen = strlen(yyLex);
- return Tok_Eoi;
-}
-
-void Tokenizer::initialize(const Config &config)
-{
- QString versionSym = config.getString(CONFIG_VERSIONSYM);
-
- QString sourceEncoding = config.getString(CONFIG_SOURCEENCODING);
- if (sourceEncoding.isEmpty())
- sourceEncoding = QLatin1String("ISO-8859-1");
-#ifndef QT_NO_TEXTCODEC
- sourceCodec = QTextCodec::codecForName(sourceEncoding.toLocal8Bit());
-#endif
-
- comment = new QRegExp("/(?:\\*.*\\*/|/.*\n|/[^\n]*$)");
- comment->setMinimal(true);
- versionX = new QRegExp("$cannot possibly match^");
- if (!versionSym.isEmpty())
- versionX->setPattern("[ \t]*(?:" + QRegExp::escape(versionSym)
- + ")[ \t]+\"([^\"]*)\"[ \t]*");
- definedX = new QRegExp("defined ?\\(?([A-Z_0-9a-z]+) ?\\)");
-
- QStringList d = config.getStringList(CONFIG_DEFINES);
- d += "qdoc";
- defines = new QRegExp(d.join('|'));
- falsehoods = new QRegExp(config.getStringList(CONFIG_FALSEHOODS).join('|'));
-
- /*
- The keyword hash table is always cleared before any words are inserted.
- */
- memset(kwordHashTable, 0, sizeof(kwordHashTable));
- for (int i = 0; i < Tok_LastKeyword - Tok_FirstKeyword + 1; i++)
- insertKwordIntoHash(kwords[i], i + 1);
-
- ignoredTokensAndDirectives = new QHash<QByteArray, bool>;
-
- QStringList tokens = config.getStringList(LANGUAGE_CPP + Config::dot + CONFIG_IGNORETOKENS);
- foreach (const QString &t, tokens) {
- const QByteArray tb = t.toLatin1();
- ignoredTokensAndDirectives->insert(tb, false);
- insertKwordIntoHash(tb.data(), -1);
- }
-
- QStringList directives = config.getStringList(LANGUAGE_CPP + Config::dot
- + CONFIG_IGNOREDIRECTIVES);
- foreach (const QString &d, directives) {
- const QByteArray db = d.toLatin1();
- ignoredTokensAndDirectives->insert(db, true);
- insertKwordIntoHash(db.data(), -1);
- }
-}
-
-/*!
- The heap allocated variables are freed here. The keyword
- hash table is not cleared here, but it is cleared in the
- initialize() function, before any keywords are inserted.
- */
-void Tokenizer::terminate()
-{
- delete comment;
- comment = 0;
- delete versionX;
- versionX = 0;
- delete definedX;
- definedX = 0;
- delete defines;
- defines = 0;
- delete falsehoods;
- falsehoods = 0;
- delete ignoredTokensAndDirectives;
- ignoredTokensAndDirectives = 0;
-}
-
-void Tokenizer::init()
-{
- yyLexBuf1 = new char[(int) yyLexBufSize];
- yyLexBuf2 = new char[(int) yyLexBufSize];
- yyPrevLex = yyLexBuf1;
- yyPrevLex[0] = '\0';
- yyLex = yyLexBuf2;
- yyLex[0] = '\0';
- yyLexLen = 0;
- yyPreprocessorSkipping.push(false);
- yyNumPreprocessorSkipping = 0;
- yyBraceDepth = 0;
- yyParenDepth = 0;
- yyBracketDepth = 0;
- yyCh = '\0';
- parsingMacro = false;
-}
-
-void Tokenizer::start(const Location& loc)
-{
- yyTokLoc = loc;
- yyCurLoc = loc;
- yyCurLoc.start();
- strcpy(yyPrevLex, "beginning-of-input");
- strcpy(yyLex, "beginning-of-input");
- yyLexLen = strlen(yyLex);
- yyBraceDepth = 0;
- yyParenDepth = 0;
- yyBracketDepth = 0;
- yyCh = '\0';
- yyCh = getChar();
-}
-
-/*
- Returns the next token, if # was met. This function interprets the
- preprocessor directive, skips over any #ifdef'd out tokens, and returns the
- token after all of that.
-*/
-int Tokenizer::getTokenAfterPreprocessor()
-{
- yyCh = getChar();
- while (isspace(yyCh) && yyCh != '\n')
- yyCh = getChar();
-
- /*
- #directive condition
- */
- QString directive;
- QString condition;
-
- while (isalpha(yyCh)) {
- directive += QChar(yyCh);
- yyCh = getChar();
- }
- if (!directive.isEmpty()) {
- while (yyCh != EOF && yyCh != '\n') {
- if (yyCh == '\\') {
- yyCh = getChar();
- if (yyCh == '\r')
- yyCh = getChar();
- }
- condition += yyCh;
- yyCh = getChar();
- }
- condition.remove(*comment);
- condition = condition.simplified();
-
- /*
- The #if, #ifdef, #ifndef, #elif, #else, and #endif
- directives have an effect on the skipping stack. For
- instance, if the code processed so far is
-
- #if 1
- #if 0
- #if 1
- // ...
- #else
-
- the skipping stack contains, from bottom to top, false true
- true (assuming 0 is false and 1 is true). If at least one
- entry of the stack is true, the tokens are skipped.
-
- This mechanism is simple yet hard to understand.
- */
- if (directive[0] == QChar('i')) {
- if (directive == QString("if"))
- pushSkipping(!isTrue(condition));
- else if (directive == QString("ifdef"))
- pushSkipping(!defines->exactMatch(condition));
- else if (directive == QString("ifndef"))
- pushSkipping(defines->exactMatch(condition));
- } else if (directive[0] == QChar('e')) {
- if (directive == QString("elif")) {
- bool old = popSkipping();
- if (old)
- pushSkipping(!isTrue(condition));
- else
- pushSkipping(true);
- } else if (directive == QString("else")) {
- pushSkipping(!popSkipping());
- } else if (directive == QString("endif")) {
- popSkipping();
- }
- } else if (directive == QString("define")) {
- if (versionX->exactMatch(condition))
- yyVersion = versionX->cap(1);
- }
- }
-
- int tok;
- do {
- /*
- We set yyLex now, and after getToken() this will be
- yyPrevLex. This way, we skip over the preprocessor
- directive.
- */
- qstrcpy(yyLex, yyPrevLex);
-
- /*
- If getToken() meets another #, it will call
- getTokenAfterPreprocessor() once again, which could in turn
- call getToken() again, etc. Unless there are 10,000 or so
- preprocessor directives in a row, this shouldn't overflow
- the stack.
- */
- tok = getToken();
- } while (yyNumPreprocessorSkipping > 0 && tok != Tok_Eoi);
- return tok;
-}
-
-/*
- Pushes a new skipping value onto the stack. This corresponds to entering a
- new #if block.
-*/
-void Tokenizer::pushSkipping(bool skip)
-{
- yyPreprocessorSkipping.push(skip);
- if (skip)
- yyNumPreprocessorSkipping++;
-}
-
-/*
- Pops a skipping value from the stack. This corresponds to reaching a #endif.
-*/
-bool Tokenizer::popSkipping()
-{
- if (yyPreprocessorSkipping.isEmpty()) {
- yyTokLoc.warning(tr("Unexpected #elif, #else or #endif"));
- return true;
- }
-
- bool skip = yyPreprocessorSkipping.pop();
- if (skip)
- yyNumPreprocessorSkipping--;
- return skip;
-}
-
-/*
- Returns \c true if the condition evaluates as true, otherwise false. The
- condition is represented by a string. Unsophisticated parsing techniques are
- used. The preprocessing method could be named StriNg-Oriented PreProcessing,
- as SNOBOL stands for StriNg-Oriented symBOlic Language.
-*/
-bool Tokenizer::isTrue(const QString &condition)
-{
- int firstOr = -1;
- int firstAnd = -1;
- int parenDepth = 0;
-
- /*
- Find the first logical operator at top level, but be careful
- about precedence. Examples:
-
- X || Y // the or
- X || Y || Z // the leftmost or
- X || Y && Z // the or
- X && Y || Z // the or
- (X || Y) && Z // the and
- */
- for (int i = 0; i < (int) condition.length() - 1; i++) {
- QChar ch = condition[i];
- if (ch == QChar('(')) {
- parenDepth++;
- } else if (ch == QChar(')')) {
- parenDepth--;
- } else if (parenDepth == 0) {
- if (condition[i + 1] == ch) {
- if (ch == QChar('|')) {
- firstOr = i;
- break;
- } else if (ch == QChar('&')) {
- if (firstAnd == -1)
- firstAnd = i;
- }
- }
- }
- }
- if (firstOr != -1)
- return isTrue(condition.left(firstOr)) ||
- isTrue(condition.mid(firstOr + 2));
- if (firstAnd != -1)
- return isTrue(condition.left(firstAnd)) &&
- isTrue(condition.mid(firstAnd + 2));
-
- QString t = condition.simplified();
- if (t.isEmpty())
- return true;
-
- if (t[0] == QChar('!'))
- return !isTrue(t.mid(1));
- if (t[0] == QChar('(') && t.endsWith(QChar(')')))
- return isTrue(t.mid(1, t.length() - 2));
-
- if (definedX->exactMatch(t))
- return defines->exactMatch(definedX->cap(1));
- else
- return !falsehoods->exactMatch(t);
-}
-
-QString Tokenizer::lexeme() const
-{
-#ifndef QT_NO_TEXTCODEC
- return sourceCodec->toUnicode(yyLex);
-#else
- return QString::fromUtf8(yyLex);
-#endif
-}
-
-QString Tokenizer::previousLexeme() const
-{
-#ifndef QT_NO_TEXTCODEC
- return sourceCodec->toUnicode(yyPrevLex);
-#else
- return QString::fromUtf8(yyPrevLex);
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/tokenizer.h b/src/tools/qdoc/tokenizer.h
deleted file mode 100644
index 2b79320567..0000000000
--- a/src/tools/qdoc/tokenizer.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- tokenizer.h
-*/
-
-#ifndef TOKENIZER_H
-#define TOKENIZER_H
-
-#include <qfile.h>
-#include <qstack.h>
-#include <qstring.h>
-
-#include "location.h"
-
-QT_BEGIN_NAMESPACE
-
-/*
- Here come the C++ tokens we support. The first part contains
- all-purpose tokens; then come keywords.
-
- If you add a keyword, make sure to modify the keyword array in
- tokenizer.cpp as well, and possibly adjust Tok_FirstKeyword and
- Tok_LastKeyword.
-*/
-enum { Tok_Eoi, Tok_Ampersand, Tok_Aster, Tok_Caret, Tok_LeftParen,
- Tok_RightParen, Tok_LeftParenAster, Tok_Equal, Tok_LeftBrace,
- Tok_RightBrace, Tok_Semicolon, Tok_Colon, Tok_LeftAngle,
- Tok_RightAngle, Tok_Comma, Tok_Ellipsis, Tok_Gulbrandsen,
- Tok_LeftBracket, Tok_RightBracket, Tok_Tilde, Tok_SomeOperator,
- Tok_Number, Tok_String, Tok_Doc, Tok_Comment, Tok_Ident, Tok_At,
- Tok_char, Tok_class, Tok_const, Tok_double, Tok_enum,
- Tok_explicit, Tok_friend, Tok_inline, Tok_int, Tok_long,
- Tok_namespace, Tok_operator, Tok_private, Tok_protected,
- Tok_public, Tok_short, Tok_signals, Tok_signed, Tok_slots,
- Tok_static, Tok_struct, Tok_template, Tok_typedef,
- Tok_typename, Tok_union, Tok_unsigned, Tok_using, Tok_virtual,
- Tok_void, Tok_volatile, Tok_int64, Tok_Q_OBJECT, Tok_Q_OVERRIDE,
- Tok_Q_PROPERTY, Tok_Q_PRIVATE_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
- Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR,
- Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR,
- Tok_Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR,
- Tok_Q_DECLARE_FLAGS, Tok_Q_SIGNALS, Tok_Q_SLOTS, Tok_QT_COMPAT,
- Tok_QT_COMPAT_CONSTRUCTOR, Tok_QT_DEPRECATED, Tok_QT_MOC_COMPAT,
- Tok_QT_MODULE, Tok_QT3_SUPPORT, Tok_QT3_SUPPORT_CONSTRUCTOR,
- Tok_QT3_MOC_SUPPORT, Tok_QDOC_PROPERTY, Tok_QPrivateSignal,
- Tok_FirstKeyword = Tok_char, Tok_LastKeyword = Tok_QPrivateSignal };
-
-/*
- The Tokenizer class implements lexical analysis of C++ source
- files.
-
- Not every operator or keyword of C++ is recognized; only those
- that are interesting to us. Some Qt keywords or macros are also
- recognized.
-*/
-
-class Tokenizer
-{
- Q_DECLARE_TR_FUNCTIONS(QDoc::Tokenizer)
-
-public:
- Tokenizer(const Location& loc, const QByteArray &in);
- Tokenizer(const Location& loc, QFile &file);
-
- ~Tokenizer();
-
- int getToken();
- void setParsingFnOrMacro(bool macro) { parsingMacro = macro; }
- bool parsingFnOrMacro() const { return parsingMacro; }
-
- const Location &location() const { return yyTokLoc; }
- QString previousLexeme() const;
- QString lexeme() const;
- QString version() const { return yyVersion; }
- int braceDepth() const { return yyBraceDepth; }
- int parenDepth() const { return yyParenDepth; }
- int bracketDepth() const { return yyBracketDepth; }
-
- static void initialize(const Config &config);
- static void terminate();
- static bool isTrue(const QString &condition);
-
-private:
- void init();
- void start(const Location& loc);
- /*
- This limit on the length of a lexeme seems fairly high, but a
- doc comment can be arbitrarily long. The previous 65,536 limit
- was reached by Mark Summerfield.
- */
- enum { yyLexBufSize = 524288 };
-
- int getch()
- {
- return yyPos == yyIn.size() ? EOF : yyIn[yyPos++];
- }
-
- inline int getChar()
- {
- if (yyCh == EOF)
- return EOF;
- if (yyLexLen < yyLexBufSize - 1) {
- yyLex[yyLexLen++] = (char) yyCh;
- yyLex[yyLexLen] = '\0';
- }
- yyCurLoc.advance(yyCh);
- int ch = getch();
- if (ch == EOF)
- return EOF;
- // cast explicitly to make sure the value of ch
- // is in range [0..255] to avoid assert messages
- // when using debug CRT that checks its input.
- return int(uint(uchar(ch)));
- }
-
- int getTokenAfterPreprocessor();
- void pushSkipping(bool skip);
- bool popSkipping();
-
- Location yyTokLoc;
- Location yyCurLoc;
- char *yyLexBuf1;
- char *yyLexBuf2;
- char *yyPrevLex;
- char *yyLex;
- size_t yyLexLen;
- QStack<bool> yyPreprocessorSkipping;
- int yyNumPreprocessorSkipping;
- int yyBraceDepth;
- int yyParenDepth;
- int yyBracketDepth;
- int yyCh;
-
- QString yyVersion;
- bool parsingMacro;
-
-protected:
- QByteArray yyIn;
- int yyPos;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
deleted file mode 100644
index 1b0aba1a0c..0000000000
--- a/src/tools/qdoc/tree.cpp
+++ /dev/null
@@ -1,1524 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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 "doc.h"
-#include "htmlgenerator.h"
-#include "location.h"
-#include "node.h"
-#include "text.h"
-#include "tree.h"
-#include "qdocdatabase.h"
-#include <limits.h>
-#include <qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class Tree
-
- This class constructs and maintains a tree of instances of
- the subclasses of Node.
-
- This class is now private. Only class QDocDatabase has access.
- Please don't change this. If you must access class Tree, do it
- though the pointer to the singleton QDocDatabase.
-
- Tree is being converted to a forest. A static member provides a
- map of Tree* values with the module names as the keys. There is
- one Tree in the map for each index file read, and there is one
- tree that is not in the map for the module whose documentation
- is being generated.
- */
-
-/*!
- Constructs a Tree. \a qdb is the pointer to the singleton
- qdoc database that is constructing the tree. This might not
- be necessary, and it might be removed later.
-
- \a camelCaseModuleName is the project name for this tree,
- which was obtained from the qdocconf file via the Config
- singleton.
- */
-Tree::Tree(const QString& camelCaseModuleName, QDocDatabase* qdb)
- : treeHasBeenAnalyzed_(false),
- docsHaveBeenGenerated_(false),
- linkCount_(0),
- camelCaseModuleName_(camelCaseModuleName),
- physicalModuleName_(camelCaseModuleName.toLower()),
- qdb_(qdb),
- root_(0, QString()),
- targetListMap_(0)
-{
- root_.setPhysicalModuleName(physicalModuleName_);
- root_.setTree(this);
- if (Generator::writeQaPages()) {
- targetListMap_ = new TargetListMap;
- }
-}
-
-/*!
- Destroys the Tree. The root node is a data member
- of this object, so its destructor is called. The
- destructor of each child node is called, and these
- destructors are recursive. Thus the entire tree is
- destroyed.
-
- There are two maps of targets, keywords, and contents.
- One map is indexed by ref, the other by title. The ref
- is just the canonical form of the title. Both maps
- use the same set of TargetRec objects as the values,
- so the destructor only deletes the values from one of
- the maps. Then it clears both maps.
- */
-Tree::~Tree()
-{
- TargetMap::iterator i = nodesByTargetRef_.begin();
- while (i != nodesByTargetRef_.end()) {
- delete i.value();
- ++i;
- }
- nodesByTargetRef_.clear();
- nodesByTargetTitle_.clear();
- if (Generator::writeQaPages() && targetListMap_) {
- TargetListMap::iterator i = targetListMap_->begin();
- while (i != targetListMap_->end()) {
- TargetList* tlist = i.value();
- if (tlist) {
- foreach (TargetLoc* tloc, *tlist)
- delete tloc;
- }
- delete tlist;
- ++i;
- }
- }
-}
-
-/* API members */
-
-/*!
- Calls findClassNode() first with \a path and \a start. If
- it finds a node, the node is returned. If not, it calls
- findNamespaceNode() with the same parameters. The result
- is returned.
- */
-Node* Tree::findNodeForInclude(const QStringList& path) const
-{
- Node* n = findClassNode(path);
- if (!n)
- n = findNamespaceNode(path);
- return n;
-}
-
-/*!
- Find the C++ class node named \a path. Begin the search at the
- \a start node. If the \a start node is 0, begin the search
- at the root of the tree. Only a C++ class node named \a path is
- acceptible. If one is not found, 0 is returned.
- */
-ClassNode* Tree::findClassNode(const QStringList& path, const Node* start) const
-{
- if (!start)
- start = const_cast<NamespaceNode*>(root());
- return static_cast<ClassNode*>(findNodeRecursive(path, 0, start, Node::Class));
-}
-
-/*!
- Find the Namespace node named \a path. Begin the search at
- the root of the tree. Only a Namespace node named \a path
- is acceptible. If one is not found, 0 is returned.
- */
-NamespaceNode* Tree::findNamespaceNode(const QStringList& path) const
-{
- Node* start = const_cast<NamespaceNode*>(root());
- return static_cast<NamespaceNode*>(findNodeRecursive(path, 0, start, Node::Namespace));
-}
-
-/*!
- This function first ignores the \a clone node and searches
- for the parent node with \a parentPath. If that search is
- successful, it searches for a child node of the parent that
- matches the \a clone node. If it finds a node that is just
- like the \a clone, it returns a pointer to the found node.
-
- Apparently the search order is important here. Don't change
- it unless you know what you are doing, or you will introduce
- qdoc warnings.
- */
-FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const FunctionNode* clone)
-{
- const Node* parent = findNamespaceNode(parentPath);
- if (parent == 0)
- parent = findClassNode(parentPath, 0);
- if (parent == 0)
- parent = findNode(parentPath, 0, 0, Node::DontCare);
- if (parent == 0 || !parent->isInnerNode())
- return 0;
- return ((const InnerNode*)parent)->findFunctionNode(clone);
-}
-
-
-/*!
- Find the Qml type node named \a path. Begin the search at the
- \a start node. If the \a start node is 0, begin the search
- at the root of the tree. Only a Qml type node named <\a path is
- acceptible. If one is not found, 0 is returned.
- */
-QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path)
-{
- /*
- If the path contains one or two double colons ("::"),
- check first to see if the first two path strings refer
- to a QML element. If they do, path[0] will be the QML
- module identifier, and path[1] will be the QML type.
- If the anser is yes, the reference identifies a QML
- class node.
- */
- if (path.size() >= 2 && !path[0].isEmpty()) {
- QmlTypeNode* qcn = qdb_->findQmlType(path[0], path[1]);
- if (qcn)
- return qcn;
- }
- return static_cast<QmlTypeNode*>(findNodeRecursive(path, 0, root(), Node::QmlType));
-}
-
-/*!
- This function begins searching the tree at \a relative for
- the \l {FunctionNode} {function node} identified by \a path.
- The \a findFlags are used to restrict the search. If a node
- that matches the \a path is found, it is returned. Otherwise,
- 0 is returned. If \a relative is 0, the root of the tree is
- used as the starting point.
- */
-const FunctionNode* Tree::findFunctionNode(const QStringList& path,
- const Node* relative,
- int findFlags,
- Node::Genus genus) const
-{
- if (path.size() == 3 && !path[0].isEmpty() &&
- ((genus == Node::QML) || (genus == Node::DontCare))) {
- QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
- if (!qcn) {
- QStringList p(path[1]);
- Node* n = findNodeByNameAndType(p, Node::QmlType);
- if (n && (n->isQmlType() || n->isJsType()))
- qcn = static_cast<QmlTypeNode*>(n);
- }
- if (qcn)
- return static_cast<const FunctionNode*>(qcn->findFunctionNode(path[2]));
- }
-
- if (!relative)
- relative = root();
- else if (genus != Node::DontCare) {
- if (genus != relative->genus())
- relative = root();
- }
-
- do {
- const Node* node = relative;
- int i;
-
- for (i = 0; i < path.size(); ++i) {
- if (node == 0 || !node->isInnerNode())
- break;
-
- const Node* next;
- if (i == path.size() - 1)
- next = ((const InnerNode*) node)->findFunctionNode(path.at(i));
- else
- next = ((const InnerNode*) node)->findChildNode(path.at(i), genus);
-
- if (!next && node->isClass() && (findFlags & SearchBaseClasses)) {
- NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
- foreach (const Node* baseClass, baseClasses) {
- if (i == path.size() - 1)
- next = static_cast<const InnerNode*>(baseClass)->findFunctionNode(path.at(i));
- else
- next = static_cast<const InnerNode*>(baseClass)->findChildNode(path.at(i), genus);
-
- if (next)
- break;
- }
- }
-
- node = next;
- }
- if (node && i == path.size() && node->isFunction()) {
- // CppCodeParser::processOtherMetaCommand ensures that reimplemented
- // functions are private.
- const FunctionNode* func = static_cast<const FunctionNode*>(node);
- while (func->access() == Node::Private) {
- const FunctionNode* from = func->reimplementedFrom();
- if (from != 0) {
- if (from->access() != Node::Private)
- return from;
- else
- func = from;
- }
- else
- break;
- }
- return func;
- }
- relative = relative->parent();
- } while (relative);
-
- return 0;
-}
-
-static NodeTypeList t;
-static const NodeTypeList& relatesTypes()
-{
- if (t.isEmpty()) {
- t.reserve(3);
- t.append(NodeTypePair(Node::Class, Node::NoSubType));
- t.append(NodeTypePair(Node::Namespace, Node::NoSubType));
- t.append(NodeTypePair(Node::Document, Node::HeaderFile));
- }
- return t;
-}
-
-/*!
- This function searches for the node specified by \a path.
- The matching node can be one of several different types
- including a C++ class, a C++ namespace, or a C++ header
- file.
-
- I'm not sure if it can be a QML type, but if that is a
- possibility, the code can easily accommodate it.
-
- If a matching node is found, a pointer to it is returned.
- Otherwise 0 is returned.
- */
-InnerNode* Tree::findRelatesNode(const QStringList& path)
-{
- Node* n = findNodeRecursive(path, 0, root(), relatesTypes());
- return ((n && n->isInnerNode()) ? static_cast<InnerNode*>(n) : 0);
-}
-
-/*!
- */
-void Tree::addPropertyFunction(PropertyNode* property,
- const QString& funcName,
- PropertyNode::FunctionRole funcRole)
-{
- unresolvedPropertyMap[property].insert(funcRole, funcName);
-}
-
-/*!
- This function resolves C++ inheritance and reimplementation
- settings for each C++ class node found in the tree beginning
- at \a n. It also calls itself recursively for each C++ class
- node or namespace node it encounters. For each child of \a n
- that is a class node, it calls resolveInheritanceHelper().
-
- This function does not resolve QML inheritance.
- */
-void Tree::resolveInheritance(InnerNode* n)
-{
- if (!n)
- n = root();
-
- for (int pass = 0; pass < 2; pass++) {
- NodeList::ConstIterator c = n->childNodes().constBegin();
- while (c != n->childNodes().constEnd()) {
- if ((*c)->type() == Node::Class) {
- resolveInheritanceHelper(pass, (ClassNode*)*c);
- resolveInheritance((ClassNode*)*c);
- }
- else if ((*c)->type() == Node::Namespace) {
- NamespaceNode* ns = static_cast<NamespaceNode*>(*c);
- resolveInheritance(ns);
- }
- ++c;
- }
- }
-}
-
-/*!
- This function is run twice for eachclass node \a cn in the
- tree. First it is run with \a pass set to 0 for each
- class node \a cn. Then it is run with \a pass set to 1 for
- eachclass node \a cn.
-
- In \a pass 0, all the base classes ofclass node \a cn are
- found and added to the base class list forclass node \a cn.
-
- In \a pass 1, each child ofclass node \a cn that is a function
- that is reimplemented from one of the base classes is marked
- as being reimplemented from that class.
-
- Some property node fixing up is also done in \a pass 1.
- */
-void Tree::resolveInheritanceHelper(int pass, ClassNode* cn)
-{
- if (pass == 0) {
- QList<RelatedClass>& bases = cn->baseClasses();
- QList<RelatedClass>::iterator b = bases.begin();
- while (b != bases.end()) {
- if (!(*b).node_) {
- Node* n = qdb_->findClassNode((*b).path_);
- /*
- If the node for the base class was not found,
- the reason might be that the subclass is in a
- namespace and the base class is in the same
- namespace, but the base class name was not
- qualified with the namespace name. That is the
- case most of the time. Then restart the search
- at the parent of the subclass node (the namespace
- node) using the unqualified base class name.
- */
- if (!n) {
- InnerNode* parent = cn->parent();
- if (parent)
- // Exclude the root namespace
- if (parent->isNamespace() && !parent->name().isEmpty())
- n = findClassNode((*b).path_, parent);
- }
- if (n) {
- ClassNode* bcn = static_cast<ClassNode*>(n);
- (*b).node_ = bcn;
- bcn->addDerivedClass((*b).access_, cn);
- }
- }
- ++b;
- }
- }
- else {
- NodeList::ConstIterator c = cn->childNodes().constBegin();
- while (c != cn->childNodes().constEnd()) {
- if ((*c)->type() == Node::Function) {
- FunctionNode* func = (FunctionNode*)* c;
- FunctionNode* from = findVirtualFunctionInBaseClasses(cn, func);
- if (from != 0) {
- if (func->virtualness() == FunctionNode::NonVirtual)
- func->setVirtualness(FunctionNode::ImpureVirtual);
- func->setReimplementedFrom(from);
- }
- }
- else if ((*c)->type() == Node::Property)
- cn->fixPropertyUsingBaseClasses(static_cast<PropertyNode*>(*c));
- ++c;
- }
- }
-}
-
-/*!
- */
-void Tree::resolveProperties()
-{
- PropertyMap::ConstIterator propEntry;
-
- propEntry = unresolvedPropertyMap.constBegin();
- while (propEntry != unresolvedPropertyMap.constEnd()) {
- PropertyNode* property = propEntry.key();
- InnerNode* parent = property->parent();
- QString getterName = (*propEntry)[PropertyNode::Getter];
- QString setterName = (*propEntry)[PropertyNode::Setter];
- QString resetterName = (*propEntry)[PropertyNode::Resetter];
- QString notifierName = (*propEntry)[PropertyNode::Notifier];
-
- NodeList::ConstIterator c = parent->childNodes().constBegin();
- while (c != parent->childNodes().constEnd()) {
- if ((*c)->type() == Node::Function) {
- FunctionNode* function = static_cast<FunctionNode*>(*c);
- if (function->access() == property->access() &&
- (function->status() == property->status() ||
- function->doc().isEmpty())) {
- if (function->name() == getterName) {
- property->addFunction(function, PropertyNode::Getter);
- }
- else if (function->name() == setterName) {
- property->addFunction(function, PropertyNode::Setter);
- }
- else if (function->name() == resetterName) {
- property->addFunction(function, PropertyNode::Resetter);
- }
- else if (function->name() == notifierName) {
- property->addSignal(function, PropertyNode::Notifier);
- }
- }
- }
- ++c;
- }
- ++propEntry;
- }
-
- propEntry = unresolvedPropertyMap.constBegin();
- while (propEntry != unresolvedPropertyMap.constEnd()) {
- PropertyNode* property = propEntry.key();
- // redo it to set the property functions
- if (property->overriddenFrom())
- property->setOverriddenFrom(property->overriddenFrom());
- ++propEntry;
- }
-
- unresolvedPropertyMap.clear();
-}
-
-/*!
- For each QML class node that points to a C++ class node,
- follow its C++ class node pointer and set the C++ class
- node's QML class node pointer back to the QML class node.
- */
-void Tree::resolveCppToQmlLinks()
-{
-
- foreach (Node* child, root_.childNodes()) {
- if (child->isQmlType() || child->isJsType()) {
- QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
- ClassNode* cn = const_cast<ClassNode*>(qcn->classNode());
- if (cn)
- cn->setQmlElement(qcn);
- }
- }
-}
-
-/*!
- For each C++ class node, resolve any \c using clauses
- that appeared in the class declaration.
- */
-void Tree::resolveUsingClauses()
-{
- foreach (Node* child, root_.childNodes()) {
- if (child->isClass()) {
- ClassNode* cn = static_cast<ClassNode*>(child);
- QList<UsingClause>& usingClauses = cn->usingClauses();
- QList<UsingClause>::iterator uc = usingClauses.begin();
- while (uc != usingClauses.end()) {
- if (!(*uc).node()) {
- const Node* n = qdb_->findFunctionNode((*uc).signature(), cn, Node::CPP);
- if (n)
- (*uc).setNode(n);
- }
- ++uc;
- }
- }
- }
-}
-
-/*!
- */
-void Tree::fixInheritance(NamespaceNode* rootNode)
-{
- if (!rootNode)
- rootNode = root();
-
- NodeList::ConstIterator c = rootNode->childNodes().constBegin();
- while (c != rootNode->childNodes().constEnd()) {
- if ((*c)->type() == Node::Class)
- static_cast<ClassNode*>(*c)->fixBaseClasses();
- else if ((*c)->type() == Node::Namespace) {
- NamespaceNode* ns = static_cast<NamespaceNode*>(*c);
- fixInheritance(ns);
- }
- ++c;
- }
-}
-
-/*!
- */
-FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* cn, FunctionNode* clone)
-{
- const QList<RelatedClass>& rc = cn->baseClasses();
- QList<RelatedClass>::ConstIterator r = rc.constBegin();
- while (r != rc.constEnd()) {
- FunctionNode* func;
- if ((*r).node_) {
- if (((func = findVirtualFunctionInBaseClasses((*r).node_, clone)) != 0 ||
- (func = (*r).node_->findFunctionNode(clone)) != 0)) {
- if (func->virtualness() != FunctionNode::NonVirtual)
- return func;
- }
- }
- ++r;
- }
- return 0;
-}
-
-/*!
- */
-NodeList Tree::allBaseClasses(const ClassNode* classNode) const
-{
- NodeList result;
- foreach (const RelatedClass& r, classNode->baseClasses()) {
- if (r.node_) {
- result += r.node_;
- result += allBaseClasses(r.node_);
- }
- }
- return result;
-}
-
-/*!
- Find the node with the specified \a path name that is of
- the specified \a type and \a subtype. Begin the search at
- the \a start node. If the \a start node is 0, begin the
- search at the tree root. \a subtype is not used unless
- \a type is \c{Document}.
- */
-Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) const
-{
- return findNodeRecursive(path, 0, root(), type);
-}
-
-/*!
- Recursive search for a node identified by \a path. Each
- path element is a name. \a pathIndex specifies the index
- of the name in \a path to try to match. \a start is the
- node whose children shoulod be searched for one that has
- that name. Each time a match is found, increment the
- \a pathIndex and call this function recursively.
-
- If the end of the path is reached (i.e. if a matching
- node is found for each name in the \a path), the \a type
- must match the type of the last matching node, and if the
- type is \e{Document}, the \a subtype must match as well.
-
- If the algorithm is successful, the pointer to the final
- node is returned. Otherwise 0 is returned.
- */
-Node* Tree::findNodeRecursive(const QStringList& path,
- int pathIndex,
- const Node* start,
- Node::Type type) const
-{
- if (!start || path.isEmpty())
- return 0; // no place to start, or nothing to search for.
- Node* node = const_cast<Node*>(start);
- if (start->isLeaf()) {
- if (pathIndex >= path.size())
- return node; // found a match.
- return 0; // premature leaf
- }
-
- InnerNode* current = static_cast<InnerNode*>(node);
- const NodeList& children = current->childNodes();
- const QString& name = path.at(pathIndex);
- for (int i=0; i<children.size(); ++i) {
- Node* n = children.at(i);
- if (!n)
- continue;
- if (n->isQmlPropertyGroup()) {
- if (type == Node::QmlProperty) {
- n = findNodeRecursive(path, pathIndex, n, type);
- if (n)
- return n;
- }
- }
- else if (n->name() == name) {
- if (pathIndex+1 >= path.size()) {
- if ((n->type() == type) || (type == Node::NoType))
- return n;
- continue;
- }
- else { // Search the children of n for the next name in the path.
- n = findNodeRecursive(path, pathIndex+1, n, type);
- if (n)
- return n;
- }
- }
- }
- return 0;
-}
-
-/*!
- Recursive search for a node identified by \a path. Each
- path element is a name. \a pathIndex specifies the index
- of the name in \a path to try to match. \a start is the
- node whose children shoulod be searched for one that has
- that name. Each time a name match is found, increment the
- \a pathIndex and call this function recursively.
-
- If the end of the path is reached (i.e. if a matching
- node is found for each name in the \a path), test the
- matching node's type and subtype values against the ones
- listed in \a types. If a match is found there, return the
- pointer to the final node. Otherwise return 0.
- */
-Node* Tree::findNodeRecursive(const QStringList& path,
- int pathIndex,
- Node* start,
- const NodeTypeList& types) const
-{
- if (!start || path.isEmpty())
- return 0;
- if (start->isLeaf())
- return ((pathIndex >= path.size()) ? start : 0);
- if (pathIndex >= path.size())
- return 0;
-
- InnerNode* current = static_cast<InnerNode*>(start);
- const NodeList& children = current->childNodes();
- for (int i=0; i<children.size(); ++i) {
- Node* n = children.at(i);
- if (n && n->name() == path.at(pathIndex)) {
- if (pathIndex+1 >= path.size()) {
- if (n->match(types))
- return n;
- }
- else if (!n->isLeaf()) {
- n = findNodeRecursive(path, pathIndex+1, n, types);
- if (n)
- return n;
- }
- }
- }
- return 0;
-}
-
-/*!
- Searches the tree for a node that matches the \a path plus
- the \a target. The search begins at \a start and moves up
- the parent chain from there, or, if \a start is 0, the search
- begins at the root.
-
- The \a flags can indicate whether to search base classes and/or
- the enum values in enum types. \a genus can be a further restriction
- on what kind of node is an acceptible match, i.e. CPP or QML.
-
- If a matching node is found, \a ref is an output parameter that
- is set to the HTML reference to use for the link.
- */
-const Node* Tree::findNodeForTarget(const QStringList& path,
- const QString& target,
- const Node* start,
- int flags,
- Node::Genus genus,
- QString& ref) const
-{
- const Node* node = 0;
- QString p;
- if (path.size() > 1)
- p = path.join(QString("::"));
- else if ((genus == Node::DontCare) || (genus == Node::DOC)) {
- p = path.at(0);
- node = findDocumentNodeByTitle(p);
- if (node) {
- if (!target.isEmpty()) {
- ref = getRef(target, node);
- if (ref.isEmpty())
- node = 0;
- }
- if (node)
- return node;
- }
- }
- node = findUnambiguousTarget(p, ref);
- if (node) {
- if (!target.isEmpty()) {
- ref = getRef(target, node);
- if (ref.isEmpty())
- node = 0;
- }
- if (node)
- return node;
- }
-
- const Node* current = start;
- if (!current)
- current = root();
-
- /*
- If the path contains one or two double colons ("::"),
- check first to see if the first two path strings refer
- to a QML element. If they do, path[0] will be the QML
- module identifier, and path[1] will be the QML type.
- If the answer is yes, the reference identifies a QML
- type node.
- */
- int path_idx = 0;
- if (((genus == Node::QML) || (genus == Node::DontCare)) &&
- (path.size() >= 2) && !path[0].isEmpty()) {
- QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
- if (qcn) {
- current = qcn;
- if (path.size() == 2) {
- if (!target.isEmpty()) {
- ref = getRef(target, current);
- if (!ref.isEmpty())
- return current;
- return 0;
- }
- else
- return current;
- }
- path_idx = 2;
- }
- }
-
- while (current) {
- if (current->isInnerNode()) {
- const Node* node = matchPathAndTarget(path, path_idx, target, current, flags, genus, ref);
- if (node)
- return node;
- }
- current = current->parent();
- path_idx = 0;
- }
- return 0;
-}
-
-/*!
- First, the \a path is used to find a node. The \a path
- matches some part of the node's fully quallified name.
- If the \a target is not empty, it must match a target
- in the matching node. If the matching of the \a path
- and the \a target (if present) is successful, \a ref
- is set from the \a target, and the pointer to the
- matching node is returned. \a idx is the index into the
- \a path where to begin the matching. The function is
- recursive with idx being incremented for each recursive
- call.
-
- The matching node must be of the correct \a genus, i.e.
- either QML or C++, but \a genus can be set to \c DontCare.
- \a flags indicates whether to search base classes and
- whether to search for an enum value. \a node points to
- the node where the search should begin, assuming the
- \a path is a not a fully-qualified name. \a node is
- most often the root of this Tree.
- */
-const Node* Tree::matchPathAndTarget(const QStringList& path,
- int idx,
- const QString& target,
- const Node* node,
- int flags,
- Node::Genus genus,
- QString& ref) const
-{
- /*
- If the path has been matched, then if there is a target,
- try to match the target. If there is a target, but you
- can't match it at the end of the path, give up; return 0.
- */
- if (idx == path.size()) {
- if (!target.isEmpty()) {
- ref = getRef(target, node);
- if (ref.isEmpty())
- return 0;
- }
- if (node->isFunction() && node->name() == node->parent()->name())
- node = node->parent();
- return node;
- }
-
- const Node* t = 0;
- QString name = path.at(idx);
- QList<Node*> nodes;
- node->findChildren(name, nodes);
-
- foreach (const Node* n, nodes) {
- if (genus != Node::DontCare) {
- if (n->genus() != genus)
- continue;
- }
- t = matchPathAndTarget(path, idx+1, target, n, flags, genus, ref);
- if (t && !t->isPrivate())
- return t;
- }
- if (target.isEmpty()) {
- if ((idx) == (path.size()-1) && node->isInnerNode() && (flags & SearchEnumValues)) {
- t = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(idx));
- if (t)
- return t;
- }
- }
- if (((genus == Node::CPP) || (genus == Node::DontCare)) &&
- node->isClass() && (flags & SearchBaseClasses)) {
- NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
- foreach (const Node* bc, baseClasses) {
- t = matchPathAndTarget(path, idx, target, bc, flags, genus, ref);
- if (t && ! t->isPrivate())
- return t;
- if (target.isEmpty()) {
- if ((idx) == (path.size()-1) && (flags & SearchEnumValues)) {
- t = static_cast<const InnerNode*>(bc)->findEnumNodeForValue(path.at(idx));
- if (t)
- return t;
- }
- }
- }
- }
- return 0;
-}
-
-/*!
- Searches the tree for a node that matches the \a path. The
- search begins at \a start but can move up the parent chain
- recursively if no match is found.
-
- This findNode() callse the other findNode(), which is not
- called anywhere else.
- */
-const Node* Tree::findNode(const QStringList& path,
- const Node* start,
- int findFlags,
- Node::Genus genus) const
-{
- const Node* current = start;
- if (!current)
- current = root();
-
- do {
- const Node* node = current;
- int i;
- int start_idx = 0;
-
- /*
- If the path contains one or two double colons ("::"),
- check first to see if the first two path strings refer
- to a QML element. If they do, path[0] will be the QML
- module identifier, and path[1] will be the QML type.
- If the answer is yes, the reference identifies a QML
- type node.
- */
- if (((genus == Node::QML) || (genus == Node::DontCare)) &&
- (path.size() >= 2) && !path[0].isEmpty()) {
- QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
- if (qcn) {
- node = qcn;
- if (path.size() == 2)
- return node;
- start_idx = 2;
- }
- }
-
- for (i = start_idx; i < path.size(); ++i) {
- if (node == 0 || !node->isInnerNode())
- break;
-
- const Node* next = static_cast<const InnerNode*>(node)->findChildNode(path.at(i), genus);
- if (!next && (findFlags & SearchEnumValues) && i == path.size()-1) {
- next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i));
- }
- if (!next && ((genus == Node::CPP) || (genus == Node::DontCare)) &&
- node->isClass() && (findFlags & SearchBaseClasses)) {
- NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
- foreach (const Node* baseClass, baseClasses) {
- next = static_cast<const InnerNode*>(baseClass)->findChildNode(path.at(i), genus);
- if (!next && (findFlags & SearchEnumValues) && i == path.size() - 1)
- next = static_cast<const InnerNode*>(baseClass)->findEnumNodeForValue(path.at(i));
- if (next) {
- break;
- }
- }
- }
- node = next;
- }
- if (node && i == path.size())
- return node;
- current = current->parent();
- } while (current);
-
- return 0;
-}
-
-/*!
- This function searches for a node with a canonical title
- constructed from \a target. If the node it finds is \a node,
- it returns the ref from that node. Otherwise it returns an
- empty string.
- */
-QString Tree::getRef(const QString& target, const Node* node) const
-{
- TargetMap::const_iterator i = nodesByTargetTitle_.constFind(target);
- if (i != nodesByTargetTitle_.constEnd()) {
- do {
- if (i.value()->node_ == node)
- return i.value()->ref_;
- ++i;
- } while (i != nodesByTargetTitle_.constEnd() && i.key() == target);
- }
- QString key = Doc::canonicalTitle(target);
- i = nodesByTargetRef_.constFind(key);
- if (i != nodesByTargetRef_.constEnd()) {
- do {
- if (i.value()->node_ == node)
- return i.value()->ref_;
- ++i;
- } while (i != nodesByTargetRef_.constEnd() && i.key() == key);
- }
- return QString();
-}
-
-/*!
- Inserts a new target into the target table. \a name is the
- key. The target record contains the \a type, a pointer to
- the \a node, the \a priority. and a canonicalized form of
- the \a name, which is later used.
- */
-void Tree::insertTarget(const QString& name,
- const QString& title,
- TargetRec::Type type,
- Node* node,
- int priority)
-{
- TargetRec* target = new TargetRec(name, title, type, node, priority);
- nodesByTargetRef_.insert(name, target);
- nodesByTargetTitle_.insert(title, target);
-}
-
-/*!
- */
-void Tree::resolveTargets(InnerNode* root)
-{
- // need recursion
- foreach (Node* child, root->childNodes()) {
- if (child->type() == Node::Document) {
- DocumentNode* node = static_cast<DocumentNode*>(child);
- QString key = node->title();
- if (!key.isEmpty()) {
- if (key.contains(QChar(' ')))
- key = Doc::canonicalTitle(key);
- QList<DocumentNode*> nodes = docNodesByTitle_.values(key);
- bool alreadyThere = false;
- if (!nodes.empty()) {
- for (int i=0; i< nodes.size(); ++i) {
- if (nodes[i]->subType() == Node::ExternalPage) {
- if (node->name() == nodes[i]->name()) {
- alreadyThere = true;
- break;
- }
- }
- }
- }
- if (!alreadyThere)
- docNodesByTitle_.insert(key, node);
- }
- }
-
- if (child->doc().hasTableOfContents()) {
- const QList<Atom*>& toc = child->doc().tableOfContents();
- for (int i = 0; i < toc.size(); ++i) {
- QString ref = refForAtom(toc.at(i));
- QString title = Text::sectionHeading(toc.at(i)).toString();
- if (!ref.isEmpty() && !title.isEmpty()) {
- QString key = Doc::canonicalTitle(title);
- TargetRec* target = new TargetRec(ref, title, TargetRec::Contents, child, 3);
- nodesByTargetRef_.insert(key, target);
- nodesByTargetTitle_.insert(title, target);
- }
- }
- }
- if (child->doc().hasKeywords()) {
- const QList<Atom*>& keywords = child->doc().keywords();
- for (int i = 0; i < keywords.size(); ++i) {
- QString ref = refForAtom(keywords.at(i));
- QString title = keywords.at(i)->string();
- if (!ref.isEmpty() && !title.isEmpty()) {
- QString key = Doc::canonicalTitle(title);
- TargetRec* target = new TargetRec(ref, title, TargetRec::Keyword, child, 1);
- nodesByTargetRef_.insert(key, target);
- nodesByTargetTitle_.insert(title, target);
- }
- }
- }
- if (child->doc().hasTargets()) {
- const QList<Atom*>& targets = child->doc().targets();
- for (int i = 0; i < targets.size(); ++i) {
- QString ref = refForAtom(targets.at(i));
- QString title = targets.at(i)->string();
- if (!ref.isEmpty() && !title.isEmpty()) {
- QString key = Doc::canonicalTitle(title);
- TargetRec* target = new TargetRec(ref, title, TargetRec::Target, child, 2);
- nodesByTargetRef_.insert(key, target);
- nodesByTargetTitle_.insert(title, target);
- }
- }
- }
- }
-}
-
-/*!
- This function searches for a \a target anchor node. If it
- finds one, it sets \a ref and returns the found node.
- */
-const Node*
-Tree::findUnambiguousTarget(const QString& target, QString& ref) const
-{
- int numBestTargets = 0;
- TargetRec* bestTarget = 0;
- QList<TargetRec*> bestTargetList;
-
- QString key = target;
- TargetMap::const_iterator i = nodesByTargetTitle_.find(key);
- while (i != nodesByTargetTitle_.constEnd()) {
- if (i.key() != key)
- break;
- TargetRec* candidate = i.value();
- if (!bestTarget || (candidate->priority_ < bestTarget->priority_)) {
- bestTarget = candidate;
- bestTargetList.clear();
- bestTargetList.append(candidate);
- numBestTargets = 1;
- } else if (candidate->priority_ == bestTarget->priority_) {
- bestTargetList.append(candidate);
- ++numBestTargets;
- }
- ++i;
- }
- if (bestTarget) {
- ref = bestTarget->ref_;
- return bestTarget->node_;
- }
-
- numBestTargets = 0;
- bestTarget = 0;
- key = Doc::canonicalTitle(target);
- i = nodesByTargetRef_.find(key);
- while (i != nodesByTargetRef_.constEnd()) {
- if (i.key() != key)
- break;
- TargetRec* candidate = i.value();
- if (!bestTarget || (candidate->priority_ < bestTarget->priority_)) {
- bestTarget = candidate;
- bestTargetList.clear();
- bestTargetList.append(candidate);
- numBestTargets = 1;
- } else if (candidate->priority_ == bestTarget->priority_) {
- bestTargetList.append(candidate);
- ++numBestTargets;
- }
- ++i;
- }
- if (bestTarget) {
- ref = bestTarget->ref_;
- return bestTarget->node_;
- }
-
- ref.clear();
- return 0;
-}
-
-/*!
- This function searches for a node with the specified \a title.
- */
-const DocumentNode* Tree::findDocumentNodeByTitle(const QString& title) const
-{
- DocumentNodeMultiMap::const_iterator i;
- if (title.contains(QChar(' ')))
- i = docNodesByTitle_.constFind(Doc::canonicalTitle(title));
- else
- i = docNodesByTitle_.constFind(title);
- if (i != docNodesByTitle_.constEnd()) {
- /*
- Reporting all these duplicate section titles is probably
- overkill. We should report the duplicate file and let
- that suffice.
- */
- DocumentNodeMultiMap::const_iterator j = i;
- ++j;
- if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) {
- QList<Location> internalLocations;
- while (j != docNodesByTitle_.constEnd()) {
- if (j.key() == i.key() && j.value()->url().isEmpty()) {
- internalLocations.append(j.value()->location());
- break; // Just report one duplicate for now.
- }
- ++j;
- }
- if (internalLocations.size() > 0) {
- i.value()->location().warning("This page title exists in more than one file: " + title);
- foreach (const Location &location, internalLocations)
- location.warning("[It also exists here]");
- }
- }
- return i.value();
- }
- return 0;
-}
-
-/*!
- Returns a canonical title for the \a atom, if the \a atom
- is a SectionLeft or a Target.
- */
-QString Tree::refForAtom(const Atom* atom)
-{
- if (atom) {
- if (atom->type() == Atom::SectionLeft)
- return Doc::canonicalTitle(Text::sectionHeading(atom).toString());
- if ((atom->type() == Atom::Target) || (atom->type() == Atom::Keyword))
- return Doc::canonicalTitle(atom->string());
- }
- return QString();
-}
-
-/*!
- \fn const CNMap& Tree::groups() const
- Returns a const reference to the collection of all
- group nodes.
-*/
-
-/*!
- \fn const ModuleMap& Tree::modules() const
- Returns a const reference to the collection of all
- module nodes.
-*/
-
-/*!
- \fn const QmlModuleMap& Tree::qmlModules() const
- Returns a const reference to the collection of all
- QML module nodes.
-*/
-
-/*!
- Returns a pointer to the collection map specified by \a genus.
- Returns null if \a genus is not specified.
- */
-CNMap* Tree::getCollectionMap(Node::Genus genus)
-{
- switch (genus) {
- case Node::DOC:
- return &groups_;
- case Node::CPP:
- return &modules_;
- case Node::QML:
- return &qmlModules_;
- case Node::JS:
- return &jsModules_;
- default:
- break;
- }
- return 0;
-}
-
-/*!
- Returns a pointer to the collection named \a name of the
- specified \a genus in this tree. If there is no matching
- collection in this tree, 0 is returned.
- */
-CollectionNode* Tree::getCollection(const QString& name, Node::Genus genus)
-{
- CNMap* m = getCollectionMap(genus);
- if (m) {
- CNMap::const_iterator i = m->constFind(name);
- if (i != m->cend())
- return i.value();
- }
- return 0;
-}
-
-/*!
- Find the group, module, QML module, or JavaScript module
- named \a name and return a pointer to that collection node.
- \a genus specifies which kind of collection node you want.
- If a collection node with the specified \a name and \a genus
- is not found, a new one is created, and the pointer to the
- new one is returned.
-
- If a new collection node is created, its parent is the tree
- root, and the new collection node is marked \e{not seen}.
-
- \a genus must be specified, i.e. it must not be \c{DontCare}.
- If it is \c{DontCare}, 0 is returned, which is a programming
- error.
- */
-CollectionNode* Tree::findCollection(const QString& name, Node::Genus genus)
-{
- CNMap* m = getCollectionMap(genus);
- if (!m) // error
- return 0;
- CNMap::const_iterator i = m->constFind(name);
- if (i != m->cend())
- return i.value();
- Node::Type t = Node::NoType;
- switch (genus) {
- case Node::DOC:
- t = Node::Group;
- break;
- case Node::CPP:
- t = Node::Module;
- break;
- case Node::QML:
- t = Node::QmlModule;
- break;
- case Node::JS:
- t = Node::QmlModule;
- break;
- default:
- break;
- }
- CollectionNode* cn = new CollectionNode(t, root(), name, genus);
- cn->markNotSeen();
- m->insert(name, cn);
- return cn;
-}
-
-/*! \fn CollectionNode* Tree::findGroup(const QString& name)
- Find the group node named \a name and return a pointer
- to it. If the group node is not found, add a new group
- node named \a name and return a pointer to the new one.
-
- If a new group node is added, its parent is the tree root,
- and the new group node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* Tree::findModule(const QString& name)
- Find the module node named \a name and return a pointer
- to it. If a matching node is not found, add a new module
- node named \a name and return a pointer to that one.
-
- If a new module node is added, its parent is the tree root,
- and the new module node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* Tree::findQmlModule(const QString& name)
- Find the QML module node named \a name and return a pointer
- to it. If a matching node is not found, add a new QML module
- node named \a name and return a pointer to that one.
-
- If a new QML module node is added, its parent is the tree root,
- and the new node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* Tree::findJsModule(const QString& name)
- Find the JavaScript module named \a name and return a pointer
- to it. If a matching node is not found, add a new JavaScript
- module node named \a name and return a pointer to that one.
-
- If a new JavaScript module node is added, its parent is the
- tree root, and the new node is marked \e{not seen}.
- */
-
-/*! \fn CollectionNode* Tree::addGroup(const QString& name)
- Looks up the group node named \a name in the collection
- of all group nodes. If a match is found, a pointer to the
- node is returned. Otherwise, a new group node named \a name
- is created and inserted into the collection, and the pointer
- to that node is returned.
- */
-
-/*! \fn CollectionNode* Tree::addModule(const QString& name)
- Looks up the module node named \a name in the collection
- of all module nodes. If a match is found, a pointer to the
- node is returned. Otherwise, a new module node named \a name
- is created and inserted into the collection, and the pointer
- to that node is returned.
- */
-
-/*! \fn CollectionNode* Tree::addQmlModule(const QString& name)
- Looks up the QML module node named \a name in the collection
- of all QML module nodes. If a match is found, a pointer to the
- node is returned. Otherwise, a new QML module node named \a name
- is created and inserted into the collection, and the pointer
- to that node is returned.
- */
-
-/*! \fn CollectionNode* Tree::addJsModule(const QString& name)
- Looks up the JavaScript module node named \a name in the collection
- of all JavaScript module nodes. If a match is found, a pointer to the
- node is returned. Otherwise, a new JavaScrpt module node named \a name
- is created and inserted into the collection, and the pointer
- to that node is returned.
- */
-
-/*!
- Looks up the group node named \a name in the collection
- of all group nodes. If a match is not found, a new group
- node named \a name is created and inserted into the collection.
- Then append \a node to the group's members list, and append the
- group name to the list of group names in \a node. The parent of
- \a node is not changed by this function. Returns a pointer to
- the group node.
- */
-CollectionNode* Tree::addToGroup(const QString& name, Node* node)
-{
- CollectionNode* cn = findGroup(name);
- if (!node->isInternal()) {
- cn->addMember(node);
- node->appendGroupName(name);
- }
- return cn;
-}
-
-/*!
- Looks up the module node named \a name in the collection
- of all module nodes. If a match is not found, a new module
- node named \a name is created and inserted into the collection.
- Then append \a node to the module's members list. The parent of
- \a node is not changed by this function. Returns the module node.
- */
-CollectionNode* Tree::addToModule(const QString& name, Node* node)
-{
- CollectionNode* cn = findModule(name);
- cn->addMember(node);
- node->setPhysicalModuleName(name);
- return cn;
-}
-
-/*!
- Looks up the QML module named \a name. If it isn't there,
- create it. Then append \a node to the QML module's member
- list. The parent of \a node is not changed by this function.
- Returns the pointer to the QML module node.
- */
-CollectionNode* Tree::addToQmlModule(const QString& name, Node* node)
-{
- QStringList qmid;
- QStringList dotSplit;
- QStringList blankSplit = name.split(QLatin1Char(' '));
- qmid.append(blankSplit[0]);
- if (blankSplit.size() > 1) {
- qmid.append(blankSplit[0] + blankSplit[1]);
- dotSplit = blankSplit[1].split(QLatin1Char('.'));
- qmid.append(blankSplit[0] + dotSplit[0]);
- }
-
- CollectionNode* cn = findQmlModule(blankSplit[0]);
- cn->addMember(node);
- node->setQmlModule(cn);
- if (node->isQmlType()) {
- QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
- for (int i=0; i<qmid.size(); ++i) {
- QString key = qmid[i] + "::" + node->name();
- insertQmlType(key, n);
- }
- }
- return cn;
-}
-
-/*!
- Looks up the QML module named \a name. If it isn't there,
- create it. Then append \a node to the QML module's member
- list. The parent of \a node is not changed by this function.
- Returns the pointer to the QML module node.
- */
-CollectionNode* Tree::addToJsModule(const QString& name, Node* node)
-{
- QStringList qmid;
- QStringList dotSplit;
- QStringList blankSplit = name.split(QLatin1Char(' '));
- qmid.append(blankSplit[0]);
- if (blankSplit.size() > 1) {
- qmid.append(blankSplit[0] + blankSplit[1]);
- dotSplit = blankSplit[1].split(QLatin1Char('.'));
- qmid.append(blankSplit[0] + dotSplit[0]);
- }
-
- CollectionNode* cn = findJsModule(blankSplit[0]);
- cn->addMember(node);
- node->setQmlModule(cn);
- if (node->isJsType()) {
- QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
- for (int i=0; i<qmid.size(); ++i) {
- QString key = qmid[i] + "::" + node->name();
- insertQmlType(key, n);
- }
- }
- return cn;
-}
-
-/*!
- If the QML type map does not contain \a key, insert node
- \a n with the specified \a key.
- */
-void Tree::insertQmlType(const QString& key, QmlTypeNode* n)
-{
- if (!qmlTypeMap_.contains(key))
- qmlTypeMap_.insert(key,n);
-}
-
-/*!
- Split \a target on "::" and find the function node with that
- path.
- */
-const Node* Tree::findFunctionNode(const QString& target, const Node* relative, Node::Genus genus)
-{
- QString t = target;
- if (t.endsWith("()"))
- t.chop(2);
- QStringList path = t.split("::");
- const FunctionNode* fn = findFunctionNode(path, relative, SearchBaseClasses, genus);
- if (fn && fn->metaness() != FunctionNode::MacroWithoutParams)
- return fn;
- return 0;
-}
-
-/*!
- Search for a node that is identified by \a name.
- Return a pointer to a matching node, or 0.
-*/
-const Node* Tree::checkForCollision(const QString& name)
-{
- return findNode(QStringList(name), 0, 0, Node::DontCare);
-}
-
-/*!
- Generate a target of the form link-nnn, where the nnn is
- the current link count for this tree. This target string
- is returned. It will be output as an HTML anchor just before
- an HTML link to the node \a t.
-
- The node \a t
- */
-QString Tree::getNewLinkTarget(const Node* locNode,
- const Node* t,
- const QString& fileName,
- QString& text,
- bool broken)
-{
- QString physicalModuleName;
- if (t && !broken) {
- Tree* tree = t->tree();
- if (tree != this)
- tree->incrementLinkCount();
- physicalModuleName = tree->physicalModuleName();
- }
- else
- physicalModuleName = "broken";
- incrementLinkCount();
- QString target = QString("qa-target-%1").arg(-(linkCount()));
- TargetLoc* tloc = new TargetLoc(locNode, target, fileName, text, broken);
- TargetList* tList = 0;
- TargetListMap::iterator i = targetListMap_->find(physicalModuleName);
- if (i == targetListMap_->end()) {
- tList = new TargetList;
- i = targetListMap_->insert(physicalModuleName, tList);
- }
- else
- tList = i.value();
- tList->append(tloc);
- return target;
-}
-
-/*!
- Look up the target list for the specified \a module
- and return a pointer to it.
- */
-TargetList* Tree::getTargetList(const QString& module)
-{
- return targetListMap_->value(module);
-}
-
-QT_END_NAMESPACE
diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h
deleted file mode 100644
index 1e9612aeec..0000000000
--- a/src/tools/qdoc/tree.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- tree.h
-*/
-
-#ifndef TREE_H
-#define TREE_H
-
-#include <QtCore/qstack.h>
-#include "node.h"
-
-QT_BEGIN_NAMESPACE
-
-class QStringList;
-class QDocDatabase;
-
-struct TargetRec
-{
- public:
- enum Type { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle };
-
- TargetRec(const QString& name,
- const QString& title,
- TargetRec::Type type,
- Node* node,
- int priority)
- : node_(node), ref_(name), title_(title), priority_(priority), type_(type) { }
-
- bool isEmpty() const { return ref_.isEmpty(); }
-
- Node* node_;
- QString ref_;
- QString title_;
- int priority_;
- Type type_;
-};
-
-struct TargetLoc
-{
- public:
- TargetLoc(const Node* loc, const QString& t, const QString& fileName, const QString& text, bool broken)
- : loc_(loc), target_(t), fileName_(fileName), text_(text), broken_(broken) { }
- const Node* loc_;
- QString target_;
- QString fileName_;
- QString text_;
- bool broken_;
-};
-
-typedef QMultiMap<QString, TargetRec*> TargetMap;
-typedef QMultiMap<QString, DocumentNode*> DocumentNodeMultiMap;
-typedef QMap<QString, QmlTypeNode*> QmlTypeMap;
-typedef QMultiMap<QString, const ExampleNode*> ExampleNodeMap;
-typedef QVector<TargetLoc*> TargetList;
-typedef QMap<QString, TargetList*> TargetListMap;
-
-class Tree
-{
- private:
- friend class QDocForest;
- friend class QDocDatabase;
-
- typedef QMap<PropertyNode::FunctionRole, QString> RoleMap;
- typedef QMap<PropertyNode*, RoleMap> PropertyMap;
-
- Tree(const QString& camelCaseModuleName, QDocDatabase* qdb);
- ~Tree();
-
- Node* findNodeForInclude(const QStringList& path) const;
- ClassNode* findClassNode(const QStringList& path, const Node* start = 0) const;
- NamespaceNode* findNamespaceNode(const QStringList& path) const;
- FunctionNode* findFunctionNode(const QStringList& parentPath, const FunctionNode* clone);
- const Node* findFunctionNode(const QString& target, const Node* relative, Node::Genus genus);
-
- Node* findNodeRecursive(const QStringList& path,
- int pathIndex,
- const Node* start,
- Node::Type type) const;
- Node* findNodeRecursive(const QStringList& path,
- int pathIndex,
- Node* start,
- const NodeTypeList& types) const;
-
- const Node* findNodeForTarget(const QStringList& path,
- const QString& target,
- const Node* node,
- int flags,
- Node::Genus genus,
- QString& ref) const;
- const Node* matchPathAndTarget(const QStringList& path,
- int idx,
- const QString& target,
- const Node* node,
- int flags,
- Node::Genus genus,
- QString& ref) const;
-
- const Node* findNode(const QStringList &path,
- const Node* relative, // = 0,
- int findFlags, // = 0,
- Node::Genus genus) const; // = Node::DontCare) const;
-
- QmlTypeNode* findQmlTypeNode(const QStringList& path);
-
- Node* findNodeByNameAndType(const QStringList& path, Node::Type type) const;
- InnerNode* findRelatesNode(const QStringList& path);
- QString getRef(const QString& target, const Node* node) const;
- void insertTarget(const QString& name,
- const QString& title,
- TargetRec::Type type,
- Node* node,
- int priority);
- void resolveTargets(InnerNode* root);
- const Node* findUnambiguousTarget(const QString& target, QString& ref) const;
- const DocumentNode* findDocumentNodeByTitle(const QString& title) const;
-
- void addPropertyFunction(PropertyNode *property,
- const QString &funcName,
- PropertyNode::FunctionRole funcRole);
- void resolveInheritance(InnerNode* n = 0);
- void resolveInheritanceHelper(int pass, ClassNode* cn);
- void resolveProperties();
- void resolveCppToQmlLinks();
- void resolveUsingClauses();
- void fixInheritance(NamespaceNode *rootNode = 0);
- NamespaceNode *root() { return &root_; }
-
- const FunctionNode *findFunctionNode(const QStringList &path,
- const Node *relative = 0,
- int findFlags = 0,
- Node::Genus genus = Node::DontCare) const;
- const NamespaceNode *root() const { return &root_; }
-
- FunctionNode *findVirtualFunctionInBaseClasses(ClassNode *classe,
- FunctionNode *clone);
- NodeList allBaseClasses(const ClassNode *classe) const;
- QString refForAtom(const Atom* atom);
-
- CNMap* getCollectionMap(Node::Genus genus);
- const CNMap& groups() const { return groups_; }
- const CNMap& modules() const { return modules_; }
- const CNMap& qmlModules() const { return qmlModules_; }
- const CNMap& jsModules() const { return jsModules_; }
-
- CollectionNode* getCollection(const QString& name, Node::Genus genus);
- CollectionNode* findCollection(const QString& name, Node::Genus genus);
-
- CollectionNode* findGroup(const QString& name) { return findCollection(name, Node::DOC); }
- CollectionNode* findModule(const QString& name) { return findCollection(name, Node::CPP); }
- CollectionNode* findQmlModule(const QString& name) { return findCollection(name, Node::QML); }
- CollectionNode* findJsModule(const QString& name) { return findCollection(name, Node::JS); }
-
- CollectionNode* addGroup(const QString& name) { return findGroup(name); }
- CollectionNode* addModule(const QString& name) { return findModule(name); }
- CollectionNode* addQmlModule(const QString& name) { return findQmlModule(name); }
- CollectionNode* addJsModule(const QString& name) { return findJsModule(name); }
-
- CollectionNode* addToGroup(const QString& name, Node* node);
- CollectionNode* addToModule(const QString& name, Node* node);
- CollectionNode* addToQmlModule(const QString& name, Node* node);
- CollectionNode* addToJsModule(const QString& name, Node* node);
-
- QmlTypeNode* lookupQmlType(const QString& name) const { return qmlTypeMap_.value(name); }
- void insertQmlType(const QString& key, QmlTypeNode* n);
- void addExampleNode(ExampleNode* n) { exampleNodeMap_.insert(n->title(), n); }
- ExampleNodeMap& exampleNodeMap() { return exampleNodeMap_; }
- const Node* checkForCollision(const QString& name);
- void setIndexFileName(const QString& t) { indexFileName_ = t; }
-
- bool treeHasBeenAnalyzed() const { return treeHasBeenAnalyzed_; }
- bool docsHaveBeenGenerated() const { return docsHaveBeenGenerated_; }
- void setTreeHasBeenAnalyzed() { treeHasBeenAnalyzed_ = true; }
- void setdocsHaveBeenGenerated() { docsHaveBeenGenerated_ = true; }
- QString getNewLinkTarget(const Node* locNode,
- const Node* t,
- const QString& fileName,
- QString& text,
- bool broken);
- TargetList* getTargetList(const QString& module);
- QStringList getTargetListKeys() { return targetListMap_->keys(); }
-
- public:
- const QString& camelCaseModuleName() const { return camelCaseModuleName_; }
- const QString& physicalModuleName() const { return physicalModuleName_; }
- const QString& indexFileName() const { return indexFileName_; }
- long incrementLinkCount() { return --linkCount_; }
- void clearLinkCount() { linkCount_ = 0; }
- long linkCount() const { return linkCount_; }
-
-private:
- bool treeHasBeenAnalyzed_;
- bool docsHaveBeenGenerated_;
- long linkCount_;
- QString camelCaseModuleName_;
- QString physicalModuleName_;
- QString indexFileName_;
- QDocDatabase* qdb_;
- NamespaceNode root_;
- PropertyMap unresolvedPropertyMap;
- DocumentNodeMultiMap docNodesByTitle_;
- TargetMap nodesByTargetRef_;
- TargetMap nodesByTargetTitle_;
- CNMap groups_;
- CNMap modules_;
- CNMap qmlModules_;
- CNMap jsModules_;
- QmlTypeMap qmlTypeMap_;
- ExampleNodeMap exampleNodeMap_;
- TargetListMap* targetListMap_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/tools/qdoc/yyindent.cpp b/src/tools/qdoc/yyindent.cpp
deleted file mode 100644
index e48a847088..0000000000
--- a/src/tools/qdoc/yyindent.cpp
+++ /dev/null
@@ -1,1182 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the tools applications 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$
-**
-****************************************************************************/
-
-/*
- This file is a self-contained interactive indenter for C++ and Qt
- Script.
-
- The general problem of indenting a C++ program is ill posed. On
- the one hand, an indenter has to analyze programs written in a
- free-form formal language that is best described in terms of
- tokens, not characters, not lines. On the other hand, indentation
- applies to lines and white space characters matter, and otherwise
- the programs to indent are formally invalid in general, as they
- are begin edited.
-
- The approach taken here works line by line. We receive a program
- consisting of N lines or more, and we want to compute the
- indentation appropriate for the Nth line. Lines beyond the Nth
- lines are of no concern to us, so for simplicity we pretend the
- program has exactly N lines and we call the Nth line the "bottom
- line". Typically, we have to indent the bottom line when it's
- still empty, so we concentrate our analysis on the N - 1 lines
- that precede.
-
- By inspecting the (N - 1)-th line, the (N - 2)-th line, ...
- backwards, we determine the kind of the bottom line and indent it
- accordingly.
-
- * The bottom line is a comment line. See
- bottomLineStartsInCComment() and
- indentWhenBottomLineStartsInCComment().
- * The bottom line is a continuation line. See isContinuationLine()
- and indentForContinuationLine().
- * The bottom line is a standalone line. See
- indentForStandaloneLine().
-
- Certain tokens that influence the indentation, notably braces,
- are looked for in the lines. This is done by simple string
- comparison, without a real tokenizer. Confusing constructs such
- as comments and string literals are removed beforehand.
-*/
-
-#include <qregexp.h>
-#include <qstringlist.h>
-
-QT_BEGIN_NAMESPACE
-
-/* qmake ignore Q_OBJECT */
-
-/*
- The indenter avoids getting stuck in almost infinite loops by
- imposing arbitrary limits on the number of lines it analyzes when
- looking for a construct.
-
- For example, the indenter never considers more than BigRoof lines
- backwards when looking for the start of a C-style comment.
-*/
-static const int SmallRoof = 40;
-static const int BigRoof = 400;
-
-/*
- The indenter supports a few parameters:
-
- * ppHardwareTabSize is the size of a '\t' in your favorite editor.
- * ppIndentSize is the size of an indentation, or software tab
- size.
- * ppContinuationIndentSize is the extra indent for a continuation
- line, when there is nothing to align against on the previous
- line.
- * ppCommentOffset is the indentation within a C-style comment,
- when it cannot be picked up.
-*/
-
-static int ppHardwareTabSize = 8;
-static int ppIndentSize = 4;
-static int ppContinuationIndentSize = 8;
-
-static const int ppCommentOffset = 2;
-
-void setTabSize( int size )
-{
- ppHardwareTabSize = size;
-}
-
-void setIndentSize( int size )
-{
- ppIndentSize = size;
- ppContinuationIndentSize = 2 * size;
-}
-
-static QRegExp *literal = 0;
-static QRegExp *label = 0;
-static QRegExp *inlineCComment = 0;
-static QRegExp *braceX = 0;
-static QRegExp *iflikeKeyword = 0;
-
-/*
- Returns the first non-space character in the string t, or
- QChar::Null if the string is made only of white space.
-*/
-static QChar firstNonWhiteSpace( const QString& t )
-{
- int i = 0;
- while ( i < (int) t.length() ) {
- if ( !t[i].isSpace() )
- return t[i];
- i++;
- }
- return QChar::Null;
-}
-
-/*
- Returns \c true if string t is made only of white space; otherwise
- returns \c false.
-*/
-static bool isOnlyWhiteSpace( const QString& t )
-{
- return firstNonWhiteSpace( t ).isNull();
-}
-
-/*
- Assuming string t is a line, returns the column number of a given
- index. Column numbers and index are identical for strings that don't
- contain '\t's.
-*/
-int columnForIndex( const QString& t, int index )
-{
- int col = 0;
- if ( index > (int) t.length() )
- index = t.length();
-
- for ( int i = 0; i < index; i++ ) {
- if ( t[i] == QChar('\t') ) {
- col = ( (col / ppHardwareTabSize) + 1 ) * ppHardwareTabSize;
- } else {
- col++;
- }
- }
- return col;
-}
-
-/*
- Returns the indentation size of string t.
-*/
-int indentOfLine( const QString& t )
-{
- return columnForIndex( t, t.indexOf(firstNonWhiteSpace(t)) );
-}
-
-/*
- Replaces t[k] by ch, unless t[k] is '\t'. Tab characters are better
- left alone since they break the "index equals column" rule. No
- provisions are taken against '\n' or '\r', which shouldn't occur in
- t anyway.
-*/
-static inline void eraseChar( QString& t, int k, QChar ch )
-{
- if ( t[k] != '\t' )
- t[k] = ch;
-}
-
-/*
- Removes some nefast constructs from a code line and returns the
- resulting line.
-*/
-static QString trimmedCodeLine( const QString& t )
-{
- QString trimmed = t;
- int k;
-
- /*
- Replace character and string literals by X's, since they may
- contain confusing characters (such as '{' and ';'). "Hello!" is
- replaced by XXXXXXXX. The literals are rigourously of the same
- length before and after; otherwise, we would break alignment of
- continuation lines.
- */
- k = 0;
- while ( (k = trimmed.indexOf(*literal, k)) != -1 ) {
- for ( int i = 0; i < literal->matchedLength(); i++ )
- eraseChar( trimmed, k + i, 'X' );
- k += literal->matchedLength();
- }
-
- /*
- Replace inline C-style comments by spaces. Other comments are
- handled elsewhere.
- */
- k = 0;
- while ( (k = trimmed.indexOf(*inlineCComment, k)) != -1 ) {
- for ( int i = 0; i < inlineCComment->matchedLength(); i++ )
- eraseChar( trimmed, k + i, ' ' );
- k += inlineCComment->matchedLength();
- }
-
- /*
- Replace goto and switch labels by whitespace, but be careful
- with this case:
-
- foo1: bar1;
- bar2;
- */
- while ( trimmed.lastIndexOf(':') != -1 && trimmed.indexOf(*label) != -1 ) {
- QString cap1 = label->cap( 1 );
- int pos1 = label->pos( 1 );
- int stop = cap1.length();
-
- if ( pos1 + stop < (int) trimmed.length() && ppIndentSize < stop )
- stop = ppIndentSize;
-
- int i = 0;
- while ( i < stop ) {
- eraseChar( trimmed, pos1 + i, ' ' );
- i++;
- }
- while ( i < (int) cap1.length() ) {
- eraseChar( trimmed, pos1 + i, ';' );
- i++;
- }
- }
-
- /*
- Remove C++-style comments.
- */
- k = trimmed.indexOf( "//" );
- if ( k != -1 )
- trimmed.truncate( k );
-
- return trimmed;
-}
-
-/*
- Returns '(' if the last parenthesis is opening, ')' if it is
- closing, and QChar::Null if there are no parentheses in t.
-*/
-static inline QChar lastParen( const QString& t )
-{
- int i = t.length();
- while ( i > 0 ) {
- i--;
- if ( t[i] == QChar('(') || t[i] == QChar(')') )
- return t[i];
- }
- return QChar::Null;
-}
-
-/*
- Returns \c true if typedIn the same as okayCh or is null; otherwise
- returns \c false.
-*/
-static inline bool okay( QChar typedIn, QChar okayCh )
-{
- return typedIn == QChar::Null || typedIn == okayCh;
-}
-
-/*
- The "linizer" is a group of functions and variables to iterate
- through the source code of the program to indent. The program is
- given as a list of strings, with the bottom line being the line
- to indent. The actual program might contain extra lines, but
- those are uninteresting and not passed over to us.
-*/
-
-struct LinizerState
-{
- QString line;
- int braceDepth;
- bool leftBraceFollows;
-
- QStringList::ConstIterator iter;
- bool inCComment;
- bool pendingRightBrace;
-};
-
-static QStringList *yyProgram = 0;
-static LinizerState *yyLinizerState = 0;
-
-// shorthands
-static const QString *yyLine = 0;
-static const int *yyBraceDepth = 0;
-static const bool *yyLeftBraceFollows = 0;
-
-/*
- Saves and restores the state of the global linizer. This enables
- backtracking.
-*/
-#define YY_SAVE() \
- LinizerState savedState = *yyLinizerState
-#define YY_RESTORE() \
- *yyLinizerState = savedState
-
-/*
- Advances to the previous line in yyProgram and update yyLine
- accordingly. yyLine is cleaned from comments and other damageable
- constructs. Empty lines are skipped.
-*/
-static bool readLine()
-{
- int k;
-
- yyLinizerState->leftBraceFollows =
- ( firstNonWhiteSpace(yyLinizerState->line) == QChar('{') );
-
- do {
- if ( yyLinizerState->iter == yyProgram->constBegin() ) {
- yyLinizerState->line.clear();
- return false;
- }
-
- --yyLinizerState->iter;
- yyLinizerState->line = *yyLinizerState->iter;
-
- yyLinizerState->line = trimmedCodeLine( yyLinizerState->line );
-
- /*
- Remove C-style comments that span multiple lines. If the
- bottom line starts in a C-style comment, we are not aware
- of that and eventually yyLine will contain a slash-aster.
-
- Notice that both if's can be executed, since
- yyLinizerState->inCComment is potentially set to false in
- the first if. The order of the if's is also important.
- */
-
- if ( yyLinizerState->inCComment ) {
- QString slashAster( "/*" );
-
- k = yyLinizerState->line.indexOf( slashAster );
- if ( k == -1 ) {
- yyLinizerState->line.clear();
- } else {
- yyLinizerState->line.truncate( k );
- yyLinizerState->inCComment = false;
- }
- }
-
- if ( !yyLinizerState->inCComment ) {
- QString asterSlash( "*/" );
-
- k = yyLinizerState->line.indexOf( asterSlash );
- if ( k != -1 ) {
- for ( int i = 0; i < k + 2; i++ )
- eraseChar( yyLinizerState->line, i, ' ' );
- yyLinizerState->inCComment = true;
- }
- }
-
- /*
- Remove preprocessor directives.
- */
- k = 0;
- while ( k < (int) yyLinizerState->line.length() ) {
- QChar ch = yyLinizerState->line[k];
- if ( ch == QChar('#') ) {
- yyLinizerState->line.clear();
- } else if ( !ch.isSpace() ) {
- break;
- }
- k++;
- }
-
- /*
- Remove trailing spaces.
- */
- k = yyLinizerState->line.length();
- while ( k > 0 && yyLinizerState->line[k - 1].isSpace() )
- k--;
- yyLinizerState->line.truncate( k );
-
- /*
- '}' increment the brace depth and '{' decrements it and not
- the other way around, as we are parsing backwards.
- */
- yyLinizerState->braceDepth +=
- yyLinizerState->line.count( '}' ) -
- yyLinizerState->line.count( '{' );
-
- /*
- We use a dirty trick for
-
- } else ...
-
- We don't count the '}' yet, so that it's more or less
- equivalent to the friendly construct
-
- }
- else ...
- */
- if ( yyLinizerState->pendingRightBrace )
- yyLinizerState->braceDepth++;
- yyLinizerState->pendingRightBrace =
- ( yyLinizerState->line.indexOf(*braceX) == 0 );
- if ( yyLinizerState->pendingRightBrace )
- yyLinizerState->braceDepth--;
- } while ( yyLinizerState->line.isEmpty() );
-
- return true;
-}
-
-/*
- Resets the linizer to its initial state, with yyLine containing the
- line above the bottom line of the program.
-*/
-static void startLinizer()
-{
- yyLinizerState->braceDepth = 0;
- yyLinizerState->inCComment = false;
- yyLinizerState->pendingRightBrace = false;
-
- yyLine = &yyLinizerState->line;
- yyBraceDepth = &yyLinizerState->braceDepth;
- yyLeftBraceFollows = &yyLinizerState->leftBraceFollows;
-
- yyLinizerState->iter = yyProgram->constEnd();
- --yyLinizerState->iter;
- yyLinizerState->line = *yyLinizerState->iter;
- readLine();
-}
-
-/*
- Returns \c true if the start of the bottom line of yyProgram (and
- potentially the whole line) is part of a C-style comment;
- otherwise returns \c false.
-*/
-static bool bottomLineStartsInCComment()
-{
- QString slashAster( "/*" );
- QString asterSlash( "*/" );
-
- /*
- We could use the linizer here, but that would slow us down
- terribly. We are better to trim only the code lines we need.
- */
- QStringList::ConstIterator p = yyProgram->constEnd();
- --p; // skip bottom line
-
- for ( int i = 0; i < BigRoof; i++ ) {
- if ( p == yyProgram->constBegin() )
- return false;
- --p;
-
- if ( (*p).indexOf(slashAster) != -1 || (*p).indexOf(asterSlash) != -1 ) {
- QString trimmed = trimmedCodeLine( *p );
-
- if ( trimmed.indexOf(slashAster) != -1 ) {
- return true;
- } else if ( trimmed.indexOf(asterSlash) != -1 ) {
- return false;
- }
- }
- }
- return false;
-}
-
-/*
- Returns the recommended indent for the bottom line of yyProgram
- assuming that it starts in a C-style comment, a condition that is
- tested elsewhere.
-
- Essentially, we're trying to align against some text on the
- previous line.
-*/
-static int indentWhenBottomLineStartsInCComment()
-{
- int k = yyLine->lastIndexOf( "/*" );
- if ( k == -1 ) {
- /*
- We found a normal text line in a comment. Align the
- bottom line with the text on this line.
- */
- return indentOfLine( *yyLine );
- } else {
- /*
- The C-style comment starts on this line. If there is
- text on the same line, align with it. Otherwise, align
- with the slash-aster plus a given offset.
- */
- int indent = columnForIndex( *yyLine, k );
- k += 2;
- while ( k < (int) yyLine->length() ) {
- if ( !(*yyLine)[k].isSpace() )
- return columnForIndex( *yyLine, k );
- k++;
- }
- return indent + ppCommentOffset;
- }
-}
-
-/*
- A function called match...() modifies the linizer state. If it
- returns \c true, yyLine is the top line of the matched construct;
- otherwise, the linizer is left in an unknown state.
-
- A function called is...() keeps the linizer state intact.
-*/
-
-/*
- Returns \c true if the current line (and upwards) forms a braceless
- control statement; otherwise returns \c false.
-
- The first line of the following example is a "braceless control
- statement":
-
- if ( x )
- y;
-*/
-static bool matchBracelessControlStatement()
-{
- int delimDepth = 0;
-
- if ( yyLine->endsWith("else") )
- return true;
-
- if ( !yyLine->endsWith(QLatin1Char(')')) )
- return false;
-
- for ( int i = 0; i < SmallRoof; i++ ) {
- int j = yyLine->length();
- while ( j > 0 ) {
- j--;
- QChar ch = (*yyLine)[j];
-
- switch ( ch.unicode() ) {
- case ')':
- delimDepth++;
- break;
- case '(':
- delimDepth--;
- if ( delimDepth == 0 ) {
- if ( yyLine->indexOf(*iflikeKeyword) != -1 ) {
- /*
- We have
-
- if ( x )
- y
-
- "if ( x )" is not part of the statement
- "y".
- */
- return true;
- }
- }
- if ( delimDepth == -1 ) {
- /*
- We have
-
- if ( (1 +
- 2)
-
- and not
-
- if ( 1 +
- 2 )
- */
- return false;
- }
- break;
- case '{':
- case '}':
- case ';':
- /*
- We met a statement separator, but not where we
- expected it. What follows is probably a weird
- continuation line. Be careful with ';' in for,
- though.
- */
- if ( ch != QChar(';') || delimDepth == 0 )
- return false;
- }
- }
-
- if ( !readLine() )
- break;
- }
- return false;
-}
-
-/*
- Returns \c true if yyLine is an unfinished line; otherwise returns
- false.
-
- In many places we'll use the terms "standalone line", "unfinished
- line" and "continuation line". The meaning of these should be
- evident from this code example:
-
- a = b; // standalone line
- c = d + // unfinished line
- e + // unfinished continuation line
- f + // unfinished continuation line
- g; // continuation line
-*/
-static bool isUnfinishedLine()
-{
- bool unf = false;
-
- YY_SAVE();
-
- if ( yyLine->isEmpty() )
- return false;
-
- QChar lastCh = (*yyLine)[(int) yyLine->length() - 1];
- if ( QString("{};").indexOf(lastCh) == -1 && !yyLine->endsWith("...") ) {
- /*
- It doesn't end with ';' or similar. If it's neither
- "Q_OBJECT" nor "if ( x )", it must be an unfinished line.
- */
- unf = ( yyLine->indexOf("Q_OBJECT") == -1 &&
- !matchBracelessControlStatement() );
- } else if ( lastCh == QChar(';') ) {
- if ( lastParen(*yyLine) == QChar('(') ) {
- /*
- Exception:
-
- for ( int i = 1; i < 10;
- */
- unf = true;
- } else if ( readLine() && yyLine->endsWith(QLatin1Char(';')) &&
- lastParen(*yyLine) == QChar('(') ) {
- /*
- Exception:
-
- for ( int i = 1;
- i < 10;
- */
- unf = true;
- }
- }
-
- YY_RESTORE();
- return unf;
-}
-
-/*
- Returns \c true if yyLine is a continuation line; otherwise returns
- false.
-*/
-static bool isContinuationLine()
-{
- bool cont = false;
-
- YY_SAVE();
- if ( readLine() )
- cont = isUnfinishedLine();
- YY_RESTORE();
- return cont;
-}
-
-/*
- Returns the recommended indent for the bottom line of yyProgram,
- assuming it's a continuation line.
-
- We're trying to align the continuation line against some parenthesis
- or other bracked left opened on a previous line, or some interesting
- operator such as '='.
-*/
-static int indentForContinuationLine()
-{
- int braceDepth = 0;
- int delimDepth = 0;
-
- bool leftBraceFollowed = *yyLeftBraceFollows;
-
- for ( int i = 0; i < SmallRoof; i++ ) {
- int hook = -1;
-
- int j = yyLine->length();
- while ( j > 0 && hook < 0 ) {
- j--;
- QChar ch = (*yyLine)[j];
-
- switch ( ch.unicode() ) {
- case ')':
- case ']':
- delimDepth++;
- break;
- case '}':
- braceDepth++;
- break;
- case '(':
- case '[':
- delimDepth--;
- /*
- An unclosed delimiter is a good place to align at,
- at least for some styles (including Qt's).
- */
- if ( delimDepth == -1 )
- hook = j;
- break;
- case '{':
- braceDepth--;
- /*
- A left brace followed by other stuff on the same
- line is typically for an enum or an initializer.
- Such a brace must be treated just like the other
- delimiters.
- */
- if ( braceDepth == -1 ) {
- if ( j < (int) yyLine->length() - 1 ) {
- hook = j;
- } else {
- return 0; // shouldn't happen
- }
- }
- break;
- case '=':
- /*
- An equal sign is a very natural alignment hook
- because it's usually the operator with the lowest
- precedence in statements it appears in. Case in
- point:
-
- int x = 1 +
- 2;
-
- However, we have to beware of constructs such as
- default arguments and explicit enum constant
- values:
-
- void foo( int x = 0,
- int y = 0 );
-
- And not
-
- void foo( int x = 0,
- int y = 0 );
-
- These constructs are caracterized by a ',' at the
- end of the unfinished lines or by unbalanced
- parentheses.
- */
- if ( QString("!=<>").indexOf((*yyLine)[j - 1]) == -1 &&
- (*yyLine)[j + 1] != '=' ) {
- if ( braceDepth == 0 && delimDepth == 0 &&
- j < (int) yyLine->length() - 1 &&
- !yyLine->endsWith(QLatin1Char(',')) &&
- (yyLine->contains('(') == yyLine->contains(')')) )
- hook = j;
- }
- }
- }
-
- if ( hook >= 0 ) {
- /*
- Yes, we have a delimiter or an operator to align
- against! We don't really align against it, but rather
- against the following token, if any. In this example,
- the following token is "11":
-
- int x = ( 11 +
- 2 );
-
- If there is no such token, we use a continuation indent:
-
- static QRegExp foo( QString(
- "foo foo foo foo foo foo foo foo foo") );
- */
- hook++;
- while ( hook < (int) yyLine->length() ) {
- if ( !(*yyLine)[hook].isSpace() )
- return columnForIndex( *yyLine, hook );
- hook++;
- }
- return indentOfLine( *yyLine ) + ppContinuationIndentSize;
- }
-
- if ( braceDepth != 0 )
- break;
-
- /*
- The line's delimiters are balanced. It looks like a
- continuation line or something.
- */
- if ( delimDepth == 0 ) {
- if ( leftBraceFollowed ) {
- /*
- We have
-
- int main()
- {
-
- or
-
- Bar::Bar()
- : Foo( x )
- {
-
- The "{" should be flush left.
- */
- if ( !isContinuationLine() )
- return indentOfLine( *yyLine );
- } else if ( isContinuationLine() || yyLine->endsWith(QLatin1Char(',')) ) {
- /*
- We have
-
- x = a +
- b +
- c;
-
- or
-
- int t[] = {
- 1, 2, 3,
- 4, 5, 6
-
- The "c;" should fall right under the "b +", and the
- "4, 5, 6" right under the "1, 2, 3,".
- */
- return indentOfLine( *yyLine );
- } else {
- /*
- We have
-
- stream << 1 +
- 2;
-
- We could, but we don't, try to analyze which
- operator has precedence over which and so on, to
- obtain the excellent result
-
- stream << 1 +
- 2;
-
- We do have a special trick above for the assignment
- operator above, though.
- */
- return indentOfLine( *yyLine ) + ppContinuationIndentSize;
- }
- }
-
- if ( !readLine() )
- break;
- }
- return 0;
-}
-
-/*
- Returns the recommended indent for the bottom line of yyProgram if
- that line is standalone (or should be indented likewise).
-
- Indenting a standalone line is tricky, mostly because of braceless
- control statements. Grossly, we are looking backwards for a special
- line, a "hook line", that we can use as a starting point to indent,
- and then modify the indentation level according to the braces met
- along the way to that hook.
-
- Let's consider a few examples. In all cases, we want to indent the
- bottom line.
-
- Example 1:
-
- x = 1;
- y = 2;
-
- The hook line is "x = 1;". We met 0 opening braces and 0 closing
- braces. Therefore, "y = 2;" inherits the indent of "x = 1;".
-
- Example 2:
-
- if ( x ) {
- y;
-
- The hook line is "if ( x ) {". No matter what precedes it, "y;" has
- to be indented one level deeper than the hook line, since we met one
- opening brace along the way.
-
- Example 3:
-
- if ( a )
- while ( b ) {
- c;
- }
- d;
-
- To indent "d;" correctly, we have to go as far as the "if ( a )".
- Compare with
-
- if ( a ) {
- while ( b ) {
- c;
- }
- d;
-
- Still, we're striving to go back as little as possible to
- accommodate people with irregular indentation schemes. A hook line
- near at hand is much more reliable than a remote one.
-*/
-static int indentForStandaloneLine()
-{
- for ( int i = 0; i < SmallRoof; i++ ) {
- if ( !*yyLeftBraceFollows ) {
- YY_SAVE();
-
- if ( matchBracelessControlStatement() ) {
- /*
- The situation is this, and we want to indent "z;":
-
- if ( x &&
- y )
- z;
-
- yyLine is "if ( x &&".
- */
- return indentOfLine( *yyLine ) + ppIndentSize;
- }
- YY_RESTORE();
- }
-
- if ( yyLine->endsWith(QLatin1Char(';')) || yyLine->contains('{') ) {
- /*
- The situation is possibly this, and we want to indent
- "z;":
-
- while ( x )
- y;
- z;
-
- We return the indent of "while ( x )". In place of "y;",
- any arbitrarily complex compound statement can appear.
- */
-
- if ( *yyBraceDepth > 0 ) {
- do {
- if ( !readLine() )
- break;
- } while ( *yyBraceDepth > 0 );
- }
-
- LinizerState hookState;
-
- while ( isContinuationLine() )
- readLine();
- hookState = *yyLinizerState;
-
- readLine();
- if ( *yyBraceDepth <= 0 ) {
- do {
- if ( !matchBracelessControlStatement() )
- break;
- hookState = *yyLinizerState;
- } while ( readLine() );
- }
-
- *yyLinizerState = hookState;
-
- while ( isContinuationLine() )
- readLine();
-
- /*
- Never trust lines containing only '{' or '}', as some
- people (Richard M. Stallman) format them weirdly.
- */
- if ( yyLine->trimmed().length() > 1 )
- return indentOfLine( *yyLine ) - *yyBraceDepth * ppIndentSize;
- }
-
- if ( !readLine() )
- return -*yyBraceDepth * ppIndentSize;
- }
- return 0;
-}
-
-/*
- Constructs global variables used by the indenter.
-*/
-static void initializeIndenter()
-{
- literal = new QRegExp( "([\"'])(?:\\\\.|[^\\\\])*\\1" );
- literal->setMinimal( true );
- label = new QRegExp(
- "^\\s*((?:case\\b([^:]|::)+|[a-zA-Z_0-9]+)(?:\\s+slots)?:)(?!:)" );
- inlineCComment = new QRegExp( "/\\*.*\\*/" );
- inlineCComment->setMinimal( true );
- braceX = new QRegExp( "^\\s*\\}\\s*(?:else|catch)\\b" );
- iflikeKeyword = new QRegExp( "\\b(?:catch|do|for|if|while)\\b" );
-
- yyLinizerState = new LinizerState;
-}
-
-/*
- Destroys global variables used by the indenter.
-*/
-static void terminateIndenter()
-{
- delete literal;
- delete label;
- delete inlineCComment;
- delete braceX;
- delete iflikeKeyword;
- delete yyLinizerState;
-}
-
-/*
- Returns the recommended indent for the bottom line of program.
- Unless null, typedIn stores the character of yyProgram that
- triggered reindentation.
-
- This function works better if typedIn is set properly; it is
- slightly more conservative if typedIn is completely wild, and
- slighly more liberal if typedIn is always null. The user might be
- annoyed by the liberal behavior.
-*/
-int indentForBottomLine( const QStringList& program, QChar typedIn )
-{
- if ( program.isEmpty() )
- return 0;
-
- initializeIndenter();
-
- yyProgram = new QStringList( program );
- startLinizer();
-
- const QString& bottomLine = program.last();
- QChar firstCh = firstNonWhiteSpace( bottomLine );
- int indent;
-
- if ( bottomLineStartsInCComment() ) {
- /*
- The bottom line starts in a C-style comment. Indent it
- smartly, unless the user has already played around with it,
- in which case it's better to leave her stuff alone.
- */
- if ( isOnlyWhiteSpace(bottomLine) ) {
- indent = indentWhenBottomLineStartsInCComment();
- } else {
- indent = indentOfLine( bottomLine );
- }
- } else if ( okay(typedIn, '#') && firstCh == QChar('#') ) {
- /*
- Preprocessor directives go flush left.
- */
- indent = 0;
- } else {
- if ( isUnfinishedLine() ) {
- indent = indentForContinuationLine();
- } else {
- indent = indentForStandaloneLine();
- }
-
- if ( okay(typedIn, '}') && firstCh == QChar('}') ) {
- /*
- A closing brace is one level more to the left than the
- code it follows.
- */
- indent -= ppIndentSize;
- } else if ( okay(typedIn, ':') ) {
- QRegExp caseLabel(
- "\\s*(?:case\\b(?:[^:]|::)+"
- "|(?:public|protected|private|signals|default)(?:\\s+slots)?\\s*"
- ")?:.*" );
-
- if ( caseLabel.exactMatch(bottomLine) ) {
- /*
- Move a case label (or the ':' in front of a
- constructor initialization list) one level to the
- left, but only if the user did not play around with
- it yet. Some users have exotic tastes in the
- matter, and most users probably are not patient
- enough to wait for the final ':' to format their
- code properly.
-
- We don't attempt the same for goto labels, as the
- user is probably the middle of "foo::bar". (Who
- uses goto, anyway?)
- */
- if ( indentOfLine(bottomLine) <= indent )
- indent -= ppIndentSize;
- else
- indent = indentOfLine( bottomLine );
- }
- }
- }
- delete yyProgram;
- terminateIndenter();
- return qMax( 0, indent );
-}
-
-QT_END_NAMESPACE
-
-#ifdef Q_TEST_YYINDENT
-/*
- Test driver.
-*/
-
-#include <qfile.h>
-#include <qtextstream.h>
-
-#include <errno.h>
-
-QT_BEGIN_NAMESPACE
-
-static QString fileContents( const QString& fileName )
-{
- QFile f( fileName );
- if ( !f.open(QFile::ReadOnly) ) {
- qWarning( "yyindent error: Cannot open file '%s' for reading: %s",
- fileName.toLatin1().data(), strerror(errno) );
- return QString();
- }
-
- QTextStream t( &f );
- QString contents = t.read();
- f.close();
- if ( contents.isEmpty() )
- qWarning( "yyindent error: File '%s' is empty", fileName.toLatin1().data() );
- return contents;
-}
-
-QT_END_NAMESPACE
-
-int main( int argc, char **argv )
-{
- QT_USE_NAMESPACE
-
- if ( argc != 2 ) {
- qWarning( "usage: yyindent file.cpp" );
- return 1;
- }
-
- QString code = fileContents( argv[1] );
- QStringList program = QStringList::split( '\n', code, true );
- QStringList p;
- QString out;
-
- while ( !program.isEmpty() && program.last().trimmed().isEmpty() )
- program.remove( program.fromLast() );
-
- QStringList::ConstIterator line = program.constBegin();
- while ( line != program.constEnd() ) {
- p.push_back( *line );
- QChar typedIn = firstNonWhiteSpace( *line );
- if ( p.last().endsWith(QLatin1Char(':')) )
- typedIn = ':';
-
- int indent = indentForBottomLine( p, typedIn );
-
- if ( !(*line).trimmed().isEmpty() ) {
- for ( int j = 0; j < indent; j++ )
- out += QLatin1Char(' ');
- out += (*line).trimmed();
- }
- out += QLatin1Char('\n');
- ++line;
- }
-
- while ( out.endsWith(QLatin1Char('\n')) )
- out.truncate( out.length() - 1 );
-
- printf( "%s\n", out.toLatin1().data() );
- return 0;
-}
-
-#endif // Q_TEST_YYINDENT
diff --git a/src/tools/qlalr/compress.cpp b/src/tools/qlalr/compress.cpp
index 247b284421..fa67504a08 100644
--- a/src/tools/qlalr/compress.cpp
+++ b/src/tools/qlalr/compress.cpp
@@ -183,7 +183,7 @@ void Compress::operator () (int *table, int row_count, int column_count)
index.fill (-999999, row_count);
- foreach (UncompressedRow row, sortedTable)
+ foreach (const UncompressedRow &row, sortedTable)
{
int first_token = std::distance (row.begin (), row.beginNonZeros ());
QVector<int>::iterator pos = info.begin ();
diff --git a/src/tools/qlalr/cppgenerator.cpp b/src/tools/qlalr/cppgenerator.cpp
index 80f7a4ed2b..3005690e6e 100644
--- a/src/tools/qlalr/cppgenerator.cpp
+++ b/src/tools/qlalr/cppgenerator.cpp
@@ -163,7 +163,7 @@ void CppGenerator::operator () ()
if (item->rule == grammar.goal)
accept_state = q;
- foreach (Name s, lookaheads)
+ foreach (const Name &s, lookaheads)
{
int &u = ACTION (q, aut.id (s));
@@ -616,7 +616,7 @@ void CppGenerator::generateImpl (QTextStream &out)
out << name_ids.value(rule->lhs);
- foreach (Name n, rule->rhs)
+ foreach (const Name &n, rule->rhs)
out << ", " << name_ids.value (n);
}
out << "};" << endl << endl;
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index 3d780cd618..537051956e 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -367,7 +367,7 @@ void Automaton::closure (StatePointer state)
if (_M_grammar->isNonTerminal (*item->dot))
{
- foreach (RulePointer rule, _M_grammar->rule_map.values (*item->dot))
+ foreach (const RulePointer &rule, _M_grammar->rule_map.values (*item->dot))
{
Item ii;
ii.rule = rule;
@@ -413,7 +413,7 @@ void Automaton::buildLookbackSets ()
if (! _M_grammar->isNonTerminal (A))
continue;
- foreach (RulePointer rule, _M_grammar->rule_map.values (A))
+ foreach (const RulePointer &rule, _M_grammar->rule_map.values (A))
{
StatePointer q = p;
@@ -606,7 +606,7 @@ void Automaton::buildIncludesDigraph ()
if (! _M_grammar->isNonTerminal (name))
continue;
- foreach (RulePointer rule, _M_grammar->rule_map.values (name))
+ foreach (const RulePointer &rule, _M_grammar->rule_map.values (name))
{
StatePointer p = pp;
@@ -706,7 +706,7 @@ void Automaton::buildLookaheads ()
{
for (ItemPointer item = p->closure.begin (); item != p->closure.end (); ++item)
{
- foreach (Lookback lookback, lookbacks.values (item))
+ foreach (const Lookback &lookback, lookbacks.values (item))
{
StatePointer q = lookback.state;
diff --git a/src/tools/qlalr/lalr.h b/src/tools/qlalr/lalr.h
index 138b1bb876..bdd6609ba6 100644
--- a/src/tools/qlalr/lalr.h
+++ b/src/tools/qlalr/lalr.h
@@ -396,6 +396,9 @@ public:
StatePointer state;
Name nt;
};
+QT_BEGIN_NAMESPACE
+Q_DECLARE_TYPEINFO(OrderedSet<Node<Read> >::const_iterator, Q_PRIMITIVE_TYPE);
+QT_END_NAMESPACE
class Include
{
@@ -417,6 +420,9 @@ public:
StatePointer state;
Name nt;
};
+QT_BEGIN_NAMESPACE
+Q_DECLARE_TYPEINFO(OrderedSet<Node<Include> >::const_iterator, Q_PRIMITIVE_TYPE);
+QT_END_NAMESPACE
class Automaton
{
diff --git a/src/tools/qlalr/parsetable.cpp b/src/tools/qlalr/parsetable.cpp
index 8b62e597ef..77e2219987 100644
--- a/src/tools/qlalr/parsetable.cpp
+++ b/src/tools/qlalr/parsetable.cpp
@@ -91,7 +91,7 @@ void ParseTable::operator () (Automaton *aut)
first = false;
- foreach (Name la, aut->lookaheads.value (item))
+ foreach (const Name &la, aut->lookaheads.value (item))
out << " " << *la << " reduce using rule " << aut->id (item->rule) << " (" << *item->rule->lhs << ")" << endl;
}
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 7bd1ac0bc6..40e77c9876 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -366,6 +366,7 @@ enum RCCXmlTag {
ResourceTag,
FileTag
};
+Q_DECLARE_TYPEINFO(RCCXmlTag, Q_PRIMITIVE_TYPE);
bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
const QString &fname, QString currentPath, bool ignoreErrors)
@@ -938,10 +939,14 @@ bool RCCResourceLibrary::writeDataNames()
return true;
}
-static bool qt_rcc_compare_hash(const RCCFileInfo *left, const RCCFileInfo *right)
+struct qt_rcc_compare_hash
{
- return qt_hash(left->m_name) < qt_hash(right->m_name);
-}
+ typedef bool result_type;
+ result_type operator()(const RCCFileInfo *left, const RCCFileInfo *right) const
+ {
+ return qt_hash(left->m_name) < qt_hash(right->m_name);
+ }
+};
bool RCCResourceLibrary::writeDataStructure()
{
@@ -963,7 +968,7 @@ bool RCCResourceLibrary::writeDataStructure()
//sort by hash value for binary lookup
QList<RCCFileInfo*> m_children = file->m_children.values();
- std::sort(m_children.begin(), m_children.end(), qt_rcc_compare_hash);
+ std::sort(m_children.begin(), m_children.end(), qt_rcc_compare_hash());
//write out the actual data now
for (int i = 0; i < m_children.size(); ++i) {
@@ -982,7 +987,7 @@ bool RCCResourceLibrary::writeDataStructure()
//sort by hash value for binary lookup
QList<RCCFileInfo*> m_children = file->m_children.values();
- std::sort(m_children.begin(), m_children.end(), qt_rcc_compare_hash);
+ std::sort(m_children.begin(), m_children.end(), qt_rcc_compare_hash());
//write out the actual data now
for (int i = 0; i < m_children.size(); ++i) {
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index 6e7888c62b..e4f1aedb7e 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -36,7 +36,6 @@
#include "treewalker.h"
-#include <qhash.h>
#include <qmap.h>
#include <qset.h>
#include <qstring.h>
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index 940017d063..930a648d57 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -969,10 +969,10 @@ QT_CLASS_LIB(QTextEdit, QtWidgets, qtextedit.h)
QT_CLASS_LIB(QToolBar, QtWidgets, qtoolbar.h)
QT_CLASS_LIB(QToolBox, QtWidgets, qtoolbox.h)
QT_CLASS_LIB(QToolButton, QtWidgets, qtoolbutton.h)
-QT_CLASS_LIB(QValidator, QtWidgets, qvalidator.h)
-QT_CLASS_LIB(QIntValidator, QtWidgets, qvalidator.h)
-QT_CLASS_LIB(QDoubleValidator, QtWidgets, qvalidator.h)
-QT_CLASS_LIB(QRegExpValidator, QtWidgets, qvalidator.h)
+QT_CLASS_LIB(QValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QIntValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QDoubleValidator, QtGui, qvalidator.h)
+QT_CLASS_LIB(QRegExpValidator, QtGui, qvalidator.h)
QT_CLASS_LIB(QScriptEngineDebugger, QtScriptTools, qscriptenginedebugger.h)
QT_CLASS_LIB(QDesignerComponents, QtDesigner, qdesigner_components.h)
QT_CLASS_LIB(QExtensionFactory, QtDesigner, default_extensionfactory.h)
diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp
index d765368367..acde63d301 100644
--- a/src/tools/uic/ui4.cpp
+++ b/src/tools/uic/ui4.cpp
@@ -144,14 +144,14 @@ void DomUI::read(QXmlStreamReader &reader)
continue;
}
if (name == QLatin1String("stdsetdef")) {
- setAttributeStdsetdef(attribute.value().toString().toInt());
+ setAttributeStdsetdef(attribute.value().toInt());
continue;
}
if (name == QLatin1String("stdSetDef")) {
- setAttributeStdSetDef(attribute.value().toString().toInt());
+ setAttributeStdSetDef(attribute.value().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -250,7 +250,7 @@ void DomUI::read(QXmlStreamReader &reader)
setElementButtonGroups(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -714,7 +714,7 @@ void DomIncludes::read(QXmlStreamReader &reader)
m_include.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -787,14 +787,14 @@ void DomInclude::read(QXmlStreamReader &reader)
setAttributeImpldecl(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -860,7 +860,7 @@ void DomResources::read(QXmlStreamReader &reader)
setAttributeName(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -873,7 +873,7 @@ void DomResources::read(QXmlStreamReader &reader)
m_include.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -942,14 +942,14 @@ void DomResource::read(QXmlStreamReader &reader)
setAttributeLocation(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1024,7 +1024,7 @@ void DomActionGroup::read(QXmlStreamReader &reader)
setAttributeName(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -1055,7 +1055,7 @@ void DomActionGroup::read(QXmlStreamReader &reader)
m_attribute.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1168,7 +1168,7 @@ void DomAction::read(QXmlStreamReader &reader)
setAttributeMenu(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -1187,7 +1187,7 @@ void DomAction::read(QXmlStreamReader &reader)
m_attribute.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1269,14 +1269,14 @@ void DomActionRef::read(QXmlStreamReader &reader)
setAttributeName(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1343,7 +1343,7 @@ void DomButtonGroup::read(QXmlStreamReader &reader)
setAttributeName(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -1362,7 +1362,7 @@ void DomButtonGroup::read(QXmlStreamReader &reader)
m_attribute.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1447,7 +1447,7 @@ void DomButtonGroups::read(QXmlStreamReader &reader)
m_buttonGroup.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1519,7 +1519,7 @@ void DomImages::read(QXmlStreamReader &reader)
m_image.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1589,7 +1589,7 @@ void DomImage::read(QXmlStreamReader &reader)
setAttributeName(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -1602,7 +1602,7 @@ void DomImage::read(QXmlStreamReader &reader)
setElementData(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1693,17 +1693,17 @@ void DomImageData::read(QXmlStreamReader &reader)
continue;
}
if (name == QLatin1String("length")) {
- setAttributeLength(attribute.value().toString().toInt());
+ setAttributeLength(attribute.value().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1771,7 +1771,7 @@ void DomCustomWidgets::read(QXmlStreamReader &reader)
m_customWidget.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1838,14 +1838,14 @@ void DomHeader::read(QXmlStreamReader &reader)
setAttributeLocation(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -1992,7 +1992,7 @@ void DomCustomWidget::read(QXmlStreamReader &reader)
setElementPropertyspecifications(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2311,7 +2311,7 @@ void DomProperties::read(QXmlStreamReader &reader)
m_property.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2377,14 +2377,14 @@ void DomPropertyData::read(QXmlStreamReader &reader)
setAttributeType(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2451,7 +2451,7 @@ void DomSizePolicyData::read(QXmlStreamReader &reader)
setElementVerData(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2540,21 +2540,21 @@ void DomLayoutDefault::read(QXmlStreamReader &reader)
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("spacing")) {
- setAttributeSpacing(attribute.value().toString().toInt());
+ setAttributeSpacing(attribute.value().toInt());
continue;
}
if (name == QLatin1String("margin")) {
- setAttributeMargin(attribute.value().toString().toInt());
+ setAttributeMargin(attribute.value().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2622,14 +2622,14 @@ void DomLayoutFunction::read(QXmlStreamReader &reader)
setAttributeMargin(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2693,7 +2693,7 @@ void DomTabStops::read(QXmlStreamReader &reader)
m_tabStop.append(reader.readElementText());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2807,7 +2807,7 @@ void DomLayout::read(QXmlStreamReader &reader)
setAttributeColumnMinimumWidth(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -2832,7 +2832,7 @@ void DomLayout::read(QXmlStreamReader &reader)
m_item.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -2966,26 +2966,26 @@ void DomLayoutItem::read(QXmlStreamReader &reader)
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
- setAttributeRow(attribute.value().toString().toInt());
+ setAttributeRow(attribute.value().toInt());
continue;
}
if (name == QLatin1String("column")) {
- setAttributeColumn(attribute.value().toString().toInt());
+ setAttributeColumn(attribute.value().toInt());
continue;
}
if (name == QLatin1String("rowspan")) {
- setAttributeRowSpan(attribute.value().toString().toInt());
+ setAttributeRowSpan(attribute.value().toInt());
continue;
}
if (name == QLatin1String("colspan")) {
- setAttributeColSpan(attribute.value().toString().toInt());
+ setAttributeColSpan(attribute.value().toInt());
continue;
}
if (name == QLatin1String("alignment")) {
setAttributeAlignment(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -3010,7 +3010,7 @@ void DomLayoutItem::read(QXmlStreamReader &reader)
setElementSpacer(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3154,7 +3154,7 @@ void DomRow::read(QXmlStreamReader &reader)
m_property.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3226,7 +3226,7 @@ void DomColumn::read(QXmlStreamReader &reader)
m_property.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3303,14 +3303,14 @@ void DomItem::read(QXmlStreamReader &reader)
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("row")) {
- setAttributeRow(attribute.value().toString().toInt());
+ setAttributeRow(attribute.value().toInt());
continue;
}
if (name == QLatin1String("column")) {
- setAttributeColumn(attribute.value().toString().toInt());
+ setAttributeColumn(attribute.value().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -3329,7 +3329,7 @@ void DomItem::read(QXmlStreamReader &reader)
m_item.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3474,10 +3474,10 @@ void DomWidget::read(QXmlStreamReader &reader)
continue;
}
if (name == QLatin1String("native")) {
- setAttributeNative(attribute.value().toString() == QLatin1String("true"));
+ setAttributeNative(attribute.value() == QLatin1String("true"));
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -3564,7 +3564,7 @@ void DomWidget::read(QXmlStreamReader &reader)
m_zOrder.append(reader.readElementText());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3773,7 +3773,7 @@ void DomSpacer::read(QXmlStreamReader &reader)
setAttributeName(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -3786,7 +3786,7 @@ void DomSpacer::read(QXmlStreamReader &reader)
m_property.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3860,10 +3860,10 @@ void DomColor::read(QXmlStreamReader &reader)
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("alpha")) {
- setAttributeAlpha(attribute.value().toString().toInt());
+ setAttributeAlpha(attribute.value().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -3882,7 +3882,7 @@ void DomColor::read(QXmlStreamReader &reader)
setElementBlue(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -3989,10 +3989,10 @@ void DomGradientStop::read(QXmlStreamReader &reader)
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("position")) {
- setAttributePosition(attribute.value().toString().toDouble());
+ setAttributePosition(attribute.value().toDouble());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -4005,7 +4005,7 @@ void DomGradientStop::read(QXmlStreamReader &reader)
setElementColor(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -4135,43 +4135,43 @@ void DomGradient::read(QXmlStreamReader &reader)
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("startx")) {
- setAttributeStartX(attribute.value().toString().toDouble());
+ setAttributeStartX(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("starty")) {
- setAttributeStartY(attribute.value().toString().toDouble());
+ setAttributeStartY(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("endx")) {
- setAttributeEndX(attribute.value().toString().toDouble());
+ setAttributeEndX(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("endy")) {
- setAttributeEndY(attribute.value().toString().toDouble());
+ setAttributeEndY(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("centralx")) {
- setAttributeCentralX(attribute.value().toString().toDouble());
+ setAttributeCentralX(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("centraly")) {
- setAttributeCentralY(attribute.value().toString().toDouble());
+ setAttributeCentralY(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("focalx")) {
- setAttributeFocalX(attribute.value().toString().toDouble());
+ setAttributeFocalX(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("focaly")) {
- setAttributeFocalY(attribute.value().toString().toDouble());
+ setAttributeFocalY(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("radius")) {
- setAttributeRadius(attribute.value().toString().toDouble());
+ setAttributeRadius(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("angle")) {
- setAttributeAngle(attribute.value().toString().toDouble());
+ setAttributeAngle(attribute.value().toDouble());
continue;
}
if (name == QLatin1String("type")) {
@@ -4186,7 +4186,7 @@ void DomGradient::read(QXmlStreamReader &reader)
setAttributeCoordinateMode(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -4199,7 +4199,7 @@ void DomGradient::read(QXmlStreamReader &reader)
m_gradientStop.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -4318,7 +4318,7 @@ void DomBrush::read(QXmlStreamReader &reader)
setAttributeBrushStyle(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -4343,7 +4343,7 @@ void DomBrush::read(QXmlStreamReader &reader)
setElementGradient(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -4473,7 +4473,7 @@ void DomColorRole::read(QXmlStreamReader &reader)
setAttributeRole(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -4486,7 +4486,7 @@ void DomColorRole::read(QXmlStreamReader &reader)
setElementBrush(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -4587,7 +4587,7 @@ void DomColorGroup::read(QXmlStreamReader &reader)
m_color.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -4689,7 +4689,7 @@ void DomPalette::read(QXmlStreamReader &reader)
setElementDisabled(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -4875,7 +4875,7 @@ void DomFont::read(QXmlStreamReader &reader)
setElementKerning(reader.readElementText() == QLatin1String("true"));
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5089,7 +5089,7 @@ void DomPoint::read(QXmlStreamReader &reader)
setElementY(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5195,7 +5195,7 @@ void DomRect::read(QXmlStreamReader &reader)
setElementHeight(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5317,14 +5317,14 @@ void DomLocale::read(QXmlStreamReader &reader)
setAttributeCountry(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5400,7 +5400,7 @@ void DomSizePolicy::read(QXmlStreamReader &reader)
setAttributeVSizeType(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -5423,7 +5423,7 @@ void DomSizePolicy::read(QXmlStreamReader &reader)
setElementVerStretch(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5553,7 +5553,7 @@ void DomSize::read(QXmlStreamReader &reader)
setElementHeight(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5653,7 +5653,7 @@ void DomDate::read(QXmlStreamReader &reader)
setElementDay(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5768,7 +5768,7 @@ void DomTime::read(QXmlStreamReader &reader)
setElementSecond(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -5901,7 +5901,7 @@ void DomDateTime::read(QXmlStreamReader &reader)
setElementDay(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6061,7 +6061,7 @@ void DomStringList::read(QXmlStreamReader &reader)
setAttributeExtraComment(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -6072,7 +6072,7 @@ void DomStringList::read(QXmlStreamReader &reader)
m_string.append(reader.readElementText());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6154,14 +6154,14 @@ void DomResourcePixmap::read(QXmlStreamReader &reader)
setAttributeAlias(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6262,7 +6262,7 @@ void DomResourceIcon::read(QXmlStreamReader &reader)
setAttributeResource(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -6317,7 +6317,7 @@ void DomResourceIcon::read(QXmlStreamReader &reader)
setElementSelectedOn(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6600,14 +6600,14 @@ void DomString::read(QXmlStreamReader &reader)
setAttributeExtraComment(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6680,7 +6680,7 @@ void DomPointF::read(QXmlStreamReader &reader)
setElementY(reader.readElementText().toDouble());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6786,7 +6786,7 @@ void DomRectF::read(QXmlStreamReader &reader)
setElementHeight(reader.readElementText().toDouble());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6910,7 +6910,7 @@ void DomSizeF::read(QXmlStreamReader &reader)
setElementHeight(reader.readElementText().toDouble());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -6998,7 +6998,7 @@ void DomChar::read(QXmlStreamReader &reader)
setElementUnicode(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -7075,7 +7075,7 @@ void DomUrl::read(QXmlStreamReader &reader)
setElementString(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -7262,10 +7262,10 @@ void DomProperty::read(QXmlStreamReader &reader)
continue;
}
if (name == QLatin1String("stdset")) {
- setAttributeStdset(attribute.value().toString().toInt());
+ setAttributeStdset(attribute.value().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -7446,7 +7446,7 @@ void DomProperty::read(QXmlStreamReader &reader)
setElementBrush(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8091,7 +8091,7 @@ void DomConnections::read(QXmlStreamReader &reader)
m_connection.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8179,7 +8179,7 @@ void DomConnection::read(QXmlStreamReader &reader)
setElementHints(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8327,7 +8327,7 @@ void DomConnectionHints::read(QXmlStreamReader &reader)
m_hint.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8397,7 +8397,7 @@ void DomConnectionHint::read(QXmlStreamReader &reader)
setAttributeType(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ reader.raiseError(QLatin1String("Unexpected attribute ") + name);
}
for (bool finished = false; !finished && !reader.hasError();) {
@@ -8412,7 +8412,7 @@ void DomConnectionHint::read(QXmlStreamReader &reader)
setElementY(reader.readElementText().toInt());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8507,14 +8507,14 @@ void DomScript::read(QXmlStreamReader &reader)
setAttributeLanguage(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8582,7 +8582,7 @@ void DomWidgetData::read(QXmlStreamReader &reader)
m_property.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8654,7 +8654,7 @@ void DomDesignerData::read(QXmlStreamReader &reader)
m_property.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8728,7 +8728,7 @@ void DomSlots::read(QXmlStreamReader &reader)
m_slot.append(reader.readElementText());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8776,6 +8776,8 @@ void DomSlots::setElementSlot(const QStringList& a)
void DomPropertySpecifications::clear(bool clear_all)
{
+ qDeleteAll(m_tooltip);
+ m_tooltip.clear();
qDeleteAll(m_stringpropertyspecification);
m_stringpropertyspecification.clear();
@@ -8793,6 +8795,8 @@ DomPropertySpecifications::DomPropertySpecifications()
DomPropertySpecifications::~DomPropertySpecifications()
{
+ qDeleteAll(m_tooltip);
+ m_tooltip.clear();
qDeleteAll(m_stringpropertyspecification);
m_stringpropertyspecification.clear();
}
@@ -8804,13 +8808,19 @@ void DomPropertySpecifications::read(QXmlStreamReader &reader)
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
const QString tag = reader.name().toString().toLower();
+ if (tag == QLatin1String("tooltip")) {
+ DomPropertyToolTip *v = new DomPropertyToolTip();
+ v->read(reader);
+ m_tooltip.append(v);
+ continue;
+ }
if (tag == QLatin1String("stringpropertyspecification")) {
DomStringPropertySpecification *v = new DomStringPropertySpecification();
v->read(reader);
m_stringpropertyspecification.append(v);
continue;
}
- reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
@@ -8830,6 +8840,10 @@ void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &t
{
writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertyspecifications") : tagName.toLower());
+ for (int i = 0; i < m_tooltip.size(); ++i) {
+ DomPropertyToolTip* v = m_tooltip[i];
+ v->write(writer, QStringLiteral("tooltip"));
+ }
for (int i = 0; i < m_stringpropertyspecification.size(); ++i) {
DomStringPropertySpecification* v = m_stringpropertyspecification[i];
v->write(writer, QStringLiteral("stringpropertyspecification"));
@@ -8840,12 +8854,84 @@ void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &t
writer.writeEndElement();
}
+void DomPropertySpecifications::setElementTooltip(const QList<DomPropertyToolTip*>& a)
+{
+ m_children |= Tooltip;
+ m_tooltip = a;
+}
+
void DomPropertySpecifications::setElementStringpropertyspecification(const QList<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)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.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();
+ 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 DomPropertyToolTip::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("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)
{
@@ -8888,14 +8974,14 @@ void DomStringPropertySpecification::read(QXmlStreamReader &reader)
setAttributeNotr(attribute.value().toString());
continue;
}
- reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ 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(QStringLiteral("Unexpected element ") + tag);
+ reader.raiseError(QLatin1String("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
diff --git a/src/tools/uic/ui4.h b/src/tools/uic/ui4.h
index 60685c9111..1e5bcbf0ab 100644
--- a/src/tools/uic/ui4.h
+++ b/src/tools/uic/ui4.h
@@ -144,6 +144,7 @@ class DomWidgetData;
class DomDesignerData;
class DomSlots;
class DomPropertySpecifications;
+class DomPropertyToolTip;
class DomStringPropertySpecification;
/*******************************************************************************
@@ -3541,6 +3542,9 @@ public:
// attribute accessors
// child element accessors
+ inline QList<DomPropertyToolTip*> elementTooltip() const { return m_tooltip; }
+ void setElementTooltip(const QList<DomPropertyToolTip*>& a);
+
inline QList<DomStringPropertySpecification*> elementStringpropertyspecification() const { return m_stringpropertyspecification; }
void setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a);
@@ -3551,15 +3555,49 @@ private:
// attribute data
// child element data
uint m_children;
+ QList<DomPropertyToolTip*> m_tooltip;
QList<DomStringPropertySpecification*> m_stringpropertyspecification;
enum Child {
- Stringpropertyspecification = 1
+ Tooltip = 1,
+ Stringpropertyspecification = 2
};
DomPropertySpecifications(const DomPropertySpecifications &other);
void operator = (const DomPropertySpecifications&other);
};
+class QDESIGNER_UILIB_EXPORT DomPropertyToolTip {
+public:
+ DomPropertyToolTip();
+ ~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 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);
+};
+
class QDESIGNER_UILIB_EXPORT DomStringPropertySpecification {
public:
DomStringPropertySpecification();
diff --git a/src/tools/uic/uic.h b/src/tools/uic/uic.h
index e88326f0da..b65b662473 100644
--- a/src/tools/uic/uic.h
+++ b/src/tools/uic/uic.h
@@ -38,7 +38,6 @@
#include "customwidgetsinfo.h"
#include <qstring.h>
#include <qstringlist.h>
-#include <qhash.h>
#include <qstack.h>
#include <qxmlstream.h>
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 6e985c86e8..ba87fead3c 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -172,7 +172,7 @@ QAccessibleTabBar::QAccessibleTabBar(QWidget *w)
QAccessibleTabBar::~QAccessibleTabBar()
{
- foreach (QAccessible::Id id, m_childInterfaces.values())
+ foreach (QAccessible::Id id, m_childInterfaces)
QAccessible::deleteAccessibleInterface(id);
}
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index 6534d51a45..1b724c9a17 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -94,7 +94,7 @@ bool QAccessibleTable::isValid() const
QAccessibleTable::~QAccessibleTable()
{
- Q_FOREACH (QAccessible::Id id, childToId.values())
+ Q_FOREACH (QAccessible::Id id, childToId)
QAccessible::deleteAccessibleInterface(id);
}
@@ -198,7 +198,9 @@ QList<QAccessibleInterface *> QAccessibleTable::selectedCells() const
QList<QAccessibleInterface*> cells;
if (!view()->selectionModel())
return cells;
- Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedIndexes())
+ const QModelIndexList selectedIndexes = view()->selectionModel()->selectedIndexes();
+ cells.reserve(selectedIndexes.size());
+ Q_FOREACH (const QModelIndex &index, selectedIndexes)
cells.append(child(logicalIndex(index)));
return cells;
}
@@ -208,9 +210,11 @@ QList<int> QAccessibleTable::selectedColumns() const
if (!view()->selectionModel())
return QList<int>();
QList<int> columns;
- Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedColumns()) {
+ const QModelIndexList selectedColumns = view()->selectionModel()->selectedColumns();
+ columns.reserve(selectedColumns.size());
+ Q_FOREACH (const QModelIndex &index, selectedColumns)
columns.append(index.column());
- }
+
return columns;
}
@@ -219,9 +223,11 @@ QList<int> QAccessibleTable::selectedRows() const
if (!view()->selectionModel())
return QList<int>();
QList<int> rows;
- Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedRows()) {
+ const QModelIndexList selectedRows = view()->selectionModel()->selectedRows();
+ rows.reserve(selectedRows.size());
+ Q_FOREACH (const QModelIndex &index, selectedRows)
rows.append(index.row());
- }
+
return rows;
}
@@ -526,7 +532,7 @@ void QAccessibleTable::modelChange(QAccessibleTableModelChangeEvent *event)
switch (event->modelChangeType()) {
case QAccessibleTableModelChangeEvent::ModelReset:
- Q_FOREACH (QAccessible::Id id, childToId.values())
+ Q_FOREACH (QAccessible::Id id, childToId)
QAccessible::deleteAccessibleInterface(id);
childToId.clear();
break;
@@ -1010,6 +1016,9 @@ QAccessible::Role QAccessibleTableCell::role() const
QAccessible::State QAccessibleTableCell::state() const
{
QAccessible::State st;
+ if (!view)
+ return st;
+
QRect globalRect = view->rect();
globalRect.translate(view->mapToGlobal(QPoint(0,0)));
if (!globalRect.intersects(rect()))
diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h
index a1b6a6db9f..6a18a1231b 100644
--- a/src/widgets/accessible/itemviews_p.h
+++ b/src/widgets/accessible/itemviews_p.h
@@ -172,13 +172,13 @@ public:
QAccessibleTableCell(QAbstractItemView *view, const QModelIndex &m_index, QAccessible::Role role);
void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
- QObject *object() const Q_DECL_OVERRIDE { return 0; }
+ QObject *object() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
QAccessible::Role role() const Q_DECL_OVERRIDE;
QAccessible::State state() const Q_DECL_OVERRIDE;
QRect rect() const Q_DECL_OVERRIDE;
bool isValid() const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return 0; }
+ QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return Q_NULLPTR; }
int childCount() const Q_DECL_OVERRIDE { return 0; }
int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
@@ -224,13 +224,13 @@ public:
// For header cells, pass the header view in addition
QAccessibleTableHeaderCell(QAbstractItemView *view, int index, Qt::Orientation orientation);
- QObject *object() const Q_DECL_OVERRIDE { return 0; }
+ QObject *object() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
QAccessible::Role role() const Q_DECL_OVERRIDE;
QAccessible::State state() const Q_DECL_OVERRIDE;
QRect rect() const Q_DECL_OVERRIDE;
bool isValid() const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return 0; }
+ QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return Q_NULLPTR; }
int childCount() const Q_DECL_OVERRIDE { return 0; }
int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
@@ -261,13 +261,13 @@ public:
:view(view_)
{}
- QObject *object() const Q_DECL_OVERRIDE { return 0; }
+ QObject *object() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
QAccessible::Role role() const Q_DECL_OVERRIDE { return QAccessible::Pane; }
QAccessible::State state() const Q_DECL_OVERRIDE { return QAccessible::State(); }
QRect rect() const Q_DECL_OVERRIDE { return QRect(); }
bool isValid() const Q_DECL_OVERRIDE { return true; }
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return 0; }
+ QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return Q_NULLPTR; }
int childCount() const Q_DECL_OVERRIDE { return 0; }
int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
@@ -278,7 +278,7 @@ public:
return QAccessible::queryAccessibleInterface(view);
}
QAccessibleInterface *child(int) const Q_DECL_OVERRIDE {
- return 0;
+ return Q_NULLPTR;
}
private:
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory_p.h b/src/widgets/accessible/qaccessiblewidgetfactory_p.h
index caa37dcf81..d94f2d1cb2 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory_p.h
+++ b/src/widgets/accessible/qaccessiblewidgetfactory_p.h
@@ -40,8 +40,8 @@
// 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
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp
index 604c754ea1..adf908b821 100644
--- a/src/widgets/accessible/qaccessiblewidgets.cpp
+++ b/src/widgets/accessible/qaccessiblewidgets.cpp
@@ -826,6 +826,9 @@ QString QAccessibleTextWidget::attributes(int offset, int *startOffset, int *end
attrs["text-underline-type"] = QStringLiteral("single"); // if underlineStyleValue is set, there is an underline, and Qt does not support other than single ones
} // else both are "none" which is the default - no need to set them
+ if (block.textDirection() == Qt::RightToLeft)
+ attrs["writing-mode"] = QStringLiteral("rl");
+
QTextCharFormat::VerticalAlignment alignment = charFormat.verticalAlignment();
attrs["text-position"] = QString::fromLatin1((alignment == QTextCharFormat::AlignSubScript) ? "sub" : ((alignment == QTextCharFormat::AlignSuperScript) ? "super" : "baseline" ));
diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri
index a5b4883db8..4f4a9b1517 100644
--- a/src/widgets/dialogs/dialogs.pri
+++ b/src/widgets/dialogs/dialogs.pri
@@ -2,7 +2,6 @@
HEADERS += \
dialogs/qcolordialog.h \
- dialogs/qcolordialog_p.h \
dialogs/qfscompleter_p.h \
dialogs/qdialog.h \
dialogs/qdialog_p.h \
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 5f3161f39f..468bffe49e 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#include "qcolordialog_p.h"
+#include "qcolordialog.h"
#ifndef QT_NO_COLORDIALOG
@@ -49,6 +49,7 @@
#include "qpixmap.h"
#include "qpushbutton.h"
#include "qsettings.h"
+#include "qsharedpointer.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qvalidator.h"
@@ -58,13 +59,115 @@
#include "qscreen.h"
#include "qcursor.h"
#include "qtimer.h"
+#include "qwindow.h"
+
+#include "private/qdialog_p.h"
#include <algorithm>
QT_BEGIN_NAMESPACE
+namespace {
+class QColorLuminancePicker;
+class QColorPicker;
+class QColorShower;
+class QWellArray;
+class QColorPickingEventFilter;
+} // unnamed namespace
+
+class QColorDialogPrivate : public QDialogPrivate
+{
+ Q_DECLARE_PUBLIC(QColorDialog)
+
+public:
+ enum SetColorMode {
+ ShowColor = 0x1,
+ SelectColor = 0x2,
+ SetColorAll = ShowColor | SelectColor
+ };
+
+ QColorDialogPrivate() : options(new QColorDialogOptions)
+#ifdef Q_OS_WIN32
+ , updateTimer(0)
+#endif
+ {}
+
+ QPlatformColorDialogHelper *platformColorDialogHelper() const
+ { return static_cast<QPlatformColorDialogHelper *>(platformHelper()); }
+
+ void init(const QColor &initial);
+ void initWidgets();
+ QRgb currentColor() const;
+ QColor currentQColor() const;
+ void setCurrentColor(const QColor &color, SetColorMode setColorMode = SetColorAll);
+ void setCurrentRgbColor(QRgb rgb);
+ void setCurrentQColor(const QColor &color);
+ bool selectColor(const QColor &color);
+ QColor grabScreenColor(const QPoint &p);
+
+ int currentAlpha() const;
+ void setCurrentAlpha(int a);
+ void showAlpha(bool b);
+ bool isAlphaVisible() const;
+ void retranslateStrings();
+
+ void _q_addCustom();
+
+ void _q_newHsv(int h, int s, int v);
+ void _q_newColorTypedIn(QRgb rgb);
+ void _q_nextCustom(int, int);
+ void _q_newCustom(int, int);
+ void _q_newStandard(int, int);
+ void _q_pickScreenColor();
+ void _q_updateColorPicking();
+ void updateColorLabelText(const QPoint &);
+ void updateColorPicking(const QPoint &pos);
+ void releaseColorPicking();
+ bool handleColorPickingMouseMove(QMouseEvent *e);
+ bool handleColorPickingMouseButtonRelease(QMouseEvent *e);
+ bool handleColorPickingKeyPress(QKeyEvent *e);
+
+ bool canBeNativeDialog() const Q_DECL_OVERRIDE;
+
+ QWellArray *custom;
+ QWellArray *standard;
+
+ QDialogButtonBox *buttons;
+ QVBoxLayout *leftLay;
+ QColorPicker *cp;
+ QColorLuminancePicker *lp;
+ QColorShower *cs;
+ QLabel *lblBasicColors;
+ QLabel *lblCustomColors;
+ QLabel *lblScreenColorInfo;
+ QPushButton *ok;
+ QPushButton *cancel;
+ QPushButton *addCusBt;
+ QPushButton *screenColorPickerButton;
+ QColor selectedQColor;
+ int nextCust;
+ bool smallDisplay;
+ bool screenColorPicking;
+ QColorPickingEventFilter *colorPickingEventFilter;
+ QRgb beforeScreenColorPicking;
+ QSharedPointer<QColorDialogOptions> options;
+
+ QPointer<QObject> receiverToDisconnectOnClose;
+ QByteArray memberToDisconnectOnClose;
+#ifdef Q_OS_WIN32
+ QTimer *updateTimer;
+ QWindow dummyTransparentWindow;
+#endif
+
+private:
+ virtual void initHelper(QPlatformDialogHelper *h) Q_DECL_OVERRIDE;
+ virtual void helperPrepareShow(QPlatformDialogHelper *h) Q_DECL_OVERRIDE;
+};
+
//////////// QWellArray BEGIN
+namespace {
+
struct QWellArrayData;
class QWellArray : public QWidget
@@ -446,6 +549,8 @@ private:
QColorDialogPrivate *m_dp;
};
+} // unnamed namespace
+
/*!
Returns the number of custom colors supported by QColorDialog. All
color dialogs share the same custom colors.
@@ -506,6 +611,8 @@ static inline void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
c.getHsv(&h, &s, &v);
}
+namespace {
+
class QColorWell : public QWellArray
{
public:
@@ -975,8 +1082,8 @@ private:
QColorDialog *colorDialog;
QGridLayout *gl;
- friend class QColorDialog;
- friend class QColorDialogPrivate;
+ friend class QT_PREPEND_NAMESPACE(QColorDialog);
+ friend class QT_PREPEND_NAMESPACE(QColorDialogPrivate);
};
class QColorShowLabel : public QFrame
@@ -1265,6 +1372,8 @@ QColorShower::QColorShower(QColorDialog *parent)
retranslateStrings();
}
+} // unnamed namespace
+
inline QRgb QColorDialogPrivate::currentColor() const { return cs->currentColor(); }
inline int QColorDialogPrivate::currentAlpha() const { return cs->currentAlpha(); }
inline void QColorDialogPrivate::setCurrentAlpha(int a) { cs->setCurrentAlpha(a); }
@@ -1605,9 +1714,6 @@ void QColorDialogPrivate::init(const QColor &initial)
if (!nativeDialogInUse)
initWidgets();
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
- delegate = 0;
-#endif
#ifdef Q_OS_WIN32
dummyTransparentWindow.resize(1, 1);
dummyTransparentWindow.setFlags(Qt::Tool | Qt::FramelessWindowHint);
@@ -2009,11 +2115,6 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const
\sa color, colorSelected()
*/
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
-// can only have one Cocoa color panel active
-bool QColorDialogPrivate::sharedColorPanelAvailable = true;
-#endif
-
/*!
\fn void QColorDialog::colorSelected(const QColor &color);
@@ -2040,23 +2141,6 @@ void QColorDialog::setVisible(bool visible)
if (visible)
d->selectedQColor = QColor();
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
- if (visible) {
- if (d->delegate || (QColorDialogPrivate::sharedColorPanelAvailable &&
- !(testAttribute(Qt::WA_DontShowOnScreen) || (d->opts & DontUseNativeDialog)))){
- d->openCocoaColorPanel(currentColor(), parentWidget(), windowTitle(), options());
- QColorDialogPrivate::sharedColorPanelAvailable = false;
- setAttribute(Qt::WA_DontShowOnScreen);
- }
- setWindowFlags(windowModality() == Qt::WindowModal ? Qt::Sheet : DefaultWindowFlags);
- } else {
- if (d->delegate) {
- d->closeCocoaColorPanel();
- setAttribute(Qt::WA_DontShowOnScreen, false);
- }
- }
-#else
-
if (d->nativeDialogInUse) {
d->setNativeDialogVisible(visible);
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
@@ -2065,7 +2149,6 @@ void QColorDialog::setVisible(bool visible)
} else {
setAttribute(Qt::WA_DontShowOnScreen, false);
}
-#endif
QDialog::setVisible(visible);
}
@@ -2141,13 +2224,7 @@ QRgb QColorDialog::getRgba(QRgb initial, bool *ok, QWidget *parent)
QColorDialog::~QColorDialog()
{
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
- Q_D(QColorDialog);
- if (d->delegate) {
- d->releaseCocoaColorPanelDelegate();
- QColorDialogPrivate::sharedColorPanelAvailable = true;
- }
-#endif
+
}
/*!
@@ -2209,16 +2286,12 @@ bool QColorDialogPrivate::handleColorPickingMouseButtonRelease(QMouseEvent *e)
bool QColorDialogPrivate::handleColorPickingKeyPress(QKeyEvent *e)
{
Q_Q(QColorDialog);
- switch (e->key()) {
- case Qt::Key_Escape:
+ if (e->matches(QKeySequence::Cancel)) {
releaseColorPicking();
q->setCurrentColor(beforeScreenColorPicking);
- break;
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
q->setCurrentColor(grabScreenColor(QCursor::pos()));
releaseColorPicking();
- break;
}
e->accept();
return true;
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index 16339f56c4..de18e6f9ed 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -61,8 +61,8 @@ public:
Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
- explicit QColorDialog(QWidget *parent = 0);
- explicit QColorDialog(const QColor &initial, QWidget *parent = 0);
+ explicit QColorDialog(QWidget *parent = Q_NULLPTR);
+ explicit QColorDialog(const QColor &initial, QWidget *parent = Q_NULLPTR);
~QColorDialog();
void setCurrentColor(const QColor &color);
@@ -81,12 +81,12 @@ public:
void setVisible(bool visible) Q_DECL_OVERRIDE;
static QColor getColor(const QColor &initial = Qt::white,
- QWidget *parent = 0,
+ QWidget *parent = Q_NULLPTR,
const QString &title = QString(),
- ColorDialogOptions options = 0);
+ ColorDialogOptions options = ColorDialogOptions());
// obsolete
- static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = 0, QWidget *parent = 0);
+ static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
static int customCount();
static QColor customColor(int index);
@@ -113,7 +113,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_newStandard(int, int))
Q_PRIVATE_SLOT(d_func(), void _q_pickScreenColor())
Q_PRIVATE_SLOT(d_func(), void _q_updateColorPicking())
- friend class QColorShower;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions)
diff --git a/src/widgets/dialogs/qcolordialog_p.h b/src/widgets/dialogs/qcolordialog_p.h
deleted file mode 100644
index 1a881eae70..0000000000
--- a/src/widgets/dialogs/qcolordialog_p.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtWidgets module 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 QCOLORDIALOG_P_H
-#define QCOLORDIALOG_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
-// to version without notice, or even be removed.
-//
-// We mean it.
-//
-//
-
-#include "private/qdialog_p.h"
-#include "qcolordialog.h"
-#include "qsharedpointer.h"
-#include "qwindow.h"
-
-#ifndef QT_NO_COLORDIALOG
-
-QT_BEGIN_NAMESPACE
-
-class QColorLuminancePicker;
-class QColorPicker;
-class QColorShower;
-class QDialogButtonBox;
-class QLabel;
-class QVBoxLayout;
-class QPushButton;
-class QWellArray;
-class QColorPickingEventFilter;
-class QTimer;
-
-class QColorDialogPrivate : public QDialogPrivate
-{
- Q_DECLARE_PUBLIC(QColorDialog)
-
-public:
- enum SetColorMode {
- ShowColor = 0x1,
- SelectColor = 0x2,
- SetColorAll = ShowColor | SelectColor
- };
-
- QColorDialogPrivate() : options(new QColorDialogOptions)
-#ifdef Q_OS_WIN32
- , updateTimer(0)
-#endif
- {}
-
- QPlatformColorDialogHelper *platformColorDialogHelper() const
- { return static_cast<QPlatformColorDialogHelper *>(platformHelper()); }
-
- void init(const QColor &initial);
- void initWidgets();
- QRgb currentColor() const;
- QColor currentQColor() const;
- void setCurrentColor(const QColor &color, SetColorMode setColorMode = SetColorAll);
- void setCurrentRgbColor(QRgb rgb);
- void setCurrentQColor(const QColor &color);
- bool selectColor(const QColor &color);
- QColor grabScreenColor(const QPoint &p);
-
- int currentAlpha() const;
- void setCurrentAlpha(int a);
- void showAlpha(bool b);
- bool isAlphaVisible() const;
- void retranslateStrings();
-
- void _q_addCustom();
-
- void _q_newHsv(int h, int s, int v);
- void _q_newColorTypedIn(QRgb rgb);
- void _q_nextCustom(int, int);
- void _q_newCustom(int, int);
- void _q_newStandard(int, int);
- void _q_pickScreenColor();
- void _q_updateColorPicking();
- void updateColorLabelText(const QPoint &);
- void updateColorPicking(const QPoint &pos);
- void releaseColorPicking();
- bool handleColorPickingMouseMove(QMouseEvent *e);
- bool handleColorPickingMouseButtonRelease(QMouseEvent *e);
- bool handleColorPickingKeyPress(QKeyEvent *e);
-
- bool canBeNativeDialog() const Q_DECL_OVERRIDE;
-
- QWellArray *custom;
- QWellArray *standard;
-
- QDialogButtonBox *buttons;
- QVBoxLayout *leftLay;
- QColorPicker *cp;
- QColorLuminancePicker *lp;
- QColorShower *cs;
- QLabel *lblBasicColors;
- QLabel *lblCustomColors;
- QLabel *lblScreenColorInfo;
- QPushButton *ok;
- QPushButton *cancel;
- QPushButton *addCusBt;
- QPushButton *screenColorPickerButton;
- QColor selectedQColor;
- int nextCust;
- bool smallDisplay;
- bool screenColorPicking;
- QColorPickingEventFilter *colorPickingEventFilter;
- QRgb beforeScreenColorPicking;
- QSharedPointer<QColorDialogOptions> options;
-
- QPointer<QObject> receiverToDisconnectOnClose;
- QByteArray memberToDisconnectOnClose;
-#ifdef Q_OS_WIN32
- QTimer *updateTimer;
- QWindow dummyTransparentWindow;
-#endif
-
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
- void openCocoaColorPanel(const QColor &initial,
- QWidget *parent, const QString &title, QColorDialog::ColorDialogOptions options);
- void closeCocoaColorPanel();
- void releaseCocoaColorPanelDelegate();
- void setCocoaPanelColor(const QColor &color);
-
- inline void done(int result) { q_func()->done(result); }
- inline QColorDialog *colorDialog() { return q_func(); }
-
- void *delegate;
-
- static bool sharedColorPanelAvailable;
-
- void _q_macRunNativeAppModalPanel();
- void mac_nativeDialogModalHelp();
-#endif
-private:
- virtual void initHelper(QPlatformDialogHelper *h) Q_DECL_OVERRIDE;
- virtual void helperPrepareShow(QPlatformDialogHelper *h) Q_DECL_OVERRIDE;
-};
-
-#endif // QT_NO_COLORDIALOG
-
-QT_END_NAMESPACE
-
-#endif // QCOLORDIALOG_P_H
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 054c220b84..5124960ab4 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -243,7 +243,7 @@ void QDialogPrivate::deletePlatformHelper()
\section1 Escape Key
If the user presses the Esc key in a dialog, QDialog::reject()
- will be called. This will cause the window to close: The \l{QCloseEvent}{close event} cannot be \l{QCloseEvent::ignore()}{ignored}.
+ will be called. This will cause the window to close: The \l{QCloseEvent}{close event} cannot be \l{QEvent::ignore()}{ignored}.
\section1 Extensibility
@@ -565,7 +565,7 @@ int QDialog::exec()
last window closed, the QApplication::lastWindowClosed() signal is
emitted.
- \sa accept(), reject(), QApplication::activeWindow(), QApplication::quit()
+ \sa accept(), reject(), QApplication::activeWindow(), QCoreApplication::quit()
*/
void QDialog::done(int r)
@@ -651,11 +651,9 @@ void QDialog::keyPressEvent(QKeyEvent *e)
// Calls reject() if Escape is pressed. Simulates a button
// click for the default button if Enter is pressed. Move focus
// for the arrow keys. Ignore the rest.
-#ifdef Q_OS_MAC
- if(e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period) {
+ if (e->matches(QKeySequence::Cancel)) {
reject();
} else
-#endif
if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
switch (e->key()) {
case Qt::Key_Enter:
@@ -671,9 +669,6 @@ void QDialog::keyPressEvent(QKeyEvent *e)
}
}
break;
- case Qt::Key_Escape:
- reject();
- break;
default:
e->ignore();
return;
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index cd53378f9a..5ea5375387 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -51,7 +51,7 @@ class Q_WIDGETS_EXPORT QDialog : public QWidget
Q_PROPERTY(bool modal READ isModal WRITE setModal)
public:
- explicit QDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
+ explicit QDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~QDialog();
enum DialogCode { Rejected, Accepted };
@@ -90,7 +90,7 @@ public Q_SLOTS:
void showExtension(bool);
protected:
- QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0);
+ QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
#if defined(Q_OS_WINCE)
bool event(QEvent *e);
diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp
index 4c3a5497d4..855bae3c9f 100644
--- a/src/widgets/dialogs/qerrormessage.cpp
+++ b/src/widgets/dialogs/qerrormessage.cpp
@@ -47,9 +47,10 @@
#include "qpixmap.h"
#include "qmetaobject.h"
#include "qthread.h"
-#include "qqueue.h"
#include "qset.h"
+#include <queue>
+
#include <stdio.h>
#include <stdlib.h>
@@ -68,16 +69,18 @@ public:
QCheckBox * again;
QTextEdit * errors;
QLabel * icon;
- QQueue<QPair<QString, QString> > pending;
+ std::queue<QPair<QString, QString> > pending;
QSet<QString> doNotShow;
QSet<QString> doNotShowType;
QString currentMessage;
QString currentType;
+ bool isMessageToBeShown(const QString &message, const QString &type) const;
bool nextPending();
void retranslateStrings();
};
+namespace {
class QErrorMessageTextView : public QTextEdit
{
public:
@@ -87,6 +90,7 @@ public:
virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
virtual QSize sizeHint() const Q_DECL_OVERRIDE;
};
+} // unnamed namespace
QSize QErrorMessageTextView::minimumSizeHint() const
{
@@ -217,29 +221,32 @@ QErrorMessage::QErrorMessage(QWidget * parent)
: QDialog(*new QErrorMessagePrivate, parent)
{
Q_D(QErrorMessage);
- QGridLayout * grid = new QGridLayout(this);
+
d->icon = new QLabel(this);
-#ifndef QT_NO_MESSAGEBOX
- d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
- d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
-#endif
- grid->addWidget(d->icon, 0, 0, Qt::AlignTop);
d->errors = new QErrorMessageTextView(this);
- grid->addWidget(d->errors, 0, 1);
d->again = new QCheckBox(this);
- d->again->setChecked(true);
- grid->addWidget(d->again, 1, 1, Qt::AlignTop);
d->ok = new QPushButton(this);
+ QGridLayout * grid = new QGridLayout(this);
+
+ connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
+ grid->addWidget(d->icon, 0, 0, Qt::AlignTop);
+ grid->addWidget(d->errors, 0, 1);
+ grid->addWidget(d->again, 1, 1, Qt::AlignTop);
+ grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
+ grid->setColumnStretch(1, 42);
+ grid->setRowStretch(0, 42);
+#ifndef QT_NO_MESSAGEBOX
+ d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
+ d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
+#endif
+ d->again->setChecked(true);
#if defined(Q_OS_WINCE)
d->ok->setFixedSize(0,0);
#endif
- connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
d->ok->setFocus();
- grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
- grid->setColumnStretch(1, 42);
- grid->setRowStretch(0, 42);
+
d->retranslateStrings();
}
@@ -265,11 +272,13 @@ QErrorMessage::~QErrorMessage()
void QErrorMessage::done(int a)
{
Q_D(QErrorMessage);
- if (!d->again->isChecked() && !d->currentMessage.isEmpty() && d->currentType.isEmpty()) {
- d->doNotShow.insert(d->currentMessage);
- }
- if (!d->again->isChecked() && !d->currentType.isEmpty()) {
- d->doNotShowType.insert(d->currentType);
+ if (!d->again->isChecked()) {
+ if (d->currentType.isEmpty()) {
+ if (!d->currentMessage.isEmpty())
+ d->doNotShow.insert(d->currentMessage);
+ } else {
+ d->doNotShowType.insert(d->currentType);
+ }
}
d->currentMessage.clear();
d->currentType.clear();
@@ -301,20 +310,27 @@ QErrorMessage * QErrorMessage::qtHandler()
/*! \internal */
+bool QErrorMessagePrivate::isMessageToBeShown(const QString &message, const QString &type) const
+{
+ return !message.isEmpty()
+ && (type.isEmpty() ? !doNotShow.contains(message) : !doNotShowType.contains(type));
+}
+
bool QErrorMessagePrivate::nextPending()
{
- while (!pending.isEmpty()) {
- QPair<QString,QString> pendingMessage = pending.dequeue();
- QString message = pendingMessage.first;
- QString type = pendingMessage.second;
- if (!message.isEmpty() && ((type.isEmpty() && !doNotShow.contains(message)) || (!type.isEmpty() && !doNotShowType.contains(type)))) {
+ while (!pending.empty()) {
+ QPair<QString,QString> &pendingMessage = pending.front();
+ QString message = qMove(pendingMessage.first);
+ QString type = qMove(pendingMessage.second);
+ pending.pop();
+ if (isMessageToBeShown(message, type)) {
#ifndef QT_NO_TEXTHTMLPARSER
errors->setHtml(message);
#else
errors->setPlainText(message);
#endif
- currentMessage = message;
- currentType = type;
+ currentMessage = qMove(message);
+ currentType = qMove(type);
return true;
}
}
@@ -333,12 +349,7 @@ bool QErrorMessagePrivate::nextPending()
void QErrorMessage::showMessage(const QString &message)
{
- Q_D(QErrorMessage);
- if (d->doNotShow.contains(message))
- return;
- d->pending.enqueue(qMakePair(message,QString()));
- if (!isVisible() && d->nextPending())
- show();
+ showMessage(message, QString());
}
/*!
@@ -358,9 +369,9 @@ void QErrorMessage::showMessage(const QString &message)
void QErrorMessage::showMessage(const QString &message, const QString &type)
{
Q_D(QErrorMessage);
- if (d->doNotShow.contains(message) && d->doNotShowType.contains(type))
+ if (!d->isMessageToBeShown(message, type))
return;
- d->pending.push_back(qMakePair(message,type));
+ d->pending.push(qMakePair(message, type));
if (!isVisible() && d->nextPending())
show();
}
diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h
index 55d0b389b1..1d69515dfb 100644
--- a/src/widgets/dialogs/qerrormessage.h
+++ b/src/widgets/dialogs/qerrormessage.h
@@ -48,7 +48,7 @@ class Q_WIDGETS_EXPORT QErrorMessage: public QDialog
Q_OBJECT
Q_DECLARE_PRIVATE(QErrorMessage)
public:
- explicit QErrorMessage(QWidget* parent = 0);
+ explicit QErrorMessage(QWidget* parent = Q_NULLPTR);
~QErrorMessage();
static QErrorMessage * qtHandler();
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 4e0d70fb9a..06102ec1d6 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -330,14 +330,8 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
*/
QT_BEGIN_INCLUDE_NAMESPACE
-#ifdef Q_DEAD_CODE_FROM_QT4_WIN
-#include <qwindowsstyle_p.h>
-#endif
#include <QMetaEnum>
#include <qshortcut.h>
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
-#include <qmacstyle_mac_p.h>
-#endif
QT_END_INCLUDE_NAMESPACE
/*!
@@ -983,7 +977,7 @@ void QFileDialog::setDirectoryUrl(const QUrl &directory)
else if (directory.isLocalFile())
setDirectory(directory.toLocalFile());
else if (d->usingWidgets())
- qWarning() << "Non-native QFileDialog supports only local files";
+ qWarning("Non-native QFileDialog supports only local files");
}
/*!
@@ -1093,7 +1087,7 @@ void QFileDialog::selectUrl(const QUrl &url)
else if (url.isLocalFile())
selectFile(url.toLocalFile());
else
- qWarning() << "Non-native QFileDialog supports only local files";
+ qWarning("Non-native QFileDialog supports only local files");
}
#ifdef Q_OS_UNIX
@@ -1191,12 +1185,17 @@ QList<QUrl> QFileDialogPrivate::userSelectedFiles() const
if (!usingWidgets())
return addDefaultSuffixToUrls(selectedFiles_sys());
- foreach (const QModelIndex &index, qFileDialogUi->listView->selectionModel()->selectedRows())
+ const QModelIndexList selectedRows = qFileDialogUi->listView->selectionModel()->selectedRows();
+ files.reserve(selectedRows.size());
+ foreach (const QModelIndex &index, selectedRows)
files.append(QUrl::fromLocalFile(index.data(QFileSystemModel::FilePathRole).toString()));
- if (files.isEmpty() && !lineEdit()->text().isEmpty())
- foreach (const QString &path, typedFiles())
+ if (files.isEmpty() && !lineEdit()->text().isEmpty()) {
+ const QStringList typedFilesList = typedFiles();
+ files.reserve(typedFilesList.size());
+ foreach (const QString &path, typedFilesList)
files.append(QUrl::fromLocalFile(path));
+ }
return files;
}
@@ -1230,7 +1229,9 @@ QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList &files
QList<QUrl> QFileDialogPrivate::addDefaultSuffixToUrls(const QList<QUrl> &urlsToFix) const
{
QList<QUrl> urls;
- for (int i=0; i<urlsToFix.size(); ++i) {
+ const int numUrlsToFix = urlsToFix.size();
+ urls.reserve(numUrlsToFix);
+ for (int i = 0; i < numUrlsToFix; ++i) {
QUrl url = urlsToFix.at(i);
// if the filename has no suffix, add the default suffix
const QString defaultSuffix = options->defaultSuffix();
@@ -1254,7 +1255,9 @@ QStringList QFileDialog::selectedFiles() const
Q_D(const QFileDialog);
QStringList files;
- foreach (const QUrl &file, d->userSelectedFiles())
+ const QList<QUrl> userSelectedFiles = d->userSelectedFiles();
+ files.reserve(userSelectedFiles.size());
+ foreach (const QUrl &file, userSelectedFiles)
files.append(file.toLocalFile());
if (files.isEmpty() && d->usingWidgets()) {
const FileMode fm = fileMode();
@@ -1279,7 +1282,9 @@ QList<QUrl> QFileDialog::selectedUrls() const
return d->userSelectedFiles();
} else {
QList<QUrl> urls;
- foreach (const QString &file, selectedFiles())
+ const QStringList selectedFileList = selectedFiles();
+ urls.reserve(selectedFileList.size());
+ foreach (const QString &file, selectedFileList)
urls.append(QUrl::fromLocalFile(file));
return urls;
}
@@ -1358,7 +1363,9 @@ QStringList qt_strip_filters(const QStringList &filters)
{
QStringList strippedFilters;
QRegExp r(QString::fromLatin1(QPlatformFileDialogHelper::filterRegExp));
- for (int i = 0; i < filters.count(); ++i) {
+ const int numFilters = filters.count();
+ strippedFilters.reserve(numFilters);
+ for (int i = 0; i < numFilters; ++i) {
QString filterName;
int index = r.indexIn(filters[i]);
if (index >= 0)
@@ -1393,7 +1400,9 @@ void QFileDialog::setNameFilters(const QStringList &filters)
Q_D(QFileDialog);
d->defaultFileTypes = (filters == QStringList(QFileDialog::tr("All Files (*)")));
QStringList cleanedFilters;
- for (int i = 0; i < filters.count(); ++i) {
+ const int numFilters = filters.count();
+ cleanedFilters.reserve(numFilters);
+ for (int i = 0; i < numFilters; ++i) {
cleanedFilters << filters[i].simplified();
}
d->options->setNameFilters(cleanedFilters);
@@ -1693,6 +1702,30 @@ void QFileDialog::setAcceptMode(QFileDialog::AcceptMode mode)
d->retranslateWindowTitle();
}
+/*!
+ \property QFileDialog::supportedSchemes
+ \brief the URL schemes that the file dialog should allow navigating to.
+ \since 5.6
+
+ Setting this property allows to restrict the type of URLs the
+ user will be able to select. It is a way for the application to declare
+ the protocols it will support to fetch the file content. An empty list
+ means that no restriction is applied (the default).
+ Supported for local files ("file" scheme) is implicit and always enabled;
+ it is not necessary to include it in the restriction.
+*/
+
+void QFileDialog::setSupportedSchemes(const QStringList &schemes)
+{
+ Q_D(QFileDialog);
+ d->options->setSupportedSchemes(schemes);
+}
+
+QStringList QFileDialog::supportedSchemes() const
+{
+ return d_func()->options->supportedSchemes();
+}
+
/*
Returns the file system model index that is the root index in the
views
@@ -2091,8 +2124,8 @@ QString QFileDialog::getOpenFileName(QWidget *parent,
user will be able to select. It is a way for the application to declare
the protocols it will support to fetch the file content. An empty list
means that no restriction is applied (the default).
- Supported for local files ("file" scheme) is implicit and always enabled.
- it is not necessary to include in the restriction.
+ Supported for local files ("file" scheme) is implicit and always enabled;
+ it is not necessary to include it in the restriction.
When possible, this static function will use the native file dialog and
not a QFileDialog. On platforms which don't support selecting remote
@@ -2109,8 +2142,6 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent,
Options options,
const QStringList &supportedSchemes)
{
- Q_UNUSED(supportedSchemes); // TODO
-
QFileDialogArgs args;
args.parent = parent;
args.caption = caption;
@@ -2121,6 +2152,7 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent,
args.options = options;
QFileDialog dialog(args);
+ dialog.setSupportedSchemes(supportedSchemes);
if (selectedFilter && !selectedFilter->isEmpty())
dialog.selectNameFilter(*selectedFilter);
if (dialog.exec() == QDialog::Accepted) {
@@ -2169,11 +2201,6 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent,
see the QFileDialog::Option enum for more information on the flags you can
pass.
- \note If you want to iterate over the list of files, you should iterate
- over a copy. For example:
-
- \snippet code/src_gui_dialogs_qfiledialog.cpp 10
-
\warning Do not delete \a parent during the execution of the dialog. If you
want to do this, you should create the dialog yourself using one of the
QFileDialog constructors.
@@ -2190,6 +2217,7 @@ QStringList QFileDialog::getOpenFileNames(QWidget *parent,
const QStringList schemes = QStringList(QStringLiteral("file"));
const QList<QUrl> selectedUrls = getOpenFileUrls(parent, caption, QUrl::fromLocalFile(dir), filter, selectedFilter, options, schemes);
QStringList fileNames;
+ fileNames.reserve(selectedUrls.size());
foreach (const QUrl &url, selectedUrls)
fileNames << url.toLocalFile();
return fileNames;
@@ -2213,8 +2241,8 @@ QStringList QFileDialog::getOpenFileNames(QWidget *parent,
user will be able to select. It is a way for the application to declare
the protocols it will support to fetch the file content. An empty list
means that no restriction is applied (the default).
- Supported for local files ("file" scheme) is implicit and always enabled.
- it is not necessary to include in the restriction.
+ Supported for local files ("file" scheme) is implicit and always enabled;
+ it is not necessary to include it in the restriction.
When possible, this static function will use the native file dialog and
not a QFileDialog. On platforms which don't support selecting remote
@@ -2231,8 +2259,6 @@ QList<QUrl> QFileDialog::getOpenFileUrls(QWidget *parent,
Options options,
const QStringList &supportedSchemes)
{
- Q_UNUSED(supportedSchemes);
-
QFileDialogArgs args;
args.parent = parent;
args.caption = caption;
@@ -2243,6 +2269,7 @@ QList<QUrl> QFileDialog::getOpenFileUrls(QWidget *parent,
args.options = options;
QFileDialog dialog(args);
+ dialog.setSupportedSchemes(supportedSchemes);
if (selectedFilter && !selectedFilter->isEmpty())
dialog.selectNameFilter(*selectedFilter);
if (dialog.exec() == QDialog::Accepted) {
@@ -2332,8 +2359,8 @@ QString QFileDialog::getSaveFileName(QWidget *parent,
user will be able to select. It is a way for the application to declare
the protocols it will support to save the file content. An empty list
means that no restriction is applied (the default).
- Supported for local files ("file" scheme) is implicit and always enabled.
- it is not necessary to include in the restriction.
+ Supported for local files ("file" scheme) is implicit and always enabled;
+ it is not necessary to include it in the restriction.
When possible, this static function will use the native file dialog and
not a QFileDialog. On platforms which don't support selecting remote
@@ -2350,8 +2377,6 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent,
Options options,
const QStringList &supportedSchemes)
{
- Q_UNUSED(supportedSchemes);
-
QFileDialogArgs args;
args.parent = parent;
args.caption = caption;
@@ -2362,6 +2387,7 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent,
args.options = options;
QFileDialog dialog(args);
+ dialog.setSupportedSchemes(supportedSchemes);
dialog.setAcceptMode(AcceptSave);
if (selectedFilter && !selectedFilter->isEmpty())
dialog.selectNameFilter(*selectedFilter);
@@ -2442,8 +2468,8 @@ QString QFileDialog::getExistingDirectory(QWidget *parent,
user will be able to select. It is a way for the application to declare
the protocols it will support to fetch the file content. An empty list
means that no restriction is applied (the default).
- Supported for local files ("file" scheme) is implicit and always enabled.
- it is not necessary to include in the restriction.
+ Supported for local files ("file" scheme) is implicit and always enabled;
+ it is not necessary to include it in the restriction.
When possible, this static function will use the native file dialog and
not a QFileDialog. On platforms which don't support selecting remote
@@ -2458,8 +2484,6 @@ QUrl QFileDialog::getExistingDirectoryUrl(QWidget *parent,
Options options,
const QStringList &supportedSchemes)
{
- Q_UNUSED(supportedSchemes);
-
QFileDialogArgs args;
args.parent = parent;
args.caption = caption;
@@ -2468,6 +2492,7 @@ QUrl QFileDialog::getExistingDirectoryUrl(QWidget *parent,
args.options = options;
QFileDialog dialog(args);
+ dialog.setSupportedSchemes(supportedSchemes);
if (dialog.exec() == QDialog::Accepted)
return dialog.selectedUrls().value(0);
return QUrl();
@@ -2669,7 +2694,9 @@ void QFileDialogPrivate::saveSettings()
settings.setValue(QLatin1String("treeViewHeader"), qFileDialogUi->treeView->header()->saveState());
}
QStringList historyUrls;
- foreach (const QString &path, q->history())
+ const QStringList history = q->history();
+ historyUrls.reserve(history.size());
+ foreach (const QString &path, history)
historyUrls << QUrl::fromLocalFile(path).toString();
settings.setValue(QLatin1String("history"), historyUrls);
settings.setValue(QLatin1String("lastVisited"), lastVisitedDir()->toString());
@@ -2795,7 +2822,9 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
qFileDialogUi->sidebar->hide();
#endif
- q->resize(q->sizeHint());
+ const QSize sizeHint = q->sizeHint();
+ if (sizeHint.isValid())
+ q->resize(sizeHint);
}
/*!
@@ -2971,7 +3000,7 @@ void QFileDialogPrivate::createWidgets()
q->setHistory(options->history());
if (options->initiallySelectedFiles().count() == 1)
q->selectFile(options->initiallySelectedFiles().first().fileName());
- foreach (QUrl url, options->initiallySelectedFiles())
+ foreach (const QUrl &url, options->initiallySelectedFiles())
q->selectUrl(url);
lineEdit()->selectAll();
_q_updateOkButton();
@@ -3764,6 +3793,12 @@ void QFileDialogPrivate::_q_nativeEnterDirectory(const QUrl &directory)
bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) {
Q_Q(QFileDialog);
+
+ if (event->matches(QKeySequence::Cancel)) {
+ q->reject();
+ return true;
+ }
+
switch (event->key()) {
case Qt::Key_Backspace:
_q_navigateToParent();
@@ -3779,9 +3814,6 @@ bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) {
return true;
}
break;
- case Qt::Key_Escape:
- q->hide();
- return true;
default:
break;
}
@@ -3792,7 +3824,7 @@ QString QFileDialogPrivate::getEnvironmentVariable(const QString &string)
{
#ifdef Q_OS_UNIX
if (string.size() > 1 && string.startsWith(QLatin1Char('$'))) {
- return QString::fromLocal8Bit(getenv(string.mid(1).toLatin1().constData()));
+ return QString::fromLocal8Bit(qgetenv(string.mid(1).toLatin1().constData()));
}
#else
if (string.size() > 2 && string.startsWith(QLatin1Char('%')) && string.endsWith(QLatin1Char('%'))) {
@@ -3968,7 +4000,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
int key = e->key();
QLineEdit::keyPressEvent(e);
- if (key != Qt::Key_Escape && key != Qt::Key_Back)
+ if (!e->matches(QKeySequence::Cancel) && key != Qt::Key_Back)
e->accept();
}
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index 95209bceb5..ffe49a2dd2 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -66,6 +66,7 @@ class Q_WIDGETS_EXPORT QFileDialog : public QDialog
Q_PROPERTY(bool nameFilterDetailsVisible READ isNameFilterDetailsVisible
WRITE setNameFilterDetailsVisible DESIGNABLE false)
Q_PROPERTY(Options options READ options WRITE setOptions)
+ Q_PROPERTY(QStringList supportedSchemes READ supportedSchemes WRITE setSupportedSchemes)
public:
enum ViewMode { Detail, List };
@@ -91,7 +92,7 @@ public:
Q_DECLARE_FLAGS(Options, Option)
QFileDialog(QWidget *parent, Qt::WindowFlags f);
- explicit QFileDialog(QWidget *parent = 0,
+ explicit QFileDialog(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QString &directory = QString(),
const QString &filter = QString());
@@ -167,6 +168,9 @@ public:
void setLabelText(DialogLabel label, const QString &text);
QString labelText(DialogLabel label) const;
+ void setSupportedSchemes(const QStringList &schemes);
+ QStringList supportedSchemes() const;
+
#ifndef QT_NO_PROXYMODEL
void setProxyModel(QAbstractProxyModel *model);
QAbstractProxyModel *proxyModel() const;
@@ -196,60 +200,60 @@ Q_SIGNALS:
public:
- static QString getOpenFileName(QWidget *parent = 0,
+ static QString getOpenFileName(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
- QString *selectedFilter = 0,
- Options options = 0);
+ QString *selectedFilter = Q_NULLPTR,
+ Options options = Options());
- static QUrl getOpenFileUrl(QWidget *parent = 0,
+ static QUrl getOpenFileUrl(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
const QString &filter = QString(),
- QString *selectedFilter = 0,
- Options options = 0,
+ QString *selectedFilter = Q_NULLPTR,
+ Options options = Options(),
const QStringList &supportedSchemes = QStringList());
- static QString getSaveFileName(QWidget *parent = 0,
+ static QString getSaveFileName(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
- QString *selectedFilter = 0,
- Options options = 0);
+ QString *selectedFilter = Q_NULLPTR,
+ Options options = Options());
- static QUrl getSaveFileUrl(QWidget *parent = 0,
+ static QUrl getSaveFileUrl(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
const QString &filter = QString(),
- QString *selectedFilter = 0,
- Options options = 0,
+ QString *selectedFilter = Q_NULLPTR,
+ Options options = Options(),
const QStringList &supportedSchemes = QStringList());
- static QString getExistingDirectory(QWidget *parent = 0,
+ static QString getExistingDirectory(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QString &dir = QString(),
Options options = ShowDirsOnly);
- static QUrl getExistingDirectoryUrl(QWidget *parent = 0,
+ static QUrl getExistingDirectoryUrl(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
Options options = ShowDirsOnly,
const QStringList &supportedSchemes = QStringList());
- static QStringList getOpenFileNames(QWidget *parent = 0,
+ static QStringList getOpenFileNames(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
- QString *selectedFilter = 0,
- Options options = 0);
+ QString *selectedFilter = Q_NULLPTR,
+ Options options = Options());
- static QList<QUrl> getOpenFileUrls(QWidget *parent = 0,
+ static QList<QUrl> getOpenFileUrls(QWidget *parent = Q_NULLPTR,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
const QString &filter = QString(),
- QString *selectedFilter = 0,
- Options options = 0,
+ QString *selectedFilter = Q_NULLPTR,
+ Options options = Options(),
const QStringList &supportedSchemes = QStringList());
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index 7329019a87..92d6b8f3be 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -287,7 +287,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
}
for (int i = infoList.count() - 1; i >= 0; --i) {
QString driveName = translateDriveName(infoList.at(i));
- QList<QPair<QString,QFileInfo> > updatedFiles;
+ QVector<QPair<QString,QFileInfo> > updatedFiles;
updatedFiles.append(QPair<QString,QFileInfo>(driveName, infoList.at(i)));
emit updates(path, updatedFiles);
}
@@ -298,7 +298,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
base.start();
QFileInfo fileInfo;
bool firstTime = true;
- QList<QPair<QString, QFileInfo> > updatedFiles;
+ QVector<QPair<QString, QFileInfo> > updatedFiles;
QStringList filesToCheck = files;
QString itPath = QDir::fromNativeSeparators(files.isEmpty() ? path : QLatin1String(""));
@@ -324,7 +324,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
emit directoryLoaded(path);
}
-void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) {
+void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) {
updatedFiles.append(QPair<QString, QFileInfo>(fileInfo.fileName(), fileInfo));
QElapsedTimer current;
current.start();
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index 6bd15b5388..03f87fdba5 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -149,7 +149,7 @@ class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread
Q_OBJECT
Q_SIGNALS:
- void updates(const QString &directory, const QList<QPair<QString, QFileInfo> > &updates);
+ void updates(const QString &directory, const QVector<QPair<QString, QFileInfo> > &updates);
void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const;
void nameResolved(const QString &fileName, const QString &resolvedName) const;
void directoryLoaded(const QString &path);
@@ -176,7 +176,7 @@ private:
void run() Q_DECL_OVERRIDE;
// called by run():
void getFileInfos(const QString &path, const QStringList &files);
- void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
+ void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
private:
mutable QMutex mutex;
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 4859231d95..d23737f130 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -39,6 +39,7 @@
#include <qdebug.h>
#include <qmessagebox.h>
#include <qapplication.h>
+#include <QtCore/qcollator.h>
#include <algorithm>
@@ -154,6 +155,11 @@ QT_BEGIN_NAMESPACE
Returns the QFileInfo for the item stored in the model under the given
\a index.
*/
+QFileInfo QFileSystemModel::fileInfo(const QModelIndex &index) const
+{
+ Q_D(const QFileSystemModel);
+ return d->node(index)->fileInfo();
+}
/*!
\fn void QFileSystemModel::rootPathChanged(const QString &newPath);
@@ -192,13 +198,14 @@ QT_BEGIN_NAMESPACE
bool QFileSystemModel::remove(const QModelIndex &aindex)
{
const QString path = filePath(aindex);
+ const bool success = QFileInfo(path).isFile() ? QFile::remove(path) : QDir(path).removeRecursively();
#ifndef QT_NO_FILESYSTEMWATCHER
- QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
- d->fileInfoGatherer.removePath(path);
+ if (success) {
+ QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
+ d->fileInfoGatherer.removePath(path);
+ }
#endif
- if (QFileInfo(path).isFile())
- return QFile::remove(path);
- return QDir(path).removeRecursively();
+ return success;
}
/*!
@@ -243,7 +250,7 @@ QModelIndex QFileSystemModel::index(int row, int column, const QModelIndex &pare
Q_ASSERT(parentNode);
// now get the internal pointer for the index
- QString childName = parentNode->visibleChildren[d->translateVisibleLocation(parentNode, row)];
+ const QString &childName = parentNode->visibleChildren.at(d->translateVisibleLocation(parentNode, row));
const QFileSystemModelPrivate::QFileSystemNode *indexNode = parentNode->children.value(childName);
Q_ASSERT(indexNode);
@@ -259,10 +266,7 @@ QModelIndex QFileSystemModel::index(const QString &path, int column) const
{
Q_D(const QFileSystemModel);
QFileSystemModelPrivate::QFileSystemNode *node = d->node(path, false);
- QModelIndex idx = d->index(node);
- if (idx.column() != column)
- idx = idx.sibling(idx.row(), column);
- return idx;
+ return d->index(node, column);
}
/*!
@@ -375,7 +379,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
{
- if (!pathElements.at(0).contains(QLatin1String(":"))) {
+ if (!pathElements.at(0).contains(QLatin1Char(':'))) {
QString rootPath = QDir(longPath).rootPath();
pathElements.prepend(rootPath);
}
@@ -476,7 +480,7 @@ void QFileSystemModel::timerEvent(QTimerEvent *event)
d->fileInfoGatherer.fetchExtendedInformation(d->toFetch.at(i).dir,
QStringList(d->toFetch.at(i).file));
} else {
- // qDebug() << "yah!, you saved a little gerbil soul";
+ // qDebug("yah!, you saved a little gerbil soul");
}
}
#endif
@@ -562,7 +566,7 @@ QModelIndex QFileSystemModel::parent(const QModelIndex &index) const
return the index for node
*/
-QModelIndex QFileSystemModelPrivate::index(const QFileSystemModelPrivate::QFileSystemNode *node) const
+QModelIndex QFileSystemModelPrivate::index(const QFileSystemModelPrivate::QFileSystemNode *node, int column) const
{
Q_Q(const QFileSystemModel);
QFileSystemModelPrivate::QFileSystemNode *parentNode = (node ? node->parent : 0);
@@ -575,7 +579,7 @@ QModelIndex QFileSystemModelPrivate::index(const QFileSystemModelPrivate::QFileS
return QModelIndex();
int visualRow = translateVisibleLocation(parentNode, parentNode->visibleLocation(node->fileName));
- return q->createIndex(visualRow, 0, const_cast<QFileSystemNode*>(node));
+ return q->createIndex(visualRow, column, const_cast<QFileSystemNode*>(node));
}
/*!
@@ -643,7 +647,7 @@ int QFileSystemModel::rowCount(const QModelIndex &parent) const
*/
int QFileSystemModel::columnCount(const QModelIndex &parent) const
{
- return (parent.column() > 0) ? 0 : 4;
+ return (parent.column() > 0) ? 0 : QFileSystemModelPrivate::NumColumns;
}
/*!
@@ -799,8 +803,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const
#endif
!resolvedSymLinks.isEmpty() && dirNode->isSymLink(/* ignoreNtfsSymLinks = */ true)) {
QString fullPath = QDir::fromNativeSeparators(filePath(index));
- if (resolvedSymLinks.contains(fullPath))
- return resolvedSymLinks[fullPath];
+ return resolvedSymLinks.value(fullPath, dirNode->fileName);
}
return dirNode->fileName;
}
@@ -978,84 +981,6 @@ void QFileSystemModelPrivate::_q_performDelayedSort()
q->sort(sortColumn, sortOrder);
}
-static inline QChar getNextChar(const QString &s, int location)
-{
- return (location < s.length()) ? s.at(location) : QChar();
-}
-
-/*!
- Natural number sort, skips spaces.
-
- Examples:
- 1, 2, 10, 55, 100
- 01.jpg, 2.jpg, 10.jpg
-
- Note on the algorithm:
- Only as many characters as necessary are looked at and at most they all
- are looked at once.
-
- Slower then QString::compare() (of course)
- */
-int QFileSystemModelPrivate::naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs)
-{
- for (int l1 = 0, l2 = 0; l1 <= s1.count() && l2 <= s2.count(); ++l1, ++l2) {
- // skip spaces, tabs and 0's
- QChar c1 = getNextChar(s1, l1);
- while (c1.isSpace())
- c1 = getNextChar(s1, ++l1);
- QChar c2 = getNextChar(s2, l2);
- while (c2.isSpace())
- c2 = getNextChar(s2, ++l2);
-
- if (c1.isDigit() && c2.isDigit()) {
- while (c1.digitValue() == 0)
- c1 = getNextChar(s1, ++l1);
- while (c2.digitValue() == 0)
- c2 = getNextChar(s2, ++l2);
-
- int lookAheadLocation1 = l1;
- int lookAheadLocation2 = l2;
- int currentReturnValue = 0;
- // find the last digit, setting currentReturnValue as we go if it isn't equal
- for (
- QChar lookAhead1 = c1, lookAhead2 = c2;
- (lookAheadLocation1 <= s1.length() && lookAheadLocation2 <= s2.length());
- lookAhead1 = getNextChar(s1, ++lookAheadLocation1),
- lookAhead2 = getNextChar(s2, ++lookAheadLocation2)
- ) {
- bool is1ADigit = !lookAhead1.isNull() && lookAhead1.isDigit();
- bool is2ADigit = !lookAhead2.isNull() && lookAhead2.isDigit();
- if (!is1ADigit && !is2ADigit)
- break;
- if (!is1ADigit)
- return -1;
- if (!is2ADigit)
- return 1;
- if (currentReturnValue == 0) {
- if (lookAhead1 < lookAhead2) {
- currentReturnValue = -1;
- } else if (lookAhead1 > lookAhead2) {
- currentReturnValue = 1;
- }
- }
- }
- if (currentReturnValue != 0)
- return currentReturnValue;
- }
-
- if (cs == Qt::CaseInsensitive) {
- if (!c1.isLower()) c1 = c1.toLower();
- if (!c2.isLower()) c2 = c2.toLower();
- }
- int r = QString::localeAwareCompare(c1, c2);
- if (r < 0)
- return -1;
- if (r > 0)
- return 1;
- }
- // The two strings are the same (02 == 2) so fall back to the normal sort
- return QString::compare(s1, s2, cs);
-}
/*
\internal
@@ -1064,7 +989,11 @@ int QFileSystemModelPrivate::naturalCompare(const QString &s1, const QString &s2
class QFileSystemModelSorter
{
public:
- inline QFileSystemModelSorter(int column) : sortColumn(column) {}
+ inline QFileSystemModelSorter(int column) : sortColumn(column)
+ {
+ naturalCompare.setNumericMode(true);
+ naturalCompare.setCaseSensitivity(Qt::CaseInsensitive);
+ }
bool compareNodes(const QFileSystemModelPrivate::QFileSystemNode *l,
const QFileSystemModelPrivate::QFileSystemNode *r) const
@@ -1078,8 +1007,7 @@ public:
if (left ^ right)
return left;
#endif
- return QFileSystemModelPrivate::naturalCompare(l->fileName,
- r->fileName, Qt::CaseInsensitive) < 0;
+ return naturalCompare.compare(l->fileName, r->fileName) < 0;
}
case 1:
{
@@ -1091,22 +1019,22 @@ public:
qint64 sizeDifference = l->size() - r->size();
if (sizeDifference == 0)
- return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0;
+ return naturalCompare.compare(l->fileName, r->fileName) < 0;
return sizeDifference < 0;
}
case 2:
{
- int compare = QString::localeAwareCompare(l->type(), r->type());
+ int compare = naturalCompare.compare(l->type(), r->type());
if (compare == 0)
- return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0;
+ return naturalCompare.compare(l->fileName, r->fileName) < 0;
return compare < 0;
}
case 3:
{
if (l->lastModified() == r->lastModified())
- return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0;
+ return naturalCompare.compare(l->fileName, r->fileName) < 0;
return l->lastModified() < r->lastModified();
}
@@ -1115,14 +1043,15 @@ public:
return false;
}
- bool operator()(const QPair<QFileSystemModelPrivate::QFileSystemNode*, int> &l,
- const QPair<QFileSystemModelPrivate::QFileSystemNode*, int> &r) const
+ bool operator()(const QFileSystemModelPrivate::QFileSystemNode *l,
+ const QFileSystemModelPrivate::QFileSystemNode *r) const
{
- return compareNodes(l.first, r.first);
+ return compareNodes(l, r);
}
private:
+ QCollator naturalCompare;
int sortColumn;
};
@@ -1138,16 +1067,14 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
if (indexNode->children.count() == 0)
return;
- QList<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > values;
+ QVector<QFileSystemModelPrivate::QFileSystemNode*> values;
QHash<QString, QFileSystemNode *>::const_iterator iterator;
- int i = 0;
for(iterator = indexNode->children.constBegin() ; iterator != indexNode->children.constEnd() ; ++iterator) {
if (filtersAcceptsNode(iterator.value())) {
- values.append(QPair<QFileSystemModelPrivate::QFileSystemNode*, int>((iterator.value()), i));
+ values.append(iterator.value());
} else {
iterator.value()->isVisible = false;
}
- i++;
}
QFileSystemModelSorter ms(column);
std::sort(values.begin(), values.end(), ms);
@@ -1155,9 +1082,11 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
indexNode->visibleChildren.clear();
//No more dirty item we reset our internal dirty index
indexNode->dirtyChildrenIndex = -1;
- for (int i = 0; i < values.count(); ++i) {
- indexNode->visibleChildren.append(values.at(i).first->fileName);
- values.at(i).first->isVisible = true;
+ const int numValues = values.count();
+ indexNode->visibleChildren.reserve(numValues);
+ for (int i = 0; i < numValues; ++i) {
+ indexNode->visibleChildren.append(values.at(i)->fileName);
+ values.at(i)->isVisible = true;
}
if (!disableRecursiveSort) {
@@ -1182,9 +1111,12 @@ void QFileSystemModel::sort(int column, Qt::SortOrder order)
emit layoutAboutToBeChanged();
QModelIndexList oldList = persistentIndexList();
- QList<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > oldNodes;
- for (int i = 0; i < oldList.count(); ++i) {
- QPair<QFileSystemModelPrivate::QFileSystemNode*, int> pair(d->node(oldList.at(i)), oldList.at(i).column());
+ QVector<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > oldNodes;
+ const int nodeCount = oldList.count();
+ oldNodes.reserve(nodeCount);
+ for (int i = 0; i < nodeCount; ++i) {
+ const QModelIndex &oldNode = oldList.at(i);
+ QPair<QFileSystemModelPrivate::QFileSystemNode*, int> pair(d->node(oldNode), oldNode.column());
oldNodes.append(pair);
}
@@ -1197,10 +1129,11 @@ void QFileSystemModel::sort(int column, Qt::SortOrder order)
d->sortOrder = order;
QModelIndexList newList;
- for (int i = 0; i < oldNodes.count(); ++i) {
- QModelIndex idx = d->index(oldNodes.at(i).first);
- idx = idx.sibling(idx.row(), oldNodes.at(i).second);
- newList.append(idx);
+ const int numOldNodes = oldNodes.size();
+ newList.reserve(numOldNodes);
+ for (int i = 0; i < numOldNodes; ++i) {
+ const QPair<QFileSystemModelPrivate::QFileSystemNode*, int> &oldNode = oldNodes.at(i);
+ newList.append(d->index(oldNode.first, oldNode.second));
}
changePersistentIndexList(oldList, newList);
emit layoutChanged();
@@ -1648,7 +1581,9 @@ QStringList QFileSystemModel::nameFilters() const
Q_D(const QFileSystemModel);
QStringList filters;
#ifndef QT_NO_REGEXP
- for (int i = 0; i < d->nameFilters.size(); ++i) {
+ const int numNameFilters = d->nameFilters.size();
+ filters.reserve(numNameFilters);
+ for (int i = 0; i < numNameFilters; ++i) {
filters << d->nameFilters.at(i).pattern();
}
#endif
@@ -1673,11 +1608,14 @@ bool QFileSystemModel::event(QEvent *event)
bool QFileSystemModel::rmdir(const QModelIndex &aindex)
{
QString path = filePath(aindex);
+ const bool success = QDir().rmdir(path);
#ifndef QT_NO_FILESYSTEMWATCHER
- QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
- d->fileInfoGatherer.removePath(path);
+ if (success) {
+ QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
+ d->fileInfoGatherer.removePath(path);
+ }
#endif
- return QDir().rmdir(path);
+ return success;
}
/*!
@@ -1765,26 +1703,6 @@ void QFileSystemModelPrivate::removeNode(QFileSystemModelPrivate::QFileSystemNod
q->endRemoveRows();
}
-/*
- \internal
- Helper functor used by addVisibleFiles()
-*/
-class QFileSystemModelVisibleFinder
-{
-public:
- inline QFileSystemModelVisibleFinder(QFileSystemModelPrivate::QFileSystemNode *node, QFileSystemModelSorter *sorter) : parentNode(node), sorter(sorter) {}
-
- bool operator()(const QString &, QString r) const
- {
- return sorter->compareNodes(parentNode->children.value(name), parentNode->children.value(r));
- }
-
- QString name;
-private:
- QFileSystemModelPrivate::QFileSystemNode *parentNode;
- QFileSystemModelSorter *sorter;
-};
-
/*!
\internal
@@ -1806,9 +1724,9 @@ void QFileSystemModelPrivate::addVisibleFiles(QFileSystemNode *parentNode, const
parentNode->dirtyChildrenIndex = parentNode->visibleChildren.count();
for (int i = 0; i < newFiles.count(); ++i) {
- parentNode->visibleChildren.append(newFiles.at(i));
- parentNode->children[newFiles.at(i)]->isVisible = true;
- }
+ parentNode->visibleChildren.append(newFiles.at(i));
+ parentNode->children.value(newFiles.at(i))->isVisible = true;
+ }
if (!indexHidden)
q->endInsertRows();
}
@@ -1830,7 +1748,7 @@ void QFileSystemModelPrivate::removeVisibleFile(QFileSystemNode *parentNode, int
if (!indexHidden)
q->beginRemoveRows(parent, translateVisibleLocation(parentNode, vLocation),
translateVisibleLocation(parentNode, vLocation));
- parentNode->children[parentNode->visibleChildren.at(vLocation)]->isVisible = false;
+ parentNode->children.value(parentNode->visibleChildren.at(vLocation))->isVisible = false;
parentNode->visibleChildren.removeAt(vLocation);
if (!indexHidden)
q->endRemoveRows();
@@ -1842,7 +1760,7 @@ void QFileSystemModelPrivate::removeVisibleFile(QFileSystemNode *parentNode, int
The thread has received new information about files,
update and emit dataChanged if it has actually changed.
*/
-void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &updates)
+void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &updates)
{
#ifndef QT_NO_FILESYSTEMWATCHER
Q_Q(QFileSystemModel);
@@ -1873,10 +1791,6 @@ void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QL
node->fileName = fileName;
}
- if (info.size() == -1 && !info.isSymLink()) {
- removeNode(parentNode, fileName);
- continue;
- }
if (*node != info ) {
node->populate(info);
bypassFilters.remove(node);
@@ -1961,12 +1875,12 @@ void QFileSystemModelPrivate::_q_resolvedName(const QString &fileName, const QSt
void QFileSystemModelPrivate::init()
{
Q_Q(QFileSystemModel);
- qRegisterMetaType<QList<QPair<QString,QFileInfo> > >();
+ qRegisterMetaType<QVector<QPair<QString,QFileInfo> > >();
#ifndef QT_NO_FILESYSTEMWATCHER
q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(QString,QStringList)),
q, SLOT(_q_directoryChanged(QString,QStringList)));
- q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QList<QPair<QString,QFileInfo> >)),
- q, SLOT(_q_fileSystemChanged(QString,QList<QPair<QString,QFileInfo> >)));
+ q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector<QPair<QString,QFileInfo> >)),
+ q, SLOT(_q_fileSystemChanged(QString,QVector<QPair<QString,QFileInfo> >)));
q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)),
q, SLOT(_q_resolvedName(QString,QString)));
q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)),
diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h
index 7c98a102f3..515417f225 100644
--- a/src/widgets/dialogs/qfilesystemmodel.h
+++ b/src/widgets/dialogs/qfilesystemmodel.h
@@ -69,7 +69,7 @@ public:
FilePermissions = Qt::UserRole + 3
};
- explicit QFileSystemModel(QObject *parent = 0);
+ explicit QFileSystemModel(QObject *parent = Q_NULLPTR);
~QFileSystemModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@@ -132,11 +132,11 @@ public:
inline QString fileName(const QModelIndex &index) const;
inline QIcon fileIcon(const QModelIndex &index) const;
QFile::Permissions permissions(const QModelIndex &index) const;
- inline QFileInfo fileInfo(const QModelIndex &index) const;
+ QFileInfo fileInfo(const QModelIndex &index) const;
bool remove(const QModelIndex &index);
protected:
- QFileSystemModel(QFileSystemModelPrivate &, QObject *parent = 0);
+ QFileSystemModel(QFileSystemModelPrivate &, QObject *parent = Q_NULLPTR);
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
bool event(QEvent *event) Q_DECL_OVERRIDE;
@@ -146,7 +146,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &directory, const QStringList &list))
Q_PRIVATE_SLOT(d_func(), void _q_performDelayedSort())
- Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &))
+ Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &))
Q_PRIVATE_SLOT(d_func(), void _q_resolvedName(const QString &fileName, const QString &resolvedName))
friend class QFileDialogPrivate;
@@ -156,8 +156,6 @@ inline QString QFileSystemModel::fileName(const QModelIndex &aindex) const
{ return aindex.data(Qt::DisplayRole).toString(); }
inline QIcon QFileSystemModel::fileIcon(const QModelIndex &aindex) const
{ return qvariant_cast<QIcon>(aindex.data(Qt::DecorationRole)); }
-inline QFileInfo QFileSystemModel::fileInfo(const QModelIndex &aindex) const
-{ return QFileInfo(filePath(aindex)); }
#endif // QT_NO_FILESYSTEMMODEL
diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h
index dd4b25d59c..d2a40a1cb5 100644
--- a/src/widgets/dialogs/qfilesystemmodel_p.h
+++ b/src/widgets/dialogs/qfilesystemmodel_p.h
@@ -70,6 +70,8 @@ class Q_AUTOTEST_EXPORT QFileSystemModelPrivate : public QAbstractItemModelPriva
Q_DECLARE_PUBLIC(QFileSystemModel)
public:
+ enum { NumColumns = 4 };
+
class QFileSystemNode
{
public:
@@ -105,6 +107,7 @@ public:
return true;
return false;
}
+ inline QFileInfo fileInfo() const { if (info) return info->fileInfo(); return QFileInfo(); }
inline bool isFile() const { if (info) return info->isFile(); return true; }
inline bool isSystem() const { if (info) return info->isSystem(); return true; }
inline bool isHidden() const { if (info) return info->isHidden(); return false; }
@@ -220,8 +223,8 @@ public:
}
QFileSystemNode *node(const QModelIndex &index) const;
QFileSystemNode *node(const QString &path, bool fetch = true) const;
- inline QModelIndex index(const QString &path) { return index(node(path)); }
- QModelIndex index(const QFileSystemNode *node) const;
+ inline QModelIndex index(const QString &path, int column = 0) { return index(node(path), column); }
+ QModelIndex index(const QFileSystemNode *node, int column = 0) const;
bool filtersAcceptsNode(const QFileSystemNode *node) const;
bool passNameFilters(const QFileSystemNode *node) const;
void removeNode(QFileSystemNode *parentNode, const QString &name);
@@ -280,7 +283,7 @@ public:
void _q_directoryChanged(const QString &directory, const QStringList &list);
void _q_performDelayedSort();
- void _q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &);
+ void _q_fileSystemChanged(const QString &path, const QVector<QPair<QString, QFileInfo> > &);
void _q_resolvedName(const QString &fileName, const QString &resolvedName);
static int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs);
@@ -318,6 +321,7 @@ public:
QList<Fetching> toFetch;
};
+Q_DECLARE_TYPEINFO(QFileSystemModelPrivate::Fetching, Q_MOVABLE_TYPE);
#endif // QT_NO_FILESYSTEMMODEL
QT_END_NAMESPACE
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index d47dd3562f..d0177941f7 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -102,6 +102,16 @@ QFontListView::QFontListView(QWidget *parent)
static const Qt::WindowFlags DefaultWindowFlags =
Qt::Dialog | Qt::WindowSystemMenuHint;
+QFontDialogPrivate::QFontDialogPrivate()
+ : writingSystem(QFontDatabase::Any),
+ options(QSharedPointer<QFontDialogOptions>::create())
+{
+}
+
+QFontDialogPrivate::~QFontDialogPrivate()
+{
+}
+
/*!
\class QFontDialog
\ingroup standard-dialogs
@@ -619,6 +629,7 @@ void QFontDialogPrivate::updateSizes()
int i = 0;
int current = -1;
QStringList str_sizes;
+ str_sizes.reserve(sizes.size());
for(QList<int>::const_iterator it = sizes.constBegin(); it != sizes.constEnd(); ++it) {
str_sizes.append(QString::number(*it));
if (current == -1 && *it == size)
diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h
index 8ca9bf14dd..c3c3050174 100644
--- a/src/widgets/dialogs/qfontdialog.h
+++ b/src/widgets/dialogs/qfontdialog.h
@@ -65,8 +65,8 @@ public:
Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
- explicit QFontDialog(QWidget *parent = 0);
- explicit QFontDialog(const QFont &initial, QWidget *parent = 0);
+ explicit QFontDialog(QWidget *parent = Q_NULLPTR);
+ explicit QFontDialog(const QFont &initial, QWidget *parent = Q_NULLPTR);
~QFontDialog();
void setCurrentFont(const QFont &font);
@@ -84,9 +84,9 @@ public:
void setVisible(bool visible) Q_DECL_OVERRIDE;
- static QFont getFont(bool *ok, QWidget *parent = 0);
- static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = 0, const QString &title = QString(),
- FontDialogOptions options = 0);
+ static QFont getFont(bool *ok, QWidget *parent = Q_NULLPTR);
+ static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = Q_NULLPTR, const QString &title = QString(),
+ FontDialogOptions options = FontDialogOptions());
Q_SIGNALS:
void currentFontChanged(const QFont &font);
diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h
index e456faaa61..7b92b67f5c 100644
--- a/src/widgets/dialogs/qfontdialog_p.h
+++ b/src/widgets/dialogs/qfontdialog_p.h
@@ -65,14 +65,13 @@ class QGroupBox;
class QLabel;
class QLineEdit;
-class QFontDialogPrivate : public QDialogPrivate
+class Q_AUTOTEST_EXPORT QFontDialogPrivate : public QDialogPrivate
{
Q_DECLARE_PUBLIC(QFontDialog)
public:
- inline QFontDialogPrivate()
- : writingSystem(QFontDatabase::Any), options(new QFontDialogOptions)
- { }
+ QFontDialogPrivate();
+ ~QFontDialogPrivate();
QPlatformFontDialogHelper *platformFontDialogHelper() const
{ return static_cast<QPlatformFontDialogHelper *>(platformHelper()); }
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 9c78f5e9ac..fb52fa4651 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -791,6 +791,7 @@ QStringList QInputDialog::comboBoxItems() const
QStringList result;
if (d->comboBox) {
const int count = d->comboBox->count();
+ result.reserve(count);
for (int i = 0; i < count; ++i)
result.append(d->comboBox->itemText(i));
}
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index 84130d5f90..600f6c9753 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -83,7 +83,7 @@ public:
DoubleInput
};
- QInputDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ QInputDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QInputDialog();
void setInputMode(InputMode mode);
@@ -153,27 +153,29 @@ public:
static QString getText(QWidget *parent, const QString &title, const QString &label,
QLineEdit::EchoMode echo = QLineEdit::Normal,
- const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0,
+ const QString &text = QString(), bool *ok = Q_NULLPTR,
+ Qt::WindowFlags flags = Qt::WindowFlags(),
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static QString getMultiLineText(QWidget *parent, const QString &title, const QString &label,
- const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0,
- Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
+ const QString &text = QString(), bool *ok = Q_NULLPTR,
+ Qt::WindowFlags flags = Qt::WindowFlags(),
+ Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static QString getItem(QWidget *parent, const QString &title, const QString &label,
const QStringList &items, int current = 0, bool editable = true,
- bool *ok = 0, Qt::WindowFlags flags = 0,
+ bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags(),
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static int getInt(QWidget *parent, const QString &title, const QString &label, int value = 0,
int minValue = -2147483647, int maxValue = 2147483647,
- int step = 1, bool *ok = 0, Qt::WindowFlags flags = 0);
+ int step = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
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 = 0, Qt::WindowFlags flags = 0);
+ int decimals = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static inline int getInteger(QWidget *parent, const QString &title, const QString &label, int value = 0,
int minValue = -2147483647, int maxValue = 2147483647,
- int step = 1, bool *ok = 0, Qt::WindowFlags flags = 0)
+ int step = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags())
{
return getInt(parent, title, label, value, minValue, maxValue, step, ok, flags);
}
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index ef9b55acd6..8a48100ea7 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1450,11 +1450,8 @@ void QMessageBox::changeEvent(QEvent *ev)
void QMessageBox::keyPressEvent(QKeyEvent *e)
{
Q_D(QMessageBox);
- if (e->key() == Qt::Key_Escape
-#ifdef Q_OS_MAC
- || (e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period)
-#endif
- ) {
+
+ if (e->matches(QKeySequence::Cancel)) {
if (d->detectedEscapeButton) {
#ifdef Q_OS_MAC
d->detectedEscapeButton->animateClick();
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index 464bf734dc..b108354466 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -125,9 +125,9 @@ public:
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
- explicit QMessageBox(QWidget *parent = 0);
+ explicit QMessageBox(QWidget *parent = Q_NULLPTR);
QMessageBox(Icon icon, const QString &title, const QString &text,
- StandardButtons buttons = NoButton, QWidget *parent = 0,
+ StandardButtons buttons = NoButton, QWidget *parent = Q_NULLPTR,
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
~QMessageBox();
@@ -198,7 +198,7 @@ public:
QMessageBox(const QString &title, const QString &text, Icon icon,
int button0, int button1, int button2,
- QWidget *parent = 0,
+ QWidget *parent = Q_NULLPTR,
Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
static int information(QWidget *parent, const QString &title,
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 4e8e245813..bbb251c8b2 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -411,7 +411,8 @@ void QProgressDialog::setCancelButton(QPushButton *cancelButton)
if (cancelButton) {
connect(d->cancel, SIGNAL(clicked()), this, SIGNAL(canceled()));
#ifndef QT_NO_SHORTCUT
- d->escapeShortcut = new QShortcut(Qt::Key_Escape, this, SIGNAL(canceled()));
+ // FIXME: This only registers the primary key sequence of the cancel action
+ d->escapeShortcut = new QShortcut(QKeySequence::Cancel, this, SIGNAL(canceled()));
#endif
} else {
#ifndef QT_NO_SHORTCUT
@@ -697,9 +698,6 @@ void QProgressDialog::setValue(int progress)
d->shown_once = true;
}
}
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
- QApplication::flush();
-#endif
}
if (progress == d->bar->maximum() && d->autoReset)
diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h
index 51c45f5d30..28de623385 100644
--- a/src/widgets/dialogs/qprogressdialog.h
+++ b/src/widgets/dialogs/qprogressdialog.h
@@ -61,9 +61,10 @@ class Q_WIDGETS_EXPORT QProgressDialog : public QDialog
Q_PROPERTY(QString labelText READ labelText WRITE setLabelText)
public:
- explicit QProgressDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QProgressDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
QProgressDialog(const QString &labelText, const QString &cancelButtonText,
- int minimum, int maximum, QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ int minimum, int maximum, QWidget *parent = Q_NULLPTR,
+ Qt::WindowFlags flags = Qt::WindowFlags());
~QProgressDialog();
void setLabel(QLabel *label);
diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp
index 6fbcce801d..f883705cc3 100644
--- a/src/widgets/dialogs/qsidebar.cpp
+++ b/src/widgets/dialogs/qsidebar.cpp
@@ -60,6 +60,8 @@ void QSideBarDelegate::initStyleOption(QStyleOptionViewItem *option,
}
/*!
+ \internal
+ \class QUrlModel
QUrlModel lets you have indexes from a QFileSystemModel to a list. When QFileSystemModel
changes them QUrlModel will automatically update.
@@ -274,7 +276,9 @@ void QUrlModel::addUrls(const QList<QUrl> &list, int row, bool move)
QList<QUrl> QUrlModel::urls() const
{
QList<QUrl> list;
- for (int i = 0; i < rowCount(); ++i)
+ const int numRows = rowCount();
+ list.reserve(numRows);
+ for (int i = 0; i < numRows; ++i)
list.append(data(index(i, 0), UrlRole).toUrl());
return list;
}
@@ -334,10 +338,12 @@ void QUrlModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto
void QUrlModel::layoutChanged()
{
QStringList paths;
- for (int i = 0; i < watching.count(); ++i)
+ const int numPaths = watching.count();
+ paths.reserve(numPaths);
+ for (int i = 0; i < numPaths; ++i)
paths.append(watching.at(i).second);
watching.clear();
- for (int i = 0; i < paths.count(); ++i) {
+ for (int i = 0; i < numPaths; ++i) {
QString path = paths.at(i);
QModelIndex newIndex = fileSystemModel->index(path);
watching.append(QPair<QModelIndex, QString>(newIndex, path));
@@ -453,12 +459,14 @@ void QSidebar::removeEntry()
{
QList<QModelIndex> idxs = selectionModel()->selectedIndexes();
QList<QPersistentModelIndex> indexes;
- for (int i = 0; i < idxs.count(); i++)
+ const int numIndexes = idxs.count();
+ for (int i = 0; i < numIndexes; i++)
indexes.append(idxs.at(i));
- for (int i = 0; i < indexes.count(); ++i)
+ for (int i = 0; i < numIndexes; ++i) {
if (!indexes.at(i).data(QUrlModel::UrlRole).toUrl().path().isEmpty())
model()->removeRow(indexes.at(i).row());
+ }
}
/*!
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 139fbc3843..b9906f13da 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -170,6 +170,7 @@ public:
const char *changedSignal)
: className(className), property(property), changedSignal(changedSignal) {}
};
+Q_DECLARE_TYPEINFO(QWizardDefaultProperty, Q_MOVABLE_TYPE);
class QWizardField
{
@@ -189,6 +190,7 @@ public:
QByteArray changedSignal;
QVariant initialValue;
};
+Q_DECLARE_TYPEINFO(QWizardField, Q_MOVABLE_TYPE);
QWizardField::QWizardField(QWizardPage *page, const QString &spec, QObject *object,
const char *property, const char *changedSignal)
@@ -751,6 +753,7 @@ void QWizardPrivate::init()
updateButtonLayout();
+ defaultPropertyTable.reserve(NFallbackDefaultProperties);
for (uint i = 0; i < NFallbackDefaultProperties; ++i)
defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
fallbackProperties[i].property,
@@ -1344,7 +1347,6 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info)
}
if (info.watermark && !info.sideWidget) {
minimumSize.setHeight(mainLayout->totalSizeHint().height());
- maximumSize.setHeight(mainLayout->totalSizeHint().height());
}
if (q->minimumWidth() == minimumWidth) {
minimumWidth = minimumSize.width();
@@ -3660,7 +3662,7 @@ bool QWizardPage::validatePage()
from the rest of your implementation, whenever the value of isComplete()
changes. This ensures that QWizard updates the enabled or disabled state of
its buttons. An example of the reimplementation is
- available \l{http://doc.qt.digia.com/qq/qq22-qwizard.html#validatebeforeitstoolate}
+ available \l{http://doc.qt.io/archives/qq/qq22-qwizard.html#validatebeforeitstoolate}
{here}.
\sa completeChanged(), isFinalPage()
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index 517edde377..9193f0b659 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -114,7 +114,7 @@ public:
Q_DECLARE_FLAGS(WizardOptions, WizardOption)
- explicit QWizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QWizard(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QWizard();
int addPage(QWizardPage *page);
@@ -209,7 +209,7 @@ class Q_WIDGETS_EXPORT QWizardPage : public QWidget
Q_PROPERTY(QString subTitle READ subTitle WRITE setSubTitle)
public:
- explicit QWizardPage(QWidget *parent = 0);
+ explicit QWizardPage(QWidget *parent = Q_NULLPTR);
~QWizardPage();
void setTitle(const QString &title);
@@ -237,8 +237,8 @@ Q_SIGNALS:
protected:
void setField(const QString &name, const QVariant &value);
QVariant field(const QString &name) const;
- void registerField(const QString &name, QWidget *widget, const char *property = 0,
- const char *changedSignal = 0);
+ void registerField(const QString &name, QWidget *widget, const char *property = Q_NULLPTR,
+ const char *changedSignal = Q_NULLPTR);
QWizard *wizard() const;
private:
diff --git a/src/widgets/doc/images/listview.png b/src/widgets/doc/images/listview.png
index fa49c52c62..fa49c52c62 100755..100644
--- a/src/widgets/doc/images/listview.png
+++ b/src/widgets/doc/images/listview.png
Binary files differ
diff --git a/src/widgets/doc/images/modelview-combobox.png b/src/widgets/doc/images/modelview-combobox.png
index d172b413eb..d172b413eb 100755..100644
--- a/src/widgets/doc/images/modelview-combobox.png
+++ b/src/widgets/doc/images/modelview-combobox.png
Binary files differ
diff --git a/src/widgets/doc/images/tableview.png b/src/widgets/doc/images/tableview.png
index 8be1b6ce62..8be1b6ce62 100755..100644
--- a/src/widgets/doc/images/tableview.png
+++ b/src/widgets/doc/images/tableview.png
Binary files differ
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index f307e9d3e4..8160396ca2 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -4,7 +4,7 @@ project = QtWidgets
description = Qt Widgets Reference Documentation
version = $QT_VERSION
-examplesinstallpath = widgets
+examplesinstallpath = qtbase/widgets
qhp.projects = QtWidgets
diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
index 39dfe32ace..e5c0f5cea1 100644
--- a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
@@ -106,16 +106,6 @@ QStringList files = QFileDialog::getOpenFileNames(
//! [9]
-//! [10]
-QStringList list = files;
-QStringList::Iterator it = list.begin();
-while(it != list.end()) {
- myProcessing(*it);
- ++it;
-}
-//! [10]
-
-
//! [11]
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
"/home/jana/untitled.png",
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
index 2f6865c9dd..074b214f80 100644
--- a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
@@ -116,7 +116,7 @@ void CustomView::mousePressEvent(QMouseEvent *event)
if (QGraphicsItem *item = itemAt(event->pos())) {
qDebug() << "You clicked on item" << item;
} else {
- qDebug() << "You didn't click on an item.";
+ qDebug("You didn't click on an item.");
}
}
//! [6]
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp
index b0b548e731..4997e25ada 100644
--- a/src/widgets/doc/snippets/javastyle.cpp
+++ b/src/widgets/doc/snippets/javastyle.cpp
@@ -236,9 +236,8 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option,
break;
}
case CE_DockWidgetTitle: {
- const QStyleOptionDockWidgetV2 *docker =
- new QStyleOptionDockWidgetV2(
- *qstyleoption_cast<const QStyleOptionDockWidget *>(option));
+ const QStyleOptionDockWidget *docker =
+ qstyleoption_cast<const QStyleOptionDockWidget *>(option);
QRect rect = docker->rect;
QRect titleRect = rect;
@@ -366,11 +365,9 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option,
break;
}
case CE_ProgressBar: {
- const QStyleOptionProgressBar *bar1 =
+ const QStyleOptionProgressBar *bar =
qstyleoption_cast<const QStyleOptionProgressBar *>(option);
- QStyleOptionProgressBarV2 *bar = new QStyleOptionProgressBarV2(*bar1);
-
QRect rect = bar->rect;
if (bar->orientation == Qt::Vertical) {
rect = QRect(rect.left(), rect.top(), rect.height(), rect.width());
@@ -416,7 +413,6 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option,
if (bar->textVisible)
drawControl(CE_ProgressBarLabel, &subBar, painter, widget);
- delete bar;
break;
}
case CE_ProgressBarGroove: {
@@ -2366,18 +2362,17 @@ void JavaStyle::drawPrimitive(PrimitiveElement element,
case PE_FrameLineEdit: {
const QStyleOptionFrame *frame =
qstyleoption_cast<const QStyleOptionFrame *>(option);
- const QStyleOptionFrameV2 frameV2(*frame);
painter->setPen(frame->palette.color(QPalette::Mid));
- painter->drawRect(frameV2.rect.adjusted(0, 0, -2, -2));
+ painter->drawRect(frame->rect.adjusted(0, 0, -2, -2));
painter->setPen(Qt::white);
- painter->drawRect(frameV2.rect.adjusted(1, 1, -1, -1));
- painter->setPen(frameV2.palette.color(QPalette::Active,
+ painter->drawRect(frame->rect.adjusted(1, 1, -1, -1));
+ painter->setPen(frame->palette.color(QPalette::Active,
QPalette::Background));
- painter->drawLine(frameV2.rect.bottomLeft(),
- frameV2.rect.bottomLeft() + QPoint(1, -1));
- painter->drawLine(frameV2.rect.topRight(),
- frameV2.rect.topRight() + QPoint(-1, 1));
+ painter->drawLine(frame->rect.bottomLeft(),
+ frame->rect.bottomLeft() + QPoint(1, -1));
+ painter->drawLine(frame->rect.topRight(),
+ frame->rect.topRight() + QPoint(-1, 1));
break;
}
case PE_FrameFocusRect: {
diff --git a/src/widgets/doc/snippets/macmainwindow.mm b/src/widgets/doc/snippets/macmainwindow.mm
index d0d74631ab..d0d74631ab 100755..100644
--- a/src/widgets/doc/snippets/macmainwindow.mm
+++ b/src/widgets/doc/snippets/macmainwindow.mm
diff --git a/src/widgets/doc/snippets/qstyleoption/main.cpp b/src/widgets/doc/snippets/qstyleoption/main.cpp
index aa4220d8ea..05d5ece33d 100644
--- a/src/widgets/doc/snippets/qstyleoption/main.cpp
+++ b/src/widgets/doc/snippets/qstyleoption/main.cpp
@@ -75,44 +75,11 @@ void MyPushButton::paintEvent(QPaintEvent *)
class MyStyle : public QStyle
{
public:
- MyStyle();
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget);
};
-MyStyle::MyStyle()
-{
-//! [1]
- QStyleOptionFrame *option;
-
- if (const QStyleOptionFrame *frameOption =
- qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- QStyleOptionFrameV2 frameOptionV2(*frameOption);
-
- // draw the frame using frameOptionV2
- }
-//! [1]
-
-//! [2]
- if (const QStyleOptionProgressBar *progressBarOption =
- qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
- QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);
-
- // draw the progress bar using progressBarV2
- }
-//! [2]
-
-//! [3]
- if (const QStyleOptionTab *tabOption =
- qstyleoption_cast<const QStyleOptionTab *>(option)) {
- QStyleOptionTabV2 tabV2(*tabOption);
-
- // draw the tab using tabV2
- }
-//! [3]
-}
-
//! [4]
void MyStyle::drawPrimitive(PrimitiveElement element,
const QStyleOption *option,
diff --git a/src/widgets/doc/src/guibooks.qdoc b/src/widgets/doc/src/guibooks.qdoc
index 8a1198c328..b3afe06961 100644
--- a/src/widgets/doc/src/guibooks.qdoc
+++ b/src/widgets/doc/src/guibooks.qdoc
@@ -76,7 +76,7 @@
advises against will produce more easily comprehensible software.
Doing what it tells you to do may also help.
- \b{\l{http://www.amazon.com/exec/obidos/ASIN/047159900X/trolltech/t}{The
+ \b{\l{http://www.amazon.com/New-Windows-Interface-Microsoft-Press/dp/1556156790/}{The
Microsoft Windows User Experience}}, ISBN 1-55615-679-0,
is Microsoft's look and feel bible. Indispensable for everyone who
has customers that worship Microsoft, and it's quite good, too.
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 098bb39fe2..0032e77c6a 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -2301,7 +2301,7 @@
{fetchMore()} must be reimplemented as their default implementation returns
false and does nothing.
- \keyword Model/View Classes
+ \target Model/View Classes
\section1 The Model/View Classes
These classes use the model/view design pattern in which the
diff --git a/src/widgets/doc/src/qtwidgets-examples.qdoc b/src/widgets/doc/src/qtwidgets-examples.qdoc
index 7b727183b8..9c0b29d687 100644
--- a/src/widgets/doc/src/qtwidgets-examples.qdoc
+++ b/src/widgets/doc/src/qtwidgets-examples.qdoc
@@ -127,7 +127,7 @@
/*!
\ingroup all-examples
- \target Graphicsview Examples
+ \keyword Graphicsview Examples
\title Graphics View Examples
\brief Using the Graphics View framework.
\page examples-graphicsview.html
diff --git a/src/widgets/doc/src/widgets-and-layouts/layout.qdoc b/src/widgets/doc/src/widgets-and-layouts/layout.qdoc
index 3f093ab2d6..47c2a17e7e 100644
--- a/src/widgets/doc/src/widgets-and-layouts/layout.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/layout.qdoc
@@ -197,7 +197,7 @@
\section2 Stretch Factors
- \keyword stretch factor
+ \target stretch factor
Widgets are normally created without any stretch factor set. When they are
laid out in a layout the widgets are given a share of space in accordance
@@ -249,7 +249,7 @@
For further guidance when implementing these functions, see the
\e{Qt Quarterly} article
- \l{http://doc.qt.digia.com/qq/qq04-height-for-width.html}
+ \l{http://doc.qt.io/archives/qq/qq04-height-for-width.html}
{Trading Height for Width}.
diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
index 0a5a079969..7d1bffd0b4 100644
--- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
@@ -989,9 +989,7 @@
The style option for tabs (QStyleOptionTab) contains the necessary
information for drawing tabs. The option contains the position of
the tab in the tab bar, the position of the selected tab, the
- shape of the tab, the text, and the icon. After Qt 4.1, the option
- should be cast to a QStyleOptionTabV2, which also contains the
- icon's size.
+ shape of the tab, the text, the icon, and the icon's size.
As the Java style tabs don't overlap, we also present an image of
a tab widget in the common style. Note that if you want the tabs
@@ -1024,7 +1022,7 @@
Note that individual tabs may be disabled even if the tab bar
is not. The tab will be active if the tab bar is active.
- Here follows a table of QStyleOptionTabV2's members:
+ Here follows a table of QStyleOptionTab's members:
\table 90%
\header
@@ -1450,7 +1448,7 @@
\li Content
\row
\li features
- \li Flags of the QStyleOptionFrameV2::FrameFeatures
+ \li Flags of the QStyleOptionFrame::FrameFeatures
enum describing the frame of the group box.
\row
\li lineWidth
@@ -1501,7 +1499,7 @@
\image javastyle/progressbarimage.png
- The style option for QProgressBar is QStyleOptionProgressBarV2.
+ The style option for QProgressBar is QStyleOptionProgressBar.
The bar does not set any state flags, but the other members of the
option are:
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index fc3ac345a8..2fb6819c47 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -829,7 +829,7 @@
\l{#selected-ps}{:selected},
and \l{#checked-ps}{:checked} pseudo states.
- Sort indicator in can be styled using the
+ The sort indicator can be styled using the
\l{#up-arrow-sub}{::up-arrow} and the
\l{#down-arrow-sub}{::down-arrow} Sub-control.
@@ -2186,6 +2186,54 @@
\snippet code/doc_src_stylesheet.qdoc 68
\row
+ \li \b outline
+ \li
+ \li The outline drawn around the object's border.
+
+ \row
+ \li \b outline-color
+ \li \l{#Color}{Color}
+ \li The color of the outline.
+ See also \l{Qt Style Sheets Reference#border-color-prop}{border-color}
+
+ \row
+ \li \b outline-offset
+ \li \l{#Length}{Length}
+ \li The outline's offset from the border of the widget.
+
+ \row
+ \li \b outline-style
+ \li
+ \li Specifies the pattern used to draw the outline.
+ See also \l{Qt Style Sheets Reference#border-style-prop}{border-style}
+
+ \row
+ \li \b outline-radius
+ \li
+ \li Adds rounded corners to the outline
+
+ \row
+ \li \b outline-bottom-left-radius
+ \li \l{#Radius}{Radius}
+ \li The radius for the bottom-left rounded corner of the outline.
+
+ \row
+ \li \b outline-bottom-right-radius
+ \li \l{#Radius}{Radius}
+ \li The radius for the bottom-right rounded corner of the outline.
+
+ \row
+ \li \b outline-top-left-radius
+ \li \l{#Radius}{Radius}
+ \li The radius for the top-left corner of the outline.
+
+ \row
+ \li \b outline-top-right-radius
+ \li \l{#Radius}{Radius}
+ \li The radius for the top-right rounded corner of the outline.
+
+
+ \row
\li \b{\c padding} \target padding-prop
\li \l{#Box Lengths}{Box Lengths}
\li The widget's padding. Equivalent to specifying \c
@@ -2981,7 +3029,7 @@
\li \b{Url} \target Url
\li \tt{url(\e{filename})}
\li \tt{\e{filename}} is the name of a file on the local disk
- or stored using \l{the Qt Resource System}. Setting an
+ or stored using \l{The Qt Resource System}. Setting an
image implicitly sets the width and height of the element.
\endtable
diff --git a/src/widgets/doc/src/windows-and-dialogs/mainwindow.qdoc b/src/widgets/doc/src/windows-and-dialogs/mainwindow.qdoc
index 7610174744..6e58fe4499 100644
--- a/src/widgets/doc/src/windows-and-dialogs/mainwindow.qdoc
+++ b/src/widgets/doc/src/windows-and-dialogs/mainwindow.qdoc
@@ -78,7 +78,7 @@
design ideas. Creating designs visually and reading the code generated by
\l{uic} is a great way to learn Qt!
- \keyword window geometry
+ \target window geometry
\section1 Window Geometry
QWidget provides several functions that deal with a widget's
@@ -226,7 +226,11 @@
We create a toolbar as a child of the main window, and add the desired
actions to it:
- \snippet mainwindows/sdi/mainwindow.cpp 0
+ \code
+ fileToolBar = addToolBar(tr("File"));
+ fileToolBar->addAction(newAct);
+ fileToolBar->addAction(openAct);
+ \endcode
\dots
\snippet code/doc_src_qt4-mainwindow.cpp 1
diff --git a/src/widgets/effects/qgraphicseffect.cpp b/src/widgets/effects/qgraphicseffect.cpp
index f53804e494..5a97be3d96 100644
--- a/src/widgets/effects/qgraphicseffect.cpp
+++ b/src/widgets/effects/qgraphicseffect.cpp
@@ -111,6 +111,10 @@
#ifndef QT_NO_GRAPHICSEFFECT
QT_BEGIN_NAMESPACE
+QGraphicsEffectPrivate::~QGraphicsEffectPrivate()
+{
+}
+
/*!
\internal
\class QGraphicsEffectSource
diff --git a/src/widgets/effects/qgraphicseffect.h b/src/widgets/effects/qgraphicseffect.h
index 678ece3dd2..c43b607d39 100644
--- a/src/widgets/effects/qgraphicseffect.h
+++ b/src/widgets/effects/qgraphicseffect.h
@@ -72,7 +72,7 @@ public:
PadToEffectiveBoundingRect
};
- QGraphicsEffect(QObject *parent = 0);
+ QGraphicsEffect(QObject *parent = Q_NULLPTR);
virtual ~QGraphicsEffect();
virtual QRectF boundingRectFor(const QRectF &sourceRect) const;
@@ -88,7 +88,7 @@ Q_SIGNALS:
void enabledChanged(bool enabled);
protected:
- QGraphicsEffect(QGraphicsEffectPrivate &d, QObject *parent = 0);
+ QGraphicsEffect(QGraphicsEffectPrivate &d, QObject *parent = Q_NULLPTR);
virtual void draw(QPainter *painter) = 0;
virtual void sourceChanged(ChangeFlags flags);
void updateBoundingRect();
@@ -97,7 +97,7 @@ protected:
QRectF sourceBoundingRect(Qt::CoordinateSystem system = Qt::LogicalCoordinates) const;
void drawSource(QPainter *painter);
QPixmap sourcePixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates,
- QPoint *offset = 0,
+ QPoint *offset = Q_NULLPTR,
PixmapPadMode mode = PadToEffectiveBoundingRect) const;
private:
@@ -122,7 +122,7 @@ class Q_WIDGETS_EXPORT QGraphicsColorizeEffect: public QGraphicsEffect
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged)
public:
- QGraphicsColorizeEffect(QObject *parent = 0);
+ QGraphicsColorizeEffect(QObject *parent = Q_NULLPTR);
~QGraphicsColorizeEffect();
QColor color() const;
@@ -159,7 +159,7 @@ public:
};
Q_DECLARE_FLAGS(BlurHints, BlurHint)
- QGraphicsBlurEffect(QObject *parent = 0);
+ QGraphicsBlurEffect(QObject *parent = Q_NULLPTR);
~QGraphicsBlurEffect();
QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
@@ -194,7 +194,7 @@ class Q_WIDGETS_EXPORT QGraphicsDropShadowEffect: public QGraphicsEffect
Q_PROPERTY(qreal blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
public:
- QGraphicsDropShadowEffect(QObject *parent = 0);
+ QGraphicsDropShadowEffect(QObject *parent = Q_NULLPTR);
~QGraphicsDropShadowEffect();
QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
@@ -247,7 +247,7 @@ class Q_WIDGETS_EXPORT QGraphicsOpacityEffect: public QGraphicsEffect
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
Q_PROPERTY(QBrush opacityMask READ opacityMask WRITE setOpacityMask NOTIFY opacityMaskChanged)
public:
- QGraphicsOpacityEffect(QObject *parent = 0);
+ QGraphicsOpacityEffect(QObject *parent = Q_NULLPTR);
~QGraphicsOpacityEffect();
qreal opacity() const;
diff --git a/src/widgets/effects/qgraphicseffect_p.h b/src/widgets/effects/qgraphicseffect_p.h
index 6e990cc52e..35264c0d30 100644
--- a/src/widgets/effects/qgraphicseffect_p.h
+++ b/src/widgets/effects/qgraphicseffect_p.h
@@ -142,6 +142,7 @@ class Q_WIDGETS_EXPORT QGraphicsEffectPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QGraphicsEffect)
public:
QGraphicsEffectPrivate() : source(0), isEnabled(1) {}
+ ~QGraphicsEffectPrivate();
inline void setGraphicsEffectSource(QGraphicsEffectSource *newSource)
{
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout.h b/src/widgets/graphicsview/qgraphicsanchorlayout.h
index 90406fe71f..2fdfe75be9 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout.h
@@ -71,7 +71,7 @@ private:
class Q_WIDGETS_EXPORT QGraphicsAnchorLayout : public QGraphicsLayout
{
public:
- QGraphicsAnchorLayout(QGraphicsLayoutItem *parent = 0);
+ QGraphicsAnchorLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
virtual ~QGraphicsAnchorLayout();
QGraphicsAnchor *addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge,
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
index 8327777217..dac8e61645 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -751,9 +751,12 @@ static AnchorData *createSequence(Graph<AnchorVertex, AnchorData> *graph,
AnchorVertex *prev = before;
QVector<AnchorData *> edges;
+ edges.reserve(vertices.count() + 1);
+ const int numVertices = vertices.count();
+ edges.reserve(numVertices + 1);
// Take from the graph, the edges that will be simplificated
- for (int i = 0; i < vertices.count(); ++i) {
+ for (int i = 0; i < numVertices; ++i) {
AnchorVertex *next = vertices.at(i);
AnchorData *ad = graph->takeEdge(prev, next);
Q_ASSERT(ad);
@@ -2569,6 +2572,7 @@ QGraphicsAnchorLayoutPrivate::getGraphParts(Orientation orientation)
if (!remainingConstraints.isEmpty()) {
QList<QSimplexConstraint *> nonTrunkConstraints;
+ nonTrunkConstraints.reserve(remainingConstraints.size());
QLinkedList<QSimplexConstraint *>::iterator it = remainingConstraints.begin();
while (it != remainingConstraints.end()) {
nonTrunkConstraints += *it;
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
index c0bb8ef63a..a5c7f1e2ce 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
@@ -317,6 +317,7 @@ public:
QSet<AnchorData *> positives;
QSet<AnchorData *> negatives;
};
+Q_DECLARE_TYPEINFO(GraphPath, Q_MOVABLE_TYPE);
class QGraphicsAnchorLayoutPrivate;
/*!
diff --git a/src/widgets/graphicsview/qgraphicsgridlayout.h b/src/widgets/graphicsview/qgraphicsgridlayout.h
index 90cc316025..f6aa3af91d 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayout.h
+++ b/src/widgets/graphicsview/qgraphicsgridlayout.h
@@ -47,12 +47,12 @@ class QGraphicsGridLayoutPrivate;
class Q_WIDGETS_EXPORT QGraphicsGridLayout : public QGraphicsLayout
{
public:
- QGraphicsGridLayout(QGraphicsLayoutItem *parent = 0);
+ QGraphicsGridLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
virtual ~QGraphicsGridLayout();
void addItem(QGraphicsLayoutItem *item, int row, int column, int rowSpan, int columnSpan,
- Qt::Alignment alignment = 0);
- inline void addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment = 0);
+ Qt::Alignment alignment = Qt::Alignment());
+ inline void addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment = Qt::Alignment());
void setHorizontalSpacing(qreal spacing);
qreal horizontalSpacing() const;
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 1332134000..5f5c402a4a 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -10832,9 +10832,7 @@ void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic
range.start = 0;
range.length = layout.text().length();
range.format.setTextOutline(d->pen);
- QList<QTextLayout::FormatRange> formats;
- formats.append(range);
- layout.setAdditionalFormats(formats);
+ layout.setFormats(QVector<QTextLayout::FormatRange>(1, range));
}
setupTextLayout(&layout);
diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h
index d3540beb77..b2f8fcbe74 100644
--- a/src/widgets/graphicsview/qgraphicsitem.h
+++ b/src/widgets/graphicsview/qgraphicsitem.h
@@ -153,7 +153,7 @@ public:
SceneModal
};
- explicit QGraphicsItem(QGraphicsItem *parent = 0);
+ explicit QGraphicsItem(QGraphicsItem *parent = Q_NULLPTR);
virtual ~QGraphicsItem();
QGraphicsScene *scene() const;
@@ -189,7 +189,7 @@ public:
PanelModality panelModality() const;
void setPanelModality(PanelModality panelModality);
- bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = 0) const;
+ bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = Q_NULLPTR) const;
#ifndef QT_NO_TOOLTIP
QString toolTip() const;
@@ -285,7 +285,7 @@ public:
QTransform transform() const;
QTransform sceneTransform() const;
QTransform deviceTransform(const QTransform &viewportTransform) const;
- QTransform itemTransform(const QGraphicsItem *other, bool *ok = 0) const;
+ QTransform itemTransform(const QGraphicsItem *other, bool *ok = Q_NULLPTR) const;
void setTransform(const QTransform &matrix, bool combine = false);
void resetTransform();
#if QT_DEPRECATED_SINCE(5, 0)
@@ -336,7 +336,7 @@ public:
void setBoundingRegionGranularity(qreal granularity);
// Drawing
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) = 0;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) = 0;
void update(const QRectF &rect = QRectF());
inline void update(qreal x, qreal y, qreal width, qreal height);
void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF());
@@ -553,7 +553,7 @@ class Q_WIDGETS_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
Q_CLASSINFO("DefaultProperty", "children")
Q_INTERFACES(QGraphicsItem)
public:
- explicit QGraphicsObject(QGraphicsItem *parent = 0);
+ explicit QGraphicsObject(QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsObject();
using QObject::children;
@@ -595,7 +595,7 @@ class QAbstractGraphicsShapeItemPrivate;
class Q_WIDGETS_EXPORT QAbstractGraphicsShapeItem : public QGraphicsItem
{
public:
- explicit QAbstractGraphicsShapeItem(QGraphicsItem *parent = 0);
+ explicit QAbstractGraphicsShapeItem(QGraphicsItem *parent = Q_NULLPTR);
~QAbstractGraphicsShapeItem();
QPen pen() const;
@@ -620,8 +620,8 @@ class QGraphicsPathItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsPathItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsPathItem(QGraphicsItem *parent = 0);
- explicit QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = 0);
+ explicit QGraphicsPathItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsPathItem();
QPainterPath path() const;
@@ -631,7 +631,7 @@ public:
QPainterPath shape() const Q_DECL_OVERRIDE;
bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
@@ -653,9 +653,9 @@ class QGraphicsRectItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsRectItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsRectItem(QGraphicsItem *parent = 0);
- explicit QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = 0);
- explicit QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = 0);
+ explicit QGraphicsRectItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsRectItem();
QRectF rect() const;
@@ -666,7 +666,7 @@ public:
QPainterPath shape() const Q_DECL_OVERRIDE;
bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
@@ -691,9 +691,9 @@ class QGraphicsEllipseItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsEllipseItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsEllipseItem(QGraphicsItem *parent = 0);
- explicit QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = 0);
- explicit QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = 0);
+ explicit QGraphicsEllipseItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsEllipseItem();
QRectF rect() const;
@@ -710,7 +710,7 @@ public:
QPainterPath shape() const Q_DECL_OVERRIDE;
bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
@@ -735,9 +735,9 @@ class QGraphicsPolygonItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsPolygonItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsPolygonItem(QGraphicsItem *parent = 0);
+ explicit QGraphicsPolygonItem(QGraphicsItem *parent = Q_NULLPTR);
explicit QGraphicsPolygonItem(const QPolygonF &polygon,
- QGraphicsItem *parent = 0);
+ QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsPolygonItem();
QPolygonF polygon() const;
@@ -750,7 +750,7 @@ public:
QPainterPath shape() const Q_DECL_OVERRIDE;
bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
@@ -772,9 +772,9 @@ class QGraphicsLineItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsLineItem : public QGraphicsItem
{
public:
- explicit QGraphicsLineItem(QGraphicsItem *parent = 0);
- explicit QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent = 0);
- explicit QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent = 0);
+ explicit QGraphicsLineItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsLineItem();
QPen pen() const;
@@ -789,7 +789,7 @@ public:
QPainterPath shape() const Q_DECL_OVERRIDE;
bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
@@ -817,8 +817,8 @@ public:
HeuristicMaskShape
};
- explicit QGraphicsPixmapItem(QGraphicsItem *parent = 0);
- explicit QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = 0);
+ explicit QGraphicsPixmapItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsPixmapItem();
QPixmap pixmap() const;
@@ -869,8 +869,8 @@ class Q_WIDGETS_EXPORT QGraphicsTextItem : public QGraphicsObject
QDOC_PROPERTY(QTextCursor textCursor READ textCursor WRITE setTextCursor)
public:
- explicit QGraphicsTextItem(QGraphicsItem *parent = 0);
- explicit QGraphicsTextItem(const QString &text, QGraphicsItem *parent = 0);
+ explicit QGraphicsTextItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsTextItem(const QString &text, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsTextItem();
QString toHtml() const;
@@ -960,8 +960,8 @@ class QGraphicsSimpleTextItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsSimpleTextItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsSimpleTextItem(QGraphicsItem *parent = 0);
- explicit QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent = 0);
+ explicit QGraphicsSimpleTextItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsSimpleTextItem();
void setText(const QString &text);
@@ -996,14 +996,14 @@ class QGraphicsItemGroupPrivate;
class Q_WIDGETS_EXPORT QGraphicsItemGroup : public QGraphicsItem
{
public:
- explicit QGraphicsItemGroup(QGraphicsItem *parent = 0);
+ explicit QGraphicsItemGroup(QGraphicsItem *parent = Q_NULLPTR);
~QGraphicsItemGroup();
void addToGroup(QGraphicsItem *item);
void removeFromGroup(QGraphicsItem *item);
QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/graphicsview/qgraphicsitem_p.h b/src/widgets/graphicsview/qgraphicsitem_p.h
index bf788d2c39..fe4bac12bc 100644
--- a/src/widgets/graphicsview/qgraphicsitem_p.h
+++ b/src/widgets/graphicsview/qgraphicsitem_p.h
@@ -353,6 +353,7 @@ public:
}
struct ExtraStruct {
+ ExtraStruct() {} // for QVector, don't use
ExtraStruct(Extra type, QVariant value)
: type(type), value(value)
{ }
@@ -364,7 +365,7 @@ public:
{ return type < extra; }
};
- QList<ExtraStruct> extras;
+ QVector<ExtraStruct> extras;
QGraphicsItemCache *maybeExtraItemCache() const;
QGraphicsItemCache *extraItemCache() const;
@@ -584,6 +585,7 @@ public:
int globalStackingOrder;
QGraphicsItem *q_ptr;
};
+Q_DECLARE_TYPEINFO(QGraphicsItemPrivate::ExtraStruct, Q_MOVABLE_TYPE);
struct QGraphicsItemPrivate::TransformData
{
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.cpp b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
index 0a6fccf559..585539de94 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.cpp
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
@@ -116,7 +116,6 @@ public:
qreal step;
struct Pair {
- Pair(qreal a, qreal b) : step(a), value(b) {}
bool operator <(const Pair &other) const
{ return step < other.step; }
bool operator==(const Pair &other) const
@@ -124,21 +123,22 @@ public:
qreal step;
qreal value;
};
- QList<Pair> xPosition;
- QList<Pair> yPosition;
- QList<Pair> rotation;
- QList<Pair> verticalScale;
- QList<Pair> horizontalScale;
- QList<Pair> verticalShear;
- QList<Pair> horizontalShear;
- QList<Pair> xTranslation;
- QList<Pair> yTranslation;
-
- qreal linearValueForStep(qreal step, QList<Pair> *source, qreal defaultValue = 0);
- void insertUniquePair(qreal step, qreal value, QList<Pair> *binList, const char* method);
+ QVector<Pair> xPosition;
+ QVector<Pair> yPosition;
+ QVector<Pair> rotation;
+ QVector<Pair> verticalScale;
+ QVector<Pair> horizontalScale;
+ QVector<Pair> verticalShear;
+ QVector<Pair> horizontalShear;
+ QVector<Pair> xTranslation;
+ QVector<Pair> yTranslation;
+
+ qreal linearValueForStep(qreal step, QVector<Pair> *source, qreal defaultValue = 0);
+ void insertUniquePair(qreal step, qreal value, QVector<Pair> *binList, const char* method);
};
+Q_DECLARE_TYPEINFO(QGraphicsItemAnimationPrivate::Pair, Q_PRIMITIVE_TYPE);
-qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, QList<Pair> *source, qreal defaultValue)
+qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, QVector<Pair> *source, qreal defaultValue)
{
if (source->isEmpty())
return defaultValue;
@@ -168,20 +168,18 @@ qreal QGraphicsItemAnimationPrivate::linearValueForStep(qreal step, QList<Pair>
return valueBefore + (valueAfter - valueBefore) * ((step - stepBefore) / (stepAfter - stepBefore));
}
-void QGraphicsItemAnimationPrivate::insertUniquePair(qreal step, qreal value, QList<Pair> *binList, const char* method)
+void QGraphicsItemAnimationPrivate::insertUniquePair(qreal step, qreal value, QVector<Pair> *binList, const char* method)
{
if (!check_step_valid(step, method))
return;
- Pair pair(step, value);
+ const Pair pair = { step, value };
- QList<Pair>::iterator result = std::lower_bound(binList->begin(), binList->end(), pair);
- if ((result != binList->end()) && !(pair < *result))
+ const QVector<Pair>::iterator result = std::lower_bound(binList->begin(), binList->end(), pair);
+ if (result == binList->end() || pair < *result)
+ binList->insert(result, pair);
+ else
result->value = value;
- else {
- *binList << pair;
- std::sort(binList->begin(), binList->end());
- }
}
/*!
@@ -284,7 +282,9 @@ void QGraphicsItemAnimation::setPosAt(qreal step, const QPointF &pos)
QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::posList() const
{
QList<QPair<qreal, QPointF> > list;
- for (int i = 0; i < d->xPosition.size(); ++i)
+ const int xPosCount = d->xPosition.size();
+ list.reserve(xPosCount);
+ for (int i = 0; i < xPosCount; ++i)
list << QPair<qreal, QPointF>(d->xPosition.at(i).step, QPointF(d->xPosition.at(i).value, d->yPosition.at(i).value));
return list;
@@ -338,7 +338,9 @@ void QGraphicsItemAnimation::setRotationAt(qreal step, qreal angle)
QList<QPair<qreal, qreal> > QGraphicsItemAnimation::rotationList() const
{
QList<QPair<qreal, qreal> > list;
- for (int i = 0; i < d->rotation.size(); ++i)
+ const int numRotations = d->rotation.size();
+ list.reserve(numRotations);
+ for (int i = 0; i < numRotations; ++i)
list << QPair<qreal, qreal>(d->rotation.at(i).step, d->rotation.at(i).value);
return list;
@@ -386,7 +388,9 @@ void QGraphicsItemAnimation::setTranslationAt(qreal step, qreal dx, qreal dy)
QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::translationList() const
{
QList<QPair<qreal, QPointF> > list;
- for (int i = 0; i < d->xTranslation.size(); ++i)
+ const int numTranslations = d->xTranslation.size();
+ list.reserve(numTranslations);
+ for (int i = 0; i < numTranslations; ++i)
list << QPair<qreal, QPointF>(d->xTranslation.at(i).step, QPointF(d->xTranslation.at(i).value, d->yTranslation.at(i).value));
return list;
@@ -435,7 +439,9 @@ void QGraphicsItemAnimation::setScaleAt(qreal step, qreal sx, qreal sy)
QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::scaleList() const
{
QList<QPair<qreal, QPointF> > list;
- for (int i = 0; i < d->horizontalScale.size(); ++i)
+ const int numScales = d->horizontalScale.size();
+ list.reserve(numScales);
+ for (int i = 0; i < numScales; ++i)
list << QPair<qreal, QPointF>(d->horizontalScale.at(i).step, QPointF(d->horizontalScale.at(i).value, d->verticalScale.at(i).value));
return list;
@@ -483,7 +489,9 @@ void QGraphicsItemAnimation::setShearAt(qreal step, qreal sh, qreal sv)
QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::shearList() const
{
QList<QPair<qreal, QPointF> > list;
- for (int i = 0; i < d->horizontalShear.size(); ++i)
+ const int numShears = d->horizontalShear.size();
+ list.reserve(numShears);
+ for (int i = 0; i < numShears; ++i)
list << QPair<qreal, QPointF>(d->horizontalShear.at(i).step, QPointF(d->horizontalShear.at(i).value, d->verticalShear.at(i).value));
return list;
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.h b/src/widgets/graphicsview/qgraphicsitemanimation.h
index 02a20f3f01..a54ba3a9e9 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.h
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.h
@@ -52,7 +52,7 @@ class Q_WIDGETS_EXPORT QGraphicsItemAnimation : public QObject
{
Q_OBJECT
public:
- QGraphicsItemAnimation(QObject *parent = 0);
+ QGraphicsItemAnimation(QObject *parent = Q_NULLPTR);
virtual ~QGraphicsItemAnimation();
QGraphicsItem *item() const;
diff --git a/src/widgets/graphicsview/qgraphicslayout.h b/src/widgets/graphicsview/qgraphicslayout.h
index ebd90735f1..84a8d97943 100644
--- a/src/widgets/graphicsview/qgraphicslayout.h
+++ b/src/widgets/graphicsview/qgraphicslayout.h
@@ -48,7 +48,7 @@ class QGraphicsWidget;
class Q_WIDGETS_EXPORT QGraphicsLayout : public QGraphicsLayoutItem
{
public:
- QGraphicsLayout(QGraphicsLayoutItem *parent = 0);
+ QGraphicsLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
~QGraphicsLayout();
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom);
diff --git a/src/widgets/graphicsview/qgraphicslayoutitem.h b/src/widgets/graphicsview/qgraphicslayoutitem.h
index 85b6d901f2..1608d79836 100644
--- a/src/widgets/graphicsview/qgraphicslayoutitem.h
+++ b/src/widgets/graphicsview/qgraphicslayoutitem.h
@@ -48,7 +48,7 @@ class QGraphicsItem;
class Q_WIDGETS_EXPORT QGraphicsLayoutItem
{
public:
- QGraphicsLayoutItem(QGraphicsLayoutItem *parent = 0, bool isLayout = false);
+ QGraphicsLayoutItem(QGraphicsLayoutItem *parent = Q_NULLPTR, bool isLayout = false);
virtual ~QGraphicsLayoutItem();
void setSizePolicy(const QSizePolicy &policy);
diff --git a/src/widgets/graphicsview/qgraphicslinearlayout.cpp b/src/widgets/graphicsview/qgraphicslinearlayout.cpp
index efdf6a595c..0384364ad4 100644
--- a/src/widgets/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/widgets/graphicsview/qgraphicslinearlayout.cpp
@@ -512,7 +512,7 @@ void QGraphicsLinearLayout::setGeometry(const QRectF &rect)
d->engine.setGeometries(effectiveRect, d->styleInfo());
#ifdef QGRIDLAYOUTENGINE_DEBUG
if (qt_graphicsLayoutDebug()) {
- qDebug() << "post dump";
+ qDebug("post dump");
dump(1);
}
#endif
diff --git a/src/widgets/graphicsview/qgraphicslinearlayout.h b/src/widgets/graphicsview/qgraphicslinearlayout.h
index 997bff7da1..3232da22ca 100644
--- a/src/widgets/graphicsview/qgraphicslinearlayout.h
+++ b/src/widgets/graphicsview/qgraphicslinearlayout.h
@@ -47,8 +47,8 @@ class QGraphicsLinearLayoutPrivate;
class Q_WIDGETS_EXPORT QGraphicsLinearLayout : public QGraphicsLayout
{
public:
- QGraphicsLinearLayout(QGraphicsLayoutItem *parent = 0);
- QGraphicsLinearLayout(Qt::Orientation orientation, QGraphicsLayoutItem *parent = 0);
+ QGraphicsLinearLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
+ QGraphicsLinearLayout(Qt::Orientation orientation, QGraphicsLayoutItem *parent = Q_NULLPTR);
virtual ~QGraphicsLinearLayout();
void setOrientation(Qt::Orientation orientation);
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index db4d18299b..88bed7cf0e 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -269,8 +269,7 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent
// Send mouse event.
QMouseEvent mouseEvent(type, pos, receiver->mapTo(receiver->topLevelWidget(), pos.toPoint()),
receiver->mapToGlobal(pos.toPoint()),
- event->button(), event->buttons(), event->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(&mouseEvent, event->source());
+ event->button(), event->buttons(), event->modifiers(), event->source());
QWidget *embeddedMouseGrabberPtr = (QWidget *)embeddedMouseGrabber;
QApplicationPrivate::sendMouseEvent(receiver, &mouseEvent, alienWidget, widget,
@@ -880,6 +879,19 @@ bool QGraphicsProxyWidget::event(QEvent *event)
break;
}
#endif
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd: {
+ if (event->spontaneous())
+ qt_sendSpontaneousEvent(d->widget, event);
+ else
+ QApplication::sendEvent(d->widget, event);
+
+ if (event->isAccepted())
+ return true;
+
+ break;
+ }
default:
break;
}
@@ -1156,7 +1168,7 @@ void QGraphicsProxyWidget::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::hoverMoveEvent";
+ qDebug("QGraphicsProxyWidget::hoverMoveEvent");
#endif
// Ignore events on the window frame.
if (!d->widget || !rect().contains(event->pos())) {
@@ -1196,7 +1208,7 @@ void QGraphicsProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::mouseMoveEvent";
+ qDebug("QGraphicsProxyWidget::mouseMoveEvent");
#endif
d->sendWidgetMouseEvent(event);
}
@@ -1208,7 +1220,7 @@ void QGraphicsProxyWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::mousePressEvent";
+ qDebug("QGraphicsProxyWidget::mousePressEvent");
#endif
d->sendWidgetMouseEvent(event);
}
@@ -1220,7 +1232,7 @@ void QGraphicsProxyWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::mouseDoubleClickEvent";
+ qDebug("QGraphicsProxyWidget::mouseDoubleClickEvent");
#endif
d->sendWidgetMouseEvent(event);
}
@@ -1233,7 +1245,7 @@ void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::wheelEvent";
+ qDebug("QGraphicsProxyWidget::wheelEvent");
#endif
if (!d->widget)
return;
@@ -1271,7 +1283,7 @@ void QGraphicsProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::mouseReleaseEvent";
+ qDebug("QGraphicsProxyWidget::mouseReleaseEvent");
#endif
d->sendWidgetMouseEvent(event);
}
@@ -1283,7 +1295,7 @@ void QGraphicsProxyWidget::keyPressEvent(QKeyEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::keyPressEvent";
+ qDebug("QGraphicsProxyWidget::keyPressEvent");
#endif
d->sendWidgetKeyEvent(event);
}
@@ -1295,7 +1307,7 @@ void QGraphicsProxyWidget::keyReleaseEvent(QKeyEvent *event)
{
Q_D(QGraphicsProxyWidget);
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::keyReleaseEvent";
+ qDebug("QGraphicsProxyWidget::keyReleaseEvent");
#endif
d->sendWidgetKeyEvent(event);
}
@@ -1306,7 +1318,7 @@ void QGraphicsProxyWidget::keyReleaseEvent(QKeyEvent *event)
void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event)
{
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::focusInEvent";
+ qDebug("QGraphicsProxyWidget::focusInEvent");
#endif
Q_D(QGraphicsProxyWidget);
@@ -1345,7 +1357,7 @@ void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event)
void QGraphicsProxyWidget::focusOutEvent(QFocusEvent *event)
{
#ifdef GRAPHICSPROXYWIDGET_DEBUG
- qDebug() << "QGraphicsProxyWidget::focusOutEvent";
+ qDebug("QGraphicsProxyWidget::focusOutEvent");
#endif
Q_D(QGraphicsProxyWidget);
if (d->widget) {
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.h b/src/widgets/graphicsview/qgraphicsproxywidget.h
index ae52f88f16..5a03a8a9dd 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.h
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.h
@@ -47,7 +47,7 @@ class Q_WIDGETS_EXPORT QGraphicsProxyWidget : public QGraphicsWidget
{
Q_OBJECT
public:
- QGraphicsProxyWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+ QGraphicsProxyWidget(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
~QGraphicsProxyWidget();
void setWidget(QWidget *widget);
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget_p.h b/src/widgets/graphicsview/qgraphicsproxywidget_p.h
index 7b164a0067..c0e0d73aa9 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget_p.h
+++ b/src/widgets/graphicsview/qgraphicsproxywidget_p.h
@@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
-class QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
+class Q_AUTOTEST_EXPORT QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
{
Q_DECLARE_PUBLIC(QGraphicsProxyWidget)
public:
diff --git a/src/widgets/graphicsview/qgraphicsscene.h b/src/widgets/graphicsview/qgraphicsscene.h
index 68382bf498..c93db20716 100644
--- a/src/widgets/graphicsview/qgraphicsscene.h
+++ b/src/widgets/graphicsview/qgraphicsscene.h
@@ -115,9 +115,9 @@ public:
};
Q_DECLARE_FLAGS(SceneLayers, SceneLayer)
- QGraphicsScene(QObject *parent = 0);
- QGraphicsScene(const QRectF &sceneRect, QObject *parent = 0);
- QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = 0);
+ QGraphicsScene(QObject *parent = Q_NULLPTR);
+ QGraphicsScene(const QRectF &sceneRect, QObject *parent = Q_NULLPTR);
+ QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = Q_NULLPTR);
virtual ~QGraphicsScene();
QRectF sceneRect() const;
@@ -192,7 +192,7 @@ public:
QGraphicsRectItem *addRect(const QRectF &rect, const QPen &pen = QPen(), const QBrush &brush = QBrush());
QGraphicsTextItem *addText(const QString &text, const QFont &font = QFont());
QGraphicsSimpleTextItem *addSimpleText(const QString &text, const QFont &font = QFont());
- QGraphicsProxyWidget *addWidget(QWidget *widget, Qt::WindowFlags wFlags = 0);
+ QGraphicsProxyWidget *addWidget(QWidget *widget, Qt::WindowFlags wFlags = Qt::WindowFlags());
inline QGraphicsEllipseItem *addEllipse(qreal x, qreal y, qreal w, qreal h, const QPen &pen = QPen(), const QBrush &brush = QBrush())
{ return addEllipse(QRectF(x, y, w, h), pen, brush); }
inline QGraphicsLineItem *addLine(qreal x1, qreal y1, qreal x2, qreal y2, const QPen &pen = QPen())
@@ -279,7 +279,7 @@ protected:
virtual void drawItems(QPainter *painter, int numItems,
QGraphicsItem *items[],
const QStyleOptionGraphicsItem options[],
- QWidget *widget = 0);
+ QWidget *widget = Q_NULLPTR);
protected Q_SLOTS:
// ### Qt 6: make unconditional
diff --git a/src/widgets/graphicsview/qgraphicssceneevent.h b/src/widgets/graphicsview/qgraphicssceneevent.h
index 1e3554fa36..ffa708ea23 100644
--- a/src/widgets/graphicsview/qgraphicssceneevent.h
+++ b/src/widgets/graphicsview/qgraphicssceneevent.h
@@ -40,7 +40,9 @@
#include <QtCore/qrect.h>
#include <QtGui/qpolygon.h>
#include <QtCore/qset.h>
+#if QT_DEPRECATED_SINCE(5, 5)
#include <QtCore/qhash.h>
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/graphicsview/qgraphicssceneindex.cpp b/src/widgets/graphicsview/qgraphicssceneindex.cpp
index 8662f73d64..a76f6b6565 100644
--- a/src/widgets/graphicsview/qgraphicssceneindex.cpp
+++ b/src/widgets/graphicsview/qgraphicssceneindex.cpp
@@ -520,7 +520,9 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::estimateTopLevelItems(const QRectF &
scened->ensureSortedTopLevelItems();
if (order == Qt::DescendingOrder) {
QList<QGraphicsItem *> sorted;
- for (int i = scened->topLevelItems.size() - 1; i >= 0; --i)
+ const int numTopLevelItems = scened->topLevelItems.size();
+ sorted.reserve(numTopLevelItems);
+ for (int i = numTopLevelItems - 1; i >= 0; --i)
sorted << scened->topLevelItems.at(i);
return sorted;
}
diff --git a/src/widgets/graphicsview/qgraphicstransform.cpp b/src/widgets/graphicsview/qgraphicstransform.cpp
index 67564b5a8b..fe963fbf3c 100644
--- a/src/widgets/graphicsview/qgraphicstransform.cpp
+++ b/src/widgets/graphicsview/qgraphicstransform.cpp
@@ -89,6 +89,11 @@
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
+
+QGraphicsTransformPrivate::~QGraphicsTransformPrivate()
+{
+}
+
void QGraphicsTransformPrivate::setItem(QGraphicsItem *i)
{
if (item == i)
diff --git a/src/widgets/graphicsview/qgraphicstransform.h b/src/widgets/graphicsview/qgraphicstransform.h
index 4a7a3d0c0b..6fa76683f2 100644
--- a/src/widgets/graphicsview/qgraphicstransform.h
+++ b/src/widgets/graphicsview/qgraphicstransform.h
@@ -50,7 +50,7 @@ class Q_WIDGETS_EXPORT QGraphicsTransform : public QObject
{
Q_OBJECT
public:
- QGraphicsTransform(QObject *parent = 0);
+ QGraphicsTransform(QObject *parent = Q_NULLPTR);
~QGraphicsTransform();
virtual void applyTo(QMatrix4x4 *matrix) const = 0;
@@ -78,7 +78,7 @@ class Q_WIDGETS_EXPORT QGraphicsScale : public QGraphicsTransform
Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged)
Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged)
public:
- QGraphicsScale(QObject *parent = 0);
+ QGraphicsScale(QObject *parent = Q_NULLPTR);
~QGraphicsScale();
QVector3D origin() const;
@@ -116,7 +116,7 @@ class Q_WIDGETS_EXPORT QGraphicsRotation : public QGraphicsTransform
Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
public:
- QGraphicsRotation(QObject *parent = 0);
+ QGraphicsRotation(QObject *parent = Q_NULLPTR);
~QGraphicsRotation();
QVector3D origin() const;
diff --git a/src/widgets/graphicsview/qgraphicstransform_p.h b/src/widgets/graphicsview/qgraphicstransform_p.h
index dde085935f..c81a95fd3d 100644
--- a/src/widgets/graphicsview/qgraphicstransform_p.h
+++ b/src/widgets/graphicsview/qgraphicstransform_p.h
@@ -51,12 +51,14 @@ QT_BEGIN_NAMESPACE
class QGraphicsItem;
-class QGraphicsTransformPrivate : public QObjectPrivate {
+// ### Qt 6: unexport again, if QtQuick1's QDeclarativeTranslatePrivate is gone by then
+class Q_WIDGETS_EXPORT QGraphicsTransformPrivate : public QObjectPrivate {
public:
Q_DECLARE_PUBLIC(QGraphicsTransform)
QGraphicsTransformPrivate()
: QObjectPrivate(), item(0) {}
+ ~QGraphicsTransformPrivate();
QGraphicsItem *item;
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index c270c4be88..ac8cd45f9e 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -362,6 +362,10 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
styleOptions.reserve(QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS);
}
+QGraphicsViewPrivate::~QGraphicsViewPrivate()
+{
+}
+
/*!
\internal
*/
@@ -2460,6 +2464,7 @@ QPolygonF QGraphicsView::mapToScene(const QRect &rect) const
QPolygonF QGraphicsView::mapToScene(const QPolygon &polygon) const
{
QPolygonF poly;
+ poly.reserve(polygon.count());
foreach (const QPoint &point, polygon)
poly << mapToScene(point);
return poly;
@@ -2555,6 +2560,7 @@ QPolygon QGraphicsView::mapFromScene(const QRectF &rect) const
QPolygon QGraphicsView::mapFromScene(const QPolygonF &polygon) const
{
QPolygon poly;
+ poly.reserve(polygon.count());
foreach (const QPointF &point, polygon)
poly << mapFromScene(point);
return poly;
@@ -2669,7 +2675,9 @@ void QGraphicsView::updateScene(const QList<QRectF> &rects)
// Extract and reset dirty scene rect info.
QVector<QRect> dirtyViewportRects;
const QVector<QRect> &dirtyRects = d->dirtyRegion.rects();
- for (int i = 0; i < dirtyRects.size(); ++i)
+ const int dirtyRectsCount = dirtyRects.size();
+ dirtyViewportRects.reserve(dirtyRectsCount + rects.count());
+ for (int i = 0; i < dirtyRectsCount; ++i)
dirtyViewportRects += dirtyRects.at(i);
d->dirtyRegion = QRegion();
d->dirtyBoundingRect = QRect();
diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h
index d426273d97..667fa76fe7 100644
--- a/src/widgets/graphicsview/qgraphicsview.h
+++ b/src/widgets/graphicsview/qgraphicsview.h
@@ -108,8 +108,8 @@ public:
};
Q_DECLARE_FLAGS(OptimizationFlags, OptimizationFlag)
- QGraphicsView(QWidget *parent = 0);
- QGraphicsView(QGraphicsScene *scene, QWidget *parent = 0);
+ QGraphicsView(QWidget *parent = Q_NULLPTR);
+ QGraphicsView(QGraphicsScene *scene, QWidget *parent = Q_NULLPTR);
~QGraphicsView();
QSize sizeHint() const Q_DECL_OVERRIDE;
@@ -230,7 +230,7 @@ protected Q_SLOTS:
void setupViewport(QWidget *widget) Q_DECL_OVERRIDE;
protected:
- QGraphicsView(QGraphicsViewPrivate &, QWidget *parent = 0);
+ QGraphicsView(QGraphicsViewPrivate &, QWidget *parent = Q_NULLPTR);
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE;
diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h
index fec8336695..dcbffb1c39 100644
--- a/src/widgets/graphicsview/qgraphicsview_p.h
+++ b/src/widgets/graphicsview/qgraphicsview_p.h
@@ -63,6 +63,7 @@ class Q_WIDGETS_EXPORT QGraphicsViewPrivate : public QAbstractScrollAreaPrivate
Q_DECLARE_PUBLIC(QGraphicsView)
public:
QGraphicsViewPrivate();
+ ~QGraphicsViewPrivate();
void recalculateContentSize();
void centerView(QGraphicsView::ViewportAnchor anchor);
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp
index 6f10e2854c..8ffb60411c 100644
--- a/src/widgets/graphicsview/qgraphicswidget.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget.cpp
@@ -304,6 +304,7 @@ void QGraphicsWidget::resize(const QSizeF &size)
/*!
\fn void QGraphicsWidget::resize(qreal w, qreal h)
+ \overload
This convenience function is equivalent to calling resize(QSizeF(w, h)).
@@ -2397,7 +2398,7 @@ bool QGraphicsWidget::close()
#if 0
void QGraphicsWidget::dumpFocusChain()
{
- qDebug() << "=========== Dumping focus chain ==============";
+ qDebug("=========== Dumping focus chain ==============");
int i = 0;
QGraphicsWidget *next = this;
QSet<QGraphicsWidget*> visited;
diff --git a/src/widgets/graphicsview/qgraphicswidget.h b/src/widgets/graphicsview/qgraphicswidget.h
index 3ecdeac158..0878e020bc 100644
--- a/src/widgets/graphicsview/qgraphicswidget.h
+++ b/src/widgets/graphicsview/qgraphicswidget.h
@@ -74,7 +74,7 @@ class Q_WIDGETS_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphic
Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground)
Q_PROPERTY(QGraphicsLayout* layout READ layout WRITE setLayout NOTIFY layoutChanged)
public:
- QGraphicsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+ QGraphicsWidget(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
~QGraphicsWidget();
QGraphicsLayout *layout() const;
void setLayout(QGraphicsLayout *layout);
@@ -156,8 +156,8 @@ public:
};
int type() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
- virtual void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ virtual void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR);
QRectF boundingRect() const Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
@@ -213,7 +213,7 @@ protected:
virtual void ungrabMouseEvent(QEvent *event);
virtual void grabKeyboardEvent(QEvent *event);
virtual void ungrabKeyboardEvent(QEvent *event);
- QGraphicsWidget(QGraphicsWidgetPrivate &, QGraphicsItem *parent, Qt::WindowFlags wFlags = 0);
+ QGraphicsWidget(QGraphicsWidgetPrivate &, QGraphicsItem *parent, Qt::WindowFlags wFlags = Qt::WindowFlags());
private:
Q_DISABLE_COPY(QGraphicsWidget)
diff --git a/src/widgets/graphicsview/qsimplex_p.cpp b/src/widgets/graphicsview/qsimplex_p.cpp
index 1aeade6640..b827ab1400 100644
--- a/src/widgets/graphicsview/qsimplex_p.cpp
+++ b/src/widgets/graphicsview/qsimplex_p.cpp
@@ -140,7 +140,7 @@ bool QSimplex::setConstraints(const QList<QSimplexConstraint *> &newConstraints)
// Remove constraints of type Var == K and replace them for their value.
if (!simplifyConstraints(&constraints)) {
- qWarning() << "QSimplex: No feasible solution!";
+ qWarning("QSimplex: No feasible solution!");
clearDataStructures();
return false;
}
@@ -230,7 +230,7 @@ bool QSimplex::setConstraints(const QList<QSimplexConstraint *> &newConstraints)
matrix = (qreal *)malloc(sizeof(qreal) * columns * rows);
if (!matrix) {
- qWarning() << "QSimplex: Unable to allocate memory!";
+ qWarning("QSimplex: Unable to allocate memory!");
return false;
}
for (int i = columns * rows - 1; i >= 0; --i)
@@ -281,7 +281,7 @@ bool QSimplex::setConstraints(const QList<QSimplexConstraint *> &newConstraints)
// Otherwise, we clean up our structures and report there is
// no feasible solution.
if ((valueAt(0, columns - 1) != 0.0) && (qAbs(valueAt(0, columns - 1)) > 0.00001)) {
- qWarning() << "QSimplex: No feasible solution!";
+ qWarning("QSimplex: No feasible solution!");
clearDataStructures();
return false;
}
@@ -471,7 +471,7 @@ bool QSimplex::iterate()
// Find Pivot row for column
int pivotRow = pivotRowForColumn(pivotColumn);
if (pivotRow == -1) {
- qWarning() << "QSimplex: Unbounded problem!";
+ qWarning("QSimplex: Unbounded problem!");
return false;
}
diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri
index 2bbf7ac1ff..245962d35f 100644
--- a/src/widgets/itemviews/itemviews.pri
+++ b/src/widgets/itemviews/itemviews.pri
@@ -4,6 +4,7 @@ HEADERS += \
itemviews/qabstractitemview.h \
itemviews/qabstractitemview_p.h \
itemviews/qheaderview.h \
+ itemviews/qheaderview_p.h \
itemviews/qlistview.h \
itemviews/qlistview_p.h \
itemviews/qbsptree_p.h \
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index 6efe5ccb71..c2dd1ec8fd 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -455,6 +455,12 @@ bool QAbstractItemDelegatePrivate::editorEventFilter(QObject *object, QEvent *ev
if (editorHandlesKeyEvent(editor, keyEvent))
return false;
+ if (keyEvent->matches(QKeySequence::Cancel)) {
+ // don't commit data
+ emit q->closeEditor(editor, QAbstractItemDelegate::RevertModelCache);
+ return true;
+ }
+
switch (keyEvent->key()) {
case Qt::Key_Tab:
if (tryFixup(editor)) {
@@ -479,10 +485,6 @@ bool QAbstractItemDelegatePrivate::editorEventFilter(QObject *object, QEvent *ev
QMetaObject::invokeMethod(q, "_q_commitDataAndCloseEditor",
Qt::QueuedConnection, Q_ARG(QWidget*, editor));
return false;
- case Qt::Key_Escape:
- // don't commit data
- emit q->closeEditor(editor, QAbstractItemDelegate::RevertModelCache);
- return true;
default:
return false;
}
@@ -509,7 +511,7 @@ bool QAbstractItemDelegatePrivate::editorEventFilter(QObject *object, QEvent *ev
emit q->closeEditor(editor, QAbstractItemDelegate::NoHint);
}
} else if (event->type() == QEvent::ShortcutOverride) {
- if (static_cast<QKeyEvent*>(event)->key() == Qt::Key_Escape) {
+ if (static_cast<QKeyEvent*>(event)->matches(QKeySequence::Cancel)) {
event->accept();
return true;
}
diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h
index c250179087..b29717d1e1 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.h
+++ b/src/widgets/itemviews/qabstractitemdelegate.h
@@ -63,7 +63,7 @@ public:
RevertModelCache
};
- explicit QAbstractItemDelegate(QObject *parent = 0);
+ explicit QAbstractItemDelegate(QObject *parent = Q_NULLPTR);
virtual ~QAbstractItemDelegate();
// painting
@@ -113,7 +113,7 @@ Q_SIGNALS:
void sizeHintChanged(const QModelIndex &);
protected:
- QAbstractItemDelegate(QObjectPrivate &, QObject *parent = 0);
+ QAbstractItemDelegate(QObjectPrivate &, QObject *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QAbstractItemDelegate)
Q_DISABLE_COPY(QAbstractItemDelegate)
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 2caf5d1eb3..ad7be840d0 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -1882,8 +1882,7 @@ void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event)
|| (d->pressedIndex != index)) {
QMouseEvent me(QEvent::MouseButtonPress,
event->localPos(), event->windowPos(), event->screenPos(),
- event->button(), event->buttons(), event->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(&me, event->source());
+ event->button(), event->buttons(), event->modifiers(), event->source());
mousePressEvent(&me);
return;
}
@@ -2386,7 +2385,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
}
#endif
break;
-#ifdef Q_OS_MAC
+#ifdef Q_OS_OSX
case Qt::Key_Enter:
case Qt::Key_Return:
// Propagate the enter if you couldn't edit the item and there are no
@@ -2416,7 +2415,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
selectAll();
break;
}
-#ifdef Q_OS_MAC
+#ifdef Q_OS_OSX
if (event->key() == Qt::Key_O && event->modifiers() & Qt::ControlModifier && currentIndex().isValid()) {
emit activated(currentIndex());
break;
@@ -2637,6 +2636,11 @@ void QAbstractItemView::updateEditorGeometries()
Q_D(QAbstractItemView);
if(d->editorIndexHash.isEmpty())
return;
+ if (d->delayedPendingLayout) {
+ // doItemsLayout() will end up calling this function again
+ d->executePostedLayout();
+ return;
+ }
QStyleOptionViewItem option = d->viewOptionsV1();
QEditorIndexHash::iterator it = d->editorIndexHash.begin();
QWidgetList editorsToRelease;
@@ -3017,13 +3021,12 @@ int QAbstractItemView::sizeHintForRow(int row) const
QStyleOptionViewItem option = d->viewOptionsV1();
int height = 0;
int colCount = d->model->columnCount(d->root);
- QModelIndex index;
for (int c = 0; c < colCount; ++c) {
- index = d->model->index(row, c, d->root);
+ const QModelIndex index = d->model->index(row, c, d->root);
if (QWidget *editor = d->editorForIndex(index).widget.data())
height = qMax(height, editor->height());
- int hint = d->delegateForIndex(index)->sizeHint(option, index).height();
- height = qMax(height, hint);
+ if (const QAbstractItemDelegate *delegate = d->delegateForIndex(index))
+ height = qMax(height, delegate->sizeHint(option, index).height());
}
return height;
}
@@ -3048,13 +3051,12 @@ int QAbstractItemView::sizeHintForColumn(int column) const
QStyleOptionViewItem option = d->viewOptionsV1();
int width = 0;
int rows = d->model->rowCount(d->root);
- QModelIndex index;
for (int r = 0; r < rows; ++r) {
- index = d->model->index(r, column, d->root);
+ const QModelIndex index = d->model->index(r, column, d->root);
if (QWidget *editor = d->editorForIndex(index).widget.data())
width = qMax(width, editor->sizeHint().width());
- int hint = d->delegateForIndex(index)->sizeHint(option, index).width();
- width = qMax(width, hint);
+ if (const QAbstractItemDelegate *delegate = d->delegateForIndex(index))
+ width = qMax(width, delegate->sizeHint(option, index).width());
}
return width;
}
diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h
index 1be17b6c0e..ff1848b149 100644
--- a/src/widgets/itemviews/qabstractitemview.h
+++ b/src/widgets/itemviews/qabstractitemview.h
@@ -115,7 +115,7 @@ public:
};
Q_ENUM(ScrollMode)
- explicit QAbstractItemView(QWidget *parent = 0);
+ explicit QAbstractItemView(QWidget *parent = Q_NULLPTR);
~QAbstractItemView();
virtual void setModel(QAbstractItemModel *model);
@@ -258,7 +258,7 @@ Q_SIGNALS:
void iconSizeChanged(const QSize &size);
protected:
- QAbstractItemView(QAbstractItemViewPrivate &, QWidget *parent = 0);
+ QAbstractItemView(QAbstractItemViewPrivate &, QWidget *parent = Q_NULLPTR);
void setHorizontalStepsPerItem(int steps);
int horizontalStepsPerItem() const;
@@ -283,7 +283,7 @@ protected:
virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index,
- const QEvent *event = 0) const;
+ const QEvent *event = Q_NULLPTR) const;
#ifndef QT_NO_DRAGANDDROP
virtual void startDrag(Qt::DropActions supportedActions);
diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h
index 016c50436b..bb88b25652 100644
--- a/src/widgets/itemviews/qabstractitemview_p.h
+++ b/src/widgets/itemviews/qabstractitemview_p.h
@@ -74,7 +74,7 @@ typedef QHash<QWidget *, QPersistentModelIndex> QEditorIndexHash;
typedef QHash<QPersistentModelIndex, QEditorInfo> QIndexEditorHash;
typedef QPair<QRect, QModelIndex> QItemViewPaintPair;
-typedef QList<QItemViewPaintPair> QItemViewPaintPairs;
+typedef QVector<QItemViewPaintPair> QItemViewPaintPairs;
class QEmptyModel : public QAbstractItemModel
{
diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp
index 5c317bbb0c..92bbdf6b69 100644
--- a/src/widgets/itemviews/qcolumnview.cpp
+++ b/src/widgets/itemviews/qcolumnview.cpp
@@ -861,11 +861,15 @@ void QColumnView::setColumnWidths(const QList<int> &list)
{
Q_D(QColumnView);
int i = 0;
- for (; (i < list.count() && i < d->columns.count()); ++i) {
+ const int listCount = list.count();
+ const int count = qMin(listCount, d->columns.count());
+ for (; i < count; ++i) {
d->columns.at(i)->resize(list.at(i), d->columns.at(i)->height());
d->columnSizes[i] = list.at(i);
}
- for (; i < list.count(); ++i)
+
+ d->columnSizes.reserve(listCount);
+ for (; i < listCount; ++i)
d->columnSizes.append(list.at(i));
}
@@ -878,7 +882,9 @@ QList<int> QColumnView::columnWidths() const
{
Q_D(const QColumnView);
QList<int> list;
- for (int i = 0; i < d->columns.count(); ++i)
+ const int columnCount = d->columns.count();
+ list.reserve(columnCount);
+ for (int i = 0; i < columnCount; ++i)
list.append(d->columnSizes.at(i));
return list;
}
diff --git a/src/widgets/itemviews/qcolumnview.h b/src/widgets/itemviews/qcolumnview.h
index 792ae04eb6..58472ddd8e 100644
--- a/src/widgets/itemviews/qcolumnview.h
+++ b/src/widgets/itemviews/qcolumnview.h
@@ -52,7 +52,7 @@ Q_SIGNALS:
void updatePreviewWidget(const QModelIndex &index);
public:
- explicit QColumnView(QWidget *parent = 0);
+ explicit QColumnView(QWidget *parent = Q_NULLPTR);
~QColumnView();
// QAbstractItemView overloads
@@ -76,7 +76,7 @@ public:
QList<int> columnWidths() const;
protected:
- QColumnView(QColumnViewPrivate &dd, QWidget *parent = 0);
+ QColumnView(QColumnViewPrivate &dd, QWidget *parent = Q_NULLPTR);
// QAbstractItemView overloads
bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp
index c9fdf9967a..ee7b3613a2 100644
--- a/src/widgets/itemviews/qdatawidgetmapper.cpp
+++ b/src/widgets/itemviews/qdatawidgetmapper.cpp
@@ -756,7 +756,7 @@ void QDataWidgetMapper::clearMapping()
QList<QDataWidgetMapperPrivate::WidgetMapper> copy;
d->widgetMap.swap(copy); // a C++98 move
- for (std::reverse_iterator<QList<QDataWidgetMapperPrivate::WidgetMapper>::const_iterator> it(copy.cend()), end(copy.cbegin()); it != end; ++it) {
+ for (QList<QDataWidgetMapperPrivate::WidgetMapper>::const_reverse_iterator it = copy.crbegin(), end = copy.crend(); it != end; ++it) {
if (it->widget)
it->widget->removeEventFilter(d->delegate);
}
diff --git a/src/widgets/itemviews/qdatawidgetmapper.h b/src/widgets/itemviews/qdatawidgetmapper.h
index 5ccbee4d68..4dd5e0e14c 100644
--- a/src/widgets/itemviews/qdatawidgetmapper.h
+++ b/src/widgets/itemviews/qdatawidgetmapper.h
@@ -55,7 +55,7 @@ class Q_WIDGETS_EXPORT QDataWidgetMapper: public QObject
Q_PROPERTY(SubmitPolicy submitPolicy READ submitPolicy WRITE setSubmitPolicy)
public:
- explicit QDataWidgetMapper(QObject *parent = 0);
+ explicit QDataWidgetMapper(QObject *parent = Q_NULLPTR);
~QDataWidgetMapper();
void setModel(QAbstractItemModel *model);
diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp
index 50406b51f4..0c157c940f 100644
--- a/src/widgets/itemviews/qdirmodel.cpp
+++ b/src/widgets/itemviews/qdirmodel.cpp
@@ -66,7 +66,6 @@ public:
struct QDirNode
{
QDirNode() : parent(0), populated(false), stat(false) {}
- ~QDirNode() { children.clear(); }
QDirNode *parent;
QFileInfo info;
QIcon icon; // cache the icon
diff --git a/src/widgets/itemviews/qdirmodel.h b/src/widgets/itemviews/qdirmodel.h
index dcc337244c..536e5299a2 100644
--- a/src/widgets/itemviews/qdirmodel.h
+++ b/src/widgets/itemviews/qdirmodel.h
@@ -60,8 +60,8 @@ public:
};
QDirModel(const QStringList &nameFilters, QDir::Filters filters,
- QDir::SortFlags sort, QObject *parent = 0);
- explicit QDirModel(QObject *parent = 0);
+ QDir::SortFlags sort, QObject *parent = Q_NULLPTR);
+ explicit QDirModel(QObject *parent = Q_NULLPTR);
~QDirModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@@ -127,7 +127,7 @@ public Q_SLOTS:
void refresh(const QModelIndex &parent = QModelIndex());
protected:
- QDirModel(QDirModelPrivate &, QObject *parent = 0);
+ QDirModel(QDirModelPrivate &, QObject *parent = Q_NULLPTR);
friend class QFileDialogPrivate;
private:
diff --git a/src/widgets/itemviews/qfileiconprovider.cpp b/src/widgets/itemviews/qfileiconprovider.cpp
index 051cb8e7cc..f43bcd5d5a 100644
--- a/src/widgets/itemviews/qfileiconprovider.cpp
+++ b/src/widgets/itemviews/qfileiconprovider.cpp
@@ -117,6 +117,7 @@ public:
if (themeSizes.isEmpty())
return sizes;
+ sizes.reserve(themeSizes.count());
foreach (int size, themeSizes)
sizes << QSize(size, size);
}
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 4cb28d0804..338627c79f 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2608,10 +2608,12 @@ bool QHeaderView::viewportEvent(QEvent *e)
}
return true; }
#endif // QT_NO_STATUSTIP
- case QEvent::Hide:
- case QEvent::Show:
case QEvent::FontChange:
- case QEvent::StyleChange:{
+ case QEvent::StyleChange:
+ d->invalidateCachedSizeHint();
+ // Fall through
+ case QEvent::Hide:
+ case QEvent::Show: {
QAbstractScrollArea *parent = qobject_cast<QAbstractScrollArea *>(parentWidget());
if (parent && parent->isVisible()) // Only resize if we have a visible parent
resizeSections();
diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h
index e0f57130c0..d892614a39 100644
--- a/src/widgets/itemviews/qheaderview.h
+++ b/src/widgets/itemviews/qheaderview.h
@@ -68,7 +68,7 @@ public:
};
Q_ENUM(ResizeMode)
- explicit QHeaderView(Qt::Orientation orientation, QWidget *parent = 0);
+ explicit QHeaderView(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
virtual ~QHeaderView();
void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
@@ -202,7 +202,7 @@ protected Q_SLOTS:
void sectionsAboutToBeRemoved(const QModelIndex &parent, int logicalFirst, int logicalLast);
protected:
- QHeaderView(QHeaderViewPrivate &dd, Qt::Orientation orientation, QWidget *parent = 0);
+ QHeaderView(QHeaderViewPrivate &dd, Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
void initialize();
void initializeSections();
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index 621c3c990e..7f92d2a81b 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -369,6 +369,7 @@ public:
#endif
};
+Q_DECLARE_TYPEINFO(QHeaderViewPrivate::SectionItem, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h
index edc224b0f3..beba6b90fb 100644
--- a/src/widgets/itemviews/qitemdelegate.h
+++ b/src/widgets/itemviews/qitemdelegate.h
@@ -53,7 +53,7 @@ class Q_WIDGETS_EXPORT QItemDelegate : public QAbstractItemDelegate
Q_PROPERTY(bool clipping READ hasClipping WRITE setClipping)
public:
- explicit QItemDelegate(QObject *parent = 0);
+ explicit QItemDelegate(QObject *parent = Q_NULLPTR);
~QItemDelegate();
bool hasClipping() const;
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 8257944821..9c79509874 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -53,6 +53,8 @@
QT_BEGIN_NAMESPACE
+extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
+
/*!
\class QListView
@@ -796,6 +798,35 @@ void QListView::mouseReleaseEvent(QMouseEvent *e)
}
}
+#ifndef QT_NO_WHEELEVENT
+/*!
+ \reimp
+*/
+void QListView::wheelEvent(QWheelEvent *e)
+{
+ Q_D(QListView);
+ if (e->orientation() == Qt::Vertical) {
+ if (e->angleDelta().x() == 0
+ && ((d->flow == TopToBottom && d->wrap) || (d->flow == LeftToRight && !d->wrap))
+ && d->vbar->minimum() == 0 && d->vbar->maximum() == 0) {
+ QPoint pixelDelta(e->pixelDelta().y(), e->pixelDelta().x());
+ QPoint angleDelta(e->angleDelta().y(), e->angleDelta().x());
+ QWheelEvent hwe(e->pos(), e->globalPos(), pixelDelta, angleDelta, e->delta(),
+ Qt::Horizontal, e->buttons(), e->modifiers(), e->phase());
+ if (e->spontaneous())
+ qt_sendSpontaneousEvent(d->hbar, &hwe);
+ else
+ QApplication::sendEvent(d->hbar, &hwe);
+ e->setAccepted(hwe.isAccepted());
+ } else {
+ QApplication::sendEvent(d->vbar, e);
+ }
+ } else {
+ QApplication::sendEvent(d->hbar, e);
+ }
+}
+#endif // QT_NO_WHEELEVENT
+
/*!
\reimp
*/
diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h
index f62c96067f..433933b500 100644
--- a/src/widgets/itemviews/qlistview.h
+++ b/src/widgets/itemviews/qlistview.h
@@ -72,7 +72,7 @@ public:
enum ViewMode { ListMode, IconMode };
Q_ENUM(ViewMode)
- explicit QListView(QWidget *parent = 0);
+ explicit QListView(QWidget *parent = Q_NULLPTR);
~QListView();
void setMovement(Movement movement);
@@ -131,7 +131,7 @@ Q_SIGNALS:
void indexesMoved(const QModelIndexList &indexes);
protected:
- QListView(QListViewPrivate &, QWidget *parent = 0);
+ QListView(QListViewPrivate &, QWidget *parent = Q_NULLPTR);
bool event(QEvent *e) Q_DECL_OVERRIDE;
@@ -146,6 +146,9 @@ protected:
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+#ifndef QT_NO_WHEELEVENT
+ void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
+#endif
void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h
index fe059d73dd..62fa45e640 100644
--- a/src/widgets/itemviews/qlistview_p.h
+++ b/src/widgets/itemviews/qlistview_p.h
@@ -93,6 +93,7 @@ private:
mutable int indexHint;
uint visited;
};
+Q_DECLARE_TYPEINFO(QListViewItem, Q_PRIMITIVE_TYPE);
struct QListViewLayoutInfo
{
@@ -105,6 +106,7 @@ struct QListViewLayoutInfo
QListView::Flow flow;
int max;
};
+Q_DECLARE_TYPEINFO(QListViewLayoutInfo, Q_PRIMITIVE_TYPE);
class QListView;
class QListViewPrivate;
@@ -291,7 +293,7 @@ private:
};
-class QListViewPrivate: public QAbstractItemViewPrivate
+class Q_AUTOTEST_EXPORT QListViewPrivate: public QAbstractItemViewPrivate
{
Q_DECLARE_PUBLIC(QListView)
public:
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 66f965aa54..d4d22c8bef 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -299,7 +299,10 @@ void QListModel::sort(int column, Qt::SortOrder order)
std::sort(sorting.begin(), sorting.end(), compare);
QModelIndexList fromIndexes;
QModelIndexList toIndexes;
- for (int r = 0; r < sorting.count(); ++r) {
+ const int sortingCount = sorting.count();
+ fromIndexes.reserve(sortingCount);
+ toIndexes.reserve(sortingCount);
+ for (int r = 0; r < sortingCount; ++r) {
QListWidgetItem *item = sorting.at(r).first;
toIndexes.append(createIndex(r, 0, item));
fromIndexes.append(createIndex(sorting.at(r).second, 0, sorting.at(r).first));
@@ -423,7 +426,9 @@ QMimeData *QListModel::internalMimeData() const
QMimeData *QListModel::mimeData(const QModelIndexList &indexes) const
{
QList<QListWidgetItem*> itemlist;
- for (int i = 0; i < indexes.count(); ++i)
+ const int indexesCount = indexes.count();
+ itemlist.reserve(indexesCount);
+ for (int i = 0; i < indexesCount; ++i)
itemlist << at(indexes.at(i).row());
const QListWidget *view = qobject_cast<const QListWidget*>(QObject::parent());
@@ -1257,7 +1262,7 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
activated when the user clicks or double clicks on it, depending on the
system configuration. It is also activated when the user presses the
activation key (on Windows and X11 this is the \uicontrol Return key, on Mac OS
- X it is \uicontrol{Ctrl+0}).
+ X it is \uicontrol{Command+O}).
*/
/*!
@@ -1694,7 +1699,9 @@ QList<QListWidgetItem*> QListWidget::selectedItems() const
Q_D(const QListWidget);
QModelIndexList indexes = selectionModel()->selectedIndexes();
QList<QListWidgetItem*> items;
- for (int i = 0; i < indexes.count(); ++i)
+ const int numIndexes = indexes.count();
+ items.reserve(numIndexes);
+ for (int i = 0; i < numIndexes; ++i)
items.append(d->listModel()->at(indexes.at(i).row()));
return items;
}
@@ -1710,7 +1717,9 @@ QList<QListWidgetItem*> QListWidget::findItems(const QString &text, Qt::MatchFla
QModelIndexList indexes = d->listModel()->match(model()->index(0, 0, QModelIndex()),
Qt::DisplayRole, text, -1, flags);
QList<QListWidgetItem*> items;
- for (int i = 0; i < indexes.size(); ++i)
+ const int indexesSize = indexes.size();
+ items.reserve(indexesSize);
+ for (int i = 0; i < indexesSize; ++i)
items.append(d->listModel()->at(indexes.at(i).row()));
return items;
}
@@ -1795,6 +1804,7 @@ QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*> items) const
// if non empty, it's called from the model's own mimeData
if (cachedIndexes.isEmpty()) {
+ cachedIndexes.reserve(items.count());
foreach (QListWidgetItem *item, items)
cachedIndexes << indexFromItem(item);
@@ -1845,7 +1855,9 @@ void QListWidget::dropEvent(QDropEvent *event) {
if (d->dropOn(event, &row, &col, &topIndex)) {
QList<QModelIndex> selIndexes = selectedIndexes();
QList<QPersistentModelIndex> persIndexes;
- for (int i = 0; i < selIndexes.count(); i++)
+ const int selIndexesCount = selIndexes.count();
+ persIndexes.reserve(selIndexesCount);
+ for (int i = 0; i < selIndexesCount; i++)
persIndexes.append(selIndexes.at(i));
if (persIndexes.contains(topIndex))
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index 8ab864c930..1fbdc472db 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -55,10 +55,10 @@ class Q_WIDGETS_EXPORT QListWidgetItem
friend class QListWidget;
public:
enum ItemType { Type = 0, UserType = 1000 };
- explicit QListWidgetItem(QListWidget *view = 0, int type = Type);
- explicit QListWidgetItem(const QString &text, QListWidget *view = 0, int type = Type);
+ explicit QListWidgetItem(QListWidget *view = Q_NULLPTR, int type = Type);
+ explicit QListWidgetItem(const QString &text, QListWidget *view = Q_NULLPTR, int type = Type);
explicit QListWidgetItem(const QIcon &icon, const QString &text,
- QListWidget *view = 0, int type = Type);
+ QListWidget *view = Q_NULLPTR, int type = Type);
QListWidgetItem(const QListWidgetItem &other);
virtual ~QListWidgetItem();
@@ -198,7 +198,7 @@ class Q_WIDGETS_EXPORT QListWidget : public QListView
friend class QListWidgetItem;
friend class QListModel;
public:
- explicit QListWidget(QWidget *parent = 0);
+ explicit QListWidget(QWidget *parent = Q_NULLPTR);
~QListWidget();
QListWidgetItem *item(int row) const;
@@ -299,7 +299,7 @@ private:
};
inline void QListWidget::removeItemWidget(QListWidgetItem *aItem)
-{ setItemWidget(aItem, 0); }
+{ setItemWidget(aItem, Q_NULLPTR); }
inline void QListWidget::addItem(QListWidgetItem *aitem)
{ insertItem(count(), aitem); }
diff --git a/src/widgets/itemviews/qstyleditemdelegate.h b/src/widgets/itemviews/qstyleditemdelegate.h
index 590ddf6614..541830239a 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.h
+++ b/src/widgets/itemviews/qstyleditemdelegate.h
@@ -52,7 +52,7 @@ class Q_WIDGETS_EXPORT QStyledItemDelegate : public QAbstractItemDelegate
Q_OBJECT
public:
- explicit QStyledItemDelegate(QObject *parent = 0);
+ explicit QStyledItemDelegate(QObject *parent = Q_NULLPTR);
~QStyledItemDelegate();
// painting
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index ae31387faf..ee0d41ce15 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -190,7 +190,7 @@ QList<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w,
#ifdef DEBUG_SPAN_UPDATE
QDebug operator<<(QDebug str, const QSpanCollection::Span &span)
{
- str << "(" << span.top() << "," << span.left() << "," << span.bottom() << "," << span.right() << ")";
+ str << '(' << span.top() << ',' << span.left() << ',' << span.bottom() << ',' << span.right() << ')';
return str;
}
#endif
@@ -201,9 +201,7 @@ QDebug operator<<(QDebug str, const QSpanCollection::Span &span)
void QSpanCollection::updateInsertedRows(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << Q_FUNC_INFO;
- qDebug() << start << end;
- qDebug() << index;
+ qDebug() << start << end << endl << index;
#endif
if (spans.isEmpty())
return;
@@ -251,9 +249,7 @@ void QSpanCollection::updateInsertedRows(int start, int end)
void QSpanCollection::updateInsertedColumns(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << Q_FUNC_INFO;
- qDebug() << start << end;
- qDebug() << index;
+ qDebug() << start << end << endl << index;
#endif
if (spans.isEmpty())
return;
@@ -334,9 +330,7 @@ bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int
void QSpanCollection::updateRemovedRows(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << Q_FUNC_INFO;
- qDebug() << start << end;
- qDebug() << index;
+ qDebug() << start << end << endl << index;
#endif
if (spans.isEmpty())
return;
@@ -463,9 +457,7 @@ void QSpanCollection::updateRemovedRows(int start, int end)
void QSpanCollection::updateRemovedColumns(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << Q_FUNC_INFO;
- qDebug() << start << end;
- qDebug() << index;
+ qDebug() << start << end << endl << index;
#endif
if (spans.isEmpty())
return;
@@ -670,13 +662,14 @@ void QTableViewPrivate::trimHiddenSelections(QItemSelectionRange *range) const
void QTableViewPrivate::setSpan(int row, int column, int rowSpan, int columnSpan)
{
if (row < 0 || column < 0 || rowSpan <= 0 || columnSpan <= 0) {
- qWarning() << "QTableView::setSpan: invalid span given: (" << row << ',' << column << ',' << rowSpan << ',' << columnSpan << ')';
+ qWarning("QTableView::setSpan: invalid span given: (%d, %d, %d, %d)",
+ row, column, rowSpan, columnSpan);
return;
}
QSpanCollection::Span *sp = spans.spanAt(column, row);
if (sp) {
if (sp->top() != row || sp->left() != column) {
- qWarning() << "QTableView::setSpan: span cannot overlap";
+ qWarning("QTableView::setSpan: span cannot overlap");
return;
}
if (rowSpan == 1 && columnSpan == 1) {
@@ -688,7 +681,7 @@ void QTableViewPrivate::setSpan(int row, int column, int rowSpan, int columnSpan
spans.updateSpan(sp, old_height);
return;
} else if (rowSpan == 1 && columnSpan == 1) {
- qWarning() << "QTableView::setSpan: single cell span won't be added";
+ qWarning("QTableView::setSpan: single cell span won't be added");
return;
}
sp = new QSpanCollection::Span(row, column, rowSpan, columnSpan);
@@ -1884,6 +1877,7 @@ void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionF
break;
}
} while (expanded);
+ selection.reserve((right - left + 1) * (bottom - top + 1));
for (int horizontal = left; horizontal <= right; ++horizontal) {
int column = d->logicalColumn(horizontal);
for (int vertical = top; vertical <= bottom; ++vertical) {
@@ -1897,6 +1891,7 @@ void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionF
int left = d->visualColumn(tl.column());
int bottom = d->visualRow(br.row());
int right = d->visualColumn(br.column());
+ selection.reserve((right - left + 1) * (bottom - top + 1));
for (int horizontal = left; horizontal <= right; ++horizontal) {
int column = d->logicalColumn(horizontal);
for (int vertical = top; vertical <= bottom; ++vertical) {
@@ -1908,6 +1903,7 @@ void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionF
} else if (horizontalMoved) {
int left = d->visualColumn(tl.column());
int right = d->visualColumn(br.column());
+ selection.reserve(right - left + 1);
for (int visual = left; visual <= right; ++visual) {
int column = d->logicalColumn(visual);
QModelIndex topLeft = d->model->index(tl.row(), column, d->root);
@@ -1917,6 +1913,7 @@ void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionF
} else if (verticalMoved) {
int top = d->visualRow(tl.row());
int bottom = d->visualRow(br.row());
+ selection.reserve(bottom - top + 1);
for (int visual = top; visual <= bottom; ++visual) {
int row = d->logicalRow(visual);
QModelIndex topLeft = d->model->index(row, tl.column(), d->root);
@@ -2540,7 +2537,7 @@ void QTableView::setColumnHidden(int column, bool hide)
*/
/*!
- If \a enabled true enables sorting for the table and immediately
+ If \a enable is true, enables sorting for the table and immediately
trigger a call to sortByColumn() with the current sort section and
order
*/
diff --git a/src/widgets/itemviews/qtableview.h b/src/widgets/itemviews/qtableview.h
index d69b78c6fe..1bb23844cc 100644
--- a/src/widgets/itemviews/qtableview.h
+++ b/src/widgets/itemviews/qtableview.h
@@ -54,7 +54,7 @@ class Q_WIDGETS_EXPORT QTableView : public QAbstractItemView
Q_PROPERTY(bool cornerButtonEnabled READ isCornerButtonEnabled WRITE setCornerButtonEnabled)
public:
- explicit QTableView(QWidget *parent = 0);
+ explicit QTableView(QWidget *parent = Q_NULLPTR);
~QTableView();
void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 9ebcbc35a7..cd38f4b282 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -507,11 +507,15 @@ void QTableModel::sort(int column, Qt::SortOrder order)
QVector<QTableWidgetItem*> sorted_table(tableItems.count());
QModelIndexList from;
QModelIndexList to;
- for (int i = 0; i < rowCount(); ++i) {
+ const int numRows = rowCount();
+ const int numColumns = columnCount();
+ from.reserve(numRows * numColumns);
+ to.reserve(numRows * numColumns);
+ for (int i = 0; i < numRows; ++i) {
int r = (i < sortable.count()
? sortable.at(i).second
: unsortable.at(i - sortable.count()));
- for (int c = 0; c < columnCount(); ++c) {
+ for (int c = 0; c < numColumns; ++c) {
sorted_table[tableIndex(i, c)] = item(r, c);
from.append(createIndex(r, c));
to.append(createIndex(i, c));
@@ -551,9 +555,7 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
LessThan compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan);
std::stable_sort(sorting.begin(), sorting.end(), compare);
-
- QModelIndexList oldPersistentIndexes = persistentIndexList();
- QModelIndexList newPersistentIndexes = oldPersistentIndexes;
+ QModelIndexList oldPersistentIndexes, newPersistentIndexes;
QVector<QTableWidgetItem*> newTable = tableItems;
QVector<QTableWidgetItem*> newVertical = verticalHeaderItems;
QVector<QTableWidgetItem*> colItems = columnItems(column);
@@ -569,7 +571,12 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
newRow = oldRow;
vit = colItems.insert(vit, item);
if (newRow != oldRow) {
- changed = true;
+ if (!changed) {
+ emit layoutAboutToBeChanged();
+ oldPersistentIndexes = persistentIndexList();
+ newPersistentIndexes = oldPersistentIndexes;
+ changed = true;
+ }
// move the items @ oldRow to newRow
int cc = columnCount();
QVector<QTableWidgetItem*> rowItems(cc);
@@ -596,7 +603,6 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
}
if (changed) {
- emit layoutAboutToBeChanged();
tableItems = newTable;
verticalHeaderItems = newVertical;
changePersistentIndexList(oldPersistentIndexes,
@@ -812,7 +818,9 @@ QMimeData *QTableModel::internalMimeData() const
QMimeData *QTableModel::mimeData(const QModelIndexList &indexes) const
{
QList<QTableWidgetItem*> items;
- for (int i = 0; i < indexes.count(); ++i)
+ const int indexesCount = indexes.count();
+ items.reserve(indexesCount);
+ for (int i = 0; i < indexesCount; ++i)
items << item(indexes.at(i));
const QTableWidget *view = qobject_cast<const QTableWidget*>(QObject::parent());
@@ -2021,6 +2029,8 @@ QTableWidgetItem *QTableWidget::horizontalHeaderItem(int column) const
/*!
Sets the horizontal header item for column \a column to \a item.
+ If necessary, the column count is increased to fit the item.
+ The previous header item (if there was one) is deleted.
*/
void QTableWidget::setHorizontalHeaderItem(int column, QTableWidgetItem *item)
{
@@ -2326,7 +2336,9 @@ QList<QTableWidgetSelectionRange> QTableWidget::selectedRanges() const
{
const QList<QItemSelectionRange> ranges = selectionModel()->selection();
QList<QTableWidgetSelectionRange> result;
- for (int i = 0; i < ranges.count(); ++i)
+ const int rangesCount = ranges.count();
+ result.reserve(rangesCount);
+ for (int i = 0; i < rangesCount; ++i)
result.append(QTableWidgetSelectionRange(ranges.at(i).top(),
ranges.at(i).left(),
ranges.at(i).bottom(),
@@ -2372,7 +2384,9 @@ QList<QTableWidgetItem*> QTableWidget::findItems(const QString &text, Qt::MatchF
indexes += d->model->match(model()->index(0, column, QModelIndex()),
Qt::DisplayRole, text, -1, flags);
QList<QTableWidgetItem*> items;
- for (int i = 0; i < indexes.size(); ++i)
+ const int indexCount = indexes.size();
+ items.reserve(indexCount);
+ for (int i = 0; i < indexCount; ++i)
items.append(d->tableModel()->item(indexes.at(i)));
return items;
}
@@ -2565,6 +2579,7 @@ QMimeData *QTableWidget::mimeData(const QList<QTableWidgetItem*> items) const
// if non empty, it's called from the model's own mimeData
if (cachedIndexes.isEmpty()) {
+ cachedIndexes.reserve(items.count());
foreach (QTableWidgetItem *item, items)
cachedIndexes << indexFromItem(item);
@@ -2676,7 +2691,9 @@ void QTableWidget::dropEvent(QDropEvent *event) {
}
QList<QTableWidgetItem *> taken;
- for (int i = 0; i < indexes.count(); ++i)
+ const int indexesCount = indexes.count();
+ taken.reserve(indexesCount);
+ for (int i = 0; i < indexesCount; ++i)
taken.append(takeItem(indexes.at(i).row(), indexes.at(i).column()));
for (int i = 0; i < indexes.count(); ++i) {
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index 93639f0753..9acdc19863 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -214,8 +214,8 @@ class Q_WIDGETS_EXPORT QTableWidget : public QTableView
friend class QTableModel;
public:
- explicit QTableWidget(QWidget *parent = 0);
- QTableWidget(int rows, int columns, QWidget *parent = 0);
+ explicit QTableWidget(QWidget *parent = Q_NULLPTR);
+ QTableWidget(int rows, int columns, QWidget *parent = Q_NULLPTR);
~QTableWidget();
void setRowCount(int rows);
@@ -344,7 +344,7 @@ private:
};
inline void QTableWidget::removeCellWidget(int arow, int acolumn)
-{ setCellWidget(arow, acolumn, 0); }
+{ setCellWidget(arow, acolumn, Q_NULLPTR); }
inline QTableWidgetItem *QTableWidget::itemAt(int ax, int ay) const
{ return itemAt(QPoint(ax, ay)); }
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index e9e2e78e17..546cc488cb 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -60,7 +60,7 @@ class Q_WIDGETS_EXPORT QTreeView : public QAbstractItemView
Q_PROPERTY(bool expandsOnDoubleClick READ expandsOnDoubleClick WRITE setExpandsOnDoubleClick)
public:
- explicit QTreeView(QWidget *parent = 0);
+ explicit QTreeView(QWidget *parent = Q_NULLPTR);
~QTreeView();
void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
@@ -163,7 +163,7 @@ protected Q_SLOTS:
void rowsRemoved(const QModelIndex &parent, int first, int last);
protected:
- QTreeView(QTreeViewPrivate &dd, QWidget *parent = 0);
+ QTreeView(QTreeViewPrivate &dd, QWidget *parent = Q_NULLPTR);
void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index bf736bc387..676893ebf0 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -1720,12 +1720,12 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
}
} break;
case Qt::CheckStateRole:
- if ((itemFlags & Qt::ItemIsTristate) && value != Qt::PartiallyChecked) {
+ if ((itemFlags & Qt::ItemIsAutoTristate) && value != Qt::PartiallyChecked) {
for (int i = 0; i < children.count(); ++i) {
QTreeWidgetItem *child = children.at(i);
if (child->data(column, role).isValid()) {// has a CheckState
Qt::ItemFlags f = itemFlags; // a little hack to avoid multiple dataChanged signals
- itemFlags &= ~Qt::ItemIsTristate;
+ itemFlags &= ~Qt::ItemIsAutoTristate;
child->setData(column, role, value);
itemFlags = f;
}
@@ -1760,7 +1760,7 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
model->emitDataChanged(this, column);
if (role == Qt::CheckStateRole) {
QTreeWidgetItem *p;
- for (p = par; p && (p->itemFlags & Qt::ItemIsTristate); p = p->par)
+ for (p = par; p && (p->itemFlags & Qt::ItemIsAutoTristate); p = p->par)
model->emitDataChanged(p, column);
}
}
@@ -1779,7 +1779,7 @@ QVariant QTreeWidgetItem::data(int column, int role) const
break;
case Qt::CheckStateRole:
// special case for check state in tristate
- if (children.count() && (itemFlags & Qt::ItemIsTristate))
+ if (children.count() && (itemFlags & Qt::ItemIsAutoTristate))
return childrenCheckState(column);
// fallthrough intended
default:
@@ -3042,7 +3042,9 @@ QList<QTreeWidgetItem*> QTreeWidget::findItems(const QString &text, Qt::MatchFla
QModelIndexList indexes = d->model->match(model()->index(0, column, QModelIndex()),
Qt::DisplayRole, text, -1, flags);
QList<QTreeWidgetItem*> items;
- for (int i = 0; i < indexes.size(); ++i)
+ const int indexesSize = indexes.size();
+ items.reserve(indexesSize);
+ for (int i = 0; i < indexesSize; ++i)
items.append(d->item(indexes.at(i)));
return items;
}
@@ -3279,7 +3281,7 @@ QMimeData *QTreeWidget::mimeData(const QList<QTreeWidgetItem*> items) const
for (int i = 0; i < items.count(); ++i) {
QTreeWidgetItem *item = items.at(i);
if (!item) {
- qWarning() << "QTreeWidget::mimeData: Null-item passed";
+ qWarning("QTreeWidget::mimeData: Null-item passed");
return 0;
}
@@ -3371,7 +3373,9 @@ void QTreeWidget::dropEvent(QDropEvent *event) {
if (d->dropOn(event, &row, &col, &topIndex)) {
QList<QModelIndex> idxs = selectedIndexes();
QList<QPersistentModelIndex> indexes;
- for (int i = 0; i < idxs.count(); i++)
+ const int indexesCount = idxs.count();
+ indexes.reserve(indexesCount);
+ for (int i = 0; i < indexesCount; i++)
indexes.append(idxs.at(i));
if (indexes.contains(topIndex))
@@ -3382,7 +3386,7 @@ void QTreeWidget::dropEvent(QDropEvent *event) {
// Remove the items
QList<QTreeWidgetItem *> taken;
- for (int i = indexes.count() - 1; i >= 0; --i) {
+ for (int i = 0; i < indexes.count(); ++i) {
QTreeWidgetItem *parent = itemFromIndex(indexes.at(i));
if (!parent || !parent->parent()) {
taken.append(takeTopLevelItem(indexes.at(i).row()));
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index 564e10ac1a..995528fe37 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -172,7 +172,7 @@ public:
inline QTreeWidgetItem *parent() const { return par; }
inline QTreeWidgetItem *child(int index) const {
if (index < 0 || index >= children.size())
- return 0;
+ return Q_NULLPTR;
executePendingSort();
return children.at(index);
}
@@ -255,7 +255,7 @@ class Q_WIDGETS_EXPORT QTreeWidget : public QTreeView
friend class QTreeModel;
friend class QTreeWidgetItem;
public:
- explicit QTreeWidget(QWidget *parent = 0);
+ explicit QTreeWidget(QWidget *parent = Q_NULLPTR);
~QTreeWidget();
int columnCount() const;
@@ -375,7 +375,7 @@ private:
};
inline void QTreeWidget::removeItemWidget(QTreeWidgetItem *item, int column)
-{ setItemWidget(item, column, 0); }
+{ setItemWidget(item, column, Q_NULLPTR); }
inline QTreeWidgetItem *QTreeWidget::itemAt(int ax, int ay) const
{ return itemAt(QPoint(ax, ay)); }
diff --git a/src/widgets/itemviews/qwidgetitemdata_p.h b/src/widgets/itemviews/qwidgetitemdata_p.h
index 307d228c74..d8c1fc2ff7 100644
--- a/src/widgets/itemviews/qwidgetitemdata_p.h
+++ b/src/widgets/itemviews/qwidgetitemdata_p.h
@@ -58,6 +58,7 @@ public:
QVariant value;
inline bool operator==(const QWidgetItemData &other) const { return role == other.role && value == other.value; }
};
+Q_DECLARE_TYPEINFO(QWidgetItemData, Q_MOVABLE_TYPE);
#ifndef QT_NO_DATASTREAM
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 4dd10720d6..2c4e4d3125 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -223,8 +223,9 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
\snippet mainwindows/application/mainwindow.cpp 19
\codeline
- \snippet mainwindows/application/mainwindow.cpp 28
- \snippet mainwindows/application/mainwindow.cpp 31
+ \code
+ fileMenu->addAction(openAct);
+ \endcode
We recommend that actions are created as children of the window
they are used in. In most cases actions will be children of
@@ -254,7 +255,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
\value TextHeuristicRole This action should be put in the application menu based on the action's text
as described in the QMenuBar documentation.
\value ApplicationSpecificRole This action should be put in the application menu with an application specific role
- \value AboutQtRole This action matches handles the "About Qt" menu item.
+ \value AboutQtRole This action handles the "About Qt" menu item.
\value AboutRole This action should be placed where the "About" menu item is in the application menu. The text of
the menu item will be set to "About <application name>". The application name is fetched from the
\c{Info.plist} file in the application's bundle (See \l{Qt for OS X - Deployment}).
@@ -1230,7 +1231,7 @@ void QAction::activate(ActionEvent event)
\since 4.2
This indicates what role the action serves in the application menu on Mac
- OS X. By default all action have the TextHeuristicRole, which means that
+ OS X. By default all actions have the TextHeuristicRole, which means that
the action is added based on its text (see QMenuBar for more information).
The menu role can only be changed before the actions are put into the menu
@@ -1269,7 +1270,7 @@ QAction::MenuRole QAction::menuRole() const
For example:
\snippet code/src_gui_kernel_qaction.cpp 0
- \sa QAction::icon, QApplication::setAttribute()
+ \sa QAction::icon, QCoreApplication::setAttribute()
*/
void QAction::setIconVisibleInMenu(bool visible)
{
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h
index 1d69694699..8ef26b60bf 100644
--- a/src/widgets/kernel/qaction.h
+++ b/src/widgets/kernel/qaction.h
@@ -153,7 +153,7 @@ public:
enum ActionEvent { Trigger, Hover };
void activate(ActionEvent event);
- bool showStatusText(QWidget *widget=0);
+ bool showStatusText(QWidget *widget = Q_NULLPTR);
void setMenuRole(MenuRole menuRole);
MenuRole menuRole() const;
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 078feb4b03..e20e820f12 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -398,8 +398,6 @@ void qt_cleanup();
QStyle *QApplicationPrivate::app_style = 0; // default application style
bool QApplicationPrivate::overrides_native_style = false; // whether native QApplication style is
// overridden, i.e. not native
-QString QApplicationPrivate::styleOverride; // style override
-
#ifndef QT_NO_STYLE_STYLESHEET
QString QApplicationPrivate::styleSheet; // default application stylesheet
#endif
@@ -465,6 +463,13 @@ QDesktopWidget *qt_desktopWidget = 0; // root window widgets
*/
void QApplicationPrivate::process_cmdline()
{
+ if (!styleOverride.isEmpty()) {
+ if (app_style) {
+ delete app_style;
+ app_style = 0;
+ }
+ }
+
// process platform-indep command line
if (!qt_is_gui_used || !argc)
return;
@@ -480,13 +485,8 @@ void QApplicationPrivate::process_cmdline()
QByteArray arg = argv[i];
if (arg.startsWith("--"))
arg.remove(0, 1);
- QString s;
if (arg == "-qdevel" || arg == "-qdebug") {
// obsolete argument
- } else if (arg.indexOf("-style=", 0) != -1) {
- s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower());
- } else if (arg == "-style" && i < argc-1) {
- s = QString::fromLocal8Bit(argv[++i]).toLower();
#ifndef QT_NO_STYLE_STYLESHEET
} else if (arg == "-stylesheet" && i < argc -1) {
styleSheet = QLatin1String("file:///");
@@ -500,13 +500,6 @@ void QApplicationPrivate::process_cmdline()
} else {
argv[j++] = argv[i];
}
- if (!s.isEmpty()) {
- if (app_style) {
- delete app_style;
- app_style = 0;
- }
- styleOverride = s;
- }
}
if(j < argc) {
@@ -557,7 +550,7 @@ void QApplicationPrivate::process_cmdline()
and will make the application wait until a debugger connects to it.
\endlist
- \sa arguments()
+ \sa QCoreApplication::arguments()
*/
#ifdef Q_QDOC
@@ -747,15 +740,15 @@ void QApplicationPrivate::initializeWidgetFontHash()
if (const QFont *font = theme->font(QPlatformTheme::ItemViewFont))
fontHash->insert(QByteArrayLiteral("QAbstractItemView"), *font);
if (const QFont *font = theme->font(QPlatformTheme::ListViewFont))
- fontHash->insert(QByteArrayLiteral("QListViewFont"), *font);
+ fontHash->insert(QByteArrayLiteral("QListView"), *font);
if (const QFont *font = theme->font(QPlatformTheme::HeaderViewFont))
- fontHash->insert(QByteArrayLiteral("QHeaderViewFont"), *font);
+ fontHash->insert(QByteArrayLiteral("QHeaderView"), *font);
if (const QFont *font = theme->font(QPlatformTheme::ListBoxFont))
fontHash->insert(QByteArrayLiteral("QListBox"), *font);
if (const QFont *font = theme->font(QPlatformTheme::ComboMenuItemFont))
- fontHash->insert(QByteArrayLiteral("QComboMenuItemFont"), *font);
+ fontHash->insert(QByteArrayLiteral("QComboMenuItem"), *font);
if (const QFont *font = theme->font(QPlatformTheme::ComboLineEditFont))
- fontHash->insert(QByteArrayLiteral("QComboLineEditFont"), *font);
+ fontHash->insert(QByteArrayLiteral("QComboLineEdit"), *font);
if (const QFont *font = theme->font(QPlatformTheme::SmallFont))
fontHash->insert(QByteArrayLiteral("QSmallFont"), *font);
if (const QFont *font = theme->font(QPlatformTheme::MiniFont))
@@ -1905,7 +1898,7 @@ bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows
if (!w->isVisible() || w->data->is_closing)
break;
QWindow *window = w->windowHandle();
- if (!w->close()) // Qt::WA_DeleteOnClose may cause deletion.
+ if (!window->close()) // Qt::WA_DeleteOnClose may cause deletion.
return false;
if (window)
processedWindows->append(window);
@@ -1917,7 +1910,7 @@ bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows
if (w->isVisible() && w->windowType() != Qt::Desktop &&
!w->testAttribute(Qt::WA_DontShowOnScreen) && !w->data->is_closing) {
QWindow *window = w->windowHandle();
- if (!w->close()) // Qt::WA_DeleteOnClose may cause deletion.
+ if (!window->close()) // Qt::WA_DeleteOnClose may cause deletion.
return false;
if (window)
processedWindows->append(window);
@@ -1950,7 +1943,7 @@ bool QApplicationPrivate::tryCloseAllWindows()
\l quitOnLastWindowClosed to false.
\sa quitOnLastWindowClosed, lastWindowClosed(), QWidget::close(),
- QWidget::closeEvent(), lastWindowClosed(), quit(), topLevelWidgets(),
+ QWidget::closeEvent(), lastWindowClosed(), QCoreApplication::quit(), topLevelWidgets(),
QWidget::isWindow()
*/
void QApplication::closeAllWindows()
@@ -2970,8 +2963,8 @@ int QApplication::startDragDistance()
application will have time to exit its event loop and execute code at the
end of the \c{main()} function, after the QApplication::exec() call.
- \sa quitOnLastWindowClosed, quit(), exit(), processEvents(),
- QCoreApplication::exec()
+ \sa quitOnLastWindowClosed, QCoreApplication::quit(), QCoreApplication::exit(),
+ QCoreApplication::processEvents(), QCoreApplication::exec()
*/
int QApplication::exec()
{
@@ -3251,12 +3244,11 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QPointer<QWidget> pw = w;
while (w) {
- QMouseEvent me(mouse->type(), relpos, mouse->windowPos(), mouse->globalPos(), mouse->button(), mouse->buttons(),
- mouse->modifiers());
+ QMouseEvent me(mouse->type(), relpos, mouse->windowPos(), mouse->globalPos(),
+ mouse->button(), mouse->buttons(), mouse->modifiers(), mouse->source());
me.spont = mouse->spontaneous();
me.setTimestamp(mouse->timestamp());
QGuiApplicationPrivate::setMouseEventFlags(&me, mouse->flags());
- QGuiApplicationPrivate::setMouseEventSource(&me, mouse->source());
// throw away any mouse-tracking-only mouse events
if (!w->hasMouseTracking()
&& mouse->type() == QEvent::MouseMove && mouse->buttons() == 0) {
@@ -3690,7 +3682,9 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
{
// send to all application event filters
- if (sendThroughApplicationEventFilters(receiver, e))
+ if (threadRequiresCoreApplication()
+ && receiver->d_func()->threadData->thread == mainThread()
+ && sendThroughApplicationEventFilters(receiver, e))
return true;
if (receiver->isWidgetType()) {
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index d4b2326afd..7aaea2a947 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -104,11 +104,11 @@ public:
using QGuiApplication::palette;
static QPalette palette(const QWidget *);
static QPalette palette(const char *className);
- static void setPalette(const QPalette &, const char* className = 0);
+ static void setPalette(const QPalette &, const char* className = Q_NULLPTR);
static QFont font();
static QFont font(const QWidget*);
static QFont font(const char *className);
- static void setFont(const QFont &, const char* className = 0);
+ static void setFont(const QFont &, const char* className = Q_NULLPTR);
static QFontMetrics fontMetrics();
#if QT_VERSION < 0x060000 // remove these forwarders in Qt 6
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index ba8d7ff63c..75d86a5eba 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -219,8 +219,6 @@ public:
static QApplicationPrivate *instance() { return self; }
- static QString styleOverride;
-
#ifdef QT_KEYPAD_NAVIGATION
static QWidget *oldEditFocus;
static Qt::NavigationMode navigationMode;
diff --git a/src/widgets/kernel/qboxlayout.h b/src/widgets/kernel/qboxlayout.h
index 5ce9ca26f6..10209e05c9 100644
--- a/src/widgets/kernel/qboxlayout.h
+++ b/src/widgets/kernel/qboxlayout.h
@@ -54,7 +54,7 @@ public:
enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
Down = TopToBottom, Up = BottomToTop };
- explicit QBoxLayout(Direction, QWidget *parent = 0);
+ explicit QBoxLayout(Direction, QWidget *parent = Q_NULLPTR);
~QBoxLayout();
@@ -64,7 +64,7 @@ public:
void addSpacing(int size);
void addStretch(int stretch = 0);
void addSpacerItem(QSpacerItem *spacerItem);
- void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = 0);
+ void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
void addLayout(QLayout *layout, int stretch = 0);
void addStrut(int);
void addItem(QLayoutItem *) Q_DECL_OVERRIDE;
@@ -72,7 +72,7 @@ public:
void insertSpacing(int index, int size);
void insertStretch(int index, int stretch = 0);
void insertSpacerItem(int index, QSpacerItem *spacerItem);
- void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0);
+ void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
void insertLayout(int index, QLayout *layout, int stretch = 0);
void insertItem(int index, QLayoutItem *);
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp
index 94716025b9..2ddd025239 100644
--- a/src/widgets/kernel/qdesktopwidget.cpp
+++ b/src/widgets/kernel/qdesktopwidget.cpp
@@ -36,6 +36,7 @@
#include "qdesktopwidget_p.h"
#include "qscreen.h"
#include "qwidget_p.h"
+#include "qwindow.h"
QT_BEGIN_NAMESPACE
@@ -99,13 +100,18 @@ void QDesktopWidgetPrivate::_q_updateScreens()
QRegion virtualGeometry;
- // update the geometry of each screen widget, determine virtual geometry
- // and emit change signals afterwards.
+ // update the geometry of each screen widget, determine virtual geometry,
+ // set the new screen for window handle and emit change signals afterwards.
QList<int> changedScreens;
for (int i = 0; i < screens.length(); i++) {
- const QRect screenGeometry = screenList.at(i)->geometry();
- if (screenGeometry != screens.at(i)->geometry()) {
- screens.at(i)->setGeometry(screenGeometry);
+ QDesktopScreenWidget *screenWidget = screens.at(i);
+ QScreen *qScreen = screenList.at(i);
+ QWindow *winHandle = screenWidget->windowHandle();
+ if (winHandle && winHandle->screen() != qScreen)
+ winHandle->setScreen(qScreen);
+ const QRect screenGeometry = qScreen->geometry();
+ if (screenGeometry != screenWidget->geometry()) {
+ screenWidget->setGeometry(screenGeometry);
changedScreens.push_back(i);
}
virtualGeometry += screenGeometry;
@@ -134,6 +140,7 @@ QDesktopWidget::QDesktopWidget()
setObjectName(QLatin1String("desktop"));
d->_q_updateScreens();
connect(qApp, SIGNAL(screenAdded(QScreen*)), this, SLOT(_q_updateScreens()));
+ connect(qApp, SIGNAL(primaryScreenChanged(QScreen*)), this, SIGNAL(primaryScreenChanged()));
}
QDesktopWidget::~QDesktopWidget()
@@ -188,23 +195,69 @@ const QRect QDesktopWidget::screenGeometry(int screenNo) const
int QDesktopWidget::screenNumber(const QWidget *w) const
{
if (!w)
- return 0;
+ return primaryScreen();
+ const QList<QScreen *> allScreens = QGuiApplication::screens();
+ QList<QScreen *> screens = allScreens;
+ if (screens.isEmpty()) // This should never happen
+ return primaryScreen();
+
+ // If there is more than one virtual desktop
+ if (screens.count() != screens.constFirst()->virtualSiblings().count()) {
+ // Find the root widget, get a QScreen from it and use the
+ // virtual siblings for checking the window position.
+ const QWidget *root = w;
+ const QWidget *tmp = w;
+ while ((tmp = tmp->parentWidget()))
+ root = tmp;
+ const QWindow *winHandle = root->windowHandle();
+ if (winHandle) {
+ const QScreen *winScreen = winHandle->screen();
+ if (winScreen)
+ screens = winScreen->virtualSiblings();
+ }
+ }
+
+ // Get the screen number from window position using screen geometry
+ // and proper screens.
QRect frame = w->frameGeometry();
if (!w->isWindow())
frame.moveTopLeft(w->mapToGlobal(QPoint(0, 0)));
- const QPoint midpoint = (frame.topLeft() + frame.bottomRight()) / 2;
- return screenNumber(midpoint);
+
+ QScreen *widgetScreen = Q_NULLPTR;
+ int largestArea = 0;
+ foreach (QScreen *screen, screens) {
+ QRect intersected = screen->geometry().intersected(frame);
+ int area = intersected.width() * intersected.height();
+ if (largestArea < area) {
+ widgetScreen = screen;
+ largestArea = area;
+ }
+ }
+ return allScreens.indexOf(widgetScreen);
}
int QDesktopWidget::screenNumber(const QPoint &p) const
{
- QList<QScreen *> screens = QGuiApplication::screens();
-
- for (int i = 0; i < screens.size(); ++i)
- if (screens.at(i)->geometry().contains(p))
- return i;
-
+ const QList<QScreen *> screens = QGuiApplication::screens();
+ if (!screens.isEmpty()) {
+ const QList<QScreen *> primaryScreens = screens.first()->virtualSiblings();
+ // Find the screen index on the primary virtual desktop first
+ foreach (QScreen *screen, primaryScreens) {
+ if (screen->geometry().contains(p))
+ return screens.indexOf(screen);
+ }
+ // If the screen index is not found on primary virtual desktop, find
+ // the screen index on all screens except the first which was for
+ // sure in the previous loop. Some other screens may repeat. Find
+ // only when there is more than one virtual desktop.
+ if (screens.count() != primaryScreens.count()) {
+ for (int i = 1; i < screens.size(); ++i) {
+ if (screens[i]->geometry().contains(p))
+ return i;
+ }
+ }
+ }
return primaryScreen(); //even better would be closest screen
}
diff --git a/src/widgets/kernel/qdesktopwidget.h b/src/widgets/kernel/qdesktopwidget.h
index 5412c5bc4a..1dfec2d4ad 100644
--- a/src/widgets/kernel/qdesktopwidget.h
+++ b/src/widgets/kernel/qdesktopwidget.h
@@ -47,7 +47,7 @@ class Q_WIDGETS_EXPORT QDesktopWidget : public QWidget
Q_OBJECT
Q_PROPERTY(bool virtualDesktop READ isVirtualDesktop)
Q_PROPERTY(int screenCount READ screenCount NOTIFY screenCountChanged)
- Q_PROPERTY(int primaryScreen READ primaryScreen)
+ Q_PROPERTY(int primaryScreen READ primaryScreen NOTIFY primaryScreenChanged)
public:
QDesktopWidget();
~QDesktopWidget();
@@ -58,7 +58,7 @@ public:
int screenCount() const;
int primaryScreen() const;
- int screenNumber(const QWidget *widget = 0) const;
+ int screenNumber(const QWidget *widget = Q_NULLPTR) const;
int screenNumber(const QPoint &) const;
QWidget *screen(int screen = -1);
@@ -77,6 +77,7 @@ Q_SIGNALS:
void resized(int);
void workAreaResized(int);
void screenCountChanged(int);
+ void primaryScreenChanged();
protected:
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
diff --git a/src/widgets/kernel/qdesktopwidget.qdoc b/src/widgets/kernel/qdesktopwidget.qdoc
index 31a99f1acb..d1a6ecabd6 100644
--- a/src/widgets/kernel/qdesktopwidget.qdoc
+++ b/src/widgets/kernel/qdesktopwidget.qdoc
@@ -271,3 +271,17 @@
\sa screenCount
*/
+
+
+/*!
+ \fn void QDesktopWidget::primaryScreenChanged()
+
+ \since 5.6
+
+ \brief This signal is emitted whenever the primary screen changes.
+
+ \note This doesn't mean the QDesktopWidget::primaryScreen index will
+ necessarily be different, but now it will refer to the new primary screen.
+
+ \sa primaryScreen, screenGeometry()
+*/
diff --git a/src/widgets/kernel/qformlayout.h b/src/widgets/kernel/qformlayout.h
index 18f3c84354..0767d78ce6 100644
--- a/src/widgets/kernel/qformlayout.h
+++ b/src/widgets/kernel/qformlayout.h
@@ -74,7 +74,7 @@ public:
};
Q_ENUM(ItemRole)
- explicit QFormLayout(QWidget *parent = 0);
+ explicit QFormLayout(QWidget *parent = Q_NULLPTR);
~QFormLayout();
void setFieldGrowthPolicy(FieldGrowthPolicy policy);
diff --git a/src/widgets/kernel/qgesture.h b/src/widgets/kernel/qgesture.h
index dfe9450365..bcf583a507 100644
--- a/src/widgets/kernel/qgesture.h
+++ b/src/widgets/kernel/qgesture.h
@@ -63,7 +63,7 @@ class Q_WIDGETS_EXPORT QGesture : public QObject
Q_PROPERTY(bool hasHotSpot READ hasHotSpot)
public:
- explicit QGesture(QObject *parent = 0);
+ explicit QGesture(QObject *parent = Q_NULLPTR);
~QGesture();
Qt::GestureType gestureType() const;
@@ -107,7 +107,7 @@ class Q_WIDGETS_EXPORT QPanGesture : public QGesture
Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal verticalVelocity READ verticalVelocity WRITE setVerticalVelocity)
public:
- explicit QPanGesture(QObject *parent = 0);
+ explicit QPanGesture(QObject *parent = Q_NULLPTR);
~QPanGesture();
QPointF lastOffset() const;
@@ -154,7 +154,7 @@ public:
Q_PROPERTY(QPointF centerPoint READ centerPoint WRITE setCenterPoint)
public:
- explicit QPinchGesture(QObject *parent = 0);
+ explicit QPinchGesture(QObject *parent = Q_NULLPTR);
~QPinchGesture();
ChangeFlags totalChangeFlags() const;
@@ -210,7 +210,7 @@ public:
enum SwipeDirection { NoDirection, Left, Right, Up, Down };
Q_ENUM(SwipeDirection)
- explicit QSwipeGesture(QObject *parent = 0);
+ explicit QSwipeGesture(QObject *parent = Q_NULLPTR);
~QSwipeGesture();
SwipeDirection horizontalDirection() const;
@@ -231,7 +231,7 @@ class Q_WIDGETS_EXPORT QTapGesture : public QGesture
Q_PROPERTY(QPointF position READ position WRITE setPosition)
public:
- explicit QTapGesture(QObject *parent = 0);
+ explicit QTapGesture(QObject *parent = Q_NULLPTR);
~QTapGesture();
QPointF position() const;
@@ -249,7 +249,7 @@ class Q_WIDGETS_EXPORT QTapAndHoldGesture : public QGesture
Q_PROPERTY(QPointF position READ position WRITE setPosition)
public:
- explicit QTapAndHoldGesture(QObject *parent = 0);
+ explicit QTapAndHoldGesture(QObject *parent = Q_NULLPTR);
~QTapAndHoldGesture();
QPointF position() const;
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 8b918a72a2..fb2914d53a 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -66,7 +66,7 @@ static inline int panTouchPoints()
static const char panTouchPointVariable[] = "QT_PAN_TOUCHPOINTS";
if (qEnvironmentVariableIsSet(panTouchPointVariable)) {
bool ok;
- const int result = qgetenv(panTouchPointVariable).toInt(&ok);
+ const int result = qEnvironmentVariableIntValue(panTouchPointVariable, &ok);
if (ok && result >= 1)
return result;
qWarning() << "Ignoring invalid value of " << panTouchPointVariable;
@@ -572,18 +572,19 @@ void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures,
}
// for each gesture type
- foreach (Qt::GestureType type, gestureByTypes.keys()) {
- QHash<QWidget *, QGesture *> gestures = gestureByTypes.value(type);
- foreach (QWidget *widget, gestures.keys()) {
+ for (GestureByTypes::const_iterator git = gestureByTypes.cbegin(), gend = gestureByTypes.cend(); git != gend; ++git) {
+ const QHash<QWidget *, QGesture *> &gestures = git.value();
+ for (QHash<QWidget *, QGesture *>::const_iterator wit = gestures.cbegin(), wend = gestures.cend(); wit != wend; ++wit) {
+ QWidget *widget = wit.key();
QWidget *w = widget->parentWidget();
while (w) {
QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator it
- = w->d_func()->gestureContext.constFind(type);
+ = w->d_func()->gestureContext.constFind(git.key());
if (it != w->d_func()->gestureContext.constEnd()) {
// i.e. 'w' listens to gesture 'type'
if (!(it.value() & Qt::DontStartGestureOnChildren) && w != widget) {
// conflicting gesture!
- (*conflicts)[widget].append(gestures[widget]);
+ (*conflicts)[widget].append(wit.value());
break;
}
}
@@ -594,7 +595,7 @@ void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures,
w = w->parentWidget();
}
if (!w)
- (*normal)[widget].append(gestures[widget]);
+ (*normal)[widget].append(wit.value());
}
}
}
diff --git a/src/widgets/kernel/qgridlayout.h b/src/widgets/kernel/qgridlayout.h
index a582d31634..ae3fe125b6 100644
--- a/src/widgets/kernel/qgridlayout.h
+++ b/src/widgets/kernel/qgridlayout.h
@@ -93,10 +93,10 @@ public:
void invalidate() Q_DECL_OVERRIDE;
inline void addWidget(QWidget *w) { QLayout::addWidget(w); }
- void addWidget(QWidget *, int row, int column, Qt::Alignment = 0);
- void addWidget(QWidget *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = 0);
- void addLayout(QLayout *, int row, int column, Qt::Alignment = 0);
- void addLayout(QLayout *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = 0);
+ void addWidget(QWidget *, int row, int column, Qt::Alignment = Qt::Alignment());
+ void addWidget(QWidget *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = Qt::Alignment());
+ void addLayout(QLayout *, int row, int column, Qt::Alignment = Qt::Alignment());
+ void addLayout(QLayout *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = Qt::Alignment());
void setOriginCorner(Qt::Corner);
Qt::Corner originCorner() const;
@@ -107,7 +107,7 @@ public:
int count() const Q_DECL_OVERRIDE;
void setGeometry(const QRect&) Q_DECL_OVERRIDE;
- void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = 0);
+ void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = Qt::Alignment());
void setDefaultPositioning(int n, Qt::Orientation orient);
void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan) const;
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index d3e5986103..e74f17b6f7 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -1175,13 +1175,12 @@ QLayoutItem *QLayout::replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOpt
if (index == -1)
return 0;
+ addChildWidget(to);
QLayoutItem *newitem = new QWidgetItem(to);
newitem->setAlignment(item->alignment());
QLayoutItem *r = d->replaceAt(index, newitem);
if (!r)
delete newitem;
- else
- addChildWidget(to);
return r;
}
diff --git a/src/widgets/kernel/qlayoutitem.h b/src/widgets/kernel/qlayoutitem.h
index 650e114c76..cdb612728f 100644
--- a/src/widgets/kernel/qlayoutitem.h
+++ b/src/widgets/kernel/qlayoutitem.h
@@ -53,7 +53,7 @@ class QSize;
class Q_WIDGETS_EXPORT QLayoutItem
{
public:
- inline explicit QLayoutItem(Qt::Alignment alignment = 0);
+ inline explicit QLayoutItem(Qt::Alignment alignment = Qt::Alignment());
virtual ~QLayoutItem();
virtual QSize sizeHint() const = 0;
virtual QSize minimumSize() const = 0;
diff --git a/src/widgets/kernel/qmacgesturerecognizer.cpp b/src/widgets/kernel/qmacgesturerecognizer.cpp
index 47003f5866..9f55e23cee 100644
--- a/src/widgets/kernel/qmacgesturerecognizer.cpp
+++ b/src/widgets/kernel/qmacgesturerecognizer.cpp
@@ -256,6 +256,7 @@ void QMacPanGestureRecognizer::reset(QGesture *gesture)
QPanGesture *g = static_cast<QPanGesture *>(gesture);
_startPos = QPointF();
_panCanceled = true;
+ _panTimer.stop();
g->setOffset(QPointF(0, 0));
g->setLastOffset(QPointF(0, 0));
g->setAcceleration(qreal(1));
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 1ee28f2e9a..a80db3f60b 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -425,7 +425,12 @@ QT_BEGIN_NAMESPACE
Note that this does not apply when there are no other widgets underneath and
the intention is to have a semi-transparent window. In that case the
- traditional approach of setting Qt::WA_TranslucentBackground is sufficient.
+ traditional approach of setting Qt::WA_TranslucentBackground
+ on the top-level window is sufficient. Note that if the transparent areas are
+ only desired in the QOpenGLWidget, then Qt::WA_NoSystemBackground will need
+ to be turned back to \c false after enabling Qt::WA_TranslucentBackground.
+ Additionally, requesting an alpha channel for the QOpenGLWidget's context via
+ setFormat() may be necessary too, depending on the system.
QOpenGLWidget supports multiple update behaviors, just like QOpenGLWindow. In
preserved mode the rendered content from the previous paintGL() call is
@@ -553,7 +558,9 @@ public:
hasBeenComposed(false),
flushPending(false),
paintDevice(0),
- updateBehavior(QOpenGLWidget::NoPartialUpdate)
+ updateBehavior(QOpenGLWidget::NoPartialUpdate),
+ requestedSamples(0),
+ inPaintGL(false)
{
requestedFormat = QSurfaceFormat::defaultFormat();
}
@@ -595,6 +602,8 @@ public:
QOpenGLPaintDevice *paintDevice;
QSurfaceFormat requestedFormat;
QOpenGLWidget::UpdateBehavior updateBehavior;
+ int requestedSamples;
+ bool inPaintGL;
};
void QOpenGLWidgetPaintDevicePrivate::beginPaint()
@@ -605,7 +614,7 @@ void QOpenGLWidgetPaintDevicePrivate::beginPaint()
// with the palette's background color.
if (w->autoFillBackground()) {
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
- if (w->testAttribute(Qt::WA_TranslucentBackground)) {
+ if (w->format().hasAlpha()) {
f->glClearColor(0, 0, 0, 0);
} else {
QColor c = w->palette().brush(w->backgroundRole()).color();
@@ -636,12 +645,6 @@ void QOpenGLWidgetPaintDevice::ensureActiveTarget()
GLuint QOpenGLWidgetPrivate::textureId() const
{
- Q_Q(const QOpenGLWidget);
- if (!q->isWindow() && q->internalWinId()) {
- qWarning() << "QOpenGLWidget cannot be used as a native child widget."
- << "Consider setting Qt::WA_DontCreateNativeAncestors and Qt::AA_DontCreateNativeWidgetSiblings.";
- return 0;
- }
return resolvedFbo ? resolvedFbo->texture() : (fbo ? fbo->texture() : 0);
}
@@ -686,7 +689,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
delete resolvedFbo;
resolvedFbo = 0;
- int samples = context->format().samples();
+ int samples = requestedSamples;
QOpenGLExtensions *extfuncs = static_cast<QOpenGLExtensions *>(context->functions());
if (!extfuncs->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample))
samples = 0;
@@ -695,7 +698,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setSamples(samples);
- const QSize deviceSize = q->size() * q->devicePixelRatio();
+ const QSize deviceSize = q->size() * q->devicePixelRatioF();
fbo = new QOpenGLFramebufferObject(deviceSize, format);
if (samples > 0)
resolvedFbo = new QOpenGLFramebufferObject(deviceSize);
@@ -704,7 +707,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
context->functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
paintDevice->setSize(deviceSize);
- paintDevice->setDevicePixelRatio(q->devicePixelRatio());
+ paintDevice->setDevicePixelRatio(q->devicePixelRatioF());
emit q->resized();
}
@@ -742,6 +745,13 @@ void QOpenGLWidgetPrivate::initialize()
return;
}
+ // 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
+ // create a pbuffer with a multisampled config crashes certain implementations. Just
+ // avoid the entire hassle, the result is the same.
+ requestedSamples = requestedFormat.samples();
+ requestedFormat.setSamples(0);
+
QScopedPointer<QOpenGLContext> ctx(new QOpenGLContext);
ctx->setShareContext(shareContext);
ctx->setFormat(requestedFormat);
@@ -778,8 +788,8 @@ void QOpenGLWidgetPrivate::initialize()
}
paintDevice = new QOpenGLWidgetPaintDevice(q);
- paintDevice->setSize(q->size() * q->devicePixelRatio());
- paintDevice->setDevicePixelRatio(q->devicePixelRatio());
+ paintDevice->setSize(q->size() * q->devicePixelRatioF());
+ paintDevice->setDevicePixelRatio(q->devicePixelRatioF());
context = ctx.take();
initialized = true;
@@ -808,8 +818,10 @@ void QOpenGLWidgetPrivate::invokeUserPaint()
QOpenGLFunctions *f = ctx->functions();
QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = fbo->handle();
- f->glViewport(0, 0, q->width() * q->devicePixelRatio(), q->height() * q->devicePixelRatio());
+ f->glViewport(0, 0, q->width() * q->devicePixelRatioF(), q->height() * q->devicePixelRatioF());
+ inPaintGL = true;
q->paintGL();
+ inPaintGL = false;
flushPending = true;
QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = 0;
@@ -856,11 +868,24 @@ QImage QOpenGLWidgetPrivate::grabFramebuffer()
if (!initialized)
return QImage();
- render();
- resolveSamples();
- q->makeCurrent();
- QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatio(), false, false);
- res.setDevicePixelRatio(q->devicePixelRatio());
+ if (!inPaintGL)
+ render();
+
+ if (resolvedFbo) {
+ resolveSamples();
+ resolvedFbo->bind();
+ } else {
+ q->makeCurrent();
+ }
+
+ QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatioF(), false, false);
+ res.setDevicePixelRatio(q->devicePixelRatioF());
+
+ // While we give no guarantees of what is going to be left bound, prefer the
+ // multisample fbo instead of the resolved one. Clients may continue to
+ // render straight after calling this function.
+ if (resolvedFbo)
+ q->makeCurrent();
return res;
}
@@ -879,7 +904,7 @@ void QOpenGLWidgetPrivate::resizeViewportFramebuffer()
if (!initialized)
return;
- if (!fbo || q->size() * q->devicePixelRatio() != fbo->size())
+ if (!fbo || q->size() * q->devicePixelRatioF() != fbo->size())
recreateFbo();
}
@@ -946,13 +971,12 @@ QOpenGLWidget::UpdateBehavior QOpenGLWidget::updateBehavior() const
OpenGL widgets, individual calls to this function can be replaced by one single call to
QSurfaceFormat::setDefaultFormat() before creating the first widget.
- \note Requesting an alpha buffer via this function, or by setting
- Qt::WA_TranslucentBackground, will not lead to the desired results when the intention is
- to make other widgets beneath visible. Instead, use Qt::WA_AlwaysStackOnTop to enable
- semi-transparent QOpenGLWidget instances with other widgets visible underneath. Keep in
- mind however that this breaks the stacking order, so it will no longer be possible to
- have other widgets on top of the QOpenGLWidget. When the intention is to have a
- semi-transparent top-level window, Qt::WA_TranslucentBackground is sufficient.
+ \note Requesting an alpha buffer via this function will not lead to the
+ desired results when the intention is to make other widgets beneath visible.
+ Instead, use Qt::WA_AlwaysStackOnTop to enable semi-transparent QOpenGLWidget
+ instances with other widgets visible underneath. Keep in mind however that
+ this breaks the stacking order, so it will no longer be possible to have
+ other widgets on top of the QOpenGLWidget.
\sa format(), Qt::WA_AlwaysStackOnTop, QSurfaceFormat::setDefaultFormat()
*/
@@ -1148,8 +1172,7 @@ void QOpenGLWidget::resizeEvent(QResizeEvent *e)
d->recreateFbo();
resizeGL(width(), height());
- d->invokeUserPaint();
- d->resolveSamples();
+ d->sendPaintEvent(QRect(QPoint(0, 0), size()));
}
/*!
@@ -1196,6 +1219,7 @@ int QOpenGLWidget::metric(QPaintDevice::PaintDeviceMetric metric) const
return QWidget::metric(metric);
QWidget *tlw = window();
+ QWindow *window = tlw ? tlw->windowHandle() : 0;
QScreen *screen = tlw && tlw->windowHandle() ? tlw->windowHandle()->screen() : 0;
if (!screen && QGuiApplication::primaryScreen())
screen = QGuiApplication::primaryScreen();
@@ -1243,8 +1267,13 @@ int QOpenGLWidget::metric(QPaintDevice::PaintDeviceMetric metric) const
else
return qRound(dpmy * 0.0254);
case PdmDevicePixelRatio:
- if (screen)
- return screen->devicePixelRatio();
+ if (window)
+ return int(window->devicePixelRatio());
+ else
+ return 1.0;
+ case PdmDevicePixelRatioScaled:
+ if (window)
+ return int(window->devicePixelRatio() * devicePixelRatioFScale());
else
return 1.0;
default:
@@ -1304,7 +1333,7 @@ bool QOpenGLWidget::event(QEvent *e)
}
break;
case QEvent::ScreenChangeInternal:
- if (d->initialized && d->paintDevice->devicePixelRatio() != devicePixelRatio())
+ if (d->initialized && d->paintDevice->devicePixelRatioF() != devicePixelRatioF())
d->recreateFbo();
break;
default:
diff --git a/src/widgets/kernel/qopenglwidget.h b/src/widgets/kernel/qopenglwidget.h
index 4a9edb8180..ca65d75ca8 100644
--- a/src/widgets/kernel/qopenglwidget.h
+++ b/src/widgets/kernel/qopenglwidget.h
@@ -57,7 +57,7 @@ public:
PartialUpdate
};
- explicit QOpenGLWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
+ explicit QOpenGLWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~QOpenGLWidget();
void setUpdateBehavior(UpdateBehavior updateBehavior);
diff --git a/src/widgets/kernel/qshortcut.h b/src/widgets/kernel/qshortcut.h
index 9171f855ba..e816bbe06d 100644
--- a/src/widgets/kernel/qshortcut.h
+++ b/src/widgets/kernel/qshortcut.h
@@ -55,7 +55,7 @@ class Q_WIDGETS_EXPORT QShortcut : public QObject
public:
explicit QShortcut(QWidget *parent);
QShortcut(const QKeySequence& key, QWidget *parent,
- const char *member = 0, const char *ambiguousMember = 0,
+ const char *member = Q_NULLPTR, const char *ambiguousMember = Q_NULLPTR,
Qt::ShortcutContext context = Qt::WindowShortcut);
~QShortcut();
diff --git a/src/widgets/kernel/qsizepolicy.cpp b/src/widgets/kernel/qsizepolicy.cpp
index 1476b4c5d7..3c28f5ccf7 100644
--- a/src/widgets/kernel/qsizepolicy.cpp
+++ b/src/widgets/kernel/qsizepolicy.cpp
@@ -332,6 +332,15 @@ void QSizePolicy::setControlType(ControlType type)
*/
/*!
+ \fn uint qHash(QSizePolicy key, uint seed = 0)
+ \since 5.6
+ \relates QSizePolicy
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+
+/*!
\fn int QSizePolicy::horizontalStretch() const
Returns the horizontal stretch factor of the size policy.
diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h
index 6cd511f513..7c9a356973 100644
--- a/src/widgets/kernel/qsizepolicy.h
+++ b/src/widgets/kernel/qsizepolicy.h
@@ -40,6 +40,9 @@ QT_BEGIN_NAMESPACE
class QVariant;
+class QSizePolicy;
+
+Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) Q_DECL_NOTHROW;
class Q_WIDGETS_EXPORT QSizePolicy
{
@@ -112,6 +115,9 @@ public:
bool operator==(const QSizePolicy& s) const { return data == s.data; }
bool operator!=(const QSizePolicy& s) const { return data != s.data; }
+
+ friend Q_DECL_CONST_FUNCTION uint qHash(QSizePolicy key, uint seed) Q_DECL_NOTHROW { return qHash(key.data, seed); }
+
operator QVariant() const;
int horizontalStretch() const { return static_cast<int>(bits.horStretch); }
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 8a800ab9d0..51bf6e4684 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -37,7 +37,6 @@
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qevent.h>
-#include <qhash.h>
#include <qlabel.h>
#include <qpointer.h>
#include <qstyle.h>
diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h
index 286d8fb327..54cf71d2f0 100644
--- a/src/widgets/kernel/qtooltip.h
+++ b/src/widgets/kernel/qtooltip.h
@@ -46,7 +46,7 @@ class Q_WIDGETS_EXPORT QToolTip
QToolTip() Q_DECL_EQ_DELETE;
public:
// ### Qt 6 - merge the three showText functions below
- static void showText(const QPoint &pos, const QString &text, QWidget *w = 0);
+ static void showText(const QPoint &pos, const QString &text, QWidget *w = Q_NULLPTR);
static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect);
static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecShowTime);
static inline void hideText() { showText(QPoint(), QString()); }
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 5fb4695687..81de2f25ca 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -42,7 +42,6 @@
#include "qscreen.h"
#include "qpainter.h"
#include "qtimer.h"
-#include "qhash.h"
#include "qaction.h"
#include "qcursor.h"
#include "qbitmap.h"
@@ -460,7 +459,7 @@ bool QWhatsThisPrivate::eventFilter(QObject *o, QEvent *e)
{
QKeyEvent* kev = (QKeyEvent*)e;
- if (kev->key() == Qt::Key_Escape) {
+ if (kev->matches(QKeySequence::Cancel)) {
QWhatsThis::leaveWhatsThisMode();
return true;
} else if (customWhatsThis) {
diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h
index 999c66486c..367b8aab3c 100644
--- a/src/widgets/kernel/qwhatsthis.h
+++ b/src/widgets/kernel/qwhatsthis.h
@@ -53,10 +53,10 @@ public:
static bool inWhatsThisMode();
static void leaveWhatsThisMode();
- static void showText(const QPoint &pos, const QString &text, QWidget *w = 0);
+ static void showText(const QPoint &pos, const QString &text, QWidget *w = Q_NULLPTR);
static void hideText();
- static QAction *createAction(QObject *parent = 0);
+ static QAction *createAction(QObject *parent = Q_NULLPTR);
};
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7136714d39..b2b5c539e5 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -37,7 +37,6 @@
#include "qcursor.h"
#include "qdesktopwidget_p.h"
#include "qevent.h"
-#include "qhash.h"
#include "qlayout.h"
#include "qmenu.h"
#include "qmetaobject.h"
@@ -61,6 +60,7 @@
# 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"
@@ -69,6 +69,7 @@
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
#include "qfileinfo.h"
+#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/qopenglcontext.h>
#include <QtGui/private/qopenglcontext_p.h>
@@ -101,6 +102,7 @@
#include "qwindowcontainer_p.h"
+#include <QtPlatformHeaders/qxcbwindowfunctions.h>
// widget/widget data creation count
//#define QWIDGET_EXTRA_DEBUG
@@ -270,6 +272,9 @@ QWidgetPrivate::QWidgetPrivate(int version)
#ifndef QT_NO_IM
, inheritsInputMethodHints(0)
#endif
+#ifndef QT_NO_OPENGL
+ , renderToTextureReallyDirty(1)
+#endif
#if defined(Q_OS_WIN)
, noPaintOnScreen(0)
#endif
@@ -712,7 +717,7 @@ void QWidget::setAutoFillBackground(bool enabled)
close().
\row \li Top-level windows \li
- \l windowModified, \l windowTitle, \l windowIcon, \l windowIconText,
+ \l windowModified, \l windowTitle, \l windowIcon,
\l isActiveWindow, activateWindow(), \l minimized, showMinimized(),
\l maximized, showMaximized(), \l fullScreen, showFullScreen(),
showNormal().
@@ -1482,9 +1487,12 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (extra && !extra->mask.isEmpty())
setMask_sys(extra->mask);
- // If widget is already shown, set window visible, too
- if (q->isVisible())
+ if (data.crect.width() == 0 || data.crect.height() == 0) {
+ q->setAttribute(Qt::WA_OutsideWSRange, true);
+ } else if (q->isVisible()) {
+ // If widget is already shown, set window visible, too
win->setVisible(true);
+ }
}
#ifdef Q_OS_WIN
@@ -1859,6 +1867,8 @@ void QWidgetPrivate::deleteTLSysExtra()
extra->topextra->backingStoreTracker.destroy();
deleteBackingStore(this);
#ifndef QT_NO_OPENGL
+ qDeleteAll(extra->topextra->widgetTextures);
+ extra->topextra->widgetTextures.clear();
delete extra->topextra->shareContext;
extra->topextra->shareContext = 0;
#endif
@@ -2062,7 +2072,7 @@ void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion &reg
// Transform the system clip region from device-independent pixels to device pixels
QPaintEngine *paintEngine = paintDevice->paintEngine();
QTransform scaleTransform;
- const qreal devicePixelRatio = paintDevice->devicePixelRatio();
+ const qreal devicePixelRatio = paintDevice->devicePixelRatioF();
scaleTransform.scale(devicePixelRatio, devicePixelRatio);
paintEngine->d_func()->systemClip = scaleTransform.map(region);
}
@@ -5230,7 +5240,7 @@ QPixmap QWidget::grab(const QRect &rectangle)
QPixmap res(r.size());
if (!d->isOpaque)
res.fill(Qt::transparent);
- render(&res, QPoint(), QRegion(r), renderFlags);
+ d->render(&res, QPoint(), QRegion(r), renderFlags);
d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
return res;
@@ -5392,7 +5402,7 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
if (size.isNull())
return;
- const qreal pixmapDevicePixelRatio = qreal(painter->device()->devicePixelRatio());
+ const qreal pixmapDevicePixelRatio = painter->device()->devicePixelRatioF();
QPixmap pixmap(size * pixmapDevicePixelRatio);
pixmap.setDevicePixelRatio(pixmapDevicePixelRatio);
@@ -5567,7 +5577,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
<< "geometry ==" << QRect(q->mapTo(q->window(), QPoint(0, 0)), q->size());
#endif
- bool grabbed = false;
+ bool skipPaintEvent = false;
#ifndef QT_NO_OPENGL
if (renderToTexture) {
// This widget renders into a texture which is composed later. We just need to
@@ -5581,14 +5591,18 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
} else {
// We are not drawing to a backingstore: fall back to QImage
p.drawImage(q->rect(), grabFramebuffer());
- grabbed = true;
+ skipPaintEvent = true;
}
endBackingStorePainting();
}
+ if (renderToTextureReallyDirty)
+ renderToTextureReallyDirty = 0;
+ else
+ skipPaintEvent = true;
}
#endif // QT_NO_OPENGL
- if (!grabbed) {
+ if (!skipPaintEvent) {
//actually send the paint event
sendPaintEvent(toBePainted);
}
@@ -5980,7 +5994,7 @@ void QWidget::unsetLocale()
window title, if set. This is done by the QPA plugin, so it is shown to the
user, but isn't part of the windowTitle string.
- \sa windowIcon, windowIconText, windowModified, windowFilePath
+ \sa windowIcon, windowModified, windowFilePath
*/
QString QWidget::windowTitle() const
{
@@ -6075,7 +6089,11 @@ void QWidgetPrivate::setWindowIconText_helper(const QString &title)
void QWidgetPrivate::setWindowIconText_sys(const QString &iconText)
{
- Q_UNUSED(iconText);
+ Q_Q(QWidget);
+ // ### The QWidget property is deprecated, but the XCB window function is not.
+ // It should remain available for the rare application that needs it.
+ if (QWindow *window = q->windowHandle())
+ QXcbWindowFunctions::setWmWindowIconText(window, iconText);
}
/*!
@@ -6085,6 +6103,9 @@ void QWidgetPrivate::setWindowIconText_sys(const QString &iconText)
new \a iconText as an argument.
\since 5.2
+ \obsolete
+
+ This signal is deprecated.
*/
void QWidget::setWindowIconText(const QString &iconText)
@@ -6135,7 +6156,7 @@ void QWidget::setWindowTitle(const QString &title)
has been set, windowIcon() returns the application icon
(QApplication::windowIcon()).
- \sa windowIconText, windowTitle
+ \sa windowTitle
*/
QIcon QWidget::windowIcon() const
{
@@ -6151,8 +6172,15 @@ QIcon QWidget::windowIcon() const
void QWidgetPrivate::setWindowIcon_helper()
{
+ Q_Q(QWidget);
QEvent e(QEvent::WindowIconChange);
- QApplication::sendEvent(q_func(), &e);
+
+ // Do not send the event if the widget is a top level.
+ // In that case, setWindowIcon_sys does it, and event propagation from
+ // QWidgetWindow to the top level QWidget ensures that the event reaches
+ // the top level anyhow
+ if (!q->windowHandle())
+ QApplication::sendEvent(q, &e);
for (int i = 0; i < children.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(children.at(i));
if (w && !w->isWindow())
@@ -6195,10 +6223,15 @@ void QWidgetPrivate::setWindowIcon_sys()
/*!
\property QWidget::windowIconText
- \brief the widget's icon text
+ \brief the text to be displayed on the icon of a minimized window
This property only makes sense for windows. If no icon
- text has been set, this functions returns an empty string.
+ text has been set, this accessor returns an empty string.
+ It is only implemented on the X11 platform, and only certain
+ window managers use this window property.
+
+ \obsolete
+ This property is deprecated.
\sa windowIcon, windowTitle
*/
@@ -7177,10 +7210,10 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
bool needsShow = false;
- if (q->isWindow()) {
+ if (q->isWindow() || q->windowHandle()) {
if (!(data.window_state & Qt::WindowFullScreen) && (w == 0 || h == 0)) {
q->setAttribute(Qt::WA_OutsideWSRange, true);
- if (q->isVisible() && q->testAttribute(Qt::WA_Mapped))
+ if (q->isVisible())
hide_sys();
data.crect = QRect(x, y, w, h);
} else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) {
@@ -7884,8 +7917,9 @@ void QWidgetPrivate::show_sys()
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
invalidateBuffer(q->rect());
q->setAttribute(Qt::WA_Mapped);
- if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
- // add our window to the modal window list
+ // add our window the modal window list (native dialogs)
+ if ((q->isWindow() && (!extra || !extra->proxyWidget))
+ && q->windowModality() != Qt::NonModal && window) {
QGuiApplicationPrivate::showModalWindow(window);
}
return;
@@ -7896,8 +7930,10 @@ void QWidgetPrivate::show_sys()
else
QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
- if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow))
+ if ((!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow))
+ || q->testAttribute(Qt::WA_OutsideWSRange)) {
return;
+ }
if (window) {
if (q->isWindow())
@@ -8016,8 +8052,9 @@ void QWidgetPrivate::hide_sys()
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
q->setAttribute(Qt::WA_Mapped, false);
- if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
- // remove our window from the modal window list
+ // remove our window from the modal window list (native dialogs)
+ if ((q->isWindow() && (!extra || !extra->proxyWidget))
+ && q->windowModality() != Qt::NonModal && window) {
QGuiApplicationPrivate::hideModalWindow(window);
}
// do not return here, if window non-zero, we must hide it
@@ -8339,8 +8376,8 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
otherwise returns \c false.
First it sends the widget a QCloseEvent. The widget is
- \l{hide()}{hidden} if it \l{QCloseEvent::accept()}{accepts}
- the close event. If it \l{QCloseEvent::ignore()}{ignores}
+ \l{hide()}{hidden} if it \l{QEvent::accept()}{accepts}
+ the close event. If it \l{QEvent::ignore()}{ignores}
the event, nothing happens. The default
implementation of QWidget::closeEvent() accepts the close event.
@@ -9313,12 +9350,12 @@ void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
subclass to receive wheel events for the widget.
If you reimplement this handler, it is very important that you
- \l{QWheelEvent}{ignore()} the event if you do not handle
+ \l{QEvent}{ignore()} the event if you do not handle
it, so that the widget's parent can interpret it.
The default implementation ignores the event.
- \sa QWheelEvent::ignore(), QWheelEvent::accept(), event(),
+ \sa QEvent::ignore(), QEvent::accept(), event(),
QWheelEvent
*/
@@ -9334,12 +9371,12 @@ void QWidget::wheelEvent(QWheelEvent *event)
subclass to receive tablet events for the widget.
If you reimplement this handler, it is very important that you
- \l{QTabletEvent}{ignore()} the event if you do not handle
+ \l{QEvent}{ignore()} the event if you do not handle
it, so that the widget's parent can interpret it.
The default implementation ignores the event.
- \sa QTabletEvent::ignore(), QTabletEvent::accept(), event(),
+ \sa QEvent::ignore(), QEvent::accept(), event(),
QTabletEvent
*/
@@ -9360,7 +9397,8 @@ void QWidget::tabletEvent(QTabletEvent *event)
call the base class implementation if you do not act upon the key.
The default implementation closes popup widgets if the user
- presses Esc. Otherwise the event is ignored, so that the widget's
+ presses the key sequence for QKeySequence::Cancel (typically the
+ Escape key). Otherwise the event is ignored, so that the widget's
parent can interpret it.
Note that QKeyEvent starts with isAccepted() == true, so you do not
@@ -9373,7 +9411,7 @@ void QWidget::tabletEvent(QTabletEvent *event)
void QWidget::keyPressEvent(QKeyEvent *event)
{
- if ((windowType() == Qt::Popup) && event->key() == Qt::Key_Escape) {
+ if ((windowType() == Qt::Popup) && event->matches(QKeySequence::Cancel)) {
event->accept();
close();
} else {
@@ -9399,7 +9437,7 @@ void QWidget::keyPressEvent(QKeyEvent *event)
need to call QKeyEvent::accept() - just do not call the base class
implementation if you act upon the key.
- \sa keyPressEvent(), QKeyEvent::ignore(), setFocusPolicy(),
+ \sa keyPressEvent(), QEvent::ignore(), setFocusPolicy(),
focusInEvent(), focusOutEvent(), event(), QKeyEvent
*/
@@ -9752,6 +9790,8 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
d->imHints = hints;
if (this == QGuiApplication::focusObject())
QGuiApplication::inputMethod()->update(Qt::ImHints);
+#else
+ Q_UNUSED(hints);
#endif //QT_NO_IM
}
@@ -11846,13 +11886,11 @@ void QWidgetPrivate::updateFrameStrut()
Q_Q(QWidget);
if (q->data->fstrut_dirty) {
if (QTLWExtra *te = maybeTopData()) {
- if (te->window) {
- if (const QPlatformWindow *pw = te->window->handle()) {
- const QMargins margins = pw->frameMargins();
- if (!margins.isNull()) {
- te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
- q->data->fstrut_dirty = false;
- }
+ if (te->window && te->window->handle()) {
+ const QMargins margins = te->window->frameMargins();
+ if (!margins.isNull()) {
+ te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ q->data->fstrut_dirty = false;
}
}
}
@@ -12106,7 +12144,7 @@ QOpenGLContext *QWidgetPrivate::shareContext() const
return 0;
#else
if (!extra || !extra->topextra || !extra->topextra->window) {
- qWarning() << "Asking for share context for widget that does not have a window handle";
+ qWarning("Asking for share context for widget that does not have a window handle");
return 0;
}
QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this);
@@ -12294,6 +12332,12 @@ QPaintEngine *QWidget::paintEngine() const
return 0; //##### @@@
}
+// Do not call QWindow::mapToGlobal() until QPlatformWindow is properly showing.
+static inline bool canMapPosition(QWindow *window)
+{
+ return window->handle() && !qt_window_private(window)->resizeEventPending;
+}
+
/*!
\fn QPoint QWidget::mapToGlobal(const QPoint &pos) const
@@ -12320,7 +12364,7 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const
const QWidget *w = this;
while (w) {
QWindow *window = w->windowHandle();
- if (window && window->handle())
+ if (window && canMapPosition(window))
return window->mapToGlobal(QPoint(x, y));
x += w->data->crect.x();
@@ -12355,7 +12399,7 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
const QWidget *w = this;
while (w) {
QWindow *window = w->windowHandle();
- if (window && window->handle())
+ if (window && canMapPosition(window))
return window->mapFromGlobal(QPoint(x, y));
x -= w->data->crect.x();
@@ -12669,6 +12713,9 @@ int QWidget::metric(PaintDeviceMetric m) const
return qRound(screen->physicalDotsPerInchY());
} else if (m == PdmDevicePixelRatio) {
return topLevelWindow ? topLevelWindow->devicePixelRatio() : qApp->devicePixelRatio();
+ } else if (m == PdmDevicePixelRatioScaled) {
+ return (QPaintDevice::devicePixelRatioFScale() *
+ (topLevelWindow ? topLevelWindow->devicePixelRatio() : qApp->devicePixelRatio()));
} else {
val = QPaintDevice::metric(m);// XXX
}
@@ -12794,7 +12841,7 @@ void QWidgetPrivate::setMask_sys(const QRegion &region)
Q_Q(QWidget);
if (const QWindow *window = q->windowHandle())
if (QPlatformWindow *platformWindow = window->handle())
- platformWindow->setMask(region);
+ platformWindow->setMask(QHighDpi::toNativeLocalRegion(region, window));
}
/*!
@@ -12847,6 +12894,65 @@ void QWidgetPrivate::setWidgetParentHelper(QObject *widgetAsObject, QObject *new
widget->setParent(static_cast<QWidget*>(newParent));
}
+#ifndef QT_NO_DEBUG_STREAM
+
+static inline void formatWidgetAttributes(QDebug debug, const QWidget *widget)
+{
+ const QMetaObject *qtMo = qt_getEnumMetaObject(Qt::WA_AttributeCount);
+ const QMetaEnum me = qtMo->enumerator(qtMo->indexOfEnumerator("WidgetAttribute"));
+ debug << ", attributes=[";
+ int count = 0;
+ for (int a = 0; a < Qt::WA_AttributeCount; ++a) {
+ if (widget->testAttribute(static_cast<Qt::WidgetAttribute>(a))) {
+ if (count++)
+ debug << ',';
+ debug << me.valueToKey(a);
+ }
+ }
+ debug << ']';
+}
+
+QDebug operator<<(QDebug debug, const QWidget *widget)
+{
+ const QDebugStateSaver saver(debug);
+ debug.nospace();
+ if (widget) {
+ debug << widget->metaObject()->className() << '(' << (const void *)widget;
+ if (!widget->objectName().isEmpty())
+ debug << ", name=" << widget->objectName();
+ if (debug.verbosity() > 2) {
+ const QRect geometry = widget->geometry();
+ const QRect frameGeometry = widget->frameGeometry();
+ if (widget->isVisible())
+ debug << ", visible";
+ if (!widget->isEnabled())
+ debug << ", disabled";
+ debug << ", states=" << widget->windowState()
+ << ", type=" << widget->windowType() << ", flags=" << widget->windowFlags();
+ formatWidgetAttributes(debug, widget);
+ if (widget->isWindow())
+ debug << ", window";
+ debug << ", " << geometry.width() << 'x' << geometry.height()
+ << forcesign << geometry.x() << geometry.y() << noforcesign;
+ if (frameGeometry != geometry) {
+ const QMargins margins(geometry.x() - frameGeometry.x(),
+ geometry.y() - frameGeometry.y(),
+ frameGeometry.right() - geometry.right(),
+ frameGeometry.bottom() - geometry.bottom());
+ debug << ", margins=" << margins;
+ }
+ debug << ", devicePixelRatio=" << widget->devicePixelRatioF();
+ if (const WId wid = widget->internalWinId())
+ debug << ", winId=0x" << hex << wid << dec;
+ }
+ debug << ')';
+ } else {
+ debug << "QWidget(0x0)";
+ }
+ return debug;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
/*! \fn Qt::HANDLE QWidget::macCGHandle() const
\internal
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index c3913e9d45..a56f6e1133 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -89,6 +89,9 @@ class QGraphicsEffect;
class QRasterWindowSurface;
class QUnifiedToolbarSurface;
class QPixmap;
+#ifndef QT_NO_DEBUG_STREAM
+class QDebug;
+#endif
class QWidgetData
{
@@ -165,7 +168,7 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice
Q_PROPERTY(bool acceptDrops READ acceptDrops WRITE setAcceptDrops)
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle NOTIFY windowTitleChanged DESIGNABLE isWindow)
Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon NOTIFY windowIconChanged DESIGNABLE isWindow)
- Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText NOTIFY windowIconTextChanged DESIGNABLE isWindow)
+ Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText NOTIFY windowIconTextChanged DESIGNABLE isWindow) // deprecated
Q_PROPERTY(double windowOpacity READ windowOpacity WRITE setWindowOpacity DESIGNABLE isWindow)
Q_PROPERTY(bool windowModified READ isWindowModified WRITE setWindowModified DESIGNABLE isWindow)
#ifndef QT_NO_TOOLTIP
@@ -200,7 +203,7 @@ public:
};
Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
- explicit QWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
+ explicit QWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~QWidget();
int devType() const Q_DECL_OVERRIDE;
@@ -590,7 +593,7 @@ public:
QWindow *windowHandle() const;
- static QWidget *createWindowContainer(QWindow *window, QWidget *parent=0, Qt::WindowFlags flags=0);
+ static QWidget *createWindowContainer(QWindow *window, QWidget *parent=Q_NULLPTR, Qt::WindowFlags flags=Qt::WindowFlags());
friend class QDesktopScreenWidget;
@@ -731,12 +734,12 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QWidget::RenderFlags)
#ifndef Q_QDOC
template <> inline QWidget *qobject_cast<QWidget*>(QObject *o)
{
- if (!o || !o->isWidgetType()) return 0;
+ if (!o || !o->isWidgetType()) return Q_NULLPTR;
return static_cast<QWidget*>(o);
}
template <> inline const QWidget *qobject_cast<const QWidget*>(const QObject *o)
{
- if (!o || !o->isWidgetType()) return 0;
+ if (!o || !o->isWidgetType()) return Q_NULLPTR;
return static_cast<const QWidget*>(o);
}
#endif // !Q_QDOC
@@ -858,6 +861,10 @@ inline bool QWidget::testAttribute(Qt::WidgetAttribute attribute) const
#define QWIDGETSIZE_MAX ((1<<24)-1)
+#ifndef QT_NO_DEBUG_STREAM
+Q_WIDGETS_EXPORT QDebug operator<<(QDebug, const QWidget *);
+#endif
+
QT_END_NAMESPACE
#endif // QWIDGET_H
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index fe65cb19c7..7eb8d048b3 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -75,6 +75,7 @@ class QWidgetBackingStore;
class QGraphicsProxyWidget;
class QWidgetItemV2;
class QOpenGLContext;
+class QPlatformTextureList;
class QStyle;
@@ -153,6 +154,8 @@ struct QTLWExtra {
QWidgetBackingStoreTracker backingStoreTracker;
QBackingStore *backingStore;
QPainter *sharedPainter;
+ QWidgetWindow *window;
+ QOpenGLContext *shareContext;
// Implicit pointers (shared_null).
QString caption; // widget caption
@@ -167,6 +170,9 @@ struct QTLWExtra {
QRect frameStrut;
QRect normalGeometry; // used by showMin/maximized/FullScreen
Qt::WindowFlags savedFlags; // Save widget flags while showing fullscreen
+ int initialScreenIndex; // Screen number when passing a QDesktop[Screen]Widget as parent.
+
+ QVector<QPlatformTextureList *> widgetTextures;
// *************************** Cross-platform bit fields ****************************
uint opacity : 8;
@@ -210,9 +216,6 @@ struct QTLWExtra {
// starting position as 0,0 instead of the normal starting position.
bool wasMaximized;
#endif
- QWidgetWindow *window;
- QOpenGLContext *shareContext;
- int initialScreenIndex; // Screen number when passing a QDesktop[Screen]Widget as parent.
};
struct QWExtra {
@@ -740,6 +743,9 @@ public:
#ifndef QT_NO_IM
uint inheritsInputMethodHints : 1;
#endif
+#ifndef QT_NO_OPENGL
+ uint renderToTextureReallyDirty : 1;
+#endif
// *************************** Platform specific ************************************
#if defined(Q_OS_WIN)
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 2a339cda4c..d9d1c887c1 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -79,7 +79,6 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
Q_ASSERT(widget);
Q_ASSERT(backingStore);
Q_ASSERT(tlw);
-
#if !defined(QT_NO_PAINT_DEBUG)
static int flushUpdate = qEnvironmentVariableIntValue("QT_FLUSH_UPDATE");
if (flushUpdate > 0)
@@ -105,13 +104,16 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
#ifndef QT_NO_OPENGL
if (widgetTextures) {
+ qt_window_private(tlw->windowHandle())->compositing = true;
widget->window()->d_func()->sendComposeStatus(widget->window(), false);
// A window may have alpha even when the app did not request
// WA_TranslucentBackground. Therefore the compositor needs to know whether the app intends
// to rely on translucency, in order to decide if it should clear to transparent or opaque.
const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground);
+ // Use the tlw's context, not widget's. The difference is important with native child
+ // widgets where tlw != widget.
backingStore->handle()->composeAndFlush(widget->windowHandle(), region, offset, widgetTextures,
- widget->d_func()->shareContext(), translucentBackground);
+ tlw->d_func()->shareContext(), translucentBackground);
widget->window()->d_func()->sendComposeStatus(widget->window(), true);
} else
#endif
@@ -446,6 +448,26 @@ void QWidgetBackingStore::sendUpdateRequest(QWidget *widget, UpdateTime updateTi
if (!widget)
return;
+#ifndef QT_NO_OPENGL
+ // Having every repaint() leading to a sync/flush is bad as it causes
+ // compositing and waiting for vsync each and every time. Change to
+ // UpdateLater, except for approx. once per frame to prevent starvation in
+ // case the control does not get back to the event loop.
+ QWidget *w = widget->window();
+ if (updateTime == UpdateNow && w && w->windowHandle() && QWindowPrivate::get(w->windowHandle())->compositing) {
+ int refresh = 60;
+ QScreen *ws = w->windowHandle()->screen();
+ if (ws)
+ refresh = ws->refreshRate();
+ QWindowPrivate *wd = QWindowPrivate::get(w->windowHandle());
+ if (wd->lastComposeTime.isValid()) {
+ const qint64 elapsed = wd->lastComposeTime.elapsed();
+ if (elapsed <= qint64(1000.0f / refresh))
+ updateTime = UpdateLater;
+ }
+ }
+#endif
+
switch (updateTime) {
case UpdateLater:
updateRequestSent = true;
@@ -619,7 +641,11 @@ void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget,
const QRect widgetRect = widget->d_func()->effectiveRectFor(rect);
- const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint())));
+ QRect translatedRect = widgetRect;
+ if (widget != tlw)
+ translatedRect.translate(widget->mapTo(tlw, QPoint()));
+ // Graphics effects may exceed window size, clamp.
+ translatedRect = translatedRect.intersected(QRect(QPoint(), tlw->size()));
if (qt_region_strictContains(dirty, translatedRect)) {
if (updateTime == UpdateNow)
sendUpdateRequest(tlw, updateTime);
@@ -741,7 +767,6 @@ void QWidgetBackingStore::updateLists(QWidget *cur)
QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel)
: tlw(topLevel),
dirtyOnScreenWidgets(0),
- widgetTextures(0),
fullUpdatePending(0),
updateRequestSent(0),
textureListWatcher(0),
@@ -761,11 +786,7 @@ QWidgetBackingStore::~QWidgetBackingStore()
for (int c = 0; c < dirtyRenderToTextureWidgets.size(); ++c)
resetWidget(dirtyRenderToTextureWidgets.at(c));
-#ifndef QT_NO_OPENGL
- delete widgetTextures;
delete dirtyOnScreenWidgets;
-#endif
- dirtyOnScreenWidgets = 0;
}
//parent's coordinates; move whole rect; update parent and widget
@@ -793,8 +814,9 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
destRect = destRect.translated(dx, dy).intersected(clipR);
const QRect sourceRect(destRect.translated(-dx, -dy));
const QRect parentRect(rect & clipR);
+ const bool nativeWithTextureChild = textureChildSeen && q->internalWinId();
- bool accelerateMove = accelEnv && isOpaque
+ bool accelerateMove = accelEnv && isOpaque && !nativeWithTextureChild
#ifndef QT_NO_GRAPHICSVIEW
// No accelerate move for proxy widgets.
&& !tlw->d_func()->extra->proxyWidget
@@ -914,6 +936,121 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
}
}
+#ifndef QT_NO_OPENGL
+static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures, QVector<QWidget *> *nativeChildren)
+{
+ QWidgetPrivate *wd = QWidgetPrivate::get(widget);
+ if (wd->renderToTexture) {
+ QPlatformTextureList::Flags flags = 0;
+ if (widget->testAttribute(Qt::WA_AlwaysStackOnTop))
+ flags |= QPlatformTextureList::StacksOnTop;
+ const QRect rect(widget->mapTo(tlw, QPoint()), widget->size());
+ widgetTextures->appendTexture(widget, wd->textureId(), rect, wd->clipRect(), flags);
+ }
+
+ for (int i = 0; i < wd->children.size(); ++i) {
+ QWidget *w = qobject_cast<QWidget *>(wd->children.at(i));
+ // Stop at native widgets but store them. Stop at hidden widgets too.
+ if (w && !w->isWindow() && w->internalWinId())
+ nativeChildren->append(w);
+ if (w && !w->isWindow() && !w->internalWinId() && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen)
+ findTextureWidgetsRecursively(tlw, w, widgetTextures, nativeChildren);
+ }
+}
+
+static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget)
+{
+ // textureChildSeen does not take native child widgets into account and that's good.
+ if (QWidgetPrivate::get(widget)->textureChildSeen) {
+ QVector<QWidget *> nativeChildren;
+ QScopedPointer<QPlatformTextureList> tl(new QPlatformTextureList);
+ // Look for texture widgets (incl. widget itself) from 'widget' down,
+ // but skip subtrees with a parent of a native child widget.
+ findTextureWidgetsRecursively(tlw, widget, tl.data(), &nativeChildren);
+ // tl may be empty regardless of textureChildSeen if we have native or hidden children.
+ if (!tl->isEmpty())
+ QWidgetPrivate::get(tlw)->topData()->widgetTextures.append(tl.take());
+ // Native child widgets, if there was any, get their own separate QPlatformTextureList.
+ foreach (QWidget *ncw, nativeChildren) {
+ if (QWidgetPrivate::get(ncw)->textureChildSeen)
+ findAllTextureWidgetsRecursively(tlw, ncw);
+ }
+ }
+}
+
+Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
+
+static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
+{
+ foreach (QPlatformTextureList *tl, QWidgetPrivate::get(tlw)->topData()->widgetTextures) {
+ Q_ASSERT(!tl->isEmpty());
+ for (int i = 0; i < tl->count(); ++i) {
+ QWidget *w = static_cast<QWidget *>(tl->source(i));
+ if ((w->internalWinId() && w == widget) || (!w->internalWinId() && w->nativeParentWidget() == widget))
+ return tl;
+ }
+ }
+
+ if (QWidgetPrivate::get(tlw)->textureChildSeen) {
+ // No render-to-texture widgets in the (sub-)tree due to hidden or native
+ // children. Returning null results in using the normal backingstore flush path
+ // without OpenGL-based compositing. This is very desirable normally. However,
+ // some platforms cannot handle switching between the non-GL and GL paths for
+ // their windows so it has to be opt-in.
+ static bool switchableWidgetComposition =
+ QGuiApplicationPrivate::instance()->platformIntegration()
+ ->hasCapability(QPlatformIntegration::SwitchableWidgetComposition);
+ if (!switchableWidgetComposition)
+ return qt_dummy_platformTextureList();
+ }
+
+ return 0;
+}
+
+// Watches one or more QPlatformTextureLists for changes in the lock state and
+// triggers a backingstore sync when all the registered lists turn into
+// unlocked state. This is essential when a custom composeAndFlush()
+// implementation in a platform plugin is not synchronous and keeps
+// holding on to the textures for some time even after returning from there.
+QPlatformTextureListWatcher::QPlatformTextureListWatcher(QWidgetBackingStore *backingStore)
+ : m_backingStore(backingStore)
+{
+}
+
+void QPlatformTextureListWatcher::watch(QPlatformTextureList *textureList)
+{
+ connect(textureList, SIGNAL(locked(bool)), SLOT(onLockStatusChanged(bool)));
+ m_locked[textureList] = textureList->isLocked();
+}
+
+bool QPlatformTextureListWatcher::isLocked() const
+{
+ foreach (bool v, m_locked) {
+ if (v)
+ return true;
+ }
+ return false;
+}
+
+void QPlatformTextureListWatcher::onLockStatusChanged(bool locked)
+{
+ QPlatformTextureList *tl = static_cast<QPlatformTextureList *>(sender());
+ m_locked[tl] = locked;
+ if (!isLocked())
+ m_backingStore->sync();
+}
+
+#else
+
+static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
+{
+ Q_UNUSED(tlw);
+ Q_UNUSED(widget);
+ return Q_NULLPTR;
+}
+
+#endif // QT_NO_OPENGL
+
static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
{
if (!tlw || !tlwExtra || !tlw->testAttribute(Qt::WA_Mapped) || !tlw->isVisible())
@@ -942,7 +1079,8 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
// Nothing to repaint.
if (!isDirty() && store->size().isValid()) {
- qt_flush(exposedWidget, exposedRegion, store, tlw, tlwOffset, widgetTextures, this);
+ QPlatformTextureList *tl = widgetTexturesFor(tlw, exposedWidget);
+ qt_flush(exposedWidget, tl ? QRegion() : exposedRegion, store, tlw, tlwOffset, tl, this);
return;
}
@@ -954,45 +1092,6 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
doSync();
}
-#ifndef QT_NO_OPENGL
-static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures)
-{
- QWidgetPrivate *wd = QWidgetPrivate::get(widget);
- if (wd->renderToTexture) {
- QPlatformTextureList::Flags flags = 0;
- if (widget->testAttribute(Qt::WA_AlwaysStackOnTop))
- flags |= QPlatformTextureList::StacksOnTop;
- const QRect rect(widget->mapTo(tlw, QPoint()), widget->size());
- widgetTextures->appendTexture(widget, wd->textureId(), rect, wd->clipRect(), flags);
- }
-
- for (int i = 0; i < wd->children.size(); ++i) {
- QWidget *w = qobject_cast<QWidget *>(wd->children.at(i));
- if (w && !w->isWindow() && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen)
- findTextureWidgetsRecursively(tlw, w, widgetTextures);
- }
-}
-
-QPlatformTextureListWatcher::QPlatformTextureListWatcher(QWidgetBackingStore *backingStore)
- : m_locked(false),
- m_backingStore(backingStore)
-{
-}
-
-void QPlatformTextureListWatcher::watch(QPlatformTextureList *textureList)
-{
- connect(textureList, SIGNAL(locked(bool)), SLOT(onLockStatusChanged(bool)));
- m_locked = textureList->isLocked();
-}
-
-void QPlatformTextureListWatcher::onLockStatusChanged(bool locked)
-{
- m_locked = locked;
- if (!locked)
- m_backingStore->sync();
-}
-#endif // QT_NO_OPENGL
-
/*!
Synchronizes the backing store, i.e. dirty areas are repainted and flushed.
*/
@@ -1020,12 +1119,19 @@ void QWidgetBackingStore::sync()
if (textureListWatcher && !textureListWatcher->isLocked()) {
textureListWatcher->deleteLater();
textureListWatcher = 0;
- } else if (widgetTextures && widgetTextures->isLocked()) {
- if (!textureListWatcher)
- textureListWatcher = new QPlatformTextureListWatcher(this);
- if (!textureListWatcher->isLocked())
- textureListWatcher->watch(widgetTextures);
- return;
+ } else if (!tlwExtra->widgetTextures.isEmpty()) {
+ bool skipSync = false;
+ foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
+ if (tl->isLocked()) {
+ if (!textureListWatcher)
+ textureListWatcher = new QPlatformTextureListWatcher(this);
+ if (!textureListWatcher->isLocked())
+ textureListWatcher->watch(tl);
+ skipSync = true;
+ }
+ }
+ if (skipSync) // cannot compose due to widget textures being in use
+ return;
}
#endif
@@ -1118,13 +1224,14 @@ void QWidgetBackingStore::doSync()
dirtyWidgets.clear();
#ifndef QT_NO_OPENGL
- delete widgetTextures;
- widgetTextures = 0;
- if (tlw->d_func()->textureChildSeen) {
- widgetTextures = new QPlatformTextureList;
- findTextureWidgetsRecursively(tlw, tlw, widgetTextures);
- }
- qt_window_private(tlw->windowHandle())->compositing = widgetTextures;
+ // Find all render-to-texture child widgets (including self).
+ // The search is cut at native widget boundaries, meaning that each native child widget
+ // has its own list for the subtree below it.
+ QTLWExtra *tlwExtra = tlw->d_func()->topData();
+ qDeleteAll(tlwExtra->widgetTextures);
+ tlwExtra->widgetTextures.clear();
+ findAllTextureWidgetsRecursively(tlw, tlw);
+ qt_window_private(tlw->windowHandle())->compositing = false; // will get updated in qt_flush()
fullUpdatePending = false;
#endif
@@ -1144,6 +1251,17 @@ void QWidgetBackingStore::doSync()
for (int i = 0; i < paintPending.count(); ++i) {
QWidget *w = paintPending[i];
w->d_func()->sendPaintEvent(w->rect());
+ if (w != tlw) {
+ QWidget *npw = w->nativeParentWidget();
+ if (w->internalWinId() || (npw && npw != tlw)) {
+ if (!w->internalWinId())
+ w = npw;
+ QWidgetPrivate *wPrivate = w->d_func();
+ if (!wPrivate->needsFlush)
+ wPrivate->needsFlush = new QRegion;
+ appendDirtyOnScreenWidget(w);
+ }
+ }
}
// We might have newly exposed areas on the screen if this function was
@@ -1155,11 +1273,14 @@ void QWidgetBackingStore::doSync()
}
#ifndef QT_NO_OPENGL
- if (widgetTextures && widgetTextures->count()) {
- for (int i = 0; i < widgetTextures->count(); ++i) {
- QWidget *w = static_cast<QWidget *>(widgetTextures->source(i));
+ foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
+ for (int i = 0; i < tl->count(); ++i) {
+ QWidget *w = static_cast<QWidget *>(tl->source(i));
if (dirtyRenderToTextureWidgets.contains(w)) {
- const QRect rect = widgetTextures->geometry(i); // mapped to the tlw already
+ const QRect rect = tl->geometry(i); // mapped to the tlw already
+ // Set a flag to indicate that the paint event for this
+ // render-to-texture widget must not to be optimized away.
+ w->d_func()->renderToTextureReallyDirty = 1;
dirty += rect;
toClean += rect;
}
@@ -1236,31 +1357,39 @@ void QWidgetBackingStore::doSync()
*/
void QWidgetBackingStore::flush(QWidget *widget)
{
+ const bool hasDirtyOnScreenWidgets = dirtyOnScreenWidgets && !dirtyOnScreenWidgets->isEmpty();
+ bool flushed = false;
+
+ // Flush the region in dirtyOnScreen.
if (!dirtyOnScreen.isEmpty()) {
QWidget *target = widget ? widget : tlw;
- qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset, widgetTextures, this);
+ qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset, widgetTexturesFor(tlw, tlw), this);
dirtyOnScreen = QRegion();
-#ifndef QT_NO_OPENGL
- if (widgetTextures && widgetTextures->count())
- return;
-#endif
+ flushed = true;
}
- if (!dirtyOnScreenWidgets || dirtyOnScreenWidgets->isEmpty()) {
+ // Render-to-texture widgets are not in dirtyOnScreen so flush if we have not done it above.
+ if (!flushed && !hasDirtyOnScreenWidgets) {
#ifndef QT_NO_OPENGL
- if (widgetTextures && widgetTextures->count()) {
- QWidget *target = widget ? widget : tlw;
- qt_flush(target, QRegion(), store, tlw, tlwOffset, widgetTextures, this);
+ if (!tlw->d_func()->topData()->widgetTextures.isEmpty()) {
+ QPlatformTextureList *tl = widgetTexturesFor(tlw, tlw);
+ if (tl) {
+ QWidget *target = widget ? widget : tlw;
+ qt_flush(target, QRegion(), store, tlw, tlwOffset, tl, this);
+ }
}
#endif
- return;
}
+ if (!hasDirtyOnScreenWidgets)
+ return;
+
for (int i = 0; i < dirtyOnScreenWidgets->size(); ++i) {
QWidget *w = dirtyOnScreenWidgets->at(i);
QWidgetPrivate *wd = w->d_func();
Q_ASSERT(wd->needsFlush);
- qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset, 0, this);
+ QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : 0;
+ qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset, widgetTexturesForNative, this);
*wd->needsFlush = QRegion();
}
dirtyOnScreenWidgets->clear();
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
index bcffa3be79..c45e60ef6e 100644
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ b/src/widgets/kernel/qwidgetbackingstore_p.h
@@ -71,13 +71,13 @@ class QPlatformTextureListWatcher : public QObject
public:
QPlatformTextureListWatcher(QWidgetBackingStore *backingStore);
void watch(QPlatformTextureList *textureList);
- bool isLocked() const { return m_locked; }
+ bool isLocked() const;
private slots:
void onLockStatusChanged(bool locked);
private:
- bool m_locked;
+ QHash<QPlatformTextureList *, bool> m_locked;
QWidgetBackingStore *m_backingStore;
};
#endif
@@ -128,7 +128,6 @@ private:
QVector<QWidget *> dirtyRenderToTextureWidgets;
QVector<QWidget *> *dirtyOnScreenWidgets;
QList<QWidget *> staticWidgets;
- QPlatformTextureList *widgetTextures;
QBackingStore *store;
uint fullUpdatePending : 1;
uint updateRequestSent : 1;
@@ -301,6 +300,8 @@ private:
friend class QWidgetPrivate;
friend class QWidget;
friend class QBackingStore;
+
+ Q_DISABLE_COPY(QWidgetBackingStore)
};
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp
index b0dcc4aa1b..fc02c9c77d 100644
--- a/src/widgets/kernel/qwidgetsvariant.cpp
+++ b/src/widgets/kernel/qwidgetsvariant.cpp
@@ -109,7 +109,7 @@ static void streamDebug(QDebug dbg, const QVariant &v)
dbg.nospace() << *v_cast<QSizePolicy>(d);
break;
default:
- dbg.nospace() << "QMetaType::Type(" << d->type << ")";
+ dbg.nospace() << "QMetaType::Type(" << d->type << ')';
}
}
#endif
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index cc50cde799..6f8d97e028 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -45,13 +45,13 @@
#include <qpa/qplatformtheme.h>
#include <qpa/qplatformwindow.h>
#include <private/qgesturemanager_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets();
QWidget *qt_button_down = 0; // widget got last button-down
-static QPointer<QWidget> qt_tablet_target = 0;
// popup control
QWidget *qt_popup_down = 0; // popup that contains the pressed widget
@@ -161,7 +161,7 @@ bool QWidgetWindow::event(QEvent *event)
if (m_widget->testAttribute(Qt::WA_DontShowOnScreen)) {
// \a event is uninteresting for QWidgetWindow, the event was probably
// generated before WA_DontShowOnScreen was set
- return m_widget->event(event);
+ return QCoreApplication::sendEvent(m_widget, event);
}
switch (event->type()) {
@@ -303,7 +303,7 @@ bool QWidgetWindow::event(QEvent *event)
break;
}
- if (m_widget->event(event) && event->type() != QEvent::Timer)
+ if (QCoreApplication::sendEvent(m_widget, event) && event->type() != QEvent::Timer)
return true;
return QWindow::event(event);
@@ -446,8 +446,8 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (receiver != popup)
widgetPos = receiver->mapFromGlobal(event->globalPos());
QWidget *alien = m_widget->childAt(m_widget->mapFromGlobal(event->globalPos()));
- QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(&e, QGuiApplicationPrivate::mouseEventSource(event));
+ 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, alien, receiver->window(), &qt_button_down, qt_last_mouse_receiver);
qt_last_mouse_receiver = receiver;
@@ -489,9 +489,9 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (globalGeometry.contains(event->globalPos())) {
// Use postEvent() to ensure the local QEventLoop terminates when called from QMenu::exec()
const QPoint localPos = win->mapFromGlobal(event->globalPos());
- QMouseEvent *e = new QMouseEvent(QEvent::MouseButtonPress, localPos, localPos, event->globalPos(), event->button(), event->buttons(), event->modifiers());
+ QMouseEvent *e = new QMouseEvent(QEvent::MouseButtonPress, localPos, localPos, event->globalPos(),
+ event->button(), event->buttons(), event->modifiers(), event->source());
QCoreApplicationPrivate::setEventSpontaneous(e, true);
- QGuiApplicationPrivate::setMouseEventSource(e, QGuiApplicationPrivate::mouseEventSource(event));
e->setTimestamp(event->timestamp());
QCoreApplication::postEvent(win, e);
}
@@ -548,11 +548,11 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
// The preceding statement excludes MouseButtonPress events which caused
// creation of a MouseButtonDblClick event. QTBUG-25831
QMouseEvent translated(event->type(), mapped, event->windowPos(), event->screenPos(),
- event->button(), event->buttons(), event->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(&translated, QGuiApplicationPrivate::mouseEventSource(event));
+ event->button(), event->buttons(), event->modifiers(), event->source());
translated.setTimestamp(event->timestamp());
QApplicationPrivate::sendMouseEvent(receiver, &translated, widget, m_widget,
&qt_button_down, qt_last_mouse_receiver);
+ event->setAccepted(translated.isAccepted());
}
#ifndef QT_NO_CONTEXTMENU
if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton
@@ -673,7 +673,7 @@ void QWidgetWindow::updateNormalGeometry()
// Ask platform window, default to widget geometry.
QRect normalGeometry;
if (const QPlatformWindow *pw = handle())
- normalGeometry = pw->normalGeometry();
+ normalGeometry = QHighDpi::fromNativePixels(pw->normalGeometry(), this);
if (!normalGeometry.isValid() && effectiveState(m_widget->windowState()) == Qt::WindowNoState)
normalGeometry = m_widget->geometry();
if (normalGeometry.isValid())
@@ -708,6 +708,7 @@ void QWidgetWindow::handleCloseEvent(QCloseEvent *event)
{
bool is_closing = m_widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
event->setAccepted(is_closing);
+ QWindow::event(event); // Call QWindow QCloseEvent handler.
}
#ifndef QT_NO_WHEELEVENT
@@ -794,7 +795,7 @@ void QWidgetWindow::handleDragLeaveEvent(QDragLeaveEvent *event)
void QWidgetWindow::handleDropEvent(QDropEvent *event)
{
if (m_dragTarget.isNull()) {
- qWarning() << Q_FUNC_INFO << m_widget << ": No drag target set.";
+ qWarning() << m_widget << ": No drag target set.";
event->ignore();
return;
}
@@ -874,6 +875,7 @@ bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long
#ifndef QT_NO_TABLETEVENT
void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
{
+ static QPointer<QWidget> qt_tablet_target = 0;
if (event->type() == QEvent::TabletPress) {
QWidget *widget = m_widget->childAt(event->pos());
if (!widget)
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 9d3a4ef0b2..3885431b05 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -34,6 +34,8 @@
#include "qwindowcontainer_p.h"
#include "qwidget_p.h"
#include <QtGui/qwindow.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#include <QDebug>
#include <QMdiSubWindow>
@@ -196,6 +198,13 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
return;
}
+ // The embedded QWindow must use the same logic as QWidget when it comes to the surface type.
+ // Otherwise we may end up with BadMatch failures on X11.
+ if (embeddedWindow->surfaceType() == QSurface::RasterSurface
+ && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface)
+ && !QApplication::testAttribute(Qt::AA_ForceRasterWidgets))
+ embeddedWindow->setSurfaceType(QSurface::RasterGLSurface);
+
d->window = embeddedWindow;
d->window->setParent(&d->fakeParent);
setAcceptDrops(true);
diff --git a/src/widgets/statemachine/qkeyeventtransition.cpp b/src/widgets/statemachine/qkeyeventtransition.cpp
index 3283003e2e..67af85dd27 100644
--- a/src/widgets/statemachine/qkeyeventtransition.cpp
+++ b/src/widgets/statemachine/qkeyeventtransition.cpp
@@ -117,7 +117,7 @@ int QKeyEventTransition::key() const
}
/*!
- Sets the key that this key event transition will check for.
+ Sets the \a key that this key event transition will check for.
*/
void QKeyEventTransition::setKey(int key)
{
diff --git a/src/widgets/statemachine/qkeyeventtransition.h b/src/widgets/statemachine/qkeyeventtransition.h
index 5dd0685d0b..ad159eaa22 100644
--- a/src/widgets/statemachine/qkeyeventtransition.h
+++ b/src/widgets/statemachine/qkeyeventtransition.h
@@ -48,9 +48,9 @@ class Q_WIDGETS_EXPORT QKeyEventTransition : public QEventTransition
Q_PROPERTY(int key READ key WRITE setKey)
Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask)
public:
- QKeyEventTransition(QState *sourceState = 0);
+ QKeyEventTransition(QState *sourceState = Q_NULLPTR);
QKeyEventTransition(QObject *object, QEvent::Type type, int key,
- QState *sourceState = 0);
+ QState *sourceState = Q_NULLPTR);
~QKeyEventTransition();
int key() const;
diff --git a/src/widgets/statemachine/qmouseeventtransition.h b/src/widgets/statemachine/qmouseeventtransition.h
index d9bac9e1a0..b4db61279d 100644
--- a/src/widgets/statemachine/qmouseeventtransition.h
+++ b/src/widgets/statemachine/qmouseeventtransition.h
@@ -49,9 +49,9 @@ class Q_WIDGETS_EXPORT QMouseEventTransition : public QEventTransition
Q_PROPERTY(Qt::MouseButton button READ button WRITE setButton)
Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask)
public:
- QMouseEventTransition(QState *sourceState = 0);
+ QMouseEventTransition(QState *sourceState = Q_NULLPTR);
QMouseEventTransition(QObject *object, QEvent::Type type,
- Qt::MouseButton button, QState *sourceState = 0);
+ Qt::MouseButton button, QState *sourceState = Q_NULLPTR);
~QMouseEventTransition();
Qt::MouseButton button() const;
diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp
index c73908d0a5..4489f36ab7 100644
--- a/src/widgets/styles/qandroidstyle.cpp
+++ b/src/widgets/styles/qandroidstyle.cpp
@@ -298,8 +298,7 @@ void QAndroidStyle::drawPrimitive(PrimitiveElement pe,
}
} else if (pe == PE_FrameGroupBox) {
if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
- const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt);
- if (frame2 && (frame2->features & QStyleOptionFrameV2::Flat)) {
+ if (frame->features & QStyleOptionFrame::Flat) {
QRect fr = frame->rect;
QPoint p1(fr.x(), fr.y() + 1);
QPoint p2(fr.x() + fr.width(), p1.y());
@@ -403,7 +402,7 @@ void QAndroidStyle::drawComplexControl(ComplexControl cc,
if (groupBox->subControls & SC_GroupBoxCheckBox)
checkBoxRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, widget);
if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
- QStyleOptionFrameV2 frame;
+ QStyleOptionFrame frame;
frame.QStyleOption::operator=(*groupBox);
frame.features = groupBox->features;
frame.lineWidth = groupBox->lineWidth;
@@ -1617,15 +1616,13 @@ void QAndroidStyle::AndroidProgressBarControl::drawControl(const QStyleOption *o
if (const QStyleOptionProgressBar *progressBarOption =
qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
- QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);
if (m_progressDrawable->type() == QAndroidStyle::Layer) {
+ const double fraction = progressBarOption->progress / double(progressBarOption->maximum - progressBarOption->minimum);
QAndroidStyle::AndroidDrawable *clipDrawable = static_cast<QAndroidStyle::AndroidLayerDrawable *>(m_progressDrawable)->layer(m_progressId);
if (clipDrawable->type() == QAndroidStyle::Clip)
- static_cast<QAndroidStyle::AndroidClipDrawable *>(clipDrawable)->setFactor(double(progressBarV2.progress) / double(progressBarV2.maximum - progressBarV2.minimum),
- progressBarV2.orientation);
+ static_cast<AndroidClipDrawable *>(clipDrawable)->setFactor(fraction, progressBarOption->orientation);
else
- static_cast<QAndroidStyle::AndroidLayerDrawable *>(m_progressDrawable)->setFactor(m_progressId, double(progressBarV2.progress) / double(progressBarV2.maximum - progressBarV2.minimum),
- progressBarV2.orientation);
+ static_cast<AndroidLayerDrawable *>(m_progressDrawable)->setFactor(m_progressId, fraction, progressBarOption->orientation);
}
m_progressDrawable->draw(p, option);
}
@@ -1637,8 +1634,7 @@ QRect QAndroidStyle::AndroidProgressBarControl::subElementRect(QStyle::SubElemen
{
if (const QStyleOptionProgressBar *progressBarOption =
qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
- QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);
- const bool horizontal = progressBarV2.orientation == Qt::Vertical;
+ const bool horizontal = progressBarOption->orientation == Qt::Vertical;
if (!m_background)
return option->rect;
@@ -1680,8 +1676,7 @@ QSize QAndroidStyle::AndroidProgressBarControl::sizeFromContents(const QStyleOpt
if (const QStyleOptionProgressBar *progressBarOption =
qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
- QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);
- if (progressBarV2.orientation == Qt::Vertical) {
+ if (progressBarOption->orientation == Qt::Vertical) {
if (sz.height() > m_maxSize.height())
sz.setHeight(m_maxSize.height());
} else {
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index a4ecfc547b..355a3d2c3f 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -80,6 +80,11 @@
QT_BEGIN_NAMESPACE
+static QWindow *qt_getWindow(const QWidget *widget)
+{
+ return widget ? widget->window()->windowHandle() : 0;
+}
+
/*!
\class QCommonStyle
\brief The QCommonStyle class encapsulates the common Look and Feel of a GUI.
@@ -260,8 +265,8 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
case PE_IndicatorProgressChunk:
{
bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt))
- vertical = (pb2->orientation == Qt::Vertical);
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt))
+ vertical = pb->orientation == Qt::Vertical;
if (!vertical) {
p->fillRect(opt->rect.x(), opt->rect.y() + 3, opt->rect.width() -2, opt->rect.height() - 6,
opt->palette.brush(QPalette::Highlight));
@@ -395,7 +400,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
mode = QIcon::Disabled;
QIcon::State state = opt->state & State_Sunken ? QIcon::On : QIcon::Off;
- QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(size, mode, state);
+ QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(qt_getWindow(widget), QSize(size, size), mode, state);
proxy()->drawItemPixmap(p, opt->rect, Qt::AlignCenter, pixmap);
break;
}
@@ -1067,7 +1072,7 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect
Uses the same computation than in QTabBar::tabSizeHint
*/
-void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const
+void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const
{
Q_ASSERT(textRect);
Q_ASSERT(iconRect);
@@ -1237,7 +1242,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (button->state & State_On)
state = QIcon::On;
- QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state);
+ QPixmap pixmap = button->icon.pixmap(qt_getWindow(widget), button->iconSize, mode, state);
int pixmapWidth = pixmap.width() / pixmap.devicePixelRatio();
int pixmapHeight = pixmap.height() / pixmap.devicePixelRatio();
@@ -1314,7 +1319,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
QPixmap pix;
QRect textRect = btn->rect;
if (!btn->icon.isNull()) {
- pix = btn->icon.pixmap(btn->iconSize, btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled);
+ pix = btn->icon.pixmap(qt_getWindow(widget), btn->iconSize, btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled);
proxy()->drawItemPixmap(p, btn->rect, alignment, pix);
if (btn->direction == Qt::RightToLeft)
textRect.setRight(textRect.right() - btn->iconSize.width() - 4);
@@ -1355,7 +1360,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
| Qt::TextSingleLine;
if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget))
alignment |= Qt::TextHideMnemonic;
- QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (mbi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
+ int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
+ QPixmap pix = mbi->icon.pixmap(qt_getWindow(widget), QSize(iconExtent, iconExtent), (mbi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
if (!pix.isNull())
proxy()->drawItemPixmap(p,mbi->rect, alignment, pix);
else
@@ -1372,7 +1378,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
case CE_ProgressBar:
if (const QStyleOptionProgressBar *pb
= qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
- QStyleOptionProgressBarV2 subopt = *pb;
+ QStyleOptionProgressBar subopt = *pb;
subopt.rect = subElementRect(SE_ProgressBarGroove, pb, widget);
proxy()->drawControl(CE_ProgressBarGroove, &subopt, p, widget);
subopt.rect = subElementRect(SE_ProgressBarContents, pb, widget);
@@ -1390,10 +1396,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
break;
case CE_ProgressBarLabel:
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
- bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
- vertical = (pb2->orientation == Qt::Vertical);
- }
+ const bool vertical = pb->orientation == Qt::Vertical;
if (!vertical) {
QPalette::ColorRole textRole = QPalette::NoRole;
if ((pb->textAlignment & Qt::AlignCenter) && pb->textVisible
@@ -1418,18 +1421,12 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
QRect rect = pb->rect;
- bool vertical = false;
- bool inverted = false;
+ const bool vertical = pb->orientation == Qt::Vertical;
+ const bool inverted = pb->invertedAppearance;
qint64 minimum = qint64(pb->minimum);
qint64 maximum = qint64(pb->maximum);
qint64 progress = qint64(pb->progress);
- // Get extra style options if version 2
- const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt);
- if (pb2) {
- vertical = (pb2->orientation == Qt::Vertical);
- inverted = pb2->invertedAppearance;
- }
QMatrix m;
if (vertical) {
@@ -1489,7 +1486,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
int x0 = reverse ? rect.right() - ((unit_width > 1) ? unit_width : 0)
: rect.x();
- QStyleOptionProgressBarV2 pbBits = *pb;
+ QStyleOptionProgressBar pbBits = *pb;
pbBits.rect = rect;
pbBits.palette = pal2;
int myY = pbBits.rect.y();
@@ -1519,8 +1516,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
QRect rect = header->rect;
if (!header->icon.isNull()) {
+ int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
QPixmap pixmap
- = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (header->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
+ = header->icon.pixmap(qt_getWindow(widget), QSize(iconExtent, iconExtent), (header->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
int pixw = pixmap.width() / pixmap.devicePixelRatio();
QRect aligned = alignedRect(header->direction, QFlag(header->iconAlignment), pixmap.size() / pixmap.devicePixelRatio(), rect);
@@ -1579,7 +1577,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
mode = QIcon::Active;
else
mode = QIcon::Normal;
- pm = toolbutton->icon.pixmap(toolbutton->rect.size().boundedTo(toolbutton->iconSize),
+ pm = toolbutton->icon.pixmap(qt_getWindow(widget), toolbutton->rect.size().boundedTo(toolbutton->iconSize),
mode, state);
pmSize = pm.size() / pm.devicePixelRatio();
}
@@ -1800,7 +1798,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) {
bool enabled = tb->state & State_Enabled;
bool selected = tb->state & State_Selected;
- QPixmap pm = tb->icon.pixmap(proxy()->pixelMetric(QStyle::PM_SmallIconSize, tb, widget),
+ int iconExtent = proxy()->pixelMetric(QStyle::PM_SmallIconSize, tb, widget);
+ QPixmap pm = tb->icon.pixmap(qt_getWindow(widget), QSize(iconExtent, iconExtent),
enabled ? QIcon::Normal : QIcon::Disabled);
QRect cr = subElementRect(QStyle::SE_ToolBoxTabContents, tb, widget);
@@ -1843,12 +1842,11 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
break;
case CE_TabBarTabLabel:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- QStyleOptionTabV3 tabV2(*tab);
- QRect tr = tabV2.rect;
- bool verticalTabs = tabV2.shape == QTabBar::RoundedEast
- || tabV2.shape == QTabBar::RoundedWest
- || tabV2.shape == QTabBar::TriangularEast
- || tabV2.shape == QTabBar::TriangularWest;
+ QRect tr = tab->rect;
+ bool verticalTabs = tab->shape == QTabBar::RoundedEast
+ || tab->shape == QTabBar::RoundedWest
+ || tab->shape == QTabBar::TriangularEast
+ || tab->shape == QTabBar::TriangularWest;
int alignment = Qt::AlignCenter | Qt::TextShowMnemonic;
if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget))
@@ -1857,7 +1855,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (verticalTabs) {
p->save();
int newX, newY, newRot;
- if (tabV2.shape == QTabBar::RoundedEast || tabV2.shape == QTabBar::TriangularEast) {
+ if (tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::TriangularEast) {
newX = tr.width() + tr.x();
newY = tr.y();
newRot = 90;
@@ -1871,15 +1869,15 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
p->setTransform(m, true);
}
QRect iconRect;
- d->tabLayout(&tabV2, widget, &tr, &iconRect);
+ d->tabLayout(tab, widget, &tr, &iconRect);
tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); //we compute tr twice because the style may override subElementRect
- if (!tabV2.icon.isNull()) {
- QPixmap tabIcon = tabV2.icon.pixmap(tabV2.iconSize,
- (tabV2.state & State_Enabled) ? QIcon::Normal
- : QIcon::Disabled,
- (tabV2.state & State_Selected) ? QIcon::On
- : QIcon::Off);
+ if (!tab->icon.isNull()) {
+ QPixmap tabIcon = tab->icon.pixmap(qt_getWindow(widget), tab->iconSize,
+ (tab->state & State_Enabled) ? QIcon::Normal
+ : QIcon::Disabled,
+ (tab->state & State_Selected) ? QIcon::On
+ : QIcon::Off);
p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon);
}
@@ -1887,17 +1885,17 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (verticalTabs)
p->restore();
- if (tabV2.state & State_HasFocus) {
+ if (tab->state & State_HasFocus) {
const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth);
int x1, x2;
- x1 = tabV2.rect.left();
- x2 = tabV2.rect.right() - 1;
+ x1 = tab->rect.left();
+ x2 = tab->rect.right() - 1;
QStyleOptionFocusRect fropt;
fropt.QStyleOption::operator=(*tab);
- fropt.rect.setRect(x1 + 1 + OFFSET, tabV2.rect.y() + OFFSET,
- x2 - x1 - 2*OFFSET, tabV2.rect.height() - 2*OFFSET);
+ fropt.rect.setRect(x1 + 1 + OFFSET, tab->rect.y() + OFFSET,
+ x2 - x1 - 2*OFFSET, tab->rect.height() - 2*OFFSET);
drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);
}
}
@@ -2016,9 +2014,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
}
if (!dwOpt->title.isEmpty()) {
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
if (verticalTitleBar) {
r.setSize(r.size().transposed());
@@ -2077,7 +2073,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (!cb->currentIcon.isNull()) {
QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal
: QIcon::Disabled;
- QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);
+ QPixmap pixmap = cb->currentIcon.pixmap(qt_getWindow(widget), cb->iconSize, mode);
QRect iconRect(editRect);
iconRect.setWidth(cb->iconSize.width() + 4);
iconRect = alignedRect(cb->direction,
@@ -2376,7 +2372,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
if (!btn->icon.isNull()) {
iconRect = itemPixmapRect(cr, Qt::AlignAbsolute | Qt::AlignLeft | Qt::AlignVCenter
| Qt::TextShowMnemonic,
- btn->icon.pixmap(btn->iconSize, QIcon::Normal));
+ btn->icon.pixmap(qt_getWindow(widget), btn->iconSize, QIcon::Normal));
if (!textRect.isEmpty())
textRect.translate(iconRect.right() + 4, 0);
}
@@ -2424,7 +2420,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
if (!btn->icon.isNull()) {
iconRect = itemPixmapRect(cr, Qt::AlignAbsolute | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic,
- btn->icon.pixmap(btn->iconSize, QIcon::Normal));
+ btn->icon.pixmap(qt_getWindow(widget), btn->iconSize, QIcon::Normal));
if (!textRect.isEmpty())
textRect.translate(iconRect.right() + 4, 0);
}
@@ -2454,10 +2450,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
case SE_ProgressBarLabel:
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
int textw = 0;
- bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
- vertical = (pb2->orientation == Qt::Vertical);
- }
+ const bool vertical = pb->orientation == Qt::Vertical;
if (!vertical) {
if (pb->textVisible)
textw = qMax(pb->fontMetrics.width(pb->text), pb->fontMetrics.width(QLatin1String("100%"))) + 6;
@@ -2710,14 +2703,13 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break;
case SE_TabBarTabText:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- QStyleOptionTabV3 tabV3(*tab);
QRect dummyIconRect;
- d->tabLayout(&tabV3, widget, &r, &dummyIconRect);
+ d->tabLayout(tab, widget, &r, &dummyIconRect);
}
break;
case SE_TabBarTabLeftButton:
case SE_TabBarTabRightButton:
- if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
+ if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
bool selected = tab->state & State_Selected;
int verticalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget);
int horizontalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget);
@@ -2889,9 +2881,8 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
= qstyleoption_cast<const QStyleOptionDockWidget*>(opt);
bool canClose = dwOpt == 0 ? true : dwOpt->closable;
bool canFloat = dwOpt == 0 ? false : dwOpt->floatable;
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+
+ const bool verticalTitleBar = dwOpt && dwOpt->verticalTitleBar;
// If this is a vertical titlebar, we transpose and work as if it was
// horizontal, then transpose again.
@@ -3398,9 +3389,9 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|| qobject_cast<const QDockWidget *>(widget)
#endif
)
- pm = proxy()->standardIcon(SP_DockWidgetCloseButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_DockWidgetCloseButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
else
- pm = proxy()->standardIcon(SP_TitleBarCloseButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarCloseButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3419,7 +3410,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMaxButton, widget);
down = tb->activeSubControls & SC_TitleBarMaxButton && (opt->state & State_Sunken);
- pm = proxy()->standardIcon(SP_TitleBarMaxButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarMaxButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3437,7 +3428,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
&& !(tb->titleBarState & Qt::WindowMinimized)) {
ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMinButton, widget);
down = tb->activeSubControls & SC_TitleBarMinButton && (opt->state & State_Sunken);
- pm = proxy()->standardIcon(SP_TitleBarMinButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarMinButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3459,7 +3450,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
if (drawNormalButton) {
ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarNormalButton, widget);
down = tb->activeSubControls & SC_TitleBarNormalButton && (opt->state & State_Sunken);
- pm = proxy()->standardIcon(SP_TitleBarNormalButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarNormalButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3477,7 +3468,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
&& !(tb->titleBarState & Qt::WindowMinimized)) {
ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarShadeButton, widget);
down = (tb->activeSubControls & SC_TitleBarShadeButton && (opt->state & State_Sunken));
- pm = proxy()->standardIcon(SP_TitleBarShadeButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarShadeButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3495,7 +3486,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarUnshadeButton, widget);
down = tb->activeSubControls & SC_TitleBarUnshadeButton && (opt->state & State_Sunken);
- pm = proxy()->standardIcon(SP_TitleBarUnshadeButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarUnshadeButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3511,7 +3502,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarContextHelpButton, widget);
down = tb->activeSubControls & SC_TitleBarContextHelpButton && (opt->state & State_Sunken);
- pm = proxy()->standardIcon(SP_TitleBarContextHelpButton, &tool, widget).pixmap(10, 10);
+ pm = proxy()->standardIcon(SP_TitleBarContextHelpButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
tool.rect = ir;
tool.state = down ? State_Sunken : State_Raised;
proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
@@ -3528,7 +3519,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
tb->icon.paint(p, ir);
} else {
int iconSize = proxy()->pixelMetric(PM_SmallIconSize, tb, widget);
- pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(iconSize, iconSize);
+ pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(iconSize, iconSize));
tool.rect = ir;
p->save();
proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm);
@@ -3715,7 +3706,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiCloseButton, widget);
proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget);
- QPixmap pm = proxy()->standardIcon(SP_TitleBarCloseButton).pixmap(16, 16);
+ QPixmap pm = proxy()->standardIcon(SP_TitleBarCloseButton).pixmap(qt_getWindow(widget), QSize(16, 16));
proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm);
}
if (opt->subControls & QStyle::SC_MdiNormalButton) {
@@ -3732,7 +3723,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiNormalButton, widget);
proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget);
- QPixmap pm = proxy()->standardIcon(SP_TitleBarNormalButton).pixmap(16, 16);
+ QPixmap pm = proxy()->standardIcon(SP_TitleBarNormalButton).pixmap(qt_getWindow(widget), QSize(16, 16));
proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm);
}
if (opt->subControls & QStyle::SC_MdiMinButton) {
@@ -3749,7 +3740,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiMinButton, widget);
proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget);
- QPixmap pm = proxy()->standardIcon(SP_TitleBarMinButton).pixmap(16, 16);
+ QPixmap pm = proxy()->standardIcon(SP_TitleBarMinButton).pixmap(qt_getWindow(widget), QSize(16, 16));
proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm);
}
}
@@ -5762,8 +5753,8 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off);
for (int i = 0 ; i < sizes.size() ; ++i) {
int size = sizes[i].width();
- QPixmap basePixmap = baseIcon.pixmap(size);
- QPixmap linkPixmap = linkIcon.pixmap(size/2);
+ QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size));
+ QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2));
QPainter painter(&basePixmap);
painter.drawPixmap(size/2, size/2, linkPixmap);
icon.addPixmap(basePixmap);
@@ -5779,8 +5770,8 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off);
for (int i = 0 ; i < sizes.size() ; ++i) {
int size = sizes[i].width();
- QPixmap basePixmap = baseIcon.pixmap(size);
- QPixmap linkPixmap = linkIcon.pixmap(size/2);
+ QPixmap basePixmap = baseIcon.pixmap(qt_getWindow(widget), QSize(size, size));
+ QPixmap linkPixmap = linkIcon.pixmap(qt_getWindow(widget), QSize(size / 2, size / 2));
QPainter painter(&basePixmap);
painter.drawPixmap(size/2, size/2, linkPixmap);
icon.addPixmap(basePixmap);
diff --git a/src/widgets/styles/qcommonstyle.h b/src/widgets/styles/qcommonstyle.h
index 06fd755fa1..0d040f1b3e 100644
--- a/src/widgets/styles/qcommonstyle.h
+++ b/src/widgets/styles/qcommonstyle.h
@@ -49,34 +49,34 @@ public:
~QCommonStyle();
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QPoint &pt, const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QSize &contentsSize, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- int pixelMetric(PixelMetric m, const QStyleOption *opt = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ int pixelMetric(PixelMetric m, const QStyleOption *opt = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
- QStyleHintReturn *shret = 0) const Q_DECL_OVERRIDE;
+ int styleHint(StyleHint sh, const QStyleOption *opt = Q_NULLPTR, const QWidget *w = Q_NULLPTR,
+ QStyleHintReturn *shret = Q_NULLPTR) const Q_DECL_OVERRIDE;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *opt) const Q_DECL_OVERRIDE;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
- Qt::Orientation orientation, const QStyleOption *option = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ Qt::Orientation orientation, const QStyleOption *option = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
void polish(QPalette &) Q_DECL_OVERRIDE;
void polish(QApplication *app) Q_DECL_OVERRIDE;
diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h
index 1287528bdb..8f512f7d72 100644
--- a/src/widgets/styles/qcommonstyle_p.h
+++ b/src/widgets/styles/qcommonstyle_p.h
@@ -104,7 +104,7 @@ public:
#endif
mutable QIcon tabBarcloseButtonIcon;
#ifndef QT_NO_TABBAR
- void tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const;
+ void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const;
#endif
int animationFps;
diff --git a/src/widgets/styles/qdrawutil.h b/src/widgets/styles/qdrawutil.h
index 1f2078a931..f34a2857a7 100644
--- a/src/widgets/styles/qdrawutil.h
+++ b/src/widgets/styles/qdrawutil.h
@@ -63,42 +63,42 @@ Q_WIDGETS_EXPORT void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint
Q_WIDGETS_EXPORT void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
int lineWidth = 1, int midLineWidth = 0,
- const QBrush *fill = 0);
+ const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawShadeRect(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
int lineWidth = 1, int midLineWidth = 0,
- const QBrush *fill = 0);
+ const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
- int lineWidth = 1, const QBrush *fill = 0);
+ int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawShadePanel(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
- int lineWidth = 1, const QBrush *fill = 0);
+ int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = 0);
+ const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawWinButton(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = 0);
+ const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = 0);
+ const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawWinPanel(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = 0);
+ const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
- int lineWidth = 1, const QBrush *fill = 0);
+ int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
Q_WIDGETS_EXPORT void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
- int lineWidth = 1, const QBrush *fill = 0);
+ int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
@@ -145,7 +145,7 @@ Q_WIDGETS_EXPORT void qDrawBorderPixmap(QPainter *painter,
const QMargins &sourceMargins,
const QTileRules &rules = QTileRules()
#ifndef Q_QDOC
- , QDrawBorderPixmap::DrawingHints hints = 0
+ , QDrawBorderPixmap::DrawingHints hints = QDrawBorderPixmap::DrawingHints()
#endif
);
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 6d722c680b..2fc52e9a32 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -40,7 +40,6 @@
#include <qpushbutton.h>
#include <qpainter.h>
#include <qdir.h>
-#include <qhash.h>
#include <qstyleoption.h>
#include <qapplication.h>
#include <qmainwindow.h>
@@ -555,11 +554,19 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
QColor arrowColor = header->palette.foreground().color();
QPoint offset = QPoint(0, -1);
+#if defined(Q_OS_LINUX)
if (header->sortIndicator & QStyleOptionHeader::SortUp) {
arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor);
} else if (header->sortIndicator & QStyleOptionHeader::SortDown) {
arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180);
}
+#else
+ if (header->sortIndicator & QStyleOptionHeader::SortUp) {
+ arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor, 180);
+ } else if (header->sortIndicator & QStyleOptionHeader::SortDown) {
+ arrow = colorizedImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_arrow.png"), arrowColor);
+ }
+#endif
if (!arrow.isNull()) {
r.setSize(QSize(arrow.width()/2, arrow.height()/2));
diff --git a/src/widgets/styles/qgtk2painter.cpp b/src/widgets/styles/qgtk2painter.cpp
index 489d456617..ea8afbc93c 100644
--- a/src/widgets/styles/qgtk2painter.cpp
+++ b/src/widgets/styles/qgtk2painter.cpp
@@ -93,6 +93,7 @@ namespace QGtk2PainterPrivate {
static void initGtk()
{
+#ifndef QT_NO_LIBRARY
static bool initialized = false;
if (!initialized) {
// enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
@@ -123,6 +124,7 @@ static void initGtk()
initialized = true;
}
+#endif // !QT_NO_LIBRARY
}
// To recover alpha we apply the gtk painting function two times to
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 348727b328..7ed0dce91d 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -3633,6 +3633,7 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
QFont font = widget->font();
font.setBold(true);
fontMetrics = QFontMetrics(font);
+#ifndef QT_NO_ACCESSIBILITY
} else if (QStyleHelper::isInstanceOf(groupBox->styleObject, QAccessible::Grouping)) {
QVariant var = groupBox->styleObject->property("font");
if (var.isValid() && var.canConvert<QFont>()) {
@@ -3640,6 +3641,7 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
font.setBold(true);
fontMetrics = QFontMetrics(font);
}
+#endif // QT_NO_ACCESSIBILITY
}
QSize textRect = fontMetrics.boundingRect(groupBox->text).size() + QSize(4, 4);
diff --git a/src/widgets/styles/qgtkstyle_p.cpp b/src/widgets/styles/qgtkstyle_p.cpp
index 0e119a11ae..00682c1c0f 100644
--- a/src/widgets/styles/qgtkstyle_p.cpp
+++ b/src/widgets/styles/qgtkstyle_p.cpp
@@ -326,6 +326,7 @@ void QGtkStylePrivate::gtkWidgetSetFocus(GtkWidget *widget, bool focus)
*/
void QGtkStylePrivate::resolveGtk() const
{
+#ifndef QT_NO_LIBRARY
// enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
@@ -427,6 +428,7 @@ void QGtkStylePrivate::resolveGtk() const
gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("gnomevfs-2"), 0, "gnome_vfs_init");
+#endif // !QT_NO_LIBRARY
}
/* \internal
@@ -593,11 +595,13 @@ void QGtkStylePrivate::cleanupGtkWidgets()
static bool resolveGConf()
{
+#ifndef QT_NO_LIBRARY
if (!QGtkStylePrivate::gconf_client_get_default) {
QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
QGtkStylePrivate::gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
QGtkStylePrivate::gconf_client_get_bool = (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
}
+#endif // !QT_NO_LIBRARY
return (QGtkStylePrivate::gconf_client_get_default !=0);
}
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index d13754b36b..ac23512f1d 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -93,16 +93,9 @@
QT_USE_NAMESPACE
-namespace {
-class AutoReleasePool
+static QWindow *qt_getWindow(const QWidget *widget)
{
-public:
- AutoReleasePool(): pool([[NSAutoreleasePool alloc] init]) {}
- ~AutoReleasePool() { [pool release]; }
-
-private:
- NSAutoreleasePool *pool;
-};
+ return widget ? widget->window()->windowHandle() : 0;
}
@interface QT_MANGLE_NAMESPACE(NotificationReceiver) : NSObject {
@@ -126,7 +119,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(NotificationReceiver);
{
Q_UNUSED(notification);
QEvent event(QEvent::StyleChange);
- QMutableSetIterator<QPointer<QObject> > it(QMacStylePrivate::scrollBars);
+ QMutableVectorIterator<QPointer<QObject> > it(QMacStylePrivate::scrollBars);
while (it.hasNext()) {
if (!it.next())
it.remove();
@@ -150,12 +143,7 @@ const int QMacStylePrivate::BevelButtonW = 50;
const int QMacStylePrivate::BevelButtonH = 22;
const int QMacStylePrivate::PushButtonContentPadding = 6;
-QSet<QPointer<QObject> > QMacStylePrivate::scrollBars;
-
-static uint qHash(const QPointer<QObject> &ptr)
-{
- return qHash(ptr.data());
-}
+QVector<QPointer<QObject> > QMacStylePrivate::scrollBars;
// Title bar gradient colors for Lion were determined by inspecting PSDs exported
// using CoreUI's CoreThemeDocument; there is no public API to retrieve them
@@ -277,7 +265,7 @@ QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect)
return tabRect;
}
-void drawTabShape(QPainter *p, const QStyleOptionTabV3 *tabOpt, bool isUnified)
+void drawTabShape(QPainter *p, const QStyleOptionTab *tabOpt, bool isUnified)
{
QRect r = tabOpt->rect;
p->translate(tabOpt->rect.x(), tabOpt->rect.y());
@@ -381,7 +369,7 @@ void drawTabShape(QPainter *p, const QStyleOptionTabV3 *tabOpt, bool isUnified)
}
}
-void drawTabBase(QPainter *p, const QStyleOptionTabBarBaseV2 *tbb, const QWidget *w)
+void drawTabBase(QPainter *p, const QStyleOptionTabBarBase *tbb, const QWidget *w)
{
QRect r = tbb->rect;
if (isVerticalTabs(tbb->shape)) {
@@ -1753,7 +1741,7 @@ QMacStylePrivate::QMacStylePrivate()
QMacStylePrivate::~QMacStylePrivate()
{
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
Q_FOREACH (NSView *b, cocoaControls)
[b release];
}
@@ -1884,7 +1872,7 @@ NSView *QMacStylePrivate::cocoaControl(QCocoaWidget widget) const
if ([bv isKindOfClass:[NSButton class]]) {
NSButton *bc = (NSButton *)bv;
- bc.title = nil;
+ bc.title = @"";
}
if ([bv isKindOfClass:[NSControl class]]) {
@@ -1977,7 +1965,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
const bool button = opt->type == QStyleOption::SO_Button;
const bool viewItem = opt->type == QStyleOption::SO_ViewItem;
const bool pressed = bdi->state == kThemeStatePressed;
- const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
+ const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10;
if (button && pressed) {
if (bdi->kind == kThemePushButton) {
@@ -1989,7 +1977,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
}
- int devicePixelRatio = p->device()->devicePixelRatio();
+ int devicePixelRatio = p->device()->devicePixelRatioF();
int width = devicePixelRatio * (int(macRect.size.width) + extraWidth);
int height = devicePixelRatio * (int(macRect.size.height) + extraHeight);
@@ -2135,7 +2123,7 @@ QMacStyle::QMacStyle()
: QCommonStyle(*new QMacStylePrivate)
{
Q_D(QMacStyle);
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
@@ -2152,7 +2140,7 @@ QMacStyle::QMacStyle()
QMacStyle::~QMacStyle()
{
Q_D(QMacStyle);
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
[reinterpret_cast<NSScroller*>(d->nsscroller) release];
@@ -2169,7 +2157,7 @@ QMacStyle::~QMacStyle()
*/
QPixmap QMacStylePrivate::generateBackgroundPattern() const
{
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
QPixmap px(4, 4);
QMacCGContext cg(&px);
HIThemeSetFill(kThemeBrushDialogBackgroundActive, 0, cg, kHIThemeOrientationNormal);
@@ -2767,7 +2755,7 @@ QPalette QMacStyle::standardPalette() const
int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w,
QStyleHintReturn *hret) const
{
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
SInt32 ret = 0;
switch (sh) {
@@ -2868,7 +2856,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = QEvent::MouseButtonRelease;
break;
case SH_TabBar_SelectMouseType:
- if (const QStyleOptionTabBarBaseV2 *opt2 = qstyleoption_cast<const QStyleOptionTabBarBaseV2 *>(opt)) {
+ if (const QStyleOptionTabBarBase *opt2 = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
ret = opt2->documentMode ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease;
} else {
ret = QEvent::MouseButtonRelease;
@@ -3141,7 +3129,7 @@ QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOpt
size = 64;
break;
}
- return icon.pixmap(size, size);
+ return icon.pixmap(qt_getWindow(widget), QSize(size, size));
}
void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy)
@@ -3234,8 +3222,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
p->restore();
break; }
case PE_FrameTabBarBase:
- if (const QStyleOptionTabBarBaseV2 *tbb
- = qstyleoption_cast<const QStyleOptionTabBarBaseV2 *>(opt)) {
+ if (const QStyleOptionTabBarBase *tbb
+ = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
if (tbb->documentMode) {
p->save();
drawTabBase(p, tbb, w);
@@ -3273,8 +3261,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
break;
case PE_FrameGroupBox:
if (const QStyleOptionFrame *groupBox = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
- const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt);
- if (frame2 && frame2->features & QStyleOptionFrameV2::Flat) {
+ if (groupBox->features & QStyleOptionFrame::Flat) {
QCommonStyle::drawPrimitive(pe, groupBox, p, w);
} else {
HIThemeGroupBoxDrawInfo gdi;
@@ -3618,6 +3605,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QWindow *window = w && w->window() ? w->window()->windowHandle() :
QStyleHelper::styleObjectWindow(opt->styleObject);
const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
+ const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10;
switch (ce) {
case CE_HeaderSection:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
@@ -3701,7 +3689,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QIcon::Mode mode = QIcon::Disabled;
if (opt->state & State_Enabled)
mode = QIcon::Normal;
- QPixmap pixmap = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), mode);
+ int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
+ QPixmap pixmap = header->icon.pixmap(window, QSize(iconExtent, iconExtent), mode);
QRect pixr = header->rect;
pixr.setY(header->rect.center().y() - (pixmap.height() / pixmap.devicePixelRatio() - 1) / 2);
@@ -3709,7 +3698,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
textr.translate(pixmap.width() / pixmap.devicePixelRatio() + 2, 0);
}
- p->setFont(qt_app_fonts_hash()->value("QSmallFont", QFont()));
proxy()->drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette,
header->state & State_Enabled, header->text, QPalette::ButtonText);
p->restore();
@@ -3753,7 +3741,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
: QIcon::Disabled;
QIcon::State iconState = (tb->state & State_On) ? QIcon::On
: QIcon::Off;
- QPixmap pixmap = tb->icon.pixmap(tb->rect.size().boundedTo(tb->iconSize), iconMode, iconState);
+ QPixmap pixmap = tb->icon.pixmap(window,
+ tb->rect.size().boundedTo(tb->iconSize),
+ iconMode, iconState);
// Draw the text if it's needed.
if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) {
@@ -3829,13 +3819,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// No default button pulsating animation on Yosemite,
// so we have to do few things differently.
- const bool yosemiteOrLater = QSysInfo::QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
// 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 (yosemiteOrLater)
+ if (usingYosemiteOrLater)
d->autoDefaultButton = opt->styleObject;
else
d->setAutoDefaultButton(opt->styleObject);
@@ -3846,7 +3835,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (!d->autoDefaultButton) {
if (btn->features & QStyleOptionButton::DefaultButton && opt->state & State_Active) {
d->defaultButton = opt->styleObject;
- if (!yosemiteOrLater && !d->animation(opt->styleObject))
+ if (!usingYosemiteOrLater && !d->animation(opt->styleObject))
d->startAnimation(new QStyleAnimation(opt->styleObject));
} else if (d->defaultButton == opt->styleObject) {
if (QStyleAnimation *animation = d->animation(opt->styleObject)) {
@@ -3868,7 +3857,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
HIThemeButtonDrawInfo bdi;
d->initHIThemePushButton(btn, w, tds, &bdi);
- if (yosemiteOrLater) {
+ if (usingYosemiteOrLater) {
if (!hasMenu) {
// HITheme is not drawing a nice focus frame around buttons.
// We'll do it ourselves further down.
@@ -3921,7 +3910,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
newRect.size.width -= QMacStylePrivate::PushButtonRightOffset - 4;
}
- if (hasMenu && yosemiteOrLater && bdi.kind != kThemeBevelButton) {
+ if (hasMenu && usingYosemiteOrLater && bdi.kind != kThemeBevelButton) {
QCocoaWidget cw = cocoaWidgetFromHIThemeButtonKind(bdi.kind);
cw.first = QCocoaPullDownButton;
NSPopUpButton *pdb = (NSPopUpButton *)d->cocoaControl(cw);
@@ -3935,7 +3924,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
else
HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
- if (yosemiteOrLater && btn->state & State_HasFocus) {
+ if (usingYosemiteOrLater && btn->state & State_HasFocus) {
CGRect focusRect = newRect;
if (bdi.kind == kThemePushButton)
focusRect.size.height += 1; // Another thing HITheme and Cocoa seem to disagree about.
@@ -3966,7 +3955,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
qt_drawFocusRingOnPath(cg, pushButtonFocusRingPath);
}
- if (hasMenu && (!yosemiteOrLater || bdi.kind == kThemeBevelButton)) {
+ if (hasMenu && (!usingYosemiteOrLater || bdi.kind == kThemeBevelButton)) {
int mbi = proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, btn, w);
QRect ir = btn->rect;
int arrowXOffset = bdi.kind == kThemePushButton ? 6 :
@@ -4084,7 +4073,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QIcon::State state = QIcon::Off;
if (btn.state & State_On)
state = QIcon::On;
- QPixmap pixmap = btn.icon.pixmap(btn.iconSize, mode, state);
+ 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;
@@ -4122,23 +4111,19 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
case CE_TabBarTabShape:
if (const QStyleOptionTab *tabOpt = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- if (const QStyleOptionTabV3 *tabOptV3 = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
- if (tabOptV3->documentMode) {
- p->save();
- bool isUnified = false;
- if (w) {
- QRect tabRect = tabOptV3->rect;
- QPoint windowTabStart = w->mapTo(w->window(), tabRect.topLeft());
- isUnified = isInMacUnifiedToolbarArea(w->window()->windowHandle(), windowTabStart.y());
- }
-
- drawTabShape(p, tabOptV3, isUnified);
- p->restore();
- return;
+ if (tabOpt->documentMode) {
+ p->save();
+ bool isUnified = false;
+ if (w) {
+ QRect tabRect = tabOpt->rect;
+ QPoint windowTabStart = w->mapTo(w->window(), tabRect.topLeft());
+ isUnified = isInMacUnifiedToolbarArea(w->window()->windowHandle(), windowTabStart.y());
}
- }
- bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
+ drawTabShape(p, tabOpt, isUnified);
+ p->restore();
+ return;
+ }
HIThemeTabDrawInfo tdi;
tdi.version = 1;
@@ -4247,11 +4232,10 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
break;
case CE_TabBarTabLabel:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- QStyleOptionTabV3 myTab = *tab;
+ QStyleOptionTab myTab = *tab;
ThemeTabDirection ttd = getTabDirection(myTab.shape);
bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
bool selected = (myTab.state & QStyle::State_Selected);
- bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
if (selected && !myTab.documentMode
&& (!usingYosemiteOrLater || myTab.state & State_Active))
@@ -4283,7 +4267,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
QPalette np = tab->palette;
np.setColor(QPalette::WindowText, shadowColor);
- QRect nr = subElementRect(SE_TabBarTabText, opt, w);
+ QRect nr = proxy()->subElementRect(SE_TabBarTabText, opt, w);
nr.moveTop(-1);
int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextHideMnemonic;
proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled,
@@ -4375,9 +4359,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// Draw the text...
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
if (!dwOpt->title.isEmpty()) {
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(dwOpt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, opt, w);
if (verticalTitleBar) {
@@ -4537,7 +4520,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (const QComboBox *comboBox = qobject_cast<const QComboBox *>(w)) {
iconSize = comboBox->iconSize();
}
- QPixmap pixmap = mi->icon.pixmap(iconSize, mode);
+ 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());
@@ -4642,10 +4625,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
if (!mi->icon.isNull()) {
+ int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
drawItemPixmap(p, mi->rect,
Qt::AlignCenter | Qt::TextHideMnemonic | Qt::TextDontClip
| Qt::TextSingleLine,
- mi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize),
+ mi->icon.pixmap(window, QSize(iconExtent, iconExtent),
(mi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled));
} else {
drawItemText(p, mi->rect,
@@ -4673,12 +4657,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tdi.version = qt_mac_hitheme_version;
tdi.reserved = 0;
bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
- bool vertical = false;
- bool inverted = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
- vertical = (pb2->orientation == Qt::Vertical);
- inverted = pb2->invertedAppearance;
- }
+ const bool vertical = pb->orientation == Qt::Vertical;
+ const bool inverted = pb->invertedAppearance;
bool reverse = (!vertical && (pb->direction == Qt::RightToLeft));
if (inverted)
reverse = !reverse;
@@ -4699,7 +4679,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tdi.value = pb->progress;
tdi.attributes = vertical ? 0 : kThemeTrackHorizontal;
- const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
if (isIndeterminate || (tdi.value < tdi.max && !usingYosemiteOrLater)) {
if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject)))
tdi.trackInfo.progress.phase = animation->animationStep();
@@ -4782,8 +4761,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
HIThemeSplitterDrawInfo sdi;
sdi.version = qt_mac_hitheme_version;
sdi.state = tds;
- sdi.adornment = qt_mac_is_metal(w) ? kHIThemeSplitterAdornmentMetal
- : kHIThemeSplitterAdornmentNone;
+ sdi.adornment = qt_mac_is_metal(w) || usingYosemiteOrLater ?
+ kHIThemeSplitterAdornmentMetal : kHIThemeSplitterAdornmentNone;
HIRect hirect = qt_hirectForQRect(opt->rect);
HIThemeDrawPaneSplitter(&hirect, &sdi, cg, kHIThemeOrientationNormal);
} else {
@@ -5142,7 +5121,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
break;
case SE_FrameLayoutItem:
- // hack because QStyleOptionFrameV2 doesn't have a frameStyle member
+ // hack because QStyleOptionFrame doesn't have a frameStyle member
if (const QFrame *frame = qobject_cast<const QFrame *>(widget)) {
rect = opt->rect;
switch (frame->frameStyle() & QFrame::Shape_Mask) {
@@ -5205,9 +5184,8 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
= qstyleoption_cast<const QStyleOptionDockWidget*>(opt);
bool canClose = dwOpt == 0 ? true : dwOpt->closable;
bool canFloat = dwOpt == 0 ? false : dwOpt->floatable;
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
// If this is a vertical titlebar, we transpose and work as if it was
// horizontal, then transpose again.
@@ -5318,6 +5296,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
QWindow *window = widget && widget->window() ? widget->window()->windowHandle() :
QStyleHelper::styleObjectWindow(opt->styleObject);
const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
+ const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10;
switch (cc) {
case CC_Slider:
case CC_ScrollBar:
@@ -5380,7 +5359,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
// there is not enough space for them.
if (cc == CC_ScrollBar) {
if (opt && opt->styleObject && !QMacStylePrivate::scrollBars.contains(opt->styleObject))
- QMacStylePrivate::scrollBars.insert(QPointer<QObject>(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);
@@ -5395,7 +5374,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
tdi.attributes |= kThemeTrackHideTrack;
}
- const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
const bool isHorizontal = slider->orientation == Qt::Horizontal;
if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient, opt, widget)) {
@@ -5771,7 +5749,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
break;
case CC_ComboBox:
if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)){
- const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
HIThemeButtonDrawInfo bdi;
d->initComboboxBdi(combo, &bdi, widget, tds);
HIRect rect = qt_hirectForQRect(combo->rect);
@@ -5889,9 +5866,11 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
x += iw;
else
x += br.width() / 2 - p->fontMetrics().width(titlebar->text) / 2;
- if (iw)
+ if (iw) {
+ int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
p->drawPixmap(x - iw, y,
- titlebar->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), QIcon::Normal));
+ titlebar->icon.pixmap(window, QSize(iconExtent, iconExtent), QIcon::Normal));
+ }
drawItemText(p, br, Qt::AlignCenter, opt->palette, tds == kThemeStateActive,
titlebar->text, QPalette::Text);
p->restore();
@@ -5904,7 +5883,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
= qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
QStyleOptionGroupBox groupBox(*gb);
- bool flat = (groupBox.features & QStyleOptionFrameV2::Flat);
+ const bool flat = groupBox.features & QStyleOptionFrame::Flat;
if (!flat)
groupBox.state |= QStyle::State_Mini; // Force mini-sized checkbox to go with small-sized label
else
@@ -6356,7 +6335,7 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
case CC_GroupBox:
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
bool checkable = groupBox->subControls & SC_GroupBoxCheckBox;
- bool flat = (groupBox->features & QStyleOptionFrameV2::Flat);
+ const bool flat = groupBox->features & QStyleOptionFrame::Flat;
bool hasNoText = !checkable && groupBox->text.isEmpty();
switch (sc) {
case SC_GroupBoxLabel:
@@ -6635,7 +6614,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
break;
case QStyle::CT_TabBarTab:
- if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
+ if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
const QAquaWidgetSize AquaSize = d->aquaSizeConstrain(opt, widget);
const bool differentFont = (widget && widget->testAttribute(Qt::WA_SetFont))
|| !QApplication::desktopSettingsAware();
@@ -7213,11 +7192,11 @@ CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
ret = CGBitmapContextCreate(image->bits(), image->width(), image->height(),
8, image->bytesPerLine(), colorspace, flags);
} else {
- qDebug() << "qt_mac_cg_context: Unsupported pixmap class";
+ qDebug("qt_mac_cg_context: Unsupported pixmap class");
}
CGContextTranslateCTM(ret, 0, pm->height());
- int devicePixelRatio = pdev->devicePixelRatio();
+ qreal devicePixelRatio = pdev->devicePixelRatioF();
CGContextScaleCTM(ret, devicePixelRatio, devicePixelRatio);
CGContextScaleCTM(ret, 1, -1);
return ret;
@@ -7225,7 +7204,7 @@ CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
//CGContextRef ret = static_cast<CGContextRef>(static_cast<const QWidget *>(pdev)->macCGHandle());
///CGContextRetain(ret);
//return ret;
- qDebug() << "qt_mac_cg_context: not implemented: Widget class";
+ qDebug("qt_mac_cg_context: not implemented: Widget class");
return 0;
}
return 0;
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index b09e81d595..33818568ec 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -86,7 +86,7 @@
#include <qdatetimeedit.h>
#include <qmath.h>
#include <qpair.h>
-#include <qset.h>
+#include <qvector.h>
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtWidgets/qgraphicsview.h>
@@ -213,7 +213,7 @@ public:
mutable QPointer<QObject> pressedButton;
mutable QPointer<QObject> defaultButton;
mutable QPointer<QObject> autoDefaultButton;
- static QSet<QPointer<QObject> > scrollBars;
+ static QVector<QPointer<QObject> > scrollBars;
struct ButtonState {
int frame;
diff --git a/src/widgets/styles/qproxystyle.h b/src/widgets/styles/qproxystyle.h
index cac4cde0f2..072965bbd7 100644
--- a/src/widgets/styles/qproxystyle.h
+++ b/src/widgets/styles/qproxystyle.h
@@ -47,16 +47,16 @@ class Q_WIDGETS_EXPORT QProxyStyle : public QCommonStyle
Q_OBJECT
public:
- QProxyStyle(QStyle *style = 0);
+ QProxyStyle(QStyle *style = Q_NULLPTR);
QProxyStyle(const QString &key);
~QProxyStyle();
QStyle *baseStyle() const;
void setBaseStyle(QStyle *style);
- void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled,
const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const Q_DECL_OVERRIDE;
virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
@@ -68,14 +68,14 @@ public:
QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const Q_DECL_OVERRIDE;
QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
- SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ int styleHint(StyleHint hint, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR, QStyleHintReturn *returnData = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
- Qt::Orientation orientation, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ Qt::Orientation orientation, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const Q_DECL_OVERRIDE;
QPalette standardPalette() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index b41762795d..1e9d15c993 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -192,7 +192,7 @@ public:
Q_ENUM(PrimitiveElement)
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const = 0;
+ const QWidget *w = Q_NULLPTR) const = 0;
enum ControlElement {
CE_PushButton,
CE_PushButtonBevel,
@@ -263,7 +263,7 @@ public:
Q_ENUM(ControlElement)
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const = 0;
+ const QWidget *w = Q_NULLPTR) const = 0;
enum SubElement {
SE_PushButtonContents,
@@ -347,7 +347,7 @@ public:
Q_ENUM(SubElement)
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option,
- const QWidget *widget = 0) const = 0;
+ const QWidget *widget = Q_NULLPTR) const = 0;
enum ComplexControl {
@@ -426,11 +426,11 @@ public:
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *widget = 0) const = 0;
+ const QWidget *widget = Q_NULLPTR) const = 0;
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *widget = 0) const = 0;
+ const QPoint &pt, const QWidget *widget = Q_NULLPTR) const = 0;
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
- SubControl sc, const QWidget *widget = 0) const = 0;
+ SubControl sc, const QWidget *widget = Q_NULLPTR) const = 0;
enum PixelMetric {
PM_ButtonMargin,
@@ -561,8 +561,8 @@ public:
};
Q_ENUM(PixelMetric)
- virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
- const QWidget *widget = 0) const = 0;
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR) const = 0;
enum ContentsType {
CT_PushButton,
@@ -594,7 +594,7 @@ public:
Q_ENUM(ContentsType)
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *w = 0) const = 0;
+ const QSize &contentsSize, const QWidget *w = Q_NULLPTR) const = 0;
enum RequestSoftwareInputPanel {
RSIP_OnMouseClickAndAlreadyFocused,
@@ -724,8 +724,8 @@ public:
};
Q_ENUM(StyleHint)
- virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = 0,
- const QWidget *widget = 0, QStyleHintReturn* returnData = 0) const = 0;
+ virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR, QStyleHintReturn* returnData = Q_NULLPTR) const = 0;
enum StandardPixmap {
SP_TitleBarMenuButton,
@@ -804,11 +804,11 @@ public:
};
Q_ENUM(StandardPixmap)
- virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = 0,
- const QWidget *widget = 0) const = 0;
+ virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR) const = 0;
- virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
- const QWidget *widget = 0) const = 0;
+ virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = Q_NULLPTR,
+ const QWidget *widget = Q_NULLPTR) const = 0;
virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *opt) const = 0;
@@ -827,10 +827,10 @@ public:
virtual int layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2, Qt::Orientation orientation,
- const QStyleOption *option = 0, const QWidget *widget = 0) const = 0;
+ const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const = 0;
int combinedLayoutSpacing(QSizePolicy::ControlTypes controls1,
QSizePolicy::ControlTypes controls2, Qt::Orientation orientation,
- QStyleOption *option = 0, QWidget *widget = 0) const;
+ QStyleOption *option = Q_NULLPTR, QWidget *widget = Q_NULLPTR) const;
const QStyle * proxy() const;
diff --git a/src/widgets/styles/qstylepainter.h b/src/widgets/styles/qstylepainter.h
index 33d17d42b9..8492d231ae 100644
--- a/src/widgets/styles/qstylepainter.h
+++ b/src/widgets/styles/qstylepainter.h
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
class QStylePainter : public QPainter
{
public:
- inline QStylePainter() : QPainter(), widget(0), wstyle(0) {}
+ inline QStylePainter() : QPainter(), widget(Q_NULLPTR), wstyle(Q_NULLPTR) {}
inline explicit QStylePainter(QWidget *w) { begin(w, w); }
inline QStylePainter(QPaintDevice *pd, QWidget *w) { begin(pd, w); }
inline bool begin(QWidget *w) { return begin(w, w); }
diff --git a/src/widgets/styles/qstyleplugin.h b/src/widgets/styles/qstyleplugin.h
index b83774a39d..c8f6344758 100644
--- a/src/widgets/styles/qstyleplugin.h
+++ b/src/widgets/styles/qstyleplugin.h
@@ -48,7 +48,7 @@ class Q_WIDGETS_EXPORT QStylePlugin : public QObject
{
Q_OBJECT
public:
- explicit QStylePlugin(QObject *parent = 0);
+ explicit QStylePlugin(QObject *parent = Q_NULLPTR);
~QStylePlugin();
virtual QStyle *create(const QString &key) = 0;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index ce10b92d85..d3f667748e 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -460,7 +460,6 @@ class QRenderRule
public:
QRenderRule() : features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) { }
QRenderRule(const QVector<QCss::Declaration> &, const QObject *);
- ~QRenderRule() { }
QRect borderRect(const QRect &r) const;
QRect outlineRect(const QRect &r) const;
@@ -558,16 +557,22 @@ public:
return csz;
}
+ bool hasStyleHint(const QString &sh) const { return styleHints.contains(sh); }
+ QVariant styleHint(const QString &sh) const { return styleHints.value(sh); }
+
+ void fixupBorder(int);
+
+ // Shouldn't be here
+ void setClip(QPainter *p, const QRect &rect);
+ void unsetClip(QPainter *);
+
+public:
int features;
QBrush defaultBackground;
QFont font;
bool hasFont;
QHash<QString, QVariant> styleHints;
- bool hasStyleHint(const QString& sh) const { return styleHints.contains(sh); }
- QVariant styleHint(const QString& sh) const { return styleHints.value(sh); }
-
- void fixupBorder(int);
QSharedDataPointer<QStyleSheetPaletteData> pal;
QSharedDataPointer<QStyleSheetBoxData> b;
@@ -578,12 +583,10 @@ public:
QSharedDataPointer<QStyleSheetPositionData> p;
QSharedDataPointer<QStyleSheetImageData> img;
- // Shouldn't be here
- void setClip(QPainter *p, const QRect &rect);
- void unsetClip(QPainter *);
int clipset;
QPainterPath clipPath;
};
+Q_DECLARE_TYPEINFO(QRenderRule, Q_MOVABLE_TYPE);
///////////////////////////////////////////////////////////////////////////////////////////
static const char *const knownStyleHints[] = {
@@ -728,6 +731,7 @@ namespace {
int width;
};
}
+template <> class QTypeInfo<ButtonInfo> : public QTypeInfoMerger<ButtonInfo, QRenderRule, int> {};
QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget *w, const QStyleOptionTitleBar *tb) const
{
@@ -742,16 +746,19 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget
int offsets[3] = { 0, 0, 0 };
enum Where { Left, Right, Center, NoWhere } where = Left;
- QList<ButtonInfo> infos;
- for (int i = 0; i < layout.count(); i++) {
- ButtonInfo info;
- info.element = layout[i].toInt();
- if (info.element == '(') {
+ QVector<ButtonInfo> infos;
+ const int numLayouts = layout.size();
+ infos.reserve(numLayouts);
+ for (int i = 0; i < numLayouts; i++) {
+ const int element = layout[i].toInt();
+ if (element == '(') {
where = Center;
- } else if (info.element == ')') {
+ } else if (element == ')') {
where = Right;
} else {
- switch (info.element) {
+ ButtonInfo info;
+ info.element = element;
+ switch (element) {
case PseudoElement_TitleBar:
if (!(tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)))
continue;
@@ -796,14 +803,14 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget
info.rule = subRule;
info.offset = offsets[where];
info.where = where;
- infos.append(info);
+ infos.append(qMove(info));
offsets[where] += info.width;
}
}
- for (int i = 0; i < infos.count(); i++) {
- ButtonInfo info = infos[i];
+ for (int i = 0; i < infos.size(); i++) {
+ const ButtonInfo &info = infos[i];
QRect lr = cr;
switch (info.where) {
case Center: {
@@ -1951,24 +1958,24 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
}
#endif // QT_NO_TOOLBAR
#ifndef QT_NO_TOOLBOX
- else if (const QStyleOptionToolBoxV2 *tab = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(opt)) {
- if (tab->position == QStyleOptionToolBoxV2::OnlyOneTab)
+ else if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) {
+ if (tb->position == QStyleOptionToolBox::OnlyOneTab)
extraClass |= PseudoClass_OnlyOne;
- else if (tab->position == QStyleOptionToolBoxV2::Beginning)
+ else if (tb->position == QStyleOptionToolBox::Beginning)
extraClass |= PseudoClass_First;
- else if (tab->position == QStyleOptionToolBoxV2::End)
+ else if (tb->position == QStyleOptionToolBox::End)
extraClass |= PseudoClass_Last;
- else if (tab->position == QStyleOptionToolBoxV2::Middle)
+ else if (tb->position == QStyleOptionToolBox::Middle)
extraClass |= PseudoClass_Middle;
- if (tab->selectedPosition == QStyleOptionToolBoxV2::NextIsSelected)
+ if (tb->selectedPosition == QStyleOptionToolBox::NextIsSelected)
extraClass |= PseudoClass_NextSelected;
- else if (tab->selectedPosition == QStyleOptionToolBoxV2::PreviousIsSelected)
+ else if (tb->selectedPosition == QStyleOptionToolBox::PreviousIsSelected)
extraClass |= PseudoClass_PreviousSelected;
}
#endif // QT_NO_TOOLBOX
#ifndef QT_NO_DOCKWIDGET
- else if (const QStyleOptionDockWidgetV2 *dw = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)) {
+ else if (const QStyleOptionDockWidget *dw = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
if (dw->verticalTitleBar)
extraClass |= PseudoClass_Vertical;
else
@@ -2393,6 +2400,13 @@ static bool unstylable(const QWidget *w)
return true;
}
#endif
+
+#ifndef QT_NO_TABBAR
+ if (w->metaObject() == &QWidget::staticMetaObject
+ && qobject_cast<const QTabBar*>(w->parentWidget()))
+ return true; // The moving tab of a QTabBar
+#endif
+
return false;
}
@@ -3793,7 +3807,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
case CE_ProgressBarContents: {
QRenderRule subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk);
if (subRule.hasDrawable()) {
- if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
p->save();
p->setClipRect(pb->rect);
@@ -3874,12 +3888,12 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
break;
case CE_ProgressBarLabel:
- if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
if (rule.hasBox() || rule.hasBorder() || hasStyleRule(w, PseudoElement_ProgressBarChunk)) {
drawItemText(p, pb->rect, pb->textAlignment | Qt::TextSingleLine, pb->palette,
pb->state & State_Enabled, pb->text, QPalette::Text);
} else {
- QStyleOptionProgressBarV2 pbCopy(*pb);
+ QStyleOptionProgressBar pbCopy(*pb);
rule.configurePalette(&pbCopy.palette, QPalette::HighlightedText, QPalette::Highlight);
baseStyle()->drawControl(ce, &pbCopy, p, w);
}
@@ -4002,13 +4016,13 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
case CE_TabBarTabLabel:
case CE_TabBarTabShape:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- QStyleOptionTabV3 tabCopy(*tab);
QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, opt->rect, opt->direction);
if (ce == CE_TabBarTabShape && subRule.hasDrawable()) {
subRule.drawRule(p, r);
return;
}
+ QStyleOptionTab tabCopy(*tab);
subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Window);
QFont oldFont = p->font();
if (subRule.hasFont)
@@ -4036,14 +4050,14 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
break;
case CE_DockWidgetTitle:
- if (const QStyleOptionDockWidgetV2 *dwOpt = qstyleoption_cast<const QStyleOptionDockWidgetV2 *>(opt)) {
+ if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_DockWidgetTitle);
if (!subRule.hasDrawable() && !subRule.hasPosition())
break;
if (subRule.hasDrawable()) {
subRule.drawRule(p, opt->rect);
} else {
- QStyleOptionDockWidgetV2 dwCopy(*dwOpt);
+ QStyleOptionDockWidget dwCopy(*dwOpt);
dwCopy.title = QString();
baseStyle()->drawControl(ce, &dwCopy, p, w);
}
@@ -4379,7 +4393,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane);
if (subRule.hasNativeBorder()) {
subRule.drawBackground(p, opt->rect);
- QStyleOptionTabWidgetFrameV2 frmCopy(*frm);
+ QStyleOptionTabWidgetFrame frmCopy(*frm);
subRule.configurePalette(&frmCopy.palette, QPalette::WindowText, QPalette::Window);
baseStyle()->drawPrimitive(pe, &frmCopy, p, w);
} else {
@@ -5695,7 +5709,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
case SE_ProgressBarGroove:
case SE_ProgressBarContents:
case SE_ProgressBarLabel:
- if (const QStyleOptionProgressBarV2 *pb = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
if (rule.hasBox() || !rule.hasNativeBorder() || rule.hasPosition() || hasStyleRule(w, PseudoElement_ProgressBarChunk)) {
if (se == SE_ProgressBarGroove)
return rule.borderRect(pb->rect);
diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp
index fd9ac6fecf..e26925807f 100644
--- a/src/widgets/styles/qwindowscestyle.cpp
+++ b/src/widgets/styles/qwindowscestyle.cpp
@@ -1536,7 +1536,7 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt
QRect textRect = subControlRect(CC_GroupBox, &groupBoxFont, SC_GroupBoxLabel, widget);
QRect checkBoxRect = subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget);
if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
- QStyleOptionFrameV2 frame;
+ QStyleOptionFrame frame;
frame.QStyleOption::operator=(*groupBox);
frame.features = groupBox->features;
frame.lineWidth = groupBox->lineWidth;
@@ -2002,7 +2002,7 @@ QRect QWindowsCEStyle::subControlRect(ComplexControl control, const QStyleOption
}
int frameWidth = 0;
- if ((groupBox->features & QStyleOptionFrameV2::Flat) == 0)
+ if ((groupBox->features & QStyleOptionFrame::Flat) == 0)
frameWidth = pixelMetric(PM_DefaultFrameWidth, groupBox, widget);
rect = frameRect.adjusted(frameWidth, frameWidth + topHeight, -frameWidth, -frameWidth - noLabelMargin);
break;
@@ -2013,7 +2013,7 @@ QRect QWindowsCEStyle::subControlRect(ComplexControl control, const QStyleOption
QFontMetrics fontMetrics = groupBox->fontMetrics;
int h = fontMetrics.height();
int tw = fontMetrics.size(Qt::TextShowMnemonic, groupBox->text + QLatin1Char(' ')).width();
- int marg = (groupBox->features & QStyleOptionFrameV2::Flat) ? 0 : 8;
+ const int marg = (groupBox->features & QStyleOptionFrame::Flat) ? 0 : 8;
rect = groupBox->rect.adjusted(marg, 0, -marg, 0);
rect.setHeight(h);
diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp
index 2f5ea7a54c..e34c2dfe00 100644
--- a/src/widgets/styles/qwindowsmobilestyle.cpp
+++ b/src/widgets/styles/qwindowsmobilestyle.cpp
@@ -4682,8 +4682,8 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp
#ifndef QT_NO_PROGRESSBAR
case PE_IndicatorProgressChunk: {
bool vertical = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option))
- vertical = (pb2->orientation == Qt::Vertical);
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option))
+ vertical = pb->orientation == Qt::Vertical;
if (!vertical) {
painter->fillRect(option->rect.x(), option->rect.y()+2, option->rect.width(), option->rect.height()-4,
option->palette.brush(QPalette::Highlight));
@@ -4806,8 +4806,7 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp
case PE_FrameGroupBox:
if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(option);
- if (frame2 && !(frame2->features & QStyleOptionFrameV2::Flat)) {
+ if (!(frame->features & QStyleOptionFrame::Flat)) {
QPen oldPen = painter->pen();
QRect r = frame->rect;
painter->setPen(frame->palette.shadow().color());
@@ -5678,9 +5677,8 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption
#ifndef QT_NO_DOCKWIDGET
case CE_DockWidgetTitle:
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option)) {
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(option);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
QRect rect = dwOpt->rect;
QRect r = rect;
@@ -6168,7 +6166,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
QRect textRect = proxy()->subControlRect(CC_GroupBox, &groupBoxFont, SC_GroupBoxLabel, widget);
QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget).adjusted(0,0,0,0);
if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
- QStyleOptionFrameV2 frame;
+ QStyleOptionFrame frame;
frame.QStyleOption::operator=(*groupBox);
frame.features = groupBox->features;
frame.lineWidth = groupBox->lineWidth;
@@ -6800,8 +6798,8 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp
QFontMetrics fontMetrics = groupBox->fontMetrics;
int h = fontMetrics.height();
int textWidth = fontMetrics.size(Qt::TextShowMnemonic, groupBox->text + QLatin1Char(' ')).width();
- int margX = (groupBox->features & QStyleOptionFrameV2::Flat) ? 0 : 2;
- int margY = (groupBox->features & QStyleOptionFrameV2::Flat) ? 0 : 2;
+ const int margX = (groupBox->features & QStyleOptionFrame::Flat) ? 0 : 2;
+ const int margY = (groupBox->features & QStyleOptionFrame::Flat) ? 0 : 2;
rect = groupBox->rect.adjusted(margX, margY, -margX, 0);
if (groupBox->text.size())
rect.setHeight(h);
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 14af5ede39..01b82424c8 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -1024,9 +1024,9 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
case PE_IndicatorProgressChunk:
{
bool vertical = false, inverted = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
- vertical = (pb2->orientation == Qt::Vertical);
- inverted = pb2->invertedAppearance;
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
+ vertical = pb->orientation == Qt::Vertical;
+ inverted = pb->invertedAppearance;
}
int space = 2;
@@ -1689,15 +1689,9 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
if (!rect.isValid())
return;
- bool vertical = false;
- bool inverted = false;
+ const bool vertical = pb->orientation == Qt::Vertical;
+ const bool inverted = pb->invertedAppearance;
- // Get extra style options if version 2
- const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt);
- if (pb2) {
- vertical = (pb2->orientation == Qt::Vertical);
- inverted = pb2->invertedAppearance;
- }
QMatrix m;
if (vertical) {
rect = QRect(rect.y(), rect.x(), rect.height(), rect.width()); // flip width and height
@@ -1716,7 +1710,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
Q_D(const QWindowsStyle);
if (pb->minimum == 0 && pb->maximum == 0) {
const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb, widget);
- QStyleOptionProgressBarV2 pbBits = *pb;
+ QStyleOptionProgressBar pbBits = *pb;
Q_ASSERT(unit_width >0);
pbBits.rect = rect;
@@ -1773,9 +1767,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
Q_D(const QWindowsStyle);
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
QRect rect = dwOpt->rect;
QRect r = rect;
@@ -1796,7 +1788,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
QColor left, right;
//Titlebar gradient
- if (widget && widget->isWindow()) {
+ if (opt->state & QStyle::State_Window) {
floating = true;
if (active) {
left = d->activeCaptionColor;
@@ -1874,9 +1866,9 @@ QRect QWindowsStyle::subElementRect(SubElement sr, const QStyleOption *opt, cons
break;
case SE_DockWidgetTitleBarText: {
r = QCommonStyle::subElementRect(sr, opt, w);
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+ const QStyleOptionDockWidget *dwOpt
+ = qstyleoption_cast<const QStyleOptionDockWidget*>(opt);
+ const bool verticalTitleBar = dwOpt && dwOpt->verticalTitleBar;
int m = proxy()->pixelMetric(PM_DockWidgetTitleMargin, opt, w);
if (verticalTitleBar) {
r.adjust(0, 0, 0, -m);
diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h
index f1a4a390e1..c8778cc914 100644
--- a/src/widgets/styles/qwindowsstyle_p_p.h
+++ b/src/widgets/styles/qwindowsstyle_p_p.h
@@ -50,7 +50,6 @@
#ifndef QT_NO_STYLE_WINDOWS
#include <qlist.h>
-#include <qhash.h>
QT_BEGIN_NAMESPACE
@@ -66,7 +65,7 @@ public:
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0);
static int fixedPixelMetric(QStyle::PixelMetric pm);
static int devicePixelRatio(const QWidget *widget = 0)
- { return widget ? widget->devicePixelRatio() : QWindowsStylePrivate::appDevicePixelRatio(); }
+ { return widget ? int(widget->devicePixelRatioF()) : QWindowsStylePrivate::appDevicePixelRatio(); }
bool hasSeenAlt(const QWidget *widget) const;
bool altDown() const { return alt_down; }
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 375ada6a64..083b1d1707 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -657,12 +657,12 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
newStyle = !qobject_cast<const QTableView*>(view);
selectionBehavior = view->selectionBehavior();
selectionMode = view->selectionMode();
- }
#ifndef QT_NO_ACCESSIBILITY
- else if (!widget) {
+ } else if (!widget) {
newStyle = !QStyleHelper::hasAncestor(option->styleObject, QAccessible::MenuItem) ;
- }
#endif
+ }
+
if (newStyle && (vopt = qstyleoption_cast<const QStyleOptionViewItem *>(option))) {
bool selected = vopt->state & QStyle::State_Selected;
const bool hover = selectionMode != QAbstractItemView::NoSelection && (vopt->state & QStyle::State_MouseOver);
@@ -1007,12 +1007,8 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (const QStyleOptionProgressBar *bar
= qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
bool isIndeterminate = (bar->minimum == 0 && bar->maximum == 0);
- bool vertical = false;
- bool inverted = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
- vertical = (pb2->orientation == Qt::Vertical);
- inverted = pb2->invertedAppearance;
- }
+ const bool vertical = bar->orientation == Qt::Vertical;
+ const bool inverted = bar->invertedAppearance;
if (isIndeterminate || (bar->progress > 0 && (bar->progress < bar->maximum) && d->transitionsEnabled())) {
if (!d->animation(styleObject(option)))
@@ -1378,9 +1374,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
break; //otherwise fall through
}
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(dwOpt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
if (verticalTitleBar) {
rect.setSize(rect.size().transposed());
@@ -2478,12 +2472,12 @@ bool QWindowsVistaStylePrivate::initTreeViewTheming()
m_treeViewHelper = createTreeViewHelperWindow();
if (!m_treeViewHelper) {
- qWarning("%s: Unable to create the treeview helper window.", Q_FUNC_INFO);
+ qWarning("Unable to create the treeview helper window.");
return false;
}
const HRESULT hr = QWindowsXPStylePrivate::pSetWindowTheme(m_treeViewHelper, L"explorer", NULL);
if (hr != S_OK) {
- qErrnoWarning("%s: SetWindowTheme() failed.", Q_FUNC_INFO);
+ qErrnoWarning("SetWindowTheme() failed.");
return false;
}
return QWindowsXPStylePrivate::createTheme(QWindowsXPStylePrivate::TreeViewTheme, m_treeViewHelper);
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 7776773b87..c350e82c69 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -338,15 +338,15 @@ void QWindowsXPStylePrivate::cleanupHandleMap()
HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd)
{
if (theme < 0 || theme >= NThemes || !hwnd) {
- qWarning("%s: Invalid parameters #%d, %p", Q_FUNC_INFO, theme, hwnd);
+ qWarning("Invalid parameters #%d, %p", theme, hwnd);
return 0;
}
if (!m_themes[theme]) {
const wchar_t *name = themeNames[theme];
m_themes[theme] = pOpenThemeData(hwnd, name);
if (!m_themes[theme])
- qErrnoWarning("%s: OpenThemeData() failed for theme %d (%s).",
- Q_FUNC_INFO, theme, qPrintable(themeName(theme)));
+ qErrnoWarning("OpenThemeData() failed for theme %d (%s).",
+ theme, qPrintable(themeName(theme)));
}
return m_themes[theme];
}
@@ -1690,7 +1690,7 @@ case PE_Frame:
// This should work, but currently there's an error in the ::drawBackgroundDirectly()
// code, when using the HDC directly..
if (useGradient) {
- QStyleOptionTabWidgetFrameV2 frameOpt = *tab;
+ QStyleOptionTabWidgetFrame frameOpt = *tab;
frameOpt.rect = widget->rect();
QRect contentsRect = subElementRect(SE_TabWidgetTabContents, &frameOpt, widget);
QRegion reg = option->rect;
@@ -1810,8 +1810,7 @@ case PE_Frame:
else
stateId = GBS_NORMAL;
if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(option);
- if (frame2->features & QStyleOptionFrameV2::Flat) {
+ if (frame->features & QStyleOptionFrame::Flat) {
// Windows XP does not have a theme part for a flat GroupBox, paint it with the windows style
QRect fr = frame->rect;
QPoint p1(fr.x(), fr.y() + 1);
@@ -1826,10 +1825,9 @@ case PE_Frame:
{
Qt::Orientation orient = Qt::Horizontal;
bool inverted = false;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option)) {
- orient = pb2->orientation;
- if (pb2->invertedAppearance)
- inverted = true;
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
+ orient = pb->orientation;
+ inverted = pb->invertedAppearance;
}
if (orient == Qt::Horizontal) {
partId = PP_CHUNK;
@@ -2207,8 +2205,8 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
case CE_ProgressBarGroove:
{
Qt::Orientation orient = Qt::Horizontal;
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option))
- orient = pb2->orientation;
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option))
+ orient = pb->orientation;
partId = (orient == Qt::Horizontal) ? PP_BAR : PP_BARVERT;
themeNumber = QWindowsXPStylePrivate::ProgressTheme;
stateId = 1;
@@ -2378,9 +2376,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
bool isFloating = widget && widget->isWindow();
bool isActive = dwOpt->state & State_Active;
- const QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(dwOpt);
- bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+ const bool verticalTitleBar = dwOpt->verticalTitleBar;
if (verticalTitleBar) {
rect.setSize(rect.size().transposed());
@@ -3316,8 +3312,8 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
static inline Qt::Orientation progressBarOrientation(const QStyleOption *option = 0)
{
- if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option))
- return pb2->orientation;
+ if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option))
+ return pb->orientation;
return Qt::Horizontal;
}
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index fedc928f61..4382abaf50 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -432,7 +432,7 @@ void QCompletionEngine::filter(const QStringList& parts)
QModelIndex parent;
for (int i = 0; i < curParts.count() - 1; i++) {
- QString part = curParts[i];
+ QString part = curParts.at(i);
int emi = filter(part, parent, -1).exactMatchIndex;
if (emi == -1)
return;
@@ -442,10 +442,10 @@ void QCompletionEngine::filter(const QStringList& parts)
// Note that we set the curParent to a valid parent, even if we have no matches
// When filtering is disabled, we show all the items under this parent
curParent = parent;
- if (curParts.last().isEmpty())
+ if (curParts.constLast().isEmpty())
curMatch = QMatchData(QIndexMapper(0, model->rowCount(curParent) - 1), -1, false);
else
- curMatch = filter(curParts.last(), curParent, 1); // build at least one
+ curMatch = filter(curParts.constLast(), curParent, 1); // build at least one
curRow = curMatch.isValid() ? 0 : -1;
}
@@ -1337,6 +1337,11 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
}
// default implementation for keys not handled by the widget when popup is open
+ if (ke->matches(QKeySequence::Cancel)) {
+ d->popup->hide();
+ return true;
+ }
+
switch (key) {
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
@@ -1357,7 +1362,6 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
break;
case Qt::Key_Backtab:
- case Qt::Key_Escape:
d->popup->hide();
break;
@@ -1816,26 +1820,23 @@ QStringList QCompleter::splitPath(const QString& path) const
return QStringList(completionPrefix());
QString pathCopy = QDir::toNativeSeparators(path);
- QString sep = QDir::separator();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\"))
return QStringList(pathCopy);
- QString doubleSlash(QLatin1String("\\\\"));
- if (pathCopy.startsWith(doubleSlash))
+ const bool startsWithDoubleSlash = pathCopy.startsWith(QLatin1String("\\\\"));
+ if (startsWithDoubleSlash)
pathCopy = pathCopy.mid(2);
- else
- doubleSlash.clear();
#endif
- QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']'));
- QStringList parts = pathCopy.split(re);
+ const QChar sep = QDir::separator();
+ QStringList parts = pathCopy.split(sep);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- if (!doubleSlash.isEmpty())
- parts[0].prepend(doubleSlash);
+ if (startsWithDoubleSlash)
+ parts[0].prepend(QLatin1String("\\\\"));
#else
- if (pathCopy[0] == sep[0]) // readd the "/" at the beginning as the split removed it
- parts[0] = QDir::fromNativeSeparators(QString(sep[0]));
+ if (pathCopy[0] == sep) // readd the "/" at the beginning as the split removed it
+ parts[0] = QLatin1Char('/');
#endif
return parts;
diff --git a/src/widgets/util/qcompleter.h b/src/widgets/util/qcompleter.h
index 22230fc39e..32ee6296ca 100644
--- a/src/widgets/util/qcompleter.h
+++ b/src/widgets/util/qcompleter.h
@@ -76,10 +76,10 @@ public:
CaseInsensitivelySortedModel
};
- QCompleter(QObject *parent = 0);
- QCompleter(QAbstractItemModel *model, QObject *parent = 0);
+ QCompleter(QObject *parent = Q_NULLPTR);
+ QCompleter(QAbstractItemModel *model, QObject *parent = Q_NULLPTR);
#ifndef QT_NO_STRINGLISTMODEL
- QCompleter(const QStringList& completions, QObject *parent = 0);
+ QCompleter(const QStringList& completions, QObject *parent = Q_NULLPTR);
#endif
~QCompleter();
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp
index 0e598717c8..c7e0861a0f 100644
--- a/src/widgets/util/qflickgesture.cpp
+++ b/src/widgets/util/qflickgesture.cpp
@@ -66,8 +66,8 @@ static QMouseEvent *copyMouseEvent(QEvent *e)
case QEvent::MouseButtonRelease:
case QEvent::MouseMove: {
QMouseEvent *me = static_cast<QMouseEvent *>(e);
- QMouseEvent *cme = new QMouseEvent(me->type(), QPoint(0, 0), me->windowPos(), me->screenPos(), me->button(), me->buttons(), me->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(cme, me->source());
+ QMouseEvent *cme = new QMouseEvent(me->type(), QPoint(0, 0), me->windowPos(), me->screenPos(),
+ me->button(), me->buttons(), me->modifiers(), me->source());
return cme;
}
#ifndef QT_NO_GRAPHICSVIEW
@@ -78,8 +78,8 @@ static QMouseEvent *copyMouseEvent(QEvent *e)
#if 1
QEvent::Type met = me->type() == QEvent::GraphicsSceneMousePress ? QEvent::MouseButtonPress :
(me->type() == QEvent::GraphicsSceneMouseRelease ? QEvent::MouseButtonRelease : QEvent::MouseMove);
- QMouseEvent *cme = new QMouseEvent(met, QPoint(0, 0), QPoint(0, 0), me->screenPos(), me->button(), me->buttons(), me->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(cme, me->source());
+ QMouseEvent *cme = new QMouseEvent(met, QPoint(0, 0), QPoint(0, 0), me->screenPos(),
+ me->button(), me->buttons(), me->modifiers(), me->source());
return cme;
#else
QGraphicsSceneMouseEvent *copy = new QGraphicsSceneMouseEvent(me->type());
@@ -155,9 +155,9 @@ public:
mouseTarget = QApplication::widgetAt(pressDelayEvent->globalPos());
mouseButton = pressDelayEvent->button();
mouseEventSource = pressDelayEvent->source();
- qFGDebug() << "QFG: consuming/delaying mouse press";
+ qFGDebug("QFG: consuming/delaying mouse press");
} else {
- qFGDebug() << "QFG: NOT consuming/delaying mouse press";
+ qFGDebug("QFG: NOT consuming/delaying mouse press");
}
e->setAccepted(true);
}
@@ -194,7 +194,7 @@ public:
void scrollerWasIntercepted()
{
- qFGDebug() << "QFG: deleting delayed mouse press, since scroller was only intercepted";
+ qFGDebug("QFG: deleting delayed mouse press, since scroller was only intercepted");
if (pressDelayEvent) {
// we still haven't even sent the press, so just throw it away now
if (pressDelayTimer) {
@@ -210,7 +210,7 @@ public:
{
if (pressDelayEvent) {
// we still haven't even sent the press, so just throw it away now
- qFGDebug() << "QFG: deleting delayed mouse press, since scroller is active now";
+ qFGDebug("QFG: deleting delayed mouse press, since scroller is active now");
if (pressDelayTimer) {
killTimer(pressDelayTimer);
pressDelayTimer = 0;
@@ -240,8 +240,7 @@ public:
qFGDebug() << "QFG: sending a fake mouse release at far-far-away to " << mouseTarget;
QMouseEvent re(QEvent::MouseButtonRelease, QPoint(), farFarAway, farFarAway,
mouseButton, QApplication::mouseButtons() & ~mouseButton,
- QApplication::keyboardModifiers());
- QGuiApplicationPrivate::setMouseEventSource(&re, mouseEventSource);
+ QApplication::keyboardModifiers(), mouseEventSource);
sendMouseEvent(&re, RegrabMouseAfterwards);
// don't clear the mouseTarget just yet, since we need to explicitly ungrab the mouse on release!
}
@@ -291,8 +290,7 @@ protected:
if (me) {
QMouseEvent copy(me->type(), mouseTarget->mapFromGlobal(me->globalPos()),
mouseTarget->topLevelWidget()->mapFromGlobal(me->globalPos()), me->screenPos(),
- me->button(), me->buttons(), me->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(&copy, me->source());
+ me->button(), me->buttons(), me->modifiers(), me->source());
qt_sendSpontaneousEvent(mouseTarget, &copy);
}
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index de12983f21..38b104f9e9 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -976,7 +976,7 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta
{
Q_D(QScroller);
- qScrollerDebug() << "QScroller::handleInput(" << input << ", " << d->stateName(d->state) << ", " << position << ", " << timestamp << ")";
+ qScrollerDebug() << "QScroller::handleInput(" << input << ", " << d->stateName(d->state) << ", " << position << ", " << timestamp << ')';
struct statechange {
State state;
Input input;
@@ -1296,7 +1296,7 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos,
qreal lowerSnapPos = nextSnapPos(startPos, -1, orientation);
qreal higherSnapPos = nextSnapPos(startPos, 1, orientation);
- qScrollerDebug() << " Real Delta:" << lowerSnapPos <<"-"<<nextSnap <<"-"<<higherSnapPos;
+ qScrollerDebug() << " Real Delta:" << lowerSnapPos << '-' << nextSnap << '-' <<higherSnapPos;
// - check if we can reach another snap point
if (nextSnap > higherSnapPos || qIsNaN(higherSnapPos))
@@ -1668,7 +1668,7 @@ bool QScrollerPrivate::releaseWhileDragging(const QPointF &position, qint64 time
void QScrollerPrivate::timerEventWhileScrolling()
{
- qScrollerDebug() << "QScroller::timerEventWhileScrolling()";
+ qScrollerDebug("QScroller::timerEventWhileScrolling()");
setContentPositionHelperScrolling();
if (xSegments.isEmpty() && ySegments.isEmpty())
@@ -1703,7 +1703,7 @@ void QScrollerPrivate::setState(QScroller::State newstate)
if (state == newstate)
return;
- qScrollerDebug() << q << "QScroller::setState(" << stateName(newstate) << ")";
+ qScrollerDebug() << q << "QScroller::setState(" << stateName(newstate) << ')';
switch (newstate) {
case QScroller::Inactive:
@@ -1870,8 +1870,8 @@ void QScrollerPrivate::setContentPositionHelperScrolling()
newPos.setY(nextSegmentPosition(ySegments, now, newPos.y()));
// -- set the position and handle overshoot
- qScrollerDebug() << "QScroller::setContentPositionHelperScrolling()";
- qScrollerDebug() << " --> overshoot:" << overshootPosition << "- new pos:" << newPos;
+ qScrollerDebug() << "QScroller::setContentPositionHelperScrolling()\n"
+ " --> overshoot:" << overshootPosition << "- new pos:" << newPos;
QPointF newClampedPos = clampToRect(newPos, contentPosRange);
diff --git a/src/widgets/util/qscroller_mac.mm b/src/widgets/util/qscroller_mac.mm
index 9120c43075..07de07de52 100644
--- a/src/widgets/util/qscroller_mac.mm
+++ b/src/widgets/util/qscroller_mac.mm
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
QPointF QScrollerPrivate::realDpi(int screen)
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
NSArray *nsscreens = [NSScreen screens];
if (screen < 0 || screen >= int([nsscreens count]))
@@ -59,7 +59,6 @@ QPointF QScrollerPrivate::realDpi(int screen)
} else {
return QPointF();
}
- [pool release];
}
QT_END_NAMESPACE
diff --git a/src/widgets/util/qscroller_p.h b/src/widgets/util/qscroller_p.h
index bb00c12905..d09f78d130 100644
--- a/src/widgets/util/qscroller_p.h
+++ b/src/widgets/util/qscroller_p.h
@@ -196,6 +196,9 @@ public:
QScroller *q_ptr;
};
+template <>
+class QTypeInfo<QScrollerPrivate::ScrollSegment>
+ : public QTypeInfoMerger<QScrollerPrivate::ScrollSegment, QEasingCurve> {};
QT_END_NAMESPACE
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index df3c291840..ebb29211a4 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
\l{http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html freedesktop.org}
XEmbed system tray specification.
\li All X11 desktop environments that implement the D-Bus
- \l{http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/ StatusNotifierItem}
+ \l{http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem}
specification, including recent versions of KDE and Unity.
\li All supported versions of OS X. Note that the Growl
notification system must be installed for
@@ -284,12 +284,6 @@ bool QSystemTrayIcon::isVisible() const
*/
bool QSystemTrayIcon::event(QEvent *e)
{
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
- if (e->type() == QEvent::ToolTip) {
- Q_D(QSystemTrayIcon);
- return d->sys->deliverToolTipEvent(e);
- }
-#endif
return QObject::event(e);
}
diff --git a/src/widgets/util/qsystemtrayicon.h b/src/widgets/util/qsystemtrayicon.h
index a4da0861e9..aba126b4fc 100644
--- a/src/widgets/util/qsystemtrayicon.h
+++ b/src/widgets/util/qsystemtrayicon.h
@@ -59,8 +59,8 @@ class Q_WIDGETS_EXPORT QSystemTrayIcon : public QObject
Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false)
public:
- QSystemTrayIcon(QObject *parent = 0);
- QSystemTrayIcon(const QIcon &icon, QObject *parent = 0);
+ QSystemTrayIcon(QObject *parent = Q_NULLPTR);
+ QSystemTrayIcon(const QIcon &icon, QObject *parent = Q_NULLPTR);
~QSystemTrayIcon();
enum ActivationReason {
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index 1809c36483..f1b86ba2df 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -395,7 +395,7 @@ void QSystemTrayIconPrivate::install_sys()
sys->createIcon();
sys->trayMessage(NIM_ADD);
} else {
- qWarning("%s: The platform plugin failed to create a message window.", Q_FUNC_INFO);
+ qWarning("The platform plugin failed to create a message window.");
}
}
}
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index 4060655d45..02bab236c8 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -52,6 +52,8 @@
#include <private/qguiapplication_p.h>
#include <qdebug.h>
+#include <QtPlatformHeaders/qxcbwindowfunctions.h>
+#include <QtPlatformHeaders/qxcbintegrationfunctions.h>
#ifndef QT_NO_SYSTEMTRAYICON
QT_BEGIN_NAMESPACE
@@ -112,17 +114,11 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn)
// window to ParentRelative (so that it inherits the background of its X11 parent window), call
// xcb_clear_region before painting (so that the inherited background is visible) and then grab
// the just-drawn background from the X11 server.
- bool hasAlphaChannel = false;
- QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "systrayVisualHasAlphaChannel", Qt::DirectConnection,
- Q_RETURN_ARG(bool, hasAlphaChannel));
+ bool hasAlphaChannel = QXcbIntegrationFunctions::xEmbedSystemTrayVisualHasAlphaChannel();
setAttribute(Qt::WA_TranslucentBackground, hasAlphaChannel);
if (!hasAlphaChannel) {
createWinId();
- QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "setParentRelativeBackPixmap", Qt::DirectConnection,
- Q_ARG(const QWindow *, windowHandle())
- );
+ QXcbWindowFunctions::setParentRelativeBackPixmap(windowHandle());
// XXX: This is actually required, but breaks things ("QWidget::paintEngine: Should no
// longer be called"). Why is this needed? When the widget is drawn, we use tricks to grab
@@ -143,15 +139,9 @@ bool QSystemTrayIconSys::addToTray()
createWinId();
setMouseTracking(true);
- bool requestResult = false;
- if (!QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "requestSystemTrayWindowDock", Qt::DirectConnection,
- Q_RETURN_ARG(bool, requestResult),
- Q_ARG(const QWindow *, windowHandle()))
- || !requestResult) {
- qWarning("requestSystemTrayWindowDock failed.");
+ if (!QXcbWindowFunctions::requestSystemTrayWindowDock(windowHandle()))
return false;
- }
+
if (!background.isNull())
background = QPixmap();
show();
@@ -171,15 +161,7 @@ void QSystemTrayIconSys::systemTrayWindowChanged(QScreen *)
QRect QSystemTrayIconSys::globalGeometry() const
{
- QRect result;
- if (!QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "systemTrayWindowGlobalGeometry", Qt::DirectConnection,
- Q_RETURN_ARG(QRect, result),
- Q_ARG(const QWindow *, windowHandle()))
- || !result.isValid()) {
- qWarning("systemTrayWindowGlobalGeometry failed.");
- }
- return result;
+ return QXcbWindowFunctions::systemTrayWindowGlobalGeometry(windowHandle());
}
void QSystemTrayIconSys::mousePressEvent(QMouseEvent *ev)
@@ -212,6 +194,9 @@ void QSystemTrayIconSys::mouseDoubleClickEvent(QMouseEvent *ev)
bool QSystemTrayIconSys::event(QEvent *e)
{
switch (e->type()) {
+ case QEvent::ToolTip:
+ QApplication::sendEvent(q, e);
+ break;
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
return QApplication::sendEvent(q, e);
diff --git a/src/widgets/util/qundogroup.h b/src/widgets/util/qundogroup.h
index ea4b226a18..ec6e67f4d3 100644
--- a/src/widgets/util/qundogroup.h
+++ b/src/widgets/util/qundogroup.h
@@ -52,7 +52,7 @@ class Q_WIDGETS_EXPORT QUndoGroup : public QObject
Q_DECLARE_PRIVATE(QUndoGroup)
public:
- explicit QUndoGroup(QObject *parent = 0);
+ explicit QUndoGroup(QObject *parent = Q_NULLPTR);
~QUndoGroup();
void addStack(QUndoStack *stack);
diff --git a/src/widgets/util/qundostack.h b/src/widgets/util/qundostack.h
index f6589da4ec..0b14a442c2 100644
--- a/src/widgets/util/qundostack.h
+++ b/src/widgets/util/qundostack.h
@@ -51,8 +51,8 @@ class Q_WIDGETS_EXPORT QUndoCommand
QUndoCommandPrivate *d;
public:
- explicit QUndoCommand(QUndoCommand *parent = 0);
- explicit QUndoCommand(const QString &text, QUndoCommand *parent = 0);
+ explicit QUndoCommand(QUndoCommand *parent = Q_NULLPTR);
+ explicit QUndoCommand(const QString &text, QUndoCommand *parent = Q_NULLPTR);
virtual ~QUndoCommand();
virtual void undo();
@@ -85,7 +85,7 @@ class Q_WIDGETS_EXPORT QUndoStack : public QObject
Q_PROPERTY(int undoLimit READ undoLimit WRITE setUndoLimit)
public:
- explicit QUndoStack(QObject *parent = 0);
+ explicit QUndoStack(QObject *parent = Q_NULLPTR);
~QUndoStack();
void clear();
diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h
index a239d9b38e..2a15207ca5 100644
--- a/src/widgets/util/qundoview.h
+++ b/src/widgets/util/qundoview.h
@@ -55,10 +55,10 @@ class Q_WIDGETS_EXPORT QUndoView : public QListView
Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
public:
- explicit QUndoView(QWidget *parent = 0);
- explicit QUndoView(QUndoStack *stack, QWidget *parent = 0);
+ explicit QUndoView(QWidget *parent = Q_NULLPTR);
+ explicit QUndoView(QUndoStack *stack, QWidget *parent = Q_NULLPTR);
#ifndef QT_NO_UNDOGROUP
- explicit QUndoView(QUndoGroup *group, QWidget *parent = 0);
+ explicit QUndoView(QUndoGroup *group, QWidget *parent = Q_NULLPTR);
#endif
~QUndoView();
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index e413b3b87a..a1707b9cab 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -221,13 +221,12 @@ void QButtonGroup::addButton(QAbstractButton *button, int id)
button->d_func()->group = this;
d->buttonList.append(button);
if (id == -1) {
- QList<int> ids = d->mapping.values();
- if (ids.isEmpty())
- d->mapping[button] = -2;
- else {
- std::sort(ids.begin(), ids.end());
- d->mapping[button] = ids.first()-1;
- }
+ const QHash<QAbstractButton*, int>::const_iterator it
+ = std::min_element(d->mapping.cbegin(), d->mapping.cend());
+ if (it == d->mapping.cend())
+ d->mapping[button] = -2;
+ else
+ d->mapping[button] = *it - 1;
} else {
d->mapping[button] = id;
}
@@ -1222,16 +1221,14 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
}
break;
}
- case Qt::Key_Escape:
- if (d->down) {
+ default:
+ if (e->matches(QKeySequence::Cancel) && d->down) {
setDown(false);
repaint(); //flush paint event before invoking potentially expensive operation
QApplication::flush();
d->emitReleased();
- break;
+ return;
}
- // fall through
- default:
e->ignore();
}
}
diff --git a/src/widgets/widgets/qabstractbutton.h b/src/widgets/widgets/qabstractbutton.h
index 4b397e2396..5f3e82a2e6 100644
--- a/src/widgets/widgets/qabstractbutton.h
+++ b/src/widgets/widgets/qabstractbutton.h
@@ -63,7 +63,7 @@ class Q_WIDGETS_EXPORT QAbstractButton : public QWidget
Q_PROPERTY(bool down READ isDown WRITE setDown DESIGNABLE false)
public:
- explicit QAbstractButton(QWidget* parent=0);
+ explicit QAbstractButton(QWidget *parent = Q_NULLPTR);
~QAbstractButton();
void setText(const QString &text);
@@ -135,7 +135,7 @@ protected:
protected:
- QAbstractButton(QAbstractButtonPrivate &dd, QWidget* parent = 0);
+ QAbstractButton(QAbstractButtonPrivate &dd, QWidget* parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QAbstractButton)
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index 2e1caedde7..65d06eafc5 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -168,6 +168,10 @@ QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate()
{
}
+QAbstractScrollAreaPrivate::~QAbstractScrollAreaPrivate()
+{
+}
+
QAbstractScrollAreaScrollBarContainer::QAbstractScrollAreaScrollBarContainer(Qt::Orientation orientation, QWidget *parent)
:QWidget(parent), scrollBar(new QScrollBar(orientation, this)),
layout(new QBoxLayout(orientation == Qt::Horizontal ? QBoxLayout::LeftToRight : QBoxLayout::TopToBottom)),
@@ -206,10 +210,12 @@ QWidgetList QAbstractScrollAreaScrollBarContainer::widgets(LogicalPosition posit
QWidgetList list;
const int scrollBarIndex = scrollBarLayoutIndex();
if (position == LogicalLeft) {
+ list.reserve(scrollBarIndex);
for (int i = 0; i < scrollBarIndex; ++i)
list.append(layout->itemAt(i)->widget());
} else if (position == LogicalRight) {
const int layoutItemCount = layout->count();
+ list.reserve(layoutItemCount - (scrollBarIndex + 1));
for (int i = scrollBarIndex + 1; i < layoutItemCount; ++i)
list.append(layout->itemAt(i)->widget());
}
diff --git a/src/widgets/widgets/qabstractscrollarea.h b/src/widgets/widgets/qabstractscrollarea.h
index 13dafd547b..8bc32b1c78 100644
--- a/src/widgets/widgets/qabstractscrollarea.h
+++ b/src/widgets/widgets/qabstractscrollarea.h
@@ -54,7 +54,7 @@ class Q_WIDGETS_EXPORT QAbstractScrollArea : public QFrame
Q_PROPERTY(SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy)
public:
- explicit QAbstractScrollArea(QWidget* parent=0);
+ explicit QAbstractScrollArea(QWidget *parent = Q_NULLPTR);
~QAbstractScrollArea();
enum SizeAdjustPolicy {
@@ -94,7 +94,7 @@ public:
void setSizeAdjustPolicy(SizeAdjustPolicy policy);
protected:
- QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget *parent = 0);
+ QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget *parent = Q_NULLPTR);
void setViewportMargins(int left, int top, int right, int bottom);
void setViewportMargins(const QMargins &margins);
QMargins viewportMargins() const;
diff --git a/src/widgets/widgets/qabstractscrollarea_p.h b/src/widgets/widgets/qabstractscrollarea_p.h
index f770bb69f8..33222573f4 100644
--- a/src/widgets/widgets/qabstractscrollarea_p.h
+++ b/src/widgets/widgets/qabstractscrollarea_p.h
@@ -54,12 +54,15 @@ QT_BEGIN_NAMESPACE
class QScrollBar;
class QAbstractScrollAreaScrollBarContainer;
+
+// ### Qt 6: is the export still needed? If not, unexport QFramePrivate, too.
class Q_WIDGETS_EXPORT QAbstractScrollAreaPrivate: public QFramePrivate
{
Q_DECLARE_PUBLIC(QAbstractScrollArea)
public:
QAbstractScrollAreaPrivate();
+ ~QAbstractScrollAreaPrivate();
void replaceScrollBar(QScrollBar *scrollBar, Qt::Orientation orientation);
diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h
index 2f649e3d3d..6faca5ea3c 100644
--- a/src/widgets/widgets/qabstractslider.h
+++ b/src/widgets/widgets/qabstractslider.h
@@ -58,7 +58,7 @@ class Q_WIDGETS_EXPORT QAbstractSlider : public QWidget
Q_PROPERTY(bool sliderDown READ isSliderDown WRITE setSliderDown DESIGNABLE false)
public:
- explicit QAbstractSlider(QWidget *parent=0);
+ explicit QAbstractSlider(QWidget *parent = Q_NULLPTR);
~QAbstractSlider();
Qt::Orientation orientation() const;
@@ -144,7 +144,7 @@ protected:
protected:
- QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent=0);
+ QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent = Q_NULLPTR);
private:
Q_DISABLE_COPY(QAbstractSlider)
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index c96c779d6a..ba4bbe40a8 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -720,7 +720,16 @@ void QAbstractSpinBox::interpretText()
QVariant QAbstractSpinBox::inputMethodQuery(Qt::InputMethodQuery query) const
{
Q_D(const QAbstractSpinBox);
- return d->edit->inputMethodQuery(query);
+ const QVariant lineEditValue = d->edit->inputMethodQuery(query);
+ switch (query) {
+ case Qt::ImHints:
+ if (const int hints = inputMethodHints())
+ return QVariant(hints | lineEditValue.toInt());
+ break;
+ default:
+ break;
+ }
+ return lineEditValue;
}
/*!
diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h
index a80a89c894..046036b9a8 100644
--- a/src/widgets/widgets/qabstractspinbox.h
+++ b/src/widgets/widgets/qabstractspinbox.h
@@ -64,7 +64,7 @@ class Q_WIDGETS_EXPORT QAbstractSpinBox : public QWidget
Q_PROPERTY(bool keyboardTracking READ keyboardTracking WRITE setKeyboardTracking)
Q_PROPERTY(bool showGroupSeparator READ isGroupSeparatorShown WRITE setGroupSeparatorShown)
public:
- explicit QAbstractSpinBox(QWidget *parent = 0);
+ explicit QAbstractSpinBox(QWidget *parent = Q_NULLPTR);
~QAbstractSpinBox();
enum StepEnabledFlag { StepNone = 0x00, StepUpEnabled = 0x01,
@@ -154,7 +154,7 @@ protected:
Q_SIGNALS:
void editingFinished();
protected:
- QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = 0);
+ QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = Q_NULLPTR);
private:
Q_PRIVATE_SLOT(d_func(), void _q_editorTextChanged(const QString &))
diff --git a/src/widgets/widgets/qbuttongroup.h b/src/widgets/widgets/qbuttongroup.h
index 01de03ac84..ba4f8e26c1 100644
--- a/src/widgets/widgets/qbuttongroup.h
+++ b/src/widgets/widgets/qbuttongroup.h
@@ -51,7 +51,7 @@ class Q_WIDGETS_EXPORT QButtonGroup : public QObject
Q_PROPERTY(bool exclusive READ exclusive WRITE setExclusive)
public:
- explicit QButtonGroup(QObject *parent = 0);
+ explicit QButtonGroup(QObject *parent = Q_NULLPTR);
~QButtonGroup();
void setExclusive(bool);
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 2150fc7a50..48b224fe13 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -776,7 +776,7 @@ bool QCalendarTextNavigator::eventFilter(QObject *o, QEvent *e)
applyDate();
emit editingFinished();
removeDateLabel();
- } else if (ke->key() == Qt::Key_Escape) {
+ } else if (ke->matches(QKeySequence::Cancel)) {
removeDateLabel();
} else if (e->type() == QEvent::KeyPress) {
createDateLabel();
@@ -3078,8 +3078,7 @@ void QCalendarWidget::resizeEvent(QResizeEvent * event)
void QCalendarWidget::keyPressEvent(QKeyEvent * event)
{
Q_D(QCalendarWidget);
- if(d->yearEdit->isVisible()&& event->key() == Qt::Key_Escape)
- {
+ if (d->yearEdit->isVisible()&& event->matches(QKeySequence::Cancel)) {
d->yearEdit->setValue(yearShown());
d->_q_yearEditingFinished();
return;
diff --git a/src/widgets/widgets/qcalendarwidget.h b/src/widgets/widgets/qcalendarwidget.h
index c456cc2161..df54985351 100644
--- a/src/widgets/widgets/qcalendarwidget.h
+++ b/src/widgets/widgets/qcalendarwidget.h
@@ -83,7 +83,7 @@ public:
};
Q_ENUM(SelectionMode)
- explicit QCalendarWidget(QWidget *parent = 0);
+ explicit QCalendarWidget(QWidget *parent = Q_NULLPTR);
~QCalendarWidget();
virtual QSize sizeHint() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qcheckbox.h b/src/widgets/widgets/qcheckbox.h
index b614659f02..61d03eb8e6 100644
--- a/src/widgets/widgets/qcheckbox.h
+++ b/src/widgets/widgets/qcheckbox.h
@@ -49,8 +49,8 @@ class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
Q_PROPERTY(bool tristate READ isTristate WRITE setTristate)
public:
- explicit QCheckBox(QWidget *parent=0);
- explicit QCheckBox(const QString &text, QWidget *parent=0);
+ explicit QCheckBox(QWidget *parent = Q_NULLPTR);
+ explicit QCheckBox(const QString &text, QWidget *parent = Q_NULLPTR);
~QCheckBox();
QSize sizeHint() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index b04aa7053a..35c54f102f 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -546,7 +546,8 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView)
disconnect(view, SIGNAL(destroyed()),
this, SLOT(viewDestroyed()));
- delete view;
+ if (isAncestorOf(view))
+ delete view;
view = 0;
}
@@ -653,8 +654,9 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e)
bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
{
switch (e->type()) {
- case QEvent::ShortcutOverride:
- switch (static_cast<QKeyEvent*>(e)->key()) {
+ case QEvent::ShortcutOverride: {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*>(e);
+ switch (keyEvent->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
#ifdef QT_KEYPAD_NAVIGATION
@@ -666,17 +668,21 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
}
return true;
case Qt::Key_Down:
- if (!(static_cast<QKeyEvent*>(e)->modifiers() & Qt::AltModifier))
+ if (!(keyEvent->modifiers() & Qt::AltModifier))
break;
// fall through
case Qt::Key_F4:
- case Qt::Key_Escape:
combo->hidePopup();
return true;
default:
+ if (keyEvent->matches(QKeySequence::Cancel)) {
+ combo->hidePopup();
+ return true;
+ }
break;
}
- break;
+ break;
+ }
case QEvent::MouseMove:
if (isVisible()) {
QMouseEvent *m = static_cast<QMouseEvent *>(e);
@@ -2268,6 +2274,7 @@ void QComboBox::insertItems(int index, const QStringList &list)
// construct a QStandardItem, reducing the number of expensive signals from the model
if (QStandardItemModel *m = qobject_cast<QStandardItemModel*>(d->model)) {
QList<QStandardItem *> items;
+ items.reserve(insertCount);
QStandardItem *hiddenRoot = m->invisibleRootItem();
for (int i = 0; i < insertCount; ++i)
items.append(new QStandardItem(list.at(i)));
@@ -3032,9 +3039,6 @@ void QComboBox::mousePressEvent(QMouseEvent *e)
d->showPopupFromMouseEvent(e);
}
-/*!
- \reimp
-*/
void QComboBoxPrivate::showPopupFromMouseEvent(QMouseEvent *e)
{
Q_Q(QComboBox);
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index ae35f7a89a..3182a0a3aa 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -74,7 +74,7 @@ class Q_WIDGETS_EXPORT QComboBox : public QWidget
Q_PROPERTY(int modelColumn READ modelColumn WRITE setModelColumn)
public:
- explicit QComboBox(QWidget *parent = 0);
+ explicit QComboBox(QWidget *parent = Q_NULLPTR);
~QComboBox();
int maxVisibleItems() const;
diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h
index 3fdfdcc22f..b69b94f3b9 100644
--- a/src/widgets/widgets/qcombobox_p.h
+++ b/src/widgets/widgets/qcombobox_p.h
@@ -57,7 +57,6 @@
#include "QtGui/qpainter.h"
#include "QtWidgets/qstyle.h"
#include "QtWidgets/qstyleoption.h"
-#include "QtCore/qhash.h"
#include "QtCore/qpair.h"
#include "QtCore/qtimer.h"
#include "private/qwidget_p.h"
diff --git a/src/widgets/widgets/qcommandlinkbutton.h b/src/widgets/widgets/qcommandlinkbutton.h
index 486c48af5d..9ddb14270d 100644
--- a/src/widgets/widgets/qcommandlinkbutton.h
+++ b/src/widgets/widgets/qcommandlinkbutton.h
@@ -49,9 +49,9 @@ class Q_WIDGETS_EXPORT QCommandLinkButton: public QPushButton
Q_PROPERTY(bool flat READ isFlat WRITE setFlat DESIGNABLE false)
public:
- explicit QCommandLinkButton(QWidget *parent=0);
- explicit QCommandLinkButton(const QString &text, QWidget *parent=0);
- explicit QCommandLinkButton(const QString &text, const QString &description, QWidget *parent=0);
+ explicit QCommandLinkButton(QWidget *parent = Q_NULLPTR);
+ explicit QCommandLinkButton(const QString &text, QWidget *parent = Q_NULLPTR);
+ explicit QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = Q_NULLPTR);
~QCommandLinkButton();
QString description() const;
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index a8da78a025..abee788a46 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -1687,6 +1687,10 @@ QDateTimeEditPrivate::QDateTimeEditPrivate()
#endif
}
+QDateTimeEditPrivate::~QDateTimeEditPrivate()
+{
+}
+
void QDateTimeEditPrivate::updateTimeSpec()
{
minimum = minimum.toDateTime().toTimeSpec(spec);
@@ -2655,7 +2659,7 @@ bool QCalendarPopup::event(QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
- if (keyEvent->key()== Qt::Key_Escape)
+ if (keyEvent->matches(QKeySequence::Cancel))
dateChanged = false;
}
return QWidget::event(event);
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index 4e77713fd0..829ce205be 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -86,10 +86,10 @@ public:
Q_DECLARE_FLAGS(Sections, Section)
- explicit QDateTimeEdit(QWidget *parent = 0);
- explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = 0);
- explicit QDateTimeEdit(const QDate &d, QWidget *parent = 0);
- explicit QDateTimeEdit(const QTime &t, QWidget *parent = 0);
+ explicit QDateTimeEdit(QWidget *parent = Q_NULLPTR);
+ explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = Q_NULLPTR);
+ explicit QDateTimeEdit(const QDate &d, QWidget *parent = Q_NULLPTR);
+ explicit QDateTimeEdit(const QTime &t, QWidget *parent = Q_NULLPTR);
~QDateTimeEdit();
QDateTime dateTime() const;
@@ -185,7 +185,7 @@ protected:
virtual void paintEvent(QPaintEvent *event);
void initStyleOption(QStyleOptionSpinBox *option) const;
- QDateTimeEdit(const QVariant &val, QVariant::Type parserType, QWidget *parent = 0);
+ QDateTimeEdit(const QVariant &val, QVariant::Type parserType, QWidget *parent = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QDateTimeEdit)
Q_DISABLE_COPY(QDateTimeEdit)
@@ -198,8 +198,8 @@ class Q_WIDGETS_EXPORT QTimeEdit : public QDateTimeEdit
Q_OBJECT
Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY userTimeChanged USER true)
public:
- explicit QTimeEdit(QWidget *parent = 0);
- explicit QTimeEdit(const QTime &time, QWidget *parent = 0);
+ explicit QTimeEdit(QWidget *parent = Q_NULLPTR);
+ explicit QTimeEdit(const QTime &time, QWidget *parent = Q_NULLPTR);
~QTimeEdit();
Q_SIGNALS:
@@ -211,8 +211,8 @@ class Q_WIDGETS_EXPORT QDateEdit : public QDateTimeEdit
Q_OBJECT
Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY userDateChanged USER true)
public:
- explicit QDateEdit(QWidget *parent = 0);
- explicit QDateEdit(const QDate &date, QWidget *parent = 0);
+ explicit QDateEdit(QWidget *parent = Q_NULLPTR);
+ explicit QDateEdit(const QDate &date, QWidget *parent = Q_NULLPTR);
~QDateEdit();
Q_SIGNALS:
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index 50e2cde8cc..4a6014000b 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -62,11 +62,12 @@
QT_BEGIN_NAMESPACE
class QCalendarPopup;
-class QDateTimeEditPrivate : public QAbstractSpinBoxPrivate, public QDateTimeParser
+class Q_AUTOTEST_EXPORT QDateTimeEditPrivate : public QAbstractSpinBoxPrivate, public QDateTimeParser
{
Q_DECLARE_PUBLIC(QDateTimeEdit)
public:
QDateTimeEditPrivate();
+ ~QDateTimeEditPrivate();
void init(const QVariant &var);
void readLocaleSettings();
diff --git a/src/widgets/widgets/qdial.h b/src/widgets/widgets/qdial.h
index 7e01aefce3..cb69e02301 100644
--- a/src/widgets/widgets/qdial.h
+++ b/src/widgets/widgets/qdial.h
@@ -54,7 +54,7 @@ class Q_WIDGETS_EXPORT QDial: public QAbstractSlider
Q_PROPERTY(qreal notchTarget READ notchTarget WRITE setNotchTarget)
Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible)
public:
- explicit QDial(QWidget *parent = 0);
+ explicit QDial(QWidget *parent = Q_NULLPTR);
~QDial();
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 5b6bfb3b3c..4d2c32d43e 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -261,7 +261,7 @@ void QDialogButtonBoxPrivate::layoutButtons()
if (center)
buttonLayout->addStretch();
- QList<QAbstractButton *> acceptRoleList = buttonLists[QPlatformDialogHelper::AcceptRole];
+ const QList<QAbstractButton *> &acceptRoleList = buttonLists[QPlatformDialogHelper::AcceptRole];
while (*currentLayout != QPlatformDialogHelper::EOL) {
int role = (*currentLayout & ~QPlatformDialogHelper::Reverse);
diff --git a/src/widgets/widgets/qdialogbuttonbox.h b/src/widgets/widgets/qdialogbuttonbox.h
index 02960b5b79..83c1fd66fd 100644
--- a/src/widgets/widgets/qdialogbuttonbox.h
+++ b/src/widgets/widgets/qdialogbuttonbox.h
@@ -106,11 +106,11 @@ public:
GnomeLayout
};
- QDialogButtonBox(QWidget *parent = 0);
- QDialogButtonBox(Qt::Orientation orientation, QWidget *parent = 0);
- explicit QDialogButtonBox(StandardButtons buttons, QWidget *parent = 0);
+ QDialogButtonBox(QWidget *parent = Q_NULLPTR);
+ QDialogButtonBox(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
+ explicit QDialogButtonBox(StandardButtons buttons, QWidget *parent = Q_NULLPTR);
QDialogButtonBox(StandardButtons buttons, Qt::Orientation orientation,
- QWidget *parent = 0);
+ QWidget *parent = Q_NULLPTR);
~QDialogButtonBox();
void setOrientation(Qt::Orientation orientation);
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index e71b9616fc..8c79425e44 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -1017,7 +1018,7 @@ QLayoutItem *QDockAreaLayoutInfo::plug(const QList<int> &path)
index = -index - 1;
if (path.count() > 1) {
- const QDockAreaLayoutItem &item = item_list.at(index);
+ QDockAreaLayoutItem &item = item_list[index];
Q_ASSERT(item.subinfo != 0);
return item.subinfo->plug(path.mid(1));
}
@@ -1063,7 +1064,7 @@ QLayoutItem *QDockAreaLayoutInfo::unplug(const QList<int> &path)
const int index = path.first();
if (path.count() > 1) {
- const QDockAreaLayoutItem &item = item_list.at(index);
+ QDockAreaLayoutItem &item = item_list[index];
Q_ASSERT(item.subinfo != 0);
return item.subinfo->unplug(path.mid(1));
}
@@ -1815,7 +1816,8 @@ void QDockAreaLayoutInfo::saveState(QDataStream &stream) const
stream << flags;
if (w->isWindow()) {
- stream << w->x() << w->y() << w->width() << w->height();
+ const QRect geometry = w->geometry();
+ stream << geometry.x() << geometry.y() << geometry.width() << geometry.height();
} else {
stream << item.pos << item.size << pick(o, item.minimumSize())
<< pick(o, item.maximumSize());
@@ -1854,20 +1856,6 @@ static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)
return Qt::NoDockWidgetArea;
}
-static QRect constrainedRect(QRect rect, const QRect &desktop)
-{
- if (desktop.isValid()) {
- rect.setWidth(qMin(rect.width(), desktop.width()));
- rect.setHeight(qMin(rect.height(), desktop.height()));
- rect.moveLeft(qMax(rect.left(), desktop.left()));
- rect.moveTop(qMax(rect.top(), desktop.top()));
- rect.moveRight(qMin(rect.right(), desktop.right()));
- rect.moveBottom(qMin(rect.bottom(), desktop.bottom()));
- }
-
- return rect;
-}
-
bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> &widgets, bool testing)
{
uchar marker;
@@ -1958,11 +1946,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
#endif
if (!testing) {
QRect r(x, y, w, h);
- QDesktopWidget *desktop = QApplication::desktop();
- if (desktop->isVirtualDesktop())
- r = constrainedRect(r, desktop->screenGeometry(desktop->screenNumber(r.topLeft())));
- else
- r = constrainedRect(r, desktop->screenGeometry(widget));
+ r = QDockAreaLayout::constrainedRect(r, widget);
widget->move(r.topLeft());
widget->resize(r.size());
}
@@ -2075,6 +2059,36 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const
#endif //QT_NO_TABBAR
#ifndef QT_NO_TABBAR
+/*! \internal
+ reparent all the widgets contained in this layout portion to the
+ specified parent. This is used to reparent dock widgets and tabbars
+ to the floating window or the main window
+ */
+void QDockAreaLayoutInfo::reparentWidgets(QWidget *parent)
+{
+ if (tabBar)
+ tabBar->setParent(parent);
+
+ for (int i = 0; i < item_list.count(); ++i) {
+ const QDockAreaLayoutItem &item = item_list.at(i);
+ if (item.flags & QDockAreaLayoutItem::GapItem)
+ continue;
+ if (item.skip())
+ continue;
+ if (item.subinfo)
+ item.subinfo->reparentWidgets(parent);
+ if (item.widgetItem) {
+ QWidget *w = item.widgetItem->widget();
+ if (w->parent() != parent) {
+ bool hidden = w->isHidden();
+ w->setParent(parent);
+ if (!hidden)
+ w->show();
+ }
+ }
+ }
+}
+
//returns whether the tabbar is visible or not
bool QDockAreaLayoutInfo::updateTabBar() const
{
@@ -2092,6 +2106,8 @@ bool QDockAreaLayoutInfo::updateTabBar() const
const QSignalBlocker blocker(tabBar);
bool gap = false;
+ const quintptr oldCurrentId = currentTabId();
+
int tab_idx = 0;
for (int i = 0; i < item_list.count(); ++i) {
const QDockAreaLayoutItem &item = item_list.at(i);
@@ -2140,6 +2156,9 @@ bool QDockAreaLayoutInfo::updateTabBar() const
tabBar->removeTab(tab_idx);
}
+ if (oldCurrentId > 0 && currentTabId() != oldCurrentId)
+ that->setCurrentTabId(oldCurrentId);
+
//returns if the tabbar is visible or not
return ( (gap ? 1 : 0) + tabBar->count()) > 1;
}
@@ -2198,8 +2217,10 @@ QSet<QTabBar*> QDockAreaLayoutInfo::usedTabBars() const
QSet<QWidget*> QDockAreaLayoutInfo::usedSeparatorWidgets() const
{
QSet<QWidget*> result;
+ const int numSeparatorWidgets = separatorWidgets.count();
+ result.reserve(numSeparatorWidgets);
- for (int i = 0; i < separatorWidgets.count(); ++i)
+ for (int i = 0; i < numSeparatorWidgets; ++i)
result << separatorWidgets.at(i);
for (int i = 0; i < item_list.count(); ++i) {
@@ -2244,6 +2265,22 @@ QRect QDockAreaLayoutInfo::tabContentRect() const
return result;
}
+
+int QDockAreaLayoutInfo::tabIndexToListIndex(int tabIndex) const
+{
+ Q_ASSERT(tabbed && tabBar);
+ quintptr data = qvariant_cast<quintptr>(tabBar->tabData(tabIndex));
+ for (int i = 0; i < item_list.count(); ++i) {
+ if (tabId(item_list.at(i)) == data)
+ return i;
+ }
+ return -1;
+}
+
+void QDockAreaLayoutInfo::moveTab(int from, int to)
+{
+ item_list.move(tabIndexToListIndex(from), tabIndexToListIndex(to));
+}
#endif // QT_NO_TABBAR
/******************************************************************************
@@ -2965,6 +3002,33 @@ QSize QDockAreaLayout::minimumSize() const
return QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
}
+/*! \internal
+ Try to fit the given rectangle \a rect on the screen which contains
+ the window \a widget.
+ Used to compute the geometry of a dragged a dock widget that should
+ be shown with \a rect, but needs to be visible on the screen
+ */
+QRect QDockAreaLayout::constrainedRect(QRect rect, QWidget* widget)
+{
+ QRect desktop;
+ QDesktopWidget *desktopW = QApplication::desktop();
+ if (desktopW->isVirtualDesktop())
+ desktop = desktopW->screenGeometry(rect.topLeft());
+ else
+ desktop = desktopW->screenGeometry(widget);
+
+ if (desktop.isValid()) {
+ rect.setWidth(qMin(rect.width(), desktop.width()));
+ rect.setHeight(qMin(rect.height(), desktop.height()));
+ rect.moveLeft(qMax(rect.left(), desktop.left()));
+ rect.moveTop(qMax(rect.top(), desktop.top()));
+ rect.moveRight(qMin(rect.right(), desktop.right()));
+ rect.moveBottom(qMin(rect.bottom(), desktop.bottom()));
+ }
+
+ return rect;
+}
+
bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget)
{
QList<int> index = indexOfPlaceHolder(dockWidget->objectName());
@@ -2978,9 +3042,7 @@ bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget)
item.widgetItem = new QDockWidgetItem(dockWidget);
if (placeHolder->window) {
- const QRect screenGeometry =
- QApplication::desktop()->screenGeometry(placeHolder->topLevelRect.center());
- const QRect r = constrainedRect(placeHolder->topLevelRect, screenGeometry);
+ const QRect r = constrainedRect(placeHolder->topLevelRect, dockWidget);
dockWidget->d_func()->setWindowState(true, true, r);
}
dockWidget->setVisible(!placeHolder->hidden);
@@ -3045,6 +3107,53 @@ void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
remove(index);
}
+void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
+ const QList<int> &sizes, Qt::Orientation o)
+{
+ if (docks.count() != sizes.count()) {
+ qWarning("QMainWidget::resizeDocks: size of the lists are not the same");
+ return;
+ }
+ int count = docks.count();
+ fallbackToSizeHints = false;
+ for (int i = 0; i < count; ++i) {
+ QList<int> path = indexOf(docks[i]);
+ if (path.isEmpty()) {
+ qWarning("QMainWidget::resizeDocks: one QDockWidget is not part of the layout");
+ continue;
+ }
+ int size = sizes[i];
+ if (size <= 0) {
+ qWarning("QMainWidget::resizeDocks: all sizes need to be larger than 0");
+ size = 1;
+ }
+
+ while (path.size() > 1) {
+ QDockAreaLayoutInfo *info = this->info(path);
+ if (!info->tabbed && info->o == o) {
+ info->item_list[path.last()].size = size;
+ int totalSize = 0;
+ foreach (const QDockAreaLayoutItem &item, info->item_list) {
+ if (!item.skip()) {
+ if (totalSize != 0)
+ totalSize += sep;
+ totalSize += item.size == -1 ? pick(o, item.sizeHint()) : item.size;
+ }
+ }
+ size = totalSize;
+ }
+ path.removeLast();
+ }
+
+ const int dockNum = path.first();
+ Q_ASSERT(dockNum < QInternal::DockCount);
+ QRect &r = this->docks[dockNum].rect;
+ QSize s = r.size();
+ rpick(o, s) = size;
+ r.setSize(s);
+ }
+}
+
void QDockAreaLayout::splitDockWidget(QDockWidget *after,
QDockWidget *dockWidget,
Qt::Orientation orientation)
diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h
index 7c67466c7b..5d352f0124 100644
--- a/src/widgets/widgets/qdockarealayout_p.h
+++ b/src/widgets/widgets/qdockarealayout_p.h
@@ -202,12 +202,16 @@ public:
QTabBar *tabBar;
int tabBarShape;
+ void reparentWidgets(QWidget *p);
bool updateTabBar() const;
void setTabBarShape(int shape);
QSize tabBarMinimumSize() const;
QSize tabBarSizeHint() const;
QSet<QTabBar*> usedTabBars() const;
+
+ int tabIndexToListIndex(int) const;
+ void moveTab(int from, int to);
#endif // QT_NO_TABBAR
};
@@ -229,7 +233,8 @@ public:
bool isValid() const;
- enum { DockWidgetStateMarker = 0xfd };
+ enum { DockWidgetStateMarker = 0xfd, FloatingDockWidgetTabMarker = 0xf9 };
+ static QRect constrainedRect(QRect rect, QWidget *widget);
void saveState(QDataStream &stream) const;
bool restoreState(QDataStream &stream, const QList<QDockWidget*> &widgets, bool testing = false);
@@ -263,6 +268,7 @@ public:
void splitDockWidget(QDockWidget *after, QDockWidget *dockWidget,
Qt::Orientation orientation);
void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
+ void resizeDocks(const QList<QDockWidget *> &docks, const QList<int> &sizes, Qt::Orientation o);
void apply(bool animate);
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 21b0904cc0..67eb466ba8 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -65,6 +65,18 @@ extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); /
// qmainwindow.cpp
extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
+static inline QMainWindowLayout *qt_mainwindow_layout_from_dock(const QDockWidget *dock)
+{
+ const QWidget *p = dock->parentWidget();
+ while (p) {
+ const QMainWindow *window = qobject_cast<const QMainWindow*>(p);
+ if (window)
+ return qt_mainwindow_layout(window);
+ p = p->parentWidget();
+ }
+ return Q_NULLPTR;
+}
+
static inline bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
{ return (priv->features & feature) == feature; }
@@ -194,31 +206,46 @@ QDockWidgetLayout::~QDockWidgetLayout()
qDeleteAll(item_list);
}
+/*! \internal
+ Returns true if the dock widget managed by this layout should have a native
+ window decoration or if Qt needs to draw it.
+ */
bool QDockWidgetLayout::nativeWindowDeco() const
{
- return nativeWindowDeco(parentWidget()->isWindow());
+ bool floating = parentWidget()->isWindow();
+ if (!floating && qobject_cast<QDockWidgetGroupWindow*>(parentWidget()->parentWidget()))
+ return wmSupportsNativeWindowDeco();
+ return nativeWindowDeco(floating);
}
-static bool isXcb()
+/*! \internal
+ Returns true if the window manager can draw natively the windows decoration
+ of a dock widget
+ */
+bool QDockWidgetLayout::wmSupportsNativeWindowDeco()
{
+#if defined(Q_OS_WINCE) || defined(Q_OS_ANDROID)
+ return false;
+#else
static const bool xcb = !QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive);
- return xcb;
+ return !xcb;
+#endif
}
+/*! \internal
+ Returns true if the dock widget managed by this layout should have a native
+ window decoration or if Qt needs to draw it. The \a floating parameter
+ overrides the floating current state of the dock widget.
+ */
bool QDockWidgetLayout::nativeWindowDeco(bool floating) const
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_ANDROID)
- Q_UNUSED(floating)
- return false;
-#else
- return !isXcb() && (floating && item_list[QDockWidgetLayout::TitleBar] == 0);
-#endif
+ return wmSupportsNativeWindowDeco() && floating && item_list.at(QDockWidgetLayout::TitleBar) == 0;
}
void QDockWidgetLayout::addItem(QLayoutItem*)
{
- qWarning() << "QDockWidgetLayout::addItem(): please use QDockWidgetLayout::setWidget()";
+ qWarning("QDockWidgetLayout::addItem(): please use QDockWidgetLayout::setWidget()");
return;
}
@@ -480,7 +507,7 @@ void QDockWidgetLayout::setGeometry(const QRect &geometry)
if (QLayoutItem *item = item_list[TitleBar]) {
item->setGeometry(_titleArea);
} else {
- QStyleOptionDockWidgetV2 opt;
+ QStyleOptionDockWidget opt;
q->initStyleOption(&opt);
if (QLayoutItem *item = item_list[CloseButton]) {
@@ -587,6 +614,7 @@ void QDockWidgetPrivate::init()
#ifndef QT_NO_ACTION
toggleViewAction = new QAction(q);
toggleViewAction->setCheckable(true);
+ toggleViewAction->setMenuRole(QAction::NoRole);
fixedWindowTitle = qt_setWindowTitle_helperHelper(q->windowTitle(), q);
toggleViewAction->setText(fixedWindowTitle);
QObject::connect(toggleViewAction, SIGNAL(triggered(bool)),
@@ -611,7 +639,10 @@ void QDockWidget::initStyleOption(QStyleOptionDockWidget *option) const
return;
QDockWidgetLayout *dwlayout = qobject_cast<QDockWidgetLayout*>(layout());
- option->initFrom(this);
+ QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent());
+ // If we are in a floating tab, init from the parent because the attributes and the geometry
+ // of the title bar should be taken from the floating window.
+ option->initFrom(floatingTab && !isFloating() ? parentWidget() : this);
option->rect = dwlayout->titleArea();
option->title = d->fixedWindowTitle;
option->closable = hasFeature(this, QDockWidget::DockWidgetClosable);
@@ -619,10 +650,7 @@ void QDockWidget::initStyleOption(QStyleOptionDockWidget *option) const
option->floatable = hasFeature(this, QDockWidget::DockWidgetFloatable);
QDockWidgetLayout *l = qobject_cast<QDockWidgetLayout*>(layout());
- QStyleOptionDockWidgetV2 *v2
- = qstyleoption_cast<QStyleOptionDockWidgetV2*>(option);
- if (v2 != 0)
- v2->verticalTitleBar = l->verticalTitleBar;
+ option->verticalTitleBar = l->verticalTitleBar;
}
void QDockWidgetPrivate::_q_toggleView(bool b)
@@ -681,14 +709,20 @@ void QDockWidgetPrivate::_q_toggleTopLevel()
q->setFloating(!q->isFloating());
}
+/*! \internal
+ Initialize the drag state structure and remember the position of the click.
+ This is called when the mouse is pressed, but the dock is not yet dragged out.
+
+ \a nca specify that the event comes from NonClientAreaMouseButtonPress
+ */
void QDockWidgetPrivate::initDrag(const QPoint &pos, bool nca)
{
+ Q_Q(QDockWidget);
+
if (state != 0)
return;
- QMainWindow *win = qobject_cast<QMainWindow*>(parent);
- Q_ASSERT(win != 0);
- QMainWindowLayout *layout = qt_mainwindow_layout(win);
+ QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);
Q_ASSERT(layout != 0);
if (layout->pluggingWidget != 0) // the main window is animating a docking operation
return;
@@ -702,23 +736,33 @@ void QDockWidgetPrivate::initDrag(const QPoint &pos, bool nca)
state->ctrlDrag = false;
}
-void QDockWidgetPrivate::startDrag()
+/*! \internal
+ Actually start the drag and detach the dockwidget.
+ The \a group parameter is true when we should potentially drag a group of
+ tabbed widgets, and false if the dock widget should always be dragged
+ alone.
+ */
+void QDockWidgetPrivate::startDrag(bool group)
{
Q_Q(QDockWidget);
if (state == 0 || state->dragging)
return;
- QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
+ QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);
Q_ASSERT(layout != 0);
- state->widgetItem = layout->unplug(q);
+ state->widgetItem = layout->unplug(q, group);
if (state->widgetItem == 0) {
/* I have a QMainWindow parent, but I was never inserted with
QMainWindow::addDockWidget, so the QMainWindowLayout has no
widget item for me. :( I have to create it myself, and then
delete it if I don't get dropped into a dock area. */
- state->widgetItem = new QDockWidgetItem(q);
+ QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);
+ if (floatingTab && !q->isFloating())
+ state->widgetItem = new QDockWidgetGroupWindowItem(floatingTab);
+ else
+ state->widgetItem = new QDockWidgetItem(q);
state->ownWidgetItem = true;
}
@@ -728,6 +772,11 @@ void QDockWidgetPrivate::startDrag()
state->dragging = true;
}
+/*! \internal
+ Ends the drag end drop operation of the QDockWidget.
+ The \a abort parameter specifies that it ends because of programmatic state
+ reset rather than mouse release event.
+ */
void QDockWidgetPrivate::endDrag(bool abort)
{
Q_Q(QDockWidget);
@@ -736,29 +785,31 @@ void QDockWidgetPrivate::endDrag(bool abort)
q->releaseMouse();
if (state->dragging) {
- QMainWindowLayout *mwLayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
+ QMainWindowLayout *mwLayout = qt_mainwindow_layout_from_dock(q);
Q_ASSERT(mwLayout != 0);
if (abort || !mwLayout->plug(state->widgetItem)) {
if (hasFeature(this, QDockWidget::DockWidgetFloatable)) {
+ // This QDockWidget will now stay in the floating state.
if (state->ownWidgetItem)
delete state->widgetItem;
mwLayout->restore();
- if (isXcb()) {
+ QDockWidgetLayout *dwLayout = qobject_cast<QDockWidgetLayout*>(layout);
+ if (!dwLayout->nativeWindowDeco()) {
// get rid of the X11BypassWindowManager window flag and activate the resizer
Qt::WindowFlags flags = q->windowFlags();
flags &= ~Qt::X11BypassWindowManagerHint;
q->setWindowFlags(flags);
- setResizerActive(true);
+ setResizerActive(q->isFloating());
q->show();
} else {
- QDockWidgetLayout *myLayout
- = qobject_cast<QDockWidgetLayout*>(layout);
- setResizerActive(myLayout->widgetForRole(QDockWidgetLayout::TitleBar) != 0);
+ setResizerActive(false);
}
undockedGeometry = q->geometry();
q->activateWindow();
} else {
+ // The tab was not plugged back in the QMainWindow but the QDockWidget cannot
+ // stay floating, revert to the previous state.
mwLayout->revert(state->widgetItem);
}
}
@@ -782,11 +833,7 @@ bool QDockWidgetPrivate::isAnimating() const
{
Q_Q(const QDockWidget);
- QMainWindow *mainWin = qobject_cast<QMainWindow*>(parent);
- if (mainWin == 0)
- return false;
-
- QMainWindowLayout *mainWinLayout = qt_mainwindow_layout(mainWin);
+ QMainWindowLayout *mainWinLayout = qt_mainwindow_layout_from_dock(q);
if (mainWinLayout == 0)
return false;
@@ -804,12 +851,14 @@ bool QDockWidgetPrivate::mousePressEvent(QMouseEvent *event)
if (!dwLayout->nativeWindowDeco()) {
QRect titleArea = dwLayout->titleArea();
+ QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);
+
if (event->button() != Qt::LeftButton ||
!titleArea.contains(event->pos()) ||
// check if the tool window is movable... do nothing if it
// is not (but allow moving if the window is floating)
(!hasFeature(this, QDockWidget::DockWidgetMovable) && !q->isFloating()) ||
- qobject_cast<QMainWindow*>(parent) == 0 ||
+ (qobject_cast<QMainWindow*>(parent) == 0 && !floatingTab) ||
isAnimating() || state != 0) {
return false;
}
@@ -853,7 +902,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
QDockWidgetLayout *dwlayout
= qobject_cast<QDockWidgetLayout *>(layout);
- QMainWindowLayout *mwlayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
+ QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);
if (!dwlayout->nativeWindowDeco()) {
if (!state->dragging
&& mwlayout->pluggingWidget == 0
@@ -871,7 +920,12 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
if (state->dragging && !state->nca) {
QPoint pos = event->globalPos() - state->pressPos;
- q->move(pos);
+
+ QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);
+ if (floatingTab && !q->isFloating())
+ floatingTab->move(pos);
+ else
+ q->move(pos);
if (state && !state->ctrlDrag)
mwlayout->hover(state->widgetItem, event->globalPos());
@@ -902,8 +956,9 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event)
int fw = q->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, q);
- QRect geo = q->geometry();
- QRect titleRect = q->frameGeometry();
+ QWidget *tl = q->topLevelWidget();
+ QRect geo = tl->geometry();
+ QRect titleRect = tl->frameGeometry();
#ifdef Q_DEAD_CODE_FROM_QT4_MAC
if ((features & QDockWidget::DockWidgetVerticalTitleBar)) {
titleRect.setTop(geo.top());
@@ -924,7 +979,7 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event)
break;
if (state != 0)
break;
- if (qobject_cast<QMainWindow*>(parent) == 0)
+ if (qobject_cast<QMainWindow*>(parent) == 0 && qobject_cast<QDockWidgetGroupWindow*>(parent) == 0)
break;
if (isAnimating())
break;
@@ -958,11 +1013,17 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event)
}
}
+/*! \internal
+ Called when the QDockWidget or the QDockWidgetGroupWindow is moved
+ */
void QDockWidgetPrivate::moveEvent(QMoveEvent *event)
{
Q_Q(QDockWidget);
- if (state == 0 || !state->dragging || !state->nca || !q->isWindow())
+ if (state == 0 || !state->dragging || !state->nca)
+ return;
+
+ if (!q->isWindow() && qobject_cast<QDockWidgetGroupWindow*>(parent) == 0)
return;
// When the native window frame is being dragged, all we get is these mouse
@@ -971,7 +1032,7 @@ void QDockWidgetPrivate::moveEvent(QMoveEvent *event)
if (state->ctrlDrag)
return;
- QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
+ QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(q);
Q_ASSERT(layout != 0);
QPoint globalMousePos = event->pos() + state->pressPos;
@@ -999,8 +1060,9 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
Q_Q(QDockWidget);
if (!floating && parent) {
- QMainWindowLayout *mwlayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
- if (mwlayout && mwlayout->dockWidgetArea(q) == Qt::NoDockWidgetArea)
+ QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);
+ if (mwlayout && mwlayout->dockWidgetArea(q) == Qt::NoDockWidgetArea
+ && !qobject_cast<QDockWidgetGroupWindow *>(parent))
return; // this dockwidget can't be redocked
}
@@ -1031,14 +1093,8 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
q->setWindowFlags(flags);
- if (!rect.isNull()) {
- if (floating) {
- q->resize(rect.size());
- q->move(rect.topLeft());
- } else {
+ if (!rect.isNull())
q->setGeometry(rect);
- }
- }
updateButtons();
@@ -1048,7 +1104,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
if (floating != wasFloating) {
emit q->topLevelChanged(floating);
if (!floating && parent) {
- QMainWindowLayout *mwlayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
+ QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);
if (mwlayout)
emit q->dockLocationChanged(mwlayout->dockWidgetArea(q));
}
@@ -1230,8 +1286,11 @@ void QDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features)
emit featuresChanged(d->features);
update();
if (closableChanged && layout->nativeWindowDeco()) {
- //this ensures the native decoration is drawn
- d->setWindowState(true /*floating*/, true /*unplug*/);
+ QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow *>(parent());
+ if (floatingTab && !isFloating())
+ floatingTab->adjustFlags();
+ else
+ d->setWindowState(true /*floating*/, true /*unplug*/); //this ensures the native decoration is drawn
}
}
@@ -1323,11 +1382,12 @@ void QDockWidget::changeEvent(QEvent *event)
#endif
#ifndef QT_NO_TABBAR
{
- QMainWindow *win = qobject_cast<QMainWindow*>(parentWidget());
- if (QMainWindowLayout *winLayout = qt_mainwindow_layout(win)) {
+ if (QMainWindowLayout *winLayout = qt_mainwindow_layout_from_dock(this)) {
if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this))
info->updateTabBar();
}
+ if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent()))
+ p->adjustFlags();
}
#endif // QT_NO_TABBAR
break;
@@ -1368,7 +1428,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)
- QStyleOptionDockWidgetV2 titleOpt;
+ QStyleOptionDockWidget titleOpt;
initStyleOption(&titleOpt);
p.drawControl(QStyle::CE_DockWidgetTitle, titleOpt);
}
@@ -1380,7 +1440,7 @@ bool QDockWidget::event(QEvent *event)
Q_D(QDockWidget);
QMainWindow *win = qobject_cast<QMainWindow*>(parentWidget());
- QMainWindowLayout *layout = qt_mainwindow_layout(win);
+ QMainWindowLayout *layout = qt_mainwindow_layout_from_dock(this);
switch (event->type()) {
#ifndef QT_NO_ACTION
@@ -1417,6 +1477,9 @@ bool QDockWidget::event(QEvent *event)
}
if (!isFloating() && layout != 0 && onTop)
layout->raise(this);
+ if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent()))
+ p->adjustFlags();
+
break;
}
case QEvent::WindowActivate:
diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h
index af4a5521bf..25e4d4d0a4 100644
--- a/src/widgets/widgets/qdockwidget.h
+++ b/src/widgets/widgets/qdockwidget.h
@@ -58,8 +58,9 @@ class Q_WIDGETS_EXPORT QDockWidget : public QWidget
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle DESIGNABLE true)
public:
- explicit QDockWidget(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0);
- explicit QDockWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QDockWidget(const QString &title, QWidget *parent = Q_NULLPTR,
+ Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QDockWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QDockWidget();
QWidget *widget() const;
diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h
index 752d6519e5..9c68bc5fb1 100644
--- a/src/widgets/widgets/qdockwidget_p.h
+++ b/src/widgets/widgets/qdockwidget_p.h
@@ -108,7 +108,7 @@ public:
void setWindowState(bool floating, bool unplug = false, const QRect &rect = QRect());
void nonClientAreaMouseEvent(QMouseEvent *event);
void initDrag(const QPoint &pos, bool nca);
- void startDrag();
+ void startDrag(bool group = true);
void endDrag(bool abort = false);
void moveEvent(QMoveEvent *event);
@@ -151,6 +151,7 @@ public:
int minimumTitleWidth() const;
int titleHeight() const;
void updateMaxSize();
+ static bool wmSupportsNativeWindowDeco();
bool nativeWindowDeco() const;
bool nativeWindowDeco(bool floating) const;
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index 708e90cc32..b256861d08 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -197,7 +197,7 @@ bool QAlphaWidget::eventFilter(QObject *o, QEvent *e)
break;
case QEvent::KeyPress: {
QKeyEvent *ke = (QKeyEvent*)e;
- if (ke->key() == Qt::Key_Escape) {
+ if (ke->matches(QKeySequence::Cancel)) {
showWidget = false;
} else {
duration = 0;
diff --git a/src/widgets/widgets/qfocusframe.cpp b/src/widgets/widgets/qfocusframe.cpp
index 5a403fa669..bf8cb30ef7 100644
--- a/src/widgets/widgets/qfocusframe.cpp
+++ b/src/widgets/widgets/qfocusframe.cpp
@@ -250,6 +250,10 @@ void
QFocusFrame::paintEvent(QPaintEvent *)
{
Q_D(QFocusFrame);
+
+ if (!d->widget)
+ return;
+
QStylePainter p(this);
QStyleOption option;
initStyleOption(&option);
diff --git a/src/widgets/widgets/qfocusframe.h b/src/widgets/widgets/qfocusframe.h
index f976ba9827..bbd639c2f9 100644
--- a/src/widgets/widgets/qfocusframe.h
+++ b/src/widgets/widgets/qfocusframe.h
@@ -46,7 +46,7 @@ class Q_WIDGETS_EXPORT QFocusFrame : public QWidget
{
Q_OBJECT
public:
- QFocusFrame(QWidget *parent=0);
+ QFocusFrame(QWidget *parent = Q_NULLPTR);
~QFocusFrame();
void setWidget(QWidget *widget);
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index faa2f41a51..957d148c74 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -401,14 +401,6 @@ void QFontComboBoxPrivate::_q_currentChanged(const QString &text)
*/
/*!
- \fn void QFontComboBox::setWritingSystem(QFontDatabase::WritingSystem script)
-*/
-
-/*!
- \fn void QFontComboBox::setCurrentFont(const QFont &font);
-*/
-
-/*!
Constructs a font combobox with the given \a parent.
*/
QFontComboBox::QFontComboBox(QWidget *parent)
diff --git a/src/widgets/widgets/qfontcombobox.h b/src/widgets/widgets/qfontcombobox.h
index 0c8cf5d58d..412acd041e 100644
--- a/src/widgets/widgets/qfontcombobox.h
+++ b/src/widgets/widgets/qfontcombobox.h
@@ -53,7 +53,7 @@ class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox
Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged)
public:
- explicit QFontComboBox(QWidget *parent = 0);
+ explicit QFontComboBox(QWidget *parent = Q_NULLPTR);
~QFontComboBox();
void setWritingSystem(QFontDatabase::WritingSystem);
diff --git a/src/widgets/widgets/qframe.cpp b/src/widgets/widgets/qframe.cpp
index 0861ea70b5..755b03a4ca 100644
--- a/src/widgets/widgets/qframe.cpp
+++ b/src/widgets/widgets/qframe.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
QFramePrivate::QFramePrivate()
- : frect(QRect(0, 0, 0, 0)),
+ : frect(0, 0, 0, 0),
frameStyle(QFrame::NoFrame | QFrame::Plain),
lineWidth(1),
midLineWidth(0),
@@ -55,6 +55,10 @@ QFramePrivate::QFramePrivate()
{
}
+QFramePrivate::~QFramePrivate()
+{
+}
+
inline void QFramePrivate::init()
{
setLayoutItemMargins(QStyle::SE_FrameLayoutItem);
diff --git a/src/widgets/widgets/qframe.h b/src/widgets/widgets/qframe.h
index c32e38f311..eb4d74c72a 100644
--- a/src/widgets/widgets/qframe.h
+++ b/src/widgets/widgets/qframe.h
@@ -54,7 +54,7 @@ class Q_WIDGETS_EXPORT QFrame : public QWidget
Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false)
public:
- explicit QFrame(QWidget* parent = 0, Qt::WindowFlags f = 0);
+ explicit QFrame(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~QFrame();
int frameStyle() const;
@@ -108,7 +108,7 @@ protected:
protected:
- QFrame(QFramePrivate &dd, QWidget* parent = 0, Qt::WindowFlags f = 0);
+ QFrame(QFramePrivate &dd, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
void initStyleOption(QStyleOptionFrame *option) const;
private:
diff --git a/src/widgets/widgets/qframe_p.h b/src/widgets/widgets/qframe_p.h
index 2b80e9abbe..eb04bbed4a 100644
--- a/src/widgets/widgets/qframe_p.h
+++ b/src/widgets/widgets/qframe_p.h
@@ -50,11 +50,13 @@
QT_BEGIN_NAMESPACE
-class QFramePrivate : public QWidgetPrivate
+// ### unexport this class when and if QAbstractScrollAreaPrivate is unexported
+class Q_WIDGETS_EXPORT QFramePrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QFrame)
public:
QFramePrivate();
+ ~QFramePrivate();
void updateFrameWidth();
void updateStyledFrameWidths();
diff --git a/src/widgets/widgets/qgroupbox.h b/src/widgets/widgets/qgroupbox.h
index 8100fadff4..57ebdce8dd 100644
--- a/src/widgets/widgets/qgroupbox.h
+++ b/src/widgets/widgets/qgroupbox.h
@@ -53,8 +53,8 @@ class Q_WIDGETS_EXPORT QGroupBox : public QWidget
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable)
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled USER true)
public:
- explicit QGroupBox(QWidget* parent=0);
- explicit QGroupBox(const QString &title, QWidget* parent=0);
+ explicit QGroupBox(QWidget *parent = Q_NULLPTR);
+ explicit QGroupBox(const QString &title, QWidget *parent = Q_NULLPTR);
~QGroupBox();
QString title() const;
diff --git a/src/widgets/widgets/qkeysequenceedit.h b/src/widgets/widgets/qkeysequenceedit.h
index 1887a40bfc..ad60bcc513 100644
--- a/src/widgets/widgets/qkeysequenceedit.h
+++ b/src/widgets/widgets/qkeysequenceedit.h
@@ -48,8 +48,8 @@ class Q_WIDGETS_EXPORT QKeySequenceEdit : public QWidget
Q_PROPERTY(QKeySequence keySequence READ keySequence WRITE setKeySequence NOTIFY keySequenceChanged USER true)
public:
- explicit QKeySequenceEdit(QWidget *parent = 0);
- explicit QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent = 0);
+ explicit QKeySequenceEdit(QWidget *parent = Q_NULLPTR);
+ explicit QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent = Q_NULLPTR);
~QKeySequenceEdit();
QKeySequence keySequence() const;
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 83e94c4128..55e277026c 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -53,6 +53,54 @@
QT_BEGIN_NAMESPACE
+QLabelPrivate::QLabelPrivate()
+ : QFramePrivate(),
+ sh(),
+ msh(),
+ text(),
+ pixmap(Q_NULLPTR),
+ scaledpixmap(Q_NULLPTR),
+ cachedimage(Q_NULLPTR),
+#ifndef QT_NO_PICTURE
+ picture(Q_NULLPTR),
+#endif
+#ifndef QT_NO_MOVIE
+ movie(),
+#endif
+ control(Q_NULLPTR),
+ shortcutCursor(),
+#ifndef QT_NO_CURSOR
+ cursor(),
+#endif
+#ifndef QT_NO_SHORTCUT
+ buddy(),
+ shortcutId(0),
+#endif
+ textformat(Qt::AutoText),
+ textInteractionFlags(Qt::LinksAccessibleByMouse),
+ sizePolicy(),
+ margin(0),
+ align(Qt::AlignLeft | Qt::AlignVCenter | Qt::TextExpandTabs),
+ indent(-1),
+ valid_hints(false),
+ scaledcontents(false),
+ textLayoutDirty(false),
+ textDirty(false),
+ isRichText(false),
+ isTextLabel(false),
+ hasShortcut(/*???*/),
+#ifndef QT_NO_CURSOR
+ validCursor(false),
+ onAnchor(false),
+#endif
+ openExternalLinks(false)
+{
+}
+
+QLabelPrivate::~QLabelPrivate()
+{
+}
+
/*!
\class QLabel
\brief The QLabel widget provides a text or image display.
@@ -202,41 +250,8 @@ void QLabelPrivate::init()
{
Q_Q(QLabel);
- valid_hints = false;
- margin = 0;
-#ifndef QT_NO_MOVIE
- movie = 0;
-#endif
-#ifndef QT_NO_SHORTCUT
- shortcutId = 0;
-#endif
- pixmap = 0;
- scaledpixmap = 0;
- cachedimage = 0;
-#ifndef QT_NO_PICTURE
- picture = 0;
-#endif
- align = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextExpandTabs;
- indent = -1;
- scaledcontents = false;
- textLayoutDirty = false;
- textDirty = false;
- textformat = Qt::AutoText;
- control = 0;
- textInteractionFlags = Qt::LinksAccessibleByMouse;
- isRichText = false;
- isTextLabel = false;
-
q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred,
QSizePolicy::Label));
-
-#ifndef QT_NO_CURSOR
- validCursor = false;
- onAnchor = false;
-#endif
-
- openExternalLinks = false;
-
setLayoutItemMargins(QStyle::SE_LabelLayoutItem);
}
@@ -1081,7 +1096,7 @@ void QLabel::paintEvent(QPaintEvent *)
d->cachedimage = new QImage(d->pixmap->toImage());
delete d->scaledpixmap;
QImage scaledImage =
- d->cachedimage->scaled(cr.size() * devicePixelRatio(),
+ d->cachedimage->scaled(cr.size() * devicePixelRatioF(),
Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
d->scaledpixmap = new QPixmap(QPixmap::fromImage(scaledImage));
}
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h
index 330626a9c5..1a3a68db60 100644
--- a/src/widgets/widgets/qlabel.h
+++ b/src/widgets/widgets/qlabel.h
@@ -58,8 +58,8 @@ class Q_WIDGETS_EXPORT QLabel : public QFrame
Q_PROPERTY(QString selectedText READ selectedText)
public:
- explicit QLabel(QWidget *parent=0, Qt::WindowFlags f=0);
- explicit QLabel(const QString &text, QWidget *parent=0, Qt::WindowFlags f=0);
+ explicit QLabel(QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QLabel(const QString &text, QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
~QLabel();
QString text() const;
diff --git a/src/widgets/widgets/qlabel_p.h b/src/widgets/widgets/qlabel_p.h
index 3778cb9d47..b4da56c290 100644
--- a/src/widgets/widgets/qlabel_p.h
+++ b/src/widgets/widgets/qlabel_p.h
@@ -60,54 +60,25 @@
QT_BEGIN_NAMESPACE
-class QLabelPrivate : public QFramePrivate
+class Q_AUTOTEST_EXPORT QLabelPrivate : public QFramePrivate
{
Q_DECLARE_PUBLIC(QLabel)
public:
- QLabelPrivate() {}
+ QLabelPrivate();
+ ~QLabelPrivate();
void init();
void clearContents();
void updateLabel();
QSize sizeForWidth(int w) const;
- mutable QSize sh;
- mutable QSize msh;
- mutable bool valid_hints;
- mutable QSizePolicy sizePolicy;
- int margin;
- QString text;
- QPixmap *pixmap;
- QPixmap *scaledpixmap;
- QImage *cachedimage;
-#ifndef QT_NO_PICTURE
- QPicture *picture;
-#endif
#ifndef QT_NO_MOVIE
- QPointer<QMovie> movie;
void _q_movieUpdated(const QRect&);
void _q_movieResized(const QSize&);
#endif
#ifndef QT_NO_SHORTCUT
void updateShortcut();
#endif
-#ifndef QT_NO_SHORTCUT
- QPointer<QWidget> buddy;
- int shortcutId;
-#endif
- ushort align;
- short indent;
- uint scaledcontents :1;
- mutable uint textLayoutDirty : 1;
- mutable uint textDirty : 1;
- mutable uint isRichText : 1;
- mutable uint isTextLabel : 1;
- mutable uint hasShortcut : 1;
- Qt::TextFormat textformat;
- mutable QWidgetTextControl *control;
- mutable QTextCursor shortcutCursor;
- Qt::TextInteractionFlags textInteractionFlags;
-
inline bool needTextControl() const {
return isTextLabel
&& (isRichText
@@ -129,13 +100,46 @@ public:
QMenu *createStandardContextMenu(const QPoint &pos);
#endif
- bool openExternalLinks;
-
+ mutable QSize sh;
+ mutable QSize msh;
+ QString text;
+ QPixmap *pixmap;
+ QPixmap *scaledpixmap;
+ QImage *cachedimage;
+#ifndef QT_NO_PICTURE
+ QPicture *picture;
+#endif
+#ifndef QT_NO_MOVIE
+ QPointer<QMovie> movie;
+#endif
+ mutable QWidgetTextControl *control;
+ mutable QTextCursor shortcutCursor;
+#ifndef QT_NO_CURSOR
+ QCursor cursor;
+#endif
+#ifndef QT_NO_SHORTCUT
+ QPointer<QWidget> buddy;
+ int shortcutId;
+#endif
+ Qt::TextFormat textformat;
+ Qt::TextInteractionFlags textInteractionFlags;
+ mutable QSizePolicy sizePolicy;
+ int margin;
+ ushort align;
+ short indent;
+ mutable uint valid_hints : 1;
+ uint scaledcontents : 1;
+ mutable uint textLayoutDirty : 1;
+ mutable uint textDirty : 1;
+ mutable uint isRichText : 1;
+ mutable uint isTextLabel : 1;
+ mutable uint hasShortcut : 1;
#ifndef QT_NO_CURSOR
uint validCursor : 1;
uint onAnchor : 1;
- QCursor cursor;
#endif
+ uint openExternalLinks : 1;
+ // <-- space for more bit field values here
friend class QMessageBoxPrivate;
};
diff --git a/src/widgets/widgets/qlcdnumber.h b/src/widgets/widgets/qlcdnumber.h
index d93edc75ca..9a7904a8bb 100644
--- a/src/widgets/widgets/qlcdnumber.h
+++ b/src/widgets/widgets/qlcdnumber.h
@@ -53,8 +53,8 @@ class Q_WIDGETS_EXPORT QLCDNumber : public QFrame // LCD number widget
Q_PROPERTY(int intValue READ intValue WRITE display)
public:
- explicit QLCDNumber(QWidget* parent = 0);
- explicit QLCDNumber(uint numDigits, QWidget* parent = 0);
+ explicit QLCDNumber(QWidget* parent = Q_NULLPTR);
+ explicit QLCDNumber(uint numDigits, QWidget* parent = Q_NULLPTR);
~QLCDNumber();
enum Mode {
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 0500907b3d..6b32665065 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -1488,7 +1488,7 @@ void QLineEdit::mousePressEvent(QMouseEvent* e)
int cursor = d->xToPos(e->pos().x());
#ifndef QT_NO_DRAGANDDROP
if (!mark && d->dragEnabled && d->control->echoMode() == Normal &&
- e->button() == Qt::LeftButton && d->control->inSelection(e->pos().x())) {
+ e->button() == Qt::LeftButton && d->inSelection(e->pos().x())) {
if (!d->dndTimer.isActive())
d->dndTimer.start(QApplication::startDragTime(), this);
} else
@@ -1897,18 +1897,14 @@ void QLineEdit::paintEvent(QPaintEvent *)
}
QRect lineRect(r.x() + d->horizontalMargin, d->vscroll, r.width() - 2*d->horizontalMargin, fm.height());
- int minLB = qMax(0, -fm.minLeftBearing());
- int minRB = qMax(0, -fm.minRightBearing());
-
if (d->shouldShowPlaceholderText()) {
if (!d->placeholderText.isEmpty()) {
QColor col = pal.text().color();
col.setAlpha(128);
QPen oldpen = p.pen();
p.setPen(col);
- QRect ph = lineRect.adjusted(minLB, 0, 0, 0);
- QString elidedText = fm.elidedText(d->placeholderText, Qt::ElideRight, ph.width());
- p.drawText(ph, va, elidedText);
+ QString elidedText = fm.elidedText(d->placeholderText, Qt::ElideRight, lineRect.width());
+ p.drawText(lineRect, va, elidedText);
p.setPen(oldpen);
}
}
@@ -1918,11 +1914,10 @@ void QLineEdit::paintEvent(QPaintEvent *)
// horizontal scrolling. d->hscroll is the left indent from the beginning
// of the text line to the left edge of lineRect. we update this value
// depending on the delta from the last paint event; in effect this means
- // the below code handles all scrolling based on the textline (widthUsed,
- // minLB, minRB), the line edit rect (lineRect) and the cursor position
- // (cix).
- int widthUsed = qRound(d->control->naturalTextWidth()) + 1 + minRB;
- if ((minLB + widthUsed) <= lineRect.width()) {
+ // the below code handles all scrolling based on the textline (widthUsed),
+ // the line edit rect (lineRect) and the cursor position (cix).
+ int widthUsed = qRound(d->control->naturalTextWidth()) + 1;
+ if (widthUsed <= lineRect.width()) {
// text fits in lineRect; use hscroll for alignment
switch (va & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
case Qt::AlignRight:
@@ -1936,7 +1931,6 @@ void QLineEdit::paintEvent(QPaintEvent *)
d->hscroll = 0;
break;
}
- d->hscroll -= minLB;
} else if (cix - d->hscroll >= lineRect.width()) {
// text doesn't fit, cursor is to the right of lineRect (scroll right)
d->hscroll = cix - lineRect.width() + 1;
diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h
index e006f1c0d8..ac192f0da8 100644
--- a/src/widgets/widgets/qlineedit.h
+++ b/src/widgets/widgets/qlineedit.h
@@ -84,8 +84,8 @@ public:
};
Q_ENUM(ActionPosition)
- explicit QLineEdit(QWidget* parent=0);
- explicit QLineEdit(const QString &, QWidget* parent=0);
+ explicit QLineEdit(QWidget *parent = Q_NULLPTR);
+ explicit QLineEdit(const QString &, QWidget *parent = Q_NULLPTR);
~QLineEdit();
QString text() const;
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index e24cc8a03a..599ebce0ab 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -70,6 +70,12 @@ int QLineEditPrivate::xToPos(int x, QTextLine::CursorPosition betweenOrOn) const
return control->xToPos(x, betweenOrOn);
}
+bool QLineEditPrivate::inSelection(int x) const
+{
+ x -= adjustedContentsRect().x() - hscroll + horizontalMargin;
+ return control->inSelection(x);
+}
+
QRect QLineEditPrivate::cursorRect() const
{
return adjustedControlRect(control->cursorRect());
@@ -364,7 +370,7 @@ void QLineEditIconButton::startOpacityAnimation(qreal endValue)
void QLineEditIconButton::updateCursor()
{
#ifndef QT_NO_CURSOR
- setCursor(qFuzzyCompare(m_opacity, 1.0) || !parentWidget() ? QCursor(Qt::ArrowCursor) : parentWidget()->cursor());
+ setCursor(qFuzzyCompare(m_opacity, qreal(1.0)) || !parentWidget() ? QCursor(Qt::ArrowCursor) : parentWidget()->cursor());
#endif
}
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 5a22285149..60372ab393 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -114,7 +114,7 @@ public:
QAction *action;
int flags;
};
- typedef QList<SideWidgetEntry> SideWidgetEntryList;
+ typedef QVector<SideWidgetEntry> SideWidgetEntryList;
QLineEditPrivate()
: control(0), frame(1), contextMenuEnabled(1), cursorVisible(0),
@@ -139,6 +139,7 @@ public:
QRect adjustedControlRect(const QRect &) const;
int xToPos(int x, QTextLine::CursorPosition = QTextLine::CursorBetweenCharacters) const;
+ bool inSelection(int x) const;
QRect cursorRect() const;
void setCursorVisible(bool visible);
@@ -228,6 +229,7 @@ private:
int lastTextSize;
mutable QSize m_iconSize;
};
+Q_DECLARE_TYPEINFO(QLineEditPrivate::SideWidgetEntry, Q_PRIMITIVE_TYPE);
static bool isSideWidgetVisible(const QLineEditPrivate::SideWidgetEntry &e)
{
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.h b/src/widgets/widgets/qmaccocoaviewcontainer_mac.h
index 5920c1f8bf..a27d8f8690 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.h
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.h
@@ -45,7 +45,7 @@ class Q_WIDGETS_EXPORT QMacCocoaViewContainer : public QWidget
{
Q_OBJECT
public:
- QMacCocoaViewContainer(NSView *cocoaViewToWrap, QWidget *parent = 0);
+ QMacCocoaViewContainer(NSView *cocoaViewToWrap, QWidget *parent = Q_NULLPTR);
virtual ~QMacCocoaViewContainer();
void setCocoaView(NSView *view);
diff --git a/src/widgets/widgets/qmacnativewidget_mac.h b/src/widgets/widgets/qmacnativewidget_mac.h
index 761e55656b..5e82872faa 100644
--- a/src/widgets/widgets/qmacnativewidget_mac.h
+++ b/src/widgets/widgets/qmacnativewidget_mac.h
@@ -45,7 +45,7 @@ class Q_WIDGETS_EXPORT QMacNativeWidget : public QWidget
{
Q_OBJECT
public:
- QMacNativeWidget(NSView *parentView = 0);
+ QMacNativeWidget(NSView *parentView = Q_NULLPTR);
~QMacNativeWidget();
QSize sizeHint() const;
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 4d5d3e5ec1..ff4bb3cc98 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -263,7 +263,14 @@ void QMainWindowPrivate::init()
An example of how to create menus follows:
- \snippet mainwindows/application/mainwindow.cpp 26
+ \code
+ void MainWindow::createMenus()
+ {
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(newAct);
+ fileMenu->addAction(openAct);
+ fileMenu->addAction(saveAct);
+ \endcode
The \c createPopupMenu() function creates popup menus when the
main window receives context menu events. The default
@@ -290,7 +297,12 @@ void QMainWindowPrivate::init()
An example of toolbar creation follows:
- \snippet mainwindows/application/mainwindow.cpp 29
+ \code
+ void MainWindow::createToolBars()
+ {
+ fileToolBar = addToolBar(tr("File"));
+ fileToolBar->addAction(newAct);
+ \endcode
\section2 Creating Dock Widgets
@@ -420,6 +432,13 @@ QMainWindow::~QMainWindow()
at the bottom. Implies AllowTabbedDocks. See also
\l setTabPosition().
+ \value GroupedDragging When dragging the titlebar of a dock, all the tabs
+ that are tabbed with it are going to be dragged.
+ Implies AllowTabbedDocks. Does not work well if
+ some QDockWidgets have restrictions in which area
+ they are allowed. (This enum value was added in Qt
+ 5.6.)
+
These options only control how dock widgets may be dropped in a QMainWindow.
They do not re-arrange the dock widgets to conform with the specified
options. For this reason they should be set before any dock widgets
@@ -1080,7 +1099,7 @@ void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget
addDockWidget(area, dockwidget, orientation);
#ifdef Q_DEAD_CODE_FROM_QT4_MAC //drawer support
- QMacCocoaAutoReleasePool pool;
+ 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
@@ -1218,6 +1237,35 @@ void QMainWindow::removeDockWidget(QDockWidget *dockwidget)
Qt::DockWidgetArea QMainWindow::dockWidgetArea(QDockWidget *dockwidget) const
{ return d_func()->layout->dockWidgetArea(dockwidget); }
+
+/*!
+ \since 5.6
+ Resizes the dock widgets in the list \a docks to the corresponding size in
+ pixels from the list \a sizes. If \a orientation is Qt::Horizontal, adjusts
+ the width, otherwise adjusts the height of the dock widgets.
+ The sizes will be adjusted such that the maximum and the minimum sizes are
+ respected and the QMainWindow itself will not be resized.
+ Any additional/missing space is distributed amongst the widgets according
+ to the relative weight of the sizes.
+
+ Example:
+ \code
+ resizeDocks({blueWidget, yellowWidget}, {20 , 40}, Qt::Horizontal);
+ \endcode
+ If the blue and the yellow widget are nested on the same level they will be
+ resized such that the yellowWidget is twice as big as the blueWidget
+
+ If some widgets are grouped in tabs, only one widget per group should be
+ specified. Widgets not in the list might be changed to repect the constraints.
+*/
+void QMainWindow::resizeDocks(const QList<QDockWidget *> &docks,
+ const QList<int> &sizes, Qt::Orientation orientation)
+{
+ d_func()->layout->layoutState.dockAreaLayout.resizeDocks(docks, sizes, orientation);
+ d_func()->layout->invalidate();
+}
+
+
#endif // QT_NO_DOCKWIDGET
/*!
diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h
index cbbea74b9b..70d78a7904 100644
--- a/src/widgets/widgets/qmainwindow.h
+++ b/src/widgets/widgets/qmainwindow.h
@@ -77,12 +77,13 @@ public:
AllowNestedDocks = 0x02,
AllowTabbedDocks = 0x04,
ForceTabbedDocks = 0x08, // implies AllowTabbedDocks, !AllowNestedDocks
- VerticalTabs = 0x10 // implies AllowTabbedDocks
+ VerticalTabs = 0x10, // implies AllowTabbedDocks
+ GroupedDragging = 0x20 // implies AllowTabbedDocks
};
Q_ENUM(DockOption)
Q_DECLARE_FLAGS(DockOptions, DockOption)
- explicit QMainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QMainWindow();
QSize iconSize() const;
@@ -164,6 +165,9 @@ public:
bool restoreDockWidget(QDockWidget *dockwidget);
Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const;
+
+ void resizeDocks(const QList<QDockWidget *> &docks,
+ const QList<int> &sizes, Qt::Orientation orientation);
#endif // QT_NO_DOCKWIDGET
QByteArray saveState(int version = 0) const;
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 046666f571..54e956c4cf 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -49,6 +50,7 @@
#include <qstatusbar.h>
#include <qstring.h>
#include <qstyle.h>
+#include <qstylepainter.h>
#include <qvarlengtharray.h>
#include <qstack.h>
#include <qmap.h>
@@ -61,6 +63,7 @@
#include <private/qapplication_p.h>
#include <private/qlayoutengine_p.h>
+#include <private/qwidgetresizehandler_p.h>
#ifdef Q_DEAD_CODE_FROM_QT4_MAC
# include <private/qcore_mac_p.h>
# include <private/qt_cocoa_helpers_mac_p.h>
@@ -68,9 +71,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_DOCKWIDGET
extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
-#endif
/******************************************************************************
** debug
@@ -165,6 +166,228 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout)
#endif // !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG)
/******************************************************************************
+ ** QDockWidgetGroupWindow
+ */
+// QDockWidgetGroupWindow is the floating window containing the tabbed dockwidgets in case several
+// dockwidgets are dragged together (QMainWindow::GroupedDragging feature).
+// QDockWidgetGroupLayout is the layout of that window and use a QDockAreaLayoutInfo to layout
+// the tabs inside it.
+#ifndef QT_NO_DOCKWIDGET
+class QDockWidgetGroupLayout : public QLayout {
+ QDockAreaLayoutInfo info;
+ QWidgetResizeHandler *resizer;
+public:
+ QDockWidgetGroupLayout(QWidget* parent) : QLayout(parent) {
+ setSizeConstraint(QLayout::SetMinAndMaxSize);
+ resizer = new QWidgetResizeHandler(parent);
+ resizer->setMovingEnabled(false);
+ }
+ ~QDockWidgetGroupLayout() {
+ info.deleteAllLayoutItems();
+ }
+
+ void addItem(QLayoutItem*) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
+ int count() const Q_DECL_OVERRIDE { return 0; }
+ QLayoutItem* itemAt(int index) const Q_DECL_OVERRIDE
+ {
+ int x = 0;
+ return info.itemAt(&x, index);
+ }
+ QLayoutItem* takeAt(int index) Q_DECL_OVERRIDE
+ {
+ int x = 0;
+ return info.takeAt(&x, index);
+ }
+ QSize sizeHint() const Q_DECL_OVERRIDE
+ {
+ int fw = frameWidth();
+ return info.sizeHint() + QSize(fw, fw);
+ }
+ QSize minimumSize() const Q_DECL_OVERRIDE
+ {
+ int fw = frameWidth();
+ return info.minimumSize() + QSize(fw, fw);
+ }
+ QSize maximumSize() const Q_DECL_OVERRIDE
+ {
+ int fw = frameWidth();
+ return info.maximumSize() + QSize(fw, fw);
+ }
+ void setGeometry(const QRect&r) Q_DECL_OVERRIDE
+ {
+ QDockAreaLayoutInfo *li = layoutInfo();
+ if (li->isEmpty()) {
+ static_cast<QDockWidgetGroupWindow *>(parent())->destroyIfEmpty();
+ return;
+ }
+ int fw = frameWidth();
+ li->reparentWidgets(parentWidget());
+ li->rect = r.adjusted(fw, fw, -fw, -fw);
+ li->fitItems();
+ li->apply(false);
+ resizer->setActive(QWidgetResizeHandler::Resize, !nativeWindowDeco());
+ }
+
+ QDockAreaLayoutInfo *layoutInfo() {
+ return &info;
+ }
+
+ bool nativeWindowDeco() const
+ {
+ return QDockWidgetLayout::wmSupportsNativeWindowDeco();
+ }
+
+ int frameWidth() const
+ {
+ return nativeWindowDeco() ? 0 :
+ parentWidget()->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, parentWidget());
+ }
+};
+
+bool QDockWidgetGroupWindow::event(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::Close:
+ // Forward the close to the QDockWidget just as if its close button was pressed
+ if (QDockWidget *dw = topDockWidget()) {
+ e->ignore();
+ dw->close();
+ adjustFlags();
+ }
+ return true;
+ case QEvent::Move:
+ // Let QDockWidgetPrivate::moseEvent handle the dragging
+ if (QDockWidget *dw = topDockWidget())
+ static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(dw))->moveEvent(static_cast<QMoveEvent*>(e));
+ return true;
+ case QEvent::NonClientAreaMouseMove:
+ case QEvent::NonClientAreaMouseButtonPress:
+ case QEvent::NonClientAreaMouseButtonRelease:
+ case QEvent::NonClientAreaMouseButtonDblClick:
+ // Let the QDockWidgetPrivate of the currently visible dock widget handle the drag and drop
+ if (QDockWidget *dw = topDockWidget())
+ static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(dw))->nonClientAreaMouseEvent(static_cast<QMouseEvent*>(e));
+ return true;
+ case QEvent::ChildAdded:
+ if (qobject_cast<QDockWidget *>(static_cast<QChildEvent*>(e)->child()))
+ adjustFlags();
+ break;
+ default:
+ break;
+ }
+ return QWidget::event(e);
+}
+
+void QDockWidgetGroupWindow::paintEvent(QPaintEvent *)
+{
+ QDockWidgetGroupLayout *lay = static_cast<QDockWidgetGroupLayout *>(layout());
+ bool nativeDeco = lay->nativeWindowDeco();
+
+ if (!nativeDeco) {
+ QStyleOptionFrame framOpt;
+ framOpt.init(this);
+ QStylePainter p(this);
+ p.drawPrimitive(QStyle::PE_FrameDockWidget, framOpt);
+ }
+}
+
+QDockAreaLayoutInfo *QDockWidgetGroupWindow::layoutInfo() const
+{
+ return static_cast<QDockWidgetGroupLayout*>(layout())->layoutInfo();
+}
+
+/*! \internal
+ Returns the currently active QDockWidget.
+ */
+QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
+{
+ QDockAreaLayoutInfo *info = layoutInfo();
+ QDockWidget *dw = 0;
+ if (info->tabBar && info->tabBar->currentIndex() >= 0) {
+ int i = info->tabIndexToListIndex(info->tabBar->currentIndex());
+ if (i >= 0) {
+ const QDockAreaLayoutItem &item = info->item_list.at(i);
+ if (item.widgetItem)
+ dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
+ }
+ }
+ if (!dw) {
+ for (int i = 0; !dw && i < info->item_list.count(); ++i) {
+ const QDockAreaLayoutItem &item = info->item_list.at(i);
+ if (item.skip())
+ continue;
+ if (!item.widgetItem)
+ continue;
+ dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
+ }
+ }
+ return dw;
+}
+
+/*! \internal
+ Destroy this window if there is no more QDockWidget in it.
+ */
+void QDockWidgetGroupWindow::destroyIfEmpty()
+{
+ if (layoutInfo()->isEmpty()) {
+ // Make sure to reparent the possibly floating or hidden QDockWidgets to the parent
+ foreach (QDockWidget *dw,
+ findChildren<QDockWidget *>(QString(), Qt::FindDirectChildrenOnly)) {
+ bool wasFloating = dw->isFloating();
+ bool wasHidden = dw->isHidden();
+ dw->setParent(parentWidget());
+ if (wasFloating) {
+ dw->setFloating(true);
+ } else {
+ // maybe it was hidden, we still have to put it back in the main layout.
+ QMainWindowLayout *ml = qt_mainwindow_layout(static_cast<QMainWindow*>(parentWidget()));
+ Qt::DockWidgetArea area = ml->dockWidgetArea(this);
+ if (area == Qt::NoDockWidgetArea)
+ area = Qt::LeftDockWidgetArea;
+ static_cast<QMainWindow*>(parentWidget())->addDockWidget(area, dw);
+ }
+ if (!wasHidden)
+ dw->show();
+ }
+ foreach (QTabBar *tb, findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly))
+ tb->setParent(parentWidget());
+ deleteLater();
+ }
+}
+
+/*! \internal
+ Sets the flags of this window in accordence 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) {
+ flags |= Qt::CustomizeWindowHint | Qt::WindowTitleHint;
+ if (top->features() & QDockWidget::DockWidgetClosable)
+ flags |= Qt::WindowCloseButtonHint;
+ else
+ flags &= ~Qt::WindowCloseButtonHint;
+ flags &= ~Qt::FramelessWindowHint;
+ } else {
+ flags |= Qt::FramelessWindowHint;
+ }
+ if (oldFlags != flags) {
+ setWindowFlags(flags);
+ show(); // setWindowFlags hides the window
+ }
+
+ setWindowTitle(top->windowTitle());
+ setWindowIcon(top->windowIcon());
+}
+#endif
+
+/******************************************************************************
** QMainWindowLayoutState
*/
@@ -335,8 +558,8 @@ QList<int> QMainWindowLayoutState::indexOf(QWidget *widget) const
#ifndef QT_NO_DOCKWIDGET
// is it a dock widget?
- if (QDockWidget *dockWidget = qobject_cast<QDockWidget *>(widget)) {
- result = dockAreaLayout.indexOf(dockWidget);
+ if (qobject_cast<QDockWidget *>(widget) || qobject_cast<QDockWidgetGroupWindow *>(widget)) {
+ result = dockAreaLayout.indexOf(widget);
if (!result.isEmpty())
result.prepend(1);
return result;
@@ -413,7 +636,8 @@ QList<int> QMainWindowLayoutState::gapIndex(QWidget *widget,
#ifndef QT_NO_DOCKWIDGET
// is it a dock widget?
- if (qobject_cast<QDockWidget *>(widget) != 0) {
+ if (qobject_cast<QDockWidget *>(widget) != 0
+ || qobject_cast<QDockWidgetGroupWindow *>(widget)) {
result = dockAreaLayout.gapIndex(pos);
if (!result.isEmpty())
result.prepend(1);
@@ -440,7 +664,7 @@ bool QMainWindowLayoutState::insertGap(const QList<int> &path, QLayoutItem *item
#ifndef QT_NO_DOCKWIDGET
if (i == 1) {
- Q_ASSERT(qobject_cast<QDockWidget*>(item->widget()) != 0);
+ Q_ASSERT(qobject_cast<QDockWidget*>(item->widget()) || qobject_cast<QDockWidgetGroupWindow*>(item->widget()));
return dockAreaLayout.insertGap(path.mid(1), item);
}
#endif //QT_NO_DOCKWIDGET
@@ -593,6 +817,17 @@ void QMainWindowLayoutState::saveState(QDataStream &stream) const
{
#ifndef QT_NO_DOCKWIDGET
dockAreaLayout.saveState(stream);
+#ifndef QT_NO_TABBAR
+ QList<QDockWidgetGroupWindow *> floatingTabs =
+ mainWindow->findChildren<QDockWidgetGroupWindow *>(QString(), Qt::FindDirectChildrenOnly);
+
+ foreach (QDockWidgetGroupWindow *floating, floatingTabs) {
+ if (floating->layoutInfo()->isEmpty())
+ continue;
+ stream << uchar(QDockAreaLayout::FloatingDockWidgetTabMarker) << floating->geometry();
+ floating->layoutInfo()->saveState(stream);
+ }
+#endif
#endif
#ifndef QT_NO_TOOLBAR
toolBarAreaLayout.saveState(stream);
@@ -638,12 +873,28 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream)
case QDockAreaLayout::DockWidgetStateMarker:
{
QList<QDockWidget *> dockWidgets = findChildrenHelper<QDockWidget*>(mainWindow);
+ foreach (QDockWidgetGroupWindow *floating, findChildrenHelper<QDockWidgetGroupWindow*>(mainWindow))
+ dockWidgets += findChildrenHelper<QDockWidget*>(floating);
if (!dockAreaLayout.restoreState(stream, dockWidgets, true /*testing*/)) {
return false;
}
}
break;
-#endif
+#ifndef QT_NO_TABBAR
+ case QDockAreaLayout::FloatingDockWidgetTabMarker:
+ {
+ QRect geom;
+ stream >> geom;
+ QDockAreaLayoutInfo info;
+ QList<QDockWidget *> dockWidgets = findChildrenHelper<QDockWidget*>(mainWindow);
+ foreach (QDockWidgetGroupWindow *floating, findChildrenHelper<QDockWidgetGroupWindow*>(mainWindow))
+ dockWidgets += findChildrenHelper<QDockWidget*>(floating);
+ if (!info.restoreState(stream, dockWidgets, true /* testing*/))
+ return false;
+ }
+ break;
+#endif // QT_NO_TABBAR
+#endif // QT_NO_DOCKWIDGET
default:
//there was an error during the parsing
return false;
@@ -682,6 +933,8 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream,
case QDockAreaLayout::DockWidgetStateMarker:
{
QList<QDockWidget *> dockWidgets = findChildrenHelper<QDockWidget*>(mainWindow);
+ foreach (QDockWidgetGroupWindow *floating, findChildrenHelper<QDockWidgetGroupWindow*>(mainWindow))
+ dockWidgets += findChildrenHelper<QDockWidget*>(floating);
if (!dockAreaLayout.restoreState(stream, dockWidgets))
return false;
@@ -702,6 +955,26 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream,
}
}
break;
+#ifndef QT_NO_TABBAR
+ case QDockAreaLayout::FloatingDockWidgetTabMarker:
+ {
+ QList<QDockWidget *> dockWidgets = findChildrenHelper<QDockWidget*>(mainWindow);
+ foreach (QDockWidgetGroupWindow *floating, findChildrenHelper<QDockWidgetGroupWindow*>(mainWindow))
+ dockWidgets += findChildrenHelper<QDockWidget*>(floating);
+ QDockWidgetGroupWindow* floatingTab = qt_mainwindow_layout(mainWindow)->createTabbedDockWindow();
+ *floatingTab->layoutInfo() = QDockAreaLayoutInfo(&dockAreaLayout.sep, QInternal::LeftDock,
+ Qt::Horizontal, QTabBar::RoundedSouth, mainWindow);
+ QRect geometry;
+ stream >> geometry;
+ if (!floatingTab->layoutInfo()->restoreState(stream, dockWidgets, false))
+ return false;
+ geometry = QDockAreaLayout::constrainedRect(geometry, floatingTab);
+ floatingTab->move(geometry.topLeft());
+ floatingTab->resize(geometry.size());
+ floatingTab->show();
+ }
+ break;
+#endif // QT_NO_TABBAR
#endif // QT_NO_DOCKWIDGET
#ifndef QT_NO_TOOLBAR
@@ -1223,7 +1496,7 @@ void QMainWindowLayout::splitDockWidget(QDockWidget *after,
invalidate();
}
-Qt::DockWidgetArea QMainWindowLayout::dockWidgetArea(QDockWidget *widget) const
+Qt::DockWidgetArea QMainWindowLayout::dockWidgetArea(QWidget *widget) const
{
QList<int> pathToWidget = layoutState.dockAreaLayout.indexOf(widget);
if (pathToWidget.isEmpty())
@@ -1238,20 +1511,88 @@ void QMainWindowLayout::keepSize(QDockWidget *w)
#ifndef QT_NO_TABBAR
+// Handle custom tooltip, and allow to drag tabs away.
class QMainWindowTabBar : public QTabBar
{
+ QMainWindow *mainWindow;
+ QDockWidget *draggingDock; // Currently dragging (detached) dock widget
public:
- QMainWindowTabBar(QWidget *parent);
+ QMainWindowTabBar(QMainWindow *parent);
protected:
bool event(QEvent *e) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE;
+
};
-QMainWindowTabBar::QMainWindowTabBar(QWidget *parent)
- : QTabBar(parent)
+QMainWindowTabBar::QMainWindowTabBar(QMainWindow *parent)
+ : QTabBar(parent), mainWindow(parent), draggingDock(0)
{
setExpanding(false);
}
+void QMainWindowTabBar::mouseMoveEvent(QMouseEvent *e)
+{
+ // The QTabBar handles the moving (reordering) of tabs.
+ // When QTabBarPrivate::dragInProgress is true, and that the mouse is outside of a region
+ // around the QTabBar, we will consider the user wants to drag that QDockWidget away from this
+ // tab area.
+
+ QTabBarPrivate *d = static_cast<QTabBarPrivate*>(d_ptr.data());
+ if (!draggingDock && (mainWindow->dockOptions() & QMainWindow::GroupedDragging)) {
+ int offset = QApplication::startDragDistance() + 1;
+ offset *= 3;
+ QRect r = rect().adjusted(-offset, -offset, offset, offset);
+ if (d->dragInProgress && !r.contains(e->pos()) && d->validIndex(d->pressedIndex)) {
+ QMainWindowLayout* mlayout = qt_mainwindow_layout(mainWindow);
+ QDockAreaLayoutInfo *info = mlayout->dockInfo(this);
+ Q_ASSERT(info);
+ int idx = info->tabIndexToListIndex(d->pressedIndex);
+ const QDockAreaLayoutItem &item = info->item_list.at(idx);
+ if (item.widgetItem
+ && (draggingDock = qobject_cast<QDockWidget *>(item.widgetItem->widget()))) {
+ // We should drag this QDockWidget away by unpluging it.
+ // First cancel the QTabBar's internal move
+ d->moveTabFinished(d->pressedIndex);
+ d->pressedIndex = -1;
+ if (d->movingTab)
+ d->movingTab->setVisible(false);
+ d->dragStartPosition = QPoint();
+
+ // Then starts the drag using QDockWidgetPrivate's API
+ QDockWidgetPrivate *dockPriv = static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(draggingDock));
+ QDockWidgetLayout *dwlayout = static_cast<QDockWidgetLayout *>(draggingDock->layout());
+ dockPriv->initDrag(dwlayout->titleArea().center(), true);
+ dockPriv->startDrag(false);
+ if (dockPriv->state)
+ dockPriv->state->ctrlDrag = e->modifiers() & Qt::ControlModifier;
+ }
+ }
+ }
+
+ if (draggingDock) {
+ QDockWidgetPrivate *dockPriv = static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(draggingDock));
+ if (dockPriv->state && dockPriv->state->dragging) {
+ QPoint pos = e->globalPos() - dockPriv->state->pressPos;
+ draggingDock->move(pos);
+ // move will call QMainWindowLayout::hover
+ }
+ }
+ QTabBar::mouseMoveEvent(e);
+}
+
+void QMainWindowTabBar::mouseReleaseEvent(QMouseEvent *e)
+{
+ if (draggingDock && e->button() == Qt::LeftButton) {
+ QDockWidgetPrivate *dockPriv = static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(draggingDock));
+ if (dockPriv->state && dockPriv->state->dragging) {
+ dockPriv->endDrag();
+ }
+ draggingDock = 0;
+ }
+ QTabBar::mouseReleaseEvent(e);
+}
+
bool QMainWindowTabBar::event(QEvent *e)
{
// show the tooltip if tab is too small to fit label
@@ -1276,11 +1617,13 @@ QTabBar *QMainWindowLayout::getTabBar()
if (!unusedTabBars.isEmpty()) {
result = unusedTabBars.takeLast();
} else {
- result = new QMainWindowTabBar(parentWidget());
+ result = new QMainWindowTabBar(static_cast<QMainWindow *>(parentWidget()));
result->setDrawBase(true);
result->setElideMode(Qt::ElideRight);
result->setDocumentMode(_documentMode);
+ result->setMovable(true);
connect(result, SIGNAL(currentChanged(int)), this, SLOT(tabChanged()));
+ connect(result, &QTabBar::tabMoved, this, &QMainWindowLayout::tabMoved);
}
usedTabBars.insert(result);
@@ -1303,12 +1646,30 @@ QWidget *QMainWindowLayout::getSeparatorWidget()
return result;
}
+/*! \internal
+ Returns a pointer QDockAreaLayoutInfo which contains this \a widget directly
+ (in its internal list)
+ */
+QDockAreaLayoutInfo *QMainWindowLayout::dockInfo(QWidget *widget)
+{
+ QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(widget);
+ if (info)
+ return info;
+ foreach (QDockWidgetGroupWindow *dwgw,
+ parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
+ info = dwgw->layoutInfo()->info(widget);
+ if (info)
+ return info;
+ }
+ return 0;
+}
+
void QMainWindowLayout::tabChanged()
{
QTabBar *tb = qobject_cast<QTabBar*>(sender());
if (tb == 0)
return;
- QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(tb);
+ QDockAreaLayoutInfo *info = dockInfo(tb);
if (info == 0)
return;
info->apply(false);
@@ -1316,6 +1677,16 @@ void QMainWindowLayout::tabChanged()
if (QWidget *w = centralWidget())
w->raise();
}
+
+void QMainWindowLayout::tabMoved(int from, int to)
+{
+ QTabBar *tb = qobject_cast<QTabBar*>(sender());
+ Q_ASSERT(tb);
+ QDockAreaLayoutInfo *info = dockInfo(tb);
+ Q_ASSERT(info);
+
+ info->moveTab(from, to);
+}
#endif // QT_NO_TABBAR
bool QMainWindowLayout::startSeparatorMove(const QPoint &pos)
@@ -1353,7 +1724,7 @@ bool QMainWindowLayout::endSeparatorMove(const QPoint&)
void QMainWindowLayout::raise(QDockWidget *widget)
{
- QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(widget);
+ QDockAreaLayoutInfo *info = dockInfo(widget);
if (info == 0)
return;
#ifndef QT_NO_TABBAR
@@ -1537,6 +1908,8 @@ void QMainWindowLayout::revert(QLayoutItem *widgetItem)
QWidget *widget = widgetItem->widget();
layoutState = savedState;
currentGapPos = layoutState.indexOf(widget);
+ if (currentGapPos.isEmpty())
+ return;
fixToolBarOrientation(widgetItem, currentGapPos.at(1));
layoutState.unplug(currentGapPos);
layoutState.fitLayout();
@@ -1547,6 +1920,54 @@ void QMainWindowLayout::revert(QLayoutItem *widgetItem)
bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
{
+#ifndef QT_NO_DOCKWIDGET
+ if (currentHoveredFloat) {
+ QWidget *widget = widgetItem->widget();
+ QList<int> previousPath = layoutState.indexOf(widget);
+ if (!previousPath.isEmpty())
+ layoutState.remove(previousPath);
+ // Let's remove the widget from any possible group window
+ foreach (QDockWidgetGroupWindow *dwgw,
+ parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
+ QList<int> path = dwgw->layoutInfo()->indexOf(widget);
+ if (!path.isEmpty())
+ dwgw->layoutInfo()->remove(path);
+ }
+ currentGapRect = QRect();
+
+ 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(parentLayout->takeAt(parentLayout->indexOf(currentHoveredFloat)));
+
+ dropTo->setParent(floatingTabs);
+ dropTo->show();
+ dropTo->d_func()->plug(QRect());
+ currentHoveredFloat = floatingTabs;
+ }
+
+ 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);
+ if (!previousPath.isEmpty())
+ dwgw->layoutInfo()->remove(previousPath);
+ dwgw->layoutInfo()->tab(0, widgetItem);
+ QRect globalRect = dwgw->layoutInfo()->tabContentRect();
+ globalRect.moveTopLeft(dwgw->mapToGlobal(globalRect.topLeft()));
+ pluggingWidget = widget;
+ widgetAnimator.animate(widget, globalRect, dockOptions & QMainWindow::AnimatedDocks);
+ return true;
+ }
+#endif
+
if (!parentWidget()->isVisible() || parentWidget()->isMinimized() || currentGapPos.isEmpty())
return false;
@@ -1554,6 +1975,16 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
QWidget *widget = widgetItem->widget();
+#ifndef QT_NO_DOCKWIDGET
+ // Let's remove the widget from any possible group window
+ foreach (QDockWidgetGroupWindow *dwgw,
+ parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
+ QList<int> path = dwgw->layoutInfo()->indexOf(widget);
+ if (!path.isEmpty())
+ dwgw->layoutInfo()->remove(path);
+ }
+#endif
+
QList<int> previousPath = layoutState.indexOf(widget);
const QLayoutItem *it = layoutState.plug(currentGapPos);
@@ -1601,8 +2032,59 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
if (widget == pluggingWidget) {
#ifndef QT_NO_DOCKWIDGET
- if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget))
+ 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();
+ Q_ASSERT(parentInfo->tabbed);
+ path = parentInfo->indexOf(widget);
+ Q_ASSERT(path.size() == 1);
+ } else {
+ path = layoutState.dockAreaLayout.indexOf(widget);
+ Q_ASSERT(path.size() >= 2);
+ parentInfo = layoutState.dockAreaLayout.info(path);
+ Q_ASSERT(parentInfo);
+ }
+
+ if (parentInfo->tabbed) {
+ // merge the two tab widgets
+ int idx = path.last();
+ 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 {
+ QDockAreaLayoutItem &item = layoutState.dockAreaLayout.item(path);
+ Q_ASSERT(item.widgetItem->widget() == dwgw);
+ delete item.widgetItem;
+ item.widgetItem = 0;
+ item.subinfo = new QDockAreaLayoutInfo(qMove(*info));
+ *info = QDockAreaLayoutInfo();
+ item.subinfo->reparentWidgets(parentWidget());
+ item.subinfo->setTabBarShape(parentInfo->tabBarShape);
+ }
+ dwgw->destroyIfEmpty();
+ }
+
+ if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
+ if (currentHoveredFloat) {
+ dw->setParent(currentHoveredFloat);
+ dw->show();
+ }
dw->d_func()->plug(currentGapRect);
+ }
#endif
#ifndef QT_NO_TOOLBAR
if (QToolBar *tb = qobject_cast<QToolBar*>(widget))
@@ -1612,6 +2094,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
savedState.clear();
currentGapPos.clear();
pluggingWidget = 0;
+ currentHoveredFloat = Q_NULLPTR;
//applying the state will make sure that the currentGap is updated correctly
//and all the geometries (especially the one from the central widget) is correct
layoutState.apply(false);
@@ -1621,7 +2104,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
if (qobject_cast<QDockWidget*>(widget) != 0) {
// info() might return null if the widget is destroyed while
// animating but before the animationFinished signal is received.
- if (QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(widget))
+ if (QDockAreaLayoutInfo *info = dockInfo(widget))
info->setCurrentTab(widget);
}
#endif
@@ -1673,9 +2156,6 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
#endif // QT_NO_DOCKWIDGET
, widgetAnimator(this)
, pluggingWidget(0)
-#ifndef QT_NO_RUBBERBAND
- , gapIndicator(new QRubberBand(QRubberBand::Rectangle, mainwindow))
-#endif //QT_NO_RUBBERBAND
#ifdef Q_DEAD_CODE_FROM_QT4_MAC
, blockVisiblityCheck(false)
#endif
@@ -1693,12 +2173,6 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
tabPositions[i] = QTabWidget::South;
#endif
#endif // QT_NO_DOCKWIDGET
-
-#ifndef QT_NO_RUBBERBAND
- // For accessibility to identify this special widget.
- gapIndicator->setObjectName(QLatin1String("qt_rubberband"));
- gapIndicator->hide();
-#endif
pluggingWidget = 0;
setObjectName(mainwindow->objectName() + QLatin1String("_layout"));
@@ -1765,8 +2239,33 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget)
invalidate();
}
-QLayoutItem *QMainWindowLayout::unplug(QWidget *widget)
-{
+/*! \internal
+ Unplug \a widget (QDockWidget or QToolBar) from it's parent container.
+
+ If \a group is true we might actually unplug the group of tabs this
+ widget is part if QMainWindow::GroupedDragging is set. When \a group
+ is false, the widget itself is always unplugged alone
+
+ Returns the QLayoutItem of the dragged element.
+ The layout item is kept in the layout but set as a gap item.
+ */
+QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
+{
+#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR)
+ QDockWidgetGroupWindow *floatingParent = qobject_cast<QDockWidgetGroupWindow *>(widget->parentWidget());
+ if (group && floatingParent && !widget->isWindow()) {
+ // 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);
+ } else if (floatingParent) {
+ // We are unplugging a dock widget from a floating window.
+ if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
+ dw->d_func()->unplug(widget->geometry());
+ return 0;
+ }
+ }
+#endif
QList<int> path = layoutState.indexOf(widget);
if (path.isEmpty())
return 0;
@@ -1780,9 +2279,35 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget)
#ifndef QT_NO_DOCKWIDGET
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
- dw->d_func()->unplug(r);
+ Q_ASSERT(path.first() == 1);
+ bool actualGroup = false;
+#ifndef QT_NO_TABBAR
+ 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;
+ }
+ }
+#endif // QT_NO_TABBAR
+ if (!actualGroup) {
+ dw->d_func()->unplug(r);
+ }
}
-#endif
+#endif // QT_NO_DOCKWIDGET
#ifndef QT_NO_TOOLBAR
if (QToolBar *tb = qobject_cast<QToolBar*>(widget)) {
tb->d_func()->unplug(r);
@@ -1804,18 +2329,75 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget)
void QMainWindowLayout::updateGapIndicator()
{
#ifndef QT_NO_RUBBERBAND
- gapIndicator->setVisible(!widgetAnimator.animating() && !currentGapPos.isEmpty());
- gapIndicator->setGeometry(currentGapRect);
-#endif
+ if ((!widgetAnimator.animating() && !currentGapPos.isEmpty()) || currentHoveredFloat) {
+ QWidget *expectedParent = currentHoveredFloat ? currentHoveredFloat.data() : parentWidget();
+ if (!gapIndicator) {
+ gapIndicator = new QRubberBand(QRubberBand::Rectangle, expectedParent);
+ // For accessibility to identify this special widget.
+ gapIndicator->setObjectName(QLatin1String("qt_rubberband"));
+ } else if (gapIndicator->parent() != expectedParent) {
+ gapIndicator->setParent(expectedParent);
+ }
+ gapIndicator->setGeometry(currentHoveredFloat ? currentHoveredFloat->rect() : currentGapRect);
+ gapIndicator->show();
+ gapIndicator->raise();
+ } else if (gapIndicator) {
+ gapIndicator->hide();
+ }
+#endif //QT_NO_RUBBERBAND
}
-QList<int> QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
+void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
{
if (!parentWidget()->isVisible() || parentWidget()->isMinimized()
|| pluggingWidget != 0 || widgetItem == 0)
- return QList<int>();
+ return;
QWidget *widget = widgetItem->widget();
+
+#ifndef QT_NO_DOCKWIDGET
+ if ((dockOptions & QMainWindow::GroupedDragging) && (qobject_cast<QDockWidget*>(widget)
+ || qobject_cast<QDockWidgetGroupWindow *>(widget))) {
+
+ // Check if we are over another floating dock widget
+ QVarLengthArray<QWidget *, 10> candidates;
+ foreach (QObject *c, parentWidget()->children()) {
+ QWidget *w = qobject_cast<QWidget*>(c);
+ if (!w)
+ continue;
+ if (w == widget)
+ continue;
+ if (!w->isTopLevel() || !w->isVisible() || w->isMinimized())
+ continue;
+ if (!qobject_cast<QDockWidget*>(w) && !qobject_cast<QDockWidgetGroupWindow *>(w))
+ continue;
+ candidates << w;
+ if (QDockWidgetGroupWindow *group = qobject_cast<QDockWidgetGroupWindow *>(w)) {
+ // Sometimes, there are floating QDockWidget that have a QDockWidgetGroupWindow as a parent.
+ foreach (QObject *c, group->children()) {
+ if (QDockWidget *dw = qobject_cast<QDockWidget*>(c)) {
+ if (dw != widget && dw->isFloating() && dw->isVisible() && !dw->isMinimized())
+ candidates << dw;
+ }
+ }
+ }
+ }
+ foreach (QWidget *w, candidates) {
+ QWindow *handle1 = widget->windowHandle();
+ QWindow *handle2 = w->windowHandle();
+ if (handle1 && handle2 && handle1->screen() != handle2->screen())
+ continue;
+ if (!w->geometry().contains(mousePos))
+ continue;
+
+ currentHoveredFloat = w;
+ restore(true);
+ return;
+ }
+ }
+ currentHoveredFloat = Q_NULLPTR;
+#endif //QT_NO_DOCKWIDGET
+
QPoint pos = parentWidget()->mapFromGlobal(mousePos);
if (!savedState.isValid())
@@ -1829,6 +2411,9 @@ QList<int> QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mouse
#ifndef QT_NO_DOCKWIDGET
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget))
allowed = dw->isAreaAllowed(toDockWidgetArea(path.at(1)));
+
+ if (qobject_cast<QDockWidgetGroupWindow *>(widget))
+ allowed = true;
#endif
#ifndef QT_NO_TOOLBAR
if (QToolBar *tb = qobject_cast<QToolBar*>(widget))
@@ -1840,13 +2425,13 @@ QList<int> QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mouse
}
if (path == currentGapPos)
- return currentGapPos; // the gap is already there
+ return; // the gap is already there
currentGapPos = path;
if (path.isEmpty()) {
fixToolBarOrientation(widgetItem, 2); // 2 = top dock, ie. horizontal
restore(true);
- return QList<int>();
+ return;
}
fixToolBarOrientation(widgetItem, currentGapPos.at(1));
@@ -1855,7 +2440,7 @@ QList<int> QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mouse
if (!newState.insertGap(path, widgetItem)) {
restore(true); // not enough space
- return QList<int>();
+ return;
}
QSize min = newState.minimumSize();
@@ -1863,7 +2448,7 @@ QList<int> QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mouse
if (min.width() > size.width() || min.height() > size.height()) {
restore(true);
- return QList<int>();
+ return;
}
newState.fitLayout();
@@ -1877,8 +2462,13 @@ QList<int> QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mouse
applyState(layoutState);
updateGapIndicator();
+}
- return path;
+QDockWidgetGroupWindow *QMainWindowLayout::createTabbedDockWindow()
+{
+ QDockWidgetGroupWindow* f = new QDockWidgetGroupWindow(parentWidget(), Qt::Tool);
+ new QDockWidgetGroupLayout(f);
+ return f;
}
void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animate)
@@ -1886,6 +2476,11 @@ void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animat
#ifndef QT_NO_DOCKWIDGET
#ifndef QT_NO_TABBAR
QSet<QTabBar*> used = newState.dockAreaLayout.usedTabBars();
+ foreach (QDockWidgetGroupWindow *dwgw,
+ parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
+ used += dwgw->layoutInfo()->usedTabBars();
+ }
+
QSet<QTabBar*> retired = usedTabBars - used;
usedTabBars = used;
foreach (QTabBar *tab_bar, retired) {
@@ -1904,6 +2499,8 @@ void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animat
}
}
+ for (int i = 0; i < QInternal::DockCount; ++i)
+ newState.dockAreaLayout.docks[i].reparentWidgets(parentWidget());
#endif // QT_NO_TABBAR
#endif // QT_NO_DOCKWIDGET
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index 9f84ee95db..9a13e5f5ce 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -77,6 +77,37 @@ QT_BEGIN_NAMESPACE
class QToolBar;
class QRubberBand;
+#ifndef QT_NO_DOCKWIDGET
+class QDockWidgetGroupWindow : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit QDockWidgetGroupWindow(QWidget* parent = 0, Qt::WindowFlags f = 0)
+ : QWidget(parent, f) {}
+ QDockAreaLayoutInfo *layoutInfo() const;
+ QDockWidget *topDockWidget() const;
+ void destroyIfEmpty();
+ void adjustFlags();
+protected:
+ bool event(QEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
+};
+
+// This item will be used in the layout for the gap item. We cannot use QWidgetItem directly
+// because QWidgetItem functions return an empty size for widgets that are are floating.
+class QDockWidgetGroupWindowItem : public QWidgetItem
+{
+public:
+ explicit QDockWidgetGroupWindowItem(QDockWidgetGroupWindow *parent) : QWidgetItem(parent) {}
+ QSize minimumSize() const Q_DECL_OVERRIDE { return lay()->minimumSize(); }
+ QSize maximumSize() const Q_DECL_OVERRIDE { return lay()->maximumSize(); }
+ QSize sizeHint() const Q_DECL_OVERRIDE { return lay()->sizeHint(); }
+
+private:
+ QLayout *lay() const { return const_cast<QDockWidgetGroupWindowItem *>(this)->widget()->layout(); }
+};
+#endif
+
/* This data structure represents the state of all the tool-bars and dock-widgets. It's value based
so it can be easilly copied into a temporary variable. All operations are performed without moving
any widgets. Only when we are sure we have the desired state, we call apply(), which moves the
@@ -196,10 +227,11 @@ public:
QDockWidget *dockwidget,
Qt::Orientation orientation);
void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
- Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const;
+ Qt::DockWidgetArea dockWidgetArea(QWidget* widget) const;
void raise(QDockWidget *widget);
void setVerticalTabsEnabled(bool enabled);
bool restoreDockWidget(QDockWidget *dockwidget);
+ QDockAreaLayoutInfo *dockInfo(QWidget *w);
#ifndef QT_NO_TABBAR
bool _documentMode;
@@ -224,6 +256,8 @@ public:
void setTabShape(QTabWidget::TabShape tabShape);
QTabWidget::TabPosition tabPosition(Qt::DockWidgetArea area) const;
void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition);
+
+ QDockWidgetGroupWindow *createTabbedDockWindow();
#endif // QT_NO_TABWIDGET
#endif // QT_NO_TABBAR
@@ -268,12 +302,15 @@ public:
QRect currentGapRect;
QWidget *pluggingWidget;
#ifndef QT_NO_RUBBERBAND
- QRubberBand *gapIndicator;
+ QPointer<QRubberBand> gapIndicator;
+#endif
+#ifndef QT_NO_DOCKWIDGET
+ QPointer<QWidget> currentHoveredFloat; // set when dragging over a floating dock widget
#endif
- QList<int> hover(QLayoutItem *widgetItem, const QPoint &mousePos);
+ void hover(QLayoutItem *widgetItem, const QPoint &mousePos);
bool plug(QLayoutItem *widgetItem);
- QLayoutItem *unplug(QWidget *widget);
+ QLayoutItem *unplug(QWidget *widget, bool group = false);
void revert(QLayoutItem *widgetItem);
void updateGapIndicator();
void paintDropIndicator(QPainter *p, QWidget *widget, const QRegion &clip);
@@ -286,6 +323,7 @@ private Q_SLOTS:
#ifndef QT_NO_DOCKWIDGET
#ifndef QT_NO_TABBAR
void tabChanged();
+ void tabMoved(int from, int to);
#endif
#endif
private:
diff --git a/src/widgets/widgets/qmdiarea.h b/src/widgets/widgets/qmdiarea.h
index 461282f8a8..e05535b2af 100644
--- a/src/widgets/widgets/qmdiarea.h
+++ b/src/widgets/widgets/qmdiarea.h
@@ -79,7 +79,7 @@ public:
};
Q_ENUM(ViewMode)
- QMdiArea(QWidget *parent = 0);
+ QMdiArea(QWidget *parent = Q_NULLPTR);
~QMdiArea();
QSize sizeHint() const Q_DECL_OVERRIDE;
@@ -89,7 +89,7 @@ public:
QMdiSubWindow *activeSubWindow() const;
QList<QMdiSubWindow *> subWindowList(WindowOrder order = CreationOrder) const;
- QMdiSubWindow *addSubWindow(QWidget *widget, Qt::WindowFlags flags = 0);
+ QMdiSubWindow *addSubWindow(QWidget *widget, Qt::WindowFlags flags = Qt::WindowFlags());
void removeSubWindow(QWidget *widget);
QBrush background() const;
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h
index 7f28879f8d..f6bdf61492 100644
--- a/src/widgets/widgets/qmdiarea_p.h
+++ b/src/widgets/widgets/qmdiarea_p.h
@@ -142,8 +142,8 @@ public:
#endif
QMdiAreaTabBar *tabBar;
QList<QMdi::Rearranger *> pendingRearrangements;
- QList< QPointer<QMdiSubWindow> > pendingPlacements;
- QList< QPointer<QMdiSubWindow> > childWindows;
+ QVector< QPointer<QMdiSubWindow> > pendingPlacements;
+ QVector< QPointer<QMdiSubWindow> > childWindows;
QList<int> indicesToActivatedChildren;
QPointer<QMdiSubWindow> active;
QPointer<QMdiSubWindow> aboutToBecomeActive;
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 1808030639..14aeb73baf 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -1091,8 +1091,8 @@ void QMdiSubWindowPrivate::updateDirtyRegions()
if (!parent)
return;
- foreach (Operation operation, operationMap.keys())
- operationMap.find(operation).value().region = getRegion(operation);
+ for (OperationInfoMap::iterator it = operationMap.begin(), end = operationMap.end(); it != end; ++it)
+ it.value().region = getRegion(it.key());
}
/*!
@@ -2689,7 +2689,10 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event)
// System menu events.
if (d->systemMenu && d->systemMenu == object) {
if (event->type() == QEvent::MouseButtonDblClick) {
- close();
+ const QMouseEvent *mouseEvent = static_cast<const QMouseEvent *>(event);
+ const QAction *action = d->systemMenu->actionAt(mouseEvent->pos());
+ if (!action || action->isEnabled())
+ close();
} else if (event->type() == QEvent::MouseMove) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
d->hoveredSubControl = d->getSubControl(mapFromGlobal(mouseEvent->globalPos()));
diff --git a/src/widgets/widgets/qmdisubwindow.h b/src/widgets/widgets/qmdisubwindow.h
index 693477c894..e7d0ca4e44 100644
--- a/src/widgets/widgets/qmdisubwindow.h
+++ b/src/widgets/widgets/qmdisubwindow.h
@@ -60,7 +60,7 @@ public:
};
Q_DECLARE_FLAGS(SubWindowOptions, SubWindowOption)
- QMdiSubWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ QMdiSubWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QMdiSubWindow();
QSize sizeHint() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index e81359feac..ea3e4c4488 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -102,9 +102,9 @@ class QTornOffMenu : public QMenu
causedPopup.action = ((QTornOffMenu*)p)->d_func()->causedPopup.action;
causedStack = ((QTornOffMenu*)p)->d_func()->calcCausedStack();
}
- QList<QPointer<QWidget> > calcCausedStack() const Q_DECL_OVERRIDE { return causedStack; }
+ QVector<QPointer<QWidget> > calcCausedStack() const Q_DECL_OVERRIDE { return causedStack; }
QPointer<QMenu> causedMenu;
- QList<QPointer<QWidget> > causedStack;
+ QVector<QPointer<QWidget> > causedStack;
};
public:
QTornOffMenu(QMenu *p) : QMenu(*(new QTornOffMenuPrivate(p)))
@@ -192,11 +192,10 @@ void QMenuPrivate::syncPlatformMenu()
return;
QPlatformMenuItem *beforeItem = Q_NULLPTR;
- QListIterator<QAction*> it(q->actions());
- it.toBack();
- while (it.hasPrevious()) {
+ const QList<QAction*> actions = q->actions();
+ for (QList<QAction*>::const_reverse_iterator it = actions.rbegin(), end = actions.rend(); it != end; ++it) {
QPlatformMenuItem *menuItem = platformMenu->createMenuItem();
- QAction *action = it.previous();
+ QAction *action = *it;
menuItem->setTag(reinterpret_cast<quintptr>(action));
QObject::connect(menuItem, SIGNAL(activated()), action, SLOT(trigger()), Qt::QueuedConnection);
QObject::connect(menuItem, SIGNAL(hovered()), action, SIGNAL(hovered()), Qt::QueuedConnection);
@@ -236,9 +235,9 @@ QRect QMenuPrivate::popupGeometry(int screen) const
}
}
-QList<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
+QVector<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
{
- QList<QPointer<QWidget> > ret;
+ QVector<QPointer<QWidget> > ret;
for(QWidget *widget = causedPopup.widget; widget; ) {
ret.append(widget);
if (QTornOffMenu *qtmenu = qobject_cast<QTornOffMenu*>(widget))
@@ -503,8 +502,8 @@ void QMenuPrivate::hideMenu(QMenu *menu)
if (activeMenu == menu)
activeMenu = 0;
menu->d_func()->causedPopup.action = 0;
- menu->d_func()->causedPopup.widget = 0;
menu->close();
+ menu->d_func()->causedPopup.widget = 0;
if (previousMouseMenu.data() == menu)
handleEnterLeaveEvents(&previousMouseMenu, Q_NULLPTR);
}
@@ -1110,8 +1109,7 @@ bool QMenuPrivate::mouseEventTaken(QMouseEvent *e)
handleEnterLeaveEvents(&previousMouseMenu,qobject_cast<QMenu *>(caused));
if(e->type() != QEvent::MouseButtonRelease || mouseDown == caused) {
QMouseEvent new_e(e->type(), cpos, caused->mapTo(caused->topLevelWidget(), cpos), e->screenPos(),
- e->button(), e->buttons(), e->modifiers());
- QGuiApplicationPrivate::setMouseEventSource(&new_e, e->source());
+ e->button(), e->buttons(), e->modifiers(), e->source());
QApplication::sendEvent(caused, &new_e);
return true;
}
@@ -1123,7 +1121,7 @@ bool QMenuPrivate::mouseEventTaken(QMouseEvent *e)
return false;
}
-void QMenuPrivate::activateCausedStack(const QList<QPointer<QWidget> > &causedStack, QAction *action, QAction::ActionEvent action_e, bool self)
+void QMenuPrivate::activateCausedStack(const QVector<QPointer<QWidget> > &causedStack, QAction *action, QAction::ActionEvent action_e, bool self)
{
QBoolBlocker guard(activationRecursionGuard);
if(self)
@@ -1171,7 +1169,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
/* I have to save the caused stack here because it will be undone after popup execution (ie in the hide).
Then I iterate over the list to actually send the events. --Sam
*/
- const QList<QPointer<QWidget> > causedStack = calcCausedStack();
+ const QVector<QPointer<QWidget> > causedStack = calcCausedStack();
if (action_e == QAction::Trigger) {
#ifndef QT_NO_WHATSTHIS
if (!inWhatsThisMode)
@@ -1233,7 +1231,7 @@ void QMenuPrivate::_q_actionTriggered()
if (!activationRecursionGuard && actionGuard) {
//in case the action has not been activated by the mouse
//we check the parent hierarchy
- QList< QPointer<QWidget> > list;
+ QVector< QPointer<QWidget> > list;
for(QWidget *widget = q->parentWidget(); widget; ) {
if (qobject_cast<QMenu*>(widget)
#ifndef QT_NO_MENUBAR
@@ -1266,7 +1264,7 @@ void QMenuPrivate::_q_platformMenuAboutToShow()
#ifdef Q_OS_OSX
if (platformMenu)
Q_FOREACH (QAction *action, q->actions())
- if (QWidget *widget = widgetItems.value(const_cast<QAction *>(action)))
+ if (QWidget *widget = widgetItems.value(action))
if (widget->parent() == q) {
QPlatformMenuItem *menuItem = platformMenu->menuItemForTag(reinterpret_cast<quintptr>(action));
moveWidgetToPlatformItem(widget, menuItem);
@@ -1444,7 +1442,7 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
addSeparator(), and addMenu().
\sa QMenuBar, {fowler}{GUI Design Handbook: Menu, Drop-Down and Pop-Up},
- {Application Example}, {Menus Example}, {Recent Files Example}
+ {Application Example}, {Menus Example}
*/
@@ -1572,6 +1570,100 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch
return action;
}
+/*!\fn QAction *QMenu::addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0)
+
+ \since 5.6
+
+ \overload
+
+ This convenience function creates a new action with the text \a
+ text and an optional shortcut \a shortcut. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a method of the \a receiver. The function adds the newly created
+ action to the menu's list of actions and returns it.
+
+ QMenu takes ownership of the returned QAction.
+*/
+
+/*!\fn QAction *QMenu::addAction(const QString &text, Functor functor, const QKeySequence &shortcut = 0)
+
+ \since 5.6
+
+ \overload
+
+ This convenience function creates a new action with the text \a
+ text and an optional shortcut \a shortcut. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor. The function adds the newly created
+ action to the menu's list of actions and returns it.
+
+ QMenu takes ownership of the returned QAction.
+*/
+
+/*!\fn QAction *QMenu::addAction(const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0)
+
+ \since 5.6
+
+ \overload
+
+ This convenience function creates a new action with the text \a
+ text and an optional shortcut \a shortcut. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor. The function adds the newly created
+ action to the menu's list of actions and returns it.
+
+ If \a context is destroyed, the functor will not be called.
+
+ QMenu takes ownership of the returned QAction.
+*/
+
+/*!\fn QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0)
+
+ \since 5.6
+
+ \overload
+
+ This convenience function creates a new action with an \a icon
+ and some \a text and an optional shortcut \a shortcut. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a method of the \a receiver. The function adds the newly created
+ action to the menu's list of actions and returns it.
+
+ QMenu takes ownership of the returned QAction.
+*/
+
+/*!\fn QAction *QMenu::addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut = 0)
+
+ \since 5.6
+
+ \overload
+
+ This convenience function creates a new action with an \a icon
+ and some \a text and an optional shortcut \a shortcut. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor. The function adds the newly created
+ action to the menu's list of actions and returns it.
+
+ QMenu takes ownership of the returned QAction.
+*/
+
+/*!\fn QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0)
+
+ \since 5.6
+
+ \overload
+
+ This convenience function creates a new action with an \a icon
+ and some \a text and an optional shortcut \a shortcut. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor. The function adds the newly created
+ action to the menu's list of actions and returns it.
+
+ If \a context is destroyed, the functor will not be called.
+
+ QMenu takes ownership of the returned QAction.
+*/
+
/*!
\overload
@@ -2494,7 +2586,11 @@ void QMenu::mousePressEvent(QMouseEvent *e)
Q_D(QMenu);
if (d->aboutToHide || d->mouseEventTaken(e))
return;
- if (!rect().contains(e->pos())) {
+ // Workaround for XCB on multiple screens which doesn't have offset. If the menu is open on one screen
+ // and mouse clicks on second screen, e->pos() is QPoint(0,0) and the menu doesn't hide. This trick makes
+ // possible to hide the menu when mouse clicks on another screen (e->screenPos() returns correct value).
+ // Only when mouse clicks in QPoint(0,0) on second screen, the menu doesn't hide.
+ if ((e->pos().isNull() && !e->screenPos().isNull()) || !rect().contains(e->pos())) {
if (d->noReplayFor
&& QRect(d->noReplayFor->mapToGlobal(QPoint()), d->noReplayFor->size()).contains(e->globalPos()))
setAttribute(Qt::WA_NoMouseReplay);
@@ -2586,7 +2682,7 @@ QMenu::event(QEvent *e)
if (kev->key() == Qt::Key_Up || kev->key() == Qt::Key_Down
|| kev->key() == Qt::Key_Left || kev->key() == Qt::Key_Right
|| kev->key() == Qt::Key_Enter || kev->key() == Qt::Key_Return
- || kev->key() == Qt::Key_Escape) {
+ || kev->matches(QKeySequence::Cancel)) {
e->accept();
return true;
}
@@ -2872,27 +2968,6 @@ void QMenu::keyPressEvent(QKeyEvent *e)
}
break;
- case Qt::Key_Escape:
-#ifdef QT_KEYPAD_NAVIGATION
- case Qt::Key_Back:
-#endif
- key_consumed = true;
- if (d->tornoff) {
- close();
- return;
- }
- {
- QPointer<QWidget> caused = d->causedPopup.widget;
- d->hideMenu(this); // hide after getting causedPopup
-#ifndef QT_NO_MENUBAR
- if (QMenuBar *mb = qobject_cast<QMenuBar*>(caused)) {
- mb->d_func()->setCurrentAction(d->menuAction);
- mb->d_func()->setKeyboardMode(true);
- }
-#endif
- }
- break;
-
case Qt::Key_Space:
if (!style()->styleHint(QStyle::SH_Menu_SpaceActivatesItem, 0, this))
break;
@@ -2929,6 +3004,28 @@ void QMenu::keyPressEvent(QKeyEvent *e)
key_consumed = false;
}
+ if (!key_consumed && (e->matches(QKeySequence::Cancel)
+#ifdef QT_KEYPAD_NAVIGATION
+ || e->key() == Qt::Key_Back
+#endif
+ )) {
+ key_consumed = true;
+ if (d->tornoff) {
+ close();
+ return;
+ }
+ {
+ QPointer<QWidget> caused = d->causedPopup.widget;
+ d->hideMenu(this); // hide after getting causedPopup
+#ifndef QT_NO_MENUBAR
+ if (QMenuBar *mb = qobject_cast<QMenuBar*>(caused)) {
+ mb->d_func()->setCurrentAction(d->menuAction);
+ mb->d_func()->setKeyboardMode(true);
+ }
+#endif
+ }
+ }
+
if (!key_consumed) { // send to menu bar
if ((!e->modifiers() || e->modifiers() == Qt::AltModifier || e->modifiers() == Qt::ShiftModifier) &&
e->text().length()==1) {
@@ -3049,7 +3146,7 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
d->activeMenu->d_func()->setCurrentAction(0);
QMenuSloppyState::MouseEventResult sloppyEventResult = d->sloppyState.processMouseEvent(e->localPos(), action, d->currentAction);
- if (sloppyEventResult == QMenuSloppyState::EventShouldBePropogated) {
+ if (sloppyEventResult == QMenuSloppyState::EventShouldBePropagated) {
d->setCurrentAction(action, d->mousePopupDelay);
} else if (sloppyEventResult == QMenuSloppyState::EventDiscardsSloppyState) {
d->sloppyState.reset();
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index 5dda8b2370..6bbe54186e 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -68,8 +68,8 @@ private:
Q_PROPERTY(bool toolTipsVisible READ toolTipsVisible WRITE setToolTipsVisible)
public:
- explicit QMenu(QWidget *parent = 0);
- explicit QMenu(const QString &title, QWidget *parent = 0);
+ explicit QMenu(QWidget *parent = Q_NULLPTR);
+ explicit QMenu(const QString &title, QWidget *parent = Q_NULLPTR);
~QMenu();
using QWidget::addAction;
@@ -78,6 +78,72 @@ public:
QAction *addAction(const QString &text, const QObject *receiver, const char* member, const QKeySequence &shortcut = 0);
QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char* member, const QKeySequence &shortcut = 0);
+#ifdef Q_QDOC
+ QAction *addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0);
+ QAction *addAction(const QString &text, Functor functor, const QKeySequence &shortcut = 0);
+ QAction *addAction(const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0);
+ QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0);
+ QAction *addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut = 0);
+ QAction *addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0);
+#else
+ // addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
+ template<class Obj, typename Func1>
+ inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+ addAction(const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0)
+ {
+ QAction *result = addAction(text);
+#ifdef QT_NO_SHORTCUT
+ Q_UNUSED(shortcut)
+#else
+ result->setShortcut(shortcut);
+#endif
+ connect(result, &QAction::triggered, object, slot);
+ return result;
+ }
+ // addAction(QString): Connect to a functor or function pointer (without context)
+ template <typename Func1>
+ inline QAction *addAction(const QString &text, Func1 slot, const QKeySequence &shortcut = 0)
+ {
+ QAction *result = addAction(text);
+#ifdef QT_NO_SHORTCUT
+ Q_UNUSED(shortcut)
+#else
+ result->setShortcut(shortcut);
+#endif
+ connect(result, &QAction::triggered, slot);
+ return result;
+ }
+ // addAction(QIcon, QString): Connect to a QObject slot / functor or function pointer (with context)
+ template<class Obj, typename Func1>
+ inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+ addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0)
+ {
+ QAction *result = addAction(actionIcon, text);
+#ifdef QT_NO_SHORTCUT
+ Q_UNUSED(shortcut)
+#else
+ result->setShortcut(shortcut);
+#endif
+ connect(result, &QAction::triggered, object, slot);
+ return result;
+ }
+ // addAction(QIcon, QString): Connect to a functor or function pointer (without context)
+ template <typename Func1>
+ inline QAction *addAction(const QIcon &actionIcon, const QString &text, Func1 slot, const QKeySequence &shortcut = 0)
+ {
+ QAction *result = addAction(actionIcon, text);
+#ifdef QT_NO_SHORTCUT
+ Q_UNUSED(shortcut)
+#else
+ result->setShortcut(shortcut);
+#endif
+ connect(result, &QAction::triggered, slot);
+ return result;
+ }
+#endif // !Q_QDOC
+
QAction *addMenu(QMenu *menu);
QMenu *addMenu(const QString &title);
QMenu *addMenu(const QIcon &icon, const QString &title);
@@ -107,14 +173,14 @@ public:
void setActiveAction(QAction *act);
QAction *activeAction() const;
- void popup(const QPoint &pos, QAction *at=0);
+ void popup(const QPoint &pos, QAction *at = Q_NULLPTR);
QAction *exec();
- QAction *exec(const QPoint &pos, QAction *at=0);
+ QAction *exec(const QPoint &pos, QAction *at = Q_NULLPTR);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- static QAction *exec(const QList<QAction *> &actions, const QPoint &pos, QAction *at = 0, QWidget *parent = 0);
+ static QAction *exec(const QList<QAction *> &actions, const QPoint &pos, QAction *at = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
#else
- static QAction *exec(QList<QAction*> actions, const QPoint &pos, QAction *at=0, QWidget *parent=0);
+ static QAction *exec(QList<QAction*> actions, const QPoint &pos, QAction *at = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
#endif
QSize sizeHint() const Q_DECL_OVERRIDE;
@@ -189,7 +255,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_platformMenuAboutToShow())
protected:
- QMenu(QMenuPrivate &dd, QWidget* parent = 0);
+ QMenu(QMenuPrivate &dd, QWidget* parent = Q_NULLPTR);
private:
Q_DISABLE_COPY(QMenu)
diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm
index a42879fc73..8b29011178 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -115,6 +115,7 @@ void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem*
QObject::connect(platformMenu, SIGNAL(destroyed()), container, SLOT(deleteLater()));
container->resize(widget->sizeHint());
widget->setParent(container);
+ widget->setVisible(true);
NSView *containerView = container->nativeView();
QWindow *containerWindow = container->windowHandle();
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index ab6ca068fb..e717d923ae 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -126,7 +126,7 @@ public:
enum MouseEventResult {
EventIsProcessed,
- EventShouldBePropogated,
+ EventShouldBePropagated,
EventDiscardsSloppyState
};
@@ -187,14 +187,14 @@ public:
m_parent->stopTimer();
if (!m_enabled)
- return EventShouldBePropogated;
+ return EventShouldBePropagated;
if (!m_time.isActive())
startTimer();
if (!m_sub_menu) {
reset();
- return EventShouldBePropogated;
+ return EventShouldBePropagated;
}
QSetValueOnDestroy<bool> setFirstMouse(m_first_mouse, false);
@@ -208,7 +208,7 @@ public:
if (m_action_rect.contains(mousePos)) {
startTimer();
- return currentAction == m_menu->menuAction() ? EventIsProcessed : EventShouldBePropogated;
+ return currentAction == m_menu->menuAction() ? EventIsProcessed : EventShouldBePropagated;
}
if (m_uni_directional && !m_first_mouse && resetAction != m_origin_action) {
@@ -247,7 +247,7 @@ public:
}
- return m_select_other_actions ? EventShouldBePropogated : EventIsProcessed;
+ return m_select_other_actions ? EventShouldBePropagated : EventIsProcessed;
}
void setSubMenuPopup(const QRect &actionRect, QAction *resetAction, QMenu *subMenu);
@@ -422,7 +422,7 @@ public:
QPointer<QWidget> widget;
QPointer<QAction> action;
};
- virtual QList<QPointer<QWidget> > calcCausedStack() const;
+ virtual QVector<QPointer<QWidget> > calcCausedStack() const;
QMenuCaused causedPopup;
void hideUpToMenuBar();
void hideMenu(QMenu *menu);
@@ -450,7 +450,7 @@ public:
//firing of events
void activateAction(QAction *, QAction::ActionEvent, bool self=true);
- void activateCausedStack(const QList<QPointer<QWidget> > &, QAction *, QAction::ActionEvent, bool);
+ void activateCausedStack(const QVector<QPointer<QWidget> > &, QAction *, QAction::ActionEvent, bool);
void _q_actionTriggered();
void _q_actionHovered();
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 883fd3a945..2e48607f82 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -195,7 +195,9 @@ void QMenuBarPrivate::updateGeometries()
for(int j = 0; j < shortcutIndexMap.size(); ++j)
q->releaseShortcut(shortcutIndexMap.value(j));
shortcutIndexMap.resize(0); // faster than clear
- for(int i = 0; i < actions.count(); i++)
+ const int actionsCount = actions.count();
+ shortcutIndexMap.reserve(actionsCount);
+ for (int i = 0; i < actionsCount; i++)
shortcutIndexMap.append(q->grabShortcut(QKeySequence::mnemonic(actions.at(i)->text())));
}
#endif
@@ -636,7 +638,7 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti
\row \li quit or exit
\li Application Menu | Quit <application name>
\li If this entry is not found a default Quit item will be
- created to call QApplication::quit()
+ created to call QCoreApplication::quit()
\endtable
You can override this behavior by using the QAction::menuRole()
@@ -1120,14 +1122,14 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
}
break; }
- case Qt::Key_Escape:
+ default:
+ key_consumed = false;
+ }
+
+ if (!key_consumed && e->matches(QKeySequence::Cancel)) {
d->setCurrentAction(0);
d->setKeyboardMode(false);
key_consumed = true;
- break;
-
- default:
- key_consumed = false;
}
if(!key_consumed &&
@@ -1430,7 +1432,7 @@ bool QMenuBar::event(QEvent *e)
case QEvent::ShortcutOverride: {
QKeyEvent *kev = static_cast<QKeyEvent*>(e);
//we only filter out escape if there is a current action
- if (kev->key() == Qt::Key_Escape && d->currentAction) {
+ if (kev->matches(QKeySequence::Cancel) && d->currentAction) {
e->accept();
return true;
}
diff --git a/src/widgets/widgets/qmenubar.h b/src/widgets/widgets/qmenubar.h
index 461dec8a94..3b3980c860 100644
--- a/src/widgets/widgets/qmenubar.h
+++ b/src/widgets/widgets/qmenubar.h
@@ -54,7 +54,7 @@ class Q_WIDGETS_EXPORT QMenuBar : public QWidget
Q_PROPERTY(bool nativeMenuBar READ isNativeMenuBar WRITE setNativeMenuBar)
public:
- explicit QMenuBar(QWidget *parent = 0);
+ explicit QMenuBar(QWidget *parent = Q_NULLPTR);
~QMenuBar();
using QWidget::addAction;
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 93c9ddc285..91788a3383 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -1615,7 +1615,7 @@ void QPlainTextEdit::timerEvent(QTimerEvent *e)
Note that the undo/redo history is cleared by this function.
- \sa toText()
+ \sa toPlainText()
*/
void QPlainTextEdit::setPlainText(const QString &text)
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h
index 69bd2ab647..60f1d6e984 100644
--- a/src/widgets/widgets/qplaintextedit.h
+++ b/src/widgets/widgets/qplaintextedit.h
@@ -82,8 +82,8 @@ public:
};
Q_ENUM(LineWrapMode)
- explicit QPlainTextEdit(QWidget *parent = 0);
- explicit QPlainTextEdit(const QString &text, QWidget *parent = 0);
+ explicit QPlainTextEdit(QWidget *parent = Q_NULLPTR);
+ explicit QPlainTextEdit(const QString &text, QWidget *parent = Q_NULLPTR);
virtual ~QPlainTextEdit();
void setDocument(QTextDocument *document);
@@ -136,9 +136,9 @@ public:
void setCenterOnScroll(bool enabled);
bool centerOnScroll() const;
- bool find(const QString &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QString &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
#ifndef QT_NO_REGEXP
- bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QRegExp &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
#endif
inline QString toPlainText() const
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 8034a0237a..5b06e75abe 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -107,10 +107,8 @@ void QProgressBarPrivate::resetLayoutItemMargins()
/*!
Initialize \a option with the values from this QProgressBar. This method is useful
- for subclasses when they need a QStyleOptionProgressBar or QStyleOptionProgressBarV2,
- but don't want to fill in all the information themselves. This function will check the version
- of the QStyleOptionProgressBar and fill in the additional values for a
- QStyleOptionProgressBarV2.
+ for subclasses when they need a QStyleOptionProgressBar,
+ but don't want to fill in all the information themselves.
\sa QStyleOption::initFrom()
*/
@@ -129,13 +127,9 @@ void QProgressBar::initStyleOption(QStyleOptionProgressBar *option) const
option->textAlignment = d->alignment;
option->textVisible = d->textVisible;
option->text = text();
-
- if (QStyleOptionProgressBarV2 *optionV2
- = qstyleoption_cast<QStyleOptionProgressBarV2 *>(option)) {
- optionV2->orientation = d->orientation; // ### Qt 6: remove this member from QStyleOptionProgressBarV2
- optionV2->invertedAppearance = d->invertedAppearance;
- optionV2->bottomToTop = (d->textDirection == QProgressBar::BottomToTop);
- }
+ option->orientation = d->orientation; // ### Qt 6: remove this member from QStyleOptionProgressBar
+ option->invertedAppearance = d->invertedAppearance;
+ option->bottomToTop = d->textDirection == QProgressBar::BottomToTop;
}
bool QProgressBarPrivate::repaintRequired() const
@@ -158,7 +152,7 @@ bool QProgressBarPrivate::repaintRequired() const
}
// Check if the bar needs to be repainted
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
q->initStyleOption(&opt);
int cw = q->style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, q);
QRect groove = q->style()->subElementRect(QStyle::SE_ProgressBarGroove, &opt, q);
@@ -410,7 +404,7 @@ Qt::Alignment QProgressBar::alignment() const
void QProgressBar::paintEvent(QPaintEvent *)
{
QStylePainter paint(this);
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
initStyleOption(&opt);
paint.drawControl(QStyle::CE_ProgressBar, opt);
d_func()->lastPaintedValue = d_func()->value;
@@ -423,7 +417,7 @@ QSize QProgressBar::sizeHint() const
{
ensurePolished();
QFontMetrics fm = fontMetrics();
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
initStyleOption(&opt);
int cw = style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, this);
QSize size = QSize(qMax(9, cw) * 7 + fm.width(QLatin1Char('0')) * 4, fm.height() + 8);
diff --git a/src/widgets/widgets/qprogressbar.h b/src/widgets/widgets/qprogressbar.h
index 0c3200f82c..e17e01c17b 100644
--- a/src/widgets/widgets/qprogressbar.h
+++ b/src/widgets/widgets/qprogressbar.h
@@ -62,7 +62,7 @@ public:
enum Direction { TopToBottom, BottomToTop };
Q_ENUM(Direction)
- explicit QProgressBar(QWidget *parent = 0);
+ explicit QProgressBar(QWidget *parent = Q_NULLPTR);
~QProgressBar();
int minimum() const;
diff --git a/src/widgets/widgets/qpushbutton.h b/src/widgets/widgets/qpushbutton.h
index 2521c0982e..3db12be380 100644
--- a/src/widgets/widgets/qpushbutton.h
+++ b/src/widgets/widgets/qpushbutton.h
@@ -52,9 +52,9 @@ class Q_WIDGETS_EXPORT QPushButton : public QAbstractButton
Q_PROPERTY(bool flat READ isFlat WRITE setFlat)
public:
- explicit QPushButton(QWidget *parent=0);
- explicit QPushButton(const QString &text, QWidget *parent=0);
- QPushButton(const QIcon& icon, const QString &text, QWidget *parent=0);
+ explicit QPushButton(QWidget *parent = Q_NULLPTR);
+ explicit QPushButton(const QString &text, QWidget *parent = Q_NULLPTR);
+ QPushButton(const QIcon& icon, const QString &text, QWidget *parent = Q_NULLPTR);
~QPushButton();
QSize sizeHint() const Q_DECL_OVERRIDE;
@@ -88,7 +88,7 @@ protected:
void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE;
void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE;
void initStyleOption(QStyleOptionButton *option) const;
- QPushButton(QPushButtonPrivate &dd, QWidget* parent = 0);
+ QPushButton(QPushButtonPrivate &dd, QWidget* parent = Q_NULLPTR);
public:
diff --git a/src/widgets/widgets/qradiobutton.h b/src/widgets/widgets/qradiobutton.h
index f323f5af99..df0b1051bf 100644
--- a/src/widgets/widgets/qradiobutton.h
+++ b/src/widgets/widgets/qradiobutton.h
@@ -47,8 +47,8 @@ class Q_WIDGETS_EXPORT QRadioButton : public QAbstractButton
Q_OBJECT
public:
- explicit QRadioButton(QWidget *parent=0);
- explicit QRadioButton(const QString &text, QWidget *parent=0);
+ explicit QRadioButton(QWidget *parent = Q_NULLPTR);
+ explicit QRadioButton(const QString &text, QWidget *parent = Q_NULLPTR);
~QRadioButton();
QSize sizeHint() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qrubberband.h b/src/widgets/widgets/qrubberband.h
index 3ff6eb47fa..b0dc14ed98 100644
--- a/src/widgets/widgets/qrubberband.h
+++ b/src/widgets/widgets/qrubberband.h
@@ -50,7 +50,7 @@ class Q_WIDGETS_EXPORT QRubberBand : public QWidget
public:
enum Shape { Line, Rectangle };
- explicit QRubberBand(Shape, QWidget * =0);
+ explicit QRubberBand(Shape, QWidget * = Q_NULLPTR);
~QRubberBand();
Shape shape() const;
diff --git a/src/widgets/widgets/qscrollarea.h b/src/widgets/widgets/qscrollarea.h
index cafb1ec6de..1658236034 100644
--- a/src/widgets/widgets/qscrollarea.h
+++ b/src/widgets/widgets/qscrollarea.h
@@ -50,7 +50,7 @@ class Q_WIDGETS_EXPORT QScrollArea : public QAbstractScrollArea
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
public:
- explicit QScrollArea(QWidget* parent=0);
+ explicit QScrollArea(QWidget *parent = Q_NULLPTR);
~QScrollArea();
QWidget *widget() const;
@@ -71,7 +71,7 @@ public:
void ensureWidgetVisible(QWidget *childWidget, int xmargin = 50, int ymargin = 50);
protected:
- QScrollArea(QScrollAreaPrivate &dd, QWidget *parent = 0);
+ QScrollArea(QScrollAreaPrivate &dd, QWidget *parent = Q_NULLPTR);
bool event(QEvent *) Q_DECL_OVERRIDE;
bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h
index 5934469045..4af5fb4a55 100644
--- a/src/widgets/widgets/qscrollbar.h
+++ b/src/widgets/widgets/qscrollbar.h
@@ -49,8 +49,8 @@ class Q_WIDGETS_EXPORT QScrollBar : public QAbstractSlider
{
Q_OBJECT
public:
- explicit QScrollBar(QWidget *parent=0);
- explicit QScrollBar(Qt::Orientation, QWidget *parent=0);
+ explicit QScrollBar(QWidget *parent = Q_NULLPTR);
+ explicit QScrollBar(Qt::Orientation, QWidget *parent = Q_NULLPTR);
~QScrollBar();
QSize sizeHint() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h
index 3a528382a7..801a684fdf 100644
--- a/src/widgets/widgets/qslider.h
+++ b/src/widgets/widgets/qslider.h
@@ -61,8 +61,8 @@ public:
};
Q_ENUM(TickPosition)
- explicit QSlider(QWidget *parent = 0);
- explicit QSlider(Qt::Orientation orientation, QWidget *parent = 0);
+ explicit QSlider(QWidget *parent = Q_NULLPTR);
+ explicit QSlider(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
~QSlider();
diff --git a/src/widgets/widgets/qspinbox.h b/src/widgets/widgets/qspinbox.h
index 606206d4f0..066fe88562 100644
--- a/src/widgets/widgets/qspinbox.h
+++ b/src/widgets/widgets/qspinbox.h
@@ -56,7 +56,7 @@ class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox
Q_PROPERTY(int displayIntegerBase READ displayIntegerBase WRITE setDisplayIntegerBase)
public:
- explicit QSpinBox(QWidget *parent = 0);
+ explicit QSpinBox(QWidget *parent = Q_NULLPTR);
~QSpinBox();
int value() const;
@@ -117,7 +117,7 @@ class Q_WIDGETS_EXPORT QDoubleSpinBox : public QAbstractSpinBox
Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true)
public:
- explicit QDoubleSpinBox(QWidget *parent = 0);
+ explicit QDoubleSpinBox(QWidget *parent = Q_NULLPTR);
~QDoubleSpinBox();
double value() const;
diff --git a/src/widgets/widgets/qsplashscreen.h b/src/widgets/widgets/qsplashscreen.h
index 58b8484f4c..dec24a5608 100644
--- a/src/widgets/widgets/qsplashscreen.h
+++ b/src/widgets/widgets/qsplashscreen.h
@@ -47,8 +47,8 @@ class Q_WIDGETS_EXPORT QSplashScreen : public QWidget
{
Q_OBJECT
public:
- explicit QSplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = 0);
- QSplashScreen(QWidget *parent, const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = 0);
+ explicit QSplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = Qt::WindowFlags());
+ QSplashScreen(QWidget *parent, const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = Qt::WindowFlags());
virtual ~QSplashScreen();
void setPixmap(const QPixmap &pixmap);
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index de6e45234c..c2081c15f8 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -58,6 +58,10 @@ QT_BEGIN_NAMESPACE
//#define QSPLITTER_DEBUG
+QSplitterPrivate::~QSplitterPrivate()
+{
+}
+
/*!
\class QSplitterHandle
\brief The QSplitterHandle class provides handle functionality for the splitter.
@@ -1498,8 +1502,11 @@ QList<int> QSplitter::sizes() const
Q_D(const QSplitter);
ensurePolished();
+ const int numSizes = d->list.size();
QList<int> list;
- for (int i = 0; i < d->list.size(); ++i) {
+ list.reserve(numSizes);
+
+ for (int i = 0; i < numSizes; ++i) {
QSplitterLayoutStruct *s = d->list.at(i);
list.append(d->pick(s->rect.size()));
}
@@ -1594,8 +1601,10 @@ QByteArray QSplitter::saveState() const
stream << qint32(SplitterMagic);
stream << qint32(version);
+ const int numSizes = d->list.size();
QList<int> list;
- for (int i = 0; i < d->list.size(); ++i) {
+ list.reserve(numSizes);
+ for (int i = 0; i < numSizes; ++i) {
QSplitterLayoutStruct *s = d->list.at(i);
list.append(s->sizer);
}
diff --git a/src/widgets/widgets/qsplitter.h b/src/widgets/widgets/qsplitter.h
index 4da92acd22..84010c236b 100644
--- a/src/widgets/widgets/qsplitter.h
+++ b/src/widgets/widgets/qsplitter.h
@@ -58,8 +58,8 @@ class Q_WIDGETS_EXPORT QSplitter : public QFrame
Q_PROPERTY(bool childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible)
public:
- explicit QSplitter(QWidget* parent = 0);
- explicit QSplitter(Qt::Orientation, QWidget* parent = 0);
+ explicit QSplitter(QWidget* parent = Q_NULLPTR);
+ explicit QSplitter(Qt::Orientation, QWidget* parent = Q_NULLPTR);
~QSplitter();
void addWidget(QWidget *widget);
diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h
index a45f776da1..890bd535ec 100644
--- a/src/widgets/widgets/qsplitter_p.h
+++ b/src/widgets/widgets/qsplitter_p.h
@@ -76,6 +76,7 @@ class QSplitterPrivate : public QFramePrivate
public:
QSplitterPrivate() : rubberBand(0), opaque(true), firstShow(true),
childrenCollapsible(true), compatMode(false), handleWidth(-1), blockChildAdd(false), opaqueResizeSet(false) {}
+ ~QSplitterPrivate();
QPointer<QRubberBand> rubberBand;
mutable QList<QSplitterLayoutStruct *> list;
diff --git a/src/widgets/widgets/qstackedwidget.h b/src/widgets/widgets/qstackedwidget.h
index 4267d8241f..9fcdf80833 100644
--- a/src/widgets/widgets/qstackedwidget.h
+++ b/src/widgets/widgets/qstackedwidget.h
@@ -50,7 +50,7 @@ class Q_WIDGETS_EXPORT QStackedWidget : public QFrame
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
Q_PROPERTY(int count READ count)
public:
- explicit QStackedWidget(QWidget *parent=0);
+ explicit QStackedWidget(QWidget *parent = Q_NULLPTR);
~QStackedWidget();
int addWidget(QWidget *w);
diff --git a/src/widgets/widgets/qstatusbar.h b/src/widgets/widgets/qstatusbar.h
index 42248d7958..92785aa4c4 100644
--- a/src/widgets/widgets/qstatusbar.h
+++ b/src/widgets/widgets/qstatusbar.h
@@ -50,7 +50,7 @@ class Q_WIDGETS_EXPORT QStatusBar: public QWidget
Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
public:
- explicit QStatusBar(QWidget* parent=0);
+ explicit QStatusBar(QWidget *parent = Q_NULLPTR);
virtual ~QStatusBar();
void addWidget(QWidget *widget, int stretch = 0);
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index f2e98474b3..7ea5455bf7 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -118,10 +118,8 @@ void QTabBarPrivate::updateMacBorderMetrics()
/*!
Initialize \a option with the values from the tab at \a tabIndex. This method
- is useful for subclasses when they need a QStyleOptionTab, QStyleOptionTabV2,
- or QStyleOptionTabV3 but don't want to fill in all the information themselves.
- This function will check the version of the QStyleOptionTab and fill in the
- additional values for a QStyleOptionTabV2 and QStyleOptionTabV3.
+ is useful for subclasses when they need a QStyleOptionTab,
+ but don't want to fill in all the information themselves.
\sa QStyleOption::initFrom(), QTabWidget::initStyleOption()
*/
@@ -158,14 +156,11 @@ void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
option->palette.setColor(foregroundRole(), tab.textColor);
option->icon = tab.icon;
- if (QStyleOptionTabV2 *optionV2 = qstyleoption_cast<QStyleOptionTabV2 *>(option))
- optionV2->iconSize = iconSize(); // Will get the default value then.
+ option->iconSize = iconSize(); // Will get the default value then.
- if (QStyleOptionTabV3 *optionV3 = qstyleoption_cast<QStyleOptionTabV3 *>(option)) {
- optionV3->leftButtonSize = tab.leftWidget ? tab.leftWidget->size() : QSize();
- optionV3->rightButtonSize = tab.rightWidget ? tab.rightWidget->size() : QSize();
- optionV3->documentMode = d->documentMode;
- }
+ option->leftButtonSize = tab.leftWidget ? tab.leftWidget->size() : QSize();
+ option->rightButtonSize = tab.rightWidget ? tab.rightWidget->size() : QSize();
+ option->documentMode = d->documentMode;
if (tabIndex > 0 && tabIndex - 1 == d->currentIndex)
option->selectedPosition = QStyleOptionTab::PreviousIsSelected;
@@ -600,7 +595,7 @@ void QTabBarPrivate::layoutTab(int index)
if (!(tab.leftWidget || tab.rightWidget))
return;
- QStyleOptionTabV3 opt;
+ QStyleOptionTab opt;
q->initStyleOption(&opt, index);
if (tab.leftWidget) {
QRect rect = q->style()->subElementRect(QStyle::SE_TabBarTabLeftButton, &opt, q);
@@ -778,7 +773,7 @@ void QTabBar::setShape(Shape shape)
If true then QTabBar draws a base in relation to the styles overlab.
Otherwise only the tabs are drawn.
- \sa QStyle::pixelMetric(), QStyle::PM_TabBarBaseOverlap, QStyleOptionTabBarBaseV2
+ \sa QStyle::pixelMetric(), QStyle::PM_TabBarBaseOverlap, QStyleOptionTabBarBase
*/
void QTabBar::setDrawBase(bool drawBase)
@@ -857,7 +852,7 @@ int QTabBar::insertTab(int index, const QIcon& icon, const QString &text)
++d->currentIndex;
if (d->closeButtonOnTabs) {
- QStyleOptionTabV3 opt;
+ QStyleOptionTab opt;
initStyleOption(&opt, index);
ButtonPosition closeSide = (ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, this);
QAbstractButton *closeButton = new CloseButton(this);
@@ -1363,7 +1358,7 @@ QSize QTabBar::tabSizeHint(int index) const
//Note: this must match with the computations in QCommonStylePrivate::tabLayout
Q_D(const QTabBar);
if (const QTabBarPrivate::Tab *tab = d->at(index)) {
- QStyleOptionTabV3 opt;
+ QStyleOptionTab opt;
initStyleOption(&opt, index);
opt.text = d->tabList.at(index).text;
QSize iconSize = tab->icon.isNull() ? QSize(0, 0) : opt.iconSize;
@@ -1571,7 +1566,7 @@ void QTabBar::paintEvent(QPaintEvent *)
{
Q_D(QTabBar);
- QStyleOptionTabBarBaseV2 optTabBase;
+ QStyleOptionTabBarBase optTabBase;
QTabBarPrivate::initStyleBaseOption(&optTabBase, this, size());
QStylePainter p(this);
@@ -1593,7 +1588,7 @@ void QTabBar::paintEvent(QPaintEvent *)
p.drawPrimitive(QStyle::PE_FrameTabBarBase, optTabBase);
for (int i = 0; i < d->tabList.count(); ++i) {
- QStyleOptionTabV3 tab;
+ QStyleOptionTab tab;
initStyleOption(&tab, i);
if (d->paintWithOffsets && d->tabList[i].dragOffset != 0) {
if (vertical) {
@@ -1626,7 +1621,7 @@ void QTabBar::paintEvent(QPaintEvent *)
// Draw the selected tab last to get it "on top"
if (selected >= 0) {
- QStyleOptionTabV3 tab;
+ QStyleOptionTab tab;
initStyleOption(&tab, selected);
if (d->paintWithOffsets && d->tabList[selected].dragOffset != 0) {
if (vertical)
@@ -1806,7 +1801,7 @@ void QTabBar::mousePressEvent(QMouseEvent *event)
d->previousPressedIndex = d->pressedIndex;
#endif
if (d->validIndex(d->pressedIndex)) {
- QStyleOptionTabBarBaseV2 optTabBase;
+ QStyleOptionTabBarBase optTabBase;
optTabBase.init(this);
optTabBase.documentMode = d->documentMode;
if (event->type() == style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this))
@@ -1902,7 +1897,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
event->ignore();
return;
}
- QStyleOptionTabBarBaseV2 optTabBase;
+ QStyleOptionTabBarBase optTabBase;
optTabBase.init(this);
optTabBase.documentMode = d->documentMode;
}
@@ -1922,7 +1917,7 @@ void QTabBarPrivate::setupMovableTab()
QStylePainter p(&grabImage, q);
p.initFrom(q);
- QStyleOptionTabV3 tab;
+ QStyleOptionTab tab;
q->initStyleOption(&tab, pressedIndex);
tab.rect.moveTopLeft(QPoint(taboverlap, 0));
p.drawControl(QStyle::CE_TabBarTab, tab);
@@ -2006,7 +2001,7 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event)
int i = d->indexAtPos(event->pos()) == d->pressedIndex ? d->pressedIndex : -1;
d->pressedIndex = -1;
- QStyleOptionTabBarBaseV2 optTabBase;
+ QStyleOptionTabBarBase optTabBase;
optTabBase.initFrom(this);
optTabBase.documentMode = d->documentMode;
if (style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this) == QEvent::MouseButtonRelease)
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index 6d8bdb0c86..94a83142b0 100644
--- a/src/widgets/widgets/qtabbar.h
+++ b/src/widgets/widgets/qtabbar.h
@@ -65,7 +65,7 @@ class Q_WIDGETS_EXPORT QTabBar: public QWidget
Q_PROPERTY(bool changeCurrentOnDrag READ changeCurrentOnDrag WRITE setChangeCurrentOnDrag)
public:
- explicit QTabBar(QWidget* parent=0);
+ explicit QTabBar(QWidget *parent = Q_NULLPTR);
~QTabBar();
enum Shape { RoundedNorth, RoundedSouth, RoundedWest, RoundedEast,
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index d5a59b05ad..38a3c138cc 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -206,7 +206,7 @@ public:
int previousPressedIndex;
#endif
// shared by tabwidget and qtabbar
- static void initStyleBaseOption(QStyleOptionTabBarBaseV2 *optTabBase, QTabBar *tabbar, QSize size)
+ static void initStyleBaseOption(QStyleOptionTabBarBase *optTabBase, QTabBar *tabbar, QSize size)
{
QStyleOptionTab tabOverlap;
tabOverlap.shape = tabbar->shape();
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index 1edb548206..0379bad723 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -331,13 +331,11 @@ void QTabWidget::initStyleOption(QStyleOptionTabWidgetFrame *option) const
option->tabBarSize = t;
- if (QStyleOptionTabWidgetFrameV2 *tabframe = qstyleoption_cast<QStyleOptionTabWidgetFrameV2*>(option)) {
- QRect tbRect = tabBar()->geometry();
- QRect selectedTabRect = tabBar()->tabRect(tabBar()->currentIndex());
- tabframe->tabBarRect = tbRect;
- selectedTabRect.moveTopLeft(selectedTabRect.topLeft() + tbRect.topLeft());
- tabframe->selectedTabRect = selectedTabRect;
- }
+ QRect tbRect = tabBar()->geometry();
+ QRect selectedTabRect = tabBar()->tabRect(tabBar()->currentIndex());
+ option->tabBarRect = tbRect;
+ selectedTabRect.moveTopLeft(selectedTabRect.topLeft() + tbRect.topLeft());
+ option->selectedTabRect = selectedTabRect;
}
/*!
@@ -768,7 +766,7 @@ void QTabWidget::setUpLayout(bool onlyCheck)
if (onlyCheck && !d->dirty)
return; // nothing to do
- QStyleOptionTabWidgetFrameV2 option;
+ QStyleOptionTabWidgetFrame option;
initStyleOption(&option);
// this must be done immediately, because QWidgetItem relies on it (even if !isVisible())
@@ -817,7 +815,7 @@ QSize QTabWidget::sizeHint() const
{
Q_D(const QTabWidget);
QSize lc(0, 0), rc(0, 0);
- QStyleOptionTabWidgetFrameV2 opt;
+ QStyleOptionTabWidgetFrame opt;
initStyleOption(&opt);
opt.state = QStyle::State_None;
@@ -866,7 +864,7 @@ QSize QTabWidget::minimumSizeHint() const
QSize sz = basicSize(d->pos == North || d->pos == South, lc, rc, s, t);
- QStyleOptionTabWidgetFrameV2 opt;
+ QStyleOptionTabWidgetFrame opt;
initStyleOption(&opt);
opt.palette = palette();
opt.state = QStyle::State_None;
@@ -880,7 +878,7 @@ QSize QTabWidget::minimumSizeHint() const
int QTabWidget::heightForWidth(int width) const
{
Q_D(const QTabWidget);
- QStyleOptionTabWidgetFrameV2 opt;
+ QStyleOptionTabWidgetFrame opt;
initStyleOption(&opt);
opt.state = QStyle::State_None;
@@ -1226,14 +1224,14 @@ void QTabWidget::paintEvent(QPaintEvent *)
if (documentMode()) {
QStylePainter p(this, tabBar());
if (QWidget *w = cornerWidget(Qt::TopLeftCorner)) {
- QStyleOptionTabBarBaseV2 opt;
+ QStyleOptionTabBarBase opt;
QTabBarPrivate::initStyleBaseOption(&opt, tabBar(), w->size());
opt.rect.moveLeft(w->x() + opt.rect.x());
opt.rect.moveTop(w->y() + opt.rect.y());
p.drawPrimitive(QStyle::PE_FrameTabBarBase, opt);
}
if (QWidget *w = cornerWidget(Qt::TopRightCorner)) {
- QStyleOptionTabBarBaseV2 opt;
+ QStyleOptionTabBarBase opt;
QTabBarPrivate::initStyleBaseOption(&opt, tabBar(), w->size());
opt.rect.moveLeft(w->x() + opt.rect.x());
opt.rect.moveTop(w->y() + opt.rect.y());
@@ -1243,7 +1241,7 @@ void QTabWidget::paintEvent(QPaintEvent *)
}
QStylePainter p(this);
- QStyleOptionTabWidgetFrameV2 opt;
+ QStyleOptionTabWidgetFrame opt;
initStyleOption(&opt);
opt.rect = d->panelRect;
p.drawPrimitive(QStyle::PE_FrameTabWidget, opt);
diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h
index 702563127d..f12d584475 100644
--- a/src/widgets/widgets/qtabwidget.h
+++ b/src/widgets/widgets/qtabwidget.h
@@ -62,7 +62,7 @@ class Q_WIDGETS_EXPORT QTabWidget : public QWidget
Q_PROPERTY(bool tabBarAutoHide READ tabBarAutoHide WRITE setTabBarAutoHide)
public:
- explicit QTabWidget(QWidget *parent = 0);
+ explicit QTabWidget(QWidget *parent = Q_NULLPTR);
~QTabWidget();
int addTab(QWidget *widget, const QString &);
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index 9bf305a055..2c073342b0 100644
--- a/src/widgets/widgets/qtextbrowser.cpp
+++ b/src/widgets/widgets/qtextbrowser.cpp
@@ -139,6 +139,7 @@ public:
int lastKeypadScrollValue;
#endif
};
+Q_DECLARE_TYPEINFO(QTextBrowserPrivate::HistoryEntry, Q_MOVABLE_TYPE);
QString QTextBrowserPrivate::findFile(const QUrl &name) const
{
diff --git a/src/widgets/widgets/qtextbrowser.h b/src/widgets/widgets/qtextbrowser.h
index 4d4d9f4880..339814e948 100644
--- a/src/widgets/widgets/qtextbrowser.h
+++ b/src/widgets/widgets/qtextbrowser.h
@@ -57,7 +57,7 @@ class Q_WIDGETS_EXPORT QTextBrowser : public QTextEdit
Q_PROPERTY(bool openLinks READ openLinks WRITE setOpenLinks)
public:
- explicit QTextBrowser(QWidget* parent = 0);
+ explicit QTextBrowser(QWidget* parent = Q_NULLPTR);
virtual ~QTextBrowser();
QUrl source() const;
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 689f45bea9..88b7444daa 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -94,8 +94,8 @@ public:
Q_DECLARE_FLAGS(AutoFormatting, AutoFormattingFlag)
- explicit QTextEdit(QWidget *parent = 0);
- explicit QTextEdit(const QString &text, QWidget *parent = 0);
+ explicit QTextEdit(QWidget *parent = Q_NULLPTR);
+ explicit QTextEdit(const QString &text, QWidget *parent = Q_NULLPTR);
virtual ~QTextEdit();
void setDocument(QTextDocument *document);
@@ -153,9 +153,9 @@ public:
QTextOption::WrapMode wordWrapMode() const;
void setWordWrapMode(QTextOption::WrapMode policy);
- bool find(const QString &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QString &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
#ifndef QT_NO_REGEXP
- bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QRegExp &exp, QTextDocument::FindFlags options = QTextDocument::FindFlags());
#endif
QString toPlainText() const;
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index ecba6f1974..1e4a39088c 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -793,6 +793,82 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text,
return action;
}
+/*!\fn QAction *QToolBar::addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method)
+
+ \since 5.6
+
+ \overload
+
+ Creates a new action with the given \a text. This action is added to
+ the end of the toolbar. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a method of the \a receiver.
+*/
+
+/*!\fn QAction *QToolBar::addAction(const QString &text, Functor functor)
+
+ \since 5.6
+
+ \overload
+
+ Creates a new action with the given \a text. This action is added to
+ the end of the toolbar. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor.
+*/
+
+/*!\fn QAction *QToolBar::addAction(const QString &text, const QObject *context, Functor functor)
+
+ \since 5.6
+
+ \overload
+
+ Creates a new action with the given \a text. This action is added to
+ the end of the toolbar. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor.
+
+ If \a context is destroyed, the functor will not be called.
+*/
+
+/*!\fn QAction *QToolBar::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method)
+
+ \since 5.6
+
+ \overload
+
+ Creates a new action with the given \a icon and \a text. This
+ action is added to the end of the toolbar. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a method of the \a receiver.
+*/
+
+/*!\fn QAction *QToolBar::addAction(const QIcon &icon, const QString &text, Functor functor)
+
+ \since 5.6
+
+ \overload
+
+ Creates a new action with the given \a icon and \a text. This
+ action is added to the end of the toolbar. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor.
+*/
+
+/*!\fn QAction *QToolBar::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor)
+
+ \since 5.6
+
+ \overload
+
+ Creates a new action with the given \a icon and \a text. This
+ action is added to the end of the toolbar. The action's
+ \l{QAction::triggered()}{triggered()} signal is connected to the
+ \a functor.
+
+ If \a context is destroyed, the functor will not be called.
+*/
+
/*!
Adds a separator to the end of the toolbar.
diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
index f925577646..9eeb7ccd71 100644
--- a/src/widgets/widgets/qtoolbar.h
+++ b/src/widgets/widgets/qtoolbar.h
@@ -34,6 +34,7 @@
#ifndef QDYNAMICTOOLBAR_H
#define QDYNAMICTOOLBAR_H
+#include <QtWidgets/qaction.h>
#include <QtWidgets/qwidget.h>
QT_BEGIN_NAMESPACE
@@ -68,8 +69,8 @@ class Q_WIDGETS_EXPORT QToolBar : public QWidget
Q_PROPERTY(bool floatable READ isFloatable WRITE setFloatable)
public:
- explicit QToolBar(const QString &title, QWidget *parent = 0);
- explicit QToolBar(QWidget *parent = 0);
+ explicit QToolBar(const QString &title, QWidget *parent = Q_NULLPTR);
+ explicit QToolBar(QWidget *parent = Q_NULLPTR);
~QToolBar();
void setMovable(bool movable);
@@ -92,6 +93,51 @@ public:
QAction *addAction(const QString &text, const QObject *receiver, const char* member);
QAction *addAction(const QIcon &icon, const QString &text,
const QObject *receiver, const char* member);
+#ifdef Q_QDOC
+ QAction *addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method);
+ QAction *addAction(const QString &text, Functor functor);
+ QAction *addAction(const QString &text, const QObject *context, Functor functor);
+ QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method);
+ QAction *addAction(const QIcon &icon, const QString &text, Functor functor);
+ QAction *addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor);
+#else
+ // addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
+ template<class Obj, typename Func1>
+ inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+ addAction(const QString &text, const Obj *object, Func1 slot)
+ {
+ QAction *result = addAction(text);
+ connect(result, &QAction::triggered, object, slot);
+ return result;
+ }
+ // addAction(QString): Connect to a functor or function pointer (without context)
+ template <typename Func1>
+ inline QAction *addAction(const QString &text, Func1 slot)
+ {
+ QAction *result = addAction(text);
+ connect(result, &QAction::triggered, slot);
+ return result;
+ }
+ // addAction(QString): Connect to a QObject slot / functor or function pointer (with context)
+ template<class Obj, typename Func1>
+ inline typename QtPrivate::QEnableIf<!QtPrivate::is_same<const char*, Func1>::value
+ && QtPrivate::IsPointerToTypeDerivedFromQObject<Obj*>::Value, QAction *>::Type
+ addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot)
+ {
+ QAction *result = addAction(actionIcon, text);
+ connect(result, &QAction::triggered, object, slot);
+ return result;
+ }
+ // addAction(QIcon, QString): Connect to a functor or function pointer (without context)
+ template <typename Func1>
+ inline QAction *addAction(const QIcon &actionIcon, const QString &text, Func1 slot)
+ {
+ QAction *result = addAction(actionIcon, text);
+ connect(result, &QAction::triggered, slot);
+ return result;
+ }
+#endif // !Q_QDOC
QAction *addSeparator();
QAction *insertSeparator(QAction *before);
diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp
index 89e3da1383..16b1115dd6 100644
--- a/src/widgets/widgets/qtoolbararealayout.cpp
+++ b/src/widgets/widgets/qtoolbararealayout.cpp
@@ -1129,7 +1129,7 @@ QLayoutItem *QToolBarAreaLayout::plug(const QList<int> &path)
{
QToolBarAreaLayoutItem *item = this->item(path);
if (!item) {
- qWarning() << Q_FUNC_INFO << "No item at" << path;
+ qWarning() << "No item at" << path;
return 0;
}
Q_ASSERT(item->gap);
diff --git a/src/widgets/widgets/qtoolbarlayout.cpp b/src/widgets/widgets/qtoolbarlayout.cpp
index d478b028a6..42fd93fda2 100644
--- a/src/widgets/widgets/qtoolbarlayout.cpp
+++ b/src/widgets/widgets/qtoolbarlayout.cpp
@@ -153,7 +153,7 @@ void QToolBarLayout::checkUsePopupMenu()
void QToolBarLayout::addItem(QLayoutItem*)
{
- qWarning() << "QToolBarLayout::addItem(): please use addAction() instead";
+ qWarning("QToolBarLayout::addItem(): please use addAction() instead");
return;
}
diff --git a/src/widgets/widgets/qtoolbox.cpp b/src/widgets/widgets/qtoolbox.cpp
index 32fcdc3665..beb70f1283 100644
--- a/src/widgets/widgets/qtoolbox.cpp
+++ b/src/widgets/widgets/qtoolbox.cpp
@@ -206,26 +206,24 @@ void QToolBoxButton::initStyleOption(QStyleOptionToolBox *option) const
option->text = text();
option->icon = icon();
- if (QStyleOptionToolBoxV2 *optionV2 = qstyleoption_cast<QStyleOptionToolBoxV2 *>(option)) {
- QToolBox *toolBox = static_cast<QToolBox *>(parentWidget()); // I know I'm in a tool box.
- int widgetCount = toolBox->count();
- int currIndex = toolBox->currentIndex();
- if (widgetCount == 1) {
- optionV2->position = QStyleOptionToolBoxV2::OnlyOneTab;
- } else if (indexInPage == 0) {
- optionV2->position = QStyleOptionToolBoxV2::Beginning;
- } else if (indexInPage == widgetCount - 1) {
- optionV2->position = QStyleOptionToolBoxV2::End;
- } else {
- optionV2->position = QStyleOptionToolBoxV2::Middle;
- }
- if (currIndex == indexInPage - 1) {
- optionV2->selectedPosition = QStyleOptionToolBoxV2::PreviousIsSelected;
- } else if (currIndex == indexInPage + 1) {
- optionV2->selectedPosition = QStyleOptionToolBoxV2::NextIsSelected;
- } else {
- optionV2->selectedPosition = QStyleOptionToolBoxV2::NotAdjacent;
- }
+ QToolBox *toolBox = static_cast<QToolBox *>(parentWidget()); // I know I'm in a tool box.
+ const int widgetCount = toolBox->count();
+ const int currIndex = toolBox->currentIndex();
+ if (widgetCount == 1) {
+ option->position = QStyleOptionToolBox::OnlyOneTab;
+ } else if (indexInPage == 0) {
+ option->position = QStyleOptionToolBox::Beginning;
+ } else if (indexInPage == widgetCount - 1) {
+ option->position = QStyleOptionToolBox::End;
+ } else {
+ option->position = QStyleOptionToolBox::Middle;
+ }
+ if (currIndex == indexInPage - 1) {
+ option->selectedPosition = QStyleOptionToolBox::PreviousIsSelected;
+ } else if (currIndex == indexInPage + 1) {
+ option->selectedPosition = QStyleOptionToolBox::NextIsSelected;
+ } else {
+ option->selectedPosition = QStyleOptionToolBox::NotAdjacent;
}
}
@@ -233,7 +231,7 @@ void QToolBoxButton::paintEvent(QPaintEvent *)
{
QPainter paint(this);
QPainter *p = &paint;
- QStyleOptionToolBoxV2 opt;
+ QStyleOptionToolBox opt;
initStyleOption(&opt);
style()->drawControl(QStyle::CE_ToolBoxTab, &opt, p, parentWidget());
}
diff --git a/src/widgets/widgets/qtoolbox.h b/src/widgets/widgets/qtoolbox.h
index cff5ae09ae..42b06e205c 100644
--- a/src/widgets/widgets/qtoolbox.h
+++ b/src/widgets/widgets/qtoolbox.h
@@ -51,7 +51,7 @@ class Q_WIDGETS_EXPORT QToolBox : public QFrame
Q_PROPERTY(int count READ count)
public:
- explicit QToolBox(QWidget *parent = 0, Qt::WindowFlags f = 0);
+ explicit QToolBox(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~QToolBox();
int addItem(QWidget *widget, const QString &text);
diff --git a/src/widgets/widgets/qtoolbutton.h b/src/widgets/widgets/qtoolbutton.h
index 69ad032324..c76f58577b 100644
--- a/src/widgets/widgets/qtoolbutton.h
+++ b/src/widgets/widgets/qtoolbutton.h
@@ -64,7 +64,7 @@ public:
};
Q_ENUM(ToolButtonPopupMode)
- explicit QToolButton(QWidget * parent=0);
+ explicit QToolButton(QWidget *parent = Q_NULLPTR);
~QToolButton();
QSize sizeHint() const Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 759e41a5fa..436937be72 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -189,7 +189,7 @@ void QWidgetLineControl::commitPreedit()
m_preeditCursor = 0;
setPreeditArea(-1, QString());
- m_textLayout.clearAdditionalFormats();
+ m_textLayout.clearFormats();
updateDisplayText(/*force*/ true);
#endif
}
@@ -557,7 +557,8 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event)
const int oldPreeditCursor = m_preeditCursor;
m_preeditCursor = event->preeditString().length();
m_hideCursor = false;
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
+ formats.reserve(event->attributes().size());
for (int i = 0; i < event->attributes().size(); ++i) {
const QInputMethodEvent::Attribute &a = event->attributes().at(i);
if (a.type == QInputMethodEvent::Cursor) {
@@ -574,7 +575,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event)
}
}
}
- m_textLayout.setAdditionalFormats(formats);
+ m_textLayout.setFormats(formats);
updateDisplayText(/*force*/ true);
if (cursorPositionChanged)
emitCursorPositionChanged();
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 72007ac3e8..deca002bf5 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -883,7 +883,8 @@ void QWidgetTextControl::setTextCursor(const QTextCursor &cursor)
const bool posChanged = cursor.position() != d->cursor.position();
const QTextCursor oldSelection = d->cursor;
d->cursor = cursor;
- d->cursorOn = d->hasFocus && (d->interactionFlags & Qt::TextEditable);
+ d->cursorOn = d->hasFocus
+ && (d->interactionFlags & (Qt::TextSelectableByKeyboard | Qt::TextEditable));
d->_q_updateCurrentCharFormatAndSelection();
ensureCursorVisible();
d->repaintOldAndNewSelection(oldSelection);
@@ -2028,7 +2029,8 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
QTextLayout *layout = block.layout();
if (isGettingInput)
layout->setPreeditArea(cursor.position() - block.position(), e->preeditString());
- QList<QTextLayout::FormatRange> overrides;
+ QVector<QTextLayout::FormatRange> overrides;
+ overrides.reserve(e->attributes().size());
const int oldPreeditCursor = preeditCursor;
preeditCursor = e->preeditString().length();
hideCursor = false;
@@ -2048,7 +2050,7 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
}
}
}
- layout->setAdditionalFormats(overrides);
+ layout->setFormats(overrides);
cursor.endEditBlock();
@@ -2138,7 +2140,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason))) {
#endif
- cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard);
+ cursorOn = (interactionFlags & (Qt::TextSelectableByKeyboard | Qt::TextEditable));
if (interactionFlags & Qt::TextEditable) {
setBlinkingCursorEnabled(true);
}
@@ -2437,10 +2439,13 @@ QList<QTextEdit::ExtraSelection> QWidgetTextControl::extraSelections() const
{
Q_D(const QWidgetTextControl);
QList<QTextEdit::ExtraSelection> selections;
- for (int i = 0; i < d->extraSelections.count(); ++i) {
+ const int numExtraSelections = d->extraSelections.count();
+ selections.reserve(numExtraSelections);
+ for (int i = 0; i < numExtraSelections; ++i) {
QTextEdit::ExtraSelection sel;
- sel.cursor = d->extraSelections.at(i).cursor;
- sel.format = d->extraSelections.at(i).format;
+ const QAbstractTextDocumentLayout::Selection &sel2 = d->extraSelections.at(i);
+ sel.cursor = sel2.cursor;
+ sel.format = sel2.format;
selections.append(sel);
}
return selections;
@@ -2877,7 +2882,7 @@ void QWidgetTextControlPrivate::commitPreedit()
QTextBlock block = cursor.block();
QTextLayout *layout = block.layout();
layout->setPreeditArea(-1, QString());
- layout->clearAdditionalFormats();
+ layout->clearFormats();
cursor.endEditBlock();
}
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp
index 141e3ed135..9e5f206ea5 100644
--- a/src/winmain/qtmain_winrt.cpp
+++ b/src/winmain/qtmain_winrt.cpp
@@ -49,38 +49,45 @@
entry point within the newly created GUI thread.
*/
+#if _MSC_VER < 1900
#include <new.h>
typedef struct
{
int newmode;
} _startupinfo;
+#endif // _MSC_VER < 1900
extern "C" {
+#if _MSC_VER < 1900
int __getmainargs(int *argc, char ***argv, char ***env, int expandWildcards, _startupinfo *info);
+#endif
int main(int, char **);
}
#include <qbytearray.h>
#include <qstring.h>
-#include <qlist.h>
-#include <qvector.h>
#include <qdir.h>
#include <qstandardpaths.h>
+#include <qfunctions_winrt.h>
+#include <qcoreapplication.h>
#include <wrl.h>
#include <Windows.ApplicationModel.core.h>
+#include <windows.ui.xaml.h>
+#include <windows.ui.xaml.controls.h>
using namespace ABI::Windows::ApplicationModel;
+using namespace ABI::Windows::ApplicationModel::Activation;
+using namespace ABI::Windows::ApplicationModel::Core;
using namespace ABI::Windows::Foundation;
+using namespace ABI::Windows::UI;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
#define qHString(x) Wrappers::HString::MakeReference(x).Get()
#define CoreApplicationClass RuntimeClass_Windows_ApplicationModel_Core_CoreApplication
-typedef ITypedEventHandler<Core::CoreApplicationView *, Activation::IActivatedEventArgs *> ActivatedHandler;
-
-static int g_mainExitCode;
+typedef ITypedEventHandler<CoreApplicationView *, Activation::IActivatedEventArgs *> ActivatedHandler;
static QtMessageHandler defaultMessageHandler;
static void devMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
@@ -103,53 +110,157 @@ static void devMessageHandler(QtMsgType type, const QMessageLogContext &context,
defaultMessageHandler(type, context, message);
}
-class AppContainer : public Microsoft::WRL::RuntimeClass<Core::IFrameworkView>
+class QActivationEvent : public QEvent
{
public:
- AppContainer(int argc, char *argv[]) : m_argc(argc), m_deleteArgv0(false)
+ explicit QActivationEvent(IInspectable *args)
+ : QEvent(QEvent::WinEventAct)
{
- m_argv.reserve(argc);
- for (int i = 0; i < argc; ++i) {
- // Workaround for empty argv[0] which occurs when WMAppManifest's ImageParams is used
- // The second argument is taken to be the executable
- if (i == 0 && argc >= 2 && !qstrlen(argv[0])) {
- const QByteArray argv0 = QDir::current()
- .absoluteFilePath(QString::fromLatin1(argv[1])).toUtf8();
- m_argv.append(qstrdup(argv0.constData()));
- m_argc -= 1;
- m_deleteArgv0 = true;
- ++i;
- continue;
- }
- m_argv.append(argv[i]);
- }
+ setAccepted(false);
+ args->AddRef();
+ d = reinterpret_cast<QEventPrivate *>(args);
+ }
+
+ ~QActivationEvent() {
+ IUnknown *args = reinterpret_cast<IUnknown *>(d);
+ args->Release();
+ d = nullptr;
+ }
+};
+
+class AppContainer : public RuntimeClass<Xaml::IApplicationOverrides>
+{
+public:
+ AppContainer()
+ {
+ ComPtr<Xaml::IApplicationFactory> applicationFactory;
+ HRESULT hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_Xaml_Application).Get(),
+ IID_PPV_ARGS(&applicationFactory));
+ Q_ASSERT_SUCCEEDED(hr);
+
+ hr = applicationFactory->CreateInstance(this, &base, &core);
+ RETURN_VOID_IF_FAILED("Failed to create application container instance");
+
+ pidFile = INVALID_HANDLE_VALUE;
}
~AppContainer()
{
- if (m_deleteArgv0)
- delete[] m_argv[0];
- for (int i = m_argc; i < m_argv.size(); ++i)
- delete[] m_argv[i];
}
- // IFrameworkView Methods
- HRESULT __stdcall Initialize(Core::ICoreApplicationView *view)
+ int exec(int argc, char **argv)
+ {
+ args.reserve(argc);
+ for (int i = 0; i < argc; ++i)
+ args.append(argv[i]);
+
+ mainThread = CreateThread(NULL, 0, [](void *param) -> DWORD {
+ AppContainer *app = reinterpret_cast<AppContainer *>(param);
+ int argc = app->args.count();
+ char **argv = app->args.data();
+ const int res = main(argc, argv);
+ if (app->pidFile != INVALID_HANDLE_VALUE) {
+ const QByteArray resString = QByteArray::number(res);
+ WriteFile(app->pidFile, reinterpret_cast<LPCVOID>(resString.constData()),
+ resString.size(), NULL, NULL);
+ FlushFileBuffers(app->pidFile);
+ CloseHandle(app->pidFile);
+ }
+ app->core->Exit();
+ return res;
+ }, this, CREATE_SUSPENDED, nullptr);
+
+ HRESULT hr;
+ ComPtr<Xaml::IApplicationStatics> appStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_Xaml_Application).Get(),
+ IID_PPV_ARGS(&appStatics));
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = appStatics->Start(Callback<Xaml::IApplicationInitializationCallback>([](Xaml::IApplicationInitializationCallbackParams *) {
+ return S_OK;
+ }).Get());
+ Q_ASSERT_SUCCEEDED(hr);
+
+ WaitForSingleObjectEx(mainThread, INFINITE, FALSE);
+ DWORD exitCode;
+ GetExitCodeThread(mainThread, &exitCode);
+ return exitCode;
+ }
+
+private:
+ HRESULT __stdcall OnActivated(IActivatedEventArgs *args) Q_DECL_OVERRIDE
{
- view->add_Activated(Callback<ActivatedHandler>(this, &AppContainer::onActivated).Get(),
- &m_activationToken);
+ QAbstractEventDispatcher *dispatcher = QCoreApplication::eventDispatcher();
+ if (dispatcher)
+ QCoreApplication::postEvent(dispatcher, new QActivationEvent(args));
return S_OK;
}
- HRESULT __stdcall SetWindow(ABI::Windows::UI::Core::ICoreWindow *) { return S_OK; }
- HRESULT __stdcall Load(HSTRING) { return S_OK; }
- HRESULT __stdcall Run()
+
+ HRESULT __stdcall OnLaunched(ILaunchActivatedEventArgs *launchArgs) Q_DECL_OVERRIDE
{
+#if _MSC_VER >= 1900
+ ComPtr<IPrelaunchActivatedEventArgs> preArgs;
+ HRESULT hr = launchArgs->QueryInterface(preArgs.GetAddressOf());
+ if (SUCCEEDED(hr)) {
+ boolean prelaunched;
+ preArgs->get_PrelaunchActivated(&prelaunched);
+ if (prelaunched)
+ return S_OK;
+ }
+
+ commandLine = QString::fromWCharArray(GetCommandLine()).toUtf8();
+#endif
+ HString launchCommandLine;
+ launchArgs->get_Arguments(launchCommandLine.GetAddressOf());
+ if (launchCommandLine.IsValid()) {
+ quint32 launchCommandLineLength;
+ const wchar_t *launchCommandLineBuffer = launchCommandLine.GetRawBuffer(&launchCommandLineLength);
+ if (!commandLine.isEmpty() && launchCommandLineLength)
+ commandLine += ' ';
+ if (launchCommandLineLength)
+ commandLine += QString::fromWCharArray(launchCommandLineBuffer, launchCommandLineLength).toUtf8();
+ }
+ if (!commandLine.isEmpty())
+ args.append(commandLine.data());
+
+ bool quote = false;
+ bool escape = false;
+ for (int i = 0; i < commandLine.size(); ++i) {
+ switch (commandLine.at(i)) {
+ case '\\':
+ escape = true;
+ break;
+ case '"':
+ if (escape) {
+ escape = false;
+ break;
+ }
+ quote = !quote;
+ commandLine[i] = '\0';
+ break;
+ case ' ':
+ if (quote)
+ break;
+ commandLine[i] = '\0';
+ if (args.last()[0] != '\0')
+ args.append(commandLine.data() + i + 1);
+ // fall through
+ default:
+ if (args.last()[0] == '\0')
+ args.last() = commandLine.data() + i;
+ escape = false; // only quotes are escaped
+ break;
+ }
+ }
+
+ if (args.count() >= 2 && strncmp(args.at(1), "-ServerName:", 12) == 0)
+ args.remove(1);
+
bool develMode = false;
bool debugWait = false;
- foreach (const QByteArray &arg, m_argv) {
- if (arg == "-qdevel")
+ foreach (const char *arg, args) {
+ if (strcmp(arg, "-qdevel") == 0)
develMode = true;
- if (arg == "-qdebug")
+ if (strcmp(arg, "-qdebug") == 0)
debugWait = true;
}
if (develMode) {
@@ -158,11 +269,10 @@ public:
.absoluteFilePath(QString::number(uint(GetCurrentProcessId())) + QStringLiteral(".pid"));
CREATEFILE2_EXTENDED_PARAMETERS params = {
sizeof(CREATEFILE2_EXTENDED_PARAMETERS),
- FILE_ATTRIBUTE_NORMAL, FILE_FLAG_DELETE_ON_CLOSE
+ FILE_ATTRIBUTE_NORMAL
};
- // (Unused) handle will automatically be closed when the app exits
- CreateFile2(reinterpret_cast<LPCWSTR>(pidFileName.utf16()),
- 0, FILE_SHARE_READ|FILE_SHARE_DELETE, CREATE_ALWAYS, &params);
+ pidFile = CreateFile2(reinterpret_cast<LPCWSTR>(pidFileName.utf16()),
+ GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, &params);
// Install the develMode message handler
#ifndef Q_OS_WINPHONE
defaultMessageHandler = qInstallMessageHandler(devMessageHandler);
@@ -173,98 +283,71 @@ public:
while (!IsDebuggerPresent())
WaitForSingleObjectEx(GetCurrentThread(), 1, true);
}
- g_mainExitCode = main(m_argv.count(), m_argv.data());
+
+ ResumeThread(mainThread);
return S_OK;
}
- HRESULT __stdcall Uninitialize() { return S_OK; }
-private:
- // Activation handler
- HRESULT onActivated(Core::ICoreApplicationView *, Activation::IActivatedEventArgs *args)
+ HRESULT __stdcall OnFileActivated(IFileActivatedEventArgs *args) Q_DECL_OVERRIDE
{
- Activation::ILaunchActivatedEventArgs *launchArgs;
- if (SUCCEEDED(args->QueryInterface(&launchArgs))) {
- for (int i = m_argc; i < m_argv.size(); ++i)
- delete[] m_argv[i];
- m_argv.resize(m_argc);
- HString arguments;
- launchArgs->get_Arguments(arguments.GetAddressOf());
- if (arguments.IsValid()) {
- foreach (const QByteArray &arg, QString::fromWCharArray(
- arguments.GetRawBuffer(nullptr)).toLocal8Bit().split(' ')) {
- m_argv.append(qstrdup(arg.constData()));
- }
- }
- }
+ Q_UNUSED(args);
return S_OK;
}
- int m_argc;
- QVector<char *> m_argv;
- bool m_deleteArgv0;
- EventRegistrationToken m_activationToken;
-};
+ HRESULT __stdcall OnSearchActivated(ISearchActivatedEventArgs *args) Q_DECL_OVERRIDE
+ {
+ Q_UNUSED(args);
+ return S_OK;
+ }
-class AppViewSource : public Microsoft::WRL::RuntimeClass<Core::IFrameworkViewSource>
-{
-public:
- AppViewSource(int argc, char **argv) : m_argc(argc), m_argv(argv) { }
- HRESULT __stdcall CreateView(Core::IFrameworkView **frameworkView)
+ HRESULT __stdcall OnShareTargetActivated(IShareTargetActivatedEventArgs *args) Q_DECL_OVERRIDE
+ {
+ Q_UNUSED(args);
+ return S_OK;
+ }
+
+ HRESULT __stdcall OnFileOpenPickerActivated(IFileOpenPickerActivatedEventArgs *args) Q_DECL_OVERRIDE
{
- return (*frameworkView = Make<AppContainer>(m_argc, m_argv).Detach()) ? S_OK : E_OUTOFMEMORY;
+ Q_UNUSED(args);
+ return S_OK;
}
-private:
- int m_argc;
- char **m_argv;
+
+ HRESULT __stdcall OnFileSavePickerActivated(IFileSavePickerActivatedEventArgs *args) Q_DECL_OVERRIDE
+ {
+ Q_UNUSED(args);
+ return S_OK;
+ }
+
+ HRESULT __stdcall OnCachedFileUpdaterActivated(ICachedFileUpdaterActivatedEventArgs *args) Q_DECL_OVERRIDE
+ {
+ Q_UNUSED(args);
+ return S_OK;
+ }
+
+ HRESULT __stdcall OnWindowCreated(Xaml::IWindowCreatedEventArgs *args) Q_DECL_OVERRIDE
+ {
+ Q_UNUSED(args);
+ return S_OK;
+ }
+
+ ComPtr<Xaml::IApplicationOverrides> base;
+ ComPtr<Xaml::IApplication> core;
+ QByteArray commandLine;
+ QVarLengthArray<char *> args;
+ HANDLE mainThread;
+ HANDLE pidFile;
};
// Main entry point for Appx containers
int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
-#if _MSC_VER < 1900
int argc = 0;
- char **argv, **env;
+ char **argv = 0, **env = 0;
+#if _MSC_VER < 1900
_startupinfo info = { _query_new_mode() };
if (int init = __getmainargs(&argc, &argv, &env, false, &info))
return init;
-#else
- QByteArray commandLine = QString::fromWCharArray(GetCommandLine()).toUtf8();
- QVarLengthArray<char *> args;
- args.append(commandLine.data());
- bool quote = false;
- bool escape = false;
- for (int i = 0; i < commandLine.size(); ++i) {
- switch (commandLine.at(i)) {
- case '\\':
- escape = true;
- break;
- case '"':
- if (escape) {
- escape = false;
- break;
- }
- quote = !quote;
- commandLine[i] = '\0';
- break;
- case ' ':
- if (quote)
- break;
- commandLine[i] = '\0';
- if (args.last()[0] != '\0')
- args.append(commandLine.data() + i + 1);
- // fall through
- default:
- if (args.last()[0] == '\0')
- args.last() = commandLine.data() + i;
- escape = false; // only quotes are escaped
- break;
- }
- }
- int argc = args.size();
- char **argv = args.data();
- char **env = Q_NULLPTR;
#endif // _MSC_VER >= 1900
-
for (int i = 0; env && env[i]; ++i) {
QByteArray var(env[i]);
int split = var.indexOf('=');
@@ -275,10 +358,6 @@ int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
if (FAILED(RoInitialize(RO_INIT_MULTITHREADED)))
return 1;
- Core::ICoreApplication *appFactory;
- if (FAILED(RoGetActivationFactory(qHString(CoreApplicationClass), IID_PPV_ARGS(&appFactory))))
- return 2;
-
- appFactory->Run(Make<AppViewSource>(argc, argv).Get());
- return g_mainExitCode;
+ ComPtr<AppContainer> app = Make<AppContainer>();
+ return app->exec(argc, argv);
}
diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf
index a23915487f..b31c2a18d2 100644
--- a/src/xml/doc/qtxml.qdocconf
+++ b/src/xml/doc/qtxml.qdocconf
@@ -4,7 +4,7 @@ project = QtXml
description = Qt XML Reference Documentation
version = $QT_VERSION
-examplesinstallpath = xml
+examplesinstallpath = qtbase/xml
qhp.projects = QtXml
diff --git a/src/xml/doc/snippets/rsslisting/handler.cpp b/src/xml/doc/snippets/rsslisting/handler.cpp
index 4825cf2f62..27e4a23fb4 100644
--- a/src/xml/doc/snippets/rsslisting/handler.cpp
+++ b/src/xml/doc/snippets/rsslisting/handler.cpp
@@ -174,7 +174,7 @@ bool Handler::characters (const QString &chars)
bool Handler::fatalError (const QXmlParseException & exception)
{
qWarning() << "Fatal error on line" << exception.lineNumber()
- << ", column" << exception.columnNumber() << ":"
+ << ", column" << exception.columnNumber() << ':'
<< exception.message();
return false;
diff --git a/src/xml/doc/snippets/simpleparse/main.cpp b/src/xml/doc/snippets/simpleparse/main.cpp
index 480dc1c528..cbb8ac96aa 100644
--- a/src/xml/doc/snippets/simpleparse/main.cpp
+++ b/src/xml/doc/snippets/simpleparse/main.cpp
@@ -78,7 +78,7 @@ int main(int argc, char **argv)
for (int i = 0; i < items; ++i) {
for (int j = 0; j < indentations[i]; ++j)
- std::cout << " ";
+ std::cout << ' ';
std::cout << names[i].toLocal8Bit().constData() << std::endl;
}
}
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 943d5c28a4..5e4946a814 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -3142,7 +3142,7 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::removeNamedItem(const QString& name)
QDomNodePrivate* QDomNamedNodeMapPrivate::item(int index) const
{
- if (index >= length())
+ if (index >= length() || index < 0)
return 0;
return *(map.constBegin() + index);
}
diff --git a/src/xml/dom/qdom.h b/src/xml/dom/qdom.h
index 5a83659e5c..f2bcf83e2b 100644
--- a/src/xml/dom/qdom.h
+++ b/src/xml/dom/qdom.h
@@ -329,14 +329,14 @@ public:
inline QDomNode::NodeType nodeType() const { return DocumentNode; }
// Qt extensions
- bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(const QByteArray& text, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(const QString& text, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(QIODevice* dev, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
- bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 );
+ bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(const QByteArray& text, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(const QString& text, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(QIODevice* dev, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
// Qt extensions
QString toString(int = 1) const;
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index 8e382f76f6..97a3b070d8 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -6457,7 +6457,7 @@ bool QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(QString *errorMessag
if (*expandedIt > entityCharacterLimit) {
if (errorMessage) {
*errorMessage = QString::fromLatin1("The XML entity \"%1\" expands to a string that is too large to process (%2 characters > %3).")
- .arg(entity, *expandedIt, entityCharacterLimit);
+ .arg(entity, QString::number(*expandedIt), QString::number(entityCharacterLimit));
}
return true;
}
diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h
index d7285fc289..6bb9bfbe9c 100644
--- a/src/xml/sax/qxml.h
+++ b/src/xml/sax/qxml.h
@@ -201,10 +201,10 @@ class Q_XML_EXPORT QXmlReader
{
public:
virtual ~QXmlReader() {}
- virtual bool feature(const QString& name, bool *ok = 0) const = 0;
+ virtual bool feature(const QString& name, bool *ok = Q_NULLPTR) const = 0;
virtual void setFeature(const QString& name, bool value) = 0;
virtual bool hasFeature(const QString& name) const = 0;
- virtual void* property(const QString& name, bool *ok = 0) const = 0;
+ virtual void* property(const QString& name, bool *ok = Q_NULLPTR) const = 0;
virtual void setProperty(const QString& name, void* value) = 0;
virtual bool hasProperty(const QString& name) const = 0;
virtual void setEntityResolver(QXmlEntityResolver* handler) = 0;
@@ -229,11 +229,11 @@ public:
QXmlSimpleReader();
virtual ~QXmlSimpleReader();
- bool feature(const QString& name, bool *ok = 0) const Q_DECL_OVERRIDE;
+ bool feature(const QString& name, bool *ok = Q_NULLPTR) const Q_DECL_OVERRIDE;
void setFeature(const QString& name, bool value) Q_DECL_OVERRIDE;
bool hasFeature(const QString& name) const Q_DECL_OVERRIDE;
- void* property(const QString& name, bool *ok = 0) const Q_DECL_OVERRIDE;
+ void* property(const QString& name, bool *ok = Q_NULLPTR) const Q_DECL_OVERRIDE;
void setProperty(const QString& name, void* value) Q_DECL_OVERRIDE;
bool hasProperty(const QString& name) const Q_DECL_OVERRIDE;
diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h
index 7712b5760c..013c2618a3 100644
--- a/src/xml/sax/qxml_p.h
+++ b/src/xml/sax/qxml_p.h
@@ -104,6 +104,7 @@ private:
QString value;
int index;
};
+ friend class QTypeInfo<XmlRef>;
QStack<XmlRef> xmlRefStack;
// used for standalone declaration
@@ -166,6 +167,7 @@ private:
ParseFunction function;
int state;
};
+ friend class QTypeInfo<ParseState>;
QStack<ParseState> *parseStack;
// used in parseProlog()
@@ -294,6 +296,8 @@ private:
friend class QXmlSimpleReaderLocator;
friend class QDomHandler;
};
+Q_DECLARE_TYPEINFO(QXmlSimpleReaderPrivate::ParseState, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QXmlSimpleReaderPrivate::XmlRef, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
diff --git a/sync.profile b/sync.profile
index bf29ca6e26..bba0ff2b2f 100644
--- a/sync.profile
+++ b/sync.profile
@@ -16,7 +16,7 @@
"QtANGLE/GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2",
"QtANGLE/GLES3" => "!$basedir/src/3rdparty/angle/include/GLES3",
"QtANGLE/EGL" => "!$basedir/src/3rdparty/angle/include/EGL",
- "QtZlib" => "!$basedir/src/3rdparty/zlib",
+ "QtZlib" => "!>$basedir/src/corelib;$basedir/src/3rdparty/zlib",
"QtOpenGLExtensions" => "$basedir/src/openglextensions",
);
%moduleheaders = ( # restrict the module headers to those found in relative path
@@ -50,7 +50,7 @@
}
);
-@qpa_headers = ( qr/^qplatform/, qr/^qwindowsystem/ );
+@qpa_headers = ( qr/^(?!qplatformheaderhelper)qplatform/, qr/^qwindowsystem/ );
my @angle_headers = ('egl.h', 'eglext.h', 'eglplatform.h', 'gl2.h', 'gl2ext.h', 'gl2platform.h', 'ShaderLang.h', 'khrplatform.h');
my @internal_zlib_headers = ( "crc32.h", "deflate.h", "gzguts.h", "inffast.h", "inffixed.h", "inflate.h", "inftrees.h", "trees.h", "zutil.h" );
my @zlib_headers = ( "zconf.h", "zlib.h" );
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 6f06ba591f..9cab3c9e42 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -32,8 +32,11 @@ cross_compile: SUBDIRS -= tools
# Disable the QtDBus tests if we can't connect to the session bus
qtHaveModule(dbus) {
- !system("dbus-send --session --type=signal / local.AutotestCheck.Hello"): {
- warning("QtDBus is enabled but session bus is not available. Please check the installation.")
+ !system("dbus-send --session --type=signal / local.AutotestCheck.Hello >/dev/null 2>&1") {
+ contains(QT_CONFIG, dbus-linked): \
+ error("QtDBus is enabled but session bus is not available. Please check the installation.")
+ else: \
+ warning("QtDBus is enabled with runtime support, but session bus is not available. Skipping QtDBus tests.")
SUBDIRS -= dbus
}
} else {
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 25bc8a5e45..5248f75a84 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -50,7 +50,9 @@ include("${_Qt5CTestMacros}")
if(NOT ${CMAKE_VERSION} VERSION_LESS 2.8.9)
# Requires INCLUDE_DIRECTORIES target property in CMake 2.8.8
# and POSITION_INDEPENDENT_CODE target property in 2.8.9
- expect_pass(test_use_modules_function)
+ if (NOT NO_GUI)
+ expect_pass(test_use_modules_function)
+ endif()
expect_pass(test_umbrella_config)
else()
message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\" or \"test_umbrella_config\"")
@@ -127,7 +129,7 @@ if (QT_WITH_ANGLE OR (NOT WIN32 AND NOT APPLE AND NOT NO_EGL))
endif()
expect_pass(test_opengl_lib)
-if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+if (NOT CMAKE_VERSION VERSION_LESS 2.8.11 AND NOT NO_WIDGETS)
expect_pass(test_interface)
endif()
diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt
index a8af92da63..2af80ea448 100644
--- a/tests/auto/cmake/test_interface/CMakeLists.txt
+++ b/tests/auto/cmake/test_interface/CMakeLists.txt
@@ -8,6 +8,8 @@ find_package(Qt5Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
add_executable(test_interface_exe WIN32 main.cpp mainwindow.cpp)
# No need to specify include directories, compile definitions, the PIC flag, or to
diff --git a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
index c0fdfd6b9a..6b11c09e7b 100644
--- a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
+++ b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
@@ -9,5 +9,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
add_subdirectory(subdir1)
-add_executable(exe1 "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
-include_directories(${Qt5Core_INCLUDE_DIRS})
+add_executable(exe1 main.cpp)
+target_link_libraries(exe1 Qt5::Core)
diff --git a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
index 0c7a113f50..dfcc35d735 100644
--- a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
+++ b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
@@ -2,4 +2,4 @@
find_package(Qt5Core REQUIRED)
add_executable(exe2 "${CMAKE_CURRENT_SOURCE_DIR}/../main.cpp")
-include_directories(${Qt5Core_INCLUDE_DIRS})
+target_link_libraries(exe2 Qt5::Core)
diff --git a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
index 2b32a419e7..e2f72842f6 100644
--- a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
+++ b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
@@ -11,3 +11,4 @@ add_definitions(${Qt5Core_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
add_executable(myobject main.cpp)
+target_link_libraries(myobject Qt5::Core)
diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
index bfcdd9d1d7..be05c75054 100644
--- a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
+++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
@@ -12,5 +12,7 @@ add_executable(three three.cpp)
find_package(Qt5Core)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
qt5_use_modules(two Test)
qt5_use_modules(three Gui Test)
diff --git a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
index b5e3dee9a6..cadd4e82cd 100644
--- a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
+++ b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
@@ -1443,45 +1443,45 @@ void tst_QtConcurrentFilter::noDetach()
QVERIFY(l.isDetached());
QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::filtered(l, waitFilterfn).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::blockingFiltered(l, waitFilterfn);
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::filteredReduced(l, waitFilterfn, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::filter(l, waitFilterfn).waitForFinished();
if (!l.isDetached())
QEXPECT_FAIL("", "QTBUG-20688: Known unstable failure", Abort);
- QVERIFY(l.isDetached() == true);
- QVERIFY(ll.isDetached() == true);
+ QVERIFY(l.isDetached());
+ QVERIFY(ll.isDetached());
}
{
const QList<int> l = QList<int>() << 1;
QVERIFY(l.isDetached());
const QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::filtered(l, waitFilterfn).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::filteredReduced(l, waitFilterfn, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
}
}
diff --git a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
index 4e19124ca8..33941d8e90 100644
--- a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -2250,38 +2250,38 @@ void tst_QtConcurrentMap::noDetach()
QVERIFY(l.isDetached());
QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::mapped(l, mapper).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::mappedReduced(l, mapper, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::map(l, multiplyBy2Immutable).waitForFinished();
- QVERIFY(l.isDetached() == true);
- QVERIFY(ll.isDetached() == true);
+ QVERIFY(l.isDetached());
+ QVERIFY(ll.isDetached());
}
{
const QList<int> l = QList<int>() << 1;
QVERIFY(l.isDetached());
const QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::mapped(l, mapper).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::mappedReduced(l, mapper, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
}
}
diff --git a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
new file mode 100644
index 0000000000..3b2cd84749
--- /dev/null
+++ b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
@@ -0,0 +1,4 @@
+[multiplePauseAnimations]
+osx-10.9
+[pauseAndPropertyAnimations]
+*
diff --git a/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST b/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST
new file mode 100644
index 0000000000..a7e95b1e97
--- /dev/null
+++ b/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST
@@ -0,0 +1,4 @@
+[statesAndSignals:normal animation]
+windows
+[startBackwardWithoutEndValue]
+windows
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
new file mode 100644
index 0000000000..e11e4ae6fb
--- /dev/null
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
@@ -0,0 +1,4 @@
+[startGroupWithRunningChild]
+windows
+[finishWithUncontrolledAnimation]
+windows
diff --git a/tests/auto/corelib/global/qflags/qflags.pro b/tests/auto/corelib/global/qflags/qflags.pro
index 3f78bc045b..7602008e22 100644
--- a/tests/auto/corelib/global/qflags/qflags.pro
+++ b/tests/auto/corelib/global/qflags/qflags.pro
@@ -3,4 +3,5 @@ TARGET = tst_qflags
QT = core testlib
SOURCES = tst_qflags.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-contains(QT_CONFIG, c++11): CONFIG += c++11 c++14
+contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++14): CONFIG += c++14
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 69bf7598fc..00f70f5380 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -457,7 +457,7 @@ void tst_QGlobal::isEnum()
// fallback type traits implementation. Any compiler
// supported by Qt that supports C++0x class enums
// should also support the __is_enum intrinsic.
- QVERIFY(Q_IS_ENUM(isEnum_G) == true);
+ QVERIFY(Q_IS_ENUM(isEnum_G));
#endif
#undef IS_ENUM_TRUE
diff --git a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
index a1cfff7e85..e9fd999e9f 100644
--- a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
+++ b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
@@ -41,10 +41,17 @@
#include <QtCore/QThread>
#include <QtTest/QtTest>
+#if defined(Q_OS_UNIX)
+#include <sys/resource.h>
+#endif
+
class tst_QGlobalStatic : public QObject
{
Q_OBJECT
+public Q_SLOTS:
+ void initTestCase();
+
private Q_SLOTS:
void beforeInitialization();
void api();
@@ -55,6 +62,20 @@ private Q_SLOTS:
void afterDestruction();
};
+void tst_QGlobalStatic::initTestCase()
+{
+#if defined(Q_OS_UNIX)
+ // The tests create a lot of threads, which require file descriptors. On systems like
+ // OS X low defaults such as 256 as the limit for the number of simultaneously
+ // open files is not sufficient.
+ struct rlimit numFiles;
+ if (getrlimit(RLIMIT_NOFILE, &numFiles) == 0 && numFiles.rlim_cur < 1024) {
+ numFiles.rlim_cur = qMin(rlim_t(1024), numFiles.rlim_max);
+ setrlimit(RLIMIT_NOFILE, &numFiles);
+ }
+#endif
+}
+
Q_GLOBAL_STATIC_WITH_ARGS(const int, constInt, (42))
Q_GLOBAL_STATIC_WITH_ARGS(volatile int, volatileInt, (-47))
diff --git a/tests/auto/corelib/global/qlogging/qlogging.pro b/tests/auto/corelib/global/qlogging/qlogging.pro
index 4d3823cdbe..f1ca6570a0 100644
--- a/tests/auto/corelib/global/qlogging/qlogging.pro
+++ b/tests/auto/corelib/global/qlogging/qlogging.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS += \
- app \
- test
+!winrt: SUBDIRS += app
+
+SUBDIRS += test
diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro
index d4dce4a0c3..64a63ce28a 100644
--- a/tests/auto/corelib/global/qlogging/test/test.pro
+++ b/tests/auto/corelib/global/qlogging/test/test.pro
@@ -1,10 +1,11 @@
CONFIG += testcase parallel_test
CONFIG -= app_bundle debug_and_release_target
-contains(QT_CONFIG, c++11): CONFIG += c++11 c++14
+contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++14): CONFIG += c++14
TARGET = ../tst_qlogging
QT = core testlib
SOURCES = ../tst_qlogging.cpp
DEFINES += QT_MESSAGELOGCONTEXT
-TEST_HELPER_INSTALLS = ../app/app
+!winrt: TEST_HELPER_INSTALLS = ../app/app
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/global/qnumeric/qnumeric.pro b/tests/auto/corelib/global/qnumeric/qnumeric.pro
index 00f3635be9..0772ce6aab 100644
--- a/tests/auto/corelib/global/qnumeric/qnumeric.pro
+++ b/tests/auto/corelib/global/qnumeric/qnumeric.pro
@@ -1,6 +1,6 @@
CONFIG += testcase parallel_test
TARGET = tst_qnumeric
-QT = core testlib
+QT = core-private testlib
SOURCES = tst_qnumeric.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
intel_icc: QMAKE_CXXFLAGS += -fp-model strict
diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
index fdc8bc6aab..6be8ff81cf 100644
--- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
+++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
@@ -34,6 +34,7 @@
#include <QtTest/QtTest>
#include <QtGlobal>
+#include "private/qnumeric_p.h"
#include <math.h>
#include <float.h>
@@ -50,6 +51,10 @@ private slots:
void floatDistance();
void floatDistance_double_data();
void floatDistance_double();
+ void addOverflow_data();
+ void addOverflow();
+ void mulOverflow_data();
+ void mulOverflow();
};
void tst_QNumeric::fuzzyCompare_data()
@@ -206,5 +211,160 @@ void tst_QNumeric::floatDistance_double()
QCOMPARE(qFloatDistance(val1, val2), expectedDistance);
}
+void tst_QNumeric::addOverflow_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::newRow("quint8") << 8;
+ QTest::newRow("quint16") << 16;
+ QTest::newRow("quint32") << 32;
+ QTest::newRow("quint64") << 64;
+ QTest::newRow("ulong") << 48; // it's either 32- or 64-bit, so on average it's 48 :-)
+}
+
+// Note: in release mode, all the tests may be statically determined and only the calls
+// to QTest::toString and QTest::qCompare will remain.
+template <typename Int> static void addOverflow_template()
+{
+#if defined(Q_CC_MSVC) && Q_CC_MSVC < 2000
+ QSKIP("Test disabled, this test generates an Internal Compiler Error compiling in release mode");
+#else
+ const Int max = std::numeric_limits<Int>::max();
+ Int r;
+
+ // basic values
+ QCOMPARE(add_overflow(Int(0), Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(add_overflow(Int(1), Int(0), &r), false);
+ QCOMPARE(r, Int(1));
+ QCOMPARE(add_overflow(Int(0), Int(1), &r), false);
+ QCOMPARE(r, Int(1));
+
+ // half-way through max
+ QCOMPARE(add_overflow(Int(max/2), Int(max/2), &r), false);
+ QCOMPARE(r, Int(max / 2 * 2));
+ QCOMPARE(add_overflow(Int(max/2 - 1), Int(max/2 + 1), &r), false);
+ QCOMPARE(r, Int(max / 2 * 2));
+ QCOMPARE(add_overflow(Int(max/2 + 1), Int(max/2), &r), false);
+ QCOMPARE(r, max);
+ QCOMPARE(add_overflow(Int(max/2), Int(max/2 + 1), &r), false);
+ QCOMPARE(r, max);
+
+ // more than half
+ QCOMPARE(add_overflow(Int(max/4 * 3), Int(max/4), &r), false);
+ QCOMPARE(r, Int(max / 4 * 4));
+
+ // max
+ QCOMPARE(add_overflow(max, Int(0), &r), false);
+ QCOMPARE(r, max);
+ QCOMPARE(add_overflow(Int(0), max, &r), false);
+ QCOMPARE(r, max);
+
+ // 64-bit issues
+ if (max > std::numeric_limits<uint>::max()) {
+ QCOMPARE(add_overflow(Int(std::numeric_limits<uint>::max()), Int(std::numeric_limits<uint>::max()), &r), false);
+ QCOMPARE(r, Int(2 * Int(std::numeric_limits<uint>::max())));
+ }
+
+ // overflows
+ QCOMPARE(add_overflow(max, Int(1), &r), true);
+ QCOMPARE(add_overflow(Int(1), max, &r), true);
+ QCOMPARE(add_overflow(Int(max/2 + 1), Int(max/2 + 1), &r), true);
+#endif
+}
+
+void tst_QNumeric::addOverflow()
+{
+ QFETCH(int, size);
+ if (size == 8)
+ addOverflow_template<quint8>();
+ if (size == 16)
+ addOverflow_template<quint16>();
+ if (size == 32)
+ addOverflow_template<quint32>();
+ if (size == 48)
+ addOverflow_template<ulong>(); // not really 48-bit
+ if (size == 64)
+ addOverflow_template<quint64>();
+}
+
+void tst_QNumeric::mulOverflow_data()
+{
+ addOverflow_data();
+}
+
+// Note: in release mode, all the tests may be statically determined and only the calls
+// to QTest::toString and QTest::qCompare will remain.
+template <typename Int> static void mulOverflow_template()
+{
+#if defined(Q_CC_MSVC) && Q_CC_MSVC < 1900
+ QSKIP("Test disabled, this test generates an Internal Compiler Error compiling");
+#else
+ const Int max = std::numeric_limits<Int>::max();
+ const Int middle = Int(max >> (sizeof(Int) * CHAR_BIT / 2));
+ Int r;
+
+ // basic multiplications
+ QCOMPARE(mul_overflow(Int(0), Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(Int(1), Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(Int(0), Int(1), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(max, Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(Int(0), max, &r), false);
+ QCOMPARE(r, Int(0));
+
+ QCOMPARE(mul_overflow(Int(1), Int(1), &r), false);
+ QCOMPARE(r, Int(1));
+ QCOMPARE(mul_overflow(Int(1), max, &r), false);
+ QCOMPARE(r, max);
+ QCOMPARE(mul_overflow(max, Int(1), &r), false);
+ QCOMPARE(r, max);
+
+ // almost max
+ QCOMPARE(mul_overflow(middle, middle, &r), false);
+ QCOMPARE(r, Int(max - 2 * middle));
+ QCOMPARE(mul_overflow(Int(middle + 1), middle, &r), false);
+ QCOMPARE(r, Int(middle << (sizeof(Int) * CHAR_BIT / 2)));
+ QCOMPARE(mul_overflow(middle, Int(middle + 1), &r), false);
+ QCOMPARE(r, Int(middle << (sizeof(Int) * CHAR_BIT / 2)));
+ QCOMPARE(mul_overflow(Int(max / 2), Int(2), &r), false);
+ QCOMPARE(r, Int(max & ~Int(1)));
+ QCOMPARE(mul_overflow(Int(max / 4), Int(4), &r), false);
+ QCOMPARE(r, Int(max & ~Int(3)));
+
+ // overflows
+ QCOMPARE(mul_overflow(max, Int(2), &r), true);
+ QCOMPARE(mul_overflow(Int(max / 2), Int(3), &r), true);
+ QCOMPARE(mul_overflow(Int(middle + 1), Int(middle + 1), &r), true);
+#endif
+}
+
+template <typename Int, bool enabled = sizeof(Int) <= sizeof(void*)> struct MulOverflowDispatch;
+template <typename Int> struct MulOverflowDispatch<Int, true>
+{
+ void operator()() { mulOverflow_template<Int>(); }
+};
+template <typename Int> struct MulOverflowDispatch<Int, false>
+{
+ void operator()() { QSKIP("This type is too big for this architecture"); }
+};
+
+void tst_QNumeric::mulOverflow()
+{
+ QFETCH(int, size);
+ if (size == 8)
+ MulOverflowDispatch<quint8>()();
+ if (size == 16)
+ MulOverflowDispatch<quint16>()();
+ if (size == 32)
+ MulOverflowDispatch<quint32>()();
+ if (size == 48)
+ MulOverflowDispatch<ulong>()(); // not really 48-bit
+ if (size == 64)
+ MulOverflowDispatch<quint64>()();
+}
+
QTEST_APPLESS_MAIN(tst_QNumeric)
#include "tst_qnumeric.moc"
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index 2cf93e1c45..d9d3f55d4a 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -264,7 +264,9 @@ static int NColorRoles[] = {
QPalette::ToolTipText + 1, // Qt_5_2
QPalette::ToolTipText + 1, // Qt_5_3
QPalette::ToolTipText + 1, // Qt_5_4
- 0 // add the correct value for Qt_5_5 here later
+ QPalette::ToolTipText + 1, // Qt_5_5
+ QPalette::ToolTipText + 1, // Qt_5_6
+ 0 // add the correct value for Qt_5_7 here later
};
// Testing get/set functions
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 3e19e816c9..db2805ebf0 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -49,6 +49,7 @@ private slots:
void debugWithBool() const;
void debugSpaceHandling() const;
void debugNoQuotes() const;
+ void verbosity() const;
void stateSaver() const;
void veryLongWarningMessage() const;
void qDebugQChar() const;
@@ -192,7 +193,11 @@ public:
QDebug operator<< (QDebug s, const MyLine& line)
{
const QDebugStateSaver saver(s);
- s.nospace() << "MyLine(" << line.p1 << ", " << line.p2 << ")";
+ s.nospace();
+ s << "MyLine(" << line.p1 << ", "<< line.p2;
+ if (s.verbosity() > 2)
+ s << ", Manhattan length=" << (qAbs(line.p2.v1 - line.p1.v1) + qAbs(line.p2.v2 - line.p1.v2));
+ s << ')';
return s;
}
@@ -255,6 +260,33 @@ void tst_QDebug::debugNoQuotes() const
QCOMPARE(s_msg, QString::fromLatin1("'H' \"Hello\" \"Hello\" H Hello Hello"));
}
+void tst_QDebug::verbosity() const
+{
+ MyLine line(MyPoint(10, 11), MyPoint (12, 13));
+ QString output;
+ QDebug d(&output);
+ d.nospace();
+ d << line << '\n';
+ const int oldVerbosity = d.verbosity();
+ d.setVerbosity(0);
+ QCOMPARE(d.verbosity(), 0);
+ d.setVerbosity(7);
+ QCOMPARE(d.verbosity(), 7);
+ const int newVerbosity = oldVerbosity + 2;
+ d.setVerbosity(newVerbosity);
+ QCOMPARE(d.verbosity(), newVerbosity);
+ d << line << '\n';
+ d.setVerbosity(oldVerbosity );
+ QCOMPARE(d.verbosity(), oldVerbosity );
+ d << line;
+ const QStringList lines = output.split(QLatin1Char('\n'));
+ QCOMPARE(lines.size(), 3);
+ // Verbose should be longer
+ QVERIFY2(lines.at(1).size() > lines.at(0).size(), qPrintable(lines.join(QLatin1Char(','))));
+ // Switching back to brief produces same output
+ QCOMPARE(lines.at(0).size(), lines.at(2).size());
+}
+
void tst_QDebug::stateSaver() const
{
MessageHandlerSetter mhs(myMessageHandler);
diff --git a/tests/auto/corelib/io/qdir/qdir.pro b/tests/auto/corelib/io/qdir/qdir.pro
index d3e954bd32..0adc7e0450 100644
--- a/tests/auto/corelib/io/qdir/qdir.pro
+++ b/tests/auto/corelib/io/qdir/qdir.pro
@@ -10,3 +10,5 @@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
android:!android-no-sdk {
RESOURCES += android_testdata.qrc
}
+
+win32: CONFIG += insignificant_test # Crashes on Windows in release builds
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index 72d036c2ae..ae6fe7eaef 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -68,6 +68,12 @@ QT_END_NAMESPACE
#endif
+static QByteArray msgDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
class tst_QDir : public QObject
{
Q_OBJECT
@@ -354,7 +360,7 @@ void tst_QDir::mkdir()
//make sure it really exists (ie that mkdir returns the right value)
QFileInfo fi(path);
- QVERIFY(fi.exists() && fi.isDir());
+ QVERIFY2(fi.exists() && fi.isDir(), msgDoesNotExist(path).constData());
}
void tst_QDir::makedirReturnCode()
@@ -378,7 +384,7 @@ void tst_QDir::makedirReturnCode()
f.open(QIODevice::WriteOnly);
f.write("test");
f.close();
- QVERIFY(f.exists());
+ QVERIFY2(f.exists(), msgDoesNotExist(f.fileName()).constData());
QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing file will fail.
QVERIFY(!QDir::current().mkpath(dirName)); // calling mkpath on an existing file will fail.
f.remove();
@@ -474,7 +480,7 @@ void tst_QDir::removeRecursivelyFailure()
QVERIFY(!QDir().rmdir(path));
QDir dir(path);
QVERIFY(!dir.removeRecursively()); // didn't work
- QVERIFY(dir.exists()); // still exists
+ QVERIFY2(dir.exists(), msgDoesNotExist(dir.absolutePath()).constData()); // still exists
QVERIFY(dirAsFile.setPermissions(QFile::Permissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner)));
QVERIFY(dir.removeRecursively());
@@ -527,14 +533,15 @@ void tst_QDir::exists_data()
QTest::newRow("simple dir") << (m_dataPath + "/resources") << true;
QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << true;
#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << true;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << true;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << true;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
- QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << true;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << true;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << true;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << true;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << false;
+ QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
#endif
#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
@@ -566,7 +573,10 @@ void tst_QDir::exists()
QFETCH(bool, expected);
QDir dir(path);
- QCOMPARE(dir.exists(), expected);
+ if (expected)
+ QVERIFY2(dir.exists(), msgDoesNotExist(path).constData());
+ else
+ QVERIFY(!dir.exists());
}
void tst_QDir::isRelativePath_data()
@@ -802,7 +812,7 @@ void tst_QDir::entryList()
#endif //Q_NO_SYMLINKS
QDir dir(dirName);
- QVERIFY(dir.exists());
+ QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData());
QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec,
(QDir::SortFlags)sortspec);
@@ -845,8 +855,8 @@ void tst_QDir::entryListTimedSort()
QTemporaryFile aFile(entrylistPath + "A-XXXXXX.qws");
QTemporaryFile bFile(entrylistPath + "B-XXXXXX.qws");
- QVERIFY(aFile.open());
- QVERIFY(bFile.open());
+ QVERIFY2(aFile.open(), qPrintable(aFile.errorString()));
+ QVERIFY2(bFile.open(), qPrintable(bFile.errorString()));
{
QProcess p;
p.start(touchBinary, QStringList() << "-t" << "201306021513" << aFile.fileName());
@@ -888,18 +898,25 @@ void tst_QDir::entryListSimple_data()
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << 2;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << 2;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << 2;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << 2;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << 2;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << 2;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << 0;
- QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << 0;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << 2;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << 2;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << 2;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << 2;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << 2;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << 2;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << 0;
+ QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << 0;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << 0;
#endif
}
+static QByteArray msgEntryListFailed(int actual, int expectedMin, const QString &name)
+{
+ return QByteArray::number(actual) + " < " + QByteArray::number(expectedMin) + " in \""
+ + QFile::encodeName(QDir::toNativeSeparators(name)) + '"';
+}
+
void tst_QDir::entryListSimple()
{
QFETCH(QString, dirName);
@@ -907,7 +924,7 @@ void tst_QDir::entryListSimple()
QDir dir(dirName);
QStringList actual = dir.entryList();
- QVERIFY(actual.count() >= countMin);
+ QVERIFY2(actual.count() >= countMin, msgEntryListFailed(actual.count(), countMin, dirName).constData());
}
void tst_QDir::entryListWithSymLinks()
@@ -1121,7 +1138,7 @@ void tst_QDir::setNameFilters()
QFETCH(QStringList, expected);
QDir dir(dirName);
- QVERIFY(dir.exists());
+ QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData());
dir.setNameFilters(nameFilters);
QStringList actual = dir.entryList();
@@ -1504,7 +1521,7 @@ void tst_QDir::exists2()
QDir dir;
if (exists)
- QVERIFY(dir.exists(path));
+ QVERIFY2(dir.exists(path), msgDoesNotExist(path).constData());
else
QVERIFY(!dir.exists(path));
diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
index 3b5d2bd931..a2429bf2f0 100644
--- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
@@ -8,3 +8,5 @@ TESTDATA += entrylist
wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+win32: CONFIG += insignificant_test # Crashes on Windows in release builds
diff --git a/tests/auto/corelib/io/qfile/BLACKLIST b/tests/auto/corelib/io/qfile/BLACKLIST
new file mode 100644
index 0000000000..e3bc093c83
--- /dev/null
+++ b/tests/auto/corelib/io/qfile/BLACKLIST
@@ -0,0 +1,9 @@
+# QTBUG-48455
+[readLineStdin]
+msvc-2015
+[readLineStdin_lineByLine]
+msvc-2015
+[openStandardStreamsFileDescriptors]
+osx
+[openStandardStreamsBufferedStreams]
+osx
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index b423e857d0..1c695a1113 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -390,9 +390,30 @@ tst_QFile::tst_QFile() : m_oldDir(QDir::currentPath())
{
}
+static QByteArray msgOpenFailed(QIODevice::OpenMode om, const QFile &file)
+{
+ QString result;
+ QDebug(&result).noquote().nospace() << "Could not open \""
+ << QDir::toNativeSeparators(file.fileName()) << "\" using "
+ << om << ": " << file.errorString();
+ return result.toLocal8Bit();
+}
+
+static QByteArray msgOpenFailed(const QFile &file)
+{
+ return (QLatin1String("Could not open \"") + QDir::toNativeSeparators(file.fileName())
+ + QLatin1String("\": ") + file.errorString()).toLocal8Bit();
+}
+
+static QByteArray msgFileDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
void tst_QFile::initTestCase()
{
- QVERIFY(m_temporaryDir.isValid());
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
m_stdinProcessDir = QFINDTESTDATA("stdinprocess");
QVERIFY(!m_stdinProcessDir.isEmpty());
m_testSourceFile = QFINDTESTDATA("tst_qfile.cpp");
@@ -418,19 +439,19 @@ void tst_QFile::initTestCase()
// create a file and make it read-only
QFile file(QString::fromLatin1(readOnlyFile));
- QVERIFY2(file.open(QFile::WriteOnly), qPrintable(file.errorString()));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("a", 1);
file.close();
QVERIFY2(file.setPermissions(QFile::ReadOwner), qPrintable(file.errorString()));
// create another file and make it not readable
file.setFileName(QString::fromLatin1(noReadFile));
- QVERIFY2(file.open(QFile::WriteOnly), qPrintable(file.errorString()));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("b", 1);
file.close();
#ifndef Q_OS_WIN // Not supported on Windows.
QVERIFY2(file.setPermissions(0), qPrintable(file.errorString()));
#else
- QVERIFY2(file.open(QFile::WriteOnly), qPrintable(file.errorString()));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
#endif
}
@@ -455,19 +476,19 @@ void tst_QFile::cleanupTestCase()
void tst_QFile::exists()
{
QFile f( m_testFile );
- QVERIFY(f.exists());
+ QVERIFY2(f.exists(), msgFileDoesNotExist(m_testFile));
QFile file("nobodyhassuchafile");
file.remove();
QVERIFY(!file.exists());
QFile file2("nobodyhassuchafile");
- QVERIFY(file2.open(QIODevice::WriteOnly));
+ QVERIFY2(file2.open(QIODevice::WriteOnly), msgOpenFailed(file2).constData());
file2.close();
QVERIFY(file.exists());
- QVERIFY(file.open(QIODevice::WriteOnly));
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
file.close();
QVERIFY(file.exists());
@@ -475,8 +496,9 @@ void tst_QFile::exists()
QVERIFY(!file.exists());
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QFile unc("//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt");
- QVERIFY(unc.exists());
+ const QString uncPath = "//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt";
+ QFile unc(uncPath);
+ QVERIFY2(unc.exists(), msgFileDoesNotExist(uncPath).constData());
#endif
}
@@ -558,7 +580,12 @@ void tst_QFile::open()
if (filename.isEmpty())
QTest::ignoreMessage(QtWarningMsg, "QFSFileEngine::open: No file name specified");
- QCOMPARE(f.open( QIODevice::OpenMode(mode) ), ok);
+ const QIODevice::OpenMode om(mode);
+ const bool succeeded = f.open(om);
+ if (ok)
+ QVERIFY2(succeeded, msgOpenFailed(om, f).constData());
+ else
+ QVERIFY(!succeeded);
QTEST( f.error(), "status" );
}
@@ -566,7 +593,7 @@ void tst_QFile::open()
void tst_QFile::openUnbuffered()
{
QFile file(m_testFile);
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered), msgOpenFailed(file).constData());
char c = '\0';
QVERIFY(file.seek(1));
QCOMPARE(file.pos(), qint64(1));
@@ -618,7 +645,7 @@ void tst_QFile::size()
QFile f( filename );
QCOMPARE( f.size(), size );
- QVERIFY( f.open(QIODevice::ReadOnly) );
+ QVERIFY2(f.open(QIODevice::ReadOnly), msgOpenFailed(f).constData());
QCOMPARE( f.size(), size );
}
@@ -662,7 +689,7 @@ void tst_QFile::sizeNoExist()
void tst_QFile::seek()
{
QFile file("newfile.txt");
- file.open(QIODevice::WriteOnly);
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
QCOMPARE(file.size(), qint64(0));
QCOMPARE(file.pos(), qint64(0));
QVERIFY(file.seek(10));
@@ -674,7 +701,7 @@ void tst_QFile::seek()
void tst_QFile::setSize()
{
QFile f("createme.txt");
- QVERIFY(f.open(QIODevice::Truncate | QIODevice::ReadWrite));
+ QVERIFY2(f.open(QIODevice::Truncate | QIODevice::ReadWrite), msgOpenFailed(f).constData());
f.putChar('a');
f.seek(0);
@@ -712,7 +739,7 @@ void tst_QFile::setSize()
void tst_QFile::setSizeSeek()
{
QFile f("setsizeseek.txt");
- QVERIFY(f.open(QFile::WriteOnly));
+ QVERIFY2(f.open(QFile::WriteOnly), msgOpenFailed(f).constData());
f.write("ABCD");
QCOMPARE(f.pos(), qint64(4));
@@ -734,7 +761,7 @@ void tst_QFile::setSizeSeek()
void tst_QFile::atEnd()
{
QFile f( m_testFile );
- QVERIFY(f.open( QIODevice::ReadOnly ));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
int size = f.size();
f.seek( size );
@@ -747,7 +774,7 @@ void tst_QFile::atEnd()
void tst_QFile::readLine()
{
QFile f( m_testFile );
- QVERIFY(f.open( QIODevice::ReadOnly ));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
int i = 0;
char p[128];
@@ -767,7 +794,8 @@ void tst_QFile::readLine()
void tst_QFile::readLine2()
{
QFile f( m_testFile );
- f.open( QIODevice::ReadOnly );
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
+
char p[128];
QCOMPARE(f.readLine(p, 60), qlonglong(59));
@@ -785,7 +813,7 @@ void tst_QFile::readLineNullInLine()
{
QFile::remove("nullinline.txt");
QFile file("nullinline.txt");
- QVERIFY(file.open(QIODevice::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
QVERIFY(file.write("linewith\0null\nanotherline\0withnull\n\0\nnull\0", 42) > 0);
QVERIFY(file.flush());
file.reset();
@@ -816,10 +844,8 @@ void tst_QFile::readAll()
QFETCH( QString, fileName );
QFile file(fileName);
- if (textMode)
- QVERIFY(file.open(QFile::Text | QFile::ReadOnly));
- else
- QVERIFY(file.open(QFile::ReadOnly));
+ const QIODevice::OpenMode om = textMode ? (QFile::Text | QFile::ReadOnly) : QFile::ReadOnly;
+ QVERIFY2(file.open(om), msgOpenFailed(om, file).constData());
QByteArray a = file.readAll();
file.reset();
@@ -848,8 +874,8 @@ void tst_QFile::readAllBuffer()
QByteArray data1("This is arguably a very simple text.");
QByteArray data2("This is surely not as simple a test.");
- QVERIFY( writer.open(QIODevice::ReadWrite | QIODevice::Unbuffered) );
- QVERIFY( reader.open(QIODevice::ReadOnly) );
+ QVERIFY2(writer.open(QIODevice::ReadWrite | QIODevice::Unbuffered), msgOpenFailed(writer).constData());
+ QVERIFY2(reader.open(QIODevice::ReadOnly), msgOpenFailed(reader).constData());
QCOMPARE( writer.write(data1), qint64(data1.size()) );
QVERIFY( writer.seek(0) );
@@ -868,6 +894,32 @@ void tst_QFile::readAllBuffer()
QFile::remove(fileName);
}
+#ifndef QT_NO_PROCESS
+class StdinReaderProcessGuard { // Ensure the stdin reader process is stopped on destruction.
+ Q_DISABLE_COPY(StdinReaderProcessGuard)
+
+public:
+ StdinReaderProcessGuard(QProcess *p) : m_process(p) {}
+ ~StdinReaderProcessGuard() { stop(); }
+
+ bool stop(int msecs = 30000)
+ {
+ if (m_process->state() != QProcess::Running)
+ return true;
+ m_process->closeWriteChannel();
+ if (m_process->waitForFinished(msecs))
+ return m_process->exitStatus() == QProcess::NormalExit && !m_process->exitCode();
+ m_process->terminate();
+ if (!m_process->waitForFinished())
+ m_process->kill();
+ return false;
+ }
+
+private:
+ QProcess *m_process;
+};
+#endif // !QT_NO_PROCESS
+
#if !defined(Q_OS_WINCE)
void tst_QFile::readAllStdin()
{
@@ -877,18 +929,17 @@ void tst_QFile::readAllStdin()
QByteArray lotsOfData(1024, '@'); // 10 megs
QProcess process;
+ StdinReaderProcessGuard processGuard(&process);
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"), QStringList(QStringLiteral("all")));
QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
- while (process.bytesToWrite() > 0) {
+ while (process.bytesToWrite() > 0)
QVERIFY(process.waitForBytesWritten());
- }
}
- process.closeWriteChannel();
- process.waitForFinished();
+ QVERIFY(processGuard.stop());
QCOMPARE(process.readAll().size(), lotsOfData.size() * 5);
#endif
}
@@ -908,6 +959,7 @@ void tst_QFile::readLineStdin()
for (int i = 0; i < 2; ++i) {
QProcess process;
+ StdinReaderProcessGuard processGuard(&process);
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"),
QStringList() << QStringLiteral("line") << QString::number(i),
QIODevice::Text | QIODevice::ReadWrite);
@@ -915,13 +967,11 @@ void tst_QFile::readLineStdin()
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
- while (process.bytesToWrite() > 0) {
+ while (process.bytesToWrite() > 0)
QVERIFY(process.waitForBytesWritten());
- }
}
- process.closeWriteChannel();
- QVERIFY(process.waitForFinished(5000));
+ QVERIFY(processGuard.stop(5000));
QByteArray array = process.readAll();
QCOMPARE(array.size(), lotsOfData.size() * 5);
@@ -942,6 +992,7 @@ void tst_QFile::readLineStdin_lineByLine()
#else
for (int i = 0; i < 2; ++i) {
QProcess process;
+ StdinReaderProcessGuard processGuard(&process);
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"),
QStringList() << QStringLiteral("line") << QString::number(i),
QIODevice::Text | QIODevice::ReadWrite);
@@ -956,8 +1007,7 @@ void tst_QFile::readLineStdin_lineByLine()
QCOMPARE(process.readAll(), line);
}
- process.closeWriteChannel();
- QVERIFY(process.waitForFinished(5000));
+ QVERIFY(processGuard.stop(5000));
}
#endif
}
@@ -967,7 +1017,7 @@ void tst_QFile::text()
{
// dosfile.txt is a binary CRLF file
QFile file(m_dosFile);
- QVERIFY(file.open(QFile::Text | QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::Text | QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.readLine(),
QByteArray("/dev/system/root / reiserfs acl,user_xattr 1 1\n"));
QCOMPARE(file.readLine(),
@@ -980,7 +1030,7 @@ void tst_QFile::text()
void tst_QFile::missingEndOfLine()
{
QFile file(m_noEndOfLineFile);
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
int nlines = 0;
while (!file.atEnd()) {
@@ -1026,7 +1076,7 @@ void tst_QFile::getch()
void tst_QFile::ungetChar()
{
QFile f(m_testFile);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
QByteArray array = f.readLine();
QCOMPARE(array.constData(), "----------------------------------------------------------\n");
@@ -1044,7 +1094,7 @@ void tst_QFile::ungetChar()
QFile::remove("genfile.txt");
QFile out("genfile.txt");
- QVERIFY(out.open(QIODevice::ReadWrite));
+ QVERIFY2(out.open(QIODevice::ReadWrite), msgOpenFailed(out).constData());
out.write("123");
out.seek(0);
QCOMPARE(out.readAll().constData(), "123");
@@ -1127,7 +1177,7 @@ void tst_QFile::createFile()
QVERIFY( !QFile::exists( "createme.txt" ) );
QFile f( "createme.txt" );
- QVERIFY( f.open( QIODevice::WriteOnly ) );
+ QVERIFY2( f.open(QIODevice::WriteOnly), msgOpenFailed(f).constData());
f.close();
QVERIFY( QFile::exists( "createme.txt" ) );
}
@@ -1140,11 +1190,11 @@ void tst_QFile::append()
QVERIFY(!QFile::exists(name));
QFile f(name);
- QVERIFY(f.open(QIODevice::WriteOnly | QIODevice::Truncate));
+ QVERIFY2(f.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(f).constData());
f.putChar('a');
f.close();
- QVERIFY(f.open(QIODevice::Append));
+ QVERIFY2(f.open(QIODevice::Append), msgOpenFailed(f).constData());
QVERIFY(f.pos() == 1);
f.putChar('a');
f.close();
@@ -1181,7 +1231,7 @@ void tst_QFile::permissions()
QFETCH(bool, create);
if (create) {
QFile fc(file);
- QVERIFY(fc.open(QFile::WriteOnly));
+ QVERIFY2(fc.open(QFile::WriteOnly), msgOpenFailed(fc).constData());
QVERIFY(fc.write("hello\n"));
fc.close();
}
@@ -1230,7 +1280,7 @@ void tst_QFile::setPermissions()
QVERIFY( !QFile::exists( "createme.txt" ) );
QFile f("createme.txt");
- QVERIFY(f.open(QIODevice::WriteOnly | QIODevice::Truncate));
+ QVERIFY2(f.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(f).constData());
f.putChar('a');
f.close();
@@ -1247,8 +1297,8 @@ void tst_QFile::copy()
QFile::remove("test2");
QVERIFY(QFile::copy(m_testSourceFile, "tst_qfile_copy.cpp"));
QFile in1(m_testSourceFile), in2("tst_qfile_copy.cpp");
- QVERIFY(in1.open(QFile::ReadOnly));
- QVERIFY(in2.open(QFile::ReadOnly));
+ QVERIFY2(in1.open(QFile::ReadOnly), msgOpenFailed(in1).constData());
+ QVERIFY2(in2.open(QFile::ReadOnly), msgOpenFailed(in2).constData());
QByteArray data1 = in1.readAll(), data2 = in2.readAll();
QCOMPARE(data1, data2);
QFile::remove( "main_copy.cpp" );
@@ -1261,8 +1311,8 @@ void tst_QFile::copyAfterFail()
QFile file1("file-to-be-copied.txt");
QFile file2("existing-file.txt");
- QVERIFY(file1.open(QIODevice::ReadWrite) && "(test-precondition)");
- QVERIFY(file2.open(QIODevice::ReadWrite) && "(test-precondition)");
+ QVERIFY2(file1.open(QIODevice::ReadWrite), msgOpenFailed(file1).constData());
+ QVERIFY2(file2.open(QIODevice::ReadWrite), msgOpenFailed(file1).constData());
file2.close();
QVERIFY(!QFile::exists("copied-file-1.txt") && "(test-precondition)");
QVERIFY(!QFile::exists("copied-file-2.txt") && "(test-precondition)");
@@ -1331,7 +1381,7 @@ void tst_QFile::copyFallback()
QVERIFY(QFile::remove("file-copy-destination.txt"));
// Fallback copy of open file.
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QVERIFY(file.copy("file-copy-destination.txt"));
QVERIFY(QFile::exists("file-copy-destination.txt"));
QVERIFY(!file.isOpen());
@@ -1401,7 +1451,7 @@ void tst_QFile::link()
QCOMPARE(info2.symLinkTarget(), referenceTarget);
QFile link("myLink.lnk");
- QVERIFY(link.open(QIODevice::ReadOnly));
+ QVERIFY2(link.open(QIODevice::ReadOnly), msgOpenFailed(link).constData());
QCOMPARE(link.symLinkTarget(), referenceTarget);
link.close();
@@ -1483,15 +1533,15 @@ void tst_QFile::readTextFile()
QFETCH(QByteArray, out);
QFile winfile("winfile.txt");
- QVERIFY(winfile.open(QFile::WriteOnly | QFile::Truncate));
+ QVERIFY2(winfile.open(QFile::WriteOnly | QFile::Truncate), msgOpenFailed(winfile).constData());
winfile.write(in);
winfile.close();
- QVERIFY(winfile.open(QFile::ReadOnly));
+ QVERIFY2(winfile.open(QFile::ReadOnly), msgOpenFailed(winfile).constData());
QCOMPARE(winfile.readAll(), in);
winfile.close();
- QVERIFY(winfile.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(winfile.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(winfile).constData());
QCOMPARE(winfile.readAll(), out);
}
@@ -1499,13 +1549,13 @@ void tst_QFile::readTextFile2()
{
{
QFile file(m_testLogFile);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
file.read(4097);
}
{
QFile file(m_testLogFile);
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), msgOpenFailed(file).constData());
file.read(4097);
}
}
@@ -1532,7 +1582,8 @@ void tst_QFile::writeTextFile()
QFETCH(QByteArray, in);
QFile file("textfile.txt");
- QVERIFY(file.open(QFile::WriteOnly | QFile::Truncate | QFile::Text));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Truncate | QFile::Text),
+ msgOpenFailed(file).constData());
QByteArray out = in;
#ifdef Q_OS_WIN
out.replace('\n', "\r\n");
@@ -1555,8 +1606,10 @@ void tst_QFile::largeUncFileSupport()
{
// 1) Native file handling.
QFile file(largeFile);
+ QVERIFY2(file.exists(), msgFileDoesNotExist(largeFile));
+
QCOMPARE(file.size(), size);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.size(), size);
QVERIFY(file.seek(dataOffset));
QCOMPARE(file.read(knownData.size()), knownData);
@@ -1593,13 +1646,13 @@ void tst_QFile::flush()
{
QFile file(fileName);
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
QCOMPARE(file.write("abc", 3),qint64(3));
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::WriteOnly | QFile::Append));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Append), msgOpenFailed(file).constData());
QCOMPARE(file.pos(), qlonglong(3));
QCOMPARE(file.write("def", 3), qlonglong(3));
QCOMPARE(file.pos(), qlonglong(6));
@@ -1607,7 +1660,7 @@ void tst_QFile::flush()
{
QFile file("stdfile.txt");
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.readAll(), QByteArray("abcdef"));
}
}
@@ -1617,7 +1670,7 @@ void tst_QFile::bufferedRead()
QFile::remove("stdfile.txt");
QFile file("stdfile.txt");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("abcdef");
file.close();
@@ -1634,7 +1687,7 @@ void tst_QFile::bufferedRead()
{
QFile file;
- QVERIFY(file.open(stdFile, QFile::ReadOnly));
+ QVERIFY2(file.open(stdFile, QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.pos(), qlonglong(1));
QCOMPARE(file.read(&c, 1), qlonglong(1));
QCOMPARE(c, 'b');
@@ -1648,7 +1701,7 @@ void tst_QFile::bufferedRead()
void tst_QFile::isSequential()
{
QFile zero("/dev/null");
- QVERIFY(zero.open(QFile::ReadOnly));
+ QVERIFY2(zero.open(QFile::ReadOnly), msgOpenFailed(zero).constData());
QVERIFY(zero.isSequential());
}
#endif
@@ -1662,15 +1715,15 @@ void tst_QFile::truncate()
{
for (int i = 0; i < 2; ++i) {
QFile file("truncate.txt");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write(QByteArray(200, '@'));
file.close();
- QVERIFY(file.open((i ? QFile::WriteOnly : QFile::ReadWrite) | QFile::Truncate));
+ QVERIFY2(file.open((i ? QFile::WriteOnly : QFile::ReadWrite) | QFile::Truncate), msgOpenFailed(file).constData());
file.write(QByteArray(100, '$'));
file.close();
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.readAll(), QByteArray(100, '$'));
}
}
@@ -1679,13 +1732,13 @@ void tst_QFile::seekToPos()
{
{
QFile file("seekToPos.txt");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("a\r\nb\r\nc\r\n");
file.flush();
}
QFile file("seekToPos.txt");
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
file.seek(1);
char c;
QVERIFY(file.getChar(&c));
@@ -1707,7 +1760,7 @@ void tst_QFile::seekAfterEndOfFile()
QFile::remove(filename);
{
QFile file(filename);
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("abcd");
QCOMPARE(file.size(), qint64(4));
file.seek(8);
@@ -1723,7 +1776,7 @@ void tst_QFile::seekAfterEndOfFile()
}
QFile file(filename);
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QByteArray contents = file.readAll();
QCOMPARE(contents.left(12), QByteArray("abcdefghijkl", 12));
//bytes 12-15 are uninitialised so we don't care what they read as.
@@ -1741,7 +1794,7 @@ void tst_QFile::FILEReadWrite()
// create test file
{
QFile f("FILEReadWrite.txt");
- QVERIFY(f.open(QFile::WriteOnly));
+ QVERIFY2(f.open(QFile::WriteOnly), msgOpenFailed(f).constData());
QDataStream ds(&f);
qint8 c = 0;
ds << c;
@@ -1777,7 +1830,7 @@ void tst_QFile::FILEReadWrite()
#endif
QVERIFY(fp);
QFile file;
- QVERIFY(file.open(fp, QFile::ReadWrite));
+ QVERIFY2(file.open(fp, QFile::ReadWrite), msgOpenFailed(file).constData());
QDataStream sfile(&file) ;
qint8 var1,var2,var3,var4;
@@ -1814,7 +1867,7 @@ void tst_QFile::FILEReadWrite()
// check modified file
{
QFile f("FILEReadWrite.txt");
- QVERIFY(f.open(QFile::ReadOnly));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QDataStream ds(&f);
qint8 c = 0;
ds >> c;
@@ -1928,14 +1981,14 @@ void tst_QFile::i18nFileName()
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts.setCodec("UTF-8");
ts << fileName << endl;
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts.setCodec("UTF-8");
QString line = ts.readLine();
@@ -1983,13 +2036,13 @@ void tst_QFile::longFileName()
QEXPECT_FAIL("244 chars", "Full pathname must be less than 260 chars", Abort);
QEXPECT_FAIL("244 chars to absolutepath", "Full pathname must be less than 260 chars", Abort);
#endif
- QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts << fileName << endl;
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
QString line = ts.readLine();
QCOMPARE(line, fileName);
@@ -1998,7 +2051,7 @@ void tst_QFile::longFileName()
{
QVERIFY(QFile::copy(fileName, newName));
QFile file(newName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
QString line = ts.readLine();
QCOMPARE(line, fileName);
@@ -2008,12 +2061,12 @@ void tst_QFile::longFileName()
{
QVERIFY(QFile::rename(fileName, newName));
QFile file(newName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
QString line = ts.readLine();
QCOMPARE(line, fileName);
}
- QVERIFY(QFile::exists(newName));
+ QVERIFY2(QFile::exists(newName), msgFileDoesNotExist(newName).constData());
}
#ifdef QT_BUILD_INTERNAL
@@ -2146,7 +2199,7 @@ void tst_QFile::remove_and_exists()
bool opened = f.open(QIODevice::WriteOnly);
QVERIFY(opened);
- f.write(QString("testing that remove/exists work...").toLatin1());
+ f.write("testing that remove/exists work...");
f.close();
QVERIFY(f.exists());
@@ -2165,7 +2218,7 @@ void tst_QFile::removeOpenFile()
QVERIFY(!f.exists());
bool opened = f.open(QIODevice::WriteOnly);
QVERIFY(opened);
- f.write(QString("testing that remove closes the file first...").toLatin1());
+ f.write("testing that remove closes the file first...");
bool removed = f.remove(); // remove should both close and remove the file
QVERIFY(removed);
@@ -2184,7 +2237,7 @@ void tst_QFile::removeOpenFile()
QVERIFY(!f.exists());
bool opened = f.open(QIODevice::WriteOnly);
QVERIFY(opened);
- f.write(QString("testing that remove closes the file first...").toLatin1());
+ f.write("testing that remove closes the file first...");
f.close();
}
@@ -2208,7 +2261,7 @@ void tst_QFile::fullDisk()
if (!file.exists())
QSKIP("/dev/full doesn't exist on this system");
- QVERIFY(file.open(QIODevice::WriteOnly));
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
file.write("foobar", 6);
QVERIFY(!file.flush());
@@ -2235,7 +2288,7 @@ void tst_QFile::fullDisk()
QCOMPARE(file.error(), QFile::NoError);
// try again without flush:
- QVERIFY(file.open(QIODevice::WriteOnly));
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
file.write("foobar", 6);
file.close();
QVERIFY(file.error() != QFile::NoError);
@@ -2288,8 +2341,7 @@ void tst_QFile::writeLargeDataBlock()
{
QFile file(fileName);
- QVERIFY2( openFile(file, QIODevice::WriteOnly, (FileType)type),
- qPrintable(QString("Couldn't open file for writing: [%1]").arg(fileName)) );
+ QVERIFY2(openFile(file, QIODevice::WriteOnly, (FileType)type), msgOpenFailed(file));
qint64 fileWriteOriginalData = file.write(originalData);
qint64 originalDataSize = (qint64)originalData.size();
#if defined(Q_OS_WIN)
@@ -2332,7 +2384,7 @@ void tst_QFile::writeLargeDataBlock()
void tst_QFile::readFromWriteOnlyFile()
{
QFile file("writeonlyfile");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
char c;
QTest::ignoreMessage(QtWarningMsg, "QIODevice::read (QFile, \"writeonlyfile\"): WriteOnly device");
QCOMPARE(file.read(&c, 1), qint64(-1));
@@ -2341,7 +2393,7 @@ void tst_QFile::readFromWriteOnlyFile()
void tst_QFile::writeToReadOnlyFile()
{
QFile file("readonlyfile");
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
char c = 0;
QTest::ignoreMessage(QtWarningMsg, "QIODevice::write (QFile, \"readonlyfile\"): ReadOnly device");
QCOMPARE(file.write(&c, 1), qint64(-1));
@@ -2363,13 +2415,13 @@ void tst_QFile::virtualFile()
// consistency check
QFileInfo fi(fname);
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgFileDoesNotExist(fname).constData());
QVERIFY(fi.isFile());
QCOMPARE(fi.size(), Q_INT64_C(0));
// open the file
QFile f(fname);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), msgOpenFailed(f).constData());
QCOMPARE(f.size(), Q_INT64_C(0));
QVERIFY(f.atEnd());
@@ -2413,7 +2465,7 @@ void tst_QFile::textFile()
::fclose(fs);
QFile file("writeabletextfile");
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QByteArray data = file.readAll();
@@ -2543,8 +2595,8 @@ void tst_QFile::renameMultiple()
// create the file if it doesn't exist
QFile file("file-to-be-renamed.txt");
QFile file2("existing-file.txt");
- QVERIFY(file.open(QIODevice::ReadWrite) && "(test-precondition)");
- QVERIFY(file2.open(QIODevice::ReadWrite) && "(test-precondition)");
+ QVERIFY2(file.open(QIODevice::ReadWrite), msgOpenFailed(file).constData());
+ QVERIFY2(file2.open(QIODevice::ReadWrite), msgOpenFailed(file2).constData());
// any stale files from previous test failures?
QFile::remove("file-renamed-once.txt");
@@ -2583,10 +2635,10 @@ void tst_QFile::renameMultiple()
void tst_QFile::appendAndRead()
{
QFile writeFile(QLatin1String("appendfile.txt"));
- QVERIFY(writeFile.open(QIODevice::WriteOnly | QIODevice::Truncate));
+ QVERIFY2(writeFile.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(writeFile).constData());
QFile readFile(QLatin1String("appendfile.txt"));
- QVERIFY(readFile.open(QIODevice::ReadOnly));
+ QVERIFY2(readFile.open(QIODevice::ReadOnly), msgOpenFailed(readFile).constData());
// Write to the end of the file, then read that character back, and so on.
for (int i = 0; i < 100; ++i) {
@@ -2612,11 +2664,13 @@ void tst_QFile::miscWithUncPathAsCurrentDir()
{
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QString current = QDir::currentPath();
- QVERIFY(QDir::setCurrent("//" + QtNetworkSettings::winServerName() + "/testshare"));
+ const QString path = QLatin1String("//") + QtNetworkSettings::winServerName()
+ + QLatin1String("/testshare");
+ QVERIFY2(QDir::setCurrent(path), qPrintable(QDir::toNativeSeparators(path)));
QFile file("test.pri");
- QVERIFY(file.exists());
+ QVERIFY2(file.exists(), msgFileDoesNotExist(file.fileName()).constData());
QCOMPARE(int(file.size()), 34);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QVERIFY(QDir::setCurrent(current));
#endif
}
@@ -2634,7 +2688,7 @@ void tst_QFile::handle()
int fd;
#if !defined(Q_OS_WINCE)
QFile file(m_testSourceFile);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
fd = int(file.handle());
QVERIFY(fd > 2);
QCOMPARE(int(file.handle()), fd);
@@ -2648,7 +2702,7 @@ void tst_QFile::handle()
// same, but read from QFile first now
file.close();
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered), msgOpenFailed(file).constData());
fd = int(file.handle());
QVERIFY(fd > 2);
QVERIFY(file.getChar(&c));
@@ -2690,7 +2744,7 @@ void tst_QFile::nativeHandleLeaks()
{
QFile file("qt_file.tmp");
- QVERIFY( file.open(QIODevice::ReadWrite) );
+ QVERIFY2(file.open(QIODevice::ReadWrite), msgOpenFailed(file).constData());
fd1 = file.handle();
QVERIFY( -1 != fd1 );
@@ -2709,7 +2763,7 @@ void tst_QFile::nativeHandleLeaks()
{
QFile file("qt_file.tmp");
- QVERIFY( file.open(QIODevice::ReadOnly) );
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
fd2 = file.handle();
QVERIFY( -1 != fd2 );
@@ -2755,7 +2809,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2777,7 +2831,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2798,7 +2852,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2820,7 +2874,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2841,7 +2895,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2867,7 +2921,7 @@ void tst_QFile::posAfterFailedStat()
QFile::remove("tmp.txt");
QFile file("tmp.txt");
QVERIFY(!file.exists());
- QVERIFY(file.open(QIODevice::Append));
+ QVERIFY2(file.open(QIODevice::Append), msgOpenFailed(file).constData());
QVERIFY(file.exists());
file.write("qt430", 5);
QVERIFY(!file.isSequential());
@@ -2922,11 +2976,11 @@ void tst_QFile::map()
QCOMPARE(file.error(), QFile::PermissionsError);
// make a file
- QVERIFY(file.open(QFile::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
QVERIFY(file.resize(fileSize));
QVERIFY(file.flush());
file.close();
- QVERIFY(file.open(QFile::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
memory = file.map(offset, size);
if (error != QFile::NoError) {
QVERIFY(file.error() != QFile::NoError);
@@ -3061,13 +3115,14 @@ void tst_QFile::mapOpenMode()
QFile file(fileName);
// make a file
- QVERIFY(file.open(QFile::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
QVERIFY(file.write(pattern));
QVERIFY(file.flush());
file.close();
// open according to our mode
- QVERIFY(file.open(QIODevice::OpenMode(openMode)));
+ const QIODevice::OpenMode om(openMode);
+ QVERIFY2(file.open(om), msgOpenFailed(om, file).constData());
uchar *memory = file.map(0, fileSize, QFileDevice::MemoryMapFlags(flags));
#if defined(Q_OS_WINCE)
@@ -3116,7 +3171,8 @@ void tst_QFile::mapWrittenFile()
QFile::remove(fileName);
}
QFile file(fileName);
- QVERIFY(file.open(QIODevice::ReadWrite | QFile::OpenMode(mode)));
+ const QIODevice::OpenMode om = QIODevice::ReadWrite | QIODevice::OpenMode(mode);
+ QVERIFY2(file.open(om), msgOpenFailed(om, file).constData());
QCOMPARE(file.write(data, sizeof data), qint64(sizeof data));
if ((mode & QIODevice::Unbuffered) == 0)
file.flush();
@@ -3328,7 +3384,7 @@ void tst_QFile::caseSensitivity()
QString filename("File.txt");
{
QFile f(filename);
- QVERIFY(f.open(QIODevice::WriteOnly));
+ QVERIFY2(f.open(QIODevice::WriteOnly), msgOpenFailed(f));
QVERIFY(f.write(testData));
f.close();
}
diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
index de99447404..571637be37 100644
--- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
@@ -7,3 +7,5 @@ RESOURCES += qfileinfo.qrc \
win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+win32: CONFIG += insignificant_test # Crashes on Windows in release builds
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 96ad78a666..210fdb5a12 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -149,6 +149,25 @@ static QString seedAndTemplate()
qsrand(QDateTime::currentDateTimeUtc().toTime_t());
return QDir::tempPath() + "/tst_qfileinfo-XXXXXX";
}
+
+static QByteArray msgDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
+static QByteArray msgIsNoDirectory(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" is not a directory.")).toLocal8Bit();
+}
+
+static QByteArray msgIsNotRoot(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" is no root directory.")).toLocal8Bit();
+}
+
class tst_QFileInfo : public QObject
{
Q_OBJECT
@@ -287,7 +306,8 @@ void tst_QFileInfo::initTestCase()
m_resourcesDir = dataPath + QLatin1String("/resources");
m_proFile = dataPath + QLatin1String("/tst_qfileinfo.pro");
- QVERIFY(m_dir.isValid());
+ QVERIFY2(m_dir.isValid(),
+ ("Failed to create temporary dir: " + m_dir.errorString()).toUtf8());
QVERIFY(QDir::setCurrent(m_dir.path()));
}
@@ -316,7 +336,7 @@ static QFileInfoPrivate* getPrivate(QFileInfo &info)
void tst_QFileInfo::copy()
{
QTemporaryFile t;
- t.open();
+ QVERIFY2(t.open(), qPrintable(t.errorString()));
QFileInfo info(t.fileName());
QVERIFY(info.exists());
@@ -413,13 +433,14 @@ void tst_QFileInfo::isDir_data()
//QTest::newRow("drive 2") << "t:s" << false;
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << true;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << true;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << true;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << true;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << true;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << true;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << true;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << false;
#endif
}
@@ -428,8 +449,11 @@ void tst_QFileInfo::isDir()
QFETCH(QString, path);
QFETCH(bool, expected);
- QFileInfo fi(path);
- QCOMPARE(fi.isDir(), expected);
+ const bool isDir = QFileInfo(path).isDir();
+ if (expected)
+ QVERIFY2(isDir, msgIsNoDirectory(path).constData());
+ else
+ QVERIFY(!isDir);
}
void tst_QFileInfo::isRoot_data()
@@ -452,10 +476,11 @@ void tst_QFileInfo::isRoot_data()
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << false;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << false;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << false;
QTest::newRow("unc 7") << "//ahostthatshouldnotexist" << false;
#endif
}
@@ -465,8 +490,11 @@ void tst_QFileInfo::isRoot()
QFETCH(QString, path);
QFETCH(bool, expected);
- QFileInfo fi(path);
- QCOMPARE(fi.isRoot(), expected);
+ const bool isRoot = QFileInfo(path).isRoot();
+ if (expected)
+ QVERIFY2(isRoot, msgIsNotRoot(path).constData());
+ else
+ QVERIFY(!isRoot);
}
void tst_QFileInfo::exists_data()
@@ -492,14 +520,15 @@ void tst_QFileInfo::exists_data()
QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << true;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << true;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << true;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << true;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
- QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << true;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << true;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << true;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << true;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << false;
+ QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
#endif
}
@@ -510,8 +539,12 @@ void tst_QFileInfo::exists()
QFETCH(bool, expected);
QFileInfo fi(path);
- QCOMPARE(fi.exists(), expected);
- QCOMPARE(QFileInfo::exists(path), expected);
+ const bool exists = fi.exists();
+ QCOMPARE(exists, QFileInfo::exists(path));
+ if (expected)
+ QVERIFY2(exists, msgDoesNotExist(path).constData());
+ else
+ QVERIFY(!exists);
}
void tst_QFileInfo::absolutePath_data()
@@ -611,7 +644,7 @@ void tst_QFileInfo::canonicalPath()
{
QTemporaryFile tempFile;
tempFile.setAutoRemove(true);
- tempFile.open();
+ QVERIFY2(tempFile.open(), qPrintable(tempFile.errorString()));
QFileInfo fi(tempFile.fileName());
QCOMPARE(fi.canonicalPath(), QFileInfo(QDir::tempPath()).canonicalFilePath());
}
@@ -993,7 +1026,7 @@ void tst_QFileInfo::systemFiles()
QSKIP("This is a Windows only test");
#endif
QFileInfo fi("c:\\pagefile.sys");
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QVERIFY(fi.size() > 0);
QVERIFY(fi.lastModified().isValid());
}
@@ -1478,7 +1511,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
QTest::newRow("dummy") << target.path() << false << "" << target.canonicalPath();
QSKIP("link not supported by FS or insufficient privilege");
}
- QVERIFY(file.exists());
+ QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData());
QTest::newRow("absolute dir symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath();
QTest::newRow("relative dir symlink") << relSymlink << true << QDir::fromNativeSeparators(relTarget) << target.canonicalPath();
@@ -1509,7 +1542,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
QFile file(fileInJunction.absoluteFilePath());
file.open(QIODevice::ReadWrite);
file.close();
- QVERIFY(file.exists());
+ QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData());
QTest::newRow("file in junction") << fileInJunction.absoluteFilePath() << false << "" << fileInJunction.canonicalFilePath();
target = QDir::rootPath();
@@ -1601,7 +1634,7 @@ void tst_QFileInfo::isWritable()
#else
QFileInfo fi("c:\\pagefile.sys");
#endif
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QVERIFY(!fi.isWritable());
#endif
#if defined (Q_OS_QNX) // On QNX /etc is usually on a read-only filesystem
@@ -1859,7 +1892,7 @@ void tst_QFileInfo::owner()
QVERIFY(testFile.write(testData) != -1);
}
QFileInfo fi(fileName);
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QCOMPARE(fi.owner(), userName);
QFile::remove(fileName);
@@ -1894,7 +1927,7 @@ void tst_QFileInfo::group()
QVERIFY(testFile.write(testData) != -1);
testFile.close();
QFileInfo fi(fileName);
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QCOMPARE(fi.group(), expected);
}
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+haiku/test b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+haiku/test2 b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test
diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.qrc b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
index 661647f933..6e2699774d 100644
--- a/tests/auto/corelib/io/qfileselector/qfileselector.qrc
+++ b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
@@ -19,6 +19,7 @@
<file>platforms/+unix/+darwin/+mac/+osx/test</file>
<file>platforms/+unix/+darwin/+mac/test</file>
<file>platforms/+unix/+darwin/test</file>
+ <file>platforms/+unix/+haiku/test</file>
<file>platforms/+unix/+linux/test</file>
<file>platforms/+unix/test</file>
<file>platforms/+windows/+wince/test</file>
@@ -30,6 +31,7 @@
<file>platforms/+osx/test</file>
<file>platforms/+darwin/test</file>
<file>platforms/+mac/test</file>
+ <file>platforms/+haiku/test</file>
<file>platforms/+linux/test</file>
<file>platforms/+wince/test</file>
@@ -39,6 +41,7 @@
<file>platforms/+blackberry/test2</file>
<file>platforms/+ios/test2</file>
<file>platforms/+osx/test2</file>
+ <file>platforms/+haiku/test2</file>
<file>platforms/+linux/test2</file>
<file>platforms/+wince/test2</file>
<file>platforms/+winnt/test2</file>
diff --git a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
index b3767b4887..87381f4c4e 100644
--- a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
+++ b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
@@ -89,7 +89,7 @@ void tst_QFileSelector::basicTest_data()
QString expectedPlatform2File(""); //Only the last selector
QString expectedPlatform3File; // Only the first selector (the family)
#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_BLACKBERRY) && \
- !defined(Q_OS_DARWIN) && !defined(Q_OS_LINUX)
+ !defined(Q_OS_DARWIN) && !defined(Q_OS_LINUX) && !defined(Q_OS_HAIKU)
/* We are only aware of specific unixes, and do not have test files for any of the others.
However those unixes can get a selector added from the result of a uname call, so this will
lead to a case where we don't have that file so we can't expect the concatenation of platform
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST b/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
index 3ac0b9dff4..90b714758a 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
+++ b/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
@@ -1,8 +1,9 @@
# QTBUG-33574 QTBUG-30943
[signalsEmittedAfterFileMoved]
-windows 32bit msvc-2010
-windows 64bit msvc
+windows
[watchFileAndItsDirectory:native backend-testfile]
osx
+windows
[watchFileAndItsDirectory:native backend-specialchars]
osx
+windows
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 7e56ecaab3..026743257c 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -126,7 +126,7 @@ void tst_QFileSystemWatcher::basicTest()
// create test file
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QFile testFile(temporaryDirectory.path() + QLatin1Char('/') + testFileName);
QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Truncate));
testFile.write(QByteArray("hello"));
@@ -263,7 +263,7 @@ void tst_QFileSystemWatcher::watchDirectory()
QFETCH(QString, backend);
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QDir temporaryDir(temporaryDirectory.path());
const QString testDirName = QStringLiteral("testDir");
@@ -498,7 +498,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
QFETCH(QString, backend);
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QDir temporaryDir(temporaryDirectory.path());
const QString testDirName = QStringLiteral("testDir");
@@ -553,7 +553,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
timer.start(3000);
eventLoop.exec();
int fileChangedSpyCount = fileChangedSpy.count();
-#ifdef Q_OS_WIN64
+#ifdef Q_OS_WIN
if (fileChangedSpyCount != 0)
QEXPECT_FAIL("", "See QTBUG-30943", Continue);
#endif
@@ -605,7 +605,7 @@ void tst_QFileSystemWatcher::nonExistingFile()
void tst_QFileSystemWatcher::removeFileAndUnWatch()
{
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
const QString filename = temporaryDirectory.path() + QStringLiteral("/foo.txt");
@@ -664,7 +664,7 @@ void tst_QFileSystemWatcher::QTBUG2331()
QFETCH(QString, backend);
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QFileSystemWatcher watcher;
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
QVERIFY(watcher.addPath(temporaryDirectory.path()));
@@ -724,7 +724,8 @@ void tst_QFileSystemWatcher::signalsEmittedAfterFileMoved()
{
const int fileCount = 10;
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
+
QDir testDir(temporaryDirectory.path());
QVERIFY(testDir.mkdir("movehere"));
QString movePath = testDir.filePath("movehere");
diff --git a/tests/auto/corelib/io/qiodevice/BLACKLIST b/tests/auto/corelib/io/qiodevice/BLACKLIST
new file mode 100644
index 0000000000..b8a61d3ca9
--- /dev/null
+++ b/tests/auto/corelib/io/qiodevice/BLACKLIST
@@ -0,0 +1,2 @@
+[unget]
+redhatenterpriselinuxworkstation-6.6
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index af79de06d5..f637ffcfc5 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -59,6 +59,7 @@ private slots:
void peekBug();
void readAllKeepPosition();
+ void writeInTextMode();
};
void tst_QIODevice::initTestCase()
@@ -627,5 +628,45 @@ void tst_QIODevice::readAllKeepPosition()
QCOMPARE(resultArray, buffer.buffer());
}
+class RandomAccessBuffer : public QIODevice
+{
+public:
+ RandomAccessBuffer(const char *data) : QIODevice(), buf(data) { }
+
+protected:
+ qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ {
+ maxSize = qMin(maxSize, qint64(buf.size() - pos()));
+ memcpy(data, buf.constData() + pos(), maxSize);
+ return maxSize;
+ }
+ qint64 writeData(const char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ {
+ maxSize = qMin(maxSize, qint64(buf.size() - pos()));
+ memcpy(buf.data() + pos(), data, maxSize);
+ return maxSize;
+ }
+
+private:
+ QByteArray buf;
+};
+
+// Test write() on skipping correct number of bytes in read buffer
+void tst_QIODevice::writeInTextMode()
+{
+ // Unlike other platforms, Windows implementation expands '\n' into
+ // "\r\n" sequence in write(). Ensure that write() properly works with
+ // a read buffer on random-access devices.
+#ifndef Q_OS_WIN
+ QSKIP("This is a Windows-only test");
+#else
+ RandomAccessBuffer buffer("one\r\ntwo\r\nthree\r\n");
+ buffer.open(QBuffer::ReadWrite | QBuffer::Text);
+ QCOMPARE(buffer.readLine(), QByteArray("one\n"));
+ QCOMPARE(buffer.write("two\n"), 4);
+ QCOMPARE(buffer.readLine(), QByteArray("three\n"));
+#endif
+}
+
QTEST_MAIN(tst_QIODevice)
#include "tst_qiodevice.moc"
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index 27614e0eb8..21c5696d1d 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -80,6 +80,7 @@ void tst_QLockFile::initTestCase()
#elif defined(QT_NO_PROCESS)
QSKIP("This test requires QProcess support");
#else
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
// chdir to our testdata path and execute helper apps relative to that.
QString testdata_dir = QFileInfo(QFINDTESTDATA("qlockfiletesthelper")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
diff --git a/tests/auto/corelib/io/qprocess/BLACKLIST b/tests/auto/corelib/io/qprocess/BLACKLIST
new file mode 100644
index 0000000000..216faa7fb4
--- /dev/null
+++ b/tests/auto/corelib/io/qprocess/BLACKLIST
@@ -0,0 +1,5 @@
+[lockupsInStartDetached]
+redhatenterpriselinuxworkstation-6.6
+# QTBUG-48455
+[fileWriterProcess]
+msvc-2015
diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp b/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
index 411c7e334b..25cb66f9d2 100644
--- a/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
+++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
@@ -33,20 +33,26 @@
#include <QCoreApplication>
#include <QFile>
+#include <stdio.h>
+
int main(int argc, char **argv)
{
QCoreApplication ca(argc, argv);
QFile f;
f.open(stdin, QIODevice::ReadOnly);
- QString input;
+ QByteArray input;
char buf[1024];
qint64 len;
while ((len = f.read(buf, 1024)) > 0)
- input += QByteArray(buf, len);
+ input.append(buf, len);
f.close();
QFile f2("fileWriterProcess.txt");
- f2.open(QIODevice::WriteOnly | QIODevice::Truncate);
- f2.write(input.toLatin1());
+ if (!f2.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ fprintf(stderr, "Cannot open %s for writing: %s\n",
+ qPrintable(f2.fileName()), qPrintable(f2.errorString()));
+ return 1;
+ }
+ f2.write(input);
f2.close();
return 0;
}
diff --git a/tests/auto/corelib/io/qprocess/testDetached/main.cpp b/tests/auto/corelib/io/qprocess/testDetached/main.cpp
index bbcc7033c7..760306ea17 100644
--- a/tests/auto/corelib/io/qprocess/testDetached/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testDetached/main.cpp
@@ -57,7 +57,8 @@ int main(int argc, char **argv)
QFile f(args.at(1));
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) {
- fprintf(stderr, "Cannot open %s for writing", qPrintable(f.fileName()));
+ fprintf(stderr, "Cannot open %s for writing: %s\n",
+ qPrintable(f.fileName()), qPrintable(f.errorString()));
return 1;
}
diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp b/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
index c92d7f515f..c3cf9f56c7 100644
--- a/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
@@ -33,8 +33,8 @@
#include <stdlib.h>
-int main(int /* argc */, char **argv)
+int main(int argc, char **argv)
{
- return atoi(argv[1]);
+ return argc >= 2 ? atoi(argv[1]) : -1;
}
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 0995f764b7..712e3440d8 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -38,6 +38,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QThread>
+#include <QtCore/QTemporaryDir>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
#include <QtCore/QMetaType>
@@ -54,13 +55,9 @@ Q_DECLARE_METATYPE(QProcess::ExitStatus);
Q_DECLARE_METATYPE(QProcess::ProcessState);
#endif
-#define QPROCESS_VERIFY(Process, Fn) \
-{ \
-const bool ret = Process.Fn; \
-if (ret == false) \
- qWarning("QProcess error: %d: %s", Process.error(), qPrintable(Process.errorString())); \
-QVERIFY(ret); \
-}
+typedef void (QProcess::*QProcessFinishedSignal1)(int);
+typedef void (QProcess::*QProcessFinishedSignal2)(int, QProcess::ExitStatus);
+typedef void (QProcess::*QProcessErrorSignal)(QProcess::ProcessError);
class tst_QProcess : public QObject
{
@@ -69,6 +66,7 @@ class tst_QProcess : public QObject
public slots:
void initTestCase();
void cleanupTestCase();
+ void init();
#ifndef QT_NO_PROCESS
private slots:
@@ -124,9 +122,9 @@ private slots:
void removeFileWhileProcessIsRunning();
void fileWriterProcess();
void switchReadChannels();
-#ifdef Q_OS_WIN
+ void discardUnwantedOutput();
void setWorkingDirectory();
-#endif // Q_OS_WIN
+ void setNonExistentWorkingDirectory();
#endif // not Q_OS_WINCE
void exitStatus_data();
@@ -174,8 +172,8 @@ protected slots:
#endif
private:
- QProcess *process;
qint64 bytesAvailable;
+ QTemporaryDir m_temporaryDir;
#endif //QT_NO_PROCESS
};
@@ -184,6 +182,7 @@ void tst_QProcess::initTestCase()
#ifdef QT_NO_PROCESS
QSKIP("This test requires QProcess support");
#else
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
// chdir to our testdata path and execute helper apps relative to that.
QString testdata_dir = QFileInfo(QFINDTESTDATA("testProcessNormal")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
@@ -197,6 +196,11 @@ void tst_QProcess::cleanupTestCase()
#endif
}
+void tst_QProcess::init()
+{
+ bytesAvailable = 0;
+}
+
#ifndef QT_NO_PROCESS
// Testing get/set functions
@@ -220,7 +224,6 @@ void tst_QProcess::getSetCheck()
QCOMPARE(QProcess::ProcessChannel(QProcess::StandardError), obj1.readChannel());
}
-//-----------------------------------------------------------------------------
void tst_QProcess::constructing()
{
QProcess process;
@@ -258,10 +261,10 @@ void tst_QProcess::simpleStart()
{
qRegisterMetaType<QProcess::ProcessState>("QProcess::ProcessState");
- process = new QProcess;
- QSignalSpy spy(process, &QProcess::stateChanged);
+ QScopedPointer<QProcess> process(new QProcess);
+ QSignalSpy spy(process.data(), &QProcess::stateChanged);
QVERIFY(spy.isValid());
- connect(process, SIGNAL(readyRead()), this, SLOT(readFromProcess()));
+ connect(process.data(), &QIODevice::readyRead, this, &tst_QProcess::readFromProcess);
/* valgrind dislike SUID binaries(those that have the `s'-flag set), which
* makes it fail to start the process. For this reason utilities like `ping' won't
@@ -273,8 +276,7 @@ void tst_QProcess::simpleStart()
QCOMPARE(process->state(), QProcess::Running);
QTRY_COMPARE(process->state(), QProcess::NotRunning);
- delete process;
- process = 0;
+ process.reset();
QCOMPARE(spy.count(), 3);
QCOMPARE(qvariant_cast<QProcess::ProcessState>(spy.at(0).at(0)), QProcess::Starting);
@@ -282,7 +284,6 @@ void tst_QProcess::simpleStart()
QCOMPARE(qvariant_cast<QProcess::ProcessState>(spy.at(2).at(0)), QProcess::NotRunning);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::startWithOpen()
{
QProcess p;
@@ -300,7 +301,6 @@ void tst_QProcess::startWithOpen()
QVERIFY(p.waitForFinished(5000));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::startWithOldOpen()
{
// similar to the above, but we start with start() actually
@@ -319,7 +319,6 @@ void tst_QProcess::startWithOldOpen()
QVERIFY(p.waitForFinished(5000));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::execute()
{
QCOMPARE(QProcess::execute("testProcessNormal/testProcessNormal",
@@ -327,34 +326,32 @@ void tst_QProcess::execute()
QCOMPARE(QProcess::execute("nonexistingexe"), -2);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::startDetached()
{
- QProcess proc;
- QVERIFY(proc.startDetached("testProcessNormal/testProcessNormal",
- QStringList() << "arg1" << "arg2"));
+ QVERIFY(QProcess::startDetached("testProcessNormal/testProcessNormal",
+ QStringList() << "arg1" << "arg2"));
#ifdef QPROCESS_USE_SPAWN
QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue);
#endif
QCOMPARE(QProcess::startDetached("nonexistingexe"), false);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::readFromProcess()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
int lines = 0;
while (process->canReadLine()) {
++lines;
- QByteArray line = process->readLine();
+ process->readLine();
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::crashTest()
{
qRegisterMetaType<QProcess::ProcessState>("QProcess::ProcessState");
- process = new QProcess;
- QSignalSpy stateSpy(process, &QProcess::stateChanged);
+ QScopedPointer<QProcess> process(new QProcess);
+ QSignalSpy stateSpy(process.data(), &QProcess::stateChanged);
QVERIFY(stateSpy.isValid());
process->start("testProcessCrash/testProcessCrash");
QVERIFY(process->waitForStarted(5000));
@@ -362,11 +359,13 @@ void tst_QProcess::crashTest()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
- QSignalSpy spy(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy spy2(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy spy(process.data(), &QProcess::errorOccurred);
+ QSignalSpy spy2(process.data(), static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy spy3(process.data(), static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
+ QVERIFY(spy3.isValid());
QVERIFY(process->waitForFinished(30000));
@@ -374,12 +373,15 @@ void tst_QProcess::crashTest()
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
QCOMPARE(spy2.count(), 1);
- QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit);
+ QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy2.at(0).at(0).constData()), QProcess::Crashed);
+
+ QCOMPARE(spy3.count(), 1);
+ QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy3.at(0).at(1).constData()), QProcess::CrashExit);
QCOMPARE(process->exitStatus(), QProcess::CrashExit);
- delete process;
- process = 0;
+ // delete process;
+ process.reset();
QCOMPARE(stateSpy.count(), 3);
QCOMPARE(qvariant_cast<QProcess::ProcessState>(stateSpy.at(0).at(0)), QProcess::Starting);
@@ -387,23 +389,23 @@ void tst_QProcess::crashTest()
QCOMPARE(qvariant_cast<QProcess::ProcessState>(stateSpy.at(2).at(0)), QProcess::NotRunning);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::crashTest2()
{
- process = new QProcess;
- process->start("testProcessCrash/testProcessCrash");
- QVERIFY(process->waitForStarted(5000));
+ QProcess process;
+ process.start("testProcessCrash/testProcessCrash");
+ QVERIFY(process.waitForStarted(5000));
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
- QSignalSpy spy(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy spy2(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy spy(&process, static_cast<QProcessErrorSignal>(&QProcess::errorOccurred));
+ QSignalSpy spy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
- QObject::connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
+ QObject::connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::exitLoopSlot);
QTestEventLoop::instance().enterLoop(30);
if (QTestEventLoop::instance().timeout())
@@ -415,15 +417,11 @@ void tst_QProcess::crashTest2()
QCOMPARE(spy2.count(), 1);
QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit);
- QCOMPARE(process->exitStatus(), QProcess::CrashExit);
-
- delete process;
- process = 0;
+ QCOMPARE(process.exitStatus(), QProcess::CrashExit);
}
#ifndef Q_OS_WINCE
//Reading and writing to a process is not supported on Qt/CE
-//-----------------------------------------------------------------------------
void tst_QProcess::echoTest_data()
{
QTest::addColumn<QByteArray>("input");
@@ -438,30 +436,28 @@ void tst_QProcess::echoTest_data()
QTest::newRow("10000 bytes") << QByteArray(10000, '@');
}
-//-----------------------------------------------------------------------------
-
void tst_QProcess::echoTest()
{
QFETCH(QByteArray, input);
- process = new QProcess;
- connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::exitLoopSlot);
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
- process->write(input);
+ process.write(input);
QTime stopWatch;
stopWatch.start();
do {
- QVERIFY(process->isOpen());
+ QVERIFY(process.isOpen());
QTestEventLoop::instance().enterLoop(2);
- } while (stopWatch.elapsed() < 60000 && process->bytesAvailable() < input.size());
+ } while (stopWatch.elapsed() < 60000 && process.bytesAvailable() < input.size());
if (stopWatch.elapsed() >= 60000)
QFAIL("Timed out");
- QByteArray message = process->readAll();
+ QByteArray message = process.readAll();
QCOMPARE(message.size(), input.size());
char *c1 = message.data();
@@ -474,40 +470,35 @@ void tst_QProcess::echoTest()
}
QCOMPARE(*c1, *c2);
- process->write("", 1);
-
- QVERIFY(process->waitForFinished(5000));
-
+ process.write("", 1);
- delete process;
- process = 0;
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::exitLoopSlot()
{
QTestEventLoop::instance().exitLoop();
}
-//-----------------------------------------------------------------------------
-
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::echoTest2()
{
- process = new QProcess;
- connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::exitLoopSlot);
- process->start("testProcessEcho2/testProcessEcho2");
- QVERIFY(process->waitForStarted(5000));
- QVERIFY(!process->waitForReadyRead(250));
- QCOMPARE(process->error(), QProcess::Timedout);
+ process.start("testProcessEcho2/testProcessEcho2");
+ QVERIFY(process.waitForStarted(5000));
+ QVERIFY(!process.waitForReadyRead(250));
+ QCOMPARE(process.error(), QProcess::Timedout);
- process->write("Hello");
- QSignalSpy spy1(process, &QProcess::readyReadStandardOutput);
- QSignalSpy spy2(process, &QProcess::readyReadStandardError);
+ process.write("Hello");
+ QSignalSpy spy1(&process, &QProcess::readyReadStandardOutput);
+ QSignalSpy spy2(&process, &QProcess::readyReadStandardError);
QVERIFY(spy1.isValid());
QVERIFY(spy2.isValid());
@@ -518,11 +509,11 @@ void tst_QProcess::echoTest2()
QTestEventLoop::instance().enterLoop(1);
if (stopWatch.elapsed() >= 30000)
QFAIL("Timed out");
- process->setReadChannel(QProcess::StandardOutput);
- qint64 baso = process->bytesAvailable();
+ process.setReadChannel(QProcess::StandardOutput);
+ qint64 baso = process.bytesAvailable();
- process->setReadChannel(QProcess::StandardError);
- qint64 base = process->bytesAvailable();
+ process.setReadChannel(QProcess::StandardError);
+ qint64 base = process.bytesAvailable();
if (baso == 5 && base == 5)
break;
}
@@ -530,20 +521,18 @@ void tst_QProcess::echoTest2()
QVERIFY(spy1.count() > 0);
QVERIFY(spy2.count() > 0);
- QCOMPARE(process->readAllStandardOutput(), QByteArray("Hello"));
- QCOMPARE(process->readAllStandardError(), QByteArray("Hello"));
-
- process->write("", 1);
- QVERIFY(process->waitForFinished(5000));
+ QCOMPARE(process.readAllStandardOutput(), QByteArray("Hello"));
+ QCOMPARE(process.readAllStandardError(), QByteArray("Hello"));
- delete process;
- process = 0;
+ process.write("", 1);
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Reading and writing to a process is not supported on Qt/CE
-//-----------------------------------------------------------------------------
void tst_QProcess::echoTestGui()
{
QProcess process;
@@ -555,6 +544,8 @@ void tst_QProcess::echoTestGui()
process.write("q");
QVERIFY(process.waitForFinished(50000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QCOMPARE(process.readAllStandardOutput(), QByteArray("Hello"));
QCOMPARE(process.readAllStandardError(), QByteArray("Hello"));
@@ -572,7 +563,6 @@ void tst_QProcess::testSetNamedPipeHandleState()
}
#endif // !Q_OS_WINCE && Q_OS_WIN
-//-----------------------------------------------------------------------------
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Batch files are not supported on Windows CE
void tst_QProcess::batFiles_data()
@@ -594,6 +584,8 @@ void tst_QProcess::batFiles()
proc.start(batFile, QStringList());
QVERIFY(proc.waitForFinished(5000));
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
QVERIFY(proc.bytesAvailable() > 0);
@@ -601,7 +593,6 @@ void tst_QProcess::batFiles()
}
#endif // !Q_OS_WINCE && Q_OS_WIN
-//-----------------------------------------------------------------------------
void tst_QProcess::exitStatus_data()
{
QTest::addColumn<QStringList>("processList");
@@ -628,79 +619,75 @@ void tst_QProcess::exitStatus_data()
void tst_QProcess::exitStatus()
{
- process = new QProcess;
+ QProcess process;
QFETCH(QStringList, processList);
QFETCH(QList<QProcess::ExitStatus>, exitStatus);
QCOMPARE(exitStatus.count(), processList.count());
for (int i = 0; i < processList.count(); ++i) {
- process->start(processList.at(i));
- QVERIFY(process->waitForStarted(5000));
- QVERIFY(process->waitForFinished(30000));
+ process.start(processList.at(i));
+ QVERIFY(process.waitForStarted(5000));
+ QVERIFY(process.waitForFinished(30000));
- QCOMPARE(process->exitStatus(), exitStatus.at(i));
+ QCOMPARE(process.exitStatus(), exitStatus.at(i));
}
-
- process->deleteLater();
- process = 0;
}
-//-----------------------------------------------------------------------------
+
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::loopBackTest()
{
- process = new QProcess;
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ QProcess process;
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
for (int i = 0; i < 100; ++i) {
- process->write("Hello");
+ process.write("Hello");
do {
- QVERIFY(process->waitForReadyRead(5000));
- } while (process->bytesAvailable() < 5);
- QCOMPARE(process->readAll(), QByteArray("Hello"));
+ QVERIFY(process.waitForReadyRead(5000));
+ } while (process.bytesAvailable() < 5);
+ QCOMPARE(process.readAll(), QByteArray("Hello"));
}
- process->write("", 1);
- QVERIFY(process->waitForFinished(5000));
-
- delete process;
- process = 0;
+ process.write("", 1);
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::readTimeoutAndThenCrash()
{
- process = new QProcess;
- process->start("testProcessEcho/testProcessEcho");
- if (process->state() != QProcess::Starting)
- QCOMPARE(process->state(), QProcess::Running);
+ QProcess process;
+ process.start("testProcessEcho/testProcessEcho");
+ if (process.state() != QProcess::Starting)
+ QCOMPARE(process.state(), QProcess::Running);
- QVERIFY(process->waitForStarted(5000));
- QCOMPARE(process->state(), QProcess::Running);
+ QVERIFY(process.waitForStarted(5000));
+ QCOMPARE(process.state(), QProcess::Running);
- QVERIFY(!process->waitForReadyRead(5000));
- QCOMPARE(process->error(), QProcess::Timedout);
+ QVERIFY(!process.waitForReadyRead(5000));
+ QCOMPARE(process.error(), QProcess::Timedout);
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
- QSignalSpy spy(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QSignalSpy spy(&process, &QProcess::errorOccurred);
+ QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
- process->kill();
+ process.kill();
- QVERIFY(process->waitForFinished(5000));
- QCOMPARE(process->state(), QProcess::NotRunning);
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.state(), QProcess::NotRunning);
QCOMPARE(spy.count(), 1);
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
-
- delete process;
- process = 0;
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy2.at(0).at(0).constData()), QProcess::Crashed);
}
#endif
@@ -747,10 +734,11 @@ void tst_QProcess::deadWhileReading()
QCOMPARE(output.count("\n"), 10*1024);
process.waitForFinished();
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::restartProcessDeadlock()
@@ -759,28 +747,31 @@ void tst_QProcess::restartProcessDeadlock()
// The purpose of this test is to detect whether restarting a
// process in the finished() connected slot causes a deadlock
// because of the way QProcessManager uses its locks.
- QProcess proc;
- process = &proc;
- connect(process, SIGNAL(finished(int)), this, SLOT(restartProcess()));
+ QProcess process;
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::restartProcess);
- process->start("testProcessEcho/testProcessEcho");
+ process.start("testProcessEcho/testProcessEcho");
- QCOMPARE(process->write("", 1), qlonglong(1));
- QVERIFY(process->waitForFinished(5000));
+ QCOMPARE(process.write("", 1), qlonglong(1));
+ QVERIFY(process.waitForFinished(5000));
- process->disconnect(SIGNAL(finished(int)));
+ QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), Q_NULLPTR, Q_NULLPTR);
- QCOMPARE(process->write("", 1), qlonglong(1));
- QVERIFY(process->waitForFinished(5000));
+ QCOMPARE(process.write("", 1), qlonglong(1));
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
void tst_QProcess::restartProcess()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
process->start("testProcessEcho/testProcessEcho");
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::closeWriteChannel()
@@ -805,10 +796,11 @@ void tst_QProcess::closeWriteChannel()
if (more.state() == QProcess::Running)
more.write("q");
QVERIFY(more.waitForFinished(5000));
+ QCOMPARE(more.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(more.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE"
void tst_QProcess::closeReadChannel()
@@ -836,11 +828,12 @@ void tst_QProcess::closeReadChannel()
proc.write("", 1);
QVERIFY(proc.waitForFinished(5000));
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
}
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::openModes()
@@ -885,14 +878,13 @@ void tst_QProcess::openModes()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
{
QProcess proc;
- connect(&proc, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
+ connect(&proc, &QIODevice::readyRead, this, &tst_QProcess::exitLoopSlot);
QSignalSpy spy(&proc, &QProcess::readyRead);
QVERIFY(spy.isValid());
@@ -912,16 +904,17 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
QVERIFY(QTestEventLoop::instance().timeout());
QVERIFY(!proc.waitForReadyRead(250));
- QObject::disconnect(&proc, SIGNAL(readyRead()), 0, 0);
+ QObject::disconnect(&proc, &QIODevice::readyRead, Q_NULLPTR, Q_NULLPTR);
proc.write("B");
QVERIFY(proc.waitForReadyRead(5000));
proc.write("", 1);
QVERIFY(proc.waitForFinished(5000));
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::hardExit()
{
QProcess proc;
@@ -945,7 +938,6 @@ void tst_QProcess::hardExit()
QCOMPARE(int(proc.error()), int(QProcess::Crashed));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::softExit()
{
QProcess proc;
@@ -976,30 +968,30 @@ public:
SoftExitProcess(int n) : waitedForFinished(false), n(n), killing(false)
{
- connect(this, SIGNAL(finished(int,QProcess::ExitStatus)),
- this, SLOT(finishedSlot(int,QProcess::ExitStatus)));
+ connect(this, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
+ this, &SoftExitProcess::finishedSlot);
switch (n) {
case 0:
setReadChannelMode(QProcess::MergedChannels);
- connect(this, SIGNAL(readyRead()), this, SLOT(terminateSlot()));
+ connect(this, &QIODevice::readyRead, this, &SoftExitProcess::terminateSlot);
break;
case 1:
- connect(this, SIGNAL(readyReadStandardOutput()),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::readyReadStandardOutput,
+ this, &SoftExitProcess::terminateSlot);
break;
case 2:
- connect(this, SIGNAL(readyReadStandardError()),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::readyReadStandardError,
+ this, &SoftExitProcess::terminateSlot);
break;
case 3:
- connect(this, SIGNAL(started()),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::started,
+ this, &SoftExitProcess::terminateSlot);
break;
case 4:
default:
- connect(this, SIGNAL(stateChanged(QProcess::ProcessState)),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::stateChanged,
+ this, &SoftExitProcess::terminateSlot);
break;
}
}
@@ -1055,7 +1047,6 @@ private:
QByteArray dataToWrite;
};
-//-----------------------------------------------------------------------------
void tst_QProcess::softExitInSlots_data()
{
QTest::addColumn<QString>("appName");
@@ -1065,7 +1056,6 @@ void tst_QProcess::softExitInSlots_data()
#endif
QTest::newRow("console app") << "testProcessEcho2/testProcessEcho2";
}
-//-----------------------------------------------------------------------------
void tst_QProcess::softExitInSlots()
{
@@ -1081,7 +1071,6 @@ void tst_QProcess::softExitInSlots()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::mergedChannels()
@@ -1103,10 +1092,11 @@ void tst_QProcess::mergedChannels()
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
@@ -1142,6 +1132,8 @@ void tst_QProcess::forwardedChannels()
QCOMPARE(process.write("input"), 5);
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
const char *err;
switch (process.exitCode()) {
case 0: err = "ok"; break;
@@ -1161,7 +1153,6 @@ void tst_QProcess::forwardedChannels()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::atEnd()
@@ -1182,6 +1173,8 @@ void tst_QProcess::atEnd()
process.write("", 1);
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
@@ -1200,8 +1193,8 @@ protected:
exitCode = 90210;
QProcess process;
- connect(&process, SIGNAL(finished(int)), this, SLOT(catchExitCode(int)),
- Qt::DirectConnection);
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &TestThread::catchExitCode, Qt::DirectConnection);
process.start("testProcessEcho/testProcessEcho");
@@ -1222,7 +1215,6 @@ private:
int exitCode;
};
-//-----------------------------------------------------------------------------
void tst_QProcess::processInAThread()
{
for (int i = 0; i < 10; ++i) {
@@ -1233,7 +1225,6 @@ void tst_QProcess::processInAThread()
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::processesInMultipleThreads()
{
for (int i = 0; i < 10; ++i) {
@@ -1258,61 +1249,58 @@ void tst_QProcess::processesInMultipleThreads()
}
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForFinishedWithTimeout()
{
- process = new QProcess(this);
-
- process->start("testProcessEcho/testProcessEcho");
+ QProcess process;
- QVERIFY(process->waitForStarted(5000));
- QVERIFY(!process->waitForFinished(1));
+ process.start("testProcessEcho/testProcessEcho");
- process->write("", 1);
+ QVERIFY(process.waitForStarted(5000));
+ QVERIFY(!process.waitForFinished(1));
- QVERIFY(process->waitForFinished());
+ process.write("", 1);
- delete process;
- process = 0;
+ QVERIFY(process.waitForFinished());
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForReadyReadInAReadyReadSlot()
{
- process = new QProcess(this);
- connect(process, SIGNAL(readyRead()), this, SLOT(waitForReadyReadInAReadyReadSlotSlot()));
- connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::waitForReadyReadInAReadyReadSlotSlot);
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::exitLoopSlot);
bytesAvailable = 0;
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
- QSignalSpy spy(process, &QProcess::readyRead);
+ QSignalSpy spy(&process, &QProcess::readyRead);
QVERIFY(spy.isValid());
- process->write("foo");
+ process.write("foo");
QTestEventLoop::instance().enterLoop(30);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(spy.count(), 1);
- process->disconnect();
- QVERIFY(process->waitForFinished(5000));
- QVERIFY(process->bytesAvailable() > bytesAvailable);
- delete process;
- process = 0;
+ process.disconnect();
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ QVERIFY(process.bytesAvailable() > bytesAvailable);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
bytesAvailable = process->bytesAvailable();
process->write("bar", 4);
QVERIFY(process->waitForReadyRead(5000));
@@ -1320,44 +1308,44 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot()
{
- process = new QProcess(this);
- connect(process, SIGNAL(bytesWritten(qint64)), this, SLOT(waitForBytesWrittenInABytesWrittenSlotSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::bytesWritten, this, &tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot);
bytesAvailable = 0;
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
- QSignalSpy spy(process, &QProcess::bytesWritten);
+ QSignalSpy spy(&process, &QProcess::bytesWritten);
QVERIFY(spy.isValid());
- process->write("f");
+ process.write("f");
QTestEventLoop::instance().enterLoop(30);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(spy.count(), 1);
- process->write("", 1);
- process->disconnect();
- QVERIFY(process->waitForFinished());
- delete process;
- process = 0;
+ process.write("", 1);
+ process.disconnect();
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
process->write("b");
QVERIFY(process->waitForBytesWritten(5000));
QTestEventLoop::instance().exitLoop();
}
#endif
-//-----------------------------------------------------------------------------
+
void tst_QProcess::spaceArgsTest_data()
{
QTest::addColumn<QStringList>("args");
@@ -1410,7 +1398,6 @@ static QByteArray startFailMessage(const QString &program, const QProcess &proce
return result;
}
-//-----------------------------------------------------------------------------
void tst_QProcess::spaceArgsTest()
{
QFETCH(QStringList, args);
@@ -1421,11 +1408,11 @@ void tst_QProcess::spaceArgsTest()
<< QString::fromLatin1("testProcessSpacesArgs/one space")
<< QString::fromLatin1("testProcessSpacesArgs/two space s");
- process = new QProcess(this);
+ QProcess process;
for (int i = 0; i < programs.size(); ++i) {
QString program = programs.at(i);
- process->start(program, args);
+ process.start(program, args);
#if defined(Q_OS_WINCE)
const int timeOutMS = 10000;
@@ -1433,14 +1420,16 @@ void tst_QProcess::spaceArgsTest()
const int timeOutMS = 5000;
#endif
QByteArray errorMessage;
- bool started = process->waitForStarted(timeOutMS);
+ bool started = process.waitForStarted(timeOutMS);
if (!started)
- errorMessage = startFailMessage(program, *process);
+ errorMessage = startFailMessage(program, process);
QVERIFY2(started, errorMessage.constData());
- QVERIFY(process->waitForFinished(timeOutMS));
+ QVERIFY(process.waitForFinished(timeOutMS));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
#if !defined(Q_OS_WINCE)
- QStringList actual = QString::fromLatin1(process->readAll()).split("|");
+ QStringList actual = QString::fromLatin1(process.readAll()).split("|");
#endif
#if !defined(Q_OS_WINCE)
QVERIFY(!actual.isEmpty());
@@ -1457,16 +1446,16 @@ void tst_QProcess::spaceArgsTest()
program += QString::fromLatin1(" ") + stringArgs;
errorMessage.clear();
- process->start(program);
- started = process->waitForStarted(5000);
+ process.start(program);
+ started = process.waitForStarted(5000);
if (!started)
- errorMessage = startFailMessage(program, *process);
+ errorMessage = startFailMessage(program, process);
QVERIFY2(started, errorMessage.constData());
- QVERIFY(process->waitForFinished(5000));
+ QVERIFY(process.waitForFinished(5000));
#if !defined(Q_OS_WINCE)
- actual = QString::fromLatin1(process->readAll()).split("|");
+ actual = QString::fromLatin1(process.readAll()).split("|");
#endif
#if !defined(Q_OS_WINCE)
QVERIFY(!actual.isEmpty());
@@ -1476,14 +1465,10 @@ void tst_QProcess::spaceArgsTest()
QCOMPARE(actual, args);
#endif
}
-
- delete process;
- process = 0;
}
#if defined(Q_OS_WIN)
-//-----------------------------------------------------------------------------
void tst_QProcess::nativeArguments()
{
QProcess proc;
@@ -1501,6 +1486,8 @@ void tst_QProcess::nativeArguments()
QVERIFY(proc.waitForStarted(10000));
QVERIFY(proc.waitForFinished(10000));
#endif
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
#if defined(Q_OS_WINCE)
// WinCE test outputs to a file, so check that
@@ -1527,7 +1514,6 @@ void tst_QProcess::nativeArguments()
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::exitCodeTest()
{
for (int i = 0; i < 255; ++i) {
@@ -1544,7 +1530,6 @@ void tst_QProcess::exitCodeTest()
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::failToStart()
{
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
@@ -1556,12 +1541,14 @@ void tst_QProcess::failToStart()
QProcess process;
QSignalSpy stateSpy(&process, &QProcess::stateChanged);
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(stateSpy.isValid());
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
QVERIFY(finishedSpy2.isValid());
@@ -1578,6 +1565,7 @@ void tst_QProcess::failToStart()
for (int j = 0; j < 8; ++j) {
for (int i = 0; i < attempts; ++i) {
QCOMPARE(errorSpy.count(), j * attempts + i);
+ QCOMPARE(errorSpy2.count(), j * attempts + i);
process.start("/blurp");
switch (j) {
@@ -1602,6 +1590,7 @@ void tst_QProcess::failToStart()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), j * attempts + i + 1);
+ QCOMPARE(errorSpy2.count(), j * attempts + i + 1);
QCOMPARE(finishedSpy.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
@@ -1614,7 +1603,6 @@ void tst_QProcess::failToStart()
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::failToStartWithWait()
{
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
@@ -1625,11 +1613,13 @@ void tst_QProcess::failToStartWithWait()
QProcess process;
QEventLoop loop;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
QVERIFY(finishedSpy2.isValid());
@@ -1639,12 +1629,12 @@ void tst_QProcess::failToStartWithWait()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), i + 1);
+ QCOMPARE(errorSpy2.count(), i + 1);
QCOMPARE(finishedSpy.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::failToStartWithEventLoop()
{
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
@@ -1655,16 +1645,18 @@ void tst_QProcess::failToStartWithEventLoop()
QProcess process;
QEventLoop loop;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
QVERIFY(finishedSpy2.isValid());
// The error signal may be emitted before start() returns
- connect(&process, SIGNAL(error(QProcess::ProcessError)), &loop, SLOT(quit()), Qt::QueuedConnection);
+ connect(&process, &QProcess::errorOccurred, &loop, &QEventLoop::quit, Qt::QueuedConnection);
for (int i = 0; i < 50; ++i) {
@@ -1674,6 +1666,7 @@ void tst_QProcess::failToStartWithEventLoop()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), i + 1);
+ QCOMPARE(errorSpy2.count(), i + 1);
QCOMPARE(finishedSpy.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
}
@@ -1693,7 +1686,7 @@ void tst_QProcess::failToStartEmptyArgs()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QProcess process;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QSignalSpy errorSpy(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(errorSpy.isValid());
switch (startOverload) {
@@ -1715,12 +1708,11 @@ void tst_QProcess::failToStartEmptyArgs()
QCOMPARE(process.error(), QProcess::FailedToStart);
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::removeFileWhileProcessIsRunning()
{
- QFile file("removeFile.txt");
+ QFile file(m_temporaryDir.path() + QLatin1String("/removeFile.txt"));
QVERIFY(file.open(QFile::WriteOnly));
QProcess process;
@@ -1732,9 +1724,10 @@ void tst_QProcess::removeFileWhileProcessIsRunning()
process.write("", 1);
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// OS doesn't support environment variables
void tst_QProcess::setEnvironment_data()
@@ -1812,7 +1805,6 @@ void tst_QProcess::setEnvironment()
}
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// OS doesn't support environment variables
void tst_QProcess::setProcessEnvironment_data()
@@ -1853,7 +1845,7 @@ void tst_QProcess::setProcessEnvironment()
}
}
#endif
-//-----------------------------------------------------------------------------
+
void tst_QProcess::systemEnvironment()
{
#if defined (Q_OS_WINCE)
@@ -1869,7 +1861,6 @@ void tst_QProcess::systemEnvironment()
#endif
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::spaceInName()
@@ -1879,10 +1870,11 @@ void tst_QProcess::spaceInName()
QVERIFY(process.waitForStarted());
process.write("", 1);
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::lockupsInStartDetached()
{
// Check that QProcess doesn't cause a lock up at this program's
@@ -1896,7 +1888,6 @@ void tst_QProcess::lockupsInStartDetached()
QProcess::startDetached("yjhbrty");
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::atEnd2()
@@ -1915,7 +1906,6 @@ void tst_QProcess::atEnd2()
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::waitForReadyReadForNonexistantProcess()
{
// Start a program that doesn't exist, process events and then try to waitForReadyRead
@@ -1923,11 +1913,13 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
QProcess process;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy1(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy1(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy1.isValid());
QVERIFY(finishedSpy2.isValid());
@@ -1939,27 +1931,30 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
#endif
QCOMPARE(errorSpy.count(), 1);
QCOMPARE(errorSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(errorSpy2.count(), 1);
+ QCOMPARE(errorSpy2.at(0).at(0).toInt(), 0);
QCOMPARE(finishedSpy1.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::setStandardInputFile()
{
static const char data[] = "A bunch\1of\2data\3\4\5\6\7...";
QProcess process;
- QFile file("data");
+ QFile file(m_temporaryDir.path() + QLatin1String("/data-sif"));
QVERIFY(file.open(QIODevice::WriteOnly));
file.write(data, sizeof data);
file.close();
- process.setStandardInputFile("data");
+ process.setStandardInputFile(file.fileName());
process.start("testProcessEcho/testProcessEcho");
- QPROCESS_VERIFY(process, waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QByteArray all = process.readAll();
QCOMPARE(all.size(), int(sizeof data) - 1); // testProcessEcho drops the ending \0
QVERIFY(all == data);
@@ -1967,13 +1962,12 @@ void tst_QProcess::setStandardInputFile()
QProcess process2;
process2.setStandardInputFile(QProcess::nullDevice());
process2.start("testProcessEcho/testProcessEcho");
- QPROCESS_VERIFY(process2, waitForFinished());
+ QVERIFY(process2.waitForFinished());
all = process2.readAll();
QCOMPARE(all.size(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::setStandardOutputFile_data()
@@ -2004,7 +1998,6 @@ void tst_QProcess::setStandardOutputFile_data()
<< true;
}
-//-----------------------------------------------------------------------------
void tst_QProcess::setStandardOutputFile()
{
static const char data[] = "Original data. ";
@@ -2018,7 +2011,7 @@ void tst_QProcess::setStandardOutputFile()
QIODevice::OpenMode mode = append ? QIODevice::Append : QIODevice::Truncate;
// create the destination file with data
- QFile file("data");
+ QFile file(m_temporaryDir.path() + QLatin1String("/data-stdof-") + QLatin1String(QTest::currentDataTag()));
QVERIFY(file.open(QIODevice::WriteOnly));
file.write(data, sizeof data - 1);
file.close();
@@ -2027,13 +2020,15 @@ void tst_QProcess::setStandardOutputFile()
QProcess process;
process.setReadChannelMode(channelMode);
if (channelToTest == QProcess::StandardOutput)
- process.setStandardOutputFile("data", mode);
+ process.setStandardOutputFile(file.fileName(), mode);
else
- process.setStandardErrorFile("data", mode);
+ process.setStandardErrorFile(file.fileName(), mode);
process.start("testProcessEcho2/testProcessEcho2");
process.write(testdata, sizeof testdata);
- QPROCESS_VERIFY(process,waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
// open the file again and verify the data
QVERIFY(file.open(QIODevice::ReadOnly));
@@ -2062,7 +2057,9 @@ void tst_QProcess::setStandardOutputFileNullDevice()
process.setStandardOutputFile(QProcess::nullDevice());
process.start("testProcessEcho2/testProcessEcho2");
process.write(testdata, sizeof testdata);
- QPROCESS_VERIFY(process,waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
QVERIFY(!QFileInfo(QProcess::nullDevice()).isFile());
@@ -2072,13 +2069,16 @@ void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten()
{
static const char testdata[] = "Test data.";
- QFile file("data");
+ QFile file(m_temporaryDir.path() + QLatin1String("/data-stdofawfbw"));
QProcess process;
process.setStandardOutputFile(file.fileName());
process.start("testProcessEcho2/testProcessEcho2");
+ QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
process.write(testdata, sizeof testdata);
process.waitForBytesWritten();
- QPROCESS_VERIFY(process, waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
// open the file again and verify the data
QVERIFY(file.open(QIODevice::ReadOnly));
@@ -2089,7 +2089,6 @@ void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::setStandardOutputProcess_data()
@@ -2119,8 +2118,12 @@ void tst_QProcess::setStandardOutputProcess()
if (waitForBytesWritten)
source.waitForBytesWritten();
source.closeWriteChannel();
- QPROCESS_VERIFY(source, waitForFinished());
- QPROCESS_VERIFY(sink, waitForFinished());
+ QVERIFY(source.waitForFinished());
+ QCOMPARE(source.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(source.exitCode(), 0);
+ QVERIFY(sink.waitForFinished());
+ QCOMPARE(sink.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(sink.exitCode(), 0);
QByteArray all = sink.readAll();
if (!merged)
@@ -2130,35 +2133,43 @@ void tst_QProcess::setStandardOutputProcess()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::fileWriterProcess()
{
- QString stdinStr;
- for (int i = 0; i < 5000; ++i)
- stdinStr += QString::fromLatin1("%1 -- testing testing 1 2 3\n").arg(i);
+ const QByteArray line = QByteArrayLiteral(" -- testing testing 1 2 3\n");
+ QByteArray stdinStr;
+ stdinStr.reserve(5000 * (4 + line.size()) + 1);
+ for (int i = 0; i < 5000; ++i) {
+ stdinStr += QByteArray::number(i);
+ stdinStr += line;
+ }
QTime stopWatch;
stopWatch.start();
+ const QString fileName = m_temporaryDir.path() + QLatin1String("/fileWriterProcess.txt");
+ const QString binary = QDir::currentPath() + QLatin1String("/fileWriterProcess/fileWriterProcess");
+
do {
- QFile::remove("fileWriterProcess.txt");
+ if (QFile::exists(fileName))
+ QVERIFY(QFile::remove(fileName));
QProcess process;
- process.start("fileWriterProcess/fileWriterProcess",
- QIODevice::ReadWrite | QIODevice::Text);
- process.write(stdinStr.toLatin1());
+ process.setWorkingDirectory(m_temporaryDir.path());
+ process.start(binary, QIODevice::ReadWrite | QIODevice::Text);
+ process.write(stdinStr);
process.closeWriteChannel();
while (process.bytesToWrite()) {
QVERIFY(stopWatch.elapsed() < 3500);
QVERIFY(process.waitForBytesWritten(2000));
}
QVERIFY(process.waitForFinished());
- QCOMPARE(QFile("fileWriterProcess.txt").size(), qint64(stdinStr.size()));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ QCOMPARE(QFile(fileName).size(), qint64(stdinStr.size()));
} while (stopWatch.elapsed() < 3000);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::detachedWorkingDirectoryAndPid()
{
qint64 pid;
@@ -2167,8 +2178,9 @@ void tst_QProcess::detachedWorkingDirectoryAndPid()
QTest::qSleep(1000);
#endif
- QFile infoFile(QDir::currentPath() + QLatin1String("/detachedinfo.txt"));
- infoFile.remove();
+ QFile infoFile(m_temporaryDir.path() + QLatin1String("/detachedinfo.txt"));
+ if (infoFile.exists())
+ QVERIFY(infoFile.remove());
QString workingDir = QDir::currentPath() + "/testDetached";
@@ -2202,7 +2214,6 @@ void tst_QProcess::detachedWorkingDirectoryAndPid()
QCOMPARE(actualPid, pid);
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::switchReadChannels()
@@ -2215,6 +2226,8 @@ void tst_QProcess::switchReadChannels()
process.write(data);
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
for (int i = 0; i < 4; ++i) {
process.setReadChannel(QProcess::StandardOutput);
@@ -2233,26 +2246,63 @@ void tst_QProcess::switchReadChannels()
}
#endif
-//-----------------------------------------------------------------------------
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#ifndef Q_OS_WINCE
+// Reading and writing to a process is not supported on Qt/CE
+void tst_QProcess::discardUnwantedOutput()
+{
+ QProcess process;
+
+ process.setProgram("testProcessEcho2/testProcessEcho2");
+ process.start(QIODevice::WriteOnly);
+ process.write("Hello, World");
+ process.closeWriteChannel();
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+
+ process.setReadChannel(QProcess::StandardOutput);
+ QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
+ process.setReadChannel(QProcess::StandardError);
+ QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
+}
+#endif
+
+#ifndef Q_OS_WINCE
// Q_OS_WIN - setWorkingDirectory will chdir before starting the process on unices
// Windows CE does not support working directory logic
void tst_QProcess::setWorkingDirectory()
{
- process = new QProcess;
- process->setWorkingDirectory("test");
- process->start("testSetWorkingDirectory/testSetWorkingDirectory");
- QVERIFY(process->waitForFinished());
+ QProcess process;
+ process.setWorkingDirectory("test");
+
+ // use absolute path because on Windows, the executable is relative to the parent's CWD
+ // while on Unix with fork it's relative to the child's (with posix_spawn, it could be either).
+ process.start(QFileInfo("testSetWorkingDirectory/testSetWorkingDirectory").absoluteFilePath());
+
+ QVERIFY2(process.waitForFinished(), process.errorString().toLocal8Bit());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
- QByteArray workingDir = process->readAllStandardOutput();
+ QByteArray workingDir = process.readAllStandardOutput();
QCOMPARE(QDir("test").canonicalPath(), QDir(workingDir.constData()).canonicalPath());
+}
- delete process;
- process = 0;
+void tst_QProcess::setNonExistentWorkingDirectory()
+{
+ QProcess process;
+ process.setWorkingDirectory("this/directory/should/not/exist/for/sure");
+
+ // use absolute path because on Windows, the executable is relative to the parent's CWD
+ // while on Unix with fork it's relative to the child's (with posix_spawn, it could be either).
+ process.start(QFileInfo("testSetWorkingDirectory/testSetWorkingDirectory").absoluteFilePath());
+ QVERIFY(!process.waitForFinished());
+#ifdef QPROCESS_USE_SPAWN
+ QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue);
+#endif
+ QCOMPARE(int(process.error()), int(QProcess::FailedToStart));
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::startFinishStartFinish()
{
QProcess process;
@@ -2266,12 +2316,14 @@ void tst_QProcess::startFinishStartFinish()
QCOMPARE(QString::fromLatin1(process.readLine().trimmed()),
QString("0 -this is a number"));
#endif
- if (process.state() != QProcess::NotRunning)
+ if (process.state() != QProcess::NotRunning) {
QVERIFY(process.waitForFinished(10000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ }
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::invalidProgramString_data()
{
QTest::addColumn<QString>("programString");
@@ -2286,24 +2338,26 @@ void tst_QProcess::invalidProgramString()
QProcess process;
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
- QSignalSpy spy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QSignalSpy spy(&process, &QProcess::errorOccurred);
+ QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
process.start(programString);
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy2.count(), 1);
QVERIFY(!QProcess::startDetached(programString));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::onlyOneStartedSignal()
{
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
QProcess process;
QSignalSpy spyStarted(&process, &QProcess::started);
- QSignalSpy spyFinished(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy spyFinished(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spyStarted.isValid());
QVERIFY(spyFinished.isValid());
@@ -2319,19 +2373,19 @@ void tst_QProcess::onlyOneStartedSignal()
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QCOMPARE(spyStarted.count(), 1);
QCOMPARE(spyFinished.count(), 1);
}
-//-----------------------------------------------------------------------------
-
class BlockOnReadStdOut : public QObject
{
Q_OBJECT
public:
BlockOnReadStdOut(QProcess *process)
{
- connect(process, SIGNAL(readyReadStandardOutput()), SLOT(block()));
+ connect(process, &QProcess::readyReadStandardOutput, this, &BlockOnReadStdOut::block);
}
public slots:
@@ -2346,7 +2400,8 @@ void tst_QProcess::finishProcessBeforeReadingDone()
QProcess process;
BlockOnReadStdOut blocker(&process);
QEventLoop loop;
- connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()));
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ &loop, &QEventLoop::quit);
process.start("testProcessOutput/testProcessOutput");
QVERIFY(process.waitForStarted());
loop.exec();
@@ -2354,6 +2409,8 @@ void tst_QProcess::finishProcessBeforeReadingDone()
QRegExp(QStringLiteral("[\r\n]")), QString::SkipEmptyParts);
QVERIFY(!lines.isEmpty());
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
//-----------------------------------------------------------------------------
@@ -2370,14 +2427,17 @@ void tst_QProcess::startStopStartStop()
QProcess process;
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
process.start("testExitCodes/testExitCodes", QStringList() << "1");
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 1);
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
}
@@ -2449,6 +2509,7 @@ void tst_QProcess::startStopStartStopBuffers()
process.write("line3\n");
process.closeWriteChannel();
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
if (channelMode2 == QProcess::MergedChannels) {
diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
index be9a38c499..2099101a91 100644
--- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
+++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -66,11 +66,19 @@ void tst_QProcessEnvironment::operator_eq()
QVERIFY(e1 == e2);
e1.clear();
- QVERIFY(e1 != e2);
+ QVERIFY(e1 == e2);
e2.clear();
+ QVERIFY(e1 == e2);
+
+ e1.insert("FOO", "bar");
+ QVERIFY(e1 != e2);
+ e2.insert("FOO", "bar");
QVERIFY(e1 == e2);
+
+ e2.insert("FOO", "baz");
+ QVERIFY(e1 != e2);
}
void tst_QProcessEnvironment::clearAndIsEmpty()
@@ -196,6 +204,15 @@ void tst_QProcessEnvironment::insertEnv()
QCOMPARE(e.value("Hello"), QString("Another World"));
QCOMPARE(e.value("FOO2"), QString("bar2"));
QCOMPARE(e.value("A2"), QString("bc2"));
+
+ QProcessEnvironment e3;
+ e3.insert("FOO2", "bar2");
+ e3.insert("A2", "bc2");
+ e3.insert("Hello", "Another World");
+
+ e3.insert(e3); // mustn't deadlock
+
+ QVERIFY(e3 == e2);
}
void tst_QProcessEnvironment::caseSensitivity()
diff --git a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp
index 5796636b92..6e6dc2df95 100644
--- a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp
+++ b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp
@@ -99,7 +99,7 @@ static inline QByteArray msgCannotOpen(const QFileDevice &f)
void tst_QSaveFile::transactionalWrite()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QFile::remove(targetFile);
QSaveFile file(targetFile);
@@ -134,7 +134,7 @@ void tst_QSaveFile::saveTwice()
// Check that we can reuse a QSaveFile object
// (and test the case of an existing target file)
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -153,7 +153,7 @@ void tst_QSaveFile::saveTwice()
void tst_QSaveFile::textStreamManualFlush()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -174,7 +174,7 @@ void tst_QSaveFile::textStreamManualFlush()
void tst_QSaveFile::textStreamAutoFlush()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -206,7 +206,7 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnDir()
#endif
QFETCH(bool, directWriteFallback);
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
QVERIFY(QFile(dir.path()).setPermissions(QFile::ReadOwner | QFile::ExeOwner));
PermissionRestorer permissionRestorer(dir.path());
@@ -264,7 +264,7 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnFile()
#endif
// Setup an existing but readonly file
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QFile file(targetFile);
PermissionRestorer permissionRestorer(targetFile);
@@ -285,7 +285,7 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnFile()
void tst_QSaveFile::transactionalWriteCanceled()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QFile::remove(targetFile);
QSaveFile file(targetFile);
@@ -313,7 +313,7 @@ void tst_QSaveFile::transactionalWriteErrorRenaming()
QSKIP("Test is not applicable with root privileges");
#endif
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -347,7 +347,7 @@ void tst_QSaveFile::symlink()
#ifdef Q_OS_UNIX
QByteArray someData = "some data";
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QLatin1String("/outfile");
const QString linkFile = dir.path() + QLatin1String("/linkfile");
@@ -400,7 +400,7 @@ void tst_QSaveFile::symlink()
// link to a link in another directory
QTemporaryDir dir2;
- QVERIFY(dir2.isValid());
+ QVERIFY2(dir2.isValid(), qPrintable(dir2.errorString()));
const QString linkFile2 = dir2.path() + QLatin1String("/linkfile");
QVERIFY(QFile::link(linkFile, linkFile2));
@@ -458,7 +458,7 @@ void tst_QSaveFile::symlink()
void tst_QSaveFile::directory()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString subdir = dir.path() + QLatin1String("/subdir");
QVERIFY(QDir(dir.path()).mkdir(QStringLiteral("subdir")));
diff --git a/tests/auto/corelib/io/qsettings/BLACKLIST b/tests/auto/corelib/io/qsettings/BLACKLIST
new file mode 100644
index 0000000000..317e97730e
--- /dev/null
+++ b/tests/auto/corelib/io/qsettings/BLACKLIST
@@ -0,0 +1,3 @@
+[isWritable:native]
+osx-10.10
+osx-10.11
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index e2e1d99657..19155cc3ad 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -37,6 +37,7 @@
#include <QtCore/QSettings>
#include <private/qsettings_p.h>
#include <QtCore/QCoreApplication>
+#include <QtCore/QDateTime>
#include <QtCore/QtGlobal>
#include <QtCore/QMetaType>
#include <QtCore/QString>
@@ -88,12 +89,11 @@ class tst_QSettings : public QObject
Q_OBJECT
public:
- tst_QSettings() : m_canWriteNativeSystemSettings(canWriteNativeSystemSettings()) {}
+ tst_QSettings();
public slots:
void initTestCase();
- void init();
- void cleanup();
+ void cleanup() { cleanupTestFiles(); }
private slots:
void getSetCheck();
void ctor_data();
@@ -164,6 +164,8 @@ private slots:
void bom();
private:
+ void cleanupTestFiles();
+
const bool m_canWriteNativeSystemSettings;
};
@@ -179,39 +181,16 @@ void tst_QSettings::getSetCheck()
QCOMPARE(true, obj1.fallbacksEnabled());
}
-#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
-static void removePath(const QString& _path)
-{
- QString path = _path;
- QDir dir(path);
- if (!dir.exists())
- return;
- QStringList entries = dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot);
- foreach(QString name, entries) {
- QString absolute = path + name;
- if (QFileInfo(absolute).isDir())
- removePath(absolute+"\\");
- else
- QFile::remove(absolute);
- }
- dir.cdUp();
- if (path[path.size()-1] == '\\')
- path = path.left(path.size()-1);
- dir.rmdir(path.mid(path.lastIndexOf('\\')+1));
-}
-#endif
-
-static QString settingsPath(const char *path = "")
+static QString settingsPath(const char *path = Q_NULLPTR)
{
// Temporary path for files that are specified explicitly in the constructor.
#ifndef Q_OS_WINRT
- QString tempPath = QDir::tempPath();
+ static const QString tempPath = QDir::tempPath() + QLatin1String("/tst_QSettings");
#else
- QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
+ static const QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
+ + QLatin1String("/tst_QSettings");
#endif
- if (tempPath.endsWith("/"))
- tempPath.truncate(tempPath.size() - 1);
- return QDir::toNativeSeparators(tempPath + "/tst_QSettings/" + QLatin1String(path));
+ return path && *path ? tempPath + QLatin1Char('/') + QLatin1String(path) : tempPath;
}
static bool readCustom1File(QIODevice &device, QSettings::SettingsMap &map)
@@ -281,6 +260,12 @@ static void populateWithFormats()
QTest::newRow("custom2") << QSettings::CustomFormat2;
}
+tst_QSettings::tst_QSettings()
+ : m_canWriteNativeSystemSettings(canWriteNativeSystemSettings())
+{
+ QStandardPaths::setTestModeEnabled(true);
+}
+
void tst_QSettings::initTestCase()
{
if (!m_canWriteNativeSystemSettings)
@@ -293,13 +278,19 @@ void tst_QSettings::initTestCase()
);
QVERIFY(custom1 == QSettings::CustomFormat1);
QVERIFY(custom2 == QSettings::CustomFormat2);
+
+ cleanupTestFiles();
}
-void tst_QSettings::init()
+void tst_QSettings::cleanupTestFiles()
{
QSettings::setSystemIniPath(settingsPath("__system__"));
QSettings::setUserIniPath(settingsPath("__user__"));
+ QDir settingsDir(settingsPath());
+ if (settingsDir.exists())
+ QVERIFY(settingsDir.removeRecursively());
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
QSettings("HKEY_CURRENT_USER\\Software\\software.org", QSettings::NativeFormat).clear();
QSettings("HKEY_CURRENT_USER\\Software\\other.software.org", QSettings::NativeFormat).clear();
@@ -315,17 +306,7 @@ void tst_QSettings::init()
QSettings("HKEY_LOCAL_MACHINE\\Software\\bat", QSettings::NativeFormat).clear();
QSettings("HKEY_LOCAL_MACHINE\\Software\\baz", QSettings::NativeFormat).clear();
}
- if (QDir(settingsPath()).exists()) {
-#if defined(Q_OS_WINCE)
- removePath(settingsPath());
-#else
- if (QSysInfo::windowsVersion() & QSysInfo::WV_NT_based)
- system(QString("rmdir /Q /S %1").arg(settingsPath()).toLatin1());
- else
- system(QString("deltree /Y %1").arg(settingsPath()).toLatin1());
-#endif
- }
-#elif defined(Q_OS_DARWIN)
+#elif defined(Q_OS_DARWIN) || defined(Q_OS_WINRT)
QSettings(QSettings::UserScope, "software.org", "KillerAPP").clear();
QSettings(QSettings::SystemScope, "software.org", "KillerAPP").clear();
QSettings(QSettings::UserScope, "other.software.org", "KillerAPP").clear();
@@ -336,31 +317,16 @@ void tst_QSettings::init()
QSettings(QSettings::SystemScope, "other.software.org").clear();
#endif
-#if !defined(Q_OS_WIN)
- system(QString("chmod -R u+rw %1 2> /dev/null").arg(settingsPath()).toLatin1());
- system(QString("rm -fr %1 2> /dev/null").arg(settingsPath()).toLatin1());
-#endif
+ const QString foo(QLatin1String("foo"));
#if defined(Q_OS_WINRT)
- QSettings(QSettings::UserScope, "software.org", "KillerAPP").clear();
- QSettings(QSettings::SystemScope, "software.org", "KillerAPP").clear();
- QSettings(QSettings::UserScope, "other.software.org", "KillerAPP").clear();
- QSettings(QSettings::SystemScope, "other.software.org", "KillerAPP").clear();
- QSettings(QSettings::UserScope, "software.org").clear();
- QSettings(QSettings::SystemScope, "software.org").clear();
- QSettings(QSettings::UserScope, "other.software.org").clear();
- QSettings(QSettings::SystemScope, "other.software.org").clear();
- QSettings("foo", QSettings::NativeFormat).clear();
- removePath(settingsPath());
- QFile::remove(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/foo");
+ QSettings(foo, QSettings::NativeFormat).clear();
+ QFile fooFile(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QLatin1Char('/') + foo);
#else
- QFile::remove("foo");
+ QFile fooFile(foo);
#endif
-}
-
-void tst_QSettings::cleanup()
-{
- init();
+ if (fooFile.exists())
+ QVERIFY2(fooFile.remove(), qPrintable(fooFile.errorString()));
}
/*
@@ -1201,6 +1167,9 @@ void tst_QSettings::testVariantTypes()
QList<QVariant> l4;
l4 << QVariant(m2) << QVariant(l2) << QVariant(l3);
testVal("key13", l4, QVariantList, List);
+ QDateTime dt = QDateTime::currentDateTime();
+ dt.setOffsetFromUtc(3600);
+ testVal("key14", dt, QDateTime, DateTime);
// We store key sequences as strings instead of binary variant blob, for improved
// readability in the resulting format.
@@ -3327,7 +3296,7 @@ void tst_QSettings::dontReorderIniKeysNeedlessly()
QString outFileName2;
QTemporaryFile outFile;
- outFile.open();
+ QVERIFY2(outFile.open(), qPrintable(outFile.errorString()));
outFile.write(contentsBefore);
outFileName = outFile.fileName();
outFile.close();
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index efb343cf85..50c5b938e9 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -56,6 +56,7 @@ class tst_qstandardpaths : public QObject
Q_OBJECT
private slots:
+ void initTestCase();
void dump();
void testDefaultLocations();
void testCustomLocations();
@@ -128,6 +129,14 @@ static const char * const enumNames[MaxStandardLocation + 1 - int(QStandardPaths
"AppConfigLocation"
};
+void tst_qstandardpaths::initTestCase()
+{
+ QVERIFY2(m_localConfigTempDir.isValid(), qPrintable(m_localConfigTempDir.errorString()));
+ QVERIFY2(m_globalConfigTempDir.isValid(), qPrintable(m_globalConfigTempDir.errorString()));
+ QVERIFY2(m_localAppTempDir.isValid(), qPrintable(m_localAppTempDir.errorString()));
+ QVERIFY2(m_globalAppTempDir.isValid(), qPrintable(m_globalAppTempDir.errorString()));
+}
+
void tst_qstandardpaths::dump()
{
#ifdef Q_XDG_PLATFORM
@@ -455,6 +464,15 @@ void tst_qstandardpaths::testCustomRuntimeDirectory()
#endif
#ifdef Q_XDG_PLATFORM
+ struct EnvVarRestorer
+ {
+ EnvVarRestorer() : origRuntimeDir(qgetenv("XDG_RUNTIME_DIR")) {}
+ ~EnvVarRestorer() { qputenv("XDG_RUNTIME_DIR", origRuntimeDir.constData()); }
+ const QByteArray origRuntimeDir;
+ };
+ EnvVarRestorer restorer;
+
+ // When $XDG_RUNTIME_DIR points to a directory with wrong ownership, QStandardPaths should warn
qputenv("XDG_RUNTIME_DIR", QFile::encodeName("/tmp"));
// It's very unlikely that /tmp is 0600 or that we can chmod it
// The call below outputs
@@ -465,6 +483,20 @@ void tst_qstandardpaths::testCustomRuntimeDirectory()
qPrintable(QString::fromLatin1("QStandardPaths: wrong ownership on runtime directory /tmp, 0 instead of %1").arg(uid)));
const QString runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
QVERIFY2(runtimeDir.isEmpty(), qPrintable(runtimeDir));
+
+ // When $XDG_RUNTIME_DIR points to a non-existing directory, QStandardPaths should warn (QTBUG-48771)
+ qputenv("XDG_RUNTIME_DIR", "does_not_exist");
+ QTest::ignoreMessage(QtWarningMsg, "QStandardPaths: XDG_RUNTIME_DIR points to non-existing path 'does_not_exist', please create it with 0700 permissions.");
+ const QString nonExistingRuntimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
+ QVERIFY2(nonExistingRuntimeDir.isEmpty(), qPrintable(nonExistingRuntimeDir));
+
+ // When $XDG_RUNTIME_DIR points to a file, QStandardPaths should warn
+ const QString file = QFINDTESTDATA("tst_qstandardpaths.cpp");
+ QVERIFY(!file.isEmpty());
+ qputenv("XDG_RUNTIME_DIR", QFile::encodeName(file));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QStandardPaths: XDG_RUNTIME_DIR points to '%1' which is not a directory").arg(file)));
+ const QString noRuntimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
+ QVERIFY2(noRuntimeDir.isEmpty(), qPrintable(file));
#endif
}
diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
index a7a0cf4ddb..efbcdc78e0 100644
--- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
+++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
@@ -153,7 +153,7 @@ void tst_QStorageInfo::storageList()
void tst_QStorageInfo::tempFile()
{
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QStorageInfo storage1(file.fileName());
#ifdef Q_OS_LINUX
@@ -174,7 +174,7 @@ void tst_QStorageInfo::tempFile()
void tst_QStorageInfo::caching()
{
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QStorageInfo storage1(file.fileName());
#ifdef Q_OS_LINUX
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
index 3e98a369ce..621e215d60 100644
--- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
+++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
@@ -93,6 +93,7 @@ void tst_QTemporaryDir::construction()
QCOMPARE(dir.path().left(tmp.size()), tmp);
QVERIFY(dir.path().contains("tst_qtemporarydir"));
QVERIFY(QFileInfo(dir.path()).isDir());
+ QCOMPARE(dir.errorString(), QString());
}
// Testing get/set functions
@@ -228,6 +229,13 @@ void tst_QTemporaryDir::autoRemove()
void tst_QTemporaryDir::nonWritableCurrentDir()
{
#ifdef Q_OS_UNIX
+
+# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ const char nonWritableDir[] = "/data";
+# else
+ const char nonWritableDir[] = "/home";
+# endif
+
if (::geteuid() == 0)
QSKIP("not valid running this test as root");
@@ -239,18 +247,19 @@ void tst_QTemporaryDir::nonWritableCurrentDir()
}
QString dir;
};
- ChdirOnReturn cor(QDir::currentPath());
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
- QDir::setCurrent("/data");
-#else
- QDir::setCurrent("/home");
-#endif
+ const QFileInfo nonWritableDirFi = QFileInfo(QLatin1String(nonWritableDir));
+ QVERIFY(nonWritableDirFi.isDir());
+ QVERIFY(!nonWritableDirFi.isWritable());
+
+ ChdirOnReturn cor(QDir::currentPath());
+ QVERIFY(QDir::setCurrent(nonWritableDirFi.absoluteFilePath()));
// QTemporaryDir("tempXXXXXX") is probably a bad idea in any app
// where the current dir could anything...
QTemporaryDir dir("tempXXXXXX");
dir.setAutoRemove(true);
QVERIFY(!dir.isValid());
+ QVERIFY(!dir.errorString().isEmpty());
QVERIFY(dir.path().isEmpty());
#endif
}
@@ -287,7 +296,11 @@ void tst_QTemporaryDir::stressTest()
for (int i = 0; i < iterations; ++i) {
QTemporaryDir dir(pattern);
dir.setAutoRemove(false);
- QVERIFY2(dir.isValid(), qPrintable(QString::fromLatin1("Failed to create #%1 under %2.").arg(i).arg(QDir::toNativeSeparators(pattern))));
+ QVERIFY2(dir.isValid(),
+ qPrintable(QString::fromLatin1("Failed to create #%1 under %2: %3.")
+ .arg(i)
+ .arg(QDir::toNativeSeparators(pattern))
+ .arg(dir.errorString())));
QVERIFY(!names.contains(dir.path()));
names.insert(dir.path());
}
diff --git a/tests/auto/corelib/io/qtextstream/BLACKLIST b/tests/auto/corelib/io/qtextstream/BLACKLIST
new file mode 100644
index 0000000000..bc3f118b33
--- /dev/null
+++ b/tests/auto/corelib/io/qtextstream/BLACKLIST
@@ -0,0 +1,2 @@
+[stillOpenWhenAtEnd]
+windows
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index 36da3b8770..3ab53848d8 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -163,6 +163,7 @@ private slots:
void string_write_operator_ToDevice_data();
void string_write_operator_ToDevice();
void latin1String_write_operator_ToDevice();
+ void stringref_write_operator_ToDevice();
// other
void skipWhiteSpace_data();
@@ -258,6 +259,7 @@ tst_QTextStream::tst_QTextStream()
void tst_QTextStream::initTestCase()
{
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
QVERIFY(!m_rfc3261FilePath.isEmpty());
QVERIFY(!m_shiftJisFilePath.isEmpty());
@@ -2553,6 +2555,22 @@ void tst_QTextStream::latin1String_write_operator_ToDevice()
QCOMPARE(buf.buffer().constData(), "No explicit lengthExplicit length");
}
+void tst_QTextStream::stringref_write_operator_ToDevice()
+{
+ QBuffer buf;
+ buf.open(QBuffer::WriteOnly);
+ QTextStream stream(&buf);
+ stream.setCodec(QTextCodec::codecForName("ISO-8859-1"));
+ stream.setAutoDetectUnicode(true);
+
+ const QString expected = "No explicit lengthExplicit length";
+
+ stream << expected.leftRef(18);
+ stream << expected.midRef(18);
+ stream.flush();
+ QCOMPARE(buf.buffer().constData(), "No explicit lengthExplicit length");
+}
+
// ------------------------------------------------------------------------------
void tst_QTextStream::useCase1()
{
@@ -2711,7 +2729,7 @@ void tst_QTextStream::readBomSeekBackReadBomAgain()
QFile::remove("utf8bom");
QFile file("utf8bom");
QVERIFY(file.open(QFile::ReadWrite));
- file.write("\xef\xbb\xbf" "Andreas");
+ file.write("\xef\xbb\xbf""Andreas");
file.seek(0);
QCOMPARE(file.pos(), qint64(0));
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 7579c6713d..031a35b380 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -79,6 +79,8 @@ private slots:
void toLocalFile();
void fromLocalFile_data();
void fromLocalFile();
+ void fromLocalFileNormalize_data();
+ void fromLocalFileNormalize();
void macTypes();
void relative();
void compat_legacy();
@@ -1242,16 +1244,6 @@ void tst_QUrl::fromLocalFile_data()
<< QString::fromLatin1("/");
QTest::newRow("data7") << QString::fromLatin1("/Mambo <#5>.mp3") << QString::fromLatin1("file:///Mambo <%235>.mp3")
<< QString::fromLatin1("/Mambo <#5>.mp3");
- QTest::newRow("data8") << QString::fromLatin1("/a%.txt") << QString::fromLatin1("file:///a%25.txt")
- << QString::fromLatin1("/a%.txt");
- QTest::newRow("data9") << QString::fromLatin1("/a%25.txt") << QString::fromLatin1("file:///a%2525.txt")
- << QString::fromLatin1("/a%25.txt");
- QTest::newRow("data10") << QString::fromLatin1("/%80.txt") << QString::fromLatin1("file:///%2580.txt")
- << QString::fromLatin1("/%80.txt");
- QTest::newRow("data11") << QString::fromLatin1("./a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt");
- QTest::newRow("data12") << QString::fromLatin1("././a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt");
- QTest::newRow("data13") << QString::fromLatin1("b/../a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt");
- QTest::newRow("data14") << QString::fromLatin1("/b/../a.txt") << QString::fromLatin1("file:///a.txt") << QString::fromLatin1("/a.txt");
}
void tst_QUrl::fromLocalFile()
@@ -1266,6 +1258,41 @@ void tst_QUrl::fromLocalFile()
QCOMPARE(url.path(), thePath);
}
+void tst_QUrl::fromLocalFileNormalize_data()
+{
+ QTest::addColumn<QString>("theFile"); // should support the fromLocalFile/toLocalFile roundtrip (so no //host or windows path)
+ QTest::addColumn<QString>("theUrl");
+ QTest::addColumn<QString>("urlWithNormalizedPath");
+
+ QTest::newRow("data0") << QString::fromLatin1("/a.txt") << QString::fromLatin1("file:///a.txt") << QString::fromLatin1("file:///a.txt");
+ QTest::newRow("data1") << QString::fromLatin1("a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data8") << QString::fromLatin1("/a%.txt") << QString::fromLatin1("file:///a%25.txt")
+ << QString::fromLatin1("file:///a%25.txt");
+ QTest::newRow("data9") << QString::fromLatin1("/a%25.txt") << QString::fromLatin1("file:///a%2525.txt")
+ << QString::fromLatin1("file:///a%2525.txt");
+ QTest::newRow("data10") << QString::fromLatin1("/%80.txt") << QString::fromLatin1("file:///%2580.txt")
+ << QString::fromLatin1("file:///%2580.txt");
+ QTest::newRow("data11") << QString::fromLatin1("./a.txt") << QString::fromLatin1("file:./a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data12") << QString::fromLatin1("././a.txt") << QString::fromLatin1("file:././a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data13") << QString::fromLatin1("b/../a.txt") << QString::fromLatin1("file:b/../a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data14") << QString::fromLatin1("/b/../a.txt") << QString::fromLatin1("file:///b/../a.txt") << QString::fromLatin1("file:///a.txt");
+ QTest::newRow("data15") << QString::fromLatin1("/b/.") << QString::fromLatin1("file:///b/.") << QString::fromLatin1("file:///b");
+}
+
+void tst_QUrl::fromLocalFileNormalize()
+{
+ QFETCH(QString, theFile);
+ QFETCH(QString, theUrl);
+ QFETCH(QString, urlWithNormalizedPath);
+
+ QUrl url = QUrl::fromLocalFile(theFile);
+
+ QCOMPARE(url.toString(QUrl::DecodeReserved), theUrl);
+ QCOMPARE(url.toLocalFile(), theFile); // roundtrip
+ QCOMPARE(url.path(), theFile); // works as well as long as we don't test windows paths
+ QCOMPARE(url.toString(QUrl::NormalizePathSegments), urlWithNormalizedPath);
+}
+
void tst_QUrl::macTypes()
{
#ifndef Q_OS_MAC
@@ -2960,6 +2987,9 @@ void tst_QUrl::fromUserInputWithCwd_data()
while (it.hasNext()) {
it.next();
QUrl url = QUrl::fromLocalFile(it.filePath());
+ if (it.fileName() == QLatin1String(".")) {
+ url = QUrl::fromLocalFile(QDir::currentPath()); // fromUserInput cleans the path
+ }
QTest::newRow(QString("file-%1").arg(c++).toLatin1()) << it.fileName() << QDir::currentPath() << url << url;
}
QDir parent = QDir::current();
@@ -3021,6 +3051,8 @@ void tst_QUrl::fileName_data()
<< QString() << "tmp.txt" << "tmp.txt";
QTest::newRow("encoded") << "print:/specials/Print%20To%20File%20(PDF%252FAcrobat)"
<< "/specials/" << "Print To File (PDF%252FAcrobat)" << "Print To File (PDF%2FAcrobat)";
+ QTest::newRow("endsWithDot") << "file:///temp/."
+ << "/temp/" << "." << ".";
}
void tst_QUrl::fileName()
@@ -3513,7 +3545,7 @@ void tst_QUrl::setComponents_data()
<< PrettyDecoded << "/path" << "trash:/path";
QTest::newRow("path-withdotdot") << QUrl("file:///tmp")
<< int(Path) << "//tmp/..///root/." << Tolerant << true
- << PrettyDecoded << "/root" << "file:///root";
+ << PrettyDecoded << "/tmp/..///root/." << "file:///tmp/..///root/.";
// the other fields can be present and be empty
// that is, their delimiters would be present, but there would be nothing to one side
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
index db0136dd20..769a96ac64 100644
--- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
+++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
@@ -177,6 +177,7 @@ void tst_QUrlQuery::constructing()
QVERIFY(copy.isEmpty());
QVERIFY(!copy.isDetached());
QVERIFY(copy == empty);
+ QCOMPARE(qHash(copy), qHash(empty));
QVERIFY(!(copy != empty));
copy = empty;
@@ -184,6 +185,7 @@ void tst_QUrlQuery::constructing()
copy = QUrlQuery();
QVERIFY(copy == empty);
+ QCOMPARE(qHash(copy), qHash(empty));
}
{
QUrlQuery copy(emptyQuery());
@@ -298,6 +300,7 @@ void tst_QUrlQuery::addRemove()
QVERIFY(query == original);
QVERIFY(!(query != original));
+ QCOMPARE(qHash(query), qHash(original));
}
{
diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index 64170b15dd..c4d2df7c3e 100644
--- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -379,7 +379,7 @@ void tst_QAbstractItemModel::hasChildren()
{
QtTestModel model(1, 1);
QModelIndex idx = model.index(0, 0, QModelIndex());
- QVERIFY(model.hasChildren(idx) == false);
+ QVERIFY(!model.hasChildren(idx));
}
void tst_QAbstractItemModel::data()
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
index ba143a31f8..e0e688cc3a 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
@@ -78,6 +78,9 @@ public:
QList<test> tests;
static void setupDatabase();
+
+private:
+ QScopedPointer<QTemporaryDir> m_dirModelTempDir;
};
@@ -306,18 +309,20 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model)
}
if (QDirModel *dirModel = qobject_cast<QDirModel *>(model)) {
- if (!QDir::current().mkdir("test"))
- qFatal("%s: cannot create directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/test")));
+ m_dirModelTempDir.reset(new QTemporaryDir);
+ if (!m_dirModelTempDir->isValid())
+ qFatal("Cannot create temporary directory \"%s\": %s",
+ qPrintable(QDir::toNativeSeparators(m_dirModelTempDir->path())),
+ qPrintable(m_dirModelTempDir->errorString()));
+
+ QDir tempDir(m_dirModelTempDir->path());
for (int i = 0; i < 26; ++i) {
- QString subdir = QString("test/foo_%1").arg(i);
- if (!QDir::current().mkdir(subdir))
- qFatal("%s: cannot create directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/"+subdir)));
+ const QString subdir = QString("foo_") + QString::number(i);
+ if (!tempDir.mkdir(subdir))
+ qFatal("Cannot create directory %s",
+ qPrintable(QDir::toNativeSeparators(tempDir.path() + QLatin1Char('/') +subdir)));
}
- return dirModel->index(QDir::currentPath()+"/test");
+ return dirModel->index(tempDir.path());
}
if (QSqlQueryModel *queryModel = qobject_cast<QSqlQueryModel *>(model)) {
@@ -382,22 +387,8 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model)
*/
void ModelsToTest::cleanupTestArea(QAbstractItemModel *model)
{
- if (qobject_cast<QDirModel *>(model))
- {
- if (QDir(QDir::currentPath()+"/test").exists())
- {
- for (int i = 0; i < 26; ++i) {
- QString subdir(QString("test/foo_%1").arg(i));
- if (!QDir::current().rmdir(subdir))
- qFatal("%s: cannot remove directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/"+subdir)));
- }
- if (!QDir::current().rmdir("test"))
- qFatal("%s: cannot remove directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/test")));
- }
+ if (qobject_cast<QDirModel *>(model)) {
+ m_dirModelTempDir.reset();
} else if (qobject_cast<QSqlQueryModel *>(model)) {
QSqlQuery q("DROP TABLE test");
}
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
index 709b35b6e0..6971f7ef78 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
@@ -49,6 +49,9 @@ class tst_QItemModel : public QObject
{
Q_OBJECT
+public:
+ tst_QItemModel();
+
public slots:
void init();
void cleanup();
@@ -124,6 +127,11 @@ private:
bool insertRecursively;
};
+tst_QItemModel::tst_QItemModel()
+{
+ qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>();
+}
+
void tst_QItemModel::init()
{
testModels = new ModelsToTest();
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 8d331389f5..38e2900c25 100644
--- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -94,6 +94,9 @@ private slots:
void testChainedSelectionClear();
void testClearCurrentIndex();
+ void QTBUG48402_data();
+ void QTBUG48402();
+
private:
QAbstractItemModel *model;
QItemSelectionModel *selection;
@@ -1530,7 +1533,7 @@ void tst_QItemSelectionModel::resetModel()
model.reset();
QVERIFY(selectionModel->selection().isEmpty());
- QVERIFY(selectionModel->hasSelection() == false);
+ QVERIFY(!selectionModel->hasSelection());
selectionModel->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select);
@@ -2756,5 +2759,96 @@ void tst_QItemSelectionModel::testClearCurrentIndex()
QVERIFY(currentIndexSpy.size() == 2);
}
+void tst_QItemSelectionModel::QTBUG48402_data()
+{
+ QTest::addColumn<int>("rows");
+ QTest::addColumn<int>("columns");
+
+ QTest::addColumn<int>("selectTop");
+ QTest::addColumn<int>("selectLeft");
+ QTest::addColumn<int>("selectBottom");
+ QTest::addColumn<int>("selectRight");
+
+ QTest::addColumn<int>("removeTop");
+ QTest::addColumn<int>("removeBottom");
+
+ QTest::addColumn<int>("deselectTop");
+ QTest::addColumn<int>("deselectLeft");
+ QTest::addColumn<int>("deselectBottom");
+ QTest::addColumn<int>("deselectRight");
+
+ QTest::newRow("4x4 top intersection")
+ << 4 << 4
+ << 0 << 2 << 1 << 3
+ << 1 << 1
+ << 1 << 2 << 1 << 3;
+
+ QTest::newRow("4x4 bottom intersection")
+ << 4 << 4
+ << 0 << 2 << 1 << 3
+ << 0 << 0
+ << 0 << 2 << 0 << 3;
+
+ QTest::newRow("4x4 middle intersection")
+ << 4 << 4
+ << 0 << 2 << 2 << 3
+ << 1 << 1
+ << 1 << 2 << 1 << 3;
+
+ QTest::newRow("4x4 full inclusion")
+ << 4 << 4
+ << 0 << 2 << 1 << 3
+ << 0 << 1
+ << 0 << 2 << 1 << 3;
+}
+class QTBUG48402_helper : public QObject
+{
+ Q_OBJECT
+public:
+ QModelIndex tl;
+ QModelIndex br;
+public slots:
+ void changed(const QItemSelection &, const QItemSelection &deselected)
+ {
+ tl = deselected.first().topLeft();
+ br = deselected.first().bottomRight();
+ }
+};
+
+void tst_QItemSelectionModel::QTBUG48402()
+{
+ QFETCH(int, rows);
+ QFETCH(int, columns);
+ QFETCH(int, selectTop);
+ QFETCH(int, selectLeft);
+ QFETCH(int, selectBottom);
+ QFETCH(int, selectRight);
+ QFETCH(int, removeTop);
+ QFETCH(int, removeBottom);
+ QFETCH(int, deselectTop);
+ QFETCH(int, deselectLeft);
+ QFETCH(int, deselectBottom);
+ QFETCH(int, deselectRight);
+
+ MyStandardItemModel model(rows, columns);
+ QItemSelectionModel selections(&model);
+
+ QModelIndex stl = model.index(selectTop, selectLeft);
+ QModelIndex sbr = model.index(selectBottom, selectRight);
+ QModelIndex dtl = model.index(deselectTop, deselectLeft);
+ QModelIndex dbr = model.index(deselectBottom, deselectRight);
+
+ selections.select(QItemSelection(stl, sbr), QItemSelectionModel::ClearAndSelect);
+ QTBUG48402_helper helper;
+ helper.connect(&selections, &QItemSelectionModel::selectionChanged, &helper, &QTBUG48402_helper::changed);
+ QVERIFY(selections.isSelected(stl));
+ QVERIFY(selections.isSelected(sbr));
+ QVERIFY(selections.hasSelection());
+
+ model.removeRows(removeTop, removeBottom - removeTop + 1);
+
+ QCOMPARE(QItemSelectionRange(helper.tl, helper.br), QItemSelectionRange(dtl, dbr));
+}
+
QTEST_MAIN(tst_QItemSelectionModel)
#include "tst_qitemselectionmodel.moc"
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 1c30adc8de..0302ae5cbf 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -87,6 +87,7 @@ private slots:
void filter_qtbug30662();
void changeSourceLayout();
+ void changeSourceLayoutFilteredOut();
void removeSourceRows_data();
void removeSourceRows();
void insertSourceRows_data();
@@ -1533,6 +1534,32 @@ void tst_QSortFilterProxyModel::changeSourceLayout()
}
}
+void tst_QSortFilterProxyModel::changeSourceLayoutFilteredOut()
+{
+ QStandardItemModel model(2, 1);
+ model.setData(model.index(0, 0), QString("b"));
+ model.setData(model.index(1, 0), QString("a"));
+ QSortFilterProxyModel proxy;
+ proxy.setSourceModel(&model);
+
+ int beforeSortFilter = proxy.rowCount();
+
+ QSignalSpy removeSpy(&proxy, &QSortFilterProxyModel::rowsRemoved);
+ // Filter everything out
+ proxy.setFilterRegExp(QRegExp("c"));
+ QCOMPARE(removeSpy.count(), 1);
+ QCOMPARE(0, proxy.rowCount());
+
+ // change layout of source model
+ model.sort(0, Qt::AscendingOrder);
+
+ QSignalSpy insertSpy(&proxy, &QSortFilterProxyModel::rowsInserted);
+ // Remove filter; we expect an insert
+ proxy.setFilterRegExp(QRegExp(""));
+ QCOMPARE(insertSpy.count(), 1);
+ QCOMPARE(beforeSortFilter, proxy.rowCount());
+}
+
void tst_QSortFilterProxyModel::removeSourceRows_data()
{
QTest::addColumn<QStringList>("sourceItems");
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp
index 884c4b3850..1665ff696d 100644
--- a/tests/auto/corelib/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/json/tst_qtjson.cpp
@@ -1137,6 +1137,12 @@ void tst_QtJson::fromVariant()
QCOMPARE(QJsonValue::fromVariant(QVariant(stringList)), QJsonValue(jsonArray_string));
QCOMPARE(QJsonValue::fromVariant(QVariant(variantList)), QJsonValue(jsonArray_variant));
QCOMPARE(QJsonValue::fromVariant(QVariant(variantMap)), QJsonValue(jsonObject));
+
+ QVERIFY(QJsonValue::fromVariant(QVariant(QJsonValue(true))).isBool());
+ QVERIFY(QJsonValue::fromVariant(QVariant(jsonArray_string)).isArray());
+ QVERIFY(QJsonValue::fromVariant(QVariant(QJsonDocument(jsonArray_string))).isArray());
+ QVERIFY(QJsonValue::fromVariant(QVariant(jsonObject)).isObject());
+ QVERIFY(QJsonValue::fromVariant(QVariant(QJsonDocument(jsonObject))).isObject());
}
void tst_QtJson::fromVariantMap()
diff --git a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
index 0602b9fc38..1039f2c08d 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
+++ b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
@@ -3,3 +3,4 @@ TARGET = tst_qcoreapplication
QT = core testlib core-private
SOURCES = tst_qcoreapplication.cpp
HEADERS = tst_qcoreapplication.h
+requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 60e358232e..655719cffc 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -73,6 +73,21 @@ public:
}
};
+class Thread : public QDaemonThread
+{
+ void run() Q_DECL_OVERRIDE
+ {
+ QThreadData *data = QThreadData::current();
+ QVERIFY(!data->requiresCoreApplication); // daemon thread
+ data->requiresCoreApplication = requiresCoreApplication;
+ QThread::run();
+ }
+
+public:
+ Thread() : requiresCoreApplication(true) {}
+ bool requiresCoreApplication;
+};
+
void tst_QCoreApplication::sendEventsOnProcessEvents()
{
int argc = 1;
@@ -848,6 +863,68 @@ void tst_QCoreApplication::applicationEventFilters_auxThread()
QVERIFY(!spy.recordedEvents.contains(QEvent::User + 1));
}
+void tst_QCoreApplication::threadedEventDelivery_data()
+{
+ QTest::addColumn<bool>("requiresCoreApplication");
+ QTest::addColumn<bool>("createCoreApplication");
+ QTest::addColumn<bool>("eventsReceived");
+
+ // invalid combination:
+ //QTest::newRow("default-without-coreapp") << true << false << false;
+ QTest::newRow("default") << true << true << true;
+ QTest::newRow("independent-without-coreapp") << false << false << true;
+ QTest::newRow("independent-with-coreapp") << false << true << true;
+}
+
+// posts the event before the QCoreApplication is destroyed, starts thread after
+void tst_QCoreApplication::threadedEventDelivery()
+{
+ QFETCH(bool, requiresCoreApplication);
+ QFETCH(bool, createCoreApplication);
+ QFETCH(bool, eventsReceived);
+
+ int argc = 1;
+ char *argv[] = { const_cast<char*>(QTest::currentAppName()) };
+ QScopedPointer<TestApplication> app(createCoreApplication ? new TestApplication(argc, argv) : 0);
+
+ Thread thread;
+ thread.requiresCoreApplication = requiresCoreApplication;
+ ThreadedEventReceiver receiver;
+ receiver.moveToThread(&thread);
+ QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User + 1)));
+
+ thread.start();
+ QVERIFY(thread.wait(1000));
+ QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived);
+}
+
+void tst_QCoreApplication::addRemoveLibPaths()
+{
+ QStringList paths = QCoreApplication::libraryPaths();
+ if (paths.isEmpty())
+ QSKIP("Cannot add/remove library paths if there are none.");
+
+ QString currentDir = QDir().absolutePath();
+ QCoreApplication::addLibraryPath(currentDir);
+ QVERIFY(QCoreApplication::libraryPaths().contains(currentDir));
+
+ QCoreApplication::removeLibraryPath(paths[0]);
+ QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0]));
+
+ int argc = 1;
+ char *argv[] = { const_cast<char*>(QTest::currentAppName()) };
+ TestApplication app(argc, argv);
+
+ // Check that modifications stay alive across the creation of an application.
+ QVERIFY(QCoreApplication::libraryPaths().contains(currentDir));
+ QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0]));
+
+ QStringList replace;
+ replace << currentDir << paths[0];
+ QCoreApplication::setLibraryPaths(replace);
+ QVERIFY(QCoreApplication::libraryPaths() == replace);
+}
+
static void createQObjectOnDestruction()
{
// Make sure that we can create a QObject after the last QObject has been
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
index 09e15723ac..d9296b3846 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
@@ -61,6 +61,9 @@ private slots:
void QTBUG31606_QEventDestructorDeadLock();
void applicationEventFilters_mainThread();
void applicationEventFilters_auxThread();
+ void threadedEventDelivery_data();
+ void threadedEventDelivery();
+ void addRemoveLibPaths();
};
#endif // TST_QCOREAPPLICATION_H
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
new file mode 100644
index 0000000000..00be65751b
--- /dev/null
+++ b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
@@ -0,0 +1,4 @@
+[sendPostedEvents]
+windows
+[registerTimer]
+windows
diff --git a/tests/auto/corelib/kernel/qeventloop/BLACKLIST b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
new file mode 100644
index 0000000000..6ea6314b0a
--- /dev/null
+++ b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
@@ -0,0 +1,2 @@
+[testQuitLock]
+windows
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
index f555d2e58e..c8bb4cda6e 100644
--- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
@@ -207,22 +207,11 @@ void tst_QEventLoop::processEvents()
QCOMPARE(awakeSpy.count(), 1);
// allow any session manager to complete its handshake, so that
- // there are no pending events left.
+ // there are no pending events left. This tests that we are able
+ // to process all events from the queue, otherwise it will hang.
while (eventLoop.processEvents())
;
- // On mac we get application started events at this point,
- // so process events one more time just to be sure.
- eventLoop.processEvents();
-
- // no events to process, QEventLoop::processEvents() should return
- // false
- aboutToBlockSpy.clear();
- awakeSpy.clear();
- QVERIFY(!eventLoop.processEvents());
- QCOMPARE(aboutToBlockSpy.count(), 0);
- QCOMPARE(awakeSpy.count(), 1);
-
// make sure the test doesn't block forever
int timerId = startTimer(100);
diff --git a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
index a18c9eb370..22c78f8e48 100644
--- a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
+++ b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2014 Olivier Goffart <ogoffart@woboq.com>
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -38,14 +38,29 @@
#include <qobject.h>
#include <qmetaobject.h>
+struct CustomType
+{
+ int padding;
+ QString str;
+ CustomType(const QString &str = QString()) : str(str) {}
+ operator QString() const { return str; }
+ friend bool operator!=(const CustomType &a, const CustomType &b)
+ { return a.str != b.str; }
+};
+
+Q_DECLARE_METATYPE(CustomType)
+
class tst_QMetaProperty : public QObject
{
Q_OBJECT
Q_PROPERTY(EnumType value WRITE setValue READ getValue)
Q_PROPERTY(EnumType value2 WRITE set_value READ get_value)
+ Q_PROPERTY(QString value7 MEMBER value7 RESET resetValue7)
Q_PROPERTY(int value8 READ value8)
Q_PROPERTY(int value9 READ value9 CONSTANT)
Q_PROPERTY(int value10 READ value10 FINAL)
+ Q_PROPERTY(QMap<int, int> map MEMBER map)
+ Q_PROPERTY(CustomType custom MEMBER custom)
private slots:
void hasStdCppSet();
@@ -53,6 +68,8 @@ private slots:
void isFinal();
void gadget();
void readAndWriteWithLazyRegistration();
+ void mapProperty();
+ void conversion();
public:
enum EnumType { EnumType1 };
@@ -62,9 +79,14 @@ public:
void set_value(EnumType) {}
EnumType get_value() const { return EnumType1; }
+ void resetValue7() { value7 = QStringLiteral("reset"); }
int value8() const { return 1; }
int value9() const { return 1; }
int value10() const { return 1; }
+
+ QString value7;
+ QMap<int, int> map;
+ CustomType custom;
};
void tst_QMetaProperty::hasStdCppSet()
@@ -182,6 +204,51 @@ void tst_QMetaProperty::readAndWriteWithLazyRegistration()
QCOMPARE(o.property("write").value<CustomWriteObjectChild*>(), &data);
}
+void tst_QMetaProperty::mapProperty()
+{
+ map.insert(5, 9);
+ QVariant v1 = QVariant::fromValue(map);
+ QVariant v = property("map");
+ QVERIFY(v.isValid());
+ QCOMPARE(map, (v.value<QMap<int,int> >()));
+}
+
+void tst_QMetaProperty::conversion()
+{
+ QMetaType::registerConverter<QString, CustomType>();
+ QMetaType::registerConverter<CustomType, QString>();
+
+ QString hello = QStringLiteral("Hello");
+
+ // Write to a QString property using a CustomType in a QVariant
+ QMetaProperty value7P = metaObject()->property(metaObject()->indexOfProperty("value7"));
+ QVERIFY(value7P.isValid());
+ QVERIFY(value7P.write(this, QVariant::fromValue(CustomType(hello))));
+ QCOMPARE(value7, hello);
+
+ // Write to a CustomType property using a QString in a QVariant
+ QMetaProperty customP = metaObject()->property(metaObject()->indexOfProperty("custom"));
+ QVERIFY(customP.isValid());
+ QVERIFY(customP.write(this, hello));
+ QCOMPARE(custom.str, hello);
+
+ // Something that cannot be converted should fail
+ QVERIFY(!customP.write(this, 45));
+ QVERIFY(!customP.write(this, QVariant::fromValue(this)));
+ QVERIFY(!value7P.write(this, QVariant::fromValue(this)));
+ QVERIFY(!value7P.write(this, QVariant::fromValue<QObject*>(this)));
+
+ // none of this should have changed the values
+ QCOMPARE(value7, hello);
+ QCOMPARE(custom.str, hello);
+
+ // Empty variant should be converted to default object
+ QVERIFY(customP.write(this, QVariant()));
+ QCOMPARE(custom.str, QString());
+ // or reset resetable
+ QVERIFY(value7P.write(this, QVariant()));
+ QCOMPARE(value7, QLatin1Literal("reset"));
+}
QTEST_MAIN(tst_QMetaProperty)
#include "tst_qmetaproperty.moc"
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index a4bfc8ac9b..c74a43b682 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -972,7 +972,7 @@ QT_FOR_EACH_STATIC_CORE_POINTER(ADD_METATYPE_TEST_ROW)
QTest::newRow("QPair<P,C>") << ::qMetaTypeId<QPair<P,C> >() << false << true << false << false;
QTest::newRow("QPair<P,M>") << ::qMetaTypeId<QPair<P,M> >() << true << true << false << false;
QTest::newRow("QPair<P,P>") << ::qMetaTypeId<QPair<P,P> >() << true << false << false << false;
- QTest::newRow("FlagsDataEnum") << ::qMetaTypeId<FlagsDataEnum>() << false << true << false << true;
+ QTest::newRow("FlagsDataEnum") << ::qMetaTypeId<FlagsDataEnum>() << true << true << false << true;
// invalid ids.
QTest::newRow("-1") << -1 << false << false << false << false;
@@ -1052,9 +1052,9 @@ void tst_QMetaType::flagsBinaryCompatibility5_0()
QFETCH(quint32, id);
QFETCH(quint32, flags);
- quint32 mask_5_0 = 0x1ff; // Only compare the values that were already defined in 5.0
+ quint32 mask_5_0 = 0x1fb; // Only compare the values that were already defined in 5.0
- QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags);
+ QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags & mask_5_0);
}
void tst_QMetaType::construct_data()
diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
index 01bf16c295..d368d9961b 100644
--- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
+++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
@@ -70,7 +70,7 @@ void tst_QMimeData::clear() const
mimeData.setData("text/plain", "pirates");
QVERIFY(mimeData.hasText());
mimeData.clear();
- QVERIFY(mimeData.hasText() == false);
+ QVERIFY(!mimeData.hasText());
// repopulate, verify not empty
mimeData.setData("text/plain", "pirates");
@@ -136,7 +136,7 @@ void tst_QMimeData::hasColor() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasColor() == false);
+ QVERIFY(!mimeData.hasColor());
// set, verify
mimeData.setColorData(QColor(Qt::red));
@@ -144,11 +144,11 @@ void tst_QMimeData::hasColor() const
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasColor() == false);
+ QVERIFY(!mimeData.hasColor());
// set something else, verify
mimeData.setData("text/plain", "pirates");
- QVERIFY(mimeData.hasColor() == false);
+ QVERIFY(!mimeData.hasColor());
}
void tst_QMimeData::hasFormat() const
@@ -156,17 +156,17 @@ void tst_QMimeData::hasFormat() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
// add, verify
mimeData.setData("text/plain", "pirates");
QVERIFY(mimeData.hasFormat("text/plain"));
- QVERIFY(mimeData.hasFormat("text/html") == false);
+ QVERIFY(!mimeData.hasFormat("text/html"));
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasFormat("text/plain") == false);
- QVERIFY(mimeData.hasFormat("text/html") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
+ QVERIFY(!mimeData.hasFormat("text/html"));
}
void tst_QMimeData::hasHtml() const
@@ -174,11 +174,11 @@ void tst_QMimeData::hasHtml() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// add plain, verify false
mimeData.setData("text/plain", "pirates");
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// add html, verify
mimeData.setData("text/html", "ninjas");
@@ -186,7 +186,7 @@ void tst_QMimeData::hasHtml() const
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// readd, verify
mimeData.setData("text/html", "ninjas");
@@ -198,11 +198,11 @@ void tst_QMimeData::hasImage() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasImage() == false);
+ QVERIFY(!mimeData.hasImage());
// add text, verify false
mimeData.setData("text/plain", "pirates");
- QVERIFY(mimeData.hasImage() == false);
+ QVERIFY(!mimeData.hasImage());
// add image
mimeData.setImageData(QImage());
@@ -210,7 +210,7 @@ void tst_QMimeData::hasImage() const
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasImage() == false);
+ QVERIFY(!mimeData.hasImage());
}
void tst_QMimeData::imageData() const
@@ -244,13 +244,13 @@ void tst_QMimeData::removeFormat() const
// remove, verify
mimeData.removeFormat("text/plain");
- QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
QVERIFY(mimeData.hasFormat("text/html"));
// remove, verify
mimeData.removeFormat("text/html");
- QVERIFY(mimeData.hasFormat("text/plain") == false);
- QVERIFY(mimeData.hasFormat("text/html") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
+ QVERIFY(!mimeData.hasFormat("text/html"));
}
void tst_QMimeData::setHtml() const
@@ -258,7 +258,7 @@ void tst_QMimeData::setHtml() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// add html, verify
mimeData.setHtml("ninjas");
@@ -277,7 +277,7 @@ void tst_QMimeData::setText() const
// verify initial state
QCOMPARE(mimeData.text(), QLatin1String(""));
- QVERIFY(mimeData.hasText() == false);
+ QVERIFY(!mimeData.hasText());
// set, verify
mimeData.setText("pirates");
@@ -294,7 +294,7 @@ void tst_QMimeData::setText() const
// clear, verify
mimeData.clear();
QCOMPARE(mimeData.text(), QLatin1String(""));
- QVERIFY(mimeData.hasText() == false);
+ QVERIFY(!mimeData.hasText());
}
// Publish retrieveData for verifying content validity
diff --git a/tests/auto/corelib/kernel/qobject/BLACKLIST b/tests/auto/corelib/kernel/qobject/BLACKLIST
new file mode 100644
index 0000000000..0887a73b4c
--- /dev/null
+++ b/tests/auto/corelib/kernel/qobject/BLACKLIST
@@ -0,0 +1,2 @@
+[moveToThread]
+windows
diff --git a/tests/auto/corelib/kernel/qobject/qobject.pro b/tests/auto/corelib/kernel/qobject/qobject.pro
index 6a7cf07f51..bd83396ca0 100644
--- a/tests/auto/corelib/kernel/qobject/qobject.pro
+++ b/tests/auto/corelib/kernel/qobject/qobject.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS += \
- signalbug \
- test
+!winrt: SUBDIRS+= signalbug
+
+SUBDIRS += test
diff --git a/tests/auto/corelib/kernel/qobject/test/test.pro b/tests/auto/corelib/kernel/qobject/test/test.pro
index 0a15ae384e..3ac728931d 100644
--- a/tests/auto/corelib/kernel/qobject/test/test.pro
+++ b/tests/auto/corelib/kernel/qobject/test/test.pro
@@ -4,5 +4,5 @@ TARGET = ../tst_qobject
QT = core-private network testlib
SOURCES = ../tst_qobject.cpp
-TEST_HELPER_INSTALLS = ../signalbug/signalbug
+!winrt: TEST_HELPER_INSTALLS = ../signalbug/signalbug
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 5b1dad78cf..f7c1f03c0f 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -1925,7 +1925,7 @@ void tst_QObject::property()
QCOMPARE(object.property("string"), QVariant("String1"));
QVERIFY(object.setProperty("string", "String2"));
QCOMPARE(object.property("string"), QVariant("String2"));
- QVERIFY(!object.setProperty("string", QVariant()));
+ QVERIFY(object.setProperty("string", QVariant()));
const int idx = mo->indexOfProperty("variant");
QVERIFY(idx != -1);
@@ -2027,7 +2027,7 @@ void tst_QObject::property()
QCOMPARE(object.property("customString"), QVariant("String1"));
QVERIFY(object.setProperty("customString", "String2"));
QCOMPARE(object.property("customString"), QVariant("String2"));
- QVERIFY(!object.setProperty("customString", QVariant()));
+ QVERIFY(object.setProperty("customString", QVariant()));
}
void tst_QObject::metamethod()
diff --git a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
index 814c4bb691..d7cce4ada4 100644
--- a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
+++ b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
@@ -50,6 +50,7 @@ private slots:
void destructor();
void assignment_operators();
void equality_operators();
+ void swap();
void isNull();
void dereference_operators();
void disconnect();
@@ -169,6 +170,22 @@ void tst_QPointer::equality_operators()
#endif
}
+void tst_QPointer::swap()
+{
+ QPointer<QObject> c1, c2;
+ {
+ QObject o;
+ c1 = &o;
+ QVERIFY(c2.isNull());
+ QCOMPARE(c1.data(), &o);
+ c1.swap(c2);
+ QVERIFY(c1.isNull());
+ QCOMPARE(c2.data(), &o);
+ }
+ QVERIFY(c1.isNull());
+ QVERIFY(c2.isNull());
+}
+
void tst_QPointer::isNull()
{
QPointer<QObject> p1;
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
new file mode 100644
index 0000000000..e68bf84268
--- /dev/null
+++ b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
@@ -0,0 +1,3 @@
+[unexpectedDisconnection]
+windows
+osx
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index 1d1432f600..b34a3a6beb 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -72,6 +72,7 @@ private slots:
void singleShotStaticFunctionZeroTimeout();
void recurseOnTimeoutAndStopTimer();
void singleShotToFunctors();
+ void crossThreadSingleShotToFunctor();
void dontBlockEvents();
void postedEventsShouldNotStarveTimers();
@@ -440,6 +441,9 @@ void tst_QTimer::deleteLaterOnQTimer()
void tst_QTimer::moveToThread()
{
+#if defined(Q_OS_WIN32)
+ QSKIP("Does not work reliably on Windows :(");
+#endif
QTimer ti1;
QTimer ti2;
ti1.start(MOVETOTHREAD_TIMEOUT);
@@ -874,5 +878,28 @@ void tst_QTimer::postedEventsShouldNotStarveTimers()
QVERIFY(timerHelper.count > 5);
}
+struct DummyFunctor {
+ void operator()() {}
+};
+
+void tst_QTimer::crossThreadSingleShotToFunctor()
+{
+ // We're testing for crashes here, so the test simply running to
+ // completion is considered a success
+ QThread t;
+ t.start();
+
+ QObject* o = new QObject();
+ o->moveToThread(&t);
+
+ for (int i = 0; i < 10000; i++) {
+ QTimer::singleShot(0, o, DummyFunctor());
+ }
+
+ t.quit();
+ t.wait();
+ delete o;
+}
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index a192ccde59..c91bb21399 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -2,6 +2,7 @@
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -1710,12 +1711,16 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("float3") << qVariantFromValue(0.f) << qVariantFromValue(-1.f) << +1;
QTest::newRow("float4") << qVariantFromValue(-float(qInf())) << qVariantFromValue(0.f) << -1;
QTest::newRow("float5") << qVariantFromValue(0.f) << qVariantFromValue(-float(qInf())) << +1;
+ QTest::newRow("float6") << qVariantFromValue(-float(qInf())) << qVariantFromValue(-float(qInf())) << 0;
+ QTest::newRow("float7") << qVariantFromValue(float(qInf())) << qVariantFromValue(float(qInf())) << 0;
QTest::newRow("double1") << qVariantFromValue(0.) << qVariantFromValue(0.) << 0;
QTest::newRow("double2") << qVariantFromValue(-1.) << qVariantFromValue(0.) << -1;
QTest::newRow("double3") << qVariantFromValue(0.) << qVariantFromValue(-1.) << +1;
QTest::newRow("double4") << qVariantFromValue(-qInf()) << qVariantFromValue(0.) << -1;
QTest::newRow("double5") << qVariantFromValue(0.) << qVariantFromValue(-qInf()) << +1;
+ QTest::newRow("double6") << qVariantFromValue(-double(qInf())) << qVariantFromValue(-qInf()) << 0;
+ QTest::newRow("double7") << qVariantFromValue(qInf()) << qVariantFromValue(qInf()) << 0;
// mixed comparisons
// fp + fp
@@ -1724,6 +1729,8 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("float+double3") << qVariantFromValue(0.f) << qVariantFromValue(-1.) << +1;
QTest::newRow("float+double4") << qVariantFromValue(-float(qInf())) << qVariantFromValue(0.) << -1;
QTest::newRow("float+double5") << qVariantFromValue(0.f) << qVariantFromValue(-qInf()) << +1;
+ QTest::newRow("float+double6") << qVariantFromValue(-float(qInf())) << qVariantFromValue(qInf()) << 0;
+ QTest::newRow("float+double7") << qVariantFromValue(float(qInf())) << qVariantFromValue(qInf()) << 0;
// fp + int
QTest::newRow("float+int1") << qVariantFromValue(0.f) << qVariantFromValue(0) << 0;
@@ -1734,6 +1741,7 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("double+int3") << qVariantFromValue(0.) << qVariantFromValue(-1) << +1;
QTest::newRow("float+int4") << qVariantFromValue(1.5f) << qVariantFromValue(1) << +1;
QTest::newRow("double+int4") << qVariantFromValue(1.5) << qVariantFromValue(1) << +1;
+ QTest::newRow("double+int5") << qVariantFromValue(qInf()) << qVariantFromValue(1) << +1;
// fp + uint
QTest::newRow("float+uint1") << qVariantFromValue(0.f) << qVariantFromValue(0U) << 0;
@@ -2491,14 +2499,26 @@ void tst_QVariant::variantMap()
QVariant v = map;
QVariantMap map2 = qvariant_cast<QVariantMap>(v);
+ QCOMPARE(map2.value("test").toInt(), 42);
+ QCOMPARE(map2, map);
+ map2 = v.toMap();
QCOMPARE(map2.value("test").toInt(), 42);
+ QCOMPARE(map2, map);
QVariant v2 = QVariant(QMetaType::type("QVariantMap"), &map);
QCOMPARE(qvariant_cast<QVariantMap>(v2).value("test").toInt(), 42);
QVariant v3 = QVariant(QMetaType::type("QMap<QString, QVariant>"), &map);
QCOMPARE(qvariant_cast<QVariantMap>(v3).value("test").toInt(), 42);
+
+ // multi-keys
+ map.insertMulti("test", 47);
+ v = map;
+ map2 = qvariant_cast<QVariantMap>(v);
+ QCOMPARE(map2, map);
+ map2 = v.toMap();
+ QCOMPARE(map2, map);
}
void tst_QVariant::variantHash()
@@ -2508,14 +2528,26 @@ void tst_QVariant::variantHash()
QVariant v = hash;
QVariantHash hash2 = qvariant_cast<QVariantHash>(v);
+ QCOMPARE(hash2.value("test").toInt(), 42);
+ QCOMPARE(hash2, hash);
+ hash2 = v.toHash();
QCOMPARE(hash2.value("test").toInt(), 42);
+ QCOMPARE(hash2, hash);
QVariant v2 = QVariant(QMetaType::type("QVariantHash"), &hash);
QCOMPARE(qvariant_cast<QVariantHash>(v2).value("test").toInt(), 42);
QVariant v3 = QVariant(QMetaType::type("QHash<QString, QVariant>"), &hash);
QCOMPARE(qvariant_cast<QVariantHash>(v3).value("test").toInt(), 42);
+
+ // multi-keys
+ hash.insertMulti("test", 47);
+ v = hash;
+ hash2 = qvariant_cast<QVariantHash>(v);
+ QCOMPARE(hash2, hash);
+ hash2 = v.toHash();
+ QCOMPARE(hash2, hash);
}
class CustomQObject : public QObject {
@@ -3233,24 +3265,40 @@ void tst_QVariant::convertIterables() const
map.insert("3", 4);
QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
+
+ map.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
+ QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
}
{
QVariantMap map;
map.insert("3", 4);
QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
+
+ map.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
+ QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
}
{
QHash<QString, int> hash;
hash.insert("3", 4);
QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
+
+ hash.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
}
{
QVariantHash hash;
hash.insert("3", 4);
QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
+
+ hash.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
}
}
@@ -3357,9 +3405,6 @@ void tst_QVariant::numericalConvert_data()
void tst_QVariant::numericalConvert()
{
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(__x86_64__)
- QSKIP("Known to fail due to a GCC bug on at least Ubuntu 10.04 32-bit - check QTBUG-8959");
-#endif
QFETCH(QVariant, v);
QFETCH(bool, isInteger);
double num = isInteger ? 5 : 5.3;
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 763bb58602..1b4dc020f2 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -35,6 +35,12 @@
#include "qstandardpaths.h"
+#ifdef Q_OS_UNIX
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
+#include <QtCore/QElapsedTimer>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QStandardPaths>
@@ -126,6 +132,7 @@ tst_QMimeDatabase::tst_QMimeDatabase()
void tst_QMimeDatabase::initTestCase()
{
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
QStandardPaths::setTestModeEnabled(true);
m_localMimeDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/mime";
if (QDir(m_localMimeDir).exists()) {
@@ -136,7 +143,8 @@ void tst_QMimeDatabase::initTestCase()
#ifdef USE_XDG_DATA_DIRS
// Create a temporary "global" XDG data dir for later use
// It will initially contain a copy of freedesktop.org.xml
- QVERIFY(m_temporaryDir.isValid());
+ QVERIFY2(m_temporaryDir.isValid(),
+ ("Could not create temporary subdir: " + m_temporaryDir.errorString()).toUtf8());
const QDir here = QDir(m_temporaryDir.path());
m_globalXdgDir = m_temporaryDir.path() + QStringLiteral("/global");
const QString globalPackageDir = m_globalXdgDir + QStringLiteral("/mime/packages");
@@ -643,6 +651,28 @@ void tst_QMimeDatabase::knownSuffix()
QCOMPARE(db.suffixForFileName(QString::fromLatin1("foo.tar.bz2")), QString::fromLatin1("tar.bz2"));
}
+void tst_QMimeDatabase::symlinkToFifo() // QTBUG-48529
+{
+#ifdef Q_OS_UNIX
+ QTemporaryDir tempDir;
+ QVERIFY(tempDir.isValid());
+ const QString dir = tempDir.path();
+ const QString fifo = dir + "/fifo";
+ QCOMPARE(mkfifo(QFile::encodeName(fifo), 0006), 0);
+
+ QMimeDatabase db;
+ QCOMPARE(db.mimeTypeForFile(fifo).name(), QString::fromLatin1("inode/fifo"));
+
+ // Now make a symlink to the fifo
+ const QString link = dir + "/link";
+ QVERIFY(QFile::link(fifo, link));
+ QCOMPARE(db.mimeTypeForFile(link).name(), QString::fromLatin1("inode/fifo"));
+
+#else
+ QSKIP("This test requires pipes and symlinks");
+#endif
+}
+
void tst_QMimeDatabase::findByFileName_data()
{
QTest::addColumn<QString>("filePath");
@@ -825,16 +855,20 @@ static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDa
return false;
}
+ QElapsedTimer timer;
QProcess proc;
proc.setProcessChannelMode(QProcess::MergedChannels); // silence output
+ qDebug().noquote() << "runUpdateMimeDatabase: running" << umd << path << "...";
+ timer.start();
proc.start(umd, QStringList(path));
if (!proc.waitForStarted()) {
qWarning("Cannot start %s: %s",
qPrintable(umd), qPrintable(proc.errorString()));
return false;
}
- proc.waitForFinished();
- //qDebug() << "runUpdateMimeDatabase" << path;
+ const bool success = proc.waitForFinished();
+ qDebug().noquote() << "runUpdateMimeDatabase: done,"
+ << success << timer.elapsed() << "ms";
return true;
}
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
index 2827bd2dc4..4b703f15d7 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
@@ -70,6 +70,7 @@ private slots:
void suffixes_data();
void suffixes();
void knownSuffix();
+ void symlinkToFifo();
void fromThreads();
// shared-mime-info test suite
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
index e87585163b..f31a7af6dd 100644
--- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
@@ -413,15 +413,6 @@ void tst_QLibrary::loadHints_data()
QTest::addColumn<bool>("result");
QLibrary::LoadHints lh;
-#if defined(Q_OS_AIX)
- if (QFile::exists("/usr/lib/libGL.a") || QFile::exists("/usr/X11R6/lib/libGL.a")) {
-# if QT_POINTER_SIZE == 4
- QTest::newRow( "ok03 (Archive member)" ) << "libGL.a(shr.o)" << int(QLibrary::LoadArchiveMemberHint) << true;
-# else
- QTest::newRow( "ok03 (Archive member)" ) << "libGL.a(shr_64.o)" << int(QLibrary::LoadArchiveMemberHint) << true;
-#endif
- }
-#endif
QString appDir = QCoreApplication::applicationDirPath();
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index bdbb291d7f..72bd38d116 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -120,6 +120,7 @@ private slots:
void loadGarbage();
#endif
void relativePath();
+ void absolutePath();
void reloadPlugin();
void preloadedPlugin_data();
void preloadedPlugin();
@@ -311,7 +312,7 @@ void tst_QPluginLoader::loadCorruptElf()
void tst_QPluginLoader::loadMachO_data()
{
-#ifdef Q_OF_MACH_O
+#if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)
QTest::addColumn<int>("parseResult");
QTest::newRow("/dev/null") << int(QMachOParser::NotSuitable);
@@ -347,7 +348,7 @@ void tst_QPluginLoader::loadMachO_data()
void tst_QPluginLoader::loadMachO()
{
-#ifdef Q_OF_MACH_O
+#if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)
QFile f(QFINDTESTDATA(QTest::currentDataTag()));
QVERIFY(f.open(QIODevice::ReadOnly));
QByteArray data = f.readAll();
@@ -406,6 +407,20 @@ void tst_QPluginLoader::relativePath()
QVERIFY(loader.unload());
}
+void tst_QPluginLoader::absolutePath()
+{
+ // Windows binaries run from release and debug subdirs, so we can't rely on the current dir.
+ const QString binDir = QFINDTESTDATA("bin");
+ QVERIFY(!binDir.isEmpty());
+ QVERIFY(QDir::isAbsolutePath(binDir));
+ QPluginLoader loader(binDir + "/theplugin");
+ loader.load(); // not recommended, instance() should do the job.
+ PluginInterface *instance = qobject_cast<PluginInterface*>(loader.instance());
+ QVERIFY(instance);
+ QCOMPARE(instance->pluginName(), QLatin1String("Plugin ok"));
+ QVERIFY(loader.unload());
+}
+
void tst_QPluginLoader::reloadPlugin()
{
QPluginLoader loader;
diff --git a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
index ac3374b6a3..c64d55671a 100644
--- a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
+++ b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
@@ -47,6 +47,7 @@ private slots:
void historyInitialState();
void transitions();
void privateSignals();
+ void parallelStateAndInitialState();
};
class TestClass: public QObject
@@ -344,5 +345,35 @@ void tst_QState::privateSignals()
}
+void tst_QState::parallelStateAndInitialState()
+{
+ QStateMachine machine;
+
+ { // setting an initial state on a parallel state:
+ QState a(QState::ParallelStates, &machine);
+ QState b(&a);
+ QVERIFY(!a.initialState());
+ const QString warning
+ = QString::asprintf("QState::setInitialState: ignoring attempt to set initial state of parallel state group %p", &a);
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ a.setInitialState(&b); // should produce a warning and do nothing.
+ QVERIFY(!a.initialState());
+ }
+
+ { // setting the child-mode from ExclusiveStates to ParallelStates should remove the initial state:
+ QState a(QState::ExclusiveStates, &machine);
+ QState b(&a);
+ a.setInitialState(&b);
+ QCOMPARE(a.initialState(), &b);
+ const QString warning
+ = QString::asprintf("QState::setChildMode: setting the child-mode of state %p to "
+ "parallel removes the initial state", &a);
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ a.setChildMode(QState::ParallelStates); // should produce a warning and remove the initial state
+ QVERIFY(!a.initialState());
+ QCOMPARE(a.childMode(), QState::ParallelStates);
+ }
+}
+
QTEST_MAIN(tst_QState)
#include "tst_qstate.moc"
diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
index e60b1c983c..8c76809c48 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
@@ -249,7 +249,9 @@ private slots:
void qtbug_44783();
void internalTransition();
void conflictingTransition();
+ void conflictingTransition2();
void qtbug_46059();
+ void qtbug_46703();
void postEventFromBeginSelectTransitions();
};
@@ -266,7 +268,7 @@ public:
TestState(ChildMode mode, const QString &objectName = QString())
: QState(mode)
{ setObjectName(objectName); }
- QList<QPair<int, Event> > events;
+ QVector<QPair<int, Event> > events;
protected:
virtual void onEntry(QEvent *) {
events.append(qMakePair(globalTick++, Entry));
@@ -282,7 +284,7 @@ public:
TestTransition(QAbstractState *target, const QString &objectName = QString())
: QAbstractTransition()
{ setTargetState(target); setObjectName(objectName); }
- QList<int> triggers;
+ QVector<int> triggers;
protected:
virtual bool eventTest(QEvent *) {
return true;
@@ -4861,7 +4863,7 @@ public:
signalList.append(signal);
}
- QList<QMetaMethod> signalList;
+ QVector<QMetaMethod> signalList;
};
void tst_QStateMachine::testIncrementReceivers()
@@ -6448,6 +6450,71 @@ void tst_QStateMachine::conflictingTransition()
QVERIFY(machine.isRunning());
}
+void tst_QStateMachine::conflictingTransition2()
+{
+ SignalEmitter emitter;
+
+ QStateMachine machine;
+ QState s0(&machine);
+ QState p0(QState::ParallelStates, &s0);
+ QState p0s1(&p0);
+ QState p0s2(&p0);
+ QState p0s3(&p0);
+ QState s1(&machine);
+
+ machine.setInitialState(&s0);
+ s0.setInitialState(&p0);
+
+ QSignalTransition *t1 = new QSignalTransition(&emitter, SIGNAL(signalWithNoArg()));
+ p0s1.addTransition(t1);
+ QSignalTransition *t2 = p0s2.addTransition(&emitter, SIGNAL(signalWithNoArg()), &p0s1);
+ QSignalTransition *t3 = p0s3.addTransition(&emitter, SIGNAL(signalWithNoArg()), &s1);
+ QSignalSpy t1Spy(t1, &QAbstractTransition::triggered);
+ QSignalSpy t2Spy(t2, &QAbstractTransition::triggered);
+ QSignalSpy t3Spy(t3, &QAbstractTransition::triggered);
+ QVERIFY(t1Spy.isValid());
+ QVERIFY(t2Spy.isValid());
+ QVERIFY(t3Spy.isValid());
+
+ s0.setObjectName("s0");
+ p0.setObjectName("p0");
+ p0s1.setObjectName("p0s1");
+ p0s2.setObjectName("p0s2");
+ p0s3.setObjectName("p0s3");
+ s1.setObjectName("s1");
+ t1->setObjectName("p0s1->p0s1");
+ t2->setObjectName("p0s2->p0s1");
+ t3->setObjectName("p0s3->s1");
+
+ machine.start();
+
+ QTRY_COMPARE(machine.configuration().contains(&s0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s1), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s2), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s3), true);
+ QTRY_COMPARE(machine.configuration().contains(&s1), false);
+
+ QCOMPARE(t1Spy.count(), 0);
+ QCOMPARE(t2Spy.count(), 0);
+ QCOMPARE(t3Spy.count(), 0);
+
+ emitter.emitSignalWithNoArg();
+
+ QTRY_COMPARE(machine.configuration().contains(&s0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s1), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s2), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s3), true);
+ QTRY_COMPARE(machine.configuration().contains(&s1), false);
+
+ QCOMPARE(t1Spy.count(), 1);
+ QCOMPARE(t2Spy.count(), 1);
+ QCOMPARE(t3Spy.count(), 0); // t3 got preempted by t2
+
+ QVERIFY(machine.isRunning());
+}
+
void tst_QStateMachine::qtbug_46059()
{
QStateMachine machine;
@@ -6486,6 +6553,60 @@ void tst_QStateMachine::qtbug_46059()
QVERIFY(machine.isRunning());
}
+void tst_QStateMachine::qtbug_46703()
+{
+ QStateMachine machine;
+ QState root(&machine);
+ QHistoryState h(&root);
+ QState p(QState::ParallelStates, &root);
+ QState a(&p);
+ QState a1(&a);
+ QState a2(&a);
+ QState a3(&a);
+ QState b(&p);
+ QState b1(&b);
+ QState b2(&b);
+
+ machine.setObjectName("machine");
+ root.setObjectName("root");
+ h.setObjectName("h");
+ p.setObjectName("p");
+ a.setObjectName("a");
+ a1.setObjectName("a1");
+ a2.setObjectName("a2");
+ a3.setObjectName("a3");
+ b.setObjectName("b");
+ b1.setObjectName("b1");
+ b2.setObjectName("b2");
+
+ machine.setInitialState(&root);
+ root.setInitialState(&h);
+ a.setInitialState(&a3);
+ b.setInitialState(&b1);
+ struct : public QAbstractTransition {
+ virtual bool eventTest(QEvent *) { return false; }
+ virtual void onTransition(QEvent *) {}
+ } defaultTransition;
+ defaultTransition.setTargetStates(QList<QAbstractState*>() << &a2 << &b2);
+ h.setDefaultTransition(&defaultTransition);
+
+ machine.start();
+ QCoreApplication::processEvents();
+
+ QTRY_COMPARE(machine.configuration().contains(&root), true);
+ QTRY_COMPARE(machine.configuration().contains(&h), false);
+ QTRY_COMPARE(machine.configuration().contains(&p), true);
+ QTRY_COMPARE(machine.configuration().contains(&a), true);
+ QTRY_COMPARE(machine.configuration().contains(&a1), false);
+ QTRY_COMPARE(machine.configuration().contains(&a2), true);
+ QTRY_COMPARE(machine.configuration().contains(&a3), false);
+ QTRY_COMPARE(machine.configuration().contains(&b), true);
+ QTRY_COMPARE(machine.configuration().contains(&b1), false);
+ QTRY_COMPARE(machine.configuration().contains(&b2), true);
+
+ QVERIFY(machine.isRunning());
+}
+
void tst_QStateMachine::postEventFromBeginSelectTransitions()
{
class StateMachine : public QStateMachine {
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
index e8c58a9fa5..72ae68f81a 100644
--- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
@@ -479,34 +479,34 @@ void tst_QAtomicInt::testAndSet_data()
QTest::addColumn<int>("value");
QTest::addColumn<int>("expected");
QTest::addColumn<int>("newval");
- QTest::addColumn<int>("result");
+ QTest::addColumn<bool>("result");
// these should succeed
- QTest::newRow("success0") << 0 << 0 << 0 << 1;
- QTest::newRow("success1") << 0 << 0 << 1 << 1;
- QTest::newRow("success2") << 0 << 0 << -1 << 1;
- QTest::newRow("success3") << 1 << 1 << 0 << 1;
- QTest::newRow("success4") << 1 << 1 << 1 << 1;
- QTest::newRow("success5") << 1 << 1 << -1 << 1;
- QTest::newRow("success6") << -1 << -1 << 0 << 1;
- QTest::newRow("success7") << -1 << -1 << 1 << 1;
- QTest::newRow("success8") << -1 << -1 << -1 << 1;
- QTest::newRow("success9") << INT_MIN+1 << INT_MIN+1 << INT_MIN+1 << 1;
- QTest::newRow("successA") << INT_MIN+1 << INT_MIN+1 << 1 << 1;
- QTest::newRow("successB") << INT_MIN+1 << INT_MIN+1 << -1 << 1;
- QTest::newRow("successC") << INT_MAX << INT_MAX << INT_MAX << 1;
- QTest::newRow("successD") << INT_MAX << INT_MAX << 1 << 1;
- QTest::newRow("successE") << INT_MAX << INT_MAX << -1 << 1;
+ QTest::newRow("success0") << 0 << 0 << 0 << true;
+ QTest::newRow("success1") << 0 << 0 << 1 << true;
+ QTest::newRow("success2") << 0 << 0 << -1 << true;
+ QTest::newRow("success3") << 1 << 1 << 0 << true;
+ QTest::newRow("success4") << 1 << 1 << 1 << true;
+ QTest::newRow("success5") << 1 << 1 << -1 << true;
+ QTest::newRow("success6") << -1 << -1 << 0 << true;
+ QTest::newRow("success7") << -1 << -1 << 1 << true;
+ QTest::newRow("success8") << -1 << -1 << -1 << true;
+ QTest::newRow("success9") << INT_MIN+1 << INT_MIN+1 << INT_MIN+1 << true;
+ QTest::newRow("successA") << INT_MIN+1 << INT_MIN+1 << 1 << true;
+ QTest::newRow("successB") << INT_MIN+1 << INT_MIN+1 << -1 << true;
+ QTest::newRow("successC") << INT_MAX << INT_MAX << INT_MAX << true;
+ QTest::newRow("successD") << INT_MAX << INT_MAX << 1 << true;
+ QTest::newRow("successE") << INT_MAX << INT_MAX << -1 << true;
// these should fail
- QTest::newRow("failure0") << 0 << 1 << ~0 << 0;
- QTest::newRow("failure1") << 0 << -1 << ~0 << 0;
- QTest::newRow("failure2") << 1 << 0 << ~0 << 0;
- QTest::newRow("failure3") << -1 << 0 << ~0 << 0;
- QTest::newRow("failure4") << 1 << -1 << ~0 << 0;
- QTest::newRow("failure5") << -1 << 1 << ~0 << 0;
- QTest::newRow("failure6") << INT_MIN+1 << INT_MAX << ~0 << 0;
- QTest::newRow("failure7") << INT_MAX << INT_MIN+1 << ~0 << 0;
+ QTest::newRow("failure0") << 0 << 1 << ~0 << false;
+ QTest::newRow("failure1") << 0 << -1 << ~0 << false;
+ QTest::newRow("failure2") << 1 << 0 << ~0 << false;
+ QTest::newRow("failure3") << -1 << 0 << ~0 << false;
+ QTest::newRow("failure4") << 1 << -1 << ~0 << false;
+ QTest::newRow("failure5") << -1 << 1 << ~0 << false;
+ QTest::newRow("failure6") << INT_MIN+1 << INT_MAX << ~0 << false;
+ QTest::newRow("failure7") << INT_MAX << INT_MIN+1 << ~0 << false;
}
void tst_QAtomicInt::testAndSet()
@@ -517,26 +517,26 @@ void tst_QAtomicInt::testAndSet()
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetRelaxed(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetRelaxed(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetAcquire(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetAcquire(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetRelease(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetRelease(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetOrdered(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetOrdered(expected, newval), "result");
}
#ifdef Q_ATOMIC_INT32_IS_SUPPORTED
- QFETCH(int, result);
+ QFETCH(bool, result);
// the new implementation has the version that loads the current value
{
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri
index d9ebe64d5b..e80e71f238 100644
--- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri
+++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri
@@ -3,9 +3,9 @@ TYPE = $$basename(_PRO_FILE_PWD_)
dn = $$dirname(_PRO_FILE_PWD_)
FORCE = $$basename(dn)
-equals(FORCE, cxx11) {
- suffix = Cxx11_$$TYPE
- DEFINES += QT_ATOMIC_FORCE_CXX11
+equals(FORCE, no-cxx11) {
+ suffix = NoCxx11_$$TYPE
+ DEFINES += QT_ATOMIC_FORCE_NO_CXX11
} else: equals(FORCE, gcc) {
suffix = Gcc_$$TYPE
DEFINES += QT_ATOMIC_FORCE_GCC
diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
index 58e5b157bd..9d929e649e 100644
--- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
@@ -19,22 +19,22 @@ SUBDIRS=\
contains(QT_CONFIG, c++11)|msvc: SUBDIRS +=\
- cxx11/char \
- cxx11/char16_t \
- cxx11/char32_t \
- cxx11/int \
- cxx11/long \
- cxx11/qlonglong \
- cxx11/qptrdiff \
- cxx11/quintptr \
- cxx11/qulonglong \
- cxx11/schar \
- cxx11/short \
- cxx11/uchar \
- cxx11/uint \
- cxx11/ulong \
- cxx11/ushort \
- cxx11/wchar_t \
+ no-cxx11/char \
+ no-cxx11/char16_t \
+ no-cxx11/char32_t \
+ no-cxx11/int \
+ no-cxx11/long \
+ no-cxx11/qlonglong \
+ no-cxx11/qptrdiff \
+ no-cxx11/quintptr \
+ no-cxx11/qulonglong \
+ no-cxx11/schar \
+ no-cxx11/short \
+ no-cxx11/uchar \
+ no-cxx11/uint \
+ no-cxx11/ulong \
+ no-cxx11/ushort \
+ no-cxx11/wchar_t \
# The GCC-style atomics only support 32-bit and pointer-sized but add
diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
index 99978a9923..ad690a094b 100644
--- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
@@ -648,7 +648,7 @@ void tst_QFuture::cancel()
result.reportStarted();
f = result.future();
- QVERIFY(f.isCanceled() == false);
+ QVERIFY(!f.isCanceled());
result.reportCanceled();
QVERIFY(f.isCanceled());
result.reportFinished();
@@ -663,14 +663,14 @@ void tst_QFuture::cancel()
QFutureInterface<void> result;
QFuture<void> f;
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
result.reportStarted();
f = result.future();
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
- QVERIFY(result.isCanceled() == false);
+ QVERIFY(!result.isCanceled());
f.cancel();
QVERIFY(result.isCanceled());
@@ -683,12 +683,12 @@ void tst_QFuture::cancel()
QFutureInterface<void> result;
QFuture<void> f;
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
result.reportStarted();
f = result.future();
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
result.reportFinished();
@@ -805,12 +805,12 @@ void tst_QFuture::indexedResults()
{
QFutureInterface<QChar> Interface;
QFuture<QChar> f;
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
Interface.reportStarted();
f = Interface.future();
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
QChar result;
@@ -1126,14 +1126,14 @@ void tst_QFuture::iterators()
QVERIFY(it.hasNext());
QCOMPARE(it.peekNext(), resultCount - 1);
QCOMPARE(it.next(), resultCount - 1);
- QVERIFY(it.hasNext() == false);
+ QVERIFY(!it.hasNext());
}
{
QFutureIterator<int> it(f);
QVERIFY(it.hasNext());
it.toBack();
- QVERIFY(it.hasNext() == false);
+ QVERIFY(!it.hasNext());
it.toFront();
QVERIFY(it.hasNext());
}
@@ -1192,15 +1192,15 @@ void tst_QFuture::pause()
Interface.reportStarted();
QFuture<void> f = Interface.future();
- QVERIFY(Interface.isPaused() == false);
+ QVERIFY(!Interface.isPaused());
f.pause();
- QVERIFY(Interface.isPaused() == true);
+ QVERIFY(Interface.isPaused());
f.resume();
- QVERIFY(Interface.isPaused() == false);
+ QVERIFY(!Interface.isPaused());
f.togglePaused();
- QVERIFY(Interface.isPaused() == true);
+ QVERIFY(Interface.isPaused());
f.togglePaused();
- QVERIFY(Interface.isPaused() == false);
+ QVERIFY(!Interface.isPaused());
Interface.reportFinished();
}
@@ -1228,13 +1228,13 @@ void tst_QFuture::throttling()
i.reportStarted();
QFuture<void> f = i.future();
- QVERIFY(i.isThrottled() == false);
+ QVERIFY(!i.isThrottled());
i.setThrottled(true);
QVERIFY(i.isThrottled());
i.setThrottled(false);
- QVERIFY(i.isThrottled() == false);
+ QVERIFY(!i.isThrottled());
i.setThrottled(true);
QVERIFY(i.isThrottled());
diff --git a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
index 8831345ad7..c4fad93e4b 100644
--- a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -68,6 +68,7 @@ private slots:
void incrementalFilterResults();
void qfutureSynchronizer();
void warnRace();
+ void matchFlags();
};
void sleeper()
@@ -312,10 +313,16 @@ void tst_QFutureWatcher::futureSignals()
// (QSignalSpy does not trigger it.)
connect(&f, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
a.reportStarted();
- f.setFuture(a.future());
QSignalSpy progressSpy(&f, &QFutureWatcher<void>::progressValueChanged);
+ QSignalSpy finishedSpy(&f, &QFutureWatcher<void>::finished);
+ QSignalSpy resultReadySpy(&f, &QFutureWatcher<void>::resultReadyAt);
+
QVERIFY(progressSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(resultReadySpy.isValid());
+ f.setFuture(a.future());
+
const int progress = 1;
a.setProgressValue(progress);
QTest::qWait(10);
@@ -323,12 +330,6 @@ void tst_QFutureWatcher::futureSignals()
QCOMPARE(progressSpy.takeFirst().at(0).toInt(), 0);
QCOMPARE(progressSpy.takeFirst().at(0).toInt(), 1);
- QSignalSpy finishedSpy(&f, &QFutureWatcher<void>::finished);
- QSignalSpy resultReadySpy(&f, &QFutureWatcher<void>::resultReadyAt);
-
- QVERIFY(finishedSpy.isValid());
- QVERIFY(resultReadySpy.isValid());
-
const int result = 10;
a.reportResult(&result);
QTest::qWait(10);
@@ -426,16 +427,15 @@ void tst_QFutureWatcher::disconnectRunningFuture()
QFuture<int> f = a.future();
QFutureWatcher<int> *watcher = new QFutureWatcher<int>();
- watcher->setFuture(f);
-
- SignalSlotObject object;
- connect(watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
-
QSignalSpy finishedSpy(watcher, &QFutureWatcher<int>::finished);
QSignalSpy resultReadySpy(watcher, &QFutureWatcher<int>::resultReadyAt);
QVERIFY(finishedSpy.isValid());
QVERIFY(resultReadySpy.isValid());
+ watcher->setFuture(f);
+
+ SignalSlotObject object;
+ connect(watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
const int result = 10;
a.reportResult(&result);
@@ -677,11 +677,6 @@ void tst_QFutureWatcher::pauseEvents()
QFutureInterface<int> iface;
iface.reportStarted();
- QFuture<int> a = iface.future();
-
- int value = 0;
- iface.reportFinished(&value);
-
QFutureWatcher<int> watcher;
SignalSlotObject object;
@@ -689,14 +684,17 @@ void tst_QFutureWatcher::pauseEvents()
QSignalSpy resultReadySpy(&watcher, &QFutureWatcher<int>::resultReadyAt);
QVERIFY(resultReadySpy.isValid());
- watcher.setFuture(a);
+ watcher.setFuture(iface.future());
watcher.pause();
+ int value = 0;
+ iface.reportFinished(&value);
+
QTest::qWait(10);
QCOMPARE(resultReadySpy.count(), 0);
watcher.resume();
- QTest::qWait(10);
+ QTRY_VERIFY2(!resultReadySpy.isEmpty(), "Result didn't arrive");
QCOMPARE(resultReadySpy.count(), 1);
}
{
@@ -705,9 +703,6 @@ void tst_QFutureWatcher::pauseEvents()
QFuture<int> a = iface.future();
- int value = 0;
- iface.reportFinished(&value);
-
QFutureWatcher<int> watcher;
SignalSlotObject object;
@@ -718,6 +713,9 @@ void tst_QFutureWatcher::pauseEvents()
watcher.setFuture(a);
a.pause();
+ int value = 0;
+ iface.reportFinished(&value);
+
QFuture<int> b;
watcher.setFuture(b); // If we watch b instead, resuming a
a.resume(); // should give us no results.
@@ -743,7 +741,7 @@ void tst_QFutureWatcher::finishedState()
iface.reportFinished();
QVERIFY(future.isFinished());
- QVERIFY(watcher.isFinished() == false);
+ QVERIFY(!watcher.isFinished());
QTest::qWait(10);
QVERIFY(watcher.isFinished());
@@ -761,18 +759,18 @@ void tst_QFutureWatcher::throttling()
QFutureWatcher<int> watcher;
watcher.setFuture(future);
- QVERIFY(iface.isThrottled() == false);
+ QVERIFY(!iface.isThrottled());
for (int i = 0; i < 1000; ++i) {
int result = 0;
iface.reportResult(result);
}
- QVERIFY(iface.isThrottled() == true);
+ QVERIFY(iface.isThrottled());
QTest::qWait(100); // process events.
- QVERIFY(iface.isThrottled() == false);
+ QVERIFY(!iface.isThrottled());
iface.reportFinished();
}
@@ -930,5 +928,17 @@ void tst_QFutureWatcher::warnRace()
future.waitForFinished();
}
+void tst_QFutureWatcher::matchFlags()
+{
+ /* Regression test: expect a default watcher to be in the same state as a
+ * default future. */
+ QFutureWatcher<int> watcher;
+ QFuture<int> future;
+ QCOMPARE(watcher.isStarted(), future.isStarted());
+ QCOMPARE(watcher.isCanceled(), future.isCanceled());
+ QCOMPARE(watcher.isFinished(), future.isFinished());
+}
+
+
QTEST_MAIN(tst_QFutureWatcher)
#include "tst_qfuturewatcher.moc"
diff --git a/tests/auto/corelib/thread/qsemaphore/BLACKLIST b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
new file mode 100644
index 0000000000..9f6f6e3ba6
--- /dev/null
+++ b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
@@ -0,0 +1,3 @@
+# Times out randomly on linux, windows, osx
+[tryAcquireWithTimeout]
+*
diff --git a/tests/auto/corelib/thread/qthread/BLACKLIST b/tests/auto/corelib/thread/qthread/BLACKLIST
new file mode 100644
index 0000000000..d75249454f
--- /dev/null
+++ b/tests/auto/corelib/thread/qthread/BLACKLIST
@@ -0,0 +1,2 @@
+[wait3_slowDestructor]
+windows
diff --git a/tests/auto/corelib/thread/qthreadpool/BLACKLIST b/tests/auto/corelib/thread/qthreadpool/BLACKLIST
new file mode 100644
index 0000000000..1c392ce96c
--- /dev/null
+++ b/tests/auto/corelib/thread/qthreadpool/BLACKLIST
@@ -0,0 +1,2 @@
+[expiryTimeoutRace]
+osx
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index c9fdb4b718..c465a07487 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -821,7 +821,7 @@ void tst_QThreadPool::tryStartCount()
++count;
QCOMPARE(count, QThread::idealThreadCount());
- QTest::qWait(100);
+ QTRY_COMPARE(threadPool.activeThreadCount(), 0);
}
}
diff --git a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro
index 2fa973d2f7..e81038a4be 100644
--- a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro
@@ -1,5 +1,7 @@
TEMPLATE = subdirs
SUBDIRS = \
- crashonexit \
test
+
+!winrt: SUBDIRS += crashonexit
+
CONFIG += ordered parallel_test
diff --git a/tests/auto/corelib/thread/qthreadstorage/test/test.pro b/tests/auto/corelib/thread/qthreadstorage/test/test.pro
index 8b7caf1e24..d97d474e51 100644
--- a/tests/auto/corelib/thread/qthreadstorage/test/test.pro
+++ b/tests/auto/corelib/thread/qthreadstorage/test/test.pro
@@ -5,6 +5,6 @@ CONFIG += console
QT = core testlib
SOURCES = ../tst_qthreadstorage.cpp
-TEST_HELPER_INSTALLS = ../crashonexit/crashonexit
+!winrt: TEST_HELPER_INSTALLS = ../crashonexit/crashonexit
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 5e9b7370b9..ed7b446172 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -240,7 +240,7 @@ void tst_QThreadStorage::adoptedThreads()
QTestEventLoop::instance().enterLoop(2);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(Pointer::count, c);
+ QTRY_COMPARE(Pointer::count, c);
}
QBasicAtomicInt cleanupOrder = Q_BASIC_ATOMIC_INITIALIZER(0);
diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index dea305e3e1..df52aa4949 100644
--- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -33,6 +33,7 @@
#include <QtTest/QtTest>
+#include <qatomic.h>
#include <qcoreapplication.h>
#include <qmutex.h>
#include <qthread.h>
@@ -54,7 +55,25 @@ private slots:
static const int iterations = 4;
static const int ThreadCount = 4;
-class wait_QMutex_Thread_1 : public QThread
+// Terminate thread in destructor for threads instantiated on the stack
+class TerminatingThread : public QThread
+{
+public:
+ explicit TerminatingThread()
+ {
+ setTerminationEnabled(true);
+ }
+
+ ~TerminatingThread()
+ {
+ if (isRunning()) {
+ qWarning() << "forcibly terminating " << objectName();
+ terminate();
+ }
+ }
+};
+
+class wait_QMutex_Thread_1 : public TerminatingThread
{
public:
QMutex mutex;
@@ -72,7 +91,7 @@ public:
}
};
-class wait_QMutex_Thread_2 : public QThread
+class wait_QMutex_Thread_2 : public TerminatingThread
{
public:
QWaitCondition started;
@@ -93,7 +112,7 @@ public:
}
};
-class wait_QReadWriteLock_Thread_1 : public QThread
+class wait_QReadWriteLock_Thread_1 : public TerminatingThread
{
public:
QReadWriteLock readWriteLock;
@@ -111,7 +130,7 @@ public:
}
};
-class wait_QReadWriteLock_Thread_2 : public QThread
+class wait_QReadWriteLock_Thread_2 : public TerminatingThread
{
public:
QWaitCondition started;
@@ -155,7 +174,11 @@ void tst_QWaitCondition::wait_QMutex()
// test multiple threads waiting on separate wait conditions
wait_QMutex_Thread_1 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].mutex.lock();
thread[x].start();
// wait for thread to start
@@ -185,8 +208,12 @@ void tst_QWaitCondition::wait_QMutex()
QWaitCondition cond1, cond2;
wait_QMutex_Thread_2 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].mutex = &mutex;
thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2;
thread[x].start();
@@ -289,7 +316,10 @@ void tst_QWaitCondition::wait_QReadWriteLock()
// test multiple threads waiting on separate wait conditions
wait_QReadWriteLock_Thread_1 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_lockforread_");
+
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].readWriteLock.lockForRead();
thread[x].start();
// wait for thread to start
@@ -319,8 +349,11 @@ void tst_QWaitCondition::wait_QReadWriteLock()
QWaitCondition cond1, cond2;
wait_QReadWriteLock_Thread_2 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_lockforwrite_");
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].readWriteLock = &readWriteLock;
thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2;
thread[x].start();
@@ -346,11 +379,17 @@ void tst_QWaitCondition::wait_QReadWriteLock()
}
}
-class wake_Thread : public QThread
+class WakeThreadBase : public TerminatingThread
{
public:
- static int count;
+ QAtomicInt *count;
+ WakeThreadBase() : count(Q_NULLPTR) {}
+};
+
+class wake_Thread : public WakeThreadBase
+{
+public:
QWaitCondition started;
QWaitCondition dummy;
@@ -366,24 +405,23 @@ public:
void run()
{
+ Q_ASSERT(count);
+ Q_ASSERT(mutex);
+ Q_ASSERT(cond);
mutex->lock();
- ++count;
+ ++*count;
dummy.wakeOne(); // this wakeup should be lost
started.wakeOne();
dummy.wakeAll(); // this one too
cond->wait(mutex);
- --count;
+ --*count;
mutex->unlock();
}
};
-int wake_Thread::count = 0;
-
-class wake_Thread_2 : public QThread
+class wake_Thread_2 : public WakeThreadBase
{
public:
- static int count;
-
QWaitCondition started;
QWaitCondition dummy;
@@ -399,22 +437,27 @@ public:
void run()
{
+ Q_ASSERT(count);
+ Q_ASSERT(readWriteLock);
+ Q_ASSERT(cond);
readWriteLock->lockForWrite();
- ++count;
+ ++*count;
dummy.wakeOne(); // this wakeup should be lost
started.wakeOne();
dummy.wakeAll(); // this one too
cond->wait(readWriteLock);
- --count;
+ --*count;
readWriteLock->unlock();
}
};
-int wake_Thread_2::count = 0;
-
void tst_QWaitCondition::wakeOne()
{
+ static const int firstWaitInterval = 1000;
+ static const int waitInterval = 30;
+
int x;
+ QAtomicInt count;
// wake up threads, one at a time
for (int i = 0; i < iterations; ++i) {
QMutex mutex;
@@ -424,8 +467,13 @@ void tst_QWaitCondition::wakeOne()
wake_Thread thread[ThreadCount];
bool thread_exited[ThreadCount];
+ QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
+ thread[x].count = &count;
thread[x].mutex = &mutex;
thread[x].cond = &cond;
thread_exited[x] = false;
@@ -438,7 +486,7 @@ void tst_QWaitCondition::wakeOne()
}
mutex.unlock();
- QCOMPARE(wake_Thread::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; ++x) {
@@ -452,24 +500,29 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (thread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (thread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 1);
- QCOMPARE(wake_Thread::count, ThreadCount - (x + 1));
+ QCOMPARE(count.load(), ThreadCount - (x + 1));
}
- QCOMPARE(wake_Thread::count, 0);
+ QCOMPARE(count.load(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
+ prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_readwritelock_")
+ + QString::number(i) + QLatin1Char('_');
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ rwthread[x].setObjectName(prefix + QString::number(x));
+ rwthread[x].count = &count;
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
thread_exited[x] = false;
@@ -482,7 +535,7 @@ void tst_QWaitCondition::wakeOne()
}
readWriteLock.unlock();
- QCOMPARE(wake_Thread_2::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; ++x) {
@@ -496,17 +549,17 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (rwthread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 1);
- QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 1));
+ QCOMPARE(count.load(), ThreadCount - (x + 1));
}
- QCOMPARE(wake_Thread_2::count, 0);
+ QCOMPARE(count.load(), 0);
}
// wake up threads, two at a time
@@ -518,8 +571,13 @@ void tst_QWaitCondition::wakeOne()
wake_Thread thread[ThreadCount];
bool thread_exited[ThreadCount];
+ QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex2_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
+ thread[x].count = &count;
thread[x].mutex = &mutex;
thread[x].cond = &cond;
thread_exited[x] = false;
@@ -532,7 +590,7 @@ void tst_QWaitCondition::wakeOne()
}
mutex.unlock();
- QCOMPARE(wake_Thread::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; x += 2) {
@@ -548,24 +606,29 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (thread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (thread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 2);
- QCOMPARE(wake_Thread::count, ThreadCount - (x + 2));
+ QCOMPARE(count.load(), ThreadCount - (x + 2));
}
- QCOMPARE(wake_Thread::count, 0);
+ QCOMPARE(count.load(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
+ prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_readwritelock_")
+ + QString::number(i) + QLatin1Char('_');
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ rwthread[x].setObjectName(prefix + QString::number(x));
+ rwthread[x].count = &count;
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
thread_exited[x] = false;
@@ -578,7 +641,7 @@ void tst_QWaitCondition::wakeOne()
}
readWriteLock.unlock();
- QCOMPARE(wake_Thread_2::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; x += 2) {
@@ -594,23 +657,24 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (rwthread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 2);
- QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 2));
+ QCOMPARE(count.load(), ThreadCount - (x + 2));
}
- QCOMPARE(wake_Thread_2::count, 0);
+ QCOMPARE(count.load(), 0);
}
}
void tst_QWaitCondition::wakeAll()
{
int x;
+ QAtomicInt count;
for (int i = 0; i < iterations; ++i) {
QMutex mutex;
QWaitCondition cond;
@@ -618,8 +682,13 @@ void tst_QWaitCondition::wakeAll()
// QMutex
wake_Thread thread[ThreadCount];
+ QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
+ thread[x].count = &count;
thread[x].mutex = &mutex;
thread[x].cond = &cond;
thread[x].start();
@@ -628,7 +697,7 @@ void tst_QWaitCondition::wakeAll()
}
mutex.unlock();
- QCOMPARE(wake_Thread::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up all threads at once
mutex.lock();
@@ -643,14 +712,19 @@ void tst_QWaitCondition::wakeAll()
}
QCOMPARE(exited, ThreadCount);
- QCOMPARE(wake_Thread::count, 0);
+ QCOMPARE(count.load(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
+ prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_readwritelock_")
+ + QString::number(i) + QLatin1Char('_');
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ rwthread[x].setObjectName(prefix + QString::number(x));
+ rwthread[x].count = &count;
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
rwthread[x].start();
@@ -659,7 +733,7 @@ void tst_QWaitCondition::wakeAll()
}
readWriteLock.unlock();
- QCOMPARE(wake_Thread_2::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up all threads at once
readWriteLock.lockForWrite();
@@ -674,11 +748,11 @@ void tst_QWaitCondition::wakeAll()
}
QCOMPARE(exited, ThreadCount);
- QCOMPARE(wake_Thread_2::count, 0);
+ QCOMPARE(count.load(), 0);
}
}
-class wait_RaceConditionThread : public QThread
+class wait_RaceConditionThread : public TerminatingThread
{
public:
wait_RaceConditionThread(QMutex *mutex, QWaitCondition *startup, QWaitCondition *waitCondition,
@@ -707,7 +781,7 @@ public:
}
};
-class wait_RaceConditionThread_2 : public QThread
+class wait_RaceConditionThread_2 : public TerminatingThread
{
public:
wait_RaceConditionThread_2(QReadWriteLock *readWriteLock,
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index 7eedd5bcf7..b9487cee33 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -90,7 +90,9 @@ void foo()
#include "qvector.h"
#include "qqueue.h"
+QT_BEGIN_NAMESPACE
template class QList<int>;
+QT_END_NAMESPACE
class tst_Collections : public QObject
{
@@ -2235,7 +2237,7 @@ void tst_Collections::qstring()
void tst_Collections::bitArray()
{
QBitArray ba(20);
- QVERIFY(ba.testBit(17) == false);
+ QVERIFY(!ba.testBit(17));
ba.setBit(17);
QVERIFY(ba.size() == 20);
QVERIFY(ba.testBit(17)==true);
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 9bce948140..99e5c4c85d 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -31,6 +31,7 @@
**
****************************************************************************/
+#include "../../../../../src/corelib/tools/qalgorithms.h"
#include <QtTest/QtTest>
#include <iostream>
@@ -80,6 +81,24 @@ private slots:
void popCount32() { popCount_impl<quint32>(); }
void popCount64() { popCount_impl<quint64>(); }
+ void countTrailing08_data() { countTrailing_data_impl(sizeof(quint8 )); }
+ void countTrailing16_data() { countTrailing_data_impl(sizeof(quint16)); }
+ void countTrailing32_data() { countTrailing_data_impl(sizeof(quint32)); }
+ void countTrailing64_data() { countTrailing_data_impl(sizeof(quint64)); }
+ void countTrailing08() { countTrailing_impl<quint8 >(); }
+ void countTrailing16() { countTrailing_impl<quint16>(); }
+ void countTrailing32() { countTrailing_impl<quint32>(); }
+ void countTrailing64() { countTrailing_impl<quint64>(); }
+
+ void countLeading08_data() { countLeading_data_impl(sizeof(quint8 )); }
+ void countLeading16_data() { countLeading_data_impl(sizeof(quint16)); }
+ void countLeading32_data() { countLeading_data_impl(sizeof(quint32)); }
+ void countLeading64_data() { countLeading_data_impl(sizeof(quint64)); }
+ void countLeading08() { countLeading_impl<quint8 >(); }
+ void countLeading16() { countLeading_impl<quint16>(); }
+ void countLeading32() { countLeading_impl<quint32>(); }
+ void countLeading64() { countLeading_impl<quint64>(); }
+
private:
#if Q_TEST_PERFORMANCE
void performance();
@@ -87,6 +106,14 @@ private:
void popCount_data_impl(size_t sizeof_T_Int);
template <typename T_Int>
void popCount_impl();
+
+ void countTrailing_data_impl(size_t sizeof_T_Int);
+ template <typename T_Int>
+ void countTrailing_impl();
+
+ void countLeading_data_impl(size_t sizeof_T_Int);
+ template <typename T_Int>
+ void countLeading_impl();
};
class TestInt
@@ -1084,6 +1111,86 @@ void tst_QAlgorithms::popCount_impl()
QCOMPARE(qPopulationCount(value), expected);
}
+void tst_QAlgorithms::countTrailing_data_impl(size_t sizeof_T_Int)
+{
+ using namespace QTest;
+ addColumn<quint64>("input");
+ addColumn<uint>("expected");
+
+ int nibs = sizeof_T_Int*2;
+
+ newRow(("0x"+QByteArray::number(0,16).rightJustified(nibs,'0')).constData()) << Q_UINT64_C(0) << uint(sizeof_T_Int*8);
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ const quint64 input = Q_UINT64_C(1) << i;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << i;
+ }
+
+ quint64 type_mask;
+ if (sizeof_T_Int>=8)
+ type_mask = ~Q_UINT64_C(0);
+ else
+ type_mask = (Q_UINT64_C(1) << (sizeof_T_Int*8))-1;
+
+ // and some random ones:
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ for (uint j = 0; j < sizeof_T_Int*3; ++j) { // 3 is arbitrary
+ const quint64 r = quint64(qrand()) << 32 | quint32(qrand());
+ const quint64 b = Q_UINT64_C(1) << i;
+ const quint64 mask = ((~(b-1)) ^ b) & type_mask;
+ const quint64 input = (r&mask) | b;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << i;
+ }
+ }
+}
+
+template <typename T_Int>
+void tst_QAlgorithms::countTrailing_impl()
+{
+ QFETCH(quint64, input);
+ QFETCH(uint, expected);
+
+ const T_Int value = static_cast<T_Int>(input);
+
+ QCOMPARE(qCountTrailingZeroBits(value), expected);
+}
+
+void tst_QAlgorithms::countLeading_data_impl(size_t sizeof_T_Int)
+{
+ using namespace QTest;
+ addColumn<quint64>("input");
+ addColumn<uint>("expected");
+
+ int nibs = sizeof_T_Int*2;
+
+ newRow(("0x"+QByteArray::number(0,16).rightJustified(nibs,'0')).constData()) << Q_UINT64_C(0) << uint(sizeof_T_Int*8);
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ const quint64 input = Q_UINT64_C(1) << i;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << uint(sizeof_T_Int*8-i-1);
+ }
+
+ // and some random ones:
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ for (uint j = 0; j < sizeof_T_Int*3; ++j) { // 3 is arbitrary
+ const quint64 r = quint64(qrand()) << 32 | quint32(qrand());
+ const quint64 b = Q_UINT64_C(1) << i;
+ const quint64 mask = b-1;
+ const quint64 input = (r&mask) | b;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << uint(sizeof_T_Int*8-i-1);
+ }
+ }
+}
+
+template <typename T_Int>
+void tst_QAlgorithms::countLeading_impl()
+{
+ QFETCH(quint64, input);
+ QFETCH(uint, expected);
+
+ const T_Int value = static_cast<T_Int>(input);
+
+ QCOMPARE(qCountLeadingZeroBits(value), expected);
+}
+
QTEST_APPLESS_MAIN(tst_QAlgorithms)
#include "tst_qalgorithms.moc"
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 410b34e894..f942eab800 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -67,6 +67,7 @@ private slots:
void endsWith_data();
void endsWith();
void endsWith_char();
+ void reverseIterators();
void split_data();
void split();
void base64_data();
@@ -540,6 +541,20 @@ void tst_QByteArray::endsWith_char()
QVERIFY(!QByteArray().endsWith('\0'));
}
+void tst_QByteArray::reverseIterators()
+{
+ QByteArray s = "1234";
+ QByteArray sr = s;
+ std::reverse(sr.begin(), sr.end());
+ const QByteArray &csr = sr;
+ QVERIFY(std::equal(s.begin(), s.end(), sr.rbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), sr.crbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), csr.rbegin()));
+ QVERIFY(std::equal(sr.rbegin(), sr.rend(), s.begin()));
+ QVERIFY(std::equal(sr.crbegin(), sr.crend(), s.begin()));
+ QVERIFY(std::equal(csr.rbegin(), csr.rend(), s.begin()));
+}
+
void tst_QByteArray::split_data()
{
QTest::addColumn<QByteArray>("sample");
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
index c2b76cc41a..95d05904a2 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
@@ -72,35 +72,31 @@ void tst_QByteArray_macTypes()
}
// QByteArray <-> NSData
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QByteArray qtByteArray("test bytearray");
const NSData *nsData = qtByteArray.toNSData();
QCOMPARE(QByteArray::fromNSData(nsData), qtByteArray);
- [autoreleasepool release];
}
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QByteArray qtByteArray("test bytearray");
const NSData *nsData = qtByteArray.toNSData();
QByteArray qtByteArrayCopy(qtByteArray);
qtByteArray = qtByteArray.toUpper(); // modify
QCOMPARE(QByteArray::fromNSData(nsData), qtByteArrayCopy);
- [autoreleasepool release];
}
// QByteArray <-> NSData Raw
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QByteArray qtByteArray("test bytearray");
const NSData *nsData = qtByteArray.toRawNSData();
QCOMPARE([nsData bytes], qtByteArray.constData());
- [autoreleasepool release];
}
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
const char data[] = "nsdata test";
const NSData *nsData = [NSData dataWithBytes:data length:sizeof(data)];
QByteArray qtByteArray = QByteArray::fromRawNSData(nsData);
QCOMPARE(qtByteArray.constData(), [nsData bytes]);
- [autoreleasepool release];
}
}
diff --git a/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt b/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
index 23c1e51d5f..0290080998 100644
--- a/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
+++ b/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
@@ -1,8 +1,8 @@
-# NormalizationTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:41 GMT [MD]
+# NormalizationTest-8.0.0.txt
+# Date: 2015-02-13, 13:30:27 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -17523,6 +17523,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 085A 059A 0316 302A 0062;0061 302A 085A 0316 059A 0062;0061 302A 085A 0316 059A 0062;0061 302A 085A 0316 059A 0062;0061 302A 085A 0316 059A 0062; # (a◌࡚◌֚◌̖◌〪b; a◌〪◌࡚◌̖◌֚b; a◌〪◌࡚◌̖◌֚b; a◌〪◌࡚◌̖◌֚b; a◌〪◌࡚◌̖◌֚b; ) LATIN SMALL LETTER A, MANDAIC VOCALIZATION MARK, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 059A 0316 302A 085B 0062;0061 302A 0316 085B 059A 0062;0061 302A 0316 085B 059A 0062;0061 302A 0316 085B 059A 0062;0061 302A 0316 085B 059A 0062; # (a◌֚◌̖◌〪◌࡛b; a◌〪◌̖◌࡛◌֚b; a◌〪◌̖◌࡛◌֚b; a◌〪◌̖◌࡛◌֚b; a◌〪◌̖◌࡛◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MANDAIC GEMINATION MARK, LATIN SMALL LETTER B
0061 085B 059A 0316 302A 0062;0061 302A 085B 0316 059A 0062;0061 302A 085B 0316 059A 0062;0061 302A 085B 0316 059A 0062;0061 302A 085B 0316 059A 0062; # (a◌࡛◌֚◌̖◌〪b; a◌〪◌࡛◌̖◌֚b; a◌〪◌࡛◌̖◌֚b; a◌〪◌࡛◌̖◌֚b; a◌〪◌࡛◌̖◌֚b; ) LATIN SMALL LETTER A, MANDAIC GEMINATION MARK, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
+0061 059A 0316 302A 08E3 0062;0061 302A 0316 08E3 059A 0062;0061 302A 0316 08E3 059A 0062;0061 302A 0316 08E3 059A 0062;0061 302A 0316 08E3 059A 0062; # (a◌֚◌̖◌〪◌ࣣb; a◌〪◌̖◌ࣣ◌֚b; a◌〪◌̖◌ࣣ◌֚b; a◌〪◌̖◌ࣣ◌֚b; a◌〪◌̖◌ࣣ◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, ARABIC TURNED DAMMA BELOW, LATIN SMALL LETTER B
+0061 08E3 059A 0316 302A 0062;0061 302A 08E3 0316 059A 0062;0061 302A 08E3 0316 059A 0062;0061 302A 08E3 0316 059A 0062;0061 302A 08E3 0316 059A 0062; # (a◌ࣣ◌֚◌̖◌〪b; a◌〪◌ࣣ◌̖◌֚b; a◌〪◌ࣣ◌̖◌֚b; a◌〪◌ࣣ◌̖◌֚b; a◌〪◌ࣣ◌̖◌֚b; ) LATIN SMALL LETTER A, ARABIC TURNED DAMMA BELOW, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 0315 0300 05AE 08E4 0062;00E0 05AE 08E4 0315 0062;0061 05AE 0300 08E4 0315 0062;00E0 05AE 08E4 0315 0062;0061 05AE 0300 08E4 0315 0062; # (a◌̕◌̀◌֮◌ࣤb; à◌֮◌ࣤ◌̕b; a◌֮◌̀◌ࣤ◌̕b; à◌֮◌ࣤ◌̕b; a◌֮◌̀◌ࣤ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, ARABIC CURLY FATHA, LATIN SMALL LETTER B
0061 08E4 0315 0300 05AE 0062;0061 05AE 08E4 0300 0315 0062;0061 05AE 08E4 0300 0315 0062;0061 05AE 08E4 0300 0315 0062;0061 05AE 08E4 0300 0315 0062; # (a◌ࣤ◌̕◌̀◌֮b; a◌֮◌ࣤ◌̀◌̕b; a◌֮◌ࣤ◌̀◌̕b; a◌֮◌ࣤ◌̀◌̕b; a◌֮◌ࣤ◌̀◌̕b; ) LATIN SMALL LETTER A, ARABIC CURLY FATHA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE 08E5 0062;00E0 05AE 08E5 0315 0062;0061 05AE 0300 08E5 0315 0062;00E0 05AE 08E5 0315 0062;0061 05AE 0300 08E5 0315 0062; # (a◌̕◌̀◌֮◌ࣥb; à◌֮◌ࣥ◌̕b; a◌֮◌̀◌ࣥ◌̕b; à◌֮◌ࣥ◌̕b; a◌֮◌̀◌ࣥ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, ARABIC CURLY DAMMA, LATIN SMALL LETTER B
@@ -18135,6 +18137,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 A67C 0315 0300 05AE 0062;0061 05AE A67C 0300 0315 0062;0061 05AE A67C 0300 0315 0062;0061 05AE A67C 0300 0315 0062;0061 05AE A67C 0300 0315 0062; # (a◌꙼◌̕◌̀◌֮b; a◌֮◌꙼◌̀◌̕b; a◌֮◌꙼◌̀◌̕b; a◌֮◌꙼◌̀◌̕b; a◌֮◌꙼◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC KAVYKA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE A67D 0062;00E0 05AE A67D 0315 0062;0061 05AE 0300 A67D 0315 0062;00E0 05AE A67D 0315 0062;0061 05AE 0300 A67D 0315 0062; # (a◌̕◌̀◌֮◌꙽b; à◌֮◌꙽◌̕b; a◌֮◌̀◌꙽◌̕b; à◌֮◌꙽◌̕b; a◌֮◌̀◌꙽◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC PAYEROK, LATIN SMALL LETTER B
0061 A67D 0315 0300 05AE 0062;0061 05AE A67D 0300 0315 0062;0061 05AE A67D 0300 0315 0062;0061 05AE A67D 0300 0315 0062;0061 05AE A67D 0300 0315 0062; # (a◌꙽◌̕◌̀◌֮b; a◌֮◌꙽◌̀◌̕b; a◌֮◌꙽◌̀◌̕b; a◌֮◌꙽◌̀◌̕b; a◌֮◌꙽◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC PAYEROK, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
+0061 0315 0300 05AE A69E 0062;00E0 05AE A69E 0315 0062;0061 05AE 0300 A69E 0315 0062;00E0 05AE A69E 0315 0062;0061 05AE 0300 A69E 0315 0062; # (a◌̕◌̀◌֮◌ꚞb; à◌֮◌ꚞ◌̕b; a◌֮◌̀◌ꚞ◌̕b; à◌֮◌ꚞ◌̕b; a◌֮◌̀◌ꚞ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC LETTER EF, LATIN SMALL LETTER B
+0061 A69E 0315 0300 05AE 0062;0061 05AE A69E 0300 0315 0062;0061 05AE A69E 0300 0315 0062;0061 05AE A69E 0300 0315 0062;0061 05AE A69E 0300 0315 0062; # (a◌ꚞ◌̕◌̀◌֮b; a◌֮◌ꚞ◌̀◌̕b; a◌֮◌ꚞ◌̀◌̕b; a◌֮◌ꚞ◌̀◌̕b; a◌֮◌ꚞ◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC LETTER EF, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE A69F 0062;00E0 05AE A69F 0315 0062;0061 05AE 0300 A69F 0315 0062;00E0 05AE A69F 0315 0062;0061 05AE 0300 A69F 0315 0062; # (a◌̕◌̀◌֮◌ꚟb; à◌֮◌ꚟ◌̕b; a◌֮◌̀◌ꚟ◌̕b; à◌֮◌ꚟ◌̕b; a◌֮◌̀◌ꚟ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC LETTER IOTIFIED E, LATIN SMALL LETTER B
0061 A69F 0315 0300 05AE 0062;0061 05AE A69F 0300 0315 0062;0061 05AE A69F 0300 0315 0062;0061 05AE A69F 0300 0315 0062;0061 05AE A69F 0300 0315 0062; # (a◌ꚟ◌̕◌̀◌֮b; a◌֮◌ꚟ◌̀◌̕b; a◌֮◌ꚟ◌̀◌̕b; a◌֮◌ꚟ◌̀◌̕b; a◌֮◌ꚟ◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC LETTER IOTIFIED E, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE A6F0 0062;00E0 05AE A6F0 0315 0062;0061 05AE 0300 A6F0 0315 0062;00E0 05AE A6F0 0315 0062;0061 05AE 0300 A6F0 0315 0062; # (a◌̕◌̀◌֮◌꛰b; à◌֮◌꛰◌̕b; a◌֮◌̀◌꛰◌̕b; à◌֮◌꛰◌̕b; a◌֮◌̀◌꛰◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, BAMUM COMBINING MARK KOQNDON, LATIN SMALL LETTER B
@@ -18245,6 +18249,10 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 FE2C 059A 0316 302A 0062;0061 302A FE2C 0316 059A 0062;0061 302A FE2C 0316 059A 0062;0061 302A FE2C 0316 059A 0062;0061 302A FE2C 0316 059A 0062; # (a◌︬◌֚◌̖◌〪b; a◌〪◌︬◌̖◌֚b; a◌〪◌︬◌̖◌֚b; a◌〪◌︬◌̖◌֚b; a◌〪◌︬◌̖◌֚b; ) LATIN SMALL LETTER A, COMBINING MACRON RIGHT HALF BELOW, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 059A 0316 302A FE2D 0062;0061 302A 0316 FE2D 059A 0062;0061 302A 0316 FE2D 059A 0062;0061 302A 0316 FE2D 059A 0062;0061 302A 0316 FE2D 059A 0062; # (a◌֚◌̖◌〪◌︭b; a◌〪◌̖◌︭◌֚b; a◌〪◌̖◌︭◌֚b; a◌〪◌̖◌︭◌֚b; a◌〪◌̖◌︭◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, COMBINING CONJOINING MACRON BELOW, LATIN SMALL LETTER B
0061 FE2D 059A 0316 302A 0062;0061 302A FE2D 0316 059A 0062;0061 302A FE2D 0316 059A 0062;0061 302A FE2D 0316 059A 0062;0061 302A FE2D 0316 059A 0062; # (a◌︭◌֚◌̖◌〪b; a◌〪◌︭◌̖◌֚b; a◌〪◌︭◌̖◌֚b; a◌〪◌︭◌̖◌֚b; a◌〪◌︭◌̖◌֚b; ) LATIN SMALL LETTER A, COMBINING CONJOINING MACRON BELOW, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
+0061 0315 0300 05AE FE2E 0062;00E0 05AE FE2E 0315 0062;0061 05AE 0300 FE2E 0315 0062;00E0 05AE FE2E 0315 0062;0061 05AE 0300 FE2E 0315 0062; # (a◌̕◌̀◌֮◌︮b; à◌֮◌︮◌̕b; a◌֮◌̀◌︮◌̕b; à◌֮◌︮◌̕b; a◌֮◌̀◌︮◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC TITLO LEFT HALF, LATIN SMALL LETTER B
+0061 FE2E 0315 0300 05AE 0062;0061 05AE FE2E 0300 0315 0062;0061 05AE FE2E 0300 0315 0062;0061 05AE FE2E 0300 0315 0062;0061 05AE FE2E 0300 0315 0062; # (a◌︮◌̕◌̀◌֮b; a◌֮◌︮◌̀◌̕b; a◌֮◌︮◌̀◌̕b; a◌֮◌︮◌̀◌̕b; a◌֮◌︮◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC TITLO LEFT HALF, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
+0061 0315 0300 05AE FE2F 0062;00E0 05AE FE2F 0315 0062;0061 05AE 0300 FE2F 0315 0062;00E0 05AE FE2F 0315 0062;0061 05AE 0300 FE2F 0315 0062; # (a◌̕◌̀◌֮◌︯b; à◌֮◌︯◌̕b; a◌֮◌̀◌︯◌̕b; à◌֮◌︯◌̕b; a◌֮◌̀◌︯◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC TITLO RIGHT HALF, LATIN SMALL LETTER B
+0061 FE2F 0315 0300 05AE 0062;0061 05AE FE2F 0300 0315 0062;0061 05AE FE2F 0300 0315 0062;0061 05AE FE2F 0300 0315 0062;0061 05AE FE2F 0300 0315 0062; # (a◌︯◌̕◌̀◌֮b; a◌֮◌︯◌̀◌̕b; a◌֮◌︯◌̀◌̕b; a◌֮◌︯◌̀◌̕b; a◌֮◌︯◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC TITLO RIGHT HALF, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 059A 0316 302A 101FD 0062;0061 302A 0316 101FD 059A 0062;0061 302A 0316 101FD 059A 0062;0061 302A 0316 101FD 059A 0062;0061 302A 0316 101FD 059A 0062; # (a◌֚◌̖◌〪◌𐇽b; a◌〪◌̖◌𐇽◌֚b; a◌〪◌̖◌𐇽◌֚b; a◌〪◌̖◌𐇽◌֚b; a◌〪◌̖◌𐇽◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE, LATIN SMALL LETTER B
0061 101FD 059A 0316 302A 0062;0061 302A 101FD 0316 059A 0062;0061 302A 101FD 0316 059A 0062;0061 302A 101FD 0316 059A 0062;0061 302A 101FD 0316 059A 0062; # (a◌𐇽◌֚◌̖◌〪b; a◌〪◌𐇽◌̖◌֚b; a◌〪◌𐇽◌̖◌֚b; a◌〪◌𐇽◌̖◌֚b; a◌〪◌𐇽◌̖◌֚b; ) LATIN SMALL LETTER A, PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 059A 0316 302A 102E0 0062;0061 302A 0316 102E0 059A 0062;0061 302A 0316 102E0 059A 0062;0061 302A 0316 102E0 059A 0062;0061 302A 0316 102E0 059A 0062; # (a◌֚◌̖◌〪◌𐋠b; a◌〪◌̖◌𐋠◌֚b; a◌〪◌̖◌𐋠◌֚b; a◌〪◌̖◌𐋠◌֚b; a◌〪◌̖◌𐋠◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, COPTIC EPACT THOUSANDS MARK, LATIN SMALL LETTER B
@@ -18297,6 +18305,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 11173 3099 093C 0334 0062;0061 0334 11173 093C 3099 0062;0061 0334 11173 093C 3099 0062;0061 0334 11173 093C 3099 0062;0061 0334 11173 093C 3099 0062; # (a◌𑅳◌゙◌़◌̴b; a◌̴◌𑅳◌़◌゙b; a◌̴◌𑅳◌़◌゙b; a◌̴◌𑅳◌़◌゙b; a◌̴◌𑅳◌़◌゙b; ) LATIN SMALL LETTER A, MAHAJANI SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
0061 05B0 094D 3099 111C0 0062;0061 3099 094D 111C0 05B0 0062;0061 3099 094D 111C0 05B0 0062;0061 3099 094D 111C0 05B0 0062;0061 3099 094D 111C0 05B0 0062; # (a◌ְ◌्◌゙𑇀b; a◌゙◌्𑇀◌ְb; a◌゙◌्𑇀◌ְb; a◌゙◌्𑇀◌ְb; a◌゙◌्𑇀◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, SHARADA SIGN VIRAMA, LATIN SMALL LETTER B
0061 111C0 05B0 094D 3099 0062;0061 3099 111C0 094D 05B0 0062;0061 3099 111C0 094D 05B0 0062;0061 3099 111C0 094D 05B0 0062;0061 3099 111C0 094D 05B0 0062; # (a𑇀◌ְ◌्◌゙b; a◌゙𑇀◌्◌ְb; a◌゙𑇀◌्◌ְb; a◌゙𑇀◌्◌ְb; a◌゙𑇀◌्◌ְb; ) LATIN SMALL LETTER A, SHARADA SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
+0061 3099 093C 0334 111CA 0062;0061 0334 093C 111CA 3099 0062;0061 0334 093C 111CA 3099 0062;0061 0334 093C 111CA 3099 0062;0061 0334 093C 111CA 3099 0062; # (a◌゙◌़◌̴◌𑇊b; a◌̴◌़◌𑇊◌゙b; a◌̴◌़◌𑇊◌゙b; a◌̴◌़◌𑇊◌゙b; a◌̴◌़◌𑇊◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, SHARADA SIGN NUKTA, LATIN SMALL LETTER B
+0061 111CA 3099 093C 0334 0062;0061 0334 111CA 093C 3099 0062;0061 0334 111CA 093C 3099 0062;0061 0334 111CA 093C 3099 0062;0061 0334 111CA 093C 3099 0062; # (a◌𑇊◌゙◌़◌̴b; a◌̴◌𑇊◌़◌゙b; a◌̴◌𑇊◌़◌゙b; a◌̴◌𑇊◌़◌゙b; a◌̴◌𑇊◌़◌゙b; ) LATIN SMALL LETTER A, SHARADA SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
0061 05B0 094D 3099 11235 0062;0061 3099 094D 11235 05B0 0062;0061 3099 094D 11235 05B0 0062;0061 3099 094D 11235 05B0 0062;0061 3099 094D 11235 05B0 0062; # (a◌ְ◌्◌゙𑈵b; a◌゙◌्𑈵◌ְb; a◌゙◌्𑈵◌ְb; a◌゙◌्𑈵◌ְb; a◌゙◌्𑈵◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, KHOJKI SIGN VIRAMA, LATIN SMALL LETTER B
0061 11235 05B0 094D 3099 0062;0061 3099 11235 094D 05B0 0062;0061 3099 11235 094D 05B0 0062;0061 3099 11235 094D 05B0 0062;0061 3099 11235 094D 05B0 0062; # (a𑈵◌ְ◌्◌゙b; a◌゙𑈵◌्◌ְb; a◌゙𑈵◌्◌ְb; a◌゙𑈵◌्◌ְb; a◌゙𑈵◌्◌ְb; ) LATIN SMALL LETTER A, KHOJKI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
0061 3099 093C 0334 11236 0062;0061 0334 093C 11236 3099 0062;0061 0334 093C 11236 3099 0062;0061 0334 093C 11236 3099 0062;0061 0334 093C 11236 3099 0062; # (a◌゙◌़◌̴◌𑈶b; a◌̴◌़◌𑈶◌゙b; a◌̴◌़◌𑈶◌゙b; a◌̴◌़◌𑈶◌゙b; a◌̴◌़◌𑈶◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, KHOJKI SIGN NUKTA, LATIN SMALL LETTER B
@@ -18347,6 +18357,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 116B6 05B0 094D 3099 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062; # (a𑚶◌ְ◌्◌゙b; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; ) LATIN SMALL LETTER A, TAKRI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
0061 3099 093C 0334 116B7 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062; # (a◌゙◌़◌̴◌𑚷b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, TAKRI SIGN NUKTA, LATIN SMALL LETTER B
0061 116B7 3099 093C 0334 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062; # (a◌𑚷◌゙◌़◌̴b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; ) LATIN SMALL LETTER A, TAKRI SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
+0061 05B0 094D 3099 1172B 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062; # (a◌ְ◌्◌゙◌𑜫b; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, AHOM SIGN KILLER, LATIN SMALL LETTER B
+0061 1172B 05B0 094D 3099 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062; # (a◌𑜫◌ְ◌्◌゙b; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; ) LATIN SMALL LETTER A, AHOM SIGN KILLER, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
0061 093C 0334 16AF0 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062; # (a◌़◌̴◌𖫰b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING HIGH TONE, LATIN SMALL LETTER B
0061 16AF0 093C 0334 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062; # (a◌𖫰◌़◌̴b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING HIGH TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
0061 093C 0334 16AF1 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062; # (a◌़◌̴◌𖫱b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING LOW TONE, LATIN SMALL LETTER B
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index f80d6e6d93..22fbce9f8e 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -594,6 +594,10 @@ void tst_QChar::unicodeVersion()
QVERIFY(QChar::unicodeVersion(0x20bd) == QChar::Unicode_7_0);
QVERIFY(QChar::unicodeVersion(0x16b00) == QChar::Unicode_7_0);
+ QVERIFY(QChar(0x08b3).unicodeVersion() == QChar::Unicode_8_0);
+ QVERIFY(QChar::unicodeVersion(0x08b3) == QChar::Unicode_8_0);
+ QVERIFY(QChar::unicodeVersion(0x108e0) == QChar::Unicode_8_0);
+
QVERIFY(QChar(0x09ff).unicodeVersion() == QChar::Unicode_Unassigned);
QVERIFY(QChar::unicodeVersion(0x09ff) == QChar::Unicode_Unassigned);
QVERIFY(QChar::unicodeVersion(0x110000) == QChar::Unicode_Unassigned);
diff --git a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
index 7b1b7ce963..6e09ebb09b 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
@@ -73,6 +73,12 @@ int main(int argc, char *argv[])
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
parser.addOption(newlineOption);
+ // A hidden option
+ QCommandLineOption hiddenOption(QStringList() << QStringLiteral("hidden"));
+ hiddenOption.setDescription(QStringLiteral("THIS SHOULD NEVER APPEAR"));
+ hiddenOption.setHidden(true);
+ parser.addOption(hiddenOption);
+
// This program supports different options depending on the "command" (first argument).
// Call parse() to find out the positional arguments.
parser.parse(QCoreApplication::arguments());
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index 6ff46ed20b..fb0b971602 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -35,6 +35,7 @@
#include <QtCore/QCommandLineParser>
Q_DECLARE_METATYPE(char**)
+Q_DECLARE_METATYPE(QCommandLineParser::OptionsAfterPositionalArgumentsMode)
class tst_QCommandLineParser : public QObject
{
@@ -51,6 +52,8 @@ private slots:
void testPositionalArguments();
void testBooleanOption_data();
void testBooleanOption();
+ void testOptionsAndPositional_data();
+ void testOptionsAndPositional();
void testMultipleNames_data();
void testMultipleNames();
void testSingleValueOption_data();
@@ -130,7 +133,7 @@ void tst_QCommandLineParser::testBooleanOption()
QFETCH(bool, expectedIsSet);
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
- QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("b"), QStringLiteral("a boolean option"))));
+ QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("b"))));
QVERIFY(parser.parse(args));
QCOMPARE(parser.optionNames(), expectedOptionNames);
QCOMPARE(parser.isSet("b"), expectedIsSet);
@@ -141,6 +144,40 @@ void tst_QCommandLineParser::testBooleanOption()
QVERIFY(!parser.isSet("c"));
}
+void tst_QCommandLineParser::testOptionsAndPositional_data()
+{
+ QTest::addColumn<QStringList>("args");
+ QTest::addColumn<QStringList>("expectedOptionNames");
+ QTest::addColumn<bool>("expectedIsSet");
+ QTest::addColumn<QStringList>("expectedPositionalArguments");
+ QTest::addColumn<QCommandLineParser::OptionsAfterPositionalArgumentsMode>("parsingMode");
+
+ const QStringList arg = QStringList() << "arg";
+ QTest::newRow("before_positional_default") << (QStringList() << "tst_qcommandlineparser" << "-b" << "arg") << (QStringList() << "b") << true << arg << QCommandLineParser::ParseAsOptions;
+ QTest::newRow("after_positional_default") << (QStringList() << "tst_qcommandlineparser" << "arg" << "-b") << (QStringList() << "b") << true << arg << QCommandLineParser::ParseAsOptions;
+ QTest::newRow("before_positional_parseAsArg") << (QStringList() << "tst_qcommandlineparser" << "-b" << "arg") << (QStringList() << "b") << true << arg << QCommandLineParser::ParseAsPositionalArguments;
+ QTest::newRow("after_positional_parseAsArg") << (QStringList() << "tst_qcommandlineparser" << "arg" << "-b") << (QStringList()) << false << (QStringList() << "arg" << "-b") << QCommandLineParser::ParseAsPositionalArguments;
+}
+
+void tst_QCommandLineParser::testOptionsAndPositional()
+{
+ QFETCH(QStringList, args);
+ QFETCH(QStringList, expectedOptionNames);
+ QFETCH(bool, expectedIsSet);
+ QFETCH(QStringList, expectedPositionalArguments);
+ QFETCH(QCommandLineParser::OptionsAfterPositionalArgumentsMode, parsingMode);
+
+ QCoreApplication app(empty_argc, empty_argv);
+ QCommandLineParser parser;
+ parser.setOptionsAfterPositionalArgumentsMode(parsingMode);
+ QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("b"), QStringLiteral("a boolean option"))));
+ QVERIFY(parser.parse(args));
+ QCOMPARE(parser.optionNames(), expectedOptionNames);
+ QCOMPARE(parser.isSet("b"), expectedIsSet);
+ QCOMPARE(parser.values("b"), QStringList());
+ QCOMPARE(parser.positionalArguments(), expectedPositionalArguments);
+}
+
void tst_QCommandLineParser::testMultipleNames_data()
{
QTest::addColumn<QStringList>("args");
diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
index e515fcf5b9..937a490da2 100644
--- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp
+++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
@@ -392,16 +392,37 @@ void tst_QDate::weekNumber_data()
QTest::addColumn<int>("month");
QTest::addColumn<int>("day");
- //next we fill it with data
- QTest::newRow( "data0" ) << 10 << 2002 << 2002 << 3 << 8;
- QTest::newRow( "data1" ) << 10 << 2002 << 2002 << 3 << 8;
- QTest::newRow( "data2" ) << 52 << 1999 << 2000 << 1 << 1;
- QTest::newRow( "data3" ) << 52 << 1999 << 1999 << 12 << 31;
- QTest::newRow( "data4" ) << 1 << 2001 << 2001 << 1 << 1;
- QTest::newRow( "data5" ) << 53 << 1998 << 1998 << 12 << 31;
- QTest::newRow( "data6" ) << 1 << 1985 << 1984 << 12 << 31;
- QTest::newRow( "data7" ) << 52 << 2006 << 2006 << 12 << 31;
- QTest::newRow( "data8" ) << 53 << 2004 << 2005 << 1 << 1;
+ enum { Thursday = 4 };
+ bool wasLastYearLong = false; // 1999 was not a long (53-week) year
+ bool isLongYear;
+
+ // full 400-year cycle for Jan 1, 4 and Dec 28, 31
+ for (int yr = 2000; yr < 2400; ++yr, wasLastYearLong = isLongYear) {
+ QByteArray yrstr = QByteArray::number(yr);
+ int wday = QDate(yr, 1, 1).dayOfWeek();
+
+ // the year is 53-week long if Jan 1 is Thursday or, if it's a leap year, a Wednesday
+ isLongYear = (wday == Thursday) || (QDate::isLeapYear(yr) && wday == Thursday - 1);
+
+ // Jan 4 is always on week 1
+ QTest::newRow(yrstr + "-01-04") << 1 << yr << yr << 1 << 4;
+
+ // Dec 28 is always on the last week
+ QTest::newRow(yrstr + "-12-28") << (52 + isLongYear) << yr << yr << 12 << 28;
+
+ // Jan 1 is on either on week 1 or on the last week of the previous year
+ QTest::newRow(yrstr + "-01-01")
+ << (wday <= Thursday ? 1 : 52 + wasLastYearLong)
+ << (wday <= Thursday ? yr : yr - 1)
+ << yr << 1 << 1;
+
+ // Dec 31 is either on the last week or week 1 of the next year
+ wday = QDate(yr, 12, 31).dayOfWeek();
+ QTest::newRow(yrstr + "-12-31")
+ << (wday >= Thursday ? 52 + isLongYear : 1)
+ << (wday >= Thursday ? yr : yr + 1)
+ << yr << 12 << 31;
+ }
}
void tst_QDate::weekNumber()
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index df9089057d..228ce73c6b 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -68,7 +68,10 @@ private slots:
void timeSpec();
void toTime_t_data();
void toTime_t();
+ void daylightSavingsTimeChange_data();
void daylightSavingsTimeChange();
+ void springForward_data();
+ void springForward();
void setDate();
void setTime_data();
void setTime();
@@ -188,10 +191,10 @@ tst_QDateTime::tst_QDateTime()
void tst_QDateTime::initTestCase()
{
// Never construct a message like this in an i18n context...
- const char *typemsg1, *typemsg2 = "and therefore not";
+ const char *typemsg1 = "exactly";
+ const char *typemsg2 = "and therefore not";
switch (localTimeType) {
case LocalTimeIsUtc:
- typemsg1 = "exactly";
break;
case LocalTimeBehindUtc:
typemsg1 = "behind";
@@ -1561,36 +1564,87 @@ void tst_QDateTime::toTime_t()
}
}
+void tst_QDateTime::daylightSavingsTimeChange_data()
+{
+ QTest::addColumn<QDate>("inDST");
+ QTest::addColumn<QDate>("outDST");
+ QTest::newRow("Autumn") << QDate(2006, 8, 1) << QDate(2006, 12, 1);
+ QTest::newRow("Spring") << QDate(2006, 5, 1) << QDate(2006, 2, 1);
+}
+
void tst_QDateTime::daylightSavingsTimeChange()
{
- // This is a regression test for an old bug where starting with a date in
- // DST and then moving to a date outside it (or vice-versa) caused 1-hour
- // jumps in time when addSecs() was called.
+ // This has grown from a regression test for an old bug where starting with
+ // a date in DST and then moving to a date outside it (or vice-versa) caused
+ // 1-hour jumps in time when addSecs() was called.
//
// The bug was caused by QDateTime knowing more than it lets show.
// Internally, if it knows, QDateTime stores a flag indicating if the time is
// DST or not. If it doesn't, it sets to "LocalUnknown". The problem happened
// because some functions did not reset the flag when moving in or out of DST.
- // WARNING: This test only works if there's a Daylight Savings Time change
- // in the current locale between 2006-11-06 and 2006-10-16
- // This is true for Central European Time
+ // WARNING: This only tests anything if there's a Daylight Savings Time change
+ // in the current locale between inDST and outDST.
+ // This is true for Central European Time and may be elsewhere.
+
+ QFETCH(QDate, inDST);
+ QFETCH(QDate, outDST);
- if (!europeanTimeZone)
- QSKIP("Not tested with timezone other than Central European (CET/CEST)");
+ // First with simple construction
+ QDateTime dt = QDateTime(outDST, QTime(0, 0, 0), Qt::LocalTime);
+ int outDSTsecs = dt.toTime_t();
- QDateTime dt = QDateTime(QDate(2006, 11, 6), QTime(0, 0, 0), Qt::LocalTime);
- dt.setDate(QDate(2006, 10, 16));
+ dt.setDate(inDST);
dt = dt.addSecs(1);
- QCOMPARE(dt.date(), QDate(2006, 10, 16));
- QCOMPARE(dt.time(), QTime(0, 0, 1));
+ QCOMPARE(dt, QDateTime(inDST, QTime(0, 0, 1)));
// now using fromTime_t
- dt = QDateTime::fromTime_t(1162767600); // 2006-11-06 00:00:00 +0100
- dt.setDate(QDate(2006, 10, 16));
- dt = dt.addSecs (1);
- QCOMPARE(dt.date(), QDate(2006, 10, 16));
- QCOMPARE(dt.time(), QTime(0, 0, 1));
+ dt = QDateTime::fromTime_t(outDSTsecs);
+ QCOMPARE(dt, QDateTime(outDST, QTime(0, 0, 0)));
+
+ dt.setDate(inDST);
+ dt = dt.addSecs(60);
+ QCOMPARE(dt, QDateTime(inDST, QTime(0, 1, 0)));
+}
+
+void tst_QDateTime::springForward_data()
+{
+ QTest::addColumn<QDate>("day"); // day of DST transition
+ QTest::addColumn<QTime>("time"); // in the "missing hour"
+ QTest::addColumn<int>("step"); // days to step; +ve from before, -ve from after
+ QTest::addColumn<int>("adjust"); // minutes ahead of UTC on day stepped from
+
+ if (europeanTimeZone) {
+ QTest::newRow("Europe from day before") << QDate(2015, 3, 29) << QTime(2, 30, 0) << 1 << 60;
+ QTest::newRow("Europe from day after") << QDate(2015, 3, 29) << QTime(2, 30, 0) << -1 << 120;
+ // } else if (otherZone) {
+ } else {
+ QSKIP("No spring forward test data for this TZ");
+ }
+}
+
+void tst_QDateTime::springForward()
+{
+ QFETCH(QDate, day);
+ QFETCH(QTime, time);
+ QFETCH(int, step);
+ QFETCH(int, adjust);
+
+ QDateTime direct = QDateTime(day.addDays(-step), time, Qt::LocalTime).addDays(step);
+ QCOMPARE(direct.date(), day);
+ QCOMPARE(direct.time().minute(), time.minute());
+ QCOMPARE(direct.time().second(), time.second());
+ int off = direct.time().hour() - time.hour();
+ QVERIFY(off == 1 || off == -1);
+ // Note: function doc claims always +1, but this should be reviewed !
+
+ // Repeat, but getting there via .toLocalTime():
+ QDateTime detour = QDateTime(day.addDays(-step),
+ time.addSecs(-60 * adjust),
+ Qt::UTC).toLocalTime();
+ QCOMPARE(detour.time(), time);
+ detour = detour.addDays(step);
+ QCOMPARE(detour, direct); // Insist on consistency.
}
void tst_QDateTime::operator_eqeq_data()
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
index 6bdaa94e49..0ad9a8253b 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
@@ -56,19 +56,17 @@ void tst_QDateTime_macTypes()
}
// QDateTime <-> NSDate
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QDateTime qtDateTime = QDateTime::fromMSecsSinceEpoch(0);
const NSDate *nsDate = qtDateTime.toNSDate();
QCOMPARE(QDateTime::fromNSDate(nsDate), qtDateTime);
- [autoreleasepool release];
}
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QDateTime qtDateTime = QDateTime::fromMSecsSinceEpoch(0);
const NSDate *nsDate = qtDateTime.toNSDate();
QDateTime qtDateTimeCopy(qtDateTime);
qtDateTime.setTime_t(10000); // modify
QCOMPARE(QDateTime::fromNSDate(nsDate), qtDateTimeCopy);
- [autoreleasepool release];
}
}
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 6ea33fb37f..6a5c6b5670 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -62,6 +62,7 @@ private slots:
void compare();
void compare2();
void iterators(); // sligthly modified from tst_QMap
+ void keyIterator();
void keys_values_uniqueKeys(); // slightly modified from tst_QMap
void noNeedlessRehashes();
@@ -965,6 +966,34 @@ void tst_QHash::iterators()
}
}
+void tst_QHash::keyIterator()
+{
+ QHash<int, int> hash;
+
+ for (int i = 0; i < 100; ++i)
+ hash.insert(i, i*100);
+
+ QHash<int, int>::key_iterator key_it = hash.keyBegin();
+ QHash<int, int>::const_iterator it = hash.cbegin();
+ for (int i = 0; i < 100; ++i) {
+ QCOMPARE(*key_it, it.key());
+ key_it++;
+ it++;
+ }
+
+ key_it = std::find(hash.keyBegin(), hash.keyEnd(), 50);
+ it = std::find(hash.cbegin(), hash.cend(), 50 * 100);
+
+ QVERIFY(key_it != hash.keyEnd());
+ QCOMPARE(*key_it, it.key());
+ QCOMPARE(*(key_it++), (it++).key());
+ QCOMPARE(*(key_it--), (it--).key());
+ QCOMPARE(*(++key_it), (++it).key());
+ QCOMPARE(*(--key_it), (--it).key());
+
+ QCOMPARE(std::count(hash.keyBegin(), hash.keyEnd(), 99), 1);
+}
+
void tst_QHash::rehash_isnt_quadratic()
{
// this test should be incredibly slow if rehash() is quadratic
diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
index 6961426f59..bde9433a24 100644
--- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
+++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
@@ -50,6 +50,8 @@ private Q_SLOTS:
void qthash();
void range();
void rangeCommutative();
+
+ void setGlobalQHashSeed();
};
void tst_QHashFunctions::qhash()
@@ -207,5 +209,21 @@ void tst_QHashFunctions::rangeCommutative()
(void)qHashRangeCommutative(hashables, hashables + numHashables);
}
+void tst_QHashFunctions::setGlobalQHashSeed()
+{
+ // Setter works as advertised
+ qSetGlobalQHashSeed(0x10101010);
+ QCOMPARE(qGlobalQHashSeed(), 0x10101010);
+
+ // Creating a new QHash doesn't reset the seed
+ QHash<QString, int> someHash;
+ someHash.insert("foo", 42);
+ QCOMPARE(qGlobalQHashSeed(), 0x10101010);
+
+ // Reset works as advertised
+ qSetGlobalQHashSeed(-1);
+ QVERIFY(qGlobalQHashSeed() != -1);
+}
+
QTEST_APPLESS_MAIN(tst_QHashFunctions)
#include "tst_qhashfunctions.moc"
diff --git a/tests/auto/corelib/tools/qlatin1string/.gitignore b/tests/auto/corelib/tools/qlatin1string/.gitignore
new file mode 100644
index 0000000000..dddf56b2df
--- /dev/null
+++ b/tests/auto/corelib/tools/qlatin1string/.gitignore
@@ -0,0 +1 @@
+tst_qlatin1string
diff --git a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
new file mode 100644
index 0000000000..a996dab23e
--- /dev/null
+++ b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
@@ -0,0 +1,9 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qlatin1string
+QT = core testlib
+SOURCES = tst_qlatin1string.cpp
+DEFINES += QT_NO_CAST_TO_ASCII
+contains(QT_CONFIG,c++11): CONFIG += c++11
+contains(QT_CONFIG,c++14): CONFIG += c++14
+
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
new file mode 100644
index 0000000000..290c9fc12a
--- /dev/null
+++ b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 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 test suite 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 <QtTest/QtTest>
+
+#include <QString>
+
+class tst_QLatin1String : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void nullString();
+ void emptyString();
+};
+
+void tst_QLatin1String::nullString()
+{
+ // default ctor
+ {
+ QLatin1String l1;
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isNull());
+ }
+
+ // from nullptr
+ {
+ const char *null = Q_NULLPTR;
+ QLatin1String l1(null);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isNull());
+ }
+
+ // from null QByteArray
+ {
+ const QByteArray null;
+ QVERIFY(null.isNull());
+
+ QLatin1String l1(null);
+ QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings...", Continue);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings become non-null QStrings...", Continue);
+ QVERIFY(s.isNull());
+ }
+}
+
+void tst_QLatin1String::emptyString()
+{
+ {
+ const char *empty = "";
+ QLatin1String l1(empty);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(empty));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isEmpty());
+ QVERIFY(!s.isNull());
+ }
+
+ {
+ const char *notEmpty = "foo";
+ QLatin1String l1(notEmpty, 0);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(notEmpty));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isEmpty());
+ QVERIFY(!s.isNull());
+ }
+
+ {
+ const QByteArray empty = "";
+ QLatin1String l1(empty);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(empty.constData()));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isEmpty());
+ QVERIFY(!s.isNull());
+ }
+}
+
+
+
+QTEST_APPLESS_MAIN(tst_QLatin1String)
+
+#include "tst_qlatin1string.moc"
diff --git a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
index 82303b4f72..d3ace40164 100644
--- a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
+++ b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
@@ -204,6 +204,7 @@ private slots:
void removeOneInt() const;
void removeOneMovable() const;
void removeOneComplex() const;
+ void reverseIterators() const;
void startsWithInt() const;
void startsWithMovable() const;
void startsWithComplex() const;
@@ -527,12 +528,12 @@ void tst_QLinkedList::contains() const
QLinkedList<T> list;
list << T_FOO << T_BAR << T_BAZ;
- QVERIFY(list.contains(T_FOO) == true);
+ QVERIFY(list.contains(T_FOO));
QVERIFY(list.contains(T_BLAH) != true);
// add it and make sure it matches
list.append(T_BLAH);
- QVERIFY(list.contains(T_BLAH) == true);
+ QVERIFY(list.contains(T_BLAH));
}
void tst_QLinkedList::containsInt() const
@@ -754,6 +755,21 @@ void tst_QLinkedList::removeOneComplex() const
QCOMPARE(liveCount, Complex::getLiveCount());
}
+void tst_QLinkedList::reverseIterators() const
+{
+ QLinkedList<int> l;
+ l << 1 << 2 << 3 << 4;
+ QLinkedList<int> lr = l;
+ std::reverse(lr.begin(), lr.end());
+ const QLinkedList<int> &clr = lr;
+ QVERIFY(std::equal(l.begin(), l.end(), lr.rbegin()));
+ QVERIFY(std::equal(l.begin(), l.end(), lr.crbegin()));
+ QVERIFY(std::equal(l.begin(), l.end(), clr.rbegin()));
+ QVERIFY(std::equal(lr.rbegin(), lr.rend(), l.begin()));
+ QVERIFY(std::equal(lr.crbegin(), lr.crend(), l.begin()));
+ QVERIFY(std::equal(clr.rbegin(), clr.rend(), l.begin()));
+}
+
template<typename T>
void tst_QLinkedList::startsWith() const
{
diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
index 1207986dde..1bb31afa9c 100644
--- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp
+++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
@@ -76,6 +76,13 @@ struct Movable {
return i == other.i;
}
+ bool operator<(const Movable &other) const
+ {
+ check(state, Constructed);
+ check(other.state, Constructed);
+ return i < other.i;
+ }
+
Movable &operator=(const Movable &other)
{
check(state, Constructed);
@@ -144,6 +151,13 @@ struct Optimal
return i == other.i;
}
+ bool operator<(const Optimal &other) const
+ {
+ check(state, Constructed);
+ check(other.state, Constructed);
+ return i < other.i;
+ }
+
Optimal &operator=(const Optimal &other)
{
check(state, Constructed);
@@ -220,6 +234,12 @@ struct Complex
return value == other.value;
}
+ bool operator<(Complex const &other) const
+ {
+ check(); other.check();
+ return value < other.value;
+ }
+
void check() const
{
QVERIFY(this == checkSum);
@@ -293,6 +313,8 @@ private slots:
void lastOptimal() const;
void lastMovable() const;
void lastComplex() const;
+ void constFirst() const;
+ void constLast() const;
void beginOptimal() const;
void beginMovable() const;
void beginComplex() const;
@@ -329,6 +351,9 @@ private slots:
void replaceOptimal() const;
void replaceMovable() const;
void replaceComplex() const;
+ void reverseIteratorsOptimal() const;
+ void reverseIteratorsMovable() const;
+ void reverseIteratorsComplex() const;
void startsWithOptimal() const;
void startsWithMovable() const;
void startsWithComplex() const;
@@ -376,6 +401,9 @@ private slots:
void eraseValidIteratorsOnSharedList() const;
void insertWithValidIteratorsOnSharedList() const;
+ void qhashOptimal() const { qhash<Optimal>(); }
+ void qhashMovable() const { qhash<Movable>(); }
+ void qhashComplex() const { qhash<Complex>(); }
void reserve() const;
private:
template<typename T> void length() const;
@@ -392,10 +420,12 @@ private:
template<typename T> void endsWith() const;
template<typename T> void lastIndexOf() const;
template<typename T> void move() const;
+ template<typename T> void qhash() const;
template<typename T> void removeAll() const;
template<typename T> void removeAt() const;
template<typename T> void removeOne() const;
template<typename T> void replace() const;
+ template<typename T> void reverseIterators() const;
template<typename T> void startsWith() const;
template<typename T> void swap() const;
template<typename T> void takeAt() const;
@@ -701,6 +731,140 @@ void tst_QList::firstComplex() const
QCOMPARE(liveCount, Complex::getLiveCount());
}
+void tst_QList::constFirst() const
+{
+ // Based on tst_QVector::constFirst()
+ QList<int> list;
+ list << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(list.constFirst(), 69);
+ QVERIFY(list.isDetached());
+
+ QList<int> listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constFirst(), 69);
+ QCOMPARE(listCopy.constFirst(), 69);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test removal changes
+ list.removeAt(0);
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constFirst(), 42);
+ QCOMPARE(listCopy.constFirst(), 69);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constFirst(), 42);
+ QCOMPARE(listCopy.constFirst(), 42);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test prepend changes
+ list.prepend(23);
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constFirst(), 23);
+ QCOMPARE(listCopy.constFirst(), 42);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constFirst(), 23);
+ QCOMPARE(listCopy.constFirst(), 23);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+}
+
+void tst_QList::constLast() const
+{
+ // Based on tst_QVector::constLast()
+ QList<int> list;
+ list << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(list.constLast(), 3);
+ QVERIFY(list.isDetached());
+
+ QList<int> listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constLast(), 3);
+ QCOMPARE(listCopy.constLast(), 3);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test removal changes
+ list.removeLast();
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constLast(), 42);
+ QCOMPARE(listCopy.constLast(), 3);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constLast(), 42);
+ QCOMPARE(listCopy.constLast(), 42);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test prepend changes
+ list.append(23);
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constLast(), 23);
+ QCOMPARE(listCopy.constLast(), 42);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constLast(), 23);
+ QCOMPARE(listCopy.constLast(), 23);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+}
+
template<typename T>
void tst_QList::last() const
{
@@ -812,12 +976,12 @@ void tst_QList::contains() const
QList<T> list;
list << T_FOO << T_BAR << T_BAZ;
- QVERIFY(list.contains(T_FOO) == true);
+ QVERIFY(list.contains(T_FOO));
QVERIFY(list.contains(T_BLAH) != true);
// add it and make sure it matches
list.append(T_BLAH);
- QVERIFY(list.contains(T_BLAH) == true);
+ QVERIFY(list.contains(T_BLAH));
}
void tst_QList::containsOptimal() const
@@ -1220,6 +1384,43 @@ void tst_QList::replaceComplex() const
}
template<typename T>
+void tst_QList::reverseIterators() const
+{
+ QList<T> v;
+ v << T_CAT << T_DOG << T_BLAH << T_BAZ;
+ QList<T> vr = v;
+ std::reverse(vr.begin(), vr.end());
+ const QList<T> &cvr = vr;
+ QVERIFY(std::equal(v.begin(), v.end(), vr.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), vr.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cvr.rbegin()));
+ QVERIFY(std::equal(vr.rbegin(), vr.rend(), v.begin()));
+ QVERIFY(std::equal(vr.crbegin(), vr.crend(), v.begin()));
+ QVERIFY(std::equal(cvr.rbegin(), cvr.rend(), v.begin()));
+}
+
+void tst_QList::reverseIteratorsOptimal() const
+{
+ const int liveCount = Optimal::getLiveCount();
+ reverseIterators<Optimal>();
+ QCOMPARE(liveCount, Optimal::getLiveCount());
+}
+
+void tst_QList::reverseIteratorsMovable() const
+{
+ const int liveCount = Movable::getLiveCount();
+ reverseIterators<Movable>();
+ QCOMPARE(liveCount, Movable::getLiveCount());
+}
+
+void tst_QList::reverseIteratorsComplex() const
+{
+ const int liveCount = Complex::getLiveCount();
+ reverseIterators<Complex>();
+ QCOMPARE(liveCount, Complex::getLiveCount());
+}
+
+template<typename T>
void tst_QList::startsWith() const
{
QList<T> list;
@@ -1576,6 +1777,19 @@ void tst_QList::testOperators() const
// []
QCOMPARE(list[0], T_FOO);
QCOMPARE(list[list.size() - 1], T_CAT);
+
+ // <, >, <=, >=
+ QVERIFY(!(list < listtwo));
+ QVERIFY(!(list > listtwo));
+ QVERIFY( list <= listtwo);
+ QVERIFY( list >= listtwo);
+ listtwo.push_back(T_CAT);
+ QVERIFY( list < listtwo);
+ QVERIFY(!(list > listtwo));
+ QVERIFY( list <= listtwo);
+ QVERIFY(!(list >= listtwo));
+ QVERIFY(listtwo > list);
+ QVERIFY(listtwo >= list);
}
void tst_QList::testOperatorsOptimal() const
@@ -1834,6 +2048,16 @@ void tst_QList::insertWithValidIteratorsOnSharedList() const
QCOMPARE(a.at(1), 15);
}
+template <typename T>
+void tst_QList::qhash() const
+{
+ QList<T> l1, l2;
+ QCOMPARE(qHash(l1), qHash(l2));
+ l1 << T_BAR;
+ l2 << T_BAR;
+ QCOMPARE(qHash(l1), qHash(l2));
+}
+
void tst_QList::reserve() const
{
// Note:
diff --git a/tests/auto/corelib/tools/qlocale/qlocale.pro b/tests/auto/corelib/tools/qlocale/qlocale.pro
index abbe31d1ef..5161200260 100644
--- a/tests/auto/corelib/tools/qlocale/qlocale.pro
+++ b/tests/auto/corelib/tools/qlocale/qlocale.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS += test \
- syslocaleapp
+SUBDIRS += test
+!winrt: SUBDIRS+=syslocaleapp
diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro
index df12d35a09..60afb29233 100644
--- a/tests/auto/corelib/tools/qlocale/test/test.pro
+++ b/tests/auto/corelib/tools/qlocale/test/test.pro
@@ -14,7 +14,7 @@ win32 {
}
}
-TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp
+!winrt: TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
blackberry:LIBS += -lpps
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index b1e13a0384..5f046575c4 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -371,6 +371,8 @@ void tst_QLocale::ctor()
QString("requested: \"" + QString(req_lc) + "\", got: " \
+ QLocale::languageToString(l.language()) \
+ "/" + QLocale::countryToString(l.country())).toLatin1().constData()); \
+ QCOMPARE(l, QLocale(QLocale::exp_lang, QLocale::exp_country)); \
+ QCOMPARE(qHash(l), qHash(QLocale(QLocale::exp_lang, QLocale::exp_country))); \
}
QLocale::setDefault(QLocale(QLocale::C));
@@ -611,7 +613,8 @@ void tst_QLocale::legacyNames()
TEST_CTOR("no", Norwegian, Norway)
TEST_CTOR("sh_ME", Serbian, Montenegro)
TEST_CTOR("tl", Filipino, Philippines)
-
+ TEST_CTOR("iw", Hebrew, Israel)
+ TEST_CTOR("in", Indonesian, Indonesia)
#undef TEST_CTOR
}
@@ -900,6 +903,7 @@ void tst_QLocale::long_long_conversion()
void tst_QLocale::long_long_conversion_extra()
{
QLocale l(QLocale::C);
+ l.setNumberOptions(0);
QCOMPARE(l.toString((qlonglong)1), QString("1"));
QCOMPARE(l.toString((qlonglong)12), QString("12"));
QCOMPARE(l.toString((qlonglong)123), QString("123"));
@@ -1611,20 +1615,20 @@ void tst_QLocale::numberOptions()
bool ok;
QLocale locale(QLocale::C);
- QCOMPARE(locale.numberOptions(), 0);
- QCOMPARE(locale.toInt(QString("12,345"), &ok), 12345);
+ QCOMPARE(locale.numberOptions(), QLocale::OmitGroupSeparator);
+ QCOMPARE(locale.toInt(QString("12345"), &ok), 12345);
QVERIFY(ok);
QCOMPARE(locale.toInt(QString("12345"), &ok), 12345);
QVERIFY(ok);
- QCOMPARE(locale.toString(12345), QString("12,345"));
+ QCOMPARE(locale.toString(12345), QString("12345"));
- locale.setNumberOptions(QLocale::OmitGroupSeparator);
- QCOMPARE(locale.numberOptions(), QLocale::OmitGroupSeparator);
+ locale.setNumberOptions(0);
+ QCOMPARE(locale.numberOptions(), 0);
QCOMPARE(locale.toInt(QString("12,345"), &ok), 12345);
QVERIFY(ok);
QCOMPARE(locale.toInt(QString("12345"), &ok), 12345);
QVERIFY(ok);
- QCOMPARE(locale.toString(12345), QString("12345"));
+ QCOMPARE(locale.toString(12345), QString("12,345"));
locale.setNumberOptions(QLocale::RejectGroupSeparator);
QCOMPARE(locale.numberOptions(), QLocale::RejectGroupSeparator);
@@ -2031,10 +2035,10 @@ void tst_QLocale::standaloneMonthName()
void tst_QLocale::currency()
{
const QLocale c(QLocale::C);
- QCOMPARE(c.toCurrencyString(qulonglong(1234)), QString("1,234"));
- QCOMPARE(c.toCurrencyString(qlonglong(-1234)), QString("-1,234"));
- QCOMPARE(c.toCurrencyString(double(1234.56)), QString("1,234.56"));
- QCOMPARE(c.toCurrencyString(double(-1234.56)), QString("-1,234.56"));
+ QCOMPARE(c.toCurrencyString(qulonglong(1234)), QString("1234"));
+ QCOMPARE(c.toCurrencyString(qlonglong(-1234)), QString("-1234"));
+ QCOMPARE(c.toCurrencyString(double(1234.56)), QString("1234.56"));
+ QCOMPARE(c.toCurrencyString(double(-1234.56)), QString("-1234.56"));
const QLocale en_US("en_US");
QCOMPARE(en_US.toCurrencyString(qulonglong(1234)), QString("$1,234"));
diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
index 8560a2f18c..bb6535b635 100644
--- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp
+++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
@@ -65,6 +65,7 @@ private slots:
void take();
void iterators();
+ void keyIterator();
void keys_values_uniqueKeys();
void qmultimap_specific();
@@ -835,6 +836,34 @@ void tst_QMap::iterators()
}
}
+void tst_QMap::keyIterator()
+{
+ QMap<int, int> map;
+
+ for (int i = 0; i < 100; ++i)
+ map.insert(i, i*100);
+
+ QMap<int, int>::key_iterator key_it = map.keyBegin();
+ QMap<int, int>::const_iterator it = map.cbegin();
+ for (int i = 0; i < 100; ++i) {
+ QCOMPARE(*key_it, it.key());
+ ++key_it;
+ ++it;
+ }
+
+ key_it = std::find(map.keyBegin(), map.keyEnd(), 50);
+ it = std::find(map.cbegin(), map.cend(), 50 * 100);
+
+ QVERIFY(key_it != map.keyEnd());
+ QCOMPARE(*key_it, it.key());
+ QCOMPARE(*(key_it++), (it++).key());
+ QCOMPARE(*(key_it--), (it--).key());
+ QCOMPARE(*(++key_it), (++it).key());
+ QCOMPARE(*(--key_it), (--it).key());
+
+ QCOMPARE(std::count(map.keyBegin(), map.keyEnd(), 99), 1);
+}
+
void tst_QMap::keys_values_uniqueKeys()
{
QMap<QString, int> map;
@@ -996,11 +1025,16 @@ void tst_QMap::const_shared_null()
void tst_QMap::equal_range()
{
QMap<int, QString> map;
+ const QMap<int, QString> &cmap = map;
QPair<QMap<int, QString>::iterator, QMap<int, QString>::iterator> result = map.equal_range(0);
QCOMPARE(result.first, map.end());
QCOMPARE(result.second, map.end());
+ QPair<QMap<int, QString>::const_iterator, QMap<int, QString>::const_iterator> cresult = cmap.equal_range(0);
+ QCOMPARE(cresult.first, cmap.cend());
+ QCOMPARE(cresult.second, cmap.cend());
+
map.insert(1, "one");
result = map.equal_range(0);
@@ -1015,6 +1049,18 @@ void tst_QMap::equal_range()
QCOMPARE(result.first, map.end());
QCOMPARE(result.second, map.end());
+ cresult = cmap.equal_range(0);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.find(1));
+
+ cresult = cmap.equal_range(1);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.cend());
+
+ cresult = cmap.equal_range(2);
+ QCOMPARE(cresult.first, cmap.cend());
+ QCOMPARE(cresult.second, cmap.cend());
+
for (int i = -10; i < 10; i += 2)
map.insert(i, QString("%1").arg(i));
@@ -1030,11 +1076,28 @@ void tst_QMap::equal_range()
QCOMPARE(result.first, map.find(2));
QCOMPARE(result.second, map.find(4));
+ cresult = cmap.equal_range(0);
+ QCOMPARE(cresult.first, cmap.find(0));
+ QCOMPARE(cresult.second, cmap.find(1));
+
+ cresult = cmap.equal_range(1);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.find(2));
+
+ cresult = cmap.equal_range(2);
+ QCOMPARE(cresult.first, cmap.find(2));
+ QCOMPARE(cresult.second, cmap.find(4));
+
map.insertMulti(1, "another one");
+
result = map.equal_range(1);
QCOMPARE(result.first, map.find(1));
QCOMPARE(result.second, map.find(2));
+ cresult = cmap.equal_range(1);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.find(2));
+
QCOMPARE(map.count(1), 2);
}
diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
index fefdec7496..b9a3fc13c5 100644
--- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
+++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
@@ -1224,6 +1224,9 @@ void tst_QRegExp::operator_eq()
for (int j = 0; j < I * J * K * ELL; ++j) {
QCOMPARE(rxtable[i] == rxtable[j], i / ELL == j / ELL);
QCOMPARE(rxtable[i] != rxtable[j], i / ELL != j / ELL);
+ // this just happens to have no hash collisions. If at some point
+ // we get collisions, restrict the test to only equal elements:
+ QCOMPARE(qHash(rxtable[i]) == qHash(rxtable[j]), i / ELL == j / ELL);
}
}
}
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index d185e64251..8ddd4979b6 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -1423,6 +1423,7 @@ static void verifyEquality(const QRegularExpression &re1, const QRegularExpressi
{
QVERIFY(re1 == re2);
QVERIFY(re2 == re1);
+ QCOMPARE(qHash(re1), qHash(re2));
QVERIFY(!(re1 != re2));
QVERIFY(!(re2 != re1));
@@ -1430,22 +1431,26 @@ static void verifyEquality(const QRegularExpression &re1, const QRegularExpressi
QVERIFY(re1 == re3);
QVERIFY(re3 == re1);
+ QCOMPARE(qHash(re1), qHash(re3));
QVERIFY(!(re1 != re3));
QVERIFY(!(re3 != re1));
QVERIFY(re2 == re3);
QVERIFY(re3 == re2);
+ QCOMPARE(qHash(re2), qHash(re3));
QVERIFY(!(re2 != re3));
QVERIFY(!(re3 != re2));
re3 = re2;
QVERIFY(re1 == re3);
QVERIFY(re3 == re1);
+ QCOMPARE(qHash(re1), qHash(re3));
QVERIFY(!(re1 != re3));
QVERIFY(!(re3 != re1));
QVERIFY(re2 == re3);
QVERIFY(re3 == re2);
+ QCOMPARE(qHash(re2), qHash(re3));
QVERIFY(!(re2 != re3));
QVERIFY(!(re3 != re2));
}
diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
index 8c29064457..77fc6ad6ae 100644
--- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
+++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
@@ -48,10 +48,12 @@ private slots:
void sizeWhenReserved();
void free();
void reserveAndRead();
+ void reserveFrontAndRead();
void chop();
void ungetChar();
void indexOf();
void appendAndRead();
+ void peek();
void readLine();
};
@@ -60,7 +62,7 @@ void tst_QRingBuffer::sizeWhenReserved()
QRingBuffer ringBuffer;
ringBuffer.reserve(5);
- QCOMPARE(ringBuffer.size(), 5);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5));
}
void tst_QRingBuffer::sizeWhenReservedAndChopped()
@@ -69,14 +71,14 @@ void tst_QRingBuffer::sizeWhenReservedAndChopped()
ringBuffer.reserve(31337);
ringBuffer.chop(31337);
- QCOMPARE(ringBuffer.size(), 0);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
void tst_QRingBuffer::sizeWhenEmpty()
{
QRingBuffer ringBuffer;
- QCOMPARE(ringBuffer.size(), 0);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
void tst_QRingBuffer::readPointerAtPositionReadTooMuch()
@@ -86,7 +88,7 @@ void tst_QRingBuffer::readPointerAtPositionReadTooMuch()
qint64 length;
const char *buf = ringBuffer.readPointerAtPosition(42, length);
QVERIFY(buf == 0);
- QVERIFY(length == 0);
+ QCOMPARE(length, Q_INT64_C(0));
}
void tst_QRingBuffer::readPointerAtPositionWithHead()
@@ -101,22 +103,22 @@ void tst_QRingBuffer::readPointerAtPositionWithHead()
qint64 length;
const char* buf2 = ringBuffer.readPointerAtPosition(0, length);
- QCOMPARE(length, qint64(2));
- QVERIFY(*buf2 == '2');
- QVERIFY(*(buf2+1) == '3');
+ QCOMPARE(length, Q_INT64_C(2));
+ QCOMPARE(*buf2, '2');
+ QCOMPARE(*(buf2 + 1), '3');
// advance 2 more, ringBuffer should be empty then
ringBuffer.free(2);
buf2 = ringBuffer.readPointerAtPosition(0, length);
- QCOMPARE(length, qint64(0));
+ QCOMPARE(length, Q_INT64_C(0));
QVERIFY(buf2 == 0);
// check buffer with 2 blocks
memcpy(ringBuffer.reserve(4), "0123", 4);
ringBuffer.append(QByteArray("45678", 5));
ringBuffer.free(3);
- buf2 = ringBuffer.readPointerAtPosition(1, length);
- QCOMPARE(length, qint64(5));
+ buf2 = ringBuffer.readPointerAtPosition(Q_INT64_C(1), length);
+ QCOMPARE(length, Q_INT64_C(5));
}
void tst_QRingBuffer::readPointerAtPositionEmptyRead()
@@ -126,7 +128,7 @@ void tst_QRingBuffer::readPointerAtPositionEmptyRead()
qint64 length;
const char *buf = ringBuffer.readPointerAtPosition(0, length);
QVERIFY(buf == 0);
- QVERIFY(length == 0);
+ QCOMPARE(length, Q_INT64_C(0));
}
void tst_QRingBuffer::readPointerAtPositionWriteRead()
@@ -149,14 +151,14 @@ void tst_QRingBuffer::readPointerAtPositionWriteRead()
// write in chunks of 50 bytes
// this ensures there will be multiple QByteArrays inside the QRingBuffer
// since QRingBuffer is then only using individual arrays of around 4000 bytes
- qint64 thisWrite = qMin(remaining, qint64(50));
+ qint64 thisWrite = qMin(remaining, Q_INT64_C(50));
char *pos = ringBuffer.reserve(thisWrite);
inData.read(pos, thisWrite);
remaining -= thisWrite;
}
// was data put into it?
QVERIFY(ringBuffer.size() > 0);
- QCOMPARE(qint64(ringBuffer.size()), inData.size());
+ QCOMPARE(ringBuffer.size(), inData.size());
//read from the QRingBuffer in loop, put back into another QBuffer
QBuffer outData;
@@ -187,12 +189,12 @@ void tst_QRingBuffer::free()
ringBuffer.append(QByteArray("01234", 5));
ringBuffer.free(1);
- QCOMPARE(ringBuffer.size(), 4095 + 2048 + 5);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4095 + 2048 + 5));
ringBuffer.free(4096);
- QCOMPARE(ringBuffer.size(), 2047 + 5);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(2047 + 5));
ringBuffer.free(48);
ringBuffer.free(2000);
- QCOMPARE(ringBuffer.size(), 4);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4));
QVERIFY(memcmp(ringBuffer.readPointer(), "1234", 4) == 0);
}
@@ -211,11 +213,33 @@ void tst_QRingBuffer::reserveAndRead()
for (int i = 1; i < 256; ++i) {
QByteArray ba;
ba.resize(i);
- int thisRead = ringBuffer.read(ba.data(), i);
- QCOMPARE(thisRead, i);
- QVERIFY(ba.count(char(i)) == i);
+ qint64 thisRead = ringBuffer.read(ba.data(), i);
+ QCOMPARE(thisRead, qint64(i));
+ QCOMPARE(ba.count(char(i)), i);
}
- QVERIFY(ringBuffer.size() == 0);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
+}
+
+void tst_QRingBuffer::reserveFrontAndRead()
+{
+ QRingBuffer ringBuffer;
+ // fill buffer with an arithmetic progression
+ for (int i = 1; i < 256; ++i) {
+ QByteArray ba(i, char(i));
+ char *ringPos = ringBuffer.reserveFront(i);
+ QVERIFY(ringPos);
+ memcpy(ringPos, ba.constData(), i);
+ }
+
+ // readback and check stored data
+ for (int i = 255; i > 0; --i) {
+ QByteArray ba;
+ ba.resize(i);
+ qint64 thisRead = ringBuffer.read(ba.data(), i);
+ QCOMPARE(thisRead, qint64(i));
+ QCOMPARE(ba.count(char(i)), i);
+ }
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
void tst_QRingBuffer::chop()
@@ -227,12 +251,12 @@ void tst_QRingBuffer::chop()
ringBuffer.reserve(4096);
ringBuffer.chop(1);
- QCOMPARE(ringBuffer.size(), 5 + 2048 + 4095);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5 + 2048 + 4095));
ringBuffer.chop(4096);
- QCOMPARE(ringBuffer.size(), 5 + 2047);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5 + 2047));
ringBuffer.chop(48);
ringBuffer.chop(2000);
- QCOMPARE(ringBuffer.size(), 4);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4));
QVERIFY(memcmp(ringBuffer.readPointer(), "0123", 4) == 0);
}
@@ -244,11 +268,11 @@ void tst_QRingBuffer::ungetChar()
for (int i = 1; i < 31; ++i) {
int c = ringBuffer.getChar();
- QVERIFY(c == 1);
+ QCOMPARE(c, 1);
ringBuffer.getChar();
ringBuffer.ungetChar(char(c)); // unget first char
}
- QCOMPARE(ringBuffer.size(), 1);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(1));
}
void tst_QRingBuffer::indexOf()
@@ -258,10 +282,10 @@ void tst_QRingBuffer::indexOf()
ringBuffer.putChar(char(i));
for (int i = 1; i < 256; ++i) {
- int index = ringBuffer.indexOf(char(i));
- QCOMPARE(i - 1, index);
- QCOMPARE(index, ringBuffer.indexOf(char(i), i));
- QVERIFY(ringBuffer.indexOf(char(i), i - 1) == -1); // test for absent char
+ qint64 index = ringBuffer.indexOf(char(i));
+ QCOMPARE(index, qint64(i - 1));
+ QCOMPARE(ringBuffer.indexOf(char(i), i), index);
+ QCOMPARE(ringBuffer.indexOf(char(i), i - 1), -1); // test for absent char
}
}
@@ -275,9 +299,34 @@ void tst_QRingBuffer::appendAndRead()
ringBuffer.append(ba2);
ringBuffer.append(ba3);
- QVERIFY(ringBuffer.read() == ba1);
- QVERIFY(ringBuffer.read() == ba2);
- QVERIFY(ringBuffer.read() == ba3);
+ QCOMPARE(ringBuffer.read(), ba1);
+ QCOMPARE(ringBuffer.read(), ba2);
+ QCOMPARE(ringBuffer.read(), ba3);
+}
+
+void tst_QRingBuffer::peek()
+{
+ QRingBuffer ringBuffer;
+ QByteArray testBuffer;
+ // fill buffer with an arithmetic progression
+ for (int i = 1; i < 256; ++i) {
+ char *ringPos = ringBuffer.reserve(i);
+ QVERIFY(ringPos);
+ memset(ringPos, i, i);
+ testBuffer.append(ringPos, i);
+ }
+
+ // check stored data
+ QByteArray resultBuffer;
+ int peekPosition = testBuffer.size();
+ for (int i = 1; i < 256; ++i) {
+ QByteArray ba(i, 0);
+ peekPosition -= i;
+ qint64 thisPeek = ringBuffer.peek(ba.data(), i, peekPosition);
+ QCOMPARE(thisPeek, qint64(i));
+ resultBuffer.prepend(ba);
+ }
+ QCOMPARE(resultBuffer, testBuffer);
}
void tst_QRingBuffer::readLine()
@@ -293,18 +342,18 @@ void tst_QRingBuffer::readLine()
char stringBuf[102];
stringBuf[101] = 0; // non-crash terminator
- QVERIFY(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2) == ba1.size());
- QVERIFY(QByteArray(stringBuf, int(strlen(stringBuf))) == ba1);
+ QCOMPARE(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2), qint64(ba1.size()));
+ QCOMPARE(QByteArray(stringBuf, int(strlen(stringBuf))), ba1);
// check first empty string reading
stringBuf[0] = char(0xFF);
- QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2), ba2.size());
- QVERIFY(stringBuf[0] == ba2[0]);
+ QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2), qint64(ba2.size()));
+ QCOMPARE(stringBuf[0], ba2.at(0));
- QVERIFY(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2) == (ba3.size() + ba4.size()
- + ba2.size()));
- QVERIFY(QByteArray(stringBuf, int(strlen(stringBuf))) == (ba3 + ba4 + ba2));
- QVERIFY(ringBuffer.size() == 0);
+ QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2),
+ qint64(ba3.size() + ba4.size() + ba2.size()));
+ QCOMPARE(QByteArray(stringBuf, int(strlen(stringBuf))), ba3 + ba4 + ba2);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
QTEST_APPLESS_MAIN(tst_QRingBuffer)
diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp
index f13d69514a..fe4d81085c 100644
--- a/tests/auto/corelib/tools/qset/tst_qset.cpp
+++ b/tests/auto/corelib/tools/qset/tst_qset.cpp
@@ -65,6 +65,7 @@ private slots:
void begin();
void end();
void insert();
+ void reverseIterators();
void setOperations();
void stlIterator();
void stlMutableIterator();
@@ -73,6 +74,7 @@ private slots:
void makeSureTheComfortFunctionsCompile();
void initializerList();
void qhash();
+ void intersects();
};
struct IdentityTracker {
@@ -554,6 +556,21 @@ void tst_QSet::insert()
}
}
+void tst_QSet::reverseIterators()
+{
+ QSet<int> s;
+ s << 1 << 17 << 61 << 127 << 911;
+ std::vector<int> v(s.begin(), s.end());
+ std::reverse(v.begin(), v.end());
+ const QSet<int> &cs = s;
+ QVERIFY(std::equal(v.begin(), v.end(), s.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), s.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cs.rbegin()));
+ QVERIFY(std::equal(s.rbegin(), s.rend(), v.begin()));
+ QVERIFY(std::equal(s.crbegin(), s.crend(), v.begin()));
+ QVERIFY(std::equal(cs.rbegin(), cs.rend(), v.begin()));
+}
+
void tst_QSet::setOperations()
{
QSet<QString> set1, set2;
@@ -969,24 +986,6 @@ void tst_QSet::initializerList()
#endif
}
-QT_BEGIN_NAMESPACE
-extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-QT_END_NAMESPACE
-
-class QtQHashSeedSaver {
- int oldSeed, newSeed;
-public:
- explicit QtQHashSeedSaver(int seed)
- : oldSeed(qt_qhash_seed.fetchAndStoreRelaxed(seed)),
- newSeed(seed)
- {}
- ~QtQHashSeedSaver()
- {
- // only restore when no-one else changed the seed in the meantime:
- qt_qhash_seed.testAndSetRelaxed(newSeed, oldSeed);
- }
-};
-
void tst_QSet::qhash()
{
//
@@ -994,14 +993,14 @@ void tst_QSet::qhash()
//
{
// create some deterministic initial state:
- const QtQHashSeedSaver seed1(0);
+ qSetGlobalQHashSeed(0);
QSet<int> s1;
s1.reserve(4);
s1 << 400 << 300 << 200 << 100;
// also change the seed:
- const QtQHashSeedSaver seed2(0x10101010);
+ qSetGlobalQHashSeed(0x10101010);
QSet<int> s2;
s2.reserve(100); // provoke different bucket counts
@@ -1030,6 +1029,32 @@ void tst_QSet::qhash()
}
}
+void tst_QSet::intersects()
+{
+ QSet<int> s1;
+ QSet<int> s2;
+
+ QVERIFY(!s1.intersects(s1));
+ QVERIFY(!s1.intersects(s2));
+
+ s1 << 100;
+ QVERIFY(s1.intersects(s1));
+ QVERIFY(!s1.intersects(s2));
+
+ s2 << 200;
+ QVERIFY(!s1.intersects(s2));
+
+ s1 << 200;
+ QVERIFY(s1.intersects(s2));
+
+ qSetGlobalQHashSeed(0x10101010);
+ QSet<int> s3;
+ s3 << 500;
+ QVERIFY(!s1.intersects(s3));
+ s3 << 200;
+ QVERIFY(s1.intersects(s3));
+}
+
QTEST_APPLESS_MAIN(tst_QSet)
#include "tst_qset.moc"
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
index c3a615fdff..2128eeb164 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
@@ -641,6 +641,7 @@ namespace QTest {
make.setProcessChannelMode(channelMode);
static const char makes[] =
+ "jom.exe\0" //preferred for visual c++ or mingw
"nmake.exe\0" //for visual c++
"mingw32-make.exe\0" //for mingw
"gmake\0"
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri
index cac94bb522..604bd7f59f 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri
@@ -4,4 +4,3 @@ cleanedQMAKESPEC = $$replace(QMAKESPEC, \\\\, /)
DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\"
cross_compile:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED
-wince: DEFINES += QTEST_CROSS_COMPILED QTEST_NO_RTTI
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 7538eaf378..ab5bc410f6 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -94,18 +94,18 @@ private slots:
void creatingQObject();
void mixTrackingPointerCode();
void reentrancyWhileDestructing();
+ void map();
+ void hash();
+ void qvariantCast();
+ void sharedFromThis();
void threadStressTest_data();
void threadStressTest();
- void map();
- void hash();
void validConstructs();
void invalidConstructs_data();
void invalidConstructs();
-
- void qvariantCast();
- void sharedFromThis();
-
+ // let invalidConstructs be the last test, because it's the slowest;
+ // add new tests above this block
public slots:
void cleanup() { safetyCheck(); }
@@ -231,6 +231,14 @@ void tst_QSharedPointer::basics()
QCOMPARE(sizeof(weakref), 2*sizeof(void*));
}
+ {
+ QSharedPointer<const Data> ptr;
+ QWeakPointer<const Data> weakref;
+
+ QCOMPARE(sizeof(ptr), 2*sizeof(void*));
+ QCOMPARE(sizeof(weakref), 2*sizeof(void*));
+ }
+
QFETCH(bool, isNull);
Data *aData = 0;
if (!isNull)
@@ -2173,6 +2181,16 @@ void tst_QSharedPointer::sharedFromThis()
QVERIFY(const_scp.isNull());
QCOMPARE(Data::generationCounter, generations + 1);
QCOMPARE(Data::destructorCounter, destructions);
+
+ QWeakPointer<SomeClass> wcp = sc.sharedFromThis();
+ QVERIFY(wcp.isNull());
+ QCOMPARE(Data::generationCounter, generations + 1);
+ QCOMPARE(Data::destructorCounter, destructions);
+
+ QWeakPointer<const SomeClass> const_wcp = sc.sharedFromThis();
+ QVERIFY(const_wcp.isNull());
+ QCOMPARE(Data::generationCounter, generations + 1);
+ QCOMPARE(Data::destructorCounter, destructions);
}
QCOMPARE(Data::generationCounter, generations + 1);
@@ -2184,6 +2202,11 @@ void tst_QSharedPointer::sharedFromThis()
QVERIFY(const_scp.isNull());
QCOMPARE(Data::generationCounter, generations + 2);
QCOMPARE(Data::destructorCounter, destructions + 1);
+
+ QWeakPointer<const SomeClass> const_wcp = sc.sharedFromThis();
+ QVERIFY(const_wcp.isNull());
+ QCOMPARE(Data::generationCounter, generations + 2);
+ QCOMPARE(Data::destructorCounter, destructions + 1);
}
QCOMPARE(Data::generationCounter, generations + 2);
@@ -2375,6 +2398,21 @@ void tst_QSharedPointer::sharedFromThis()
QCOMPARE(Data::generationCounter, generations + 5);
QCOMPARE(Data::destructorCounter, destructions + 5);
+
+ {
+ QSharedPointer<const SomeClass> scp2(new SomeClass());
+ QVERIFY(!scp2.isNull());
+ QCOMPARE(Data::generationCounter, generations + 6);
+ QCOMPARE(Data::destructorCounter, destructions + 5);
+
+ QWeakPointer<const SomeClass> wcp2(scp2.constCast<SomeClass>());
+ QVERIFY(!wcp2.isNull());
+ QCOMPARE(Data::generationCounter, generations + 6);
+ QCOMPARE(Data::destructorCounter, destructions + 5);
+ }
+
+ QCOMPARE(Data::generationCounter, generations + 6);
+ QCOMPARE(Data::destructorCounter, destructions + 6);
}
namespace ReentrancyWhileDestructing {
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 0d10a9c5bd..a922e3ad27 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -60,11 +60,241 @@
#include <qhash.h>
#include <string>
+#include <algorithm>
#define CREATE_REF(string) \
const QString padded = QString::fromLatin1(" %1 ").arg(string); \
QStringRef ref = padded.midRef(1, padded.size() - 2);
+namespace {
+
+// this wraps an argument to a QString function, as well as how to apply
+// the argument to a given QString member function.
+template <typename T>
+class Arg;
+
+template <typename T>
+class Reversed {}; // marker for Arg<QChar> to apply the operation in reverse order (for prepend())
+
+class ArgBase
+{
+protected:
+ QString pinned;
+ explicit ArgBase(const char *str)
+ : pinned(QString::fromLatin1(str)) {}
+};
+
+template <>
+class Arg<QChar> : protected ArgBase
+{
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { Q_FOREACH (QChar ch, this->pinned) (s.*mf)(ch); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { Q_FOREACH (QChar ch, this->pinned) (s.*mf)(a1, ch); }
+};
+
+template <>
+class Arg<Reversed<QChar> > : private Arg<QChar>
+{
+public:
+ explicit Arg(const char *str) : Arg<QChar>(str)
+ {
+ std::reverse(this->pinned.begin(), this->pinned.end());
+ }
+
+ using Arg<QChar>::apply0;
+ using Arg<QChar>::apply1;
+};
+
+template <>
+class Arg<QString> : ArgBase
+{
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(this->pinned); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, this->pinned); }
+};
+
+template <>
+class Arg<QStringRef> : ArgBase
+{
+ QStringRef ref() const
+ { return this->pinned.isNull() ? QStringRef() : this->pinned.midRef(0) ; }
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(ref()); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, ref()); }
+};
+
+template <>
+class Arg<QPair<const QChar *, int> > : ArgBase
+{
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(this->pinned.constData(), this->pinned.length()); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, this->pinned.constData(), this->pinned.length()); }
+};
+
+template <>
+class Arg<QLatin1String>
+{
+ QLatin1String l1;
+public:
+ explicit Arg(const char *str) : l1(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(l1); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, l1); }
+};
+
+template <>
+class Arg<char>
+{
+protected:
+ const char *str;
+public:
+ explicit Arg(const char *str) : str(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ {
+ if (str) {
+ for (const char *it = str; *it; ++it)
+ (s.*mf)(*it);
+ }
+ }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ {
+ if (str) {
+ for (const char *it = str; *it; ++it)
+ (s.*mf)(a1, *it);
+ }
+ }
+};
+
+template <>
+class Arg<Reversed<char> > : private Arg<char>
+{
+ static const char *dupAndReverse(const char *s)
+ {
+ char *s2 = qstrdup(s);
+ std::reverse(s2, s2 + qstrlen(s2));
+ return s2;
+ }
+public:
+ explicit Arg(const char *str) : Arg<char>(dupAndReverse(str)) {}
+ ~Arg() { delete[] str; }
+
+ using Arg<char>::apply0;
+ using Arg<char>::apply1;
+};
+
+template <>
+class Arg<const char*>
+{
+ const char *str;
+public:
+ explicit Arg(const char *str) : str(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(str); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, str); }
+};
+
+template <>
+class Arg<QByteArray>
+{
+ QByteArray ba;
+public:
+ explicit Arg(const char *str) : ba(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(ba); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, ba); }
+};
+
+// const char* is not allowed as columns in data-driven tests (causes static_assert failure),
+// so wrap it in a container (default ctor is a QMetaType/QVariant requirement):
+class CharStarContainer
+{
+ const char *str;
+public:
+ explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = Q_NULLPTR) : str(s) {}
+ Q_DECL_CONSTEXPR operator const char *() const { return str; }
+};
+
+} // unnamed namespace
+
+Q_DECLARE_METATYPE(CharStarContainer)
+
+// implementation helpers for append_impl/prepend_impl etc
+template <typename ArgType, typename MemFun>
+static void do_apply0(MemFun mf)
+{
+ QFETCH(QString, s);
+ QFETCH(CharStarContainer, arg);
+ QFETCH(QString, expected);
+
+ Arg<ArgType>(arg).apply0(s, mf);
+
+ QCOMPARE(s, expected);
+ QCOMPARE(s.isEmpty(), expected.isEmpty());
+ QCOMPARE(s.isNull(), expected.isNull());
+}
+
+template <typename ArgType, typename A1, typename MemFun>
+static void do_apply1(MemFun mf)
+{
+ QFETCH(QString, s);
+ QFETCH(CharStarContainer, arg);
+ QFETCH(A1, a1);
+ QFETCH(QString, expected);
+
+ Arg<ArgType>(arg).apply1(s, mf, a1);
+
+ QCOMPARE(s, expected);
+ QCOMPARE(s.isEmpty(), expected.isEmpty());
+ QCOMPARE(s.isNull(), expected.isNull());
+}
+
class tst_QString : public QObject
{
Q_OBJECT
@@ -73,6 +303,27 @@ class tst_QString : public QObject
void split_regexp(const QString &string, const QString &pattern, QStringList result);
template<typename List>
void split(const QString &string, const QString &separator, QStringList result);
+
+ template <typename ArgType, typename MemFun>
+ void append_impl() const { do_apply0<ArgType>(MemFun(&QString::append)); }
+ template <typename ArgType>
+ void append_impl() const { append_impl<ArgType, QString &(QString::*)(const ArgType&)>(); }
+ void append_data(bool emptyIsNoop = false);
+ template <typename ArgType, typename MemFun>
+ void operator_pluseq_impl() const { do_apply0<ArgType>(MemFun(&QString::operator+=)); }
+ template <typename ArgType>
+ void operator_pluseq_impl() const { operator_pluseq_impl<ArgType, QString &(QString::*)(const ArgType&)>(); }
+ void operator_pluseq_data(bool emptyIsNoop = false);
+ template <typename ArgType, typename MemFun>
+ void prepend_impl() const { do_apply0<ArgType>(MemFun(&QString::prepend)); }
+ template <typename ArgType>
+ void prepend_impl() const { prepend_impl<ArgType, QString &(QString::*)(const ArgType&)>(); }
+ void prepend_data(bool emptyIsNoop = false);
+ template <typename ArgType, typename MemFun>
+ void insert_impl() const { do_apply1<ArgType, int>(MemFun(&QString::insert)); }
+ template <typename ArgType>
+ void insert_impl() const { insert_impl<ArgType, QString &(QString::*)(int, const ArgType&)>(); }
+ void insert_data(bool emptyIsNoop = false);
public:
tst_QString();
public slots:
@@ -121,19 +372,86 @@ private slots:
void remove_regexp_data();
void remove_regexp();
void swap();
- void prepend();
- void prepend_bytearray_data();
- void prepend_bytearray();
- void append();
- void append_bytearray_data();
- void append_bytearray();
- void operator_pluseq_bytearray_data();
- void operator_pluseq_bytearray();
+
+ void prepend_qstring() { prepend_impl<QString>(); }
+ void prepend_qstring_data() { prepend_data(true); }
+ void prepend_qstringref() { prepend_impl<QStringRef>(); }
+ void prepend_qstringref_data() { prepend_data(true); }
+ void prepend_qlatin1string() { prepend_impl<QLatin1String, QString &(QString::*)(QLatin1String)>(); }
+ void prepend_qlatin1string_data() { prepend_data(true); }
+ void prepend_qcharstar_int() { prepend_impl<QPair<const QChar *, int>, QString &(QString::*)(const QChar *, int)>(); }
+ void prepend_qcharstar_int_data() { prepend_data(true); }
+ void prepend_qchar() { prepend_impl<Reversed<QChar>, QString &(QString::*)(QChar)>(); }
+ void prepend_qchar_data() { prepend_data(true); }
+ void prepend_qbytearray() { prepend_impl<QByteArray>(); }
+ void prepend_qbytearray_data() { prepend_data(true); }
+ void prepend_char() { prepend_impl<Reversed<char>, QString &(QString::*)(QChar)>(); }
+ void prepend_char_data() { prepend_data(true); }
+ void prepend_charstar() { prepend_impl<const char *, QString &(QString::*)(const char *)>(); }
+ void prepend_charstar_data() { prepend_data(true); }
+ void prepend_bytearray_special_cases_data();
+ void prepend_bytearray_special_cases();
+
+ void append_qstring() { append_impl<QString>(); }
+ void append_qstring_data() { append_data(); }
+ void append_qstringref() { append_impl<QStringRef>(); }
+ void append_qstringref_data() { append_data(); }
+ void append_qlatin1string() { append_impl<QLatin1String, QString &(QString::*)(QLatin1String)>(); }
+ void append_qlatin1string_data() { append_data(); }
+ void append_qcharstar_int() { append_impl<QPair<const QChar *, int>, QString&(QString::*)(const QChar *, int)>(); }
+ void append_qcharstar_int_data() { append_data(true); }
+ void append_qchar() { append_impl<QChar, QString &(QString::*)(QChar)>(); }
+ void append_qchar_data() { append_data(true); }
+ void append_qbytearray() { append_impl<QByteArray>(); }
+ void append_qbytearray_data() { append_data(); }
+ void append_char() { append_impl<char, QString &(QString::*)(QChar)>(); }
+ void append_char_data() { append_data(true); }
+ void append_charstar() { append_impl<const char *, QString &(QString::*)(const char *)>(); }
+ void append_charstar_data() { append_data(); }
+ void append_special_cases();
+ void append_bytearray_special_cases_data();
+ void append_bytearray_special_cases();
+
+ void operator_pluseq_qstring() { operator_pluseq_impl<QString>(); }
+ void operator_pluseq_qstring_data() { operator_pluseq_data(); }
+ void operator_pluseq_qstringref() { operator_pluseq_impl<QStringRef>(); }
+ void operator_pluseq_qstringref_data() { operator_pluseq_data(); }
+ void operator_pluseq_qlatin1string() { operator_pluseq_impl<QLatin1String, QString &(QString::*)(QLatin1String)>(); }
+ void operator_pluseq_qlatin1string_data() { operator_pluseq_data(); }
+ void operator_pluseq_qchar() { operator_pluseq_impl<QChar, QString &(QString::*)(QChar)>(); }
+ void operator_pluseq_qchar_data() { operator_pluseq_data(true); }
+ void operator_pluseq_qbytearray() { operator_pluseq_impl<QByteArray>(); }
+ void operator_pluseq_qbytearray_data() { operator_pluseq_data(); }
+ void operator_pluseq_char() { operator_pluseq_impl<char, QString &(QString::*)(char)>(); }
+ void operator_pluseq_char_data() { operator_pluseq_data(true); }
+ void operator_pluseq_charstar() { operator_pluseq_impl<const char *, QString &(QString::*)(const char *)>(); }
+ void operator_pluseq_charstar_data() { operator_pluseq_data(); }
+ void operator_pluseq_bytearray_special_cases_data();
+ void operator_pluseq_bytearray_special_cases();
+
void operator_eqeq_bytearray_data();
void operator_eqeq_bytearray();
void operator_eqeq_nullstring();
void operator_smaller();
- void insert();
+
+ void insert_qstring() { insert_impl<QString>(); }
+ void insert_qstring_data() { insert_data(true); }
+ void insert_qstringref() { insert_impl<QStringRef>(); }
+ void insert_qstringref_data() { insert_data(true); }
+ void insert_qlatin1string() { insert_impl<QLatin1String, QString &(QString::*)(int, QLatin1String)>(); }
+ void insert_qlatin1string_data() { insert_data(true); }
+ void insert_qcharstar_int() { insert_impl<QPair<const QChar *, int>, QString &(QString::*)(int, const QChar*, int) >(); }
+ void insert_qcharstar_int_data() { insert_data(true); }
+ void insert_qchar() { insert_impl<Reversed<QChar>, QString &(QString::*)(int, QChar)>(); }
+ void insert_qchar_data() { insert_data(true); }
+ void insert_qbytearray() { insert_impl<QByteArray>(); }
+ void insert_qbytearray_data() { insert_data(true); }
+ void insert_char() { insert_impl<Reversed<char>, QString &(QString::*)(int, QChar)>(); }
+ void insert_char_data() { insert_data(true); }
+ void insert_charstar() { insert_impl<const char *, QString &(QString::*)(int, const char*) >(); }
+ void insert_charstar_data() { insert_data(true); }
+ void insert_special_cases();
+
void simplified_data();
void simplified();
void trimmed();
@@ -183,6 +501,7 @@ private slots:
void fromLocal8Bit();
void local8Bit_data();
void local8Bit();
+ void nullFromLocal8Bit();
void fromLatin1Roundtrip_data();
void fromLatin1Roundtrip();
void toLatin1Roundtrip_data();
@@ -215,6 +534,7 @@ private slots:
void localeAwareCompare_data();
void localeAwareCompare();
#endif
+ void reverseIterators();
void split_data();
void split();
void split_regexp_data();
@@ -262,6 +582,7 @@ private slots:
void compareQLatin1Strings();
void fromQLatin1StringWithLength();
void assignQLatin1String();
+ void assignQChar();
void isRightToLeft_data();
void isRightToLeft();
void unicodeStrings();
@@ -1830,6 +2151,22 @@ void tst_QString::toUpper()
QCOMPARE( QString("`abyz{").toUpper(), QString("`ABYZ{"));
QCOMPARE( QString(1, QChar(0xdf)).toUpper(), QString("SS"));
+ {
+ QString s = QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e");
+
+ // call lvalue-ref version, mustn't change the original
+ QCOMPARE(s.toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
+
+ // call rvalue-ref while shared (the original mustn't change)
+ QString copy = s;
+ QCOMPARE(qMove(copy).toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
+
+ // call rvalue-ref version on detached case
+ copy.clear();
+ QCOMPARE(qMove(s).toUpper(), QString("GROSSSTRASSE"));
+ }
QString lower, upper;
lower += QChar(QChar::highSurrogate(0x10428));
@@ -2066,7 +2403,46 @@ void tst_QString::simplified()
QCOMPARE(qMove(full).simplified(), simple);
}
-void tst_QString::insert()
+void tst_QString::insert_data(bool emptyIsNoop)
+{
+ QTest::addColumn<QString>("s");
+ QTest::addColumn<CharStarContainer>("arg");
+ QTest::addColumn<int>("a1");
+ QTest::addColumn<QString>("expected");
+
+ const CharStarContainer nullC;
+ const CharStarContainer emptyC("");
+ const CharStarContainer aC("a");
+ const CharStarContainer bC("b");
+ //const CharStarContainer abC("ab");
+ const CharStarContainer baC("ba");
+
+ const QString null;
+ const QString empty("");
+ const QString a("a");
+ const QString b("b");
+ const QString ab("ab");
+ const QString ba("ba");
+
+ QTest::newRow("null.insert(0, null)") << null << nullC << 0 << null;
+ QTest::newRow("null.insert(0, empty)") << null << emptyC << 0 << (emptyIsNoop ? null : empty);
+ QTest::newRow("null.insert(0, a)") << null << aC << 0 << a;
+ QTest::newRow("empty.insert(0, null)") << empty << nullC << 0 << empty;
+ QTest::newRow("empty.insert(0, empty)") << empty << emptyC << 0 << empty;
+ QTest::newRow("empty.insert(0, a)") << empty << aC << 0 << a;
+ QTest::newRow("a.insert(0, null)") << a << nullC << 0 << a;
+ QTest::newRow("a.insert(0, empty)") << a << emptyC << 0 << a;
+ QTest::newRow("a.insert(0, b)") << a << bC << 0 << ba;
+ QTest::newRow("a.insert(0, ba)") << a << baC << 0 << (ba + a);
+ QTest::newRow("a.insert(1, null)") << a << nullC << 1 << a;
+ QTest::newRow("a.insert(1, empty)") << a << emptyC << 1 << a;
+ QTest::newRow("a.insert(1, b)") << a << bC << 1 << ab;
+ QTest::newRow("a.insert(1, ba)") << a << baC << 1 << (a + ba);
+ QTest::newRow("ba.insert(1, a)") << ba << aC << 1 << (ba + a);
+ QTest::newRow("ba.insert(2, b)") << ba << bC << 2 << (ba + b);
+}
+
+void tst_QString::insert_special_cases()
{
QString a;
@@ -2097,14 +2473,37 @@ void tst_QString::insert()
QCOMPARE(a.insert(0, QLatin1String("a")), QString("aMontreal"));
}
-void tst_QString::append()
+void tst_QString::append_data(bool emptyIsNoop)
{
- {
- QString a;
- a = "<>ABCABCABCABC";
- QCOMPARE(a.append(">"),QString("<>ABCABCABCABC>"));
- }
+ QTest::addColumn<QString>("s");
+ QTest::addColumn<CharStarContainer>("arg");
+ QTest::addColumn<QString>("expected");
+ const CharStarContainer nullC;
+ const CharStarContainer emptyC("");
+ const CharStarContainer aC("a");
+ const CharStarContainer bC("b");
+ //const CharStarContainer abC("ab");
+
+ const QString null;
+ const QString empty("");
+ const QString a("a");
+ //const QString b("b");
+ const QString ab("ab");
+
+ QTest::newRow("null + null") << null << nullC << null;
+ QTest::newRow("null + empty") << null << emptyC << (emptyIsNoop ? null : empty);
+ QTest::newRow("null + a") << null << aC << a;
+ QTest::newRow("empty + null") << empty << nullC << empty;
+ QTest::newRow("empty + empty") << empty << emptyC << empty;
+ QTest::newRow("empty + a") << empty << aC << a;
+ QTest::newRow("a + null") << a << nullC << a;
+ QTest::newRow("a + empty") << a << emptyC << a;
+ QTest::newRow("a + b") << a << bC << ab;
+}
+
+void tst_QString::append_special_cases()
+{
{
QString a;
static const QChar unicode[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!' };
@@ -2124,7 +2523,7 @@ void tst_QString::append()
}
}
-void tst_QString::append_bytearray_data()
+void tst_QString::append_bytearray_special_cases_data()
{
QTest::addColumn<QString>("str" );
QTest::addColumn<QByteArray>("ba" );
@@ -2158,7 +2557,7 @@ void tst_QString::append_bytearray_data()
QTest::newRow( "nonAsciiByteArray2") << QString() << QByteArray("\xc3\xa9") << QString::fromUtf8("\xc3\xa9");
}
-void tst_QString::append_bytearray()
+void tst_QString::append_bytearray_special_cases()
{
{
QFETCH( QString, str );
@@ -2186,12 +2585,17 @@ void tst_QString::append_bytearray()
}
}
-void tst_QString::operator_pluseq_bytearray_data()
+void tst_QString::operator_pluseq_data(bool emptyIsNoop)
{
- append_bytearray_data();
+ append_data(emptyIsNoop);
}
-void tst_QString::operator_pluseq_bytearray()
+void tst_QString::operator_pluseq_bytearray_special_cases_data()
+{
+ append_bytearray_special_cases_data();
+}
+
+void tst_QString::operator_pluseq_bytearray_special_cases()
{
{
QFETCH( QString, str );
@@ -2248,14 +2652,37 @@ void tst_QString::swap()
QCOMPARE(s2,QLatin1String("s1"));
}
-void tst_QString::prepend()
+void tst_QString::prepend_data(bool emptyIsNoop)
{
- QString a;
- a = "<>ABCABCABCABC>";
- QCOMPARE(a.prepend("-"),(QString)"-<>ABCABCABCABC>");
+ QTest::addColumn<QString>("s");
+ QTest::addColumn<CharStarContainer>("arg");
+ QTest::addColumn<QString>("expected");
+
+ const CharStarContainer nullC;
+ const CharStarContainer emptyC("");
+ const CharStarContainer aC("a");
+ const CharStarContainer bC("b");
+ const CharStarContainer baC("ba");
+
+ const QString null;
+ const QString empty("");
+ const QString a("a");
+ //const QString b("b");
+ const QString ba("ba");
+
+ QTest::newRow("null.prepend(null)") << null << nullC << null;
+ QTest::newRow("null.prepend(empty)") << null << emptyC << (emptyIsNoop ? null : empty);
+ QTest::newRow("null.prepend(a)") << null << aC << a;
+ QTest::newRow("empty.prepend(null)") << empty << nullC << empty;
+ QTest::newRow("empty.prepend(empty)") << empty << emptyC << empty;
+ QTest::newRow("empty.prepend(a)") << empty << aC << a;
+ QTest::newRow("a.prepend(null)") << a << nullC << a;
+ QTest::newRow("a.prepend(empty)") << a << emptyC << a;
+ QTest::newRow("a.prepend(b)") << a << bC << ba;
+ QTest::newRow("a.prepend(ba)") << a << baC << (ba + a);
}
-void tst_QString::prepend_bytearray_data()
+void tst_QString::prepend_bytearray_special_cases_data()
{
QTest::addColumn<QString>("str" );
QTest::addColumn<QByteArray>("ba" );
@@ -2281,7 +2708,7 @@ void tst_QString::prepend_bytearray_data()
QTest::newRow( "nonAsciiByteArray2") << QString() << QByteArray("\xc3\xa9") << QString::fromUtf8("\xc3\xa9");
}
-void tst_QString::prepend_bytearray()
+void tst_QString::prepend_bytearray_special_cases()
{
{
QFETCH( QString, str );
@@ -3697,6 +4124,12 @@ void tst_QString::nullFromUtf8()
a = QString::fromUtf8("");
QVERIFY(!a.isNull());
QVERIFY(a.isEmpty());
+ a = QString::fromUtf8(QByteArray());
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromUtf8(QByteArray(""));
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
}
void tst_QString::fromLocal8Bit_data()
@@ -3779,6 +4212,23 @@ void tst_QString::local8Bit()
QCOMPARE(local8Bit.toLocal8Bit(), QByteArray(result));
}
+void tst_QString::nullFromLocal8Bit()
+{
+ QString a;
+ a = QString::fromLocal8Bit(0);
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLocal8Bit("");
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLocal8Bit(QByteArray());
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLocal8Bit(QByteArray(""));
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
+}
+
void tst_QString::stringRef_local8Bit_data()
{
local8Bit_data();
@@ -3945,6 +4395,12 @@ void tst_QString::fromLatin1()
a = QString::fromLatin1( "" );
QVERIFY( !a.isNull() );
QVERIFY( a.isEmpty() );
+ a = QString::fromLatin1(QByteArray());
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLatin1(QByteArray(""));
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
a = QString::fromLatin1(0, 0);
QVERIFY(a.isNull());
@@ -5012,6 +5468,20 @@ void tst_QString::localeAwareCompare()
}
#endif //!defined(Q_OS_WIN) || defined(Q_OS_WIN_AND_WINCE)
+void tst_QString::reverseIterators()
+{
+ QString s = "1234";
+ QString sr = s;
+ std::reverse(sr.begin(), sr.end());
+ const QString &csr = sr;
+ QVERIFY(std::equal(s.begin(), s.end(), sr.rbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), sr.crbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), csr.rbegin()));
+ QVERIFY(std::equal(sr.rbegin(), sr.rend(), s.begin()));
+ QVERIFY(std::equal(sr.crbegin(), sr.crend(), s.begin()));
+ QVERIFY(std::equal(csr.rbegin(), csr.rend(), s.begin()));
+}
+
void tst_QString::split_data()
{
QTest::addColumn<QString>("str");
@@ -5837,14 +6307,15 @@ void tst_QString::arg_locale()
QLocale l(QLocale::English, QLocale::UnitedKingdom);
QString str("*%L1*%L2*");
- QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123,456*1,234.56*"));
QLocale::setDefault(l);
+ QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123,456*1,234.56*"));
l.setNumberOptions(QLocale::OmitGroupSeparator);
QLocale::setDefault(l);
QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
QLocale::setDefault(QLocale::C);
+ QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
}
@@ -6163,6 +6634,71 @@ void tst_QString::assignQLatin1String()
QCOMPARE(foo.size(), latin1subfoo.size());
QCOMPARE(foo, QString::fromLatin1("foo"));
+ // check capacity re-use:
+ QString s;
+ QCOMPARE(s.capacity(), 0);
+
+ // assign to null QString:
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), 3);
+
+ // assign to non-null QString with enough capacity:
+ s = QString::fromLatin1("foofoo");
+ const int capacity = s.capacity();
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), capacity);
+
+ // assign to shared QString (enough capacity, but can't use):
+ s = QString::fromLatin1("foofoo");
+ QString s2 = s;
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), 3);
+
+ // assign to QString with too little capacity:
+ s = QString::fromLatin1("fo");
+ QCOMPARE(s.capacity(), 2);
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), 3);
+
+}
+
+void tst_QString::assignQChar()
+{
+ const QChar sp = QLatin1Char(' ');
+ QString s;
+ QCOMPARE(s.capacity(), 0);
+
+ // assign to null QString:
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), 1);
+
+ // assign to non-null QString with enough capacity:
+ s = QLatin1String("foo");
+ const int capacity = s.capacity();
+ QCOMPARE(capacity, 3);
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), capacity);
+
+ // assign to shared QString (enough capacity, but can't use):
+ s = QLatin1String("foo");
+ QString s2 = s;
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), 1);
+
+ // assign to empty QString:
+ s = QString("");
+ s.detach();
+ QCOMPARE(s.capacity(), 0);
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), 1);
}
void tst_QString::isRightToLeft_data()
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
index f4b748e62a..550f835bea 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
+++ b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
@@ -55,23 +55,19 @@ void tst_QString_macTypes()
}
// QString <-> NSString
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QString qtString("test string");
const NSString *nsString = qtString.toNSString();
QCOMPARE(QString::fromNSString(nsString), qtString);
-
- [pool release];
}
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QString qtString("test string");
const NSString *nsString = qtString.toNSString();
QString qtStringCopy(qtString);
qtString = qtString.toUpper(); // modify
QCOMPARE(QString::fromNSString(nsString), qtStringCopy);
-
- [pool release];
}
}
diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
index 7fc855a359..82d103c460 100644
--- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
+++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
@@ -82,6 +82,7 @@ private slots:
void integer_conversion_data();
void integer_conversion();
void trimmed();
+ void truncate();
void left();
void right();
void mid();
@@ -1839,6 +1840,30 @@ void tst_QStringRef::trimmed()
QCOMPARE(b.trimmed().compare(QStringLiteral("a")), 0);
}
+void tst_QStringRef::truncate()
+{
+ const QString str = "OriginalString~";
+ const QStringRef cref = str.midRef(0);
+ {
+ QStringRef ref = cref;
+ ref.truncate(1000);
+ QCOMPARE(ref, cref);
+ for (int i = str.size(); i >= 0; --i) {
+ ref.truncate(i);
+ QCOMPARE(ref.size(), i);
+ QCOMPARE(ref, cref.left(i));
+ }
+ QVERIFY(ref.isEmpty());
+ }
+
+ {
+ QStringRef ref = cref;
+ QVERIFY(!ref.isEmpty());
+ ref.truncate(-1);
+ QVERIFY(ref.isEmpty());
+ }
+}
+
void tst_QStringRef::left()
{
QString originalString = "OrginalString~";
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
index d39f2c760a..a3ed239c95 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
@@ -1,8 +1,8 @@
-# GraphemeBreakTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:39 GMT [MD]
+# GraphemeBreakTest-8.0.0.txt
+# Date: 2015-02-13, 13:47:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
index f06917bb77..7f2e2cc54f 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
@@ -1,8 +1,8 @@
-# LineBreakTest-7.0.0.txt
-# Date: 2014-02-19, 15:51:25 GMT [MD]
+# LineBreakTest-8.0.0.txt
+# Date: 2015-04-30, 09:40:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -166,10 +166,10 @@
× 0023 × 0020 ÷ 00A7 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0023 × 0308 × 00A7 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0023 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0023 × E000 ÷ # × [0.3] NUMBER SIGN (AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0023 × 0020 ÷ E000 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0023 × 0308 × E000 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0023 × 0308 × 0020 ÷ E000 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0023 × 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0023 × 0020 ÷ 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0023 × 0308 × 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0023 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0023 × 0E01 ÷ # × [0.3] NUMBER SIGN (AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0023 × 0020 ÷ 0E01 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0023 × 0308 × 0E01 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -322,10 +322,10 @@
× 2014 × 0020 ÷ 00A7 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2014 × 0308 ÷ 00A7 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2014 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 2014 ÷ E000 ÷ # × [0.3] EM DASH (B2) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2014 × 0020 ÷ E000 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2014 × 0308 ÷ E000 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2014 × 0308 × 0020 ÷ E000 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 2014 ÷ 50005 ÷ # × [0.3] EM DASH (B2) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2014 × 0020 ÷ 50005 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2014 × 0308 ÷ 50005 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2014 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 2014 ÷ 0E01 ÷ # × [0.3] EM DASH (B2) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2014 × 0020 ÷ 0E01 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2014 × 0308 ÷ 0E01 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -478,10 +478,10 @@
× 0009 × 0020 ÷ 00A7 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0009 × 0308 ÷ 00A7 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0009 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0009 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0009 × 0020 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0009 × 0308 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0009 × 0308 × 0020 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0009 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0009 × 0020 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0009 × 0308 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0009 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0009 ÷ 0E01 ÷ # × [0.3] <CHARACTER TABULATION> (BA) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0009 × 0020 ÷ 0E01 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0009 × 0308 ÷ 0E01 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -634,10 +634,10 @@
× 00B4 × 0020 ÷ 00A7 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00B4 × 0308 × 00A7 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] SECTION SIGN (AI_AL) ÷ [0.3]
× 00B4 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 00B4 × E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [21.04] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00B4 × 0020 ÷ E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00B4 × 0308 × E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00B4 × 0308 × 0020 ÷ E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 00B4 × 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [21.04] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00B4 × 0020 ÷ 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00B4 × 0308 × 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00B4 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 00B4 × 0E01 ÷ # × [0.3] ACUTE ACCENT (BB) × [21.04] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00B4 × 0020 ÷ 0E01 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00B4 × 0308 × 0E01 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -790,10 +790,10 @@
× 000B ÷ 0020 ÷ 00A7 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000B ÷ 0308 × 00A7 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000B ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 000B ÷ E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000B ÷ 0020 ÷ E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000B ÷ 0308 × E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000B ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 000B ÷ 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000B ÷ 0020 ÷ 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000B ÷ 0308 × 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000B ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 000B ÷ 0E01 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000B ÷ 0020 ÷ 0E01 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000B ÷ 0308 × 0E01 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -946,10 +946,10 @@
× FFFC × 0020 ÷ 00A7 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× FFFC × 0308 ÷ 00A7 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] SECTION SIGN (AI_AL) ÷ [0.3]
× FFFC × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× FFFC ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) ÷ [20.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× FFFC × 0020 ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× FFFC × 0308 ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× FFFC × 0308 × 0020 ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× FFFC ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) ÷ [20.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× FFFC × 0020 ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× FFFC × 0308 ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× FFFC × 0308 × 0020 ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× FFFC ÷ 0E01 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) ÷ [20.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× FFFC × 0020 ÷ 0E01 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× FFFC × 0308 ÷ 0E01 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1102,10 +1102,10 @@
× 007D × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 007D × 0308 ÷ 00A7 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 007D × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 007D ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 007D × 0020 ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 007D × 0308 ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 007D × 0308 × 0020 ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 007D ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 007D × 0020 ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 007D × 0308 ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 007D × 0308 × 0020 ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 007D ÷ 0E01 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 007D × 0020 ÷ 0E01 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 007D × 0308 ÷ 0E01 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1258,10 +1258,10 @@
× 0029 × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0029 × 0308 × 00A7 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 0029 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0029 × E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [30.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0029 × 0020 ÷ E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0029 × 0308 × E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0029 × 0308 × 0020 ÷ E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0029 × 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [30.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0029 × 0020 ÷ 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0029 × 0308 × 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0029 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0029 × 0E01 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [30.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0029 × 0020 ÷ 0E01 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0029 × 0308 × 0E01 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1414,10 +1414,10 @@
× 0001 × 0020 ÷ 00A7 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0001 × 0308 × 00A7 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0001 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0001 × E000 ÷ # × [0.3] <START OF HEADING> (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0001 × 0020 ÷ E000 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0001 × 0308 × E000 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0001 × 0308 × 0020 ÷ E000 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0001 × 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0001 × 0020 ÷ 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0001 × 0308 × 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0001 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0001 × 0E01 ÷ # × [0.3] <START OF HEADING> (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0001 × 0020 ÷ 0E01 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0001 × 0308 × 0E01 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1570,10 +1570,10 @@
× 000D ÷ 0020 ÷ 00A7 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000D ÷ 0308 × 00A7 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000D ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 000D ÷ E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000D ÷ 0020 ÷ E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000D ÷ 0308 × E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000D ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 000D ÷ 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000D ÷ 0020 ÷ 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000D ÷ 0308 × 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000D ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 000D ÷ 0E01 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000D ÷ 0020 ÷ 0E01 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000D ÷ 0308 × 0E01 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1650,9 +1650,9 @@
× 0021 × 0020 ÷ 231A ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 0021 × 0308 ÷ 231A ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 0021 × 0308 × 0020 ÷ 231A ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 0021 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 0021 × 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
× 0021 × 0020 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 0021 × 0308 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 0021 × 0308 × 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
× 0021 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 0021 × 002C ÷ # × [0.3] EXCLAMATION MARK (EX) × [13.02] COMMA (IS) ÷ [0.3]
× 0021 × 0020 × 002C ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -1726,10 +1726,10 @@
× 0021 × 0020 ÷ 00A7 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0021 × 0308 ÷ 00A7 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0021 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0021 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0021 × 0020 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0021 × 0308 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0021 × 0308 × 0020 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0021 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0021 × 0020 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0021 × 0308 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0021 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0021 ÷ 0E01 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0021 × 0020 ÷ 0E01 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0021 × 0308 ÷ 0E01 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1882,10 +1882,10 @@
× 00A0 × 0020 ÷ 00A7 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A0 × 0308 × 00A7 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A0 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 00A0 × E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [12.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A0 × 0020 ÷ E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A0 × 0308 × E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A0 × 0308 × 0020 ÷ E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 00A0 × 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [12.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A0 × 0020 ÷ 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A0 × 0308 × 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A0 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 00A0 × 0E01 ÷ # × [0.3] NO-BREAK SPACE (GL) × [12.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A0 × 0020 ÷ 0E01 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A0 × 0308 × 0E01 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2038,10 +2038,10 @@
× AC00 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC00 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC00 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× AC00 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC00 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC00 × 0308 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC00 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× AC00 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC00 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC00 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC00 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× AC00 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC00 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC00 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2194,10 +2194,10 @@
× AC01 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC01 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC01 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× AC01 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC01 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC01 × 0308 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC01 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× AC01 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC01 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC01 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC01 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× AC01 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC01 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC01 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2350,10 +2350,10 @@
× 05D0 × 0020 ÷ 00A7 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 05D0 × 0308 × 00A7 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 05D0 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 05D0 × E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 05D0 × 0020 ÷ E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 05D0 × 0308 × E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 05D0 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 05D0 × 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 05D0 × 0020 ÷ 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 05D0 × 0308 × 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 05D0 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 05D0 × 0E01 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 05D0 × 0020 ÷ 0E01 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 05D0 × 0308 × 0E01 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2506,10 +2506,10 @@
× 002D × 0020 ÷ 00A7 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002D × 0308 ÷ 00A7 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002D × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 002D ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002D × 0020 ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002D × 0308 ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002D × 0308 × 0020 ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 002D ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002D × 0020 ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002D × 0308 ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002D × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 002D ÷ 0E01 ÷ # × [0.3] HYPHEN-MINUS (HY) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002D × 0020 ÷ 0E01 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002D × 0308 ÷ 0E01 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2586,9 +2586,9 @@
× 231A × 0020 ÷ 231A ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 231A × 0308 ÷ 231A ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 231A × 0308 × 0020 ÷ 231A ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 231A × 2024 ÷ # × [0.3] WATCH (ID) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
+× 231A × 2024 ÷ # × [0.3] WATCH (ID) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
× 231A × 0020 ÷ 2024 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 231A × 0308 × 2024 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
+× 231A × 0308 × 2024 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
× 231A × 0308 × 0020 ÷ 2024 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 231A × 002C ÷ # × [0.3] WATCH (ID) × [13.02] COMMA (IS) ÷ [0.3]
× 231A × 0020 × 002C ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -2662,10 +2662,10 @@
× 231A × 0020 ÷ 00A7 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 231A × 0308 ÷ 00A7 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 231A × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 231A ÷ E000 ÷ # × [0.3] WATCH (ID) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 231A × 0020 ÷ E000 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 231A × 0308 ÷ E000 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 231A × 0308 × 0020 ÷ E000 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 231A ÷ 50005 ÷ # × [0.3] WATCH (ID) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 231A × 0020 ÷ 50005 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 231A × 0308 ÷ 50005 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 231A × 0308 × 0020 ÷ 50005 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 231A ÷ 0E01 ÷ # × [0.3] WATCH (ID) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 231A × 0020 ÷ 0E01 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 231A × 0308 ÷ 0E01 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2742,9 +2742,9 @@
× 2024 × 0020 ÷ 231A ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 2024 × 0308 ÷ 231A ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 2024 × 0308 × 0020 ÷ 231A ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 2024 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
+× 2024 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
× 2024 × 0020 ÷ 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 2024 × 0308 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
+× 2024 × 0308 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
× 2024 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 2024 × 002C ÷ # × [0.3] ONE DOT LEADER (IN) × [13.02] COMMA (IS) ÷ [0.3]
× 2024 × 0020 × 002C ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -2818,10 +2818,10 @@
× 2024 × 0020 ÷ 00A7 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2024 × 0308 ÷ 00A7 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2024 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 2024 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2024 × 0020 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2024 × 0308 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2024 × 0308 × 0020 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 2024 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2024 × 0020 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2024 × 0308 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2024 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 2024 ÷ 0E01 ÷ # × [0.3] ONE DOT LEADER (IN) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2024 × 0020 ÷ 0E01 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2024 × 0308 ÷ 0E01 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2974,10 +2974,10 @@
× 002C × 0020 ÷ 00A7 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002C × 0308 × 00A7 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002C × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 002C × E000 ÷ # × [0.3] COMMA (IS) × [29.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002C × 0020 ÷ E000 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002C × 0308 × E000 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002C × 0308 × 0020 ÷ E000 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 002C × 50005 ÷ # × [0.3] COMMA (IS) × [29.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002C × 0020 ÷ 50005 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002C × 0308 × 50005 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002C × 0308 × 0020 ÷ 50005 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 002C × 0E01 ÷ # × [0.3] COMMA (IS) × [29.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002C × 0020 ÷ 0E01 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002C × 0308 × 0E01 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3130,10 +3130,10 @@
× 1100 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1100 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1100 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 1100 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1100 × 0020 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1100 × 0308 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1100 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 1100 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1100 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1100 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1100 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 1100 ÷ 0E01 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1100 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1100 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3286,10 +3286,10 @@
× 11A8 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 11A8 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 11A8 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 11A8 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 11A8 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 11A8 × 0308 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 11A8 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 11A8 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 11A8 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 11A8 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 11A8 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 11A8 ÷ 0E01 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 11A8 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 11A8 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3442,10 +3442,10 @@
× 1160 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1160 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1160 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 1160 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1160 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1160 × 0308 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1160 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 1160 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1160 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1160 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1160 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 1160 ÷ 0E01 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1160 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1160 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3598,10 +3598,10 @@
× 000A ÷ 0020 ÷ 00A7 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000A ÷ 0308 × 00A7 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000A ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 000A ÷ E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000A ÷ 0020 ÷ E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000A ÷ 0308 × E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000A ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 000A ÷ 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000A ÷ 0020 ÷ 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000A ÷ 0308 × 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000A ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 000A ÷ 0E01 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000A ÷ 0020 ÷ 0E01 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000A ÷ 0308 × 0E01 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3754,10 +3754,10 @@
× 0085 ÷ 0020 ÷ 00A7 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0085 ÷ 0308 × 00A7 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0085 ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0085 ÷ E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0085 ÷ 0020 ÷ E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0085 ÷ 0308 × E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0085 ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0085 ÷ 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0085 ÷ 0020 ÷ 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0085 ÷ 0308 × 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0085 ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0085 ÷ 0E01 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0085 ÷ 0020 ÷ 0E01 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0085 ÷ 0308 × 0E01 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3910,10 +3910,10 @@
× 17D6 × 0020 ÷ 00A7 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 17D6 × 0308 ÷ 00A7 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 17D6 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 17D6 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 17D6 × 0020 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 17D6 × 0308 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 17D6 × 0308 × 0020 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 17D6 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 17D6 × 0020 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 17D6 × 0308 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 17D6 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 17D6 ÷ 0E01 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 17D6 × 0020 ÷ 0E01 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 17D6 × 0308 ÷ 0E01 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3990,9 +3990,9 @@
× 0030 × 0020 ÷ 231A ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 0030 × 0308 ÷ 231A ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 0030 × 0308 × 0020 ÷ 231A ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 0030 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
+× 0030 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [22.05] ONE DOT LEADER (IN) ÷ [0.3]
× 0030 × 0020 ÷ 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 0030 × 0308 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
+× 0030 × 0308 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [22.05] ONE DOT LEADER (IN) ÷ [0.3]
× 0030 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 0030 × 002C ÷ # × [0.3] DIGIT ZERO (NU) × [25.03] COMMA (IS) ÷ [0.3]
× 0030 × 0020 × 002C ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -4066,10 +4066,10 @@
× 0030 × 0020 ÷ 00A7 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0030 × 0308 × 00A7 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] SECTION SIGN (AI_AL) ÷ [0.3]
× 0030 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0030 × E000 ÷ # × [0.3] DIGIT ZERO (NU) × [23.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0030 × 0020 ÷ E000 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0030 × 0308 × E000 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0030 × 0308 × 0020 ÷ E000 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0030 × 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [23.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0030 × 0020 ÷ 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0030 × 0308 × 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0030 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0030 × 0E01 ÷ # × [0.3] DIGIT ZERO (NU) × [23.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0030 × 0020 ÷ 0E01 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0030 × 0308 × 0E01 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4222,10 +4222,10 @@
× 0028 × 0020 × 00A7 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0028 × 0308 × 00A7 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0028 × 0308 × 0020 × 00A7 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [14.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0028 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0028 × 0020 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0028 × 0308 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0028 × 0308 × 0020 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0028 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0028 × 0020 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0028 × 0308 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0028 × 0308 × 0020 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0028 × 0E01 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [14.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0028 × 0020 × 0E01 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0028 × 0308 × 0E01 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4378,10 +4378,10 @@
× 0025 × 0020 ÷ 00A7 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0025 × 0308 × 00A7 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] SECTION SIGN (AI_AL) ÷ [0.3]
× 0025 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0025 × E000 ÷ # × [0.3] PERCENT SIGN (PO) × [24.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0025 × 0020 ÷ E000 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0025 × 0308 × E000 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0025 × 0308 × 0020 ÷ E000 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0025 × 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [24.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0025 × 0020 ÷ 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0025 × 0308 × 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0025 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0025 × 0E01 ÷ # × [0.3] PERCENT SIGN (PO) × [24.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0025 × 0020 ÷ 0E01 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0025 × 0308 × 0E01 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4534,10 +4534,10 @@
× 0024 × 0020 ÷ 00A7 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0024 × 0308 × 00A7 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 0024 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0024 × E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [24.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0024 × 0020 ÷ E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0024 × 0308 × E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0024 × 0308 × 0020 ÷ E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0024 × 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [24.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0024 × 0020 ÷ 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0024 × 0308 × 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0024 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0024 × 0E01 ÷ # × [0.3] DOLLAR SIGN (PR) × [24.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0024 × 0020 ÷ 0E01 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0024 × 0308 × 0E01 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4690,10 +4690,10 @@
× 0022 × 0020 ÷ 00A7 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0022 × 0308 × 00A7 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 0022 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0022 × E000 ÷ # × [0.3] QUOTATION MARK (QU) × [19.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0022 × 0020 ÷ E000 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0022 × 0308 × E000 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0022 × 0308 × 0020 ÷ E000 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0022 × 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [19.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0022 × 0020 ÷ 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0022 × 0308 × 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0022 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0022 × 0E01 ÷ # × [0.3] QUOTATION MARK (QU) × [19.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0022 × 0020 ÷ 0E01 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0022 × 0308 × 0E01 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4846,10 +4846,10 @@
× 0020 × 0020 ÷ 00A7 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0020 ÷ 0308 × 00A7 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0020 ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0020 ÷ E000 ÷ # × [0.3] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0020 × 0020 ÷ E000 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0020 ÷ 0308 × E000 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0020 ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0020 ÷ 50005 ÷ # × [0.3] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0020 × 0020 ÷ 50005 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0020 ÷ 0308 × 50005 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0020 ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0020 ÷ 0E01 ÷ # × [0.3] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0020 × 0020 ÷ 0E01 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0020 ÷ 0308 × 0E01 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4914,9 +4914,9 @@
× 002F × 0020 ÷ AC01 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
× 002F × 0308 ÷ AC01 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
× 002F × 0308 × 0020 ÷ AC01 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× 002F ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 002F × 05D0 ÷ # × [0.3] SOLIDUS (SY) × [21.2] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 002F × 0020 ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× 002F × 0308 ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 002F × 0308 × 05D0 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [21.2] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 002F × 0308 × 0020 ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 002F × 002D ÷ # × [0.3] SOLIDUS (SY) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
× 002F × 0020 ÷ 002D ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
@@ -5002,10 +5002,10 @@
× 002F × 0020 ÷ 00A7 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002F × 0308 ÷ 00A7 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002F × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 002F ÷ E000 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002F × 0020 ÷ E000 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002F × 0308 ÷ E000 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002F × 0308 × 0020 ÷ E000 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 002F ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002F × 0020 ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002F × 0308 ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002F × 0308 × 0020 ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 002F ÷ 0E01 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002F × 0020 ÷ 0E01 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002F × 0308 ÷ 0E01 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5158,10 +5158,10 @@
× 2060 × 0020 ÷ 00A7 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2060 × 0308 × 00A7 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 2060 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 2060 × E000 ÷ # × [0.3] WORD JOINER (WJ) × [11.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2060 × 0020 ÷ E000 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2060 × 0308 × E000 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2060 × 0308 × 0020 ÷ E000 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 2060 × 50005 ÷ # × [0.3] WORD JOINER (WJ) × [11.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2060 × 0020 ÷ 50005 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2060 × 0308 × 50005 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2060 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 2060 × 0E01 ÷ # × [0.3] WORD JOINER (WJ) × [11.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2060 × 0020 ÷ 0E01 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2060 × 0308 × 0E01 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5314,10 +5314,10 @@
× 200B × 0020 ÷ 00A7 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 200B ÷ 0308 × 00A7 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 200B ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 200B ÷ E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 200B × 0020 ÷ E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 200B ÷ 0308 × E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 200B ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 200B ÷ 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 200B × 0020 ÷ 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 200B ÷ 0308 × 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 200B ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 200B ÷ 0E01 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 200B × 0020 ÷ 0E01 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 200B ÷ 0308 × 0E01 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5470,10 +5470,10 @@
× 1F1E6 × 0020 ÷ 00A7 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1F1E6 × 0308 ÷ 00A7 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1F1E6 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 1F1E6 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1F1E6 × 0020 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1F1E6 × 0308 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1F1E6 × 0308 × 0020 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 1F1E6 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1F1E6 × 0020 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1F1E6 × 0308 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1F1E6 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 1F1E6 ÷ 0E01 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1F1E6 × 0020 ÷ 0E01 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1F1E6 × 0308 ÷ 0E01 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5626,10 +5626,10 @@
× 00A7 × 0020 ÷ 00A7 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A7 × 0308 × 00A7 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A7 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 00A7 × E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A7 × 0020 ÷ E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A7 × 0308 × E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A7 × 0308 × 0020 ÷ E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 00A7 × 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A7 × 0020 ÷ 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A7 × 0308 × 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A7 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 00A7 × 0E01 ÷ # × [0.3] SECTION SIGN (AI_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A7 × 0020 ÷ 0E01 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A7 × 0308 × 0E01 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5638,162 +5638,162 @@
× 00A7 × 0020 ÷ 3041 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
× 00A7 × 0308 × 3041 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
× 00A7 × 0308 × 0020 ÷ 3041 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 × 0020 ÷ 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 × 0308 × 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0020 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0308 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 × 0020 ÷ 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 × 0308 × 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 0020 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 0308 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 × 0020 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 × 0308 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 × 0308 × 0020 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 0020 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 0308 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0020 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0308 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0308 × 0020 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0020 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0308 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0308 × 0020 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 0020 ÷ 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 0308 × 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0020 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0308 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0308 × 0020 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 0020 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 0308 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 0308 × 0020 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [12.1] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 × 0020 ÷ 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 × 0308 × 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [12.2] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 × 0020 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 × 0308 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 0020 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 0308 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 0020 ÷ 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 0308 × 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 × 0020 ÷ 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 × 0308 × 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] WATCH (ID) ÷ [0.3]
-× E000 × 0020 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× E000 × 0308 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× E000 × 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 0020 ÷ 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 0308 × 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] COMMA (IS) ÷ [0.3]
-× E000 × 0020 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
-× E000 × 0308 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] COMMA (IS) ÷ [0.3]
-× E000 × 0308 × 0020 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
-× E000 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 × 0020 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 × 0308 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 × 0020 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 × 0308 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 0020 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 0308 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0020 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0308 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0308 × 0020 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 0020 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 0308 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 0308 × 0020 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0020 ÷ 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0308 × 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0020 ÷ 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0308 × 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 × 0020 ÷ 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 × 0308 × 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 × 0020 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 × 0308 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0020 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0308 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0020 ÷ 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0308 × 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 0020 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 0308 × 0020 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] SOLIDUS (SY) ÷ [0.3]
-× E000 × 0020 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
-× E000 × 0308 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] SOLIDUS (SY) ÷ [0.3]
-× E000 × 0308 × 0020 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
-× E000 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 0020 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 0308 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 0308 × 0020 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 × 0020 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 × 0308 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 × 0308 × 0020 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 0020 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 0308 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × 0020 ÷ 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × 0308 × 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0020 ÷ E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0308 × E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 0020 ÷ 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 0308 × 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0020 ÷ 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0308 × 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 × 0020 ÷ 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 × 0308 × 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0020 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0308 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 × 0020 ÷ 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 × 0308 × 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 0020 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 0308 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 × 0020 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 × 0308 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 × 0308 × 0020 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 0020 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 0308 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0020 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0308 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0308 × 0020 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0020 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0308 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 0020 ÷ 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 0308 × 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0020 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0308 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0308 × 0020 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 0020 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 0308 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [12.1] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 × 0020 ÷ 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 × 0308 × 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [12.2] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 × 0020 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 × 0308 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 0020 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 0308 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 0020 ÷ 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 0308 × 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 × 0020 ÷ 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 × 0308 × 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] WATCH (ID) ÷ [0.3]
+× 50005 × 0020 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
+× 50005 × 0308 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
+× 50005 × 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 0020 ÷ 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 0308 × 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] COMMA (IS) ÷ [0.3]
+× 50005 × 0020 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
+× 50005 × 0308 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] COMMA (IS) ÷ [0.3]
+× 50005 × 0308 × 0020 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
+× 50005 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 × 0020 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 × 0308 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 × 0020 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 × 0308 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 0020 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 0308 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0020 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0308 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0308 × 0020 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 0020 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 0308 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0020 ÷ 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0308 × 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0020 ÷ 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0308 × 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 × 0020 ÷ 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 × 0308 × 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 × 0020 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 × 0308 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0020 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0308 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0020 ÷ 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0308 × 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 0020 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 0020 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 0308 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 0308 × 0020 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 0020 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 0308 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 0308 × 0020 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 × 0020 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 × 0308 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 × 0308 × 0020 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 0020 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 0308 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 0020 ÷ 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 0308 × 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0020 ÷ 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0308 × 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 0020 ÷ 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 0308 × 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0020 ÷ 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0308 × 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
× 0E01 × 0023 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
× 0E01 × 0020 ÷ 0023 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
× 0E01 × 0308 × 0023 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
@@ -5938,10 +5938,10 @@
× 0E01 × 0020 ÷ 00A7 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0E01 × 0308 × 00A7 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0E01 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0E01 × E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0E01 × 0020 ÷ E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0E01 × 0308 × E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0E01 × 0308 × 0020 ÷ E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0E01 × 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0E01 × 0020 ÷ 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0E01 × 0308 × 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0E01 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0E01 × 0E01 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0E01 × 0020 ÷ 0E01 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0E01 × 0308 × 0E01 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -6094,10 +6094,10 @@
× 3041 × 0020 ÷ 00A7 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 3041 × 0308 ÷ 00A7 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 3041 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 3041 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 3041 × 0020 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 3041 × 0308 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 3041 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 3041 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 3041 × 0020 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 3041 × 0308 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 3041 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 3041 ÷ 0E01 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 3041 × 0020 ÷ 0E01 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 3041 × 0308 ÷ 0E01 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -6297,7 +6297,7 @@
× 672C × 003A × 0020 ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-672C (ID) × [13.02] COLON (IS) × [7.01] SPACE (SP) ÷ [0.3]
× 672C × 003A × 0020 ÷ 30AF ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-672C (ID) × [13.02] COLON (IS) × [7.01] SPACE (SP) ÷ [18.0] KATAKANA LETTER KU (ID) ÷ [0.3]
× 51FA ÷ 5178 × 003A × 0020 ÷ 30D5 ÷ 30EA × 30FC ÷ 767E ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-51FA (ID) ÷ [999.0] CJK UNIFIED IDEOGRAPH-5178 (ID) × [13.02] COLON (IS) × [7.01] SPACE (SP) ÷ [18.0] KATAKANA LETTER HU (ID) ÷ [999.0] KATAKANA LETTER RI (ID) × [21.03] KATAKANA-HIRAGANA PROLONGED SOUND MARK (CJ_NS) ÷ [999.0] CJK UNIFIED IDEOGRAPH-767E (ID) ÷ [0.3]
-× 5F8C × 2026 ÷ 306B ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-5F8C (ID) × [22.02] HORIZONTAL ELLIPSIS (IN) ÷ [999.0] HIRAGANA LETTER NI (ID) ÷ [0.3]
+× 5F8C × 2026 ÷ 306B ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-5F8C (ID) × [22.03] HORIZONTAL ELLIPSIS (IN) ÷ [999.0] HIRAGANA LETTER NI (ID) ÷ [0.3]
× 3057 × 3087 ÷ 3046 × 3002 × 3002 × 3002 ÷ # × [0.3] HIRAGANA LETTER SI (ID) × [21.03] HIRAGANA LETTER SMALL YO (CJ_NS) ÷ [999.0] HIRAGANA LETTER U (ID) × [13.02] IDEOGRAPHIC FULL STOP (CL) × [13.02] IDEOGRAPHIC FULL STOP (CL) × [13.02] IDEOGRAPHIC FULL STOP (CL) ÷ [0.3]
× 304D × 3001 × 0021 × 0021 × 3001 × 0021 × 0021 × 0021 ÷ 3068 ÷ # × [0.3] HIRAGANA LETTER KI (ID) × [13.02] IDEOGRAPHIC COMMA (CL) × [13.01] EXCLAMATION MARK (EX) × [13.01] EXCLAMATION MARK (EX) × [13.02] IDEOGRAPHIC COMMA (CL) × [13.01] EXCLAMATION MARK (EX) × [13.01] EXCLAMATION MARK (EX) × [13.01] EXCLAMATION MARK (EX) ÷ [999.0] HIRAGANA LETTER TO (ID) ÷ [0.3]
× 306F × 3001 × 003F ÷ 3068 × 0021 ÷ 3092 ÷ # × [0.3] HIRAGANA LETTER HA (ID) × [13.02] IDEOGRAPHIC COMMA (CL) × [13.01] QUESTION MARK (EX) ÷ [999.0] HIRAGANA LETTER TO (ID) × [13.01] EXCLAMATION MARK (EX) ÷ [999.0] HIRAGANA LETTER WO (ID) ÷ [0.3]
@@ -6327,12 +6327,13 @@
× 1F1F7 × 1F1FA × 1F1F8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER R (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER U (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER S (RI) ÷ [0.3]
× 1F1F7 × 1F1FA × 1F1F8 × 1F1EA ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER R (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER U (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER S (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER E (RI) ÷ [0.3]
× 1F1F7 × 1F1FA × 200B ÷ 1F1F8 × 1F1EA ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER R (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER U (RI) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [8.0] REGIONAL INDICATOR SYMBOL LETTER S (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER E (RI) ÷ [0.3]
+× 05D0 × 002D × 05D0 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [21.02] HYPHEN-MINUS (HY) × [21.1] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 1F1E6 × 1F1E7 × 1F1E8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [0.3]
× 1F1E6 × 200D × 1F1E7 × 1F1E8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] ZERO WIDTH JOINER (CM) × [30.11] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [0.3]
× 1F1E6 × 1F1E7 × 200D × 1F1E8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [9.0] ZERO WIDTH JOINER (CM) × [30.11] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [0.3]
× 0020 ÷ 200D × 0646 ÷ # × [0.3] SPACE (SP) ÷ [18.0] ZERO WIDTH JOINER (CM) × [28.0] ARABIC LETTER NOON (AL) ÷ [0.3]
× 0646 × 200D × 0020 ÷ # × [0.3] ARABIC LETTER NOON (AL) × [9.0] ZERO WIDTH JOINER (CM) × [7.01] SPACE (SP) ÷ [0.3]
#
-# Lines: 6310
+# Lines: 6311
#
# EOF
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
index 638b22a378..279e6db06d 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
@@ -1,8 +1,8 @@
-# SentenceBreakTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:53 GMT [MD]
+# SentenceBreakTest-8.0.0.txt
+# Date: 2015-04-30, 09:40:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -477,6 +477,9 @@
÷ 0055 × 002E × 0053 × 002E × 0041 × 0300 × 002E ÷ # ÷ [0.2] LATIN CAPITAL LETTER U (Upper) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER S (Upper) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER A (Upper) × [5.0] COMBINING GRAVE ACCENT (Extend_FE) × [12.0] FULL STOP (ATerm) ÷ [0.3]
÷ 0033 × 002E × 0034 ÷ # ÷ [0.2] DIGIT THREE (Numeric) × [12.0] FULL STOP (ATerm) × [6.0] DIGIT FOUR (Numeric) ÷ [0.3]
÷ 0063 × 002E × 0064 ÷ # ÷ [0.2] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.0] LATIN SMALL LETTER D (Lower) ÷ [0.3]
+÷ 0043 × 002E × 0064 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (Upper) × [12.0] FULL STOP (ATerm) × [8.0] LATIN SMALL LETTER D (Lower) ÷ [0.3]
+÷ 0063 × 002E × 0044 ÷ # ÷ [0.2] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER D (Upper) ÷ [0.3]
+÷ 0043 × 002E × 0044 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (Upper) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER D (Upper) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 0029 × 2019 × 00A0 × 0074 × 0068 × 0065 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.0] RIGHT PARENTHESIS (Close) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [8.0] NO-BREAK SPACE (Sp) × [8.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER H (Lower) × [12.0] LATIN SMALL LETTER E (Lower) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 0029 × 2019 × 00A0 ÷ 0054 × 0068 × 0065 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [9.0] RIGHT PARENTHESIS (Close) × [9.0] RIGHT SINGLE QUOTATION MARK (Close) × [9.0] NO-BREAK SPACE (Sp) ÷ [11.0] LATIN CAPITAL LETTER T (Upper) × [12.0] LATIN SMALL LETTER H (Lower) × [12.0] LATIN SMALL LETTER E (Lower) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 0029 × 2019 × 00A0 × 2018 × 0028 × 0074 × 0068 × 0065 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.0] RIGHT PARENTHESIS (Close) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [8.0] NO-BREAK SPACE (Sp) × [8.0] LEFT SINGLE QUOTATION MARK (Close) × [12.0] LEFT PARENTHESIS (Close) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER H (Lower) × [12.0] LATIN SMALL LETTER E (Lower) ÷ [0.3]
@@ -490,6 +493,7 @@
÷ 0065 × 0074 × 0063 × 002E ÷ 5B83 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 3002 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.1] IDEOGRAPHIC FULL STOP (STerm) ÷ [0.3]
÷ 5B57 × 3002 ÷ 5B83 ÷ # ÷ [0.2] CJK UNIFIED IDEOGRAPH-5B57 (OLetter) × [12.0] IDEOGRAPHIC FULL STOP (STerm) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) ÷ [0.3]
+÷ 0021 × 0020 × 0020 ÷ # ÷ [0.2] EXCLAMATION MARK (STerm) × [9.0] SPACE (Sp) × [10.0] SPACE (Sp) ÷ [0.3]
÷ 2060 × 0028 × 2060 × 0022 × 2060 × 0047 × 2060 × 006F × 2060 × 002E × 2060 × 0022 × 2060 × 0029 × 2060 × 0020 × 2060 ÷ 0028 × 2060 × 0048 × 2060 × 0065 × 2060 × 0020 × 2060 × 0064 × 2060 × 0069 × 2060 × 0064 × 2060 × 002E × 2060 × 0029 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER G (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER O (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER H (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER I (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0028 × 2060 × 201C × 2060 × 0047 × 2060 × 006F × 2060 × 003F × 2060 × 201D × 2060 × 0029 × 2060 × 0020 × 2060 ÷ 0028 × 2060 × 0048 × 2060 × 0065 × 2060 × 0020 × 2060 × 0064 × 2060 × 0069 × 2060 × 0064 × 2060 × 002E × 2060 × 0029 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LEFT DOUBLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER G (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER O (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] QUESTION MARK (STerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT DOUBLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER H (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER I (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0055 × 2060 × 002E × 2060 × 0053 × 2060 × 002E × 2060 × 0041 × 2060 × 0300 × 002E × 2060 × 0020 × 2060 × 0069 × 2060 × 0073 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER U (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER S (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER A (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] COMBINING GRAVE ACCENT (Extend_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER I (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER S (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
@@ -497,6 +501,9 @@
÷ 2060 × 0055 × 2060 × 002E × 2060 × 0053 × 2060 × 002E × 2060 × 0041 × 2060 × 0300 × 002E × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER U (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER S (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER A (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] COMBINING GRAVE ACCENT (Extend_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0033 × 2060 × 002E × 2060 × 0034 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] DIGIT THREE (Numeric) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [6.0] DIGIT FOUR (Numeric) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0063 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0043 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER C (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0063 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0043 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER C (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 0029 × 2060 × 2019 × 2060 × 00A0 × 2060 × 0074 × 2060 × 0068 × 2060 × 0065 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] NO-BREAK SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER H (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 0029 × 2060 × 2019 × 2060 × 00A0 × 2060 ÷ 0054 × 2060 × 0068 × 2060 × 0065 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] NO-BREAK SPACE (Sp) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] LATIN CAPITAL LETTER T (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER H (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 0029 × 2060 × 2019 × 2060 × 00A0 × 2060 × 2018 × 2060 × 0028 × 2060 × 0074 × 2060 × 0068 × 2060 × 0065 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] NO-BREAK SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [8.0] LEFT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER H (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
@@ -510,12 +517,13 @@
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 ÷ 5B83 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 3002 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.1] IDEOGRAPHIC FULL STOP (STerm) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 5B57 × 2060 × 3002 × 2060 ÷ 5B83 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] CJK UNIFIED IDEOGRAPH-5B57 (OLetter) × [5.0] WORD JOINER (Format_FE) × [12.0] IDEOGRAPHIC FULL STOP (STerm) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0021 × 2060 × 0020 × 2060 × 0020 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] EXCLAMATION MARK (STerm) × [5.0] WORD JOINER (Format_FE) × [9.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [10.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER C (Other) ÷ [0.3]
÷ 1F1E6 × 200D × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Other) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER C (Other) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 200D × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (Other) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] REGIONAL INDICATOR SYMBOL LETTER C (Other) ÷ [0.3]
÷ 0020 × 200D × 0646 ÷ # ÷ [0.2] SPACE (Sp) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] ARABIC LETTER NOON (OLetter) ÷ [0.3]
÷ 0646 × 200D × 0020 ÷ # ÷ [0.2] ARABIC LETTER NOON (OLetter) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] SPACE (Sp) ÷ [0.3]
#
-# Lines: 495
+# Lines: 503
#
# EOF
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
index 1f812f63bf..7e163f1e41 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
@@ -1,8 +1,8 @@
-# WordBreakTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:53 GMT [MD]
+# WordBreakTest-8.0.0.txt
+# Date: 2015-05-02, 14:48:55 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -1377,22 +1377,139 @@
÷ 0061 × 0062 × 00AD × 0062 × 0079 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER B (ALetter) × [4.0] SOFT HYPHEN (Format_FE) × [5.0] LATIN SMALL LETTER B (ALetter) × [5.0] LATIN SMALL LETTER Y (ALetter) ÷ [0.3]
÷ 0061 ÷ 0024 ÷ 002D ÷ 0033 × 0034 × 002C × 0035 × 0036 × 0037 × 002E × 0031 × 0034 ÷ 0025 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] DOLLAR SIGN (Other) ÷ [999.0] HYPHEN-MINUS (Other) ÷ [999.0] DIGIT THREE (Numeric) × [8.0] DIGIT FOUR (Numeric) × [12.0] COMMA (MidNum) × [11.0] DIGIT FIVE (Numeric) × [8.0] DIGIT SIX (Numeric) × [8.0] DIGIT SEVEN (Numeric) × [12.0] FULL STOP (MidNumLet) × [11.0] DIGIT ONE (Numeric) × [8.0] DIGIT FOUR (Numeric) ÷ [999.0] PERCENT SIGN (Other) ÷ [999.0] LATIN SMALL LETTER B (ALetter) ÷ [0.3]
÷ 0033 × 0061 ÷ # ÷ [0.2] DIGIT THREE (Numeric) × [10.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0063 × 002E × 0064 ÷ # ÷ [0.2] LATIN SMALL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN SMALL LETTER D (ALetter) ÷ [0.3]
+÷ 0043 × 002E × 0064 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN SMALL LETTER D (ALetter) ÷ [0.3]
+÷ 0063 × 002E × 0044 ÷ # ÷ [0.2] LATIN SMALL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN CAPITAL LETTER D (ALetter) ÷ [0.3]
+÷ 0043 × 002E × 0044 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN CAPITAL LETTER D (ALetter) ÷ [0.3]
÷ 2060 ÷ 0063 × 2060 × 0061 × 2060 × 006E × 2060 × 0027 × 2060 × 0074 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER N (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER T (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0063 × 2060 × 0061 × 2060 × 006E × 2060 × 2019 × 2060 × 0074 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER N (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] RIGHT SINGLE QUOTATION MARK (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER T (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0061 × 2060 × 0062 × 2060 × 00AD × 2060 × 0062 × 2060 × 0079 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER B (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] SOFT HYPHEN (Format_FE) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER B (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER Y (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0061 × 2060 ÷ 0024 × 2060 ÷ 002D × 2060 ÷ 0033 × 2060 × 0034 × 2060 × 002C × 2060 × 0035 × 2060 × 0036 × 2060 × 0037 × 2060 × 002E × 2060 × 0031 × 2060 × 0034 × 2060 ÷ 0025 × 2060 ÷ 0062 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] DOLLAR SIGN (Other) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] HYPHEN-MINUS (Other) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] DIGIT THREE (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT FOUR (Numeric) × [4.0] WORD JOINER (Format_FE) × [12.0] COMMA (MidNum) × [4.0] WORD JOINER (Format_FE) × [11.0] DIGIT FIVE (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT SIX (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT SEVEN (Numeric) × [4.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [11.0] DIGIT ONE (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT FOUR (Numeric) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] PERCENT SIGN (Other) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER B (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0033 × 2060 × 0061 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] DIGIT THREE (Numeric) × [4.0] WORD JOINER (Format_FE) × [10.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0063 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0043 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN CAPITAL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0063 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0043 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN CAPITAL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 0061 ÷ 1F1E6 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [999.0] LATIN SMALL LETTER B (ALetter) ÷ [0.3]
÷ 1F1F7 × 1F1FA ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) ÷ [0.3]
÷ 1F1F7 × 1F1FA × 1F1F8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER S (Regional_Indicator) ÷ [0.3]
÷ 1F1F7 × 1F1FA × 1F1F8 × 1F1EA ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER S (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER E (Regional_Indicator) ÷ [0.3]
÷ 1F1F7 × 1F1FA ÷ 200B ÷ 1F1F8 × 1F1EA ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) ÷ [999.0] ZERO WIDTH SPACE (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER S (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER E (Regional_Indicator) ÷ [0.3]
+÷ 05D0 × 0022 × 05D0 ÷ # ÷ [0.2] HEBREW LETTER ALEF (Hebrew_Letter) × [7.2] QUOTATION MARK (Double_Quote) × [7.3] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER B (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER C (Regional_Indicator) ÷ [0.3]
÷ 1F1E6 × 200D × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) × [4.0] ZERO WIDTH JOINER (Extend_FE) × [13.3] REGIONAL INDICATOR SYMBOL LETTER B (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER C (Regional_Indicator) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 200D × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER B (Regional_Indicator) × [4.0] ZERO WIDTH JOINER (Extend_FE) × [13.3] REGIONAL INDICATOR SYMBOL LETTER C (Regional_Indicator) ÷ [0.3]
÷ 0020 × 200D ÷ 0646 ÷ # ÷ [0.2] SPACE (Other) × [4.0] ZERO WIDTH JOINER (Extend_FE) ÷ [999.0] ARABIC LETTER NOON (ALetter) ÷ [0.3]
÷ 0646 × 200D ÷ 0020 ÷ # ÷ [0.2] ARABIC LETTER NOON (ALetter) × [4.0] ZERO WIDTH JOINER (Extend_FE) ÷ [999.0] SPACE (Other) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
#
-# Lines: 1372
+# Lines: 1489
#
# EOF
diff --git a/tests/auto/corelib/tools/qtimeline/BLACKLIST b/tests/auto/corelib/tools/qtimeline/BLACKLIST
new file mode 100644
index 0000000000..b5861756d8
--- /dev/null
+++ b/tests/auto/corelib/tools/qtimeline/BLACKLIST
@@ -0,0 +1,4 @@
+[interpolation]
+windows
+[duration]
+windows
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
index 975ed129fc..b588e1fe82 100644
--- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
@@ -93,29 +93,20 @@ void tst_QTimeLine::range()
QCOMPARE(timeLine.endFrame(), 16);
// Verify that you can change the range in the timeLine
- timeLine.setFrameRange(10, 20);
+ timeLine.setFrameRange(1000, 2000);
QSignalSpy spy(&timeLine, &QTimeLine::frameChanged);
QVERIFY(spy.isValid());
- timeLine.start();
-#ifdef Q_OS_WINCE
- QTest::qWait(1000);
-#else
- QTest::qWait(100);
-#endif
- QCOMPARE(timeLine.state(), QTimeLine::Running);
+ timeLine.start(); // make sure that the logic works for a running timeline
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ timeLine.setCurrentTime(timeLine.duration()/2);
int oldValue = timeLine.currentFrame();
- timeLine.setFrameRange(0, 5);
+ timeLine.setFrameRange(0, 500);
QVERIFY(timeLine.currentFrame() < oldValue);
- timeLine.setEndFrame(100);
- timeLine.setStartFrame(50);
+ timeLine.setEndFrame(10000);
+ timeLine.setStartFrame(5000);
QVERIFY(timeLine.currentFrame() > oldValue);
- timeLine.setFrameRange(0, 5);
-#ifdef Q_OS_WINCE
- QTest::qWait(500);
-#else
- QTest::qWait(50);
-#endif
- QVERIFY(spy.count() > 1);
+ timeLine.setFrameRange(0, 500);
+ QTRY_VERIFY(spy.count() > 1);
QVERIFY(timeLine.currentFrame() < oldValue);
}
@@ -123,19 +114,17 @@ void tst_QTimeLine::currentTime()
{
QTimeLine timeLine(2000);
timeLine.setUpdateInterval((timeLine.duration()/2) / 33);
- QSignalSpy spy(&timeLine, &QTimeLine::valueChanged);
- QVERIFY(spy.isValid());
timeLine.setFrameRange(10, 20);
QCOMPARE(timeLine.currentTime(), 0);
timeLine.start();
- QTest::qWait(timeLine.duration()/2);
- QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > timeLine.duration()/2 - timeLine.duration()/10);
- QVERIFY(timeLine.currentTime() < timeLine.duration()/2 + timeLine.duration()/10);
- QTest::qWait(timeLine.duration()/4 + timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentTime() > timeLine.duration()/2 - timeLine.duration()/4);
+ QVERIFY(timeLine.currentTime() < timeLine.duration()/2 + timeLine.duration()/4);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
QCOMPARE(timeLine.currentTime(), timeLine.duration());
+ QSignalSpy spy(&timeLine, &QTimeLine::valueChanged);
+ QVERIFY(spy.isValid());
spy.clear();
timeLine.setCurrentTime(timeLine.duration()/2);
timeLine.setCurrentTime(timeLine.duration()/2);
@@ -144,24 +133,22 @@ void tst_QTimeLine::currentTime()
QCOMPARE(timeLine.currentTime(), timeLine.duration()/2);
timeLine.resume();
// Let it update on its own
- QTest::qWait(timeLine.duration()/4);
QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > timeLine.duration()/2);
+ QTRY_VERIFY(timeLine.currentTime() > timeLine.duration()/2);
QVERIFY(timeLine.currentTime() < timeLine.duration());
- QTest::qWait(timeLine.duration()/4 + timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- QVERIFY(timeLine.currentTime() == timeLine.duration());
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QCOMPARE(timeLine.currentTime(), timeLine.duration());
// Reverse should decrease the currentTime
timeLine.setCurrentTime(timeLine.duration()/2);
timeLine.start();
// Let it update on its own
- QTest::qWait(timeLine.duration()/4);
- QCOMPARE(timeLine.state(), QTimeLine::Running);
int currentTime = timeLine.currentTime();
+ QTRY_VERIFY(timeLine.currentTime() > currentTime);
+ QCOMPARE(timeLine.state(), QTimeLine::Running);
+ currentTime = timeLine.currentTime();
timeLine.setDirection(QTimeLine::Backward);
- QTest::qWait(timeLine.duration()/4);
- QVERIFY(timeLine.currentTime() < currentTime);
+ QTRY_VERIFY(timeLine.currentTime() < currentTime);
timeLine.stop();
}
@@ -174,11 +161,9 @@ void tst_QTimeLine::duration()
QCOMPARE(timeLine.duration(), 1000);
timeLine.start();
- QTest::qWait(999);
- QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > 900);
- QTest::qWait(100);
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentTime() > 0);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
QCOMPARE(timeLine.currentTime(), 1000);
// The duration shouldn't change
QCOMPARE(timeLine.duration(), 1000);
@@ -187,7 +172,7 @@ void tst_QTimeLine::duration()
void tst_QTimeLine::frameRate()
{
QTimeLine timeLine;
- timeLine.setFrameRange(10, 20);
+ timeLine.setFrameRange(100, 2000);
QCOMPARE(timeLine.updateInterval(), 1000 / 25);
timeLine.setUpdateInterval(1000 / 60);
QCOMPARE(timeLine.updateInterval(), 1000 / 60);
@@ -208,36 +193,32 @@ void tst_QTimeLine::frameRate()
timeLine.start();
QTest::qWait(timeLine.duration()*2);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- QVERIFY(slowCount < spy.count());
+ QVERIFY2(slowCount < spy.count(), QByteArray::number(spy.count()));
}
void tst_QTimeLine::value()
{
- QTimeLine timeLine(2000);
- QVERIFY(timeLine.currentValue() == 0.0);
+ QTimeLine timeLine(5000);
+ QCOMPARE(timeLine.currentValue(), 0.0);
// Default speed
QSignalSpy spy(&timeLine, &QTimeLine::valueChanged);
QVERIFY(spy.isValid());
timeLine.start();
- QTest::qWait(timeLine.duration()/3);
- QVERIFY(timeLine.currentValue() > 0);
- QTest::qWait(timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- qreal currentValue = timeLine.currentValue();
- QVERIFY(currentValue == 1);
+ QTRY_VERIFY(timeLine.currentValue() > 0);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QCOMPARE(timeLine.currentValue(), 1.0);
QVERIFY(spy.count() > 0);
// Reverse should decrease the value
timeLine.setCurrentTime(100);
timeLine.start();
// Let it update on its own
- QTest::qWait(500);
QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentValue());
qreal value = timeLine.currentValue();
timeLine.setDirection(QTimeLine::Backward);
- QTest::qWait(1000);
- QVERIFY(timeLine.currentValue() < value);
+ QTRY_VERIFY(timeLine.currentValue() < value);
timeLine.stop();
}
@@ -251,22 +232,19 @@ void tst_QTimeLine::currentFrame()
QSignalSpy spy(&timeLine, &QTimeLine::frameChanged);
QVERIFY(spy.isValid());
timeLine.start();
- QTest::qWait(timeLine.duration()/3);
- QVERIFY(timeLine.currentFrame() > 10);
- QTest::qWait(timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QTRY_VERIFY(timeLine.currentFrame() > 10);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
QCOMPARE(timeLine.currentFrame(), 20);
// Reverse should decrease the value
timeLine.setCurrentTime(timeLine.duration()/2);
timeLine.start();
// Let it update on its own
- QTest::qWait(timeLine.duration()/4);
QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentTime() > timeLine.duration()/2); // wait for continuation
int value = timeLine.currentFrame();
timeLine.setDirection(QTimeLine::Backward);
- QTest::qWait(timeLine.duration()/2);
- QVERIFY(timeLine.currentFrame() < value);
+ QTRY_VERIFY(timeLine.currentFrame() < value);
timeLine.stop();
}
@@ -505,9 +483,8 @@ void tst_QTimeLine::finished()
QSignalSpy spy(&timeLine, &QTimeLine::finished);
QVERIFY(spy.isValid());
timeLine.start();
- QTest::qWait(timeLine.duration()*2);
+ QTRY_COMPARE(spy.count(), 1);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- QCOMPARE(spy.count(), 1);
spy.clear();
timeLine.start();
@@ -606,16 +583,15 @@ void tst_QTimeLine::resume()
{
QCOMPARE(timeLine.currentTime(), 0);
timeLine.start();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() > 0);
timeLine.stop();
int oldCurrentTime = timeLine.currentTime();
QVERIFY(oldCurrentTime > 0);
QVERIFY(oldCurrentTime < 1000);
timeLine.resume();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() > oldCurrentTime);
timeLine.stop();
int currentTime = timeLine.currentTime();
- QVERIFY(currentTime > oldCurrentTime);
QVERIFY(currentTime < 1000);
}
timeLine.setDirection(QTimeLine::Backward);
@@ -623,13 +599,13 @@ void tst_QTimeLine::resume()
timeLine.setCurrentTime(1000);
QCOMPARE(timeLine.currentTime(), 1000);
timeLine.start();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() < 1000);
timeLine.stop();
int oldCurrentTime = timeLine.currentTime();
QVERIFY(oldCurrentTime < 1000);
QVERIFY(oldCurrentTime > 0);
timeLine.resume();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() < oldCurrentTime);
timeLine.stop();
int currentTime = timeLine.currentTime();
QVERIFY(currentTime < oldCurrentTime);
@@ -643,8 +619,7 @@ void tst_QTimeLine::restart()
timeLine.setFrameRange(0,9);
timeLine.start();
- QTest::qWait(timeLine.duration()*2);
- QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QTRY_COMPARE(timeLine.currentFrame(), timeLine.endFrame());
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
// A restart with the same duration
@@ -652,8 +627,7 @@ void tst_QTimeLine::restart()
QCOMPARE(timeLine.state(), QTimeLine::Running);
QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
QCOMPARE(timeLine.currentTime(), 0);
- QTest::qWait(250);
- QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QTRY_COMPARE(timeLine.currentFrame(), timeLine.endFrame());
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
// Set a smaller duration and restart
@@ -662,8 +636,7 @@ void tst_QTimeLine::restart()
QCOMPARE(timeLine.state(), QTimeLine::Running);
QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
QCOMPARE(timeLine.currentTime(), 0);
- QTest::qWait(250);
- QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QTRY_COMPARE(timeLine.currentFrame(), timeLine.endFrame());
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
// Set a longer duration and restart
diff --git a/tests/auto/corelib/tools/qtimezone/BLACKLIST b/tests/auto/corelib/tools/qtimezone/BLACKLIST
new file mode 100644
index 0000000000..665e78bc08
--- /dev/null
+++ b/tests/auto/corelib/tools/qtimezone/BLACKLIST
@@ -0,0 +1,2 @@
+[tzTest]
+opensuse-13.1
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
index 94d81e0a5a..82f78b2b0b 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -47,10 +47,12 @@ private slots:
void appendCausingRealloc();
void resize();
void realloc();
+ void reverseIterators();
void count();
void first();
void last();
void squeeze();
+ void operators();
void indexOf();
void lastIndexOf();
void contains();
@@ -563,6 +565,21 @@ void tst_QVarLengthArray::realloc()
QVERIFY(reallocTestProceed);
}
+void tst_QVarLengthArray::reverseIterators()
+{
+ QVarLengthArray<int> v;
+ v << 1 << 2 << 3 << 4;
+ QVarLengthArray<int> vr = v;
+ std::reverse(vr.begin(), vr.end());
+ const QVarLengthArray<int> &cvr = vr;
+ QVERIFY(std::equal(v.begin(), v.end(), vr.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), vr.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cvr.rbegin()));
+ QVERIFY(std::equal(vr.rbegin(), vr.rend(), v.begin()));
+ QVERIFY(std::equal(vr.crbegin(), vr.crend(), v.begin()));
+ QVERIFY(std::equal(cvr.rbegin(), cvr.rend(), v.begin()));
+}
+
void tst_QVarLengthArray::count()
{
// tests size(), count() and length(), since they're the same thing
@@ -691,6 +708,49 @@ void tst_QVarLengthArray::squeeze()
QCOMPARE(list.capacity(), sizeOnHeap);
}
+void tst_QVarLengthArray::operators()
+{
+ QVarLengthArray<QString> myvla;
+ myvla << "A" << "B" << "C";
+ QVarLengthArray<QString> myvlatwo;
+ myvlatwo << "D" << "E" << "F";
+ QVarLengthArray<QString> combined;
+ combined << "A" << "B" << "C" << "D" << "E" << "F";
+
+ // !=
+ QVERIFY(myvla != myvlatwo);
+
+ // +=: not provided, emulate
+ //myvla += myvlatwo;
+ Q_FOREACH (const QString &s, myvlatwo)
+ myvla.push_back(s);
+ QCOMPARE(myvla, combined);
+
+ // ==
+ QVERIFY(myvla == combined);
+
+ // <, >, <=, >=
+ QVERIFY(!(myvla < combined));
+ QVERIFY(!(myvla > combined));
+ QVERIFY( myvla <= combined);
+ QVERIFY( myvla >= combined);
+ combined.push_back("G");
+ QVERIFY( myvla < combined);
+ QVERIFY(!(myvla > combined));
+ QVERIFY( myvla <= combined);
+ QVERIFY(!(myvla >= combined));
+ QVERIFY(combined > myvla);
+ QVERIFY(combined >= myvla);
+
+ // []
+ QCOMPARE(myvla[0], QLatin1String("A"));
+ QCOMPARE(myvla[1], QLatin1String("B"));
+ QCOMPARE(myvla[2], QLatin1String("C"));
+ QCOMPARE(myvla[3], QLatin1String("D"));
+ QCOMPARE(myvla[4], QLatin1String("E"));
+ QCOMPARE(myvla[5], QLatin1String("F"));
+}
+
void tst_QVarLengthArray::indexOf()
{
QVarLengthArray<QString> myvec;
diff --git a/tests/auto/corelib/tools/qvector/qvector.pro b/tests/auto/corelib/tools/qvector/qvector.pro
index 22edde3412..c1e0564915 100644
--- a/tests/auto/corelib/tools/qvector/qvector.pro
+++ b/tests/auto/corelib/tools/qvector/qvector.pro
@@ -1,4 +1,5 @@
CONFIG += testcase parallel_test
+contains(QT_CONFIG, c++11):CONFIG += c++11
TARGET = tst_qvector
QT = core testlib
SOURCES = $$PWD/tst_qvector.cpp
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 69da6e450e..87822bca6f 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -86,6 +86,8 @@ private:
}
};
+inline uint qHash(const Movable &key, uint seed = 0) { return qHash(key.i, seed); }
+
QAtomicInt Movable::counter = 0;
QT_BEGIN_NAMESPACE
Q_DECLARE_TYPEINFO(Movable, Q_MOVABLE_TYPE);
@@ -123,6 +125,13 @@ struct Custom {
return i == other.i;
}
+ bool operator<(const Custom &other) const
+ {
+ check(&other);
+ check(this);
+ return i < other.i;
+ }
+
Custom &operator=(const Custom &other)
{
check(&other);
@@ -148,6 +157,8 @@ private:
};
QAtomicInt Custom::counter = 0;
+inline uint qHash(const Custom &key, uint seed = 0) { return qHash(key.i, seed); }
+
Q_DECLARE_METATYPE(Custom);
// tests depends on the fact that:
@@ -179,6 +190,7 @@ private slots:
void appendInt() const;
void appendMovable() const;
void appendCustom() const;
+ void appendRvalue() const;
void at() const;
void capacityInt() const;
void capacityMovable() const;
@@ -187,6 +199,8 @@ private slots:
void clearMovable() const;
void clearCustom() const;
void constData() const;
+ void constFirst() const;
+ void constLast() const;
void contains() const;
void countInt() const;
void countMovable() const;
@@ -227,9 +241,15 @@ private slots:
void last() const;
void lastIndexOf() const;
void mid() const;
+ void moveInt() const;
+ void moveMovable() const;
+ void moveCustom() const;
void prependInt() const;
void prependMovable() const;
void prependCustom() const;
+ void qhashInt() const { qhash<int>(); }
+ void qhashMovable() const { qhash<Movable>(); }
+ void qhashCustom() const { qhash<Custom>(); }
void removeInt() const;
void removeMovable() const;
void removeCustom() const;
@@ -241,6 +261,7 @@ private slots:
void resizeComplex_data() const;
void resizeComplex() const;
void resizeCtorAndDtor() const;
+ void reverseIterators() const;
void sizeInt() const;
void sizeMovable() const;
void sizeCustom() const;
@@ -294,6 +315,8 @@ private:
template<typename T> void fill() const;
template<typename T> void fromList() const;
template<typename T> void insert() const;
+ template<typename T> void qhash() const;
+ template<typename T> void move() const;
template<typename T> void prepend() const;
template<typename T> void remove() const;
template<typename T> void size() const;
@@ -332,6 +355,14 @@ const Movable SimpleValue<Movable>::Values[] = { 110, 105, 101, 114, 111, 98 };
template<>
const Custom SimpleValue<Custom>::Values[] = { 110, 105, 101, 114, 111, 98 };
+// Make some macros for the tests to use in order to be slightly more readable...
+#define T_FOO SimpleValue<T>::at(0)
+#define T_BAR SimpleValue<T>::at(1)
+#define T_BAZ SimpleValue<T>::at(2)
+#define T_CAT SimpleValue<T>::at(3)
+#define T_DOG SimpleValue<T>::at(4)
+#define T_BLAH SimpleValue<T>::at(5)
+
void tst_QVector::constructors_empty() const
{
QVector<int> emptyInt;
@@ -608,6 +639,21 @@ void tst_QVector::appendCustom() const
QCOMPARE(instancesCount, Custom::counter.loadAcquire());
}
+void tst_QVector::appendRvalue() const
+{
+#ifdef Q_COMPILER_RVALUE_REFS
+ QVector<QString> v;
+ v.append("hello");
+ QString world = "world";
+ v.append(std::move(world));
+ QVERIFY(world.isEmpty());
+ QCOMPARE(v.front(), QString("hello"));
+ QCOMPARE(v.back(), QString("world"));
+#else
+ QSKIP("This test requires that C++11 move semantics support is enabled in the compiler");
+#endif
+}
+
void tst_QVector::at() const
{
QVector<QString> myvec;
@@ -1206,16 +1252,86 @@ void tst_QVector::first() const
// test it starts ok
QCOMPARE(myvec.first(), 69);
+ QCOMPARE(myvec.constFirst(), 69);
// test removal changes
myvec.remove(0);
QCOMPARE(myvec.first(), 42);
+ QCOMPARE(myvec.constFirst(), 42);
// test prepend changes
myvec.prepend(23);
QCOMPARE(myvec.first(), 23);
+ QCOMPARE(myvec.constFirst(), 23);
+}
+
+void tst_QVector::constFirst() const
+{
+ QVector<int> myvec;
+ myvec << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(myvec.constFirst(), 69);
+ QVERIFY(myvec.isDetached());
+
+ QVector<int> myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constFirst(), 69);
+ QCOMPARE(myvecCopy.constFirst(), 69);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test removal changes
+ myvec.remove(0);
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constFirst(), 42);
+ QCOMPARE(myvecCopy.constFirst(), 69);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constFirst(), 42);
+ QCOMPARE(myvecCopy.constFirst(), 42);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test prepend changes
+ myvec.prepend(23);
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constFirst(), 23);
+ QCOMPARE(myvecCopy.constFirst(), 42);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constFirst(), 23);
+ QCOMPARE(myvecCopy.constFirst(), 23);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
}
+
template<typename T>
void tst_QVector::fromList() const
{
@@ -1393,14 +1509,83 @@ void tst_QVector::last() const
// test starts ok
QCOMPARE(myvec.last(), QLatin1String("C"));
+ QCOMPARE(myvec.constLast(), QLatin1String("C"));
// test it changes ok
myvec.append(QLatin1String("X"));
QCOMPARE(myvec.last(), QLatin1String("X"));
+ QCOMPARE(myvec.constLast(), QLatin1String("X"));
// and remove again
myvec.remove(3);
QCOMPARE(myvec.last(), QLatin1String("C"));
+ QCOMPARE(myvec.constLast(), QLatin1String("C"));
+}
+
+void tst_QVector::constLast() const
+{
+ QVector<int> myvec;
+ myvec << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(myvec.constLast(), 3);
+ QVERIFY(myvec.isDetached());
+
+ QVector<int> myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constLast(), 3);
+ QCOMPARE(myvecCopy.constLast(), 3);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test removal changes
+ myvec.removeLast();
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constLast(), 42);
+ QCOMPARE(myvecCopy.constLast(), 3);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constLast(), 42);
+ QCOMPARE(myvecCopy.constLast(), 42);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test prepend changes
+ myvec.append(23);
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constLast(), 23);
+ QCOMPARE(myvecCopy.constLast(), 42);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constLast(), 23);
+ QCOMPARE(myvecCopy.constLast(), 23);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
}
void tst_QVector::lastIndexOf() const
@@ -1437,6 +1622,54 @@ void tst_QVector::mid() const
QCOMPARE(list.mid(4), QVector<QString>() << "buck" << "hello" << "kitty");
}
+template <typename T>
+void tst_QVector::qhash() const
+{
+ QVector<T> l1, l2;
+ QCOMPARE(qHash(l1), qHash(l2));
+ l1 << SimpleValue<T>::at(0);
+ l2 << SimpleValue<T>::at(0);
+ QCOMPARE(qHash(l1), qHash(l2));
+}
+
+template <typename T>
+void tst_QVector::move() const
+{
+ QVector<T> list;
+ list << T_FOO << T_BAR << T_BAZ;
+
+ // move an item
+ list.move(0, list.count() - 1);
+ QCOMPARE(list, QVector<T>() << T_BAR << T_BAZ << T_FOO);
+
+ // move it back
+ list.move(list.count() - 1, 0);
+ QCOMPARE(list, QVector<T>() << T_FOO << T_BAR << T_BAZ);
+
+ // move an item in the middle
+ list.move(1, 0);
+ QCOMPARE(list, QVector<T>() << T_BAR << T_FOO << T_BAZ);
+}
+
+void tst_QVector::moveInt() const
+{
+ move<int>();
+}
+
+void tst_QVector::moveMovable() const
+{
+ const int instancesCount = Movable::counter.loadAcquire();
+ move<Movable>();
+ QCOMPARE(instancesCount, Movable::counter.loadAcquire());
+}
+
+void tst_QVector::moveCustom() const
+{
+ const int instancesCount = Custom::counter.loadAcquire();
+ move<Custom>();
+ QCOMPARE(instancesCount, Custom::counter.loadAcquire());
+}
+
template<typename T>
void tst_QVector::prepend() const
{
@@ -1907,6 +2140,21 @@ void tst_QVector::resizeCtorAndDtor() const
QCOMPARE(Custom::counter.loadAcquire(), items);
}
+void tst_QVector::reverseIterators() const
+{
+ QVector<int> v;
+ v << 1 << 2 << 3 << 4;
+ QVector<int> vr = v;
+ std::reverse(vr.begin(), vr.end());
+ const QVector<int> &cvr = vr;
+ QVERIFY(std::equal(v.begin(), v.end(), vr.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), vr.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cvr.rbegin()));
+ QVERIFY(std::equal(vr.rbegin(), vr.rend(), v.begin()));
+ QVERIFY(std::equal(vr.crbegin(), vr.crend(), v.begin()));
+ QVERIFY(std::equal(cvr.rbegin(), cvr.rend(), v.begin()));
+}
+
template<typename T>
void tst_QVector::size() const
{
@@ -2076,6 +2324,19 @@ void tst_QVector::testOperators() const
// ==
QVERIFY(myvec == combined);
+ // <, >, <=, >=
+ QVERIFY(!(myvec < combined));
+ QVERIFY(!(myvec > combined));
+ QVERIFY( myvec <= combined);
+ QVERIFY( myvec >= combined);
+ combined.push_back("G");
+ QVERIFY( myvec < combined);
+ QVERIFY(!(myvec > combined));
+ QVERIFY( myvec <= combined);
+ QVERIFY(!(myvec >= combined));
+ QVERIFY(combined > myvec);
+ QVERIFY(combined >= myvec);
+
// []
QCOMPARE(myvec[0], QLatin1String("A"));
QCOMPARE(myvec[1], QLatin1String("B"));
diff --git a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
index 1e74d42bbd..e83a2b507c 100644
--- a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
+++ b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
@@ -1,4 +1,6 @@
CONFIG += testcase parallel_test
+contains(QT_CONFIG, c++11):CONFIG += c++11
+contains(QT_CONFIG, c++14):CONFIG += c++14
TARGET = tst_qversionnumber
-QT = core-private testlib
+QT = core testlib
SOURCES = tst_qversionnumber.cpp
diff --git a/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp b/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
index 4202b87b2d..0b8b63a1e8 100644
--- a/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
+++ b/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
@@ -33,7 +33,7 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <private/qversionnumber_p.h>
+#include <QtCore/qversionnumber.h>
class tst_QVersionNumber : public QObject
{
diff --git a/tests/auto/corelib/tools/tools.pro b/tests/auto/corelib/tools/tools.pro
index 9024a1a1bb..f9e1c454e7 100644
--- a/tests/auto/corelib/tools/tools.pro
+++ b/tests/auto/corelib/tools/tools.pro
@@ -24,6 +24,7 @@ SUBDIRS=\
qhash \
qhash_strictiterators \
qhashfunctions \
+ qlatin1string \
qline \
qlinkedlist \
qlist \
diff --git a/tests/auto/dbus/dbus.pro b/tests/auto/dbus/dbus.pro
index cd845d7043..67cbc4bfef 100644
--- a/tests/auto/dbus/dbus.pro
+++ b/tests/auto/dbus/dbus.pro
@@ -1,9 +1,16 @@
TEMPLATE=subdirs
+
+# Run this test first
SUBDIRS=\
+ qdbusconnection_delayed
+
+SUBDIRS+=\
qdbusabstractadaptor \
qdbusabstractinterface \
qdbusconnection \
+ qdbusconnection_no_app \
qdbusconnection_no_bus \
+ qdbusconnection_no_libdbus \
qdbuscontext \
qdbusinterface \
qdbuslocalcalls \
@@ -16,7 +23,7 @@ SUBDIRS=\
qdbusservicewatcher \
qdbustype \
qdbusthreading \
- qdbusxmlparser \
+ qdbusxmlparser
!contains(QT_CONFIG,private_tests): SUBDIRS -= \
qdbusmarshall \
diff --git a/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST b/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST
new file mode 100644
index 0000000000..d3d970f4f4
--- /dev/null
+++ b/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST
@@ -0,0 +1,2 @@
+[overloadedSignalEmission]
+linux
diff --git a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
index e51d03c811..d26af847cf 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
@@ -346,7 +346,7 @@ void syncPeer()
// wait for the sync signal with the right ID
QEventLoop loop;
QDBusConnection con("peer");
- con.connect(serviceName, objectPath, interfaceName, "syncReceived",
+ con.connect(QString(), objectPath, interfaceName, "syncReceived",
QStringList() << reqId, QString(), &loop, SLOT(quit()));
QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "requestSync");
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index 403e500d8c..cd23f2cb47 100644
--- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
@@ -1012,8 +1012,14 @@ void tst_QDBusAbstractInterface::followSignal()
QVERIFY(!con.interface()->isServiceRegistered(serviceToFollow));
Pinger control = getPinger("");
- // we need to connect the signal somewhere in order for D-Bus to enable the rules
- QTestEventLoop::instance().connect(p.data(), SIGNAL(voidSignal()), SLOT(exitLoop()));
+ // connect our test signal
+ // FRAGILE CODE AHEAD:
+ // Connection order is important: we connect the control first because that
+ // needs to be delivered last, to ensure that we don't exitLoop() before
+ // the signal delivery to QSignalSpy is posted to the current thread. That
+ // happens because QDBusConnectionPrivate runs in a separate thread and
+ // uses a QMultiHash and insertMulti prepends to the list of items with the
+ // same key.
QTestEventLoop::instance().connect(control.data(), SIGNAL(voidSignal()), SLOT(exitLoop()));
QSignalSpy s(p.data(), SIGNAL(voidSignal()));
diff --git a/tests/auto/dbus/qdbusconnection/qdbusconnection.pro b/tests/auto/dbus/qdbusconnection/qdbusconnection.pro
index 2fd62a234b..83ae29de0a 100644
--- a/tests/auto/dbus/qdbusconnection/qdbusconnection.pro
+++ b/tests/auto/dbus/qdbusconnection/qdbusconnection.pro
@@ -2,4 +2,5 @@ CONFIG += testcase
TARGET = tst_qdbusconnection
QT = core dbus testlib
SOURCES += tst_qdbusconnection.cpp
+HEADERS += tst_qdbusconnection.h
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
index 32c228c186..e91f87d6c8 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -30,34 +31,15 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include "tst_qdbusconnection.h"
+
#include <qcoreapplication.h>
#include <qdebug.h>
#include <QtTest/QtTest>
#include <QtDBus/QtDBus>
-class BaseObject: public QObject
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "local.BaseObject")
-public:
- BaseObject(QObject *parent = 0) : QObject(parent) { }
-public slots:
- void anotherMethod() { }
-};
-
-class MyObject: public BaseObject
-{
- Q_OBJECT
-public slots:
- void method(const QDBusMessage &msg);
-
-public:
- static QString path;
- int callCount;
- MyObject(QObject *parent = 0) : BaseObject(parent), callCount(0) {}
-};
-
void MyObject::method(const QDBusMessage &msg)
{
path = msg.path();
@@ -65,19 +47,6 @@ void MyObject::method(const QDBusMessage &msg)
//qDebug() << msg;
}
-class MyObjectWithoutInterface: public QObject
-{
- Q_OBJECT
-public slots:
- void method(const QDBusMessage &msg);
-
-public:
- static QString path;
- static QString interface;
- int callCount;
- MyObjectWithoutInterface(QObject *parent = 0) : QObject(parent), callCount(0) {}
-};
-
void MyObjectWithoutInterface::method(const QDBusMessage &msg)
{
path = msg.path();
@@ -86,70 +55,6 @@ void MyObjectWithoutInterface::method(const QDBusMessage &msg)
//qDebug() << msg;
}
-class tst_QDBusConnection: public QObject
-{
- Q_OBJECT
-
- int signalsReceived;
-public slots:
- void oneSlot() { ++signalsReceived; }
- void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); }
- void secondCallWithCallback();
-
-private slots:
- void noConnection();
- void connectToBus();
- void connectToPeer();
- void connect();
- void send();
- void sendWithGui();
- void sendAsync();
- void sendSignal();
-
- void registerObject_data();
- void registerObject();
- void registerObjectWithInterface_data();
- void registerObjectWithInterface();
- void registerObjectPeer_data();
- void registerObjectPeer();
- void registerObject2();
- void registerObjectPeer2();
-
- void registerQObjectChildren();
- void registerQObjectChildrenPeer();
-
- void callSelf();
- void callSelfByAnotherName_data();
- void callSelfByAnotherName();
- void multipleInterfacesInQObject();
-
- void slotsWithLessParameters();
- void nestedCallWithCallback();
-
- void serviceRegistrationRaceCondition();
-
- void registerVirtualObject();
- void callVirtualObject();
- void callVirtualObjectLocal();
-
-public:
- QString serviceName() const { return "org.qtproject.Qt.Autotests.QDBusConnection"; }
- bool callMethod(const QDBusConnection &conn, const QString &path);
- bool callMethod(const QDBusConnection &conn, const QString &path, const QString &interface);
- bool callMethodPeer(const QDBusConnection &conn, const QString &path);
-};
-
-class QDBusSpy: public QObject
-{
- Q_OBJECT
-public slots:
- void handlePing(const QString &str) { args.clear(); args << str; }
- void asyncReply(const QDBusMessage &msg) { args = msg.arguments(); }
-
-public:
- QList<QVariant> args;
-};
-
void tst_QDBusConnection::noConnection()
{
QDBusConnection con = QDBusConnection::connectToBus("unix:path=/dev/null", "testconnection");
@@ -185,8 +90,55 @@ void tst_QDBusConnection::sendSignal()
msg << QLatin1String("ping");
QVERIFY(con.send(msg));
+}
+
+void tst_QDBusConnection::sendSignalToName()
+{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication"); // because of the qWait()
+
+ QDBusSpy spy;
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy,
+ SLOT(handlePing(QString)));
+
+ QDBusMessage msg =
+ QDBusMessage::createTargetedSignal(con.baseService(), "/org/kde/selftest",
+ "org.kde.selftest", "ping");
+ msg << QLatin1String("ping");
+
+ QVERIFY(con.send(msg));
+
+ QTest::qWait(1000);
+
+ QCOMPARE(spy.args.count(), 1);
+ QCOMPARE(spy.args.at(0).toString(), QString("ping"));
+}
+
+void tst_QDBusConnection::sendSignalToOtherName()
+{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication"); // because of the qWait()
+
+ QDBusSpy spy;
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy,
+ SLOT(handlePing(QString)));
+
+ QDBusMessage msg =
+ QDBusMessage::createTargetedSignal("some.other.service", "/org/kde/selftest",
+ "org.kde.selftest", "ping");
+ msg << QLatin1String("ping");
+
+ QVERIFY(con.send(msg));
QTest::qWait(1000);
+
+ QCOMPARE(spy.args.count(), 0);
}
void tst_QDBusConnection::send()
@@ -207,6 +159,9 @@ void tst_QDBusConnection::send()
void tst_QDBusConnection::sendWithGui()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
@@ -223,6 +178,9 @@ void tst_QDBusConnection::sendWithGui()
void tst_QDBusConnection::sendAsync()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
@@ -244,6 +202,9 @@ void tst_QDBusConnection::connect()
QDBusConnection con = QDBusConnection::sessionBus();
+ if (!QCoreApplication::instance())
+ return; // cannot receive signals in this thread without QCoreApplication
+
con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy,
SLOT(handlePing(QString)));
@@ -437,58 +398,6 @@ void tst_QDBusConnection::registerObjectWithInterface()
QVERIFY(!callMethod(con, path, interface));
}
-class MyServer : public QDBusServer
-{
- Q_OBJECT
-public:
- MyServer(QString path) : m_path(path), m_connections()
- {
- connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
- }
-
- bool registerObject(const QDBusConnection& c)
- {
- QDBusConnection conn(c);
- if (!conn.registerObject(m_path, &m_obj, QDBusConnection::ExportAllSlots))
- return false;
- if (!(conn.objectRegisteredAt(m_path) == &m_obj))
- return false;
- return true;
- }
-
- bool registerObject()
- {
- Q_FOREACH (const QString &name, m_connections) {
- if (!registerObject(QDBusConnection(name)))
- return false;
- }
- return true;
- }
-
- void unregisterObject()
- {
- Q_FOREACH (const QString &name, m_connections) {
- QDBusConnection c(name);
- c.unregisterObject(m_path);
- }
- }
-
-public slots:
- void handleConnection(const QDBusConnection& c)
- {
- m_connections << c.name();
- QVERIFY(isConnected());
- QVERIFY(c.isConnected());
- QVERIFY(registerObject(c));
- }
-
-private:
- MyObject m_obj;
- QString m_path;
- QStringList m_connections;
-};
-
-
void tst_QDBusConnection::registerObjectPeer_data()
{
QTest::addColumn<QString>("path");
@@ -502,16 +411,22 @@ void tst_QDBusConnection::registerObjectPeer_data()
void tst_QDBusConnection::registerObjectPeer()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QFETCH(QString, path);
MyServer server(path);
QDBusConnection::connectToPeer(server.address(), "beforeFoo");
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
{
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
- QCoreApplication::processEvents();
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(con.isConnected());
MyObject obj;
@@ -520,6 +435,7 @@ void tst_QDBusConnection::registerObjectPeer()
}
QDBusConnection::connectToPeer(server.address(), "afterFoo");
+ QTestEventLoop::instance().enterLoop(2);
{
QDBusConnection con("foo");
@@ -572,7 +488,6 @@ void tst_QDBusConnection::registerObject2()
MyObject obj;
QVERIFY(con.registerObject("/", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(callMethod(con, "/"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/"));
}
// make sure it's gone
@@ -584,7 +499,6 @@ void tst_QDBusConnection::registerObject2()
QVERIFY(con.registerObject("/p1", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(!callMethod(con, "/"));
QVERIFY(callMethod(con, "/p1"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/p1"));
// re-register it somewhere else
@@ -648,38 +562,15 @@ void tst_QDBusConnection::registerObject2()
}
}
-class MyServer2 : public QDBusServer
-{
- Q_OBJECT
-public:
- MyServer2() : m_conn("none")
- {
- connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
- }
-
- QDBusConnection connection()
- {
- return m_conn;
- }
-
-public slots:
- void handleConnection(const QDBusConnection& c)
- {
- m_conn = c;
- QVERIFY(isConnected());
- QVERIFY(m_conn.isConnected());
- }
-
-private:
- MyObject m_obj;
- QDBusConnection m_conn;
-};
-
void tst_QDBusConnection::registerObjectPeer2()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
MyServer2 server;
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
- QCoreApplication::processEvents();
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(con.isConnected());
QDBusConnection srv_con = server.connection();
@@ -696,7 +587,6 @@ void tst_QDBusConnection::registerObjectPeer2()
MyObject obj;
QVERIFY(con.registerObject("/", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(callMethodPeer(srv_con, "/"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/"));
}
// make sure it's gone
@@ -708,7 +598,6 @@ void tst_QDBusConnection::registerObjectPeer2()
QVERIFY(con.registerObject("/p1", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(!callMethodPeer(srv_con, "/"));
QVERIFY(callMethodPeer(srv_con, "/p1"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/p1"));
// re-register it somewhere else
@@ -832,8 +721,13 @@ void tst_QDBusConnection::registerQObjectChildren()
void tst_QDBusConnection::registerQObjectChildrenPeer()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
MyServer2 server;
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
QCoreApplication::processEvents();
QVERIFY(con.isConnected());
@@ -923,22 +817,6 @@ bool tst_QDBusConnection::callMethodPeer(const QDBusConnection &conn, const QStr
return (MyObject::path == path);
}
-class TestObject : public QObject
-{
-Q_OBJECT
-public:
- TestObject(QObject *parent = 0) : QObject(parent) {}
- ~TestObject() {}
-
- QString func;
-
-public slots:
- void test0() { func = "test0"; }
- void test1(int i) { func = "test1 " + QString::number(i); }
- int test2() { func = "test2"; return 43; }
- int test3(int i) { func = "test2"; return i + 1; }
-};
-
void tst_QDBusConnection::callSelf()
{
TestObject testObject;
@@ -975,6 +853,9 @@ void tst_QDBusConnection::callSelfByAnotherName_data()
void tst_QDBusConnection::callSelfByAnotherName()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
static int counter = 0;
QString sname = serviceName() + QString::number(counter++);
@@ -1047,6 +928,9 @@ void tst_QDBusConnection::multipleInterfacesInQObject()
void tst_QDBusConnection::slotsWithLessParameters()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QDBusMessage signal = QDBusMessage::createSignal("/", "org.qtproject.TestCase",
@@ -1073,7 +957,6 @@ void tst_QDBusConnection::slotsWithLessParameters()
void tst_QDBusConnection::secondCallWithCallback()
{
- qDebug("Hello");
QDBusConnection con = QDBusConnection::sessionBus();
QDBusMessage msg = QDBusMessage::createMethodCall(con.baseService(), "/test", QString(),
"test0");
@@ -1082,6 +965,9 @@ void tst_QDBusConnection::secondCallWithCallback()
void tst_QDBusConnection::nestedCallWithCallback()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
TestObject testObject;
QDBusConnection connection = QDBusConnection::sessionBus();
QVERIFY(connection.registerObject("/test", &testObject,
@@ -1097,22 +983,11 @@ void tst_QDBusConnection::nestedCallWithCallback()
QCOMPARE(signalsReceived, 1);
}
-class RaceConditionSignalWaiter : public QObject
-{
- Q_OBJECT
-public:
- int count;
- RaceConditionSignalWaiter() : count (0) {}
- virtual ~RaceConditionSignalWaiter() {}
-
-public slots:
- void countUp() { ++count; emit done(); }
-signals:
- void done();
-};
-
void tst_QDBusConnection::serviceRegistrationRaceCondition()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
// There was a race condition in the updating of list of name owners in
// Qt D-Bus. When the user connects to a signal coming from a given
// service, we must listen for NameOwnerChanged signals relevant to that
@@ -1164,39 +1039,6 @@ void tst_QDBusConnection::serviceRegistrationRaceCondition()
QCOMPARE(recv.count, 1);
}
-class VirtualObject: public QDBusVirtualObject
-{
- Q_OBJECT
-public:
- VirtualObject() :success(true) {}
-
- QString introspect(const QString & /* path */) const
- {
- return QString();
- }
-
- bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) {
- ++callCount;
- lastMessage = message;
-
- if (success) {
- QDBusMessage reply = message.createReply(replyArguments);
- connection.send(reply);
- }
- emit messageReceived(message);
- return success;
- }
-signals:
- void messageReceived(const QDBusMessage &message) const;
-
-public:
- mutable QDBusMessage lastMessage;
- QVariantList replyArguments;
- mutable int callCount;
- bool success;
-};
-
-
void tst_QDBusConnection::registerVirtualObject()
{
QDBusConnection con = QDBusConnection::sessionBus();
@@ -1279,6 +1121,9 @@ void tst_QDBusConnection::registerVirtualObject()
void tst_QDBusConnection::callVirtualObject()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
@@ -1336,7 +1181,6 @@ void tst_QDBusConnection::callVirtualObject()
QVERIFY(!QTestEventLoop::instance().timeout());
QTest::qWait(100);
QVERIFY(errorReply.isError());
- qDebug() << errorReply.reply().arguments();
QCOMPARE(errorReply.reply().errorName(), QString("org.freedesktop.DBus.Error.UnknownObject"));
QDBusConnection::disconnectFromBus("con2");
@@ -1377,7 +1221,7 @@ void tst_QDBusConnection::callVirtualObjectLocal()
QString MyObject::path;
QString MyObjectWithoutInterface::path;
QString MyObjectWithoutInterface::interface;
-QTEST_MAIN(tst_QDBusConnection)
-
-#include "tst_qdbusconnection.moc"
+#ifndef tst_QDBusConnection
+QTEST_MAIN(tst_QDBusConnection)
+#endif
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
new file mode 100644
index 0000000000..a53ba320f8
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
@@ -0,0 +1,287 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 TST_QDBUSCONNECTION_H
+#define TST_QDBUSCONNECTION_H
+
+#include <QObject>
+#include <QtDBus/QtDBus>
+#include <QtTest/QtTest>
+
+class BaseObject: public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "local.BaseObject")
+public:
+ BaseObject(QObject *parent = 0) : QObject(parent) { }
+public slots:
+ void anotherMethod() { }
+};
+
+class MyObject: public BaseObject
+{
+ Q_OBJECT
+public slots:
+ void method(const QDBusMessage &msg);
+
+public:
+ static QString path;
+ int callCount;
+ MyObject(QObject *parent = 0) : BaseObject(parent), callCount(0) {}
+};
+
+class MyObjectWithoutInterface: public QObject
+{
+ Q_OBJECT
+public slots:
+ void method(const QDBusMessage &msg);
+
+public:
+ static QString path;
+ static QString interface;
+ int callCount;
+ MyObjectWithoutInterface(QObject *parent = 0) : QObject(parent), callCount(0) {}
+};
+
+class tst_QDBusConnection: public QObject
+{
+ Q_OBJECT
+
+ int signalsReceived;
+public slots:
+ void oneSlot() { ++signalsReceived; }
+ void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); }
+ void secondCallWithCallback();
+
+private slots:
+ void noConnection();
+ void connectToBus();
+ void connectToPeer();
+ void connect();
+ void send();
+ void sendWithGui();
+ void sendAsync();
+ void sendSignal();
+ void sendSignalToName();
+ void sendSignalToOtherName();
+
+ void registerObject_data();
+ void registerObject();
+ void registerObjectWithInterface_data();
+ void registerObjectWithInterface();
+ void registerObjectPeer_data();
+ void registerObjectPeer();
+ void registerObject2();
+ void registerObjectPeer2();
+
+ void registerQObjectChildren();
+ void registerQObjectChildrenPeer();
+
+ void callSelf();
+ void callSelfByAnotherName_data();
+ void callSelfByAnotherName();
+ void multipleInterfacesInQObject();
+
+ void slotsWithLessParameters();
+ void nestedCallWithCallback();
+
+ void serviceRegistrationRaceCondition();
+
+ void registerVirtualObject();
+ void callVirtualObject();
+ void callVirtualObjectLocal();
+
+public:
+ QString serviceName() const { return "org.qtproject.Qt.Autotests.QDBusConnection"; }
+ bool callMethod(const QDBusConnection &conn, const QString &path);
+ bool callMethod(const QDBusConnection &conn, const QString &path, const QString &interface);
+ bool callMethodPeer(const QDBusConnection &conn, const QString &path);
+};
+
+class QDBusSpy: public QObject
+{
+ Q_OBJECT
+public slots:
+ void handlePing(const QString &str) { args.clear(); args << str; }
+ void asyncReply(const QDBusMessage &msg) { args = msg.arguments(); }
+
+public:
+ QList<QVariant> args;
+};
+
+class MyServer : public QDBusServer
+{
+ Q_OBJECT
+public:
+ MyServer(QString path) : m_path(path), m_connections()
+ {
+ connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
+ }
+
+ bool registerObject(const QDBusConnection& c)
+ {
+ QDBusConnection conn(c);
+ if (!conn.registerObject(m_path, &m_obj, QDBusConnection::ExportAllSlots))
+ return false;
+ if (!(conn.objectRegisteredAt(m_path) == &m_obj))
+ return false;
+ return true;
+ }
+
+ bool registerObject()
+ {
+ Q_FOREACH (const QString &name, m_connections) {
+ if (!registerObject(QDBusConnection(name)))
+ return false;
+ }
+ return true;
+ }
+
+ void unregisterObject()
+ {
+ Q_FOREACH (const QString &name, m_connections) {
+ QDBusConnection c(name);
+ c.unregisterObject(m_path);
+ }
+ }
+
+public slots:
+ void handleConnection(const QDBusConnection& c)
+ {
+ m_connections << c.name();
+ QVERIFY(isConnected());
+ QVERIFY(c.isConnected());
+ QVERIFY(registerObject(c));
+ QTestEventLoop::instance().exitLoop();
+ }
+
+private:
+ MyObject m_obj;
+ QString m_path;
+ QStringList m_connections;
+};
+
+class MyServer2 : public QDBusServer
+{
+ Q_OBJECT
+public:
+ MyServer2() : m_conn("none")
+ {
+ connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
+ }
+
+ QDBusConnection connection()
+ {
+ return m_conn;
+ }
+
+public slots:
+ void handleConnection(const QDBusConnection& c)
+ {
+ m_conn = c;
+ QVERIFY(isConnected());
+ QVERIFY(m_conn.isConnected());
+ QTestEventLoop::instance().exitLoop();
+ }
+
+private:
+ MyObject m_obj;
+ QDBusConnection m_conn;
+};
+
+class TestObject : public QObject
+{
+Q_OBJECT
+public:
+ TestObject(QObject *parent = 0) : QObject(parent) {}
+ ~TestObject() {}
+
+ QString func;
+
+public slots:
+ void test0() { func = "test0"; }
+ void test1(int i) { func = "test1 " + QString::number(i); }
+ int test2() { func = "test2"; return 43; }
+ int test3(int i) { func = "test2"; return i + 1; }
+};
+
+class RaceConditionSignalWaiter : public QObject
+{
+ Q_OBJECT
+public:
+ int count;
+ RaceConditionSignalWaiter() : count (0) {}
+ virtual ~RaceConditionSignalWaiter() {}
+
+public slots:
+ void countUp() { ++count; emit done(); }
+signals:
+ void done();
+};
+
+class VirtualObject: public QDBusVirtualObject
+{
+ Q_OBJECT
+public:
+ VirtualObject() :success(true) {}
+
+ QString introspect(const QString & /* path */) const
+ {
+ return QString();
+ }
+
+ bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) {
+ ++callCount;
+ lastMessage = message;
+
+ if (success) {
+ QDBusMessage reply = message.createReply(replyArguments);
+ connection.send(reply);
+ }
+ emit messageReceived(message);
+ return success;
+ }
+signals:
+ void messageReceived(const QDBusMessage &message) const;
+
+public:
+ mutable QDBusMessage lastMessage;
+ QVariantList replyArguments;
+ mutable int callCount;
+ bool success;
+};
+
+
+#endif // TST_QDBUSCONNECTION_H
+
diff --git a/tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro b/tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro
new file mode 100644
index 0000000000..71a75c644d
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qdbusconnection_delayed
+QT = core dbus testlib
+SOURCES += tst_qdbusconnection_delayed.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp b/tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp
new file mode 100644
index 0000000000..c4f3063169
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QtDBus>
+#include <QtTest>
+
+#ifdef Q_OS_WIN
+# include <process.h>
+# define getpid _getpid
+#else
+# include <sys/types.h>
+# include <unistd.h>
+#endif
+
+class tst_QDBusConnection_Delayed : public QObject
+{
+ Q_OBJECT
+private slots:
+ void delayedMessages();
+};
+
+class Foo : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.qtproject.tst_qdbusconnection_delayed.Foo")
+public slots:
+ int bar() { return 42; }
+};
+
+static bool executedOnce = false;
+
+void tst_QDBusConnection_Delayed::delayedMessages()
+{
+ if (executedOnce)
+ QSKIP("This test can only be executed once");
+ executedOnce = true;
+
+ int argc = 1;
+ char *argv[] = { const_cast<char *>("tst_qdbusconnection_delayed"), 0 };
+ QCoreApplication app(argc, argv);
+
+ QDBusConnection session = QDBusConnection::sessionBus();
+ QVERIFY(session.isConnected());
+ QVERIFY(!session.baseService().isEmpty());
+
+ QDBusConnection other = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "other");
+ QVERIFY(other.isConnected());
+ QVERIFY(!other.baseService().isEmpty());
+
+ // make a method call: those should work even if delivery is disabled
+ QVERIFY(session.interface()->isServiceRegistered(other.baseService()));
+
+ // acquire a name in the main session bus connection: the effect is immediate
+ QString name = "org.qtproject.tst_qdbusconnection_delayed-" +
+ QString::number(getpid());
+ QVERIFY(session.registerService(name));
+ QVERIFY(other.interface()->isServiceRegistered(name));
+
+ // make an asynchronous call to a yet-unregistered object
+ QDBusPendingCallWatcher pending(other.asyncCall(QDBusMessage::createMethodCall(name, "/foo", QString(), "bar")));
+
+ // sleep the main thread without running the event loop;
+ // the call must not be delivered
+ QTest::qSleep(1000);
+ QVERIFY(!pending.isFinished());
+
+ // now register the object
+ Foo foo;
+ session.registerObject("/foo", &foo, QDBusConnection::ExportAllSlots);
+
+ connect(&pending, &QDBusPendingCallWatcher::finished,
+ &QTestEventLoop::instance(), &QTestEventLoop::exitLoop);
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(pending.isFinished());
+ QVERIFY2(!pending.isError(), pending.error().name().toLatin1());
+ QVERIFY(!pending.reply().arguments().isEmpty());
+ QCOMPARE(pending.reply().arguments().at(0), QVariant(42));
+}
+
+QTEST_APPLESS_MAIN(tst_QDBusConnection_Delayed)
+
+#include "tst_qdbusconnection_delayed.moc"
diff --git a/tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro b/tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro
new file mode 100644
index 0000000000..ba3a13caa9
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro
@@ -0,0 +1,6 @@
+CONFIG += testcase
+TARGET = tst_qdbusconnection_no_app
+QT = core dbus testlib
+SOURCES += tst_qdbusconnection_no_app.cpp
+HEADERS += ../qdbusconnection/tst_qdbusconnection.h
+DEFINES += SRCDIR=\\\"$$PWD/\\\" tst_QDBusConnection=tst_QDBusConnection_NoApplication
diff --git a/tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp b/tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp
new file mode 100644
index 0000000000..816f75f82e
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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$
+**
+****************************************************************************/
+
+// Ugly hack, look away
+#include "../qdbusconnection/tst_qdbusconnection.cpp"
+
+QTEST_APPLESS_MAIN(tst_QDBusConnection_NoApplication)
diff --git a/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro b/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro
index 7b15a4fb81..57712f0689 100644
--- a/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro
+++ b/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusconnection_no_bus
QT = core dbus testlib
SOURCES += tst_qdbusconnection_no_bus.cpp
diff --git a/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp b/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
index 21f8f11f80..5a74096059 100644
--- a/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
+++ b/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
@@ -52,7 +52,9 @@ public:
tst_QDBusConnectionNoBus()
{
qputenv("DBUS_SESSION_BUS_ADDRESS", "unix:abstract=/tmp/does_not_exist");
+#ifdef SIMULATE_LOAD_FAIL
qputenv("QT_SIMULATE_DBUS_LIBFAIL", "1");
+#endif
}
private slots:
@@ -67,7 +69,7 @@ void tst_QDBusConnectionNoBus::connectToBus()
QDBusConnection con = QDBusConnection::sessionBus();
- QVERIFY(true); // if we didn't crash here, the test passed :)
+ QVERIFY(!con.isConnected()); // if we didn't crash here, the test passed :)
}
QTEST_APPLESS_MAIN(tst_QDBusConnectionNoBus)
diff --git a/tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro b/tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro
new file mode 100644
index 0000000000..cb0eab1a18
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qdbusconnection_no_libdbus
+QT = core dbus testlib
+DEFINES += SIMULATE_LOAD_FAIL
+SOURCES += ../qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
diff --git a/tests/auto/dbus/qdbusmarshall/BLACKLIST b/tests/auto/dbus/qdbusmarshall/BLACKLIST
new file mode 100644
index 0000000000..036378d204
--- /dev/null
+++ b/tests/auto/dbus/qdbusmarshall/BLACKLIST
@@ -0,0 +1,3 @@
+[receiveUnknownType]
+ubuntu-14.04
+opensuse-13.1
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index 16314a5dc5..57fd5084be 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -150,7 +150,11 @@ int tst_QDBusMarshall::fileDescriptorForTest()
{
if (!tempFile.isOpen()) {
tempFile.setFileTemplate(QDir::tempPath() + "/qdbusmarshalltestXXXXXX.tmp");
- tempFile.open();
+ if (!tempFile.open()) {
+ qWarning("%s: Cannot create temporary file: %s", Q_FUNC_INFO,
+ qPrintable(tempFile.errorString()));
+ return 0;
+ }
}
return tempFile.handle();
}
@@ -869,7 +873,7 @@ void tst_QDBusMarshall::sendSignalErrors()
"signalName");
msg << QVariant::fromValue(QDBusObjectPath());
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
QVERIFY(!con.send(msg));
msg.setArguments(QVariantList());
@@ -879,19 +883,19 @@ void tst_QDBusMarshall::sendSignalErrors()
path.setPath("abc");
msg << QVariant::fromValue(path);
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
QVERIFY(!con.send(msg));
QDBusSignature sig;
msg.setArguments(QVariantList() << QVariant::fromValue(sig));
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
QVERIFY(!con.send(msg));
QTest::ignoreMessage(QtWarningMsg, "QDBusSignature: invalid signature \"a\"");
sig.setSignature("a");
msg.setArguments(QVariantList());
msg << QVariant::fromValue(sig);
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
QVERIFY(!con.send(msg));
}
@@ -1079,7 +1083,7 @@ static bool canSendUnixFd(DBusConnection *connection)
# if DBUS_VERSION-0 >= 0x010400
can_send_type = dbus_connection_can_send_type;
# endif
-#else
+#elif !defined(QT_NO_LIBRARY)
// run-time check if the next functions are available
can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
#endif
diff --git a/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro b/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro
index c0b38cf478..26dd58a010 100644
--- a/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro
+++ b/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusmetaobject
QT = core dbus-private testlib
SOURCES += tst_qdbusmetaobject.cpp
diff --git a/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro b/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro
index aef9bc73cb..ac020b435a 100644
--- a/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro
+++ b/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusmetatype
QT = core dbus testlib
SOURCES += tst_qdbusmetatype.cpp
diff --git a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
index 9c334f77a2..cc12ef8bcc 100644
--- a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
+++ b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -172,10 +173,6 @@ QDBusPendingCall tst_QDBusPendingCall::sendError()
void tst_QDBusPendingCall::waitForFinished()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(!ac.isError());
@@ -195,10 +192,6 @@ void tst_QDBusPendingCall::waitForFinished()
void tst_QDBusPendingCall::waitForFinished_error()
{
QDBusPendingCall ac = sendError();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(ac.isError());
@@ -254,10 +247,6 @@ void tst_QDBusPendingCall::callWithCallback_localLoop_errorReply()
void tst_QDBusPendingCall::watcher()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
@@ -284,10 +273,6 @@ void tst_QDBusPendingCall::watcher()
void tst_QDBusPendingCall::watcher_error()
{
QDBusPendingCall ac = sendError();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
@@ -312,10 +297,6 @@ void tst_QDBusPendingCall::watcher_error()
void tst_QDBusPendingCall::watcher_waitForFinished()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
@@ -391,10 +372,6 @@ void tst_QDBusPendingCall::watcher_waitForFinished_threaded()
void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(!ac.isError());
@@ -425,10 +402,6 @@ void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished()
void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished_eventLoop()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(!ac.isError());
@@ -462,10 +435,6 @@ void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished_eventLoop()
void tst_QDBusPendingCall::watcher_waitForFinished_error()
{
QDBusPendingCall ac = sendError();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
diff --git a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
index 9dd2e4bb83..e7fa1e6484 100644
--- a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
+++ b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
@@ -49,8 +49,11 @@ private slots:
void watchForCreation();
void watchForDisappearance();
+ void watchForDisappearanceUniqueConnection();
void watchForOwnerChange();
void modeChange();
+ void disconnectedConnection();
+ void setConnection();
};
tst_QDBusServiceWatcher::tst_QDBusServiceWatcher()
@@ -155,6 +158,40 @@ void tst_QDBusServiceWatcher::watchForDisappearance()
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
}
+void tst_QDBusServiceWatcher::watchForDisappearanceUniqueConnection()
+{
+ QDBusConnection con = QDBusConnection::sessionBus();
+ QVERIFY(con.isConnected());
+
+ // second connection
+ QString watchedName = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session2").baseService();
+ QVERIFY(!watchedName.isEmpty());
+
+ QDBusServiceWatcher watcher(watchedName, con, QDBusServiceWatcher::WatchForUnregistration);
+ watcher.setObjectName("watcher for disappearance");
+
+ QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString)));
+ QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString)));
+ QSignalSpy spyO(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)));
+ QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceUnregistered(QString)), SLOT(exitLoop()));
+
+ // unregister it:
+ QDBusConnection::disconnectFromBus("session2");
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spyR.count(), 0);
+
+ QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.at(0).at(0).toString(), watchedName);
+
+ QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.at(0).at(0).toString(), watchedName);
+ QCOMPARE(spyO.at(0).at(1).toString(), watchedName);
+ QVERIFY(spyO.at(0).at(2).toString().isEmpty());
+}
+
void tst_QDBusServiceWatcher::watchForOwnerChange()
{
QDBusConnection con = QDBusConnection::sessionBus();
@@ -263,5 +300,72 @@ void tst_QDBusServiceWatcher::modeChange()
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
}
+void tst_QDBusServiceWatcher::disconnectedConnection()
+{
+ QDBusConnection con("");
+ QVERIFY(!con.isConnected());
+
+ QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration);
+ watcher.addWatchedService("com.example.somethingelse");
+ watcher.addWatchedService("org.freedesktop.DBus");
+
+ watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
+ watcher.setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);
+
+ watcher.setWatchedServices(QStringList());
+}
+
+void tst_QDBusServiceWatcher::setConnection()
+{
+ // begin with a disconnected connection
+ QDBusConnection con("");
+ QVERIFY(!con.isConnected());
+
+ QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration);
+
+ QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString)));
+ QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString)));
+ QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)), SLOT(exitLoop()));
+
+ // move to the session bus
+ con = QDBusConnection::sessionBus();
+ QVERIFY(con.isConnected());
+ watcher.setConnection(con);
+
+ // register a name
+ QVERIFY(con.registerService(serviceName));
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.at(0).at(0).toString(), serviceName);
+ QCOMPARE(spyU.count(), 0);
+
+ // is the system bus available?
+ if (!QDBusConnection::systemBus().isConnected())
+ return;
+
+ // connect to the system bus and ask to watch that base service
+ QString watchedName = QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system2").baseService();
+ watcher.setWatchedServices(QStringList() << watchedName);
+ watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
+
+ // move to the system bus
+ watcher.setConnection(QDBusConnection::systemBus());
+ spyR.clear();
+ spyU.clear();
+
+ QDBusConnection::disconnectFromBus("system2");
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spyR.count(), 0);
+
+ QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.at(0).at(0).toString(), watchedName);
+}
+
QTEST_MAIN(tst_QDBusServiceWatcher)
#include "tst_qdbusservicewatcher.moc"
diff --git a/tests/auto/dbus/qdbustype/qdbustype.pro b/tests/auto/dbus/qdbustype/qdbustype.pro
index 21df33d2c7..7db87d279e 100644
--- a/tests/auto/dbus/qdbustype/qdbustype.pro
+++ b/tests/auto/dbus/qdbustype/qdbustype.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbustype
QT = core-private dbus-private testlib
SOURCES += tst_qdbustype.cpp
diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
index 63444b61ad..4408729e7c 100644
--- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
+++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
@@ -94,7 +94,11 @@ static void addFixedTypes()
// the library recognizes this as valid type first.
// The following function was added for Unix FD support, so if it is
// present, so is support for Unix FDs.
+# ifndef QT_NO_LIBRARY
bool supportsUnixFds = qdbus_resolve_conditionally("dbus_connection_can_send_type");
+# else
+ bool supportsUnixFds = false;
+# endif
# else
bool supportsUnixFds = true;
# endif
diff --git a/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro b/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro
index a7186c341b..6cdd09007c 100644
--- a/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro
+++ b/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusxmlparser
QT = core-private dbus-private xml testlib
SOURCES += tst_qdbusxmlparser.cpp
diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
index 4dbe0aae7d..c57292b7db 100644
--- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
+++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
@@ -64,15 +64,10 @@ private slots:
void properties();
};
-QT_BEGIN_NAMESPACE
-// Avoid QHash randomization so that the order of the XML attributes is stable
-extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-QT_END_NAMESPACE
-
void tst_QDBusXmlParser::initTestCase()
{
// Always initialize the hash seed to 0 to get reliable test results
- qt_qhash_seed.store(0);
+ qSetGlobalQHashSeed(0);
}
void tst_QDBusXmlParser::parsing_data()
diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
index d2fae0e5e3..bff762fd04 100644
--- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
+++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
@@ -324,6 +324,11 @@ void tst_QIcoImageFormat::pngCompression()
QImage image;
reader.jumpToImage(index);
+
+ QSize size = reader.size();
+ QCOMPARE(size.width(), width);
+ QCOMPARE(size.height(), height);
+
reader.read(&image);
QCOMPARE(image.width(), width);
diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp
index 20a08e10a2..7333dd739f 100644
--- a/tests/auto/gui/image/qicon/tst_qicon.cpp
+++ b/tests/auto/gui/image/qicon/tst_qicon.cpp
@@ -53,6 +53,7 @@ private slots:
void actualSize2_data(); // test with 2 pixmaps with different aspect ratio
void actualSize2();
void isNull();
+ void isMask();
void swap();
void bestMatch();
void cacheKey();
@@ -75,14 +76,8 @@ private:
const QString m_pngImageFileName;
const QString m_pngRectFileName;
const QString m_sourceFileName;
-
- const static QIcon staticIcon;
};
-// Creating an icon statically should not cause a crash.
-// But we do not officially support this. See QTBUG-8666
-const QIcon tst_QIcon::staticIcon = QIcon::fromTheme("edit-find");
-
bool tst_QIcon::haveImageFormat(QByteArray const& desiredFormat)
{
return QImageReader::supportedImageFormats().contains(desiredFormat);
@@ -224,6 +219,20 @@ void tst_QIcon::isNull() {
QVERIFY(iconSupportedFormat.actualSize(QSize(32, 32)).isValid());
}
+void tst_QIcon::isMask()
+{
+ QIcon icon;
+ icon.setIsMask(true);
+ icon.addPixmap(QPixmap());
+ QVERIFY(icon.isMask());
+
+ QIcon icon2;
+ icon2.setIsMask(true);
+ QVERIFY(icon2.isMask());
+ icon2.setIsMask(false);
+ QVERIFY(!icon2.isMask());
+}
+
void tst_QIcon::swap()
{
QPixmap p1(1, 1), p2(2, 2);
@@ -354,10 +363,10 @@ void tst_QIcon::cacheKey()
qint64 icon1_key = icon1.cacheKey();
QIcon icon2 = icon1;
- QVERIFY(icon2.cacheKey() == icon1.cacheKey());
+ QCOMPARE(icon2.cacheKey(), icon1.cacheKey());
icon2.detach();
QVERIFY(icon2.cacheKey() != icon1.cacheKey());
- QVERIFY(icon1.cacheKey() == icon1_key);
+ QCOMPARE(icon1.cacheKey(), icon1_key);
}
void tst_QIcon::detach()
@@ -374,7 +383,7 @@ void tst_QIcon::detach()
img1 = icon1.pixmap(32, 32).toImage();
img2 = icon2.pixmap(32, 32).toImage();
- QVERIFY(img1 == img2);
+ QCOMPARE(img1, img2);
}
void tst_QIcon::addFile()
@@ -562,7 +571,7 @@ void tst_QIcon::fromTheme()
QString firstSearchPath = QLatin1String(":/icons");
QString secondSearchPath = QLatin1String(":/second_icons");
QIcon::setThemeSearchPaths(QStringList() << firstSearchPath << secondSearchPath);
- QVERIFY(QIcon::themeSearchPaths().size() == 2);
+ QCOMPARE(QIcon::themeSearchPaths().size(), 2);
QCOMPARE(firstSearchPath, QIcon::themeSearchPaths()[0]);
QCOMPARE(secondSearchPath, QIcon::themeSearchPaths()[1]);
@@ -599,7 +608,7 @@ void tst_QIcon::fromTheme()
// Test non existing icon with fallback
noIcon = QIcon::fromTheme("broken-icon", abIcon);
- QVERIFY(noIcon.cacheKey() == abIcon.cacheKey());
+ QCOMPARE(noIcon.cacheKey(), abIcon.cacheKey());
// Test svg-only icon
noIcon = QIcon::fromTheme("svg-icon", abIcon);
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 939226e2b0..23ddfbdd58 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -196,6 +196,8 @@ private slots:
void metadataPassthrough();
+ void pixelColor();
+
private:
const QString m_prefix;
};
@@ -478,7 +480,7 @@ void tst_QImage::setAlphaChannel()
image.setAlphaChannel(alphaChannel);
image = image.convertToFormat(QImage::Format_ARGB32);
- QVERIFY(image.format() == QImage::Format_ARGB32);
+ QCOMPARE(image.format(), QImage::Format_ARGB32);
// alpha of 0 becomes black at a=0 due to premultiplication
QRgb pixel = alpha == 0 ? 0 : qRgba(red, green, blue, alpha);
@@ -1565,12 +1567,12 @@ void tst_QImage::createHeuristicMask()
// line 2
QVERIFY(newMask.pixel(0,1) != newMask.pixel(1,1));
- QVERIFY(newMask.pixel(1,1) == newMask.pixel(2,1));
+ QCOMPARE(newMask.pixel(1,1), newMask.pixel(2,1));
QVERIFY(newMask.pixel(2,1) != newMask.pixel(3,1));
// line 3
QVERIFY(newMask.pixel(0,2) != newMask.pixel(1,2));
- QVERIFY(newMask.pixel(1,2) == newMask.pixel(2,2));
+ QCOMPARE(newMask.pixel(1,2), newMask.pixel(2,2));
QVERIFY(newMask.pixel(2,2) != newMask.pixel(3,2));
}
#endif
@@ -1581,10 +1583,10 @@ void tst_QImage::cacheKey()
qint64 image1_key = image1.cacheKey();
QImage image2 = image1;
- QVERIFY(image2.cacheKey() == image1.cacheKey());
+ QCOMPARE(image2.cacheKey(), image1.cacheKey());
image2.detach();
QVERIFY(image2.cacheKey() != image1.cacheKey());
- QVERIFY(image1.cacheKey() == image1_key);
+ QCOMPARE(image1.cacheKey(), image1_key);
}
void tst_QImage::smoothScale()
@@ -3020,5 +3022,21 @@ void tst_QImage::metadataPassthrough()
QCOMPARE(swapped.devicePixelRatio(), a.devicePixelRatio());
}
+void tst_QImage::pixelColor()
+{
+ QImage argb32(1, 1, QImage::Format_ARGB32);
+ QImage argb32pm(1, 1, QImage::Format_ARGB32_Premultiplied);
+
+ QColor c(Qt::red);
+ c.setAlpha(128);
+ argb32.setPixelColor(QPoint(0, 0), c);
+ argb32pm.setPixelColor(QPoint(0, 0), c);
+ QCOMPARE(argb32.pixelColor(QPoint(0, 0)), c);
+ QCOMPARE(argb32pm.pixelColor(QPoint(0, 0)), c);
+
+ QImage t = argb32.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(t.pixel(0,0), argb32pm.pixel(0,0));
+}
+
QTEST_GUILESS_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/gui/image/qimagereader/images/longcomment.pgm b/tests/auto/gui/image/qimagereader/images/longcomment.pgm
new file mode 100644
index 0000000000..a5624b6c73
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/longcomment.pgm
@@ -0,0 +1,12 @@
+P2
+# A short comment
+# A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment
+24 7
+15
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
+0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
+0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
+0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
+0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 4b3e2606fd..86dd8c4daf 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -36,7 +36,6 @@
#include <QBuffer>
#include <QDebug>
-#include <QFile>
#include <QImage>
#include <QImageReader>
#include <QImageWriter>
@@ -46,6 +45,7 @@
#include <QTcpServer>
#include <QTimer>
#include <QTemporaryDir>
+#include <QTemporaryFile>
#include <algorithm>
@@ -53,6 +53,22 @@ typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QImage::Format)
+static QByteArray msgFileOpenWriteFailed(const QFile &file)
+{
+ const QString result = QLatin1String("Cannot open \"")
+ + QDir::toNativeSeparators(file.fileName())
+ + QLatin1String("\" for writing: ") + file.errorString();
+ return result.toLocal8Bit();
+}
+
+static QByteArray msgFileOpenReadFailed(const QFile &file)
+{
+ const QString result = QLatin1String("Cannot open \"")
+ + QDir::toNativeSeparators(file.fileName())
+ + QLatin1String("\" for reading: ") + file.errorString();
+ return result.toLocal8Bit();
+}
+
class tst_QImageReader : public QObject
{
Q_OBJECT
@@ -194,7 +210,7 @@ void tst_QImageReader::initTestCase()
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
- QVERIFY(m_temporaryDir.isValid());
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
}
void tst_QImageReader::cleanupTestCase()
@@ -224,6 +240,7 @@ void tst_QImageReader::readImage_data()
QTest::newRow("PPM: runners") << QString("runners.ppm") << true << QByteArray("ppm");
QTest::newRow("PPM: test") << QString("test.ppm") << true << QByteArray("ppm");
QTest::newRow("XBM: gnus") << QString("gnus.xbm") << true << QByteArray("xbm");
+ QTest::newRow("PGM: longcomment") << QString("longcomment.pgm") << true << QByteArray("pgm");
QTest::newRow("JPEG: beavis") << QString("beavis.jpg") << true << QByteArray("jpeg");
QTest::newRow("JPEG: qtbug13653") << QString("qtbug13653-no_eoi.jpg") << true << QByteArray("jpeg");
@@ -733,7 +750,7 @@ void tst_QImageReader::gifHandlerBugs()
QVERIFY(io.loopCount() != 1);
int count=0;
for (; io.canRead(); io.read(), ++count) ;
- QVERIFY(count == 34);
+ QCOMPARE(count, 34);
}
// Task 95166
@@ -810,7 +827,7 @@ void tst_QImageReader::gifImageCount()
QVERIFY(io.canRead());
QImage greenFrame = io.read();
- QVERIFY(io.imageCount() == 4);
+ QCOMPARE(io.imageCount(), 4);
QVERIFY(io.canRead());
QImage blueFrame = io.read();
@@ -925,8 +942,8 @@ void tst_QImageReader::gifImageCount()
}
{
QImageReader io(":images/trolltech.gif");
- QVERIFY(io.imageCount() == 34);
- QVERIFY(io.size() == QSize(128,64));
+ QCOMPARE(io.imageCount(), 34);
+ QCOMPARE(io.size(), QSize(128,64));
}
}
@@ -1050,7 +1067,7 @@ void tst_QImageReader::readFromDevice()
const QString imageFileName = prefix + fileName;
QImage expectedImage(imageFileName, format);
QFile file(imageFileName);
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgFileOpenReadFailed(file).constData());
QByteArray imageData = file.readAll();
QVERIFY(!imageData.isEmpty());
{
@@ -1128,12 +1145,11 @@ void tst_QImageReader::readFromFileAfterJunk()
SKIP_IF_UNSUPPORTED(format);
- QFile::remove("junk");
- QFile junkFile("junk");
- QVERIFY(junkFile.open(QFile::WriteOnly));
+ QTemporaryFile junkFile(m_temporaryDir.path() + QLatin1String("/junkXXXXXX"));
+ QVERIFY2(junkFile.open(), msgFileOpenWriteFailed(junkFile).constData());
QFile imageFile(prefix + fileName);
- QVERIFY(imageFile.open(QFile::ReadOnly));
+ QVERIFY2(imageFile.open(QFile::ReadOnly), msgFileOpenReadFailed(imageFile).constData());
QByteArray imageData = imageFile.readAll();
QVERIFY(!imageData.isNull());
@@ -1154,7 +1170,7 @@ void tst_QImageReader::readFromFileAfterJunk()
}
}
junkFile.close();
- junkFile.open(QFile::ReadOnly);
+ QVERIFY2(junkFile.open(), msgFileOpenReadFailed(junkFile).constData());
for (int i = 0; i < iterations; ++i) {
QByteArray ole = junkFile.read(9);
@@ -1204,7 +1220,7 @@ void tst_QImageReader::devicePosition()
QVERIFY(!expected.isNull());
QFile imageFile(prefix + fileName);
- QVERIFY(imageFile.open(QFile::ReadOnly));
+ QVERIFY2(imageFile.open(QFile::ReadOnly), msgFileOpenReadFailed(imageFile).constData());
QByteArray imageData = imageFile.readAll();
QVERIFY(!imageData.isNull());
int imageDataSize = imageData.size();
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 4f04e50294..1dd4d69ea8 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -89,6 +89,7 @@ private slots:
void saveToTemporaryFile();
private:
+ QTemporaryDir m_temporaryDir;
QString prefix;
QString writePrefix;
};
@@ -112,14 +113,11 @@ static void initializePadding(QImage *image)
void tst_QImageWriter::initTestCase()
{
+ QVERIFY(m_temporaryDir.isValid());
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
- writePrefix = QDir::homePath();
-#else
- writePrefix = prefix;
-#endif
+ writePrefix = m_temporaryDir.path();
}
// Testing get/set functions
@@ -416,7 +414,7 @@ void tst_QImageWriter::testCanWrite()
{
// check if canWrite won't leave an empty file
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
QString fileName(dir.path() + QLatin1String("/001.garble"));
QVERIFY(!QFileInfo(fileName).exists());
QImageWriter writer(fileName);
@@ -524,7 +522,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 1) Via QImageWriter's API, with a standard temp file name
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QImageWriter writer(&file, "PNG");
if (writer.canWrite())
QVERIFY(writer.write(image));
@@ -538,7 +536,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 2) Via QImage's API, with a standard temp file name
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QVERIFY(image.save(&file, "PNG"));
file.reset();
QImage tmp;
@@ -548,7 +546,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 3) Via QImageWriter's API, with a named temp file
QTemporaryFile file("tempXXXXXX");
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QImageWriter writer(&file, "PNG");
QVERIFY(writer.write(image));
#if defined(Q_OS_WINCE)
@@ -559,7 +557,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 4) Via QImage's API, with a named temp file
QTemporaryFile file("tempXXXXXX");
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QVERIFY(image.save(&file, "PNG"));
file.reset();
QImage tmp;
diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp
index c61c88d1a6..b8c99ca324 100644
--- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp
+++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp
@@ -188,8 +188,8 @@ void tst_QMovie::jumpToFrame()
QMovie movie(QFINDTESTDATA(fileName));
movie.start();
movie.stop();
- QVERIFY(movie.jumpToFrame(-1) == false);
- QVERIFY(movie.currentFrameNumber() == 0);
+ QVERIFY(!movie.jumpToFrame(-1));
+ QCOMPARE(movie.currentFrameNumber(), 0);
}
void tst_QMovie::changeMovieFile()
@@ -198,7 +198,7 @@ void tst_QMovie::changeMovieFile()
movie.start();
movie.stop();
movie.setFileName(QFINDTESTDATA("animations/trolltech.gif"));
- QVERIFY(movie.currentFrameNumber() == -1);
+ QCOMPARE(movie.currentFrameNumber(), -1);
}
#ifndef QT_NO_WIDGETS
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 58cc5824bd..67d7e57fd4 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -447,7 +447,7 @@ void tst_QPixmap::scroll()
QString fileName = QString(":/images/%1.png").arg(QTest::currentDataTag());
QPixmap output(fileName);
- QVERIFY(input.isNull() == output.isNull());
+ QCOMPARE(input.isNull(), output.isNull());
QVERIFY(lenientCompare(pixmap, output));
QCOMPARE(exp, exposed);
}
@@ -713,11 +713,11 @@ void tst_QPixmap::cacheKey()
QVERIFY(pixmap1.cacheKey() != pixmap2.cacheKey());
pixmap2 = pixmap1;
- QVERIFY(pixmap2.cacheKey() == pixmap1.cacheKey());
+ QCOMPARE(pixmap2.cacheKey(), pixmap1.cacheKey());
pixmap2.detach();
QVERIFY(pixmap2.cacheKey() != pixmap1.cacheKey());
- QVERIFY(pixmap1.cacheKey() == pixmap1_key);
+ QCOMPARE(pixmap1.cacheKey(), pixmap1_key);
}
// Test drawing a bitmap on a pixmap.
@@ -743,7 +743,7 @@ void tst_QPixmap::isNull()
{
{
QPixmap pixmap(1,1);
- QVERIFY(pixmap.isNull() == false);
+ QVERIFY(!pixmap.isNull());
}
{
QPixmap pixmap(0,0);
@@ -783,11 +783,11 @@ void tst_QPixmap::convertFromImageNoDetach()
QPixmap pix = QPixmap::fromImage(orig);
QImage copy = pix.toImage();
- QVERIFY(copy.format() == screenFormat);
+ QCOMPARE(copy.format(), screenFormat);
const QImage constOrig = orig;
const QImage constCopy = copy;
- QVERIFY(constOrig.bits() == constCopy.bits());
+ QCOMPARE(constOrig.bits(), constCopy.bits());
}
void tst_QPixmap::convertFromImageDetach()
@@ -821,7 +821,7 @@ void tst_QPixmap::convertFromImageCacheKey()
QPixmap pix = QPixmap::fromImage(orig);
QImage copy = pix.toImage();
- QVERIFY(copy.format() == screenFormat);
+ QCOMPARE(copy.format(), screenFormat);
QCOMPARE(orig.cacheKey(), pix.cacheKey());
QCOMPARE(copy.cacheKey(), pix.cacheKey());
@@ -1135,9 +1135,9 @@ void tst_QPixmap::copy()
void tst_QPixmap::depthOfNullObjects()
{
QBitmap b1;
- QVERIFY(b1.depth() == 0);
+ QCOMPARE(b1.depth(), 0);
QPixmap p4;
- QVERIFY(p4.depth() == 0);
+ QCOMPARE(p4.depth(), 0);
}
void tst_QPixmap::transformed()
@@ -1437,7 +1437,7 @@ void tst_QPixmap::task_246446()
{
QPixmap pm2(pm);
}
- QVERIFY(pm.width() == 10);
+ QCOMPARE(pm.width(), 10);
QVERIFY(pm.mask().isNull());
}
@@ -1490,14 +1490,14 @@ void tst_QPixmap::loadAsBitmapOrPixmap()
// The do the same check for bitmaps..
QBitmap bitmap("temp_image.png");
QVERIFY(!bitmap.isNull());
- QVERIFY(bitmap.depth() == 1);
+ QCOMPARE(bitmap.depth(), 1);
QVERIFY(bitmap.isQBitmap());
bitmap = QBitmap();
ok = bitmap.load("temp_image.png");
QVERIFY(ok);
QVERIFY(!bitmap.isNull());
- QVERIFY(bitmap.depth() == 1);
+ QCOMPARE(bitmap.depth(), 1);
QVERIFY(bitmap.isQBitmap());
}
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index f22aa63112..a3cf66da18 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -111,7 +111,7 @@ void tst_QPixmapCache::setCacheLimit()
delete p1;
QPixmapCache::setCacheLimit(0);
- QVERIFY(QPixmapCache::find("P1") == 0);
+ QVERIFY(!QPixmapCache::find("P1"));
p1 = new QPixmap(2, 3);
QPixmapCache::setCacheLimit(1000);
@@ -346,12 +346,12 @@ void tst_QPixmapCache::remove()
QVERIFY(p1.toImage() == p1.toImage()); // sanity check
QPixmapCache::remove("red");
- QVERIFY(QPixmapCache::find("red") == 0);
+ QVERIFY(!QPixmapCache::find("red"));
QPixmapCache::remove("red");
- QVERIFY(QPixmapCache::find("red") == 0);
+ QVERIFY(!QPixmapCache::find("red"));
QPixmapCache::remove("green");
- QVERIFY(QPixmapCache::find("green") == 0);
+ QVERIFY(!QPixmapCache::find("green"));
//The int part of the API
QPixmapCache::clear();
@@ -424,7 +424,7 @@ void tst_QPixmapCache::clear()
QPixmapCache::clear();
for (int k = 0; k < numberOfKeys; ++k)
- QVERIFY(QPixmapCache::find(QString::number(k)) == 0);
+ QVERIFY(!QPixmapCache::find(QString::number(k)));
//The int part of the API
QPixmap p2(10, 10);
diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
index 2448b89296..ff263c166a 100644
--- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
@@ -278,9 +278,12 @@ void tst_QStandardItem::getSetFlags()
QVERIFY(item.isCheckable());
QCOMPARE(item.checkState(), Qt::Unchecked);
QVERIFY(item.flags() & Qt::ItemIsUserCheckable);
- item.setTristate(true);
- QVERIFY(item.isTristate());
- QVERIFY(item.flags() & Qt::ItemIsTristate);
+ item.setUserTristate(true);
+ QVERIFY(item.isUserTristate());
+ QVERIFY(item.flags() & Qt::ItemIsUserTristate);
+ item.setAutoTristate(true);
+ QVERIFY(item.isAutoTristate());
+ QVERIFY(item.flags() & Qt::ItemIsAutoTristate);
#ifndef QT_NO_DRAGANDDROP
item.setDragEnabled(true);
QVERIFY(item.isDragEnabled());
@@ -306,10 +309,12 @@ void tst_QStandardItem::getSetFlags()
item.setCheckable(false);
QVERIFY(!item.isCheckable());
QVERIFY(!(item.flags() & Qt::ItemIsUserCheckable));
- QVERIFY(item.isTristate());
- item.setTristate(false);
- QVERIFY(!item.isTristate());
- QVERIFY(!(item.flags() & Qt::ItemIsTristate));
+ item.setUserTristate(false);
+ QVERIFY(!item.isUserTristate());
+ QVERIFY(!(item.flags() & Qt::ItemIsUserTristate));
+ item.setAutoTristate(false);
+ QVERIFY(!item.isAutoTristate());
+ QVERIFY(!(item.flags() & Qt::ItemIsAutoTristate));
#ifndef QT_NO_DRAGANDDROP
QVERIFY(item.isDragEnabled());
item.setDragEnabled(false);
@@ -325,6 +330,13 @@ void tst_QStandardItem::getSetFlags()
item.setCheckState(Qt::Checked);
item.setCheckable(true);
QCOMPARE(item.checkState(), Qt::Checked);
+
+ // deprecated API
+ item.setTristate(true);
+ QVERIFY(item.isTristate());
+ QVERIFY(item.flags() & Qt::ItemIsTristate);
+ item.setTristate(false);
+ QVERIFY(!(item.flags() & Qt::ItemIsTristate));
}
void tst_QStandardItem::getSetRowAndColumnCount()
diff --git a/tests/auto/gui/kernel/qclipboard/qclipboard.pro b/tests/auto/gui/kernel/qclipboard/qclipboard.pro
index d97c58dea0..b9fd2080e7 100644
--- a/tests/auto/gui/kernel/qclipboard/qclipboard.pro
+++ b/tests/auto/gui/kernel/qclipboard/qclipboard.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = copier paster
+!winrt: SUBDIRS = copier paster
test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/gui/kernel/qclipboard/test/test.pro b/tests/auto/gui/kernel/qclipboard/test/test.pro
index 586404871f..40bf9c8d8e 100644
--- a/tests/auto/gui/kernel/qclipboard/test/test.pro
+++ b/tests/auto/gui/kernel/qclipboard/test/test.pro
@@ -3,6 +3,8 @@ SOURCES += ../tst_qclipboard.cpp
TARGET = ../tst_qclipboard
QT += testlib
+osx: LIBS += -framework AppKit
+
win32 {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qclipboard
@@ -15,6 +17,6 @@ wince* {
DEPLOYMENT += rsc reg_resource
}
-TEST_HELPER_INSTALLS = \
+!winrt: TEST_HELPER_INSTALLS = \
../copier/copier \
../paster/paster
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index d573d97495..d18f9664fc 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -171,7 +171,7 @@ void tst_QGuiApplication::focusObject()
int argc = 0;
QGuiApplication app(argc, 0);
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QObject obj1, obj2, obj3;
@@ -342,7 +342,7 @@ void tst_QGuiApplication::changeFocusWindow()
int argc = 0;
QGuiApplication app(argc, 0);
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
@@ -416,11 +416,11 @@ void tst_QGuiApplication::keyboardModifiers()
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
// shortcut events
- QWindowSystemInterface::tryHandleShortcutEvent(window.data(), Qt::Key_5, Qt::MetaModifier);
+ QTest::keyEvent(QTest::Shortcut, window.data(), Qt::Key_5, Qt::MetaModifier);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::MetaModifier);
- QWindowSystemInterface::tryHandleShortcutEvent(window.data(), Qt::Key_Period, Qt::NoModifier);
+ QTest::keyEvent(QTest::Shortcut, window.data(), Qt::Key_Period, Qt::NoModifier);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
- QWindowSystemInterface::tryHandleShortcutEvent(window.data(), Qt::Key_0, Qt::ControlModifier);
+ QTest::keyEvent(QTest::Shortcut, window.data(), Qt::Key_0, Qt::ControlModifier);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
// key events
@@ -928,7 +928,7 @@ void tst_QGuiApplication::genericPluginsAndWindowSystemEvents()
QGuiApplication app(argc, argv);
QVERIFY(QGuiApplication::primaryScreen());
- QVERIFY(QGuiApplication::primaryScreen()->orientation() == testOrientationToSend);
+ QCOMPARE(QGuiApplication::primaryScreen()->orientation(), testOrientationToSend);
QCOMPARE(testReceiver.customEvents, 0);
QCoreApplication::sendPostedEvents(&testReceiver);
diff --git a/tests/auto/gui/kernel/qguivariant/no_application/main.cpp b/tests/auto/gui/kernel/qguivariant/no_application/main.cpp
index c37e633d75..1294751224 100644
--- a/tests/auto/gui/kernel/qguivariant/no_application/main.cpp
+++ b/tests/auto/gui/kernel/qguivariant/no_application/main.cpp
@@ -56,7 +56,7 @@ void tst_QGuiVariantNoApplication::variantWithoutApplication()
{
QVariant v = QString("red");
- QVERIFY(qvariant_cast<QColor>(v) == QColor(Qt::red));
+ QCOMPARE(qvariant_cast<QColor>(v), QColor(Qt::red));
}
diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
index 58c595ad07..0a704b9f64 100644
--- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
+++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
@@ -140,13 +140,13 @@ void tst_QGuiVariant::constructor_invalid()
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(static_cast<QVariant::Type>(typeId));
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
{
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(typeId, /* copy */ 0);
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
}
@@ -250,6 +250,14 @@ void tst_QGuiVariant::toColor_data()
QColor c("red");
QTest::newRow( "string" ) << QVariant( QString( "red" ) ) << c;
QTest::newRow( "solid brush" ) << QVariant( QBrush(c) ) << c;
+ QTest::newRow("qbytearray") << QVariant(QByteArray("red")) << c;
+ QTest::newRow("same color") << QVariant(c) << c;
+ QTest::newRow("qstring(#ff0000)") << QVariant(QString::fromUtf8("#ff0000")) << c;
+ QTest::newRow("qbytearray(#ff0000)") << QVariant(QByteArray("#ff0000")) << c;
+
+ c.setNamedColor("#88112233");
+ QTest::newRow("qstring(#88112233)") << QVariant(QString::fromUtf8("#88112233")) << c;
+ QTest::newRow("qbytearray(#88112233)") << QVariant(QByteArray("#88112233")) << c;
}
void tst_QGuiVariant::toColor()
@@ -260,6 +268,8 @@ void tst_QGuiVariant::toColor()
QVERIFY( value.canConvert( QVariant::Color ) );
QColor d = qvariant_cast<QColor>(value);
QCOMPARE( d, result );
+ QVERIFY(value.convert(QMetaType::QColor));
+ QCOMPARE(d, QColor(value.toString()));
}
void tst_QGuiVariant::toPixmap_data()
@@ -611,9 +621,9 @@ void tst_QGuiVariant::writeToReadFromDataStream()
// the uninitialized float can be NaN (observed on Windows Mobile 5 ARMv4i)
float readFloat = qvariant_cast<float>(readVariant);
float writtenFloat = qvariant_cast<float>(writeVariant);
- QVERIFY(qIsNaN(readFloat) == qIsNaN(writtenFloat));
+ QCOMPARE(qIsNaN(readFloat), qIsNaN(writtenFloat));
if (!qIsNaN(readFloat))
- QVERIFY(readFloat == writtenFloat);
+ QCOMPARE(readFloat, writtenFloat);
}
break;
}
@@ -632,7 +642,7 @@ void tst_QGuiVariant::writeToReadFromOldDataStream()
dataFileStream.setVersion(QDataStream::Qt_4_9);
QVariant readVariant;
dataFileStream >> readVariant;
- QVERIFY(readVariant.userType() == QMetaType::QPolygonF);
+ QCOMPARE(readVariant.userType(), int(QMetaType::QPolygonF));
QCOMPARE(testVariant, readVariant);
file.close();
}
@@ -656,7 +666,7 @@ void tst_QGuiVariant::writeToReadFromOldDataStream()
QDataStream readVarData(variantData);
readVarData >> dummy;
readVarData >> polyData50;
- QVERIFY(polyData49 == polyData50);
+ QCOMPARE(polyData49, polyData50);
}
}
diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
index a36e31e2e2..e3b71e40d1 100644
--- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
+++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
@@ -191,7 +191,7 @@ void tst_qinputmethod::cursorRectangle()
{
QCOMPARE(qApp->inputMethod()->cursorRectangle(), QRectF());
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
DummyWindow window;
@@ -289,9 +289,12 @@ void tst_qinputmethod::inputDirection()
void tst_qinputmethod::inputMethodAccepted()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
+ QSKIP("XCB: depends on dedicated platform context.");
+
InputItem disabledItem;
disabledItem.setEnabled(false);
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
index dcead8bfbf..1fc4967b12 100644
--- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
+++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
@@ -248,7 +248,7 @@ public:
GLuint fbo = 0xFFFF;
QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo);
- QVERIFY(fbo == 0);
+ QCOMPARE(fbo, GLuint(0));
}
void paintGL() Q_DECL_OVERRIDE {
@@ -272,7 +272,7 @@ public:
GLuint fbo = 0xFFFF;
QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo);
- QVERIFY(fbo == 0);
+ QCOMPARE(fbo, GLuint(0));
}
};
diff --git a/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp b/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp
index 0d5991ef41..a5f86c6c09 100644
--- a/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp
+++ b/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp
@@ -53,7 +53,7 @@ void tst_QPixelFormat::testOperators()
{
QPixelFormat first = qPixelFormatRgba(8,8,8,8,QPixelFormat::UsesAlpha, QPixelFormat::AtBeginning, QPixelFormat::Premultiplied);
QPixelFormat second = qPixelFormatRgba(8,8,8,8,QPixelFormat::UsesAlpha, QPixelFormat::AtBeginning, QPixelFormat::Premultiplied);
- QVERIFY(first == second);
+ QCOMPARE(first, second);
QPixelFormat third = qPixelFormatRgba(8,8,8,8,QPixelFormat::UsesAlpha, QPixelFormat::AtEnd, QPixelFormat::NotPremultiplied);
QVERIFY(first != third);
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index fd3cfd55ff..d754e0b3c3 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -39,33 +39,8 @@
#include <QtWidgets/QWidget>
#include <QtTest>
#include <qpa/qwindowsysteminterface.h>
-
-// FIXME: Use static functions of QWindowSystemInterface introduced with HighDPI scaling in 5.6 instead.
-static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
-{
- QWindowSystemInterface::TouchPoint p;
- p.id = pt.id();
- p.flags = pt.flags();
- p.normalPosition = pt.normalizedPos();
- p.area = pt.screenRect();
- p.pressure = pt.pressure();
- p.state = pt.state();
- p.velocity = pt.velocity();
- p.rawPositions = pt.rawScreenPositions();
- return p;
-}
-
-static QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QList<QTouchEvent::TouchPoint>& pointList)
-{
- QList<struct QWindowSystemInterface::TouchPoint> newList;
-
- Q_FOREACH (QTouchEvent::TouchPoint p, pointList)
- {
- newList.append(touchPoint(p));
- }
- return newList;
-}
-
+#include <qpa/qwindowsysteminterface_p.h>
+#include <private/qhighdpiscaling_p.h>
class tst_QTouchEventWidget : public QWidget
{
@@ -622,11 +597,10 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawPosList << QPointF(12, 34) << QPointF(56, 78);
rawTouchPoint.setRawScreenPositions(rawPosList);
const ulong timestamp = 1234;
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- timestamp,
- touchScreenDevice,
- touchPointList(
- QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, window);
+ QWindowSystemInterface::handleTouchEvent(window, timestamp, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -653,16 +627,16 @@ void tst_QTouchEvent::basicRawEventTranslation()
QCOMPARE(touchBeginPoint.sceneRect(), touchBeginPoint.screenRect());
QCOMPARE(touchBeginPoint.pressure(), qreal(1.));
QCOMPARE(touchBeginPoint.velocity(), QVector2D());
- QCOMPARE(touchBeginPoint.rawScreenPositions(), rawPosList);
+ if (!QHighDpiScaling::isActive())
+ QCOMPARE(touchBeginPoint.rawScreenPositions(), rawPosList);
// moving the point should translate to TouchUpdate
rawTouchPoint.setState(Qt::TouchPointMoved);
rawTouchPoint.setScreenPos(screenPos + delta);
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
@@ -692,10 +666,9 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawTouchPoint.setState(Qt::TouchPointReleased);
rawTouchPoint.setScreenPos(screenPos + delta + delta);
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
@@ -762,10 +735,10 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointPressed);
rawTouchPoints[1].setScreenPos(rightScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -827,10 +800,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -892,10 +864,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -992,10 +963,10 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointPressed);
rawTouchPoints[1].setScreenPos(rightScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchPadDevice,
- touchPointList(rawTouchPoints));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchPadDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1058,10 +1029,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchPadDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchPadDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1123,10 +1093,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchPadDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchPadDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1385,10 +1354,10 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
rawTouchPoints[2].setNormalizedPos(normalized(rawTouchPoints[2].pos(), screenGeometry));
// generate begin events on all widgets, the left widget should die
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(leftWidget.isNull());
QVERIFY(!centerWidget.isNull());
@@ -1398,20 +1367,18 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
rawTouchPoints[0].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[2].setState(Qt::TouchPointMoved);
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
// generate end events on all widget, the right widget should die
rawTouchPoints[0].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[2].setState(Qt::TouchPointReleased);
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
}
@@ -1447,6 +1414,8 @@ void tst_QTouchEvent::crashInQGraphicsSceneAfterNotHandlingTouchBegin()
void tst_QTouchEvent::touchBeginWithGraphicsWidget()
{
+ if (QHighDpiScaling::isActive())
+ QSKIP("Fails when scaling is active");
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowTitle(QTest::currentTestFunction());
@@ -1605,12 +1574,15 @@ void tst_QTouchEvent::testMultiDevice()
QWindowSystemInterface::TouchPoint tp;
tp.id = 0;
tp.state = Qt::TouchPointPressed;
- tp.area = QRectF(120, 120, 20, 20);
+ const QPoint screenOrigin = w.screen()->geometry().topLeft();
+ const QRect area0(120, 120, 20, 20);
+ tp.area = QHighDpi::toNative(area0, QHighDpiScaling::factor(&w), screenOrigin);
pointsOne.append(tp);
pointsTwo.append(tp);
tp.id = 1;
- tp.area = QRectF(140, 140, 20, 20);
+ const QRect area1(140, 140, 20, 20);
+ tp.area = QHighDpi::toNative(area1, QHighDpiScaling::factor(&w), screenOrigin);
pointsTwo.append(tp);
QWindowSystemInterface::handleTouchEvent(&w, deviceOne, pointsOne);
@@ -1625,12 +1597,12 @@ void tst_QTouchEvent::testMultiDevice()
QCOMPARE(filter.d.value(deviceOne).points.count(), 1);
QCOMPARE(filter.d.value(deviceTwo).points.count(), 2);
- QCOMPARE(filter.d.value(deviceOne).points.at(0).screenRect(), pointsOne[0].area);
+ QCOMPARE(filter.d.value(deviceOne).points.at(0).screenRect(), QRectF(area0));
QCOMPARE(filter.d.value(deviceOne).points.at(0).state(), pointsOne[0].state);
- QCOMPARE(filter.d.value(deviceTwo).points.at(0).screenRect(), pointsTwo[0].area);
+ QCOMPARE(filter.d.value(deviceTwo).points.at(0).screenRect(), QRectF(area0));
QCOMPARE(filter.d.value(deviceTwo).points.at(0).state(), pointsTwo[0].state);
- QCOMPARE(filter.d.value(deviceTwo).points.at(1).screenRect(), pointsTwo[1].area);
+ QCOMPARE(filter.d.value(deviceTwo).points.at(1).screenRect(), QRectF(area1));
QCOMPARE(filter.d.value(deviceTwo).points.at(1).state(), pointsTwo[1].state);
}
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index d361aa12a6..a89f0da4d2 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -35,6 +35,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtGui/QPainter>
#include <QtTest/QtTest>
@@ -94,6 +95,8 @@ private slots:
void windowsTransientChildren();
void requestUpdate();
void initTestCase();
+ void stateChange_data();
+ void stateChange();
void cleanup();
private:
@@ -265,6 +268,38 @@ void tst_QWindow::positioning_data()
#endif
}
+// Compare a window position that may go through scaling in the platform plugin with fuzz.
+static inline bool qFuzzyCompareWindowPosition(const QPoint &p1, const QPoint p2, int fuzz)
+{
+ return (p1 - p2).manhattanLength() <= fuzz;
+}
+
+static inline bool qFuzzyCompareWindowSize(const QSize &s1, const QSize &s2, int fuzz)
+{
+ const int manhattanLength = qAbs(s1.width() - s2.width()) + qAbs(s1.height() - s2.height());
+ return manhattanLength <= fuzz;
+}
+
+static inline bool qFuzzyCompareWindowGeometry(const QRect &r1, const QRect &r2, int fuzz)
+{
+ return qFuzzyCompareWindowPosition(r1.topLeft(), r2.topLeft(), fuzz)
+ && qFuzzyCompareWindowSize(r1.size(), r2.size(), fuzz);
+}
+
+static QString msgPointMismatch(const QPoint &p1, const QPoint p2)
+{
+ QString result;
+ QDebug(&result) << p1 << "!=" << p2 << ", manhattanLength=" << (p1 - p2).manhattanLength();
+ return result;
+}
+
+static QString msgRectMismatch(const QRect &r1, const QRect &r2)
+{
+ QString result;
+ QDebug(&result) << r1 << "!=" << r2;
+ return result;
+}
+
void tst_QWindow::positioning()
{
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(
@@ -272,7 +307,7 @@ void tst_QWindow::positioning()
QSKIP("This platform does not support non-fullscreen windows");
}
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
// Some platforms enforce minimum widths for windows, which can cause extra resize
@@ -327,21 +362,25 @@ void tst_QWindow::positioning()
// if our positioning is actually fully respected by the window manager
// test whether it correctly handles frame positioning as well
if (originalPos == geometry.topLeft() && (originalMargins.top() != 0 || originalMargins.left() != 0)) {
- QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center();
+ const QScreen *screen = window.screen();
+ const QRect availableGeometry = screen->availableGeometry();
+ const QPoint framePos = availableGeometry.center();
window.reset();
const QPoint oldFramePos = window.framePosition();
window.setFramePosition(framePos);
QTRY_VERIFY(window.received(QEvent::Move));
- if (window.framePosition() != framePos) {
+ const int fuzz = int(QHighDpiScaling::factor(&window));
+ if (!qFuzzyCompareWindowPosition(window.framePosition(), framePos, fuzz)) {
qDebug() << "About to fail auto-test. Here is some additional information:";
qDebug() << "window.framePosition() == " << window.framePosition();
qDebug() << "old frame position == " << oldFramePos;
qDebug() << "We received " << window.received(QEvent::Move) << " move events";
qDebug() << "frame positions after each move event:" << window.m_framePositionsOnMove;
}
- QTRY_COMPARE(framePos, window.framePosition());
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(window.framePosition(), framePos, fuzz),
+ qPrintable(msgPointMismatch(window.framePosition(), framePos)));
QTRY_COMPARE(originalMargins, window.frameMargins());
QCOMPARE(window.position(), window.framePosition() + QPoint(originalMargins.left(), originalMargins.top()));
@@ -357,7 +396,8 @@ void tst_QWindow::positioning()
void tst_QWindow::positioningDuringMinimized()
{
// QTBUG-39544, setting a geometry in minimized state should work as well.
- if (QGuiApplication::platformName().compare("windows", Qt::CaseInsensitive))
+ if (QGuiApplication::platformName().compare("windows", Qt::CaseInsensitive) != 0
+ && QGuiApplication::platformName().compare("cocoa", Qt::CaseInsensitive) != 0)
QSKIP("Not supported on this platform");
Window window;
window.setTitle(QStringLiteral("positioningDuringMinimized"));
@@ -375,6 +415,52 @@ void tst_QWindow::positioningDuringMinimized()
QTRY_COMPARE(window.geometry(), newGeometry);
}
+// QTBUG-49709: Verify that the normal geometry is correctly restored
+// when executing a sequence of window state changes. So far, Windows
+// only where state changes have immediate effect.
+
+typedef QList<Qt::WindowState> WindowStateList;
+
+Q_DECLARE_METATYPE(WindowStateList)
+
+void tst_QWindow::stateChange_data()
+{
+ QTest::addColumn<WindowStateList>("stateSequence");
+
+ QTest::newRow("normal->min->normal") <<
+ (WindowStateList() << Qt::WindowMinimized << Qt::WindowNoState);
+ QTest::newRow("normal->maximized->normal") <<
+ (WindowStateList() << Qt::WindowMaximized << Qt::WindowNoState);
+ QTest::newRow("normal->fullscreen->normal") <<
+ (WindowStateList() << Qt::WindowFullScreen << Qt::WindowNoState);
+ QTest::newRow("normal->maximized->fullscreen->normal") <<
+ (WindowStateList() << Qt::WindowMaximized << Qt::WindowFullScreen << Qt::WindowNoState);
+}
+
+void tst_QWindow::stateChange()
+{
+ QFETCH(WindowStateList, stateSequence);
+
+ if (QGuiApplication::platformName().compare(QLatin1String("windows"), Qt::CaseInsensitive))
+ QSKIP("Windows-only test");
+
+ Window window;
+ window.setTitle(QLatin1String(QTest::currentTestFunction()) + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
+ const QRect normalGeometry(m_availableTopLeft + QPoint(40, 40), m_testWindowSize);
+ window.setGeometry(normalGeometry);
+ // explicitly use non-fullscreen show. show() can be fullscreen on some platforms
+ window.showNormal();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+ foreach (Qt::WindowState state, stateSequence) {
+ window.setWindowState(state);
+ QCoreApplication::processEvents();
+ }
+ const QRect geometry = window.geometry();
+ const int fuzz = int(QHighDpiScaling::factor(&window));
+ QVERIFY2(qFuzzyCompareWindowGeometry(geometry, normalGeometry, fuzz),
+ qPrintable(msgRectMismatch(geometry, normalGeometry)));
+}
+
class PlatformWindowFilter : public QObject
{
Q_OBJECT
@@ -418,14 +504,14 @@ void tst_QWindow::platformSurface()
QCOMPARE(window.geometry(), geometry);
window.create();
- QTRY_VERIFY(window.received(QEvent::PlatformSurface) == 1);
- QTRY_VERIFY(window.surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated);
+ QTRY_COMPARE(window.received(QEvent::PlatformSurface), 1);
+ QTRY_COMPARE(window.surfaceEventType(), QPlatformSurfaceEvent::SurfaceCreated);
QTRY_VERIFY(window.handle() != Q_NULLPTR);
window.destroy();
- QTRY_VERIFY(window.received(QEvent::PlatformSurface) == 2);
- QTRY_VERIFY(window.surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
- QTRY_VERIFY(window.handle() == Q_NULLPTR);
+ QTRY_COMPARE(window.received(QEvent::PlatformSurface), 2);
+ QTRY_COMPARE(window.surfaceEventType(), QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
+ QTRY_VERIFY(!window.handle());
// Check for synchronous delivery of platform surface events and that the platform
// surface always existed upon event delivery
@@ -457,7 +543,7 @@ void tst_QWindow::isExposed()
window.hide();
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This is flaky. Figure out why.");
QCoreApplication::processEvents();
@@ -468,7 +554,7 @@ void tst_QWindow::isExposed()
void tst_QWindow::isActive()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
Window window;
@@ -487,7 +573,7 @@ void tst_QWindow::isActive()
context.swapBuffers(&window);
#endif
QTRY_COMPARE(window.received(QEvent::Resize), 1);
- QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
QVERIFY(window.isActive());
Window child;
@@ -499,7 +585,7 @@ void tst_QWindow::isActive()
child.requestActivate();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &child);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &child);
QVERIFY(child.isActive());
// parent shouldn't receive new resize events from child being shown
@@ -522,7 +608,7 @@ void tst_QWindow::isActive()
QTRY_VERIFY(dialog.isExposed());
QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::Resize), 1);
- QTRY_VERIFY(QGuiApplication::focusWindow() == &dialog);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &dialog);
QVERIFY(dialog.isActive());
// transient child has focus
@@ -533,7 +619,7 @@ void tst_QWindow::isActive()
window.requestActivate();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::FocusOut), 1);
QTRY_COMPARE(window.received(QEvent::FocusIn), 2);
@@ -654,15 +740,13 @@ void tst_QWindow::testInputEvents()
window.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&window));
- QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
- QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier);
+ QTest::keyClick(&window, Qt::Key_A, Qt::NoModifier);
QCoreApplication::processEvents();
QCOMPARE(window.keyPressCode, int(Qt::Key_A));
QCOMPARE(window.keyReleaseCode, int(Qt::Key_A));
QPointF local(12, 34);
- QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::NoButton);
+ QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, local.toPoint());
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
@@ -688,15 +772,17 @@ void tst_QWindow::testInputEvents()
// Now with null pointer as window. local param should not be utilized:
// handleMouseEvent() with tlw == 0 means the event is in global coords only.
window.mousePressButton = window.mouseReleaseButton = 0;
- QPointF nonWindowGlobal(window.geometry().topRight() + QPoint(200, 50)); // not inside the window
- QWindowSystemInterface::handleMouseEvent(0, nonWindowGlobal, nonWindowGlobal, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(0, nonWindowGlobal, nonWindowGlobal, Qt::NoButton);
+ const QPointF nonWindowGlobal(window.geometry().topRight() + QPoint(200, 50)); // not inside the window
+ const QPointF deviceNonWindowGlobal = QHighDpi::toNativePixels(nonWindowGlobal, window.screen());
+ QWindowSystemInterface::handleMouseEvent(0, deviceNonWindowGlobal, deviceNonWindowGlobal, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(0, deviceNonWindowGlobal, deviceNonWindowGlobal, Qt::NoButton);
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, 0);
QCOMPARE(window.mouseReleaseButton, 0);
- QPointF windowGlobal = window.mapToGlobal(local.toPoint());
- QWindowSystemInterface::handleMouseEvent(0, windowGlobal, windowGlobal, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(0, windowGlobal, windowGlobal, Qt::NoButton);
+ const QPointF windowGlobal = window.mapToGlobal(local.toPoint());
+ const QPointF deviceWindowGlobal = QHighDpi::toNativePixels(windowGlobal, window.screen());
+ QWindowSystemInterface::handleMouseEvent(0, deviceWindowGlobal, deviceWindowGlobal, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(0, deviceWindowGlobal, deviceWindowGlobal, Qt::NoButton);
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
@@ -718,7 +804,7 @@ void tst_QWindow::touchToMouseTranslation()
const QRectF moveArea(105, 108, 4, 4);
tp1.id = 1;
tp1.state = Qt::TouchPointPressed;
- tp1.area = pressArea;
+ tp1.area = QHighDpi::toNativePixels(pressArea, &window);
tp2.id = 2;
tp2.state = Qt::TouchPointPressed;
points << tp1 << tp2;
@@ -729,7 +815,7 @@ void tst_QWindow::touchToMouseTranslation()
tp1.state = Qt::TouchPointStationary;
tp2.id = 1;
tp2.state = Qt::TouchPointMoved;
- tp2.area = moveArea;
+ tp2.area = QHighDpi::toNativePixels(moveArea, &window);
points.clear();
points << tp1 << tp2;
QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
@@ -946,12 +1032,15 @@ void tst_QWindow::touchCancelWithTouchToMouse()
tp1.id = 1;
tp1.state = Qt::TouchPointPressed;
- tp1.area = QRect(100, 100, 4, 4);
+ const QRect area(100, 100, 4, 4);
+ tp1.area = QHighDpi::toNativePixels(area, &window);
points << tp1;
QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
QCoreApplication::processEvents();
QTRY_COMPARE(window.mousePressButton, int(Qt::LeftButton));
- QTRY_COMPARE(window.mousePressScreenPos, points[0].area.center());
+ const int fuzz = 2 * int(QHighDpiScaling::factor(&window));
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(window.mousePressScreenPos.toPoint(), area.center(), fuzz),
+ qPrintable(msgPointMismatch(window.mousePressScreenPos.toPoint(), area.center())));
// Cancel the touch. Should result in a mouse release for windows that have
// have an active touch-to-mouse sequence.
@@ -1112,7 +1201,7 @@ void tst_QWindow::close()
void tst_QWindow::activateAndClose()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
for (int i = 0; i < 10; ++i) {
@@ -1149,8 +1238,9 @@ void tst_QWindow::mouseEventSequence()
ulong timestamp = 0;
QPointF local(12, 34);
- QWindowSystemInterface::handleMouseEvent(&window, timestamp++, local, local, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(&window, timestamp++, local, local, Qt::NoButton);
+ const QPointF deviceLocal = QHighDpi::toNativePixels(local, &window);
+ QWindowSystemInterface::handleMouseEvent(&window, timestamp++, deviceLocal, deviceLocal, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, timestamp++, deviceLocal, deviceLocal, Qt::NoButton);
QCoreApplication::processEvents();
QCOMPARE(window.mousePressedCount, 1);
QCOMPARE(window.mouseReleasedCount, 1);
@@ -1308,14 +1398,14 @@ void tst_QWindow::inputReentrancy()
class TabletTestWindow : public QWindow
{
public:
- TabletTestWindow() : eventType(0) { }
+ TabletTestWindow() : eventType(QEvent::None) { }
void tabletEvent(QTabletEvent *ev) {
eventType = ev->type();
eventGlobal = ev->globalPosF();
eventLocal = ev->posF();
eventDevice = ev->device();
}
- int eventType;
+ QEvent::Type eventType;
QPointF eventGlobal, eventLocal;
int eventDevice;
bool eventFilter(QObject *obj, QEvent *ev) {
@@ -1337,25 +1427,27 @@ void tst_QWindow::tabletEvents()
window.setGeometry(QRect(m_availableTopLeft + QPoint(10, 10), m_testWindowSize));
qGuiApp->installEventFilter(&window);
- QPoint local(10, 10);
- QPoint global = window.mapToGlobal(local);
- QWindowSystemInterface::handleTabletEvent(&window, true, local, global, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
+ const QPoint local(10, 10);
+ const QPoint global = window.mapToGlobal(local);
+ const QPoint deviceLocal = QHighDpi::toNativeLocalPosition(local, &window);
+ const QPoint deviceGlobal = QHighDpi::toNativePixels(global, window.screen());
+ QWindowSystemInterface::handleTabletEvent(&window, true, deviceLocal, deviceGlobal, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
QCoreApplication::processEvents();
QTRY_VERIFY(window.eventType == QEvent::TabletPress);
QTRY_COMPARE(window.eventGlobal.toPoint(), global);
QTRY_COMPARE(window.eventLocal.toPoint(), local);
- QWindowSystemInterface::handleTabletEvent(&window, false, local, global, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
+ QWindowSystemInterface::handleTabletEvent(&window, false, deviceLocal, deviceGlobal, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
QCoreApplication::processEvents();
- QTRY_VERIFY(window.eventType == QEvent::TabletRelease);
+ QTRY_COMPARE(window.eventType, QEvent::TabletRelease);
QWindowSystemInterface::handleTabletEnterProximityEvent(1, 2, 3);
QCoreApplication::processEvents();
- QTRY_VERIFY(window.eventType == QEvent::TabletEnterProximity);
+ QTRY_COMPARE(window.eventType, QEvent::TabletEnterProximity);
QTRY_COMPARE(window.eventDevice, 1);
QWindowSystemInterface::handleTabletLeaveProximityEvent(1, 2, 3);
QCoreApplication::processEvents();
- QTRY_VERIFY(window.eventType == QEvent::TabletLeaveProximity);
+ QTRY_COMPARE(window.eventType, QEvent::TabletLeaveProximity);
QTRY_COMPARE(window.eventDevice, 1);
#endif
@@ -1363,7 +1455,7 @@ void tst_QWindow::tabletEvents()
void tst_QWindow::windowModality_QTBUG27039()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow parent;
@@ -1458,7 +1550,7 @@ void tst_QWindow::mask()
void tst_QWindow::initialSize()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QSize defaultSize(0,0);
@@ -1499,7 +1591,7 @@ void tst_QWindow::initialSize()
void tst_QWindow::modalDialog()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normalWindow;
@@ -1525,7 +1617,7 @@ void tst_QWindow::modalDialog()
void tst_QWindow::modalDialogClosingOneOfTwoModal()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normalWindow;
@@ -1563,7 +1655,7 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal()
void tst_QWindow::modalWithChildWindow()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normalWindow;
@@ -1597,7 +1689,7 @@ void tst_QWindow::modalWithChildWindow()
void tst_QWindow::modalWindowModallity()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normal_window;
@@ -1703,13 +1795,13 @@ void tst_QWindow::requestUpdate()
QCoreApplication::processEvents();
QTRY_VERIFY(window.isExposed());
- QVERIFY(window.received(QEvent::UpdateRequest) == 0);
+ QCOMPARE(window.received(QEvent::UpdateRequest), 0);
window.requestUpdate();
- QTRY_VERIFY(window.received(QEvent::UpdateRequest) == 1);
+ QTRY_COMPARE(window.received(QEvent::UpdateRequest), 1);
window.requestUpdate();
- QTRY_VERIFY(window.received(QEvent::UpdateRequest) == 2);
+ QTRY_COMPARE(window.received(QEvent::UpdateRequest), 2);
}
#include <tst_qwindow.moc>
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index e7659a25bd..463322ff2a 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -673,7 +673,7 @@ void tst_QMatrixNxN::compare2x2()
QMatrix2x2 m2(uniqueValues2);
QMatrix2x2 m3(transposedValues2);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -686,7 +686,7 @@ void tst_QMatrixNxN::compare3x3()
QMatrix3x3 m2(uniqueValues3);
QMatrix3x3 m3(transposedValues3);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -699,7 +699,7 @@ void tst_QMatrixNxN::compare4x4()
QMatrix4x4 m2(uniqueValues4);
QMatrix4x4 m3(transposedValues4);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -712,7 +712,7 @@ void tst_QMatrixNxN::compare4x3()
QMatrix4x3 m2(uniqueValues4x3);
QMatrix4x3 m3(transposedValues3x4);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -1858,7 +1858,7 @@ void tst_QMatrixNxN::inverted4x4()
if (invertible)
QVERIFY(m1.determinant() != 0.0f);
else
- QVERIFY(m1.determinant() == 0.0f);
+ QCOMPARE(m1.determinant(), 0.0f);
Matrix4 m1alt;
memcpy(m1alt.v, (const float *)m1Values, sizeof(m1alt.v));
@@ -1992,7 +1992,7 @@ void tst_QMatrixNxN::scale4x4()
if (z == 1.0f) {
QMatrix4x4 m2b;
m2b.scale(x, y);
- QVERIFY(m2b == m2);
+ QCOMPARE(m2b, m2);
}
QVector3D v1(2.0f, 3.0f, -4.0f);
@@ -2051,7 +2051,7 @@ void tst_QMatrixNxN::scale4x4()
if (z == 1.0f) {
QMatrix4x4 m4b(m3);
m4b.scale(x, y);
- QVERIFY(m4b == m4);
+ QCOMPARE(m4b, m4);
}
// Test coverage when the special matrix type is unknown.
@@ -2138,7 +2138,7 @@ void tst_QMatrixNxN::translate4x4()
if (z == 0.0f) {
QMatrix4x4 m2b;
m2b.translate(x, y);
- QVERIFY(m2b == m2);
+ QCOMPARE(m2b, m2);
}
QVector3D v1(2.0f, 3.0f, -4.0f);
@@ -2179,7 +2179,7 @@ void tst_QMatrixNxN::translate4x4()
if (z == 0.0f) {
QMatrix4x4 m4b(m3);
m4b.translate(x, y);
- QVERIFY(m4b == m4);
+ QCOMPARE(m4b, m4);
}
}
@@ -3073,7 +3073,7 @@ void tst_QMatrixNxN::convertQMatrix()
QPointF p2 = m2 * QPointF(100.0, 150.0);
QCOMPARE((double)p2.x(), 100.0 - 3.5);
QCOMPARE((double)p2.y(), 150.0 + 2.0);
- QVERIFY(m1 == m2.toAffine());
+ QCOMPARE(m1, m2.toAffine());
QMatrix m3;
m3.scale(1.5, -2.0);
@@ -3085,7 +3085,7 @@ void tst_QMatrixNxN::convertQMatrix()
QPointF p4 = m4 * QPointF(100.0, 150.0);
QCOMPARE((double)p4.x(), 1.5 * 100.0);
QCOMPARE((double)p4.y(), -2.0 * 150.0);
- QVERIFY(m3 == m4.toAffine());
+ QCOMPARE(m3, m4.toAffine());
QMatrix m5;
m5.rotate(45.0);
@@ -3120,7 +3120,7 @@ void tst_QMatrixNxN::convertQTransform()
QPointF p2 = m2 * QPointF(100.0, 150.0);
QCOMPARE((double)p2.x(), 100.0 - 3.5);
QCOMPARE((double)p2.y(), 150.0 + 2.0);
- QVERIFY(m1 == m2.toTransform());
+ QCOMPARE(m1, m2.toTransform());
QTransform m3;
m3.scale(1.5, -2.0);
@@ -3132,7 +3132,7 @@ void tst_QMatrixNxN::convertQTransform()
QPointF p4 = m4 * QPointF(100.0, 150.0);
QCOMPARE((double)p4.x(), 1.5 * 100.0);
QCOMPARE((double)p4.y(), -2.0 * 150.0);
- QVERIFY(m3 == m4.toTransform());
+ QCOMPARE(m3, m4.toTransform());
QTransform m5;
m5.rotate(45.0);
@@ -3206,16 +3206,16 @@ void tst_QMatrixNxN::mapRect()
QRect recti(qRound(x), qRound(y), qRound(width), qRound(height));
QMatrix4x4 m1;
- QVERIFY(m1.mapRect(rect) == rect);
- QVERIFY(m1.mapRect(recti) == recti);
+ QCOMPARE(m1.mapRect(rect), rect);
+ QCOMPARE(m1.mapRect(recti), recti);
QMatrix4x4 m2;
m2.translate(-100.5f, 64.0f);
QRectF translated = rect.translated(-100.5f, 64.0f);
QRect translatedi = QRect(qRound(recti.x() - 100.5f), recti.y() + 64,
recti.width(), recti.height());
- QVERIFY(m2.mapRect(rect) == translated);
- QVERIFY(m2.mapRect(recti) == translatedi);
+ QCOMPARE(m2.mapRect(rect), translated);
+ QCOMPARE(m2.mapRect(recti), translatedi);
QMatrix4x4 m3;
m3.scale(-100.5f, 64.0f);
@@ -3232,7 +3232,7 @@ void tst_QMatrixNxN::mapRect()
scaley -= scaleht;
}
QRectF scaled(scalex, scaley, scalewid, scaleht);
- QVERIFY(m3.mapRect(rect) == scaled);
+ QCOMPARE(m3.mapRect(rect), scaled);
scalex = recti.x() * -100.5f;
scaley = recti.y() * 64.0f;
scalewid = recti.width() * -100.5f;
@@ -3247,7 +3247,7 @@ void tst_QMatrixNxN::mapRect()
}
QRect scaledi(qRound(scalex), qRound(scaley),
qRound(scalewid), qRound(scaleht));
- QVERIFY(m3.mapRect(recti) == scaledi);
+ QCOMPARE(m3.mapRect(recti), scaledi);
QMatrix4x4 m4;
m4.translate(-100.5f, 64.0f);
@@ -3261,7 +3261,7 @@ void tst_QMatrixNxN::mapRect()
if (transy1 > transy2)
qSwap(transy1, transy2);
QRectF trans(transx1, transy1, transx2 - transx1, transy2 - transy1);
- QVERIFY(m4.mapRect(rect) == trans);
+ QCOMPARE(m4.mapRect(rect), trans);
transx1 = recti.x() * -2.5f - 100.5f;
transy1 = recti.y() * 4.0f + 64.0f;
transx2 = (recti.x() + recti.width()) * -2.5f - 100.5f;
@@ -3273,7 +3273,7 @@ void tst_QMatrixNxN::mapRect()
QRect transi(qRound(transx1), qRound(transy1),
qRound(transx2) - qRound(transx1),
qRound(transy2) - qRound(transy1));
- QVERIFY(m4.mapRect(recti) == transi);
+ QCOMPARE(m4.mapRect(recti), transi);
m4.rotate(45.0f, 0.0f, 0.0f, 1.0f);
@@ -3290,7 +3290,7 @@ void tst_QMatrixNxN::mapRect()
QRect mri = m4.mapRect(recti);
QRect tri = t4.mapRect(recti);
- QVERIFY(mri == tri);
+ QCOMPARE(mri, tri);
}
void tst_QMatrixNxN::mapVector_data()
@@ -3389,14 +3389,14 @@ void tst_QMatrixNxN::properties()
void tst_QMatrixNxN::metaTypes()
{
- QVERIFY(QMetaType::type("QMatrix4x4") == QMetaType::QMatrix4x4);
+ QCOMPARE(QMetaType::type("QMatrix4x4"), int(QMetaType::QMatrix4x4));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QMatrix4x4)),
QByteArray("QMatrix4x4"));
QVERIFY(QMetaType::isRegistered(QMetaType::QMatrix4x4));
- QVERIFY(qMetaTypeId<QMatrix4x4>() == QMetaType::QMatrix4x4);
+ QCOMPARE(qMetaTypeId<QMatrix4x4>(), int(QMetaType::QMatrix4x4));
}
QTEST_APPLESS_MAIN(tst_QMatrixNxN)
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index ec7af97f07..1fbad5b829 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -446,7 +446,7 @@ void tst_QQuaternion::compare()
QQuaternion v5(8, 1, 2, 3);
QQuaternion v6(3, 1, 2, 4);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -522,7 +522,7 @@ void tst_QQuaternion::add()
QQuaternion v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -560,7 +560,7 @@ void tst_QQuaternion::subtract()
QQuaternion v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -569,7 +569,7 @@ void tst_QQuaternion::subtract()
QQuaternion v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -704,7 +704,7 @@ void tst_QQuaternion::multiplyFactor()
QQuaternion v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -740,7 +740,7 @@ void tst_QQuaternion::divide()
QQuaternion v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -764,7 +764,7 @@ void tst_QQuaternion::negate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(-w1, -x1, -y1, -z1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test quaternion conjugate calculations.
@@ -783,7 +783,7 @@ void tst_QQuaternion::conjugate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(w1, -x1, -y1, -z1);
- QVERIFY(v1.conjugate() == v2);
+ QCOMPARE(v1.conjugate(), v2);
}
// Test quaternion creation from an axis and an angle.
@@ -1325,14 +1325,14 @@ void tst_QQuaternion::properties()
void tst_QQuaternion::metaTypes()
{
- QVERIFY(QMetaType::type("QQuaternion") == QMetaType::QQuaternion);
+ QCOMPARE(QMetaType::type("QQuaternion"), int(QMetaType::QQuaternion));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QQuaternion)),
QByteArray("QQuaternion"));
QVERIFY(QMetaType::isRegistered(QMetaType::QQuaternion));
- QVERIFY(qMetaTypeId<QQuaternion>() == QMetaType::QQuaternion);
+ QCOMPARE(qMetaTypeId<QQuaternion>(), int(QMetaType::QQuaternion));
}
QTEST_APPLESS_MAIN(tst_QQuaternion)
diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
index d2e0bbe375..eeff2c3bae 100644
--- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
@@ -885,7 +885,7 @@ void tst_QVectorND::compare2()
QVector2D v3(3, 2);
QVector2D v4(1, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
}
@@ -899,7 +899,7 @@ void tst_QVectorND::compare3()
QVector3D v4(1, 3, 4);
QVector3D v5(1, 2, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -915,7 +915,7 @@ void tst_QVectorND::compare4()
QVector4D v5(1, 2, 3, 8);
QVector4D v6(1, 2, 4, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -969,7 +969,7 @@ void tst_QVectorND::add2()
QVector2D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1033,7 +1033,7 @@ void tst_QVectorND::add3()
QVector3D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1109,7 +1109,7 @@ void tst_QVectorND::add4()
QVector4D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1141,14 +1141,14 @@ void tst_QVectorND::subtract2()
QVector2D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
QVector2D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1181,7 +1181,7 @@ void tst_QVectorND::subtract3()
QVector3D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -1189,7 +1189,7 @@ void tst_QVectorND::subtract3()
QVector3D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1226,7 +1226,7 @@ void tst_QVectorND::subtract4()
QVector4D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -1235,7 +1235,7 @@ void tst_QVectorND::subtract4()
QVector4D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1290,7 +1290,7 @@ void tst_QVectorND::multiply2()
QVector2D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1354,7 +1354,7 @@ void tst_QVectorND::multiply3()
QVector3D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1430,7 +1430,7 @@ void tst_QVectorND::multiply4()
QVector4D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1488,7 +1488,7 @@ void tst_QVectorND::multiplyFactor2()
QVector2D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1553,7 +1553,7 @@ void tst_QVectorND::multiplyFactor3()
QVector3D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1628,7 +1628,7 @@ void tst_QVectorND::multiplyFactor4()
QVector4D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1660,7 +1660,7 @@ void tst_QVectorND::divide2()
QVector2D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1670,7 +1670,7 @@ void tst_QVectorND::divide2()
QVector2D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1704,7 +1704,7 @@ void tst_QVectorND::divide3()
QVector3D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1715,7 +1715,7 @@ void tst_QVectorND::divide3()
QVector3D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1753,7 +1753,7 @@ void tst_QVectorND::divide4()
QVector4D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1765,7 +1765,7 @@ void tst_QVectorND::divide4()
QVector4D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1798,7 +1798,7 @@ void tst_QVectorND::divideFactor2()
QVector2D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1830,7 +1830,7 @@ void tst_QVectorND::divideFactor3()
QVector3D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1865,7 +1865,7 @@ void tst_QVectorND::divideFactor4()
QVector4D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1887,7 +1887,7 @@ void tst_QVectorND::negate2()
QVector2D v1(x1, y1);
QVector2D v2(-x1, -y1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test vector negation for 3D vectors.
@@ -1905,7 +1905,7 @@ void tst_QVectorND::negate3()
QVector3D v1(x1, y1, z1);
QVector3D v2(-x1, -y1, -z1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test vector negation for 4D vectors.
@@ -1924,7 +1924,7 @@ void tst_QVectorND::negate4()
QVector4D v1(x1, y1, z1, w1);
QVector4D v2(-x1, -y1, -z1, -w1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test the computation of vector cross-products.
@@ -1976,7 +1976,7 @@ void tst_QVectorND::crossProduct()
QVector3D v3(x3, y3, z3);
QVector3D v4 = QVector3D::crossProduct(v1, v2);
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
// Compute the cross-product long-hand and check again.
float xres = y1 * z2 - z1 * y2;
@@ -2667,9 +2667,9 @@ void tst_QVectorND::properties()
void tst_QVectorND::metaTypes()
{
- QVERIFY(QMetaType::type("QVector2D") == QMetaType::QVector2D);
- QVERIFY(QMetaType::type("QVector3D") == QMetaType::QVector3D);
- QVERIFY(QMetaType::type("QVector4D") == QMetaType::QVector4D);
+ QCOMPARE(QMetaType::type("QVector2D"), int(QMetaType::QVector2D));
+ QCOMPARE(QMetaType::type("QVector3D"), int(QMetaType::QVector3D));
+ QCOMPARE(QMetaType::type("QVector4D"), int(QMetaType::QVector4D));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QVector2D)),
QByteArray("QVector2D"));
@@ -2682,9 +2682,9 @@ void tst_QVectorND::metaTypes()
QVERIFY(QMetaType::isRegistered(QMetaType::QVector3D));
QVERIFY(QMetaType::isRegistered(QMetaType::QVector4D));
- QVERIFY(qMetaTypeId<QVector2D>() == QMetaType::QVector2D);
- QVERIFY(qMetaTypeId<QVector3D>() == QMetaType::QVector3D);
- QVERIFY(qMetaTypeId<QVector4D>() == QMetaType::QVector4D);
+ QCOMPARE(qMetaTypeId<QVector2D>(), int(QMetaType::QVector2D));
+ QCOMPARE(qMetaTypeId<QVector3D>(), int(QMetaType::QVector3D));
+ QCOMPARE(qMetaTypeId<QVector4D>(), int(QMetaType::QVector4D));
}
QTEST_APPLESS_MAIN(tst_QVectorND)
diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
index 4f58178f2c..30982f1e24 100644
--- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
+++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
@@ -461,8 +461,8 @@ void tst_QBrush::textureBrushComparison()
imageBrush1.setTextureImage(image1);
imageBrush2.setTextureImage(image2);
- QVERIFY(imageBrush1 == imageBrush2);
- QVERIFY(pixmapBrush == imageBrush1);
+ QCOMPARE(imageBrush1, imageBrush2);
+ QCOMPARE(pixmapBrush, imageBrush1);
}
QTEST_MAIN(tst_QBrush)
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 4fafbf9827..b81a4e2c4c 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -39,6 +39,7 @@
#include <qcolor.h>
#include <qdebug.h>
#include <private/qdrawingprimitive_sse2_p.h>
+#include <qrgba64.h>
class tst_QColor : public QObject
{
@@ -105,6 +106,10 @@ private slots:
void premultiply();
void unpremultiply_sse4();
+ void qrgba64();
+ void qrgba64MemoryLayout();
+ void qrgba64Premultiply();
+ void qrgba64Equivalence();
#ifdef Q_DEAD_CODE_FROM_QT4_X11
void setallowX11ColorNames();
@@ -249,7 +254,7 @@ void tst_QColor::isValid()
{
QFETCH(QColor, color);
QFETCH(bool, isValid);
- QVERIFY(color.isValid() == isValid);
+ QCOMPARE(color.isValid(), isValid);
}
Q_DECLARE_METATYPE(QColor::NameFormat);
@@ -1321,19 +1326,19 @@ void tst_QColor::convertTo()
QColor color(Qt::black);
QColor rgb = color.convertTo(QColor::Rgb);
- QVERIFY(rgb.spec() == QColor::Rgb);
+ QCOMPARE(rgb.spec(), QColor::Rgb);
QColor hsv = color.convertTo(QColor::Hsv);
- QVERIFY(hsv.spec() == QColor::Hsv);
+ QCOMPARE(hsv.spec(), QColor::Hsv);
QColor cmyk = color.convertTo(QColor::Cmyk);
- QVERIFY(cmyk.spec() == QColor::Cmyk);
+ QCOMPARE(cmyk.spec(), QColor::Cmyk);
QColor hsl = color.convertTo(QColor::Hsl);
- QVERIFY(hsl.spec() == QColor::Hsl);
+ QCOMPARE(hsl.spec(), QColor::Hsl);
QColor invalid = color.convertTo(QColor::Invalid);
- QVERIFY(invalid.spec() == QColor::Invalid);
+ QCOMPARE(invalid.spec(), QColor::Invalid);
}
void tst_QColor::light()
@@ -1464,5 +1469,102 @@ void tst_QColor::unpremultiply_sse4()
QSKIP("SSE4 not supported on this CPU.");
}
+void tst_QColor::qrgba64()
+{
+ QRgba64 rgb64 = QRgba64::fromRgba(0x22, 0x33, 0x44, 0xff);
+ QCOMPARE(rgb64.red(), quint16(0x2222));
+ QCOMPARE(rgb64.green(), quint16(0x3333));
+ QCOMPARE(rgb64.blue(), quint16(0x4444));
+ QCOMPARE(rgb64.alpha(), quint16(0xffff));
+
+ QColor c(rgb64);
+ QCOMPARE(c.red(), 0x22);
+ QCOMPARE(c.green(), 0x33);
+ QCOMPARE(c.blue(), 0x44);
+
+ QCOMPARE(c.rgba64(), rgb64);
+
+ QColor c2 = QColor::fromRgb(0x22, 0x33, 0x44, 0xff);
+ QCOMPARE(c, c2);
+ QCOMPARE(c2.rgba64(), rgb64);
+
+ rgb64.setAlpha(0x8000);
+ rgb64.setGreen(0x8844);
+ rgb64 = rgb64.premultiplied();
+ QCOMPARE(rgb64.red(), quint16(0x1111));
+ QCOMPARE(rgb64.blue(), quint16(0x2222));
+ QCOMPARE(rgb64.green(), quint16(0x4422));
+}
+
+void tst_QColor::qrgba64MemoryLayout()
+{
+ QRgba64 rgb64 = QRgba64::fromRgba64(0x0123, 0x4567, 0x89ab, 0xcdef);
+ QCOMPARE(rgb64.red(), quint16(0x0123));
+ QCOMPARE(rgb64.green(), quint16(0x4567));
+ QCOMPARE(rgb64.blue(), quint16(0x89ab));
+ QCOMPARE(rgb64.alpha(), quint16(0xcdef));
+
+ // Check in-memory order, so it can be used by things like SSE
+ Q_STATIC_ASSERT(sizeof(QRgba64) == sizeof(quint64));
+ quint16 memory[4];
+ memcpy(memory, &rgb64, sizeof(QRgba64));
+ QCOMPARE(memory[0], quint16(0x0123));
+ QCOMPARE(memory[1], quint16(0x4567));
+ QCOMPARE(memory[2], quint16(0x89ab));
+ QCOMPARE(memory[3], quint16(0xcdef));
+}
+
+void tst_QColor::qrgba64Premultiply()
+{
+ // Tests that qPremultiply(qUnpremultiply(rgba64)) returns rgba64.
+ for (uint a = 0; a < 0x10000; a+=7) {
+ const uint step = std::max(a/1024, 1u);
+ for (uint c = 0; c <= a; c+=step) {
+ QRgba64 p = qRgba64(c, a-c, a-c/2, a);
+ QRgba64 pp = qPremultiply(qUnpremultiply(p));
+ QCOMPARE(pp, p);
+ }
+ }
+}
+
+void tst_QColor::qrgba64Equivalence()
+{
+ // Any ARGB32 converted back and forth.
+ for (uint a = 0; a < 256; a++) {
+ for (uint c = 0; c < 256; c++) {
+ QRgb p1 = qRgba(c, 255-c, 255-c, a);
+ QRgba64 p64 = QRgba64::fromArgb32(p1);
+ QCOMPARE(p64.toArgb32(), p1);
+ }
+ }
+ // Any unpremultiplied ARGB32 value premultipled in RGB64 (except alpha 0).
+ for (uint a = 1; a < 256; a++) {
+ for (uint c = 0; c < 256; c++) {
+ QRgb p1 = qRgba(c, 255-c, 255-c, a);
+ QRgb pp1 = qPremultiply(p1);
+ QRgba64 pp64 = qPremultiply(QRgba64::fromArgb32(p1));
+ QRgb pp2 = pp64.toArgb32();
+ // 64bit premultiplied is more accurate than 32bit, so allow slight difference.
+ QCOMPARE(qAlpha(pp2), qAlpha(pp1));
+ QVERIFY(qAbs(qRed(pp2)-qRed(pp1)) <= 1);
+ QVERIFY(qAbs(qGreen(pp2)-qGreen(pp1)) <= 1);
+ QVERIFY(qAbs(qBlue(pp2)-qBlue(pp1)) <= 1);
+ // But verify the added accuracy means we can return to accurate unpremultiplied ARGB32.
+ QRgba64 pu64 = qUnpremultiply(pp64);
+ QRgb p2 = pu64.toArgb32();
+ QCOMPARE(p2, p1);
+ }
+ }
+ // Any premultiplied ARGB32 value unpremultipled in RGB64.
+ for (uint a = 0; a < 256; a++) {
+ for (uint c = 0; c <= a; c++) {
+ QRgb pp = qRgba(c, a-c, a-c, a);
+ QRgb pu = qUnpremultiply(pp);
+ QRgba64 pu64 = qUnpremultiply(QRgba64::fromArgb32(pp));
+ QCOMPARE(pu64.toArgb32(), pu);
+ }
+ }
+}
+
QTEST_MAIN(tst_QColor)
#include "tst_qcolor.moc"
diff --git a/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp b/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp
index 964487f566..0f2f51d9b6 100644
--- a/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp
+++ b/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp
@@ -76,7 +76,7 @@ void tst_QPageLayout::basics()
QCOMPARE(simple.paintRectPixels(72), QRect(0, 0, 595, 842));
const QPageLayout a4portrait = simple;
- QVERIFY(a4portrait == simple);
+ QCOMPARE(a4portrait, simple);
// Change orientation
simple.setOrientation(QPageLayout::Landscape);
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index 7e9d438e1b..e90b516ef2 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qpainter
-QT += testlib
+QT += testlib gui-private core-private
qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpainter.cpp
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 752ab0fd8c..1ed78fa0ef 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -53,6 +53,7 @@
#endif
#include <qpixmap.h>
+#include <private/qdrawhelper_p.h>
#include <qpainter.h>
#ifndef QT_NO_WIDGETS
@@ -125,8 +126,12 @@ private slots:
void fillRect3();
void fillRect4_data() { fillRect2_data(); }
void fillRect4();
+ void fillRectNonPremul_data();
void fillRectNonPremul();
+ void fillRectRGB30_data();
+ void fillRectRGB30();
+
void drawEllipse_data();
void drawEllipse();
void drawClippedEllipse_data();
@@ -198,6 +203,11 @@ private slots:
void gradientPixelFormat_data();
void gradientPixelFormat();
+ void linearGradientRgb30_data();
+ void linearGradientRgb30();
+ void radialGradientRgb30_data();
+ void radialGradientRgb30();
+
void fpe_pixmapTransform();
void fpe_zeroLengthLines();
void fpe_divByZero();
@@ -789,7 +799,7 @@ void tst_QPainter::drawPixmapFragments()
QImage origImage = origPixmap.toImage().convertToFormat(QImage::Format_ARGB32);
QImage resImage = resPixmap.toImage().convertToFormat(QImage::Format_ARGB32);
- QVERIFY(resImage.size() == resPixmap.size());
+ QCOMPARE(resImage.size(), resPixmap.size());
QVERIFY(resImage.pixel(5, 5) == origImage.pixel(15, 15));
QVERIFY(resImage.pixel(5, 15) == origImage.pixel(15, 5));
QVERIFY(resImage.pixel(15, 5) == origImage.pixel(5, 15));
@@ -797,16 +807,16 @@ void tst_QPainter::drawPixmapFragments()
QPainter::PixmapFragment fragment = QPainter::PixmapFragment::create(QPointF(20, 20), QRectF(30, 30, 2, 2));
- QVERIFY(fragment.x == 20);
- QVERIFY(fragment.y == 20);
- QVERIFY(fragment.sourceLeft == 30);
- QVERIFY(fragment.sourceTop == 30);
- QVERIFY(fragment.width == 2);
- QVERIFY(fragment.height == 2);
- QVERIFY(fragment.scaleX == 1);
- QVERIFY(fragment.scaleY == 1);
- QVERIFY(fragment.rotation == 0);
- QVERIFY(fragment.opacity == 1);
+ QCOMPARE(fragment.x, qreal(20));
+ QCOMPARE(fragment.y, qreal(20));
+ QCOMPARE(fragment.sourceLeft, qreal(30));
+ QCOMPARE(fragment.sourceTop, qreal(30));
+ QCOMPARE(fragment.width, qreal(2));
+ QCOMPARE(fragment.height, qreal(2));
+ QCOMPARE(fragment.scaleX, qreal(1));
+ QCOMPARE(fragment.scaleY, qreal(1));
+ QCOMPARE(fragment.rotation, qreal(0));
+ QCOMPARE(fragment.opacity, qreal(1));
}
void tst_QPainter::drawPixmapNegativeScale()
@@ -1245,22 +1255,87 @@ void tst_QPainter::fillRect4()
QCOMPARE(image, expected);
}
+void tst_QPainter::fillRectNonPremul_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+ QTest::addColumn<uint>("color");
+
+ QTest::newRow("argb32 7f1f3f7f") << QImage::Format_ARGB32 << qRgba(31, 63, 127, 127);
+ QTest::newRow("rgba8888 7f1f3f7f") << QImage::Format_RGBA8888 << qRgba(31, 63, 127, 127);
+
+ QTest::newRow("argb32 3f1f3f7f") << QImage::Format_ARGB32 << qRgba(31, 63, 127, 63);
+ QTest::newRow("rgba8888 3f1f3f7f") << QImage::Format_RGBA8888 << qRgba(31, 63, 127, 63);
+
+ QTest::newRow("argb32 070375f4") << QImage::Format_ARGB32 << qRgba(3, 117, 244, 7);
+ QTest::newRow("rgba8888 070375f4") << QImage::Format_RGBA8888 << qRgba(3, 117, 244, 7);
+
+ QTest::newRow("argb32 0301fe0c") << QImage::Format_ARGB32 << qRgba(1, 254, 12, 3);
+ QTest::newRow("rgba8888 0301fe0c") << QImage::Format_RGBA8888 << qRgba(1, 254, 12, 3);
+
+ QTest::newRow("argb32 01804010") << QImage::Format_ARGB32 << qRgba(128, 64, 32, 1);
+ QTest::newRow("rgba8888 01804010") << QImage::Format_RGBA8888 << qRgba(128, 64, 32, 1);
+}
+
void tst_QPainter::fillRectNonPremul()
{
- QImage img1(1, 1, QImage::Format_ARGB32);
- QImage img2(1, 1, QImage::Format_RGBA8888);
+ QFETCH(QImage::Format, format);
+ QFETCH(uint, color);
+
+ QImage image(1, 1, format);
+ QRectF rect(0, 0, 1, 1);
+
+ // Fill with CompositionMode_SourceOver tests blend_color
+ image.fill(Qt::transparent);
+ QPainter painter(&image);
+ painter.fillRect(rect, QColor::fromRgba(color));
+ painter.end();
+
+ // Fill with CompositionMode_Source tests rectfill.
+ painter.begin(&image);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(rect, QColor::fromRgba(color));
+ painter.end();
+
+ QRgb p = image.pixel(0, 0);
+ QCOMPARE(qAlpha(p), qAlpha(color));
+ QVERIFY(qAbs(qRed(p)-qRed(color)) <= 1);
+ QVERIFY(qAbs(qGreen(p)-qGreen(color)) <= 1);
+ QVERIFY(qAbs(qBlue(p)-qBlue(color)) <= 1);
+}
+
+void tst_QPainter::fillRectRGB30_data()
+{
+ QTest::addColumn<uint>("color");
- QPainter p1(&img1);
- QPainter p2(&img2);
+ QTest::newRow("17|43|259") << (0xc0000000 | (17 << 20) | (43 << 10) | 259);
+ QTest::newRow("2|33|444") << (0xc0000000 | (2 << 20) | (33 << 10) | 444);
+ QTest::newRow("1000|1000|1000") << (0xc0000000 | (1000 << 20) | (1000 << 10) | 1000);
+}
+void tst_QPainter::fillRectRGB30()
+{
+ QFETCH(uint, color);
QRectF rect(0, 0, 1, 1);
- p1.fillRect(rect, qRgba(31, 63, 127, 127));
- p2.fillRect(rect, qRgba(31, 63, 127, 127));
- p1.end();
- p2.end();
+ // Fill with CompositionMode_SourceOver tests blend_color
+ QImage image1(1, 1, QImage::Format_A2BGR30_Premultiplied);
+ image1.fill(Qt::transparent);
+ QPainter painter(&image1);
+ painter.fillRect(rect, QColor::fromRgba64(qConvertA2rgb30ToRgb64<PixelOrderBGR>(color)));
+ painter.end();
+
+ uint pixel1 = ((const uint*)(image1.bits()))[0];
+ QCOMPARE(pixel1, color);
+
+ // Fill with CompositionMode_Source tests rectfill.
+ QImage image2(1, 1, QImage::Format_RGB30);
+ painter.begin(&image2);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(rect, QColor::fromRgba64(qConvertA2rgb30ToRgb64<PixelOrderRGB>(color)));
+ painter.end();
- QCOMPARE(img1.pixel(0, 0), img2.pixel(0,0));
+ uint pixel2 = ((const uint*)(image2.bits()))[0];
+ QCOMPARE(pixel2, color);
}
void tst_QPainter::drawPath_data()
@@ -1406,7 +1481,7 @@ void tst_QPainter::drawPath3()
p.drawPath(path);
p.end();
- QVERIFY(imgA == imgB);
+ QCOMPARE(imgA, imgB);
imgA.invertPixels();
imgB.fill(0xffffff);
@@ -1420,7 +1495,7 @@ void tst_QPainter::drawPath3()
p.drawPath(path);
p.end();
- QVERIFY(imgA == imgB);
+ QCOMPARE(imgA, imgB);
path.setFillRule(Qt::WindingFill);
imgB.fill(0xffffff);
@@ -2381,36 +2456,50 @@ void tst_QPainter::setOpacity_data()
QTest::newRow("RGBx8888 on RGBx8888") << QImage::Format_RGBX8888
<< QImage::Format_RGBX8888;
- QTest::newRow("RGBA8888P on ARGB32P") << QImage::Format_RGBA8888_Premultiplied
+ QTest::newRow("RGBA8888P on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_RGBA8888_Premultiplied;
+
+ QTest::newRow("RGBx8888 on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_RGBX8888;
+
+ QTest::newRow("ARGB32P on RGBA8888P") << QImage::Format_RGBA8888_Premultiplied
<< QImage::Format_ARGB32_Premultiplied;
- QTest::newRow("RGBx8888 on ARGB32P") << QImage::Format_RGBX8888
- << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("RGB32 on RGBx8888") << QImage::Format_RGBX8888
+ << QImage::Format_RGB32;
- QTest::newRow("ARGB32P on RGBA8888P") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_RGBA8888_Premultiplied;
+ QTest::newRow("RGB30 on RGB32") << QImage::Format_RGB32
+ << QImage::Format_BGR30;
- QTest::newRow("RGB32 on RGBx8888") << QImage::Format_RGB32
- << QImage::Format_RGBX8888;
+ QTest::newRow("BGR30 on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_BGR30;
+
+ QTest::newRow("A2RGB30P on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_A2BGR30_Premultiplied;
QTest::newRow("A2RGB30P on A2RGB30P") << QImage::Format_A2RGB30_Premultiplied
<< QImage::Format_A2RGB30_Premultiplied;
- QTest::newRow("ARGB32P on A2RGB30P") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_A2RGB30_Premultiplied;
+ QTest::newRow("ARGB32P on A2RGB30P") << QImage::Format_A2RGB30_Premultiplied
+ << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("RGB32 on A2BGR30P") << QImage::Format_A2BGR30_Premultiplied
+ << QImage::Format_RGB32;
- QTest::newRow("RGB32 on A2BGR30P") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_A2BGR30_Premultiplied;
+ QTest::newRow("RGB30 on A2BGR30P") << QImage::Format_A2BGR30_Premultiplied
+ << QImage::Format_RGB30;
- QTest::newRow("A2RGB30P on A2BGR30P") << QImage::Format_A2RGB30_Premultiplied
- << QImage::Format_A2BGR30_Premultiplied;
+ QTest::newRow("A2RGB30P on A2BGR30P") << QImage::Format_A2BGR30_Premultiplied
+ << QImage::Format_A2RGB30_Premultiplied;
- QTest::newRow("ARGB32P on BGR30") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_BGR30;
+ QTest::newRow("ARGB32P on BGR30") << QImage::Format_BGR30
+ << QImage::Format_ARGB32_Premultiplied;
- QTest::newRow("ARGB32P on RGB30") << QImage::Format_A2RGB30_Premultiplied
- << QImage::Format_RGB30;
+ QTest::newRow("ARGB32P on RGB30") << QImage::Format_RGB30
+ << QImage::Format_ARGB32_Premultiplied;
+
+ QTest::newRow("A2RGB30P on RGB30") << QImage::Format_RGB30
+ << QImage::Format_A2RGB30_Premultiplied;
}
@@ -2492,7 +2581,7 @@ void tst_QPainter::drawhelper_blend_untransformed()
QImage expected(size - 2, size, destFormat);
p.begin(&expected);
p.fillRect(0, 0, expected.width(), expected.height(),
- QColor(dest.pixel(1, 0)));
+ dest.pixelColor(1, 0));
p.end();
const QImage subDest(dest.bits() + dest.depth() / 8,
@@ -2500,9 +2589,7 @@ void tst_QPainter::drawhelper_blend_untransformed()
dest.bytesPerLine(), dest.format());
if (dest.format() == QImage::Format_ARGB8565_Premultiplied ||
- dest.format() == QImage::Format_ARGB8555_Premultiplied ||
- dest.format() == QImage::Format_A2BGR30_Premultiplied ||
- dest.format() == QImage::Format_A2RGB30_Premultiplied ) {
+ dest.format() == QImage::Format_ARGB8555_Premultiplied) {
// Test skipped due to rounding errors...
continue;
}
@@ -2551,7 +2638,7 @@ void tst_QPainter::drawhelper_blend_tiled_untransformed()
QImage expected(size - 2, size, destFormat);
p.begin(&expected);
p.fillRect(0, 0, expected.width(), expected.height(),
- QColor(dest.pixel(1, 0)));
+ dest.pixelColor(1, 0));
p.end();
const QImage subDest(dest.bits() + dest.depth() / 8,
@@ -2619,28 +2706,6 @@ void tst_QPainter::porterDuff_warning()
QVERIFY(qInstallMessageHandler(old) == porterDuff_warningChecker);
}
-class quint24
-{
-public:
- inline quint24(quint32 v)
- {
- data[0] = qBlue(v);
- data[1] = qGreen(v);
- data[2] = qRed(v);
- }
-
- inline operator quint32 ()
- {
- return qRgb(data[2], data[1], data[0]);
- }
-
- inline bool operator==(const quint24 &v) const {
- return (data[0] == v.data[0] && data[1] == v.data[1] && data[2] == v.data[2]);
- }
-
- uchar data[3];
-};
-
void tst_QPainter::drawhelper_blend_color()
{
QImage dest(32, 32, QImage::Format_ARGB8555_Premultiplied);
@@ -3889,6 +3954,65 @@ void tst_QPainter::gradientInterpolation()
}
}
+void tst_QPainter::linearGradientRgb30_data()
+{
+ QTest::addColumn<QColor>("stop0");
+ QTest::addColumn<QColor>("stop1");
+
+ QTest::newRow("white->black") << QColor(Qt::white) << QColor(Qt::black);
+ QTest::newRow("blue->black") << QColor(Qt::blue) << QColor(Qt::black);
+ QTest::newRow("white->red") << QColor(Qt::white) << QColor(Qt::red);
+}
+
+void tst_QPainter::linearGradientRgb30()
+{
+ QFETCH(QColor, stop0);
+ QFETCH(QColor, stop1);
+
+ QLinearGradient gradient(0, 0, 1000, 1);
+ gradient.setColorAt(0.0, stop0);
+ gradient.setColorAt(1.0, stop1);
+
+ QImage image(1000, 1, QImage::Format_RGB30);
+ QPainter painter(&image);
+ painter.fillRect(image.rect(), gradient);
+ painter.end();
+
+ for (int i = 1; i < 1000; ++i) {
+ QColor p1 = image.pixelColor(i - 1, 0);
+ QColor p2 = image.pixelColor(i, 0);
+ QVERIFY(p1 != p2);
+ QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
+ }
+}
+
+void tst_QPainter::radialGradientRgb30_data()
+{
+ linearGradientRgb30_data();
+}
+
+void tst_QPainter::radialGradientRgb30()
+{
+ QFETCH(QColor, stop0);
+ QFETCH(QColor, stop1);
+
+ QRadialGradient gradient(0, 0, 1000);
+ gradient.setColorAt(0.0, stop0);
+ gradient.setColorAt(1.0, stop1);
+
+ QImage image(1000, 1, QImage::Format_A2BGR30_Premultiplied);
+ QPainter painter(&image);
+ painter.fillRect(image.rect(), gradient);
+ painter.end();
+
+ for (int i = 1; i < 1000; ++i) {
+ QColor p1 = image.pixelColor(i - 1, 0);
+ QColor p2 = image.pixelColor(i, 0);
+ QVERIFY(p1 != p2);
+ QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
+ }
+}
+
void tst_QPainter::drawPolygon()
{
QImage img(128, 128, QImage::Format_ARGB32_Premultiplied);
@@ -4064,10 +4188,10 @@ void tst_QPainter::extendedBlendModes()
QVERIFY(testCompositionMode(255, 255, 255, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode( 0, 0, 0, QPainter::CompositionMode_Plus, 0.3));
- QVERIFY(testCompositionMode(127, 128, 165, QPainter::CompositionMode_Plus, 0.3));
- QVERIFY(testCompositionMode(127, 0, 37, QPainter::CompositionMode_Plus, 0.3));
+ QVERIFY(testCompositionMode(126, 128, 165, QPainter::CompositionMode_Plus, 0.3));
+ QVERIFY(testCompositionMode(127, 0, 38, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode( 0, 127, 127, QPainter::CompositionMode_Plus, 0.3));
- QVERIFY(testCompositionMode(255, 0, 75, QPainter::CompositionMode_Plus, 0.3));
+ QVERIFY(testCompositionMode(255, 0, 76, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode( 0, 255, 255, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode(128, 128, 166, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode(186, 200, 255, QPainter::CompositionMode_Plus, 0.3));
@@ -4752,6 +4876,22 @@ void tst_QPainter::blendARGBonRGB_data()
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 125;
QTest::newRow("ARGB_PM source-in RGB666") << QImage::Format_RGB666 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 125;
+ QTest::newRow("ARGB over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 85) << 85;
+ QTest::newRow("ARGB_PM over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_SourceOver << qRgba(85, 0, 0, 85) << 85;
+ QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_Source << qRgba(255, 0, 0, 85) << 85;
+ QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_Source << qRgba(255, 0, 0, 120) << 85;
+ QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_Source << qRgba(85, 0, 0, 85) << 85;
+ QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_Source << qRgba(180, 0, 0, 180) << 170;
+ QTest::newRow("ARGB source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 85) << 85;
+ QTest::newRow("ARGB_PM source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_SourceIn << qRgba(85, 0, 0, 85) << 85;
}
void tst_QPainter::blendARGBonRGB()
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 0a073f5c84..ae30719ee7 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -602,16 +602,16 @@ void tst_QPainterPath::testOperatorEquals()
{
QPainterPath empty1;
QPainterPath empty2;
- QVERIFY(empty1 == empty2);
+ QCOMPARE(empty1, empty2);
QPainterPath rect1;
rect1.addRect(100, 100, 100, 100);
- QVERIFY(rect1 == rect1);
+ QCOMPARE(rect1, rect1);
QVERIFY(rect1 != empty1);
QPainterPath rect2;
rect2.addRect(100, 100, 100, 100);
- QVERIFY(rect1 == rect2);
+ QCOMPARE(rect1, rect2);
rect2.setFillRule(Qt::WindingFill);
QVERIFY(rect1 != rect2);
@@ -622,7 +622,7 @@ void tst_QPainterPath::testOperatorEquals()
QPainterPath ellipse2;
ellipse2.addEllipse(50, 50, 100, 100);
- QVERIFY(ellipse1 == ellipse2);
+ QCOMPARE(ellipse1, ellipse2);
}
void tst_QPainterPath::testOperatorEquals_fuzzy()
@@ -638,12 +638,12 @@ void tst_QPainterPath::testOperatorEquals_fuzzy()
QPainterPath pb;
pb.addRect(b);
- QVERIFY(pa == pb);
+ QCOMPARE(pa, pb);
QTransform transform;
transform.translate(-100, -100);
- QVERIFY(transform.map(pa) == transform.map(pb));
+ QCOMPARE(transform.map(pa), transform.map(pb));
}
// higher tolerance for error when path's bounding rect is big
@@ -656,12 +656,12 @@ void tst_QPainterPath::testOperatorEquals_fuzzy()
QPainterPath pb;
pb.addRect(b);
- QVERIFY(pa == pb);
+ QCOMPARE(pa, pb);
QTransform transform;
transform.translate(-1, -1);
- QVERIFY(transform.map(pa) == transform.map(pb));
+ QCOMPARE(transform.map(pa), transform.map(pb));
}
// operator== should return true for a path that has
@@ -676,7 +676,7 @@ void tst_QPainterPath::testOperatorEquals_fuzzy()
QPainterPath b = transform.inverted().map(transform.map(a));
- QVERIFY(a == b);
+ QCOMPARE(a, b);
}
{
@@ -720,7 +720,7 @@ void tst_QPainterPath::testOperatorDatastream()
stream >> other;
}
- QVERIFY(other == path);
+ QCOMPARE(other, path);
}
void tst_QPainterPath::closing()
@@ -1066,19 +1066,19 @@ void tst_QPainterPath::setElementPositionAt()
{
QPainterPath path(QPointF(42., 42.));
QCOMPARE(path.elementCount(), 1);
- QVERIFY(path.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(path.elementAt(0).type, QPainterPath::MoveToElement);
QCOMPARE(path.elementAt(0).x, qreal(42.));
QCOMPARE(path.elementAt(0).y, qreal(42.));
QPainterPath copy = path;
copy.setElementPositionAt(0, qreal(0), qreal(0));
QCOMPARE(copy.elementCount(), 1);
- QVERIFY(copy.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(copy.elementAt(0).type, QPainterPath::MoveToElement);
QCOMPARE(copy.elementAt(0).x, qreal(0));
QCOMPARE(copy.elementAt(0).y, qreal(0));
QCOMPARE(path.elementCount(), 1);
- QVERIFY(path.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(path.elementAt(0).type, QPainterPath::MoveToElement);
QCOMPARE(path.elementAt(0).x, qreal(42.));
QCOMPARE(path.elementAt(0).y, qreal(42.));
}
@@ -1253,10 +1253,10 @@ void tst_QPainterPath::connectPathMoveTo()
path1.connectPath(path2);
- QVERIFY(path1.elementAt(0).type == QPainterPath::MoveToElement);
- QVERIFY(path2.elementAt(0).type == QPainterPath::MoveToElement);
- QVERIFY(path3.elementAt(0).type == QPainterPath::MoveToElement);
- QVERIFY(path4.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(path1.elementAt(0).type, QPainterPath::MoveToElement);
+ QCOMPARE(path2.elementAt(0).type, QPainterPath::MoveToElement);
+ QCOMPARE(path3.elementAt(0).type, QPainterPath::MoveToElement);
+ QCOMPARE(path4.elementAt(0).type, QPainterPath::MoveToElement);
}
void tst_QPainterPath::translate()
diff --git a/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp b/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
index 4bc31baba8..5eaee1192a 100644
--- a/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
+++ b/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
@@ -50,8 +50,7 @@ private slots:
void tst_QPdfWriter::basics()
{
QTemporaryFile file;
- if (!file.open())
- QSKIP("Couldn't open temp file!");
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QPdfWriter writer(file.fileName());
QCOMPARE(writer.title(), QString());
@@ -150,8 +149,7 @@ void tst_QPdfWriter::testPageMetrics()
QSizeF sizeMMf = QSizeF(widthMMf, heightMMf);
QTemporaryFile file;
- if (!file.open())
- QSKIP("Couldn't open temp file!");
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QPdfWriter writer(file.fileName());
QCOMPARE(writer.pageLayout().orientation(), QPageLayout::Portrait);
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index c0e3c6d187..33f81cc10e 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -173,7 +173,7 @@ void tst_QRegion::setRects()
QRect rect;
region.setRects(&rect, 0);
QVERIFY(region.isEmpty());
- QVERIFY(region == QRegion());
+ QCOMPARE(region, QRegion());
QVERIFY(!region.boundingRect().isValid());
QVERIFY(region.rects().isEmpty());
}
diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
index 13b15d09dd..60b89aa6ab 100644
--- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
@@ -57,6 +57,7 @@ private slots:
void mapRect();
void assignments();
void mapToPolygon();
+ void qhash();
void translate();
void scale();
void matrix();
@@ -361,6 +362,22 @@ void tst_QTransform::mapToPolygon()
QVERIFY(equal);
}
+void tst_QTransform::qhash()
+{
+ QMatrix m1;
+ m1.shear(3.0, 2.0);
+ m1.rotate(44);
+
+ QMatrix m2 = m1;
+
+ QTransform t1(m1);
+ QTransform t2(m2);
+
+ // not really much to test here, so just the bare minimum:
+ QCOMPARE(qHash(m1), qHash(m2));
+ QCOMPARE(qHash(t1), qHash(t2));
+}
+
void tst_QTransform::translate()
{
@@ -411,14 +428,14 @@ void tst_QTransform::matrix()
mat1.m21(), mat1.m22(), 0,
mat1.dx(), mat1.dy(), 1);
- QVERIFY(tran1 == dummy);
- QVERIFY(tran1.inverted() == dummy.inverted());
- QVERIFY(tran1.inverted() == QTransform(mat1.inverted()));
- QVERIFY(tran2.inverted() == QTransform(mat2.inverted()));
+ QCOMPARE(tran1, dummy);
+ QCOMPARE(tran1.inverted(), dummy.inverted());
+ QCOMPARE(tran1.inverted(), QTransform(mat1.inverted()));
+ QCOMPARE(tran2.inverted(), QTransform(mat2.inverted()));
QMatrix mat3 = mat1 * mat2;
QTransform tran3 = tran1 * tran2;
- QVERIFY(QTransform(mat3) == tran3);
+ QCOMPARE(QTransform(mat3), tran3);
/* QMatrix::operator==() doesn't use qFuzzyCompare(), which
* on win32-g++ results in a failure. So we work around it by
@@ -430,15 +447,15 @@ void tst_QTransform::matrix()
QRect rect(43, 70, 200, 200);
QPoint pt(43, 66);
- QVERIFY(tranInv.map(pt) == matInv.map(pt));
- QVERIFY(tranInv.map(pt) == matInv.map(pt));
+ QCOMPARE(tranInv.map(pt), matInv.map(pt));
+ QCOMPARE(tranInv.map(pt), matInv.map(pt));
QPainterPath path;
path.moveTo(55, 60);
path.lineTo(110, 110);
path.quadTo(220, 50, 10, 20);
path.closeSubpath();
- QVERIFY(tranInv.map(path) == matInv.map(path));
+ QCOMPARE(tranInv.map(path), matInv.map(path));
}
void tst_QTransform::testOffset()
@@ -724,8 +741,8 @@ void tst_QTransform::inverted()
const QTransform inverted = matrix.inverted();
- QVERIFY(matrix.isIdentity() == inverted.isIdentity());
- QVERIFY(matrix.type() == inverted.type());
+ QCOMPARE(matrix.isIdentity(), inverted.isIdentity());
+ QCOMPARE(matrix.type(), inverted.type());
QVERIFY((matrix * inverted).isIdentity());
QVERIFY((inverted * matrix).isIdentity());
diff --git a/tests/auto/gui/qopengl/BLACKLIST b/tests/auto/gui/qopengl/BLACKLIST
new file mode 100644
index 0000000000..7f167d81df
--- /dev/null
+++ b/tests/auto/gui/qopengl/BLACKLIST
@@ -0,0 +1,8 @@
+[fboRendering]
+windows
+[QTBUG15621_triangulatingStrokerDivZero]
+windows
+[imageFormatPainting]
+windows
+[openGLPaintDevice]
+windows
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 3e66bcbf70..e2ad502a52 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -87,6 +87,8 @@ private slots:
void fboRenderingRGB30_data();
void fboRenderingRGB30();
void fboHandleNulledAfterContextDestroyed();
+ void fboMRT();
+ void fboMRT_differentFormats();
void openGLPaintDevice_data();
void openGLPaintDevice();
void aboutToBeDestroyed();
@@ -515,7 +517,7 @@ void tst_QOpenGL::fboTextureOwnership()
// pull out the texture
GLuint texture = fbo->takeTexture();
QVERIFY(texture != 0);
- QVERIFY(fbo->texture() == 0);
+ QCOMPARE(fbo->texture(), GLuint(0));
// verify that the next bind() creates a new texture
fbo->bind();
@@ -595,6 +597,14 @@ void tst_QOpenGL::fboRenderingRGB30_data()
common_data();
}
+#ifndef GL_RGB5_A1
+#define GL_RGB5_A1 0x8057
+#endif
+
+#ifndef GL_RGBA8
+#define GL_RGBA8 0x8058
+#endif
+
#ifndef GL_RGB10_A2
#define GL_RGB10_A2 0x8059
#endif
@@ -607,6 +617,24 @@ void tst_QOpenGL::fboRenderingRGB30_data()
#define GL_FULL_SUPPORT 0x82B7
#endif
+static bool hasRGB10A2(QOpenGLContext *ctx)
+{
+ if (ctx->format().majorVersion() < 3)
+ return false;
+#ifndef QT_OPENGL_ES_2
+ if (!ctx->isOpenGLES() && ctx->format().majorVersion() >= 4) {
+ GLint value = -1;
+ QOpenGLFunctions_4_2_Core* vFuncs = ctx->versionFunctions<QOpenGLFunctions_4_2_Core>();
+ if (vFuncs && vFuncs->initializeOpenGLFunctions()) {
+ vFuncs->glGetInternalformativ(GL_TEXTURE_2D, GL_RGB10_A2, GL_FRAMEBUFFER_RENDERABLE, 1, &value);
+ if (value != GL_FULL_SUPPORT)
+ return false;
+ }
+ }
+#endif
+ return true;
+}
+
void tst_QOpenGL::fboRenderingRGB30()
{
#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(__x86_64__)
@@ -624,24 +652,9 @@ void tst_QOpenGL::fboRenderingRGB30()
if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
QSKIP("QOpenGLFramebufferObject not supported on this platform");
- if (ctx.format().majorVersion() < 3)
+ if (!hasRGB10A2(&ctx))
QSKIP("An internal RGB30_A2 format is not guaranteed on this platform");
-#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
- // NVidia currently only supports RGB30 and RGB30_A2 in their Quadro drivers,
- // but they do provide an extension for querying the support. We use the query
- // in case they implement the required formats later.
- if (!ctx.isOpenGLES() && ctx.format().majorVersion() >= 4) {
- GLint value = -1;
- QOpenGLFunctions_4_2_Core* vFuncs = ctx.versionFunctions<QOpenGLFunctions_4_2_Core>();
- if (vFuncs && vFuncs->initializeOpenGLFunctions()) {
- vFuncs->glGetInternalformativ(GL_TEXTURE_2D, GL_RGB10_A2, GL_FRAMEBUFFER_RENDERABLE, 1, &value);
- if (value != GL_FULL_SUPPORT)
- QSKIP("The required RGB30_A2 format is not supported by this driver");
- }
- }
-#endif
-
// No multisample with combined depth/stencil attachment:
QOpenGLFramebufferObjectFormat fboFormat;
fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
@@ -721,6 +734,150 @@ void tst_QOpenGL::fboHandleNulledAfterContextDestroyed()
QCOMPARE(fbo->handle(), 0U);
}
+void tst_QOpenGL::fboMRT()
+{
+ QWindow window;
+ window.setSurfaceType(QWindow::OpenGLSurface);
+ window.setGeometry(0, 0, 10, 10);
+ window.create();
+
+ QOpenGLContext ctx;
+ QVERIFY(ctx.create());
+ ctx.makeCurrent(&window);
+
+ if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QOpenGLFramebufferObject not supported on this platform");
+
+ if (!ctx.functions()->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets))
+ QSKIP("Multiple render targets not supported on this platform");
+
+ QOpenGLExtraFunctions *ef = ctx.extraFunctions();
+
+ {
+ // 3 color attachments, different sizes, same internal format, no depth/stencil.
+ QVector<QSize> sizes;
+ sizes << QSize(128, 128) << QSize(192, 128) << QSize(432, 123);
+ QOpenGLFramebufferObject fbo(sizes[0]);
+ fbo.addColorAttachment(sizes[1]);
+ fbo.addColorAttachment(sizes[2]);
+ QVERIFY(fbo.bind());
+ QCOMPARE(fbo.attachment(), QOpenGLFramebufferObject::NoAttachment);
+ QCOMPARE(sizes, fbo.sizes());
+ QCOMPARE(sizes[0], fbo.size());
+ // Clear the three buffers to red, green and blue.
+ GLenum drawBuf = GL_COLOR_ATTACHMENT0;
+ ef->glDrawBuffers(1, &drawBuf);
+ ef->glClearColor(1, 0, 0, 1);
+ ef->glClear(GL_COLOR_BUFFER_BIT);
+ drawBuf = GL_COLOR_ATTACHMENT0 + 1;
+ ef->glDrawBuffers(1, &drawBuf);
+ ef->glClearColor(0, 1, 0, 1);
+ ef->glClear(GL_COLOR_BUFFER_BIT);
+ drawBuf = GL_COLOR_ATTACHMENT0 + 2;
+ ef->glDrawBuffers(1, &drawBuf);
+ ef->glClearColor(0, 0, 1, 1);
+ ef->glClear(GL_COLOR_BUFFER_BIT);
+ // Verify, keeping in mind that only a 128x123 area is touched in the buffers.
+ // Some drivers do not get this right, unfortunately, so do not rely on it.
+ const char *vendor = (const char *) ef->glGetString(GL_VENDOR);
+ bool hasCorrectMRT = false;
+ if (vendor && strstr(vendor, "NVIDIA")) // maybe others too
+ hasCorrectMRT = true;
+ QImage img = fbo.toImage(false, 0);
+ QCOMPARE(img.size(), sizes[0]);
+ QCOMPARE(img.pixel(0, 0), qRgb(255, 0, 0));
+ if (hasCorrectMRT)
+ QCOMPARE(img.pixel(127, 122), qRgb(255, 0, 0));
+ img = fbo.toImage(false, 1);
+ QCOMPARE(img.size(), sizes[1]);
+ QCOMPARE(img.pixel(0, 0), qRgb(0, 255, 0));
+ if (hasCorrectMRT)
+ QCOMPARE(img.pixel(127, 122), qRgb(0, 255, 0));
+ img = fbo.toImage(false, 2);
+ QCOMPARE(img.size(), sizes[2]);
+ QCOMPARE(img.pixel(0, 0), qRgb(0, 0, 255));
+ if (hasCorrectMRT)
+ QCOMPARE(img.pixel(127, 122), qRgb(0, 0, 255));
+ fbo.release();
+ }
+
+ {
+ // 2 color attachments, same size, same internal format, depth/stencil.
+ QVector<QSize> sizes;
+ sizes.fill(QSize(128, 128), 2);
+ QOpenGLFramebufferObject fbo(sizes[0], QOpenGLFramebufferObject::CombinedDepthStencil);
+ fbo.addColorAttachment(sizes[1]);
+ QVERIFY(fbo.bind());
+ QCOMPARE(fbo.attachment(), QOpenGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(sizes, fbo.sizes());
+ QCOMPARE(sizes[0], fbo.size());
+ ef->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ ef->glFinish();
+ fbo.release();
+ }
+}
+
+void tst_QOpenGL::fboMRT_differentFormats()
+{
+ QWindow window;
+ window.setSurfaceType(QWindow::OpenGLSurface);
+ window.setGeometry(0, 0, 10, 10);
+ window.create();
+
+ QOpenGLContext ctx;
+ QVERIFY(ctx.create());
+ ctx.makeCurrent(&window);
+
+ QOpenGLFunctions *f = ctx.functions();
+ const char * vendor = (const char *) f->glGetString(GL_VENDOR);
+ if (vendor && strstr(vendor, "VMware, Inc."))
+ QSKIP("The tested formats may not be supported on this platform");
+
+ if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QOpenGLFramebufferObject not supported on this platform");
+
+ if (!f->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets))
+ QSKIP("Multiple render targets not supported on this platform");
+
+ if (!hasRGB10A2(&ctx))
+ QSKIP("RGB10_A2 not supported on this platform");
+
+ // 3 color attachments, same size, different internal format, depth/stencil.
+ QVector<QSize> sizes;
+ sizes.fill(QSize(128, 128), 3);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
+ QVector<GLenum> internalFormats;
+ internalFormats << GL_RGBA8 << GL_RGB10_A2 << GL_RGB5_A1;
+ format.setInternalTextureFormat(internalFormats[0]);
+ QOpenGLFramebufferObject fbo(sizes[0], format);
+ fbo.addColorAttachment(sizes[1], internalFormats[1]);
+ fbo.addColorAttachment(sizes[2], internalFormats[2]);
+
+ QVERIFY(fbo.bind());
+ QCOMPARE(fbo.attachment(), QOpenGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(sizes, fbo.sizes());
+ QCOMPARE(sizes[0], fbo.size());
+
+ QOpenGLExtraFunctions *ef = ctx.extraFunctions();
+ QVERIFY(ef->glGetError() == 0);
+ ef->glClearColor(1, 0, 0, 1);
+ GLenum drawBuf[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT0 + 1, GL_COLOR_ATTACHMENT0 + 2 };
+ ef->glDrawBuffers(3, drawBuf);
+ ef->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ QVERIFY(ef->glGetError() == 0);
+
+ QImage img = fbo.toImage(true, 0);
+ QCOMPARE(img.size(), sizes[0]);
+ QCOMPARE(img.pixel(0, 0), qRgb(255, 0, 0));
+ img = fbo.toImage(true, 1);
+ QCOMPARE(img.size(), sizes[1]);
+ QCOMPARE(img.format(), QImage::Format_A2BGR30_Premultiplied);
+ QCOMPARE(img.pixel(0, 0), qRgb(255, 0, 0));
+
+ fbo.release();
+}
+
void tst_QOpenGL::imageFormatPainting()
{
QScopedPointer<QSurface> surface(createSurface(QSurface::Window));
@@ -1175,18 +1332,18 @@ void tst_QOpenGL::textureblitterPartTargetRectTransform()
void tst_QOpenGL::defaultSurfaceFormat()
{
QSurfaceFormat fmt;
- QVERIFY(QSurfaceFormat::defaultFormat() == fmt);
+ QCOMPARE(QSurfaceFormat::defaultFormat(), fmt);
fmt.setDepthBufferSize(16);
QSurfaceFormat::setDefaultFormat(fmt);
- QVERIFY(QSurfaceFormat::defaultFormat() == fmt);
+ QCOMPARE(QSurfaceFormat::defaultFormat(), fmt);
QCOMPARE(QSurfaceFormat::defaultFormat().depthBufferSize(), 16);
QScopedPointer<QWindow> window(new QWindow);
- QVERIFY(window->requestedFormat() == fmt);
+ QCOMPARE(window->requestedFormat(), fmt);
QScopedPointer<QOpenGLContext> context(new QOpenGLContext);
- QVERIFY(context->format() == fmt);
+ QCOMPARE(context->format(), fmt);
}
#ifdef USE_GLX
@@ -1215,7 +1372,7 @@ void tst_QOpenGL::glxContextWrap()
QOpenGLContext *ctx = new QOpenGLContext;
ctx->setNativeHandle(QVariant::fromValue<QGLXNativeContext>(QGLXNativeContext(context)));
QVERIFY(ctx->create());
- QVERIFY(ctx->nativeHandle().value<QGLXNativeContext>().context() == context);
+ QCOMPARE(ctx->nativeHandle().value<QGLXNativeContext>().context(), context);
QVERIFY(nativeIf->nativeResourceForContext(QByteArrayLiteral("glxcontext"), ctx) == (void *) context);
QVERIFY(ctx->makeCurrent(window));
diff --git a/tests/auto/gui/qopenglconfig/buglist.json b/tests/auto/gui/qopenglconfig/buglist.json
index c7b8e61bc8..ef311612b2 100644
--- a/tests/auto/gui/qopenglconfig/buglist.json
+++ b/tests/auto/gui/qopenglconfig/buglist.json
@@ -103,6 +103,28 @@
]
},
{
+ "id": 7,
+ "description": "driver description test",
+ "driver_description": "Long And Special Driver Description",
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "feature2"
+ ]
+ },
+ {
+ "id": 8,
+ "description": "Windows version test",
+ "os": {
+ "type": "win",
+ "release": [ "10" ]
+ },
+ "features": [
+ "win10_feature"
+ ]
+ },
+ {
"id": 128,
"description": "check for matching GL_VENDOR",
"gl_vendor": "The Qt Company",
diff --git a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
index f88cbdc758..1cb7972cc6 100644
--- a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
+++ b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QVariant>
#include <QtCore/QDebug>
#include <QtCore/QTextStream>
+#include <QtCore/QJsonDocument>
#include <algorithm>
@@ -107,6 +108,7 @@ private slots:
void testConfiguration();
void testGlConfiguration();
void testBugList();
+ void testDefaultWindowsBlacklist();
};
static void dumpConfiguration(QTextStream &str)
@@ -243,29 +245,61 @@ void tst_QOpenGlConfig::testBugList()
QSet<QString> expectedFeatures;
expectedFeatures << "feature1";
+ // adapter info
QVersionNumber driverVersion(QVector<int>() << 9 << 18 << 13 << 4460);
- QOpenGLConfig::Gpu gpu = QOpenGLConfig::Gpu::fromDevice(0x10DE, 0x0DE9, driverVersion);
+ QOpenGLConfig::Gpu gpu = QOpenGLConfig::Gpu::fromDevice(0x10DE, 0x0DE9, driverVersion, QByteArrayLiteral("Unknown"));
QSet<QString> actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
- QVersionNumber(6, 3), fileName);
+ QVersionNumber(6, 3), QStringLiteral("7"), fileName);
QVERIFY2(expectedFeatures == actualFeatures,
msgSetMismatch(expectedFeatures, actualFeatures));
+ // driver_description
+ gpu = QOpenGLConfig::Gpu::fromDevice(0xDEAD, 0xBEEF, driverVersion, QByteArrayLiteral("Very Long And Special Driver Description"));
+ actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
+ QVersionNumber(6, 3), QStringLiteral("8"), fileName);
+ expectedFeatures = QSet<QString>() << "feature2";
+ QVERIFY2(expectedFeatures == actualFeatures,
+ msgSetMismatch(expectedFeatures, actualFeatures));
+
+ // os.release
+ gpu = QOpenGLConfig::Gpu::fromDevice(0xDEAD, 0xBEEF, driverVersion, QByteArrayLiteral("WinVerTest"));
+ actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
+ QVersionNumber(12, 34), QStringLiteral("10"), fileName);
+ expectedFeatures = QSet<QString>() << "win10_feature";
+ QVERIFY2(expectedFeatures == actualFeatures,
+ msgSetMismatch(expectedFeatures, actualFeatures));
+
+ // gl_vendor
gpu = QOpenGLConfig::Gpu::fromGLVendor(QByteArrayLiteral("Somebody Else"));
expectedFeatures.clear();
actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("linux"),
- QVersionNumber(1, 0), fileName);
+ QVersionNumber(1, 0), QString(), fileName);
QVERIFY2(expectedFeatures == actualFeatures,
msgSetMismatch(expectedFeatures, actualFeatures));
gpu = QOpenGLConfig::Gpu::fromGLVendor(QByteArrayLiteral("The Qt Company"));
expectedFeatures = QSet<QString>() << "cool_feature";
actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("linux"),
- QVersionNumber(1, 0), fileName);
+ QVersionNumber(1, 0), QString(), fileName);
QVERIFY2(expectedFeatures == actualFeatures,
msgSetMismatch(expectedFeatures, actualFeatures));
}
+void tst_QOpenGlConfig::testDefaultWindowsBlacklist()
+{
+ if (QGuiApplication::platformName().compare(QLatin1String("windows"), Qt::CaseInsensitive))
+ QSKIP("Only applicable to Windows");
+
+ QFile f(QStringLiteral(":/qt-project.org/windows/openglblacklists/default.json"));
+ QVERIFY(f.open(QIODevice::ReadOnly | QIODevice::Text));
+ QJsonParseError err;
+ QJsonDocument doc = QJsonDocument::fromJson(f.readAll(), &err);
+ QVERIFY2(err.error == 0,
+ QStringLiteral("Failed to parse built-in Windows GPU blacklist. %1 : %2")
+ .arg(err.offset).arg(err.errorString()).toLatin1());
+}
+
QTEST_MAIN(tst_QOpenGlConfig)
#include "tst_qopenglconfig.moc"
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index 5d78bc1d01..b1beb0ffd0 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -203,8 +203,8 @@ void tst_QCssParser::scanner()
QCss::Scanner::scan(QCss::Scanner::preprocess(QString::fromUtf8(inputFile.readAll())), &symbols);
QVERIFY(symbols.count() > 1);
- QVERIFY(symbols.last().token == QCss::S);
- QVERIFY(symbols.last().lexem() == QLatin1String("\n"));
+ QCOMPARE(symbols.last().token, QCss::S);
+ QCOMPARE(symbols.last().lexem(), QLatin1String("\n"));
symbols.remove(symbols.count() - 1, 1);
QFile outputFile(output);
@@ -861,7 +861,7 @@ void tst_QCssParser::colorValue()
QCss::Declaration decl;
QVERIFY(parser.parseNextDeclaration(&decl));
const QColor col = decl.colorValue();
- QVERIFY(expectedColor.isValid() == col.isValid());
+ QCOMPARE(expectedColor.isValid(), col.isValid());
QCOMPARE(col, expectedColor);
}
@@ -1304,7 +1304,7 @@ void tst_QCssParser::rulesForNode()
decls += rules.at(i).declarations;
}
- QVERIFY(decls.count() == declCount);
+ QCOMPARE(decls.count(), declCount);
if (declCount > 0)
QCOMPARE(decls.at(0).d->values.at(0).variant.toString(), value0);
@@ -1364,7 +1364,7 @@ void tst_QCssParser::shorthandBackgroundProperty()
v.extractBackground(&brush, &image, &repeat, &alignment, &origin, &attachment, &ignoredOrigin);
QFETCH(QBrush, expectedBrush);
- QVERIFY(expectedBrush.color() == brush.color());
+ QCOMPARE(expectedBrush.color(), brush.color());
QTEST(image, "expectedImage");
QTEST(int(repeat), "expectedRepeatValue");
@@ -1372,7 +1372,7 @@ void tst_QCssParser::shorthandBackgroundProperty()
//QTBUG-9674 : a second evaluation should give the same results
QVERIFY(v.extractBackground(&brush, &image, &repeat, &alignment, &origin, &attachment, &ignoredOrigin));
- QVERIFY(expectedBrush.color() == brush.color());
+ QCOMPARE(expectedBrush.color(), brush.color());
QTEST(image, "expectedImage");
QTEST(int(repeat), "expectedRepeatValue");
QTEST(int(alignment), "expectedAlignment");
@@ -1438,7 +1438,7 @@ void tst_QCssParser::pseudoElement()
decls += rules.at(i).declarations;
}
- QVERIFY(decls.count() == declCount);
+ QCOMPARE(decls.count(), declCount);
}
void tst_QCssParser::gradient_data()
@@ -1517,21 +1517,21 @@ void tst_QCssParser::gradient()
QBrush sbg, abg;
QVERIFY(ve.extractPalette(&fg, &sfg, &sbg, &abg));
if (type == "linear") {
- QVERIFY(sbg.style() == Qt::LinearGradientPattern);
+ QCOMPARE(sbg.style(), Qt::LinearGradientPattern);
const QLinearGradient *lg = static_cast<const QLinearGradient *>(sbg.gradient());
QCOMPARE(lg->start(), start);
QCOMPARE(lg->finalStop(), finalStop);
} else if (type == "conical") {
- QVERIFY(sbg.style() == Qt::ConicalGradientPattern);
+ QCOMPARE(sbg.style(), Qt::ConicalGradientPattern);
const QConicalGradient *cg = static_cast<const QConicalGradient *>(sbg.gradient());
QCOMPARE(cg->center(), start);
}
const QGradient *g = sbg.gradient();
QCOMPARE(g->spread(), QGradient::Spread(spread));
- QVERIFY(g->stops().at(0).first == stop0);
- QVERIFY(g->stops().at(0).second == color0);
- QVERIFY(g->stops().at(1).first == stop1);
- QVERIFY(g->stops().at(1).second == color1);
+ QCOMPARE(g->stops().at(0).first, stop0);
+ QCOMPARE(g->stops().at(0).second, color0);
+ QCOMPARE(g->stops().at(1).first, stop1);
+ QCOMPARE(g->stops().at(1).second, color1);
}
void tst_QCssParser::extractFontFamily_data()
@@ -1637,15 +1637,15 @@ void tst_QCssParser::extractBorder()
QSize radii[4];
extractor.extractBorder(widths, colors, styles, radii);
- QVERIFY(widths[QCss::TopEdge] == expectedTopWidth);
- QVERIFY(styles[QCss::TopEdge] == expectedTopStyle);
- QVERIFY(colors[QCss::TopEdge] == expectedTopColor);
+ QCOMPARE(widths[QCss::TopEdge], expectedTopWidth);
+ QCOMPARE(int(styles[QCss::TopEdge]), expectedTopStyle);
+ QCOMPARE(colors[QCss::TopEdge].color(), expectedTopColor);
//QTBUG-9674 : a second evaluation should give the same results
QVERIFY(extractor.extractBorder(widths, colors, styles, radii));
- QVERIFY(widths[QCss::TopEdge] == expectedTopWidth);
- QVERIFY(styles[QCss::TopEdge] == expectedTopStyle);
- QVERIFY(colors[QCss::TopEdge] == expectedTopColor);
+ QCOMPARE(widths[QCss::TopEdge], expectedTopWidth);
+ QCOMPARE(int(styles[QCss::TopEdge]), expectedTopStyle);
+ QCOMPARE(colors[QCss::TopEdge].color(), expectedTopColor);
}
void tst_QCssParser::noTextDecoration()
diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST
new file mode 100644
index 0000000000..d859dee03e
--- /dev/null
+++ b/tests/auto/gui/text/qfont/BLACKLIST
@@ -0,0 +1,2 @@
+[exactMatch]
+opensuse-13.1
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 64b06e9856..93e308b96a 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -149,7 +149,7 @@ void tst_QFont::exactMatch()
#endif
- if (QGuiApplication::platformName() == QLatin1String("xcb")) {
+ if (!QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) {
QVERIFY(QFont("sans").exactMatch());
QVERIFY(QFont("sans-serif").exactMatch());
QVERIFY(QFont("serif").exactMatch());
@@ -217,15 +217,15 @@ void tst_QFont::exactMatch()
|| fontinfo.family().isEmpty());
}
if (font.pointSize() != -1) {
- QVERIFY(font.pointSize() == fontinfo.pointSize());
+ QCOMPARE(font.pointSize(), fontinfo.pointSize());
} else {
- QVERIFY(font.pixelSize() == fontinfo.pixelSize());
+ QCOMPARE(font.pixelSize(), fontinfo.pixelSize());
}
- QVERIFY(font.italic() == fontinfo.italic());
+ QCOMPARE(font.italic(), fontinfo.italic());
if (font.weight() != fontinfo.weight()) {
qDebug("font is %s", font.toString().toLatin1().constData());
}
- QVERIFY(font.weight() == fontinfo.weight());
+ QCOMPARE(font.weight(), fontinfo.weight());
} else {
font.setFixedPitch(!fontinfo.fixedPitch());
QFontInfo fontinfo1(font);
@@ -274,12 +274,12 @@ void tst_QFont::exactMatch()
|| fontinfo.family().contains(font.family())
|| fontinfo.family().isEmpty());
if (font.pointSize() != -1) {
- QVERIFY(font.pointSize() == fontinfo.pointSize());
+ QCOMPARE(font.pointSize(), fontinfo.pointSize());
} else {
- QVERIFY(font.pixelSize() == fontinfo.pixelSize());
+ QCOMPARE(font.pixelSize(), fontinfo.pixelSize());
}
- QVERIFY(font.italic() == fontinfo.italic());
- QVERIFY(font.weight() == fontinfo.weight());
+ QCOMPARE(font.italic(), fontinfo.italic());
+ QCOMPARE(font.weight(), fontinfo.weight());
} else {
font.setFixedPitch(!fontinfo.fixedPitch());
QFontInfo fontinfo1(font, (QFont::Script) script);
@@ -371,42 +371,42 @@ void tst_QFont::compare()
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font2.setItalic(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font2.setWeight(QFont::Bold);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font2.setWeight(QFont::Normal);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setUnderline(true);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setUnderline(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setStrikeOut(true);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setStrikeOut(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setOverline(true);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setOverline(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setCapitalization(QFont::SmallCaps);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setCapitalization(QFont::MixedCase);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
}
}
@@ -426,27 +426,27 @@ void tst_QFont::resolve()
font1.setWeight(QFont::Bold);
QFont font2 = font1.resolve(font);
- QVERIFY(font2.weight() == font1.weight());
+ QCOMPARE(font2.weight(), font1.weight());
- QVERIFY(font2.pointSize() == font.pointSize());
- QVERIFY(font2.italic() == font.italic());
- QVERIFY(font2.underline() == font.underline());
- QVERIFY(font2.overline() == font.overline());
- QVERIFY(font2.strikeOut() == font.strikeOut());
- QVERIFY(font2.stretch() == font.stretch());
+ QCOMPARE(font2.pointSize(), font.pointSize());
+ QCOMPARE(font2.italic(), font.italic());
+ QCOMPARE(font2.underline(), font.underline());
+ QCOMPARE(font2.overline(), font.overline());
+ QCOMPARE(font2.strikeOut(), font.strikeOut());
+ QCOMPARE(font2.stretch(), font.stretch());
QFont font3;
font3.setStretch(QFont::UltraCondensed);
QFont font4 = font3.resolve(font1).resolve(font);
- QVERIFY(font4.stretch() == font3.stretch());
+ QCOMPARE(font4.stretch(), font3.stretch());
- QVERIFY(font4.weight() == font.weight());
- QVERIFY(font4.pointSize() == font.pointSize());
- QVERIFY(font4.italic() == font.italic());
- QVERIFY(font4.underline() == font.underline());
- QVERIFY(font4.overline() == font.overline());
- QVERIFY(font4.strikeOut() == font.strikeOut());
+ QCOMPARE(font4.weight(), font.weight());
+ QCOMPARE(font4.pointSize(), font.pointSize());
+ QCOMPARE(font4.italic(), font.italic());
+ QCOMPARE(font4.underline(), font.underline());
+ QCOMPARE(font4.overline(), font.overline());
+ QCOMPARE(font4.strikeOut(), font.strikeOut());
QFont f1,f2,f3;
@@ -479,8 +479,8 @@ void tst_QFont::resetFont()
child->setFont(QFont()); // reset font
- QVERIFY(child->font().resolve() == 0);
- QVERIFY(child->font().pointSize() == parent.font().pointSize());
+ QCOMPARE(child->font().resolve(), uint(0));
+ QCOMPARE(child->font().pointSize(), parent.font().pointSize());
QVERIFY(parent.font().resolve() != 0);
}
#endif
@@ -608,6 +608,11 @@ void tst_QFont::serialize_data()
font.setStyleName("Regular Black Condensed");
// This wasn't read until 5.4.
QTest::newRow("styleName") << font << QDataStream::Qt_5_4;
+
+ font = basicFont;
+ font.setCapitalization(QFont::AllUppercase);
+ // This wasn't read until 5.6.
+ QTest::newRow("capitalization") << font << QDataStream::Qt_5_6;
}
void tst_QFont::serialize()
@@ -728,24 +733,24 @@ void tst_QFont::sharing()
QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1 + refs_by_cache);
QFont f2(f);
- QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2), QFontPrivate::get(f));
QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
QVERIFY(QFontPrivate::get(f2)->engineData);
- QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache);
f2.setKerning(!f.kerning());
QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f));
QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1);
QVERIFY(QFontPrivate::get(f2)->engineData);
- QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2 + refs_by_cache);
f2 = f;
- QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2), QFontPrivate::get(f));
QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
QVERIFY(QFontPrivate::get(f2)->engineData);
- QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache);
if (f.pointSize() > 0)
diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
index d8e9836112..ec62bafd6c 100644
--- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
@@ -65,6 +65,7 @@ private slots:
void inFontUcs4();
void lineWidth();
void mnemonicTextWidth();
+ void leadingBelowLine();
};
tst_QFontMetrics::tst_QFontMetrics()
@@ -343,5 +344,16 @@ void tst_QFontMetrics::mnemonicTextWidth()
QCOMPARE(fm.size(Qt::TextShowMnemonic, f1), fm.size(Qt::TextShowMnemonic, f2));
QCOMPARE(fm.size(Qt::TextHideMnemonic, f1), fm.size(Qt::TextHideMnemonic, f2));
}
+
+void tst_QFontMetrics::leadingBelowLine()
+{
+ QScriptLine line;
+ line.leading = 10;
+ line.leadingIncluded = true;
+ line.ascent = 5;
+ QCOMPARE(line.height(), line.ascent + line.descent + line.leading);
+ QCOMPARE(line.base(), line.ascent);
+}
+
QTEST_MAIN(tst_QFontMetrics)
#include "tst_qfontmetrics.moc"
diff --git a/tests/auto/gui/text/qrawfont/BLACKLIST b/tests/auto/gui/text/qrawfont/BLACKLIST
new file mode 100644
index 0000000000..a614595689
--- /dev/null
+++ b/tests/auto/gui/text/qrawfont/BLACKLIST
@@ -0,0 +1,4 @@
+[correctFontData]
+osx-10.8
+[unsupportedWritingSystem]
+osx-10.8
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
index 014ed4c7c8..06448d11fe 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
+++ b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
@@ -120,7 +120,7 @@ void tst_QSyntaxHighlighter::cleanup()
class TestHighlighter : public QSyntaxHighlighter
{
public:
- inline TestHighlighter(const QList<QTextLayout::FormatRange> &fmts, QTextDocument *parent)
+ inline TestHighlighter(const QVector<QTextLayout::FormatRange> &fmts, QTextDocument *parent)
: QSyntaxHighlighter(parent), formats(fmts), highlighted(false), callCount(0) {}
inline TestHighlighter(QObject *parent)
: QSyntaxHighlighter(parent) {}
@@ -138,24 +138,15 @@ public:
++callCount;
}
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
bool highlighted;
int callCount;
QString highlightedText;
};
-QT_BEGIN_NAMESPACE
-bool operator==(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs)
-{
- return lhs.start == rhs.start
- && lhs.length == rhs.length
- && lhs.format == rhs.format;
-}
-QT_END_NAMESPACE
-
void tst_QSyntaxHighlighter::basic()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 2;
@@ -179,7 +170,7 @@ void tst_QSyntaxHighlighter::basic()
QVERIFY(hl->highlighted);
QVERIFY(lout->documentChangedCalled);
- QVERIFY(doc->begin().layout()->additionalFormats() == formats);
+ QCOMPARE(doc->begin().layout()->formats(), formats);
}
class CommentTestHighlighter : public QSyntaxHighlighter
@@ -222,7 +213,7 @@ void tst_QSyntaxHighlighter::basicTwo()
void tst_QSyntaxHighlighter::removeFormatsOnDelete()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 9;
@@ -237,9 +228,9 @@ void tst_QSyntaxHighlighter::removeFormatsOnDelete()
QVERIFY(lout->documentChangedCalled);
lout->documentChangedCalled = false;
- QVERIFY(!doc->begin().layout()->additionalFormats().isEmpty());
+ QVERIFY(!doc->begin().layout()->formats().isEmpty());
delete hl;
- QVERIFY(doc->begin().layout()->additionalFormats().isEmpty());
+ QVERIFY(doc->begin().layout()->formats().isEmpty());
QVERIFY(lout->documentChangedCalled);
}
@@ -405,7 +396,7 @@ void tst_QSyntaxHighlighter::highlightToEndOfDocument2()
void tst_QSyntaxHighlighter::preservePreeditArea()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 8;
@@ -432,12 +423,12 @@ void tst_QSyntaxHighlighter::preservePreeditArea()
hl->callCount = 0;
cursor.beginEditBlock();
- layout->setAdditionalFormats(formats);
+ layout->setFormats(formats);
cursor.endEditBlock();
QCOMPARE(hl->callCount, 1);
- formats = layout->additionalFormats();
+ formats = layout->formats();
QCOMPARE(formats.count(), 3);
range = formats.at(0);
@@ -483,7 +474,7 @@ void tst_QSyntaxHighlighter::avoidUnnecessaryRehighlight()
void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 10;
diff --git a/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp b/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
index 967fe3114e..49300871d9 100644
--- a/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
@@ -102,7 +102,7 @@ void tst_QTextBlock::fragmentOverBlockBoundaries()
// Block separators are always a fragment of their self. Thus:
// |Hello|\b|World|\b|
#if !defined(Q_OS_WIN)
- QVERIFY(doc->docHandle()->fragmentMap().numNodes() == 4);
+ QCOMPARE(doc->docHandle()->fragmentMap().numNodes(), 4);
#endif
QCOMPARE(cursor.block().text(), QString("Hello"));
cursor.movePosition(QTextCursor::NextBlock);
@@ -126,7 +126,7 @@ void tst_QTextBlock::excludeParagraphSeparatorFragment()
++it;
QVERIFY(it.atEnd());
- QVERIFY(it == block.end());
+ QCOMPARE(it, block.end());
}
void tst_QTextBlock::backwardsBlockIterator()
diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
index 42b3c53bc5..9396cd678b 100644
--- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
+++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
@@ -178,15 +178,15 @@ void tst_QTextCursor::navigation1()
QVERIFY(doc->toPlainText() == "Hello World");
cursor.movePosition(QTextCursor::End);
- QVERIFY(cursor.position() == 11);
+ QCOMPARE(cursor.position(), 11);
cursor.deletePreviousChar();
- QVERIFY(cursor.position() == 10);
+ QCOMPARE(cursor.position(), 10);
cursor.deletePreviousChar();
cursor.deletePreviousChar();
cursor.deletePreviousChar();
cursor.deletePreviousChar();
cursor.deletePreviousChar();
- QVERIFY(doc->toPlainText() == "Hello");
+ QCOMPARE(doc->toPlainText(), QLatin1String("Hello"));
QTextCursor otherCursor(doc);
otherCursor.movePosition(QTextCursor::Start);
@@ -195,12 +195,12 @@ void tst_QTextCursor::navigation1()
cursor.movePosition(QTextCursor::Right);
QVERIFY(cursor != otherCursor);
otherCursor.insertText("Hey");
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
doc->undo();
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
doc->redo();
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
doc->undo();
@@ -209,29 +209,29 @@ void tst_QTextCursor::navigation1()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, 6);
- QVERIFY(cursor.position() == 6);
+ QCOMPARE(cursor.position(), 6);
otherCursor = cursor;
otherCursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, 2);
otherCursor.deletePreviousChar();
otherCursor.deletePreviousChar();
otherCursor.deletePreviousChar();
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
cursor.movePosition(QTextCursor::End);
cursor.insertBlock();
{
int oldPos = cursor.position();
cursor.movePosition(QTextCursor::End);
- QVERIFY(cursor.position() == oldPos);
+ QCOMPARE(cursor.position(), oldPos);
}
QVERIFY(cursor.atBlockStart());
- QVERIFY(cursor.position() == 9);
+ QCOMPARE(cursor.position(), 9);
QTextCharFormat fmt;
fmt.setForeground(Qt::blue);
cursor.insertText("Test", fmt);
- QVERIFY(fmt == cursor.charFormat());
- QVERIFY(cursor.position() == 13);
+ QCOMPARE(fmt, cursor.charFormat());
+ QCOMPARE(cursor.position(), 13);
}
void tst_QTextCursor::navigation2_data()
@@ -497,7 +497,7 @@ void tst_QTextCursor::navigation10()
QVERIFY(ok);
QCOMPARE(cursor.position(), 99);
ok = cursor.movePosition(QTextCursor::NextCell);
- QVERIFY(ok == false);
+ QVERIFY(!ok);
QCOMPARE(cursor.position(), 99); // didn't move.
QVERIFY(cursor.currentTable());
@@ -573,8 +573,8 @@ void tst_QTextCursor::insertBlock()
QTextBlockFormat fmt;
fmt.setTopMargin(100);
cursor.insertBlock(fmt);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.blockFormat() == fmt);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.blockFormat(), fmt);
}
void tst_QTextCursor::insertWithBlockSeparator1()
@@ -584,28 +584,28 @@ void tst_QTextCursor::insertWithBlockSeparator1()
cursor.insertText(text);
cursor.movePosition(QTextCursor::PreviousBlock);
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 6);
+ QCOMPARE(cursor.position(), 6);
}
void tst_QTextCursor::insertWithBlockSeparator2()
{
cursor.insertText(QString(QChar::ParagraphSeparator));
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
}
void tst_QTextCursor::insertWithBlockSeparator3()
{
cursor.insertText(QString(QChar::ParagraphSeparator) + "Hi" + QString(QChar::ParagraphSeparator));
- QVERIFY(cursor.position() == 4);
+ QCOMPARE(cursor.position(), 4);
}
void tst_QTextCursor::insertWithBlockSeparator4()
{
cursor.insertText(QString(QChar::ParagraphSeparator) + QString(QChar::ParagraphSeparator));
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
}
void tst_QTextCursor::clearObjectType1()
@@ -656,7 +656,7 @@ void tst_QTextCursor::comparisonOperators1()
midCursor.movePosition(QTextCursor::NextWord);
QVERIFY(midCursor <= cursor);
- QVERIFY(midCursor == cursor);
+ QCOMPARE(midCursor, cursor);
QVERIFY(midCursor >= cursor);
QVERIFY(midCursor > startCursor);
@@ -690,7 +690,7 @@ void tst_QTextCursor::comparisonOperators2()
QTextCursor cursor2(&doc2);
QVERIFY(cursor1 != cursor2);
- QVERIFY(cursor1 == QTextCursor(&doc1));
+ QCOMPARE(cursor1, QTextCursor(&doc1));
}
void tst_QTextCursor::selection1()
@@ -718,97 +718,97 @@ void tst_QTextCursor::dontCopyTableAttributes()
void tst_QTextCursor::checkFrame1()
{
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
QPointer<QTextFrame> frame = cursor.insertFrame(QTextFrameFormat());
QVERIFY(frame != 0);
QTextFrame *root = frame->parentFrame();
QVERIFY(root != 0);
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 1);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 1);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 1);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 1);
doc->undo();
QVERIFY(!frame);
- QVERIFY(root->childFrames().size() == 0);
+ QCOMPARE(root->childFrames().size(), 0);
- QVERIFY(cursor.position() == 0);
- QVERIFY(cursor.selectionStart() == 0);
- QVERIFY(cursor.selectionEnd() == 0);
+ QCOMPARE(cursor.position(), 0);
+ QCOMPARE(cursor.selectionStart(), 0);
+ QCOMPARE(cursor.selectionEnd(), 0);
doc->redo();
frame = doc->frameAt(1);
QVERIFY(frame);
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 1);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 1);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 1);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 1);
// cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
-// QVERIFY(cursor.position() == 2);
-// QVERIFY(cursor.selectionStart() == 0);
-// QVERIFY(cursor.selectionEnd() == 2);
+// QCOMPARE(cursor.position(), 2);
+// QCOMPARE(cursor.selectionStart(), 0);
+// QCOMPARE(cursor.selectionEnd(), 2);
}
void tst_QTextCursor::checkFrame2()
{
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
cursor.insertText("A");
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
cursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor);
QPointer<QTextFrame> frame = cursor.insertFrame(QTextFrameFormat());
QTextFrame *root = frame->parentFrame();
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 2);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 2);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 2);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 2);
doc->undo();
QVERIFY(!frame);
- QVERIFY(root->childFrames().size() == 0);
+ QCOMPARE(root->childFrames().size(), 0);
- QVERIFY(cursor.position() == 0);
- QVERIFY(cursor.selectionStart() == 0);
- QVERIFY(cursor.selectionEnd() == 1);
+ QCOMPARE(cursor.position(), 0);
+ QCOMPARE(cursor.selectionStart(), 0);
+ QCOMPARE(cursor.selectionEnd(), 1);
doc->redo();
frame = doc->frameAt(1);
QVERIFY(frame);
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 2);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 2);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 2);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 2);
cursor.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor);
- QVERIFY(cursor.position() == 0);
- QVERIFY(cursor.selectionStart() == 0);
- QVERIFY(cursor.selectionEnd() == 3);
+ QCOMPARE(cursor.position(), 0);
+ QCOMPARE(cursor.selectionStart(), 0);
+ QCOMPARE(cursor.selectionEnd(), 3);
}
void tst_QTextCursor::insertBlockToUseCharFormat()
@@ -833,9 +833,9 @@ void tst_QTextCursor::insertBlockToUseCharFormat()
void tst_QTextCursor::tableMovement()
{
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
cursor.insertText("AA");
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
cursor.movePosition(QTextCursor::Left);
cursor.insertTable(3, 3);
@@ -1030,7 +1030,7 @@ void tst_QTextCursor::insertBlockShouldRemoveSelection()
cursor.insertBlock();
QVERIFY(!cursor.hasSelection());
- QVERIFY(doc->toPlainText().indexOf("Hello") == -1);
+ QCOMPARE(doc->toPlainText().indexOf("Hello"), -1);
}
void tst_QTextCursor::insertBlockShouldRemoveSelection2()
@@ -1046,7 +1046,7 @@ void tst_QTextCursor::insertBlockShouldRemoveSelection2()
cursor.insertBlock(fmt);
QVERIFY(!cursor.hasSelection());
- QVERIFY(doc->toPlainText().indexOf("Hello") == -1);
+ QCOMPARE(doc->toPlainText().indexOf("Hello"), -1);
}
void tst_QTextCursor::mergeCellShouldUpdateSelection()
@@ -1159,7 +1159,7 @@ void tst_QTextCursor::setBlockFormatInTable()
cursor.setBlockFormat(fmt);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.blockFormat().background().color() == Qt::blue);
+ QCOMPARE(cursor.blockFormat().background().color(), QColor(Qt::blue));
}
void tst_QTextCursor::blockCharFormat2()
@@ -1174,7 +1174,7 @@ void tst_QTextCursor::blockCharFormat2()
cursor.movePosition(QTextCursor::Start);
cursor.insertText("Red");
cursor.movePosition(QTextCursor::PreviousCharacter);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.charFormat().foreground().color(), QColor(Qt::red));
}
void tst_QTextCursor::blockCharFormat3()
@@ -1189,21 +1189,23 @@ void tst_QTextCursor::blockCharFormat3()
cursor.insertText("Test");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ const QColor red(Qt::red);
+ const QColor green(Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
fmt.setForeground(Qt::red);
cursor.setBlockCharFormat(fmt);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), red);
cursor.movePosition(QTextCursor::End);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
cursor.insertText("Test");
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
cursor.select(QTextCursor::Document);
cursor.removeSelectedText();
@@ -1212,7 +1214,7 @@ void tst_QTextCursor::blockCharFormat3()
QVERIFY(cursor.atStart());
cursor.insertText("Test");
- QVERIFY(cursor.charFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.charFormat().foreground().color(), red);
}
void tst_QTextCursor::blockCharFormat()
@@ -1222,12 +1224,12 @@ void tst_QTextCursor::blockCharFormat()
cursor.insertBlock(QTextBlockFormat(), fmt);
cursor.insertText("Hm");
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::blue);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::blue));
fmt.setForeground(Qt::red);
cursor.setBlockCharFormat(fmt);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::red));
}
void tst_QTextCursor::blockCharFormatOnSelection()
@@ -1249,11 +1251,11 @@ void tst_QTextCursor::blockCharFormatOnSelection()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::blue);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::blue));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::red));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::white);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::white));
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
@@ -1264,17 +1266,17 @@ void tst_QTextCursor::blockCharFormatOnSelection()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::cyan);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::cyan));
cursor.movePosition(QTextCursor::Right);
cursor.movePosition(QTextCursor::Right);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), QColor(Qt::green));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::cyan);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::cyan));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::white);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::white));
}
void tst_QTextCursor::anchorInitialized1()
@@ -1404,7 +1406,7 @@ void tst_QTextCursor::selectBlock()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
QCOMPARE(cursor.block().text(), QString("blah"));
}
@@ -1449,7 +1451,7 @@ void tst_QTextCursor::insertFragmentShouldUseCurrentCharFormat()
cursor.insertFragment(fragment);
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
- QVERIFY(cursor.charFormat() == fmt);
+ QCOMPARE(cursor.charFormat(), fmt);
}
int tst_QTextCursor::blockCount()
@@ -1910,15 +1912,15 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo()
int cursorPositionAfter = cursor.position();
cursor.endEditBlock();
- QVERIFY(doc->toPlainText() == "*AAAA*BBBB*CCCC*DDDD");
+ QCOMPARE(doc->toPlainText(), QLatin1String("*AAAA*BBBB*CCCC*DDDD"));
QCOMPARE(12, cursorPositionBefore);
QCOMPARE(1, cursorPositionAfter);
doc->undo(&cursor);
- QVERIFY(doc->toPlainText() == "AAAABBBBCCCCDDDD");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBBCCCCDDDD"));
QCOMPARE(cursor.position(), cursorPositionBefore);
doc->redo(&cursor);
- QVERIFY(doc->toPlainText() == "*AAAA*BBBB*CCCC*DDDD");
+ QCOMPARE(doc->toPlainText(), QLatin1String("*AAAA*BBBB*CCCC*DDDD"));
QCOMPARE(cursor.position(), cursorPositionAfter);
}
@@ -1932,11 +1934,11 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo2()
cursor.insertText("AAAABBBBCCCCDDDD");
cursor.endEditBlock();
doc->undo(&cursor);
- QVERIFY(doc->toPlainText() == "AAAABBBB");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBB"));
QCOMPARE(cursor.position(), cursorPositionBefore);
cursor.insertText("CCCC");
- QVERIFY(doc->toPlainText() == "AAAABBBBCCCC");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBBCCCC"));
cursorPositionBefore = cursor.position();
cursor.setPosition(0, QTextCursor::KeepAnchor);
@@ -1951,7 +1953,7 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo2()
doc->undo(&cursor);
- QVERIFY(doc->toPlainText() == "AAAABBBBCCCC");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBBCCCC"));
QCOMPARE(cursor.position(), cursorPositionBefore);
}
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index 5e6b606d83..7378ca85ee 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -744,7 +744,7 @@ void tst_QTextDocument::mightBeRichText()
{
QFETCH(QString, input);
QFETCH(bool, result);
- QVERIFY(result == Qt::mightBeRichText(input));
+ QCOMPARE(result, Qt::mightBeRichText(input));
}
Q_DECLARE_METATYPE(QTextDocumentFragment)
@@ -2222,7 +2222,7 @@ void tst_QTextDocument::clonePreservesUserStates()
b2 = b2.next();
QCOMPARE(b1.userState(), b2.userState());
}
- QVERIFY(b2 == clone->end());
+ QCOMPARE(b2, clone->end());
delete clone;
}
@@ -2269,7 +2269,7 @@ void tst_QTextDocument::resolvedFontInEmptyFormat()
doc->setDefaultFont(font);
QTextCharFormat fmt = doc->begin().charFormat();
QVERIFY(fmt.properties().isEmpty());
- QVERIFY(fmt.font() == font);
+ QCOMPARE(fmt.font(), font);
}
void tst_QTextDocument::defaultRootFrameMargin()
@@ -2369,6 +2369,7 @@ void tst_QTextDocument::deleteTextObjectsOnClear()
void tst_QTextDocument::defaultStyleSheet()
{
+ const QColor green("green");
const QString sheet("p { background-color: green; }");
QVERIFY(doc->defaultStyleSheet().isEmpty());
doc->setDefaultStyleSheet(sheet);
@@ -2376,30 +2377,30 @@ void tst_QTextDocument::defaultStyleSheet()
cursor.insertHtml("<p>test");
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
doc->clear();
cursor.insertHtml("<p>test");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
QTextDocument *clone = doc->clone();
QCOMPARE(clone->defaultStyleSheet(), sheet);
cursor = QTextCursor(clone);
cursor.insertHtml("<p>test");
fmt = clone->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
delete clone;
cursor = QTextCursor(doc);
cursor.insertHtml("<p>test");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
doc->clear();
cursor.insertHtml("<style>p { background-color: red; }</style><p>test");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("red"));
+ QCOMPARE(fmt.background().color(), QColor(Qt::red));
doc->clear();
doc->setDefaultStyleSheet("invalid style sheet....");
@@ -2567,7 +2568,7 @@ void tst_QTextDocument::setTextPreservesUndoRedoEnabled()
void tst_QTextDocument::firstLast()
{
QCOMPARE(doc->blockCount(), 1);
- QVERIFY(doc->firstBlock() == doc->lastBlock());
+ QCOMPARE(doc->firstBlock(), doc->lastBlock());
doc->setPlainText("Hello\nTest\nWorld");
@@ -3013,8 +3014,8 @@ void tst_QTextDocument::QTBUG27354_spaceAndSoftSpace()
QTextBlock block = td.begin();
while (block.isValid()) {
QTextBlockFormat fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::SingleHeight);
- QVERIFY(fmt.lineHeight() == 0);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::SingleHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(0));
block = block.next();
}
}
@@ -3164,8 +3165,8 @@ void tst_QTextDocument::cssInheritance()
QTextBlock block = td.begin();
while (block.isValid()) {
QTextBlockFormat fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::ProportionalHeight);
- QVERIFY(fmt.lineHeight() == 200);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::ProportionalHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(200));
block = block.next();
}
}
@@ -3175,12 +3176,12 @@ void tst_QTextDocument::cssInheritance()
"<p style=\"line-height: 40px\">Foo</p><p>Bar</p><p>Baz</p></body></html>");
QTextBlock block = td.begin();
QTextBlockFormat fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::FixedHeight);
- QVERIFY(fmt.lineHeight() == 40);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::FixedHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(40));
block = block.next();
fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::ProportionalHeight);
- QVERIFY(fmt.lineHeight() == 300);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::ProportionalHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(300));
}
{
QTextDocument td;
@@ -3188,7 +3189,7 @@ void tst_QTextDocument::cssInheritance()
"<p>Foo</p><p>Bar</p><p>Baz</p></body></html>");
QTextBlock block = td.begin();
while (block.isValid()) {
- QVERIFY(block.blockFormat().background() == QBrush());
+ QCOMPARE(block.blockFormat().background(), QBrush());
QVERIFY(block.charFormat().font().bold());
block = block.next();
}
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index 8f0d306cba..1cd9d9bcbe 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -727,7 +727,7 @@ void tst_QTextDocumentFragment::html_listIndents5()
QCOMPARE(list->format().indent(), 1);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.currentList() == list);
+ QCOMPARE(cursor.currentList(), list);
QCOMPARE(cursor.blockFormat().indent(), 0);
}
@@ -778,7 +778,7 @@ void tst_QTextDocumentFragment::blockCharFormatCopied()
cleanup();
init();
cursor.insertFragment(frag);
- QVERIFY(cursor.blockCharFormat() == fmt);
+ QCOMPARE(cursor.blockCharFormat(), fmt);
}
void tst_QTextDocumentFragment::initialBlock()
@@ -794,19 +794,19 @@ void tst_QTextDocumentFragment::clone()
mod.setAlignment(Qt::AlignCenter);
cursor.mergeBlockFormat(mod);
cursor.insertText("Blah");
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignCenter);
QTextDocumentFragment frag(doc);
cleanup();
init();
cursor.insertFragment(frag);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignCenter);
}
void tst_QTextDocumentFragment::dontRemoveInitialBlockIfItHoldsObjectIndexedCharFormat()
{
const char html[] = "<table><tr><td>cell one<td>cell two</tr><tr><td>cell three<td>cell four</tr></table>";
- QVERIFY(doc->begin().charFormat().objectIndex() == -1);
+ QCOMPARE(doc->begin().charFormat().objectIndex(), -1);
setHtml(QString::fromLatin1(html));
int cnt = 0;
@@ -841,13 +841,13 @@ void tst_QTextDocumentFragment::unorderedListEnumeration()
setHtml(QString::fromLatin1(html));
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDisc);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDisc);
const char html2[] = "<ul><ul><ul type=circle><li>Blah</li></ul></ul>";
setHtml(QString::fromLatin1(html2));
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListCircle);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListCircle);
}
@@ -873,7 +873,7 @@ void tst_QTextDocumentFragment::hrefAnchor()
setHtml(QString::fromLatin1(html));
QVERIFY(doc->begin().begin().fragment().charFormat().isAnchor());
QCOMPARE(doc->begin().begin().fragment().charFormat().anchorHref(), QString::fromLatin1("test"));
- QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline() == true);
+ QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline());
}
{
@@ -881,7 +881,7 @@ void tst_QTextDocumentFragment::hrefAnchor()
const char html[] = "<a>blah</a>";
setHtml(QString::fromLatin1(html));
QVERIFY(doc->begin().begin().fragment().charFormat().isAnchor());
- QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline() == false);
+ QVERIFY(!doc->begin().begin().fragment().charFormat().fontUnderline());
}
}
@@ -901,7 +901,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments()
// the 'a'
QVERIFY(it.fragment().isValid());
QCOMPARE(it.fragment().text(), QString::fromLatin1("a"));
- QVERIFY(it.fragment().charFormat().isAnchor() == false);
+ QVERIFY(!it.fragment().charFormat().isAnchor());
// the 'b' of 'blah' as separate fragment with the anchor attribute
++it;
@@ -913,7 +913,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments()
++it;
QVERIFY(it.fragment().isValid());
QVERIFY(it.fragment().text().startsWith("lah"));
- QVERIFY(it.fragment().charFormat().isAnchor() == false);
+ QVERIFY(!it.fragment().charFormat().isAnchor());
}
void tst_QTextDocumentFragment::namedAnchorFragments2()
@@ -982,7 +982,7 @@ void tst_QTextDocumentFragment::cellBlockCount()
int blockCount = 0;
for (QTextFrame::iterator it = cell.begin(); !it.atEnd(); ++it) {
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
++blockCount;
}
@@ -1003,7 +1003,7 @@ void tst_QTextDocumentFragment::cellBlockCount2()
int blockCount = 0;
for (QTextFrame::iterator it = cell.begin(); !it.atEnd(); ++it) {
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
++blockCount;
}
@@ -1037,7 +1037,7 @@ void tst_QTextDocumentFragment::emptyTable3()
QCOMPARE(table->columns(), 2);
QTextTableCell cell = table->cellAt(0, 0);
QVERIFY(cell.isValid());
- QVERIFY(cell.firstPosition() == cell.lastPosition());
+ QCOMPARE(cell.firstPosition(), cell.lastPosition());
cell = table->cellAt(0, 1);
QTextCursor cursor = cell.firstCursorPosition();
cursor.setPosition(cell.lastPosition(), QTextCursor::KeepAnchor);
@@ -1065,7 +1065,7 @@ void tst_QTextDocumentFragment::inheritAlignment()
const char html[] = "<body align=right><p>Hey";
setHtml(QString::fromLatin1(html));
// html alignment is absolute
- QVERIFY(doc->begin().blockFormat().alignment() == Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
+ QCOMPARE(doc->begin().blockFormat().alignment(), Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
}
void tst_QTextDocumentFragment::dontEmitEmptyNodeWhenEmptyTagIsFollowedByCloseTag()
@@ -1073,8 +1073,8 @@ void tst_QTextDocumentFragment::dontEmitEmptyNodeWhenEmptyTagIsFollowedByCloseTa
// make sure the Hey does not end up as tag text for the img tag
const char html[] = "<body align=right><p align=left>Blah<img></img><p>Hey";
setHtml(QString::fromLatin1(html));
- QVERIFY(doc->begin().blockFormat().alignment() == Qt::Alignment(Qt::AlignLeft|Qt::AlignAbsolute));
- QVERIFY(doc->begin().next().blockFormat().alignment() == Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
+ QCOMPARE(doc->begin().blockFormat().alignment(), Qt::Alignment(Qt::AlignLeft|Qt::AlignAbsolute));
+ QCOMPARE(doc->begin().next().blockFormat().alignment(), Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
}
void tst_QTextDocumentFragment::toPlainText()
@@ -1378,8 +1378,8 @@ void tst_QTextDocumentFragment::html_listStart1()
{
// don't create a block for the <ul> element, even if there's some whitespace between
// it and the <li>
- const char html[] = "<ul> <li>list item</li><ul>";
- cursor.insertFragment(QTextDocumentFragment::fromHtml(QByteArray::fromRawData(html, sizeof(html) / sizeof(html[0]))));
+ const QString html = QStringLiteral("<ul> <li>list item</li><ul>");
+ cursor.insertFragment(QTextDocumentFragment::fromHtml(html));
QCOMPARE(doc->blockCount(), 1);
}
@@ -1387,8 +1387,8 @@ void tst_QTextDocumentFragment::html_listStart1()
void tst_QTextDocumentFragment::html_listStart2()
{
// unlike with html_listStart1 we want a block showing the 'buggy' text here
- const char html[] = "<ul>buggy, but text should appear<li>list item</li><ul>";
- cursor.insertFragment(QTextDocumentFragment::fromHtml(QByteArray::fromRawData(html, sizeof(html) / sizeof(html[0]))));
+ const QString html = QStringLiteral("<ul>buggy, but text should appear<li>list item</li><ul>");
+ cursor.insertFragment(QTextDocumentFragment::fromHtml(html));
QCOMPARE(doc->blockCount(), 2);
}
@@ -1480,19 +1480,19 @@ void tst_QTextDocumentFragment::html_subAndSuperScript()
const char alignmentInherited[] = "<sub><font face=\"Verdana\">Subby</font></sub>";
setHtml(subHtml);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSubScript);
setHtml(subHtmlCss);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSubScript);
setHtml(superHtml);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSuperScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSuperScript);
setHtml(superHtmlCss);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSuperScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSuperScript);
setHtml(alignmentInherited);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSubScript);
}
void tst_QTextDocumentFragment::html_cssColors()
@@ -1695,7 +1695,7 @@ void tst_QTextDocumentFragment::html_bodyBackground()
const char html[] = "<body background=\"foo.png\">Foo</body>";
doc->setHtml(html);
- QVERIFY(doc->rootFrame()->frameFormat().background().style() == Qt::TexturePattern);
+ QCOMPARE(doc->rootFrame()->frameFormat().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::html_tableCellBackground()
@@ -1709,7 +1709,7 @@ void tst_QTextDocumentFragment::html_tableCellBackground()
QVERIFY(table);
QTextTableCell cell = table->cellAt(0, 0);
- QVERIFY(cell.format().background().style() == Qt::TexturePattern);
+ QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::css_bodyBackground()
@@ -1717,7 +1717,7 @@ void tst_QTextDocumentFragment::css_bodyBackground()
const char html[] = "<body style=\"background-image:url('foo.png')\">Foo</body>";
doc->setHtml(html);
- QVERIFY(doc->rootFrame()->frameFormat().background().style() == Qt::TexturePattern);
+ QCOMPARE(doc->rootFrame()->frameFormat().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::css_tableCellBackground()
@@ -1731,7 +1731,7 @@ void tst_QTextDocumentFragment::css_tableCellBackground()
QVERIFY(table);
QTextTableCell cell = table->cellAt(0, 0);
- QVERIFY(cell.format().background().style() == Qt::TexturePattern);
+ QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::css_cellPaddings()
@@ -1767,7 +1767,7 @@ void tst_QTextDocumentFragment::html_blockLevelDiv()
setHtml(html);
QCOMPARE(doc->begin().blockFormat().alignment(), Qt::AlignRight|Qt::AlignAbsolute);
- QVERIFY(doc->begin().next() == doc->end());
+ QCOMPARE(doc->begin().next(), doc->end());
}
void tst_QTextDocumentFragment::html_spanNesting()
@@ -1805,7 +1805,7 @@ void tst_QTextDocumentFragment::html_nestedLists()
cursor.movePosition(QTextCursor::NextBlock);
QTextList *thirdList = cursor.currentList();
QVERIFY(thirdList);
- QVERIFY(thirdList == firstList);
+ QCOMPARE(thirdList, firstList);
}
void tst_QTextDocumentFragment::noSpecialCharactersInPlainText()
@@ -1837,7 +1837,7 @@ void tst_QTextDocumentFragment::html_doNotInheritBackground()
for (QTextBlock block = doc->begin();
block.isValid(); block = block.next()) {
- QVERIFY(block.blockFormat().hasProperty(QTextFormat::BackgroundBrush) == false);
+ QVERIFY(!block.blockFormat().hasProperty(QTextFormat::BackgroundBrush));
}
QVERIFY(doc->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
@@ -2022,7 +2022,7 @@ void tst_QTextDocumentFragment::html_frameImport()
cursor.insertFragment(frag);
QList<QTextFrame *> childFrames = doc->rootFrame()->childFrames();
- QVERIFY(childFrames.count() == 1);
+ QCOMPARE(childFrames.count(), 1);
QTextFrame *frame = childFrames.first();
QCOMPARE(frame->frameFormat().margin(), ffmt.margin());
QCOMPARE(frame->frameFormat().border(), ffmt.border());
@@ -2050,7 +2050,7 @@ void tst_QTextDocumentFragment::html_frameImport2()
cursor.insertFragment(frag);
QList<QTextFrame *> childFrames = doc->rootFrame()->childFrames();
- QVERIFY(childFrames.count() == 1);
+ QCOMPARE(childFrames.count(), 1);
QTextFrame *frame = childFrames.first();
QCOMPARE(frame->frameFormat().topMargin(), ffmt.topMargin());
QCOMPARE(frame->frameFormat().bottomMargin(), ffmt.bottomMargin());
@@ -2065,7 +2065,7 @@ void tst_QTextDocumentFragment::html_dontAddMarginsAcrossTableCells()
cursor.insertFragment(QTextDocumentFragment::fromHtml(QString::fromLatin1(html)));
QList<QTextFrame *> childFrames = doc->rootFrame()->childFrames();
- QVERIFY(childFrames.count() == 1);
+ QCOMPARE(childFrames.count(), 1);
QTextFrame *frame = childFrames.first();
cursor = frame->firstCursorPosition();
QCOMPARE(cursor.blockFormat().leftMargin(), qreal(50.0));
@@ -2078,7 +2078,7 @@ void tst_QTextDocumentFragment::html_dontMergeCenterBlocks()
QCOMPARE(doc->blockCount(), 2);
QTextBlock blk = doc->begin();
- QVERIFY(blk.blockFormat().alignment() == Qt::AlignCenter);
+ QCOMPARE(blk.blockFormat().alignment(), Qt::AlignCenter);
blk = blk.next();
QVERIFY(blk.blockFormat().alignment() != Qt::AlignCenter);
}
@@ -2112,7 +2112,7 @@ void tst_QTextDocumentFragment::html_tableCellBgColor2()
QTextFrame::Iterator it = cell.begin();
QVERIFY(!it.atEnd());
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
++it;
@@ -2122,9 +2122,9 @@ void tst_QTextDocumentFragment::html_tableCellBgColor2()
++it;
QVERIFY(!it.atEnd());
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
- QVERIFY(it.currentBlock().blockFormat().background() == QBrush(Qt::NoBrush));
+ QCOMPARE(it.currentBlock().blockFormat().background(), QBrush(Qt::NoBrush));
++it;
QVERIFY(it.atEnd());
@@ -2245,8 +2245,8 @@ void tst_QTextDocumentFragment::html_blockVsInline()
{
{
setHtml("<html><body><div><b>Foo<div>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<html><body><p><b>Foo<p>Bar");
@@ -2255,23 +2255,23 @@ void tst_QTextDocumentFragment::html_blockVsInline()
}
{
setHtml("<html><body><b><center>Foo</center></b>");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<html><body><b><p>Foo");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<html><body><b><p>Foo<p>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<div><b>Foo<div>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<p><b>Foo<p>Bar");
@@ -2280,18 +2280,18 @@ void tst_QTextDocumentFragment::html_blockVsInline()
}
{
setHtml("<b><center>Foo</center></b>");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<b><p>Foo");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<b><p>Foo<p>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
}
@@ -2338,7 +2338,7 @@ void tst_QTextDocumentFragment::html_nestedTables()
QTextTable *firstNestedTable = cursor.currentTable();
QVERIFY(firstNestedTable);
- QVERIFY(firstNestedTable->parentFrame() == table);
+ QCOMPARE(firstNestedTable->parentFrame(), table);
QCOMPARE(firstNestedTable->rows(), 1);
QCOMPARE(firstNestedTable->columns(), 1);
QCOMPARE(firstNestedTable->cellAt(0, 0).firstCursorPosition().block().text(), QString("Hello"));
@@ -2348,13 +2348,13 @@ void tst_QTextDocumentFragment::html_nestedTables()
;
QVERIFY(!cursor.isNull());
- QVERIFY(cursor.currentTable() == table);
+ QCOMPARE(cursor.currentTable(), table);
cursor.movePosition(QTextCursor::NextBlock);
QTextTable *secondNestedTable = cursor.currentTable();
QVERIFY(secondNestedTable);
- QVERIFY(secondNestedTable->parentFrame() == table);
+ QCOMPARE(secondNestedTable->parentFrame(), table);
QCOMPARE(secondNestedTable->rows(), 1);
QCOMPARE(secondNestedTable->columns(), 1);
QCOMPARE(secondNestedTable->cellAt(0, 0).firstCursorPosition().block().text(), QString("World"));
@@ -2454,7 +2454,7 @@ void tst_QTextDocumentFragment::html_anchorColor()
setHtml("<span style=\"color: red;\"><a href=\"http://www.kde.org/\">Blue</a></span>");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
- QVERIFY(cursor.charFormat().foreground().color() == QGuiApplication::palette().link().color());
+ QCOMPARE(cursor.charFormat().foreground().color(), QGuiApplication::palette().link().color());
setHtml("<span style=\"color: red;\"><a href=\"http://www.kde.org/\" style=\"color: yellow;\">Green</a></span>");
cursor.movePosition(QTextCursor::Start);
@@ -2525,17 +2525,17 @@ void tst_QTextDocumentFragment::html_columnWidths()
const QVector<QTextLength> columnWidths = fmt.columnWidthConstraints();
QCOMPARE(columnWidths.count(), 2);
- QVERIFY(columnWidths.at(0).type() == QTextLength::VariableLength);
- QVERIFY(columnWidths.at(1).type() == QTextLength::PercentageLength);
- QVERIFY(columnWidths.at(1).rawValue() == 1);
+ QCOMPARE(columnWidths.at(0).type(), QTextLength::VariableLength);
+ QCOMPARE(columnWidths.at(1).type(), QTextLength::PercentageLength);
+ QCOMPARE(columnWidths.at(1).rawValue(), qreal(1));
}
void tst_QTextDocumentFragment::css_fontWeight()
{
setHtml("<p style=\"font-weight:bold\">blah</p>");
- QVERIFY(doc->begin().charFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(doc->begin().charFormat().fontWeight(), int(QFont::Bold));
setHtml("<p style=\"font-weight:600\">blah</p>");
- QVERIFY(doc->begin().charFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(doc->begin().charFormat().fontWeight(), int(QFont::Bold));
}
@@ -2548,7 +2548,7 @@ void tst_QTextDocumentFragment::css_float()
QVERIFY(o);
QTextFormat f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::FloatRight);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::FloatRight);
setHtml("<img src=\"foo\" align=right>");
fmt = doc->begin().begin().fragment().charFormat();
@@ -2557,7 +2557,7 @@ void tst_QTextDocumentFragment::css_float()
QVERIFY(o);
f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::FloatRight);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::FloatRight);
setHtml("<img src=\"foo\" align=left>");
fmt = doc->begin().begin().fragment().charFormat();
@@ -2566,7 +2566,7 @@ void tst_QTextDocumentFragment::css_float()
QVERIFY(o);
f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::FloatLeft);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::FloatLeft);
}
void tst_QTextDocumentFragment::css_textIndent()
@@ -2585,7 +2585,7 @@ void tst_QTextDocumentFragment::css_inline()
"<p>test</p>"
);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_external()
@@ -2596,11 +2596,12 @@ void tst_QTextDocumentFragment::css_external()
"<p>test</p>"
);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_import()
{
+ const QColor green("green");
doc->addResource(QTextDocument::StyleSheetResource, QUrl("test.css"), QString("@import \"other.css\";"));
doc->addResource(QTextDocument::StyleSheetResource, QUrl("other.css"), QString("@import url(\"other2.css\");"));
doc->addResource(QTextDocument::StyleSheetResource, QUrl("other2.css"), QString("p { background-color: green; }"));
@@ -2609,14 +2610,14 @@ void tst_QTextDocumentFragment::css_import()
"<p>test</p>"
);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
doc->setHtml(""
"<style>@import \"test.css\" screen;</style>"
"<p>test</p>"
);
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
}
void tst_QTextDocumentFragment::css_selectors_data()
@@ -2662,9 +2663,9 @@ void tst_QTextDocumentFragment::css_selectors()
QTextBlockFormat fmt = doc->begin().blockFormat();
if (match)
- QVERIFY(fmt.background().color() == QColor("red"));
+ QCOMPARE(fmt.background().color(), QColor("red"));
else
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_nodeNameCaseInsensitivity()
@@ -2674,7 +2675,7 @@ void tst_QTextDocumentFragment::css_nodeNameCaseInsensitivity()
"</style>"
"<p>test</p>");
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_textUnderlineStyle_data()
@@ -2710,14 +2711,14 @@ void tst_QTextDocumentFragment::css_textUnderlineStyleAndDecoration()
QTextFragment fragment = doc->begin().begin().fragment();
QVERIFY(fragment.isValid());
- QVERIFY(fragment.charFormat().underlineStyle() == QTextCharFormat::SingleUnderline);
+ QCOMPARE(fragment.charFormat().underlineStyle(), QTextCharFormat::SingleUnderline);
QVERIFY(fragment.charFormat().fontOverline());
doc->setHtml("<span style=\"text-underline-style: solid; text-decoration: overline\">Test</span>");
fragment = doc->begin().begin().fragment();
QVERIFY(fragment.isValid());
- QVERIFY(fragment.charFormat().underlineStyle() == QTextCharFormat::SingleUnderline);
+ QCOMPARE(fragment.charFormat().underlineStyle(), QTextCharFormat::SingleUnderline);
QVERIFY(fragment.charFormat().fontOverline());
}
@@ -2726,48 +2727,48 @@ void tst_QTextDocumentFragment::css_listStyleType()
doc->setHtml("<ol style=\"list-style-type: disc\"><li>Blah</li></ol>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDisc);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDisc);
doc->setHtml("<ul style=\"list-style-type: square\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListSquare);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListSquare);
doc->setHtml("<ul style=\"list-style-type: circle\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListCircle);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListCircle);
doc->setHtml("<ul style=\"list-style-type: decimal\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDecimal);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDecimal);
doc->setHtml("<ul style=\"list-style-type: lower-alpha\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListLowerAlpha);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListLowerAlpha);
doc->setHtml("<ul style=\"list-style-type: upper-alpha\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListUpperAlpha);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListUpperAlpha);
doc->setHtml("<ul style=\"list-style-type: upper-roman\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListUpperRoman);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListUpperRoman);
doc->setHtml("<ul style=\"list-style-type: lower-roman\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListLowerRoman);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListLowerRoman);
// ignore the unsupported list-style-position inside the list-style shorthand property
doc->setHtml("<ul style=\"list-style: outside decimal\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDecimal);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDecimal);
}
void tst_QTextDocumentFragment::css_linkPseudo()
@@ -2785,13 +2786,13 @@ void tst_QTextDocumentFragment::css_linkPseudo()
void tst_QTextDocumentFragment::css_pageBreaks()
{
doc->setHtml("<p>Foo</p>");
- QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == QTextFormat::PageBreak_Auto);
+ QCOMPARE(doc->begin().blockFormat().pageBreakPolicy(), QTextFormat::PageBreak_Auto);
doc->setHtml("<p style=\" page-break-before:always;\">Foo</p>");
- QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == QTextFormat::PageBreak_AlwaysBefore);
+ QCOMPARE(doc->begin().blockFormat().pageBreakPolicy(), QTextFormat::PageBreak_AlwaysBefore);
doc->setHtml("<p style=\" page-break-after:always;\">Foo</p>");
- QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == QTextFormat::PageBreak_AlwaysAfter);
+ QCOMPARE(doc->begin().blockFormat().pageBreakPolicy(), QTextFormat::PageBreak_AlwaysAfter);
doc->setHtml("<p style=\" page-break-before:always; page-break-after:always;\">Foo</p>");
QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == (QTextFormat::PageBreak_AlwaysAfter | QTextFormat::PageBreak_AlwaysBefore));
@@ -2832,13 +2833,14 @@ void tst_QTextDocumentFragment::universalSelectors()
QTextBlockFormat fmt = doc->begin().blockFormat();
if (match)
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
else
QVERIFY(!fmt.hasProperty(QTextFormat::BackgroundBrush));
}
void tst_QTextDocumentFragment::screenMedia()
{
+ const QColor green("green");
setHtml("<style>"
"@media screen {"
"p { background-color: green }"
@@ -2847,7 +2849,7 @@ void tst_QTextDocumentFragment::screenMedia()
"<p>test</p>"
"");
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
setHtml("<style>"
"@media foobar {"
@@ -2857,7 +2859,7 @@ void tst_QTextDocumentFragment::screenMedia()
"<p>test</p>"
"");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() != QColor("green"));
+ QVERIFY(fmt.background().color() != green);
setHtml("<style>"
"@media sCrEeN {"
@@ -2867,7 +2869,7 @@ void tst_QTextDocumentFragment::screenMedia()
"<p>test</p>"
"");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
}
void tst_QTextDocumentFragment::htmlResourceLoading()
@@ -2881,7 +2883,7 @@ void tst_QTextDocumentFragment::htmlResourceLoading()
doc->clear();
QTextCursor(doc).insertFragment(frag);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::someCaseInsensitiveAttributeValues()
@@ -2890,7 +2892,7 @@ void tst_QTextDocumentFragment::someCaseInsensitiveAttributeValues()
setHtml(QString::fromLatin1(html1));
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListSquare);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListSquare);
const char html2[] = "<div align=ceNTeR><b>Hello World";
setHtml(html2);
@@ -2925,7 +2927,7 @@ void tst_QTextDocumentFragment::backgroundImage()
doc.testPixmap.fill(Qt::blue);
doc.setHtml("<p style=\"background-image: url(testPixmap)\">Hello</p>");
QBrush bg = doc.begin().blockFormat().background();
- QVERIFY(bg.style() == Qt::TexturePattern);
+ QCOMPARE(bg.style(), Qt::TexturePattern);
QCOMPARE(bg.texture().cacheKey(), doc.testPixmap.cacheKey());
}
@@ -3109,7 +3111,7 @@ void tst_QTextDocumentFragment::html_tableStrangeNewline()
QCOMPARE(table->columns(), 1);
const QTextTableCell cell = table->cellAt(0, 0);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Foo"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
}
void tst_QTextDocumentFragment::html_tableStrangeNewline2()
@@ -3123,7 +3125,7 @@ void tst_QTextDocumentFragment::html_tableStrangeNewline2()
QCOMPARE(table->columns(), 1);
const QTextTableCell cell = table->cellAt(0, 0);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Foo"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
}
void tst_QTextDocumentFragment::html_tableStrangeNewline3()
@@ -3152,11 +3154,11 @@ void tst_QTextDocumentFragment::html_tableStrangeNewline3()
QTextTableCell cell = table->cellAt(0, 0);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Meh"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
cell = table->cellAt(0, 1);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Foo"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
}
void tst_QTextDocumentFragment::html_caption()
@@ -3170,7 +3172,7 @@ void tst_QTextDocumentFragment::html_caption()
cursor.movePosition(QTextCursor::NextBlock);
QCOMPARE(cursor.block().text(), QString("This is a Caption!"));
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
cursor.movePosition(QTextCursor::NextBlock);
QTextTable *table = cursor.currentTable();
@@ -3427,7 +3429,7 @@ void tst_QTextDocumentFragment::html_dontInheritAlignmentForFloatingImages()
QVERIFY(o);
QTextFormat f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::InFlow);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::InFlow);
}
void tst_QTextDocumentFragment::html_verticalImageAlignment()
@@ -3437,35 +3439,35 @@ void tst_QTextDocumentFragment::html_verticalImageAlignment()
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
QTextImageFormat fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignNormal);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignNormal);
doc->setHtml("<img src=\"foo\" align=middle />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignMiddle);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignMiddle);
doc->setHtml("<img src=\"foo\" style=\"vertical-align: middle\" />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignMiddle);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignMiddle);
doc->setHtml("<img src=\"foo\" align=top />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignTop);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignTop);
doc->setHtml("<img src=\"foo\" style=\"vertical-align: top\" />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignTop);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignTop);
}
void tst_QTextDocumentFragment::html_verticalCellAlignment()
@@ -3944,11 +3946,11 @@ void tst_QTextDocumentFragment::html_directionWithHtml()
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::RightToLeft);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::RightToLeft);
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::LeftToRight);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::LeftToRight);
}
void tst_QTextDocumentFragment::html_directionWithRichText()
@@ -3961,11 +3963,11 @@ void tst_QTextDocumentFragment::html_directionWithRichText()
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::RightToLeft);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::RightToLeft);
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::LeftToRight);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::LeftToRight);
}
void tst_QTextDocumentFragment::html_metaInBody()
diff --git a/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST b/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
new file mode 100644
index 0000000000..b13b2497d3
--- /dev/null
+++ b/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
@@ -0,0 +1,2 @@
+[imageAtRightAlignedTab]
+linux
diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
index 7c742bc864..5a401031e2 100644
--- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
+++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
@@ -101,7 +101,7 @@ void tst_QTextFormat::defaultAlignment()
QTextBlockFormat fmt;
QVERIFY(!fmt.hasProperty(QTextFormat::BlockAlignment));
QCOMPARE(fmt.intProperty(QTextFormat::BlockAlignment), 0);
- QVERIFY(fmt.alignment() == Qt::AlignLeft);
+ QCOMPARE(fmt.alignment(), Qt::AlignLeft);
}
void tst_QTextFormat::testUnderlinePropertyPrecedence()
@@ -209,7 +209,7 @@ void tst_QTextFormat::resolveFont()
QVector<QTextFormat> formats = doc.allFormats();
QCOMPARE(formats.count(), 3);
- QVERIFY(formats.at(2).type() == QTextFormat::CharFormat);
+ QCOMPARE(formats.at(2).type(), int(QTextFormat::CharFormat));
fmt = formats.at(2).toCharFormat();
QVERIFY(!fmt.font().underline());
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index 51f726ac86..de0c2d6dbe 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -1675,6 +1675,7 @@ void tst_QTextLayout::testTabDPIScale()
case QPaintDevice::PdmPhysicalDpiY:
return 72;
case QPaintDevice::PdmDevicePixelRatio:
+ case QPaintDevice::PdmDevicePixelRatioScaled:
; // fall through
}
return 0;
@@ -1744,7 +1745,7 @@ void tst_QTextLayout::capitalization_allUpperCase()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 1);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Uppercase);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Uppercase));
}
void tst_QTextLayout::capitalization_allUpperCase_newline()
@@ -1764,9 +1765,9 @@ void tst_QTextLayout::capitalization_allUpperCase_newline()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 3);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Uppercase);
- QVERIFY(engine->layoutData->items.at(1).analysis.flags == QScriptAnalysis::LineOrParagraphSeparator);
- QVERIFY(engine->layoutData->items.at(2).analysis.flags == QScriptAnalysis::Uppercase);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Uppercase));
+ QCOMPARE(engine->layoutData->items.at(1).analysis.flags, ushort(QScriptAnalysis::LineOrParagraphSeparator));
+ QCOMPARE(engine->layoutData->items.at(2).analysis.flags, ushort(QScriptAnalysis::Uppercase));
}
void tst_QTextLayout::capitalization_allLowerCase()
@@ -1782,7 +1783,7 @@ void tst_QTextLayout::capitalization_allLowerCase()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 1);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Lowercase);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Lowercase));
}
void tst_QTextLayout::capitalization_smallCaps()
@@ -1798,8 +1799,8 @@ void tst_QTextLayout::capitalization_smallCaps()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 2);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::None);
- QVERIFY(engine->layoutData->items.at(1).analysis.flags == QScriptAnalysis::SmallCaps);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::None));
+ QCOMPARE(engine->layoutData->items.at(1).analysis.flags, ushort(QScriptAnalysis::SmallCaps));
}
void tst_QTextLayout::capitalization_capitalize()
@@ -1815,11 +1816,11 @@ void tst_QTextLayout::capitalization_capitalize()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 5);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Uppercase);
- QVERIFY(engine->layoutData->items.at(1).analysis.flags == QScriptAnalysis::None);
- QVERIFY(engine->layoutData->items.at(2).analysis.flags == QScriptAnalysis::Tab);
- QVERIFY(engine->layoutData->items.at(3).analysis.flags == QScriptAnalysis::Uppercase);
- QVERIFY(engine->layoutData->items.at(4).analysis.flags == QScriptAnalysis::None);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Uppercase));
+ QCOMPARE(engine->layoutData->items.at(1).analysis.flags, ushort(QScriptAnalysis::None));
+ QCOMPARE(engine->layoutData->items.at(2).analysis.flags, ushort(QScriptAnalysis::Tab));
+ QCOMPARE(engine->layoutData->items.at(3).analysis.flags, ushort(QScriptAnalysis::Uppercase));
+ QCOMPARE(engine->layoutData->items.at(4).analysis.flags, ushort(QScriptAnalysis::None));
}
void tst_QTextLayout::longText()
@@ -1984,7 +1985,12 @@ void tst_QTextLayout::textWidthVsWIdth()
"./libs -I/home/ettrich/dev/creator/tools -I../../plugins -I../../shared/scriptwrapper -I../../libs/3rdparty/botan/build -Idialogs -Iactionmanager -Ieditorma"
"nager -Iprogressmanager -Iscriptmanager -I.moc/debug-shared -I.uic -o .obj/debug-shared/sidebar.o sidebar.cpp"));
- // textWidth includes right bearing, but it should never be LARGER than width if there is space for at least one character
+ // The naturalTextWidth includes right bearing, but should never be LARGER than line width if
+ // there is space for at least one character. Unfortunately that assumption may not hold if the
+ // font engine fails to report an accurate minimum right bearing for the font, eg. when the
+ // minimum right bearing reported by the font engine doesn't cover all the glyphs in the font.
+ // The result is that this test may fail in some cases. We should fix this by running the test
+ // with a font that we know have no suprising right bearings. See qtextlayout.cpp for details.
for (int width = 100; width < 1000; ++width) {
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -2096,8 +2102,8 @@ void tst_QTextLayout::cursorInNonStopChars()
QTextLine line = layout.createLine();
layout.endLayout();
- QVERIFY(line.cursorToX(1) == line.cursorToX(3));
- QVERIFY(line.cursorToX(2) == line.cursorToX(3));
+ QCOMPARE(line.cursorToX(1), line.cursorToX(3));
+ QCOMPARE(line.cursorToX(2), line.cursorToX(3));
}
void tst_QTextLayout::justifyTrailingSpaces()
diff --git a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
index c57123af61..03e557d8dd 100644
--- a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
+++ b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
@@ -113,11 +113,11 @@ void tst_QTextList::autoNumbering()
for (int i = 0; i < 27; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 28);
+ QCOMPARE(list->count(), 28);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 27);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "ab.");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 27);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("ab."));
}
void tst_QTextList::autoNumberingPrefixAndSuffix()
@@ -132,11 +132,11 @@ void tst_QTextList::autoNumberingPrefixAndSuffix()
for (int i = 0; i < 27; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 28);
+ QCOMPARE(list->count(), 28);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 27);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "-ab)");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 27);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("-ab)"));
}
void tst_QTextList::autoNumberingPrefixAndSuffixRTL()
@@ -154,9 +154,9 @@ void tst_QTextList::autoNumberingPrefixAndSuffixRTL()
cursor.insertBlock();
- QVERIFY(list->count() == 2);
+ QCOMPARE(list->count(), 2);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "*B-");
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("*B-"));
}
void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
@@ -174,7 +174,7 @@ void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
for (int i = 0; i < 27; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 28);
+ QCOMPARE(list->count(), 28);
QString htmlExport = doc->toHtml();
QTextDocument importDoc;
@@ -185,9 +185,9 @@ void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
importCursor.movePosition(QTextCursor::NextBlock);
QVERIFY(importCursor.currentList());
- QVERIFY(importCursor.currentList()->itemNumber(importCursor.block()) == 27);
- QVERIFY(importCursor.currentList()->itemText(importCursor.block()) == "\"ab#");
- QVERIFY(importCursor.currentList()->format().indent() == 10);
+ QCOMPARE(importCursor.currentList()->itemNumber(importCursor.block()), 27);
+ QCOMPARE(importCursor.currentList()->itemText(importCursor.block()), QLatin1String("\"ab#"));
+ QCOMPARE(importCursor.currentList()->format().indent(), 10);
}
void tst_QTextList::autoNumberingRTL()
@@ -203,9 +203,9 @@ void tst_QTextList::autoNumberingRTL()
cursor.insertBlock();
- QVERIFY(list->count() == 2);
+ QCOMPARE(list->count(), 2);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == ".B");
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String(".B"));
}
void tst_QTextList::romanNumbering()
@@ -218,11 +218,11 @@ void tst_QTextList::romanNumbering()
for (int i = 0; i < 4998; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 4999);
+ QCOMPARE(list->count(), 4999);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 4998);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "MMMMCMXCIX.");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 4998);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("MMMMCMXCIX."));
}
void tst_QTextList::romanNumberingLimit()
@@ -235,11 +235,11 @@ void tst_QTextList::romanNumberingLimit()
for (int i = 0; i < 4999; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 5000);
+ QCOMPARE(list->count(), 5000);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 4999);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "?.");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 4999);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("?."));
}
void tst_QTextList::formatChange()
@@ -257,12 +257,12 @@ void tst_QTextList::formatChange()
QVERIFY(list && list->count() == 2);
QTextBlockFormat bfmt = cursor.blockFormat();
-// QVERIFY(bfmt.object() == list);
+// QCOMPARE(bfmt.object(), list);
bfmt.setObjectIndex(-1);
cursor.setBlockFormat(bfmt);
- QVERIFY(firstList->count() == 1);
+ QCOMPARE(firstList->count(), 1);
}
void tst_QTextList::cursorNavigation()
@@ -282,7 +282,7 @@ void tst_QTextList::cursorNavigation()
QVERIFY(cursor.currentList());
cursor.movePosition(QTextCursor::PreviousBlock);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 0);
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 0);
}
void tst_QTextList::partialRemoval()
diff --git a/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp b/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
index ae8948a61f..cd43849729 100644
--- a/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
+++ b/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
@@ -157,7 +157,7 @@ void tst_QTextPieceTable::insertion3()
table->insert(pos, str, charFormatIndex);
compare.insert(pos, str);
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::insertion4()
@@ -176,7 +176,7 @@ void tst_QTextPieceTable::insertion4()
// exit(12);
// }
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::insertion5()
@@ -196,10 +196,10 @@ void tst_QTextPieceTable::insertion5()
}
compare.insert(pos, str);
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
for (QTextBlock it = table->blocksBegin(); it != table->blocksEnd(); it = it.next()) {
QTextDocumentPrivate::FragmentIterator fit = table->find(it.position());
- QVERIFY(fit.position() == it.position());
+ QCOMPARE(fit.position(), it.position());
}
}
@@ -260,7 +260,7 @@ void tst_QTextPieceTable::removal3()
// exit(12);
// }
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::removal4()
@@ -294,7 +294,7 @@ void tst_QTextPieceTable::removal4()
// exit(12);
// }
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::undoRedo1()
@@ -392,7 +392,7 @@ void tst_QTextPieceTable::undoRedo6()
QTextBlockFormat bfmt;
bfmt.setAlignment(Qt::AlignHCenter);
cursor.setBlockFormat(bfmt);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
QTextCursor range = cursor;
range.clearSelection();
@@ -404,11 +404,11 @@ void tst_QTextPieceTable::undoRedo6()
range.mergeCharFormat(modifier);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
doc.undo();
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
}
void tst_QTextPieceTable::undoRedo7()
@@ -497,13 +497,13 @@ void tst_QTextPieceTable::undoRedo11()
}
l += remove ? -1 : 2;
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
for (int i = 0; i < loops; ++i)
table->undo();
- QVERIFY(table->plainText() == QString(""));
+ QCOMPARE(table->plainText(), QString(""));
for (int i = 0; i < loops; ++i)
table->redo();
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
@@ -693,9 +693,9 @@ void tst_QTextPieceTable::setBlockFormat()
QTextBlock b = table->blocksFind(1);
table->setBlockFormat(b, b, newbfmt);
- QVERIFY(table->blocksFind(0).blockFormat() == bfmt);
- QVERIFY(table->blocksFind(1).blockFormat() == newbfmt);
- QVERIFY(table->blocksFind(2).blockFormat() == bfmt);
+ QCOMPARE(table->blocksFind(0).blockFormat(), bfmt);
+ QCOMPARE(table->blocksFind(1).blockFormat(), newbfmt);
+ QCOMPARE(table->blocksFind(2).blockFormat(), bfmt);
}
@@ -705,19 +705,19 @@ void tst_QTextPieceTable::blockInsertion()
fmt.setTopMargin(100);
int idx = table->formatCollection()->indexForFormat(fmt);
int charFormat = table->formatCollection()->indexForFormat(QTextCharFormat());
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
table->insertBlock(0, idx, charFormat);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).blockFormat() == fmt);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).blockFormat(), fmt);
table->undo();
- QVERIFY(table->blockMap().length() == 1);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blockMap().length(), 1);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
table->redo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).blockFormat() == fmt);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).blockFormat(), fmt);
}
void tst_QTextPieceTable::blockInsertion2()
@@ -755,37 +755,37 @@ void tst_QTextPieceTable::blockRemoval1()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->beginEditBlock();
table->remove(5, 5);
table->endEditBlock();
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 5);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 5);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 5);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 5);
}
void tst_QTextPieceTable::blockRemoval2()
@@ -803,35 +803,35 @@ void tst_QTextPieceTable::blockRemoval2()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->remove(4, 1);
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(6).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 0);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(6).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 0);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(6).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 0);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(6).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 0);
}
void tst_QTextPieceTable::blockRemoval3()
@@ -849,38 +849,38 @@ void tst_QTextPieceTable::blockRemoval3()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->beginEditBlock();
table->remove(3, 4);
table->endEditBlock();
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
}
void tst_QTextPieceTable::blockRemoval4()
@@ -899,35 +899,35 @@ void tst_QTextPieceTable::blockRemoval4()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->remove(3, 7);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
#endif
}
@@ -946,38 +946,38 @@ void tst_QTextPieceTable::blockRemoval5()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->beginEditBlock();
table->remove(3, 8);
table->endEditBlock();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
}
@@ -996,66 +996,66 @@ void tst_QTextPieceTable::checkFrames1()
QPointer<QTextFrame> frame = table->insertFrame(1, 3, ffmt);
QTextFrame *root = table->rootFrame();
- QVERIFY(root == frame->parentFrame());
+ QCOMPARE(root, frame->parentFrame());
QVERIFY(root);
- QVERIFY(root->parentFrame() == 0);
+ QVERIFY(!root->parentFrame());
- QVERIFY(root->childFrames().count() == 1);
+ QCOMPARE(root->childFrames().count(), 1);
QVERIFY(frame->format() == ffmt);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 4);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 4);
QPointer<QTextFrame> frame2 = table->insertFrame(2, 3, ffmt);
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame);
- QVERIFY(frame->childFrames().count() == 1);
- QVERIFY(frame2->childFrames().count() == 0);
- QVERIFY(frame2->parentFrame() == frame);
- QVERIFY(frame2->firstPosition() == 3);
- QVERIFY(frame2->lastPosition() == 4);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame.data());
+ QCOMPARE(frame->childFrames().count(), 1);
+ QCOMPARE(frame2->childFrames().count(), 0);
+ QCOMPARE(frame2->parentFrame(), frame.data());
+ QCOMPARE(frame2->firstPosition(), 3);
+ QCOMPARE(frame2->lastPosition(), 4);
QVERIFY(frame->format() == ffmt);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 6);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 6);
table->removeFrame(frame);
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame2);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame2.data());
QVERIFY(!frame);
- QVERIFY(frame2->childFrames().count() == 0);
- QVERIFY(frame2->parentFrame() == root);
- QVERIFY(frame2->firstPosition() == 2);
- QVERIFY(frame2->lastPosition() == 3);
+ QCOMPARE(frame2->childFrames().count(), 0);
+ QCOMPARE(frame2->parentFrame(), root);
+ QCOMPARE(frame2->firstPosition(), 2);
+ QCOMPARE(frame2->lastPosition(), 3);
table->undo();
frame = table->frameAt(2);
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame);
- QVERIFY(frame->childFrames().count() == 1);
- QVERIFY(frame->childFrames().at(0) == frame2);
- QVERIFY(frame2->childFrames().count() == 0);
- QVERIFY(frame2->parentFrame() == frame);
- QVERIFY(frame2->firstPosition() == 3);
- QVERIFY(frame2->lastPosition() == 4);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame.data());
+ QCOMPARE(frame->childFrames().count(), 1);
+ QCOMPARE(frame->childFrames().at(0), frame2.data());
+ QCOMPARE(frame2->childFrames().count(), 0);
+ QCOMPARE(frame2->parentFrame(), frame.data());
+ QCOMPARE(frame2->firstPosition(), 3);
+ QCOMPARE(frame2->lastPosition(), 4);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 6);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 6);
table->undo();
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame);
- QVERIFY(frame->childFrames().count() == 0);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame.data());
+ QCOMPARE(frame->childFrames().count(), 0);
QVERIFY(!frame2);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 4);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 4);
}
void tst_QTextPieceTable::removeFrameDirect()
@@ -1065,7 +1065,7 @@ void tst_QTextPieceTable::removeFrameDirect()
QTextFrame *frame = table->insertFrame(1, 5, ffmt);
- QVERIFY(frame->parentFrame() == table->rootFrame());
+ QCOMPARE(frame->parentFrame(), table->rootFrame());
const int start = frame->firstPosition() - 1;
const int end = frame->lastPosition();
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index c8d3122e6d..1c099acc56 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -146,87 +146,87 @@ void tst_QTextTable::variousTableModifications()
QTextTableFormat tableFmt;
QTextTable *tab = cursor.insertTable(2, 2, tableFmt);
- QVERIFY(doc->toPlainText().length() == 5);
- QVERIFY(tab == cursor.currentTable());
- QVERIFY(tab->columns() == 2);
- QVERIFY(tab->rows() == 2);
+ QCOMPARE(doc->toPlainText().length(), 5);
+ QCOMPARE(tab, cursor.currentTable());
+ QCOMPARE(tab->columns(), 2);
+ QCOMPARE(tab->rows(), 2);
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
QTextCharFormat fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
QTextTableCell cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 0);
- QVERIFY(cell.column() == 0);
+ QCOMPARE(cell.row(), 0);
+ QCOMPARE(cell.column(), 0);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 0);
- QVERIFY(cell.column() == 1);
+ QCOMPARE(cell.row(), 0);
+ QCOMPARE(cell.column(), 1);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 3);
+ QCOMPARE(cursor.position(), 3);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 1);
- QVERIFY(cell.column() == 0);
+ QCOMPARE(cell.row(), 1);
+ QCOMPARE(cell.column(), 0);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 4);
+ QCOMPARE(cursor.position(), 4);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 1);
- QVERIFY(cell.column() == 1);
+ QCOMPARE(cell.row(), 1);
+ QCOMPARE(cell.column(), 1);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(!cell.isValid());
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
// check we can't delete the cells with the cursor
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
cursor.deleteChar();
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(doc->toPlainText().length(), 5);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
cursor.deleteChar();
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(doc->toPlainText().length(), 5);
cursor.deletePreviousChar();
- QVERIFY(cursor.position() == 2);
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(cursor.position(), 2);
+ QCOMPARE(doc->toPlainText().length(), 5);
QTextTable *table = cursor.currentTable();
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
table->insertRows(2, 1);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 2);
- QVERIFY(doc->toPlainText().length() == 7);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 2);
+ QCOMPARE(doc->toPlainText().length(), 7);
table->insertColumns(2, 2);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 4);
- QVERIFY(doc->toPlainText().length() == 13);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 4);
+ QCOMPARE(doc->toPlainText().length(), 13);
table->resize(4, 5);
- QVERIFY(table->rows() == 4);
- QVERIFY(table->columns() == 5);
- QVERIFY(doc->toPlainText().length() == 21);
+ QCOMPARE(table->rows(), 4);
+ QCOMPARE(table->columns(), 5);
+ QCOMPARE(doc->toPlainText().length(), 21);
}
void tst_QTextTable::tableShrinking()
@@ -234,25 +234,25 @@ void tst_QTextTable::tableShrinking()
QTextTableFormat tableFmt;
cursor.insertTable(3, 4, tableFmt);
- QVERIFY(doc->toPlainText().length() == 13);
+ QCOMPARE(doc->toPlainText().length(), 13);
QTextTable *table = cursor.currentTable();
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 4);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 4);
table->removeRows(1, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 4);
- QVERIFY(doc->toPlainText().length() == 9);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 4);
+ QCOMPARE(doc->toPlainText().length(), 9);
table->removeColumns(1, 2);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
+ QCOMPARE(doc->toPlainText().length(), 5);
table->resize(1, 1);
- QVERIFY(table->rows() == 1);
- QVERIFY(table->columns() == 1);
- QVERIFY(doc->toPlainText().length() == 2);
+ QCOMPARE(table->rows(), 1);
+ QCOMPARE(table->columns(), 1);
+ QCOMPARE(doc->toPlainText().length(), 2);
}
void tst_QTextTable::spans()
@@ -264,12 +264,12 @@ void tst_QTextTable::spans()
QTextTable *table = cursor.currentTable();
QVERIFY(table->cellAt(0, 0) != table->cellAt(0, 1));
table->mergeCells(0, 0, 1, 2);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
QVERIFY(table->cellAt(0, 0) == table->cellAt(0, 1));
table->mergeCells(0, 0, 2, 2);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
}
void tst_QTextTable::variousModifications2()
@@ -277,45 +277,45 @@ void tst_QTextTable::variousModifications2()
QTextTableFormat tableFmt;
cursor.insertTable(2, 5, tableFmt);
- QVERIFY(doc->toPlainText().length() == 11);
+ QCOMPARE(doc->toPlainText().length(), 11);
QTextTable *table = cursor.currentTable();
- QVERIFY(cursor.position() == 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 5);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 5);
table->insertColumns(0, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 6);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 6);
table->insertColumns(6, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 7);
table->insertRows(0, 1);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 7);
table->insertRows(3, 1);
- QVERIFY(table->rows() == 4);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 4);
+ QCOMPARE(table->columns(), 7);
table->removeRows(0, 1);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 7);
table->removeRows(2, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 7);
table->removeColumns(0, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 6);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 6);
table->removeColumns(5, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 5);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 5);
tableFmt = table->format();
table->insertColumns(2, 1);
table->setFormat(tableFmt);
table->insertColumns(2, 1);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->columns(), 7);
}
void tst_QTextTable::tableManager_undo()
@@ -325,16 +325,16 @@ void tst_QTextTable::tableManager_undo()
QTextTable *table = cursor.insertTable(2, 2, fmt);
QVERIFY(table);
- QVERIFY(table->format().border() == 10);
+ QCOMPARE(table->format().border(), qreal(10));
fmt.setBorder(20);
table->setFormat(fmt);
- QVERIFY(table->format().border() == 20);
+ QCOMPARE(table->format().border(), qreal(20));
doc->undo();
- QVERIFY(table->format().border() == 10);
+ QCOMPARE(table->format().border(), qreal(10));
}
void tst_QTextTable::tableManager_removeCell()
@@ -360,10 +360,10 @@ void tst_QTextTable::rowAt()
QTextCursor cell20Cursor = table->cellAt(2, 0).firstCursorPosition();
QTextCursor cell21Cursor = table->cellAt(2, 1).firstCursorPosition();
QTextCursor cell30Cursor = table->cellAt(3, 0).firstCursorPosition();
- QVERIFY(table->cellAt(cell00Cursor).firstCursorPosition() == cell00Cursor);
- QVERIFY(table->cellAt(cell10Cursor).firstCursorPosition() == cell10Cursor);
- QVERIFY(table->cellAt(cell20Cursor).firstCursorPosition() == cell20Cursor);
- QVERIFY(table->cellAt(cell30Cursor).firstCursorPosition() == cell30Cursor);
+ QCOMPARE(table->cellAt(cell00Cursor).firstCursorPosition(), cell00Cursor);
+ QCOMPARE(table->cellAt(cell10Cursor).firstCursorPosition(), cell10Cursor);
+ QCOMPARE(table->cellAt(cell20Cursor).firstCursorPosition(), cell20Cursor);
+ QCOMPARE(table->cellAt(cell30Cursor).firstCursorPosition(), cell30Cursor);
table->mergeCells(1, 0, 2, 1);
@@ -433,16 +433,16 @@ void tst_QTextTable::insertRows()
QVERIFY(cursor == table->cellAt(0, 0).firstCursorPosition());
table->insertRows(0, 1);
- QVERIFY(table->rows() == 3);
+ QCOMPARE(table->rows(), 3);
table->insertRows(1, 1);
- QVERIFY(table->rows() == 4);
+ QCOMPARE(table->rows(), 4);
table->insertRows(-1, 1);
- QVERIFY(table->rows() == 5);
+ QCOMPARE(table->rows(), 5);
table->insertRows(5, 2);
- QVERIFY(table->rows() == 7);
+ QCOMPARE(table->rows(), 7);
}
@@ -552,9 +552,9 @@ void tst_QTextTable::mergeCells()
QTextBlock block = table->cellAt(0, 0).firstCursorPosition().block();
- QVERIFY(block.text() == "Blah Foo");
- QVERIFY(block.next().text() == "Hah");
- QVERIFY(block.next().next().text() == "Bar");
+ QCOMPARE(block.text(), QLatin1String("Blah Foo"));
+ QCOMPARE(block.next().text(), QLatin1String("Hah"));
+ QCOMPARE(block.next().next().text(), QLatin1String("Bar"));
table = create4x4Table();
@@ -580,7 +580,7 @@ void tst_QTextTable::mergeCells()
if (table) {
cursor = table->cellAt(0, 0).firstCursorPosition();
- QVERIFY(cursor.block().text() == "Test");
+ QCOMPARE(cursor.block().text(), QLatin1String("Test"));
}
table = create2x2Table();
@@ -750,7 +750,7 @@ void tst_QTextTable::setCellFormat()
fmt.setTableCellColumnSpan(25);
fmt.setTableCellRowSpan(42);
cell.setFormat(fmt);
- QVERIFY(cell.format().background().color() == QColor(Qt::blue));
+ QCOMPARE(cell.format().background().color(), QColor(Qt::blue));
QCOMPARE(cell.format().tableCellColumnSpan(), 1);
QCOMPARE(cell.format().tableCellRowSpan(), 1);
}
@@ -1086,6 +1086,8 @@ public:
{
if (PdmDevicePixelRatio == metric)
return 1;
+ if (PdmDevicePixelRatioScaled == metric)
+ return 1 * QPaintDevice::devicePixelRatioFScale();
if (PdmDpiY == metric)
return 96;
if (PdmDpiX == metric)
diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/gui/text/qzip/tst_qzip.cpp
index 90e93881b9..8381c93bc2 100644
--- a/tests/auto/gui/text/qzip/tst_qzip.cpp
+++ b/tests/auto/gui/text/qzip/tst_qzip.cpp
@@ -39,9 +39,6 @@
class tst_QZip : public QObject
{
Q_OBJECT
-public slots:
- void init();
- void cleanup();
private slots:
void basicUnpack();
@@ -50,18 +47,10 @@ private slots:
void createArchive();
};
-void tst_QZip::init()
-{
-}
-
-void tst_QZip::cleanup()
-{
-}
-
void tst_QZip::basicUnpack()
{
QZipReader zip(QFINDTESTDATA("/testdata/test.zip"), QIODevice::ReadOnly);
- QList<QZipReader::FileInfo> files = zip.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip.fileInfoList();
QCOMPARE(files.count(), 2);
QZipReader::FileInfo fi = files.at(0);
@@ -97,7 +86,7 @@ void tst_QZip::basicUnpack()
void tst_QZip::symlinks()
{
QZipReader zip(QFINDTESTDATA("/testdata/symlink.zip"), QIODevice::ReadOnly);
- QList<QZipReader::FileInfo> files = zip.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip.fileInfoList();
QCOMPARE(files.count(), 2);
QZipReader::FileInfo fi = files.at(0);
@@ -120,7 +109,7 @@ void tst_QZip::symlinks()
void tst_QZip::readTest()
{
QZipReader zip("foobar.zip", QIODevice::ReadOnly); // non existing file.
- QList<QZipReader::FileInfo> files = zip.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip.fileInfoList();
QCOMPARE(files.count(), 0);
QByteArray b = zip.fileData("foobar");
QCOMPARE(b.size(), 0);
@@ -139,7 +128,7 @@ void tst_QZip::createArchive()
QBuffer buffer2(&zipFile);
QZipReader zip2(&buffer2);
- QList<QZipReader::FileInfo> files = zip2.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip2.fileInfoList();
QCOMPARE(files.count(), 1);
QZipReader::FileInfo file = files.at(0);
QCOMPARE(file.filePath, QString("My Filename"));
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index c8964eb02c..db4b15530c 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -35,6 +35,7 @@
#include <QtTest/QtTest>
#include <qdebug.h>
#include <qdesktopservices.h>
+#include <qregularexpression.h>
class tst_qdesktopservices : public QObject
{
@@ -74,7 +75,9 @@ void tst_qdesktopservices::openUrl()
QCOMPARE(QDesktopServices::openUrl(QUrl()), false);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// this test is only valid on windows on other systems it might mean open a new document in the application handling .file
- QTest::ignoreMessage(QtWarningMsg, "ShellExecute 'file://invalid.file' failed (error 3).");
+ const QRegularExpression messagePattern("ShellExecute 'file://invalid\\.file' failed \\(error \\d+\\)\\.");
+ QVERIFY(messagePattern.isValid());
+ QTest::ignoreMessage(QtWarningMsg, messagePattern);
QCOMPARE(QDesktopServices::openUrl(QUrl("file://invalid.file")), false);
#endif
}
diff --git a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
index c2833d9e67..78ab769137 100644
--- a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
+++ b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
@@ -256,41 +256,41 @@ void tst_QDoubleValidator::notifySignals()
dv.setTop(0.8);
QCOMPARE(topSpy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
- QVERIFY(dv.top() == 0.8);
+ QCOMPARE(dv.top(), 0.8);
dv.setBottom(0.2);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(changedSpy.count(), 2);
- QVERIFY(dv.bottom() == 0.2);
+ QCOMPARE(dv.bottom(), 0.2);
dv.setRange(0.2, 0.7);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(decSpy.count(), 1);
QCOMPARE(changedSpy.count(), 3);
- QVERIFY(dv.bottom() == 0.2);
- QVERIFY(dv.top() == 0.7);
- QVERIFY(dv.decimals() == 0.);
+ QCOMPARE(dv.bottom(), 0.2);
+ QCOMPARE(dv.top(), 0.7);
+ QCOMPARE(dv.decimals(), 0);
dv.setRange(0.3, 0.7);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 2);
QCOMPARE(changedSpy.count(), 4);
- QVERIFY(dv.bottom() == 0.3);
- QVERIFY(dv.top() == 0.7);
- QVERIFY(dv.decimals() == 0.);
+ QCOMPARE(dv.bottom(), 0.3);
+ QCOMPARE(dv.top(), 0.7);
+ QCOMPARE(dv.decimals(), 0);
dv.setRange(0.4, 0.6);
QCOMPARE(topSpy.count(), 3);
QCOMPARE(bottomSpy.count(), 3);
QCOMPARE(changedSpy.count(), 5);
- QVERIFY(dv.bottom() == 0.4);
- QVERIFY(dv.top() == 0.6);
- QVERIFY(dv.decimals() == 0.);
+ QCOMPARE(dv.bottom(), 0.4);
+ QCOMPARE(dv.top(), 0.6);
+ QCOMPARE(dv.decimals(), 0);
dv.setDecimals(10);
QCOMPARE(decSpy.count(), 2);
QCOMPARE(changedSpy.count(), 6);
- QVERIFY(dv.decimals() == 10.);
+ QCOMPARE(dv.decimals(), 10);
dv.setRange(0.4, 0.6, 100);
@@ -298,14 +298,14 @@ void tst_QDoubleValidator::notifySignals()
QCOMPARE(bottomSpy.count(), 3);
QCOMPARE(decSpy.count(), 3);
QCOMPARE(changedSpy.count(), 7);
- QVERIFY(dv.bottom() == 0.4);
- QVERIFY(dv.top() == 0.6);
- QVERIFY(dv.decimals() == 100.);
+ QCOMPARE(dv.bottom(), 0.4);
+ QCOMPARE(dv.top(), 0.6);
+ QCOMPARE(dv.decimals(), 100);
dv.setNotation(QDoubleValidator::StandardNotation);
QCOMPARE(notSpy.count(), 1);
QCOMPARE(changedSpy.count(), 8);
- QVERIFY(dv.notation() == QDoubleValidator::StandardNotation);
+ QCOMPARE(dv.notation(), QDoubleValidator::StandardNotation);
dv.setRange(dv.bottom(), dv.top(), dv.decimals());
QCOMPARE(topSpy.count(), 3);
diff --git a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
index 43f7b58439..a683d903df 100644
--- a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
@@ -239,32 +239,32 @@ void tst_QIntValidator::notifySignals()
iv.setTop(9);
QCOMPARE(topSpy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
- QVERIFY(iv.top() == 9);
+ QCOMPARE(iv.top(), 9);
iv.setBottom(1);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(changedSpy.count(), 2);
- QVERIFY(iv.bottom() == 1);
+ QCOMPARE(iv.bottom(), 1);
iv.setRange(1, 8);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(changedSpy.count(), 3);
- QVERIFY(iv.top() == 8);
- QVERIFY(iv.bottom() == 1);
+ QCOMPARE(iv.top(), 8);
+ QCOMPARE(iv.bottom(), 1);
iv.setRange(2, 8);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 2);
QCOMPARE(changedSpy.count(), 4);
- QVERIFY(iv.top() == 8);
- QVERIFY(iv.bottom() == 2);
+ QCOMPARE(iv.top(), 8);
+ QCOMPARE(iv.bottom(), 2);
iv.setRange(3, 7);
QCOMPARE(topSpy.count(), 3);
QCOMPARE(bottomSpy.count(), 3);
QCOMPARE(changedSpy.count(), 5);
- QVERIFY(iv.top() == 7);
- QVERIFY(iv.bottom() == 3);
+ QCOMPARE(iv.top(), 7);
+ QCOMPARE(iv.bottom(), 3);
iv.setRange(3, 7);
QCOMPARE(topSpy.count(), 3);
diff --git a/tests/auto/network/access/qabstractnetworkcache/BLACKLIST b/tests/auto/network/access/qabstractnetworkcache/BLACKLIST
new file mode 100644
index 0000000000..3bd3350e4b
--- /dev/null
+++ b/tests/auto/network/access/qabstractnetworkcache/BLACKLIST
@@ -0,0 +1,9 @@
+[cacheControl]
+windows
+osx
+[expires]
+osx
+[etag]
+osx
+[lastModified]
+osx
diff --git a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 4cbdef2bbe..fd48ec3253 100644
--- a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -294,6 +294,7 @@ void tst_QAbstractNetworkCache::runTest()
QNetworkAccessManager manager;
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QCOMPARE(diskCache->gotData, false);
@@ -344,6 +345,7 @@ void tst_QAbstractNetworkCache::checkSynchronous()
QNetworkAccessManager manager;
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QCOMPARE(diskCache->gotData, false);
@@ -392,6 +394,7 @@ void tst_QAbstractNetworkCache::deleteCache()
{
QNetworkAccessManager manager;
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QString url = "httpcachetest_cachecontrol.cgi?max-age=1000";
diff --git a/tests/auto/network/access/qftp/BLACKLIST b/tests/auto/network/access/qftp/BLACKLIST
new file mode 100644
index 0000000000..92ad1aee8f
--- /dev/null
+++ b/tests/auto/network/access/qftp/BLACKLIST
@@ -0,0 +1,14 @@
+# QTBUG-15111
+
+[activeMode:WithoutProxy]
+opensuse-13.1 64bit
+redhatenterpriselinuxworkstation-6.6
+osx-10.10
+
+[activeMode:WithoutProxyWithSession]
+opensuse-13.1 64bit
+redhatenterpriselinuxworkstation-6.6
+osx-10.10
+
+[list:epsvNotSupported]
+*
diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro
index 850e1a9417..4294f27e74 100644
--- a/tests/auto/network/access/qftp/qftp.pro
+++ b/tests/auto/network/access/qftp/qftp.pro
@@ -11,4 +11,3 @@ wince {
DEPLOYMENT += addFiles
}
-CONFIG+=insignificant_test # QTBUG-15111: uses live qt-test-server, inherently unstable
diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp
index 7ea1859938..795548ccc8 100644
--- a/tests/auto/network/access/qftp/tst_qftp.cpp
+++ b/tests/auto/network/access/qftp/tst_qftp.cpp
@@ -390,8 +390,7 @@ void tst_QFtp::connectToUnresponsiveHost()
a lot of other stuff in QFtp, so we just expect this test to fail on Windows.
*/
QEXPECT_FAIL("", "timeout not working due to strange Windows socket behaviour (see source file of this test for explanation)", Abort);
-#else
- QEXPECT_FAIL("", "QTBUG-20687", Abort);
+
#endif
QVERIFY2(! QTestEventLoop::instance().timeout(), "Network timeout longer than expected (should have been 60 seconds)");
diff --git a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
index 1d04921c9a..be3e839725 100644
--- a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -83,7 +83,7 @@ void tst_QNetworkCookie::getterSetter()
QNetworkCookie cookie;
QNetworkCookie otherCookie;
- QVERIFY(cookie == otherCookie);
+ QCOMPARE(cookie, otherCookie);
QCOMPARE(cookie, otherCookie);
QVERIFY(!(cookie != otherCookie));
@@ -133,7 +133,7 @@ void tst_QNetworkCookie::getterSetter()
cookie.setSecure(false);
QVERIFY(!cookie.isSecure());
- QVERIFY(cookie == otherCookie);
+ QCOMPARE(cookie, otherCookie);
}
void tst_QNetworkCookie::parseSingleCookie_data()
diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index 708e7ebca8..1685838e9e 100644
--- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -563,7 +563,7 @@ void tst_QNetworkDiskCache::oldCacheVersionFile()
{
QTemporaryFile file(cache.cacheDirectory() + "/XXXXXX.d");
file.setAutoRemove(false);
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QDataStream out(&file);
out << qint32(0xe8);
out << qint32(2);
diff --git a/tests/auto/network/access/qnetworkreply/element.xml b/tests/auto/network/access/qnetworkreply/element.xml
new file mode 100644
index 0000000000..071ffae057
--- /dev/null
+++ b/tests/auto/network/access/qnetworkreply/element.xml
@@ -0,0 +1 @@
+<root attr="value" attr2="value2"><person /><fruit /></root>
diff --git a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro
index 7cb6fddbaf..bd10c77252 100644
--- a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro
+++ b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
-!wince: SUBDIRS += echo
+!winrt:!wince: SUBDIRS += echo
test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro
index b683f620df..772bb55990 100644
--- a/tests/auto/network/access/qnetworkreply/test/test.pro
+++ b/tests/auto/network/access/qnetworkreply/test/test.pro
@@ -13,4 +13,4 @@ TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \
contains(QT_CONFIG,xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102
win32:CONFIG += insignificant_test # QTBUG-24226
-TEST_HELPER_INSTALLS = ../echo/echo
+!winrt: TEST_HELPER_INSTALLS = ../echo/echo
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 4ed175ff7f..ce56dcacba 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -129,6 +129,14 @@ class tst_QNetworkReply: public QObject
return s;
};
+ static QString tempRedirectReplyStr() {
+ QString s = "HTTP/1.1 307 Temporary Redirect\r\n"
+ "Content-Type: text/plain\r\n"
+ "location: %1\r\n"
+ "\r\n";
+ return s;
+ };
+
QEventLoop *loop;
enum RunSimpleRequestReturn { Timeout = 0, Success, Failure };
int returnCode;
@@ -192,8 +200,7 @@ protected Q_SLOTS:
void nestedEventLoops_slot();
private Q_SLOTS:
- void init();
- void cleanup();
+ void cleanup() { cleanupTestData(); }
void initTestCase();
void cleanupTestCase();
@@ -426,6 +433,8 @@ private Q_SLOTS:
void qtbug28035browserDoesNotLoadQtProjectOrgCorrectly();
+ void qtbug45581WrongReplyStatusCode();
+
void synchronousRequest_data();
void synchronousRequest();
#ifndef QT_NO_SSL
@@ -464,6 +473,10 @@ private Q_SLOTS:
void putWithRateLimiting();
+ void ioHttpSingleRedirect();
+ void ioHttpChangeMaxRedirects();
+ void ioHttpRedirectErrors_data();
+ void ioHttpRedirectErrors();
#ifndef QT_NO_SSL
void putWithServerClosingConnectionImmediately();
#endif
@@ -471,6 +484,8 @@ private Q_SLOTS:
// NOTE: This test must be last!
void parentingRepliesToTheApp();
private:
+ void cleanupTestData();
+
QString testDataDir;
};
@@ -605,10 +620,16 @@ protected:
virtual void reply() {
Q_ASSERT(!client.isNull());
// we need to emulate the bytesWrittenSlot call if the data is empty.
- if (dataToTransmit.size() == 0)
+ if (dataToTransmit.size() == 0) {
QMetaObject::invokeMethod(this, "bytesWrittenSlot", Qt::QueuedConnection);
- else
+ } else {
client->write(dataToTransmit);
+ // FIXME: For SSL connections, if we don't flush the socket, the
+ // client never receives the data and since we're doing a disconnect
+ // immediately afterwards, it causes a RemoteHostClosedError for the
+ // client
+ client->flush();
+ }
}
private:
void connectSocketSignals()
@@ -1472,6 +1493,8 @@ void tst_QNetworkReply::initTestCase()
echoProcessDir = QFINDTESTDATA("echo");
QVERIFY2(!echoProcessDir.isEmpty(), qPrintable(
QString::fromLatin1("Couldn't find echo dir starting from %1.").arg(QDir::currentPath())));
+
+ cleanupTestData();
}
void tst_QNetworkReply::cleanupTestCase()
@@ -1487,12 +1510,7 @@ void tst_QNetworkReply::cleanupTestCase()
#endif
}
-void tst_QNetworkReply::init()
-{
- cleanup();
-}
-
-void tst_QNetworkReply::cleanup()
+void tst_QNetworkReply::cleanupTestData()
{
QFile file(testFileName);
QVERIFY(!file.exists() || file.remove());
@@ -1659,14 +1677,14 @@ void tst_QNetworkReply::getFromFile()
// create the file:
QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX");
file.setAutoRemove(true);
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QNetworkRequest request(QUrl::fromLocalFile(file.fileName()));
QNetworkReplyPtr reply;
static const char fileData[] = "This is some data that is in the file.\r\n";
QByteArray data = QByteArray::fromRawData(fileData, sizeof fileData - 1);
- QVERIFY(file.write(data) == data.size());
+ QCOMPARE(file.write(data), data.size());
file.flush();
QCOMPARE(file.size(), qint64(data.size()));
@@ -2914,9 +2932,9 @@ void tst_QNetworkReply::connectToIPv6Address()
//qDebug() << server.receivedData;
QByteArray hostinfo = "\r\nHost: " + hostfield + ":" + QByteArray::number(server.serverPort()) + "\r\n";
QVERIFY(server.receivedData.contains(hostinfo));
- QVERIFY(content == dataToSend);
+ QCOMPARE(content, dataToSend);
QCOMPARE(reply->url(), request.url());
- QVERIFY(reply->error() == error);
+ QCOMPARE(reply->error(), error);
}
void tst_QNetworkReply::sendCustomRequestToHttp_data()
@@ -3045,10 +3063,10 @@ void tst_QNetworkReply::ioGetFromFile()
{
QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX");
file.setAutoRemove(true);
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QFETCH(QByteArray, data);
- QVERIFY(file.write(data) == data.size());
+ QCOMPARE(file.write(data), data.size());
file.flush();
QCOMPARE(file.size(), qint64(data.size()));
@@ -3118,8 +3136,8 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse()
DataReader reader2(reply2);
QSignalSpy spy(reply1.data(), SIGNAL(finished()));
- QVERIFY(waitForFinish(reply1) == Success);
- QVERIFY(waitForFinish(reply2) == Success);
+ QCOMPARE(waitForFinish(reply1), int(Success));
+ QCOMPARE(waitForFinish(reply2), int(Success));
QCOMPARE(reply1->url(), request.url());
QCOMPARE(reply2->url(), request.url());
@@ -3169,8 +3187,8 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseParallel()
DataReader reader2(reply2);
QSignalSpy spy(reply1.data(), SIGNAL(finished()));
- QVERIFY(waitForFinish(reply2) == Success);
- QVERIFY(waitForFinish(reply1) == Success);
+ QCOMPARE(waitForFinish(reply2), int(Success));
+ QCOMPARE(waitForFinish(reply1), int(Success));
QCOMPARE(reply1->url(), request.url());
QCOMPARE(reply2->url(), request.url());
@@ -3272,8 +3290,8 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth()
connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
- QVERIFY(waitForFinish(reply2) == Success);
- QVERIFY(waitForFinish(reply1) == Success);
+ QCOMPARE(waitForFinish(reply2), int(Success));
+ QCOMPARE(waitForFinish(reply1), int(Success));
manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -3402,8 +3420,8 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth()
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- QVERIFY(waitForFinish(reply2) == Success);
- QVERIFY(waitForFinish(reply1) == Success);
+ QCOMPARE(waitForFinish(reply2), int(Success));
+ QCOMPARE(waitForFinish(reply1), int(Success));
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -3525,7 +3543,7 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -3613,7 +3631,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslHandshakeError()
QSignalSpy sslspy(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
connect(reply, SIGNAL(metaDataChanged()), SLOT(storeSslConfiguration()));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QCOMPARE(reply->error(), QNetworkReply::SslHandshakeFailedError);
QCOMPARE(sslspy.count(), 0);
@@ -3671,7 +3689,7 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer()
QNetworkReplyPtr reply(manager.get(request));
QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QCOMPARE(reply->url(), request.url());
QCOMPARE(spy.count(), 1);
@@ -4722,7 +4740,7 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -5092,7 +5110,7 @@ void tst_QNetworkReply::ioPostToHttpEmptyUploadProgress()
QVERIFY(!QTestEventLoop::instance().timeout());
// final check: only 1 uploadProgress has been emitted
- QVERIFY(spy.length() == 1);
+ QCOMPARE(spy.length(), 1);
QList<QVariant> args = spy.last();
QVERIFY(!args.isEmpty());
QCOMPARE(args.at(0).toLongLong(), buffer.size());
@@ -5333,10 +5351,10 @@ void tst_QNetworkReply::chaining()
{
QTemporaryFile sourceFile(QDir::currentPath() + "/temp-XXXXXX");
sourceFile.setAutoRemove(true);
- QVERIFY(sourceFile.open());
+ QVERIFY2(sourceFile.open(), qPrintable(sourceFile.errorString()));
QFETCH(QByteArray, data);
- QVERIFY(sourceFile.write(data) == data.size());
+ QCOMPARE(sourceFile.write(data), data.size());
sourceFile.flush();
QCOMPARE(sourceFile.size(), qint64(data.size()));
@@ -5348,7 +5366,7 @@ void tst_QNetworkReply::chaining()
request.setUrl(url);
QNetworkReplyPtr putReply(manager.put(request, getReply.data()));
- QVERIFY(waitForFinish(putReply) == Success);
+ QCOMPARE(waitForFinish(putReply), int(Success));
QCOMPARE(getReply->url(), QUrl::fromLocalFile(sourceFile.fileName()));
QCOMPARE(getReply->error(), QNetworkReply::NoError);
@@ -5755,7 +5773,7 @@ void tst_QNetworkReply::proxyChange()
// verify that the replies succeeded
QCOMPARE(reply1->error(), QNetworkReply::NoError);
QCOMPARE(reply1->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
- QVERIFY(reply1->size() == 1);
+ QCOMPARE(reply1->size(), 1);
QCOMPARE(reply2->error(), QNetworkReply::NoError);
QCOMPARE(reply2->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
@@ -5772,7 +5790,7 @@ void tst_QNetworkReply::proxyChange()
manager.setProxy(dummyProxy);
QNetworkReplyPtr reply3(manager.get(req));
- QVERIFY(waitForFinish(reply3) == Failure);
+ QCOMPARE(waitForFinish(reply3), int(Failure));
QVERIFY(int(reply3->error()) > 0);
}
@@ -5808,7 +5826,7 @@ void tst_QNetworkReply::authorizationError()
QSignalSpy errorSpy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
QSignalSpy finishedSpy(reply.data(), SIGNAL(finished()));
// now run the request:
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QFETCH(int, errorSignalCount);
QCOMPARE(errorSpy.count(), errorSignalCount);
@@ -5983,7 +6001,7 @@ public slots:
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
QVERIFY(!reply->error());
- QVERIFY(reply->bytesAvailable() == 27906);
+ QCOMPARE(reply->bytesAvailable(), 27906);
if (requestsFinishedCount == 60) {
QTestEventLoop::instance().exitLoop();
@@ -6153,6 +6171,10 @@ void tst_QNetworkReply::sslSessionSharing_data()
void tst_QNetworkReply::sslSessionSharing()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Not implemented with SecureTransport");
+#endif
+
QString urlString("https://" + QtNetworkSettings::serverName());
QList<QNetworkReplyPtr> replies;
@@ -6217,6 +6239,10 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession_data()
void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Not implemented with SecureTransport");
+#endif
+
QString urlString("https://" + QtNetworkSettings::serverName());
// warm up SSL session cache to get a working session
@@ -6501,7 +6527,7 @@ public:
void finishedSlot() {
// We should have already received all readyRead
QVERIFY(!bytesAvailableList.isEmpty());
- QVERIFY(bytesAvailableList.last() == uploadSize);
+ QCOMPARE(bytesAvailableList.last(), uploadSize);
}
};
@@ -6584,7 +6610,7 @@ void tst_QNetworkReply::ioGetFromHttpWithoutContentLength()
QCOMPARE(reply->url(), request.url());
QVERIFY(reply->isFinished());
- QVERIFY(reply->error() == QNetworkReply::NoError);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
}
// Is handled somewhere else too, introduced this special test to have it more accessible
@@ -6651,7 +6677,7 @@ void tst_QNetworkReply::compressedHttpReplyBrokenGzip()
QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
QNetworkReplyPtr reply(manager.get(request));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QCOMPARE(reply->error(), QNetworkReply::ProtocolFailure);
}
@@ -6664,7 +6690,7 @@ void tst_QNetworkReply::getFromUnreachableIp()
QNetworkRequest request(QUrl("http://255.255.255.255/42/23/narf/narf/narf"));
QNetworkReplyPtr reply(manager.get(request));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QVERIFY(reply->error() != QNetworkReply::NoError);
}
@@ -7166,6 +7192,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QByteArray postData = "ACT=100";
QTemporaryDir tempDir(QDir::tempPath() + "/tmp_cache_28035");
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
tempDir.setAutoRemove(true);
QNetworkDiskCache *diskCache = new QNetworkDiskCache();
@@ -7255,6 +7282,34 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
}
+void tst_QNetworkReply::qtbug45581WrongReplyStatusCode()
+{
+ const QUrl url("file:" + testDataDir + "/element.xml");
+ QNetworkRequest request(url);
+
+ QNetworkReplyPtr reply;
+ QSignalSpy finishedSpy(&manager, SIGNAL(finished(QNetworkReply*)));
+ QSignalSpy sslErrorsSpy(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
+ RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::GetOperation, request, reply, 0));
+ QVERIFY(reply->isFinished());
+
+ const QByteArray expectedContent =
+ "<root attr=\"value\" attr2=\"value2\">"
+ "<person /><fruit /></root>\n";
+
+ QCOMPARE(reply->readAll(), expectedContent);
+
+ QCOMPARE(finishedSpy.count(), 0);
+ QCOMPARE(sslErrorsSpy.count(), 0);
+
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), expectedContent.size());
+
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString(), QLatin1String("OK"));
+
+ reply->deleteLater();
+}
+
void tst_QNetworkReply::synchronousRequest_data()
{
QTest::addColumn<QUrl>("url");
@@ -7425,7 +7480,7 @@ void tst_QNetworkReply::httpAbort()
QNetworkRequest request3("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
QNetworkReplyPtr reply3(manager.get(request3));
- QVERIFY(waitForFinish(reply3) == Success);
+ QCOMPARE(waitForFinish(reply3), int(Success));
QVERIFY(reply3->isFinished());
reply3->abort();
@@ -7980,7 +8035,142 @@ void tst_QNetworkReply::putWithRateLimiting()
QCOMPARE(uploadedData, data);
}
+void tst_QNetworkReply::ioHttpSingleRedirect()
+{
+ QUrl localhost = QUrl("http://localhost");
+ QByteArray http200Reply = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n";
+
+ // Setup server to which the second server will redirect to
+ MiniHttpServer server2(http200Reply);
+
+ QUrl redirectUrl = QUrl(localhost);
+ redirectUrl.setPort(server2.serverPort());
+
+ QByteArray tempRedirectReply =
+ tempRedirectReplyStr().arg(QString(redirectUrl.toEncoded())).toLatin1();
+
+
+ // Setup redirect server
+ MiniHttpServer server(tempRedirectReply);
+
+ localhost.setPort(server.serverPort());
+ QNetworkRequest request(localhost);
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+
+ QNetworkReplyPtr reply(manager.get(request));
+ QSignalSpy redSpy(reply.data(), SIGNAL(redirected(QUrl)));
+ QSignalSpy finSpy(reply.data(), SIGNAL(finished()));
+
+ QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
+
+ // Redirected and finished should be emitted exactly once
+ QCOMPARE(redSpy.count(), 1);
+ QCOMPARE(finSpy.count(), 1);
+
+ // Original URL should not be changed after redirect
+ QCOMPARE(request.url(), localhost);
+
+ // Verify Redirect url
+ QList<QVariant> args = redSpy.takeFirst();
+ QCOMPARE(args.at(0).toUrl(), redirectUrl);
+
+ // Reply url is set to the redirect url
+ QCOMPARE(reply->url(), redirectUrl);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+}
+
+void tst_QNetworkReply::ioHttpChangeMaxRedirects()
+{
+ QUrl localhost = QUrl("http://localhost");
+
+ QByteArray http200Reply = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n";
+
+ MiniHttpServer server1("");
+ MiniHttpServer server2("");
+ MiniHttpServer server3(http200Reply);
+
+ QUrl server2Url(localhost);
+ server2Url.setPort(server2.serverPort());
+ server1.setDataToTransmit(tempRedirectReplyStr().arg(
+ QString(server2Url.toEncoded())).toLatin1());
+
+ QUrl server3Url(localhost);
+ server3Url.setPort(server3.serverPort());
+ server2.setDataToTransmit(tempRedirectReplyStr().arg(
+ QString(server3Url.toEncoded())).toLatin1());
+
+ localhost.setPort(server1.serverPort());
+ QNetworkRequest request(localhost);
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+
+ // Set Max redirects to 1. This will cause TooManyRedirectsError
+ request.setMaximumRedirectsAllowed(1);
+
+ QNetworkReplyPtr reply(manager.get(request));
+ QSignalSpy redSpy(reply.data(), SIGNAL(redirected(QUrl)));
+ QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
+
+ QCOMPARE(waitForFinish(reply), int(Failure));
+
+ QCOMPARE(redSpy.count(), request.maximumRedirectsAllowed());
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(reply->error(), QNetworkReply::TooManyRedirectsError);
+
+ // Increase max redirects to allow successful completion
+ request.setMaximumRedirectsAllowed(3);
+
+ QNetworkReplyPtr reply2(manager.get(request));
+ QSignalSpy redSpy2(reply2.data(), SIGNAL(redirected(QUrl)));
+
+ QVERIFY2(waitForFinish(reply2) == Success, msgWaitForFinished(reply2));
+ QCOMPARE(redSpy2.count(), 2);
+ QCOMPARE(reply2->url(), server3Url);
+ QCOMPARE(reply2->error(), QNetworkReply::NoError);
+}
+
+void tst_QNetworkReply::ioHttpRedirectErrors_data()
+{
+ QTest::addColumn<QString>("url");
+ QTest::addColumn<QString>("dataToSend");
+ QTest::addColumn<QNetworkReply::NetworkError>("error");
+
+ QString tempRedirectReply = QString("HTTP/1.1 307 Temporary Redirect\r\n"
+ "Content-Type: text/plain\r\n"
+ "location: http://localhost:%1\r\n\r\n");
+
+ QTest::newRow("too-many-redirects") << "http://localhost" << tempRedirectReply << QNetworkReply::TooManyRedirectsError;
+ QTest::newRow("insecure-redirect") << "https://localhost" << tempRedirectReply << QNetworkReply::InsecureRedirectError;
+ QTest::newRow("unknown-redirect") << "http://localhost"<< tempRedirectReply.replace("http", "bad_protocol") << QNetworkReply::ProtocolUnknownError;
+}
+
+void tst_QNetworkReply::ioHttpRedirectErrors()
+{
+ QFETCH(QString, url);
+ QFETCH(QString, dataToSend);
+ QFETCH(QNetworkReply::NetworkError, error);
+
+ QUrl localhost(url);
+ MiniHttpServer server("", localhost.scheme() == "https");
+
+ localhost.setPort(server.serverPort());
+
+ QByteArray d2s = dataToSend.arg(
+ QString::number(server.serverPort())).toLatin1();
+ server.setDataToTransmit(d2s);
+
+ QNetworkRequest request(localhost);
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+ QNetworkReplyPtr reply(manager.get(request));
+ if (localhost.scheme() == "https")
+ reply.data()->ignoreSslErrors();
+ QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
+
+ QCOMPARE(waitForFinish(reply), int(Failure));
+
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(reply->error(), error);
+}
#ifndef QT_NO_SSL
class PutWithServerClosingConnectionImmediatelyHandler: public QObject
diff --git a/tests/auto/network/access/spdy/BLACKLIST b/tests/auto/network/access/spdy/BLACKLIST
new file mode 100644
index 0000000000..b13eae1000
--- /dev/null
+++ b/tests/auto/network/access/spdy/BLACKLIST
@@ -0,0 +1,4 @@
+[download]
+linux
+[upload]
+linux
diff --git a/tests/auto/network/access/spdy/spdy.pro b/tests/auto/network/access/spdy/spdy.pro
index 6bfc6d84e0..23efa85b47 100644
--- a/tests/auto/network/access/spdy/spdy.pro
+++ b/tests/auto/network/access/spdy/spdy.pro
@@ -5,3 +5,5 @@ SOURCES += tst_spdy.cpp
QT = core core-private network network-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+win32:CONFIG += insignificant_test # QTBUG-47128
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index 7dfc02463e..09ccff4968 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -68,7 +68,7 @@ void tst_QNetworkConfiguration::invalidPoint()
QVERIFY(pt.name().isEmpty());
QVERIFY(!pt.isValid());
- QVERIFY(pt.type() == QNetworkConfiguration::Invalid);
+ QCOMPARE(pt.type(), QNetworkConfiguration::Invalid);
QVERIFY(!(pt.state() & QNetworkConfiguration::Defined));
QVERIFY(!(pt.state() & QNetworkConfiguration::Discovered));
QVERIFY(!(pt.state() & QNetworkConfiguration::Active));
@@ -77,7 +77,7 @@ void tst_QNetworkConfiguration::invalidPoint()
QNetworkConfiguration pt2(pt);
QVERIFY(pt2.name().isEmpty());
QVERIFY(!pt2.isValid());
- QVERIFY(pt2.type() == QNetworkConfiguration::Invalid);
+ QCOMPARE(pt2.type(), QNetworkConfiguration::Invalid);
QVERIFY(!(pt2.state() & QNetworkConfiguration::Defined));
QVERIFY(!(pt2.state() & QNetworkConfiguration::Discovered));
QVERIFY(!(pt2.state() & QNetworkConfiguration::Active));
@@ -91,27 +91,27 @@ void tst_QNetworkConfiguration::comparison()
//compare invalid connection points
QNetworkConfiguration pt1;
QVERIFY(!pt1.isValid());
- QVERIFY(pt1.type() == QNetworkConfiguration::Invalid);
+ QCOMPARE(pt1.type(), QNetworkConfiguration::Invalid);
QNetworkConfiguration pt2(pt1);
QVERIFY(pt1==pt2);
QVERIFY(!(pt1!=pt2));
- QVERIFY(pt1.name() == pt2.name());
- QVERIFY(pt1.isValid() == pt2.isValid());
- QVERIFY(pt1.type() == pt2.type());
- QVERIFY(pt1.state() == pt2.state());
- QVERIFY(pt1.purpose() == pt2.purpose());
+ QCOMPARE(pt1.name(), pt2.name());
+ QCOMPARE(pt1.isValid(), pt2.isValid());
+ QCOMPARE(pt1.type(), pt2.type());
+ QCOMPARE(pt1.state(), pt2.state());
+ QCOMPARE(pt1.purpose(), pt2.purpose());
QNetworkConfiguration pt3;
pt3 = pt1;
QVERIFY(pt1==pt3);
QVERIFY(!(pt1!=pt3));
- QVERIFY(pt1.name() == pt3.name());
- QVERIFY(pt1.isValid() == pt3.isValid());
- QVERIFY(pt1.type() == pt3.type());
- QVERIFY(pt1.state() == pt3.state());
- QVERIFY(pt1.purpose() == pt3.purpose());
+ QCOMPARE(pt1.name(), pt3.name());
+ QCOMPARE(pt1.isValid(), pt3.isValid());
+ QCOMPARE(pt1.type(), pt3.type());
+ QCOMPARE(pt1.state(), pt3.state());
+ QCOMPARE(pt1.purpose(), pt3.purpose());
//test case must run on machine that has valid connection points
QNetworkConfigurationManager manager;
@@ -131,11 +131,11 @@ void tst_QNetworkConfiguration::comparison()
pt3 = defaultConfig;
QVERIFY(defaultConfig==pt3);
QVERIFY(!(defaultConfig!=pt3));
- QVERIFY(defaultConfig.name() == pt3.name());
- QVERIFY(defaultConfig.isValid() == pt3.isValid());
- QVERIFY(defaultConfig.type() == pt3.type());
- QVERIFY(defaultConfig.state() == pt3.state());
- QVERIFY(defaultConfig.purpose() == pt3.purpose());
+ QCOMPARE(defaultConfig.name(), pt3.name());
+ QCOMPARE(defaultConfig.isValid(), pt3.isValid());
+ QCOMPARE(defaultConfig.type(), pt3.type());
+ QCOMPARE(defaultConfig.state(), pt3.state());
+ QCOMPARE(defaultConfig.purpose(), pt3.purpose());
}
void tst_QNetworkConfiguration::children()
@@ -178,7 +178,7 @@ void tst_QNetworkConfiguration::isRoamingAvailable()
if ( c.children().count() <= 1 )
QVERIFY(!c.isRoamingAvailable());
foreach(QNetworkConfiguration child, c.children()) {
- QVERIFY(QNetworkConfiguration::InternetAccessPoint == child.type());
+ QCOMPARE(QNetworkConfiguration::InternetAccessPoint, child.type());
QCOMPARE(child.children().count(), 0);
}
} else {
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index afe1fc274e..94c4d903b2 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -168,7 +168,7 @@ void tst_QNetworkConfigurationManager::defaultConfiguration()
QVERIFY(!defaultConfig.isRoamingAvailable());
QCOMPARE(defaultConfig.state(), QNetworkConfiguration::Discovered);
QNetworkConfiguration copy = manager.configurationFromIdentifier(defaultConfig.identifier());
- QVERIFY(copy == defaultConfig);
+ QCOMPARE(copy, defaultConfig);
}
}
@@ -190,7 +190,7 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier()
QNetworkConfiguration direct = manager.configurationFromIdentifier(c.identifier());
QVERIFY(direct.isValid());
- QVERIFY(direct == c);
+ QCOMPARE(direct, c);
}
//assume that there is no item with identifier 'FooBar'
diff --git a/tests/auto/network/bearer/qnetworksession/qnetworksession.pro b/tests/auto/network/bearer/qnetworksession/qnetworksession.pro
index f1cb47d14e..cd480fb73b 100644
--- a/tests/auto/network/bearer/qnetworksession/qnetworksession.pro
+++ b/tests/auto/network/bearer/qnetworksession/qnetworksession.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = lackey
+!winrt:SUBDIRS = lackey
test.depends = $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/network/bearer/qnetworksession/test/test.pro b/tests/auto/network/bearer/qnetworksession/test/test.pro
index dd7618b4ad..c95baa2b81 100644
--- a/tests/auto/network/bearer/qnetworksession/test/test.pro
+++ b/tests/auto/network/bearer/qnetworksession/test/test.pro
@@ -15,4 +15,4 @@ CONFIG(debug_and_release) {
DESTDIR = ..
}
-TEST_HELPER_INSTALLS = ../lackey/lackey
+!winrt: TEST_HELPER_INSTALLS = ../lackey/lackey
diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
index 2fd80b3e71..cd510ddfa8 100644
--- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
@@ -187,19 +187,19 @@ void tst_QNetworkSession::invalidSession()
// 1. Verify that session created with invalid configuration remains in invalid state
QNetworkSession session(QNetworkConfiguration(), 0);
QVERIFY(!session.isOpen());
- QVERIFY(session.state() == QNetworkSession::Invalid);
- QVERIFY(session.error() == QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(session.state(), QNetworkSession::Invalid);
+ QCOMPARE(session.error(), QNetworkSession::InvalidConfigurationError);
// 2. Verify that opening session with invalid configuration both 1) emits invalidconfigurationerror and 2) sets session's state as invalid.
QSignalSpy errorSpy(&session, SIGNAL(error(QNetworkSession::SessionError)));
session.open();
session.waitForOpened(1000); // Should bail out right away
- QVERIFY(errorSpy.count() == 1);
+ QCOMPARE(errorSpy.count(), 1);
QNetworkSession::SessionError error =
qvariant_cast<QNetworkSession::SessionError> (errorSpy.first().at(0));
- QVERIFY(error == QNetworkSession::InvalidConfigurationError);
- QVERIFY(session.error() == QNetworkSession::InvalidConfigurationError);
- QVERIFY(session.state() == QNetworkSession::Invalid);
+ QCOMPARE(error, QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(session.error(), QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(session.state(), QNetworkSession::Invalid);
#ifdef QNETWORKSESSION_MANUAL_TESTS
@@ -210,7 +210,7 @@ void tst_QNetworkSession::invalidSession()
qDebug() << "Delete the WLAN IAP from phone now (waiting 60 seconds): " << invalidatedConfig.name();
QTest::qWait(60000);
QVERIFY(!invalidatedConfig.isValid());
- QVERIFY(invalidatedSession.state() == QNetworkSession::Invalid);
+ QCOMPARE(invalidatedSession.state(), QNetworkSession::Invalid);
qDebug() << "Add the WLAN IAP back (waiting 60 seconds): " << invalidatedConfig.name();
QTest::qWait(60000);
}
@@ -235,11 +235,11 @@ void tst_QNetworkSession::invalidSession()
QVERIFY(definedSession.state() == QNetworkSession::NotAvailable); // State is not available because WLAN is not in coverage
QVERIFY(!errorSpy.isEmpty()); // Session tells with error about invalidated configuration
sessionError = qvariant_cast<QNetworkSession::SessionError> (errorSpy.first().at(0));
- QVERIFY(sessionError == QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(sessionError, QNetworkSession::InvalidConfigurationError);
qDebug() << "Turn the WLAN IAP back on (waiting 60 seconds): " << definedConfig.name();
QTest::qWait(60000);
updateConfigurations();
- QVERIFY(definedConfig.state() == QNetworkConfiguration::Discovered);
+ QCOMPARE(definedConfig.state(), QNetworkConfiguration::Discovered);
}
#endif
}
@@ -260,7 +260,7 @@ void tst_QNetworkSession::sessionProperties()
{
QFETCH(QNetworkConfiguration, configuration);
QNetworkSession session(configuration);
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QStringList validBearerNames = QStringList() << QLatin1String("Unknown")
<< QLatin1String("Ethernet")
<< QLatin1String("WLAN")
@@ -303,10 +303,10 @@ void tst_QNetworkSession::sessionProperties()
} else {
switch (configuration.state()) {
case QNetworkConfiguration::Undefined:
- QVERIFY(session.state() == QNetworkSession::NotAvailable);
+ QCOMPARE(session.state(), QNetworkSession::NotAvailable);
break;
case QNetworkConfiguration::Defined:
- QVERIFY(session.state() == QNetworkSession::NotAvailable);
+ QCOMPARE(session.state(), QNetworkSession::NotAvailable);
break;
case QNetworkConfiguration::Discovered:
QVERIFY(session.state() == QNetworkSession::Connecting ||
@@ -372,12 +372,12 @@ void tst_QNetworkSession::userChoiceSession()
{
QFETCH(QNetworkConfiguration, configuration);
- QVERIFY(configuration.type() == QNetworkConfiguration::UserChoice);
+ QCOMPARE(configuration.type(), QNetworkConfiguration::UserChoice);
QNetworkSession session(configuration);
// Check that configuration was really set
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QVERIFY(!session.isOpen());
@@ -431,7 +431,7 @@ void tst_QNetworkSession::userChoiceSession()
if (expectStateChange)
QTRY_VERIFY_WITH_TIMEOUT(!stateChangedSpy.isEmpty(), TestTimeOut);
- QVERIFY(session.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
#endif
@@ -462,16 +462,16 @@ void tst_QNetworkSession::userChoiceSession()
manager.configurationFromIdentifier(activeIdentifier);
QVERIFY(activeConfiguration.isValid());
- QVERIFY(activeConfiguration.type() == QNetworkConfiguration::InternetAccessPoint);
+ QCOMPARE(activeConfiguration.type(), QNetworkConfiguration::InternetAccessPoint);
//resetting ActiveConfiguration is ignored (read only property)
session.setSessionProperty("ActiveConfiguration", testIdentifier);
QVERIFY(session.sessionProperty("ActiveConfiguration").toString() != testIdentifier);
if (userChoiceConfiguration.type() == QNetworkConfiguration::InternetAccessPoint) {
- QVERIFY(userChoiceConfiguration == activeConfiguration);
+ QCOMPARE(userChoiceConfiguration, activeConfiguration);
} else {
- QVERIFY(userChoiceConfiguration.type() == QNetworkConfiguration::ServiceNetwork);
+ QCOMPARE(userChoiceConfiguration.type(), QNetworkConfiguration::ServiceNetwork);
QVERIFY(userChoiceConfiguration.children().contains(activeConfiguration));
}
} else {
@@ -500,18 +500,21 @@ void tst_QNetworkSession::sessionOpenCloseStop()
{
QFETCH(QNetworkConfiguration, configuration);
QFETCH(bool, forceSessionStop);
+#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
+ QSKIP("Deadlocks on Linux due to QTBUG-45655");
+#endif
QNetworkSession session(configuration);
// Test initial state of the session.
{
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QVERIFY(!session.isOpen());
// session may be invalid if configuration is removed between when
// sessionOpenCloseStop_data() is called and here.
QVERIFY((configuration.isValid() && (session.state() != QNetworkSession::Invalid)) ||
(!configuration.isValid() && (session.state() == QNetworkSession::Invalid)));
- QVERIFY(session.error() == QNetworkSession::UnknownSessionError);
+ QCOMPARE(session.error(), QNetworkSession::UnknownSessionError);
}
// The remaining tests require the session to be not NotAvailable.
@@ -541,7 +544,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::SessionError error =
qvariant_cast<QNetworkSession::SessionError>(errorSpy.first().at(0));
- QVERIFY(session.state() == previousState);
+ QCOMPARE(session.state(), previousState);
if (error == QNetworkSession::OperationNotSupportedError) {
// The session needed to bring up the interface,
@@ -571,13 +574,13 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(0).at(0));
- QVERIFY(state == QNetworkSession::Connecting);
+ QCOMPARE(state, QNetworkSession::Connecting);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(1).at(0));
- QVERIFY(state == QNetworkSession::Connected);
+ QCOMPARE(state, QNetworkSession::Connected);
}
- QVERIFY(session.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
#endif
@@ -600,10 +603,10 @@ void tst_QNetworkSession::sessionOpenCloseStop()
// Test opening a second session.
{
- QVERIFY(session2.configuration() == configuration);
+ QCOMPARE(session2.configuration(), configuration);
QVERIFY(!session2.isOpen());
- QVERIFY(session2.state() == QNetworkSession::Connected);
- QVERIFY(session.error() == QNetworkSession::UnknownSessionError);
+ QCOMPARE(session2.state(), QNetworkSession::Connected);
+ QCOMPARE(session.error(), QNetworkSession::UnknownSessionError);
session2.open();
@@ -611,10 +614,10 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (errorSpy2.isEmpty()) {
QVERIFY(session2.isOpen());
- QVERIFY(session2.state() == QNetworkSession::Connected);
+ QCOMPARE(session2.state(), QNetworkSession::Connected);
}
QVERIFY(session.isOpen());
- QVERIFY(session.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
if (errorSpy2.isEmpty()) {
@@ -648,8 +651,8 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::SessionError error2 =
qvariant_cast<QNetworkSession::SessionError>(errorSpy2.first().at(0));
- QVERIFY(error == QNetworkSession::SessionAbortedError);
- QVERIFY(error2 == QNetworkSession::SessionAbortedError);
+ QCOMPARE(error, QNetworkSession::SessionAbortedError);
+ QCOMPARE(error2, QNetworkSession::SessionAbortedError);
QCOMPARE(errorSpy.count(), 1);
QCOMPARE(errorSpy2.count(), 1);
@@ -668,8 +671,8 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QTRY_VERIFY_WITH_TIMEOUT(stateChangedSpy2.count() >= 1 || !errorSpy2.isEmpty(), TestTimeOut);
if (!errorSpy2.isEmpty()) {
- QVERIFY(session2.state() == previousState);
- QVERIFY(session.state() == previousState);
+ QCOMPARE(session2.state(), previousState);
+ QCOMPARE(session.state(), previousState);
QNetworkSession::SessionError error =
qvariant_cast<QNetworkSession::SessionError>(errorSpy2.first().at(0));
@@ -697,22 +700,22 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::State state;
if (stateChangedSpy2.count() == 4) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Connecting);
+ QCOMPARE(state, QNetworkSession::Connecting);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Connected);
+ QCOMPARE(state, QNetworkSession::Connected);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(2).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ QCOMPARE(state, QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
} else if (stateChangedSpy2.count() == 2) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ QCOMPARE(state, QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
} else {
QFAIL("Unexpected amount of state changes when roaming.");
}
@@ -748,7 +751,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (stateChangedSpy.count() > 1) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 2).at(0));
- QVERIFY(state == QNetworkSession::Roaming);
+ QCOMPARE(state, QNetworkSession::Roaming);
}
roamedSuccessfully = true;
}
@@ -776,9 +779,9 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (stateChangedSpy2.count() == 2) {
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ QCOMPARE(state, QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
} else {
QVERIFY(stateChangedSpy2.count() >= 1);
@@ -791,7 +794,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(stateChangedSpy2.count() - 1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
}
}
@@ -818,14 +821,14 @@ void tst_QNetworkSession::sessionOpenCloseStop()
session2.close();
QTRY_VERIFY_WITH_TIMEOUT(!sessionClosedSpy2.isEmpty(), TestTimeOut);
- QVERIFY(stateChangedSpy2.count() == stateChangedCountBeforeClose);
+ QCOMPARE(stateChangedSpy2.count(), stateChangedCountBeforeClose);
QVERIFY(sessionClosedSpy.isEmpty());
QVERIFY(session.isOpen());
QVERIFY(!session2.isOpen());
- QVERIFY(session.state() == QNetworkSession::Connected);
- QVERIFY(session2.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
+ QCOMPARE(session2.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
QCOMPARE(session.interface().hardwareAddress(), session2.interface().hardwareAddress());
@@ -1233,7 +1236,7 @@ void tst_QNetworkSession::sessionAutoClose()
QNetworkSession session(configuration);
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QVariant autoCloseSession = session.sessionProperty(QLatin1String("AutoCloseSessionTimeout"));
@@ -1259,7 +1262,7 @@ void tst_QNetworkSession::sessionAutoClose()
QVERIFY(!session.isOpen());
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
autoCloseSession = session.sessionProperty(QLatin1String("AutoCloseSessionTimeout"));
diff --git a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
index f6b7dfa3af..026a2a2722 100644
--- a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
+++ b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
@@ -82,7 +82,7 @@ void tst_QAuthenticator::basicAuth()
QAuthenticator auth;
auth.detach();
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
- QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+ QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
QList<QPair<QByteArray, QByteArray> > headers;
headers << qMakePair<QByteArray, QByteArray>(QByteArray("WWW-Authenticate"), "Basic " + data.toUtf8());
@@ -94,7 +94,7 @@ void tst_QAuthenticator::basicAuth()
auth.setUser(user);
auth.setPassword(password);
- QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+ QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
QCOMPARE(priv->calculateResponse("GET", "/").constData(), QByteArray("Basic " + expectedReply).constData());
}
@@ -125,7 +125,7 @@ void tst_QAuthenticator::ntlmAuth()
auth.detach();
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
- QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+ QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
QList<QPair<QByteArray, QByteArray> > headers;
diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
index ef24cbf3c8..8069865d93 100644
--- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
@@ -83,22 +83,12 @@ private slots:
void isInSubnet();
void isLoopback_data();
void isLoopback();
+ void isMulticast_data();
+ void isMulticast();
void convertv4v6_data();
void convertv4v6();
};
-QT_BEGIN_NAMESPACE
-namespace QTest {
- template<>
- char *toString(const QHostAddress &addr)
- {
- if (addr.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol)
- return qstrdup("<invalid>");
- return qstrdup(addr.toString().toLatin1());
- }
-}
-QT_END_NAMESPACE
-
tst_QHostAddress::tst_QHostAddress()
{
}
@@ -234,7 +224,7 @@ void tst_QHostAddress::setAddress_QString()
QFETCH(int, protocol);
QHostAddress hostAddr;
- QVERIFY(hostAddr.setAddress(address) == ok);
+ QCOMPARE(hostAddr.setAddress(address), ok);
if (ok)
QTEST(hostAddr.toString(), "resAddr");
@@ -316,7 +306,7 @@ void tst_QHostAddress::compare_data()
QTest::newRow("6") << QHostAddress(QHostAddress::LocalHost) << QHostAddress(QHostAddress::LocalHostIPv6) << false;
QTest::newRow("7") << QHostAddress() << QHostAddress(QHostAddress::LocalHostIPv6) << false;
- Q_IPV6ADDR localhostv4mapped = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1 };
+ Q_IPV6ADDR localhostv4mapped = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1 } };
QTest::newRow("v4-v4mapped") << QHostAddress(QHostAddress::LocalHost) << QHostAddress("::ffff:127.0.0.1") << false;
QTest::newRow("v4-v4mapped-2") << QHostAddress(QHostAddress::LocalHost) << QHostAddress(localhostv4mapped) << false;
}
@@ -330,7 +320,7 @@ void tst_QHostAddress::compare()
QCOMPARE(first == second, result);
QCOMPARE(second == first, result);
if (result == true)
- QVERIFY(qHash(first) == qHash(second));
+ QCOMPARE(qHash(first), qHash(second));
}
void tst_QHostAddress::assignment()
@@ -399,11 +389,11 @@ void tst_QHostAddress::streaming()
QByteArray ba;
QDataStream ds1(&ba, QIODevice::WriteOnly);
ds1 << address;
- QVERIFY(ds1.status() == QDataStream::Ok);
+ QCOMPARE(ds1.status(), QDataStream::Ok);
QDataStream ds2(&ba, QIODevice::ReadOnly);
QHostAddress address2;
ds2 >> address2;
- QVERIFY(ds2.status() == QDataStream::Ok);
+ QCOMPARE(ds2.status(), QDataStream::Ok);
QCOMPARE(address, address2);
}
@@ -631,6 +621,9 @@ void tst_QHostAddress::isLoopback_data()
QTest::addColumn<QHostAddress>("address");
QTest::addColumn<bool>("result");
+ QTest::newRow("default") << QHostAddress() << false;
+ QTest::newRow("invalid") << QHostAddress("&&&") << false;
+
QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << true;
QTest::newRow("::1") << QHostAddress("::1") << true;
@@ -639,7 +632,6 @@ void tst_QHostAddress::isLoopback_data()
QTest::newRow("127.0.0.2") << QHostAddress("127.0.0.2") << true;
QTest::newRow("127.3.2.1") << QHostAddress("127.3.2.1") << true;
- QTest::newRow("default") << QHostAddress() << false;
QTest::newRow("1.2.3.4") << QHostAddress("1.2.3.4") << false;
QTest::newRow("10.0.0.4") << QHostAddress("10.0.0.4") << false;
QTest::newRow("192.168.3.4") << QHostAddress("192.168.3.4") << false;
@@ -650,10 +642,12 @@ void tst_QHostAddress::isLoopback_data()
QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << false;
QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << false;
QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << false;
+ QTest::newRow("ipv6-all-ffff") << QHostAddress("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << false;
QTest::newRow("::ffff:127.0.0.1") << QHostAddress("::ffff:127.0.0.1") << true;
QTest::newRow("::ffff:127.0.0.2") << QHostAddress("::ffff:127.0.0.2") << true;
QTest::newRow("::ffff:127.3.2.1") << QHostAddress("::ffff:127.3.2.1") << true;
+
}
void tst_QHostAddress::isLoopback()
@@ -664,6 +658,50 @@ void tst_QHostAddress::isLoopback()
QCOMPARE(address.isLoopback(), result);
}
+void tst_QHostAddress::isMulticast_data()
+{
+ QTest::addColumn<QHostAddress>("address");
+ QTest::addColumn<bool>("result");
+
+ QTest::newRow("default") << QHostAddress() << false;
+ QTest::newRow("invalid") << QHostAddress("&&&") << false;
+
+ QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << false;
+ QTest::newRow("::1") << QHostAddress("::1") << false;
+ QTest::newRow("ipv4_loop") << QHostAddress(QHostAddress::LocalHost) << false;
+ QTest::newRow("127.0.0.1") << QHostAddress("127.0.0.1") << false;
+ QTest::newRow("::") << QHostAddress("::") << false;
+ QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << false;
+ QTest::newRow("AnyIPv4") << QHostAddress(QHostAddress::AnyIPv4) << false;
+ QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << false;
+ QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << false;
+ QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << false;
+
+ QTest::newRow("223.255.255.255") << QHostAddress("223.255.255.255") << false;
+ QTest::newRow("224.0.0.0") << QHostAddress("224.0.0.0") << true;
+ QTest::newRow("239.255.255.255") << QHostAddress("239.255.255.255") << true;
+ QTest::newRow("240.0.0.0") << QHostAddress("240.0.0.0") << false;
+
+ QTest::newRow("::ffff:223.255.255.255") << QHostAddress("::ffff:223.255.255.255") << false;
+ QTest::newRow("::ffff:224.0.0.0") << QHostAddress("::ffff:224.0.0.0") << true;
+ QTest::newRow("::ffff:239.255.255.255") << QHostAddress("::ffff:239.255.255.255") << true;
+ QTest::newRow("::ffff:240.0.0.0") << QHostAddress("::ffff:240.0.0.0") << false;
+
+ QTest::newRow("fc00::") << QHostAddress("fc00::") << false;
+ QTest::newRow("fe80::") << QHostAddress("fe80::") << false;
+ QTest::newRow("fec0::") << QHostAddress("fec0::") << false;
+ QTest::newRow("ff00::") << QHostAddress("ff00::") << true;
+ QTest::newRow("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << QHostAddress("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << true;
+}
+
+void tst_QHostAddress::isMulticast()
+{
+ QFETCH(QHostAddress, address);
+ QFETCH(bool, result);
+
+ QCOMPARE(address.isMulticast(), result);
+}
+
void tst_QHostAddress::convertv4v6_data()
{
QTest::addColumn<QHostAddress>("source");
diff --git a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
index c9b795d098..12858c97ee 100644
--- a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
@@ -14,3 +14,5 @@ wince {
# needed for getaddrinfo with official MinGW
mingw:DEFINES += _WIN32_WINNT=0x0501
+
+winrt: WINRT_MANIFEST.capabilities += internetClientServer
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index 599e475beb..5f0addba98 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -561,13 +561,13 @@ void tst_QHostInfo::cache()
QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(valid == false);
+ QVERIFY(!valid);
QVERIFY(result.addresses().isEmpty());
// loopkup second time, result should come directly
valid = false;
result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
- QVERIFY(valid == true);
+ QVERIFY(valid);
QVERIFY(!result.addresses().isEmpty());
// clear the cache
@@ -578,7 +578,7 @@ void tst_QHostInfo::cache()
result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(valid == false);
+ QVERIFY(!valid);
QVERIFY(result.addresses().isEmpty());
// the slot should have been called 2 times.
diff --git a/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp b/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
index d88b2e222c..cca670e13a 100644
--- a/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
+++ b/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
@@ -76,7 +76,7 @@ void tst_QNetworkAddressEntry::getSetCheck()
entry = entry2;
QCOMPARE(entry, entry2);
- QVERIFY(entry == entry);
+ QCOMPARE(entry, entry);
QVERIFY(!(entry != entry2));
}
diff --git a/tests/auto/network/kernel/qnetworkinterface/BLACKLIST b/tests/auto/network/kernel/qnetworkinterface/BLACKLIST
new file mode 100644
index 0000000000..23bb688d9a
--- /dev/null
+++ b/tests/auto/network/kernel/qnetworkinterface/BLACKLIST
@@ -0,0 +1,2 @@
+[localAddress]
+linux
diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
index b3ffe74b67..519ee0dc84 100644
--- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
+++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
@@ -55,9 +55,11 @@ private slots:
void initTestCase();
void cleanupTestCase();
void dump();
+ void consistencyCheck();
void loopbackIPv4();
void loopbackIPv6();
void localAddress();
+ void interfaceFromXXX_data();
void interfaceFromXXX();
void copyInvalidInterface();
@@ -147,6 +149,24 @@ void tst_QNetworkInterface::dump()
}
}
+void tst_QNetworkInterface::consistencyCheck()
+{
+ QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
+ QSet<QString> interfaceNames;
+ QVector<int> interfaceIndexes;
+
+ foreach (const QNetworkInterface &iface, ifaces) {
+ QVERIFY2(!interfaceNames.contains(iface.name()),
+ "duplicate name = " + iface.name().toLocal8Bit());
+ interfaceNames << iface.name();
+
+ QVERIFY2(!interfaceIndexes.contains(iface.index()),
+ "duplicate index = " + QByteArray::number(iface.index()));
+ if (iface.index())
+ interfaceIndexes << iface.index();
+ }
+}
+
void tst_QNetworkInterface::loopbackIPv4()
{
QList<QHostAddress> all = QNetworkInterface::allAddresses();
@@ -188,35 +208,42 @@ void tst_QNetworkInterface::localAddress()
QVERIFY(all.contains(local));
}
-void tst_QNetworkInterface::interfaceFromXXX()
+void tst_QNetworkInterface::interfaceFromXXX_data()
{
+ QTest::addColumn<QNetworkInterface>("iface");
+
QList<QNetworkInterface> allInterfaces = QNetworkInterface::allInterfaces();
+ foreach (QNetworkInterface iface, allInterfaces)
+ QTest::newRow(iface.name().toLocal8Bit()) << iface;
+}
+
+void tst_QNetworkInterface::interfaceFromXXX()
+{
+ QFETCH(QNetworkInterface, iface);
- foreach (QNetworkInterface iface, allInterfaces) {
- QVERIFY(QNetworkInterface::interfaceFromName(iface.name()).isValid());
- foreach (QNetworkAddressEntry entry, iface.addressEntries()) {
- QVERIFY(!entry.ip().isNull());
+ QVERIFY(QNetworkInterface::interfaceFromName(iface.name()).isValid());
+ foreach (QNetworkAddressEntry entry, iface.addressEntries()) {
+ QVERIFY(!entry.ip().isNull());
- if (!entry.netmask().isNull()) {
- QCOMPARE(entry.netmask().protocol(), entry.ip().protocol());
+ if (!entry.netmask().isNull()) {
+ QCOMPARE(entry.netmask().protocol(), entry.ip().protocol());
- // if the netmask is known, the broadcast is known
- // but only for IPv4 (there is no such thing as broadcast in IPv6)
- if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
- QVERIFY(!entry.broadcast().isNull());
+ // if the netmask is known, the broadcast is known
+ // but only for IPv4 (there is no such thing as broadcast in IPv6)
+ if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
+ QVERIFY(!entry.broadcast().isNull());
- // verify that the broadcast address is correct
- quint32 ip = entry.ip().toIPv4Address();
- quint32 mask = entry.netmask().toIPv4Address();
- quint32 bcast = entry.broadcast().toIPv4Address();
+ // verify that the broadcast address is correct
+ quint32 ip = entry.ip().toIPv4Address();
+ quint32 mask = entry.netmask().toIPv4Address();
+ quint32 bcast = entry.broadcast().toIPv4Address();
- QCOMPARE(bcast, ip | ~mask);
- }
+ QCOMPARE(bcast, ip | ~mask);
}
-
- if (!entry.broadcast().isNull())
- QCOMPARE(entry.broadcast().protocol(), entry.ip().protocol());
}
+
+ if (!entry.broadcast().isNull())
+ QCOMPARE(entry.broadcast().protocol(), entry.ip().protocol());
}
}
diff --git a/tests/auto/network/socket/platformsocketengine/BLACKLIST b/tests/auto/network/socket/platformsocketengine/BLACKLIST
new file mode 100644
index 0000000000..8e1a55995e
--- /dev/null
+++ b/tests/auto/network/socket/platformsocketengine/BLACKLIST
@@ -0,0 +1 @@
+windows
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index 9bd89cdf4f..71125f463a 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -130,18 +130,18 @@ void tst_PlatformSocketEngine::construction()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.isValid());
- QVERIFY(socketDevice.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(socketDevice.socketType() == QAbstractSocket::TcpSocket);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(socketDevice.socketType(), QAbstractSocket::TcpSocket);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(socketDevice.socketDescriptor() != -1);
- QVERIFY(socketDevice.localAddress() == QHostAddress());
- QVERIFY(socketDevice.localPort() == 0);
- QVERIFY(socketDevice.peerAddress() == QHostAddress());
- QVERIFY(socketDevice.peerPort() == 0);
- QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.localAddress(), QHostAddress());
+ QCOMPARE(socketDevice.localPort(), quint16(0));
+ QCOMPARE(socketDevice.peerAddress(), QHostAddress());
+ QCOMPARE(socketDevice.peerPort(), quint16(0));
+ QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == -1);
+ QCOMPARE(socketDevice.bytesAvailable(), -1);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());
@@ -154,16 +154,16 @@ void tst_PlatformSocketEngine::simpleConnectToIMAP()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
const bool isConnected = socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
if (!isConnected) {
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
}
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -200,8 +200,8 @@ void tst_PlatformSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//---------------------------------------------------------------------------
@@ -213,13 +213,13 @@ void tst_PlatformSocketEngine::udpLoopbackTest()
QVERIFY(udpSocket.initialize(QAbstractSocket::UdpSocket));
QVERIFY(udpSocket.isValid());
QVERIFY(udpSocket.socketDescriptor() != -1);
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(udpSocket.socketType() == QAbstractSocket::UdpSocket);
- QVERIFY(udpSocket.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(udpSocket.socketType(), QAbstractSocket::UdpSocket);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::UnconnectedState);
// Bind #1 to localhost
QVERIFY(udpSocket.bind(QHostAddress("127.0.0.1"), 0));
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
quint16 port = udpSocket.localPort();
QVERIFY(port != 0);
@@ -229,7 +229,7 @@ void tst_PlatformSocketEngine::udpLoopbackTest()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(QHostAddress("127.0.0.1"), port));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
// Write a message to #1
QByteArray message1 = "hei der";
@@ -243,13 +243,13 @@ void tst_PlatformSocketEngine::udpLoopbackTest()
QVERIFY(available > 0);
QByteArray answer;
answer.resize(available);
- QHostAddress senderAddress;
- quint16 senderPort = 0;
- QVERIFY(udpSocket.readDatagram(answer.data(), answer.size(),
- &senderAddress,
- &senderPort) == message1.size());
- QVERIFY(senderAddress == QHostAddress("127.0.0.1"));
- QVERIFY(senderPort != 0);
+ QIpPacketHeader header;
+ QCOMPARE(udpSocket.readDatagram(answer.data(), answer.size(),
+ &header, QAbstractSocketEngine::WantDatagramSender),
+ qint64(message1.size()));
+ QVERIFY(header.senderAddress == QHostAddress("127.0.0.1"));
+ QCOMPARE(header.senderAddress, QHostAddress("127.0.0.1"));
+ QVERIFY(header.senderPort != 0);
}
//---------------------------------------------------------------------------
@@ -261,13 +261,13 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest()
bool init = udpSocket.initialize(QAbstractSocket::UdpSocket, QAbstractSocket::IPv6Protocol);
if (!init) {
- QVERIFY(udpSocket.error() == QAbstractSocket::UnsupportedSocketOperationError);
+ QCOMPARE(udpSocket.error(), QAbstractSocket::UnsupportedSocketOperationError);
} else {
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv6Protocol);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv6Protocol);
// Bind #1 to localhost
QVERIFY(udpSocket.bind(QHostAddress("::1"), 0));
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
quint16 port = udpSocket.localPort();
QVERIFY(port != 0);
@@ -277,7 +277,7 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(QHostAddress("::1"), port));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
// Write a message to #1
QByteArray message1 = "hei der";
@@ -291,13 +291,13 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest()
QVERIFY(available > 0);
QByteArray answer;
answer.resize(available);
- QHostAddress senderAddress;
- quint16 senderPort = 0;
- QVERIFY(udpSocket.readDatagram(answer.data(), answer.size(),
- &senderAddress,
- &senderPort) == message1.size());
- QVERIFY(senderAddress == QHostAddress("::1"));
- QVERIFY(senderPort != 0);
+ QIpPacketHeader header;
+ QCOMPARE(udpSocket.readDatagram(answer.data(), answer.size(),
+ &header, QAbstractSocketEngine::WantDatagramSender),
+ qint64(message1.size()));
+ QVERIFY(header.senderAddress == QHostAddress("::1"));
+ QCOMPARE(header.senderAddress, QHostAddress("::1"));
+ QVERIFY(header.senderPort != 0);
}
}
@@ -314,7 +314,7 @@ void tst_PlatformSocketEngine::broadcastTest()
// Bind to any port on all interfaces
QVERIFY(broadcastSocket.bind(QHostAddress::Any, 0));
- QVERIFY(broadcastSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(broadcastSocket.state(), QAbstractSocket::BoundState);
quint16 port = broadcastSocket.localPort();
QVERIFY(port > 0);
@@ -323,9 +323,9 @@ void tst_PlatformSocketEngine::broadcastTest()
= "MOOT wtf is a MOOT? talk english not your sutpiD ENGLISH.";
qint64 written = broadcastSocket.writeDatagram(trollMessage.data(),
trollMessage.size(),
- QHostAddress::Broadcast,
- port);
+ QIpPacketHeader(QHostAddress::Broadcast, port));
+ QVERIFY2(written != -1, qt_error_string().toLocal8Bit());
QCOMPARE((int)written, trollMessage.size());
// Wait until we receive it ourselves
@@ -354,20 +354,20 @@ void tst_PlatformSocketEngine::serverTest()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
PLATFORMSOCKETENGINE client;
QVERIFY(client.initialize(QAbstractSocket::TcpSocket));
if (!client.connectToHost(QHostAddress("127.0.0.1"), port)) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
// The server accepts the connection
@@ -378,7 +378,7 @@ void tst_PlatformSocketEngine::serverTest()
// socket descriptor from accept(). It's pre-connected.
PLATFORMSOCKETENGINE serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
// The server socket sends a greeting to the clietn
QByteArray greeting = "Greetings!";
@@ -407,13 +407,13 @@ void tst_PlatformSocketEngine::udpLoopbackPerformance()
QVERIFY(udpSocket.initialize(QAbstractSocket::UdpSocket));
QVERIFY(udpSocket.isValid());
QVERIFY(udpSocket.socketDescriptor() != -1);
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(udpSocket.socketType() == QAbstractSocket::UdpSocket);
- QVERIFY(udpSocket.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(udpSocket.socketType(), QAbstractSocket::UdpSocket);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::UnconnectedState);
// Bind #1 to localhost
QVERIFY(udpSocket.bind(QHostAddress("127.0.0.1"), 0));
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
quint16 port = udpSocket.localPort();
QVERIFY(port != 0);
@@ -423,7 +423,7 @@ void tst_PlatformSocketEngine::udpLoopbackPerformance()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(QHostAddress("127.0.0.1"), port));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
const int messageSize = 8192;
QByteArray message1(messageSize, '@');
@@ -459,12 +459,12 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
PLATFORMSOCKETENGINE client;
@@ -472,9 +472,9 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
// Connect to our server
if (!client.connectToHost(QHostAddress("127.0.0.1"), port)) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
// The server accepts the connection
@@ -485,7 +485,7 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
// socket descriptor from accept(). It's pre-connected.
PLATFORMSOCKETENGINE serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
const int messageSize = 1024 * 256;
QByteArray message1(messageSize, '@');
@@ -562,7 +562,7 @@ void tst_PlatformSocketEngine::bind()
PLATFORMSOCKETENGINE binder;
QVERIFY(binder.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder.bind(QHostAddress::AnyIPv4, 82));
- QVERIFY(binder.error() == QAbstractSocket::SocketAccessError);
+ QCOMPARE(binder.error(), QAbstractSocket::SocketAccessError);
#endif
PLATFORMSOCKETENGINE binder2;
@@ -572,7 +572,7 @@ void tst_PlatformSocketEngine::bind()
PLATFORMSOCKETENGINE binder3;
QVERIFY(binder3.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder3.bind(QHostAddress::AnyIPv4, 31180));
- QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError);
+ QCOMPARE(binder3.error(), QAbstractSocket::AddressInUseError);
if (QtNetworkSettings::hasIPv6()) {
PLATFORMSOCKETENGINE binder4;
@@ -582,7 +582,7 @@ void tst_PlatformSocketEngine::bind()
PLATFORMSOCKETENGINE binder5;
QVERIFY(binder5.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv6Protocol));
QVERIFY(!binder5.bind(QHostAddress::AnyIPv6, 31180));
- QVERIFY(binder5.error() == QAbstractSocket::AddressInUseError);
+ QCOMPARE(binder5.error(), QAbstractSocket::AddressInUseError);
}
PLATFORMSOCKETENGINE binder6;
@@ -599,11 +599,11 @@ void tst_PlatformSocketEngine::networkError()
const bool isConnected = client.connectToHost(QtNetworkSettings::serverIP(), 143);
if (!isConnected) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
// An unexpected network error!
#ifdef Q_OS_WINRT
@@ -636,7 +636,7 @@ void tst_PlatformSocketEngine::invalidSend()
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::writeDatagram() was"
" called by a socket other than QAbstractSocket::UdpSocket");
- QCOMPARE(socket.writeDatagram("hei", 3, QHostAddress::LocalHost, 143),
+ QCOMPARE(socket.writeDatagram("hei", 3, QIpPacketHeader(QHostAddress::LocalHost, 143)),
(qlonglong) -1);
}
@@ -650,19 +650,19 @@ void tst_PlatformSocketEngine::receiveUrgentData()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
PLATFORMSOCKETENGINE client;
QVERIFY(client.initialize(QAbstractSocket::TcpSocket));
if (!client.connectToHost(QHostAddress("127.0.0.1"), port)) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
int socketDescriptor = server.accept();
@@ -670,7 +670,7 @@ void tst_PlatformSocketEngine::receiveUrgentData()
PLATFORMSOCKETENGINE serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
char msg;
int available;
diff --git a/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp b/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
index 76c36831bd..1c79b6c016 100644
--- a/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
+++ b/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
@@ -37,11 +37,6 @@
#include <qcoreapplication.h>
#include <qdebug.h>
#include <qabstractsocket.h>
-#include <qtcpserver.h>
-#include <qtcpsocket.h>
-#ifndef QT_NO_SSL
-#include <qsslsocket.h>
-#endif
class tst_QAbstractSocket : public QObject
{
@@ -52,9 +47,7 @@ public:
virtual ~tst_QAbstractSocket();
private slots:
- void initTestCase();
void getSetCheck();
- void serverDisconnectWithBuffered();
};
tst_QAbstractSocket::tst_QAbstractSocket()
@@ -73,11 +66,6 @@ public:
void setPeerPort(quint16 port) { QAbstractSocket::setPeerPort(port); }
};
-void tst_QAbstractSocket::initTestCase()
-{
- qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
-}
-
// Testing get/set functions
void tst_QAbstractSocket::getSetCheck()
{
@@ -106,46 +94,5 @@ void tst_QAbstractSocket::getSetCheck()
QCOMPARE(quint16(0xffff), obj1.peerPort());
}
-// Test buffered socket being properly closed on remote disconnect
-void tst_QAbstractSocket::serverDisconnectWithBuffered()
-{
- QTcpServer tcpServer;
-#ifndef QT_NO_SSL
- QSslSocket testSocket;
-#else
- QTcpSocket testSocket;
-#endif
-
- QVERIFY(tcpServer.listen(QHostAddress::LocalHost));
- testSocket.connectToHost(tcpServer.serverAddress(), tcpServer.serverPort());
- // Accept connection on server side
- QVERIFY(tcpServer.waitForNewConnection(5000));
- QTcpSocket *newConnection = tcpServer.nextPendingConnection();
- // Send one char and drop link
- QVERIFY(newConnection != NULL);
- QVERIFY(newConnection->putChar(0));
- QVERIFY(newConnection->flush());
- delete newConnection;
-
- QVERIFY(testSocket.waitForConnected(5000)); // ready for write
- QVERIFY(testSocket.state() == QAbstractSocket::ConnectedState);
-
- QSignalSpy spyStateChanged(&testSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)));
- QSignalSpy spyDisconnected(&testSocket, SIGNAL(disconnected()));
-
- QVERIFY(testSocket.waitForReadyRead(5000)); // have one char already in internal buffer
- char buf[128];
- QCOMPARE(testSocket.read(buf, sizeof(buf)), Q_INT64_C(1));
- if (testSocket.state() != QAbstractSocket::UnconnectedState) {
- QVERIFY(testSocket.waitForDisconnected(5000));
- QVERIFY(testSocket.state() == QAbstractSocket::UnconnectedState);
- }
- // Test signal emitting
- QVERIFY(spyDisconnected.count() == 1);
- QVERIFY(spyStateChanged.count() > 0);
- QVERIFY(qvariant_cast<QAbstractSocket::SocketState>(spyStateChanged.last().first())
- == QAbstractSocket::UnconnectedState);
-}
-
QTEST_MAIN(tst_QAbstractSocket)
#include "tst_qabstractsocket.moc"
diff --git a/tests/auto/network/socket/qhttpsocketengine/BLACKLIST b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
new file mode 100644
index 0000000000..8e1a55995e
--- /dev/null
+++ b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
@@ -0,0 +1 @@
+windows
diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 10e8c95fc0..f6662b6712 100644
--- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -72,6 +72,7 @@ private slots:
void downloadBigFile();
// void tcpLoopbackPerformance();
void passwordAuth();
+ void ensureEofTriggersNotification();
protected slots:
void tcpSocketNonBlocking_hostFound();
@@ -164,18 +165,18 @@ void tst_QHttpSocketEngine::construction()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.isValid());
- QVERIFY(socketDevice.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(socketDevice.socketType() == QAbstractSocket::TcpSocket);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(socketDevice.socketType(), QAbstractSocket::TcpSocket);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
// QVERIFY(socketDevice.socketDescriptor() != -1);
- QVERIFY(socketDevice.localAddress() == QHostAddress());
- QVERIFY(socketDevice.localPort() == 0);
- QVERIFY(socketDevice.peerAddress() == QHostAddress());
- QVERIFY(socketDevice.peerPort() == 0);
- QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.localAddress(), QHostAddress());
+ QCOMPARE(socketDevice.localPort(), quint16(0));
+ QCOMPARE(socketDevice.peerAddress(), QHostAddress());
+ QCOMPARE(socketDevice.peerPort(), quint16(0));
+ QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == 0);
+ QCOMPARE(socketDevice.bytesAvailable(), 0);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());
@@ -299,15 +300,15 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
QVERIFY(!socketDevice.localAddress().isNull());
QVERIFY(socketDevice.localPort() > 0);
@@ -345,8 +346,8 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
char c;
QCOMPARE(socketDevice.read(&c, sizeof(c)), (qint64) -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//---------------------------------------------------------------------------
@@ -360,14 +361,14 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(30000)) {
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState ||
socketDevice.state() == QAbstractSocket::UnconnectedState);
} else {
- QVERIFY(socketDevice.error() == QAbstractSocket::SocketTimeoutError);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::SocketTimeoutError);
}
}
@@ -381,12 +382,12 @@ void tst_QHttpSocketEngine::tcpLoopbackPerformance()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
QHttpSocketEngine client;
@@ -408,7 +409,7 @@ void tst_QHttpSocketEngine::tcpLoopbackPerformance()
// socket descriptor from accept(). It's pre-connected.
QSocketLayer serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
const int messageSize = 1024 * 256;
QByteArray message1(messageSize, '@');
@@ -544,7 +545,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 8);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 8);
QTestEventLoop::instance().enterLoop(30);
@@ -569,7 +570,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 10);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 10);
// Wait for greeting
QTestEventLoop::instance().enterLoop(30);
@@ -637,7 +638,7 @@ void tst_QHttpSocketEngine::downloadBigFile()
QFAIL("Network operation timed out");
QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("Host: ") > 0);
QVERIFY(tmpSocket->write(hostName.data()) > 0);
@@ -659,7 +660,7 @@ void tst_QHttpSocketEngine::downloadBigFile()
QVERIFY(bytesAvailable >= 10000000);
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s",
bytesAvailable / (1024.0 * 1024.0),
@@ -689,15 +690,15 @@ void tst_QHttpSocketEngine::passwordAuth()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password"));
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -733,11 +734,57 @@ void tst_QHttpSocketEngine::passwordAuth()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//----------------------------------------------------------------------------------
+void tst_QHttpSocketEngine::ensureEofTriggersNotification()
+{
+ QList<QByteArray> serverData;
+ // Set the handshake and server response data
+ serverData << "HTTP/1.0 200 Connection established\r\n\r\n" << "0";
+ MiniHttpServer server(serverData);
+
+ QTcpSocket socket;
+ connect(&socket, SIGNAL(connected()), SLOT(exitLoopSlot()));
+ socket.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, server.serverAddress().toString(),
+ server.serverPort()));
+ socket.connectToHost("0.1.2.3", 12345);
+
+ QTestEventLoop::instance().enterLoop(5);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Connect timed out");
+
+ QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
+ // Disable read notification on server response
+ socket.setReadBufferSize(1);
+ socket.putChar(0);
+
+ // Wait for the response
+ connect(&socket, SIGNAL(readyRead()), SLOT(exitLoopSlot()));
+ QTestEventLoop::instance().enterLoop(5);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Read timed out");
+
+ QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
+ QCOMPARE(socket.bytesAvailable(), 1);
+ // Trigger a read notification
+ socket.readAll();
+ // Check for pending EOF at input
+ QCOMPARE(socket.bytesAvailable(), 0);
+ QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
+
+ // Try to read EOF
+ connect(&socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
+ QTestEventLoop::instance().enterLoop(5);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Disconnect timed out");
+
+ // Check that it's closed
+ QCOMPARE(socket.state(), QTcpSocket::UnconnectedState);
+}
+
QTEST_MAIN(tst_QHttpSocketEngine)
#include "tst_qhttpsocketengine.moc"
diff --git a/tests/auto/network/socket/qlocalsocket/BLACKLIST b/tests/auto/network/socket/qlocalsocket/BLACKLIST
new file mode 100644
index 0000000000..11ddef30a5
--- /dev/null
+++ b/tests/auto/network/socket/qlocalsocket/BLACKLIST
@@ -0,0 +1,2 @@
+[processConnection:1 client]
+windows
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 9130aff4e2..d7480a4109 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -247,8 +247,8 @@ void tst_QLocalSocket::socket_basic()
QCOMPARE(socket.serverName(), QString());
QCOMPARE(socket.fullServerName(), QString());
socket.abort();
- QVERIFY(socket.bytesAvailable() == 0);
- QVERIFY(socket.bytesToWrite() == 0);
+ QCOMPARE(socket.bytesAvailable(), 0);
+ QCOMPARE(socket.bytesToWrite(), 0);
QCOMPARE(socket.canReadLine(), false);
socket.close();
socket.disconnectFromServer();
@@ -256,7 +256,7 @@ void tst_QLocalSocket::socket_basic()
QVERIFY(!socket.errorString().isEmpty());
QCOMPARE(socket.flush(), false);
QCOMPARE(socket.isValid(), false);
- QVERIFY(socket.readBufferSize() == 0);
+ QCOMPARE(socket.readBufferSize(), 0);
socket.setReadBufferSize(0);
//QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.state(), QLocalSocket::UnconnectedState);
@@ -376,13 +376,13 @@ void tst_QLocalSocket::listenAndConnect()
QVERIFY(!socket->errorString().isEmpty());
QVERIFY(socket->error() != QLocalSocket::UnknownSocketError);
QCOMPARE(socket->state(), QLocalSocket::UnconnectedState);
- //QVERIFY(socket->socketDescriptor() == -1);
+ //QCOMPARE(socket->socketDescriptor(), -1);
QCOMPARE(qvariant_cast<QLocalSocket::LocalSocketError>(spyError.first()[0]),
QLocalSocket::ServerNotFoundError);
}
- QVERIFY(socket->bytesAvailable() == 0);
- QVERIFY(socket->bytesToWrite() == 0);
+ QCOMPARE(socket->bytesAvailable(), 0);
+ QCOMPARE(socket->bytesToWrite(), 0);
QCOMPARE(socket->canReadLine(), false);
QCOMPARE(socket->flush(), false);
QCOMPARE(socket->isValid(), canListen);
@@ -433,7 +433,7 @@ void tst_QLocalSocket::listenAndConnect()
} else {
QVERIFY(server.serverName().isEmpty());
QVERIFY(server.fullServerName().isEmpty());
- QVERIFY(server.nextPendingConnection() == (QLocalSocket*)0);
+ QCOMPARE(server.nextPendingConnection(), (QLocalSocket*)0);
QCOMPARE(spyNewConnection.count(), 0);
QCOMPARE(server.hits.count(), 0);
QVERIFY(!server.errorString().isEmpty());
@@ -617,7 +617,7 @@ void tst_QLocalSocket::readBufferOverflow()
QVERIFY(client.waitForReadyRead());
QCOMPARE(client.read(buffer, readBufferSize), qint64(readBufferSize));
// no more bytes available
- QVERIFY(client.bytesAvailable() == 0);
+ QCOMPARE(client.bytesAvailable(), 0);
}
// QLocalSocket/Server can take a name or path, check that it works as expected
@@ -732,7 +732,10 @@ public:
int done = clients;
while (done > 0) {
bool timedOut = true;
- QVERIFY(server.waitForNewConnection(7000, &timedOut));
+ QVERIFY2(server.waitForNewConnection(7000, &timedOut),
+ (QByteArrayLiteral("done=") + QByteArray::number(done)
+ + QByteArrayLiteral(", timedOut=")
+ + (timedOut ? "true" : "false")).constData());
QVERIFY(!timedOut);
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
@@ -913,7 +916,7 @@ void tst_QLocalSocket::waitForDisconnectByServer()
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
serverSocket->close();
- QVERIFY(serverSocket->state() == QLocalSocket::UnconnectedState);
+ QCOMPARE(serverSocket->state(), QLocalSocket::UnconnectedState);
QVERIFY(socket.waitForDisconnected(3000));
QCOMPARE(spy.count(), 1);
}
@@ -1226,11 +1229,12 @@ void tst_QLocalSocket::verifyListenWithDescriptor()
QVERIFY2(server.listen(listenSocket), "failed to start create QLocalServer with local socket");
#ifdef Q_OS_LINUX
+ const QChar at(QLatin1Char('@'));
if (!bound) {
- QVERIFY(server.serverName().at(0) == QLatin1Char('@'));
- QVERIFY(server.fullServerName().at(0) == QLatin1Char('@'));
+ QCOMPARE(server.serverName().at(0), at);
+ QCOMPARE(server.fullServerName().at(0), at);
} else if (abstract) {
- QVERIFY2(server.fullServerName().at(0) == QLatin1Char('@'), "abstract sockets should start with a '@'");
+ QVERIFY2(server.fullServerName().at(0) == at, "abstract sockets should start with a '@'");
} else {
QCOMPARE(server.fullServerName(), path);
if (path.contains(QLatin1String("/"))) {
diff --git a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
index bf4afa8c45..2a32a326d0 100644
--- a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
+++ b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
@@ -2,3 +2,5 @@
*
[passwordAuth]
*
+[serverTest]
+windows
diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
index 0ae9887773..8da656aab7 100644
--- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -193,18 +193,18 @@ void tst_QSocks5SocketEngine::construction()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.isValid());
- QVERIFY(socketDevice.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(socketDevice.socketType() == QAbstractSocket::TcpSocket);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(socketDevice.socketType(), QAbstractSocket::TcpSocket);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
// QVERIFY(socketDevice.socketDescriptor() != -1);
- QVERIFY(socketDevice.localAddress() == QHostAddress());
- QVERIFY(socketDevice.localPort() == 0);
- QVERIFY(socketDevice.peerAddress() == QHostAddress());
- QVERIFY(socketDevice.peerPort() == 0);
- QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.localAddress(), QHostAddress());
+ QCOMPARE(socketDevice.localPort(), quint16(0));
+ QCOMPARE(socketDevice.peerAddress(), QHostAddress());
+ QCOMPARE(socketDevice.peerPort(), quint16(0));
+ QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == 0);
+ QCOMPARE(socketDevice.bytesAvailable(), 0);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());
@@ -334,15 +334,15 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -377,8 +377,8 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//---------------------------------------------------------------------------
@@ -392,14 +392,14 @@ void tst_QSocks5SocketEngine::simpleErrorsAndStates()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(!socketDevice.connectToHost(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first(), 8088));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(15000)) {
QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState ||
socketDevice.state() == QAbstractSocket::ConnectedState);
} else {
- QVERIFY(socketDevice.error() == QAbstractSocket::SocketTimeoutError);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::SocketTimeoutError);
}
}
@@ -413,12 +413,12 @@ void tst_QSocks5SocketEngine::tcpLoopbackPerformance()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
QSocks5SocketEngine client;
@@ -440,7 +440,7 @@ void tst_QSocks5SocketEngine::tcpLoopbackPerformance()
// socket descriptor from accept(). It's pre-connected.
QSocketLayer serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
const int messageSize = 1024 * 256;
QByteArray message1(messageSize, '@');
@@ -482,11 +482,11 @@ void tst_QSocks5SocketEngine::serverTest()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
QSocks5SocketEngine client;
@@ -501,7 +501,7 @@ void tst_QSocks5SocketEngine::serverTest()
if (!client.connectToHost(server.localAddress(), server.localPort())) {
QVERIFY(client.waitForWrite());
// QTest::wait(100); // ### timing problem on win32
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
//QTest::wait(100);
}
@@ -516,14 +516,14 @@ void tst_QSocks5SocketEngine::serverTest()
QSocks5SocketEngine serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
- QVERIFY(serverSocket.localAddress() == client.peerAddress());
- QVERIFY(serverSocket.localPort() == client.peerPort());
+ QCOMPARE(serverSocket.localAddress(), client.peerAddress());
+ QCOMPARE(serverSocket.localPort(), client.peerPort());
// this seems depends on the socks server implementation, especially
// when connecting /to/ the socks server /through/ the same socks server
- //QVERIFY(serverSocket.peerAddress() == client.localAddress());
- //QVERIFY(serverSocket.peerPort() == client.localPort());
+ //QCOMPARE(serverSocket.peerAddress(), client.localAddress());
+ //QCOMPARE(serverSocket.peerPort(), client.localPort());
// The server socket sends a greeting to the client
QByteArray greeting = "Greetings!";
@@ -557,16 +557,16 @@ void tst_QSocks5SocketEngine::udpTest()
udpSocket.setProxy(proxy);
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(udpSocket.socketType() == QAbstractSocket::UdpSocket);
- QVERIFY(udpSocket.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(udpSocket.socketType(), QAbstractSocket::UdpSocket);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::UnconnectedState);
// Bind #1
bool bindSuccessful = udpSocket.bind(QHostAddress("0.0.0.0"), 0);
if (!bindSuccessful)
QEXPECT_FAIL("", "QTBUG-23380 / QTBUG-35490: Fails on some Ubuntu 11.10 x64 configurations and on new network test server", Abort);
QVERIFY(bindSuccessful);
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
QVERIFY(udpSocket.localPort() != 0);
// Initialize device #2
@@ -577,7 +577,7 @@ void tst_QSocks5SocketEngine::udpTest()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(udpSocket.localAddress(), udpSocket.localPort()));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
// Write a message to #1
QByteArray message1 = "hei der";
@@ -591,13 +591,13 @@ void tst_QSocks5SocketEngine::udpTest()
QVERIFY(available > 0);
QByteArray answer;
answer.resize(available);
- QHostAddress senderAddress;
- quint16 senderPort = 0;
- QVERIFY(udpSocket.readDatagram(answer.data(), answer.size(),
- &senderAddress,
- &senderPort) == message1.size());
- QVERIFY(senderAddress == udpSocket2.localAddress());
- QVERIFY(senderPort == udpSocket2.localPort());
+ QIpPacketHeader header;
+ QCOMPARE(udpSocket.readDatagram(answer.data(), answer.size(),
+ &header, QAbstractSocketEngine::WantDatagramSender),
+ qint64(message1.size()));
+ QVERIFY(header.senderAddress == udpSocket2.localAddress());
+ QCOMPARE(header.senderAddress, udpSocket2.localAddress());
+ QCOMPARE(header.senderPort, udpSocket2.localPort());
}
void tst_QSocks5SocketEngine::tcpSocketBlockingTest()
@@ -705,7 +705,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 8);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 8);
QTestEventLoop::instance().enterLoop(30);
@@ -729,7 +729,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 10);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 10);
// Wait for greeting
QTestEventLoop::instance().enterLoop(30);
@@ -797,7 +797,7 @@ void tst_QSocks5SocketEngine::downloadBigFile()
QFAIL("Network operation timed out");
QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("HOST: ") > 0);
QVERIFY(tmpSocket->write(hostName.data()) > 0);
@@ -819,7 +819,7 @@ void tst_QSocks5SocketEngine::downloadBigFile()
QCOMPARE(bytesAvailable, qint64(10000000));
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
/*qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s",
bytesAvailable / (1024.0 * 1024.0),
@@ -852,19 +852,19 @@ void tst_QSocks5SocketEngine::passwordAuth()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080, "qsockstest", "password"));
// Connect to imap.trolltech.com's IP
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
if (!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)) {
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
}
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -899,8 +899,8 @@ void tst_QSocks5SocketEngine::passwordAuth()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//----------------------------------------------------------------------------------
@@ -918,21 +918,21 @@ void tst_QSocks5SocketEngine::passwordAuth2()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081));
socketDevice.setReceiver(this);
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
while (socketDevice.state() == QAbstractSocket::ConnectingState) {
QVERIFY(socketDevice.waitForWrite());
socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
}
if (socketDevice.state() != QAbstractSocket::ConnectedState)
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -967,8 +967,8 @@ void tst_QSocks5SocketEngine::passwordAuth2()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
void tst_QSocks5SocketEngine::fragmentation_data()
@@ -1017,7 +1017,7 @@ void tst_QSocks5SocketEngine::fragmentation()
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(socket.localAddress() == QHostAddress("1.2.3.4") || socket.localAddress() == QHostAddress("0123:4567:89ab:cdef:0123:4567:89ab:cdef"));
- QVERIFY(socket.localPort() == 0x0506);
+ QCOMPARE(socket.localPort(), quint16(0x0506));
}
void tst_QSocks5SocketEngine::incomplete_data()
diff --git a/tests/auto/network/socket/qtcpserver/BLACKLIST b/tests/auto/network/socket/qtcpserver/BLACKLIST
new file mode 100644
index 0000000000..f8b61808cc
--- /dev/null
+++ b/tests/auto/network/socket/qtcpserver/BLACKLIST
@@ -0,0 +1,13 @@
+windows
+[linkLocal]
+linux
+[listenWhileListening:WithSocks5Proxy]
+linux
+windows
+[ipv6Server:WithoutProxy]
+windows
+osx
+[clientServerLoop:WithSocks5Proxy]
+linux
+[crashTests:WithSocks5Proxy]
+linux
diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
index e0a6e3699d..5df5432cdd 100644
--- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -265,11 +265,11 @@ void tst_QTcpServer::ipv6Server()
//### need to enter the event loop for the server to get the connection ?? ( windows)
QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 8944)) {
- QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError);
+ QCOMPARE(server.serverError(), QAbstractSocket::UnsupportedSocketOperationError);
return;
}
- QVERIFY(server.serverPort() == 8944);
+ QCOMPARE(server.serverPort(), quint16(8944));
QVERIFY(server.serverAddress() == QHostAddress::LocalHostIPv6);
QTcpSocket client;
@@ -835,17 +835,17 @@ void tst_QTcpServer::qtbug14268_peek()
client.write("abc\n");
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(helper.lastDataPeeked == QByteArray("6162630a"));
+ QCOMPARE(helper.lastDataPeeked, QByteArray("6162630a"));
client.write("def\n");
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a"));
+ QCOMPARE(helper.lastDataPeeked, QByteArray("6162630a6465660a"));
client.write("ghi\n");
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a6768690a"));
+ QCOMPARE(helper.lastDataPeeked, QByteArray("6162630a6465660a6768690a"));
}
void tst_QTcpServer::serverAddress_data()
diff --git a/tests/auto/network/socket/qtcpsocket/test/test.pro b/tests/auto/network/socket/qtcpsocket/test/test.pro
index 3e64b87b53..325abcaab8 100644
--- a/tests/auto/network/socket/qtcpsocket/test/test.pro
+++ b/tests/auto/network/socket/qtcpsocket/test/test.pro
@@ -21,3 +21,5 @@ win32 {
} else {
DESTDIR = ../
}
+
+win32: CONFIG += insignificant_test # Hangs in release builds
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index e8a942e6c4..cde453c191 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -200,6 +200,7 @@ private slots:
void setSocketOption();
void clientSendDataOnDelayedDisconnect();
+ void serverDisconnectWithBuffered();
void readNotificationsAfterBind();
protected slots:
@@ -242,7 +243,6 @@ private:
mutable int proxyAuthCalled;
- int numConnections;
static int loopLevel;
SocketPair *earlyConstructedSockets;
@@ -484,9 +484,9 @@ void tst_QTcpSocket::constructing()
QCOMPARE(socket->readLine(), QByteArray());
QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE((int) socket->localPort(), 0);
- QVERIFY(socket->localAddress() == QHostAddress());
+ QCOMPARE(socket->localAddress(), QHostAddress());
QCOMPARE((int) socket->peerPort(), 0);
- QVERIFY(socket->peerAddress() == QHostAddress());
+ QCOMPARE(socket->peerAddress(), QHostAddress());
QCOMPARE(socket->error(), QTcpSocket::UnknownSocketError);
QCOMPARE(socket->errorString(), QString("Unknown error"));
@@ -756,7 +756,7 @@ void tst_QTcpSocket::socketDescriptor()
QVERIFY(socket->state() == QAbstractSocket::HostLookupState ||
socket->state() == QAbstractSocket::ConnectingState);
QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::ConnectedState);
QVERIFY(socket->socketDescriptor() != -1);
delete socket;
@@ -937,7 +937,7 @@ void tst_QTcpSocket::nonBlockingIMAP()
QFAIL("Timed out");
}
- QVERIFY(nonBlockingIMAP_totalWritten == 8);
+ QCOMPARE(nonBlockingIMAP_totalWritten, 8);
enterLoop(30);
@@ -962,7 +962,7 @@ void tst_QTcpSocket::nonBlockingIMAP()
QFAIL("Timed out");
}
- QVERIFY(nonBlockingIMAP_totalWritten == 10);
+ QCOMPARE(nonBlockingIMAP_totalWritten, 10);
// Wait for greeting
enterLoop(30);
@@ -1087,7 +1087,7 @@ void tst_QTcpSocket::partialRead()
QTcpSocket *socket = newSocket();
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
char buf[512];
QByteArray greeting = expectedReplyIMAP();
@@ -1111,7 +1111,7 @@ void tst_QTcpSocket::unget()
QTcpSocket *socket = newSocket();
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
char buf[512];
QByteArray greeting = expectedReplyIMAP();
@@ -1169,7 +1169,7 @@ void tst_QTcpSocket::openCloseOpenClose()
QCOMPARE(int(socket->openMode()), int(QIODevice::NotOpen));
QVERIFY(socket->isSequential());
QVERIFY(!socket->isOpen());
- QVERIFY(socket->socketType() == QTcpSocket::TcpSocket);
+ QCOMPARE(socket->socketType(), QTcpSocket::TcpSocket);
char c;
QCOMPARE(socket->getChar(&c), false);
@@ -1178,13 +1178,13 @@ void tst_QTcpSocket::openCloseOpenClose()
QCOMPARE(socket->readLine(), QByteArray());
QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE((int) socket->localPort(), 0);
- QVERIFY(socket->localAddress() == QHostAddress());
+ QCOMPARE(socket->localAddress(), QHostAddress());
QCOMPARE((int) socket->peerPort(), 0);
- QVERIFY(socket->peerAddress() == QHostAddress());
+ QCOMPARE(socket->peerAddress(), QHostAddress());
QCOMPARE(socket->error(), QTcpSocket::UnknownSocketError);
QCOMPARE(socket->errorString(), QString("Unknown error"));
- QVERIFY(socket->state() == QTcpSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForConnected(10000));
@@ -1201,7 +1201,7 @@ void tst_QTcpSocket::connectDisconnectConnectDisconnect()
for (int i = 0; i < 3; ++i) {
QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
- QVERIFY(socket->socketType() == QTcpSocket::TcpSocket);
+ QCOMPARE(socket->socketType(), QTcpSocket::TcpSocket);
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForReadyRead(10000));
@@ -1261,7 +1261,7 @@ void tst_QTcpSocket::disconnectWhileConnecting()
connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
enterLoop(10);
QVERIFY2(!timeout(), "Network timeout");
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite));
socket->close();
@@ -1273,7 +1273,7 @@ void tst_QTcpSocket::disconnectWhileConnecting()
QTcpSocket *othersocket = server.nextPendingConnection();
if (othersocket->state() != QAbstractSocket::UnconnectedState)
QVERIFY2(othersocket->waitForDisconnected(10000), "Network timeout");
- QVERIFY(othersocket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(othersocket->state(), QAbstractSocket::UnconnectedState);
QCOMPARE(othersocket->readAll(), data);
delete socket;
@@ -1376,7 +1376,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop()
}
QVERIFY2(socket->waitForDisconnected(10000), "Network timeout");
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite));
socket->close();
@@ -1415,10 +1415,10 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
QFETCH(bool, doClose);
if (doClose) {
socket->close();
- QVERIFY(socket->openMode() == QIODevice::NotOpen);
+ QCOMPARE(socket->openMode(), QIODevice::NotOpen);
} else {
socket->disconnectFromHost();
- QVERIFY(socket->openMode() == QIODevice::ReadWrite);
+ QCOMPARE(socket->openMode(), QIODevice::ReadWrite);
QVERIFY(socket->waitForDisconnected(5000));
}
@@ -1429,12 +1429,12 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
// recheck
if (doClose) {
- QVERIFY(socket->openMode() == QIODevice::NotOpen);
+ QCOMPARE(socket->openMode(), QIODevice::NotOpen);
} else {
- QVERIFY(socket->openMode() == QIODevice::ReadWrite);
+ QCOMPARE(socket->openMode(), QIODevice::ReadWrite);
}
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
}
//----------------------------------------------------------------------------------
@@ -1458,7 +1458,7 @@ void tst_QTcpSocket::downloadBigFile()
}
QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("HOST: ") > 0);
QVERIFY(tmpSocket->write(hostName.data()) > 0);
@@ -1831,7 +1831,6 @@ private slots:
}
#endif // !QT_NO_NETWORKPROXY
private:
- int exitCode;
QTcpSocket *socket;
QByteArray socketData;
};
@@ -2687,12 +2686,12 @@ void tst_QTcpSocket::taskQtBug7054TimeoutErrorResetting()
socket->connectToHost(QtNetworkSettings::serverName(), 443);
QVERIFY(socket->waitForConnected(5*1000));
- QVERIFY(socket->error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socket->error(), QAbstractSocket::UnknownSocketError);
// We connected to the HTTPS port. Wait two seconds to receive data. We will receive
// nothing because we would need to start the SSL handshake
QVERIFY(!socket->waitForReadyRead(2*1000));
- QVERIFY(socket->error() == QAbstractSocket::SocketTimeoutError);
+ QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError);
// Now write some crap to make the server disconnect us. 4 lines are enough.
socket->write("a\r\nb\r\nc\r\nd\r\n");
@@ -2702,7 +2701,7 @@ void tst_QTcpSocket::taskQtBug7054TimeoutErrorResetting()
// should get a better error since the server disconnected us
QVERIFY(!socket->waitForReadyRead(2*1000));
// It must NOT be the SocketTimeoutError that had been set before
- QVERIFY(socket->error() == QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socket->error(), QAbstractSocket::RemoteHostClosedError);
}
#ifndef QT_NO_NETWORKPROXY
@@ -2896,25 +2895,25 @@ void tst_QTcpSocket::qtbug14268_peek()
QTcpSocket *outgoing = socketPair.endPoints[0];
QTcpSocket *incoming = socketPair.endPoints[1];
- QVERIFY(incoming->state() == QTcpSocket::ConnectedState);
- QVERIFY(outgoing->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(incoming->state(), QTcpSocket::ConnectedState);
+ QCOMPARE(outgoing->state(), QTcpSocket::ConnectedState);
outgoing->write("abc\n");
QVERIFY(outgoing->waitForBytesWritten(2000));
QVERIFY(incoming->waitForReadyRead(2000));
- QVERIFY(incoming->peek(128*1024) == QByteArray("abc\n"));
+ QCOMPARE(incoming->peek(128*1024), QByteArray("abc\n"));
outgoing->write("def\n");
QVERIFY(outgoing->waitForBytesWritten(2000));
QVERIFY(incoming->waitForReadyRead(2000));
- QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\n"));
+ QCOMPARE(incoming->peek(128*1024), QByteArray("abc\ndef\n"));
outgoing->write("ghi\n");
QVERIFY(outgoing->waitForBytesWritten(2000));
QVERIFY(incoming->waitForReadyRead(2000));
- QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\nghi\n"));
+ QCOMPARE(incoming->peek(128*1024), QByteArray("abc\ndef\nghi\n"));
- QVERIFY(incoming->read(128*1024) == QByteArray("abc\ndef\nghi\n"));
+ QCOMPARE(incoming->read(128*1024), QByteArray("abc\ndef\nghi\n"));
}
void tst_QTcpSocket::setSocketOption()
@@ -2928,8 +2927,8 @@ void tst_QTcpSocket::setSocketOption()
QTcpSocket *outgoing = socketPair.endPoints[0];
QTcpSocket *incoming = socketPair.endPoints[1];
- QVERIFY(incoming->state() == QTcpSocket::ConnectedState);
- QVERIFY(outgoing->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(incoming->state(), QTcpSocket::ConnectedState);
+ QCOMPARE(outgoing->state(), QTcpSocket::ConnectedState);
outgoing->setSocketOption(QAbstractSocket::LowDelayOption, true);
QVariant v = outgoing->socketOption(QAbstractSocket::LowDelayOption);
@@ -2985,6 +2984,51 @@ void tst_QTcpSocket::clientSendDataOnDelayedDisconnect()
delete socket;
}
+// Test buffered socket being properly closed on remote disconnect
+void tst_QTcpSocket::serverDisconnectWithBuffered()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
+
+ QTcpServer tcpServer;
+ QTcpSocket *socket = newSocket();
+
+ QVERIFY(tcpServer.listen(QHostAddress::LocalHost));
+ socket->connectToHost(tcpServer.serverAddress(), tcpServer.serverPort());
+ // Accept connection on server side
+ QVERIFY(tcpServer.waitForNewConnection(5000));
+ QTcpSocket *newConnection = tcpServer.nextPendingConnection();
+ // Send one char and drop link
+ QVERIFY(newConnection != NULL);
+ QVERIFY(newConnection->putChar(0));
+ QVERIFY(newConnection->flush());
+ delete newConnection;
+
+ QVERIFY(socket->waitForConnected(5000)); // ready for write
+ QCOMPARE(socket->state(), QAbstractSocket::ConnectedState);
+
+ QSignalSpy spyStateChanged(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)));
+ QSignalSpy spyDisconnected(socket, SIGNAL(disconnected()));
+
+ QVERIFY(socket->waitForReadyRead(5000)); // have one char already in internal buffer
+ char buf[128];
+ QCOMPARE(socket->read(buf, sizeof(buf)), Q_INT64_C(1));
+ if (socket->state() != QAbstractSocket::UnconnectedState) {
+ QVERIFY(socket->waitForDisconnected(5000));
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
+ }
+ // Test signal emitting
+ QCOMPARE(spyDisconnected.count(), 1);
+ QVERIFY(spyStateChanged.count() > 0);
+ QVERIFY(qvariant_cast<QAbstractSocket::SocketState>(spyStateChanged.last().first())
+ == QAbstractSocket::UnconnectedState);
+
+ delete socket;
+}
+
// Test that the socket does not enable the read notifications in bind()
void tst_QTcpSocket::readNotificationsAfterBind()
{
diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST
new file mode 100644
index 0000000000..3e936aebf6
--- /dev/null
+++ b/tests/auto/network/socket/qudpsocket/BLACKLIST
@@ -0,0 +1,8 @@
+[multicast:same bind, group ipv6 address]
+*
+[multicast:valid bind, group ipv6 address]
+osx
+[multicast:dual bind, group ipv6 address]
+osx
+[multicast:same bind, group ipv4 address]
+osx
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 6f96e6d6f5..0ee3255502 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -56,7 +56,6 @@
#endif
Q_DECLARE_METATYPE(QHostAddress)
-Q_DECLARE_METATYPE(QNetworkInterface)
QT_FORWARD_DECLARE_CLASS(QUdpSocket)
@@ -228,7 +227,7 @@ void tst_QUdpSocket::constructing()
QVERIFY(socket.isSequential());
QVERIFY(!socket.isOpen());
- QVERIFY(socket.socketType() == QUdpSocket::UdpSocket);
+ QCOMPARE(socket.socketType(), QUdpSocket::UdpSocket);
QCOMPARE((int) socket.bytesAvailable(), 0);
QCOMPARE(socket.canReadLine(), false);
QCOMPARE(socket.readLine(), QByteArray());
@@ -754,7 +753,7 @@ void tst_QUdpSocket::writeDatagram()
QCOMPARE(client.error(), QUdpSocket::DatagramTooLargeError);
break;
}
- QVERIFY(bytesspy.count() == 1);
+ QCOMPARE(bytesspy.count(), 1);
QCOMPARE(*static_cast<const qint64 *>(bytesspy.at(0).at(0).constData()),
qint64(i * 1024));
QCOMPARE(errorspy.count(), 0);
diff --git a/tests/auto/network/ssl/qsslcertificate/BLACKLIST b/tests/auto/network/ssl/qsslcertificate/BLACKLIST
new file mode 100644
index 0000000000..25509a5ca8
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/BLACKLIST
@@ -0,0 +1,3 @@
+# OpenSSL version is too new. Rich will fix :)
+[subjectAndIssuerAttributes]
+*
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index 748c240f3d..4c288fffaf 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -775,7 +775,7 @@ void tst_QSslCertificate::certInfo()
QVERIFY(cert.expiryDate() < QDateTime::currentDateTime()); // cert has expired
QSslCertificate copy = cert;
- QVERIFY(cert == copy);
+ QCOMPARE(cert, copy);
QVERIFY(!(cert != copy));
QCOMPARE(cert, QSslCertificate(pem, QSsl::Pem));
@@ -833,6 +833,9 @@ void tst_QSslCertificate::task256066toPem()
void tst_QSslCertificate::nulInCN()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Generic QSslCertificatePrivate fails this test");
+#endif
QList<QSslCertificate> certList =
QSslCertificate::fromPath(testDataDir + "/more-certificates/badguy-nul-cn.crt");
QCOMPARE(certList.size(), 1);
@@ -849,6 +852,9 @@ void tst_QSslCertificate::nulInCN()
void tst_QSslCertificate::nulInSan()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Generic QSslCertificatePrivate fails this test");
+#endif
QList<QSslCertificate> certList =
QSslCertificate::fromPath(testDataDir + "/more-certificates/badguy-nul-san.crt");
QCOMPARE(certList.size(), 1);
@@ -976,6 +982,9 @@ void tst_QSslCertificate::subjectAndIssuerAttributes()
void tst_QSslCertificate::verify()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Not implemented in SecureTransport");
+#endif
QList<QSslError> errors;
QList<QSslCertificate> toVerify;
@@ -1069,7 +1078,7 @@ void tst_QSslCertificate::extensions()
QSslCertificate cert = certList[0];
QList<QSslCertificateExtension> extensions = cert.extensions();
- QVERIFY(extensions.count() == 9);
+ QCOMPARE(extensions.count(), 9);
int unknown_idx = -1;
int authority_info_idx = -1;
@@ -1101,8 +1110,8 @@ void tst_QSslCertificate::extensions()
// Unknown
QSslCertificateExtension unknown = extensions[unknown_idx];
- QVERIFY(unknown.oid() == QStringLiteral("1.3.6.1.5.5.7.1.12"));
- QVERIFY(unknown.name() == QStringLiteral("1.3.6.1.5.5.7.1.12"));
+ QCOMPARE(unknown.oid(), QStringLiteral("1.3.6.1.5.5.7.1.12"));
+ QCOMPARE(unknown.name(), QStringLiteral("1.3.6.1.5.5.7.1.12"));
QVERIFY(!unknown.isCritical());
QVERIFY(!unknown.isSupported());
@@ -1114,8 +1123,8 @@ void tst_QSslCertificate::extensions()
// Authority Info Access
QSslCertificateExtension aia = extensions[authority_info_idx];
- QVERIFY(aia.oid() == QStringLiteral("1.3.6.1.5.5.7.1.1"));
- QVERIFY(aia.name() == QStringLiteral("authorityInfoAccess"));
+ QCOMPARE(aia.oid(), QStringLiteral("1.3.6.1.5.5.7.1.1"));
+ QCOMPARE(aia.name(), QStringLiteral("authorityInfoAccess"));
QVERIFY(!aia.isCritical());
QVERIFY(aia.isSupported());
@@ -1124,32 +1133,32 @@ void tst_QSslCertificate::extensions()
QString ocsp = aiaValue[QStringLiteral("OCSP")].toString();
QString caIssuers = aiaValue[QStringLiteral("caIssuers")].toString();
- QVERIFY(ocsp == QStringLiteral("http://EVIntl-ocsp.verisign.com"));
- QVERIFY(caIssuers == QStringLiteral("http://EVIntl-aia.verisign.com/EVIntl2006.cer"));
+ QCOMPARE(ocsp, QStringLiteral("http://EVIntl-ocsp.verisign.com"));
+ QCOMPARE(caIssuers, QStringLiteral("http://EVIntl-aia.verisign.com/EVIntl2006.cer"));
// Basic constraints
QSslCertificateExtension basic = extensions[basic_constraints_idx];
- QVERIFY(basic.oid() == QStringLiteral("2.5.29.19"));
- QVERIFY(basic.name() == QStringLiteral("basicConstraints"));
+ QCOMPARE(basic.oid(), QStringLiteral("2.5.29.19"));
+ QCOMPARE(basic.name(), QStringLiteral("basicConstraints"));
QVERIFY(!basic.isCritical());
QVERIFY(basic.isSupported());
QVariantMap basicValue = basic.value().toMap();
QCOMPARE(basicValue.keys(), QList<QString>() << QStringLiteral("ca"));
- QVERIFY(basicValue[QStringLiteral("ca")].toBool() == false);
+ QVERIFY(!basicValue[QStringLiteral("ca")].toBool());
// Subject key identifier
QSslCertificateExtension subjectKey = extensions[subject_key_idx];
- QVERIFY(subjectKey.oid() == QStringLiteral("2.5.29.14"));
- QVERIFY(subjectKey.name() == QStringLiteral("subjectKeyIdentifier"));
+ QCOMPARE(subjectKey.oid(), QStringLiteral("2.5.29.14"));
+ QCOMPARE(subjectKey.name(), QStringLiteral("subjectKeyIdentifier"));
QVERIFY(!subjectKey.isCritical());
QVERIFY(subjectKey.isSupported());
- QVERIFY(subjectKey.value().toString() == QStringLiteral("5F:90:23:CD:24:CA:52:C9:36:29:F0:7E:9D:B1:FE:08:E0:EE:69:F0"));
+ QCOMPARE(subjectKey.value().toString(), QStringLiteral("5F:90:23:CD:24:CA:52:C9:36:29:F0:7E:9D:B1:FE:08:E0:EE:69:F0"));
// Authority key identifier
QSslCertificateExtension authKey = extensions[auth_key_idx];
- QVERIFY(authKey.oid() == QStringLiteral("2.5.29.35"));
- QVERIFY(authKey.name() == QStringLiteral("authorityKeyIdentifier"));
+ QCOMPARE(authKey.oid(), QStringLiteral("2.5.29.35"));
+ QCOMPARE(authKey.name(), QStringLiteral("authorityKeyIdentifier"));
QVERIFY(!authKey.isCritical());
QVERIFY(authKey.isSupported());
@@ -1167,7 +1176,7 @@ void tst_QSslCertificate::extensionsCritical()
QSslCertificate cert = certList[0];
QList<QSslCertificateExtension> extensions = cert.extensions();
- QVERIFY(extensions.count() == 9);
+ QCOMPARE(extensions.count(), 9);
int basic_constraints_idx = -1;
int key_usage_idx = -1;
@@ -1186,19 +1195,19 @@ void tst_QSslCertificate::extensionsCritical()
// Basic constraints
QSslCertificateExtension basic = extensions[basic_constraints_idx];
- QVERIFY(basic.oid() == QStringLiteral("2.5.29.19"));
- QVERIFY(basic.name() == QStringLiteral("basicConstraints"));
+ QCOMPARE(basic.oid(), QStringLiteral("2.5.29.19"));
+ QCOMPARE(basic.name(), QStringLiteral("basicConstraints"));
QVERIFY(basic.isCritical());
QVERIFY(basic.isSupported());
QVariantMap basicValue = basic.value().toMap();
QCOMPARE(basicValue.keys(), QList<QString>() << QStringLiteral("ca"));
- QVERIFY(basicValue[QStringLiteral("ca")].toBool() == false);
+ QVERIFY(!basicValue[QStringLiteral("ca")].toBool());
// Key Usage
QSslCertificateExtension keyUsage = extensions[key_usage_idx];
- QVERIFY(keyUsage.oid() == QStringLiteral("2.5.29.15"));
- QVERIFY(keyUsage.name() == QStringLiteral("keyUsage"));
+ QCOMPARE(keyUsage.oid(), QStringLiteral("2.5.29.15"));
+ QCOMPARE(keyUsage.name(), QStringLiteral("keyUsage"));
QVERIFY(keyUsage.isCritical());
QVERIFY(!keyUsage.isSupported());
}
@@ -1257,21 +1266,21 @@ void tst_QSslCertificate::threadSafeConstMethods()
t2.start();
QVERIFY(t1.wait(5000));
QVERIFY(t2.wait(5000));
- QVERIFY(t1.cert == t2.cert);
- QVERIFY(t1.effectiveDate == t2.effectiveDate);
- QVERIFY(t1.expiryDate == t2.expiryDate);
+ QCOMPARE(t1.cert, t2.cert);
+ QCOMPARE(t1.effectiveDate, t2.effectiveDate);
+ QCOMPARE(t1.expiryDate, t2.expiryDate);
//QVERIFY(t1.extensions == t2.extensions); // no equality operator, so not tested
- QVERIFY(t1.isBlacklisted == t2.isBlacklisted);
- QVERIFY(t1.issuerInfo == t2.issuerInfo);
- QVERIFY(t1.issuerInfoAttributes == t2.issuerInfoAttributes);
- QVERIFY(t1.publicKey == t2.publicKey);
- QVERIFY(t1.serialNumber == t2.serialNumber);
- QVERIFY(t1.subjectInfo == t2.subjectInfo);
- QVERIFY(t1.subjectInfoAttributes == t2.subjectInfoAttributes);
- QVERIFY(t1.toDer == t2.toDer);
- QVERIFY(t1.toPem == t2.toPem);
- QVERIFY(t1.toText == t2.toText);
- QVERIFY(t1.version == t2.version);
+ QCOMPARE(t1.isBlacklisted, t2.isBlacklisted);
+ QCOMPARE(t1.issuerInfo, t2.issuerInfo);
+ QCOMPARE(t1.issuerInfoAttributes, t2.issuerInfoAttributes);
+ QCOMPARE(t1.publicKey, t2.publicKey);
+ QCOMPARE(t1.serialNumber, t2.serialNumber);
+ QCOMPARE(t1.subjectInfo, t2.subjectInfo);
+ QCOMPARE(t1.subjectInfoAttributes, t2.subjectInfoAttributes);
+ QCOMPARE(t1.toDer, t2.toDer);
+ QCOMPARE(t1.toPem, t2.toPem);
+ QCOMPARE(t1.toText, t2.toText);
+ QCOMPARE(t1.version, t2.version);
}
diff --git a/tests/auto/network/ssl/qsslkey/BLACKLIST b/tests/auto/network/ssl/qsslkey/BLACKLIST
new file mode 100644
index 0000000000..a08e1f35eb
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/BLACKLIST
@@ -0,0 +1 @@
+linux
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index d570037015..a7957d3288 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -39,7 +39,7 @@
#include <QtNetwork/qhostaddress.h>
#include <QtNetwork/qnetworkproxy.h>
-#if !defined(QT_NO_SSL) && defined(QT_NO_OPENSSL) && defined(QT_BUILD_INTERNAL)
+#if !defined(QT_NO_SSL) && defined(QT_BUILD_INTERNAL)
#include "private/qsslkey_p.h"
#define TEST_CRYPTO
#endif
diff --git a/tests/auto/network/ssl/qsslsocket/BLACKLIST b/tests/auto/network/ssl/qsslsocket/BLACKLIST
index 17b606e2be..4146a352e9 100644
--- a/tests/auto/network/ssl/qsslsocket/BLACKLIST
+++ b/tests/auto/network/ssl/qsslsocket/BLACKLIST
@@ -1,2 +1,3 @@
+windows
[waitForConnectedEncryptedReadyRead:WithSocks5ProxyAuth]
*
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index b95b72a41e..257df13343 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -170,6 +170,9 @@ private slots:
void protocol();
void protocolServerSide_data();
void protocolServerSide();
+#ifndef QT_NO_OPENSSL
+ void serverCipherPreferences();
+#endif // QT_NO_OPENSSL
void setCaCertificates();
void setLocalCertificate();
void localCertificateChain();
@@ -463,7 +466,9 @@ void tst_QSslSocket::constructing()
QCOMPARE(socket.peerAddress(), QHostAddress());
QVERIFY(socket.peerName().isEmpty());
QCOMPARE(socket.peerPort(), quint16(0));
+#ifndef QT_NO_NETWORKPROXY
QCOMPARE(socket.proxy().type(), QNetworkProxy::DefaultProxy);
+#endif
QCOMPARE(socket.readBufferSize(), qint64(0));
QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.socketType(), QAbstractSocket::TcpSocket);
@@ -817,7 +822,7 @@ void tst_QSslSocket::peerCertificateChain()
this->socket = socket.data();
QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
- QVERIFY(caCertificates.count() == 1);
+ QCOMPARE(caCertificates.count(), 1);
socket->addCaCertificates(caCertificates);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket.data(), SIGNAL(sslErrors(QList<QSslError>)),
@@ -863,7 +868,7 @@ void tst_QSslSocket::peerCertificateChain()
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->peerCertificateChain().first(), socket->peerCertificate());
- QVERIFY(socket->peerCertificateChain() == certChain);
+ QCOMPARE(socket->peerCertificateChain(), certChain);
socket->disconnectFromHost();
QVERIFY(socket->waitForDisconnected());
@@ -1063,6 +1068,7 @@ public:
const QString &certFile = SRCDIR "certs/fluke.cert",
const QString &interFile = QString())
: socket(0),
+ config(QSslConfiguration::defaultConfiguration()),
ignoreSslErrors(true),
peerVerifyMode(QSslSocket::AutoVerifyPeer),
protocol(QSsl::TlsV1_0),
@@ -1071,6 +1077,7 @@ public:
m_interFile(interFile)
{ }
QSslSocket *socket;
+ QSslConfiguration config;
QString addCaCertificates;
bool ignoreSslErrors;
QSslSocket::PeerVerifyMode peerVerifyMode;
@@ -1084,6 +1091,7 @@ protected:
void incomingConnection(qintptr socketDescriptor)
{
socket = new QSslSocket(this);
+ socket->setSslConfiguration(config);
socket->setPeerVerifyMode(peerVerifyMode);
socket->setProtocol(protocol);
if (ignoreSslErrors)
@@ -1254,6 +1262,78 @@ void tst_QSslSocket::protocolServerSide()
QCOMPARE(client->isEncrypted(), works);
}
+#ifndef QT_NO_OPENSSL
+
+void tst_QSslSocket::serverCipherPreferences()
+{
+ if (!QSslSocket::supportsSsl()) {
+ qWarning("SSL not supported, skipping test");
+ return;
+ }
+
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ // First using the default (server preference)
+ {
+ SslServer server;
+ server.ciphers = QString("AES128-SHA:AES256-SHA");
+ QVERIFY(server.listen());
+
+ QEventLoop loop;
+ QTimer::singleShot(5000, &loop, SLOT(quit()));
+
+ QSslSocketPtr client(new QSslSocket);
+ socket = client.data();
+ socket->setCiphers("AES256-SHA:AES128-SHA");
+
+ // upon SSL wrong version error, error will be triggered, not sslErrors
+ connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
+ connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
+
+ client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+
+ loop.exec();
+
+ QVERIFY(client->isEncrypted());
+ QCOMPARE(client->sessionCipher().name(), QString("AES128-SHA"));
+ }
+
+ {
+ // Now using the client preferences
+ SslServer server;
+ QSslConfiguration config = QSslConfiguration::defaultConfiguration();
+ config.setSslOption(QSsl::SslOptionDisableServerCipherPreference, true);
+ server.config = config;
+ server.ciphers = QString("AES128-SHA:AES256-SHA");
+ QVERIFY(server.listen());
+
+ QEventLoop loop;
+ QTimer::singleShot(5000, &loop, SLOT(quit()));
+
+ QSslSocketPtr client(new QSslSocket);
+ socket = client.data();
+ socket->setCiphers("AES256-SHA:AES128-SHA");
+
+ // upon SSL wrong version error, error will be triggered, not sslErrors
+ connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
+ connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
+
+ client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+
+ loop.exec();
+
+ QVERIFY(client->isEncrypted());
+ QCOMPARE(client->sessionCipher().name(), QString("AES256-SHA"));
+ }
+}
+
+#endif // QT_NO_OPENSSL
+
+
void tst_QSslSocket::setCaCertificates()
{
if (!QSslSocket::supportsSsl())
@@ -1655,7 +1735,7 @@ void tst_QSslSocket::spontaneousWrite()
QSslSocket *sender = server.socket;
QVERIFY(sender);
- QVERIFY(sender->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(sender->state(), QAbstractSocket::ConnectedState);
receiver->setObjectName("receiver");
sender->setObjectName("sender");
receiver->ignoreSslErrors();
@@ -1700,7 +1780,7 @@ void tst_QSslSocket::setReadBufferSize()
QSslSocket *sender = server.socket;
QVERIFY(sender);
- QVERIFY(sender->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(sender->state(), QAbstractSocket::ConnectedState);
receiver->setObjectName("receiver");
sender->setObjectName("sender");
receiver->ignoreSslErrors();
@@ -2109,6 +2189,7 @@ void tst_QSslSocket::disconnectFromHostWhenConnected()
void tst_QSslSocket::resetProxy()
{
+#ifndef QT_NO_NETWORKPROXY
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return;
@@ -2148,6 +2229,7 @@ void tst_QSslSocket::resetProxy()
socket2.setProxy(goodProxy);
socket2.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
QVERIFY2(socket2.waitForConnected(10000), qPrintable(socket.errorString()));
+#endif // QT_NO_NETWORKPROXY
}
void tst_QSslSocket::ignoreSslErrorsList_data()
@@ -2254,7 +2336,7 @@ void tst_QSslSocket::readFromClosedSocket()
socket->close();
QVERIFY(!socket->bytesAvailable());
QVERIFY(!socket->bytesToWrite());
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
}
void tst_QSslSocket::writeBigChunk()
@@ -2281,7 +2363,7 @@ void tst_QSslSocket::writeBigChunk()
QString errorBefore = socket->errorString();
int ret = socket->write(data.constData(), data.size());
- QVERIFY(data.size() == ret);
+ QCOMPARE(data.size(), ret);
// spin the event loop once so QSslSocket::transmit() gets called
QCoreApplication::processEvents();
@@ -2298,7 +2380,7 @@ void tst_QSslSocket::writeBigChunk()
QByteArray("unexpected error: ").append(qPrintable(errorAfter)));
// check that everything has been written to OpenSSL
- QVERIFY(socket->bytesToWrite() == 0);
+ QCOMPARE(socket->bytesToWrite(), 0);
socket->close();
}
@@ -2322,7 +2404,7 @@ void tst_QSslSocket::blacklistedCertificates()
QSslSocket *sender = server.socket;
QVERIFY(sender);
- QVERIFY(sender->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(sender->state(), QAbstractSocket::ConnectedState);
receiver->setObjectName("receiver");
sender->setObjectName("sender");
receiver->startClientEncryption();
@@ -2354,28 +2436,28 @@ void tst_QSslSocket::sslOptions()
#ifdef SSL_OP_NO_COMPRESSION
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSslConfigurationPrivate::defaultSslOptions),
- long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_COMPRESSION));
+ long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_COMPRESSION|SSL_OP_CIPHER_SERVER_PREFERENCE));
#else
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSslConfigurationPrivate::defaultSslOptions),
- long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3));
+ long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_CIPHER_SERVER_PREFERENCE));
#endif
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSsl::SslOptionDisableEmptyFragments
|QSsl::SslOptionDisableLegacyRenegotiation),
- long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3));
+ long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_CIPHER_SERVER_PREFERENCE));
#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSsl::SslOptionDisableEmptyFragments),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION|SSL_OP_CIPHER_SERVER_PREFERENCE)));
#endif
#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSsl::SslOptionDisableLegacyRenegotiation),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3) & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_CIPHER_SERVER_PREFERENCE) & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
#endif
#ifdef SSL_OP_NO_TICKET
@@ -2383,7 +2465,7 @@ void tst_QSslSocket::sslOptions()
QSsl::SslOptionDisableEmptyFragments
|QSsl::SslOptionDisableLegacyRenegotiation
|QSsl::SslOptionDisableSessionTickets),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET)));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET|SSL_OP_CIPHER_SERVER_PREFERENCE)));
#endif
#ifdef SSL_OP_NO_TICKET
@@ -2393,7 +2475,7 @@ void tst_QSslSocket::sslOptions()
|QSsl::SslOptionDisableLegacyRenegotiation
|QSsl::SslOptionDisableSessionTickets
|QSsl::SslOptionDisableCompression),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET|SSL_OP_NO_COMPRESSION)));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET|SSL_OP_NO_COMPRESSION|SSL_OP_CIPHER_SERVER_PREFERENCE)));
#endif
#endif
}
@@ -2648,9 +2730,9 @@ void tst_QSslSocket::qtbug18498_peek2()
while (client->bytesAvailable() < 7 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
char c;
- QVERIFY(client->peek(&c,1) == 1);
+ QCOMPARE(client->peek(&c,1), 1);
QCOMPARE(c, 'H');
- QVERIFY(client->read(&c,1) == 1);
+ QCOMPARE(client->read(&c,1), 1);
QCOMPARE(c, 'H');
QByteArray b = client->peek(2);
QCOMPARE(b, QByteArray("EL"));
@@ -2686,7 +2768,7 @@ void tst_QSslSocket::qtbug18498_peek2()
// ### Qt5 use QTRY_VERIFY
while (server->bytesAvailable() < 10 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
- QVERIFY(server->peek(&c,1) == 1);
+ QCOMPARE(server->peek(&c,1), 1);
QCOMPARE(c, 'S');
b = server->peek(3);
QCOMPARE(b, QByteArray("STA"));
@@ -2722,9 +2804,9 @@ void tst_QSslSocket::qtbug18498_peek2()
while (client->bytesAvailable() < 7 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
QVERIFY(server->mode() == QSslSocket::SslServerMode && client->mode() == QSslSocket::SslClientMode);
- QVERIFY(client->peek(&c,1) == 1);
+ QCOMPARE(client->peek(&c,1), 1);
QCOMPARE(c, 'h');
- QVERIFY(client->read(&c,1) == 1);
+ QCOMPARE(client->read(&c,1), 1);
QCOMPARE(c, 'h');
b = client->peek(2);
QCOMPARE(b, QByteArray("el"));
@@ -2734,7 +2816,7 @@ void tst_QSslSocket::qtbug18498_peek2()
stopwatch.start();
while (server->bytesAvailable() < 9 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
- QVERIFY(server->peek(&c,1) == 1);
+ QCOMPARE(server->peek(&c,1), 1);
QCOMPARE(c, 'g');
QCOMPARE(server->readAll(), QByteArray("goodbye\r\n"));
client->disconnectFromHost();
@@ -2768,7 +2850,7 @@ void tst_QSslSocket::dhServer()
client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
}
void tst_QSslSocket::ecdhServer()
@@ -2798,7 +2880,7 @@ void tst_QSslSocket::ecdhServer()
client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
}
void tst_QSslSocket::verifyClientCertificate_data()
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST
new file mode 100644
index 0000000000..c9b628d79b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST
@@ -0,0 +1,2 @@
+[onDemandRootCertLoadingMemberMethods]
+linux
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST
new file mode 100644
index 0000000000..52bd2bc86d
--- /dev/null
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST
@@ -0,0 +1,2 @@
+[onDemandRootCertLoadingStaticMethods:WithSocks5ProxyAuth]
+windows
diff --git a/tests/auto/opengl/qgl/BLACKLIST b/tests/auto/opengl/qgl/BLACKLIST
new file mode 100644
index 0000000000..fa7c829b30
--- /dev/null
+++ b/tests/auto/opengl/qgl/BLACKLIST
@@ -0,0 +1,16 @@
+[glWidgetRendering]
+windows
+[glFBORendering]
+windows
+[multipleFBOInterleavedRendering]
+windows
+[glPBufferRendering]
+windows
+[replaceClipping]
+windows
+[clipTest]
+windows
+[graphicsViewClipping]
+windows
+[glFBOUseInGLWidget]
+windows
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 9bd82559b7..7970725355 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -459,113 +459,113 @@ void tst_QGL::getSetCheck()
QGLFormat format1;
QGLFormat format2;
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setDoubleBuffer(false);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setDoubleBuffer(false);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setDepthBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setDepthBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setAccumBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setAccumBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setRedBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setRedBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setGreenBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setGreenBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setBlueBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setBlueBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setAlphaBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setAlphaBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setStencilBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setStencilBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setSamples(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setSamples(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setSwapInterval(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setSwapInterval(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setPlane(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setPlane(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setVersion(3, 2);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setVersion(3, 2);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setProfile(QGLFormat::CoreProfile);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setProfile(QGLFormat::CoreProfile);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setOption(QGL::NoDeprecatedFunctions);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setOption(QGL::NoDeprecatedFunctions);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
// Copy constructor and assignment for QGLFormat.
QGLFormat format3(format1);
QGLFormat format4;
- QVERIFY(format1 == format3);
+ QCOMPARE(format1, format3);
QVERIFY(format1 != format4);
format4 = format1;
- QVERIFY(format1 == format4);
+ QCOMPARE(format1, format4);
// Check that modifying a copy doesn't affect the original.
format3.setRedBufferSize(16);
@@ -584,15 +584,15 @@ void tst_QGL::getSetCheck()
QCOMPARE(format5.plane(), 3);
// The default format should be the same as QGLFormat().
- QVERIFY(QGLFormat::defaultFormat() == QGLFormat());
+ QCOMPARE(QGLFormat::defaultFormat(), QGLFormat());
// Modify the default format and check that it was changed.
QGLFormat::setDefaultFormat(format1);
- QVERIFY(QGLFormat::defaultFormat() == format1);
+ QCOMPARE(QGLFormat::defaultFormat(), format1);
// Restore the default format.
QGLFormat::setDefaultFormat(QGLFormat());
- QVERIFY(QGLFormat::defaultFormat() == QGLFormat());
+ QCOMPARE(QGLFormat::defaultFormat(), QGLFormat());
// Check the default overlay format's expected values.
QGLFormat overlay(QGLFormat::defaultOverlayFormat());
@@ -618,11 +618,11 @@ void tst_QGL::getSetCheck()
// Modify the default overlay format and check that it was changed.
QGLFormat::setDefaultOverlayFormat(format1);
- QVERIFY(QGLFormat::defaultOverlayFormat() == format1);
+ QCOMPARE(QGLFormat::defaultOverlayFormat(), format1);
// Restore the default overlay format.
QGLFormat::setDefaultOverlayFormat(overlay);
- QVERIFY(QGLFormat::defaultOverlayFormat() == overlay);
+ QCOMPARE(QGLFormat::defaultOverlayFormat(), overlay);
MyGLContext obj2(obj1);
// bool QGLContext::windowCreated()
@@ -1512,9 +1512,9 @@ void tst_QGL::colormap()
QGLColormap cmap1;
QVERIFY(cmap1.isEmpty());
QCOMPARE(cmap1.size(), 0);
- QVERIFY(cmap1.entryRgb(0) == 0);
- QVERIFY(cmap1.entryRgb(-1) == 0);
- QVERIFY(cmap1.entryRgb(100) == 0);
+ QCOMPARE(cmap1.entryRgb(0), QRgb(0));
+ QCOMPARE(cmap1.entryRgb(-1), QRgb(0));
+ QCOMPARE(cmap1.entryRgb(100), QRgb(0));
QVERIFY(!cmap1.entryColor(0).isValid());
QVERIFY(!cmap1.entryColor(-1).isValid());
QVERIFY(!cmap1.entryColor(100).isValid());
@@ -1529,7 +1529,7 @@ void tst_QGL::colormap()
// not to detect when it is empty!
QVERIFY(cmap1.isEmpty());
QCOMPARE(cmap1.size(), 256);
- QVERIFY(cmap1.entryRgb(0) == 0);
+ QCOMPARE(cmap1.entryRgb(0), QRgb(0));
QVERIFY(cmap1.entryColor(0) == QColor(0, 0, 0, 255));
QVERIFY(cmap1.entryRgb(56) == qRgb(255, 0, 0));
QVERIFY(cmap1.entryColor(56) == QColor(255, 0, 0, 255));
@@ -1611,7 +1611,7 @@ void tst_QGL::colormap()
QVERIFY(cmap4.isEmpty());
QCOMPARE(cmap4.size(), 256);
cmap4.setHandle(Qt::HANDLE(42));
- QVERIFY(cmap4.handle() == Qt::HANDLE(42));
+ QCOMPARE(cmap4.handle(), Qt::HANDLE(42));
QVERIFY(!cmap4.isEmpty());
QCOMPARE(cmap4.size(), 256);
}
@@ -1629,7 +1629,7 @@ void tst_QGL::fboFormat()
// Check the initial conditions.
QGLFramebufferObjectFormat format1;
QCOMPARE(format1.samples(), 0);
- QVERIFY(format1.attachment() == QGLFramebufferObject::NoAttachment);
+ QCOMPARE(format1.attachment(), QGLFramebufferObject::NoAttachment);
QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_2D));
int expectedFormat =
#ifdef QT_OPENGL_ES_2
@@ -1645,7 +1645,7 @@ void tst_QGL::fboFormat()
format1.setTextureTarget(GL_TEXTURE_3D);
format1.setInternalTextureFormat(GL_RGB16);
QCOMPARE(format1.samples(), 8);
- QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format1.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16));
@@ -1653,12 +1653,12 @@ void tst_QGL::fboFormat()
QGLFramebufferObjectFormat format2(format1);
QGLFramebufferObjectFormat format3;
QCOMPARE(format2.samples(), 8);
- QVERIFY(format2.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format2.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format2.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format2.internalTextureFormat()), int(GL_RGB16));
format3 = format1;
QCOMPARE(format3.samples(), 8);
- QVERIFY(format3.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format3.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format3.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format3.internalTextureFormat()), int(GL_RGB16));
@@ -1666,7 +1666,7 @@ void tst_QGL::fboFormat()
format2.setSamples(9);
format3.setTextureTarget(GL_TEXTURE_2D);
QCOMPARE(format1.samples(), 8);
- QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format1.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16));
@@ -1674,39 +1674,39 @@ void tst_QGL::fboFormat()
QGLFramebufferObjectFormat format1c;
QGLFramebufferObjectFormat format2c;
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setSamples(8);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setSamples(8);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setTextureTarget(GL_TEXTURE_3D);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setTextureTarget(GL_TEXTURE_3D);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setInternalTextureFormat(GL_RGB16);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setInternalTextureFormat(GL_RGB16);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
QGLFramebufferObjectFormat format3c(format1c);
QGLFramebufferObjectFormat format4c;
- QVERIFY(format1c == format3c);
+ QCOMPARE(format1c, format3c);
QVERIFY(!(format1c != format3c));
format3c.setInternalTextureFormat(
#ifdef QT_OPENGL_ES_2
@@ -1719,7 +1719,7 @@ void tst_QGL::fboFormat()
QVERIFY(format1c != format3c);
format4c = format1c;
- QVERIFY(format1c == format4c);
+ QCOMPARE(format1c, format4c);
QVERIFY(!(format1c != format4c));
format4c.setInternalTextureFormat(
#ifdef QT_OPENGL_ES_2
@@ -1947,7 +1947,7 @@ void tst_QGL::destroyFBOAfterContext()
delete glw;
// The handle should now be zero.
- QVERIFY(fbo->handle() == 0);
+ QVERIFY(!fbo->handle());
QVERIFY(!fbo->isValid());
delete fbo;
@@ -1984,14 +1984,14 @@ void tst_QGL::shareRegister()
// Create a guard for the first context.
QOpenGLSharedResourceGuard guard(glw1->context()->contextHandle());
- QVERIFY(guard.id() == 0);
+ QCOMPARE(guard.id(), 0);
guard.setId(3);
- QVERIFY(guard.id() == 3);
+ QCOMPARE(guard.id(), 3);
// Request a tst_QGLResource object for the first context.
tst_QGLResource *res1 = qt_shared_test()->value(glw1->context()->contextHandle());
QVERIFY(res1);
- QVERIFY(qt_shared_test()->value(glw1->context()->contextHandle()) == res1);
+ QCOMPARE(qt_shared_test()->value(glw1->context()->contextHandle()), res1);
// Create another context that shares with the first.
QVERIFY(!glw1->isSharing());
@@ -2005,12 +2005,12 @@ void tst_QGL::shareRegister()
QVERIFY(glw1->context() != glw2->context());
// Check that the first context's resource is also on the second.
- QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
+ QCOMPARE(qt_shared_test()->value(glw1->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw2->context()), res1);
// Guard should still be the same.
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
+ QCOMPARE(guard.context(), glw1->context());
+ QCOMPARE(guard.id(), 3);
// Check the sharing relationships.
QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context()));
@@ -2032,9 +2032,9 @@ void tst_QGL::shareRegister()
// Request a resource to the third context.
tst_QGLResource *res3 = qt_shared_test()->value(glw3->context());
QVERIFY(res3);
- QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
+ QCOMPARE(qt_shared_test()->value(glw1->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw2->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw3->context()), res3);
// Check the sharing relationships again.
QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context()));
@@ -2053,8 +2053,8 @@ void tst_QGL::shareRegister()
QVERIFY(!QGLContext::areSharing(0, 0));
// Shared guard should still be the same.
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
+ QCOMPARE(guard.context(), glw1->context());
+ QCOMPARE(guard.id(), 3);
// Delete the first context.
delete glw1;
@@ -2064,14 +2064,14 @@ void tst_QGL::shareRegister()
// The first context's resource should transfer to the second context.
QCOMPARE(tst_QGLResource::deletions, 0);
- QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
+ QCOMPARE(qt_shared_test()->value(glw2->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw3->context()), res3);
// Shared guard should now be the second context, with the id the same.
- QVERIFY(guard.context() == glw2->context());
- QVERIFY(guard.id() == 3);
- QVERIFY(guard3.context() == glw3->context());
- QVERIFY(guard3.id() == 5);
+ QCOMPARE(guard.context(), glw2->context());
+ QCOMPARE(guard.id(), 3);
+ QCOMPARE(guard3.context(), glw3->context());
+ QCOMPARE(guard3.id(), 5);
// Clean up and check that the resources are properly deleted.
delete glw2;
@@ -2115,25 +2115,25 @@ void tst_QGL::qglContextDefaultBindTexture()
QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
// Make sure the texture IDs returned are valid:
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_TRUE);
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_TRUE));
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_TRUE));
// Make sure the textures are still valid after we delete the image/pixmap:
// Also check that although the textures are left intact, the cache entries are removed:
delete boundImage;
boundImage = 0;
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_TRUE));
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
delete boundPixmap;
boundPixmap = 0;
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_TRUE));
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
// Finally, make sure QGLContext::deleteTexture deletes the texture IDs:
ctx->deleteTexture(boundImageTextureId);
ctx->deleteTexture(boundPixmapTextureId);
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_FALSE);
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_FALSE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_FALSE));
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_FALSE));
}
#endif
diff --git a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
index b0409d46d0..f96e3514a7 100644
--- a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
+++ b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
@@ -86,14 +86,14 @@ void tst_QGLBuffer::testBuffer(QGLBuffer::Type type)
// Create the local object, but not the buffer in the server.
QGLBuffer buffer(type);
- QVERIFY(buffer.usagePattern() == QGLBuffer::StaticDraw);
+ QCOMPARE(buffer.usagePattern(), QGLBuffer::StaticDraw);
buffer.setUsagePattern(QGLBuffer::UsagePattern(usagePattern));
// Check the initial state.
- QVERIFY(buffer.type() == type);
+ QCOMPARE(buffer.type(), type);
QVERIFY(!buffer.isCreated());
- QVERIFY(buffer.bufferId() == 0);
- QVERIFY(buffer.usagePattern() == QGLBuffer::UsagePattern(usagePattern));
+ QCOMPARE(buffer.bufferId(), GLuint(0));
+ QCOMPARE(buffer.usagePattern(), QGLBuffer::UsagePattern(usagePattern));
QCOMPARE(buffer.size(), -1);
// Should not be able to bind it yet because it isn't created.
@@ -253,7 +253,7 @@ void tst_QGLBuffer::bufferSharing()
delete w2;
// The buffer should now be invalid.
- QVERIFY(buffer.bufferId() == 0);
+ QCOMPARE(buffer.bufferId(), GLuint(0));
QVERIFY(!buffer.isCreated());
}
diff --git a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
index 866cd57381..07fdba4664 100644
--- a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
+++ b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
@@ -200,13 +200,13 @@ void tst_QGLFunctions::multitexture()
GLint active = 0;
funcs.glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
- QVERIFY(active == GL_TEXTURE1);
+ QCOMPARE(active, GL_TEXTURE1);
funcs.glActiveTexture(GL_TEXTURE0);
active = 0;
funcs.glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
- QVERIFY(active == GL_TEXTURE0);
+ QCOMPARE(active, GL_TEXTURE0);
}
// Verify that the glBlendColor() function appears to resolve and work.
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index ff5a18dedb..6a726ac62d 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -796,7 +796,6 @@ void tst_QGLThreads::painterOnFboInThread()
int main(int argc, char **argv)
{
- QApplication::setAttribute(Qt::AA_X11InitThreads);
QApplication app(argc, argv);
QTEST_DISABLE_KEYPAD_NAVIGATION \
diff --git a/tests/auto/other/compiler/compiler.pro b/tests/auto/other/compiler/compiler.pro
index 213429050f..356013c8f1 100644
--- a/tests/auto/other/compiler/compiler.pro
+++ b/tests/auto/other/compiler/compiler.pro
@@ -3,7 +3,8 @@ TARGET = tst_compiler
SOURCES += tst_compiler.cpp baseclass.cpp derivedclass.cpp othersource.cpp
HEADERS += baseclass.h derivedclass.h
QT = core testlib
-contains(QT_CONFIG, c++11): CONFIG += c++14 c++11
+contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++14): CONFIG += c++14
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index 8f7dcdb3c5..af0fa4682d 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -336,17 +336,17 @@ struct Qxxx {};
void tst_Compiler::detectDataStream()
{
- QVERIFY(QtTestInternal::DataStreamChecker<int>::HasDataStream == true);
- QVERIFY(QtTestInternal::DataStreamChecker<uint>::HasDataStream == true);
+ QVERIFY(QtTestInternal::DataStreamChecker<int>::HasDataStream);
+ QVERIFY(QtTestInternal::DataStreamChecker<uint>::HasDataStream);
QVERIFY(QtTestInternal::DataStreamChecker<char *>::HasDataStream == true);
QVERIFY(QtTestInternal::DataStreamChecker<const int>::HasInDataStream == true);
QVERIFY(QtTestInternal::DataStreamChecker<const int>::HasOutDataStream == false);
QVERIFY(QtTestInternal::DataStreamChecker<const int>::HasDataStream == false);
- QVERIFY(QtTestInternal::DataStreamChecker<double>::HasDataStream == true);
+ QVERIFY(QtTestInternal::DataStreamChecker<double>::HasDataStream);
- QVERIFY(QtTestInternal::DataStreamChecker<QString>::HasDataStream == true);
- QVERIFY(QtTestInternal::DataStreamChecker<MyString>::HasDataStream == true);
- QVERIFY(QtTestInternal::DataStreamChecker<Qxxx>::HasDataStream == false);
+ QVERIFY(QtTestInternal::DataStreamChecker<QString>::HasDataStream);
+ QVERIFY(QtTestInternal::DataStreamChecker<MyString>::HasDataStream);
+ QVERIFY(!QtTestInternal::DataStreamChecker<Qxxx>::HasDataStream);
QVERIFY(QtTestInternal::getSaveOperator<int>() != 0);
QVERIFY(QtTestInternal::getSaveOperator<uint>() != 0);
@@ -354,7 +354,7 @@ void tst_Compiler::detectDataStream()
QVERIFY(QtTestInternal::getSaveOperator<double>() != 0);
QVERIFY(QtTestInternal::getSaveOperator<QString>() != 0);
QVERIFY(QtTestInternal::getSaveOperator<MyString>() != 0);
- QVERIFY(QtTestInternal::getSaveOperator<Qxxx>() == 0);
+ QVERIFY(!QtTestInternal::getSaveOperator<Qxxx>());
}
#else
void tst_Compiler::detectDataStream()
@@ -637,7 +637,8 @@ void tst_Compiler::cxx11_alignas()
QSKIP("Compiler does not support C++11 feature");
#else
alignas(double) char c;
- QVERIFY(Q_ALIGNOF(c) == Q_ALIGNOF(double));
+ Q_UNUSED(c);
+ QCOMPARE(Q_ALIGNOF(c), Q_ALIGNOF(double));
#endif
}
@@ -978,6 +979,20 @@ void tst_Compiler::cxx11_nullptr()
#endif
}
+namespace SomeNamespace {
+class AdlOnly {
+ QVector<int> v;
+public:
+ AdlOnly() : v(5) { std::fill_n(v.begin(), v.size(), 42); }
+
+private:
+ friend QVector<int>::const_iterator begin(const AdlOnly &x) { return x.v.begin(); }
+ friend QVector<int>::const_iterator end(const AdlOnly &x) { return x.v.end(); }
+ friend QVector<int>::iterator begin(AdlOnly &x) { return x.v.begin(); }
+ friend QVector<int>::iterator end(AdlOnly &x) { return x.v.end(); }
+};
+}
+
void tst_Compiler::cxx11_range_for()
{
#ifndef Q_COMPILER_RANGE_FOR
@@ -997,6 +1012,85 @@ void tst_Compiler::cxx11_range_for()
l << 2;
for (int i : ll)
QCOMPARE(i, 2);
+
+ {
+ const int array[] = { 0, 1, 2, 3, 4 };
+ int i = 0;
+ for (const int &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (int e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const int e : array)
+ QCOMPARE(e, array[i++]);
+#ifdef Q_COMPILER_AUTO_TYPE
+ i = 0;
+ for (const auto &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto &e : array) // auto deducing const
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const auto e : array)
+ QCOMPARE(e, array[i++]);
+#endif
+ }
+
+ {
+ int array[] = { 0, 1, 2, 3, 4 };
+ const int array2[] = { 10, 11, 12, 13, 14 };
+ int i = 0;
+ for (const int &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (int &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (int e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const int e : array)
+ QCOMPARE(e, array[i++]);
+#ifdef Q_COMPILER_AUTO_TYPE
+ i = 0;
+ for (const auto &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const auto e : array)
+ QCOMPARE(e, array[i++]);
+#endif
+ for (int &e : array)
+ e += 10;
+ i = 0;
+ for (const int &e : array)
+ QCOMPARE(e, array2[i++]);
+ }
+
+ {
+ const SomeNamespace::AdlOnly x;
+ for (const int &e : x)
+ QCOMPARE(e, 42);
+ }
+
+ {
+ SomeNamespace::AdlOnly x;
+ for (const int &e : x)
+ QCOMPARE(e, 42);
+ for (int &e : x)
+ e += 10;
+ for (const int &e : x)
+ QCOMPARE(e, 52);
+ }
#endif
}
@@ -1034,24 +1128,88 @@ void tst_Compiler::cxx11_ref_qualifiers()
#endif
}
+class MoveDefinedQString {
+ QString s;
+public:
+ MoveDefinedQString() : s() {}
+ explicit MoveDefinedQString(const QString &s) : s(s) {}
+ MoveDefinedQString(const MoveDefinedQString &other) : s(other.s) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ MoveDefinedQString(MoveDefinedQString &&other) : s(std::move(other.s)) { other.s.clear(); }
+ MoveDefinedQString &operator=(MoveDefinedQString &&other)
+ { s = std::move(other.s); other.s.clear(); return *this; }
+#endif
+ MoveDefinedQString &operator=(const MoveDefinedQString &other) { s = other.s; return *this; }
+
+private:
+ friend bool operator==(const MoveDefinedQString &lhs, const MoveDefinedQString &rhs)
+ { return lhs.s == rhs.s; }
+ friend bool operator!=(const MoveDefinedQString &lhs, const MoveDefinedQString &rhs)
+ { return !operator==(lhs, rhs); }
+ friend char* toString(const MoveDefinedQString &mds)
+ { using namespace QTest; return toString(mds.s); }
+};
+
void tst_Compiler::cxx11_rvalue_refs()
{
#ifndef Q_COMPILER_RVALUE_REFS
QSKIP("Compiler does not support C++11 feature");
#else
- int i = 1;
- i = std::move(i);
-
- QString s = "Hello";
- QString t = std::move(s);
- QCOMPARE(t, QString("Hello"));
+ // we require std::move:
+ {
+ int i = 1;
+ i = std::move(i);
+
+ MoveDefinedQString s("Hello");
+ MoveDefinedQString t = std::move(s);
+ QCOMPARE(t, MoveDefinedQString("Hello"));
+ QCOMPARE(s, MoveDefinedQString());
+
+ s = t;
+ t = std::move(s);
+ QCOMPARE(t, MoveDefinedQString("Hello"));
+ QCOMPARE(s, MoveDefinedQString());
+
+ MoveDefinedQString &&r = std::move(t); // no actual move!
+ QCOMPARE(r, MoveDefinedQString("Hello"));
+ QCOMPARE(t, MoveDefinedQString("Hello")); // so 't' is unchanged
+ }
- s = t;
- t = std::move(s);
- QCOMPARE(t, QString("Hello"));
+ // we require std::forward:
+ {
+ MoveDefinedQString s("Hello");
+ MoveDefinedQString s2 = std::forward<MoveDefinedQString>(s); // forward as rvalue
+ QCOMPARE(s2, MoveDefinedQString("Hello"));
+ QCOMPARE(s, MoveDefinedQString());
+
+ MoveDefinedQString s3 = std::forward<MoveDefinedQString&>(s2); // forward as lvalue
+ QCOMPARE(s2, MoveDefinedQString("Hello"));
+ QCOMPARE(s3, MoveDefinedQString("Hello"));
+ }
- QString &&r = std::move(s);
- QCOMPARE(r, QString("Hello"));
+ // supported by MSVC only from November 2013 CTP, but only check for VC2015:
+# if !defined(Q_CC_MSVC) || defined(Q_CC_INTEL) || _MSC_VER >= 1900 // VS14 == VC2015
+ // we require automatic generation of move special member functions:
+ {
+ struct M { MoveDefinedQString s1, s2; };
+ M m1 = { MoveDefinedQString("Hello"), MoveDefinedQString("World") };
+ QCOMPARE(m1.s1, MoveDefinedQString("Hello"));
+ QCOMPARE(m1.s2, MoveDefinedQString("World"));
+ M m2 = std::move(m1);
+ QCOMPARE(m1.s1, MoveDefinedQString());
+ QCOMPARE(m1.s2, MoveDefinedQString());
+ QCOMPARE(m2.s1, MoveDefinedQString("Hello"));
+ QCOMPARE(m2.s2, MoveDefinedQString("World"));
+ M m3;
+ QCOMPARE(m3.s1, MoveDefinedQString());
+ QCOMPARE(m3.s2, MoveDefinedQString());
+ m3 = std::move(m2);
+ QCOMPARE(m2.s1, MoveDefinedQString());
+ QCOMPARE(m2.s2, MoveDefinedQString());
+ QCOMPARE(m3.s1, MoveDefinedQString("Hello"));
+ QCOMPARE(m3.s2, MoveDefinedQString("World"));
+ }
+# endif // MSVC < 2015
#endif
}
@@ -1264,9 +1422,11 @@ void tst_Compiler::cxx14_decltype_auto()
}
#if __cpp_return_type_deduction >= 201304
-auto returnTypeDeduction()
+auto returnTypeDeduction(bool choice)
{
- return 1U;
+ if (choice)
+ return 1U;
+ return returnTypeDeduction(!choice);
}
#endif
@@ -1275,7 +1435,7 @@ void tst_Compiler::cxx14_return_type_deduction()
#if __cpp_return_type_deduction-0 < 201304
QSKIP("Compiler does not support this C++14 feature");
#else
- QCOMPARE(returnTypeDeduction(), 1U);
+ QCOMPARE(returnTypeDeduction(false), 1U);
#endif
}
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
new file mode 100644
index 0000000000..4e8745ca78
--- /dev/null
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -0,0 +1,2 @@
+[customGesture]
+opensuse-13.1
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index 43ce6b2d72..6db918cffd 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -48,6 +48,24 @@
#include <qdebug.h>
+static bool waitForWindowExposed(QWindow *window)
+{
+ if (!window)
+ return false;
+#ifdef Q_OS_OSX
+ QTest::qWait(100);
+ return window->isExposed();
+#endif
+ return QTest::qWaitForWindowExposed(window);
+}
+
+static bool waitForWindowExposed(QWidget *widget)
+{
+ if (!widget)
+ return false;
+ return waitForWindowExposed(widget->windowHandle());
+}
+
static QPointF mapToGlobal(const QPointF &pt, QGraphicsItem *item, QGraphicsView *view)
{
return view->viewport()->mapToGlobal(view->mapFromScene(item->mapToScene(pt)));
@@ -387,7 +405,7 @@ void tst_Gestures::customGesture()
GestureWidget widget;
widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
widget.show();
- QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ QVERIFY(waitForWindowExposed(&widget));
CustomEvent event;
event.hotSpot = widget.mapToGlobal(QPoint(5,5));
@@ -856,7 +874,7 @@ void tst_Gestures::graphicsItemGesture()
item->setPos(100, 100);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item->grabGesture(CustomGesture::GestureType);
@@ -918,7 +936,7 @@ void tst_Gestures::graphicsView()
item->setPos(100, 100);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item->grabGesture(CustomGesture::GestureType);
@@ -994,7 +1012,7 @@ void tst_Gestures::graphicsItemTreeGesture()
item1_child2->setParentItem(item1);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType);
@@ -1051,7 +1069,7 @@ void tst_Gestures::explicitGraphicsObjectTarget()
item2_child1->setPos(10, 10);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
@@ -1110,7 +1128,7 @@ void tst_Gestures::gestureOverChildGraphicsItem()
item2_child1->setPos(0, 0);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType);
@@ -1408,7 +1426,7 @@ void tst_Gestures::testMapToScene()
item0->setPos(14, 16);
view.show(); // need to show to give it a global coordinate
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
QPoint origin = view.mapToGlobal(QPoint());
@@ -1461,7 +1479,7 @@ void tst_Gestures::ungrabGesture() // a method on QWidget
QPointer<QGesture> customGestureB;
customGestureB = *(b->gestures.begin());
QVERIFY(!customGestureB.isNull());
- QVERIFY(customGestureA.data() == customGestureB.data());
+ QCOMPARE(customGestureA.data(), customGestureB.data());
QCOMPARE(customGestureB->gestureType(), CustomGesture::GestureType);
a->gestures.clear();
@@ -1534,7 +1552,7 @@ void tst_Gestures::autoCancelGestures()
parent.grabGesture(CustomGesture::GestureType);
child->grabGesture(secondGesture);
parent.show();
- QVERIFY(QTest::qWaitForWindowExposed(&parent));
+ QVERIFY(waitForWindowExposed(&parent));
/*
An event is sent to both the child and the parent, when the child gets it a gesture is triggered
@@ -1593,7 +1611,7 @@ void tst_Gestures::autoCancelGestures2()
child->grabGesture(secondGesture);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
CustomEvent event;
@@ -1639,7 +1657,7 @@ void tst_Gestures::graphicsViewParentPropagation()
item1_c1_c1->setPos(0, 0);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item0->grabGesture(CustomGesture::GestureType, Qt::ReceivePartialGestures | Qt::IgnoredGesturesPropagateToParent);
@@ -1709,7 +1727,7 @@ void tst_Gestures::panelPropagation()
item1_child1_child1->setZValue(10);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -1820,7 +1838,7 @@ void tst_Gestures::panelStacksBehindParent()
panel->setZValue(5);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -1904,7 +1922,7 @@ void tst_Gestures::deleteGestureTargetItem()
items.insert(item2->objectName(), item2);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
if (propagateUpdateGesture)
@@ -1949,7 +1967,7 @@ void tst_Gestures::viewportCoordinates()
scene.addItem(item1);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
CustomEvent event;
@@ -1986,7 +2004,7 @@ void tst_Gestures::partialGesturePropagation()
scene.addItem(item4);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->ignoredUpdatedGestures << CustomGesture::GestureType;
@@ -2074,7 +2092,7 @@ void tst_Gestures::testQGestureRecognizerCleanup()
//QGestureRecognizer::registerRecognizer(new PanRecognizer(PanRecognizer::Custom));
w->show();
- QVERIFY(QTest::qWaitForWindowExposed(w));
+ QVERIFY(waitForWindowExposed(w));
delete w;
}
@@ -2195,7 +2213,7 @@ void tst_Gestures::testReuseCanceledGestures()
gv->viewport()->grabGesture(tapGestureTypeId);
mw.show();
- QVERIFY(QTest::qWaitForWindowExposed(&mw));
+ QVERIFY(waitForWindowExposed(&mw));
QPoint targetPos(gv->mapFromScene(target->mapToScene(target->rect().center())));
targetPos = gv->viewport()->mapFromParent(targetPos);
@@ -2261,7 +2279,7 @@ void tst_Gestures::conflictingGesturesInGraphicsView()
scene.addItem(item2);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -2326,7 +2344,7 @@ void tst_Gestures::bug_13501_gesture_not_accepted()
NoConsumeWidgetBug13501 w;
w.grabGesture(Qt::TapGesture);
w.show();
- QVERIFY(QTest::qWaitForWindowExposed(&w));
+ QVERIFY(waitForWindowExposed(&w));
//QTest::mousePress(&ignoreEvent, Qt::LeftButton);
QTouchDevice *device = new QTouchDevice;
device->setType(QTouchDevice::TouchScreen);
diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp
index 6da3d06ba8..3022114403 100644
--- a/tests/auto/other/lancelot/tst_lancelot.cpp
+++ b/tests/auto/other/lancelot/tst_lancelot.cpp
@@ -259,13 +259,9 @@ void tst_Lancelot::paint(QPaintDevice *device, GraphicsEngine engine, const QStr
QTEST_MAIN(tst_Lancelot)
#undef main
-QT_BEGIN_NAMESPACE
-extern Q_DECL_IMPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-QT_END_NAMESPACE
-
int main(int argc, char *argv[])
{
- qt_qhash_seed.store(0); // Avoid rendering variations caused by QHash randomization
+ qSetGlobalQHashSeed(0); // Avoid rendering variations caused by QHash randomization
QBaselineTest::handleCmdLineArgs(&argc, &argv);
return _realmain(argc, argv);
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp
index 788993ef35..68d604547d 100644
--- a/tests/auto/other/languagechange/tst_languagechange.cpp
+++ b/tests/auto/other/languagechange/tst_languagechange.cpp
@@ -276,7 +276,7 @@ void tst_languageChange::retranslatability()
tempDirPattern += QStringLiteral("languagechangetestdirXXXXXX");
QTemporaryDir temporaryDir(tempDirPattern);
temporaryDir.setAutoRemove(true);
- QVERIFY(temporaryDir.isValid());
+ QVERIFY2(temporaryDir.isValid(), qPrintable(temporaryDir.errorString()));
const QString finalDir = temporaryDir.path() + QStringLiteral("/finaldir");
const QString fooName = temporaryDir.path() + QStringLiteral("/foo");
QDir dir;
diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp
index 1ddd0ca870..dee7ace1b9 100644
--- a/tests/auto/other/macgui/guitest.cpp
+++ b/tests/auto/other/macgui/guitest.cpp
@@ -145,7 +145,9 @@ namespace NativeEvents {
CGEventType mouseDownType = (buttons & Qt::LeftButton) ? kCGEventLeftMouseDown :
(buttons & Qt::RightButton) ? kCGEventRightMouseDown :
kCGEventOtherMouseDown;
- CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGEventLeftMouseDown;
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherMouseDown, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGMouseButtonLeft;
CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL, mouseDownType, position, mouseButton);
CGEventPost(kCGHIDEventTap, mouseEvent);
diff --git a/tests/auto/other/macgui/macgui.pro b/tests/auto/other/macgui/macgui.pro
index bf805ccd75..a793a304ca 100644
--- a/tests/auto/other/macgui/macgui.pro
+++ b/tests/auto/other/macgui/macgui.pro
@@ -6,5 +6,7 @@ HEADERS += guitest.h
QT = core-private widgets-private testlib
+osx: LIBS += -framework ApplicationServices
+
requires(mac)
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp
index 56035f4be4..ba6ac536f2 100644
--- a/tests/auto/other/macgui/tst_macgui.cpp
+++ b/tests/auto/other/macgui/tst_macgui.cpp
@@ -146,7 +146,7 @@ void tst_MacGui::splashScreenModality()
connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot()));
const int timeout = 4;
QTestEventLoop::instance().enterLoop(timeout);
- QVERIFY(QTestEventLoop::instance().timeout() == false);
+ QVERIFY(!QTestEventLoop::instance().timeout());
}
class PrimaryWindowDialog : public QDialog
@@ -231,7 +231,7 @@ void tst_MacGui::spinBoxArrowButtons()
const QRect lessRect = lessInterface->rect();
const QRect lessLocalRect(colorWidget.mapFromGlobal(lessRect.topLeft()), colorWidget.mapFromGlobal(lessRect.bottomRight()));
const QRect compareRect = lessLocalRect.adjusted(5, 3, -5, -7);
- QVERIFY(noFocus.copy(compareRect) == focus.copy(compareRect));
+ QCOMPARE(noFocus.copy(compareRect), focus.copy(compareRect));
}
QTEST_MAIN(tst_MacGui)
diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST
index 2820457075..4129868022 100644
--- a/tests/auto/other/macnativeevents/BLACKLIST
+++ b/tests/auto/other/macnativeevents/BLACKLIST
@@ -3,9 +3,22 @@
osx
[testMouseEnter]
osx-10.9
+osx-10.8
[testChildDialogInFrontOfModalParent]
osx
[testChildWindowInFrontOfStaysOnTopParentWindow]
osx
[testModifierCtrlWithDontSwapCtrlAndMeta]
osx
+[testMouseMoveLocation]
+osx
+[testMouseLeftDoubleClick]
+osx
+[stressTestMouseLeftDoubleClick]
+osx
+[testMouseDragInside]
+osx
+[testMouseDragOutside]
+osx
+[testMouseDragToNonClientArea]
+osx
diff --git a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
index 6053a649a1..d3b50a5405 100644
--- a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
+++ b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
@@ -56,15 +56,15 @@ static Qt::KeyboardModifiers getModifiersFromQuartzEvent(CGEventRef inEvent)
static void setModifiersFromQNativeEvent(CGEventRef inEvent, const QNativeEvent &event)
{
- CGEventFlags flags = 0;
+ CGEventFlags flags = CGEventFlags(0);
if (event.modifiers.testFlag(Qt::ShiftModifier))
- flags |= kCGEventFlagMaskShift;
+ flags = CGEventFlags(flags | kCGEventFlagMaskShift);
if (event.modifiers.testFlag(Qt::ControlModifier))
- flags |= kCGEventFlagMaskControl;
+ flags = CGEventFlags(flags | kCGEventFlagMaskControl);
if (event.modifiers.testFlag(Qt::AltModifier))
- flags |= kCGEventFlagMaskAlternate;
+ flags = CGEventFlags(flags | kCGEventFlagMaskAlternate);
if (event.modifiers.testFlag(Qt::MetaModifier))
- flags |= kCGEventFlagMaskCommand;
+ flags = CGEventFlags(flags | kCGEventFlagMaskCommand);
CGEventSetFlags(inEvent, flags);
}
@@ -240,7 +240,7 @@ Qt::Native::Status sendNativeMouseMoveEvent_Quartz(const QNativeMouseMoveEvent &
pos.x = event.globalPos.x();
pos.y = event.globalPos.y();
- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
+ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft /* ignored */);
setModifiersFromQNativeEvent(e, event);
CGEventPost(kCGHIDEventTap, e);
CFRelease(e);
@@ -253,7 +253,7 @@ Qt::Native::Status sendNativeMouseButtonEvent_Quartz(const QNativeMouseButtonEve
pos.x = event.globalPos.x();
pos.y = event.globalPos.y();
- CGEventType type = 0;
+ CGEventType type = kCGEventNull;
if (event.button == Qt::LeftButton)
type = (event.clickCount > 0) ? kCGEventLeftMouseDown : kCGEventLeftMouseUp;
else if (event.button == Qt::RightButton)
@@ -261,7 +261,12 @@ Qt::Native::Status sendNativeMouseButtonEvent_Quartz(const QNativeMouseButtonEve
else
type = (event.clickCount > 0) ? kCGEventOtherMouseDown : kCGEventOtherMouseUp;
- CGEventRef e = CGEventCreateMouseEvent(0, type, pos, event.button);
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherSomething, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = (type == kCGEventOtherMouseDown || type == kCGEventOtherMouseUp) ?
+ kCGMouseButtonCenter : kCGMouseButtonLeft;
+
+ CGEventRef e = CGEventCreateMouseEvent(0, type, pos, mouseButton);
setModifiersFromQNativeEvent(e, event);
CGEventSetIntegerValueField(e, kCGMouseEventClickState, event.clickCount);
CGEventPost(kCGHIDEventTap, e);
@@ -275,7 +280,7 @@ Qt::Native::Status sendNativeMouseDragEvent_Quartz(const QNativeMouseDragEvent &
pos.x = event.globalPos.x();
pos.y = event.globalPos.y();
- CGEventType type = 0;
+ CGEventType type = kCGEventNull;
if (event.button == Qt::LeftButton)
type = kCGEventLeftMouseDragged;
else if (event.button == Qt::RightButton)
@@ -283,7 +288,11 @@ Qt::Native::Status sendNativeMouseDragEvent_Quartz(const QNativeMouseDragEvent &
else
type = kCGEventOtherMouseDragged;
- CGEventRef e = CGEventCreateMouseEvent(0, type, pos, event.button);
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherSomething, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = type == kCGEventOtherMouseDragged ? kCGMouseButtonCenter : kCGMouseButtonLeft;
+
+ CGEventRef e = CGEventCreateMouseEvent(0, type, pos, mouseButton);
setModifiersFromQNativeEvent(e, event);
CGEventPost(kCGHIDEventTap, e);
CFRelease(e);
diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
index 5d24655144..d1c5e4a35e 100644
--- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
+++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
@@ -457,8 +457,8 @@ void tst_MacNativeEvents::testModifierCtrl()
QWidget w;
w.show();
- QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]);
- QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]);
+ QCOMPARE(ushort(kControlUnicode), QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText).at(0).unicode());
+ QCOMPARE(ushort(kCommandUnicode), QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText).at(0).unicode());
NativeEventList native;
native.append(new QNativeModifierEvent(Qt::ControlModifier));
@@ -490,8 +490,8 @@ void tst_MacNativeEvents::testModifierCtrlWithDontSwapCtrlAndMeta()
QWidget w;
w.show();
- QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]);
- QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]);
+ QCOMPARE(ushort(kCommandUnicode), QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText).at(0).unicode());
+ QCOMPARE(ushort(kControlUnicode), QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText).at(0).unicode());
NativeEventList native;
native.append(new QNativeModifierEvent(Qt::ControlModifier));
diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp
index 72a4a0ad29..c119fdaa4e 100644
--- a/tests/auto/other/modeltest/modeltest.cpp
+++ b/tests/auto/other/modeltest/modeltest.cpp
@@ -569,7 +569,7 @@ void ModelTest::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto
QVERIFY(topLeft.isValid());
QVERIFY(bottomRight.isValid());
QModelIndex commonParent = bottomRight.parent();
- QVERIFY(topLeft.parent() == commonParent);
+ QCOMPARE(topLeft.parent(), commonParent);
QVERIFY(topLeft.row() <= bottomRight.row());
QVERIFY(topLeft.column() <= bottomRight.column());
int rowCount = model->rowCount(commonParent);
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index ca321fb6fd..7ef830d89f 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -34,6 +34,8 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <QtCore/QDateTime>
+#include <QtCore/QTextStream>
+#include <QtCore/QStandardPaths>
#include <QtCore/private/qiodevice_p.h>
#ifndef QT_NO_BEARERMANAGEMENT
@@ -464,7 +466,7 @@ void tst_NetworkSelfTest::remotePortsOpen()
else
QFAIL(QString("Error connecting to server on port %1: %2").arg(portNumber).arg(socket.errorString()).toLocal8Bit());
}
- QVERIFY(socket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(socket.state(), QAbstractSocket::ConnectedState);
}
static QList<Chat> ftpChat(const QByteArray &userSuffix = QByteArray())
@@ -964,6 +966,25 @@ void tst_NetworkSelfTest::supportsSsl()
#endif
}
+#ifndef QT_NO_PROCESS
+static const QByteArray msgProcessError(const QProcess &process, const char *what)
+{
+ QString result;
+ QTextStream(&result) << what << ": \"" << process.program() << ' '
+ << process.arguments().join(QLatin1Char(' ')) << "\": " << process.errorString();
+ return result.toLocal8Bit();
+}
+
+static void ensureTermination(QProcess &process)
+{
+ if (process.state() == QProcess::Running) {
+ process.terminate();
+ if (!process.waitForFinished(300))
+ process.kill();
+ }
+}
+#endif // !QT_NO_PROCESS
+
void tst_NetworkSelfTest::smbServer()
{
static const char contents[] = "This is 34 bytes. Do not change...";
@@ -981,19 +1002,24 @@ void tst_NetworkSelfTest::smbServer()
QVERIFY(memcmp(buf, contents, strlen(contents)) == 0);
#else
#ifndef QT_NO_PROCESS
+ enum { sambaTimeOutSecs = 5 };
// try to use Samba
- QString progname = "smbclient";
- QProcess smbclient;
- smbclient.start(progname, QIODevice::ReadOnly);
- if (!smbclient.waitForStarted(2000))
+ const QString progname = "smbclient";
+ const QString binary = QStandardPaths::findExecutable(progname);
+ if (binary.isEmpty())
QSKIP("Could not find smbclient (from Samba), cannot continue testing");
- if (!smbclient.waitForFinished(2000) || smbclient.exitStatus() != QProcess::NormalExit)
- QSKIP("smbclient isn't working, cannot continue testing");
- smbclient.close();
// try listing the server
- smbclient.start(progname, QStringList() << "-g" << "-N" << "-L" << QtNetworkSettings::winServerName(), QIODevice::ReadOnly);
- QVERIFY(smbclient.waitForFinished(5000));
+ const QStringList timeOutArguments = QStringList()
+ << "--timeout" << QString::number(sambaTimeOutSecs);
+ QStringList arguments = timeOutArguments;
+ arguments << "-g" << "-N" << "-L" << QtNetworkSettings::winServerName();
+ QProcess smbclient;
+ smbclient.start(binary, arguments, QIODevice::ReadOnly);
+ QVERIFY2(smbclient.waitForStarted(), msgProcessError(smbclient, "Unable to start"));
+ const bool listFinished = smbclient.waitForFinished((1 + sambaTimeOutSecs) * 1000);
+ ensureTermination(smbclient);
+ QVERIFY2(listFinished, msgProcessError(smbclient, "Listing servers timed out"));
if (smbclient.exitStatus() != QProcess::NormalExit)
QSKIP("smbclient crashed");
QVERIFY2(smbclient.exitCode() == 0, "Test server not found");
@@ -1008,9 +1034,13 @@ void tst_NetworkSelfTest::smbServer()
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PAGER", "/bin/cat"); // just in case
smbclient.setProcessEnvironment(env);
- smbclient.start(progname, QStringList() << "-N" << "-c" << "more test.pri"
- << QString("\\\\%1\\testshare").arg(QtNetworkSettings::winServerName()), QIODevice::ReadOnly);
- QVERIFY(smbclient.waitForFinished(5000));
+ arguments = timeOutArguments;
+ arguments << "-N" << "-c" << "more test.pri"
+ << ("\\\\" + QtNetworkSettings::winServerName() + "\\testshare");
+ smbclient.start(binary, arguments, QIODevice::ReadOnly);
+ const bool fileFinished = smbclient.waitForFinished((1 + sambaTimeOutSecs) * 1000);
+ ensureTermination(smbclient);
+ QVERIFY2(fileFinished, msgProcessError(smbclient, "Timed out"));
if (smbclient.exitStatus() != QProcess::NormalExit)
QSKIP("smbclient crashed");
QVERIFY2(smbclient.exitCode() == 0, "File //qt-test-server/testshare/test.pri not found");
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 4f891fcda0..62c2c0a916 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -162,16 +162,6 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
return true;
}
-static inline int indexOfChild(QAccessibleInterface *parentInterface, QWidget *childWidget)
-{
- if (!parentInterface || !childWidget)
- return -1;
- QAccessibleInterface *childInterface(QAccessible::queryAccessibleInterface(childWidget));
- if (!childInterface)
- return -1;
- return parentInterface->indexOfChild(childInterface);
-}
-
#define EXPECT(cond) \
do { \
if (!errorAt && !(cond)) { \
@@ -462,15 +452,15 @@ void tst_QAccessibility::statesStructTest()
QVERIFY(s1.modal == 0);
QAccessible::State s2;
- QVERIFY(s2 == s1);
+ QCOMPARE(s2, s1);
s2.busy = true;
QVERIFY(!(s2 == s1));
s1.busy = true;
- QVERIFY(s2 == s1);
+ QCOMPARE(s2, s1);
s1 = QAccessible::State();
QVERIFY(!(s2 == s1));
s1 = s2;
- QVERIFY(s2 == s1);
+ QCOMPARE(s2, s1);
QVERIFY(s1.busy == 1);
}
@@ -533,9 +523,9 @@ void tst_QAccessibility::navigateHierarchy()
QVERIFY(ifaceW->isValid());
QAccessibleInterface *target = ifaceW->child(14);
- QVERIFY(target == 0);
+ QVERIFY(!target);
target = ifaceW->child(-1);
- QVERIFY(target == 0);
+ QVERIFY(!target);
target = ifaceW->child(0);
QAccessibleInterface *interfaceW1(ifaceW->child(0));
QVERIFY(target);
@@ -551,7 +541,7 @@ void tst_QAccessibility::navigateHierarchy()
QCOMPARE(target->object(), (QObject*)w3);
QAccessibleInterface *child = target->child(1);
- QVERIFY(child == 0);
+ QVERIFY(!child);
child = target->child(0);
QVERIFY(child != 0);
QVERIFY(child->isValid());
@@ -969,7 +959,7 @@ void tst_QAccessibility::mainWindowTest()
QWindow window;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
// We currently don't have an accessible interface for QWindow
// the active state is either in the QMainWindow or QQuickView
@@ -1313,7 +1303,7 @@ void tst_QAccessibility::tabTest()
QCOMPARE(child1->text(QAccessible::Description), QLatin1String("Cool tool tip"));
QCOMPARE(child1->text(QAccessible::Help), QLatin1String("I don't know"));
- QVERIFY((child1->state().invisible) == false);
+ QVERIFY(!(child1->state().invisible));
tabBar->hide();
QCoreApplication::processEvents();
@@ -1660,7 +1650,7 @@ void tst_QAccessibility::spinBoxTest()
// make sure that the line edit is not there
const int numChildren = interface->childCount();
QCOMPARE(numChildren, 0);
- QVERIFY(interface->child(0) == Q_NULLPTR);
+ QVERIFY(!interface->child(0));
QVERIFY(interface->valueInterface());
QCOMPARE(interface->valueInterface()->currentValue().toInt(), 3);
@@ -1746,6 +1736,13 @@ static bool fuzzyRectCompare(const QRect &a, const QRect &b)
&& qAbs(delta.right()) <= MAX_ACCEPTABLE_DELTA && qAbs(delta.bottom()) <= MAX_ACCEPTABLE_DELTA;
}
+static QByteArray msgRectMismatch(const QRect &a, const QRect &b)
+{
+ QString result;
+ QDebug(&result) << a << "!=" << b;
+ return result.toLocal8Bit();
+}
+
void tst_QAccessibility::textEditTest()
{
for (int pass = 0; pass < 2; ++pass) {
@@ -1791,16 +1788,24 @@ void tst_QAccessibility::textEditTest()
int offset = 10;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("d"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual10 = textIface->characterRect(offset);
+ const QRect expected10 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual10, expected10), msgRectMismatch(actual10, expected10).constData());
offset = 13;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("H"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual13 = textIface->characterRect(offset);
+ const QRect expected13 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual13, expected13), msgRectMismatch(actual13, expected13).constData());
offset = 21;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("y"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual21 = textIface->characterRect(offset);
+ const QRect expected21 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual21, expected21), msgRectMismatch(actual21, expected21).constData());
offset = 32;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("I"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual32 = textIface->characterRect(offset);
+ const QRect expected32 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual32, expected32), msgRectMismatch(actual32, expected32).constData());
QTestAccessibility::clearEvents();
@@ -2481,7 +2486,7 @@ void tst_QAccessibility::groupBoxTest()
QCOMPARE(iface->text(QAccessible::Name), QLatin1String("Test QGroupBox"));
QCOMPARE(iface->text(QAccessible::Description), QLatin1String("This group box will be used to test accessibility"));
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations = rButtonIface->relations();
- QVERIFY(relations.size() == 1);
+ QCOMPARE(relations.size(), 1);
QPair<QAccessibleInterface*, QAccessible::Relation> relation = relations.first();
QCOMPARE(relation.first->object(), groupBox);
QCOMPARE(relation.second, QAccessible::Label);
@@ -3526,13 +3531,13 @@ void tst_QAccessibility::dockWidgetTest()
QPoint buttonPoint = pb2->mapToGlobal(QPoint(pb2->width()/2, pb2->height()/2));
QAccessibleInterface *childAt = accDock2->childAt(buttonPoint.x(), buttonPoint.y());
QVERIFY(childAt);
- QVERIFY(childAt->object() == pb2);
+ QCOMPARE(childAt->object(), pb2);
QWidget *close1 = qobject_cast<QWidget*>(dock1Close->object());
QPoint close1ButtonPoint = close1->mapToGlobal(QPoint(close1->width()/2, close1->height()/2));
QAccessibleInterface *childAt2 = accDock1->childAt(close1ButtonPoint.x(), close1ButtonPoint.y());
QVERIFY(childAt2);
- QVERIFY(childAt2->object() == close1);
+ QCOMPARE(childAt2->object(), close1);
// custom title bar widget
QDockWidget *dock3 = new QDockWidget(mw);
diff --git a/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro b/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro
index 2ea54ab603..10d950541a 100644
--- a/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro
+++ b/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro
@@ -1,8 +1,5 @@
CONFIG += testcase
-# This is temporary to start running the test as part of normal CI.
-CONFIG += insignificant_test # QTBUG-27732
-
include($$QT_SOURCE_TREE/src/platformsupport/accessibility/accessibility.pri)
include($$QT_SOURCE_TREE/src/platformsupport/linuxaccessibility/linuxaccessibility.pri)
diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
index 5f0eed5afe..4885a5f037 100644
--- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
+++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
@@ -84,7 +84,15 @@ class tst_QAccessibilityLinux : public QObject
Q_OBJECT
public:
- tst_QAccessibilityLinux() : m_window(0), root(0), rootApplication(0), mainWindow(0) {}
+ tst_QAccessibilityLinux() : m_window(0), root(0), rootApplication(0), mainWindow(0)
+ {
+ qputenv("QT_LINUX_ACCESSIBILITY_ALWAYS_ON", QByteArrayLiteral("1"));
+ dbus = new DBusConnection();
+ }
+ ~tst_QAccessibilityLinux()
+ {
+ delete dbus;
+ }
private slots:
void initTestCase();
@@ -112,7 +120,7 @@ private:
QDBusInterface *rootApplication;
QDBusInterface *mainWindow;
- DBusConnection dbus;
+ DBusConnection *dbus;
};
// helper to find children of a dbus object
@@ -149,7 +157,7 @@ QString tst_QAccessibilityLinux::getParent(QDBusInterface *interface)
// helper to get dbus object
QDBusInterface *tst_QAccessibilityLinux::getInterface(const QString &path, const QString &interfaceName)
{
- return new QDBusInterface(address, path, interfaceName, dbus.connection(), this);
+ return new QDBusInterface(address, path, interfaceName, dbus->connection(), this);
}
void tst_QAccessibilityLinux::initTestCase()
@@ -158,14 +166,22 @@ void tst_QAccessibilityLinux::initTestCase()
qApp->setStyle("fusion");
qApp->setApplicationName("tst_QAccessibilityLinux app");
- // Pretend we are a screen reader
+
+ // trigger launching of at-spi if it isn't running already
QDBusConnection c = QDBusConnection::sessionBus();
OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(QStringLiteral("org.a11y.Bus"), QStringLiteral("/org/a11y/bus"), c, this);
- a11yStatus->setScreenReaderEnabled(true);
+ // don't care about the result, calling any function on "org.a11y.Bus" will launch the service
+ a11yStatus->isEnabled();
+ for (int i = 0; i < 5; ++i) {
+ if (!dbus->isEnabled())
+ QTest::qWait(100);
+ }
- QTRY_VERIFY(dbus.isEnabled());
- QTRY_VERIFY(dbus.connection().isConnected());
- address = dbus.connection().baseService().toLatin1().data();
+ if (!dbus->isEnabled())
+ QSKIP("Could not connect to AT-SPI, make sure lib atspi2 is installed.");
+ QTRY_VERIFY(dbus->isEnabled());
+ QTRY_VERIFY(dbus->connection().isConnected());
+ address = dbus->connection().baseService().toLatin1().data();
QVERIFY(!address.isEmpty());
m_window = new AccessibleTestWindow();
@@ -185,7 +201,7 @@ void tst_QAccessibilityLinux::cleanupTestCase()
void tst_QAccessibilityLinux::registerDbus()
{
- QVERIFY(dbus.connection().isConnected());
+ QVERIFY(dbus->connection().isConnected());
root = getInterface("/org/a11y/atspi/accessible/root",
"org.a11y.atspi.Accessible");
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index 3056904dcf..65dbff4f92 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -199,7 +199,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
CFRange cfRange;
NSRange range = NSMakeRange(0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCFRangeType, &cfRange))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCFRangeType), &cfRange))
qDebug() << "Could not get CFRange value out of AXValueRef";
else if (cfRange.location < 0 || cfRange.length < 0)
qDebug() << "Cannot convert CFRange with negative location or length to NSRange";
@@ -217,7 +217,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
+ (NSRect)_rectFromValue:(CFTypeRef)value
{
NSRect rect = NSMakeRect(0, 0, 0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCGRectType, reinterpret_cast<CGRect*>(&rect)))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGRectType), reinterpret_cast<CGRect*>(&rect)))
{
qDebug() << "Could not get CGRect value out of AXValueRef";
}
@@ -227,7 +227,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
+ (NSPoint)_pointFromValue:(CFTypeRef)value
{
NSPoint point = NSMakePoint(0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCGPointType, reinterpret_cast<CGPoint*>(&point)))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGPointType), reinterpret_cast<CGPoint*>(&point)))
{
qDebug() << "Could not get CGPoint value out of AXValueRef";
}
@@ -237,7 +237,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
+ (NSSize)_sizeFromValue:(CFTypeRef)value
{
NSSize size = NSMakeSize(0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCGSizeType, reinterpret_cast<CGSize*>(&size)))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGSizeType), reinterpret_cast<CGSize*>(&size)))
{
qDebug() << "Could not get CGSize value out of AXValueRef";
}
@@ -308,7 +308,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
- (CFTypeRef)_attributeValue:(CFStringRef)attribute forRange:(NSRange)aRange
{
CFRange cfRange = CFRangeMake(aRange.location, aRange.length);
- AXValueRef range = AXValueCreate(kAXValueCFRangeType, &cfRange);
+ AXValueRef range = AXValueCreate(AXValueType(kAXValueCFRangeType), &cfRange);
CFTypeRef value = [self _attributeValue:attribute forParameter:range];
CFRelease(range);
return value;
@@ -324,7 +324,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
- (CFTypeRef)_attributeValue:(CFStringRef)attribute forPoint:(CGPoint)aPoint
{
- AXValueRef point = AXValueCreate(kAXValueCGPointType, &aPoint);
+ AXValueRef point = AXValueCreate(AXValueType(kAXValueCGPointType), &aPoint);
CFTypeRef value = [self _attributeValue:attribute forParameter:point];
CFRelease(point);
return value;
diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
index a9234b7060..1428a63123 100644
--- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
@@ -173,7 +173,7 @@ void tst_QComplexText::bidiCursor_qtbug2795()
qreal x2 = line2.cursorToX(0) - line2.cursorToX(str.size());
// The cursor should remain at the same position after a digit is appended
- QVERIFY(x1 == x2);
+ QCOMPARE(x1, x2);
}
void tst_QComplexText::bidiCursorMovement_data()
diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp
index bbd787bf38..92127fcd5c 100644
--- a/tests/auto/other/toolsupport/tst_toolsupport.cpp
+++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp
@@ -111,10 +111,10 @@ void tst_toolsupport::offsets_data()
}
#ifdef Q_OS_LINUX
- if (sizeof(void *) == 8) {
+ {
QTestData &data = QTest::newRow("QFilePrivate::fileName")
<< pmm_to_offsetof(&QFilePrivate::fileName);
- data << -1 << 248;
+ data << 168 << 248;
}
#endif
diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
index b161dccb88..acb0d28c6b 100644
--- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
+++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
@@ -132,7 +132,7 @@ void compareScreenshots(const QString &image1, const QString &image2)
//screenShot.save("scr2.png", "PNG");
//original.save("orig1.png", "PNG");
- QVERIFY(original == screenShot);
+ QCOMPARE(original, screenShot);
}
void takeScreenShot(const QString filename)
diff --git a/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp b/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp
index 598abca43b..f3b865ed92 100644
--- a/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp
+++ b/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp
@@ -57,7 +57,6 @@ void tst_QPrintDevice::basics()
if (defaultId.isEmpty()) {
qDebug() << "No default printer found";
} else {
- qDebug() << "Default Printer ID :" << defaultId;
QVERIFY(ps->availablePrintDeviceIds().contains(defaultId));
}
@@ -66,7 +65,9 @@ void tst_QPrintDevice::basics()
// Just exercise the api for now as we don't know what is installed
foreach (const QString id, ps->availablePrintDeviceIds()) {
QPrintDevice printDevice = ps->createPrintDevice(id);
- qDebug() << "Created printer" << id;
+ const char quote = id == defaultId ? '*' : '"';
+ qDebug().noquote().nospace() << "\nCreated printer " << quote << id
+ << quote << ":\n" << printDevice << '\n';
QCOMPARE(printDevice.isValid(), true);
printDevice.id();
printDevice.name();
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index c256d9ba82..aa72be3ea8 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -425,12 +425,12 @@ void tst_QPrinter::outputFormatFromSuffix()
if (QPrinterInfo::availablePrinters().size() == 0)
QSKIP("No printers available.");
QPrinter p;
- QVERIFY(p.outputFormat() == QPrinter::NativeFormat);
+ QCOMPARE(p.outputFormat(), QPrinter::NativeFormat);
p.setOutputFileName("test.pdf");
TempFileCleanup tmpFile("test.pdf");
- QVERIFY(p.outputFormat() == QPrinter::PdfFormat);
+ QCOMPARE(p.outputFormat(), QPrinter::PdfFormat);
p.setOutputFileName(QString());
- QVERIFY(p.outputFormat() == QPrinter::NativeFormat);
+ QCOMPARE(p.outputFormat(), QPrinter::NativeFormat);
}
void tst_QPrinter::testPageMargins_data()
@@ -1090,12 +1090,12 @@ void tst_QPrinter::doubleSidedPrinting()
QPrinter native;
if (native.outputFormat() == QPrinter::NativeFormat) {
// Test default
- QPrinterInfo printerInfo;
+ QPrinterInfo printerInfo(native);
bool expected = (printerInfo.defaultDuplexMode() != QPrinter::DuplexNone);
- QCOMPARE(native.doubleSidedPrinting(), false);
+ QCOMPARE(native.doubleSidedPrinting(), expected);
- // Test set/get
- expected = (printerInfo.supportedDuplexModes().count() > 1);
+ // Test set/get, changing the expected value if possible
+ expected = expected ? false : (printerInfo.supportedDuplexModes().count() > 1);
native.setDoubleSidedPrinting(expected);
QCOMPARE(native.doubleSidedPrinting(), expected);
diff --git a/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb b/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb
index f388f192ac..f388f192ac 100755..100644
--- a/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb
+++ b/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb
Binary files differ
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
index c499aed481..fe8a3689b0 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
@@ -261,8 +261,8 @@ public:
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org" );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3307 );
-// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1
-// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux
+// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3308, "CLIENT_COMPRESS=1" ); // MySQL 4.1.1
+// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3309, "CLIENT_COMPRESS=1" ); // MySQL 5.0.18 Linux
// addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.qt-project.org" ); // MySQL 5.1.36 Windows
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql41.qt-project.org" ); // MySQL 4.1.22-2.el4 linux
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
index 1993f23672..83cf0394f9 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
@@ -1569,11 +1569,11 @@ void tst_QSqlDatabase::ibase_numericFields()
QCOMPARE(q.value(2).toString(), QString("%1").arg(num2));
QCOMPARE(QString("%1").arg(q.value(3).toDouble()), QString("%1").arg(num3));
QCOMPARE(QString("%1").arg(q.value(4).toDouble()), QString("%1").arg(num4));
- QVERIFY(q.value(0).type() == QVariant::Int);
- QVERIFY(q.value(1).type() == QVariant::Double);
- QVERIFY(q.value(2).type() == QVariant::Double);
- QVERIFY(q.value(3).type() == QVariant::Double);
- QVERIFY(q.value(4).type() == QVariant::Double);
+ QCOMPARE(q.value(0).type(), QVariant::Int);
+ QCOMPARE(q.value(1).type(), QVariant::Double);
+ QCOMPARE(q.value(2).type(), QVariant::Double);
+ QCOMPARE(q.value(3).type(), QVariant::Double);
+ QCOMPARE(q.value(4).type(), QVariant::Double);
QCOMPARE(q.record().field(1).length(), 2);
QCOMPARE(q.record().field(1).precision(), 1);
@@ -1583,16 +1583,16 @@ void tst_QSqlDatabase::ibase_numericFields()
QCOMPARE(q.record().field(3).precision(), 3);
QCOMPARE(q.record().field(4).length(), 18);
QCOMPARE(q.record().field(4).precision(), 4);
- QVERIFY(q.record().field(0).requiredStatus() == QSqlField::Required);
- QVERIFY(q.record().field(1).requiredStatus() == QSqlField::Optional);
+ QCOMPARE(q.record().field(0).requiredStatus(), QSqlField::Required);
+ QCOMPARE(q.record().field(1).requiredStatus(), QSqlField::Optional);
}
QSqlRecord r = db.record(tableName);
- QVERIFY(r.field(0).type() == QVariant::Int);
- QVERIFY(r.field(1).type() == QVariant::Double);
- QVERIFY(r.field(2).type() == QVariant::Double);
- QVERIFY(r.field(3).type() == QVariant::Double);
- QVERIFY(r.field(4).type() == QVariant::Double);
+ QCOMPARE(r.field(0).type(), QVariant::Int);
+ QCOMPARE(r.field(1).type(), QVariant::Double);
+ QCOMPARE(r.field(2).type(), QVariant::Double);
+ QCOMPARE(r.field(3).type(), QVariant::Double);
+ QCOMPARE(r.field(4).type(), QVariant::Double);
QCOMPARE(r.field(1).length(), 2);
QCOMPARE(r.field(1).precision(), 1);
QCOMPARE(r.field(2).length(), 5);
@@ -1601,8 +1601,8 @@ void tst_QSqlDatabase::ibase_numericFields()
QCOMPARE(r.field(3).precision(), 3);
QCOMPARE(r.field(4).length(), 18);
QCOMPARE(r.field(4).precision(), 4);
- QVERIFY(r.field(0).requiredStatus() == QSqlField::Required);
- QVERIFY(r.field(1).requiredStatus() == QSqlField::Optional);
+ QCOMPARE(r.field(0).requiredStatus(), QSqlField::Required);
+ QCOMPARE(r.field(1).requiredStatus(), QSqlField::Optional);
}
void tst_QSqlDatabase::ibase_fetchBlobs()
@@ -2086,7 +2086,7 @@ void tst_QSqlDatabase::eventNotificationIBase()
QCOMPARE(spy.count(), 1);
QList<QVariant> arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toString() == procedureName);
+ QCOMPARE(arguments.at(0).toString(), procedureName);
QVERIFY_SQL(*driver, unsubscribeFromNotification(procedureName));
q.exec(QString("DROP PROCEDURE %1").arg(procedureName));
}
diff --git a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
index 7a12f66452..70e09a2b80 100644
--- a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
+++ b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
@@ -160,7 +160,7 @@ void tst_QSqlError::operators()
error2.setType(QSqlError::NoError);
error3.setType(QSqlError::UnknownError);
- QVERIFY(error1 == error2);
+ QCOMPARE(error1, error2);
QVERIFY(error1 != error3);
}
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 61586eb841..b98ab68ae9 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -241,6 +241,10 @@ private slots:
void aggregateFunctionTypes_data() { generic_data(); }
void aggregateFunctionTypes();
+
+ void integralTypesMysql_data() { generic_data("QMYSQL"); }
+ void integralTypesMysql();
+
private:
// returns all database connections
void generic_data(const QString &engine=QString());
@@ -3974,5 +3978,65 @@ void tst_QSqlQuery::aggregateFunctionTypes()
}
}
+template<typename T>
+void runIntegralTypesMysqlTest(QSqlDatabase &db, const QString &tableName, const QString &type, const bool withPreparedStatement,
+ const T min = std::numeric_limits<T>::min(), const T max = std::numeric_limits<T>::max())
+{
+ QSqlQuery q(db);
+ QVERIFY_SQL(q, exec("DROP TABLE IF EXISTS " + tableName));
+ QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id " + type + ")"));
+
+ const int steps = 20;
+ const T increment = max / steps - min / steps;
+
+ // insert some values
+ QVector<T> values;
+ values.resize(steps);
+ T v = min;
+ if (withPreparedStatement) {
+ QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (id) VALUES (?)"));
+ }
+ for (int i = 0; i < values.size(); ++i) {
+ if (withPreparedStatement) {
+ q.bindValue(0, v);
+ QVERIFY_SQL(q, exec());
+ } else {
+ QVERIFY_SQL(q, exec("INSERT INTO " + tableName + " (id) VALUES (" + QString::number(v) + ")"));
+ }
+ values[i] = v;
+ v += increment;
+ }
+
+ // ensure we can read them back properly
+ QVERIFY_SQL(q, exec("SELECT id FROM " + tableName));
+ QVector<T> actualValues;
+ actualValues.reserve(values.size());
+ while (q.next()) {
+ actualValues << q.value(0).value<T>();
+ }
+ QCOMPARE(actualValues, values);
+}
+
+void tst_QSqlQuery::integralTypesMysql()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ for (int i = 0; i < 2; ++i) {
+ const bool withPreparedStatement = (i == 1);
+ runIntegralTypesMysqlTest<char>(db, "tinyIntTest", "TINYINT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned char>(db, "unsignedTinyIntTest", "TINYINT UNSIGNED", withPreparedStatement);
+ runIntegralTypesMysqlTest<char>(db, "smallIntTest", "SMALLINT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned char>(db, "unsignedSmallIntTest", "SMALLINT UNSIGNED", withPreparedStatement);
+ runIntegralTypesMysqlTest<int>(db, "mediumIntTest", "MEDIUMINT", withPreparedStatement, -(1 << 23), (1 << 23) - 1);
+ runIntegralTypesMysqlTest<unsigned int>(db, "unsignedMediumIntTest", "MEDIUMINT UNSIGNED", withPreparedStatement, 0, (1 << 24) - 1);
+ runIntegralTypesMysqlTest<int>(db, "intTest", "INT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned int>(db, "unsignedIntTest", "INT UNSIGNED", withPreparedStatement);
+ runIntegralTypesMysqlTest<long long>(db, "bigIntTest", "BIGINT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned long long>(db, "unsignedBigIntTest", "BIGINT UNSIGNED", withPreparedStatement);
+ }
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
index ae2f8dde5f..52baa0070b 100644
--- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
+++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
@@ -593,7 +593,7 @@ public:
connect(this, SIGNAL(modelReset()), this, SLOT(modelResetSlot()));
}
- void testme()
+ void testNested()
{
// Only the outermost beginResetModel/endResetModel should
// emit signals.
@@ -618,6 +618,14 @@ public:
QCOMPARE(gotReset, true);
}
+ void testClear() // QTBUG-49404: Basic test whether clear() emits signals.
+ {
+ gotAboutToBeReset = gotReset = false;
+ clear();
+ QVERIFY(gotAboutToBeReset);
+ QVERIFY(gotReset);
+ }
+
private slots:
void modelAboutToBeResetSlot() { gotAboutToBeReset = true; }
void modelResetSlot() { gotReset = true; }
@@ -634,7 +642,8 @@ void tst_QSqlQueryModel::nestedResets()
CHECK_DATABASE(db);
NestedResetsTest t;
- t.testme();
+ t.testClear();
+ t.testNested();
}
// For task 180617
diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
index 71ec2b6588..3702631275 100644
--- a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
+++ b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
@@ -858,7 +858,7 @@ static void testRevert(QSqlRelationalTableModel &model)
/* Now revert the newly inserted rows */
model.revertAll();
- QVERIFY(model.rowCount() == initialRowCount);
+ QCOMPARE(model.rowCount(), initialRowCount);
/* Insert rows again */
QVERIFY(model.insertRows(4, 4));
@@ -1026,7 +1026,7 @@ void tst_QSqlRelationalTableModel::invalidData()
QCOMPARE(model.data(model.index(0, 2)).toString(), QString("herr"));
//try to set data in non valid index
- QVERIFY(model.setData(model.index(0,10),5) == false);
+ QVERIFY(!model.setData(model.index(0,10),5));
//same test with LeftJoin mode
model.setJoinMode(QSqlRelationalTableModel::LeftJoin);
@@ -1037,7 +1037,7 @@ void tst_QSqlRelationalTableModel::invalidData()
QCOMPARE(model.data(model.index(0, 2)).toString(), QString("herr"));
//try to set data in non valid index
- QVERIFY(model.setData(model.index(0,10),5) == false);
+ QVERIFY(!model.setData(model.index(0,10),5));
}
void tst_QSqlRelationalTableModel::relationModel()
@@ -1051,20 +1051,20 @@ void tst_QSqlRelationalTableModel::relationModel()
model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(0) == NULL);
- QVERIFY(model.relationModel(1) == NULL);
+ QVERIFY(!model.relationModel(0));
+ QVERIFY(!model.relationModel(1));
QVERIFY(model.relationModel(2) != NULL);
- QVERIFY(model.relationModel(3) == NULL);
- QVERIFY(model.relationModel(4) == NULL);
+ QVERIFY(!model.relationModel(3));
+ QVERIFY(!model.relationModel(4));
model.setRelation(3, QSqlRelation(reltest4, "id", "name"));
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(0) == NULL);
- QVERIFY(model.relationModel(1) == NULL);
+ QVERIFY(!model.relationModel(0));
+ QVERIFY(!model.relationModel(1));
QVERIFY(model.relationModel(2) != NULL);
QVERIFY(model.relationModel(3) != NULL);
- QVERIFY(model.relationModel(4) == NULL);
+ QVERIFY(!model.relationModel(4));
QSqlTableModel *rel_model = model.relationModel(2);
QCOMPARE(rel_model->data(rel_model->index(0,1)).toString(), QString("herr"));
@@ -1073,11 +1073,11 @@ void tst_QSqlRelationalTableModel::relationModel()
model.setJoinMode(QSqlRelationalTableModel::LeftJoin);
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(0) == NULL);
- QVERIFY(model.relationModel(1) == NULL);
+ QVERIFY(!model.relationModel(0));
+ QVERIFY(!model.relationModel(1));
QVERIFY(model.relationModel(2) != NULL);
QVERIFY(model.relationModel(3) != NULL);
- QVERIFY(model.relationModel(4) == NULL);
+ QVERIFY(!model.relationModel(4));
QSqlTableModel *rel_model2 = model.relationModel(2);
QCOMPARE(rel_model2->data(rel_model->index(0,1)).toString(), QString("herr"));
@@ -1487,13 +1487,13 @@ void tst_QSqlRelationalTableModel::selectAfterUpdate()
model.setTable(reltest1);
model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(2)->rowCount() == 2);
+ QCOMPARE(model.relationModel(2)->rowCount(), 2);
{
QSqlQuery q(db);
QVERIFY_SQL(q, exec("insert into " + reltest2 + " values(3, 'mrs')"));
model.relationModel(2)->select();
}
- QVERIFY(model.relationModel(2)->rowCount() == 3);
+ QCOMPARE(model.relationModel(2)->rowCount(), 3);
QVERIFY(model.setData(model.index(0,2), 3));
QVERIFY(model.submitAll());
QCOMPARE(model.data(model.index(0,2)), QVariant("mrs"));
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
index 9c351f4657..2ace79973b 100644
--- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -533,7 +533,7 @@ void tst_QSqlTableModel::setData()
idx = model.index(0, 0);
QVERIFY_SQL(model, setData(idx, QVariant(QVariant::Int)));
val = model.data(idx);
- QVERIFY(val == QVariant(QVariant::Int));
+ QCOMPARE(val, QVariant(QVariant::Int));
QVERIFY(val.isNull());
QVERIFY_SQL(model, isDirty(idx));
QVERIFY_SQL(model, submitAll());
@@ -560,13 +560,13 @@ void tst_QSqlTableModel::setData()
// initial state
idx = model.index(0, 0);
QSqlRecord rec = model.record(0);
- QVERIFY(rec.value(0) == QVariant(QVariant::Int));
+ QCOMPARE(rec.value(0), QVariant(QVariant::Int));
QVERIFY(rec.isNull(0));
QVERIFY(!rec.isGenerated(0));
// unchanged value, but causes column to be included in INSERT
QVERIFY_SQL(model, setData(idx, QVariant(QVariant::Int)));
rec = model.record(0);
- QVERIFY(rec.value(0) == QVariant(QVariant::Int));
+ QCOMPARE(rec.value(0), QVariant(QVariant::Int));
QVERIFY(rec.isNull(0));
QVERIFY(rec.isGenerated(0));
QVERIFY_SQL(model, submitAll());
@@ -1136,8 +1136,8 @@ void tst_QSqlTableModel::removeRows()
QVERIFY_SQL(model, removeRows(0, 1));
QVERIFY_SQL(model, removeRows(1, 1));
QCOMPARE(beforeDeleteSpy.count(), 2);
- QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 0);
- QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 1);
+ QCOMPARE(beforeDeleteSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(beforeDeleteSpy.at(1).at(0).toInt(), 1);
// deleted rows shown as empty until select
QCOMPARE(model.rowCount(), 3);
QCOMPARE(model.data(model.index(0, 1)).toString(), QString(""));
@@ -1172,11 +1172,11 @@ void tst_QSqlTableModel::removeRows()
QCOMPARE(headerDataChangedSpy.at(1).at(1).toInt(), 0);
QCOMPARE(headerDataChangedSpy.at(1).at(2).toInt(), 0);
QCOMPARE(model.rowCount(), 3);
- QVERIFY(beforeDeleteSpy.count() == 0);
+ QCOMPARE(beforeDeleteSpy.count(), 0);
QVERIFY(model.submitAll());
- QVERIFY(beforeDeleteSpy.count() == 2);
- QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 0);
- QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 1);
+ QCOMPARE(beforeDeleteSpy.count(), 2);
+ QCOMPARE(beforeDeleteSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(beforeDeleteSpy.at(1).at(0).toInt(), 1);
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(model.index(0, 1)).toString(), QString("vohi"));
}
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
index 6b94dfb529..6446fec510 100644
--- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
@@ -124,6 +124,8 @@ class tst_Cmptest: public QObject
Q_OBJECT
private slots:
+ void compare_unregistered_enums();
+ void compare_registered_enums();
void compare_boolfuncs();
void compare_pointerfuncs();
void compare_tostring();
@@ -138,8 +140,26 @@ private slots:
void compareQImages();
void compareQImages_data();
#endif
+ void verify();
+ void verify2();
+ void tryVerify();
+ void tryVerify2();
};
+enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 };
+
+void tst_Cmptest::compare_unregistered_enums()
+{
+ QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue1);
+ QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue2);
+}
+
+void tst_Cmptest::compare_registered_enums()
+{
+ QCOMPARE(Qt::ArrowCursor, Qt::ArrowCursor);
+ QCOMPARE(Qt::ArrowCursor, Qt::BusyCursor);
+}
+
static bool boolfunc() { return true; }
static bool boolfunc2() { return true; }
@@ -371,7 +391,36 @@ void tst_Cmptest::compareQImages()
QCOMPARE(opA, opB);
}
-#endif
+#endif // QT_GUI_LIB
+
+static int opaqueFunc()
+{
+ return 42;
+}
+
+void tst_Cmptest::verify()
+{
+ QVERIFY(opaqueFunc() > 2);
+ QVERIFY(opaqueFunc() < 2);
+}
+
+void tst_Cmptest::verify2()
+{
+ QVERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData());
+ QVERIFY2(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData());
+}
+
+void tst_Cmptest::tryVerify()
+{
+ QTRY_VERIFY(opaqueFunc() > 2);
+ QTRY_VERIFY_WITH_TIMEOUT(opaqueFunc() < 2, 1);
+}
+
+void tst_Cmptest::tryVerify2()
+{
+ QTRY_VERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData());
+ QTRY_VERIFY2_WITH_TIMEOUT(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData(), 1);
+}
QTEST_MAIN(tst_Cmptest)
#include "tst_cmptest.moc"
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index 4a376b5c8b..36929cec6b 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -5,18 +5,32 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_unregistered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="154">
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_registered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="160">
+ <Description><![CDATA[Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_boolfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_pointerfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_tostring">
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(int,123)
@@ -25,25 +39,25 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both invalid]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[null hash, invalid]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QVariantHash)
Expected (expected): QVariant()]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[string, null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[both non-null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQStringLists">
<Incident type="pass" file="" line="0">
@@ -52,65 +66,65 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal lists]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
-<Incident type="fail" file="tst_cmptest.cpp" line="320">
+<Incident type="fail" file="tst_cmptest.cpp" line="332">
<Description><![CDATA[Compared lists differ at index 2.
Actual (int1): 3
Expected (int2): 4]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListDouble">
-<Incident type="fail" file="tst_cmptest.cpp" line="327">
+<Incident type="fail" file="tst_cmptest.cpp" line="339">
<Description><![CDATA[Compared lists differ at index 0.
Actual (double1): 1.5
Expected (double2): 1]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQPixmaps">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 0
@@ -119,29 +133,29 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQImages">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 0
@@ -150,26 +164,50 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QImages differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different format]]></DataTag>
<Description><![CDATA[Compared QImages differ in format.
Actual (opA): 6
Expected (opB): 3]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify">
+<Incident type="fail" file="tst_cmptest.cpp" line="404">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="410">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify">
+<Incident type="fail" file="tst_cmptest.cpp" line="416">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="422">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index 9e8c56ed99..70c54704f9 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -1,91 +1,105 @@
********* Start testing of tst_Cmptest *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Cmptest::initTestCase()
+FAIL! : tst_Cmptest::compare_unregistered_enums() Compared values are not the same
+ Loc: [tst_cmptest.cpp(154)]
+FAIL! : tst_Cmptest::compare_registered_enums() Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor
+ Loc: [tst_cmptest.cpp(160)]
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_pointerfuncs()
FAIL! : tst_Cmptest::compare_tostring(int, string) Compared values are not the same
Actual (actual) : QVariant(int,123)
Expected (expected): QVariant(QString,hi)
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
PASS : tst_Cmptest::compare_tostring(both invalid)
FAIL! : tst_Cmptest::compare_tostring(null hash, invalid) Compared values are not the same
Actual (actual) : QVariant(QVariantHash)
Expected (expected): QVariant()
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
FAIL! : tst_Cmptest::compare_tostring(string, null user type) Compared values are not the same
Actual (actual) : QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values are not the same
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
PASS : tst_Cmptest::compareQStringLists(empty lists)
PASS : tst_Cmptest::compareQStringLists(equal lists)
FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2.
Actual (int1): 3
Expected (int2): 4
- Loc: [tst_cmptest.cpp(320)]
+ Loc: [tst_cmptest.cpp(332)]
FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0.
Actual (double1): 1.5
Expected (double2): 1
- Loc: [tst_cmptest.cpp(327)]
+ Loc: [tst_cmptest.cpp(339)]
PASS : tst_Cmptest::compareQPixmaps(both null)
FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
FAIL! : tst_Cmptest::compareQPixmaps(other null) Compared QPixmaps differ.
Actual (opA).isNull(): 0
Expected (opB).isNull(): 1
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
PASS : tst_Cmptest::compareQPixmaps(equal)
FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ in size.
Actual (opA): 11x20
Expected (opB): 20x20
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
PASS : tst_Cmptest::compareQImages(both null)
FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
FAIL! : tst_Cmptest::compareQImages(other null) Compared QImages differ.
Actual (opA).isNull(): 0
Expected (opB).isNull(): 1
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
PASS : tst_Cmptest::compareQImages(equal)
FAIL! : tst_Cmptest::compareQImages(different size) Compared QImages differ in size.
Actual (opA): 11x20
Expected (opB): 20x20
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ in format.
Actual (opA): 6
Expected (opB): 3
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
+FAIL! : tst_Cmptest::verify() 'opaqueFunc() < 2' returned FALSE. ()
+ Loc: [tst_cmptest.cpp(404)]
+FAIL! : tst_Cmptest::verify2() 'opaqueFunc() < 2' returned FALSE. (42)
+ Loc: [tst_cmptest.cpp(410)]
+FAIL! : tst_Cmptest::tryVerify() 'opaqueFunc() < 2' returned FALSE. ()
+ Loc: [tst_cmptest.cpp(416)]
+FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
+ Loc: [tst_cmptest.cpp(422)]
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 11 passed, 20 failed, 0 skipped, 0 blacklisted
+Totals: 11 passed, 26 failed, 0 skipped, 0 blacklisted
********* Finished testing of tst_Cmptest *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index aefb1b5f4c..9437e8e4b7 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -7,18 +7,32 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_unregistered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="154">
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_registered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="160">
+ <Description><![CDATA[Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_boolfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_pointerfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_tostring">
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(int,123)
@@ -27,25 +41,25 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both invalid]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[null hash, invalid]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QVariantHash)
Expected (expected): QVariant()]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[string, null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[both non-null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQStringLists">
<Incident type="pass" file="" line="0">
@@ -54,65 +68,65 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal lists]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
-<Incident type="fail" file="tst_cmptest.cpp" line="320">
+<Incident type="fail" file="tst_cmptest.cpp" line="332">
<Description><![CDATA[Compared lists differ at index 2.
Actual (int1): 3
Expected (int2): 4]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListDouble">
-<Incident type="fail" file="tst_cmptest.cpp" line="327">
+<Incident type="fail" file="tst_cmptest.cpp" line="339">
<Description><![CDATA[Compared lists differ at index 0.
Actual (double1): 1.5
Expected (double2): 1]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQPixmaps">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 0
@@ -121,29 +135,29 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQImages">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 0
@@ -152,27 +166,51 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QImages differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different format]]></DataTag>
<Description><![CDATA[Compared QImages differ in format.
Actual (opA): 6
Expected (opB): 3]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify">
+<Incident type="fail" file="tst_cmptest.cpp" line="404">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="410">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify">
+<Incident type="fail" file="tst_cmptest.cpp" line="416">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="422">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
index 7502d3cc54..fa970d4172 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
@@ -1,11 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="20" tests="10" name="tst_Cmptest">
+<testsuite errors="0" failures="26" tests="16" name="tst_Cmptest">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
<property value="" name="QtBuild"/>
</properties>
<testcase result="pass" name="initTestCase"/>
+ <testcase result="fail" name="compare_unregistered_enums">
+ <failure message="Compared values are not the same" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compare_registered_enums">
+ <failure message="Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor" result="fail"/>
+ </testcase>
<testcase result="pass" name="compare_boolfuncs"/>
<testcase result="pass" name="compare_pointerfuncs"/>
<testcase result="fail" name="compare_tostring">
@@ -76,6 +84,18 @@
Expected (opB): 3" result="fail"/>
<failure tag="different pixels" message="Compared values are not the same" result="fail"/>
</testcase>
+ <testcase result="fail" name="verify">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. ()" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="verify2">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. (42)" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="tryVerify">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. ()" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="tryVerify2">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. (42)" result="fail"/>
+ </testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err/>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_crashes_3.txt b/tests/auto/testlib/selftests/expected_crashes_3.txt
index 57c3ddc2ba..0e3f60dd1b 100644
--- a/tests/auto/testlib/selftests/expected_crashes_3.txt
+++ b/tests/auto/testlib/selftests/expected_crashes_3.txt
@@ -2,6 +2,7 @@
Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
PASS : tst_Crashes::initTestCase()
QFATAL : tst_Crashes::crash() Received signal 11
+ Function time: ms Total time: ms
FAIL! : tst_Crashes::crash() Received a fatal error.
Loc: [Unknown file(0)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted
diff --git a/tests/auto/testlib/selftests/selftests.pro b/tests/auto/testlib/selftests/selftests.pro
index 1d39e6a899..091f0dd5a1 100644
--- a/tests/auto/testlib/selftests/selftests.pro
+++ b/tests/auto/testlib/selftests/selftests.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-include(selftests.pri)
+!winrt: include(selftests.pri)
SUBDIRS = $$SUBPROGRAMS test
diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro
index 0a31810105..d94b45ce89 100644
--- a/tests/auto/testlib/selftests/test/test.pro
+++ b/tests/auto/testlib/selftests/test/test.pro
@@ -16,5 +16,5 @@ win32 {
RESOURCES += ../selftests.qrc
include(../selftests.pri)
-for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
+!winrt: for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 6536f103ac..63c48fc809 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -316,6 +316,7 @@ tst_Selftests::tst_Selftests()
void tst_Selftests::initTestCase()
{
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
//Detect the location of the sub programs
QString subProgram = QLatin1String("float/float");
#if defined(Q_OS_WIN)
@@ -571,7 +572,9 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
#endif
QProcess proc;
- static const QProcessEnvironment environment = processEnvironment();
+ QProcessEnvironment environment = processEnvironment();
+ if (crashes)
+ environment.insert("QTEST_DISABLE_STACK_DUMP", "1");
proc.setProcessEnvironment(environment);
const QString path = subdir + QLatin1Char('/') + subdir;
proc.start(path, arguments);
@@ -623,11 +626,33 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
for (int n = 0; n < loggers.count(); ++n) {
QString logger = loggers[n];
+ if (n == 0 && subdir == QLatin1String("crashes")) {
+ QByteArray &actual = actualOutputs[0];
+#ifndef Q_OS_WIN
+ // Remove digits of times to match the expected file.
+ const QLatin1String timePattern("Function time:");
+ int timePos = actual.indexOf(timePattern);
+ if (timePos >= 0) {
+ timePos += timePattern.size();
+ const int nextLinePos = actual.indexOf('\n', timePos);
+ for (int c = (nextLinePos != -1 ? nextLinePos : actual.size()) - 1; c >= timePos; --c) {
+ if (actual.at(c) >= '0' && actual.at(c) <= '9')
+ actual.remove(c, 1);
+ }
+ }
+#else // !Q_OS_WIN
+ // Remove stack trace which is output to stdout.
+ const int exceptionLogStart = actual.indexOf("A crash occurred in ");
+ if (exceptionLogStart >= 0)
+ actual.truncate(exceptionLogStart);
+#endif // Q_OS_WIN
+ }
+
QList<QByteArray> res = splitLines(actualOutputs[n]);
const QString expectedFileName = expectedFileNameFromTest(subdir, logger);
QList<QByteArray> exp = expectedResult(expectedFileName);
-#if defined (Q_CC_MSVC) || defined(Q_CC_MINGW)
- // MSVC, MinGW format double numbers differently
+#if (defined (Q_CC_MSVC) && _MSC_VER < 1900)|| defined(Q_CC_MINGW)
+ // MSVC up to MSVC2013, MinGW format double numbers differently
if (n == 0 && subdir == QStringLiteral("float")) {
for (int i = 0; i < exp.size(); ++i) {
exp[i].replace("e-07", "e-007");
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 350c6142d2..c113b7cd60 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -513,6 +513,8 @@ class tst_Moc : public QObject
Q_PROPERTY(QString member4 MEMBER sMember NOTIFY member4Changed)
Q_PROPERTY(QString member5 MEMBER sMember NOTIFY member5Changed)
Q_PROPERTY(QString member6 MEMBER sConst CONSTANT)
+ Q_PROPERTY(QString sub1 MEMBER (sub.m_string))
+ Q_PROPERTY(QString sub2 READ (sub.string) WRITE (sub.setString))
public:
inline tst_Moc() : sConst("const") {}
@@ -626,6 +628,13 @@ private:
QString sMember;
const QString sConst;
PrivatePropertyTest *pPPTest;
+
+ struct {
+ QString m_string;
+ void setString(const QString &s) { m_string = s; }
+ QString string() { return m_string; }
+ } sub;
+
};
void tst_Moc::initTestCase()
@@ -880,7 +889,7 @@ void tst_Moc::preprocessorConditionals()
QVERIFY(mobj->indexOfSignal("signalInIf1()") != -1);
QVERIFY(mobj->indexOfSignal("signalInIf2()") != -1);
QVERIFY(mobj->indexOfSignal("signalInIf3()") != -1);
- QVERIFY(mobj->indexOfSignal("doNotExist()") == -1);
+ QCOMPARE(mobj->indexOfSignal("doNotExist()"), -1);
}
void tst_Moc::blackslashNewlines()
@@ -888,7 +897,7 @@ void tst_Moc::blackslashNewlines()
BackslashNewlines tst;
const QMetaObject *mobj = tst.metaObject();
QVERIFY(mobj->indexOfSlot("works()") != -1);
- QVERIFY(mobj->indexOfSlot("buggy()") == -1);
+ QCOMPARE(mobj->indexOfSlot("buggy()"), -1);
}
void tst_Moc::slotWithSillyConst()
@@ -928,8 +937,8 @@ void tst_Moc::testExtraDataForEnum()
const QMetaObject * const *objects = mobjUser->d.relatedMetaObjects;
QVERIFY(objects);
- QVERIFY(objects[0] == mobjSource);
- QVERIFY(objects[1] == 0);
+ QCOMPARE(objects[0], mobjSource);
+ QVERIFY(!objects[1]);
}
void tst_Moc::namespaceTypeProperty()
@@ -982,7 +991,7 @@ void tst_Moc::namespacedFlags()
const QVariant v = bar.property("flags");
QVERIFY(v.isValid());
QVERIFY(baz.setProperty("flags", v));
- QVERIFY(baz.flags() == bar.flags());
+ QCOMPARE(baz.flags(), bar.flags());
QList<Foo::Bar::Flags> l;
l << baz.flags();
@@ -1104,7 +1113,7 @@ void tst_Moc::winNewline()
if (data.at(i) == QLatin1Char('\r')) {
QVERIFY(i < data.count() - 1);
++i;
- QVERIFY(data.at(i) == '\n');
+ QCOMPARE(data.at(i), '\n');
} else {
QVERIFY(data.at(i) != '\n');
}
@@ -1255,14 +1264,14 @@ void tst_Moc::invokable()
{
const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("foo()"));
}
{
const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("bar()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("foo()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("bar()"));
}
}
@@ -1271,22 +1280,22 @@ void tst_Moc::singleFunctionKeywordSignalAndSlot()
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()"));
}
}
@@ -1740,34 +1749,34 @@ template <class T>
void tst_Moc::revisions_T()
{
int idx = T::staticMetaObject.indexOfProperty("prop1");
- QVERIFY(T::staticMetaObject.property(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.property(idx).revision(), 0);
idx = T::staticMetaObject.indexOfProperty("prop2");
- QVERIFY(T::staticMetaObject.property(idx).revision() == 2);
+ QCOMPARE(T::staticMetaObject.property(idx).revision(), 2);
idx = T::staticMetaObject.indexOfMethod("method1()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 0);
idx = T::staticMetaObject.indexOfMethod("method2()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 4);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 4);
idx = T::staticMetaObject.indexOfSlot("slot1()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 0);
idx = T::staticMetaObject.indexOfSlot("slot2()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 3);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 3);
idx = T::staticMetaObject.indexOfSlot("slot3()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 6);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 6);
idx = T::staticMetaObject.indexOfSlot("slot4()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 6);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 6);
idx = T::staticMetaObject.indexOfSignal("signal1()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 0);
idx = T::staticMetaObject.indexOfSignal("signal2()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 5);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 5);
idx = T::staticMetaObject.indexOfSignal("signal3()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 7);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 7);
idx = T::staticMetaObject.indexOfSignal("signal4()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 7);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 7);
idx = T::staticMetaObject.indexOfEnumerator("TestEnum");
QCOMPARE(T::staticMetaObject.enumerator(idx).keyCount(), 2);
@@ -1883,12 +1892,19 @@ void tst_Moc::warnings_data()
<< QString()
<< QString("standard input:5: Error: Class declaration lacks Q_OBJECT macro.");
- QTest::newRow("QTBUG-46210: crash on invalid macro")
- << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45);")
+ QTest::newRow("Invalid macro definition")
+ << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45, 42, 39);")
<< QStringList()
<< 1
<< QString("IGNORE_ALL_STDOUT")
<< QString(":2: Error: '#' is not followed by a macro parameter");
+
+ QTest::newRow("QTBUG-46210: crash on invalid macro invocation")
+ << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c\n Foo(45);")
+ << QStringList()
+ << 1
+ << QString("IGNORE_ALL_STDOUT")
+ << QString(":2: Error: Macro invoked with too few parameters for a use of '#'");
}
void tst_Moc::warnings()
@@ -1947,7 +1963,7 @@ public:
void tst_Moc::privateClass()
{
- QVERIFY(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()") == 0);
+ QCOMPARE(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()"), 0);
QVERIFY(PrivateClass::staticMetaObject.indexOfSignal("someSignal()") > 0);
}
@@ -2037,6 +2053,10 @@ void tst_Moc::memberProperties_data()
<< 1 << "blub5" << "blub5Changed(const QString&)" << "mno" << true << "mno";
QTest::newRow("private MEMBER property with CONSTANT")
<< 1 << "blub6" << "" << "test" << false << "const";
+ QTest::newRow("sub1")
+ << 0 << "sub1" << "" << "helloSub1" << true << "helloSub1";
+ QTest::newRow("sub2")
+ << 0 << "sub2" << "" << "helloSub2" << true << "helloSub2";
}
void tst_Moc::memberProperties()
@@ -3068,7 +3088,7 @@ void tst_Moc::parseDefines()
int index = mo->indexOfSlot("stringMethod()");
QVERIFY(index != -1);
- QVERIFY(mo->method(index).returnType() == QMetaType::QString);
+ QCOMPARE(mo->method(index).returnType(), int(QMetaType::QString));
index = mo->indexOfSlot("combined1()");
QVERIFY(index != -1);
@@ -3127,7 +3147,7 @@ void tst_Moc::parseDefines()
QVERIFY(!qstrcmp(mci.value(), "TestValue"));
}
}
- QVERIFY(count == 3);
+ QCOMPARE(count, 3);
index = mo->indexOfSlot("PD_DEFINE_ITSELF_SUFFIX(int)");
QVERIFY(index != -1);
@@ -3253,7 +3273,7 @@ void tst_Moc::relatedMetaObjectsWithinNamespaces()
const QMetaObject *testMo = &QTBUG_2151::B::staticMetaObject;
QVERIFY(testMo->d.relatedMetaObjects);
- QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo);
+ QCOMPARE(testMo->d.relatedMetaObjects[0], relatedMo);
}
void tst_Moc::relatedMetaObjectsInGadget()
@@ -3262,7 +3282,7 @@ void tst_Moc::relatedMetaObjectsInGadget()
const QMetaObject *testMo = &QTBUG_35657::B::staticMetaObject;
QVERIFY(testMo->d.relatedMetaObjects);
- QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo);
+ QCOMPARE(testMo->d.relatedMetaObjects[0], relatedMo);
}
void tst_Moc::relatedMetaObjectsNameConflict_data()
diff --git a/tests/auto/tools/qmake/qmake.pro b/tests/auto/tools/qmake/qmake.pro
index 5ed3073e20..d0817247db 100644
--- a/tests/auto/tools/qmake/qmake.pro
+++ b/tests/auto/tools/qmake/qmake.pro
@@ -8,5 +8,11 @@ SOURCES += tst_qmake.cpp testcompiler.cpp
QT = core testlib
cross_compile: DEFINES += QMAKE_CROSS_COMPILED
+debug_and_release {
+ CONFIG(debug, debug|release): \
+ DEFINES += DEBUG_BUILD
+ else: \
+ DEFINES += RELEASE_BUILD
+}
TESTDATA += testdata/*
diff --git a/tests/auto/tools/qmake/testdata/.gitignore b/tests/auto/tools/qmake/testdata/.gitignore
new file mode 100644
index 0000000000..1e997b287b
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/.gitignore
@@ -0,0 +1,5 @@
+# Created by various tests, even for shadow builds:
+/pro_file_cache/include.pri
+/quotedfilenames/cpp folder/
+/quotedfilenames/quotedfilenames
+/resources/resources
diff --git a/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro b/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro
index 442c9c767f..afb3f65297 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro
+++ b/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro
@@ -1,4 +1,5 @@
DESTDIR = ./
+gcc: QMAKE_CXXFLAGS += -Wno-comment
HEADERS += object1.h \
object2.h \
@@ -8,5 +9,7 @@ HEADERS += object1.h \
object6.h \
object7.h \
object8.h \
- object9.h
-SOURCES += main.cpp
+ object9.h \
+ objecta.h \
+ objectf.h
+SOURCES += main.cpp needed.cpp
diff --git a/tests/auto/tools/qmake/testdata/findDeps/main.cpp b/tests/auto/tools/qmake/testdata/findDeps/main.cpp
index e4aa5c6251..3f4f5def3c 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/main.cpp
+++ b/tests/auto/tools/qmake/testdata/findDeps/main.cpp
@@ -31,23 +31,60 @@
**
****************************************************************************/
+#define spurious \
+ / #include "needed.cpp"
+// if not ignored, symbol needed() won't be available ...
- #include <moc_object1.cpp>
-/**/ #include <moc_object2.cpp>
-/**//**/ #include <moc_object3.cpp>
-/*'*/ #include <moc_object4.cpp>
-/*
-*/ #include <moc_object5.cpp>
+// Check we're not confused by string juxtaposition:
+static const char text[] = "lorem ""ipsum /*";
-//
+ #include <moc_object1.cpp>
+/**/ #include "\
+moc_object2.cpp\
+"
+/**//**/ #include <moc_\
+o\
+b\
+j\
+e\
+c\
+t\
+3\
+.cpp>
+/*'"*/ #include <moc_object4.cpp>
+/*"'
+*/ #include <moc_object5.cpp> /*
+#include "missing.cpp"
+*/// a backslash newline does make the next line part of this comment \
+/* so this text is in last line's C++-style comment, not a C-comment !
#include <moc_object6.cpp>
+#if 0
+#pragma "ignore me" '&' L"me"
+#line 4321 "main.cpp" more /* preprocessing */ tokens
+#endif
static void function1();
-#include <moc_object7.cpp>
+#include/* every comment
+gets replaced (in phase 3) by a single
+space */<moc_object7.cpp>
static void function2(); /**/
-#include <moc_object8.cpp>
+#include \
+<moc_object8.cpp>
static void function3(); //
#include <moc_object9.cpp>
+/* backslash-newline elimination happens in phase 2 *\
+/ # /* and that's valid here, too. *\
+/ include/* and, of course, here *\
+/<moc_objecta.cpp>// while we're here, ... \
+#include "needed.cpp"
-int main () {}
+int main () {
+ extern int needed(void);
+ return needed();
+}
+/*
+ Deliberately end file in a #include, with nothing after it but the mandatory
+ (unescaped) newline at the end of every source file.
+*/
+#include "moc_objectf.cpp"
diff --git a/tests/auto/tools/qmake/testdata/findDeps/needed.cpp b/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
new file mode 100644
index 0000000000..698d0aaa12
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
@@ -0,0 +1 @@
+extern int needed(void) { return 1; }
diff --git a/tests/auto/tools/qmake/testdata/findDeps/objecta.h b/tests/auto/tools/qmake/testdata/findDeps/objecta.h
new file mode 100644
index 0000000000..b9813b9e18
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findDeps/objecta.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QObject>
+
+class ObjectA : public QObject
+{
+ Q_OBJECT
+};
+
diff --git a/tests/auto/tools/qmake/testdata/findDeps/objectf.h b/tests/auto/tools/qmake/testdata/findDeps/objectf.h
new file mode 100644
index 0000000000..5dead815a0
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findDeps/objectf.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QObject>
+
+class ObjectF : public QObject
+{
+ Q_OBJECT
+};
+
diff --git a/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro b/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro
index a4a7dc987d..af672c2621 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro
+++ b/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro
@@ -1,4 +1,5 @@
DESTDIR = ./
-HEADERS += object1.h object2.h object3.h object4.h object5.h object6.h object7.h
+HEADERS += object1.h object2.h object3.h object4.h \
+ object5.h object6.h object7.h object8.h object9.h
SOURCES += main.cpp
diff --git a/tests/auto/tools/qmake/testdata/findMocs/main.cpp b/tests/auto/tools/qmake/testdata/findMocs/main.cpp
index 8e0ef9fc41..3f566c4af4 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/main.cpp
+++ b/tests/auto/tools/qmake/testdata/findMocs/main.cpp
@@ -39,6 +39,7 @@
#include <moc_object5.cpp>
#include <moc_object6.cpp>
#include <moc_object7.cpp>
+#include "object8.h"
+#include <moc_object9.cpp>
-int main () {}
-
+int main() { return 0; }
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object1.h b/tests/auto/tools/qmake/testdata/findMocs/object1.h
index e0857f4297..1fcac5f511 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object1.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object1.h
@@ -37,6 +37,6 @@
class Object1 : public QObject
{
- Q_OBJECT
+ Q\
+_OBJECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object2.h b/tests/auto/tools/qmake/testdata/findMocs/object2.h
index cc60269cd3..a52489b44c 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object2.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object2.h
@@ -36,6 +36,6 @@
class Object2 : public QObject
{
- Q_OBJECT
+ Q_\
+OBJECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object3.h b/tests/auto/tools/qmake/testdata/findMocs/object3.h
index c66edee6e1..c481a0796d 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object3.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object3.h
@@ -37,6 +37,6 @@
class Object3 : public QObject
{
- Q_OBJECT
+ Q_OBJ\
+ECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object4.h b/tests/auto/tools/qmake/testdata/findMocs/object4.h
index 73bf9cdaa3..eb38652f14 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object4.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object4.h
@@ -44,10 +44,9 @@ class Object4 : public QObject
Comment ends there --> /*/
// Now we poison moc, just to make sure this doesn't get moc'ed :)
-class NonMocObject
+class NonMocObject4
/* : QObject */
{
/* qmake ignore Q_OBJECT */
Q_OBJECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object7.h b/tests/auto/tools/qmake/testdata/findMocs/object7.h
index 92b4672d6b..3922a542e0 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object7.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object7.h
@@ -33,6 +33,7 @@
/**//*'*/
#include <QObject>
+#define bogon /"/*"
class Object7 : public QObject
{
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object8.h b/tests/auto/tools/qmake/testdata/findMocs/object8.h
new file mode 100644
index 0000000000..51096e4c27
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findMocs/object8.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QObject>
+#define Q_OBJECTOID_THING // empty
+
+class Object8 : public QObject
+{
+ Q_OBJECT\
+OID_THING
+};
+
+// Now we poison moc, just to make sure this doesn't get moc'ed :)
+class NonMocObject8
+/* : QObject */
+{
+ /* qmake ignore Q_OBJECT */
+ Q_OBJECT
+};
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object9.h b/tests/auto/tools/qmake/testdata/findMocs/object9.h
new file mode 100644
index 0000000000..bda50355d9
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findMocs/object9.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QObject>
+#define juxtaposed "lorem ""ipsum /*"
+
+class Object9 : public QObject
+{
+ Q_OBJECT
+};
diff --git a/tests/auto/tools/qmake/testdata/rawString/main.cpp b/tests/auto/tools/qmake/testdata/rawString/main.cpp
new file mode 100644
index 0000000000..604986666a
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/main.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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$
+**
+****************************************************************************/
+
+static const char raw[] = R"blah(lorem " ipsum /*)blah"\
+;
+#include <moc_object1.cpp>
+
+int main () { return 0; }
diff --git a/tests/auto/tools/qmake/testdata/rawString/object1.h b/tests/auto/tools/qmake/testdata/rawString/object1.h
new file mode 100644
index 0000000000..1435624f7b
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/object1.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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$
+**
+****************************************************************************/
+
+#define rawstring R"blah(lorem " ipsum /*)blah";
+#include <QObject>
+
+class Object1 : public QObject
+{
+ Q_OBJECT
+};
diff --git a/tests/auto/tools/qmake/testdata/rawString/rawString.pro b/tests/auto/tools/qmake/testdata/rawString/rawString.pro
new file mode 100644
index 0000000000..d2d8132ceb
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/rawString.pro
@@ -0,0 +1,4 @@
+DESTDIR = ./
+
+HEADERS += object1.h
+SOURCES += main.cpp
diff --git a/tests/auto/tools/qmake/testdata/resources/main.cpp b/tests/auto/tools/qmake/testdata/resources/main.cpp
new file mode 100644
index 0000000000..78f9814396
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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.h>
+
+int main( int argc, char **argv )
+{
+ QGuiApplication a( argc, argv );
+ return a.exec();
+}
diff --git a/tests/auto/tools/qmake/testdata/resources/resources.pro b/tests/auto/tools/qmake/testdata/resources/resources.pro
new file mode 100644
index 0000000000..f024fe5617
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/resources.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+SOURCES = main.cpp
+
+pro_file.files = resources.pro
+pro_file.prefix = /prefix
+
+subdir.files = subdir/file.txt
+subdir.base = subdir
+
+RESOURCES = test.qrc main.cpp pro_file subdir
diff --git a/tests/auto/tools/qmake/testdata/resources/subdir/file.txt b/tests/auto/tools/qmake/testdata/resources/subdir/file.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/subdir/file.txt
diff --git a/tests/auto/tools/qmake/testdata/resources/test.qrc b/tests/auto/tools/qmake/testdata/resources/test.qrc
new file mode 100644
index 0000000000..decde3dd24
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/test.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>test.qrc</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index da5314c83b..d216a54575 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -39,6 +39,14 @@
#include <QStandardPaths>
#include <QDir>
+#if defined(DEBUG_BUILD)
+# define DIR_INFIX "debug/"
+#elif defined(RELEASE_BUILD)
+# define DIR_INFIX "release/"
+#else
+# define DIR_INFIX ""
+#endif
+
class tst_qmake : public QObject
{
Q_OBJECT
@@ -71,12 +79,14 @@ private slots:
void one_space();
void findMocs();
void findDeps();
+ void rawString();
#if defined(Q_OS_MAC)
void bundle_spaces();
#endif
void substitutes();
void project();
void proFileCache();
+ void resources();
private:
TestCompiler test_compiler;
@@ -397,6 +407,24 @@ void tst_qmake::findDeps()
QVERIFY( test_compiler.removeMakefile(workDir) );
}
+void tst_qmake::rawString()
+{
+#ifdef Q_COMPILER_RAW_STRINGS
+ QString workDir = base_path + "/testdata/rawString";
+
+ QVERIFY( test_compiler.qmake(workDir, "rawString") );
+ QVERIFY( test_compiler.make(workDir) );
+ QVERIFY( test_compiler.exists(workDir, "rawString", Exe, "1.0.0" ) );
+ QVERIFY( test_compiler.makeClean(workDir) );
+ QVERIFY( test_compiler.exists(workDir, "rawString", Exe, "1.0.0" ) );
+ QVERIFY( test_compiler.makeDistClean(workDir ) );
+ QVERIFY( !test_compiler.exists(workDir, "rawString", Exe, "1.0.0" ) );
+ QVERIFY( test_compiler.removeMakefile(workDir) );
+#else
+ QSKIP("Test for C++11 raw strings depends on compiler support for them");
+#endif
+}
+
struct TempFile
: QFile
{
@@ -490,5 +518,38 @@ void tst_qmake::proFileCache()
QVERIFY( test_compiler.qmake( workDir, "pro_file_cache" ));
}
+void tst_qmake::resources()
+{
+ QString workDir = base_path + "/testdata/resources";
+ QVERIFY(test_compiler.qmake(workDir, "resources"));
+
+ {
+ QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_pro_file.qrc");
+ QVERIFY(qrcFile.exists());
+ QVERIFY(qrcFile.open(QFile::ReadOnly));
+ QByteArray qrcXml = qrcFile.readAll();
+ QVERIFY(qrcXml.contains("alias=\"resources.pro\""));
+ QVERIFY(qrcXml.contains("prefix=\"/prefix\""));
+ }
+
+ {
+ QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_subdir.qrc");
+ QVERIFY(qrcFile.exists());
+ QVERIFY(qrcFile.open(QFile::ReadOnly));
+ QByteArray qrcXml = qrcFile.readAll();
+ QVERIFY(qrcXml.contains("alias=\"file.txt\""));
+ }
+
+ {
+ QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_qmake_immediate.qrc");
+ QVERIFY(qrcFile.exists());
+ QVERIFY(qrcFile.open(QFile::ReadOnly));
+ QByteArray qrcXml = qrcFile.readAll();
+ QVERIFY(qrcXml.contains("alias=\"main.cpp\""));
+ }
+
+ QVERIFY(test_compiler.make(workDir));
+}
+
QTEST_MAIN(tst_qmake)
#include "tst_qmake.moc"
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index bed4c792a1..beafef5ad2 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -2205,9 +2205,10 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
<< ""
<< true;
+ // FIXME: This also tests that 'exe' is accepted, but does not test whether it actually works.
QTest::newRow("write_file(): append")
<< "VAR = 'one more line'\n"
- "write_file(" + wpath + ", VAR, append): OK = 1\n"
+ "write_file(" + wpath + ", VAR, append exe): OK = 1\n"
"OUT = $$cat(" + wpath + ", lines)"
<< "OK = 1\nOUT = 'other content' 'one more line'"
<< ""
@@ -2227,7 +2228,13 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("write_file(): bad number of arguments")
<< "write_file(1, 2, 3, 4): OK = 1"
<< "OK = UNDEF"
- << "##:1: write_file(name, [content var, [append]]) requires one to three arguments."
+ << "##:1: write_file(name, [content var, [append] [exe]]) requires one to three arguments."
+ << true;
+
+ QTest::newRow("write_file(): invalid flag")
+ << "write_file(file, VAR, fail): OK = 1"
+ << "OK = UNDEF"
+ << "##:1: write_file(): invalid flag fail."
<< true;
// FIXME: This doesn't test whether it actually works.
diff --git a/tests/auto/tools/qmakelib/tst_qmakelib.h b/tests/auto/tools/qmakelib/tst_qmakelib.h
index c4716ca65e..b043d31e21 100644
--- a/tests/auto/tools/qmakelib/tst_qmakelib.h
+++ b/tests/auto/tools/qmakelib/tst_qmakelib.h
@@ -90,8 +90,8 @@ public:
virtual void message(int type, const QString &msg, const QString &fileName, int lineNo)
{ print(fileName, lineNo, type, msg); }
- virtual void fileMessage(const QString &msg)
- { doPrint(msg); }
+ virtual void fileMessage(int type, const QString &msg)
+ { Q_UNUSED(type) doPrint(msg); }
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
virtual void doneWithEval(ProFile *) {}
diff --git a/tests/auto/tools/uic/tst_uic.cpp b/tests/auto/tools/uic/tst_uic.cpp
index eac80bed7a..42c8e3e7b9 100644
--- a/tests/auto/tools/uic/tst_uic.cpp
+++ b/tests/auto/tools/uic/tst_uic.cpp
@@ -86,6 +86,7 @@ static QByteArray msgProcessStartFailed(const QString &command, const QString &w
void tst_uic::initTestCase()
{
+ QVERIFY2(m_generated.isValid(), qPrintable(m_generated.errorString()));
QVERIFY(m_versionRegexp.isValid());
m_baseline = QFINDTESTDATA("baseline");
QVERIFY2(!m_baseline.isEmpty(), "Could not find 'baseline'.");
diff --git a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
index 22f6bab497..c379e67ec5 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
+++ b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
@@ -4,5 +4,4 @@ TARGET = tst_qcolordialog
QT += widgets testlib
SOURCES += tst_qcolordialog.cpp
-
-
+linux*: CONFIG += insignificant_test # Crashes on different Linux distros
diff --git a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
index 59227a6168..c5e31a4bd4 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
+++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
@@ -98,7 +98,7 @@ void tst_QColorDialog::testNativeActiveModalWidget()
TestNativeDialog d;
QTimer::singleShot(1000, &d, SLOT(hide()));
d.exec();
- QVERIFY(&d == d.m_activeModalWidget);
+ QCOMPARE(&d, d.m_activeModalWidget);
}
void tst_QColorDialog::native_activeModalWidget()
diff --git a/tests/auto/widgets/dialogs/qdialog/BLACKLIST b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
new file mode 100644
index 0000000000..3da7337784
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
@@ -0,0 +1,2 @@
+[snapToDefaultButton]
+osx
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index a23938959b..37afa7f0a5 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -42,6 +42,8 @@
#include <QVBoxLayout>
#include <QSizeGrip>
#include <QDesktopWidget>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsView>
#include <QWindow>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformtheme.h>
@@ -88,6 +90,7 @@ private slots:
void snapToDefaultButton();
void transientParent_data();
void transientParent();
+ void dialogInGraphicsView();
private:
DummyDialog *testWidget;
@@ -119,9 +122,11 @@ void tst_QDialog::getSetCheck()
class ToolDialog : public QDialog
{
public:
- ToolDialog(QWidget *parent = 0) : QDialog(parent, Qt::Tool), mWasActive(false), tId(-1) {
- }
+ ToolDialog(QWidget *parent = 0)
+ : QDialog(parent, Qt::Tool), mWasActive(false), mWasModalWindow(false), tId(-1) {}
+
bool wasActive() const { return mWasActive; }
+ bool wasModalWindow() const { return mWasModalWindow; }
int exec() {
tId = startTimer(300);
@@ -132,12 +137,14 @@ protected:
if (tId == event->timerId()) {
killTimer(tId);
mWasActive = isActiveWindow();
+ mWasModalWindow = QGuiApplication::modalWindow() == windowHandle();
reject();
}
}
private:
int mWasActive;
+ bool mWasModalWindow;
int tId;
};
@@ -558,7 +565,7 @@ void tst_QDialog::snapToDefaultButton()
#ifdef QT_NO_CURSOR
QSKIP("Test relies on there being a cursor");
#else
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: Wayland does not support setting the cursor position.");
QPoint topLeftPos = QApplication::desktop()->availableGeometry().topLeft();
@@ -617,5 +624,27 @@ void tst_QDialog::transientParent()
QCOMPARE(dialog.windowHandle()->transientParent(), topLevel.windowHandle());
}
+void tst_QDialog::dialogInGraphicsView()
+{
+ // QTBUG-49124: A dialog embedded into QGraphicsView has Qt::WA_DontShowOnScreen
+ // set (as has a native dialog). It must not trigger the modal handling though
+ // as not to lock up.
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
+ const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
+ view.resize(availableGeometry.size() / 2);
+ view.move(availableGeometry.left() + availableGeometry.width() / 4,
+ availableGeometry.top() + availableGeometry.height() / 4);
+ ToolDialog *dialog = new ToolDialog;
+ scene.addWidget(dialog);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ for (int i = 0; i < 3; ++i) {
+ dialog->exec();
+ QVERIFY(!dialog->wasModalWindow());
+ }
+}
+
QTEST_MAIN(tst_QDialog)
#include "tst_qdialog.moc"
diff --git a/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro b/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
index 3a96827352..2a11a29420 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
+++ b/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
@@ -21,3 +21,5 @@ wince* {
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+
+linux*: CONFIG += insignificant_test # Crashes on different Linux distros
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 59288bd764..42e2bd09a5 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -484,11 +484,11 @@ void tst_QFiledialog::completer()
if (startPath.isEmpty()) {
tempDir.reset(new QTemporaryDir);
- QVERIFY(tempDir->isValid());
+ QVERIFY2(tempDir->isValid(), qPrintable(tempDir->errorString()));
startPath = tempDir->path();
for (int i = 0; i < 10; ++i) {
TemporaryFilePtr file(new QTemporaryFile(startPath + QStringLiteral("/rXXXXXX")));
- QVERIFY(file->open());
+ QVERIFY2(file->open(), qPrintable(file->errorString()));
files.append(file);
}
}
@@ -678,7 +678,7 @@ void tst_QFiledialog::filters()
// effects
QList<QComboBox*> views = fd.findChildren<QComboBox*>("fileTypeCombo");
- QVERIFY(views.count() == 1);
+ QCOMPARE(views.count(), 1);
QCOMPARE(views.at(0)->isVisible(), false);
QStringList filters;
@@ -890,7 +890,7 @@ void tst_QFiledialog::selectFile()
QScopedPointer<QTemporaryFile> tempFile;
if (file == QLatin1String("temp")) {
tempFile.reset(new QTemporaryFile(QDir::tempPath() + QStringLiteral("/aXXXXXX")));
- QVERIFY(tempFile->open());
+ QVERIFY2(tempFile->open(), qPrintable(tempFile->errorString()));
file = tempFile->fileName();
}
@@ -928,7 +928,7 @@ void tst_QFiledialog::selectFileWrongCaseSaveAs()
void tst_QFiledialog::selectFiles()
{
QTemporaryDir tempDir;
- QVERIFY(tempDir.isValid());
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
const QString tempPath = tempDir.path();
{
QNonNativeFileDialog fd;
@@ -1297,7 +1297,7 @@ void tst_QFiledialog::clearLineEdit()
QLineEdit *lineEdit = fd.findChild<QLineEdit*>("fileNameEdit");
QVERIFY(lineEdit);
- QVERIFY(lineEdit->text() == "foo");
+ QCOMPARE(lineEdit->text(), QLatin1String("foo"));
fd.setDirectory(QDir::home());
QListView* list = fd.findChild<QListView*>("listView");
@@ -1394,12 +1394,12 @@ void tst_QFiledialog::trailingDotsAndSpaces()
QTest::keyClick(lineEdit, Qt::Key_Space);
QTest::keyClick(lineEdit, Qt::Key_Period);
QTest::qWait(1000);
- QVERIFY(currentChildrenCount == list->model()->rowCount(list->rootIndex()));
+ QCOMPARE(currentChildrenCount, list->model()->rowCount(list->rootIndex()));
lineEdit->clear();
QTest::keyClick(lineEdit, Qt::Key_Period);
QTest::keyClick(lineEdit, Qt::Key_Space);
QTest::qWait(1000);
- QVERIFY(currentChildrenCount == list->model()->rowCount(list->rootIndex()));
+ QCOMPARE(currentChildrenCount, list->model()->rowCount(list->rootIndex()));
}
#ifdef Q_OS_UNIX
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index ed34c67aad..b457558879 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -57,6 +57,8 @@
#include "../../../../../src/widgets/dialogs/qfilesystemmodel_p.h"
#include "../../../../../src/widgets/dialogs/qfiledialog_p.h"
+#include <qpa/qplatformdialoghelper.h>
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#include "../../../network-settings.h"
#endif
@@ -79,6 +81,12 @@ public:
}
};
+static QByteArray msgDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
class tst_QFileDialog2 : public QObject
{
Q_OBJECT
@@ -122,6 +130,7 @@ private slots:
#endif
void completionOnLevelAfterRoot();
void task233037_selectingDirectory();
+ void task235069_hideOnEscape_data();
void task235069_hideOnEscape();
void task203703_returnProperSeparator();
void task228844_ensurePreviousSorting();
@@ -134,6 +143,8 @@ private slots:
void QTBUG6558_showDirsOnly();
void QTBUG4842_selectFilterWithHideNameFilterDetails();
void dontShowCompleterOnRoot();
+ void nameFilterParsing_data();
+ void nameFilterParsing();
private:
void cleanupSettingsFile();
@@ -167,7 +178,7 @@ void tst_QFileDialog2::cleanupSettingsFile()
void tst_QFileDialog2::initTestCase()
{
- QVERIFY(tempDir.isValid());
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
QStandardPaths::setTestModeEnabled(true);
cleanupSettingsFile();
}
@@ -239,13 +250,13 @@ void tst_QFileDialog2::deleteDirAndFiles()
QTemporaryFile *t;
t = new QTemporaryFile(tempPath + "/foo/aXXXXXX");
t->setAutoRemove(false);
- t->open();
+ QVERIFY2(t->open(), qPrintable(t->errorString()));
t->close();
delete t;
t = new QTemporaryFile(tempPath + "/foo/B/yXXXXXX");
t->setAutoRemove(false);
- t->open();
+ QVERIFY2(t->open(), qPrintable(t->errorString()));
t->close();
delete t;
FriendlyQFileDialog fd;
@@ -303,7 +314,7 @@ void tst_QFileDialog2::unc()
#else
QString dir(QDir::currentPath());
#endif
- QVERIFY(QFile::exists(dir));
+ QVERIFY2(QFile::exists(dir), msgDoesNotExist(dir).constData());
QNonNativeFileDialog fd(0, QString(), dir);
QFileSystemModel *model = fd.findChild<QFileSystemModel*>("qt_filesystem_model");
QVERIFY(model);
@@ -459,7 +470,7 @@ void tst_QFileDialog2::task180459_lastDirectory_data()
void tst_QFileDialog2::task180459_lastDirectory()
{
- if (qApp->platformName().toLower() == QStringLiteral("cocoa"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("cocoa"), Qt::CaseInsensitive))
QSKIP("Insignificant on OSX"); //QTBUG-39183
//first visit the temp directory and close the dialog
QNonNativeFileDialog *dlg = new QNonNativeFileDialog(0, "", tempDir.path());
@@ -760,26 +771,38 @@ void tst_QFileDialog2::task233037_selectingDirectory()
current.rmdir("test");
}
+void tst_QFileDialog2::task235069_hideOnEscape_data()
+{
+ QTest::addColumn<QString>("childName");
+ QTest::addColumn<QFileDialog::ViewMode>("viewMode");
+ QTest::newRow("listView") << QStringLiteral("listView") << QFileDialog::List;
+ QTest::newRow("fileNameEdit") << QStringLiteral("fileNameEdit") << QFileDialog::List;
+ QTest::newRow("treeView") << QStringLiteral("treeView") << QFileDialog::Detail;
+}
+
void tst_QFileDialog2::task235069_hideOnEscape()
{
+ QFETCH(QString, childName);
+ QFETCH(QFileDialog::ViewMode, viewMode);
QDir current = QDir::currentPath();
+
QNonNativeFileDialog fd;
- fd.setViewMode(QFileDialog::List);
+ QSignalSpy spyFinished(&fd, &QDialog::finished);
+ QVERIFY(spyFinished.isValid());
+ QSignalSpy spyRejected(&fd, &QDialog::rejected);
+ QVERIFY(spyRejected.isValid());
+ fd.setViewMode(viewMode);
fd.setDirectory(current.absolutePath());
- fd.setAcceptMode( QFileDialog::AcceptSave);
+ fd.setAcceptMode(QFileDialog::AcceptSave);
fd.show();
- QListView *list = fd.findChild<QListView*>("listView");
- list->setFocus();
+ QWidget *child = fd.findChild<QWidget *>(childName);
+ QVERIFY(child);
+ child->setFocus();
QTest::qWait(200);
- QTest::keyClick(list, Qt::Key_Escape);
+ QTest::keyClick(child, Qt::Key_Escape);
QCOMPARE(fd.isVisible(), false);
- QNonNativeFileDialog fd2;
- fd2.setDirectory(current.absolutePath());
- fd2.setAcceptMode( QFileDialog::AcceptSave);
- fd2.show();
- QLineEdit *edit = fd2.findChild<QLineEdit*>("fileNameEdit");
- QTest::keyClick(edit, Qt::Key_Escape);
- QCOMPARE(fd2.isVisible(), false);
+ QCOMPARE(spyFinished.count(), 1); // QTBUG-7690
+ QCOMPARE(spyRejected.count(), 1); // reject(), don't hide()
}
#ifdef QT_BUILD_INTERNAL
@@ -845,7 +868,7 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
current.mkdir("f");
current.mkdir("g");
QTemporaryFile *tempFile = new QTemporaryFile(current.absolutePath() + "/rXXXXXX");
- tempFile->open();
+ QVERIFY2(tempFile->open(), qPrintable(tempFile->errorString()));
current.cdUp();
QNonNativeFileDialog fd;
@@ -1104,6 +1127,7 @@ void tst_QFileDialog2::task254490_selectFileMultipleTimes()
QString tempPath = tempDir.path();
QTemporaryFile *t;
t = new QTemporaryFile;
+ QVERIFY2(t->open(), qPrintable(t->errorString()));
t->open();
QNonNativeFileDialog fd(0, "TestFileDialog");
@@ -1205,7 +1229,7 @@ void tst_QFileDialog2::QTBUG4419_lineEditSelectAll()
{
QString tempPath = tempDir.path();
QTemporaryFile temporaryFile(tempPath + "/tst_qfiledialog2_lineEditSelectAll.XXXXXX");
- QVERIFY(temporaryFile.open());
+ QVERIFY2(temporaryFile.open(), qPrintable(temporaryFile.errorString()));
QNonNativeFileDialog fd(0, "TestFileDialog", temporaryFile.fileName());
fd.setDirectory(tempPath);
@@ -1353,5 +1377,24 @@ void tst_QFileDialog2::dontShowCompleterOnRoot()
QTRY_VERIFY(lineEdit->completer()->popup()->isHidden());
}
+void tst_QFileDialog2::nameFilterParsing_data()
+{
+ QTest::addColumn<QString>("filterString");
+ QTest::addColumn<QStringList>("filters");
+
+ // QTBUG-47923: Do not trip over "*,v".
+ QTest::newRow("text") << "plain text document (*.txt *.asc *,v *.doc)"
+ << (QStringList() << "*.txt" << "*.asc" << "*,v" << "*.doc");
+ QTest::newRow("html") << "HTML document (*.html *.htm)"
+ << (QStringList() << "*.html" << "*.htm");
+}
+
+void tst_QFileDialog2::nameFilterParsing()
+{
+ QFETCH(QString, filterString);
+ QFETCH(QStringList, filters);
+ QCOMPARE(QPlatformFileDialogHelper::cleanFilterList(filterString), filters);
+}
+
QTEST_MAIN(tst_QFileDialog2)
#include "tst_qfiledialog2.moc"
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 03f0d25375..d370a647b4 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -78,10 +78,6 @@ private slots:
void indexPath();
void rootPath();
-#ifdef QT_BUILD_INTERNAL
- void naturalCompare_data();
- void naturalCompare();
-#endif
void readOnly();
void iconProvider();
@@ -127,6 +123,9 @@ private slots:
void permissions_data();
void permissions();
+ void doNotUnwatchOnFailedRmdir();
+ void specialFiles();
+
protected:
bool createFiles(const QString &test_path, const QStringList &initial_files, int existingFileCount = 0, const QStringList &intial_dirs = QStringList());
@@ -167,13 +166,13 @@ void tst_QFileSystemModel::cleanup()
QVERIFY(dir.rmdir(list.at(i)));
}
list = dir.entryList(QDir::AllEntries | QDir::System | QDir::Hidden | QDir::NoDotAndDotDot);
- QVERIFY(list.count() == 0);
+ QCOMPARE(list.count(), 0);
}
}
void tst_QFileSystemModel::initTestCase()
{
- QVERIFY(m_tempDir.isValid());
+ QVERIFY2(m_tempDir.isValid(), qPrintable(m_tempDir.errorString()));
flatDirTestPath = m_tempDir.path();
}
@@ -242,83 +241,11 @@ void tst_QFileSystemModel::rootPath()
}
}
-#ifdef QT_BUILD_INTERNAL
-void tst_QFileSystemModel::naturalCompare_data()
-{
- QTest::addColumn<QString>("s1");
- QTest::addColumn<QString>("s2");
- QTest::addColumn<int>("caseSensitive");
- QTest::addColumn<int>("result");
- QTest::addColumn<int>("swap");
-
-#define ROWNAME(name) (qPrintable(QString("prefix=%1, postfix=%2, num=%3, i=%4, test=%5").arg(prefix).arg(postfix).arg(num).arg(i).arg(name)))
-
- for (int j = 0; j < 4; ++j) { // <- set a prefix and a postfix string (not numbers)
- QString prefix = (j == 0 || j == 1) ? "b" : "";
- QString postfix = (j == 1 || j == 2) ? "y" : "";
-
- for (int k = 0; k < 3; ++k) { // <- make 0 not a special case
- QString num = QString("%1").arg(k);
- QString nump = QString("%1").arg(k + 1);
- for (int i = 10; i < 12; ++i) { // <- swap s1 and s2 and reverse the result
- QTest::newRow(ROWNAME("basic")) << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0;
-
- // s1 should always be less then s2
- QTest::newRow(ROWNAME("just text")) << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("just numbers")) << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("zero")) << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("space b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("space a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("tab b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("tab a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("10 vs 2")) << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("diff len")) << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("01 before 1")) << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 1")) << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 2")) << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 3")) << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 4")) << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums big 1")) << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums big 2")) << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul alphabet 1")) << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul alphabet 2")) << prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums w\\0")) << prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("num first")) << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i;
- }
- }
- }
-#undef ROWNAME
-}
-#endif
-
-#ifdef QT_BUILD_INTERNAL
-void tst_QFileSystemModel::naturalCompare()
-{
- QFETCH(QString, s1);
- QFETCH(QString, s2);
- QFETCH(int, caseSensitive);
- QFETCH(int, result);
-
- if (result == 10)
- QCOMPARE(QFileSystemModelPrivate::naturalCompare(s1, s2, Qt::CaseSensitivity(caseSensitive)), -1);
- else
- if (result == 11)
- QCOMPARE(QFileSystemModelPrivate::naturalCompare(s2, s1, Qt::CaseSensitivity(caseSensitive)), 1);
- else
- QCOMPARE(QFileSystemModelPrivate::naturalCompare(s2, s1, Qt::CaseSensitivity(caseSensitive)), result);
-#if defined(Q_OS_WINCE)
- // On Windows CE we need to wait after each test, otherwise no new threads can be
- // created. The scheduler takes its time to recognize ended threads.
- QTest::qWait(300);
-#endif
-}
-#endif
-
void tst_QFileSystemModel::readOnly()
{
QCOMPARE(model->isReadOnly(), true);
QTemporaryFile file(flatDirTestPath + QStringLiteral("/XXXXXX.dat"));
- file.open();
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QModelIndex root = model->setRootPath(flatDirTestPath);
QTRY_VERIFY(model->rowCount(root) > 0);
@@ -523,8 +450,14 @@ void tst_QFileSystemModel::rowsInserted()
QVERIFY(createFiles(tmp, QStringList(".hidden_file"), 5 + count));
- if (count != 0) QTRY_VERIFY(spy0.count() >= 1); else QTRY_VERIFY(spy0.count() == 0);
- if (count != 0) QTRY_VERIFY(spy1.count() >= 1); else QTRY_VERIFY(spy1.count() == 0);
+ if (count != 0)
+ QTRY_VERIFY(spy0.count() >= 1);
+ else
+ QTRY_COMPARE(spy0.count(), 0);
+ if (count != 0)
+ QTRY_VERIFY(spy1.count() >= 1);
+ else
+ QTRY_COMPARE(spy1.count(), 0);
}
void tst_QFileSystemModel::rowsRemoved_data()
@@ -563,8 +496,8 @@ void tst_QFileSystemModel::rowsRemoved()
}
} else {
if (i == 10 || spy0.count() == 0) {
- QVERIFY(spy0.count() == 0);
- QVERIFY(spy1.count() == 0);
+ QCOMPARE(spy0.count(), 0);
+ QCOMPARE(spy1.count(), 0);
}
}
QStringList lst;
@@ -583,8 +516,8 @@ void tst_QFileSystemModel::rowsRemoved()
QVERIFY(QFile::remove(tmp + '/' + QString(".c")));
QTest::qWait(WAITTIME);
- if (count != 0) QVERIFY(spy0.count() >= 1); else QVERIFY(spy0.count() == 0);
- if (count != 0) QVERIFY(spy1.count() >= 1); else QVERIFY(spy1.count() == 0);
+ if (count != 0) QVERIFY(spy0.count() >= 1); else QCOMPARE(spy0.count(), 0);
+ if (count != 0) QVERIFY(spy1.count() >= 1); else QCOMPARE(spy1.count(), 0);
}
void tst_QFileSystemModel::dataChanged_data()
@@ -614,7 +547,7 @@ void tst_QFileSystemModel::dataChanged()
QTest::qWait(WAITTIME);
- if (count != 0) QVERIFY(spy.count() >= 1); else QVERIFY(spy.count() == 0);
+ if (count != 0) QVERIFY(spy.count() >= 1); else QCOMPARE(spy.count(), 0);
*/
}
@@ -813,7 +746,7 @@ void tst_QFileSystemModel::setData()
void tst_QFileSystemModel::sortPersistentIndex()
{
QTemporaryFile file(flatDirTestPath + QStringLiteral("/XXXXXX.dat"));
- file.open();
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QModelIndex root = model->setRootPath(flatDirTestPath);
QTRY_VERIFY(model->rowCount(root) > 0);
@@ -890,18 +823,21 @@ void tst_QFileSystemModel::sort()
QModelIndex parent = myModel->index(dirPath, 0);
QList<QString> expectedOrder;
expectedOrder << tempFile2.fileName() << tempFile.fileName() << dirPath + QChar('/') + ".." << dirPath + QChar('/') + ".";
- //File dialog Mode means sub trees are not sorted, only the current root
+
if (fileDialogMode) {
- // FIXME: we were only able to disableRecursiveSort in developer builds, so we can only
- // stably perform this test for developer builds
-#ifdef QT_BUILD_INTERNAL
- QList<QString> actualRows;
+ // File dialog Mode means sub trees are not sorted, only the current root.
+ // There's no way we can check that the sub tree is "not sorted"; just check if it
+ // has the same contents of the expected list
+ QList<QString> actualRows;
for(int i = 0; i < myModel->rowCount(parent); ++i)
{
actualRows << dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString();
}
- QVERIFY(actualRows != expectedOrder);
-#endif
+
+ std::sort(expectedOrder.begin(), expectedOrder.end());
+ std::sort(actualRows.begin(), actualRows.end());
+
+ QCOMPARE(actualRows, expectedOrder);
} else {
for(int i = 0; i < myModel->rowCount(parent); ++i)
{
@@ -1113,6 +1049,78 @@ void tst_QFileSystemModel::permissions() // checks QTBUG-20503
QCOMPARE(fileInfoPermissions, modelPermissions);
}
+void tst_QFileSystemModel::doNotUnwatchOnFailedRmdir()
+{
+ const QString tmp = flatDirTestPath;
+
+ QFileSystemModel model;
+
+ const QTemporaryDir tempDir(tmp + '/' + QStringLiteral("doNotUnwatchOnFailedRmdir-XXXXXX"));
+ QVERIFY(tempDir.isValid());
+
+ const QModelIndex rootIndex = model.setRootPath(tempDir.path());
+
+ // create a file in the directory so to prevent it from deletion
+ {
+ QFile file(tempDir.path() + '/' + QStringLiteral("file1"));
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ }
+
+ QCOMPARE(model.rmdir(rootIndex), false);
+
+ // create another file
+ {
+ QFile file(tempDir.path() + '/' + QStringLiteral("file2"));
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ }
+
+ // the model must now detect this second file
+ QTRY_COMPARE(model.rowCount(rootIndex), 2);
+}
+
+static QSet<QString> fileListUnderIndex(const QFileSystemModel *model, const QModelIndex &parent)
+{
+ QSet<QString> fileNames;
+ const int rowCount = model->rowCount(parent);
+ for (int i = 0; i < rowCount; ++i)
+ fileNames.insert(model->index(i, 0, parent).data(QFileSystemModel::FileNameRole).toString());
+ return fileNames;
+}
+
+void tst_QFileSystemModel::specialFiles()
+{
+ QFileSystemModel model;
+
+ model.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
+
+ // Can't simply verify if the model returns a valid model index for a special file
+ // as it will always return a valid index for existing files,
+ // even if the file is not visible with the given filter.
+
+#if defined(Q_OS_UNIX)
+ const QModelIndex rootIndex = model.setRootPath(QStringLiteral("/dev/"));
+ const QString testFileName = QStringLiteral("null");
+#elif defined(Q_OS_WIN)
+ const QModelIndex rootIndex = model.setRootPath(flatDirTestPath);
+
+ const QString testFileName = QStringLiteral("linkSource.lnk");
+
+ QFile file(flatDirTestPath + QLatin1String("/linkTarget.txt"));
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ file.close();
+ QVERIFY(file.link(flatDirTestPath + '/' + testFileName));
+#else
+ QSKIP("Not implemented");
+ QModelIndex rootIndex;
+ QString testFileName;
+#endif
+
+ QTRY_VERIFY(fileListUnderIndex(&model, rootIndex).contains(testFileName));
+
+ model.setFilter(QDir::AllEntries | QDir::Hidden);
+
+ QTRY_VERIFY(!fileListUnderIndex(&model, rootIndex).contains(testFileName));
+}
QTEST_MAIN(tst_QFileSystemModel)
#include "tst_qfilesystemmodel.moc"
diff --git a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
new file mode 100644
index 0000000000..6d3c17f35f
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
@@ -0,0 +1,5 @@
+[task256466_wrongStyle]
+opensuse-13.1
+[setFont]
+ubuntu-14.04
+redhatenterpriselinuxworkstation-6.6
diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
index 6e4ad29190..0d29f5b7a2 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
@@ -36,7 +36,7 @@
void click_cocoa_button()
{
- QMacCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSArray *windows = [NSApp windows];
for (NSWindow *window in windows) {
// This is NOT how one should do RTTI, but since I don't want to leak the class too much...
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index cb816a7e85..1a4f9077d9 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -89,13 +89,6 @@
class tst_QMessageBox : public QObject
{
Q_OBJECT
-public:
- tst_QMessageBox();
- int exec(QMessageBox *msgBox, int key = -1);
- void sendKeySoon();
-
-public slots:
- void sendKey();
private slots:
void sanityTest();
@@ -122,12 +115,7 @@ private slots:
void setInformativeText();
void iconPixmap();
- void init();
- void initTestCase();
-
-private:
- int keyToSend;
- QTimer keySendTimer;
+ void cleanup();
};
class tst_ResizingMessageBox : public QMessageBox
@@ -143,51 +131,61 @@ protected:
}
};
-tst_QMessageBox::tst_QMessageBox() : keyToSend(-1)
+// ExecCloseHelper: Closes a modal QDialog during its exec() function by either
+// sending a key event or closing it (CloseWindow) once it becomes the active
+// modal window. Pass nullptr to "autodetect" the instance for static methods.
+class ExecCloseHelper : public QObject
{
-}
+public:
+ enum { CloseWindow = -1 };
-int tst_QMessageBox::exec(QMessageBox *msgBox, int key)
-{
- if (key == -1) {
- QTimer::singleShot(1000, msgBox, SLOT(close()));
- } else {
- keyToSend = key;
- sendKeySoon();
+ explicit ExecCloseHelper(QObject *parent = Q_NULLPTR)
+ : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(Q_NULLPTR) { }
+
+ void start(int key, QWidget *testCandidate = Q_NULLPTR)
+ {
+ m_key = key;
+ m_testCandidate = testCandidate;
+ m_timerId = startTimer(50);
}
- return msgBox->exec();
-}
-void tst_QMessageBox::sendKey()
+ bool done() const { return !m_timerId; }
+
+protected:
+ void timerEvent(QTimerEvent *te) Q_DECL_OVERRIDE;
+
+private:
+ int m_key;
+ int m_timerId;
+ QWidget *m_testCandidate;
+};
+
+void ExecCloseHelper::timerEvent(QTimerEvent *te)
{
- if (keyToSend == -2) {
- QApplication::activeModalWidget()->close();
- keyToSend = -1;
- return;
- }
- if (keyToSend == -1)
+ if (te->timerId() != m_timerId)
return;
- QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, keyToSend, Qt::NoModifier);
- qApp->postEvent(QApplication::activeModalWidget(), ke);
- keyToSend = -1;
-}
-void tst_QMessageBox::sendKeySoon()
-{
- keySendTimer.start();
-}
+ QWidget *modalWidget = QApplication::activeModalWidget();
-void tst_QMessageBox::init()
-{
- // if there is any pending key send from the last test, cancel it.
- keySendTimer.stop();
+ if (!m_testCandidate && modalWidget)
+ m_testCandidate = modalWidget;
+
+ if (m_testCandidate && m_testCandidate == modalWidget) {
+ if (m_key == CloseWindow) {
+ m_testCandidate->close();
+ } else {
+ QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier);
+ QCoreApplication::postEvent(m_testCandidate, ke);
+ }
+ m_testCandidate = Q_NULLPTR;
+ killTimer(m_timerId);
+ m_timerId = m_key = 0;
+ }
}
-void tst_QMessageBox::initTestCase()
+void tst_QMessageBox::cleanup()
{
- keySendTimer.setInterval(1000);
- keySendTimer.setSingleShot(true);
- QVERIFY(QObject::connect(&keySendTimer, SIGNAL(timeout()), this, SLOT(sendKey())));
+ QTRY_VERIFY(QApplication::topLevelWidgets().isEmpty()); // OS X requires TRY
}
void tst_QMessageBox::sanityTest()
@@ -200,7 +198,9 @@ void tst_QMessageBox::sanityTest()
msgBox.setIconPixmap(QPixmap("whatever.png"));
msgBox.setTextFormat(Qt::RichText);
msgBox.setTextFormat(Qt::PlainText);
- exec(&msgBox);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
}
void tst_QMessageBox::button()
@@ -216,7 +216,7 @@ void tst_QMessageBox::button()
// remove the cancel, should not exist anymore
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- QVERIFY(msgBox.button(QMessageBox::Cancel) == 0);
+ QVERIFY(!msgBox.button(QMessageBox::Cancel));
QVERIFY(msgBox.button(QMessageBox::Yes) != 0);
// should not crash
@@ -228,92 +228,105 @@ void tst_QMessageBox::button()
void tst_QMessageBox::defaultButton()
{
QMessageBox msgBox;
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
msgBox.addButton(QMessageBox::Ok);
msgBox.addButton(QMessageBox::Cancel);
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
QPushButton pushButton;
msgBox.setDefaultButton(&pushButton);
QVERIFY(msgBox.defaultButton() == 0); // we have not added it yet
QPushButton *retryButton = msgBox.addButton(QMessageBox::Retry);
msgBox.setDefaultButton(retryButton);
QCOMPARE(msgBox.defaultButton(), retryButton);
- exec(&msgBox);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), msgBox.button(QMessageBox::Cancel));
- exec(&msgBox, Qt::Key_Enter);
+ closeHelper.start(Qt::Key_Enter, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton);
QAbstractButton *okButton = msgBox.button(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
QCOMPARE(msgBox.defaultButton(), (QPushButton *)okButton);
- exec(&msgBox, Qt::Key_Enter);
+ closeHelper.start(Qt::Key_Enter, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), okButton);
msgBox.setDefaultButton(QMessageBox::Yes); // its not in there!
- QVERIFY(msgBox.defaultButton() == okButton);
+ QCOMPARE(msgBox.defaultButton(), okButton);
msgBox.removeButton(okButton);
delete okButton;
okButton = 0;
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
msgBox.setDefaultButton(QMessageBox::Ok);
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
}
void tst_QMessageBox::escapeButton()
{
QMessageBox msgBox;
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
msgBox.addButton(QMessageBox::Ok);
- exec(&msgBox);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QVERIFY(msgBox.clickedButton() == msgBox.button(QMessageBox::Ok)); // auto detected (one button only)
msgBox.addButton(QMessageBox::Cancel);
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
QPushButton invalidButton;
msgBox.setEscapeButton(&invalidButton);
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
QAbstractButton *retryButton = msgBox.addButton(QMessageBox::Retry);
- exec(&msgBox);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QVERIFY(msgBox.clickedButton() == msgBox.button(QMessageBox::Cancel)); // auto detected (cancel)
msgBox.setEscapeButton(retryButton);
QCOMPARE(msgBox.escapeButton(), (QAbstractButton *)retryButton);
// with escape
- exec(&msgBox, Qt::Key_Escape);
+ closeHelper.start(Qt::Key_Escape, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), retryButton);
// with close
- exec(&msgBox);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton);
QAbstractButton *okButton = msgBox.button(QMessageBox::Ok);
msgBox.setEscapeButton(QMessageBox::Ok);
QCOMPARE(msgBox.escapeButton(), okButton);
- exec(&msgBox, Qt::Key_Escape);
+ closeHelper.start(Qt::Key_Escape, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), okButton);
msgBox.setEscapeButton(QMessageBox::Yes); // its not in there!
- QVERIFY(msgBox.escapeButton() == okButton);
+ QCOMPARE(msgBox.escapeButton(), okButton);
msgBox.removeButton(okButton);
delete okButton;
okButton = 0;
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
msgBox.setEscapeButton(QMessageBox::Ok);
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
QMessageBox msgBox2;
msgBox2.addButton(QMessageBox::Yes);
msgBox2.addButton(QMessageBox::No);
- exec(&msgBox2);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
+ msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == msgBox2.button(QMessageBox::No)); // auto detected (one No button only)
QPushButton *rejectButton = new QPushButton;
msgBox2.addButton(rejectButton, QMessageBox::RejectRole);
- exec(&msgBox2);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
+ msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == rejectButton); // auto detected (one reject button only)
msgBox2.addButton(new QPushButton, QMessageBox::RejectRole);
- exec(&msgBox2);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
+ msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == msgBox2.button(QMessageBox::No)); // auto detected (one No button only)
}
@@ -328,38 +341,35 @@ void tst_QMessageBox::statics()
statics[2] = QMessageBox::question;
statics[3] = QMessageBox::warning;
+ ExecCloseHelper closeHelper;
for (int i = 0; i < 4; i++) {
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
QMessageBox::StandardButton sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = -2; // close()
- sendKeySoon();
+ closeHelper.start(ExecCloseHelper::CloseWindow);
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::Yes);
QCOMPARE(sb, QMessageBox::Yes);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::No);
QCOMPARE(sb, QMessageBox::No);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
}
}
@@ -371,34 +381,36 @@ void tst_QMessageBox::shortcut()
msgBox.addButton("O&k", QMessageBox::YesRole);
msgBox.addButton("&No", QMessageBox::YesRole);
msgBox.addButton("&Maybe", QMessageBox::YesRole);
- QCOMPARE(exec(&msgBox, Qt::Key_M), 2);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_M, &msgBox);
+ QCOMPARE(msgBox.exec(), 2);
}
#endif
void tst_QMessageBox::about()
{
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Escape);
QMessageBox::about(0, "Caption", "This is an auto test");
// On Mac, about and aboutQt are not modal, so we need to
// explicitly run the event loop
#ifdef Q_OS_MAC
- QTRY_COMPARE(keyToSend, -1);
+ QTRY_VERIFY(closeHelper.done());
#else
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
#endif
#if !defined(Q_OS_WINCE)
- keyToSend = Qt::Key_Enter;
+ const int keyToSend = Qt::Key_Enter;
#else
- keyToSend = Qt::Key_Escape;
+ const keyToSend = Qt::Key_Escape;
#endif
- sendKeySoon();
+ closeHelper.start(keyToSend);
QMessageBox::aboutQt(0, "Caption");
#ifdef Q_OS_MAC
- QTRY_COMPARE(keyToSend, -1);
+ QTRY_VERIFY(closeHelper.done());
#else
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
#endif
}
@@ -407,8 +419,8 @@ void tst_QMessageBox::staticSourceCompat()
int ret;
// source compat tests for < 4.2
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No);
int expectedButton = int(QMessageBox::Yes);
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
@@ -418,51 +430,44 @@ void tst_QMessageBox::staticSourceCompat()
expectedButton = int(QMessageBox::No);
}
QCOMPARE(ret, expectedButton);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No);
QCOMPARE(ret, int(QMessageBox::Yes));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape);
QCOMPARE(ret, int(QMessageBox::Yes));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
// the button text versions
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, 1);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
if (0) { // don't run these tests since the dialog won't close!
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, -1);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 0, 1);
QCOMPARE(ret, 1);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
}
}
@@ -480,12 +485,17 @@ void tst_QMessageBox::instanceSourceCompat()
mb.addButton("&Revert", QMessageBox::RejectRole);
mb.addButton("&Zoo", QMessageBox::ActionRole);
- QCOMPARE(exec(&mb, Qt::Key_Enter), int(QMessageBox::Yes));
- QCOMPARE(exec(&mb, Qt::Key_Escape), int(QMessageBox::Cancel));
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Enter, &mb);
+ QCOMPARE(mb.exec(), int(QMessageBox::Yes));
+ closeHelper.start(Qt::Key_Escape, &mb);
+ QCOMPARE(mb.exec(), int(QMessageBox::Cancel));
#ifndef Q_OS_MAC
// mnemonics are not used on OS X
- QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_R), 0);
- QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_Z), 1);
+ closeHelper.start(Qt::ALT + Qt::Key_R, &mb);
+ QCOMPARE(mb.exec(), 0);
+ closeHelper.start(Qt::ALT + Qt::Key_Z, &mb);
+ QCOMPARE(mb.exec(), 1);
#endif
}
@@ -527,13 +537,13 @@ void tst_QMessageBox::testSymbols()
QCOMPARE(mb1.text(), text);
icon = mb1.icon();
- QVERIFY(icon == QMessageBox::NoIcon);
+ QCOMPARE(icon, QMessageBox::NoIcon);
mb1.setIcon(QMessageBox::Question);
- QVERIFY(mb1.icon() == QMessageBox::Question);
+ QCOMPARE(mb1.icon(), QMessageBox::Question);
QPixmap iconPixmap = mb1.iconPixmap();
mb1.setIconPixmap(iconPixmap);
- QVERIFY(mb1.icon() == QMessageBox::NoIcon);
+ QCOMPARE(mb1.icon(), QMessageBox::NoIcon);
QCOMPARE(mb1.buttonText(QMessageBox::Ok), QLatin1String("OK"));
QCOMPARE(mb1.buttonText(QMessageBox::Cancel), QString());
@@ -647,26 +657,24 @@ void tst_QMessageBox::expandDetails_QTBUG_32473()
void tst_QMessageBox::incorrectDefaultButton()
{
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Escape);
//Do not crash here
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save );
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QMessageBox::question( 0, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save );
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
//do not crash here -> call old function of QMessageBox in this case
QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
}
void tst_QMessageBox::updateSize()
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
new file mode 100644
index 0000000000..a2670e8f36
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
@@ -0,0 +1,2 @@
+[autoShow:50_to_100_fast_0_compat]
+osx
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 21c15edff2..b2bdbac79a 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -400,7 +400,7 @@ void tst_QWizard::setButton()
// revert to default button
wizard.setButton(QWizard::NextButton, 0);
- QVERIFY(toolButton == 0);
+ QVERIFY(toolButton.isNull());
QVERIFY(qobject_cast<QPushButton *>(wizard.button(QWizard::NextButton)));
QVERIFY(wizard.button(QWizard::NextButton)->text().contains("Next"));
}
@@ -408,16 +408,16 @@ void tst_QWizard::setButton()
void tst_QWizard::setTitleFormatEtc()
{
QWizard wizard;
- QVERIFY(wizard.titleFormat() == Qt::AutoText);
- QVERIFY(wizard.subTitleFormat() == Qt::AutoText);
+ QCOMPARE(wizard.titleFormat(), Qt::AutoText);
+ QCOMPARE(wizard.subTitleFormat(), Qt::AutoText);
wizard.setTitleFormat(Qt::RichText);
- QVERIFY(wizard.titleFormat() == Qt::RichText);
- QVERIFY(wizard.subTitleFormat() == Qt::AutoText);
+ QCOMPARE(wizard.titleFormat(), Qt::RichText);
+ QCOMPARE(wizard.subTitleFormat(), Qt::AutoText);
wizard.setSubTitleFormat(Qt::PlainText);
- QVERIFY(wizard.titleFormat() == Qt::RichText);
- QVERIFY(wizard.subTitleFormat() == Qt::PlainText);
+ QCOMPARE(wizard.titleFormat(), Qt::RichText);
+ QCOMPARE(wizard.subTitleFormat(), Qt::PlainText);
}
void tst_QWizard::setPixmap()
@@ -439,7 +439,7 @@ void tst_QWizard::setPixmap()
QVERIFY(wizard.pixmap(QWizard::LogoPixmap).isNull());
QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).isNull());
#ifdef Q_OS_OSX
- QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false);
+ QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull());
#else
QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull());
#endif
@@ -448,7 +448,7 @@ void tst_QWizard::setPixmap()
QVERIFY(page->pixmap(QWizard::LogoPixmap).isNull());
QVERIFY(page->pixmap(QWizard::WatermarkPixmap).isNull());
#ifdef Q_OS_OSX
- QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false);
+ QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull());
#else
QVERIFY(page->pixmap(QWizard::BackgroundPixmap).isNull());
#endif
@@ -459,20 +459,20 @@ void tst_QWizard::setPixmap()
page->setPixmap(QWizard::LogoPixmap, p5);
- QVERIFY(wizard.pixmap(QWizard::BannerPixmap).size() == p1.size());
- QVERIFY(wizard.pixmap(QWizard::LogoPixmap).size() == p2.size());
- QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).size() == p3.size());
- QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).size() == p4.size());
+ QCOMPARE(wizard.pixmap(QWizard::BannerPixmap).size(), p1.size());
+ QCOMPARE(wizard.pixmap(QWizard::LogoPixmap).size(), p2.size());
+ QCOMPARE(wizard.pixmap(QWizard::WatermarkPixmap).size(), p3.size());
+ QCOMPARE(wizard.pixmap(QWizard::BackgroundPixmap).size(), p4.size());
- QVERIFY(page->pixmap(QWizard::BannerPixmap).size() == p1.size());
- QVERIFY(page->pixmap(QWizard::LogoPixmap).size() == p5.size());
- QVERIFY(page->pixmap(QWizard::WatermarkPixmap).size() == p3.size());
- QVERIFY(page->pixmap(QWizard::BackgroundPixmap).size() == p4.size());
+ QCOMPARE(page->pixmap(QWizard::BannerPixmap).size(), p1.size());
+ QCOMPARE(page->pixmap(QWizard::LogoPixmap).size(), p5.size());
+ QCOMPARE(page->pixmap(QWizard::WatermarkPixmap).size(), p3.size());
+ QCOMPARE(page->pixmap(QWizard::BackgroundPixmap).size(), p4.size());
- QVERIFY(page2->pixmap(QWizard::BannerPixmap).size() == p1.size());
- QVERIFY(page2->pixmap(QWizard::LogoPixmap).size() == p2.size());
- QVERIFY(page2->pixmap(QWizard::WatermarkPixmap).size() == p3.size());
- QVERIFY(page2->pixmap(QWizard::BackgroundPixmap).size() == p4.size());
+ QCOMPARE(page2->pixmap(QWizard::BannerPixmap).size(), p1.size());
+ QCOMPARE(page2->pixmap(QWizard::LogoPixmap).size(), p2.size());
+ QCOMPARE(page2->pixmap(QWizard::WatermarkPixmap).size(), p3.size());
+ QCOMPARE(page2->pixmap(QWizard::BackgroundPixmap).size(), p4.size());
}
class MyPage1 : public QWizardPage
@@ -571,7 +571,7 @@ void tst_QWizard::addPage()
}
for (int i = 0; i < N; ++i) {
- QVERIFY(pages[i] == wizard.page(i));
+ QCOMPARE(pages[i], wizard.page(i));
}
QVERIFY(!wizard.page(-1));
QVERIFY(!wizard.page(N));
@@ -667,7 +667,7 @@ void tst_QWizard::setPage()
QCOMPARE(wizard.page(-2), page);
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == page);
+ QCOMPARE(wizard.currentPage(), page);
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
@@ -679,14 +679,14 @@ void tst_QWizard::setPage()
QCOMPARE(wizard.page(2), page);
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
wizard.restart();
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
@@ -698,28 +698,28 @@ void tst_QWizard::setPage()
QCOMPARE(wizard.page(-3), page);
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
wizard.restart();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -3);
- QVERIFY(wizard.currentPage() == wizard.page(-3));
+ QCOMPARE(wizard.currentPage(), wizard.page(-3));
QCOMPARE(wizard.nextId(), -2);
CHECK_VISITED(wizard, QList<int>() << -3);
wizard.next();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -3 << -2);
wizard.next();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 2);
CHECK_VISITED(wizard, QList<int>() << -3 << -2 << 0);
@@ -727,7 +727,7 @@ void tst_QWizard::setPage()
wizard.next();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), 2);
- QVERIFY(wizard.currentPage() == wizard.page(2));
+ QCOMPARE(wizard.currentPage(), wizard.page(2));
QCOMPARE(wizard.nextId(), -1);
CHECK_VISITED(wizard, QList<int>() << -3 << -2 << 0 << 2);
}
@@ -735,14 +735,14 @@ void tst_QWizard::setPage()
wizard.back();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 2);
CHECK_VISITED(wizard, QList<int>() << -3 << -2 << 0);
wizard.back();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -3 << -2);
@@ -750,7 +750,7 @@ void tst_QWizard::setPage()
wizard.back();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -3);
- QVERIFY(wizard.currentPage() == wizard.page(-3));
+ QCOMPARE(wizard.currentPage(), wizard.page(-3));
QCOMPARE(wizard.nextId(), -2);
CHECK_VISITED(wizard, QList<int>() << -3);
}
@@ -759,7 +759,7 @@ void tst_QWizard::setPage()
wizard.restart();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -3);
- QVERIFY(wizard.currentPage() == wizard.page(-3));
+ QCOMPARE(wizard.currentPage(), wizard.page(-3));
QCOMPARE(wizard.nextId(), -2);
CHECK_VISITED(wizard, QList<int>() << -3);
}
@@ -808,31 +808,31 @@ void tst_QWizard::setStartId()
wizard.restart();
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
wizard.next();
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 1);
wizard.setStartId(INT_MIN);
QCOMPARE(wizard.startId(), INT_MIN);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 1);
wizard.next();
QCOMPARE(wizard.startId(), INT_MIN);
QCOMPARE(wizard.currentId(), 1);
- QVERIFY(wizard.currentPage() == wizard.page(1));
+ QCOMPARE(wizard.currentPage(), wizard.page(1));
QCOMPARE(wizard.nextId(), INT_MAX);
wizard.next();
QCOMPARE(wizard.startId(), INT_MIN);
QCOMPARE(wizard.currentId(), INT_MAX);
- QVERIFY(wizard.currentPage() == wizard.page(INT_MAX));
+ QCOMPARE(wizard.currentPage(), wizard.page(INT_MAX));
QCOMPARE(wizard.nextId(), -1);
CHECK_VISITED(wizard, QList<int>() << -2 << 0 << 1 << INT_MAX);
}
@@ -1143,12 +1143,12 @@ void tst_QWizard::setOption_ExtendedWatermarkPixmap()
}
if (wizard1.wizardStyle() == QWizard::MacStyle) {
- QVERIFY(i1[0] == i1[1]);
- QVERIFY(i2[0] == i2[1]);
- QVERIFY(i1[0] == i2[0]);
+ QCOMPARE(i1[0], i1[1]);
+ QCOMPARE(i2[0], i2[1]);
+ QCOMPARE(i1[0], i2[0]);
} else {
QVERIFY(i1[0] != i1[1]);
- QVERIFY(i2[0] == i2[1]);
+ QCOMPARE(i2[0], i2[1]);
QVERIFY(i1[0] != i2[0]);
QVERIFY(i1[1] != i2[1]);
}
@@ -2425,19 +2425,19 @@ void tst_QWizard::sideWidget()
QWizard wizard;
wizard.setSideWidget(0);
- QVERIFY(wizard.sideWidget() == 0);
+ QVERIFY(!wizard.sideWidget());
QScopedPointer<QWidget> w1(new QWidget(&wizard));
wizard.setSideWidget(w1.data());
QCOMPARE(wizard.sideWidget(), w1.data());
QWidget *w2 = new QWidget(&wizard);
wizard.setSideWidget(w2);
- QVERIFY(wizard.sideWidget() == w2);
+ QCOMPARE(wizard.sideWidget(), w2);
QVERIFY(w1->parent() != 0);
QCOMPARE(w1->window(), static_cast<QWidget *>(&wizard));
QCOMPARE(w2->window(), static_cast<QWidget *>(&wizard));
w1->setParent(0);
wizard.setSideWidget(0);
- QVERIFY(wizard.sideWidget() == 0);
+ QVERIFY(!wizard.sideWidget());
}
void tst_QWizard::objectNames_data()
@@ -2558,7 +2558,7 @@ void tst_QWizard::task183550_stretchFactor()
page2->disableVerticalExpansion();
wizard.next();
QCOMPARE(wizard.currentPage(), static_cast<QWizardPage*>(page2));
- QVERIFY(page2->treeWidgetHeight() == page2->treeWidgetSizeHintHeight());
+ QCOMPARE(page2->treeWidgetHeight(), page2->treeWidgetSizeHintHeight());
wizard.back();
QCOMPARE(wizard.currentPage(), static_cast<QWizardPage*>(page1));
@@ -2576,7 +2576,7 @@ void tst_QWizard::task183550_stretchFactor()
page2->disableVerticalExpansion();
wizard.next();
QCOMPARE(wizard.currentPage(), static_cast<QWizardPage*>(page2));
- QVERIFY(page2->treeWidgetHeight() == page2->treeWidgetSizeHintHeight());
+ QCOMPARE(page2->treeWidgetHeight(), page2->treeWidgetSizeHintHeight());
}
void tst_QWizard::task161658_alignments()
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index 4d7f55f37d..c7d1dd0aa1 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -520,7 +520,7 @@ public:
void draw(QPainter *painter)
{
- QVERIFY(sourcePixmap(Qt::LogicalCoordinates).handle() == pixmap.handle());
+ QCOMPARE(sourcePixmap(Qt::LogicalCoordinates).handle(), pixmap.handle());
QVERIFY((painter->worldTransform().type() <= QTransform::TxTranslate) == (sourcePixmap(Qt::DeviceCoordinates).handle() == pixmap.handle()));
++repaints;
@@ -595,7 +595,7 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching()
item->translate(10, 0);
- QTRY_VERIFY(item->numRepaints == numRepaints);
+ QTRY_COMPARE(item->numRepaints, numRepaints);
}
void tst_QGraphicsEffect::inheritOpacity()
diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST b/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST
new file mode 100644
index 0000000000..7f55c2dae0
--- /dev/null
+++ b/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST
@@ -0,0 +1,2 @@
+[panGesture:Two finger]
+xcb
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index ca01b27bee..f71308cdaf 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -133,7 +133,6 @@ static bool checkReverseDirection(QGraphicsWidget *widget)
layout->getContentsMargins(&left, &top, &right, &bottom);
widget->setLayoutDirection(Qt::LeftToRight);
QApplication::processEvents();
- const QRectF layoutGeometry = layout->geometry();
QMap<QGraphicsLayoutItem *, QRectF> geometries;
for (int i = 0; i < layout->count(); ++i) {
QGraphicsLayoutItem *item = layout->itemAt(i);
@@ -141,7 +140,7 @@ static bool checkReverseDirection(QGraphicsWidget *widget)
}
widget->setLayoutDirection(Qt::RightToLeft);
QApplication::processEvents();
- layoutGeometry.adjusted(+right, +top, -left, -bottom);
+ const QRectF layoutGeometry = layout->geometry().adjusted(+right, +top, -left, -bottom);
for (int i = 0; i < layout->count(); ++i) {
QGraphicsLayoutItem *item = layout->itemAt(i);
const QRectF rightToLeftGeometry = item->geometry();
@@ -653,7 +652,7 @@ void tst_QGraphicsAnchorLayout::snake()
QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0));
QCOMPARE(p.size(), layoutMaximumSize);
- QVERIFY(layoutHasConflict(l) == false);
+ QVERIFY(!layoutHasConflict(l));
// Test QSizePolicy::ExpandFlag, it shouldn't change the extreme
// points of the layout...
@@ -2041,9 +2040,9 @@ void tst_QGraphicsAnchorLayout::graphicsAnchorHandling()
QGraphicsAnchor *invalidAnchor = l->anchor(a, Qt::AnchorTop, l, Qt::AnchorBottom);
// Ensure none of these anchors are accessible.
- QVERIFY(layoutAnchor == 0);
- QVERIFY(itemAnchor == 0);
- QVERIFY(invalidAnchor == 0);
+ QVERIFY(!layoutAnchor);
+ QVERIFY(!itemAnchor);
+ QVERIFY(!invalidAnchor);
// Hook the anchors to a QObject
QObject object;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index a2108dd494..a58f295575 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -715,7 +715,7 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases()
widget1->setGeometry(QRectF(0,0,100,100));
QCOMPARE(childWidget->geometry(), QRectF(1,1,98,98));
- QVERIFY(childWidget->parentLayoutItem() == layout1);
+ QCOMPARE(childWidget->parentLayoutItem(), layout1);
QGraphicsWidget *widget2 = new QGraphicsWidget;
TheAnchorLayout *layout2 = new TheAnchorLayout();
widget2->setLayout(layout2);
@@ -739,10 +739,10 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases()
widget2->setGeometry(QRectF(0,0,100,100));
QCOMPARE(childWidget->geometry(), QRectF(1,1,98,98));
- QVERIFY(childWidget->parentLayoutItem() == layout2);
+ QCOMPARE(childWidget->parentLayoutItem(), layout2);
QCOMPARE(widget4->geometry(), QRectF(1,1,98,98));
- QVERIFY(widget4->parentLayoutItem() == layout2);
- QVERIFY(widget4->parentItem() == widget2);
+ QCOMPARE(widget4->parentLayoutItem(), layout2);
+ QCOMPARE(widget4->parentItem(), widget2);
delete widget4;
delete widget3;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 0dd1161dcf..835aeaa4df 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -4274,7 +4274,7 @@ void tst_QGraphicsItem::cursor()
void tst_QGraphicsItem::textControlGetterSetter()
{
QGraphicsTextItem *item = new QGraphicsTextItem;
- QVERIFY(item->textControl()->parent() == item);
+ QCOMPARE(item->textControl()->parent(), item);
QPointer<QWidgetTextControl> control = item->textControl();
delete item;
QVERIFY(!control);
@@ -4285,7 +4285,7 @@ void tst_QGraphicsItem::textControlGetterSetter()
control = new QWidgetTextControl;
item->setTextControl(control);
- QVERIFY(item->textControl() == control);
+ QCOMPARE(item->textControl(), control);
QVERIFY(!control->parent());
QVERIFY(!oldControl);
@@ -5141,19 +5141,19 @@ void tst_QGraphicsItem::paint()
//nominal case, update call paint
tester2.update();
qApp->processEvents();
- QTRY_VERIFY(tester2.painted == 2);
+ QTRY_COMPARE(tester2.painted, 2);
//we remove the item from the scene, number of updates is still the same
tester2.update();
scene2.removeItem(&tester2);
qApp->processEvents();
- QTRY_VERIFY(tester2.painted == 2);
+ QTRY_COMPARE(tester2.painted, 2);
//We re-add the item, the number of paint should increase
scene2.addItem(&tester2);
tester2.update();
qApp->processEvents();
- QTRY_VERIFY(tester2.painted == 3);
+ QTRY_COMPARE(tester2.painted, 3);
}
class HarakiriItem : public QGraphicsRectItem
@@ -5878,7 +5878,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
scene.setItemIndexMethod(QGraphicsScene::NoIndex);
scene.addItem(parent);
- QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls);
+ QCOMPARE(parent->boundingRectCalls, childOutsideShape->boundingRectCalls);
int oldParentBoundingRectCalls = parent->boundingRectCalls;
int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
@@ -5886,10 +5886,10 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
// First test that both items are searched if no optimization flags are set
QGraphicsItem* item = scene.itemAt(25,5);
- QVERIFY(item == childOutsideShape);
+ QCOMPARE(item, childOutsideShape);
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
QVERIFY(childOutsideShape->boundingRectCalls > oldChildBoundingRectCalls);
- QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls);
+ QCOMPARE(parent->boundingRectCalls, childOutsideShape->boundingRectCalls);
oldParentBoundingRectCalls = parent->boundingRectCalls;
oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
@@ -5897,10 +5897,10 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
// Repeat the test to make sure that no caching/indexing is in effect
item = scene.itemAt(25,5);
- QVERIFY(item == childOutsideShape);
+ QCOMPARE(item, childOutsideShape);
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
QVERIFY(childOutsideShape->boundingRectCalls > oldChildBoundingRectCalls);
- QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls);
+ QCOMPARE(parent->boundingRectCalls, childOutsideShape->boundingRectCalls);
oldParentBoundingRectCalls = parent->boundingRectCalls;
oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
@@ -5912,7 +5912,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
QVERIFY(!(item));
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
- QVERIFY(childOutsideShape->boundingRectCalls == oldChildBoundingRectCalls);
+ QCOMPARE(childOutsideShape->boundingRectCalls, oldChildBoundingRectCalls);
QVERIFY(parent->boundingRectCalls > childOutsideShape->boundingRectCalls);
}
@@ -11205,21 +11205,21 @@ void tst_QGraphicsItem::QTBUG_6738_missingUpdateWithSetParent()
child2->setVisible(false);
child2->setParentItem(child);
- QTRY_VERIFY(view.repaints == 1);
+ QTRY_COMPARE(view.repaints, 1);
// test case #2
view.reset();
child3->setOpacity(0.0);
child3->setParentItem(child);
- QTRY_VERIFY(view.repaints == 1);
+ QTRY_COMPARE(view.repaints, 1);
// test case #3
view.reset();
child4->setParentItem(child);
child4->setVisible(false);
- QTRY_VERIFY(view.repaints == 1);
+ QTRY_COMPARE(view.repaints, 1);
}
void tst_QGraphicsItem::QT_2653_fullUpdateDiscardingOpacityUpdate()
@@ -11469,9 +11469,9 @@ void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
QGraphicsSceneDragDropEvent event(QEvent::GraphicsSceneDragMove);
event.setScenePos(item->boundingRect().center());
QApplication::sendEvent(&scene, &event);
- QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == item);
+ QCOMPARE(QGraphicsScenePrivate::get(&scene)->dragDropItem, item);
delete item;
- QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == 0);
+ QVERIFY(!QGraphicsScenePrivate::get(&scene)->dragDropItem);
}
void tst_QGraphicsItem::QTBUG_12112_focusItem()
diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
index bd104539ac..a2740edc54 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -948,7 +948,7 @@ void tst_QGraphicsLayout::ownership()
destructedSet.clear();
window->setLayout(0);
- QVERIFY(destructedSet.count() == 0);
+ QCOMPARE(destructedSet.count(), 0);
delete window;
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 6a8b690560..8bebd4eddd 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -1230,8 +1230,8 @@ void tst_QGraphicsLinearLayout::testStretch()
layout->addStretch(2);
layout->addItem(w2);
QCOMPARE(layout->count(), 2);
- QVERIFY(layout->itemAt(0) == w1);
- QVERIFY(layout->itemAt(1) == w2);
+ QCOMPARE(layout->itemAt(0), w1);
+ QCOMPARE(layout->itemAt(1), w2);
layout->activate();
//view->setSceneRect(-50, -50, 800, 800);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
index 84c39bbb98..0f9e8c101e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
@@ -102,7 +102,7 @@ void tst_QGraphicsObject::pos()
QCOMPARE(xSpy.count(), 1);
QCOMPARE(ySpy.count(), 1);
- QVERIFY(object.pos() == QPointF(10,10));
+ QCOMPARE(object.pos(), QPointF(10,10));
object.setPos(10, 10);
QCOMPARE(xSpy.count(), 1);
@@ -111,12 +111,12 @@ void tst_QGraphicsObject::pos()
object.setProperty("pos", QPointF(0, 0));
QCOMPARE(xSpy.count(), 2);
QCOMPARE(ySpy.count(), 2);
- QVERIFY(object.property("pos") == QPointF(0,0));
+ QCOMPARE(object.property("pos").toPointF(), QPointF(0,0));
object.setProperty("pos", QPointF(10, 0));
QCOMPARE(xSpy.count(), 3);
QCOMPARE(ySpy.count(), 2);
- QVERIFY(object.property("pos") == QPointF(10,0));
+ QCOMPARE(object.property("pos").toPointF(), QPointF(10,0));
object.setProperty("pos", QPointF(10, 10));
QCOMPARE(xSpy.count(), 3);
@@ -135,7 +135,7 @@ void tst_QGraphicsObject::x()
QCOMPARE(ySpy.count(), 0);
QVERIFY(object.pos() == QPointF(10, 0));
- QVERIFY(object.x() == 10);
+ QCOMPARE(object.x(), qreal(10));
object.setX(10);
QCOMPARE(xSpy.count(), 1);
@@ -144,7 +144,7 @@ void tst_QGraphicsObject::x()
object.setProperty("x", 0);
QCOMPARE(xSpy.count(), 2);
QCOMPARE(ySpy.count(), 0);
- QVERIFY(object.property("x") == 0);
+ QCOMPARE(object.property("x").toDouble(), double(0));
}
void tst_QGraphicsObject::y()
@@ -158,7 +158,7 @@ void tst_QGraphicsObject::y()
QCOMPARE(ySpy.count(), 1);
QVERIFY(object.pos() == QPointF(0, 10));
- QVERIFY(object.y() == 10);
+ QCOMPARE(object.y(), qreal(10));
object.setY(10);
QCOMPARE(xSpy.count(), 0);
@@ -167,79 +167,79 @@ void tst_QGraphicsObject::y()
object.setProperty("y", 0);
QCOMPARE(xSpy.count(), 0);
QCOMPARE(ySpy.count(), 2);
- QVERIFY(object.property("y") == 0);
+ QCOMPARE(object.property("y").toDouble(), qreal(0));
}
void tst_QGraphicsObject::z()
{
MyGraphicsObject object;
QSignalSpy zSpy(&object, SIGNAL(zChanged()));
- QVERIFY(object.zValue() == 0);
+ QCOMPARE(object.zValue(), qreal(0));
object.setZValue(10);
QCOMPARE(zSpy.count(), 1);
- QVERIFY(object.zValue() == 10);
+ QCOMPARE(object.zValue(), qreal(10));
object.setZValue(10);
QCOMPARE(zSpy.count(), 1);
object.setProperty("z", 0);
QCOMPARE(zSpy.count(), 2);
- QVERIFY(object.property("z") == 0);
+ QCOMPARE(object.property("z").toDouble(), double(0));
}
void tst_QGraphicsObject::opacity()
{
MyGraphicsObject object;
QSignalSpy spy(&object, SIGNAL(opacityChanged()));
- QVERIFY(object.opacity() == 1.);
+ QCOMPARE(object.opacity(), 1.);
object.setOpacity(0);
QCOMPARE(spy.count(), 1);
- QVERIFY(object.opacity() == 0.);
+ QCOMPARE(object.opacity(), 0.);
object.setOpacity(0);
QCOMPARE(spy.count(), 1);
object.setProperty("opacity", .5);
QCOMPARE(spy.count(), 2);
- QVERIFY(object.property("opacity") == .5);
+ QCOMPARE(object.property("opacity").toDouble(), .5);
}
void tst_QGraphicsObject::enabled()
{
MyGraphicsObject object;
QSignalSpy spy(&object, SIGNAL(enabledChanged()));
- QVERIFY(object.isEnabled() == true);
+ QVERIFY(object.isEnabled());
object.setEnabled(false);
QCOMPARE(spy.count(), 1);
- QVERIFY(object.isEnabled() == false);
+ QVERIFY(!object.isEnabled());
object.setEnabled(false);
QCOMPARE(spy.count(), 1);
object.setProperty("enabled", true);
QCOMPARE(spy.count(), 2);
- QVERIFY(object.property("enabled") == true);
+ QVERIFY(object.property("enabled").toBool());
}
void tst_QGraphicsObject::visible()
{
MyGraphicsObject object;
QSignalSpy spy(&object, SIGNAL(visibleChanged()));
- QVERIFY(object.isVisible() == true);
+ QVERIFY(object.isVisible());
object.setVisible(false);
QCOMPARE(spy.count(), 1);
- QVERIFY(object.isVisible() == false);
+ QVERIFY(!object.isVisible());
object.setVisible(false);
QCOMPARE(spy.count(), 1);
object.setProperty("visible", true);
QCOMPARE(spy.count(), 2);
- QVERIFY(object.property("visible") == true);
+ QVERIFY(object.property("visible").toBool());
}
class DeleteTester : public QGraphicsObject
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index f3a683fe8b..d8a8ed6b4b 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -97,8 +97,8 @@ private slots:
void paint_2();
void setWidget_data();
void setWidget();
- void eventFilter_data();
- void eventFilter();
+ void testEventFilter_data();
+ void testEventFilter();
void focusInEvent_data();
void focusInEvent();
void focusInEventNoWidget();
@@ -179,6 +179,7 @@ private slots:
void mapToGlobal();
void mapToGlobalWithoutScene();
void QTBUG_43780_visibility();
+ void forwardTouchEvent();
};
// Subclass that exposes the protected functions.
@@ -314,7 +315,7 @@ void tst_QGraphicsProxyWidget::qgraphicsproxywidget()
SubQGraphicsProxyWidget proxy;
proxy.paint(0, 0, 0);
proxy.setWidget(0);
- QVERIFY(proxy.type() == QGraphicsProxyWidget::Type);
+ QCOMPARE(proxy.type(), int(QGraphicsProxyWidget::Type));
QVERIFY(!proxy.widget());
QEvent event(QEvent::None);
proxy.call_eventFilter(0, &event);
@@ -533,7 +534,7 @@ void tst_QGraphicsProxyWidget::setWidget()
}
Q_DECLARE_METATYPE(QEvent::Type)
-void tst_QGraphicsProxyWidget::eventFilter_data()
+void tst_QGraphicsProxyWidget::testEventFilter_data()
{
QTest::addColumn<QEvent::Type>("eventType");
QTest::addColumn<bool>("fromObject"); // big grin evil
@@ -552,7 +553,7 @@ void tst_QGraphicsProxyWidget::eventFilter_data()
}
// protected bool eventFilter(QObject* object, QEvent* event)
-void tst_QGraphicsProxyWidget::eventFilter()
+void tst_QGraphicsProxyWidget::testEventFilter()
{
QFETCH(QEvent::Type, eventType);
QFETCH(bool, fromObject);
@@ -1223,6 +1224,7 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.resize(500, 500);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
@@ -1231,7 +1233,6 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
QPushButton *widget = new QPushButton;
QSignalSpy spy(widget, SIGNAL(clicked()));
widget->resize(50, 50);
- view.resize(100, 100);
if (hasWidget) {
proxy->setWidget(widget);
proxy->show();
@@ -3017,36 +3018,36 @@ void tst_QGraphicsProxyWidget::createProxyForChildWidget()
layout->addWidget(rightDial);
window.setLayout(layout);
- QVERIFY(window.graphicsProxyWidget() == 0);
- QVERIFY(checkbox->graphicsProxyWidget() == 0);
+ QVERIFY(!window.graphicsProxyWidget());
+ QVERIFY(!checkbox->graphicsProxyWidget());
QGraphicsProxyWidget *windowProxy = scene.addWidget(&window);
QGraphicsView view(&scene);
view.show();
view.resize(500,500);
- QVERIFY(window.graphicsProxyWidget() == windowProxy);
- QVERIFY(box->graphicsProxyWidget() == 0);
- QVERIFY(checkbox->graphicsProxyWidget() == 0);
+ QCOMPARE(window.graphicsProxyWidget(), windowProxy);
+ QVERIFY(!box->graphicsProxyWidget());
+ QVERIFY(!checkbox->graphicsProxyWidget());
QPointer<QGraphicsProxyWidget> checkboxProxy = windowProxy->createProxyForChildWidget(checkbox);
QGraphicsProxyWidget *boxProxy = box->graphicsProxyWidget();
QVERIFY(boxProxy);
- QVERIFY(checkbox->graphicsProxyWidget() == checkboxProxy);
- QVERIFY(checkboxProxy->parentItem() == boxProxy);
- QVERIFY(boxProxy->parentItem() == windowProxy);
+ QCOMPARE(checkbox->graphicsProxyWidget(), checkboxProxy.data());
+ QCOMPARE(checkboxProxy->parentItem(), boxProxy);
+ QCOMPARE(boxProxy->parentItem(), windowProxy);
QVERIFY(checkboxProxy->mapToScene(QPointF()) == checkbox->mapTo(&window, QPoint()));
- QVERIFY(checkboxProxy->size() == checkbox->size());
- QVERIFY(boxProxy->size() == box->size());
+ QCOMPARE(checkboxProxy->size().toSize(), checkbox->size());
+ QCOMPARE(boxProxy->size().toSize(), box->size());
window.resize(500,500);
- QVERIFY(windowProxy->size() == QSize(500,500));
+ QCOMPARE(windowProxy->size().toSize(), QSize(500,500));
QVERIFY(checkboxProxy->mapToScene(QPointF()) == checkbox->mapTo(&window, QPoint()));
- QVERIFY(checkboxProxy->size() == checkbox->size());
- QVERIFY(boxProxy->size() == box->size());
+ QCOMPARE(checkboxProxy->size().toSize(), checkbox->size());
+ QCOMPARE(boxProxy->size().toSize(), box->size());
QTest::qWait(10);
@@ -3064,9 +3065,9 @@ void tst_QGraphicsProxyWidget::createProxyForChildWidget()
boxProxy->setWidget(0);
- QVERIFY(checkbox->graphicsProxyWidget() == 0);
- QVERIFY(box->graphicsProxyWidget() == 0);
- QVERIFY(checkboxProxy == 0);
+ QVERIFY(!checkbox->graphicsProxyWidget());
+ QVERIFY(!box->graphicsProxyWidget());
+ QVERIFY(checkboxProxy.isNull());
delete boxProxy;
}
@@ -3766,5 +3767,73 @@ void tst_QGraphicsProxyWidget::QTBUG_43780_visibility()
QVERIFY(comboPopup->isVisible());
}
+class TouchWidget : public QWidget
+{
+public:
+ TouchWidget(QWidget *parent = 0) : QWidget(parent) {}
+
+ bool event(QEvent *event)
+ {
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ event->accept();
+ return true;
+ break;
+ default:
+ break;
+ }
+
+ return QWidget::event(event);
+ }
+};
+
+// QTBUG_45737
+void tst_QGraphicsProxyWidget::forwardTouchEvent()
+{
+ QGraphicsScene *scene = new QGraphicsScene;
+
+ TouchWidget *widget = new TouchWidget;
+
+ widget->setAttribute(Qt::WA_AcceptTouchEvents);
+
+ QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget;
+
+ proxy->setAcceptTouchEvents(true);
+ proxy->setWidget(widget);
+
+ scene->addItem(proxy);
+
+ QGraphicsView *view = new QGraphicsView(scene);
+
+ view->show();
+
+ EventSpy eventSpy(widget);
+
+ QTouchDevice *device = new QTouchDevice;
+ device->setType(QTouchDevice::TouchScreen);
+ QWindowSystemInterface::registerTouchDevice(device);
+
+ QCOMPARE(eventSpy.counts[QEvent::TouchBegin], 0);
+ QCOMPARE(eventSpy.counts[QEvent::TouchUpdate], 0);
+ QCOMPARE(eventSpy.counts[QEvent::TouchEnd], 0);
+
+ QTest::touchEvent(view, device).press(0, QPoint(10, 10), view);
+ QTest::touchEvent(view, device).move(0, QPoint(15, 15), view);
+ QTest::touchEvent(view, device).move(0, QPoint(16, 16), view);
+ QTest::touchEvent(view, device).release(0, QPoint(15, 15), view);
+
+ QApplication::processEvents();
+
+ QCOMPARE(eventSpy.counts[QEvent::TouchBegin], 1);
+ QCOMPARE(eventSpy.counts[QEvent::TouchUpdate], 2);
+ QCOMPARE(eventSpy.counts[QEvent::TouchEnd], 1);
+
+ delete view;
+ delete proxy;
+ delete scene;
+}
+
QTEST_MAIN(tst_QGraphicsProxyWidget)
#include "tst_qgraphicsproxywidget.moc"
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 7bd0393760..ae71b0412f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1282,33 +1282,16 @@ void tst_QGraphicsScene::removeItem()
view.show();
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
- QTest::mouseMove(view.viewport(), QPoint(-1, -1));
- {
- QMouseEvent moveEvent(QEvent::MouseMove, view.mapFromScene(hoverItem->scenePos() + QPointF(20, 20)), Qt::NoButton, 0, 0);
- QApplication::sendEvent(view.viewport(), &moveEvent);
- }
- qApp->processEvents(); // update
- qApp->processEvents(); // draw
- QVERIFY(!hoverItem->isHovered);
+ QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos() + QPointF(20, 20)), Qt::NoButton);
+ QTRY_VERIFY(!hoverItem->isHovered);
- {
- QTest::qWait(250);
- QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton);
- QTest::qWait(10);
- QMouseEvent moveEvent(QEvent::MouseMove, view.mapFromScene(hoverItem->scenePos()), Qt::NoButton, 0, 0);
- QApplication::sendEvent(view.viewport(), &moveEvent);
- }
- qApp->processEvents(); // update
- qApp->processEvents(); // draw
- QVERIFY(hoverItem->isHovered);
+ QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton);
+ QTRY_VERIFY(hoverItem->isHovered);
scene.removeItem(hoverItem);
hoverItem->setAcceptsHoverEvents(false);
scene.addItem(hoverItem);
- qApp->processEvents(); // <- delayed update is called
- qApp->processEvents(); // <- scene schedules pending update
- qApp->processEvents(); // <- pending update is sent to view
- QVERIFY(!hoverItem->isHovered);
+ QTRY_VERIFY(!hoverItem->isHovered);
}
void tst_QGraphicsScene::focusItem()
@@ -3509,6 +3492,8 @@ void tst_QGraphicsScene::task160653_selectionChanged()
QSignalSpy spy(&scene, SIGNAL(selectionChanged()));
QGraphicsView view(&scene);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
QTest::mouseClick(
view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.items().first()->scenePos()));
QCOMPARE(spy.count(), 1);
@@ -4742,9 +4727,9 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
- QVERIFY(viewRepaints == smallChild->repaints);
- QVERIFY(viewRepaints == smallerGrandChild->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
+ QCOMPARE(viewRepaints, smallChild->repaints);
+ QCOMPARE(viewRepaints, smallerGrandChild->repaints);
// Setting a minimum render size should cause a repaint
scene.setMinimumRenderSize(0.5);
@@ -4753,9 +4738,9 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
- QVERIFY(viewRepaints == smallChild->repaints);
- QVERIFY(viewRepaints == smallerGrandChild->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
+ QCOMPARE(viewRepaints, smallChild->repaints);
+ QCOMPARE(viewRepaints, smallerGrandChild->repaints);
// Scaling should cause a repaint of big items only.
view.scale(0.1, 0.1);
@@ -4764,8 +4749,8 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
- QVERIFY(viewRepaints == smallChild->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
+ QCOMPARE(viewRepaints, smallChild->repaints);
QVERIFY(smallChild->repaints > smallerGrandChild->repaints);
// Scaling further should cause even fewer items to be repainted
@@ -4775,7 +4760,7 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
QVERIFY(bigParent->repaints > smallChild->repaints);
QVERIFY(smallChild->repaints > smallerGrandChild->repaints);
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
index be7a7e398b..3cba8bad7e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
@@ -1,4 +1,18 @@
[task255529_transformationAnchorMouseAndViewportMargins]
-ubuntu-14.04
+xcb
[cursor]
-ubuntu-14.04
+xcb
+[cursor2]
+xcb
+[rubberBandExtendSelection]
+xcb
+[rotated_rubberBand]
+xcb
+[sendEvent]
+xcb
+[forwardMousePress]
+xcb
+[hoverLeave]
+xcb
+[resizeAnchor]
+xcb
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index d1d4c1ab86..98473fb5cc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -145,7 +145,7 @@ class tst_QGraphicsView : public QObject
public:
tst_QGraphicsView()
- : platformName(qApp->platformName().toLower())
+ : platformName(QGuiApplication::platformName().toLower())
{ }
private slots:
void initTestCase();
@@ -255,7 +255,6 @@ private slots:
void task186827_deleteReplayedItem();
void task207546_focusCrash();
void task210599_unsetDragWhileDragging();
- void task236394_sendShortcutOverrideEvent();
void task239729_noViewUpdate_data();
void task239729_noViewUpdate();
void task239047_fitInViewSmallViewport();
@@ -3369,14 +3368,6 @@ void tst_QGraphicsView::task210599_unsetDragWhileDragging()
QCOMPARE(basePos, view.mapFromScene(0, 0));
}
-void tst_QGraphicsView::task236394_sendShortcutOverrideEvent()
-{
- QGraphicsView view;
- view.show();
- QKeyEvent event(QEvent::ShortcutOverride, Qt::Key_A, 0, QString("A"));
- QApplication::sendEvent(&view, &event);
-}
-
class ChangedListener : public QObject
{
Q_OBJECT
@@ -3525,7 +3516,7 @@ void tst_QGraphicsView::embeddedViews()
v2->QWidget::render(&actual);
QTransform b = item->transform;
- QVERIFY(a == b);
+ QCOMPARE(a, b);
delete v1;
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 9b92c34fb5..ec2203e615 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -182,14 +182,6 @@ private slots:
void QTBUG_45867_send_itemChildAddedChange_to_parent();
};
-
-static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = 0)
-{
- QTest::mouseMove(widget, point);
- QMouseEvent event(QEvent::MouseMove, point, button, buttons, 0);
- QApplication::sendEvent(widget, &event);
-}
-
// Subclass that exposes the protected functions.
class SubQGraphicsWidget : public QGraphicsWidget {
public:
@@ -197,7 +189,7 @@ public:
: QGraphicsWidget(parent, windowFlags), eventCount(0)
{ }
- void initStyleOption(QStyleOption *option)
+ void initStyleOption(QStyleOption *option) const
{ QGraphicsWidget::initStyleOption(option); }
void call_changeEvent(QEvent* event)
@@ -1110,8 +1102,8 @@ void tst_QGraphicsWidget::initStyleOption()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.resize(300, 300);
view.show();
- QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
view.setAlignment(Qt::AlignTop | Qt::AlignLeft);
@@ -1133,10 +1125,8 @@ void tst_QGraphicsWidget::initStyleOption()
}
QFETCH(bool, underMouse);
if (underMouse) {
- view.resize(300, 300);
- view.show();
- QVERIFY(QTest::qWaitForWindowActive(&view));
- sendMouseMove(view.viewport(), view.mapFromScene(widget->mapToScene(widget->boundingRect().center())));
+ QCursor::setPos(view.viewport()->mapToGlobal(view.mapFromScene(widget->mapToScene(widget->boundingRect().center()))));
+ QTest::qWait(100);
}
QFETCH(QPalette, palette);
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index eed38752d9..3a17f7c690 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -250,6 +250,7 @@ private slots:
void QTBUG39324_settingSameInstanceOfIndexWidget();
void sizeHintChangeTriggersLayout();
void shiftSelectionAfterChangingModelContents();
+ void QTBUG48968_reentrant_updateEditorGeometries();
};
class MyAbstractItemDelegate : public QAbstractItemDelegate
@@ -1036,7 +1037,7 @@ void tst_QAbstractItemView::dragAndDropOnChild()
++successes;
}
- QVERIFY(successes == 0);
+ QCOMPARE(successes, 0);
}
#endif // 0
@@ -1214,7 +1215,7 @@ void tst_QAbstractItemView::setCurrentIndex()
view->setModel(model);
view->setCurrentIndex(model->index(0,0));
- QVERIFY(view->currentIndex() == model->index(0,0));
+ QCOMPARE(view->currentIndex(), model->index(0,0));
view->setCurrentIndex(model->index(1,0));
QVERIFY(view->currentIndex() == model->index(result ? 1 : 0,0));
}
@@ -1990,5 +1991,42 @@ void tst_QAbstractItemView::shiftSelectionAfterChangingModelContents()
QVERIFY(selected.contains(indexE));
}
+void tst_QAbstractItemView::QTBUG48968_reentrant_updateEditorGeometries()
+{
+
+ QStandardItemModel *m = new QStandardItemModel(this);
+ for (int i=0; i<10; ++i) {
+ QStandardItem *item = new QStandardItem(QString("Item number %1").arg(i));
+ item->setEditable(true);
+ for (int j=0; j<5; ++j) {
+ QStandardItem *child = new QStandardItem(QString("Child Item number %1").arg(j));
+ item->setChild(j, 0, child);
+ }
+ m->setItem(i, 0, item);
+ }
+
+ QTreeView tree;
+ tree.setModel(m);
+ tree.setRootIsDecorated(false);
+ QObject::connect(&tree, SIGNAL(doubleClicked(QModelIndex)), &tree, SLOT(setRootIndex(QModelIndex)));
+ tree.show();
+ QTest::qWaitForWindowActive(&tree);
+
+ // Trigger editing idx
+ QModelIndex idx = m->index(1, 0);
+ const QPoint pos = tree.visualRect(idx).center();
+ QTest::mouseClick(tree.viewport(), Qt::LeftButton, Qt::NoModifier, pos);
+ QTest::mouseDClick(tree.viewport(), Qt::LeftButton, Qt::NoModifier, pos);
+
+ // Add more children to idx
+ QStandardItem *item = m->itemFromIndex(idx);
+ for (int j=5; j<10; ++j) {
+ QStandardItem *child = new QStandardItem(QString("Child Item number %1").arg(j));
+ item->setChild(j, 0, child);
+ }
+
+ // No crash, all fine.
+}
+
QTEST_MAIN(tst_QAbstractItemView)
#include "tst_qabstractitemview.moc"
diff --git a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
index f5e6facaad..6645da727c 100644
--- a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
@@ -292,7 +292,7 @@ void tst_QColumnView::grips()
for (int i = 0 ; i < list.count(); ++i) {
if (QAbstractItemView *view = qobject_cast<QAbstractItemView*>(list.at(i))) {
if (view->isVisible())
- QVERIFY(view->cornerWidget() == 0);
+ QVERIFY(!view->cornerWidget());
}
}
}
@@ -587,7 +587,7 @@ void tst_QColumnView::selectAll()
QVERIFY(view.selectionModel()->selectedIndexes().count() > 0);
view.setCurrentIndex(QModelIndex());
- QVERIFY(view.selectionModel()->selectedIndexes().count() == 0);
+ QCOMPARE(view.selectionModel()->selectedIndexes().count(), 0);
}
void tst_QColumnView::clicked()
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 21e4b82366..55fcf04846 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -239,6 +239,8 @@ private slots:
void testStreamWithHide();
void testStylePosition();
+ void sizeHintCrash();
+
protected:
void setupTestData(bool use_reset_model = false);
void additionalInit();
@@ -403,7 +405,7 @@ void tst_QHeaderView::init()
view = new QHeaderView(Qt::Vertical,topLevel);
// Some initial value tests before a model is added
QCOMPARE(view->length(), 0);
- QVERIFY(view->sizeHint() == QSize(0,0));
+ QCOMPARE(view->sizeHint(), QSize(0,0));
QCOMPARE(view->sectionSizeHint(0), -1);
/*
@@ -925,9 +927,9 @@ void tst_QHeaderView::moveSection()
QFETCH(QList<int>, logical);
QFETCH(int, count);
- QVERIFY(from.count() == to.count());
- QVERIFY(from.count() == moved.count());
- QVERIFY(view->count() == logical.count());
+ QCOMPARE(from.count(), to.count());
+ QCOMPARE(from.count(), moved.count());
+ QCOMPARE(view->count(), logical.count());
QSignalSpy spy1(view, SIGNAL(sectionMoved(int,int,int)));
QCOMPARE(view->sectionsMoved(), false);
@@ -1370,15 +1372,15 @@ void tst_QHeaderView::unhideSection()
QCOMPARE(view->sectionsHidden(), false);
view->setSectionHidden(0, true);
QCOMPARE(view->sectionsHidden(), true);
- QVERIFY(view->sectionSize(0) == 0);
+ QCOMPARE(view->sectionSize(0), 0);
view->setSectionResizeMode(QHeaderView::Interactive);
view->setSectionHidden(0, false);
QVERIFY(view->sectionSize(0) > 0);
view->setSectionHidden(0, true);
- QVERIFY(view->sectionSize(0) == 0);
+ QCOMPARE(view->sectionSize(0), 0);
view->setSectionHidden(0, true);
- QVERIFY(view->sectionSize(0) == 0);
+ QCOMPARE(view->sectionSize(0), 0);
view->setSectionResizeMode(QHeaderView::Stretch);
view->setSectionHidden(0, false);
QVERIFY(view->sectionSize(0) > 0);
@@ -1645,7 +1647,7 @@ void tst_QHeaderView::saveRestore()
QByteArray s2 = h2.saveState();
- QVERIFY(s1 == s2);
+ QCOMPARE(s1, s2);
QVERIFY(!h2.restoreState(QByteArrayLiteral("Garbage")));
// QTBUG-40462
@@ -1659,7 +1661,7 @@ void tst_QHeaderView::saveRestore()
int sectionItemsLengthTotal = 0;
for (int i = 0; i < h2.count(); ++i)
sectionItemsLengthTotal += h2.sectionSize(i);
- QVERIFY(sectionItemsLengthTotal == h2.length());
+ QCOMPARE(sectionItemsLengthTotal, h2.length());
// Buggy setting where sum(sectionItems) != length. Check false is returned and this corrupted
// state isn't restored
@@ -1676,8 +1678,8 @@ void tst_QHeaderView::saveRestore()
// Check setting is correctly recognized as corrupted
QVERIFY(!h2.restoreState(settings_buggy_length));
// Check nothing has been actually restored
- QVERIFY(h2.length() == old_length);
- QVERIFY(h2.saveState() == old_state);
+ QCOMPARE(h2.length(), old_length);
+ QCOMPARE(h2.saveState(), old_state);
}
void tst_QHeaderView::defaultSectionSizeTest()
@@ -1699,7 +1701,7 @@ void tst_QHeaderView::defaultSectionSizeTest()
// no hidden Sections
hv->resizeSection(1, 0);
hv->setDefaultSectionSize(defaultSize);
- QVERIFY(hv->sectionSize(1) == defaultSize);
+ QCOMPARE(hv->sectionSize(1), defaultSize);
// with hidden sections
hv->resizeSection(1, 0);
@@ -2277,7 +2279,7 @@ void tst_QHeaderView::QTBUG14242_hideSectionAutoSize()
for (int u = 0; u < hv->count(); ++u)
calced_length += hv->sectionSize(u);
- QVERIFY(calced_length == afterlength);
+ QCOMPARE(calced_length, afterlength);
}
void tst_QHeaderView::ensureNoIndexAtLength()
@@ -2286,9 +2288,9 @@ void tst_QHeaderView::ensureNoIndexAtLength()
QStandardItemModel amodel(4, 4);
qtv.setModel(&amodel);
QHeaderView *hv = qtv.verticalHeader();
- QVERIFY(hv->visualIndexAt(hv->length()) == -1);
+ QCOMPARE(hv->visualIndexAt(hv->length()), -1);
hv->resizeSection(hv->count() - 1, 0);
- QVERIFY(hv->visualIndexAt(hv->length()) == -1);
+ QCOMPARE(hv->visualIndexAt(hv->length()), -1);
}
void tst_QHeaderView::offsetConsistent()
@@ -2307,7 +2309,7 @@ void tst_QHeaderView::offsetConsistent()
hv->hideSection(sectionToHide);
hv->setOffsetToSectionPosition(150);
int offset2 = hv->offset();
- QVERIFY(offset1 == offset2);
+ QCOMPARE(offset1, offset2);
// Ensure that hidden indexes (still) is considered.
hv->resizeSection(sectionToHide, hv->sectionSize(200) * 2);
hv->setOffsetToSectionPosition(800);
@@ -2600,8 +2602,8 @@ void tst_QHeaderView::logicalIndexAtTest()
//qDebug() << "logicalIndexAtTest" << check1 << check2;
const int precalced_check1 = 106327;
const int precalced_check2 = 29856418;
- QVERIFY(precalced_check1 == check1);
- QVERIFY(precalced_check2 == check2);
+ QCOMPARE(precalced_check1, check1);
+ QCOMPARE(precalced_check2, check2);
const int precalced_results[] = { 1145298384, -1710423344, -650981936, 372919464, -1544372176, -426463328, 12124 };
calculateAndCheck(__LINE__, precalced_results);
@@ -2628,8 +2630,8 @@ void tst_QHeaderView::visualIndexAtTest()
//qDebug() << "visualIndexAtTest" << check1 << check2;
const int precalced_check1 = 72665;
const int precalced_check2 = 14015890;
- QVERIFY(precalced_check1 == check1);
- QVERIFY(precalced_check2 == check2);
+ QCOMPARE(precalced_check1, check1);
+ QCOMPARE(precalced_check2, check2);
const int precalced_results[] = { 1145298384, -1710423344, -1457520212, 169223959, 557466160, -324939600, 5453 };
calculateAndCheck(__LINE__, precalced_results);
@@ -2879,5 +2881,15 @@ void tst_QHeaderView::testStylePosition()
QCOMPARE(proxy.lastPosition, QStyleOptionHeader::OnlyOneSection);
}
+void tst_QHeaderView::sizeHintCrash()
+{
+ QTreeView treeView;
+ QStandardItemModel *model = new QStandardItemModel(&treeView);
+ model->appendRow(new QStandardItem("QTBUG-48543"));
+ treeView.setModel(model);
+ treeView.header()->sizeHintForColumn(0);
+ treeView.header()->sizeHintForRow(0);
+}
+
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 439eeff005..25f27cb0c7 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -804,9 +804,9 @@ void tst_QItemDelegate::dateTimeEditor()
dateTimeEditor->setTime(time.addSecs(600));
widget.clearFocus();
- QVERIFY(item1->data(Qt::EditRole).userType() == QMetaType::QTime);
- QVERIFY(item2->data(Qt::EditRole).userType() == QMetaType::QDate);
- QVERIFY(item3->data(Qt::EditRole).userType() == QMetaType::QDateTime);
+ QCOMPARE(item1->data(Qt::EditRole).userType(), int(QMetaType::QTime));
+ QCOMPARE(item2->data(Qt::EditRole).userType(), int(QMetaType::QDate));
+ QCOMPARE(item3->data(Qt::EditRole).userType(), int(QMetaType::QDateTime));
}
// A delegate where we can either enforce a certain widget or use the standard widget.
@@ -901,9 +901,9 @@ void tst_QItemDelegate::dateAndTimeEditorTest2()
s.setData(i1, datetime2);
editor = w.fastEdit(i1);
timeEdit = qobject_cast<QTimeEdit*>(editor);
- QVERIFY(timeEdit == 0);
+ QVERIFY(!timeEdit);
dateEdit = qobject_cast<QDateEdit*>(editor);
- QVERIFY(dateEdit == 0);
+ QVERIFY(!dateEdit);
dateTimeEdit = qobject_cast<QDateTimeEdit*>(editor);
QVERIFY(dateTimeEdit);
QCOMPARE(dateTimeEdit->dateTime(), datetime2);
@@ -1154,7 +1154,7 @@ void tst_QItemDelegate::editorEvent_data()
QTest::newRow("unchecked, tristate, release")
<< (int)(Qt::Unchecked)
- << (int)(defaultFlags | Qt::ItemIsTristate)
+ << (int)(defaultFlags | Qt::ItemIsAutoTristate)
<< true
<< (int)(QEvent::MouseButtonRelease)
<< (int)(Qt::LeftButton)
@@ -1163,7 +1163,7 @@ void tst_QItemDelegate::editorEvent_data()
QTest::newRow("partially checked, tristate, release")
<< (int)(Qt::PartiallyChecked)
- << (int)(defaultFlags | Qt::ItemIsTristate)
+ << (int)(defaultFlags | Qt::ItemIsAutoTristate)
<< true
<< (int)(QEvent::MouseButtonRelease)
<< (int)(Qt::LeftButton)
@@ -1172,7 +1172,7 @@ void tst_QItemDelegate::editorEvent_data()
QTest::newRow("checked, tristate, release")
<< (int)(Qt::Checked)
- << (int)(defaultFlags | Qt::ItemIsTristate)
+ << (int)(defaultFlags | Qt::ItemIsAutoTristate)
<< true
<< (int)(QEvent::MouseButtonRelease)
<< (int)(Qt::LeftButton)
diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
index 3a6f1f933d..8fd86ea467 100644
--- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
+++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
@@ -483,6 +483,7 @@ void tst_QItemView::spider()
view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll);
view->setModel(treeModel);
view->show();
+ QVERIFY(QTest::qWaitForWindowActive(view));
#if defined(Q_OS_WINCE)
srandom(0);
#else
@@ -551,7 +552,7 @@ void tst_QItemView::visualRect()
QFETCH(bool, displays);
if (!displays){
- QVERIFY(view->visualRect(topIndex) == QRect());
+ QCOMPARE(view->visualRect(topIndex), QRect());
return;
}
@@ -559,15 +560,15 @@ void tst_QItemView::visualRect()
view->show();
QVERIFY(view->visualRect(topIndex) != QRect());
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).center()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).bottomLeft()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).bottomRight()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).topLeft()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).topRight()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).center()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).bottomLeft()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).bottomRight()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).topLeft()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).topRight()));
testViews->hideIndexes(view);
QModelIndex hiddenIndex = treeModel->index(1, 0);
- QVERIFY(view->visualRect(hiddenIndex) == QRect());
+ QCOMPARE(view->visualRect(hiddenIndex), QRect());
}
void tst_QItemView::walkScreen(QAbstractItemView *view)
@@ -615,7 +616,7 @@ void walkIndex(QModelIndex index, QAbstractItemView *view)
if (view->indexAt(point) != index) {
qDebug() << "index" << index << "visualRect" << visualRect << point << view->indexAt(point);
}
- QVERIFY(view->indexAt(point) == index);
+ QCOMPARE(view->indexAt(point), index);
}
}
diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
index 0623fc8ede..509303b62e 100644
--- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro
+++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
@@ -3,3 +3,4 @@ TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib
SOURCES += tst_qlistview.cpp
win32:!wince:!winrt: LIBS += -luser32
+linux*: CONFIG += insignificant_test # Crashes
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 1b21096b44..5b206af357 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -38,6 +38,7 @@
#include <qapplication.h>
#include <qlistview.h>
#include <private/qlistview_p.h>
+#include <private/qcoreapplication_p.h>
#include <qlistwidget.h>
#include <qitemdelegate.h>
#include <qstandarditemmodel.h>
@@ -150,6 +151,7 @@ private slots:
void testViewOptions();
void taskQTBUG_39902_mutualScrollBars_data();
void taskQTBUG_39902_mutualScrollBars();
+ void horizontalScrollingByVerticalWheelEvents();
};
// Testing get/set functions
@@ -1209,7 +1211,7 @@ void tst_QListView::scrollTo()
list << "Short item";
model.setStringList(list);
lv.setModel(&model);
- lv.setFixedSize(100, 200);
+ lv.setFixedSize(110, 200);
topLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
@@ -2018,8 +2020,7 @@ void tst_QListView::styleOptionViewItem()
public:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
- QVERIFY(qstyleoption_cast<const QStyleOptionViewItemV4 *>(&option));
- QStyleOptionViewItemV4 opt(option);
+ QStyleOptionViewItem opt(option);
initStyleOption(&opt, index);
QCOMPARE(opt.index, index);
@@ -2445,5 +2446,52 @@ void tst_QListView::taskQTBUG_39902_mutualScrollBars()
QTRY_VERIFY(view->verticalScrollBar()->isVisible());
}
+void tst_QListView::horizontalScrollingByVerticalWheelEvents()
+{
+ QListView lv;
+ lv.setWrapping(true);
+
+ TestDelegate *delegate = new TestDelegate(&lv);
+ delegate->m_sizeHint = QSize(100, 100);
+ lv.setItemDelegate(delegate);
+
+ QtTestModel model;
+ model.colCount = 1;
+ model.rCount = 100;
+
+ lv.setModel(&model);
+
+ lv.resize(300, 300);
+ lv.show();
+ QTest::qWaitForWindowExposed(&lv);
+
+ QPoint globalPos = lv.geometry().center();
+ QPoint pos = lv.viewport()->geometry().center();
+
+ QWheelEvent wheelDownEvent(pos, globalPos, QPoint(0, 0), QPoint(0, -120), -120, Qt::Vertical, 0, 0);
+ QWheelEvent wheelUpEvent(pos, globalPos, QPoint(0, 0), QPoint(0, 120), 120, Qt::Vertical, 0, 0);
+ QWheelEvent wheelLeftDownEvent(pos, globalPos, QPoint(0, 0), QPoint(120, -120), -120, Qt::Vertical, 0, 0);
+
+ int hValue = lv.horizontalScrollBar()->value();
+ QApplication::sendEvent(lv.viewport(), &wheelDownEvent);
+ QVERIFY(lv.horizontalScrollBar()->value() > hValue);
+
+ QApplication::sendEvent(lv.viewport(), &wheelUpEvent);
+ QCOMPARE(lv.horizontalScrollBar()->value(), hValue);
+
+ QApplication::sendEvent(lv.viewport(), &wheelLeftDownEvent);
+ QCOMPARE(lv.horizontalScrollBar()->value(), hValue);
+
+ // ensure that vertical wheel events are not converted when vertical
+ // scroll bar is not visible but vertical scrolling is possible
+ lv.setWrapping(false);
+ lv.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ QApplication::processEvents();
+
+ int vValue = lv.verticalScrollBar()->value();
+ QApplication::sendEvent(lv.viewport(), &wheelDownEvent);
+ QVERIFY(lv.verticalScrollBar()->value() > vValue);
+}
+
QTEST_MAIN(tst_QListView)
#include "tst_qlistview.moc"
diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
index dcbdbe824a..ecf72613da 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
@@ -427,9 +427,9 @@ void tst_QListWidget::currentItem()
// actual test
QModelIndex currentIndex = testWidget->selectionModel()->currentIndex();
if (currentIndex.isValid())
- QVERIFY(testWidget->currentItem() == testWidget->item(currentIndex.row()));
+ QCOMPARE(testWidget->currentItem(), testWidget->item(currentIndex.row()));
else
- QVERIFY(testWidget->currentItem() == (QListWidgetItem*)0);
+ QCOMPARE(testWidget->currentItem(), (QListWidgetItem*)0);
}
void tst_QListWidget::currentRow()
@@ -742,7 +742,7 @@ void tst_QListWidget::selectedItems()
QFETCH(IntList, selectedRows);
QFETCH(IntList, expectedRows);
- QVERIFY(testWidget->count() == 0);
+ QCOMPARE(testWidget->count(), 0);
//insert items
for (int i=0; i<itemCount; ++i)
@@ -1159,7 +1159,7 @@ void tst_QListWidget::setData()
QFETCH(int, expectedSignalCount);
qRegisterMetaType<QListWidgetItem *>("QListWidgetItem*");
- QVERIFY(roles.count() == values.count());
+ QCOMPARE(roles.count(), values.count());
for (int manipulateModel=0; manipulateModel<2; ++manipulateModel) {
testWidget->clear();
@@ -1711,7 +1711,7 @@ void tst_QListWidget::mimeData()
QVERIFY(data->hasFormat(format));
QVERIFY(data2->hasFormat(format));
- QVERIFY(data->data(format) == data2->data(format));
+ QCOMPARE(data->data(format), data2->data(format));
delete data;
delete data2;
diff --git a/tests/auto/widgets/itemviews/qtableview/BLACKLIST b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
index fc231a4e30..329010a86e 100644
--- a/tests/auto/widgets/itemviews/qtableview/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
@@ -1,2 +1,4 @@
[moveCursorBiggerJump]
osx
+[resizeColumnsToContents]
+ubuntu-14.04
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index 75f77f8107..e5abd6bc46 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -2249,11 +2249,11 @@ void tst_QTableView::resizeColumnsToContents_data()
QTest::addColumn<int>("rowHeight");
QTest::addColumn<int>("columnWidth");
- QTest::newRow("10x10 grid shown 40x40")
- << 10 << 10 << false << 40 << 40 << 40 << 40;
+ QTest::newRow("10x10 grid not shown 60x60")
+ << 10 << 10 << false << 60 << 60 << 60 << 60;
- QTest::newRow("10x10 grid not shown 40x40")
- << 10 << 10 << true << 40 << 40 << 41 << 41;
+ QTest::newRow("10x10 grid shown 60x60")
+ << 10 << 10 << true << 60 << 60 << 61 << 61;
}
void tst_QTableView::resizeColumnsToContents()
@@ -4051,9 +4051,9 @@ void tst_QTableView::mouseWheel()
QWheelEvent verticalEvent(pos, delta, 0, 0, Qt::Vertical);
QWheelEvent horizontalEvent(pos, delta, 0, 0, Qt::Horizontal);
QApplication::sendEvent(view.viewport(), &horizontalEvent);
- QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 10);
+ QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 15);
QApplication::sendEvent(view.viewport(), &verticalEvent);
- QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 10);
+ QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 15);
}
#endif // !QT_NO_WHEELEVENT
diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
index 36bc23910c..ea31fd19dd 100644
--- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
@@ -94,6 +94,7 @@ private slots:
void task262056_sortDuplicate();
void itemWithHeaderItems();
void mimeData();
+ void selectedRowAfterSorting();
private:
QTableWidget *testWidget;
@@ -196,9 +197,9 @@ void tst_QTableWidget::clearContents()
{
QTableWidgetItem *item = new QTableWidgetItem("test");
testWidget->setHorizontalHeaderItem(0, item);
- QVERIFY(testWidget->horizontalHeaderItem(0) == item);
+ QCOMPARE(testWidget->horizontalHeaderItem(0), item);
testWidget->clearContents();
- QVERIFY(testWidget->horizontalHeaderItem(0) == item);
+ QCOMPARE(testWidget->horizontalHeaderItem(0), item);
}
void tst_QTableWidget::clear()
@@ -1559,11 +1560,29 @@ void tst_QTableWidget::mimeData()
QVERIFY(data->hasFormat(format));
QVERIFY(data2->hasFormat(format));
- QVERIFY(data->data(format) == data2->data(format));
+ QCOMPARE(data->data(format), data2->data(format));
delete data;
delete data2;
}
+void tst_QTableWidget::selectedRowAfterSorting()
+{
+ TestTableWidget table(3,3);
+ table.setSelectionBehavior(QAbstractItemView::SelectRows);
+ for (int r = 0; r < 3; r++)
+ for (int c = 0; c < 3; c++)
+ table.setItem(r,c,new QTableWidgetItem(QStringLiteral("0")));
+ QHeaderView *localHorizontalHeader = table.horizontalHeader();
+ localHorizontalHeader->setSortIndicator(1,Qt::DescendingOrder);
+ table.setProperty("sortingEnabled",true);
+ table.selectRow(1);
+ table.item(1,1)->setText("9");
+ QCOMPARE(table.selectedItems().count(),3);
+ foreach (QTableWidgetItem *item, table.selectedItems()) {
+ QCOMPARE(item->row(),0);
+ }
+}
+
QTEST_MAIN(tst_QTableWidget)
#include "tst_qtablewidget.moc"
diff --git a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
index 3abd58e73d..e8406dab7b 100644
--- a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
+++ b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
@@ -4,3 +4,5 @@ QT += widgets testlib
QT += widgets-private gui-private core-private
SOURCES += tst_qtreeview.cpp
HEADERS += ../../../../shared/fakedirmodel.h
+
+win32: CONFIG += insignificant_test
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 340637513c..033464c9db 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -253,7 +253,6 @@ private slots:
void taskQTBUG_25333_adjustViewOptionsForIndex();
void taskQTBUG_18539_emitLayoutChanged();
void taskQTBUG_8176_emitOnExpandAll();
- void taskQTBUG_34717_collapseAtBottom();
void taskQTBUG_37813_crash();
void taskQTBUG_45697_crash();
void testInitialFocus();
@@ -2365,7 +2364,7 @@ void tst_QTreeView::selectionOrderTest()
void tst_QTreeView::selection()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This causes a crash triggered by setVisible(false)");
QTreeView treeView;
@@ -3076,7 +3075,7 @@ void tst_QTreeView::styleOptionViewItem()
{
class MyDelegate : public QStyledItemDelegate
{
- static QString posToString(QStyleOptionViewItemV4::ViewItemPosition pos) {
+ static QString posToString(QStyleOptionViewItem::ViewItemPosition pos) {
static const char* s_pos[] = { "Invalid", "Beginning", "Middle", "End", "OnlyOne" };
return s_pos[pos];
}
@@ -3089,8 +3088,7 @@ void tst_QTreeView::styleOptionViewItem()
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
- QVERIFY(qstyleoption_cast<const QStyleOptionViewItemV4 *>(&option));
- QStyleOptionViewItemV4 opt(option);
+ QStyleOptionViewItem opt(option);
initStyleOption(&opt, index);
QVERIFY(!opt.text.isEmpty());
@@ -3098,20 +3096,20 @@ void tst_QTreeView::styleOptionViewItem()
//qDebug() << index << opt.text;
if (allCollapsed)
- QCOMPARE(!(opt.features & QStyleOptionViewItemV2::Alternate), !(index.row() % 2));
- QCOMPARE(!(opt.features & QStyleOptionViewItemV2::HasCheckIndicator), !opt.text.contains("Checkable"));
+ QCOMPARE(!(opt.features & QStyleOptionViewItem::Alternate), !(index.row() % 2));
+ QCOMPARE(!(opt.features & QStyleOptionViewItem::HasCheckIndicator), !opt.text.contains("Checkable"));
if (opt.text.contains("Beginning"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Beginning));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::Beginning));
if (opt.text.contains("Middle"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Middle));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::Middle));
if (opt.text.contains("End"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::End));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::End));
if (opt.text.contains("OnlyOne"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::OnlyOne));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::OnlyOne));
if (opt.text.contains("Checked"))
QCOMPARE(opt.checkState, Qt::Checked);
@@ -3657,7 +3655,7 @@ void tst_QTreeView::task202039_closePersistentEditor()
QVERIFY(view.indexWidget(current));
view.closePersistentEditor(current);
- QVERIFY(view.indexWidget(current) == 0);
+ QVERIFY(!view.indexWidget(current));
//here was the bug: closing the persistent editor would not reset the state
//and it was impossible to go into editinon again
@@ -4193,7 +4191,7 @@ void tst_QTreeView::taskQTBUG_25333_adjustViewOptionsForIndex()
#ifdef QT_BUILD_INTERNAL
{
- QStyleOptionViewItemV4 option;
+ QStyleOptionViewItem option;
view.aiv_priv()->adjustViewOptionsForIndex(&option, model.indexFromItem(item1));
@@ -4283,35 +4281,6 @@ void tst_QTreeView::taskQTBUG_8176_emitOnExpandAll()
QCOMPARE(spy2.size(), 1); // item2 is collapsed
}
-// From QTBUG_34717 (QTreeWidget crashes when scrolling to the end
-// of an expanded tree, then collapse all)
-// The test passes simply if it doesn't crash.
-void tst_QTreeView::taskQTBUG_34717_collapseAtBottom()
-{
- QTreeWidget treeWidget;
- treeWidget.header()->setSectionResizeMode(QHeaderView::ResizeToContents);
- treeWidget.setColumnCount(2);
- QTreeWidgetItem *mainItem = new QTreeWidgetItem(&treeWidget, QStringList() << "Root");
- for (int i = 0; i < 200; ++i) {
- QTreeWidgetItem *item = new QTreeWidgetItem(mainItem, QStringList(QString("Item")));
- new QTreeWidgetItem(item, QStringList() << "Child" << "1");
- new QTreeWidgetItem(item, QStringList() << "Child" << "2");
- new QTreeWidgetItem(item, QStringList() << "Child" << "3");
- }
- treeWidget.show();
- treeWidget.expandAll();
- treeWidget.scrollToBottom();
- treeWidget.collapseAll();
-
- treeWidget.setAnimated(true);
- treeWidget.expandAll();
- treeWidget.scrollToBottom();
- mainItem->setExpanded(false);
-
- PublicView *pview = (PublicView*) &treeWidget;
- QVERIFY(pview->sizeHintForColumn(1) >= 0);
-}
-
void tst_QTreeView::testInitialFocus()
{
QTreeWidget treeWidget;
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 5c881369a0..117c53a2bb 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -161,6 +161,7 @@ private slots:
void taskQTBUG2844_visualItemRect();
void setChildIndicatorPolicy();
+ void taskQTBUG_34717_collapseAtBottom();
void task20345_sortChildren();
void getMimeDataWithInvalidItem();
@@ -1037,7 +1038,7 @@ void tst_QTreeWidget::checkState()
QCOMPARE(firstChild->checkState(0), Qt::Checked);
QCOMPARE(seccondChild->checkState(0), Qt::Unchecked);
- item->setFlags(item->flags()|Qt::ItemIsTristate);
+ item->setFlags(item->flags()|Qt::ItemIsAutoTristate);
QCOMPARE(item->checkState(0), Qt::PartiallyChecked);
QCOMPARE(firstChild->checkState(0), Qt::Checked);
QCOMPARE(seccondChild->checkState(0), Qt::Unchecked);
@@ -1586,7 +1587,7 @@ void tst_QTreeWidget::scrollToItem()
testWidget->setHeaderLabels(QStringList() << "foo");
testWidget->scrollToItem(search);
- QVERIFY(search->text(0) == "111");
+ QCOMPARE(search->text(0), QLatin1String("111"));
bar = search->parent();
QVERIFY(testWidget->isItemExpanded(bar));
@@ -2287,7 +2288,7 @@ void tst_QTreeWidget::insertExpandedItemsWithSorting()
QCOMPARE(parent->childCount(), childText.count());
QVERIFY(parent->isExpanded());
}
- QVERIFY(tree.model()->rowCount() == parentText.count());
+ QCOMPARE(tree.model()->rowCount(), parentText.count());
// verify that the items are still expanded
foreach (QTreeWidgetItem *item, items) {
@@ -2659,7 +2660,7 @@ void tst_QTreeWidget::sortedIndexOfChild()
tw.sortItems(0, (Qt::SortOrder)sortOrder);
tw.expandAll();
- QVERIFY(itms.count() == expectedIndexes.count());
+ QCOMPARE(itms.count(), expectedIndexes.count());
for (int j = 0; j < expectedIndexes.count(); ++j)
QCOMPARE(top->indexOfChild(itms.at(j)), expectedIndexes.at(j));
}
@@ -3155,11 +3156,11 @@ void tst_QTreeWidget::setSelectionModel()
void tst_QTreeWidget::task217309()
{
QTreeWidgetItem item;
- item.setFlags(item.flags() | Qt::ItemIsTristate);
+ item.setFlags(item.flags() | Qt::ItemIsAutoTristate);
QTreeWidgetItem subitem1;
- subitem1.setFlags(subitem1.flags() | Qt::ItemIsTristate);
+ subitem1.setFlags(subitem1.flags() | Qt::ItemIsAutoTristate);
QTreeWidgetItem subitem2;
- subitem2.setFlags(subitem2.flags() | Qt::ItemIsTristate);
+ subitem2.setFlags(subitem2.flags() | Qt::ItemIsAutoTristate);
item.addChild(&subitem1);
item.addChild(&subitem2);
subitem1.setCheckState(0, Qt::Checked);
@@ -3180,7 +3181,7 @@ void tst_QTreeWidget::nonEditableTristate()
QTreeWidget *tree = new QTreeWidget;
QTreeWidgetItem *item = new QTreeWidgetItem();
tree->insertTopLevelItem(0, item);
- item->setFlags(item->flags() | Qt::ItemIsTristate);
+ item->setFlags(item->flags() | Qt::ItemIsAutoTristate);
item->setCheckState(0, Qt::Unchecked);
QTreeWidgetItem *subitem1 = new QTreeWidgetItem(item);
subitem1->setCheckState(0, Qt::Unchecked);
@@ -3235,7 +3236,7 @@ void tst_QTreeWidget::setCurrentItemExpandsParent()
QTreeWidgetItem *i1 = new QTreeWidgetItem(&w, QStringList() << "parent");
QTreeWidgetItem *i2 = new QTreeWidgetItem(i1, QStringList() << "child");
QVERIFY(!i2->isExpanded());
- QVERIFY(w.currentItem() == 0);
+ QVERIFY(!w.currentItem());
w.setCurrentItem(i2);
QVERIFY(!i2->isExpanded());
QCOMPARE(w.currentItem(), i2);
@@ -3378,9 +3379,41 @@ void tst_QTreeWidget::setChildIndicatorPolicy()
QTRY_COMPARE(delegate.numPaints, 1);
}
+// From QTBUG_34717 (QTreeWidget crashes when scrolling to the end
+// of an expanded tree, then collapse all)
+// The test passes simply if it doesn't crash.
+void tst_QTreeWidget::taskQTBUG_34717_collapseAtBottom()
+{
+ struct PublicTreeWidget: public QTreeWidget
+ {
+ inline int sizeHintForColumn(int column) const { return QTreeWidget::sizeHintForColumn(column); }
+ };
+ PublicTreeWidget treeWidget;
+ treeWidget.header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ treeWidget.setColumnCount(2);
+ QTreeWidgetItem *mainItem = new QTreeWidgetItem(&treeWidget, QStringList() << "Root");
+ for (int i = 0; i < 200; ++i) {
+ QTreeWidgetItem *item = new QTreeWidgetItem(mainItem, QStringList(QString("Item")));
+ new QTreeWidgetItem(item, QStringList() << "Child" << "1");
+ new QTreeWidgetItem(item, QStringList() << "Child" << "2");
+ new QTreeWidgetItem(item, QStringList() << "Child" << "3");
+ }
+ treeWidget.show();
+ treeWidget.expandAll();
+ treeWidget.scrollToBottom();
+ treeWidget.collapseAll();
+
+ treeWidget.setAnimated(true);
+ treeWidget.expandAll();
+ treeWidget.scrollToBottom();
+ mainItem->setExpanded(false);
+
+ QVERIFY(treeWidget.sizeHintForColumn(1) >= 0);
+}
+
void tst_QTreeWidget::task20345_sortChildren()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This causes a crash triggered by setVisible(false)");
// This test case is considered successful if it is executed (no crash in sorting)
diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
index 490f87a7ef..c52198fa2c 100644
--- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
@@ -1112,13 +1112,13 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget()
delete item;
item = *it;
if (expecteditemIsNull) {
- QVERIFY(item == 0);
+ QVERIFY(!item);
} else {
QVERIFY(item);
QCOMPARE(item->text(0), expecteditemvalue);
item = *itRemove;
if (expectedUpdatedCurrent.isNull()) {
- QVERIFY(item == 0);
+ QVERIFY(!item);
} else {
QCOMPARE(item->text(0), expectedUpdatedCurrent);
}
diff --git a/tests/auto/widgets/kernel/qaction/BLACKLIST b/tests/auto/widgets/kernel/qaction/BLACKLIST
index f67a3c471e..1ad524fdbf 100644
--- a/tests/auto/widgets/kernel/qaction/BLACKLIST
+++ b/tests/auto/widgets/kernel/qaction/BLACKLIST
@@ -1,2 +1,2 @@
[setStandardKeys]
-ubuntu-14.04
+linux
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 897128d40e..71b55d71ea 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -242,7 +242,7 @@ void tst_QAction::setStandardKeys()
QList<QKeySequence> list;
act.setShortcuts(list);
act.setShortcuts(QKeySequence::Copy);
- QVERIFY(act.shortcut() == act.shortcuts().first());
+ QCOMPARE(act.shortcut(), act.shortcuts().first());
QList<QKeySequence> expected;
const QKeySequence ctrlC = QKeySequence(QStringLiteral("CTRL+C"));
diff --git a/tests/auto/widgets/kernel/qactiongroup/BLACKLIST b/tests/auto/widgets/kernel/qactiongroup/BLACKLIST
new file mode 100644
index 0000000000..fdc424b6ac
--- /dev/null
+++ b/tests/auto/widgets/kernel/qactiongroup/BLACKLIST
@@ -0,0 +1,2 @@
+[QTBUG_14292_filesystem]
+linux
diff --git a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
index 8ce9941238..81e5542e91 100644
--- a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
@@ -42,6 +42,7 @@ class tst_QActionGroup : public QObject
Q_OBJECT
private slots:
+ void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
void enabledPropagation();
void visiblePropagation();
void exclusive();
@@ -223,7 +224,7 @@ void tst_QActionGroup::unCheckCurrentAction()
current->setChecked(false);
QVERIFY(!action1.isChecked());
QVERIFY(!action2.isChecked());
- QVERIFY(group.checkedAction() == 0);
+ QVERIFY(!group.checkedAction());
}
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST
new file mode 100644
index 0000000000..6abb1d9988
--- /dev/null
+++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST
@@ -0,0 +1,4 @@
+[quitOnLastWindowClosed]
+osx-10.10
+[touchEventPropagation]
+xcb
diff --git a/tests/auto/widgets/kernel/qapplication/qapplication.pro b/tests/auto/widgets/kernel/qapplication/qapplication.pro
index 3d167827a3..21bfb50aee 100644
--- a/tests/auto/widgets/kernel/qapplication/qapplication.pro
+++ b/tests/auto/widgets/kernel/qapplication/qapplication.pro
@@ -1,7 +1,6 @@
TEMPLATE = subdirs
-SUBDIRS = desktopsettingsaware modal
+!winrt: SUBDIRS = desktopsettingsaware modal
-win32:!wince: SUBDIRS += wincmdline
test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/widgets/kernel/qapplication/test/BLACKLIST b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST
new file mode 100644
index 0000000000..f4a9cb6166
--- /dev/null
+++ b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST
@@ -0,0 +1,2 @@
+[quitOnLastWindowClosed]
+osx-10.10
diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro
index b617c228ac..908aa846c0 100644
--- a/tests/auto/widgets/kernel/qapplication/test/test.pro
+++ b/tests/auto/widgets/kernel/qapplication/test/test.pro
@@ -9,7 +9,10 @@ TARGET = ../tst_qapplication
TESTDATA = ../test/test.pro ../tmp/README
-SUBPROGRAMS = desktopsettingsaware modal
-win32:!wince: SUBPROGRAMS += wincmdline
+!winrt {
+ SUBPROGRAMS = desktopsettingsaware modal
+ win32:!wince: SUBPROGRAMS += wincmdline
+
+ for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
+}
-for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 84956d0a02..878136b4a0 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -62,6 +62,7 @@
#endif
#include <qpa/qwindowsysteminterface.h>
+#include <private/qhighdpiscaling_p.h>
#include "../../../qtest-config.h"
@@ -162,9 +163,6 @@ private slots:
void setAttribute();
- void windowsCommandLine_data();
- void windowsCommandLine();
-
void touchEventPropagation();
void qtbug_12673();
@@ -1160,7 +1158,7 @@ void tst_QApplication::sendPostedEvents()
QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection);
QPointer<SendPostedEventsTester> p = tester;
(void) app.exec();
- QVERIFY(p == 0);
+ QVERIFY(p.isNull());
}
void tst_QApplication::thread()
@@ -1178,8 +1176,8 @@ void tst_QApplication::thread()
// *before* the QApplication has a thread
QObject object;
QObject child(&object);
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
{
int argc = 0;
@@ -1209,8 +1207,8 @@ void tst_QApplication::thread()
QVERIFY(!currentThread->isFinished());
// should still have a thread
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
// do the test again, making sure that the thread is the same as
// before
@@ -1231,8 +1229,8 @@ void tst_QApplication::thread()
QVERIFY(!currentThread->isFinished());
// should still have a thread
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
QTestEventLoop::instance().enterLoop(1);
}
@@ -1246,8 +1244,8 @@ void tst_QApplication::thread()
QVERIFY(!currentThread->isFinished());
// should still have a thread
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
}
class DeleteLaterWidget : public QWidget
@@ -1561,9 +1559,9 @@ void tst_QApplication::focusChanged()
QCOMPARE(spy.at(0).count(), 2);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == 0);
+ QCOMPARE(now, &le1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QVERIFY(!old);
spy.clear();
QCOMPARE(spy.count(), 0);
@@ -1571,27 +1569,27 @@ void tst_QApplication::focusChanged()
QCOMPARE(spy.count(), 1);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le1);
+ QCOMPARE(now, &pb1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le1);
spy.clear();
lb1.setFocus();
QCOMPARE(spy.count(), 1);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &lb1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb1);
+ QCOMPARE(now, &lb1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb1);
spy.clear();
lb1.clearFocus();
QCOMPARE(spy.count(), 1);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == 0);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &lb1);
+ QVERIFY(!now);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &lb1);
spy.clear();
QWidget parent2;
@@ -1608,9 +1606,9 @@ void tst_QApplication::focusChanged()
QVERIFY(spy.count() > 0); // one for deactivation, one for activation on Windows
old = qvariant_cast<QWidget*>(spy.at(spy.count()-1).at(0));
now = qvariant_cast<QWidget*>(spy.at(spy.count()-1).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == 0);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QVERIFY(!old);
spy.clear();
QTestKeyEvent tab(QTest::Press, Qt::Key_Tab, 0, 0);
@@ -1632,82 +1630,82 @@ void tst_QApplication::focusChanged()
tab.simulate(now);
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &pb2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
}
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
tab.simulate(now);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb2);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb2);
spy.clear();
}
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
backtab.simulate(now);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &pb2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
}
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
old = &pb2;
} else {
backtab.simulate(now);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb2);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb2);
spy.clear();
}
click.simulate(old);
if (!(pb2.focusPolicy() & Qt::ClickFocus)) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &pb2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
click.simulate(old);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb2);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb2);
spy.clear();
}
@@ -1722,9 +1720,9 @@ void tst_QApplication::focusChanged()
else
old = qvariant_cast<QWidget*>(spy.at(spy.count()-2).at(0));
now = qvariant_cast<QWidget*>(spy.at(spy.count()-1).at(1));
- QVERIFY(now == &le1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &le1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
}
@@ -1933,39 +1931,6 @@ void tst_QApplication::setAttribute()
delete w;
}
-void tst_QApplication::windowsCommandLine_data()
-{
-#if defined(Q_OS_WIN)
- QTest::addColumn<QString>("args");
- QTest::addColumn<QString>("expected");
-
- QTest::newRow("hello world")
- << QString("Hello \"World\"")
- << QString("Hello \"World\"");
- QTest::newRow("sql")
- << QString("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PNR' AND TABLE_TYPE = 'VIEW' ORDER BY TABLE_NAME")
- << QString("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PNR' AND TABLE_TYPE = 'VIEW' ORDER BY TABLE_NAME");
-#endif
-}
-
-void tst_QApplication::windowsCommandLine()
-{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QFETCH(QString, args);
- QFETCH(QString, expected);
-
- QProcess testProcess;
- const QString path = QStringLiteral("wincmdline/wincmdline");
- testProcess.start(path, QStringList(args));
- QVERIFY2(testProcess.waitForStarted(),
- qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
- QVERIFY(testProcess.waitForFinished(10000));
- QByteArray error = testProcess.readAllStandardError();
- QString procError(error);
- QCOMPARE(procError, expected);
-#endif
-}
-
class TouchEventPropagationTestWidget : public QWidget
{
Q_OBJECT
@@ -2038,8 +2003,10 @@ void tst_QApplication::touchEventPropagation()
QVERIFY(QTest::qWaitForWindowExposed(&window));
// QPA always takes screen positions and since we map the TouchPoint back to QPA's structure first,
// we must ensure there is a screen position in the TouchPoint that maps to a local 0, 0.
- pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
- releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
+ const QPoint deviceGlobalPos =
+ QHighDpi::toNativePixels(window.mapToGlobal(QPoint(0, 0)), window.windowHandle()->screen());
+ pressedTouchPoints[0].setScreenPos(deviceGlobalPos);
+ releasedTouchPoints[0].setScreenPos(deviceGlobalPos);
QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
0,
@@ -2092,8 +2059,10 @@ void tst_QApplication::touchEventPropagation()
widget.setObjectName("2. widget");
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
- pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(50, 50)));
- releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(50, 50)));
+ const QPoint deviceGlobalPos =
+ QHighDpi::toNativePixels(window.mapToGlobal(QPoint(50, 50)), window.windowHandle()->screen());
+ pressedTouchPoints[0].setScreenPos(deviceGlobalPos);
+ releasedTouchPoints[0].setScreenPos(deviceGlobalPos);
QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
0,
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp b/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp
deleted file mode 100644
index 2d86b46875..0000000000
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite 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 <QApplication>
-#include <stdio.h>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- if (argc > 1)
- fprintf(stderr, "%s", argv[1]);
- else
- fprintf(stderr, "Failed");
- fflush(stderr);
- return 0;
-}
-
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
deleted file mode 100644
index 3e32a6798d..0000000000
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-QT += widgets
-CONFIG -= app_bundle debug_and_release_target
-SOURCES += main.cpp
-DESTDIR = ./
-
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 35a8636f0b..aeaf1e7bf0 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -48,17 +48,8 @@ class tst_QBoxLayout : public QObject
{
Q_OBJECT
-public:
- tst_QBoxLayout();
- virtual ~tst_QBoxLayout();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
+ void cleanup();
void insertSpacerItem();
void insertLayout();
void sizeHint();
@@ -120,34 +111,15 @@ int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * opti
return QProxyStyle::pixelMetric(metric, option, widget);
}
-
-tst_QBoxLayout::tst_QBoxLayout()
-{
-}
-
-tst_QBoxLayout::~tst_QBoxLayout()
-{
-}
-
-void tst_QBoxLayout::initTestCase()
-{
-}
-
-void tst_QBoxLayout::cleanupTestCase()
-{
-}
-
-void tst_QBoxLayout::init()
-{
-}
-
void tst_QBoxLayout::cleanup()
{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QBoxLayout::insertSpacerItem()
{
- QWidget *window = new QWidget;
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
QSpacerItem *spacer1 = new QSpacerItem(20, 10, QSizePolicy::Expanding, QSizePolicy::Expanding);
QSpacerItem *spacer2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -157,44 +129,43 @@ void tst_QBoxLayout::insertSpacerItem()
layout->addSpacerItem(spacer1);
layout->addWidget(new QLineEdit("Baaaaaaaaaaaaaaaaaaaaaaaaar"));
layout->insertSpacerItem(0, spacer2);
- window->setLayout(layout);
+ window.setLayout(layout);
- QVERIFY(layout->itemAt(0) == spacer2);
- QVERIFY(layout->itemAt(2) == spacer1);
+ QCOMPARE(layout->itemAt(0), spacer2);
+ QCOMPARE(layout->itemAt(2), spacer1);
- window->show();
+ window.show();
}
void tst_QBoxLayout::insertLayout()
{
- QWidget *window = new QWidget;
- QVBoxLayout *vbox = new QVBoxLayout(window);
- QVBoxLayout *dummyParentLayout = new QVBoxLayout;
+ QWidget window;
+ QVBoxLayout *vbox = new QVBoxLayout(&window);
+ QScopedPointer<QVBoxLayout> dummyParentLayout(new QVBoxLayout);
QHBoxLayout *subLayout = new QHBoxLayout;
dummyParentLayout->addLayout(subLayout);
- QCOMPARE(subLayout->parent(), dummyParentLayout);
+ QCOMPARE(subLayout->parent(), dummyParentLayout.data());
QCOMPARE(dummyParentLayout->count(), 1);
// add subLayout to another layout
QTest::ignoreMessage(QtWarningMsg, "QLayout::addChildLayout: layout \"\" already has a parent");
vbox->addLayout(subLayout);
QCOMPARE((subLayout->parent() == vbox), (vbox->count() == 1));
-
- delete dummyParentLayout;
- delete window;
}
void tst_QBoxLayout::sizeHint()
{
- QWidget *window = new QWidget;
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
QHBoxLayout *lay1 = new QHBoxLayout;
QHBoxLayout *lay2 = new QHBoxLayout;
QLabel *label = new QLabel("widget twooooooooooooooooooooooooooooooooooooooooooooooooooooooo");
lay2->addWidget(label);
lay1->addLayout(lay2);
- window->setLayout(lay1);
- window->show();
+ window.setLayout(lay1);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
label->setText("foooooooo baaaaaaar");
QSize sh = lay1->sizeHint();
QApplication::processEvents();
@@ -207,24 +178,26 @@ void tst_QBoxLayout::sizeHint()
void tst_QBoxLayout::sizeConstraints()
{
- QWidget *window = new QWidget;
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
QHBoxLayout *lay = new QHBoxLayout;
lay->addWidget(new QLabel("foooooooooooooooooooooooooooooooooooo"));
lay->addWidget(new QLabel("baaaaaaaaaaaaaaaaaaaaaaaaaaaaaar"));
lay->setSizeConstraint(QLayout::SetFixedSize);
- window->setLayout(lay);
- window->show();
- QApplication::processEvents();
- QSize sh = window->sizeHint();
+ window.setLayout(lay);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
+ QSize sh = window.sizeHint();
lay->takeAt(1);
- QVERIFY(sh.width() >= window->sizeHint().width() &&
- sh.height() >= window->sizeHint().height());
+ QVERIFY(sh.width() >= window.sizeHint().width() &&
+ sh.height() >= window.sizeHint().height());
}
void tst_QBoxLayout::setGeometry()
{
QWidget toplevel;
+ toplevel.setWindowTitle(QTest::currentTestFunction());
setFrameless(&toplevel);
QWidget w(&toplevel);
QVBoxLayout *lay = new QVBoxLayout;
@@ -247,33 +220,30 @@ void tst_QBoxLayout::setGeometry()
void tst_QBoxLayout::setStyleShouldChangeSpacing()
{
- QWidget *window = new QWidget;
- QHBoxLayout *hbox = new QHBoxLayout(window);
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
+ QHBoxLayout *hbox = new QHBoxLayout(&window);
QPushButton *pb1 = new QPushButton(tr("The spacing between this"));
QPushButton *pb2 = new QPushButton(tr("and this button should depend on the style of the parent widget"));;
pb1->setAttribute(Qt::WA_LayoutUsesWidgetRect);
pb2->setAttribute(Qt::WA_LayoutUsesWidgetRect);
hbox->addWidget(pb1);
hbox->addWidget(pb2);
- CustomLayoutStyle *style1 = new CustomLayoutStyle;
+ QScopedPointer<CustomLayoutStyle> style1(new CustomLayoutStyle);
style1->hspacing = 6;
- window->setStyle(style1);
- window->show();
+ window.setStyle(style1.data());
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
- QTest::qWait(100);
int spacing = pb2->geometry().left() - pb1->geometry().right() - 1;
QCOMPARE(spacing, 6);
- CustomLayoutStyle *style2 = new CustomLayoutStyle();
+ QScopedPointer<CustomLayoutStyle> style2(new CustomLayoutStyle());
style2->hspacing = 10;
- window->setStyle(style2);
+ window.setStyle(style2.data());
QTest::qWait(100);
spacing = pb2->geometry().left() - pb1->geometry().right() - 1;
QCOMPARE(spacing, 10);
-
- delete window;
- delete style1;
- delete style2;
}
void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
@@ -287,6 +257,7 @@ void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
layout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setLayout(layout);
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
@@ -325,6 +296,7 @@ void tst_QBoxLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setObjectName("347b469225a24a0ef05150a");
QVBoxLayout layout(&widget);
layout.setObjectName("ef9e2b42298e0e6420105bb");
@@ -340,6 +312,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setObjectName("fe44e5cb6c08006597126a");
QVBoxLayout layout(&widget);
layout.setObjectName("cc751dd0f50f62b05a62da");
diff --git a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
index b717c1deb1..e94dfa5754 100644
--- a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -73,6 +73,7 @@ void tst_QDesktopWidget::init()
void tst_QDesktopWidget::cleanup()
{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QDesktopWidget::numScreens()
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 8588df7afa..e1b494c9f1 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -60,17 +60,8 @@ class tst_QFormLayout : public QObject
{
Q_OBJECT
-public:
- tst_QFormLayout();
- ~tst_QFormLayout();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
+ void cleanup();
void rowCount();
void buddies();
void getItemPosition();
@@ -132,34 +123,15 @@ private slots:
};
-tst_QFormLayout::tst_QFormLayout()
-{
-}
-
-tst_QFormLayout::~tst_QFormLayout()
-{
-}
-
-void tst_QFormLayout::initTestCase()
-{
-}
-
-void tst_QFormLayout::cleanupTestCase()
-{
-}
-
-void tst_QFormLayout::init()
-{
-}
-
void tst_QFormLayout::cleanup()
{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QFormLayout::rowCount()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
fl->addRow(tr("Label 1"), new QLineEdit);
fl->addRow(tr("Label 2"), new QLineEdit);
@@ -174,14 +146,12 @@ void tst_QFormLayout::rowCount()
QCOMPARE(fl->rowCount(), 6);
//TODO: remove items
-
- delete w;
}
void tst_QFormLayout::buddies()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
//normal buddy case
QLineEdit *le = new QLineEdit;
@@ -195,23 +165,21 @@ void tst_QFormLayout::buddies()
QLineEdit *le2 = new QLineEdit;
fl->addRow(0, le2);
QWidget *label2 = fl->labelForField(le2);
- QVERIFY(label2 == 0);
+ QVERIFY(!label2);
//no label
QLineEdit *le3 = new QLineEdit;
fl->addRow(le3);
QWidget *label3 = fl->labelForField(le3);
- QVERIFY(label3 == 0);
+ QVERIFY(!label3);
//TODO: empty label?
-
- delete w;
}
void tst_QFormLayout::getItemPosition()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
QList<QLabel*> labels;
QList<QLineEdit*> fields;
@@ -249,14 +217,12 @@ void tst_QFormLayout::getItemPosition()
QCOMPARE(row, 2);
QCOMPARE(role, QFormLayout::FieldRole);
}
-
- delete w;
}
void tst_QFormLayout::wrapping()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
fl->setRowWrapPolicy(QFormLayout::WrapLongRows);
QLineEdit *le = new QLineEdit;
@@ -264,14 +230,13 @@ void tst_QFormLayout::wrapping()
le->setMinimumWidth(200);
fl->addRow(lbl, le);
- w->setFixedWidth(240);
- w->show();
+ w.setFixedWidth(240);
+ w.setWindowTitle(QTest::currentTestFunction());
+ w.show();
QCOMPARE(le->geometry().y() > lbl->geometry().y(), true);
//TODO: additional tests covering different wrapping cases
-
- delete w;
}
class CustomLayoutStyle : public QProxyStyle
@@ -309,12 +274,12 @@ int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * opti
void tst_QFormLayout::spacing()
{
//TODO: confirm spacing behavior
- QWidget *w = new QWidget;
- CustomLayoutStyle *style = new CustomLayoutStyle;
+ QWidget w;
+ QScopedPointer<CustomLayoutStyle> style(new CustomLayoutStyle);
style->hspacing = 5;
style->vspacing = 10;
- w->setStyle(style);
- QFormLayout *fl = new QFormLayout(w);
+ w.setStyle(style.data());
+ QFormLayout *fl = new QFormLayout(&w);
QCOMPARE(style->hspacing, fl->horizontalSpacing());
QCOMPARE(style->vspacing, fl->verticalSpacing());
@@ -351,12 +316,10 @@ void tst_QFormLayout::spacing()
QCheckBox *checkBox = new QCheckBox(tr("Yes"));
fl->setWidget(0, QFormLayout::LabelRole, label);
fl->setWidget(1, QFormLayout::FieldRole, checkBox);
- w->resize(200, 100);
- w->show();
- QVERIFY(QTest::qWaitForWindowExposed(w));
-
- delete w;
- delete style;
+ w.resize(200, 100);
+ w.setWindowTitle(QTest::currentTestFunction());
+ w.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
}
void tst_QFormLayout::contentsRect()
@@ -366,6 +329,7 @@ void tst_QFormLayout::contentsRect()
QFormLayout form;
w.setLayout(&form);
form.addRow("Label", new QPushButton(&w));
+ w.setWindowTitle(QTest::currentTestFunction());
w.show();
QVERIFY(QTest::qWaitForWindowExposed(&w));
int l, t, r, b;
@@ -425,18 +389,18 @@ void tst_QFormLayout::setFormStyle()
#if 0 // QT_NO_STYLE_PLASTIQUE
widget.setStyle(new QPlastiqueStyle());
- QVERIFY(layout.labelAlignment() == Qt::AlignRight);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::ExpandingFieldsGrow);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::ExpandingFieldsGrow);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
#endif
widget.setStyle(QStyleFactory::create("windows"));
- QVERIFY(layout.labelAlignment() == Qt::AlignLeft);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignLeft);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::AllNonFixedFieldsGrow);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::AllNonFixedFieldsGrow);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
/* can't directly create mac style or qtopia style, since
this test is cross platform.. so create dummy styles that
@@ -444,17 +408,17 @@ void tst_QFormLayout::setFormStyle()
*/
widget.setStyle(new DummyMacStyle());
- QVERIFY(layout.labelAlignment() == Qt::AlignRight);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignHCenter | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::FieldsStayAtSizeHint);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::FieldsStayAtSizeHint);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
widget.setStyle(new DummyQtopiaStyle());
- QVERIFY(layout.labelAlignment() == Qt::AlignRight);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::AllNonFixedFieldsGrow);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::WrapLongRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::AllNonFixedFieldsGrow);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::WrapLongRows);
}
void tst_QFormLayout::setFieldGrowthPolicy()
@@ -479,14 +443,14 @@ void tst_QFormLayout::setFieldGrowthPolicy()
layout.activate();
if (i == 0) {
- QVERIFY(fld1.width() == fld2.width());
- QVERIFY(fld2.width() == fld3.width());
+ QCOMPARE(fld1.width(), fld2.width());
+ QCOMPARE(fld2.width(), fld3.width());
} else if (i == 1) {
- QVERIFY(fld1.width() == fld2.width());
+ QCOMPARE(fld1.width(), fld2.width());
QVERIFY(fld2.width() < fld3.width());
} else {
QVERIFY(fld1.width() < fld2.width());
- QVERIFY(fld2.width() == fld3.width());
+ QCOMPARE(fld2.width(), fld3.width());
}
}
}
@@ -505,33 +469,39 @@ void tst_QFormLayout::setFormAlignment()
void tst_QFormLayout::addRow()
{
- QFormLayout layout;
- QWidget w1, w2, w3;
- QHBoxLayout l1, l2, l3;
- QLabel lbl1, lbl2;
-
- QCOMPARE(layout.rowCount(), 0);
-
- layout.addRow(&lbl1, &w1);
- layout.addRow(&lbl2, &l1);
- layout.addRow("Foo:", &w2);
- layout.addRow("Bar:", &l2);
- layout.addRow(&w3);
- layout.addRow(&l3);
-
- QCOMPARE(layout.rowCount(), 6);
-
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
- QVERIFY(layout.itemAt(2, QFormLayout::LabelRole)->widget()->property("text") == "Foo:");
- QVERIFY(layout.itemAt(3, QFormLayout::LabelRole)->widget()->property("text") == "Bar:");
- QVERIFY(layout.itemAt(4, QFormLayout::LabelRole) == 0);
- QVERIFY(layout.itemAt(5, QFormLayout::LabelRole) == 0);
-
- QVERIFY(layout.itemAt(0, QFormLayout::FieldRole)->widget() == &w1);
- QVERIFY(layout.itemAt(1, QFormLayout::FieldRole)->layout() == &l1);
- QVERIFY(layout.itemAt(2, QFormLayout::FieldRole)->widget() == &w2);
- QVERIFY(layout.itemAt(3, QFormLayout::FieldRole)->layout() == &l2);
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QWidget *w1 = new QWidget(&topLevel);
+ QWidget *w2 = new QWidget(&topLevel);
+ QWidget *w3 = new QWidget(&topLevel);
+ QHBoxLayout *l1 = new QHBoxLayout;
+ QHBoxLayout *l2 = new QHBoxLayout;
+ QHBoxLayout *l3 = new QHBoxLayout;
+ QLabel *lbl1 = new QLabel(&topLevel);
+ QLabel *lbl2 = new QLabel(&topLevel);
+
+ QCOMPARE(layout->rowCount(), 0);
+
+ layout->addRow(lbl1, w1);
+ layout->addRow(lbl2, l1);
+ layout->addRow("Foo:", w2);
+ layout->addRow("Bar:", l2);
+ layout->addRow(w3);
+ layout->addRow(l3);
+
+ QCOMPARE(layout->rowCount(), 6);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
+ QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget()->property("text") == "Foo:");
+ QVERIFY(layout->itemAt(3, QFormLayout::LabelRole)->widget()->property("text") == "Bar:");
+ QVERIFY(layout->itemAt(4, QFormLayout::LabelRole) == 0);
+ QVERIFY(layout->itemAt(5, QFormLayout::LabelRole) == 0);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::FieldRole)->widget() == w1);
+ QVERIFY(layout->itemAt(1, QFormLayout::FieldRole)->layout() == l1);
+ QVERIFY(layout->itemAt(2, QFormLayout::FieldRole)->widget() == w2);
+ QVERIFY(layout->itemAt(3, QFormLayout::FieldRole)->layout() == l2);
// ### should have a third role, FullRowRole?
// QVERIFY(layout.itemAt(4, QFormLayout::FieldRole) == 0);
// QVERIFY(layout.itemAt(5, QFormLayout::FieldRole) == 0);
@@ -539,17 +509,24 @@ void tst_QFormLayout::addRow()
void tst_QFormLayout::insertRow_QWidget_QWidget()
{
- QFormLayout layout;
- QLabel lbl1, lbl2, lbl3, lbl4;
- QLineEdit fld1, fld2, fld3, fld4;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QLabel *lbl1 = new QLabel(&topLevel);
+ QLabel *lbl2 = new QLabel(&topLevel);
+ QLabel *lbl3 = new QLabel(&topLevel);
+ QLabel *lbl4 = new QLabel(&topLevel);
+ QLineEdit *fld1 = new QLineEdit(&topLevel);
+ QLineEdit *fld2 = new QLineEdit(&topLevel);
+ QLineEdit *fld3 = new QLineEdit(&topLevel);
+ QLineEdit *fld4 = new QLineEdit(&topLevel);
- layout.insertRow(0, &lbl1, &fld1);
- QCOMPARE(layout.rowCount(), 1);
+ layout->insertRow(0, lbl1, fld1);
+ QCOMPARE(layout->rowCount(), 1);
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getWidgetPosition(&lbl1, &row, &role);
+ layout->getWidgetPosition(lbl1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::LabelRole));
}
@@ -557,63 +534,68 @@ void tst_QFormLayout::insertRow_QWidget_QWidget()
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getWidgetPosition(&fld1, &row, &role);
+ layout->getWidgetPosition(fld1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::FieldRole));
}
// check that negative values append
- layout.insertRow(-2, &lbl2, &fld2);
- QCOMPARE(layout.rowCount(), 2);
+ layout->insertRow(-2, lbl2, fld2);
+ QCOMPARE(layout->rowCount(), 2);
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
// check that too large values append
- layout.insertRow(100, &lbl3, &fld3);
- QCOMPARE(layout.rowCount(), 3);
- QCOMPARE(layout.count(), 6);
+ layout->insertRow(100, lbl3, fld3);
+ QCOMPARE(layout->rowCount(), 3);
+ QCOMPARE(layout->count(), 6);
- layout.insertRow(3, (QWidget *)0, (QWidget *)0);
- QCOMPARE(layout.rowCount(), 4);
- QCOMPARE(layout.count(), 6);
+ layout->insertRow(3, (QWidget *)0, (QWidget *)0);
+ QCOMPARE(layout->rowCount(), 4);
+ QCOMPARE(layout->count(), 6);
- layout.insertRow(4, (QWidget *)0, &fld4);
- QCOMPARE(layout.rowCount(), 5);
- QCOMPARE(layout.count(), 7);
+ layout->insertRow(4, (QWidget *)0, fld4);
+ QCOMPARE(layout->rowCount(), 5);
+ QCOMPARE(layout->count(), 7);
- layout.insertRow(5, &lbl4, (QWidget *)0);
- QCOMPARE(layout.rowCount(), 6);
- QCOMPARE(layout.count(), 8);
-
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
- QVERIFY(layout.itemAt(2, QFormLayout::LabelRole)->widget() == &lbl3);
- QVERIFY(layout.itemAt(3, QFormLayout::LabelRole) == 0);
- QVERIFY(layout.itemAt(4, QFormLayout::LabelRole) == 0);
- QVERIFY(layout.itemAt(5, QFormLayout::LabelRole)->widget() == &lbl4);
-
- QVERIFY(layout.itemAt(0, QFormLayout::FieldRole)->widget() == &fld1);
- QVERIFY(layout.itemAt(1, QFormLayout::FieldRole)->widget() == &fld2);
- QVERIFY(layout.itemAt(2, QFormLayout::FieldRole)->widget() == &fld3);
- QVERIFY(layout.itemAt(3, QFormLayout::FieldRole) == 0);
- QVERIFY(layout.itemAt(4, QFormLayout::FieldRole)->widget() == &fld4);
- QVERIFY(layout.itemAt(5, QFormLayout::FieldRole) == 0);
+ layout->insertRow(5, lbl4, (QWidget *)0);
+ QCOMPARE(layout->rowCount(), 6);
+ QCOMPARE(layout->count(), 8);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
+ QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget() == lbl3);
+ QVERIFY(layout->itemAt(3, QFormLayout::LabelRole) == 0);
+ QVERIFY(layout->itemAt(4, QFormLayout::LabelRole) == 0);
+ QVERIFY(layout->itemAt(5, QFormLayout::LabelRole)->widget() == lbl4);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::FieldRole)->widget() == fld1);
+ QVERIFY(layout->itemAt(1, QFormLayout::FieldRole)->widget() == fld2);
+ QVERIFY(layout->itemAt(2, QFormLayout::FieldRole)->widget() == fld3);
+ QVERIFY(layout->itemAt(3, QFormLayout::FieldRole) == 0);
+ QVERIFY(layout->itemAt(4, QFormLayout::FieldRole)->widget() == fld4);
+ QVERIFY(layout->itemAt(5, QFormLayout::FieldRole) == 0);
}
void tst_QFormLayout::insertRow_QWidget_QLayout()
{
- QFormLayout layout;
- QLabel lbl1, lbl2, lbl3, lbl4;
- QHBoxLayout fld1, fld2, fld3, fld4;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QLabel *lbl1 = new QLabel(&topLevel);
+ QLabel *lbl2 = new QLabel(&topLevel);
+ QLabel *lbl3 = new QLabel(&topLevel);
+ QHBoxLayout *fld1 = new QHBoxLayout;
+ QHBoxLayout *fld2 = new QHBoxLayout;
+ QHBoxLayout *fld3 = new QHBoxLayout;
- layout.insertRow(0, &lbl1, &fld1);
- QCOMPARE(layout.rowCount(), 1);
+ layout->insertRow(0, lbl1, fld1);
+ QCOMPARE(layout->rowCount(), 1);
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getWidgetPosition(&lbl1, &row, &role);
+ layout->getWidgetPosition(lbl1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::LabelRole));
}
@@ -621,77 +603,83 @@ void tst_QFormLayout::insertRow_QWidget_QLayout()
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getLayoutPosition(&fld1, &row, &role);
+ layout->getLayoutPosition(fld1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::FieldRole));
}
// check that negative values append
- layout.insertRow(-2, &lbl2, &fld2);
- QCOMPARE(layout.rowCount(), 2);
+ layout->insertRow(-2, lbl2, fld2);
+ QCOMPARE(layout->rowCount(), 2);
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
// check that too large values append
- layout.insertRow(100, &lbl3, &fld3);
- QCOMPARE(layout.rowCount(), 3);
+ layout->insertRow(100, lbl3, fld3);
+ QCOMPARE(layout->rowCount(), 3);
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
- QVERIFY(layout.itemAt(2, QFormLayout::LabelRole)->widget() == &lbl3);
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
+ QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget() == lbl3);
- QVERIFY(layout.itemAt(0, QFormLayout::FieldRole)->layout() == &fld1);
- QVERIFY(layout.itemAt(1, QFormLayout::FieldRole)->layout() == &fld2);
- QVERIFY(layout.itemAt(2, QFormLayout::FieldRole)->layout() == &fld3);
+ QVERIFY(layout->itemAt(0, QFormLayout::FieldRole)->layout() == fld1);
+ QVERIFY(layout->itemAt(1, QFormLayout::FieldRole)->layout() == fld2);
+ QVERIFY(layout->itemAt(2, QFormLayout::FieldRole)->layout() == fld3);
}
void tst_QFormLayout::insertRow_QString_QWidget()
{
- QFormLayout layout;
- QLineEdit fld1, fld2, fld3;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QLineEdit *fld1 = new QLineEdit(&topLevel);
+ QLineEdit *fld2 = new QLineEdit(&topLevel);
+ QLineEdit *fld3 = new QLineEdit(&topLevel);
- layout.insertRow(-5, "&Name:", &fld1);
- QLabel *label1 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(-5, "&Name:", fld1);
+ QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label1 != 0);
- QVERIFY(label1->buddy() == &fld1);
+ QCOMPARE(label1->buddy(), fld1);
- layout.insertRow(0, "&Email:", &fld2);
- QLabel *label2 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(0, "&Email:", fld2);
+ QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label2 != 0);
- QVERIFY(label2->buddy() == &fld2);
+ QCOMPARE(label2->buddy(), fld2);
- layout.insertRow(5, "&Age:", &fld3);
- QLabel *label3 = qobject_cast<QLabel *>(layout.itemAt(2, QFormLayout::LabelRole)->widget());
+ layout->insertRow(5, "&Age:", fld3);
+ QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget());
QVERIFY(label3 != 0);
- QVERIFY(label3->buddy() == &fld3);
+ QCOMPARE(label3->buddy(), fld3);
}
void tst_QFormLayout::insertRow_QString_QLayout()
{
- QFormLayout layout;
- QHBoxLayout fld1, fld2, fld3;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QHBoxLayout *fld1 = new QHBoxLayout;
+ QHBoxLayout *fld2 = new QHBoxLayout;
+ QHBoxLayout *fld3 = new QHBoxLayout;
- layout.insertRow(-5, "&Name:", &fld1);
- QLabel *label1 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(-5, "&Name:", fld1);
+ QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label1 != 0);
- QVERIFY(label1->buddy() == 0);
+ QVERIFY(!label1->buddy());
- QCOMPARE(layout.rowCount(), 1);
+ QCOMPARE(layout->rowCount(), 1);
- layout.insertRow(0, "&Email:", &fld2);
- QLabel *label2 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(0, "&Email:", fld2);
+ QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label2 != 0);
- QVERIFY(label2->buddy() == 0);
+ QVERIFY(!label2->buddy());
- QCOMPARE(layout.rowCount(), 2);
+ QCOMPARE(layout->rowCount(), 2);
- layout.insertRow(5, "&Age:", &fld3);
- QLabel *label3 = qobject_cast<QLabel *>(layout.itemAt(2, QFormLayout::LabelRole)->widget());
+ layout->insertRow(5, "&Age:", fld3);
+ QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget());
QVERIFY(label3 != 0);
- QVERIFY(label3->buddy() == 0);
+ QVERIFY(!label3->buddy());
- QCOMPARE(layout.rowCount(), 3);
+ QCOMPARE(layout->rowCount(), 3);
}
void tst_QFormLayout::insertRow_QWidget()
@@ -840,39 +828,40 @@ void tst_QFormLayout::setLayout()
void tst_QFormLayout::itemAt()
{
- QFormLayout layout;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
- QWidget w1;
- QWidget w2;
- QWidget w3;
- QWidget w4;
- QWidget w5;
- QHBoxLayout l6;
+ QWidget *w1 = new QWidget(&topLevel);
+ QWidget *w2 = new QWidget(&topLevel);
+ QWidget *w3 = new QWidget(&topLevel);
+ QWidget *w4 = new QWidget(&topLevel);
+ QWidget *w5 = new QWidget(&topLevel);
+ QHBoxLayout *l6 = new QHBoxLayout;
- layout.setWidget(5, QFormLayout::LabelRole, &w1);
- layout.setWidget(3, QFormLayout::FieldRole, &w2);
- layout.setWidget(3, QFormLayout::LabelRole, &w3);
- layout.addRow(&w4, &w5);
- layout.addRow("Foo:", &l6);
+ layout->setWidget(5, QFormLayout::LabelRole, w1);
+ layout->setWidget(3, QFormLayout::FieldRole, w2);
+ layout->setWidget(3, QFormLayout::LabelRole, w3);
+ layout->addRow(w4, w5);
+ layout->addRow("Foo:", l6);
- QCOMPARE(layout.count(), 7);
+ QCOMPARE(layout->count(), 7);
QBitArray scoreBoard(7);
for (int i = 0; i < 7; ++i) {
- QLayoutItem *item = layout.itemAt(i);
+ QLayoutItem *item = layout->itemAt(i);
QVERIFY(item != 0);
- if (item->widget() == &w1) {
+ if (item->widget() == w1) {
scoreBoard[0] = true;
- } else if (item->widget() == &w2) {
+ } else if (item->widget() == w2) {
scoreBoard[1] = true;
- } else if (item->widget() == &w3) {
+ } else if (item->widget() == w3) {
scoreBoard[2] = true;
- } else if (item->widget() == &w4) {
+ } else if (item->widget() == w4) {
scoreBoard[3] = true;
- } else if (item->widget() == &w5) {
+ } else if (item->widget() == w5) {
scoreBoard[4] = true;
- } else if (item->layout() == &l6) {
+ } else if (item->layout() == l6) {
scoreBoard[5] = true;
} else if (qobject_cast<QLabel *>(item->widget())) {
scoreBoard[6] = true;
@@ -883,26 +872,27 @@ void tst_QFormLayout::itemAt()
void tst_QFormLayout::takeAt()
{
- QFormLayout layout;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
- QWidget w1;
- QWidget w2;
- QWidget w3;
- QWidget w4;
- QWidget w5;
- QHBoxLayout l6;
+ QWidget *w1 = new QWidget(&topLevel);
+ QWidget *w2 = new QWidget(&topLevel);
+ QWidget *w3 = new QWidget(&topLevel);
+ QWidget *w4 = new QWidget(&topLevel);
+ QWidget *w5 = new QWidget(&topLevel);
+ QHBoxLayout *l6 = new QHBoxLayout;
- layout.setWidget(5, QFormLayout::LabelRole, &w1);
- layout.setWidget(3, QFormLayout::FieldRole, &w2);
- layout.setWidget(3, QFormLayout::LabelRole, &w3);
- layout.addRow(&w4, &w5);
- layout.addRow("Foo:", &l6);
+ layout->setWidget(5, QFormLayout::LabelRole, w1);
+ layout->setWidget(3, QFormLayout::FieldRole, w2);
+ layout->setWidget(3, QFormLayout::LabelRole, w3);
+ layout->addRow(w4, w5);
+ layout->addRow("Foo:", l6);
- QCOMPARE(layout.count(), 7);
+ QCOMPARE(layout->count(), 7);
for (int i = 6; i >= 0; --i) {
- layout.takeAt(0);
- QCOMPARE(layout.count(), i);
+ layout->takeAt(0);
+ QCOMPARE(layout->count(), i);
}
}
@@ -917,6 +907,7 @@ void tst_QFormLayout::layoutAlone()
QHBoxLayout hlay;
layout.setLayout(1, QFormLayout::LabelRole, &hlay);
QCOMPARE(layout.count(), 2);
+ w.setWindowTitle(QTest::currentTestFunction());
w.show();
layout.activate();
QTest::qWait(500);
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 7f3c289fb4..1e67c675ef 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -60,18 +60,9 @@ class tst_QGridLayout : public QObject
{
Q_OBJECT
-public:
- tst_QGridLayout();
- virtual ~tst_QGridLayout();
-
-
-public slots:
+private slots:
void initTestCase();
- void cleanupTestCase();
- void init();
void cleanup();
-
-private slots:
void getItemPosition();
void itemAtPosition();
void badDistributionBug();
@@ -97,76 +88,72 @@ private slots:
void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
void dontCrashWhenExtendsToEnd();
-
-private:
- QWidget *testWidget;
- QGridLayout *testLayout;
- QWidget *w1;
- QWidget *w2;
- QWidget *w3;
- QSpacerItem *sp;
-
- QGridLayout *m_grid;
- QWidget *m_toplevel;
};
-
-tst_QGridLayout::tst_QGridLayout()
+void tst_QGridLayout::initTestCase()
{
- m_grid = 0;
- m_toplevel = 0;
+#ifdef Q_OS_WINCE //disable magic for WindowsCE
+ qApp->setAutoMaximizeThreshold(-1);
+#endif
}
-tst_QGridLayout::~tst_QGridLayout()
+static inline int visibleTopLevelWidgetCount()
{
- delete m_toplevel;
+ int result= 0;
+ foreach (const QWidget *topLevel, QApplication::topLevelWidgets()) {
+ if (topLevel->isVisible())
+ ++result;
+ }
+ return result;
}
-void tst_QGridLayout::initTestCase()
+void tst_QGridLayout::cleanup()
{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
- // Create the test class
- testWidget = new QWidget(0);
+ // Verify that no visible top levels are leaked. Cannot check for
+ // topLevelWidgets().isEmpty() here since the data driven test layoutSpacing()
+ // will appear to "leak" top levels due to it creating widgets in the test data.
+ QCOMPARE(visibleTopLevelWidgetCount(), 0);
+}
- testLayout = new QGridLayout(testWidget);
+class ItemTestWidget : public QWidget {
+public:
+ ItemTestWidget();
+
+ QGridLayout *testLayout;
+ QWidget *w1;
+ QWidget *w2;
+ QWidget *w3;
+ QSpacerItem *sp;
+};
+
+ItemTestWidget::ItemTestWidget()
+ : testLayout(new QGridLayout(this))
+ , w1(new QWidget(this))
+ , w2(new QWidget(this))
+ , w3(new QWidget(this))
+ , sp(new QSpacerItem(4, 4))
+{
+ setObjectName("testWidget");
+ setWindowTitle(QTest::currentTestFunction());
- w1 = new QWidget(testWidget);
w1->setPalette(QPalette(Qt::red));
testLayout->addWidget(w1, 0, 0);
- w2 = new QWidget(testWidget);
testLayout->addWidget(w2, 1, 1, 2, 2);
w2->setPalette(QPalette(Qt::green));
- w3 = new QWidget(testWidget);
testLayout->addWidget(w3, 0, 1, 1, 2);
w3->setPalette(QPalette(Qt::blue));
- sp = new QSpacerItem(4, 4);
testLayout->addItem(sp, 1, 3, 2, 1);
-
- testWidget->resize( 200, 200 );
- testWidget->show();
-}
-
-void tst_QGridLayout::cleanupTestCase()
-{
- delete testWidget;
- testWidget = 0;
-}
-
-void tst_QGridLayout::init()
-{
-}
-
-void tst_QGridLayout::cleanup()
-{
}
void tst_QGridLayout::getItemPosition()
{
+ ItemTestWidget testWidget;
+ testWidget.resize(200, 200);
+ testWidget.show();
+
QLayoutItem *item;
int counter = 0;
@@ -175,28 +162,28 @@ void tst_QGridLayout::getItemPosition()
bool seenW3 = false;
bool seenSpacer = false;
- while ((item = testLayout->itemAt(counter))) {
+ while ((item = testWidget.testLayout->itemAt(counter))) {
QWidget *w = item->widget();
int r,c,rs,cs;
- testLayout->getItemPosition(counter, &r, &c, &rs, &cs);
+ testWidget.testLayout->getItemPosition(counter, &r, &c, &rs, &cs);
// qDebug() << "item" << counter << "has" <<r << c << rs << cs;
- if (w == w1) {
+ if (w == testWidget.w1) {
QVERIFY(!seenW1);
seenW1 = true;
QCOMPARE(r, 0);
QCOMPARE(c, 0);
QCOMPARE(rs, 1);
QCOMPARE(cs, 1);
- } else if (w == w2) {
+ } else if (w == testWidget.w2) {
QVERIFY(!seenW2);
seenW2 = true;
QCOMPARE(r, 1);
QCOMPARE(c, 1);
QCOMPARE(rs, 2);
QCOMPARE(cs, 2);
- } else if (w == w3) {
+ } else if (w == testWidget.w3) {
QVERIFY(!seenW3);
seenW3 = true;
QCOMPARE(r, 0);
@@ -223,16 +210,20 @@ void tst_QGridLayout::getItemPosition()
void tst_QGridLayout::itemAtPosition()
{
+ ItemTestWidget testWidget;
+ testWidget.resize(200, 200);
+ testWidget.show();
+
void *table[4][5] = {
- { w1, w3, w3, 0, 0 },
- { 0, w2, w2, sp, 0 },
- { 0, w2, w2, sp, 0 },
+ { testWidget.w1, testWidget.w3,testWidget.w3, 0, 0 },
+ { 0, testWidget.w2, testWidget.w2, testWidget.sp, 0 },
+ { 0, testWidget.w2, testWidget.w2, testWidget.sp, 0 },
{ 0, 0, 0, 0, 0 }
};
for (int row = 0; row < 4; ++row) {
for (int col = 0; col < 5; ++col) {
- QLayoutItem *item = testLayout->itemAtPosition(row, col);
+ QLayoutItem *item = testWidget.testLayout->itemAtPosition(row, col);
QVERIFY(item == table[row][col]
|| (item && item->widget() == table[row][col]));
}
@@ -860,32 +851,31 @@ void tst_QGridLayout::minMaxSize()
}
}
QApplication::setStyle(style);
- if (!m_grid)
- m_grid = new QGridLayout();
- if (!m_toplevel) {
- m_toplevel = new QWidget();
- setFrameless(m_toplevel);
- }
+ QWidget toplevel;
+ toplevel.setWindowTitle(QLatin1String(QTest::currentTestFunction())
+ + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
+ setFrameless(&toplevel);
+ QGridLayout *grid = new QGridLayout;
if (fixedSize.isValid()) {
- m_toplevel->setFixedSize(fixedSize);
+ toplevel.setFixedSize(fixedSize);
} else {
- m_toplevel->setMinimumSize(QSize(0,0));
- m_toplevel->setMaximumSize(QSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX));
+ toplevel.setMinimumSize(QSize(0,0));
+ toplevel.setMaximumSize(QSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX));
}
// Do a two-pass one using the real testdata, the other pass enables heightForWidth
// on the widget, but the heightForWidth() function just return sizeHint().width()
for (int pass = 0; pass < 2; ++pass) {
- m_toplevel->hide();
+ toplevel.hide();
QApplication::processEvents();
QTest::qWait(20);
// Test if removeItem uninitializes data properly
- while (m_grid->count()) {
- QLayoutItem *item = m_grid->itemAt(0);
- m_grid->removeItem(item);
+ while (grid->count()) {
+ QLayoutItem *item = grid->itemAt(0);
+ grid->removeItem(item);
delete item->widget();
delete item;
}
- m_toplevel->setLayout(m_grid);
+ toplevel.setLayout(grid);
// a layout with a top-level parent widget
QList<QPointer<SizeHinterFrame> > sizehinters;
@@ -899,29 +889,29 @@ void tst_QGridLayout::minMaxSize()
QSizePolicy sp = sh->sizePolicy();
sp.setHorizontalPolicy((QSizePolicy::Policy)sizePolicy);
sh->setSizePolicy(sp);
- sh->setParent(m_toplevel);
+ sh->setParent(&toplevel);
if (si.minSize.isValid())
sh->setMinimumSize(si.minSize);
if (si.maxSize.isValid())
sh->setMaximumSize(si.maxSize);
sizehinters.append(sh);
- m_grid->addWidget(sh, i, j);
+ grid->addWidget(sh, i, j);
}
}
- m_toplevel->show();
- QVERIFY(QTest::qWaitForWindowExposed(m_toplevel));
- m_toplevel->adjustSize();
+ toplevel.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
+ toplevel.adjustSize();
QTest::qWait(240); // wait for the implicit adjustSize
// If the following fails we might have to wait longer.
// If that does not help there is likely a problem with the implicit adjustSize in show()
if (!fixedSize.isValid()) {
// Note that this can fail if the desktop has large fonts on windows.
- QTRY_COMPARE(m_toplevel->size(), m_toplevel->sizeHint());
+ QTRY_COMPARE(toplevel.size(), toplevel.sizeHint());
}
// We are relying on the order here...
for (int pi = 0; pi < sizehinters.count(); ++pi) {
- QPoint pt = sizehinters.at(pi)->mapTo(m_toplevel, QPoint(0, 0));
+ QPoint pt = sizehinters.at(pi)->mapTo(&toplevel, QPoint(0, 0));
QCOMPARE(pt, sizeinfos.at(pi).expectedPos);
}
}
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index d661c074ac..4d15ac9a93 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -66,6 +66,7 @@ public:
virtual ~tst_QLayout();
private slots:
+ void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
void getSetCheck();
void geometry();
void smartMaxSize();
@@ -217,12 +218,12 @@ void tst_QLayout::setLayoutBugs()
}
widget.setLayout(hBoxLayout);
- QVERIFY(widget.layout() == hBoxLayout);
+ QCOMPARE(widget.layout(), hBoxLayout);
QWidget containerWidget(0);
containerWidget.setLayout(widget.layout());
- QVERIFY(widget.layout() == 0);
- QVERIFY(containerWidget.layout() == hBoxLayout);
+ QVERIFY(!widget.layout());
+ QCOMPARE(containerWidget.layout(), hBoxLayout);
}
class MyLayout : public QLayout
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 7b9eaa418f..15aef8d503 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -72,7 +72,8 @@ public:
TriggerSlot4,
TriggerSlot5,
TriggerSlot6,
- TriggerSlot7
+ TriggerSlot7,
+ SendKeyEvent
};
enum Result {
@@ -84,6 +85,7 @@ public:
Slot5Triggered,
Slot6Triggered,
Slot7Triggered,
+ SentKeyEvent,
Ambiguous
} currentResult;
@@ -104,10 +106,12 @@ public slots:
void ambigSlot7() { currentResult = Ambiguous; ambigResult = Slot7Triggered; }
void statusMessage( const QString& message ) { sbText = message; }
void shortcutDestroyed(QObject* obj);
+ void sendKeyEvent() { sendKeyEvents(edit, Qt::CTRL + Qt::Key_B, 0); currentResult = SentKeyEvent; }
public slots:
void initTestCase();
void cleanupTestCase();
+ void cleanup() { QCOMPARE(QApplication::topLevelWidgets().size(), 1); }
private slots:
void number_data();
@@ -980,6 +984,19 @@ void tst_QShortcut::keypressConsumption()
QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>a"));
clearAllShortcuts();
+ edit->clear();
+ QCOMPARE(edit->toPlainText().size(), 0);
+
+ setupShortcut(edit, "first", SendKeyEvent, "Ctrl+A");
+
+ // Verify reentrancy when a non-shortcut is triggered as part
+ // of shortcut processing.
+ currentResult = NoResult;
+ ambigResult = NoResult;
+ sendKeyEvents(edit, Qt::CTRL + Qt::Key_A, 0);
+ QCOMPARE(currentResult, SentKeyEvent);
+ QCOMPARE(ambigResult, NoResult);
+ QCOMPARE(edit->toPlainText(), QString(QString("<Ctrl+B>")));
}
// ------------------------------------------------------------------
@@ -1181,9 +1198,12 @@ QShortcut *tst_QShortcut::setupShortcut(QWidget *parent, const char *name, int t
normal = SLOT(slotTrig7());
ambig = SLOT(ambigSlot7());
break;
+ case SendKeyEvent:
+ normal = SLOT(sendKeyEvent());
}
connect(cut, SIGNAL(activated()), this, normal);
- connect(cut, SIGNAL(activatedAmbiguously()), this, ambig);
+ if (ambig)
+ connect(cut, SIGNAL(activatedAmbiguously()), this, ambig);
connect(cut, SIGNAL(destroyed(QObject*)), this, SLOT(shortcutDestroyed(QObject*)));
shortcuts.append(cut);
return cut;
diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
index 6c88f8731b..0f8c9d1c9e 100644
--- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
+++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
@@ -44,6 +44,7 @@ class tst_QSizePolicy : public QObject
Q_OBJECT
private Q_SLOTS:
+ void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
void qtest();
void defaultValues();
void getSetCheck_data() { data(); }
@@ -51,6 +52,8 @@ private Q_SLOTS:
void dataStream();
void horizontalStretch();
void verticalStretch();
+ void qhash_data() { data(); }
+ void qhash();
private:
void data() const;
};
@@ -149,8 +152,6 @@ void tst_QSizePolicy::getSetCheck()
QCOMPARE(sp.expandingDirections(), ed);
}
-#undef FETCH_TEST_DATA
-
static void makeRow(QSizePolicy sp, QSizePolicy::Policy hp, QSizePolicy::Policy vp,
int hst, int vst, QSizePolicy::ControlType ct, bool hfw, bool wfh,
Qt::Orientations orients)
@@ -314,5 +315,21 @@ void tst_QSizePolicy::verticalStretch()
QCOMPARE(sp.verticalStretch(), 255);
}
+void tst_QSizePolicy::qhash()
+{
+ FETCH_TEST_DATA;
+ Q_UNUSED(ed);
+
+ QSizePolicy sp2(hp, vp, ct);
+ sp2.setVerticalStretch(vst);
+ sp2.setHorizontalStretch(hst);
+ if (hfw) sp2.setHeightForWidth(true);
+ if (wfh) sp2.setWidthForHeight(true);
+ QCOMPARE(sp, sp2);
+ QCOMPARE(qHash(sp), qHash(sp2));
+}
+
+#undef FETCH_TEST_DATA
+
QTEST_MAIN(tst_QSizePolicy)
#include "tst_qsizepolicy.moc"
diff --git a/tests/auto/widgets/kernel/qtooltip/BLACKLIST b/tests/auto/widgets/kernel/qtooltip/BLACKLIST
new file mode 100644
index 0000000000..f8d062cc46
--- /dev/null
+++ b/tests/auto/widgets/kernel/qtooltip/BLACKLIST
@@ -0,0 +1,4 @@
+[whatsThis]
+ubuntu-14.04
+[task183679]
+opensuse-13.1
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 591aa9e40f..78ccbe302a 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -12,7 +12,7 @@ osx
ubuntu-14.04
osx
[focusProxyAndInputMethods]
-ubuntu-14.04
+linux
[touchEventSynthesizedMouseEvent]
ubuntu-14.04
[grabMouse]
@@ -28,73 +28,17 @@ osx
[stackUnder]
osx
[raise]
-osx-10.9
+osx
[widgetAt]
osx
[sheetOpacity]
osx
[resizeEvent]
osx
-[setWindowGeometry:100,123 200x200, flags 0]
-osx-10.10
-[windowMoveResize:100,123 200x200, flags 0]
-osx-10.10
-[setWindowGeometry:100,122 200x200, flags 0]
-osx-10.9
-[windowMoveResize:100,122 200x200, flags 0]
-osx-10.9
-[setWindowGeometry:100,100 824x564, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x564, flags 0]
-osx-10.10
-[setWindowGeometry:100,100 824x516, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x516, flags 0]
-osx-10.10
-[setWindowGeometry:100,73 200x0, flags 0]
-osx-10.10
-[windowMoveResize:100,73 200x0, flags 0]
-osx-10.10
-[setWindowGeometry:100,100 824x519, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x519, flags 0]
-osx-10.10
-[setWindowGeometry:100,100 824x518, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x518, flags 0]
-osx-10.10
-[setWindowGeometry:100,72 200x0, flags 0]
-osx-10.9
-[windowMoveResize:100,72 200x0, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x574, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x574, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x578, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x578, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x576, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x576, flags 0]
-osx-10.9
-[setWindowGeometry:100,100 824x521, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x521, flags 0]
-osx-10.10
-[setWindowGeometry:100,122 952x577, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x577, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x580, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x580, flags 0]
-osx-10.9
-[windowMoveResize:130,72 0x0, flags 0]
-osx-10.9
-[windowMoveResize:130,122 0x200, flags 0]
-osx-10.9
+[setWindowGeometry]
+osx
+[windowMoveResize]
+osx
[childEvents]
osx
[renderInvisible]
@@ -114,9 +58,9 @@ osx
[showMinimizedKeepsFocus]
osx-10.10
[moveWindowInShowEvent:1]
-osx-10.9
+osx
[moveWindowInShowEvent:2]
-osx-10.9
+osx
[taskQTBUG_4055_sendSyntheticEnterLeave]
osx
[syntheticEnterLeave]
@@ -128,10 +72,14 @@ osx-10.10
[hideOpaqueChildWhileHidden]
osx
[resizeStaticContentsChildWidget_QTBUG35282]
-osx-10.9
+osx
[lower]
osx
[setClearAndResizeMask]
osx
[setToolTip]
osx-10.9
+[moveInResizeEvent]
+ubuntu-14.04
+[moveChild:right]
+osx
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index a0d94d2dc9..ddbb4e6d75 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -51,6 +51,7 @@
#include <qdesktopwidget.h>
#include <private/qwidget_p.h>
#include <private/qapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <qcalendarwidget.h>
#include <qmainwindow.h>
#include <qdockwidget.h>
@@ -193,6 +194,19 @@ static QByteArray msgComparisonFailed(T v1, const char *op, T v2)
return s.toLocal8Bit();
}
+// Compare a window position that may go through scaling in the platform plugin with fuzz.
+static inline bool qFuzzyCompareWindowPosition(const QPoint &p1, const QPoint p2, int fuzz)
+{
+ return (p1 - p2).manhattanLength() <= fuzz;
+}
+
+static QString msgPointMismatch(const QPoint &p1, const QPoint p2)
+{
+ QString result;
+ QDebug(&result) << p1 << "!=" << p2 << ", manhattanLength=" << (p1 - p2).manhattanLength();
+ return result;
+}
+
class tst_QWidget : public QObject
{
Q_OBJECT
@@ -613,7 +627,7 @@ void tst_QWidget::getSetCheck()
}
tst_QWidget::tst_QWidget()
- : m_platform(qApp->platformName().toLower())
+ : m_platform(QGuiApplication::platformName().toLower())
, m_windowsAnimationsEnabled(windowsAnimationsEnabled())
{
if (m_windowsAnimationsEnabled) // Disable animations which can interfere with screen grabbing in moveChild(), showAndMoveChild()
@@ -1846,10 +1860,6 @@ void tst_QWidget::activation()
QCOMPARE(QApplication::activeWindow(), &widget1);
widget2.showNormal();
QTest::qWait(waitTime);
-#ifndef Q_OS_WINCE
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
- QEXPECT_FAIL("", "MS introduced new behavior after XP", Continue);
-#endif
QTest::qWait(waitTime);
QCOMPARE(QApplication::activeWindow(), &widget2);
widget2.hide();
@@ -1905,8 +1915,10 @@ void tst_QWidget::windowState()
widget1.setWindowState(widget1.windowState() ^ Qt::WindowMaximized);
QTest::qWait(100);
+ const int fuzz = int(QHighDpiScaling::factor(widget1.windowHandle()));
QVERIFY(!(widget1.windowState() & Qt::WindowMaximized));
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
widget1.setWindowState(Qt::WindowMinimized);
@@ -1927,7 +1939,8 @@ void tst_QWidget::windowState()
widget1.setWindowState(widget1.windowState() ^ Qt::WindowMaximized);
QTest::qWait(100);
QVERIFY(!(widget1.windowState() & (Qt::WindowMinimized|Qt::WindowMaximized)));
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
widget1.setWindowState(Qt::WindowFullScreen);
@@ -1948,7 +1961,8 @@ void tst_QWidget::windowState()
widget1.setWindowState(Qt::WindowNoState);
QTest::qWait(100);
VERIFY_STATE(Qt::WindowNoState);
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
widget1.setWindowState(Qt::WindowFullScreen);
@@ -1981,7 +1995,8 @@ void tst_QWidget::windowState()
QVERIFY(!(widget1.windowState() & stateMask));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QTRY_COMPARE(widget1.size(), size);
}
@@ -3079,12 +3094,12 @@ void tst_QWidget::saveRestoreGeometry()
const QByteArray four("abca");
const QByteArray garbage("abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc");
- QVERIFY(widget.restoreGeometry(empty) == false);
- QVERIFY(widget.restoreGeometry(one) == false);
- QVERIFY(widget.restoreGeometry(two) == false);
- QVERIFY(widget.restoreGeometry(three) == false);
- QVERIFY(widget.restoreGeometry(four) == false);
- QVERIFY(widget.restoreGeometry(garbage) == false);
+ QVERIFY(!widget.restoreGeometry(empty));
+ QVERIFY(!widget.restoreGeometry(one));
+ QVERIFY(!widget.restoreGeometry(two));
+ QVERIFY(!widget.restoreGeometry(three));
+ QVERIFY(!widget.restoreGeometry(four));
+ QVERIFY(!widget.restoreGeometry(garbage));
QVERIFY(widget.restoreGeometry(savedGeometry));
widget.showNormal();
@@ -3354,7 +3369,7 @@ void tst_QWidget::widgetAt()
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
#endif
- QTRY_VERIFY(QApplication::widgetAt(testPos) == w1.data());
+ QTRY_COMPARE(QApplication::widgetAt(testPos), w1.data());
QTRY_VERIFY(QApplication::widgetAt(testPos + QPoint(1, 1)) == w2.data());
}
@@ -3401,24 +3416,24 @@ void tst_QWidget::testDeletionInEventHandlers()
QPointer<Widget> w = new Widget;
w->deleteThis = true;
w->close();
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// focusOut (crashes)
//w = new Widget;
//w->show();
//w->setFocus();
- //QVERIFY(qApp->focusWidget() == w);
+ //QCOMPARE(qApp->focusWidget(), w);
//w->deleteThis = true;
//w->clearFocus();
- //QVERIFY(w == 0);
+ //QVERIFY(w.isNull());
// key press
w = new Widget;
w->show();
w->deleteThis = true;
QTest::keyPress(w, Qt::Key_A);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// key release
@@ -3426,7 +3441,7 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
QTest::keyRelease(w, Qt::Key_A);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// mouse press
@@ -3434,15 +3449,16 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
QTest::mousePress(w, Qt::LeftButton);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// mouse release
w = new Widget;
w->show();
w->deleteThis = true;
- QTest::mouseRelease(w, Qt::LeftButton);
- QVERIFY(w == 0);
+ QMouseEvent me(QEvent::MouseButtonRelease, QPoint(1, 1), Qt::LeftButton, Qt::LeftButton, 0);
+ qApp->notify(w, &me);
+ QVERIFY(w.isNull());
delete w;
// mouse double click
@@ -3450,7 +3466,7 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
QTest::mouseDClick(w, Qt::LeftButton);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// hide event (crashes)
@@ -3458,13 +3474,13 @@ void tst_QWidget::testDeletionInEventHandlers()
//w->show();
//w->deleteThis = true;
//w->hide();
- //QVERIFY(w == 0);
+ //QVERIFY(w.isNull());
// action event
w = new Widget;
w->deleteThis = true;
w->addAction(new QAction(w));
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// change event
@@ -3472,16 +3488,16 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
w->setMouseTracking(true);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
w = new Widget;
w->setMouseTracking(true);
w->show();
w->deleteThis = true;
- QMouseEvent me(QEvent::MouseMove, QPoint(0, 0), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ me = QMouseEvent(QEvent::MouseMove, QPoint(0, 0), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
QApplication::sendEvent(w, &me);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
}
@@ -3675,6 +3691,8 @@ void tst_QWidget::optimizedResizeMove()
void tst_QWidget::optimizedResize_topLevel()
{
+ if (QHighDpiScaling::isActive())
+ QSKIP("Skip due to rounding errors in the regions.");
StaticWidget topLevel;
topLevel.gotPaintEvent = false;
topLevel.show();
@@ -3909,7 +3927,7 @@ void tst_QWidget::winIdChangeEvent()
QCOMPARE(winIdBefore, winIdAfter);
QCOMPARE(child.winIdChangeEventCount(), 3);
// winId is set to zero during reparenting
- QVERIFY(0 == child.m_winIdList[1]);
+ QCOMPARE(WId(0), child.m_winIdList[1]);
}
{
@@ -3949,7 +3967,7 @@ void tst_QWidget::winIdChangeEvent()
QCOMPARE(winIdBefore, winIdAfter);
QCOMPARE(child.winIdChangeEventCount(), 3);
// winId is set to zero during reparenting
- QVERIFY(0 == child.m_winIdList[1]);
+ QCOMPARE(WId(0), child.m_winIdList[1]);
}
}
@@ -4495,7 +4513,7 @@ void tst_QWidget::qobject_castInDestroyedSlot()
QObject::connect(widget, SIGNAL(destroyed(QObject*)), &checker, SLOT(destroyedSlot(QObject*)));
delete widget;
- QVERIFY(checker.wasQWidget == true);
+ QVERIFY(checker.wasQWidget);
}
// Since X11 WindowManager operations are all async, and we have no way to know if the window
@@ -4544,8 +4562,18 @@ void tst_QWidget::setWindowGeometry_data()
QList<int> windowFlags;
windowFlags << 0 << Qt::FramelessWindowHint;
+ const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
foreach (QList<QRect> l, rects) {
QRect rect = l.first();
+ if (skipEmptyRects) {
+ QList<QRect>::iterator it = l.begin();
+ while (it != l.end()) {
+ if (it->isEmpty())
+ it = l.erase(it);
+ else
+ ++it;
+ }
+ }
foreach (int windowFlag, windowFlags) {
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
.arg(rect.x())
@@ -4594,8 +4622,13 @@ void tst_QWidget::setWindowGeometry()
widget.setGeometry(rect);
widget.showNormal();
- if (rect.isValid())
+ if (rect.isValid()) {
QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ } else {
+ // in case of an invalid rect, wait for the geometry to become
+ // adjusted to the actual (valid) value.
+ QApplication::processEvents();
+ }
QTRY_COMPARE(widget.geometry(), rect);
// setGeometry() while shown
@@ -6007,10 +6040,13 @@ void tst_QWidget::childEvents()
expected =
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::Polish)
+ << qMakePair(&widget, QEvent::PlatformSurface)
<< qMakePair(&widget, QEvent::WinIdChange)
+ << qMakePair(&widget, QEvent::WindowIconChange)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show)
+ << qMakePair(&widget, QEvent::CursorChange)
<< qMakePair(&widget, QEvent::ShowToParent);
QVERIFY2(spy.eventList() == expected,
@@ -6022,13 +6058,9 @@ void tst_QWidget::childEvents()
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
-#if defined(Q_OS_OSX) || defined(Q_OS_QNX)
<< qMakePair(&widget, QEvent::UpdateLater)
-#endif
<< qMakePair(&widget, QEvent::UpdateRequest);
- if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
- QEXPECT_FAIL("", EventRecorder::msgExpectFailQtBug26424(expected, spy.eventList()).constData(), Continue);
QVERIFY2(spy.eventList() == expected,
EventRecorder::msgEventListMismatch(expected, spy.eventList()).constData());
}
@@ -6097,10 +6129,13 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::Polish)
<< qMakePair(&widget, QEvent::ChildPolished)
<< qMakePair(&widget, QEvent::ChildPolished)
+ << qMakePair(&widget, QEvent::PlatformSurface)
<< qMakePair(&widget, QEvent::WinIdChange)
+ << qMakePair(&widget, QEvent::WindowIconChange)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show)
+ << qMakePair(&widget, QEvent::CursorChange)
<< qMakePair(&widget, QEvent::ShowToParent);
QVERIFY2(spy.eventList() == expected,
@@ -6113,13 +6148,9 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_OS_OSX) || defined(Q_OS_QNX)
<< qMakePair(&widget, QEvent::UpdateLater)
-#endif
<< qMakePair(&widget, QEvent::UpdateRequest);
- if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
- QEXPECT_FAIL("", EventRecorder::msgExpectFailQtBug26424(expected, spy.eventList()).constData(), Continue);
QVERIFY2(spy.eventList() == expected,
EventRecorder::msgEventListMismatch(expected, spy.eventList()).constData());
}
@@ -6190,10 +6221,13 @@ void tst_QWidget::childEvents()
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::Polish)
<< qMakePair(&widget, QEvent::ChildPolished)
+ << qMakePair(&widget, QEvent::PlatformSurface)
<< qMakePair(&widget, QEvent::WinIdChange)
+ << qMakePair(&widget, QEvent::WindowIconChange)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show)
+ << qMakePair(&widget, QEvent::CursorChange)
<< qMakePair(&widget, QEvent::ShowToParent);
QVERIFY2(spy.eventList() == expected,
@@ -6206,13 +6240,9 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_OS_OSX) || defined(Q_OS_QNX)
<< qMakePair(&widget, QEvent::UpdateLater)
-#endif
<< qMakePair(&widget, QEvent::UpdateRequest);
- if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
- QEXPECT_FAIL("", EventRecorder::msgExpectFailQtBug26424(expected, spy.eventList()).constData(), Continue);
QVERIFY2(spy.eventList() == expected,
EventRecorder::msgEventListMismatch(expected, spy.eventList()).constData());
}
@@ -8957,7 +8987,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
int numEnterEvents, numMouseMoveEvents;
};
- QCursor::setPos(QPoint(0,0));
+ QCursor::setPos(QPoint(0,0));
SELParent parent;
parent.move(200, 200);
@@ -8965,8 +8995,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
SELChild child(&parent);
child.resize(200, 200);
parent.show();
- QVERIFY(QTest::qWaitForWindowExposed(&parent));
- QTest::qWait(150);
+ QVERIFY(QTest::qWaitForWindowActive(&parent));
QCursor::setPos(child.mapToGlobal(QPoint(100, 100)));
// Make sure the cursor has entered the child.
@@ -9714,8 +9743,9 @@ void tst_QWidget::grabMouse()
QVERIFY(QTest::qWaitForWindowActive(&w));
QStringList expectedLog;
- grabber->grabMouse();
QPoint mousePos = QPoint(w.width() / 2, 10);
+ QTest::mouseMove(w.windowHandle(), mousePos);
+ grabber->grabMouse();
const int step = w.height() / 5;
for ( ; mousePos.y() < w.height() ; mousePos.ry() += step) {
QTest::mouseClick(w.windowHandle(), Qt::LeftButton, 0, mousePos);
@@ -10385,6 +10415,9 @@ public:
void tst_QWidget::keyboardModifiers()
{
KeyboardWidget w;
+ w.resize(300, 300);
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
QTest::mouseClick(&w, Qt::LeftButton, Qt::ControlModifier);
QCOMPARE(w.m_eventCounter, 1);
QCOMPARE(int(w.m_modifiers), int(Qt::ControlModifier));
@@ -10462,7 +10495,7 @@ void tst_QWidget::qmlSetParentHelper()
QWidget child;
QVERIFY(QAbstractDeclarativeData::setWidgetParent);
QAbstractDeclarativeData::setWidgetParent(&child, &parent);
- QVERIFY(child.parentWidget() == &parent);
+ QCOMPARE(child.parentWidget(), &parent);
QAbstractDeclarativeData::setWidgetParent(&child, 0);
QVERIFY(!child.parentWidget());
#else
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index 148c2352a5..5188dfbcfa 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -97,6 +97,8 @@ private slots:
void tst_resize_count();
void tst_move_count();
+
+ void tst_eventfilter_on_toplevel();
};
void tst_QWidget_window::initTestCase()
@@ -336,30 +338,30 @@ void tst_QWidget_window::tst_windowFilePath()
void tst_QWidget_window::tst_showWithoutActivating()
{
-#ifndef Q_DEAD_CODE_FROM_QT4_X11
- QSKIP("This test is X11-only.");
-#else
- QWidget w;
- w.show();
- QVERIFY(QTest::qWaitForWindowExposed(&w));
- QApplication::processEvents();
+ QString platformName = QGuiApplication::platformName().toLower();
+ if (platformName == "cocoa")
+ QSKIP("Cocoa: This fails. Figure out why.");
+ else if (platformName != QStringLiteral("xcb")
+ && platformName != QStringLiteral("windows")
+ && platformName != QStringLiteral("ios"))
+ QSKIP("Qt::WA_ShowWithoutActivating is currently supported only on xcb, windows, and ios platforms.");
+
+ QWidget w1;
+ w1.setAttribute(Qt::WA_ShowWithoutActivating);
+ w1.show();
+ QVERIFY(!QTest::qWaitForWindowActive(&w1));
- QApplication::clipboard();
- QLineEdit *lineEdit = new QLineEdit;
- lineEdit->setAttribute(Qt::WA_ShowWithoutActivating, true);
- lineEdit->show();
- lineEdit->setAttribute(Qt::WA_ShowWithoutActivating, false);
- lineEdit->raise();
- lineEdit->activateWindow();
-
- Window window;
- int revertto;
- QTRY_COMPARE(lineEdit->winId(),
- (XGetInputFocus(QX11Info::display(), &window, &revertto), window) );
- // Note the use of the , before window because we want the XGetInputFocus to be re-executed
- // in each iteration of the inside loop of the QTRY_COMPARE macro
-
-#endif // Q_DEAD_CODE_FROM_QT4_X11
+ QWidget w2;
+ w2.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w2));
+
+ QWidget w3;
+ w3.setAttribute(Qt::WA_ShowWithoutActivating);
+ w3.show();
+ QVERIFY(!QTest::qWaitForWindowActive(&w3));
+
+ w3.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&w3));
}
void tst_QWidget_window::tst_paintEventOnSecondShow()
@@ -762,5 +764,48 @@ void tst_QWidget_window::tst_move_count()
QTRY_VERIFY(move.moveCount >= 1);
}
+class EventFilter : public QObject
+{
+public:
+ int eventCount;
+
+ EventFilter()
+ : QObject(),
+ eventCount(0)
+ {
+ }
+
+ static QEvent::Type filterEventType()
+ {
+ static int type = QEvent::registerEventType();
+ return static_cast<QEvent::Type>(type);
+ }
+
+protected:
+ bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE
+ {
+ if (e->type() == filterEventType())
+ ++eventCount;
+
+ return QObject::eventFilter(o, e);
+ }
+};
+
+void tst_QWidget_window::tst_eventfilter_on_toplevel()
+{
+ QWidget w;
+ EventFilter filter;
+ w.installEventFilter(&filter);
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+ QVERIFY(w.isWindow());
+ QCOMPARE(filter.eventCount, 0);
+
+ // send an event not handled in a special way by QWidgetWindow::event,
+ // and check that it's received by the event filter
+ QCoreApplication::postEvent(w.windowHandle(), new QEvent(EventFilter::filterEventType()));
+ QTRY_COMPARE(filter.eventCount, 1);
+}
+
QTEST_MAIN(tst_QWidget_window)
#include "tst_qwidget_window.moc"
diff --git a/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp b/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
index df54d22a2f..207ce00dbf 100644
--- a/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
+++ b/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
@@ -55,6 +55,8 @@ class tst_QWidgetAction : public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
+ void cleanup();
void defaultWidget();
void visibilityUpdate();
void customWidget();
@@ -65,6 +67,19 @@ private slots:
void releaseWidgetCrash();
};
+void tst_QWidgetAction::initTestCase()
+{
+ // Disable menu/combo animations to prevent the alpha widgets from getting in the
+ // way in popup(), failing the top level leak check in cleanup().
+ QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
+ QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
+}
+
+void tst_QWidgetAction::cleanup()
+{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
+}
+
void tst_QWidgetAction::defaultWidget()
{
{
@@ -123,14 +138,14 @@ void tst_QWidgetAction::defaultWidget()
action->setDefaultWidget(combo);
tb1.addAction(action);
- QVERIFY(combo->parent() == &tb1);
+ QCOMPARE(combo->parent(), &tb1);
qApp->processEvents();
qApp->processEvents();
QVERIFY(combo->isVisible());
// not supported, not supposed to work, hence the parent() check
tb2.addAction(action);
- QVERIFY(combo->parent() == &tb1);
+ QCOMPARE(combo->parent(), &tb1);
tb2.removeAction(action);
tb1.removeAction(action);
@@ -141,11 +156,11 @@ void tst_QWidgetAction::defaultWidget()
tb2.addAction(action);
qApp->processEvents(); //the call to hide is delayd by the toolbar layout
qApp->processEvents();
- QVERIFY(combo->parent() == &tb2);
+ QCOMPARE(combo->parent(), &tb2);
QVERIFY(combo->isVisible());
tb1.addAction(action);
- QVERIFY(combo->parent() == &tb2);
+ QCOMPARE(combo->parent(), &tb2);
delete action;
QVERIFY(!combo);
@@ -156,17 +171,17 @@ void tst_QWidgetAction::defaultWidget()
QPointer<QComboBox> combo1 = new QComboBox;
a->setDefaultWidget(combo1);
- QVERIFY(a->defaultWidget() == combo1);
+ QCOMPARE(a->defaultWidget(), combo1.data());
a->setDefaultWidget(combo1);
QVERIFY(combo1);
- QVERIFY(a->defaultWidget() == combo1);
+ QCOMPARE(a->defaultWidget(), combo1.data());
QPointer<QComboBox> combo2 = new QComboBox;
QVERIFY(combo1 != combo2);
a->setDefaultWidget(combo2);
QVERIFY(!combo1);
- QVERIFY(a->defaultWidget() == combo2);
+ QCOMPARE(a->defaultWidget(), combo2.data());
delete a;
QVERIFY(!combo2);
@@ -238,7 +253,7 @@ void tst_QWidgetAction::customWidget()
combos = action->createdWidgets();
QCOMPARE(combos.count(), 2);
- QVERIFY(combos.at(0) == combo1);
+ QCOMPARE(combos.at(0), combo1.data());
QPointer<QComboBox> combo2 = qobject_cast<QComboBox *>(combos.at(1));
QVERIFY(combo2);
@@ -262,7 +277,7 @@ void tst_QWidgetAction::keepOwnership()
{
QToolBar *tb = new QToolBar;
tb->addAction(action);
- QVERIFY(combo->parent() == tb);
+ QCOMPARE(combo->parent(), tb);
delete tb;
}
diff --git a/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp b/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
index 8b566713f9..690ef30f71 100644
--- a/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
+++ b/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
@@ -84,13 +84,13 @@ void tst_QWidgetsVariant::constructor_invalid()
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(static_cast<QVariant::Type>(typeId));
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
{
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(typeId, /* copy */ 0);
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
}
@@ -208,7 +208,7 @@ void tst_QWidgetsVariant::qvariant_cast_QObject_derived()
CustomQWidget customWidget;
QWidget *widget = &customWidget;
QVariant data = QVariant::fromValue(widget);
- QVERIFY(data.userType() == qMetaTypeId<QWidget*>());
+ QCOMPARE(data.userType(), qMetaTypeId<QWidget*>());
QCOMPARE(data.value<QObject*>(), widget);
QCOMPARE(data.value<QWidget*>(), widget);
diff --git a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
index 33427788f6..dfc53c9164 100644
--- a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
+++ b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
@@ -212,7 +212,7 @@ void tst_QWindowContainer::testActivation()
// Under KDE (ubuntu 12.10), we experience that doing two activateWindow in a row
// does not work. The second gets ignored by the window manager, even though the
// timestamp in the xcb connection is unique for both.
- if (QGuiApplication::platformName() == "xcb")
+ if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
QTest::qWait(100);
window->requestActivate();
@@ -327,7 +327,7 @@ void tst_QWindowContainer::testDockWidget()
QTest::qWait(1000);
dock->setFloating(false);
- QTRY_VERIFY(window->parent() == mainWindow.window()->windowHandle());
+ QTRY_COMPARE(window->parent(), mainWindow.window()->windowHandle());
}
QTEST_MAIN(tst_QWindowContainer)
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index 7aa529d5ee..21369d4520 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -214,12 +214,12 @@ void tst_QStyle::testProxyStyle()
QProxyStyle *proxyStyle = new QProxyStyle();
QVERIFY(proxyStyle->baseStyle());
QStyle *style = QStyleFactory::create("Windows");
- QVERIFY(style->proxy() == style);
+ QCOMPARE(style->proxy(), style);
proxyStyle->setBaseStyle(style);
- QVERIFY(style->proxy() == proxyStyle);
- QVERIFY(style->parent() == proxyStyle);
- QVERIFY(proxyStyle->baseStyle() == style);
+ QCOMPARE(style->proxy(), proxyStyle);
+ QCOMPARE(style->parent(), proxyStyle);
+ QCOMPARE(proxyStyle->baseStyle(), style);
QVERIFY(testAllFunctions(proxyStyle));
proxyStyle->setBaseStyle(0);
@@ -236,7 +236,7 @@ void tst_QStyle::testProxyStyle()
QLineEdit edit;
edit.setStyle(&customStyle);
QVERIFY(!customStyle.parent());
- QVERIFY(edit.style()->pixelMetric(QStyle::PM_ButtonIconSize) == 13);
+ QCOMPARE(edit.style()->pixelMetric(QStyle::PM_ButtonIconSize), 13);
}
void tst_QStyle::drawItemPixmap()
diff --git a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
index 3c1d4c589b..2e26ba609b 100644
--- a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
+++ b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
@@ -43,7 +43,6 @@ class tst_QStyleOption: public QObject
private slots:
void qstyleoptioncast_data();
void qstyleoptioncast();
- void copyconstructors();
};
// Just a simple container for QStyleOption-pointer
@@ -133,21 +132,6 @@ void tst_QStyleOption::qstyleoptioncast()
delete testOption;
}
-void tst_QStyleOption::copyconstructors()
-{
- QStyleOptionFrame frame;
- QStyleOptionFrameV2 frame2(frame);
- QCOMPARE(frame2.version, int(QStyleOptionFrameV2::Version));
- frame2 = frame;
- QCOMPARE(frame2.version, int(QStyleOptionFrameV2::Version));
-
- QStyleOptionProgressBar bar;
- QStyleOptionProgressBarV2 bar2(bar);
- QCOMPARE(bar2.version, int(QStyleOptionProgressBarV2::Version));
- bar2 = bar;
- QCOMPARE(bar2.version, int(QStyleOptionProgressBarV2::Version));
-}
-
QTEST_MAIN(tst_QStyleOption)
#include "tst_qstyleoption.moc"
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
new file mode 100644
index 0000000000..cf78fb47c2
--- /dev/null
+++ b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
@@ -0,0 +1,2 @@
+[hoverColors]
+ubuntu-14.04
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 25f7715e3b..a360803c50 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -178,45 +178,49 @@ void tst_QStyleSheetStyle::numinstances()
void tst_QStyleSheetStyle::widgetsBeforeAppStyleSheet()
{
QPushButton w1; // widget with no stylesheet
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
qApp->setStyleSheet("* { color: red; }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
w1.setStyleSheet("color: white");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
}
class FriendlySpinBox : public QSpinBox { friend class tst_QStyleSheetStyle; };
void tst_QStyleSheetStyle::widgetsAfterAppStyleSheet()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
qApp->setStyleSheet("* { color: red; font-size: 32pt; }");
QPushButton w1;
FriendlySpinBox spin;
- QVERIFY(COLOR(w1) == QColor("red"));
- QVERIFY(COLOR(spin) == QColor("red"));
- QVERIFY(COLOR(*spin.lineEdit()) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
+ QCOMPARE(COLOR(spin), red);
+ QCOMPARE(COLOR(*spin.lineEdit()), red);
QCOMPARE(FONTSIZE(w1), 32);
QCOMPARE(FONTSIZE(spin), 32);
QCOMPARE(FONTSIZE(*spin.lineEdit()), 32);
w1.setStyleSheet("color: white");
- QVERIFY(COLOR(w1) == QColor("white"));
- QVERIFY(COLOR(spin) == QColor("red"));
- QVERIFY(COLOR(*spin.lineEdit()) == QColor("red"));
+ QCOMPARE(COLOR(w1), white);
+ QCOMPARE(COLOR(spin), red);
+ QCOMPARE(COLOR(*spin.lineEdit()), red);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("red"));
- QVERIFY(COLOR(spin) == QColor("red"));
- QVERIFY(COLOR(*spin.lineEdit()) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
+ QCOMPARE(COLOR(spin), red);
+ QCOMPARE(COLOR(*spin.lineEdit()), red);
w1.setStyleSheet("color: white");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("white"));
- QVERIFY(COLOR(spin) == APPCOLOR(spin));
- QVERIFY(COLOR(*spin.lineEdit()) == APPCOLOR(*spin.lineEdit()));
+ QCOMPARE(COLOR(w1), white);
+ QCOMPARE(COLOR(spin), APPCOLOR(spin));
+ QCOMPARE(COLOR(*spin.lineEdit()), APPCOLOR(*spin.lineEdit()));
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
// QCOMPARE(FONTSIZE(w1), APPFONTSIZE(w1)); //### task 244261
QCOMPARE(FONTSIZE(spin), APPFONTSIZE(spin));
//QCOMPARE(FONTSIZE(*spin.lineEdit()), APPFONTSIZE(*spin.lineEdit())); //### task 244261
@@ -224,121 +228,135 @@ void tst_QStyleSheetStyle::widgetsAfterAppStyleSheet()
void tst_QStyleSheetStyle::applicationStyleSheet()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton w1;
qApp->setStyleSheet("* { color: red; }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
qApp->setStyleSheet("* { color: white; }");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
qApp->setStyleSheet("* { color: red }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
}
void tst_QStyleSheetStyle::windowStyleSheet()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton w1;
qApp->setStyleSheet("");
w1.setStyleSheet("* { color: red; }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
w1.setStyleSheet("* { color: white; }");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
w1.setStyleSheet("* { color: red }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
qApp->setStyleSheet("* { color: green }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("green"));
+ QCOMPARE(COLOR(w1), QColor("green"));
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
}
void tst_QStyleSheetStyle::widgetStyleSheet()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton w1;
QPushButton *pb = new QPushButton(&w1);
QPushButton &w2 = *pb;
qApp->setStyleSheet("");
w1.setStyleSheet("* { color: red }");
- QVERIFY(COLOR(w1) == QColor("red"));
- QVERIFY(COLOR(w2) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
+ QCOMPARE(COLOR(w2), red);
w2.setStyleSheet("* { color: white }");
- QVERIFY(COLOR(w2) == QColor("white"));
+ QCOMPARE(COLOR(w2), white);
w1.setStyleSheet("* { color: blue }");
- QVERIFY(COLOR(w1) == QColor("blue"));
- QVERIFY(COLOR(w2) == QColor("white"));
+ QCOMPARE(COLOR(w1), blue);
+ QCOMPARE(COLOR(w2), white);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
- QVERIFY(COLOR(w2) == QColor("white"));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
+ QCOMPARE(COLOR(w2), white);
w2.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
- QVERIFY(COLOR(w2) == APPCOLOR(w2));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
+ QCOMPARE(COLOR(w2), APPCOLOR(w2));
}
void tst_QStyleSheetStyle::reparentWithNoChildStyleSheet()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton p1, p2;
QPushButton *pb = new QPushButton(&p1);
QPushButton &c1 = *pb; // child with no stylesheet
qApp->setStyleSheet("");
p1.setStyleSheet("* { color: red }");
- QVERIFY(COLOR(c1) == QColor("red"));
+ QCOMPARE(COLOR(c1), red);
c1.setParent(&p2);
- QVERIFY(COLOR(c1) == APPCOLOR(c1));
+ QCOMPARE(COLOR(c1), APPCOLOR(c1));
p2.setStyleSheet("* { color: white }");
- QVERIFY(COLOR(c1) == QColor("white"));
+ QCOMPARE(COLOR(c1), white);
c1.setParent(&p1);
- QVERIFY(COLOR(c1) == QColor("red"));
+ QCOMPARE(COLOR(c1), red);
qApp->setStyleSheet("* { color: blue }");
c1.setParent(0);
- QVERIFY(COLOR(c1) == QColor("blue"));
+ QCOMPARE(COLOR(c1), blue);
delete pb;
}
void tst_QStyleSheetStyle::reparentWithChildStyleSheet()
{
+ const QColor gray("gray");
+ const QColor white(Qt::white);
qApp->setStyleSheet("");
QPushButton p1, p2;
QPushButton *pb = new QPushButton(&p1);
QPushButton &c1 = *pb;
c1.setStyleSheet("background: gray");
- QVERIFY(BACKGROUND(c1) == QColor("gray"));
+ QCOMPARE(BACKGROUND(c1), gray);
c1.setParent(&p2);
- QVERIFY(BACKGROUND(c1) == QColor("gray"));
+ QCOMPARE(BACKGROUND(c1), gray);
qApp->setStyleSheet("* { color: white }");
c1.setParent(&p1);
- QVERIFY(BACKGROUND(c1) == QColor("gray"));
- QVERIFY(COLOR(c1) == QColor("white"));
+ QCOMPARE(BACKGROUND(c1), gray);
+ QCOMPARE(COLOR(c1), white);
}
void tst_QStyleSheetStyle::repolish()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
qApp->setStyleSheet("");
QPushButton p1;
p1.setStyleSheet("color: red; background: white");
- QVERIFY(BACKGROUND(p1) == QColor("white"));
+ QCOMPARE(BACKGROUND(p1), white);
p1.setStyleSheet("background: white");
- QVERIFY(COLOR(p1) == APPCOLOR(p1));
+ QCOMPARE(COLOR(p1), APPCOLOR(p1));
p1.setStyleSheet("color: red");
- QVERIFY(COLOR(p1) == QColor("red"));
- QVERIFY(BACKGROUND(p1) == APPBACKGROUND(p1));
+ QCOMPARE(COLOR(p1), red);
+ QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1));
p1.setStyleSheet("");
- QVERIFY(COLOR(p1) == APPCOLOR(p1));
- QVERIFY(BACKGROUND(p1) == APPBACKGROUND(p1));
+ QCOMPARE(COLOR(p1), APPCOLOR(p1));
+ QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1));
}
void tst_QStyleSheetStyle::widgetStyle()
@@ -492,12 +510,12 @@ void tst_QStyleSheetStyle::appStyle()
QPointer<QStyle> style2 = QStyleFactory::create("Windows");
qApp->setStyle(style1);
// Basic sanity
- QVERIFY(qApp->style() == style1);
+ QCOMPARE(QApplication::style(), style1.data());
qApp->setStyle(style2);
QVERIFY(style1.isNull()); // qApp must have taken ownership and deleted it
// Setting null should not crash
qApp->setStyle(0);
- QVERIFY(qApp->style() == style2);
+ QCOMPARE(QApplication::style(), style2.data());
// Set the stylesheet
qApp->setStyleSheet("whatever");
@@ -505,7 +523,7 @@ void tst_QStyleSheetStyle::appStyle()
QVERIFY(!sss.isNull());
QCOMPARE(sss->metaObject()->className(), "QStyleSheetStyle"); // must be our proxy now
QVERIFY(!style2.isNull()); // this should exist as it is the base of the proxy
- QVERIFY(sss->baseStyle() == style2);
+ QCOMPARE(sss->baseStyle(), style2.data());
style1 = QStyleFactory::create("Windows");
qApp->setStyle(style1);
QVERIFY(style2.isNull()); // should disappear automatically
@@ -514,16 +532,16 @@ void tst_QStyleSheetStyle::appStyle()
// Update the stylesheet and check nothing changes
sss = (QStyleSheetStyle *)qApp->style();
qApp->setStyleSheet("whatever2");
- QVERIFY(qApp->style() == sss);
- QVERIFY(sss->baseStyle() == style1);
+ QCOMPARE(QApplication::style(), sss.data());
+ QCOMPARE(sss->baseStyle(), style1.data());
// Revert the stylesheet
qApp->setStyleSheet("");
QVERIFY(sss.isNull()); // should have disappeared
- QVERIFY(qApp->style() == style1);
+ QCOMPARE(QApplication::style(), style1.data());
qApp->setStyleSheet("");
- QVERIFY(qApp->style() == style1);
+ QCOMPARE(QApplication::style(), style1.data());
}
void tst_QStyleSheetStyle::dynamicProperty()
@@ -589,21 +607,24 @@ namespace ns {
void tst_QStyleSheetStyle::namespaces()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
ns::PushButton1 pb1;
qApp->setStyleSheet("ns--PushButton1 { background: white }");
- QVERIFY(BACKGROUND(pb1) == QColor("white"));
+ QCOMPARE(BACKGROUND(pb1), white);
qApp->setStyleSheet(".ns--PushButton1 { background: red }");
- QVERIFY(BACKGROUND(pb1) == QColor("red"));
+ QCOMPARE(BACKGROUND(pb1), red);
ns::PushButton2 pb2;
qApp->setStyleSheet("ns--PushButton1 { background: blue}");
- QVERIFY(BACKGROUND(pb2) == QColor("blue"));
+ QCOMPARE(BACKGROUND(pb2), blue);
qApp->setStyleSheet("ns--PushButton2 { background: magenta }");
- QVERIFY(BACKGROUND(pb2) == QColor("magenta"));
+ QCOMPARE(BACKGROUND(pb2), QColor(Qt::magenta));
qApp->setStyleSheet(".PushButtonTwo { background: white; }");
- QVERIFY(BACKGROUND(pb2) == QColor("white"));
+ QCOMPARE(BACKGROUND(pb2), white);
qApp->setStyleSheet(".PushButtonDuo { background: red; }");
- QVERIFY(BACKGROUND(pb2) == QColor("red"));
+ QCOMPARE(BACKGROUND(pb2), red);
}
void tst_QStyleSheetStyle::palettePropagation()
@@ -639,8 +660,8 @@ void tst_QStyleSheetStyle::fontPropagation()
int viewFontSize = FONTSIZE(*popup);
cb.setStyleSheet("QComboBox { font-size: 20pt; }");
- QVERIFY(FONTSIZE(cb) == 20);
- QVERIFY(FONTSIZE(*popup) == viewFontSize);
+ QCOMPARE(FONTSIZE(cb), 20);
+ QCOMPARE(FONTSIZE(*popup), viewFontSize);
QGroupBox gb;
QPushButton *push = new QPushButton(&gb);
QPushButton &pb = *push;
@@ -648,25 +669,25 @@ void tst_QStyleSheetStyle::fontPropagation()
int gbFontSize = FONTSIZE(gb);
gb.setStyleSheet("QGroupBox { font-size: 20pt }");
- QVERIFY(FONTSIZE(gb) == 20);
+ QCOMPARE(FONTSIZE(gb), 20);
QVERIFY(FONTSIZE(pb) == buttonFontSize); // font does not propagate
gb.setStyleSheet("QGroupBox * { font-size: 20pt; }");
- QVERIFY(FONTSIZE(gb) == gbFontSize);
- QVERIFY(FONTSIZE(pb) == 20);
+ QCOMPARE(FONTSIZE(gb), gbFontSize);
+ QCOMPARE(FONTSIZE(pb), 20);
QWidget window;
window.setStyleSheet("* { font-size: 10pt }");
pb.setParent(&window);
QCOMPARE(FONTSIZE(pb), 10);
window.setStyleSheet("");
- QVERIFY(FONTSIZE(pb) == buttonFontSize);
+ QCOMPARE(FONTSIZE(pb), buttonFontSize);
QTabWidget tw;
tw.setStyleSheet("QTabWidget { font-size: 20pt; }");
- QVERIFY(FONTSIZE(tw) == 20);
+ QCOMPARE(FONTSIZE(tw), 20);
QWidget *child = tw.findChild<QWidget *>("qt_tabwidget_tabbar");
QVERIFY2(child, "QTabWidget did not contain a widget named \"qt_tabwidget_tabbar\"");
- QVERIFY(FONTSIZE(*child) == 20);
+ QCOMPARE(FONTSIZE(*child), 20);
}
void tst_QStyleSheetStyle::onWidgetDestroyed()
@@ -1009,6 +1030,8 @@ void tst_QStyleSheetStyle::tabAlignement()
void tst_QStyleSheetStyle::attributesList()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
QWidget w;
QPushButton *p1=new QPushButton(&w);
QPushButton *p2=new QPushButton(&w);
@@ -1019,10 +1042,10 @@ void tst_QStyleSheetStyle::attributesList()
p3->setProperty("prop", QStringList() << "foo" << "bar");
w.setStyleSheet(" QPushButton{ background-color:blue; } QPushButton[prop~=red] { background-color:red; }");
- QCOMPARE(BACKGROUND(*p1) , QColor("red"));
- QCOMPARE(BACKGROUND(*p2) , QColor("red"));
- QCOMPARE(BACKGROUND(*p3) , QColor("blue"));
- QCOMPARE(BACKGROUND(*p4) , QColor("blue"));
+ QCOMPARE(BACKGROUND(*p1) , red);
+ QCOMPARE(BACKGROUND(*p2) , red);
+ QCOMPARE(BACKGROUND(*p3) , blue);
+ QCOMPARE(BACKGROUND(*p4) , blue);
}
void tst_QStyleSheetStyle::minmaxSizes()
@@ -1065,6 +1088,7 @@ void tst_QStyleSheetStyle::minmaxSizes()
void tst_QStyleSheetStyle::task206238_twice()
{
+ const QColor red(Qt::red);
QMainWindow w;
QTabWidget* tw = new QTabWidget;
tw->addTab(new QLabel("foo"), "test");
@@ -1073,12 +1097,12 @@ void tst_QStyleSheetStyle::task206238_twice()
centerOnScreen(&w);
w.show();
QTest::qWait(20);
- QCOMPARE(BACKGROUND(w) , QColor("red"));
- QCOMPARE(BACKGROUND(*tw), QColor("red"));
+ QCOMPARE(BACKGROUND(w) , red);
+ QCOMPARE(BACKGROUND(*tw), red);
w.setStyleSheet("background: red;");
QTest::qWait(20);
- QCOMPARE(BACKGROUND(w) , QColor("red"));
- QCOMPARE(BACKGROUND(*tw), QColor("red"));
+ QCOMPARE(BACKGROUND(w) , red);
+ QCOMPARE(BACKGROUND(*tw), red);
}
void tst_QStyleSheetStyle::transparent()
@@ -1277,9 +1301,9 @@ void tst_QStyleSheetStyle::proxyStyle()
QTest::qWait(100);
// Test for QTBUG-7198 - style sheet overrides custom element size
- QStyleOptionViewItemV4 opt;
+ QStyleOptionViewItem opt;
opt.initFrom(w);
- opt.features |= QStyleOptionViewItemV2::HasCheckIndicator;
+ opt.features |= QStyleOptionViewItem::HasCheckIndicator;
QVERIFY(pb5->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator,
&opt, pb5).width() == 3);
delete w;
diff --git a/tests/auto/widgets/util/qcompleter/BLACKLIST b/tests/auto/widgets/util/qcompleter/BLACKLIST
index ffbcc94a1f..fdc424b6ac 100644
--- a/tests/auto/widgets/util/qcompleter/BLACKLIST
+++ b/tests/auto/widgets/util/qcompleter/BLACKLIST
@@ -1,2 +1,2 @@
[QTBUG_14292_filesystem]
-ubuntu-14.04
+linux
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index dbfeda8104..e8ac9aa5d2 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -1043,9 +1043,9 @@ void tst_QCompleter::setters()
QAbstractItemModel *oldModel = completer->model();
completer->setModel(dirModel);
QVERIFY(completer->popup()->model() != oldModel);
- QVERIFY(completer->popup()->model() == completer->completionModel());
+ QCOMPARE(completer->popup()->model(), completer->completionModel());
completer->setPopup(new QListView);
- QVERIFY(completer->popup()->model() == completer->completionModel());
+ QCOMPARE(completer->popup()->model(), completer->completionModel());
completer->setModel(new QStringListModel(completer));
QVERIFY(dirModel == 0); // must have been deleted
@@ -1062,7 +1062,7 @@ void tst_QCompleter::modelDeletion()
QStringListModel *listModel = new QStringListModel(list);
completer->setCompletionPrefix("i");
completer->setModel(listModel);
- QVERIFY(completer->completionCount() == 3);
+ QCOMPARE(completer->completionCount(), 3);
QScopedPointer<QListView> view(new QListView);
view->setModel(completer->completionModel());
delete listModel;
@@ -1070,8 +1070,8 @@ void tst_QCompleter::modelDeletion()
view->show();
qApp->processEvents();
view.reset();
- QVERIFY(completer->completionCount() == 0);
- QVERIFY(completer->currentRow() == -1);
+ QCOMPARE(completer->completionCount(), 0);
+ QCOMPARE(completer->currentRow(), -1);
}
void tst_QCompleter::multipleWidgets()
@@ -1098,7 +1098,7 @@ void tst_QCompleter::multipleWidgets()
window.activateWindow();
QApplication::setActiveWindow(&window);
QTest::qWait(50);
- QTRY_VERIFY(qApp->focusWidget() == comboBox);
+ QTRY_COMPARE(QApplication::focusWidget(), comboBox);
comboBox->lineEdit()->setText("it");
QCOMPARE(comboBox->currentText(), QString("it")); // should not complete with setText
QTest::keyPress(comboBox, 'e');
@@ -1111,7 +1111,7 @@ void tst_QCompleter::multipleWidgets()
lineEdit->show();
lineEdit->setFocus();
QTest::qWait(50);
- QTRY_VERIFY(qApp->focusWidget() == lineEdit);
+ QTRY_COMPARE(QApplication::focusWidget(), lineEdit);
lineEdit->setText("it");
QCOMPARE(lineEdit->text(), QString("it")); // should not completer with setText
QCOMPARE(comboBox->currentText(), QString("")); // combo box text must not change!
@@ -1148,13 +1148,13 @@ void tst_QCompleter::focusIn()
lineEdit2->show();
comboBox->setFocus();
- QTRY_VERIFY(completer.widget() == comboBox);
+ QTRY_COMPARE(completer.widget(), comboBox);
lineEdit->setFocus();
- QTRY_VERIFY(completer.widget() == lineEdit);
+ QTRY_COMPARE(completer.widget(), lineEdit);
comboBox->setFocus();
- QTRY_VERIFY(completer.widget() == comboBox);
+ QTRY_COMPARE(completer.widget(), comboBox);
lineEdit2->setFocus();
- QTRY_VERIFY(completer.widget() == comboBox);
+ QTRY_COMPARE(completer.widget(), comboBox);
}
void tst_QCompleter::dynamicSortOrder()
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index d2e88a1656..58a655321c 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -297,7 +297,7 @@ void tst_QScroller::staticScrollers()
QScrollerProperties sp2 = QScroller::scroller(o2)->scrollerProperties();
// default properties should be the same
- QVERIFY(sp1 == sp2);
+ QCOMPARE(sp1, sp2);
QCOMPARE(QScroller::scroller(o1)->scrollerProperties(), sp1);
diff --git a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
index 7ea63911ae..05511a17a1 100644
--- a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
+++ b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
@@ -136,7 +136,7 @@ void tst_QSystemTrayIcon::lastWindowClosed()
QTimer::singleShot(2500, &window, SLOT(close()));
QTimer::singleShot(20000, qApp, SLOT(quit())); // in case the test fails
qApp->exec();
- QVERIFY(spy.count() == 1);
+ QCOMPARE(spy.count(), 1);
}
QTEST_MAIN(tst_QSystemTrayIcon)
diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
index 781adeedad..9f03e9b3a0 100644
--- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
@@ -36,7 +36,22 @@
#include <QAction>
// Temporarily disabling IRIX due to build issuues with GCC
-#if !defined(__sgi) || defined(__sgi) && !defined(__GNUC__)
+#if defined(__sgi) && defined(__GNUC__)
+
+class tst_QUndoGroup : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QUndoGroup() {}
+
+private slots:
+ void setActive() { QSKIP( "Not tested on irix-g++"); }
+ void addRemoveStack() { QSKIP( "Not tested on irix-g++"); }
+ void deleteStack() { QSKIP( "Not tested on irix-g++"); }
+ void checkSignals() { QSKIP( "Not tested on irix-g++"); }
+ void addStackAndDie() { QSKIP( "Not tested on irix-g++"); }
+};
+#else
/******************************************************************************
** Commands
@@ -645,22 +660,7 @@ void tst_QUndoGroup::commandTextFormat()
qApp->removeTranslator(&translator);
#endif
}
-
-#else
-class tst_QUndoGroup : public QObject
-{
- Q_OBJECT
-public:
- tst_QUndoGroup() {}
-
-private slots:
- void setActive() { QSKIP( "Not tested on irix-g++"); }
- void addRemoveStack() { QSKIP( "Not tested on irix-g++"); }
- void deleteStack() { QSKIP( "Not tested on irix-g++"); }
- void checkSignals() { QSKIP( "Not tested on irix-g++"); }
- void addStackAndDie() { QSKIP( "Not tested on irix-g++"); }
-};
-#endif
+#endif // !(SGI && GCC)
QTEST_MAIN(tst_QUndoGroup)
diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
index a633ba0cf0..43d6912c6e 100644
--- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
+++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
@@ -283,9 +283,9 @@ void tst_QAbstractButton::setAutoRepeat()
QTest::qWait(REPEAT_DELAY);
QVERIFY(testWidget->isDown());
QTest::keyRelease(testWidget, Qt::Key_Space);
- QVERIFY(release_count == press_count);
- QVERIFY(toggle_count == 0);
- QVERIFY(press_count == click_count);
+ QCOMPARE(release_count, press_count);
+ QCOMPARE(toggle_count, uint(0));
+ QCOMPARE(press_count, click_count);
QVERIFY(click_count > 1);
break;
case 4:
diff --git a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
index df69063540..5dec6224ca 100644
--- a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
+++ b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
@@ -324,13 +324,13 @@ void tst_QButtonGroup::testSignals()
int expectedId = -2;
- QVERIFY(clickedIdSpy.takeFirst().at(0).toInt() == expectedId);
+ QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), expectedId);
QCOMPARE(pressedSpy.count(), 1);
QCOMPARE(pressedIdSpy.count(), 1);
- QVERIFY(pressedIdSpy.takeFirst().at(0).toInt() == expectedId);
+ QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), expectedId);
QCOMPARE(releasedSpy.count(), 1);
QCOMPARE(releasedIdSpy.count(), 1);
- QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == expectedId);
+ QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), expectedId);
clickedSpy.clear();
clickedIdSpy.clear();
@@ -344,13 +344,13 @@ void tst_QButtonGroup::testSignals()
QCOMPARE(clickedSpy.count(), 1);
QCOMPARE(clickedIdSpy.count(), 1);
- QVERIFY(clickedIdSpy.takeFirst().at(0).toInt() == 23);
+ QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), 23);
QCOMPARE(pressedSpy.count(), 1);
QCOMPARE(pressedIdSpy.count(), 1);
- QVERIFY(pressedIdSpy.takeFirst().at(0).toInt() == 23);
+ QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), 23);
QCOMPARE(releasedSpy.count(), 1);
QCOMPARE(releasedIdSpy.count(), 1);
- QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == 23);
+ QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), 23);
QSignalSpy toggledSpy(&buttons, SIGNAL(buttonToggled(QAbstractButton*, bool)));
@@ -427,25 +427,25 @@ void tst_QButtonGroup::checkedButton()
buttons.addButton(&pb1);
buttons.addButton(&pb2, 23);
- QVERIFY(buttons.checkedButton() == 0);
+ QVERIFY(!buttons.checkedButton());
pb1.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb1);
+ QCOMPARE(buttons.checkedButton(), &pb1);
pb2.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb2);
+ QCOMPARE(buttons.checkedButton(), &pb2);
pb2.setChecked(false);
- QVERIFY(buttons.checkedButton() == &pb1);
+ QCOMPARE(buttons.checkedButton(), &pb1);
pb1.setChecked(false);
- QVERIFY(buttons.checkedButton() == 0);
+ QVERIFY(!buttons.checkedButton());
buttons.setExclusive(true);
- QVERIFY(buttons.checkedButton() == 0);
+ QVERIFY(!buttons.checkedButton());
pb1.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb1);
+ QCOMPARE(buttons.checkedButton(), &pb1);
pb2.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb2);
+ QCOMPARE(buttons.checkedButton(), &pb2);
// checked button cannot be unchecked
pb2.setChecked(false);
- QVERIFY(buttons.checkedButton() == &pb2);
+ QCOMPARE(buttons.checkedButton(), &pb2);
}
class task209485_ButtonDeleter : public QObject
@@ -523,9 +523,9 @@ void tst_QButtonGroup::autoIncrementId()
radio1->setChecked(true);
- QVERIFY(buttons->id(radio1) == -2);
- QVERIFY(buttons->id(radio2) == -3);
- QVERIFY(buttons->id(radio3) == -4);
+ QCOMPARE(buttons->id(radio1), -2);
+ QCOMPARE(buttons->id(radio2), -3);
+ QCOMPARE(buttons->id(radio3), -4);
dlg.show();
}
diff --git a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
index e76e11fc67..5696382fab 100644
--- a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
+++ b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
@@ -83,9 +83,7 @@ private:
uint press_count;
uint release_count;
int cur_state;
- uint tmp;
QCheckBox *testWidget;
- uint tmp2;
};
tst_QCheckBox::tst_QCheckBox()
@@ -326,7 +324,7 @@ void tst_QCheckBox::isToggleButton()
void tst_QCheckBox::foregroundRole()
{
- QVERIFY(testWidget->foregroundRole() == QPalette::WindowText);
+ QCOMPARE(testWidget->foregroundRole(), QPalette::WindowText);
}
void tst_QCheckBox::minimumSizeHint()
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 00636e50a8..ae516639a6 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -164,6 +164,7 @@ private slots:
void keyboardSelection();
void setCustomModelAndView();
void updateDelegateOnEditableChange();
+ void respectChangedOwnershipOfItemView();
void task_QTBUG_39088_inputMethodHints();
void task_QTBUG_49831_scrollerNotActivated();
};
@@ -454,7 +455,7 @@ void tst_QComboBox::setPalette()
for (int i = 0; i < comboChildren.size(); ++i) {
QObject *o = comboChildren.at(i);
if (o->isWidgetType()) {
- QVERIFY(((QWidget*)o)->palette() == pal);
+ QCOMPARE(((QWidget*)o)->palette(), pal);
}
}
@@ -463,12 +464,12 @@ void tst_QComboBox::setPalette()
//Setting it on the lineedit should be separate form the combo
testWidget->lineEdit()->setPalette(pal);
QVERIFY(testWidget->palette() != pal);
- QVERIFY(testWidget->lineEdit()->palette() == pal);
+ QCOMPARE(testWidget->lineEdit()->palette(), pal);
pal.setColor(QPalette::Base, Qt::green);
//Setting it on the combo directly should override lineedit
testWidget->setPalette(pal);
- QVERIFY(testWidget->palette() == pal);
- QVERIFY(testWidget->lineEdit()->palette() == pal);
+ QCOMPARE(testWidget->palette(), pal);
+ QCOMPARE(testWidget->lineEdit()->palette(), pal);
}
void tst_QComboBox::sizeAdjustPolicy()
@@ -479,7 +480,7 @@ void tst_QComboBox::sizeAdjustPolicy()
QComboBox *testWidget = topLevel.comboBox();
// test that adding new items will not change the sizehint for AdjustToContentsOnFirstShow
QVERIFY(!testWidget->count());
- QVERIFY(testWidget->sizeAdjustPolicy() == QComboBox::AdjustToContentsOnFirstShow);
+ QCOMPARE(testWidget->sizeAdjustPolicy(), QComboBox::AdjustToContentsOnFirstShow);
QVERIFY(testWidget->isVisible());
QSize firstShow = testWidget->sizeHint();
testWidget->addItem("normal item");
@@ -752,7 +753,7 @@ void tst_QComboBox::insertPolicy()
// First check that there is the right number of entries, or
// we may unwittingly pass
- QVERIFY((int)result.count() == testWidget->count());
+ QCOMPARE((int)result.count(), testWidget->count());
// No need to compare if there are no strings to compare
if (result.count() > 0) {
@@ -797,7 +798,7 @@ void tst_QComboBox::virtualAutocompletion()
QApplication::sendEvent(testWidget, &kr1);
qApp->processEvents(); // Process events to trigger autocompletion
- QTRY_VERIFY(testWidget->currentIndex() == 1);
+ QTRY_COMPARE(testWidget->currentIndex(), 1);
QKeyEvent kp2(QEvent::KeyPress, Qt::Key_O, 0, "o");
QKeyEvent kr2(QEvent::KeyRelease, Qt::Key_O, 0, "o");
@@ -846,7 +847,7 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
testWidget->clearEditText();
QSignalSpy spyReturn(testWidget, SIGNAL(activated(int)));
testWidget->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive);
- QVERIFY(testWidget->autoCompletionCaseSensitivity() == Qt::CaseInsensitive);
+ QCOMPARE(testWidget->autoCompletionCaseSensitivity(), Qt::CaseInsensitive);
QTest::keyClick(testWidget->lineEdit(), Qt::Key_A);
qApp->processEvents();
@@ -880,7 +881,7 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
// case sensitive
testWidget->clearEditText();
testWidget->setAutoCompletionCaseSensitivity(Qt::CaseSensitive);
- QVERIFY(testWidget->autoCompletionCaseSensitivity() == Qt::CaseSensitive);
+ QCOMPARE(testWidget->autoCompletionCaseSensitivity(), Qt::CaseSensitive);
QTest::keyClick(testWidget->lineEdit(), Qt::Key_A);
qApp->processEvents();
QCOMPARE(testWidget->currentText(), QString("aww"));
@@ -1378,7 +1379,7 @@ void tst_QComboBox::textpixmapdata()
QCOMPARE(icon.cacheKey(), icons.at(i).cacheKey());
QPixmap original = icons.at(i).pixmap(1024);
QPixmap pixmap = icon.pixmap(1024);
- QVERIFY(pixmap.toImage() == original.toImage());
+ QCOMPARE(pixmap.toImage(), original.toImage());
}
for (int i = 0; i<text.count(); ++i) {
@@ -1612,7 +1613,7 @@ void tst_QComboBox::setModel()
QCOMPARE(box.currentIndex(), 0);
QVERIFY(box.model() != oldModel);
QVERIFY(box.rootModelIndex() != rootModelIndex);
- QVERIFY(box.rootModelIndex() == QModelIndex());
+ QCOMPARE(box.rootModelIndex(), QModelIndex());
// check that setting the very same model doesn't move the current item
box.setCurrentIndex(1);
@@ -3185,6 +3186,27 @@ void tst_QComboBox::task_QTBUG_39088_inputMethodHints()
QCOMPARE(box.lineEdit()->inputMethodHints(), Qt::ImhNoPredictiveText);
}
+void tst_QComboBox::respectChangedOwnershipOfItemView()
+{
+ QComboBox box1;
+ QComboBox box2;
+ QTableView *v1 = new QTableView;
+ box1.setView(v1);
+
+ QSignalSpy spy1(v1, SIGNAL(destroyed()));
+ box2.setView(v1); // Ownership should now be transferred to box2
+
+
+ QTableView *v2 = new QTableView(&box1);
+ box1.setView(v2); // Here we do not expect v1 to be deleted
+ QApplication::processEvents();
+ QCOMPARE(spy1.count(), 0);
+
+ QSignalSpy spy2(v2, SIGNAL(destroyed()));
+ box1.setView(v1);
+ QCOMPARE(spy2.count(), 1);
+}
+
void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated()
{
QStringList modelData;
diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
index d8cb7c01ad..a57553097a 100644
--- a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
+++ b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
@@ -98,11 +98,11 @@ void tst_QCommandLinkButton::getSetCheck()
QString text("mytext");
QVERIFY(obj1.description().isEmpty());
obj1.setDescription(text);
- QVERIFY(obj1.description() == text);
+ QCOMPARE(obj1.description(), text);
QVERIFY(obj1.text().isEmpty());
obj1.setText(text);
- QVERIFY(obj1.text() == text);
+ QCOMPARE(obj1.text(), text);
QMenu *var1 = new QMenu;
obj1.setMenu(var1);
@@ -236,8 +236,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
QVERIFY( testWidget->isDown() );
QVERIFY( toggle_count == 0 );
QTest::keyRelease( testWidget, Qt::Key_Space );
- QVERIFY(press_count == release_count);
- QVERIFY(release_count == click_count);
+ QCOMPARE(press_count, release_count);
+ QCOMPARE(release_count, click_count);
QVERIFY(press_count > 1);
// #### shouldn't I check here to see if multiple signals have been fired???
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index c9ae60dd76..d41398046f 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -285,6 +285,7 @@ typedef QList<Qt::Key> KeyList;
void tst_QDateTimeEdit::getSetCheck()
{
QDateTimeEdit obj1;
+ QCOMPARE(obj1.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
obj1.setDisplayFormat("dd/MM/yyyy hh:mm:ss.zzz d/M/yy h:m:s.z AP");
// Section QDateTimeEdit::currentSection()
// void QDateTimeEdit::setCurrentSection(Section)
@@ -306,6 +307,11 @@ void tst_QDateTimeEdit::getSetCheck()
QCOMPARE(QDateTimeEdit::MonthSection, obj1.currentSection());
obj1.setCurrentSection(QDateTimeEdit::YearSection);
QCOMPARE(QDateTimeEdit::YearSection, obj1.currentSection());
+
+ QDateEdit dateEdit;
+ QCOMPARE(dateEdit.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
+ QTimeEdit timeEdit;
+ QCOMPARE(timeEdit.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
}
tst_QDateTimeEdit::tst_QDateTimeEdit()
@@ -2416,7 +2422,7 @@ void tst_QDateTimeEdit::displayedSections()
QFETCH(uint, section);
testWidget->setDisplayFormat(format);
- QVERIFY((QDateTimeEdit::Section)section == testWidget->displayedSections());
+ QCOMPARE(QDateTimeEdit::Sections(section), testWidget->displayedSections());
}
void tst_QDateTimeEdit::currentSection_data()
@@ -2460,7 +2466,7 @@ void tst_QDateTimeEdit::currentSection()
if ((QDateTimeEdit::Section)section == QDateTimeEdit::NoSection)
testWidget->setCurrentSection(QDateTimeEdit::YearSection); // Ensure it's not reset (see above)
testWidget->setCurrentSection((QDateTimeEdit::Section)section);
- QVERIFY((QDateTimeEdit::Section)currentSection == testWidget->currentSection());
+ QCOMPARE((QDateTimeEdit::Section)currentSection, testWidget->currentSection());
}
void tst_QDateTimeEdit::readOnly()
@@ -2825,7 +2831,7 @@ void tst_QDateTimeEdit::calendarPopup()
rect = style->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxArrow, &timeEdit);
QTest::mouseClick(&timeEdit, Qt::LeftButton, 0, QPoint(rect.left()+rect.width()/2, rect.top()+rect.height()/2));
QWidget *wid2 = timeEdit.findChild<QWidget *>("qt_datetimedit_calendar");
- QVERIFY(wid2 == 0);
+ QVERIFY(!wid2);
timeEdit.hide();
@@ -2839,7 +2845,7 @@ void tst_QDateTimeEdit::calendarPopup()
rect = style->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxArrow, &dateEdit);
QTest::mouseClick(&dateEdit, Qt::LeftButton, 0, QPoint(rect.left()+rect.width()/2, rect.top()+rect.height()/2));
QWidget *wid3 = dateEdit.findChild<QWidget *>("qt_datetimedit_calendar");
- QVERIFY(wid3 == 0);
+ QVERIFY(!wid3);
dateEdit.hide();
}
diff --git a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
index 38b473e5ae..32412afcd5 100644
--- a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
+++ b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
@@ -132,12 +132,12 @@ void tst_QDialogButtonBox::layoutReuse()
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok);
QPointer<QLayout> layout = box->layout();
box->setCenterButtons(!box->centerButtons());
- QVERIFY(layout == box->layout());
+ QCOMPARE(layout.data(), box->layout());
QEvent event(QEvent::StyleChange);
QApplication::sendEvent(box, &event);
- QVERIFY(layout == box->layout());
+ QCOMPARE(layout.data(), box->layout());
box->setOrientation(box->orientation() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal);
- QVERIFY(layout == 0);
+ QVERIFY(layout.isNull());
QVERIFY(layout != box->layout());
delete box;
}
diff --git a/tests/auto/widgets/widgets/qdockwidget/BLACKLIST b/tests/auto/widgets/widgets/qdockwidget/BLACKLIST
new file mode 100644
index 0000000000..60adfb9f4b
--- /dev/null
+++ b/tests/auto/widgets/widgets/qdockwidget/BLACKLIST
@@ -0,0 +1,2 @@
+[restoreDockWidget]
+ubuntu-14.04
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index 2bbc2e05b7..713dc6b9b8 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -40,6 +40,7 @@
#include <qdockwidget.h>
#include <qmainwindow.h>
#include <qlineedit.h>
+#include <qtabbar.h>
#include <QDesktopWidget>
#include <QtGui/QPainter>
#include "private/qdockwidget_p.h"
@@ -68,6 +69,7 @@ private slots:
void allowedAreas();
void toggleViewAction();
void visibilityChanged();
+ void updateTabBarOnVisibilityChanged();
void dockLocationChanged();
void setTitleBarWidget();
void titleBarDoubleClick();
@@ -120,7 +122,7 @@ void tst_QDockWidget::widget()
{
{
QDockWidget dw;
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
}
{
@@ -130,32 +132,32 @@ void tst_QDockWidget::widget()
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
dw.setWidget(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
dw.setWidget(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
dw.setWidget(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
}
{
@@ -165,37 +167,37 @@ void tst_QDockWidget::widget()
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
w1->setParent(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
w2->setParent(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
w1->setParent(0);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
w2->setParent(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
delete w1;
delete w2;
}
@@ -586,6 +588,44 @@ void tst_QDockWidget::visibilityChanged()
QCOMPARE(spy.at(0).at(0).toBool(), true);
}
+void tst_QDockWidget::updateTabBarOnVisibilityChanged()
+{
+ // QTBUG49045: Populate tabified dock area with 4 widgets, set the tab
+ // index to 2 (dw2), hide dw0, dw1 and check that the tab index is 0 (dw3).
+ QMainWindow mw;
+ mw.setMinimumSize(400, 400);
+ mw.setWindowTitle(QTest::currentTestFunction());
+ QDockWidget *dw0 = new QDockWidget("d1", &mw);
+ dw0->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw0);
+ QDockWidget *dw1 = new QDockWidget("d2", &mw);
+ dw1->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw1);
+ QDockWidget *dw2 = new QDockWidget("d3", &mw);
+ dw2->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw2);
+ QDockWidget *dw3 = new QDockWidget("d4", &mw);
+ dw3->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw3);
+ mw.tabifyDockWidget(dw0, dw1);
+ mw.tabifyDockWidget(dw1, dw2);
+ mw.tabifyDockWidget(dw2, dw3);
+
+ QTabBar *tabBar = mw.findChild<QTabBar *>();
+ QVERIFY(tabBar);
+ tabBar->setCurrentIndex(2);
+
+ mw.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&mw));
+
+ QCOMPARE(tabBar->currentIndex(), 2);
+
+ dw0->hide();
+ dw1->hide();
+ QTRY_COMPARE(tabBar->count(), 2);
+ QCOMPARE(tabBar->currentIndex(), 0);
+}
+
Q_DECLARE_METATYPE(Qt::DockWidgetArea)
void tst_QDockWidget::dockLocationChanged()
@@ -721,6 +761,9 @@ void tst_QDockWidget::restoreDockWidget()
{
QByteArray geometry;
QByteArray state;
+
+ const bool isXcb = !QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive);
+
const QString name = QStringLiteral("main");
const QRect availableGeometry = QApplication::desktop()->availableGeometry();
const QSize size = availableGeometry.size() / 5;
@@ -745,11 +788,22 @@ void tst_QDockWidget::restoreDockWidget()
QVERIFY(dock->isFloating());
state = saveWindow.saveState();
geometry = saveWindow.saveGeometry();
+
+ // QTBUG-49832: Delete and recreate the dock; it should be restored to the same position.
+ delete dock;
+ dock = createTestDock(saveWindow);
+ QVERIFY(saveWindow.restoreDockWidget(dock));
+ dock->show();
+ QVERIFY(QTest::qWaitForWindowExposed(dock));
+ QTRY_VERIFY(dock->isFloating());
+ if (!isXcb) // Avoid Window manager positioning issues
+ QTRY_COMPARE(dock->pos(), dockPos);
}
QVERIFY(!geometry.isEmpty());
QVERIFY(!state.isEmpty());
+ // QTBUG-45780: Completely recreate the dock widget from the saved state.
{
QMainWindow restoreWindow;
restoreWindow.setObjectName(name);
@@ -764,7 +818,7 @@ void tst_QDockWidget::restoreDockWidget()
restoreWindow.show();
QVERIFY(QTest::qWaitForWindowExposed(&restoreWindow));
QTRY_VERIFY(dock->isFloating());
- if (!QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive))
+ if (isXcb)
QSKIP("Skip due to Window manager positioning issues", Abort);
QTRY_COMPARE(dock->pos(), dockPos);
}
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
index 1d995b5eea..d76dbf6b46 100644
--- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
+++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
@@ -47,13 +47,12 @@
class Widget : public QWidget
{
+ Q_OBJECT
public:
- Widget() { }
-
QList<QEvent::Type> events;
protected:
- bool event(QEvent *ev) {
+ bool event(QEvent *ev) Q_DECL_OVERRIDE {
events.append(ev->type());
return QWidget::event(ev);
}
@@ -62,19 +61,14 @@ protected:
class tst_QLabel : public QObject
{
-Q_OBJECT
-
-public:
- tst_QLabel();
- virtual ~tst_QLabel();
-
+ Q_OBJECT
-public slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
void cleanup();
-private slots:
+
void getSetCheck();
void setText_data();
void setText();
@@ -111,7 +105,6 @@ private:
QLabel *testWidget;
QPointer<Widget> test_box;
QPointer<QLabel> test_label;
- QLineEdit *test_edit;
};
// Testing get/set functions
@@ -144,15 +137,6 @@ void tst_QLabel::getSetCheck()
delete var3;
}
-
-tst_QLabel::tst_QLabel(): test_box(0)
-{
-}
-
-tst_QLabel::~tst_QLabel()
-{
-}
-
void tst_QLabel::initTestCase()
{
// Create the test class
@@ -165,8 +149,7 @@ void tst_QLabel::cleanupTestCase()
{
delete testWidget;
testWidget = 0;
- if (test_box)
- delete test_box;
+ delete test_box;
}
void tst_QLabel::init()
@@ -196,7 +179,7 @@ void tst_QLabel::setBuddy()
test_box = new Widget;
test_label= new QLabel( test_box );
test_label->setText( "&Test with a buddy" );
- test_edit = new QLineEdit( test_box );
+ QWidget *test_edit = new QLineEdit( test_box );
QVBoxLayout *layout = new QVBoxLayout(test_box);
layout->addWidget(test_label);
layout->addWidget(test_edit);
@@ -322,7 +305,7 @@ void tst_QLabel::eventPropagation()
test_label->setText(text);
test_box->events.clear();
test_label->setTextInteractionFlags(Qt::TextInteractionFlags(textInteractionFlags));
- QVERIFY(int(test_label->focusPolicy()) == focusPolicy);
+ QCOMPARE(int(test_label->focusPolicy()), focusPolicy);
QTest::mousePress(test_label, Qt::LeftButton);
QVERIFY(test_box->events.contains(QEvent::MouseButtonPress) == propagation); // should have propagated!
}
diff --git a/tests/auto/widgets/widgets/qlineedit/qlineedit.pro b/tests/auto/widgets/widgets/qlineedit/qlineedit.pro
index 715dcb9550..636208d67a 100644
--- a/tests/auto/widgets/widgets/qlineedit/qlineedit.pro
+++ b/tests/auto/widgets/widgets/qlineedit/qlineedit.pro
@@ -3,3 +3,4 @@ TARGET = tst_qlineedit
QT += gui-private core-private widgets widgets-private testlib
SOURCES += tst_qlineedit.cpp
+osx: LIBS += -framework AppKit
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 1d70e8a8ab..b46609c371 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -229,6 +229,7 @@ private slots:
void isModified();
void edited();
+ void fixupDoesNotModify_QTBUG_49295();
void insert();
void setSelection_data();
@@ -1669,7 +1670,7 @@ void tst_QLineEdit::displayText()
testWidget->setEchoMode(mode);
testWidget->setText(insertString);
QCOMPARE(testWidget->displayText(), expectedString);
- QVERIFY(testWidget->echoMode() == mode);
+ QCOMPARE(testWidget->echoMode(), mode);
}
void tst_QLineEdit::passwordEchoOnEdit()
@@ -1839,9 +1840,9 @@ void tst_QLineEdit::maxLength()
// Make sure that the textChanged is not emitted unless the text is actually changed
if (insertString == expectedString) {
- QVERIFY(changed_count == 0);
+ QCOMPARE(changed_count, 0);
} else {
- QVERIFY(changed_count == 1);
+ QCOMPARE(changed_count, 1);
}
}
@@ -1962,7 +1963,7 @@ void tst_QLineEdit::psKeyClick(QTestEventList &keys, Qt::Key key, Qt::KeyboardMo
void tst_QLineEdit::cursorPosition()
{
QLineEdit *testWidget = ensureTestWidget();
- QVERIFY(testWidget->cursorPosition() == 0);
+ QCOMPARE(testWidget->cursorPosition(), 0);
// start with a basic text
QTest::keyClicks(testWidget, "The");
@@ -2208,7 +2209,7 @@ void tst_QLineEdit::selectedText()
testWidget->cursorForward(true, 9);
QVERIFY(testWidget->hasSelectedText());
QCOMPARE(testWidget->selectedText(), QString("Abc defg "));
- QVERIFY(selection_count == 1);
+ QCOMPARE(selection_count, 1);
// reset selection
testWidget->home(false);
@@ -2264,19 +2265,19 @@ void tst_QLineEdit::textChangedAndTextEdited()
QLineEdit *testWidget = ensureTestWidget();
QTest::keyClick(testWidget, Qt::Key_A);
QCOMPARE(changed_count, 1);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, 'b');
QCOMPARE(changed_count, 2);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, 'c');
QCOMPARE(changed_count, 3);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, ' ');
QCOMPARE(changed_count, 4);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, 'd');
QCOMPARE(changed_count, 5);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
changed_count = 0;
edited_count = 0;
@@ -2322,27 +2323,27 @@ void tst_QLineEdit::returnPressed()
QLineEdit *testWidget = ensureTestWidget();
QTest::keyClick(testWidget, Qt::Key_Return);
- QVERIFY(return_count == 1);
+ QCOMPARE(return_count, 1);
return_count = 0;
QTest::keyClick(testWidget, 'A');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, 'b');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, 'c');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, ' ');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, 'd');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
psKeyClick(testWidget, Qt::Key_Home);
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
psKeyClick(testWidget, Qt::Key_End);
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, Qt::Key_Escape);
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, Qt::Key_Return);
- QVERIFY(return_count == 1);
+ QCOMPARE(return_count, 1);
}
// int validator that fixes all !isNumber to '0'
@@ -2498,14 +2499,14 @@ void tst_QLineEdit::setValidator()
QCOMPARE(testWidget->validator(), static_cast<const QValidator*>(&iv1));
testWidget->setValidator(0);
- QVERIFY(testWidget->validator() == 0);
+ QVERIFY(!testWidget->validator());
QIntValidator iv2(0, 99, 0);
testWidget->setValidator(&iv2);
QCOMPARE(testWidget->validator(), static_cast<const QValidator *>(&iv2));
testWidget->setValidator(0);
- QVERIFY(testWidget->validator() == 0);
+ QVERIFY(!testWidget->validator());
}
void tst_QLineEdit::setValidator_QIntValidator_data()
@@ -2747,7 +2748,7 @@ void tst_QLineEdit::setAlignment()
QTEST(testWidget, "left");
#endif
#endif
- QVERIFY(testWidget->alignment() == Qt::AlignLeft);
+ QCOMPARE(testWidget->alignment(), Qt::AlignLeft);
testWidget->setText("hcenter");
testWidget->setAlignment(Qt::AlignHCenter);
@@ -2756,7 +2757,7 @@ void tst_QLineEdit::setAlignment()
QTEST(testWidget, "hcenter");
#endif
#endif
- QVERIFY(testWidget->alignment() == Qt::AlignHCenter);
+ QCOMPARE(testWidget->alignment(), Qt::AlignHCenter);
testWidget->setText("right");
testWidget->setAlignment(Qt::AlignRight);
@@ -2765,16 +2766,16 @@ void tst_QLineEdit::setAlignment()
QTEST(testWidget, "right");
#endif
#endif
- QVERIFY(testWidget->alignment() == Qt::AlignRight);
+ QCOMPARE(testWidget->alignment(), Qt::AlignRight);
testWidget->setAlignment(Qt::AlignTop);
- QVERIFY(testWidget->alignment() == Qt::AlignTop);
+ QCOMPARE(testWidget->alignment(), Qt::AlignTop);
testWidget->setAlignment(Qt::AlignBottom);
- QVERIFY(testWidget->alignment() == Qt::AlignBottom);
+ QCOMPARE(testWidget->alignment(), Qt::AlignBottom);
testWidget->setAlignment(Qt::AlignCenter);
- QVERIFY(testWidget->alignment() == Qt::AlignCenter);
+ QCOMPARE(testWidget->alignment(), Qt::AlignCenter);
}
void tst_QLineEdit::isModified()
@@ -2844,6 +2845,29 @@ void tst_QLineEdit::edited()
QVERIFY(testWidget->isModified());
}
+void tst_QLineEdit::fixupDoesNotModify_QTBUG_49295()
+{
+ QLineEdit *testWidget = ensureTestWidget();
+
+ ValidatorWithFixup val;
+ testWidget->setValidator(&val);
+ testWidget->setText("foo");
+ QVERIFY(!testWidget->isModified());
+ QVERIFY(!testWidget->hasAcceptableInput());
+
+ QTest::keyClicks(testWidget, QStringLiteral("bar"));
+ QVERIFY(testWidget->isModified());
+ QVERIFY(!testWidget->hasAcceptableInput());
+
+ // trigger a fixup, which should not reset the modified flag
+ QFocusEvent lostFocus(QEvent::FocusOut);
+ qApp->sendEvent(testWidget, &lostFocus);
+
+ QVERIFY(testWidget->hasAcceptableInput());
+ QEXPECT_FAIL("", "QTBUG-49295: a fixup of a line edit should keep it modified", Continue);
+ QVERIFY(testWidget->isModified());
+}
+
void tst_QLineEdit::insert()
{
QLineEdit *testWidget = ensureTestWidget();
@@ -3082,10 +3106,10 @@ void tst_QLineEdit::maxLengthAndInputMask()
QLineEdit *testWidget = ensureTestWidget();
QVERIFY(testWidget->inputMask().isNull());
testWidget->setMaxLength(10);
- QVERIFY(testWidget->maxLength() == 10);
+ QCOMPARE(testWidget->maxLength(), 10);
testWidget->setInputMask(QString::null);
QVERIFY(testWidget->inputMask().isNull());
- QVERIFY(testWidget->maxLength() == 10);
+ QCOMPARE(testWidget->maxLength(), 10);
}
@@ -4477,7 +4501,7 @@ void tst_QLineEdit::QTBUG1266_setInputMaskEmittingTextEdited()
QSignalSpy spy(&lineEdit, SIGNAL(textEdited(QString)));
lineEdit.setInputMask("AAAA");
lineEdit.setInputMask(QString());
- QVERIFY(spy.count() == 0);
+ QCOMPARE(spy.count(), 0);
}
QTEST_MAIN(tst_QLineEdit)
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 270e5168f7..6282028746 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -149,6 +149,8 @@ private slots:
void toggleUnifiedTitleAndToolBarOnMac();
#endif
void QTBUG21378_animationFinished();
+ void resizeDocks();
+ void resizeDocks_data();
};
@@ -211,15 +213,15 @@ tst_QMainWindow::tst_QMainWindow()
void tst_QMainWindow::constructor()
{
QMainWindow mw;
- QVERIFY(mw.parentWidget() == 0);
+ QVERIFY(!mw.parentWidget());
QVERIFY(mw.isWindow());
QMainWindow mw2(&mw);
- QVERIFY(mw2.parentWidget() == &mw);
+ QCOMPARE(mw2.parentWidget(), &mw);
QVERIFY(mw2.isWindow());
QMainWindow mw3(&mw, Qt::FramelessWindowHint);
- QVERIFY(mw3.parentWidget() == &mw);
+ QCOMPARE(mw3.parentWidget(), &mw);
QVERIFY(mw3.isWindow());
}
@@ -607,7 +609,7 @@ void tst_QMainWindow::menuBar()
QVERIFY(mw.menuBar() != 0);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb1 == 0);
+ QVERIFY(mb1.isNull());
mw.setMenuBar(mb2);
QVERIFY(mw.menuBar() != 0);
@@ -618,7 +620,7 @@ void tst_QMainWindow::menuBar()
QVERIFY(mw.menuBar() != 0);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb2 == 0);
+ QVERIFY(mb2.isNull());
mb1 = new QMenuBar;
mw.setMenuBar(mb1);
@@ -631,7 +633,7 @@ void tst_QMainWindow::menuBar()
QCOMPARE(mw.menuBar(), (QMenuBar *)mb2);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb1 == 0);
+ QVERIFY(mb1.isNull());
mb1 = new QMenuBar;
mw.setMenuBar(mb1);
@@ -639,7 +641,7 @@ void tst_QMainWindow::menuBar()
QCOMPARE(mw.menuBar(), (QMenuBar *)mb1);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb2 == 0);
+ QVERIFY(mb2.isNull());
QPointer<QWidget> topLeftCornerWidget = new QWidget;
mb1->setCornerWidget(topLeftCornerWidget, Qt::TopLeftCorner);
@@ -652,7 +654,7 @@ void tst_QMainWindow::menuBar()
QCOMPARE(mw.menuBar(), (QMenuBar *)mb2);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb1 == 0);
+ QVERIFY(mb1.isNull());
QVERIFY(topLeftCornerWidget);
QCOMPARE(mb2->cornerWidget(Qt::TopLeftCorner), static_cast<QWidget *>(topLeftCornerWidget));
@@ -663,8 +665,8 @@ void tst_QMainWindow::menuBar()
QVERIFY(mw.menuBar() != 0);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb2 == 0);
+ QVERIFY(mb2.isNull());
QVERIFY(!topLeftCornerWidget);
QVERIFY(!topRightCornerWidget);
}
@@ -692,7 +694,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(mw.statusBar() != 0);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb1 == 0);
+ QVERIFY(sb1.isNull());
mw.setStatusBar(sb2);
QVERIFY(mw.statusBar() != 0);
@@ -703,7 +705,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(mw.statusBar() != 0);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb2 == 0);
+ QVERIFY(sb2.isNull());
sb1 = new QStatusBar;
mw.setStatusBar(sb1);
@@ -718,7 +720,7 @@ void tst_QMainWindow::statusBar()
QCOMPARE(sb2->parentWidget(), (QWidget *)&mw);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb1 == 0);
+ QVERIFY(sb1.isNull());
sb1 = new QStatusBar;
mw.setStatusBar(sb1);
@@ -727,7 +729,7 @@ void tst_QMainWindow::statusBar()
QCOMPARE(sb1->parentWidget(), (QWidget *)&mw);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb2 == 0);
+ QVERIFY(sb2.isNull());
sb2 = new QStatusBar;
mw.setStatusBar(sb2);
@@ -736,7 +738,7 @@ void tst_QMainWindow::statusBar()
QCOMPARE(sb2->parentWidget(), (QWidget *)&mw);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb1 == 0);
+ QVERIFY(sb1.isNull());
}
{
@@ -749,7 +751,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(indexOfSb != -1);
delete sb;
indexOfSb = l->indexOf(sb);
- QVERIFY(indexOfSb == -1);
+ QCOMPARE(indexOfSb, -1);
}
}
@@ -791,7 +793,7 @@ void tst_QMainWindow::centralWidget()
{
{
QMainWindow mw;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
}
{
@@ -799,7 +801,7 @@ void tst_QMainWindow::centralWidget()
QPointer<QWidget> w1 = new QWidget;
QPointer<QWidget> w2 = new QWidget;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
mw.setCentralWidget(w1);
QVERIFY(mw.centralWidget() != 0);
@@ -812,12 +814,12 @@ void tst_QMainWindow::centralWidget()
QCOMPARE(w2->parentWidget(), (QWidget *)&mw);
mw.setCentralWidget(0);
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
//we now call deleteLater on the previous central widgets
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(w1 == 0);
- QVERIFY(w2 == 0);
+ QVERIFY(w1.isNull());
+ QVERIFY(w2.isNull());
}
{
@@ -831,7 +833,7 @@ void tst_QMainWindow::centralWidget()
QPointer<QWidget> w1 = new QWidget;
QPointer<QWidget> w2 = new QWidget;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
mw.setCentralWidget(w1);
QVERIFY(mw.centralWidget() != 0);
@@ -844,12 +846,12 @@ void tst_QMainWindow::centralWidget()
QCOMPARE(w2->parentWidget(), (QWidget *)&mw);
mw.setCentralWidget(0);
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
//we now call deleteLater on the previous central widgets
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(w1 == 0);
- QVERIFY(w2 == 0);
+ QVERIFY(w1.isNull());
+ QVERIFY(w2.isNull());
}
}
@@ -860,25 +862,25 @@ void tst_QMainWindow::takeCentralWidget() {
QPointer<QWidget> w1 = new QWidget;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
mw.setCentralWidget(w1);
QWidget *oldCentralWidget = mw.takeCentralWidget();
- QVERIFY(oldCentralWidget == w1.data());
+ QCOMPARE(oldCentralWidget, w1.data());
// ensure that takeCentralWidget doesn't end up calling deleteLater
// on the central widget
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
QVERIFY(!w1.isNull());
- QVERIFY(w1->parent() == 0);
+ QVERIFY(!w1->parent());
mw.setCentralWidget(w1);
// ensure that the deleteLater called by setCentralWidget
// gets executed
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mw.centralWidget() == w1.data());
+ QCOMPARE(mw.centralWidget(), w1.data());
QPointer<QWidget> w2 = new QWidget;
@@ -887,10 +889,10 @@ void tst_QMainWindow::takeCentralWidget() {
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QVERIFY(w1.isNull());
- QVERIFY(mw.centralWidget() == w2.data());
+ QCOMPARE(mw.centralWidget(), w2.data());
QWidget *hopefullyW2 = mw.takeCentralWidget();
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
// ensure that takeCentralWidget doesn't end up calling deleteLater
// on the central widget
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
@@ -1928,9 +1930,9 @@ void tst_QMainWindow::toggleUnifiedTitleAndToolBarOnMac()
mw.show();
QRect frameGeometry = mw.frameGeometry();
mw.setUnifiedTitleAndToolBarOnMac(false);
- QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
+ QCOMPARE(frameGeometry.topLeft(), mw.frameGeometry().topLeft());
mw.setUnifiedTitleAndToolBarOnMac(true);
- QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
+ QCOMPARE(frameGeometry.topLeft(), mw.frameGeometry().topLeft());
}
#endif
@@ -1950,5 +1952,96 @@ void tst_QMainWindow::QTBUG21378_animationFinished()
delete mwClickTimer;
QVERIFY(true);
}
+
+Q_DECLARE_METATYPE(Qt::Orientation)
+
+void tst_QMainWindow::resizeDocks_data()
+{
+ QTest::addColumn<Qt::Orientation>("orientation");
+ QTest::addColumn<QStringList>("docks");
+ QTest::addColumn<QList<int> >("sizes");
+
+ QTest::newRow("1") << Qt::Horizontal
+ << (QStringList() << "blue" << "orange" << "green" << "gray")
+ << (QList<int>() << 190 << 190 << 320 << 160);
+
+ QTest::newRow("2") << Qt::Vertical
+ << (QStringList() << "yellow" << "orange")
+ << (QList<int>() << 147 << 133 );
+
+
+ QTest::newRow("3") << Qt::Horizontal
+ << (QStringList() << "blue" << "yellow")
+ << (QList<int>() << 190 << 600);
+}
+
+void tst_QMainWindow::resizeDocks()
+{
+ AddList addList;
+ addList
+ << AddDockWidget("blue", Qt::LeftDockWidgetArea)
+ << AddDockWidget("red", Qt::TopDockWidgetArea)
+ << AddDockWidget("pink", "red")
+ << AddDockWidget("yellow", Qt::RightDockWidgetArea)
+ << AddDockWidget("orange", Qt::RightDockWidgetArea)
+ << AddDockWidget("green", "orange", Qt::Horizontal)
+ << AddDockWidget("gray", "orange", Qt::Horizontal);
+ /*
+ +--------------------------------+
+ | red/pink |
+ +------+-+-----------------------+
+ | | | yellow |
+ | blue + +--------+------+-------+
+ | | | orange | gray | green |
+ +------+-+--------+------+-------+
+
+ */
+
+ QMainWindow mw(0, Qt::BypassWindowManagerHint);
+ mw.setDockNestingEnabled(true);
+ mw.resize(1800, 600);
+
+ foreach (const AddDockWidget &i, addList)
+ i.apply(&mw);
+
+ foreach (QDockWidget *dw, mw.findChildren<QDockWidget *>())
+ dw->setStyleSheet( "* { background-color: " + dw->objectName() +" }");
+
+ mw.setCentralWidget(new QTextEdit);
+
+ mw.show();
+ QTest::qWaitForWindowExposed(&mw);
+
+ QFETCH(Qt::Orientation, orientation);
+ QFETCH(QStringList, docks);
+ QFETCH(QList<int>, sizes);
+
+ QList<QDockWidget *> list;
+ foreach (const QString &name, docks) {
+ QDockWidget *d = mw.findChild<QDockWidget *>(name);
+ QVERIFY(d);
+ list << d;
+ }
+
+ mw.resizeDocks(list, sizes, orientation);
+
+ qApp->processEvents();
+
+ int totalFromList = 0;
+ int actualTotal = 0;
+ for (int i = 0; i < docks.count(); ++i) {
+ totalFromList += sizes[i];
+ QSize s = list[i]->size();
+ actualTotal += (orientation == Qt::Horizontal) ? s.width() : s.height();
+// qDebug() << list[i] << list[i]->size() << sizes[i];
+ }
+
+ for (int i = 0; i < docks.count(); ++i) {
+ QSize s = list[i]->size();
+ int value = (orientation == Qt::Horizontal) ? s.width() : s.height();
+ QCOMPARE(value, qRound(sizes[i]*actualTotal/double(totalFromList)));
+ }
+}
+
QTEST_MAIN(tst_QMainWindow)
#include "tst_qmainwindow.moc"
diff --git a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
index b8640e9ac3..63da2e3ae3 100644
--- a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
@@ -1,2 +1,5 @@
[updateScrollBars]
osx
+[tileSubWindows]
+osx
+xcb
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index 53defce423..e23634c515 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -377,13 +377,13 @@ void tst_QMdiArea::subWindowActivated()
while (workspace->activeSubWindow() ) {
workspace->activeSubWindow()->close();
qApp->processEvents();
- QVERIFY(activeWindow == workspace->activeSubWindow());
+ QCOMPARE(activeWindow, workspace->activeSubWindow());
QCOMPARE(spy.count(), 1);
spy.clear();
}
- QVERIFY(activeWindow == 0);
- QVERIFY(workspace->activeSubWindow() == 0);
+ QVERIFY(!activeWindow);
+ QVERIFY(!workspace->activeSubWindow());
QCOMPARE(workspace->subWindowList().count(), 0);
{
@@ -432,13 +432,13 @@ void tst_QMdiArea::subWindowActivated()
QCOMPARE(spy.count(), 1);
spy.clear();
QVERIFY( activeWindow == window );
- QVERIFY(workspace->activeSubWindow() == window);
+ QCOMPARE(workspace->activeSubWindow(), window);
window->close();
qApp->processEvents();
QCOMPARE(spy.count(), 1);
spy.clear();
- QVERIFY(workspace->activeSubWindow() == 0);
- QVERIFY( activeWindow == 0 );
+ QVERIFY(!workspace->activeSubWindow());
+ QVERIFY(!activeWindow);
}
}
@@ -518,7 +518,7 @@ void tst_QMdiArea::subWindowActivated2()
#ifdef Q_OS_MAC
QSKIP("QTBUG-25298: This test is unstable on Mac.");
#endif
- if (qApp->platformName().toLower() == QStringLiteral("xcb"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
QSKIP("QTBUG-25298: Unstable on some X11 window managers");
QTRY_COMPARE(spy.count(), 1);
QVERIFY(!mdiArea.activeSubWindow());
@@ -564,8 +564,8 @@ void tst_QMdiArea::subWindowActivatedWithMinimize()
window1->close();
qApp->processEvents();
- QVERIFY(workspace->activeSubWindow() == 0);
- QVERIFY( activeWindow == 0 );
+ QVERIFY(!workspace->activeSubWindow());
+ QVERIFY(!activeWindow);
QVERIFY( workspace->subWindowList().count() == 0 );
}
@@ -1104,7 +1104,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QVERIFY(window);
qApp->processEvents();
QCOMPARE(workspace.subWindowList().count(), 1);
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
QCOMPARE(window->size(), workspace.viewport()->size());
}
@@ -1115,7 +1115,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QVERIFY(window);
qApp->processEvents();
QCOMPARE(workspace.subWindowList().count(), 2);
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
QCOMPARE(window->size(), window->minimumSize());
}
@@ -1127,7 +1127,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QVERIFY(window);
qApp->processEvents();
QCOMPARE(workspace.subWindowList().count(), 3);
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
QCOMPARE(window->size(), QSize(1500, 1500));
}
@@ -1142,7 +1142,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QMdiSubWindow *window = new QMdiSubWindow;
workspace.addSubWindow(window);
qApp->processEvents();
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
window->setWidget(new QWidget);
QCOMPARE(workspace.subWindowList().count(), 4);
QTest::ignoreMessage(QtWarningMsg, "QMdiArea::addSubWindow: window is already added");
@@ -1206,7 +1206,7 @@ void tst_QMdiArea::addAndRemoveWindowsWithReparenting()
{
QMdiArea workspace;
QMdiSubWindow window(&workspace);
- QVERIFY(window.windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window.windowFlags(), DefaultWindowFlags);
// 0 because the window list contains widgets and not actual
// windows. Silly, but that's the behavior.
@@ -1219,7 +1219,7 @@ void tst_QMdiArea::addAndRemoveWindowsWithReparenting()
QCOMPARE(workspace.subWindowList().count(), 0);
window.setParent(&workspace);
QCOMPARE(workspace.subWindowList().count(), 1);
- QVERIFY(window.windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window.windowFlags(), DefaultWindowFlags);
QTest::ignoreMessage(QtWarningMsg, "QMdiArea::addSubWindow: window is already added");
workspace.addSubWindow(&window);
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index a6caa3d020..db252347ac 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -191,6 +191,7 @@ private slots:
void fixedMinMaxSize();
#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
void replaceMenuBarWhileMaximized();
+ void closeOnDoubleClick_data();
void closeOnDoubleClick();
#endif
void setFont();
@@ -1793,9 +1794,23 @@ void tst_QMdiSubWindow::replaceMenuBarWhileMaximized()
QVERIFY(!subWindow->maximizedSystemMenuIconWidget());
}
+void tst_QMdiSubWindow::closeOnDoubleClick_data()
+{
+ QTest::addColumn<int>("actionIndex");
+ QTest::addColumn<bool>("expectClosed");
+
+ QTest::newRow("close") << 1 << true;
+ QTest::newRow("disabled-restore-action") << 0 << false; // QTBUG-48493
+}
+
void tst_QMdiSubWindow::closeOnDoubleClick()
{
+ QFETCH(int, actionIndex);
+ QFETCH(bool, expectClosed);
+
QMdiArea mdiArea;
+ mdiArea.setWindowTitle(QLatin1String(QTest::currentTestFunction())
+ + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
QPointer<QMdiSubWindow> subWindow = mdiArea.addSubWindow(new QWidget);
mdiArea.show();
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
@@ -1807,12 +1822,13 @@ void tst_QMdiSubWindow::closeOnDoubleClick()
QVERIFY(systemMenu);
QVERIFY(systemMenu->isVisible());
- sendMouseDoubleClick(systemMenu, QPoint(10, 10));
+ const QRect actionGeometry = systemMenu->actionGeometry(systemMenu->actions().at(actionIndex));
+ sendMouseDoubleClick(systemMenu, actionGeometry.center());
if (qApp->activePopupWidget() == static_cast<QWidget *>(systemMenu))
systemMenu->hide();
qApp->processEvents();
- QVERIFY(!subWindow || !subWindow->isVisible());
QVERIFY(!systemMenu || !systemMenu->isVisible());
+ QCOMPARE(subWindow.isNull() || !subWindow->isVisible(), expectClosed);
}
#endif
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 46d3177a56..b3f9c54f24 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -78,6 +78,7 @@ public slots:
private slots:
void getSetCheck();
void addActionsAndClear();
+ void addActionsConnect();
void keyboardNavigation_data();
void keyboardNavigation();
@@ -93,6 +94,7 @@ private slots:
void task208001_stylesheet();
void activeSubMenuPosition();
+ void activeSubMenuPositionExec();
void task242454_sizeHint();
void task176201_clear();
void task250673_activeMultiColumnSubMenuPosition();
@@ -264,6 +266,34 @@ void tst_QMenu::addActionsAndClear()
QCOMPARE(menus[0]->actions().count(), 0);
}
+static void testFunction() { }
+
+void tst_QMenu::addActionsConnect()
+{
+ QMenu menu;
+ const QString text = QLatin1String("bla");
+ const QIcon icon;
+ menu.addAction(text, &menu, SLOT(deleteLater()));
+ menu.addAction(text, &menu, &QMenu::deleteLater);
+ menu.addAction(text, testFunction);
+ menu.addAction(text, &menu, testFunction);
+ menu.addAction(icon, text, &menu, SLOT(deleteLater()));
+ menu.addAction(icon, text, &menu, &QMenu::deleteLater);
+ menu.addAction(icon, text, testFunction);
+ menu.addAction(icon, text, &menu, testFunction);
+#ifndef QT_NO_SHORTCUT
+ const QKeySequence keySequence(Qt::CTRL + Qt::Key_C);
+ menu.addAction(text, &menu, SLOT(deleteLater()), keySequence);
+ menu.addAction(text, &menu, &QMenu::deleteLater, keySequence);
+ menu.addAction(text, testFunction, keySequence);
+ menu.addAction(text, &menu, testFunction, keySequence);
+ menu.addAction(icon, text, &menu, SLOT(deleteLater()), keySequence);
+ menu.addAction(icon, text, &menu, &QMenu::deleteLater, keySequence);
+ menu.addAction(icon, text, testFunction, keySequence);
+ menu.addAction(icon, text, &menu, testFunction, keySequence);
+#endif // !QT_NO_SHORTCUT
+}
+
// We have a separate mouseActivation test for Windows mobile
#ifndef Q_OS_WINCE
void tst_QMenu::mouseActivation()
@@ -334,8 +364,10 @@ void tst_QMenu::keyboardNavigation_data()
QTest::newRow("data9") << Qt::Key(Qt::Key_Down) << Qt::KeyboardModifiers(Qt::NoModifier) << 3 << 0 << false << false<< true;
QTest::newRow("data10") << Qt::Key(Qt::Key_Return) << Qt::KeyboardModifiers(Qt::NoModifier) << 3 << 0 << false << true << false;
- // Test shortcuts.
- QTest::newRow("shortcut0") << Qt::Key(Qt::Key_V) << Qt::KeyboardModifiers(Qt::AltModifier) << 5 << 0 << true << true << false;
+ if (QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive)) {
+ // Test shortcuts.
+ QTest::newRow("shortcut0") << Qt::Key(Qt::Key_V) << Qt::KeyboardModifiers(Qt::AltModifier) << 5 << 0 << true << true << false;
+ }
}
void tst_QMenu::keyboardNavigation()
@@ -513,7 +545,7 @@ void tst_QMenu::onStatusTipTimer()
menu->close(); //goes out of the menu
QCOMPARE(st, QString("sub action"));
- QVERIFY(menu->isVisible() == false);
+ QVERIFY(!menu->isVisible());
m_onStatusTipTimerExecuted = true;
}
@@ -663,6 +695,61 @@ void tst_QMenu::activeSubMenuPosition()
#endif
}
+// QTBUG-49588, QTBUG-48396: activeSubMenuPositionExec() is the same as
+// activeSubMenuPosition(), but uses QMenu::exec(), which produces a different
+// sequence of events. Verify that the sub menu is positioned to the right of the
+// main menu.
+class SubMenuPositionExecMenu : public QMenu
+{
+ Q_OBJECT
+public:
+ SubMenuPositionExecMenu() : QMenu("Menu-Title"), m_timerId(-1), m_timerTick(0)
+ {
+ addAction("Item 1");
+ m_subMenu = addMenu("Submenu");
+ m_subAction = m_subMenu->addAction("Sub-Item1");
+ setActiveAction(m_subMenu->menuAction());
+ }
+
+protected:
+ void showEvent(QShowEvent *e) Q_DECL_OVERRIDE
+ {
+ QVERIFY(m_subMenu->isVisible());
+ QVERIFY2(m_subMenu->x() > x(),
+ (QByteArray::number(m_subMenu->x()) + ' ' + QByteArray::number(x())).constData());
+ m_timerId = startTimer(50);
+ QMenu::showEvent(e);
+ }
+
+ void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE
+ {
+ if (e->timerId() == m_timerId) {
+ switch (m_timerTick++) {
+ case 0:
+ m_subMenu->close();
+ break;
+ case 1:
+ close();
+ break;
+ }
+ }
+ }
+
+private:
+ int m_timerId;
+ int m_timerTick;
+ QMenu *m_subMenu;
+ QAction *m_subAction;
+};
+
+void tst_QMenu::activeSubMenuPositionExec()
+{
+#ifndef Q_OS_WINCE
+ SubMenuPositionExecMenu menu;
+ menu.exec(QGuiApplication::primaryScreen()->availableGeometry().center());
+#endif // !Q_OS_WINCE
+}
+
void tst_QMenu::task242454_sizeHint()
{
QMenu menu;
diff --git a/tests/auto/widgets/widgets/qmenubar/BLACKLIST b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
index 424ab2ceed..4f9508266c 100644
--- a/tests/auto/widgets/widgets/qmenubar/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
@@ -2,5 +2,6 @@
ubuntu-14.04
[taskQTBUG4965_escapeEaten]
ubuntu-14.04
+redhatenterpriselinuxworkstation-6.6
[task256322_highlight]
osx
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index 31e9c737e2..f787d73a02 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -117,6 +117,7 @@ private slots:
// void check_mouse2();
void check_altPress();
+ void check_altClosePress();
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
void check_shortcutPress();
void check_menuPosition();
@@ -146,7 +147,7 @@ private:
QAction* m_lastSimpleAcceleratorId;
int m_simpleActivatedCount;
- int m_complexTriggerCount['k'];
+ int m_complexTriggerCount[int('k')];
};
// Testing get/set functions
@@ -534,60 +535,60 @@ void tst_QMenuBar::check_accelKeys()
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_A, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_C, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_B, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 1);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 1);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_D, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 1);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 1);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 1);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 1);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_J, Qt::AltModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 1);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 1);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 1);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 1);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 1);
}
#endif
@@ -606,10 +607,10 @@ void tst_QMenuBar::check_cursorKeys1()
// the Popupmenu should be visible now
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
// Simulate a cursor key down click
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Down );
@@ -618,10 +619,10 @@ void tst_QMenuBar::check_cursorKeys1()
// Let's see if the correct slot is called...
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0); // this shouldn't have been called
- QCOMPARE(m_complexTriggerCount['b'], 1); // and this should have been called by a signal now
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0); // this shouldn't have been called
+ QCOMPARE(m_complexTriggerCount[int('b')], 1); // and this should have been called by a signal now
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
}
#endif
@@ -648,10 +649,10 @@ void tst_QMenuBar::check_cursorKeys2()
// Let's see if the correct slot is called...
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0); // this shouldn't have been caled
- QCOMPARE(m_complexTriggerCount['b'], 0); // and this should have been called by a signal ow
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 1);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0); // this shouldn't have been caled
+ QCOMPARE(m_complexTriggerCount[int('b')], 0); // and this should have been called by a signal ow
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 1);
}
#endif
@@ -679,10 +680,10 @@ void tst_QMenuBar::check_cursorKeys3()
// Let's see if the correct slot is called...
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0); // this shouldn't have been called
- QCOMPARE(m_complexTriggerCount['b'], 1); // and this should have been called by a signal now
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0); // this shouldn't have been called
+ QCOMPARE(m_complexTriggerCount[int('b')], 1); // and this should have been called by a signal now
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
}
#endif
@@ -715,17 +716,17 @@ void tst_QMenuBar::check_homeKey()
// and press ENTER
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Enter );
// Let's see if the correct slot is called...
-// QVERIFY2( m_complexActionTriggerCount['c'] == 1, "Popupmenu should respond to a Home key" );
- QCOMPARE(m_complexTriggerCount['c'], 1);
+// QVERIFY2( m_complexActionTriggerCount[int('c')] == 1, "Popupmenu should respond to a Home key" );
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
- QCOMPARE(m_complexTriggerCount['e'], 0);
- QCOMPARE(m_complexTriggerCount['f'], 0);
- QCOMPARE(m_complexTriggerCount['g'], 0);
- QCOMPARE(m_complexTriggerCount['h'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
+ QCOMPARE(m_complexTriggerCount[int('e')], 0);
+ QCOMPARE(m_complexTriggerCount[int('f')], 0);
+ QCOMPARE(m_complexTriggerCount[int('g')], 0);
+ QCOMPARE(m_complexTriggerCount[int('h')], 0);
}
/*!
@@ -754,17 +755,17 @@ void tst_QMenuBar::check_endKey()
// and press ENTER
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Enter );
// Let's see if the correct slot is called...
-// QVERIFY2( m_complexActionTriggerCount['h'] == 1, "Popupmenu should respond to an End key" );
- QCOMPARE(m_complexTriggerCount['h'], 1);//, "Popupmenu should respond to an End key");
+// QVERIFY2( m_complexActionTriggerCount[int('h')] == 1, "Popupmenu should respond to an End key" );
+ QCOMPARE(m_complexTriggerCount[int('h')], 1);//, "Popupmenu should respond to an End key");
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
- QCOMPARE(m_complexTriggerCount['e'], 0);
- QCOMPARE(m_complexTriggerCount['f'], 0);
- QCOMPARE(m_complexTriggerCount['g'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
+ QCOMPARE(m_complexTriggerCount[int('e')], 0);
+ QCOMPARE(m_complexTriggerCount[int('f')], 0);
+ QCOMPARE(m_complexTriggerCount[int('g')], 0);
}
/*!
@@ -808,7 +809,7 @@ void tst_QMenuBar::check_escKey()
// and press ENTER
QTest::keyClick( menu.menus.at(1), Qt::Key_Enter );
// Let's see if the correct slot is called...
- QVERIFY2( m_complexTriggerCount['c'] == 1, "Expected item 2C to be selected" );
+ QVERIFY2(m_complexTriggerCount[int('c')] == 1, "Expected item 2C to be selected");
}
#endif
@@ -978,6 +979,35 @@ void tst_QMenuBar::check_altPress()
QTRY_VERIFY( ::qobject_cast<QMenuBar *>(qApp->focusWidget()) );
}
+// QTBUG-47377: Pressing 'Alt' after opening a menu by pressing 'Alt+Accelerator'
+// should close it and QMenuBar::activeAction() should be 0.
+void tst_QMenuBar::check_altClosePress()
+{
+ const QStyle *style = QApplication::style();
+ if (!style->styleHint(QStyle::SH_MenuBar_AltKeyNavigation) ) {
+ QSKIP(("This test is not supposed to work in the " + style->objectName().toLatin1()
+ + " style. Skipping.").constData());
+ }
+
+ QMainWindow w;
+ w.setWindowTitle(QTest::currentTestFunction());
+ QMenu *menuFile = w.menuBar()->addMenu(tr("&File"));
+ menuFile->addAction("Quit");
+ QMenu *menuEdit = w.menuBar()->addMenu(tr("&Edit"));
+ menuEdit->addAction("Copy");
+
+ w.show();
+ w.move(QGuiApplication::primaryScreen()->availableGeometry().center());
+ QApplication::setActiveWindow(&w);
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+
+ QTest::keyClick(&w, Qt::Key_F, Qt::AltModifier);
+ QTRY_VERIFY(menuFile->isVisible());
+ QTest::keyClick(menuFile, Qt::Key_Alt, Qt::AltModifier);
+ QTRY_VERIFY(!menuFile->isVisible());
+ QTRY_VERIFY(!w.menuBar()->activeAction());
+}
+
// Qt/Mac,WinCE does not use the native popups/menubar
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
void tst_QMenuBar::check_shortcutPress()
diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
new file mode 100644
index 0000000000..725b8e93b4
--- /dev/null
+++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
@@ -0,0 +1,2 @@
+[clearAndGrab]
+opensuse-13.1
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index e9f9c67856..a4a0045265 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -57,6 +57,8 @@ private slots:
void asViewport();
void requestUpdate();
void fboRedirect();
+ void showHide();
+ void nativeWindow();
};
void tst_QOpenGLWidget::create()
@@ -70,7 +72,7 @@ void tst_QOpenGLWidget::create()
QVERIFY(w->isValid());
QVERIFY(w->context());
- QVERIFY(w->context()->format() == w->format());
+ QCOMPARE(w->context()->format(), w->format());
QVERIFY(w->defaultFramebufferObject() != 0);
}
@@ -81,7 +83,8 @@ public:
: QOpenGLWidget(parent),
m_initCalled(false), m_paintCalled(false), m_resizeCalled(false),
m_resizeOk(false),
- m_w(expectedWidth), m_h(expectedHeight) { }
+ m_w(expectedWidth), m_h(expectedHeight),
+ r(1.0f), g(0.0f), b(0.0f) { }
void initializeGL() Q_DECL_OVERRIDE {
m_initCalled = true;
@@ -89,13 +92,16 @@ public:
}
void paintGL() Q_DECL_OVERRIDE {
m_paintCalled = true;
- glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
+ glClearColor(r, g, b, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
}
void resizeGL(int w, int h) Q_DECL_OVERRIDE {
m_resizeCalled = true;
m_resizeOk = w == m_w && h == m_h;
}
+ void setClearColor(float r, float g, float b) {
+ this->r = r; this->g = g; this->b = b;
+ }
bool m_initCalled;
bool m_paintCalled;
@@ -103,6 +109,7 @@ public:
bool m_resizeOk;
int m_w;
int m_h;
+ float r, g, b;
};
void tst_QOpenGLWidget::clearAndGrab()
@@ -304,7 +311,7 @@ void tst_QOpenGLWidget::asViewport()
// the widget stack.
btn->update();
qApp->processEvents();
- QVERIFY(view->paintCount() == 0);
+ QCOMPARE(view->paintCount(), 0);
}
class PaintCountWidget : public QOpenGLWidget
@@ -355,6 +362,69 @@ void tst_QOpenGLWidget::fboRedirect()
QVERIFY(reportedDefaultFbo != widgetFbo);
}
+void tst_QOpenGLWidget::showHide()
+{
+ QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600));
+ w->resize(800, 600);
+ w->show();
+ QTest::qWaitForWindowExposed(w.data());
+
+ w->hide();
+
+ QImage image = w->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), w->width());
+ QCOMPARE(image.height(), w->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(255, 0, 0));
+
+ w->setClearColor(0, 0, 1);
+ w->show();
+ QTest::qWaitForWindowExposed(w.data());
+
+ image = w->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), w->width());
+ QCOMPARE(image.height(), w->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255));
+}
+
+void tst_QOpenGLWidget::nativeWindow()
+{
+ QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600));
+ w->resize(800, 600);
+ w->show();
+ w->winId();
+ QTest::qWaitForWindowExposed(w.data());
+
+ QImage image = w->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), w->width());
+ QCOMPARE(image.height(), w->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(255, 0, 0));
+ QVERIFY(w->internalWinId());
+
+ // Now as a native child.
+ QWidget nativeParent;
+ nativeParent.resize(800, 600);
+ nativeParent.setAttribute(Qt::WA_NativeWindow);
+ ClearWidget *child = new ClearWidget(0, 800, 600);
+ child->setClearColor(0, 1, 0);
+ child->setParent(&nativeParent);
+ child->resize(400, 400);
+ child->move(23, 34);
+ nativeParent.show();
+ QTest::qWaitForWindowExposed(&nativeParent);
+
+ QVERIFY(nativeParent.internalWinId());
+ QVERIFY(!child->internalWinId());
+
+ image = child->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), child->width());
+ QCOMPARE(image.height(), child->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(0, 255, 0));
+}
+
QTEST_MAIN(tst_QOpenGLWidget)
#include "tst_qopenglwidget.moc"
diff --git a/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro b/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro
index e98bae2089..be4102ec75 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro
+++ b/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro
@@ -9,3 +9,4 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qplaintextedit.cpp
+osx: LIBS += -framework AppKit
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index e7de6b0b75..2145260013 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -333,7 +333,7 @@ void tst_QPlainTextEdit::selectAllSetsNotSelection()
QSKIP("Test only relevant for systems with selection");
QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection);
- QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar"));
+ QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString("foobar"));
ed->insertPlainText("Hello World");
ed->selectAll();
@@ -905,13 +905,13 @@ void tst_QPlainTextEdit::mouseCursorShape()
{
// always show an IBeamCursor, see change 170146
QVERIFY(!ed->isReadOnly());
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setReadOnly(true);
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setPlainText("Foo");
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
}
#endif
@@ -1324,7 +1324,7 @@ void tst_QPlainTextEdit::preserveCharFormatAfterSetPlainText()
QTextBlock block = ed->document()->begin();
block = block.next();
QCOMPARE(block.text(), QString("This should still be blue"));
- QVERIFY(block.begin().fragment().charFormat().foreground().color() == QColor(Qt::blue));
+ QCOMPARE(block.begin().fragment().charFormat().foreground().color(), QColor(Qt::blue));
}
void tst_QPlainTextEdit::extraSelections()
@@ -1444,7 +1444,7 @@ void tst_QPlainTextEdit::wordWrapProperty()
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
edit.setDocument(doc);
edit.setWordWrapMode(QTextOption::NoWrap);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
{
QPlainTextEdit edit;
@@ -1452,18 +1452,18 @@ void tst_QPlainTextEdit::wordWrapProperty()
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
edit.setWordWrapMode(QTextOption::NoWrap);
edit.setDocument(doc);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
}
void tst_QPlainTextEdit::lineWrapProperty()
{
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->lineWrapMode() == QPlainTextEdit::WidgetWidth);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->lineWrapMode(), QPlainTextEdit::WidgetWidth);
ed->setLineWrapMode(QPlainTextEdit::NoWrap);
- QVERIFY(ed->lineWrapMode() == QPlainTextEdit::NoWrap);
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->document()->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(ed->lineWrapMode(), QPlainTextEdit::NoWrap);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->document()->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
void tst_QPlainTextEdit::selectionChanged()
@@ -1560,7 +1560,7 @@ void tst_QPlainTextEdit::findWithRegExp()
bool found = ed->find(rx);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
@@ -1574,7 +1574,7 @@ void tst_QPlainTextEdit::findBackwardWithRegExp()
bool found = ed->find(rx, QTextDocument::FindBackward);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit"));
}
@@ -1586,7 +1586,7 @@ void tst_QPlainTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
bool found = ed->find(rx);
- QVERIFY(found == false);
+ QVERIFY(!found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
#endif
diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
index 4a5f9d535b..5455ebb830 100644
--- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
@@ -267,7 +267,7 @@ void tst_QProgressBar::sizeHint()
//test if the sizeHint is big enough
QFontMetrics fm = bar.fontMetrics();
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
bar.initStyleOption(&opt);
QSize size = QSize(9 * 7 + fm.width(QLatin1Char('0')) * 4, fm.height() + 8);
size= bar.style()->sizeFromContents(QStyle::CT_ProgressBar, &opt, size, &bar);
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 4fd8b99acf..44a554ad82 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -227,8 +227,8 @@ void tst_QPushButton::autoRepeat()
QVERIFY( testWidget->isDown() );
QVERIFY( toggle_count == 0 );
QTest::keyRelease( testWidget, Qt::Key_Space );
- QVERIFY(press_count == release_count);
- QVERIFY(release_count == click_count);
+ QCOMPARE(press_count, release_count);
+ QCOMPARE(release_count, click_count);
QVERIFY(press_count > 1);
// #### shouldn't I check here to see if multiple signals have been fired???
diff --git a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
index 40e13c8e8d..ce6afc0a57 100644
--- a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
@@ -166,8 +166,8 @@ void tst_QScrollArea::checkHFW_Task_197736()
scrollArea.setWidgetResizable(false);
scrollArea.resize(QSize(100,100));
w->resize(QSize(200,200));
- QVERIFY(w->width() == 200);
- QVERIFY(w->height() == 200);
+ QCOMPARE(w->width(), 200);
+ QCOMPARE(w->height(), 200);
}
QTEST_MAIN(tst_QScrollArea)
diff --git a/tests/auto/widgets/widgets/qsizegrip/BLACKLIST b/tests/auto/widgets/widgets/qsizegrip/BLACKLIST
new file mode 100644
index 0000000000..2c874bcb57
--- /dev/null
+++ b/tests/auto/widgets/widgets/qsizegrip/BLACKLIST
@@ -0,0 +1,2 @@
+[hideAndShowOnWindowStateChange:Qt::Window]
+xcb
diff --git a/tests/auto/widgets/widgets/qspinbox/BLACKLIST b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
new file mode 100644
index 0000000000..5bf6c3beed
--- /dev/null
+++ b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
@@ -0,0 +1,3 @@
+[editingFinished]
+osx-10.8
+osx-10.9
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 05dd834c76..34b05c5291 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -165,6 +165,7 @@ Q_DECLARE_METATYPE(QLocale::Country)
void tst_QSpinBox::getSetCheck()
{
QSpinBox obj1;
+ QCOMPARE(obj1.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhDigitsOnly)));
// int QSpinBox::singleStep()
// void QSpinBox::setSingleStep(int)
obj1.setSingleStep(0);
@@ -202,6 +203,7 @@ void tst_QSpinBox::getSetCheck()
QCOMPARE(INT_MAX, obj1.value());
QDoubleSpinBox obj2;
+ QCOMPARE(obj2.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhFormattedNumbersOnly)));
// double QDoubleSpinBox::singleStep()
// void QDoubleSpinBox::setSingleStep(double)
obj2.setSingleStep(0.0);
diff --git a/tests/auto/widgets/widgets/qtabbar/BLACKLIST b/tests/auto/widgets/widgets/qtabbar/BLACKLIST
new file mode 100644
index 0000000000..5a3f33e3e4
--- /dev/null
+++ b/tests/auto/widgets/widgets/qtabbar/BLACKLIST
@@ -0,0 +1,3 @@
+[sizeHints]
+ubuntu-14.04
+redhatenterpriselinuxworkstation-6.6
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index fffbbc2ec7..a991f18110 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -165,7 +165,7 @@ void tst_QTabWidget::init()
tw = new QTabWidget(0);
QCOMPARE(tw->count(), 0);
QCOMPARE(tw->currentIndex(), -1);
- QVERIFY(tw->currentWidget() == NULL);
+ QVERIFY(!tw->currentWidget());
}
void tst_QTabWidget::cleanup()
@@ -208,7 +208,7 @@ void tst_QTabWidget::addRemoveTab()
QCOMPARE(tw->count(), 0);
tw->removeTab(-1);
QCOMPARE(tw->count(), 0);
- QVERIFY(tw->widget(-1) == 0);
+ QVERIFY(!tw->widget(-1));
QWidget *w = new QWidget();
int index = tw->addTab(w, LABEL);
@@ -216,7 +216,7 @@ void tst_QTabWidget::addRemoveTab()
QCOMPARE(tw->indexOf(w), index);
QCOMPARE(tw->count(), 1);
- QVERIFY(tw->widget(index) == w);
+ QCOMPARE(tw->widget(index), w);
QCOMPARE(tw->tabText(index), QString(LABEL));
removePage(index);
@@ -238,7 +238,7 @@ void tst_QTabWidget::tabPosition()
void tst_QTabWidget::tabEnabled()
{
// Test bad arguments
- QVERIFY(tw->isTabEnabled(-1) == false);
+ QVERIFY(!tw->isTabEnabled(-1));
tw->setTabEnabled(-1, false);
int index = addPage();
@@ -333,21 +333,21 @@ void tst_QTabWidget::currentWidget()
{
// Test bad arguments
tw->setCurrentWidget(NULL);
- QVERIFY(tw->currentWidget() == NULL);
+ QVERIFY(!tw->currentWidget());
int index = addPage();
QWidget *w = tw->widget(index);
- QVERIFY(tw->currentWidget() == w);
+ QCOMPARE(tw->currentWidget(), w);
QCOMPARE(tw->currentIndex(), index);
tw->setCurrentWidget(NULL);
- QVERIFY(tw->currentWidget() == w);
+ QCOMPARE(tw->currentWidget(), w);
QCOMPARE(tw->currentIndex(), index);
int index2 = addPage();
QWidget *w2 = tw->widget(index2);
Q_UNUSED(w2);
- QVERIFY(tw->currentWidget() == w);
+ QCOMPARE(tw->currentWidget(), w);
QCOMPARE(tw->currentIndex(), index);
removePage(index2);
@@ -372,7 +372,7 @@ void tst_QTabWidget::currentIndex()
QCOMPARE(tw->currentIndex(), firstIndex);
QCOMPARE(spy.count(), 1);
QList<QVariant> arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == firstIndex);
+ QCOMPARE(arguments.at(0).toInt(), firstIndex);
int index = addPage();
QCOMPARE(tw->currentIndex(), firstIndex);
@@ -380,19 +380,19 @@ void tst_QTabWidget::currentIndex()
QCOMPARE(tw->currentIndex(), index);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == index);
+ QCOMPARE(arguments.at(0).toInt(), index);
removePage(index);
QCOMPARE(tw->currentIndex(), firstIndex);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == firstIndex);
+ QCOMPARE(arguments.at(0).toInt(), firstIndex);
removePage(firstIndex);
QCOMPARE(tw->currentIndex(), -1);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == -1);
+ QCOMPARE(arguments.at(0).toInt(), -1);
}
void tst_QTabWidget::cornerWidget()
@@ -400,24 +400,24 @@ void tst_QTabWidget::cornerWidget()
// Test bad arguments
tw->setCornerWidget(NULL, Qt::TopRightCorner);
- QVERIFY(tw->cornerWidget(Qt::TopLeftCorner) == 0);
- QVERIFY(tw->cornerWidget(Qt::TopRightCorner) == 0);
- QVERIFY(tw->cornerWidget(Qt::BottomLeftCorner) == 0);
- QVERIFY(tw->cornerWidget(Qt::BottomRightCorner) == 0);
+ QVERIFY(!tw->cornerWidget(Qt::TopLeftCorner));
+ QVERIFY(!tw->cornerWidget(Qt::TopRightCorner));
+ QVERIFY(!tw->cornerWidget(Qt::BottomLeftCorner));
+ QVERIFY(!tw->cornerWidget(Qt::BottomRightCorner));
QWidget *w = new QWidget(0);
tw->setCornerWidget(w, Qt::TopLeftCorner);
QCOMPARE(w->parent(), (QObject *)tw);
- QVERIFY(tw->cornerWidget(Qt::TopLeftCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::TopLeftCorner), w);
tw->setCornerWidget(w, Qt::TopRightCorner);
- QVERIFY(tw->cornerWidget(Qt::TopRightCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::TopRightCorner), w);
tw->setCornerWidget(w, Qt::BottomLeftCorner);
- QVERIFY(tw->cornerWidget(Qt::BottomLeftCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::BottomLeftCorner), w);
tw->setCornerWidget(w, Qt::BottomRightCorner);
- QVERIFY(tw->cornerWidget(Qt::BottomRightCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::BottomRightCorner), w);
tw->setCornerWidget(0, Qt::TopRightCorner);
- QVERIFY(tw->cornerWidget(Qt::TopRightCorner) == 0);
+ QVERIFY(!tw->cornerWidget(Qt::TopRightCorner));
QCOMPARE(w->isHidden(), true);
}
diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
index aaa7348bdf..adc768f828 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
@@ -141,14 +141,14 @@ void tst_QTextBrowser::noReloadOnAnchorJump()
browser->setSource(url);
QCOMPARE(browser->htmlLoadAttempts, 1);
QVERIFY(!browser->toPlainText().isEmpty());
- QVERIFY(browser->source() == url);
+ QCOMPARE(browser->source(), url);
}
void tst_QTextBrowser::bgColorOnSourceChange()
{
browser->setSource(QUrl::fromLocalFile("pagewithbg.html"));
QVERIFY(browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
- QVERIFY(browser->document()->rootFrame()->frameFormat().background().color() == Qt::blue);
+ QCOMPARE(browser->document()->rootFrame()->frameFormat().background().color(), QColor(Qt::blue));
browser->setSource(QUrl::fromLocalFile("pagewithoutbg.html"));
QVERIFY(!browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
@@ -167,13 +167,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
QVariant val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(browser->historyTitle(-1).isEmpty());
QCOMPARE(browser->historyUrl(0), QUrl::fromLocalFile("pagewithbg.html"));
@@ -185,13 +185,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == true);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(val.toBool());
QCOMPARE(browser->historyTitle(-1), QString("Page With BG"));
QCOMPARE(browser->historyTitle(0), QString("Sample Anchor"));
@@ -201,13 +201,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == true);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(browser->historyTitle(-1).isEmpty());
QCOMPARE(browser->historyTitle(0), QString("Page With BG"));
@@ -217,13 +217,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == true);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(val.toBool());
}
void tst_QTextBrowser::viewportPositionInHistory()
@@ -244,29 +244,29 @@ void tst_QTextBrowser::relativeLinks()
QSignalSpy sourceChangedSpy(browser, SIGNAL(sourceChanged(QUrl)));
browser->setSource(QUrl("subdir/../qtextbrowser.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/../qtextbrowser.html"));
browser->setSource(QUrl("subdir/index.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/index.html"));
browser->setSource(QUrl("anchor.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("anchor.html"));
browser->setSource(QUrl("subdir/index.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/index.html"));
// using QUrl::fromLocalFile()
browser->setSource(QUrl::fromLocalFile("anchor.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("file:anchor.html"));
browser->setSource(QUrl("subdir/../qtextbrowser.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/../qtextbrowser.html"));
}
@@ -446,13 +446,13 @@ void tst_QTextBrowser::sourceInsideLoadResource()
void tst_QTextBrowser::textInteractionFlags_vs_readOnly()
{
QVERIFY(browser->isReadOnly());
- QVERIFY(browser->textInteractionFlags() == Qt::TextBrowserInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextBrowserInteraction);
browser->setReadOnly(true);
- QVERIFY(browser->textInteractionFlags() == Qt::TextBrowserInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextBrowserInteraction);
browser->setReadOnly(false);
- QVERIFY(browser->textInteractionFlags() == Qt::TextEditorInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextEditorInteraction);
browser->setReadOnly(true);
- QVERIFY(browser->textInteractionFlags() == Qt::TextBrowserInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextBrowserInteraction);
}
void tst_QTextBrowser::anchorsWithSelfBuiltHtml()
@@ -525,7 +525,7 @@ void tst_QTextBrowser::loadResourceOnRelativeLocalFiles()
QVERIFY(!browser->toPlainText().isEmpty());
QVariant v = browser->loadResource(QTextDocument::HtmlResource, QUrl("../anchor.html"));
QVERIFY(v.isValid());
- QVERIFY(v.type() == QVariant::ByteArray);
+ QCOMPARE(v.type(), QVariant::ByteArray);
QVERIFY(!v.toByteArray().isEmpty());
}
@@ -658,7 +658,7 @@ void tst_QTextBrowser::urlEncoding()
QCOMPARE(spy.count(), 1);
QUrl url = spy.at(0).at(0).toUrl();
- QVERIFY(url.toEncoded() == QByteArray("http://www.google.com/q=%22"));
+ QCOMPARE(url.toEncoded(), QByteArray("http://www.google.com/q=%22"));
delete browser;
}
diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
index 6e0fff17d5..8b39ab59b7 100644
--- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
+++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
@@ -4,3 +4,5 @@ TARGET = tst_qtextedit
QT += widgets widgets-private gui-private core-private testlib
SOURCES += tst_qtextedit.cpp
+
+osx: LIBS += -framework AppKit
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 35a6a8e4e0..0cc812cbca 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -398,12 +398,13 @@ void tst_QTextEdit::cleanup()
void tst_QTextEdit::inlineAttributesOnInsert()
{
- QVERIFY(ed->textCursor().charFormat().foreground().color() != Qt::blue);
+ const QColor blue(Qt::blue);
+ QVERIFY(ed->textCursor().charFormat().foreground().color() != blue);
- ed->setTextColor(Qt::blue);
+ ed->setTextColor(blue);
QTest::keyClick(ed, Qt::Key_A);
- QVERIFY(ed->textCursor().charFormat().foreground().color() == Qt::blue);
+ QCOMPARE(ed->textCursor().charFormat().foreground().color(), blue);
}
void tst_QTextEdit::inlineAttributesOnSelection()
@@ -457,7 +458,7 @@ void tst_QTextEdit::autoBulletList1()
QTest::keyClicks(ed, "*This should become a list");
QVERIFY(ed->textCursor().currentList());
- QVERIFY(ed->textCursor().currentList()->format().style() == QTextListFormat::ListDisc);
+ QCOMPARE(ed->textCursor().currentList()->format().style(), QTextListFormat::ListDisc);
}
void tst_QTextEdit::autoBulletList2()
@@ -582,7 +583,7 @@ void tst_QTextEdit::selectAllSetsNotSelection()
}
QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection);
- QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar"));
+ QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString("foobar"));
ed->insertPlainText("Hello World");
ed->selectAll();
@@ -867,11 +868,12 @@ void tst_QTextEdit::appendShouldUseCurrentFormat()
fmt.setFontItalic(true);
ed->setCurrentCharFormat(fmt);
ed->append("Hello");
+ const QColor blue(Qt::blue);
QTextCursor cursor(ed->document());
QVERIFY(cursor.movePosition(QTextCursor::NextCharacter));
- QVERIFY(cursor.charFormat().foreground().color() != Qt::blue);
+ QVERIFY(cursor.charFormat().foreground().color() != blue);
QVERIFY(!cursor.charFormat().fontItalic());
QVERIFY(cursor.movePosition(QTextCursor::NextBlock));
@@ -883,7 +885,7 @@ void tst_QTextEdit::appendShouldUseCurrentFormat()
}
QVERIFY(cursor.movePosition(QTextCursor::NextCharacter));
- QVERIFY(cursor.charFormat().foreground().color() == Qt::blue);
+ QCOMPARE(cursor.charFormat().foreground().color(), blue);
QVERIFY(cursor.charFormat().fontItalic());
}
@@ -1211,7 +1213,7 @@ void tst_QTextEdit::lineWrapModes()
{
ed->setLineWrapMode(QTextEdit::NoWrap);
// NoWrap at the same time as having all lines that are all left aligned means we optimize to only layout once. The effect is that the width is always 0
- QVERIFY(ed->document()->pageSize().width() == qreal(0));
+ QCOMPARE(ed->document()->pageSize().width(), qreal(0));
QTextCursor cursor = QTextCursor(ed->document());
cursor.insertText(QString("A simple line"));
@@ -1237,13 +1239,13 @@ void tst_QTextEdit::mouseCursorShape()
{
// always show an IBeamCursor, see change 170146
QVERIFY(!ed->isReadOnly());
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setReadOnly(true);
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setPlainText("Foo");
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
}
#endif
@@ -1661,7 +1663,7 @@ void tst_QTextEdit::preserveCharFormatAfterSetPlainText()
QTextBlock block = ed->document()->begin();
block = block.next();
QCOMPARE(block.text(), QString("This should still be blue"));
- QVERIFY(block.begin().fragment().charFormat().foreground().color() == QColor(Qt::blue));
+ QCOMPARE(block.begin().fragment().charFormat().foreground().color(), QColor(Qt::blue));
}
void tst_QTextEdit::extraSelections()
@@ -1796,25 +1798,25 @@ void tst_QTextEdit::wordWrapProperty()
QTextDocument *doc = new QTextDocument(&edit);
edit.setDocument(doc);
edit.setWordWrapMode(QTextOption::NoWrap);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
{
QTextEdit edit;
QTextDocument *doc = new QTextDocument(&edit);
edit.setWordWrapMode(QTextOption::NoWrap);
edit.setDocument(doc);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
}
void tst_QTextEdit::lineWrapProperty()
{
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->lineWrapMode() == QTextEdit::WidgetWidth);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->lineWrapMode(), QTextEdit::WidgetWidth);
ed->setLineWrapMode(QTextEdit::NoWrap);
- QVERIFY(ed->lineWrapMode() == QTextEdit::NoWrap);
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->document()->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(ed->lineWrapMode(), QTextEdit::NoWrap);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->document()->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
void tst_QTextEdit::selectionChanged()
@@ -2122,7 +2124,7 @@ void tst_QTextEdit::setDocumentPreservesPalette()
QTextDocument *newDoc = new QTextDocument(ed);
ed->setDocument(newDoc);
- QVERIFY(control->document() == newDoc);
+ QCOMPARE(control->document(), newDoc);
QVERIFY(whitePal.color(QPalette::Active, QPalette::Text)
== control->palette().color(QPalette::Active, QPalette::Text));
}
@@ -2525,7 +2527,7 @@ void tst_QTextEdit::findWithRegExp()
bool found = ed->find(rx);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
@@ -2539,7 +2541,7 @@ void tst_QTextEdit::findBackwardWithRegExp()
bool found = ed->find(rx, QTextDocument::FindBackward);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit"));
}
@@ -2551,7 +2553,7 @@ void tst_QTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
bool found = ed->find(rx);
- QVERIFY(found == false);
+ QVERIFY(!found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
#endif
diff --git a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
index 24de35ce89..e653a85d96 100644
--- a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
+++ b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
@@ -67,6 +67,7 @@ private slots:
void allowedAreas();
void orientation();
void addAction();
+ void addActionConnect();
void insertAction();
void addSeparator();
void insertSeparator();
@@ -361,6 +362,23 @@ void tst_QToolBar::addAction()
}
}
+static void testFunction() { }
+
+void tst_QToolBar::addActionConnect()
+{
+ QToolBar tb;
+ const QString text = QLatin1String("bla");
+ const QIcon icon;
+ tb.addAction(text, &tb, SLOT(deleteLater()));
+ tb.addAction(text, &tb, &QMenu::deleteLater);
+ tb.addAction(text, testFunction);
+ tb.addAction(text, &tb, testFunction);
+ tb.addAction(icon, text, &tb, SLOT(deleteLater()));
+ tb.addAction(icon, text, &tb, &QMenu::deleteLater);
+ tb.addAction(icon, text, testFunction);
+ tb.addAction(icon, text, &tb, testFunction);
+}
+
void tst_QToolBar::insertAction()
{
QToolBar tb;
@@ -495,13 +513,13 @@ void tst_QToolBar::insertWidget()
QToolBar tb;
QPointer<QWidget> widget = new QWidget;
QAction *action = tb.addWidget(widget);
- QVERIFY(action->parent() == &tb);
+ QCOMPARE(action->parent(), &tb);
QToolBar tb2;
tb.removeAction(action);
tb2.addAction(action);
QVERIFY(widget && widget->parent() == &tb2);
- QVERIFY(action->parent() == &tb2);
+ QCOMPARE(action->parent(), &tb2);
}
}
@@ -960,10 +978,10 @@ void tst_QToolBar::actionOwnership()
QToolBar *tb2 = new QToolBar;
QPointer<QAction> action = tb1->addAction("test");
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
tb2->addAction(action);
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
delete tb1;
QVERIFY(!action);
@@ -974,13 +992,13 @@ void tst_QToolBar::actionOwnership()
QToolBar *tb2 = new QToolBar;
QPointer<QAction> action = tb1->addAction("test");
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
tb1->removeAction(action);
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
tb2->addAction(action);
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
delete tb1;
QVERIFY(!action);
diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
index 03fbae2e57..0d1abe5032 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
@@ -170,10 +170,10 @@ void tst_QToolButton::collapseTextOnPriority()
QStyleOptionToolButton option;
button.initStyleOption(&option);
- QVERIFY(option.toolButtonStyle == Qt::ToolButtonTextBesideIcon);
+ QCOMPARE(option.toolButtonStyle, Qt::ToolButtonTextBesideIcon);
action.setPriority(QAction::LowPriority);
button.initStyleOption(&option);
- QVERIFY(option.toolButtonStyle == Qt::ToolButtonIconOnly);
+ QCOMPARE(option.toolButtonStyle, Qt::ToolButtonIconOnly);
}
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
index 2ce32c7cf2..04cd0b300f 100644
--- a/tests/auto/xml/dom/qdom/tst_qdom.cpp
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -119,6 +119,7 @@ private slots:
void cloneDTD_QTBUG8398() const;
void DTDNotationDecl();
void DTDEntityDecl();
+ void QTBUG49113_dontCrashWithNegativeIndex() const;
void cleanupTestCase() const;
@@ -1043,15 +1044,15 @@ void tst_QDom::browseElements()
QVERIFY(!bar.isNull());
QVERIFY(bar.previousSiblingElement("bar").isNull());
QVERIFY(bar.previousSiblingElement().isNull());
- QVERIFY(bar.nextSiblingElement("bar").tagName() == "bar");
+ QCOMPARE(bar.nextSiblingElement("bar").tagName(), QLatin1String("bar"));
QVERIFY(bar.nextSiblingElement("bar").nextSiblingElement("bar").isNull());
QDomElement bop = foo.firstChildElement("bop");
QVERIFY(!bop.isNull());
- QVERIFY(bar.nextSiblingElement() == bop);
- QVERIFY(bop.nextSiblingElement("bop") == foo.lastChildElement("bop"));
- QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement("bar"));
- QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement());
+ QCOMPARE(bar.nextSiblingElement(), bop);
+ QCOMPARE(bop.nextSiblingElement("bop"), foo.lastChildElement("bop"));
+ QCOMPARE(bop.previousSiblingElement("bar"), foo.firstChildElement("bar"));
+ QCOMPARE(bop.previousSiblingElement("bar"), foo.firstChildElement());
}
void tst_QDom::domNodeMapAndList()
@@ -1979,5 +1980,13 @@ void tst_QDom::DTDEntityDecl()
QCOMPARE(doctype.namedItem(QString("logo")).toEntity().notationName(), QString("gif"));
}
+void tst_QDom::QTBUG49113_dontCrashWithNegativeIndex() const
+{
+ QDomDocument doc;
+ QDomElement elem = doc.appendChild(doc.createElement("root")).toElement();
+ QDomNode node = elem.attributes().item(-1);
+ QVERIFY(node.isNull());
+}
+
QTEST_MAIN(tst_QDom)
#include "tst_qdom.moc"
diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
index 04f19f6a2b..a5ac58878e 100644
--- a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
+++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
@@ -147,7 +147,7 @@ public slots:
void requestFinished(QNetworkReply *reply)
{
- QVERIFY(reply->error() == QNetworkReply::NoError);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
reply->deleteLater();
}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
index 1cff3fd44f..1cff3fd44f 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
index 45f6d8e74e..45f6d8e74e 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
index 3436f20001..3436f20001 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
index c6e97f821f..c6e97f821f 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
index 4df2f0c2ac..4df2f0c2ac 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
index ab1d696dd7..ab1d696dd7 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
index c6ca61f9c8..c6ca61f9c8 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
index 67c3297611..67c3297611 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
index b19be3a497..b19be3a497 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
index 8eb1fb9c41..8eb1fb9c41 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
index 7f25c502dd..7f25c502dd 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
index 470fd6fe44..470fd6fe44 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
index 67c3297611..67c3297611 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
index 931f3ad6d8..931f3ad6d8 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
index 40f7ff58a2..40f7ff58a2 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
index 61def75cb7..61def75cb7 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
index ade9599032..ade9599032 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
index bef50b1f38..bef50b1f38 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
index 8f305a82bd..8f305a82bd 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
index 52a28f5deb..52a28f5deb 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
index 7e372e65e9..7e372e65e9 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
index a3691d9f08..a3691d9f08 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
index 6eaf779329..6eaf779329 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
index 00d2f30e1d..00d2f30e1d 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
index bf77ef8336..bf77ef8336 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
index ffd9adde61..ffd9adde61 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
index 2d46f76fc3..2d46f76fc3 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
index d18201a98b..d18201a98b 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
index 815291c6d2..815291c6d2 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
index 9f8f2afd2b..9f8f2afd2b 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
index 26f2d8beb2..26f2d8beb2 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
index e3268819f7..e3268819f7 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
index aa6d0eccac..aa6d0eccac 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
index 389d259eb1..389d259eb1 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
index bdc93af639..bdc93af639 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
index 712cce3700..712cce3700 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
index ac249d7b2c..ac249d7b2c 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
index df94df5560..df94df5560 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
index e3864460df..e3864460df 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
index f7f94ab152..f7f94ab152 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
index bef50b1f38..bef50b1f38 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
index 272bafc7dd..42d36a22f8 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
@@ -223,12 +223,12 @@ void tst_qdiriterator::fsiterator()
int c = 0;
dump && printf("\n\n\n\n");
- QFileSystemIterator dir(dirpath,
+ QDirIteratorTest::QFileSystemIterator dir(dirpath,
//QDir::AllEntries | QDir::Hidden | QDir::NoDotAndDotDot,
//QDir::AllEntries | QDir::Hidden,
//QDir::Files | QDir::NoDotAndDotDot,
QDir::Files,
- QFileSystemIterator::Subdirectories);
+ QDirIteratorTest::QFileSystemIterator::Subdirectories);
for (; !dir.atEnd(); dir.next()) {
dump && printf("%d %s\n",
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
index 1b28f462aa..a4db21742d 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
@@ -99,6 +99,8 @@
QT_BEGIN_NAMESPACE
+namespace QDirIteratorTest {
+
class QFileSystemIteratorPrivate
{
public:
@@ -671,4 +673,6 @@ QString QFileSystemIterator::path() const
return QString::fromLocal8Bit(d->m_dirPaths.top());
}
+} // QDirIteratorTest::
+
QT_END_NAMESPACE
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h
index b940c0061b..96fa5177a0 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h
@@ -38,6 +38,7 @@
QT_BEGIN_NAMESPACE
+namespace QDirIteratorTest {
class QFileSystemIteratorPrivate;
class //Q_CORE_EXPORT
@@ -81,6 +82,8 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemIterator::IteratorFlags)
+} // namespace QDirIteratorTest
+
QT_END_NAMESPACE
#endif
diff --git a/tests/benchmarks/corelib/tools/qringbuffer/main.cpp b/tests/benchmarks/corelib/tools/qringbuffer/main.cpp
index 6bb82a8056..cf55aeaee5 100644
--- a/tests/benchmarks/corelib/tools/qringbuffer/main.cpp
+++ b/tests/benchmarks/corelib/tools/qringbuffer/main.cpp
@@ -48,10 +48,10 @@ void tst_qringbuffer::reserveAndRead()
{
QRingBuffer ringBuffer;
QBENCHMARK {
- for (int i = 1; i < 256; ++i)
+ for (qint64 i = 1; i < 256; ++i)
ringBuffer.reserve(i);
- for (int i = 1; i < 256; ++i)
+ for (qint64 i = 1; i < 256; ++i)
ringBuffer.read(0, i);
}
}
diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp
index 224d9619ec..f20b3f6cce 100644
--- a/tests/benchmarks/gui/text/qtext/main.cpp
+++ b/tests/benchmarks/gui/text/qtext/main.cpp
@@ -42,7 +42,7 @@
#include <QBuffer>
#include <qtest.h>
-Q_DECLARE_METATYPE(QList<QTextLayout::FormatRange>)
+Q_DECLARE_METATYPE(QVector<QTextLayout::FormatRange>)
class tst_QText: public QObject
{
@@ -324,13 +324,13 @@ void tst_QText::layout()
void tst_QText::formattedLayout_data()
{
QTest::addColumn<QString>("text");
- QTest::addColumn<QList<QTextLayout::FormatRange> >("ranges");
+ QTest::addColumn<QVector<QTextLayout::FormatRange> >("ranges");
QTextCharFormat format;
format.setForeground(QColor("steelblue"));
{
- QList<QTextLayout::FormatRange> ranges;
+ QVector<QTextLayout::FormatRange> ranges;
QTextLayout::FormatRange formatRange;
formatRange.format = format;
@@ -341,7 +341,7 @@ void tst_QText::formattedLayout_data()
QTest::newRow("short-single") << m_shortLorem << ranges;
}
{
- QList<QTextLayout::FormatRange> ranges;
+ QVector<QTextLayout::FormatRange> ranges;
QString text = m_lorem.repeated(100);
const int width = 1;
@@ -360,15 +360,15 @@ void tst_QText::formattedLayout_data()
void tst_QText::formattedLayout()
{
QFETCH(QString, text);
- QFETCH(QList<QTextLayout::FormatRange>, ranges);
+ QFETCH(QVector<QTextLayout::FormatRange>, ranges);
QTextLayout layout(text);
- layout.setAdditionalFormats(ranges);
+ layout.setFormats(ranges);
setupTextLayout(&layout);
QBENCHMARK {
QTextLayout layout(text);
- layout.setAdditionalFormats(ranges);
+ layout.setFormats(ranges);
setupTextLayout(&layout);
}
}
diff --git a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp
index 63aa6f7250..b5937b76b0 100644
--- a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp
+++ b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp
@@ -55,6 +55,8 @@ public slots:
private slots:
void benchmark_data() { generic_data(); }
void benchmark();
+ void benchmarkSelectPrepared_data() { generic_data(); }
+ void benchmarkSelectPrepared();
private:
// returns all database connections
@@ -264,4 +266,42 @@ void tst_QSqlQuery::benchmark()
tst_Databases::safeDropTable( db, tableName );
}
+void tst_QSqlQuery::benchmarkSelectPrepared()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+ if (tst_Databases::getMySqlVersion(db).section(QChar('.'), 0, 0).toInt() < 5)
+ QSKIP("Test requires MySQL >= 5.0");
+
+ QSqlQuery q(db);
+ const QString tableName(qTableName("benchmark", __FILE__, db));
+
+ tst_Databases::safeDropTable(db, tableName);
+
+ QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + "(id INT NOT NULL)"));
+
+ const int NUM_ROWS = 1000;
+ int expectedSum = 0;
+ QString fillQuery = "INSERT INTO " + tableName + " VALUES (0)";
+ for (int i = 1; i < NUM_ROWS; ++i) {
+ fillQuery += ", (" + QString::number(i) + ")";
+ expectedSum += i;
+ }
+ QVERIFY_SQL(q, exec(fillQuery));
+
+ QVERIFY_SQL(q, prepare("SELECT id FROM "+tableName));
+ QBENCHMARK {
+ QVERIFY_SQL(q, exec());
+ int sum = 0;
+
+ while (q.next())
+ sum += q.value(0).toInt();
+
+ QCOMPARE(sum, expectedSum);
+ }
+
+ tst_Databases::safeDropTable(db, tableName);
+}
+
#include "main.moc"
diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm
index 5dd546479e..23370b0305 100644
--- a/tests/manual/cocoa/qt_on_cocoa/main.mm
+++ b/tests/manual/cocoa/qt_on_cocoa/main.mm
@@ -31,123 +31,35 @@
**
****************************************************************************/
-#include <QtGui>
-#include <QtDeclarative>
+#include "rasterwindow.h"
+#include <QtGui>
#include <QtWidgets/QtWidgets>
-#include <private/qwidgetwindow_p.h>
-#include <QtGui/qpa/qplatformnativeinterface.h>
-
-#include <QtGui/QPixmap>
-
-#include "window.h"
#include <Cocoa/Cocoa.h>
-
-@interface FilledView : NSView
-{
-
+@interface AppDelegate : NSObject <NSApplicationDelegate> {
+ QGuiApplication *m_app;
+ QWindow *m_window;
}
+- (AppDelegate *) initWithArgc:(int)argc argv:(const char **)argv;
+- (void) applicationWillFinishLaunching: (NSNotification *)notification;
+- (void)applicationWillTerminate:(NSNotification *)notification;
@end
-@implementation FilledView
-
-- (void)drawRect:(NSRect)dirtyRect {
- // set any NSColor for filling, say white:
- [[NSColor redColor] setFill];
- NSRectFill(dirtyRect);
-}
-
-@end
-
-@interface QtMacToolbarDelegate : NSObject <NSToolbarDelegate>
+@implementation AppDelegate
+- (AppDelegate *) initWithArgc:(int)argc argv:(const char **)argv
{
-@public
- NSToolbar *toolbar;
-}
-
-- (id)init;
-- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted;
-- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)tb;
-- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
-- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar;
-@end
-
-@implementation QtMacToolbarDelegate
-
-- (id)init
-{
- self = [super init];
- if (self) {
- }
+ m_app = new QGuiApplication(argc, const_cast<char **>(argv));
return self;
}
-- (void)dealloc
-{
- [super dealloc];
-}
-
-- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)tb
-{
- Q_UNUSED(tb);
- NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
-// [array addObject : NSToolbarPrintItemIdentifier];
-// [array addObject : NSToolbarShowColorsItemIdentifier];
- [array addObject : @"filledView"];
- return array;
-}
-
-- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)tb
-{
- Q_UNUSED(tb);
- NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
-// [array addObject : NSToolbarPrintItemIdentifier];
-// [array addObject : NSToolbarShowColorsItemIdentifier];
- [array addObject : @"filledView"];
- return array;
-}
-
-- (NSArray *)toolbarSelectableItemIdentifiers: (NSToolbar *)tb
-{
- Q_UNUSED(tb);
- NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
- return array;
-}
-
-- (IBAction)itemClicked:(id)sender
+- (void) applicationWillFinishLaunching: (NSNotification *)notification
{
+ Q_UNUSED(notification);
-}
-
-- (NSToolbarItem *) toolbar: (NSToolbar *)tb itemForItemIdentifier: (NSString *) itemIdentifier willBeInsertedIntoToolbar:(BOOL) willBeInserted
-{
- Q_UNUSED(tb);
- Q_UNUSED(willBeInserted);
- //const QString identifier = toQString(itemIdentifier);
- //NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];
- //return toolbarItem;
-
- //NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];
- NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];
- FilledView *theView = [[FilledView alloc] init];
- [toolbarItem setView : theView];
- [toolbarItem setMinSize : NSMakeSize(400, 40)];
- [toolbarItem setMaxSize : NSMakeSize(4000, 40)];
- return toolbarItem;
-}
-@end
-
-@interface WindowAndViewAndQtCreator : NSObject {}
-- (void)createWindowAndViewAndQt;
-@end
-
-@implementation WindowAndViewAndQtCreator
-- (void)createWindowAndViewAndQt {
-
- // Create the window
+ // Create the NSWindow
NSRect frame = NSMakeRect(500, 500, 500, 500);
NSWindow* window = [[NSWindow alloc] initWithContentRect:frame
styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask
@@ -156,49 +68,31 @@
NSString *title = @"This the NSWindow window";
[window setTitle:title];
-
[window setBackgroundColor:[NSColor blueColor]];
- // Create a tool bar, set Qt delegate
- NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier : @"foobartoolbar"];
- QtMacToolbarDelegate *delegate = [[QtMacToolbarDelegate alloc] init];
- [toolbar setDelegate : delegate];
- [window setToolbar : toolbar];
-
- // Create the QWindow, don't show it.
- Window *qtWindow = new Window();
- qtWindow->create();
-
- //QSGView *qtWindow = new QSGView();
- //qtWindow->setSource(QUrl::fromLocalFile("/Users/msorvig/code/qt5/qtdeclarative/examples/declarative/samegame/samegame.qml"));
- // qtWindow->setWindowFlags(Qt::WindowType(13)); // 13: NativeEmbeddedWindow
-
- // Get the nsview from the QWindow, set it as the content view
- // on the NSWindow created above.
- QPlatformNativeInterface *platformNativeInterface = QGuiApplication::platformNativeInterface();
- NSView *qtView = (NSView *)platformNativeInterface->nativeResourceForWindow("nsview", qtWindow);
- [window setContentView:qtView];
+ // Create the QWindow, use its NSView as the content view
+ m_window = new RasterWindow();
+ [window setContentView:reinterpret_cast<NSView *>(m_window->winId())];
+
+ // Show the NSWindow
[window makeKeyAndOrderFront:NSApp];
}
-@end
-int main(int argc, char *argv[])
+- (void)applicationWillTerminate:(NSNotification *)notification
{
- QGuiApplication app(argc, argv);
-
- // fake NSApplicationMain() implementation follows:
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
- [NSApplication sharedApplication];
+ Q_UNUSED(notification);
+ delete m_window;
+ delete m_app;
+}
- // schedule call to create the UI.
- WindowAndViewAndQtCreator *windowAndViewAndQtCreator= [WindowAndViewAndQtCreator alloc];
- [NSTimer scheduledTimerWithTimeInterval:0 target:windowAndViewAndQtCreator selector:@selector(createWindowAndViewAndQt) userInfo:nil repeats:NO];
+@end
- [(NSApplication *)NSApp run];
- [NSApp release];
- [pool release];
- exit(0);
- return 0;
+int main(int argc, const char *argv[])
+{
+ // Create NSApplicaiton with delgate
+ NSApplication *app =[NSApplication sharedApplication];
+ app.delegate = [[AppDelegate alloc] initWithArgc:argc argv:argv];
+ return NSApplicationMain (argc, argv);
}
diff --git a/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
index 3d526909a5..97e4473e15 100644
--- a/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
+++ b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
@@ -1,13 +1,11 @@
TEMPLATE = app
OBJECTIVE_SOURCES += main.mm
-HEADERS += window.h
-SOURCES += window.cpp
+HEADERS += rasterwindow.h
+SOURCES += rasterwindow.cpp
LIBS += -framework Cocoa
-QMAKE_INFO_PLIST = Info_mac.plist
-OTHER_FILES = Info_mac.plist
-QT += gui widgets widgets-private gui-private core-private
+QT += gui widgets quick
-QT += declarative
+QT += quick
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/cocoa/qt_on_cocoa/rasterwindow.cpp b/tests/manual/cocoa/qt_on_cocoa/rasterwindow.cpp
new file mode 100644
index 0000000000..9b8f5e63ce
--- /dev/null
+++ b/tests/manual/cocoa/qt_on_cocoa/rasterwindow.cpp
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 "rasterwindow.h"
+
+//#include <private/qguiapplication_p.h>
+
+#include <QBackingStore>
+#include <QPainter>
+#include <QtWidgets>
+
+static int colorIndexId = 0;
+
+QColor colorTable[] =
+{
+ QColor("#f09f8f"),
+ QColor("#a2bff2"),
+ QColor("#c0ef8f")
+};
+
+RasterWindow::RasterWindow(QRasterWindow *parent)
+ : QRasterWindow(parent)
+ , m_backgroundColorIndex(colorIndexId++)
+{
+ initialize();
+}
+
+void RasterWindow::initialize()
+{
+ if (parent())
+ setGeometry(QRect(160, 120, 320, 240));
+ else {
+ setGeometry(QRect(10, 10, 640, 480));
+
+ setSizeIncrement(QSize(10, 10));
+ setBaseSize(QSize(640, 480));
+ setMinimumSize(QSize(240, 160));
+ setMaximumSize(QSize(800, 600));
+ }
+
+ create();
+ m_backingStore = new QBackingStore(this);
+
+ m_image = QImage(geometry().size(), QImage::Format_RGB32);
+ m_image.fill(colorTable[m_backgroundColorIndex % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
+
+ m_lastPos = QPoint(-1, -1);
+ m_renderTimer = 0;
+}
+
+void RasterWindow::mousePressEvent(QMouseEvent *event)
+{
+ m_lastPos = event->pos();
+}
+
+void RasterWindow::mouseMoveEvent(QMouseEvent *event)
+{
+ if (m_lastPos != QPoint(-1, -1)) {
+ QPainter p(&m_image);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.drawLine(m_lastPos, event->pos());
+ m_lastPos = event->pos();
+ }
+
+ scheduleRender();
+}
+
+void RasterWindow::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (m_lastPos != QPoint(-1, -1)) {
+ QPainter p(&m_image);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.drawLine(m_lastPos, event->pos());
+ m_lastPos = QPoint(-1, -1);
+ }
+
+ scheduleRender();
+}
+
+void RasterWindow::exposeEvent(QExposeEvent *)
+{
+ scheduleRender();
+}
+
+void RasterWindow::resizeEvent(QResizeEvent *)
+{
+ QImage old = m_image;
+
+ //qDebug() << "RasterWindow::resizeEvent" << width << height;
+
+ int width = qMax(geometry().width(), old.width());
+ int height = qMax(geometry().height(), old.height());
+
+ if (width > old.width() || height > old.height()) {
+ m_image = QImage(width, height, QImage::Format_RGB32);
+ m_image.fill(colorTable[(m_backgroundColorIndex) % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
+
+ QPainter p(&m_image);
+ p.drawImage(0, 0, old);
+ }
+
+ render();
+}
+
+void RasterWindow::keyPressEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Backspace:
+ m_text.chop(1);
+ break;
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ m_text.append('\n');
+ break;
+ default:
+ m_text.append(event->text());
+ break;
+ }
+ scheduleRender();
+}
+
+void RasterWindow::scheduleRender()
+{
+ if (!m_renderTimer)
+ m_renderTimer = startTimer(1);
+}
+
+void RasterWindow::timerEvent(QTimerEvent *)
+{
+ render();
+ killTimer(m_renderTimer);
+ m_renderTimer = 0;
+}
+
+void RasterWindow::render()
+{
+ QRect rect(QPoint(), geometry().size());
+
+ m_backingStore->resize(rect.size());
+
+ m_backingStore->beginPaint(rect);
+
+ QPaintDevice *device = m_backingStore->paintDevice();
+
+ QPainter p(device);
+ p.drawImage(0, 0, m_image);
+
+ QFont font;
+ font.setPixelSize(32);
+
+ p.setFont(font);
+ p.drawText(rect, 0, m_text);
+
+ m_backingStore->endPaint();
+ m_backingStore->flush(rect);
+}
+
+
diff --git a/tests/manual/cocoa/qt_on_cocoa/rasterwindow.h b/tests/manual/cocoa/qt_on_cocoa/rasterwindow.h
new file mode 100644
index 0000000000..1de66b5302
--- /dev/null
+++ b/tests/manual/cocoa/qt_on_cocoa/rasterwindow.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QRasterWindow>
+#include <QImage>
+
+class RasterWindow : public QRasterWindow
+{
+public:
+ RasterWindow(QRasterWindow *parent = 0);
+
+protected:
+ void mousePressEvent(QMouseEvent *);
+ void mouseMoveEvent(QMouseEvent *);
+ void mouseReleaseEvent(QMouseEvent *);
+
+ void keyPressEvent(QKeyEvent *);
+
+ void exposeEvent(QExposeEvent *);
+ void resizeEvent(QResizeEvent *);
+
+ void timerEvent(QTimerEvent *);
+
+private:
+ void render();
+ void scheduleRender();
+ void initialize();
+
+ QString m_text;
+ QImage m_image;
+ QPoint m_lastPos;
+ int m_backgroundColorIndex;
+ QBackingStore *m_backingStore;
+ int m_renderTimer;
+};
diff --git a/tests/manual/cocoa/qt_on_cocoa/window.cpp b/tests/manual/cocoa/qt_on_cocoa/window.cpp
deleted file mode 100644
index 9929a50065..0000000000
--- a/tests/manual/cocoa/qt_on_cocoa/window.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite 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 "window.h"
-
-#include <private/qguiapplication_p.h>
-
-#include <QBackingStore>
-#include <QPainter>
-#include <QtWidgets>
-
-static int colorIndexId = 0;
-
-QColor colorTable[] =
-{
- QColor("#f09f8f"),
- QColor("#a2bff2"),
- QColor("#c0ef8f")
-};
-
-Window::Window(QScreen *screen)
- : QWindow(screen)
- , m_backgroundColorIndex(colorIndexId++)
-{
- initialize();
-}
-
-Window::Window(QWindow *parent)
- : QWindow(parent)
- , m_backgroundColorIndex(colorIndexId++)
-{
- initialize();
-}
-
-void Window::initialize()
-{
- if (parent())
- setGeometry(QRect(160, 120, 320, 240));
- else {
- setGeometry(QRect(10, 10, 640, 480));
-
- setSizeIncrement(QSize(10, 10));
- setBaseSize(QSize(640, 480));
- setMinimumSize(QSize(240, 160));
- setMaximumSize(QSize(800, 600));
- }
-
- create();
- m_backingStore = new QBackingStore(this);
-
- m_image = QImage(geometry().size(), QImage::Format_RGB32);
- m_image.fill(colorTable[m_backgroundColorIndex % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
-
- m_lastPos = QPoint(-1, -1);
- m_renderTimer = 0;
-}
-
-void Window::mousePressEvent(QMouseEvent *event)
-{
- m_lastPos = event->pos();
-}
-
-void Window::mouseMoveEvent(QMouseEvent *event)
-{
- if (m_lastPos != QPoint(-1, -1)) {
- QPainter p(&m_image);
- p.setRenderHint(QPainter::Antialiasing);
- p.drawLine(m_lastPos, event->pos());
- m_lastPos = event->pos();
- }
-
- scheduleRender();
-}
-
-void Window::mouseReleaseEvent(QMouseEvent *event)
-{
- if (m_lastPos != QPoint(-1, -1)) {
- QPainter p(&m_image);
- p.setRenderHint(QPainter::Antialiasing);
- p.drawLine(m_lastPos, event->pos());
- m_lastPos = QPoint(-1, -1);
- }
-
- scheduleRender();
-}
-
-void Window::exposeEvent(QExposeEvent *)
-{
- scheduleRender();
-}
-
-void Window::resizeEvent(QResizeEvent *)
-{
- QImage old = m_image;
-
- //qDebug() << "Window::resizeEvent" << width << height;
-
- int width = qMax(geometry().width(), old.width());
- int height = qMax(geometry().height(), old.height());
-
- if (width > old.width() || height > old.height()) {
- m_image = QImage(width, height, QImage::Format_RGB32);
- m_image.fill(colorTable[(m_backgroundColorIndex) % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
-
- QPainter p(&m_image);
- p.drawImage(0, 0, old);
- }
-
- render();
-}
-
-void Window::keyPressEvent(QKeyEvent *event)
-{
- switch (event->key()) {
- case Qt::Key_Backspace:
- m_text.chop(1);
- break;
- case Qt::Key_Enter:
- case Qt::Key_Return:
- m_text.append('\n');
- break;
- default:
- m_text.append(event->text());
- break;
- }
- scheduleRender();
-}
-
-void Window::scheduleRender()
-{
- if (!m_renderTimer)
- m_renderTimer = startTimer(1);
-}
-
-void Window::timerEvent(QTimerEvent *)
-{
- render();
- killTimer(m_renderTimer);
- m_renderTimer = 0;
-}
-
-void Window::render()
-{
- QRect rect(QPoint(), geometry().size());
-
- m_backingStore->resize(rect.size());
-
- m_backingStore->beginPaint(rect);
-
- QPaintDevice *device = m_backingStore->paintDevice();
-
- QPainter p(device);
- p.drawImage(0, 0, m_image);
-
- QFont font;
- font.setPixelSize(32);
-
- p.setFont(font);
- p.drawText(rect, 0, m_text);
-
- m_backingStore->endPaint();
- m_backingStore->flush(rect);
-}
-
-
diff --git a/tests/manual/cocoa/qt_on_cocoa/window.h b/tests/manual/cocoa/qt_on_cocoa/window.h
deleted file mode 100644
index a36180e0f3..0000000000
--- a/tests/manual/cocoa/qt_on_cocoa/window.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite 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 <QWindow>
-#include <QImage>
-
-class Window : public QWindow
-{
-public:
- Window(QWindow *parent = 0);
- Window(QScreen *screen);
-
-protected:
- void mousePressEvent(QMouseEvent *);
- void mouseMoveEvent(QMouseEvent *);
- void mouseReleaseEvent(QMouseEvent *);
-
- void keyPressEvent(QKeyEvent *);
-
- void exposeEvent(QExposeEvent *);
- void resizeEvent(QResizeEvent *);
-
- void timerEvent(QTimerEvent *);
-
-private:
- void render();
- void scheduleRender();
- void initialize();
-
- QString m_text;
- QImage m_image;
- QPoint m_lastPos;
- int m_backgroundColorIndex;
- QBackingStore *m_backingStore;
- int m_renderTimer;
-};
diff --git a/tests/manual/diaglib/eventfilter.cpp b/tests/manual/diaglib/eventfilter.cpp
index b35d29cc8a..6df885ebb6 100644
--- a/tests/manual/diaglib/eventfilter.cpp
+++ b/tests/manual/diaglib/eventfilter.cpp
@@ -190,8 +190,13 @@ static void formatApplicationState(QDebug debug)
debug << "\n QGuiApplication::modalWindow = ";
formatObject(mw, debug);
}
- debug << "\n QGuiApplication::focusWindow = ";
- formatObject(QGuiApplication::focusWindow(), debug);
+ const QObject *focusObject = QGuiApplication::focusObject();
+ const QObject *focusWindow = QGuiApplication::focusWindow();
+ debug << "\n QGuiApplication::focusObject = ";
+ formatObject(focusObject, debug);
+ if (focusWindow && focusWindow != focusObject)
+ debug << "\n QGuiApplication::focusWindow = ";
+ formatObject(focusWindow, debug);
#endif // HAVE_GUI_APPLICATION
}
diff --git a/tests/manual/diaglib/nativewindowdump_win.cpp b/tests/manual/diaglib/nativewindowdump_win.cpp
index e3885eb96d..b25f8aa864 100644
--- a/tests/manual/diaglib/nativewindowdump_win.cpp
+++ b/tests/manual/diaglib/nativewindowdump_win.cpp
@@ -48,9 +48,10 @@
namespace QtDiag {
struct DumpContext {
- DumpContext() : indentation(0) {}
+ DumpContext() : indentation(0), parent(0) {}
int indentation;
+ HWND parent;
QSharedPointer<QTextStream> stream;
};
@@ -64,11 +65,19 @@ static void formatNativeWindow(HWND hwnd, QTextStream &str)
RECT rect;
if (GetWindowRect(hwnd, &rect)) {
str << ' ' << (rect.right - rect.left) << 'x' << (rect.bottom - rect.top)
- << '+' << rect.left << '+' << rect.top;
+ << forcesign << rect.left << rect.top << noforcesign;
}
if (IsWindowVisible(hwnd))
str << " [visible]";
+ wchar_t buf[512];
+ if (GetWindowText(hwnd, buf, sizeof(buf)/sizeof(buf[0])) && buf[0])
+ str << " title=\"" << QString::fromWCharArray(buf) << "\"/";
+ else
+ str << ' ';
+ if (GetClassName(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
+ str << '"' << QString::fromWCharArray(buf) << '"';
+
str << hex << showbase;
if (const LONG_PTR style = GetWindowLongPtr(hwnd, GWL_STYLE)) {
str << " style=" << style;
@@ -121,13 +130,31 @@ static void formatNativeWindow(HWND hwnd, QTextStream &str)
debugWinStyle(str, exStyle, WS_EX_COMPOSITED)
debugWinStyle(str, exStyle, WS_EX_NOACTIVATE)
}
+
+ if (const ULONG_PTR classStyle = GetClassLongPtr(hwnd, GCL_STYLE)) {
+ str << " classStyle=" << classStyle;
+ debugWinStyle(str, classStyle, CS_BYTEALIGNCLIENT)
+ debugWinStyle(str, classStyle, CS_BYTEALIGNWINDOW)
+ debugWinStyle(str, classStyle, CS_CLASSDC)
+ debugWinStyle(str, classStyle, CS_DBLCLKS)
+ debugWinStyle(str, classStyle, CS_DROPSHADOW)
+ debugWinStyle(str, classStyle, CS_GLOBALCLASS)
+ debugWinStyle(str, classStyle, CS_HREDRAW)
+ debugWinStyle(str, classStyle, CS_NOCLOSE)
+ debugWinStyle(str, classStyle, CS_OWNDC)
+ debugWinStyle(str, classStyle, CS_PARENTDC)
+ debugWinStyle(str, classStyle, CS_SAVEBITS)
+ debugWinStyle(str, classStyle, CS_VREDRAW)
+ }
+
+ if (const ULONG_PTR wndProc = GetClassLongPtr(hwnd, GCLP_WNDPROC))
+ str << " wndProc=" << wndProc;
+
str << noshowbase << dec;
- wchar_t buf[512];
- if (GetWindowText(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
- str << " title=\"" << QString::fromWCharArray(buf) << '"';
- if (GetClassName(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
- str << " class=\"" << QString::fromWCharArray(buf) << '"';
+ if (GetWindowModuleFileName(hwnd, buf, sizeof(buf)/sizeof(buf[0])))
+ str << " module=\"" << QString::fromWCharArray(buf) << '"';
+
str << '\n';
}
@@ -135,7 +162,11 @@ static void dumpNativeWindowRecursion(HWND hwnd, DumpContext *dc);
BOOL CALLBACK dumpWindowEnumChildProc(HWND hwnd, LPARAM lParam)
{
- dumpNativeWindowRecursion(hwnd, reinterpret_cast<DumpContext *>(lParam));
+ DumpContext *dumpContext = reinterpret_cast<DumpContext *>(lParam);
+ // EnumChildWindows enumerates grand children as well, skip these to
+ // get the hierarchical formatting right.
+ if (GetAncestor(hwnd, GA_PARENT) == dumpContext->parent)
+ dumpNativeWindowRecursion(hwnd, dumpContext);
return TRUE;
}
@@ -145,6 +176,7 @@ static void dumpNativeWindowRecursion(HWND hwnd, DumpContext *dc)
formatNativeWindow(hwnd, *dc->stream);
DumpContext nextLevel = *dc;
nextLevel.indentation += 2;
+ nextLevel.parent = hwnd;
EnumChildWindows(hwnd, dumpWindowEnumChildProc, reinterpret_cast<LPARAM>(&nextLevel));
}
diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp
index a77bae22e9..c0faefb918 100644
--- a/tests/manual/diaglib/qwindowdump.cpp
+++ b/tests/manual/diaglib/qwindowdump.cpp
@@ -38,6 +38,9 @@
# include <QtGui/QScreen>
# include <QtGui/QWindow>
# include <qpa/qplatformwindow.h>
+# if QT_VERSION >= 0x050600
+# include <private/qhighdpiscaling_p.h>
+# endif
#endif
#include <QtCore/QMetaObject>
#include <QtCore/QRect>
@@ -131,9 +134,19 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option
str << "[top] ";
if (w->isExposed())
str << "[exposed] ";
+ if (w->surfaceClass() == QWindow::Offscreen)
+ str << "[offscreen] ";
+ str << "surface=" << w->surfaceType() << ' ';
if (const Qt::WindowState state = w->windowState())
str << "windowState=" << state << ' ';
formatRect(str, w->geometry());
+ if (w->isTopLevel()) {
+ str << " \"" << w->screen()->name() << "\" ";
+#if QT_VERSION >= 0x050600
+ if (QHighDpiScaling::isActive())
+ str << "factor=" << QHighDpiScaling::factor(w) << ' ';
+#endif
+ }
if (!(options & DontPrintWindowFlags)) {
str << ' ';
formatWindowFlags(str, w->flags());
diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp
index ed4d5021be..0f69166a43 100644
--- a/tests/manual/diaglib/textdump.cpp
+++ b/tests/manual/diaglib/textdump.cpp
@@ -248,6 +248,15 @@ static const EnumLookup scriptEnumLookup[] =
{QChar::Script_Tirhuta, "Script_Tirhuta"},
{QChar::Script_WarangCiti, "Script_WarangCiti"},
#endif // Qt 5.5
+
+#if QT_VERSION >= 0x050600
+ {QChar::Script_Ahom, "Script_Ahom"},
+ {QChar::Script_AnatolianHieroglyphs, "Script_AnatolianHieroglyphs"},
+ {QChar::Script_Hatran, "Script_Hatran"},
+ {QChar::Script_Multani, "Script_Multani"},
+ {QChar::Script_OldHungarian, "Script_OldHungarian"},
+ {QChar::Script_SignWriting, "Script_SignWriting"},
+#endif // Qt 5.5
};
#endif // Qt 5.1
@@ -364,6 +373,9 @@ static const EnumLookup unicodeVersionEnumLookup[] =
#if QT_VERSION >= 0x050500
{QChar::Unicode_7_0, "Unicode_7_0"},
#endif // Qt 5.5
+#if QT_VERSION >= 0x050600
+ {QChar::Unicode_8_0, "Unicode_8_0"},
+#endif // Qt 5.6
#endif // Qt 5
};
diff --git a/tests/manual/dialogs/dialogs.pro b/tests/manual/dialogs/dialogs.pro
index 21ebf9b622..d765b8cf05 100644
--- a/tests/manual/dialogs/dialogs.pro
+++ b/tests/manual/dialogs/dialogs.pro
@@ -1,11 +1,20 @@
QT += core gui
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
+
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QT += widgets
+ qtHaveModule(printsupport): QT += printsupport
+}
TARGET = dialogs
TEMPLATE = app
SOURCES += main.cpp filedialogpanel.cpp colordialogpanel.cpp fontdialogpanel.cpp \
- wizardpanel.cpp messageboxpanel.cpp printdialogpanel.cpp utils.cpp
+ wizardpanel.cpp messageboxpanel.cpp utils.cpp
HEADERS += filedialogpanel.h colordialogpanel.h fontdialogpanel.h \
- wizardpanel.h messageboxpanel.h printdialogpanel.h utils.h
-FORMS += printdialogpanel.ui
+ wizardpanel.h messageboxpanel.h utils.h
+
+!contains(DEFINES, QT_NO_PRINTER) {
+ SOURCES += printdialogpanel.cpp
+ HEADERS += printdialogpanel.h
+ FORMS += printdialogpanel.ui
+}
diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp
new file mode 100644
index 0000000000..b203566696
--- /dev/null
+++ b/tests/manual/highdpi/dragwidget.cpp
@@ -0,0 +1,223 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2015 The Qt Company Ltd.
+ ** Contact: http://www.qt.io/licensing/
+ **
+ ** This file is part of the test suite 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 <QtWidgets>
+#include "dragwidget.h"
+
+class FramedLabel : public QLabel
+{
+public:
+ FramedLabel(const QString &text, QWidget *parent)
+ : QLabel(text, parent)
+ {
+ setAutoFillBackground(true);
+ setFrameShape(QFrame::Panel);
+ setFrameShadow(QFrame::Raised);
+ }
+};
+
+DragWidget::DragWidget(QString text, QWidget *parent)
+ : QWidget(parent), otherWindow(0)
+{
+ int x = 5;
+ int y = 5;
+
+ bool createChildWindow = text.isEmpty(); // OK, yes this is a hack...
+ if (text.isEmpty())
+ text = "You can drag from this window and drop text here";
+
+ QStringList words = text.split(' ');
+ foreach (QString word, words) {
+ if (!word.isEmpty()) {
+ FramedLabel *wordLabel = new FramedLabel(word, this);
+ wordLabel->move(x, y);
+ wordLabel->show();
+ x += wordLabel->width() + 2;
+ if (x >= 245) {
+ x = 5;
+ y += wordLabel->height() + 2;
+ }
+ }
+ }
+
+ /*
+ QPalette newPalette = palette();
+ newPalette.setColor(QPalette::Window, Qt::white);
+ setPalette(newPalette);
+ */
+
+ setAcceptDrops(true);
+ setMinimumSize(400, qMax(200, y));
+ setWindowTitle(tr("Draggable Text Window %1").arg(createChildWindow ? 1 : 2));
+ if (createChildWindow)
+ otherWindow = new DragWidget("Here is a second window that accepts drops");
+}
+
+void DragWidget::dragEnterEvent(QDragEnterEvent *event)
+{
+ if (event->mimeData()->hasText()) {
+ if (event->source() == this) {
+ event->setDropAction(Qt::MoveAction);
+ event->accept();
+ } else {
+ event->acceptProposedAction();
+ }
+ } else {
+ event->ignore();
+ }
+}
+
+void DragWidget::dragMoveEvent(QDragMoveEvent * event)
+{
+ dragPos = event->pos();
+ dragTimer.start(500, this);
+ update();
+}
+
+void DragWidget::dragLeaveEvent(QDragLeaveEvent *)
+{
+ dragTimer.stop();
+ update();
+}
+
+
+void DragWidget::dropEvent(QDropEvent *event)
+{
+ if (event->mimeData()->hasText()) {
+ const QMimeData *mime = event->mimeData();
+ QStringList pieces = mime->text().split(QRegExp("\\s+"),
+ QString::SkipEmptyParts);
+ QPoint position = event->pos();
+ QPoint hotSpot;
+
+ QList<QByteArray> hotSpotPos = mime->data("application/x-hotspot").split(' ');
+ if (hotSpotPos.size() == 2) {
+ hotSpot.setX(hotSpotPos.first().toInt());
+ hotSpot.setY(hotSpotPos.last().toInt());
+ }
+ dropPos = position - hotSpot;
+ dropTimer.start(500, this);
+ update();
+
+ foreach (QString piece, pieces) {
+ FramedLabel *newLabel = new FramedLabel(piece, this);
+ newLabel->move(position - hotSpot);
+ newLabel->show();
+
+ position += QPoint(newLabel->width(), 0);
+ }
+
+ if (event->source() == this) {
+ event->setDropAction(Qt::MoveAction);
+ event->accept();
+ } else {
+ event->acceptProposedAction();
+ }
+ } else {
+ event->ignore();
+ }
+ foreach (QObject *child, children()) {
+ if (child->inherits("QWidget")) {
+ QWidget *widget = static_cast<QWidget *>(child);
+ if (!widget->isVisible())
+ widget->deleteLater();
+ }
+ }
+}
+
+void DragWidget::mousePressEvent(QMouseEvent *event)
+{
+ QLabel *child = static_cast<QLabel*>(childAt(event->pos()));
+ if (!child)
+ return;
+
+ QPoint hotSpot = event->pos() - child->pos();
+
+ QMimeData *mimeData = new QMimeData;
+ mimeData->setText(child->text());
+ mimeData->setData("application/x-hotspot",
+ QByteArray::number(hotSpot.x()) + " " + QByteArray::number(hotSpot.y()));
+
+ QPixmap pixmap(child->size());
+ child->render(&pixmap);
+
+ QDrag *drag = new QDrag(this);
+ drag->setMimeData(mimeData);
+ drag->setPixmap(pixmap);
+ drag->setHotSpot(hotSpot);
+
+ Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
+
+ if (dropAction == Qt::MoveAction)
+ child->close();
+}
+
+void DragWidget::timerEvent(QTimerEvent *e)
+{
+ if (e->timerId() == dragTimer.timerId())
+ dragTimer.stop();
+ if (e->timerId() == dropTimer.timerId())
+ dropTimer.stop();
+ update();
+}
+
+void DragWidget::paintEvent(QPaintEvent *)
+{
+ QPainter p(this);
+ p.fillRect(rect(), Qt::white);
+
+ if (dropTimer.isActive()) {
+ p.setBrush(Qt::red);
+ p.drawEllipse(dropPos, 50, 50);
+ }
+
+ if (dragTimer.isActive()) {
+ p.setPen(QPen(Qt::blue, 5));
+ QPoint p1 = (rect().topLeft()*3 + rect().bottomRight())/4;
+ QPoint p2 = (rect().topLeft() + rect().bottomRight()*3)/4;
+ p.drawLine(p1, dragPos);
+ p.drawLine(p2, dragPos);
+ }
+}
+
+void DragWidget::showEvent(QShowEvent *)
+{
+ if (otherWindow)
+ otherWindow->show();
+}
+
+void DragWidget::hideEvent(QHideEvent *)
+{
+ if (otherWindow)
+ otherWindow->hide();
+}
diff --git a/tests/manual/highdpi/dragwidget.h b/tests/manual/highdpi/dragwidget.h
new file mode 100644
index 0000000000..0d9631e2f8
--- /dev/null
+++ b/tests/manual/highdpi/dragwidget.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2015 The Qt Company Ltd.
+ ** Contact: http://www.qt.io/licensing/
+ **
+ ** This file is part of the test suite 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 DRAGWIDGET_H
+#define DRAGWIDGET_H
+
+#include <QWidget>
+#include <QBasicTimer>
+
+QT_BEGIN_NAMESPACE
+class QDragEnterEvent;
+class QDropEvent;
+QT_END_NAMESPACE
+
+class DragWidget : public QWidget
+{
+public:
+ DragWidget(QString text = QString(), QWidget *parent = 0);
+
+protected:
+ void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
+ void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
+ void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void dragMoveEvent(QDragMoveEvent * event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
+ void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
+private:
+ QPoint dragPos;
+ QPoint dropPos;
+ QBasicTimer dragTimer;
+ QBasicTimer dropTimer;
+ QWidget *otherWindow;
+};
+
+#endif // DRAGWIDGET_H
diff --git a/tests/manual/highdpi/highdpi.pro b/tests/manual/highdpi/highdpi.pro
index 7a2979c74c..7d6b42535e 100644
--- a/tests/manual/highdpi/highdpi.pro
+++ b/tests/manual/highdpi/highdpi.pro
@@ -1,10 +1,17 @@
TEMPLATE = app
TARGET = highdpi
INCLUDEPATH += .
-QT += widgets
-CONFIG+=console
+QT += widgets gui-private
+CONFIG +=console
+CONFIG -= app_bundle
+CONFIG += c++11
# Input
-SOURCES += main.cpp
+SOURCES += \
+ dragwidget.cpp \
+ main.cpp
+
+HEADERS += \
+ dragwidget.h
RESOURCES += \
highdpi.qrc
diff --git a/tests/manual/highdpi/highdpi.qrc b/tests/manual/highdpi/highdpi.qrc
index 10efac44fa..0e33ed33d7 100644
--- a/tests/manual/highdpi/highdpi.qrc
+++ b/tests/manual/highdpi/highdpi.qrc
@@ -2,6 +2,7 @@
<qresource prefix="/">
<file>qticon16.png</file>
<file>qticon16@2x.png</file>
+ <file>qticon16@3x.png</file>
<file>qticon32.png</file>
<file>qticon32@2x.png</file>
<file>qticon64.png</file>
diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp
index fd14523a97..692a60d511 100644
--- a/tests/manual/highdpi/main.cpp
+++ b/tests/manual/highdpi/main.cpp
@@ -32,6 +32,7 @@
****************************************************************************/
#include <QMainWindow>
+#include <QMenuBar>
#include <QLabel>
#include <QHBoxLayout>
#include <QApplication>
@@ -39,6 +40,7 @@
#include <QStyle>
#include <QToolBar>
#include <QPushButton>
+#include <QButtonGroup>
#include <QLineEdit>
#include <QScrollBar>
#include <QSlider>
@@ -49,10 +51,219 @@
#include <QWindow>
#include <QScreen>
#include <QFile>
+#include <QMouseEvent>
#include <QTemporaryDir>
+#include <QTimer>
#include <QCommandLineParser>
#include <QCommandLineOption>
+#include <QDebug>
+#include <private/qhighdpiscaling_p.h>
+#include "dragwidget.h"
+
+class DemoContainerBase
+{
+public:
+ DemoContainerBase() : m_widget(0) {}
+ virtual ~DemoContainerBase() {}
+ QString name() { return option().names().first(); }
+ virtual QCommandLineOption &option() = 0;
+ virtual void makeVisible(bool visible, QWidget *parent) = 0;
+ QWidget *widget() { return m_widget; }
+protected:
+ QWidget *m_widget;
+};
+
+typedef QList<DemoContainerBase*> DemoContainerList ;
+
+
+template <class T>
+class DemoContainer : public DemoContainerBase
+{
+public:
+ DemoContainer(const QString &optionName, const QString &description)
+ : m_option(optionName, description)
+ {
+ }
+ ~DemoContainer() { delete m_widget; }
+
+ QCommandLineOption &option() { return m_option; }
+
+ void makeVisible(bool visible, QWidget *parent) {
+ if (visible && !m_widget) {
+ m_widget = new T;
+ m_widget->installEventFilter(parent);
+ }
+ if (m_widget)
+ m_widget->setVisible(visible);
+ }
+private:
+ QCommandLineOption m_option;
+};
+
+class LabelSlider : public QObject
+{
+Q_OBJECT
+public:
+ LabelSlider(QObject *parent, const QString &text, QGridLayout *layout, int row)
+ : QObject(parent)
+ {
+ QLabel *textLabel = new QLabel(text);
+ m_slider = new QSlider();
+ m_slider->setOrientation(Qt::Horizontal);
+ m_slider->setMinimum(1);
+ m_slider->setMaximum(40);
+ m_slider->setValue(10);
+ m_slider->setTracking(false);
+ m_slider->setTickInterval(5);
+ m_slider->setTickPosition(QSlider::TicksBelow);
+ m_label = new QLabel("1.0");
+
+ // set up layouts
+ layout->addWidget(textLabel, row, 0);
+ layout->addWidget(m_slider, row, 1);
+ layout->addWidget(m_label, row, 2);
+
+ // handle slider position change
+ connect(m_slider, &QSlider::sliderMoved, this, &LabelSlider::updateLabel);
+ connect(m_slider, &QSlider::valueChanged, this, &LabelSlider::valueChanged);
+ }
+ void setValue(int scaleFactor) {
+ m_slider->setValue(scaleFactor);
+ updateLabel(scaleFactor);
+ }
+private slots:
+ void updateLabel(int scaleFactor) {
+ // slider value is scale factor times ten;
+ qreal scalefactorF = qreal(scaleFactor) / 10.0;
+
+ // update label, add ".0" if needed.
+ QString number = QString::number(scalefactorF);
+ if (!number.contains("."))
+ number.append(".0");
+ m_label->setText(number);
+ }
+signals:
+ void valueChanged(int scaleFactor);
+private:
+ QSlider *m_slider;
+ QLabel *m_label;
+};
+
+static qreal getScreenFactorWithoutPixelDensity(const QScreen *screen)
+{
+ // this is a hack that relies on knowing the internals of QHighDpiScaling
+ static const char *scaleFactorProperty = "_q_scaleFactor";
+ QVariant screenFactor = screen->property(scaleFactorProperty);
+ return screenFactor.isValid() ? screenFactor.toReal() : 1.0;
+}
+
+static inline qreal getGlobalScaleFactor()
+{
+ QScreen *noScreen = 0;
+ return QHighDpiScaling::factor(noScreen);
+}
+
+class DemoController : public QWidget
+{
+Q_OBJECT
+public:
+ DemoController(DemoContainerList *demos, QCommandLineParser *parser);
+ ~DemoController();
+protected:
+ bool eventFilter(QObject *object, QEvent *event);
+ void closeEvent(QCloseEvent *) { qApp->quit(); }
+private slots:
+ void handleButton(int id, bool toggled);
+private:
+ DemoContainerList *m_demos;
+ QButtonGroup *m_group;
+};
+
+DemoController::DemoController(DemoContainerList *demos, QCommandLineParser *parser)
+ : m_demos(demos)
+{
+ setWindowTitle("screen scale factors");
+ setObjectName("controller"); // make WindowScaleFactorSetter skip this window
+
+ QGridLayout *layout = new QGridLayout;
+ setLayout(layout);
+
+ int layoutRow = 0;
+ LabelSlider *globalScaleSlider = new LabelSlider(this, "Global scale factor", layout, layoutRow++);
+ globalScaleSlider->setValue(int(getGlobalScaleFactor() * 10));
+ connect(globalScaleSlider, &LabelSlider::valueChanged, [](int scaleFactor){
+ // slider value is scale factor times ten;
+ qreal scalefactorF = qreal(scaleFactor) / 10.0;
+ QHighDpiScaling::setGlobalFactor(scalefactorF);
+ });
+
+ // set up one scale control line per screen
+ QList<QScreen *> screens = QGuiApplication::screens();
+ foreach (QScreen *screen, screens) {
+ // create scale control line
+ QSize screenSize = screen->geometry().size();
+ QString screenId = screen->name() + " " + QString::number(screenSize.width())
+ + " " + QString::number(screenSize.height());
+ LabelSlider *slider = new LabelSlider(this, screenId, layout, layoutRow++);
+ slider->setValue(getScreenFactorWithoutPixelDensity(screen) * 10);
+
+ // handle slider value change
+ connect(slider, &LabelSlider::valueChanged, [screen](int scaleFactor){
+ // slider value is scale factor times ten;
+ qreal scalefactorF = qreal(scaleFactor) / 10.0;
+
+ // set scale factor for screen
+ qreal oldFactor = QHighDpiScaling::factor(screen);
+ QHighDpiScaling::setScreenFactor(screen, scalefactorF);
+ qreal newFactor = QHighDpiScaling::factor(screen);
+
+ qDebug() << "factor was / is" << oldFactor << newFactor;
+ });
+ }
+
+ m_group = new QButtonGroup(this);
+ m_group->setExclusive(false);
+
+ for (int i = 0; i < m_demos->size(); ++i) {
+ DemoContainerBase *demo = m_demos->at(i);
+ QPushButton *button = new QPushButton(demo->name());
+ button->setToolTip(demo->option().description());
+ button->setCheckable(true);
+ layout->addWidget(button, layoutRow++, 0, 1, -1);
+ m_group->addButton(button, i);
+
+ if (parser->isSet(demo->option())) {
+ demo->makeVisible(true, this);
+ button->setChecked(true);
+ }
+ }
+ connect(m_group, SIGNAL(buttonToggled(int, bool)), this, SLOT(handleButton(int, bool)));
+}
+
+DemoController::~DemoController()
+{
+ qDeleteAll(*m_demos);
+}
+
+bool DemoController::eventFilter(QObject *object, QEvent *event)
+{
+ if (event->type() == QEvent::Close) {
+ for (int i = 0; i < m_demos->size(); ++i) {
+ DemoContainerBase *demo = m_demos->at(i);
+ if (demo->widget() == object) {
+ m_group->button(i)->setChecked(false);
+ break;
+ }
+ }
+ }
+ return false;
+}
+
+void DemoController::handleButton(int id, bool toggled)
+{
+ m_demos->at(id)->makeVisible(toggled, this);
+}
class PixmapPainter : public QWidget
{
@@ -69,7 +280,6 @@ public:
QIcon qtIcon;
};
-
PixmapPainter::PixmapPainter()
{
pixmap1X = QPixmap(":/qticon32.png");
@@ -172,15 +382,18 @@ class MainWindow : public QMainWindow
{
public:
MainWindow();
+ QMenu *addNewMenu(const QString &title, int itemCount = 5);
QIcon qtIcon;
QIcon qtIcon1x;
QIcon qtIcon2x;
QToolBar *fileToolBar;
+ int menuCount;
};
MainWindow::MainWindow()
+ :menuCount(0)
{
// beware that QIcon auto-loads the @2x versions.
qtIcon1x.addFile(":/qticon16.png");
@@ -192,8 +405,33 @@ MainWindow::MainWindow()
// fileToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
fileToolBar->addAction(new QAction(qtIcon1x, QString("1x"), this));
fileToolBar->addAction(new QAction(qtIcon2x, QString("2x"), this));
+ addNewMenu("&Edit");
+ addNewMenu("&Build");
+ addNewMenu("&Debug", 4);
+ addNewMenu("&Transmogrify", 7);
+ addNewMenu("T&ools");
+ addNewMenu("&Help", 2);
}
+
+QMenu *MainWindow::addNewMenu(const QString &title, int itemCount)
+{
+ QMenu *menu = menuBar()->addMenu(title);
+ for (int i = 0; i < itemCount; i++) {
+ menuCount++;
+ QString s = "Menu item " + QString::number(menuCount);
+ if (i == 3) {
+ QMenu *subMenu = menu->addMenu(s);
+ for (int j = 1; j < 4; j++)
+ subMenu->addAction(QString::fromLatin1("SubMenu item %1.%2").arg(menuCount).arg(j));
+ } else {
+ menu->addAction(s);
+ }
+ }
+ return menu;
+}
+
+
class StandardIcons : public QWidget
{
public:
@@ -205,7 +443,7 @@ public:
int dy = 50;
int maxX = 500;
- for (int iconIndex = QStyle::SP_TitleBarMenuButton; iconIndex < QStyle::SP_MediaVolumeMuted; ++iconIndex) {
+ for (uint iconIndex = QStyle::SP_TitleBarMenuButton; iconIndex < QStyle::SP_MediaVolumeMuted; ++iconIndex) {
QIcon icon = qApp->style()->standardIcon(QStyle::StandardPixmap(iconIndex));
QPainter p(this);
p.drawPixmap(x, y, icon.pixmap(dx - 5, dy - 5));
@@ -295,14 +533,27 @@ public:
void paintEvent(QPaintEvent *)
{
QPainter painter(this);
- int y = 40;
- for (int fontSize = 2; fontSize < 18; fontSize += 2) {
+
+ // Points
+ int y = 10;
+ for (int fontSize = 6; fontSize < 18; fontSize += 2) {
QFont font;
font.setPointSize(fontSize);
- QString string = QString(QStringLiteral("%1 The quick brown fox jumped over the lazy Doug.")).arg(fontSize);
+ QString string = QString(QStringLiteral("This text is in point size %1")).arg(fontSize);
+ painter.setFont(font);
+ y += (painter.fontMetrics().lineSpacing());
+ painter.drawText(10, y, string);
+ }
+
+ // Pixels
+ y += painter.fontMetrics().lineSpacing();
+ for (int fontSize = 6; fontSize < 18; fontSize += 2) {
+ QFont font;
+ font.setPixelSize(fontSize);
+ QString string = QString(QStringLiteral("This text is in pixel size %1")).arg(fontSize);
painter.setFont(font);
+ y += (painter.fontMetrics().lineSpacing());
painter.drawText(10, y, string);
- y += (fontSize * 2.5);
}
}
};
@@ -461,97 +712,427 @@ public:
}
};
+class LinePainter : public QWidget
+{
+public:
+ void paintEvent(QPaintEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+
+ QPoint lastMousePoint;
+ QVector<QPoint> linePoints;
+};
-int main(int argc, char **argv)
+void LinePainter::paintEvent(QPaintEvent *)
{
- QApplication app(argc, argv);
- QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
- QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QPainter p(this);
+ p.fillRect(QRect(QPoint(0, 0), size()), QBrush(Qt::gray));
- QCommandLineParser parser;
- parser.setApplicationDescription("High DPI tester");
- parser.addHelpOption();
- parser.addVersionOption();
- QCommandLineOption pixmapPainterOption("pixmap", "Test pixmap painter");
- parser.addOption(pixmapPainterOption);
- QCommandLineOption labelOption("label", "Test Labels");
- parser.addOption(labelOption);
- QCommandLineOption mainWindowOption("mainwindow", "Test QMainWindow");
- parser.addOption(mainWindowOption);
- QCommandLineOption standardIconsOption("standard-icons", "Test standard icons");
- parser.addOption(standardIconsOption);
- QCommandLineOption cachingOption("caching", "Test caching");
- parser.addOption(cachingOption);
- QCommandLineOption styleOption("styles", "Test style");
- parser.addOption(styleOption);
- QCommandLineOption fontsOption("fonts", "Test fonts");
- parser.addOption(fontsOption);
- QCommandLineOption iconDrawingOption("icondrawing", "Test icon drawing");
- parser.addOption(iconDrawingOption);
- QCommandLineOption buttonsOption("buttons", "Test buttons");
- parser.addOption(buttonsOption);
+ // Default antialiased line
+ p.setRenderHint(QPainter::Antialiasing);
+ p.drawLines(linePoints);
+
+ // Cosmetic 1 antialiased line
+ QPen pen;
+ pen.setCosmetic(true);
+ pen.setWidth(1);
+ p.setPen(pen);
+ p.translate(3, 3);
+ p.drawLines(linePoints);
+
+ // Aliased cosmetic 1 line
+ p.setRenderHint(QPainter::Antialiasing, false);
+ p.translate(3, 3);
+ p.drawLines(linePoints);
+}
- parser.process(app);
+void LinePainter::mousePressEvent(QMouseEvent *event)
+{
+ lastMousePoint = event->pos();
+}
- QScopedPointer<PixmapPainter> pixmapPainter;
- if (parser.isSet(pixmapPainterOption)) {
- pixmapPainter.reset(new PixmapPainter);
- pixmapPainter->show();
+void LinePainter::mouseReleaseEvent(QMouseEvent *)
+{
+ lastMousePoint = QPoint();
+}
+
+void LinePainter::mouseMoveEvent(QMouseEvent *event)
+{
+ if (lastMousePoint.isNull())
+ return;
+
+ QPoint newMousePoint = event->pos();
+ if (lastMousePoint == newMousePoint)
+ return;
+ linePoints.append(lastMousePoint);
+ linePoints.append(newMousePoint);
+ lastMousePoint = newMousePoint;
+ update();
+}
+
+class CursorTester : public QWidget
+{
+public:
+ CursorTester()
+ :moveLabel(0), moving(false)
+ {
}
- QScopedPointer<Labels> label;
- if (parser.isSet(labelOption)) {
- label.reset(new Labels);
- label->resize(200, 200);
- label->show();
+ inline QRect getRect(int idx) const
+ {
+ int h = height() / 2;
+ return QRect(10, 10 + h * (idx - 1), width() - 20, h - 20);
+ }
+ void paintEvent(QPaintEvent *)
+ {
+ QPainter p(this);
+ QRect r1 = getRect(1);
+ QRect r2 = getRect(2);
+ p.fillRect(r1, QColor(200, 200, 250));
+ p.drawText(r1, "Drag from here to move a window based on QCursor::pos()");
+ p.fillRect(r2, QColor(250, 200, 200));
+ p.drawText(r2, "Drag from here to move a window based on mouse event position");
+
+ if (moving) {
+ p.setPen(Qt::darkGray);
+ QFont f = font();
+ f.setPointSize(8);
+ p.setFont(f);
+ p.drawEllipse(mousePos, 30,60);
+ QPoint pt = mousePos - QPoint(0, 60);
+ QPoint pt2 = pt - QPoint(30,10);
+ QPoint offs(30, 0);
+ p.drawLine(pt, pt2);
+ p.drawLine(pt2 - offs, pt2 + offs);
+ p.drawText(pt2 - offs, "mouse pos");
+
+ p.setPen(QColor(50,130,70));
+ QPoint cursorPos = mapFromGlobal(QCursor::pos());
+ pt = cursorPos - QPoint(0, 30);
+ pt2 = pt + QPoint(60, -20);
+ p.drawEllipse(cursorPos, 60, 30);
+ p.drawLine(pt, pt2);
+ p.drawLine(pt2 - offs, pt2 + offs);
+ p.drawText(pt2 - offs, "cursor pos");
+ }
}
- QScopedPointer<MainWindow> mainWindow;
- if (parser.isSet(mainWindowOption)) {
- mainWindow.reset(new MainWindow);
- mainWindow->show();
+ void mousePressEvent(QMouseEvent *e)
+ {
+ if (moving)
+ return;
+ QRect r1 = getRect(1);
+ QRect r2 = getRect(2);
+
+ moving = r1.contains(e->pos()) || r2.contains(e->pos());
+ if (!moving)
+ return;
+ useCursorPos = r1.contains(e->pos());
+
+ if (!moveLabel)
+ moveLabel = new QLabel(this,Qt::BypassWindowManagerHint|Qt::FramelessWindowHint|Qt::Window );
+
+ if (useCursorPos)
+ moveLabel->setText("I'm following QCursor::pos()");
+ else
+ moveLabel->setText("I'm following QMouseEvent::globalPos()");
+ moveLabel->adjustSize();
+ mouseMoveEvent(e);
+ moveLabel->show();
}
- QScopedPointer<StandardIcons> icons;
- if (parser.isSet(standardIconsOption)) {
- icons.reset(new StandardIcons);
- icons->resize(510, 510);
- icons->show();
+ void mouseReleaseEvent(QMouseEvent *)
+ {
+ if (moveLabel)
+ moveLabel->hide();
+ update();
+ moving = false;
}
- QScopedPointer<Caching> caching;
- if (parser.isSet(cachingOption)) {
- caching.reset(new Caching);
- caching->resize(300, 300);
- caching->show();
+ void mouseMoveEvent(QMouseEvent *e)
+ {
+ if (!moving)
+ return;
+ QPoint pos = useCursorPos ? QCursor::pos() : e->globalPos();
+ pos -= moveLabel->rect().center();
+ moveLabel->move(pos);
+ mousePos = e->pos();
+ update();
}
- QScopedPointer<Style> style;
- if (parser.isSet(styleOption)) {
- style.reset(new Style);
- style->show();
+private:
+ QLabel *moveLabel;
+ bool useCursorPos;
+ bool moving;
+ QPoint mousePos;
+};
+
+
+class ScreenDisplayer : public QWidget
+{
+public:
+ ScreenDisplayer()
+ : QWidget(), moveLabel(0), scaleFactor(1.0)
+ {
}
- QScopedPointer<Fonts> fonts;
- if (parser.isSet(fontsOption)) {
- fonts.reset(new Fonts);
- fonts->show();
+ void timerEvent(QTimerEvent *) {
+ update();
}
- QScopedPointer<IconDrawing> iconDrawing;
- if (parser.isSet(iconDrawingOption)) {
- iconDrawing.reset(new IconDrawing);
- iconDrawing->show();
+ void mousePressEvent(QMouseEvent *) {
+ if (!moveLabel)
+ moveLabel = new QLabel(this,Qt::BypassWindowManagerHint|Qt::FramelessWindowHint|Qt::Window );
+ moveLabel->setText("Hello, Qt this is a label\nwith some text");
+ moveLabel->show();
+ }
+ void mouseMoveEvent(QMouseEvent *e) {
+ if (!moveLabel)
+ return;
+ moveLabel->move(e->pos() / scaleFactor);
+ QString str;
+ QDebug dbg(&str);
+ dbg.setAutoInsertSpaces(false);
+ dbg << moveLabel->geometry();
+ moveLabel->setText(str);
+ }
+ void mouseReleaseEvent(QMouseEvent *) {
+ if (moveLabel)
+ moveLabel->hide();
+ }
+ void showEvent(QShowEvent *) {
+ refreshTimer.start(300, this);
}
+ void hideEvent(QHideEvent *) {
+ refreshTimer.stop();
+ }
+ void paintEvent(QPaintEvent *) {
+ QPainter p(this);
+ QRectF total;
+ QList<QScreen*> screens = qApp->screens();
+ foreach (QScreen *screen, screens) {
+ total |= screen->geometry();
+ }
+ if (total.isEmpty())
+ return;
+
+ scaleFactor = qMin(width()/total.width(), height()/total.height());
+
+ p.fillRect(rect(), Qt::black);
+ p.scale(scaleFactor, scaleFactor);
+ p.translate(-total.topLeft());
+ p.setPen(QPen(Qt::white, 10));
+ p.setBrush(Qt::gray);
+
- QScopedPointer<Buttons> buttons;
- if (parser.isSet(buttonsOption)) {
- buttons.reset(new Buttons);
- buttons->show();
+ foreach (QScreen *screen, screens) {
+ p.drawRect(screen->geometry());
+ QFont f = font();
+ f.setPixelSize(screen->geometry().height() / 8);
+ p.setFont(f);
+ p.drawText(screen->geometry(), Qt::AlignCenter, screen->name());
+ }
+ p.setBrush(QColor(200,220,255,127));
+ foreach (QWidget *widget, QApplication::topLevelWidgets()) {
+ if (!widget->isHidden())
+ p.drawRect(widget->geometry());
+ }
+
+ QPolygon cursorShape;
+ cursorShape << QPoint(0,0) << QPoint(20, 60)
+ << QPoint(30, 50) << QPoint(60, 80)
+ << QPoint(80, 60) << QPoint(50, 30)
+ << QPoint(60, 20);
+ cursorShape.translate(QCursor::pos());
+ p.drawPolygon(cursorShape);
}
+private:
+ QLabel *moveLabel;
+ QBasicTimer refreshTimer;
+ qreal scaleFactor;
+};
+
+class PhysicalSizeTest : public QWidget
+{
+Q_OBJECT
+public:
+ PhysicalSizeTest() : QWidget(), m_ignoreResize(false) {}
+ void paintEvent(QPaintEvent *event);
+ void resizeEvent(QResizeEvent *) {
+ qreal ppi = window()->windowHandle()->screen()->physicalDotsPerInchX();
+ QSizeF s = size();
+ if (!m_ignoreResize)
+ m_physicalSize = s / ppi;
+ }
+ bool event(QEvent *event) {
+ if (event->type() == QEvent::ScreenChangeInternal) {
+ // we will get resize events when the scale factor changes
+ m_ignoreResize = true;
+ QTimer::singleShot(100, this, SLOT(handleScreenChange()));
+ }
+ return QWidget::event(event);
+ }
+public slots:
+ void handleScreenChange() {
+ qreal ppi = window()->windowHandle()->screen()->physicalDotsPerInchX();
+ QSizeF newSize = m_physicalSize * ppi;
+ resize(newSize.toSize());
+ m_ignoreResize = false;
+ }
+private:
+ QSizeF m_physicalSize;
+ bool m_ignoreResize;
+};
+
+void PhysicalSizeTest::paintEvent(QPaintEvent *)
+{
+ QPainter p(this);
+ p.setRenderHint(QPainter::Antialiasing);
+
+ qreal ppi = window()->windowHandle()->screen()->physicalDotsPerInchX();
+ qreal ppmm = ppi / 25.4;
+ qreal h = 15 * ppmm;
+ QRectF rulerRect(0,0, width(), h);
+ rulerRect.moveCenter(rect().center());
+
+ QFont f = font();
+ f.setPixelSize(18);
+ p.setFont(f);
+
+ // draw a rectangle in (Qt) pixel coordinates, for comparison
+ QRect pixelRect(0, 0, 300, 50);
+ pixelRect.moveTopLeft(QPoint(5 * ppmm, rulerRect.bottom() + 5 * ppmm));
+ p.fillRect(pixelRect, QColor(199,222,255));
+ p.drawText(pixelRect, "This rectangle is 300x50 pixels");
+
+ f.setPixelSize(4 * ppmm);
+ p.setFont(f);
+
+ QRectF topRect(0, 0, width(), rulerRect.top());
+ p.drawText(topRect, Qt::AlignCenter, "The ruler is drawn in physical units.\nThis window tries to keep its physical size\nwhen moved between screens.");
+
+ // draw a ruler in real physical coordinates
+
+ p.fillRect(rulerRect, QColor(255, 222, 111));
+
+ QPen linePen(Qt::black, 0.3 * ppmm);
+ p.setPen(linePen);
+ f.setBold(true);
+ p.setFont(f);
+
+ qreal vCenter = rulerRect.center().y();
+ p.drawLine(0, vCenter, width(), vCenter);
+
+ // cm
+ for (int i = 0;;) {
+ i++;
+ qreal x = i * ppmm;
+ if (x > width())
+ break;
+ qreal y = rulerRect.bottom();
+ qreal len;
+ if (i % 5)
+ len = 2 * ppmm;
+ else if (i % 10)
+ len = 3 * ppmm;
+ else
+ len = h / 2;
+
+ p.drawLine(QPointF(x, y), QPointF(x, y - len));
+ if (i % 10 == 5) {
+ QRectF textR(0, 0, 5 * ppmm, h / 2 - 2 * ppmm);
+ textR.moveTopLeft(QPointF(x, vCenter));
+ int n = i / 10 + 1;
+ if (n % 10 == 0)
+ p.setPen(Qt::red);
+ p.drawText(textR, Qt::AlignCenter, QString::number(n));
+ p.setPen(linePen);
+ }
+ }
+
+ //inches
+ for (int i = 0;;) {
+ i++;
+ qreal x = i * ppi / 16;
+ if (x > width())
+ break;
+ qreal y = rulerRect.top();
+
+ qreal d = h / 10;
+ qreal len;
+ if (i % 2)
+ len = 1 * d;
+ else if (i % 4)
+ len = 2 * d;
+ else if (i % 8)
+ len = 3 * d;
+ else if (i % 16)
+ len = 4 * d;
+ else
+ len = h / 2;
+
+ p.drawLine(QPointF(x, y), QPointF(x, y + len));
+ if (i % 16 == 12) {
+ QRectF textR(0, 0, 0.25 * ppi, h / 2 - 2 * d);
+ textR.moveBottomLeft(QPointF(x, vCenter));
+ p.drawText(textR, Qt::AlignCenter, QString::number(1 + i/16));
+ }
+ }
+
+}
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+
+ int argumentCount = QCoreApplication::arguments().count();
+
+ QCommandLineParser parser;
+ parser.setApplicationDescription("High DPI tester. Pass one or more of the options to\n"
+ "test various high-dpi aspects. \n"
+ "--interactive is a special option and opens a configuration"
+ " window.");
+ parser.addHelpOption();
+ parser.addVersionOption();
+ QCommandLineOption controllerOption("interactive", "Show configuration window.");
+ parser.addOption(controllerOption);
+
+
+ DemoContainerList demoList;
+ demoList << new DemoContainer<PixmapPainter>("pixmap", "Test pixmap painter");
+ demoList << new DemoContainer<Labels>("label", "Test Labels");
+ demoList << new DemoContainer<MainWindow>("mainwindow", "Test QMainWindow");
+ demoList << new DemoContainer<StandardIcons>("standard-icons", "Test standard icons");
+ demoList << new DemoContainer<Caching>("caching", "Test caching");
+ demoList << new DemoContainer<Style>("styles", "Test style");
+ demoList << new DemoContainer<Fonts>("fonts", "Test fonts");
+ demoList << new DemoContainer<IconDrawing>("icondrawing", "Test icon drawing");
+ demoList << new DemoContainer<Buttons>("buttons", "Test buttons");
+ demoList << new DemoContainer<LinePainter>("linepainter", "Test line painting");
+ demoList << new DemoContainer<DragWidget>("draganddrop", "Test drag and drop");
+ demoList << new DemoContainer<CursorTester>("cursorpos", "Test cursor and window positioning");
+ demoList << new DemoContainer<ScreenDisplayer>("screens", "Test screen and window positioning");
+ demoList << new DemoContainer<PhysicalSizeTest>("physicalsize", "Test manual highdpi support using physicalDotsPerInch");
+
+
+ foreach (DemoContainerBase *demo, demoList)
+ parser.addOption(demo->option());
+
+ parser.process(app);
+
+ //controller takes ownership of all demos
+ DemoController controller(&demoList, &parser);
+
+ if (parser.isSet(controllerOption) || argumentCount <= 1)
+ controller.show();
if (QApplication::topLevelWidgets().isEmpty())
parser.showHelp(0);
return app.exec();
}
+
+#include "main.moc"
diff --git a/tests/manual/highdpi/qticon16@3x.png b/tests/manual/highdpi/qticon16@3x.png
new file mode 100644
index 0000000000..de92658241
--- /dev/null
+++ b/tests/manual/highdpi/qticon16@3x.png
Binary files differ
diff --git a/tests/manual/qcursor/qcursor.pro b/tests/manual/qcursor/qcursor.pro
index af082a4b82..0b5c2b1945 100644
--- a/tests/manual/qcursor/qcursor.pro
+++ b/tests/manual/qcursor/qcursor.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = allcursors grab_override
+SUBDIRS = allcursors grab_override qcursorhighdpi
diff --git a/tests/manual/qcursor/qcursorhighdpi/main.cpp b/tests/manual/qcursor/qcursorhighdpi/main.cpp
new file mode 100644
index 0000000000..fc45ae00d1
--- /dev/null
+++ b/tests/manual/qcursor/qcursorhighdpi/main.cpp
@@ -0,0 +1,321 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 <QAction>
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QGridLayout>
+#include <QLabel>
+#include <QMainWindow>
+#include <QMenu>
+#include <QMenuBar>
+#include <QSharedPointer>
+#include <QToolBar>
+
+#include <QBitmap>
+#include <QCursor>
+#include <QPainter>
+#include <QPixmap>
+
+#include <QDebug>
+#include <QStringList>
+#include <QTextStream>
+
+#if QT_VERSION > 0x050000
+# include <QScreen>
+# include <QWindow>
+# include <private/qhighdpiscaling_p.h>
+# include <qpa/qplatformwindow.h>
+#else
+# define Q_NULLPTR 0
+# define Q_DECL_OVERRIDE
+#endif
+
+#ifdef Q_OS_WIN
+# include <qt_windows.h>
+#endif
+
+#include <algorithm>
+#include <iterator>
+
+// High DPI cursor test for testing cursor sizes in multi-screen setups.
+// It creates one widget per screen with a grid of standard cursors,
+// pixmap / bitmap cursors and pixmap / bitmap cursors with device pixel ratio 2.
+// On the left, there is a ruler with 10 DIP marks.
+// The code is meant to compile with Qt 4 also.
+
+static QString screenInfo(const QWidget *w)
+{
+ QString result;
+ QTextStream str(&result);
+#if QT_VERSION > 0x050000
+ QScreen *screen = Q_NULLPTR;
+ if (const QWindow *window = w->windowHandle())
+ screen = window->screen();
+ if (screen) {
+ str << '"' << screen->name() << "\" " << screen->size().width() << 'x'
+ << screen->size().height() << ", DPR=" << screen->devicePixelRatio()
+ << ", " << screen->logicalDotsPerInchX() << "DPI ";
+ if (QHighDpiScaling::isActive())
+ str << ", factor=" << QHighDpiScaling::factor(screen);
+ else
+ str << ", no scaling";
+ } else {
+ str << "<null>";
+ }
+#else
+ QDesktopWidget *desktop = QApplication::desktop();
+ int screenNumber = desktop->screenNumber(w);
+ str << "Screen #" <<screenNumber << ' ' << desktop->screenGeometry(screenNumber).width()
+ << 'x' << desktop->screenGeometry(screenNumber).height() << " PD: " << w->logicalDpiX() << "DPI";
+#endif
+#ifdef Q_OS_WIN
+ str << ", SM_C_CURSOR: " << GetSystemMetrics(SM_CXCURSOR) << 'x' << GetSystemMetrics(SM_CYCURSOR);
+#endif
+ return result;
+}
+
+// Helpers for painting pixmaps and creating cursors
+static QPixmap paintPixmap(int size, QColor c)
+{
+ QPixmap result(size, size);
+ result.fill(c);
+ QPainter p(&result);
+ p.drawRect(QRect(QPoint(0, 0), result.size() - QSize(1, 1)));
+ p.drawLine(0, 0, size, size);
+ p.drawLine(0, size, size, 0);
+ return result;
+}
+
+static QCursor pixmapCursor(int size)
+{
+ QCursor result(paintPixmap(size, Qt::red), size / 2, size / 2);
+ return result;
+}
+
+static QPair<QBitmap, QBitmap> paintBitmaps(int size)
+{
+ QBitmap bitmap(size, size);
+ bitmap.fill(Qt::color1);
+ QBitmap mask(size, size);
+ mask.fill(Qt::color1);
+ {
+ QPainter mp(&mask);
+ mp.fillRect(QRect(0, 0, size / 2, size / 2), Qt::color0);
+ }
+ return QPair<QBitmap, QBitmap>(bitmap, mask);
+}
+
+static QCursor bitmapCursor(int size)
+{
+ QPair<QBitmap, QBitmap> bitmaps = paintBitmaps(size);
+ return QCursor(bitmaps.first, bitmaps.second, size / 2, size / 2);
+}
+
+#if QT_VERSION > 0x050000
+static QCursor pixmapCursorDevicePixelRatio(int size, int dpr)
+{
+ QPixmap pixmap = paintPixmap(dpr * size, Qt::yellow);
+ pixmap.setDevicePixelRatio(dpr);
+ return QCursor(pixmap, size / 2, size / 2);
+}
+
+static QCursor bitmapCursorDevicePixelRatio(int size, int dpr)
+{
+ QPair<QBitmap, QBitmap> bitmaps = paintBitmaps(dpr * size);
+ bitmaps.first.setDevicePixelRatio(dpr);
+ bitmaps.second.setDevicePixelRatio(dpr);
+ return QCursor(bitmaps.first, bitmaps.second, size / 2, size / 2);
+}
+#endif // Qt 5
+
+// Vertical ruler widget with 10 px marks
+class VerticalRuler : public QWidget {
+public:
+ VerticalRuler(QWidget *parent = Q_NULLPTR);
+
+protected:
+ void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+};
+
+VerticalRuler::VerticalRuler(QWidget *parent) : QWidget(parent)
+{
+ const int screenWidth = QApplication::desktop()->screenGeometry(this).width();
+ setFixedWidth(screenWidth / 48); // 1920 pixel monitor ->40
+}
+
+void VerticalRuler::paintEvent(QPaintEvent *)
+{
+ const QSize sizeS(size());
+ const QPoint sizeP(sizeS.width(), sizeS.height());
+ const QPoint center = sizeP / 2;
+ QPainter painter(this);
+ painter.fillRect(QRect(QPoint(0, 0), sizeS), Qt::white);
+ painter.drawLine(center.x(), 0, center.x(), sizeP.y());
+ for (int y = 0; y < sizeP.y(); y += 10)
+ painter.drawLine(center.x() - 5, y, center.x() + 5, y);
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ explicit MainWindow(QWidget *parent = Q_NULLPTR);
+ void updateScreenInfo() { m_screenInfoLabel->setText(screenInfo(this)); }
+
+public slots:
+ void screenChanged() { updateScreenInfo(); }
+
+private:
+ QLabel *m_screenInfoLabel;
+};
+
+static QLabel *createCursorLabel(const QCursor &cursor, const QString &additionalText = QString())
+{
+ QString labelText;
+ QDebug(&labelText).nospace() << cursor.shape();
+#if QT_VERSION > 0x050000
+ labelText.remove(0, labelText.indexOf('(') + 1);
+ labelText.chop(1);
+#endif // Qt 5
+ if (!additionalText.isEmpty())
+ labelText += ' ' + additionalText;
+ QLabel *result = new QLabel(labelText);
+ result->setFrameShape(QFrame::Box);
+ result->setCursor(cursor);
+ return result;
+}
+
+static void addToGrid(QWidget *w, QGridLayout *gridLayout, int columnCount, int &row, int &col)
+{
+ gridLayout->addWidget(w, row, col);
+ if (col >= columnCount) {
+ col = 0;
+ row++;
+ } else {
+ col++;
+ }
+}
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+ , m_screenInfoLabel(new QLabel)
+{
+ QString title = "Cursors ";
+#if QT_VERSION > 0x050000
+ title += '(' + QGuiApplication::platformName() + ") ";
+#endif
+ title += QT_VERSION_STR;
+ setWindowTitle(title);
+
+ QMenu *fileMenu = menuBar()->addMenu("File");
+ QAction *quitAction = fileMenu->addAction("Quit");
+ quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
+ connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+
+ QToolBar *fileToolBar = addToolBar("File");
+ fileToolBar->addAction(quitAction);
+
+ QWidget *cw = new QWidget;
+ QHBoxLayout *hLayout = new QHBoxLayout(cw);
+ hLayout->addWidget(new VerticalRuler(cw));
+ QGridLayout *gridLayout = new QGridLayout;
+ hLayout->addLayout(gridLayout);
+
+ const int columnCount = 5;
+ const int size = 32;
+
+ int row = 0;
+ int col = 0;
+ for (int i = 0; i < Qt::BitmapCursor; ++i)
+ addToGrid(createCursorLabel(QCursor(static_cast<Qt::CursorShape>(i))), gridLayout, columnCount, row, col);
+
+ addToGrid(createCursorLabel(QCursor(pixmapCursor(size)),
+ QLatin1String("Plain PX ") + QString::number(size)),
+ gridLayout, columnCount, row, col);
+
+ addToGrid(createCursorLabel(bitmapCursor(size),
+ QLatin1String("Plain BM ") + QString::number(size)),
+ gridLayout, columnCount, row, col);
+
+#if QT_VERSION > 0x050000
+ addToGrid(createCursorLabel(QCursor(pixmapCursorDevicePixelRatio(size, 2)),
+ "PX with DPR 2 " + QString::number(size)),
+ gridLayout, columnCount, row, col);
+
+ addToGrid(createCursorLabel(QCursor(bitmapCursorDevicePixelRatio(size, 2)),
+ "BM with DPR 2 " + QString::number(size)),
+ gridLayout, columnCount, row, col);
+#endif // Qt 5
+
+ gridLayout->addWidget(m_screenInfoLabel, row + 1, 0, 1, columnCount);
+
+ setCentralWidget(cw);
+}
+
+typedef QSharedPointer<MainWindow> MainWindowPtr;
+typedef QList<MainWindowPtr> MainWindowPtrList;
+
+int main(int argc, char *argv[])
+{
+ QStringList arguments;
+ std::copy(argv + 1, argv + argc, std::back_inserter(arguments));
+
+#if QT_VERSION > 0x050000
+ if (arguments.contains("-s"))
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ else if (arguments.contains("-n"))
+ QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
+#endif // Qt 5
+
+ QApplication app(argc, argv);
+
+ MainWindowPtrList windows;
+
+ QDesktopWidget *desktopWidget = app.desktop();
+
+ for (int s = desktopWidget->screenCount() - 1; s >= 0; --s) {
+ MainWindowPtr window(new MainWindow(desktopWidget->screen(s)));
+ const QPoint pos = desktopWidget->screenGeometry(s).center() - QPoint(200, 100);
+ window->move(pos);
+ windows.append(window);
+ window->show();
+ window->updateScreenInfo();
+#if QT_VERSION > 0x050000
+ QObject::connect(window->windowHandle(), &QWindow::screenChanged,
+ window.data(), &MainWindow::updateScreenInfo);
+#endif
+ }
+ return app.exec();
+}
+#include "main.moc"
diff --git a/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro b/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro
new file mode 100644
index 0000000000..3a8fc25b33
--- /dev/null
+++ b/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+QT = core gui
+greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private core-private widgets
+CONFIG -= app_bundle
+SOURCES += main.cpp
+win32: LIBS += -lUser32
diff --git a/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp b/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp
index 04c9b3f72c..2792f6f1a3 100644
--- a/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp
+++ b/tests/manual/qopengltextureblitter/qopengltextureblitwindow.cpp
@@ -61,6 +61,7 @@ QOpenGLTextureBlitWindow::QOpenGLTextureBlitWindow()
m_context->makeCurrent(this);
m_blitter.create();
+ qDebug("GL_TEXTURE_EXTERNAL_OES support: %d", m_blitter.supportsExternalOESTarget());
}
void QOpenGLTextureBlitWindow::render()
@@ -132,6 +133,12 @@ void QOpenGLTextureBlitWindow::render()
m_blitter.setSwizzleRB(false);
m_blitter.release();
+ if (m_blitter.supportsExternalOESTarget()) {
+ // Cannot do much testing here, just verify that bind and release work, meaning that the program is present.
+ m_blitter.bind(0x8D65);
+ m_blitter.release();
+ }
+
m_context->swapBuffers(this);
}
diff --git a/tests/manual/qopenglwidget/openglwidget/main.cpp b/tests/manual/qopenglwidget/openglwidget/main.cpp
index aaa48ea60a..a56cea1dfe 100644
--- a/tests/manual/qopenglwidget/openglwidget/main.cpp
+++ b/tests/manual/qopenglwidget/openglwidget/main.cpp
@@ -35,13 +35,108 @@
#include <QApplication>
#include <QPushButton>
#include <QMdiArea>
+#include <QMdiSubWindow>
+#include <QMenu>
+#include <QMenuBar>
+#include <QMainWindow>
#include <QLCDNumber>
+#include <QScrollArea>
+#include <QScrollBar>
+#include <QTabWidget>
+#include <QLabel>
#include <QTimer>
#include <QSurfaceFormat>
#include <QDebug>
+#include <private/qwindow_p.h>
+
+class Tools : public QObject
+{
+ Q_OBJECT
+
+public:
+ Tools(QWidget *root, QWidget *widgetToTurn, const QVector<QWidget *> glwidgets)
+ : m_root(root), m_widgetToTurn(widgetToTurn), m_glWidgets(glwidgets) { }
+ void dump();
+
+private slots:
+ void turnNative();
+ void hideShowAllGL();
+ void dumpCompositingStatus();
+
+signals:
+ void aboutToShowGLWidgets();
+
+private:
+ void dumpWidget(QWidget *w, int indent = 0);
+
+ QWidget *m_root;
+ QWidget *m_widgetToTurn;
+ QVector<QWidget *> m_glWidgets;
+};
+
+void Tools::turnNative()
+{
+ qDebug("Turning into native");
+ m_widgetToTurn->winId();
+ dump();
+}
+
+void Tools::hideShowAllGL()
+{
+ if (m_glWidgets[0]->isVisible()) {
+ qDebug("Hiding all render-to-texture widgets");
+ foreach (QWidget *w, m_glWidgets)
+ w->hide();
+ } else {
+ qDebug("Showing all render-to-texture widgets");
+ emit aboutToShowGLWidgets();
+ foreach (QWidget *w, m_glWidgets)
+ w->show();
+ }
+}
+
+void Tools::dump()
+{
+ qDebug() << "Widget hierarchy";
+ dumpWidget(m_root);
+ qDebug() << "========";
+}
+
+void Tools::dumpWidget(QWidget *w, int indent)
+{
+ QString indentStr;
+ indentStr.fill(' ', indent);
+ qDebug().noquote() << indentStr << w << "winId =" << w->internalWinId();
+ foreach (QObject *obj, w->children()) {
+ if (QWidget *cw = qobject_cast<QWidget *>(obj))
+ dumpWidget(cw, indent + 4);
+ }
+}
+
+void Tools::dumpCompositingStatus()
+{
+ QWindow *w = m_root->window()->windowHandle();
+ qDebug() << "Compositing status for" << w << m_root->window() << "is" << QWindowPrivate::get(w)->compositing;
+}
+
+class TabWidgetResetter : public QObject
+{
+ Q_OBJECT
+public:
+ TabWidgetResetter(QTabWidget *tw) : m_tw(tw) { }
+public slots:
+ void reset() { m_tw->setCurrentIndex(0); }
+private:
+ QTabWidget *m_tw;
+};
int main(int argc, char *argv[])
{
+ if (argc > 1 && !strcmp(argv[1], "--sharecontext")) {
+ qDebug("Requesting all contexts to share");
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+ }
+
QApplication a(argc, argv);
QSurfaceFormat format;
@@ -53,28 +148,86 @@ int main(int argc, char *argv[])
}
qDebug() << "Requesting" << format;
- QMdiArea w;
- w.resize(400,400);
+ QMainWindow wnd;
+ wnd.setObjectName("Main Window");
+ wnd.resize(1024, 768);
+
+ QMdiArea *w = new QMdiArea;
+ w->setObjectName("MDI area");
+ w->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ wnd.setCentralWidget(w);
- OpenGLWidget *glw = new OpenGLWidget;
+ OpenGLWidget *glw = new OpenGLWidget(33, QVector3D(0, 0, 1));
+ glw->setObjectName("First GL Widget with 33 ms timer");
glw->setFormat(format);
- w.addSubWindow(glw);
- glw->setMinimumSize(100,100);
+ glw->setMinimumSize(100, 100);
+ QMdiSubWindow *sw = w->addSubWindow(glw);
+ sw->setObjectName("First MDI Sub-Window");
+ sw->setWindowTitle("33 ms timer");
- OpenGLWidget *glw2 = new OpenGLWidget;
+ OpenGLWidget *glw2 = new OpenGLWidget(16);
+ glw2->setObjectName("Second GL Widget with 16 ms timer");
glw2->setFormat(format);
- glw2->setMinimumSize(100,100);
- w.addSubWindow(glw2);
+ glw2->setMinimumSize(100, 100);
+ QOpenGLWidget *glw22 = new OpenGLWidget(16);
+ glw22->setObjectName("Second #2 GLWidget");
+ glw22->setParent(glw2);
+ glw22->resize(40, 40);
+ sw = w->addSubWindow(glw2);
+ sw->setObjectName("Second MDI Sub-Window");
+ sw->setWindowTitle("16 ms timer");
+
+ OpenGLWidget *glw3 = new OpenGLWidget(0); // trigger updates continuously, no timer
+ glw3->setObjectName("GL widget in scroll area (possibly native)");
+ glw3->setFormat(format);
+ glw3->setFixedSize(600, 600);
+ QScrollArea *sa = new QScrollArea;
+ sa->setWidget(glw3);
+ sa->setMinimumSize(100, 100);
+ sa->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ sw = w->addSubWindow(sa);
+ sw->setObjectName("MDI Sub-Window for scroll area");
+ sw->setWindowTitle("Cont. update");
+ sw->resize(300, 300);
+ sa->verticalScrollBar()->setValue(300);
QLCDNumber *lcd = new QLCDNumber;
lcd->display(1337);
- lcd->setMinimumSize(300,100);
- w.addSubWindow(lcd);
+ lcd->setMinimumSize(300, 100);
+ sw = w->addSubWindow(lcd);
+ sw->setObjectName("MDI Sub-Window for LCD widget");
+ sw->setWindowTitle("Ordinary widget");
+
+ QTabWidget *tw = new QTabWidget;
+ QOpenGLWidget *glw4 = new OpenGLWidget(16, QVector3D(1, 0, 0));
+ glw4->setObjectName("GL widget in tab widget");
+ tw->addTab(glw4, "OpenGL");
+ QLabel *label = new QLabel("Another tab");
+ tw->addTab(label, "Not OpenGL");
+ tw->setMinimumSize(100, 100);
+ sw = w->addSubWindow(tw);
+ sw->setObjectName("MDI Sub-Window for tab widget");
+ sw->setWindowTitle("Tabs");
- w.show();
+ TabWidgetResetter twr(tw);
+ Tools t(&wnd, glw3, QVector<QWidget *>() << glw << glw2 << glw3 << glw4);
+ QObject::connect(&t, SIGNAL(aboutToShowGLWidgets()), &twr, SLOT(reset()));
+ QMenu *toolsMenu = wnd.menuBar()->addMenu("&Tools");
+ toolsMenu->addAction("&Turn widgets (or some parent) into native", &t, SLOT(turnNative()));
+ toolsMenu->addAction("&Hide/show all OpenGL widgets", &t, SLOT(hideShowAllGL()));
+
+ QTimer compStatusDumpTimer;
+ QObject::connect(&compStatusDumpTimer, SIGNAL(timeout()), &t, SLOT(dumpCompositingStatus()));
+ compStatusDumpTimer.start(5000);
+
+ wnd.show();
if (glw->isValid())
qDebug() << "Got" << glw->format();
+ t.dump();
+
return a.exec();
}
+
+#include "main.moc"
diff --git a/tests/manual/qopenglwidget/openglwidget/openglwidget.cpp b/tests/manual/qopenglwidget/openglwidget/openglwidget.cpp
index d47e12edc8..4d2463b84d 100644
--- a/tests/manual/qopenglwidget/openglwidget/openglwidget.cpp
+++ b/tests/manual/qopenglwidget/openglwidget/openglwidget.cpp
@@ -75,16 +75,23 @@ public:
int w,h;
QWidget *q;
+
+ int m_interval;
+ QVector3D m_rotAxis;
};
-OpenGLWidget::OpenGLWidget(QWidget *parent)
+OpenGLWidget::OpenGLWidget(int interval, const QVector3D &rotAxis, QWidget *parent)
: QOpenGLWidget(parent)
{
- d = new OpenGLWidgetPrivate(this);
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(update()));
- timer->start(30);
+ d.reset(new OpenGLWidgetPrivate(this));
+ d->m_interval = interval;
+ d->m_rotAxis = rotAxis;
+ if (interval > 0) {
+ QTimer *timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(update()));
+ timer->start(interval);
+ }
}
OpenGLWidget::~OpenGLWidget()
@@ -152,7 +159,8 @@ void OpenGLWidgetPrivate::render()
QMatrix4x4 matrix;
matrix.perspective(60.0f, 4.0f/3.0f, 0.1f, 100.0f);
matrix.translate(0, 0, -2);
- matrix.rotate(100.0f * m_frame / 30/*screen()->refreshRate()*/, 0, 1, 0);
+ const qreal angle = 100.0f * m_frame / 30;
+ matrix.rotate(angle, m_rotAxis);
m_program->setUniformValue(m_matrixUniform, matrix);
@@ -182,4 +190,7 @@ void OpenGLWidgetPrivate::render()
m_program->release();
++m_frame;
+
+ if (m_interval <= 0)
+ q->update();
}
diff --git a/tests/manual/qopenglwidget/openglwidget/openglwidget.h b/tests/manual/qopenglwidget/openglwidget/openglwidget.h
index 4dc5fde067..a1d5490845 100644
--- a/tests/manual/qopenglwidget/openglwidget/openglwidget.h
+++ b/tests/manual/qopenglwidget/openglwidget/openglwidget.h
@@ -35,13 +35,14 @@
#define OPENGLWIDGET_H
#include <QtWidgets/QOpenGLWidget>
+#include <QtGui/QVector3D>
class OpenGLWidgetPrivate;
class OpenGLWidget : public QOpenGLWidget
{
Q_OBJECT
public:
- OpenGLWidget(QWidget *parent = 0);
+ OpenGLWidget(int interval = 30, const QVector3D &rotAxis = QVector3D(0, 1, 0), QWidget *parent = 0);
~OpenGLWidget();
void initializeGL();
@@ -49,7 +50,7 @@ public:
void paintGL();
private:
- OpenGLWidgetPrivate *d;
+ QScopedPointer<OpenGLWidgetPrivate> d;
};
#endif // OPENGLWIDGET_H
diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp
index 1047ffcdfc..298996a59b 100644
--- a/tests/manual/qscreen/main.cpp
+++ b/tests/manual/qscreen/main.cpp
@@ -36,23 +36,127 @@
#include <QScreen>
#include <QWindow>
#include <QDebug>
+#include <QTextStream>
#include <QFormLayout>
+#include <QMainWindow>
+#include <QMenu>
+#include <QMenuBar>
+#include <QAction>
+#include <QStatusBar>
#include <QLineEdit>
#include <QDesktopWidget>
-int i = 0;
+class ScreenPropertyWatcher : public PropertyWatcher
+{
+ Q_OBJECT
+public:
+ ScreenPropertyWatcher(QWidget *wp = Q_NULLPTR) : PropertyWatcher(Q_NULLPTR, QString(), wp)
+ {
+ // workaround for the fact that virtualSiblings is not a property,
+ // thus there is no change notification:
+ // allow the user to update the field manually
+ connect(this, &PropertyWatcher::updatedAllFields, this, &ScreenPropertyWatcher::updateSiblings);
+ }
+
+ QScreen *screenSubject() const { return qobject_cast<QScreen *>(subject()); }
+ void setScreenSubject(QScreen *s, const QString &annotation = QString())
+ {
+ setSubject(s, annotation);
+ updateSiblings();
+ }
-typedef QHash<QScreen*, PropertyWatcher*> ScreensHash;
-Q_GLOBAL_STATIC(ScreensHash, props);
+public slots:
+ void updateSiblings();
+};
-void updateSiblings(PropertyWatcher* w)
+void ScreenPropertyWatcher::updateSiblings()
{
- QLineEdit *siblingsField = w->findChild<QLineEdit *>("siblings");
- QScreen* screen = (QScreen*)w->subject();
- QStringList siblingsList;
- foreach (QScreen *sibling, screen->virtualSiblings())
- siblingsList << sibling->name();
- siblingsField->setText(siblingsList.join(", "));
+ const QScreen *screen = screenSubject();
+ if (!screen)
+ return;
+ const QString objectName = QLatin1String("siblings");
+ QLineEdit *siblingsField = findChild<QLineEdit *>(objectName);
+ if (!siblingsField) {
+ siblingsField = new QLineEdit(this);
+ siblingsField->setObjectName(objectName);
+ siblingsField->setReadOnly(true);
+ formLayout()->insertRow(0, QLatin1String("virtualSiblings"), siblingsField);
+ }
+ QString text;
+ foreach (const QScreen *sibling, screen->virtualSiblings()) {
+ if (!text.isEmpty())
+ text += QLatin1String(", ");
+ text += sibling->name();
+ }
+ siblingsField->setText(text);
+}
+
+class ScreenWatcherMainWindow : public QMainWindow
+{
+ Q_OBJECT
+public:
+ explicit ScreenWatcherMainWindow(QScreen *screen);
+
+ QScreen *screenSubject() const { return m_watcher->screenSubject(); }
+
+protected:
+ bool event(QEvent *event) Q_DECL_OVERRIDE;
+
+private:
+ const QString m_annotation;
+ ScreenPropertyWatcher *m_watcher;
+};
+
+static int i = 0;
+
+ScreenWatcherMainWindow::ScreenWatcherMainWindow(QScreen *screen)
+ : m_annotation(QLatin1Char('#') + QString::number(i++))
+ , m_watcher(new ScreenPropertyWatcher(this))
+{
+ setAttribute(Qt::WA_DeleteOnClose);
+ setCentralWidget(m_watcher);
+ m_watcher->setScreenSubject(screen, m_annotation);
+
+ QMenu *fileMenu = menuBar()->addMenu(QLatin1String("&File"));
+ QAction *a = fileMenu->addAction(QLatin1String("Close"));
+ a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W));
+ connect(a, SIGNAL(triggered()), this, SLOT(close()));
+ a = fileMenu->addAction(QLatin1String("Quit"));
+ a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
+ connect(a, SIGNAL(triggered()), qApp, SLOT(quit()));
+}
+
+static inline QString msgScreenChange(const QWidget *w, const QScreen *oldScreen, const QScreen *newScreen)
+{
+ QString result;
+ const QRect geometry = w->geometry();
+ const QPoint pos = QCursor::pos();
+ if (!newScreen) {
+ result = QLatin1String("Screen changed --> null");
+ } else if (!oldScreen) {
+ QTextStream(&result) << "Screen changed null --> \""
+ << newScreen->name() << "\" at " << pos.x() << ',' << pos.y() << " geometry: "
+ << geometry.width() << 'x' << geometry.height() << forcesign << geometry.x()
+ << geometry.y() << '.';
+ } else {
+ QTextStream(&result) << "Screen changed \"" << oldScreen->name() << "\" --> \""
+ << newScreen->name() << "\" at " << pos.x() << ',' << pos.y() << " geometry: "
+ << geometry.width() << 'x' << geometry.height() << forcesign << geometry.x()
+ << geometry.y() << '.';
+ }
+ return result;
+}
+
+bool ScreenWatcherMainWindow::event(QEvent *event)
+{
+ if (event->type() == QEvent::ScreenChangeInternal) {
+ QScreen *newScreen = windowHandle()->screen();
+ const QString message = msgScreenChange(this, m_watcher->screenSubject(), newScreen);
+ qDebug().noquote() << message;
+ statusBar()->showMessage(message);
+ m_watcher->setScreenSubject(newScreen, m_annotation);
+ }
+ return QMainWindow::event(event);
}
void screenAdded(QScreen* screen)
@@ -60,12 +164,7 @@ void screenAdded(QScreen* screen)
screen->setOrientationUpdateMask((Qt::ScreenOrientations)0x0F);
qDebug("\nscreenAdded %s siblings %d first %s", qPrintable(screen->name()), screen->virtualSiblings().count(),
(screen->virtualSiblings().isEmpty() ? "none" : qPrintable(screen->virtualSiblings().first()->name())));
- PropertyWatcher *w = new PropertyWatcher(screen, QString::number(i++));
- QLineEdit *siblingsField = new QLineEdit();
- siblingsField->setObjectName("siblings");
- siblingsField->setReadOnly(true);
- w->layout()->insertRow(0, "virtualSiblings", siblingsField);
- updateSiblings(w);
+ ScreenWatcherMainWindow *w = new ScreenWatcherMainWindow(screen);
// Set the screen via QDesktopWidget. This corresponds to setScreen() for the underlying
// QWindow. This is essential when having separate X screens since the the positioning below is
@@ -84,18 +183,17 @@ void screenAdded(QScreen* screen)
geom.setHeight(screen->geometry().height() * 9 / 10);
geom.moveCenter(screen->geometry().center());
w->setGeometry(geom);
-
- props->insert(screen, w);
-
- // workaround for the fact that virtualSiblings is not a property,
- // thus there is no change notification:
- // allow the user to update the field manually
- QObject::connect(w, &PropertyWatcher::updatedAllFields, &updateSiblings);
}
void screenRemoved(QScreen* screen)
{
- delete props->take(screen);
+ const QWidgetList topLevels = QApplication::topLevelWidgets();
+ for (int i = topLevels.size() - 1; i >= 0; --i) {
+ if (ScreenWatcherMainWindow *sw = qobject_cast<ScreenWatcherMainWindow *>(topLevels.at(i))) {
+ if (sw->screenSubject() == screen)
+ sw->close();
+ }
+ }
}
int main(int argc, char *argv[])
@@ -108,3 +206,5 @@ int main(int argc, char *argv[])
QObject::connect((const QGuiApplication*)QGuiApplication::instance(), &QGuiApplication::screenRemoved, &screenRemoved);
return a.exec();
}
+
+#include "main.moc"
diff --git a/tests/manual/qscreen/propertywatcher.cpp b/tests/manual/qscreen/propertywatcher.cpp
index cfb5ea272d..b745ef5125 100644
--- a/tests/manual/qscreen/propertywatcher.cpp
+++ b/tests/manual/qscreen/propertywatcher.cpp
@@ -35,33 +35,82 @@
#include <QMetaProperty>
#include <QFormLayout>
#include <QPushButton>
+#include <QLabel>
#include "propertyfield.h"
PropertyWatcher::PropertyWatcher(QObject *subject, QString annotation, QWidget *parent)
- : QWidget(parent), m_subject(subject), m_layout(new QFormLayout)
+ : QWidget(parent), m_subject(Q_NULLPTR), m_formLayout(new QFormLayout(this))
{
- setWindowTitle(QString("Properties of %1 %2 %3")
- .arg(subject->metaObject()->className()).arg(subject->objectName()).arg(annotation));
setMinimumSize(450, 300);
+ m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
+ setSubject(subject, annotation);
+}
+
+class UpdatesEnabledBlocker
+{
+ Q_DISABLE_COPY(UpdatesEnabledBlocker);
+public:
+ explicit UpdatesEnabledBlocker(QWidget *w) : m_widget(w)
+ {
+ m_widget->setUpdatesEnabled(false);
+ }
+ ~UpdatesEnabledBlocker()
+ {
+ m_widget->setUpdatesEnabled(true);
+ m_widget->update();
+ }
+
+private:
+ QWidget *m_widget;
+};
+
+void PropertyWatcher::setSubject(QObject *s, const QString &annotation)
+{
+ if (s == m_subject)
+ return;
+
+ UpdatesEnabledBlocker blocker(this);
+
+ if (m_subject) {
+ disconnect(m_subject, &QObject::destroyed, this, &PropertyWatcher::subjectDestroyed);
+ for (int i = m_formLayout->count() - 1; i >= 0; --i) {
+ QLayoutItem *item = m_formLayout->takeAt(i);
+ delete item->widget();
+ delete item;
+ }
+ window()->setWindowTitle(QString());
+ window()->setWindowIconText(QString());
+ }
+
+ m_subject = s;
+ if (!m_subject)
+ return;
+
const QMetaObject* meta = m_subject->metaObject();
+ QString title = QLatin1String("Properties ") + QLatin1String(meta->className());
+ if (!m_subject->objectName().isEmpty())
+ title += QLatin1Char(' ') + m_subject->objectName();
+ if (!annotation.isEmpty())
+ title += QLatin1Char(' ') + annotation;
+ window()->setWindowTitle(title);
- for (int i = 0; i < meta->propertyCount(); ++i) {
- QMetaProperty prop = meta->property(i);
+ for (int i = 0, count = meta->propertyCount(); i < count; ++i) {
+ const QMetaProperty prop = meta->property(i);
if (prop.isReadable()) {
- PropertyField* field = new PropertyField(m_subject, prop);
- m_layout->addRow(prop.name(), field);
+ QLabel *label = new QLabel(prop.name(), this);
+ PropertyField *field = new PropertyField(m_subject, prop, this);
+ m_formLayout->addRow(label, field);
+ if (!qstrcmp(prop.name(), "name"))
+ window()->setWindowIconText(prop.read(m_subject).toString());
+ label->setVisible(true);
+ field->setVisible(true);
}
}
- QPushButton *updateButton = new QPushButton("update");
- connect(updateButton, &QPushButton::clicked, this, &PropertyWatcher::updateAllFields);
- m_layout->addRow("", updateButton);
- m_layout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
- setLayout(m_layout);
- connect(subject, &QObject::destroyed, this, &PropertyWatcher::subjectDestroyed);
-}
+ connect(m_subject, &QObject::destroyed, this, &PropertyWatcher::subjectDestroyed);
-PropertyWatcher::~PropertyWatcher()
-{
+ QPushButton *updateButton = new QPushButton(QLatin1String("Update"), this);
+ connect(updateButton, &QPushButton::clicked, this, &PropertyWatcher::updateAllFields);
+ m_formLayout->addRow(QString(), updateButton);
}
void PropertyWatcher::updateAllFields()
diff --git a/tests/manual/qscreen/propertywatcher.h b/tests/manual/qscreen/propertywatcher.h
index 7dccfe3672..01e448845a 100644
--- a/tests/manual/qscreen/propertywatcher.h
+++ b/tests/manual/qscreen/propertywatcher.h
@@ -44,10 +44,12 @@ class PropertyWatcher : public QWidget
Q_OBJECT
public:
- PropertyWatcher(QObject* subject, QString annotation = QString(), QWidget *parent = 0);
- ~PropertyWatcher();
- QFormLayout *layout() { return m_layout; }
- QObject* subject() { return m_subject; }
+ explicit PropertyWatcher(QObject* subject = Q_NULLPTR, QString annotation = QString(), QWidget *parent = Q_NULLPTR);
+
+ QFormLayout *formLayout() { return m_formLayout; }
+
+ QObject *subject() const { return m_subject; }
+ void setSubject(QObject *s, const QString &annotation = QString());
public slots:
void updateAllFields();
@@ -56,9 +58,9 @@ public slots:
signals:
void updatedAllFields(PropertyWatcher* sender);
-protected:
+private:
QObject* m_subject;
- QFormLayout * m_layout;
+ QFormLayout * m_formLayout;
};
#endif // PROPERTY_WATCHER_H
diff --git a/tests/manual/qscreen/qscreen.pro b/tests/manual/qscreen/qscreen.pro
index cec8bbf245..5d587db3f4 100644
--- a/tests/manual/qscreen/qscreen.pro
+++ b/tests/manual/qscreen/qscreen.pro
@@ -1,4 +1,5 @@
QT += core gui widgets
+CONFIG += console
TARGET = qscreen
TEMPLATE = app
diff --git a/tests/manual/qsysinfo/main.cpp b/tests/manual/qsysinfo/main.cpp
index a3f21140cb..9456bd9b03 100644
--- a/tests/manual/qsysinfo/main.cpp
+++ b/tests/manual/qsysinfo/main.cpp
@@ -134,6 +134,7 @@ int main(int argc, char *argv[])
printf("QSysInfo::productType() = %s\n", qPrintable(QSysInfo::productType()));
printf("QSysInfo::productVersion() = %s\n", qPrintable(QSysInfo::productVersion()));
printf("QSysInfo::prettyProductName() = %s\n", qPrintable(QSysInfo::prettyProductName()));
+ printf("QSysInfo::machineHostName() = %s\n", qPrintable(QSysInfo::machineHostName()));
return 0;
}
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
index 2e4cb6658f..f1d838f01d 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
@@ -73,6 +73,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev)
mRot = event->rotation();
mButton = event->button();
mButtons = event->buttons();
+ mTimestamp = event->timestamp();
if (isVisible())
update();
break;
@@ -84,6 +85,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev)
mType = event->type();
mPos = event->pos();
mGPos = event->globalPos();
+ mTimestamp = event->timestamp();
}
default:
break;
@@ -122,6 +124,7 @@ void TabletWidget::paintEvent(QPaintEvent *)
eventInfo << QString("Global position: %1 %2").arg(QString::number(mGPos.x()), QString::number(mGPos.y()));
eventInfo << QString("Local position: %1 %2").arg(QString::number(mPos.x()), QString::number(mPos.y()));
+ eventInfo << QString("Timestamp: %1").arg(QString::number(mTimestamp));
if (mType == QEvent::TabletEnterProximity || mType == QEvent::TabletLeaveProximity
|| mType == QEvent::TabletMove || mType == QEvent::TabletPress
|| mType == QEvent::TabletRelease) {
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.h b/tests/manual/qtabletevent/device_information/tabletwidget.h
index 2861eb4814..95631be57b 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.h
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.h
@@ -65,6 +65,7 @@ private:
qreal mPress, mTangential, mRot;
qint64 mUnique;
bool mMouseToo;
+ ulong mTimestamp;
};
#endif // TABLETWIDGET_H
diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
index 5a83decfa2..a6fddd4b18 100644
--- a/tests/manual/qtabletevent/regular_widgets/main.cpp
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -39,6 +39,7 @@
#include <QMenuBar>
#include <QMenu>
#include <QAction>
+#include <QStatusBar>
#include <QVector>
#include <QPainter>
#include <QCursor>
@@ -72,6 +73,9 @@ public:
public slots:
void clearPoints() { m_points.clear(); update(); }
+signals:
+ void stats(QString s);
+
protected:
void mouseDoubleClickEvent(QMouseEvent *event) { outputMouseEvent(event); }
void mouseMoveEvent(QMouseEvent *event) { outputMouseEvent(event); }
@@ -81,6 +85,7 @@ protected:
void tabletEvent(QTabletEvent *);
void paintEvent(QPaintEvent *);
+ void timerEvent(QTimerEvent *);
private:
void outputMouseEvent(QMouseEvent *event);
@@ -89,28 +94,36 @@ private:
bool m_lastIsTabletMove;
Qt::MouseButton m_lastButton;
QVector<TabletPoint> m_points;
+ int m_tabletMoveCount;
+ int m_paintEventCount;
};
EventReportWidget::EventReportWidget()
: m_lastIsMouseMove(false)
, m_lastIsTabletMove(false)
, m_lastButton(Qt::NoButton)
-{ }
+ , m_tabletMoveCount(0)
+ , m_paintEventCount(0)
+{
+ startTimer(1000);
+}
void EventReportWidget::paintEvent(QPaintEvent *)
{
QPainter p(this);
+ int lineSpacing = fontMetrics().lineSpacing();
+ int halfLineSpacing = lineSpacing / 2;
const QRectF geom = QRectF(QPoint(0, 0), size());
p.fillRect(geom, Qt::white);
p.drawRect(QRectF(geom.topLeft(), geom.bottomRight() - QPointF(1,1)));
p.setPen(Qt::white);
QPainterPath ellipse;
- ellipse.addEllipse(0, 0, 50, 10);
+ ellipse.addEllipse(0, 0, halfLineSpacing * 5, halfLineSpacing);
foreach (const TabletPoint &t, m_points) {
if (geom.contains(t.pos)) {
QPainterPath pp;
- pp.addEllipse(t.pos, 8, 8);
- QRectF pointBounds(t.pos.x() - 10, t.pos.y() - 10, 20, 20);
+ pp.addEllipse(t.pos, halfLineSpacing, halfLineSpacing);
+ QRectF pointBounds(t.pos.x() - halfLineSpacing, t.pos.y() - halfLineSpacing, lineSpacing, lineSpacing);
switch (t.type) {
case TabletButtonPress:
p.fillPath(pp, Qt::darkGreen);
@@ -133,7 +146,7 @@ void EventReportWidget::paintEvent(QPaintEvent *)
p.drawPath(ellipse);
p.restore();
} else {
- p.drawEllipse(t.pos, t.pressure * 10.0, t.pressure * 10.0);
+ p.drawEllipse(t.pos, t.pressure * halfLineSpacing, t.pressure * halfLineSpacing);
}
p.setPen(Qt::white);
} else {
@@ -143,6 +156,7 @@ void EventReportWidget::paintEvent(QPaintEvent *)
}
}
}
+ ++m_paintEventCount;
}
void EventReportWidget::tabletEvent(QTabletEvent *event)
@@ -152,11 +166,13 @@ void EventReportWidget::tabletEvent(QTabletEvent *event)
switch (event->type()) {
case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity:
+ qDebug() << "proximity" << event;
break;
case QEvent::TabletMove:
m_points.push_back(TabletPoint(event->pos(), TabletMove, m_lastButton, event->pointerType(), event->pressure(), event->rotation()));
update();
isMove = true;
+ ++m_tabletMoveCount;
break;
case QEvent::TabletPress:
m_points.push_back(TabletPoint(event->pos(), TabletButtonPress, event->button(), event->pointerType(), event->rotation()));
@@ -192,6 +208,13 @@ void EventReportWidget::outputMouseEvent(QMouseEvent *event)
qDebug() << event;
}
+void EventReportWidget::timerEvent(QTimerEvent *)
+{
+ emit stats(QString("%1 moves/sec, %2 frames/sec").arg(m_tabletMoveCount).arg(m_paintEventCount));
+ m_tabletMoveCount = 0;
+ m_paintEventCount = 0;
+}
+
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
@@ -201,6 +224,7 @@ int main(int argc, char *argv[])
widget->setMinimumSize(640, 480);
QMenu *fileMenu = mainWindow.menuBar()->addMenu("File");
QObject::connect(fileMenu->addAction("Clear"), SIGNAL(triggered()), widget, SLOT(clearPoints()));
+ QObject::connect(widget, SIGNAL(stats(QString)), mainWindow.statusBar(), SLOT(showMessage(QString)));
QAction *quitAction = fileMenu->addAction("Quit");
QObject::connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp
index e1114d7f57..b7029767c9 100644
--- a/tests/manual/touch/main.cpp
+++ b/tests/manual/touch/main.cpp
@@ -32,21 +32,187 @@
****************************************************************************/
#include <QApplication>
+#include <QGesture>
#include <QLabel>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QMainWindow>
#include <QSplitter>
+#include <QToolBar>
#include <QVector>
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QPlainTextEdit>
+#include <QPainter>
+#include <QPainterPath>
#include <QPaintEvent>
#include <QScreen>
+#include <QSharedPointer>
#include <QDebug>
#include <QTextStream>
+bool optIgnoreTouch = false;
+QVector<Qt::GestureType> optGestures;
+
+static inline void drawCircle(const QPointF &center, qreal radius, const QColor &color, QPainter &painter)
+{
+ const QPen oldPen = painter.pen();
+ QPen pen = oldPen;
+ pen.setColor(color);
+ painter.setPen(pen);
+ painter.drawEllipse(center, radius, radius);
+ painter.setPen(oldPen);
+}
+
+static inline void fillCircle(const QPointF &center, qreal radius, const QColor &color, QPainter &painter)
+{
+ QPainterPath painterPath;
+ painterPath.addEllipse(center, radius, radius);
+ painter.fillPath(painterPath, color);
+}
+
+// Draws an arrow assuming a mathematical coordinate system, Y axis pointing
+// upwards, angle counterclockwise (that is, 45' is pointing up/right).
+static void drawArrow(const QPointF &center, qreal length, qreal angleDegrees,
+ const QColor &color, int arrowSize, QPainter &painter)
+{
+ painter.save();
+ painter.translate(center); // Transform center to (0,0) rotate and draw arrow pointing right.
+ painter.rotate(-angleDegrees);
+ QPen pen = painter.pen();
+ pen.setColor(color);
+ pen.setWidth(2);
+ painter.setPen(pen);
+ const QPointF endPoint(length, 0);
+ painter.drawLine(QPointF(0, 0), endPoint);
+ painter.drawLine(endPoint, endPoint + QPoint(-arrowSize, -arrowSize));
+ painter.drawLine(endPoint, endPoint + QPoint(-arrowSize, arrowSize));
+ painter.restore();
+}
+
+QDebug operator<<(QDebug debug, const QTouchDevice *d)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QTouchDevice(" << d->name() << ',';
+ switch (d->type()) {
+ case QTouchDevice::TouchScreen:
+ debug << "TouchScreen";
+ break;
+ case QTouchDevice::TouchPad:
+ debug << "TouchPad";
+ break;
+ }
+ debug << ", capabilities=" << d->capabilities()
+ << ", maximumTouchPoints=" << d->maximumTouchPoints() << ')';
+ return debug;
+}
+
+// Hierarchy of classes containing gesture parameters and drawing functionality.
+class Gesture {
+ Q_DISABLE_COPY(Gesture)
+public:
+ static Gesture *fromQGesture(const QWidget *w, const QGesture *source);
+ virtual ~Gesture() {}
+
+ virtual void draw(const QRectF &rect, QPainter &painter) const = 0;
+
+protected:
+ explicit Gesture(const QWidget *w, const QGesture *source) : m_type(source->gestureType())
+ , m_hotSpot(w->mapFromGlobal(source->hotSpot().toPoint()))
+ , m_hasHotSpot(source->hasHotSpot()) {}
+
+ QPointF drawHotSpot(const QRectF &rect, QPainter &painter) const
+ {
+ const QPointF h = m_hasHotSpot ? m_hotSpot : rect.center();
+ painter.drawEllipse(h, 15, 15);
+ return h;
+ }
+
+private:
+ Qt::GestureType m_type;
+ QPointF m_hotSpot;
+ bool m_hasHotSpot;
+};
+
+class PanGesture : public Gesture {
+public:
+ explicit PanGesture(const QWidget *w, const QPanGesture *source) : Gesture(w, source)
+ , m_offset(source->offset()) {}
+
+ void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE
+ {
+ const QPointF hotSpot = drawHotSpot(rect, painter);
+ painter.drawLine(hotSpot, hotSpot + m_offset);
+ }
+
+private:
+ QPointF m_offset;
+};
+
+class SwipeGesture : public Gesture {
+public:
+ explicit SwipeGesture(const QWidget *w, const QSwipeGesture *source) : Gesture(w, source)
+ , m_horizontal(source->horizontalDirection()), m_vertical(source->verticalDirection())
+ , m_angle(source->swipeAngle()) {}
+
+ void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE;
+
+private:
+ QSwipeGesture::SwipeDirection m_horizontal;
+ QSwipeGesture::SwipeDirection m_vertical;
+ qreal m_angle;
+};
+
+static qreal swipeDirectionAngle(QSwipeGesture::SwipeDirection d)
+{
+ switch (d) {
+ case QSwipeGesture::NoDirection:
+ case QSwipeGesture::Right:
+ break;
+ case QSwipeGesture::Left:
+ return 180;
+ case QSwipeGesture::Up:
+ return 90;
+ case QSwipeGesture::Down:
+ return 270;
+ }
+ return 0;
+}
+
+void SwipeGesture::draw(const QRectF &rect, QPainter &painter) const
+{
+ enum { arrowLength = 50, arrowHeadSize = 10 };
+ const QPointF hotSpot = drawHotSpot(rect, painter);
+ drawArrow(hotSpot, arrowLength, swipeDirectionAngle(m_horizontal), Qt::red, arrowHeadSize, painter);
+ drawArrow(hotSpot, arrowLength, swipeDirectionAngle(m_vertical), Qt::green, arrowHeadSize, painter);
+ drawArrow(hotSpot, arrowLength, m_angle, Qt::blue, arrowHeadSize, painter);
+}
+
+Gesture *Gesture::fromQGesture(const QWidget *w, const QGesture *source)
+{
+ Gesture *result = Q_NULLPTR;
+ switch (source->gestureType()) {
+ case Qt::TapGesture:
+ case Qt::TapAndHoldGesture:
+ case Qt::PanGesture:
+ result = new PanGesture(w, static_cast<const QPanGesture *>(source));
+ break;
+ case Qt::PinchGesture:
+ case Qt::CustomGesture:
+ case Qt::LastGestureType:
+ break;
+ case Qt::SwipeGesture:
+ result = new SwipeGesture(w, static_cast<const QSwipeGesture *>(source));
+ break;
+ }
+ return result;
+}
+
+typedef QSharedPointer<Gesture> GesturePtr;
+typedef QVector<GesturePtr> GesturePtrs;
+
typedef QVector<QEvent::Type> EventTypeVector;
class EventFilter : public QObject {
@@ -68,33 +234,189 @@ bool EventFilter::eventFilter(QObject *o, QEvent *e)
static int n = 0;
if (m_types.contains(e->type())) {
QString message;
- QDebug(&message) << '#' << n++ << ' ' << o->objectName() << ' ' << e;
+ QDebug debug(&message);
+ debug << '#' << n++ << ' ' << o->objectName() << ' ';
+ switch (e->type()) {
+ case QEvent::Gesture:
+ case QEvent::GestureOverride:
+ debug << static_cast<const QGestureEvent *>(e); // Special operator
+ break;
+ default:
+ debug << e;
+ break;
+ }
emit eventReceived(message);
}
return false;
}
+enum PointType {
+ TouchPoint,
+ MousePress,
+ MouseRelease
+};
+
+struct Point
+{
+ Point(const QPointF &p = QPoint(), PointType t = TouchPoint,
+ Qt::MouseEventSource s = Qt::MouseEventNotSynthesized) : pos(p), type(t), source(s) {}
+
+ QColor color() const;
+
+ QPointF pos;
+ PointType type;
+ Qt::MouseEventSource source;
+};
+
+QColor Point::color() const
+{
+ Qt::GlobalColor globalColor = Qt::black;
+ if (type != TouchPoint) {
+ switch (source) {
+ case Qt::MouseEventSynthesizedBySystem:
+ globalColor = Qt::red;
+ break;
+ case Qt::MouseEventSynthesizedByQt:
+ globalColor = Qt::blue;
+ break;
+ case Qt::MouseEventNotSynthesized:
+ break;
+ }
+ }
+ const QColor result(globalColor);
+ return type == MousePress ? result.lighter() : result;
+}
+
class TouchTestWidget : public QWidget {
+ Q_OBJECT
+ Q_PROPERTY(bool drawPoints READ drawPoints WRITE setDrawPoints)
public:
- explicit TouchTestWidget(QWidget *parent = 0) : QWidget(parent)
+ explicit TouchTestWidget(QWidget *parent = 0) : QWidget(parent), m_drawPoints(true)
{
setAttribute(Qt::WA_AcceptTouchEvents);
+ foreach (Qt::GestureType t, optGestures)
+ grabGesture(t);
}
- bool event(QEvent *event) Q_DECL_OVERRIDE
- {
- switch (event->type()) {
- case QEvent::TouchBegin:
- case QEvent::TouchUpdate:
- case QEvent::TouchEnd:
+ bool drawPoints() const { return m_drawPoints; }
+
+public slots:
+ void clearPoints();
+ void setDrawPoints(bool drawPoints);
+
+signals:
+ void logMessage(const QString &);
+
+protected:
+ bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+
+private:
+ void handleGestureEvent(QGestureEvent *gestureEvent);
+
+ QVector<Point> m_points;
+ GesturePtrs m_gestures;
+ bool m_drawPoints;
+};
+
+void TouchTestWidget::clearPoints()
+{
+ if (!m_points.isEmpty() || !m_gestures.isEmpty()) {
+ m_points.clear();
+ m_gestures.clear();
+ update();
+ }
+}
+
+void TouchTestWidget::setDrawPoints(bool drawPoints)
+{
+ if (m_drawPoints != drawPoints) {
+ clearPoints();
+ m_drawPoints = drawPoints;
+ }
+}
+
+bool TouchTestWidget::event(QEvent *event)
+{
+ const QEvent::Type type = event->type();
+ switch (type) {
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ if (m_drawPoints) {
+ const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
+ m_points.append(Point(me->localPos(),
+ type == QEvent::MouseButtonPress ? MousePress : MouseRelease,
+ me->source()));
+ update();
+ }
+ break;
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ if (m_drawPoints) {
+ foreach (const QTouchEvent::TouchPoint &p, static_cast<const QTouchEvent *>(event)->touchPoints())
+ m_points.append(Point(p.pos(), TouchPoint));
+ update();
+ }
+ case QEvent::TouchEnd:
+ if (optIgnoreTouch)
+ event->ignore();
+ else
event->accept();
- return true;
- default:
- break;
+ return true;
+ case QEvent::Gesture:
+ handleGestureEvent(static_cast<QGestureEvent *>(event));
+ break;
+ default:
+ break;
+ }
+ return QWidget::event(event);
+}
+
+void TouchTestWidget::handleGestureEvent(QGestureEvent *gestureEvent)
+{
+ foreach (QGesture *gesture, gestureEvent->gestures()) {
+ if (optGestures.contains(gesture->gestureType())) {
+ switch (gesture->state()) {
+ case Qt::NoGesture:
+ break;
+ case Qt::GestureStarted:
+ case Qt::GestureUpdated:
+ gestureEvent->accept(gesture);
+ break;
+ case Qt::GestureFinished:
+ gestureEvent->accept(gesture);
+ if (Gesture *g = Gesture::fromQGesture(this, gesture)) {
+ m_gestures.append(GesturePtr(g));
+ update();
+ }
+ break;
+ case Qt::GestureCanceled:
+ emit logMessage(QLatin1String("=== Qt::GestureCanceled ==="));
+ break;
+ }
}
- return QWidget::event(event);
}
-};
+}
+
+void TouchTestWidget::paintEvent(QPaintEvent *)
+{
+ // Draw touch points as dots, mouse press as light filled circles, mouse release as circles.
+ QPainter painter(this);
+ const QRectF geom = QRectF(QPointF(0, 0), QSizeF(size()));
+ painter.fillRect(geom, Qt::white);
+ painter.drawRect(QRectF(geom.topLeft(), geom.bottomRight() - QPointF(1, 1)));
+ foreach (const Point &point, m_points) {
+ if (geom.contains(point.pos)) {
+ const qreal radius = point.type == TouchPoint ? 1 : 4;
+ if (point.type == MouseRelease) {
+ drawCircle(point.pos, radius, point.color(), painter);
+ } else
+ fillCircle(point.pos, radius, point.color(), painter);
+ }
+ }
+ foreach (const GesturePtr &gp, m_gestures)
+ gp->draw(geom, painter);
+}
class MainWindow : public QMainWindow
{
@@ -108,7 +430,7 @@ public slots:
void dumpTouchDevices();
private:
- QWidget *m_touchWidget;
+ TouchTestWidget *m_touchWidget;
QPlainTextEdit *m_logTextEdit;
};
@@ -119,23 +441,38 @@ MainWindow::MainWindow()
setWindowTitle(QStringLiteral("Touch Event Tester ") + QT_VERSION_STR);
setObjectName("MainWin");
+ QToolBar *toolBar = new QToolBar(this);
+ addToolBar(Qt::TopToolBarArea, toolBar);
QMenu *fileMenu = menuBar()->addMenu("File");
- QAction *da = fileMenu->addAction(QStringLiteral("Dump devices"));
- da->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
- connect(da, SIGNAL(triggered()), this, SLOT(dumpTouchDevices()));
- QAction *qa = fileMenu->addAction(QStringLiteral("Quit"));
- qa->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
- connect(qa, SIGNAL(triggered()), this, SLOT(close()));
+ QAction *dumpDeviceAction = fileMenu->addAction(QStringLiteral("Dump devices"));
+ dumpDeviceAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
+ connect(dumpDeviceAction, SIGNAL(triggered()), this, SLOT(dumpTouchDevices()));
+ toolBar->addAction(dumpDeviceAction);
+ QAction *clearLogAction = fileMenu->addAction(QStringLiteral("Clear Log"));
+ clearLogAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
+ connect(clearLogAction, SIGNAL(triggered()), m_logTextEdit, SLOT(clear()));
+ toolBar->addAction(clearLogAction);
+ QAction *toggleDrawPointAction = fileMenu->addAction(QStringLiteral("Draw Points"));
+ toggleDrawPointAction->setCheckable(true);
+ toggleDrawPointAction->setChecked(m_touchWidget->drawPoints());
+ connect(toggleDrawPointAction, SIGNAL(toggled(bool)), m_touchWidget, SLOT(setDrawPoints(bool)));
+ toolBar->addAction(toggleDrawPointAction);
+ QAction *clearPointAction = fileMenu->addAction(QStringLiteral("Clear Points"));
+ clearPointAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P));
+ connect(clearPointAction, SIGNAL(triggered()), m_touchWidget, SLOT(clearPoints()));
+ toolBar->addAction(clearPointAction);
+ QAction *quitAction = fileMenu->addAction(QStringLiteral("Quit"));
+ quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+ toolBar->addAction(quitAction);
- QSplitter *mainSplitter = new QSplitter(Qt::Vertical);
+ QSplitter *mainSplitter = new QSplitter(Qt::Vertical, this);
m_touchWidget->setObjectName(QStringLiteral("TouchWidget"));
- const QSize screenSize = QGuiApplication::primaryScreen()->availableGeometry().size();
- m_touchWidget->setMinimumSize(screenSize / 2);
mainSplitter->addWidget(m_touchWidget);
+ connect(m_touchWidget, &TouchTestWidget::logMessage, this, &MainWindow::appendToLog);
m_logTextEdit->setObjectName(QStringLiteral("LogTextEdit"));
- m_logTextEdit->setMinimumHeight(screenSize.height() / 4);
mainSplitter->addWidget(m_logTextEdit);
setCentralWidget(mainSplitter);
@@ -165,19 +502,57 @@ int main(int argc, char *argv[])
const QCommandLineOption globalFilterOption(QStringLiteral("global"),
QStringLiteral("Global event filter"));
parser.addOption(globalFilterOption);
+
+ const QCommandLineOption ignoreTouchOption(QStringLiteral("ignore"),
+ QStringLiteral("Ignore touch events (for testing mouse emulation)."));
+ parser.addOption(ignoreTouchOption);
+ const QCommandLineOption noTouchLogOption(QStringLiteral("notouchlog"),
+ QStringLiteral("Do not log touch events (for testing gestures)."));
+ parser.addOption(noTouchLogOption);
+ const QCommandLineOption noMouseLogOption(QStringLiteral("nomouselog"),
+ QStringLiteral("Do not log mouse events (for testing gestures)."));
+ parser.addOption(noMouseLogOption);
+
+ const QCommandLineOption tapGestureOption(QStringLiteral("tap"), QStringLiteral("Grab tap gesture."));
+ parser.addOption(tapGestureOption);
+ const QCommandLineOption tapAndHoldGestureOption(QStringLiteral("tap-and-hold"),
+ QStringLiteral("Grab tap-and-hold gesture."));
+ parser.addOption(tapAndHoldGestureOption);
+ const QCommandLineOption panGestureOption(QStringLiteral("pan"), QStringLiteral("Grab pan gesture."));
+ parser.addOption(panGestureOption);
+ const QCommandLineOption pinchGestureOption(QStringLiteral("pinch"), QStringLiteral("Grab pinch gesture."));
+ parser.addOption(pinchGestureOption);
+ const QCommandLineOption swipeGestureOption(QStringLiteral("swipe"), QStringLiteral("Grab swipe gesture."));
+ parser.addOption(swipeGestureOption);
parser.process(QApplication::arguments());
+ optIgnoreTouch = parser.isSet(ignoreTouchOption);
+ if (parser.isSet(tapGestureOption))
+ optGestures.append(Qt::TapGesture);
+ if (parser.isSet(tapAndHoldGestureOption))
+ optGestures.append(Qt::TapAndHoldGesture);
+ if (parser.isSet(panGestureOption))
+ optGestures.append(Qt::PanGesture);
+ if (parser.isSet(pinchGestureOption))
+ optGestures.append(Qt::PinchGesture);
+ if (parser.isSet(swipeGestureOption))
+ optGestures.append(Qt::SwipeGesture);
MainWindow w;
+ const QSize screenSize = QGuiApplication::primaryScreen()->availableGeometry().size();
+ w.resize(screenSize / 2);
+ const QSize sizeDiff = screenSize - w.size();
+ w.move(sizeDiff.width() / 2, sizeDiff.height() / 2);
w.show();
- const QSize pos = QGuiApplication::primaryScreen()->availableGeometry().size() - w.size();
- w.move(pos.width() / 2, pos.height() / 2);
EventTypeVector eventTypes;
- eventTypes << QEvent::MouseButtonPress << QEvent::MouseButtonRelease
- << QEvent::MouseButtonDblClick
- << QEvent::TouchBegin << QEvent::TouchUpdate << QEvent::TouchEnd;
+ if (!parser.isSet(noMouseLogOption))
+ eventTypes << QEvent::MouseButtonPress << QEvent::MouseButtonRelease << QEvent::MouseButtonDblClick;
if (parser.isSet(mouseMoveOption))
eventTypes << QEvent::MouseMove;
+ if (!parser.isSet(noTouchLogOption))
+ eventTypes << QEvent::TouchBegin << QEvent::TouchUpdate << QEvent::TouchEnd;
+ if (!optGestures.isEmpty())
+ eventTypes << QEvent::Gesture << QEvent::GestureOverride;
QObject *filterTarget = parser.isSet(globalFilterOption)
? static_cast<QObject *>(&a)
: static_cast<QObject *>(w.touchWidget());
diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw
index 9ac99fd678..5bdfc3f32c 100644
--- a/tools/configure/Makefile.mingw
+++ b/tools/configure/Makefile.mingw
@@ -4,7 +4,7 @@ CONFSRC = $(TOOLSRC)/configure
RAW_PCH = configure_pch.h
PCH = $(RAW_PCH).gch/c++
-DEFINES = -DUNICODE -DQT_NO_DATASTREAM -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE
+DEFINES = -DUNICODE -DQT_NO_DATASTREAM -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -DQT_VERSION_STR=\"$(QTVERSION)\" -DQT_VERSION_MAJOR=$(QT_VERSION_MAJOR) -DQT_VERSION_MINOR=$(QT_VERSION_MINOR) -DQT_VERSION_PATCH=$(QT_VERSION_PATCH)
INCPATH = -I"../../include" -I"../../include/QtCore" -I"../../include/QtCore/$(QTVERSION)" -I"../../include/QtCore/$(QTVERSION)/QtCore" -I"$(TOOLSRC)/shared" -I"$(QTSRC)mkspecs/win32-g++"
CXXFLAGS_BARE = -fno-rtti -fno-exceptions -mthreads -Wall -Wextra $(DEFINES) $(INCPATH)
CXXFLAGS = -include $(RAW_PCH) $(CXXFLAGS_BARE)
@@ -48,6 +48,7 @@ OBJECTS = \
qfsfileengine_win.o \
qfsfileengine_iterator.o \
qiodevice.o \
+ qringbuffer.o \
qdebug.o \
qtextstream.o \
qlogging.o \
@@ -88,7 +89,7 @@ $(OBJECTS): $(PCH)
# sh-compatible shell. This is not a problem, because configure.bat
# will not do that.
ifeq ($(SHELL), sh.exe)
- ifeq ($(wildcard $(CURDIR)/sh.exe), )
+ ifeq ($(wildcard "$(CURDIR)/sh.exe"), )
SH = 0
else
SH = 1
diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32
index 8c6d213e42..8d6fe8bf72 100644
--- a/tools/configure/Makefile.win32
+++ b/tools/configure/Makefile.win32
@@ -3,9 +3,9 @@ TOOLSRC = $(QTSRC)tools
CONFSRC = $(TOOLSRC)\configure
PCH = configure_pch.pch
-DEFINES = -DUNICODE -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE
+DEFINES = -DUNICODE -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DQT_BUILD_CONFIGURE -DQT_VERSION_STR=\"$(QTVERSION)\" -DQT_VERSION_MAJOR=$(QT_VERSION_MAJOR) -DQT_VERSION_MINOR=$(QT_VERSION_MINOR) -DQT_VERSION_PATCH=$(QT_VERSION_PATCH)
INCPATH = -I"..\..\include" -I"..\..\include\QtCore" -I"..\..\include\QtCore\$(QTVERSION)" -I"..\..\include\QtCore\$(QTVERSION)\QtCore" -I"$(TOOLSRC)\shared" -I"$(QTSRC)mkspecs\win32-msvc2008"
-CXXFLAGS_BARE = -nologo -Zc:wchar_t -W3 -GR -EHsc -w34100 -w34189 $(CFLAGS_CRT) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCPATH)
+CXXFLAGS_BARE = -nologo -Zc:wchar_t -W3 -GR -EHsc -w34100 -w34189 -wd4577 $(CFLAGS_CRT) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCPATH)
CXXFLAGS = -FIconfigure_pch.h -Yuconfigure_pch.h -Fp$(PCH) -MP $(CXXFLAGS_BARE)
LINK = link
LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:"configure.intermediate.manifest"
@@ -47,6 +47,7 @@ OBJECTS = \
qfsfileengine_win.obj \
qfsfileengine_iterator.obj \
qiodevice.obj \
+ qringbuffer.obj \
qdebug.obj \
qtextstream.obj \
qlogging.obj \
@@ -122,6 +123,7 @@ qfsfileengine.obj: $(CORESRC)\io\qfsfileengine.cpp $(PCH)
qfsfileengine_win.obj: $(CORESRC)\io\qfsfileengine_win.cpp $(PCH)
qfsfileengine_iterator.obj: $(CORESRC)\io\qfsfileengine_iterator.cpp $(PCH)
qiodevice.obj: $(CORESRC)\io\qiodevice.cpp $(PCH)
+qringbuffer.obj: $(CORESRC)\tools\qringbuffer.cpp $(PCH)
qdebug.obj: $(CORESRC)\io\qdebug.cpp $(PCH)
qtextstream.obj: $(CORESRC)\io\qtextstream.cpp $(PCH)
qtemporaryfile.obj: $(CORESRC)\io\qtemporaryfile.cpp $(PCH)
diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro
index e4901bacde..939c9ea5ab 100644
--- a/tools/configure/configure.pro
+++ b/tools/configure/configure.pro
@@ -68,6 +68,7 @@ HEADERS = configureapp.h environment.h tools.h\
$$QT_SOURCE_TREE/src/corelib/tools/qdatetime.h \
$$QT_SOURCE_TREE/src/corelib/tools/qmap.h \
$$QT_SOURCE_TREE/src/corelib/tools/qregexp.h \
+ $$QT_SOURCE_TREE/src/corelib/tools/qringbuffer_p.h \
$$QT_SOURCE_TREE/src/corelib/tools/qstring.h \
$$QT_SOURCE_TREE/src/corelib/tools/qstringlist.h \
$$QT_SOURCE_TREE/src/corelib/tools/qstringmatcher.h \
@@ -119,6 +120,7 @@ SOURCES = main.cpp configureapp.cpp environment.cpp tools.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qdatetime.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qmap.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qregexp.cpp \
+ $$QT_SOURCE_TREE/src/corelib/tools/qringbuffer.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qstring.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qstring_compat.cpp \
$$QT_SOURCE_TREE/src/corelib/tools/qstringlist.cpp \
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 5df8f7d645..160ccf5778 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -83,7 +83,7 @@ static inline void promptKeyPress()
exit(0); // Exit cleanly for Ctrl+C
}
-Configure::Configure(int& argc, char** argv)
+Configure::Configure(int& argc, char** argv) : verbose(0)
{
// Default values for indentation
optionIndent = 4;
@@ -165,11 +165,11 @@ Configure::Configure(int& argc, char** argv)
dictionary[ "CETEST" ] = "auto";
dictionary[ "CE_SIGNATURE" ] = "no";
dictionary[ "AUDIO_BACKEND" ] = "auto";
- dictionary[ "WMF_BACKEND" ] = "auto";
+ dictionary[ "WMF_BACKEND" ] = "no";
dictionary[ "WMSDK" ] = "auto";
dictionary[ "QML_DEBUG" ] = "yes";
dictionary[ "PLUGIN_MANIFESTS" ] = "no";
- dictionary[ "DIRECTWRITE" ] = "no";
+ dictionary[ "DIRECTWRITE" ] = "auto";
dictionary[ "DIRECT2D" ] = "no";
dictionary[ "NIS" ] = "no";
dictionary[ "NEON" ] = "auto";
@@ -198,20 +198,18 @@ Configure::Configure(int& argc, char** argv)
dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg";
QString version;
- QFile qglobal_h(sourcePath + "/src/corelib/global/qglobal.h");
- if (qglobal_h.open(QFile::ReadOnly)) {
- QTextStream read(&qglobal_h);
- QRegExp version_regexp("^# *define *QT_VERSION_STR *\"([^\"]*)\"");
- QString line;
- while (!read.atEnd()) {
- line = read.readLine();
- if (version_regexp.exactMatch(line)) {
- version = version_regexp.cap(1).trimmed();
- if (!version.isEmpty())
- break;
- }
+ QFile qmake_conf(sourcePath + "/.qmake.conf");
+ if (qmake_conf.open(QFile::ReadOnly)) {
+ while (!qmake_conf.atEnd()) {
+ static const char beginning[] = "MODULE_VERSION = ";
+ QByteArray line = qmake_conf.readLine();
+ if (!line.startsWith(beginning))
+ continue;
+
+ version = qMove(line).mid(int(strlen(beginning))).trimmed();
+ break;
}
- qglobal_h.close();
+ qmake_conf.close();
}
if (version.isEmpty())
@@ -232,6 +230,7 @@ Configure::Configure(int& argc, char** argv)
dictionary[ "BUILD" ] = "debug";
dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly
dictionary[ "FORCEDEBUGINFO" ] = "no";
+ dictionary[ "OPTIMIZED_TOOLS" ] = "no";
dictionary[ "BUILDTYPE" ] = "none";
@@ -239,7 +238,7 @@ Configure::Configure(int& argc, char** argv)
dictionary[ "COMPILE_EXAMPLES" ] = "yes";
- dictionary[ "C++11" ] = "auto";
+ dictionary[ "C++STD" ] = "auto";
dictionary[ "USE_GOLD_LINKER" ] = "no";
@@ -383,6 +382,7 @@ void Configure::parseCmdLine()
configCmdLine.clear();
reloadCmdLine();
}
+
else if (configCmdLine.at(i) == "-loadconfig") {
++i;
if (i != argCount) {
@@ -420,6 +420,10 @@ void Configure::parseCmdLine()
|| configCmdLine.at(i) == "-?")
dictionary[ "HELP" ] = "yes";
+ else if (configCmdLine.at(i) == "-v" || configCmdLine.at(i) == "-verbose") {
+ ++verbose;
+ }
+
else if (configCmdLine.at(i) == "-qconfig") {
++i;
if (i == argCount)
@@ -457,6 +461,10 @@ void Configure::parseCmdLine()
dictionary[ "SEPARATE_DEBUG_INFO" ] = "no";
else if (configCmdLine.at(i) == "-separate-debug-info")
dictionary[ "SEPARATE_DEBUG_INFO" ] = "yes";
+ else if (configCmdLine.at(i) == "-optimized-tools")
+ dictionary[ "RELEASE_TOOLS" ] = "yes";
+ else if (configCmdLine.at(i) == "-no-optimized-tools")
+ dictionary[ "RELEASE_TOOLS" ] = "no";
else if (configCmdLine.at(i) == "-compile-examples") {
dictionary[ "COMPILE_EXAMPLES" ] = "yes";
@@ -465,9 +473,29 @@ void Configure::parseCmdLine()
}
else if (configCmdLine.at(i) == "-c++11")
- dictionary[ "C++11" ] = "yes";
+ dictionary[ "C++STD" ] = "c++11";
else if (configCmdLine.at(i) == "-no-c++11")
- dictionary[ "C++11" ] = "no";
+ dictionary[ "C++STD" ] = "c++98";
+ else if (configCmdLine.at(i) == "-c++std") {
+ ++i;
+ if (i == argCount)
+ break;
+
+ QString level = configCmdLine.at(i);
+ if (level == "c++98" || level == "c++11" || level == "c++14" || level == "c++1z"
+ || level == "auto") {
+ dictionary[ "C++STD" ] = level;
+ } else if (level == "98" || level == "11" || level == "14" || level == "1z") {
+ dictionary[ "C++STD" ] = "c++" + level;
+ } else {
+ dictionary[ "DONE" ] = "error";
+ cout << "ERROR: invalid C++ standard " << level
+ << "; valid options are: c++98 c++11 c++14 c++1z auto" << endl;
+ return;
+ }
+ }
+
+
else if (configCmdLine.at(i) == "-use-gold-linker")
dictionary[ "USE_GOLD_LINKER" ] = "yes";
else if (configCmdLine.at(i) == "-no-use-gold-linker")
@@ -884,13 +912,15 @@ void Configure::parseCmdLine()
} else if (configCmdLine.at(i) == "-no-qdbus") {
dictionary[ "DBUS" ] = "no";
} else if (configCmdLine.at(i) == "-qdbus") {
- dictionary[ "DBUS" ] = "yes";
+ dictionary[ "DBUS" ] = "auto";
} else if (configCmdLine.at(i) == "-no-dbus") {
dictionary[ "DBUS" ] = "no";
} else if (configCmdLine.at(i) == "-dbus") {
- dictionary[ "DBUS" ] = "yes";
+ dictionary[ "DBUS" ] = "auto";
} else if (configCmdLine.at(i) == "-dbus-linked") {
dictionary[ "DBUS" ] = "linked";
+ } else if (configCmdLine.at(i) == "-dbus-runtime") {
+ dictionary[ "DBUS" ] = "runtime";
} else if (configCmdLine.at(i) == "-audio-backend") {
dictionary[ "AUDIO_BACKEND" ] = "yes";
} else if (configCmdLine.at(i) == "-no-audio-backend") {
@@ -1386,8 +1416,8 @@ void Configure::parseCmdLine()
cout << "QMAKESPEC environment variable is set to \"" << dictionary["QMAKESPEC"]
<< "\" which is not a supported platform" << endl;
} else { // was autodetected from environment
- cout << "Unable to detect the platform from environment. Use -platform command line"
- "argument or set the QMAKESPEC environment variable and run configure again" << endl;
+ cout << "Unable to detect the platform from environment. Use -platform command line" << endl
+ << "argument or set the QMAKESPEC environment variable and run configure again." << endl;
}
cout << "See the README file for a list of supported operating systems and compilers." << endl;
} else {
@@ -1789,11 +1819,14 @@ bool Configure::displayHelp()
desc("BUILDDEV", "yes", "-developer-build", "Compile and link Qt with Qt developer options (including auto-tests exporting)\n");
+ desc("RELEASE_TOOLS", "yes", "-optimized-tools", "Build optimized host tools even in debug build.");
+ desc("RELEASE_TOOLS", "no", "-no-optimized-tools", "Do not build optimized host tools even in debug build.\n");
+
desc("OPENSOURCE", "opensource", "-opensource", "Compile and link the Open-Source Edition of Qt.");
desc("COMMERCIAL", "commercial", "-commercial", "Compile and link the Commercial Edition of Qt.\n");
- desc("C++11", "yes", "-c++11", "Compile Qt with C++11 support enabled.");
- desc("C++11", "no", "-no-c++11", "Do not compile Qt with C++11 support enabled.\n");
+ desc( "-c++std <edition>", "Compile Qt with C++ standard edition (c++98, c++11, c++14, c++1z)\n"
+ "Default: highest supported. This option is not supported for MSVC.\n");
desc("USE_GOLD_LINKER", "yes", "-use-gold-linker", "Link using the GNU gold linker (gcc only).");
desc("USE_GOLD_LINKER", "no", "-no-use-gold-linker", "Do not link using the GNU gold linker.\n");
@@ -1890,9 +1923,6 @@ bool Configure::displayHelp()
desc("LARGE_FILE", "yes", "-largefile", "Enables Qt to access files larger than 4 GB.\n");
- desc("FONT_CONFIG", "yes", "-fontconfig", "Build with FontConfig support.");
- desc("FONT_CONFIG", "no", "-no-fontconfig", "Do not build with FontConfig support.\n");
-
desc("POSIX_IPC", "yes", "-posix-ipc", "Enable POSIX IPC.\n");
desc("QT_GLIB", "yes", "-glib", "Compile Glib support.\n");
@@ -1938,7 +1968,10 @@ bool Configure::displayHelp()
desc("FREETYPE", "no", "-no-freetype", "Do not compile in Freetype2 support.");
desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt.");
- desc("FREETYPE", "system","-system-freetype", "Use the libfreetype provided by the system.");
+ desc("FREETYPE", "system","-system-freetype", "Use the libfreetype provided by the system.\n");
+
+ desc("FONT_CONFIG", "yes", "-fontconfig", "Build with FontConfig support.");
+ desc("FONT_CONFIG", "no", "-no-fontconfig", "Do not build with FontConfig support.\n");
desc("HARFBUZZ", "no", "-no-harfbuzz", "Do not compile in HarfBuzz-NG support.");
desc("HARFBUZZ", "qt", "-qt-harfbuzz", "Use HarfBuzz-NG bundled with Qt to do text shaping.\n"
@@ -2003,16 +2036,16 @@ bool Configure::displayHelp()
desc("LIBPROXY", "no", "-no-libproxy", "Do not compile in libproxy support.");
desc("LIBPROXY", "yes", "-libproxy", "Compile in libproxy support (for cross compilation targets).\n");
desc("DBUS", "no", "-no-dbus", "Do not compile in D-Bus support.");
- desc("DBUS", "yes", "-dbus", "Compile in D-Bus support and load libdbus-1\ndynamically.");
desc("DBUS", "linked", "-dbus-linked", "Compile in D-Bus support and link to libdbus-1.\n");
+ desc("DBUS", "runtime", "-dbus-runtime", "Compile in D-Bus support and load libdbus-1\ndynamically.");
desc("AUDIO_BACKEND", "no","-no-audio-backend", "Do not compile in the platform audio backend into\nQt Multimedia.");
desc("AUDIO_BACKEND", "yes","-audio-backend", "Compile in the platform audio backend into Qt Multimedia.\n");
desc("WMF_BACKEND", "no","-no-wmf-backend", "Do not compile in the windows media foundation backend\ninto Qt Multimedia.");
desc("WMF_BACKEND", "yes","-wmf-backend", "Compile in the windows media foundation backend into Qt Multimedia.\n");
desc("QML_DEBUG", "no", "-no-qml-debug", "Do not build the in-process QML debugging support.");
desc("QML_DEBUG", "yes", "-qml-debug", "Build the in-process QML debugging support.\n");
- desc("DIRECTWRITE", "no", "-no-directwrite", "Do not build support for DirectWrite font rendering.");
- desc("DIRECTWRITE", "yes", "-directwrite", "Build support for DirectWrite font rendering (requires DirectWrite availability on target systems, e.g. Windows Vista with Platform Update, Windows 7, etc.)\n");
+ desc("DIRECTWRITE", "no", "-no-directwrite", "Do not build support for DirectWrite font rendering.");
+ desc("DIRECTWRITE", "yes", "-directwrite", "Build support for DirectWrite font rendering.\n");
desc("DIRECT2D", "no", "-no-direct2d", "Do not build the Direct2D platform plugin.");
desc("DIRECT2D", "yes", "-direct2d", "Build the Direct2D platform plugin (experimental,\n"
@@ -2036,6 +2069,7 @@ bool Configure::displayHelp()
desc( "-loadconfig <config>", "Run configure with the parameters from file configure_<config>.cache.");
desc( "-saveconfig <config>", "Run configure and save the parameters in file configure_<config>.cache.");
desc( "-redo", "Run configure with the same parameters as last time.\n");
+ desc( "-v, -verbose", "Run configure tests with verbose output.\n");
// Qt\Windows CE only options go below here -----------------------------------------------------------------------------
desc("Qt for Windows CE only:\n\n");
@@ -2118,7 +2152,7 @@ QString Configure::defaultTo(const QString &option)
return "no";
// keep 'auto' default for msvc, since we can't set the language supported
- if (option == "C++11"
+ if (option == "C++STD"
&& dictionary["QMAKESPEC"].contains("msvc"))
return "auto";
@@ -2298,7 +2332,7 @@ bool Configure::checkAvailability(const QString &part)
} else if (part == "WMF_BACKEND") {
available = findFile("mfapi.h") && findFile("mf.lib");
} else if (part == "DIRECTWRITE") {
- available = findFile("dwrite.h") && findFile("d2d1.h") && findFile("dwrite.lib");
+ available = tryCompileProject("win/directwrite");
} else if (part == "DIRECT2D") {
available = tryCompileProject("qpa/direct2d");
} else if (part == "ICONV") {
@@ -2345,9 +2379,32 @@ void Configure::autoDetection()
// Auto-detect CPU architectures.
detectArch();
- if (dictionary["C++11"] == "auto") {
- if (!dictionary["QMAKESPEC"].contains("msvc"))
- dictionary["C++11"] = tryCompileProject("common/c++11") ? "yes" : "no";
+ if (dictionary["C++STD"] == "auto" && !dictionary["QMAKESPEC"].contains("msvc")) {
+ if (!tryCompileProject("common/c++11")) {
+ dictionary["C++STD"] = "c++98";
+ } else if (!tryCompileProject("common/c++14")) {
+ dictionary["C++STD"] = "c++11";
+ } else if (!tryCompileProject("common/c++1z")) {
+ dictionary["C++STD"] = "c++14";
+ } else {
+ dictionary["C++STD"] = "c++1z";
+ }
+ }
+
+ if (!dictionary["QMAKESPEC"].contains("msvc")) {
+ if (tryCompileProject("common/c++default", QString(), false)) {
+ QFile iiFile(buildPath + "/config.tests/common/c++default/c++default.ii");
+ if (iiFile.open(QIODevice::ReadOnly)) {
+ QString content = QString::fromUtf8(iiFile.readAll());
+ QRegExp expr("\\b([0-9]+)L\\b");
+ if (expr.indexIn(content) != -1)
+ dictionary["CFG_STDCXX_DEFAULT"] = expr.cap(1);
+ }
+ }
+ if (dictionary["CFG_STDCXX_DEFAULT"].isEmpty()) {
+ cout << "Could not determine the C++ standard the compiler uses by default, assuming C++98." << endl;
+ dictionary["CFG_STDCXX_DEFAULT"] = "199711";
+ }
}
if (dictionary["ATOMIC64"] == "auto")
@@ -2453,7 +2510,7 @@ void Configure::autoDetection()
if (dictionary["LIBPROXY"] == "auto")
dictionary["LIBPROXY"] = checkAvailability("LIBPROXY") ? "yes" : "no";
if (dictionary["DBUS"] == "auto")
- dictionary["DBUS"] = checkAvailability("DBUS") ? "yes" : "no";
+ dictionary["DBUS"] = checkAvailability("DBUS") ? "linked" : "runtime";
if (dictionary["QML_DEBUG"] == "auto")
dictionary["QML_DEBUG"] = dictionary["QML"] == "yes" ? "yes" : "no";
if (dictionary["AUDIO_BACKEND"] == "auto")
@@ -2521,31 +2578,26 @@ void Configure::autoDetection()
if (dictionary["FONT_CONFIG"] == "auto")
dictionary["FONT_CONFIG"] = checkAvailability("FONT_CONFIG") ? "yes" : "no";
+ if (dictionary["DIRECTWRITE"] == "auto")
+ dictionary["DIRECTWRITE"] = checkAvailability("DIRECTWRITE") ? "yes" : "no";
+
// Mark all unknown "auto" to the default value..
for (QMap<QString,QString>::iterator i = dictionary.begin(); i != dictionary.end(); ++i) {
if (i.value() == "auto")
i.value() = defaultTo(i.key());
}
- if (tryCompileProject("unix/ptrsize"))
- dictionary["QT_POINTER_SIZE"] = "8";
- else
- dictionary["QT_POINTER_SIZE"] = "4";
+ cout << "Done running configuration tests." << endl;
}
bool Configure::verifyConfiguration()
{
bool prompt = false;
- if (dictionary["C++11"] != "auto"
+ if (dictionary["C++STD"] != "auto"
&& dictionary["QMAKESPEC"].contains("msvc")) {
- cout << "WARNING: Qt does not support disabling or enabling any existing C++11 support "
- "with MSVC compilers.";
- if (dictionary["C++11"] == "yes")
- cout << "Therefore -c++11 is ignored." << endl << endl;
- else
- cout << "Therefore -no-c++11 is ignored." << endl << endl;
-
- dictionary["C++11"] = "auto";
+ cout << "WARNING: It is not possible to change the C++ standard edition with MSVC compilers. "
+ "Therefore, the option -c++std " << dictionary["C++STD"] << " was ignored." << endl << endl;
+ dictionary["C++STD"] = "auto";
}
if (dictionary["STATIC_RUNTIME"] == "yes" && dictionary["SHARED"] == "yes") {
@@ -2647,6 +2699,14 @@ bool Configure::verifyConfiguration()
}
}
+ if (dictionary["OPENGL"] == "no" || dictionary["OPENGL_ES_2"] == "no") {
+ if (dictionary.value("XQMAKESPEC").startsWith("winphone") ||
+ dictionary.value("XQMAKESPEC").startsWith("winrt")) {
+ cout << "ERROR: Option -no-opengl is not valid for WinRT." << endl;
+ dictionary[ "DONE" ] = "error";
+ }
+ }
+
if (prompt)
promptKeyPress();
@@ -2686,9 +2746,17 @@ void Configure::generateOutputVars()
qtConfig += "debug_and_release build_all debug";
qtConfig += "release";
}
+ if (dictionary[ "RELEASE_TOOLS" ] == "yes")
+ qtConfig += "release_tools";
- if (dictionary[ "C++11" ] == "yes")
+ if (dictionary[ "C++STD" ] == "c++11")
qtConfig += "c++11";
+ else if (dictionary[ "C++STD" ] == "c++14")
+ qtConfig += "c++11 c++14";
+ else if (dictionary[ "C++STD" ] == "c++1z")
+ qtConfig += "c++11 c++14 c++1z";
+ if (!dictionary[ "CFG_STDCXX_DEFAULT" ].isEmpty())
+ qmakeVars += "QT_COMPILER_STDCXX = " + dictionary[ "CFG_STDCXX_DEFAULT" ];
if (dictionary[ "USE_GOLD_LINKER" ] == "yes")
qmakeConfig += "use_gold_linker";
@@ -2909,7 +2977,7 @@ void Configure::generateOutputVars()
if (dictionary[ "LIBPROXY" ] == "yes")
qtConfig += "libproxy";
- if (dictionary[ "DBUS" ] == "yes")
+ if (dictionary[ "DBUS" ] == "runtime")
qtConfig += "dbus";
else if (dictionary[ "DBUS" ] == "linked")
qtConfig += "dbus dbus-linked";
@@ -2921,6 +2989,9 @@ void Configure::generateOutputVars()
if (dictionary["AUDIO_BACKEND"] == "yes")
qtConfig += "audio-backend";
+ if (dictionary["QML_DEBUG"] == "no")
+ qtConfig += "no-qml-debug";
+
if (dictionary["WMF_BACKEND"] == "yes")
qtConfig += "wmf-backend";
@@ -3016,7 +3087,7 @@ void Configure::generateOutputVars()
qmakeVars += QString("OPENSSL_LIBS += -L%1/lib").arg(opensslPath);
}
}
- if (dictionary[ "DBUS" ] != "no") {
+ if (dictionary[ "DBUS" ] == "linked") {
if (!dbusPath.isEmpty()) {
qmakeVars += QString("QT_CFLAGS_DBUS = -I%1/include").arg(dbusPath);
qmakeVars += QString("QT_LIBS_DBUS = -L%1/lib").arg(dbusPath);
@@ -3075,7 +3146,7 @@ void Configure::generateOutputVars()
void Configure::generateCachefile()
{
- // Generate qmodule.pri
+ // Generate qmodule.pri, which is loaded only by Qt modules
{
FileWriter moduleStream(buildPath + "/mkspecs/qmodule.pri");
@@ -3143,6 +3214,8 @@ void Configure::generateCachefile()
moduleStream << " largefile";
if (dictionary[ "STRIP" ] == "no")
moduleStream << " nostrip";
+ if (dictionary[ "LTCG" ] == "yes")
+ moduleStream << " ltcg";
moduleStream << endl;
for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var)
@@ -3297,7 +3370,8 @@ void Configure::detectArch()
QDir::setCurrent(oldpwd);
}
-bool Configure::tryCompileProject(const QString &projectPath, const QString &extraOptions)
+bool Configure::tryCompileProject(const QString &projectPath, const QString &extraOptions,
+ bool distClean)
{
QString oldpwd = QDir::currentPath();
@@ -3314,7 +3388,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
}
// run qmake
- QString command = QString("%1 %2 %3 2>&1")
+ QString command = QString("%1 %2 %3")
.arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")),
QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath),
extraOptions);
@@ -3326,6 +3400,11 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
addSysroot(&command);
}
+ if (verbose)
+ cout << qPrintable(command) << endl;
+ else
+ command += " 2>&1";
+
int code = 0;
QString output = Environment::execute(command, &code);
//cout << output << endl;
@@ -3335,12 +3414,16 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext
command = dictionary[ "MAKE" ];
if (command.contains("nmake") || command.contains("jom"))
command += " /NOLOGO";
- command += " -s 2>&1";
+ if (verbose)
+ cout << qPrintable(command) << endl;
+ else
+ command += " -s 2>&1";
output = Environment::execute(command, &code);
//cout << output << endl;
// clean up
- Environment::execute(command + " distclean 2>&1");
+ if (distClean)
+ Environment::execute(command + " distclean 2>&1");
}
QDir::setCurrent(oldpwd);
@@ -3420,8 +3503,6 @@ void Configure::generateQConfigPri()
if (dictionary["STATIC_RUNTIME"] == "yes")
configStream << " static_runtime";
- if (dictionary[ "LTCG" ] == "yes")
- configStream << " ltcg";
if (dictionary[ "RTTI" ] == "yes")
configStream << " rtti";
if (dictionary["INCREDIBUILD_XGE"] == "yes")
@@ -3554,6 +3635,12 @@ void Configure::generateConfigfiles()
{
FileWriter tmpStream(buildPath + "/src/corelib/global/qconfig.h");
+ tmpStream << "#define QT_VERSION_MAJOR " << dictionary["VERSION_MAJOR"] << endl
+ << "#define QT_VERSION_MINOR " << dictionary["VERSION_MINOR"] << endl
+ << "#define QT_VERSION_PATCH " << dictionary["VERSION_PATCH"] << endl
+ << "#define QT_VERSION_STR \"" << dictionary["VERSION"] << "\"\n"
+ << endl;
+
if (dictionary[ "QCONFIG" ] == "full") {
tmpStream << "/* Everything */" << endl;
} else {
@@ -3635,7 +3722,6 @@ void Configure::generateConfigfiles()
if (dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL";
if (dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL";
if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS";
- if (dictionary["QML_DEBUG"] == "no") qconfigList += "QT_NO_QML_DEBUGGER";
if (dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE";
if (dictionary["HARFBUZZ"] == "no") qconfigList += "QT_NO_HARFBUZZ";
if (dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES";
@@ -3681,8 +3767,6 @@ void Configure::generateConfigfiles()
if (dictionary["REDUCE_RELOCATIONS"] == "yes") qconfigList += "QT_REDUCE_RELOCATIONS";
if (dictionary["QT_GETIFADDRS"] == "no") qconfigList += "QT_NO_GETIFADDRS";
- qconfigList += QString("QT_POINTER_SIZE=%1").arg(dictionary["QT_POINTER_SIZE"]);
-
qconfigList.sort();
for (int i = 0; i < qconfigList.count(); ++i)
tmpStream << addDefine(qconfigList.at(i));
@@ -3763,7 +3847,9 @@ void Configure::displayConfig()
}
if (dictionary[ "BUILD" ] == "release" || dictionary[ "BUILDALL" ] == "yes")
sout << "Force debug info............" << dictionary[ "FORCEDEBUGINFO" ] << endl;
- sout << "C++11 support..............." << dictionary[ "C++11" ] << endl;
+ if (dictionary[ "BUILD" ] == "debug")
+ sout << "Force optimized tools......." << dictionary[ "RELEASE_TOOLS" ] << endl;
+ sout << "C++ language standard......." << dictionary[ "C++STD" ] << endl;
sout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl;
sout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl;
sout << "RTTI support................" << dictionary[ "RTTI" ] << endl;
@@ -3928,6 +4014,18 @@ void Configure::displayConfig()
<< "will be the same unless you are cross-compiling)." << endl
<< endl;
}
+ if (dictionary["C++STD"] == "c++98") {
+ sout << endl
+ << "NOTE: The -no-c++11 / -c++-level c++98 option is deprecated." << endl
+ << endl
+ << "Qt 5.7 will require C++11 support. The options are in effect for this" << endl
+ << "Qt 5.6 build, but you should update your build scripts to remove the" << endl
+ << "option and, if necessary, upgrade your compiler." << endl;
+ }
+ if (dictionary["RELEASE_TOOLS"] == "yes" && dictionary["BUILD"] != "debug" ) {
+ sout << endl
+ << "NOTE: -optimized-tools is not useful in -release mode." << endl;
+ }
if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) {
sout << endl
<< dictionary["PREFIX_COMPLAINTS"] << endl
@@ -3954,7 +4052,7 @@ void Configure::generateHeaders()
QStringList args;
args << "perl" << "-w";
args += sourcePath + "/bin/syncqt.pl";
- args << "-minimal" << "-module" << "QtCore";
+ args << "-version" << dictionary["VERSION"] << "-minimal" << "-module" << "QtCore";
args += sourcePath;
int retc = Environment::execute(args, QStringList(), QStringList());
if (retc) {
@@ -4217,7 +4315,10 @@ void Configure::buildQmake()
<< "INC_PATH = " << QDir::toNativeSeparators(
(QFile::exists(sourcePath + "/.git") ? ".." : sourcePath)
+ "/include") << endl;
- stream << "QT_VERSION = " << dictionary["VERSION"] << endl;
+ stream << "QT_VERSION = " << dictionary["VERSION"] << endl
+ << "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl
+ << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
+ << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\win32-g++" << endl
<< "EXTRA_CFLAGS = -DUNICODE -ffunction-sections" << endl
diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h
index e58a0feb2b..78cc118a9d 100644
--- a/tools/configure/configureapp.h
+++ b/tools/configure/configureapp.h
@@ -93,6 +93,8 @@ public:
private:
bool checkAngleAvailability(QString *errorMessage = 0) const;
+ int verbose;
+
// Our variable dictionaries
QMap<QString,QString> dictionary;
QStringList allBuildParts;
@@ -158,7 +160,8 @@ private:
void saveCmdLine();
void addSysroot(QString *command);
- bool tryCompileProject(const QString &projectPath, const QString &extraOptions = QString());
+ bool tryCompileProject(const QString &projectPath, const QString &extraOptions = QString(),
+ bool distClean = true);
bool compilerSupportsFlag(const QString &compilerAndArgs);
void desc(const char *description, int startingAt = 0, int wrapIndent = 0);
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index 11064a757d..5e28fda11d 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -69,17 +69,11 @@ struct CompilerInfo{
{CC_MINGW, "MinGW (Minimalist GNU for Windows)", 0, "g++.exe"},
{CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", 0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe
{CC_MSVC2005, "Microsoft (R) Visual Studio 2005 C/C++ Compiler (8.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe
- {CC_MSVC2005, "Microsoft (R) Visual Studio 2005 C/C++ Compiler (8.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe
{CC_MSVC2008, "Microsoft (R) Visual Studio 2008 C/C++ Compiler (9.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe
- {CC_MSVC2008, "Microsoft (R) Visual Studio 2008 C/C++ Compiler (9.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe
{CC_MSVC2010, "Microsoft (R) Visual Studio 2010 C/C++ Compiler (10.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe
- {CC_MSVC2010, "Microsoft (R) Visual Studio 2010 C/C++ Compiler (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe
{CC_MSVC2012, "Microsoft (R) Visual Studio 2012 C/C++ Compiler (11.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\11.0", "cl.exe"}, // link.exe, lib.exe
- {CC_MSVC2012, "Microsoft (R) Visual Studio 2012 C/C++ Compiler (11.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\11.0", "cl.exe"}, // link.exe, lib.exe
{CC_MSVC2013, "Microsoft (R) Visual Studio 2013 C/C++ Compiler (12.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0", "cl.exe"}, // link.exe, lib.exe
- {CC_MSVC2013, "Microsoft (R) Visual Studio 2013 C/C++ Compiler (12.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0", "cl.exe"}, // link.exe, lib.exe
// Microsoft skipped version 13
- {CC_MSVC2015, "Microsoft (R) Visual Studio 2015 C/C++ Compiler (14.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7\\14.0", "cl.exe"}, // link.exe, lib.exe
{CC_MSVC2015, "Microsoft (R) Visual Studio 2015 C/C++ Compiler (14.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\14.0", "cl.exe"}, // link.exe, lib.exe
{CC_UNKNOWN, "Unknown", 0, 0},
};
@@ -196,7 +190,8 @@ Compiler Environment::detectCompiler()
QString paths = qgetenv("PATH");
QStringList pathlist = paths.toLower().split(";");
for(int i = 0; compiler_info[i].compiler; ++i) {
- QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey).toLower();
+ QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey,
+ KEY_WOW64_32KEY).toLower();
if (productPath.length()) {
QStringList::iterator it;
for(it = pathlist.begin(); it != pathlist.end(); ++it) {
diff --git a/tools/shared/windows/registry.cpp b/tools/shared/windows/registry.cpp
index c989ae279b..432c707e28 100644
--- a/tools/shared/windows/registry.cpp
+++ b/tools/shared/windows/registry.cpp
@@ -74,7 +74,7 @@ static QString keyName(const QString &rKey)
}
#endif
-QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey)
+QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned long options)
{
QString result;
@@ -83,7 +83,8 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey)
QString rSubkeyPath = keyPath(rSubkey);
HKEY handle = 0;
- LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle);
+ LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0,
+ KEY_READ | options, &handle);
if (res != ERROR_SUCCESS)
return QString();
@@ -152,6 +153,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey)
#else
Q_UNUSED(parentHandle);
Q_UNUSED(rSubkey)
+ Q_UNUSED(options);
#endif
return result;
diff --git a/tools/shared/windows/registry_p.h b/tools/shared/windows/registry_p.h
index e13f9e6f46..4fa2d6aa9f 100644
--- a/tools/shared/windows/registry_p.h
+++ b/tools/shared/windows/registry_p.h
@@ -63,8 +63,14 @@ QT_BEGIN_NAMESPACE
* If the key is not found, or the registry cannot be accessed (for example
* if this code is compiled for a platform other than Windows), a null
* string is returned.
+ *
+ * 32-bit code reads from the registry's 32 bit view (Wow6432Node),
+ * 64 bit code reads from the 64 bit view.
+ * Pass KEY_WOW64_32KEY to access the 32 bit view regardless of the
+ * application's architecture, KEY_WOW64_64KEY respectively.
*/
-QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey);
+QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey,
+ unsigned long options = 0);
QT_END_NAMESPACE
diff --git a/util/unicode/data/ArabicShaping.txt b/util/unicode/data/ArabicShaping.txt
index fe653fca97..b0e5b5b7af 100644
--- a/util/unicode/data/ArabicShaping.txt
+++ b/util/unicode/data/ArabicShaping.txt
@@ -1,5 +1,5 @@
-# ArabicShaping-7.0.0.txt
-# Date: 2014-02-14, 21:00:00 GMT [RP, KW, LI]
+# ArabicShaping-8.0.0.txt
+# Date: 2015-02-17, 23:33:00 GMT [RP]
#
# This file is a normative contributory data file in the
# Unicode Character Database.
@@ -7,16 +7,17 @@
# Copyright (c) 1991-2014 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
#
-# This file defines the Joining_Type and Joining_Group property values for
-# Arabic, Syriac, N'Ko, Mandaic, Manichaean, and Psalter Pahlavi positional
-# shaping, repeating in machine readable form the information exemplified in
-# Tables 9-3, 9-8, 9-9, 9-10, 9-14, 9-15, 9-16, 9-19, 9-20, 10-XX, 19-5 of The
-# Unicode Standard, Version 7.0. This file also defines Joining_Type values
-# for Mongolian and Phags-pa positional shaping, which are not listed in
-# tables in the standard.
+# This file defines the Joining_Type and Joining_Group property
+# values for Arabic, Syriac, N'Ko, Mandaic, and Manichaean positional
+# shaping, repeating in machine readable form the information
+# exemplified in Tables 9-3, 9-8, 9-9, 9-10, 9-14, 9-15, 9-16, 9-19,
+# 9-20, 10-4, 10-5, 10-6, 10-7, and 19-5 of The Unicode Standard core
+# specification. This file also defines Joining_Type values for
+# Mongolian, Phags-pa, and Psalter Pahlavi positional shaping, which
+# are not listed in tables in the standard.
#
# See Sections 9.2, 9.3, 9.5, 10.5, 10.6, 13.4, 14.3, 19.4 of
-# The Unicode Standard, Version 7.0 for more information.
+# The Unicode Standard core specification for more information.
#
# Each line contains four fields, separated by a semicolon.
#
@@ -72,14 +73,15 @@
# no longer applies to its namesake character, U+06C2.
# See PropertyValueAliases.txt.
#
-# When other cursive scripts are added to the Unicode Standard in
-# the future, the joining group value of all its letters will default
-# to jg=No_Joining_Group in this data file. Other, more specific
+# When other cursive scripts are added to the Unicode Standard in the
+# future, the joining group value of all its letters will default to
+# jg=No_Joining_Group in this data file. Other, more specific
# joining group values will be defined only if an explicit proposal
# to define those values exactly has been approved by the UTC. This
# is the convention exemplified by the N'Ko, Mandaic, Mongolian,
-# and Phags-pa scripts. Only the Arabic and Syriac scripts
-# currently have explicit joining group values defined.
+# Phags-pa, and Psalter Pahlavi scripts. Only the Arabic,
+# Manichaean, and Syriac scripts currently have explicit joining
+# group values defined.
#
# Note: Code points that are not explicitly listed in this file are
# either of joining type T or U:
@@ -392,7 +394,7 @@
0844; MANDAIC AH; D; No_Joining_Group
0845; MANDAIC USHENNA; D; No_Joining_Group
0846; MANDAIC AZ; R; No_Joining_Group
-0847; MANDAIC IT; D; No_Joining_Group
+0847; MANDAIC IT; R; No_Joining_Group
0848; MANDAIC ATT; D; No_Joining_Group
0849; MANDAIC AKSA; R; No_Joining_Group
084A; MANDAIC AK; D; No_Joining_Group
@@ -400,7 +402,7 @@
084C; MANDAIC AM; D; No_Joining_Group
084D; MANDAIC AN; D; No_Joining_Group
084E; MANDAIC AS; D; No_Joining_Group
-084F; MANDAIC IN; R; No_Joining_Group
+084F; MANDAIC IN; D; No_Joining_Group
0850; MANDAIC AP; D; No_Joining_Group
0851; MANDAIC ASZ; D; No_Joining_Group
0852; MANDAIC AQ; D; No_Joining_Group
@@ -432,6 +434,8 @@
08B0; KEHEH WITH STROKE BELOW; D; GAF
08B1; STRAIGHT WAW; R; STRAIGHT WAW
08B2; REH WITH DOT AND INVERTED V ABOVE; R; REH
+08B3; AIN WITH 3 DOTS BELOW; D; AIN
+08B4; KAF WITH DOT BELOW; D; KAF
# Mongolian Characters
diff --git a/util/unicode/data/BidiMirroring.txt b/util/unicode/data/BidiMirroring.txt
index b1f7386d67..fbc60f1ab6 100644
--- a/util/unicode/data/BidiMirroring.txt
+++ b/util/unicode/data/BidiMirroring.txt
@@ -1,19 +1,19 @@
-# BidiMirroring-7.0.0.txt
-# Date: 2013-12-17, 00:00:00 GMT [KW, LI]
+# BidiMirroring-8.0.0.txt
+# Date: 2015-01-20, 18:30:00 GMT [KW, LI]
#
# Bidi_Mirroring_Glyph Property
#
# This file is an informative contributory data file in the
# Unicode Character Database.
#
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
#
# This data file lists characters that have the Bidi_Mirrored=Yes property
# value, for which there is another Unicode character that typically has a glyph
# that is the mirror image of the original character's glyph.
#
-# The repertoire covered by the file is Unicode 7.0.0.
+# The repertoire covered by the file is Unicode 8.0.0.
#
# The file contains a list of lines with mappings from one code point
# to another one for character-based mirroring.
@@ -42,7 +42,7 @@
#
# This file was originally created by Markus Scherer.
# Extended for Unicode 3.2, 4.0, 4.1, 5.0, 5.1, 5.2, and 6.0 by Ken Whistler,
-# and for Unicode 6.1, 6.2, 6.3, and 7.0 by Ken Whistler and Laurentiu Iancu.
+# and for subsequent versions by Ken Whistler and Laurentiu Iancu.
#
# ############################################################
#
diff --git a/util/unicode/data/Blocks.txt b/util/unicode/data/Blocks.txt
index 3653af7a47..0a4a580763 100644
--- a/util/unicode/data/Blocks.txt
+++ b/util/unicode/data/Blocks.txt
@@ -1,14 +1,11 @@
-# Blocks-7.0.0.txt
-# Date: 2014-04-03, 23:23:00 GMT [RP, KW]
+# Blocks-8.0.0.txt
+# Date: 2014-11-10, 23:04:00 GMT [KW]
#
# Unicode Character Database
# Copyright (c) 1991-2014 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
-# Note: The casing of block names is not normative.
-# For example, "Basic Latin" and "BASIC LATIN" are equivalent.
-#
# Format:
# Start Code..End Code; Block Name
@@ -20,6 +17,14 @@
# For more information on the comparison of property values,
# see UAX #44: http://www.unicode.org/reports/tr44/
#
+# All block ranges start with a value where (cp MOD 16) = 0,
+# and end with a value where (cp MOD 16) = 15. In other words,
+# the last hexadecimal digit of the start of range is ...0
+# and the last hexadecimal digit of the end of range is ...F.
+# This constraint on block ranges guarantees that allocations
+# are done in terms of whole columns, and that code chart display
+# never involves splitting columns in the charts.
+#
# All code points not explicitly listed for Block
# have the value No_Block.
@@ -168,6 +173,7 @@ AA80..AADF; Tai Viet
AAE0..AAFF; Meetei Mayek Extensions
AB00..AB2F; Ethiopic Extended-A
AB30..AB6F; Latin Extended-E
+AB70..ABBF; Cherokee Supplement
ABC0..ABFF; Meetei Mayek
AC00..D7AF; Hangul Syllables
D7B0..D7FF; Hangul Jamo Extended-B
@@ -210,6 +216,7 @@ FFF0..FFFF; Specials
10840..1085F; Imperial Aramaic
10860..1087F; Palmyrene
10880..108AF; Nabataean
+108E0..108FF; Hatran
10900..1091F; Phoenician
10920..1093F; Lydian
10980..1099F; Meroitic Hieroglyphs
@@ -223,6 +230,7 @@ FFF0..FFFF; Specials
10B60..10B7F; Inscriptional Pahlavi
10B80..10BAF; Psalter Pahlavi
10C00..10C4F; Old Turkic
+10C80..10CFF; Old Hungarian
10E60..10E7F; Rumi Numeral Symbols
11000..1107F; Brahmi
11080..110CF; Kaithi
@@ -232,17 +240,21 @@ FFF0..FFFF; Specials
11180..111DF; Sharada
111E0..111FF; Sinhala Archaic Numbers
11200..1124F; Khojki
+11280..112AF; Multani
112B0..112FF; Khudawadi
11300..1137F; Grantha
11480..114DF; Tirhuta
11580..115FF; Siddham
11600..1165F; Modi
11680..116CF; Takri
+11700..1173F; Ahom
118A0..118FF; Warang Citi
11AC0..11AFF; Pau Cin Hau
12000..123FF; Cuneiform
12400..1247F; Cuneiform Numbers and Punctuation
+12480..1254F; Early Dynastic Cuneiform
13000..1342F; Egyptian Hieroglyphs
+14400..1467F; Anatolian Hieroglyphs
16800..16A3F; Bamum Supplement
16A40..16A6F; Mro
16AD0..16AFF; Bassa Vah
@@ -257,6 +269,7 @@ FFF0..FFFF; Specials
1D300..1D35F; Tai Xuan Jing Symbols
1D360..1D37F; Counting Rod Numerals
1D400..1D7FF; Mathematical Alphanumeric Symbols
+1D800..1DAAF; Sutton SignWriting
1E800..1E8DF; Mende Kikakui
1EE00..1EEFF; Arabic Mathematical Alphabetic Symbols
1F000..1F02F; Mahjong Tiles
@@ -271,9 +284,11 @@ FFF0..FFFF; Specials
1F700..1F77F; Alchemical Symbols
1F780..1F7FF; Geometric Shapes Extended
1F800..1F8FF; Supplemental Arrows-C
+1F900..1F9FF; Supplemental Symbols and Pictographs
20000..2A6DF; CJK Unified Ideographs Extension B
2A700..2B73F; CJK Unified Ideographs Extension C
2B740..2B81F; CJK Unified Ideographs Extension D
+2B820..2CEAF; CJK Unified Ideographs Extension E
2F800..2FA1F; CJK Compatibility Ideographs Supplement
E0000..E007F; Tags
E0100..E01EF; Variation Selectors Supplement
diff --git a/util/unicode/data/CaseFolding.txt b/util/unicode/data/CaseFolding.txt
index 13c10a6c48..0197a6c40f 100644
--- a/util/unicode/data/CaseFolding.txt
+++ b/util/unicode/data/CaseFolding.txt
@@ -1,8 +1,8 @@
-# CaseFolding-7.0.0.txt
-# Date: 2014-04-09, 20:00:56 GMT [MD]
+# CaseFolding-8.0.0.txt
+# Date: 2015-01-13, 18:16:36 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -587,6 +587,12 @@
10C5; C; 2D25; # GEORGIAN CAPITAL LETTER HOE
10C7; C; 2D27; # GEORGIAN CAPITAL LETTER YN
10CD; C; 2D2D; # GEORGIAN CAPITAL LETTER AEN
+13F8; C; 13F0; # CHEROKEE SMALL LETTER YE
+13F9; C; 13F1; # CHEROKEE SMALL LETTER YI
+13FA; C; 13F2; # CHEROKEE SMALL LETTER YO
+13FB; C; 13F3; # CHEROKEE SMALL LETTER YU
+13FC; C; 13F4; # CHEROKEE SMALL LETTER YV
+13FD; C; 13F5; # CHEROKEE SMALL LETTER MV
1E00; C; 1E01; # LATIN CAPITAL LETTER A WITH RING BELOW
1E02; C; 1E03; # LATIN CAPITAL LETTER B WITH DOT ABOVE
1E04; C; 1E05; # LATIN CAPITAL LETTER B WITH DOT BELOW
@@ -1159,6 +1165,90 @@ A7AC; C; 0261; # LATIN CAPITAL LETTER SCRIPT G
A7AD; C; 026C; # LATIN CAPITAL LETTER L WITH BELT
A7B0; C; 029E; # LATIN CAPITAL LETTER TURNED K
A7B1; C; 0287; # LATIN CAPITAL LETTER TURNED T
+A7B2; C; 029D; # LATIN CAPITAL LETTER J WITH CROSSED-TAIL
+A7B3; C; AB53; # LATIN CAPITAL LETTER CHI
+A7B4; C; A7B5; # LATIN CAPITAL LETTER BETA
+A7B6; C; A7B7; # LATIN CAPITAL LETTER OMEGA
+AB70; C; 13A0; # CHEROKEE SMALL LETTER A
+AB71; C; 13A1; # CHEROKEE SMALL LETTER E
+AB72; C; 13A2; # CHEROKEE SMALL LETTER I
+AB73; C; 13A3; # CHEROKEE SMALL LETTER O
+AB74; C; 13A4; # CHEROKEE SMALL LETTER U
+AB75; C; 13A5; # CHEROKEE SMALL LETTER V
+AB76; C; 13A6; # CHEROKEE SMALL LETTER GA
+AB77; C; 13A7; # CHEROKEE SMALL LETTER KA
+AB78; C; 13A8; # CHEROKEE SMALL LETTER GE
+AB79; C; 13A9; # CHEROKEE SMALL LETTER GI
+AB7A; C; 13AA; # CHEROKEE SMALL LETTER GO
+AB7B; C; 13AB; # CHEROKEE SMALL LETTER GU
+AB7C; C; 13AC; # CHEROKEE SMALL LETTER GV
+AB7D; C; 13AD; # CHEROKEE SMALL LETTER HA
+AB7E; C; 13AE; # CHEROKEE SMALL LETTER HE
+AB7F; C; 13AF; # CHEROKEE SMALL LETTER HI
+AB80; C; 13B0; # CHEROKEE SMALL LETTER HO
+AB81; C; 13B1; # CHEROKEE SMALL LETTER HU
+AB82; C; 13B2; # CHEROKEE SMALL LETTER HV
+AB83; C; 13B3; # CHEROKEE SMALL LETTER LA
+AB84; C; 13B4; # CHEROKEE SMALL LETTER LE
+AB85; C; 13B5; # CHEROKEE SMALL LETTER LI
+AB86; C; 13B6; # CHEROKEE SMALL LETTER LO
+AB87; C; 13B7; # CHEROKEE SMALL LETTER LU
+AB88; C; 13B8; # CHEROKEE SMALL LETTER LV
+AB89; C; 13B9; # CHEROKEE SMALL LETTER MA
+AB8A; C; 13BA; # CHEROKEE SMALL LETTER ME
+AB8B; C; 13BB; # CHEROKEE SMALL LETTER MI
+AB8C; C; 13BC; # CHEROKEE SMALL LETTER MO
+AB8D; C; 13BD; # CHEROKEE SMALL LETTER MU
+AB8E; C; 13BE; # CHEROKEE SMALL LETTER NA
+AB8F; C; 13BF; # CHEROKEE SMALL LETTER HNA
+AB90; C; 13C0; # CHEROKEE SMALL LETTER NAH
+AB91; C; 13C1; # CHEROKEE SMALL LETTER NE
+AB92; C; 13C2; # CHEROKEE SMALL LETTER NI
+AB93; C; 13C3; # CHEROKEE SMALL LETTER NO
+AB94; C; 13C4; # CHEROKEE SMALL LETTER NU
+AB95; C; 13C5; # CHEROKEE SMALL LETTER NV
+AB96; C; 13C6; # CHEROKEE SMALL LETTER QUA
+AB97; C; 13C7; # CHEROKEE SMALL LETTER QUE
+AB98; C; 13C8; # CHEROKEE SMALL LETTER QUI
+AB99; C; 13C9; # CHEROKEE SMALL LETTER QUO
+AB9A; C; 13CA; # CHEROKEE SMALL LETTER QUU
+AB9B; C; 13CB; # CHEROKEE SMALL LETTER QUV
+AB9C; C; 13CC; # CHEROKEE SMALL LETTER SA
+AB9D; C; 13CD; # CHEROKEE SMALL LETTER S
+AB9E; C; 13CE; # CHEROKEE SMALL LETTER SE
+AB9F; C; 13CF; # CHEROKEE SMALL LETTER SI
+ABA0; C; 13D0; # CHEROKEE SMALL LETTER SO
+ABA1; C; 13D1; # CHEROKEE SMALL LETTER SU
+ABA2; C; 13D2; # CHEROKEE SMALL LETTER SV
+ABA3; C; 13D3; # CHEROKEE SMALL LETTER DA
+ABA4; C; 13D4; # CHEROKEE SMALL LETTER TA
+ABA5; C; 13D5; # CHEROKEE SMALL LETTER DE
+ABA6; C; 13D6; # CHEROKEE SMALL LETTER TE
+ABA7; C; 13D7; # CHEROKEE SMALL LETTER DI
+ABA8; C; 13D8; # CHEROKEE SMALL LETTER TI
+ABA9; C; 13D9; # CHEROKEE SMALL LETTER DO
+ABAA; C; 13DA; # CHEROKEE SMALL LETTER DU
+ABAB; C; 13DB; # CHEROKEE SMALL LETTER DV
+ABAC; C; 13DC; # CHEROKEE SMALL LETTER DLA
+ABAD; C; 13DD; # CHEROKEE SMALL LETTER TLA
+ABAE; C; 13DE; # CHEROKEE SMALL LETTER TLE
+ABAF; C; 13DF; # CHEROKEE SMALL LETTER TLI
+ABB0; C; 13E0; # CHEROKEE SMALL LETTER TLO
+ABB1; C; 13E1; # CHEROKEE SMALL LETTER TLU
+ABB2; C; 13E2; # CHEROKEE SMALL LETTER TLV
+ABB3; C; 13E3; # CHEROKEE SMALL LETTER TSA
+ABB4; C; 13E4; # CHEROKEE SMALL LETTER TSE
+ABB5; C; 13E5; # CHEROKEE SMALL LETTER TSI
+ABB6; C; 13E6; # CHEROKEE SMALL LETTER TSO
+ABB7; C; 13E7; # CHEROKEE SMALL LETTER TSU
+ABB8; C; 13E8; # CHEROKEE SMALL LETTER TSV
+ABB9; C; 13E9; # CHEROKEE SMALL LETTER WA
+ABBA; C; 13EA; # CHEROKEE SMALL LETTER WE
+ABBB; C; 13EB; # CHEROKEE SMALL LETTER WI
+ABBC; C; 13EC; # CHEROKEE SMALL LETTER WO
+ABBD; C; 13ED; # CHEROKEE SMALL LETTER WU
+ABBE; C; 13EE; # CHEROKEE SMALL LETTER WV
+ABBF; C; 13EF; # CHEROKEE SMALL LETTER YA
FB00; F; 0066 0066; # LATIN SMALL LIGATURE FF
FB01; F; 0066 0069; # LATIN SMALL LIGATURE FI
FB02; F; 0066 006C; # LATIN SMALL LIGATURE FL
@@ -1237,6 +1327,57 @@ FF3A; C; FF5A; # FULLWIDTH LATIN CAPITAL LETTER Z
10425; C; 1044D; # DESERET CAPITAL LETTER ENG
10426; C; 1044E; # DESERET CAPITAL LETTER OI
10427; C; 1044F; # DESERET CAPITAL LETTER EW
+10C80; C; 10CC0; # OLD HUNGARIAN CAPITAL LETTER A
+10C81; C; 10CC1; # OLD HUNGARIAN CAPITAL LETTER AA
+10C82; C; 10CC2; # OLD HUNGARIAN CAPITAL LETTER EB
+10C83; C; 10CC3; # OLD HUNGARIAN CAPITAL LETTER AMB
+10C84; C; 10CC4; # OLD HUNGARIAN CAPITAL LETTER EC
+10C85; C; 10CC5; # OLD HUNGARIAN CAPITAL LETTER ENC
+10C86; C; 10CC6; # OLD HUNGARIAN CAPITAL LETTER ECS
+10C87; C; 10CC7; # OLD HUNGARIAN CAPITAL LETTER ED
+10C88; C; 10CC8; # OLD HUNGARIAN CAPITAL LETTER AND
+10C89; C; 10CC9; # OLD HUNGARIAN CAPITAL LETTER E
+10C8A; C; 10CCA; # OLD HUNGARIAN CAPITAL LETTER CLOSE E
+10C8B; C; 10CCB; # OLD HUNGARIAN CAPITAL LETTER EE
+10C8C; C; 10CCC; # OLD HUNGARIAN CAPITAL LETTER EF
+10C8D; C; 10CCD; # OLD HUNGARIAN CAPITAL LETTER EG
+10C8E; C; 10CCE; # OLD HUNGARIAN CAPITAL LETTER EGY
+10C8F; C; 10CCF; # OLD HUNGARIAN CAPITAL LETTER EH
+10C90; C; 10CD0; # OLD HUNGARIAN CAPITAL LETTER I
+10C91; C; 10CD1; # OLD HUNGARIAN CAPITAL LETTER II
+10C92; C; 10CD2; # OLD HUNGARIAN CAPITAL LETTER EJ
+10C93; C; 10CD3; # OLD HUNGARIAN CAPITAL LETTER EK
+10C94; C; 10CD4; # OLD HUNGARIAN CAPITAL LETTER AK
+10C95; C; 10CD5; # OLD HUNGARIAN CAPITAL LETTER UNK
+10C96; C; 10CD6; # OLD HUNGARIAN CAPITAL LETTER EL
+10C97; C; 10CD7; # OLD HUNGARIAN CAPITAL LETTER ELY
+10C98; C; 10CD8; # OLD HUNGARIAN CAPITAL LETTER EM
+10C99; C; 10CD9; # OLD HUNGARIAN CAPITAL LETTER EN
+10C9A; C; 10CDA; # OLD HUNGARIAN CAPITAL LETTER ENY
+10C9B; C; 10CDB; # OLD HUNGARIAN CAPITAL LETTER O
+10C9C; C; 10CDC; # OLD HUNGARIAN CAPITAL LETTER OO
+10C9D; C; 10CDD; # OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG OE
+10C9E; C; 10CDE; # OLD HUNGARIAN CAPITAL LETTER RUDIMENTA OE
+10C9F; C; 10CDF; # OLD HUNGARIAN CAPITAL LETTER OEE
+10CA0; C; 10CE0; # OLD HUNGARIAN CAPITAL LETTER EP
+10CA1; C; 10CE1; # OLD HUNGARIAN CAPITAL LETTER EMP
+10CA2; C; 10CE2; # OLD HUNGARIAN CAPITAL LETTER ER
+10CA3; C; 10CE3; # OLD HUNGARIAN CAPITAL LETTER SHORT ER
+10CA4; C; 10CE4; # OLD HUNGARIAN CAPITAL LETTER ES
+10CA5; C; 10CE5; # OLD HUNGARIAN CAPITAL LETTER ESZ
+10CA6; C; 10CE6; # OLD HUNGARIAN CAPITAL LETTER ET
+10CA7; C; 10CE7; # OLD HUNGARIAN CAPITAL LETTER ENT
+10CA8; C; 10CE8; # OLD HUNGARIAN CAPITAL LETTER ETY
+10CA9; C; 10CE9; # OLD HUNGARIAN CAPITAL LETTER ECH
+10CAA; C; 10CEA; # OLD HUNGARIAN CAPITAL LETTER U
+10CAB; C; 10CEB; # OLD HUNGARIAN CAPITAL LETTER UU
+10CAC; C; 10CEC; # OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG UE
+10CAD; C; 10CED; # OLD HUNGARIAN CAPITAL LETTER RUDIMENTA UE
+10CAE; C; 10CEE; # OLD HUNGARIAN CAPITAL LETTER EV
+10CAF; C; 10CEF; # OLD HUNGARIAN CAPITAL LETTER EZ
+10CB0; C; 10CF0; # OLD HUNGARIAN CAPITAL LETTER EZS
+10CB1; C; 10CF1; # OLD HUNGARIAN CAPITAL LETTER ENT-SHAPED SIGN
+10CB2; C; 10CF2; # OLD HUNGARIAN CAPITAL LETTER US
118A0; C; 118C0; # WARANG CITI CAPITAL LETTER NGAA
118A1; C; 118C1; # WARANG CITI CAPITAL LETTER A
118A2; C; 118C2; # WARANG CITI CAPITAL LETTER WI
diff --git a/util/unicode/data/DerivedAge.txt b/util/unicode/data/DerivedAge.txt
index 134dbbbe44..f1b0addb1c 100644
--- a/util/unicode/data/DerivedAge.txt
+++ b/util/unicode/data/DerivedAge.txt
@@ -1,8 +1,8 @@
-# DerivedAge-7.0.0.txt
-# Date: 2014-05-28, 18:42:04 GMT [MD]
+# DerivedAge-8.0.0.txt
+# Date: 2015-02-13, 13:30:18 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -1467,4 +1467,72 @@ FE27..FE2D ; 7.0 # [7] COMBINING LIGATURE LEFT HALF BELOW..COMBINING CONJOI
# Total code points: 2834
+# ================================================
+
+# Age=V8_0
+
+# Newly assigned in Unicode 8.0.0 (June, 2015)
+
+08B3..08B4 ; 8.0 # [2] ARABIC LETTER AIN WITH THREE DOTS BELOW..ARABIC LETTER KAF WITH DOT BELOW
+08E3 ; 8.0 # ARABIC TURNED DAMMA BELOW
+0AF9 ; 8.0 # GUJARATI LETTER ZHA
+0C5A ; 8.0 # TELUGU LETTER RRRA
+0D5F ; 8.0 # MALAYALAM LETTER ARCHAIC II
+13F5 ; 8.0 # CHEROKEE LETTER MV
+13F8..13FD ; 8.0 # [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
+20BE ; 8.0 # LARI SIGN
+218A..218B ; 8.0 # [2] TURNED DIGIT TWO..TURNED DIGIT THREE
+2BEC..2BEF ; 8.0 # [4] LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS..DOWNWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS
+9FCD..9FD5 ; 8.0 # [9] CJK UNIFIED IDEOGRAPH-9FCD..CJK UNIFIED IDEOGRAPH-9FD5
+A69E ; 8.0 # COMBINING CYRILLIC LETTER EF
+A78F ; 8.0 # LATIN LETTER SINOLOGICAL DOT
+A7B2..A7B7 ; 8.0 # [6] LATIN CAPITAL LETTER J WITH CROSSED-TAIL..LATIN SMALL LETTER OMEGA
+A8FC..A8FD ; 8.0 # [2] DEVANAGARI SIGN SIDDHAM..DEVANAGARI JAIN OM
+AB60..AB63 ; 8.0 # [4] LATIN SMALL LETTER SAKHA YAT..LATIN SMALL LETTER UO
+AB70..ABBF ; 8.0 # [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
+FE2E..FE2F ; 8.0 # [2] COMBINING CYRILLIC TITLO LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
+108E0..108F2 ; 8.0 # [19] HATRAN LETTER ALEPH..HATRAN LETTER QOPH
+108F4..108F5 ; 8.0 # [2] HATRAN LETTER SHIN..HATRAN LETTER TAW
+108FB..108FF ; 8.0 # [5] HATRAN NUMBER ONE..HATRAN NUMBER ONE HUNDRED
+109BC..109BD ; 8.0 # [2] MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS..MEROITIC CURSIVE FRACTION ONE HALF
+109C0..109CF ; 8.0 # [16] MEROITIC CURSIVE NUMBER ONE..MEROITIC CURSIVE NUMBER SEVENTY
+109D2..109FF ; 8.0 # [46] MEROITIC CURSIVE NUMBER ONE HUNDRED..MEROITIC CURSIVE FRACTION TEN TWELFTHS
+10C80..10CB2 ; 8.0 # [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
+10CC0..10CF2 ; 8.0 # [51] OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US
+10CFA..10CFF ; 8.0 # [6] OLD HUNGARIAN NUMBER ONE..OLD HUNGARIAN NUMBER ONE THOUSAND
+111C9..111CC ; 8.0 # [4] SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK
+111DB..111DF ; 8.0 # [5] SHARADA SIGN SIDDHAM..SHARADA SECTION MARK-2
+11280..11286 ; 8.0 # [7] MULTANI LETTER A..MULTANI LETTER GA
+11288 ; 8.0 # MULTANI LETTER GHA
+1128A..1128D ; 8.0 # [4] MULTANI LETTER CA..MULTANI LETTER JJA
+1128F..1129D ; 8.0 # [15] MULTANI LETTER NYA..MULTANI LETTER BA
+1129F..112A9 ; 8.0 # [11] MULTANI LETTER BHA..MULTANI SECTION MARK
+11300 ; 8.0 # GRANTHA SIGN COMBINING ANUSVARA ABOVE
+11350 ; 8.0 # GRANTHA OM
+115CA..115DD ; 8.0 # [20] SIDDHAM SECTION MARK WITH TRIDENT AND U-SHAPED ORNAMENTS..SIDDHAM VOWEL SIGN ALTERNATE UU
+11700..11719 ; 8.0 # [26] AHOM LETTER KA..AHOM LETTER JHA
+1171D..1172B ; 8.0 # [15] AHOM CONSONANT SIGN MEDIAL LA..AHOM SIGN KILLER
+11730..1173F ; 8.0 # [16] AHOM DIGIT ZERO..AHOM SYMBOL VI
+12399 ; 8.0 # CUNEIFORM SIGN U U
+12480..12543 ; 8.0 # [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU
+14400..14646 ; 8.0 # [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530
+1D1DE..1D1E8 ; 8.0 # [11] MUSICAL SYMBOL KIEVAN C CLEF..MUSICAL SYMBOL KIEVAN FLAT SIGN
+1D800..1DA8B ; 8.0 # [652] SIGNWRITING HAND-FIST INDEX..SIGNWRITING PARENTHESIS
+1DA9B..1DA9F ; 8.0 # [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF ; 8.0 # [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
+1F32D..1F32F ; 8.0 # [3] HOT DOG..BURRITO
+1F37E..1F37F ; 8.0 # [2] BOTTLE WITH POPPING CORK..POPCORN
+1F3CF..1F3D3 ; 8.0 # [5] CRICKET BAT AND BALL..TABLE TENNIS PADDLE AND BALL
+1F3F8..1F3FF ; 8.0 # [8] BADMINTON RACQUET AND SHUTTLECOCK..EMOJI MODIFIER FITZPATRICK TYPE-6
+1F4FF ; 8.0 # PRAYER BEADS
+1F54B..1F54F ; 8.0 # [5] KAABA..BOWL OF HYGIEIA
+1F643..1F644 ; 8.0 # [2] UPSIDE-DOWN FACE..FACE WITH ROLLING EYES
+1F6D0 ; 8.0 # PLACE OF WORSHIP
+1F910..1F918 ; 8.0 # [9] ZIPPER-MOUTH FACE..SIGN OF THE HORNS
+1F980..1F984 ; 8.0 # [5] CRAB..UNICORN FACE
+1F9C0 ; 8.0 # CHEESE WEDGE
+2B820..2CEA1 ; 8.0 # [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1
+
+# Total code points: 7716
+
# EOF
diff --git a/util/unicode/data/DerivedNormalizationProps.txt b/util/unicode/data/DerivedNormalizationProps.txt
index 147ef2b531..6492493da3 100644
--- a/util/unicode/data/DerivedNormalizationProps.txt
+++ b/util/unicode/data/DerivedNormalizationProps.txt
@@ -1,8 +1,8 @@
-# DerivedNormalizationProps-7.0.0.txt
-# Date: 2013-12-03, 15:11:47 GMT [MD]
+# DerivedNormalizationProps-8.0.0.txt
+# Date: 2015-02-13, 13:30:23 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
@@ -3504,6 +3504,12 @@ FFE3 ; Expands_On_NFKC # Sk FULLWIDTH MACRON
10CD ; NFKC_CF; 2D2D # L& GEORGIAN CAPITAL LETTER AEN
10FC ; NFKC_CF; 10DC # Lm MODIFIER LETTER GEORGIAN NAR
115F..1160 ; NFKC_CF; # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER
+13F8 ; NFKC_CF; 13F0 # L& CHEROKEE SMALL LETTER YE
+13F9 ; NFKC_CF; 13F1 # L& CHEROKEE SMALL LETTER YI
+13FA ; NFKC_CF; 13F2 # L& CHEROKEE SMALL LETTER YO
+13FB ; NFKC_CF; 13F3 # L& CHEROKEE SMALL LETTER YU
+13FC ; NFKC_CF; 13F4 # L& CHEROKEE SMALL LETTER YV
+13FD ; NFKC_CF; 13F5 # L& CHEROKEE SMALL LETTER MV
17B4..17B5 ; NFKC_CF; # Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
180B..180D ; NFKC_CF; # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
180E ; NFKC_CF; # Cf MONGOLIAN VOWEL SEPARATOR
@@ -5259,12 +5265,96 @@ A7AC ; NFKC_CF; 0261 # L& LATIN CAPITAL LETTER SCRIPT G
A7AD ; NFKC_CF; 026C # L& LATIN CAPITAL LETTER L WITH BELT
A7B0 ; NFKC_CF; 029E # L& LATIN CAPITAL LETTER TURNED K
A7B1 ; NFKC_CF; 0287 # L& LATIN CAPITAL LETTER TURNED T
+A7B2 ; NFKC_CF; 029D # L& LATIN CAPITAL LETTER J WITH CROSSED-TAIL
+A7B3 ; NFKC_CF; AB53 # L& LATIN CAPITAL LETTER CHI
+A7B4 ; NFKC_CF; A7B5 # L& LATIN CAPITAL LETTER BETA
+A7B6 ; NFKC_CF; A7B7 # L& LATIN CAPITAL LETTER OMEGA
A7F8 ; NFKC_CF; 0127 # Lm MODIFIER LETTER CAPITAL H WITH STROKE
A7F9 ; NFKC_CF; 0153 # Lm MODIFIER LETTER SMALL LIGATURE OE
AB5C ; NFKC_CF; A727 # Lm MODIFIER LETTER SMALL HENG
AB5D ; NFKC_CF; AB37 # Lm MODIFIER LETTER SMALL L WITH INVERTED LAZY S
AB5E ; NFKC_CF; 026B # Lm MODIFIER LETTER SMALL L WITH MIDDLE TILDE
AB5F ; NFKC_CF; AB52 # Lm MODIFIER LETTER SMALL U WITH LEFT HOOK
+AB70 ; NFKC_CF; 13A0 # L& CHEROKEE SMALL LETTER A
+AB71 ; NFKC_CF; 13A1 # L& CHEROKEE SMALL LETTER E
+AB72 ; NFKC_CF; 13A2 # L& CHEROKEE SMALL LETTER I
+AB73 ; NFKC_CF; 13A3 # L& CHEROKEE SMALL LETTER O
+AB74 ; NFKC_CF; 13A4 # L& CHEROKEE SMALL LETTER U
+AB75 ; NFKC_CF; 13A5 # L& CHEROKEE SMALL LETTER V
+AB76 ; NFKC_CF; 13A6 # L& CHEROKEE SMALL LETTER GA
+AB77 ; NFKC_CF; 13A7 # L& CHEROKEE SMALL LETTER KA
+AB78 ; NFKC_CF; 13A8 # L& CHEROKEE SMALL LETTER GE
+AB79 ; NFKC_CF; 13A9 # L& CHEROKEE SMALL LETTER GI
+AB7A ; NFKC_CF; 13AA # L& CHEROKEE SMALL LETTER GO
+AB7B ; NFKC_CF; 13AB # L& CHEROKEE SMALL LETTER GU
+AB7C ; NFKC_CF; 13AC # L& CHEROKEE SMALL LETTER GV
+AB7D ; NFKC_CF; 13AD # L& CHEROKEE SMALL LETTER HA
+AB7E ; NFKC_CF; 13AE # L& CHEROKEE SMALL LETTER HE
+AB7F ; NFKC_CF; 13AF # L& CHEROKEE SMALL LETTER HI
+AB80 ; NFKC_CF; 13B0 # L& CHEROKEE SMALL LETTER HO
+AB81 ; NFKC_CF; 13B1 # L& CHEROKEE SMALL LETTER HU
+AB82 ; NFKC_CF; 13B2 # L& CHEROKEE SMALL LETTER HV
+AB83 ; NFKC_CF; 13B3 # L& CHEROKEE SMALL LETTER LA
+AB84 ; NFKC_CF; 13B4 # L& CHEROKEE SMALL LETTER LE
+AB85 ; NFKC_CF; 13B5 # L& CHEROKEE SMALL LETTER LI
+AB86 ; NFKC_CF; 13B6 # L& CHEROKEE SMALL LETTER LO
+AB87 ; NFKC_CF; 13B7 # L& CHEROKEE SMALL LETTER LU
+AB88 ; NFKC_CF; 13B8 # L& CHEROKEE SMALL LETTER LV
+AB89 ; NFKC_CF; 13B9 # L& CHEROKEE SMALL LETTER MA
+AB8A ; NFKC_CF; 13BA # L& CHEROKEE SMALL LETTER ME
+AB8B ; NFKC_CF; 13BB # L& CHEROKEE SMALL LETTER MI
+AB8C ; NFKC_CF; 13BC # L& CHEROKEE SMALL LETTER MO
+AB8D ; NFKC_CF; 13BD # L& CHEROKEE SMALL LETTER MU
+AB8E ; NFKC_CF; 13BE # L& CHEROKEE SMALL LETTER NA
+AB8F ; NFKC_CF; 13BF # L& CHEROKEE SMALL LETTER HNA
+AB90 ; NFKC_CF; 13C0 # L& CHEROKEE SMALL LETTER NAH
+AB91 ; NFKC_CF; 13C1 # L& CHEROKEE SMALL LETTER NE
+AB92 ; NFKC_CF; 13C2 # L& CHEROKEE SMALL LETTER NI
+AB93 ; NFKC_CF; 13C3 # L& CHEROKEE SMALL LETTER NO
+AB94 ; NFKC_CF; 13C4 # L& CHEROKEE SMALL LETTER NU
+AB95 ; NFKC_CF; 13C5 # L& CHEROKEE SMALL LETTER NV
+AB96 ; NFKC_CF; 13C6 # L& CHEROKEE SMALL LETTER QUA
+AB97 ; NFKC_CF; 13C7 # L& CHEROKEE SMALL LETTER QUE
+AB98 ; NFKC_CF; 13C8 # L& CHEROKEE SMALL LETTER QUI
+AB99 ; NFKC_CF; 13C9 # L& CHEROKEE SMALL LETTER QUO
+AB9A ; NFKC_CF; 13CA # L& CHEROKEE SMALL LETTER QUU
+AB9B ; NFKC_CF; 13CB # L& CHEROKEE SMALL LETTER QUV
+AB9C ; NFKC_CF; 13CC # L& CHEROKEE SMALL LETTER SA
+AB9D ; NFKC_CF; 13CD # L& CHEROKEE SMALL LETTER S
+AB9E ; NFKC_CF; 13CE # L& CHEROKEE SMALL LETTER SE
+AB9F ; NFKC_CF; 13CF # L& CHEROKEE SMALL LETTER SI
+ABA0 ; NFKC_CF; 13D0 # L& CHEROKEE SMALL LETTER SO
+ABA1 ; NFKC_CF; 13D1 # L& CHEROKEE SMALL LETTER SU
+ABA2 ; NFKC_CF; 13D2 # L& CHEROKEE SMALL LETTER SV
+ABA3 ; NFKC_CF; 13D3 # L& CHEROKEE SMALL LETTER DA
+ABA4 ; NFKC_CF; 13D4 # L& CHEROKEE SMALL LETTER TA
+ABA5 ; NFKC_CF; 13D5 # L& CHEROKEE SMALL LETTER DE
+ABA6 ; NFKC_CF; 13D6 # L& CHEROKEE SMALL LETTER TE
+ABA7 ; NFKC_CF; 13D7 # L& CHEROKEE SMALL LETTER DI
+ABA8 ; NFKC_CF; 13D8 # L& CHEROKEE SMALL LETTER TI
+ABA9 ; NFKC_CF; 13D9 # L& CHEROKEE SMALL LETTER DO
+ABAA ; NFKC_CF; 13DA # L& CHEROKEE SMALL LETTER DU
+ABAB ; NFKC_CF; 13DB # L& CHEROKEE SMALL LETTER DV
+ABAC ; NFKC_CF; 13DC # L& CHEROKEE SMALL LETTER DLA
+ABAD ; NFKC_CF; 13DD # L& CHEROKEE SMALL LETTER TLA
+ABAE ; NFKC_CF; 13DE # L& CHEROKEE SMALL LETTER TLE
+ABAF ; NFKC_CF; 13DF # L& CHEROKEE SMALL LETTER TLI
+ABB0 ; NFKC_CF; 13E0 # L& CHEROKEE SMALL LETTER TLO
+ABB1 ; NFKC_CF; 13E1 # L& CHEROKEE SMALL LETTER TLU
+ABB2 ; NFKC_CF; 13E2 # L& CHEROKEE SMALL LETTER TLV
+ABB3 ; NFKC_CF; 13E3 # L& CHEROKEE SMALL LETTER TSA
+ABB4 ; NFKC_CF; 13E4 # L& CHEROKEE SMALL LETTER TSE
+ABB5 ; NFKC_CF; 13E5 # L& CHEROKEE SMALL LETTER TSI
+ABB6 ; NFKC_CF; 13E6 # L& CHEROKEE SMALL LETTER TSO
+ABB7 ; NFKC_CF; 13E7 # L& CHEROKEE SMALL LETTER TSU
+ABB8 ; NFKC_CF; 13E8 # L& CHEROKEE SMALL LETTER TSV
+ABB9 ; NFKC_CF; 13E9 # L& CHEROKEE SMALL LETTER WA
+ABBA ; NFKC_CF; 13EA # L& CHEROKEE SMALL LETTER WE
+ABBB ; NFKC_CF; 13EB # L& CHEROKEE SMALL LETTER WI
+ABBC ; NFKC_CF; 13EC # L& CHEROKEE SMALL LETTER WO
+ABBD ; NFKC_CF; 13ED # L& CHEROKEE SMALL LETTER WU
+ABBE ; NFKC_CF; 13EE # L& CHEROKEE SMALL LETTER WV
+ABBF ; NFKC_CF; 13EF # L& CHEROKEE SMALL LETTER YA
F900 ; NFKC_CF; 8C48 # Lo CJK COMPATIBILITY IDEOGRAPH-F900
F901 ; NFKC_CF; 66F4 # Lo CJK COMPATIBILITY IDEOGRAPH-F901
F902 ; NFKC_CF; 8ECA # Lo CJK COMPATIBILITY IDEOGRAPH-F902
@@ -6641,6 +6731,57 @@ FFF0..FFF8 ; NFKC_CF; # Cn [9] <reserved-FFF0>..<reserved-FF
10425 ; NFKC_CF; 1044D # L& DESERET CAPITAL LETTER ENG
10426 ; NFKC_CF; 1044E # L& DESERET CAPITAL LETTER OI
10427 ; NFKC_CF; 1044F # L& DESERET CAPITAL LETTER EW
+10C80 ; NFKC_CF; 10CC0 # L& OLD HUNGARIAN CAPITAL LETTER A
+10C81 ; NFKC_CF; 10CC1 # L& OLD HUNGARIAN CAPITAL LETTER AA
+10C82 ; NFKC_CF; 10CC2 # L& OLD HUNGARIAN CAPITAL LETTER EB
+10C83 ; NFKC_CF; 10CC3 # L& OLD HUNGARIAN CAPITAL LETTER AMB
+10C84 ; NFKC_CF; 10CC4 # L& OLD HUNGARIAN CAPITAL LETTER EC
+10C85 ; NFKC_CF; 10CC5 # L& OLD HUNGARIAN CAPITAL LETTER ENC
+10C86 ; NFKC_CF; 10CC6 # L& OLD HUNGARIAN CAPITAL LETTER ECS
+10C87 ; NFKC_CF; 10CC7 # L& OLD HUNGARIAN CAPITAL LETTER ED
+10C88 ; NFKC_CF; 10CC8 # L& OLD HUNGARIAN CAPITAL LETTER AND
+10C89 ; NFKC_CF; 10CC9 # L& OLD HUNGARIAN CAPITAL LETTER E
+10C8A ; NFKC_CF; 10CCA # L& OLD HUNGARIAN CAPITAL LETTER CLOSE E
+10C8B ; NFKC_CF; 10CCB # L& OLD HUNGARIAN CAPITAL LETTER EE
+10C8C ; NFKC_CF; 10CCC # L& OLD HUNGARIAN CAPITAL LETTER EF
+10C8D ; NFKC_CF; 10CCD # L& OLD HUNGARIAN CAPITAL LETTER EG
+10C8E ; NFKC_CF; 10CCE # L& OLD HUNGARIAN CAPITAL LETTER EGY
+10C8F ; NFKC_CF; 10CCF # L& OLD HUNGARIAN CAPITAL LETTER EH
+10C90 ; NFKC_CF; 10CD0 # L& OLD HUNGARIAN CAPITAL LETTER I
+10C91 ; NFKC_CF; 10CD1 # L& OLD HUNGARIAN CAPITAL LETTER II
+10C92 ; NFKC_CF; 10CD2 # L& OLD HUNGARIAN CAPITAL LETTER EJ
+10C93 ; NFKC_CF; 10CD3 # L& OLD HUNGARIAN CAPITAL LETTER EK
+10C94 ; NFKC_CF; 10CD4 # L& OLD HUNGARIAN CAPITAL LETTER AK
+10C95 ; NFKC_CF; 10CD5 # L& OLD HUNGARIAN CAPITAL LETTER UNK
+10C96 ; NFKC_CF; 10CD6 # L& OLD HUNGARIAN CAPITAL LETTER EL
+10C97 ; NFKC_CF; 10CD7 # L& OLD HUNGARIAN CAPITAL LETTER ELY
+10C98 ; NFKC_CF; 10CD8 # L& OLD HUNGARIAN CAPITAL LETTER EM
+10C99 ; NFKC_CF; 10CD9 # L& OLD HUNGARIAN CAPITAL LETTER EN
+10C9A ; NFKC_CF; 10CDA # L& OLD HUNGARIAN CAPITAL LETTER ENY
+10C9B ; NFKC_CF; 10CDB # L& OLD HUNGARIAN CAPITAL LETTER O
+10C9C ; NFKC_CF; 10CDC # L& OLD HUNGARIAN CAPITAL LETTER OO
+10C9D ; NFKC_CF; 10CDD # L& OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG OE
+10C9E ; NFKC_CF; 10CDE # L& OLD HUNGARIAN CAPITAL LETTER RUDIMENTA OE
+10C9F ; NFKC_CF; 10CDF # L& OLD HUNGARIAN CAPITAL LETTER OEE
+10CA0 ; NFKC_CF; 10CE0 # L& OLD HUNGARIAN CAPITAL LETTER EP
+10CA1 ; NFKC_CF; 10CE1 # L& OLD HUNGARIAN CAPITAL LETTER EMP
+10CA2 ; NFKC_CF; 10CE2 # L& OLD HUNGARIAN CAPITAL LETTER ER
+10CA3 ; NFKC_CF; 10CE3 # L& OLD HUNGARIAN CAPITAL LETTER SHORT ER
+10CA4 ; NFKC_CF; 10CE4 # L& OLD HUNGARIAN CAPITAL LETTER ES
+10CA5 ; NFKC_CF; 10CE5 # L& OLD HUNGARIAN CAPITAL LETTER ESZ
+10CA6 ; NFKC_CF; 10CE6 # L& OLD HUNGARIAN CAPITAL LETTER ET
+10CA7 ; NFKC_CF; 10CE7 # L& OLD HUNGARIAN CAPITAL LETTER ENT
+10CA8 ; NFKC_CF; 10CE8 # L& OLD HUNGARIAN CAPITAL LETTER ETY
+10CA9 ; NFKC_CF; 10CE9 # L& OLD HUNGARIAN CAPITAL LETTER ECH
+10CAA ; NFKC_CF; 10CEA # L& OLD HUNGARIAN CAPITAL LETTER U
+10CAB ; NFKC_CF; 10CEB # L& OLD HUNGARIAN CAPITAL LETTER UU
+10CAC ; NFKC_CF; 10CEC # L& OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG UE
+10CAD ; NFKC_CF; 10CED # L& OLD HUNGARIAN CAPITAL LETTER RUDIMENTA UE
+10CAE ; NFKC_CF; 10CEE # L& OLD HUNGARIAN CAPITAL LETTER EV
+10CAF ; NFKC_CF; 10CEF # L& OLD HUNGARIAN CAPITAL LETTER EZ
+10CB0 ; NFKC_CF; 10CF0 # L& OLD HUNGARIAN CAPITAL LETTER EZS
+10CB1 ; NFKC_CF; 10CF1 # L& OLD HUNGARIAN CAPITAL LETTER ENT-SHAPED SIGN
+10CB2 ; NFKC_CF; 10CF2 # L& OLD HUNGARIAN CAPITAL LETTER US
118A0 ; NFKC_CF; 118C0 # L& WARANG CITI CAPITAL LETTER NGAA
118A1 ; NFKC_CF; 118C1 # L& WARANG CITI CAPITAL LETTER A
118A2 ; NFKC_CF; 118C2 # L& WARANG CITI CAPITAL LETTER WI
@@ -8493,7 +8634,7 @@ E0080..E00FF ; NFKC_CF; # Cn [128] <reserved-E0080>..<reserved-E
E0100..E01EF ; NFKC_CF; # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
E01F0..E0FFF ; NFKC_CF; # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
-# Total code points: 10005
+# Total code points: 10146
# ================================================
@@ -8827,6 +8968,7 @@ E01F0..E0FFF ; NFKC_CF; # Cn [3600] <reserved-E01F0>..<reserved-
10CD ; Changes_When_NFKC_Casefolded # L& GEORGIAN CAPITAL LETTER AEN
10FC ; Changes_When_NFKC_Casefolded # Lm MODIFIER LETTER GEORGIAN NAR
115F..1160 ; Changes_When_NFKC_Casefolded # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER
+13F8..13FD ; Changes_When_NFKC_Casefolded # L& [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
17B4..17B5 ; Changes_When_NFKC_Casefolded # Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
180B..180D ; Changes_When_NFKC_Casefolded # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
180E ; Changes_When_NFKC_Casefolded # Cf MONGOLIAN VOWEL SEPARATOR
@@ -9248,9 +9390,11 @@ A7A4 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER N W
A7A6 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER R WITH OBLIQUE STROKE
A7A8 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER S WITH OBLIQUE STROKE
A7AA..A7AD ; Changes_When_NFKC_Casefolded # L& [4] LATIN CAPITAL LETTER H WITH HOOK..LATIN CAPITAL LETTER L WITH BELT
-A7B0..A7B1 ; Changes_When_NFKC_Casefolded # L& [2] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER TURNED T
+A7B0..A7B4 ; Changes_When_NFKC_Casefolded # L& [5] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER BETA
+A7B6 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER OMEGA
A7F8..A7F9 ; Changes_When_NFKC_Casefolded # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE
AB5C..AB5F ; Changes_When_NFKC_Casefolded # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK
+AB70..ABBF ; Changes_When_NFKC_Casefolded # L& [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
F900..FA0D ; Changes_When_NFKC_Casefolded # Lo [270] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA0D
FA10 ; Changes_When_NFKC_Casefolded # Lo CJK COMPATIBILITY IDEOGRAPH-FA10
FA12 ; Changes_When_NFKC_Casefolded # Lo CJK COMPATIBILITY IDEOGRAPH-FA12
@@ -9375,6 +9519,7 @@ FFE9..FFEC ; Changes_When_NFKC_Casefolded # Sm [4] HALFWIDTH LEFTWARDS ARRO
FFED..FFEE ; Changes_When_NFKC_Casefolded # So [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CIRCLE
FFF0..FFF8 ; Changes_When_NFKC_Casefolded # Cn [9] <reserved-FFF0>..<reserved-FFF8>
10400..10427 ; Changes_When_NFKC_Casefolded # L& [40] DESERET CAPITAL LETTER LONG I..DESERET CAPITAL LETTER EW
+10C80..10CB2 ; Changes_When_NFKC_Casefolded # L& [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
118A0..118BF ; Changes_When_NFKC_Casefolded # L& [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO
1BCA0..1BCA3 ; Changes_When_NFKC_Casefolded # Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP
1D15E..1D164 ; Changes_When_NFKC_Casefolded # So [7] MUSICAL SYMBOL HALF NOTE..MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
@@ -9472,6 +9617,6 @@ E0080..E00FF ; Changes_When_NFKC_Casefolded # Cn [128] <reserved-E0080>..<reser
E0100..E01EF ; Changes_When_NFKC_Casefolded # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
E01F0..E0FFF ; Changes_When_NFKC_Casefolded # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
-# Total code points: 10005
+# Total code points: 10146
# EOF
diff --git a/util/unicode/data/GraphemeBreakProperty.txt b/util/unicode/data/GraphemeBreakProperty.txt
index 752ee7926a..fba2ee8793 100644
--- a/util/unicode/data/GraphemeBreakProperty.txt
+++ b/util/unicode/data/GraphemeBreakProperty.txt
@@ -1,8 +1,8 @@
-# GraphemeBreakProperty-7.0.0.txt
-# Date: 2014-02-19, 15:51:21 GMT [MD]
+# GraphemeBreakProperty-8.0.0.txt
+# Date: 2015-02-13, 13:47:14 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
@@ -89,7 +89,7 @@ E01F0..E0FFF ; Control # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
0825..0827 ; Extend # Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U
0829..082D ; Extend # Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA
0859..085B ; Extend # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK
-08E4..0902 ; Extend # Mn [31] ARABIC CURLY FATHA..DEVANAGARI SIGN ANUSVARA
+08E3..0902 ; Extend # Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA
093A ; Extend # Mn DEVANAGARI VOWEL SIGN OE
093C ; Extend # Mn DEVANAGARI SIGN NUKTA
0941..0948 ; Extend # Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI
@@ -250,7 +250,7 @@ E01F0..E0FFF ; Control # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
A66F ; Extend # Mn COMBINING CYRILLIC VZMET
A670..A672 ; Extend # Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN
A674..A67D ; Extend # Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK
-A69F ; Extend # Mn COMBINING CYRILLIC LETTER IOTIFIED E
+A69E..A69F ; Extend # Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E
A6F0..A6F1 ; Extend # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
A802 ; Extend # Mn SYLOTI NAGRI SIGN DVISVARA
A806 ; Extend # Mn SYLOTI NAGRI SIGN HASANTA
@@ -283,7 +283,7 @@ ABE8 ; Extend # Mn MEETEI MAYEK VOWEL SIGN UNAP
ABED ; Extend # Mn MEETEI MAYEK APUN IYEK
FB1E ; Extend # Mn HEBREW POINT JUDEO-SPANISH VARIKA
FE00..FE0F ; Extend # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
-FE20..FE2D ; Extend # Mn [14] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON BELOW
+FE20..FE2F ; Extend # Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
101FD ; Extend # Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE
102E0 ; Extend # Mn COPTIC EPACT THOUSANDS MARK
@@ -305,12 +305,13 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
11173 ; Extend # Mn MAHAJANI SIGN NUKTA
11180..11181 ; Extend # Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA
111B6..111BE ; Extend # Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O
+111CA..111CC ; Extend # Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK
1122F..11231 ; Extend # Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI
11234 ; Extend # Mn KHOJKI SIGN ANUSVARA
11236..11237 ; Extend # Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA
112DF ; Extend # Mn KHUDAWADI SIGN ANUSVARA
112E3..112EA ; Extend # Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA
-11301 ; Extend # Mn GRANTHA SIGN CANDRABINDU
+11300..11301 ; Extend # Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU
1133C ; Extend # Mn GRANTHA SIGN NUKTA
1133E ; Extend # Mc GRANTHA VOWEL SIGN AA
11340 ; Extend # Mn GRANTHA VOWEL SIGN II
@@ -327,6 +328,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
115B2..115B5 ; Extend # Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR
115BC..115BD ; Extend # Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA
115BF..115C0 ; Extend # Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA
+115DC..115DD ; Extend # Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU
11633..1163A ; Extend # Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI
1163D ; Extend # Mn MODI SIGN ANUSVARA
1163F..11640 ; Extend # Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA
@@ -334,6 +336,9 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
116AD ; Extend # Mn TAKRI VOWEL SIGN AA
116B0..116B5 ; Extend # Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU
116B7 ; Extend # Mn TAKRI SIGN NUKTA
+1171D..1171F ; Extend # Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA
+11722..11725 ; Extend # Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU
+11727..1172B ; Extend # Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER
16AF0..16AF4 ; Extend # Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE
16B30..16B36 ; Extend # Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM
16F8F..16F92 ; Extend # Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW
@@ -345,10 +350,16 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
1D185..1D18B ; Extend # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
1D1AA..1D1AD ; Extend # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
1D242..1D244 ; Extend # Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
+1DA00..1DA36 ; Extend # Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
+1DA3B..1DA6C ; Extend # Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
+1DA75 ; Extend # Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
+1DA84 ; Extend # Mn SIGNWRITING LOCATION HEAD NECK
+1DA9B..1DA9F ; Extend # Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF ; Extend # Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
1E8D0..1E8D6 ; Extend # Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS
E0100..E01EF ; Extend # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
-# Total code points: 1461
+# Total code points: 1610
# ================================================
@@ -412,8 +423,6 @@ E0100..E01EF ; Extend # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
1929..192B ; SpacingMark # Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA
1930..1931 ; SpacingMark # Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA
1933..1938 ; SpacingMark # Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA
-19B5..19B7 ; SpacingMark # Mc [3] NEW TAI LUE VOWEL SIGN E..NEW TAI LUE VOWEL SIGN O
-19BA ; SpacingMark # Mc NEW TAI LUE VOWEL SIGN AY
1A19..1A1A ; SpacingMark # Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O
1A55 ; SpacingMark # Mc TAI THAM CONSONANT SIGN MEDIAL RA
1A57 ; SpacingMark # Mc TAI THAM CONSONANT SIGN LA TANG LAI
@@ -487,11 +496,13 @@ ABEC ; SpacingMark # Mc MEETEI MAYEK LUM IYEK
116AC ; SpacingMark # Mc TAKRI SIGN VISARGA
116AE..116AF ; SpacingMark # Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II
116B6 ; SpacingMark # Mc TAKRI SIGN VIRAMA
+11720..11721 ; SpacingMark # Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA
+11726 ; SpacingMark # Mc AHOM VOWEL SIGN E
16F51..16F7E ; SpacingMark # Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG
1D166 ; SpacingMark # Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM
1D16D ; SpacingMark # Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT
-# Total code points: 331
+# Total code points: 330
# ================================================
diff --git a/util/unicode/data/LineBreak.txt b/util/unicode/data/LineBreak.txt
index e496c5fc0e..b627f874d0 100644
--- a/util/unicode/data/LineBreak.txt
+++ b/util/unicode/data/LineBreak.txt
@@ -1,5 +1,5 @@
-# LineBreak-7.0.0.txt
-# Date: 2014-02-28, 23:15:00 GMT [KW, LI]
+# LineBreak-8.0.0.txt
+# Date: 2015-02-13, 09:15:00 GMT [KW, LI]
#
# Line_Break Property
#
@@ -7,7 +7,7 @@
# Unicode Character Database.
# It contains both normative and informative data.
#
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
#
# The format is two fields separated by a semicolon.
@@ -30,6 +30,7 @@
# CJK Unified Ideographs Extension B: U+20000..U+2A6DF
# CJK Unified Ideographs Extension C: U+2A700..U+2B73F
# CJK Unified Ideographs Extension D: U+2B740..U+2B81F
+# CJK Unified Ideographs Extension E: U+2B820..U+2CEAF
# CJK Compatibility Ideographs Supplement: U+2F800..U+2FA1F
# and any other reserved code points on
# Planes 2 and 3: U+20000..U+2FFFD
@@ -272,8 +273,8 @@
0840..0858;AL # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN
0859..085B;CM # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK
085E;AL # Po MANDAIC PUNCTUATION
-08A0..08B2;AL # Lo [19] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER ZAIN WITH INVERTED V ABOVE
-08E4..08FF;CM # Mn [28] ARABIC CURLY FATHA..ARABIC MARK SIDEWAYS NOON GHUNNA
+08A0..08B4;AL # Lo [21] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER KAF WITH DOT BELOW
+08E3..08FF;CM # Mn [29] ARABIC TURNED DAMMA BELOW..ARABIC MARK SIDEWAYS NOON GHUNNA
0900..0902;CM # Mn [3] DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANAGARI SIGN ANUSVARA
0903;CM # Mc DEVANAGARI SIGN VISARGA
0904..0939;AL # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA
@@ -366,6 +367,7 @@
0AE6..0AEF;NU # Nd [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE
0AF0;AL # Po GUJARATI ABBREVIATION SIGN
0AF1;PR # Sc GUJARATI RUPEE SIGN
+0AF9;AL # Lo GUJARATI LETTER ZHA
0B01;CM # Mn ORIYA SIGN CANDRABINDU
0B02..0B03;CM # Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA
0B05..0B0C;AL # Lo [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L
@@ -428,7 +430,7 @@
0C46..0C48;CM # Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI
0C4A..0C4D;CM # Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA
0C55..0C56;CM # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK
-0C58..0C59;AL # Lo [2] TELUGU LETTER TSA..TELUGU LETTER DZA
+0C58..0C5A;AL # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA
0C60..0C61;AL # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
0C62..0C63;CM # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL
0C66..0C6F;NU # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE
@@ -469,7 +471,7 @@
0D4D;CM # Mn MALAYALAM SIGN VIRAMA
0D4E;AL # Lo MALAYALAM LETTER DOT REPH
0D57;CM # Mc MALAYALAM AU LENGTH MARK
-0D60..0D61;AL # Lo [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL
+0D5F..0D61;AL # Lo [3] MALAYALAM LETTER ARCHAIC II..MALAYALAM LETTER VOCALIC LL
0D62..0D63;CM # Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL
0D66..0D6F;NU # Nd [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE
0D70..0D75;AL # No [6] MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE QUARTERS
@@ -641,7 +643,8 @@
1369..137C;AL # No [20] ETHIOPIC DIGIT ONE..ETHIOPIC NUMBER TEN THOUSAND
1380..138F;AL # Lo [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE
1390..1399;AL # So [10] ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MARK KURT
-13A0..13F4;AL # Lo [85] CHEROKEE LETTER A..CHEROKEE LETTER YV
+13A0..13F5;AL # Lu [86] CHEROKEE LETTER A..CHEROKEE LETTER MV
+13F8..13FD;AL # Ll [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
1400;BA # Pd CANADIAN SYLLABICS HYPHEN
1401..166C;AL # Lo [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA
166D..166E;AL # Po [2] CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP
@@ -716,9 +719,7 @@
1950..196D;SA # Lo [30] TAI LE LETTER KA..TAI LE LETTER AI
1970..1974;SA # Lo [5] TAI LE LETTER TONE-2..TAI LE LETTER TONE-6
1980..19AB;SA # Lo [44] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW SUA
-19B0..19C0;SA # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY
-19C1..19C7;SA # Lo [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B
-19C8..19C9;SA # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2
+19B0..19C9;SA # Lo [26] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE TONE MARK-2
19D0..19D9;NU # Nd [10] NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE
19DA;SA # No NEW TAI LUE THAM DIGIT ONE
19DE..19DF;SA # So [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV
@@ -926,7 +927,8 @@
20B7..20BA;PR # Sc [4] SPESMILO SIGN..TURKISH LIRA SIGN
20BB;PO # Sc NORDIC MARK SIGN
20BC..20BD;PR # Sc [2] MANAT SIGN..RUBLE SIGN
-20BE..20CF;PR # Cn [18] <reserved-20BE>..<reserved-20CF>
+20BE;PO # Sc LARI SIGN
+20BF..20CF;PR # Cn [17] <reserved-20BF>..<reserved-20CF>
20D0..20DC;CM # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE
20DD..20E0;CM # Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH
20E1;CM # Mn COMBINING LEFT RIGHT ARROW ABOVE
@@ -988,6 +990,7 @@
2183..2184;AL # L& [2] ROMAN NUMERAL REVERSED ONE HUNDRED..LATIN SMALL LETTER REVERSED C
2185..2188;AL # Nl [4] ROMAN NUMERAL SIX LATE FORM..ROMAN NUMERAL ONE HUNDRED THOUSAND
2189;AI # No VULGAR FRACTION ZERO THIRDS
+218A..218B;AL # So [2] TURNED DIGIT TWO..TURNED DIGIT THREE
2190..2194;AI # Sm [5] LEFTWARDS ARROW..LEFT RIGHT ARROW
2195..2199;AI # So [5] UP DOWN ARROW..SOUTH WEST ARROW
219A..219B;AL # Sm [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE
@@ -1063,7 +1066,9 @@
22A5;AI # Sm UP TACK
22A6..22BE;AL # Sm [25] ASSERTION..RIGHT ANGLE WITH ARC
22BF;AI # Sm RIGHT TRIANGLE
-22C0..22FF;AL # Sm [64] N-ARY LOGICAL AND..Z NOTATION BAG MEMBERSHIP
+22C0..22EE;AL # Sm [47] N-ARY LOGICAL AND..VERTICAL ELLIPSIS
+22EF;IN # Sm MIDLINE HORIZONTAL ELLIPSIS
+22F0..22FF;AL # Sm [16] UP RIGHT DIAGONAL ELLIPSIS..Z NOTATION BAG MEMBERSHIP
2300..2307;AL # So [8] DIAMETER SIGN..WAVY LINE
2308;OP # Ps LEFT CEILING
2309;CL # Pe RIGHT CEILING
@@ -1273,6 +1278,7 @@
2B98..2BB9;AL # So [34] THREE-D TOP-LIGHTED LEFTWARDS EQUILATERAL ARROWHEAD..UP ARROWHEAD IN A RECTANGLE BOX
2BBD..2BC8;AL # So [12] BALLOT BOX WITH LIGHT X..BLACK MEDIUM RIGHT-POINTING TRIANGLE CENTRED
2BCA..2BD1;AL # So [8] TOP HALF BLACK CIRCLE..UNCERTAINTY SIGN
+2BEC..2BEF;AL # So [4] LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS..DOWNWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS
2C00..2C2E;AL # Lu [47] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE
2C30..2C5E;AL # Ll [47] GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER LATINATE MYSLITE
2C60..2C7B;AL # L& [28] LATIN CAPITAL LETTER L WITH DOUBLE BAR..LATIN LETTER SMALL CAPITAL TURNED E
@@ -1470,8 +1476,8 @@
3400..4DB5;ID # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5
4DB6..4DBF;ID # Cn [10] <reserved-4DB6>..<reserved-4DBF>
4DC0..4DFF;AL # So [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION
-4E00..9FCC;ID # Lo [20941] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCC
-9FCD..9FFF;ID # Cn [51] <reserved-9FCD>..<reserved-9FFF>
+4E00..9FD5;ID # Lo [20950] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FD5
+9FD6..9FFF;ID # Cn [42] <reserved-9FD6>..<reserved-9FFF>
A000..A014;ID # Lo [21] YI SYLLABLE IT..YI SYLLABLE E
A015;NS # Lm YI SYLLABLE WU
A016..A48C;ID # Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR
@@ -1497,7 +1503,7 @@ A67E;AL # Po CYRILLIC KAVYKA
A67F;AL # Lm CYRILLIC PAYEROK
A680..A69B;AL # L& [28] CYRILLIC CAPITAL LETTER DWE..CYRILLIC SMALL LETTER CROSSED O
A69C..A69D;AL # Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER CYRILLIC SOFT SIGN
-A69F;CM # Mn COMBINING CYRILLIC LETTER IOTIFIED E
+A69E..A69F;CM # Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E
A6A0..A6E5;AL # Lo [70] BAMUM LETTER A..BAMUM LETTER KI
A6E6..A6EF;AL # Nl [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM
A6F0..A6F1;CM # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
@@ -1512,8 +1518,9 @@ A771..A787;AL # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULA
A788;AL # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT
A789..A78A;AL # Sk [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN
A78B..A78E;AL # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT
+A78F;AL # Lo LATIN LETTER SINOLOGICAL DOT
A790..A7AD;AL # L& [30] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER L WITH BELT
-A7B0..A7B1;AL # Lu [2] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER TURNED T
+A7B0..A7B7;AL # L& [8] LATIN CAPITAL LETTER TURNED K..LATIN SMALL LETTER OMEGA
A7F7;AL # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I
A7F8..A7F9;AL # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE
A7FA;AL # Ll LATIN LETTER SMALL CAPITAL TURNED M
@@ -1546,6 +1553,8 @@ A8E0..A8F1;CM # Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANA
A8F2..A8F7;AL # Lo [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
A8F8..A8FA;AL # Po [3] DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET
A8FB;AL # Lo DEVANAGARI HEADSTROKE
+A8FC;BB # Po DEVANAGARI SIGN SIDDHAM
+A8FD;AL # Lo DEVANAGARI JAIN OM
A900..A909;NU # Nd [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGIT NINE
A90A..A925;AL # Lo [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO
A926..A92D;CM # Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU
@@ -1630,7 +1639,8 @@ AB28..AB2E;AL # Lo [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SYLLABLE BBO
AB30..AB5A;AL # Ll [43] LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG
AB5B;AL # Sk MODIFIER BREVE WITH INVERTED BREVE
AB5C..AB5F;AL # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK
-AB64..AB65;AL # Ll [2] LATIN SMALL LETTER INVERTED ALPHA..GREEK LETTER SMALL CAPITAL OMEGA
+AB60..AB65;AL # Ll [6] LATIN SMALL LETTER SAKHA YAT..GREEK LETTER SMALL CAPITAL OMEGA
+AB70..ABBF;AL # Ll [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
ABC0..ABE2;AL # Lo [35] MEETEI MAYEK LETTER KOK..MEETEI MAYEK LETTER I LONSUM
ABE3..ABE4;CM # Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP
ABE5;CM # Mn MEETEI MAYEK VOWEL SIGN ANAP
@@ -2479,7 +2489,7 @@ FE15..FE16;EX # Po [2] PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK..
FE17;OP # Ps PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
FE18;CL # Pe PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET
FE19;IN # Po PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS
-FE20..FE2D;CM # Mn [14] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON BELOW
+FE20..FE2F;CM # Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
FE30;ID # Po PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
FE31..FE32;ID # Pd [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH
FE33..FE34;ID # Pc [2] PRESENTATION FORM FOR VERTICAL LOW LINE..PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
@@ -2647,6 +2657,9 @@ FFFD;AI # So REPLACEMENT CHARACTER
10879..1087F;AL # No [7] PALMYRENE NUMBER ONE..PALMYRENE NUMBER TWENTY
10880..1089E;AL # Lo [31] NABATAEAN LETTER FINAL ALEPH..NABATAEAN LETTER TAW
108A7..108AF;AL # No [9] NABATAEAN NUMBER ONE..NABATAEAN NUMBER ONE HUNDRED
+108E0..108F2;AL # Lo [19] HATRAN LETTER ALEPH..HATRAN LETTER QOPH
+108F4..108F5;AL # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW
+108FB..108FF;AL # No [5] HATRAN NUMBER ONE..HATRAN NUMBER ONE HUNDRED
10900..10915;AL # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU
10916..1091B;AL # No [6] PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER THREE
1091F;BA # Po PHOENICIAN WORD SEPARATOR
@@ -2654,7 +2667,10 @@ FFFD;AI # So REPLACEMENT CHARACTER
1093F;AL # Po LYDIAN TRIANGULAR MARK
10980..1099F;AL # Lo [32] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC HIEROGLYPHIC SYMBOL VIDJ-2
109A0..109B7;AL # Lo [24] MEROITIC CURSIVE LETTER A..MEROITIC CURSIVE LETTER DA
+109BC..109BD;AL # No [2] MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS..MEROITIC CURSIVE FRACTION ONE HALF
109BE..109BF;AL # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN
+109C0..109CF;AL # No [16] MEROITIC CURSIVE NUMBER ONE..MEROITIC CURSIVE NUMBER SEVENTY
+109D2..109FF;AL # No [46] MEROITIC CURSIVE NUMBER ONE HUNDRED..MEROITIC CURSIVE FRACTION TEN TWELFTHS
10A00;AL # Lo KHAROSHTHI LETTER A
10A01..10A03;CM # Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R
10A05..10A06;CM # Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O
@@ -2689,6 +2705,9 @@ FFFD;AI # So REPLACEMENT CHARACTER
10B99..10B9C;AL # Po [4] PSALTER PAHLAVI SECTION MARK..PSALTER PAHLAVI FOUR DOTS WITH DOT
10BA9..10BAF;AL # No [7] PSALTER PAHLAVI NUMBER ONE..PSALTER PAHLAVI NUMBER ONE HUNDRED
10C00..10C48;AL # Lo [73] OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTER ORKHON BASH
+10C80..10CB2;AL # Lu [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
+10CC0..10CF2;AL # Ll [51] OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US
+10CFA..10CFF;AL # No [6] OLD HUNGARIAN NUMBER ONE..OLD HUNGARIAN NUMBER ONE THOUSAND
10E60..10E7E;AL # No [31] RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS
11000;CM # Mc BRAHMI SIGN CANDRABINDU
11001;CM # Mn BRAHMI SIGN ANUSVARA
@@ -2734,9 +2753,14 @@ FFFD;AI # So REPLACEMENT CHARACTER
111C5..111C6;BA # Po [2] SHARADA DANDA..SHARADA DOUBLE DANDA
111C7;AL # Po SHARADA ABBREVIATION SIGN
111C8;BA # Po SHARADA SEPARATOR
+111C9;AL # Po SHARADA SANDHI MARK
+111CA..111CC;CM # Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK
111CD;AL # Po SHARADA SUTRA MARK
111D0..111D9;NU # Nd [10] SHARADA DIGIT ZERO..SHARADA DIGIT NINE
111DA;AL # Lo SHARADA EKAM
+111DB;BB # Po SHARADA SIGN SIDDHAM
+111DC;AL # Lo SHARADA HEADSTROKE
+111DD..111DF;BA # Po [3] SHARADA CONTINUATION SIGN..SHARADA SECTION MARK-2
111E1..111F4;AL # No [20] SINHALA ARCHAIC DIGIT ONE..SINHALA ARCHAIC NUMBER ONE THOUSAND
11200..11211;AL # Lo [18] KHOJKI LETTER A..KHOJKI LETTER JJA
11213..1122B;AL # Lo [25] KHOJKI LETTER NYA..KHOJKI LETTER LLA
@@ -2750,12 +2774,18 @@ FFFD;AI # So REPLACEMENT CHARACTER
1123A;AL # Po KHOJKI WORD SEPARATOR
1123B..1123C;BA # Po [2] KHOJKI SECTION MARK..KHOJKI DOUBLE SECTION MARK
1123D;AL # Po KHOJKI ABBREVIATION SIGN
+11280..11286;AL # Lo [7] MULTANI LETTER A..MULTANI LETTER GA
+11288;AL # Lo MULTANI LETTER GHA
+1128A..1128D;AL # Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA
+1128F..1129D;AL # Lo [15] MULTANI LETTER NYA..MULTANI LETTER BA
+1129F..112A8;AL # Lo [10] MULTANI LETTER BHA..MULTANI LETTER RHA
+112A9;BA # Po MULTANI SECTION MARK
112B0..112DE;AL # Lo [47] KHUDAWADI LETTER A..KHUDAWADI LETTER HA
112DF;CM # Mn KHUDAWADI SIGN ANUSVARA
112E0..112E2;CM # Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II
112E3..112EA;CM # Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA
112F0..112F9;NU # Nd [10] KHUDAWADI DIGIT ZERO..KHUDAWADI DIGIT NINE
-11301;CM # Mn GRANTHA SIGN CANDRABINDU
+11300..11301;CM # Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU
11302..11303;CM # Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA
11305..1130C;AL # Lo [8] GRANTHA LETTER A..GRANTHA LETTER VOCALIC L
1130F..11310;AL # Lo [2] GRANTHA LETTER EE..GRANTHA LETTER AI
@@ -2770,6 +2800,7 @@ FFFD;AI # So REPLACEMENT CHARACTER
11341..11344;CM # Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR
11347..11348;CM # Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI
1134B..1134D;CM # Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA
+11350;AL # Lo GRANTHA OM
11357;CM # Mc GRANTHA AU LENGTH MARK
1135D..11361;AL # Lo [5] GRANTHA SIGN PLUTA..GRANTHA LETTER VOCALIC LL
11362..11363;CM # Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL
@@ -2799,7 +2830,9 @@ FFFD;AI # So REPLACEMENT CHARACTER
115C2..115C3;BA # Po [2] SIDDHAM DANDA..SIDDHAM DOUBLE DANDA
115C4..115C5;EX # Po [2] SIDDHAM SEPARATOR DOT..SIDDHAM SEPARATOR BAR
115C6..115C8;AL # Po [3] SIDDHAM REPETITION MARK-1..SIDDHAM REPETITION MARK-3
-115C9;BA # Po SIDDHAM END OF TEXT MARK
+115C9..115D7;BA # Po [15] SIDDHAM END OF TEXT MARK..SIDDHAM SECTION MARK WITH CIRCLES AND FOUR ENCLOSURES
+115D8..115DB;AL # Lo [4] SIDDHAM LETTER THREE-CIRCLE ALTERNATE I..SIDDHAM LETTER ALTERNATE U
+115DC..115DD;CM # Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU
11600..1162F;AL # Lo [48] MODI LETTER A..MODI LETTER LLA
11630..11632;CM # Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II
11633..1163A;CM # Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI
@@ -2820,14 +2853,25 @@ FFFD;AI # So REPLACEMENT CHARACTER
116B6;CM # Mc TAKRI SIGN VIRAMA
116B7;CM # Mn TAKRI SIGN NUKTA
116C0..116C9;NU # Nd [10] TAKRI DIGIT ZERO..TAKRI DIGIT NINE
+11700..11719;SA # Lo [26] AHOM LETTER KA..AHOM LETTER JHA
+1171D..1171F;SA # Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA
+11720..11721;SA # Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA
+11722..11725;SA # Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU
+11726;SA # Mc AHOM VOWEL SIGN E
+11727..1172B;SA # Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER
+11730..11739;NU # Nd [10] AHOM DIGIT ZERO..AHOM DIGIT NINE
+1173A..1173B;SA # No [2] AHOM NUMBER TEN..AHOM NUMBER TWENTY
+1173C..1173E;BA # Po [3] AHOM SIGN SMALL SECTION..AHOM SIGN RULAI
+1173F;SA # So AHOM SYMBOL VI
118A0..118DF;AL # L& [64] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI SMALL LETTER VIYO
118E0..118E9;NU # Nd [10] WARANG CITI DIGIT ZERO..WARANG CITI DIGIT NINE
118EA..118F2;AL # No [9] WARANG CITI NUMBER TEN..WARANG CITI NUMBER NINETY
118FF;AL # Lo WARANG CITI OM
11AC0..11AF8;AL # Lo [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL
-12000..12398;AL # Lo [921] CUNEIFORM SIGN A..CUNEIFORM SIGN UM TIMES ME
+12000..12399;AL # Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U
12400..1246E;AL # Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM
12470..12474;BA # Po [5] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL QUADCOLON
+12480..12543;AL # Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU
13000..13257;AL # Lo [600] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH O006
13258..1325A;OP # Lo [3] EGYPTIAN HIEROGLYPH O006A..EGYPTIAN HIEROGLYPH O006C
1325B..1325D;CL # Lo [3] EGYPTIAN HIEROGLYPH O006D..EGYPTIAN HIEROGLYPH O006F
@@ -2842,6 +2886,10 @@ FFFD;AI # So REPLACEMENT CHARACTER
13379;OP # Lo EGYPTIAN HIEROGLYPH V011A
1337A..1337B;CL # Lo [2] EGYPTIAN HIEROGLYPH V011B..EGYPTIAN HIEROGLYPH V011C
1337C..1342E;AL # Lo [179] EGYPTIAN HIEROGLYPH V012..EGYPTIAN HIEROGLYPH AA032
+14400..145CD;AL # Lo [462] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A409
+145CE;OP # Lo ANATOLIAN HIEROGLYPH A410 BEGIN LOGOGRAM MARK
+145CF;CL # Lo ANATOLIAN HIEROGLYPH A410A END LOGOGRAM MARK
+145D0..14646;AL # Lo [119] ANATOLIAN HIEROGLYPH A411..ANATOLIAN HIEROGLYPH A530
16800..16A38;AL # Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ
16A40..16A5E;AL # Lo [31] MRO LETTER TA..MRO LETTER TEK
16A60..16A69;NU # Nd [10] MRO DIGIT ZERO..MRO DIGIT NINE
@@ -2888,7 +2936,7 @@ FFFD;AI # So REPLACEMENT CHARACTER
1D185..1D18B;CM # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
1D18C..1D1A9;AL # So [30] MUSICAL SYMBOL RINFORZANDO..MUSICAL SYMBOL DEGREE SLASH
1D1AA..1D1AD;CM # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
-1D1AE..1D1DD;AL # So [48] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL PES SUBPUNCTIS
+1D1AE..1D1E8;AL # So [59] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL KIEVAN FLAT SIGN
1D200..1D241;AL # So [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54
1D242..1D244;CM # Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
1D245;AL # So GREEK MUSICAL LEIMMA
@@ -2935,6 +2983,19 @@ FFFD;AI # So REPLACEMENT CHARACTER
1D7C3;AL # Sm MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
1D7C4..1D7CB;AL # L& [8] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD SMALL DIGAMMA
1D7CE..1D7FF;NU # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
+1D800..1D9FF;AL # So [512] SIGNWRITING HAND-FIST INDEX..SIGNWRITING HEAD
+1DA00..1DA36;CM # Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
+1DA37..1DA3A;AL # So [4] SIGNWRITING AIR BLOW SMALL ROTATIONS..SIGNWRITING BREATH EXHALE
+1DA3B..1DA6C;CM # Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
+1DA6D..1DA74;AL # So [8] SIGNWRITING SHOULDER HIP SPINE..SIGNWRITING TORSO-FLOORPLANE TWISTING
+1DA75;CM # Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
+1DA76..1DA83;AL # So [14] SIGNWRITING LIMB COMBINATION..SIGNWRITING LOCATION DEPTH
+1DA84;CM # Mn SIGNWRITING LOCATION HEAD NECK
+1DA85..1DA86;AL # So [2] SIGNWRITING LOCATION TORSO..SIGNWRITING LOCATION LIMBS DIGITS
+1DA87..1DA8A;BA # Po [4] SIGNWRITING COMMA..SIGNWRITING COLON
+1DA8B;AL # Po SIGNWRITING PARENTHESIS
+1DA9B..1DA9F;CM # Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF;CM # Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
1E800..1E8C4;AL # Lo [197] MENDE KIKAKUI SYLLABLE M001 KI..MENDE KIKAKUI SYLLABLE M060 NYON
1E8C7..1E8CF;AL # No [9] MENDE KIKAKUI DIGIT ONE..MENDE KIKAKUI DIGIT NINE
1E8D0..1E8D6;CM # Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS
@@ -2989,16 +3050,14 @@ FFFD;AI # So REPLACEMENT CHARACTER
1F210..1F23A;ID # So [43] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-55B6
1F240..1F248;ID # So [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557
1F250..1F251;ID # So [2] CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT
-1F300..1F32C;ID # So [45] CYCLONE..WIND BLOWING FACE
-1F330..1F37D;ID # So [78] CHESTNUT..FORK AND KNIFE WITH PLATE
-1F380..1F39B;ID # So [28] RIBBON..CONTROL KNOBS
+1F300..1F39B;ID # So [156] CYCLONE..CONTROL KNOBS
1F39C..1F39D;AL # So [2] BEAMED ASCENDING MUSICAL NOTES..BEAMED DESCENDING MUSICAL NOTES
1F39E..1F3B4;ID # So [23] FILM FRAMES..FLOWER PLAYING CARDS
1F3B5..1F3B6;AL # So [2] MUSICAL NOTE..MULTIPLE MUSICAL NOTES
1F3B7..1F3BB;ID # So [5] SAXOPHONE..VIOLIN
1F3BC;AL # So MUSICAL SCORE
-1F3BD..1F3CE;ID # So [18] RUNNING SHIRT WITH SASH..RACING CAR
-1F3D4..1F3F7;ID # So [36] SNOW CAPPED MOUNTAIN..LABEL
+1F3BD..1F3FA;ID # So [62] RUNNING SHIRT WITH SASH..AMPHORA
+1F3FB..1F3FF;AL # Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6
1F400..1F49F;ID # So [160] RAT..HEART DECORATION
1F4A0;AL # So DIAMOND SHAPE WITH A DOT INSIDE
1F4A1;ID # So ELECTRIC LIGHT BULB
@@ -3009,27 +3068,25 @@ FFFD;AI # So REPLACEMENT CHARACTER
1F4AF;AL # So HUNDRED POINTS SYMBOL
1F4B0;ID # So MONEY BAG
1F4B1..1F4B2;AL # So [2] CURRENCY EXCHANGE..HEAVY DOLLAR SIGN
-1F4B3..1F4FE;ID # So [76] CREDIT CARD..PORTABLE STEREO
+1F4B3..1F4FF;ID # So [77] CREDIT CARD..PRAYER BEADS
1F500..1F506;AL # So [7] TWISTED RIGHTWARDS ARROWS..HIGH BRIGHTNESS SYMBOL
1F507..1F516;ID # So [16] SPEAKER WITH CANCELLATION STROKE..BOOKMARK
1F517..1F524;AL # So [14] LINK SYMBOL..INPUT SYMBOL FOR LATIN LETTERS
1F525..1F531;ID # So [13] FIRE..TRIDENT EMBLEM
1F532..1F549;AL # So [24] BLACK SQUARE BUTTON..OM SYMBOL
-1F54A;ID # So DOVE OF PEACE
-1F550..1F579;ID # So [42] CLOCK FACE ONE OCLOCK..JOYSTICK
+1F54A..1F579;ID # So [48] DOVE OF PEACE..JOYSTICK
1F57B..1F5A3;ID # So [41] LEFT HAND TELEPHONE RECEIVER..BLACK DOWN POINTING BACKHAND INDEX
1F5A5..1F5D3;ID # So [47] DESKTOP COMPUTER..SPIRAL CALENDAR PAD
1F5D4..1F5DB;AL # So [8] DESKTOP WINDOW..DECREASE FONT SIZE SYMBOL
1F5DC..1F5F3;ID # So [24] COMPRESSION..BALLOT BOX WITH BALLOT
1F5F4..1F5F9;AL # So [6] BALLOT SCRIPT X..BALLOT BOX WITH BOLD CHECK
1F5FA..1F5FF;ID # So [6] WORLD MAP..MOYAI
-1F600..1F642;ID # So [67] GRINNING FACE..SLIGHTLY SMILING FACE
-1F645..1F64F;ID # So [11] FACE WITH NO GOOD GESTURE..PERSON WITH FOLDED HANDS
+1F600..1F64F;ID # So [80] GRINNING FACE..PERSON WITH FOLDED HANDS
1F650..1F675;AL # So [38] NORTH WEST POINTING LEAF..SWASH AMPERSAND ORNAMENT
1F676..1F678;QU # So [3] SANS-SERIF HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT..SANS-SERIF HEAVY LOW DOUBLE COMMA QUOTATION MARK ORNAMENT
1F679..1F67B;NS # So [3] HEAVY INTERROBANG ORNAMENT..HEAVY SANS-SERIF INTERROBANG ORNAMENT
1F67C..1F67F;AL # So [4] VERY HEAVY SOLIDUS..REVERSE CHECKER BOARD
-1F680..1F6CF;ID # So [80] ROCKET..BED
+1F680..1F6D0;ID # So [81] ROCKET..PLACE OF WORSHIP
1F6E0..1F6EC;ID # So [13] HAMMER AND WRENCH..AIRPLANE ARRIVING
1F6F0..1F6F3;ID # So [4] SATELLITE..PASSENGER SHIP
1F700..1F773;AL # So [116] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE
@@ -3039,12 +3096,17 @@ FFFD;AI # So REPLACEMENT CHARACTER
1F850..1F859;AL # So [10] LEFTWARDS SANS-SERIF ARROW..UP DOWN SANS-SERIF ARROW
1F860..1F887;AL # So [40] WIDE-HEADED LEFTWARDS LIGHT BARB ARROW..WIDE-HEADED SOUTH WEST VERY HEAVY BARB ARROW
1F890..1F8AD;AL # So [30] LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS
+1F910..1F918;ID # So [9] ZIPPER-MOUTH FACE..SIGN OF THE HORNS
+1F980..1F984;ID # So [5] CRAB..UNICORN FACE
+1F9C0;ID # So CHEESE WEDGE
20000..2A6D6;ID # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6
2A6D7..2A6FF;ID # Cn [41] <reserved-2A6D7>..<reserved-2A6FF>
2A700..2B734;ID # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734
2B735..2B73F;ID # Cn [11] <reserved-2B735>..<reserved-2B73F>
2B740..2B81D;ID # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D
-2B81E..2F7FF;ID # Cn [16354] <reserved-2B81E>..<reserved-2F7FF>
+2B81E..2B81F;ID # Cn [2] <reserved-2B81E>..<reserved-2B81F>
+2B820..2CEA1;ID # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1
+2CEA2..2F7FF;ID # Cn [10590] <reserved-2CEA2>..<reserved-2F7FF>
2F800..2FA1D;ID # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
2FA1E..2FFFD;ID # Cn [1504] <reserved-2FA1E>..<reserved-2FFFD>
30000..3FFFD;ID # Cn [65534] <reserved-30000>..<reserved-3FFFD>
diff --git a/util/unicode/data/NormalizationCorrections.txt b/util/unicode/data/NormalizationCorrections.txt
index 79c77da79a..04fc10d11c 100644
--- a/util/unicode/data/NormalizationCorrections.txt
+++ b/util/unicode/data/NormalizationCorrections.txt
@@ -1,10 +1,10 @@
-# NormalizationCorrections-7.0.0.txt
-# Date: 2013-12-17, 00:00:00 GMT [KW, LI]
+# NormalizationCorrections-8.0.0.txt
+# Date: 2015-03-07, 01:30:00 GMT [KW, LI]
#
# This file is a normative contributory data file in the
# Unicode Character Database.
#
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
#
# The normalization stability policy of the Unicode Consortium
diff --git a/util/unicode/data/Scripts.txt b/util/unicode/data/Scripts.txt
index 0b69438a57..7e42740407 100644
--- a/util/unicode/data/Scripts.txt
+++ b/util/unicode/data/Scripts.txt
@@ -1,10 +1,16 @@
-# Scripts-7.0.0.txt
-# Date: 2014-05-15, 00:11:35 GMT [MD]
+# Scripts-8.0.0.txt
+# Date: 2015-03-11, 22:29:42 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
+# For more information, see:
+# UAX #24, Unicode Script Property: http://www.unicode.org/reports/tr24/
+# Especially the sections:
+# http://www.unicode.org/reports/tr24/#Assignment_Script_Values
+# http://www.unicode.org/reports/tr24/#Assignment_ScriptX_Values
+#
# ================================================
@@ -89,7 +95,6 @@
061C ; Common # Cf ARABIC LETTER MARK
061F ; Common # Po ARABIC QUESTION MARK
0640 ; Common # Lm ARABIC TATWEEL
-0660..0669 ; Common # Nd [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE
06DD ; Common # Cf ARABIC END OF AYAH
0964..0965 ; Common # Po [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA
0E3F ; Common # Sc THAI CURRENCY SYMBOL BAHT
@@ -148,7 +153,7 @@
208A..208C ; Common # Sm [3] SUBSCRIPT PLUS SIGN..SUBSCRIPT EQUALS SIGN
208D ; Common # Ps SUBSCRIPT LEFT PARENTHESIS
208E ; Common # Pe SUBSCRIPT RIGHT PARENTHESIS
-20A0..20BD ; Common # Sc [30] EURO-CURRENCY SIGN..RUBLE SIGN
+20A0..20BE ; Common # Sc [31] EURO-CURRENCY SIGN..LARI SIGN
2100..2101 ; Common # So [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT
2102 ; Common # L& DOUBLE-STRUCK CAPITAL C
2103..2106 ; Common # So [4] DEGREE CELSIUS..CADA UNA
@@ -182,6 +187,7 @@
214F ; Common # So SYMBOL FOR SAMARITAN SOURCE
2150..215F ; Common # No [16] VULGAR FRACTION ONE SEVENTH..FRACTION NUMERATOR ONE
2189 ; Common # No VULGAR FRACTION ZERO THIRDS
+218A..218B ; Common # So [2] TURNED DIGIT TWO..TURNED DIGIT THREE
2190..2194 ; Common # Sm [5] LEFTWARDS ARROW..LEFT RIGHT ARROW
2195..2199 ; Common # So [5] UP DOWN ARROW..SOUTH WEST ARROW
219A..219B ; Common # Sm [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE
@@ -304,6 +310,7 @@
2B98..2BB9 ; Common # So [34] THREE-D TOP-LIGHTED LEFTWARDS EQUILATERAL ARROWHEAD..UP ARROWHEAD IN A RECTANGLE BOX
2BBD..2BC8 ; Common # So [12] BALLOT BOX WITH LIGHT X..BLACK MEDIUM RIGHT-POINTING TRIANGLE CENTRED
2BCA..2BD1 ; Common # So [8] TOP HALF BLACK CIRCLE..UNCERTAINTY SIGN
+2BEC..2BEF ; Common # So [4] LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS..DOWNWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS
2E00..2E01 ; Common # Po [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER
2E02 ; Common # Pi LEFT SUBSTITUTION BRACKET
2E03 ; Common # Pf RIGHT SUBSTITUTION BRACKET
@@ -512,7 +519,7 @@ FFFC..FFFD ; Common # So [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHAR
1D173..1D17A ; Common # Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
1D183..1D184 ; Common # So [2] MUSICAL SYMBOL ARPEGGIATO UP..MUSICAL SYMBOL ARPEGGIATO DOWN
1D18C..1D1A9 ; Common # So [30] MUSICAL SYMBOL RINFORZANDO..MUSICAL SYMBOL DEGREE SLASH
-1D1AE..1D1DD ; Common # So [48] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL PES SUBPUNCTIS
+1D1AE..1D1E8 ; Common # So [59] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL KIEVAN FLAT SIGN
1D300..1D356 ; Common # So [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING
1D360..1D371 ; Common # No [18] COUNTING ROD UNIT DIGIT ONE..COUNTING ROD TENS DIGIT NINE
1D400..1D454 ; Common # L& [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G
@@ -571,16 +578,11 @@ FFFC..FFFD ; Common # So [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHAR
1F210..1F23A ; Common # So [43] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-55B6
1F240..1F248 ; Common # So [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557
1F250..1F251 ; Common # So [2] CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT
-1F300..1F32C ; Common # So [45] CYCLONE..WIND BLOWING FACE
-1F330..1F37D ; Common # So [78] CHESTNUT..FORK AND KNIFE WITH PLATE
-1F380..1F3CE ; Common # So [79] RIBBON..RACING CAR
-1F3D4..1F3F7 ; Common # So [36] SNOW CAPPED MOUNTAIN..LABEL
-1F400..1F4FE ; Common # So [255] RAT..PORTABLE STEREO
-1F500..1F54A ; Common # So [75] TWISTED RIGHTWARDS ARROWS..DOVE OF PEACE
-1F550..1F579 ; Common # So [42] CLOCK FACE ONE OCLOCK..JOYSTICK
+1F300..1F3FA ; Common # So [251] CYCLONE..AMPHORA
+1F3FB..1F3FF ; Common # Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6
+1F400..1F579 ; Common # So [378] RAT..JOYSTICK
1F57B..1F5A3 ; Common # So [41] LEFT HAND TELEPHONE RECEIVER..BLACK DOWN POINTING BACKHAND INDEX
-1F5A5..1F642 ; Common # So [158] DESKTOP COMPUTER..SLIGHTLY SMILING FACE
-1F645..1F6CF ; Common # So [139] FACE WITH NO GOOD GESTURE..BED
+1F5A5..1F6D0 ; Common # So [300] DESKTOP COMPUTER..PLACE OF WORSHIP
1F6E0..1F6EC ; Common # So [13] HAMMER AND WRENCH..AIRPLANE ARRIVING
1F6F0..1F6F3 ; Common # So [4] SATELLITE..PASSENGER SHIP
1F700..1F773 ; Common # So [116] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ALCHEMICAL SYMBOL FOR HALF OUNCE
@@ -590,10 +592,13 @@ FFFC..FFFD ; Common # So [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHAR
1F850..1F859 ; Common # So [10] LEFTWARDS SANS-SERIF ARROW..UP DOWN SANS-SERIF ARROW
1F860..1F887 ; Common # So [40] WIDE-HEADED LEFTWARDS LIGHT BARB ARROW..WIDE-HEADED SOUTH WEST VERY HEAVY BARB ARROW
1F890..1F8AD ; Common # So [30] LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS
+1F910..1F918 ; Common # So [9] ZIPPER-MOUTH FACE..SIGN OF THE HORNS
+1F980..1F984 ; Common # So [5] CRAB..UNICORN FACE
+1F9C0 ; Common # So CHEESE WEDGE
E0001 ; Common # Cf LANGUAGE TAG
E0020..E007F ; Common # Cf [96] TAG SPACE..CANCEL TAG
-# Total code points: 7129
+# Total code points: 7179
# ================================================
@@ -635,20 +640,21 @@ A722..A76F ; Latin # L& [78] LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF..LATIN
A770 ; Latin # Lm MODIFIER LETTER US
A771..A787 ; Latin # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T
A78B..A78E ; Latin # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT
+A78F ; Latin # Lo LATIN LETTER SINOLOGICAL DOT
A790..A7AD ; Latin # L& [30] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER L WITH BELT
-A7B0..A7B1 ; Latin # L& [2] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER TURNED T
+A7B0..A7B7 ; Latin # L& [8] LATIN CAPITAL LETTER TURNED K..LATIN SMALL LETTER OMEGA
A7F7 ; Latin # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I
A7F8..A7F9 ; Latin # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE
A7FA ; Latin # L& LATIN LETTER SMALL CAPITAL TURNED M
A7FB..A7FF ; Latin # Lo [5] LATIN EPIGRAPHIC LETTER REVERSED F..LATIN EPIGRAPHIC LETTER ARCHAIC M
AB30..AB5A ; Latin # L& [43] LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG
AB5C..AB5F ; Latin # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK
-AB64 ; Latin # L& LATIN SMALL LETTER INVERTED ALPHA
+AB60..AB64 ; Latin # L& [5] LATIN SMALL LETTER SAKHA YAT..LATIN SMALL LETTER INVERTED ALPHA
FB00..FB06 ; Latin # L& [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST
FF21..FF3A ; Latin # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z
FF41..FF5A ; Latin # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z
-# Total code points: 1338
+# Total code points: 1349
# ================================================
@@ -731,9 +737,10 @@ A67E ; Cyrillic # Po CYRILLIC KAVYKA
A67F ; Cyrillic # Lm CYRILLIC PAYEROK
A680..A69B ; Cyrillic # L& [28] CYRILLIC CAPITAL LETTER DWE..CYRILLIC SMALL LETTER CROSSED O
A69C..A69D ; Cyrillic # Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER CYRILLIC SOFT SIGN
-A69F ; Cyrillic # Mn COMBINING CYRILLIC LETTER IOTIFIED E
+A69E..A69F ; Cyrillic # Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E
+FE2E..FE2F ; Cyrillic # Mn [2] COMBINING CYRILLIC TITLO LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
-# Total code points: 431
+# Total code points: 434
# ================================================
@@ -788,6 +795,7 @@ FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATU
0620..063F ; Arabic # Lo [32] ARABIC LETTER KASHMIRI YEH..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE
0641..064A ; Arabic # Lo [10] ARABIC LETTER FEH..ARABIC LETTER YEH
0656..065F ; Arabic # Mn [10] ARABIC SUBSCRIPT ALEF..ARABIC WAVY HAMZA BELOW
+0660..0669 ; Arabic # Nd [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE
066A..066D ; Arabic # Po [4] ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR
066E..066F ; Arabic # Lo [2] ARABIC LETTER DOTLESS BEH..ARABIC LETTER DOTLESS QAF
0671..06D3 ; Arabic # Lo [99] ARABIC LETTER ALEF WASLA..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
@@ -806,8 +814,8 @@ FB46..FB4F ; Hebrew # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATU
06FD..06FE ; Arabic # So [2] ARABIC SIGN SINDHI AMPERSAND..ARABIC SIGN SINDHI POSTPOSITION MEN
06FF ; Arabic # Lo ARABIC LETTER HEH WITH INVERTED V
0750..077F ; Arabic # Lo [48] ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS ABOVE
-08A0..08B2 ; Arabic # Lo [19] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER ZAIN WITH INVERTED V ABOVE
-08E4..08FF ; Arabic # Mn [28] ARABIC CURLY FATHA..ARABIC MARK SIDEWAYS NOON GHUNNA
+08A0..08B4 ; Arabic # Lo [21] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER KAF WITH DOT BELOW
+08E3..08FF ; Arabic # Mn [29] ARABIC TURNED DAMMA BELOW..ARABIC MARK SIDEWAYS NOON GHUNNA
FB50..FBB1 ; Arabic # Lo [98] ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM
FBB2..FBC1 ; Arabic # Sk [16] ARABIC SYMBOL DOT ABOVE..ARABIC SYMBOL SMALL TAH BELOW
FBD3..FD3D ; Arabic # Lo [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM
@@ -854,7 +862,7 @@ FE76..FEFC ; Arabic # Lo [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LA
1EEAB..1EEBB ; Arabic # Lo [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN
1EEF0..1EEF1 ; Arabic # Sm [2] ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL..ARABIC MATHEMATICAL OPERATOR HAH WITH DAL
-# Total code points: 1244
+# Total code points: 1257
# ================================================
@@ -902,8 +910,10 @@ A8E0..A8F1 ; Devanagari # Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING
A8F2..A8F7 ; Devanagari # Lo [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
A8F8..A8FA ; Devanagari # Po [3] DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET
A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE
+A8FC ; Devanagari # Po DEVANAGARI SIGN SIDDHAM
+A8FD ; Devanagari # Lo DEVANAGARI JAIN OM
-# Total code points: 152
+# Total code points: 154
# ================================================
@@ -987,8 +997,9 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE
0AE6..0AEF ; Gujarati # Nd [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE
0AF0 ; Gujarati # Po GUJARATI ABBREVIATION SIGN
0AF1 ; Gujarati # Sc GUJARATI RUPEE SIGN
+0AF9 ; Gujarati # Lo GUJARATI LETTER ZHA
-# Total code points: 84
+# Total code points: 85
# ================================================
@@ -1064,14 +1075,14 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE
0C46..0C48 ; Telugu # Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI
0C4A..0C4D ; Telugu # Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA
0C55..0C56 ; Telugu # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK
-0C58..0C59 ; Telugu # Lo [2] TELUGU LETTER TSA..TELUGU LETTER DZA
+0C58..0C5A ; Telugu # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA
0C60..0C61 ; Telugu # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
0C62..0C63 ; Telugu # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL
0C66..0C6F ; Telugu # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE
0C78..0C7E ; Telugu # No [7] TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR..TELUGU FRACTION DIGIT THREE FOR EVEN POWERS OF FOUR
0C7F ; Telugu # So TELUGU SIGN TUUMU
-# Total code points: 95
+# Total code points: 96
# ================================================
@@ -1115,14 +1126,14 @@ A8FB ; Devanagari # Lo DEVANAGARI HEADSTROKE
0D4D ; Malayalam # Mn MALAYALAM SIGN VIRAMA
0D4E ; Malayalam # Lo MALAYALAM LETTER DOT REPH
0D57 ; Malayalam # Mc MALAYALAM AU LENGTH MARK
-0D60..0D61 ; Malayalam # Lo [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL
+0D5F..0D61 ; Malayalam # Lo [3] MALAYALAM LETTER ARCHAIC II..MALAYALAM LETTER VOCALIC LL
0D62..0D63 ; Malayalam # Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL
0D66..0D6F ; Malayalam # Nd [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE
0D70..0D75 ; Malayalam # No [6] MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE QUARTERS
0D79 ; Malayalam # So MALAYALAM DATE MARK
0D7A..0D7F ; Malayalam # Lo [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K
-# Total code points: 99
+# Total code points: 100
# ================================================
@@ -1358,9 +1369,11 @@ AB28..AB2E ; Ethiopic # Lo [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SYLLABLE BBO
# ================================================
-13A0..13F4 ; Cherokee # Lo [85] CHEROKEE LETTER A..CHEROKEE LETTER YV
+13A0..13F5 ; Cherokee # L& [86] CHEROKEE LETTER A..CHEROKEE LETTER MV
+13F8..13FD ; Cherokee # L& [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
+AB70..ABBF ; Cherokee # L& [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
-# Total code points: 85
+# Total code points: 172
# ================================================
@@ -1472,15 +1485,16 @@ FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAK
3038..303A ; Han # Nl [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY
303B ; Han # Lm VERTICAL IDEOGRAPHIC ITERATION MARK
3400..4DB5 ; Han # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5
-4E00..9FCC ; Han # Lo [20941] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCC
+4E00..9FD5 ; Han # Lo [20950] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FD5
F900..FA6D ; Han # Lo [366] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA6D
FA70..FAD9 ; Han # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9
20000..2A6D6 ; Han # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6
2A700..2B734 ; Han # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734
2B740..2B81D ; Han # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D
+2B820..2CEA1 ; Han # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1
2F800..2FA1D ; Han # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
-# Total code points: 75963
+# Total code points: 81734
# ================================================
@@ -1680,9 +1694,7 @@ E0100..E01EF ; Inherited # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-2
# ================================================
1980..19AB ; New_Tai_Lue # Lo [44] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW SUA
-19B0..19C0 ; New_Tai_Lue # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY
-19C1..19C7 ; New_Tai_Lue # Lo [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B
-19C8..19C9 ; New_Tai_Lue # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2
+19B0..19C9 ; New_Tai_Lue # Lo [26] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE TONE MARK-2
19D0..19D9 ; New_Tai_Lue # Nd [10] NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE
19DA ; New_Tai_Lue # No NEW TAI LUE THAM DIGIT ONE
19DE..19DF ; New_Tai_Lue # So [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV
@@ -1770,11 +1782,12 @@ A828..A82B ; Syloti_Nagri # So [4] SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI
# ================================================
-12000..12398 ; Cuneiform # Lo [921] CUNEIFORM SIGN A..CUNEIFORM SIGN UM TIMES ME
+12000..12399 ; Cuneiform # Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U
12400..1246E ; Cuneiform # Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM
12470..12474 ; Cuneiform # Po [5] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL QUADCOLON
+12480..12543 ; Cuneiform # Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU
-# Total code points: 1037
+# Total code points: 1234
# ================================================
@@ -2151,9 +2164,12 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI
# ================================================
109A0..109B7 ; Meroitic_Cursive # Lo [24] MEROITIC CURSIVE LETTER A..MEROITIC CURSIVE LETTER DA
+109BC..109BD ; Meroitic_Cursive # No [2] MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS..MEROITIC CURSIVE FRACTION ONE HALF
109BE..109BF ; Meroitic_Cursive # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN
+109C0..109CF ; Meroitic_Cursive # No [16] MEROITIC CURSIVE NUMBER ONE..MEROITIC CURSIVE NUMBER SEVENTY
+109D2..109FF ; Meroitic_Cursive # No [46] MEROITIC CURSIVE NUMBER ONE HUNDRED..MEROITIC CURSIVE FRACTION TEN TWELFTHS
-# Total code points: 26
+# Total code points: 90
# ================================================
@@ -2180,12 +2196,16 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI
111B6..111BE ; Sharada # Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O
111BF..111C0 ; Sharada # Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA
111C1..111C4 ; Sharada # Lo [4] SHARADA SIGN AVAGRAHA..SHARADA OM
-111C5..111C8 ; Sharada # Po [4] SHARADA DANDA..SHARADA SEPARATOR
+111C5..111C9 ; Sharada # Po [5] SHARADA DANDA..SHARADA SANDHI MARK
+111CA..111CC ; Sharada # Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK
111CD ; Sharada # Po SHARADA SUTRA MARK
111D0..111D9 ; Sharada # Nd [10] SHARADA DIGIT ZERO..SHARADA DIGIT NINE
111DA ; Sharada # Lo SHARADA EKAM
+111DB ; Sharada # Po SHARADA SIGN SIDDHAM
+111DC ; Sharada # Lo SHARADA HEADSTROKE
+111DD..111DF ; Sharada # Po [3] SHARADA CONTINUATION SIGN..SHARADA SECTION MARK-2
-# Total code points: 85
+# Total code points: 94
# ================================================
@@ -2243,7 +2263,7 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI
# ================================================
-11301 ; Grantha # Mn GRANTHA SIGN CANDRABINDU
+11300..11301 ; Grantha # Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU
11302..11303 ; Grantha # Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA
11305..1130C ; Grantha # Lo [8] GRANTHA LETTER A..GRANTHA LETTER VOCALIC L
1130F..11310 ; Grantha # Lo [2] GRANTHA LETTER EE..GRANTHA LETTER AI
@@ -2258,13 +2278,14 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI
11341..11344 ; Grantha # Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR
11347..11348 ; Grantha # Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI
1134B..1134D ; Grantha # Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA
+11350 ; Grantha # Lo GRANTHA OM
11357 ; Grantha # Mc GRANTHA AU LENGTH MARK
1135D..11361 ; Grantha # Lo [5] GRANTHA SIGN PLUTA..GRANTHA LETTER VOCALIC LL
11362..11363 ; Grantha # Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL
11366..1136C ; Grantha # Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX
11370..11374 ; Grantha # Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA
-# Total code points: 83
+# Total code points: 85
# ================================================
@@ -2407,9 +2428,11 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI
115BC..115BD ; Siddham # Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA
115BE ; Siddham # Mc SIDDHAM SIGN VISARGA
115BF..115C0 ; Siddham # Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA
-115C1..115C9 ; Siddham # Po [9] SIDDHAM SIGN SIDDHAM..SIDDHAM END OF TEXT MARK
+115C1..115D7 ; Siddham # Po [23] SIDDHAM SIGN SIDDHAM..SIDDHAM SECTION MARK WITH CIRCLES AND FOUR ENCLOSURES
+115D8..115DB ; Siddham # Lo [4] SIDDHAM LETTER THREE-CIRCLE ALTERNATE I..SIDDHAM LETTER ALTERNATE U
+115DC..115DD ; Siddham # Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU
-# Total code points: 72
+# Total code points: 92
# ================================================
@@ -2448,4 +2471,69 @@ ABF0..ABF9 ; Meetei_Mayek # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DI
# Total code points: 84
+# ================================================
+
+11700..11719 ; Ahom # Lo [26] AHOM LETTER KA..AHOM LETTER JHA
+1171D..1171F ; Ahom # Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA
+11720..11721 ; Ahom # Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA
+11722..11725 ; Ahom # Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU
+11726 ; Ahom # Mc AHOM VOWEL SIGN E
+11727..1172B ; Ahom # Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER
+11730..11739 ; Ahom # Nd [10] AHOM DIGIT ZERO..AHOM DIGIT NINE
+1173A..1173B ; Ahom # No [2] AHOM NUMBER TEN..AHOM NUMBER TWENTY
+1173C..1173E ; Ahom # Po [3] AHOM SIGN SMALL SECTION..AHOM SIGN RULAI
+1173F ; Ahom # So AHOM SYMBOL VI
+
+# Total code points: 57
+
+# ================================================
+
+14400..14646 ; Anatolian_Hieroglyphs # Lo [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530
+
+# Total code points: 583
+
+# ================================================
+
+108E0..108F2 ; Hatran # Lo [19] HATRAN LETTER ALEPH..HATRAN LETTER QOPH
+108F4..108F5 ; Hatran # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW
+108FB..108FF ; Hatran # No [5] HATRAN NUMBER ONE..HATRAN NUMBER ONE HUNDRED
+
+# Total code points: 26
+
+# ================================================
+
+11280..11286 ; Multani # Lo [7] MULTANI LETTER A..MULTANI LETTER GA
+11288 ; Multani # Lo MULTANI LETTER GHA
+1128A..1128D ; Multani # Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA
+1128F..1129D ; Multani # Lo [15] MULTANI LETTER NYA..MULTANI LETTER BA
+1129F..112A8 ; Multani # Lo [10] MULTANI LETTER BHA..MULTANI LETTER RHA
+112A9 ; Multani # Po MULTANI SECTION MARK
+
+# Total code points: 38
+
+# ================================================
+
+10C80..10CB2 ; Old_Hungarian # L& [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
+10CC0..10CF2 ; Old_Hungarian # L& [51] OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US
+10CFA..10CFF ; Old_Hungarian # No [6] OLD HUNGARIAN NUMBER ONE..OLD HUNGARIAN NUMBER ONE THOUSAND
+
+# Total code points: 108
+
+# ================================================
+
+1D800..1D9FF ; SignWriting # So [512] SIGNWRITING HAND-FIST INDEX..SIGNWRITING HEAD
+1DA00..1DA36 ; SignWriting # Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
+1DA37..1DA3A ; SignWriting # So [4] SIGNWRITING AIR BLOW SMALL ROTATIONS..SIGNWRITING BREATH EXHALE
+1DA3B..1DA6C ; SignWriting # Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
+1DA6D..1DA74 ; SignWriting # So [8] SIGNWRITING SHOULDER HIP SPINE..SIGNWRITING TORSO-FLOORPLANE TWISTING
+1DA75 ; SignWriting # Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
+1DA76..1DA83 ; SignWriting # So [14] SIGNWRITING LIMB COMBINATION..SIGNWRITING LOCATION DEPTH
+1DA84 ; SignWriting # Mn SIGNWRITING LOCATION HEAD NECK
+1DA85..1DA86 ; SignWriting # So [2] SIGNWRITING LOCATION TORSO..SIGNWRITING LOCATION LIMBS DIGITS
+1DA87..1DA8B ; SignWriting # Po [5] SIGNWRITING COMMA..SIGNWRITING PARENTHESIS
+1DA9B..1DA9F ; SignWriting # Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF ; SignWriting # Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
+
+# Total code points: 672
+
# EOF
diff --git a/util/unicode/data/SentenceBreakProperty.txt b/util/unicode/data/SentenceBreakProperty.txt
index 19752103f9..8dd1abff0f 100644
--- a/util/unicode/data/SentenceBreakProperty.txt
+++ b/util/unicode/data/SentenceBreakProperty.txt
@@ -1,8 +1,8 @@
-# SentenceBreakProperty-7.0.0.txt
-# Date: 2014-02-19, 15:51:38 GMT [MD]
+# SentenceBreakProperty-8.0.0.txt
+# Date: 2015-03-11, 22:29:43 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
@@ -53,7 +53,7 @@
0825..0827 ; Extend # Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U
0829..082D ; Extend # Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA
0859..085B ; Extend # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK
-08E4..0902 ; Extend # Mn [31] ARABIC CURLY FATHA..DEVANAGARI SIGN ANUSVARA
+08E3..0902 ; Extend # Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA
0903 ; Extend # Mc DEVANAGARI SIGN VISARGA
093A ; Extend # Mn DEVANAGARI VOWEL SIGN OE
093B ; Extend # Mc DEVANAGARI VOWEL SIGN OOE
@@ -216,8 +216,6 @@
1932 ; Extend # Mn LIMBU SMALL LETTER ANUSVARA
1933..1938 ; Extend # Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA
1939..193B ; Extend # Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I
-19B0..19C0 ; Extend # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY
-19C8..19C9 ; Extend # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2
1A17..1A18 ; Extend # Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U
1A19..1A1A ; Extend # Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O
1A1B ; Extend # Mn BUGINESE VOWEL SIGN AE
@@ -291,7 +289,7 @@
A66F ; Extend # Mn COMBINING CYRILLIC VZMET
A670..A672 ; Extend # Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN
A674..A67D ; Extend # Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK
-A69F ; Extend # Mn COMBINING CYRILLIC LETTER IOTIFIED E
+A69E..A69F ; Extend # Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E
A6F0..A6F1 ; Extend # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
A802 ; Extend # Mn SYLOTI NAGRI SIGN DVISVARA
A806 ; Extend # Mn SYLOTI NAGRI SIGN HASANTA
@@ -345,7 +343,7 @@ ABEC ; Extend # Mc MEETEI MAYEK LUM IYEK
ABED ; Extend # Mn MEETEI MAYEK APUN IYEK
FB1E ; Extend # Mn HEBREW POINT JUDEO-SPANISH VARIKA
FE00..FE0F ; Extend # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
-FE20..FE2D ; Extend # Mn [14] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON BELOW
+FE20..FE2F ; Extend # Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
101FD ; Extend # Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE
102E0 ; Extend # Mn COPTIC EPACT THOUSANDS MARK
@@ -376,6 +374,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
111B3..111B5 ; Extend # Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II
111B6..111BE ; Extend # Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O
111BF..111C0 ; Extend # Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA
+111CA..111CC ; Extend # Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK
1122C..1122E ; Extend # Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II
1122F..11231 ; Extend # Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI
11232..11233 ; Extend # Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU
@@ -385,7 +384,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
112DF ; Extend # Mn KHUDAWADI SIGN ANUSVARA
112E0..112E2 ; Extend # Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II
112E3..112EA ; Extend # Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA
-11301 ; Extend # Mn GRANTHA SIGN CANDRABINDU
+11300..11301 ; Extend # Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU
11302..11303 ; Extend # Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA
1133C ; Extend # Mn GRANTHA SIGN NUKTA
1133E..1133F ; Extend # Mc [2] GRANTHA VOWEL SIGN AA..GRANTHA VOWEL SIGN I
@@ -411,6 +410,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
115BC..115BD ; Extend # Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA
115BE ; Extend # Mc SIDDHAM SIGN VISARGA
115BF..115C0 ; Extend # Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA
+115DC..115DD ; Extend # Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU
11630..11632 ; Extend # Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II
11633..1163A ; Extend # Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI
1163B..1163C ; Extend # Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU
@@ -424,6 +424,11 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
116B0..116B5 ; Extend # Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU
116B6 ; Extend # Mc TAKRI SIGN VIRAMA
116B7 ; Extend # Mn TAKRI SIGN NUKTA
+1171D..1171F ; Extend # Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA
+11720..11721 ; Extend # Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA
+11722..11725 ; Extend # Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU
+11726 ; Extend # Mc AHOM VOWEL SIGN E
+11727..1172B ; Extend # Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER
16AF0..16AF4 ; Extend # Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE
16B30..16B36 ; Extend # Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM
16F51..16F7E ; Extend # Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG
@@ -436,10 +441,16 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
1D185..1D18B ; Extend # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
1D1AA..1D1AD ; Extend # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
1D242..1D244 ; Extend # Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
+1DA00..1DA36 ; Extend # Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
+1DA3B..1DA6C ; Extend # Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
+1DA75 ; Extend # Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
+1DA84 ; Extend # Mn SIGNWRITING LOCATION HEAD NECK
+1DA9B..1DA9F ; Extend # Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF ; Extend # Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
1E8D0..1E8D6 ; Extend # Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS
E0100..E01EF ; Extend # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
-# Total code points: 1834
+# Total code points: 1967
# ================================================
@@ -764,6 +775,7 @@ E0020..E007F ; Format # Cf [96] TAG SPACE..CANCEL TAG
052D ; Lower # L& CYRILLIC SMALL LETTER DCHE
052F ; Lower # L& CYRILLIC SMALL LETTER EL WITH DESCENDER
0561..0587 ; Lower # L& [39] ARMENIAN SMALL LETTER AYB..ARMENIAN SMALL LIGATURE ECH YIWN
+13F8..13FD ; Lower # L& [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
1D00..1D2B ; Lower # L& [44] LATIN LETTER SMALL CAPITAL A..CYRILLIC LETTER SMALL CAPITAL EL
1D2C..1D6A ; Lower # Lm [63] MODIFIER LETTER CAPITAL A..GREEK SUBSCRIPT SMALL LETTER CHI
1D6B..1D77 ; Lower # L& [13] LATIN SMALL LETTER UE..LATIN SMALL LETTER TURNED G
@@ -1094,15 +1106,19 @@ A7A3 ; Lower # L& LATIN SMALL LETTER K WITH OBLIQUE STROKE
A7A5 ; Lower # L& LATIN SMALL LETTER N WITH OBLIQUE STROKE
A7A7 ; Lower # L& LATIN SMALL LETTER R WITH OBLIQUE STROKE
A7A9 ; Lower # L& LATIN SMALL LETTER S WITH OBLIQUE STROKE
+A7B5 ; Lower # L& LATIN SMALL LETTER BETA
+A7B7 ; Lower # L& LATIN SMALL LETTER OMEGA
A7F8..A7F9 ; Lower # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE
A7FA ; Lower # L& LATIN LETTER SMALL CAPITAL TURNED M
AB30..AB5A ; Lower # L& [43] LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG
AB5C..AB5F ; Lower # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK
-AB64..AB65 ; Lower # L& [2] LATIN SMALL LETTER INVERTED ALPHA..GREEK LETTER SMALL CAPITAL OMEGA
+AB60..AB65 ; Lower # L& [6] LATIN SMALL LETTER SAKHA YAT..GREEK LETTER SMALL CAPITAL OMEGA
+AB70..ABBF ; Lower # L& [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
FB00..FB06 ; Lower # L& [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST
FB13..FB17 ; Lower # L& [5] ARMENIAN SMALL LIGATURE MEN NOW..ARMENIAN SMALL LIGATURE MEN XEH
FF41..FF5A ; Lower # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z
10428..1044F ; Lower # L& [40] DESERET SMALL LETTER LONG I..DESERET SMALL LETTER EW
+10CC0..10CF2 ; Lower # L& [51] OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US
118C0..118DF ; Lower # L& [32] WARANG CITI SMALL LETTER NGAA..WARANG CITI SMALL LETTER VIYO
1D41A..1D433 ; Lower # L& [26] MATHEMATICAL BOLD SMALL A..MATHEMATICAL BOLD SMALL Z
1D44E..1D454 ; Lower # L& [7] MATHEMATICAL ITALIC SMALL A..MATHEMATICAL ITALIC SMALL G
@@ -1133,7 +1149,7 @@ FF41..FF5A ; Lower # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN
1D7C4..1D7C9 ; Lower # L& [6] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
1D7CB ; Lower # L& MATHEMATICAL BOLD SMALL DIGAMMA
-# Total code points: 2029
+# Total code points: 2172
# ================================================
@@ -1412,6 +1428,7 @@ FF41..FF5A ; Lower # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN
10A0..10C5 ; Upper # L& [38] GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE
10C7 ; Upper # L& GEORGIAN CAPITAL LETTER YN
10CD ; Upper # L& GEORGIAN CAPITAL LETTER AEN
+13A0..13F5 ; Upper # L& [86] CHEROKEE LETTER A..CHEROKEE LETTER MV
1E00 ; Upper # L& LATIN CAPITAL LETTER A WITH RING BELOW
1E02 ; Upper # L& LATIN CAPITAL LETTER B WITH DOT ABOVE
1E04 ; Upper # L& LATIN CAPITAL LETTER B WITH DOT BELOW
@@ -1729,9 +1746,11 @@ A7A4 ; Upper # L& LATIN CAPITAL LETTER N WITH OBLIQUE STROKE
A7A6 ; Upper # L& LATIN CAPITAL LETTER R WITH OBLIQUE STROKE
A7A8 ; Upper # L& LATIN CAPITAL LETTER S WITH OBLIQUE STROKE
A7AA..A7AD ; Upper # L& [4] LATIN CAPITAL LETTER H WITH HOOK..LATIN CAPITAL LETTER L WITH BELT
-A7B0..A7B1 ; Upper # L& [2] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER TURNED T
+A7B0..A7B4 ; Upper # L& [5] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER BETA
+A7B6 ; Upper # L& LATIN CAPITAL LETTER OMEGA
FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z
10400..10427 ; Upper # L& [40] DESERET CAPITAL LETTER LONG I..DESERET CAPITAL LETTER EW
+10C80..10CB2 ; Upper # L& [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
118A0..118BF ; Upper # L& [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO
1D400..1D419 ; Upper # L& [26] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL BOLD CAPITAL Z
1D434..1D44D ; Upper # L& [26] MATHEMATICAL ITALIC CAPITAL A..MATHEMATICAL ITALIC CAPITAL Z
@@ -1768,7 +1787,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
1F150..1F169 ; Upper # So [26] NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z
1F170..1F189 ; Upper # So [26] NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER Z
-# Total code points: 1641
+# Total code points: 1782
# ================================================
@@ -1806,7 +1825,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
0824 ; OLetter # Lm SAMARITAN MODIFIER LETTER SHORT A
0828 ; OLetter # Lm SAMARITAN MODIFIER LETTER I
0840..0858 ; OLetter # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN
-08A0..08B2 ; OLetter # Lo [19] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER ZAIN WITH INVERTED V ABOVE
+08A0..08B4 ; OLetter # Lo [21] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER KAF WITH DOT BELOW
0904..0939 ; OLetter # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA
093D ; OLetter # Lo DEVANAGARI SIGN AVAGRAHA
0950 ; OLetter # Lo DEVANAGARI OM
@@ -1843,6 +1862,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
0ABD ; OLetter # Lo GUJARATI SIGN AVAGRAHA
0AD0 ; OLetter # Lo GUJARATI OM
0AE0..0AE1 ; OLetter # Lo [2] GUJARATI LETTER VOCALIC RR..GUJARATI LETTER VOCALIC LL
+0AF9 ; OLetter # Lo GUJARATI LETTER ZHA
0B05..0B0C ; OLetter # Lo [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L
0B0F..0B10 ; OLetter # Lo [2] ORIYA LETTER E..ORIYA LETTER AI
0B13..0B28 ; OLetter # Lo [22] ORIYA LETTER O..ORIYA LETTER NA
@@ -1869,7 +1889,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
0C12..0C28 ; OLetter # Lo [23] TELUGU LETTER O..TELUGU LETTER NA
0C2A..0C39 ; OLetter # Lo [16] TELUGU LETTER PA..TELUGU LETTER HA
0C3D ; OLetter # Lo TELUGU SIGN AVAGRAHA
-0C58..0C59 ; OLetter # Lo [2] TELUGU LETTER TSA..TELUGU LETTER DZA
+0C58..0C5A ; OLetter # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA
0C60..0C61 ; OLetter # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
0C85..0C8C ; OLetter # Lo [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L
0C8E..0C90 ; OLetter # Lo [3] KANNADA LETTER E..KANNADA LETTER AI
@@ -1885,7 +1905,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
0D12..0D3A ; OLetter # Lo [41] MALAYALAM LETTER O..MALAYALAM LETTER TTTA
0D3D ; OLetter # Lo MALAYALAM SIGN AVAGRAHA
0D4E ; OLetter # Lo MALAYALAM LETTER DOT REPH
-0D60..0D61 ; OLetter # Lo [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL
+0D5F..0D61 ; OLetter # Lo [3] MALAYALAM LETTER ARCHAIC II..MALAYALAM LETTER VOCALIC LL
0D7A..0D7F ; OLetter # Lo [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K
0D85..0D96 ; OLetter # Lo [18] SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA
0D9A..0DB1 ; OLetter # Lo [24] SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA
@@ -1945,7 +1965,6 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
1312..1315 ; OLetter # Lo [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE
1318..135A ; OLetter # Lo [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA
1380..138F ; OLetter # Lo [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE
-13A0..13F4 ; OLetter # Lo [85] CHEROKEE LETTER A..CHEROKEE LETTER YV
1401..166C ; OLetter # Lo [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA
166F..167F ; OLetter # Lo [17] CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS BLACKFOOT W
1681..169A ; OLetter # Lo [26] OGHAM LETTER BEITH..OGHAM LETTER PEITH
@@ -1971,7 +1990,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
1950..196D ; OLetter # Lo [30] TAI LE LETTER KA..TAI LE LETTER AI
1970..1974 ; OLetter # Lo [5] TAI LE LETTER TONE-2..TAI LE LETTER TONE-6
1980..19AB ; OLetter # Lo [44] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW SUA
-19C1..19C7 ; OLetter # Lo [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B
+19B0..19C9 ; OLetter # Lo [26] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE TONE MARK-2
1A00..1A16 ; OLetter # Lo [23] BUGINESE LETTER KA..BUGINESE LETTER HA
1A20..1A54 ; OLetter # Lo [53] TAI THAM LETTER HIGH KA..TAI THAM LETTER GREAT SA
1AA7 ; OLetter # Lm TAI THAM SIGN MAI YAMOK
@@ -2021,7 +2040,7 @@ FF21..FF3A ; Upper # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LAT
31A0..31BA ; OLetter # Lo [27] BOPOMOFO LETTER BU..BOPOMOFO LETTER ZY
31F0..31FF ; OLetter # Lo [16] KATAKANA LETTER SMALL KU..KATAKANA LETTER SMALL RO
3400..4DB5 ; OLetter # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5
-4E00..9FCC ; OLetter # Lo [20941] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCC
+4E00..9FD5 ; OLetter # Lo [20950] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FD5
A000..A014 ; OLetter # Lo [21] YI SYLLABLE IT..YI SYLLABLE E
A015 ; OLetter # Lm YI SYLLABLE WU
A016..A48C ; OLetter # Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR
@@ -2037,6 +2056,7 @@ A6A0..A6E5 ; OLetter # Lo [70] BAMUM LETTER A..BAMUM LETTER KI
A6E6..A6EF ; OLetter # Nl [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM
A717..A71F ; OLetter # Lm [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK
A788 ; OLetter # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT
+A78F ; OLetter # Lo LATIN LETTER SINOLOGICAL DOT
A7F7 ; OLetter # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I
A7FB..A801 ; OLetter # Lo [7] LATIN EPIGRAPHIC LETTER REVERSED F..SYLOTI NAGRI LETTER I
A803..A805 ; OLetter # Lo [3] SYLOTI NAGRI LETTER U..SYLOTI NAGRI LETTER O
@@ -2046,6 +2066,7 @@ A840..A873 ; OLetter # Lo [52] PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABIN
A882..A8B3 ; OLetter # Lo [50] SAURASHTRA LETTER A..SAURASHTRA LETTER LLA
A8F2..A8F7 ; OLetter # Lo [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
A8FB ; OLetter # Lo DEVANAGARI HEADSTROKE
+A8FD ; OLetter # Lo DEVANAGARI JAIN OM
A90A..A925 ; OLetter # Lo [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO
A930..A946 ; OLetter # Lo [23] REJANG LETTER KA..REJANG LETTER A
A960..A97C ; OLetter # Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH
@@ -2140,6 +2161,8 @@ FFDA..FFDC ; OLetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
1083F..10855 ; OLetter # Lo [23] CYPRIOT SYLLABLE ZO..IMPERIAL ARAMAIC LETTER TAW
10860..10876 ; OLetter # Lo [23] PALMYRENE LETTER ALEPH..PALMYRENE LETTER TAW
10880..1089E ; OLetter # Lo [31] NABATAEAN LETTER FINAL ALEPH..NABATAEAN LETTER TAW
+108E0..108F2 ; OLetter # Lo [19] HATRAN LETTER ALEPH..HATRAN LETTER QOPH
+108F4..108F5 ; OLetter # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW
10900..10915 ; OLetter # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU
10920..10939 ; OLetter # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C
10980..109B7 ; OLetter # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA
@@ -2166,8 +2189,14 @@ FFDA..FFDC ; OLetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
11183..111B2 ; OLetter # Lo [48] SHARADA LETTER A..SHARADA LETTER HA
111C1..111C4 ; OLetter # Lo [4] SHARADA SIGN AVAGRAHA..SHARADA OM
111DA ; OLetter # Lo SHARADA EKAM
+111DC ; OLetter # Lo SHARADA HEADSTROKE
11200..11211 ; OLetter # Lo [18] KHOJKI LETTER A..KHOJKI LETTER JJA
11213..1122B ; OLetter # Lo [25] KHOJKI LETTER NYA..KHOJKI LETTER LLA
+11280..11286 ; OLetter # Lo [7] MULTANI LETTER A..MULTANI LETTER GA
+11288 ; OLetter # Lo MULTANI LETTER GHA
+1128A..1128D ; OLetter # Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA
+1128F..1129D ; OLetter # Lo [15] MULTANI LETTER NYA..MULTANI LETTER BA
+1129F..112A8 ; OLetter # Lo [10] MULTANI LETTER BHA..MULTANI LETTER RHA
112B0..112DE ; OLetter # Lo [47] KHUDAWADI LETTER A..KHUDAWADI LETTER HA
11305..1130C ; OLetter # Lo [8] GRANTHA LETTER A..GRANTHA LETTER VOCALIC L
1130F..11310 ; OLetter # Lo [2] GRANTHA LETTER EE..GRANTHA LETTER AI
@@ -2176,19 +2205,24 @@ FFDA..FFDC ; OLetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
11332..11333 ; OLetter # Lo [2] GRANTHA LETTER LA..GRANTHA LETTER LLA
11335..11339 ; OLetter # Lo [5] GRANTHA LETTER VA..GRANTHA LETTER HA
1133D ; OLetter # Lo GRANTHA SIGN AVAGRAHA
+11350 ; OLetter # Lo GRANTHA OM
1135D..11361 ; OLetter # Lo [5] GRANTHA SIGN PLUTA..GRANTHA LETTER VOCALIC LL
11480..114AF ; OLetter # Lo [48] TIRHUTA ANJI..TIRHUTA LETTER HA
114C4..114C5 ; OLetter # Lo [2] TIRHUTA SIGN AVAGRAHA..TIRHUTA GVANG
114C7 ; OLetter # Lo TIRHUTA OM
11580..115AE ; OLetter # Lo [47] SIDDHAM LETTER A..SIDDHAM LETTER HA
+115D8..115DB ; OLetter # Lo [4] SIDDHAM LETTER THREE-CIRCLE ALTERNATE I..SIDDHAM LETTER ALTERNATE U
11600..1162F ; OLetter # Lo [48] MODI LETTER A..MODI LETTER LLA
11644 ; OLetter # Lo MODI SIGN HUVA
11680..116AA ; OLetter # Lo [43] TAKRI LETTER A..TAKRI LETTER RRA
+11700..11719 ; OLetter # Lo [26] AHOM LETTER KA..AHOM LETTER JHA
118FF ; OLetter # Lo WARANG CITI OM
11AC0..11AF8 ; OLetter # Lo [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL
-12000..12398 ; OLetter # Lo [921] CUNEIFORM SIGN A..CUNEIFORM SIGN UM TIMES ME
+12000..12399 ; OLetter # Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U
12400..1246E ; OLetter # Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM
+12480..12543 ; OLetter # Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU
13000..1342E ; OLetter # Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032
+14400..14646 ; OLetter # Lo [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530
16800..16A38 ; OLetter # Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ
16A40..16A5E ; OLetter # Lo [31] MRO LETTER TA..MRO LETTER TEK
16AD0..16AED ; OLetter # Lo [30] BASSA VAH LETTER ENNI..BASSA VAH LETTER I
@@ -2241,9 +2275,10 @@ FFDA..FFDC ; OLetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
20000..2A6D6 ; OLetter # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6
2A700..2B734 ; OLetter # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734
2B740..2B81D ; OLetter # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D
+2B820..2CEA1 ; OLetter # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1
2F800..2FA1D ; OLetter # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
-# Total code points: 99420
+# Total code points: 106002
# ================================================
@@ -2293,12 +2328,13 @@ ABF0..ABF9 ; Numeric # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT N
114D0..114D9 ; Numeric # Nd [10] TIRHUTA DIGIT ZERO..TIRHUTA DIGIT NINE
11650..11659 ; Numeric # Nd [10] MODI DIGIT ZERO..MODI DIGIT NINE
116C0..116C9 ; Numeric # Nd [10] TAKRI DIGIT ZERO..TAKRI DIGIT NINE
+11730..11739 ; Numeric # Nd [10] AHOM DIGIT ZERO..AHOM DIGIT NINE
118E0..118E9 ; Numeric # Nd [10] WARANG CITI DIGIT ZERO..WARANG CITI DIGIT NINE
16A60..16A69 ; Numeric # Nd [10] MRO DIGIT ZERO..MRO DIGIT NINE
16B50..16B59 ; Numeric # Nd [10] PAHAWH HMONG DIGIT ZERO..PAHAWH HMONG DIGIT NINE
1D7CE..1D7FF ; Numeric # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
-# Total code points: 532
+# Total code points: 542
# ================================================
@@ -2358,18 +2394,22 @@ FF61 ; STerm # Po HALFWIDTH IDEOGRAPHIC FULL STOP
11141..11143 ; STerm # Po [3] CHAKMA DANDA..CHAKMA QUESTION MARK
111C5..111C6 ; STerm # Po [2] SHARADA DANDA..SHARADA DOUBLE DANDA
111CD ; STerm # Po SHARADA SUTRA MARK
+111DE..111DF ; STerm # Po [2] SHARADA SECTION MARK-1..SHARADA SECTION MARK-2
11238..11239 ; STerm # Po [2] KHOJKI DANDA..KHOJKI DOUBLE DANDA
1123B..1123C ; STerm # Po [2] KHOJKI SECTION MARK..KHOJKI DOUBLE SECTION MARK
+112A9 ; STerm # Po MULTANI SECTION MARK
115C2..115C3 ; STerm # Po [2] SIDDHAM DANDA..SIDDHAM DOUBLE DANDA
-115C9 ; STerm # Po SIDDHAM END OF TEXT MARK
+115C9..115D7 ; STerm # Po [15] SIDDHAM END OF TEXT MARK..SIDDHAM SECTION MARK WITH CIRCLES AND FOUR ENCLOSURES
11641..11642 ; STerm # Po [2] MODI DANDA..MODI DOUBLE DANDA
+1173C..1173E ; STerm # Po [3] AHOM SIGN SMALL SECTION..AHOM SIGN RULAI
16A6E..16A6F ; STerm # Po [2] MRO DANDA..MRO DOUBLE DANDA
16AF5 ; STerm # Po BASSA VAH FULL STOP
16B37..16B38 ; STerm # Po [2] PAHAWH HMONG SIGN VOS THOM..PAHAWH HMONG SIGN VOS TSHAB CEEB
16B44 ; STerm # Po PAHAWH HMONG SIGN XAUS
1BC9F ; STerm # Po DUPLOYAN PUNCTUATION CHINOOK FULL STOP
+1DA88 ; STerm # Po SIGNWRITING FULL STOP
-# Total code points: 96
+# Total code points: 117
# ================================================
diff --git a/util/unicode/data/SpecialCasing.txt b/util/unicode/data/SpecialCasing.txt
index 43645bd2d1..8de6462f18 100644
--- a/util/unicode/data/SpecialCasing.txt
+++ b/util/unicode/data/SpecialCasing.txt
@@ -1,5 +1,5 @@
-# SpecialCasing-7.0.0.txt
-# Date: 2014-03-18, 07:18:02 GMT [MD]
+# SpecialCasing-8.0.0.txt
+# Date: 2014-12-16, 23:08:04 GMT [MD]
#
# Unicode Character Database
# Copyright (c) 1991-2014 Unicode, Inc.
diff --git a/util/unicode/data/UnicodeData.txt b/util/unicode/data/UnicodeData.txt
index 31c8a7eaa0..aa0e914f84 100644
--- a/util/unicode/data/UnicodeData.txt
+++ b/util/unicode/data/UnicodeData.txt
@@ -667,7 +667,7 @@
029A;LATIN SMALL LETTER CLOSED OPEN E;Ll;0;L;;;;;N;LATIN SMALL LETTER CLOSED EPSILON;;;;
029B;LATIN LETTER SMALL CAPITAL G WITH HOOK;Ll;0;L;;;;;N;LATIN LETTER SMALL CAPITAL G HOOK;;;;
029C;LATIN LETTER SMALL CAPITAL H;Ll;0;L;;;;;N;;;;;
-029D;LATIN SMALL LETTER J WITH CROSSED-TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER CROSSED-TAIL J;;;;
+029D;LATIN SMALL LETTER J WITH CROSSED-TAIL;Ll;0;L;;;;;N;LATIN SMALL LETTER CROSSED-TAIL J;;A7B2;;A7B2
029E;LATIN SMALL LETTER TURNED K;Ll;0;L;;;;;N;;;A7B0;;A7B0
029F;LATIN LETTER SMALL CAPITAL L;Ll;0;L;;;;;N;;;;;
02A0;LATIN SMALL LETTER Q WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER Q HOOK;;;;
@@ -2091,6 +2091,9 @@
08B0;ARABIC LETTER GAF WITH INVERTED STROKE;Lo;0;AL;;;;;N;;;;;
08B1;ARABIC LETTER STRAIGHT WAW;Lo;0;AL;;;;;N;;;;;
08B2;ARABIC LETTER ZAIN WITH INVERTED V ABOVE;Lo;0;AL;;;;;N;;;;;
+08B3;ARABIC LETTER AIN WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;;;;;
+08B4;ARABIC LETTER KAF WITH DOT BELOW;Lo;0;AL;;;;;N;;;;;
+08E3;ARABIC TURNED DAMMA BELOW;Mn;220;NSM;;;;;N;;;;;
08E4;ARABIC CURLY FATHA;Mn;230;NSM;;;;;N;;;;;
08E5;ARABIC CURLY DAMMA;Mn;230;NSM;;;;;N;;;;;
08E6;ARABIC CURLY KASRA;Mn;220;NSM;;;;;N;;;;;
@@ -2503,6 +2506,7 @@
0AEF;GUJARATI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;;
0AF0;GUJARATI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;;
0AF1;GUJARATI RUPEE SIGN;Sc;0;ET;;;;;N;;;;;
+0AF9;GUJARATI LETTER ZHA;Lo;0;L;;;;;N;;;;;
0B01;ORIYA SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;;
0B02;ORIYA SIGN ANUSVARA;Mc;0;L;;;;;N;;;;;
0B03;ORIYA SIGN VISARGA;Mc;0;L;;;;;N;;;;;
@@ -2738,6 +2742,7 @@
0C56;TELUGU AI LENGTH MARK;Mn;91;NSM;;;;;N;;;;;
0C58;TELUGU LETTER TSA;Lo;0;L;;;;;N;;;;;
0C59;TELUGU LETTER DZA;Lo;0;L;;;;;N;;;;;
+0C5A;TELUGU LETTER RRRA;Lo;0;L;;;;;N;;;;;
0C60;TELUGU LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;;
0C61;TELUGU LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;;
0C62;TELUGU VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;;
@@ -2919,6 +2924,7 @@
0D4D;MALAYALAM SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;;
0D4E;MALAYALAM LETTER DOT REPH;Lo;0;L;;;;;N;;;;;
0D57;MALAYALAM AU LENGTH MARK;Mc;0;L;;;;;N;;;;;
+0D5F;MALAYALAM LETTER ARCHAIC II;Lo;0;L;;;;;N;;;;;
0D60;MALAYALAM LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;;
0D61;MALAYALAM LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;;
0D62;MALAYALAM VOWEL SIGN VOCALIC L;Mn;0;NSM;;;;;N;;;;;
@@ -4289,91 +4295,98 @@
1397;ETHIOPIC TONAL MARK HIDET;So;0;ON;;;;;N;;;;;
1398;ETHIOPIC TONAL MARK DERET-HIDET;So;0;ON;;;;;N;;;;;
1399;ETHIOPIC TONAL MARK KURT;So;0;ON;;;;;N;;;;;
-13A0;CHEROKEE LETTER A;Lo;0;L;;;;;N;;;;;
-13A1;CHEROKEE LETTER E;Lo;0;L;;;;;N;;;;;
-13A2;CHEROKEE LETTER I;Lo;0;L;;;;;N;;;;;
-13A3;CHEROKEE LETTER O;Lo;0;L;;;;;N;;;;;
-13A4;CHEROKEE LETTER U;Lo;0;L;;;;;N;;;;;
-13A5;CHEROKEE LETTER V;Lo;0;L;;;;;N;;;;;
-13A6;CHEROKEE LETTER GA;Lo;0;L;;;;;N;;;;;
-13A7;CHEROKEE LETTER KA;Lo;0;L;;;;;N;;;;;
-13A8;CHEROKEE LETTER GE;Lo;0;L;;;;;N;;;;;
-13A9;CHEROKEE LETTER GI;Lo;0;L;;;;;N;;;;;
-13AA;CHEROKEE LETTER GO;Lo;0;L;;;;;N;;;;;
-13AB;CHEROKEE LETTER GU;Lo;0;L;;;;;N;;;;;
-13AC;CHEROKEE LETTER GV;Lo;0;L;;;;;N;;;;;
-13AD;CHEROKEE LETTER HA;Lo;0;L;;;;;N;;;;;
-13AE;CHEROKEE LETTER HE;Lo;0;L;;;;;N;;;;;
-13AF;CHEROKEE LETTER HI;Lo;0;L;;;;;N;;;;;
-13B0;CHEROKEE LETTER HO;Lo;0;L;;;;;N;;;;;
-13B1;CHEROKEE LETTER HU;Lo;0;L;;;;;N;;;;;
-13B2;CHEROKEE LETTER HV;Lo;0;L;;;;;N;;;;;
-13B3;CHEROKEE LETTER LA;Lo;0;L;;;;;N;;;;;
-13B4;CHEROKEE LETTER LE;Lo;0;L;;;;;N;;;;;
-13B5;CHEROKEE LETTER LI;Lo;0;L;;;;;N;;;;;
-13B6;CHEROKEE LETTER LO;Lo;0;L;;;;;N;;;;;
-13B7;CHEROKEE LETTER LU;Lo;0;L;;;;;N;;;;;
-13B8;CHEROKEE LETTER LV;Lo;0;L;;;;;N;;;;;
-13B9;CHEROKEE LETTER MA;Lo;0;L;;;;;N;;;;;
-13BA;CHEROKEE LETTER ME;Lo;0;L;;;;;N;;;;;
-13BB;CHEROKEE LETTER MI;Lo;0;L;;;;;N;;;;;
-13BC;CHEROKEE LETTER MO;Lo;0;L;;;;;N;;;;;
-13BD;CHEROKEE LETTER MU;Lo;0;L;;;;;N;;;;;
-13BE;CHEROKEE LETTER NA;Lo;0;L;;;;;N;;;;;
-13BF;CHEROKEE LETTER HNA;Lo;0;L;;;;;N;;;;;
-13C0;CHEROKEE LETTER NAH;Lo;0;L;;;;;N;;;;;
-13C1;CHEROKEE LETTER NE;Lo;0;L;;;;;N;;;;;
-13C2;CHEROKEE LETTER NI;Lo;0;L;;;;;N;;;;;
-13C3;CHEROKEE LETTER NO;Lo;0;L;;;;;N;;;;;
-13C4;CHEROKEE LETTER NU;Lo;0;L;;;;;N;;;;;
-13C5;CHEROKEE LETTER NV;Lo;0;L;;;;;N;;;;;
-13C6;CHEROKEE LETTER QUA;Lo;0;L;;;;;N;;;;;
-13C7;CHEROKEE LETTER QUE;Lo;0;L;;;;;N;;;;;
-13C8;CHEROKEE LETTER QUI;Lo;0;L;;;;;N;;;;;
-13C9;CHEROKEE LETTER QUO;Lo;0;L;;;;;N;;;;;
-13CA;CHEROKEE LETTER QUU;Lo;0;L;;;;;N;;;;;
-13CB;CHEROKEE LETTER QUV;Lo;0;L;;;;;N;;;;;
-13CC;CHEROKEE LETTER SA;Lo;0;L;;;;;N;;;;;
-13CD;CHEROKEE LETTER S;Lo;0;L;;;;;N;;;;;
-13CE;CHEROKEE LETTER SE;Lo;0;L;;;;;N;;;;;
-13CF;CHEROKEE LETTER SI;Lo;0;L;;;;;N;;;;;
-13D0;CHEROKEE LETTER SO;Lo;0;L;;;;;N;;;;;
-13D1;CHEROKEE LETTER SU;Lo;0;L;;;;;N;;;;;
-13D2;CHEROKEE LETTER SV;Lo;0;L;;;;;N;;;;;
-13D3;CHEROKEE LETTER DA;Lo;0;L;;;;;N;;;;;
-13D4;CHEROKEE LETTER TA;Lo;0;L;;;;;N;;;;;
-13D5;CHEROKEE LETTER DE;Lo;0;L;;;;;N;;;;;
-13D6;CHEROKEE LETTER TE;Lo;0;L;;;;;N;;;;;
-13D7;CHEROKEE LETTER DI;Lo;0;L;;;;;N;;;;;
-13D8;CHEROKEE LETTER TI;Lo;0;L;;;;;N;;;;;
-13D9;CHEROKEE LETTER DO;Lo;0;L;;;;;N;;;;;
-13DA;CHEROKEE LETTER DU;Lo;0;L;;;;;N;;;;;
-13DB;CHEROKEE LETTER DV;Lo;0;L;;;;;N;;;;;
-13DC;CHEROKEE LETTER DLA;Lo;0;L;;;;;N;;;;;
-13DD;CHEROKEE LETTER TLA;Lo;0;L;;;;;N;;;;;
-13DE;CHEROKEE LETTER TLE;Lo;0;L;;;;;N;;;;;
-13DF;CHEROKEE LETTER TLI;Lo;0;L;;;;;N;;;;;
-13E0;CHEROKEE LETTER TLO;Lo;0;L;;;;;N;;;;;
-13E1;CHEROKEE LETTER TLU;Lo;0;L;;;;;N;;;;;
-13E2;CHEROKEE LETTER TLV;Lo;0;L;;;;;N;;;;;
-13E3;CHEROKEE LETTER TSA;Lo;0;L;;;;;N;;;;;
-13E4;CHEROKEE LETTER TSE;Lo;0;L;;;;;N;;;;;
-13E5;CHEROKEE LETTER TSI;Lo;0;L;;;;;N;;;;;
-13E6;CHEROKEE LETTER TSO;Lo;0;L;;;;;N;;;;;
-13E7;CHEROKEE LETTER TSU;Lo;0;L;;;;;N;;;;;
-13E8;CHEROKEE LETTER TSV;Lo;0;L;;;;;N;;;;;
-13E9;CHEROKEE LETTER WA;Lo;0;L;;;;;N;;;;;
-13EA;CHEROKEE LETTER WE;Lo;0;L;;;;;N;;;;;
-13EB;CHEROKEE LETTER WI;Lo;0;L;;;;;N;;;;;
-13EC;CHEROKEE LETTER WO;Lo;0;L;;;;;N;;;;;
-13ED;CHEROKEE LETTER WU;Lo;0;L;;;;;N;;;;;
-13EE;CHEROKEE LETTER WV;Lo;0;L;;;;;N;;;;;
-13EF;CHEROKEE LETTER YA;Lo;0;L;;;;;N;;;;;
-13F0;CHEROKEE LETTER YE;Lo;0;L;;;;;N;;;;;
-13F1;CHEROKEE LETTER YI;Lo;0;L;;;;;N;;;;;
-13F2;CHEROKEE LETTER YO;Lo;0;L;;;;;N;;;;;
-13F3;CHEROKEE LETTER YU;Lo;0;L;;;;;N;;;;;
-13F4;CHEROKEE LETTER YV;Lo;0;L;;;;;N;;;;;
+13A0;CHEROKEE LETTER A;Lu;0;L;;;;;N;;;;AB70;
+13A1;CHEROKEE LETTER E;Lu;0;L;;;;;N;;;;AB71;
+13A2;CHEROKEE LETTER I;Lu;0;L;;;;;N;;;;AB72;
+13A3;CHEROKEE LETTER O;Lu;0;L;;;;;N;;;;AB73;
+13A4;CHEROKEE LETTER U;Lu;0;L;;;;;N;;;;AB74;
+13A5;CHEROKEE LETTER V;Lu;0;L;;;;;N;;;;AB75;
+13A6;CHEROKEE LETTER GA;Lu;0;L;;;;;N;;;;AB76;
+13A7;CHEROKEE LETTER KA;Lu;0;L;;;;;N;;;;AB77;
+13A8;CHEROKEE LETTER GE;Lu;0;L;;;;;N;;;;AB78;
+13A9;CHEROKEE LETTER GI;Lu;0;L;;;;;N;;;;AB79;
+13AA;CHEROKEE LETTER GO;Lu;0;L;;;;;N;;;;AB7A;
+13AB;CHEROKEE LETTER GU;Lu;0;L;;;;;N;;;;AB7B;
+13AC;CHEROKEE LETTER GV;Lu;0;L;;;;;N;;;;AB7C;
+13AD;CHEROKEE LETTER HA;Lu;0;L;;;;;N;;;;AB7D;
+13AE;CHEROKEE LETTER HE;Lu;0;L;;;;;N;;;;AB7E;
+13AF;CHEROKEE LETTER HI;Lu;0;L;;;;;N;;;;AB7F;
+13B0;CHEROKEE LETTER HO;Lu;0;L;;;;;N;;;;AB80;
+13B1;CHEROKEE LETTER HU;Lu;0;L;;;;;N;;;;AB81;
+13B2;CHEROKEE LETTER HV;Lu;0;L;;;;;N;;;;AB82;
+13B3;CHEROKEE LETTER LA;Lu;0;L;;;;;N;;;;AB83;
+13B4;CHEROKEE LETTER LE;Lu;0;L;;;;;N;;;;AB84;
+13B5;CHEROKEE LETTER LI;Lu;0;L;;;;;N;;;;AB85;
+13B6;CHEROKEE LETTER LO;Lu;0;L;;;;;N;;;;AB86;
+13B7;CHEROKEE LETTER LU;Lu;0;L;;;;;N;;;;AB87;
+13B8;CHEROKEE LETTER LV;Lu;0;L;;;;;N;;;;AB88;
+13B9;CHEROKEE LETTER MA;Lu;0;L;;;;;N;;;;AB89;
+13BA;CHEROKEE LETTER ME;Lu;0;L;;;;;N;;;;AB8A;
+13BB;CHEROKEE LETTER MI;Lu;0;L;;;;;N;;;;AB8B;
+13BC;CHEROKEE LETTER MO;Lu;0;L;;;;;N;;;;AB8C;
+13BD;CHEROKEE LETTER MU;Lu;0;L;;;;;N;;;;AB8D;
+13BE;CHEROKEE LETTER NA;Lu;0;L;;;;;N;;;;AB8E;
+13BF;CHEROKEE LETTER HNA;Lu;0;L;;;;;N;;;;AB8F;
+13C0;CHEROKEE LETTER NAH;Lu;0;L;;;;;N;;;;AB90;
+13C1;CHEROKEE LETTER NE;Lu;0;L;;;;;N;;;;AB91;
+13C2;CHEROKEE LETTER NI;Lu;0;L;;;;;N;;;;AB92;
+13C3;CHEROKEE LETTER NO;Lu;0;L;;;;;N;;;;AB93;
+13C4;CHEROKEE LETTER NU;Lu;0;L;;;;;N;;;;AB94;
+13C5;CHEROKEE LETTER NV;Lu;0;L;;;;;N;;;;AB95;
+13C6;CHEROKEE LETTER QUA;Lu;0;L;;;;;N;;;;AB96;
+13C7;CHEROKEE LETTER QUE;Lu;0;L;;;;;N;;;;AB97;
+13C8;CHEROKEE LETTER QUI;Lu;0;L;;;;;N;;;;AB98;
+13C9;CHEROKEE LETTER QUO;Lu;0;L;;;;;N;;;;AB99;
+13CA;CHEROKEE LETTER QUU;Lu;0;L;;;;;N;;;;AB9A;
+13CB;CHEROKEE LETTER QUV;Lu;0;L;;;;;N;;;;AB9B;
+13CC;CHEROKEE LETTER SA;Lu;0;L;;;;;N;;;;AB9C;
+13CD;CHEROKEE LETTER S;Lu;0;L;;;;;N;;;;AB9D;
+13CE;CHEROKEE LETTER SE;Lu;0;L;;;;;N;;;;AB9E;
+13CF;CHEROKEE LETTER SI;Lu;0;L;;;;;N;;;;AB9F;
+13D0;CHEROKEE LETTER SO;Lu;0;L;;;;;N;;;;ABA0;
+13D1;CHEROKEE LETTER SU;Lu;0;L;;;;;N;;;;ABA1;
+13D2;CHEROKEE LETTER SV;Lu;0;L;;;;;N;;;;ABA2;
+13D3;CHEROKEE LETTER DA;Lu;0;L;;;;;N;;;;ABA3;
+13D4;CHEROKEE LETTER TA;Lu;0;L;;;;;N;;;;ABA4;
+13D5;CHEROKEE LETTER DE;Lu;0;L;;;;;N;;;;ABA5;
+13D6;CHEROKEE LETTER TE;Lu;0;L;;;;;N;;;;ABA6;
+13D7;CHEROKEE LETTER DI;Lu;0;L;;;;;N;;;;ABA7;
+13D8;CHEROKEE LETTER TI;Lu;0;L;;;;;N;;;;ABA8;
+13D9;CHEROKEE LETTER DO;Lu;0;L;;;;;N;;;;ABA9;
+13DA;CHEROKEE LETTER DU;Lu;0;L;;;;;N;;;;ABAA;
+13DB;CHEROKEE LETTER DV;Lu;0;L;;;;;N;;;;ABAB;
+13DC;CHEROKEE LETTER DLA;Lu;0;L;;;;;N;;;;ABAC;
+13DD;CHEROKEE LETTER TLA;Lu;0;L;;;;;N;;;;ABAD;
+13DE;CHEROKEE LETTER TLE;Lu;0;L;;;;;N;;;;ABAE;
+13DF;CHEROKEE LETTER TLI;Lu;0;L;;;;;N;;;;ABAF;
+13E0;CHEROKEE LETTER TLO;Lu;0;L;;;;;N;;;;ABB0;
+13E1;CHEROKEE LETTER TLU;Lu;0;L;;;;;N;;;;ABB1;
+13E2;CHEROKEE LETTER TLV;Lu;0;L;;;;;N;;;;ABB2;
+13E3;CHEROKEE LETTER TSA;Lu;0;L;;;;;N;;;;ABB3;
+13E4;CHEROKEE LETTER TSE;Lu;0;L;;;;;N;;;;ABB4;
+13E5;CHEROKEE LETTER TSI;Lu;0;L;;;;;N;;;;ABB5;
+13E6;CHEROKEE LETTER TSO;Lu;0;L;;;;;N;;;;ABB6;
+13E7;CHEROKEE LETTER TSU;Lu;0;L;;;;;N;;;;ABB7;
+13E8;CHEROKEE LETTER TSV;Lu;0;L;;;;;N;;;;ABB8;
+13E9;CHEROKEE LETTER WA;Lu;0;L;;;;;N;;;;ABB9;
+13EA;CHEROKEE LETTER WE;Lu;0;L;;;;;N;;;;ABBA;
+13EB;CHEROKEE LETTER WI;Lu;0;L;;;;;N;;;;ABBB;
+13EC;CHEROKEE LETTER WO;Lu;0;L;;;;;N;;;;ABBC;
+13ED;CHEROKEE LETTER WU;Lu;0;L;;;;;N;;;;ABBD;
+13EE;CHEROKEE LETTER WV;Lu;0;L;;;;;N;;;;ABBE;
+13EF;CHEROKEE LETTER YA;Lu;0;L;;;;;N;;;;ABBF;
+13F0;CHEROKEE LETTER YE;Lu;0;L;;;;;N;;;;13F8;
+13F1;CHEROKEE LETTER YI;Lu;0;L;;;;;N;;;;13F9;
+13F2;CHEROKEE LETTER YO;Lu;0;L;;;;;N;;;;13FA;
+13F3;CHEROKEE LETTER YU;Lu;0;L;;;;;N;;;;13FB;
+13F4;CHEROKEE LETTER YV;Lu;0;L;;;;;N;;;;13FC;
+13F5;CHEROKEE LETTER MV;Lu;0;L;;;;;N;;;;13FD;
+13F8;CHEROKEE SMALL LETTER YE;Ll;0;L;;;;;N;;;13F0;;13F0
+13F9;CHEROKEE SMALL LETTER YI;Ll;0;L;;;;;N;;;13F1;;13F1
+13FA;CHEROKEE SMALL LETTER YO;Ll;0;L;;;;;N;;;13F2;;13F2
+13FB;CHEROKEE SMALL LETTER YU;Ll;0;L;;;;;N;;;13F3;;13F3
+13FC;CHEROKEE SMALL LETTER YV;Ll;0;L;;;;;N;;;13F4;;13F4
+13FD;CHEROKEE SMALL LETTER MV;Ll;0;L;;;;;N;;;13F5;;13F5
1400;CANADIAN SYLLABICS HYPHEN;Pd;0;ON;;;;;N;;;;;
1401;CANADIAN SYLLABICS E;Lo;0;L;;;;;N;;;;;
1402;CANADIAN SYLLABICS AAI;Lo;0;L;;;;;N;;;;;
@@ -5700,23 +5713,23 @@
19A9;NEW TAI LUE LETTER LOW XVA;Lo;0;L;;;;;N;;;;;
19AA;NEW TAI LUE LETTER HIGH SUA;Lo;0;L;;;;;N;;;;;
19AB;NEW TAI LUE LETTER LOW SUA;Lo;0;L;;;;;N;;;;;
-19B0;NEW TAI LUE VOWEL SIGN VOWEL SHORTENER;Mc;0;L;;;;;N;;;;;
-19B1;NEW TAI LUE VOWEL SIGN AA;Mc;0;L;;;;;N;;;;;
-19B2;NEW TAI LUE VOWEL SIGN II;Mc;0;L;;;;;N;;;;;
-19B3;NEW TAI LUE VOWEL SIGN U;Mc;0;L;;;;;N;;;;;
-19B4;NEW TAI LUE VOWEL SIGN UU;Mc;0;L;;;;;N;;;;;
-19B5;NEW TAI LUE VOWEL SIGN E;Mc;0;L;;;;;N;;;;;
-19B6;NEW TAI LUE VOWEL SIGN AE;Mc;0;L;;;;;N;;;;;
-19B7;NEW TAI LUE VOWEL SIGN O;Mc;0;L;;;;;N;;;;;
-19B8;NEW TAI LUE VOWEL SIGN OA;Mc;0;L;;;;;N;;;;;
-19B9;NEW TAI LUE VOWEL SIGN UE;Mc;0;L;;;;;N;;;;;
-19BA;NEW TAI LUE VOWEL SIGN AY;Mc;0;L;;;;;N;;;;;
-19BB;NEW TAI LUE VOWEL SIGN AAY;Mc;0;L;;;;;N;;;;;
-19BC;NEW TAI LUE VOWEL SIGN UY;Mc;0;L;;;;;N;;;;;
-19BD;NEW TAI LUE VOWEL SIGN OY;Mc;0;L;;;;;N;;;;;
-19BE;NEW TAI LUE VOWEL SIGN OAY;Mc;0;L;;;;;N;;;;;
-19BF;NEW TAI LUE VOWEL SIGN UEY;Mc;0;L;;;;;N;;;;;
-19C0;NEW TAI LUE VOWEL SIGN IY;Mc;0;L;;;;;N;;;;;
+19B0;NEW TAI LUE VOWEL SIGN VOWEL SHORTENER;Lo;0;L;;;;;N;;;;;
+19B1;NEW TAI LUE VOWEL SIGN AA;Lo;0;L;;;;;N;;;;;
+19B2;NEW TAI LUE VOWEL SIGN II;Lo;0;L;;;;;N;;;;;
+19B3;NEW TAI LUE VOWEL SIGN U;Lo;0;L;;;;;N;;;;;
+19B4;NEW TAI LUE VOWEL SIGN UU;Lo;0;L;;;;;N;;;;;
+19B5;NEW TAI LUE VOWEL SIGN E;Lo;0;L;;;;;N;;;;;
+19B6;NEW TAI LUE VOWEL SIGN AE;Lo;0;L;;;;;N;;;;;
+19B7;NEW TAI LUE VOWEL SIGN O;Lo;0;L;;;;;N;;;;;
+19B8;NEW TAI LUE VOWEL SIGN OA;Lo;0;L;;;;;N;;;;;
+19B9;NEW TAI LUE VOWEL SIGN UE;Lo;0;L;;;;;N;;;;;
+19BA;NEW TAI LUE VOWEL SIGN AY;Lo;0;L;;;;;N;;;;;
+19BB;NEW TAI LUE VOWEL SIGN AAY;Lo;0;L;;;;;N;;;;;
+19BC;NEW TAI LUE VOWEL SIGN UY;Lo;0;L;;;;;N;;;;;
+19BD;NEW TAI LUE VOWEL SIGN OY;Lo;0;L;;;;;N;;;;;
+19BE;NEW TAI LUE VOWEL SIGN OAY;Lo;0;L;;;;;N;;;;;
+19BF;NEW TAI LUE VOWEL SIGN UEY;Lo;0;L;;;;;N;;;;;
+19C0;NEW TAI LUE VOWEL SIGN IY;Lo;0;L;;;;;N;;;;;
19C1;NEW TAI LUE LETTER FINAL V;Lo;0;L;;;;;N;;;;;
19C2;NEW TAI LUE LETTER FINAL NG;Lo;0;L;;;;;N;;;;;
19C3;NEW TAI LUE LETTER FINAL N;Lo;0;L;;;;;N;;;;;
@@ -5724,8 +5737,8 @@
19C5;NEW TAI LUE LETTER FINAL K;Lo;0;L;;;;;N;;;;;
19C6;NEW TAI LUE LETTER FINAL D;Lo;0;L;;;;;N;;;;;
19C7;NEW TAI LUE LETTER FINAL B;Lo;0;L;;;;;N;;;;;
-19C8;NEW TAI LUE TONE MARK-1;Mc;0;L;;;;;N;;;;;
-19C9;NEW TAI LUE TONE MARK-2;Mc;0;L;;;;;N;;;;;
+19C8;NEW TAI LUE TONE MARK-1;Lo;0;L;;;;;N;;;;;
+19C9;NEW TAI LUE TONE MARK-2;Lo;0;L;;;;;N;;;;;
19D0;NEW TAI LUE DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;;
19D1;NEW TAI LUE DIGIT ONE;Nd;0;L;;1;1;1;N;;;;;
19D2;NEW TAI LUE DIGIT TWO;Nd;0;L;;2;2;2;N;;;;;
@@ -7277,6 +7290,7 @@
20BB;NORDIC MARK SIGN;Sc;0;ET;;;;;N;;;;;
20BC;MANAT SIGN;Sc;0;ET;;;;;N;;;;;
20BD;RUBLE SIGN;Sc;0;ET;;;;;N;;;;;
+20BE;LARI SIGN;Sc;0;ET;;;;;N;;;;;
20D0;COMBINING LEFT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT HARPOON ABOVE;;;;
20D1;COMBINING RIGHT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RIGHT HARPOON ABOVE;;;;
20D2;COMBINING LONG VERTICAL LINE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG VERTICAL BAR OVERLAY;;;;
@@ -7448,6 +7462,8 @@
2187;ROMAN NUMERAL FIFTY THOUSAND;Nl;0;L;;;;50000;N;;;;;
2188;ROMAN NUMERAL ONE HUNDRED THOUSAND;Nl;0;L;;;;100000;N;;;;;
2189;VULGAR FRACTION ZERO THIRDS;No;0;ON;<fraction> 0030 2044 0033;;;0;N;;;;;
+218A;TURNED DIGIT TWO;So;0;ON;;;;;N;;;;;
+218B;TURNED DIGIT THREE;So;0;ON;;;;;N;;;;;
2190;LEFTWARDS ARROW;Sm;0;ON;;;;;N;LEFT ARROW;;;;
2191;UPWARDS ARROW;Sm;0;ON;;;;;N;UP ARROW;;;;
2192;RIGHTWARDS ARROW;Sm;0;ON;;;;;N;RIGHT ARROW;;;;
@@ -10015,6 +10031,10 @@
2BCF;ROTATED WHITE FOUR POINTED CUSP;So;0;ON;;;;;N;;;;;
2BD0;SQUARE POSITION INDICATOR;So;0;ON;;;;;N;;;;;
2BD1;UNCERTAINTY SIGN;So;0;ON;;;;;N;;;;;
+2BEC;LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;;
+2BED;UPWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;;
+2BEE;RIGHTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;;
+2BEF;DOWNWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS;So;0;ON;;;;;N;;;;;
2C00;GLAGOLITIC CAPITAL LETTER AZU;Lu;0;L;;;;;N;;;;2C30;
2C01;GLAGOLITIC CAPITAL LETTER BUKY;Lu;0;L;;;;;N;;;;2C31;
2C02;GLAGOLITIC CAPITAL LETTER VEDE;Lu;0;L;;;;;N;;;;2C32;
@@ -11942,7 +11962,7 @@
4DFE;HEXAGRAM FOR AFTER COMPLETION;So;0;ON;;;;;N;;;;;
4DFF;HEXAGRAM FOR BEFORE COMPLETION;So;0;ON;;;;;N;;;;;
4E00;<CJK Ideograph, First>;Lo;0;L;;;;;N;;;;;
-9FCC;<CJK Ideograph, Last>;Lo;0;L;;;;;N;;;;;
+9FD5;<CJK Ideograph, Last>;Lo;0;L;;;;;N;;;;;
A000;YI SYLLABLE IT;Lo;0;L;;;;;N;;;;;
A001;YI SYLLABLE IX;Lo;0;L;;;;;N;;;;;
A002;YI SYLLABLE I;Lo;0;L;;;;;N;;;;;
@@ -13605,6 +13625,7 @@ A69A;CYRILLIC CAPITAL LETTER CROSSED O;Lu;0;L;;;;;N;;;;A69B;
A69B;CYRILLIC SMALL LETTER CROSSED O;Ll;0;L;;;;;N;;;A69A;;A69A
A69C;MODIFIER LETTER CYRILLIC HARD SIGN;Lm;0;L;<super> 044A;;;;N;;;;;
A69D;MODIFIER LETTER CYRILLIC SOFT SIGN;Lm;0;L;<super> 044C;;;;N;;;;;
+A69E;COMBINING CYRILLIC LETTER EF;Mn;230;NSM;;;;;N;;;;;
A69F;COMBINING CYRILLIC LETTER IOTIFIED E;Mn;230;NSM;;;;;N;;;;;
A6A0;BAMUM LETTER A;Lo;0;L;;;;;N;;;;;
A6A1;BAMUM LETTER KA;Lo;0;L;;;;;N;;;;;
@@ -13837,6 +13858,7 @@ A78B;LATIN CAPITAL LETTER SALTILLO;Lu;0;L;;;;;N;;;;A78C;
A78C;LATIN SMALL LETTER SALTILLO;Ll;0;L;;;;;N;;;A78B;;A78B
A78D;LATIN CAPITAL LETTER TURNED H;Lu;0;L;;;;;N;;;;0265;
A78E;LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT;Ll;0;L;;;;;N;;;;;
+A78F;LATIN LETTER SINOLOGICAL DOT;Lo;0;L;;;;;N;;;;;
A790;LATIN CAPITAL LETTER N WITH DESCENDER;Lu;0;L;;;;;N;;;;A791;
A791;LATIN SMALL LETTER N WITH DESCENDER;Ll;0;L;;;;;N;;;A790;;A790
A792;LATIN CAPITAL LETTER C WITH BAR;Lu;0;L;;;;;N;;;;A793;
@@ -13869,6 +13891,12 @@ A7AC;LATIN CAPITAL LETTER SCRIPT G;Lu;0;L;;;;;N;;;;0261;
A7AD;LATIN CAPITAL LETTER L WITH BELT;Lu;0;L;;;;;N;;;;026C;
A7B0;LATIN CAPITAL LETTER TURNED K;Lu;0;L;;;;;N;;;;029E;
A7B1;LATIN CAPITAL LETTER TURNED T;Lu;0;L;;;;;N;;;;0287;
+A7B2;LATIN CAPITAL LETTER J WITH CROSSED-TAIL;Lu;0;L;;;;;N;;;;029D;
+A7B3;LATIN CAPITAL LETTER CHI;Lu;0;L;;;;;N;;;;AB53;
+A7B4;LATIN CAPITAL LETTER BETA;Lu;0;L;;;;;N;;;;A7B5;
+A7B5;LATIN SMALL LETTER BETA;Ll;0;L;;;;;N;;;A7B4;;A7B4
+A7B6;LATIN CAPITAL LETTER OMEGA;Lu;0;L;;;;;N;;;;A7B7;
+A7B7;LATIN SMALL LETTER OMEGA;Ll;0;L;;;;;N;;;A7B6;;A7B6
A7F7;LATIN EPIGRAPHIC LETTER SIDEWAYS I;Lo;0;L;;;;;N;;;;;
A7F8;MODIFIER LETTER CAPITAL H WITH STROKE;Lm;0;L;<super> 0126;;;;N;;;;;
A7F9;MODIFIER LETTER SMALL LIGATURE OE;Lm;0;L;<super> 0153;;;;N;;;;;
@@ -14097,6 +14125,8 @@ A8F8;DEVANAGARI SIGN PUSHPIKA;Po;0;L;;;;;N;;;;;
A8F9;DEVANAGARI GAP FILLER;Po;0;L;;;;;N;;;;;
A8FA;DEVANAGARI CARET;Po;0;L;;;;;N;;;;;
A8FB;DEVANAGARI HEADSTROKE;Lo;0;L;;;;;N;;;;;
+A8FC;DEVANAGARI SIGN SIDDHAM;Po;0;L;;;;;N;;;;;
+A8FD;DEVANAGARI JAIN OM;Lo;0;L;;;;;N;;;;;
A900;KAYAH LI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;;
A901;KAYAH LI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;;
A902;KAYAH LI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;;
@@ -14610,7 +14640,7 @@ AB4F;LATIN SMALL LETTER U BAR WITH SHORT RIGHT LEG;Ll;0;L;;;;;N;;;;;
AB50;LATIN SMALL LETTER UI;Ll;0;L;;;;;N;;;;;
AB51;LATIN SMALL LETTER TURNED UI;Ll;0;L;;;;;N;;;;;
AB52;LATIN SMALL LETTER U WITH LEFT HOOK;Ll;0;L;;;;;N;;;;;
-AB53;LATIN SMALL LETTER CHI;Ll;0;L;;;;;N;;;;;
+AB53;LATIN SMALL LETTER CHI;Ll;0;L;;;;;N;;;A7B3;;A7B3
AB54;LATIN SMALL LETTER CHI WITH LOW RIGHT RING;Ll;0;L;;;;;N;;;;;
AB55;LATIN SMALL LETTER CHI WITH LOW LEFT SERIF;Ll;0;L;;;;;N;;;;;
AB56;LATIN SMALL LETTER X WITH LOW RIGHT RING;Ll;0;L;;;;;N;;;;;
@@ -14623,8 +14653,92 @@ AB5C;MODIFIER LETTER SMALL HENG;Lm;0;L;<super> A727;;;;N;;;;;
AB5D;MODIFIER LETTER SMALL L WITH INVERTED LAZY S;Lm;0;L;<super> AB37;;;;N;;;;;
AB5E;MODIFIER LETTER SMALL L WITH MIDDLE TILDE;Lm;0;L;<super> 026B;;;;N;;;;;
AB5F;MODIFIER LETTER SMALL U WITH LEFT HOOK;Lm;0;L;<super> AB52;;;;N;;;;;
+AB60;LATIN SMALL LETTER SAKHA YAT;Ll;0;L;;;;;N;;;;;
+AB61;LATIN SMALL LETTER IOTIFIED E;Ll;0;L;;;;;N;;;;;
+AB62;LATIN SMALL LETTER OPEN OE;Ll;0;L;;;;;N;;;;;
+AB63;LATIN SMALL LETTER UO;Ll;0;L;;;;;N;;;;;
AB64;LATIN SMALL LETTER INVERTED ALPHA;Ll;0;L;;;;;N;;;;;
AB65;GREEK LETTER SMALL CAPITAL OMEGA;Ll;0;L;;;;;N;;;;;
+AB70;CHEROKEE SMALL LETTER A;Ll;0;L;;;;;N;;;13A0;;13A0
+AB71;CHEROKEE SMALL LETTER E;Ll;0;L;;;;;N;;;13A1;;13A1
+AB72;CHEROKEE SMALL LETTER I;Ll;0;L;;;;;N;;;13A2;;13A2
+AB73;CHEROKEE SMALL LETTER O;Ll;0;L;;;;;N;;;13A3;;13A3
+AB74;CHEROKEE SMALL LETTER U;Ll;0;L;;;;;N;;;13A4;;13A4
+AB75;CHEROKEE SMALL LETTER V;Ll;0;L;;;;;N;;;13A5;;13A5
+AB76;CHEROKEE SMALL LETTER GA;Ll;0;L;;;;;N;;;13A6;;13A6
+AB77;CHEROKEE SMALL LETTER KA;Ll;0;L;;;;;N;;;13A7;;13A7
+AB78;CHEROKEE SMALL LETTER GE;Ll;0;L;;;;;N;;;13A8;;13A8
+AB79;CHEROKEE SMALL LETTER GI;Ll;0;L;;;;;N;;;13A9;;13A9
+AB7A;CHEROKEE SMALL LETTER GO;Ll;0;L;;;;;N;;;13AA;;13AA
+AB7B;CHEROKEE SMALL LETTER GU;Ll;0;L;;;;;N;;;13AB;;13AB
+AB7C;CHEROKEE SMALL LETTER GV;Ll;0;L;;;;;N;;;13AC;;13AC
+AB7D;CHEROKEE SMALL LETTER HA;Ll;0;L;;;;;N;;;13AD;;13AD
+AB7E;CHEROKEE SMALL LETTER HE;Ll;0;L;;;;;N;;;13AE;;13AE
+AB7F;CHEROKEE SMALL LETTER HI;Ll;0;L;;;;;N;;;13AF;;13AF
+AB80;CHEROKEE SMALL LETTER HO;Ll;0;L;;;;;N;;;13B0;;13B0
+AB81;CHEROKEE SMALL LETTER HU;Ll;0;L;;;;;N;;;13B1;;13B1
+AB82;CHEROKEE SMALL LETTER HV;Ll;0;L;;;;;N;;;13B2;;13B2
+AB83;CHEROKEE SMALL LETTER LA;Ll;0;L;;;;;N;;;13B3;;13B3
+AB84;CHEROKEE SMALL LETTER LE;Ll;0;L;;;;;N;;;13B4;;13B4
+AB85;CHEROKEE SMALL LETTER LI;Ll;0;L;;;;;N;;;13B5;;13B5
+AB86;CHEROKEE SMALL LETTER LO;Ll;0;L;;;;;N;;;13B6;;13B6
+AB87;CHEROKEE SMALL LETTER LU;Ll;0;L;;;;;N;;;13B7;;13B7
+AB88;CHEROKEE SMALL LETTER LV;Ll;0;L;;;;;N;;;13B8;;13B8
+AB89;CHEROKEE SMALL LETTER MA;Ll;0;L;;;;;N;;;13B9;;13B9
+AB8A;CHEROKEE SMALL LETTER ME;Ll;0;L;;;;;N;;;13BA;;13BA
+AB8B;CHEROKEE SMALL LETTER MI;Ll;0;L;;;;;N;;;13BB;;13BB
+AB8C;CHEROKEE SMALL LETTER MO;Ll;0;L;;;;;N;;;13BC;;13BC
+AB8D;CHEROKEE SMALL LETTER MU;Ll;0;L;;;;;N;;;13BD;;13BD
+AB8E;CHEROKEE SMALL LETTER NA;Ll;0;L;;;;;N;;;13BE;;13BE
+AB8F;CHEROKEE SMALL LETTER HNA;Ll;0;L;;;;;N;;;13BF;;13BF
+AB90;CHEROKEE SMALL LETTER NAH;Ll;0;L;;;;;N;;;13C0;;13C0
+AB91;CHEROKEE SMALL LETTER NE;Ll;0;L;;;;;N;;;13C1;;13C1
+AB92;CHEROKEE SMALL LETTER NI;Ll;0;L;;;;;N;;;13C2;;13C2
+AB93;CHEROKEE SMALL LETTER NO;Ll;0;L;;;;;N;;;13C3;;13C3
+AB94;CHEROKEE SMALL LETTER NU;Ll;0;L;;;;;N;;;13C4;;13C4
+AB95;CHEROKEE SMALL LETTER NV;Ll;0;L;;;;;N;;;13C5;;13C5
+AB96;CHEROKEE SMALL LETTER QUA;Ll;0;L;;;;;N;;;13C6;;13C6
+AB97;CHEROKEE SMALL LETTER QUE;Ll;0;L;;;;;N;;;13C7;;13C7
+AB98;CHEROKEE SMALL LETTER QUI;Ll;0;L;;;;;N;;;13C8;;13C8
+AB99;CHEROKEE SMALL LETTER QUO;Ll;0;L;;;;;N;;;13C9;;13C9
+AB9A;CHEROKEE SMALL LETTER QUU;Ll;0;L;;;;;N;;;13CA;;13CA
+AB9B;CHEROKEE SMALL LETTER QUV;Ll;0;L;;;;;N;;;13CB;;13CB
+AB9C;CHEROKEE SMALL LETTER SA;Ll;0;L;;;;;N;;;13CC;;13CC
+AB9D;CHEROKEE SMALL LETTER S;Ll;0;L;;;;;N;;;13CD;;13CD
+AB9E;CHEROKEE SMALL LETTER SE;Ll;0;L;;;;;N;;;13CE;;13CE
+AB9F;CHEROKEE SMALL LETTER SI;Ll;0;L;;;;;N;;;13CF;;13CF
+ABA0;CHEROKEE SMALL LETTER SO;Ll;0;L;;;;;N;;;13D0;;13D0
+ABA1;CHEROKEE SMALL LETTER SU;Ll;0;L;;;;;N;;;13D1;;13D1
+ABA2;CHEROKEE SMALL LETTER SV;Ll;0;L;;;;;N;;;13D2;;13D2
+ABA3;CHEROKEE SMALL LETTER DA;Ll;0;L;;;;;N;;;13D3;;13D3
+ABA4;CHEROKEE SMALL LETTER TA;Ll;0;L;;;;;N;;;13D4;;13D4
+ABA5;CHEROKEE SMALL LETTER DE;Ll;0;L;;;;;N;;;13D5;;13D5
+ABA6;CHEROKEE SMALL LETTER TE;Ll;0;L;;;;;N;;;13D6;;13D6
+ABA7;CHEROKEE SMALL LETTER DI;Ll;0;L;;;;;N;;;13D7;;13D7
+ABA8;CHEROKEE SMALL LETTER TI;Ll;0;L;;;;;N;;;13D8;;13D8
+ABA9;CHEROKEE SMALL LETTER DO;Ll;0;L;;;;;N;;;13D9;;13D9
+ABAA;CHEROKEE SMALL LETTER DU;Ll;0;L;;;;;N;;;13DA;;13DA
+ABAB;CHEROKEE SMALL LETTER DV;Ll;0;L;;;;;N;;;13DB;;13DB
+ABAC;CHEROKEE SMALL LETTER DLA;Ll;0;L;;;;;N;;;13DC;;13DC
+ABAD;CHEROKEE SMALL LETTER TLA;Ll;0;L;;;;;N;;;13DD;;13DD
+ABAE;CHEROKEE SMALL LETTER TLE;Ll;0;L;;;;;N;;;13DE;;13DE
+ABAF;CHEROKEE SMALL LETTER TLI;Ll;0;L;;;;;N;;;13DF;;13DF
+ABB0;CHEROKEE SMALL LETTER TLO;Ll;0;L;;;;;N;;;13E0;;13E0
+ABB1;CHEROKEE SMALL LETTER TLU;Ll;0;L;;;;;N;;;13E1;;13E1
+ABB2;CHEROKEE SMALL LETTER TLV;Ll;0;L;;;;;N;;;13E2;;13E2
+ABB3;CHEROKEE SMALL LETTER TSA;Ll;0;L;;;;;N;;;13E3;;13E3
+ABB4;CHEROKEE SMALL LETTER TSE;Ll;0;L;;;;;N;;;13E4;;13E4
+ABB5;CHEROKEE SMALL LETTER TSI;Ll;0;L;;;;;N;;;13E5;;13E5
+ABB6;CHEROKEE SMALL LETTER TSO;Ll;0;L;;;;;N;;;13E6;;13E6
+ABB7;CHEROKEE SMALL LETTER TSU;Ll;0;L;;;;;N;;;13E7;;13E7
+ABB8;CHEROKEE SMALL LETTER TSV;Ll;0;L;;;;;N;;;13E8;;13E8
+ABB9;CHEROKEE SMALL LETTER WA;Ll;0;L;;;;;N;;;13E9;;13E9
+ABBA;CHEROKEE SMALL LETTER WE;Ll;0;L;;;;;N;;;13EA;;13EA
+ABBB;CHEROKEE SMALL LETTER WI;Ll;0;L;;;;;N;;;13EB;;13EB
+ABBC;CHEROKEE SMALL LETTER WO;Ll;0;L;;;;;N;;;13EC;;13EC
+ABBD;CHEROKEE SMALL LETTER WU;Ll;0;L;;;;;N;;;13ED;;13ED
+ABBE;CHEROKEE SMALL LETTER WV;Ll;0;L;;;;;N;;;13EE;;13EE
+ABBF;CHEROKEE SMALL LETTER YA;Ll;0;L;;;;;N;;;13EF;;13EF
ABC0;MEETEI MAYEK LETTER KOK;Lo;0;L;;;;;N;;;;;
ABC1;MEETEI MAYEK LETTER SAM;Lo;0;L;;;;;N;;;;;
ABC2;MEETEI MAYEK LETTER LAI;Lo;0;L;;;;;N;;;;;
@@ -15944,6 +16058,8 @@ FE2A;COMBINING TILDE RIGHT HALF BELOW;Mn;220;NSM;;;;;N;;;;;
FE2B;COMBINING MACRON LEFT HALF BELOW;Mn;220;NSM;;;;;N;;;;;
FE2C;COMBINING MACRON RIGHT HALF BELOW;Mn;220;NSM;;;;;N;;;;;
FE2D;COMBINING CONJOINING MACRON BELOW;Mn;220;NSM;;;;;N;;;;;
+FE2E;COMBINING CYRILLIC TITLO LEFT HALF;Mn;230;NSM;;;;;N;;;;;
+FE2F;COMBINING CYRILLIC TITLO RIGHT HALF;Mn;230;NSM;;;;;N;;;;;
FE30;PRESENTATION FORM FOR VERTICAL TWO DOT LEADER;Po;0;ON;<vertical> 2025;;;;N;GLYPH FOR VERTICAL TWO DOT LEADER;;;;
FE31;PRESENTATION FORM FOR VERTICAL EM DASH;Pd;0;ON;<vertical> 2014;;;;N;GLYPH FOR VERTICAL EM DASH;;;;
FE32;PRESENTATION FORM FOR VERTICAL EN DASH;Pd;0;ON;<vertical> 2013;;;;N;GLYPH FOR VERTICAL EN DASH;;;;
@@ -17830,6 +17946,32 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
108AD;NABATAEAN NUMBER TEN;No;0;R;;;;10;N;;;;;
108AE;NABATAEAN NUMBER TWENTY;No;0;R;;;;20;N;;;;;
108AF;NABATAEAN NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;;
+108E0;HATRAN LETTER ALEPH;Lo;0;R;;;;;N;;;;;
+108E1;HATRAN LETTER BETH;Lo;0;R;;;;;N;;;;;
+108E2;HATRAN LETTER GIMEL;Lo;0;R;;;;;N;;;;;
+108E3;HATRAN LETTER DALETH-RESH;Lo;0;R;;;;;N;;;;;
+108E4;HATRAN LETTER HE;Lo;0;R;;;;;N;;;;;
+108E5;HATRAN LETTER WAW;Lo;0;R;;;;;N;;;;;
+108E6;HATRAN LETTER ZAYN;Lo;0;R;;;;;N;;;;;
+108E7;HATRAN LETTER HETH;Lo;0;R;;;;;N;;;;;
+108E8;HATRAN LETTER TETH;Lo;0;R;;;;;N;;;;;
+108E9;HATRAN LETTER YODH;Lo;0;R;;;;;N;;;;;
+108EA;HATRAN LETTER KAPH;Lo;0;R;;;;;N;;;;;
+108EB;HATRAN LETTER LAMEDH;Lo;0;R;;;;;N;;;;;
+108EC;HATRAN LETTER MEM;Lo;0;R;;;;;N;;;;;
+108ED;HATRAN LETTER NUN;Lo;0;R;;;;;N;;;;;
+108EE;HATRAN LETTER SAMEKH;Lo;0;R;;;;;N;;;;;
+108EF;HATRAN LETTER AYN;Lo;0;R;;;;;N;;;;;
+108F0;HATRAN LETTER PE;Lo;0;R;;;;;N;;;;;
+108F1;HATRAN LETTER SADHE;Lo;0;R;;;;;N;;;;;
+108F2;HATRAN LETTER QOPH;Lo;0;R;;;;;N;;;;;
+108F4;HATRAN LETTER SHIN;Lo;0;R;;;;;N;;;;;
+108F5;HATRAN LETTER TAW;Lo;0;R;;;;;N;;;;;
+108FB;HATRAN NUMBER ONE;No;0;R;;;;1;N;;;;;
+108FC;HATRAN NUMBER FIVE;No;0;R;;;;5;N;;;;;
+108FD;HATRAN NUMBER TEN;No;0;R;;;;10;N;;;;;
+108FE;HATRAN NUMBER TWENTY;No;0;R;;;;20;N;;;;;
+108FF;HATRAN NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;;
10900;PHOENICIAN LETTER ALF;Lo;0;R;;;;;N;;;;;
10901;PHOENICIAN LETTER BET;Lo;0;R;;;;;N;;;;;
10902;PHOENICIAN LETTER GAML;Lo;0;R;;;;;N;;;;;
@@ -17942,8 +18084,72 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
109B5;MEROITIC CURSIVE LETTER TE;Lo;0;R;;;;;N;;;;;
109B6;MEROITIC CURSIVE LETTER TO;Lo;0;R;;;;;N;;;;;
109B7;MEROITIC CURSIVE LETTER DA;Lo;0;R;;;;;N;;;;;
+109BC;MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS;No;0;R;;;;11/12;N;;;;;
+109BD;MEROITIC CURSIVE FRACTION ONE HALF;No;0;R;;;;1/2;N;;;;;
109BE;MEROITIC CURSIVE LOGOGRAM RMT;Lo;0;R;;;;;N;;;;;
109BF;MEROITIC CURSIVE LOGOGRAM IMN;Lo;0;R;;;;;N;;;;;
+109C0;MEROITIC CURSIVE NUMBER ONE;No;0;R;;;;1;N;;;;;
+109C1;MEROITIC CURSIVE NUMBER TWO;No;0;R;;;;2;N;;;;;
+109C2;MEROITIC CURSIVE NUMBER THREE;No;0;R;;;;3;N;;;;;
+109C3;MEROITIC CURSIVE NUMBER FOUR;No;0;R;;;;4;N;;;;;
+109C4;MEROITIC CURSIVE NUMBER FIVE;No;0;R;;;;5;N;;;;;
+109C5;MEROITIC CURSIVE NUMBER SIX;No;0;R;;;;6;N;;;;;
+109C6;MEROITIC CURSIVE NUMBER SEVEN;No;0;R;;;;7;N;;;;;
+109C7;MEROITIC CURSIVE NUMBER EIGHT;No;0;R;;;;8;N;;;;;
+109C8;MEROITIC CURSIVE NUMBER NINE;No;0;R;;;;9;N;;;;;
+109C9;MEROITIC CURSIVE NUMBER TEN;No;0;R;;;;10;N;;;;;
+109CA;MEROITIC CURSIVE NUMBER TWENTY;No;0;R;;;;20;N;;;;;
+109CB;MEROITIC CURSIVE NUMBER THIRTY;No;0;R;;;;30;N;;;;;
+109CC;MEROITIC CURSIVE NUMBER FORTY;No;0;R;;;;40;N;;;;;
+109CD;MEROITIC CURSIVE NUMBER FIFTY;No;0;R;;;;50;N;;;;;
+109CE;MEROITIC CURSIVE NUMBER SIXTY;No;0;R;;;;60;N;;;;;
+109CF;MEROITIC CURSIVE NUMBER SEVENTY;No;0;R;;;;70;N;;;;;
+109D2;MEROITIC CURSIVE NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;;
+109D3;MEROITIC CURSIVE NUMBER TWO HUNDRED;No;0;R;;;;200;N;;;;;
+109D4;MEROITIC CURSIVE NUMBER THREE HUNDRED;No;0;R;;;;300;N;;;;;
+109D5;MEROITIC CURSIVE NUMBER FOUR HUNDRED;No;0;R;;;;400;N;;;;;
+109D6;MEROITIC CURSIVE NUMBER FIVE HUNDRED;No;0;R;;;;500;N;;;;;
+109D7;MEROITIC CURSIVE NUMBER SIX HUNDRED;No;0;R;;;;600;N;;;;;
+109D8;MEROITIC CURSIVE NUMBER SEVEN HUNDRED;No;0;R;;;;700;N;;;;;
+109D9;MEROITIC CURSIVE NUMBER EIGHT HUNDRED;No;0;R;;;;800;N;;;;;
+109DA;MEROITIC CURSIVE NUMBER NINE HUNDRED;No;0;R;;;;900;N;;;;;
+109DB;MEROITIC CURSIVE NUMBER ONE THOUSAND;No;0;R;;;;1000;N;;;;;
+109DC;MEROITIC CURSIVE NUMBER TWO THOUSAND;No;0;R;;;;2000;N;;;;;
+109DD;MEROITIC CURSIVE NUMBER THREE THOUSAND;No;0;R;;;;3000;N;;;;;
+109DE;MEROITIC CURSIVE NUMBER FOUR THOUSAND;No;0;R;;;;4000;N;;;;;
+109DF;MEROITIC CURSIVE NUMBER FIVE THOUSAND;No;0;R;;;;5000;N;;;;;
+109E0;MEROITIC CURSIVE NUMBER SIX THOUSAND;No;0;R;;;;6000;N;;;;;
+109E1;MEROITIC CURSIVE NUMBER SEVEN THOUSAND;No;0;R;;;;7000;N;;;;;
+109E2;MEROITIC CURSIVE NUMBER EIGHT THOUSAND;No;0;R;;;;8000;N;;;;;
+109E3;MEROITIC CURSIVE NUMBER NINE THOUSAND;No;0;R;;;;9000;N;;;;;
+109E4;MEROITIC CURSIVE NUMBER TEN THOUSAND;No;0;R;;;;10000;N;;;;;
+109E5;MEROITIC CURSIVE NUMBER TWENTY THOUSAND;No;0;R;;;;20000;N;;;;;
+109E6;MEROITIC CURSIVE NUMBER THIRTY THOUSAND;No;0;R;;;;30000;N;;;;;
+109E7;MEROITIC CURSIVE NUMBER FORTY THOUSAND;No;0;R;;;;40000;N;;;;;
+109E8;MEROITIC CURSIVE NUMBER FIFTY THOUSAND;No;0;R;;;;50000;N;;;;;
+109E9;MEROITIC CURSIVE NUMBER SIXTY THOUSAND;No;0;R;;;;60000;N;;;;;
+109EA;MEROITIC CURSIVE NUMBER SEVENTY THOUSAND;No;0;R;;;;70000;N;;;;;
+109EB;MEROITIC CURSIVE NUMBER EIGHTY THOUSAND;No;0;R;;;;80000;N;;;;;
+109EC;MEROITIC CURSIVE NUMBER NINETY THOUSAND;No;0;R;;;;90000;N;;;;;
+109ED;MEROITIC CURSIVE NUMBER ONE HUNDRED THOUSAND;No;0;R;;;;100000;N;;;;;
+109EE;MEROITIC CURSIVE NUMBER TWO HUNDRED THOUSAND;No;0;R;;;;200000;N;;;;;
+109EF;MEROITIC CURSIVE NUMBER THREE HUNDRED THOUSAND;No;0;R;;;;300000;N;;;;;
+109F0;MEROITIC CURSIVE NUMBER FOUR HUNDRED THOUSAND;No;0;R;;;;400000;N;;;;;
+109F1;MEROITIC CURSIVE NUMBER FIVE HUNDRED THOUSAND;No;0;R;;;;500000;N;;;;;
+109F2;MEROITIC CURSIVE NUMBER SIX HUNDRED THOUSAND;No;0;R;;;;600000;N;;;;;
+109F3;MEROITIC CURSIVE NUMBER SEVEN HUNDRED THOUSAND;No;0;R;;;;700000;N;;;;;
+109F4;MEROITIC CURSIVE NUMBER EIGHT HUNDRED THOUSAND;No;0;R;;;;800000;N;;;;;
+109F5;MEROITIC CURSIVE NUMBER NINE HUNDRED THOUSAND;No;0;R;;;;900000;N;;;;;
+109F6;MEROITIC CURSIVE FRACTION ONE TWELFTH;No;0;R;;;;1/12;N;;;;;
+109F7;MEROITIC CURSIVE FRACTION TWO TWELFTHS;No;0;R;;;;2/12;N;;;;;
+109F8;MEROITIC CURSIVE FRACTION THREE TWELFTHS;No;0;R;;;;3/12;N;;;;;
+109F9;MEROITIC CURSIVE FRACTION FOUR TWELFTHS;No;0;R;;;;4/12;N;;;;;
+109FA;MEROITIC CURSIVE FRACTION FIVE TWELFTHS;No;0;R;;;;5/12;N;;;;;
+109FB;MEROITIC CURSIVE FRACTION SIX TWELFTHS;No;0;R;;;;6/12;N;;;;;
+109FC;MEROITIC CURSIVE FRACTION SEVEN TWELFTHS;No;0;R;;;;7/12;N;;;;;
+109FD;MEROITIC CURSIVE FRACTION EIGHT TWELFTHS;No;0;R;;;;8/12;N;;;;;
+109FE;MEROITIC CURSIVE FRACTION NINE TWELFTHS;No;0;R;;;;9/12;N;;;;;
+109FF;MEROITIC CURSIVE FRACTION TEN TWELFTHS;No;0;R;;;;10/12;N;;;;;
10A00;KHAROSHTHI LETTER A;Lo;0;R;;;;;N;;;;;
10A01;KHAROSHTHI VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;;
10A02;KHAROSHTHI VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;;
@@ -18344,6 +18550,114 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
10C46;OLD TURKIC LETTER YENISEI AET;Lo;0;R;;;;;N;;;;;
10C47;OLD TURKIC LETTER ORKHON OT;Lo;0;R;;;;;N;;;;;
10C48;OLD TURKIC LETTER ORKHON BASH;Lo;0;R;;;;;N;;;;;
+10C80;OLD HUNGARIAN CAPITAL LETTER A;Lu;0;R;;;;;N;;;;10CC0;
+10C81;OLD HUNGARIAN CAPITAL LETTER AA;Lu;0;R;;;;;N;;;;10CC1;
+10C82;OLD HUNGARIAN CAPITAL LETTER EB;Lu;0;R;;;;;N;;;;10CC2;
+10C83;OLD HUNGARIAN CAPITAL LETTER AMB;Lu;0;R;;;;;N;;;;10CC3;
+10C84;OLD HUNGARIAN CAPITAL LETTER EC;Lu;0;R;;;;;N;;;;10CC4;
+10C85;OLD HUNGARIAN CAPITAL LETTER ENC;Lu;0;R;;;;;N;;;;10CC5;
+10C86;OLD HUNGARIAN CAPITAL LETTER ECS;Lu;0;R;;;;;N;;;;10CC6;
+10C87;OLD HUNGARIAN CAPITAL LETTER ED;Lu;0;R;;;;;N;;;;10CC7;
+10C88;OLD HUNGARIAN CAPITAL LETTER AND;Lu;0;R;;;;;N;;;;10CC8;
+10C89;OLD HUNGARIAN CAPITAL LETTER E;Lu;0;R;;;;;N;;;;10CC9;
+10C8A;OLD HUNGARIAN CAPITAL LETTER CLOSE E;Lu;0;R;;;;;N;;;;10CCA;
+10C8B;OLD HUNGARIAN CAPITAL LETTER EE;Lu;0;R;;;;;N;;;;10CCB;
+10C8C;OLD HUNGARIAN CAPITAL LETTER EF;Lu;0;R;;;;;N;;;;10CCC;
+10C8D;OLD HUNGARIAN CAPITAL LETTER EG;Lu;0;R;;;;;N;;;;10CCD;
+10C8E;OLD HUNGARIAN CAPITAL LETTER EGY;Lu;0;R;;;;;N;;;;10CCE;
+10C8F;OLD HUNGARIAN CAPITAL LETTER EH;Lu;0;R;;;;;N;;;;10CCF;
+10C90;OLD HUNGARIAN CAPITAL LETTER I;Lu;0;R;;;;;N;;;;10CD0;
+10C91;OLD HUNGARIAN CAPITAL LETTER II;Lu;0;R;;;;;N;;;;10CD1;
+10C92;OLD HUNGARIAN CAPITAL LETTER EJ;Lu;0;R;;;;;N;;;;10CD2;
+10C93;OLD HUNGARIAN CAPITAL LETTER EK;Lu;0;R;;;;;N;;;;10CD3;
+10C94;OLD HUNGARIAN CAPITAL LETTER AK;Lu;0;R;;;;;N;;;;10CD4;
+10C95;OLD HUNGARIAN CAPITAL LETTER UNK;Lu;0;R;;;;;N;;;;10CD5;
+10C96;OLD HUNGARIAN CAPITAL LETTER EL;Lu;0;R;;;;;N;;;;10CD6;
+10C97;OLD HUNGARIAN CAPITAL LETTER ELY;Lu;0;R;;;;;N;;;;10CD7;
+10C98;OLD HUNGARIAN CAPITAL LETTER EM;Lu;0;R;;;;;N;;;;10CD8;
+10C99;OLD HUNGARIAN CAPITAL LETTER EN;Lu;0;R;;;;;N;;;;10CD9;
+10C9A;OLD HUNGARIAN CAPITAL LETTER ENY;Lu;0;R;;;;;N;;;;10CDA;
+10C9B;OLD HUNGARIAN CAPITAL LETTER O;Lu;0;R;;;;;N;;;;10CDB;
+10C9C;OLD HUNGARIAN CAPITAL LETTER OO;Lu;0;R;;;;;N;;;;10CDC;
+10C9D;OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG OE;Lu;0;R;;;;;N;;;;10CDD;
+10C9E;OLD HUNGARIAN CAPITAL LETTER RUDIMENTA OE;Lu;0;R;;;;;N;;;;10CDE;
+10C9F;OLD HUNGARIAN CAPITAL LETTER OEE;Lu;0;R;;;;;N;;;;10CDF;
+10CA0;OLD HUNGARIAN CAPITAL LETTER EP;Lu;0;R;;;;;N;;;;10CE0;
+10CA1;OLD HUNGARIAN CAPITAL LETTER EMP;Lu;0;R;;;;;N;;;;10CE1;
+10CA2;OLD HUNGARIAN CAPITAL LETTER ER;Lu;0;R;;;;;N;;;;10CE2;
+10CA3;OLD HUNGARIAN CAPITAL LETTER SHORT ER;Lu;0;R;;;;;N;;;;10CE3;
+10CA4;OLD HUNGARIAN CAPITAL LETTER ES;Lu;0;R;;;;;N;;;;10CE4;
+10CA5;OLD HUNGARIAN CAPITAL LETTER ESZ;Lu;0;R;;;;;N;;;;10CE5;
+10CA6;OLD HUNGARIAN CAPITAL LETTER ET;Lu;0;R;;;;;N;;;;10CE6;
+10CA7;OLD HUNGARIAN CAPITAL LETTER ENT;Lu;0;R;;;;;N;;;;10CE7;
+10CA8;OLD HUNGARIAN CAPITAL LETTER ETY;Lu;0;R;;;;;N;;;;10CE8;
+10CA9;OLD HUNGARIAN CAPITAL LETTER ECH;Lu;0;R;;;;;N;;;;10CE9;
+10CAA;OLD HUNGARIAN CAPITAL LETTER U;Lu;0;R;;;;;N;;;;10CEA;
+10CAB;OLD HUNGARIAN CAPITAL LETTER UU;Lu;0;R;;;;;N;;;;10CEB;
+10CAC;OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG UE;Lu;0;R;;;;;N;;;;10CEC;
+10CAD;OLD HUNGARIAN CAPITAL LETTER RUDIMENTA UE;Lu;0;R;;;;;N;;;;10CED;
+10CAE;OLD HUNGARIAN CAPITAL LETTER EV;Lu;0;R;;;;;N;;;;10CEE;
+10CAF;OLD HUNGARIAN CAPITAL LETTER EZ;Lu;0;R;;;;;N;;;;10CEF;
+10CB0;OLD HUNGARIAN CAPITAL LETTER EZS;Lu;0;R;;;;;N;;;;10CF0;
+10CB1;OLD HUNGARIAN CAPITAL LETTER ENT-SHAPED SIGN;Lu;0;R;;;;;N;;;;10CF1;
+10CB2;OLD HUNGARIAN CAPITAL LETTER US;Lu;0;R;;;;;N;;;;10CF2;
+10CC0;OLD HUNGARIAN SMALL LETTER A;Ll;0;R;;;;;N;;;10C80;;10C80
+10CC1;OLD HUNGARIAN SMALL LETTER AA;Ll;0;R;;;;;N;;;10C81;;10C81
+10CC2;OLD HUNGARIAN SMALL LETTER EB;Ll;0;R;;;;;N;;;10C82;;10C82
+10CC3;OLD HUNGARIAN SMALL LETTER AMB;Ll;0;R;;;;;N;;;10C83;;10C83
+10CC4;OLD HUNGARIAN SMALL LETTER EC;Ll;0;R;;;;;N;;;10C84;;10C84
+10CC5;OLD HUNGARIAN SMALL LETTER ENC;Ll;0;R;;;;;N;;;10C85;;10C85
+10CC6;OLD HUNGARIAN SMALL LETTER ECS;Ll;0;R;;;;;N;;;10C86;;10C86
+10CC7;OLD HUNGARIAN SMALL LETTER ED;Ll;0;R;;;;;N;;;10C87;;10C87
+10CC8;OLD HUNGARIAN SMALL LETTER AND;Ll;0;R;;;;;N;;;10C88;;10C88
+10CC9;OLD HUNGARIAN SMALL LETTER E;Ll;0;R;;;;;N;;;10C89;;10C89
+10CCA;OLD HUNGARIAN SMALL LETTER CLOSE E;Ll;0;R;;;;;N;;;10C8A;;10C8A
+10CCB;OLD HUNGARIAN SMALL LETTER EE;Ll;0;R;;;;;N;;;10C8B;;10C8B
+10CCC;OLD HUNGARIAN SMALL LETTER EF;Ll;0;R;;;;;N;;;10C8C;;10C8C
+10CCD;OLD HUNGARIAN SMALL LETTER EG;Ll;0;R;;;;;N;;;10C8D;;10C8D
+10CCE;OLD HUNGARIAN SMALL LETTER EGY;Ll;0;R;;;;;N;;;10C8E;;10C8E
+10CCF;OLD HUNGARIAN SMALL LETTER EH;Ll;0;R;;;;;N;;;10C8F;;10C8F
+10CD0;OLD HUNGARIAN SMALL LETTER I;Ll;0;R;;;;;N;;;10C90;;10C90
+10CD1;OLD HUNGARIAN SMALL LETTER II;Ll;0;R;;;;;N;;;10C91;;10C91
+10CD2;OLD HUNGARIAN SMALL LETTER EJ;Ll;0;R;;;;;N;;;10C92;;10C92
+10CD3;OLD HUNGARIAN SMALL LETTER EK;Ll;0;R;;;;;N;;;10C93;;10C93
+10CD4;OLD HUNGARIAN SMALL LETTER AK;Ll;0;R;;;;;N;;;10C94;;10C94
+10CD5;OLD HUNGARIAN SMALL LETTER UNK;Ll;0;R;;;;;N;;;10C95;;10C95
+10CD6;OLD HUNGARIAN SMALL LETTER EL;Ll;0;R;;;;;N;;;10C96;;10C96
+10CD7;OLD HUNGARIAN SMALL LETTER ELY;Ll;0;R;;;;;N;;;10C97;;10C97
+10CD8;OLD HUNGARIAN SMALL LETTER EM;Ll;0;R;;;;;N;;;10C98;;10C98
+10CD9;OLD HUNGARIAN SMALL LETTER EN;Ll;0;R;;;;;N;;;10C99;;10C99
+10CDA;OLD HUNGARIAN SMALL LETTER ENY;Ll;0;R;;;;;N;;;10C9A;;10C9A
+10CDB;OLD HUNGARIAN SMALL LETTER O;Ll;0;R;;;;;N;;;10C9B;;10C9B
+10CDC;OLD HUNGARIAN SMALL LETTER OO;Ll;0;R;;;;;N;;;10C9C;;10C9C
+10CDD;OLD HUNGARIAN SMALL LETTER NIKOLSBURG OE;Ll;0;R;;;;;N;;;10C9D;;10C9D
+10CDE;OLD HUNGARIAN SMALL LETTER RUDIMENTA OE;Ll;0;R;;;;;N;;;10C9E;;10C9E
+10CDF;OLD HUNGARIAN SMALL LETTER OEE;Ll;0;R;;;;;N;;;10C9F;;10C9F
+10CE0;OLD HUNGARIAN SMALL LETTER EP;Ll;0;R;;;;;N;;;10CA0;;10CA0
+10CE1;OLD HUNGARIAN SMALL LETTER EMP;Ll;0;R;;;;;N;;;10CA1;;10CA1
+10CE2;OLD HUNGARIAN SMALL LETTER ER;Ll;0;R;;;;;N;;;10CA2;;10CA2
+10CE3;OLD HUNGARIAN SMALL LETTER SHORT ER;Ll;0;R;;;;;N;;;10CA3;;10CA3
+10CE4;OLD HUNGARIAN SMALL LETTER ES;Ll;0;R;;;;;N;;;10CA4;;10CA4
+10CE5;OLD HUNGARIAN SMALL LETTER ESZ;Ll;0;R;;;;;N;;;10CA5;;10CA5
+10CE6;OLD HUNGARIAN SMALL LETTER ET;Ll;0;R;;;;;N;;;10CA6;;10CA6
+10CE7;OLD HUNGARIAN SMALL LETTER ENT;Ll;0;R;;;;;N;;;10CA7;;10CA7
+10CE8;OLD HUNGARIAN SMALL LETTER ETY;Ll;0;R;;;;;N;;;10CA8;;10CA8
+10CE9;OLD HUNGARIAN SMALL LETTER ECH;Ll;0;R;;;;;N;;;10CA9;;10CA9
+10CEA;OLD HUNGARIAN SMALL LETTER U;Ll;0;R;;;;;N;;;10CAA;;10CAA
+10CEB;OLD HUNGARIAN SMALL LETTER UU;Ll;0;R;;;;;N;;;10CAB;;10CAB
+10CEC;OLD HUNGARIAN SMALL LETTER NIKOLSBURG UE;Ll;0;R;;;;;N;;;10CAC;;10CAC
+10CED;OLD HUNGARIAN SMALL LETTER RUDIMENTA UE;Ll;0;R;;;;;N;;;10CAD;;10CAD
+10CEE;OLD HUNGARIAN SMALL LETTER EV;Ll;0;R;;;;;N;;;10CAE;;10CAE
+10CEF;OLD HUNGARIAN SMALL LETTER EZ;Ll;0;R;;;;;N;;;10CAF;;10CAF
+10CF0;OLD HUNGARIAN SMALL LETTER EZS;Ll;0;R;;;;;N;;;10CB0;;10CB0
+10CF1;OLD HUNGARIAN SMALL LETTER ENT-SHAPED SIGN;Ll;0;R;;;;;N;;;10CB1;;10CB1
+10CF2;OLD HUNGARIAN SMALL LETTER US;Ll;0;R;;;;;N;;;10CB2;;10CB2
+10CFA;OLD HUNGARIAN NUMBER ONE;No;0;R;;;;1;N;;;;;
+10CFB;OLD HUNGARIAN NUMBER FIVE;No;0;R;;;;5;N;;;;;
+10CFC;OLD HUNGARIAN NUMBER TEN;No;0;R;;;;10;N;;;;;
+10CFD;OLD HUNGARIAN NUMBER FIFTY;No;0;R;;;;50;N;;;;;
+10CFE;OLD HUNGARIAN NUMBER ONE HUNDRED;No;0;R;;;;100;N;;;;;
+10CFF;OLD HUNGARIAN NUMBER ONE THOUSAND;No;0;R;;;;1000;N;;;;;
10E60;RUMI DIGIT ONE;No;0;AN;;;1;1;N;;;;;
10E61;RUMI DIGIT TWO;No;0;AN;;;2;2;N;;;;;
10E62;RUMI DIGIT THREE;No;0;AN;;;3;3;N;;;;;
@@ -18764,6 +19078,10 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
111C6;SHARADA DOUBLE DANDA;Po;0;L;;;;;N;;;;;
111C7;SHARADA ABBREVIATION SIGN;Po;0;L;;;;;N;;;;;
111C8;SHARADA SEPARATOR;Po;0;L;;;;;N;;;;;
+111C9;SHARADA SANDHI MARK;Po;0;L;;;;;N;;;;;
+111CA;SHARADA SIGN NUKTA;Mn;7;NSM;;;;;N;;;;;
+111CB;SHARADA VOWEL MODIFIER MARK;Mn;0;NSM;;;;;N;;;;;
+111CC;SHARADA EXTRA SHORT VOWEL MARK;Mn;0;NSM;;;;;N;;;;;
111CD;SHARADA SUTRA MARK;Po;0;L;;;;;N;;;;;
111D0;SHARADA DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;;
111D1;SHARADA DIGIT ONE;Nd;0;L;;1;1;1;N;;;;;
@@ -18776,6 +19094,11 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
111D8;SHARADA DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;;
111D9;SHARADA DIGIT NINE;Nd;0;L;;9;9;9;N;;;;;
111DA;SHARADA EKAM;Lo;0;L;;;;;N;;;;;
+111DB;SHARADA SIGN SIDDHAM;Po;0;L;;;;;N;;;;;
+111DC;SHARADA HEADSTROKE;Lo;0;L;;;;;N;;;;;
+111DD;SHARADA CONTINUATION SIGN;Po;0;L;;;;;N;;;;;
+111DE;SHARADA SECTION MARK-1;Po;0;L;;;;;N;;;;;
+111DF;SHARADA SECTION MARK-2;Po;0;L;;;;;N;;;;;
111E1;SINHALA ARCHAIC DIGIT ONE;No;0;L;;;;1;N;;;;;
111E2;SINHALA ARCHAIC DIGIT TWO;No;0;L;;;;2;N;;;;;
111E3;SINHALA ARCHAIC DIGIT THREE;No;0;L;;;;3;N;;;;;
@@ -18857,6 +19180,44 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1123B;KHOJKI SECTION MARK;Po;0;L;;;;;N;;;;;
1123C;KHOJKI DOUBLE SECTION MARK;Po;0;L;;;;;N;;;;;
1123D;KHOJKI ABBREVIATION SIGN;Po;0;L;;;;;N;;;;;
+11280;MULTANI LETTER A;Lo;0;L;;;;;N;;;;;
+11281;MULTANI LETTER I;Lo;0;L;;;;;N;;;;;
+11282;MULTANI LETTER U;Lo;0;L;;;;;N;;;;;
+11283;MULTANI LETTER E;Lo;0;L;;;;;N;;;;;
+11284;MULTANI LETTER KA;Lo;0;L;;;;;N;;;;;
+11285;MULTANI LETTER KHA;Lo;0;L;;;;;N;;;;;
+11286;MULTANI LETTER GA;Lo;0;L;;;;;N;;;;;
+11288;MULTANI LETTER GHA;Lo;0;L;;;;;N;;;;;
+1128A;MULTANI LETTER CA;Lo;0;L;;;;;N;;;;;
+1128B;MULTANI LETTER CHA;Lo;0;L;;;;;N;;;;;
+1128C;MULTANI LETTER JA;Lo;0;L;;;;;N;;;;;
+1128D;MULTANI LETTER JJA;Lo;0;L;;;;;N;;;;;
+1128F;MULTANI LETTER NYA;Lo;0;L;;;;;N;;;;;
+11290;MULTANI LETTER TTA;Lo;0;L;;;;;N;;;;;
+11291;MULTANI LETTER TTHA;Lo;0;L;;;;;N;;;;;
+11292;MULTANI LETTER DDA;Lo;0;L;;;;;N;;;;;
+11293;MULTANI LETTER DDDA;Lo;0;L;;;;;N;;;;;
+11294;MULTANI LETTER DDHA;Lo;0;L;;;;;N;;;;;
+11295;MULTANI LETTER NNA;Lo;0;L;;;;;N;;;;;
+11296;MULTANI LETTER TA;Lo;0;L;;;;;N;;;;;
+11297;MULTANI LETTER THA;Lo;0;L;;;;;N;;;;;
+11298;MULTANI LETTER DA;Lo;0;L;;;;;N;;;;;
+11299;MULTANI LETTER DHA;Lo;0;L;;;;;N;;;;;
+1129A;MULTANI LETTER NA;Lo;0;L;;;;;N;;;;;
+1129B;MULTANI LETTER PA;Lo;0;L;;;;;N;;;;;
+1129C;MULTANI LETTER PHA;Lo;0;L;;;;;N;;;;;
+1129D;MULTANI LETTER BA;Lo;0;L;;;;;N;;;;;
+1129F;MULTANI LETTER BHA;Lo;0;L;;;;;N;;;;;
+112A0;MULTANI LETTER MA;Lo;0;L;;;;;N;;;;;
+112A1;MULTANI LETTER YA;Lo;0;L;;;;;N;;;;;
+112A2;MULTANI LETTER RA;Lo;0;L;;;;;N;;;;;
+112A3;MULTANI LETTER LA;Lo;0;L;;;;;N;;;;;
+112A4;MULTANI LETTER VA;Lo;0;L;;;;;N;;;;;
+112A5;MULTANI LETTER SA;Lo;0;L;;;;;N;;;;;
+112A6;MULTANI LETTER HA;Lo;0;L;;;;;N;;;;;
+112A7;MULTANI LETTER RRA;Lo;0;L;;;;;N;;;;;
+112A8;MULTANI LETTER RHA;Lo;0;L;;;;;N;;;;;
+112A9;MULTANI SECTION MARK;Po;0;L;;;;;N;;;;;
112B0;KHUDAWADI LETTER A;Lo;0;L;;;;;N;;;;;
112B1;KHUDAWADI LETTER AA;Lo;0;L;;;;;N;;;;;
112B2;KHUDAWADI LETTER I;Lo;0;L;;;;;N;;;;;
@@ -18926,6 +19287,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
112F7;KHUDAWADI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;;
112F8;KHUDAWADI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;;
112F9;KHUDAWADI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;;
+11300;GRANTHA SIGN COMBINING ANUSVARA ABOVE;Mn;0;NSM;;;;;N;;;;;
11301;GRANTHA SIGN CANDRABINDU;Mn;0;NSM;;;;;N;;;;;
11302;GRANTHA SIGN ANUSVARA;Mc;0;L;;;;;N;;;;;
11303;GRANTHA SIGN VISARGA;Mc;0;L;;;;;N;;;;;
@@ -18989,6 +19351,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1134B;GRANTHA VOWEL SIGN OO;Mc;0;L;11347 1133E;;;;N;;;;;
1134C;GRANTHA VOWEL SIGN AU;Mc;0;L;11347 11357;;;;N;;;;;
1134D;GRANTHA SIGN VIRAMA;Mc;9;L;;;;;N;;;;;
+11350;GRANTHA OM;Lo;0;L;;;;;N;;;;;
11357;GRANTHA AU LENGTH MARK;Mc;0;L;;;;;N;;;;;
1135D;GRANTHA SIGN PLUTA;Lo;0;L;;;;;N;;;;;
1135E;GRANTHA LETTER VEDIC ANUSVARA;Lo;0;L;;;;;N;;;;;
@@ -19163,6 +19526,26 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
115C7;SIDDHAM REPETITION MARK-2;Po;0;L;;;;;N;;;;;
115C8;SIDDHAM REPETITION MARK-3;Po;0;L;;;;;N;;;;;
115C9;SIDDHAM END OF TEXT MARK;Po;0;L;;;;;N;;;;;
+115CA;SIDDHAM SECTION MARK WITH TRIDENT AND U-SHAPED ORNAMENTS;Po;0;L;;;;;N;;;;;
+115CB;SIDDHAM SECTION MARK WITH TRIDENT AND DOTTED CRESCENTS;Po;0;L;;;;;N;;;;;
+115CC;SIDDHAM SECTION MARK WITH RAYS AND DOTTED CRESCENTS;Po;0;L;;;;;N;;;;;
+115CD;SIDDHAM SECTION MARK WITH RAYS AND DOTTED DOUBLE CRESCENTS;Po;0;L;;;;;N;;;;;
+115CE;SIDDHAM SECTION MARK WITH RAYS AND DOTTED TRIPLE CRESCENTS;Po;0;L;;;;;N;;;;;
+115CF;SIDDHAM SECTION MARK DOUBLE RING;Po;0;L;;;;;N;;;;;
+115D0;SIDDHAM SECTION MARK DOUBLE RING WITH RAYS;Po;0;L;;;;;N;;;;;
+115D1;SIDDHAM SECTION MARK WITH DOUBLE CRESCENTS;Po;0;L;;;;;N;;;;;
+115D2;SIDDHAM SECTION MARK WITH TRIPLE CRESCENTS;Po;0;L;;;;;N;;;;;
+115D3;SIDDHAM SECTION MARK WITH QUADRUPLE CRESCENTS;Po;0;L;;;;;N;;;;;
+115D4;SIDDHAM SECTION MARK WITH SEPTUPLE CRESCENTS;Po;0;L;;;;;N;;;;;
+115D5;SIDDHAM SECTION MARK WITH CIRCLES AND RAYS;Po;0;L;;;;;N;;;;;
+115D6;SIDDHAM SECTION MARK WITH CIRCLES AND TWO ENCLOSURES;Po;0;L;;;;;N;;;;;
+115D7;SIDDHAM SECTION MARK WITH CIRCLES AND FOUR ENCLOSURES;Po;0;L;;;;;N;;;;;
+115D8;SIDDHAM LETTER THREE-CIRCLE ALTERNATE I;Lo;0;L;;;;;N;;;;;
+115D9;SIDDHAM LETTER TWO-CIRCLE ALTERNATE I;Lo;0;L;;;;;N;;;;;
+115DA;SIDDHAM LETTER TWO-CIRCLE ALTERNATE II;Lo;0;L;;;;;N;;;;;
+115DB;SIDDHAM LETTER ALTERNATE U;Lo;0;L;;;;;N;;;;;
+115DC;SIDDHAM VOWEL SIGN ALTERNATE U;Mn;0;NSM;;;;;N;;;;;
+115DD;SIDDHAM VOWEL SIGN ALTERNATE UU;Mn;0;NSM;;;;;N;;;;;
11600;MODI LETTER A;Lo;0;L;;;;;N;;;;;
11601;MODI LETTER AA;Lo;0;L;;;;;N;;;;;
11602;MODI LETTER I;Lo;0;L;;;;;N;;;;;
@@ -19308,6 +19691,63 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
116C7;TAKRI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;;
116C8;TAKRI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;;
116C9;TAKRI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;;
+11700;AHOM LETTER KA;Lo;0;L;;;;;N;;;;;
+11701;AHOM LETTER KHA;Lo;0;L;;;;;N;;;;;
+11702;AHOM LETTER NGA;Lo;0;L;;;;;N;;;;;
+11703;AHOM LETTER NA;Lo;0;L;;;;;N;;;;;
+11704;AHOM LETTER TA;Lo;0;L;;;;;N;;;;;
+11705;AHOM LETTER ALTERNATE TA;Lo;0;L;;;;;N;;;;;
+11706;AHOM LETTER PA;Lo;0;L;;;;;N;;;;;
+11707;AHOM LETTER PHA;Lo;0;L;;;;;N;;;;;
+11708;AHOM LETTER BA;Lo;0;L;;;;;N;;;;;
+11709;AHOM LETTER MA;Lo;0;L;;;;;N;;;;;
+1170A;AHOM LETTER JA;Lo;0;L;;;;;N;;;;;
+1170B;AHOM LETTER CHA;Lo;0;L;;;;;N;;;;;
+1170C;AHOM LETTER THA;Lo;0;L;;;;;N;;;;;
+1170D;AHOM LETTER RA;Lo;0;L;;;;;N;;;;;
+1170E;AHOM LETTER LA;Lo;0;L;;;;;N;;;;;
+1170F;AHOM LETTER SA;Lo;0;L;;;;;N;;;;;
+11710;AHOM LETTER NYA;Lo;0;L;;;;;N;;;;;
+11711;AHOM LETTER HA;Lo;0;L;;;;;N;;;;;
+11712;AHOM LETTER A;Lo;0;L;;;;;N;;;;;
+11713;AHOM LETTER DA;Lo;0;L;;;;;N;;;;;
+11714;AHOM LETTER DHA;Lo;0;L;;;;;N;;;;;
+11715;AHOM LETTER GA;Lo;0;L;;;;;N;;;;;
+11716;AHOM LETTER ALTERNATE GA;Lo;0;L;;;;;N;;;;;
+11717;AHOM LETTER GHA;Lo;0;L;;;;;N;;;;;
+11718;AHOM LETTER BHA;Lo;0;L;;;;;N;;;;;
+11719;AHOM LETTER JHA;Lo;0;L;;;;;N;;;;;
+1171D;AHOM CONSONANT SIGN MEDIAL LA;Mn;0;NSM;;;;;N;;;;;
+1171E;AHOM CONSONANT SIGN MEDIAL RA;Mn;0;NSM;;;;;N;;;;;
+1171F;AHOM CONSONANT SIGN MEDIAL LIGATING RA;Mn;0;NSM;;;;;N;;;;;
+11720;AHOM VOWEL SIGN A;Mc;0;L;;;;;N;;;;;
+11721;AHOM VOWEL SIGN AA;Mc;0;L;;;;;N;;;;;
+11722;AHOM VOWEL SIGN I;Mn;0;NSM;;;;;N;;;;;
+11723;AHOM VOWEL SIGN II;Mn;0;NSM;;;;;N;;;;;
+11724;AHOM VOWEL SIGN U;Mn;0;NSM;;;;;N;;;;;
+11725;AHOM VOWEL SIGN UU;Mn;0;NSM;;;;;N;;;;;
+11726;AHOM VOWEL SIGN E;Mc;0;L;;;;;N;;;;;
+11727;AHOM VOWEL SIGN AW;Mn;0;NSM;;;;;N;;;;;
+11728;AHOM VOWEL SIGN O;Mn;0;NSM;;;;;N;;;;;
+11729;AHOM VOWEL SIGN AI;Mn;0;NSM;;;;;N;;;;;
+1172A;AHOM VOWEL SIGN AM;Mn;0;NSM;;;;;N;;;;;
+1172B;AHOM SIGN KILLER;Mn;9;NSM;;;;;N;;;;;
+11730;AHOM DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;;
+11731;AHOM DIGIT ONE;Nd;0;L;;1;1;1;N;;;;;
+11732;AHOM DIGIT TWO;Nd;0;L;;2;2;2;N;;;;;
+11733;AHOM DIGIT THREE;Nd;0;L;;3;3;3;N;;;;;
+11734;AHOM DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;;
+11735;AHOM DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;;
+11736;AHOM DIGIT SIX;Nd;0;L;;6;6;6;N;;;;;
+11737;AHOM DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;;
+11738;AHOM DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;;
+11739;AHOM DIGIT NINE;Nd;0;L;;9;9;9;N;;;;;
+1173A;AHOM NUMBER TEN;No;0;L;;;;10;N;;;;;
+1173B;AHOM NUMBER TWENTY;No;0;L;;;;20;N;;;;;
+1173C;AHOM SIGN SMALL SECTION;Po;0;L;;;;;N;;;;;
+1173D;AHOM SIGN SECTION;Po;0;L;;;;;N;;;;;
+1173E;AHOM SIGN RULAI;Po;0;L;;;;;N;;;;;
+1173F;AHOM SYMBOL VI;So;0;L;;;;;N;;;;;
118A0;WARANG CITI CAPITAL LETTER NGAA;Lu;0;L;;;;;N;;;;118C0;
118A1;WARANG CITI CAPITAL LETTER A;Lu;0;L;;;;;N;;;;118C1;
118A2;WARANG CITI CAPITAL LETTER WI;Lu;0;L;;;;;N;;;;118C2;
@@ -20370,6 +20810,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
12396;CUNEIFORM SIGN SAG TIMES IGI GUNU;Lo;0;L;;;;;N;;;;;
12397;CUNEIFORM SIGN TI2;Lo;0;L;;;;;N;;;;;
12398;CUNEIFORM SIGN UM TIMES ME;Lo;0;L;;;;;N;;;;;
+12399;CUNEIFORM SIGN U U;Lo;0;L;;;;;N;;;;;
12400;CUNEIFORM NUMERIC SIGN TWO ASH;Nl;0;L;;;;2;N;;;;;
12401;CUNEIFORM NUMERIC SIGN THREE ASH;Nl;0;L;;;;3;N;;;;;
12402;CUNEIFORM NUMERIC SIGN FOUR ASH;Nl;0;L;;;;4;N;;;;;
@@ -20486,6 +20927,202 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
12472;CUNEIFORM PUNCTUATION SIGN DIAGONAL COLON;Po;0;L;;;;;N;;;;;
12473;CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON;Po;0;L;;;;;N;;;;;
12474;CUNEIFORM PUNCTUATION SIGN DIAGONAL QUADCOLON;Po;0;L;;;;;N;;;;;
+12480;CUNEIFORM SIGN AB TIMES NUN TENU;Lo;0;L;;;;;N;;;;;
+12481;CUNEIFORM SIGN AB TIMES SHU2;Lo;0;L;;;;;N;;;;;
+12482;CUNEIFORM SIGN AD TIMES ESH2;Lo;0;L;;;;;N;;;;;
+12483;CUNEIFORM SIGN BAD TIMES DISH TENU;Lo;0;L;;;;;N;;;;;
+12484;CUNEIFORM SIGN BAHAR2 TIMES AB2;Lo;0;L;;;;;N;;;;;
+12485;CUNEIFORM SIGN BAHAR2 TIMES NI;Lo;0;L;;;;;N;;;;;
+12486;CUNEIFORM SIGN BAHAR2 TIMES ZA;Lo;0;L;;;;;N;;;;;
+12487;CUNEIFORM SIGN BU OVER BU TIMES NA2;Lo;0;L;;;;;N;;;;;
+12488;CUNEIFORM SIGN DA TIMES TAK4;Lo;0;L;;;;;N;;;;;
+12489;CUNEIFORM SIGN DAG TIMES KUR;Lo;0;L;;;;;N;;;;;
+1248A;CUNEIFORM SIGN DIM TIMES IGI;Lo;0;L;;;;;N;;;;;
+1248B;CUNEIFORM SIGN DIM TIMES U U U;Lo;0;L;;;;;N;;;;;
+1248C;CUNEIFORM SIGN DIM2 TIMES UD;Lo;0;L;;;;;N;;;;;
+1248D;CUNEIFORM SIGN DUG TIMES ANSHE;Lo;0;L;;;;;N;;;;;
+1248E;CUNEIFORM SIGN DUG TIMES ASH;Lo;0;L;;;;;N;;;;;
+1248F;CUNEIFORM SIGN DUG TIMES ASH AT LEFT;Lo;0;L;;;;;N;;;;;
+12490;CUNEIFORM SIGN DUG TIMES DIN;Lo;0;L;;;;;N;;;;;
+12491;CUNEIFORM SIGN DUG TIMES DUN;Lo;0;L;;;;;N;;;;;
+12492;CUNEIFORM SIGN DUG TIMES ERIN2;Lo;0;L;;;;;N;;;;;
+12493;CUNEIFORM SIGN DUG TIMES GA;Lo;0;L;;;;;N;;;;;
+12494;CUNEIFORM SIGN DUG TIMES GI;Lo;0;L;;;;;N;;;;;
+12495;CUNEIFORM SIGN DUG TIMES GIR2 GUNU;Lo;0;L;;;;;N;;;;;
+12496;CUNEIFORM SIGN DUG TIMES GISH;Lo;0;L;;;;;N;;;;;
+12497;CUNEIFORM SIGN DUG TIMES HA;Lo;0;L;;;;;N;;;;;
+12498;CUNEIFORM SIGN DUG TIMES HI;Lo;0;L;;;;;N;;;;;
+12499;CUNEIFORM SIGN DUG TIMES IGI GUNU;Lo;0;L;;;;;N;;;;;
+1249A;CUNEIFORM SIGN DUG TIMES KASKAL;Lo;0;L;;;;;N;;;;;
+1249B;CUNEIFORM SIGN DUG TIMES KUR;Lo;0;L;;;;;N;;;;;
+1249C;CUNEIFORM SIGN DUG TIMES KUSHU2;Lo;0;L;;;;;N;;;;;
+1249D;CUNEIFORM SIGN DUG TIMES KUSHU2 PLUS KASKAL;Lo;0;L;;;;;N;;;;;
+1249E;CUNEIFORM SIGN DUG TIMES LAK-020;Lo;0;L;;;;;N;;;;;
+1249F;CUNEIFORM SIGN DUG TIMES LAM;Lo;0;L;;;;;N;;;;;
+124A0;CUNEIFORM SIGN DUG TIMES LAM TIMES KUR;Lo;0;L;;;;;N;;;;;
+124A1;CUNEIFORM SIGN DUG TIMES LUH PLUS GISH;Lo;0;L;;;;;N;;;;;
+124A2;CUNEIFORM SIGN DUG TIMES MASH;Lo;0;L;;;;;N;;;;;
+124A3;CUNEIFORM SIGN DUG TIMES MES;Lo;0;L;;;;;N;;;;;
+124A4;CUNEIFORM SIGN DUG TIMES MI;Lo;0;L;;;;;N;;;;;
+124A5;CUNEIFORM SIGN DUG TIMES NI;Lo;0;L;;;;;N;;;;;
+124A6;CUNEIFORM SIGN DUG TIMES PI;Lo;0;L;;;;;N;;;;;
+124A7;CUNEIFORM SIGN DUG TIMES SHE;Lo;0;L;;;;;N;;;;;
+124A8;CUNEIFORM SIGN DUG TIMES SI GUNU;Lo;0;L;;;;;N;;;;;
+124A9;CUNEIFORM SIGN E2 TIMES KUR;Lo;0;L;;;;;N;;;;;
+124AA;CUNEIFORM SIGN E2 TIMES PAP;Lo;0;L;;;;;N;;;;;
+124AB;CUNEIFORM SIGN ERIN2 X;Lo;0;L;;;;;N;;;;;
+124AC;CUNEIFORM SIGN ESH2 CROSSING ESH2;Lo;0;L;;;;;N;;;;;
+124AD;CUNEIFORM SIGN EZEN SHESHIG TIMES ASH;Lo;0;L;;;;;N;;;;;
+124AE;CUNEIFORM SIGN EZEN SHESHIG TIMES HI;Lo;0;L;;;;;N;;;;;
+124AF;CUNEIFORM SIGN EZEN SHESHIG TIMES IGI GUNU;Lo;0;L;;;;;N;;;;;
+124B0;CUNEIFORM SIGN EZEN SHESHIG TIMES LA;Lo;0;L;;;;;N;;;;;
+124B1;CUNEIFORM SIGN EZEN SHESHIG TIMES LAL;Lo;0;L;;;;;N;;;;;
+124B2;CUNEIFORM SIGN EZEN SHESHIG TIMES ME;Lo;0;L;;;;;N;;;;;
+124B3;CUNEIFORM SIGN EZEN SHESHIG TIMES MES;Lo;0;L;;;;;N;;;;;
+124B4;CUNEIFORM SIGN EZEN SHESHIG TIMES SU;Lo;0;L;;;;;N;;;;;
+124B5;CUNEIFORM SIGN EZEN TIMES SU;Lo;0;L;;;;;N;;;;;
+124B6;CUNEIFORM SIGN GA2 TIMES BAHAR2;Lo;0;L;;;;;N;;;;;
+124B7;CUNEIFORM SIGN GA2 TIMES DIM GUNU;Lo;0;L;;;;;N;;;;;
+124B8;CUNEIFORM SIGN GA2 TIMES DUG TIMES IGI GUNU;Lo;0;L;;;;;N;;;;;
+124B9;CUNEIFORM SIGN GA2 TIMES DUG TIMES KASKAL;Lo;0;L;;;;;N;;;;;
+124BA;CUNEIFORM SIGN GA2 TIMES EREN;Lo;0;L;;;;;N;;;;;
+124BB;CUNEIFORM SIGN GA2 TIMES GA;Lo;0;L;;;;;N;;;;;
+124BC;CUNEIFORM SIGN GA2 TIMES GAR PLUS DI;Lo;0;L;;;;;N;;;;;
+124BD;CUNEIFORM SIGN GA2 TIMES GAR PLUS NE;Lo;0;L;;;;;N;;;;;
+124BE;CUNEIFORM SIGN GA2 TIMES HA PLUS A;Lo;0;L;;;;;N;;;;;
+124BF;CUNEIFORM SIGN GA2 TIMES KUSHU2 PLUS KASKAL;Lo;0;L;;;;;N;;;;;
+124C0;CUNEIFORM SIGN GA2 TIMES LAM;Lo;0;L;;;;;N;;;;;
+124C1;CUNEIFORM SIGN GA2 TIMES LAM TIMES KUR;Lo;0;L;;;;;N;;;;;
+124C2;CUNEIFORM SIGN GA2 TIMES LUH;Lo;0;L;;;;;N;;;;;
+124C3;CUNEIFORM SIGN GA2 TIMES MUSH;Lo;0;L;;;;;N;;;;;
+124C4;CUNEIFORM SIGN GA2 TIMES NE;Lo;0;L;;;;;N;;;;;
+124C5;CUNEIFORM SIGN GA2 TIMES NE PLUS E2;Lo;0;L;;;;;N;;;;;
+124C6;CUNEIFORM SIGN GA2 TIMES NE PLUS GI;Lo;0;L;;;;;N;;;;;
+124C7;CUNEIFORM SIGN GA2 TIMES SHIM;Lo;0;L;;;;;N;;;;;
+124C8;CUNEIFORM SIGN GA2 TIMES ZIZ2;Lo;0;L;;;;;N;;;;;
+124C9;CUNEIFORM SIGN GABA ROTATED NINETY DEGREES;Lo;0;L;;;;;N;;;;;
+124CA;CUNEIFORM SIGN GESHTIN TIMES U;Lo;0;L;;;;;N;;;;;
+124CB;CUNEIFORM SIGN GISH TIMES GISH CROSSING GISH;Lo;0;L;;;;;N;;;;;
+124CC;CUNEIFORM SIGN GU2 TIMES IGI GUNU;Lo;0;L;;;;;N;;;;;
+124CD;CUNEIFORM SIGN GUD PLUS GISH TIMES TAK4;Lo;0;L;;;;;N;;;;;
+124CE;CUNEIFORM SIGN HA TENU GUNU;Lo;0;L;;;;;N;;;;;
+124CF;CUNEIFORM SIGN HI TIMES ASH OVER HI TIMES ASH;Lo;0;L;;;;;N;;;;;
+124D0;CUNEIFORM SIGN KA TIMES BU;Lo;0;L;;;;;N;;;;;
+124D1;CUNEIFORM SIGN KA TIMES KA;Lo;0;L;;;;;N;;;;;
+124D2;CUNEIFORM SIGN KA TIMES U U U;Lo;0;L;;;;;N;;;;;
+124D3;CUNEIFORM SIGN KA TIMES UR;Lo;0;L;;;;;N;;;;;
+124D4;CUNEIFORM SIGN LAGAB TIMES ZU OVER ZU;Lo;0;L;;;;;N;;;;;
+124D5;CUNEIFORM SIGN LAK-003;Lo;0;L;;;;;N;;;;;
+124D6;CUNEIFORM SIGN LAK-021;Lo;0;L;;;;;N;;;;;
+124D7;CUNEIFORM SIGN LAK-025;Lo;0;L;;;;;N;;;;;
+124D8;CUNEIFORM SIGN LAK-030;Lo;0;L;;;;;N;;;;;
+124D9;CUNEIFORM SIGN LAK-050;Lo;0;L;;;;;N;;;;;
+124DA;CUNEIFORM SIGN LAK-051;Lo;0;L;;;;;N;;;;;
+124DB;CUNEIFORM SIGN LAK-062;Lo;0;L;;;;;N;;;;;
+124DC;CUNEIFORM SIGN LAK-079 OVER LAK-079 GUNU;Lo;0;L;;;;;N;;;;;
+124DD;CUNEIFORM SIGN LAK-080;Lo;0;L;;;;;N;;;;;
+124DE;CUNEIFORM SIGN LAK-081 OVER LAK-081;Lo;0;L;;;;;N;;;;;
+124DF;CUNEIFORM SIGN LAK-092;Lo;0;L;;;;;N;;;;;
+124E0;CUNEIFORM SIGN LAK-130;Lo;0;L;;;;;N;;;;;
+124E1;CUNEIFORM SIGN LAK-142;Lo;0;L;;;;;N;;;;;
+124E2;CUNEIFORM SIGN LAK-210;Lo;0;L;;;;;N;;;;;
+124E3;CUNEIFORM SIGN LAK-219;Lo;0;L;;;;;N;;;;;
+124E4;CUNEIFORM SIGN LAK-220;Lo;0;L;;;;;N;;;;;
+124E5;CUNEIFORM SIGN LAK-225;Lo;0;L;;;;;N;;;;;
+124E6;CUNEIFORM SIGN LAK-228;Lo;0;L;;;;;N;;;;;
+124E7;CUNEIFORM SIGN LAK-238;Lo;0;L;;;;;N;;;;;
+124E8;CUNEIFORM SIGN LAK-265;Lo;0;L;;;;;N;;;;;
+124E9;CUNEIFORM SIGN LAK-266;Lo;0;L;;;;;N;;;;;
+124EA;CUNEIFORM SIGN LAK-343;Lo;0;L;;;;;N;;;;;
+124EB;CUNEIFORM SIGN LAK-347;Lo;0;L;;;;;N;;;;;
+124EC;CUNEIFORM SIGN LAK-348;Lo;0;L;;;;;N;;;;;
+124ED;CUNEIFORM SIGN LAK-383;Lo;0;L;;;;;N;;;;;
+124EE;CUNEIFORM SIGN LAK-384;Lo;0;L;;;;;N;;;;;
+124EF;CUNEIFORM SIGN LAK-390;Lo;0;L;;;;;N;;;;;
+124F0;CUNEIFORM SIGN LAK-441;Lo;0;L;;;;;N;;;;;
+124F1;CUNEIFORM SIGN LAK-449;Lo;0;L;;;;;N;;;;;
+124F2;CUNEIFORM SIGN LAK-449 TIMES GU;Lo;0;L;;;;;N;;;;;
+124F3;CUNEIFORM SIGN LAK-449 TIMES IGI;Lo;0;L;;;;;N;;;;;
+124F4;CUNEIFORM SIGN LAK-449 TIMES PAP PLUS LU3;Lo;0;L;;;;;N;;;;;
+124F5;CUNEIFORM SIGN LAK-449 TIMES PAP PLUS PAP PLUS LU3;Lo;0;L;;;;;N;;;;;
+124F6;CUNEIFORM SIGN LAK-449 TIMES U2 PLUS BA;Lo;0;L;;;;;N;;;;;
+124F7;CUNEIFORM SIGN LAK-450;Lo;0;L;;;;;N;;;;;
+124F8;CUNEIFORM SIGN LAK-457;Lo;0;L;;;;;N;;;;;
+124F9;CUNEIFORM SIGN LAK-470;Lo;0;L;;;;;N;;;;;
+124FA;CUNEIFORM SIGN LAK-483;Lo;0;L;;;;;N;;;;;
+124FB;CUNEIFORM SIGN LAK-490;Lo;0;L;;;;;N;;;;;
+124FC;CUNEIFORM SIGN LAK-492;Lo;0;L;;;;;N;;;;;
+124FD;CUNEIFORM SIGN LAK-493;Lo;0;L;;;;;N;;;;;
+124FE;CUNEIFORM SIGN LAK-495;Lo;0;L;;;;;N;;;;;
+124FF;CUNEIFORM SIGN LAK-550;Lo;0;L;;;;;N;;;;;
+12500;CUNEIFORM SIGN LAK-608;Lo;0;L;;;;;N;;;;;
+12501;CUNEIFORM SIGN LAK-617;Lo;0;L;;;;;N;;;;;
+12502;CUNEIFORM SIGN LAK-617 TIMES ASH;Lo;0;L;;;;;N;;;;;
+12503;CUNEIFORM SIGN LAK-617 TIMES BAD;Lo;0;L;;;;;N;;;;;
+12504;CUNEIFORM SIGN LAK-617 TIMES DUN3 GUNU GUNU;Lo;0;L;;;;;N;;;;;
+12505;CUNEIFORM SIGN LAK-617 TIMES KU3;Lo;0;L;;;;;N;;;;;
+12506;CUNEIFORM SIGN LAK-617 TIMES LA;Lo;0;L;;;;;N;;;;;
+12507;CUNEIFORM SIGN LAK-617 TIMES TAR;Lo;0;L;;;;;N;;;;;
+12508;CUNEIFORM SIGN LAK-617 TIMES TE;Lo;0;L;;;;;N;;;;;
+12509;CUNEIFORM SIGN LAK-617 TIMES U2;Lo;0;L;;;;;N;;;;;
+1250A;CUNEIFORM SIGN LAK-617 TIMES UD;Lo;0;L;;;;;N;;;;;
+1250B;CUNEIFORM SIGN LAK-617 TIMES URUDA;Lo;0;L;;;;;N;;;;;
+1250C;CUNEIFORM SIGN LAK-636;Lo;0;L;;;;;N;;;;;
+1250D;CUNEIFORM SIGN LAK-648;Lo;0;L;;;;;N;;;;;
+1250E;CUNEIFORM SIGN LAK-648 TIMES DUB;Lo;0;L;;;;;N;;;;;
+1250F;CUNEIFORM SIGN LAK-648 TIMES GA;Lo;0;L;;;;;N;;;;;
+12510;CUNEIFORM SIGN LAK-648 TIMES IGI;Lo;0;L;;;;;N;;;;;
+12511;CUNEIFORM SIGN LAK-648 TIMES IGI GUNU;Lo;0;L;;;;;N;;;;;
+12512;CUNEIFORM SIGN LAK-648 TIMES NI;Lo;0;L;;;;;N;;;;;
+12513;CUNEIFORM SIGN LAK-648 TIMES PAP PLUS PAP PLUS LU3;Lo;0;L;;;;;N;;;;;
+12514;CUNEIFORM SIGN LAK-648 TIMES SHESH PLUS KI;Lo;0;L;;;;;N;;;;;
+12515;CUNEIFORM SIGN LAK-648 TIMES UD;Lo;0;L;;;;;N;;;;;
+12516;CUNEIFORM SIGN LAK-648 TIMES URUDA;Lo;0;L;;;;;N;;;;;
+12517;CUNEIFORM SIGN LAK-724;Lo;0;L;;;;;N;;;;;
+12518;CUNEIFORM SIGN LAK-749;Lo;0;L;;;;;N;;;;;
+12519;CUNEIFORM SIGN LU2 GUNU TIMES ASH;Lo;0;L;;;;;N;;;;;
+1251A;CUNEIFORM SIGN LU2 TIMES DISH;Lo;0;L;;;;;N;;;;;
+1251B;CUNEIFORM SIGN LU2 TIMES HAL;Lo;0;L;;;;;N;;;;;
+1251C;CUNEIFORM SIGN LU2 TIMES PAP;Lo;0;L;;;;;N;;;;;
+1251D;CUNEIFORM SIGN LU2 TIMES PAP PLUS PAP PLUS LU3;Lo;0;L;;;;;N;;;;;
+1251E;CUNEIFORM SIGN LU2 TIMES TAK4;Lo;0;L;;;;;N;;;;;
+1251F;CUNEIFORM SIGN MI PLUS ZA7;Lo;0;L;;;;;N;;;;;
+12520;CUNEIFORM SIGN MUSH OVER MUSH TIMES GA;Lo;0;L;;;;;N;;;;;
+12521;CUNEIFORM SIGN MUSH OVER MUSH TIMES KAK;Lo;0;L;;;;;N;;;;;
+12522;CUNEIFORM SIGN NINDA2 TIMES DIM GUNU;Lo;0;L;;;;;N;;;;;
+12523;CUNEIFORM SIGN NINDA2 TIMES GISH;Lo;0;L;;;;;N;;;;;
+12524;CUNEIFORM SIGN NINDA2 TIMES GUL;Lo;0;L;;;;;N;;;;;
+12525;CUNEIFORM SIGN NINDA2 TIMES HI;Lo;0;L;;;;;N;;;;;
+12526;CUNEIFORM SIGN NINDA2 TIMES KESH2;Lo;0;L;;;;;N;;;;;
+12527;CUNEIFORM SIGN NINDA2 TIMES LAK-050;Lo;0;L;;;;;N;;;;;
+12528;CUNEIFORM SIGN NINDA2 TIMES MASH;Lo;0;L;;;;;N;;;;;
+12529;CUNEIFORM SIGN NINDA2 TIMES PAP PLUS PAP;Lo;0;L;;;;;N;;;;;
+1252A;CUNEIFORM SIGN NINDA2 TIMES U;Lo;0;L;;;;;N;;;;;
+1252B;CUNEIFORM SIGN NINDA2 TIMES U PLUS U;Lo;0;L;;;;;N;;;;;
+1252C;CUNEIFORM SIGN NINDA2 TIMES URUDA;Lo;0;L;;;;;N;;;;;
+1252D;CUNEIFORM SIGN SAG GUNU TIMES HA;Lo;0;L;;;;;N;;;;;
+1252E;CUNEIFORM SIGN SAG TIMES EN;Lo;0;L;;;;;N;;;;;
+1252F;CUNEIFORM SIGN SAG TIMES SHE AT LEFT;Lo;0;L;;;;;N;;;;;
+12530;CUNEIFORM SIGN SAG TIMES TAK4;Lo;0;L;;;;;N;;;;;
+12531;CUNEIFORM SIGN SHA6 TENU;Lo;0;L;;;;;N;;;;;
+12532;CUNEIFORM SIGN SHE OVER SHE;Lo;0;L;;;;;N;;;;;
+12533;CUNEIFORM SIGN SHE PLUS HUB2;Lo;0;L;;;;;N;;;;;
+12534;CUNEIFORM SIGN SHE PLUS NAM2;Lo;0;L;;;;;N;;;;;
+12535;CUNEIFORM SIGN SHE PLUS SAR;Lo;0;L;;;;;N;;;;;
+12536;CUNEIFORM SIGN SHU2 PLUS DUG TIMES NI;Lo;0;L;;;;;N;;;;;
+12537;CUNEIFORM SIGN SHU2 PLUS E2 TIMES AN;Lo;0;L;;;;;N;;;;;
+12538;CUNEIFORM SIGN SI TIMES TAK4;Lo;0;L;;;;;N;;;;;
+12539;CUNEIFORM SIGN TAK4 PLUS SAG;Lo;0;L;;;;;N;;;;;
+1253A;CUNEIFORM SIGN TUM TIMES GAN2 TENU;Lo;0;L;;;;;N;;;;;
+1253B;CUNEIFORM SIGN TUM TIMES THREE DISH;Lo;0;L;;;;;N;;;;;
+1253C;CUNEIFORM SIGN UR2 INVERTED;Lo;0;L;;;;;N;;;;;
+1253D;CUNEIFORM SIGN UR2 TIMES UD;Lo;0;L;;;;;N;;;;;
+1253E;CUNEIFORM SIGN URU TIMES DARA3;Lo;0;L;;;;;N;;;;;
+1253F;CUNEIFORM SIGN URU TIMES LAK-668;Lo;0;L;;;;;N;;;;;
+12540;CUNEIFORM SIGN URU TIMES LU3;Lo;0;L;;;;;N;;;;;
+12541;CUNEIFORM SIGN ZA7;Lo;0;L;;;;;N;;;;;
+12542;CUNEIFORM SIGN ZU OVER ZU PLUS SAR;Lo;0;L;;;;;N;;;;;
+12543;CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU;Lo;0;L;;;;;N;;;;;
13000;EGYPTIAN HIEROGLYPH A001;Lo;0;L;;;;;N;;;;;
13001;EGYPTIAN HIEROGLYPH A002;Lo;0;L;;;;;N;;;;;
13002;EGYPTIAN HIEROGLYPH A003;Lo;0;L;;;;;N;;;;;
@@ -21557,6 +22194,589 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1342C;EGYPTIAN HIEROGLYPH AA030;Lo;0;L;;;;;N;;;;;
1342D;EGYPTIAN HIEROGLYPH AA031;Lo;0;L;;;;;N;;;;;
1342E;EGYPTIAN HIEROGLYPH AA032;Lo;0;L;;;;;N;;;;;
+14400;ANATOLIAN HIEROGLYPH A001;Lo;0;L;;;;;N;;;;;
+14401;ANATOLIAN HIEROGLYPH A002;Lo;0;L;;;;;N;;;;;
+14402;ANATOLIAN HIEROGLYPH A003;Lo;0;L;;;;;N;;;;;
+14403;ANATOLIAN HIEROGLYPH A004;Lo;0;L;;;;;N;;;;;
+14404;ANATOLIAN HIEROGLYPH A005;Lo;0;L;;;;;N;;;;;
+14405;ANATOLIAN HIEROGLYPH A006;Lo;0;L;;;;;N;;;;;
+14406;ANATOLIAN HIEROGLYPH A007;Lo;0;L;;;;;N;;;;;
+14407;ANATOLIAN HIEROGLYPH A008;Lo;0;L;;;;;N;;;;;
+14408;ANATOLIAN HIEROGLYPH A009;Lo;0;L;;;;;N;;;;;
+14409;ANATOLIAN HIEROGLYPH A010;Lo;0;L;;;;;N;;;;;
+1440A;ANATOLIAN HIEROGLYPH A010A;Lo;0;L;;;;;N;;;;;
+1440B;ANATOLIAN HIEROGLYPH A011;Lo;0;L;;;;;N;;;;;
+1440C;ANATOLIAN HIEROGLYPH A012;Lo;0;L;;;;;N;;;;;
+1440D;ANATOLIAN HIEROGLYPH A013;Lo;0;L;;;;;N;;;;;
+1440E;ANATOLIAN HIEROGLYPH A014;Lo;0;L;;;;;N;;;;;
+1440F;ANATOLIAN HIEROGLYPH A015;Lo;0;L;;;;;N;;;;;
+14410;ANATOLIAN HIEROGLYPH A016;Lo;0;L;;;;;N;;;;;
+14411;ANATOLIAN HIEROGLYPH A017;Lo;0;L;;;;;N;;;;;
+14412;ANATOLIAN HIEROGLYPH A018;Lo;0;L;;;;;N;;;;;
+14413;ANATOLIAN HIEROGLYPH A019;Lo;0;L;;;;;N;;;;;
+14414;ANATOLIAN HIEROGLYPH A020;Lo;0;L;;;;;N;;;;;
+14415;ANATOLIAN HIEROGLYPH A021;Lo;0;L;;;;;N;;;;;
+14416;ANATOLIAN HIEROGLYPH A022;Lo;0;L;;;;;N;;;;;
+14417;ANATOLIAN HIEROGLYPH A023;Lo;0;L;;;;;N;;;;;
+14418;ANATOLIAN HIEROGLYPH A024;Lo;0;L;;;;;N;;;;;
+14419;ANATOLIAN HIEROGLYPH A025;Lo;0;L;;;;;N;;;;;
+1441A;ANATOLIAN HIEROGLYPH A026;Lo;0;L;;;;;N;;;;;
+1441B;ANATOLIAN HIEROGLYPH A026A;Lo;0;L;;;;;N;;;;;
+1441C;ANATOLIAN HIEROGLYPH A027;Lo;0;L;;;;;N;;;;;
+1441D;ANATOLIAN HIEROGLYPH A028;Lo;0;L;;;;;N;;;;;
+1441E;ANATOLIAN HIEROGLYPH A029;Lo;0;L;;;;;N;;;;;
+1441F;ANATOLIAN HIEROGLYPH A030;Lo;0;L;;;;;N;;;;;
+14420;ANATOLIAN HIEROGLYPH A031;Lo;0;L;;;;;N;;;;;
+14421;ANATOLIAN HIEROGLYPH A032;Lo;0;L;;;;;N;;;;;
+14422;ANATOLIAN HIEROGLYPH A033;Lo;0;L;;;;;N;;;;;
+14423;ANATOLIAN HIEROGLYPH A034;Lo;0;L;;;;;N;;;;;
+14424;ANATOLIAN HIEROGLYPH A035;Lo;0;L;;;;;N;;;;;
+14425;ANATOLIAN HIEROGLYPH A036;Lo;0;L;;;;;N;;;;;
+14426;ANATOLIAN HIEROGLYPH A037;Lo;0;L;;;;;N;;;;;
+14427;ANATOLIAN HIEROGLYPH A038;Lo;0;L;;;;;N;;;;;
+14428;ANATOLIAN HIEROGLYPH A039;Lo;0;L;;;;;N;;;;;
+14429;ANATOLIAN HIEROGLYPH A039A;Lo;0;L;;;;;N;;;;;
+1442A;ANATOLIAN HIEROGLYPH A040;Lo;0;L;;;;;N;;;;;
+1442B;ANATOLIAN HIEROGLYPH A041;Lo;0;L;;;;;N;;;;;
+1442C;ANATOLIAN HIEROGLYPH A041A;Lo;0;L;;;;;N;;;;;
+1442D;ANATOLIAN HIEROGLYPH A042;Lo;0;L;;;;;N;;;;;
+1442E;ANATOLIAN HIEROGLYPH A043;Lo;0;L;;;;;N;;;;;
+1442F;ANATOLIAN HIEROGLYPH A044;Lo;0;L;;;;;N;;;;;
+14430;ANATOLIAN HIEROGLYPH A045;Lo;0;L;;;;;N;;;;;
+14431;ANATOLIAN HIEROGLYPH A045A;Lo;0;L;;;;;N;;;;;
+14432;ANATOLIAN HIEROGLYPH A046;Lo;0;L;;;;;N;;;;;
+14433;ANATOLIAN HIEROGLYPH A046A;Lo;0;L;;;;;N;;;;;
+14434;ANATOLIAN HIEROGLYPH A046B;Lo;0;L;;;;;N;;;;;
+14435;ANATOLIAN HIEROGLYPH A047;Lo;0;L;;;;;N;;;;;
+14436;ANATOLIAN HIEROGLYPH A048;Lo;0;L;;;;;N;;;;;
+14437;ANATOLIAN HIEROGLYPH A049;Lo;0;L;;;;;N;;;;;
+14438;ANATOLIAN HIEROGLYPH A050;Lo;0;L;;;;;N;;;;;
+14439;ANATOLIAN HIEROGLYPH A051;Lo;0;L;;;;;N;;;;;
+1443A;ANATOLIAN HIEROGLYPH A052;Lo;0;L;;;;;N;;;;;
+1443B;ANATOLIAN HIEROGLYPH A053;Lo;0;L;;;;;N;;;;;
+1443C;ANATOLIAN HIEROGLYPH A054;Lo;0;L;;;;;N;;;;;
+1443D;ANATOLIAN HIEROGLYPH A055;Lo;0;L;;;;;N;;;;;
+1443E;ANATOLIAN HIEROGLYPH A056;Lo;0;L;;;;;N;;;;;
+1443F;ANATOLIAN HIEROGLYPH A057;Lo;0;L;;;;;N;;;;;
+14440;ANATOLIAN HIEROGLYPH A058;Lo;0;L;;;;;N;;;;;
+14441;ANATOLIAN HIEROGLYPH A059;Lo;0;L;;;;;N;;;;;
+14442;ANATOLIAN HIEROGLYPH A060;Lo;0;L;;;;;N;;;;;
+14443;ANATOLIAN HIEROGLYPH A061;Lo;0;L;;;;;N;;;;;
+14444;ANATOLIAN HIEROGLYPH A062;Lo;0;L;;;;;N;;;;;
+14445;ANATOLIAN HIEROGLYPH A063;Lo;0;L;;;;;N;;;;;
+14446;ANATOLIAN HIEROGLYPH A064;Lo;0;L;;;;;N;;;;;
+14447;ANATOLIAN HIEROGLYPH A065;Lo;0;L;;;;;N;;;;;
+14448;ANATOLIAN HIEROGLYPH A066;Lo;0;L;;;;;N;;;;;
+14449;ANATOLIAN HIEROGLYPH A066A;Lo;0;L;;;;;N;;;;;
+1444A;ANATOLIAN HIEROGLYPH A066B;Lo;0;L;;;;;N;;;;;
+1444B;ANATOLIAN HIEROGLYPH A066C;Lo;0;L;;;;;N;;;;;
+1444C;ANATOLIAN HIEROGLYPH A067;Lo;0;L;;;;;N;;;;;
+1444D;ANATOLIAN HIEROGLYPH A068;Lo;0;L;;;;;N;;;;;
+1444E;ANATOLIAN HIEROGLYPH A069;Lo;0;L;;;;;N;;;;;
+1444F;ANATOLIAN HIEROGLYPH A070;Lo;0;L;;;;;N;;;;;
+14450;ANATOLIAN HIEROGLYPH A071;Lo;0;L;;;;;N;;;;;
+14451;ANATOLIAN HIEROGLYPH A072;Lo;0;L;;;;;N;;;;;
+14452;ANATOLIAN HIEROGLYPH A073;Lo;0;L;;;;;N;;;;;
+14453;ANATOLIAN HIEROGLYPH A074;Lo;0;L;;;;;N;;;;;
+14454;ANATOLIAN HIEROGLYPH A075;Lo;0;L;;;;;N;;;;;
+14455;ANATOLIAN HIEROGLYPH A076;Lo;0;L;;;;;N;;;;;
+14456;ANATOLIAN HIEROGLYPH A077;Lo;0;L;;;;;N;;;;;
+14457;ANATOLIAN HIEROGLYPH A078;Lo;0;L;;;;;N;;;;;
+14458;ANATOLIAN HIEROGLYPH A079;Lo;0;L;;;;;N;;;;;
+14459;ANATOLIAN HIEROGLYPH A080;Lo;0;L;;;;;N;;;;;
+1445A;ANATOLIAN HIEROGLYPH A081;Lo;0;L;;;;;N;;;;;
+1445B;ANATOLIAN HIEROGLYPH A082;Lo;0;L;;;;;N;;;;;
+1445C;ANATOLIAN HIEROGLYPH A083;Lo;0;L;;;;;N;;;;;
+1445D;ANATOLIAN HIEROGLYPH A084;Lo;0;L;;;;;N;;;;;
+1445E;ANATOLIAN HIEROGLYPH A085;Lo;0;L;;;;;N;;;;;
+1445F;ANATOLIAN HIEROGLYPH A086;Lo;0;L;;;;;N;;;;;
+14460;ANATOLIAN HIEROGLYPH A087;Lo;0;L;;;;;N;;;;;
+14461;ANATOLIAN HIEROGLYPH A088;Lo;0;L;;;;;N;;;;;
+14462;ANATOLIAN HIEROGLYPH A089;Lo;0;L;;;;;N;;;;;
+14463;ANATOLIAN HIEROGLYPH A090;Lo;0;L;;;;;N;;;;;
+14464;ANATOLIAN HIEROGLYPH A091;Lo;0;L;;;;;N;;;;;
+14465;ANATOLIAN HIEROGLYPH A092;Lo;0;L;;;;;N;;;;;
+14466;ANATOLIAN HIEROGLYPH A093;Lo;0;L;;;;;N;;;;;
+14467;ANATOLIAN HIEROGLYPH A094;Lo;0;L;;;;;N;;;;;
+14468;ANATOLIAN HIEROGLYPH A095;Lo;0;L;;;;;N;;;;;
+14469;ANATOLIAN HIEROGLYPH A096;Lo;0;L;;;;;N;;;;;
+1446A;ANATOLIAN HIEROGLYPH A097;Lo;0;L;;;;;N;;;;;
+1446B;ANATOLIAN HIEROGLYPH A097A;Lo;0;L;;;;;N;;;;;
+1446C;ANATOLIAN HIEROGLYPH A098;Lo;0;L;;;;;N;;;;;
+1446D;ANATOLIAN HIEROGLYPH A098A;Lo;0;L;;;;;N;;;;;
+1446E;ANATOLIAN HIEROGLYPH A099;Lo;0;L;;;;;N;;;;;
+1446F;ANATOLIAN HIEROGLYPH A100;Lo;0;L;;;;;N;;;;;
+14470;ANATOLIAN HIEROGLYPH A100A;Lo;0;L;;;;;N;;;;;
+14471;ANATOLIAN HIEROGLYPH A101;Lo;0;L;;;;;N;;;;;
+14472;ANATOLIAN HIEROGLYPH A101A;Lo;0;L;;;;;N;;;;;
+14473;ANATOLIAN HIEROGLYPH A102;Lo;0;L;;;;;N;;;;;
+14474;ANATOLIAN HIEROGLYPH A102A;Lo;0;L;;;;;N;;;;;
+14475;ANATOLIAN HIEROGLYPH A103;Lo;0;L;;;;;N;;;;;
+14476;ANATOLIAN HIEROGLYPH A104;Lo;0;L;;;;;N;;;;;
+14477;ANATOLIAN HIEROGLYPH A104A;Lo;0;L;;;;;N;;;;;
+14478;ANATOLIAN HIEROGLYPH A104B;Lo;0;L;;;;;N;;;;;
+14479;ANATOLIAN HIEROGLYPH A104C;Lo;0;L;;;;;N;;;;;
+1447A;ANATOLIAN HIEROGLYPH A105;Lo;0;L;;;;;N;;;;;
+1447B;ANATOLIAN HIEROGLYPH A105A;Lo;0;L;;;;;N;;;;;
+1447C;ANATOLIAN HIEROGLYPH A105B;Lo;0;L;;;;;N;;;;;
+1447D;ANATOLIAN HIEROGLYPH A106;Lo;0;L;;;;;N;;;;;
+1447E;ANATOLIAN HIEROGLYPH A107;Lo;0;L;;;;;N;;;;;
+1447F;ANATOLIAN HIEROGLYPH A107A;Lo;0;L;;;;;N;;;;;
+14480;ANATOLIAN HIEROGLYPH A107B;Lo;0;L;;;;;N;;;;;
+14481;ANATOLIAN HIEROGLYPH A107C;Lo;0;L;;;;;N;;;;;
+14482;ANATOLIAN HIEROGLYPH A108;Lo;0;L;;;;;N;;;;;
+14483;ANATOLIAN HIEROGLYPH A109;Lo;0;L;;;;;N;;;;;
+14484;ANATOLIAN HIEROGLYPH A110;Lo;0;L;;;;;N;;;;;
+14485;ANATOLIAN HIEROGLYPH A110A;Lo;0;L;;;;;N;;;;;
+14486;ANATOLIAN HIEROGLYPH A110B;Lo;0;L;;;;;N;;;;;
+14487;ANATOLIAN HIEROGLYPH A111;Lo;0;L;;;;;N;;;;;
+14488;ANATOLIAN HIEROGLYPH A112;Lo;0;L;;;;;N;;;;;
+14489;ANATOLIAN HIEROGLYPH A113;Lo;0;L;;;;;N;;;;;
+1448A;ANATOLIAN HIEROGLYPH A114;Lo;0;L;;;;;N;;;;;
+1448B;ANATOLIAN HIEROGLYPH A115;Lo;0;L;;;;;N;;;;;
+1448C;ANATOLIAN HIEROGLYPH A115A;Lo;0;L;;;;;N;;;;;
+1448D;ANATOLIAN HIEROGLYPH A116;Lo;0;L;;;;;N;;;;;
+1448E;ANATOLIAN HIEROGLYPH A117;Lo;0;L;;;;;N;;;;;
+1448F;ANATOLIAN HIEROGLYPH A118;Lo;0;L;;;;;N;;;;;
+14490;ANATOLIAN HIEROGLYPH A119;Lo;0;L;;;;;N;;;;;
+14491;ANATOLIAN HIEROGLYPH A120;Lo;0;L;;;;;N;;;;;
+14492;ANATOLIAN HIEROGLYPH A121;Lo;0;L;;;;;N;;;;;
+14493;ANATOLIAN HIEROGLYPH A122;Lo;0;L;;;;;N;;;;;
+14494;ANATOLIAN HIEROGLYPH A123;Lo;0;L;;;;;N;;;;;
+14495;ANATOLIAN HIEROGLYPH A124;Lo;0;L;;;;;N;;;;;
+14496;ANATOLIAN HIEROGLYPH A125;Lo;0;L;;;;;N;;;;;
+14497;ANATOLIAN HIEROGLYPH A125A;Lo;0;L;;;;;N;;;;;
+14498;ANATOLIAN HIEROGLYPH A126;Lo;0;L;;;;;N;;;;;
+14499;ANATOLIAN HIEROGLYPH A127;Lo;0;L;;;;;N;;;;;
+1449A;ANATOLIAN HIEROGLYPH A128;Lo;0;L;;;;;N;;;;;
+1449B;ANATOLIAN HIEROGLYPH A129;Lo;0;L;;;;;N;;;;;
+1449C;ANATOLIAN HIEROGLYPH A130;Lo;0;L;;;;;N;;;;;
+1449D;ANATOLIAN HIEROGLYPH A131;Lo;0;L;;;;;N;;;;;
+1449E;ANATOLIAN HIEROGLYPH A132;Lo;0;L;;;;;N;;;;;
+1449F;ANATOLIAN HIEROGLYPH A133;Lo;0;L;;;;;N;;;;;
+144A0;ANATOLIAN HIEROGLYPH A134;Lo;0;L;;;;;N;;;;;
+144A1;ANATOLIAN HIEROGLYPH A135;Lo;0;L;;;;;N;;;;;
+144A2;ANATOLIAN HIEROGLYPH A135A;Lo;0;L;;;;;N;;;;;
+144A3;ANATOLIAN HIEROGLYPH A136;Lo;0;L;;;;;N;;;;;
+144A4;ANATOLIAN HIEROGLYPH A137;Lo;0;L;;;;;N;;;;;
+144A5;ANATOLIAN HIEROGLYPH A138;Lo;0;L;;;;;N;;;;;
+144A6;ANATOLIAN HIEROGLYPH A139;Lo;0;L;;;;;N;;;;;
+144A7;ANATOLIAN HIEROGLYPH A140;Lo;0;L;;;;;N;;;;;
+144A8;ANATOLIAN HIEROGLYPH A141;Lo;0;L;;;;;N;;;;;
+144A9;ANATOLIAN HIEROGLYPH A142;Lo;0;L;;;;;N;;;;;
+144AA;ANATOLIAN HIEROGLYPH A143;Lo;0;L;;;;;N;;;;;
+144AB;ANATOLIAN HIEROGLYPH A144;Lo;0;L;;;;;N;;;;;
+144AC;ANATOLIAN HIEROGLYPH A145;Lo;0;L;;;;;N;;;;;
+144AD;ANATOLIAN HIEROGLYPH A146;Lo;0;L;;;;;N;;;;;
+144AE;ANATOLIAN HIEROGLYPH A147;Lo;0;L;;;;;N;;;;;
+144AF;ANATOLIAN HIEROGLYPH A148;Lo;0;L;;;;;N;;;;;
+144B0;ANATOLIAN HIEROGLYPH A149;Lo;0;L;;;;;N;;;;;
+144B1;ANATOLIAN HIEROGLYPH A150;Lo;0;L;;;;;N;;;;;
+144B2;ANATOLIAN HIEROGLYPH A151;Lo;0;L;;;;;N;;;;;
+144B3;ANATOLIAN HIEROGLYPH A152;Lo;0;L;;;;;N;;;;;
+144B4;ANATOLIAN HIEROGLYPH A153;Lo;0;L;;;;;N;;;;;
+144B5;ANATOLIAN HIEROGLYPH A154;Lo;0;L;;;;;N;;;;;
+144B6;ANATOLIAN HIEROGLYPH A155;Lo;0;L;;;;;N;;;;;
+144B7;ANATOLIAN HIEROGLYPH A156;Lo;0;L;;;;;N;;;;;
+144B8;ANATOLIAN HIEROGLYPH A157;Lo;0;L;;;;;N;;;;;
+144B9;ANATOLIAN HIEROGLYPH A158;Lo;0;L;;;;;N;;;;;
+144BA;ANATOLIAN HIEROGLYPH A159;Lo;0;L;;;;;N;;;;;
+144BB;ANATOLIAN HIEROGLYPH A160;Lo;0;L;;;;;N;;;;;
+144BC;ANATOLIAN HIEROGLYPH A161;Lo;0;L;;;;;N;;;;;
+144BD;ANATOLIAN HIEROGLYPH A162;Lo;0;L;;;;;N;;;;;
+144BE;ANATOLIAN HIEROGLYPH A163;Lo;0;L;;;;;N;;;;;
+144BF;ANATOLIAN HIEROGLYPH A164;Lo;0;L;;;;;N;;;;;
+144C0;ANATOLIAN HIEROGLYPH A165;Lo;0;L;;;;;N;;;;;
+144C1;ANATOLIAN HIEROGLYPH A166;Lo;0;L;;;;;N;;;;;
+144C2;ANATOLIAN HIEROGLYPH A167;Lo;0;L;;;;;N;;;;;
+144C3;ANATOLIAN HIEROGLYPH A168;Lo;0;L;;;;;N;;;;;
+144C4;ANATOLIAN HIEROGLYPH A169;Lo;0;L;;;;;N;;;;;
+144C5;ANATOLIAN HIEROGLYPH A170;Lo;0;L;;;;;N;;;;;
+144C6;ANATOLIAN HIEROGLYPH A171;Lo;0;L;;;;;N;;;;;
+144C7;ANATOLIAN HIEROGLYPH A172;Lo;0;L;;;;;N;;;;;
+144C8;ANATOLIAN HIEROGLYPH A173;Lo;0;L;;;;;N;;;;;
+144C9;ANATOLIAN HIEROGLYPH A174;Lo;0;L;;;;;N;;;;;
+144CA;ANATOLIAN HIEROGLYPH A175;Lo;0;L;;;;;N;;;;;
+144CB;ANATOLIAN HIEROGLYPH A176;Lo;0;L;;;;;N;;;;;
+144CC;ANATOLIAN HIEROGLYPH A177;Lo;0;L;;;;;N;;;;;
+144CD;ANATOLIAN HIEROGLYPH A178;Lo;0;L;;;;;N;;;;;
+144CE;ANATOLIAN HIEROGLYPH A179;Lo;0;L;;;;;N;;;;;
+144CF;ANATOLIAN HIEROGLYPH A180;Lo;0;L;;;;;N;;;;;
+144D0;ANATOLIAN HIEROGLYPH A181;Lo;0;L;;;;;N;;;;;
+144D1;ANATOLIAN HIEROGLYPH A182;Lo;0;L;;;;;N;;;;;
+144D2;ANATOLIAN HIEROGLYPH A183;Lo;0;L;;;;;N;;;;;
+144D3;ANATOLIAN HIEROGLYPH A184;Lo;0;L;;;;;N;;;;;
+144D4;ANATOLIAN HIEROGLYPH A185;Lo;0;L;;;;;N;;;;;
+144D5;ANATOLIAN HIEROGLYPH A186;Lo;0;L;;;;;N;;;;;
+144D6;ANATOLIAN HIEROGLYPH A187;Lo;0;L;;;;;N;;;;;
+144D7;ANATOLIAN HIEROGLYPH A188;Lo;0;L;;;;;N;;;;;
+144D8;ANATOLIAN HIEROGLYPH A189;Lo;0;L;;;;;N;;;;;
+144D9;ANATOLIAN HIEROGLYPH A190;Lo;0;L;;;;;N;;;;;
+144DA;ANATOLIAN HIEROGLYPH A191;Lo;0;L;;;;;N;;;;;
+144DB;ANATOLIAN HIEROGLYPH A192;Lo;0;L;;;;;N;;;;;
+144DC;ANATOLIAN HIEROGLYPH A193;Lo;0;L;;;;;N;;;;;
+144DD;ANATOLIAN HIEROGLYPH A194;Lo;0;L;;;;;N;;;;;
+144DE;ANATOLIAN HIEROGLYPH A195;Lo;0;L;;;;;N;;;;;
+144DF;ANATOLIAN HIEROGLYPH A196;Lo;0;L;;;;;N;;;;;
+144E0;ANATOLIAN HIEROGLYPH A197;Lo;0;L;;;;;N;;;;;
+144E1;ANATOLIAN HIEROGLYPH A198;Lo;0;L;;;;;N;;;;;
+144E2;ANATOLIAN HIEROGLYPH A199;Lo;0;L;;;;;N;;;;;
+144E3;ANATOLIAN HIEROGLYPH A200;Lo;0;L;;;;;N;;;;;
+144E4;ANATOLIAN HIEROGLYPH A201;Lo;0;L;;;;;N;;;;;
+144E5;ANATOLIAN HIEROGLYPH A202;Lo;0;L;;;;;N;;;;;
+144E6;ANATOLIAN HIEROGLYPH A202A;Lo;0;L;;;;;N;;;;;
+144E7;ANATOLIAN HIEROGLYPH A202B;Lo;0;L;;;;;N;;;;;
+144E8;ANATOLIAN HIEROGLYPH A203;Lo;0;L;;;;;N;;;;;
+144E9;ANATOLIAN HIEROGLYPH A204;Lo;0;L;;;;;N;;;;;
+144EA;ANATOLIAN HIEROGLYPH A205;Lo;0;L;;;;;N;;;;;
+144EB;ANATOLIAN HIEROGLYPH A206;Lo;0;L;;;;;N;;;;;
+144EC;ANATOLIAN HIEROGLYPH A207;Lo;0;L;;;;;N;;;;;
+144ED;ANATOLIAN HIEROGLYPH A207A;Lo;0;L;;;;;N;;;;;
+144EE;ANATOLIAN HIEROGLYPH A208;Lo;0;L;;;;;N;;;;;
+144EF;ANATOLIAN HIEROGLYPH A209;Lo;0;L;;;;;N;;;;;
+144F0;ANATOLIAN HIEROGLYPH A209A;Lo;0;L;;;;;N;;;;;
+144F1;ANATOLIAN HIEROGLYPH A210;Lo;0;L;;;;;N;;;;;
+144F2;ANATOLIAN HIEROGLYPH A211;Lo;0;L;;;;;N;;;;;
+144F3;ANATOLIAN HIEROGLYPH A212;Lo;0;L;;;;;N;;;;;
+144F4;ANATOLIAN HIEROGLYPH A213;Lo;0;L;;;;;N;;;;;
+144F5;ANATOLIAN HIEROGLYPH A214;Lo;0;L;;;;;N;;;;;
+144F6;ANATOLIAN HIEROGLYPH A215;Lo;0;L;;;;;N;;;;;
+144F7;ANATOLIAN HIEROGLYPH A215A;Lo;0;L;;;;;N;;;;;
+144F8;ANATOLIAN HIEROGLYPH A216;Lo;0;L;;;;;N;;;;;
+144F9;ANATOLIAN HIEROGLYPH A216A;Lo;0;L;;;;;N;;;;;
+144FA;ANATOLIAN HIEROGLYPH A217;Lo;0;L;;;;;N;;;;;
+144FB;ANATOLIAN HIEROGLYPH A218;Lo;0;L;;;;;N;;;;;
+144FC;ANATOLIAN HIEROGLYPH A219;Lo;0;L;;;;;N;;;;;
+144FD;ANATOLIAN HIEROGLYPH A220;Lo;0;L;;;;;N;;;;;
+144FE;ANATOLIAN HIEROGLYPH A221;Lo;0;L;;;;;N;;;;;
+144FF;ANATOLIAN HIEROGLYPH A222;Lo;0;L;;;;;N;;;;;
+14500;ANATOLIAN HIEROGLYPH A223;Lo;0;L;;;;;N;;;;;
+14501;ANATOLIAN HIEROGLYPH A224;Lo;0;L;;;;;N;;;;;
+14502;ANATOLIAN HIEROGLYPH A225;Lo;0;L;;;;;N;;;;;
+14503;ANATOLIAN HIEROGLYPH A226;Lo;0;L;;;;;N;;;;;
+14504;ANATOLIAN HIEROGLYPH A227;Lo;0;L;;;;;N;;;;;
+14505;ANATOLIAN HIEROGLYPH A227A;Lo;0;L;;;;;N;;;;;
+14506;ANATOLIAN HIEROGLYPH A228;Lo;0;L;;;;;N;;;;;
+14507;ANATOLIAN HIEROGLYPH A229;Lo;0;L;;;;;N;;;;;
+14508;ANATOLIAN HIEROGLYPH A230;Lo;0;L;;;;;N;;;;;
+14509;ANATOLIAN HIEROGLYPH A231;Lo;0;L;;;;;N;;;;;
+1450A;ANATOLIAN HIEROGLYPH A232;Lo;0;L;;;;;N;;;;;
+1450B;ANATOLIAN HIEROGLYPH A233;Lo;0;L;;;;;N;;;;;
+1450C;ANATOLIAN HIEROGLYPH A234;Lo;0;L;;;;;N;;;;;
+1450D;ANATOLIAN HIEROGLYPH A235;Lo;0;L;;;;;N;;;;;
+1450E;ANATOLIAN HIEROGLYPH A236;Lo;0;L;;;;;N;;;;;
+1450F;ANATOLIAN HIEROGLYPH A237;Lo;0;L;;;;;N;;;;;
+14510;ANATOLIAN HIEROGLYPH A238;Lo;0;L;;;;;N;;;;;
+14511;ANATOLIAN HIEROGLYPH A239;Lo;0;L;;;;;N;;;;;
+14512;ANATOLIAN HIEROGLYPH A240;Lo;0;L;;;;;N;;;;;
+14513;ANATOLIAN HIEROGLYPH A241;Lo;0;L;;;;;N;;;;;
+14514;ANATOLIAN HIEROGLYPH A242;Lo;0;L;;;;;N;;;;;
+14515;ANATOLIAN HIEROGLYPH A243;Lo;0;L;;;;;N;;;;;
+14516;ANATOLIAN HIEROGLYPH A244;Lo;0;L;;;;;N;;;;;
+14517;ANATOLIAN HIEROGLYPH A245;Lo;0;L;;;;;N;;;;;
+14518;ANATOLIAN HIEROGLYPH A246;Lo;0;L;;;;;N;;;;;
+14519;ANATOLIAN HIEROGLYPH A247;Lo;0;L;;;;;N;;;;;
+1451A;ANATOLIAN HIEROGLYPH A248;Lo;0;L;;;;;N;;;;;
+1451B;ANATOLIAN HIEROGLYPH A249;Lo;0;L;;;;;N;;;;;
+1451C;ANATOLIAN HIEROGLYPH A250;Lo;0;L;;;;;N;;;;;
+1451D;ANATOLIAN HIEROGLYPH A251;Lo;0;L;;;;;N;;;;;
+1451E;ANATOLIAN HIEROGLYPH A252;Lo;0;L;;;;;N;;;;;
+1451F;ANATOLIAN HIEROGLYPH A253;Lo;0;L;;;;;N;;;;;
+14520;ANATOLIAN HIEROGLYPH A254;Lo;0;L;;;;;N;;;;;
+14521;ANATOLIAN HIEROGLYPH A255;Lo;0;L;;;;;N;;;;;
+14522;ANATOLIAN HIEROGLYPH A256;Lo;0;L;;;;;N;;;;;
+14523;ANATOLIAN HIEROGLYPH A257;Lo;0;L;;;;;N;;;;;
+14524;ANATOLIAN HIEROGLYPH A258;Lo;0;L;;;;;N;;;;;
+14525;ANATOLIAN HIEROGLYPH A259;Lo;0;L;;;;;N;;;;;
+14526;ANATOLIAN HIEROGLYPH A260;Lo;0;L;;;;;N;;;;;
+14527;ANATOLIAN HIEROGLYPH A261;Lo;0;L;;;;;N;;;;;
+14528;ANATOLIAN HIEROGLYPH A262;Lo;0;L;;;;;N;;;;;
+14529;ANATOLIAN HIEROGLYPH A263;Lo;0;L;;;;;N;;;;;
+1452A;ANATOLIAN HIEROGLYPH A264;Lo;0;L;;;;;N;;;;;
+1452B;ANATOLIAN HIEROGLYPH A265;Lo;0;L;;;;;N;;;;;
+1452C;ANATOLIAN HIEROGLYPH A266;Lo;0;L;;;;;N;;;;;
+1452D;ANATOLIAN HIEROGLYPH A267;Lo;0;L;;;;;N;;;;;
+1452E;ANATOLIAN HIEROGLYPH A267A;Lo;0;L;;;;;N;;;;;
+1452F;ANATOLIAN HIEROGLYPH A268;Lo;0;L;;;;;N;;;;;
+14530;ANATOLIAN HIEROGLYPH A269;Lo;0;L;;;;;N;;;;;
+14531;ANATOLIAN HIEROGLYPH A270;Lo;0;L;;;;;N;;;;;
+14532;ANATOLIAN HIEROGLYPH A271;Lo;0;L;;;;;N;;;;;
+14533;ANATOLIAN HIEROGLYPH A272;Lo;0;L;;;;;N;;;;;
+14534;ANATOLIAN HIEROGLYPH A273;Lo;0;L;;;;;N;;;;;
+14535;ANATOLIAN HIEROGLYPH A274;Lo;0;L;;;;;N;;;;;
+14536;ANATOLIAN HIEROGLYPH A275;Lo;0;L;;;;;N;;;;;
+14537;ANATOLIAN HIEROGLYPH A276;Lo;0;L;;;;;N;;;;;
+14538;ANATOLIAN HIEROGLYPH A277;Lo;0;L;;;;;N;;;;;
+14539;ANATOLIAN HIEROGLYPH A278;Lo;0;L;;;;;N;;;;;
+1453A;ANATOLIAN HIEROGLYPH A279;Lo;0;L;;;;;N;;;;;
+1453B;ANATOLIAN HIEROGLYPH A280;Lo;0;L;;;;;N;;;;;
+1453C;ANATOLIAN HIEROGLYPH A281;Lo;0;L;;;;;N;;;;;
+1453D;ANATOLIAN HIEROGLYPH A282;Lo;0;L;;;;;N;;;;;
+1453E;ANATOLIAN HIEROGLYPH A283;Lo;0;L;;;;;N;;;;;
+1453F;ANATOLIAN HIEROGLYPH A284;Lo;0;L;;;;;N;;;;;
+14540;ANATOLIAN HIEROGLYPH A285;Lo;0;L;;;;;N;;;;;
+14541;ANATOLIAN HIEROGLYPH A286;Lo;0;L;;;;;N;;;;;
+14542;ANATOLIAN HIEROGLYPH A287;Lo;0;L;;;;;N;;;;;
+14543;ANATOLIAN HIEROGLYPH A288;Lo;0;L;;;;;N;;;;;
+14544;ANATOLIAN HIEROGLYPH A289;Lo;0;L;;;;;N;;;;;
+14545;ANATOLIAN HIEROGLYPH A289A;Lo;0;L;;;;;N;;;;;
+14546;ANATOLIAN HIEROGLYPH A290;Lo;0;L;;;;;N;;;;;
+14547;ANATOLIAN HIEROGLYPH A291;Lo;0;L;;;;;N;;;;;
+14548;ANATOLIAN HIEROGLYPH A292;Lo;0;L;;;;;N;;;;;
+14549;ANATOLIAN HIEROGLYPH A293;Lo;0;L;;;;;N;;;;;
+1454A;ANATOLIAN HIEROGLYPH A294;Lo;0;L;;;;;N;;;;;
+1454B;ANATOLIAN HIEROGLYPH A294A;Lo;0;L;;;;;N;;;;;
+1454C;ANATOLIAN HIEROGLYPH A295;Lo;0;L;;;;;N;;;;;
+1454D;ANATOLIAN HIEROGLYPH A296;Lo;0;L;;;;;N;;;;;
+1454E;ANATOLIAN HIEROGLYPH A297;Lo;0;L;;;;;N;;;;;
+1454F;ANATOLIAN HIEROGLYPH A298;Lo;0;L;;;;;N;;;;;
+14550;ANATOLIAN HIEROGLYPH A299;Lo;0;L;;;;;N;;;;;
+14551;ANATOLIAN HIEROGLYPH A299A;Lo;0;L;;;;;N;;;;;
+14552;ANATOLIAN HIEROGLYPH A300;Lo;0;L;;;;;N;;;;;
+14553;ANATOLIAN HIEROGLYPH A301;Lo;0;L;;;;;N;;;;;
+14554;ANATOLIAN HIEROGLYPH A302;Lo;0;L;;;;;N;;;;;
+14555;ANATOLIAN HIEROGLYPH A303;Lo;0;L;;;;;N;;;;;
+14556;ANATOLIAN HIEROGLYPH A304;Lo;0;L;;;;;N;;;;;
+14557;ANATOLIAN HIEROGLYPH A305;Lo;0;L;;;;;N;;;;;
+14558;ANATOLIAN HIEROGLYPH A306;Lo;0;L;;;;;N;;;;;
+14559;ANATOLIAN HIEROGLYPH A307;Lo;0;L;;;;;N;;;;;
+1455A;ANATOLIAN HIEROGLYPH A308;Lo;0;L;;;;;N;;;;;
+1455B;ANATOLIAN HIEROGLYPH A309;Lo;0;L;;;;;N;;;;;
+1455C;ANATOLIAN HIEROGLYPH A309A;Lo;0;L;;;;;N;;;;;
+1455D;ANATOLIAN HIEROGLYPH A310;Lo;0;L;;;;;N;;;;;
+1455E;ANATOLIAN HIEROGLYPH A311;Lo;0;L;;;;;N;;;;;
+1455F;ANATOLIAN HIEROGLYPH A312;Lo;0;L;;;;;N;;;;;
+14560;ANATOLIAN HIEROGLYPH A313;Lo;0;L;;;;;N;;;;;
+14561;ANATOLIAN HIEROGLYPH A314;Lo;0;L;;;;;N;;;;;
+14562;ANATOLIAN HIEROGLYPH A315;Lo;0;L;;;;;N;;;;;
+14563;ANATOLIAN HIEROGLYPH A316;Lo;0;L;;;;;N;;;;;
+14564;ANATOLIAN HIEROGLYPH A317;Lo;0;L;;;;;N;;;;;
+14565;ANATOLIAN HIEROGLYPH A318;Lo;0;L;;;;;N;;;;;
+14566;ANATOLIAN HIEROGLYPH A319;Lo;0;L;;;;;N;;;;;
+14567;ANATOLIAN HIEROGLYPH A320;Lo;0;L;;;;;N;;;;;
+14568;ANATOLIAN HIEROGLYPH A321;Lo;0;L;;;;;N;;;;;
+14569;ANATOLIAN HIEROGLYPH A322;Lo;0;L;;;;;N;;;;;
+1456A;ANATOLIAN HIEROGLYPH A323;Lo;0;L;;;;;N;;;;;
+1456B;ANATOLIAN HIEROGLYPH A324;Lo;0;L;;;;;N;;;;;
+1456C;ANATOLIAN HIEROGLYPH A325;Lo;0;L;;;;;N;;;;;
+1456D;ANATOLIAN HIEROGLYPH A326;Lo;0;L;;;;;N;;;;;
+1456E;ANATOLIAN HIEROGLYPH A327;Lo;0;L;;;;;N;;;;;
+1456F;ANATOLIAN HIEROGLYPH A328;Lo;0;L;;;;;N;;;;;
+14570;ANATOLIAN HIEROGLYPH A329;Lo;0;L;;;;;N;;;;;
+14571;ANATOLIAN HIEROGLYPH A329A;Lo;0;L;;;;;N;;;;;
+14572;ANATOLIAN HIEROGLYPH A330;Lo;0;L;;;;;N;;;;;
+14573;ANATOLIAN HIEROGLYPH A331;Lo;0;L;;;;;N;;;;;
+14574;ANATOLIAN HIEROGLYPH A332A;Lo;0;L;;;;;N;;;;;
+14575;ANATOLIAN HIEROGLYPH A332B;Lo;0;L;;;;;N;;;;;
+14576;ANATOLIAN HIEROGLYPH A332C;Lo;0;L;;;;;N;;;;;
+14577;ANATOLIAN HIEROGLYPH A333;Lo;0;L;;;;;N;;;;;
+14578;ANATOLIAN HIEROGLYPH A334;Lo;0;L;;;;;N;;;;;
+14579;ANATOLIAN HIEROGLYPH A335;Lo;0;L;;;;;N;;;;;
+1457A;ANATOLIAN HIEROGLYPH A336;Lo;0;L;;;;;N;;;;;
+1457B;ANATOLIAN HIEROGLYPH A336A;Lo;0;L;;;;;N;;;;;
+1457C;ANATOLIAN HIEROGLYPH A336B;Lo;0;L;;;;;N;;;;;
+1457D;ANATOLIAN HIEROGLYPH A336C;Lo;0;L;;;;;N;;;;;
+1457E;ANATOLIAN HIEROGLYPH A337;Lo;0;L;;;;;N;;;;;
+1457F;ANATOLIAN HIEROGLYPH A338;Lo;0;L;;;;;N;;;;;
+14580;ANATOLIAN HIEROGLYPH A339;Lo;0;L;;;;;N;;;;;
+14581;ANATOLIAN HIEROGLYPH A340;Lo;0;L;;;;;N;;;;;
+14582;ANATOLIAN HIEROGLYPH A341;Lo;0;L;;;;;N;;;;;
+14583;ANATOLIAN HIEROGLYPH A342;Lo;0;L;;;;;N;;;;;
+14584;ANATOLIAN HIEROGLYPH A343;Lo;0;L;;;;;N;;;;;
+14585;ANATOLIAN HIEROGLYPH A344;Lo;0;L;;;;;N;;;;;
+14586;ANATOLIAN HIEROGLYPH A345;Lo;0;L;;;;;N;;;;;
+14587;ANATOLIAN HIEROGLYPH A346;Lo;0;L;;;;;N;;;;;
+14588;ANATOLIAN HIEROGLYPH A347;Lo;0;L;;;;;N;;;;;
+14589;ANATOLIAN HIEROGLYPH A348;Lo;0;L;;;;;N;;;;;
+1458A;ANATOLIAN HIEROGLYPH A349;Lo;0;L;;;;;N;;;;;
+1458B;ANATOLIAN HIEROGLYPH A350;Lo;0;L;;;;;N;;;;;
+1458C;ANATOLIAN HIEROGLYPH A351;Lo;0;L;;;;;N;;;;;
+1458D;ANATOLIAN HIEROGLYPH A352;Lo;0;L;;;;;N;;;;;
+1458E;ANATOLIAN HIEROGLYPH A353;Lo;0;L;;;;;N;;;;;
+1458F;ANATOLIAN HIEROGLYPH A354;Lo;0;L;;;;;N;;;;;
+14590;ANATOLIAN HIEROGLYPH A355;Lo;0;L;;;;;N;;;;;
+14591;ANATOLIAN HIEROGLYPH A356;Lo;0;L;;;;;N;;;;;
+14592;ANATOLIAN HIEROGLYPH A357;Lo;0;L;;;;;N;;;;;
+14593;ANATOLIAN HIEROGLYPH A358;Lo;0;L;;;;;N;;;;;
+14594;ANATOLIAN HIEROGLYPH A359;Lo;0;L;;;;;N;;;;;
+14595;ANATOLIAN HIEROGLYPH A359A;Lo;0;L;;;;;N;;;;;
+14596;ANATOLIAN HIEROGLYPH A360;Lo;0;L;;;;;N;;;;;
+14597;ANATOLIAN HIEROGLYPH A361;Lo;0;L;;;;;N;;;;;
+14598;ANATOLIAN HIEROGLYPH A362;Lo;0;L;;;;;N;;;;;
+14599;ANATOLIAN HIEROGLYPH A363;Lo;0;L;;;;;N;;;;;
+1459A;ANATOLIAN HIEROGLYPH A364;Lo;0;L;;;;;N;;;;;
+1459B;ANATOLIAN HIEROGLYPH A364A;Lo;0;L;;;;;N;;;;;
+1459C;ANATOLIAN HIEROGLYPH A365;Lo;0;L;;;;;N;;;;;
+1459D;ANATOLIAN HIEROGLYPH A366;Lo;0;L;;;;;N;;;;;
+1459E;ANATOLIAN HIEROGLYPH A367;Lo;0;L;;;;;N;;;;;
+1459F;ANATOLIAN HIEROGLYPH A368;Lo;0;L;;;;;N;;;;;
+145A0;ANATOLIAN HIEROGLYPH A368A;Lo;0;L;;;;;N;;;;;
+145A1;ANATOLIAN HIEROGLYPH A369;Lo;0;L;;;;;N;;;;;
+145A2;ANATOLIAN HIEROGLYPH A370;Lo;0;L;;;;;N;;;;;
+145A3;ANATOLIAN HIEROGLYPH A371;Lo;0;L;;;;;N;;;;;
+145A4;ANATOLIAN HIEROGLYPH A371A;Lo;0;L;;;;;N;;;;;
+145A5;ANATOLIAN HIEROGLYPH A372;Lo;0;L;;;;;N;;;;;
+145A6;ANATOLIAN HIEROGLYPH A373;Lo;0;L;;;;;N;;;;;
+145A7;ANATOLIAN HIEROGLYPH A374;Lo;0;L;;;;;N;;;;;
+145A8;ANATOLIAN HIEROGLYPH A375;Lo;0;L;;;;;N;;;;;
+145A9;ANATOLIAN HIEROGLYPH A376;Lo;0;L;;;;;N;;;;;
+145AA;ANATOLIAN HIEROGLYPH A377;Lo;0;L;;;;;N;;;;;
+145AB;ANATOLIAN HIEROGLYPH A378;Lo;0;L;;;;;N;;;;;
+145AC;ANATOLIAN HIEROGLYPH A379;Lo;0;L;;;;;N;;;;;
+145AD;ANATOLIAN HIEROGLYPH A380;Lo;0;L;;;;;N;;;;;
+145AE;ANATOLIAN HIEROGLYPH A381;Lo;0;L;;;;;N;;;;;
+145AF;ANATOLIAN HIEROGLYPH A381A;Lo;0;L;;;;;N;;;;;
+145B0;ANATOLIAN HIEROGLYPH A382;Lo;0;L;;;;;N;;;;;
+145B1;ANATOLIAN HIEROGLYPH A383 RA OR RI;Lo;0;L;;;;;N;;;;;
+145B2;ANATOLIAN HIEROGLYPH A383A;Lo;0;L;;;;;N;;;;;
+145B3;ANATOLIAN HIEROGLYPH A384;Lo;0;L;;;;;N;;;;;
+145B4;ANATOLIAN HIEROGLYPH A385;Lo;0;L;;;;;N;;;;;
+145B5;ANATOLIAN HIEROGLYPH A386;Lo;0;L;;;;;N;;;;;
+145B6;ANATOLIAN HIEROGLYPH A386A;Lo;0;L;;;;;N;;;;;
+145B7;ANATOLIAN HIEROGLYPH A387;Lo;0;L;;;;;N;;;;;
+145B8;ANATOLIAN HIEROGLYPH A388;Lo;0;L;;;;;N;;;;;
+145B9;ANATOLIAN HIEROGLYPH A389;Lo;0;L;;;;;N;;;;;
+145BA;ANATOLIAN HIEROGLYPH A390;Lo;0;L;;;;;N;;;;;
+145BB;ANATOLIAN HIEROGLYPH A391;Lo;0;L;;;;;N;;;;;
+145BC;ANATOLIAN HIEROGLYPH A392;Lo;0;L;;;;;N;;;;;
+145BD;ANATOLIAN HIEROGLYPH A393 EIGHT;Lo;0;L;;;;;N;;;;;
+145BE;ANATOLIAN HIEROGLYPH A394;Lo;0;L;;;;;N;;;;;
+145BF;ANATOLIAN HIEROGLYPH A395;Lo;0;L;;;;;N;;;;;
+145C0;ANATOLIAN HIEROGLYPH A396;Lo;0;L;;;;;N;;;;;
+145C1;ANATOLIAN HIEROGLYPH A397;Lo;0;L;;;;;N;;;;;
+145C2;ANATOLIAN HIEROGLYPH A398;Lo;0;L;;;;;N;;;;;
+145C3;ANATOLIAN HIEROGLYPH A399;Lo;0;L;;;;;N;;;;;
+145C4;ANATOLIAN HIEROGLYPH A400;Lo;0;L;;;;;N;;;;;
+145C5;ANATOLIAN HIEROGLYPH A401;Lo;0;L;;;;;N;;;;;
+145C6;ANATOLIAN HIEROGLYPH A402;Lo;0;L;;;;;N;;;;;
+145C7;ANATOLIAN HIEROGLYPH A403;Lo;0;L;;;;;N;;;;;
+145C8;ANATOLIAN HIEROGLYPH A404;Lo;0;L;;;;;N;;;;;
+145C9;ANATOLIAN HIEROGLYPH A405;Lo;0;L;;;;;N;;;;;
+145CA;ANATOLIAN HIEROGLYPH A406;Lo;0;L;;;;;N;;;;;
+145CB;ANATOLIAN HIEROGLYPH A407;Lo;0;L;;;;;N;;;;;
+145CC;ANATOLIAN HIEROGLYPH A408;Lo;0;L;;;;;N;;;;;
+145CD;ANATOLIAN HIEROGLYPH A409;Lo;0;L;;;;;N;;;;;
+145CE;ANATOLIAN HIEROGLYPH A410 BEGIN LOGOGRAM MARK;Lo;0;L;;;;;N;;;;;
+145CF;ANATOLIAN HIEROGLYPH A410A END LOGOGRAM MARK;Lo;0;L;;;;;N;;;;;
+145D0;ANATOLIAN HIEROGLYPH A411;Lo;0;L;;;;;N;;;;;
+145D1;ANATOLIAN HIEROGLYPH A412;Lo;0;L;;;;;N;;;;;
+145D2;ANATOLIAN HIEROGLYPH A413;Lo;0;L;;;;;N;;;;;
+145D3;ANATOLIAN HIEROGLYPH A414;Lo;0;L;;;;;N;;;;;
+145D4;ANATOLIAN HIEROGLYPH A415;Lo;0;L;;;;;N;;;;;
+145D5;ANATOLIAN HIEROGLYPH A416;Lo;0;L;;;;;N;;;;;
+145D6;ANATOLIAN HIEROGLYPH A417;Lo;0;L;;;;;N;;;;;
+145D7;ANATOLIAN HIEROGLYPH A418;Lo;0;L;;;;;N;;;;;
+145D8;ANATOLIAN HIEROGLYPH A419;Lo;0;L;;;;;N;;;;;
+145D9;ANATOLIAN HIEROGLYPH A420;Lo;0;L;;;;;N;;;;;
+145DA;ANATOLIAN HIEROGLYPH A421;Lo;0;L;;;;;N;;;;;
+145DB;ANATOLIAN HIEROGLYPH A422;Lo;0;L;;;;;N;;;;;
+145DC;ANATOLIAN HIEROGLYPH A423;Lo;0;L;;;;;N;;;;;
+145DD;ANATOLIAN HIEROGLYPH A424;Lo;0;L;;;;;N;;;;;
+145DE;ANATOLIAN HIEROGLYPH A425;Lo;0;L;;;;;N;;;;;
+145DF;ANATOLIAN HIEROGLYPH A426;Lo;0;L;;;;;N;;;;;
+145E0;ANATOLIAN HIEROGLYPH A427;Lo;0;L;;;;;N;;;;;
+145E1;ANATOLIAN HIEROGLYPH A428;Lo;0;L;;;;;N;;;;;
+145E2;ANATOLIAN HIEROGLYPH A429;Lo;0;L;;;;;N;;;;;
+145E3;ANATOLIAN HIEROGLYPH A430;Lo;0;L;;;;;N;;;;;
+145E4;ANATOLIAN HIEROGLYPH A431;Lo;0;L;;;;;N;;;;;
+145E5;ANATOLIAN HIEROGLYPH A432;Lo;0;L;;;;;N;;;;;
+145E6;ANATOLIAN HIEROGLYPH A433;Lo;0;L;;;;;N;;;;;
+145E7;ANATOLIAN HIEROGLYPH A434;Lo;0;L;;;;;N;;;;;
+145E8;ANATOLIAN HIEROGLYPH A435;Lo;0;L;;;;;N;;;;;
+145E9;ANATOLIAN HIEROGLYPH A436;Lo;0;L;;;;;N;;;;;
+145EA;ANATOLIAN HIEROGLYPH A437;Lo;0;L;;;;;N;;;;;
+145EB;ANATOLIAN HIEROGLYPH A438;Lo;0;L;;;;;N;;;;;
+145EC;ANATOLIAN HIEROGLYPH A439;Lo;0;L;;;;;N;;;;;
+145ED;ANATOLIAN HIEROGLYPH A440;Lo;0;L;;;;;N;;;;;
+145EE;ANATOLIAN HIEROGLYPH A441;Lo;0;L;;;;;N;;;;;
+145EF;ANATOLIAN HIEROGLYPH A442;Lo;0;L;;;;;N;;;;;
+145F0;ANATOLIAN HIEROGLYPH A443;Lo;0;L;;;;;N;;;;;
+145F1;ANATOLIAN HIEROGLYPH A444;Lo;0;L;;;;;N;;;;;
+145F2;ANATOLIAN HIEROGLYPH A445;Lo;0;L;;;;;N;;;;;
+145F3;ANATOLIAN HIEROGLYPH A446;Lo;0;L;;;;;N;;;;;
+145F4;ANATOLIAN HIEROGLYPH A447;Lo;0;L;;;;;N;;;;;
+145F5;ANATOLIAN HIEROGLYPH A448;Lo;0;L;;;;;N;;;;;
+145F6;ANATOLIAN HIEROGLYPH A449;Lo;0;L;;;;;N;;;;;
+145F7;ANATOLIAN HIEROGLYPH A450;Lo;0;L;;;;;N;;;;;
+145F8;ANATOLIAN HIEROGLYPH A450A;Lo;0;L;;;;;N;;;;;
+145F9;ANATOLIAN HIEROGLYPH A451;Lo;0;L;;;;;N;;;;;
+145FA;ANATOLIAN HIEROGLYPH A452;Lo;0;L;;;;;N;;;;;
+145FB;ANATOLIAN HIEROGLYPH A453;Lo;0;L;;;;;N;;;;;
+145FC;ANATOLIAN HIEROGLYPH A454;Lo;0;L;;;;;N;;;;;
+145FD;ANATOLIAN HIEROGLYPH A455;Lo;0;L;;;;;N;;;;;
+145FE;ANATOLIAN HIEROGLYPH A456;Lo;0;L;;;;;N;;;;;
+145FF;ANATOLIAN HIEROGLYPH A457;Lo;0;L;;;;;N;;;;;
+14600;ANATOLIAN HIEROGLYPH A457A;Lo;0;L;;;;;N;;;;;
+14601;ANATOLIAN HIEROGLYPH A458;Lo;0;L;;;;;N;;;;;
+14602;ANATOLIAN HIEROGLYPH A459;Lo;0;L;;;;;N;;;;;
+14603;ANATOLIAN HIEROGLYPH A460;Lo;0;L;;;;;N;;;;;
+14604;ANATOLIAN HIEROGLYPH A461;Lo;0;L;;;;;N;;;;;
+14605;ANATOLIAN HIEROGLYPH A462;Lo;0;L;;;;;N;;;;;
+14606;ANATOLIAN HIEROGLYPH A463;Lo;0;L;;;;;N;;;;;
+14607;ANATOLIAN HIEROGLYPH A464;Lo;0;L;;;;;N;;;;;
+14608;ANATOLIAN HIEROGLYPH A465;Lo;0;L;;;;;N;;;;;
+14609;ANATOLIAN HIEROGLYPH A466;Lo;0;L;;;;;N;;;;;
+1460A;ANATOLIAN HIEROGLYPH A467;Lo;0;L;;;;;N;;;;;
+1460B;ANATOLIAN HIEROGLYPH A468;Lo;0;L;;;;;N;;;;;
+1460C;ANATOLIAN HIEROGLYPH A469;Lo;0;L;;;;;N;;;;;
+1460D;ANATOLIAN HIEROGLYPH A470;Lo;0;L;;;;;N;;;;;
+1460E;ANATOLIAN HIEROGLYPH A471;Lo;0;L;;;;;N;;;;;
+1460F;ANATOLIAN HIEROGLYPH A472;Lo;0;L;;;;;N;;;;;
+14610;ANATOLIAN HIEROGLYPH A473;Lo;0;L;;;;;N;;;;;
+14611;ANATOLIAN HIEROGLYPH A474;Lo;0;L;;;;;N;;;;;
+14612;ANATOLIAN HIEROGLYPH A475;Lo;0;L;;;;;N;;;;;
+14613;ANATOLIAN HIEROGLYPH A476;Lo;0;L;;;;;N;;;;;
+14614;ANATOLIAN HIEROGLYPH A477;Lo;0;L;;;;;N;;;;;
+14615;ANATOLIAN HIEROGLYPH A478;Lo;0;L;;;;;N;;;;;
+14616;ANATOLIAN HIEROGLYPH A479;Lo;0;L;;;;;N;;;;;
+14617;ANATOLIAN HIEROGLYPH A480;Lo;0;L;;;;;N;;;;;
+14618;ANATOLIAN HIEROGLYPH A481;Lo;0;L;;;;;N;;;;;
+14619;ANATOLIAN HIEROGLYPH A482;Lo;0;L;;;;;N;;;;;
+1461A;ANATOLIAN HIEROGLYPH A483;Lo;0;L;;;;;N;;;;;
+1461B;ANATOLIAN HIEROGLYPH A484;Lo;0;L;;;;;N;;;;;
+1461C;ANATOLIAN HIEROGLYPH A485;Lo;0;L;;;;;N;;;;;
+1461D;ANATOLIAN HIEROGLYPH A486;Lo;0;L;;;;;N;;;;;
+1461E;ANATOLIAN HIEROGLYPH A487;Lo;0;L;;;;;N;;;;;
+1461F;ANATOLIAN HIEROGLYPH A488;Lo;0;L;;;;;N;;;;;
+14620;ANATOLIAN HIEROGLYPH A489;Lo;0;L;;;;;N;;;;;
+14621;ANATOLIAN HIEROGLYPH A490;Lo;0;L;;;;;N;;;;;
+14622;ANATOLIAN HIEROGLYPH A491;Lo;0;L;;;;;N;;;;;
+14623;ANATOLIAN HIEROGLYPH A492;Lo;0;L;;;;;N;;;;;
+14624;ANATOLIAN HIEROGLYPH A493;Lo;0;L;;;;;N;;;;;
+14625;ANATOLIAN HIEROGLYPH A494;Lo;0;L;;;;;N;;;;;
+14626;ANATOLIAN HIEROGLYPH A495;Lo;0;L;;;;;N;;;;;
+14627;ANATOLIAN HIEROGLYPH A496;Lo;0;L;;;;;N;;;;;
+14628;ANATOLIAN HIEROGLYPH A497;Lo;0;L;;;;;N;;;;;
+14629;ANATOLIAN HIEROGLYPH A501;Lo;0;L;;;;;N;;;;;
+1462A;ANATOLIAN HIEROGLYPH A502;Lo;0;L;;;;;N;;;;;
+1462B;ANATOLIAN HIEROGLYPH A503;Lo;0;L;;;;;N;;;;;
+1462C;ANATOLIAN HIEROGLYPH A504;Lo;0;L;;;;;N;;;;;
+1462D;ANATOLIAN HIEROGLYPH A505;Lo;0;L;;;;;N;;;;;
+1462E;ANATOLIAN HIEROGLYPH A506;Lo;0;L;;;;;N;;;;;
+1462F;ANATOLIAN HIEROGLYPH A507;Lo;0;L;;;;;N;;;;;
+14630;ANATOLIAN HIEROGLYPH A508;Lo;0;L;;;;;N;;;;;
+14631;ANATOLIAN HIEROGLYPH A509;Lo;0;L;;;;;N;;;;;
+14632;ANATOLIAN HIEROGLYPH A510;Lo;0;L;;;;;N;;;;;
+14633;ANATOLIAN HIEROGLYPH A511;Lo;0;L;;;;;N;;;;;
+14634;ANATOLIAN HIEROGLYPH A512;Lo;0;L;;;;;N;;;;;
+14635;ANATOLIAN HIEROGLYPH A513;Lo;0;L;;;;;N;;;;;
+14636;ANATOLIAN HIEROGLYPH A514;Lo;0;L;;;;;N;;;;;
+14637;ANATOLIAN HIEROGLYPH A515;Lo;0;L;;;;;N;;;;;
+14638;ANATOLIAN HIEROGLYPH A516;Lo;0;L;;;;;N;;;;;
+14639;ANATOLIAN HIEROGLYPH A517;Lo;0;L;;;;;N;;;;;
+1463A;ANATOLIAN HIEROGLYPH A518;Lo;0;L;;;;;N;;;;;
+1463B;ANATOLIAN HIEROGLYPH A519;Lo;0;L;;;;;N;;;;;
+1463C;ANATOLIAN HIEROGLYPH A520;Lo;0;L;;;;;N;;;;;
+1463D;ANATOLIAN HIEROGLYPH A521;Lo;0;L;;;;;N;;;;;
+1463E;ANATOLIAN HIEROGLYPH A522;Lo;0;L;;;;;N;;;;;
+1463F;ANATOLIAN HIEROGLYPH A523;Lo;0;L;;;;;N;;;;;
+14640;ANATOLIAN HIEROGLYPH A524;Lo;0;L;;;;;N;;;;;
+14641;ANATOLIAN HIEROGLYPH A525;Lo;0;L;;;;;N;;;;;
+14642;ANATOLIAN HIEROGLYPH A526;Lo;0;L;;;;;N;;;;;
+14643;ANATOLIAN HIEROGLYPH A527;Lo;0;L;;;;;N;;;;;
+14644;ANATOLIAN HIEROGLYPH A528;Lo;0;L;;;;;N;;;;;
+14645;ANATOLIAN HIEROGLYPH A529;Lo;0;L;;;;;N;;;;;
+14646;ANATOLIAN HIEROGLYPH A530;Lo;0;L;;;;;N;;;;;
16800;BAMUM LETTER PHASE-A NGKUE MFON;Lo;0;L;;;;;N;;;;;
16801;BAMUM LETTER PHASE-A GBIEE FON;Lo;0;L;;;;;N;;;;;
16802;BAMUM LETTER PHASE-A PON MFON PIPAEMGBIEE;Lo;0;L;;;;;N;;;;;
@@ -23080,6 +24300,17 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1D1DB;MUSICAL SYMBOL SCANDICUS FLEXUS;So;0;L;;;;;N;;;;;
1D1DC;MUSICAL SYMBOL TORCULUS RESUPINUS;So;0;L;;;;;N;;;;;
1D1DD;MUSICAL SYMBOL PES SUBPUNCTIS;So;0;L;;;;;N;;;;;
+1D1DE;MUSICAL SYMBOL KIEVAN C CLEF;So;0;L;;;;;N;;;;;
+1D1DF;MUSICAL SYMBOL KIEVAN END OF PIECE;So;0;L;;;;;N;;;;;
+1D1E0;MUSICAL SYMBOL KIEVAN FINAL NOTE;So;0;L;;;;;N;;;;;
+1D1E1;MUSICAL SYMBOL KIEVAN RECITATIVE MARK;So;0;L;;;;;N;;;;;
+1D1E2;MUSICAL SYMBOL KIEVAN WHOLE NOTE;So;0;L;;;;;N;;;;;
+1D1E3;MUSICAL SYMBOL KIEVAN HALF NOTE;So;0;L;;;;;N;;;;;
+1D1E4;MUSICAL SYMBOL KIEVAN QUARTER NOTE STEM DOWN;So;0;L;;;;;N;;;;;
+1D1E5;MUSICAL SYMBOL KIEVAN QUARTER NOTE STEM UP;So;0;L;;;;;N;;;;;
+1D1E6;MUSICAL SYMBOL KIEVAN EIGHTH NOTE STEM DOWN;So;0;L;;;;;N;;;;;
+1D1E7;MUSICAL SYMBOL KIEVAN EIGHTH NOTE STEM UP;So;0;L;;;;;N;;;;;
+1D1E8;MUSICAL SYMBOL KIEVAN FLAT SIGN;So;0;L;;;;;N;;;;;
1D200;GREEK VOCAL NOTATION SYMBOL-1;So;0;ON;;;;;N;;;;;
1D201;GREEK VOCAL NOTATION SYMBOL-2;So;0;ON;;;;;N;;;;;
1D202;GREEK VOCAL NOTATION SYMBOL-3;So;0;ON;;;;;N;;;;;
@@ -24251,6 +25482,678 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1D7FD;MATHEMATICAL MONOSPACE DIGIT SEVEN;Nd;0;EN;<font> 0037;7;7;7;N;;;;;
1D7FE;MATHEMATICAL MONOSPACE DIGIT EIGHT;Nd;0;EN;<font> 0038;8;8;8;N;;;;;
1D7FF;MATHEMATICAL MONOSPACE DIGIT NINE;Nd;0;EN;<font> 0039;9;9;9;N;;;;;
+1D800;SIGNWRITING HAND-FIST INDEX;So;0;L;;;;;N;;;;;
+1D801;SIGNWRITING HAND-CIRCLE INDEX;So;0;L;;;;;N;;;;;
+1D802;SIGNWRITING HAND-CUP INDEX;So;0;L;;;;;N;;;;;
+1D803;SIGNWRITING HAND-OVAL INDEX;So;0;L;;;;;N;;;;;
+1D804;SIGNWRITING HAND-HINGE INDEX;So;0;L;;;;;N;;;;;
+1D805;SIGNWRITING HAND-ANGLE INDEX;So;0;L;;;;;N;;;;;
+1D806;SIGNWRITING HAND-FIST INDEX BENT;So;0;L;;;;;N;;;;;
+1D807;SIGNWRITING HAND-CIRCLE INDEX BENT;So;0;L;;;;;N;;;;;
+1D808;SIGNWRITING HAND-FIST THUMB UNDER INDEX BENT;So;0;L;;;;;N;;;;;
+1D809;SIGNWRITING HAND-FIST INDEX RAISED KNUCKLE;So;0;L;;;;;N;;;;;
+1D80A;SIGNWRITING HAND-FIST INDEX CUPPED;So;0;L;;;;;N;;;;;
+1D80B;SIGNWRITING HAND-FIST INDEX HINGED;So;0;L;;;;;N;;;;;
+1D80C;SIGNWRITING HAND-FIST INDEX HINGED LOW;So;0;L;;;;;N;;;;;
+1D80D;SIGNWRITING HAND-CIRCLE INDEX HINGE;So;0;L;;;;;N;;;;;
+1D80E;SIGNWRITING HAND-FIST INDEX MIDDLE;So;0;L;;;;;N;;;;;
+1D80F;SIGNWRITING HAND-CIRCLE INDEX MIDDLE;So;0;L;;;;;N;;;;;
+1D810;SIGNWRITING HAND-FIST INDEX MIDDLE BENT;So;0;L;;;;;N;;;;;
+1D811;SIGNWRITING HAND-FIST INDEX MIDDLE RAISED KNUCKLES;So;0;L;;;;;N;;;;;
+1D812;SIGNWRITING HAND-FIST INDEX MIDDLE HINGED;So;0;L;;;;;N;;;;;
+1D813;SIGNWRITING HAND-FIST INDEX UP MIDDLE HINGED;So;0;L;;;;;N;;;;;
+1D814;SIGNWRITING HAND-FIST INDEX HINGED MIDDLE UP;So;0;L;;;;;N;;;;;
+1D815;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED;So;0;L;;;;;N;;;;;
+1D816;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED INDEX BENT;So;0;L;;;;;N;;;;;
+1D817;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED MIDDLE BENT;So;0;L;;;;;N;;;;;
+1D818;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED CUPPED;So;0;L;;;;;N;;;;;
+1D819;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED HINGED;So;0;L;;;;;N;;;;;
+1D81A;SIGNWRITING HAND-FIST INDEX MIDDLE CROSSED;So;0;L;;;;;N;;;;;
+1D81B;SIGNWRITING HAND-CIRCLE INDEX MIDDLE CROSSED;So;0;L;;;;;N;;;;;
+1D81C;SIGNWRITING HAND-FIST MIDDLE BENT OVER INDEX;So;0;L;;;;;N;;;;;
+1D81D;SIGNWRITING HAND-FIST INDEX BENT OVER MIDDLE;So;0;L;;;;;N;;;;;
+1D81E;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB;So;0;L;;;;;N;;;;;
+1D81F;SIGNWRITING HAND-CIRCLE INDEX MIDDLE THUMB;So;0;L;;;;;N;;;;;
+1D820;SIGNWRITING HAND-FIST INDEX MIDDLE STRAIGHT THUMB BENT;So;0;L;;;;;N;;;;;
+1D821;SIGNWRITING HAND-FIST INDEX MIDDLE BENT THUMB STRAIGHT;So;0;L;;;;;N;;;;;
+1D822;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB BENT;So;0;L;;;;;N;;;;;
+1D823;SIGNWRITING HAND-FIST INDEX MIDDLE HINGED SPREAD THUMB SIDE;So;0;L;;;;;N;;;;;
+1D824;SIGNWRITING HAND-FIST INDEX UP MIDDLE HINGED THUMB SIDE;So;0;L;;;;;N;;;;;
+1D825;SIGNWRITING HAND-FIST INDEX UP MIDDLE HINGED THUMB CONJOINED;So;0;L;;;;;N;;;;;
+1D826;SIGNWRITING HAND-FIST INDEX HINGED MIDDLE UP THUMB SIDE;So;0;L;;;;;N;;;;;
+1D827;SIGNWRITING HAND-FIST INDEX MIDDLE UP SPREAD THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D828;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB CUPPED;So;0;L;;;;;N;;;;;
+1D829;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB CIRCLED;So;0;L;;;;;N;;;;;
+1D82A;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB HOOKED;So;0;L;;;;;N;;;;;
+1D82B;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB HINGED;So;0;L;;;;;N;;;;;
+1D82C;SIGNWRITING HAND-FIST THUMB BETWEEN INDEX MIDDLE STRAIGHT;So;0;L;;;;;N;;;;;
+1D82D;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED THUMB SIDE;So;0;L;;;;;N;;;;;
+1D82E;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED THUMB SIDE CONJOINED;So;0;L;;;;;N;;;;;
+1D82F;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED THUMB SIDE BENT;So;0;L;;;;;N;;;;;
+1D830;SIGNWRITING HAND-FIST MIDDLE THUMB HOOKED INDEX UP;So;0;L;;;;;N;;;;;
+1D831;SIGNWRITING HAND-FIST INDEX THUMB HOOKED MIDDLE UP;So;0;L;;;;;N;;;;;
+1D832;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED HINGED THUMB SIDE;So;0;L;;;;;N;;;;;
+1D833;SIGNWRITING HAND-FIST INDEX MIDDLE CROSSED THUMB SIDE;So;0;L;;;;;N;;;;;
+1D834;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D835;SIGNWRITING HAND-FIST INDEX MIDDLE CONJOINED CUPPED THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D836;SIGNWRITING HAND-FIST MIDDLE THUMB CUPPED INDEX UP;So;0;L;;;;;N;;;;;
+1D837;SIGNWRITING HAND-FIST INDEX THUMB CUPPED MIDDLE UP;So;0;L;;;;;N;;;;;
+1D838;SIGNWRITING HAND-FIST MIDDLE THUMB CIRCLED INDEX UP;So;0;L;;;;;N;;;;;
+1D839;SIGNWRITING HAND-FIST MIDDLE THUMB CIRCLED INDEX HINGED;So;0;L;;;;;N;;;;;
+1D83A;SIGNWRITING HAND-FIST INDEX THUMB ANGLED OUT MIDDLE UP;So;0;L;;;;;N;;;;;
+1D83B;SIGNWRITING HAND-FIST INDEX THUMB ANGLED IN MIDDLE UP;So;0;L;;;;;N;;;;;
+1D83C;SIGNWRITING HAND-FIST INDEX THUMB CIRCLED MIDDLE UP;So;0;L;;;;;N;;;;;
+1D83D;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB CONJOINED HINGED;So;0;L;;;;;N;;;;;
+1D83E;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB ANGLED OUT;So;0;L;;;;;N;;;;;
+1D83F;SIGNWRITING HAND-FIST INDEX MIDDLE THUMB ANGLED;So;0;L;;;;;N;;;;;
+1D840;SIGNWRITING HAND-FIST MIDDLE THUMB ANGLED OUT INDEX UP;So;0;L;;;;;N;;;;;
+1D841;SIGNWRITING HAND-FIST MIDDLE THUMB ANGLED OUT INDEX CROSSED;So;0;L;;;;;N;;;;;
+1D842;SIGNWRITING HAND-FIST MIDDLE THUMB ANGLED INDEX UP;So;0;L;;;;;N;;;;;
+1D843;SIGNWRITING HAND-FIST INDEX THUMB HOOKED MIDDLE HINGED;So;0;L;;;;;N;;;;;
+1D844;SIGNWRITING HAND-FLAT FOUR FINGERS;So;0;L;;;;;N;;;;;
+1D845;SIGNWRITING HAND-FLAT FOUR FINGERS BENT;So;0;L;;;;;N;;;;;
+1D846;SIGNWRITING HAND-FLAT FOUR FINGERS HINGED;So;0;L;;;;;N;;;;;
+1D847;SIGNWRITING HAND-FLAT FOUR FINGERS CONJOINED;So;0;L;;;;;N;;;;;
+1D848;SIGNWRITING HAND-FLAT FOUR FINGERS CONJOINED SPLIT;So;0;L;;;;;N;;;;;
+1D849;SIGNWRITING HAND-CLAW FOUR FINGERS CONJOINED;So;0;L;;;;;N;;;;;
+1D84A;SIGNWRITING HAND-FIST FOUR FINGERS CONJOINED BENT;So;0;L;;;;;N;;;;;
+1D84B;SIGNWRITING HAND-HINGE FOUR FINGERS CONJOINED;So;0;L;;;;;N;;;;;
+1D84C;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD;So;0;L;;;;;N;;;;;
+1D84D;SIGNWRITING HAND-FLAT HEEL FIVE FINGERS SPREAD;So;0;L;;;;;N;;;;;
+1D84E;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD FOUR BENT;So;0;L;;;;;N;;;;;
+1D84F;SIGNWRITING HAND-FLAT HEEL FIVE FINGERS SPREAD FOUR BENT;So;0;L;;;;;N;;;;;
+1D850;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD BENT;So;0;L;;;;;N;;;;;
+1D851;SIGNWRITING HAND-FLAT HEEL FIVE FINGERS SPREAD BENT;So;0;L;;;;;N;;;;;
+1D852;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D853;SIGNWRITING HAND-CUP FIVE FINGERS SPREAD;So;0;L;;;;;N;;;;;
+1D854;SIGNWRITING HAND-CUP FIVE FINGERS SPREAD OPEN;So;0;L;;;;;N;;;;;
+1D855;SIGNWRITING HAND-HINGE FIVE FINGERS SPREAD OPEN;So;0;L;;;;;N;;;;;
+1D856;SIGNWRITING HAND-OVAL FIVE FINGERS SPREAD;So;0;L;;;;;N;;;;;
+1D857;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD HINGED;So;0;L;;;;;N;;;;;
+1D858;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD HINGED THUMB SIDE;So;0;L;;;;;N;;;;;
+1D859;SIGNWRITING HAND-FLAT FIVE FINGERS SPREAD HINGED NO THUMB;So;0;L;;;;;N;;;;;
+1D85A;SIGNWRITING HAND-FLAT;So;0;L;;;;;N;;;;;
+1D85B;SIGNWRITING HAND-FLAT BETWEEN PALM FACINGS;So;0;L;;;;;N;;;;;
+1D85C;SIGNWRITING HAND-FLAT HEEL;So;0;L;;;;;N;;;;;
+1D85D;SIGNWRITING HAND-FLAT THUMB SIDE;So;0;L;;;;;N;;;;;
+1D85E;SIGNWRITING HAND-FLAT HEEL THUMB SIDE;So;0;L;;;;;N;;;;;
+1D85F;SIGNWRITING HAND-FLAT THUMB BENT;So;0;L;;;;;N;;;;;
+1D860;SIGNWRITING HAND-FLAT THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D861;SIGNWRITING HAND-FLAT SPLIT INDEX THUMB SIDE;So;0;L;;;;;N;;;;;
+1D862;SIGNWRITING HAND-FLAT SPLIT CENTRE;So;0;L;;;;;N;;;;;
+1D863;SIGNWRITING HAND-FLAT SPLIT CENTRE THUMB SIDE;So;0;L;;;;;N;;;;;
+1D864;SIGNWRITING HAND-FLAT SPLIT CENTRE THUMB SIDE BENT;So;0;L;;;;;N;;;;;
+1D865;SIGNWRITING HAND-FLAT SPLIT LITTLE;So;0;L;;;;;N;;;;;
+1D866;SIGNWRITING HAND-CLAW;So;0;L;;;;;N;;;;;
+1D867;SIGNWRITING HAND-CLAW THUMB SIDE;So;0;L;;;;;N;;;;;
+1D868;SIGNWRITING HAND-CLAW NO THUMB;So;0;L;;;;;N;;;;;
+1D869;SIGNWRITING HAND-CLAW THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D86A;SIGNWRITING HAND-HOOK CURLICUE;So;0;L;;;;;N;;;;;
+1D86B;SIGNWRITING HAND-HOOK;So;0;L;;;;;N;;;;;
+1D86C;SIGNWRITING HAND-CUP OPEN;So;0;L;;;;;N;;;;;
+1D86D;SIGNWRITING HAND-CUP;So;0;L;;;;;N;;;;;
+1D86E;SIGNWRITING HAND-CUP OPEN THUMB SIDE;So;0;L;;;;;N;;;;;
+1D86F;SIGNWRITING HAND-CUP THUMB SIDE;So;0;L;;;;;N;;;;;
+1D870;SIGNWRITING HAND-CUP OPEN NO THUMB;So;0;L;;;;;N;;;;;
+1D871;SIGNWRITING HAND-CUP NO THUMB;So;0;L;;;;;N;;;;;
+1D872;SIGNWRITING HAND-CUP OPEN THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D873;SIGNWRITING HAND-CUP THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D874;SIGNWRITING HAND-CURLICUE OPEN;So;0;L;;;;;N;;;;;
+1D875;SIGNWRITING HAND-CURLICUE;So;0;L;;;;;N;;;;;
+1D876;SIGNWRITING HAND-CIRCLE;So;0;L;;;;;N;;;;;
+1D877;SIGNWRITING HAND-OVAL;So;0;L;;;;;N;;;;;
+1D878;SIGNWRITING HAND-OVAL THUMB SIDE;So;0;L;;;;;N;;;;;
+1D879;SIGNWRITING HAND-OVAL NO THUMB;So;0;L;;;;;N;;;;;
+1D87A;SIGNWRITING HAND-OVAL THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D87B;SIGNWRITING HAND-HINGE OPEN;So;0;L;;;;;N;;;;;
+1D87C;SIGNWRITING HAND-HINGE OPEN THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D87D;SIGNWRITING HAND-HINGE;So;0;L;;;;;N;;;;;
+1D87E;SIGNWRITING HAND-HINGE SMALL;So;0;L;;;;;N;;;;;
+1D87F;SIGNWRITING HAND-HINGE OPEN THUMB SIDE;So;0;L;;;;;N;;;;;
+1D880;SIGNWRITING HAND-HINGE THUMB SIDE;So;0;L;;;;;N;;;;;
+1D881;SIGNWRITING HAND-HINGE OPEN NO THUMB;So;0;L;;;;;N;;;;;
+1D882;SIGNWRITING HAND-HINGE NO THUMB;So;0;L;;;;;N;;;;;
+1D883;SIGNWRITING HAND-HINGE THUMB SIDE TOUCHING INDEX;So;0;L;;;;;N;;;;;
+1D884;SIGNWRITING HAND-HINGE THUMB BETWEEN MIDDLE RING;So;0;L;;;;;N;;;;;
+1D885;SIGNWRITING HAND-ANGLE;So;0;L;;;;;N;;;;;
+1D886;SIGNWRITING HAND-FIST INDEX MIDDLE RING;So;0;L;;;;;N;;;;;
+1D887;SIGNWRITING HAND-CIRCLE INDEX MIDDLE RING;So;0;L;;;;;N;;;;;
+1D888;SIGNWRITING HAND-HINGE INDEX MIDDLE RING;So;0;L;;;;;N;;;;;
+1D889;SIGNWRITING HAND-ANGLE INDEX MIDDLE RING;So;0;L;;;;;N;;;;;
+1D88A;SIGNWRITING HAND-HINGE LITTLE;So;0;L;;;;;N;;;;;
+1D88B;SIGNWRITING HAND-FIST INDEX MIDDLE RING BENT;So;0;L;;;;;N;;;;;
+1D88C;SIGNWRITING HAND-FIST INDEX MIDDLE RING CONJOINED;So;0;L;;;;;N;;;;;
+1D88D;SIGNWRITING HAND-HINGE INDEX MIDDLE RING CONJOINED;So;0;L;;;;;N;;;;;
+1D88E;SIGNWRITING HAND-FIST LITTLE DOWN;So;0;L;;;;;N;;;;;
+1D88F;SIGNWRITING HAND-FIST LITTLE DOWN RIPPLE STRAIGHT;So;0;L;;;;;N;;;;;
+1D890;SIGNWRITING HAND-FIST LITTLE DOWN RIPPLE CURVED;So;0;L;;;;;N;;;;;
+1D891;SIGNWRITING HAND-FIST LITTLE DOWN OTHERS CIRCLED;So;0;L;;;;;N;;;;;
+1D892;SIGNWRITING HAND-FIST LITTLE UP;So;0;L;;;;;N;;;;;
+1D893;SIGNWRITING HAND-FIST THUMB UNDER LITTLE UP;So;0;L;;;;;N;;;;;
+1D894;SIGNWRITING HAND-CIRCLE LITTLE UP;So;0;L;;;;;N;;;;;
+1D895;SIGNWRITING HAND-OVAL LITTLE UP;So;0;L;;;;;N;;;;;
+1D896;SIGNWRITING HAND-ANGLE LITTLE UP;So;0;L;;;;;N;;;;;
+1D897;SIGNWRITING HAND-FIST LITTLE RAISED KNUCKLE;So;0;L;;;;;N;;;;;
+1D898;SIGNWRITING HAND-FIST LITTLE BENT;So;0;L;;;;;N;;;;;
+1D899;SIGNWRITING HAND-FIST LITTLE TOUCHES THUMB;So;0;L;;;;;N;;;;;
+1D89A;SIGNWRITING HAND-FIST LITTLE THUMB;So;0;L;;;;;N;;;;;
+1D89B;SIGNWRITING HAND-HINGE LITTLE THUMB;So;0;L;;;;;N;;;;;
+1D89C;SIGNWRITING HAND-FIST LITTLE INDEX THUMB;So;0;L;;;;;N;;;;;
+1D89D;SIGNWRITING HAND-HINGE LITTLE INDEX THUMB;So;0;L;;;;;N;;;;;
+1D89E;SIGNWRITING HAND-ANGLE LITTLE INDEX THUMB INDEX THUMB OUT;So;0;L;;;;;N;;;;;
+1D89F;SIGNWRITING HAND-ANGLE LITTLE INDEX THUMB INDEX THUMB;So;0;L;;;;;N;;;;;
+1D8A0;SIGNWRITING HAND-FIST LITTLE INDEX;So;0;L;;;;;N;;;;;
+1D8A1;SIGNWRITING HAND-CIRCLE LITTLE INDEX;So;0;L;;;;;N;;;;;
+1D8A2;SIGNWRITING HAND-HINGE LITTLE INDEX;So;0;L;;;;;N;;;;;
+1D8A3;SIGNWRITING HAND-ANGLE LITTLE INDEX;So;0;L;;;;;N;;;;;
+1D8A4;SIGNWRITING HAND-FIST INDEX MIDDLE LITTLE;So;0;L;;;;;N;;;;;
+1D8A5;SIGNWRITING HAND-CIRCLE INDEX MIDDLE LITTLE;So;0;L;;;;;N;;;;;
+1D8A6;SIGNWRITING HAND-HINGE INDEX MIDDLE LITTLE;So;0;L;;;;;N;;;;;
+1D8A7;SIGNWRITING HAND-HINGE RING;So;0;L;;;;;N;;;;;
+1D8A8;SIGNWRITING HAND-ANGLE INDEX MIDDLE LITTLE;So;0;L;;;;;N;;;;;
+1D8A9;SIGNWRITING HAND-FIST INDEX MIDDLE CROSS LITTLE;So;0;L;;;;;N;;;;;
+1D8AA;SIGNWRITING HAND-CIRCLE INDEX MIDDLE CROSS LITTLE;So;0;L;;;;;N;;;;;
+1D8AB;SIGNWRITING HAND-FIST RING DOWN;So;0;L;;;;;N;;;;;
+1D8AC;SIGNWRITING HAND-HINGE RING DOWN INDEX THUMB HOOK MIDDLE;So;0;L;;;;;N;;;;;
+1D8AD;SIGNWRITING HAND-ANGLE RING DOWN MIDDLE THUMB INDEX CROSS;So;0;L;;;;;N;;;;;
+1D8AE;SIGNWRITING HAND-FIST RING UP;So;0;L;;;;;N;;;;;
+1D8AF;SIGNWRITING HAND-FIST RING RAISED KNUCKLE;So;0;L;;;;;N;;;;;
+1D8B0;SIGNWRITING HAND-FIST RING LITTLE;So;0;L;;;;;N;;;;;
+1D8B1;SIGNWRITING HAND-CIRCLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8B2;SIGNWRITING HAND-OVAL RING LITTLE;So;0;L;;;;;N;;;;;
+1D8B3;SIGNWRITING HAND-ANGLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8B4;SIGNWRITING HAND-FIST RING MIDDLE;So;0;L;;;;;N;;;;;
+1D8B5;SIGNWRITING HAND-FIST RING MIDDLE CONJOINED;So;0;L;;;;;N;;;;;
+1D8B6;SIGNWRITING HAND-FIST RING MIDDLE RAISED KNUCKLES;So;0;L;;;;;N;;;;;
+1D8B7;SIGNWRITING HAND-FIST RING INDEX;So;0;L;;;;;N;;;;;
+1D8B8;SIGNWRITING HAND-FIST RING THUMB;So;0;L;;;;;N;;;;;
+1D8B9;SIGNWRITING HAND-HOOK RING THUMB;So;0;L;;;;;N;;;;;
+1D8BA;SIGNWRITING HAND-FIST INDEX RING LITTLE;So;0;L;;;;;N;;;;;
+1D8BB;SIGNWRITING HAND-CIRCLE INDEX RING LITTLE;So;0;L;;;;;N;;;;;
+1D8BC;SIGNWRITING HAND-CURLICUE INDEX RING LITTLE ON;So;0;L;;;;;N;;;;;
+1D8BD;SIGNWRITING HAND-HOOK INDEX RING LITTLE OUT;So;0;L;;;;;N;;;;;
+1D8BE;SIGNWRITING HAND-HOOK INDEX RING LITTLE IN;So;0;L;;;;;N;;;;;
+1D8BF;SIGNWRITING HAND-HOOK INDEX RING LITTLE UNDER;So;0;L;;;;;N;;;;;
+1D8C0;SIGNWRITING HAND-CUP INDEX RING LITTLE;So;0;L;;;;;N;;;;;
+1D8C1;SIGNWRITING HAND-HINGE INDEX RING LITTLE;So;0;L;;;;;N;;;;;
+1D8C2;SIGNWRITING HAND-ANGLE INDEX RING LITTLE OUT;So;0;L;;;;;N;;;;;
+1D8C3;SIGNWRITING HAND-ANGLE INDEX RING LITTLE;So;0;L;;;;;N;;;;;
+1D8C4;SIGNWRITING HAND-FIST MIDDLE DOWN;So;0;L;;;;;N;;;;;
+1D8C5;SIGNWRITING HAND-HINGE MIDDLE;So;0;L;;;;;N;;;;;
+1D8C6;SIGNWRITING HAND-FIST MIDDLE UP;So;0;L;;;;;N;;;;;
+1D8C7;SIGNWRITING HAND-CIRCLE MIDDLE UP;So;0;L;;;;;N;;;;;
+1D8C8;SIGNWRITING HAND-FIST MIDDLE RAISED KNUCKLE;So;0;L;;;;;N;;;;;
+1D8C9;SIGNWRITING HAND-FIST MIDDLE UP THUMB SIDE;So;0;L;;;;;N;;;;;
+1D8CA;SIGNWRITING HAND-HOOK MIDDLE THUMB;So;0;L;;;;;N;;;;;
+1D8CB;SIGNWRITING HAND-FIST MIDDLE THUMB LITTLE;So;0;L;;;;;N;;;;;
+1D8CC;SIGNWRITING HAND-FIST MIDDLE LITTLE;So;0;L;;;;;N;;;;;
+1D8CD;SIGNWRITING HAND-FIST MIDDLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8CE;SIGNWRITING HAND-CIRCLE MIDDLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8CF;SIGNWRITING HAND-CURLICUE MIDDLE RING LITTLE ON;So;0;L;;;;;N;;;;;
+1D8D0;SIGNWRITING HAND-CUP MIDDLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8D1;SIGNWRITING HAND-HINGE MIDDLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8D2;SIGNWRITING HAND-ANGLE MIDDLE RING LITTLE OUT;So;0;L;;;;;N;;;;;
+1D8D3;SIGNWRITING HAND-ANGLE MIDDLE RING LITTLE IN;So;0;L;;;;;N;;;;;
+1D8D4;SIGNWRITING HAND-ANGLE MIDDLE RING LITTLE;So;0;L;;;;;N;;;;;
+1D8D5;SIGNWRITING HAND-CIRCLE MIDDLE RING LITTLE BENT;So;0;L;;;;;N;;;;;
+1D8D6;SIGNWRITING HAND-CLAW MIDDLE RING LITTLE CONJOINED;So;0;L;;;;;N;;;;;
+1D8D7;SIGNWRITING HAND-CLAW MIDDLE RING LITTLE CONJOINED SIDE;So;0;L;;;;;N;;;;;
+1D8D8;SIGNWRITING HAND-HOOK MIDDLE RING LITTLE CONJOINED OUT;So;0;L;;;;;N;;;;;
+1D8D9;SIGNWRITING HAND-HOOK MIDDLE RING LITTLE CONJOINED IN;So;0;L;;;;;N;;;;;
+1D8DA;SIGNWRITING HAND-HOOK MIDDLE RING LITTLE CONJOINED;So;0;L;;;;;N;;;;;
+1D8DB;SIGNWRITING HAND-HINGE INDEX HINGED;So;0;L;;;;;N;;;;;
+1D8DC;SIGNWRITING HAND-FIST INDEX THUMB SIDE;So;0;L;;;;;N;;;;;
+1D8DD;SIGNWRITING HAND-HINGE INDEX THUMB SIDE;So;0;L;;;;;N;;;;;
+1D8DE;SIGNWRITING HAND-FIST INDEX THUMB SIDE THUMB DIAGONAL;So;0;L;;;;;N;;;;;
+1D8DF;SIGNWRITING HAND-FIST INDEX THUMB SIDE THUMB CONJOINED;So;0;L;;;;;N;;;;;
+1D8E0;SIGNWRITING HAND-FIST INDEX THUMB SIDE THUMB BENT;So;0;L;;;;;N;;;;;
+1D8E1;SIGNWRITING HAND-FIST INDEX THUMB SIDE INDEX BENT;So;0;L;;;;;N;;;;;
+1D8E2;SIGNWRITING HAND-FIST INDEX THUMB SIDE BOTH BENT;So;0;L;;;;;N;;;;;
+1D8E3;SIGNWRITING HAND-FIST INDEX THUMB SIDE INDEX HINGE;So;0;L;;;;;N;;;;;
+1D8E4;SIGNWRITING HAND-FIST INDEX THUMB FORWARD INDEX STRAIGHT;So;0;L;;;;;N;;;;;
+1D8E5;SIGNWRITING HAND-FIST INDEX THUMB FORWARD INDEX BENT;So;0;L;;;;;N;;;;;
+1D8E6;SIGNWRITING HAND-FIST INDEX THUMB HOOK;So;0;L;;;;;N;;;;;
+1D8E7;SIGNWRITING HAND-FIST INDEX THUMB CURLICUE;So;0;L;;;;;N;;;;;
+1D8E8;SIGNWRITING HAND-FIST INDEX THUMB CURVE THUMB INSIDE;So;0;L;;;;;N;;;;;
+1D8E9;SIGNWRITING HAND-CLAW INDEX THUMB CURVE THUMB INSIDE;So;0;L;;;;;N;;;;;
+1D8EA;SIGNWRITING HAND-FIST INDEX THUMB CURVE THUMB UNDER;So;0;L;;;;;N;;;;;
+1D8EB;SIGNWRITING HAND-FIST INDEX THUMB CIRCLE;So;0;L;;;;;N;;;;;
+1D8EC;SIGNWRITING HAND-CUP INDEX THUMB;So;0;L;;;;;N;;;;;
+1D8ED;SIGNWRITING HAND-CUP INDEX THUMB OPEN;So;0;L;;;;;N;;;;;
+1D8EE;SIGNWRITING HAND-HINGE INDEX THUMB OPEN;So;0;L;;;;;N;;;;;
+1D8EF;SIGNWRITING HAND-HINGE INDEX THUMB LARGE;So;0;L;;;;;N;;;;;
+1D8F0;SIGNWRITING HAND-HINGE INDEX THUMB;So;0;L;;;;;N;;;;;
+1D8F1;SIGNWRITING HAND-HINGE INDEX THUMB SMALL;So;0;L;;;;;N;;;;;
+1D8F2;SIGNWRITING HAND-ANGLE INDEX THUMB OUT;So;0;L;;;;;N;;;;;
+1D8F3;SIGNWRITING HAND-ANGLE INDEX THUMB IN;So;0;L;;;;;N;;;;;
+1D8F4;SIGNWRITING HAND-ANGLE INDEX THUMB;So;0;L;;;;;N;;;;;
+1D8F5;SIGNWRITING HAND-FIST THUMB;So;0;L;;;;;N;;;;;
+1D8F6;SIGNWRITING HAND-FIST THUMB HEEL;So;0;L;;;;;N;;;;;
+1D8F7;SIGNWRITING HAND-FIST THUMB SIDE DIAGONAL;So;0;L;;;;;N;;;;;
+1D8F8;SIGNWRITING HAND-FIST THUMB SIDE CONJOINED;So;0;L;;;;;N;;;;;
+1D8F9;SIGNWRITING HAND-FIST THUMB SIDE BENT;So;0;L;;;;;N;;;;;
+1D8FA;SIGNWRITING HAND-FIST THUMB FORWARD;So;0;L;;;;;N;;;;;
+1D8FB;SIGNWRITING HAND-FIST THUMB BETWEEN INDEX MIDDLE;So;0;L;;;;;N;;;;;
+1D8FC;SIGNWRITING HAND-FIST THUMB BETWEEN MIDDLE RING;So;0;L;;;;;N;;;;;
+1D8FD;SIGNWRITING HAND-FIST THUMB BETWEEN RING LITTLE;So;0;L;;;;;N;;;;;
+1D8FE;SIGNWRITING HAND-FIST THUMB UNDER TWO FINGERS;So;0;L;;;;;N;;;;;
+1D8FF;SIGNWRITING HAND-FIST THUMB OVER TWO FINGERS;So;0;L;;;;;N;;;;;
+1D900;SIGNWRITING HAND-FIST THUMB UNDER THREE FINGERS;So;0;L;;;;;N;;;;;
+1D901;SIGNWRITING HAND-FIST THUMB UNDER FOUR FINGERS;So;0;L;;;;;N;;;;;
+1D902;SIGNWRITING HAND-FIST THUMB OVER FOUR RAISED KNUCKLES;So;0;L;;;;;N;;;;;
+1D903;SIGNWRITING HAND-FIST;So;0;L;;;;;N;;;;;
+1D904;SIGNWRITING HAND-FIST HEEL;So;0;L;;;;;N;;;;;
+1D905;SIGNWRITING TOUCH SINGLE;So;0;L;;;;;N;;;;;
+1D906;SIGNWRITING TOUCH MULTIPLE;So;0;L;;;;;N;;;;;
+1D907;SIGNWRITING TOUCH BETWEEN;So;0;L;;;;;N;;;;;
+1D908;SIGNWRITING GRASP SINGLE;So;0;L;;;;;N;;;;;
+1D909;SIGNWRITING GRASP MULTIPLE;So;0;L;;;;;N;;;;;
+1D90A;SIGNWRITING GRASP BETWEEN;So;0;L;;;;;N;;;;;
+1D90B;SIGNWRITING STRIKE SINGLE;So;0;L;;;;;N;;;;;
+1D90C;SIGNWRITING STRIKE MULTIPLE;So;0;L;;;;;N;;;;;
+1D90D;SIGNWRITING STRIKE BETWEEN;So;0;L;;;;;N;;;;;
+1D90E;SIGNWRITING BRUSH SINGLE;So;0;L;;;;;N;;;;;
+1D90F;SIGNWRITING BRUSH MULTIPLE;So;0;L;;;;;N;;;;;
+1D910;SIGNWRITING BRUSH BETWEEN;So;0;L;;;;;N;;;;;
+1D911;SIGNWRITING RUB SINGLE;So;0;L;;;;;N;;;;;
+1D912;SIGNWRITING RUB MULTIPLE;So;0;L;;;;;N;;;;;
+1D913;SIGNWRITING RUB BETWEEN;So;0;L;;;;;N;;;;;
+1D914;SIGNWRITING SURFACE SYMBOLS;So;0;L;;;;;N;;;;;
+1D915;SIGNWRITING SURFACE BETWEEN;So;0;L;;;;;N;;;;;
+1D916;SIGNWRITING SQUEEZE LARGE SINGLE;So;0;L;;;;;N;;;;;
+1D917;SIGNWRITING SQUEEZE SMALL SINGLE;So;0;L;;;;;N;;;;;
+1D918;SIGNWRITING SQUEEZE LARGE MULTIPLE;So;0;L;;;;;N;;;;;
+1D919;SIGNWRITING SQUEEZE SMALL MULTIPLE;So;0;L;;;;;N;;;;;
+1D91A;SIGNWRITING SQUEEZE SEQUENTIAL;So;0;L;;;;;N;;;;;
+1D91B;SIGNWRITING FLICK LARGE SINGLE;So;0;L;;;;;N;;;;;
+1D91C;SIGNWRITING FLICK SMALL SINGLE;So;0;L;;;;;N;;;;;
+1D91D;SIGNWRITING FLICK LARGE MULTIPLE;So;0;L;;;;;N;;;;;
+1D91E;SIGNWRITING FLICK SMALL MULTIPLE;So;0;L;;;;;N;;;;;
+1D91F;SIGNWRITING FLICK SEQUENTIAL;So;0;L;;;;;N;;;;;
+1D920;SIGNWRITING SQUEEZE FLICK ALTERNATING;So;0;L;;;;;N;;;;;
+1D921;SIGNWRITING MOVEMENT-HINGE UP DOWN LARGE;So;0;L;;;;;N;;;;;
+1D922;SIGNWRITING MOVEMENT-HINGE UP DOWN SMALL;So;0;L;;;;;N;;;;;
+1D923;SIGNWRITING MOVEMENT-HINGE UP SEQUENTIAL;So;0;L;;;;;N;;;;;
+1D924;SIGNWRITING MOVEMENT-HINGE DOWN SEQUENTIAL;So;0;L;;;;;N;;;;;
+1D925;SIGNWRITING MOVEMENT-HINGE UP DOWN ALTERNATING LARGE;So;0;L;;;;;N;;;;;
+1D926;SIGNWRITING MOVEMENT-HINGE UP DOWN ALTERNATING SMALL;So;0;L;;;;;N;;;;;
+1D927;SIGNWRITING MOVEMENT-HINGE SIDE TO SIDE SCISSORS;So;0;L;;;;;N;;;;;
+1D928;SIGNWRITING MOVEMENT-WALLPLANE FINGER CONTACT;So;0;L;;;;;N;;;;;
+1D929;SIGNWRITING MOVEMENT-FLOORPLANE FINGER CONTACT;So;0;L;;;;;N;;;;;
+1D92A;SIGNWRITING MOVEMENT-WALLPLANE SINGLE STRAIGHT SMALL;So;0;L;;;;;N;;;;;
+1D92B;SIGNWRITING MOVEMENT-WALLPLANE SINGLE STRAIGHT MEDIUM;So;0;L;;;;;N;;;;;
+1D92C;SIGNWRITING MOVEMENT-WALLPLANE SINGLE STRAIGHT LARGE;So;0;L;;;;;N;;;;;
+1D92D;SIGNWRITING MOVEMENT-WALLPLANE SINGLE STRAIGHT LARGEST;So;0;L;;;;;N;;;;;
+1D92E;SIGNWRITING MOVEMENT-WALLPLANE SINGLE WRIST FLEX;So;0;L;;;;;N;;;;;
+1D92F;SIGNWRITING MOVEMENT-WALLPLANE DOUBLE STRAIGHT;So;0;L;;;;;N;;;;;
+1D930;SIGNWRITING MOVEMENT-WALLPLANE DOUBLE WRIST FLEX;So;0;L;;;;;N;;;;;
+1D931;SIGNWRITING MOVEMENT-WALLPLANE DOUBLE ALTERNATING;So;0;L;;;;;N;;;;;
+1D932;SIGNWRITING MOVEMENT-WALLPLANE DOUBLE ALTERNATING WRIST FLEX;So;0;L;;;;;N;;;;;
+1D933;SIGNWRITING MOVEMENT-WALLPLANE CROSS;So;0;L;;;;;N;;;;;
+1D934;SIGNWRITING MOVEMENT-WALLPLANE TRIPLE STRAIGHT MOVEMENT;So;0;L;;;;;N;;;;;
+1D935;SIGNWRITING MOVEMENT-WALLPLANE TRIPLE WRIST FLEX;So;0;L;;;;;N;;;;;
+1D936;SIGNWRITING MOVEMENT-WALLPLANE TRIPLE ALTERNATING;So;0;L;;;;;N;;;;;
+1D937;SIGNWRITING MOVEMENT-WALLPLANE TRIPLE ALTERNATING WRIST FLEX;So;0;L;;;;;N;;;;;
+1D938;SIGNWRITING MOVEMENT-WALLPLANE BEND SMALL;So;0;L;;;;;N;;;;;
+1D939;SIGNWRITING MOVEMENT-WALLPLANE BEND MEDIUM;So;0;L;;;;;N;;;;;
+1D93A;SIGNWRITING MOVEMENT-WALLPLANE BEND LARGE;So;0;L;;;;;N;;;;;
+1D93B;SIGNWRITING MOVEMENT-WALLPLANE CORNER SMALL;So;0;L;;;;;N;;;;;
+1D93C;SIGNWRITING MOVEMENT-WALLPLANE CORNER MEDIUM;So;0;L;;;;;N;;;;;
+1D93D;SIGNWRITING MOVEMENT-WALLPLANE CORNER LARGE;So;0;L;;;;;N;;;;;
+1D93E;SIGNWRITING MOVEMENT-WALLPLANE CORNER ROTATION;So;0;L;;;;;N;;;;;
+1D93F;SIGNWRITING MOVEMENT-WALLPLANE CHECK SMALL;So;0;L;;;;;N;;;;;
+1D940;SIGNWRITING MOVEMENT-WALLPLANE CHECK MEDIUM;So;0;L;;;;;N;;;;;
+1D941;SIGNWRITING MOVEMENT-WALLPLANE CHECK LARGE;So;0;L;;;;;N;;;;;
+1D942;SIGNWRITING MOVEMENT-WALLPLANE BOX SMALL;So;0;L;;;;;N;;;;;
+1D943;SIGNWRITING MOVEMENT-WALLPLANE BOX MEDIUM;So;0;L;;;;;N;;;;;
+1D944;SIGNWRITING MOVEMENT-WALLPLANE BOX LARGE;So;0;L;;;;;N;;;;;
+1D945;SIGNWRITING MOVEMENT-WALLPLANE ZIGZAG SMALL;So;0;L;;;;;N;;;;;
+1D946;SIGNWRITING MOVEMENT-WALLPLANE ZIGZAG MEDIUM;So;0;L;;;;;N;;;;;
+1D947;SIGNWRITING MOVEMENT-WALLPLANE ZIGZAG LARGE;So;0;L;;;;;N;;;;;
+1D948;SIGNWRITING MOVEMENT-WALLPLANE PEAKS SMALL;So;0;L;;;;;N;;;;;
+1D949;SIGNWRITING MOVEMENT-WALLPLANE PEAKS MEDIUM;So;0;L;;;;;N;;;;;
+1D94A;SIGNWRITING MOVEMENT-WALLPLANE PEAKS LARGE;So;0;L;;;;;N;;;;;
+1D94B;SIGNWRITING TRAVEL-WALLPLANE ROTATION-WALLPLANE SINGLE;So;0;L;;;;;N;;;;;
+1D94C;SIGNWRITING TRAVEL-WALLPLANE ROTATION-WALLPLANE DOUBLE;So;0;L;;;;;N;;;;;
+1D94D;SIGNWRITING TRAVEL-WALLPLANE ROTATION-WALLPLANE ALTERNATING;So;0;L;;;;;N;;;;;
+1D94E;SIGNWRITING TRAVEL-WALLPLANE ROTATION-FLOORPLANE SINGLE;So;0;L;;;;;N;;;;;
+1D94F;SIGNWRITING TRAVEL-WALLPLANE ROTATION-FLOORPLANE DOUBLE;So;0;L;;;;;N;;;;;
+1D950;SIGNWRITING TRAVEL-WALLPLANE ROTATION-FLOORPLANE ALTERNATING;So;0;L;;;;;N;;;;;
+1D951;SIGNWRITING TRAVEL-WALLPLANE SHAKING;So;0;L;;;;;N;;;;;
+1D952;SIGNWRITING TRAVEL-WALLPLANE ARM SPIRAL SINGLE;So;0;L;;;;;N;;;;;
+1D953;SIGNWRITING TRAVEL-WALLPLANE ARM SPIRAL DOUBLE;So;0;L;;;;;N;;;;;
+1D954;SIGNWRITING TRAVEL-WALLPLANE ARM SPIRAL TRIPLE;So;0;L;;;;;N;;;;;
+1D955;SIGNWRITING MOVEMENT-DIAGONAL AWAY SMALL;So;0;L;;;;;N;;;;;
+1D956;SIGNWRITING MOVEMENT-DIAGONAL AWAY MEDIUM;So;0;L;;;;;N;;;;;
+1D957;SIGNWRITING MOVEMENT-DIAGONAL AWAY LARGE;So;0;L;;;;;N;;;;;
+1D958;SIGNWRITING MOVEMENT-DIAGONAL AWAY LARGEST;So;0;L;;;;;N;;;;;
+1D959;SIGNWRITING MOVEMENT-DIAGONAL TOWARDS SMALL;So;0;L;;;;;N;;;;;
+1D95A;SIGNWRITING MOVEMENT-DIAGONAL TOWARDS MEDIUM;So;0;L;;;;;N;;;;;
+1D95B;SIGNWRITING MOVEMENT-DIAGONAL TOWARDS LARGE;So;0;L;;;;;N;;;;;
+1D95C;SIGNWRITING MOVEMENT-DIAGONAL TOWARDS LARGEST;So;0;L;;;;;N;;;;;
+1D95D;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN AWAY SMALL;So;0;L;;;;;N;;;;;
+1D95E;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN AWAY MEDIUM;So;0;L;;;;;N;;;;;
+1D95F;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN AWAY LARGE;So;0;L;;;;;N;;;;;
+1D960;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN AWAY LARGEST;So;0;L;;;;;N;;;;;
+1D961;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN TOWARDS SMALL;So;0;L;;;;;N;;;;;
+1D962;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN TOWARDS MEDIUM;So;0;L;;;;;N;;;;;
+1D963;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN TOWARDS LARGE;So;0;L;;;;;N;;;;;
+1D964;SIGNWRITING MOVEMENT-DIAGONAL BETWEEN TOWARDS LARGEST;So;0;L;;;;;N;;;;;
+1D965;SIGNWRITING MOVEMENT-FLOORPLANE SINGLE STRAIGHT SMALL;So;0;L;;;;;N;;;;;
+1D966;SIGNWRITING MOVEMENT-FLOORPLANE SINGLE STRAIGHT MEDIUM;So;0;L;;;;;N;;;;;
+1D967;SIGNWRITING MOVEMENT-FLOORPLANE SINGLE STRAIGHT LARGE;So;0;L;;;;;N;;;;;
+1D968;SIGNWRITING MOVEMENT-FLOORPLANE SINGLE STRAIGHT LARGEST;So;0;L;;;;;N;;;;;
+1D969;SIGNWRITING MOVEMENT-FLOORPLANE SINGLE WRIST FLEX;So;0;L;;;;;N;;;;;
+1D96A;SIGNWRITING MOVEMENT-FLOORPLANE DOUBLE STRAIGHT;So;0;L;;;;;N;;;;;
+1D96B;SIGNWRITING MOVEMENT-FLOORPLANE DOUBLE WRIST FLEX;So;0;L;;;;;N;;;;;
+1D96C;SIGNWRITING MOVEMENT-FLOORPLANE DOUBLE ALTERNATING;So;0;L;;;;;N;;;;;
+1D96D;SIGNWRITING MOVEMENT-FLOORPLANE DOUBLE ALTERNATING WRIST FLEX;So;0;L;;;;;N;;;;;
+1D96E;SIGNWRITING MOVEMENT-FLOORPLANE CROSS;So;0;L;;;;;N;;;;;
+1D96F;SIGNWRITING MOVEMENT-FLOORPLANE TRIPLE STRAIGHT MOVEMENT;So;0;L;;;;;N;;;;;
+1D970;SIGNWRITING MOVEMENT-FLOORPLANE TRIPLE WRIST FLEX;So;0;L;;;;;N;;;;;
+1D971;SIGNWRITING MOVEMENT-FLOORPLANE TRIPLE ALTERNATING MOVEMENT;So;0;L;;;;;N;;;;;
+1D972;SIGNWRITING MOVEMENT-FLOORPLANE TRIPLE ALTERNATING WRIST FLEX;So;0;L;;;;;N;;;;;
+1D973;SIGNWRITING MOVEMENT-FLOORPLANE BEND;So;0;L;;;;;N;;;;;
+1D974;SIGNWRITING MOVEMENT-FLOORPLANE CORNER SMALL;So;0;L;;;;;N;;;;;
+1D975;SIGNWRITING MOVEMENT-FLOORPLANE CORNER MEDIUM;So;0;L;;;;;N;;;;;
+1D976;SIGNWRITING MOVEMENT-FLOORPLANE CORNER LARGE;So;0;L;;;;;N;;;;;
+1D977;SIGNWRITING MOVEMENT-FLOORPLANE CHECK;So;0;L;;;;;N;;;;;
+1D978;SIGNWRITING MOVEMENT-FLOORPLANE BOX SMALL;So;0;L;;;;;N;;;;;
+1D979;SIGNWRITING MOVEMENT-FLOORPLANE BOX MEDIUM;So;0;L;;;;;N;;;;;
+1D97A;SIGNWRITING MOVEMENT-FLOORPLANE BOX LARGE;So;0;L;;;;;N;;;;;
+1D97B;SIGNWRITING MOVEMENT-FLOORPLANE ZIGZAG SMALL;So;0;L;;;;;N;;;;;
+1D97C;SIGNWRITING MOVEMENT-FLOORPLANE ZIGZAG MEDIUM;So;0;L;;;;;N;;;;;
+1D97D;SIGNWRITING MOVEMENT-FLOORPLANE ZIGZAG LARGE;So;0;L;;;;;N;;;;;
+1D97E;SIGNWRITING MOVEMENT-FLOORPLANE PEAKS SMALL;So;0;L;;;;;N;;;;;
+1D97F;SIGNWRITING MOVEMENT-FLOORPLANE PEAKS MEDIUM;So;0;L;;;;;N;;;;;
+1D980;SIGNWRITING MOVEMENT-FLOORPLANE PEAKS LARGE;So;0;L;;;;;N;;;;;
+1D981;SIGNWRITING TRAVEL-FLOORPLANE ROTATION-FLOORPLANE SINGLE;So;0;L;;;;;N;;;;;
+1D982;SIGNWRITING TRAVEL-FLOORPLANE ROTATION-FLOORPLANE DOUBLE;So;0;L;;;;;N;;;;;
+1D983;SIGNWRITING TRAVEL-FLOORPLANE ROTATION-FLOORPLANE ALTERNATING;So;0;L;;;;;N;;;;;
+1D984;SIGNWRITING TRAVEL-FLOORPLANE ROTATION-WALLPLANE SINGLE;So;0;L;;;;;N;;;;;
+1D985;SIGNWRITING TRAVEL-FLOORPLANE ROTATION-WALLPLANE DOUBLE;So;0;L;;;;;N;;;;;
+1D986;SIGNWRITING TRAVEL-FLOORPLANE ROTATION-WALLPLANE ALTERNATING;So;0;L;;;;;N;;;;;
+1D987;SIGNWRITING TRAVEL-FLOORPLANE SHAKING;So;0;L;;;;;N;;;;;
+1D988;SIGNWRITING MOVEMENT-WALLPLANE CURVE QUARTER SMALL;So;0;L;;;;;N;;;;;
+1D989;SIGNWRITING MOVEMENT-WALLPLANE CURVE QUARTER MEDIUM;So;0;L;;;;;N;;;;;
+1D98A;SIGNWRITING MOVEMENT-WALLPLANE CURVE QUARTER LARGE;So;0;L;;;;;N;;;;;
+1D98B;SIGNWRITING MOVEMENT-WALLPLANE CURVE QUARTER LARGEST;So;0;L;;;;;N;;;;;
+1D98C;SIGNWRITING MOVEMENT-WALLPLANE CURVE HALF-CIRCLE SMALL;So;0;L;;;;;N;;;;;
+1D98D;SIGNWRITING MOVEMENT-WALLPLANE CURVE HALF-CIRCLE MEDIUM;So;0;L;;;;;N;;;;;
+1D98E;SIGNWRITING MOVEMENT-WALLPLANE CURVE HALF-CIRCLE LARGE;So;0;L;;;;;N;;;;;
+1D98F;SIGNWRITING MOVEMENT-WALLPLANE CURVE HALF-CIRCLE LARGEST;So;0;L;;;;;N;;;;;
+1D990;SIGNWRITING MOVEMENT-WALLPLANE CURVE THREE-QUARTER CIRCLE SMALL;So;0;L;;;;;N;;;;;
+1D991;SIGNWRITING MOVEMENT-WALLPLANE CURVE THREE-QUARTER CIRCLE MEDIUM;So;0;L;;;;;N;;;;;
+1D992;SIGNWRITING MOVEMENT-WALLPLANE HUMP SMALL;So;0;L;;;;;N;;;;;
+1D993;SIGNWRITING MOVEMENT-WALLPLANE HUMP MEDIUM;So;0;L;;;;;N;;;;;
+1D994;SIGNWRITING MOVEMENT-WALLPLANE HUMP LARGE;So;0;L;;;;;N;;;;;
+1D995;SIGNWRITING MOVEMENT-WALLPLANE LOOP SMALL;So;0;L;;;;;N;;;;;
+1D996;SIGNWRITING MOVEMENT-WALLPLANE LOOP MEDIUM;So;0;L;;;;;N;;;;;
+1D997;SIGNWRITING MOVEMENT-WALLPLANE LOOP LARGE;So;0;L;;;;;N;;;;;
+1D998;SIGNWRITING MOVEMENT-WALLPLANE LOOP SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D999;SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE DOUBLE SMALL;So;0;L;;;;;N;;;;;
+1D99A;SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE DOUBLE MEDIUM;So;0;L;;;;;N;;;;;
+1D99B;SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE DOUBLE LARGE;So;0;L;;;;;N;;;;;
+1D99C;SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE TRIPLE SMALL;So;0;L;;;;;N;;;;;
+1D99D;SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE TRIPLE MEDIUM;So;0;L;;;;;N;;;;;
+1D99E;SIGNWRITING MOVEMENT-WALLPLANE WAVE CURVE TRIPLE LARGE;So;0;L;;;;;N;;;;;
+1D99F;SIGNWRITING MOVEMENT-WALLPLANE CURVE THEN STRAIGHT;So;0;L;;;;;N;;;;;
+1D9A0;SIGNWRITING MOVEMENT-WALLPLANE CURVED CROSS SMALL;So;0;L;;;;;N;;;;;
+1D9A1;SIGNWRITING MOVEMENT-WALLPLANE CURVED CROSS MEDIUM;So;0;L;;;;;N;;;;;
+1D9A2;SIGNWRITING ROTATION-WALLPLANE SINGLE;So;0;L;;;;;N;;;;;
+1D9A3;SIGNWRITING ROTATION-WALLPLANE DOUBLE;So;0;L;;;;;N;;;;;
+1D9A4;SIGNWRITING ROTATION-WALLPLANE ALTERNATE;So;0;L;;;;;N;;;;;
+1D9A5;SIGNWRITING MOVEMENT-WALLPLANE SHAKING;So;0;L;;;;;N;;;;;
+1D9A6;SIGNWRITING MOVEMENT-WALLPLANE CURVE HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9A7;SIGNWRITING MOVEMENT-WALLPLANE HUMP HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9A8;SIGNWRITING MOVEMENT-WALLPLANE LOOP HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9A9;SIGNWRITING MOVEMENT-WALLPLANE WAVE HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9AA;SIGNWRITING ROTATION-WALLPLANE SINGLE HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9AB;SIGNWRITING ROTATION-WALLPLANE DOUBLE HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9AC;SIGNWRITING ROTATION-WALLPLANE ALTERNATING HITTING FRONT WALL;So;0;L;;;;;N;;;;;
+1D9AD;SIGNWRITING MOVEMENT-WALLPLANE CURVE HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9AE;SIGNWRITING MOVEMENT-WALLPLANE HUMP HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9AF;SIGNWRITING MOVEMENT-WALLPLANE LOOP HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9B0;SIGNWRITING MOVEMENT-WALLPLANE WAVE HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9B1;SIGNWRITING ROTATION-WALLPLANE SINGLE HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9B2;SIGNWRITING ROTATION-WALLPLANE DOUBLE HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9B3;SIGNWRITING ROTATION-WALLPLANE ALTERNATING HITTING CHEST;So;0;L;;;;;N;;;;;
+1D9B4;SIGNWRITING MOVEMENT-WALLPLANE WAVE DIAGONAL PATH SMALL;So;0;L;;;;;N;;;;;
+1D9B5;SIGNWRITING MOVEMENT-WALLPLANE WAVE DIAGONAL PATH MEDIUM;So;0;L;;;;;N;;;;;
+1D9B6;SIGNWRITING MOVEMENT-WALLPLANE WAVE DIAGONAL PATH LARGE;So;0;L;;;;;N;;;;;
+1D9B7;SIGNWRITING MOVEMENT-FLOORPLANE CURVE HITTING CEILING SMALL;So;0;L;;;;;N;;;;;
+1D9B8;SIGNWRITING MOVEMENT-FLOORPLANE CURVE HITTING CEILING LARGE;So;0;L;;;;;N;;;;;
+1D9B9;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING CEILING SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9BA;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING CEILING LARGE DOUBLE;So;0;L;;;;;N;;;;;
+1D9BB;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING CEILING SMALL TRIPLE;So;0;L;;;;;N;;;;;
+1D9BC;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING CEILING LARGE TRIPLE;So;0;L;;;;;N;;;;;
+1D9BD;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING CEILING SMALL SINGLE;So;0;L;;;;;N;;;;;
+1D9BE;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING CEILING LARGE SINGLE;So;0;L;;;;;N;;;;;
+1D9BF;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING CEILING SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9C0;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING CEILING LARGE DOUBLE;So;0;L;;;;;N;;;;;
+1D9C1;SIGNWRITING MOVEMENT-FLOORPLANE WAVE HITTING CEILING SMALL;So;0;L;;;;;N;;;;;
+1D9C2;SIGNWRITING MOVEMENT-FLOORPLANE WAVE HITTING CEILING LARGE;So;0;L;;;;;N;;;;;
+1D9C3;SIGNWRITING ROTATION-FLOORPLANE SINGLE HITTING CEILING;So;0;L;;;;;N;;;;;
+1D9C4;SIGNWRITING ROTATION-FLOORPLANE DOUBLE HITTING CEILING;So;0;L;;;;;N;;;;;
+1D9C5;SIGNWRITING ROTATION-FLOORPLANE ALTERNATING HITTING CEILING;So;0;L;;;;;N;;;;;
+1D9C6;SIGNWRITING MOVEMENT-FLOORPLANE CURVE HITTING FLOOR SMALL;So;0;L;;;;;N;;;;;
+1D9C7;SIGNWRITING MOVEMENT-FLOORPLANE CURVE HITTING FLOOR LARGE;So;0;L;;;;;N;;;;;
+1D9C8;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING FLOOR SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9C9;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING FLOOR LARGE DOUBLE;So;0;L;;;;;N;;;;;
+1D9CA;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING FLOOR TRIPLE SMALL TRIPLE;So;0;L;;;;;N;;;;;
+1D9CB;SIGNWRITING MOVEMENT-FLOORPLANE HUMP HITTING FLOOR TRIPLE LARGE TRIPLE;So;0;L;;;;;N;;;;;
+1D9CC;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING FLOOR SMALL SINGLE;So;0;L;;;;;N;;;;;
+1D9CD;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING FLOOR LARGE SINGLE;So;0;L;;;;;N;;;;;
+1D9CE;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING FLOOR SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9CF;SIGNWRITING MOVEMENT-FLOORPLANE LOOP HITTING FLOOR LARGE DOUBLE;So;0;L;;;;;N;;;;;
+1D9D0;SIGNWRITING MOVEMENT-FLOORPLANE WAVE HITTING FLOOR SMALL;So;0;L;;;;;N;;;;;
+1D9D1;SIGNWRITING MOVEMENT-FLOORPLANE WAVE HITTING FLOOR LARGE;So;0;L;;;;;N;;;;;
+1D9D2;SIGNWRITING ROTATION-FLOORPLANE SINGLE HITTING FLOOR;So;0;L;;;;;N;;;;;
+1D9D3;SIGNWRITING ROTATION-FLOORPLANE DOUBLE HITTING FLOOR;So;0;L;;;;;N;;;;;
+1D9D4;SIGNWRITING ROTATION-FLOORPLANE ALTERNATING HITTING FLOOR;So;0;L;;;;;N;;;;;
+1D9D5;SIGNWRITING MOVEMENT-FLOORPLANE CURVE SMALL;So;0;L;;;;;N;;;;;
+1D9D6;SIGNWRITING MOVEMENT-FLOORPLANE CURVE MEDIUM;So;0;L;;;;;N;;;;;
+1D9D7;SIGNWRITING MOVEMENT-FLOORPLANE CURVE LARGE;So;0;L;;;;;N;;;;;
+1D9D8;SIGNWRITING MOVEMENT-FLOORPLANE CURVE LARGEST;So;0;L;;;;;N;;;;;
+1D9D9;SIGNWRITING MOVEMENT-FLOORPLANE CURVE COMBINED;So;0;L;;;;;N;;;;;
+1D9DA;SIGNWRITING MOVEMENT-FLOORPLANE HUMP SMALL;So;0;L;;;;;N;;;;;
+1D9DB;SIGNWRITING MOVEMENT-FLOORPLANE LOOP SMALL;So;0;L;;;;;N;;;;;
+1D9DC;SIGNWRITING MOVEMENT-FLOORPLANE WAVE SNAKE;So;0;L;;;;;N;;;;;
+1D9DD;SIGNWRITING MOVEMENT-FLOORPLANE WAVE SMALL;So;0;L;;;;;N;;;;;
+1D9DE;SIGNWRITING MOVEMENT-FLOORPLANE WAVE LARGE;So;0;L;;;;;N;;;;;
+1D9DF;SIGNWRITING ROTATION-FLOORPLANE SINGLE;So;0;L;;;;;N;;;;;
+1D9E0;SIGNWRITING ROTATION-FLOORPLANE DOUBLE;So;0;L;;;;;N;;;;;
+1D9E1;SIGNWRITING ROTATION-FLOORPLANE ALTERNATING;So;0;L;;;;;N;;;;;
+1D9E2;SIGNWRITING MOVEMENT-FLOORPLANE SHAKING PARALLEL;So;0;L;;;;;N;;;;;
+1D9E3;SIGNWRITING MOVEMENT-WALLPLANE ARM CIRCLE SMALL SINGLE;So;0;L;;;;;N;;;;;
+1D9E4;SIGNWRITING MOVEMENT-WALLPLANE ARM CIRCLE MEDIUM SINGLE;So;0;L;;;;;N;;;;;
+1D9E5;SIGNWRITING MOVEMENT-WALLPLANE ARM CIRCLE SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9E6;SIGNWRITING MOVEMENT-WALLPLANE ARM CIRCLE MEDIUM DOUBLE;So;0;L;;;;;N;;;;;
+1D9E7;SIGNWRITING MOVEMENT-FLOORPLANE ARM CIRCLE HITTING WALL SMALL SINGLE;So;0;L;;;;;N;;;;;
+1D9E8;SIGNWRITING MOVEMENT-FLOORPLANE ARM CIRCLE HITTING WALL MEDIUM SINGLE;So;0;L;;;;;N;;;;;
+1D9E9;SIGNWRITING MOVEMENT-FLOORPLANE ARM CIRCLE HITTING WALL LARGE SINGLE;So;0;L;;;;;N;;;;;
+1D9EA;SIGNWRITING MOVEMENT-FLOORPLANE ARM CIRCLE HITTING WALL SMALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9EB;SIGNWRITING MOVEMENT-FLOORPLANE ARM CIRCLE HITTING WALL MEDIUM DOUBLE;So;0;L;;;;;N;;;;;
+1D9EC;SIGNWRITING MOVEMENT-FLOORPLANE ARM CIRCLE HITTING WALL LARGE DOUBLE;So;0;L;;;;;N;;;;;
+1D9ED;SIGNWRITING MOVEMENT-WALLPLANE WRIST CIRCLE FRONT SINGLE;So;0;L;;;;;N;;;;;
+1D9EE;SIGNWRITING MOVEMENT-WALLPLANE WRIST CIRCLE FRONT DOUBLE;So;0;L;;;;;N;;;;;
+1D9EF;SIGNWRITING MOVEMENT-FLOORPLANE WRIST CIRCLE HITTING WALL SINGLE;So;0;L;;;;;N;;;;;
+1D9F0;SIGNWRITING MOVEMENT-FLOORPLANE WRIST CIRCLE HITTING WALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9F1;SIGNWRITING MOVEMENT-WALLPLANE FINGER CIRCLES SINGLE;So;0;L;;;;;N;;;;;
+1D9F2;SIGNWRITING MOVEMENT-WALLPLANE FINGER CIRCLES DOUBLE;So;0;L;;;;;N;;;;;
+1D9F3;SIGNWRITING MOVEMENT-FLOORPLANE FINGER CIRCLES HITTING WALL SINGLE;So;0;L;;;;;N;;;;;
+1D9F4;SIGNWRITING MOVEMENT-FLOORPLANE FINGER CIRCLES HITTING WALL DOUBLE;So;0;L;;;;;N;;;;;
+1D9F5;SIGNWRITING DYNAMIC ARROWHEAD SMALL;So;0;L;;;;;N;;;;;
+1D9F6;SIGNWRITING DYNAMIC ARROWHEAD LARGE;So;0;L;;;;;N;;;;;
+1D9F7;SIGNWRITING DYNAMIC FAST;So;0;L;;;;;N;;;;;
+1D9F8;SIGNWRITING DYNAMIC SLOW;So;0;L;;;;;N;;;;;
+1D9F9;SIGNWRITING DYNAMIC TENSE;So;0;L;;;;;N;;;;;
+1D9FA;SIGNWRITING DYNAMIC RELAXED;So;0;L;;;;;N;;;;;
+1D9FB;SIGNWRITING DYNAMIC SIMULTANEOUS;So;0;L;;;;;N;;;;;
+1D9FC;SIGNWRITING DYNAMIC SIMULTANEOUS ALTERNATING;So;0;L;;;;;N;;;;;
+1D9FD;SIGNWRITING DYNAMIC EVERY OTHER TIME;So;0;L;;;;;N;;;;;
+1D9FE;SIGNWRITING DYNAMIC GRADUAL;So;0;L;;;;;N;;;;;
+1D9FF;SIGNWRITING HEAD;So;0;L;;;;;N;;;;;
+1DA00;SIGNWRITING HEAD RIM;Mn;0;NSM;;;;;N;;;;;
+1DA01;SIGNWRITING HEAD MOVEMENT-WALLPLANE STRAIGHT;Mn;0;NSM;;;;;N;;;;;
+1DA02;SIGNWRITING HEAD MOVEMENT-WALLPLANE TILT;Mn;0;NSM;;;;;N;;;;;
+1DA03;SIGNWRITING HEAD MOVEMENT-FLOORPLANE STRAIGHT;Mn;0;NSM;;;;;N;;;;;
+1DA04;SIGNWRITING HEAD MOVEMENT-WALLPLANE CURVE;Mn;0;NSM;;;;;N;;;;;
+1DA05;SIGNWRITING HEAD MOVEMENT-FLOORPLANE CURVE;Mn;0;NSM;;;;;N;;;;;
+1DA06;SIGNWRITING HEAD MOVEMENT CIRCLE;Mn;0;NSM;;;;;N;;;;;
+1DA07;SIGNWRITING FACE DIRECTION POSITION NOSE FORWARD TILTING;Mn;0;NSM;;;;;N;;;;;
+1DA08;SIGNWRITING FACE DIRECTION POSITION NOSE UP OR DOWN;Mn;0;NSM;;;;;N;;;;;
+1DA09;SIGNWRITING FACE DIRECTION POSITION NOSE UP OR DOWN TILTING;Mn;0;NSM;;;;;N;;;;;
+1DA0A;SIGNWRITING EYEBROWS STRAIGHT UP;Mn;0;NSM;;;;;N;;;;;
+1DA0B;SIGNWRITING EYEBROWS STRAIGHT NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA0C;SIGNWRITING EYEBROWS STRAIGHT DOWN;Mn;0;NSM;;;;;N;;;;;
+1DA0D;SIGNWRITING DREAMY EYEBROWS NEUTRAL DOWN;Mn;0;NSM;;;;;N;;;;;
+1DA0E;SIGNWRITING DREAMY EYEBROWS DOWN NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA0F;SIGNWRITING DREAMY EYEBROWS UP NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA10;SIGNWRITING DREAMY EYEBROWS NEUTRAL UP;Mn;0;NSM;;;;;N;;;;;
+1DA11;SIGNWRITING FOREHEAD NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA12;SIGNWRITING FOREHEAD CONTACT;Mn;0;NSM;;;;;N;;;;;
+1DA13;SIGNWRITING FOREHEAD WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA14;SIGNWRITING EYES OPEN;Mn;0;NSM;;;;;N;;;;;
+1DA15;SIGNWRITING EYES SQUEEZED;Mn;0;NSM;;;;;N;;;;;
+1DA16;SIGNWRITING EYES CLOSED;Mn;0;NSM;;;;;N;;;;;
+1DA17;SIGNWRITING EYE BLINK SINGLE;Mn;0;NSM;;;;;N;;;;;
+1DA18;SIGNWRITING EYE BLINK MULTIPLE;Mn;0;NSM;;;;;N;;;;;
+1DA19;SIGNWRITING EYES HALF OPEN;Mn;0;NSM;;;;;N;;;;;
+1DA1A;SIGNWRITING EYES WIDE OPEN;Mn;0;NSM;;;;;N;;;;;
+1DA1B;SIGNWRITING EYES HALF CLOSED;Mn;0;NSM;;;;;N;;;;;
+1DA1C;SIGNWRITING EYES WIDENING MOVEMENT;Mn;0;NSM;;;;;N;;;;;
+1DA1D;SIGNWRITING EYE WINK;Mn;0;NSM;;;;;N;;;;;
+1DA1E;SIGNWRITING EYELASHES UP;Mn;0;NSM;;;;;N;;;;;
+1DA1F;SIGNWRITING EYELASHES DOWN;Mn;0;NSM;;;;;N;;;;;
+1DA20;SIGNWRITING EYELASHES FLUTTERING;Mn;0;NSM;;;;;N;;;;;
+1DA21;SIGNWRITING EYEGAZE-WALLPLANE STRAIGHT;Mn;0;NSM;;;;;N;;;;;
+1DA22;SIGNWRITING EYEGAZE-WALLPLANE STRAIGHT DOUBLE;Mn;0;NSM;;;;;N;;;;;
+1DA23;SIGNWRITING EYEGAZE-WALLPLANE STRAIGHT ALTERNATING;Mn;0;NSM;;;;;N;;;;;
+1DA24;SIGNWRITING EYEGAZE-FLOORPLANE STRAIGHT;Mn;0;NSM;;;;;N;;;;;
+1DA25;SIGNWRITING EYEGAZE-FLOORPLANE STRAIGHT DOUBLE;Mn;0;NSM;;;;;N;;;;;
+1DA26;SIGNWRITING EYEGAZE-FLOORPLANE STRAIGHT ALTERNATING;Mn;0;NSM;;;;;N;;;;;
+1DA27;SIGNWRITING EYEGAZE-WALLPLANE CURVED;Mn;0;NSM;;;;;N;;;;;
+1DA28;SIGNWRITING EYEGAZE-FLOORPLANE CURVED;Mn;0;NSM;;;;;N;;;;;
+1DA29;SIGNWRITING EYEGAZE-WALLPLANE CIRCLING;Mn;0;NSM;;;;;N;;;;;
+1DA2A;SIGNWRITING CHEEKS PUFFED;Mn;0;NSM;;;;;N;;;;;
+1DA2B;SIGNWRITING CHEEKS NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA2C;SIGNWRITING CHEEKS SUCKED;Mn;0;NSM;;;;;N;;;;;
+1DA2D;SIGNWRITING TENSE CHEEKS HIGH;Mn;0;NSM;;;;;N;;;;;
+1DA2E;SIGNWRITING TENSE CHEEKS MIDDLE;Mn;0;NSM;;;;;N;;;;;
+1DA2F;SIGNWRITING TENSE CHEEKS LOW;Mn;0;NSM;;;;;N;;;;;
+1DA30;SIGNWRITING EARS;Mn;0;NSM;;;;;N;;;;;
+1DA31;SIGNWRITING NOSE NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA32;SIGNWRITING NOSE CONTACT;Mn;0;NSM;;;;;N;;;;;
+1DA33;SIGNWRITING NOSE WRINKLES;Mn;0;NSM;;;;;N;;;;;
+1DA34;SIGNWRITING NOSE WIGGLES;Mn;0;NSM;;;;;N;;;;;
+1DA35;SIGNWRITING AIR BLOWING OUT;Mn;0;NSM;;;;;N;;;;;
+1DA36;SIGNWRITING AIR SUCKING IN;Mn;0;NSM;;;;;N;;;;;
+1DA37;SIGNWRITING AIR BLOW SMALL ROTATIONS;So;0;L;;;;;N;;;;;
+1DA38;SIGNWRITING AIR SUCK SMALL ROTATIONS;So;0;L;;;;;N;;;;;
+1DA39;SIGNWRITING BREATH INHALE;So;0;L;;;;;N;;;;;
+1DA3A;SIGNWRITING BREATH EXHALE;So;0;L;;;;;N;;;;;
+1DA3B;SIGNWRITING MOUTH CLOSED NEUTRAL;Mn;0;NSM;;;;;N;;;;;
+1DA3C;SIGNWRITING MOUTH CLOSED FORWARD;Mn;0;NSM;;;;;N;;;;;
+1DA3D;SIGNWRITING MOUTH CLOSED CONTACT;Mn;0;NSM;;;;;N;;;;;
+1DA3E;SIGNWRITING MOUTH SMILE;Mn;0;NSM;;;;;N;;;;;
+1DA3F;SIGNWRITING MOUTH SMILE WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA40;SIGNWRITING MOUTH SMILE OPEN;Mn;0;NSM;;;;;N;;;;;
+1DA41;SIGNWRITING MOUTH FROWN;Mn;0;NSM;;;;;N;;;;;
+1DA42;SIGNWRITING MOUTH FROWN WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA43;SIGNWRITING MOUTH FROWN OPEN;Mn;0;NSM;;;;;N;;;;;
+1DA44;SIGNWRITING MOUTH OPEN CIRCLE;Mn;0;NSM;;;;;N;;;;;
+1DA45;SIGNWRITING MOUTH OPEN FORWARD;Mn;0;NSM;;;;;N;;;;;
+1DA46;SIGNWRITING MOUTH OPEN WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA47;SIGNWRITING MOUTH OPEN OVAL;Mn;0;NSM;;;;;N;;;;;
+1DA48;SIGNWRITING MOUTH OPEN OVAL WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA49;SIGNWRITING MOUTH OPEN OVAL YAWN;Mn;0;NSM;;;;;N;;;;;
+1DA4A;SIGNWRITING MOUTH OPEN RECTANGLE;Mn;0;NSM;;;;;N;;;;;
+1DA4B;SIGNWRITING MOUTH OPEN RECTANGLE WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA4C;SIGNWRITING MOUTH OPEN RECTANGLE YAWN;Mn;0;NSM;;;;;N;;;;;
+1DA4D;SIGNWRITING MOUTH KISS;Mn;0;NSM;;;;;N;;;;;
+1DA4E;SIGNWRITING MOUTH KISS FORWARD;Mn;0;NSM;;;;;N;;;;;
+1DA4F;SIGNWRITING MOUTH KISS WRINKLED;Mn;0;NSM;;;;;N;;;;;
+1DA50;SIGNWRITING MOUTH TENSE;Mn;0;NSM;;;;;N;;;;;
+1DA51;SIGNWRITING MOUTH TENSE FORWARD;Mn;0;NSM;;;;;N;;;;;
+1DA52;SIGNWRITING MOUTH TENSE SUCKED;Mn;0;NSM;;;;;N;;;;;
+1DA53;SIGNWRITING LIPS PRESSED TOGETHER;Mn;0;NSM;;;;;N;;;;;
+1DA54;SIGNWRITING LIP LOWER OVER UPPER;Mn;0;NSM;;;;;N;;;;;
+1DA55;SIGNWRITING LIP UPPER OVER LOWER;Mn;0;NSM;;;;;N;;;;;
+1DA56;SIGNWRITING MOUTH CORNERS;Mn;0;NSM;;;;;N;;;;;
+1DA57;SIGNWRITING MOUTH WRINKLES SINGLE;Mn;0;NSM;;;;;N;;;;;
+1DA58;SIGNWRITING MOUTH WRINKLES DOUBLE;Mn;0;NSM;;;;;N;;;;;
+1DA59;SIGNWRITING TONGUE STICKING OUT FAR;Mn;0;NSM;;;;;N;;;;;
+1DA5A;SIGNWRITING TONGUE LICKING LIPS;Mn;0;NSM;;;;;N;;;;;
+1DA5B;SIGNWRITING TONGUE TIP BETWEEN LIPS;Mn;0;NSM;;;;;N;;;;;
+1DA5C;SIGNWRITING TONGUE TIP TOUCHING INSIDE MOUTH;Mn;0;NSM;;;;;N;;;;;
+1DA5D;SIGNWRITING TONGUE INSIDE MOUTH RELAXED;Mn;0;NSM;;;;;N;;;;;
+1DA5E;SIGNWRITING TONGUE MOVES AGAINST CHEEK;Mn;0;NSM;;;;;N;;;;;
+1DA5F;SIGNWRITING TONGUE CENTRE STICKING OUT;Mn;0;NSM;;;;;N;;;;;
+1DA60;SIGNWRITING TONGUE CENTRE INSIDE MOUTH;Mn;0;NSM;;;;;N;;;;;
+1DA61;SIGNWRITING TEETH;Mn;0;NSM;;;;;N;;;;;
+1DA62;SIGNWRITING TEETH MOVEMENT;Mn;0;NSM;;;;;N;;;;;
+1DA63;SIGNWRITING TEETH ON TONGUE;Mn;0;NSM;;;;;N;;;;;
+1DA64;SIGNWRITING TEETH ON TONGUE MOVEMENT;Mn;0;NSM;;;;;N;;;;;
+1DA65;SIGNWRITING TEETH ON LIPS;Mn;0;NSM;;;;;N;;;;;
+1DA66;SIGNWRITING TEETH ON LIPS MOVEMENT;Mn;0;NSM;;;;;N;;;;;
+1DA67;SIGNWRITING TEETH BITE LIPS;Mn;0;NSM;;;;;N;;;;;
+1DA68;SIGNWRITING MOVEMENT-WALLPLANE JAW;Mn;0;NSM;;;;;N;;;;;
+1DA69;SIGNWRITING MOVEMENT-FLOORPLANE JAW;Mn;0;NSM;;;;;N;;;;;
+1DA6A;SIGNWRITING NECK;Mn;0;NSM;;;;;N;;;;;
+1DA6B;SIGNWRITING HAIR;Mn;0;NSM;;;;;N;;;;;
+1DA6C;SIGNWRITING EXCITEMENT;Mn;0;NSM;;;;;N;;;;;
+1DA6D;SIGNWRITING SHOULDER HIP SPINE;So;0;L;;;;;N;;;;;
+1DA6E;SIGNWRITING SHOULDER HIP POSITIONS;So;0;L;;;;;N;;;;;
+1DA6F;SIGNWRITING WALLPLANE SHOULDER HIP MOVE;So;0;L;;;;;N;;;;;
+1DA70;SIGNWRITING FLOORPLANE SHOULDER HIP MOVE;So;0;L;;;;;N;;;;;
+1DA71;SIGNWRITING SHOULDER TILTING FROM WAIST;So;0;L;;;;;N;;;;;
+1DA72;SIGNWRITING TORSO-WALLPLANE STRAIGHT STRETCH;So;0;L;;;;;N;;;;;
+1DA73;SIGNWRITING TORSO-WALLPLANE CURVED BEND;So;0;L;;;;;N;;;;;
+1DA74;SIGNWRITING TORSO-FLOORPLANE TWISTING;So;0;L;;;;;N;;;;;
+1DA75;SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS;Mn;0;NSM;;;;;N;;;;;
+1DA76;SIGNWRITING LIMB COMBINATION;So;0;L;;;;;N;;;;;
+1DA77;SIGNWRITING LIMB LENGTH-1;So;0;L;;;;;N;;;;;
+1DA78;SIGNWRITING LIMB LENGTH-2;So;0;L;;;;;N;;;;;
+1DA79;SIGNWRITING LIMB LENGTH-3;So;0;L;;;;;N;;;;;
+1DA7A;SIGNWRITING LIMB LENGTH-4;So;0;L;;;;;N;;;;;
+1DA7B;SIGNWRITING LIMB LENGTH-5;So;0;L;;;;;N;;;;;
+1DA7C;SIGNWRITING LIMB LENGTH-6;So;0;L;;;;;N;;;;;
+1DA7D;SIGNWRITING LIMB LENGTH-7;So;0;L;;;;;N;;;;;
+1DA7E;SIGNWRITING FINGER;So;0;L;;;;;N;;;;;
+1DA7F;SIGNWRITING LOCATION-WALLPLANE SPACE;So;0;L;;;;;N;;;;;
+1DA80;SIGNWRITING LOCATION-FLOORPLANE SPACE;So;0;L;;;;;N;;;;;
+1DA81;SIGNWRITING LOCATION HEIGHT;So;0;L;;;;;N;;;;;
+1DA82;SIGNWRITING LOCATION WIDTH;So;0;L;;;;;N;;;;;
+1DA83;SIGNWRITING LOCATION DEPTH;So;0;L;;;;;N;;;;;
+1DA84;SIGNWRITING LOCATION HEAD NECK;Mn;0;NSM;;;;;N;;;;;
+1DA85;SIGNWRITING LOCATION TORSO;So;0;L;;;;;N;;;;;
+1DA86;SIGNWRITING LOCATION LIMBS DIGITS;So;0;L;;;;;N;;;;;
+1DA87;SIGNWRITING COMMA;Po;0;L;;;;;N;;;;;
+1DA88;SIGNWRITING FULL STOP;Po;0;L;;;;;N;;;;;
+1DA89;SIGNWRITING SEMICOLON;Po;0;L;;;;;N;;;;;
+1DA8A;SIGNWRITING COLON;Po;0;L;;;;;N;;;;;
+1DA8B;SIGNWRITING PARENTHESIS;Po;0;L;;;;;N;;;;;
+1DA9B;SIGNWRITING FILL MODIFIER-2;Mn;0;NSM;;;;;N;;;;;
+1DA9C;SIGNWRITING FILL MODIFIER-3;Mn;0;NSM;;;;;N;;;;;
+1DA9D;SIGNWRITING FILL MODIFIER-4;Mn;0;NSM;;;;;N;;;;;
+1DA9E;SIGNWRITING FILL MODIFIER-5;Mn;0;NSM;;;;;N;;;;;
+1DA9F;SIGNWRITING FILL MODIFIER-6;Mn;0;NSM;;;;;N;;;;;
+1DAA1;SIGNWRITING ROTATION MODIFIER-2;Mn;0;NSM;;;;;N;;;;;
+1DAA2;SIGNWRITING ROTATION MODIFIER-3;Mn;0;NSM;;;;;N;;;;;
+1DAA3;SIGNWRITING ROTATION MODIFIER-4;Mn;0;NSM;;;;;N;;;;;
+1DAA4;SIGNWRITING ROTATION MODIFIER-5;Mn;0;NSM;;;;;N;;;;;
+1DAA5;SIGNWRITING ROTATION MODIFIER-6;Mn;0;NSM;;;;;N;;;;;
+1DAA6;SIGNWRITING ROTATION MODIFIER-7;Mn;0;NSM;;;;;N;;;;;
+1DAA7;SIGNWRITING ROTATION MODIFIER-8;Mn;0;NSM;;;;;N;;;;;
+1DAA8;SIGNWRITING ROTATION MODIFIER-9;Mn;0;NSM;;;;;N;;;;;
+1DAA9;SIGNWRITING ROTATION MODIFIER-10;Mn;0;NSM;;;;;N;;;;;
+1DAAA;SIGNWRITING ROTATION MODIFIER-11;Mn;0;NSM;;;;;N;;;;;
+1DAAB;SIGNWRITING ROTATION MODIFIER-12;Mn;0;NSM;;;;;N;;;;;
+1DAAC;SIGNWRITING ROTATION MODIFIER-13;Mn;0;NSM;;;;;N;;;;;
+1DAAD;SIGNWRITING ROTATION MODIFIER-14;Mn;0;NSM;;;;;N;;;;;
+1DAAE;SIGNWRITING ROTATION MODIFIER-15;Mn;0;NSM;;;;;N;;;;;
+1DAAF;SIGNWRITING ROTATION MODIFIER-16;Mn;0;NSM;;;;;N;;;;;
1E800;MENDE KIKAKUI SYLLABLE M001 KI;Lo;0;R;;;;;N;;;;;
1E801;MENDE KIKAKUI SYLLABLE M002 KA;Lo;0;R;;;;;N;;;;;
1E802;MENDE KIKAKUI SYLLABLE M003 KU;Lo;0;R;;;;;N;;;;;
@@ -25108,6 +27011,9 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F32A;CLOUD WITH TORNADO;So;0;ON;;;;;N;;;;;
1F32B;FOG;So;0;ON;;;;;N;;;;;
1F32C;WIND BLOWING FACE;So;0;ON;;;;;N;;;;;
+1F32D;HOT DOG;So;0;ON;;;;;N;;;;;
+1F32E;TACO;So;0;ON;;;;;N;;;;;
+1F32F;BURRITO;So;0;ON;;;;;N;;;;;
1F330;CHESTNUT;So;0;ON;;;;;N;;;;;
1F331;SEEDLING;So;0;ON;;;;;N;;;;;
1F332;EVERGREEN TREE;So;0;ON;;;;;N;;;;;
@@ -25186,6 +27092,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F37B;CLINKING BEER MUGS;So;0;ON;;;;;N;;;;;
1F37C;BABY BOTTLE;So;0;ON;;;;;N;;;;;
1F37D;FORK AND KNIFE WITH PLATE;So;0;ON;;;;;N;;;;;
+1F37E;BOTTLE WITH POPPING CORK;So;0;ON;;;;;N;;;;;
+1F37F;POPCORN;So;0;ON;;;;;N;;;;;
1F380;RIBBON;So;0;ON;;;;;N;;;;;
1F381;WRAPPED PRESENT;So;0;ON;;;;;N;;;;;
1F382;BIRTHDAY CAKE;So;0;ON;;;;;N;;;;;
@@ -25265,6 +27173,11 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F3CC;GOLFER;So;0;ON;;;;;N;;;;;
1F3CD;RACING MOTORCYCLE;So;0;ON;;;;;N;;;;;
1F3CE;RACING CAR;So;0;ON;;;;;N;;;;;
+1F3CF;CRICKET BAT AND BALL;So;0;ON;;;;;N;;;;;
+1F3D0;VOLLEYBALL;So;0;ON;;;;;N;;;;;
+1F3D1;FIELD HOCKEY STICK AND BALL;So;0;ON;;;;;N;;;;;
+1F3D2;ICE HOCKEY STICK AND PUCK;So;0;ON;;;;;N;;;;;
+1F3D3;TABLE TENNIS PADDLE AND BALL;So;0;ON;;;;;N;;;;;
1F3D4;SNOW CAPPED MOUNTAIN;So;0;ON;;;;;N;;;;;
1F3D5;CAMPING;So;0;ON;;;;;N;;;;;
1F3D6;BEACH WITH UMBRELLA;So;0;ON;;;;;N;;;;;
@@ -25301,6 +27214,14 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F3F5;ROSETTE;So;0;ON;;;;;N;;;;;
1F3F6;BLACK ROSETTE;So;0;ON;;;;;N;;;;;
1F3F7;LABEL;So;0;ON;;;;;N;;;;;
+1F3F8;BADMINTON RACQUET AND SHUTTLECOCK;So;0;ON;;;;;N;;;;;
+1F3F9;BOW AND ARROW;So;0;ON;;;;;N;;;;;
+1F3FA;AMPHORA;So;0;ON;;;;;N;;;;;
+1F3FB;EMOJI MODIFIER FITZPATRICK TYPE-1-2;Sk;0;ON;;;;;N;;;;;
+1F3FC;EMOJI MODIFIER FITZPATRICK TYPE-3;Sk;0;ON;;;;;N;;;;;
+1F3FD;EMOJI MODIFIER FITZPATRICK TYPE-4;Sk;0;ON;;;;;N;;;;;
+1F3FE;EMOJI MODIFIER FITZPATRICK TYPE-5;Sk;0;ON;;;;;N;;;;;
+1F3FF;EMOJI MODIFIER FITZPATRICK TYPE-6;Sk;0;ON;;;;;N;;;;;
1F400;RAT;So;0;ON;;;;;N;;;;;
1F401;MOUSE;So;0;ON;;;;;N;;;;;
1F402;OX;So;0;ON;;;;;N;;;;;
@@ -25556,6 +27477,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F4FC;VIDEOCASSETTE;So;0;ON;;;;;N;;;;;
1F4FD;FILM PROJECTOR;So;0;ON;;;;;N;;;;;
1F4FE;PORTABLE STEREO;So;0;ON;;;;;N;;;;;
+1F4FF;PRAYER BEADS;So;0;ON;;;;;N;;;;;
1F500;TWISTED RIGHTWARDS ARROWS;So;0;ON;;;;;N;;;;;
1F501;CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS;So;0;ON;;;;;N;;;;;
1F502;CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY;So;0;ON;;;;;N;;;;;
@@ -25631,6 +27553,11 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F548;CELTIC CROSS;So;0;ON;;;;;N;;;;;
1F549;OM SYMBOL;So;0;ON;;;;;N;;;;;
1F54A;DOVE OF PEACE;So;0;ON;;;;;N;;;;;
+1F54B;KAABA;So;0;ON;;;;;N;;;;;
+1F54C;MOSQUE;So;0;ON;;;;;N;;;;;
+1F54D;SYNAGOGUE;So;0;ON;;;;;N;;;;;
+1F54E;MENORAH WITH NINE BRANCHES;So;0;ON;;;;;N;;;;;
+1F54F;BOWL OF HYGIEIA;So;0;ON;;;;;N;;;;;
1F550;CLOCK FACE ONE OCLOCK;So;0;ON;;;;;N;;;;;
1F551;CLOCK FACE TWO OCLOCK;So;0;ON;;;;;N;;;;;
1F552;CLOCK FACE THREE OCLOCK;So;0;ON;;;;;N;;;;;
@@ -25872,6 +27799,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F640;WEARY CAT FACE;So;0;ON;;;;;N;;;;;
1F641;SLIGHTLY FROWNING FACE;So;0;ON;;;;;N;;;;;
1F642;SLIGHTLY SMILING FACE;So;0;ON;;;;;N;;;;;
+1F643;UPSIDE-DOWN FACE;So;0;ON;;;;;N;;;;;
+1F644;FACE WITH ROLLING EYES;So;0;ON;;;;;N;;;;;
1F645;FACE WITH NO GOOD GESTURE;So;0;ON;;;;;N;;;;;
1F646;FACE WITH OK GESTURE;So;0;ON;;;;;N;;;;;
1F647;PERSON BOWING DEEPLY;So;0;ON;;;;;N;;;;;
@@ -26011,6 +27940,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F6CD;SHOPPING BAGS;So;0;ON;;;;;N;;;;;
1F6CE;BELLHOP BELL;So;0;ON;;;;;N;;;;;
1F6CF;BED;So;0;ON;;;;;N;;;;;
+1F6D0;PLACE OF WORSHIP;So;0;ON;;;;;N;;;;;
1F6E0;HAMMER AND WRENCH;So;0;ON;;;;;N;;;;;
1F6E1;SHIELD;So;0;ON;;;;;N;;;;;
1F6E2;OIL DRUM;So;0;ON;;;;;N;;;;;
@@ -26377,12 +28307,29 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;;
1F8AB;RIGHTWARDS FRONT-TILTED SHADOWED WHITE ARROW;So;0;ON;;;;;N;;;;;
1F8AC;WHITE ARROW SHAFT WIDTH ONE;So;0;ON;;;;;N;;;;;
1F8AD;WHITE ARROW SHAFT WIDTH TWO THIRDS;So;0;ON;;;;;N;;;;;
+1F910;ZIPPER-MOUTH FACE;So;0;ON;;;;;N;;;;;
+1F911;MONEY-MOUTH FACE;So;0;ON;;;;;N;;;;;
+1F912;FACE WITH THERMOMETER;So;0;ON;;;;;N;;;;;
+1F913;NERD FACE;So;0;ON;;;;;N;;;;;
+1F914;THINKING FACE;So;0;ON;;;;;N;;;;;
+1F915;FACE WITH HEAD-BANDAGE;So;0;ON;;;;;N;;;;;
+1F916;ROBOT FACE;So;0;ON;;;;;N;;;;;
+1F917;HUGGING FACE;So;0;ON;;;;;N;;;;;
+1F918;SIGN OF THE HORNS;So;0;ON;;;;;N;;;;;
+1F980;CRAB;So;0;ON;;;;;N;;;;;
+1F981;LION FACE;So;0;ON;;;;;N;;;;;
+1F982;SCORPION;So;0;ON;;;;;N;;;;;
+1F983;TURKEY;So;0;ON;;;;;N;;;;;
+1F984;UNICORN FACE;So;0;ON;;;;;N;;;;;
+1F9C0;CHEESE WEDGE;So;0;ON;;;;;N;;;;;
20000;<CJK Ideograph Extension B, First>;Lo;0;L;;;;;N;;;;;
2A6D6;<CJK Ideograph Extension B, Last>;Lo;0;L;;;;;N;;;;;
2A700;<CJK Ideograph Extension C, First>;Lo;0;L;;;;;N;;;;;
2B734;<CJK Ideograph Extension C, Last>;Lo;0;L;;;;;N;;;;;
2B740;<CJK Ideograph Extension D, First>;Lo;0;L;;;;;N;;;;;
2B81D;<CJK Ideograph Extension D, Last>;Lo;0;L;;;;;N;;;;;
+2B820;<CJK Ideograph Extension E, First>;Lo;0;L;;;;;N;;;;;
+2CEA1;<CJK Ideograph Extension E, Last>;Lo;0;L;;;;;N;;;;;
2F800;CJK COMPATIBILITY IDEOGRAPH-2F800;Lo;0;L;4E3D;;;;N;;;;;
2F801;CJK COMPATIBILITY IDEOGRAPH-2F801;Lo;0;L;4E38;;;;N;;;;;
2F802;CJK COMPATIBILITY IDEOGRAPH-2F802;Lo;0;L;4E41;;;;N;;;;;
diff --git a/util/unicode/data/WordBreakProperty.txt b/util/unicode/data/WordBreakProperty.txt
index 6135aeabde..dc8e82020f 100644
--- a/util/unicode/data/WordBreakProperty.txt
+++ b/util/unicode/data/WordBreakProperty.txt
@@ -1,8 +1,8 @@
-# WordBreakProperty-7.0.0.txt
-# Date: 2014-02-19, 15:51:39 GMT [MD]
+# WordBreakProperty-8.0.0.txt
+# Date: 2015-02-14, 10:26:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
@@ -89,7 +89,7 @@ FB46..FB4F ; Hebrew_Letter # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW
0825..0827 ; Extend # Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U
0829..082D ; Extend # Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA
0859..085B ; Extend # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK
-08E4..0902 ; Extend # Mn [31] ARABIC CURLY FATHA..DEVANAGARI SIGN ANUSVARA
+08E3..0902 ; Extend # Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA
0903 ; Extend # Mc DEVANAGARI SIGN VISARGA
093A ; Extend # Mn DEVANAGARI VOWEL SIGN OE
093B ; Extend # Mc DEVANAGARI VOWEL SIGN OOE
@@ -252,8 +252,6 @@ FB46..FB4F ; Hebrew_Letter # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW
1932 ; Extend # Mn LIMBU SMALL LETTER ANUSVARA
1933..1938 ; Extend # Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA
1939..193B ; Extend # Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I
-19B0..19C0 ; Extend # Mc [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY
-19C8..19C9 ; Extend # Mc [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2
1A17..1A18 ; Extend # Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U
1A19..1A1A ; Extend # Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O
1A1B ; Extend # Mn BUGINESE VOWEL SIGN AE
@@ -327,7 +325,7 @@ FB46..FB4F ; Hebrew_Letter # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW
A66F ; Extend # Mn COMBINING CYRILLIC VZMET
A670..A672 ; Extend # Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN
A674..A67D ; Extend # Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK
-A69F ; Extend # Mn COMBINING CYRILLIC LETTER IOTIFIED E
+A69E..A69F ; Extend # Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E
A6F0..A6F1 ; Extend # Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
A802 ; Extend # Mn SYLOTI NAGRI SIGN DVISVARA
A806 ; Extend # Mn SYLOTI NAGRI SIGN HASANTA
@@ -381,7 +379,7 @@ ABEC ; Extend # Mc MEETEI MAYEK LUM IYEK
ABED ; Extend # Mn MEETEI MAYEK APUN IYEK
FB1E ; Extend # Mn HEBREW POINT JUDEO-SPANISH VARIKA
FE00..FE0F ; Extend # Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
-FE20..FE2D ; Extend # Mn [14] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON BELOW
+FE20..FE2F ; Extend # Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
101FD ; Extend # Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE
102E0 ; Extend # Mn COPTIC EPACT THOUSANDS MARK
@@ -412,6 +410,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
111B3..111B5 ; Extend # Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II
111B6..111BE ; Extend # Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O
111BF..111C0 ; Extend # Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA
+111CA..111CC ; Extend # Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK
1122C..1122E ; Extend # Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II
1122F..11231 ; Extend # Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI
11232..11233 ; Extend # Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU
@@ -421,7 +420,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
112DF ; Extend # Mn KHUDAWADI SIGN ANUSVARA
112E0..112E2 ; Extend # Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II
112E3..112EA ; Extend # Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA
-11301 ; Extend # Mn GRANTHA SIGN CANDRABINDU
+11300..11301 ; Extend # Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU
11302..11303 ; Extend # Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA
1133C ; Extend # Mn GRANTHA SIGN NUKTA
1133E..1133F ; Extend # Mc [2] GRANTHA VOWEL SIGN AA..GRANTHA VOWEL SIGN I
@@ -447,6 +446,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
115BC..115BD ; Extend # Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA
115BE ; Extend # Mc SIDDHAM SIGN VISARGA
115BF..115C0 ; Extend # Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA
+115DC..115DD ; Extend # Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU
11630..11632 ; Extend # Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II
11633..1163A ; Extend # Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI
1163B..1163C ; Extend # Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU
@@ -460,6 +460,11 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
116B0..116B5 ; Extend # Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU
116B6 ; Extend # Mc TAKRI SIGN VIRAMA
116B7 ; Extend # Mn TAKRI SIGN NUKTA
+1171D..1171F ; Extend # Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA
+11720..11721 ; Extend # Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA
+11722..11725 ; Extend # Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU
+11726 ; Extend # Mc AHOM VOWEL SIGN E
+11727..1172B ; Extend # Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER
16AF0..16AF4 ; Extend # Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE
16B30..16B36 ; Extend # Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM
16F51..16F7E ; Extend # Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG
@@ -472,10 +477,16 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT
1D185..1D18B ; Extend # Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
1D1AA..1D1AD ; Extend # Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
1D242..1D244 ; Extend # Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
+1DA00..1DA36 ; Extend # Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
+1DA3B..1DA6C ; Extend # Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
+1DA75 ; Extend # Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
+1DA84 ; Extend # Mn SIGNWRITING LOCATION HEAD NECK
+1DA9B..1DA9F ; Extend # Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF ; Extend # Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
1E8D0..1E8D6 ; Extend # Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS
E0100..E01EF ; Extend # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
-# Total code points: 1834
+# Total code points: 1967
# ================================================
@@ -583,7 +594,7 @@ FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAK
0824 ; ALetter # Lm SAMARITAN MODIFIER LETTER SHORT A
0828 ; ALetter # Lm SAMARITAN MODIFIER LETTER I
0840..0858 ; ALetter # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN
-08A0..08B2 ; ALetter # Lo [19] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER ZAIN WITH INVERTED V ABOVE
+08A0..08B4 ; ALetter # Lo [21] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER KAF WITH DOT BELOW
0904..0939 ; ALetter # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA
093D ; ALetter # Lo DEVANAGARI SIGN AVAGRAHA
0950 ; ALetter # Lo DEVANAGARI OM
@@ -620,6 +631,7 @@ FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAK
0ABD ; ALetter # Lo GUJARATI SIGN AVAGRAHA
0AD0 ; ALetter # Lo GUJARATI OM
0AE0..0AE1 ; ALetter # Lo [2] GUJARATI LETTER VOCALIC RR..GUJARATI LETTER VOCALIC LL
+0AF9 ; ALetter # Lo GUJARATI LETTER ZHA
0B05..0B0C ; ALetter # Lo [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L
0B0F..0B10 ; ALetter # Lo [2] ORIYA LETTER E..ORIYA LETTER AI
0B13..0B28 ; ALetter # Lo [22] ORIYA LETTER O..ORIYA LETTER NA
@@ -646,7 +658,7 @@ FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAK
0C12..0C28 ; ALetter # Lo [23] TELUGU LETTER O..TELUGU LETTER NA
0C2A..0C39 ; ALetter # Lo [16] TELUGU LETTER PA..TELUGU LETTER HA
0C3D ; ALetter # Lo TELUGU SIGN AVAGRAHA
-0C58..0C59 ; ALetter # Lo [2] TELUGU LETTER TSA..TELUGU LETTER DZA
+0C58..0C5A ; ALetter # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA
0C60..0C61 ; ALetter # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
0C85..0C8C ; ALetter # Lo [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L
0C8E..0C90 ; ALetter # Lo [3] KANNADA LETTER E..KANNADA LETTER AI
@@ -662,7 +674,7 @@ FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAK
0D12..0D3A ; ALetter # Lo [41] MALAYALAM LETTER O..MALAYALAM LETTER TTTA
0D3D ; ALetter # Lo MALAYALAM SIGN AVAGRAHA
0D4E ; ALetter # Lo MALAYALAM LETTER DOT REPH
-0D60..0D61 ; ALetter # Lo [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL
+0D5F..0D61 ; ALetter # Lo [3] MALAYALAM LETTER ARCHAIC II..MALAYALAM LETTER VOCALIC LL
0D7A..0D7F ; ALetter # Lo [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K
0D85..0D96 ; ALetter # Lo [18] SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA
0D9A..0DB1 ; ALetter # Lo [24] SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA
@@ -695,7 +707,8 @@ FF71..FF9D ; Katakana # Lo [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAK
1312..1315 ; ALetter # Lo [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE
1318..135A ; ALetter # Lo [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA
1380..138F ; ALetter # Lo [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE
-13A0..13F4 ; ALetter # Lo [85] CHEROKEE LETTER A..CHEROKEE LETTER YV
+13A0..13F5 ; ALetter # L& [86] CHEROKEE LETTER A..CHEROKEE LETTER MV
+13F8..13FD ; ALetter # L& [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
1401..166C ; ALetter # Lo [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA
166F..167F ; ALetter # Lo [17] CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS BLACKFOOT W
1681..169A ; ALetter # Lo [26] OGHAM LETTER BEITH..OGHAM LETTER PEITH
@@ -825,8 +838,9 @@ A770 ; ALetter # Lm MODIFIER LETTER US
A771..A787 ; ALetter # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T
A788 ; ALetter # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT
A78B..A78E ; ALetter # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT
+A78F ; ALetter # Lo LATIN LETTER SINOLOGICAL DOT
A790..A7AD ; ALetter # L& [30] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER L WITH BELT
-A7B0..A7B1 ; ALetter # L& [2] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER TURNED T
+A7B0..A7B7 ; ALetter # L& [8] LATIN CAPITAL LETTER TURNED K..LATIN SMALL LETTER OMEGA
A7F7 ; ALetter # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I
A7F8..A7F9 ; ALetter # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE
A7FA ; ALetter # L& LATIN LETTER SMALL CAPITAL TURNED M
@@ -838,6 +852,7 @@ A840..A873 ; ALetter # Lo [52] PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABIN
A882..A8B3 ; ALetter # Lo [50] SAURASHTRA LETTER A..SAURASHTRA LETTER LLA
A8F2..A8F7 ; ALetter # Lo [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
A8FB ; ALetter # Lo DEVANAGARI HEADSTROKE
+A8FD ; ALetter # Lo DEVANAGARI JAIN OM
A90A..A925 ; ALetter # Lo [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO
A930..A946 ; ALetter # Lo [23] REJANG LETTER KA..REJANG LETTER A
A960..A97C ; ALetter # Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH
@@ -856,7 +871,8 @@ AB20..AB26 ; ALetter # Lo [7] ETHIOPIC SYLLABLE CCHHA..ETHIOPIC SYLLABLE CC
AB28..AB2E ; ALetter # Lo [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SYLLABLE BBO
AB30..AB5A ; ALetter # L& [43] LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG
AB5C..AB5F ; ALetter # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK
-AB64..AB65 ; ALetter # L& [2] LATIN SMALL LETTER INVERTED ALPHA..GREEK LETTER SMALL CAPITAL OMEGA
+AB60..AB65 ; ALetter # L& [6] LATIN SMALL LETTER SAKHA YAT..GREEK LETTER SMALL CAPITAL OMEGA
+AB70..ABBF ; ALetter # L& [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
ABC0..ABE2 ; ALetter # Lo [35] MEETEI MAYEK LETTER KOK..MEETEI MAYEK LETTER I LONSUM
AC00..D7A3 ; ALetter # Lo [11172] HANGUL SYLLABLE GA..HANGUL SYLLABLE HIH
D7B0..D7C6 ; ALetter # Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E
@@ -912,6 +928,8 @@ FFDA..FFDC ; ALetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
1083F..10855 ; ALetter # Lo [23] CYPRIOT SYLLABLE ZO..IMPERIAL ARAMAIC LETTER TAW
10860..10876 ; ALetter # Lo [23] PALMYRENE LETTER ALEPH..PALMYRENE LETTER TAW
10880..1089E ; ALetter # Lo [31] NABATAEAN LETTER FINAL ALEPH..NABATAEAN LETTER TAW
+108E0..108F2 ; ALetter # Lo [19] HATRAN LETTER ALEPH..HATRAN LETTER QOPH
+108F4..108F5 ; ALetter # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW
10900..10915 ; ALetter # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU
10920..10939 ; ALetter # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C
10980..109B7 ; ALetter # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA
@@ -929,6 +947,8 @@ FFDA..FFDC ; ALetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
10B60..10B72 ; ALetter # Lo [19] INSCRIPTIONAL PAHLAVI LETTER ALEPH..INSCRIPTIONAL PAHLAVI LETTER TAW
10B80..10B91 ; ALetter # Lo [18] PSALTER PAHLAVI LETTER ALEPH..PSALTER PAHLAVI LETTER TAW
10C00..10C48 ; ALetter # Lo [73] OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTER ORKHON BASH
+10C80..10CB2 ; ALetter # L& [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
+10CC0..10CF2 ; ALetter # L& [51] OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US
11003..11037 ; ALetter # Lo [53] BRAHMI SIGN JIHVAMULIYA..BRAHMI LETTER OLD TAMIL NNNA
11083..110AF ; ALetter # Lo [45] KAITHI LETTER A..KAITHI LETTER HA
110D0..110E8 ; ALetter # Lo [25] SORA SOMPENG LETTER SAH..SORA SOMPENG LETTER MAE
@@ -938,8 +958,14 @@ FFDA..FFDC ; ALetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
11183..111B2 ; ALetter # Lo [48] SHARADA LETTER A..SHARADA LETTER HA
111C1..111C4 ; ALetter # Lo [4] SHARADA SIGN AVAGRAHA..SHARADA OM
111DA ; ALetter # Lo SHARADA EKAM
+111DC ; ALetter # Lo SHARADA HEADSTROKE
11200..11211 ; ALetter # Lo [18] KHOJKI LETTER A..KHOJKI LETTER JJA
11213..1122B ; ALetter # Lo [25] KHOJKI LETTER NYA..KHOJKI LETTER LLA
+11280..11286 ; ALetter # Lo [7] MULTANI LETTER A..MULTANI LETTER GA
+11288 ; ALetter # Lo MULTANI LETTER GHA
+1128A..1128D ; ALetter # Lo [4] MULTANI LETTER CA..MULTANI LETTER JJA
+1128F..1129D ; ALetter # Lo [15] MULTANI LETTER NYA..MULTANI LETTER BA
+1129F..112A8 ; ALetter # Lo [10] MULTANI LETTER BHA..MULTANI LETTER RHA
112B0..112DE ; ALetter # Lo [47] KHUDAWADI LETTER A..KHUDAWADI LETTER HA
11305..1130C ; ALetter # Lo [8] GRANTHA LETTER A..GRANTHA LETTER VOCALIC L
1130F..11310 ; ALetter # Lo [2] GRANTHA LETTER EE..GRANTHA LETTER AI
@@ -948,20 +974,24 @@ FFDA..FFDC ; ALetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
11332..11333 ; ALetter # Lo [2] GRANTHA LETTER LA..GRANTHA LETTER LLA
11335..11339 ; ALetter # Lo [5] GRANTHA LETTER VA..GRANTHA LETTER HA
1133D ; ALetter # Lo GRANTHA SIGN AVAGRAHA
+11350 ; ALetter # Lo GRANTHA OM
1135D..11361 ; ALetter # Lo [5] GRANTHA SIGN PLUTA..GRANTHA LETTER VOCALIC LL
11480..114AF ; ALetter # Lo [48] TIRHUTA ANJI..TIRHUTA LETTER HA
114C4..114C5 ; ALetter # Lo [2] TIRHUTA SIGN AVAGRAHA..TIRHUTA GVANG
114C7 ; ALetter # Lo TIRHUTA OM
11580..115AE ; ALetter # Lo [47] SIDDHAM LETTER A..SIDDHAM LETTER HA
+115D8..115DB ; ALetter # Lo [4] SIDDHAM LETTER THREE-CIRCLE ALTERNATE I..SIDDHAM LETTER ALTERNATE U
11600..1162F ; ALetter # Lo [48] MODI LETTER A..MODI LETTER LLA
11644 ; ALetter # Lo MODI SIGN HUVA
11680..116AA ; ALetter # Lo [43] TAKRI LETTER A..TAKRI LETTER RRA
118A0..118DF ; ALetter # L& [64] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI SMALL LETTER VIYO
118FF ; ALetter # Lo WARANG CITI OM
11AC0..11AF8 ; ALetter # Lo [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL
-12000..12398 ; ALetter # Lo [921] CUNEIFORM SIGN A..CUNEIFORM SIGN UM TIMES ME
+12000..12399 ; ALetter # Lo [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U
12400..1246E ; ALetter # Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM
+12480..12543 ; ALetter # Lo [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU
13000..1342E ; ALetter # Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032
+14400..14646 ; ALetter # Lo [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530
16800..16A38 ; ALetter # Lo [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ
16A40..16A5E ; ALetter # Lo [31] MRO LETTER TA..MRO LETTER TEK
16AD0..16AED ; ALetter # Lo [30] BASSA VAH LETTER ENNI..BASSA VAH LETTER I
@@ -1044,7 +1074,7 @@ FFDA..FFDC ; ALetter # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL
1F150..1F169 ; ALetter # So [26] NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z
1F170..1F189 ; ALetter # So [26] NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER Z
-# Total code points: 26647
+# Total code points: 27697
# ================================================
@@ -1139,12 +1169,13 @@ ABF0..ABF9 ; Numeric # Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT N
114D0..114D9 ; Numeric # Nd [10] TIRHUTA DIGIT ZERO..TIRHUTA DIGIT NINE
11650..11659 ; Numeric # Nd [10] MODI DIGIT ZERO..MODI DIGIT NINE
116C0..116C9 ; Numeric # Nd [10] TAKRI DIGIT ZERO..TAKRI DIGIT NINE
+11730..11739 ; Numeric # Nd [10] AHOM DIGIT ZERO..AHOM DIGIT NINE
118E0..118E9 ; Numeric # Nd [10] WARANG CITI DIGIT ZERO..WARANG CITI DIGIT NINE
16A60..16A69 ; Numeric # Nd [10] MRO DIGIT ZERO..MRO DIGIT NINE
16B50..16B59 ; Numeric # Nd [10] PAHAWH HMONG DIGIT ZERO..PAHAWH HMONG DIGIT NINE
1D7CE..1D7FF ; Numeric # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
-# Total code points: 531
+# Total code points: 541
# ================================================
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 2f6e28bd9f..d1713795dd 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -43,8 +43,8 @@
#include <private/qunicodetables_p.h>
#endif
-#define DATA_VERSION_S "7.0"
-#define DATA_VERSION_STR "QChar::Unicode_7_0"
+#define DATA_VERSION_S "8.0"
+#define DATA_VERSION_STR "QChar::Unicode_8_0"
static QHash<QByteArray, QChar::UnicodeVersion> age_map;
@@ -71,6 +71,7 @@ static void initAgeMap()
{ QChar::Unicode_6_2, "6.2" },
{ QChar::Unicode_6_3, "6.3" },
{ QChar::Unicode_7_0, "7.0" },
+ { QChar::Unicode_8_0, "8.0" },
{ QChar::Unicode_Unassigned, 0 }
};
AgeMap *d = ageMap;
@@ -719,6 +720,13 @@ static void initScriptMap()
{ QChar::Script_Khudawadi, "Khudawadi" },
{ QChar::Script_Tirhuta, "Tirhuta" },
{ QChar::Script_WarangCiti, "WarangCiti" },
+ // 8.0
+ { QChar::Script_Ahom, "Ahom" },
+ { QChar::Script_AnatolianHieroglyphs, "AnatolianHieroglyphs" },
+ { QChar::Script_Hatran, "Hatran" },
+ { QChar::Script_Multani, "Multani" },
+ { QChar::Script_OldHungarian, "OldHungarian" },
+ { QChar::Script_SignWriting, "SignWriting" },
// unhandled
{ QChar::Script_Unknown, 0 }
};
@@ -757,6 +765,38 @@ static const char *property_string =
"};\n\n"
"Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW;\n"
"Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW;\n"
+ "\n"
+ "struct LowercaseTraits\n"
+ "{\n"
+ " static inline signed short caseDiff(const Properties *prop)\n"
+ " { return prop->lowerCaseDiff; }\n"
+ " static inline bool caseSpecial(const Properties *prop)\n"
+ " { return prop->lowerCaseSpecial; }\n"
+ "};\n"
+ "\n"
+ "struct UppercaseTraits\n"
+ "{\n"
+ " static inline signed short caseDiff(const Properties *prop)\n"
+ " { return prop->upperCaseDiff; }\n"
+ " static inline bool caseSpecial(const Properties *prop)\n"
+ " { return prop->upperCaseSpecial; }\n"
+ "};\n"
+ "\n"
+ "struct TitlecaseTraits\n"
+ "{\n"
+ " static inline signed short caseDiff(const Properties *prop)\n"
+ " { return prop->titleCaseDiff; }\n"
+ " static inline bool caseSpecial(const Properties *prop)\n"
+ " { return prop->titleCaseSpecial; }\n"
+ "};\n"
+ "\n"
+ "struct CasefoldTraits\n"
+ "{\n"
+ " static inline signed short caseDiff(const Properties *prop)\n"
+ " { return prop->caseFoldDiff; }\n"
+ " static inline bool caseSpecial(const Properties *prop)\n"
+ " { return prop->caseFoldSpecial; }\n"
+ "};\n"
"\n";
static const char *methods =
@@ -840,12 +880,14 @@ static int appendToSpecialCaseMap(const QList<int> &map)
{
QList<int> utf16map;
for (int i = 0; i < map.size(); ++i) {
- int val = map.at(i);
- if (QChar::requiresSurrogates(val)) {
- utf16map << QChar::highSurrogate(val);
- utf16map << QChar::lowSurrogate(val);
+ uint codepoint = map.at(i);
+ // if the condition below doesn't hold anymore we need to modify our special case mapping code
+ Q_ASSERT(!QChar::requiresSurrogates(codepoint));
+ if (QChar::requiresSurrogates(codepoint)) {
+ utf16map << QChar::highSurrogate(codepoint);
+ utf16map << QChar::lowSurrogate(codepoint);
} else {
- utf16map << val;
+ utf16map << codepoint;
}
}
int length = utf16map.size();
@@ -946,13 +988,16 @@ struct UnicodeData {
p.lineBreakClass = LineBreak_AL; // XX -> AL
// LineBreak.txt
// The unassigned code points that default to "ID" include ranges in the following blocks:
- // [U+3400..U+4DBF, U+4E00..U+9FFF, U+F900..U+FAFF, U+20000..U+2A6DF, U+2A700..U+2B73F, U+2B740..U+2B81F, U+2F800..U+2FA1F, U+20000..U+2FFFD, U+30000..U+3FFFD]
+ // [U+3400..U+4DBF, U+4E00..U+9FFF, U+F900..U+FAFF, U+20000..U+2A6DF, U+2A700..U+2B73F, U+2B740..U+2B81F, U+2B820..U+2CEAF, U+2F800..U+2FA1F]
+ // and any other reserved code points on
+ // [U+20000..U+2FFFD, U+30000..U+3FFFD]
if ((codepoint >= 0x3400 && codepoint <= 0x4DBF)
|| (codepoint >= 0x4E00 && codepoint <= 0x9FFF)
|| (codepoint >= 0xF900 && codepoint <= 0xFAFF)
|| (codepoint >= 0x20000 && codepoint <= 0x2A6DF)
|| (codepoint >= 0x2A700 && codepoint <= 0x2B73F)
|| (codepoint >= 0x2B740 && codepoint <= 0x2B81F)
+ || (codepoint >= 0x2B820 && codepoint <= 0x2CEAF)
|| (codepoint >= 0x2F800 && codepoint <= 0x2FA1F)
|| (codepoint >= 0x20000 && codepoint <= 0x2FFFD)
|| (codepoint >= 0x30000 && codepoint <= 0x3FFFD)) {
@@ -1122,41 +1167,39 @@ static void readUnicodeData()
int upperCase = properties[UD_UpperCase].toInt(&ok, 16);
Q_ASSERT(ok);
int diff = upperCase - codepoint;
+ // if the conditions below doesn't hold anymore we need to modify our upper casing code
+ Q_ASSERT(QChar::requiresSurrogates(codepoint) == QChar::requiresSurrogates(upperCase));
+ if (QChar::requiresSurrogates(codepoint)) {
+ Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(upperCase));
+ Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(upperCase));
+ }
if (qAbs(diff) >= (1<<13)) {
qWarning() << "upperCaseDiff exceeded (" << hex << codepoint << "->" << upperCase << "); map it for special case";
- // if the condition below doesn't hold anymore we need to modify our special upper casing code in qchar.cpp
- Q_ASSERT(!QChar::requiresSurrogates(codepoint) && !QChar::requiresSurrogates(upperCase));
data.p.upperCaseSpecial = true;
data.p.upperCaseDiff = appendToSpecialCaseMap(QList<int>() << upperCase);
} else {
data.p.upperCaseDiff = diff;
maxUpperCaseDiff = qMax(maxUpperCaseDiff, qAbs(diff));
}
- if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(upperCase)) {
- // if the conditions below doesn't hold anymore we need to modify our upper casing code
- Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(upperCase));
- Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(upperCase));
- }
}
if (!properties[UD_LowerCase].isEmpty()) {
int lowerCase = properties[UD_LowerCase].toInt(&ok, 16);
Q_ASSERT(ok);
int diff = lowerCase - codepoint;
+ // if the conditions below doesn't hold anymore we need to modify our lower casing code
+ Q_ASSERT(QChar::requiresSurrogates(codepoint) == QChar::requiresSurrogates(lowerCase));
+ if (QChar::requiresSurrogates(codepoint)) {
+ Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(lowerCase));
+ Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(lowerCase));
+ }
if (qAbs(diff) >= (1<<13)) {
qWarning() << "lowerCaseDiff exceeded (" << hex << codepoint << "->" << lowerCase << "); map it for special case";
- // if the condition below doesn't hold anymore we need to modify our special lower casing code in qchar.cpp
- Q_ASSERT(!QChar::requiresSurrogates(codepoint) && !QChar::requiresSurrogates(lowerCase));
data.p.lowerCaseSpecial = true;
data.p.lowerCaseDiff = appendToSpecialCaseMap(QList<int>() << lowerCase);
} else {
data.p.lowerCaseDiff = diff;
maxLowerCaseDiff = qMax(maxLowerCaseDiff, qAbs(diff));
}
- if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(lowerCase)) {
- // if the conditions below doesn't hold anymore we need to modify our lower casing code
- Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(lowerCase));
- Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(lowerCase));
- }
}
// we want toTitleCase to map to ToUpper in case we don't have any titlecase.
if (properties[UD_TitleCase].isEmpty())
@@ -1165,21 +1208,20 @@ static void readUnicodeData()
int titleCase = properties[UD_TitleCase].toInt(&ok, 16);
Q_ASSERT(ok);
int diff = titleCase - codepoint;
+ // if the conditions below doesn't hold anymore we need to modify our title casing code
+ Q_ASSERT(QChar::requiresSurrogates(codepoint) == QChar::requiresSurrogates(titleCase));
+ if (QChar::requiresSurrogates(codepoint)) {
+ Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(titleCase));
+ Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(titleCase));
+ }
if (qAbs(diff) >= (1<<13)) {
qWarning() << "titleCaseDiff exceeded (" << hex << codepoint << "->" << titleCase << "); map it for special case";
- // if the condition below doesn't hold anymore we need to modify our special title casing code in qchar.cpp
- Q_ASSERT(!QChar::requiresSurrogates(codepoint) && !QChar::requiresSurrogates(titleCase));
data.p.titleCaseSpecial = true;
data.p.titleCaseDiff = appendToSpecialCaseMap(QList<int>() << titleCase);
} else {
data.p.titleCaseDiff = diff;
maxTitleCaseDiff = qMax(maxTitleCaseDiff, qAbs(diff));
}
- if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(titleCase)) {
- // if the conditions below doesn't hold anymore we need to modify our title casing code
- Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(titleCase));
- Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(titleCase));
- }
}
if (!properties[UD_DigitValue].isEmpty())
@@ -1535,8 +1577,10 @@ static QByteArray createNormalizationCorrections()
++numCorrections;
maxVersion = qMax(c.version, maxVersion);
}
+ if (out.endsWith(",\n"))
+ out.chop(2);
- out += "};\n\n"
+ out += "\n};\n\n"
"enum { NumNormalizationCorrections = " + QByteArray::number(numCorrections) + " };\n"
"enum { NormalizationCorrectionsVersionMax = " + QByteArray::number(maxVersion) + " };\n\n";
@@ -1731,23 +1775,20 @@ static void readCaseFolding()
if (foldMap.size() == 1) {
int caseFolded = foldMap.at(0);
int diff = caseFolded - codepoint;
+ // if the conditions below doesn't hold anymore we need to modify our case folding code
+ Q_ASSERT(QChar::requiresSurrogates(codepoint) == QChar::requiresSurrogates(caseFolded));
+ if (QChar::requiresSurrogates(codepoint)) {
+ Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(caseFolded));
+ Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(caseFolded));
+ }
if (qAbs(diff) >= (1<<13)) {
qWarning() << "caseFoldDiff exceeded (" << hex << codepoint << "->" << caseFolded << "); map it for special case";
- // if the condition below doesn't hold anymore we need to modify our special case folding code in qchar.cpp
- Q_ASSERT(!QChar::requiresSurrogates(codepoint) && !QChar::requiresSurrogates(caseFolded));
ud.p.caseFoldSpecial = true;
ud.p.caseFoldDiff = appendToSpecialCaseMap(foldMap);
} else {
ud.p.caseFoldDiff = diff;
maxCaseFoldDiff = qMax(maxCaseFoldDiff, qAbs(diff));
}
- if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(caseFolded)) {
- // if the conditions below doesn't hold anymore we need to modify our case folding code
- Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(caseFolded));
- Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(caseFolded));
- }
-// if (caseFolded != codepoint + ud.p.lowerCaseDiff)
-// qDebug() << hex << codepoint;
} else {
qFatal("we currently don't support full case foldings");
// qDebug() << "special" << hex << foldMap;
@@ -2290,7 +2331,7 @@ static QByteArray createPropertyInfo()
out += "static const unsigned short uc_property_trie[] = {\n";
// first write the map
- out += " // 0 - 0x" + QByteArray::number(BMP_END, 16);
+ out += " // [0x0..0x" + QByteArray::number(BMP_END, 16) + ")";
for (int i = 0; i < BMP_END/BMP_BLOCKSIZE; ++i) {
if (!(i % 8)) {
if (out.endsWith(' '))
@@ -2304,7 +2345,7 @@ static QByteArray createPropertyInfo()
}
if (out.endsWith(' '))
out.chop(1);
- out += "\n\n // 0x" + QByteArray::number(BMP_END, 16) + " - 0x" + QByteArray::number(SMP_END, 16) + "\n";
+ out += "\n\n // [0x" + QByteArray::number(BMP_END, 16) + "..0x" + QByteArray::number(SMP_END, 16) + ")\n";
for (int i = BMP_END/BMP_BLOCKSIZE; i < blockMap.size(); ++i) {
if (!(i % 8)) {
if (out.endsWith(' '))
@@ -2335,8 +2376,8 @@ static QByteArray createPropertyInfo()
out += ", ";
}
}
- if (out.endsWith(' '))
- out.chop(1);
+ if (out.endsWith(", "))
+ out.chop(2);
out += "\n};\n\n";
out += "#define GET_PROP_INDEX(ucs4) \\\n"
@@ -2419,20 +2460,19 @@ static QByteArray createPropertyInfo()
out += QByteArray::number( p.script );
out += " },";
}
- out.chop(1);
+ if (out.endsWith(','))
+ out.chop(1);
out += "\n};\n\n";
out += "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) Q_DECL_NOTHROW\n"
"{\n"
- " const int index = GET_PROP_INDEX(ucs4);\n"
- " return uc_properties + index;\n"
+ " return uc_properties + GET_PROP_INDEX(ucs4);\n"
"}\n"
"\n"
"Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) Q_DECL_NOTHROW\n"
"{\n"
- " const int index = GET_PROP_INDEX_UCS2(ucs2);\n"
- " return uc_properties + index;\n"
+ " return uc_properties + GET_PROP_INDEX_UCS2(ucs2);\n"
"}\n"
"\n"
"Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW\n"
@@ -2447,22 +2487,22 @@ static QByteArray createPropertyInfo()
out += "Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
"{\n"
- " return (GraphemeBreakClass)qGetProp(ucs4)->graphemeBreakClass;\n"
+ " return static_cast<GraphemeBreakClass>(qGetProp(ucs4)->graphemeBreakClass);\n"
"}\n"
"\n"
"Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
"{\n"
- " return (WordBreakClass)qGetProp(ucs4)->wordBreakClass;\n"
+ " return static_cast<WordBreakClass>(qGetProp(ucs4)->wordBreakClass);\n"
"}\n"
"\n"
"Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
"{\n"
- " return (SentenceBreakClass)qGetProp(ucs4)->sentenceBreakClass;\n"
+ " return static_cast<SentenceBreakClass>(qGetProp(ucs4)->sentenceBreakClass);\n"
"}\n"
"\n"
"Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
"{\n"
- " return (LineBreakClass)qGetProp(ucs4)->lineBreakClass;\n"
+ " return static_cast<LineBreakClass>(qGetProp(ucs4)->lineBreakClass);\n"
"}\n"
"\n";
@@ -2475,7 +2515,7 @@ static QByteArray createSpecialCaseMap()
QByteArray out;
- out += "static const ushort specialCaseMap[] = {\n"
+ out += "static const unsigned short specialCaseMap[] = {\n"
" 0x0, // placeholder";
int i = 1;
while (i < specialCaseMap.size()) {
@@ -2675,10 +2715,10 @@ static QByteArray createCompositionInfo()
" (ucs4 < 0x" + QByteArray::number(BMP_END, 16) + " \\\n"
" ? (uc_decomposition_trie[uc_decomposition_trie[ucs4>>" + QByteArray::number(BMP_SHIFT) +
"] + (ucs4 & 0x" + QByteArray::number(BMP_BLOCKSIZE-1, 16)+ ")]) \\\n"
- " : (ucs4 < 0x" + QByteArray::number(SMP_END, 16) + "\\\n"
+ " : (ucs4 < 0x" + QByteArray::number(SMP_END, 16) + " \\\n"
" ? uc_decomposition_trie[uc_decomposition_trie[((ucs4 - 0x" + QByteArray::number(BMP_END, 16) +
")>>" + QByteArray::number(SMP_SHIFT) + ") + 0x" + QByteArray::number(BMP_END/BMP_BLOCKSIZE, 16) + "]"
- " + (ucs4 & 0x" + QByteArray::number(SMP_BLOCKSIZE-1, 16) + ")]\\\n"
+ " + (ucs4 & 0x" + QByteArray::number(SMP_BLOCKSIZE-1, 16) + ")] \\\n"
" : 0xffff))\n\n";
out += "static const unsigned short uc_decomposition_map[] = {";
@@ -2874,10 +2914,10 @@ static QByteArray createLigatureInfo()
" (ucs4 < 0x" + QByteArray::number(BMP_END, 16) + " \\\n"
" ? (uc_ligature_trie[uc_ligature_trie[ucs4>>" + QByteArray::number(BMP_SHIFT) +
"] + (ucs4 & 0x" + QByteArray::number(BMP_BLOCKSIZE-1, 16)+ ")]) \\\n"
- " : (ucs4 < 0x" + QByteArray::number(SMP_END, 16) + "\\\n"
+ " : (ucs4 < 0x" + QByteArray::number(SMP_END, 16) + " \\\n"
" ? uc_ligature_trie[uc_ligature_trie[((ucs4 - 0x" + QByteArray::number(BMP_END, 16) +
")>>" + QByteArray::number(SMP_SHIFT) + ") + 0x" + QByteArray::number(BMP_END/BMP_BLOCKSIZE, 16) + "]"
- " + (ucs4 & 0x" + QByteArray::number(SMP_BLOCKSIZE-1, 16) + ")]\\\n"
+ " + (ucs4 & 0x" + QByteArray::number(SMP_BLOCKSIZE-1, 16) + ")] \\\n"
" : 0xffff))\n\n";
out += "static const unsigned short uc_ligature_map[] = {";
diff --git a/util/unicode/writingSystems.sh b/util/unicode/writingSystems.sh
index 8902d97d71..5783fe7797 100755
--- a/util/unicode/writingSystems.sh
+++ b/util/unicode/writingSystems.sh
@@ -1,5 +1,5 @@
-
#!/bin/sh
+
#############################################################################
##
## Copyright (C) 2015 The Qt Company Ltd.